From: Andrea Amorese Date: Thu, 27 Jan 2022 16:15:28 +0000 (+0100) Subject: Built motion from commit 0fc98979.|2.5.50 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22avatar.png/%22?a=commitdiff_plain;h=252153ea83088e1f29dec262a69614723feaf75c;p=motion2.git Built motion from commit 0fc98979.|2.5.50 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 00b2426..c183dd7 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-27T13:38:05.081Z", + "time": "2022-01-27T15:55:17.304Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 507bc3d..e6f9f80 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-27T13:38:05.081Z", + "time": "2022-01-27T15:55:17.304Z", "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 f6981b6..412d389 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 _0xb2f1=['getDataValue','STRING','contactManager','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xb2f1,0xee));var _0x1b2f=function(_0x271bf4,_0x122da4){_0x271bf4=_0x271bf4-0x0;var _0x50a50b=_0xb2f1[_0x271bf4];return _0x50a50b;};'use strict';var Sequelize=require(_0x1b2f('0x0'));module[_0x1b2f('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x33346a){return this[_0x1b2f('0x2')]('action');}},'action':{'type':Sequelize[_0x1b2f('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1b2f('0x4'),'integration','motionbar',_0x1b2f('0x5'),_0x1b2f('0x6'),_0x1b2f('0x7'),_0x1b2f('0x8'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x1b2f('0x9')},'data1':{'type':Sequelize[_0x1b2f('0x3')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x1b2f('0x3')](0x1000),'comment':_0x1b2f('0xa')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x1b2f('0xb')},'data4':{'type':Sequelize[_0x1b2f('0x3')](0x1000),'comments':_0x1b2f('0xc')},'data5':{'type':Sequelize[_0x1b2f('0x3')](0x1000),'comments':_0x1b2f('0xd')},'data6':{'type':Sequelize[_0x1b2f('0x3')],'comments':_0x1b2f('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':_0x1b2f('0xf')}}; \ No newline at end of file +var _0x703b=['urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','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]'];(function(_0x2206b1,_0x695410){var _0x527fee=function(_0x5cd108){while(--_0x5cd108){_0x2206b1['push'](_0x2206b1['shift']());}};_0x527fee(++_0x695410);}(_0x703b,0x1e2));var _0xb703=function(_0x457e9e,_0x372833){_0x457e9e=_0x457e9e-0x0;var _0x248cc5=_0x703b[_0x457e9e];return _0x248cc5;};'use strict';var Sequelize=require(_0xb703('0x0'));module[_0xb703('0x1')]={'name':{'type':Sequelize[_0xb703('0x2')],'get':function(_0x3ccc98){return this[_0xb703('0x3')]('action');}},'action':{'type':Sequelize[_0xb703('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb703('0x5'),_0xb703('0x6'),_0xb703('0x7'),_0xb703('0x8'),_0xb703('0x9'),_0xb703('0xa'),_0xb703('0xb'),_0xb703('0xc')]],'msg':_0xb703('0xd')}},'comment':_0xb703('0xd')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xb703('0xe')},'data2':{'type':Sequelize[_0xb703('0x4')](0x1000),'comment':_0xb703('0xf')},'data3':{'type':Sequelize['STRING'](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[_0xb703('0x4')](0x1000),'comments':_0xb703('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xb703('0x11')},'data6':{'type':Sequelize[_0xb703('0x4')],'comments':_0xb703('0x12')},'data7':{'type':Sequelize['TEXT'],'comments':_0xb703('0x13')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index de0c68c..26a7764 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 _0xae34=['body','Action','find','catch','params','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','update'];(function(_0x11fc13,_0x55d096){var _0x559da9=function(_0x41ca0a){while(--_0x41ca0a){_0x11fc13['push'](_0x11fc13['shift']());}};_0x559da9(++_0x55d096);}(_0xae34,0x12b));var _0x4ae3=function(_0x28aff4,_0x1cd4a0){_0x28aff4=_0x28aff4-0x0;var _0x55eed5=_0xae34[_0x28aff4];return _0x55eed5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ae3('0x0'));var zipdir=require(_0x4ae3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ae3('0x2'));var moment=require(_0x4ae3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4ae3('0x4'));var util=require(_0x4ae3('0x5'));var path=require(_0x4ae3('0x6'));var sox=require(_0x4ae3('0x7'));var csv=require(_0x4ae3('0x8'));var ejs=require(_0x4ae3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ae3('0xa'));var _=require('lodash');var squel=require(_0x4ae3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ae3('0xc'));var toCsv=require(_0x4ae3('0x8'));var querystring=require(_0x4ae3('0xd'));var Papa=require(_0x4ae3('0xe'));var Redis=require(_0x4ae3('0xf'));var authService=require(_0x4ae3('0x10'));var qs=require(_0x4ae3('0x11'));var as=require(_0x4ae3('0x12'));var hardwareService=require(_0x4ae3('0x13'));var logger=require(_0x4ae3('0x14'))(_0x4ae3('0x15'));var utils=require(_0x4ae3('0x16'));var config=require(_0x4ae3('0x17'));var licenseUtil=require(_0x4ae3('0x18'));var db=require(_0x4ae3('0x19'))['db'];function respondWithStatusCode(_0x3bcd0f,_0xde03d7){_0xde03d7=_0xde03d7||0xcc;return function(_0x5d4b77){if(_0x5d4b77){return _0x3bcd0f[_0x4ae3('0x1a')](_0xde03d7);}return _0x3bcd0f[_0x4ae3('0x1b')](_0xde03d7)[_0x4ae3('0x1c')]();};}function respondWithResult(_0x559ca1,_0x160c29){_0x160c29=_0x160c29||0xc8;return function(_0x1f8d16){if(_0x1f8d16){return _0x559ca1['status'](_0x160c29)['json'](_0x1f8d16);}};}function respondWithFilteredResult(_0x18ad7b,_0x3d12b0){return function(_0x4e1a8d){if(_0x4e1a8d){var _0x512d1c=typeof _0x3d12b0[_0x4ae3('0x1d')]===_0x4ae3('0x1e')&&typeof _0x3d12b0[_0x4ae3('0x1f')]===_0x4ae3('0x1e');var _0x4864b7=_0x4e1a8d[_0x4ae3('0x20')];var _0x320cfc=_0x512d1c?0x0:_0x3d12b0['offset'];var _0x29a45d=_0x512d1c?_0x4e1a8d[_0x4ae3('0x20')]:_0x3d12b0[_0x4ae3('0x1d')]+_0x3d12b0[_0x4ae3('0x1f')];var _0x48b6df;if(_0x29a45d>=_0x4864b7){_0x29a45d=_0x4864b7;_0x48b6df=0xc8;}else{_0x48b6df=0xce;}_0x18ad7b[_0x4ae3('0x1b')](_0x48b6df);return _0x18ad7b[_0x4ae3('0x21')](_0x4ae3('0x22'),_0x320cfc+'-'+_0x29a45d+'/'+_0x4864b7)['json'](_0x4e1a8d);}return null;};}function patchUpdates(_0x24be8a){return function(_0x259124){try{jsonpatch[_0x4ae3('0x23')](_0x259124,_0x24be8a,!![]);}catch(_0x504725){return BPromise['reject'](_0x504725);}return _0x259124[_0x4ae3('0x24')]();};}function saveUpdates(_0x599603,_0x5d0ad7){return function(_0x41cdf3){if(_0x41cdf3){return _0x41cdf3['update'](_0x599603)[_0x4ae3('0x25')](function(_0x3fc2e2){return _0x3fc2e2;});}return null;};}function removeEntity(_0xe86e39,_0x1909be){return function(_0x2a3729){if(_0x2a3729){return _0x2a3729[_0x4ae3('0x26')]()['then'](function(){_0xe86e39['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3db2fd,_0x4c7505){return function(_0x3f8548){if(!_0x3f8548){_0x3db2fd['sendStatus'](0x194);}return _0x3f8548;};}function handleError(_0x159372,_0x2035d2){_0x2035d2=_0x2035d2||0x1f4;return function(_0x3643f6){logger[_0x4ae3('0x27')](_0x3643f6[_0x4ae3('0x28')]);if(_0x3643f6[_0x4ae3('0x29')]){delete _0x3643f6[_0x4ae3('0x29')];}_0x159372[_0x4ae3('0x1b')](_0x2035d2)[_0x4ae3('0x2a')](_0x3643f6);};}exports[_0x4ae3('0x2b')]=function(_0x969896,_0x2a3c08){if(_0x969896[_0x4ae3('0x2c')]['id']){delete _0x969896[_0x4ae3('0x2c')]['id'];}return db[_0x4ae3('0x2d')][_0x4ae3('0x2e')]({'where':{'id':_0x969896['params']['id']}})['then'](handleEntityNotFound(_0x2a3c08,null))['then'](saveUpdates(_0x969896[_0x4ae3('0x2c')],null))[_0x4ae3('0x25')](respondWithResult(_0x2a3c08,null))[_0x4ae3('0x2f')](handleError(_0x2a3c08,null));};exports['destroy']=function(_0x4b414d,_0x47489f){return db[_0x4ae3('0x2d')][_0x4ae3('0x2e')]({'where':{'id':_0x4b414d[_0x4ae3('0x30')]['id']}})[_0x4ae3('0x25')](handleEntityNotFound(_0x47489f,null))[_0x4ae3('0x25')](removeEntity(_0x47489f,null))[_0x4ae3('0x2f')](handleError(_0x47489f,null));}; \ No newline at end of file +var _0xc143=['../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','body','find','params','catch','Action','eml-format','zip-dir','request-promise','moment','mustache','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x159d4b,_0x2a9239){var _0x2c7d84=function(_0x268a2a){while(--_0x268a2a){_0x159d4b['push'](_0x159d4b['shift']());}};_0x2c7d84(++_0x2a9239);}(_0xc143,0x1bc));var _0x3c14=function(_0x499ac0,_0x34368e){_0x499ac0=_0x499ac0-0x0;var _0x3768a3=_0xc143[_0x499ac0];return _0x3768a3;};'use strict';var emlformat=require(_0x3c14('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3c14('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c14('0x2'));var moment=require(_0x3c14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3c14('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3c14('0x5'));var csv=require('to-csv');var ejs=require(_0x3c14('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3c14('0x7'));var crypto=require('crypto');var jsforce=require(_0x3c14('0x8'));var deskjs=require(_0x3c14('0x9'));var toCsv=require(_0x3c14('0xa'));var querystring=require(_0x3c14('0xb'));var Papa=require(_0x3c14('0xc'));var Redis=require(_0x3c14('0xd'));var authService=require(_0x3c14('0xe'));var qs=require(_0x3c14('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c14('0x10'));var logger=require(_0x3c14('0x11'))('api');var utils=require(_0x3c14('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3c14('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37d90b,_0x329251){_0x329251=_0x329251||0xcc;return function(_0x1ce24c){if(_0x1ce24c){return _0x37d90b[_0x3c14('0x14')](_0x329251);}return _0x37d90b['status'](_0x329251)[_0x3c14('0x15')]();};}function respondWithResult(_0x3955dc,_0x5d71ff){_0x5d71ff=_0x5d71ff||0xc8;return function(_0x1fa86e){if(_0x1fa86e){return _0x3955dc[_0x3c14('0x16')](_0x5d71ff)[_0x3c14('0x17')](_0x1fa86e);}};}function respondWithFilteredResult(_0x509f64,_0x4f4f9c){return function(_0x465d3b){if(_0x465d3b){var _0x313b7c=typeof _0x4f4f9c[_0x3c14('0x18')]===_0x3c14('0x19')&&typeof _0x4f4f9c[_0x3c14('0x1a')]==='undefined';var _0x57b871=_0x465d3b['count'];var _0x37c221=_0x313b7c?0x0:_0x4f4f9c[_0x3c14('0x18')];var _0x4c021b=_0x313b7c?_0x465d3b[_0x3c14('0x1b')]:_0x4f4f9c[_0x3c14('0x18')]+_0x4f4f9c['limit'];var _0x17667e;if(_0x4c021b>=_0x57b871){_0x4c021b=_0x57b871;_0x17667e=0xc8;}else{_0x17667e=0xce;}_0x509f64[_0x3c14('0x16')](_0x17667e);return _0x509f64[_0x3c14('0x1c')]('Content-Range',_0x37c221+'-'+_0x4c021b+'/'+_0x57b871)['json'](_0x465d3b);}return null;};}function patchUpdates(_0x5728fa){return function(_0x21d772){try{jsonpatch[_0x3c14('0x1d')](_0x21d772,_0x5728fa,!![]);}catch(_0x450872){return BPromise['reject'](_0x450872);}return _0x21d772[_0x3c14('0x1e')]();};}function saveUpdates(_0xe672af,_0x4a4e37){return function(_0x1d5ea1){if(_0x1d5ea1){return _0x1d5ea1['update'](_0xe672af)[_0x3c14('0x1f')](function(_0x15d6e0){return _0x15d6e0;});}return null;};}function removeEntity(_0x54efd1,_0x3bb431){return function(_0x32ed76){if(_0x32ed76){return _0x32ed76[_0x3c14('0x20')]()['then'](function(){_0x54efd1[_0x3c14('0x16')](0xcc)[_0x3c14('0x15')]();});}};}function handleEntityNotFound(_0x752508,_0xfff926){return function(_0x106c5a){if(!_0x106c5a){_0x752508[_0x3c14('0x14')](0x194);}return _0x106c5a;};}function handleError(_0x426174,_0x313965){_0x313965=_0x313965||0x1f4;return function(_0x4f443c){logger[_0x3c14('0x21')](_0x4f443c[_0x3c14('0x22')]);if(_0x4f443c['name']){delete _0x4f443c[_0x3c14('0x23')];}_0x426174[_0x3c14('0x16')](_0x313965)[_0x3c14('0x24')](_0x4f443c);};}exports['update']=function(_0xe8172c,_0x1f3b5a){if(_0xe8172c['body']['id']){delete _0xe8172c[_0x3c14('0x25')]['id'];}return db['Action'][_0x3c14('0x26')]({'where':{'id':_0xe8172c[_0x3c14('0x27')]['id']}})[_0x3c14('0x1f')](handleEntityNotFound(_0x1f3b5a,null))[_0x3c14('0x1f')](saveUpdates(_0xe8172c[_0x3c14('0x25')],null))[_0x3c14('0x1f')](respondWithResult(_0x1f3b5a,null))[_0x3c14('0x28')](handleError(_0x1f3b5a,null));};exports['destroy']=function(_0x17742e,_0x4a1dbf){return db[_0x3c14('0x29')][_0x3c14('0x26')]({'where':{'id':_0x17742e['params']['id']}})[_0x3c14('0x1f')](handleEntityNotFound(_0x4a1dbf,null))[_0x3c14('0x1f')](removeEntity(_0x4a1dbf,null))[_0x3c14('0x28')](handleError(_0x4a1dbf,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 05bf741..a0cd617 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 _0x24ef=['tools_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x24ef,0x1ef));var _0xf24e=function(_0x191fab,_0x4508f1){_0x191fab=_0x191fab-0x0;var _0x34f5ae=_0x24ef[_0x191fab];return _0x34f5ae;};'use strict';var _=require(_0xf24e('0x0'));var util=require(_0xf24e('0x1'));var logger=require(_0xf24e('0x2'))('api');var moment=require(_0xf24e('0x3'));var BPromise=require(_0xf24e('0x4'));var rp=require(_0xf24e('0x5'));var fs=require('fs');var path=require(_0xf24e('0x6'));var rimraf=require(_0xf24e('0x7'));var config=require(_0xf24e('0x8'));var attributes=require(_0xf24e('0x9'));module[_0xf24e('0xa')]=function(_0x18c91e,_0x38a255){return _0x18c91e[_0xf24e('0xb')]('Action',attributes,{'tableName':_0xf24e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58a6=['path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x3418cf,_0x24b5b9){var _0x323adc=function(_0x92fe0b){while(--_0x92fe0b){_0x3418cf['push'](_0x3418cf['shift']());}};_0x323adc(++_0x24b5b9);}(_0x58a6,0x17b));var _0x658a=function(_0x3f6cca,_0x377b1a){_0x3f6cca=_0x3f6cca-0x0;var _0x4be36d=_0x58a6[_0x3f6cca];return _0x4be36d;};'use strict';var _=require(_0x658a('0x0'));var util=require('util');var logger=require(_0x658a('0x1'))(_0x658a('0x2'));var moment=require('moment');var BPromise=require(_0x658a('0x3'));var rp=require(_0x658a('0x4'));var fs=require('fs');var path=require(_0x658a('0x5'));var rimraf=require('rimraf');var config=require(_0x658a('0x6'));var attributes=require(_0x658a('0x7'));module[_0x658a('0x8')]=function(_0x2dd597,_0x318dbe){return _0x2dd597[_0x658a('0x9')](_0x658a('0xa'),attributes,{'tableName':_0x658a('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 88f6222..b484b66 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x39000a,_0x439386){var _0x374dba=function(_0x4c6783){while(--_0x4c6783){_0x39000a['push'](_0x39000a['shift']());}};_0x374dba(++_0x439386);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x5ce832,_0x595d5b){var _0x569cc3=function(_0x4da569){while(--_0x4da569){_0x5ce832['push'](_0x5ce832['shift']());}};_0x569cc3(++_0x595d5b);}(_0xe14b,0x93));var _0xbe14=function(_0x2590c7,_0x4eea69){_0x2590c7=_0x2590c7-0x0;var _0x4c7e7a=_0xe14b[_0x2590c7];return _0x4c7e7a;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index dde558d..b22b2f9 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 _0x06bf=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x5f2676,_0x136cc3){var _0x31fdf5=function(_0x9ca173){while(--_0x9ca173){_0x5f2676['push'](_0x5f2676['shift']());}};_0x31fdf5(++_0x136cc3);}(_0x06bf,0xb4));var _0xf06b=function(_0x5c1126,_0x4895ef){_0x5c1126=_0x5c1126-0x0;var _0x4e9072=_0x06bf[_0x5c1126];return _0x4e9072;};'use strict';var multer=require(_0xf06b('0x0'));var util=require(_0xf06b('0x1'));var path=require(_0xf06b('0x2'));var timeout=require(_0xf06b('0x3'));var express=require('express');var router=express[_0xf06b('0x4')]();var fs_extra=require(_0xf06b('0x5'));var auth=require(_0xf06b('0x6'));var interaction=require(_0xf06b('0x7'));var config=require(_0xf06b('0x8'));var controller=require(_0xf06b('0x9'));router[_0xf06b('0xa')](_0xf06b('0xb'),auth['isAuthenticated'](),controller[_0xf06b('0xc')]);router[_0xf06b('0xd')](_0xf06b('0xb'),auth['isAuthenticated'](),controller[_0xf06b('0xe')]);module[_0xf06b('0xf')]=router; \ No newline at end of file +var _0xe192=['destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','/:id'];(function(_0x4e674a,_0x1d0d83){var _0x390115=function(_0x2189e0){while(--_0x2189e0){_0x4e674a['push'](_0x4e674a['shift']());}};_0x390115(++_0x1d0d83);}(_0xe192,0x160));var _0x2e19=function(_0x458448,_0xc5e1b1){_0x458448=_0x458448-0x0;var _0x55d57a=_0xe192[_0x458448];return _0x55d57a;};'use strict';var multer=require(_0x2e19('0x0'));var util=require(_0x2e19('0x1'));var path=require(_0x2e19('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e19('0x3'));var router=express['Router']();var fs_extra=require(_0x2e19('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2e19('0x5'));var config=require(_0x2e19('0x6'));var controller=require(_0x2e19('0x7'));router[_0x2e19('0x8')]('/:id',auth[_0x2e19('0x9')](),controller[_0x2e19('0xa')]);router['delete'](_0x2e19('0xb'),auth[_0x2e19('0x9')](),controller[_0x2e19('0xc')]);module[_0x2e19('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 bebc3b5..389e079 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 _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x4d9b2d,_0x266d0b){var _0x391282=function(_0x11b35b){while(--_0x11b35b){_0x4d9b2d['push'](_0x4d9b2d['shift']());}};_0x391282(++_0x266d0b);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x465c8d,_0x308d2e){_0x465c8d=_0x465c8d-0x0;var _0x3e64a8=_0x3f8a[_0x465c8d];return _0x3e64a8;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}}; \ No newline at end of file +var _0x425d=['sequelize','STRING','TEXT'];(function(_0x5ab7c8,_0x19b852){var _0x2884ea=function(_0x4976f9){while(--_0x4976f9){_0x5ab7c8['push'](_0x5ab7c8['shift']());}};_0x2884ea(++_0x19b852);}(_0x425d,0x1e0));var _0xd425=function(_0x470883,_0x613e70){_0x470883=_0x470883-0x0;var _0x2f4abb=_0x425d[_0x470883];return _0x2f4abb;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index b4bdb68..857c3b6 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 _0x851f=['IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','from','table','MetricId','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parse','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','COUNT(%s)','IS\x20EMPTY','value','Sequelize','keyBy','fullPath','%s-%s.%s','randomstring','generate','output','csv','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','COUNT(*)','run','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ValidationErrorItem','metric','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','get','UserProfileResource','destroy','error','name','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','AnalyticCustomReport','include','catch','show','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','join','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL'];(function(_0x574c1d,_0x2a45a1){var _0x286a3c=function(_0x2796e8){while(--_0x2796e8){_0x574c1d['push'](_0x574c1d['shift']());}};_0x286a3c(++_0x2a45a1);}(_0x851f,0x185));var _0xf851=function(_0x4715d2,_0x3371b2){_0x4715d2=_0x4715d2-0x0;var _0x141811=_0x851f[_0x4715d2];return _0x141811;};'use strict';var emlformat=require(_0xf851('0x0'));var rimraf=require(_0xf851('0x1'));var zipdir=require(_0xf851('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf851('0x3'));var moment=require(_0xf851('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf851('0x5'));var util=require(_0xf851('0x6'));var path=require('path');var sox=require(_0xf851('0x7'));var csv=require('to-csv');var ejs=require(_0xf851('0x8'));var fs=require('fs');var fs_extra=require(_0xf851('0x9'));var _=require(_0xf851('0xa'));var squel=require(_0xf851('0xb'));var crypto=require(_0xf851('0xc'));var jsforce=require(_0xf851('0xd'));var deskjs=require(_0xf851('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf851('0xf'));var Papa=require('papaparse');var Redis=require(_0xf851('0x10'));var authService=require(_0xf851('0x11'));var qs=require(_0xf851('0x12'));var as=require(_0xf851('0x13'));var hardwareService=require(_0xf851('0x14'));var logger=require('../../config/logger')(_0xf851('0x15'));var utils=require(_0xf851('0x16'));var config=require(_0xf851('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xf851('0x18')];function respondWithStatusCode(_0x913b1a,_0x23132b){_0x23132b=_0x23132b||0xcc;return function(_0x1b0734){if(_0x1b0734){return _0x913b1a[_0xf851('0x19')](_0x23132b);}return _0x913b1a[_0xf851('0x1a')](_0x23132b)[_0xf851('0x1b')]();};}function respondWithResult(_0x103f43,_0x2a1d8a){_0x2a1d8a=_0x2a1d8a||0xc8;return function(_0x516390){if(_0x516390){return _0x103f43['status'](_0x2a1d8a)[_0xf851('0x1c')](_0x516390);}};}function respondWithFilteredResult(_0x55dec9,_0x54dc50){return function(_0xa7a925){if(_0xa7a925){var _0x2ba712=typeof _0x54dc50[_0xf851('0x1d')]===_0xf851('0x1e')&&typeof _0x54dc50[_0xf851('0x1f')]==='undefined';var _0x10f724=_0xa7a925['count'];var _0x26dc49=_0x2ba712?0x0:_0x54dc50[_0xf851('0x1d')];var _0x1d3bda=_0x2ba712?_0xa7a925[_0xf851('0x20')]:_0x54dc50[_0xf851('0x1d')]+_0x54dc50['limit'];var _0x4ca496;if(_0x1d3bda>=_0x10f724){_0x1d3bda=_0x10f724;_0x4ca496=0xc8;}else{_0x4ca496=0xce;}_0x55dec9['status'](_0x4ca496);return _0x55dec9[_0xf851('0x21')]('Content-Range',_0x26dc49+'-'+_0x1d3bda+'/'+_0x10f724)[_0xf851('0x1c')](_0xa7a925);}return null;};}function patchUpdates(_0x414326){return function(_0x251353){try{jsonpatch[_0xf851('0x22')](_0x251353,_0x414326,!![]);}catch(_0x360939){return BPromise['reject'](_0x360939);}return _0x251353[_0xf851('0x23')]();};}function saveUpdates(_0x1bda22,_0x603486){return function(_0x577827){if(_0x577827){return _0x577827['update'](_0x1bda22)[_0xf851('0x24')](function(_0x22aa50){return _0x22aa50;});}return null;};}function removeEntity(_0x3b7dd8,_0x484e3a){return function(_0x379d5a){if(_0x379d5a){return _0x379d5a['destroy']()[_0xf851('0x24')](function(){var _0x3e7758=_0x379d5a[_0xf851('0x25')]({'plain':!![]});var _0x2f2ac0='CustomReports';return db[_0xf851('0x26')][_0xf851('0x27')]({'where':{'type':_0x2f2ac0,'resourceId':_0x3e7758['id']}})['then'](function(){return _0x379d5a;});})['then'](function(){_0x3b7dd8[_0xf851('0x1a')](0xcc)[_0xf851('0x1b')]();});}};}function handleEntityNotFound(_0x18e1c2,_0x577823){return function(_0x387d1b){if(!_0x387d1b){_0x18e1c2[_0xf851('0x19')](0x194);}return _0x387d1b;};}function handleError(_0x4472d7,_0x306bac){_0x306bac=_0x306bac||0x1f4;return function(_0x39a9e5){logger[_0xf851('0x28')](_0x39a9e5['stack']);if(_0x39a9e5[_0xf851('0x29')]){delete _0x39a9e5[_0xf851('0x29')];}_0x4472d7['status'](_0x306bac)['send'](_0x39a9e5);};}exports['index']=function(_0x23a2e0,_0x249bbf){var _0x232d0b={},_0x64ea2f={},_0xe8ecf7={'count':0x0,'rows':[]};var _0x505a6a=_[_0xf851('0x2a')](db['AnalyticCustomReport'][_0xf851('0x2b')],function(_0x3178c6){return{'name':_0x3178c6[_0xf851('0x2c')],'type':_0x3178c6[_0xf851('0x2d')]['key']};});_0x64ea2f[_0xf851('0x2e')]=_[_0xf851('0x2a')](_0x505a6a,_0xf851('0x29'));_0x64ea2f[_0xf851('0x2f')]=_['keys'](_0x23a2e0[_0xf851('0x2f')]);_0x64ea2f[_0xf851('0x30')]=_[_0xf851('0x31')](_0x64ea2f[_0xf851('0x2e')],_0x64ea2f['query']);_0x232d0b['attributes']=_['intersection'](_0x64ea2f[_0xf851('0x2e')],qs[_0xf851('0x32')](_0x23a2e0[_0xf851('0x2f')]['fields']));_0x232d0b[_0xf851('0x33')]=_0x232d0b[_0xf851('0x33')][_0xf851('0x34')]?_0x232d0b[_0xf851('0x33')]:_0x64ea2f[_0xf851('0x2e')];if(!_0x23a2e0[_0xf851('0x2f')][_0xf851('0x35')](_0xf851('0x36'))){_0x232d0b['limit']=qs['limit'](_0x23a2e0['query'][_0xf851('0x1f')]);_0x232d0b[_0xf851('0x1d')]=qs[_0xf851('0x1d')](_0x23a2e0[_0xf851('0x2f')][_0xf851('0x1d')]);}_0x232d0b['order']=qs[_0xf851('0x37')](_0x23a2e0[_0xf851('0x2f')][_0xf851('0x37')]);_0x232d0b[_0xf851('0x38')]=qs[_0xf851('0x30')](_[_0xf851('0x39')](_0x23a2e0[_0xf851('0x2f')],_0x64ea2f[_0xf851('0x30')]),_0x505a6a);if(_0x23a2e0[_0xf851('0x2f')]['filter']){_0x232d0b[_0xf851('0x38')]=_[_0xf851('0x3a')](_0x232d0b[_0xf851('0x38')],{'$or':_[_0xf851('0x2a')](_0x505a6a,function(_0xe279d2){if(_0xe279d2[_0xf851('0x2d')]!==_0xf851('0x3b')){var _0x5be904={};_0x5be904[_0xe279d2['name']]={'$like':'%'+_0x23a2e0[_0xf851('0x2f')][_0xf851('0x3c')]+'%'};return _0x5be904;}})});}_0x232d0b=_[_0xf851('0x3a')]({},_0x232d0b,_0x23a2e0[_0xf851('0x3d')]);var _0x14f73e={'where':_0x232d0b[_0xf851('0x38')]};return db[_0xf851('0x3e')][_0xf851('0x20')](_0x14f73e)[_0xf851('0x24')](function(_0x5dd5e2){_0xe8ecf7[_0xf851('0x20')]=_0x5dd5e2;if(_0x23a2e0[_0xf851('0x2f')]['includeAll']){_0x232d0b[_0xf851('0x3f')]=[{'all':!![]}];}return db[_0xf851('0x3e')]['findAll'](_0x232d0b);})['then'](function(_0x190336){_0xe8ecf7['rows']=_0x190336;return _0xe8ecf7;})['then'](respondWithFilteredResult(_0x249bbf,_0x232d0b))[_0xf851('0x40')](handleError(_0x249bbf,null));};exports[_0xf851('0x41')]=function(_0x279bcf,_0xb0b31c){var _0x539bf8={'raw':![],'where':{'id':_0x279bcf['params']['id']}},_0x1e17c4={};_0x1e17c4[_0xf851('0x2e')]=_[_0xf851('0x42')](db[_0xf851('0x3e')][_0xf851('0x2b')]);_0x1e17c4[_0xf851('0x2f')]=_[_0xf851('0x42')](_0x279bcf[_0xf851('0x2f')]);_0x1e17c4[_0xf851('0x30')]=_[_0xf851('0x31')](_0x1e17c4[_0xf851('0x2e')],_0x1e17c4[_0xf851('0x2f')]);_0x539bf8[_0xf851('0x33')]=_['intersection'](_0x1e17c4[_0xf851('0x2e')],qs['fields'](_0x279bcf[_0xf851('0x2f')]['fields']));_0x539bf8['attributes']=_0x539bf8[_0xf851('0x33')]['length']?_0x539bf8[_0xf851('0x33')]:_0x1e17c4[_0xf851('0x2e')];if(_0x279bcf[_0xf851('0x2f')]['includeAll']){_0x539bf8[_0xf851('0x3f')]=[{'all':!![]}];}_0x539bf8=_[_0xf851('0x3a')]({},_0x539bf8,_0x279bcf[_0xf851('0x3d')]);return db['AnalyticCustomReport'][_0xf851('0x43')](_0x539bf8)['then'](handleEntityNotFound(_0xb0b31c,null))['then'](respondWithResult(_0xb0b31c,null))[_0xf851('0x40')](handleError(_0xb0b31c,null));};exports[_0xf851('0x44')]=function(_0x330b57,_0x293a99){return db['AnalyticCustomReport'][_0xf851('0x44')](_0x330b57[_0xf851('0x45')],{})[_0xf851('0x24')](function(_0x1116a3){var _0x496b36=_0x330b57['user'][_0xf851('0x25')]({'plain':!![]});if(!_0x496b36)throw new Error(_0xf851('0x46'));if(_0x496b36['role']===_0xf851('0x47')){var _0x48beec=_0x1116a3[_0xf851('0x25')]({'plain':!![]});var _0x3f0447=_0xf851('0x48');return db['UserProfileSection']['find']({'where':{'name':_0x3f0447,'userProfileId':_0x496b36[_0xf851('0x49')]},'raw':!![]})['then'](function(_0x53aa84){if(_0x53aa84&&_0x53aa84[_0xf851('0x4a')]===0x0){return db[_0xf851('0x26')][_0xf851('0x44')]({'name':_0x48beec['name'],'resourceId':_0x48beec['id'],'type':_0xf851('0x4b'),'sectionId':_0x53aa84['id']},{})[_0xf851('0x24')](function(){return _0x1116a3;});}else{return _0x1116a3;}})[_0xf851('0x40')](function(_0x34a492){logger[_0xf851('0x28')](_0xf851('0x4c'),_0x34a492);throw _0x34a492;});}return _0x1116a3;})[_0xf851('0x24')](respondWithResult(_0x293a99,0xc9))[_0xf851('0x40')](handleError(_0x293a99,null));};exports[_0xf851('0x4d')]=function(_0x3cb102,_0x18ea99){if(_0x3cb102[_0xf851('0x45')]['id']){delete _0x3cb102['body']['id'];}return db[_0xf851('0x3e')][_0xf851('0x43')]({'where':{'id':_0x3cb102['params']['id']}})[_0xf851('0x24')](handleEntityNotFound(_0x18ea99,null))[_0xf851('0x24')](saveUpdates(_0x3cb102[_0xf851('0x45')],null))[_0xf851('0x24')](respondWithResult(_0x18ea99,null))[_0xf851('0x40')](handleError(_0x18ea99,null));};exports[_0xf851('0x27')]=function(_0x35c447,_0x4185e6){return db['AnalyticCustomReport'][_0xf851('0x43')]({'where':{'id':_0x35c447[_0xf851('0x4e')]['id']}})[_0xf851('0x24')](handleEntityNotFound(_0x4185e6,null))[_0xf851('0x24')](removeEntity(_0x4185e6,null))['catch'](handleError(_0x4185e6,null));};exports[_0xf851('0x4f')]=function(_0x6664e,_0x4333c2){var _0x48bcdb=0xa;var _0x25ba99=[_0xf851('0x50'),_0xf851('0x51'),_0xf851('0x52'),_0xf851('0x53')];var _0x511a8f={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xf851('0x54'),'MAX':_0xf851('0x55'),'MIN':_0xf851('0x56'),'AVG':_0xf851('0x57'),'GROUP_CONCAT':_0xf851('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf851('0x59')};var _0x2bbde5={'SEC_TO_TIME':_0xf851('0x5a'),'DATE':_0xf851('0x5b'),'HOUR':_0xf851('0x5c'),'ROUND':_0xf851('0x5d'),'UNIX_TIMESTAMP':_0xf851('0x5e')};var _0x4d1219=function(_0x773c74){return!_[_0xf851('0x5f')]([_0xf851('0x60'),_0xf851('0x61'),'IS\x20EMPTY',_0xf851('0x62')],_0x773c74);};var _0x51a1e3=function(_0x121a34){if(!_0x121a34||!_0x121a34[_0xf851('0x63')]['length']){return'';}for(var _0x421a7f='(',_0x36417b=0x0;_0x36417b<_0x121a34['rules'][_0xf851('0x34')];_0x36417b+=0x1){_0x36417b>0x0&&(_0x421a7f+='\x20'+_0x121a34[_0xf851('0x64')]+'\x20');_0x421a7f+=_0x121a34['rules'][_0x36417b]['group']?_0x51a1e3(_0x121a34[_0xf851('0x63')][_0x36417b][_0xf851('0x65')]):_0x121a34['rules'][_0x36417b][_0xf851('0x66')]+'\x20'+_0x121a34[_0xf851('0x63')][_0x36417b][_0xf851('0x67')]+(_0x4d1219(_0x121a34[_0xf851('0x63')][_0x36417b][_0xf851('0x67')])?'\x20'+_0x121a34['rules'][_0x36417b]['value']:'');}return _0x421a7f+')';};var _0x2e3496={'where':{'id':_0x6664e[_0xf851('0x4e')]['id']}},_0x3c10a6,_0x541208,_0x20a0a8,_0x2cbc9e,_0x2390c6;_0x2e3496=_[_0xf851('0x3a')]({},_0x2e3496,_0x6664e[_0xf851('0x3d')]);return db[_0xf851('0x3e')][_0xf851('0x43')](_0x2e3496)[_0xf851('0x24')](function(_0xdd53aa){if(_0xdd53aa){_0x3c10a6=_0xdd53aa;return _0xdd53aa[_0xf851('0x68')]();}return null;})[_0xf851('0x24')](function(_0x6a1a3b){if(_0x6a1a3b){if(!_0x6a1a3b[_0xf851('0x34')]){throw new db['Sequelize']['ValidationErrorItem'](_0xf851('0x69'),0x193);}_0x541208=_0x6a1a3b;return db[_0xf851('0x6a')][_0xf851('0x6b')]({'raw':!![]});}return null;})[_0xf851('0x24')](function(_0x1c4df2){if(_0x1c4df2){_0x20a0a8=_['keyBy'](_0x1c4df2,'id');var _0x25e5f9;var _0x1e7d41=squel['select']();_0x1e7d41[_0xf851('0x6c')](_0x3c10a6[_0xf851('0x6d')]);for(var _0x58d364=0x0;_0x58d364<_0x541208[_0xf851('0x34')];_0x58d364+=0x1){_0x25e5f9=_0x541208[_0x58d364]['MetricId']?_0x20a0a8[_0x541208[_0x58d364][_0xf851('0x6e')]]['metric']:_0x541208[_0x58d364]['field'];_0x25e5f9=_0x541208[_0x58d364][_0xf851('0x6f')]?_[_0xf851('0x70')](_0x511a8f[_0x541208[_0x58d364][_0xf851('0x6f')]],'%s',_0x25e5f9):_0x25e5f9;_0x25e5f9=_0x541208[_0x58d364][_0xf851('0x71')]?_['replace'](_0x2bbde5[_0x541208[_0x58d364][_0xf851('0x71')]],'%s',_0x25e5f9):_0x25e5f9;if(_0x541208[_0x58d364][_0xf851('0x72')]){_0x1e7d41[_0xf851('0x65')](_0x25e5f9);}_0x541208[_0x58d364][_0xf851('0x73')]&&_0x1e7d41[_0xf851('0x74')](_0x25e5f9,_0x541208[_0x58d364][_0xf851('0x73')]===_0xf851('0x75')?![]:!![]);_0x1e7d41[_0xf851('0x66')](_0x25e5f9,_0x541208[_0x58d364][_0xf851('0x76')]||_0x25e5f9);}if(_0x3c10a6[_0xf851('0x77')]){_0x3c10a6[_0xf851('0x77')]=JSON['parse'](_0x3c10a6['joins']);for(var _0x4729e3=0x0;_0x4729e3<_0x3c10a6[_0xf851('0x77')]['length'];_0x4729e3+=0x1){if(_0x3c10a6[_0xf851('0x77')][_0x4729e3][_0xf851('0x2d')]&&_['includes'](_0x25ba99,_0x3c10a6['joins'][_0x4729e3][_0xf851('0x2d')])&&_0x3c10a6[_0xf851('0x77')][_0x4729e3][_0xf851('0x78')]&&_0x3c10a6[_0xf851('0x77')][_0x4729e3][_0xf851('0x79')]&&_0x3c10a6['joins'][_0x4729e3][_0xf851('0x7a')]){_0x1e7d41[_0x3c10a6['joins'][_0x4729e3]['type']](_0x3c10a6[_0xf851('0x77')][_0x4729e3]['foreignTable'],null,util[_0xf851('0x71')](_0xf851('0x7b'),_0x3c10a6['table'],_0x3c10a6[_0xf851('0x77')][_0x4729e3][_0xf851('0x78')],_0x3c10a6['joins'][_0x4729e3][_0xf851('0x79')],_0x3c10a6[_0xf851('0x77')][_0x4729e3][_0xf851('0x7a')]));}}}if(_0x3c10a6['conditions']){_0x3c10a6['conditions']=JSON[_0xf851('0x7c')](_0x3c10a6[_0xf851('0x7d')]);_0x1e7d41[_0xf851('0x38')](_0x51a1e3(_0x3c10a6['conditions'][_0xf851('0x65')]));}_0x2390c6=_0x1e7d41[_0xf851('0x7e')]();_0x1e7d41[_0xf851('0x1f')](_0x48bcdb);_0x1e7d41[_0xf851('0x1d')](0x0);logger[_0xf851('0x7f')](_0xf851('0x80'),_0x1e7d41[_0xf851('0x81')]());return dbH[_0xf851('0x82')][_0xf851('0x2f')](_0x1e7d41[_0xf851('0x81')](),{'type':dbH[_0xf851('0x82')][_0xf851('0x83')][_0xf851('0x84')]});}})[_0xf851('0x24')](respondWithResult(_0x4333c2,null))[_0xf851('0x40')](handleError(_0x4333c2,null));};function runReport(_0xf511e,_0x27de56,_0x5e0ce1){var _0x2afff7=_0x27de56[_0xf851('0x29')];var _0x127835=0xa;var _0x20b92a=[_0xf851('0x50'),'left_join',_0xf851('0x52'),_0xf851('0x53')];var _0x2cc937={'SUM':_0xf851('0x85'),'COUNT':_0xf851('0x86'),'COUNT DISTINCT':_0xf851('0x54'),'MAX':_0xf851('0x55'),'MIN':_0xf851('0x56'),'AVG':_0xf851('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf851('0x59')};var _0x15e333={'SEC_TO_TIME':_0xf851('0x5a'),'DATE':_0xf851('0x5b'),'HOUR':_0xf851('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xf851('0x5e')};var _0x5bdb99=function(_0x33a3ab){return!_[_0xf851('0x5f')]([_0xf851('0x60'),_0xf851('0x61'),_0xf851('0x87'),_0xf851('0x62')],_0x33a3ab);};var _0x19581b=function(_0x63ff6){if(!_0x63ff6||!_0x63ff6[_0xf851('0x63')][_0xf851('0x34')]){return'';}for(var _0x5668c3='(',_0x562c9c=0x0;_0x562c9c<_0x63ff6['rules'][_0xf851('0x34')];_0x562c9c+=0x1){_0x562c9c>0x0&&(_0x5668c3+='\x20'+_0x63ff6[_0xf851('0x64')]+'\x20');_0x5668c3+=_0x63ff6[_0xf851('0x63')][_0x562c9c][_0xf851('0x65')]?_0x19581b(_0x63ff6[_0xf851('0x63')][_0x562c9c][_0xf851('0x65')]):_0x63ff6[_0xf851('0x63')][_0x562c9c][_0xf851('0x66')]+'\x20'+_0x63ff6[_0xf851('0x63')][_0x562c9c][_0xf851('0x67')]+(_0x5bdb99(_0x63ff6[_0xf851('0x63')][_0x562c9c][_0xf851('0x67')])?'\x20'+_0x63ff6[_0xf851('0x63')][_0x562c9c][_0xf851('0x88')]:'');}return _0x5668c3+')';};var _0x46f07e={'where':{'id':_0xf511e['id']}},_0x1ca6dd,_0x36e95f,_0x335680,_0x3fb226,_0x38610b;_0x46f07e=_['merge']({},_0x46f07e,_0x5e0ce1);return db[_0xf851('0x3e')]['find'](_0x46f07e)[_0xf851('0x24')](function(_0x51a6ae){if(_0x51a6ae){_0x1ca6dd=_0x51a6ae;return _0x51a6ae['getFields']();}return null;})['then'](function(_0x8b4036){if(_0x8b4036){if(!_0x8b4036['length']){throw new db[(_0xf851('0x89'))]['ValidationErrorItem'](_0xf851('0x69'),0x193);}_0x36e95f=_0x8b4036;return db['AnalyticMetric'][_0xf851('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x23c2ea){if(_0x23c2ea){_0x335680=_[_0xf851('0x8a')](_0x23c2ea,'id');var _0x4ea8df;var _0x393722=squel['select']();_0x393722[_0xf851('0x6c')](_0x1ca6dd[_0xf851('0x6d')]);for(var _0x3c1138=0x0;_0x3c1138<_0x36e95f[_0xf851('0x34')];_0x3c1138+=0x1){_0x4ea8df=_0x36e95f[_0x3c1138][_0xf851('0x6e')]?_0x335680[_0x36e95f[_0x3c1138][_0xf851('0x6e')]]['metric']:_0x36e95f[_0x3c1138][_0xf851('0x66')];_0x4ea8df=_0x36e95f[_0x3c1138][_0xf851('0x6f')]?_[_0xf851('0x70')](_0x2cc937[_0x36e95f[_0x3c1138][_0xf851('0x6f')]],'%s',_0x4ea8df):_0x4ea8df;_0x4ea8df=_0x36e95f[_0x3c1138][_0xf851('0x71')]?_['replace'](_0x15e333[_0x36e95f[_0x3c1138][_0xf851('0x71')]],'%s',_0x4ea8df):_0x4ea8df;if(_0x36e95f[_0x3c1138][_0xf851('0x72')]){_0x393722[_0xf851('0x65')](_0x4ea8df);}_0x36e95f[_0x3c1138][_0xf851('0x73')]&&_0x393722[_0xf851('0x74')](_0x4ea8df,_0x36e95f[_0x3c1138]['orderBy']===_0xf851('0x75')?![]:!![]);_0x393722[_0xf851('0x66')](_0x4ea8df,_0x36e95f[_0x3c1138][_0xf851('0x76')]||_0x4ea8df);}if(_0x1ca6dd[_0xf851('0x77')]){_0x1ca6dd[_0xf851('0x77')]=JSON['parse'](_0x1ca6dd[_0xf851('0x77')]);for(var _0x201615=0x0;_0x201615<_0x1ca6dd[_0xf851('0x77')][_0xf851('0x34')];_0x201615+=0x1){if(_0x1ca6dd[_0xf851('0x77')][_0x201615]['type']&&_[_0xf851('0x5f')](_0x20b92a,_0x1ca6dd[_0xf851('0x77')][_0x201615][_0xf851('0x2d')])&&_0x1ca6dd[_0xf851('0x77')][_0x201615][_0xf851('0x78')]&&_0x1ca6dd['joins'][_0x201615][_0xf851('0x79')]&&_0x1ca6dd[_0xf851('0x77')][_0x201615][_0xf851('0x7a')]){_0x393722[_0x1ca6dd[_0xf851('0x77')][_0x201615]['type']](_0x1ca6dd[_0xf851('0x77')][_0x201615][_0xf851('0x79')],null,util[_0xf851('0x71')](_0xf851('0x7b'),_0x1ca6dd[_0xf851('0x6d')],_0x1ca6dd[_0xf851('0x77')][_0x201615][_0xf851('0x78')],_0x1ca6dd[_0xf851('0x77')][_0x201615][_0xf851('0x79')],_0x1ca6dd[_0xf851('0x77')][_0x201615]['foreignKey']));}}}if(_0x1ca6dd[_0xf851('0x7d')]){_0x1ca6dd[_0xf851('0x7d')]=JSON[_0xf851('0x7c')](_0x1ca6dd['conditions']);_0x393722[_0xf851('0x38')](_0x19581b(_0x1ca6dd[_0xf851('0x7d')][_0xf851('0x65')]));}_0x38610b=_0x393722[_0xf851('0x7e')]();_0x393722[_0xf851('0x1f')](_0x127835);_0x393722[_0xf851('0x1d')](0x0);return;}})[_0xf851('0x24')](function(){if(_0x27de56['output']==='web'){return null;}var _0x30353b=_[_0xf851('0x3a')](_0x27de56,{'name':_0x27de56[_0xf851('0x8b')]||_0x27de56[_0xf851('0x29')]||_0x1ca6dd[_0xf851('0x29')],'basename':_0x2afff7,'savename':util[_0xf851('0x71')](_0xf851('0x8c'),_0x27de56[_0xf851('0x29')]||_0x1ca6dd[_0xf851('0x29')],require(_0xf851('0x8d'))[_0xf851('0x8e')](0x4),_0x27de56[_0xf851('0x8f')]||_0xf851('0x90')),'reportId':_0x1ca6dd['id'],'reportType':'custom'});return db[_0xf851('0x91')]['create'](_0x30353b,{'raw':!![]});})[_0xf851('0x24')](function(_0xf42968){if(_0x1ca6dd[_0xf851('0x6d')]===_0xf851('0x92')){_0x38610b[_0xf851('0x38')](_0x1ca6dd[_0xf851('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x27de56[_0xf851('0x93')],_0x27de56[_0xf851('0x94')]);}else{_0x38610b[_0xf851('0x38')](_0x1ca6dd[_0xf851('0x6d')]+_0xf851('0x95'),_0x27de56[_0xf851('0x93')],_0x27de56[_0xf851('0x94')]);}if(_0xf42968){logger['info'](_0xf851('0x96'),_0x38610b['toString']());require(_0xf851('0x97'))[_0xf851('0x98')](path[_0xf851('0x50')](__dirname,_0xf851('0x99'),_0xf42968[_0xf851('0x8f')]),[_0xf42968['id'],_0x38610b['toString'](),path['join'](__dirname,_0xf851('0x9a'),_0xf42968[_0xf851('0x9b')]),_0x2afff7]);return _0xf42968;}else{var _0x11b702=squel[_0xf851('0x9c')]();_0x11b702[_0xf851('0x6c')]('('+_0x38610b[_0xf851('0x81')]()+')','countTable');_0x11b702[_0xf851('0x66')](_0xf851('0x9d'),'count');_0x38610b[_0xf851('0x1f')](_0x27de56[_0xf851('0x1f')]||_0x127835);_0x38610b[_0xf851('0x1d')](_0x27de56[_0xf851('0x1d')]||0x0);return dbH[_0xf851('0x82')][_0xf851('0x2f')](_0x11b702[_0xf851('0x81')](),{'type':dbH[_0xf851('0x82')]['QueryTypes'][_0xf851('0x84')]})[_0xf851('0x24')](function(_0x5dd720){if(!_0x5dd720[_0xf851('0x34')]){_0x3fb226=0x0;}else{_0x3fb226=_0x5dd720[0x0][_0xf851('0x20')]||0x0;}return dbH[_0xf851('0x82')]['query'](_0x38610b[_0xf851('0x81')](),{'type':dbH['sequelize'][_0xf851('0x83')]['SELECT']});})[_0xf851('0x24')](function(_0x2ede2d){return{'rows':_0x2ede2d||[],'count':_0x3fb226};});}});}exports[_0xf851('0x9e')]=function(_0x2a8a73,_0x2a9f91){return runReport(_0x2a8a73['params'],_0x2a8a73[_0xf851('0x2f')],_0x2a8a73['options'])[_0xf851('0x24')](respondWithResult(_0x2a9f91,null))[_0xf851('0x40')](handleError(_0x2a9f91,null));};exports['runReport']=runReport;exports[_0xf851('0x2f')]=function(_0x2de596,_0x4b16f5){var _0x29ea51=0xa;var _0x5b2bb9=[_0xf851('0x50'),_0xf851('0x51'),'right_join',_0xf851('0x53')];var _0x39c850={'SUM':_0xf851('0x85'),'COUNT':_0xf851('0x86'),'COUNT DISTINCT':_0xf851('0x54'),'MAX':_0xf851('0x55'),'MIN':_0xf851('0x56'),'AVG':_0xf851('0x57'),'GROUP_CONCAT':_0xf851('0x58'),'GROUP_CONCAT ASC':_0xf851('0x9f'),'GROUP_CONCAT DESC':_0xf851('0x59')};var _0x30b452={'SEC_TO_TIME':_0xf851('0x5a'),'DATE':'DATE(%s)','HOUR':_0xf851('0x5c'),'ROUND':_0xf851('0x5d'),'UNIX_TIMESTAMP':_0xf851('0x5e')};var _0x3c03db=function(_0x456ee4){return!_[_0xf851('0x5f')]([_0xf851('0x60'),_0xf851('0x61'),_0xf851('0x87'),_0xf851('0x62')],_0x456ee4);};var _0x1b58d9=function(_0x27857d){if(!_0x27857d||!_0x27857d[_0xf851('0x63')][_0xf851('0x34')]){return'';}for(var _0x47bb9d='(',_0x3853d3=0x0;_0x3853d3<_0x27857d[_0xf851('0x63')]['length'];_0x3853d3+=0x1){_0x3853d3>0x0&&(_0x47bb9d+='\x20'+_0x27857d[_0xf851('0x64')]+'\x20');_0x47bb9d+=_0x27857d['rules'][_0x3853d3][_0xf851('0x65')]?_0x1b58d9(_0x27857d[_0xf851('0x63')][_0x3853d3][_0xf851('0x65')]):_0x27857d['rules'][_0x3853d3][_0xf851('0x66')]+'\x20'+_0x27857d[_0xf851('0x63')][_0x3853d3][_0xf851('0x67')]+(_0x3c03db(_0x27857d[_0xf851('0x63')][_0x3853d3]['condition'])?'\x20'+_0x27857d[_0xf851('0x63')][_0x3853d3][_0xf851('0x88')]:'');}return _0x47bb9d+')';};var _0x234d57={'where':{'id':_0x2de596[_0xf851('0x4e')]['id']}},_0x316e08,_0x346cb6,_0x143afb,_0x3c6dc5,_0x3ac882;_0x234d57=_[_0xf851('0x3a')]({},_0x234d57,_0x2de596['options']);return db['AnalyticCustomReport'][_0xf851('0x43')](_0x234d57)[_0xf851('0x24')](function(_0x4f5a8d){if(_0x4f5a8d){_0x316e08=_0x4f5a8d;return _0x4f5a8d[_0xf851('0x68')]();}return null;})[_0xf851('0x24')](function(_0xc17975){if(_0xc17975){if(!_0xc17975['length']){throw new db[(_0xf851('0x89'))][(_0xf851('0xa0'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x346cb6=_0xc17975;return db['AnalyticMetric'][_0xf851('0x6b')]({'raw':!![]});}return null;})[_0xf851('0x24')](function(_0x345d7c){if(_0x345d7c){_0x143afb=_[_0xf851('0x8a')](_0x345d7c,'id');var _0x1d185c;var _0x2a6ea1=squel[_0xf851('0x9c')]();_0x2a6ea1[_0xf851('0x6c')](_0x316e08['table']);for(var _0xaaef57=0x0;_0xaaef57<_0x346cb6['length'];_0xaaef57+=0x1){_0x1d185c=_0x346cb6[_0xaaef57]['MetricId']?_0x143afb[_0x346cb6[_0xaaef57][_0xf851('0x6e')]][_0xf851('0xa1')]:_0x346cb6[_0xaaef57][_0xf851('0x66')];_0x1d185c=_0x346cb6[_0xaaef57][_0xf851('0x6f')]?_[_0xf851('0x70')](_0x39c850[_0x346cb6[_0xaaef57]['function']],'%s',_0x1d185c):_0x1d185c;_0x1d185c=_0x346cb6[_0xaaef57][_0xf851('0x71')]?_[_0xf851('0x70')](_0x30b452[_0x346cb6[_0xaaef57][_0xf851('0x71')]],'%s',_0x1d185c):_0x1d185c;if(_0x346cb6[_0xaaef57][_0xf851('0x72')]){_0x2a6ea1['group'](_0x1d185c);}_0x346cb6[_0xaaef57][_0xf851('0x73')]&&_0x2a6ea1[_0xf851('0x74')](_0x1d185c,_0x346cb6[_0xaaef57][_0xf851('0x73')]===_0xf851('0x75')?![]:!![]);_0x2a6ea1['field'](_0x1d185c,_0x346cb6[_0xaaef57]['alias']||_0x1d185c);}if(_0x316e08[_0xf851('0x77')]){_0x316e08[_0xf851('0x77')]=JSON[_0xf851('0x7c')](_0x316e08[_0xf851('0x77')]);for(var _0x43a380=0x0;_0x43a380<_0x316e08[_0xf851('0x77')][_0xf851('0x34')];_0x43a380+=0x1){if(_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x2d')]&&_['includes'](_0x5b2bb9,_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x2d')])&&_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x78')]&&_0x316e08['joins'][_0x43a380]['foreignTable']&&_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x7a')]){_0x2a6ea1[_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x2d')]](_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x79')],null,util[_0xf851('0x71')]('%s.%s\x20=\x20%s.%s',_0x316e08[_0xf851('0x6d')],_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x78')],_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x79')],_0x316e08[_0xf851('0x77')][_0x43a380]['foreignKey']));}}}if(_0x316e08['conditions']){_0x316e08[_0xf851('0x7d')]=JSON[_0xf851('0x7c')](_0x316e08[_0xf851('0x7d')]);_0x2a6ea1['where'](_0x1b58d9(_0x316e08[_0xf851('0x7d')][_0xf851('0x65')]));}_0x3ac882=_0x2a6ea1[_0xf851('0x7e')]();_0x2a6ea1[_0xf851('0x1f')](_0x29ea51);_0x2a6ea1[_0xf851('0x1d')](0x0);logger['debug'](_0xf851('0x80'),_0x2a6ea1[_0xf851('0x81')]());return dbH[_0xf851('0x82')][_0xf851('0x2f')](_0x2a6ea1['toString'](),{'type':dbH[_0xf851('0x82')][_0xf851('0x83')][_0xf851('0x84')]});}})[_0xf851('0x24')](function(){return{'sql':_0x3ac882[_0xf851('0x81')]()};})[_0xf851('0x24')](respondWithResult(_0x4b16f5,null))[_0xf851('0x40')](handleError(_0x4b16f5,null));}; \ No newline at end of file +var _0x3ede=['then','get','CustomReports','end','error','name','send','index','map','AnalyticCustomReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','pick','filter','where','type','VIRTUAL','merge','include','findAll','catch','show','params','length','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','join','left_join','right_join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','IS\x20NULL','IS\x20EMPTY','metric','clone','output','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../components/export/','../../files/reports','countTable','SELECT','run','runReport','eml-format','fast-json-patch','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','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x3ede,0x1cb));var _0xe3ed=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0x3ede[_0x2af29a];return _0x5ef02f;};'use strict';var emlformat=require(_0xe3ed('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe3ed('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe3ed('0x2'));var Mustache=require(_0xe3ed('0x3'));var util=require(_0xe3ed('0x4'));var path=require(_0xe3ed('0x5'));var sox=require(_0xe3ed('0x6'));var csv=require(_0xe3ed('0x7'));var ejs=require(_0xe3ed('0x8'));var fs=require('fs');var fs_extra=require(_0xe3ed('0x9'));var _=require(_0xe3ed('0xa'));var squel=require(_0xe3ed('0xb'));var crypto=require(_0xe3ed('0xc'));var jsforce=require(_0xe3ed('0xd'));var deskjs=require(_0xe3ed('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe3ed('0xf'));var Redis=require('ioredis');var authService=require(_0xe3ed('0x10'));var qs=require(_0xe3ed('0x11'));var as=require(_0xe3ed('0x12'));var hardwareService=require(_0xe3ed('0x13'));var logger=require(_0xe3ed('0x14'))(_0xe3ed('0x15'));var utils=require(_0xe3ed('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe3ed('0x17'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x5dbf80,_0x5414e3){_0x5414e3=_0x5414e3||0xcc;return function(_0xb00e03){if(_0xb00e03){return _0x5dbf80[_0xe3ed('0x18')](_0x5414e3);}return _0x5dbf80['status'](_0x5414e3)['end']();};}function respondWithResult(_0x3fd17f,_0x53a1f9){_0x53a1f9=_0x53a1f9||0xc8;return function(_0x23d63b){if(_0x23d63b){return _0x3fd17f[_0xe3ed('0x19')](_0x53a1f9)[_0xe3ed('0x1a')](_0x23d63b);}};}function respondWithFilteredResult(_0x45621e,_0x264785){return function(_0x11a810){if(_0x11a810){var _0x225c02=typeof _0x264785[_0xe3ed('0x1b')]===_0xe3ed('0x1c')&&typeof _0x264785['limit']===_0xe3ed('0x1c');var _0x5cc8a6=_0x11a810['count'];var _0x528001=_0x225c02?0x0:_0x264785[_0xe3ed('0x1b')];var _0x13fc96=_0x225c02?_0x11a810[_0xe3ed('0x1d')]:_0x264785[_0xe3ed('0x1b')]+_0x264785['limit'];var _0x469443;if(_0x13fc96>=_0x5cc8a6){_0x13fc96=_0x5cc8a6;_0x469443=0xc8;}else{_0x469443=0xce;}_0x45621e[_0xe3ed('0x19')](_0x469443);return _0x45621e[_0xe3ed('0x1e')](_0xe3ed('0x1f'),_0x528001+'-'+_0x13fc96+'/'+_0x5cc8a6)[_0xe3ed('0x1a')](_0x11a810);}return null;};}function patchUpdates(_0x18a065){return function(_0x304cd3){try{jsonpatch[_0xe3ed('0x20')](_0x304cd3,_0x18a065,!![]);}catch(_0x1cd418){return BPromise[_0xe3ed('0x21')](_0x1cd418);}return _0x304cd3[_0xe3ed('0x22')]();};}function saveUpdates(_0x5de8c6,_0x171b48){return function(_0x127a67){if(_0x127a67){return _0x127a67[_0xe3ed('0x23')](_0x5de8c6)[_0xe3ed('0x24')](function(_0x37dcbc){return _0x37dcbc;});}return null;};}function removeEntity(_0x22d122,_0x5ed2d4){return function(_0x2afdc1){if(_0x2afdc1){return _0x2afdc1['destroy']()[_0xe3ed('0x24')](function(){var _0x96c357=_0x2afdc1[_0xe3ed('0x25')]({'plain':!![]});var _0x2032ad=_0xe3ed('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x2032ad,'resourceId':_0x96c357['id']}})[_0xe3ed('0x24')](function(){return _0x2afdc1;});})[_0xe3ed('0x24')](function(){_0x22d122[_0xe3ed('0x19')](0xcc)[_0xe3ed('0x27')]();});}};}function handleEntityNotFound(_0x57f28d,_0x1d9b2d){return function(_0x2baf72){if(!_0x2baf72){_0x57f28d[_0xe3ed('0x18')](0x194);}return _0x2baf72;};}function handleError(_0x15db22,_0x2384e7){_0x2384e7=_0x2384e7||0x1f4;return function(_0x4d8676){logger[_0xe3ed('0x28')](_0x4d8676['stack']);if(_0x4d8676[_0xe3ed('0x29')]){delete _0x4d8676[_0xe3ed('0x29')];}_0x15db22[_0xe3ed('0x19')](_0x2384e7)[_0xe3ed('0x2a')](_0x4d8676);};}exports[_0xe3ed('0x2b')]=function(_0x39ba59,_0x3ac06e){var _0x1856e8={},_0x3e289c={},_0x373fd0={'count':0x0,'rows':[]};var _0xe6956f=_[_0xe3ed('0x2c')](db[_0xe3ed('0x2d')][_0xe3ed('0x2e')],function(_0x161f0a){return{'name':_0x161f0a['fieldName'],'type':_0x161f0a['type']['key']};});_0x3e289c[_0xe3ed('0x2f')]=_[_0xe3ed('0x2c')](_0xe6956f,'name');_0x3e289c[_0xe3ed('0x30')]=_[_0xe3ed('0x31')](_0x39ba59['query']);_0x3e289c[_0xe3ed('0x32')]=_[_0xe3ed('0x33')](_0x3e289c[_0xe3ed('0x2f')],_0x3e289c['query']);_0x1856e8[_0xe3ed('0x34')]=_['intersection'](_0x3e289c['model'],qs[_0xe3ed('0x35')](_0x39ba59[_0xe3ed('0x30')][_0xe3ed('0x35')]));_0x1856e8['attributes']=_0x1856e8[_0xe3ed('0x34')]['length']?_0x1856e8[_0xe3ed('0x34')]:_0x3e289c['model'];if(!_0x39ba59['query'][_0xe3ed('0x36')](_0xe3ed('0x37'))){_0x1856e8[_0xe3ed('0x38')]=qs[_0xe3ed('0x38')](_0x39ba59[_0xe3ed('0x30')][_0xe3ed('0x38')]);_0x1856e8[_0xe3ed('0x1b')]=qs[_0xe3ed('0x1b')](_0x39ba59['query'][_0xe3ed('0x1b')]);}_0x1856e8['order']=qs['sort'](_0x39ba59[_0xe3ed('0x30')][_0xe3ed('0x39')]);_0x1856e8['where']=qs[_0xe3ed('0x32')](_[_0xe3ed('0x3a')](_0x39ba59[_0xe3ed('0x30')],_0x3e289c['filters']),_0xe6956f);if(_0x39ba59[_0xe3ed('0x30')][_0xe3ed('0x3b')]){_0x1856e8[_0xe3ed('0x3c')]=_['merge'](_0x1856e8[_0xe3ed('0x3c')],{'$or':_[_0xe3ed('0x2c')](_0xe6956f,function(_0x43da35){if(_0x43da35[_0xe3ed('0x3d')]!==_0xe3ed('0x3e')){var _0x2f9619={};_0x2f9619[_0x43da35[_0xe3ed('0x29')]]={'$like':'%'+_0x39ba59[_0xe3ed('0x30')][_0xe3ed('0x3b')]+'%'};return _0x2f9619;}})});}_0x1856e8=_[_0xe3ed('0x3f')]({},_0x1856e8,_0x39ba59['options']);var _0x5e7995={'where':_0x1856e8['where']};return db[_0xe3ed('0x2d')][_0xe3ed('0x1d')](_0x5e7995)[_0xe3ed('0x24')](function(_0x1eb575){_0x373fd0[_0xe3ed('0x1d')]=_0x1eb575;if(_0x39ba59[_0xe3ed('0x30')]['includeAll']){_0x1856e8[_0xe3ed('0x40')]=[{'all':!![]}];}return db[_0xe3ed('0x2d')][_0xe3ed('0x41')](_0x1856e8);})[_0xe3ed('0x24')](function(_0xf3ef18){_0x373fd0['rows']=_0xf3ef18;return _0x373fd0;})[_0xe3ed('0x24')](respondWithFilteredResult(_0x3ac06e,_0x1856e8))[_0xe3ed('0x42')](handleError(_0x3ac06e,null));};exports[_0xe3ed('0x43')]=function(_0x407815,_0x5081fa){var _0x473afa={'raw':![],'where':{'id':_0x407815[_0xe3ed('0x44')]['id']}},_0xbb219e={};_0xbb219e['model']=_['keys'](db['AnalyticCustomReport'][_0xe3ed('0x2e')]);_0xbb219e[_0xe3ed('0x30')]=_['keys'](_0x407815[_0xe3ed('0x30')]);_0xbb219e[_0xe3ed('0x32')]=_[_0xe3ed('0x33')](_0xbb219e[_0xe3ed('0x2f')],_0xbb219e[_0xe3ed('0x30')]);_0x473afa[_0xe3ed('0x34')]=_[_0xe3ed('0x33')](_0xbb219e['model'],qs[_0xe3ed('0x35')](_0x407815['query'][_0xe3ed('0x35')]));_0x473afa[_0xe3ed('0x34')]=_0x473afa[_0xe3ed('0x34')][_0xe3ed('0x45')]?_0x473afa[_0xe3ed('0x34')]:_0xbb219e[_0xe3ed('0x2f')];if(_0x407815[_0xe3ed('0x30')][_0xe3ed('0x46')]){_0x473afa[_0xe3ed('0x40')]=[{'all':!![]}];}_0x473afa=_[_0xe3ed('0x3f')]({},_0x473afa,_0x407815[_0xe3ed('0x47')]);return db[_0xe3ed('0x2d')][_0xe3ed('0x48')](_0x473afa)['then'](handleEntityNotFound(_0x5081fa,null))[_0xe3ed('0x24')](respondWithResult(_0x5081fa,null))[_0xe3ed('0x42')](handleError(_0x5081fa,null));};exports['create']=function(_0xf9474e,_0x1ffd9e){return db['AnalyticCustomReport'][_0xe3ed('0x49')](_0xf9474e[_0xe3ed('0x4a')],{})[_0xe3ed('0x24')](function(_0x21c2c3){var _0x32388b=_0xf9474e[_0xe3ed('0x4b')][_0xe3ed('0x25')]({'plain':!![]});if(!_0x32388b)throw new Error(_0xe3ed('0x4c'));if(_0x32388b[_0xe3ed('0x4d')]==='user'){var _0x4d8896=_0x21c2c3[_0xe3ed('0x25')]({'plain':!![]});var _0x17398a=_0xe3ed('0x4e');return db[_0xe3ed('0x4f')]['find']({'where':{'name':_0x17398a,'userProfileId':_0x32388b[_0xe3ed('0x50')]},'raw':!![]})['then'](function(_0x498460){if(_0x498460&&_0x498460['autoAssociation']===0x0){return db[_0xe3ed('0x51')]['create']({'name':_0x4d8896[_0xe3ed('0x29')],'resourceId':_0x4d8896['id'],'type':'CustomReports','sectionId':_0x498460['id']},{})['then'](function(){return _0x21c2c3;});}else{return _0x21c2c3;}})[_0xe3ed('0x42')](function(_0x95d986){logger[_0xe3ed('0x28')](_0xe3ed('0x52'),_0x95d986);throw _0x95d986;});}return _0x21c2c3;})[_0xe3ed('0x24')](respondWithResult(_0x1ffd9e,0xc9))[_0xe3ed('0x42')](handleError(_0x1ffd9e,null));};exports[_0xe3ed('0x23')]=function(_0x5a0ef9,_0x1cf7f3){if(_0x5a0ef9[_0xe3ed('0x4a')]['id']){delete _0x5a0ef9[_0xe3ed('0x4a')]['id'];}return db['AnalyticCustomReport'][_0xe3ed('0x48')]({'where':{'id':_0x5a0ef9[_0xe3ed('0x44')]['id']}})[_0xe3ed('0x24')](handleEntityNotFound(_0x1cf7f3,null))[_0xe3ed('0x24')](saveUpdates(_0x5a0ef9[_0xe3ed('0x4a')],null))[_0xe3ed('0x24')](respondWithResult(_0x1cf7f3,null))[_0xe3ed('0x42')](handleError(_0x1cf7f3,null));};exports[_0xe3ed('0x53')]=function(_0x4100c1,_0xf4ad38){return db[_0xe3ed('0x2d')]['find']({'where':{'id':_0x4100c1[_0xe3ed('0x44')]['id']}})['then'](handleEntityNotFound(_0xf4ad38,null))[_0xe3ed('0x24')](removeEntity(_0xf4ad38,null))[_0xe3ed('0x42')](handleError(_0xf4ad38,null));};exports[_0xe3ed('0x54')]=function(_0x23f400,_0x4fd463){var _0x3bd450=0xa;var _0xd61b9d=[_0xe3ed('0x55'),_0xe3ed('0x56'),_0xe3ed('0x57'),_0xe3ed('0x58')];var _0xedab6d={'SUM':'SUM(%s)','COUNT':_0xe3ed('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe3ed('0x5a'),'MIN':_0xe3ed('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xe3ed('0x5c'),'GROUP_CONCAT ASC':_0xe3ed('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2da3c1={'SEC_TO_TIME':_0xe3ed('0x5e'),'DATE':'DATE(%s)','HOUR':_0xe3ed('0x5f'),'ROUND':_0xe3ed('0x60'),'UNIX_TIMESTAMP':_0xe3ed('0x61')};var _0x4fbfa3=function(_0x38aee4){return!_[_0xe3ed('0x62')](['IS\x20NULL',_0xe3ed('0x63'),'IS\x20EMPTY',_0xe3ed('0x64')],_0x38aee4);};var _0x115726=function(_0x1f63f3){if(!_0x1f63f3||!_0x1f63f3[_0xe3ed('0x65')]['length']){return'';}for(var _0x8c1295='(',_0x245086=0x0;_0x245086<_0x1f63f3[_0xe3ed('0x65')][_0xe3ed('0x45')];_0x245086+=0x1){_0x245086>0x0&&(_0x8c1295+='\x20'+_0x1f63f3[_0xe3ed('0x66')]+'\x20');_0x8c1295+=_0x1f63f3[_0xe3ed('0x65')][_0x245086][_0xe3ed('0x67')]?_0x115726(_0x1f63f3[_0xe3ed('0x65')][_0x245086][_0xe3ed('0x67')]):_0x1f63f3[_0xe3ed('0x65')][_0x245086][_0xe3ed('0x68')]+'\x20'+_0x1f63f3[_0xe3ed('0x65')][_0x245086]['condition']+(_0x4fbfa3(_0x1f63f3[_0xe3ed('0x65')][_0x245086][_0xe3ed('0x69')])?'\x20'+_0x1f63f3[_0xe3ed('0x65')][_0x245086][_0xe3ed('0x6a')]:'');}return _0x8c1295+')';};var _0x4c6857={'where':{'id':_0x23f400[_0xe3ed('0x44')]['id']}},_0x45523e,_0x3608a4,_0x10cacb,_0x1ee704,_0x1f160a;_0x4c6857=_['merge']({},_0x4c6857,_0x23f400[_0xe3ed('0x47')]);return db[_0xe3ed('0x2d')][_0xe3ed('0x48')](_0x4c6857)[_0xe3ed('0x24')](function(_0x5f0b11){if(_0x5f0b11){_0x45523e=_0x5f0b11;return _0x5f0b11[_0xe3ed('0x6b')]();}return null;})[_0xe3ed('0x24')](function(_0x403b12){if(_0x403b12){if(!_0x403b12[_0xe3ed('0x45')]){throw new db[(_0xe3ed('0x6c'))][(_0xe3ed('0x6d'))](_0xe3ed('0x6e'),0x193);}_0x3608a4=_0x403b12;return db[_0xe3ed('0x6f')][_0xe3ed('0x41')]({'raw':!![]});}return null;})['then'](function(_0x597ecb){if(_0x597ecb){_0x10cacb=_[_0xe3ed('0x70')](_0x597ecb,'id');var _0x2c2bef;var _0x459e5c=squel[_0xe3ed('0x71')]();_0x459e5c[_0xe3ed('0x72')](_0x45523e[_0xe3ed('0x73')]);for(var _0x3bbe87=0x0;_0x3bbe87<_0x3608a4[_0xe3ed('0x45')];_0x3bbe87+=0x1){_0x2c2bef=_0x3608a4[_0x3bbe87]['MetricId']?_0x10cacb[_0x3608a4[_0x3bbe87][_0xe3ed('0x74')]]['metric']:_0x3608a4[_0x3bbe87]['field'];_0x2c2bef=_0x3608a4[_0x3bbe87][_0xe3ed('0x75')]?_[_0xe3ed('0x76')](_0xedab6d[_0x3608a4[_0x3bbe87]['function']],'%s',_0x2c2bef):_0x2c2bef;_0x2c2bef=_0x3608a4[_0x3bbe87][_0xe3ed('0x77')]?_[_0xe3ed('0x76')](_0x2da3c1[_0x3608a4[_0x3bbe87]['format']],'%s',_0x2c2bef):_0x2c2bef;if(_0x3608a4[_0x3bbe87][_0xe3ed('0x78')]){_0x459e5c[_0xe3ed('0x67')](_0x2c2bef);}_0x3608a4[_0x3bbe87][_0xe3ed('0x79')]&&_0x459e5c[_0xe3ed('0x7a')](_0x2c2bef,_0x3608a4[_0x3bbe87][_0xe3ed('0x79')]===_0xe3ed('0x7b')?![]:!![]);_0x459e5c['field'](_0x2c2bef,_0x3608a4[_0x3bbe87][_0xe3ed('0x7c')]||_0x2c2bef);}if(_0x45523e[_0xe3ed('0x7d')]){_0x45523e[_0xe3ed('0x7d')]=JSON[_0xe3ed('0x7e')](_0x45523e['joins']);for(var _0x1a26af=0x0;_0x1a26af<_0x45523e[_0xe3ed('0x7d')][_0xe3ed('0x45')];_0x1a26af+=0x1){if(_0x45523e[_0xe3ed('0x7d')][_0x1a26af][_0xe3ed('0x3d')]&&_[_0xe3ed('0x62')](_0xd61b9d,_0x45523e[_0xe3ed('0x7d')][_0x1a26af]['type'])&&_0x45523e[_0xe3ed('0x7d')][_0x1a26af][_0xe3ed('0x7f')]&&_0x45523e[_0xe3ed('0x7d')][_0x1a26af]['foreignTable']&&_0x45523e[_0xe3ed('0x7d')][_0x1a26af]['foreignKey']){_0x459e5c[_0x45523e[_0xe3ed('0x7d')][_0x1a26af]['type']](_0x45523e[_0xe3ed('0x7d')][_0x1a26af][_0xe3ed('0x80')],null,util[_0xe3ed('0x77')](_0xe3ed('0x81'),_0x45523e[_0xe3ed('0x73')],_0x45523e[_0xe3ed('0x7d')][_0x1a26af][_0xe3ed('0x7f')],_0x45523e[_0xe3ed('0x7d')][_0x1a26af][_0xe3ed('0x80')],_0x45523e[_0xe3ed('0x7d')][_0x1a26af][_0xe3ed('0x82')]));}}}if(_0x45523e[_0xe3ed('0x83')]){_0x45523e[_0xe3ed('0x83')]=JSON[_0xe3ed('0x7e')](_0x45523e[_0xe3ed('0x83')]);_0x459e5c['where'](_0x115726(_0x45523e[_0xe3ed('0x83')]['group']));}_0x1f160a=_0x459e5c['clone']();_0x459e5c[_0xe3ed('0x38')](_0x3bd450);_0x459e5c['offset'](0x0);logger[_0xe3ed('0x84')](_0xe3ed('0x85'),_0x459e5c['toString']());return dbH[_0xe3ed('0x86')][_0xe3ed('0x30')](_0x459e5c[_0xe3ed('0x87')](),{'type':dbH[_0xe3ed('0x86')][_0xe3ed('0x88')]['SELECT']});}})[_0xe3ed('0x24')](respondWithResult(_0x4fd463,null))[_0xe3ed('0x42')](handleError(_0x4fd463,null));};function runReport(_0x5f4fe0,_0x18d1b6,_0x328265){var _0x412282=_0x18d1b6[_0xe3ed('0x29')];var _0x359a14=0xa;var _0x4a92a8=[_0xe3ed('0x55'),_0xe3ed('0x56'),'right_join',_0xe3ed('0x58')];var _0x10c96d={'SUM':_0xe3ed('0x89'),'COUNT':_0xe3ed('0x59'),'COUNT DISTINCT':_0xe3ed('0x8a'),'MAX':'MAX(%s)','MIN':_0xe3ed('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xe3ed('0x5c'),'GROUP_CONCAT ASC':_0xe3ed('0x5d'),'GROUP_CONCAT DESC':_0xe3ed('0x8b')};var _0x31433d={'SEC_TO_TIME':_0xe3ed('0x5e'),'DATE':_0xe3ed('0x8c'),'HOUR':_0xe3ed('0x5f'),'ROUND':_0xe3ed('0x60'),'UNIX_TIMESTAMP':_0xe3ed('0x61')};var _0x2eb3e4=function(_0x460d7d){return!_[_0xe3ed('0x62')]([_0xe3ed('0x8d'),_0xe3ed('0x63'),_0xe3ed('0x8e'),_0xe3ed('0x64')],_0x460d7d);};var _0x137ba2=function(_0x5286c9){if(!_0x5286c9||!_0x5286c9['rules'][_0xe3ed('0x45')]){return'';}for(var _0x500c13='(',_0x4428cd=0x0;_0x4428cd<_0x5286c9[_0xe3ed('0x65')]['length'];_0x4428cd+=0x1){_0x4428cd>0x0&&(_0x500c13+='\x20'+_0x5286c9[_0xe3ed('0x66')]+'\x20');_0x500c13+=_0x5286c9['rules'][_0x4428cd][_0xe3ed('0x67')]?_0x137ba2(_0x5286c9['rules'][_0x4428cd][_0xe3ed('0x67')]):_0x5286c9[_0xe3ed('0x65')][_0x4428cd][_0xe3ed('0x68')]+'\x20'+_0x5286c9[_0xe3ed('0x65')][_0x4428cd][_0xe3ed('0x69')]+(_0x2eb3e4(_0x5286c9[_0xe3ed('0x65')][_0x4428cd]['condition'])?'\x20'+_0x5286c9[_0xe3ed('0x65')][_0x4428cd][_0xe3ed('0x6a')]:'');}return _0x500c13+')';};var _0x203b59={'where':{'id':_0x5f4fe0['id']}},_0x19df8b,_0x5237f3,_0x4928af,_0x15c4b7,_0x394d04;_0x203b59=_[_0xe3ed('0x3f')]({},_0x203b59,_0x328265);return db[_0xe3ed('0x2d')][_0xe3ed('0x48')](_0x203b59)['then'](function(_0x3f420e){if(_0x3f420e){_0x19df8b=_0x3f420e;return _0x3f420e[_0xe3ed('0x6b')]();}return null;})[_0xe3ed('0x24')](function(_0x22b81f){if(_0x22b81f){if(!_0x22b81f[_0xe3ed('0x45')]){throw new db[(_0xe3ed('0x6c'))][(_0xe3ed('0x6d'))](_0xe3ed('0x6e'),0x193);}_0x5237f3=_0x22b81f;return db[_0xe3ed('0x6f')][_0xe3ed('0x41')]({'raw':!![]});}return null;})[_0xe3ed('0x24')](function(_0x3a1b44){if(_0x3a1b44){_0x4928af=_[_0xe3ed('0x70')](_0x3a1b44,'id');var _0x5492c3;var _0x468b89=squel[_0xe3ed('0x71')]();_0x468b89[_0xe3ed('0x72')](_0x19df8b['table']);for(var _0x23ff01=0x0;_0x23ff01<_0x5237f3[_0xe3ed('0x45')];_0x23ff01+=0x1){_0x5492c3=_0x5237f3[_0x23ff01]['MetricId']?_0x4928af[_0x5237f3[_0x23ff01][_0xe3ed('0x74')]][_0xe3ed('0x8f')]:_0x5237f3[_0x23ff01][_0xe3ed('0x68')];_0x5492c3=_0x5237f3[_0x23ff01][_0xe3ed('0x75')]?_[_0xe3ed('0x76')](_0x10c96d[_0x5237f3[_0x23ff01][_0xe3ed('0x75')]],'%s',_0x5492c3):_0x5492c3;_0x5492c3=_0x5237f3[_0x23ff01][_0xe3ed('0x77')]?_['replace'](_0x31433d[_0x5237f3[_0x23ff01][_0xe3ed('0x77')]],'%s',_0x5492c3):_0x5492c3;if(_0x5237f3[_0x23ff01][_0xe3ed('0x78')]){_0x468b89[_0xe3ed('0x67')](_0x5492c3);}_0x5237f3[_0x23ff01][_0xe3ed('0x79')]&&_0x468b89[_0xe3ed('0x7a')](_0x5492c3,_0x5237f3[_0x23ff01][_0xe3ed('0x79')]===_0xe3ed('0x7b')?![]:!![]);_0x468b89['field'](_0x5492c3,_0x5237f3[_0x23ff01][_0xe3ed('0x7c')]||_0x5492c3);}if(_0x19df8b[_0xe3ed('0x7d')]){_0x19df8b['joins']=JSON['parse'](_0x19df8b[_0xe3ed('0x7d')]);for(var _0x47c021=0x0;_0x47c021<_0x19df8b['joins'][_0xe3ed('0x45')];_0x47c021+=0x1){if(_0x19df8b[_0xe3ed('0x7d')][_0x47c021][_0xe3ed('0x3d')]&&_[_0xe3ed('0x62')](_0x4a92a8,_0x19df8b[_0xe3ed('0x7d')][_0x47c021]['type'])&&_0x19df8b[_0xe3ed('0x7d')][_0x47c021][_0xe3ed('0x7f')]&&_0x19df8b[_0xe3ed('0x7d')][_0x47c021][_0xe3ed('0x80')]&&_0x19df8b[_0xe3ed('0x7d')][_0x47c021][_0xe3ed('0x82')]){_0x468b89[_0x19df8b[_0xe3ed('0x7d')][_0x47c021][_0xe3ed('0x3d')]](_0x19df8b['joins'][_0x47c021][_0xe3ed('0x80')],null,util[_0xe3ed('0x77')](_0xe3ed('0x81'),_0x19df8b['table'],_0x19df8b['joins'][_0x47c021][_0xe3ed('0x7f')],_0x19df8b[_0xe3ed('0x7d')][_0x47c021][_0xe3ed('0x80')],_0x19df8b['joins'][_0x47c021]['foreignKey']));}}}if(_0x19df8b[_0xe3ed('0x83')]){_0x19df8b['conditions']=JSON[_0xe3ed('0x7e')](_0x19df8b['conditions']);_0x468b89[_0xe3ed('0x3c')](_0x137ba2(_0x19df8b['conditions']['group']));}_0x394d04=_0x468b89[_0xe3ed('0x90')]();_0x468b89[_0xe3ed('0x38')](_0x359a14);_0x468b89[_0xe3ed('0x1b')](0x0);return;}})['then'](function(){if(_0x18d1b6[_0xe3ed('0x91')]==='web'){return null;}var _0x39b380=_[_0xe3ed('0x3f')](_0x18d1b6,{'name':_0x18d1b6[_0xe3ed('0x92')]||_0x18d1b6[_0xe3ed('0x29')]||_0x19df8b[_0xe3ed('0x29')],'basename':_0x412282,'savename':util[_0xe3ed('0x77')](_0xe3ed('0x93'),_0x18d1b6[_0xe3ed('0x29')]||_0x19df8b[_0xe3ed('0x29')],require(_0xe3ed('0x94'))[_0xe3ed('0x95')](0x4),_0x18d1b6[_0xe3ed('0x91')]||_0xe3ed('0x96')),'reportId':_0x19df8b['id'],'reportType':'custom'});return db[_0xe3ed('0x97')][_0xe3ed('0x49')](_0x39b380,{'raw':!![]});})[_0xe3ed('0x24')](function(_0x28d171){if(_0x19df8b[_0xe3ed('0x73')]===_0xe3ed('0x98')){_0x394d04[_0xe3ed('0x3c')](_0x19df8b[_0xe3ed('0x73')]+_0xe3ed('0x99'),_0x18d1b6[_0xe3ed('0x9a')],_0x18d1b6[_0xe3ed('0x9b')]);}else{_0x394d04[_0xe3ed('0x3c')](_0x19df8b[_0xe3ed('0x73')]+_0xe3ed('0x9c'),_0x18d1b6[_0xe3ed('0x9a')],_0x18d1b6[_0xe3ed('0x9b')]);}if(_0x28d171){logger[_0xe3ed('0x9d')](_0xe3ed('0x9e'),_0x394d04['toString']());require('child_process')['fork'](path[_0xe3ed('0x55')](__dirname,_0xe3ed('0x9f'),_0x28d171[_0xe3ed('0x91')]),[_0x28d171['id'],_0x394d04[_0xe3ed('0x87')](),path[_0xe3ed('0x55')](__dirname,_0xe3ed('0xa0'),_0x28d171['savename']),_0x412282]);return _0x28d171;}else{var _0x2c46e8=squel['select']();_0x2c46e8[_0xe3ed('0x72')]('('+_0x394d04[_0xe3ed('0x87')]()+')',_0xe3ed('0xa1'));_0x2c46e8[_0xe3ed('0x68')]('COUNT(*)',_0xe3ed('0x1d'));_0x394d04[_0xe3ed('0x38')](_0x18d1b6[_0xe3ed('0x38')]||_0x359a14);_0x394d04[_0xe3ed('0x1b')](_0x18d1b6['offset']||0x0);return dbH[_0xe3ed('0x86')][_0xe3ed('0x30')](_0x2c46e8['toString'](),{'type':dbH['sequelize'][_0xe3ed('0x88')][_0xe3ed('0xa2')]})[_0xe3ed('0x24')](function(_0x247891){if(!_0x247891[_0xe3ed('0x45')]){_0x15c4b7=0x0;}else{_0x15c4b7=_0x247891[0x0][_0xe3ed('0x1d')]||0x0;}return dbH[_0xe3ed('0x86')]['query'](_0x394d04['toString'](),{'type':dbH[_0xe3ed('0x86')][_0xe3ed('0x88')]['SELECT']});})['then'](function(_0x5c5f20){return{'rows':_0x5c5f20||[],'count':_0x15c4b7};});}});}exports[_0xe3ed('0xa3')]=function(_0x8c90ec,_0x416995){return runReport(_0x8c90ec['params'],_0x8c90ec[_0xe3ed('0x30')],_0x8c90ec['options'])[_0xe3ed('0x24')](respondWithResult(_0x416995,null))[_0xe3ed('0x42')](handleError(_0x416995,null));};exports[_0xe3ed('0xa4')]=runReport;exports[_0xe3ed('0x30')]=function(_0x269ab7,_0x4f2caa){var _0x106e2d=0xa;var _0x386fda=['join','left_join',_0xe3ed('0x57'),'cross_join'];var _0xb47ac9={'SUM':_0xe3ed('0x89'),'COUNT':_0xe3ed('0x59'),'COUNT DISTINCT':_0xe3ed('0x8a'),'MAX':_0xe3ed('0x5a'),'MIN':_0xe3ed('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xe3ed('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe3ed('0x8b')};var _0x1f7545={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xe3ed('0x8c'),'HOUR':'HOUR(%s)','ROUND':_0xe3ed('0x60'),'UNIX_TIMESTAMP':_0xe3ed('0x61')};var _0x36324b=function(_0x333d57){return!_['includes']([_0xe3ed('0x8d'),'IS\x20NOT\x20NULL',_0xe3ed('0x8e'),_0xe3ed('0x64')],_0x333d57);};var _0x499ce1=function(_0x3e0630){if(!_0x3e0630||!_0x3e0630['rules']['length']){return'';}for(var _0xd39e2d='(',_0x26bb3f=0x0;_0x26bb3f<_0x3e0630[_0xe3ed('0x65')]['length'];_0x26bb3f+=0x1){_0x26bb3f>0x0&&(_0xd39e2d+='\x20'+_0x3e0630['operator']+'\x20');_0xd39e2d+=_0x3e0630['rules'][_0x26bb3f][_0xe3ed('0x67')]?_0x499ce1(_0x3e0630['rules'][_0x26bb3f][_0xe3ed('0x67')]):_0x3e0630[_0xe3ed('0x65')][_0x26bb3f][_0xe3ed('0x68')]+'\x20'+_0x3e0630[_0xe3ed('0x65')][_0x26bb3f][_0xe3ed('0x69')]+(_0x36324b(_0x3e0630[_0xe3ed('0x65')][_0x26bb3f]['condition'])?'\x20'+_0x3e0630[_0xe3ed('0x65')][_0x26bb3f]['value']:'');}return _0xd39e2d+')';};var _0x29141c={'where':{'id':_0x269ab7[_0xe3ed('0x44')]['id']}},_0x142434,_0x4f3814,_0x3418e1,_0x184a7f,_0x196562;_0x29141c=_[_0xe3ed('0x3f')]({},_0x29141c,_0x269ab7[_0xe3ed('0x47')]);return db[_0xe3ed('0x2d')][_0xe3ed('0x48')](_0x29141c)[_0xe3ed('0x24')](function(_0x13d1dd){if(_0x13d1dd){_0x142434=_0x13d1dd;return _0x13d1dd[_0xe3ed('0x6b')]();}return null;})[_0xe3ed('0x24')](function(_0x557e07){if(_0x557e07){if(!_0x557e07[_0xe3ed('0x45')]){throw new db[(_0xe3ed('0x6c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4f3814=_0x557e07;return db[_0xe3ed('0x6f')][_0xe3ed('0x41')]({'raw':!![]});}return null;})[_0xe3ed('0x24')](function(_0x1e92df){if(_0x1e92df){_0x3418e1=_[_0xe3ed('0x70')](_0x1e92df,'id');var _0x2988bf;var _0x3bcbbb=squel[_0xe3ed('0x71')]();_0x3bcbbb[_0xe3ed('0x72')](_0x142434[_0xe3ed('0x73')]);for(var _0x5a2625=0x0;_0x5a2625<_0x4f3814[_0xe3ed('0x45')];_0x5a2625+=0x1){_0x2988bf=_0x4f3814[_0x5a2625]['MetricId']?_0x3418e1[_0x4f3814[_0x5a2625]['MetricId']][_0xe3ed('0x8f')]:_0x4f3814[_0x5a2625][_0xe3ed('0x68')];_0x2988bf=_0x4f3814[_0x5a2625][_0xe3ed('0x75')]?_[_0xe3ed('0x76')](_0xb47ac9[_0x4f3814[_0x5a2625][_0xe3ed('0x75')]],'%s',_0x2988bf):_0x2988bf;_0x2988bf=_0x4f3814[_0x5a2625][_0xe3ed('0x77')]?_[_0xe3ed('0x76')](_0x1f7545[_0x4f3814[_0x5a2625][_0xe3ed('0x77')]],'%s',_0x2988bf):_0x2988bf;if(_0x4f3814[_0x5a2625]['groupBy']){_0x3bcbbb['group'](_0x2988bf);}_0x4f3814[_0x5a2625]['orderBy']&&_0x3bcbbb['order'](_0x2988bf,_0x4f3814[_0x5a2625][_0xe3ed('0x79')]===_0xe3ed('0x7b')?![]:!![]);_0x3bcbbb[_0xe3ed('0x68')](_0x2988bf,_0x4f3814[_0x5a2625]['alias']||_0x2988bf);}if(_0x142434['joins']){_0x142434['joins']=JSON[_0xe3ed('0x7e')](_0x142434[_0xe3ed('0x7d')]);for(var _0x417fb9=0x0;_0x417fb9<_0x142434['joins'][_0xe3ed('0x45')];_0x417fb9+=0x1){if(_0x142434[_0xe3ed('0x7d')][_0x417fb9]['type']&&_[_0xe3ed('0x62')](_0x386fda,_0x142434[_0xe3ed('0x7d')][_0x417fb9][_0xe3ed('0x3d')])&&_0x142434[_0xe3ed('0x7d')][_0x417fb9][_0xe3ed('0x7f')]&&_0x142434[_0xe3ed('0x7d')][_0x417fb9][_0xe3ed('0x80')]&&_0x142434['joins'][_0x417fb9]['foreignKey']){_0x3bcbbb[_0x142434[_0xe3ed('0x7d')][_0x417fb9][_0xe3ed('0x3d')]](_0x142434['joins'][_0x417fb9][_0xe3ed('0x80')],null,util[_0xe3ed('0x77')]('%s.%s\x20=\x20%s.%s',_0x142434['table'],_0x142434['joins'][_0x417fb9][_0xe3ed('0x7f')],_0x142434[_0xe3ed('0x7d')][_0x417fb9][_0xe3ed('0x80')],_0x142434[_0xe3ed('0x7d')][_0x417fb9][_0xe3ed('0x82')]));}}}if(_0x142434[_0xe3ed('0x83')]){_0x142434[_0xe3ed('0x83')]=JSON[_0xe3ed('0x7e')](_0x142434['conditions']);_0x3bcbbb[_0xe3ed('0x3c')](_0x499ce1(_0x142434[_0xe3ed('0x83')][_0xe3ed('0x67')]));}_0x196562=_0x3bcbbb[_0xe3ed('0x90')]();_0x3bcbbb[_0xe3ed('0x38')](_0x106e2d);_0x3bcbbb[_0xe3ed('0x1b')](0x0);logger[_0xe3ed('0x84')](_0xe3ed('0x85'),_0x3bcbbb[_0xe3ed('0x87')]());return dbH[_0xe3ed('0x86')][_0xe3ed('0x30')](_0x3bcbbb[_0xe3ed('0x87')](),{'type':dbH[_0xe3ed('0x86')][_0xe3ed('0x88')][_0xe3ed('0xa2')]});}})['then'](function(){return{'sql':_0x196562[_0xe3ed('0x87')]()};})[_0xe3ed('0x24')](respondWithResult(_0x4f2caa,null))[_0xe3ed('0x42')](handleError(_0x4f2caa,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index d0d5b36..9c89592 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 _0x31c1=['request-promise','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','api','moment'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0x31c1,0xcf));var _0x131c=function(_0x44c96b,_0x5e1812){_0x44c96b=_0x44c96b-0x0;var _0x47c673=_0x31c1[_0x44c96b];return _0x47c673;};'use strict';var _=require(_0x131c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x131c('0x1'));var moment=require(_0x131c('0x2'));var BPromise=require('bluebird');var rp=require(_0x131c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x131c('0x4'));var config=require('../../config/environment');var attributes=require(_0x131c('0x5'));module[_0x131c('0x6')]=function(_0x21a6bf,_0x4654f1){return _0x21a6bf[_0x131c('0x7')](_0x131c('0x8'),attributes,{'tableName':_0x131c('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcaf=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5e7551,_0x59bc05){var _0x31a117=function(_0x28fe2e){while(--_0x28fe2e){_0x5e7551['push'](_0x5e7551['shift']());}};_0x31a117(++_0x59bc05);}(_0xbcaf,0x112));var _0xfbca=function(_0x4dd6bd,_0x528d5d){_0x4dd6bd=_0x4dd6bd-0x0;var _0x5e02b1=_0xbcaf[_0x4dd6bd];return _0x5e02b1;};'use strict';var _=require('lodash');var util=require(_0xfbca('0x0'));var logger=require(_0xfbca('0x1'))(_0xfbca('0x2'));var moment=require(_0xfbca('0x3'));var BPromise=require(_0xfbca('0x4'));var rp=require(_0xfbca('0x5'));var fs=require('fs');var path=require(_0xfbca('0x6'));var rimraf=require(_0xfbca('0x7'));var config=require(_0xfbca('0x8'));var attributes=require(_0xfbca('0x9'));module[_0xfbca('0xa')]=function(_0x378d7d,_0x2f0bf7){return _0x378d7d[_0xfbca('0xb')](_0xfbca('0xc'),attributes,{'tableName':_0xfbca('0xd'),'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 22a2aa4..d403d6a 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 _0xc2b4=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xc2b4,0xbc));var _0x4c2b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc2b4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4c2b('0x0'));var util=require(_0x4c2b('0x1'));var moment=require(_0x4c2b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c2b('0x3'));var db=require(_0x4c2b('0x4'))['db'];var utils=require(_0x4c2b('0x5'));var logger=require(_0x4c2b('0x6'))('rpc');var config=require(_0x4c2b('0x7'));var jayson=require(_0x4c2b('0x8'));var client=jayson[_0x4c2b('0x9')][_0x4c2b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4734e8,_0x8125c1,_0x527654){return new BPromise(function(_0x579e5e,_0x4b8024){return client[_0x4c2b('0xb')](_0x4734e8,_0x527654)[_0x4c2b('0xc')](function(_0x36c5fe){logger[_0x4c2b('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8125c1,_0x4c2b('0xe'));logger[_0x4c2b('0xf')](_0x4c2b('0x10'),_0x8125c1,_0x4c2b('0xe'),JSON[_0x4c2b('0x11')](_0x36c5fe));if(_0x36c5fe['error']){if(_0x36c5fe['error'][_0x4c2b('0x12')]===0x1f4){logger[_0x4c2b('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8125c1,_0x36c5fe[_0x4c2b('0x13')]['message']);return _0x4b8024(_0x36c5fe[_0x4c2b('0x13')][_0x4c2b('0x14')]);}logger[_0x4c2b('0x13')](_0x4c2b('0x15'),_0x8125c1,_0x36c5fe[_0x4c2b('0x13')]['message']);return _0x579e5e(_0x36c5fe[_0x4c2b('0x13')][_0x4c2b('0x14')]);}else{logger[_0x4c2b('0xd')](_0x4c2b('0x15'),_0x8125c1,_0x4c2b('0xe'));_0x579e5e(_0x36c5fe[_0x4c2b('0x16')][_0x4c2b('0x14')]);}})[_0x4c2b('0x17')](function(_0x402832){logger[_0x4c2b('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8125c1,_0x402832);_0x4b8024(_0x402832);});});} \ No newline at end of file +var _0x0b3d=['then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','AnalyticCustomReport,\x20%s,\x20%s','result','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x1d2eff,_0x45286f){var _0x25e995=function(_0x22feec){while(--_0x22feec){_0x1d2eff['push'](_0x1d2eff['shift']());}};_0x25e995(++_0x45286f);}(_0x0b3d,0x127));var _0xd0b3=function(_0x1e62b8,_0x5eed4c){_0x1e62b8=_0x1e62b8-0x0;var _0x2ab271=_0x0b3d[_0x1e62b8];return _0x2ab271;};'use strict';var _=require(_0xd0b3('0x0'));var util=require('util');var moment=require(_0xd0b3('0x1'));var BPromise=require(_0xd0b3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd0b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd0b3('0x4'));var logger=require('../../config/logger')(_0xd0b3('0x5'));var config=require(_0xd0b3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd0b3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54da81,_0x20df66,_0x3f91f8){return new BPromise(function(_0x4c77ba,_0x1e1532){return client[_0xd0b3('0x8')](_0x54da81,_0x3f91f8)[_0xd0b3('0x9')](function(_0x255325){logger[_0xd0b3('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x20df66,_0xd0b3('0xb'));logger[_0xd0b3('0xc')](_0xd0b3('0xd'),_0x20df66,_0xd0b3('0xb'),JSON[_0xd0b3('0xe')](_0x255325));if(_0x255325[_0xd0b3('0xf')]){if(_0x255325[_0xd0b3('0xf')]['code']===0x1f4){logger[_0xd0b3('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x20df66,_0x255325[_0xd0b3('0xf')][_0xd0b3('0x10')]);return _0x1e1532(_0x255325[_0xd0b3('0xf')][_0xd0b3('0x10')]);}logger[_0xd0b3('0xf')](_0xd0b3('0x11'),_0x20df66,_0x255325['error']['message']);return _0x4c77ba(_0x255325[_0xd0b3('0xf')]['message']);}else{logger['info'](_0xd0b3('0x11'),_0x20df66,'request\x20sent');_0x4c77ba(_0x255325[_0xd0b3('0x12')][_0xd0b3('0x10')]);}})['catch'](function(_0x5768f1){logger[_0xd0b3('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x20df66,_0x5768f1);_0x1e1532(_0x5768f1);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index cbd7ce0..e60f9c6 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 _0x5cf5=['Router','fs-extra','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','run','query','post','update','delete','destroy','exports','multer','path','express'];(function(_0xa8b370,_0x2b77db){var _0x643e37=function(_0x1486eb){while(--_0x1486eb){_0xa8b370['push'](_0xa8b370['shift']());}};_0x643e37(++_0x2b77db);}(_0x5cf5,0x89));var _0x55cf=function(_0x1ae6b3,_0x3290bb){_0x1ae6b3=_0x1ae6b3-0x0;var _0x311586=_0x5cf5[_0x1ae6b3];return _0x311586;};'use strict';var multer=require(_0x55cf('0x0'));var util=require('util');var path=require(_0x55cf('0x1'));var timeout=require('connect-timeout');var express=require(_0x55cf('0x2'));var router=express[_0x55cf('0x3')]();var fs_extra=require(_0x55cf('0x4'));var auth=require(_0x55cf('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x55cf('0x6'));router[_0x55cf('0x7')]('/',auth[_0x55cf('0x8')](),controller['index']);router[_0x55cf('0x7')](_0x55cf('0x9'),auth[_0x55cf('0x8')](),controller[_0x55cf('0xa')]);router[_0x55cf('0x7')](_0x55cf('0xb'),auth[_0x55cf('0x8')](),controller[_0x55cf('0xc')]);router['get']('/:id/run',auth[_0x55cf('0x8')](),controller[_0x55cf('0xd')]);router[_0x55cf('0x7')]('/:id/query',auth[_0x55cf('0x8')](),controller[_0x55cf('0xe')]);router[_0x55cf('0xf')]('/',auth[_0x55cf('0x8')](),controller['create']);router['put']('/:id',auth[_0x55cf('0x8')](),controller[_0x55cf('0x10')]);router[_0x55cf('0x11')](_0x55cf('0x9'),auth[_0x55cf('0x8')](),controller[_0x55cf('0x12')]);module[_0x55cf('0x13')]=router; \ No newline at end of file +var _0x45b5=['get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','/:id/query','post','put','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2f3874,_0x14e659){var _0x9de217=function(_0x41cebe){while(--_0x41cebe){_0x2f3874['push'](_0x2f3874['shift']());}};_0x9de217(++_0x14e659);}(_0x45b5,0x1c3));var _0x545b=function(_0xb4a92c,_0x530597){_0xb4a92c=_0xb4a92c-0x0;var _0x3f5384=_0x45b5[_0xb4a92c];return _0x3f5384;};'use strict';var multer=require(_0x545b('0x0'));var util=require(_0x545b('0x1'));var path=require(_0x545b('0x2'));var timeout=require(_0x545b('0x3'));var express=require('express');var router=express[_0x545b('0x4')]();var fs_extra=require(_0x545b('0x5'));var auth=require(_0x545b('0x6'));var interaction=require(_0x545b('0x7'));var config=require(_0x545b('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x545b('0x9')]('/',auth[_0x545b('0xa')](),controller['index']);router['get'](_0x545b('0xb'),auth[_0x545b('0xa')](),controller[_0x545b('0xc')]);router['get'](_0x545b('0xd'),auth[_0x545b('0xa')](),controller[_0x545b('0xe')]);router[_0x545b('0x9')](_0x545b('0xf'),auth[_0x545b('0xa')](),controller['run']);router[_0x545b('0x9')](_0x545b('0x10'),auth[_0x545b('0xa')](),controller['query']);router[_0x545b('0x11')]('/',auth[_0x545b('0xa')](),controller['create']);router[_0x545b('0x12')](_0x545b('0xb'),auth[_0x545b('0xa')](),controller['update']);router['delete']('/:id',auth[_0x545b('0xa')](),controller[_0x545b('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index a2d64ed..3fdb2d2 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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x232e7a,_0x19997){var _0x445ddd=function(_0x43628d){while(--_0x43628d){_0x232e7a['push'](_0x232e7a['shift']());}};_0x445ddd(++_0x19997);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x2deac4,_0xc27a2b){_0x2deac4=_0x2deac4-0x0;var _0x1c0bda=_0xfdbd[_0x2deac4];return _0x1c0bda;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file +var _0x7c09=['exports','STRING','TEXT'];(function(_0x294b13,_0x368a13){var _0x13b88c=function(_0x3b6e50){while(--_0x3b6e50){_0x294b13['push'](_0x294b13['shift']());}};_0x13b88c(++_0x368a13);}(_0x7c09,0x102));var _0x97c0=function(_0x34d692,_0x3c60ec){_0x34d692=_0x34d692-0x0;var _0x4656ff=_0x7c09[_0x34d692];return _0x4656ff;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 33da7ec..75ba702 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 _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','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','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x50c52e,_0x2b747d){var _0x2edb61=function(_0x577f78){while(--_0x577f78){_0x50c52e['push'](_0x50c52e['shift']());}};_0x2edb61(++_0x2b747d);}(_0xf494,0x1c6));var _0x4f49=function(_0x390645,_0x20383a){_0x390645=_0x390645-0x0;var _0xb0308=_0xf494[_0x390645];return _0xb0308;};'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'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));}; \ No newline at end of file +var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0xd7d2,_0x5ad1cd){var _0x58ef71=function(_0x11a4b8){while(--_0x11a4b8){_0xd7d2['push'](_0xd7d2['shift']());}};_0x58ef71(++_0x5ad1cd);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 86d0bef..3db2048 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 _0xf3c8=['api','bluebird','request-promise','rimraf','../../config/environment','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0x57d973,_0x283ef5){var _0x1a2d7b=function(_0x1410cb){while(--_0x1410cb){_0x57d973['push'](_0x57d973['shift']());}};_0x1a2d7b(++_0x283ef5);}(_0xf3c8,0x13e));var _0x8f3c=function(_0x346af7,_0x1b7649){_0x346af7=_0x346af7-0x0;var _0x1772bb=_0xf3c8[_0x346af7];return _0x1772bb;};'use strict';var _=require(_0x8f3c('0x0'));var util=require(_0x8f3c('0x1'));var logger=require('../../config/logger')(_0x8f3c('0x2'));var moment=require('moment');var BPromise=require(_0x8f3c('0x3'));var rp=require(_0x8f3c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f3c('0x5'));var config=require(_0x8f3c('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x8f3c('0x7')]=function(_0x57c0e6,_0x2d954b){return _0x57c0e6['define'](_0x8f3c('0x8'),attributes,{'tableName':_0x8f3c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x492b=['AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define'];(function(_0x49d7a7,_0x2dc9ae){var _0xa97c90=function(_0x56ebe5){while(--_0x56ebe5){_0x49d7a7['push'](_0x49d7a7['shift']());}};_0xa97c90(++_0x2dc9ae);}(_0x492b,0x154));var _0xb492=function(_0x1f2e97,_0x25b123){_0x1f2e97=_0x1f2e97-0x0;var _0x5ed628=_0x492b[_0x1f2e97];return _0x5ed628;};'use strict';var _=require(_0xb492('0x0'));var util=require(_0xb492('0x1'));var logger=require('../../config/logger')(_0xb492('0x2'));var moment=require(_0xb492('0x3'));var BPromise=require(_0xb492('0x4'));var rp=require(_0xb492('0x5'));var fs=require('fs');var path=require(_0xb492('0x6'));var rimraf=require(_0xb492('0x7'));var config=require('../../config/environment');var attributes=require(_0xb492('0x8'));module[_0xb492('0x9')]=function(_0x4785cf,_0x4789ec){return _0x4785cf[_0xb492('0xa')](_0xb492('0xb'),attributes,{'tableName':_0xb492('0xc'),'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 88b7c6d..ceb98e0 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 _0xe721=['code','AnalyticDefaultReport,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x13fe35,_0x537cee){var _0x4875a8=function(_0x3fb855){while(--_0x3fb855){_0x13fe35['push'](_0x13fe35['shift']());}};_0x4875a8(++_0x537cee);}(_0xe721,0x150));var _0x1e72=function(_0x38833a,_0x151c2d){_0x38833a=_0x38833a-0x0;var _0x2ec16=_0xe721[_0x38833a];return _0x2ec16;};'use strict';var _=require(_0x1e72('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1e72('0x1'));var rs=require(_0x1e72('0x2'));var fs=require('fs');var Redis=require(_0x1e72('0x3'));var db=require(_0x1e72('0x4'))['db'];var utils=require(_0x1e72('0x5'));var logger=require(_0x1e72('0x6'))(_0x1e72('0x7'));var config=require(_0x1e72('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1e72('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d4e81,_0x59dbf7,_0x1d914f){return new BPromise(function(_0x5d8423,_0x4e5247){return client['request'](_0x3d4e81,_0x1d914f)[_0x1e72('0xa')](function(_0x5d88c4){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x59dbf7,_0x1e72('0xb'));logger[_0x1e72('0xc')](_0x1e72('0xd'),_0x59dbf7,_0x1e72('0xb'),JSON[_0x1e72('0xe')](_0x5d88c4));if(_0x5d88c4[_0x1e72('0xf')]){if(_0x5d88c4[_0x1e72('0xf')][_0x1e72('0x10')]===0x1f4){logger['error'](_0x1e72('0x11'),_0x59dbf7,_0x5d88c4[_0x1e72('0xf')]['message']);return _0x4e5247(_0x5d88c4[_0x1e72('0xf')][_0x1e72('0x12')]);}logger[_0x1e72('0xf')](_0x1e72('0x11'),_0x59dbf7,_0x5d88c4[_0x1e72('0xf')][_0x1e72('0x12')]);return _0x5d8423(_0x5d88c4['error'][_0x1e72('0x12')]);}else{logger[_0x1e72('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x59dbf7,_0x1e72('0xb'));_0x5d8423(_0x5d88c4[_0x1e72('0x14')][_0x1e72('0x12')]);}})[_0x1e72('0x15')](function(_0x3f10cf){logger[_0x1e72('0xf')](_0x1e72('0x11'),_0x59dbf7,_0x3f10cf);_0x4e5247(_0x3f10cf);});});} \ No newline at end of file +var _0xe906=['request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x4f8997,_0x311d5){var _0x2bf9db=function(_0x50ca90){while(--_0x50ca90){_0x4f8997['push'](_0x4f8997['shift']());}};_0x2bf9db(++_0x311d5);}(_0xe906,0xee));var _0x6e90=function(_0xcde77c,_0x134a79){_0xcde77c=_0xcde77c-0x0;var _0x470f2e=_0xe906[_0xcde77c];return _0x470f2e;};'use strict';var _=require(_0x6e90('0x0'));var util=require(_0x6e90('0x1'));var moment=require(_0x6e90('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e90('0x3'));var fs=require('fs');var Redis=require(_0x6e90('0x4'));var db=require(_0x6e90('0x5'))['db'];var utils=require(_0x6e90('0x6'));var logger=require(_0x6e90('0x7'))(_0x6e90('0x8'));var config=require('../../config/environment');var jayson=require(_0x6e90('0x9'));var client=jayson[_0x6e90('0xa')][_0x6e90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7e7794,_0x405276,_0x554dd2){return new BPromise(function(_0x5ef73c,_0x2ac5c2){return client[_0x6e90('0xc')](_0x7e7794,_0x554dd2)[_0x6e90('0xd')](function(_0x4752ca){logger[_0x6e90('0xe')](_0x6e90('0xf'),_0x405276,_0x6e90('0x10'));logger[_0x6e90('0x11')](_0x6e90('0x12'),_0x405276,_0x6e90('0x10'),JSON[_0x6e90('0x13')](_0x4752ca));if(_0x4752ca[_0x6e90('0x14')]){if(_0x4752ca[_0x6e90('0x14')][_0x6e90('0x15')]===0x1f4){logger[_0x6e90('0x14')](_0x6e90('0xf'),_0x405276,_0x4752ca[_0x6e90('0x14')][_0x6e90('0x16')]);return _0x2ac5c2(_0x4752ca['error'][_0x6e90('0x16')]);}logger[_0x6e90('0x14')](_0x6e90('0xf'),_0x405276,_0x4752ca[_0x6e90('0x14')][_0x6e90('0x16')]);return _0x5ef73c(_0x4752ca[_0x6e90('0x14')][_0x6e90('0x16')]);}else{logger[_0x6e90('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x405276,'request\x20sent');_0x5ef73c(_0x4752ca[_0x6e90('0x17')][_0x6e90('0x16')]);}})[_0x6e90('0x18')](function(_0x540237){logger[_0x6e90('0x14')](_0x6e90('0xf'),_0x405276,_0x540237);_0x2ac5c2(_0x540237);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 6ee306d..1d9a7fc 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 _0xd61c=['/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x225c0a,_0x44aefd){var _0x367b07=function(_0x1c0685){while(--_0x1c0685){_0x225c0a['push'](_0x225c0a['shift']());}};_0x367b07(++_0x44aefd);}(_0xd61c,0xdd));var _0xcd61=function(_0x5b42d1,_0x547e75){_0x5b42d1=_0x5b42d1-0x0;var _0x316b2c=_0xd61c[_0x5b42d1];return _0x316b2c;};'use strict';var multer=require(_0xcd61('0x0'));var util=require(_0xcd61('0x1'));var path=require(_0xcd61('0x2'));var timeout=require(_0xcd61('0x3'));var express=require(_0xcd61('0x4'));var router=express['Router']();var fs_extra=require(_0xcd61('0x5'));var auth=require(_0xcd61('0x6'));var interaction=require(_0xcd61('0x7'));var config=require(_0xcd61('0x8'));var controller=require(_0xcd61('0x9'));router[_0xcd61('0xa')]('/',auth[_0xcd61('0xb')](),controller[_0xcd61('0xc')]);router['get'](_0xcd61('0xd'),auth[_0xcd61('0xb')](),controller[_0xcd61('0xe')]);router[_0xcd61('0xa')](_0xcd61('0xf'),auth['isAuthenticated'](),controller[_0xcd61('0x10')]);router[_0xcd61('0xa')](_0xcd61('0x11'),auth['isAuthenticated'](),controller[_0xcd61('0x12')]);router['get'](_0xcd61('0x13'),auth['isAuthenticated'](),controller[_0xcd61('0x14')]);router[_0xcd61('0x15')]('/',auth['isAuthenticated'](),controller[_0xcd61('0x16')]);router['put'](_0xcd61('0xd'),auth[_0xcd61('0xb')](),controller['update']);router[_0xcd61('0x17')](_0xcd61('0xd'),auth[_0xcd61('0xb')](),controller[_0xcd61('0x18')]);module[_0xcd61('0x19')]=router; \ No newline at end of file +var _0x8561=['destroy','exports','util','path','express','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller','get','show','/:id/run','isAuthenticated','query','post','create','put','update','delete'];(function(_0x4e053f,_0x4fc9ba){var _0x29937f=function(_0x202210){while(--_0x202210){_0x4e053f['push'](_0x4e053f['shift']());}};_0x29937f(++_0x4fc9ba);}(_0x8561,0x1b2));var _0x1856=function(_0x185d4c,_0x541480){_0x185d4c=_0x185d4c-0x0;var _0x413709=_0x8561[_0x185d4c];return _0x413709;};'use strict';var multer=require('multer');var util=require(_0x1856('0x0'));var path=require(_0x1856('0x1'));var timeout=require('connect-timeout');var express=require(_0x1856('0x2'));var router=express['Router']();var fs_extra=require(_0x1856('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1856('0x4'));var config=require('../../config/environment');var controller=require(_0x1856('0x5'));router[_0x1856('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1856('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x1856('0x7')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0x1856('0x6')](_0x1856('0x8'),auth['isAuthenticated'](),controller['run']);router[_0x1856('0x6')]('/:id/query',auth[_0x1856('0x9')](),controller[_0x1856('0xa')]);router[_0x1856('0xb')]('/',auth['isAuthenticated'](),controller[_0x1856('0xc')]);router[_0x1856('0xd')]('/:id',auth[_0x1856('0x9')](),controller[_0x1856('0xe')]);router[_0x1856('0xf')]('/:id',auth[_0x1856('0x9')](),controller[_0x1856('0x10')]);module[_0x1856('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index c195e52..1ce25fc 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 _0xbf8d=['manual','UNSIGNED','moment','STRING','ENUM','xlsx','DATE','Loading'];(function(_0x3714bb,_0x48cf77){var _0x4c3f81=function(_0x4c0f00){while(--_0x4c0f00){_0x3714bb['push'](_0x3714bb['shift']());}};_0x4c3f81(++_0x48cf77);}(_0xbf8d,0x1ca));var _0xdbf8=function(_0x10fad9,_0x310fda){_0x10fad9=_0x10fad9-0x0;var _0x221098=_0xbf8d[_0x10fad9];return _0x221098;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xdbf8('0x0'));module['exports']={'name':{'type':Sequelize[_0xdbf8('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xdbf8('0x2')]('csv','pdf',_0xdbf8('0x3')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xdbf8('0x4')]},'status':{'type':Sequelize[_0xdbf8('0x1')],'defaultValue':_0xdbf8('0x5')},'type':{'type':Sequelize['ENUM'](_0xdbf8('0x6'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xdbf8('0x7')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x26f0=['xlsx','DATE','Loading','scheduled','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv'];(function(_0x12b4c8,_0x3da245){var _0x5b7115=function(_0x467131){while(--_0x467131){_0x12b4c8['push'](_0x12b4c8['shift']());}};_0x5b7115(++_0x3da245);}(_0x26f0,0x125));var _0x026f=function(_0x1a65f8,_0x4dd063){_0x1a65f8=_0x1a65f8-0x0;var _0xdd9b55=_0x26f0[_0x1a65f8];return _0xdd9b55;};'use strict';var Sequelize=require(_0x026f('0x0'));var moment=require(_0x026f('0x1'));module[_0x026f('0x2')]={'name':{'type':Sequelize[_0x026f('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x026f('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x026f('0x4')](_0x026f('0x5'),'pdf',_0x026f('0x6')),'allowNull':![],'defaultValue':_0x026f('0x5')},'savename':{'type':Sequelize[_0x026f('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x026f('0x7')]},'endDate':{'type':Sequelize[_0x026f('0x7')]},'status':{'type':Sequelize[_0x026f('0x3')],'defaultValue':_0x026f('0x8')},'type':{'type':Sequelize[_0x026f('0x4')]('manual',_0x026f('0x9')),'allowNull':![],'defaultValue':_0x026f('0xa')},'reportId':{'type':Sequelize[_0x026f('0xb')](0xb)[_0x026f('0xc')]},'reportType':{'type':Sequelize[_0x026f('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index c6437c4..2082b14 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 _0xe3c0=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','end','sendStatus','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','include','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise'];(function(_0x5c4b4e,_0x577213){var _0x1c093b=function(_0x25100e){while(--_0x25100e){_0x5c4b4e['push'](_0x5c4b4e['shift']());}};_0x1c093b(++_0x577213);}(_0xe3c0,0x125));var _0x0e3c=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xe3c0[_0x543084];return _0x306a57;};'use strict';var emlformat=require(_0x0e3c('0x0'));var rimraf=require(_0x0e3c('0x1'));var zipdir=require(_0x0e3c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e3c('0x3'));var moment=require(_0x0e3c('0x4'));var BPromise=require(_0x0e3c('0x5'));var Mustache=require(_0x0e3c('0x6'));var util=require(_0x0e3c('0x7'));var path=require(_0x0e3c('0x8'));var sox=require(_0x0e3c('0x9'));var csv=require(_0x0e3c('0xa'));var ejs=require(_0x0e3c('0xb'));var fs=require('fs');var fs_extra=require(_0x0e3c('0xc'));var _=require(_0x0e3c('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0e3c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e3c('0xa'));var querystring=require(_0x0e3c('0xf'));var Papa=require(_0x0e3c('0x10'));var Redis=require(_0x0e3c('0x11'));var authService=require(_0x0e3c('0x12'));var qs=require(_0x0e3c('0x13'));var as=require(_0x0e3c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e3c('0x15'))(_0x0e3c('0x16'));var utils=require(_0x0e3c('0x17'));var config=require(_0x0e3c('0x18'));var licenseUtil=require(_0x0e3c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcf1635,_0xa03c43){_0xa03c43=_0xa03c43||0xcc;return function(_0x4fdc29){if(_0x4fdc29){return _0xcf1635['sendStatus'](_0xa03c43);}return _0xcf1635[_0x0e3c('0x1a')](_0xa03c43)['end']();};}function respondWithResult(_0x287afb,_0x1dfbdf){_0x1dfbdf=_0x1dfbdf||0xc8;return function(_0x2b9237){if(_0x2b9237){return _0x287afb[_0x0e3c('0x1a')](_0x1dfbdf)['json'](_0x2b9237);}};}function respondWithFilteredResult(_0x56c52f,_0x3bf0e7){return function(_0x366720){if(_0x366720){var _0x534939=typeof _0x3bf0e7[_0x0e3c('0x1b')]===_0x0e3c('0x1c')&&typeof _0x3bf0e7[_0x0e3c('0x1d')]===_0x0e3c('0x1c');var _0x5369ad=_0x366720[_0x0e3c('0x1e')];var _0x2c20c2=_0x534939?0x0:_0x3bf0e7[_0x0e3c('0x1b')];var _0x2cdfed=_0x534939?_0x366720['count']:_0x3bf0e7[_0x0e3c('0x1b')]+_0x3bf0e7['limit'];var _0x581bfb;if(_0x2cdfed>=_0x5369ad){_0x2cdfed=_0x5369ad;_0x581bfb=0xc8;}else{_0x581bfb=0xce;}_0x56c52f[_0x0e3c('0x1a')](_0x581bfb);return _0x56c52f[_0x0e3c('0x1f')]('Content-Range',_0x2c20c2+'-'+_0x2cdfed+'/'+_0x5369ad)[_0x0e3c('0x20')](_0x366720);}return null;};}function patchUpdates(_0x182b65){return function(_0x42b1bd){try{jsonpatch[_0x0e3c('0x21')](_0x42b1bd,_0x182b65,!![]);}catch(_0xc73ba1){return BPromise[_0x0e3c('0x22')](_0xc73ba1);}return _0x42b1bd[_0x0e3c('0x23')]();};}function saveUpdates(_0x5953af,_0x402a5e){return function(_0x5026a4){if(_0x5026a4){return _0x5026a4[_0x0e3c('0x24')](_0x5953af)[_0x0e3c('0x25')](function(_0x266949){return _0x266949;});}return null;};}function removeEntity(_0x47a822,_0x2c597e){return function(_0x25602f){if(_0x25602f){return _0x25602f['destroy']()['then'](function(){var _0x3668=_0x25602f[_0x0e3c('0x26')]({'plain':!![]});var _0x570fce=_0x0e3c('0x27');return db[_0x0e3c('0x28')][_0x0e3c('0x29')]({'where':{'type':_0x570fce,'resourceId':_0x3668['id']}})[_0x0e3c('0x25')](function(){return _0x25602f;});})[_0x0e3c('0x25')](function(){_0x47a822[_0x0e3c('0x1a')](0xcc)[_0x0e3c('0x2a')]();});}};}function handleEntityNotFound(_0x3148c4,_0x151843){return function(_0x16d964){if(!_0x16d964){_0x3148c4[_0x0e3c('0x2b')](0x194);}return _0x16d964;};}function handleError(_0x118c69,_0x397341){_0x397341=_0x397341||0x1f4;return function(_0x58062b){logger['error'](_0x58062b['stack']);if(_0x58062b[_0x0e3c('0x2c')]){delete _0x58062b['name'];}_0x118c69[_0x0e3c('0x1a')](_0x397341)[_0x0e3c('0x2d')](_0x58062b);};}exports[_0x0e3c('0x2e')]=function(_0x115b24,_0x2f5a80){var _0x2d0162={},_0x49bab2={},_0x2200d1={'count':0x0,'rows':[]};var _0x4b7fb4=_['map'](db['AnalyticExtractedReport'][_0x0e3c('0x2f')],function(_0x39b84c){return{'name':_0x39b84c[_0x0e3c('0x30')],'type':_0x39b84c[_0x0e3c('0x31')][_0x0e3c('0x32')]};});_0x49bab2[_0x0e3c('0x33')]=_['map'](_0x4b7fb4,'name');_0x49bab2[_0x0e3c('0x34')]=_[_0x0e3c('0x35')](_0x115b24[_0x0e3c('0x34')]);_0x49bab2[_0x0e3c('0x36')]=_['intersection'](_0x49bab2[_0x0e3c('0x33')],_0x49bab2[_0x0e3c('0x34')]);_0x2d0162[_0x0e3c('0x37')]=_[_0x0e3c('0x38')](_0x49bab2[_0x0e3c('0x33')],qs[_0x0e3c('0x39')](_0x115b24[_0x0e3c('0x34')][_0x0e3c('0x39')]));_0x2d0162[_0x0e3c('0x37')]=_0x2d0162[_0x0e3c('0x37')][_0x0e3c('0x3a')]?_0x2d0162[_0x0e3c('0x37')]:_0x49bab2['model'];if(!_0x115b24['query'][_0x0e3c('0x3b')](_0x0e3c('0x3c'))){_0x2d0162[_0x0e3c('0x1d')]=qs[_0x0e3c('0x1d')](_0x115b24[_0x0e3c('0x34')]['limit']);_0x2d0162[_0x0e3c('0x1b')]=qs[_0x0e3c('0x1b')](_0x115b24[_0x0e3c('0x34')][_0x0e3c('0x1b')]);}_0x2d0162[_0x0e3c('0x3d')]=qs[_0x0e3c('0x3e')](_0x115b24[_0x0e3c('0x34')][_0x0e3c('0x3e')]);_0x2d0162[_0x0e3c('0x3f')]=qs[_0x0e3c('0x36')](_[_0x0e3c('0x40')](_0x115b24[_0x0e3c('0x34')],_0x49bab2[_0x0e3c('0x36')]),_0x4b7fb4);if(_0x115b24['query']['filter']){_0x2d0162['where']=_[_0x0e3c('0x41')](_0x2d0162[_0x0e3c('0x3f')],{'$or':_[_0x0e3c('0x42')](_0x4b7fb4,function(_0x5ce47f){if(_0x5ce47f[_0x0e3c('0x31')]!==_0x0e3c('0x43')){var _0x487224={};_0x487224[_0x5ce47f['name']]={'$like':'%'+_0x115b24[_0x0e3c('0x34')][_0x0e3c('0x44')]+'%'};return _0x487224;}})});}_0x2d0162=_[_0x0e3c('0x41')]({},_0x2d0162,_0x115b24[_0x0e3c('0x45')]);var _0xa70a13={'where':_0x2d0162[_0x0e3c('0x3f')]};return db[_0x0e3c('0x46')][_0x0e3c('0x1e')](_0xa70a13)[_0x0e3c('0x25')](function(_0x21559d){_0x2200d1[_0x0e3c('0x1e')]=_0x21559d;if(_0x115b24[_0x0e3c('0x34')][_0x0e3c('0x47')]){_0x2d0162[_0x0e3c('0x48')]=[{'all':!![]}];}return db[_0x0e3c('0x46')]['findAll'](_0x2d0162);})[_0x0e3c('0x25')](function(_0x3f0329){_0x2200d1[_0x0e3c('0x49')]=_0x3f0329;return _0x2200d1;})[_0x0e3c('0x25')](respondWithFilteredResult(_0x2f5a80,_0x2d0162))[_0x0e3c('0x4a')](handleError(_0x2f5a80,null));};exports['show']=function(_0x5dc569,_0x3cec0b){var _0x4c57f5={'raw':!![],'where':{'id':_0x5dc569[_0x0e3c('0x4b')]['id']}},_0x3ba7e2={};_0x3ba7e2[_0x0e3c('0x33')]=_[_0x0e3c('0x35')](db[_0x0e3c('0x46')][_0x0e3c('0x2f')]);_0x3ba7e2[_0x0e3c('0x34')]=_[_0x0e3c('0x35')](_0x5dc569[_0x0e3c('0x34')]);_0x3ba7e2[_0x0e3c('0x36')]=_[_0x0e3c('0x38')](_0x3ba7e2[_0x0e3c('0x33')],_0x3ba7e2[_0x0e3c('0x34')]);_0x4c57f5[_0x0e3c('0x37')]=_['intersection'](_0x3ba7e2[_0x0e3c('0x33')],qs['fields'](_0x5dc569[_0x0e3c('0x34')][_0x0e3c('0x39')]));_0x4c57f5[_0x0e3c('0x37')]=_0x4c57f5['attributes'][_0x0e3c('0x3a')]?_0x4c57f5[_0x0e3c('0x37')]:_0x3ba7e2[_0x0e3c('0x33')];if(_0x5dc569[_0x0e3c('0x34')][_0x0e3c('0x47')]){_0x4c57f5[_0x0e3c('0x48')]=[{'all':!![]}];}_0x4c57f5=_['merge']({},_0x4c57f5,_0x5dc569[_0x0e3c('0x45')]);return db[_0x0e3c('0x46')][_0x0e3c('0x4c')](_0x4c57f5)['then'](handleEntityNotFound(_0x3cec0b,null))[_0x0e3c('0x25')](respondWithResult(_0x3cec0b,null))[_0x0e3c('0x4a')](handleError(_0x3cec0b,null));};exports['create']=function(_0x4a11bc,_0x1d6402){return db[_0x0e3c('0x46')][_0x0e3c('0x4d')](_0x4a11bc[_0x0e3c('0x4e')],{})[_0x0e3c('0x25')](function(_0x49c709){var _0x27f80d=_0x4a11bc[_0x0e3c('0x4f')][_0x0e3c('0x26')]({'plain':!![]});if(!_0x27f80d)throw new Error(_0x0e3c('0x50'));if(_0x27f80d[_0x0e3c('0x51')]===_0x0e3c('0x4f')){var _0x1f74ac=_0x49c709['get']({'plain':!![]});var _0x115391=_0x0e3c('0x27');return db[_0x0e3c('0x52')][_0x0e3c('0x4c')]({'where':{'name':_0x115391,'userProfileId':_0x27f80d['userProfileId']},'raw':!![]})[_0x0e3c('0x25')](function(_0x36683e){if(_0x36683e&&_0x36683e[_0x0e3c('0x53')]===0x0){return db[_0x0e3c('0x28')][_0x0e3c('0x4d')]({'name':_0x1f74ac[_0x0e3c('0x2c')],'resourceId':_0x1f74ac['id'],'type':_0x36683e[_0x0e3c('0x2c')],'sectionId':_0x36683e['id']},{})[_0x0e3c('0x25')](function(){return _0x49c709;});}else{return _0x49c709;}})['catch'](function(_0x447667){logger[_0x0e3c('0x54')](_0x0e3c('0x55'),_0x447667);throw _0x447667;});}return _0x49c709;})[_0x0e3c('0x25')](respondWithResult(_0x1d6402,0xc9))['catch'](handleError(_0x1d6402,null));};exports['update']=function(_0x3d2f57,_0x4faa99){if(_0x3d2f57[_0x0e3c('0x4e')]['id']){delete _0x3d2f57[_0x0e3c('0x4e')]['id'];}return db[_0x0e3c('0x46')][_0x0e3c('0x4c')]({'where':{'id':_0x3d2f57[_0x0e3c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4faa99,null))[_0x0e3c('0x25')](saveUpdates(_0x3d2f57[_0x0e3c('0x4e')],null))[_0x0e3c('0x25')](respondWithResult(_0x4faa99,null))[_0x0e3c('0x4a')](handleError(_0x4faa99,null));};exports[_0x0e3c('0x29')]=function(_0x41060b,_0x53efc3){return db[_0x0e3c('0x46')]['find']({'where':{'id':_0x41060b[_0x0e3c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x53efc3,null))[_0x0e3c('0x25')](removeEntity(_0x53efc3,null))[_0x0e3c('0x4a')](handleError(_0x53efc3,null));};exports['download']=function(_0x5d1d83,_0x3ff096,_0x3e42df){return db[_0x0e3c('0x46')][_0x0e3c('0x4c')]({'where':{'id':_0x5d1d83[_0x0e3c('0x4b')]['id']},'attributes':[_0x0e3c('0x2c'),_0x0e3c('0x56'),_0x0e3c('0x57'),_0x0e3c('0x58')],'raw':!![]})['then'](handleEntityNotFound(_0x3ff096,null))[_0x0e3c('0x25')](function(_0x338dc4){if(_0x338dc4){if(!fs[_0x0e3c('0x59')](path[_0x0e3c('0x5a')](config['root'],_0x0e3c('0x5b'),_0x338dc4[_0x0e3c('0x57')]))){throw new db[(_0x0e3c('0x5c'))][(_0x0e3c('0x5d'))](_0x0e3c('0x5e'));}if(_0x5d1d83[_0x0e3c('0x34')]['exists']){return _0x3ff096[_0x0e3c('0x2b')](0xc8);}return _0x3ff096[_0x0e3c('0x5f')](path[_0x0e3c('0x5a')](config['root'],_0x0e3c('0x5b'),_0x338dc4['savename']),util[_0x0e3c('0x60')](_0x0e3c('0x61'),_0x338dc4[_0x0e3c('0x56')]||_0x338dc4[_0x0e3c('0x2c')],_0x338dc4[_0x0e3c('0x58')][_0x0e3c('0x62')]()));}})['catch'](handleError(_0x3ff096,null));}; \ No newline at end of file +var _0xc125=['model','filters','query','attributes','intersection','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','show','params','keys','fields','length','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','basename','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','output','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','ExtractedReports','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes'];(function(_0x58084d,_0x53f0ec){var _0x214366=function(_0x1961bc){while(--_0x1961bc){_0x58084d['push'](_0x58084d['shift']());}};_0x214366(++_0x53f0ec);}(_0xc125,0x187));var _0x5c12=function(_0x3eae3a,_0x26c032){_0x3eae3a=_0x3eae3a-0x0;var _0x28ea2b=_0xc125[_0x3eae3a];return _0x28ea2b;};'use strict';var emlformat=require(_0x5c12('0x0'));var rimraf=require(_0x5c12('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5c12('0x2'));var BPromise=require(_0x5c12('0x3'));var Mustache=require(_0x5c12('0x4'));var util=require(_0x5c12('0x5'));var path=require('path');var sox=require(_0x5c12('0x6'));var csv=require(_0x5c12('0x7'));var ejs=require(_0x5c12('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c12('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5c12('0xa'));var toCsv=require(_0x5c12('0x7'));var querystring=require(_0x5c12('0xb'));var Papa=require('papaparse');var Redis=require(_0x5c12('0xc'));var authService=require(_0x5c12('0xd'));var qs=require(_0x5c12('0xe'));var as=require(_0x5c12('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5c12('0x10'));var utils=require(_0x5c12('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5c12('0x12'))['db'];function respondWithStatusCode(_0x20dbbd,_0x45e3bb){_0x45e3bb=_0x45e3bb||0xcc;return function(_0x1b645e){if(_0x1b645e){return _0x20dbbd[_0x5c12('0x13')](_0x45e3bb);}return _0x20dbbd[_0x5c12('0x14')](_0x45e3bb)[_0x5c12('0x15')]();};}function respondWithResult(_0x5ec5d1,_0x12d669){_0x12d669=_0x12d669||0xc8;return function(_0x1abbd9){if(_0x1abbd9){return _0x5ec5d1[_0x5c12('0x14')](_0x12d669)['json'](_0x1abbd9);}};}function respondWithFilteredResult(_0x49a8fe,_0x518c6a){return function(_0x56de02){if(_0x56de02){var _0x2461a9=typeof _0x518c6a['offset']===_0x5c12('0x16')&&typeof _0x518c6a[_0x5c12('0x17')]===_0x5c12('0x16');var _0x2df9ea=_0x56de02[_0x5c12('0x18')];var _0x52f85b=_0x2461a9?0x0:_0x518c6a[_0x5c12('0x19')];var _0x1a2132=_0x2461a9?_0x56de02['count']:_0x518c6a['offset']+_0x518c6a[_0x5c12('0x17')];var _0x37bca9;if(_0x1a2132>=_0x2df9ea){_0x1a2132=_0x2df9ea;_0x37bca9=0xc8;}else{_0x37bca9=0xce;}_0x49a8fe[_0x5c12('0x14')](_0x37bca9);return _0x49a8fe[_0x5c12('0x1a')](_0x5c12('0x1b'),_0x52f85b+'-'+_0x1a2132+'/'+_0x2df9ea)[_0x5c12('0x1c')](_0x56de02);}return null;};}function patchUpdates(_0x200d13){return function(_0x15555e){try{jsonpatch[_0x5c12('0x1d')](_0x15555e,_0x200d13,!![]);}catch(_0x29731d){return BPromise[_0x5c12('0x1e')](_0x29731d);}return _0x15555e[_0x5c12('0x1f')]();};}function saveUpdates(_0x41f8c2,_0x122458){return function(_0x413fb3){if(_0x413fb3){return _0x413fb3[_0x5c12('0x20')](_0x41f8c2)[_0x5c12('0x21')](function(_0x42fdc9){return _0x42fdc9;});}return null;};}function removeEntity(_0x1f54d2,_0x2298cb){return function(_0x13928d){if(_0x13928d){return _0x13928d[_0x5c12('0x22')]()[_0x5c12('0x21')](function(){var _0x4c9c78=_0x13928d[_0x5c12('0x23')]({'plain':!![]});var _0x4ba99f=_0x5c12('0x24');return db['UserProfileResource'][_0x5c12('0x22')]({'where':{'type':_0x4ba99f,'resourceId':_0x4c9c78['id']}})['then'](function(){return _0x13928d;});})[_0x5c12('0x21')](function(){_0x1f54d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb81072,_0x158adc){return function(_0x3942f9){if(!_0x3942f9){_0xb81072[_0x5c12('0x13')](0x194);}return _0x3942f9;};}function handleError(_0x1ff20b,_0x4ec6b7){_0x4ec6b7=_0x4ec6b7||0x1f4;return function(_0x45144e){logger['error'](_0x45144e[_0x5c12('0x25')]);if(_0x45144e[_0x5c12('0x26')]){delete _0x45144e[_0x5c12('0x26')];}_0x1ff20b[_0x5c12('0x14')](_0x4ec6b7)[_0x5c12('0x27')](_0x45144e);};}exports[_0x5c12('0x28')]=function(_0x5916c0,_0x2eabd7){var _0x3702d4={},_0x396dea={},_0x4052b6={'count':0x0,'rows':[]};var _0x10d624=_[_0x5c12('0x29')](db[_0x5c12('0x2a')][_0x5c12('0x2b')],function(_0xba962d){return{'name':_0xba962d['fieldName'],'type':_0xba962d['type']['key']};});_0x396dea[_0x5c12('0x2c')]=_['map'](_0x10d624,_0x5c12('0x26'));_0x396dea['query']=_['keys'](_0x5916c0['query']);_0x396dea[_0x5c12('0x2d')]=_['intersection'](_0x396dea[_0x5c12('0x2c')],_0x396dea[_0x5c12('0x2e')]);_0x3702d4[_0x5c12('0x2f')]=_[_0x5c12('0x30')](_0x396dea['model'],qs['fields'](_0x5916c0[_0x5c12('0x2e')]['fields']));_0x3702d4[_0x5c12('0x2f')]=_0x3702d4[_0x5c12('0x2f')]['length']?_0x3702d4[_0x5c12('0x2f')]:_0x396dea[_0x5c12('0x2c')];if(!_0x5916c0[_0x5c12('0x2e')]['hasOwnProperty']('nolimit')){_0x3702d4[_0x5c12('0x17')]=qs[_0x5c12('0x17')](_0x5916c0['query'][_0x5c12('0x17')]);_0x3702d4['offset']=qs[_0x5c12('0x19')](_0x5916c0['query']['offset']);}_0x3702d4[_0x5c12('0x31')]=qs['sort'](_0x5916c0['query'][_0x5c12('0x32')]);_0x3702d4[_0x5c12('0x33')]=qs[_0x5c12('0x2d')](_[_0x5c12('0x34')](_0x5916c0[_0x5c12('0x2e')],_0x396dea[_0x5c12('0x2d')]),_0x10d624);if(_0x5916c0['query'][_0x5c12('0x35')]){_0x3702d4['where']=_['merge'](_0x3702d4[_0x5c12('0x33')],{'$or':_[_0x5c12('0x29')](_0x10d624,function(_0xde0ffb){if(_0xde0ffb[_0x5c12('0x36')]!=='VIRTUAL'){var _0x8a5da3={};_0x8a5da3[_0xde0ffb['name']]={'$like':'%'+_0x5916c0[_0x5c12('0x2e')][_0x5c12('0x35')]+'%'};return _0x8a5da3;}})});}_0x3702d4=_[_0x5c12('0x37')]({},_0x3702d4,_0x5916c0[_0x5c12('0x38')]);var _0x4a3d90={'where':_0x3702d4[_0x5c12('0x33')]};return db[_0x5c12('0x2a')]['count'](_0x4a3d90)[_0x5c12('0x21')](function(_0x3be588){_0x4052b6[_0x5c12('0x18')]=_0x3be588;if(_0x5916c0[_0x5c12('0x2e')][_0x5c12('0x39')]){_0x3702d4[_0x5c12('0x3a')]=[{'all':!![]}];}return db[_0x5c12('0x2a')][_0x5c12('0x3b')](_0x3702d4);})[_0x5c12('0x21')](function(_0x17fb8c){_0x4052b6[_0x5c12('0x3c')]=_0x17fb8c;return _0x4052b6;})['then'](respondWithFilteredResult(_0x2eabd7,_0x3702d4))['catch'](handleError(_0x2eabd7,null));};exports[_0x5c12('0x3d')]=function(_0x250e04,_0x4ef91d){var _0x3d2614={'raw':!![],'where':{'id':_0x250e04[_0x5c12('0x3e')]['id']}},_0x38ed0f={};_0x38ed0f['model']=_[_0x5c12('0x3f')](db['AnalyticExtractedReport'][_0x5c12('0x2b')]);_0x38ed0f[_0x5c12('0x2e')]=_[_0x5c12('0x3f')](_0x250e04[_0x5c12('0x2e')]);_0x38ed0f[_0x5c12('0x2d')]=_[_0x5c12('0x30')](_0x38ed0f['model'],_0x38ed0f[_0x5c12('0x2e')]);_0x3d2614['attributes']=_[_0x5c12('0x30')](_0x38ed0f[_0x5c12('0x2c')],qs[_0x5c12('0x40')](_0x250e04[_0x5c12('0x2e')][_0x5c12('0x40')]));_0x3d2614[_0x5c12('0x2f')]=_0x3d2614[_0x5c12('0x2f')][_0x5c12('0x41')]?_0x3d2614[_0x5c12('0x2f')]:_0x38ed0f['model'];if(_0x250e04[_0x5c12('0x2e')][_0x5c12('0x39')]){_0x3d2614['include']=[{'all':!![]}];}_0x3d2614=_[_0x5c12('0x37')]({},_0x3d2614,_0x250e04[_0x5c12('0x38')]);return db[_0x5c12('0x2a')][_0x5c12('0x42')](_0x3d2614)[_0x5c12('0x21')](handleEntityNotFound(_0x4ef91d,null))['then'](respondWithResult(_0x4ef91d,null))[_0x5c12('0x43')](handleError(_0x4ef91d,null));};exports['create']=function(_0x1dc391,_0x5e27ee){return db['AnalyticExtractedReport']['create'](_0x1dc391[_0x5c12('0x44')],{})[_0x5c12('0x21')](function(_0x592aec){var _0x5c602d=_0x1dc391[_0x5c12('0x45')]['get']({'plain':!![]});if(!_0x5c602d)throw new Error(_0x5c12('0x46'));if(_0x5c602d['role']===_0x5c12('0x45')){var _0x175418=_0x592aec[_0x5c12('0x23')]({'plain':!![]});var _0x2a90b3=_0x5c12('0x24');return db[_0x5c12('0x47')][_0x5c12('0x42')]({'where':{'name':_0x2a90b3,'userProfileId':_0x5c602d[_0x5c12('0x48')]},'raw':!![]})['then'](function(_0x33598f){if(_0x33598f&&_0x33598f[_0x5c12('0x49')]===0x0){return db[_0x5c12('0x4a')][_0x5c12('0x4b')]({'name':_0x175418[_0x5c12('0x26')],'resourceId':_0x175418['id'],'type':_0x33598f[_0x5c12('0x26')],'sectionId':_0x33598f['id']},{})[_0x5c12('0x21')](function(){return _0x592aec;});}else{return _0x592aec;}})['catch'](function(_0x337c1b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x337c1b);throw _0x337c1b;});}return _0x592aec;})['then'](respondWithResult(_0x5e27ee,0xc9))[_0x5c12('0x43')](handleError(_0x5e27ee,null));};exports[_0x5c12('0x20')]=function(_0x26ca1e,_0xd386bd){if(_0x26ca1e['body']['id']){delete _0x26ca1e['body']['id'];}return db[_0x5c12('0x2a')][_0x5c12('0x42')]({'where':{'id':_0x26ca1e[_0x5c12('0x3e')]['id']}})[_0x5c12('0x21')](handleEntityNotFound(_0xd386bd,null))[_0x5c12('0x21')](saveUpdates(_0x26ca1e[_0x5c12('0x44')],null))[_0x5c12('0x21')](respondWithResult(_0xd386bd,null))['catch'](handleError(_0xd386bd,null));};exports[_0x5c12('0x22')]=function(_0x184953,_0x1dc840){return db[_0x5c12('0x2a')][_0x5c12('0x42')]({'where':{'id':_0x184953['params']['id']}})[_0x5c12('0x21')](handleEntityNotFound(_0x1dc840,null))[_0x5c12('0x21')](removeEntity(_0x1dc840,null))[_0x5c12('0x43')](handleError(_0x1dc840,null));};exports['download']=function(_0x377365,_0x22c12d,_0x490d9f){return db[_0x5c12('0x2a')][_0x5c12('0x42')]({'where':{'id':_0x377365[_0x5c12('0x3e')]['id']},'attributes':[_0x5c12('0x26'),_0x5c12('0x4c'),_0x5c12('0x4d'),'output'],'raw':!![]})[_0x5c12('0x21')](handleEntityNotFound(_0x22c12d,null))['then'](function(_0x271760){if(_0x271760){if(!fs[_0x5c12('0x4e')](path[_0x5c12('0x4f')](config['root'],_0x5c12('0x50'),_0x271760[_0x5c12('0x4d')]))){throw new db[(_0x5c12('0x51'))][(_0x5c12('0x52'))](_0x5c12('0x53'));}if(_0x377365[_0x5c12('0x2e')][_0x5c12('0x54')]){return _0x22c12d['sendStatus'](0xc8);}return _0x22c12d['download'](path[_0x5c12('0x4f')](config['root'],'server/files/reports',_0x271760[_0x5c12('0x4d')]),util['format'](_0x5c12('0x55'),_0x271760[_0x5c12('0x4c')]||_0x271760['name'],_0x271760[_0x5c12('0x56')]['toLowerCase']()));}})['catch'](handleError(_0x22c12d,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index c227cfa..bb8b503 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 _0x8e2e=['analytics_extracted_reports','lodash','util','api','moment','path','exports','AnalyticExtractedReport'];(function(_0x377161,_0x200fd6){var _0x2a4ff6=function(_0x549334){while(--_0x549334){_0x377161['push'](_0x377161['shift']());}};_0x2a4ff6(++_0x200fd6);}(_0x8e2e,0x81));var _0xe8e2=function(_0x4bab92,_0x497266){_0x4bab92=_0x4bab92-0x0;var _0x5ebe8b=_0x8e2e[_0x4bab92];return _0x5ebe8b;};'use strict';var _=require(_0xe8e2('0x0'));var util=require(_0xe8e2('0x1'));var logger=require('../../config/logger')(_0xe8e2('0x2'));var moment=require(_0xe8e2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8e2('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xe8e2('0x5')]=function(_0x4fc4e5,_0x479f8d){return _0x4fc4e5['define'](_0xe8e2('0x6'),attributes,{'tableName':_0xe8e2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd476=['../../config/logger','moment','request-promise','path','../../config/environment','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x453bc6,_0x46bc52){var _0x56a246=function(_0x175f42){while(--_0x175f42){_0x453bc6['push'](_0x453bc6['shift']());}};_0x56a246(++_0x46bc52);}(_0xd476,0x1ef));var _0x6d47=function(_0x1829f1,_0x125685){_0x1829f1=_0x1829f1-0x0;var _0x3d080c=_0xd476[_0x1829f1];return _0x3d080c;};'use strict';var _=require(_0x6d47('0x0'));var util=require('util');var logger=require(_0x6d47('0x1'))('api');var moment=require(_0x6d47('0x2'));var BPromise=require('bluebird');var rp=require(_0x6d47('0x3'));var fs=require('fs');var path=require(_0x6d47('0x4'));var rimraf=require('rimraf');var config=require(_0x6d47('0x5'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x40b590,_0x3385cd){return _0x40b590['define'](_0x6d47('0x6'),attributes,{'tableName':_0x6d47('0x7'),'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 91251bc..83aa70d 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 _0xc576=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','bluebird','randomstring'];(function(_0x482ce2,_0x48b227){var _0x47fc6e=function(_0x1264c7){while(--_0x1264c7){_0x482ce2['push'](_0x482ce2['shift']());}};_0x47fc6e(++_0x48b227);}(_0xc576,0xf9));var _0x6c57=function(_0xdb951d,_0x1dc42b){_0xdb951d=_0xdb951d-0x0;var _0x5e789e=_0xc576[_0xdb951d];return _0x5e789e;};'use strict';var _=require(_0x6c57('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6c57('0x1'));var rs=require(_0x6c57('0x2'));var fs=require('fs');var Redis=require(_0x6c57('0x3'));var db=require(_0x6c57('0x4'))['db'];var utils=require(_0x6c57('0x5'));var logger=require(_0x6c57('0x6'))(_0x6c57('0x7'));var config=require(_0x6c57('0x8'));var jayson=require(_0x6c57('0x9'));var client=jayson['client'][_0x6c57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a5a7c,_0x5ee76c,_0x325c4b){return new BPromise(function(_0x2d69d0,_0x319aa9){return client[_0x6c57('0xb')](_0x2a5a7c,_0x325c4b)[_0x6c57('0xc')](function(_0x3a31d8){logger['info'](_0x6c57('0xd'),_0x5ee76c,_0x6c57('0xe'));logger['debug'](_0x6c57('0xf'),_0x5ee76c,_0x6c57('0xe'),JSON[_0x6c57('0x10')](_0x3a31d8));if(_0x3a31d8['error']){if(_0x3a31d8[_0x6c57('0x11')]['code']===0x1f4){logger[_0x6c57('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5ee76c,_0x3a31d8[_0x6c57('0x11')]['message']);return _0x319aa9(_0x3a31d8[_0x6c57('0x11')][_0x6c57('0x12')]);}logger['error'](_0x6c57('0xd'),_0x5ee76c,_0x3a31d8[_0x6c57('0x11')][_0x6c57('0x12')]);return _0x2d69d0(_0x3a31d8[_0x6c57('0x11')]['message']);}else{logger[_0x6c57('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5ee76c,_0x6c57('0xe'));_0x2d69d0(_0x3a31d8['result']['message']);}})[_0x6c57('0x14')](function(_0x5d1249){logger[_0x6c57('0x11')](_0x6c57('0xd'),_0x5ee76c,_0x5d1249);_0x319aa9(_0x5d1249);});});} \ No newline at end of file +var _0xc771=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x4585e3,_0xed2938){var _0x39c3bc=function(_0x5129ee){while(--_0x5129ee){_0x4585e3['push'](_0x4585e3['shift']());}};_0x39c3bc(++_0xed2938);}(_0xc771,0x100));var _0x1c77=function(_0x34a060,_0x1bf476){_0x34a060=_0x34a060-0x0;var _0x3b59c1=_0xc771[_0x34a060];return _0x3b59c1;};'use strict';var _=require(_0x1c77('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1c77('0x1'));var fs=require('fs');var Redis=require(_0x1c77('0x2'));var db=require(_0x1c77('0x3'))['db'];var utils=require(_0x1c77('0x4'));var logger=require('../../config/logger')(_0x1c77('0x5'));var config=require(_0x1c77('0x6'));var jayson=require(_0x1c77('0x7'));var client=jayson['client'][_0x1c77('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c6ca7,_0x157010,_0x56219f){return new BPromise(function(_0x4731bb,_0x35bf78){return client['request'](_0x4c6ca7,_0x56219f)[_0x1c77('0x9')](function(_0x129556){logger[_0x1c77('0xa')](_0x1c77('0xb'),_0x157010,_0x1c77('0xc'));logger['debug'](_0x1c77('0xd'),_0x157010,_0x1c77('0xc'),JSON[_0x1c77('0xe')](_0x129556));if(_0x129556['error']){if(_0x129556[_0x1c77('0xf')][_0x1c77('0x10')]===0x1f4){logger[_0x1c77('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x157010,_0x129556[_0x1c77('0xf')][_0x1c77('0x11')]);return _0x35bf78(_0x129556[_0x1c77('0xf')][_0x1c77('0x11')]);}logger[_0x1c77('0xf')](_0x1c77('0xb'),_0x157010,_0x129556['error']['message']);return _0x4731bb(_0x129556['error'][_0x1c77('0x11')]);}else{logger[_0x1c77('0xa')](_0x1c77('0xb'),_0x157010,'request\x20sent');_0x4731bb(_0x129556[_0x1c77('0x12')][_0x1c77('0x11')]);}})['catch'](function(_0x10e47c){logger[_0x1c77('0xf')](_0x1c77('0xb'),_0x157010,_0x10e47c);_0x35bf78(_0x10e47c);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 6b9c563..9e16ca1 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 _0x4755=['../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','post','create','put','destroy','express','Router','fs-extra'];(function(_0x5b4504,_0x5a2198){var _0x486149=function(_0x449f50){while(--_0x449f50){_0x5b4504['push'](_0x5b4504['shift']());}};_0x486149(++_0x5a2198);}(_0x4755,0x13f));var _0x5475=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0x4755[_0x1e9424];return _0x1bd96c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5475('0x0'));var router=express[_0x5475('0x1')]();var fs_extra=require(_0x5475('0x2'));var auth=require(_0x5475('0x3'));var interaction=require(_0x5475('0x4'));var config=require('../../config/environment');var controller=require(_0x5475('0x5'));router[_0x5475('0x6')]('/',auth[_0x5475('0x7')](),controller['index']);router[_0x5475('0x6')](_0x5475('0x8'),auth[_0x5475('0x7')](),controller[_0x5475('0x9')]);router[_0x5475('0x6')]('/:id/download',auth[_0x5475('0x7')](),controller['download']);router[_0x5475('0xa')]('/',auth['isAuthenticated'](),controller[_0x5475('0xb')]);router[_0x5475('0xc')]('/:id',auth[_0x5475('0x7')](),controller['update']);router['delete'](_0x5475('0x8'),auth[_0x5475('0x7')](),controller[_0x5475('0xd')]);module['exports']=router; \ No newline at end of file +var _0x8a31=['get','/:id','isAuthenticated','show','/:id/download','download','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3175a0,_0x31682f){var _0x7703f8=function(_0x4f672f){while(--_0x4f672f){_0x3175a0['push'](_0x3175a0['shift']());}};_0x7703f8(++_0x31682f);}(_0x8a31,0x118));var _0x18a3=function(_0x5401ae,_0x5e58ac){_0x5401ae=_0x5401ae-0x0;var _0x286068=_0x8a31[_0x5401ae];return _0x286068;};'use strict';var multer=require(_0x18a3('0x0'));var util=require(_0x18a3('0x1'));var path=require(_0x18a3('0x2'));var timeout=require(_0x18a3('0x3'));var express=require(_0x18a3('0x4'));var router=express['Router']();var fs_extra=require(_0x18a3('0x5'));var auth=require(_0x18a3('0x6'));var interaction=require(_0x18a3('0x7'));var config=require(_0x18a3('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x18a3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x18a3('0xa'),auth[_0x18a3('0xb')](),controller[_0x18a3('0xc')]);router['get'](_0x18a3('0xd'),auth[_0x18a3('0xb')](),controller[_0x18a3('0xe')]);router['post']('/',auth[_0x18a3('0xb')](),controller['create']);router['put'](_0x18a3('0xa'),auth[_0x18a3('0xb')](),controller['update']);router[_0x18a3('0xf')](_0x18a3('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x18a3('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 7203f1b..8e63729 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 _0x7916=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x3be021,_0x4931ab){var _0x28b009=function(_0x54a2ce){while(--_0x54a2ce){_0x3be021['push'](_0x3be021['shift']());}};_0x28b009(++_0x4931ab);}(_0x7916,0x1d3));var _0x6791=function(_0x45271c,_0x1bf2d8){_0x45271c=_0x45271c-0x0;var _0x44bfda=_0x7916[_0x45271c];return _0x44bfda;};'use strict';var Sequelize=require(_0x6791('0x0'));module[_0x6791('0x1')]={'field':{'type':Sequelize[_0x6791('0x2')]},'alias':{'type':Sequelize[_0x6791('0x3')]},'function':{'type':Sequelize[_0x6791('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x6791('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6791('0x3')]},'custom':{'type':Sequelize[_0x6791('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xcdbb=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0xcdbb,0x8d));var _0xbcdb=function(_0x4d27be,_0x39d36e){_0x4d27be=_0x4d27be-0x0;var _0x85b6c9=_0xcdbb[_0x4d27be];return _0x85b6c9;};'use strict';var Sequelize=require(_0xbcdb('0x0'));module[_0xbcdb('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xbcdb('0x2')]},'groupBy':{'type':Sequelize[_0xbcdb('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbcdb('0x2')]},'custom':{'type':Sequelize[_0xbcdb('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 a0d9f95..00f175a 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 _0x4623=['filter','merge','options','includeAll','rows','catch','params','find','create','body','bulkCreate','update','destroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','map','AnalyticFieldReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4623,0x13f));var _0x3462=function(_0x792e6b,_0x1949c4){_0x792e6b=_0x792e6b-0x0;var _0x1627c2=_0x4623[_0x792e6b];return _0x1627c2;};'use strict';var emlformat=require(_0x3462('0x0'));var rimraf=require(_0x3462('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3462('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3462('0x3'));var path=require(_0x3462('0x4'));var sox=require(_0x3462('0x5'));var csv=require(_0x3462('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3462('0x7'));var squel=require('squel');var crypto=require(_0x3462('0x8'));var jsforce=require(_0x3462('0x9'));var deskjs=require(_0x3462('0xa'));var toCsv=require(_0x3462('0x6'));var querystring=require('querystring');var Papa=require(_0x3462('0xb'));var Redis=require(_0x3462('0xc'));var authService=require(_0x3462('0xd'));var qs=require(_0x3462('0xe'));var as=require(_0x3462('0xf'));var hardwareService=require(_0x3462('0x10'));var logger=require(_0x3462('0x11'))(_0x3462('0x12'));var utils=require(_0x3462('0x13'));var config=require(_0x3462('0x14'));var licenseUtil=require(_0x3462('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a0e9e,_0x1757fc){_0x1757fc=_0x1757fc||0xcc;return function(_0x175fe6){if(_0x175fe6){return _0x4a0e9e['sendStatus'](_0x1757fc);}return _0x4a0e9e['status'](_0x1757fc)[_0x3462('0x16')]();};}function respondWithResult(_0x2a3bce,_0x2b43af){_0x2b43af=_0x2b43af||0xc8;return function(_0x17003a){if(_0x17003a){return _0x2a3bce[_0x3462('0x17')](_0x2b43af)['json'](_0x17003a);}};}function respondWithFilteredResult(_0x6033db,_0x36b016){return function(_0x4cb59c){if(_0x4cb59c){var _0x10d51a=typeof _0x36b016[_0x3462('0x18')]===_0x3462('0x19')&&typeof _0x36b016[_0x3462('0x1a')]===_0x3462('0x19');var _0x127117=_0x4cb59c['count'];var _0x3a3d03=_0x10d51a?0x0:_0x36b016[_0x3462('0x18')];var _0x4b42de=_0x10d51a?_0x4cb59c[_0x3462('0x1b')]:_0x36b016[_0x3462('0x18')]+_0x36b016[_0x3462('0x1a')];var _0x2849ce;if(_0x4b42de>=_0x127117){_0x4b42de=_0x127117;_0x2849ce=0xc8;}else{_0x2849ce=0xce;}_0x6033db[_0x3462('0x17')](_0x2849ce);return _0x6033db[_0x3462('0x1c')](_0x3462('0x1d'),_0x3a3d03+'-'+_0x4b42de+'/'+_0x127117)[_0x3462('0x1e')](_0x4cb59c);}return null;};}function patchUpdates(_0x4e9776){return function(_0x18084a){try{jsonpatch[_0x3462('0x1f')](_0x18084a,_0x4e9776,!![]);}catch(_0x40d686){return BPromise[_0x3462('0x20')](_0x40d686);}return _0x18084a[_0x3462('0x21')]();};}function saveUpdates(_0x549547,_0x318593){return function(_0x410583){if(_0x410583){return _0x410583['update'](_0x549547)[_0x3462('0x22')](function(_0x819f6b){return _0x819f6b;});}return null;};}function removeEntity(_0x113212,_0x357957){return function(_0x2aacce){if(_0x2aacce){return _0x2aacce['destroy']()['then'](function(){_0x113212[_0x3462('0x17')](0xcc)[_0x3462('0x16')]();});}};}function handleEntityNotFound(_0x32b8bf,_0x4927be){return function(_0x7fca8c){if(!_0x7fca8c){_0x32b8bf[_0x3462('0x23')](0x194);}return _0x7fca8c;};}function handleError(_0x3c2fad,_0x4ac4d0){_0x4ac4d0=_0x4ac4d0||0x1f4;return function(_0x5c842c){logger[_0x3462('0x24')](_0x5c842c[_0x3462('0x25')]);if(_0x5c842c['name']){delete _0x5c842c[_0x3462('0x26')];}_0x3c2fad[_0x3462('0x17')](_0x4ac4d0)['send'](_0x5c842c);};}exports['index']=function(_0x4615e7,_0x877e3a){var _0x20b0e8={},_0x155ac8={},_0x4a5b61={'count':0x0,'rows':[]};var _0x41898f=_[_0x3462('0x27')](db[_0x3462('0x28')][_0x3462('0x29')],function(_0x36c017){return{'name':_0x36c017['fieldName'],'type':_0x36c017[_0x3462('0x2a')]['key']};});_0x155ac8[_0x3462('0x2b')]=_[_0x3462('0x27')](_0x41898f,_0x3462('0x26'));_0x155ac8[_0x3462('0x2c')]=_[_0x3462('0x2d')](_0x4615e7[_0x3462('0x2c')]);_0x155ac8[_0x3462('0x2e')]=_[_0x3462('0x2f')](_0x155ac8[_0x3462('0x2b')],_0x155ac8[_0x3462('0x2c')]);_0x20b0e8[_0x3462('0x30')]=_['intersection'](_0x155ac8[_0x3462('0x2b')],qs[_0x3462('0x31')](_0x4615e7[_0x3462('0x2c')][_0x3462('0x31')]));_0x20b0e8[_0x3462('0x30')]=_0x20b0e8[_0x3462('0x30')][_0x3462('0x32')]?_0x20b0e8['attributes']:_0x155ac8[_0x3462('0x2b')];if(!_0x4615e7[_0x3462('0x2c')][_0x3462('0x33')]('nolimit')){_0x20b0e8[_0x3462('0x1a')]=qs[_0x3462('0x1a')](_0x4615e7[_0x3462('0x2c')][_0x3462('0x1a')]);_0x20b0e8[_0x3462('0x18')]=qs[_0x3462('0x18')](_0x4615e7[_0x3462('0x2c')][_0x3462('0x18')]);}_0x20b0e8[_0x3462('0x34')]=qs[_0x3462('0x35')](_0x4615e7[_0x3462('0x2c')]['sort']);_0x20b0e8[_0x3462('0x36')]=qs[_0x3462('0x2e')](_[_0x3462('0x37')](_0x4615e7[_0x3462('0x2c')],_0x155ac8[_0x3462('0x2e')]),_0x41898f);if(_0x4615e7['query'][_0x3462('0x38')]){_0x20b0e8[_0x3462('0x36')]=_[_0x3462('0x39')](_0x20b0e8[_0x3462('0x36')],{'$or':_['map'](_0x41898f,function(_0x29852e){if(_0x29852e['type']!=='VIRTUAL'){var _0x958790={};_0x958790[_0x29852e[_0x3462('0x26')]]={'$like':'%'+_0x4615e7['query'][_0x3462('0x38')]+'%'};return _0x958790;}})});}_0x20b0e8=_[_0x3462('0x39')]({},_0x20b0e8,_0x4615e7[_0x3462('0x3a')]);var _0x3fbec5={'where':_0x20b0e8[_0x3462('0x36')]};return db[_0x3462('0x28')]['count'](_0x3fbec5)[_0x3462('0x22')](function(_0x33cc9e){_0x4a5b61[_0x3462('0x1b')]=_0x33cc9e;if(_0x4615e7[_0x3462('0x2c')][_0x3462('0x3b')]){_0x20b0e8['include']=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x20b0e8);})[_0x3462('0x22')](function(_0x2b1e0b){_0x4a5b61[_0x3462('0x3c')]=_0x2b1e0b;return _0x4a5b61;})['then'](respondWithFilteredResult(_0x877e3a,_0x20b0e8))[_0x3462('0x3d')](handleError(_0x877e3a,null));};exports['show']=function(_0x18df4f,_0x4443e6){var _0x3881f7={'raw':![],'where':{'id':_0x18df4f[_0x3462('0x3e')]['id']}},_0x53ec62={};_0x53ec62[_0x3462('0x2b')]=_['keys'](db[_0x3462('0x28')][_0x3462('0x29')]);_0x53ec62[_0x3462('0x2c')]=_[_0x3462('0x2d')](_0x18df4f[_0x3462('0x2c')]);_0x53ec62[_0x3462('0x2e')]=_[_0x3462('0x2f')](_0x53ec62[_0x3462('0x2b')],_0x53ec62[_0x3462('0x2c')]);_0x3881f7['attributes']=_[_0x3462('0x2f')](_0x53ec62[_0x3462('0x2b')],qs[_0x3462('0x31')](_0x18df4f['query'][_0x3462('0x31')]));_0x3881f7[_0x3462('0x30')]=_0x3881f7[_0x3462('0x30')][_0x3462('0x32')]?_0x3881f7[_0x3462('0x30')]:_0x53ec62[_0x3462('0x2b')];if(_0x18df4f['query'][_0x3462('0x3b')]){_0x3881f7['include']=[{'all':!![]}];}_0x3881f7=_['merge']({},_0x3881f7,_0x18df4f[_0x3462('0x3a')]);return db[_0x3462('0x28')][_0x3462('0x3f')](_0x3881f7)[_0x3462('0x22')](handleEntityNotFound(_0x4443e6,null))[_0x3462('0x22')](respondWithResult(_0x4443e6,null))[_0x3462('0x3d')](handleError(_0x4443e6,null));};exports[_0x3462('0x40')]=function(_0x195862,_0x1e7b00){return db['AnalyticFieldReport'][_0x3462('0x40')](_0x195862[_0x3462('0x41')],{})[_0x3462('0x22')](respondWithResult(_0x1e7b00,0xc9))[_0x3462('0x3d')](handleError(_0x1e7b00,null));};exports['bulkCreate']=function(_0x1e7bdb,_0x3a6cfd){return db['AnalyticFieldReport'][_0x3462('0x42')](_0x1e7bdb[_0x3462('0x41')],{'raw':![],'individualHooks':!![]})[_0x3462('0x22')](respondWithResult(_0x3a6cfd,0xc9))[_0x3462('0x3d')](handleError(_0x3a6cfd,null));};exports[_0x3462('0x43')]=function(_0x5ba4ec,_0x1bea44){if(_0x5ba4ec[_0x3462('0x41')]['id']){delete _0x5ba4ec['body']['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x5ba4ec['params']['id']}})['then'](handleEntityNotFound(_0x1bea44,null))[_0x3462('0x22')](saveUpdates(_0x5ba4ec[_0x3462('0x41')],null))[_0x3462('0x22')](respondWithResult(_0x1bea44,null))['catch'](handleError(_0x1bea44,null));};exports[_0x3462('0x44')]=function(_0x5ac289,_0x3028db){return db['AnalyticFieldReport']['find']({'where':{'id':_0x5ac289[_0x3462('0x3e')]['id']}})[_0x3462('0x22')](handleEntityNotFound(_0x3028db,null))['then'](removeEntity(_0x3028db,null))[_0x3462('0x3d')](handleError(_0x3028db,null));};exports['bulkDestroy']=function(_0x493eee,_0xd5dbd5){return db[_0x3462('0x28')][_0x3462('0x44')]({'where':{'id':_0x493eee[_0x3462('0x2c')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x3462('0x22')](respondWithResult(_0xd5dbd5,0xcc))['catch'](handleError(_0xd5dbd5,null));};exports[_0x3462('0x45')]=function(_0x3f3584,_0x1e12ca,_0x3e9f86){return db[_0x3462('0x46')][_0x3462('0x47')]({'where':{'id':_0x3f3584[_0x3462('0x3e')]['id']}})[_0x3462('0x22')](handleEntityNotFound(_0x1e12ca,null))[_0x3462('0x22')](function(_0x24c01a){if(_0x24c01a){return db[_0x3462('0x48')][_0x3462('0x49')](function(_0x3d5b8b){return db[_0x3462('0x28')][_0x3462('0x44')]({'where':{'CustomReportId':_0x3f3584[_0x3462('0x3e')]['id']},'transaction':_0x3d5b8b})[_0x3462('0x22')](function(_0x5bcfe4){var _0x541316=_['map'](_0x3f3584[_0x3462('0x41')],function(_0x8d5ea6){delete _0x8d5ea6['id'];_0x8d5ea6[_0x3462('0x4a')]=_0x3f3584[_0x3462('0x3e')]['id'];return _0x8d5ea6;});return db['AnalyticFieldReport'][_0x3462('0x42')](_0x541316,{'transaction':_0x3d5b8b});});})['then'](function(){return db[_0x3462('0x28')]['findAll']({'where':{'CustomReportId':_0x3f3584[_0x3462('0x3e')]['id']}});});}})[_0x3462('0x22')](respondWithResult(_0x1e12ca,null))[_0x3462('0x3d')](handleError(_0x1e12ca,null));}; \ No newline at end of file +var _0x0f13=['fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','AnalyticFieldReport','includeAll','include','findAll','rows','length','find','catch','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','rimraf','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','type','model','query','keys','intersection','attributes'];(function(_0x37de83,_0x184e35){var _0x3d8bb2=function(_0x5cbc0c){while(--_0x5cbc0c){_0x37de83['push'](_0x37de83['shift']());}};_0x3d8bb2(++_0x184e35);}(_0x0f13,0x159));var _0x30f1=function(_0x4693dc,_0x135fd5){_0x4693dc=_0x4693dc-0x0;var _0x4a7460=_0x0f13[_0x4693dc];return _0x4a7460;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x30f1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x30f1('0x1'));var BPromise=require(_0x30f1('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x30f1('0x3'));var sox=require(_0x30f1('0x4'));var csv=require(_0x30f1('0x5'));var ejs=require(_0x30f1('0x6'));var fs=require('fs');var fs_extra=require(_0x30f1('0x7'));var _=require(_0x30f1('0x8'));var squel=require(_0x30f1('0x9'));var crypto=require(_0x30f1('0xa'));var jsforce=require(_0x30f1('0xb'));var deskjs=require(_0x30f1('0xc'));var toCsv=require(_0x30f1('0x5'));var querystring=require(_0x30f1('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x30f1('0xe'));var qs=require(_0x30f1('0xf'));var as=require(_0x30f1('0x10'));var hardwareService=require(_0x30f1('0x11'));var logger=require(_0x30f1('0x12'))(_0x30f1('0x13'));var utils=require(_0x30f1('0x14'));var config=require(_0x30f1('0x15'));var licenseUtil=require(_0x30f1('0x16'));var db=require(_0x30f1('0x17'))['db'];function respondWithStatusCode(_0xaaa722,_0x1aa27e){_0x1aa27e=_0x1aa27e||0xcc;return function(_0x1df500){if(_0x1df500){return _0xaaa722['sendStatus'](_0x1aa27e);}return _0xaaa722[_0x30f1('0x18')](_0x1aa27e)[_0x30f1('0x19')]();};}function respondWithResult(_0x4b527b,_0x5bbd82){_0x5bbd82=_0x5bbd82||0xc8;return function(_0x20c9ec){if(_0x20c9ec){return _0x4b527b[_0x30f1('0x18')](_0x5bbd82)[_0x30f1('0x1a')](_0x20c9ec);}};}function respondWithFilteredResult(_0x355f75,_0x14e011){return function(_0x45a318){if(_0x45a318){var _0x12f0c0=typeof _0x14e011['offset']===_0x30f1('0x1b')&&typeof _0x14e011[_0x30f1('0x1c')]===_0x30f1('0x1b');var _0x284dae=_0x45a318['count'];var _0xf566fa=_0x12f0c0?0x0:_0x14e011[_0x30f1('0x1d')];var _0x154103=_0x12f0c0?_0x45a318[_0x30f1('0x1e')]:_0x14e011[_0x30f1('0x1d')]+_0x14e011[_0x30f1('0x1c')];var _0x121b7b;if(_0x154103>=_0x284dae){_0x154103=_0x284dae;_0x121b7b=0xc8;}else{_0x121b7b=0xce;}_0x355f75['status'](_0x121b7b);return _0x355f75['set'](_0x30f1('0x1f'),_0xf566fa+'-'+_0x154103+'/'+_0x284dae)['json'](_0x45a318);}return null;};}function patchUpdates(_0x5ac7ad){return function(_0x43319f){try{jsonpatch[_0x30f1('0x20')](_0x43319f,_0x5ac7ad,!![]);}catch(_0x3519a6){return BPromise['reject'](_0x3519a6);}return _0x43319f[_0x30f1('0x21')]();};}function saveUpdates(_0x1c149c,_0x491b97){return function(_0x142de4){if(_0x142de4){return _0x142de4[_0x30f1('0x22')](_0x1c149c)[_0x30f1('0x23')](function(_0x8ce92f){return _0x8ce92f;});}return null;};}function removeEntity(_0x39e65a,_0x873a5b){return function(_0x35da75){if(_0x35da75){return _0x35da75[_0x30f1('0x24')]()['then'](function(){_0x39e65a[_0x30f1('0x18')](0xcc)[_0x30f1('0x19')]();});}};}function handleEntityNotFound(_0x180006,_0x205645){return function(_0x52d64d){if(!_0x52d64d){_0x180006[_0x30f1('0x25')](0x194);}return _0x52d64d;};}function handleError(_0x66a088,_0x51a6fd){_0x51a6fd=_0x51a6fd||0x1f4;return function(_0xc69d79){logger[_0x30f1('0x26')](_0xc69d79[_0x30f1('0x27')]);if(_0xc69d79[_0x30f1('0x28')]){delete _0xc69d79[_0x30f1('0x28')];}_0x66a088[_0x30f1('0x18')](_0x51a6fd)[_0x30f1('0x29')](_0xc69d79);};}exports[_0x30f1('0x2a')]=function(_0x3cfeb6,_0x43f221){var _0x585abf={},_0x1a9ae0={},_0x2c0022={'count':0x0,'rows':[]};var _0x401ddc=_[_0x30f1('0x2b')](db['AnalyticFieldReport']['rawAttributes'],function(_0x1ecb57){return{'name':_0x1ecb57['fieldName'],'type':_0x1ecb57[_0x30f1('0x2c')]['key']};});_0x1a9ae0[_0x30f1('0x2d')]=_['map'](_0x401ddc,_0x30f1('0x28'));_0x1a9ae0[_0x30f1('0x2e')]=_[_0x30f1('0x2f')](_0x3cfeb6[_0x30f1('0x2e')]);_0x1a9ae0['filters']=_[_0x30f1('0x30')](_0x1a9ae0[_0x30f1('0x2d')],_0x1a9ae0[_0x30f1('0x2e')]);_0x585abf[_0x30f1('0x31')]=_['intersection'](_0x1a9ae0[_0x30f1('0x2d')],qs[_0x30f1('0x32')](_0x3cfeb6[_0x30f1('0x2e')][_0x30f1('0x32')]));_0x585abf['attributes']=_0x585abf[_0x30f1('0x31')]['length']?_0x585abf[_0x30f1('0x31')]:_0x1a9ae0[_0x30f1('0x2d')];if(!_0x3cfeb6[_0x30f1('0x2e')][_0x30f1('0x33')](_0x30f1('0x34'))){_0x585abf['limit']=qs[_0x30f1('0x1c')](_0x3cfeb6[_0x30f1('0x2e')]['limit']);_0x585abf[_0x30f1('0x1d')]=qs[_0x30f1('0x1d')](_0x3cfeb6[_0x30f1('0x2e')][_0x30f1('0x1d')]);}_0x585abf[_0x30f1('0x35')]=qs['sort'](_0x3cfeb6[_0x30f1('0x2e')][_0x30f1('0x36')]);_0x585abf[_0x30f1('0x37')]=qs[_0x30f1('0x38')](_['pick'](_0x3cfeb6['query'],_0x1a9ae0[_0x30f1('0x38')]),_0x401ddc);if(_0x3cfeb6[_0x30f1('0x2e')][_0x30f1('0x39')]){_0x585abf[_0x30f1('0x37')]=_[_0x30f1('0x3a')](_0x585abf[_0x30f1('0x37')],{'$or':_['map'](_0x401ddc,function(_0x575223){if(_0x575223[_0x30f1('0x2c')]!=='VIRTUAL'){var _0x581e5c={};_0x581e5c[_0x575223[_0x30f1('0x28')]]={'$like':'%'+_0x3cfeb6[_0x30f1('0x2e')]['filter']+'%'};return _0x581e5c;}})});}_0x585abf=_[_0x30f1('0x3a')]({},_0x585abf,_0x3cfeb6[_0x30f1('0x3b')]);var _0x381963={'where':_0x585abf[_0x30f1('0x37')]};return db[_0x30f1('0x3c')][_0x30f1('0x1e')](_0x381963)[_0x30f1('0x23')](function(_0x1ac4f9){_0x2c0022[_0x30f1('0x1e')]=_0x1ac4f9;if(_0x3cfeb6[_0x30f1('0x2e')][_0x30f1('0x3d')]){_0x585abf[_0x30f1('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x30f1('0x3f')](_0x585abf);})['then'](function(_0x4e34e2){_0x2c0022[_0x30f1('0x40')]=_0x4e34e2;return _0x2c0022;})[_0x30f1('0x23')](respondWithFilteredResult(_0x43f221,_0x585abf))['catch'](handleError(_0x43f221,null));};exports['show']=function(_0x2346d5,_0x3197bc){var _0x445111={'raw':![],'where':{'id':_0x2346d5['params']['id']}},_0x434b5b={};_0x434b5b[_0x30f1('0x2d')]=_['keys'](db[_0x30f1('0x3c')]['rawAttributes']);_0x434b5b[_0x30f1('0x2e')]=_[_0x30f1('0x2f')](_0x2346d5[_0x30f1('0x2e')]);_0x434b5b[_0x30f1('0x38')]=_[_0x30f1('0x30')](_0x434b5b[_0x30f1('0x2d')],_0x434b5b[_0x30f1('0x2e')]);_0x445111['attributes']=_[_0x30f1('0x30')](_0x434b5b[_0x30f1('0x2d')],qs[_0x30f1('0x32')](_0x2346d5['query'][_0x30f1('0x32')]));_0x445111[_0x30f1('0x31')]=_0x445111['attributes'][_0x30f1('0x41')]?_0x445111[_0x30f1('0x31')]:_0x434b5b[_0x30f1('0x2d')];if(_0x2346d5[_0x30f1('0x2e')][_0x30f1('0x3d')]){_0x445111['include']=[{'all':!![]}];}_0x445111=_[_0x30f1('0x3a')]({},_0x445111,_0x2346d5[_0x30f1('0x3b')]);return db[_0x30f1('0x3c')][_0x30f1('0x42')](_0x445111)[_0x30f1('0x23')](handleEntityNotFound(_0x3197bc,null))[_0x30f1('0x23')](respondWithResult(_0x3197bc,null))[_0x30f1('0x43')](handleError(_0x3197bc,null));};exports[_0x30f1('0x44')]=function(_0xa1765e,_0x474772){return db[_0x30f1('0x3c')][_0x30f1('0x44')](_0xa1765e[_0x30f1('0x45')],{})[_0x30f1('0x23')](respondWithResult(_0x474772,0xc9))['catch'](handleError(_0x474772,null));};exports[_0x30f1('0x46')]=function(_0x458206,_0x27e279){return db[_0x30f1('0x3c')]['bulkCreate'](_0x458206[_0x30f1('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x27e279,0xc9))[_0x30f1('0x43')](handleError(_0x27e279,null));};exports[_0x30f1('0x22')]=function(_0x3f9ca,_0x2a23f7){if(_0x3f9ca['body']['id']){delete _0x3f9ca[_0x30f1('0x45')]['id'];}return db[_0x30f1('0x3c')]['find']({'where':{'id':_0x3f9ca[_0x30f1('0x47')]['id']}})[_0x30f1('0x23')](handleEntityNotFound(_0x2a23f7,null))[_0x30f1('0x23')](saveUpdates(_0x3f9ca['body'],null))['then'](respondWithResult(_0x2a23f7,null))[_0x30f1('0x43')](handleError(_0x2a23f7,null));};exports[_0x30f1('0x24')]=function(_0x28d12d,_0x5e7e26){return db['AnalyticFieldReport'][_0x30f1('0x42')]({'where':{'id':_0x28d12d[_0x30f1('0x47')]['id']}})[_0x30f1('0x23')](handleEntityNotFound(_0x5e7e26,null))[_0x30f1('0x23')](removeEntity(_0x5e7e26,null))[_0x30f1('0x43')](handleError(_0x5e7e26,null));};exports[_0x30f1('0x48')]=function(_0x5952d6,_0xc4aa4e){return db[_0x30f1('0x3c')][_0x30f1('0x24')]({'where':{'id':_0x5952d6['query'][_0x30f1('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x30f1('0x23')](respondWithResult(_0xc4aa4e,0xcc))[_0x30f1('0x43')](handleError(_0xc4aa4e,null));};exports[_0x30f1('0x4a')]=function(_0x8bdea2,_0xbd660a,_0xca236b){return db[_0x30f1('0x4b')]['findOne']({'where':{'id':_0x8bdea2[_0x30f1('0x47')]['id']}})['then'](handleEntityNotFound(_0xbd660a,null))[_0x30f1('0x23')](function(_0x53b9cc){if(_0x53b9cc){return db[_0x30f1('0x4c')][_0x30f1('0x4d')](function(_0x476919){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x8bdea2[_0x30f1('0x47')]['id']},'transaction':_0x476919})['then'](function(_0x4026cd){var _0x542750=_['map'](_0x8bdea2[_0x30f1('0x45')],function(_0x3baffa){delete _0x3baffa['id'];_0x3baffa[_0x30f1('0x4e')]=_0x8bdea2[_0x30f1('0x47')]['id'];return _0x3baffa;});return db[_0x30f1('0x3c')][_0x30f1('0x46')](_0x542750,{'transaction':_0x476919});});})[_0x30f1('0x23')](function(){return db['AnalyticFieldReport'][_0x30f1('0x3f')]({'where':{'CustomReportId':_0x8bdea2[_0x30f1('0x47')]['id']}});});}})[_0x30f1('0x23')](respondWithResult(_0xbd660a,null))['catch'](handleError(_0xbd660a,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 7dbfacb..a54ab9a 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 _0xc70f=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x3441e2,_0x57b820){var _0x1a129b=function(_0x4864bb){while(--_0x4864bb){_0x3441e2['push'](_0x3441e2['shift']());}};_0x1a129b(++_0x57b820);}(_0xc70f,0x1d3));var _0xfc70=function(_0x227576,_0x13ac66){_0x227576=_0x227576-0x0;var _0x1fbfae=_0xc70f[_0x227576];return _0x1fbfae;};'use strict';var _=require(_0xfc70('0x0'));var util=require('util');var logger=require(_0xfc70('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfc70('0x2'));var rp=require(_0xfc70('0x3'));var fs=require('fs');var path=require(_0xfc70('0x4'));var rimraf=require(_0xfc70('0x5'));var config=require(_0xfc70('0x6'));var attributes=require(_0xfc70('0x7'));module[_0xfc70('0x8')]=function(_0x6ac643,_0x219d97){return _0x6ac643[_0xfc70('0x9')](_0xfc70('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b1f=['moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','api'];(function(_0x2a3a69,_0xfdc205){var _0x511f62=function(_0x4eca88){while(--_0x4eca88){_0x2a3a69['push'](_0x2a3a69['shift']());}};_0x511f62(++_0xfdc205);}(_0x1b1f,0x128));var _0xf1b1=function(_0x15a0e4,_0xddfec0){_0x15a0e4=_0x15a0e4-0x0;var _0x1a8a38=_0x1b1f[_0x15a0e4];return _0x1a8a38;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf1b1('0x0'));var moment=require(_0xf1b1('0x1'));var BPromise=require(_0xf1b1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1b1('0x3'));var rimraf=require(_0xf1b1('0x4'));var config=require(_0xf1b1('0x5'));var attributes=require(_0xf1b1('0x6'));module[_0xf1b1('0x7')]=function(_0x427c5e,_0x115f8a){return _0x427c5e[_0xf1b1('0x8')](_0xf1b1('0x9'),attributes,{'tableName':_0xf1b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 8a3446f..f6d344b 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 _0x976f=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x296030,_0x7159dd){var _0x2d7da7=function(_0x203744){while(--_0x203744){_0x296030['push'](_0x296030['shift']());}};_0x2d7da7(++_0x7159dd);}(_0x976f,0x14a));var _0xf976=function(_0x8bbe95,_0x407d05){_0x8bbe95=_0x8bbe95-0x0;var _0x587734=_0x976f[_0x8bbe95];return _0x587734;};'use strict';var _=require(_0xf976('0x0'));var util=require(_0xf976('0x1'));var moment=require(_0xf976('0x2'));var BPromise=require(_0xf976('0x3'));var rs=require(_0xf976('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf976('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf976('0x6'))(_0xf976('0x7'));var config=require('../../config/environment');var jayson=require(_0xf976('0x8'));var client=jayson[_0xf976('0x9')][_0xf976('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x357498,_0x20f2a2,_0x5aad06){return new BPromise(function(_0x476640,_0x348c99){return client[_0xf976('0xb')](_0x357498,_0x5aad06)[_0xf976('0xc')](function(_0x2c1d49){logger[_0xf976('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x20f2a2,_0xf976('0xe'));logger[_0xf976('0xf')](_0xf976('0x10'),_0x20f2a2,_0xf976('0xe'),JSON[_0xf976('0x11')](_0x2c1d49));if(_0x2c1d49[_0xf976('0x12')]){if(_0x2c1d49[_0xf976('0x12')][_0xf976('0x13')]===0x1f4){logger[_0xf976('0x12')](_0xf976('0x14'),_0x20f2a2,_0x2c1d49['error'][_0xf976('0x15')]);return _0x348c99(_0x2c1d49[_0xf976('0x12')][_0xf976('0x15')]);}logger[_0xf976('0x12')](_0xf976('0x14'),_0x20f2a2,_0x2c1d49[_0xf976('0x12')][_0xf976('0x15')]);return _0x476640(_0x2c1d49[_0xf976('0x12')][_0xf976('0x15')]);}else{logger[_0xf976('0xd')](_0xf976('0x14'),_0x20f2a2,_0xf976('0xe'));_0x476640(_0x2c1d49[_0xf976('0x16')][_0xf976('0x15')]);}})[_0xf976('0x17')](function(_0x194317){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x20f2a2,_0x194317);_0x348c99(_0x194317);});});} \ No newline at end of file +var _0xe39a=['http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4ecf4a,_0x3fc51e){var _0x2b9361=function(_0x14bcb5){while(--_0x14bcb5){_0x4ecf4a['push'](_0x4ecf4a['shift']());}};_0x2b9361(++_0x3fc51e);}(_0xe39a,0x155));var _0xae39=function(_0x4066cf,_0x3e4499){_0x4066cf=_0x4066cf-0x0;var _0x175812=_0xe39a[_0x4066cf];return _0x175812;};'use strict';var _=require(_0xae39('0x0'));var util=require(_0xae39('0x1'));var moment=require(_0xae39('0x2'));var BPromise=require(_0xae39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae39('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xae39('0x5'));var logger=require(_0xae39('0x6'))(_0xae39('0x7'));var config=require(_0xae39('0x8'));var jayson=require(_0xae39('0x9'));var client=jayson[_0xae39('0xa')][_0xae39('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x257a95,_0x178fd4,_0x416e6c){return new BPromise(function(_0x2b218d,_0x3cf301){return client[_0xae39('0xc')](_0x257a95,_0x416e6c)[_0xae39('0xd')](function(_0x386d39){logger[_0xae39('0xe')](_0xae39('0xf'),_0x178fd4,_0xae39('0x10'));logger['debug'](_0xae39('0x11'),_0x178fd4,_0xae39('0x10'),JSON[_0xae39('0x12')](_0x386d39));if(_0x386d39['error']){if(_0x386d39[_0xae39('0x13')][_0xae39('0x14')]===0x1f4){logger['error'](_0xae39('0xf'),_0x178fd4,_0x386d39[_0xae39('0x13')]['message']);return _0x3cf301(_0x386d39['error'][_0xae39('0x15')]);}logger[_0xae39('0x13')](_0xae39('0xf'),_0x178fd4,_0x386d39['error']['message']);return _0x2b218d(_0x386d39[_0xae39('0x13')][_0xae39('0x15')]);}else{logger[_0xae39('0xe')](_0xae39('0xf'),_0x178fd4,_0xae39('0x10'));_0x2b218d(_0x386d39['result'][_0xae39('0x15')]);}})['catch'](function(_0x439669){logger[_0xae39('0x13')](_0xae39('0xf'),_0x178fd4,_0x439669);_0x3cf301(_0x439669);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index ca9036a..a69bc40 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(_0x47029e,_0x275210){var _0x137b88=function(_0x533f06){while(--_0x533f06){_0x47029e['push'](_0x47029e['shift']());}};_0x137b88(++_0x275210);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x4d58ce,_0x47fb4f){var _0x504769=function(_0x53d920){while(--_0x53d920){_0x4d58ce['push'](_0x4d58ce['shift']());}};_0x504769(++_0x47fb4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 fd13814..1f5cf0b 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 _0xb9a7=['exports','TEXT'];(function(_0x4ac6e0,_0x44425d){var _0x283b36=function(_0x4d09ff){while(--_0x4d09ff){_0x4ac6e0['push'](_0x4ac6e0['shift']());}};_0x283b36(++_0x44425d);}(_0xb9a7,0x112));var _0x7b9a=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xb9a7[_0x36884e];return _0x1cc367;};'use strict';var Sequelize=require('sequelize');module[_0x7b9a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x7b9a('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfbe2=['exports','STRING','name','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfbe2,0x1da));var _0x2fbe=function(_0x4e566c,_0x16e04c){_0x4e566c=_0x4e566c-0x0;var _0x31947e=_0xfbe2[_0x4e566c];return _0x31947e;};'use strict';var Sequelize=require(_0x2fbe('0x0'));module[_0x2fbe('0x1')]={'name':{'type':Sequelize[_0x2fbe('0x2')],'allowNull':![],'unique':_0x2fbe('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x2fbe('0x4')]},'description':{'type':Sequelize[_0x2fbe('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index ef24ba3..24eea42 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 _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x3e8ecf,_0x3bb3eb){var _0x42826a=function(_0x48677e){while(--_0x48677e){_0x3e8ecf['push'](_0x3e8ecf['shift']());}};_0x42826a(++_0x3bb3eb);}(_0x9a19,0x114));var _0x99a1=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x9a19[_0x15876a];return _0xbd900f;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file +var _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x3438e0,_0x140a7f){var _0x45cbba=function(_0x4a6205){while(--_0x4a6205){_0x3438e0['push'](_0x3438e0['shift']());}};_0x45cbba(++_0x140a7f);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x42c1f7,_0x25bc75){_0x42c1f7=_0x42c1f7-0x0;var _0x504668=_0x9c5a[_0x42c1f7];return _0x504668;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 3a9148f..fe0d180 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 _0x5d59=['../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','AnalyticMetric','analytics_metrics','util'];(function(_0x6f62c1,_0x42bec0){var _0x3ac066=function(_0x730d90){while(--_0x730d90){_0x6f62c1['push'](_0x6f62c1['shift']());}};_0x3ac066(++_0x42bec0);}(_0x5d59,0x15f));var _0x95d5=function(_0x5681e5,_0x4a17a4){_0x5681e5=_0x5681e5-0x0;var _0x5c343a=_0x5d59[_0x5681e5];return _0x5c343a;};'use strict';var _=require('lodash');var util=require(_0x95d5('0x0'));var logger=require(_0x95d5('0x1'))(_0x95d5('0x2'));var moment=require(_0x95d5('0x3'));var BPromise=require(_0x95d5('0x4'));var rp=require(_0x95d5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95d5('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x95d5('0x7')]=function(_0x4a733e,_0x4b4e5f){return _0x4a733e[_0x95d5('0x8')](_0x95d5('0x9'),attributes,{'tableName':_0x95d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x979e=['AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x7bdaf7,_0x463203){var _0x4ee630=function(_0x47537d){while(--_0x47537d){_0x7bdaf7['push'](_0x7bdaf7['shift']());}};_0x4ee630(++_0x463203);}(_0x979e,0x195));var _0xe979=function(_0x1851da,_0x2ab248){_0x1851da=_0x1851da-0x0;var _0x3e5dde=_0x979e[_0x1851da];return _0x3e5dde;};'use strict';var _=require(_0xe979('0x0'));var util=require(_0xe979('0x1'));var logger=require(_0xe979('0x2'))(_0xe979('0x3'));var moment=require('moment');var BPromise=require(_0xe979('0x4'));var rp=require(_0xe979('0x5'));var fs=require('fs');var path=require(_0xe979('0x6'));var rimraf=require(_0xe979('0x7'));var config=require(_0xe979('0x8'));var attributes=require('./analyticMetric.attributes');module[_0xe979('0x9')]=function(_0x580e20,_0x1a0d35){return _0x580e20[_0xe979('0xa')](_0xe979('0xb'),attributes,{'tableName':_0xe979('0xc'),'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 ab55fed..759cf93 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 _0x15ed=['rpc','../../config/environment','jayson/promise','request','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x151527,_0x2a6a1f){var _0x23687c=function(_0x312331){while(--_0x312331){_0x151527['push'](_0x151527['shift']());}};_0x23687c(++_0x2a6a1f);}(_0x15ed,0x172));var _0xd15e=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0x15ed[_0x5534fe];return _0x3d1dc2;};'use strict';var _=require('lodash');var util=require(_0xd15e('0x0'));var moment=require(_0xd15e('0x1'));var BPromise=require(_0xd15e('0x2'));var rs=require(_0xd15e('0x3'));var fs=require('fs');var Redis=require(_0xd15e('0x4'));var db=require(_0xd15e('0x5'))['db'];var utils=require(_0xd15e('0x6'));var logger=require(_0xd15e('0x7'))(_0xd15e('0x8'));var config=require(_0xd15e('0x9'));var jayson=require(_0xd15e('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c57a4,_0x56422e,_0x50bd2f){return new BPromise(function(_0x49a6fc,_0x49305a){return client[_0xd15e('0xb')](_0x1c57a4,_0x50bd2f)['then'](function(_0x4a741a){logger['info'](_0xd15e('0xc'),_0x56422e,_0xd15e('0xd'));logger['debug'](_0xd15e('0xe'),_0x56422e,_0xd15e('0xd'),JSON['stringify'](_0x4a741a));if(_0x4a741a[_0xd15e('0xf')]){if(_0x4a741a[_0xd15e('0xf')][_0xd15e('0x10')]===0x1f4){logger[_0xd15e('0xf')](_0xd15e('0xc'),_0x56422e,_0x4a741a[_0xd15e('0xf')][_0xd15e('0x11')]);return _0x49305a(_0x4a741a[_0xd15e('0xf')][_0xd15e('0x11')]);}logger[_0xd15e('0xf')](_0xd15e('0xc'),_0x56422e,_0x4a741a[_0xd15e('0xf')][_0xd15e('0x11')]);return _0x49a6fc(_0x4a741a[_0xd15e('0xf')][_0xd15e('0x11')]);}else{logger[_0xd15e('0x12')](_0xd15e('0xc'),_0x56422e,'request\x20sent');_0x49a6fc(_0x4a741a[_0xd15e('0x13')][_0xd15e('0x11')]);}})[_0xd15e('0x14')](function(_0x980779){logger['error'](_0xd15e('0xc'),_0x56422e,_0x980779);_0x49305a(_0x980779);});});} \ No newline at end of file +var _0xd95d=['error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x35dac7,_0x3a222d){var _0x30de62=function(_0xc42ae8){while(--_0xc42ae8){_0x35dac7['push'](_0x35dac7['shift']());}};_0x30de62(++_0x3a222d);}(_0xd95d,0x146));var _0xdd95=function(_0x2d8c34,_0x44c4d4){_0x2d8c34=_0x2d8c34-0x0;var _0x126987=_0xd95d[_0x2d8c34];return _0x126987;};'use strict';var _=require(_0xdd95('0x0'));var util=require(_0xdd95('0x1'));var moment=require('moment');var BPromise=require(_0xdd95('0x2'));var rs=require(_0xdd95('0x3'));var fs=require('fs');var Redis=require(_0xdd95('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd95('0x5'));var logger=require(_0xdd95('0x6'))(_0xdd95('0x7'));var config=require(_0xdd95('0x8'));var jayson=require(_0xdd95('0x9'));var client=jayson[_0xdd95('0xa')][_0xdd95('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x110625,_0x44ca38,_0xafc998){return new BPromise(function(_0x499105,_0x246b3e){return client[_0xdd95('0xc')](_0x110625,_0xafc998)[_0xdd95('0xd')](function(_0x1d9606){logger[_0xdd95('0xe')](_0xdd95('0xf'),_0x44ca38,'request\x20sent');logger[_0xdd95('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x44ca38,_0xdd95('0x11'),JSON[_0xdd95('0x12')](_0x1d9606));if(_0x1d9606[_0xdd95('0x13')]){if(_0x1d9606['error'][_0xdd95('0x14')]===0x1f4){logger['error'](_0xdd95('0xf'),_0x44ca38,_0x1d9606[_0xdd95('0x13')][_0xdd95('0x15')]);return _0x246b3e(_0x1d9606[_0xdd95('0x13')]['message']);}logger[_0xdd95('0x13')](_0xdd95('0xf'),_0x44ca38,_0x1d9606[_0xdd95('0x13')][_0xdd95('0x15')]);return _0x499105(_0x1d9606[_0xdd95('0x13')][_0xdd95('0x15')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x44ca38,_0xdd95('0x11'));_0x499105(_0x1d9606['result'][_0xdd95('0x15')]);}})[_0xdd95('0x16')](function(_0x2fb004){logger[_0xdd95('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x44ca38,_0x2fb004);_0x246b3e(_0x2fb004);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 69fe309..008d090 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 _0xf603=['isAuthenticated','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf603,0x124));var _0x3f60=function(_0x2936ae,_0x45287a){_0x2936ae=_0x2936ae-0x0;var _0x38c6df=_0xf603[_0x2936ae];return _0x38c6df;};'use strict';var multer=require(_0x3f60('0x0'));var util=require(_0x3f60('0x1'));var path=require('path');var timeout=require(_0x3f60('0x2'));var express=require(_0x3f60('0x3'));var router=express[_0x3f60('0x4')]();var fs_extra=require(_0x3f60('0x5'));var auth=require(_0x3f60('0x6'));var interaction=require(_0x3f60('0x7'));var config=require(_0x3f60('0x8'));var controller=require(_0x3f60('0x9'));router[_0x3f60('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3f60('0xb'),auth[_0x3f60('0xc')](),controller[_0x3f60('0xd')]);router[_0x3f60('0xe')]('/',auth[_0x3f60('0xc')](),controller[_0x3f60('0xf')]);router[_0x3f60('0x10')](_0x3f60('0xb'),auth[_0x3f60('0xc')](),controller[_0x3f60('0x11')]);router[_0x3f60('0x12')](_0x3f60('0xb'),auth[_0x3f60('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbacd=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x358fef,_0x17cbb9){var _0x24bfe8=function(_0x37aa97){while(--_0x37aa97){_0x358fef['push'](_0x358fef['shift']());}};_0x24bfe8(++_0x17cbb9);}(_0xbacd,0x1c5));var _0xdbac=function(_0x4c4b22,_0xcfa23f){_0x4c4b22=_0x4c4b22-0x0;var _0x40f400=_0xbacd[_0x4c4b22];return _0x40f400;};'use strict';var multer=require(_0xdbac('0x0'));var util=require(_0xdbac('0x1'));var path=require('path');var timeout=require(_0xdbac('0x2'));var express=require(_0xdbac('0x3'));var router=express[_0xdbac('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdbac('0x5'));var interaction=require(_0xdbac('0x6'));var config=require(_0xdbac('0x7'));var controller=require(_0xdbac('0x8'));router[_0xdbac('0x9')]('/',auth[_0xdbac('0xa')](),controller[_0xdbac('0xb')]);router[_0xdbac('0x9')](_0xdbac('0xc'),auth[_0xdbac('0xa')](),controller[_0xdbac('0xd')]);router[_0xdbac('0xe')]('/',auth[_0xdbac('0xa')](),controller[_0xdbac('0xf')]);router[_0xdbac('0x10')]('/:id',auth[_0xdbac('0xa')](),controller[_0xdbac('0x11')]);router['delete'](_0xdbac('0xc'),auth['isAuthenticated'](),controller[_0xdbac('0x12')]);module[_0xdbac('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 47fd8c8..39b2379 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 _0x238d=['exports','TEXT'];(function(_0x208213,_0x330f26){var _0x2fe677=function(_0xccc12c){while(--_0xccc12c){_0x208213['push'](_0x208213['shift']());}};_0x2fe677(++_0x330f26);}(_0x238d,0xba));var _0xd238=function(_0x5a6519,_0x4c13e9){_0x5a6519=_0x5a6519-0x0;var _0x51e08e=_0x238d[_0x5a6519];return _0x51e08e;};'use strict';var Sequelize=require('sequelize');module[_0xd238('0x0')]={'tree':{'type':Sequelize[_0xd238('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xb773=['sequelize','TEXT'];(function(_0x2c8dff,_0x408d09){var _0x4f3b95=function(_0x1e29d8){while(--_0x1e29d8){_0x2c8dff['push'](_0x2c8dff['shift']());}};_0x4f3b95(++_0x408d09);}(_0xb773,0x182));var _0x3b77=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0xb773[_0x22b39b];return _0x280e1d;};'use strict';var Sequelize=require(_0x3b77('0x0'));module['exports']={'tree':{'type':Sequelize[_0x3b77('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 3b2fbb6..1a47a96 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 _0x8d4b=['rawAttributes','type','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','options','AnalyticTreeReport','includeAll','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','index','map'];(function(_0x4d57e2,_0x36403){var _0x33136c=function(_0x1a917f){while(--_0x1a917f){_0x4d57e2['push'](_0x4d57e2['shift']());}};_0x33136c(++_0x36403);}(_0x8d4b,0x17a));var _0xb8d4=function(_0x480e91,_0x15c065){_0x480e91=_0x480e91-0x0;var _0x272813=_0x8d4b[_0x480e91];return _0x272813;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb8d4('0x0'));var zipdir=require(_0xb8d4('0x1'));var jsonpatch=require(_0xb8d4('0x2'));var rp=require(_0xb8d4('0x3'));var moment=require('moment');var BPromise=require(_0xb8d4('0x4'));var Mustache=require(_0xb8d4('0x5'));var util=require(_0xb8d4('0x6'));var path=require(_0xb8d4('0x7'));var sox=require(_0xb8d4('0x8'));var csv=require(_0xb8d4('0x9'));var ejs=require(_0xb8d4('0xa'));var fs=require('fs');var fs_extra=require(_0xb8d4('0xb'));var _=require(_0xb8d4('0xc'));var squel=require('squel');var crypto=require(_0xb8d4('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb8d4('0x9'));var querystring=require(_0xb8d4('0xe'));var Papa=require('papaparse');var Redis=require(_0xb8d4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb8d4('0x10'));var as=require(_0xb8d4('0x11'));var hardwareService=require(_0xb8d4('0x12'));var logger=require('../../config/logger')(_0xb8d4('0x13'));var utils=require(_0xb8d4('0x14'));var config=require(_0xb8d4('0x15'));var licenseUtil=require(_0xb8d4('0x16'));var db=require(_0xb8d4('0x17'))['db'];function respondWithStatusCode(_0x337133,_0x32a065){_0x32a065=_0x32a065||0xcc;return function(_0x296bc1){if(_0x296bc1){return _0x337133['sendStatus'](_0x32a065);}return _0x337133['status'](_0x32a065)[_0xb8d4('0x18')]();};}function respondWithResult(_0x4655bf,_0x34e60c){_0x34e60c=_0x34e60c||0xc8;return function(_0x56e657){if(_0x56e657){return _0x4655bf[_0xb8d4('0x19')](_0x34e60c)[_0xb8d4('0x1a')](_0x56e657);}};}function respondWithFilteredResult(_0x5407d3,_0x5470b4){return function(_0x455822){if(_0x455822){var _0x2c4993=typeof _0x5470b4[_0xb8d4('0x1b')]===_0xb8d4('0x1c')&&typeof _0x5470b4['limit']===_0xb8d4('0x1c');var _0x5f553f=_0x455822[_0xb8d4('0x1d')];var _0xe40f44=_0x2c4993?0x0:_0x5470b4[_0xb8d4('0x1b')];var _0x1ef818=_0x2c4993?_0x455822[_0xb8d4('0x1d')]:_0x5470b4[_0xb8d4('0x1b')]+_0x5470b4['limit'];var _0x214629;if(_0x1ef818>=_0x5f553f){_0x1ef818=_0x5f553f;_0x214629=0xc8;}else{_0x214629=0xce;}_0x5407d3[_0xb8d4('0x19')](_0x214629);return _0x5407d3[_0xb8d4('0x1e')](_0xb8d4('0x1f'),_0xe40f44+'-'+_0x1ef818+'/'+_0x5f553f)[_0xb8d4('0x1a')](_0x455822);}return null;};}function patchUpdates(_0x144109){return function(_0x5a235a){try{jsonpatch[_0xb8d4('0x20')](_0x5a235a,_0x144109,!![]);}catch(_0x1c5a8b){return BPromise[_0xb8d4('0x21')](_0x1c5a8b);}return _0x5a235a[_0xb8d4('0x22')]();};}function saveUpdates(_0x17ed75,_0x5e8906){return function(_0x415b4a){if(_0x415b4a){return _0x415b4a[_0xb8d4('0x23')](_0x17ed75)[_0xb8d4('0x24')](function(_0x2051c9){return _0x2051c9;});}return null;};}function removeEntity(_0x8ba3c4,_0x487b39){return function(_0x17e9c9){if(_0x17e9c9){return _0x17e9c9[_0xb8d4('0x25')]()[_0xb8d4('0x24')](function(){_0x8ba3c4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x142541,_0x18bb1d){return function(_0x3b2f0e){if(!_0x3b2f0e){_0x142541[_0xb8d4('0x26')](0x194);}return _0x3b2f0e;};}function handleError(_0x5a7ce0,_0xd239f9){_0xd239f9=_0xd239f9||0x1f4;return function(_0x341226){logger['error'](_0x341226['stack']);if(_0x341226[_0xb8d4('0x27')]){delete _0x341226[_0xb8d4('0x27')];}_0x5a7ce0[_0xb8d4('0x19')](_0xd239f9)['send'](_0x341226);};}exports[_0xb8d4('0x28')]=function(_0xcf6c79,_0x3ad797){var _0x550960={},_0x5df0f0={},_0x40b10b={'count':0x0,'rows':[]};var _0x20b699=_[_0xb8d4('0x29')](db['AnalyticTreeReport'][_0xb8d4('0x2a')],function(_0x302b09){return{'name':_0x302b09['fieldName'],'type':_0x302b09[_0xb8d4('0x2b')]['key']};});_0x5df0f0['model']=_[_0xb8d4('0x29')](_0x20b699,'name');_0x5df0f0[_0xb8d4('0x2c')]=_[_0xb8d4('0x2d')](_0xcf6c79['query']);_0x5df0f0[_0xb8d4('0x2e')]=_[_0xb8d4('0x2f')](_0x5df0f0[_0xb8d4('0x30')],_0x5df0f0[_0xb8d4('0x2c')]);_0x550960['attributes']=_[_0xb8d4('0x2f')](_0x5df0f0[_0xb8d4('0x30')],qs[_0xb8d4('0x31')](_0xcf6c79[_0xb8d4('0x2c')][_0xb8d4('0x31')]));_0x550960['attributes']=_0x550960['attributes'][_0xb8d4('0x32')]?_0x550960[_0xb8d4('0x33')]:_0x5df0f0['model'];if(!_0xcf6c79[_0xb8d4('0x2c')][_0xb8d4('0x34')](_0xb8d4('0x35'))){_0x550960[_0xb8d4('0x36')]=qs[_0xb8d4('0x36')](_0xcf6c79['query'][_0xb8d4('0x36')]);_0x550960['offset']=qs[_0xb8d4('0x1b')](_0xcf6c79[_0xb8d4('0x2c')][_0xb8d4('0x1b')]);}_0x550960[_0xb8d4('0x37')]=qs['sort'](_0xcf6c79[_0xb8d4('0x2c')][_0xb8d4('0x38')]);_0x550960[_0xb8d4('0x39')]=qs[_0xb8d4('0x2e')](_[_0xb8d4('0x3a')](_0xcf6c79[_0xb8d4('0x2c')],_0x5df0f0[_0xb8d4('0x2e')]),_0x20b699);if(_0xcf6c79[_0xb8d4('0x2c')]['filter']){_0x550960[_0xb8d4('0x39')]=_['merge'](_0x550960[_0xb8d4('0x39')],{'$or':_['map'](_0x20b699,function(_0x54b2eb){if(_0x54b2eb[_0xb8d4('0x2b')]!=='VIRTUAL'){var _0x5ca648={};_0x5ca648[_0x54b2eb[_0xb8d4('0x27')]]={'$like':'%'+_0xcf6c79[_0xb8d4('0x2c')]['filter']+'%'};return _0x5ca648;}})});}_0x550960=_[_0xb8d4('0x3b')]({},_0x550960,_0xcf6c79[_0xb8d4('0x3c')]);var _0x2437e4={'where':_0x550960[_0xb8d4('0x39')]};return db[_0xb8d4('0x3d')][_0xb8d4('0x1d')](_0x2437e4)['then'](function(_0x20b0bd){_0x40b10b['count']=_0x20b0bd;if(_0xcf6c79['query'][_0xb8d4('0x3e')]){_0x550960['include']=[{'all':!![]}];}return db[_0xb8d4('0x3d')][_0xb8d4('0x3f')](_0x550960);})[_0xb8d4('0x24')](function(_0x365976){_0x40b10b[_0xb8d4('0x40')]=_0x365976;return _0x40b10b;})['then'](respondWithFilteredResult(_0x3ad797,_0x550960))[_0xb8d4('0x41')](handleError(_0x3ad797,null));};exports['show']=function(_0x56d790,_0x2bdd4c){var _0x35b273={'raw':!![],'where':{'id':_0x56d790[_0xb8d4('0x42')]['id']}},_0x5f305e={};_0x5f305e[_0xb8d4('0x30')]=_[_0xb8d4('0x2d')](db[_0xb8d4('0x3d')][_0xb8d4('0x2a')]);_0x5f305e['query']=_[_0xb8d4('0x2d')](_0x56d790[_0xb8d4('0x2c')]);_0x5f305e[_0xb8d4('0x2e')]=_['intersection'](_0x5f305e[_0xb8d4('0x30')],_0x5f305e[_0xb8d4('0x2c')]);_0x35b273[_0xb8d4('0x33')]=_['intersection'](_0x5f305e[_0xb8d4('0x30')],qs[_0xb8d4('0x31')](_0x56d790['query'][_0xb8d4('0x31')]));_0x35b273['attributes']=_0x35b273[_0xb8d4('0x33')]['length']?_0x35b273['attributes']:_0x5f305e[_0xb8d4('0x30')];if(_0x56d790[_0xb8d4('0x2c')][_0xb8d4('0x3e')]){_0x35b273['include']=[{'all':!![]}];}_0x35b273=_[_0xb8d4('0x3b')]({},_0x35b273,_0x56d790['options']);return db[_0xb8d4('0x3d')][_0xb8d4('0x43')](_0x35b273)[_0xb8d4('0x24')](handleEntityNotFound(_0x2bdd4c,null))[_0xb8d4('0x24')](respondWithResult(_0x2bdd4c,null))[_0xb8d4('0x41')](handleError(_0x2bdd4c,null));};exports[_0xb8d4('0x44')]=function(_0xd42a84,_0x37982d){return db[_0xb8d4('0x3d')]['create'](_0xd42a84[_0xb8d4('0x45')],{})[_0xb8d4('0x24')](respondWithResult(_0x37982d,0xc9))[_0xb8d4('0x41')](handleError(_0x37982d,null));};exports[_0xb8d4('0x23')]=function(_0x33a47b,_0x2f5fa7){if(_0x33a47b[_0xb8d4('0x45')]['id']){delete _0x33a47b['body']['id'];}return db[_0xb8d4('0x3d')][_0xb8d4('0x43')]({'where':{'id':_0x33a47b[_0xb8d4('0x42')]['id']}})[_0xb8d4('0x24')](handleEntityNotFound(_0x2f5fa7,null))[_0xb8d4('0x24')](saveUpdates(_0x33a47b[_0xb8d4('0x45')],null))['then'](respondWithResult(_0x2f5fa7,null))[_0xb8d4('0x41')](handleError(_0x2f5fa7,null));};exports[_0xb8d4('0x25')]=function(_0x108961,_0x5c38fb){return db['AnalyticTreeReport'][_0xb8d4('0x43')]({'where':{'id':_0x108961['params']['id']}})[_0xb8d4('0x24')](handleEntityNotFound(_0x5c38fb,null))[_0xb8d4('0x24')](removeEntity(_0x5c38fb,null))['catch'](handleError(_0x5c38fb,null));}; \ No newline at end of file +var _0xc960=['to-csv','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','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','AnalyticTreeReport','findAll','rows','catch','params','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x5604b2,_0x3f316b){var _0x114a9e=function(_0xcb258){while(--_0xcb258){_0x5604b2['push'](_0x5604b2['shift']());}};_0x114a9e(++_0x3f316b);}(_0xc960,0x11e));var _0x0c96=function(_0x76ae3c,_0x2e223e){_0x76ae3c=_0x76ae3c-0x0;var _0x41e401=_0xc960[_0x76ae3c];return _0x41e401;};'use strict';var emlformat=require(_0x0c96('0x0'));var rimraf=require(_0x0c96('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c96('0x2'));var rp=require(_0x0c96('0x3'));var moment=require('moment');var BPromise=require(_0x0c96('0x4'));var Mustache=require(_0x0c96('0x5'));var util=require(_0x0c96('0x6'));var path=require(_0x0c96('0x7'));var sox=require(_0x0c96('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c96('0x9'));var _=require(_0x0c96('0xa'));var squel=require(_0x0c96('0xb'));var crypto=require(_0x0c96('0xc'));var jsforce=require(_0x0c96('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0c96('0xe'));var querystring=require('querystring');var Papa=require(_0x0c96('0xf'));var Redis=require(_0x0c96('0x10'));var authService=require(_0x0c96('0x11'));var qs=require(_0x0c96('0x12'));var as=require(_0x0c96('0x13'));var hardwareService=require(_0x0c96('0x14'));var logger=require(_0x0c96('0x15'))(_0x0c96('0x16'));var utils=require(_0x0c96('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0c96('0x18'));var db=require(_0x0c96('0x19'))['db'];function respondWithStatusCode(_0x330dab,_0x3fad17){_0x3fad17=_0x3fad17||0xcc;return function(_0x606105){if(_0x606105){return _0x330dab[_0x0c96('0x1a')](_0x3fad17);}return _0x330dab[_0x0c96('0x1b')](_0x3fad17)[_0x0c96('0x1c')]();};}function respondWithResult(_0x152621,_0x49ef45){_0x49ef45=_0x49ef45||0xc8;return function(_0x5c682b){if(_0x5c682b){return _0x152621['status'](_0x49ef45)[_0x0c96('0x1d')](_0x5c682b);}};}function respondWithFilteredResult(_0x54c812,_0x5e4a60){return function(_0x1b81c9){if(_0x1b81c9){var _0xe6e69a=typeof _0x5e4a60[_0x0c96('0x1e')]===_0x0c96('0x1f')&&typeof _0x5e4a60[_0x0c96('0x20')]===_0x0c96('0x1f');var _0x34f1f0=_0x1b81c9[_0x0c96('0x21')];var _0x33d431=_0xe6e69a?0x0:_0x5e4a60[_0x0c96('0x1e')];var _0x406c12=_0xe6e69a?_0x1b81c9['count']:_0x5e4a60[_0x0c96('0x1e')]+_0x5e4a60['limit'];var _0x45757f;if(_0x406c12>=_0x34f1f0){_0x406c12=_0x34f1f0;_0x45757f=0xc8;}else{_0x45757f=0xce;}_0x54c812[_0x0c96('0x1b')](_0x45757f);return _0x54c812['set'](_0x0c96('0x22'),_0x33d431+'-'+_0x406c12+'/'+_0x34f1f0)[_0x0c96('0x1d')](_0x1b81c9);}return null;};}function patchUpdates(_0x2ccc20){return function(_0x2052c9){try{jsonpatch[_0x0c96('0x23')](_0x2052c9,_0x2ccc20,!![]);}catch(_0x562724){return BPromise[_0x0c96('0x24')](_0x562724);}return _0x2052c9[_0x0c96('0x25')]();};}function saveUpdates(_0x484431,_0x47b954){return function(_0x47323a){if(_0x47323a){return _0x47323a[_0x0c96('0x26')](_0x484431)['then'](function(_0x158af1){return _0x158af1;});}return null;};}function removeEntity(_0x17c03b,_0x65b871){return function(_0x28d79a){if(_0x28d79a){return _0x28d79a[_0x0c96('0x27')]()[_0x0c96('0x28')](function(){_0x17c03b[_0x0c96('0x1b')](0xcc)[_0x0c96('0x1c')]();});}};}function handleEntityNotFound(_0x59b06c,_0x30512c){return function(_0x29e3f7){if(!_0x29e3f7){_0x59b06c['sendStatus'](0x194);}return _0x29e3f7;};}function handleError(_0x32d48a,_0x4a862d){_0x4a862d=_0x4a862d||0x1f4;return function(_0x136c9f){logger[_0x0c96('0x29')](_0x136c9f['stack']);if(_0x136c9f[_0x0c96('0x2a')]){delete _0x136c9f['name'];}_0x32d48a[_0x0c96('0x1b')](_0x4a862d)[_0x0c96('0x2b')](_0x136c9f);};}exports[_0x0c96('0x2c')]=function(_0x24850c,_0x5edd6d){var _0x59ee86={},_0x47312e={},_0x3001cc={'count':0x0,'rows':[]};var _0x375fb0=_[_0x0c96('0x2d')](db['AnalyticTreeReport'][_0x0c96('0x2e')],function(_0x15e41f){return{'name':_0x15e41f['fieldName'],'type':_0x15e41f[_0x0c96('0x2f')]['key']};});_0x47312e['model']=_[_0x0c96('0x2d')](_0x375fb0,_0x0c96('0x2a'));_0x47312e[_0x0c96('0x30')]=_[_0x0c96('0x31')](_0x24850c['query']);_0x47312e[_0x0c96('0x32')]=_[_0x0c96('0x33')](_0x47312e[_0x0c96('0x34')],_0x47312e['query']);_0x59ee86[_0x0c96('0x35')]=_['intersection'](_0x47312e['model'],qs[_0x0c96('0x36')](_0x24850c[_0x0c96('0x30')][_0x0c96('0x36')]));_0x59ee86[_0x0c96('0x35')]=_0x59ee86['attributes'][_0x0c96('0x37')]?_0x59ee86['attributes']:_0x47312e[_0x0c96('0x34')];if(!_0x24850c['query']['hasOwnProperty'](_0x0c96('0x38'))){_0x59ee86[_0x0c96('0x20')]=qs[_0x0c96('0x20')](_0x24850c[_0x0c96('0x30')]['limit']);_0x59ee86[_0x0c96('0x1e')]=qs[_0x0c96('0x1e')](_0x24850c['query'][_0x0c96('0x1e')]);}_0x59ee86[_0x0c96('0x39')]=qs[_0x0c96('0x3a')](_0x24850c[_0x0c96('0x30')]['sort']);_0x59ee86[_0x0c96('0x3b')]=qs['filters'](_[_0x0c96('0x3c')](_0x24850c['query'],_0x47312e['filters']),_0x375fb0);if(_0x24850c[_0x0c96('0x30')][_0x0c96('0x3d')]){_0x59ee86[_0x0c96('0x3b')]=_[_0x0c96('0x3e')](_0x59ee86['where'],{'$or':_[_0x0c96('0x2d')](_0x375fb0,function(_0x5b66be){if(_0x5b66be[_0x0c96('0x2f')]!==_0x0c96('0x3f')){var _0x15b3bd={};_0x15b3bd[_0x5b66be[_0x0c96('0x2a')]]={'$like':'%'+_0x24850c['query'][_0x0c96('0x3d')]+'%'};return _0x15b3bd;}})});}_0x59ee86=_[_0x0c96('0x3e')]({},_0x59ee86,_0x24850c[_0x0c96('0x40')]);var _0x25aefa={'where':_0x59ee86['where']};return db['AnalyticTreeReport']['count'](_0x25aefa)[_0x0c96('0x28')](function(_0x3cdf2e){_0x3001cc[_0x0c96('0x21')]=_0x3cdf2e;if(_0x24850c[_0x0c96('0x30')][_0x0c96('0x41')]){_0x59ee86['include']=[{'all':!![]}];}return db[_0x0c96('0x42')][_0x0c96('0x43')](_0x59ee86);})[_0x0c96('0x28')](function(_0x126f9d){_0x3001cc[_0x0c96('0x44')]=_0x126f9d;return _0x3001cc;})[_0x0c96('0x28')](respondWithFilteredResult(_0x5edd6d,_0x59ee86))[_0x0c96('0x45')](handleError(_0x5edd6d,null));};exports['show']=function(_0x35cfe7,_0x56310f){var _0x580289={'raw':!![],'where':{'id':_0x35cfe7[_0x0c96('0x46')]['id']}},_0x4ceb99={};_0x4ceb99[_0x0c96('0x34')]=_[_0x0c96('0x31')](db[_0x0c96('0x42')][_0x0c96('0x2e')]);_0x4ceb99[_0x0c96('0x30')]=_[_0x0c96('0x31')](_0x35cfe7[_0x0c96('0x30')]);_0x4ceb99[_0x0c96('0x32')]=_['intersection'](_0x4ceb99['model'],_0x4ceb99['query']);_0x580289['attributes']=_[_0x0c96('0x33')](_0x4ceb99[_0x0c96('0x34')],qs[_0x0c96('0x36')](_0x35cfe7[_0x0c96('0x30')][_0x0c96('0x36')]));_0x580289[_0x0c96('0x35')]=_0x580289[_0x0c96('0x35')][_0x0c96('0x37')]?_0x580289[_0x0c96('0x35')]:_0x4ceb99[_0x0c96('0x34')];if(_0x35cfe7['query'][_0x0c96('0x41')]){_0x580289[_0x0c96('0x47')]=[{'all':!![]}];}_0x580289=_[_0x0c96('0x3e')]({},_0x580289,_0x35cfe7[_0x0c96('0x40')]);return db[_0x0c96('0x42')][_0x0c96('0x48')](_0x580289)['then'](handleEntityNotFound(_0x56310f,null))[_0x0c96('0x28')](respondWithResult(_0x56310f,null))[_0x0c96('0x45')](handleError(_0x56310f,null));};exports['create']=function(_0x43dcf3,_0x2a7b42){return db[_0x0c96('0x42')][_0x0c96('0x49')](_0x43dcf3[_0x0c96('0x4a')],{})[_0x0c96('0x28')](respondWithResult(_0x2a7b42,0xc9))[_0x0c96('0x45')](handleError(_0x2a7b42,null));};exports[_0x0c96('0x26')]=function(_0x45e86b,_0x3f0bee){if(_0x45e86b[_0x0c96('0x4a')]['id']){delete _0x45e86b[_0x0c96('0x4a')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x45e86b['params']['id']}})[_0x0c96('0x28')](handleEntityNotFound(_0x3f0bee,null))['then'](saveUpdates(_0x45e86b[_0x0c96('0x4a')],null))['then'](respondWithResult(_0x3f0bee,null))[_0x0c96('0x45')](handleError(_0x3f0bee,null));};exports['destroy']=function(_0x4e8972,_0xfadb5e){return db[_0x0c96('0x42')][_0x0c96('0x48')]({'where':{'id':_0x4e8972[_0x0c96('0x46')]['id']}})['then'](handleEntityNotFound(_0xfadb5e,null))['then'](removeEntity(_0xfadb5e,null))[_0x0c96('0x45')](handleError(_0xfadb5e,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 059340f..bbfadf2 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 _0x040b=['bluebird','request-promise','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment'];(function(_0x197845,_0x5ccccc){var _0x12f6b7=function(_0x444f0a){while(--_0x444f0a){_0x197845['push'](_0x197845['shift']());}};_0x12f6b7(++_0x5ccccc);}(_0x040b,0xa4));var _0xb040=function(_0x3858b8,_0x566519){_0x3858b8=_0x3858b8-0x0;var _0x32ae8e=_0x040b[_0x3858b8];return _0x32ae8e;};'use strict';var _=require('lodash');var util=require(_0xb040('0x0'));var logger=require(_0xb040('0x1'))(_0xb040('0x2'));var moment=require(_0xb040('0x3'));var BPromise=require(_0xb040('0x4'));var rp=require(_0xb040('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb040('0x6'));var config=require('../../config/environment');var attributes=require(_0xb040('0x7'));module[_0xb040('0x8')]=function(_0xf9b76b,_0x361125){return _0xf9b76b[_0xb040('0x9')](_0xb040('0xa'),attributes,{'tableName':_0xb040('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4920=['request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','analytics_report_trees','util','../../config/logger','moment','bluebird'];(function(_0x2935ca,_0x2cad23){var _0x5a5faf=function(_0x2c7bd7){while(--_0x2c7bd7){_0x2935ca['push'](_0x2935ca['shift']());}};_0x5a5faf(++_0x2cad23);}(_0x4920,0x96));var _0x0492=function(_0x49d1f9,_0x1c5f67){_0x49d1f9=_0x49d1f9-0x0;var _0x3cfd1a=_0x4920[_0x49d1f9];return _0x3cfd1a;};'use strict';var _=require('lodash');var util=require(_0x0492('0x0'));var logger=require(_0x0492('0x1'))('api');var moment=require(_0x0492('0x2'));var BPromise=require(_0x0492('0x3'));var rp=require(_0x0492('0x4'));var fs=require('fs');var path=require(_0x0492('0x5'));var rimraf=require(_0x0492('0x6'));var config=require(_0x0492('0x7'));var attributes=require(_0x0492('0x8'));module['exports']=function(_0x64a17b,_0xeca493){return _0x64a17b[_0x0492('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x0492('0xa'),'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 679939c..45486c2 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1fde84,_0x453e74){var _0x4d5b74=function(_0x4c8833){while(--_0x4c8833){_0x1fde84['push'](_0x1fde84['shift']());}};_0x4d5b74(++_0x453e74);}(_0xdb28,0x106));var _0x8db2=function(_0x8fab9a,_0x2c0282){_0x8fab9a=_0x8fab9a-0x0;var _0x435da4=_0xdb28[_0x8fab9a];return _0x435da4;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x53c878,_0x1bfc1a){var _0x182454=function(_0x2a3410){while(--_0x2a3410){_0x53c878['push'](_0x53c878['shift']());}};_0x182454(++_0x1bfc1a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3ac5fb,_0x5fbe6f){_0x3ac5fb=_0x3ac5fb-0x0;var _0x56260f=_0x5f2f[_0x3ac5fb];return _0x56260f;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 170b489..69fa536 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 _0xd92a=['put','delete','destroy','exports','multer','connect-timeout','../../components/interaction/service','get','isAuthenticated','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd92a,0x1bc));var _0xad92=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd92a[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xad92('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xad92('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xad92('0x2'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0xad92('0x3')]('/',auth[_0xad92('0x4')](),controller['index']);router[_0xad92('0x3')](_0xad92('0x5'),auth['isAuthenticated'](),controller[_0xad92('0x6')]);router['post']('/',auth[_0xad92('0x4')](),controller['create']);router[_0xad92('0x7')](_0xad92('0x5'),auth[_0xad92('0x4')](),controller['update']);router[_0xad92('0x8')](_0xad92('0x5'),auth[_0xad92('0x4')](),controller[_0xad92('0x9')]);module[_0xad92('0xa')]=router; \ No newline at end of file +var _0x7bc3=['destroy','exports','util','path','express','Router','../../components/interaction/service','isAuthenticated','index','show','post','create','put','update','delete','/:id'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0x7bc3,0x1e2));var _0x37bc=function(_0x2da246,_0x273162){_0x2da246=_0x2da246-0x0;var _0x408896=_0x7bc3[_0x2da246];return _0x408896;};'use strict';var multer=require('multer');var util=require(_0x37bc('0x0'));var path=require(_0x37bc('0x1'));var timeout=require('connect-timeout');var express=require(_0x37bc('0x2'));var router=express[_0x37bc('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x37bc('0x4'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x37bc('0x5')](),controller[_0x37bc('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x37bc('0x7')]);router[_0x37bc('0x8')]('/',auth[_0x37bc('0x5')](),controller[_0x37bc('0x9')]);router[_0x37bc('0xa')]('/:id',auth[_0x37bc('0x5')](),controller[_0x37bc('0xb')]);router[_0x37bc('0xc')](_0x37bc('0xd'),auth['isAuthenticated'](),controller[_0x37bc('0xe')]);module[_0x37bc('0xf')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index ba822d4..47b914e 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 _0xcab6=['sequelize','STRING'];(function(_0x52b67b,_0x126ce8){var _0x314fd1=function(_0x58b8cb){while(--_0x58b8cb){_0x52b67b['push'](_0x52b67b['shift']());}};_0x314fd1(++_0x126ce8);}(_0xcab6,0xd4));var _0x6cab=function(_0x2eb72e,_0x4ac410){_0x2eb72e=_0x2eb72e-0x0;var _0x298ddd=_0xcab6[_0x2eb72e];return _0x298ddd;};'use strict';var Sequelize=require(_0x6cab('0x0'));module['exports']={'name':{'type':Sequelize[_0x6cab('0x1')]},'basename':{'type':Sequelize[_0x6cab('0x1')]},'type':{'type':Sequelize[_0x6cab('0x1')]}}; \ No newline at end of file +var _0x4849=['exports','STRING','sequelize'];(function(_0x1c5563,_0x54fc75){var _0x1a0e76=function(_0xe80be4){while(--_0xe80be4){_0x1c5563['push'](_0x1c5563['shift']());}};_0x1a0e76(++_0x54fc75);}(_0x4849,0x86));var _0x9484=function(_0x49aae5,_0x1f5058){_0x49aae5=_0x49aae5-0x0;var _0xe000c4=_0x4849[_0x49aae5];return _0xe000c4;};'use strict';var Sequelize=require(_0x9484('0x0'));module[_0x9484('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x9484('0x2')]},'type':{'type':Sequelize[_0x9484('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 6884d40..31ae255 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 _0xcd79=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','send','Attachment','rawAttributes','fieldName','model','map','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','filter','where','type','VIRTUAL','include','findAll','rows','show','params','length','merge','options','find','catch','includeAll','get','omit','createdAt','updatedAt','body','create','originalname','basename','filename','file','mimetype','download','findOne','join','root','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x891294,_0x3a5772){var _0x1d74de=function(_0x17b04b){while(--_0x17b04b){_0x891294['push'](_0x891294['shift']());}};_0x1d74de(++_0x3a5772);}(_0xcd79,0x15b));var _0x9cd7=function(_0x581b42,_0x3e6805){_0x581b42=_0x581b42-0x0;var _0x15197d=_0xcd79[_0x581b42];return _0x15197d;};'use strict';var emlformat=require(_0x9cd7('0x0'));var rimraf=require(_0x9cd7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9cd7('0x2'));var rp=require(_0x9cd7('0x3'));var moment=require(_0x9cd7('0x4'));var BPromise=require(_0x9cd7('0x5'));var Mustache=require(_0x9cd7('0x6'));var util=require(_0x9cd7('0x7'));var path=require(_0x9cd7('0x8'));var sox=require(_0x9cd7('0x9'));var csv=require(_0x9cd7('0xa'));var ejs=require(_0x9cd7('0xb'));var fs=require('fs');var fs_extra=require(_0x9cd7('0xc'));var _=require(_0x9cd7('0xd'));var squel=require(_0x9cd7('0xe'));var crypto=require(_0x9cd7('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9cd7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9cd7('0x11'));var Papa=require(_0x9cd7('0x12'));var Redis=require(_0x9cd7('0x13'));var authService=require(_0x9cd7('0x14'));var qs=require(_0x9cd7('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9cd7('0x16'));var logger=require('../../config/logger')(_0x9cd7('0x17'));var utils=require('../../config/utils');var config=require(_0x9cd7('0x18'));var licenseUtil=require(_0x9cd7('0x19'));var db=require(_0x9cd7('0x1a'))['db'];function respondWithStatusCode(_0x3d29a0,_0x309a2e){_0x309a2e=_0x309a2e||0xcc;return function(_0x35e1d5){if(_0x35e1d5){return _0x3d29a0[_0x9cd7('0x1b')](_0x309a2e);}return _0x3d29a0[_0x9cd7('0x1c')](_0x309a2e)['end']();};}function respondWithResult(_0x33c78d,_0x3bf5ac){_0x3bf5ac=_0x3bf5ac||0xc8;return function(_0x25d306){if(_0x25d306){return _0x33c78d['status'](_0x3bf5ac)[_0x9cd7('0x1d')](_0x25d306);}};}function respondWithFilteredResult(_0x1a1aa8,_0x356e3b){return function(_0x32fec3){if(_0x32fec3){var _0x14096e=typeof _0x356e3b[_0x9cd7('0x1e')]===_0x9cd7('0x1f')&&typeof _0x356e3b[_0x9cd7('0x20')]===_0x9cd7('0x1f');var _0x8897f4=_0x32fec3[_0x9cd7('0x21')];var _0x257d9f=_0x14096e?0x0:_0x356e3b[_0x9cd7('0x1e')];var _0x38474c=_0x14096e?_0x32fec3[_0x9cd7('0x21')]:_0x356e3b['offset']+_0x356e3b['limit'];var _0x38f880;if(_0x38474c>=_0x8897f4){_0x38474c=_0x8897f4;_0x38f880=0xc8;}else{_0x38f880=0xce;}_0x1a1aa8[_0x9cd7('0x1c')](_0x38f880);return _0x1a1aa8[_0x9cd7('0x22')](_0x9cd7('0x23'),_0x257d9f+'-'+_0x38474c+'/'+_0x8897f4)[_0x9cd7('0x1d')](_0x32fec3);}return null;};}function patchUpdates(_0x4a73ba){return function(_0x3d86e6){try{jsonpatch['apply'](_0x3d86e6,_0x4a73ba,!![]);}catch(_0x5cc0f8){return BPromise[_0x9cd7('0x24')](_0x5cc0f8);}return _0x3d86e6[_0x9cd7('0x25')]();};}function saveUpdates(_0x53f7c9,_0x1205f7){return function(_0x588edf){if(_0x588edf){return _0x588edf[_0x9cd7('0x26')](_0x53f7c9)[_0x9cd7('0x27')](function(_0x120f30){return _0x120f30;});}return null;};}function removeEntity(_0x5be7b4,_0x68e279){return function(_0x1bf349){if(_0x1bf349){return _0x1bf349[_0x9cd7('0x28')]()[_0x9cd7('0x27')](function(){_0x5be7b4[_0x9cd7('0x1c')](0xcc)[_0x9cd7('0x29')]();});}};}function handleEntityNotFound(_0x2099fb,_0x2a7b8f){return function(_0x2ec99d){if(!_0x2ec99d){_0x2099fb[_0x9cd7('0x1b')](0x194);}return _0x2ec99d;};}function handleError(_0x54ecf0,_0x3f7f3d){_0x3f7f3d=_0x3f7f3d||0x1f4;return function(_0x73abd1){logger[_0x9cd7('0x2a')](_0x73abd1[_0x9cd7('0x2b')]);if(_0x73abd1['name']){delete _0x73abd1['name'];}_0x54ecf0[_0x9cd7('0x1c')](_0x3f7f3d)[_0x9cd7('0x2c')](_0x73abd1);};}exports['index']=function(_0x3609d8,_0x39d69a){var _0x45aa7f={},_0x5772d6={},_0xaad15a={'count':0x0,'rows':[]};var _0x33f332=_['map'](db[_0x9cd7('0x2d')][_0x9cd7('0x2e')],function(_0xed5dca){return{'name':_0xed5dca[_0x9cd7('0x2f')],'type':_0xed5dca['type']['key']};});_0x5772d6[_0x9cd7('0x30')]=_[_0x9cd7('0x31')](_0x33f332,_0x9cd7('0x32'));_0x5772d6[_0x9cd7('0x33')]=_[_0x9cd7('0x34')](_0x3609d8[_0x9cd7('0x33')]);_0x5772d6[_0x9cd7('0x35')]=_['intersection'](_0x5772d6[_0x9cd7('0x30')],_0x5772d6[_0x9cd7('0x33')]);_0x45aa7f['attributes']=_[_0x9cd7('0x36')](_0x5772d6[_0x9cd7('0x30')],qs[_0x9cd7('0x37')](_0x3609d8[_0x9cd7('0x33')][_0x9cd7('0x37')]));_0x45aa7f[_0x9cd7('0x38')]=_0x45aa7f['attributes']['length']?_0x45aa7f['attributes']:_0x5772d6[_0x9cd7('0x30')];if(!_0x3609d8['query'][_0x9cd7('0x39')]('nolimit')){_0x45aa7f[_0x9cd7('0x20')]=qs[_0x9cd7('0x20')](_0x3609d8[_0x9cd7('0x33')][_0x9cd7('0x20')]);_0x45aa7f[_0x9cd7('0x1e')]=qs[_0x9cd7('0x1e')](_0x3609d8[_0x9cd7('0x33')][_0x9cd7('0x1e')]);}_0x45aa7f['order']=qs[_0x9cd7('0x3a')](_0x3609d8['query']['sort']);_0x45aa7f['where']=qs[_0x9cd7('0x35')](_[_0x9cd7('0x3b')](_0x3609d8[_0x9cd7('0x33')],_0x5772d6['filters']),_0x33f332);if(_0x3609d8[_0x9cd7('0x33')][_0x9cd7('0x3c')]){_0x45aa7f['where']=_['merge'](_0x45aa7f[_0x9cd7('0x3d')],{'$or':_[_0x9cd7('0x31')](_0x33f332,function(_0x53f765){if(_0x53f765[_0x9cd7('0x3e')]!==_0x9cd7('0x3f')){var _0xcea180={};_0xcea180[_0x53f765[_0x9cd7('0x32')]]={'$like':'%'+_0x3609d8[_0x9cd7('0x33')]['filter']+'%'};return _0xcea180;}})});}_0x45aa7f=_['merge']({},_0x45aa7f,_0x3609d8['options']);var _0x2c2643={'where':_0x45aa7f[_0x9cd7('0x3d')]};return db[_0x9cd7('0x2d')]['count'](_0x2c2643)[_0x9cd7('0x27')](function(_0x187f6e){_0xaad15a[_0x9cd7('0x21')]=_0x187f6e;if(_0x3609d8['query']['includeAll']){_0x45aa7f[_0x9cd7('0x40')]=[{'all':!![]}];}return db[_0x9cd7('0x2d')][_0x9cd7('0x41')](_0x45aa7f);})[_0x9cd7('0x27')](function(_0x151058){_0xaad15a[_0x9cd7('0x42')]=_0x151058;return _0xaad15a;})['then'](respondWithFilteredResult(_0x39d69a,_0x45aa7f))['catch'](handleError(_0x39d69a,null));};exports[_0x9cd7('0x43')]=function(_0x126405,_0x3c7dce){var _0x1f4d75={'raw':!![],'where':{'id':_0x126405[_0x9cd7('0x44')]['id']}},_0x126557={};_0x126557[_0x9cd7('0x30')]=_[_0x9cd7('0x34')](db[_0x9cd7('0x2d')][_0x9cd7('0x2e')]);_0x126557[_0x9cd7('0x33')]=_[_0x9cd7('0x34')](_0x126405['query']);_0x126557[_0x9cd7('0x35')]=_['intersection'](_0x126557[_0x9cd7('0x30')],_0x126557[_0x9cd7('0x33')]);_0x1f4d75[_0x9cd7('0x38')]=_[_0x9cd7('0x36')](_0x126557[_0x9cd7('0x30')],qs['fields'](_0x126405['query'][_0x9cd7('0x37')]));_0x1f4d75[_0x9cd7('0x38')]=_0x1f4d75[_0x9cd7('0x38')][_0x9cd7('0x45')]?_0x1f4d75[_0x9cd7('0x38')]:_0x126557[_0x9cd7('0x30')];if(_0x126405[_0x9cd7('0x33')]['includeAll']){_0x1f4d75[_0x9cd7('0x40')]=[{'all':!![]}];}_0x1f4d75=_[_0x9cd7('0x46')]({},_0x1f4d75,_0x126405[_0x9cd7('0x47')]);return db[_0x9cd7('0x2d')][_0x9cd7('0x48')](_0x1f4d75)[_0x9cd7('0x27')](handleEntityNotFound(_0x3c7dce,null))[_0x9cd7('0x27')](respondWithResult(_0x3c7dce,null))[_0x9cd7('0x49')](handleError(_0x3c7dce,null));};exports['clone']=function(_0x2c0d23,_0x660f8b){var _0x5bf237={'where':{'id':_0x2c0d23[_0x9cd7('0x44')]['id']}},_0x28e0b1={};_0x28e0b1[_0x9cd7('0x30')]=_[_0x9cd7('0x34')](db[_0x9cd7('0x2d')][_0x9cd7('0x2e')]);_0x5bf237[_0x9cd7('0x38')]=_['intersection'](_0x28e0b1[_0x9cd7('0x30')],qs['fields'](_0x2c0d23[_0x9cd7('0x33')][_0x9cd7('0x37')]));_0x5bf237[_0x9cd7('0x38')]=_0x5bf237[_0x9cd7('0x38')]['length']?_0x5bf237[_0x9cd7('0x38')]:_0x28e0b1[_0x9cd7('0x30')];if(_0x2c0d23[_0x9cd7('0x33')][_0x9cd7('0x4a')]){_0x5bf237[_0x9cd7('0x40')]=[{'all':!![]}];}_0x5bf237=_[_0x9cd7('0x46')]({},_0x5bf237,_0x2c0d23['options']);return db[_0x9cd7('0x2d')][_0x9cd7('0x48')](_0x5bf237)[_0x9cd7('0x27')](handleEntityNotFound(_0x660f8b,null))['then'](function(_0x574607){if(_0x574607){var _0x463009=_0x574607[_0x9cd7('0x4b')]({'plain':!![]});_0x463009=qs[_0x9cd7('0x4c')](_0x463009,['id',_0x9cd7('0x4d'),_0x9cd7('0x4e')]);_0x2c0d23['body']=_[_0x9cd7('0x4c')](_0x2c0d23[_0x9cd7('0x4f')],['id',_0x9cd7('0x4d'),_0x9cd7('0x4e')]);return db['Attachment'][_0x9cd7('0x50')](_[_0x9cd7('0x46')](_0x463009,_0x2c0d23[_0x9cd7('0x4f')]),{'include':_0x2c0d23[_0x9cd7('0x33')][_0x9cd7('0x4a')]?[{'all':!![]}]:undefined});}})[_0x9cd7('0x27')](respondWithResult(_0x660f8b,0xc9))[_0x9cd7('0x49')](handleError(_0x660f8b,null));};exports['update']=function(_0x536200,_0x32c11c){if(_0x536200['body']['id']){delete _0x536200[_0x9cd7('0x4f')]['id'];}return db[_0x9cd7('0x2d')][_0x9cd7('0x48')]({'where':{'id':_0x536200[_0x9cd7('0x44')]['id']}})['then'](handleEntityNotFound(_0x32c11c,null))[_0x9cd7('0x27')](saveUpdates(_0x536200['body'],null))[_0x9cd7('0x27')](respondWithResult(_0x32c11c,null))['catch'](handleError(_0x32c11c,null));};exports['destroy']=function(_0x2d4b96,_0x4c4396){return db[_0x9cd7('0x2d')][_0x9cd7('0x48')]({'where':{'id':_0x2d4b96[_0x9cd7('0x44')]['id']}})[_0x9cd7('0x27')](handleEntityNotFound(_0x4c4396,null))[_0x9cd7('0x27')](removeEntity(_0x4c4396,null))[_0x9cd7('0x49')](handleError(_0x4c4396,null));};exports[_0x9cd7('0x50')]=function(_0x18ea9a,_0x56eef0,_0x1dfe3f){_0x18ea9a[_0x9cd7('0x4f')][_0x9cd7('0x32')]=_0x18ea9a['file'][_0x9cd7('0x51')];_0x18ea9a[_0x9cd7('0x4f')][_0x9cd7('0x52')]=_0x18ea9a['file'][_0x9cd7('0x53')];_0x18ea9a[_0x9cd7('0x4f')][_0x9cd7('0x3e')]=_0x18ea9a[_0x9cd7('0x54')][_0x9cd7('0x55')];return db[_0x9cd7('0x2d')][_0x9cd7('0x50')](_0x18ea9a[_0x9cd7('0x4f')])[_0x9cd7('0x27')](respondWithResult(_0x56eef0,0xc9))[_0x9cd7('0x49')](handleError(_0x56eef0,null));};exports[_0x9cd7('0x56')]=function(_0x17a7eb,_0x56ca72,_0x4e5d55){return db['Attachment'][_0x9cd7('0x57')]({'where':{'id':_0x17a7eb[_0x9cd7('0x44')]['id']},'raw':!![]})[_0x9cd7('0x27')](handleEntityNotFound(_0x56ca72,null))['then'](function(_0x4b668c){if(_0x4b668c){var _0x5e6cff=_0x4b668c['ChatOfflineMessageId']!==null;var _0x21d70a=path[_0x9cd7('0x58')](config[_0x9cd7('0x59')],'server/files/attachments/');if(_0x5e6cff){_0x21d70a=path[_0x9cd7('0x58')](_0x21d70a,_0x9cd7('0x5a'));}var _0x309408=path['join'](_0x21d70a,_0x4b668c[_0x9cd7('0x52')]);return _0x56ca72[_0x9cd7('0x56')](_0x309408);}})['catch'](handleError(_0x56ca72,null));}; \ No newline at end of file +var _0x41d4=['sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','save','destroy','then','error','stack','name','send','index','map','Attachment','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','intersection','includeAll','find','clone','get','omit','updatedAt','createdAt','body','update','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','server/files/attachments/','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path'];(function(_0x472378,_0x327f94){var _0x4c1e48=function(_0x300b1c){while(--_0x300b1c){_0x472378['push'](_0x472378['shift']());}};_0x4c1e48(++_0x327f94);}(_0x41d4,0x103));var _0x441d=function(_0x1dab75,_0x584b43){_0x1dab75=_0x1dab75-0x0;var _0x59df44=_0x41d4[_0x1dab75];return _0x59df44;};'use strict';var emlformat=require(_0x441d('0x0'));var rimraf=require(_0x441d('0x1'));var zipdir=require(_0x441d('0x2'));var jsonpatch=require(_0x441d('0x3'));var rp=require(_0x441d('0x4'));var moment=require(_0x441d('0x5'));var BPromise=require(_0x441d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x441d('0x7'));var sox=require(_0x441d('0x8'));var csv=require(_0x441d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x441d('0xa'));var squel=require(_0x441d('0xb'));var crypto=require(_0x441d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x441d('0xd'));var toCsv=require(_0x441d('0x9'));var querystring=require(_0x441d('0xe'));var Papa=require(_0x441d('0xf'));var Redis=require(_0x441d('0x10'));var authService=require(_0x441d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x441d('0x12'));var hardwareService=require(_0x441d('0x13'));var logger=require(_0x441d('0x14'))(_0x441d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x441d('0x16'));var db=require(_0x441d('0x17'))['db'];function respondWithStatusCode(_0x583adf,_0x42b4f7){_0x42b4f7=_0x42b4f7||0xcc;return function(_0x32b360){if(_0x32b360){return _0x583adf[_0x441d('0x18')](_0x42b4f7);}return _0x583adf[_0x441d('0x19')](_0x42b4f7)[_0x441d('0x1a')]();};}function respondWithResult(_0x15052b,_0x36c2fd){_0x36c2fd=_0x36c2fd||0xc8;return function(_0x4dd19a){if(_0x4dd19a){return _0x15052b['status'](_0x36c2fd)[_0x441d('0x1b')](_0x4dd19a);}};}function respondWithFilteredResult(_0x42c80a,_0x5a5afa){return function(_0x4888f4){if(_0x4888f4){var _0x4535e4=typeof _0x5a5afa['offset']===_0x441d('0x1c')&&typeof _0x5a5afa['limit']===_0x441d('0x1c');var _0x145208=_0x4888f4[_0x441d('0x1d')];var _0x2b9cc7=_0x4535e4?0x0:_0x5a5afa[_0x441d('0x1e')];var _0x2905e7=_0x4535e4?_0x4888f4[_0x441d('0x1d')]:_0x5a5afa[_0x441d('0x1e')]+_0x5a5afa[_0x441d('0x1f')];var _0x4e1916;if(_0x2905e7>=_0x145208){_0x2905e7=_0x145208;_0x4e1916=0xc8;}else{_0x4e1916=0xce;}_0x42c80a[_0x441d('0x19')](_0x4e1916);return _0x42c80a[_0x441d('0x20')]('Content-Range',_0x2b9cc7+'-'+_0x2905e7+'/'+_0x145208)[_0x441d('0x1b')](_0x4888f4);}return null;};}function patchUpdates(_0x128441){return function(_0x11da88){try{jsonpatch[_0x441d('0x21')](_0x11da88,_0x128441,!![]);}catch(_0x45acd0){return BPromise['reject'](_0x45acd0);}return _0x11da88[_0x441d('0x22')]();};}function saveUpdates(_0x3e7955,_0x457c68){return function(_0x666566){if(_0x666566){return _0x666566['update'](_0x3e7955)['then'](function(_0x271a7c){return _0x271a7c;});}return null;};}function removeEntity(_0x2c490c,_0x453989){return function(_0x52db02){if(_0x52db02){return _0x52db02[_0x441d('0x23')]()[_0x441d('0x24')](function(){_0x2c490c[_0x441d('0x19')](0xcc)[_0x441d('0x1a')]();});}};}function handleEntityNotFound(_0x2f29df,_0x2fcbc0){return function(_0x153b07){if(!_0x153b07){_0x2f29df['sendStatus'](0x194);}return _0x153b07;};}function handleError(_0x320714,_0x24cb0f){_0x24cb0f=_0x24cb0f||0x1f4;return function(_0xde5232){logger[_0x441d('0x25')](_0xde5232[_0x441d('0x26')]);if(_0xde5232[_0x441d('0x27')]){delete _0xde5232[_0x441d('0x27')];}_0x320714[_0x441d('0x19')](_0x24cb0f)[_0x441d('0x28')](_0xde5232);};}exports[_0x441d('0x29')]=function(_0x17f393,_0x10f567){var _0x551cdd={},_0x1ccccd={},_0x380deb={'count':0x0,'rows':[]};var _0x309415=_[_0x441d('0x2a')](db[_0x441d('0x2b')][_0x441d('0x2c')],function(_0x1695ca){return{'name':_0x1695ca['fieldName'],'type':_0x1695ca[_0x441d('0x2d')][_0x441d('0x2e')]};});_0x1ccccd[_0x441d('0x2f')]=_[_0x441d('0x2a')](_0x309415,'name');_0x1ccccd[_0x441d('0x30')]=_[_0x441d('0x31')](_0x17f393['query']);_0x1ccccd[_0x441d('0x32')]=_['intersection'](_0x1ccccd[_0x441d('0x2f')],_0x1ccccd[_0x441d('0x30')]);_0x551cdd[_0x441d('0x33')]=_['intersection'](_0x1ccccd[_0x441d('0x2f')],qs[_0x441d('0x34')](_0x17f393[_0x441d('0x30')][_0x441d('0x34')]));_0x551cdd[_0x441d('0x33')]=_0x551cdd[_0x441d('0x33')][_0x441d('0x35')]?_0x551cdd[_0x441d('0x33')]:_0x1ccccd[_0x441d('0x2f')];if(!_0x17f393[_0x441d('0x30')][_0x441d('0x36')](_0x441d('0x37'))){_0x551cdd[_0x441d('0x1f')]=qs[_0x441d('0x1f')](_0x17f393[_0x441d('0x30')][_0x441d('0x1f')]);_0x551cdd[_0x441d('0x1e')]=qs[_0x441d('0x1e')](_0x17f393['query'][_0x441d('0x1e')]);}_0x551cdd['order']=qs[_0x441d('0x38')](_0x17f393[_0x441d('0x30')][_0x441d('0x38')]);_0x551cdd['where']=qs['filters'](_['pick'](_0x17f393[_0x441d('0x30')],_0x1ccccd[_0x441d('0x32')]),_0x309415);if(_0x17f393[_0x441d('0x30')]['filter']){_0x551cdd[_0x441d('0x39')]=_['merge'](_0x551cdd['where'],{'$or':_[_0x441d('0x2a')](_0x309415,function(_0x3617fe){if(_0x3617fe[_0x441d('0x2d')]!==_0x441d('0x3a')){var _0x48e804={};_0x48e804[_0x3617fe['name']]={'$like':'%'+_0x17f393[_0x441d('0x30')][_0x441d('0x3b')]+'%'};return _0x48e804;}})});}_0x551cdd=_[_0x441d('0x3c')]({},_0x551cdd,_0x17f393[_0x441d('0x3d')]);var _0x128d73={'where':_0x551cdd[_0x441d('0x39')]};return db[_0x441d('0x2b')][_0x441d('0x1d')](_0x128d73)[_0x441d('0x24')](function(_0x2786f9){_0x380deb[_0x441d('0x1d')]=_0x2786f9;if(_0x17f393[_0x441d('0x30')]['includeAll']){_0x551cdd[_0x441d('0x3e')]=[{'all':!![]}];}return db[_0x441d('0x2b')][_0x441d('0x3f')](_0x551cdd);})[_0x441d('0x24')](function(_0x19ef28){_0x380deb[_0x441d('0x40')]=_0x19ef28;return _0x380deb;})[_0x441d('0x24')](respondWithFilteredResult(_0x10f567,_0x551cdd))[_0x441d('0x41')](handleError(_0x10f567,null));};exports[_0x441d('0x42')]=function(_0x22fe23,_0x309682){var _0x4caff5={'raw':!![],'where':{'id':_0x22fe23[_0x441d('0x43')]['id']}},_0x4cd079={};_0x4cd079[_0x441d('0x2f')]=_[_0x441d('0x31')](db[_0x441d('0x2b')]['rawAttributes']);_0x4cd079[_0x441d('0x30')]=_[_0x441d('0x31')](_0x22fe23['query']);_0x4cd079['filters']=_[_0x441d('0x44')](_0x4cd079[_0x441d('0x2f')],_0x4cd079[_0x441d('0x30')]);_0x4caff5[_0x441d('0x33')]=_['intersection'](_0x4cd079['model'],qs['fields'](_0x22fe23[_0x441d('0x30')]['fields']));_0x4caff5[_0x441d('0x33')]=_0x4caff5[_0x441d('0x33')][_0x441d('0x35')]?_0x4caff5[_0x441d('0x33')]:_0x4cd079[_0x441d('0x2f')];if(_0x22fe23[_0x441d('0x30')][_0x441d('0x45')]){_0x4caff5[_0x441d('0x3e')]=[{'all':!![]}];}_0x4caff5=_[_0x441d('0x3c')]({},_0x4caff5,_0x22fe23['options']);return db[_0x441d('0x2b')][_0x441d('0x46')](_0x4caff5)[_0x441d('0x24')](handleEntityNotFound(_0x309682,null))['then'](respondWithResult(_0x309682,null))['catch'](handleError(_0x309682,null));};exports[_0x441d('0x47')]=function(_0x4a022d,_0x74cd8f){var _0x50661e={'where':{'id':_0x4a022d[_0x441d('0x43')]['id']}},_0x4463ce={};_0x4463ce['model']=_['keys'](db[_0x441d('0x2b')][_0x441d('0x2c')]);_0x50661e['attributes']=_['intersection'](_0x4463ce[_0x441d('0x2f')],qs[_0x441d('0x34')](_0x4a022d[_0x441d('0x30')][_0x441d('0x34')]));_0x50661e[_0x441d('0x33')]=_0x50661e[_0x441d('0x33')][_0x441d('0x35')]?_0x50661e[_0x441d('0x33')]:_0x4463ce[_0x441d('0x2f')];if(_0x4a022d['query'][_0x441d('0x45')]){_0x50661e[_0x441d('0x3e')]=[{'all':!![]}];}_0x50661e=_[_0x441d('0x3c')]({},_0x50661e,_0x4a022d[_0x441d('0x3d')]);return db[_0x441d('0x2b')][_0x441d('0x46')](_0x50661e)[_0x441d('0x24')](handleEntityNotFound(_0x74cd8f,null))[_0x441d('0x24')](function(_0x2dcef5){if(_0x2dcef5){var _0x26d759=_0x2dcef5[_0x441d('0x48')]({'plain':!![]});_0x26d759=qs[_0x441d('0x49')](_0x26d759,['id','createdAt',_0x441d('0x4a')]);_0x4a022d['body']=_[_0x441d('0x49')](_0x4a022d['body'],['id',_0x441d('0x4b'),'updatedAt']);return db[_0x441d('0x2b')]['create'](_[_0x441d('0x3c')](_0x26d759,_0x4a022d[_0x441d('0x4c')]),{'include':_0x4a022d[_0x441d('0x30')][_0x441d('0x45')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x74cd8f,0xc9))[_0x441d('0x41')](handleError(_0x74cd8f,null));};exports[_0x441d('0x4d')]=function(_0x383886,_0x47de2a){if(_0x383886['body']['id']){delete _0x383886[_0x441d('0x4c')]['id'];}return db[_0x441d('0x2b')][_0x441d('0x46')]({'where':{'id':_0x383886[_0x441d('0x43')]['id']}})[_0x441d('0x24')](handleEntityNotFound(_0x47de2a,null))[_0x441d('0x24')](saveUpdates(_0x383886[_0x441d('0x4c')],null))[_0x441d('0x24')](respondWithResult(_0x47de2a,null))[_0x441d('0x41')](handleError(_0x47de2a,null));};exports[_0x441d('0x23')]=function(_0x2a3f65,_0x257b22){return db[_0x441d('0x2b')][_0x441d('0x46')]({'where':{'id':_0x2a3f65[_0x441d('0x43')]['id']}})[_0x441d('0x24')](handleEntityNotFound(_0x257b22,null))[_0x441d('0x24')](removeEntity(_0x257b22,null))[_0x441d('0x41')](handleError(_0x257b22,null));};exports[_0x441d('0x4e')]=function(_0x5f59c2,_0x89aa99,_0x1eee33){_0x5f59c2[_0x441d('0x4c')]['name']=_0x5f59c2[_0x441d('0x4f')][_0x441d('0x50')];_0x5f59c2['body'][_0x441d('0x51')]=_0x5f59c2['file'][_0x441d('0x52')];_0x5f59c2[_0x441d('0x4c')][_0x441d('0x2d')]=_0x5f59c2[_0x441d('0x4f')][_0x441d('0x53')];return db[_0x441d('0x2b')]['create'](_0x5f59c2[_0x441d('0x4c')])['then'](respondWithResult(_0x89aa99,0xc9))[_0x441d('0x41')](handleError(_0x89aa99,null));};exports[_0x441d('0x54')]=function(_0xfc85b8,_0x2f3d46,_0x9a10dc){return db[_0x441d('0x2b')][_0x441d('0x55')]({'where':{'id':_0xfc85b8['params']['id']},'raw':!![]})[_0x441d('0x24')](handleEntityNotFound(_0x2f3d46,null))[_0x441d('0x24')](function(_0x3b681d){if(_0x3b681d){var _0x353e56=_0x3b681d[_0x441d('0x56')]!==null;var _0x536316=path['join'](config['root'],_0x441d('0x57'));if(_0x353e56){_0x536316=path['join'](_0x536316,'offline-chat/');}var _0x12a6d8=path[_0x441d('0x58')](_0x536316,_0x3b681d[_0x441d('0x51')]);return _0x2f3d46['download'](_0x12a6d8);}})[_0x441d('0x41')](handleError(_0x2f3d46,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 35a61a4..22e37f8 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 _0xaa53=['moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','util','../../config/logger','api'];(function(_0xa651d4,_0x5df6cb){var _0x1301be=function(_0x5aa409){while(--_0x5aa409){_0xa651d4['push'](_0xa651d4['shift']());}};_0x1301be(++_0x5df6cb);}(_0xaa53,0xc0));var _0x3aa5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xaa53[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x3aa5('0x0'));var logger=require(_0x3aa5('0x1'))(_0x3aa5('0x2'));var moment=require(_0x3aa5('0x3'));var BPromise=require(_0x3aa5('0x4'));var rp=require(_0x3aa5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3aa5('0x6'));var config=require(_0x3aa5('0x7'));var attributes=require(_0x3aa5('0x8'));module[_0x3aa5('0x9')]=function(_0x4394ab,_0x54e9f9){return _0x4394ab[_0x3aa5('0xa')](_0x3aa5('0xb'),attributes,{'tableName':_0x3aa5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x014e=['Attachment','attachments','lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x43868e,_0x49d3ae){var _0x51819c=function(_0x57a760){while(--_0x57a760){_0x43868e['push'](_0x43868e['shift']());}};_0x51819c(++_0x49d3ae);}(_0x014e,0x16a));var _0xe014=function(_0x5c3d4f,_0x37e4b7){_0x5c3d4f=_0x5c3d4f-0x0;var _0x2b7eba=_0x014e[_0x5c3d4f];return _0x2b7eba;};'use strict';var _=require(_0xe014('0x0'));var util=require('util');var logger=require(_0xe014('0x1'))(_0xe014('0x2'));var moment=require('moment');var BPromise=require(_0xe014('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe014('0x4'));var config=require(_0xe014('0x5'));var attributes=require(_0xe014('0x6'));module[_0xe014('0x7')]=function(_0x56bde6,_0x49dc86){return _0x56bde6['define'](_0xe014('0x8'),attributes,{'tableName':_0xe014('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 77b0847..dd000f3 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 _0x21a3=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Attachment','create','body','options','raw','CreateAttachment','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21a3,0x66));var _0x321a=function(_0x1e73fc,_0x533750){_0x1e73fc=_0x1e73fc-0x0;var _0xeceac4=_0x21a3[_0x1e73fc];return _0xeceac4;};'use strict';var _=require(_0x321a('0x0'));var util=require('util');var moment=require(_0x321a('0x1'));var BPromise=require(_0x321a('0x2'));var rs=require(_0x321a('0x3'));var fs=require('fs');var Redis=require(_0x321a('0x4'));var db=require(_0x321a('0x5'))['db'];var utils=require(_0x321a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x321a('0x7'));var jayson=require(_0x321a('0x8'));var client=jayson[_0x321a('0x9')][_0x321a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f3b81,_0x388901,_0x24a04c){return new BPromise(function(_0x10c1d3,_0xdfd6b8){return client[_0x321a('0xb')](_0x5f3b81,_0x24a04c)[_0x321a('0xc')](function(_0x2c52dc){logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,_0x321a('0xf'));logger[_0x321a('0x10')](_0x321a('0x11'),_0x388901,'request\x20sent',JSON[_0x321a('0x12')](_0x2c52dc));if(_0x2c52dc[_0x321a('0x13')]){if(_0x2c52dc['error']['code']===0x1f4){logger[_0x321a('0x13')]('Attachment,\x20%s,\x20%s',_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0xdfd6b8(_0x2c52dc['error']['message']);}logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0x10c1d3(_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);}else{logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,'request\x20sent');_0x10c1d3(_0x2c52dc[_0x321a('0x15')][_0x321a('0x14')]);}})['catch'](function(_0x45ceb2){logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x45ceb2);_0xdfd6b8(_0x45ceb2);});});}exports['CreateAttachment']=function(_0x5b1810){var _0x464bd7=this;return new Promise(function(_0x35fd6f,_0x58595b){return db[_0x321a('0x16')][_0x321a('0x17')](_0x5b1810[_0x321a('0x18')],{'raw':_0x5b1810['options']?_0x5b1810[_0x321a('0x19')][_0x321a('0x1a')]===undefined?!![]:![]:!![]})[_0x321a('0xc')](function(_0x423cb8){logger[_0x321a('0xd')](_0x321a('0x1b'),_0x5b1810);logger[_0x321a('0x10')](_0x321a('0x1b'),_0x5b1810,JSON[_0x321a('0x12')](_0x423cb8));_0x35fd6f(_0x423cb8);})[_0x321a('0x1c')](function(_0x1b94a1){logger[_0x321a('0x13')]('CreateAttachment',_0x1b94a1[_0x321a('0x14')],_0x5b1810);_0x58595b(_0x464bd7[_0x321a('0x13')](0x1f4,_0x1b94a1[_0x321a('0x14')]));});});}; \ No newline at end of file +var _0xd64b=['http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','body','options','then','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3d8ed9,_0x5f0302){var _0x3ae843=function(_0x3d3314){while(--_0x3d3314){_0x3d8ed9['push'](_0x3d8ed9['shift']());}};_0x3ae843(++_0x5f0302);}(_0xd64b,0xc1));var _0xbd64=function(_0x125b80,_0x41db3b){_0x125b80=_0x125b80-0x0;var _0x414ba8=_0xd64b[_0x125b80];return _0x414ba8;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32995f,_0x3e700e,_0x38204e){return new BPromise(function(_0x3f1f17,_0x2b8543){return client[_0xbd64('0x8')](_0x32995f,_0x38204e)['then'](function(_0x5ae70c){logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));logger['debug'](_0xbd64('0xc'),_0x3e700e,_0xbd64('0xb'),JSON[_0xbd64('0xd')](_0x5ae70c));if(_0x5ae70c[_0xbd64('0xe')]){if(_0x5ae70c['error'][_0xbd64('0xf')]===0x1f4){logger['error'](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x2b8543(_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);}logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x3f1f17(_0x5ae70c['error'][_0xbd64('0x10')]);}else{logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));_0x3f1f17(_0x5ae70c[_0xbd64('0x11')]['message']);}})[_0xbd64('0x12')](function(_0x5332e0){logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5332e0);_0x2b8543(_0x5332e0);});});}exports[_0xbd64('0x13')]=function(_0x1d7a14){var _0x17d015=this;return new Promise(function(_0x2f4554,_0xa5491d){return db[_0xbd64('0x14')]['create'](_0x1d7a14[_0xbd64('0x15')],{'raw':_0x1d7a14[_0xbd64('0x16')]?_0x1d7a14['options']['raw']===undefined?!![]:![]:!![]})[_0xbd64('0x17')](function(_0x42b328){logger[_0xbd64('0x9')](_0xbd64('0x13'),_0x1d7a14);logger[_0xbd64('0x18')](_0xbd64('0x13'),_0x1d7a14,JSON['stringify'](_0x42b328));_0x2f4554(_0x42b328);})['catch'](function(_0x6038f){logger[_0xbd64('0xe')](_0xbd64('0x13'),_0x6038f[_0xbd64('0x10')],_0x1d7a14);_0xa5491d(_0x17d015['error'](0x1f4,_0x6038f['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 0c9bfbd..d27c7fa 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x5aea10,_0x16e043){var _0x2886bb=function(_0x3eb0d0){while(--_0x3eb0d0){_0x5aea10['push'](_0x5aea10['shift']());}};_0x2886bb(++_0x16e043);}(_0x757a,0xde));var _0xa757=function(_0x2fc068,_0x2c72d3){_0x2fc068=_0x2fc068-0x0;var _0x5e890c=_0x757a[_0x2fc068];return _0x5e890c;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 0422544..c094540 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60a1=['bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','user','agent','disabled','add','minutes','getLicense','catch','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','Strategy','activedirectory2'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x60a1,0xb9));var _0x160a=function(_0x35ecfb,_0x4fc054){_0x35ecfb=_0x35ecfb-0x0;var _0x303599=_0x60a1[_0x35ecfb];return _0x303599;};'use strict';var passport=require(_0x160a('0x0'));var LocalStrategy=require('passport-local')[_0x160a('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x160a('0x2'));var BPromise=require(_0x160a('0x3'));var util=require('util');var db=require(_0x160a('0x4'))['db'];var authService=require(_0x160a('0x5'));var utils=require(_0x160a('0x6'));var config=require(_0x160a('0x7'));var logger=require(_0x160a('0x8'))(_0x160a('0x9'));function isActiveDirectoryConfigured(_0x5ac356){var _0x5291fb=![];if(typeof _0x5ac356[_0x160a('0xa')]!==_0x160a('0xb')){_0x5291fb=_0x5ac356[_0x160a('0xa')][_0x160a('0xc')]&&_0x5ac356[_0x160a('0xa')][_0x160a('0xd')]&&_0x5ac356[_0x160a('0xa')][_0x160a('0xe')];}return _0x5291fb;}function adAuthenticate(_0x302d24,_0x350229,_0x5191e8){return new BPromise(function(_0xa9e494,_0x245c7b){try{var _0x4b121d=new ActiveDirectory(_0x302d24);_0x4b121d['authenticate'](_0x350229,_0x5191e8,function(_0x15044b,_0x21b1a8){if(_0x15044b){logger['error'](_0x160a('0xf'),_0x350229,util[_0x160a('0x10')](_0x15044b,{'showHidden':![],'depth':null}));_0x245c7b(_0x160a('0x11'));}else if(!_0x21b1a8){logger[_0x160a('0x12')](_0x160a('0x13'),_0x350229);_0x245c7b(_0x160a('0x11'));}else{_0xa9e494(_0x21b1a8);}});}catch(_0x2609ed){_0x245c7b(_0x2609ed);}});}function ActiveDirectoryAuthenticate(_0x17c378,_0x577afe,_0x194b2b,_0x5a5988){var _0x4e9585,_0x237659;if(!isActiveDirectoryConfigured(config)){logger[_0x160a('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x577afe);return _0x5a5988(null,![],{'message':_0x160a('0x11')});}return db[_0x160a('0x14')][_0x160a('0x15')]({'where':{'id':0x1},'attributes':[_0x160a('0x16'),_0x160a('0x17')],'raw':!![]})[_0x160a('0x18')](function(_0x14b713){_0x4e9585=_0x14b713;if(!_0x4e9585[_0x160a('0x16')]){logger['error'](_0x160a('0x19'),_0x577afe);throw new Error(_0x160a('0x11'));}return _0x17c378[_0x160a('0x15')]({'logging':!![],'attributes':['id',_0x160a('0x1a'),_0x160a('0x1b'),_0x160a('0x1c'),_0x160a('0x1d'),'disabled',_0x160a('0x1e'),_0x160a('0x1f'),'online'],'where':{'name':_0x577afe,'role':{'$or':['admin',_0x160a('0x20'),_0x160a('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x2512ae){if(!_0x2512ae||_0x2512ae&&_0x2512ae[_0x160a('0x1a')]!==_0x577afe){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x237659=_0x2512ae;var _0x5038e8=_0x237659[_0x160a('0x1a')]+'@'+config[_0x160a('0xa')]['domain'];return adAuthenticate(config[_0x160a('0xa')],_0x5038e8,_0x194b2b);})[_0x160a('0x18')](function(_0x1f5c9a){if(_0x237659[_0x160a('0x22')]){throw new Error(_0x160a('0x11'));}if(_0x4e9585[_0x160a('0x17')]>0x0){if(_0x237659[_0x160a('0x1e')]){if(moment(_0x237659[_0x160a('0x1f')])[_0x160a('0x23')](_0x4e9585['blockDuration'],_0x160a('0x24'))>moment()){throw new Error(_0x160a('0x11'));}return utils['clearBlockUser'](_0x237659,0x0,![],null)[_0x160a('0x18')](function(){return utils[_0x160a('0x25')](_0x237659);})[_0x160a('0x18')](function(){return _0x5a5988(null,_0x237659);});}else{return utils[_0x160a('0x25')](_0x237659)['then'](function(){return _0x5a5988(null,_0x237659);});}}else{return utils[_0x160a('0x25')](_0x237659)[_0x160a('0x18')](function(){return _0x5a5988(null,_0x237659);});}})[_0x160a('0x26')](function(_0x4648ad){return _0x5a5988(null,![],_0x4648ad);});}function handleError(_0x4a2af9,_0x5aa34a,_0x1a8938){return _0x4a2af9['status'](_0x5aa34a||0x1f4)['send']({'message':_0x1a8938?_0x1a8938[_0x160a('0x27')]||_0x1a8938:''});}exports[_0x160a('0x28')]=function(_0x32b5d5,_0x2738ba,_0x52b7a1){passport['authenticate'](_0x160a('0x29'),function(_0x332dd5,_0x14cafc,_0x5845f2){var _0x4ec84e=_0x332dd5||_0x5845f2;if(_0x4ec84e){return handleError(_0x2738ba,0x191,_0x4ec84e);}if(!_0x14cafc){return handleError(_0x2738ba,0x194,{'message':_0x160a('0x2a')});}else{var _0x58012d={'payload':{'id':_0x14cafc['id'],'role':_0x14cafc[_0x160a('0x1d')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x58012d)[_0x160a('0x18')](function(_0xa84ec0){_0x2738ba[_0x160a('0x2b')]({'id':_0x14cafc['id'],'token':_0xa84ec0,'statusCall':'','isAlreadyLogged':_0x14cafc[_0x160a('0x2c')]});});}})(_0x32b5d5,_0x2738ba,_0x52b7a1);};passport[_0x160a('0x2d')](_0x160a('0x29'),new LocalStrategy({'usernameField':'name','passwordField':_0x160a('0x1b')},function(_0x5ad62c,_0x41de2e,_0x4d4817){return ActiveDirectoryAuthenticate(db[_0x160a('0x2e')],_0x5ad62c,_0x41de2e,_0x4d4817);})); \ No newline at end of file +var _0x65fc=['Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','role','disabled','blocked','online','user','agent','blockDuration','add','minutes','clearBlockUser','getLicense','status','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','domain'];(function(_0x435fa1,_0x58550a){var _0x845f9f=function(_0x89867e){while(--_0x89867e){_0x435fa1['push'](_0x435fa1['shift']());}};_0x845f9f(++_0x58550a);}(_0x65fc,0x85));var _0xc65f=function(_0x5bfc0f,_0x367beb){_0x5bfc0f=_0x5bfc0f-0x0;var _0x2e640d=_0x65fc[_0x5bfc0f];return _0x2e640d;};'use strict';var passport=require(_0xc65f('0x0'));var LocalStrategy=require(_0xc65f('0x1'))[_0xc65f('0x2')];var moment=require(_0xc65f('0x3'));var ActiveDirectory=require(_0xc65f('0x4'));var BPromise=require('bluebird');var util=require(_0xc65f('0x5'));var db=require(_0xc65f('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require(_0xc65f('0x7'));var logger=require(_0xc65f('0x8'))('api');function isActiveDirectoryConfigured(_0x3e2520){var _0x16ab55=![];if(typeof _0x3e2520[_0xc65f('0x9')]!==_0xc65f('0xa')){_0x16ab55=_0x3e2520[_0xc65f('0x9')][_0xc65f('0xb')]&&_0x3e2520[_0xc65f('0x9')][_0xc65f('0xc')]&&_0x3e2520[_0xc65f('0x9')][_0xc65f('0xd')];}return _0x16ab55;}function adAuthenticate(_0x55f619,_0x135b0c,_0x7aad2c){return new BPromise(function(_0x2093f0,_0x3d01e9){try{var _0x19ccbe=new ActiveDirectory(_0x55f619);_0x19ccbe['authenticate'](_0x135b0c,_0x7aad2c,function(_0x445827,_0x22413b){if(_0x445827){logger['error'](_0xc65f('0xe'),_0x135b0c,util[_0xc65f('0xf')](_0x445827,{'showHidden':![],'depth':null}));_0x3d01e9(_0xc65f('0x10'));}else if(!_0x22413b){logger[_0xc65f('0x11')](_0xc65f('0x12'),_0x135b0c);_0x3d01e9(_0xc65f('0x10'));}else{_0x2093f0(_0x22413b);}});}catch(_0x412ba1){_0x3d01e9(_0x412ba1);}});}function ActiveDirectoryAuthenticate(_0x207f18,_0xbfa945,_0x4bc17b,_0x125e99){var _0x11e709,_0x99d944;if(!isActiveDirectoryConfigured(config)){logger[_0xc65f('0x11')](_0xc65f('0x13'),_0xbfa945);return _0x125e99(null,![],{'message':_0xc65f('0x10')});}return db[_0xc65f('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0xc65f('0x15'),'blockDuration'],'raw':!![]})[_0xc65f('0x16')](function(_0x15700b){_0x11e709=_0x15700b;if(!_0x11e709[_0xc65f('0x15')]){logger['error'](_0xc65f('0x17'),_0xbfa945);throw new Error(_0xc65f('0x10'));}return _0x207f18[_0xc65f('0x18')]({'logging':!![],'attributes':['id',_0xc65f('0x19'),_0xc65f('0x1a'),'salt',_0xc65f('0x1b'),_0xc65f('0x1c'),_0xc65f('0x1d'),'blockedAt',_0xc65f('0x1e')],'where':{'name':_0xbfa945,'role':{'$or':['admin',_0xc65f('0x1f'),_0xc65f('0x20')]},'adSsoEnabled':!![]}});})[_0xc65f('0x16')](function(_0x2822a5){if(!_0x2822a5||_0x2822a5&&_0x2822a5[_0xc65f('0x19')]!==_0xbfa945){throw new Error(_0xc65f('0x10'));}_0x99d944=_0x2822a5;var _0x1910bd=_0x99d944[_0xc65f('0x19')]+'@'+config[_0xc65f('0x9')][_0xc65f('0xd')];return adAuthenticate(config[_0xc65f('0x9')],_0x1910bd,_0x4bc17b);})[_0xc65f('0x16')](function(_0x146476){if(_0x99d944[_0xc65f('0x1c')]){throw new Error(_0xc65f('0x10'));}if(_0x11e709[_0xc65f('0x21')]>0x0){if(_0x99d944[_0xc65f('0x1d')]){if(moment(_0x99d944['blockedAt'])[_0xc65f('0x22')](_0x11e709[_0xc65f('0x21')],_0xc65f('0x23'))>moment()){throw new Error(_0xc65f('0x10'));}return utils[_0xc65f('0x24')](_0x99d944,0x0,![],null)['then'](function(){return utils[_0xc65f('0x25')](_0x99d944);})[_0xc65f('0x16')](function(){return _0x125e99(null,_0x99d944);});}else{return utils[_0xc65f('0x25')](_0x99d944)[_0xc65f('0x16')](function(){return _0x125e99(null,_0x99d944);});}}else{return utils[_0xc65f('0x25')](_0x99d944)['then'](function(){return _0x125e99(null,_0x99d944);});}})['catch'](function(_0x258a4a){return _0x125e99(null,![],_0x258a4a);});}function handleError(_0x1290a2,_0x1b3e4f,_0x1b4e4c){return _0x1290a2[_0xc65f('0x26')](_0x1b3e4f||0x1f4)[_0xc65f('0x27')]({'message':_0x1b4e4c?_0x1b4e4c[_0xc65f('0x28')]||_0x1b4e4c:''});}exports[_0xc65f('0x29')]=function(_0x321bc1,_0x14cddd,_0x631c61){passport[_0xc65f('0x2a')](_0xc65f('0x2b'),function(_0x22e158,_0x52eb1c,_0x226a5e){var _0x443936=_0x22e158||_0x226a5e;if(_0x443936){return handleError(_0x14cddd,0x191,_0x443936);}if(!_0x52eb1c){return handleError(_0x14cddd,0x194,{'message':_0xc65f('0x2c')});}else{var _0x7b3db2={'payload':{'id':_0x52eb1c['id'],'role':_0x52eb1c[_0xc65f('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0xc65f('0x2d')](_0x7b3db2)[_0xc65f('0x16')](function(_0x67d193){_0x14cddd[_0xc65f('0x2e')]({'id':_0x52eb1c['id'],'token':_0x67d193,'statusCall':'','isAlreadyLogged':_0x52eb1c[_0xc65f('0x1e')]});});}})(_0x321bc1,_0x14cddd,_0x631c61);};passport[_0xc65f('0x2f')](_0xc65f('0x2b'),new LocalStrategy({'usernameField':_0xc65f('0x19'),'passwordField':'password'},function(_0x2dbe7e,_0x19247b,_0x490caf){return ActiveDirectoryAuthenticate(db[_0xc65f('0x30')],_0x2dbe7e,_0x19247b,_0x490caf);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index d4b874b..2d5228b 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b6f=['express','Router','./authActiveDirectory.controller','post','exports'];(function(_0xff27d9,_0xd9cce){var _0x375453=function(_0x54e5d0){while(--_0x54e5d0){_0xff27d9['push'](_0xff27d9['shift']());}};_0x375453(++_0xd9cce);}(_0x9b6f,0xcd));var _0xf9b6=function(_0x3ca3bd,_0xfaea6e){_0x3ca3bd=_0x3ca3bd-0x0;var _0x36f896=_0x9b6f[_0x3ca3bd];return _0x36f896;};'use strict';var express=require(_0xf9b6('0x0'));var router=express[_0xf9b6('0x1')]();var controller=require(_0xf9b6('0x2'));router[_0xf9b6('0x3')]('/',controller['login']);module[_0xf9b6('0x4')]=router; \ No newline at end of file +var _0x8b77=['Router','./authActiveDirectory.controller','login','exports'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0x8b77,0x180));var _0x78b7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8b77[_0x5b644e];return _0x49c6bf;};'use strict';var express=require('express');var router=express[_0x78b7('0x0')]();var controller=require(_0x78b7('0x1'));router['post']('/',controller[_0x78b7('0x2')]);module[_0x78b7('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 897d4c1..4ffdfae 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x7a54,0x106));var _0x47a5=function(_0x217320,_0x2dfb07){_0x217320=_0x217320-0x0;var _0x50c1bb=_0x7a54[_0x217320];return _0x50c1bb;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x3cee05,_0x2f2386){var _0x2d7412=function(_0x4c4f0c){while(--_0x4c4f0c){_0x3cee05['push'](_0x3cee05['shift']());}};_0x2d7412(++_0x2f2386);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 3942732..adad773 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 _0xa404=['get','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','../user/user.controller.js','login'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xa404,0x159));var _0x4a40=function(_0x196d84,_0x4acd97){_0x196d84=_0x196d84-0x0;var _0x28e207=_0xa404[_0x196d84];return _0x28e207;};'use strict';var express=require(_0x4a40('0x0'));var passport=require(_0x4a40('0x1'));var router=express[_0x4a40('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x4a40('0x3'));var authService=require('../../components/auth/service');router['get']('/',controller[_0x4a40('0x4')]);router[_0x4a40('0x5')]('/callback',controller[_0x4a40('0x6')],authService[_0x4a40('0x7')],userController[_0x4a40('0x4')],authService[_0x4a40('0x8')]);module[_0x4a40('0x9')]=router; \ No newline at end of file +var _0xd33e=['Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','express'];(function(_0x1f0f2a,_0x14f11a){var _0x145cd9=function(_0x5768b5){while(--_0x5768b5){_0x1f0f2a['push'](_0x1f0f2a['shift']());}};_0x145cd9(++_0x14f11a);}(_0xd33e,0x1b7));var _0xed33=function(_0x204ad4,_0x502841){_0x204ad4=_0x204ad4-0x0;var _0x50675f=_0xd33e[_0x204ad4];return _0x50675f;};'use strict';var express=require(_0xed33('0x0'));var passport=require('passport');var router=express[_0xed33('0x1')]();var controller=require(_0xed33('0x2'));var userController=require(_0xed33('0x3'));var authService=require(_0xed33('0x4'));router[_0xed33('0x5')]('/',controller[_0xed33('0x6')]);router[_0xed33('0x5')](_0xed33('0x7'),controller[_0xed33('0x8')],authService[_0xed33('0x9')],userController[_0xed33('0x6')],authService[_0xed33('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 3d5d2c3..25ecb3d 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 _0xf527=['json','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','catch','reset','params','token','now','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','blockDuration','add','clearBlockUser','minutes','getLicense','MailAccount','find','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','\x22%s\x22\x20<%s>','email','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.'];(function(_0x4d91d7,_0x296f97){var _0x42552e=function(_0x170abe){while(--_0x170abe){_0x4d91d7['push'](_0x4d91d7['shift']());}};_0x42552e(++_0x296f97);}(_0xf527,0x16e));var _0x7f52=function(_0x5e5d04,_0x1cafb2){_0x5e5d04=_0x5e5d04-0x0;var _0x5dfb76=_0xf527[_0x5e5d04];return _0x5dfb76;};'use strict';var util=require(_0x7f52('0x0'));var passport=require(_0x7f52('0x1'));var LocalStrategy=require(_0x7f52('0x2'))['Strategy'];var jayson=require(_0x7f52('0x3'));var _=require('lodash');var rs=require(_0x7f52('0x4'));var moment=require('moment');var db=require(_0x7f52('0x5'))['db'];var authService=require(_0x7f52('0x6'));var utils=require(_0x7f52('0x7'));var client=jayson['client'][_0x7f52('0x8')]({'port':0x232b});function localAuthenticate(_0x3e6468,_0x403009,_0x234283,_0x409d29){var _0x4f8e5f,_0x1aafdc;return db[_0x7f52('0x9')][_0x7f52('0xa')]({'where':{'id':0x1},'attributes':[_0x7f52('0xb'),'blockDuration'],'raw':!![]})['then'](function(_0x216438){_0x4f8e5f=_0x216438;return _0x3e6468[_0x7f52('0xa')]({'attributes':['id','name',_0x7f52('0xc'),_0x7f52('0xd'),_0x7f52('0xe'),_0x7f52('0xf'),_0x7f52('0x10'),_0x7f52('0x11'),_0x7f52('0x12')],'where':{'name':_0x403009,'role':{'$or':[_0x7f52('0x13'),_0x7f52('0x14'),'agent']}}});})['then'](function(_0x2937d9){if(!_0x2937d9||_0x2937d9&&_0x2937d9[_0x7f52('0x15')]!==_0x403009){throw new Error(_0x7f52('0x16'));}else{_0x1aafdc=_0x2937d9;return _0x1aafdc;}})[_0x7f52('0x17')](function(){_0x1aafdc['authenticate'](_0x234283,function(_0x58d408,_0x7f68b8){var _0x43212c=_0x1aafdc[_0x7f52('0x12')]+0x1;if(_0x58d408){return _0x409d29(_0x58d408);}else if(!_0x7f68b8){if(_0x1aafdc['disabled']){return _0x409d29(null,![],{'message':_0x7f52('0x16')});}else if(_0x4f8e5f[_0x7f52('0xb')]>0x0){if(_0x1aafdc[_0x7f52('0x10')]){if(_0x4f8e5f[_0x7f52('0x18')]>0x0){if(moment(_0x1aafdc[_0x7f52('0x11')])[_0x7f52('0x19')](_0x4f8e5f[_0x7f52('0x18')],'minutes')>moment()){return _0x409d29(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x7f52('0x1a')](_0x1aafdc,_0x43212c,![],null)['then'](function(){return _0x409d29(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x409d29(null,![],{'message':_0x7f52('0x16')});}}else{if(_0x43212c>=_0x4f8e5f[_0x7f52('0xb')]){return utils[_0x7f52('0x1a')](_0x1aafdc,0x0,!![],moment())[_0x7f52('0x17')](function(){return _0x409d29(null,![],{'message':_0x7f52('0x16')});});}else{return utils[_0x7f52('0x1a')](_0x1aafdc,_0x43212c,![],null)[_0x7f52('0x17')](function(){return _0x409d29(null,![],{'message':_0x7f52('0x16')});});}}}else{return _0x409d29(null,![],{'message':_0x7f52('0x16')});}}else{if(_0x1aafdc[_0x7f52('0xf')]){return _0x409d29(null,![],{'message':_0x7f52('0x16')});}else if(_0x4f8e5f['allowedLoginAttempts']>0x0){if(_0x1aafdc[_0x7f52('0x10')]){if(_0x4f8e5f['blockDuration']>0x0){if(moment(_0x1aafdc[_0x7f52('0x11')])[_0x7f52('0x19')](_0x4f8e5f['blockDuration'],_0x7f52('0x1b'))>moment()){return _0x409d29(null,![],{'message':_0x7f52('0x16')});}else{return utils[_0x7f52('0x1a')](_0x1aafdc,0x0,![],null)[_0x7f52('0x17')](function(){return utils['getLicense'](_0x1aafdc);})[_0x7f52('0x17')](function(){return _0x409d29(null,_0x1aafdc);});}}else{return _0x409d29(null,![],{'message':_0x7f52('0x16')});}}else{return utils[_0x7f52('0x1a')](_0x1aafdc,0x0,![],null)[_0x7f52('0x17')](function(){return utils[_0x7f52('0x1c')](_0x1aafdc);})[_0x7f52('0x17')](function(){return _0x409d29(null,_0x1aafdc);})['catch'](function(_0x38c146){return _0x409d29(null,![],_0x38c146);});}}else{if(_0x1aafdc[_0x7f52('0x10')]){return _0x409d29(null,![],{'message':_0x7f52('0x16')});}else{return utils[_0x7f52('0x1c')](_0x1aafdc)['then'](function(){return _0x409d29(null,_0x1aafdc);});}}}});})['catch'](function(_0xb4e9ac){return _0x409d29(null,![],_0xb4e9ac);});}function sendServiceMail(_0x707fbf){return db[_0x7f52('0x1d')][_0x7f52('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x7f52('0x15'),'email'],'include':[{'model':db[_0x7f52('0x1f')],'as':_0x7f52('0x20'),'include':[{'model':db[_0x7f52('0x21')],'as':_0x7f52('0x21')}]}]})[_0x7f52('0x17')](function(_0x839b18){if(!_0x839b18){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4a6862=_0x839b18[_0x7f52('0x22')]();var _0x5d233c={'account':_0x4a6862,'message':_[_0x7f52('0x23')]({'from':util['format'](_0x7f52('0x24'),_0x839b18[_0x7f52('0x15')],_0x839b18[_0x7f52('0x25')]||_0x839b18[_0x7f52('0x20')][_0x7f52('0x14')])},_0x707fbf)};return client[_0x7f52('0x26')](_0x7f52('0x27'),_0x5d233c);})[_0x7f52('0x17')](function(_0x5b67a1){if(_0x5b67a1[_0x7f52('0x28')]){throw new Error(util[_0x7f52('0x29')](_0x7f52('0x2a'),_0x5b67a1[_0x7f52('0x28')]['message']||JSON[_0x7f52('0x2b')](_0x5b67a1[_0x7f52('0x28')])));}return!![];});}function handleError(_0x7500ca,_0x2621f4,_0x32883f){return _0x7500ca['status'](_0x2621f4||0x1f4)[_0x7f52('0x2c')]({'message':_0x32883f?_0x32883f[_0x7f52('0x2d')]||_0x32883f:''});}exports[_0x7f52('0x2e')]=function(_0x55f004,_0x13330f,_0x533234){passport['authenticate'](_0x7f52('0x2f'),function(_0x596dcd,_0x3c3e11,_0x426ed5){var _0x4b2f2b=_0x596dcd||_0x426ed5;if(_0x4b2f2b){return handleError(_0x13330f,0x191,_0x4b2f2b);}if(!_0x3c3e11){return handleError(_0x13330f,0x194,{'message':_0x7f52('0x30')});}else{var _0x3435cb={'payload':{'id':_0x3c3e11['id'],'role':_0x3c3e11[_0x7f52('0xe')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3435cb)[_0x7f52('0x17')](function(_0x9d535f){_0x13330f[_0x7f52('0x31')]({'id':_0x3c3e11['id'],'token':_0x9d535f,'statusCall':'','isAlreadyLogged':_0x3c3e11['online']});});}})(_0x55f004,_0x13330f,_0x533234);};exports[_0x7f52('0x32')]=function(_0x49c76f,_0x4d4430){if(!_0x49c76f['body']['email']){return handleError(_0x4d4430,0x1f4,{'message':_0x7f52('0x33')});}var _0x18e398=rs[_0x7f52('0x34')]();_0x49c76f[_0x7f52('0x35')][_0x7f52('0x25')]=_0x49c76f['body'][_0x7f52('0x25')][_0x7f52('0x36')]()[_0x7f52('0x37')]();var _0x7a3ec0;return db[_0x7f52('0x9')][_0x7f52('0xa')]({'where':{'id':0x1},'attributes':[_0x7f52('0xb'),_0x7f52('0x18')],'raw':!![]})['then'](function(_0x4520a9){_0x7a3ec0=_0x4520a9;return db[_0x7f52('0x38')]['find']({'where':{'email':_0x49c76f[_0x7f52('0x35')]['email']}});})[_0x7f52('0x17')](function(_0x1b9911){if(!_0x1b9911){throw new Error(_0x7f52('0x39'));}if(_0x1b9911['disabled']){throw new Error(_0x7f52('0x3a'));}if(_0x1b9911[_0x7f52('0x10')]){if(moment(_0x1b9911[_0x7f52('0x11')])[_0x7f52('0x19')](_0x7a3ec0[_0x7f52('0x18')],_0x7f52('0x1b'))>moment()){throw new Error(_0x7f52('0x3b'));}else{_0x1b9911[_0x7f52('0x10')]=![];_0x1b9911['blockedAt']=null;}}_0x1b9911[_0x7f52('0x3c')]=_0x18e398;_0x1b9911[_0x7f52('0x3d')]=Date['now']()+0x36ee80;return _0x1b9911[_0x7f52('0x3e')]();})[_0x7f52('0x17')](function(){return sendServiceMail({'to':_0x49c76f[_0x7f52('0x35')][_0x7f52('0x25')],'subject':_0x7f52('0x3f'),'text':_0x7f52('0x40')+_0x7f52('0x41')+_0x7f52('0x42')+_0x49c76f['headers'][_0x7f52('0x43')]+_0x7f52('0x44')+_0x18e398+'\x0a\x0a'+_0x7f52('0x45')});})[_0x7f52('0x17')](function(){_0x4d4430['status'](0xc8)[_0x7f52('0x2c')]({'message':'Reset\x20Email\x20sent!'});})[_0x7f52('0x46')](function(_0x52b226){return handleError(_0x4d4430,0x1f4,_0x52b226);});};exports[_0x7f52('0x47')]=function(_0x55ba74,_0x104b83){return db[_0x7f52('0x38')][_0x7f52('0x1e')]({'where':{'resetPasswordToken':_0x55ba74[_0x7f52('0x48')][_0x7f52('0x49')],'resetPasswordExpires':{'$gt':Date[_0x7f52('0x4a')]()}}})[_0x7f52('0x17')](function(_0x3f2f62){if(!_0x3f2f62){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x7f52('0x9')][_0x7f52('0xa')]({'attributes':['id',_0x7f52('0x4b'),'enforcePasswordHistory',_0x7f52('0x4c')]})['then'](function(_0x4c68de){if(_0x4c68de[_0x7f52('0x4b')])authService[_0x7f52('0x4d')](_0x55ba74[_0x7f52('0x35')][_0x7f52('0xc')]);if(!_0x4c68de[_0x7f52('0x4e')]||!_0x3f2f62[_0x7f52('0x4f')])return _0x3f2f62;authService[_0x7f52('0x50')](_0x55ba74[_0x7f52('0x35')][_0x7f52('0xc')],_0x3f2f62[_0x7f52('0x4f')],_0x4c68de[_0x7f52('0x4c')]);return _0x3f2f62;})[_0x7f52('0x17')](function(){_0x3f2f62[_0x7f52('0xc')]=_0x55ba74[_0x7f52('0x35')][_0x7f52('0xc')];_0x3f2f62[_0x7f52('0x3c')]=null;_0x3f2f62[_0x7f52('0x3d')]=null;return _0x3f2f62['save']();});})[_0x7f52('0x17')](function(){_0x104b83['status'](0xc8)[_0x7f52('0x2c')]({'message':_0x7f52('0x51')});})[_0x7f52('0x46')](function(_0x4a813c){return handleError(_0x104b83,0x1f4,_0x4a813c);});};passport[_0x7f52('0x52')](_0x7f52('0x2f'),new LocalStrategy({'usernameField':_0x7f52('0x15'),'passwordField':'password'},function(_0x8a8c62,_0x5b5614,_0x1a91a7){return localAuthenticate(db[_0x7f52('0x38')],_0x8a8c62,_0x5b5614,_0x1a91a7);})); \ No newline at end of file +var _0x5e00=['passport-local','Strategy','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','findOne','name','salt','role','disabled','blocked','blockedAt','loginAttempts','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5e00,0x15a));var _0x05e0=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x5e00[_0x4565bf];return _0x5610ba;};'use strict';var util=require(_0x05e0('0x0'));var passport=require(_0x05e0('0x1'));var LocalStrategy=require(_0x05e0('0x2'))[_0x05e0('0x3')];var jayson=require('jayson/promise');var _=require(_0x05e0('0x4'));var rs=require(_0x05e0('0x5'));var moment=require('moment');var db=require(_0x05e0('0x6'))['db'];var authService=require(_0x05e0('0x7'));var utils=require(_0x05e0('0x8'));var client=jayson[_0x05e0('0x9')][_0x05e0('0xa')]({'port':0x232b});function localAuthenticate(_0x2586e1,_0x313332,_0x1ddf3a,_0x802232){var _0x4019e5,_0x1bb35e;return db[_0x05e0('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x05e0('0xc'),_0x05e0('0xd')],'raw':!![]})['then'](function(_0x36ee7c){_0x4019e5=_0x36ee7c;return _0x2586e1[_0x05e0('0xe')]({'attributes':['id',_0x05e0('0xf'),'password',_0x05e0('0x10'),_0x05e0('0x11'),_0x05e0('0x12'),_0x05e0('0x13'),_0x05e0('0x14'),_0x05e0('0x15')],'where':{'name':_0x313332,'role':{'$or':['admin',_0x05e0('0x16'),_0x05e0('0x17')]}}});})[_0x05e0('0x18')](function(_0x5cec77){if(!_0x5cec77||_0x5cec77&&_0x5cec77['name']!==_0x313332){throw new Error(_0x05e0('0x19'));}else{_0x1bb35e=_0x5cec77;return _0x1bb35e;}})[_0x05e0('0x18')](function(){_0x1bb35e['authenticate'](_0x1ddf3a,function(_0x5ea4e4,_0x6c9e20){var _0x122217=_0x1bb35e[_0x05e0('0x15')]+0x1;if(_0x5ea4e4){return _0x802232(_0x5ea4e4);}else if(!_0x6c9e20){if(_0x1bb35e[_0x05e0('0x12')]){return _0x802232(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4019e5[_0x05e0('0xc')]>0x0){if(_0x1bb35e['blocked']){if(_0x4019e5[_0x05e0('0xd')]>0x0){if(moment(_0x1bb35e[_0x05e0('0x14')])[_0x05e0('0x1a')](_0x4019e5[_0x05e0('0xd')],_0x05e0('0x1b'))>moment()){return _0x802232(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x05e0('0x1c')](_0x1bb35e,_0x122217,![],null)['then'](function(){return _0x802232(null,![],{'message':_0x05e0('0x19')});});}}else{return _0x802232(null,![],{'message':_0x05e0('0x19')});}}else{if(_0x122217>=_0x4019e5[_0x05e0('0xc')]){return utils[_0x05e0('0x1c')](_0x1bb35e,0x0,!![],moment())[_0x05e0('0x18')](function(){return _0x802232(null,![],{'message':_0x05e0('0x19')});});}else{return utils['clearBlockUser'](_0x1bb35e,_0x122217,![],null)['then'](function(){return _0x802232(null,![],{'message':_0x05e0('0x19')});});}}}else{return _0x802232(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1bb35e[_0x05e0('0x12')]){return _0x802232(null,![],{'message':_0x05e0('0x19')});}else if(_0x4019e5[_0x05e0('0xc')]>0x0){if(_0x1bb35e[_0x05e0('0x13')]){if(_0x4019e5['blockDuration']>0x0){if(moment(_0x1bb35e['blockedAt'])['add'](_0x4019e5[_0x05e0('0xd')],_0x05e0('0x1b'))>moment()){return _0x802232(null,![],{'message':_0x05e0('0x19')});}else{return utils['clearBlockUser'](_0x1bb35e,0x0,![],null)[_0x05e0('0x18')](function(){return utils['getLicense'](_0x1bb35e);})[_0x05e0('0x18')](function(){return _0x802232(null,_0x1bb35e);});}}else{return _0x802232(null,![],{'message':_0x05e0('0x19')});}}else{return utils[_0x05e0('0x1c')](_0x1bb35e,0x0,![],null)[_0x05e0('0x18')](function(){return utils[_0x05e0('0x1d')](_0x1bb35e);})[_0x05e0('0x18')](function(){return _0x802232(null,_0x1bb35e);})[_0x05e0('0x1e')](function(_0xc26db5){return _0x802232(null,![],_0xc26db5);});}}else{if(_0x1bb35e['blocked']){return _0x802232(null,![],{'message':_0x05e0('0x19')});}else{return utils[_0x05e0('0x1d')](_0x1bb35e)[_0x05e0('0x18')](function(){return _0x802232(null,_0x1bb35e);});}}}});})['catch'](function(_0x36f43d){return _0x802232(null,![],_0x36f43d);});}function sendServiceMail(_0x2a0284){return db[_0x05e0('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0x05e0('0xf'),_0x05e0('0x20')],'include':[{'model':db['MailServerOut'],'as':_0x05e0('0x21'),'include':[{'model':db[_0x05e0('0x22')],'as':_0x05e0('0x22')}]}]})['then'](function(_0xf25f3a){if(!_0xf25f3a){throw new Error(_0x05e0('0x23'));}var _0x403f96=_0xf25f3a[_0x05e0('0x24')]();var _0x28e368={'account':_0x403f96,'message':_[_0x05e0('0x25')]({'from':util[_0x05e0('0x26')](_0x05e0('0x27'),_0xf25f3a[_0x05e0('0xf')],_0xf25f3a['email']||_0xf25f3a[_0x05e0('0x21')][_0x05e0('0x16')])},_0x2a0284)};return client[_0x05e0('0x28')]('SendMail',_0x28e368);})[_0x05e0('0x18')](function(_0x2aa843){if(_0x2aa843[_0x05e0('0x29')]){throw new Error(util[_0x05e0('0x26')](_0x05e0('0x2a'),_0x2aa843[_0x05e0('0x29')][_0x05e0('0x2b')]||JSON[_0x05e0('0x2c')](_0x2aa843['error'])));}return!![];});}function handleError(_0x5bd156,_0x30da28,_0xd43ef2){return _0x5bd156[_0x05e0('0x2d')](_0x30da28||0x1f4)[_0x05e0('0x2e')]({'message':_0xd43ef2?_0xd43ef2[_0x05e0('0x2b')]||_0xd43ef2:''});}exports[_0x05e0('0x2f')]=function(_0x1b55b0,_0x32d533,_0x20a655){passport[_0x05e0('0x30')](_0x05e0('0x31'),function(_0x445cce,_0x520df7,_0x233ce8){var _0x31cc62=_0x445cce||_0x233ce8;if(_0x31cc62){return handleError(_0x32d533,0x191,_0x31cc62);}if(!_0x520df7){return handleError(_0x32d533,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x274ada={'payload':{'id':_0x520df7['id'],'role':_0x520df7[_0x05e0('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x05e0('0x32')](_0x274ada)[_0x05e0('0x18')](function(_0x3fc230){_0x32d533[_0x05e0('0x33')]({'id':_0x520df7['id'],'token':_0x3fc230,'statusCall':'','isAlreadyLogged':_0x520df7['online']});});}})(_0x1b55b0,_0x32d533,_0x20a655);};exports['forgot']=function(_0x3b3f57,_0x52ac99){if(!_0x3b3f57[_0x05e0('0x34')][_0x05e0('0x20')]){return handleError(_0x52ac99,0x1f4,{'message':_0x05e0('0x35')});}var _0x1b8f04=rs[_0x05e0('0x36')]();_0x3b3f57['body']['email']=_0x3b3f57[_0x05e0('0x34')][_0x05e0('0x20')][_0x05e0('0x37')]()[_0x05e0('0x38')]();var _0x561fda;return db['Setting'][_0x05e0('0xe')]({'where':{'id':0x1},'attributes':[_0x05e0('0xc'),'blockDuration'],'raw':!![]})[_0x05e0('0x18')](function(_0x2e5e43){_0x561fda=_0x2e5e43;return db['User'][_0x05e0('0x39')]({'where':{'email':_0x3b3f57[_0x05e0('0x34')][_0x05e0('0x20')]}});})[_0x05e0('0x18')](function(_0x29525c){if(!_0x29525c){throw new Error(_0x05e0('0x3a'));}if(_0x29525c['disabled']){throw new Error(_0x05e0('0x3b'));}if(_0x29525c['blocked']){if(moment(_0x29525c[_0x05e0('0x14')])[_0x05e0('0x1a')](_0x561fda['blockDuration'],'minutes')>moment()){throw new Error(_0x05e0('0x3c'));}else{_0x29525c[_0x05e0('0x13')]=![];_0x29525c[_0x05e0('0x14')]=null;}}_0x29525c[_0x05e0('0x3d')]=_0x1b8f04;_0x29525c['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x29525c[_0x05e0('0x3e')]();})[_0x05e0('0x18')](function(){return sendServiceMail({'to':_0x3b3f57[_0x05e0('0x34')][_0x05e0('0x20')],'subject':_0x05e0('0x3f'),'text':_0x05e0('0x40')+_0x05e0('0x41')+_0x05e0('0x42')+_0x3b3f57['headers'][_0x05e0('0x43')]+_0x05e0('0x44')+_0x1b8f04+'\x0a\x0a'+_0x05e0('0x45')});})[_0x05e0('0x18')](function(){_0x52ac99[_0x05e0('0x2d')](0xc8)['send']({'message':_0x05e0('0x46')});})[_0x05e0('0x1e')](function(_0x313818){return handleError(_0x52ac99,0x1f4,_0x313818);});};exports[_0x05e0('0x47')]=function(_0x1c399b,_0x385003){return db[_0x05e0('0x48')]['find']({'where':{'resetPasswordToken':_0x1c399b[_0x05e0('0x49')][_0x05e0('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x05e0('0x4b')]()}}})['then'](function(_0x109ff0){if(!_0x109ff0){throw new Error(_0x05e0('0x4c'));}return db[_0x05e0('0xb')][_0x05e0('0xe')]({'attributes':['id',_0x05e0('0x4d'),_0x05e0('0x4e'),_0x05e0('0x4f')]})['then'](function(_0x2b7c06){if(_0x2b7c06[_0x05e0('0x4d')])authService[_0x05e0('0x50')](_0x1c399b['body'][_0x05e0('0x51')]);if(!_0x2b7c06[_0x05e0('0x4e')]||!_0x109ff0[_0x05e0('0x52')])return _0x109ff0;authService[_0x05e0('0x53')](_0x1c399b[_0x05e0('0x34')][_0x05e0('0x51')],_0x109ff0[_0x05e0('0x52')],_0x2b7c06[_0x05e0('0x4f')]);return _0x109ff0;})[_0x05e0('0x18')](function(){_0x109ff0[_0x05e0('0x51')]=_0x1c399b[_0x05e0('0x34')][_0x05e0('0x51')];_0x109ff0[_0x05e0('0x3d')]=null;_0x109ff0[_0x05e0('0x54')]=null;return _0x109ff0['save']();});})['then'](function(){_0x385003[_0x05e0('0x2d')](0xc8)[_0x05e0('0x2e')]({'message':_0x05e0('0x55')});})[_0x05e0('0x1e')](function(_0x19e7bd){return handleError(_0x385003,0x1f4,_0x19e7bd);});};passport[_0x05e0('0x56')](_0x05e0('0x31'),new LocalStrategy({'usernameField':_0x05e0('0xf'),'passwordField':_0x05e0('0x51')},function(_0x1e9e3a,_0x314dcf,_0x2dd71f){return localAuthenticate(db[_0x05e0('0x48')],_0x1e9e3a,_0x314dcf,_0x2dd71f);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 73f4580..729f3a6 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 _0x1da4=['Router','./authLocal.controller','login','/forgot','forgot','exports','express'];(function(_0xd2caa4,_0x1b0832){var _0x529077=function(_0x63898c){while(--_0x63898c){_0xd2caa4['push'](_0xd2caa4['shift']());}};_0x529077(++_0x1b0832);}(_0x1da4,0x92));var _0x41da=function(_0x34ccfb,_0x5c1fe4){_0x34ccfb=_0x34ccfb-0x0;var _0x50b1f7=_0x1da4[_0x34ccfb];return _0x50b1f7;};'use strict';var express=require(_0x41da('0x0'));var router=express[_0x41da('0x1')]();var controller=require(_0x41da('0x2'));router['post']('/',controller[_0x41da('0x3')]);router['post'](_0x41da('0x4'),controller[_0x41da('0x5')]);router['post']('/reset/:token',controller['reset']);module[_0x41da('0x6')]=router; \ No newline at end of file +var _0x625b=['forgot','/reset/:token','reset','express','post','login'];(function(_0x4ee216,_0x3ceda6){var _0x19f2ac=function(_0x55f7ca){while(--_0x55f7ca){_0x4ee216['push'](_0x4ee216['shift']());}};_0x19f2ac(++_0x3ceda6);}(_0x625b,0x1b9));var _0xb625=function(_0x3f1811,_0x2ee388){_0x3f1811=_0x3f1811-0x0;var _0x3eaec5=_0x625b[_0x3f1811];return _0x3eaec5;};'use strict';var express=require(_0xb625('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0xb625('0x1')]('/',controller[_0xb625('0x2')]);router[_0xb625('0x1')]('/forgot',controller[_0xb625('0x3')]);router['post'](_0xb625('0x4'),controller[_0xb625('0x5')]);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 9aa0c6e..cff35a4 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 _0xa8a3=['INTEGER','sequelize','STRING'];(function(_0x3f9ec3,_0x3dfd37){var _0xe85b13=function(_0x10e8ed){while(--_0x10e8ed){_0x3f9ec3['push'](_0x3f9ec3['shift']());}};_0xe85b13(++_0x3dfd37);}(_0xa8a3,0x100));var _0x3a8a=function(_0x53d71c,_0x1a3859){_0x53d71c=_0x53d71c-0x0;var _0x555efb=_0xa8a3[_0x53d71c];return _0x555efb;};'use strict';var Sequelize=require(_0x3a8a('0x0'));module['exports']={'name':{'type':Sequelize[_0x3a8a('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3a8a('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0x6944=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x6944,0x14b));var _0x4694=function(_0x1ec245,_0x343203){_0x1ec245=_0x1ec245-0x0;var _0x1c154a=_0x6944[_0x1ec245];return _0x1c154a;};'use strict';var Sequelize=require(_0x4694('0x0'));module[_0x4694('0x1')]={'name':{'type':Sequelize[_0x4694('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x4694('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x4694('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4694('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 9b82575..346da91 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 _0x142c=['mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','end','error','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','Automation','includeAll','findAll','catch','show','params','keys','rawAttributes','include','find','create','body','update','addConditions','Condition','ids','omit','getConditions','findOne','addActions','getActions','Action','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5f5d43,_0x11535a){var _0x80703a=function(_0x56e764){while(--_0x56e764){_0x5f5d43['push'](_0x5f5d43['shift']());}};_0x80703a(++_0x11535a);}(_0x142c,0x14a));var _0xc142=function(_0x444ce3,_0x5e680d){_0x444ce3=_0x444ce3-0x0;var _0x242542=_0x142c[_0x444ce3];return _0x242542;};'use strict';var emlformat=require(_0xc142('0x0'));var rimraf=require(_0xc142('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc142('0x2'));var rp=require(_0xc142('0x3'));var moment=require(_0xc142('0x4'));var BPromise=require(_0xc142('0x5'));var Mustache=require(_0xc142('0x6'));var util=require(_0xc142('0x7'));var path=require(_0xc142('0x8'));var sox=require(_0xc142('0x9'));var csv=require(_0xc142('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc142('0xb'));var _=require(_0xc142('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc142('0xd'));var deskjs=require(_0xc142('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc142('0xf'));var Papa=require(_0xc142('0x10'));var Redis=require(_0xc142('0x11'));var authService=require(_0xc142('0x12'));var qs=require(_0xc142('0x13'));var as=require(_0xc142('0x14'));var hardwareService=require(_0xc142('0x15'));var logger=require('../../config/logger')(_0xc142('0x16'));var utils=require('../../config/utils');var config=require(_0xc142('0x17'));var licenseUtil=require(_0xc142('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22d456,_0x3a598e){_0x3a598e=_0x3a598e||0xcc;return function(_0x565676){if(_0x565676){return _0x22d456[_0xc142('0x19')](_0x3a598e);}return _0x22d456[_0xc142('0x1a')](_0x3a598e)['end']();};}function respondWithResult(_0x5344f9,_0x29a9ec){_0x29a9ec=_0x29a9ec||0xc8;return function(_0x292ea0){if(_0x292ea0){return _0x5344f9['status'](_0x29a9ec)[_0xc142('0x1b')](_0x292ea0);}};}function respondWithFilteredResult(_0x1ddeef,_0x75769d){return function(_0x107a80){if(_0x107a80){var _0x4dcc9a=typeof _0x75769d[_0xc142('0x1c')]===_0xc142('0x1d')&&typeof _0x75769d[_0xc142('0x1e')]===_0xc142('0x1d');var _0xa9955b=_0x107a80[_0xc142('0x1f')];var _0x502b1b=_0x4dcc9a?0x0:_0x75769d[_0xc142('0x1c')];var _0x1b276f=_0x4dcc9a?_0x107a80[_0xc142('0x1f')]:_0x75769d[_0xc142('0x1c')]+_0x75769d[_0xc142('0x1e')];var _0xadce74;if(_0x1b276f>=_0xa9955b){_0x1b276f=_0xa9955b;_0xadce74=0xc8;}else{_0xadce74=0xce;}_0x1ddeef[_0xc142('0x1a')](_0xadce74);return _0x1ddeef['set']('Content-Range',_0x502b1b+'-'+_0x1b276f+'/'+_0xa9955b)[_0xc142('0x1b')](_0x107a80);}return null;};}function patchUpdates(_0x190e38){return function(_0xbce09d){try{jsonpatch[_0xc142('0x20')](_0xbce09d,_0x190e38,!![]);}catch(_0x498519){return BPromise[_0xc142('0x21')](_0x498519);}return _0xbce09d[_0xc142('0x22')]();};}function saveUpdates(_0x57a3f8,_0x3f1665){return function(_0x1917ff){if(_0x1917ff){return _0x1917ff['update'](_0x57a3f8)[_0xc142('0x23')](function(_0x531a4f){return _0x531a4f;});}return null;};}function removeEntity(_0x33d85c,_0x2f455d){return function(_0x3d8d9b){if(_0x3d8d9b){return _0x3d8d9b[_0xc142('0x24')]()['then'](function(){_0x33d85c['status'](0xcc)[_0xc142('0x25')]();});}};}function handleEntityNotFound(_0x43508e,_0x4c298a){return function(_0x20595a){if(!_0x20595a){_0x43508e[_0xc142('0x19')](0x194);}return _0x20595a;};}function handleError(_0x137b5e,_0x214df2){_0x214df2=_0x214df2||0x1f4;return function(_0x393d30){logger[_0xc142('0x26')](_0x393d30['stack']);if(_0x393d30[_0xc142('0x27')]){delete _0x393d30[_0xc142('0x27')];}_0x137b5e['status'](_0x214df2)[_0xc142('0x28')](_0x393d30);};}exports[_0xc142('0x29')]=function(_0xece255,_0x2be855){var _0x3dc47c={},_0x597ecf={},_0x46f631={'count':0x0,'rows':[]};var _0x42d2e6=_[_0xc142('0x2a')](db['Automation']['rawAttributes'],function(_0x467c4f){return{'name':_0x467c4f[_0xc142('0x2b')],'type':_0x467c4f[_0xc142('0x2c')][_0xc142('0x2d')]};});_0x597ecf[_0xc142('0x2e')]=_[_0xc142('0x2a')](_0x42d2e6,_0xc142('0x27'));_0x597ecf['query']=_['keys'](_0xece255[_0xc142('0x2f')]);_0x597ecf[_0xc142('0x30')]=_[_0xc142('0x31')](_0x597ecf[_0xc142('0x2e')],_0x597ecf[_0xc142('0x2f')]);_0x3dc47c[_0xc142('0x32')]=_['intersection'](_0x597ecf[_0xc142('0x2e')],qs[_0xc142('0x33')](_0xece255['query']['fields']));_0x3dc47c[_0xc142('0x32')]=_0x3dc47c[_0xc142('0x32')][_0xc142('0x34')]?_0x3dc47c[_0xc142('0x32')]:_0x597ecf[_0xc142('0x2e')];if(!_0xece255[_0xc142('0x2f')][_0xc142('0x35')](_0xc142('0x36'))){_0x3dc47c[_0xc142('0x1e')]=qs[_0xc142('0x1e')](_0xece255[_0xc142('0x2f')]['limit']);_0x3dc47c[_0xc142('0x1c')]=qs[_0xc142('0x1c')](_0xece255[_0xc142('0x2f')][_0xc142('0x1c')]);}_0x3dc47c[_0xc142('0x37')]=qs[_0xc142('0x38')](_0xece255['query'][_0xc142('0x38')]);_0x3dc47c['where']=qs[_0xc142('0x30')](_[_0xc142('0x39')](_0xece255['query'],_0x597ecf['filters']),_0x42d2e6);if(_0xece255[_0xc142('0x2f')][_0xc142('0x3a')]){_0x3dc47c['where']=_[_0xc142('0x3b')](_0x3dc47c[_0xc142('0x3c')],{'$or':_['map'](_0x42d2e6,function(_0x2e37f6){if(_0x2e37f6[_0xc142('0x2c')]!=='VIRTUAL'){var _0x306422={};_0x306422[_0x2e37f6[_0xc142('0x27')]]={'$like':'%'+_0xece255['query']['filter']+'%'};return _0x306422;}})});}_0x3dc47c=_[_0xc142('0x3b')]({},_0x3dc47c,_0xece255[_0xc142('0x3d')]);var _0x4bf33c={'where':_0x3dc47c[_0xc142('0x3c')]};return db[_0xc142('0x3e')][_0xc142('0x1f')](_0x4bf33c)[_0xc142('0x23')](function(_0x74e3cc){_0x46f631['count']=_0x74e3cc;if(_0xece255[_0xc142('0x2f')][_0xc142('0x3f')]){_0x3dc47c['include']=[{'all':!![]}];}return db[_0xc142('0x3e')][_0xc142('0x40')](_0x3dc47c);})[_0xc142('0x23')](function(_0x2ef735){_0x46f631['rows']=_0x2ef735;return _0x46f631;})[_0xc142('0x23')](respondWithFilteredResult(_0x2be855,_0x3dc47c))[_0xc142('0x41')](handleError(_0x2be855,null));};exports[_0xc142('0x42')]=function(_0x3c90d1,_0x3b51ae){var _0x55c889={'raw':![],'where':{'id':_0x3c90d1[_0xc142('0x43')]['id']}},_0x1fe92d={};_0x1fe92d[_0xc142('0x2e')]=_[_0xc142('0x44')](db[_0xc142('0x3e')][_0xc142('0x45')]);_0x1fe92d['query']=_[_0xc142('0x44')](_0x3c90d1['query']);_0x1fe92d[_0xc142('0x30')]=_[_0xc142('0x31')](_0x1fe92d['model'],_0x1fe92d[_0xc142('0x2f')]);_0x55c889['attributes']=_[_0xc142('0x31')](_0x1fe92d[_0xc142('0x2e')],qs[_0xc142('0x33')](_0x3c90d1['query'][_0xc142('0x33')]));_0x55c889['attributes']=_0x55c889[_0xc142('0x32')][_0xc142('0x34')]?_0x55c889[_0xc142('0x32')]:_0x1fe92d[_0xc142('0x2e')];if(_0x3c90d1['query'][_0xc142('0x3f')]){_0x55c889[_0xc142('0x46')]=[{'all':!![]}];}_0x55c889=_[_0xc142('0x3b')]({},_0x55c889,_0x3c90d1['options']);return db[_0xc142('0x3e')][_0xc142('0x47')](_0x55c889)[_0xc142('0x23')](handleEntityNotFound(_0x3b51ae,null))[_0xc142('0x23')](respondWithResult(_0x3b51ae,null))[_0xc142('0x41')](handleError(_0x3b51ae,null));};exports[_0xc142('0x48')]=function(_0x1ed373,_0x17022b){return db[_0xc142('0x3e')]['create'](_0x1ed373[_0xc142('0x49')],{})[_0xc142('0x23')](respondWithResult(_0x17022b,0xc9))[_0xc142('0x41')](handleError(_0x17022b,null));};exports[_0xc142('0x4a')]=function(_0x5e3b49,_0x25fa77){if(_0x5e3b49['body']['id']){delete _0x5e3b49[_0xc142('0x49')]['id'];}return db[_0xc142('0x3e')][_0xc142('0x47')]({'where':{'id':_0x5e3b49['params']['id']}})[_0xc142('0x23')](handleEntityNotFound(_0x25fa77,null))['then'](saveUpdates(_0x5e3b49['body'],null))['then'](respondWithResult(_0x25fa77,null))[_0xc142('0x41')](handleError(_0x25fa77,null));};exports[_0xc142('0x24')]=function(_0x5cbe71,_0x38b096){return db[_0xc142('0x3e')][_0xc142('0x47')]({'where':{'id':_0x5cbe71[_0xc142('0x43')]['id']}})['then'](handleEntityNotFound(_0x38b096,null))[_0xc142('0x23')](removeEntity(_0x38b096,null))[_0xc142('0x41')](handleError(_0x38b096,null));};exports[_0xc142('0x4b')]=function(_0x10efba,_0x44dcd0,_0x4ef07d){return db[_0xc142('0x4c')][_0xc142('0x47')]({'where':{'id':_0x10efba[_0xc142('0x43')]['id']}})[_0xc142('0x23')](handleEntityNotFound(_0x44dcd0,null))[_0xc142('0x23')](function(_0x46c9cf){if(_0x46c9cf){return _0x46c9cf[_0xc142('0x4b')](_0x10efba['body'][_0xc142('0x4d')],_[_0xc142('0x4e')](_0x10efba[_0xc142('0x49')],[_0xc142('0x4d'),'id'])||{});}})[_0xc142('0x23')](respondWithResult(_0x44dcd0,null))[_0xc142('0x41')](handleError(_0x44dcd0,null));};exports[_0xc142('0x4f')]=function(_0x200598,_0x978059,_0x234787){var _0x172e3b={};var _0xcf91d2={};var _0x282e10;var _0x4ffffd;return db[_0xc142('0x3e')][_0xc142('0x50')]({'where':{'id':_0x200598[_0xc142('0x43')]['id']}})[_0xc142('0x23')](handleEntityNotFound(_0x978059,null))['then'](function(_0x370216){if(_0x370216){_0x282e10=_0x370216;_0xcf91d2[_0xc142('0x2e')]=_[_0xc142('0x44')](db[_0xc142('0x4c')][_0xc142('0x45')]);_0xcf91d2[_0xc142('0x2f')]=_[_0xc142('0x44')](_0x200598[_0xc142('0x2f')]);_0xcf91d2[_0xc142('0x30')]=_[_0xc142('0x31')](_0xcf91d2['model'],_0xcf91d2[_0xc142('0x2f')]);_0x172e3b[_0xc142('0x32')]=_['intersection'](_0xcf91d2[_0xc142('0x2e')],qs[_0xc142('0x33')](_0x200598['query'][_0xc142('0x33')]));_0x172e3b[_0xc142('0x32')]=_0x172e3b[_0xc142('0x32')][_0xc142('0x34')]?_0x172e3b[_0xc142('0x32')]:_0xcf91d2[_0xc142('0x2e')];_0x172e3b[_0xc142('0x37')]=qs[_0xc142('0x38')](_0x200598[_0xc142('0x2f')][_0xc142('0x38')]);_0x172e3b[_0xc142('0x3c')]=qs[_0xc142('0x30')](_[_0xc142('0x39')](_0x200598['query'],_0xcf91d2['filters']));if(_0x200598['query'][_0xc142('0x3a')]){_0x172e3b[_0xc142('0x3c')]=_[_0xc142('0x3b')](_0x172e3b[_0xc142('0x3c')],{'$or':_[_0xc142('0x2a')](_0x172e3b[_0xc142('0x32')],function(_0x4d319c){var _0x2a6de7={};_0x2a6de7[_0x4d319c]={'$like':'%'+_0x200598[_0xc142('0x2f')][_0xc142('0x3a')]+'%'};return _0x2a6de7;})});}_0x172e3b=_[_0xc142('0x3b')]({},_0x172e3b,_0x200598[_0xc142('0x3d')]);return _0x282e10[_0xc142('0x4f')](_0x172e3b);}})['then'](function(_0x2144eb){if(_0x2144eb){_0x4ffffd=_0x2144eb['length'];if(!_0x200598[_0xc142('0x2f')]['hasOwnProperty'](_0xc142('0x36'))){_0x172e3b['limit']=qs[_0xc142('0x1e')](_0x200598['query'][_0xc142('0x1e')]);_0x172e3b['offset']=qs[_0xc142('0x1c')](_0x200598['query'][_0xc142('0x1c')]);}return _0x282e10[_0xc142('0x4f')](_0x172e3b);}})[_0xc142('0x23')](function(_0xfdafcb){if(_0xfdafcb){return _0xfdafcb?{'count':_0x4ffffd,'rows':_0xfdafcb}:null;}})[_0xc142('0x23')](respondWithResult(_0x978059,null))[_0xc142('0x41')](handleError(_0x978059,null));};exports[_0xc142('0x51')]=function(_0x8833ab,_0x18ea96,_0xe1c2c3){return db['Action'][_0xc142('0x47')]({'where':{'id':_0x8833ab[_0xc142('0x43')]['id']}})['then'](handleEntityNotFound(_0x18ea96,null))[_0xc142('0x23')](function(_0x5d00a8){if(_0x5d00a8){return _0x5d00a8[_0xc142('0x51')](_0x8833ab[_0xc142('0x49')][_0xc142('0x4d')],_[_0xc142('0x4e')](_0x8833ab['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x18ea96,null))['catch'](handleError(_0x18ea96,null));};exports[_0xc142('0x52')]=function(_0x388861,_0x68a067,_0x2897d9){var _0x539988={};var _0xaae866={};var _0x2b4003;var _0x594b4e;return db['Automation'][_0xc142('0x50')]({'where':{'id':_0x388861[_0xc142('0x43')]['id']}})[_0xc142('0x23')](handleEntityNotFound(_0x68a067,null))[_0xc142('0x23')](function(_0xe9c650){if(_0xe9c650){_0x2b4003=_0xe9c650;_0xaae866[_0xc142('0x2e')]=_[_0xc142('0x44')](db[_0xc142('0x53')][_0xc142('0x45')]);_0xaae866[_0xc142('0x2f')]=_['keys'](_0x388861[_0xc142('0x2f')]);_0xaae866[_0xc142('0x30')]=_[_0xc142('0x31')](_0xaae866[_0xc142('0x2e')],_0xaae866[_0xc142('0x2f')]);_0x539988['attributes']=_[_0xc142('0x31')](_0xaae866['model'],qs['fields'](_0x388861[_0xc142('0x2f')][_0xc142('0x33')]));_0x539988['attributes']=_0x539988['attributes'][_0xc142('0x34')]?_0x539988[_0xc142('0x32')]:_0xaae866[_0xc142('0x2e')];_0x539988['order']=qs[_0xc142('0x38')](_0x388861['query'][_0xc142('0x38')]);_0x539988[_0xc142('0x3c')]=qs[_0xc142('0x30')](_[_0xc142('0x39')](_0x388861[_0xc142('0x2f')],_0xaae866[_0xc142('0x30')]));if(_0x388861[_0xc142('0x2f')]['filter']){_0x539988[_0xc142('0x3c')]=_[_0xc142('0x3b')](_0x539988[_0xc142('0x3c')],{'$or':_[_0xc142('0x2a')](_0x539988['attributes'],function(_0x4a6050){var _0x2cef83={};_0x2cef83[_0x4a6050]={'$like':'%'+_0x388861['query'][_0xc142('0x3a')]+'%'};return _0x2cef83;})});}_0x539988=_[_0xc142('0x3b')]({},_0x539988,_0x388861['options']);return _0x2b4003['getActions'](_0x539988);}})[_0xc142('0x23')](function(_0xf009da){if(_0xf009da){_0x594b4e=_0xf009da[_0xc142('0x34')];if(!_0x388861['query']['hasOwnProperty'](_0xc142('0x36'))){_0x539988[_0xc142('0x1e')]=qs[_0xc142('0x1e')](_0x388861[_0xc142('0x2f')][_0xc142('0x1e')]);_0x539988[_0xc142('0x1c')]=qs[_0xc142('0x1c')](_0x388861['query'][_0xc142('0x1c')]);}return _0x2b4003['getActions'](_0x539988);}})[_0xc142('0x23')](function(_0xb5b51a){if(_0xb5b51a){return _0xb5b51a?{'count':_0x594b4e,'rows':_0xb5b51a}:null;}})[_0xc142('0x23')](respondWithResult(_0x68a067,null))[_0xc142('0x41')](handleError(_0x68a067,null));}; \ No newline at end of file +var _0x976a=['type','model','query','keys','intersection','fields','attributes','length','nolimit','limit','order','sort','filters','pick','filter','where','merge','options','includeAll','findAll','rows','params','include','find','catch','create','body','addConditions','ids','omit','findOne','Condition','getConditions','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','Content-Range','json','reject','save','update','destroy','then','error','name','send','index','map','Automation','rawAttributes','fieldName'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x976a,0x78));var _0xa976=function(_0x3fdab4,_0x41eca9){_0x3fdab4=_0x3fdab4-0x0;var _0x484516=_0x976a[_0x3fdab4];return _0x484516;};'use strict';var emlformat=require(_0xa976('0x0'));var rimraf=require(_0xa976('0x1'));var zipdir=require(_0xa976('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa976('0x3'));var moment=require(_0xa976('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa976('0x5'));var util=require(_0xa976('0x6'));var path=require(_0xa976('0x7'));var sox=require(_0xa976('0x8'));var csv=require(_0xa976('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa976('0xa'));var _=require(_0xa976('0xb'));var squel=require(_0xa976('0xc'));var crypto=require('crypto');var jsforce=require(_0xa976('0xd'));var deskjs=require(_0xa976('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa976('0xf'));var Papa=require(_0xa976('0x10'));var Redis=require('ioredis');var authService=require(_0xa976('0x11'));var qs=require(_0xa976('0x12'));var as=require(_0xa976('0x13'));var hardwareService=require(_0xa976('0x14'));var logger=require(_0xa976('0x15'))(_0xa976('0x16'));var utils=require(_0xa976('0x17'));var config=require(_0xa976('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4530c2,_0x2eb458){_0x2eb458=_0x2eb458||0xcc;return function(_0x455cb1){if(_0x455cb1){return _0x4530c2[_0xa976('0x19')](_0x2eb458);}return _0x4530c2[_0xa976('0x1a')](_0x2eb458)[_0xa976('0x1b')]();};}function respondWithResult(_0x21c40d,_0x51c3bf){_0x51c3bf=_0x51c3bf||0xc8;return function(_0x454153){if(_0x454153){return _0x21c40d['status'](_0x51c3bf)['json'](_0x454153);}};}function respondWithFilteredResult(_0x5c9973,_0x2101e8){return function(_0x4aaebf){if(_0x4aaebf){var _0x2bdd39=typeof _0x2101e8[_0xa976('0x1c')]===_0xa976('0x1d')&&typeof _0x2101e8['limit']===_0xa976('0x1d');var _0x33b762=_0x4aaebf[_0xa976('0x1e')];var _0x54ccb9=_0x2bdd39?0x0:_0x2101e8['offset'];var _0x5ea1e6=_0x2bdd39?_0x4aaebf[_0xa976('0x1e')]:_0x2101e8[_0xa976('0x1c')]+_0x2101e8['limit'];var _0xf86f8d;if(_0x5ea1e6>=_0x33b762){_0x5ea1e6=_0x33b762;_0xf86f8d=0xc8;}else{_0xf86f8d=0xce;}_0x5c9973[_0xa976('0x1a')](_0xf86f8d);return _0x5c9973['set'](_0xa976('0x1f'),_0x54ccb9+'-'+_0x5ea1e6+'/'+_0x33b762)[_0xa976('0x20')](_0x4aaebf);}return null;};}function patchUpdates(_0x4027ca){return function(_0x5eda23){try{jsonpatch['apply'](_0x5eda23,_0x4027ca,!![]);}catch(_0x3a6199){return BPromise[_0xa976('0x21')](_0x3a6199);}return _0x5eda23[_0xa976('0x22')]();};}function saveUpdates(_0x1747ce,_0xf56726){return function(_0x47f0f4){if(_0x47f0f4){return _0x47f0f4[_0xa976('0x23')](_0x1747ce)['then'](function(_0x499982){return _0x499982;});}return null;};}function removeEntity(_0x41c34a,_0xa04431){return function(_0x17883e){if(_0x17883e){return _0x17883e[_0xa976('0x24')]()[_0xa976('0x25')](function(){_0x41c34a[_0xa976('0x1a')](0xcc)[_0xa976('0x1b')]();});}};}function handleEntityNotFound(_0x5494d5,_0x5055c7){return function(_0x2031d4){if(!_0x2031d4){_0x5494d5[_0xa976('0x19')](0x194);}return _0x2031d4;};}function handleError(_0x3c1ec6,_0x8d11b6){_0x8d11b6=_0x8d11b6||0x1f4;return function(_0x5e723d){logger[_0xa976('0x26')](_0x5e723d['stack']);if(_0x5e723d[_0xa976('0x27')]){delete _0x5e723d['name'];}_0x3c1ec6[_0xa976('0x1a')](_0x8d11b6)[_0xa976('0x28')](_0x5e723d);};}exports[_0xa976('0x29')]=function(_0x4b4c65,_0x4a718d){var _0x28828c={},_0x28157d={},_0x2b4890={'count':0x0,'rows':[]};var _0x34a977=_[_0xa976('0x2a')](db[_0xa976('0x2b')][_0xa976('0x2c')],function(_0x559694){return{'name':_0x559694[_0xa976('0x2d')],'type':_0x559694[_0xa976('0x2e')]['key']};});_0x28157d[_0xa976('0x2f')]=_[_0xa976('0x2a')](_0x34a977,'name');_0x28157d[_0xa976('0x30')]=_[_0xa976('0x31')](_0x4b4c65['query']);_0x28157d['filters']=_['intersection'](_0x28157d[_0xa976('0x2f')],_0x28157d[_0xa976('0x30')]);_0x28828c['attributes']=_[_0xa976('0x32')](_0x28157d[_0xa976('0x2f')],qs[_0xa976('0x33')](_0x4b4c65[_0xa976('0x30')][_0xa976('0x33')]));_0x28828c[_0xa976('0x34')]=_0x28828c[_0xa976('0x34')][_0xa976('0x35')]?_0x28828c[_0xa976('0x34')]:_0x28157d[_0xa976('0x2f')];if(!_0x4b4c65[_0xa976('0x30')]['hasOwnProperty'](_0xa976('0x36'))){_0x28828c['limit']=qs[_0xa976('0x37')](_0x4b4c65['query']['limit']);_0x28828c[_0xa976('0x1c')]=qs[_0xa976('0x1c')](_0x4b4c65['query'][_0xa976('0x1c')]);}_0x28828c[_0xa976('0x38')]=qs['sort'](_0x4b4c65[_0xa976('0x30')][_0xa976('0x39')]);_0x28828c['where']=qs[_0xa976('0x3a')](_[_0xa976('0x3b')](_0x4b4c65[_0xa976('0x30')],_0x28157d[_0xa976('0x3a')]),_0x34a977);if(_0x4b4c65[_0xa976('0x30')][_0xa976('0x3c')]){_0x28828c[_0xa976('0x3d')]=_[_0xa976('0x3e')](_0x28828c['where'],{'$or':_['map'](_0x34a977,function(_0x3e7abc){if(_0x3e7abc[_0xa976('0x2e')]!=='VIRTUAL'){var _0x37c810={};_0x37c810[_0x3e7abc[_0xa976('0x27')]]={'$like':'%'+_0x4b4c65['query'][_0xa976('0x3c')]+'%'};return _0x37c810;}})});}_0x28828c=_['merge']({},_0x28828c,_0x4b4c65[_0xa976('0x3f')]);var _0x59eec8={'where':_0x28828c[_0xa976('0x3d')]};return db[_0xa976('0x2b')][_0xa976('0x1e')](_0x59eec8)['then'](function(_0xfc9e14){_0x2b4890[_0xa976('0x1e')]=_0xfc9e14;if(_0x4b4c65[_0xa976('0x30')][_0xa976('0x40')]){_0x28828c['include']=[{'all':!![]}];}return db[_0xa976('0x2b')][_0xa976('0x41')](_0x28828c);})[_0xa976('0x25')](function(_0x428b22){_0x2b4890[_0xa976('0x42')]=_0x428b22;return _0x2b4890;})[_0xa976('0x25')](respondWithFilteredResult(_0x4a718d,_0x28828c))['catch'](handleError(_0x4a718d,null));};exports['show']=function(_0x101774,_0x22a99a){var _0x89b66={'raw':![],'where':{'id':_0x101774[_0xa976('0x43')]['id']}},_0x530273={};_0x530273[_0xa976('0x2f')]=_[_0xa976('0x31')](db[_0xa976('0x2b')][_0xa976('0x2c')]);_0x530273[_0xa976('0x30')]=_[_0xa976('0x31')](_0x101774[_0xa976('0x30')]);_0x530273[_0xa976('0x3a')]=_[_0xa976('0x32')](_0x530273[_0xa976('0x2f')],_0x530273[_0xa976('0x30')]);_0x89b66['attributes']=_[_0xa976('0x32')](_0x530273[_0xa976('0x2f')],qs[_0xa976('0x33')](_0x101774['query'][_0xa976('0x33')]));_0x89b66[_0xa976('0x34')]=_0x89b66[_0xa976('0x34')][_0xa976('0x35')]?_0x89b66[_0xa976('0x34')]:_0x530273['model'];if(_0x101774[_0xa976('0x30')][_0xa976('0x40')]){_0x89b66[_0xa976('0x44')]=[{'all':!![]}];}_0x89b66=_[_0xa976('0x3e')]({},_0x89b66,_0x101774['options']);return db[_0xa976('0x2b')][_0xa976('0x45')](_0x89b66)[_0xa976('0x25')](handleEntityNotFound(_0x22a99a,null))[_0xa976('0x25')](respondWithResult(_0x22a99a,null))[_0xa976('0x46')](handleError(_0x22a99a,null));};exports['create']=function(_0x40d2fb,_0x333f85){return db[_0xa976('0x2b')][_0xa976('0x47')](_0x40d2fb['body'],{})[_0xa976('0x25')](respondWithResult(_0x333f85,0xc9))[_0xa976('0x46')](handleError(_0x333f85,null));};exports[_0xa976('0x23')]=function(_0x13fc4e,_0x5de4b7){if(_0x13fc4e[_0xa976('0x48')]['id']){delete _0x13fc4e[_0xa976('0x48')]['id'];}return db['Automation'][_0xa976('0x45')]({'where':{'id':_0x13fc4e[_0xa976('0x43')]['id']}})[_0xa976('0x25')](handleEntityNotFound(_0x5de4b7,null))['then'](saveUpdates(_0x13fc4e['body'],null))['then'](respondWithResult(_0x5de4b7,null))[_0xa976('0x46')](handleError(_0x5de4b7,null));};exports[_0xa976('0x24')]=function(_0x4597e7,_0x274c5a){return db['Automation'][_0xa976('0x45')]({'where':{'id':_0x4597e7['params']['id']}})[_0xa976('0x25')](handleEntityNotFound(_0x274c5a,null))['then'](removeEntity(_0x274c5a,null))[_0xa976('0x46')](handleError(_0x274c5a,null));};exports[_0xa976('0x49')]=function(_0xd3c134,_0x23fe31,_0x4e3be3){return db['Condition'][_0xa976('0x45')]({'where':{'id':_0xd3c134[_0xa976('0x43')]['id']}})[_0xa976('0x25')](handleEntityNotFound(_0x23fe31,null))[_0xa976('0x25')](function(_0x5829f2){if(_0x5829f2){return _0x5829f2['addConditions'](_0xd3c134['body'][_0xa976('0x4a')],_[_0xa976('0x4b')](_0xd3c134[_0xa976('0x48')],[_0xa976('0x4a'),'id'])||{});}})[_0xa976('0x25')](respondWithResult(_0x23fe31,null))[_0xa976('0x46')](handleError(_0x23fe31,null));};exports['getConditions']=function(_0x2bf79c,_0x480808,_0x31647c){var _0xa61db8={};var _0x5b7f59={};var _0x55a90a;var _0x355844;return db[_0xa976('0x2b')][_0xa976('0x4c')]({'where':{'id':_0x2bf79c['params']['id']}})[_0xa976('0x25')](handleEntityNotFound(_0x480808,null))['then'](function(_0x21adb6){if(_0x21adb6){_0x55a90a=_0x21adb6;_0x5b7f59['model']=_['keys'](db[_0xa976('0x4d')][_0xa976('0x2c')]);_0x5b7f59[_0xa976('0x30')]=_[_0xa976('0x31')](_0x2bf79c[_0xa976('0x30')]);_0x5b7f59[_0xa976('0x3a')]=_[_0xa976('0x32')](_0x5b7f59[_0xa976('0x2f')],_0x5b7f59[_0xa976('0x30')]);_0xa61db8[_0xa976('0x34')]=_[_0xa976('0x32')](_0x5b7f59[_0xa976('0x2f')],qs[_0xa976('0x33')](_0x2bf79c['query'][_0xa976('0x33')]));_0xa61db8['attributes']=_0xa61db8[_0xa976('0x34')][_0xa976('0x35')]?_0xa61db8['attributes']:_0x5b7f59['model'];_0xa61db8[_0xa976('0x38')]=qs[_0xa976('0x39')](_0x2bf79c[_0xa976('0x30')][_0xa976('0x39')]);_0xa61db8[_0xa976('0x3d')]=qs[_0xa976('0x3a')](_[_0xa976('0x3b')](_0x2bf79c[_0xa976('0x30')],_0x5b7f59[_0xa976('0x3a')]));if(_0x2bf79c[_0xa976('0x30')]['filter']){_0xa61db8['where']=_['merge'](_0xa61db8[_0xa976('0x3d')],{'$or':_['map'](_0xa61db8[_0xa976('0x34')],function(_0x115574){var _0x5c0add={};_0x5c0add[_0x115574]={'$like':'%'+_0x2bf79c[_0xa976('0x30')]['filter']+'%'};return _0x5c0add;})});}_0xa61db8=_[_0xa976('0x3e')]({},_0xa61db8,_0x2bf79c['options']);return _0x55a90a[_0xa976('0x4e')](_0xa61db8);}})[_0xa976('0x25')](function(_0x4ab530){if(_0x4ab530){_0x355844=_0x4ab530['length'];if(!_0x2bf79c[_0xa976('0x30')][_0xa976('0x4f')]('nolimit')){_0xa61db8[_0xa976('0x37')]=qs[_0xa976('0x37')](_0x2bf79c[_0xa976('0x30')][_0xa976('0x37')]);_0xa61db8[_0xa976('0x1c')]=qs[_0xa976('0x1c')](_0x2bf79c[_0xa976('0x30')][_0xa976('0x1c')]);}return _0x55a90a[_0xa976('0x4e')](_0xa61db8);}})['then'](function(_0x326510){if(_0x326510){return _0x326510?{'count':_0x355844,'rows':_0x326510}:null;}})[_0xa976('0x25')](respondWithResult(_0x480808,null))[_0xa976('0x46')](handleError(_0x480808,null));};exports[_0xa976('0x50')]=function(_0x359ccb,_0x53e2c6,_0x12b497){return db[_0xa976('0x51')][_0xa976('0x45')]({'where':{'id':_0x359ccb[_0xa976('0x43')]['id']}})[_0xa976('0x25')](handleEntityNotFound(_0x53e2c6,null))['then'](function(_0xff0a9b){if(_0xff0a9b){return _0xff0a9b[_0xa976('0x50')](_0x359ccb[_0xa976('0x48')][_0xa976('0x4a')],_[_0xa976('0x4b')](_0x359ccb[_0xa976('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x53e2c6,null))['catch'](handleError(_0x53e2c6,null));};exports[_0xa976('0x52')]=function(_0x3764c1,_0x5b7228,_0x504f67){var _0x4c2816={};var _0x10be67={};var _0x1c439b;var _0x13dde5;return db[_0xa976('0x2b')][_0xa976('0x4c')]({'where':{'id':_0x3764c1[_0xa976('0x43')]['id']}})['then'](handleEntityNotFound(_0x5b7228,null))[_0xa976('0x25')](function(_0x2f0a87){if(_0x2f0a87){_0x1c439b=_0x2f0a87;_0x10be67[_0xa976('0x2f')]=_[_0xa976('0x31')](db[_0xa976('0x51')][_0xa976('0x2c')]);_0x10be67[_0xa976('0x30')]=_['keys'](_0x3764c1[_0xa976('0x30')]);_0x10be67[_0xa976('0x3a')]=_[_0xa976('0x32')](_0x10be67[_0xa976('0x2f')],_0x10be67['query']);_0x4c2816[_0xa976('0x34')]=_[_0xa976('0x32')](_0x10be67[_0xa976('0x2f')],qs[_0xa976('0x33')](_0x3764c1['query']['fields']));_0x4c2816[_0xa976('0x34')]=_0x4c2816['attributes'][_0xa976('0x35')]?_0x4c2816['attributes']:_0x10be67[_0xa976('0x2f')];_0x4c2816['order']=qs[_0xa976('0x39')](_0x3764c1['query'][_0xa976('0x39')]);_0x4c2816[_0xa976('0x3d')]=qs['filters'](_[_0xa976('0x3b')](_0x3764c1[_0xa976('0x30')],_0x10be67['filters']));if(_0x3764c1[_0xa976('0x30')]['filter']){_0x4c2816[_0xa976('0x3d')]=_[_0xa976('0x3e')](_0x4c2816[_0xa976('0x3d')],{'$or':_['map'](_0x4c2816[_0xa976('0x34')],function(_0x57c412){var _0x9f383e={};_0x9f383e[_0x57c412]={'$like':'%'+_0x3764c1[_0xa976('0x30')][_0xa976('0x3c')]+'%'};return _0x9f383e;})});}_0x4c2816=_[_0xa976('0x3e')]({},_0x4c2816,_0x3764c1[_0xa976('0x3f')]);return _0x1c439b[_0xa976('0x52')](_0x4c2816);}})[_0xa976('0x25')](function(_0x46a3ec){if(_0x46a3ec){_0x13dde5=_0x46a3ec['length'];if(!_0x3764c1['query']['hasOwnProperty']('nolimit')){_0x4c2816['limit']=qs[_0xa976('0x37')](_0x3764c1[_0xa976('0x30')][_0xa976('0x37')]);_0x4c2816[_0xa976('0x1c')]=qs['offset'](_0x3764c1[_0xa976('0x30')][_0xa976('0x1c')]);}return _0x1c439b[_0xa976('0x52')](_0x4c2816);}})[_0xa976('0x25')](function(_0x1903f7){if(_0x1903f7){return _0x1903f7?{'count':_0x13dde5,'rows':_0x1903f7}:null;}})['then'](respondWithResult(_0x5b7228,null))[_0xa976('0x46')](handleError(_0x5b7228,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 1c63791..5e77086 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 _0x31e6=['tools_automations','lodash','request-promise','path','rimraf','define','Automation'];(function(_0x403115,_0x2d6d03){var _0x596ef3=function(_0x145d97){while(--_0x145d97){_0x403115['push'](_0x403115['shift']());}};_0x596ef3(++_0x2d6d03);}(_0x31e6,0x182));var _0x631e=function(_0xf185d9,_0x42e8e9){_0xf185d9=_0xf185d9-0x0;var _0x1a1abc=_0x31e6[_0xf185d9];return _0x1a1abc;};'use strict';var _=require(_0x631e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x631e('0x1'));var fs=require('fs');var path=require(_0x631e('0x2'));var rimraf=require(_0x631e('0x3'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module['exports']=function(_0x4fdfe1,_0xb5cd89){return _0x4fdfe1[_0x631e('0x4')](_0x631e('0x5'),attributes,{'tableName':_0x631e('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9803=['../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x427d22,_0x358ab6){var _0x3217af=function(_0x14ae29){while(--_0x14ae29){_0x427d22['push'](_0x427d22['shift']());}};_0x3217af(++_0x358ab6);}(_0x9803,0x17f));var _0x3980=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9803[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3980('0x0'));var util=require(_0x3980('0x1'));var logger=require(_0x3980('0x2'))(_0x3980('0x3'));var moment=require(_0x3980('0x4'));var BPromise=require(_0x3980('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3980('0x6'));var rimraf=require('rimraf');var config=require(_0x3980('0x7'));var attributes=require('./automation.attributes');module[_0x3980('0x8')]=function(_0x401b10,_0x41eab7){return _0x401b10[_0x3980('0x9')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 1260d9e..ae2642a 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 _0x7334=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment'];(function(_0x26fd1e,_0x3f465f){var _0x359dab=function(_0x386c96){while(--_0x386c96){_0x26fd1e['push'](_0x26fd1e['shift']());}};_0x359dab(++_0x3f465f);}(_0x7334,0x184));var _0x4733=function(_0x2550fe,_0x3072fd){_0x2550fe=_0x2550fe-0x0;var _0x2b5c47=_0x7334[_0x2550fe];return _0x2b5c47;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x283754,_0x12cafa,_0x43d95c){return new BPromise(function(_0x8257cf,_0x3562b7){return client[_0x4733('0xb')](_0x283754,_0x43d95c)[_0x4733('0xc')](function(_0x2d5fde){logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,'request\x20sent');logger[_0x4733('0xf')](_0x4733('0x10'),_0x12cafa,'request\x20sent',JSON[_0x4733('0x11')](_0x2d5fde));if(_0x2d5fde['error']){if(_0x2d5fde[_0x4733('0x12')][_0x4733('0x13')]===0x1f4){logger[_0x4733('0x12')](_0x4733('0xe'),_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x3562b7(_0x2d5fde[_0x4733('0x12')]['message']);}logger[_0x4733('0x12')]('Automation,\x20%s,\x20%s',_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x8257cf(_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);}else{logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,_0x4733('0x15'));_0x8257cf(_0x2d5fde[_0x4733('0x16')][_0x4733('0x14')]);}})['catch'](function(_0x2c0031){logger[_0x4733('0x12')]('Automation,\x20%s,\x20%s',_0x12cafa,_0x2c0031);_0x3562b7(_0x2c0031);});});} \ No newline at end of file +var _0x29b1=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','info','message','catch','lodash','util','moment'];(function(_0x2fdb09,_0x182f57){var _0xd18537=function(_0x12b310){while(--_0x12b310){_0x2fdb09['push'](_0x2fdb09['shift']());}};_0xd18537(++_0x182f57);}(_0x29b1,0x16d));var _0x129b=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x29b1[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x129b('0x0'));var util=require(_0x129b('0x1'));var moment=require(_0x129b('0x2'));var BPromise=require(_0x129b('0x3'));var rs=require(_0x129b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x129b('0x5'))['db'];var utils=require(_0x129b('0x6'));var logger=require(_0x129b('0x7'))(_0x129b('0x8'));var config=require(_0x129b('0x9'));var jayson=require(_0x129b('0xa'));var client=jayson[_0x129b('0xb')][_0x129b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ce8f9,_0x3ef769,_0x5ac368){return new BPromise(function(_0x2c99a1,_0x1e29d6){return client['request'](_0x5ce8f9,_0x5ac368)[_0x129b('0xd')](function(_0x1abf45){logger['info'](_0x129b('0xe'),_0x3ef769,'request\x20sent');logger[_0x129b('0xf')](_0x129b('0x10'),_0x3ef769,_0x129b('0x11'),JSON['stringify'](_0x1abf45));if(_0x1abf45[_0x129b('0x12')]){if(_0x1abf45[_0x129b('0x12')][_0x129b('0x13')]===0x1f4){logger[_0x129b('0x12')]('Automation,\x20%s,\x20%s',_0x3ef769,_0x1abf45['error']['message']);return _0x1e29d6(_0x1abf45[_0x129b('0x12')]['message']);}logger[_0x129b('0x12')](_0x129b('0xe'),_0x3ef769,_0x1abf45[_0x129b('0x12')]['message']);return _0x2c99a1(_0x1abf45[_0x129b('0x12')]['message']);}else{logger[_0x129b('0x14')](_0x129b('0xe'),_0x3ef769,_0x129b('0x11'));_0x2c99a1(_0x1abf45['result'][_0x129b('0x15')]);}})[_0x129b('0x16')](function(_0x1364f8){logger[_0x129b('0x12')](_0x129b('0xe'),_0x3ef769,_0x1364f8);_0x1e29d6(_0x1364f8);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index afb7102..5cfcb5e 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 _0x635c=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','update','delete','destroy','exports'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x635c,0xa1));var _0xc635=function(_0x38a4a5,_0x151bc6){_0x38a4a5=_0x38a4a5-0x0;var _0x7daa9f=_0x635c[_0x38a4a5];return _0x7daa9f;};'use strict';var multer=require('multer');var util=require(_0xc635('0x0'));var path=require(_0xc635('0x1'));var timeout=require(_0xc635('0x2'));var express=require(_0xc635('0x3'));var router=express['Router']();var fs_extra=require(_0xc635('0x4'));var auth=require(_0xc635('0x5'));var interaction=require(_0xc635('0x6'));var config=require(_0xc635('0x7'));var controller=require(_0xc635('0x8'));router[_0xc635('0x9')]('/',auth[_0xc635('0xa')](),controller['index']);router[_0xc635('0x9')](_0xc635('0xb'),auth[_0xc635('0xa')](),controller['show']);router[_0xc635('0x9')](_0xc635('0xc'),auth[_0xc635('0xa')](),controller[_0xc635('0xd')]);router[_0xc635('0x9')](_0xc635('0xe'),auth[_0xc635('0xa')](),controller[_0xc635('0xf')]);router[_0xc635('0x10')]('/',auth[_0xc635('0xa')](),controller['create']);router[_0xc635('0x10')](_0xc635('0xc'),auth[_0xc635('0xa')](),controller[_0xc635('0x11')]);router['post'](_0xc635('0xe'),auth[_0xc635('0xa')](),controller[_0xc635('0x12')]);router['put']('/:id',auth[_0xc635('0xa')](),controller[_0xc635('0x13')]);router[_0xc635('0x14')](_0xc635('0xb'),auth[_0xc635('0xa')](),controller[_0xc635('0x15')]);module[_0xc635('0x16')]=router; \ No newline at end of file +var _0x8da5=['post','/:id/conditions','addConditions','put','update','delete','/:id','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/actions','getActions'];(function(_0x100560,_0x10ec86){var _0x232e71=function(_0x2ea0fb){while(--_0x2ea0fb){_0x100560['push'](_0x100560['shift']());}};_0x232e71(++_0x10ec86);}(_0x8da5,0x71));var _0x58da=function(_0xa59e57,_0x42541e){_0xa59e57=_0xa59e57-0x0;var _0x910287=_0x8da5[_0xa59e57];return _0x910287;};'use strict';var multer=require(_0x58da('0x0'));var util=require('util');var path=require(_0x58da('0x1'));var timeout=require('connect-timeout');var express=require(_0x58da('0x2'));var router=express[_0x58da('0x3')]();var fs_extra=require(_0x58da('0x4'));var auth=require(_0x58da('0x5'));var interaction=require(_0x58da('0x6'));var config=require(_0x58da('0x7'));var controller=require('./automation.controller');router[_0x58da('0x8')]('/',auth[_0x58da('0x9')](),controller[_0x58da('0xa')]);router[_0x58da('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x58da('0x8')]('/:id/conditions',auth['isAuthenticated'](),controller['getConditions']);router[_0x58da('0x8')](_0x58da('0xb'),auth[_0x58da('0x9')](),controller[_0x58da('0xc')]);router[_0x58da('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x58da('0xd')](_0x58da('0xe'),auth[_0x58da('0x9')](),controller[_0x58da('0xf')]);router[_0x58da('0xd')](_0x58da('0xb'),auth[_0x58da('0x9')](),controller['addActions']);router[_0x58da('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x58da('0x11')]);router[_0x58da('0x12')](_0x58da('0x13'),auth['isAuthenticated'](),controller[_0x58da('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 d54324d..a9166fb 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 _0x1c31=['#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,*,*,*','ENUM','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1c31,0x1a0));var _0x11c3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1c31[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x11c3('0x0'));module['exports']={'name':{'type':Sequelize[_0x11c3('0x1')],'unique':_0x11c3('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x11c3('0x3')),'allowNull':![],'defaultValue':_0x11c3('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x11c3('0x4')],'defaultValue':0x0,'comment':_0x11c3('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x11c3('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x11c3('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x11c3('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11c3('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x11c3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11c3('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11c3('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x11c3('0x7')](0x3)[_0x11c3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11c3('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x11c3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11c3('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x11c3('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x11c3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11c3('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x11c3('0x7')](0x3)[_0x11c3('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x11c3('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x11c3('0x1')],'defaultValue':_0x11c3('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x11c3('0x11')]('always',_0x11c3('0x12'),_0x11c3('0x13')),'defaultValue':_0x11c3('0x14')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x11c3('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x11c3('0x7')](0x9)[_0x11c3('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x11c3('0x16')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x11c3('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x11c3('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x11c3('0x7')](0x9)[_0x11c3('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x11c3('0x7')](0x9)[_0x11c3('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x11c3('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x11c3('0x7')](0x9)[_0x11c3('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x11c3('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x11c3('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x11c3('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x11c3('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x11c3('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x11c3('0x7')](0x5)[_0x11c3('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x11c3('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x11c3('0x7')](0x9)[_0x11c3('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x11c3('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x11c3('0x11')]('DESC',_0x11c3('0x1e')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x11c3('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x11c3('0x1f')},'dialCutDigit':{'type':Sequelize[_0x11c3('0x7')](0x3)[_0x11c3('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x11c3('0x7')](0x3)[_0x11c3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11c3('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x11c3('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11c3('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x11c3('0x7')](0x3)[_0x11c3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11c3('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x11c3('0x7')](0x5)[_0x11c3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11c3('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x11c3('0x7')](0x3)[_0x11c3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11c3('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x11c3('0x7')](0x5)[_0x11c3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x11c3('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11c3('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x11c3('0x7')](0x5)[_0x11c3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x11c3('0x7')](0x3)[_0x11c3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x11c3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11c3('0x26')}}; \ No newline at end of file +var _0xfb9d=['UNSIGNED','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER'];(function(_0x1672f3,_0x52d7ef){var _0x17b45d=function(_0x15ed9d){while(--_0x15ed9d){_0x1672f3['push'](_0x1672f3['shift']());}};_0x17b45d(++_0x52d7ef);}(_0xfb9d,0xcb));var _0xdfb9=function(_0x51eb73,_0x5d3197){_0x51eb73=_0x51eb73-0x0;var _0x28a4f8=_0xfb9d[_0x51eb73];return _0x28a4f8;};'use strict';var Sequelize=require(_0xdfb9('0x0'));module['exports']={'name':{'type':Sequelize[_0xdfb9('0x1')],'unique':_0xdfb9('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xdfb9('0x3')](_0xdfb9('0x4')),'allowNull':![],'defaultValue':_0xdfb9('0x4')},'description':{'type':Sequelize[_0xdfb9('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xdfb9('0x5')},'limitCalls':{'type':Sequelize[_0xdfb9('0x6')](0x4)[_0xdfb9('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xdfb9('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdfb9('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xdfb9('0x6')](0x3)[_0xdfb9('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xdfb9('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdfb9('0x6')](0x5)[_0xdfb9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdfb9('0x8')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdfb9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdfb9('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0xdfb9('0x6')](0x5)[_0xdfb9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdfb9('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdfb9('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xdfb9('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdfb9('0x6')](0x5)[_0xdfb9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdfb9('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xdfb9('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xdfb9('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdfb9('0x1')],'defaultValue':_0xdfb9('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xdfb9('0x3')](_0xdfb9('0xe'),_0xdfb9('0xf'),_0xdfb9('0x10')),'defaultValue':_0xdfb9('0xe')},'dialAMDActive':{'type':Sequelize[_0xdfb9('0x11')],'defaultValue':0x0,'comment':_0xdfb9('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xdfb9('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdfb9('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xdfb9('0x6')](0x9)[_0xdfb9('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdfb9('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdfb9('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdfb9('0x6')](0x9)[_0xdfb9('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdfb9('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xdfb9('0x6')](0x9)[_0xdfb9('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdfb9('0x6')](0x9)[_0xdfb9('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdfb9('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xdfb9('0x6')](0x9)[_0xdfb9('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xdfb9('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xdfb9('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdfb9('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdfb9('0x3')](_0xdfb9('0x19'),_0xdfb9('0x1a')),'defaultValue':_0xdfb9('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdfb9('0x6')](0x3)[_0xdfb9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdfb9('0x1b')},'dialCutDigit':{'type':Sequelize[_0xdfb9('0x6')](0x3)[_0xdfb9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdfb9('0x6')](0x3)[_0xdfb9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdfb9('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xdfb9('0x6')](0x5)[_0xdfb9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdfb9('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0xdfb9('0x6')](0x3)[_0xdfb9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xdfb9('0x6')](0x5)[_0xdfb9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdfb9('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdfb9('0x6')](0x3)[_0xdfb9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdfb9('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdfb9('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdfb9('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0xdfb9('0x6')](0x3)[_0xdfb9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xdfb9('0x6')](0x5)[_0xdfb9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdfb9('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdfb9('0x6')](0x3)[_0xdfb9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdfb9('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdfb9('0x6')](0x5)[_0xdfb9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index c018ec0..daee8b6 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 _0x4a4f=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','error','stack','name','index','map','Campaign','rawAttributes','query','keys','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','merge','includeAll','include','findAll','params','length','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','omit','createdAt','updatedAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','hasOwnProperty','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','rows','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','CmListId','cm_contacts','push','sequelize','all','removeLists','getBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x21cc4e,_0x24a7ac){var _0x3b7125=function(_0x1f37db){while(--_0x1f37db){_0x21cc4e['push'](_0x21cc4e['shift']());}};_0x3b7125(++_0x24a7ac);}(_0x4a4f,0x71));var _0xf4a4=function(_0x3f6778,_0x10ffb7){_0x3f6778=_0x3f6778-0x0;var _0x5546ed=_0x4a4f[_0x3f6778];return _0x5546ed;};'use strict';var emlformat=require(_0xf4a4('0x0'));var rimraf=require(_0xf4a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4a4('0x2'));var rp=require(_0xf4a4('0x3'));var moment=require(_0xf4a4('0x4'));var BPromise=require(_0xf4a4('0x5'));var Mustache=require(_0xf4a4('0x6'));var util=require('util');var path=require(_0xf4a4('0x7'));var sox=require('sox');var csv=require(_0xf4a4('0x8'));var ejs=require(_0xf4a4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4a4('0xa'));var squel=require(_0xf4a4('0xb'));var crypto=require('crypto');var jsforce=require(_0xf4a4('0xc'));var deskjs=require(_0xf4a4('0xd'));var toCsv=require(_0xf4a4('0x8'));var querystring=require(_0xf4a4('0xe'));var Papa=require(_0xf4a4('0xf'));var Redis=require(_0xf4a4('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf4a4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4a4('0x12'))(_0xf4a4('0x13'));var utils=require('../../config/utils');var config=require(_0xf4a4('0x14'));var licenseUtil=require(_0xf4a4('0x15'));var db=require(_0xf4a4('0x16'))['db'];function respondWithStatusCode(_0x4ac45e,_0x3a3510){_0x3a3510=_0x3a3510||0xcc;return function(_0x46075b){if(_0x46075b){return _0x4ac45e[_0xf4a4('0x17')](_0x3a3510);}return _0x4ac45e[_0xf4a4('0x18')](_0x3a3510)[_0xf4a4('0x19')]();};}function respondWithResult(_0x2dce2c,_0x5bc8ba){_0x5bc8ba=_0x5bc8ba||0xc8;return function(_0x4d3f39){if(_0x4d3f39){return _0x2dce2c[_0xf4a4('0x18')](_0x5bc8ba)['json'](_0x4d3f39);}};}function respondWithFilteredResult(_0x1bc583,_0x2b7c9b){return function(_0x4f0d35){if(_0x4f0d35){var _0x157b60=typeof _0x2b7c9b[_0xf4a4('0x1a')]===_0xf4a4('0x1b')&&typeof _0x2b7c9b['limit']==='undefined';var _0x32ca28=_0x4f0d35[_0xf4a4('0x1c')];var _0x5473c0=_0x157b60?0x0:_0x2b7c9b[_0xf4a4('0x1a')];var _0x1b8b03=_0x157b60?_0x4f0d35[_0xf4a4('0x1c')]:_0x2b7c9b[_0xf4a4('0x1a')]+_0x2b7c9b[_0xf4a4('0x1d')];var _0x55d8bf;if(_0x1b8b03>=_0x32ca28){_0x1b8b03=_0x32ca28;_0x55d8bf=0xc8;}else{_0x55d8bf=0xce;}_0x1bc583[_0xf4a4('0x18')](_0x55d8bf);return _0x1bc583[_0xf4a4('0x1e')](_0xf4a4('0x1f'),_0x5473c0+'-'+_0x1b8b03+'/'+_0x32ca28)[_0xf4a4('0x20')](_0x4f0d35);}return null;};}function patchUpdates(_0x4e8fec){return function(_0x325d1c){try{jsonpatch[_0xf4a4('0x21')](_0x325d1c,_0x4e8fec,!![]);}catch(_0x28f968){return BPromise['reject'](_0x28f968);}return _0x325d1c[_0xf4a4('0x22')]();};}function saveUpdates(_0x775e85,_0x33e9f8){return function(_0xd3a626){if(_0xd3a626){return _0xd3a626[_0xf4a4('0x23')](_0x775e85)['then'](function(_0x34a647){return _0x34a647;});}return null;};}function removeEntity(_0x40f068,_0xf48cb1){return function(_0x385bc0){if(_0x385bc0){return _0x385bc0[_0xf4a4('0x24')]()[_0xf4a4('0x25')](function(){var _0x2282f7=_0x385bc0[_0xf4a4('0x26')]({'plain':!![]});var _0x2c1ffc=_0xf4a4('0x27');return db[_0xf4a4('0x28')][_0xf4a4('0x24')]({'where':{'type':_0x2c1ffc,'resourceId':_0x2282f7['id']}})[_0xf4a4('0x25')](function(){return _0x385bc0;});})[_0xf4a4('0x25')](function(){_0x40f068[_0xf4a4('0x18')](0xcc)[_0xf4a4('0x19')]();});}};}function handleEntityNotFound(_0x348af3,_0x262f16){return function(_0x504e74){if(!_0x504e74){_0x348af3['sendStatus'](0x194);}return _0x504e74;};}function handleError(_0x2f785d,_0x223137){_0x223137=_0x223137||0x1f4;return function(_0x18a194){logger[_0xf4a4('0x29')](_0x18a194[_0xf4a4('0x2a')]);if(_0x18a194['name']){delete _0x18a194[_0xf4a4('0x2b')];}_0x2f785d[_0xf4a4('0x18')](_0x223137)['send'](_0x18a194);};}exports[_0xf4a4('0x2c')]=function(_0x183531,_0x36a50b){var _0xb01ef5={},_0x2be6c0={},_0xa3e891={'count':0x0,'rows':[]};var _0x43fafa=_[_0xf4a4('0x2d')](db[_0xf4a4('0x2e')][_0xf4a4('0x2f')],function(_0x402bac){return{'name':_0x402bac['fieldName'],'type':_0x402bac['type']['key']};});_0x2be6c0['model']=_[_0xf4a4('0x2d')](_0x43fafa,_0xf4a4('0x2b'));_0x2be6c0[_0xf4a4('0x30')]=_[_0xf4a4('0x31')](_0x183531[_0xf4a4('0x30')]);_0x2be6c0['filters']=_[_0xf4a4('0x32')](_0x2be6c0[_0xf4a4('0x33')],_0x2be6c0['query']);_0xb01ef5[_0xf4a4('0x34')]=_['intersection'](_0x2be6c0[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0x183531['query'][_0xf4a4('0x35')]));_0xb01ef5[_0xf4a4('0x34')]=_0xb01ef5[_0xf4a4('0x34')]['length']?_0xb01ef5[_0xf4a4('0x34')]:_0x2be6c0[_0xf4a4('0x33')];if(!_0x183531[_0xf4a4('0x30')]['hasOwnProperty'](_0xf4a4('0x36'))){_0xb01ef5[_0xf4a4('0x1d')]=qs['limit'](_0x183531[_0xf4a4('0x30')][_0xf4a4('0x1d')]);_0xb01ef5['offset']=qs[_0xf4a4('0x1a')](_0x183531[_0xf4a4('0x30')]['offset']);}_0xb01ef5[_0xf4a4('0x37')]=qs[_0xf4a4('0x38')](_0x183531[_0xf4a4('0x30')][_0xf4a4('0x38')]);_0xb01ef5[_0xf4a4('0x39')]=qs['filters'](_[_0xf4a4('0x3a')](_0x183531['query'],_0x2be6c0[_0xf4a4('0x3b')]),_0x43fafa);if(_0x183531['query'][_0xf4a4('0x3c')]){_0xb01ef5[_0xf4a4('0x39')]=_['merge'](_0xb01ef5['where'],{'$or':_[_0xf4a4('0x2d')](_0x43fafa,function(_0x2474d5){if(_0x2474d5[_0xf4a4('0x3d')]!==_0xf4a4('0x3e')){var _0x1f5ef1={};_0x1f5ef1[_0x2474d5[_0xf4a4('0x2b')]]={'$like':'%'+_0x183531['query'][_0xf4a4('0x3c')]+'%'};return _0x1f5ef1;}})});}_0xb01ef5=_[_0xf4a4('0x3f')]({},_0xb01ef5,_0x183531['options']);var _0x59da31={'where':_0xb01ef5[_0xf4a4('0x39')]};return db[_0xf4a4('0x2e')]['count'](_0x59da31)[_0xf4a4('0x25')](function(_0x6ad47f){_0xa3e891[_0xf4a4('0x1c')]=_0x6ad47f;if(_0x183531['query'][_0xf4a4('0x40')]){_0xb01ef5[_0xf4a4('0x41')]=[{'all':!![]}];}return db[_0xf4a4('0x2e')][_0xf4a4('0x42')](_0xb01ef5);})[_0xf4a4('0x25')](function(_0x11a8d6){_0xa3e891['rows']=_0x11a8d6;return _0xa3e891;})[_0xf4a4('0x25')](respondWithFilteredResult(_0x36a50b,_0xb01ef5))['catch'](handleError(_0x36a50b,null));};exports['show']=function(_0x2ba8ba,_0x8b9f37){var _0x383a76={'raw':![],'where':{'id':_0x2ba8ba[_0xf4a4('0x43')]['id']}},_0x14993f={};_0x14993f[_0xf4a4('0x33')]=_[_0xf4a4('0x31')](db[_0xf4a4('0x2e')][_0xf4a4('0x2f')]);_0x14993f[_0xf4a4('0x30')]=_['keys'](_0x2ba8ba[_0xf4a4('0x30')]);_0x14993f['filters']=_[_0xf4a4('0x32')](_0x14993f['model'],_0x14993f[_0xf4a4('0x30')]);_0x383a76['attributes']=_[_0xf4a4('0x32')](_0x14993f[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0x2ba8ba[_0xf4a4('0x30')][_0xf4a4('0x35')]));_0x383a76[_0xf4a4('0x34')]=_0x383a76[_0xf4a4('0x34')][_0xf4a4('0x44')]?_0x383a76['attributes']:_0x14993f[_0xf4a4('0x33')];if(_0x2ba8ba[_0xf4a4('0x30')][_0xf4a4('0x40')]){_0x383a76['include']=[{'all':!![]}];}_0x383a76=_[_0xf4a4('0x3f')]({},_0x383a76,_0x2ba8ba[_0xf4a4('0x45')]);return db[_0xf4a4('0x2e')][_0xf4a4('0x46')](_0x383a76)[_0xf4a4('0x25')](handleEntityNotFound(_0x8b9f37,null))[_0xf4a4('0x25')](respondWithResult(_0x8b9f37,null))[_0xf4a4('0x47')](handleError(_0x8b9f37,null));};exports[_0xf4a4('0x48')]=function(_0x4b6ee5,_0x2fe282){return db[_0xf4a4('0x2e')]['create'](_0x4b6ee5[_0xf4a4('0x49')],{})[_0xf4a4('0x25')](function(_0xc39e4d){var _0x5b6413=_0x4b6ee5[_0xf4a4('0x4a')][_0xf4a4('0x26')]({'plain':!![]});if(!_0x5b6413)throw new Error(_0xf4a4('0x4b'));if(_0x5b6413['role']===_0xf4a4('0x4a')){var _0x3903bd=_0xc39e4d['get']({'plain':!![]});var _0x5d31a5=_0xf4a4('0x27');return db[_0xf4a4('0x4c')][_0xf4a4('0x46')]({'where':{'name':_0x5d31a5,'userProfileId':_0x5b6413[_0xf4a4('0x4d')]},'raw':!![]})[_0xf4a4('0x25')](function(_0x4450da){if(_0x4450da&&_0x4450da[_0xf4a4('0x4e')]===0x0){return db[_0xf4a4('0x28')][_0xf4a4('0x48')]({'name':_0x3903bd['name'],'resourceId':_0x3903bd['id'],'type':_0x4450da[_0xf4a4('0x2b')],'sectionId':_0x4450da['id']},{})[_0xf4a4('0x25')](function(){return _0xc39e4d;});}else{return _0xc39e4d;}})['catch'](function(_0xaf8a0b){logger[_0xf4a4('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xaf8a0b);throw _0xaf8a0b;});}return _0xc39e4d;})[_0xf4a4('0x25')](respondWithResult(_0x2fe282,0xc9))['catch'](handleError(_0x2fe282,null));};exports['clone']=function(_0x321364,_0x25a12c){var _0x47f104={'where':{'id':_0x321364['params']['id']}},_0x1adee7={};_0x1adee7[_0xf4a4('0x33')]=_[_0xf4a4('0x31')](db[_0xf4a4('0x2e')][_0xf4a4('0x2f')]);_0x47f104['attributes']=_[_0xf4a4('0x32')](_0x1adee7[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0x321364[_0xf4a4('0x30')][_0xf4a4('0x35')]));_0x47f104[_0xf4a4('0x34')]=_0x47f104[_0xf4a4('0x34')][_0xf4a4('0x44')]?_0x47f104['attributes']:_0x1adee7[_0xf4a4('0x33')];if(_0x321364[_0xf4a4('0x30')][_0xf4a4('0x40')]){_0x47f104[_0xf4a4('0x41')]=[{'all':!![]}];}_0x47f104=_[_0xf4a4('0x3f')]({},_0x47f104,_0x321364['options']);return db[_0xf4a4('0x2e')][_0xf4a4('0x46')](_0x47f104)['then'](handleEntityNotFound(_0x25a12c,null))[_0xf4a4('0x25')](function(_0x3119bf){if(_0x3119bf){var _0x40fc53=_0x3119bf[_0xf4a4('0x26')]({'plain':!![]});_0x40fc53=qs[_0xf4a4('0x4f')](_0x40fc53,['id',_0xf4a4('0x50'),_0xf4a4('0x51')]);_0x321364['body']=_['omit'](_0x321364['body'],['id','createdAt',_0xf4a4('0x51')]);return db[_0xf4a4('0x2e')][_0xf4a4('0x48')](_[_0xf4a4('0x3f')](_0x40fc53,_0x321364[_0xf4a4('0x49')]),{'include':_0x321364[_0xf4a4('0x30')][_0xf4a4('0x40')]?[{'all':!![]}]:undefined})[_0xf4a4('0x25')](function(_0x5b5e9f){var _0x21f4a2=_0x321364[_0xf4a4('0x4a')][_0xf4a4('0x26')]({'plain':!![]});if(!_0x21f4a2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21f4a2[_0xf4a4('0x52')]===_0xf4a4('0x4a')){var _0x4c8712=_0x5b5e9f['get']({'plain':!![]});var _0x100de1='IvrCampaigns';return db[_0xf4a4('0x4c')][_0xf4a4('0x46')]({'where':{'name':_0x100de1,'userProfileId':_0x21f4a2[_0xf4a4('0x4d')]},'raw':!![]})[_0xf4a4('0x25')](function(_0x50f895){if(_0x50f895&&_0x50f895[_0xf4a4('0x4e')]===0x0){return db['UserProfileResource'][_0xf4a4('0x48')]({'name':_0x4c8712[_0xf4a4('0x2b')],'resourceId':_0x4c8712['id'],'type':_0x50f895[_0xf4a4('0x2b')],'sectionId':_0x50f895['id']},{})['then'](function(){return _0x5b5e9f;});}else{return _0x5b5e9f;}})['catch'](function(_0x3a2fd1){logger[_0xf4a4('0x29')](_0xf4a4('0x53'),_0x3a2fd1);throw _0x3a2fd1;});}return _0x5b5e9f;});}})[_0xf4a4('0x25')](respondWithResult(_0x25a12c,0xc9))[_0xf4a4('0x47')](handleError(_0x25a12c,null));};exports['update']=function(_0x5306cc,_0x25e045){if(_0x5306cc[_0xf4a4('0x49')]['id']){delete _0x5306cc[_0xf4a4('0x49')]['id'];}return db[_0xf4a4('0x2e')][_0xf4a4('0x46')]({'where':{'id':_0x5306cc[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x25e045,null))[_0xf4a4('0x25')](saveUpdates(_0x5306cc[_0xf4a4('0x49')],null))['then'](respondWithResult(_0x25e045,null))[_0xf4a4('0x47')](handleError(_0x25e045,null));};exports[_0xf4a4('0x24')]=function(_0x21abc2,_0x5ec908){return db[_0xf4a4('0x2e')][_0xf4a4('0x46')]({'where':{'id':_0x21abc2['params']['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x5ec908,null))['then'](removeEntity(_0x5ec908,null))[_0xf4a4('0x47')](handleError(_0x5ec908,null));};exports[_0xf4a4('0x54')]=function(_0x3f8e9e,_0x2b77b2,_0x37bd80){var _0x562305={'raw':!![],'where':{}};var _0x119740={};var _0x320cd9={'count':0x0,'rows':[]};return db['Campaign'][_0xf4a4('0x55')]({'where':{'id':_0x3f8e9e[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x2b77b2,null))[_0xf4a4('0x25')](function(_0x1c6efa){if(_0x1c6efa){_0x119740[_0xf4a4('0x33')]=_['keys'](db['CmHopper'][_0xf4a4('0x2f')]);_0x119740[_0xf4a4('0x30')]=_[_0xf4a4('0x31')](_0x3f8e9e[_0xf4a4('0x30')]);_0x119740[_0xf4a4('0x3b')]=_[_0xf4a4('0x32')](_0x119740[_0xf4a4('0x33')],_0x119740[_0xf4a4('0x30')]);_0x562305[_0xf4a4('0x34')]=_[_0xf4a4('0x32')](_0x119740[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0x3f8e9e['query'][_0xf4a4('0x35')]));_0x562305[_0xf4a4('0x34')]=_0x562305[_0xf4a4('0x34')][_0xf4a4('0x44')]?_0x562305[_0xf4a4('0x34')]:_0x119740[_0xf4a4('0x33')];if(!_0x3f8e9e[_0xf4a4('0x30')][_0xf4a4('0x56')](_0xf4a4('0x36'))){_0x562305[_0xf4a4('0x1d')]=qs[_0xf4a4('0x1d')](_0x3f8e9e[_0xf4a4('0x30')]['limit']);_0x562305[_0xf4a4('0x1a')]=qs[_0xf4a4('0x1a')](_0x3f8e9e[_0xf4a4('0x30')][_0xf4a4('0x1a')]);}_0x562305[_0xf4a4('0x37')]=qs[_0xf4a4('0x38')](_0x3f8e9e[_0xf4a4('0x30')][_0xf4a4('0x38')]);_0x562305[_0xf4a4('0x39')]=qs[_0xf4a4('0x3b')](_[_0xf4a4('0x3a')](_0x3f8e9e[_0xf4a4('0x30')],_0x119740[_0xf4a4('0x3b')]));_0x562305[_0xf4a4('0x39')][_0xf4a4('0x57')]=_0x1c6efa['id'];if(_0x3f8e9e[_0xf4a4('0x30')][_0xf4a4('0x3c')]){_0x562305['where']=_[_0xf4a4('0x3f')](_0x562305[_0xf4a4('0x39')],{'$or':_[_0xf4a4('0x2d')](_0x562305[_0xf4a4('0x34')],function(_0x327b2a){var _0x1167ea={};_0x1167ea[_0x327b2a]={'$like':'%'+_0x3f8e9e['query'][_0xf4a4('0x3c')]+'%'};return _0x1167ea;})});}_0x562305=_[_0xf4a4('0x3f')]({},_0x562305,_0x3f8e9e[_0xf4a4('0x45')]);return db[_0xf4a4('0x58')]['count']({'where':_0x562305[_0xf4a4('0x39')]})[_0xf4a4('0x25')](function(_0x447706){_0x320cd9[_0xf4a4('0x1c')]=_0x447706;if(_0x3f8e9e[_0xf4a4('0x30')]['includeAll']){_0x562305['include']=[{'all':!![]}];}return db[_0xf4a4('0x58')][_0xf4a4('0x42')](_0x562305);})[_0xf4a4('0x25')](function(_0x50c7bd){_0x320cd9['rows']=_0x50c7bd;return _0x320cd9;});}})['then'](respondWithFilteredResult(_0x2b77b2,_0x562305))['catch'](handleError(_0x2b77b2,null));};exports[_0xf4a4('0x59')]=function(_0x290624,_0x2e67a0,_0x3cb8d6){var _0x85a959={'raw':!![],'where':{}};var _0x276e32={};var _0x40a14c={'count':0x0,'rows':[]};return db[_0xf4a4('0x2e')][_0xf4a4('0x55')]({'where':{'id':_0x290624[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x2e67a0,null))[_0xf4a4('0x25')](function(_0x2cae52){if(_0x2cae52){_0x276e32[_0xf4a4('0x33')]=_[_0xf4a4('0x31')](db[_0xf4a4('0x5a')][_0xf4a4('0x2f')]);_0x276e32['query']=_[_0xf4a4('0x31')](_0x290624[_0xf4a4('0x30')]);_0x276e32[_0xf4a4('0x3b')]=_[_0xf4a4('0x32')](_0x276e32['model'],_0x276e32[_0xf4a4('0x30')]);_0x85a959[_0xf4a4('0x34')]=_[_0xf4a4('0x32')](_0x276e32[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0x290624[_0xf4a4('0x30')][_0xf4a4('0x35')]));_0x85a959['attributes']=_0x85a959[_0xf4a4('0x34')]['length']?_0x85a959[_0xf4a4('0x34')]:_0x276e32[_0xf4a4('0x33')];if(!_0x290624['query'][_0xf4a4('0x56')](_0xf4a4('0x36'))){_0x85a959[_0xf4a4('0x1d')]=qs[_0xf4a4('0x1d')](_0x290624[_0xf4a4('0x30')]['limit']);_0x85a959[_0xf4a4('0x1a')]=qs[_0xf4a4('0x1a')](_0x290624[_0xf4a4('0x30')][_0xf4a4('0x1a')]);}_0x85a959[_0xf4a4('0x37')]=qs[_0xf4a4('0x38')](_0x290624[_0xf4a4('0x30')]['sort']);_0x85a959[_0xf4a4('0x39')]=qs[_0xf4a4('0x3b')](_[_0xf4a4('0x3a')](_0x290624['query'],_0x276e32[_0xf4a4('0x3b')]));_0x85a959[_0xf4a4('0x39')][_0xf4a4('0x57')]=_0x2cae52['id'];if(_0x290624[_0xf4a4('0x30')]['filter']){_0x85a959[_0xf4a4('0x39')]=_[_0xf4a4('0x3f')](_0x85a959[_0xf4a4('0x39')],{'$or':_[_0xf4a4('0x2d')](_0x85a959[_0xf4a4('0x34')],function(_0x3f61a4){var _0x5bcc99={};_0x5bcc99[_0x3f61a4]={'$like':'%'+_0x290624[_0xf4a4('0x30')][_0xf4a4('0x3c')]+'%'};return _0x5bcc99;})});}_0x85a959=_['merge']({},_0x85a959,_0x290624[_0xf4a4('0x45')]);return db[_0xf4a4('0x5a')][_0xf4a4('0x1c')]({'where':_0x85a959[_0xf4a4('0x39')]})[_0xf4a4('0x25')](function(_0x12427a){_0x40a14c[_0xf4a4('0x1c')]=_0x12427a;if(_0x290624[_0xf4a4('0x30')][_0xf4a4('0x40')]){_0x85a959['include']=[{'all':!![]}];}return db[_0xf4a4('0x5a')]['findAll'](_0x85a959);})[_0xf4a4('0x25')](function(_0xae49df){_0x40a14c['rows']=_0xae49df;return _0x40a14c;});}})[_0xf4a4('0x25')](respondWithFilteredResult(_0x2e67a0,_0x85a959))[_0xf4a4('0x47')](handleError(_0x2e67a0,null));};exports['getHopperFinals']=function(_0x3e872e,_0x2ec432,_0x295843){var _0x2646fa={'raw':!![],'where':{}};var _0x4005f1={};var _0x16102a={'count':0x0,'rows':[]};return db[_0xf4a4('0x2e')]['findOne']({'where':{'id':_0x3e872e['params']['id']}})['then'](handleEntityNotFound(_0x2ec432,null))[_0xf4a4('0x25')](function(_0x69b45a){if(_0x69b45a){_0x4005f1[_0xf4a4('0x33')]=_[_0xf4a4('0x31')](db['CmHopperFinal'][_0xf4a4('0x2f')]);_0x4005f1[_0xf4a4('0x30')]=_[_0xf4a4('0x31')](_0x3e872e[_0xf4a4('0x30')]);_0x4005f1['filters']=_['intersection'](_0x4005f1[_0xf4a4('0x33')],_0x4005f1['query']);_0x2646fa[_0xf4a4('0x34')]=_['intersection'](_0x4005f1[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0x3e872e['query'][_0xf4a4('0x35')]));_0x2646fa[_0xf4a4('0x34')]=_0x2646fa[_0xf4a4('0x34')][_0xf4a4('0x44')]?_0x2646fa[_0xf4a4('0x34')]:_0x4005f1[_0xf4a4('0x33')];if(!_0x3e872e[_0xf4a4('0x30')][_0xf4a4('0x56')](_0xf4a4('0x36'))){_0x2646fa['limit']=qs[_0xf4a4('0x1d')](_0x3e872e[_0xf4a4('0x30')][_0xf4a4('0x1d')]);_0x2646fa['offset']=qs[_0xf4a4('0x1a')](_0x3e872e['query'][_0xf4a4('0x1a')]);}_0x2646fa['order']=qs['sort'](_0x3e872e['query'][_0xf4a4('0x38')]);_0x2646fa[_0xf4a4('0x39')]=qs['filters'](_[_0xf4a4('0x3a')](_0x3e872e[_0xf4a4('0x30')],_0x4005f1[_0xf4a4('0x3b')]));_0x2646fa[_0xf4a4('0x39')]['CampaignId']=_0x69b45a['id'];if(_0x3e872e[_0xf4a4('0x30')][_0xf4a4('0x3c')]){_0x2646fa['where']=_[_0xf4a4('0x3f')](_0x2646fa['where'],{'$or':_[_0xf4a4('0x2d')](_0x2646fa['attributes'],function(_0x1f5d4d){var _0x15f02a={};_0x15f02a[_0x1f5d4d]={'$like':'%'+_0x3e872e[_0xf4a4('0x30')]['filter']+'%'};return _0x15f02a;})});}_0x2646fa=_[_0xf4a4('0x3f')]({},_0x2646fa,_0x3e872e[_0xf4a4('0x45')]);return db[_0xf4a4('0x5b')]['count']({'where':_0x2646fa['where']})[_0xf4a4('0x25')](function(_0x41e2c0){_0x16102a['count']=_0x41e2c0;if(_0x3e872e[_0xf4a4('0x30')][_0xf4a4('0x40')]){_0x2646fa[_0xf4a4('0x41')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x2646fa);})[_0xf4a4('0x25')](function(_0x1785b5){_0x16102a[_0xf4a4('0x5c')]=_0x1785b5;return _0x16102a;});}})['then'](respondWithFilteredResult(_0x2ec432,_0x2646fa))[_0xf4a4('0x47')](handleError(_0x2ec432,null));};exports['getHopperBlacks']=function(_0x26ab64,_0x419e16,_0x215178){var _0x3e435e={'raw':!![],'where':{}};var _0xa462e9={};var _0x26cb36={'count':0x0,'rows':[]};return db['Campaign'][_0xf4a4('0x55')]({'where':{'id':_0x26ab64['params']['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x419e16,null))[_0xf4a4('0x25')](function(_0x12db4b){if(_0x12db4b){_0xa462e9[_0xf4a4('0x33')]=_['keys'](db[_0xf4a4('0x5d')][_0xf4a4('0x2f')]);_0xa462e9[_0xf4a4('0x30')]=_[_0xf4a4('0x31')](_0x26ab64[_0xf4a4('0x30')]);_0xa462e9['filters']=_[_0xf4a4('0x32')](_0xa462e9[_0xf4a4('0x33')],_0xa462e9[_0xf4a4('0x30')]);_0x3e435e[_0xf4a4('0x34')]=_[_0xf4a4('0x32')](_0xa462e9[_0xf4a4('0x33')],qs['fields'](_0x26ab64[_0xf4a4('0x30')][_0xf4a4('0x35')]));_0x3e435e[_0xf4a4('0x34')]=_0x3e435e[_0xf4a4('0x34')][_0xf4a4('0x44')]?_0x3e435e[_0xf4a4('0x34')]:_0xa462e9[_0xf4a4('0x33')];if(!_0x26ab64[_0xf4a4('0x30')][_0xf4a4('0x56')](_0xf4a4('0x36'))){_0x3e435e[_0xf4a4('0x1d')]=qs[_0xf4a4('0x1d')](_0x26ab64[_0xf4a4('0x30')]['limit']);_0x3e435e[_0xf4a4('0x1a')]=qs[_0xf4a4('0x1a')](_0x26ab64['query'][_0xf4a4('0x1a')]);}_0x3e435e[_0xf4a4('0x37')]=qs[_0xf4a4('0x38')](_0x26ab64['query'][_0xf4a4('0x38')]);_0x3e435e['where']=qs['filters'](_[_0xf4a4('0x3a')](_0x26ab64[_0xf4a4('0x30')],_0xa462e9[_0xf4a4('0x3b')]));_0x3e435e[_0xf4a4('0x39')][_0xf4a4('0x57')]=_0x12db4b['id'];if(_0x26ab64[_0xf4a4('0x30')][_0xf4a4('0x3c')]){_0x3e435e['where']=_[_0xf4a4('0x3f')](_0x3e435e[_0xf4a4('0x39')],{'$or':_[_0xf4a4('0x2d')](_0x3e435e[_0xf4a4('0x34')],function(_0x2a6775){var _0x49efd8={};_0x49efd8[_0x2a6775]={'$like':'%'+_0x26ab64['query'][_0xf4a4('0x3c')]+'%'};return _0x49efd8;})});}_0x3e435e=_[_0xf4a4('0x3f')]({},_0x3e435e,_0x26ab64[_0xf4a4('0x45')]);return db[_0xf4a4('0x5d')][_0xf4a4('0x1c')]({'where':_0x3e435e['where']})['then'](function(_0x13cc31){_0x26cb36[_0xf4a4('0x1c')]=_0x13cc31;if(_0x26ab64[_0xf4a4('0x30')][_0xf4a4('0x40')]){_0x3e435e[_0xf4a4('0x41')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xf4a4('0x42')](_0x3e435e);})['then'](function(_0x453f67){_0x26cb36[_0xf4a4('0x5c')]=_0x453f67;return _0x26cb36;});}})[_0xf4a4('0x25')](respondWithFilteredResult(_0x419e16,_0x3e435e))[_0xf4a4('0x47')](handleError(_0x419e16,null));};exports[_0xf4a4('0x5e')]=function(_0x5a4509,_0x46999b,_0x229bde){var _0x3b6750={};var _0x2cf6a1={};var _0x5c88e6;var _0x3b3ba;return db['Campaign'][_0xf4a4('0x55')]({'where':{'id':_0x5a4509[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x46999b,null))['then'](function(_0x5c404b){if(_0x5c404b){_0x5c88e6=_0x5c404b;_0x2cf6a1[_0xf4a4('0x33')]=_['keys'](db[_0xf4a4('0x5f')][_0xf4a4('0x2f')]);_0x2cf6a1[_0xf4a4('0x30')]=_[_0xf4a4('0x31')](_0x5a4509[_0xf4a4('0x30')]);_0x2cf6a1['filters']=_[_0xf4a4('0x32')](_0x2cf6a1['model'],_0x2cf6a1[_0xf4a4('0x30')]);_0x3b6750[_0xf4a4('0x34')]=_[_0xf4a4('0x32')](_0x2cf6a1[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0x5a4509['query'][_0xf4a4('0x35')]));_0x3b6750[_0xf4a4('0x34')]=_0x3b6750[_0xf4a4('0x34')][_0xf4a4('0x44')]?_0x3b6750[_0xf4a4('0x34')]:_0x2cf6a1[_0xf4a4('0x33')];_0x3b6750[_0xf4a4('0x37')]=qs[_0xf4a4('0x38')](_0x5a4509[_0xf4a4('0x30')][_0xf4a4('0x38')]);_0x3b6750[_0xf4a4('0x39')]=qs[_0xf4a4('0x3b')](_['pick'](_0x5a4509[_0xf4a4('0x30')],_0x2cf6a1['filters']));if(_0x5a4509[_0xf4a4('0x30')]['filter']){_0x3b6750[_0xf4a4('0x39')]=_['merge'](_0x3b6750[_0xf4a4('0x39')],{'$or':_[_0xf4a4('0x2d')](_0x3b6750[_0xf4a4('0x34')],function(_0x347768){var _0x533e6b={};_0x533e6b[_0x347768]={'$like':'%'+_0x5a4509[_0xf4a4('0x30')]['filter']+'%'};return _0x533e6b;})});}_0x3b6750=_[_0xf4a4('0x3f')]({},_0x3b6750,_0x5a4509[_0xf4a4('0x45')]);return _0x5c88e6[_0xf4a4('0x5e')](_0x3b6750);}})['then'](function(_0x2c1fd5){if(_0x2c1fd5){_0x3b3ba=_0x2c1fd5[_0xf4a4('0x44')];if(!_0x5a4509[_0xf4a4('0x30')][_0xf4a4('0x56')](_0xf4a4('0x36'))){_0x3b6750[_0xf4a4('0x1d')]=qs[_0xf4a4('0x1d')](_0x5a4509[_0xf4a4('0x30')][_0xf4a4('0x1d')]);_0x3b6750[_0xf4a4('0x1a')]=qs[_0xf4a4('0x1a')](_0x5a4509[_0xf4a4('0x30')][_0xf4a4('0x1a')]);}return _0x5c88e6[_0xf4a4('0x5e')](_0x3b6750);}})[_0xf4a4('0x25')](function(_0x506a46){if(_0x506a46){return _0x506a46?{'count':_0x3b3ba,'rows':_0x506a46}:null;}})['then'](respondWithResult(_0x46999b,null))[_0xf4a4('0x47')](handleError(_0x46999b,null));};exports[_0xf4a4('0x60')]=function(_0x9dbfa4,_0x26c334,_0x24b3a6){var _0x531f9c,_0x4a98ab;return db['Campaign'][_0xf4a4('0x46')]({'where':{'id':_0x9dbfa4[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x26c334,null))[_0xf4a4('0x25')](function(_0x35e2ef){if(_0x35e2ef){_0x4a98ab=_0x35e2ef;return _0x35e2ef[_0xf4a4('0x60')](_0x9dbfa4['body'][_0xf4a4('0x61')],_[_0xf4a4('0x4f')](_0x9dbfa4[_0xf4a4('0x49')],[_0xf4a4('0x61'),'id'])||{});}return null;})[_0xf4a4('0x62')](function(_0x3e9bd5){var _0x25bbbe;_0x531f9c=_0x3e9bd5||[];var _0x32b298=[];if(_0x3e9bd5){for(var _0xcfb159=0x0;_0xcfb159<_0x3e9bd5['length'];_0xcfb159+=0x1){var _0x36c674=_0x3e9bd5[_0xcfb159]['get']({'plain':!![]});_0x4a98ab[_0xf4a4('0x63')]=_0x9dbfa4[_0xf4a4('0x49')]['dialCheckDuplicateType']?_0x9dbfa4[_0xf4a4('0x49')]['dialCheckDuplicateType']:_0x4a98ab[_0xf4a4('0x63')];switch(_0x4a98ab[_0xf4a4('0x63')]){case _0xf4a4('0x64'):_0x25bbbe=squel[_0xf4a4('0x65')]()[_0xf4a4('0x66')](_0xf4a4('0x67'))[_0xf4a4('0x68')]([_0xf4a4('0x69'),_0xf4a4('0x6a'),_0xf4a4('0x6b'),_0xf4a4('0x6c'),_0xf4a4('0x57'),_0xf4a4('0x50'),_0xf4a4('0x51')],squel[_0xf4a4('0x6d')]()[_0xf4a4('0x6e')](_0xf4a4('0x69'),_0xf4a4('0x69'))[_0xf4a4('0x6e')](_0xf4a4('0x6f'),_0xf4a4('0x6a'))[_0xf4a4('0x6e')]('id',_0xf4a4('0x6b'))['field'](_0x36c674['CmListId'][_0xf4a4('0x70')](),_0xf4a4('0x6c'))['field'](_0x9dbfa4[_0xf4a4('0x43')]['id']['toString'](),_0xf4a4('0x57'))[_0xf4a4('0x6e')](_0xf4a4('0x6f'),_0xf4a4('0x50'))[_0xf4a4('0x6e')]('NOW()',_0xf4a4('0x51'))[_0xf4a4('0x71')]('cm_contacts')[_0xf4a4('0x39')](_0xf4a4('0x72'))[_0xf4a4('0x39')](_0xf4a4('0x73'),_0x36c674['CmListId']['toString']())[_0xf4a4('0x39')](_0xf4a4('0x74'))[_0xf4a4('0x39')](_0xf4a4('0x75'),squel[_0xf4a4('0x6d')]()['field'](_0xf4a4('0x76'))['from'](_0xf4a4('0x77'))[_0xf4a4('0x39')](_0xf4a4('0x78'),_0x9dbfa4[_0xf4a4('0x43')]['id']['toString']()))[_0xf4a4('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf4a4('0x6d')]()[_0xf4a4('0x6e')](_0xf4a4('0x79'))[_0xf4a4('0x71')](_0xf4a4('0x67'))['where']('CampaignId\x20=\x20?',_0x9dbfa4['params']['id'][_0xf4a4('0x70')]())))[_0xf4a4('0x70')]();break;case _0xf4a4('0x7a'):_0x25bbbe=squel[_0xf4a4('0x65')]()[_0xf4a4('0x66')](_0xf4a4('0x67'))[_0xf4a4('0x68')]([_0xf4a4('0x69'),'scheduledAt',_0xf4a4('0x6b'),_0xf4a4('0x6c'),_0xf4a4('0x57'),_0xf4a4('0x50'),_0xf4a4('0x51')],squel[_0xf4a4('0x6d')]()[_0xf4a4('0x6e')]('phone','phone')[_0xf4a4('0x6e')](_0xf4a4('0x6f'),_0xf4a4('0x6a'))[_0xf4a4('0x6e')]('id',_0xf4a4('0x6b'))['field'](_0x36c674[_0xf4a4('0x7b')][_0xf4a4('0x70')](),_0xf4a4('0x6c'))[_0xf4a4('0x6e')](_0x9dbfa4['params']['id'][_0xf4a4('0x70')](),_0xf4a4('0x57'))[_0xf4a4('0x6e')](_0xf4a4('0x6f'),_0xf4a4('0x50'))[_0xf4a4('0x6e')](_0xf4a4('0x6f'),_0xf4a4('0x51'))[_0xf4a4('0x71')](_0xf4a4('0x7c'))[_0xf4a4('0x39')]('deletedAt\x20IS\x20NULL')[_0xf4a4('0x39')](_0xf4a4('0x73'),_0x36c674['CmListId'][_0xf4a4('0x70')]())[_0xf4a4('0x39')](_0xf4a4('0x74'))[_0xf4a4('0x39')](_0xf4a4('0x75'),squel[_0xf4a4('0x6d')]()[_0xf4a4('0x6e')]('COALESCE(phone,\x27\x27)')[_0xf4a4('0x71')](_0xf4a4('0x67'))[_0xf4a4('0x39')]('CampaignId\x20=\x20?',_0x9dbfa4['params']['id'][_0xf4a4('0x70')]())))[_0xf4a4('0x70')]();break;default:_0x25bbbe=squel[_0xf4a4('0x65')]()['into'](_0xf4a4('0x67'))[_0xf4a4('0x68')]([_0xf4a4('0x69'),_0xf4a4('0x6a'),_0xf4a4('0x6b'),_0xf4a4('0x6c'),'CampaignId',_0xf4a4('0x50'),_0xf4a4('0x51')],squel[_0xf4a4('0x6d')]()['field']('phone',_0xf4a4('0x69'))[_0xf4a4('0x6e')](_0xf4a4('0x6f'),_0xf4a4('0x6a'))[_0xf4a4('0x6e')]('id','ContactId')[_0xf4a4('0x6e')](_0x36c674['CmListId']['toString'](),_0xf4a4('0x6c'))[_0xf4a4('0x6e')](_0x9dbfa4[_0xf4a4('0x43')]['id'][_0xf4a4('0x70')](),'CampaignId')[_0xf4a4('0x6e')]('NOW()',_0xf4a4('0x50'))[_0xf4a4('0x6e')](_0xf4a4('0x6f'),_0xf4a4('0x51'))[_0xf4a4('0x71')](_0xf4a4('0x7c'))[_0xf4a4('0x39')]('deletedAt\x20IS\x20NULL')['where'](_0xf4a4('0x73'),_0x36c674[_0xf4a4('0x7b')][_0xf4a4('0x70')]())[_0xf4a4('0x39')](_0xf4a4('0x74')))['toString']();}_0x32b298[_0xf4a4('0x7d')](db[_0xf4a4('0x7e')][_0xf4a4('0x30')](_0x25bbbe));}return BPromise[_0xf4a4('0x7f')](_0x32b298);}})[_0xf4a4('0x25')](function(){return _0x531f9c;})[_0xf4a4('0x25')](respondWithResult(_0x26c334,null))[_0xf4a4('0x47')](handleError(_0x26c334,null));};exports[_0xf4a4('0x80')]=function(_0x570cd4,_0x3eee73,_0x51f8ad){return db[_0xf4a4('0x2e')]['find']({'where':{'id':_0x570cd4['params']['id']}})['then'](handleEntityNotFound(_0x3eee73,null))['then'](function(_0x2d29ca){if(_0x2d29ca){return _0x2d29ca['removeLists'](_0x570cd4['query'][_0xf4a4('0x61')]);}})['then'](function(_0x2b15de){if(_0x2b15de){return db[_0xf4a4('0x58')][_0xf4a4('0x24')]({'where':{'ListId':_0x570cd4[_0xf4a4('0x30')]['ids'],'CampaignId':_0x570cd4[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](function(){return _0x2b15de;});}})[_0xf4a4('0x25')](respondWithStatusCode(_0x3eee73,null))['catch'](handleError(_0x3eee73,null));};exports[_0xf4a4('0x81')]=function(_0xe51cfe,_0x4e9dfe,_0x1194fb){var _0x8c0ab7={};var _0x4fcd09={};var _0x2febb;var _0x5cb703;return db['Campaign']['findOne']({'where':{'id':_0xe51cfe[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x4e9dfe,null))['then'](function(_0x4a61d2){if(_0x4a61d2){_0x2febb=_0x4a61d2;_0x4fcd09[_0xf4a4('0x33')]=_['keys'](db[_0xf4a4('0x5f')]['rawAttributes']);_0x4fcd09[_0xf4a4('0x30')]=_[_0xf4a4('0x31')](_0xe51cfe['query']);_0x4fcd09[_0xf4a4('0x3b')]=_[_0xf4a4('0x32')](_0x4fcd09['model'],_0x4fcd09[_0xf4a4('0x30')]);_0x8c0ab7[_0xf4a4('0x34')]=_[_0xf4a4('0x32')](_0x4fcd09[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0xe51cfe[_0xf4a4('0x30')][_0xf4a4('0x35')]));_0x8c0ab7[_0xf4a4('0x34')]=_0x8c0ab7[_0xf4a4('0x34')][_0xf4a4('0x44')]?_0x8c0ab7[_0xf4a4('0x34')]:_0x4fcd09['model'];_0x8c0ab7[_0xf4a4('0x37')]=qs[_0xf4a4('0x38')](_0xe51cfe['query'][_0xf4a4('0x38')]);_0x8c0ab7[_0xf4a4('0x39')]=qs['filters'](_['pick'](_0xe51cfe[_0xf4a4('0x30')],_0x4fcd09[_0xf4a4('0x3b')]));if(_0xe51cfe['query'][_0xf4a4('0x3c')]){_0x8c0ab7['where']=_['merge'](_0x8c0ab7['where'],{'$or':_[_0xf4a4('0x2d')](_0x8c0ab7[_0xf4a4('0x34')],function(_0x3db656){var _0x31b6b2={};_0x31b6b2[_0x3db656]={'$like':'%'+_0xe51cfe[_0xf4a4('0x30')][_0xf4a4('0x3c')]+'%'};return _0x31b6b2;})});}_0x8c0ab7=_['merge']({},_0x8c0ab7,_0xe51cfe['options']);return _0x2febb['getBlackLists'](_0x8c0ab7);}})[_0xf4a4('0x25')](function(_0x12a08e){if(_0x12a08e){_0x5cb703=_0x12a08e[_0xf4a4('0x44')];if(!_0xe51cfe[_0xf4a4('0x30')]['hasOwnProperty'](_0xf4a4('0x36'))){_0x8c0ab7[_0xf4a4('0x1d')]=qs[_0xf4a4('0x1d')](_0xe51cfe[_0xf4a4('0x30')]['limit']);_0x8c0ab7['offset']=qs[_0xf4a4('0x1a')](_0xe51cfe['query'][_0xf4a4('0x1a')]);}return _0x2febb[_0xf4a4('0x81')](_0x8c0ab7);}})['then'](function(_0x3e138e){if(_0x3e138e){return _0x3e138e?{'count':_0x5cb703,'rows':_0x3e138e}:null;}})[_0xf4a4('0x25')](respondWithResult(_0x4e9dfe,null))[_0xf4a4('0x47')](handleError(_0x4e9dfe,null));};exports['addBlackLists']=function(_0x18c74a,_0x9b9e41,_0x506f46){var _0x3a17c0,_0x1656e6;return db[_0xf4a4('0x2e')]['find']({'where':{'id':_0x18c74a[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x9b9e41,null))[_0xf4a4('0x25')](function(_0x5a0d76){if(_0x5a0d76){_0x1656e6=_0x5a0d76;return _0x5a0d76['addBlackLists'](_0x18c74a[_0xf4a4('0x49')][_0xf4a4('0x61')],_[_0xf4a4('0x4f')](_0x18c74a['body'],[_0xf4a4('0x61'),'id'])||{});}return null;})[_0xf4a4('0x62')](function(_0x42b022){var _0x1ab53c;_0x3a17c0=_0x42b022||[];var _0xc2ccdc=[];if(_0x42b022){for(var _0x12790a=0x0;_0x12790a<_0x42b022[_0xf4a4('0x44')];_0x12790a+=0x1){var _0x5c95b0=_0x42b022[_0x12790a]['get']({'plain':!![]});_0x1ab53c=squel[_0xf4a4('0x65')]()['into'](_0xf4a4('0x82'))['fromQuery'](['phone',_0xf4a4('0x6b'),_0xf4a4('0x6c'),_0xf4a4('0x57'),'createdAt',_0xf4a4('0x51')],squel['select']()[_0xf4a4('0x6e')](_0xf4a4('0x69'),'phone')[_0xf4a4('0x6e')]('id',_0xf4a4('0x6b'))[_0xf4a4('0x6e')](_0x5c95b0[_0xf4a4('0x7b')][_0xf4a4('0x70')](),_0xf4a4('0x6c'))[_0xf4a4('0x6e')](_0x18c74a[_0xf4a4('0x43')]['id'][_0xf4a4('0x70')](),_0xf4a4('0x57'))[_0xf4a4('0x6e')](_0xf4a4('0x6f'),'createdAt')['field'](_0xf4a4('0x6f'),_0xf4a4('0x51'))[_0xf4a4('0x71')]('cm_contacts')[_0xf4a4('0x39')](_0xf4a4('0x72'))['where'](_0xf4a4('0x73'),_0x5c95b0[_0xf4a4('0x7b')][_0xf4a4('0x70')]())[_0xf4a4('0x39')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0xc2ccdc[_0xf4a4('0x7d')](db[_0xf4a4('0x7e')]['query'](_0x1ab53c));}return BPromise[_0xf4a4('0x7f')](_0xc2ccdc);}})[_0xf4a4('0x25')](function(){return _0x3a17c0;})[_0xf4a4('0x25')](respondWithResult(_0x9b9e41,null))['catch'](handleError(_0x9b9e41,null));};exports[_0xf4a4('0x83')]=function(_0x136cba,_0x4913c4,_0x327eac){return db['Campaign'][_0xf4a4('0x46')]({'where':{'id':_0x136cba[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x4913c4,null))[_0xf4a4('0x25')](function(_0x45a2c9){if(_0x45a2c9){return _0x45a2c9[_0xf4a4('0x83')](_0x136cba[_0xf4a4('0x30')][_0xf4a4('0x61')]);}})[_0xf4a4('0x25')](function(_0x46df67){if(_0x46df67){return db['CmHopperBlack'][_0xf4a4('0x24')]({'where':{'ListId':_0x136cba['query'][_0xf4a4('0x61')],'CampaignId':_0x136cba[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](function(){return _0x46df67;});}})[_0xf4a4('0x25')](respondWithStatusCode(_0x4913c4,null))['catch'](handleError(_0x4913c4,null));}; \ No newline at end of file +var _0x9273=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','then','get','IvrCampaigns','UserProfileResource','destroy','stack','name','map','Campaign','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','UserProfileSection','getHoppers','findOne','CampaignId','CmHopper','findAll','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','NOW()','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','deletedAt\x20IS\x20NULL','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','spread','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x1f2c38,_0x383860){var _0x1a05b2=function(_0x56c3a3){while(--_0x56c3a3){_0x1f2c38['push'](_0x1f2c38['shift']());}};_0x1a05b2(++_0x383860);}(_0x9273,0x183));var _0x3927=function(_0x5e5a3b,_0x4891a2){_0x5e5a3b=_0x5e5a3b-0x0;var _0x35b67d=_0x9273[_0x5e5a3b];return _0x35b67d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3927('0x0'));var zipdir=require(_0x3927('0x1'));var jsonpatch=require(_0x3927('0x2'));var rp=require(_0x3927('0x3'));var moment=require(_0x3927('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3927('0x5'));var util=require(_0x3927('0x6'));var path=require(_0x3927('0x7'));var sox=require(_0x3927('0x8'));var csv=require(_0x3927('0x9'));var ejs=require(_0x3927('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3927('0xb'));var squel=require(_0x3927('0xc'));var crypto=require(_0x3927('0xd'));var jsforce=require(_0x3927('0xe'));var deskjs=require(_0x3927('0xf'));var toCsv=require(_0x3927('0x9'));var querystring=require(_0x3927('0x10'));var Papa=require('papaparse');var Redis=require(_0x3927('0x11'));var authService=require(_0x3927('0x12'));var qs=require(_0x3927('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3927('0x14'));var utils=require(_0x3927('0x15'));var config=require(_0x3927('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3927('0x17'))['db'];function respondWithStatusCode(_0x3fdbcc,_0x4dd9fc){_0x4dd9fc=_0x4dd9fc||0xcc;return function(_0x355ac5){if(_0x355ac5){return _0x3fdbcc[_0x3927('0x18')](_0x4dd9fc);}return _0x3fdbcc['status'](_0x4dd9fc)[_0x3927('0x19')]();};}function respondWithResult(_0x302e29,_0x45c7be){_0x45c7be=_0x45c7be||0xc8;return function(_0x44b797){if(_0x44b797){return _0x302e29[_0x3927('0x1a')](_0x45c7be)['json'](_0x44b797);}};}function respondWithFilteredResult(_0x119896,_0x216295){return function(_0x1c1dd9){if(_0x1c1dd9){var _0x52dc0f=typeof _0x216295['offset']===_0x3927('0x1b')&&typeof _0x216295[_0x3927('0x1c')]===_0x3927('0x1b');var _0x29bf8c=_0x1c1dd9[_0x3927('0x1d')];var _0x2902de=_0x52dc0f?0x0:_0x216295[_0x3927('0x1e')];var _0x55ee7f=_0x52dc0f?_0x1c1dd9[_0x3927('0x1d')]:_0x216295[_0x3927('0x1e')]+_0x216295[_0x3927('0x1c')];var _0x588525;if(_0x55ee7f>=_0x29bf8c){_0x55ee7f=_0x29bf8c;_0x588525=0xc8;}else{_0x588525=0xce;}_0x119896['status'](_0x588525);return _0x119896[_0x3927('0x1f')](_0x3927('0x20'),_0x2902de+'-'+_0x55ee7f+'/'+_0x29bf8c)['json'](_0x1c1dd9);}return null;};}function patchUpdates(_0x2192a2){return function(_0x5d1645){try{jsonpatch[_0x3927('0x21')](_0x5d1645,_0x2192a2,!![]);}catch(_0x101005){return BPromise[_0x3927('0x22')](_0x101005);}return _0x5d1645['save']();};}function saveUpdates(_0x1c93d8,_0x1d173b){return function(_0x5c4110){if(_0x5c4110){return _0x5c4110['update'](_0x1c93d8)['then'](function(_0x5e63dd){return _0x5e63dd;});}return null;};}function removeEntity(_0x3b3ad1,_0x447f4e){return function(_0x34a357){if(_0x34a357){return _0x34a357['destroy']()[_0x3927('0x23')](function(){var _0x1e8927=_0x34a357[_0x3927('0x24')]({'plain':!![]});var _0x233ab7=_0x3927('0x25');return db[_0x3927('0x26')][_0x3927('0x27')]({'where':{'type':_0x233ab7,'resourceId':_0x1e8927['id']}})[_0x3927('0x23')](function(){return _0x34a357;});})[_0x3927('0x23')](function(){_0x3b3ad1[_0x3927('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47ad45,_0x4d59c0){return function(_0x277580){if(!_0x277580){_0x47ad45[_0x3927('0x18')](0x194);}return _0x277580;};}function handleError(_0x3c7883,_0x304cd2){_0x304cd2=_0x304cd2||0x1f4;return function(_0x425155){logger['error'](_0x425155[_0x3927('0x28')]);if(_0x425155[_0x3927('0x29')]){delete _0x425155['name'];}_0x3c7883['status'](_0x304cd2)['send'](_0x425155);};}exports['index']=function(_0x19999b,_0x5b91b7){var _0x559c97={},_0x487458={},_0x101323={'count':0x0,'rows':[]};var _0x4893ab=_[_0x3927('0x2a')](db[_0x3927('0x2b')][_0x3927('0x2c')],function(_0x2fd23b){return{'name':_0x2fd23b[_0x3927('0x2d')],'type':_0x2fd23b[_0x3927('0x2e')]['key']};});_0x487458[_0x3927('0x2f')]=_['map'](_0x4893ab,'name');_0x487458[_0x3927('0x30')]=_['keys'](_0x19999b['query']);_0x487458[_0x3927('0x31')]=_[_0x3927('0x32')](_0x487458[_0x3927('0x2f')],_0x487458[_0x3927('0x30')]);_0x559c97[_0x3927('0x33')]=_[_0x3927('0x32')](_0x487458[_0x3927('0x2f')],qs[_0x3927('0x34')](_0x19999b[_0x3927('0x30')][_0x3927('0x34')]));_0x559c97[_0x3927('0x33')]=_0x559c97[_0x3927('0x33')][_0x3927('0x35')]?_0x559c97['attributes']:_0x487458[_0x3927('0x2f')];if(!_0x19999b['query'][_0x3927('0x36')](_0x3927('0x37'))){_0x559c97[_0x3927('0x1c')]=qs[_0x3927('0x1c')](_0x19999b[_0x3927('0x30')][_0x3927('0x1c')]);_0x559c97[_0x3927('0x1e')]=qs[_0x3927('0x1e')](_0x19999b[_0x3927('0x30')]['offset']);}_0x559c97[_0x3927('0x38')]=qs[_0x3927('0x39')](_0x19999b[_0x3927('0x30')][_0x3927('0x39')]);_0x559c97['where']=qs['filters'](_[_0x3927('0x3a')](_0x19999b[_0x3927('0x30')],_0x487458[_0x3927('0x31')]),_0x4893ab);if(_0x19999b['query'][_0x3927('0x3b')]){_0x559c97[_0x3927('0x3c')]=_[_0x3927('0x3d')](_0x559c97[_0x3927('0x3c')],{'$or':_[_0x3927('0x2a')](_0x4893ab,function(_0x350aa3){if(_0x350aa3[_0x3927('0x2e')]!==_0x3927('0x3e')){var _0x3f4de1={};_0x3f4de1[_0x350aa3[_0x3927('0x29')]]={'$like':'%'+_0x19999b[_0x3927('0x30')][_0x3927('0x3b')]+'%'};return _0x3f4de1;}})});}_0x559c97=_[_0x3927('0x3d')]({},_0x559c97,_0x19999b[_0x3927('0x3f')]);var _0x29accf={'where':_0x559c97[_0x3927('0x3c')]};return db[_0x3927('0x2b')][_0x3927('0x1d')](_0x29accf)[_0x3927('0x23')](function(_0x7b8865){_0x101323[_0x3927('0x1d')]=_0x7b8865;if(_0x19999b[_0x3927('0x30')][_0x3927('0x40')]){_0x559c97[_0x3927('0x41')]=[{'all':!![]}];}return db[_0x3927('0x2b')]['findAll'](_0x559c97);})[_0x3927('0x23')](function(_0x1c684a){_0x101323['rows']=_0x1c684a;return _0x101323;})[_0x3927('0x23')](respondWithFilteredResult(_0x5b91b7,_0x559c97))[_0x3927('0x42')](handleError(_0x5b91b7,null));};exports[_0x3927('0x43')]=function(_0x1c2162,_0x559db1){var _0x7f9059={'raw':![],'where':{'id':_0x1c2162[_0x3927('0x44')]['id']}},_0x915a8a={};_0x915a8a[_0x3927('0x2f')]=_[_0x3927('0x45')](db[_0x3927('0x2b')]['rawAttributes']);_0x915a8a[_0x3927('0x30')]=_[_0x3927('0x45')](_0x1c2162['query']);_0x915a8a[_0x3927('0x31')]=_[_0x3927('0x32')](_0x915a8a[_0x3927('0x2f')],_0x915a8a[_0x3927('0x30')]);_0x7f9059[_0x3927('0x33')]=_[_0x3927('0x32')](_0x915a8a[_0x3927('0x2f')],qs['fields'](_0x1c2162[_0x3927('0x30')][_0x3927('0x34')]));_0x7f9059['attributes']=_0x7f9059[_0x3927('0x33')]['length']?_0x7f9059[_0x3927('0x33')]:_0x915a8a[_0x3927('0x2f')];if(_0x1c2162[_0x3927('0x30')]['includeAll']){_0x7f9059[_0x3927('0x41')]=[{'all':!![]}];}_0x7f9059=_[_0x3927('0x3d')]({},_0x7f9059,_0x1c2162[_0x3927('0x3f')]);return db['Campaign'][_0x3927('0x46')](_0x7f9059)[_0x3927('0x23')](handleEntityNotFound(_0x559db1,null))[_0x3927('0x23')](respondWithResult(_0x559db1,null))[_0x3927('0x42')](handleError(_0x559db1,null));};exports[_0x3927('0x47')]=function(_0x4b3084,_0x5316eb){return db['Campaign']['create'](_0x4b3084[_0x3927('0x48')],{})['then'](function(_0x336bbc){var _0x430685=_0x4b3084['user'][_0x3927('0x24')]({'plain':!![]});if(!_0x430685)throw new Error(_0x3927('0x49'));if(_0x430685[_0x3927('0x4a')]===_0x3927('0x4b')){var _0x4d94f5=_0x336bbc[_0x3927('0x24')]({'plain':!![]});var _0x2e5812=_0x3927('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x2e5812,'userProfileId':_0x430685[_0x3927('0x4c')]},'raw':!![]})[_0x3927('0x23')](function(_0x178bdd){if(_0x178bdd&&_0x178bdd[_0x3927('0x4d')]===0x0){return db['UserProfileResource'][_0x3927('0x47')]({'name':_0x4d94f5[_0x3927('0x29')],'resourceId':_0x4d94f5['id'],'type':_0x178bdd[_0x3927('0x29')],'sectionId':_0x178bdd['id']},{})['then'](function(){return _0x336bbc;});}else{return _0x336bbc;}})[_0x3927('0x42')](function(_0x9d4103){logger[_0x3927('0x4e')](_0x3927('0x4f'),_0x9d4103);throw _0x9d4103;});}return _0x336bbc;})[_0x3927('0x23')](respondWithResult(_0x5316eb,0xc9))[_0x3927('0x42')](handleError(_0x5316eb,null));};exports['clone']=function(_0x24eb29,_0x52369c){var _0x414aa1={'where':{'id':_0x24eb29[_0x3927('0x44')]['id']}},_0x1e51cc={};_0x1e51cc[_0x3927('0x2f')]=_['keys'](db['Campaign'][_0x3927('0x2c')]);_0x414aa1[_0x3927('0x33')]=_[_0x3927('0x32')](_0x1e51cc[_0x3927('0x2f')],qs['fields'](_0x24eb29['query'][_0x3927('0x34')]));_0x414aa1[_0x3927('0x33')]=_0x414aa1[_0x3927('0x33')][_0x3927('0x35')]?_0x414aa1[_0x3927('0x33')]:_0x1e51cc[_0x3927('0x2f')];if(_0x24eb29[_0x3927('0x30')][_0x3927('0x40')]){_0x414aa1[_0x3927('0x41')]=[{'all':!![]}];}_0x414aa1=_[_0x3927('0x3d')]({},_0x414aa1,_0x24eb29['options']);return db[_0x3927('0x2b')][_0x3927('0x46')](_0x414aa1)[_0x3927('0x23')](handleEntityNotFound(_0x52369c,null))['then'](function(_0x18a3ce){if(_0x18a3ce){var _0x5f5cda=_0x18a3ce[_0x3927('0x24')]({'plain':!![]});_0x5f5cda=qs[_0x3927('0x50')](_0x5f5cda,['id',_0x3927('0x51'),_0x3927('0x52')]);_0x24eb29[_0x3927('0x48')]=_['omit'](_0x24eb29[_0x3927('0x48')],['id',_0x3927('0x51'),_0x3927('0x52')]);return db[_0x3927('0x2b')][_0x3927('0x47')](_[_0x3927('0x3d')](_0x5f5cda,_0x24eb29['body']),{'include':_0x24eb29[_0x3927('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x3927('0x23')](function(_0x270544){var _0x587331=_0x24eb29[_0x3927('0x4b')][_0x3927('0x24')]({'plain':!![]});if(!_0x587331)throw new Error(_0x3927('0x49'));if(_0x587331['role']===_0x3927('0x4b')){var _0x2fd33c=_0x270544[_0x3927('0x24')]({'plain':!![]});var _0x488cd1=_0x3927('0x25');return db[_0x3927('0x53')]['find']({'where':{'name':_0x488cd1,'userProfileId':_0x587331[_0x3927('0x4c')]},'raw':!![]})[_0x3927('0x23')](function(_0xeb7125){if(_0xeb7125&&_0xeb7125[_0x3927('0x4d')]===0x0){return db[_0x3927('0x26')][_0x3927('0x47')]({'name':_0x2fd33c[_0x3927('0x29')],'resourceId':_0x2fd33c['id'],'type':_0xeb7125['name'],'sectionId':_0xeb7125['id']},{})[_0x3927('0x23')](function(){return _0x270544;});}else{return _0x270544;}})[_0x3927('0x42')](function(_0x37ace4){logger[_0x3927('0x4e')](_0x3927('0x4f'),_0x37ace4);throw _0x37ace4;});}return _0x270544;});}})['then'](respondWithResult(_0x52369c,0xc9))['catch'](handleError(_0x52369c,null));};exports['update']=function(_0x23064f,_0x244969){if(_0x23064f[_0x3927('0x48')]['id']){delete _0x23064f[_0x3927('0x48')]['id'];}return db['Campaign'][_0x3927('0x46')]({'where':{'id':_0x23064f[_0x3927('0x44')]['id']}})['then'](handleEntityNotFound(_0x244969,null))[_0x3927('0x23')](saveUpdates(_0x23064f[_0x3927('0x48')],null))[_0x3927('0x23')](respondWithResult(_0x244969,null))[_0x3927('0x42')](handleError(_0x244969,null));};exports['destroy']=function(_0x1484a7,_0x3f56e3){return db[_0x3927('0x2b')][_0x3927('0x46')]({'where':{'id':_0x1484a7[_0x3927('0x44')]['id']}})[_0x3927('0x23')](handleEntityNotFound(_0x3f56e3,null))[_0x3927('0x23')](removeEntity(_0x3f56e3,null))[_0x3927('0x42')](handleError(_0x3f56e3,null));};exports[_0x3927('0x54')]=function(_0x1a9c46,_0x4fb3cd,_0xa154ea){var _0x50071f={'raw':!![],'where':{}};var _0x31c569={};var _0x134fea={'count':0x0,'rows':[]};return db[_0x3927('0x2b')][_0x3927('0x55')]({'where':{'id':_0x1a9c46['params']['id']}})[_0x3927('0x23')](handleEntityNotFound(_0x4fb3cd,null))[_0x3927('0x23')](function(_0x44bff5){if(_0x44bff5){_0x31c569['model']=_[_0x3927('0x45')](db['CmHopper'][_0x3927('0x2c')]);_0x31c569[_0x3927('0x30')]=_[_0x3927('0x45')](_0x1a9c46['query']);_0x31c569['filters']=_[_0x3927('0x32')](_0x31c569[_0x3927('0x2f')],_0x31c569[_0x3927('0x30')]);_0x50071f['attributes']=_[_0x3927('0x32')](_0x31c569[_0x3927('0x2f')],qs[_0x3927('0x34')](_0x1a9c46['query']['fields']));_0x50071f[_0x3927('0x33')]=_0x50071f[_0x3927('0x33')][_0x3927('0x35')]?_0x50071f[_0x3927('0x33')]:_0x31c569['model'];if(!_0x1a9c46[_0x3927('0x30')][_0x3927('0x36')](_0x3927('0x37'))){_0x50071f[_0x3927('0x1c')]=qs[_0x3927('0x1c')](_0x1a9c46[_0x3927('0x30')][_0x3927('0x1c')]);_0x50071f[_0x3927('0x1e')]=qs[_0x3927('0x1e')](_0x1a9c46[_0x3927('0x30')][_0x3927('0x1e')]);}_0x50071f['order']=qs[_0x3927('0x39')](_0x1a9c46[_0x3927('0x30')][_0x3927('0x39')]);_0x50071f[_0x3927('0x3c')]=qs[_0x3927('0x31')](_[_0x3927('0x3a')](_0x1a9c46['query'],_0x31c569['filters']));_0x50071f[_0x3927('0x3c')][_0x3927('0x56')]=_0x44bff5['id'];if(_0x1a9c46['query'][_0x3927('0x3b')]){_0x50071f['where']=_['merge'](_0x50071f[_0x3927('0x3c')],{'$or':_['map'](_0x50071f[_0x3927('0x33')],function(_0x8d6e44){var _0x40003c={};_0x40003c[_0x8d6e44]={'$like':'%'+_0x1a9c46[_0x3927('0x30')]['filter']+'%'};return _0x40003c;})});}_0x50071f=_[_0x3927('0x3d')]({},_0x50071f,_0x1a9c46['options']);return db[_0x3927('0x57')][_0x3927('0x1d')]({'where':_0x50071f[_0x3927('0x3c')]})[_0x3927('0x23')](function(_0x5c485d){_0x134fea['count']=_0x5c485d;if(_0x1a9c46[_0x3927('0x30')][_0x3927('0x40')]){_0x50071f['include']=[{'all':!![]}];}return db['CmHopper'][_0x3927('0x58')](_0x50071f);})[_0x3927('0x23')](function(_0x19adab){_0x134fea[_0x3927('0x59')]=_0x19adab;return _0x134fea;});}})[_0x3927('0x23')](respondWithFilteredResult(_0x4fb3cd,_0x50071f))[_0x3927('0x42')](handleError(_0x4fb3cd,null));};exports[_0x3927('0x5a')]=function(_0x7d7749,_0x55bcf6,_0x1d7391){var _0x34f6f9={'raw':!![],'where':{}};var _0x1eb041={};var _0x185e8c={'count':0x0,'rows':[]};return db['Campaign'][_0x3927('0x55')]({'where':{'id':_0x7d7749['params']['id']}})[_0x3927('0x23')](handleEntityNotFound(_0x55bcf6,null))[_0x3927('0x23')](function(_0x165290){if(_0x165290){_0x1eb041['model']=_[_0x3927('0x45')](db[_0x3927('0x5b')][_0x3927('0x2c')]);_0x1eb041[_0x3927('0x30')]=_[_0x3927('0x45')](_0x7d7749[_0x3927('0x30')]);_0x1eb041[_0x3927('0x31')]=_[_0x3927('0x32')](_0x1eb041[_0x3927('0x2f')],_0x1eb041[_0x3927('0x30')]);_0x34f6f9[_0x3927('0x33')]=_[_0x3927('0x32')](_0x1eb041[_0x3927('0x2f')],qs[_0x3927('0x34')](_0x7d7749[_0x3927('0x30')][_0x3927('0x34')]));_0x34f6f9[_0x3927('0x33')]=_0x34f6f9[_0x3927('0x33')]['length']?_0x34f6f9[_0x3927('0x33')]:_0x1eb041[_0x3927('0x2f')];if(!_0x7d7749[_0x3927('0x30')][_0x3927('0x36')](_0x3927('0x37'))){_0x34f6f9[_0x3927('0x1c')]=qs['limit'](_0x7d7749[_0x3927('0x30')][_0x3927('0x1c')]);_0x34f6f9['offset']=qs[_0x3927('0x1e')](_0x7d7749[_0x3927('0x30')][_0x3927('0x1e')]);}_0x34f6f9[_0x3927('0x38')]=qs[_0x3927('0x39')](_0x7d7749[_0x3927('0x30')][_0x3927('0x39')]);_0x34f6f9[_0x3927('0x3c')]=qs[_0x3927('0x31')](_[_0x3927('0x3a')](_0x7d7749[_0x3927('0x30')],_0x1eb041[_0x3927('0x31')]));_0x34f6f9[_0x3927('0x3c')][_0x3927('0x56')]=_0x165290['id'];if(_0x7d7749[_0x3927('0x30')]['filter']){_0x34f6f9['where']=_['merge'](_0x34f6f9[_0x3927('0x3c')],{'$or':_[_0x3927('0x2a')](_0x34f6f9[_0x3927('0x33')],function(_0xb477f8){var _0x3a6d9e={};_0x3a6d9e[_0xb477f8]={'$like':'%'+_0x7d7749[_0x3927('0x30')]['filter']+'%'};return _0x3a6d9e;})});}_0x34f6f9=_['merge']({},_0x34f6f9,_0x7d7749[_0x3927('0x3f')]);return db[_0x3927('0x5b')]['count']({'where':_0x34f6f9[_0x3927('0x3c')]})[_0x3927('0x23')](function(_0x3a536f){_0x185e8c[_0x3927('0x1d')]=_0x3a536f;if(_0x7d7749[_0x3927('0x30')][_0x3927('0x40')]){_0x34f6f9[_0x3927('0x41')]=[{'all':!![]}];}return db[_0x3927('0x5b')][_0x3927('0x58')](_0x34f6f9);})[_0x3927('0x23')](function(_0x4de9df){_0x185e8c['rows']=_0x4de9df;return _0x185e8c;});}})[_0x3927('0x23')](respondWithFilteredResult(_0x55bcf6,_0x34f6f9))[_0x3927('0x42')](handleError(_0x55bcf6,null));};exports['getHopperFinals']=function(_0x208237,_0x4bbfb5,_0x5cc7d0){var _0x3b1289={'raw':!![],'where':{}};var _0x1c8eb3={};var _0x2af779={'count':0x0,'rows':[]};return db['Campaign'][_0x3927('0x55')]({'where':{'id':_0x208237['params']['id']}})[_0x3927('0x23')](handleEntityNotFound(_0x4bbfb5,null))[_0x3927('0x23')](function(_0x1f1a14){if(_0x1f1a14){_0x1c8eb3[_0x3927('0x2f')]=_[_0x3927('0x45')](db['CmHopperFinal'][_0x3927('0x2c')]);_0x1c8eb3['query']=_['keys'](_0x208237[_0x3927('0x30')]);_0x1c8eb3[_0x3927('0x31')]=_[_0x3927('0x32')](_0x1c8eb3[_0x3927('0x2f')],_0x1c8eb3[_0x3927('0x30')]);_0x3b1289['attributes']=_[_0x3927('0x32')](_0x1c8eb3[_0x3927('0x2f')],qs[_0x3927('0x34')](_0x208237[_0x3927('0x30')][_0x3927('0x34')]));_0x3b1289[_0x3927('0x33')]=_0x3b1289[_0x3927('0x33')]['length']?_0x3b1289[_0x3927('0x33')]:_0x1c8eb3[_0x3927('0x2f')];if(!_0x208237[_0x3927('0x30')]['hasOwnProperty'](_0x3927('0x37'))){_0x3b1289[_0x3927('0x1c')]=qs[_0x3927('0x1c')](_0x208237['query'][_0x3927('0x1c')]);_0x3b1289['offset']=qs[_0x3927('0x1e')](_0x208237[_0x3927('0x30')][_0x3927('0x1e')]);}_0x3b1289['order']=qs[_0x3927('0x39')](_0x208237['query']['sort']);_0x3b1289[_0x3927('0x3c')]=qs['filters'](_[_0x3927('0x3a')](_0x208237[_0x3927('0x30')],_0x1c8eb3[_0x3927('0x31')]));_0x3b1289[_0x3927('0x3c')][_0x3927('0x56')]=_0x1f1a14['id'];if(_0x208237[_0x3927('0x30')]['filter']){_0x3b1289[_0x3927('0x3c')]=_[_0x3927('0x3d')](_0x3b1289[_0x3927('0x3c')],{'$or':_['map'](_0x3b1289['attributes'],function(_0x2078d3){var _0x314743={};_0x314743[_0x2078d3]={'$like':'%'+_0x208237['query'][_0x3927('0x3b')]+'%'};return _0x314743;})});}_0x3b1289=_[_0x3927('0x3d')]({},_0x3b1289,_0x208237['options']);return db[_0x3927('0x5c')][_0x3927('0x1d')]({'where':_0x3b1289[_0x3927('0x3c')]})[_0x3927('0x23')](function(_0x4d0f0e){_0x2af779[_0x3927('0x1d')]=_0x4d0f0e;if(_0x208237[_0x3927('0x30')][_0x3927('0x40')]){_0x3b1289[_0x3927('0x41')]=[{'all':!![]}];}return db[_0x3927('0x5c')][_0x3927('0x58')](_0x3b1289);})[_0x3927('0x23')](function(_0x5e6382){_0x2af779['rows']=_0x5e6382;return _0x2af779;});}})[_0x3927('0x23')](respondWithFilteredResult(_0x4bbfb5,_0x3b1289))[_0x3927('0x42')](handleError(_0x4bbfb5,null));};exports[_0x3927('0x5d')]=function(_0x4383c9,_0x1aa356,_0x4e3cae){var _0x1ab14c={'raw':!![],'where':{}};var _0x2dc994={};var _0x44e53b={'count':0x0,'rows':[]};return db['Campaign'][_0x3927('0x55')]({'where':{'id':_0x4383c9['params']['id']}})[_0x3927('0x23')](handleEntityNotFound(_0x1aa356,null))[_0x3927('0x23')](function(_0x9178dc){if(_0x9178dc){_0x2dc994[_0x3927('0x2f')]=_[_0x3927('0x45')](db['CmHopperBlack'][_0x3927('0x2c')]);_0x2dc994['query']=_['keys'](_0x4383c9[_0x3927('0x30')]);_0x2dc994[_0x3927('0x31')]=_[_0x3927('0x32')](_0x2dc994[_0x3927('0x2f')],_0x2dc994[_0x3927('0x30')]);_0x1ab14c[_0x3927('0x33')]=_[_0x3927('0x32')](_0x2dc994[_0x3927('0x2f')],qs[_0x3927('0x34')](_0x4383c9[_0x3927('0x30')][_0x3927('0x34')]));_0x1ab14c[_0x3927('0x33')]=_0x1ab14c['attributes'][_0x3927('0x35')]?_0x1ab14c['attributes']:_0x2dc994[_0x3927('0x2f')];if(!_0x4383c9[_0x3927('0x30')][_0x3927('0x36')]('nolimit')){_0x1ab14c[_0x3927('0x1c')]=qs['limit'](_0x4383c9['query'][_0x3927('0x1c')]);_0x1ab14c[_0x3927('0x1e')]=qs['offset'](_0x4383c9['query'][_0x3927('0x1e')]);}_0x1ab14c[_0x3927('0x38')]=qs[_0x3927('0x39')](_0x4383c9['query'][_0x3927('0x39')]);_0x1ab14c[_0x3927('0x3c')]=qs[_0x3927('0x31')](_[_0x3927('0x3a')](_0x4383c9['query'],_0x2dc994[_0x3927('0x31')]));_0x1ab14c['where'][_0x3927('0x56')]=_0x9178dc['id'];if(_0x4383c9[_0x3927('0x30')][_0x3927('0x3b')]){_0x1ab14c['where']=_[_0x3927('0x3d')](_0x1ab14c[_0x3927('0x3c')],{'$or':_[_0x3927('0x2a')](_0x1ab14c[_0x3927('0x33')],function(_0x35066d){var _0x398cb7={};_0x398cb7[_0x35066d]={'$like':'%'+_0x4383c9['query'][_0x3927('0x3b')]+'%'};return _0x398cb7;})});}_0x1ab14c=_[_0x3927('0x3d')]({},_0x1ab14c,_0x4383c9[_0x3927('0x3f')]);return db[_0x3927('0x5e')]['count']({'where':_0x1ab14c[_0x3927('0x3c')]})['then'](function(_0x31f79e){_0x44e53b['count']=_0x31f79e;if(_0x4383c9[_0x3927('0x30')][_0x3927('0x40')]){_0x1ab14c[_0x3927('0x41')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x3927('0x58')](_0x1ab14c);})[_0x3927('0x23')](function(_0x38fd59){_0x44e53b[_0x3927('0x59')]=_0x38fd59;return _0x44e53b;});}})[_0x3927('0x23')](respondWithFilteredResult(_0x1aa356,_0x1ab14c))[_0x3927('0x42')](handleError(_0x1aa356,null));};exports[_0x3927('0x5f')]=function(_0x868d6,_0x3c2b95,_0xf005b9){var _0x36803f={};var _0x6c0049={};var _0x444e08;var _0x21f558;return db[_0x3927('0x2b')][_0x3927('0x55')]({'where':{'id':_0x868d6[_0x3927('0x44')]['id']}})[_0x3927('0x23')](handleEntityNotFound(_0x3c2b95,null))['then'](function(_0x19c828){if(_0x19c828){_0x444e08=_0x19c828;_0x6c0049[_0x3927('0x2f')]=_[_0x3927('0x45')](db['CmList'][_0x3927('0x2c')]);_0x6c0049[_0x3927('0x30')]=_[_0x3927('0x45')](_0x868d6['query']);_0x6c0049[_0x3927('0x31')]=_[_0x3927('0x32')](_0x6c0049[_0x3927('0x2f')],_0x6c0049[_0x3927('0x30')]);_0x36803f[_0x3927('0x33')]=_['intersection'](_0x6c0049[_0x3927('0x2f')],qs[_0x3927('0x34')](_0x868d6[_0x3927('0x30')]['fields']));_0x36803f['attributes']=_0x36803f[_0x3927('0x33')][_0x3927('0x35')]?_0x36803f['attributes']:_0x6c0049[_0x3927('0x2f')];_0x36803f['order']=qs[_0x3927('0x39')](_0x868d6['query'][_0x3927('0x39')]);_0x36803f[_0x3927('0x3c')]=qs[_0x3927('0x31')](_[_0x3927('0x3a')](_0x868d6[_0x3927('0x30')],_0x6c0049[_0x3927('0x31')]));if(_0x868d6[_0x3927('0x30')]['filter']){_0x36803f[_0x3927('0x3c')]=_[_0x3927('0x3d')](_0x36803f[_0x3927('0x3c')],{'$or':_[_0x3927('0x2a')](_0x36803f['attributes'],function(_0x468995){var _0x4185a5={};_0x4185a5[_0x468995]={'$like':'%'+_0x868d6[_0x3927('0x30')]['filter']+'%'};return _0x4185a5;})});}_0x36803f=_[_0x3927('0x3d')]({},_0x36803f,_0x868d6['options']);return _0x444e08[_0x3927('0x5f')](_0x36803f);}})[_0x3927('0x23')](function(_0x30bee2){if(_0x30bee2){_0x21f558=_0x30bee2['length'];if(!_0x868d6[_0x3927('0x30')][_0x3927('0x36')]('nolimit')){_0x36803f[_0x3927('0x1c')]=qs['limit'](_0x868d6[_0x3927('0x30')]['limit']);_0x36803f[_0x3927('0x1e')]=qs[_0x3927('0x1e')](_0x868d6[_0x3927('0x30')][_0x3927('0x1e')]);}return _0x444e08[_0x3927('0x5f')](_0x36803f);}})[_0x3927('0x23')](function(_0x43aadd){if(_0x43aadd){return _0x43aadd?{'count':_0x21f558,'rows':_0x43aadd}:null;}})['then'](respondWithResult(_0x3c2b95,null))[_0x3927('0x42')](handleError(_0x3c2b95,null));};exports[_0x3927('0x60')]=function(_0x1eb087,_0x220294,_0x44dc11){var _0x4b6a49,_0xc410da;return db[_0x3927('0x2b')][_0x3927('0x46')]({'where':{'id':_0x1eb087[_0x3927('0x44')]['id']}})['then'](handleEntityNotFound(_0x220294,null))[_0x3927('0x23')](function(_0x108d82){if(_0x108d82){_0xc410da=_0x108d82;return _0x108d82[_0x3927('0x60')](_0x1eb087[_0x3927('0x48')][_0x3927('0x61')],_['omit'](_0x1eb087[_0x3927('0x48')],[_0x3927('0x61'),'id'])||{});}return null;})['spread'](function(_0x2177c9){var _0x47608d;_0x4b6a49=_0x2177c9||[];var _0x2fc417=[];if(_0x2177c9){for(var _0x51c4f0=0x0;_0x51c4f0<_0x2177c9[_0x3927('0x35')];_0x51c4f0+=0x1){var _0x3c3100=_0x2177c9[_0x51c4f0][_0x3927('0x24')]({'plain':!![]});_0xc410da[_0x3927('0x62')]=_0x1eb087[_0x3927('0x48')][_0x3927('0x62')]?_0x1eb087[_0x3927('0x48')]['dialCheckDuplicateType']:_0xc410da[_0x3927('0x62')];switch(_0xc410da[_0x3927('0x62')]){case'always':_0x47608d=squel['insert']()[_0x3927('0x63')](_0x3927('0x64'))[_0x3927('0x65')]([_0x3927('0x66'),_0x3927('0x67'),_0x3927('0x68'),_0x3927('0x69'),'CampaignId',_0x3927('0x51'),'updatedAt'],squel[_0x3927('0x6a')]()[_0x3927('0x6b')](_0x3927('0x66'),_0x3927('0x66'))['field']('NOW()',_0x3927('0x67'))[_0x3927('0x6b')]('id','ContactId')[_0x3927('0x6b')](_0x3c3100[_0x3927('0x6c')][_0x3927('0x6d')](),_0x3927('0x69'))[_0x3927('0x6b')](_0x1eb087[_0x3927('0x44')]['id']['toString'](),_0x3927('0x56'))[_0x3927('0x6b')](_0x3927('0x6e'),'createdAt')[_0x3927('0x6b')](_0x3927('0x6e'),_0x3927('0x52'))[_0x3927('0x6f')](_0x3927('0x70'))['where']('deletedAt\x20IS\x20NULL')[_0x3927('0x3c')](_0x3927('0x71'),_0x3c3100['CmListId'][_0x3927('0x6d')]())[_0x3927('0x3c')](_0x3927('0x72'))[_0x3927('0x3c')](_0x3927('0x73'),squel[_0x3927('0x6a')]()[_0x3927('0x6b')](_0x3927('0x74'))['from'](_0x3927('0x75'))['where'](_0x3927('0x76'),_0x1eb087[_0x3927('0x44')]['id'][_0x3927('0x6d')]()))[_0x3927('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3927('0x6a')]()[_0x3927('0x6b')](_0x3927('0x77'))[_0x3927('0x6f')](_0x3927('0x64'))[_0x3927('0x3c')]('CampaignId\x20=\x20?',_0x1eb087[_0x3927('0x44')]['id']['toString']())))[_0x3927('0x6d')]();break;case _0x3927('0x78'):_0x47608d=squel[_0x3927('0x79')]()['into'](_0x3927('0x64'))[_0x3927('0x65')]([_0x3927('0x66'),_0x3927('0x67'),_0x3927('0x68'),'ListId',_0x3927('0x56'),_0x3927('0x51'),_0x3927('0x52')],squel[_0x3927('0x6a')]()['field'](_0x3927('0x66'),_0x3927('0x66'))[_0x3927('0x6b')](_0x3927('0x6e'),_0x3927('0x67'))[_0x3927('0x6b')]('id',_0x3927('0x68'))[_0x3927('0x6b')](_0x3c3100[_0x3927('0x6c')][_0x3927('0x6d')](),_0x3927('0x69'))['field'](_0x1eb087[_0x3927('0x44')]['id']['toString'](),_0x3927('0x56'))[_0x3927('0x6b')](_0x3927('0x6e'),_0x3927('0x51'))['field']('NOW()',_0x3927('0x52'))[_0x3927('0x6f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x3927('0x3c')]('ListId\x20=\x20?',_0x3c3100[_0x3927('0x6c')]['toString']())[_0x3927('0x3c')](_0x3927('0x72'))[_0x3927('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3927('0x6a')]()[_0x3927('0x6b')](_0x3927('0x77'))['from'](_0x3927('0x64'))[_0x3927('0x3c')](_0x3927('0x76'),_0x1eb087[_0x3927('0x44')]['id'][_0x3927('0x6d')]())))[_0x3927('0x6d')]();break;default:_0x47608d=squel['insert']()[_0x3927('0x63')]('cm_hopper')[_0x3927('0x65')]([_0x3927('0x66'),_0x3927('0x67'),'ContactId',_0x3927('0x69'),_0x3927('0x56'),_0x3927('0x51'),_0x3927('0x52')],squel[_0x3927('0x6a')]()[_0x3927('0x6b')](_0x3927('0x66'),'phone')[_0x3927('0x6b')](_0x3927('0x6e'),_0x3927('0x67'))[_0x3927('0x6b')]('id',_0x3927('0x68'))['field'](_0x3c3100[_0x3927('0x6c')][_0x3927('0x6d')](),_0x3927('0x69'))[_0x3927('0x6b')](_0x1eb087['params']['id'][_0x3927('0x6d')](),_0x3927('0x56'))[_0x3927('0x6b')]('NOW()','createdAt')[_0x3927('0x6b')](_0x3927('0x6e'),_0x3927('0x52'))[_0x3927('0x6f')](_0x3927('0x70'))[_0x3927('0x3c')](_0x3927('0x7a'))['where'](_0x3927('0x71'),_0x3c3100[_0x3927('0x6c')][_0x3927('0x6d')]())['where'](_0x3927('0x72')))[_0x3927('0x6d')]();}_0x2fc417[_0x3927('0x7b')](db[_0x3927('0x7c')][_0x3927('0x30')](_0x47608d));}return BPromise[_0x3927('0x7d')](_0x2fc417);}})['then'](function(){return _0x4b6a49;})['then'](respondWithResult(_0x220294,null))[_0x3927('0x42')](handleError(_0x220294,null));};exports[_0x3927('0x7e')]=function(_0x651661,_0x2c8f3f,_0x3018b5){return db['Campaign'][_0x3927('0x46')]({'where':{'id':_0x651661[_0x3927('0x44')]['id']}})[_0x3927('0x23')](handleEntityNotFound(_0x2c8f3f,null))['then'](function(_0x3cd20f){if(_0x3cd20f){return _0x3cd20f['removeLists'](_0x651661[_0x3927('0x30')][_0x3927('0x61')]);}})['then'](function(_0x11d7d5){if(_0x11d7d5){return db['CmHopper'][_0x3927('0x27')]({'where':{'ListId':_0x651661[_0x3927('0x30')][_0x3927('0x61')],'CampaignId':_0x651661['params']['id']}})[_0x3927('0x23')](function(){return _0x11d7d5;});}})[_0x3927('0x23')](respondWithStatusCode(_0x2c8f3f,null))[_0x3927('0x42')](handleError(_0x2c8f3f,null));};exports[_0x3927('0x7f')]=function(_0x11ad8f,_0x510d30,_0x262bbd){var _0x372af2={};var _0xed55db={};var _0x158c70;var _0x1a86dc;return db[_0x3927('0x2b')][_0x3927('0x55')]({'where':{'id':_0x11ad8f['params']['id']}})[_0x3927('0x23')](handleEntityNotFound(_0x510d30,null))[_0x3927('0x23')](function(_0x28a094){if(_0x28a094){_0x158c70=_0x28a094;_0xed55db['model']=_[_0x3927('0x45')](db[_0x3927('0x80')][_0x3927('0x2c')]);_0xed55db[_0x3927('0x30')]=_[_0x3927('0x45')](_0x11ad8f[_0x3927('0x30')]);_0xed55db[_0x3927('0x31')]=_[_0x3927('0x32')](_0xed55db[_0x3927('0x2f')],_0xed55db['query']);_0x372af2['attributes']=_[_0x3927('0x32')](_0xed55db['model'],qs[_0x3927('0x34')](_0x11ad8f[_0x3927('0x30')][_0x3927('0x34')]));_0x372af2[_0x3927('0x33')]=_0x372af2[_0x3927('0x33')][_0x3927('0x35')]?_0x372af2['attributes']:_0xed55db[_0x3927('0x2f')];_0x372af2[_0x3927('0x38')]=qs['sort'](_0x11ad8f[_0x3927('0x30')]['sort']);_0x372af2[_0x3927('0x3c')]=qs[_0x3927('0x31')](_[_0x3927('0x3a')](_0x11ad8f[_0x3927('0x30')],_0xed55db[_0x3927('0x31')]));if(_0x11ad8f['query'][_0x3927('0x3b')]){_0x372af2[_0x3927('0x3c')]=_[_0x3927('0x3d')](_0x372af2['where'],{'$or':_[_0x3927('0x2a')](_0x372af2[_0x3927('0x33')],function(_0x4d20e9){var _0x9dadde={};_0x9dadde[_0x4d20e9]={'$like':'%'+_0x11ad8f[_0x3927('0x30')][_0x3927('0x3b')]+'%'};return _0x9dadde;})});}_0x372af2=_[_0x3927('0x3d')]({},_0x372af2,_0x11ad8f[_0x3927('0x3f')]);return _0x158c70['getBlackLists'](_0x372af2);}})[_0x3927('0x23')](function(_0x3dd282){if(_0x3dd282){_0x1a86dc=_0x3dd282[_0x3927('0x35')];if(!_0x11ad8f['query'][_0x3927('0x36')]('nolimit')){_0x372af2[_0x3927('0x1c')]=qs[_0x3927('0x1c')](_0x11ad8f[_0x3927('0x30')][_0x3927('0x1c')]);_0x372af2['offset']=qs[_0x3927('0x1e')](_0x11ad8f['query'][_0x3927('0x1e')]);}return _0x158c70[_0x3927('0x7f')](_0x372af2);}})['then'](function(_0x5ab387){if(_0x5ab387){return _0x5ab387?{'count':_0x1a86dc,'rows':_0x5ab387}:null;}})[_0x3927('0x23')](respondWithResult(_0x510d30,null))[_0x3927('0x42')](handleError(_0x510d30,null));};exports[_0x3927('0x81')]=function(_0x2708d9,_0x52c959,_0x232345){var _0x321a60,_0x2dc2d3;return db['Campaign'][_0x3927('0x46')]({'where':{'id':_0x2708d9[_0x3927('0x44')]['id']}})[_0x3927('0x23')](handleEntityNotFound(_0x52c959,null))[_0x3927('0x23')](function(_0x5256f6){if(_0x5256f6){_0x2dc2d3=_0x5256f6;return _0x5256f6[_0x3927('0x81')](_0x2708d9['body']['ids'],_[_0x3927('0x50')](_0x2708d9['body'],[_0x3927('0x61'),'id'])||{});}return null;})[_0x3927('0x82')](function(_0x474d4a){var _0xd124c6;_0x321a60=_0x474d4a||[];var _0xf1df0e=[];if(_0x474d4a){for(var _0x1aaea5=0x0;_0x1aaea5<_0x474d4a['length'];_0x1aaea5+=0x1){var _0x3fa85a=_0x474d4a[_0x1aaea5][_0x3927('0x24')]({'plain':!![]});_0xd124c6=squel[_0x3927('0x79')]()[_0x3927('0x63')](_0x3927('0x83'))[_0x3927('0x65')](['phone',_0x3927('0x68'),_0x3927('0x69'),'CampaignId',_0x3927('0x51'),_0x3927('0x52')],squel['select']()[_0x3927('0x6b')]('phone',_0x3927('0x66'))[_0x3927('0x6b')]('id',_0x3927('0x68'))['field'](_0x3fa85a[_0x3927('0x6c')][_0x3927('0x6d')](),_0x3927('0x69'))['field'](_0x2708d9[_0x3927('0x44')]['id'][_0x3927('0x6d')](),'CampaignId')['field'](_0x3927('0x6e'),_0x3927('0x51'))[_0x3927('0x6b')](_0x3927('0x6e'),_0x3927('0x52'))[_0x3927('0x6f')](_0x3927('0x70'))[_0x3927('0x3c')]('deletedAt\x20IS\x20NULL')[_0x3927('0x3c')](_0x3927('0x71'),_0x3fa85a[_0x3927('0x6c')]['toString']())['where'](_0x3927('0x72')))['toString']();_0xf1df0e[_0x3927('0x7b')](db[_0x3927('0x7c')][_0x3927('0x30')](_0xd124c6));}return BPromise['all'](_0xf1df0e);}})[_0x3927('0x23')](function(){return _0x321a60;})[_0x3927('0x23')](respondWithResult(_0x52c959,null))[_0x3927('0x42')](handleError(_0x52c959,null));};exports[_0x3927('0x84')]=function(_0x989c4b,_0x115d55,_0x937430){return db['Campaign']['find']({'where':{'id':_0x989c4b[_0x3927('0x44')]['id']}})[_0x3927('0x23')](handleEntityNotFound(_0x115d55,null))[_0x3927('0x23')](function(_0x1e5715){if(_0x1e5715){return _0x1e5715['removeBlackLists'](_0x989c4b[_0x3927('0x30')][_0x3927('0x61')]);}})[_0x3927('0x23')](function(_0x25e06e){if(_0x25e06e){return db['CmHopperBlack'][_0x3927('0x27')]({'where':{'ListId':_0x989c4b[_0x3927('0x30')][_0x3927('0x61')],'CampaignId':_0x989c4b[_0x3927('0x44')]['id']}})[_0x3927('0x23')](function(){return _0x25e06e;});}})[_0x3927('0x23')](respondWithStatusCode(_0x115d55,null))[_0x3927('0x42')](handleError(_0x115d55,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index d8e4f58..1730cea 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(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x59820d,_0xc8e6ba){var _0x3c72b1=function(_0x1f8971){while(--_0x1f8971){_0x59820d['push'](_0x59820d['shift']());}};_0x3c72b1(++_0xc8e6ba);}(_0x7a54,0x106));var _0x47a5=function(_0x4d7ee9,_0x1af36e){_0x4d7ee9=_0x4d7ee9-0x0;var _0x173aa4=_0x7a54[_0x4d7ee9];return _0x173aa4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 209da94..2106c3f 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 _0xbf83=['debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCampaign','Campaign','options','where','attributes','limit','map','include','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbf83,0x11e));var _0x3bf8=function(_0x2ede98,_0x4b504a){_0x2ede98=_0x2ede98-0x0;var _0x8e6529=_0xbf83[_0x2ede98];return _0x8e6529;};'use strict';var _=require(_0x3bf8('0x0'));var util=require('util');var moment=require(_0x3bf8('0x1'));var BPromise=require(_0x3bf8('0x2'));var rs=require(_0x3bf8('0x3'));var fs=require('fs');var Redis=require(_0x3bf8('0x4'));var db=require(_0x3bf8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3bf8('0x6'));var config=require(_0x3bf8('0x7'));var jayson=require(_0x3bf8('0x8'));var client=jayson[_0x3bf8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b0c12,_0x168a20,_0x2df7c9){return new BPromise(function(_0x4adc52,_0x27c23f){return client['request'](_0x5b0c12,_0x2df7c9)[_0x3bf8('0xa')](function(_0x2eca24){logger[_0x3bf8('0xb')](_0x3bf8('0xc'),_0x168a20,_0x3bf8('0xd'));logger[_0x3bf8('0xe')](_0x3bf8('0xf'),_0x168a20,'request\x20sent',JSON[_0x3bf8('0x10')](_0x2eca24));if(_0x2eca24[_0x3bf8('0x11')]){if(_0x2eca24['error'][_0x3bf8('0x12')]===0x1f4){logger[_0x3bf8('0x11')](_0x3bf8('0xc'),_0x168a20,_0x2eca24[_0x3bf8('0x11')][_0x3bf8('0x13')]);return _0x27c23f(_0x2eca24[_0x3bf8('0x11')][_0x3bf8('0x13')]);}logger[_0x3bf8('0x11')](_0x3bf8('0xc'),_0x168a20,_0x2eca24[_0x3bf8('0x11')]['message']);return _0x4adc52(_0x2eca24['error'][_0x3bf8('0x13')]);}else{logger[_0x3bf8('0xb')](_0x3bf8('0xc'),_0x168a20,_0x3bf8('0xd'));_0x4adc52(_0x2eca24['result'][_0x3bf8('0x13')]);}})[_0x3bf8('0x14')](function(_0x1a77fc){logger[_0x3bf8('0x11')](_0x3bf8('0xc'),_0x168a20,_0x1a77fc);_0x27c23f(_0x1a77fc);});});}exports[_0x3bf8('0x15')]=function(_0x857603){var _0x2c942e=this;return new Promise(function(_0x2f80fa,_0x262752){return db[_0x3bf8('0x16')]['findAll']({'raw':_0x857603[_0x3bf8('0x17')]?_0x857603[_0x3bf8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x857603[_0x3bf8('0x17')]?_0x857603['options'][_0x3bf8('0x18')]||null:null,'attributes':_0x857603['options']?_0x857603[_0x3bf8('0x17')][_0x3bf8('0x19')]||null:null,'limit':_0x857603['options']?_0x857603[_0x3bf8('0x17')][_0x3bf8('0x1a')]||null:null,'include':_0x857603[_0x3bf8('0x17')]?_0x857603[_0x3bf8('0x17')]['include']?_[_0x3bf8('0x1b')](_0x857603['options'][_0x3bf8('0x1c')],function(_0x583d62){return{'model':db[_0x583d62['model']],'as':_0x583d62['as'],'attributes':_0x583d62[_0x3bf8('0x19')],'include':_0x583d62[_0x3bf8('0x1c')]?_[_0x3bf8('0x1b')](_0x583d62[_0x3bf8('0x1c')],function(_0x3245e2){return{'model':db[_0x3245e2[_0x3bf8('0x1d')]],'as':_0x3245e2['as'],'attributes':_0x3245e2[_0x3bf8('0x19')],'include':_0x3245e2[_0x3bf8('0x1c')]?_[_0x3bf8('0x1b')](_0x3245e2[_0x3bf8('0x1c')],function(_0x143e8a){return{'model':db[_0x143e8a[_0x3bf8('0x1d')]],'as':_0x143e8a['as'],'attributes':_0x143e8a[_0x3bf8('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3bf8('0xa')](function(_0x25442d){logger['info'](_0x3bf8('0x15'),_0x857603);logger[_0x3bf8('0xe')]('GetCampaign',_0x857603,JSON[_0x3bf8('0x10')](_0x25442d));_0x2f80fa(_0x25442d);})[_0x3bf8('0x14')](function(_0x55cccc){logger['error'](_0x3bf8('0x15'),_0x55cccc[_0x3bf8('0x13')],_0x857603);_0x262752(_0x2c942e[_0x3bf8('0x11')](0x1f4,_0x55cccc['message']));});});}; \ No newline at end of file +var _0x66fa=['options','where','include','map','model','attributes','stringify','GetCampaign','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','message','result','catch','Campaign'];(function(_0x41d546,_0xdd03c6){var _0x3627f1=function(_0x1603d2){while(--_0x1603d2){_0x41d546['push'](_0x41d546['shift']());}};_0x3627f1(++_0xdd03c6);}(_0x66fa,0x168));var _0xa66f=function(_0xc7b2d8,_0x5b7d0b){_0xc7b2d8=_0xc7b2d8-0x0;var _0x2ce072=_0x66fa[_0xc7b2d8];return _0x2ce072;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require(_0xa66f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa66f('0x3'));var db=require(_0xa66f('0x4'))['db'];var utils=require(_0xa66f('0x5'));var logger=require(_0xa66f('0x6'))(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var jayson=require(_0xa66f('0x9'));var client=jayson[_0xa66f('0xa')][_0xa66f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33bd0d,_0x150f73,_0x5b7cf7){return new BPromise(function(_0x1cf624,_0x5ec156){return client[_0xa66f('0xc')](_0x33bd0d,_0x5b7cf7)[_0xa66f('0xd')](function(_0x5ad336){logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,_0xa66f('0x10'));logger[_0xa66f('0x11')](_0xa66f('0x12'),_0x150f73,_0xa66f('0x10'),JSON['stringify'](_0x5ad336));if(_0x5ad336['error']){if(_0x5ad336[_0xa66f('0x13')]['code']===0x1f4){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')]['message']);return _0x5ec156(_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);}logger['error'](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);return _0x1cf624(_0x5ad336[_0xa66f('0x13')]['message']);}else{logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,'request\x20sent');_0x1cf624(_0x5ad336[_0xa66f('0x15')][_0xa66f('0x14')]);}})[_0xa66f('0x16')](function(_0x76af81){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x76af81);_0x5ec156(_0x76af81);});});}exports['GetCampaign']=function(_0x4d5e31){var _0x162a28=this;return new Promise(function(_0x16648b,_0x1b4ab0){return db[_0xa66f('0x17')]['findAll']({'raw':_0x4d5e31[_0xa66f('0x18')]?_0x4d5e31[_0xa66f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d5e31[_0xa66f('0x18')]?_0x4d5e31['options'][_0xa66f('0x19')]||null:null,'attributes':_0x4d5e31[_0xa66f('0x18')]?_0x4d5e31['options']['attributes']||null:null,'limit':_0x4d5e31[_0xa66f('0x18')]?_0x4d5e31['options']['limit']||null:null,'include':_0x4d5e31['options']?_0x4d5e31['options'][_0xa66f('0x1a')]?_[_0xa66f('0x1b')](_0x4d5e31[_0xa66f('0x18')]['include'],function(_0x20bf81){return{'model':db[_0x20bf81[_0xa66f('0x1c')]],'as':_0x20bf81['as'],'attributes':_0x20bf81['attributes'],'include':_0x20bf81[_0xa66f('0x1a')]?_[_0xa66f('0x1b')](_0x20bf81[_0xa66f('0x1a')],function(_0x29dfe5){return{'model':db[_0x29dfe5[_0xa66f('0x1c')]],'as':_0x29dfe5['as'],'attributes':_0x29dfe5[_0xa66f('0x1d')],'include':_0x29dfe5['include']?_['map'](_0x29dfe5[_0xa66f('0x1a')],function(_0x5a03f7){return{'model':db[_0x5a03f7[_0xa66f('0x1c')]],'as':_0x5a03f7['as'],'attributes':_0x5a03f7[_0xa66f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa66f('0xd')](function(_0x49e1b3){logger[_0xa66f('0xe')]('GetCampaign',_0x4d5e31);logger['debug']('GetCampaign',_0x4d5e31,JSON[_0xa66f('0x1e')](_0x49e1b3));_0x16648b(_0x49e1b3);})['catch'](function(_0xd9f17e){logger[_0xa66f('0x13')](_0xa66f('0x1f'),_0xd9f17e['message'],_0x4d5e31);_0x1b4ab0(_0x162a28['error'](0x1f4,_0xd9f17e[_0xa66f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 3020a8d..1a32332 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 _0xc2a8=['/:id/blacklists','create','post','addLists','addBlackLists','put','update','delete','destroy','removeLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists'];(function(_0x3a06c0,_0x1b5b3a){var _0x8529cc=function(_0x353f5d){while(--_0x353f5d){_0x3a06c0['push'](_0x3a06c0['shift']());}};_0x8529cc(++_0x1b5b3a);}(_0xc2a8,0x1bc));var _0x8c2a=function(_0x1ff880,_0x325511){_0x1ff880=_0x1ff880-0x0;var _0x56fa82=_0xc2a8[_0x1ff880];return _0x56fa82;};'use strict';var multer=require(_0x8c2a('0x0'));var util=require(_0x8c2a('0x1'));var path=require(_0x8c2a('0x2'));var timeout=require(_0x8c2a('0x3'));var express=require(_0x8c2a('0x4'));var router=express[_0x8c2a('0x5')]();var fs_extra=require(_0x8c2a('0x6'));var auth=require(_0x8c2a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8c2a('0x8'));var controller=require(_0x8c2a('0x9'));router[_0x8c2a('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8c2a('0xb'),auth[_0x8c2a('0xc')](),controller['show']);router['get']('/:id/hoppers',auth[_0x8c2a('0xc')](),controller[_0x8c2a('0xd')]);router['get'](_0x8c2a('0xe'),auth[_0x8c2a('0xc')](),controller[_0x8c2a('0xf')]);router['get'](_0x8c2a('0x10'),auth[_0x8c2a('0xc')](),controller[_0x8c2a('0x11')]);router[_0x8c2a('0xa')](_0x8c2a('0x12'),auth[_0x8c2a('0xc')](),controller['getHopperBlacks']);router[_0x8c2a('0xa')](_0x8c2a('0x13'),auth[_0x8c2a('0xc')](),controller[_0x8c2a('0x14')]);router[_0x8c2a('0xa')](_0x8c2a('0x15'),auth[_0x8c2a('0xc')](),controller['getBlackLists']);router['post']('/',auth[_0x8c2a('0xc')](),controller[_0x8c2a('0x16')]);router[_0x8c2a('0x17')]('/:id/clone',auth[_0x8c2a('0xc')](),controller['clone']);router[_0x8c2a('0x17')](_0x8c2a('0x13'),auth[_0x8c2a('0xc')](),controller[_0x8c2a('0x18')]);router['post']('/:id/blacklists',auth[_0x8c2a('0xc')](),controller[_0x8c2a('0x19')]);router[_0x8c2a('0x1a')](_0x8c2a('0xb'),auth[_0x8c2a('0xc')](),controller[_0x8c2a('0x1b')]);router[_0x8c2a('0x1c')](_0x8c2a('0xb'),auth[_0x8c2a('0xc')](),controller[_0x8c2a('0x1d')]);router[_0x8c2a('0x1c')](_0x8c2a('0x13'),auth['isAuthenticated'](),controller[_0x8c2a('0x1e')]);router[_0x8c2a('0x1c')](_0x8c2a('0x15'),auth[_0x8c2a('0xc')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file +var _0xa4b0=['/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers'];(function(_0x1af794,_0x570050){var _0x402845=function(_0x319b24){while(--_0x319b24){_0x1af794['push'](_0x1af794['shift']());}};_0x402845(++_0x570050);}(_0xa4b0,0x15d));var _0x0a4b=function(_0x516616,_0xbeda7f){_0x516616=_0x516616-0x0;var _0x236660=_0xa4b0[_0x516616];return _0x236660;};'use strict';var multer=require(_0x0a4b('0x0'));var util=require(_0x0a4b('0x1'));var path=require(_0x0a4b('0x2'));var timeout=require(_0x0a4b('0x3'));var express=require('express');var router=express[_0x0a4b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0a4b('0x5'));var config=require('../../config/environment');var controller=require(_0x0a4b('0x6'));router[_0x0a4b('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a4b('0x8')]);router[_0x0a4b('0x7')](_0x0a4b('0x9'),auth[_0x0a4b('0xa')](),controller[_0x0a4b('0xb')]);router[_0x0a4b('0x7')](_0x0a4b('0xc'),auth[_0x0a4b('0xa')](),controller[_0x0a4b('0xd')]);router[_0x0a4b('0x7')](_0x0a4b('0xe'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x0a4b('0x7')](_0x0a4b('0xf'),auth[_0x0a4b('0xa')](),controller[_0x0a4b('0x10')]);router['get'](_0x0a4b('0x11'),auth[_0x0a4b('0xa')](),controller['getHopperBlacks']);router[_0x0a4b('0x7')](_0x0a4b('0x12'),auth[_0x0a4b('0xa')](),controller['getLists']);router['get'](_0x0a4b('0x13'),auth[_0x0a4b('0xa')](),controller[_0x0a4b('0x14')]);router[_0x0a4b('0x15')]('/',auth[_0x0a4b('0xa')](),controller['create']);router[_0x0a4b('0x15')](_0x0a4b('0x16'),auth[_0x0a4b('0xa')](),controller[_0x0a4b('0x17')]);router[_0x0a4b('0x15')](_0x0a4b('0x12'),auth[_0x0a4b('0xa')](),controller[_0x0a4b('0x18')]);router['post'](_0x0a4b('0x13'),auth[_0x0a4b('0xa')](),controller[_0x0a4b('0x19')]);router[_0x0a4b('0x1a')](_0x0a4b('0x9'),auth[_0x0a4b('0xa')](),controller[_0x0a4b('0x1b')]);router[_0x0a4b('0x1c')](_0x0a4b('0x9'),auth[_0x0a4b('0xa')](),controller[_0x0a4b('0x1d')]);router[_0x0a4b('0x1c')]('/:id/lists',auth[_0x0a4b('0xa')](),controller[_0x0a4b('0x1e')]);router[_0x0a4b('0x1c')](_0x0a4b('0x13'),auth[_0x0a4b('0xa')](),controller[_0x0a4b('0x1f')]);module[_0x0a4b('0x20')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 28c201a..7468b74 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 _0xbf11=['exports','STRING','VIRTUAL','getDataValue','key','sequelize'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0xbf11,0xe9));var _0x1bf1=function(_0x53d147,_0x259f9e){_0x53d147=_0x53d147-0x0;var _0x3bc064=_0xbf11[_0x53d147];return _0x3bc064;};'use strict';var Sequelize=require(_0x1bf1('0x0'));module[_0x1bf1('0x1')]={'key':{'type':Sequelize[_0x1bf1('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x1bf1('0x2')]},'name':{'type':Sequelize[_0x1bf1('0x3')],'get':function(){return this[_0x1bf1('0x4')](_0x1bf1('0x5'));}}}; \ No newline at end of file +var _0x036e=['TEXT','getDataValue','key','sequelize','exports','STRING'];(function(_0x4c7d57,_0xd9a803){var _0x246564=function(_0x53945c){while(--_0x53945c){_0x4c7d57['push'](_0x4c7d57['shift']());}};_0x246564(++_0xd9a803);}(_0x036e,0x9f));var _0xe036=function(_0x5763fa,_0x1aa675){_0x5763fa=_0x5763fa-0x0;var _0x58711f=_0x036e[_0x5763fa];return _0x58711f;};'use strict';var Sequelize=require(_0xe036('0x0'));module[_0xe036('0x1')]={'key':{'type':Sequelize[_0xe036('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xe036('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xe036('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe036('0x4')](_0xe036('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 30af309..3025891 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 _0xc8e9=['index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','rows','show','params','options','find','body','catch','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','update','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send'];(function(_0x3f946b,_0xbd1ebe){var _0x2a2ea1=function(_0x3c3397){while(--_0x3c3397){_0x3f946b['push'](_0x3f946b['shift']());}};_0x2a2ea1(++_0xbd1ebe);}(_0xc8e9,0x83));var _0x9c8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc8e9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9c8e('0x0'));var rimraf=require(_0x9c8e('0x1'));var zipdir=require(_0x9c8e('0x2'));var jsonpatch=require(_0x9c8e('0x3'));var rp=require(_0x9c8e('0x4'));var moment=require(_0x9c8e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9c8e('0x6'));var util=require(_0x9c8e('0x7'));var path=require(_0x9c8e('0x8'));var sox=require(_0x9c8e('0x9'));var csv=require(_0x9c8e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9c8e('0xb'));var squel=require(_0x9c8e('0xc'));var crypto=require(_0x9c8e('0xd'));var jsforce=require(_0x9c8e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9c8e('0xa'));var querystring=require(_0x9c8e('0xf'));var Papa=require(_0x9c8e('0x10'));var Redis=require('ioredis');var authService=require(_0x9c8e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9c8e('0x12'));var hardwareService=require(_0x9c8e('0x13'));var logger=require(_0x9c8e('0x14'))(_0x9c8e('0x15'));var utils=require(_0x9c8e('0x16'));var config=require(_0x9c8e('0x17'));var licenseUtil=require(_0x9c8e('0x18'));var db=require(_0x9c8e('0x19'))['db'];function respondWithStatusCode(_0x4b3842,_0x5eae01){_0x5eae01=_0x5eae01||0xcc;return function(_0x85d777){if(_0x85d777){return _0x4b3842[_0x9c8e('0x1a')](_0x5eae01);}return _0x4b3842['status'](_0x5eae01)[_0x9c8e('0x1b')]();};}function respondWithResult(_0x4a2e81,_0x2aadd4){_0x2aadd4=_0x2aadd4||0xc8;return function(_0x47400c){if(_0x47400c){return _0x4a2e81['status'](_0x2aadd4)[_0x9c8e('0x1c')](_0x47400c);}};}function respondWithFilteredResult(_0x44b4f3,_0x5e8630){return function(_0x250a0a){if(_0x250a0a){var _0x44feaf=typeof _0x5e8630[_0x9c8e('0x1d')]===_0x9c8e('0x1e')&&typeof _0x5e8630['limit']===_0x9c8e('0x1e');var _0x533708=_0x250a0a['count'];var _0x2aeaaa=_0x44feaf?0x0:_0x5e8630[_0x9c8e('0x1d')];var _0x535990=_0x44feaf?_0x250a0a[_0x9c8e('0x1f')]:_0x5e8630[_0x9c8e('0x1d')]+_0x5e8630[_0x9c8e('0x20')];var _0x5a415f;if(_0x535990>=_0x533708){_0x535990=_0x533708;_0x5a415f=0xc8;}else{_0x5a415f=0xce;}_0x44b4f3[_0x9c8e('0x21')](_0x5a415f);return _0x44b4f3['set'](_0x9c8e('0x22'),_0x2aeaaa+'-'+_0x535990+'/'+_0x533708)[_0x9c8e('0x1c')](_0x250a0a);}return null;};}function patchUpdates(_0x313df){return function(_0x1d6a06){try{jsonpatch[_0x9c8e('0x23')](_0x1d6a06,_0x313df,!![]);}catch(_0x49131c){return BPromise['reject'](_0x49131c);}return _0x1d6a06['save']();};}function saveUpdates(_0x39c112,_0x4cb075){return function(_0x114df4){if(_0x114df4){return _0x114df4[_0x9c8e('0x24')](_0x39c112)[_0x9c8e('0x25')](function(_0x5fa2a6){return _0x5fa2a6;});}return null;};}function removeEntity(_0x15bf20,_0x37774d){return function(_0x54c9f4){if(_0x54c9f4){return _0x54c9f4[_0x9c8e('0x26')]()['then'](function(){var _0x1c9b90=_0x54c9f4[_0x9c8e('0x27')]({'plain':!![]});var _0x4d5473=_0x9c8e('0x28');return db[_0x9c8e('0x29')][_0x9c8e('0x26')]({'where':{'type':_0x4d5473,'resourceId':_0x1c9b90['id']}})[_0x9c8e('0x25')](function(){return _0x54c9f4;});})[_0x9c8e('0x25')](function(){_0x15bf20[_0x9c8e('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf67946,_0x9a67b7){return function(_0x3fe862){if(!_0x3fe862){_0xf67946['sendStatus'](0x194);}return _0x3fe862;};}function handleError(_0x34e2b6,_0x2293aa){_0x2293aa=_0x2293aa||0x1f4;return function(_0x585910){logger['error'](_0x585910[_0x9c8e('0x2a')]);if(_0x585910[_0x9c8e('0x2b')]){delete _0x585910[_0x9c8e('0x2b')];}_0x34e2b6[_0x9c8e('0x21')](_0x2293aa)[_0x9c8e('0x2c')](_0x585910);};}exports[_0x9c8e('0x2d')]=function(_0x3c5150,_0x3d553a){var _0x357f34={},_0x4a217c={},_0xda4bd8={'count':0x0,'rows':[]};var _0x6c6c02=_[_0x9c8e('0x2e')](db[_0x9c8e('0x2f')][_0x9c8e('0x30')],function(_0x4be6c4){return{'name':_0x4be6c4[_0x9c8e('0x31')],'type':_0x4be6c4[_0x9c8e('0x32')][_0x9c8e('0x33')]};});_0x4a217c[_0x9c8e('0x34')]=_[_0x9c8e('0x2e')](_0x6c6c02,_0x9c8e('0x2b'));_0x4a217c[_0x9c8e('0x35')]=_[_0x9c8e('0x36')](_0x3c5150[_0x9c8e('0x35')]);_0x4a217c[_0x9c8e('0x37')]=_['intersection'](_0x4a217c['model'],_0x4a217c[_0x9c8e('0x35')]);_0x357f34['attributes']=_[_0x9c8e('0x38')](_0x4a217c[_0x9c8e('0x34')],qs[_0x9c8e('0x39')](_0x3c5150[_0x9c8e('0x35')][_0x9c8e('0x39')]));_0x357f34[_0x9c8e('0x3a')]=_0x357f34[_0x9c8e('0x3a')][_0x9c8e('0x3b')]?_0x357f34['attributes']:_0x4a217c[_0x9c8e('0x34')];if(!_0x3c5150['query'][_0x9c8e('0x3c')](_0x9c8e('0x3d'))){_0x357f34[_0x9c8e('0x20')]=qs[_0x9c8e('0x20')](_0x3c5150['query'][_0x9c8e('0x20')]);_0x357f34[_0x9c8e('0x1d')]=qs[_0x9c8e('0x1d')](_0x3c5150[_0x9c8e('0x35')]['offset']);}_0x357f34[_0x9c8e('0x3e')]=qs[_0x9c8e('0x3f')](_0x3c5150[_0x9c8e('0x35')][_0x9c8e('0x3f')]);_0x357f34['where']=qs[_0x9c8e('0x37')](_[_0x9c8e('0x40')](_0x3c5150[_0x9c8e('0x35')],_0x4a217c[_0x9c8e('0x37')]),_0x6c6c02);if(_0x3c5150[_0x9c8e('0x35')][_0x9c8e('0x41')]){_0x357f34[_0x9c8e('0x42')]=_['merge'](_0x357f34[_0x9c8e('0x42')],{'$or':[{'key':{'$like':'%'+_0x3c5150['query'][_0x9c8e('0x41')]+'%'}},{'value':{'$like':'%'+_0x3c5150['query']['filter']+'%'}}]});}_0x357f34=_[_0x9c8e('0x43')]({},_0x357f34,_0x3c5150['options']);var _0xf03a24={'where':_0x357f34[_0x9c8e('0x42')]};return db[_0x9c8e('0x2f')][_0x9c8e('0x1f')](_0xf03a24)[_0x9c8e('0x25')](function(_0x46cedf){_0xda4bd8['count']=_0x46cedf;if(_0x3c5150[_0x9c8e('0x35')][_0x9c8e('0x44')]){_0x357f34[_0x9c8e('0x45')]=[{'all':!![]}];}return db[_0x9c8e('0x2f')]['findAll'](_0x357f34);})['then'](function(_0x16c886){_0xda4bd8[_0x9c8e('0x46')]=_0x16c886;return _0xda4bd8;})[_0x9c8e('0x25')](respondWithFilteredResult(_0x3d553a,_0x357f34))['catch'](handleError(_0x3d553a,null));};exports[_0x9c8e('0x47')]=function(_0x496eeb,_0x1f7988){var _0x264982={'raw':!![],'where':{'id':_0x496eeb[_0x9c8e('0x48')]['id']}},_0x5a8688={};_0x5a8688[_0x9c8e('0x34')]=_[_0x9c8e('0x36')](db[_0x9c8e('0x2f')][_0x9c8e('0x30')]);_0x5a8688[_0x9c8e('0x35')]=_[_0x9c8e('0x36')](_0x496eeb[_0x9c8e('0x35')]);_0x5a8688[_0x9c8e('0x37')]=_[_0x9c8e('0x38')](_0x5a8688[_0x9c8e('0x34')],_0x5a8688[_0x9c8e('0x35')]);_0x264982[_0x9c8e('0x3a')]=_[_0x9c8e('0x38')](_0x5a8688[_0x9c8e('0x34')],qs[_0x9c8e('0x39')](_0x496eeb['query'][_0x9c8e('0x39')]));_0x264982['attributes']=_0x264982['attributes'][_0x9c8e('0x3b')]?_0x264982[_0x9c8e('0x3a')]:_0x5a8688[_0x9c8e('0x34')];if(_0x496eeb[_0x9c8e('0x35')][_0x9c8e('0x44')]){_0x264982[_0x9c8e('0x45')]=[{'all':!![]}];}_0x264982=_[_0x9c8e('0x43')]({},_0x264982,_0x496eeb[_0x9c8e('0x49')]);return db['CannedAnswer'][_0x9c8e('0x4a')](_0x264982)[_0x9c8e('0x25')](handleEntityNotFound(_0x1f7988,null))['then'](respondWithResult(_0x1f7988,null))['catch'](handleError(_0x1f7988,null));};exports[_0x9c8e('0x24')]=function(_0x41f917,_0x294a98){if(_0x41f917['body']['id']){delete _0x41f917[_0x9c8e('0x4b')]['id'];}return db['CannedAnswer'][_0x9c8e('0x4a')]({'where':{'id':_0x41f917[_0x9c8e('0x48')]['id']}})[_0x9c8e('0x25')](handleEntityNotFound(_0x294a98,null))[_0x9c8e('0x25')](saveUpdates(_0x41f917[_0x9c8e('0x4b')],null))[_0x9c8e('0x25')](respondWithResult(_0x294a98,null))[_0x9c8e('0x4c')](handleError(_0x294a98,null));};exports[_0x9c8e('0x26')]=function(_0x54eca1,_0x59af42){return db[_0x9c8e('0x2f')][_0x9c8e('0x4a')]({'where':{'id':_0x54eca1[_0x9c8e('0x48')]['id']}})['then'](handleEntityNotFound(_0x59af42,null))[_0x9c8e('0x25')](removeEntity(_0x59af42,null))[_0x9c8e('0x4c')](handleError(_0x59af42,null));};exports['create']=function(_0x224e31,_0x84a3c9){var _0x4bc8a0={'key':_0x224e31[_0x9c8e('0x4b')]['key']};if(_0x224e31[_0x9c8e('0x4b')][_0x9c8e('0x4d')]){_0x4bc8a0['MailAccountId']=_0x224e31[_0x9c8e('0x4b')][_0x9c8e('0x4d')];}else if(_0x224e31[_0x9c8e('0x4b')][_0x9c8e('0x4e')]){_0x4bc8a0[_0x9c8e('0x4e')]=_0x224e31['body'][_0x9c8e('0x4e')];}else if(_0x224e31['body']['OpenchannelAccountId']){_0x4bc8a0[_0x9c8e('0x4f')]=_0x224e31['body'][_0x9c8e('0x4f')];}else if(_0x224e31[_0x9c8e('0x4b')][_0x9c8e('0x50')]){_0x4bc8a0[_0x9c8e('0x50')]=_0x224e31['body'][_0x9c8e('0x50')];}return db['CannedAnswer'][_0x9c8e('0x4a')]({'where':_0x4bc8a0})['then'](function(_0x2e7d1d){if(_0x2e7d1d){throw new db['Sequelize'][(_0x9c8e('0x51'))](_0x9c8e('0x52'));}return db[_0x9c8e('0x2f')]['create'](_0x224e31[_0x9c8e('0x4b')]);})[_0x9c8e('0x25')](function(_0x5ce237){var _0x3b7e59=_0x224e31[_0x9c8e('0x53')][_0x9c8e('0x27')]({'plain':!![]});if(!_0x3b7e59)throw new Error(_0x9c8e('0x54'));if(_0x3b7e59[_0x9c8e('0x55')]===_0x9c8e('0x53')){var _0x387b21=_0x5ce237[_0x9c8e('0x27')]({'plain':!![]});return db[_0x9c8e('0x56')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x3b7e59['userProfileId']},'raw':!![]})[_0x9c8e('0x25')](function(_0x3e6fe5){if(_0x3e6fe5&&_0x3e6fe5['autoAssociation']===0x0){return db[_0x9c8e('0x29')]['create']({'name':_0x387b21['name'],'resourceId':_0x387b21['id'],'type':_0x3e6fe5[_0x9c8e('0x2b')],'sectionId':_0x3e6fe5['id']},{})[_0x9c8e('0x25')](function(){return _0x5ce237;});}else{return _0x5ce237;}})[_0x9c8e('0x4c')](function(_0x4f121f){logger['error'](_0x9c8e('0x57'),_0x4f121f);throw _0x4f121f;});}return _0x5ce237;})[_0x9c8e('0x25')](respondWithResult(_0x84a3c9,0xc9))[_0x9c8e('0x4c')](handleError(_0x84a3c9,null));}; \ No newline at end of file +var _0xfc50=['create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','CannedAnswer','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','include','rows','catch','show','params','find','update','body'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xfc50,0xb5));var _0x0fc5=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xfc50[_0x47e7cb];return _0x2a8874;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fc5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fc5('0x1'));var rp=require(_0x0fc5('0x2'));var moment=require(_0x0fc5('0x3'));var BPromise=require(_0x0fc5('0x4'));var Mustache=require(_0x0fc5('0x5'));var util=require('util');var path=require(_0x0fc5('0x6'));var sox=require('sox');var csv=require(_0x0fc5('0x7'));var ejs=require(_0x0fc5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0fc5('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0fc5('0x7'));var querystring=require(_0x0fc5('0xa'));var Papa=require(_0x0fc5('0xb'));var Redis=require(_0x0fc5('0xc'));var authService=require(_0x0fc5('0xd'));var qs=require(_0x0fc5('0xe'));var as=require(_0x0fc5('0xf'));var hardwareService=require(_0x0fc5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x0fc5('0x11'));var config=require(_0x0fc5('0x12'));var licenseUtil=require(_0x0fc5('0x13'));var db=require(_0x0fc5('0x14'))['db'];function respondWithStatusCode(_0x1dfcb7,_0x3aa82d){_0x3aa82d=_0x3aa82d||0xcc;return function(_0x197379){if(_0x197379){return _0x1dfcb7[_0x0fc5('0x15')](_0x3aa82d);}return _0x1dfcb7[_0x0fc5('0x16')](_0x3aa82d)[_0x0fc5('0x17')]();};}function respondWithResult(_0x158870,_0x1e29d2){_0x1e29d2=_0x1e29d2||0xc8;return function(_0xa596c){if(_0xa596c){return _0x158870['status'](_0x1e29d2)[_0x0fc5('0x18')](_0xa596c);}};}function respondWithFilteredResult(_0x2c28e3,_0x3fb27d){return function(_0x4f0e4e){if(_0x4f0e4e){var _0x3e77dd=typeof _0x3fb27d[_0x0fc5('0x19')]===_0x0fc5('0x1a')&&typeof _0x3fb27d['limit']===_0x0fc5('0x1a');var _0x372889=_0x4f0e4e[_0x0fc5('0x1b')];var _0x1dd97a=_0x3e77dd?0x0:_0x3fb27d['offset'];var _0x410491=_0x3e77dd?_0x4f0e4e[_0x0fc5('0x1b')]:_0x3fb27d[_0x0fc5('0x19')]+_0x3fb27d[_0x0fc5('0x1c')];var _0xff0e79;if(_0x410491>=_0x372889){_0x410491=_0x372889;_0xff0e79=0xc8;}else{_0xff0e79=0xce;}_0x2c28e3[_0x0fc5('0x16')](_0xff0e79);return _0x2c28e3[_0x0fc5('0x1d')]('Content-Range',_0x1dd97a+'-'+_0x410491+'/'+_0x372889)[_0x0fc5('0x18')](_0x4f0e4e);}return null;};}function patchUpdates(_0xa057ee){return function(_0x35d9f7){try{jsonpatch[_0x0fc5('0x1e')](_0x35d9f7,_0xa057ee,!![]);}catch(_0x169c42){return BPromise[_0x0fc5('0x1f')](_0x169c42);}return _0x35d9f7[_0x0fc5('0x20')]();};}function saveUpdates(_0x70b9e7,_0x29d9a1){return function(_0x276488){if(_0x276488){return _0x276488['update'](_0x70b9e7)[_0x0fc5('0x21')](function(_0x2e9e3f){return _0x2e9e3f;});}return null;};}function removeEntity(_0x2c62c0,_0x5dee88){return function(_0x4f5b60){if(_0x4f5b60){return _0x4f5b60[_0x0fc5('0x22')]()[_0x0fc5('0x21')](function(){var _0x48aba1=_0x4f5b60[_0x0fc5('0x23')]({'plain':!![]});var _0x5916d0='CannedAnswers';return db[_0x0fc5('0x24')][_0x0fc5('0x22')]({'where':{'type':_0x5916d0,'resourceId':_0x48aba1['id']}})['then'](function(){return _0x4f5b60;});})[_0x0fc5('0x21')](function(){_0x2c62c0[_0x0fc5('0x16')](0xcc)[_0x0fc5('0x17')]();});}};}function handleEntityNotFound(_0x1d4645,_0x185ed3){return function(_0x3a5c62){if(!_0x3a5c62){_0x1d4645[_0x0fc5('0x15')](0x194);}return _0x3a5c62;};}function handleError(_0x1d3263,_0x1b5f5d){_0x1b5f5d=_0x1b5f5d||0x1f4;return function(_0x5ef079){logger[_0x0fc5('0x25')](_0x5ef079[_0x0fc5('0x26')]);if(_0x5ef079[_0x0fc5('0x27')]){delete _0x5ef079['name'];}_0x1d3263['status'](_0x1b5f5d)['send'](_0x5ef079);};}exports[_0x0fc5('0x28')]=function(_0x1ffb48,_0x1979ab){var _0x58625e={},_0x52c927={},_0x33e8a7={'count':0x0,'rows':[]};var _0x31297c=_['map'](db[_0x0fc5('0x29')][_0x0fc5('0x2a')],function(_0xddd1b9){return{'name':_0xddd1b9['fieldName'],'type':_0xddd1b9[_0x0fc5('0x2b')][_0x0fc5('0x2c')]};});_0x52c927[_0x0fc5('0x2d')]=_[_0x0fc5('0x2e')](_0x31297c,_0x0fc5('0x27'));_0x52c927[_0x0fc5('0x2f')]=_[_0x0fc5('0x30')](_0x1ffb48[_0x0fc5('0x2f')]);_0x52c927['filters']=_[_0x0fc5('0x31')](_0x52c927['model'],_0x52c927[_0x0fc5('0x2f')]);_0x58625e[_0x0fc5('0x32')]=_[_0x0fc5('0x31')](_0x52c927[_0x0fc5('0x2d')],qs[_0x0fc5('0x33')](_0x1ffb48['query'][_0x0fc5('0x33')]));_0x58625e[_0x0fc5('0x32')]=_0x58625e[_0x0fc5('0x32')][_0x0fc5('0x34')]?_0x58625e[_0x0fc5('0x32')]:_0x52c927[_0x0fc5('0x2d')];if(!_0x1ffb48[_0x0fc5('0x2f')][_0x0fc5('0x35')](_0x0fc5('0x36'))){_0x58625e[_0x0fc5('0x1c')]=qs['limit'](_0x1ffb48[_0x0fc5('0x2f')][_0x0fc5('0x1c')]);_0x58625e[_0x0fc5('0x19')]=qs[_0x0fc5('0x19')](_0x1ffb48['query'][_0x0fc5('0x19')]);}_0x58625e[_0x0fc5('0x37')]=qs[_0x0fc5('0x38')](_0x1ffb48[_0x0fc5('0x2f')][_0x0fc5('0x38')]);_0x58625e[_0x0fc5('0x39')]=qs[_0x0fc5('0x3a')](_[_0x0fc5('0x3b')](_0x1ffb48[_0x0fc5('0x2f')],_0x52c927[_0x0fc5('0x3a')]),_0x31297c);if(_0x1ffb48['query']['filter']){_0x58625e[_0x0fc5('0x39')]=_[_0x0fc5('0x3c')](_0x58625e[_0x0fc5('0x39')],{'$or':[{'key':{'$like':'%'+_0x1ffb48[_0x0fc5('0x2f')][_0x0fc5('0x3d')]+'%'}},{'value':{'$like':'%'+_0x1ffb48[_0x0fc5('0x2f')][_0x0fc5('0x3d')]+'%'}}]});}_0x58625e=_[_0x0fc5('0x3c')]({},_0x58625e,_0x1ffb48[_0x0fc5('0x3e')]);var _0x1f060c={'where':_0x58625e['where']};return db[_0x0fc5('0x29')][_0x0fc5('0x1b')](_0x1f060c)['then'](function(_0x4a5e7f){_0x33e8a7[_0x0fc5('0x1b')]=_0x4a5e7f;if(_0x1ffb48[_0x0fc5('0x2f')]['includeAll']){_0x58625e[_0x0fc5('0x3f')]=[{'all':!![]}];}return db[_0x0fc5('0x29')]['findAll'](_0x58625e);})[_0x0fc5('0x21')](function(_0x42671b){_0x33e8a7[_0x0fc5('0x40')]=_0x42671b;return _0x33e8a7;})[_0x0fc5('0x21')](respondWithFilteredResult(_0x1979ab,_0x58625e))[_0x0fc5('0x41')](handleError(_0x1979ab,null));};exports[_0x0fc5('0x42')]=function(_0x2583f3,_0x12de19){var _0x3db676={'raw':!![],'where':{'id':_0x2583f3[_0x0fc5('0x43')]['id']}},_0x474c91={};_0x474c91[_0x0fc5('0x2d')]=_[_0x0fc5('0x30')](db['CannedAnswer']['rawAttributes']);_0x474c91[_0x0fc5('0x2f')]=_[_0x0fc5('0x30')](_0x2583f3['query']);_0x474c91['filters']=_[_0x0fc5('0x31')](_0x474c91[_0x0fc5('0x2d')],_0x474c91['query']);_0x3db676[_0x0fc5('0x32')]=_['intersection'](_0x474c91['model'],qs['fields'](_0x2583f3['query'][_0x0fc5('0x33')]));_0x3db676[_0x0fc5('0x32')]=_0x3db676[_0x0fc5('0x32')]['length']?_0x3db676[_0x0fc5('0x32')]:_0x474c91[_0x0fc5('0x2d')];if(_0x2583f3['query']['includeAll']){_0x3db676[_0x0fc5('0x3f')]=[{'all':!![]}];}_0x3db676=_[_0x0fc5('0x3c')]({},_0x3db676,_0x2583f3['options']);return db['CannedAnswer'][_0x0fc5('0x44')](_0x3db676)['then'](handleEntityNotFound(_0x12de19,null))[_0x0fc5('0x21')](respondWithResult(_0x12de19,null))[_0x0fc5('0x41')](handleError(_0x12de19,null));};exports[_0x0fc5('0x45')]=function(_0x3dcb65,_0x2b947d){if(_0x3dcb65['body']['id']){delete _0x3dcb65[_0x0fc5('0x46')]['id'];}return db[_0x0fc5('0x29')][_0x0fc5('0x44')]({'where':{'id':_0x3dcb65[_0x0fc5('0x43')]['id']}})[_0x0fc5('0x21')](handleEntityNotFound(_0x2b947d,null))[_0x0fc5('0x21')](saveUpdates(_0x3dcb65['body'],null))['then'](respondWithResult(_0x2b947d,null))[_0x0fc5('0x41')](handleError(_0x2b947d,null));};exports[_0x0fc5('0x22')]=function(_0x3785a1,_0x454138){return db[_0x0fc5('0x29')][_0x0fc5('0x44')]({'where':{'id':_0x3785a1[_0x0fc5('0x43')]['id']}})[_0x0fc5('0x21')](handleEntityNotFound(_0x454138,null))[_0x0fc5('0x21')](removeEntity(_0x454138,null))[_0x0fc5('0x41')](handleError(_0x454138,null));};exports[_0x0fc5('0x47')]=function(_0xb38684,_0x3d8f43){var _0x2daaad={'key':_0xb38684['body'][_0x0fc5('0x2c')]};if(_0xb38684[_0x0fc5('0x46')]['MailAccountId']){_0x2daaad[_0x0fc5('0x48')]=_0xb38684[_0x0fc5('0x46')][_0x0fc5('0x48')];}else if(_0xb38684[_0x0fc5('0x46')][_0x0fc5('0x49')]){_0x2daaad[_0x0fc5('0x49')]=_0xb38684['body'][_0x0fc5('0x49')];}else if(_0xb38684[_0x0fc5('0x46')][_0x0fc5('0x4a')]){_0x2daaad[_0x0fc5('0x4a')]=_0xb38684[_0x0fc5('0x46')][_0x0fc5('0x4a')];}else if(_0xb38684[_0x0fc5('0x46')][_0x0fc5('0x4b')]){_0x2daaad[_0x0fc5('0x4b')]=_0xb38684[_0x0fc5('0x46')][_0x0fc5('0x4b')];}return db[_0x0fc5('0x29')]['find']({'where':_0x2daaad})[_0x0fc5('0x21')](function(_0x4d877f){if(_0x4d877f){throw new db['Sequelize']['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x0fc5('0x47')](_0xb38684['body']);})['then'](function(_0x169748){var _0xccc5be=_0xb38684['user'][_0x0fc5('0x23')]({'plain':!![]});if(!_0xccc5be)throw new Error(_0x0fc5('0x4c'));if(_0xccc5be[_0x0fc5('0x4d')]===_0x0fc5('0x4e')){var _0x5303f8=_0x169748[_0x0fc5('0x23')]({'plain':!![]});return db[_0x0fc5('0x4f')][_0x0fc5('0x44')]({'where':{'name':_0x0fc5('0x50'),'userProfileId':_0xccc5be[_0x0fc5('0x51')]},'raw':!![]})[_0x0fc5('0x21')](function(_0x554e00){if(_0x554e00&&_0x554e00[_0x0fc5('0x52')]===0x0){return db[_0x0fc5('0x24')]['create']({'name':_0x5303f8[_0x0fc5('0x27')],'resourceId':_0x5303f8['id'],'type':_0x554e00['name'],'sectionId':_0x554e00['id']},{})[_0x0fc5('0x21')](function(){return _0x169748;});}else{return _0x169748;}})[_0x0fc5('0x41')](function(_0x55273a){logger[_0x0fc5('0x25')](_0x0fc5('0x53'),_0x55273a);throw _0x55273a;});}return _0x169748;})['then'](respondWithResult(_0x3d8f43,0xc9))['catch'](handleError(_0x3d8f43,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 9413ad2..34a10d8 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 _0x0028=['utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0028,0x15b));var _0x8002=function(_0x3a0633,_0x120c59){_0x3a0633=_0x3a0633-0x0;var _0x58341e=_0x0028[_0x3a0633];return _0x58341e;};'use strict';var _=require('lodash');var util=require(_0x8002('0x0'));var logger=require('../../config/logger')(_0x8002('0x1'));var moment=require(_0x8002('0x2'));var BPromise=require(_0x8002('0x3'));var rp=require(_0x8002('0x4'));var fs=require('fs');var path=require(_0x8002('0x5'));var rimraf=require(_0x8002('0x6'));var config=require(_0x8002('0x7'));var attributes=require(_0x8002('0x8'));module[_0x8002('0x9')]=function(_0x57d062,_0x42df7f){return _0x57d062[_0x8002('0xa')](_0x8002('0xb'),attributes,{'tableName':_0x8002('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8002('0xd'),'collate':_0x8002('0xe')});}; \ No newline at end of file +var _0xf774=['tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer'];(function(_0x40abfd,_0x19b6af){var _0x59c6aa=function(_0x444770){while(--_0x444770){_0x40abfd['push'](_0x40abfd['shift']());}};_0x59c6aa(++_0x19b6af);}(_0xf774,0x11a));var _0x4f77=function(_0xbead61,_0x262d39){_0xbead61=_0xbead61-0x0;var _0x5cdce9=_0xf774[_0xbead61];return _0x5cdce9;};'use strict';var _=require(_0x4f77('0x0'));var util=require(_0x4f77('0x1'));var logger=require(_0x4f77('0x2'))('api');var moment=require(_0x4f77('0x3'));var BPromise=require(_0x4f77('0x4'));var rp=require(_0x4f77('0x5'));var fs=require('fs');var path=require(_0x4f77('0x6'));var rimraf=require(_0x4f77('0x7'));var config=require(_0x4f77('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0x4f77('0x9')]=function(_0x204735,_0x3451d){return _0x204735[_0x4f77('0xa')](_0x4f77('0xb'),attributes,{'tableName':_0x4f77('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4f77('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index f3347d7..04da2ec 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(_0x2766fc,_0x5b3b21){var _0x3708d1=function(_0x7ae279){while(--_0x7ae279){_0x2766fc['push'](_0x2766fc['shift']());}};_0x3708d1(++_0x5b3b21);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x33eb58,_0x2caffd){var _0x5f1fe3=function(_0x40abcf){while(--_0x40abcf){_0x33eb58['push'](_0x33eb58['shift']());}};_0x5f1fe3(++_0x2caffd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 303dda9..5f9ee1f 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 _0x4166=['fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','multer','util','path','express'];(function(_0x25a8ac,_0x485530){var _0x49dcb7=function(_0x2d8032){while(--_0x2d8032){_0x25a8ac['push'](_0x25a8ac['shift']());}};_0x49dcb7(++_0x485530);}(_0x4166,0xa6));var _0x6416=function(_0x752ec7,_0x41675b){_0x752ec7=_0x752ec7-0x0;var _0x30e825=_0x4166[_0x752ec7];return _0x30e825;};'use strict';var multer=require(_0x6416('0x0'));var util=require(_0x6416('0x1'));var path=require(_0x6416('0x2'));var timeout=require('connect-timeout');var express=require(_0x6416('0x3'));var router=express['Router']();var fs_extra=require(_0x6416('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6416('0x5'));var config=require(_0x6416('0x6'));var controller=require(_0x6416('0x7'));router[_0x6416('0x8')]('/',auth[_0x6416('0x9')](),controller[_0x6416('0xa')]);router[_0x6416('0x8')](_0x6416('0xb'),auth[_0x6416('0x9')](),controller[_0x6416('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6416('0xd')]);router['put']('/:id',auth[_0x6416('0x9')](),controller[_0x6416('0xe')]);router[_0x6416('0xf')]('/:id',auth[_0x6416('0x9')](),controller[_0x6416('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa80d=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','post','create','put','delete','destroy','util','path','connect-timeout','express','fs-extra'];(function(_0x4ac04e,_0x485235){var _0x1f3079=function(_0x2f5c2b){while(--_0x2f5c2b){_0x4ac04e['push'](_0x4ac04e['shift']());}};_0x1f3079(++_0x485235);}(_0xa80d,0x6b));var _0xda80=function(_0x5356ad,_0xa8b3b){_0x5356ad=_0x5356ad-0x0;var _0x5ec9aa=_0xa80d[_0x5356ad];return _0x5ec9aa;};'use strict';var multer=require('multer');var util=require(_0xda80('0x0'));var path=require(_0xda80('0x1'));var timeout=require(_0xda80('0x2'));var express=require(_0xda80('0x3'));var router=express['Router']();var fs_extra=require(_0xda80('0x4'));var auth=require(_0xda80('0x5'));var interaction=require(_0xda80('0x6'));var config=require(_0xda80('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xda80('0x8')](),controller['index']);router['get'](_0xda80('0x9'),auth[_0xda80('0x8')](),controller[_0xda80('0xa')]);router[_0xda80('0xb')]('/',auth['isAuthenticated'](),controller[_0xda80('0xc')]);router[_0xda80('0xd')](_0xda80('0x9'),auth[_0xda80('0x8')](),controller['update']);router[_0xda80('0xe')](_0xda80('0x9'),auth['isAuthenticated'](),controller[_0xda80('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 06ac14e..3a8bc94 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 _0xd820=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x2a6571,_0xf1567c){var _0xdf7731=function(_0x43a5c4){while(--_0x43a5c4){_0x2a6571['push'](_0x2a6571['shift']());}};_0xdf7731(++_0xf1567c);}(_0xd820,0x16f));var _0x0d82=function(_0x130536,_0x543ea0){_0x130536=_0x130536-0x0;var _0x31b0cb=_0xd820[_0x130536];return _0x31b0cb;};'use strict';var Sequelize=require(_0x0d82('0x0'));module[_0x0d82('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x0d82('0x2')},'clid':{'type':Sequelize[_0x0d82('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x0d82('0x3')]},'channel':{'type':Sequelize[_0x0d82('0x3')]},'dstchannel':{'type':Sequelize[_0x0d82('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0d82('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0d82('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0d82('0x3')]},'amaflags':{'type':Sequelize[_0x0d82('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x0d82('0x3')]},'uniqueid':{'type':Sequelize[_0x0d82('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x0d82('0x3')]},'type':{'type':Sequelize[_0x0d82('0x3')]},'tag':{'type':Sequelize[_0x0d82('0x3')]}}; \ No newline at end of file +var _0x8c99=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x37e05e,_0x40e4a1){var _0x442124=function(_0x48305e){while(--_0x48305e){_0x37e05e['push'](_0x37e05e['shift']());}};_0x442124(++_0x40e4a1);}(_0x8c99,0x1a8));var _0x98c9=function(_0x468a77,_0x1382be){_0x468a77=_0x468a77-0x0;var _0x2d1c33=_0x8c99[_0x468a77];return _0x2d1c33;};'use strict';var Sequelize=require(_0x98c9('0x0'));module[_0x98c9('0x1')]={'calldate':{'type':Sequelize[_0x98c9('0x2')],'allowNull':![],'defaultValue':_0x98c9('0x3')},'clid':{'type':Sequelize[_0x98c9('0x4')]},'src':{'type':Sequelize[_0x98c9('0x4')]},'dst':{'type':Sequelize[_0x98c9('0x4')]},'dcontext':{'type':Sequelize[_0x98c9('0x4')]},'channel':{'type':Sequelize[_0x98c9('0x4')]},'dstchannel':{'type':Sequelize[_0x98c9('0x4')]},'lastapp':{'type':Sequelize[_0x98c9('0x4')]},'lastdata':{'type':Sequelize[_0x98c9('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x98c9('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x98c9('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x98c9('0x4')]},'linkedid':{'type':Sequelize[_0x98c9('0x4')]},'sequence':{'type':Sequelize[_0x98c9('0x4')]},'peeraccount':{'type':Sequelize[_0x98c9('0x4')]},'type':{'type':Sequelize[_0x98c9('0x4')]},'tag':{'type':Sequelize[_0x98c9('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index a3beb9a..3375f63 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 _0xd6d6=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type'];(function(_0x545ccb,_0x260809){var _0x4b02f8=function(_0x35e203){while(--_0x35e203){_0x545ccb['push'](_0x545ccb['shift']());}};_0x4b02f8(++_0x260809);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x2450b8,_0x3d37e1){_0x2450b8=_0x2450b8-0x0;var _0x31db98=_0xd6d6[_0x2450b8];return _0x31db98;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0xf0df7f,_0x12fab2){return function(_0x554f8e){if(!_0x554f8e){_0xf0df7f[_0x6d6d('0x19')](0x194);}return _0x554f8e;};}function handleError(_0x2b5e31,_0x235451){_0x235451=_0x235451||0x1f4;return function(_0x126ac8){logger[_0x6d6d('0x29')](_0x126ac8[_0x6d6d('0x2a')]);if(_0x126ac8[_0x6d6d('0x2b')]){delete _0x126ac8['name'];}_0x2b5e31[_0x6d6d('0x1a')](_0x235451)[_0x6d6d('0x2c')](_0x126ac8);};}exports['index']=function(_0x553645,_0x3edcce){var _0x5273cd={},_0x8a9a84={},_0x57341f={'count':0x0,'rows':[]};var _0xde3272=_[_0x6d6d('0x2d')](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')],function(_0x64d1f7){return{'name':_0x64d1f7[_0x6d6d('0x30')],'type':_0x64d1f7[_0x6d6d('0x31')][_0x6d6d('0x32')]};});_0x8a9a84[_0x6d6d('0x33')]=_[_0x6d6d('0x2d')](_0xde3272,'name');_0x8a9a84[_0x6d6d('0x34')]=_['keys'](_0x553645[_0x6d6d('0x34')]);_0x8a9a84[_0x6d6d('0x35')]=_[_0x6d6d('0x36')](_0x8a9a84[_0x6d6d('0x33')],_0x8a9a84['query']);_0x5273cd[_0x6d6d('0x37')]=_['intersection'](_0x8a9a84[_0x6d6d('0x33')],qs[_0x6d6d('0x38')](_0x553645['query'][_0x6d6d('0x38')]));_0x5273cd[_0x6d6d('0x37')]=_0x5273cd[_0x6d6d('0x37')][_0x6d6d('0x39')]?_0x5273cd[_0x6d6d('0x37')]:_0x8a9a84[_0x6d6d('0x33')];if(!_0x553645[_0x6d6d('0x34')][_0x6d6d('0x3a')](_0x6d6d('0x3b'))){_0x5273cd[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x553645[_0x6d6d('0x34')][_0x6d6d('0x1e')]);_0x5273cd[_0x6d6d('0x1f')]=qs['offset'](_0x553645[_0x6d6d('0x34')][_0x6d6d('0x1f')]);}_0x5273cd[_0x6d6d('0x3c')]=qs[_0x6d6d('0x3d')](_0x553645['query']['sort']);_0x5273cd[_0x6d6d('0x3e')]=qs[_0x6d6d('0x35')](_[_0x6d6d('0x3f')](_0x553645['query'],_0x8a9a84[_0x6d6d('0x35')]),_0xde3272);if(_0x553645[_0x6d6d('0x34')][_0x6d6d('0x40')]){_0x5273cd[_0x6d6d('0x3e')]=_['merge'](_0x5273cd['where'],{'$or':_['map'](_0xde3272,function(_0x62620d){if(_0x62620d[_0x6d6d('0x31')]!==_0x6d6d('0x41')){var _0x22a49a={};_0x22a49a[_0x62620d['name']]={'$like':'%'+_0x553645[_0x6d6d('0x34')][_0x6d6d('0x40')]+'%'};return _0x22a49a;}})});}_0x5273cd=_[_0x6d6d('0x42')]({},_0x5273cd,_0x553645[_0x6d6d('0x43')]);var _0x3d632c={'where':_0x5273cd[_0x6d6d('0x3e')]};return db['Cdr'][_0x6d6d('0x20')](_0x3d632c)[_0x6d6d('0x27')](function(_0x42aff0){_0x57341f[_0x6d6d('0x20')]=_0x42aff0;if(_0x553645[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x5273cd[_0x6d6d('0x45')]=[{'all':!![]}];}return db['Cdr'][_0x6d6d('0x46')](_0x5273cd);})[_0x6d6d('0x27')](function(_0x16e177){_0x57341f[_0x6d6d('0x47')]=_0x16e177;return _0x57341f;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x3edcce,_0x5273cd))['catch'](handleError(_0x3edcce,null));};exports[_0x6d6d('0x48')]=function(_0x39f2a9,_0x55dba8){var _0x452de2={'raw':!![],'where':{'id':_0x39f2a9[_0x6d6d('0x49')]['id']}},_0x50dc17={};_0x50dc17[_0x6d6d('0x33')]=_['keys'](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')]);_0x50dc17[_0x6d6d('0x34')]=_[_0x6d6d('0x4a')](_0x39f2a9[_0x6d6d('0x34')]);_0x50dc17['filters']=_['intersection'](_0x50dc17[_0x6d6d('0x33')],_0x50dc17['query']);_0x452de2['attributes']=_[_0x6d6d('0x36')](_0x50dc17[_0x6d6d('0x33')],qs[_0x6d6d('0x38')](_0x39f2a9['query'][_0x6d6d('0x38')]));_0x452de2['attributes']=_0x452de2[_0x6d6d('0x37')][_0x6d6d('0x39')]?_0x452de2[_0x6d6d('0x37')]:_0x50dc17[_0x6d6d('0x33')];if(_0x39f2a9[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x452de2[_0x6d6d('0x45')]=[{'all':!![]}];}_0x452de2=_['merge']({},_0x452de2,_0x39f2a9[_0x6d6d('0x43')]);return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')](_0x452de2)[_0x6d6d('0x27')](handleEntityNotFound(_0x55dba8,null))[_0x6d6d('0x27')](respondWithResult(_0x55dba8,null))[_0x6d6d('0x4c')](handleError(_0x55dba8,null));};exports[_0x6d6d('0x4d')]=function(_0x1d2b20,_0x24cec2){return db['Cdr']['create'](_0x1d2b20[_0x6d6d('0x4e')],{})[_0x6d6d('0x27')](respondWithResult(_0x24cec2,0xc9))[_0x6d6d('0x4c')](handleError(_0x24cec2,null));};exports[_0x6d6d('0x26')]=function(_0xe2a20e,_0x492834){if(_0xe2a20e[_0x6d6d('0x4e')]['id']){delete _0xe2a20e[_0x6d6d('0x4e')]['id'];}return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')]({'where':{'id':_0xe2a20e[_0x6d6d('0x49')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x492834,null))[_0x6d6d('0x27')](saveUpdates(_0xe2a20e[_0x6d6d('0x4e')],null))[_0x6d6d('0x27')](respondWithResult(_0x492834,null))[_0x6d6d('0x4c')](handleError(_0x492834,null));};exports[_0x6d6d('0x28')]=function(_0x175e26,_0x4d9811){return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')]({'where':{'id':_0x175e26[_0x6d6d('0x49')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x4d9811,null))[_0x6d6d('0x27')](removeEntity(_0x4d9811,null))['catch'](handleError(_0x4d9811,null));};exports[_0x6d6d('0x4f')]=function(_0x36bc5a,_0x45340b){return db['Cdr']['describe']()[_0x6d6d('0x27')](respondWithResult(_0x45340b,null))['catch'](handleError(_0x45340b,null));}; \ No newline at end of file +var _0x8819=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','zip-dir','fast-json-patch'];(function(_0xc3b418,_0x144412){var _0x1a5477=function(_0x357583){while(--_0x357583){_0xc3b418['push'](_0xc3b418['shift']());}};_0x1a5477(++_0x144412);}(_0x8819,0x94));var _0x9881=function(_0x57993a,_0x64adbe){_0x57993a=_0x57993a-0x0;var _0x44e680=_0x8819[_0x57993a];return _0x44e680;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9881('0x0'));var jsonpatch=require(_0x9881('0x1'));var rp=require(_0x9881('0x2'));var moment=require(_0x9881('0x3'));var BPromise=require(_0x9881('0x4'));var Mustache=require('mustache');var util=require(_0x9881('0x5'));var path=require(_0x9881('0x6'));var sox=require(_0x9881('0x7'));var csv=require(_0x9881('0x8'));var ejs=require(_0x9881('0x9'));var fs=require('fs');var fs_extra=require(_0x9881('0xa'));var _=require('lodash');var squel=require(_0x9881('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9881('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9881('0xd'));var Redis=require('ioredis');var authService=require(_0x9881('0xe'));var qs=require(_0x9881('0xf'));var as=require(_0x9881('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9881('0x11'))(_0x9881('0x12'));var utils=require(_0x9881('0x13'));var config=require(_0x9881('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9881('0x15'))['db'];function respondWithStatusCode(_0x26ee3f,_0x5c6d2d){_0x5c6d2d=_0x5c6d2d||0xcc;return function(_0x42850e){if(_0x42850e){return _0x26ee3f['sendStatus'](_0x5c6d2d);}return _0x26ee3f['status'](_0x5c6d2d)['end']();};}function respondWithResult(_0x58f526,_0x12794f){_0x12794f=_0x12794f||0xc8;return function(_0x3178d7){if(_0x3178d7){return _0x58f526[_0x9881('0x16')](_0x12794f)[_0x9881('0x17')](_0x3178d7);}};}function respondWithFilteredResult(_0x39d127,_0x1d57ea){return function(_0x4b9d1b){if(_0x4b9d1b){var _0x411513=typeof _0x1d57ea[_0x9881('0x18')]===_0x9881('0x19')&&typeof _0x1d57ea['limit']==='undefined';var _0x4c92c9=_0x4b9d1b[_0x9881('0x1a')];var _0x4c3493=_0x411513?0x0:_0x1d57ea[_0x9881('0x18')];var _0x5a9848=_0x411513?_0x4b9d1b['count']:_0x1d57ea[_0x9881('0x18')]+_0x1d57ea[_0x9881('0x1b')];var _0x1cbac3;if(_0x5a9848>=_0x4c92c9){_0x5a9848=_0x4c92c9;_0x1cbac3=0xc8;}else{_0x1cbac3=0xce;}_0x39d127[_0x9881('0x16')](_0x1cbac3);return _0x39d127[_0x9881('0x1c')](_0x9881('0x1d'),_0x4c3493+'-'+_0x5a9848+'/'+_0x4c92c9)[_0x9881('0x17')](_0x4b9d1b);}return null;};}function patchUpdates(_0x1243cc){return function(_0x1ee450){try{jsonpatch[_0x9881('0x1e')](_0x1ee450,_0x1243cc,!![]);}catch(_0x32ca84){return BPromise[_0x9881('0x1f')](_0x32ca84);}return _0x1ee450[_0x9881('0x20')]();};}function saveUpdates(_0x300fa6,_0x174b39){return function(_0x58485d){if(_0x58485d){return _0x58485d['update'](_0x300fa6)[_0x9881('0x21')](function(_0x513545){return _0x513545;});}return null;};}function removeEntity(_0x499461,_0x1ba558){return function(_0x30ed15){if(_0x30ed15){return _0x30ed15['destroy']()['then'](function(){_0x499461[_0x9881('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bddc1,_0x161f8d){return function(_0x16eeca){if(!_0x16eeca){_0x2bddc1[_0x9881('0x22')](0x194);}return _0x16eeca;};}function handleError(_0x2c3cd1,_0x14e6f9){_0x14e6f9=_0x14e6f9||0x1f4;return function(_0x2f6b7c){logger[_0x9881('0x23')](_0x2f6b7c[_0x9881('0x24')]);if(_0x2f6b7c[_0x9881('0x25')]){delete _0x2f6b7c[_0x9881('0x25')];}_0x2c3cd1[_0x9881('0x16')](_0x14e6f9)[_0x9881('0x26')](_0x2f6b7c);};}exports['index']=function(_0x31956e,_0x41fe0d){var _0x5c2815={},_0x236979={},_0x3d7120={'count':0x0,'rows':[]};var _0x4970be=_[_0x9881('0x27')](db[_0x9881('0x28')][_0x9881('0x29')],function(_0x204f2b){return{'name':_0x204f2b[_0x9881('0x2a')],'type':_0x204f2b[_0x9881('0x2b')][_0x9881('0x2c')]};});_0x236979[_0x9881('0x2d')]=_['map'](_0x4970be,_0x9881('0x25'));_0x236979[_0x9881('0x2e')]=_[_0x9881('0x2f')](_0x31956e[_0x9881('0x2e')]);_0x236979[_0x9881('0x30')]=_[_0x9881('0x31')](_0x236979['model'],_0x236979[_0x9881('0x2e')]);_0x5c2815[_0x9881('0x32')]=_['intersection'](_0x236979[_0x9881('0x2d')],qs[_0x9881('0x33')](_0x31956e[_0x9881('0x2e')][_0x9881('0x33')]));_0x5c2815[_0x9881('0x32')]=_0x5c2815['attributes'][_0x9881('0x34')]?_0x5c2815[_0x9881('0x32')]:_0x236979[_0x9881('0x2d')];if(!_0x31956e[_0x9881('0x2e')][_0x9881('0x35')](_0x9881('0x36'))){_0x5c2815[_0x9881('0x1b')]=qs[_0x9881('0x1b')](_0x31956e[_0x9881('0x2e')][_0x9881('0x1b')]);_0x5c2815[_0x9881('0x18')]=qs[_0x9881('0x18')](_0x31956e[_0x9881('0x2e')][_0x9881('0x18')]);}_0x5c2815[_0x9881('0x37')]=qs[_0x9881('0x38')](_0x31956e['query'][_0x9881('0x38')]);_0x5c2815['where']=qs[_0x9881('0x30')](_['pick'](_0x31956e[_0x9881('0x2e')],_0x236979[_0x9881('0x30')]),_0x4970be);if(_0x31956e['query'][_0x9881('0x39')]){_0x5c2815['where']=_[_0x9881('0x3a')](_0x5c2815[_0x9881('0x3b')],{'$or':_[_0x9881('0x27')](_0x4970be,function(_0x204fc3){if(_0x204fc3['type']!==_0x9881('0x3c')){var _0x3d183e={};_0x3d183e[_0x204fc3[_0x9881('0x25')]]={'$like':'%'+_0x31956e[_0x9881('0x2e')][_0x9881('0x39')]+'%'};return _0x3d183e;}})});}_0x5c2815=_[_0x9881('0x3a')]({},_0x5c2815,_0x31956e[_0x9881('0x3d')]);var _0x4feb70={'where':_0x5c2815[_0x9881('0x3b')]};return db['Cdr'][_0x9881('0x1a')](_0x4feb70)[_0x9881('0x21')](function(_0x1c0396){_0x3d7120['count']=_0x1c0396;if(_0x31956e[_0x9881('0x2e')][_0x9881('0x3e')]){_0x5c2815[_0x9881('0x3f')]=[{'all':!![]}];}return db['Cdr'][_0x9881('0x40')](_0x5c2815);})[_0x9881('0x21')](function(_0x4fe13d){_0x3d7120[_0x9881('0x41')]=_0x4fe13d;return _0x3d7120;})[_0x9881('0x21')](respondWithFilteredResult(_0x41fe0d,_0x5c2815))[_0x9881('0x42')](handleError(_0x41fe0d,null));};exports[_0x9881('0x43')]=function(_0x424ed1,_0x1eae2f){var _0x2ac606={'raw':!![],'where':{'id':_0x424ed1[_0x9881('0x44')]['id']}},_0x4421bc={};_0x4421bc[_0x9881('0x2d')]=_['keys'](db[_0x9881('0x28')][_0x9881('0x29')]);_0x4421bc[_0x9881('0x2e')]=_[_0x9881('0x2f')](_0x424ed1[_0x9881('0x2e')]);_0x4421bc['filters']=_[_0x9881('0x31')](_0x4421bc[_0x9881('0x2d')],_0x4421bc[_0x9881('0x2e')]);_0x2ac606[_0x9881('0x32')]=_['intersection'](_0x4421bc[_0x9881('0x2d')],qs[_0x9881('0x33')](_0x424ed1[_0x9881('0x2e')]['fields']));_0x2ac606[_0x9881('0x32')]=_0x2ac606[_0x9881('0x32')][_0x9881('0x34')]?_0x2ac606[_0x9881('0x32')]:_0x4421bc[_0x9881('0x2d')];if(_0x424ed1[_0x9881('0x2e')][_0x9881('0x3e')]){_0x2ac606[_0x9881('0x3f')]=[{'all':!![]}];}_0x2ac606=_[_0x9881('0x3a')]({},_0x2ac606,_0x424ed1[_0x9881('0x3d')]);return db['Cdr'][_0x9881('0x45')](_0x2ac606)[_0x9881('0x21')](handleEntityNotFound(_0x1eae2f,null))[_0x9881('0x21')](respondWithResult(_0x1eae2f,null))['catch'](handleError(_0x1eae2f,null));};exports[_0x9881('0x46')]=function(_0x24a52b,_0x1e1f0f){return db['Cdr']['create'](_0x24a52b[_0x9881('0x47')],{})[_0x9881('0x21')](respondWithResult(_0x1e1f0f,0xc9))[_0x9881('0x42')](handleError(_0x1e1f0f,null));};exports[_0x9881('0x48')]=function(_0x49c478,_0x514263){if(_0x49c478[_0x9881('0x47')]['id']){delete _0x49c478[_0x9881('0x47')]['id'];}return db[_0x9881('0x28')]['find']({'where':{'id':_0x49c478[_0x9881('0x44')]['id']}})[_0x9881('0x21')](handleEntityNotFound(_0x514263,null))['then'](saveUpdates(_0x49c478[_0x9881('0x47')],null))[_0x9881('0x21')](respondWithResult(_0x514263,null))[_0x9881('0x42')](handleError(_0x514263,null));};exports[_0x9881('0x49')]=function(_0x21720a,_0x32cb89){return db[_0x9881('0x28')]['find']({'where':{'id':_0x21720a[_0x9881('0x44')]['id']}})['then'](handleEntityNotFound(_0x32cb89,null))[_0x9881('0x21')](removeEntity(_0x32cb89,null))[_0x9881('0x42')](handleError(_0x32cb89,null));};exports[_0x9881('0x4a')]=function(_0x16ca26,_0x590acc){return db['Cdr'][_0x9881('0x4a')]()[_0x9881('0x21')](respondWithResult(_0x590acc,null))[_0x9881('0x42')](handleError(_0x590acc,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 36bd906..21643bb 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x2172ef,_0x46b33c){var _0x2b877e=function(_0x2b4e59){while(--_0x2b4e59){_0x2172ef['push'](_0x2172ef['shift']());}};_0x2b877e(++_0x46b33c);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5b4d9f,_0x36c964){var _0x45b0c6=function(_0x13e25b){while(--_0x13e25b){_0x5b4d9f['push'](_0x5b4d9f['shift']());}};_0x45b0c6(++_0x36c964);}(_0x7a54,0x106));var _0x47a5=function(_0x1251e2,_0x4731f6){_0x1251e2=_0x1251e2-0x0;var _0x22c7e6=_0x7a54[_0x1251e2];return _0x22c7e6;};'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 bac65d7..ea3e74b 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 _0x213f=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xa5ac1a,_0x11d10f){var _0x445c64=function(_0x5287e7){while(--_0x5287e7){_0xa5ac1a['push'](_0xa5ac1a['shift']());}};_0x445c64(++_0x11d10f);}(_0x213f,0x8d));var _0xf213=function(_0x1ac216,_0x2d5593){_0x1ac216=_0x1ac216-0x0;var _0x2e887f=_0x213f[_0x1ac216];return _0x2e887f;};'use strict';var _=require(_0xf213('0x0'));var util=require(_0xf213('0x1'));var moment=require(_0xf213('0x2'));var BPromise=require(_0xf213('0x3'));var rs=require(_0xf213('0x4'));var fs=require('fs');var Redis=require(_0xf213('0x5'));var db=require(_0xf213('0x6'))['db'];var utils=require(_0xf213('0x7'));var logger=require(_0xf213('0x8'))(_0xf213('0x9'));var config=require(_0xf213('0xa'));var jayson=require(_0xf213('0xb'));var client=jayson[_0xf213('0xc')][_0xf213('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x20a00a,_0x104749,_0x1cdb7e){return new BPromise(function(_0x1d38d8,_0x3882f3){return client[_0xf213('0xe')](_0x20a00a,_0x1cdb7e)['then'](function(_0x850555){logger[_0xf213('0xf')](_0xf213('0x10'),_0x104749,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x104749,_0xf213('0x11'),JSON[_0xf213('0x12')](_0x850555));if(_0x850555['error']){if(_0x850555[_0xf213('0x13')][_0xf213('0x14')]===0x1f4){logger[_0xf213('0x13')](_0xf213('0x10'),_0x104749,_0x850555[_0xf213('0x13')][_0xf213('0x15')]);return _0x3882f3(_0x850555['error']['message']);}logger[_0xf213('0x13')](_0xf213('0x10'),_0x104749,_0x850555['error'][_0xf213('0x15')]);return _0x1d38d8(_0x850555['error'][_0xf213('0x15')]);}else{logger[_0xf213('0xf')]('Cdr,\x20%s,\x20%s',_0x104749,_0xf213('0x11'));_0x1d38d8(_0x850555['result'][_0xf213('0x15')]);}})[_0xf213('0x16')](function(_0x562be5){logger['error'](_0xf213('0x10'),_0x104749,_0x562be5);_0x3882f3(_0x562be5);});});} \ No newline at end of file +var _0x8711=['../../config/logger','../../config/environment','jayson/promise','client','http','request','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Cdr,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3e379b,_0x119328){var _0x42398a=function(_0x3aa63d){while(--_0x3aa63d){_0x3e379b['push'](_0x3e379b['shift']());}};_0x42398a(++_0x119328);}(_0x8711,0x1ae));var _0x1871=function(_0x49b720,_0x10e9f2){_0x49b720=_0x49b720-0x0;var _0x290c1b=_0x8711[_0x49b720];return _0x290c1b;};'use strict';var _=require(_0x1871('0x0'));var util=require('util');var moment=require(_0x1871('0x1'));var BPromise=require(_0x1871('0x2'));var rs=require(_0x1871('0x3'));var fs=require('fs');var Redis=require(_0x1871('0x4'));var db=require(_0x1871('0x5'))['db'];var utils=require(_0x1871('0x6'));var logger=require(_0x1871('0x7'))('rpc');var config=require(_0x1871('0x8'));var jayson=require(_0x1871('0x9'));var client=jayson[_0x1871('0xa')][_0x1871('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b54f1,_0x2b0d0e,_0x52e3dd){return new BPromise(function(_0x55a38b,_0x5ee3f4){return client[_0x1871('0xc')](_0x1b54f1,_0x52e3dd)['then'](function(_0x337c20){logger['info']('Cdr,\x20%s,\x20%s',_0x2b0d0e,'request\x20sent');logger['debug'](_0x1871('0xd'),_0x2b0d0e,_0x1871('0xe'),JSON[_0x1871('0xf')](_0x337c20));if(_0x337c20[_0x1871('0x10')]){if(_0x337c20[_0x1871('0x10')][_0x1871('0x11')]===0x1f4){logger[_0x1871('0x10')](_0x1871('0x12'),_0x2b0d0e,_0x337c20[_0x1871('0x10')][_0x1871('0x13')]);return _0x5ee3f4(_0x337c20['error'][_0x1871('0x13')]);}logger[_0x1871('0x10')]('Cdr,\x20%s,\x20%s',_0x2b0d0e,_0x337c20['error'][_0x1871('0x13')]);return _0x55a38b(_0x337c20[_0x1871('0x10')][_0x1871('0x13')]);}else{logger[_0x1871('0x14')](_0x1871('0x12'),_0x2b0d0e,_0x1871('0xe'));_0x55a38b(_0x337c20[_0x1871('0x15')][_0x1871('0x13')]);}})[_0x1871('0x16')](function(_0x58b424){logger[_0x1871('0x10')](_0x1871('0x12'),_0x2b0d0e,_0x58b424);_0x5ee3f4(_0x58b424);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 91d5fe8..c844c72 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5be1d6,_0x52ab2a){var _0x5d9bd4=function(_0x4f05ba){while(--_0x4f05ba){_0x5be1d6['push'](_0x5be1d6['shift']());}};_0x5d9bd4(++_0x52ab2a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 7430cbc..fe05a7a 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 _0x5878=['*,*,*,*','exports','INTEGER','STRING','TEXT'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x5878,0xd8));var _0x8587=function(_0x2bb6fa,_0x25c421){_0x2bb6fa=_0x2bb6fa-0x0;var _0x5f4e5b=_0x5878[_0x2bb6fa];return _0x5f4e5b;};'use strict';var Sequelize=require('sequelize');module[_0x8587('0x0')]={'priority':{'type':Sequelize[_0x8587('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8587('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8587('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8587('0x2')],'defaultValue':_0x8587('0x4')}}; \ No newline at end of file +var _0xbe42=['sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x2f9f23,_0x40ae1e){var _0x2381ef=function(_0x1e092a){while(--_0x1e092a){_0x2f9f23['push'](_0x2f9f23['shift']());}};_0x2381ef(++_0x40ae1e);}(_0xbe42,0x1ae));var _0x2be4=function(_0x5b13c3,_0x378e0a){_0x5b13c3=_0x5b13c3-0x0;var _0x3d6780=_0xbe42[_0x5b13c3];return _0x3d6780;};'use strict';var Sequelize=require(_0x2be4('0x0'));module[_0x2be4('0x1')]={'priority':{'type':Sequelize[_0x2be4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2be4('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2be4('0x4')]()},'description':{'type':Sequelize[_0x2be4('0x3')]},'interval':{'type':Sequelize[_0x2be4('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 90d25f3..a1ad639 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 _0xa769=['update','then','destroy','error','stack','name','send','params','keys','ChatApplication','rawAttributes','query','intersection','model','attributes','fields','length','includeAll','include','merge','catch','body','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject'];(function(_0x594d34,_0x4eaa08){var _0x56e972=function(_0x4870ae){while(--_0x4870ae){_0x594d34['push'](_0x594d34['shift']());}};_0x56e972(++_0x4eaa08);}(_0xa769,0xfb));var _0x9a76=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa769[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x9a76('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a76('0x1'));var jsonpatch=require(_0x9a76('0x2'));var rp=require(_0x9a76('0x3'));var moment=require('moment');var BPromise=require(_0x9a76('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9a76('0x5'));var sox=require(_0x9a76('0x6'));var csv=require('to-csv');var ejs=require(_0x9a76('0x7'));var fs=require('fs');var fs_extra=require(_0x9a76('0x8'));var _=require(_0x9a76('0x9'));var squel=require(_0x9a76('0xa'));var crypto=require(_0x9a76('0xb'));var jsforce=require(_0x9a76('0xc'));var deskjs=require(_0x9a76('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9a76('0xe'));var Papa=require(_0x9a76('0xf'));var Redis=require(_0x9a76('0x10'));var authService=require(_0x9a76('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a76('0x12'));var logger=require('../../config/logger')(_0x9a76('0x13'));var utils=require(_0x9a76('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9a76('0x15'));var db=require(_0x9a76('0x16'))['db'];function respondWithStatusCode(_0x5852f9,_0x34b7c9){_0x34b7c9=_0x34b7c9||0xcc;return function(_0x30d1be){if(_0x30d1be){return _0x5852f9[_0x9a76('0x17')](_0x34b7c9);}return _0x5852f9[_0x9a76('0x18')](_0x34b7c9)[_0x9a76('0x19')]();};}function respondWithResult(_0xbb0dda,_0x204e33){_0x204e33=_0x204e33||0xc8;return function(_0x28ebac){if(_0x28ebac){return _0xbb0dda[_0x9a76('0x18')](_0x204e33)[_0x9a76('0x1a')](_0x28ebac);}};}function respondWithFilteredResult(_0x42cd61,_0x259664){return function(_0x1e687a){if(_0x1e687a){var _0x54028e=typeof _0x259664[_0x9a76('0x1b')]==='undefined'&&typeof _0x259664[_0x9a76('0x1c')]===_0x9a76('0x1d');var _0x140b08=_0x1e687a[_0x9a76('0x1e')];var _0x38e509=_0x54028e?0x0:_0x259664[_0x9a76('0x1b')];var _0x58a964=_0x54028e?_0x1e687a['count']:_0x259664[_0x9a76('0x1b')]+_0x259664[_0x9a76('0x1c')];var _0x248dcb;if(_0x58a964>=_0x140b08){_0x58a964=_0x140b08;_0x248dcb=0xc8;}else{_0x248dcb=0xce;}_0x42cd61[_0x9a76('0x18')](_0x248dcb);return _0x42cd61[_0x9a76('0x1f')](_0x9a76('0x20'),_0x38e509+'-'+_0x58a964+'/'+_0x140b08)['json'](_0x1e687a);}return null;};}function patchUpdates(_0x17de93){return function(_0x3ebe6c){try{jsonpatch['apply'](_0x3ebe6c,_0x17de93,!![]);}catch(_0x2e9dcf){return BPromise[_0x9a76('0x21')](_0x2e9dcf);}return _0x3ebe6c['save']();};}function saveUpdates(_0x3adc8e,_0x35b608){return function(_0x3e978f){if(_0x3e978f){return _0x3e978f[_0x9a76('0x22')](_0x3adc8e)[_0x9a76('0x23')](function(_0x4a40bf){return _0x4a40bf;});}return null;};}function removeEntity(_0x1a4667,_0x5c3afa){return function(_0x523727){if(_0x523727){return _0x523727[_0x9a76('0x24')]()[_0x9a76('0x23')](function(){_0x1a4667[_0x9a76('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d7f2b,_0x4d8d8d){return function(_0x57d6d7){if(!_0x57d6d7){_0x3d7f2b[_0x9a76('0x17')](0x194);}return _0x57d6d7;};}function handleError(_0x5941bc,_0xa848f){_0xa848f=_0xa848f||0x1f4;return function(_0x33707a){logger[_0x9a76('0x25')](_0x33707a[_0x9a76('0x26')]);if(_0x33707a[_0x9a76('0x27')]){delete _0x33707a[_0x9a76('0x27')];}_0x5941bc[_0x9a76('0x18')](_0xa848f)[_0x9a76('0x28')](_0x33707a);};}exports['show']=function(_0x42c35b,_0x49cc2f){var _0xd81bb8={'raw':!![],'where':{'id':_0x42c35b[_0x9a76('0x29')]['id']}},_0x328458={};_0x328458['model']=_[_0x9a76('0x2a')](db[_0x9a76('0x2b')][_0x9a76('0x2c')]);_0x328458[_0x9a76('0x2d')]=_[_0x9a76('0x2a')](_0x42c35b[_0x9a76('0x2d')]);_0x328458['filters']=_[_0x9a76('0x2e')](_0x328458[_0x9a76('0x2f')],_0x328458[_0x9a76('0x2d')]);_0xd81bb8[_0x9a76('0x30')]=_['intersection'](_0x328458[_0x9a76('0x2f')],qs[_0x9a76('0x31')](_0x42c35b[_0x9a76('0x2d')]['fields']));_0xd81bb8[_0x9a76('0x30')]=_0xd81bb8[_0x9a76('0x30')][_0x9a76('0x32')]?_0xd81bb8['attributes']:_0x328458[_0x9a76('0x2f')];if(_0x42c35b[_0x9a76('0x2d')][_0x9a76('0x33')]){_0xd81bb8[_0x9a76('0x34')]=[{'all':!![]}];}_0xd81bb8=_[_0x9a76('0x35')]({},_0xd81bb8,_0x42c35b['options']);return db[_0x9a76('0x2b')]['find'](_0xd81bb8)[_0x9a76('0x23')](handleEntityNotFound(_0x49cc2f,null))[_0x9a76('0x23')](respondWithResult(_0x49cc2f,null))[_0x9a76('0x36')](handleError(_0x49cc2f,null));};exports['update']=function(_0x4ba311,_0x53fea2){if(_0x4ba311[_0x9a76('0x37')]['id']){delete _0x4ba311[_0x9a76('0x37')]['id'];}return db['ChatApplication'][_0x9a76('0x38')]({'where':{'id':_0x4ba311[_0x9a76('0x29')]['id']}})[_0x9a76('0x23')](handleEntityNotFound(_0x53fea2,null))[_0x9a76('0x23')](saveUpdates(_0x4ba311[_0x9a76('0x37')],null))[_0x9a76('0x23')](respondWithResult(_0x53fea2,null))['catch'](handleError(_0x53fea2,null));};exports[_0x9a76('0x24')]=function(_0x5f1d3d,_0x166623){return db['ChatApplication'][_0x9a76('0x38')]({'where':{'id':_0x5f1d3d['params']['id']}})[_0x9a76('0x23')](handleEntityNotFound(_0x166623,null))[_0x9a76('0x23')](removeEntity(_0x166623,null))[_0x9a76('0x36')](handleError(_0x166623,null));}; \ No newline at end of file +var _0x7070=['catch','update','body','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','limit','undefined','set','json','save','then','destroy','error','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','model','fields','length','include','merge','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7070,0x1d7));var _0x0707=function(_0x36c62a,_0xc2800){_0x36c62a=_0x36c62a-0x0;var _0x1e9cee=_0x7070[_0x36c62a];return _0x1e9cee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0707('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0707('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0707('0x2'));var Mustache=require(_0x0707('0x3'));var util=require(_0x0707('0x4'));var path=require(_0x0707('0x5'));var sox=require('sox');var csv=require(_0x0707('0x6'));var ejs=require(_0x0707('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0707('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0707('0x9'));var toCsv=require(_0x0707('0x6'));var querystring=require(_0x0707('0xa'));var Papa=require(_0x0707('0xb'));var Redis=require(_0x0707('0xc'));var authService=require(_0x0707('0xd'));var qs=require(_0x0707('0xe'));var as=require(_0x0707('0xf'));var hardwareService=require(_0x0707('0x10'));var logger=require(_0x0707('0x11'))('api');var utils=require(_0x0707('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x0707('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b55c6,_0x2bd4d8){_0x2bd4d8=_0x2bd4d8||0xcc;return function(_0x3eeea8){if(_0x3eeea8){return _0x3b55c6[_0x0707('0x14')](_0x2bd4d8);}return _0x3b55c6[_0x0707('0x15')](_0x2bd4d8)[_0x0707('0x16')]();};}function respondWithResult(_0x3b0f64,_0x111fd7){_0x111fd7=_0x111fd7||0xc8;return function(_0x380abc){if(_0x380abc){return _0x3b0f64[_0x0707('0x15')](_0x111fd7)['json'](_0x380abc);}};}function respondWithFilteredResult(_0x5bae3d,_0x3fce78){return function(_0x429da2){if(_0x429da2){var _0x1370b3=typeof _0x3fce78[_0x0707('0x17')]==='undefined'&&typeof _0x3fce78[_0x0707('0x18')]===_0x0707('0x19');var _0xe1cf0e=_0x429da2['count'];var _0x13d5de=_0x1370b3?0x0:_0x3fce78['offset'];var _0x471431=_0x1370b3?_0x429da2['count']:_0x3fce78[_0x0707('0x17')]+_0x3fce78[_0x0707('0x18')];var _0x1debb9;if(_0x471431>=_0xe1cf0e){_0x471431=_0xe1cf0e;_0x1debb9=0xc8;}else{_0x1debb9=0xce;}_0x5bae3d[_0x0707('0x15')](_0x1debb9);return _0x5bae3d[_0x0707('0x1a')]('Content-Range',_0x13d5de+'-'+_0x471431+'/'+_0xe1cf0e)[_0x0707('0x1b')](_0x429da2);}return null;};}function patchUpdates(_0x360caf){return function(_0x37d1fd){try{jsonpatch['apply'](_0x37d1fd,_0x360caf,!![]);}catch(_0x5c8731){return BPromise['reject'](_0x5c8731);}return _0x37d1fd[_0x0707('0x1c')]();};}function saveUpdates(_0x3f31e1,_0x1d133c){return function(_0x51dec4){if(_0x51dec4){return _0x51dec4['update'](_0x3f31e1)[_0x0707('0x1d')](function(_0x225a58){return _0x225a58;});}return null;};}function removeEntity(_0x370554,_0x3e9c41){return function(_0x3ba507){if(_0x3ba507){return _0x3ba507[_0x0707('0x1e')]()[_0x0707('0x1d')](function(){_0x370554[_0x0707('0x15')](0xcc)[_0x0707('0x16')]();});}};}function handleEntityNotFound(_0x3dc5fb,_0x392acd){return function(_0x373bca){if(!_0x373bca){_0x3dc5fb['sendStatus'](0x194);}return _0x373bca;};}function handleError(_0x14d68b,_0x1834e0){_0x1834e0=_0x1834e0||0x1f4;return function(_0x3be832){logger[_0x0707('0x1f')](_0x3be832['stack']);if(_0x3be832[_0x0707('0x20')]){delete _0x3be832[_0x0707('0x20')];}_0x14d68b[_0x0707('0x15')](_0x1834e0)[_0x0707('0x21')](_0x3be832);};}exports[_0x0707('0x22')]=function(_0x599090,_0x1a4f0b){var _0x3378a5={'raw':!![],'where':{'id':_0x599090[_0x0707('0x23')]['id']}},_0x2f0ed2={};_0x2f0ed2['model']=_[_0x0707('0x24')](db[_0x0707('0x25')][_0x0707('0x26')]);_0x2f0ed2[_0x0707('0x27')]=_[_0x0707('0x24')](_0x599090[_0x0707('0x27')]);_0x2f0ed2[_0x0707('0x28')]=_['intersection'](_0x2f0ed2['model'],_0x2f0ed2[_0x0707('0x27')]);_0x3378a5[_0x0707('0x29')]=_[_0x0707('0x2a')](_0x2f0ed2[_0x0707('0x2b')],qs['fields'](_0x599090[_0x0707('0x27')][_0x0707('0x2c')]));_0x3378a5['attributes']=_0x3378a5[_0x0707('0x29')][_0x0707('0x2d')]?_0x3378a5['attributes']:_0x2f0ed2[_0x0707('0x2b')];if(_0x599090[_0x0707('0x27')]['includeAll']){_0x3378a5[_0x0707('0x2e')]=[{'all':!![]}];}_0x3378a5=_[_0x0707('0x2f')]({},_0x3378a5,_0x599090['options']);return db[_0x0707('0x25')][_0x0707('0x30')](_0x3378a5)[_0x0707('0x1d')](handleEntityNotFound(_0x1a4f0b,null))[_0x0707('0x1d')](respondWithResult(_0x1a4f0b,null))[_0x0707('0x31')](handleError(_0x1a4f0b,null));};exports[_0x0707('0x32')]=function(_0x19c84,_0x5e5b1a){if(_0x19c84[_0x0707('0x33')]['id']){delete _0x19c84[_0x0707('0x33')]['id'];}return db[_0x0707('0x25')]['find']({'where':{'id':_0x19c84[_0x0707('0x23')]['id']}})[_0x0707('0x1d')](handleEntityNotFound(_0x5e5b1a,null))['then'](saveUpdates(_0x19c84[_0x0707('0x33')],null))[_0x0707('0x1d')](respondWithResult(_0x5e5b1a,null))[_0x0707('0x31')](handleError(_0x5e5b1a,null));};exports['destroy']=function(_0x362d24,_0x4d093c){return db[_0x0707('0x25')][_0x0707('0x30')]({'where':{'id':_0x362d24[_0x0707('0x23')]['id']}})[_0x0707('0x1d')](handleEntityNotFound(_0x4d093c,null))[_0x0707('0x1d')](removeEntity(_0x4d093c,null))[_0x0707('0x31')](handleError(_0x4d093c,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 177a4e4..59254ec 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 _0x2e89=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5aeacb,_0x1b9944){var _0x40861c=function(_0x28c29a){while(--_0x28c29a){_0x5aeacb['push'](_0x5aeacb['shift']());}};_0x40861c(++_0x1b9944);}(_0x2e89,0x1e9));var _0x92e8=function(_0x599d6b,_0x50b07d){_0x599d6b=_0x599d6b-0x0;var _0x38cac5=_0x2e89[_0x599d6b];return _0x38cac5;};'use strict';var _=require(_0x92e8('0x0'));var util=require(_0x92e8('0x1'));var logger=require(_0x92e8('0x2'))(_0x92e8('0x3'));var moment=require('moment');var BPromise=require(_0x92e8('0x4'));var rp=require(_0x92e8('0x5'));var fs=require('fs');var path=require(_0x92e8('0x6'));var rimraf=require(_0x92e8('0x7'));var config=require('../../config/environment');var attributes=require(_0x92e8('0x8'));module['exports']=function(_0x1fc289,_0x5bdac5){return _0x1fc289[_0x92e8('0x9')](_0x92e8('0xa'),attributes,{'tableName':_0x92e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x92e8('0xc'),'collate':_0x92e8('0xd')});}; \ No newline at end of file +var _0xc006=['utf8mb4_unicode_ci','lodash','api','moment','bluebird','path','../../config/environment','./chatApplication.attributes','ChatApplication','chat_applications','utf8mb4'];(function(_0xf4de0,_0x47c903){var _0x35dbeb=function(_0x35254b){while(--_0x35254b){_0xf4de0['push'](_0xf4de0['shift']());}};_0x35dbeb(++_0x47c903);}(_0xc006,0x1e5));var _0x6c00=function(_0x19aaa9,_0x9d0bb6){_0x19aaa9=_0x19aaa9-0x0;var _0x465463=_0xc006[_0x19aaa9];return _0x465463;};'use strict';var _=require(_0x6c00('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6c00('0x1'));var moment=require(_0x6c00('0x2'));var BPromise=require(_0x6c00('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c00('0x4'));var rimraf=require('rimraf');var config=require(_0x6c00('0x5'));var attributes=require(_0x6c00('0x6'));module['exports']=function(_0x3c0e2c,_0x581c8f){return _0x3c0e2c['define'](_0x6c00('0x7'),attributes,{'tableName':_0x6c00('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6c00('0x9'),'collate':_0x6c00('0xa')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 3473fa4..43d0256 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 _0x66bf=['jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3e15a6,_0x2b88cf){var _0xcaee13=function(_0x4fa1e1){while(--_0x4fa1e1){_0x3e15a6['push'](_0x3e15a6['shift']());}};_0xcaee13(++_0x2b88cf);}(_0x66bf,0xad));var _0xf66b=function(_0xcbacee,_0x1ecdb2){_0xcbacee=_0xcbacee-0x0;var _0x54e9b6=_0x66bf[_0xcbacee];return _0x54e9b6;};'use strict';var _=require(_0xf66b('0x0'));var util=require(_0xf66b('0x1'));var moment=require(_0xf66b('0x2'));var BPromise=require(_0xf66b('0x3'));var rs=require(_0xf66b('0x4'));var fs=require('fs');var Redis=require(_0xf66b('0x5'));var db=require(_0xf66b('0x6'))['db'];var utils=require(_0xf66b('0x7'));var logger=require(_0xf66b('0x8'))(_0xf66b('0x9'));var config=require(_0xf66b('0xa'));var jayson=require(_0xf66b('0xb'));var client=jayson['client'][_0xf66b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3670f4,_0x4913da,_0x4f4d9c){return new BPromise(function(_0x4523af,_0x242ef4){return client[_0xf66b('0xd')](_0x3670f4,_0x4f4d9c)[_0xf66b('0xe')](function(_0x24ef18){logger[_0xf66b('0xf')](_0xf66b('0x10'),_0x4913da,_0xf66b('0x11'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4913da,_0xf66b('0x11'),JSON[_0xf66b('0x12')](_0x24ef18));if(_0x24ef18[_0xf66b('0x13')]){if(_0x24ef18[_0xf66b('0x13')]['code']===0x1f4){logger['error'](_0xf66b('0x10'),_0x4913da,_0x24ef18[_0xf66b('0x13')][_0xf66b('0x14')]);return _0x242ef4(_0x24ef18['error'][_0xf66b('0x14')]);}logger[_0xf66b('0x13')]('ChatApplication,\x20%s,\x20%s',_0x4913da,_0x24ef18['error'][_0xf66b('0x14')]);return _0x4523af(_0x24ef18[_0xf66b('0x13')][_0xf66b('0x14')]);}else{logger['info'](_0xf66b('0x10'),_0x4913da,'request\x20sent');_0x4523af(_0x24ef18[_0xf66b('0x15')][_0xf66b('0x14')]);}})[_0xf66b('0x16')](function(_0x21eb67){logger[_0xf66b('0x13')]('ChatApplication,\x20%s,\x20%s',_0x4913da,_0x21eb67);_0x242ef4(_0x21eb67);});});} \ No newline at end of file +var _0x3fd4=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x4a98ab,_0x1939c0){var _0xe8cf65=function(_0x2e75e1){while(--_0x2e75e1){_0x4a98ab['push'](_0x4a98ab['shift']());}};_0xe8cf65(++_0x1939c0);}(_0x3fd4,0x151));var _0x43fd=function(_0x176d0e,_0x2a9e65){_0x176d0e=_0x176d0e-0x0;var _0x2cd033=_0x3fd4[_0x176d0e];return _0x2cd033;};'use strict';var _=require(_0x43fd('0x0'));var util=require(_0x43fd('0x1'));var moment=require('moment');var BPromise=require(_0x43fd('0x2'));var rs=require(_0x43fd('0x3'));var fs=require('fs');var Redis=require(_0x43fd('0x4'));var db=require(_0x43fd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x43fd('0x6'))('rpc');var config=require(_0x43fd('0x7'));var jayson=require(_0x43fd('0x8'));var client=jayson['client'][_0x43fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48beb5,_0x2bfa59,_0x43b0c1){return new BPromise(function(_0x40fe8c,_0x470784){return client[_0x43fd('0xa')](_0x48beb5,_0x43b0c1)['then'](function(_0x270361){logger['info'](_0x43fd('0xb'),_0x2bfa59,_0x43fd('0xc'));logger[_0x43fd('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x2bfa59,_0x43fd('0xc'),JSON[_0x43fd('0xe')](_0x270361));if(_0x270361[_0x43fd('0xf')]){if(_0x270361[_0x43fd('0xf')][_0x43fd('0x10')]===0x1f4){logger['error'](_0x43fd('0xb'),_0x2bfa59,_0x270361['error'][_0x43fd('0x11')]);return _0x470784(_0x270361['error']['message']);}logger[_0x43fd('0xf')](_0x43fd('0xb'),_0x2bfa59,_0x270361['error'][_0x43fd('0x11')]);return _0x40fe8c(_0x270361[_0x43fd('0xf')][_0x43fd('0x11')]);}else{logger[_0x43fd('0x12')](_0x43fd('0xb'),_0x2bfa59,_0x43fd('0xc'));_0x40fe8c(_0x270361[_0x43fd('0x13')][_0x43fd('0x11')]);}})[_0x43fd('0x14')](function(_0x237094){logger[_0x43fd('0xf')](_0x43fd('0xb'),_0x2bfa59,_0x237094);_0x470784(_0x237094);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index f6fb035..aea51b2 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 _0xa295=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','delete','multer','util','express'];(function(_0x603961,_0xdc5cdd){var _0x247340=function(_0x3f3ae0){while(--_0x3f3ae0){_0x603961['push'](_0x603961['shift']());}};_0x247340(++_0xdc5cdd);}(_0xa295,0x10e));var _0x5a29=function(_0x25e266,_0x3f2a25){_0x25e266=_0x25e266-0x0;var _0x5472a6=_0xa295[_0x25e266];return _0x5472a6;};'use strict';var multer=require(_0x5a29('0x0'));var util=require(_0x5a29('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5a29('0x2'));var router=express[_0x5a29('0x3')]();var fs_extra=require(_0x5a29('0x4'));var auth=require(_0x5a29('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5a29('0x6'));var controller=require(_0x5a29('0x7'));router['get'](_0x5a29('0x8'),auth[_0x5a29('0x9')](),controller[_0x5a29('0xa')]);router[_0x5a29('0xb')]('/:id',auth[_0x5a29('0x9')](),controller['update']);router[_0x5a29('0xc')](_0x5a29('0x8'),auth[_0x5a29('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd301=['../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x25078f,_0x4b839a){var _0x4a26d8=function(_0x35d5f0){while(--_0x35d5f0){_0x25078f['push'](_0x25078f['shift']());}};_0x4a26d8(++_0x4b839a);}(_0xd301,0xc5));var _0x1d30=function(_0xd3c1fc,_0x54e814){_0xd3c1fc=_0xd3c1fc-0x0;var _0x2735ed=_0xd301[_0xd3c1fc];return _0x2735ed;};'use strict';var multer=require(_0x1d30('0x0'));var util=require(_0x1d30('0x1'));var path=require(_0x1d30('0x2'));var timeout=require(_0x1d30('0x3'));var express=require(_0x1d30('0x4'));var router=express[_0x1d30('0x5')]();var fs_extra=require(_0x1d30('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1d30('0x7'));var config=require(_0x1d30('0x8'));var controller=require(_0x1d30('0x9'));router[_0x1d30('0xa')](_0x1d30('0xb'),auth[_0x1d30('0xc')](),controller[_0x1d30('0xd')]);router[_0x1d30('0xe')](_0x1d30('0xb'),auth[_0x1d30('0xc')](),controller[_0x1d30('0xf')]);router['delete'](_0x1d30('0xb'),auth['isAuthenticated'](),controller[_0x1d30('0x10')]);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 5a29a08..d54f0c0 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 _0x50c1=['sequelize','STRING','BOOLEAN'];(function(_0x471bd3,_0x4ebe71){var _0x17d4d5=function(_0x65cb43){while(--_0x65cb43){_0x471bd3['push'](_0x471bd3['shift']());}};_0x17d4d5(++_0x4ebe71);}(_0x50c1,0x171));var _0x150c=function(_0x123db8,_0x33173f){_0x123db8=_0x123db8-0x0;var _0x158432=_0x50c1[_0x123db8];return _0x158432;};'use strict';var Sequelize=require(_0x150c('0x0'));module['exports']={'name':{'type':Sequelize[_0x150c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x150c('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf321=['exports','STRING','BOOLEAN'];(function(_0x108b66,_0x46f926){var _0x3e3e81=function(_0x9387c){while(--_0x9387c){_0x108b66['push'](_0x108b66['shift']());}};_0x3e3e81(++_0x46f926);}(_0xf321,0x1dd));var _0x1f32=function(_0x28c18d,_0x5f09b0){_0x28c18d=_0x28c18d-0x0;var _0x4fa78f=_0xf321[_0x28c18d];return _0x4fa78f;};'use strict';var Sequelize=require('sequelize');module[_0x1f32('0x0')]={'name':{'type':Sequelize[_0x1f32('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1f32('0x1')]},'write':{'type':Sequelize[_0x1f32('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 742af9c..e6e2b8f 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 _0x27dd=['query','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','ChatGroup','includeAll','include','findAll','rows','show','params','keys','options','catch','create','body','find','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','length','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','split','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x27dd,0x8d));var _0xd27d=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x27dd[_0x45783c];return _0x1161da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd27d('0x0'));var zipdir=require(_0xd27d('0x1'));var jsonpatch=require(_0xd27d('0x2'));var rp=require(_0xd27d('0x3'));var moment=require(_0xd27d('0x4'));var BPromise=require(_0xd27d('0x5'));var Mustache=require(_0xd27d('0x6'));var util=require(_0xd27d('0x7'));var path=require('path');var sox=require(_0xd27d('0x8'));var csv=require(_0xd27d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd27d('0xa'));var _=require('lodash');var squel=require(_0xd27d('0xb'));var crypto=require(_0xd27d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd27d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd27d('0xe'));var Redis=require(_0xd27d('0xf'));var authService=require(_0xd27d('0x10'));var qs=require(_0xd27d('0x11'));var as=require(_0xd27d('0x12'));var hardwareService=require(_0xd27d('0x13'));var logger=require('../../config/logger')(_0xd27d('0x14'));var utils=require('../../config/utils');var config=require(_0xd27d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd27d('0x16')]=_[_0xd27d('0x17')](config[_0xd27d('0x16')],{'host':_0xd27d('0x18'),'port':0x18eb});var socket=require(_0xd27d('0x19'))(new Redis(config[_0xd27d('0x16')]));require(_0xd27d('0x1a'))[_0xd27d('0x1b')](socket);function respondWithStatusCode(_0x135301,_0x140eb8){_0x140eb8=_0x140eb8||0xcc;return function(_0x1b11ea){if(_0x1b11ea){return _0x135301[_0xd27d('0x1c')](_0x140eb8);}return _0x135301['status'](_0x140eb8)[_0xd27d('0x1d')]();};}function respondWithResult(_0x5abe19,_0x3e6074){_0x3e6074=_0x3e6074||0xc8;return function(_0x59de4a){if(_0x59de4a){return _0x5abe19['status'](_0x3e6074)[_0xd27d('0x1e')](_0x59de4a);}};}function respondWithFilteredResult(_0x273655,_0x575878){return function(_0x499f30){if(_0x499f30){var _0x465aa6=typeof _0x575878[_0xd27d('0x1f')]===_0xd27d('0x20')&&typeof _0x575878[_0xd27d('0x21')]===_0xd27d('0x20');var _0x1d303f=_0x499f30[_0xd27d('0x22')];var _0x1de0dc=_0x465aa6?0x0:_0x575878[_0xd27d('0x1f')];var _0x29081b=_0x465aa6?_0x499f30['count']:_0x575878['offset']+_0x575878['limit'];var _0x95bc10;if(_0x29081b>=_0x1d303f){_0x29081b=_0x1d303f;_0x95bc10=0xc8;}else{_0x95bc10=0xce;}_0x273655[_0xd27d('0x23')](_0x95bc10);return _0x273655[_0xd27d('0x24')](_0xd27d('0x25'),_0x1de0dc+'-'+_0x29081b+'/'+_0x1d303f)[_0xd27d('0x1e')](_0x499f30);}return null;};}function patchUpdates(_0x351aee){return function(_0x39d9be){try{jsonpatch[_0xd27d('0x26')](_0x39d9be,_0x351aee,!![]);}catch(_0x225cec){return BPromise[_0xd27d('0x27')](_0x225cec);}return _0x39d9be[_0xd27d('0x28')]();};}function saveUpdates(_0x47bab0,_0x9ffd22){return function(_0x3d9494){if(_0x3d9494){return _0x3d9494[_0xd27d('0x29')](_0x47bab0)[_0xd27d('0x2a')](function(_0x57d6f2){return _0x57d6f2;});}return null;};}function removeEntity(_0x5e61bd,_0x586d6c){return function(_0xd3a3be){if(_0xd3a3be){return _0xd3a3be[_0xd27d('0x2b')]()['then'](function(){_0x5e61bd[_0xd27d('0x23')](0xcc)[_0xd27d('0x1d')]();});}};}function handleEntityNotFound(_0x151226,_0x366511){return function(_0x1dae81){if(!_0x1dae81){_0x151226['sendStatus'](0x194);}return _0x1dae81;};}function handleError(_0x2db729,_0x5c1c04){_0x5c1c04=_0x5c1c04||0x1f4;return function(_0x3bcddd){logger[_0xd27d('0x2c')](_0x3bcddd[_0xd27d('0x2d')]);if(_0x3bcddd[_0xd27d('0x2e')]){delete _0x3bcddd[_0xd27d('0x2e')];}_0x2db729[_0xd27d('0x23')](_0x5c1c04)[_0xd27d('0x2f')](_0x3bcddd);};}exports[_0xd27d('0x30')]=function(_0x95ba8a,_0x3b27d9){var _0x157fb6={},_0x413036={},_0x551787={'count':0x0,'rows':[]};var _0x466895=_['map'](db['ChatGroup'][_0xd27d('0x31')],function(_0x2e1f89){return{'name':_0x2e1f89[_0xd27d('0x32')],'type':_0x2e1f89[_0xd27d('0x33')][_0xd27d('0x34')]};});_0x413036[_0xd27d('0x35')]=_[_0xd27d('0x36')](_0x466895,_0xd27d('0x2e'));_0x413036[_0xd27d('0x37')]=_['keys'](_0x95ba8a[_0xd27d('0x37')]);_0x413036['filters']=_[_0xd27d('0x38')](_0x413036[_0xd27d('0x35')],_0x413036[_0xd27d('0x37')]);_0x157fb6[_0xd27d('0x39')]=_[_0xd27d('0x38')](_0x413036[_0xd27d('0x35')],qs[_0xd27d('0x3a')](_0x95ba8a[_0xd27d('0x37')]['fields']));_0x157fb6[_0xd27d('0x39')]=_0x157fb6[_0xd27d('0x39')]['length']?_0x157fb6['attributes']:_0x413036[_0xd27d('0x35')];if(!_0x95ba8a[_0xd27d('0x37')]['hasOwnProperty'](_0xd27d('0x3b'))){_0x157fb6['limit']=qs[_0xd27d('0x21')](_0x95ba8a[_0xd27d('0x37')]['limit']);_0x157fb6[_0xd27d('0x1f')]=qs[_0xd27d('0x1f')](_0x95ba8a['query'][_0xd27d('0x1f')]);}_0x157fb6[_0xd27d('0x3c')]=qs[_0xd27d('0x3d')](_0x95ba8a[_0xd27d('0x37')][_0xd27d('0x3d')]);_0x157fb6['where']=qs[_0xd27d('0x3e')](_[_0xd27d('0x3f')](_0x95ba8a[_0xd27d('0x37')],_0x413036[_0xd27d('0x3e')]),_0x466895);if(_0x95ba8a[_0xd27d('0x37')][_0xd27d('0x40')]){_0x157fb6[_0xd27d('0x41')]=_['merge'](_0x157fb6[_0xd27d('0x41')],{'$or':_['map'](_0x466895,function(_0x94f5ac){if(_0x94f5ac['type']!==_0xd27d('0x42')){var _0x12f96b={};_0x12f96b[_0x94f5ac[_0xd27d('0x2e')]]={'$like':'%'+_0x95ba8a[_0xd27d('0x37')][_0xd27d('0x40')]+'%'};return _0x12f96b;}})});}_0x157fb6=_[_0xd27d('0x43')]({},_0x157fb6,_0x95ba8a['options']);var _0x583b4c={'where':_0x157fb6[_0xd27d('0x41')]};return db[_0xd27d('0x44')]['count'](_0x583b4c)[_0xd27d('0x2a')](function(_0x15f144){_0x551787[_0xd27d('0x22')]=_0x15f144;if(_0x95ba8a['query'][_0xd27d('0x45')]){_0x157fb6[_0xd27d('0x46')]=[{'all':!![]}];}return db[_0xd27d('0x44')][_0xd27d('0x47')](_0x157fb6);})[_0xd27d('0x2a')](function(_0x5152b3){_0x551787[_0xd27d('0x48')]=_0x5152b3;return _0x551787;})[_0xd27d('0x2a')](respondWithFilteredResult(_0x3b27d9,_0x157fb6))['catch'](handleError(_0x3b27d9,null));};exports[_0xd27d('0x49')]=function(_0x114063,_0x1f9de8){var _0x1bb88c={'raw':!![],'where':{'id':_0x114063[_0xd27d('0x4a')]['id']}},_0x4905d8={};_0x4905d8[_0xd27d('0x35')]=_['keys'](db[_0xd27d('0x44')]['rawAttributes']);_0x4905d8['query']=_[_0xd27d('0x4b')](_0x114063[_0xd27d('0x37')]);_0x4905d8[_0xd27d('0x3e')]=_['intersection'](_0x4905d8[_0xd27d('0x35')],_0x4905d8[_0xd27d('0x37')]);_0x1bb88c[_0xd27d('0x39')]=_[_0xd27d('0x38')](_0x4905d8[_0xd27d('0x35')],qs['fields'](_0x114063[_0xd27d('0x37')][_0xd27d('0x3a')]));_0x1bb88c[_0xd27d('0x39')]=_0x1bb88c[_0xd27d('0x39')]['length']?_0x1bb88c[_0xd27d('0x39')]:_0x4905d8[_0xd27d('0x35')];if(_0x114063[_0xd27d('0x37')][_0xd27d('0x45')]){_0x1bb88c['include']=[{'all':!![]}];}_0x1bb88c=_[_0xd27d('0x43')]({},_0x1bb88c,_0x114063[_0xd27d('0x4c')]);return db['ChatGroup']['find'](_0x1bb88c)['then'](handleEntityNotFound(_0x1f9de8,null))[_0xd27d('0x2a')](respondWithResult(_0x1f9de8,null))[_0xd27d('0x4d')](handleError(_0x1f9de8,null));};exports['create']=function(_0x13476a,_0x1cfae9){return db[_0xd27d('0x44')][_0xd27d('0x4e')](_0x13476a['body'],{})['then'](respondWithResult(_0x1cfae9,0xc9))[_0xd27d('0x4d')](handleError(_0x1cfae9,null));};exports[_0xd27d('0x29')]=function(_0x5d70b3,_0x19d723){if(_0x5d70b3[_0xd27d('0x4f')]['id']){delete _0x5d70b3[_0xd27d('0x4f')]['id'];}return db[_0xd27d('0x44')][_0xd27d('0x50')]({'where':{'id':_0x5d70b3[_0xd27d('0x4a')]['id']}})[_0xd27d('0x2a')](handleEntityNotFound(_0x19d723,null))[_0xd27d('0x2a')](saveUpdates(_0x5d70b3['body'],null))[_0xd27d('0x2a')](respondWithResult(_0x19d723,null))[_0xd27d('0x4d')](handleError(_0x19d723,null));};exports[_0xd27d('0x2b')]=function(_0x38e469,_0x42a59e){return db['ChatGroup'][_0xd27d('0x50')]({'where':{'id':_0x38e469[_0xd27d('0x4a')]['id']}})[_0xd27d('0x2a')](handleEntityNotFound(_0x42a59e,null))['then'](removeEntity(_0x42a59e,null))['catch'](handleError(_0x42a59e,null));};exports['describe']=function(_0x52a03a,_0x50ab90){return db[_0xd27d('0x44')][_0xd27d('0x51')]()[_0xd27d('0x2a')](respondWithResult(_0x50ab90,null))[_0xd27d('0x4d')](handleError(_0x50ab90,null));};exports['getUnread']=function(_0x356af6,_0x439751,_0x140f88){return db[_0xd27d('0x52')]['count']({'where':{'ChatGroupId':_0x356af6[_0xd27d('0x4a')]['id'],'ToId':_0x356af6[_0xd27d('0x53')]['id'],'read':![]}})[_0xd27d('0x2a')](function(_0x594453){return{'id':_[_0xd27d('0x54')](_0x356af6[_0xd27d('0x4a')]['id']),'count':_0x594453};})[_0xd27d('0x2a')](respondWithResult(_0x439751,null))[_0xd27d('0x4d')](handleError(_0x439751,null));};exports[_0xd27d('0x55')]=function(_0xbd71c3,_0x287320,_0x567ee4){return db[_0xd27d('0x44')][_0xd27d('0x50')]({'where':{'id':_0xbd71c3['params']['id']}})[_0xd27d('0x2a')](handleEntityNotFound(_0x287320,null))[_0xd27d('0x2a')](function(_0x1de5f0){if(_0x1de5f0){return _0x1de5f0['addMembers'](_0xbd71c3[_0xd27d('0x4f')][_0xd27d('0x56')],_[_0xd27d('0x57')](_0xbd71c3[_0xd27d('0x4f')],['ids','id'])||{});}})[_0xd27d('0x2a')](respondWithResult(_0x287320,null))[_0xd27d('0x4d')](handleError(_0x287320,null));};exports[_0xd27d('0x58')]=function(_0x2476c5,_0x41ecb4,_0x32c96e){var _0x52c573={};var _0x3fe97c={};var _0x2f69d7;var _0x1dad8f;return db['ChatGroup'][_0xd27d('0x59')]({'where':{'id':_0x2476c5[_0xd27d('0x4a')]['id']}})[_0xd27d('0x2a')](handleEntityNotFound(_0x41ecb4,null))[_0xd27d('0x2a')](function(_0x59f7a2){if(_0x59f7a2){_0x2f69d7=_0x59f7a2;_0x3fe97c[_0xd27d('0x35')]=_[_0xd27d('0x4b')](db['User'][_0xd27d('0x31')]);_0x3fe97c['query']=_[_0xd27d('0x4b')](_0x2476c5['query']);_0x3fe97c[_0xd27d('0x3e')]=_['intersection'](_0x3fe97c[_0xd27d('0x35')],_0x3fe97c[_0xd27d('0x37')]);_0x52c573[_0xd27d('0x39')]=_['intersection'](_0x3fe97c[_0xd27d('0x35')],qs[_0xd27d('0x3a')](_0x2476c5[_0xd27d('0x37')][_0xd27d('0x3a')]));_0x52c573['attributes']=_0x52c573[_0xd27d('0x39')][_0xd27d('0x5a')]?_0x52c573[_0xd27d('0x39')]:_0x3fe97c[_0xd27d('0x35')];_0x52c573[_0xd27d('0x3c')]=qs[_0xd27d('0x3d')](_0x2476c5['query'][_0xd27d('0x3d')]);_0x52c573[_0xd27d('0x41')]=qs[_0xd27d('0x3e')](_[_0xd27d('0x3f')](_0x2476c5[_0xd27d('0x37')],_0x3fe97c[_0xd27d('0x3e')]));if(_0x2476c5[_0xd27d('0x37')][_0xd27d('0x40')]){_0x52c573[_0xd27d('0x41')]=_[_0xd27d('0x43')](_0x52c573[_0xd27d('0x41')],{'$or':_[_0xd27d('0x36')](_0x52c573['attributes'],function(_0xbc4a53){var _0x818232={};_0x818232[_0xbc4a53]={'$like':'%'+_0x2476c5['query'][_0xd27d('0x40')]+'%'};return _0x818232;})});}_0x52c573=_[_0xd27d('0x43')]({},_0x52c573,_0x2476c5[_0xd27d('0x4c')]);return _0x2f69d7[_0xd27d('0x58')](_0x52c573);}})[_0xd27d('0x2a')](function(_0x12e5a7){if(_0x12e5a7){_0x1dad8f=_0x12e5a7[_0xd27d('0x5a')];if(!_0x2476c5[_0xd27d('0x37')][_0xd27d('0x5b')](_0xd27d('0x3b'))){_0x52c573[_0xd27d('0x21')]=qs[_0xd27d('0x21')](_0x2476c5[_0xd27d('0x37')][_0xd27d('0x21')]);_0x52c573[_0xd27d('0x1f')]=qs[_0xd27d('0x1f')](_0x2476c5['query'][_0xd27d('0x1f')]);}return _0x2f69d7[_0xd27d('0x58')](_0x52c573);}})['then'](function(_0x479199){if(_0x479199){return _0x479199?{'count':_0x1dad8f,'rows':_0x479199}:null;}})[_0xd27d('0x2a')](respondWithResult(_0x41ecb4,null))[_0xd27d('0x4d')](handleError(_0x41ecb4,null));};exports[_0xd27d('0x5c')]=function(_0x1e48ae,_0x237d5a,_0x4c9ed1){return db[_0xd27d('0x44')]['find']({'where':{'id':_0x1e48ae['params']['id']}})['then'](handleEntityNotFound(_0x237d5a,null))['then'](function(_0x25e1d1){if(_0x25e1d1){return _0x25e1d1[_0xd27d('0x5c')](_0x1e48ae[_0xd27d('0x37')][_0xd27d('0x56')]);}})[_0xd27d('0x2a')](respondWithStatusCode(_0x237d5a,null))[_0xd27d('0x4d')](handleError(_0x237d5a,null));};exports[_0xd27d('0x5d')]=function(_0x4eeb5d,_0x1b697e,_0x270183){if(_0x4eeb5d['body']['id']){delete _0x4eeb5d['body']['id'];}return db['ChatGroup'][_0xd27d('0x50')]({'where':{'id':_0x4eeb5d[_0xd27d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1b697e,null))['then'](function(_0x47cd8c){if(_0x47cd8c){_0x4eeb5d[_0xd27d('0x4f')][_0xd27d('0x5e')]=_0x47cd8c['id'];return db[_0xd27d('0x52')][_0xd27d('0x4e')](_0x4eeb5d['body']);}})[_0xd27d('0x2a')](respondWithResult(_0x1b697e,null))[_0xd27d('0x4d')](handleError(_0x1b697e,null));};exports[_0xd27d('0x5f')]=function(_0x49e18f,_0x27e4c3,_0x2cf0a7){var _0x848df0={};var _0x560d6d={};var _0x4f869f;var _0x4eb88b;return db[_0xd27d('0x44')]['findOne']({'where':{'id':_0x49e18f[_0xd27d('0x4a')]['id']}})[_0xd27d('0x2a')](handleEntityNotFound(_0x27e4c3,null))[_0xd27d('0x2a')](function(_0x9f2a18){if(_0x9f2a18){_0x4f869f=_0x9f2a18;_0x560d6d[_0xd27d('0x35')]=_[_0xd27d('0x4b')](db['ChatInternalMessage'][_0xd27d('0x31')]);_0x560d6d[_0xd27d('0x37')]=_[_0xd27d('0x4b')](_0x49e18f[_0xd27d('0x37')]);_0x560d6d[_0xd27d('0x3e')]=_[_0xd27d('0x38')](_0x560d6d['model'],_0x560d6d['query']);_0x848df0[_0xd27d('0x39')]=_[_0xd27d('0x38')](_0x560d6d[_0xd27d('0x35')],qs[_0xd27d('0x3a')](_0x49e18f[_0xd27d('0x37')][_0xd27d('0x3a')]));_0x848df0['attributes']=_0x848df0['attributes'][_0xd27d('0x5a')]?_0x848df0[_0xd27d('0x39')]:_0x560d6d[_0xd27d('0x35')];_0x848df0[_0xd27d('0x3c')]=qs[_0xd27d('0x3d')](_0x49e18f[_0xd27d('0x37')][_0xd27d('0x3d')]);_0x848df0[_0xd27d('0x41')]=qs[_0xd27d('0x3e')](_[_0xd27d('0x3f')](_0x49e18f[_0xd27d('0x37')],_0x560d6d['filters']));if(_0x49e18f['query'][_0xd27d('0x40')]){_0x848df0['where']=_[_0xd27d('0x43')](_0x848df0['where'],{'$or':_[_0xd27d('0x36')](_0x848df0[_0xd27d('0x39')],function(_0x46f53a){var _0x1a4077={};_0x1a4077[_0x46f53a]={'$like':'%'+_0x49e18f['query']['filter']+'%'};return _0x1a4077;})});}if(_0x49e18f['query']['$gte']){var _0x40ee69=_0x49e18f['query']['$gte'][_0xd27d('0x60')](',');var _0xf736ec={};_0xf736ec[_0x40ee69[0x0]]={'$gte':moment(_0x40ee69[0x1])['format'](_0xd27d('0x61'))};_0x848df0[_0xd27d('0x41')]=_[_0xd27d('0x43')](_0x848df0['where'],_0xf736ec);}_0x848df0=_[_0xd27d('0x43')]({},_0x848df0,_0x49e18f[_0xd27d('0x4c')]);return _0x4f869f[_0xd27d('0x5f')](_0x848df0);}})['then'](function(_0x52de3f){if(_0x52de3f){_0x4eb88b=_0x52de3f[_0xd27d('0x5a')];if(!_0x49e18f[_0xd27d('0x37')][_0xd27d('0x5b')](_0xd27d('0x3b'))){_0x848df0[_0xd27d('0x21')]=qs[_0xd27d('0x21')](_0x49e18f[_0xd27d('0x37')]['limit']);_0x848df0[_0xd27d('0x1f')]=qs[_0xd27d('0x1f')](_0x49e18f[_0xd27d('0x37')][_0xd27d('0x1f')]);}return _0x4f869f['getMessages'](_0x848df0);}})[_0xd27d('0x2a')](function(_0x1058aa){if(_0x1058aa){return _0x1058aa?{'count':_0x4eb88b,'rows':_0x1058aa}:null;}})['then'](respondWithResult(_0x27e4c3,null))[_0xd27d('0x4d')](handleError(_0x27e4c3,null));}; \ No newline at end of file +var _0xf478=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatGroup.socket','register','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','map','ChatGroup','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','rows','show','params','keys','includeAll','include','find','create','body','catch','describe','getUnread','ChatInternalMessage','toInteger','addMembers','omit','ids','getMembers','findOne','User','options','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x563eed,_0x34b19d){var _0x2a26b1=function(_0x3445c2){while(--_0x3445c2){_0x563eed['push'](_0x563eed['shift']());}};_0x2a26b1(++_0x34b19d);}(_0xf478,0x1e1));var _0x8f47=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xf478[_0x491a7f];return _0x3d8f44;};'use strict';var emlformat=require(_0x8f47('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f47('0x1'));var jsonpatch=require(_0x8f47('0x2'));var rp=require(_0x8f47('0x3'));var moment=require(_0x8f47('0x4'));var BPromise=require(_0x8f47('0x5'));var Mustache=require(_0x8f47('0x6'));var util=require(_0x8f47('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8f47('0x8'));var ejs=require(_0x8f47('0x9'));var fs=require('fs');var fs_extra=require(_0x8f47('0xa'));var _=require(_0x8f47('0xb'));var squel=require(_0x8f47('0xc'));var crypto=require(_0x8f47('0xd'));var jsforce=require(_0x8f47('0xe'));var deskjs=require(_0x8f47('0xf'));var toCsv=require(_0x8f47('0x8'));var querystring=require(_0x8f47('0x10'));var Papa=require(_0x8f47('0x11'));var Redis=require('ioredis');var authService=require(_0x8f47('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8f47('0x13'));var hardwareService=require(_0x8f47('0x14'));var logger=require(_0x8f47('0x15'))(_0x8f47('0x16'));var utils=require(_0x8f47('0x17'));var config=require(_0x8f47('0x18'));var licenseUtil=require(_0x8f47('0x19'));var db=require(_0x8f47('0x1a'))['db'];config['redis']=_[_0x8f47('0x1b')](config[_0x8f47('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x8f47('0x1d'))(new Redis(config[_0x8f47('0x1c')]));require(_0x8f47('0x1e'))[_0x8f47('0x1f')](socket);function respondWithStatusCode(_0x27df92,_0x3d0a5b){_0x3d0a5b=_0x3d0a5b||0xcc;return function(_0x2d2ca5){if(_0x2d2ca5){return _0x27df92['sendStatus'](_0x3d0a5b);}return _0x27df92[_0x8f47('0x20')](_0x3d0a5b)['end']();};}function respondWithResult(_0xff8ec3,_0x59a7e8){_0x59a7e8=_0x59a7e8||0xc8;return function(_0x32ad26){if(_0x32ad26){return _0xff8ec3[_0x8f47('0x20')](_0x59a7e8)['json'](_0x32ad26);}};}function respondWithFilteredResult(_0x2c0e19,_0x10cd78){return function(_0x1144c0){if(_0x1144c0){var _0x428230=typeof _0x10cd78[_0x8f47('0x21')]===_0x8f47('0x22')&&typeof _0x10cd78[_0x8f47('0x23')]===_0x8f47('0x22');var _0x3626e5=_0x1144c0[_0x8f47('0x24')];var _0x1c793e=_0x428230?0x0:_0x10cd78[_0x8f47('0x21')];var _0xe53a2b=_0x428230?_0x1144c0[_0x8f47('0x24')]:_0x10cd78[_0x8f47('0x21')]+_0x10cd78[_0x8f47('0x23')];var _0x1912eb;if(_0xe53a2b>=_0x3626e5){_0xe53a2b=_0x3626e5;_0x1912eb=0xc8;}else{_0x1912eb=0xce;}_0x2c0e19[_0x8f47('0x20')](_0x1912eb);return _0x2c0e19[_0x8f47('0x25')](_0x8f47('0x26'),_0x1c793e+'-'+_0xe53a2b+'/'+_0x3626e5)['json'](_0x1144c0);}return null;};}function patchUpdates(_0x232dd0){return function(_0x36a648){try{jsonpatch[_0x8f47('0x27')](_0x36a648,_0x232dd0,!![]);}catch(_0x5df43e){return BPromise[_0x8f47('0x28')](_0x5df43e);}return _0x36a648[_0x8f47('0x29')]();};}function saveUpdates(_0xd5a2f1,_0x438f5b){return function(_0x31f2bb){if(_0x31f2bb){return _0x31f2bb[_0x8f47('0x2a')](_0xd5a2f1)[_0x8f47('0x2b')](function(_0x32bc07){return _0x32bc07;});}return null;};}function removeEntity(_0x49e00b,_0x3827eb){return function(_0x549b9c){if(_0x549b9c){return _0x549b9c[_0x8f47('0x2c')]()['then'](function(){_0x49e00b[_0x8f47('0x20')](0xcc)[_0x8f47('0x2d')]();});}};}function handleEntityNotFound(_0xf06627,_0x413bc3){return function(_0x3ac533){if(!_0x3ac533){_0xf06627[_0x8f47('0x2e')](0x194);}return _0x3ac533;};}function handleError(_0x3a67e8,_0x1283b4){_0x1283b4=_0x1283b4||0x1f4;return function(_0x51560d){logger['error'](_0x51560d[_0x8f47('0x2f')]);if(_0x51560d[_0x8f47('0x30')]){delete _0x51560d[_0x8f47('0x30')];}_0x3a67e8[_0x8f47('0x20')](_0x1283b4)[_0x8f47('0x31')](_0x51560d);};}exports['index']=function(_0x439e20,_0x5b17bc){var _0x2af58d={},_0x467d4b={},_0x1f9948={'count':0x0,'rows':[]};var _0x24246e=_[_0x8f47('0x32')](db[_0x8f47('0x33')][_0x8f47('0x34')],function(_0xa92cc2){return{'name':_0xa92cc2['fieldName'],'type':_0xa92cc2[_0x8f47('0x35')][_0x8f47('0x36')]};});_0x467d4b[_0x8f47('0x37')]=_[_0x8f47('0x32')](_0x24246e,_0x8f47('0x30'));_0x467d4b[_0x8f47('0x38')]=_['keys'](_0x439e20[_0x8f47('0x38')]);_0x467d4b[_0x8f47('0x39')]=_[_0x8f47('0x3a')](_0x467d4b[_0x8f47('0x37')],_0x467d4b[_0x8f47('0x38')]);_0x2af58d['attributes']=_[_0x8f47('0x3a')](_0x467d4b[_0x8f47('0x37')],qs[_0x8f47('0x3b')](_0x439e20[_0x8f47('0x38')][_0x8f47('0x3b')]));_0x2af58d[_0x8f47('0x3c')]=_0x2af58d[_0x8f47('0x3c')][_0x8f47('0x3d')]?_0x2af58d[_0x8f47('0x3c')]:_0x467d4b[_0x8f47('0x37')];if(!_0x439e20['query'][_0x8f47('0x3e')]('nolimit')){_0x2af58d[_0x8f47('0x23')]=qs[_0x8f47('0x23')](_0x439e20['query']['limit']);_0x2af58d[_0x8f47('0x21')]=qs[_0x8f47('0x21')](_0x439e20[_0x8f47('0x38')][_0x8f47('0x21')]);}_0x2af58d[_0x8f47('0x3f')]=qs[_0x8f47('0x40')](_0x439e20[_0x8f47('0x38')][_0x8f47('0x40')]);_0x2af58d[_0x8f47('0x41')]=qs[_0x8f47('0x39')](_[_0x8f47('0x42')](_0x439e20[_0x8f47('0x38')],_0x467d4b[_0x8f47('0x39')]),_0x24246e);if(_0x439e20[_0x8f47('0x38')][_0x8f47('0x43')]){_0x2af58d[_0x8f47('0x41')]=_[_0x8f47('0x44')](_0x2af58d['where'],{'$or':_[_0x8f47('0x32')](_0x24246e,function(_0x5c6a8a){if(_0x5c6a8a[_0x8f47('0x35')]!==_0x8f47('0x45')){var _0x2dedec={};_0x2dedec[_0x5c6a8a[_0x8f47('0x30')]]={'$like':'%'+_0x439e20[_0x8f47('0x38')]['filter']+'%'};return _0x2dedec;}})});}_0x2af58d=_['merge']({},_0x2af58d,_0x439e20['options']);var _0x414948={'where':_0x2af58d[_0x8f47('0x41')]};return db[_0x8f47('0x33')][_0x8f47('0x24')](_0x414948)['then'](function(_0x436962){_0x1f9948[_0x8f47('0x24')]=_0x436962;if(_0x439e20['query']['includeAll']){_0x2af58d['include']=[{'all':!![]}];}return db[_0x8f47('0x33')]['findAll'](_0x2af58d);})[_0x8f47('0x2b')](function(_0x92a347){_0x1f9948[_0x8f47('0x46')]=_0x92a347;return _0x1f9948;})['then'](respondWithFilteredResult(_0x5b17bc,_0x2af58d))['catch'](handleError(_0x5b17bc,null));};exports[_0x8f47('0x47')]=function(_0x14edfd,_0x2d4421){var _0xaa4c26={'raw':!![],'where':{'id':_0x14edfd[_0x8f47('0x48')]['id']}},_0x1634fb={};_0x1634fb['model']=_[_0x8f47('0x49')](db['ChatGroup'][_0x8f47('0x34')]);_0x1634fb[_0x8f47('0x38')]=_['keys'](_0x14edfd[_0x8f47('0x38')]);_0x1634fb[_0x8f47('0x39')]=_[_0x8f47('0x3a')](_0x1634fb[_0x8f47('0x37')],_0x1634fb[_0x8f47('0x38')]);_0xaa4c26['attributes']=_[_0x8f47('0x3a')](_0x1634fb['model'],qs['fields'](_0x14edfd[_0x8f47('0x38')][_0x8f47('0x3b')]));_0xaa4c26[_0x8f47('0x3c')]=_0xaa4c26[_0x8f47('0x3c')][_0x8f47('0x3d')]?_0xaa4c26['attributes']:_0x1634fb['model'];if(_0x14edfd['query'][_0x8f47('0x4a')]){_0xaa4c26[_0x8f47('0x4b')]=[{'all':!![]}];}_0xaa4c26=_[_0x8f47('0x44')]({},_0xaa4c26,_0x14edfd['options']);return db[_0x8f47('0x33')][_0x8f47('0x4c')](_0xaa4c26)[_0x8f47('0x2b')](handleEntityNotFound(_0x2d4421,null))[_0x8f47('0x2b')](respondWithResult(_0x2d4421,null))['catch'](handleError(_0x2d4421,null));};exports[_0x8f47('0x4d')]=function(_0x42932b,_0x4c24be){return db[_0x8f47('0x33')][_0x8f47('0x4d')](_0x42932b[_0x8f47('0x4e')],{})[_0x8f47('0x2b')](respondWithResult(_0x4c24be,0xc9))[_0x8f47('0x4f')](handleError(_0x4c24be,null));};exports['update']=function(_0x5635f6,_0x554707){if(_0x5635f6['body']['id']){delete _0x5635f6['body']['id'];}return db[_0x8f47('0x33')][_0x8f47('0x4c')]({'where':{'id':_0x5635f6[_0x8f47('0x48')]['id']}})[_0x8f47('0x2b')](handleEntityNotFound(_0x554707,null))[_0x8f47('0x2b')](saveUpdates(_0x5635f6[_0x8f47('0x4e')],null))['then'](respondWithResult(_0x554707,null))[_0x8f47('0x4f')](handleError(_0x554707,null));};exports[_0x8f47('0x2c')]=function(_0x5d1324,_0x46262c){return db[_0x8f47('0x33')][_0x8f47('0x4c')]({'where':{'id':_0x5d1324['params']['id']}})[_0x8f47('0x2b')](handleEntityNotFound(_0x46262c,null))[_0x8f47('0x2b')](removeEntity(_0x46262c,null))[_0x8f47('0x4f')](handleError(_0x46262c,null));};exports[_0x8f47('0x50')]=function(_0x4171ed,_0x21ac5b){return db[_0x8f47('0x33')][_0x8f47('0x50')]()[_0x8f47('0x2b')](respondWithResult(_0x21ac5b,null))[_0x8f47('0x4f')](handleError(_0x21ac5b,null));};exports[_0x8f47('0x51')]=function(_0x38dfd6,_0x9caf6f,_0x6823c3){return db[_0x8f47('0x52')][_0x8f47('0x24')]({'where':{'ChatGroupId':_0x38dfd6[_0x8f47('0x48')]['id'],'ToId':_0x38dfd6['user']['id'],'read':![]}})[_0x8f47('0x2b')](function(_0x50e77d){return{'id':_[_0x8f47('0x53')](_0x38dfd6[_0x8f47('0x48')]['id']),'count':_0x50e77d};})[_0x8f47('0x2b')](respondWithResult(_0x9caf6f,null))[_0x8f47('0x4f')](handleError(_0x9caf6f,null));};exports[_0x8f47('0x54')]=function(_0x12ce8d,_0x268174,_0x5ca02e){return db[_0x8f47('0x33')][_0x8f47('0x4c')]({'where':{'id':_0x12ce8d['params']['id']}})[_0x8f47('0x2b')](handleEntityNotFound(_0x268174,null))[_0x8f47('0x2b')](function(_0x2f9063){if(_0x2f9063){return _0x2f9063[_0x8f47('0x54')](_0x12ce8d['body']['ids'],_[_0x8f47('0x55')](_0x12ce8d[_0x8f47('0x4e')],[_0x8f47('0x56'),'id'])||{});}})['then'](respondWithResult(_0x268174,null))['catch'](handleError(_0x268174,null));};exports[_0x8f47('0x57')]=function(_0x467c66,_0x468915,_0x1143df){var _0x3aea92={};var _0x47dee7={};var _0x42e94e;var _0x11f0c0;return db[_0x8f47('0x33')][_0x8f47('0x58')]({'where':{'id':_0x467c66[_0x8f47('0x48')]['id']}})[_0x8f47('0x2b')](handleEntityNotFound(_0x468915,null))[_0x8f47('0x2b')](function(_0x406ec9){if(_0x406ec9){_0x42e94e=_0x406ec9;_0x47dee7[_0x8f47('0x37')]=_[_0x8f47('0x49')](db[_0x8f47('0x59')][_0x8f47('0x34')]);_0x47dee7['query']=_[_0x8f47('0x49')](_0x467c66[_0x8f47('0x38')]);_0x47dee7[_0x8f47('0x39')]=_[_0x8f47('0x3a')](_0x47dee7[_0x8f47('0x37')],_0x47dee7[_0x8f47('0x38')]);_0x3aea92[_0x8f47('0x3c')]=_[_0x8f47('0x3a')](_0x47dee7[_0x8f47('0x37')],qs[_0x8f47('0x3b')](_0x467c66['query'][_0x8f47('0x3b')]));_0x3aea92['attributes']=_0x3aea92[_0x8f47('0x3c')]['length']?_0x3aea92[_0x8f47('0x3c')]:_0x47dee7['model'];_0x3aea92[_0x8f47('0x3f')]=qs[_0x8f47('0x40')](_0x467c66[_0x8f47('0x38')][_0x8f47('0x40')]);_0x3aea92['where']=qs[_0x8f47('0x39')](_[_0x8f47('0x42')](_0x467c66['query'],_0x47dee7[_0x8f47('0x39')]));if(_0x467c66[_0x8f47('0x38')]['filter']){_0x3aea92[_0x8f47('0x41')]=_[_0x8f47('0x44')](_0x3aea92[_0x8f47('0x41')],{'$or':_['map'](_0x3aea92[_0x8f47('0x3c')],function(_0x5052cd){var _0x3e6373={};_0x3e6373[_0x5052cd]={'$like':'%'+_0x467c66[_0x8f47('0x38')]['filter']+'%'};return _0x3e6373;})});}_0x3aea92=_['merge']({},_0x3aea92,_0x467c66[_0x8f47('0x5a')]);return _0x42e94e['getMembers'](_0x3aea92);}})[_0x8f47('0x2b')](function(_0x5d7aee){if(_0x5d7aee){_0x11f0c0=_0x5d7aee[_0x8f47('0x3d')];if(!_0x467c66[_0x8f47('0x38')]['hasOwnProperty'](_0x8f47('0x5b'))){_0x3aea92[_0x8f47('0x23')]=qs[_0x8f47('0x23')](_0x467c66[_0x8f47('0x38')][_0x8f47('0x23')]);_0x3aea92[_0x8f47('0x21')]=qs['offset'](_0x467c66[_0x8f47('0x38')][_0x8f47('0x21')]);}return _0x42e94e['getMembers'](_0x3aea92);}})[_0x8f47('0x2b')](function(_0xfc6e3){if(_0xfc6e3){return _0xfc6e3?{'count':_0x11f0c0,'rows':_0xfc6e3}:null;}})[_0x8f47('0x2b')](respondWithResult(_0x468915,null))[_0x8f47('0x4f')](handleError(_0x468915,null));};exports[_0x8f47('0x5c')]=function(_0x448649,_0x293945,_0x24f0a1){return db[_0x8f47('0x33')][_0x8f47('0x4c')]({'where':{'id':_0x448649[_0x8f47('0x48')]['id']}})[_0x8f47('0x2b')](handleEntityNotFound(_0x293945,null))[_0x8f47('0x2b')](function(_0x169c17){if(_0x169c17){return _0x169c17[_0x8f47('0x5c')](_0x448649[_0x8f47('0x38')][_0x8f47('0x56')]);}})[_0x8f47('0x2b')](respondWithStatusCode(_0x293945,null))['catch'](handleError(_0x293945,null));};exports[_0x8f47('0x5d')]=function(_0x5aa982,_0x519d2b,_0x115c82){if(_0x5aa982[_0x8f47('0x4e')]['id']){delete _0x5aa982[_0x8f47('0x4e')]['id'];}return db[_0x8f47('0x33')][_0x8f47('0x4c')]({'where':{'id':_0x5aa982['params']['id']}})[_0x8f47('0x2b')](handleEntityNotFound(_0x519d2b,null))[_0x8f47('0x2b')](function(_0x4611ce){if(_0x4611ce){_0x5aa982[_0x8f47('0x4e')][_0x8f47('0x5e')]=_0x4611ce['id'];return db[_0x8f47('0x52')][_0x8f47('0x4d')](_0x5aa982[_0x8f47('0x4e')]);}})['then'](respondWithResult(_0x519d2b,null))[_0x8f47('0x4f')](handleError(_0x519d2b,null));};exports[_0x8f47('0x5f')]=function(_0x2723c4,_0x450996,_0x44c38e){var _0x31ebe6={};var _0x1050e7={};var _0x10b0d9;var _0x255a5d;return db[_0x8f47('0x33')][_0x8f47('0x58')]({'where':{'id':_0x2723c4[_0x8f47('0x48')]['id']}})[_0x8f47('0x2b')](handleEntityNotFound(_0x450996,null))['then'](function(_0x4c2d63){if(_0x4c2d63){_0x10b0d9=_0x4c2d63;_0x1050e7[_0x8f47('0x37')]=_[_0x8f47('0x49')](db[_0x8f47('0x52')][_0x8f47('0x34')]);_0x1050e7[_0x8f47('0x38')]=_[_0x8f47('0x49')](_0x2723c4[_0x8f47('0x38')]);_0x1050e7[_0x8f47('0x39')]=_[_0x8f47('0x3a')](_0x1050e7[_0x8f47('0x37')],_0x1050e7[_0x8f47('0x38')]);_0x31ebe6[_0x8f47('0x3c')]=_[_0x8f47('0x3a')](_0x1050e7[_0x8f47('0x37')],qs[_0x8f47('0x3b')](_0x2723c4[_0x8f47('0x38')][_0x8f47('0x3b')]));_0x31ebe6[_0x8f47('0x3c')]=_0x31ebe6['attributes']['length']?_0x31ebe6[_0x8f47('0x3c')]:_0x1050e7[_0x8f47('0x37')];_0x31ebe6[_0x8f47('0x3f')]=qs['sort'](_0x2723c4['query'][_0x8f47('0x40')]);_0x31ebe6['where']=qs[_0x8f47('0x39')](_[_0x8f47('0x42')](_0x2723c4[_0x8f47('0x38')],_0x1050e7[_0x8f47('0x39')]));if(_0x2723c4[_0x8f47('0x38')][_0x8f47('0x43')]){_0x31ebe6[_0x8f47('0x41')]=_[_0x8f47('0x44')](_0x31ebe6[_0x8f47('0x41')],{'$or':_[_0x8f47('0x32')](_0x31ebe6[_0x8f47('0x3c')],function(_0x502f49){var _0x4b9e19={};_0x4b9e19[_0x502f49]={'$like':'%'+_0x2723c4['query']['filter']+'%'};return _0x4b9e19;})});}if(_0x2723c4[_0x8f47('0x38')][_0x8f47('0x60')]){var _0x3167ba=_0x2723c4[_0x8f47('0x38')][_0x8f47('0x60')]['split'](',');var _0xd82580={};_0xd82580[_0x3167ba[0x0]]={'$gte':moment(_0x3167ba[0x1])[_0x8f47('0x61')](_0x8f47('0x62'))};_0x31ebe6[_0x8f47('0x41')]=_[_0x8f47('0x44')](_0x31ebe6[_0x8f47('0x41')],_0xd82580);}_0x31ebe6=_[_0x8f47('0x44')]({},_0x31ebe6,_0x2723c4[_0x8f47('0x5a')]);return _0x10b0d9[_0x8f47('0x5f')](_0x31ebe6);}})[_0x8f47('0x2b')](function(_0x15cc2e){if(_0x15cc2e){_0x255a5d=_0x15cc2e[_0x8f47('0x3d')];if(!_0x2723c4['query']['hasOwnProperty'](_0x8f47('0x5b'))){_0x31ebe6['limit']=qs[_0x8f47('0x23')](_0x2723c4[_0x8f47('0x38')][_0x8f47('0x23')]);_0x31ebe6[_0x8f47('0x21')]=qs['offset'](_0x2723c4['query'][_0x8f47('0x21')]);}return _0x10b0d9[_0x8f47('0x5f')](_0x31ebe6);}})[_0x8f47('0x2b')](function(_0x4f5cb3){if(_0x4f5cb3){return _0x4f5cb3?{'count':_0x255a5d,'rows':_0x4f5cb3}:null;}})[_0x8f47('0x2b')](respondWithResult(_0x450996,null))[_0x8f47('0x4f')](handleError(_0x450996,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 7967ea2..471d3ab 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 _0xf198=['setMaxListeners','save','update','emit','hook','exports','../../mysqldb'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xf198,0xd1));var _0x8f19=function(_0x499da2,_0x6f2789){_0x499da2=_0x499da2-0x0;var _0x5efb1f=_0xf198[_0x499da2];return _0x5efb1f;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x8f19('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8f19('0x1')](0x0);var events={'afterCreate':_0x8f19('0x2'),'afterUpdate':_0x8f19('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4226fd){return function(_0x390135,_0x3a7997,_0x3d85ab){ChatGroupEvents[_0x8f19('0x4')](_0x4226fd+':'+_0x390135['id'],_0x390135);ChatGroupEvents[_0x8f19('0x4')](_0x4226fd,_0x390135);_0x3d85ab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x8f19('0x5')](e,emitEvent(event));}}module[_0x8f19('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0x5b92=['save','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x9554a,_0x5d2585){var _0x3bf0bf=function(_0xbb413f){while(--_0xbb413f){_0x9554a['push'](_0x9554a['shift']());}};_0x3bf0bf(++_0x5d2585);}(_0x5b92,0x1cd));var _0x25b9=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5b92[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x25b9('0x0'))['db'][_0x25b9('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x25b9('0x2')](0x0);var events={'afterCreate':_0x25b9('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x512686){return function(_0x16e9ae,_0x1732b0,_0xd3f3c9){ChatGroupEvents[_0x25b9('0x4')](_0x512686+':'+_0x16e9ae['id'],_0x16e9ae);ChatGroupEvents['emit'](_0x512686,_0x16e9ae);_0xd3f3c9(null);};}for(var e in events){if(events[_0x25b9('0x5')](e)){var event=events[e];ChatGroup[_0x25b9('0x6')](e,emitEvent(event));}}module[_0x25b9('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 08f2679..7f5b6c2 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 _0x76a1=['exports','ChatGroup','api','request-promise','../../config/environment'];(function(_0x3d571f,_0x5ac9d0){var _0x3b3d4f=function(_0x334403){while(--_0x334403){_0x3d571f['push'](_0x3d571f['shift']());}};_0x3b3d4f(++_0x5ac9d0);}(_0x76a1,0x142));var _0x176a=function(_0x2b4bd1,_0x4e9f04){_0x2b4bd1=_0x2b4bd1-0x0;var _0x1e7352=_0x76a1[_0x2b4bd1];return _0x1e7352;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x176a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x176a('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x176a('0x2'));var attributes=require('./chatGroup.attributes');module[_0x176a('0x3')]=function(_0x44c8d1,_0x7f7014){return _0x44c8d1['define'](_0x176a('0x4'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7106=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups'];(function(_0x4659c8,_0x2ba01d){var _0xf5770e=function(_0x40efb6){while(--_0x40efb6){_0x4659c8['push'](_0x4659c8['shift']());}};_0xf5770e(++_0x2ba01d);}(_0x7106,0x70));var _0x6710=function(_0x645963,_0x29be3b){_0x645963=_0x645963-0x0;var _0x2a8cff=_0x7106[_0x645963];return _0x2a8cff;};'use strict';var _=require(_0x6710('0x0'));var util=require(_0x6710('0x1'));var logger=require(_0x6710('0x2'))('api');var moment=require(_0x6710('0x3'));var BPromise=require(_0x6710('0x4'));var rp=require(_0x6710('0x5'));var fs=require('fs');var path=require(_0x6710('0x6'));var rimraf=require(_0x6710('0x7'));var config=require(_0x6710('0x8'));var attributes=require(_0x6710('0x9'));module[_0x6710('0xa')]=function(_0x44bbab,_0x1e0c0b){return _0x44bbab[_0x6710('0xb')](_0x6710('0xc'),attributes,{'tableName':_0x6710('0xd'),'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 22d7ec6..62b3976 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 _0xd1f9=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatGroup,\x20%s,\x20%s','message','moment','bluebird','randomstring','ioredis'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xd1f9,0x88));var _0x9d1f=function(_0x1b08d4,_0x8a710c){_0x1b08d4=_0x1b08d4-0x0;var _0x9aef3e=_0xd1f9[_0x1b08d4];return _0x9aef3e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9d1f('0x0'));var BPromise=require(_0x9d1f('0x1'));var rs=require(_0x9d1f('0x2'));var fs=require('fs');var Redis=require(_0x9d1f('0x3'));var db=require(_0x9d1f('0x4'))['db'];var utils=require(_0x9d1f('0x5'));var logger=require(_0x9d1f('0x6'))(_0x9d1f('0x7'));var config=require(_0x9d1f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d1f('0x9')][_0x9d1f('0xa')]({'port':0x232a});config[_0x9d1f('0xb')]=_[_0x9d1f('0xc')](config[_0x9d1f('0xb')],{'host':_0x9d1f('0xd'),'port':0x18eb});var socket=require(_0x9d1f('0xe'))(new Redis(config[_0x9d1f('0xb')]));require(_0x9d1f('0xf'))[_0x9d1f('0x10')](socket);function respondWithRpcPromise(_0x153ef3,_0x1d960c,_0x1c5446){return new BPromise(function(_0x27480b,_0x34e67a){return client[_0x9d1f('0x11')](_0x153ef3,_0x1c5446)[_0x9d1f('0x12')](function(_0x1dcf5f){logger[_0x9d1f('0x13')]('ChatGroup,\x20%s,\x20%s',_0x1d960c,_0x9d1f('0x14'));logger[_0x9d1f('0x15')](_0x9d1f('0x16'),_0x1d960c,'request\x20sent',JSON[_0x9d1f('0x17')](_0x1dcf5f));if(_0x1dcf5f['error']){if(_0x1dcf5f['error'][_0x9d1f('0x18')]===0x1f4){logger[_0x9d1f('0x19')](_0x9d1f('0x1a'),_0x1d960c,_0x1dcf5f[_0x9d1f('0x19')][_0x9d1f('0x1b')]);return _0x34e67a(_0x1dcf5f[_0x9d1f('0x19')][_0x9d1f('0x1b')]);}logger[_0x9d1f('0x19')](_0x9d1f('0x1a'),_0x1d960c,_0x1dcf5f[_0x9d1f('0x19')][_0x9d1f('0x1b')]);return _0x27480b(_0x1dcf5f[_0x9d1f('0x19')][_0x9d1f('0x1b')]);}else{logger['info'](_0x9d1f('0x1a'),_0x1d960c,_0x9d1f('0x14'));_0x27480b(_0x1dcf5f['result'][_0x9d1f('0x1b')]);}})['catch'](function(_0x4ab476){logger['error'](_0x9d1f('0x1a'),_0x1d960c,_0x4ab476);_0x34e67a(_0x4ab476);});});} \ No newline at end of file +var _0x2cd0=['socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x2c78e3,_0x263ffa){var _0x1ebc73=function(_0x306535){while(--_0x306535){_0x2c78e3['push'](_0x2c78e3['shift']());}};_0x1ebc73(++_0x263ffa);}(_0x2cd0,0x8a));var _0x02cd=function(_0x383e11,_0x278c3a){_0x383e11=_0x383e11-0x0;var _0x10574e=_0x2cd0[_0x383e11];return _0x10574e;};'use strict';var _=require(_0x02cd('0x0'));var util=require(_0x02cd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x02cd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x02cd('0x3'));var logger=require(_0x02cd('0x4'))(_0x02cd('0x5'));var config=require(_0x02cd('0x6'));var jayson=require(_0x02cd('0x7'));var client=jayson[_0x02cd('0x8')][_0x02cd('0x9')]({'port':0x232a});config[_0x02cd('0xa')]=_[_0x02cd('0xb')](config[_0x02cd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x02cd('0xc'))(new Redis(config[_0x02cd('0xa')]));require(_0x02cd('0xd'))[_0x02cd('0xe')](socket);function respondWithRpcPromise(_0x45cc20,_0xd0cc56,_0x18dfe0){return new BPromise(function(_0x2364c3,_0x15a488){return client[_0x02cd('0xf')](_0x45cc20,_0x18dfe0)['then'](function(_0x59f017){logger[_0x02cd('0x10')](_0x02cd('0x11'),_0xd0cc56,'request\x20sent');logger['debug'](_0x02cd('0x12'),_0xd0cc56,'request\x20sent',JSON[_0x02cd('0x13')](_0x59f017));if(_0x59f017[_0x02cd('0x14')]){if(_0x59f017[_0x02cd('0x14')][_0x02cd('0x15')]===0x1f4){logger[_0x02cd('0x14')](_0x02cd('0x11'),_0xd0cc56,_0x59f017['error']['message']);return _0x15a488(_0x59f017[_0x02cd('0x14')][_0x02cd('0x16')]);}logger[_0x02cd('0x14')](_0x02cd('0x11'),_0xd0cc56,_0x59f017[_0x02cd('0x14')]['message']);return _0x2364c3(_0x59f017[_0x02cd('0x14')]['message']);}else{logger['info'](_0x02cd('0x11'),_0xd0cc56,_0x02cd('0x17'));_0x2364c3(_0x59f017[_0x02cd('0x18')][_0x02cd('0x16')]);}})['catch'](function(_0x341ace){logger['error'](_0x02cd('0x11'),_0xd0cc56,_0x341ace);_0x15a488(_0x341ace);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 68485c5..513bbc6 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 _0x1aee=['emit','removeListener','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x35640f,_0x3351bb){var _0x508de1=function(_0x4efcbf){while(--_0x4efcbf){_0x35640f['push'](_0x35640f['shift']());}};_0x508de1(++_0x3351bb);}(_0x1aee,0x84));var _0xe1ae=function(_0x533528,_0x409d05){_0x533528=_0x533528-0x0;var _0x3189f1=_0x1aee[_0x533528];return _0x3189f1;};'use strict';var ChatGroupEvents=require(_0xe1ae('0x0'));var events=[_0xe1ae('0x1'),_0xe1ae('0x2'),_0xe1ae('0x3')];function createListener(_0x545742,_0x49ed90){return function(_0x273b1f){_0x49ed90[_0xe1ae('0x4')](_0x545742,_0x273b1f);};}function removeListener(_0x3f74da,_0xc57bc){return function(){ChatGroupEvents[_0xe1ae('0x5')](_0x3f74da,_0xc57bc);};}exports['register']=function(_0x3a65cc){for(var _0x3543d7=0x0,_0x1f850c=events[_0xe1ae('0x6')];_0x3543d7<_0x1f850c;_0x3543d7++){var _0x597fc5=events[_0x3543d7];var _0xf42a93=createListener(_0xe1ae('0x7')+_0x597fc5,_0x3a65cc);ChatGroupEvents['on'](_0x597fc5,_0xf42a93);}}; \ No newline at end of file +var _0x3a65=['length','./chatGroup.events','update','emit','removeListener'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x3a65,0x155));var _0x53a6=function(_0x22022b,_0x22c49b){_0x22022b=_0x22022b-0x0;var _0x35b70d=_0x3a65[_0x22022b];return _0x35b70d;};'use strict';var ChatGroupEvents=require(_0x53a6('0x0'));var events=['save','remove',_0x53a6('0x1')];function createListener(_0x218c1d,_0xfaabda){return function(_0x5d30db){_0xfaabda[_0x53a6('0x2')](_0x218c1d,_0x5d30db);};}function removeListener(_0x530d34,_0x5c39b2){return function(){ChatGroupEvents[_0x53a6('0x3')](_0x530d34,_0x5c39b2);};}exports['register']=function(_0x26b071){for(var _0x150129=0x0,_0x708933=events[_0x53a6('0x4')];_0x150129<_0x708933;_0x150129++){var _0x5388c5=events[_0x150129];var _0x34f898=createListener('chatGroup:'+_0x5388c5,_0x26b071);ChatGroupEvents['on'](_0x5388c5,_0x34f898);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 91c8f5e..d6dd006 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 _0x22e1=['/:id/members','getMembers','getMessages','post','create','/:id/messages','addMessage','put','update','delete','removeMembers','exports','multer','util','express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/unread'];(function(_0x368d89,_0x47556e){var _0x16a007=function(_0x3ffffb){while(--_0x3ffffb){_0x368d89['push'](_0x368d89['shift']());}};_0x16a007(++_0x47556e);}(_0x22e1,0x1c6));var _0x122e=function(_0x401ad6,_0x392d17){_0x401ad6=_0x401ad6-0x0;var _0x159ef3=_0x22e1[_0x401ad6];return _0x159ef3;};'use strict';var multer=require(_0x122e('0x0'));var util=require(_0x122e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x122e('0x2'));var router=express[_0x122e('0x3')]();var fs_extra=require(_0x122e('0x4'));var auth=require(_0x122e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x122e('0x6'));router[_0x122e('0x7')]('/',auth[_0x122e('0x8')](),controller[_0x122e('0x9')]);router[_0x122e('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x122e('0xa')]);router[_0x122e('0x7')](_0x122e('0xb'),auth['isAuthenticated'](),controller[_0x122e('0xc')]);router[_0x122e('0x7')](_0x122e('0xd'),auth['isAuthenticated'](),controller['getUnread']);router[_0x122e('0x7')](_0x122e('0xe'),auth['isAuthenticated'](),controller[_0x122e('0xf')]);router[_0x122e('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x122e('0x10')]);router[_0x122e('0x11')]('/',auth[_0x122e('0x8')](),controller[_0x122e('0x12')]);router[_0x122e('0x11')](_0x122e('0xe'),auth['isAuthenticated'](),controller['addMembers']);router[_0x122e('0x11')](_0x122e('0x13'),auth[_0x122e('0x8')](),controller[_0x122e('0x14')]);router[_0x122e('0x15')](_0x122e('0xb'),auth['isAuthenticated'](),controller[_0x122e('0x16')]);router[_0x122e('0x17')](_0x122e('0xb'),auth[_0x122e('0x8')](),controller['destroy']);router[_0x122e('0x17')]('/:id/members',auth['isAuthenticated'](),controller[_0x122e('0x18')]);module[_0x122e('0x19')]=router; \ No newline at end of file +var _0x80f5=['get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','multer','path','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80f5,0x1c6));var _0x580f=function(_0x1f52ea,_0x1dd436){_0x1f52ea=_0x1f52ea-0x0;var _0x2d4b16=_0x80f5[_0x1f52ea];return _0x2d4b16;};'use strict';var multer=require(_0x580f('0x0'));var util=require('util');var path=require(_0x580f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x580f('0x2'));var auth=require(_0x580f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x580f('0x4'));var controller=require('./chatGroup.controller');router[_0x580f('0x5')]('/',auth['isAuthenticated'](),controller[_0x580f('0x6')]);router['get'](_0x580f('0x7'),auth[_0x580f('0x8')](),controller[_0x580f('0x9')]);router['get'](_0x580f('0xa'),auth[_0x580f('0x8')](),controller[_0x580f('0xb')]);router[_0x580f('0x5')](_0x580f('0xc'),auth[_0x580f('0x8')](),controller[_0x580f('0xd')]);router[_0x580f('0x5')](_0x580f('0xe'),auth['isAuthenticated'](),controller[_0x580f('0xf')]);router['get'](_0x580f('0x10'),auth[_0x580f('0x8')](),controller[_0x580f('0x11')]);router[_0x580f('0x12')]('/',auth[_0x580f('0x8')](),controller['create']);router[_0x580f('0x12')](_0x580f('0xe'),auth[_0x580f('0x8')](),controller[_0x580f('0x13')]);router[_0x580f('0x12')]('/:id/messages',auth[_0x580f('0x8')](),controller[_0x580f('0x14')]);router[_0x580f('0x15')](_0x580f('0xa'),auth[_0x580f('0x8')](),controller[_0x580f('0x16')]);router[_0x580f('0x17')](_0x580f('0xa'),auth[_0x580f('0x8')](),controller[_0x580f('0x18')]);router[_0x580f('0x17')](_0x580f('0xe'),auth['isAuthenticated'](),controller[_0x580f('0x19')]);module[_0x580f('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index f804ba0..673f7a0 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 _0x6215=['out','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT','STRING','long','DATE'];(function(_0x162552,_0x3c93d7){var _0x59bf76=function(_0x68c61d){while(--_0x68c61d){_0x162552['push'](_0x162552['shift']());}};_0x59bf76(++_0x3c93d7);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5621('0x0'));module[_0x5621('0x1')]={'closed':{'type':Sequelize[_0x5621('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x5621('0x3')](_0x5621('0x4'),_0x5621('0x5')),'defaultValue':_0x5621('0x4')},'ratingMessage':{'type':Sequelize[_0x5621('0x6')]},'pathTranscript':{'type':Sequelize[_0x5621('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5621('0x7')]},'note':{'type':Sequelize[_0x5621('0x7')]},'browserName':{'type':Sequelize[_0x5621('0x7')]},'browserVersion':{'type':Sequelize[_0x5621('0x7')]},'osName':{'type':Sequelize[_0x5621('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x5621('0x7')]},'deviceVendor':{'type':Sequelize[_0x5621('0x7')]},'deviceType':{'type':Sequelize[_0x5621('0x7')]},'referer':{'type':Sequelize[_0x5621('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x5621('0x6')](_0x5621('0x8'))},'read1stAt':{'type':Sequelize[_0x5621('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x5621('0x3')]('in',_0x5621('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x5621('0x7')]},'customerPort':{'type':Sequelize[_0x5621('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x5621('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x5621('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x1eba=['BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0x28b5cf,_0x4416d8){var _0xe2f9e0=function(_0x4fd350){while(--_0x4fd350){_0x28b5cf['push'](_0x28b5cf['shift']());}};_0xe2f9e0(++_0x4416d8);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x363b81,_0x81e6ca){_0x363b81=_0x363b81-0x0;var _0x1d92fb=_0x1eba[_0x363b81];return _0x1d92fb;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'closed':{'type':Sequelize[_0xa1eb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa1eb('0x3')]},'ratingType':{'type':Sequelize[_0xa1eb('0x4')]('star','thumb'),'defaultValue':_0xa1eb('0x5')},'ratingMessage':{'type':Sequelize[_0xa1eb('0x6')]},'pathTranscript':{'type':Sequelize[_0xa1eb('0x6')]},'mailTranscript':{'type':Sequelize[_0xa1eb('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa1eb('0x8')]},'disposition':{'type':Sequelize[_0xa1eb('0x7')]},'secondDisposition':{'type':Sequelize[_0xa1eb('0x7')]},'thirdDisposition':{'type':Sequelize[_0xa1eb('0x7')]},'note':{'type':Sequelize[_0xa1eb('0x7')]},'browserName':{'type':Sequelize[_0xa1eb('0x7')]},'browserVersion':{'type':Sequelize[_0xa1eb('0x7')]},'osName':{'type':Sequelize[_0xa1eb('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xa1eb('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xa1eb('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xa1eb('0x7')]},'formData':{'type':Sequelize['TEXT'](_0xa1eb('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xa1eb('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xa1eb('0x4')]('in',_0xa1eb('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xa1eb('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xa1eb('0x6')]},'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 be728ff..8bf163c 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 _0x9bde=['pick','filters','field','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','length','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)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','text','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','i.id\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','toString','sequelize','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','show','params','includeAll','include','options','create','ChatInteraction','describe','createVidaooSession','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','server/files/chat/upload/','format','now','ChatWebsite','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','findAll','addTags','setTags','spread','Tag','color','emit','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','Account','Owner','get','mkdirSync','N.A.','closedAt','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err','zip-dir','moment','mustache','util','path','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','http','client','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','destroy','then','name','send','render','merge','body','contact','agent','interaction','account','Users','fullname','TagIds','Tags','split','forEach','push','catch','talking','unmanaged','abandoned','total','UserId','waiting','closed','disposition','answered','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where'];(function(_0x955e5f,_0x48fd81){var _0x25515e=function(_0x17b565){while(--_0x17b565){_0x955e5f['push'](_0x955e5f['shift']());}};_0x25515e(++_0x48fd81);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1856c5,_0x3955a8){_0x1856c5=_0x1856c5-0x0;var _0x526423=_0x9bde[_0x1856c5];return _0x526423;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xe9bd('0x0'));var rp=require('request-promise');var moment=require(_0xe9bd('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xe9bd('0x2'));var util=require(_0xe9bd('0x3'));var path=require(_0xe9bd('0x4'));var ejs=require(_0xe9bd('0x5'));var fs=require('fs');var _=require(_0xe9bd('0x6'));var squel=require(_0xe9bd('0x7'));var Redis=require(_0xe9bd('0x8'));var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x9'));var pdf=require(_0xe9bd('0xa'));var logger=require(_0xe9bd('0xb'))(_0xe9bd('0xc'));var config=require(_0xe9bd('0xd'));var db=require(_0xe9bd('0xe'))['db'];config[_0xe9bd('0xf')]=_[_0xe9bd('0x10')](config[_0xe9bd('0xf')],{'host':_0xe9bd('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe9bd('0x12'))[_0xe9bd('0x13')](socket);var jayson=require(_0xe9bd('0x14'));var client=jayson['client'][_0xe9bd('0x15')]({'port':0x232b});var client9004=jayson[_0xe9bd('0x16')][_0xe9bd('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x141587,_0x5e022a,_0x2c1d98,_0x4ac319){return new BPromise(function(_0x220d07,_0x429e88){var _0x3435b4=_0x4ac319||client;return _0x3435b4['request'](_0x141587,_0x2c1d98)['then'](function(_0x46a95e){logger[_0xe9bd('0x17')](_0xe9bd('0x18'),_0x5e022a,_0xe9bd('0x19'));logger[_0xe9bd('0x1a')](_0xe9bd('0x1b'),_0x5e022a,_0xe9bd('0x19'),JSON['stringify'](_0x46a95e));if(_0x46a95e[_0xe9bd('0x1c')]){if(_0x46a95e[_0xe9bd('0x1c')][_0xe9bd('0x1d')]===0x1f4){logger['error'](_0xe9bd('0x18'),_0x5e022a,_0x46a95e[_0xe9bd('0x1c')][_0xe9bd('0x1e')]);return _0x429e88(_0x46a95e[_0xe9bd('0x1c')]['message']);}logger[_0xe9bd('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x5e022a,_0x46a95e[_0xe9bd('0x1c')]['message']);return _0x220d07(_0x46a95e[_0xe9bd('0x1c')][_0xe9bd('0x1e')]);}else{logger[_0xe9bd('0x17')](_0xe9bd('0x18'),_0x5e022a,_0xe9bd('0x19'));_0x220d07(_0x46a95e[_0xe9bd('0x1f')][_0xe9bd('0x1e')]);}})['catch'](function(_0x133318){logger[_0xe9bd('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x5e022a,_0x133318);_0x429e88(_0x133318);});});}function respondWithStatusCode(_0x37aec1,_0x505c23){_0x505c23=_0x505c23||0xcc;return function(_0x238ab1){if(_0x238ab1){return _0x37aec1[_0xe9bd('0x20')](_0x505c23);}return _0x37aec1[_0xe9bd('0x21')](_0x505c23)[_0xe9bd('0x22')]();};}function respondWithResult(_0x5bc4bf,_0x24cf25){_0x24cf25=_0x24cf25||0xc8;return function(_0x1e3cbb){if(_0x1e3cbb){return _0x5bc4bf[_0xe9bd('0x21')](_0x24cf25)[_0xe9bd('0x23')](_0x1e3cbb);}};}function respondWithFilteredResult(_0x2641be,_0xb52d45){return function(_0x399f3c){if(_0x399f3c){var _0x43ea90=typeof _0xb52d45[_0xe9bd('0x24')]==='undefined'&&typeof _0xb52d45[_0xe9bd('0x25')]===_0xe9bd('0x26');var _0x5ba1d6=_0x399f3c[_0xe9bd('0x27')];var _0xc25248=_0x43ea90?0x0:_0xb52d45[_0xe9bd('0x24')];var _0x429055=_0x43ea90?_0x399f3c[_0xe9bd('0x27')]:_0xb52d45[_0xe9bd('0x24')]+_0xb52d45['limit'];var _0x5b7f1d;if(_0x429055>=_0x5ba1d6){_0x429055=_0x5ba1d6;_0x5b7f1d=0xc8;}else{_0x5b7f1d=0xce;}_0x2641be[_0xe9bd('0x21')](_0x5b7f1d);return _0x2641be['set'](_0xe9bd('0x28'),_0xc25248+'-'+_0x429055+'/'+_0x5ba1d6)[_0xe9bd('0x23')](_0x399f3c);}return null;};}function saveUpdates(_0x27f80c){return function(_0x36aa80){if(_0x36aa80){return _0x36aa80[_0xe9bd('0x29')](_0x27f80c)['then'](function(_0x4b7bc2){return _0x4b7bc2;});}return null;};}function removeEntity(_0x7f2c5){return function(_0x3b6682){if(_0x3b6682){return _0x3b6682[_0xe9bd('0x2a')]()[_0xe9bd('0x2b')](function(){_0x7f2c5[_0xe9bd('0x21')](0xcc)[_0xe9bd('0x22')]();});}};}function handleEntityNotFound(_0x3c31ee){return function(_0x66213a){if(!_0x66213a){_0x3c31ee[_0xe9bd('0x20')](0x194);}return _0x66213a;};}function handleError(_0x4ec15c,_0x426004){_0x426004=_0x426004||0x1f4;return function(_0x81a31f){logger[_0xe9bd('0x1c')](_0x81a31f['stack']);if(_0x81a31f['name']){delete _0x81a31f[_0xe9bd('0x2c')];}_0x4ec15c[_0xe9bd('0x21')](_0x426004)[_0xe9bd('0x2d')](_0x81a31f);};}function getMustacheRender(_0x3ed60a,_0x1dda43){return Mustache[_0xe9bd('0x2e')](_0x3ed60a,_[_0xe9bd('0x2f')](_0x1dda43[_0xe9bd('0x30')],{'contact':_0x1dda43[_0xe9bd('0x31')],'message':_0x1dda43[_0xe9bd('0x1e')],'agent':_0x1dda43[_0xe9bd('0x32')],'interaction':_0x1dda43[_0xe9bd('0x33')],'account':_0x1dda43[_0xe9bd('0x34')]}))||'';}function getInteractionUsers(_0x199477,_0xc50476){return new BPromise(function(_0x8ff624,_0x264ba0){try{if(_0xc50476[_0x199477['id']]){_0x199477[_0xe9bd('0x35')]=_['map'](_0xc50476[_0x199477['id']],function(_0x3f3cf5){return{'id':_0x3f3cf5['id'],'fullname':_0x3f3cf5[_0xe9bd('0x36')]};});}}catch(_0x56b4a5){_0x264ba0(_0x56b4a5);}_0x8ff624(_0x199477);});}function getInteractionTags(_0x404a7d,_0x264c87){return new BPromise(function(_0x4c7d47,_0x4b1da0){try{if(_0x404a7d[_0xe9bd('0x37')]){_0x404a7d[_0xe9bd('0x38')]=[];_0x404a7d['TagIds'][_0xe9bd('0x39')](',')[_0xe9bd('0x3a')](function(_0x14927c){_0x404a7d['Tags'][_0xe9bd('0x3b')](_0x264c87[_0x14927c]);});}delete _0x404a7d['TagIds'];}catch(_0x3c8f7e){_0x4b1da0(_0x3c8f7e);}_0x4c7d47(_0x404a7d);});}function updateChatInteraction(_0x42238a,_0x63d67c,_0x1366f2){return new BPromise(function(_0x4e1538,_0x41f2d4){return getInteractionUsers(_0x42238a,_0x1366f2)[_0xe9bd('0x2b')](function(_0x327e1a){return getInteractionTags(_0x327e1a,_0x63d67c);})[_0xe9bd('0x2b')](function(_0x253359){return getStateInteraction(_0x253359);})[_0xe9bd('0x2b')](function(_0x3647d8){_0x4e1538(_0x3647d8);})[_0xe9bd('0x3c')](function(_0x2b5a71){_0x41f2d4(_0x2b5a71);});});}function getStateInteraction(_0x1d5d93){return new BPromise(function(_0x4e8565){_0x1d5d93['waiting']=0x0;_0x1d5d93[_0xe9bd('0x3d')]=0x0;_0x1d5d93['answered']=0x0;_0x1d5d93[_0xe9bd('0x3e')]=0x0;_0x1d5d93[_0xe9bd('0x3f')]=0x0;_0x1d5d93[_0xe9bd('0x40')]=0x0;if(!_0x1d5d93['closed']&&!_0x1d5d93[_0xe9bd('0x41')]){_0x1d5d93[_0xe9bd('0x42')]+=0x1;}if(!_0x1d5d93[_0xe9bd('0x43')]&&_0x1d5d93['UserId']){_0x1d5d93[_0xe9bd('0x3d')]+=0x1;if(_0x1d5d93[_0xe9bd('0x42')]){_0x1d5d93[_0xe9bd('0x42')]-=0x1;}}if(_0x1d5d93[_0xe9bd('0x43')]&&_0x1d5d93[_0xe9bd('0x44')]===_0xe9bd('0x3f')){_0x1d5d93[_0xe9bd('0x3f')]+=0x1;if(_0x1d5d93[_0xe9bd('0x42')]){_0x1d5d93[_0xe9bd('0x42')]-=0x1;}}else if(_0x1d5d93[_0xe9bd('0x43')]&&!_0x1d5d93[_0xe9bd('0x41')]&&_0x1d5d93[_0xe9bd('0x44')]){_0x1d5d93[_0xe9bd('0x3e')]+=0x1;if(_0x1d5d93[_0xe9bd('0x42')]){_0x1d5d93[_0xe9bd('0x42')]-=0x1;}}else if(_0x1d5d93['closed']&&_0x1d5d93['UserId']){_0x1d5d93[_0xe9bd('0x45')]+=0x1;if(_0x1d5d93[_0xe9bd('0x3d')]){_0x1d5d93[_0xe9bd('0x3d')]-=0x1;}}_0x1d5d93['total']+=0x1;_0x4e8565(_0x1d5d93);});}exports['index']=function(_0x43cf7d,_0x3f6f22){var _0x165942={},_0x15da40={},_0x39fb61={'count':0x0,'rows':[]};var _0x3d4b58=_[_0xe9bd('0x46')](db['ChatInteraction'][_0xe9bd('0x47')],function(_0x4cc146){return{'name':_0x4cc146[_0xe9bd('0x48')],'type':_0x4cc146[_0xe9bd('0x49')][_0xe9bd('0x4a')]};});_0x15da40[_0xe9bd('0x4b')]=_[_0xe9bd('0x46')](_0x3d4b58,'name');_0x15da40[_0xe9bd('0x4c')]=_[_0xe9bd('0x4d')](_0x43cf7d[_0xe9bd('0x4c')]);_0x15da40['filters']=_[_0xe9bd('0x4e')](_0x15da40[_0xe9bd('0x4b')],_0x15da40[_0xe9bd('0x4c')]);_0x165942['attributes']=_[_0xe9bd('0x4e')](_0x15da40[_0xe9bd('0x4b')],qs[_0xe9bd('0x4f')](_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x4f')]));_0x165942['attributes']=_0x165942[_0xe9bd('0x50')]['length']?_0x165942[_0xe9bd('0x50')]:_0x15da40[_0xe9bd('0x4b')];if(!_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x51')](_0xe9bd('0x52'))){_0x165942['limit']=qs[_0xe9bd('0x25')](_0x43cf7d['query'][_0xe9bd('0x25')]);_0x165942[_0xe9bd('0x24')]=qs['offset'](_0x43cf7d['query'][_0xe9bd('0x24')]);}_0x165942['order']=qs[_0xe9bd('0x53')](_0x43cf7d['query'][_0xe9bd('0x53')]);_0x165942[_0xe9bd('0x54')]=qs['filters'](_[_0xe9bd('0x55')](_0x43cf7d['query'],_0x15da40[_0xe9bd('0x56')]),_0x3d4b58);var _0x2d9a94=[];var _0x321050=squel['select']()[_0xe9bd('0x57')]('id')[_0xe9bd('0x57')](_0xe9bd('0x2c'))[_0xe9bd('0x57')]('color')['from'](_0xe9bd('0x58'));var _0x493aae=squel[_0xe9bd('0x59')]()[_0xe9bd('0x57')](_0xe9bd('0x5a'))[_0xe9bd('0x57')](_0xe9bd('0x5b'))[_0xe9bd('0x57')](_0xe9bd('0x5c'))[_0xe9bd('0x5d')](_0xe9bd('0x5e'),'ui')[_0xe9bd('0x5f')](_0xe9bd('0x60'),'u',_0xe9bd('0x61'));var _0x51500d=squel['select']()['from'](_0xe9bd('0x62'),'i')['left_join'](_0xe9bd('0x63'),'c',_0xe9bd('0x64'))[_0xe9bd('0x5f')](_0xe9bd('0x60'),'o',_0xe9bd('0x65'))[_0xe9bd('0x5f')](_0xe9bd('0x66'),'a',_0xe9bd('0x67'))[_0xe9bd('0x5f')]('chat_messages','me',_0xe9bd('0x68'))[_0xe9bd('0x5f')](_0xe9bd('0x69'),'it',_0xe9bd('0x6a'))['left_join'](_0xe9bd('0x58'),'t',_0xe9bd('0x6b'));var _0x34bd38=squel['expr']();var _0x3e6f63=[];var _0x204ea9=squel[_0xe9bd('0x6c')]();var _0xfe82f7;if(_0x43cf7d['query']['search']){_0xfe82f7=as[_0xe9bd('0x6d')](_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x6e')]);var _0xf02c5d=_0xfe82f7['sqlOperator'];for(var _0x49add9=0x0;_0x49add9<_0xfe82f7[_0xe9bd('0x6f')][_0xe9bd('0x70')];_0x49add9++){var _0x3ea0cc=_0xfe82f7[_0xe9bd('0x6f')][_0x49add9];var _0x1fd2b5='i';var _0x23f476=_['find'](_0x3d4b58,[_0xe9bd('0x2c'),_0x3ea0cc['field']]);if(!_0x23f476){switch(_0x3ea0cc[_0xe9bd('0x57')]){case _0xe9bd('0x71'):if(_0x3ea0cc[_0xe9bd('0x72')]==0x1){_0x51500d[_0xe9bd('0x73')]('`'+_0x3ea0cc['field']+_0xe9bd('0x74'));}else{_0x51500d[_0xe9bd('0x73')]('`'+_0x3ea0cc[_0xe9bd('0x57')]+'`\x20>\x200');}break;case _0xe9bd('0x75'):if(_0x3ea0cc[_0xe9bd('0x76')]===_0xe9bd('0x77')){if(_0x3ea0cc[_0xe9bd('0x72')][_0xe9bd('0x39')]('\x20')[_0xe9bd('0x70')]>0x1){_0x34bd38[_0xf02c5d](_0xe9bd('0x78'),qs[_0xe9bd('0x79')](_0x3ea0cc[_0xe9bd('0x72')]),null);}else{var _0x37bb08='%'+_0x3ea0cc[_0xe9bd('0x72')]+'%';_0x34bd38[_0xf02c5d](_0xe9bd('0x7a'),_0x37bb08,_0x37bb08,_0x37bb08);}}else{_0x23f476=_['find'](_0x3d4b58,[_0xe9bd('0x2c'),_0xe9bd('0x7b')]);_0x3ea0cc['field']=_0xe9bd('0x7b');_0x5d7257=as[_0xe9bd('0x7c')](_0x1fd2b5,_0x23f476['type'],_0x3ea0cc);_0x34bd38[_0xf02c5d](_0x5d7257['text'],_0x5d7257[_0xe9bd('0x72')][_0xe9bd('0x7d')],_0x5d7257['value']['end']);}break;case'Tag':var _0x246487=_0x3ea0cc['value']['split'](',')['map'](function(_0x4bcf2b){return Number(_0x4bcf2b);});_0x246487[_0xe9bd('0x3a')](function(_0x46da33){_0x204ea9['or'](_0xe9bd('0x7e'),'%,'+_0x46da33+',%');});_0x3e6f63=_['union'](_0x3e6f63,_0x246487);break;case _0xe9bd('0x7f'):if(_0x3ea0cc[_0xe9bd('0x76')]===_0xe9bd('0x77')){_0x34bd38[_0xf02c5d](_0xe9bd('0x80'),'%'+_0x3ea0cc['value']+'%',null);}else{_0x23f476=_[_0xe9bd('0x81')](_0x3d4b58,[_0xe9bd('0x2c'),_0xe9bd('0x41')]);_0x3ea0cc['field']='UserId';_0x5d7257=as[_0xe9bd('0x7c')](_0x1fd2b5,_0x23f476[_0xe9bd('0x49')],_0x3ea0cc);_0x34bd38[_0xf02c5d](_0x5d7257[_0xe9bd('0x82')],_0x5d7257[_0xe9bd('0x72')][_0xe9bd('0x7d')],_0x5d7257[_0xe9bd('0x72')][_0xe9bd('0x22')]);}break;case _0xe9bd('0x30'):_0x5d7257=as['buildExpression']('me',null,_0x3ea0cc);_0x34bd38[_0xf02c5d](_0x5d7257[_0xe9bd('0x82')],_0x5d7257[_0xe9bd('0x72')][_0xe9bd('0x7d')],_0x5d7257[_0xe9bd('0x72')][_0xe9bd('0x22')]);break;}}else{var _0x5d7257=as[_0xe9bd('0x7c')](_0x1fd2b5,_0x23f476['type'],_0x3ea0cc);_0x34bd38[_0xf02c5d](_0x5d7257['text'],_0x5d7257[_0xe9bd('0x72')][_0xe9bd('0x7d')],_0x5d7257['value'][_0xe9bd('0x22')]);}}}else{var _0x2d1e63=_(_0x43cf7d[_0xe9bd('0x4c')])[_0xe9bd('0x4d')]()['map'](function(_0x3c1ab9){return _[_0xe9bd('0x83')](_0x3d4b58,['name',_0x3c1ab9])?_0x3c1ab9:undefined;})[_0xe9bd('0x84')]()[_0xe9bd('0x72')]();if(!_[_0xe9bd('0x85')](_0x2d1e63)){_0x2d1e63[_0xe9bd('0x3a')](function(_0x2e63c7){if(_0x2e63c7===_0xe9bd('0x86')){_0x51500d[_0xe9bd('0x54')]('i.ChatWebsiteId\x20IN\x20?',[][_0xe9bd('0x87')](_0x43cf7d[_0xe9bd('0x4c')][_0x2e63c7]));}else if(_0x2e63c7===_0xe9bd('0x88')){var _0x421533=JSON[_0xe9bd('0x89')](_0x43cf7d[_0xe9bd('0x4c')][_0x2e63c7])[_0xe9bd('0x8a')];var _0x2adc49=JSON[_0xe9bd('0x89')](_0x43cf7d['query'][_0x2e63c7])[_0xe9bd('0x8b')];_0x51500d[_0xe9bd('0x54')](_0xe9bd('0x8c'),_0x421533,_0x2adc49);}else{if(_0x43cf7d[_0xe9bd('0x4c')][_0x2e63c7]===_0xe9bd('0x8d')){_0x51500d[_0xe9bd('0x54')]('i.'+_0x2e63c7+_0xe9bd('0x8e'));}else{_0x51500d['where']('i.'+_0x2e63c7+_0xe9bd('0x8f'),_0x43cf7d[_0xe9bd('0x4c')][_0x2e63c7]);}}});}if(_0x43cf7d['query'][_0xe9bd('0x90')]){if(_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x90')]==0x1){_0x51500d[_0xe9bd('0x73')](_0xe9bd('0x91'));}else{_0x51500d[_0xe9bd('0x73')](_0xe9bd('0x92'));}}if(_0x43cf7d['query']['tag']){_0x3e6f63=_[_0xe9bd('0x93')](_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x94')])?_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x94')]:new Array(_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x94')]);_0x3e6f63['forEach'](function(_0x35390a){_0x204ea9['or'](_0xe9bd('0x7e'),'%,'+_0x35390a+',%');});}if(_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x95')]){var _0x14cdd5=_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x95')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x14cdd5)){_0x34bd38['or'](_0xe9bd('0x96'),_0x14cdd5+'%');}else{_0x34bd38['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x14cdd5))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x14cdd5+'%');}}}_0x51500d[_0xe9bd('0x54')](_0x34bd38);_0x51500d[_0xe9bd('0x97')](_0xe9bd('0x98'));var _0xa8b335={'type':db[_0xe9bd('0x99')][_0xe9bd('0x9a')][_0xe9bd('0x9b')],'raw':!![]};var _0x27ca62=_0x51500d[_0xe9bd('0x9c')]();_0x27ca62['field'](_0xe9bd('0x98'));_0x27ca62['field'](_0xe9bd('0x9d'),_0xe9bd('0x71'));if(_0x165942[_0xe9bd('0x9e')]){_0x165942[_0xe9bd('0x9e')][_0xe9bd('0x3a')](function(_0x5d8c24){var _0x5b14e5=_0x5d8c24[0x0]==='contactName'?_0x5d8c24[0x0]:'i.'+_0x5d8c24[0x0];_0x51500d[_0xe9bd('0x9e')](_0x5b14e5,_0x5d8c24[0x1]===_0xe9bd('0x9f')?![]:!![]);});}if(!_['isEmpty'](_0x3e6f63)){_0x51500d[_0xe9bd('0x73')](_0x204ea9);_0x27ca62[_0xe9bd('0x54')](_0xe9bd('0xa0'),_0x3e6f63);}BPromise[_0xe9bd('0xa1')]()[_0xe9bd('0x2b')](function(){if(!_0xfe82f7){if(_0x43cf7d['query'][_0xe9bd('0x86')])return;_0x27ca62[_0xe9bd('0x54')](_0xe9bd('0xa2'));_0x51500d[_0xe9bd('0x54')](_0xe9bd('0xa2'));return;}if(_0x43cf7d[_0xe9bd('0xa3')][_0xe9bd('0xa4')]!==_0xe9bd('0x32'))return;return _0x43cf7d[_0xe9bd('0xa3')][_0xe9bd('0xa5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4d5288){if(_['isEmpty'](_0x4d5288)){_0x27ca62['where'](_0xe9bd('0xa6'));_0x51500d[_0xe9bd('0x54')](_0xe9bd('0xa6'));}else{_0x27ca62['where'](_0xe9bd('0xa7'),_[_0xe9bd('0x46')](_0x4d5288,'id'));_0x51500d['where']('i.ChatWebsiteId\x20IN\x20?',_[_0xe9bd('0x46')](_0x4d5288,'id'));}});})[_0xe9bd('0x2b')](function(){if(_0x43cf7d[_0xe9bd('0xa3')][_0xe9bd('0xa4')]===_0xe9bd('0x32')&&!_0xfe82f7&&!_0x43cf7d['query']['ChatWebsiteId'])return[];return db['sequelize'][_0xe9bd('0x4c')](_0x27ca62[_0xe9bd('0xa8')](),_0xa8b335);})[_0xe9bd('0x2b')](function(_0x140678){_0x39fb61[_0xe9bd('0x27')]=_0x140678[_0xe9bd('0x70')];if(_0x39fb61[_0xe9bd('0x27')]===0x0)return[];return db[_0xe9bd('0xa9')][_0xe9bd('0x4c')](_0x321050[_0xe9bd('0xa8')](),_0xa8b335)['then'](function(_0xb1203d){_0x2d9a94=_['keyBy'](_0xb1203d,'id');_0xa8b335=_[_0xe9bd('0x2f')](_0xa8b335,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x43cf7d['query'][_0xe9bd('0x4f')]){_0x165942['attributes'][_0xe9bd('0x3a')](function(_0x5cdaa8){_0x51500d[_0xe9bd('0x57')]('i.'+_0x5cdaa8);});}else{_0x51500d[_0xe9bd('0x57')](_0xe9bd('0x9d'),_0xe9bd('0x71'));_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xaa'),'Account.key');_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xab'),'Account.mandatoryDisposition');_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xac'),_0xe9bd('0xad'));_0x51500d['field'](_0xe9bd('0xae'));_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xaf'),_0xe9bd('0xb0'));_0x51500d[_0xe9bd('0x57')]('c.lastName',_0xe9bd('0xb1'));_0x51500d[_0xe9bd('0x57')]('c.email',_0xe9bd('0xb2'));_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xb3'),_0xe9bd('0xb4'));_0x51500d['field'](_0xe9bd('0xb5'),_0xe9bd('0xb6'));_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xb7'),_0xe9bd('0xb8'));_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xb9'),'Owner.fullname');_0x51500d[_0xe9bd('0x57')]('o.internal',_0xe9bd('0xba'));_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xbb'),'TagIds');}if(_0x165942[_0xe9bd('0x25')])_0x51500d['limit'](_0x165942[_0xe9bd('0x25')]);if(_0x165942[_0xe9bd('0x24')])_0x51500d[_0xe9bd('0x24')](_0x165942[_0xe9bd('0x24')]);return db[_0xe9bd('0xa9')][_0xe9bd('0x4c')](_0x51500d[_0xe9bd('0xa8')](),_0xa8b335);})[_0xe9bd('0x2b')](function(_0x14db25){if(_0x14db25[_0xe9bd('0x70')]>0x0)_0x493aae[_0xe9bd('0x54')]('ui.ChatInteractionId\x20IN\x20?',_[_0xe9bd('0x46')](_0x14db25,'id'));return db[_0xe9bd('0xa9')][_0xe9bd('0x4c')](_0x493aae['toString'](),_0xa8b335)[_0xe9bd('0x2b')](function(_0x16bcce){var _0x581727=_['groupBy'](_0x16bcce,'ChatInteractionId');var _0x52df8f=[];_0x14db25[_0xe9bd('0x3a')](function(_0x3b32a9){_0x52df8f[_0xe9bd('0x3b')](updateChatInteraction(_0x3b32a9,_0x2d9a94,_0x581727));});return BPromise['all'](_0x52df8f);});});})[_0xe9bd('0x2b')](function(_0x3b72cd){_0x39fb61['rows']=_0x3b72cd;return _0x39fb61;})[_0xe9bd('0x2b')](respondWithFilteredResult(_0x3f6f22,_0x165942))[_0xe9bd('0x3c')](handleError(_0x3f6f22,null));};exports[_0xe9bd('0xbc')]=function(_0x8c8261,_0x3700f6){var _0x5eee5c={'raw':![],'where':{'id':_0x8c8261[_0xe9bd('0xbd')]['id']}},_0x1fcc3a={};_0x1fcc3a['model']=_['keys'](db['ChatInteraction']['rawAttributes']);_0x1fcc3a[_0xe9bd('0x4c')]=_[_0xe9bd('0x4d')](_0x8c8261[_0xe9bd('0x4c')]);_0x1fcc3a[_0xe9bd('0x56')]=_['intersection'](_0x1fcc3a['model'],_0x1fcc3a[_0xe9bd('0x4c')]);_0x5eee5c[_0xe9bd('0x50')]=_[_0xe9bd('0x4e')](_0x1fcc3a['model'],qs[_0xe9bd('0x4f')](_0x8c8261[_0xe9bd('0x4c')]['fields']));_0x5eee5c['attributes']=_0x5eee5c[_0xe9bd('0x50')][_0xe9bd('0x70')]?_0x5eee5c[_0xe9bd('0x50')]:_0x1fcc3a[_0xe9bd('0x4b')];if(_0x8c8261[_0xe9bd('0x4c')][_0xe9bd('0xbe')]){_0x5eee5c[_0xe9bd('0xbf')]=[{'all':!![]}];}_0x5eee5c=_[_0xe9bd('0x2f')]({},_0x5eee5c,_0x8c8261[_0xe9bd('0xc0')]);return db['ChatInteraction'][_0xe9bd('0x81')](_0x5eee5c)[_0xe9bd('0x2b')](handleEntityNotFound(_0x3700f6,null))[_0xe9bd('0x2b')](respondWithResult(_0x3700f6,null))[_0xe9bd('0x3c')](handleError(_0x3700f6,null));};exports[_0xe9bd('0xc1')]=function(_0x3145e8,_0x55f0d3){return db[_0xe9bd('0xc2')]['create'](_0x3145e8[_0xe9bd('0x30')],{})['then'](respondWithResult(_0x55f0d3,0xc9))[_0xe9bd('0x3c')](handleError(_0x55f0d3,null));};exports[_0xe9bd('0x29')]=function(_0x555a98,_0x343479){if(_0x555a98[_0xe9bd('0x30')]['id']){delete _0x555a98['body']['id'];}return db[_0xe9bd('0xc2')][_0xe9bd('0x81')]({'where':{'id':_0x555a98[_0xe9bd('0xbd')]['id']}})[_0xe9bd('0x2b')](handleEntityNotFound(_0x343479,null))['then'](saveUpdates(_0x555a98[_0xe9bd('0x30')],null))[_0xe9bd('0x2b')](respondWithResult(_0x343479,null))['catch'](handleError(_0x343479,null));};exports[_0xe9bd('0x2a')]=function(_0x1dab51,_0x2d5601){return db['ChatInteraction'][_0xe9bd('0x81')]({'where':{'id':_0x1dab51[_0xe9bd('0xbd')]['id']}})[_0xe9bd('0x2b')](handleEntityNotFound(_0x2d5601,null))[_0xe9bd('0x2b')](removeEntity(_0x2d5601,null))[_0xe9bd('0x3c')](handleError(_0x2d5601,null));};exports[_0xe9bd('0xc3')]=function(_0x136aa0,_0x4d1288){return db[_0xe9bd('0xc2')][_0xe9bd('0xc3')]()[_0xe9bd('0x2b')](respondWithResult(_0x4d1288,null))['catch'](handleError(_0x4d1288,null));};exports[_0xe9bd('0xc4')]=function(_0x57c26d,_0x5ba105){var _0x4e1eb8=_0x57c26d[_0xe9bd('0xbd')]['id'];var _0x48af68;var _0x516080;var _0xd7ea2f;return db[_0xe9bd('0xc2')]['findOne']({'where':{'id':_0x4e1eb8}})[_0xe9bd('0x2b')](function(_0x48f4cd){_0x48af68=_0x48f4cd;return db['ChatWebsite']['findOne']({'where':{'id':_0x48f4cd[_0xe9bd('0x86')]},'attributes':['id','vidaooApiKey','vidaooEscalation',_0xe9bd('0xc5'),_0xe9bd('0xc6'),_0xe9bd('0xc7')],'raw':!![]});})[_0xe9bd('0x2b')](function(_0x276374){if(_0x276374&&_0x276374[_0xe9bd('0xc8')]&&_0x276374[_0xe9bd('0xc9')]){_0x516080=_0x276374;var _0x5ebe24={'interaction':{'id':_0x4e1eb8},'agent':{'id':_0x57c26d[_0xe9bd('0xa3')]['id'],'name':_0x57c26d['user']['name'],'fullname':_0x57c26d[_0xe9bd('0xa3')][_0xe9bd('0x36')],'email':_0x57c26d[_0xe9bd('0xa3')][_0xe9bd('0xca')]},'contact':_0x57c26d[_0xe9bd('0x30')]['contact'],'account':_0x57c26d[_0xe9bd('0x30')][_0xe9bd('0x34')]};var _0x460eb8={'rejectUnauthorized':![],'method':_0xe9bd('0xcb'),'url':_0xe9bd('0xcc'),'headers':{'X-APIKEY':_0x276374[_0xe9bd('0xc8')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x57c26d['user'][_0xe9bd('0xca')]],'buttons':null,'topic':_0x516080[_0xe9bd('0xc5')],'note':_[_0xe9bd('0xcd')](_0x516080[_0xe9bd('0xc6')])?null:getMustacheRender(_0x516080[_0xe9bd('0xc6')],_0x5ebe24),'metadata':null},'redirect':_0xe9bd('0xce'),'json':!![]};try{if(!_['isNull'](_0x516080[_0xe9bd('0xc7')])){var _0x16c3e1=getMustacheRender(_0x516080['vidaooMetadata'],_0x5ebe24);var _0x1e5c54=JSON[_0xe9bd('0x89')](_0x16c3e1);_0x460eb8[_0xe9bd('0x30')][_0xe9bd('0xcf')]=_0x1e5c54;}}catch(_0x5befe7){throw new db[(_0xe9bd('0x99'))][(_0xe9bd('0xd0'))](_0xe9bd('0xd1'));}return rp(_0x460eb8);}else{throw new db[(_0xe9bd('0x99'))][(_0xe9bd('0xd0'))](_0xe9bd('0xd2'));}})[_0xe9bd('0x2b')](function(_0x1940e7){_0xd7ea2f=_0x1940e7;if(_0xd7ea2f['id']){var _0x41506b={'body':_0xd7ea2f['join_url'],'ChatWebsiteId':_0x516080['id'],'ChatInteractionId':_0x48af68['id'],'direction':_0xe9bd('0xd3'),'UserId':_0x57c26d[_0xe9bd('0xa3')]['id']};return db[_0xe9bd('0xd4')][_0xe9bd('0xc1')](_0x41506b,{});}else{throw new db[(_0xe9bd('0x99'))][(_0xe9bd('0xd0'))](_0xe9bd('0xd5'));}})['then'](function(){return _0x48af68[_0xe9bd('0xd6')]({'vidaooSessionId':_0xd7ea2f['id']});})['then'](respondWithResult(_0x5ba105,null))[_0xe9bd('0x3c')](handleError(_0x5ba105,null));};exports[_0xe9bd('0xd7')]=function(_0x2db271,_0x1c2d6d){if(_0x2db271[_0xe9bd('0x30')]['id']){delete _0x2db271[_0xe9bd('0x30')]['id'];}return db['ChatInteraction'][_0xe9bd('0x81')]({'where':{'id':_0x2db271[_0xe9bd('0xbd')]['id']},'include':[{'model':db[_0xe9bd('0xd8')],'as':'Contact'}]})[_0xe9bd('0x2b')](handleEntityNotFound(_0x1c2d6d,null))[_0xe9bd('0x2b')](saveUpdates(_0x2db271[_0xe9bd('0x30')],null))[_0xe9bd('0x2b')](respondWithResult(_0x1c2d6d,null))[_0xe9bd('0x3c')](handleError(_0x1c2d6d,null));};exports[_0xe9bd('0xd9')]=function(_0x1e5a3f,_0x1c3af9){if(_0x1e5a3f[_0xe9bd('0x30')]['id']){delete _0x1e5a3f[_0xe9bd('0x30')]['id'];}return db['ChatInteraction'][_0xe9bd('0x81')]({'where':{'id':_0x1e5a3f[_0xe9bd('0xbd')]['id']}})[_0xe9bd('0x2b')](function(_0x517b10){if(!_0x517b10){logger[_0xe9bd('0x1c')](_0xe9bd('0xda'),_0xe9bd('0xd9'),0x194,'entity\x20not\x20found');_0x1c3af9['sendStatus'](0x194);}else{if(_0x517b10[_0xe9bd('0x41')]){throw new db[(_0xe9bd('0x99'))][(_0xe9bd('0xd0'))](_0xe9bd('0xdb'));}}return _0x517b10;})[_0xe9bd('0x2b')](function(_0x464102){if(_0x464102){return _0x464102[_0xe9bd('0x29')]({'closed':_0x1e5a3f['body'][_0xe9bd('0x43')],'disposition':_0x1e5a3f[_0xe9bd('0x30')]['disposition']})[_0xe9bd('0x2b')](function(_0x3335a4){return _0x3335a4;});}})[_0xe9bd('0x2b')](function(){return respondWithRpcPromise(_0xe9bd('0xdc'),_0xe9bd('0xd9'),_0x1e5a3f[_0xe9bd('0x30')],client9004);})[_0xe9bd('0x2b')](respondWithResult(_0x1c3af9,null))[_0xe9bd('0x3c')](handleError(_0x1c3af9,null));};exports[_0xe9bd('0xdd')]=function(_0x10dfc8,_0x38ce72){_0x10dfc8[_0xe9bd('0x30')][_0xe9bd('0x2c')]=_0x10dfc8[_0xe9bd('0xde')][_0xe9bd('0xdf')];_0x10dfc8['body'][_0xe9bd('0xe0')]=_0x10dfc8[_0xe9bd('0xde')][_0xe9bd('0xe1')];_0x10dfc8[_0xe9bd('0x30')][_0xe9bd('0x49')]=_0x10dfc8['file'][_0xe9bd('0xe2')];return db[_0xe9bd('0xe3')][_0xe9bd('0xc1')](_0x10dfc8[_0xe9bd('0x30')])[_0xe9bd('0x2b')](respondWithResult(_0x38ce72,0xc9))[_0xe9bd('0x3c')](handleError(_0x38ce72,null));};exports[_0xe9bd('0xe4')]=function(_0x463d54,_0x3c1785){return db[_0xe9bd('0xc2')][_0xe9bd('0xe5')]({'where':{'id':_0x463d54[_0xe9bd('0xbd')]['id']},'raw':!![]})[_0xe9bd('0x2b')](handleEntityNotFound(_0x3c1785,null))['then'](function(_0x1412ed){if(_0x1412ed){if(_0x1412ed[_0xe9bd('0x43')]){return _0x3c1785[_0xe9bd('0x21')](0x193)[_0xe9bd('0x23')]({'status':0x193,'message':_0xe9bd('0xe6')});}return db[_0xe9bd('0xe3')][_0xe9bd('0xe5')]({'where':{'id':_0x463d54[_0xe9bd('0x4c')][_0xe9bd('0xe7')]},'raw':!![]})[_0xe9bd('0x2b')](handleEntityNotFound(_0x3c1785,null));}})[_0xe9bd('0x2b')](function(_0x2abe2a){if(_0x2abe2a){var _0x5da417=_0x2abe2a[_0xe9bd('0xe8')]!==null;var _0x38e43f=path[_0xe9bd('0xe9')](config[_0xe9bd('0xea')],_0xe9bd('0xeb'));if(_0x5da417){_0x38e43f=path['join'](_0x38e43f,_0xe9bd('0xec'));}var _0x43579b=path[_0xe9bd('0xe9')](_0x38e43f,_0x2abe2a['basename']);return _0x3c1785[_0xe9bd('0xed')](_0x43579b);}})[_0xe9bd('0x3c')](handleError(_0x3c1785,null));};exports['close']=function(_0x4efce6,_0x4b8f8e){var _0x28e51a=null;var _0x46017e=null;var _0x48cd92=null;if(_0x4efce6[_0xe9bd('0x30')]['id']){delete _0x4efce6[_0xe9bd('0x30')]['id'];}if(_0x4efce6[_0xe9bd('0x30')]['mailTranscript']){_0x48cd92=path[_0xe9bd('0xe9')](config[_0xe9bd('0xea')],_0xe9bd('0xee'),util[_0xe9bd('0xef')]('transcript-%s.txt',Date[_0xe9bd('0xf0')]()));_0x4efce6[_0xe9bd('0x30')]['pathTranscript']=_0x48cd92;}return db[_0xe9bd('0xc2')][_0xe9bd('0x81')]({'where':{'id':_0x4efce6[_0xe9bd('0xbd')]['id']},'include':[{'model':db[_0xe9bd('0xd4')],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})[_0xe9bd('0x2b')](handleEntityNotFound(_0x4b8f8e,null))['then'](saveUpdates(_0x4efce6[_0xe9bd('0x30')],null))[_0xe9bd('0x2b')](function(_0xff728b){if(_0xff728b){_0x28e51a=_0xff728b;return db[_0xe9bd('0xf1')][_0xe9bd('0x81')]({'where':{'id':_0x28e51a[_0xe9bd('0x86')]}});}})['then'](function(_0x117c16){if(_0x117c16){_0x46017e=_0x117c16;return db[_0xe9bd('0xd8')][_0xe9bd('0x81')]({'where':{'id':_0x28e51a[_0xe9bd('0x7b')]}});}})[_0xe9bd('0x2b')](function(_0x27740c){if(_0x27740c){if(_0x48cd92){var _0x25def7=null;for(var _0x552ea8=0x1;_0x552ea8<_0x28e51a[_0xe9bd('0xf2')][_0xe9bd('0x70')];++_0x552ea8){_0x25def7=_0x28e51a[_0xe9bd('0xf2')][_0x552ea8];var _0x1b5b7c=_0x25def7['UserId']?util[_0xe9bd('0xef')](_0xe9bd('0xf3'),_0x46017e[_0xe9bd('0xf4')],_0x25def7[_0xe9bd('0x41')]):_0xe9bd('0xf5');var _0x101aa0=_0x4efce6[_0xe9bd('0x30')][_0xe9bd('0xf6')]||util[_0xe9bd('0xef')](_0xe9bd('0xf3'),_0xe9bd('0xf7'),_0x25def7[_0xe9bd('0x7b')]);switch(_0x46017e[_0xe9bd('0xf8')]){case'website_alias':_0x1b5b7c=_0x25def7[_0xe9bd('0x41')]?util[_0xe9bd('0xef')]('%s%d',_0x46017e[_0xe9bd('0xf4')],_0x25def7[_0xe9bd('0x41')]):_0xe9bd('0xf5');break;case'agent_alias':_0x1b5b7c=_0x25def7[_0xe9bd('0x41')]?_0x25def7[_0xe9bd('0x7f')][_0xe9bd('0xf9')]||_0x25def7[_0xe9bd('0x7f')]['fullname']:_0xe9bd('0xf5');break;case _0xe9bd('0xfa'):_0x1b5b7c=_0x25def7[_0xe9bd('0x41')]?_0x25def7[_0xe9bd('0x7f')][_0xe9bd('0x36')]:_0xe9bd('0xf5');break;default:_0x1b5b7c=_0x25def7['UserId']?util[_0xe9bd('0xef')]('%s%d',_0x46017e['agentAlias'],_0x25def7[_0xe9bd('0x41')]):'System';}var _0x1ab3f2=util['format'](_0xe9bd('0xfb'),moment(_0x25def7[_0xe9bd('0x88')])['format'](_0xe9bd('0xfc')),_0x25def7[_0xe9bd('0xfd')]==='in'?_0x101aa0:_0x1b5b7c,_0x25def7[_0xe9bd('0x30')]);if(!_0x25def7[_0xe9bd('0xfe')]){fs[_0xe9bd('0xff')](_0x48cd92,_0x1ab3f2);}}return db[_0xe9bd('0x100')][_0xe9bd('0xe5')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xe9bd('0x101'),'raw':!![],'include':[{'model':db[_0xe9bd('0x102')],'as':_0xe9bd('0x102'),'raw':!![]}]}]});}}})[_0xe9bd('0x2b')](function(_0x33f143){if(!_0x33f143||!_0x33f143[_0xe9bd('0x101')]||!_0x4efce6['body'])return _0x28e51a;var _0xb82cb2=_0x33f143[_0xe9bd('0x103')]();return respondWithRpcPromise(_0xe9bd('0x104'),_0xe9bd('0x105'),{'account':_0xb82cb2,'message':{'from':util[_0xe9bd('0xef')]('\x22%s\x22\x20<%s>',_0x33f143['name'],_0x33f143['email']||_0x33f143[_0xe9bd('0x101')]['user']),'to':_0x4efce6[_0xe9bd('0x30')][_0xe9bd('0x106')],'subject':'Mail\x20Transcript','text':util[_0xe9bd('0xef')](_0xe9bd('0x107'),_0x4efce6[_0xe9bd('0x30')][_0xe9bd('0x106')]),'attachments':[{'path':_0x48cd92}]}})[_0xe9bd('0x2b')](function(){return _0x28e51a;})[_0xe9bd('0x3c')](function(_0x914313){logger['error'](_0x914313);});})['then'](respondWithStatusCode(_0x4b8f8e,0xc8))[_0xe9bd('0x3c')](handleError(_0x4b8f8e,null));};exports['addMessage']=function(_0x54b3e9,_0x453d10){return db[_0xe9bd('0xd4')][_0xe9bd('0x81')]({'where':{'id':_0x54b3e9[_0xe9bd('0xbd')]['id']}})[_0xe9bd('0x2b')](handleEntityNotFound(_0x453d10,null))[_0xe9bd('0x2b')](function(_0x3a9bc4){if(_0x3a9bc4){return _0x3a9bc4[_0xe9bd('0x108')](_0x54b3e9[_0xe9bd('0x30')][_0xe9bd('0x109')],_[_0xe9bd('0x10a')](_0x54b3e9['body'],[_0xe9bd('0x109'),'id'])||{});}})['then'](respondWithResult(_0x453d10,null))[_0xe9bd('0x3c')](handleError(_0x453d10,null));};exports[_0xe9bd('0x10b')]=function(_0x33e998,_0x38f3ae){var _0x56541e={'raw':![],'where':{}};var _0x22ca72={};var _0x3bae9d={'count':0x0,'rows':[]};return db[_0xe9bd('0xc2')]['findOne']({'where':{'id':_0x33e998['params']['id']}})[_0xe9bd('0x2b')](handleEntityNotFound(_0x38f3ae,null))[_0xe9bd('0x2b')](function(_0x6e1fd3){if(_0x6e1fd3){_0x22ca72[_0xe9bd('0x4b')]=_[_0xe9bd('0x4d')](db[_0xe9bd('0xd4')]['rawAttributes']);_0x22ca72[_0xe9bd('0x4c')]=_[_0xe9bd('0x4d')](_0x33e998[_0xe9bd('0x4c')]);_0x22ca72[_0xe9bd('0x56')]=_['intersection'](_0x22ca72[_0xe9bd('0x4b')],_0x22ca72[_0xe9bd('0x4c')]);_0x56541e[_0xe9bd('0x50')]=_['intersection'](_0x22ca72[_0xe9bd('0x4b')],qs[_0xe9bd('0x4f')](_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0x4f')]));_0x56541e[_0xe9bd('0x50')]=_0x56541e[_0xe9bd('0x50')][_0xe9bd('0x70')]?_0x56541e['attributes']:_0x22ca72['model'];if(!_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0x51')](_0xe9bd('0x52'))){_0x56541e['limit']=qs['limit'](_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0x25')]);_0x56541e[_0xe9bd('0x24')]=qs['offset'](_0x33e998[_0xe9bd('0x4c')]['offset']);}_0x56541e[_0xe9bd('0x9e')]=qs[_0xe9bd('0x53')](_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0x53')]);_0x56541e[_0xe9bd('0x54')]=qs[_0xe9bd('0x56')](_[_0xe9bd('0x55')](_0x33e998[_0xe9bd('0x4c')],_0x22ca72[_0xe9bd('0x56')]));_0x56541e['where']['ChatInteractionId']=_0x6e1fd3['id'];if(_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0x95')]){_0x56541e[_0xe9bd('0x54')]=_[_0xe9bd('0x2f')](_0x56541e[_0xe9bd('0x54')],{'$or':_[_0xe9bd('0x46')](_0x56541e[_0xe9bd('0x50')],function(_0xdfc5ca){var _0x593e55={};_0x593e55[_0xdfc5ca]={'$like':'%'+_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0x95')]+'%'};return _0x593e55;})});}if(_0x33e998['query'][_0xe9bd('0x8a')]){var _0x4c4890=_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0x8a')][_0xe9bd('0x39')](',');var _0x5a7a61={};_0x5a7a61[_0x4c4890[0x0]]={'$gte':moment(_0x4c4890[0x1])[_0xe9bd('0xef')](_0xe9bd('0x10c'))};_0x56541e['where']=_[_0xe9bd('0x2f')](_0x56541e[_0xe9bd('0x54')],_0x5a7a61);}_0x56541e=_[_0xe9bd('0x2f')]({},_0x56541e,_0x33e998[_0xe9bd('0xc0')]);return db[_0xe9bd('0xd4')]['count']({'where':_0x56541e[_0xe9bd('0x54')]})[_0xe9bd('0x2b')](function(_0x993518){_0x3bae9d[_0xe9bd('0x27')]=_0x993518;if(_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0xbe')]){_0x56541e['include']=[{'all':!![]}];}return db[_0xe9bd('0xd4')]['findAll'](_0x56541e);})[_0xe9bd('0x2b')](function(_0x560ed7){_0x3bae9d[_0xe9bd('0x10d')]=_0x560ed7;return _0x3bae9d;});}})[_0xe9bd('0x2b')](respondWithFilteredResult(_0x38f3ae,_0x56541e))['catch'](handleError(_0x38f3ae,null));};exports[_0xe9bd('0x10e')]=function(_0x170bf0,_0x5a8d1a){var _0xd2c2a1={'where':{}},_0x4b269d={},_0x557cf5={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xe9bd('0xe5')]({'where':{'id':_0x170bf0[_0xe9bd('0xbd')]['id']}})['then'](handleEntityNotFound(_0x5a8d1a,null))['then'](function(_0x367dcc){if(_0x367dcc){_0x4b269d['model']=_[_0xe9bd('0x4d')](db[_0xe9bd('0xd4')]['rawAttributes']);_0x4b269d[_0xe9bd('0x4c')]=_[_0xe9bd('0x4d')](_0x170bf0[_0xe9bd('0x4c')]);_0x4b269d[_0xe9bd('0x56')]=_[_0xe9bd('0x4e')](_0x4b269d[_0xe9bd('0x4b')],_0x4b269d[_0xe9bd('0x4c')]);_0xd2c2a1[_0xe9bd('0x50')]=_[_0xe9bd('0x4e')](_0x4b269d[_0xe9bd('0x4b')],qs[_0xe9bd('0x4f')](_0x170bf0[_0xe9bd('0x4c')][_0xe9bd('0x4f')]));_0xd2c2a1['attributes']=_0xd2c2a1[_0xe9bd('0x50')][_0xe9bd('0x70')]?_0xd2c2a1[_0xe9bd('0x50')]:_0x4b269d[_0xe9bd('0x4b')];if(!_0x170bf0[_0xe9bd('0x4c')]['hasOwnProperty'](_0xe9bd('0x52'))){_0xd2c2a1[_0xe9bd('0x25')]=qs[_0xe9bd('0x25')](_0x170bf0[_0xe9bd('0x4c')][_0xe9bd('0x25')]);_0xd2c2a1[_0xe9bd('0x24')]=qs[_0xe9bd('0x24')](_0x170bf0['query'][_0xe9bd('0x24')]);}_0xd2c2a1[_0xe9bd('0x9e')]=qs['sort'](_0x170bf0[_0xe9bd('0x4c')][_0xe9bd('0x53')]);_0xd2c2a1[_0xe9bd('0x54')]=qs[_0xe9bd('0x56')](_[_0xe9bd('0x55')](_0x170bf0[_0xe9bd('0x4c')],_0x4b269d[_0xe9bd('0x56')]));_0xd2c2a1[_0xe9bd('0x54')]['ChatInteractionId']=_0x367dcc['id'];if(_0x170bf0[_0xe9bd('0x4c')][_0xe9bd('0x95')]){_0xd2c2a1[_0xe9bd('0x54')]=_['merge'](_0xd2c2a1[_0xe9bd('0x54')],{'$or':_[_0xe9bd('0x46')](_0xd2c2a1['attributes'],function(_0x48dc13){var _0xebabdd={};_0xebabdd[_0x48dc13]={'$like':'%'+_0x170bf0['query'][_0xe9bd('0x95')]+'%'};return _0xebabdd;})});}_0xd2c2a1[_0xe9bd('0x54')][_0xe9bd('0xfe')]=![];if(_0x170bf0[_0xe9bd('0x4c')]['id']){_0xd2c2a1[_0xe9bd('0x54')]['id']={'$gt':_0x170bf0[_0xe9bd('0x4c')]['id']};}_0xd2c2a1=_[_0xe9bd('0x2f')]({},_0xd2c2a1,_0x170bf0[_0xe9bd('0xc0')]);return db['ChatMessage'][_0xe9bd('0x27')]({'where':_0xd2c2a1[_0xe9bd('0x54')]})[_0xe9bd('0x2b')](function(_0x351791){_0x557cf5[_0xe9bd('0x27')]=_0x351791;_0xd2c2a1[_0xe9bd('0xbf')]=[];if(_0x170bf0['query'][_0xe9bd('0x10f')]){_0xd2c2a1[_0xe9bd('0xbf')][_0xe9bd('0x3b')]({'model':db[_0xe9bd('0x7f')],'as':_0xe9bd('0x7f'),'attributes':['id',_0xe9bd('0x36'),_0xe9bd('0xf9')]});}if(_0x170bf0[_0xe9bd('0x4c')]['includeAll']){_0xd2c2a1['include']=[{'all':!![]}];}return db[_0xe9bd('0xd4')][_0xe9bd('0x110')](_0xd2c2a1);})[_0xe9bd('0x2b')](function(_0xc219e9){_0x557cf5[_0xe9bd('0x10d')]=_0xc219e9;return _0x557cf5;});}})[_0xe9bd('0x2b')](respondWithFilteredResult(_0x5a8d1a,_0xd2c2a1))[_0xe9bd('0x3c')](handleError(_0x5a8d1a,null));};exports[_0xe9bd('0x111')]=function(_0x432aea,_0x2301ce){return db['ChatInteraction'][_0xe9bd('0x81')]({'where':{'id':_0x432aea[_0xe9bd('0xbd')]['id']}})[_0xe9bd('0x2b')](handleEntityNotFound(_0x2301ce,null))[_0xe9bd('0x2b')](function(_0x2e6329){if(_0x2e6329){return _0x2e6329[_0xe9bd('0x112')](_0x432aea[_0xe9bd('0x30')]['ids'],_[_0xe9bd('0x10a')](_0x432aea[_0xe9bd('0x30')],[_0xe9bd('0x109'),'id'])||{})[_0xe9bd('0x113')](function(){return db[_0xe9bd('0x114')]['findAll']({'attributes':['id',_0xe9bd('0x2c'),_0xe9bd('0x115')],'where':{'id':_0x432aea[_0xe9bd('0x30')][_0xe9bd('0x109')]}});})[_0xe9bd('0x2b')](function(_0x47d0d5){socket[_0xe9bd('0x116')]('chatInteractionTags:save',{'id':Number(_0x432aea[_0xe9bd('0xbd')]['id']),'tags':_0x47d0d5||[]});return{'id':Number(_0x432aea[_0xe9bd('0xbd')]['id']),'tags':_0x47d0d5||[]};});}})[_0xe9bd('0x2b')](respondWithResult(_0x2301ce,null))['catch'](handleError(_0x2301ce,null));};exports['removeTags']=function(_0x38096d,_0x3ad097){return db[_0xe9bd('0xc2')]['find']({'where':{'id':_0x38096d[_0xe9bd('0xbd')]['id']}})[_0xe9bd('0x2b')](handleEntityNotFound(_0x3ad097,null))[_0xe9bd('0x2b')](function(_0x1d6363){if(_0x1d6363){return _0x1d6363[_0xe9bd('0x117')](_0x38096d[_0xe9bd('0x4c')][_0xe9bd('0x109')]);}})[_0xe9bd('0x2b')](respondWithStatusCode(_0x3ad097,null))[_0xe9bd('0x3c')](handleError(_0x3ad097,null));};exports[_0xe9bd('0xed')]=function(_0x1bae64,_0x23f104){var _0x3b5bca=moment()[_0xe9bd('0x118')]()['toString']();var _0x3fe9ca=path[_0xe9bd('0xe9')](config['root'],_0xe9bd('0x119'),_0xe9bd('0x11a'),_0xe9bd('0x11b'));var _0x4335ad=path['join'](config[_0xe9bd('0xea')],_0xe9bd('0x119'),_0xe9bd('0x11a'),_0xe9bd('0x11c'));var _0x52d59e=path['join'](_0x3fe9ca,_0x3b5bca);var _0x3107f0=util['format'](_0xe9bd('0x11d'),_0x1bae64[_0xe9bd('0xbd')]['id'],_0x3b5bca);var _0x8f8874=path[_0xe9bd('0xe9')](_0x3fe9ca,_0x3107f0);var _0x240cd0=[];_0x240cd0['push']({'model':db[_0xe9bd('0x7f')],'as':_0xe9bd('0x7f'),'attributes':['id',_0xe9bd('0x36')],'raw':!![]});_0x240cd0[_0xe9bd('0x3b')]({'model':db[_0xe9bd('0xd8')],'as':_0xe9bd('0x75'),'attributes':['id',_0xe9bd('0x11e'),'lastName'],'raw':!![]});if(_0x1bae64[_0xe9bd('0x4c')][_0xe9bd('0x11c')]){_0x240cd0[_0xe9bd('0x3b')]({'model':db[_0xe9bd('0xe3')],'as':_0xe9bd('0xe3'),'raw':!![]});}var _0x5f3e76=[{'model':db[_0xe9bd('0xd4')],'as':_0xe9bd('0xf2'),'attributes':['id',_0xe9bd('0x30'),_0xe9bd('0x88'),_0xe9bd('0xfd'),_0xe9bd('0xfe'),_0xe9bd('0x90')],'include':_0x240cd0}];_0x5f3e76[_0xe9bd('0x3b')]({'model':db[_0xe9bd('0xf1')],'as':_0xe9bd('0x11f'),'attributes':['id',_0xe9bd('0x2c')]});_0x5f3e76[_0xe9bd('0x3b')]({'model':db[_0xe9bd('0x7f')],'as':_0xe9bd('0x120'),'attributes':['id',_0xe9bd('0x36')]});return db[_0xe9bd('0xc2')][_0xe9bd('0x81')]({'where':{'id':_0x1bae64[_0xe9bd('0xbd')]['id']},'include':_0x5f3e76})[_0xe9bd('0x2b')](handleEntityNotFound(_0x23f104,null))[_0xe9bd('0x2b')](function(_0x5e6e02){if(_0x5e6e02){var _0xa3e69c=_0x5e6e02[_0xe9bd('0x121')]({'plain':!![]});fs[_0xe9bd('0x122')](_0x52d59e);var _0x126e47={'channel':'Chat','account':_0xa3e69c[_0xe9bd('0x11f')]['name'],'agent':_0xa3e69c['Owner']?_0xa3e69c['Owner']['fullname']:_0xe9bd('0x123'),'createdAt':moment(_0xa3e69c[_0xe9bd('0x88')])[_0xe9bd('0xef')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe9bd('0xa8')](),'closedAt':_0xa3e69c['closed']?moment(_0xa3e69c[_0xe9bd('0x124')])[_0xe9bd('0xef')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe9bd('0xa8')]():'','disposition':_0xa3e69c['disposition'],'chatInfo':{'browser':_0xa3e69c['browserName'],'os':_0xa3e69c[_0xe9bd('0x125')],'referer':_0xa3e69c[_0xe9bd('0x126')],'customerIp':_0xa3e69c[_0xe9bd('0x127')],'customerPort':_0xa3e69c['customerPort']?_0xa3e69c[_0xe9bd('0x128')]:'N.A.'},'messages':_(_0xa3e69c[_0xe9bd('0xf2')])['tail']()[_0xe9bd('0x95')]({'secret':![]})[_0xe9bd('0x46')](function(_0x38aa10){if(_0x38aa10['Attachment']){var _0x1402d0=path['join'](_0x4335ad,_0x38aa10[_0xe9bd('0xe3')][_0xe9bd('0xe0')]);if(fs[_0xe9bd('0x129')](_0x1402d0)){fs[_0xe9bd('0x12a')](_0x1402d0)[_0xe9bd('0x12b')](fs[_0xe9bd('0x12c')](path[_0xe9bd('0xe9')](_0x52d59e,_0x38aa10[_0xe9bd('0xe3')][_0xe9bd('0xe0')])));}}return{'date':moment(_0x38aa10[_0xe9bd('0x88')])[_0xe9bd('0xef')](_0xe9bd('0x10c'))[_0xe9bd('0xa8')](),'sender':_0x38aa10[_0xe9bd('0xfd')]===_0xe9bd('0xd3')?_0x38aa10[_0xe9bd('0x7f')]?_0x38aa10[_0xe9bd('0x7f')][_0xe9bd('0x36')]:_0xe9bd('0xf5'):_0x38aa10[_0xe9bd('0x75')][_0xe9bd('0x11e')]+(_0x38aa10['Contact'][_0xe9bd('0x12d')]?'\x20'+_0x38aa10[_0xe9bd('0x75')]['lastName']:''),'body':_0x38aa10[_0xe9bd('0xe3')]?_0x38aa10[_0xe9bd('0xe3')][_0xe9bd('0xe0')]:_0x38aa10[_0xe9bd('0x30')],'direction':_0x38aa10[_0xe9bd('0xfd')]==='out'?'A':'C','secret':_0x38aa10[_0xe9bd('0xfe')],'read':_0x38aa10[_0xe9bd('0x90')],'attachment':_0x38aa10[_0xe9bd('0xe3')]};})[_0xe9bd('0x72')]()};return ejs[_0xe9bd('0x12e')](path[_0xe9bd('0xe9')](config[_0xe9bd('0xea')],_0xe9bd('0x119'),_0xe9bd('0x12f'),_0xe9bd('0x130')),{'interaction':_0x126e47})['then'](function(_0x14f61d){var _0x271116=path[_0xe9bd('0xe9')](_0x52d59e,_0xe9bd('0x131')+_0xa3e69c['id']+'-'+_0x3b5bca+_0xe9bd('0x132'));var _0x45da6a={'path':_0x271116,'channel':_0xe9bd('0x133'),'interactionId':_0xa3e69c['id']};return pdf[_0xe9bd('0x134')](_0x14f61d,_0x45da6a);})['then'](function(){return new Promise(function(_0x34c5f,_0x25b453){zipdir(_0x52d59e,{'saveTo':_0x8f8874},function(_0x2d9878,_0x10ea33){if(_0x2d9878)return _0x25b453(_0x2d9878);return _0x34c5f(_0x10ea33);});})['then'](function(){return new BPromise(function(_0x138630,_0x3682d1){rimraf(_0x52d59e,function(_0x298c03){if(_0x298c03)_0x3682d1(_0x298c03);return _0x138630();});});})[_0xe9bd('0x2b')](function(){return _0x23f104[_0xe9bd('0xed')](_0x8f8874,_0x3107f0,function(_0x3f4426){if(_0x3f4426){logger[_0xe9bd('0x1c')](_0xe9bd('0x135'),_0x3f4426);}else{fs['unlinkSync'](_0x8f8874);}});});});}else{return _0x23f104[_0xe9bd('0x20')](0xc8);}})['catch'](handleError(_0x23f104,null));}; \ No newline at end of file +var _0x4bc3=['customer','%s%d','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','findAll','addTags','setTags','omit','Tag','color','emit','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','Account','get','mkdirSync','Owner','N.A.','closedAt','browserName','osName','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','views','downloadInteraction.ejs','.pdf','Chat','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','http','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','update','then','destroy','stack','name','send','merge','body','contact','agent','map','fullname','Tags','TagIds','split','push','waiting','answered','unmanaged','abandoned','closed','UserId','talking','disposition','index','ChatInteraction','rawAttributes','fieldName','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_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','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','type','keys','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','count','toString','keyBy','fields','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','params','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','parse','metadata','Error\x20in\x20conversion\x20vidaooMetadata','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','ValidationError','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','transcript-%s.txt','ChatMessage','Messages','format','agentAlias'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x4bc3,0x16e));var _0x34bc=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x4bc3[_0x15c421];return _0x5e5ed5;};'use strict';var rimraf=require(_0x34bc('0x0'));var zipdir=require(_0x34bc('0x1'));var rp=require('request-promise');var moment=require(_0x34bc('0x2'));var BPromise=require(_0x34bc('0x3'));var Mustache=require('mustache');var util=require(_0x34bc('0x4'));var path=require(_0x34bc('0x5'));var ejs=require(_0x34bc('0x6'));var fs=require('fs');var _=require(_0x34bc('0x7'));var squel=require(_0x34bc('0x8'));var Redis=require(_0x34bc('0x9'));var qs=require(_0x34bc('0xa'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x34bc('0xb'));var logger=require('../../config/logger')('api');var config=require(_0x34bc('0xc'));var db=require(_0x34bc('0xd'))['db'];config[_0x34bc('0xe')]=_[_0x34bc('0xf')](config[_0x34bc('0xe')],{'host':_0x34bc('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x34bc('0x11'))[_0x34bc('0x12')](socket);var jayson=require(_0x34bc('0x13'));var client=jayson['client'][_0x34bc('0x14')]({'port':0x232b});var client9004=jayson['client'][_0x34bc('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x124b87,_0x164fb2,_0x536ebd,_0x3f8852){return new BPromise(function(_0x553a7d,_0x12cf72){var _0x43ff68=_0x3f8852||client;return _0x43ff68[_0x34bc('0x15')](_0x124b87,_0x536ebd)['then'](function(_0x4c365a){logger[_0x34bc('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x164fb2,_0x34bc('0x17'));logger[_0x34bc('0x18')](_0x34bc('0x19'),_0x164fb2,_0x34bc('0x17'),JSON[_0x34bc('0x1a')](_0x4c365a));if(_0x4c365a[_0x34bc('0x1b')]){if(_0x4c365a['error']['code']===0x1f4){logger['error'](_0x34bc('0x1c'),_0x164fb2,_0x4c365a[_0x34bc('0x1b')][_0x34bc('0x1d')]);return _0x12cf72(_0x4c365a[_0x34bc('0x1b')]['message']);}logger[_0x34bc('0x1b')](_0x34bc('0x1c'),_0x164fb2,_0x4c365a['error'][_0x34bc('0x1d')]);return _0x553a7d(_0x4c365a[_0x34bc('0x1b')]['message']);}else{logger[_0x34bc('0x16')](_0x34bc('0x1c'),_0x164fb2,_0x34bc('0x17'));_0x553a7d(_0x4c365a[_0x34bc('0x1e')][_0x34bc('0x1d')]);}})[_0x34bc('0x1f')](function(_0x48087e){logger[_0x34bc('0x1b')](_0x34bc('0x1c'),_0x164fb2,_0x48087e);_0x12cf72(_0x48087e);});});}function respondWithStatusCode(_0x38882c,_0x48eb94){_0x48eb94=_0x48eb94||0xcc;return function(_0x4c4b9a){if(_0x4c4b9a){return _0x38882c[_0x34bc('0x20')](_0x48eb94);}return _0x38882c[_0x34bc('0x21')](_0x48eb94)[_0x34bc('0x22')]();};}function respondWithResult(_0x410800,_0x13094a){_0x13094a=_0x13094a||0xc8;return function(_0x2e22e3){if(_0x2e22e3){return _0x410800[_0x34bc('0x21')](_0x13094a)[_0x34bc('0x23')](_0x2e22e3);}};}function respondWithFilteredResult(_0x19472e,_0x25d6fe){return function(_0x2de017){if(_0x2de017){var _0x1edcb0=typeof _0x25d6fe['offset']===_0x34bc('0x24')&&typeof _0x25d6fe['limit']==='undefined';var _0x3da96b=_0x2de017['count'];var _0x4082c3=_0x1edcb0?0x0:_0x25d6fe[_0x34bc('0x25')];var _0x46fd76=_0x1edcb0?_0x2de017['count']:_0x25d6fe[_0x34bc('0x25')]+_0x25d6fe[_0x34bc('0x26')];var _0x384fd7;if(_0x46fd76>=_0x3da96b){_0x46fd76=_0x3da96b;_0x384fd7=0xc8;}else{_0x384fd7=0xce;}_0x19472e[_0x34bc('0x21')](_0x384fd7);return _0x19472e[_0x34bc('0x27')](_0x34bc('0x28'),_0x4082c3+'-'+_0x46fd76+'/'+_0x3da96b)['json'](_0x2de017);}return null;};}function saveUpdates(_0xff07bd){return function(_0x1fb7c5){if(_0x1fb7c5){return _0x1fb7c5[_0x34bc('0x29')](_0xff07bd)[_0x34bc('0x2a')](function(_0x2241b4){return _0x2241b4;});}return null;};}function removeEntity(_0xd92957){return function(_0x5b37de){if(_0x5b37de){return _0x5b37de[_0x34bc('0x2b')]()['then'](function(){_0xd92957['status'](0xcc)[_0x34bc('0x22')]();});}};}function handleEntityNotFound(_0x540aa3){return function(_0x1e8445){if(!_0x1e8445){_0x540aa3[_0x34bc('0x20')](0x194);}return _0x1e8445;};}function handleError(_0xb446f4,_0x452a51){_0x452a51=_0x452a51||0x1f4;return function(_0x1b6264){logger[_0x34bc('0x1b')](_0x1b6264[_0x34bc('0x2c')]);if(_0x1b6264['name']){delete _0x1b6264[_0x34bc('0x2d')];}_0xb446f4[_0x34bc('0x21')](_0x452a51)[_0x34bc('0x2e')](_0x1b6264);};}function getMustacheRender(_0x3224c7,_0x360126){return Mustache['render'](_0x3224c7,_[_0x34bc('0x2f')](_0x360126[_0x34bc('0x30')],{'contact':_0x360126[_0x34bc('0x31')],'message':_0x360126[_0x34bc('0x1d')],'agent':_0x360126[_0x34bc('0x32')],'interaction':_0x360126['interaction'],'account':_0x360126['account']}))||'';}function getInteractionUsers(_0x39e630,_0x6a3bd3){return new BPromise(function(_0xf9453c,_0x128c1c){try{if(_0x6a3bd3[_0x39e630['id']]){_0x39e630['Users']=_[_0x34bc('0x33')](_0x6a3bd3[_0x39e630['id']],function(_0x4477bd){return{'id':_0x4477bd['id'],'fullname':_0x4477bd[_0x34bc('0x34')]};});}}catch(_0x5b6acd){_0x128c1c(_0x5b6acd);}_0xf9453c(_0x39e630);});}function getInteractionTags(_0x37cd30,_0x42d1eb){return new BPromise(function(_0xd0e121,_0x18663c){try{if(_0x37cd30['TagIds']){_0x37cd30[_0x34bc('0x35')]=[];_0x37cd30[_0x34bc('0x36')][_0x34bc('0x37')](',')['forEach'](function(_0x246a86){_0x37cd30[_0x34bc('0x35')][_0x34bc('0x38')](_0x42d1eb[_0x246a86]);});}delete _0x37cd30[_0x34bc('0x36')];}catch(_0x348cea){_0x18663c(_0x348cea);}_0xd0e121(_0x37cd30);});}function updateChatInteraction(_0x4fc2dc,_0xca2aaf,_0x281e81){return new BPromise(function(_0xb66ba0,_0x174cfe){return getInteractionUsers(_0x4fc2dc,_0x281e81)[_0x34bc('0x2a')](function(_0x4bf331){return getInteractionTags(_0x4bf331,_0xca2aaf);})[_0x34bc('0x2a')](function(_0x50f1ee){return getStateInteraction(_0x50f1ee);})[_0x34bc('0x2a')](function(_0x3f07f5){_0xb66ba0(_0x3f07f5);})[_0x34bc('0x1f')](function(_0x384994){_0x174cfe(_0x384994);});});}function getStateInteraction(_0x53feca){return new BPromise(function(_0x11ab9c){_0x53feca[_0x34bc('0x39')]=0x0;_0x53feca['talking']=0x0;_0x53feca[_0x34bc('0x3a')]=0x0;_0x53feca[_0x34bc('0x3b')]=0x0;_0x53feca[_0x34bc('0x3c')]=0x0;_0x53feca['total']=0x0;if(!_0x53feca[_0x34bc('0x3d')]&&!_0x53feca[_0x34bc('0x3e')]){_0x53feca[_0x34bc('0x39')]+=0x1;}if(!_0x53feca[_0x34bc('0x3d')]&&_0x53feca[_0x34bc('0x3e')]){_0x53feca[_0x34bc('0x3f')]+=0x1;if(_0x53feca[_0x34bc('0x39')]){_0x53feca[_0x34bc('0x39')]-=0x1;}}if(_0x53feca[_0x34bc('0x3d')]&&_0x53feca[_0x34bc('0x40')]===_0x34bc('0x3c')){_0x53feca['abandoned']+=0x1;if(_0x53feca['waiting']){_0x53feca[_0x34bc('0x39')]-=0x1;}}else if(_0x53feca[_0x34bc('0x3d')]&&!_0x53feca[_0x34bc('0x3e')]&&_0x53feca[_0x34bc('0x40')]){_0x53feca[_0x34bc('0x3b')]+=0x1;if(_0x53feca[_0x34bc('0x39')]){_0x53feca['waiting']-=0x1;}}else if(_0x53feca[_0x34bc('0x3d')]&&_0x53feca['UserId']){_0x53feca[_0x34bc('0x3a')]+=0x1;if(_0x53feca[_0x34bc('0x3f')]){_0x53feca[_0x34bc('0x3f')]-=0x1;}}_0x53feca['total']+=0x1;_0x11ab9c(_0x53feca);});}exports[_0x34bc('0x41')]=function(_0xf7c0be,_0x1b42f5){var _0x1c6480={},_0x21b903={},_0x26924c={'count':0x0,'rows':[]};var _0xba179d=_[_0x34bc('0x33')](db[_0x34bc('0x42')][_0x34bc('0x43')],function(_0x100c70){return{'name':_0x100c70[_0x34bc('0x44')],'type':_0x100c70['type']['key']};});_0x21b903[_0x34bc('0x45')]=_[_0x34bc('0x33')](_0xba179d,_0x34bc('0x2d'));_0x21b903['query']=_['keys'](_0xf7c0be[_0x34bc('0x46')]);_0x21b903[_0x34bc('0x47')]=_[_0x34bc('0x48')](_0x21b903['model'],_0x21b903[_0x34bc('0x46')]);_0x1c6480[_0x34bc('0x49')]=_['intersection'](_0x21b903[_0x34bc('0x45')],qs['fields'](_0xf7c0be[_0x34bc('0x46')]['fields']));_0x1c6480[_0x34bc('0x49')]=_0x1c6480[_0x34bc('0x49')][_0x34bc('0x4a')]?_0x1c6480[_0x34bc('0x49')]:_0x21b903['model'];if(!_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x4b')](_0x34bc('0x4c'))){_0x1c6480[_0x34bc('0x26')]=qs[_0x34bc('0x26')](_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x26')]);_0x1c6480[_0x34bc('0x25')]=qs['offset'](_0xf7c0be['query']['offset']);}_0x1c6480[_0x34bc('0x4d')]=qs[_0x34bc('0x4e')](_0xf7c0be['query'][_0x34bc('0x4e')]);_0x1c6480[_0x34bc('0x4f')]=qs[_0x34bc('0x47')](_[_0x34bc('0x50')](_0xf7c0be[_0x34bc('0x46')],_0x21b903['filters']),_0xba179d);var _0x5b6497=[];var _0x52d4c7=squel[_0x34bc('0x51')]()[_0x34bc('0x52')]('id')[_0x34bc('0x52')](_0x34bc('0x2d'))[_0x34bc('0x52')]('color')[_0x34bc('0x53')](_0x34bc('0x54'));var _0x3dabaa=squel[_0x34bc('0x51')]()['field'](_0x34bc('0x55'))[_0x34bc('0x52')](_0x34bc('0x56'))[_0x34bc('0x52')](_0x34bc('0x57'))[_0x34bc('0x53')](_0x34bc('0x58'),'ui')[_0x34bc('0x59')](_0x34bc('0x5a'),'u',_0x34bc('0x5b'));var _0x39c580=squel[_0x34bc('0x51')]()[_0x34bc('0x53')]('chat_interactions','i')[_0x34bc('0x59')](_0x34bc('0x5c'),'c',_0x34bc('0x5d'))[_0x34bc('0x59')](_0x34bc('0x5a'),'o',_0x34bc('0x5e'))[_0x34bc('0x59')](_0x34bc('0x5f'),'a',_0x34bc('0x60'))[_0x34bc('0x59')](_0x34bc('0x61'),'me',_0x34bc('0x62'))[_0x34bc('0x59')](_0x34bc('0x63'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x34bc('0x59')](_0x34bc('0x54'),'t',_0x34bc('0x64'));var _0x320d86=squel[_0x34bc('0x65')]();var _0x2b46b8=[];var _0x16ac8a=squel[_0x34bc('0x65')]();var _0x47068c;if(_0xf7c0be[_0x34bc('0x46')]['search']){_0x47068c=as[_0x34bc('0x66')](_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x67')]);var _0x582931=_0x47068c[_0x34bc('0x68')];for(var _0x295420=0x0;_0x295420<_0x47068c[_0x34bc('0x69')][_0x34bc('0x4a')];_0x295420++){var _0x535a53=_0x47068c[_0x34bc('0x69')][_0x295420];var _0x284b55='i';var _0x3701b7=_[_0x34bc('0x6a')](_0xba179d,[_0x34bc('0x2d'),_0x535a53[_0x34bc('0x52')]]);if(!_0x3701b7){switch(_0x535a53[_0x34bc('0x52')]){case _0x34bc('0x6b'):if(_0x535a53['value']==0x1){_0x39c580['having']('`'+_0x535a53[_0x34bc('0x52')]+_0x34bc('0x6c'));}else{_0x39c580[_0x34bc('0x6d')]('`'+_0x535a53[_0x34bc('0x52')]+_0x34bc('0x6e'));}break;case _0x34bc('0x6f'):if(_0x535a53[_0x34bc('0x70')]===_0x34bc('0x71')){if(_0x535a53[_0x34bc('0x72')][_0x34bc('0x37')]('\x20')[_0x34bc('0x4a')]>0x1){_0x320d86[_0x582931](_0x34bc('0x73'),qs[_0x34bc('0x74')](_0x535a53[_0x34bc('0x72')]),null);}else{var _0x4d7c67='%'+_0x535a53[_0x34bc('0x72')]+'%';_0x320d86[_0x582931](_0x34bc('0x75'),_0x4d7c67,_0x4d7c67,_0x4d7c67);}}else{_0x3701b7=_[_0x34bc('0x6a')](_0xba179d,['name',_0x34bc('0x76')]);_0x535a53[_0x34bc('0x52')]=_0x34bc('0x76');_0x348be3=as[_0x34bc('0x77')](_0x284b55,_0x3701b7['type'],_0x535a53);_0x320d86[_0x582931](_0x348be3[_0x34bc('0x78')],_0x348be3[_0x34bc('0x72')][_0x34bc('0x79')],_0x348be3[_0x34bc('0x72')][_0x34bc('0x22')]);}break;case'Tag':var _0xc08131=_0x535a53[_0x34bc('0x72')][_0x34bc('0x37')](',')[_0x34bc('0x33')](function(_0x52b73a){return Number(_0x52b73a);});_0xc08131[_0x34bc('0x7a')](function(_0xb920a6){_0x16ac8a['or'](_0x34bc('0x7b'),'%,'+_0xb920a6+',%');});_0x2b46b8=_[_0x34bc('0x7c')](_0x2b46b8,_0xc08131);break;case _0x34bc('0x7d'):if(_0x535a53[_0x34bc('0x70')]==='$substring'){_0x320d86[_0x582931]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x535a53[_0x34bc('0x72')]+'%',null);}else{_0x3701b7=_[_0x34bc('0x6a')](_0xba179d,['name',_0x34bc('0x3e')]);_0x535a53[_0x34bc('0x52')]=_0x34bc('0x3e');_0x348be3=as[_0x34bc('0x77')](_0x284b55,_0x3701b7['type'],_0x535a53);_0x320d86[_0x582931](_0x348be3['text'],_0x348be3[_0x34bc('0x72')][_0x34bc('0x79')],_0x348be3[_0x34bc('0x72')][_0x34bc('0x22')]);}break;case _0x34bc('0x30'):_0x348be3=as[_0x34bc('0x77')]('me',null,_0x535a53);_0x320d86[_0x582931](_0x348be3[_0x34bc('0x78')],_0x348be3[_0x34bc('0x72')][_0x34bc('0x79')],_0x348be3[_0x34bc('0x72')][_0x34bc('0x22')]);break;}}else{var _0x348be3=as[_0x34bc('0x77')](_0x284b55,_0x3701b7[_0x34bc('0x7e')],_0x535a53);_0x320d86[_0x582931](_0x348be3[_0x34bc('0x78')],_0x348be3[_0x34bc('0x72')]['start'],_0x348be3[_0x34bc('0x72')][_0x34bc('0x22')]);}}}else{var _0x1d9f60=_(_0xf7c0be[_0x34bc('0x46')])[_0x34bc('0x7f')]()['map'](function(_0x415c29){return _[_0x34bc('0x80')](_0xba179d,[_0x34bc('0x2d'),_0x415c29])?_0x415c29:undefined;})[_0x34bc('0x81')]()[_0x34bc('0x72')]();if(!_['isEmpty'](_0x1d9f60)){_0x1d9f60[_0x34bc('0x7a')](function(_0x3dbf1b){if(_0x3dbf1b===_0x34bc('0x82')){_0x39c580[_0x34bc('0x4f')](_0x34bc('0x83'),[][_0x34bc('0x84')](_0xf7c0be['query'][_0x3dbf1b]));}else if(_0x3dbf1b===_0x34bc('0x85')){var _0xcdbda5=JSON['parse'](_0xf7c0be[_0x34bc('0x46')][_0x3dbf1b])[_0x34bc('0x86')];var _0xd0213e=JSON['parse'](_0xf7c0be['query'][_0x3dbf1b])[_0x34bc('0x87')];_0x39c580['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xcdbda5,_0xd0213e);}else{if(_0xf7c0be['query'][_0x3dbf1b]===_0x34bc('0x88')){_0x39c580[_0x34bc('0x4f')]('i.'+_0x3dbf1b+_0x34bc('0x89'));}else{_0x39c580['where']('i.'+_0x3dbf1b+_0x34bc('0x8a'),_0xf7c0be[_0x34bc('0x46')][_0x3dbf1b]);}}});}if(_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x8b')]){if(_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x8b')]==0x1){_0x39c580[_0x34bc('0x6d')](_0x34bc('0x8c'));}else{_0x39c580[_0x34bc('0x6d')](_0x34bc('0x8d'));}}if(_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x8e')]){_0x2b46b8=_['isArray'](_0xf7c0be['query'][_0x34bc('0x8e')])?_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x8e')]:new Array(_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x8e')]);_0x2b46b8[_0x34bc('0x7a')](function(_0x46e789){_0x16ac8a['or'](_0x34bc('0x7b'),'%,'+_0x46e789+',%');});}if(_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x8f')]){var _0x498a83=_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x8f')][_0x34bc('0x90')]('\x5c','\x5c\x5c')[_0x34bc('0x90')](/'/g,'\x27\x27');if(qs[_0x34bc('0x91')](_0x498a83)){_0x320d86['or'](_0x34bc('0x92'),_0x498a83+'%');}else{_0x320d86['or'](_0x34bc('0x93'),qs[_0x34bc('0x74')](_0x498a83))['or'](_0x34bc('0x94'),_0x498a83+'%');}}}_0x39c580['where'](_0x320d86);_0x39c580[_0x34bc('0x95')]('i.id');var _0x5ba38f={'type':db[_0x34bc('0x96')]['QueryTypes']['SELECT'],'raw':!![]};var _0x4368f9=_0x39c580[_0x34bc('0x97')]();_0x4368f9['field'](_0x34bc('0x98'));_0x4368f9[_0x34bc('0x52')](_0x34bc('0x99'),_0x34bc('0x6b'));if(_0x1c6480['order']){_0x1c6480[_0x34bc('0x4d')][_0x34bc('0x7a')](function(_0x5e1b4d){var _0x4ea0d8=_0x5e1b4d[0x0]==='contactName'?_0x5e1b4d[0x0]:'i.'+_0x5e1b4d[0x0];_0x39c580[_0x34bc('0x4d')](_0x4ea0d8,_0x5e1b4d[0x1]===_0x34bc('0x9a')?![]:!![]);});}if(!_[_0x34bc('0x9b')](_0x2b46b8)){_0x39c580[_0x34bc('0x6d')](_0x16ac8a);_0x4368f9[_0x34bc('0x4f')](_0x34bc('0x9c'),_0x2b46b8);}BPromise[_0x34bc('0x9d')]()[_0x34bc('0x2a')](function(){if(!_0x47068c){if(_0xf7c0be[_0x34bc('0x46')]['ChatWebsiteId'])return;_0x4368f9[_0x34bc('0x4f')](_0x34bc('0x9e'));_0x39c580[_0x34bc('0x4f')](_0x34bc('0x9e'));return;}if(_0xf7c0be[_0x34bc('0x9f')][_0x34bc('0xa0')]!=='agent')return;return _0xf7c0be[_0x34bc('0x9f')][_0x34bc('0xa1')]({'attributes':['id'],'raw':!![]})[_0x34bc('0x2a')](function(_0x21cbfc){if(_[_0x34bc('0x9b')](_0x21cbfc)){_0x4368f9[_0x34bc('0x4f')](_0x34bc('0xa2'));_0x39c580[_0x34bc('0x4f')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x4368f9[_0x34bc('0x4f')](_0x34bc('0x83'),_[_0x34bc('0x33')](_0x21cbfc,'id'));_0x39c580['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x34bc('0x33')](_0x21cbfc,'id'));}});})[_0x34bc('0x2a')](function(){if(_0xf7c0be[_0x34bc('0x9f')][_0x34bc('0xa0')]==='agent'&&!_0x47068c&&!_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x82')])return[];return db[_0x34bc('0xa3')][_0x34bc('0x46')](_0x4368f9['toString'](),_0x5ba38f);})[_0x34bc('0x2a')](function(_0x29cd84){_0x26924c[_0x34bc('0xa4')]=_0x29cd84[_0x34bc('0x4a')];if(_0x26924c[_0x34bc('0xa4')]===0x0)return[];return db[_0x34bc('0xa3')]['query'](_0x52d4c7[_0x34bc('0xa5')](),_0x5ba38f)[_0x34bc('0x2a')](function(_0x4094e4){_0x5b6497=_[_0x34bc('0xa6')](_0x4094e4,'id');_0x5ba38f=_['merge'](_0x5ba38f,{'model':db[_0x34bc('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf7c0be[_0x34bc('0x46')][_0x34bc('0xa7')]){_0x1c6480['attributes'][_0x34bc('0x7a')](function(_0x257991){_0x39c580[_0x34bc('0x52')]('i.'+_0x257991);});}else{_0x39c580[_0x34bc('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x34bc('0x6b'));_0x39c580['field']('a.key',_0x34bc('0xa8'));_0x39c580['field'](_0x34bc('0xa9'),_0x34bc('0xaa'));_0x39c580[_0x34bc('0x52')](_0x34bc('0xab'),'contactName');_0x39c580[_0x34bc('0x52')]('i.*');_0x39c580[_0x34bc('0x52')](_0x34bc('0xac'),'Contact.firstName');_0x39c580[_0x34bc('0x52')](_0x34bc('0xad'),_0x34bc('0xae'));_0x39c580['field']('c.email','Contact.email');_0x39c580['field']('c.phone',_0x34bc('0xaf'));_0x39c580[_0x34bc('0x52')](_0x34bc('0xb0'),_0x34bc('0xb1'));_0x39c580['field'](_0x34bc('0xb2'),_0x34bc('0xb3'));_0x39c580[_0x34bc('0x52')](_0x34bc('0xb4'),_0x34bc('0xb5'));_0x39c580[_0x34bc('0x52')](_0x34bc('0xb6'),_0x34bc('0xb7'));_0x39c580[_0x34bc('0x52')](_0x34bc('0xb8'),_0x34bc('0x36'));}if(_0x1c6480[_0x34bc('0x26')])_0x39c580[_0x34bc('0x26')](_0x1c6480[_0x34bc('0x26')]);if(_0x1c6480[_0x34bc('0x25')])_0x39c580[_0x34bc('0x25')](_0x1c6480[_0x34bc('0x25')]);return db[_0x34bc('0xa3')]['query'](_0x39c580['toString'](),_0x5ba38f);})['then'](function(_0x653f3){if(_0x653f3[_0x34bc('0x4a')]>0x0)_0x3dabaa[_0x34bc('0x4f')](_0x34bc('0xb9'),_['map'](_0x653f3,'id'));return db[_0x34bc('0xa3')][_0x34bc('0x46')](_0x3dabaa[_0x34bc('0xa5')](),_0x5ba38f)[_0x34bc('0x2a')](function(_0x4ac316){var _0x3a2365=_['groupBy'](_0x4ac316,_0x34bc('0xba'));var _0x24f4f4=[];_0x653f3['forEach'](function(_0x3d8e3f){_0x24f4f4['push'](updateChatInteraction(_0x3d8e3f,_0x5b6497,_0x3a2365));});return BPromise[_0x34bc('0xbb')](_0x24f4f4);});});})[_0x34bc('0x2a')](function(_0x661409){_0x26924c[_0x34bc('0xbc')]=_0x661409;return _0x26924c;})['then'](respondWithFilteredResult(_0x1b42f5,_0x1c6480))[_0x34bc('0x1f')](handleError(_0x1b42f5,null));};exports[_0x34bc('0xbd')]=function(_0x17b018,_0x48a9d8){var _0x400402={'raw':![],'where':{'id':_0x17b018[_0x34bc('0xbe')]['id']}},_0xcebf49={};_0xcebf49[_0x34bc('0x45')]=_[_0x34bc('0x7f')](db[_0x34bc('0x42')][_0x34bc('0x43')]);_0xcebf49[_0x34bc('0x46')]=_[_0x34bc('0x7f')](_0x17b018[_0x34bc('0x46')]);_0xcebf49['filters']=_[_0x34bc('0x48')](_0xcebf49[_0x34bc('0x45')],_0xcebf49[_0x34bc('0x46')]);_0x400402[_0x34bc('0x49')]=_[_0x34bc('0x48')](_0xcebf49[_0x34bc('0x45')],qs[_0x34bc('0xa7')](_0x17b018[_0x34bc('0x46')][_0x34bc('0xa7')]));_0x400402[_0x34bc('0x49')]=_0x400402['attributes'][_0x34bc('0x4a')]?_0x400402[_0x34bc('0x49')]:_0xcebf49[_0x34bc('0x45')];if(_0x17b018[_0x34bc('0x46')][_0x34bc('0xbf')]){_0x400402[_0x34bc('0xc0')]=[{'all':!![]}];}_0x400402=_[_0x34bc('0x2f')]({},_0x400402,_0x17b018[_0x34bc('0xc1')]);return db[_0x34bc('0x42')][_0x34bc('0x6a')](_0x400402)[_0x34bc('0x2a')](handleEntityNotFound(_0x48a9d8,null))[_0x34bc('0x2a')](respondWithResult(_0x48a9d8,null))[_0x34bc('0x1f')](handleError(_0x48a9d8,null));};exports[_0x34bc('0xc2')]=function(_0x4e0f61,_0x19c29b){return db[_0x34bc('0x42')][_0x34bc('0xc2')](_0x4e0f61['body'],{})['then'](respondWithResult(_0x19c29b,0xc9))['catch'](handleError(_0x19c29b,null));};exports[_0x34bc('0x29')]=function(_0x5c1440,_0x1bda2f){if(_0x5c1440[_0x34bc('0x30')]['id']){delete _0x5c1440['body']['id'];}return db['ChatInteraction'][_0x34bc('0x6a')]({'where':{'id':_0x5c1440[_0x34bc('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1bda2f,null))[_0x34bc('0x2a')](saveUpdates(_0x5c1440['body'],null))[_0x34bc('0x2a')](respondWithResult(_0x1bda2f,null))[_0x34bc('0x1f')](handleError(_0x1bda2f,null));};exports[_0x34bc('0x2b')]=function(_0x1a81ad,_0x5debcf){return db[_0x34bc('0x42')][_0x34bc('0x6a')]({'where':{'id':_0x1a81ad[_0x34bc('0xbe')]['id']}})[_0x34bc('0x2a')](handleEntityNotFound(_0x5debcf,null))[_0x34bc('0x2a')](removeEntity(_0x5debcf,null))[_0x34bc('0x1f')](handleError(_0x5debcf,null));};exports[_0x34bc('0xc3')]=function(_0x52b208,_0x55be12){return db[_0x34bc('0x42')][_0x34bc('0xc3')]()[_0x34bc('0x2a')](respondWithResult(_0x55be12,null))['catch'](handleError(_0x55be12,null));};exports[_0x34bc('0xc4')]=function(_0x26c7b9,_0x23a24d){var _0xf9d80e=_0x26c7b9['params']['id'];var _0x402476;var _0x4252f6;var _0x4035ce;return db[_0x34bc('0x42')][_0x34bc('0xc5')]({'where':{'id':_0xf9d80e}})[_0x34bc('0x2a')](function(_0x1df2b5){_0x402476=_0x1df2b5;return db[_0x34bc('0xc6')][_0x34bc('0xc5')]({'where':{'id':_0x1df2b5[_0x34bc('0x82')]},'attributes':['id',_0x34bc('0xc7'),_0x34bc('0xc8'),_0x34bc('0xc9'),_0x34bc('0xca'),'vidaooMetadata'],'raw':!![]});})[_0x34bc('0x2a')](function(_0x43baf3){if(_0x43baf3&&_0x43baf3['vidaooApiKey']&&_0x43baf3[_0x34bc('0xc8')]){_0x4252f6=_0x43baf3;var _0xf2127c={'interaction':{'id':_0xf9d80e},'agent':{'id':_0x26c7b9[_0x34bc('0x9f')]['id'],'name':_0x26c7b9[_0x34bc('0x9f')][_0x34bc('0x2d')],'fullname':_0x26c7b9[_0x34bc('0x9f')]['fullname'],'email':_0x26c7b9[_0x34bc('0x9f')]['email']},'contact':_0x26c7b9[_0x34bc('0x30')]['contact'],'account':_0x26c7b9[_0x34bc('0x30')][_0x34bc('0xcb')]};var _0x5bc02a={'rejectUnauthorized':![],'method':_0x34bc('0xcc'),'url':_0x34bc('0xcd'),'headers':{'X-APIKEY':_0x43baf3[_0x34bc('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x26c7b9['user'][_0x34bc('0xce')]],'buttons':null,'topic':_0x4252f6[_0x34bc('0xc9')],'note':_[_0x34bc('0xcf')](_0x4252f6[_0x34bc('0xca')])?null:getMustacheRender(_0x4252f6[_0x34bc('0xca')],_0xf2127c),'metadata':null},'redirect':_0x34bc('0xd0'),'json':!![]};try{if(!_['isNull'](_0x4252f6[_0x34bc('0xd1')])){var _0x2eacb1=getMustacheRender(_0x4252f6['vidaooMetadata'],_0xf2127c);var _0x53604d=JSON[_0x34bc('0xd2')](_0x2eacb1);_0x5bc02a['body'][_0x34bc('0xd3')]=_0x53604d;}}catch(_0x2fc389){throw new db[(_0x34bc('0x96'))]['ValidationError'](_0x34bc('0xd4'));}return rp(_0x5bc02a);}else{throw new db['Sequelize']['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x34bc('0x2a')](function(_0x48d8c4){_0x4035ce=_0x48d8c4;if(_0x4035ce['id']){var _0x3afd00={'body':_0x4035ce['join_url'],'ChatWebsiteId':_0x4252f6['id'],'ChatInteractionId':_0x402476['id'],'direction':'out','UserId':_0x26c7b9[_0x34bc('0x9f')]['id']};return db['ChatMessage']['create'](_0x3afd00,{});}else{throw new db[(_0x34bc('0x96'))]['ValidationError'](_0x34bc('0xd5'));}})[_0x34bc('0x2a')](function(){return _0x402476[_0x34bc('0xd6')]({'vidaooSessionId':_0x4035ce['id']});})[_0x34bc('0x2a')](respondWithResult(_0x23a24d,null))['catch'](handleError(_0x23a24d,null));};exports[_0x34bc('0xd7')]=function(_0x4054b4,_0x22ac51){if(_0x4054b4[_0x34bc('0x30')]['id']){delete _0x4054b4['body']['id'];}return db[_0x34bc('0x42')][_0x34bc('0x6a')]({'where':{'id':_0x4054b4[_0x34bc('0xbe')]['id']},'include':[{'model':db[_0x34bc('0xd8')],'as':_0x34bc('0x6f')}]})[_0x34bc('0x2a')](handleEntityNotFound(_0x22ac51,null))[_0x34bc('0x2a')](saveUpdates(_0x4054b4[_0x34bc('0x30')],null))[_0x34bc('0x2a')](respondWithResult(_0x22ac51,null))[_0x34bc('0x1f')](handleError(_0x22ac51,null));};exports[_0x34bc('0xd9')]=function(_0x596197,_0x4c7317){if(_0x596197['body']['id']){delete _0x596197[_0x34bc('0x30')]['id'];}return db[_0x34bc('0x42')]['find']({'where':{'id':_0x596197[_0x34bc('0xbe')]['id']}})[_0x34bc('0x2a')](function(_0x4fc697){if(!_0x4fc697){logger['error'](_0x34bc('0xda'),_0x34bc('0xd9'),0x194,'entity\x20not\x20found');_0x4c7317['sendStatus'](0x194);}else{if(_0x4fc697[_0x34bc('0x3e')]){throw new db[(_0x34bc('0x96'))][(_0x34bc('0xdb'))]('Interaction\x20already\x20assigned');}}return _0x4fc697;})['then'](function(_0x4f30e3){if(_0x4f30e3){return _0x4f30e3[_0x34bc('0x29')]({'closed':_0x596197['body'][_0x34bc('0x3d')],'disposition':_0x596197['body']['disposition']})[_0x34bc('0x2a')](function(_0x2186b1){return _0x2186b1;});}})[_0x34bc('0x2a')](function(){return respondWithRpcPromise(_0x34bc('0xdc'),_0x34bc('0xd9'),_0x596197[_0x34bc('0x30')],client9004);})[_0x34bc('0x2a')](respondWithResult(_0x4c7317,null))[_0x34bc('0x1f')](handleError(_0x4c7317,null));};exports[_0x34bc('0xdd')]=function(_0x248b3e,_0x37451f){_0x248b3e['body'][_0x34bc('0x2d')]=_0x248b3e[_0x34bc('0xde')][_0x34bc('0xdf')];_0x248b3e[_0x34bc('0x30')][_0x34bc('0xe0')]=_0x248b3e['file'][_0x34bc('0xe1')];_0x248b3e['body'][_0x34bc('0x7e')]=_0x248b3e['file']['mimetype'];return db[_0x34bc('0xe2')][_0x34bc('0xc2')](_0x248b3e[_0x34bc('0x30')])[_0x34bc('0x2a')](respondWithResult(_0x37451f,0xc9))[_0x34bc('0x1f')](handleError(_0x37451f,null));};exports['attachmentDownload']=function(_0x4a85fc,_0x1e41fa){return db[_0x34bc('0x42')][_0x34bc('0xc5')]({'where':{'id':_0x4a85fc[_0x34bc('0xbe')]['id']},'raw':!![]})[_0x34bc('0x2a')](handleEntityNotFound(_0x1e41fa,null))[_0x34bc('0x2a')](function(_0x17ae0e){if(_0x17ae0e){if(_0x17ae0e['closed']){return _0x1e41fa['status'](0x193)[_0x34bc('0x23')]({'status':0x193,'message':_0x34bc('0xe3')});}return db['Attachment'][_0x34bc('0xc5')]({'where':{'id':_0x4a85fc[_0x34bc('0x46')][_0x34bc('0xe4')]},'raw':!![]})[_0x34bc('0x2a')](handleEntityNotFound(_0x1e41fa,null));}})['then'](function(_0x3b45e8){if(_0x3b45e8){var _0xc20c96=_0x3b45e8[_0x34bc('0xe5')]!==null;var _0x2d5a65=path[_0x34bc('0xe6')](config[_0x34bc('0xe7')],'server/files/attachments/');if(_0xc20c96){_0x2d5a65=path[_0x34bc('0xe6')](_0x2d5a65,_0x34bc('0xe8'));}var _0x1fc4cc=path['join'](_0x2d5a65,_0x3b45e8[_0x34bc('0xe0')]);return _0x1e41fa[_0x34bc('0xe9')](_0x1fc4cc);}})[_0x34bc('0x1f')](handleError(_0x1e41fa,null));};exports[_0x34bc('0xea')]=function(_0x12dc1c,_0x1db257){var _0x286b11=null;var _0x2a4683=null;var _0x4e93ba=null;if(_0x12dc1c[_0x34bc('0x30')]['id']){delete _0x12dc1c[_0x34bc('0x30')]['id'];}if(_0x12dc1c[_0x34bc('0x30')]['mailTranscript']){_0x4e93ba=path[_0x34bc('0xe6')](config['root'],'server/files/chat/upload/',util['format'](_0x34bc('0xeb'),Date['now']()));_0x12dc1c['body']['pathTranscript']=_0x4e93ba;}return db['ChatInteraction'][_0x34bc('0x6a')]({'where':{'id':_0x12dc1c[_0x34bc('0xbe')]['id']},'include':[{'model':db[_0x34bc('0xec')],'as':_0x34bc('0xed'),'include':[{'model':db[_0x34bc('0x7d')],'as':_0x34bc('0x7d')}]}]})[_0x34bc('0x2a')](handleEntityNotFound(_0x1db257,null))[_0x34bc('0x2a')](saveUpdates(_0x12dc1c[_0x34bc('0x30')],null))['then'](function(_0x4e8810){if(_0x4e8810){_0x286b11=_0x4e8810;return db[_0x34bc('0xc6')][_0x34bc('0x6a')]({'where':{'id':_0x286b11[_0x34bc('0x82')]}});}})[_0x34bc('0x2a')](function(_0x3f67dc){if(_0x3f67dc){_0x2a4683=_0x3f67dc;return db[_0x34bc('0xd8')][_0x34bc('0x6a')]({'where':{'id':_0x286b11[_0x34bc('0x76')]}});}})['then'](function(_0x4626a5){if(_0x4626a5){if(_0x4e93ba){var _0x5ae468=null;for(var _0x547709=0x1;_0x547709<_0x286b11[_0x34bc('0xed')]['length'];++_0x547709){_0x5ae468=_0x286b11[_0x34bc('0xed')][_0x547709];var _0x5b9a25=_0x5ae468['UserId']?util[_0x34bc('0xee')]('%s%d',_0x2a4683[_0x34bc('0xef')],_0x5ae468[_0x34bc('0x3e')]):'System';var _0x1b2e09=_0x12dc1c[_0x34bc('0x30')][_0x34bc('0xf0')]||util[_0x34bc('0xee')](_0x34bc('0xf1'),_0x34bc('0xf2'),_0x5ae468[_0x34bc('0x76')]);switch(_0x2a4683[_0x34bc('0xf3')]){case _0x34bc('0xf4'):_0x5b9a25=_0x5ae468[_0x34bc('0x3e')]?util[_0x34bc('0xee')](_0x34bc('0xf1'),_0x2a4683[_0x34bc('0xef')],_0x5ae468['UserId']):_0x34bc('0xf5');break;case _0x34bc('0xf6'):_0x5b9a25=_0x5ae468[_0x34bc('0x3e')]?_0x5ae468[_0x34bc('0x7d')][_0x34bc('0xf7')]||_0x5ae468[_0x34bc('0x7d')][_0x34bc('0x34')]:'System';break;case _0x34bc('0xf8'):_0x5b9a25=_0x5ae468[_0x34bc('0x3e')]?_0x5ae468[_0x34bc('0x7d')][_0x34bc('0x34')]:_0x34bc('0xf5');break;default:_0x5b9a25=_0x5ae468[_0x34bc('0x3e')]?util['format']('%s%d',_0x2a4683[_0x34bc('0xef')],_0x5ae468[_0x34bc('0x3e')]):'System';}var _0x17a7c4=util['format'](_0x34bc('0xf9'),moment(_0x5ae468['createdAt'])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x5ae468[_0x34bc('0xfa')]==='in'?_0x1b2e09:_0x5b9a25,_0x5ae468[_0x34bc('0x30')]);if(!_0x5ae468[_0x34bc('0xfb')]){fs[_0x34bc('0xfc')](_0x4e93ba,_0x17a7c4);}}return db[_0x34bc('0xfd')][_0x34bc('0xc5')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x34bc('0xfe'),'raw':!![],'include':[{'model':db[_0x34bc('0xff')],'as':_0x34bc('0xff'),'raw':!![]}]}]});}}})[_0x34bc('0x2a')](function(_0x1b5b81){if(!_0x1b5b81||!_0x1b5b81[_0x34bc('0xfe')]||!_0x12dc1c['body'])return _0x286b11;var _0x3622c2=_0x1b5b81[_0x34bc('0x100')]();return respondWithRpcPromise(_0x34bc('0x101'),_0x34bc('0x102'),{'account':_0x3622c2,'message':{'from':util[_0x34bc('0xee')](_0x34bc('0x103'),_0x1b5b81[_0x34bc('0x2d')],_0x1b5b81[_0x34bc('0xce')]||_0x1b5b81[_0x34bc('0xfe')][_0x34bc('0x9f')]),'to':_0x12dc1c['body']['mailTranscript'],'subject':_0x34bc('0x104'),'text':util[_0x34bc('0xee')](_0x34bc('0x105'),_0x12dc1c['body'][_0x34bc('0x106')]),'attachments':[{'path':_0x4e93ba}]}})['then'](function(){return _0x286b11;})[_0x34bc('0x1f')](function(_0x2543f9){logger[_0x34bc('0x1b')](_0x2543f9);});})[_0x34bc('0x2a')](respondWithStatusCode(_0x1db257,0xc8))['catch'](handleError(_0x1db257,null));};exports[_0x34bc('0x107')]=function(_0x526111,_0x3cc362){return db[_0x34bc('0xec')]['find']({'where':{'id':_0x526111[_0x34bc('0xbe')]['id']}})[_0x34bc('0x2a')](handleEntityNotFound(_0x3cc362,null))['then'](function(_0x4dab7c){if(_0x4dab7c){return _0x4dab7c[_0x34bc('0x107')](_0x526111[_0x34bc('0x30')]['ids'],_['omit'](_0x526111[_0x34bc('0x30')],[_0x34bc('0x108'),'id'])||{});}})[_0x34bc('0x2a')](respondWithResult(_0x3cc362,null))['catch'](handleError(_0x3cc362,null));};exports[_0x34bc('0x109')]=function(_0x40b723,_0x5b99fe){var _0x1deb67={'raw':![],'where':{}};var _0x4c2aed={};var _0xb2ed0c={'count':0x0,'rows':[]};return db[_0x34bc('0x42')][_0x34bc('0xc5')]({'where':{'id':_0x40b723[_0x34bc('0xbe')]['id']}})[_0x34bc('0x2a')](handleEntityNotFound(_0x5b99fe,null))[_0x34bc('0x2a')](function(_0x55d529){if(_0x55d529){_0x4c2aed['model']=_[_0x34bc('0x7f')](db['ChatMessage'][_0x34bc('0x43')]);_0x4c2aed[_0x34bc('0x46')]=_['keys'](_0x40b723[_0x34bc('0x46')]);_0x4c2aed[_0x34bc('0x47')]=_[_0x34bc('0x48')](_0x4c2aed[_0x34bc('0x45')],_0x4c2aed[_0x34bc('0x46')]);_0x1deb67['attributes']=_[_0x34bc('0x48')](_0x4c2aed[_0x34bc('0x45')],qs[_0x34bc('0xa7')](_0x40b723[_0x34bc('0x46')][_0x34bc('0xa7')]));_0x1deb67[_0x34bc('0x49')]=_0x1deb67[_0x34bc('0x49')]['length']?_0x1deb67[_0x34bc('0x49')]:_0x4c2aed[_0x34bc('0x45')];if(!_0x40b723[_0x34bc('0x46')][_0x34bc('0x4b')](_0x34bc('0x4c'))){_0x1deb67[_0x34bc('0x26')]=qs['limit'](_0x40b723[_0x34bc('0x46')][_0x34bc('0x26')]);_0x1deb67[_0x34bc('0x25')]=qs[_0x34bc('0x25')](_0x40b723[_0x34bc('0x46')][_0x34bc('0x25')]);}_0x1deb67['order']=qs[_0x34bc('0x4e')](_0x40b723[_0x34bc('0x46')][_0x34bc('0x4e')]);_0x1deb67[_0x34bc('0x4f')]=qs[_0x34bc('0x47')](_[_0x34bc('0x50')](_0x40b723[_0x34bc('0x46')],_0x4c2aed['filters']));_0x1deb67['where'][_0x34bc('0xba')]=_0x55d529['id'];if(_0x40b723[_0x34bc('0x46')][_0x34bc('0x8f')]){_0x1deb67[_0x34bc('0x4f')]=_[_0x34bc('0x2f')](_0x1deb67[_0x34bc('0x4f')],{'$or':_['map'](_0x1deb67[_0x34bc('0x49')],function(_0x10b53a){var _0x5d6d9e={};_0x5d6d9e[_0x10b53a]={'$like':'%'+_0x40b723[_0x34bc('0x46')][_0x34bc('0x8f')]+'%'};return _0x5d6d9e;})});}if(_0x40b723['query']['$gte']){var _0x3bc686=_0x40b723[_0x34bc('0x46')][_0x34bc('0x86')][_0x34bc('0x37')](',');var _0x329589={};_0x329589[_0x3bc686[0x0]]={'$gte':moment(_0x3bc686[0x1])[_0x34bc('0xee')](_0x34bc('0x10a'))};_0x1deb67[_0x34bc('0x4f')]=_[_0x34bc('0x2f')](_0x1deb67[_0x34bc('0x4f')],_0x329589);}_0x1deb67=_[_0x34bc('0x2f')]({},_0x1deb67,_0x40b723['options']);return db[_0x34bc('0xec')][_0x34bc('0xa4')]({'where':_0x1deb67[_0x34bc('0x4f')]})[_0x34bc('0x2a')](function(_0x80b623){_0xb2ed0c[_0x34bc('0xa4')]=_0x80b623;if(_0x40b723['query'][_0x34bc('0xbf')]){_0x1deb67['include']=[{'all':!![]}];}return db[_0x34bc('0xec')]['findAll'](_0x1deb67);})['then'](function(_0x2ddc87){_0xb2ed0c[_0x34bc('0xbc')]=_0x2ddc87;return _0xb2ed0c;});}})[_0x34bc('0x2a')](respondWithFilteredResult(_0x5b99fe,_0x1deb67))['catch'](handleError(_0x5b99fe,null));};exports[_0x34bc('0x10b')]=function(_0x4cdb0f,_0xd514e6){var _0x4c5ec0={'where':{}},_0x1df1f6={},_0x24e563={'count':0x0,'rows':[]};return db[_0x34bc('0x42')]['findOne']({'where':{'id':_0x4cdb0f['params']['id']}})[_0x34bc('0x2a')](handleEntityNotFound(_0xd514e6,null))['then'](function(_0x5c8fff){if(_0x5c8fff){_0x1df1f6[_0x34bc('0x45')]=_[_0x34bc('0x7f')](db[_0x34bc('0xec')][_0x34bc('0x43')]);_0x1df1f6[_0x34bc('0x46')]=_[_0x34bc('0x7f')](_0x4cdb0f[_0x34bc('0x46')]);_0x1df1f6['filters']=_['intersection'](_0x1df1f6[_0x34bc('0x45')],_0x1df1f6[_0x34bc('0x46')]);_0x4c5ec0['attributes']=_[_0x34bc('0x48')](_0x1df1f6['model'],qs[_0x34bc('0xa7')](_0x4cdb0f[_0x34bc('0x46')][_0x34bc('0xa7')]));_0x4c5ec0[_0x34bc('0x49')]=_0x4c5ec0[_0x34bc('0x49')][_0x34bc('0x4a')]?_0x4c5ec0['attributes']:_0x1df1f6['model'];if(!_0x4cdb0f[_0x34bc('0x46')][_0x34bc('0x4b')](_0x34bc('0x4c'))){_0x4c5ec0['limit']=qs['limit'](_0x4cdb0f[_0x34bc('0x46')]['limit']);_0x4c5ec0['offset']=qs[_0x34bc('0x25')](_0x4cdb0f[_0x34bc('0x46')][_0x34bc('0x25')]);}_0x4c5ec0[_0x34bc('0x4d')]=qs[_0x34bc('0x4e')](_0x4cdb0f[_0x34bc('0x46')][_0x34bc('0x4e')]);_0x4c5ec0['where']=qs[_0x34bc('0x47')](_['pick'](_0x4cdb0f[_0x34bc('0x46')],_0x1df1f6[_0x34bc('0x47')]));_0x4c5ec0['where'][_0x34bc('0xba')]=_0x5c8fff['id'];if(_0x4cdb0f['query'][_0x34bc('0x8f')]){_0x4c5ec0['where']=_['merge'](_0x4c5ec0[_0x34bc('0x4f')],{'$or':_[_0x34bc('0x33')](_0x4c5ec0['attributes'],function(_0x5158bf){var _0x2dce96={};_0x2dce96[_0x5158bf]={'$like':'%'+_0x4cdb0f['query']['filter']+'%'};return _0x2dce96;})});}_0x4c5ec0[_0x34bc('0x4f')][_0x34bc('0xfb')]=![];if(_0x4cdb0f[_0x34bc('0x46')]['id']){_0x4c5ec0['where']['id']={'$gt':_0x4cdb0f[_0x34bc('0x46')]['id']};}_0x4c5ec0=_[_0x34bc('0x2f')]({},_0x4c5ec0,_0x4cdb0f['options']);return db[_0x34bc('0xec')][_0x34bc('0xa4')]({'where':_0x4c5ec0['where']})[_0x34bc('0x2a')](function(_0x4d7373){_0x24e563[_0x34bc('0xa4')]=_0x4d7373;_0x4c5ec0[_0x34bc('0xc0')]=[];if(_0x4cdb0f['query']['includeAgent']){_0x4c5ec0[_0x34bc('0xc0')]['push']({'model':db[_0x34bc('0x7d')],'as':_0x34bc('0x7d'),'attributes':['id','fullname',_0x34bc('0xf7')]});}if(_0x4cdb0f[_0x34bc('0x46')][_0x34bc('0xbf')]){_0x4c5ec0['include']=[{'all':!![]}];}return db[_0x34bc('0xec')][_0x34bc('0x10c')](_0x4c5ec0);})[_0x34bc('0x2a')](function(_0x2fe410){_0x24e563[_0x34bc('0xbc')]=_0x2fe410;return _0x24e563;});}})[_0x34bc('0x2a')](respondWithFilteredResult(_0xd514e6,_0x4c5ec0))[_0x34bc('0x1f')](handleError(_0xd514e6,null));};exports[_0x34bc('0x10d')]=function(_0xe7cb34,_0x4ee3de){return db[_0x34bc('0x42')][_0x34bc('0x6a')]({'where':{'id':_0xe7cb34[_0x34bc('0xbe')]['id']}})[_0x34bc('0x2a')](handleEntityNotFound(_0x4ee3de,null))[_0x34bc('0x2a')](function(_0x2d2b36){if(_0x2d2b36){return _0x2d2b36[_0x34bc('0x10e')](_0xe7cb34[_0x34bc('0x30')][_0x34bc('0x108')],_[_0x34bc('0x10f')](_0xe7cb34['body'],['ids','id'])||{})['spread'](function(){return db[_0x34bc('0x110')][_0x34bc('0x10c')]({'attributes':['id',_0x34bc('0x2d'),_0x34bc('0x111')],'where':{'id':_0xe7cb34[_0x34bc('0x30')][_0x34bc('0x108')]}});})[_0x34bc('0x2a')](function(_0x332229){socket[_0x34bc('0x112')]('chatInteractionTags:save',{'id':Number(_0xe7cb34[_0x34bc('0xbe')]['id']),'tags':_0x332229||[]});return{'id':Number(_0xe7cb34[_0x34bc('0xbe')]['id']),'tags':_0x332229||[]};});}})[_0x34bc('0x2a')](respondWithResult(_0x4ee3de,null))[_0x34bc('0x1f')](handleError(_0x4ee3de,null));};exports['removeTags']=function(_0x583111,_0x2aae4c){return db[_0x34bc('0x42')][_0x34bc('0x6a')]({'where':{'id':_0x583111[_0x34bc('0xbe')]['id']}})[_0x34bc('0x2a')](handleEntityNotFound(_0x2aae4c,null))[_0x34bc('0x2a')](function(_0x586528){if(_0x586528){return _0x586528[_0x34bc('0x113')](_0x583111['query'][_0x34bc('0x108')]);}})[_0x34bc('0x2a')](respondWithStatusCode(_0x2aae4c,null))[_0x34bc('0x1f')](handleError(_0x2aae4c,null));};exports['download']=function(_0x15905c,_0x117e5f){var _0x445029=moment()[_0x34bc('0x114')]()[_0x34bc('0xa5')]();var _0x483dbd=path[_0x34bc('0xe6')](config[_0x34bc('0xe7')],_0x34bc('0x115'),_0x34bc('0x116'),_0x34bc('0x117'));var _0x14e049=path[_0x34bc('0xe6')](config[_0x34bc('0xe7')],_0x34bc('0x115'),_0x34bc('0x116'),'attachments');var _0x43f1db=path[_0x34bc('0xe6')](_0x483dbd,_0x445029);var _0x5c012b=util[_0x34bc('0xee')](_0x34bc('0x118'),_0x15905c[_0x34bc('0xbe')]['id'],_0x445029);var _0x2a9205=path[_0x34bc('0xe6')](_0x483dbd,_0x5c012b);var _0x5e8ae=[];_0x5e8ae[_0x34bc('0x38')]({'model':db['User'],'as':_0x34bc('0x7d'),'attributes':['id',_0x34bc('0x34')],'raw':!![]});_0x5e8ae[_0x34bc('0x38')]({'model':db[_0x34bc('0xd8')],'as':_0x34bc('0x6f'),'attributes':['id',_0x34bc('0x119'),_0x34bc('0x11a')],'raw':!![]});if(_0x15905c[_0x34bc('0x46')]['attachments']){_0x5e8ae[_0x34bc('0x38')]({'model':db[_0x34bc('0xe2')],'as':_0x34bc('0xe2'),'raw':!![]});}var _0x15a2ae=[{'model':db[_0x34bc('0xec')],'as':'Messages','attributes':['id',_0x34bc('0x30'),_0x34bc('0x85'),_0x34bc('0xfa'),_0x34bc('0xfb'),'read'],'include':_0x5e8ae}];_0x15a2ae[_0x34bc('0x38')]({'model':db[_0x34bc('0xc6')],'as':_0x34bc('0x11b'),'attributes':['id',_0x34bc('0x2d')]});_0x15a2ae[_0x34bc('0x38')]({'model':db[_0x34bc('0x7d')],'as':'Owner','attributes':['id','fullname']});return db[_0x34bc('0x42')][_0x34bc('0x6a')]({'where':{'id':_0x15905c[_0x34bc('0xbe')]['id']},'include':_0x15a2ae})[_0x34bc('0x2a')](handleEntityNotFound(_0x117e5f,null))['then'](function(_0x86bfb0){if(_0x86bfb0){var _0x2d5e16=_0x86bfb0[_0x34bc('0x11c')]({'plain':!![]});fs[_0x34bc('0x11d')](_0x43f1db);var _0x4d01bf={'channel':'Chat','account':_0x2d5e16[_0x34bc('0x11b')][_0x34bc('0x2d')],'agent':_0x2d5e16[_0x34bc('0x11e')]?_0x2d5e16[_0x34bc('0x11e')]['fullname']:_0x34bc('0x11f'),'createdAt':moment(_0x2d5e16['createdAt'])[_0x34bc('0xee')](_0x34bc('0x10a'))[_0x34bc('0xa5')](),'closedAt':_0x2d5e16['closed']?moment(_0x2d5e16[_0x34bc('0x120')])[_0x34bc('0xee')](_0x34bc('0x10a'))[_0x34bc('0xa5')]():'','disposition':_0x2d5e16[_0x34bc('0x40')],'chatInfo':{'browser':_0x2d5e16[_0x34bc('0x121')],'os':_0x2d5e16[_0x34bc('0x122')],'referer':_0x2d5e16['referer'],'customerIp':_0x2d5e16['customerIp'],'customerPort':_0x2d5e16[_0x34bc('0x123')]?_0x2d5e16[_0x34bc('0x123')]:_0x34bc('0x11f')},'messages':_(_0x2d5e16[_0x34bc('0xed')])['tail']()[_0x34bc('0x8f')]({'secret':![]})[_0x34bc('0x33')](function(_0x2b7927){if(_0x2b7927[_0x34bc('0xe2')]){var _0x3222c0=path[_0x34bc('0xe6')](_0x14e049,_0x2b7927['Attachment'][_0x34bc('0xe0')]);if(fs[_0x34bc('0x124')](_0x3222c0)){fs[_0x34bc('0x125')](_0x3222c0)[_0x34bc('0x126')](fs[_0x34bc('0x127')](path[_0x34bc('0xe6')](_0x43f1db,_0x2b7927[_0x34bc('0xe2')][_0x34bc('0xe0')])));}}return{'date':moment(_0x2b7927[_0x34bc('0x85')])[_0x34bc('0xee')](_0x34bc('0x10a'))[_0x34bc('0xa5')](),'sender':_0x2b7927[_0x34bc('0xfa')]===_0x34bc('0x128')?_0x2b7927[_0x34bc('0x7d')]?_0x2b7927[_0x34bc('0x7d')][_0x34bc('0x34')]:'System':_0x2b7927[_0x34bc('0x6f')][_0x34bc('0x119')]+(_0x2b7927['Contact'][_0x34bc('0x11a')]?'\x20'+_0x2b7927[_0x34bc('0x6f')][_0x34bc('0x11a')]:''),'body':_0x2b7927[_0x34bc('0xe2')]?_0x2b7927[_0x34bc('0xe2')]['basename']:_0x2b7927[_0x34bc('0x30')],'direction':_0x2b7927[_0x34bc('0xfa')]===_0x34bc('0x128')?'A':'C','secret':_0x2b7927[_0x34bc('0xfb')],'read':_0x2b7927[_0x34bc('0x8b')],'attachment':_0x2b7927[_0x34bc('0xe2')]};})[_0x34bc('0x72')]()};return ejs['renderFile'](path[_0x34bc('0xe6')](config[_0x34bc('0xe7')],_0x34bc('0x115'),_0x34bc('0x129'),_0x34bc('0x12a')),{'interaction':_0x4d01bf})['then'](function(_0x4427bd){var _0x33bc51=path[_0x34bc('0xe6')](_0x43f1db,'transcript-'+_0x2d5e16['id']+'-'+_0x445029+_0x34bc('0x12b'));var _0x5f0236={'path':_0x33bc51,'channel':_0x34bc('0x12c'),'interactionId':_0x2d5e16['id']};return pdf['createPdfFromHTML'](_0x4427bd,_0x5f0236);})[_0x34bc('0x2a')](function(){return new Promise(function(_0x9d5061,_0x472306){zipdir(_0x43f1db,{'saveTo':_0x2a9205},function(_0x233a70,_0x44c796){if(_0x233a70)return _0x472306(_0x233a70);return _0x9d5061(_0x44c796);});})[_0x34bc('0x2a')](function(){return new BPromise(function(_0x21c965,_0x2e8fb6){rimraf(_0x43f1db,function(_0x352b09){if(_0x352b09)_0x2e8fb6(_0x352b09);return _0x21c965();});});})['then'](function(){return _0x117e5f[_0x34bc('0xe9')](_0x2a9205,_0x5c012b,function(_0x186e8b){if(_0x186e8b){logger[_0x34bc('0x1b')](_0x34bc('0x12d'),_0x186e8b);}else{fs[_0x34bc('0x12e')](_0x2a9205);}});});});}else{return _0x117e5f[_0x34bc('0x20')](0xc8);}})[_0x34bc('0x1f')](handleError(_0x117e5f,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index be57f97..5860108 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 _0xb0da=['hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x56dc1f,_0x17f87f){var _0x30f9b9=function(_0x158ff5){while(--_0x158ff5){_0x56dc1f['push'](_0x56dc1f['shift']());}};_0x30f9b9(++_0x17f87f);}(_0xb0da,0x8e));var _0xab0d=function(_0x1532fb,_0x2e6b6f){_0x1532fb=_0x1532fb-0x0;var _0x379876=_0xb0da[_0x1532fb];return _0x379876;};'use strict';var EventEmitter=require(_0xab0d('0x0'));var ChatInteraction=require(_0xab0d('0x1'))['db'][_0xab0d('0x2')];var ChatMessage=require(_0xab0d('0x1'))['db'][_0xab0d('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xab0d('0x4')](0x0);var events={'afterCreate':_0xab0d('0x5'),'afterUpdate':_0xab0d('0x6'),'afterDestroy':_0xab0d('0x7')};function emitEvent(_0x4f6b6b){return function(_0x1e7c2b,_0x4330f6,_0x2d7100){_0x1e7c2b[_0xab0d('0x8')]({'attributes':['id'],'raw':!![]})[_0xab0d('0x9')](function(_0x136123){_0x1e7c2b[_0xab0d('0xa')](_0xab0d('0xb'),_0x136123['map'](function(_0x58cc82){return{'id':_0x58cc82['id']};}));return ChatMessage[_0xab0d('0xc')]({'where':{'ChatInteractionId':_0x1e7c2b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xab0d('0x9')](function(_0x42e687){_0x1e7c2b[_0xab0d('0xa')](_0xab0d('0xd'),_0x42e687[_0xab0d('0xe')]);ChatInteractionEvents[_0xab0d('0xf')](_0x4f6b6b+':'+_0x1e7c2b['id'],_0x1e7c2b);ChatInteractionEvents[_0xab0d('0xf')](_0x4f6b6b,_0x1e7c2b);_0x2d7100(null);})[_0xab0d('0x10')](_0x2d7100(null));};}for(var e in events){if(events[_0xab0d('0x11')](e)){var event=events[e];ChatInteraction[_0xab0d('0x12')](e,emitEvent(event));}}module[_0xab0d('0x13')]=ChatInteractionEvents; \ No newline at end of file +var _0xf538=['catch','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf538,0xd4));var _0x8f53=function(_0x273af3,_0x5d11c8){_0x273af3=_0x273af3-0x0;var _0x475ccc=_0xf538[_0x273af3];return _0x475ccc;};'use strict';var EventEmitter=require(_0x8f53('0x0'));var ChatInteraction=require(_0x8f53('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x8f53('0x1'))['db'][_0x8f53('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8f53('0x3')](0x0);var events={'afterCreate':_0x8f53('0x4'),'afterUpdate':_0x8f53('0x5'),'afterDestroy':_0x8f53('0x6')};function emitEvent(_0xa9ad45){return function(_0x2c3396,_0x2a6f2b,_0x320ba5){_0x2c3396[_0x8f53('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x584183){_0x2c3396[_0x8f53('0x8')](_0x8f53('0x9'),_0x584183[_0x8f53('0xa')](function(_0x2c08a7){return{'id':_0x2c08a7['id']};}));return ChatMessage[_0x8f53('0xb')]({'where':{'ChatInteractionId':_0x2c3396['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8f53('0xc')](function(_0xf1329d){_0x2c3396[_0x8f53('0x8')](_0x8f53('0xd'),_0xf1329d[_0x8f53('0xe')]);ChatInteractionEvents['emit'](_0xa9ad45+':'+_0x2c3396['id'],_0x2c3396);ChatInteractionEvents[_0x8f53('0xf')](_0xa9ad45,_0x2c3396);_0x320ba5(null);})[_0x8f53('0x10')](_0x320ba5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x8f53('0x11')](e,emitEvent(event));}}module[_0x8f53('0x12')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index da9c92b..0f6a902 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 _0x56d7=['rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x30a6ce,_0x2f3243){var _0x59fedc=function(_0x48627a){while(--_0x48627a){_0x30a6ce['push'](_0x30a6ce['shift']());}};_0x59fedc(++_0x2f3243);}(_0x56d7,0x7f));var _0x756d=function(_0x425541,_0x5dec0e){_0x425541=_0x425541-0x0;var _0x455616=_0x56d7[_0x425541];return _0x455616;};'use strict';var _=require(_0x756d('0x0'));var util=require('util');var logger=require(_0x756d('0x1'))(_0x756d('0x2'));var moment=require(_0x756d('0x3'));var BPromise=require('bluebird');var rp=require(_0x756d('0x4'));var fs=require('fs');var path=require(_0x756d('0x5'));var rimraf=require(_0x756d('0x6'));var config=require(_0x756d('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x756d('0x8')]=function(_0x5a6e0a,_0xdf79a){return _0x5a6e0a[_0x756d('0x9')](_0x756d('0xa'),attributes,{'tableName':_0x756d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22891a,_0x418c4f,_0x22111d){if(_0x22891a[_0x756d('0xc')](_0x756d('0xd'))){_0x22891a[_0x756d('0xe')]=moment()[_0x756d('0xf')](_0x756d('0x10'));}_0x22111d(null,_0x22891a);}},'charset':_0x756d('0x11'),'collate':_0x756d('0x12')});}; \ No newline at end of file +var _0xc69c=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x3d784f,_0x100ef1){var _0x32340e=function(_0xfd0c00){while(--_0xfd0c00){_0x3d784f['push'](_0x3d784f['shift']());}};_0x32340e(++_0x100ef1);}(_0xc69c,0x11b));var _0xcc69=function(_0x276167,_0x21086e){_0x276167=_0x276167-0x0;var _0x27a866=_0xc69c[_0x276167];return _0x27a866;};'use strict';var _=require(_0xcc69('0x0'));var util=require(_0xcc69('0x1'));var logger=require(_0xcc69('0x2'))(_0xcc69('0x3'));var moment=require(_0xcc69('0x4'));var BPromise=require(_0xcc69('0x5'));var rp=require(_0xcc69('0x6'));var fs=require('fs');var path=require(_0xcc69('0x7'));var rimraf=require(_0xcc69('0x8'));var config=require(_0xcc69('0x9'));var attributes=require(_0xcc69('0xa'));module['exports']=function(_0x473434,_0x3d7308){return _0x473434[_0xcc69('0xb')](_0xcc69('0xc'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e2bc7,_0x30554a,_0x492bd9){if(_0x2e2bc7['changed'](_0xcc69('0xd'))){_0x2e2bc7['closedAt']=moment()[_0xcc69('0xe')](_0xcc69('0xf'));}_0x492bd9(null,_0x2e2bc7);}},'charset':_0xcc69('0x10'),'collate':_0xcc69('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 3bdc645..79b79ba 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 _0x68b8=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','options','attributes','AddTagsToChatInteraction','where','body','ids','omit','spread','AddTags','lodash','util'];(function(_0x299b96,_0x243cb1){var _0x2ae4a5=function(_0x41493a){while(--_0x41493a){_0x299b96['push'](_0x299b96['shift']());}};_0x2ae4a5(++_0x243cb1);}(_0x68b8,0x9a));var _0x868b=function(_0xb6a965,_0x5c5ace){_0xb6a965=_0xb6a965-0x0;var _0x51d37d=_0x68b8[_0xb6a965];return _0x51d37d;};'use strict';var _=require(_0x868b('0x0'));var util=require(_0x868b('0x1'));var moment=require(_0x868b('0x2'));var BPromise=require(_0x868b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x868b('0x4'))['db'];var utils=require(_0x868b('0x5'));var logger=require(_0x868b('0x6'))(_0x868b('0x7'));var config=require(_0x868b('0x8'));var jayson=require(_0x868b('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x868b('0xa')]=_[_0x868b('0xb')](config[_0x868b('0xa')],{'host':_0x868b('0xc'),'port':0x18eb});var socket=require(_0x868b('0xd'))(new Redis(config[_0x868b('0xa')]));require(_0x868b('0xe'))[_0x868b('0xf')](socket);function respondWithRpcPromise(_0x54c441,_0x261473,_0x4b9fae){return new BPromise(function(_0x3ea358,_0x2916cf){return client[_0x868b('0x10')](_0x54c441,_0x4b9fae)[_0x868b('0x11')](function(_0x4283c5){logger[_0x868b('0x12')](_0x868b('0x13'),_0x261473,_0x868b('0x14'));logger[_0x868b('0x15')](_0x868b('0x16'),_0x261473,_0x868b('0x14'),JSON[_0x868b('0x17')](_0x4283c5));if(_0x4283c5[_0x868b('0x18')]){if(_0x4283c5[_0x868b('0x18')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x261473,_0x4283c5[_0x868b('0x18')]['message']);return _0x2916cf(_0x4283c5[_0x868b('0x18')][_0x868b('0x19')]);}logger[_0x868b('0x18')](_0x868b('0x13'),_0x261473,_0x4283c5[_0x868b('0x18')]['message']);return _0x3ea358(_0x4283c5[_0x868b('0x18')][_0x868b('0x19')]);}else{logger[_0x868b('0x12')](_0x868b('0x13'),_0x261473,_0x868b('0x14'));_0x3ea358(_0x4283c5[_0x868b('0x1a')]['message']);}})[_0x868b('0x1b')](function(_0x162f01){logger[_0x868b('0x18')](_0x868b('0x13'),_0x261473,_0x162f01);_0x2916cf(_0x162f01);});});}exports[_0x868b('0x1c')]=function(_0x34b71f){var _0x49a27d=this;return new Promise(function(_0x5302f7,_0x2df986){return db[_0x868b('0x1d')]['update'](_0x34b71f['body'],{'raw':_0x34b71f[_0x868b('0x1e')]?_0x34b71f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34b71f['options']?_0x34b71f[_0x868b('0x1e')]['where']||null:null,'attributes':_0x34b71f[_0x868b('0x1e')]?_0x34b71f[_0x868b('0x1e')][_0x868b('0x1f')]||null:null,'limit':_0x34b71f['options']?_0x34b71f[_0x868b('0x1e')]['limit']||null:null})[_0x868b('0x11')](function(_0x175b23){logger[_0x868b('0x12')](_0x868b('0x1c'),_0x34b71f);logger[_0x868b('0x15')](_0x868b('0x1c'),_0x34b71f,JSON['stringify'](_0x175b23));_0x5302f7(_0x175b23);})[_0x868b('0x1b')](function(_0x2feeb5){logger['error'](_0x868b('0x1c'),_0x2feeb5['message'],_0x34b71f);_0x2df986(_0x49a27d[_0x868b('0x18')](0x1f4,_0x2feeb5[_0x868b('0x19')]));});});};exports[_0x868b('0x20')]=function(_0x48db48){return new Promise(function(_0x4f5707,_0x8986eb){return db[_0x868b('0x1d')]['find']({'where':_0x48db48['options']?_0x48db48['options'][_0x868b('0x21')]||null:null})['then'](function(_0x31189b){if(_0x31189b){return _0x31189b['addTags'](_0x48db48[_0x868b('0x22')][_0x868b('0x23')],_[_0x868b('0x24')](_0x48db48[_0x868b('0x22')],['ids','id'])||{});}})[_0x868b('0x25')](function(_0x521dd6){logger[_0x868b('0x12')](_0x868b('0x26'),_0x48db48);logger[_0x868b('0x15')](_0x868b('0x26'),_0x48db48,JSON[_0x868b('0x17')](_0x521dd6));_0x4f5707(_0x521dd6);})['catch'](function(_0x1ef97a){logger[_0x868b('0x18')]('AddTags',_0x1ef97a[_0x868b('0x19')],_0x48db48);_0x8986eb(_this[_0x868b('0x18')](0x1f4,_0x1ef97a['message']));});});}; \ No newline at end of file +var _0x3348=['request\x20sent','debug','stringify','error','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s'];(function(_0x5f13ed,_0x346b48){var _0x1b4a25=function(_0x4250bb){while(--_0x4250bb){_0x5f13ed['push'](_0x5f13ed['shift']());}};_0x1b4a25(++_0x346b48);}(_0x3348,0xba));var _0x8334=function(_0x3aba6e,_0x76ce){_0x3aba6e=_0x3aba6e-0x0;var _0x577273=_0x3348[_0x3aba6e];return _0x577273;};'use strict';var _=require('lodash');var util=require(_0x8334('0x0'));var moment=require(_0x8334('0x1'));var BPromise=require(_0x8334('0x2'));var rs=require(_0x8334('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8334('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8334('0x5'))(_0x8334('0x6'));var config=require(_0x8334('0x7'));var jayson=require(_0x8334('0x8'));var client=jayson[_0x8334('0x9')][_0x8334('0xa')]({'port':0x232a});config[_0x8334('0xb')]=_[_0x8334('0xc')](config['redis'],{'host':_0x8334('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8334('0xb')]));require(_0x8334('0xe'))[_0x8334('0xf')](socket);function respondWithRpcPromise(_0xda5393,_0x5c86ae,_0x145453){return new BPromise(function(_0xe3afa7,_0x1385c6){return client[_0x8334('0x10')](_0xda5393,_0x145453)[_0x8334('0x11')](function(_0x1793aa){logger['info'](_0x8334('0x12'),_0x5c86ae,_0x8334('0x13'));logger[_0x8334('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5c86ae,'request\x20sent',JSON[_0x8334('0x15')](_0x1793aa));if(_0x1793aa[_0x8334('0x16')]){if(_0x1793aa['error']['code']===0x1f4){logger[_0x8334('0x16')](_0x8334('0x12'),_0x5c86ae,_0x1793aa[_0x8334('0x16')][_0x8334('0x17')]);return _0x1385c6(_0x1793aa[_0x8334('0x16')]['message']);}logger['error'](_0x8334('0x12'),_0x5c86ae,_0x1793aa[_0x8334('0x16')][_0x8334('0x17')]);return _0xe3afa7(_0x1793aa[_0x8334('0x16')][_0x8334('0x17')]);}else{logger[_0x8334('0x18')](_0x8334('0x12'),_0x5c86ae,_0x8334('0x13'));_0xe3afa7(_0x1793aa[_0x8334('0x19')]['message']);}})[_0x8334('0x1a')](function(_0x82faf1){logger['error'](_0x8334('0x12'),_0x5c86ae,_0x82faf1);_0x1385c6(_0x82faf1);});});}exports[_0x8334('0x1b')]=function(_0xa39a94){var _0x20cd51=this;return new Promise(function(_0x45e517,_0xaee126){return db[_0x8334('0x1c')][_0x8334('0x1d')](_0xa39a94[_0x8334('0x1e')],{'raw':_0xa39a94[_0x8334('0x1f')]?_0xa39a94[_0x8334('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa39a94[_0x8334('0x1f')]?_0xa39a94['options'][_0x8334('0x20')]||null:null,'attributes':_0xa39a94[_0x8334('0x1f')]?_0xa39a94[_0x8334('0x1f')][_0x8334('0x21')]||null:null,'limit':_0xa39a94['options']?_0xa39a94[_0x8334('0x1f')][_0x8334('0x22')]||null:null})[_0x8334('0x11')](function(_0x4eafd7){logger[_0x8334('0x18')]('UpdateChatInteraction',_0xa39a94);logger[_0x8334('0x14')](_0x8334('0x1b'),_0xa39a94,JSON[_0x8334('0x15')](_0x4eafd7));_0x45e517(_0x4eafd7);})[_0x8334('0x1a')](function(_0x30a689){logger[_0x8334('0x16')]('UpdateChatInteraction',_0x30a689[_0x8334('0x17')],_0xa39a94);_0xaee126(_0x20cd51[_0x8334('0x16')](0x1f4,_0x30a689[_0x8334('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x340975){return new Promise(function(_0x28166e,_0x346162){return db[_0x8334('0x1c')][_0x8334('0x23')]({'where':_0x340975[_0x8334('0x1f')]?_0x340975['options'][_0x8334('0x20')]||null:null})[_0x8334('0x11')](function(_0x2061c9){if(_0x2061c9){return _0x2061c9[_0x8334('0x24')](_0x340975['body'][_0x8334('0x25')],_[_0x8334('0x26')](_0x340975[_0x8334('0x1e')],[_0x8334('0x25'),'id'])||{});}})[_0x8334('0x27')](function(_0x177b39){logger[_0x8334('0x18')]('AddTags',_0x340975);logger[_0x8334('0x14')](_0x8334('0x28'),_0x340975,JSON['stringify'](_0x177b39));_0x28166e(_0x177b39);})[_0x8334('0x1a')](function(_0x34c292){logger[_0x8334('0x16')](_0x8334('0x28'),_0x34c292[_0x8334('0x17')],_0x340975);_0x346162(_this['error'](0x1f4,_0x34c292['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index ca7a71b..359cbc6 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 _0xd26d=['save','remove','update','emit','removeListener','register','length','chatInteraction:'];(function(_0x296118,_0x39a635){var _0x2c6a98=function(_0x1d622d){while(--_0x1d622d){_0x296118['push'](_0x296118['shift']());}};_0x2c6a98(++_0x39a635);}(_0xd26d,0x108));var _0xdd26=function(_0x50abc4,_0x558d64){_0x50abc4=_0x50abc4-0x0;var _0x5a745d=_0xd26d[_0x50abc4];return _0x5a745d;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xdd26('0x0'),_0xdd26('0x1'),_0xdd26('0x2')];function createListener(_0x247aba,_0xec5751){return function(_0x1e979c){_0xec5751[_0xdd26('0x3')](_0x247aba,_0x1e979c);};}function removeListener(_0xffa247,_0x5d7819){return function(){ChatInteractionEvents[_0xdd26('0x4')](_0xffa247,_0x5d7819);};}exports[_0xdd26('0x5')]=function(_0x27474f){for(var _0x412c84=0x0,_0x199761=events[_0xdd26('0x6')];_0x412c84<_0x199761;_0x412c84++){var _0x4c1d6b=events[_0x412c84];var _0x5097ca=createListener(_0xdd26('0x7')+_0x4c1d6b,_0x27474f);ChatInteractionEvents['on'](_0x4c1d6b,_0x5097ca);}}; \ No newline at end of file +var _0x3e58=['register','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener'];(function(_0x30cd3b,_0x1371a4){var _0xa1bfea=function(_0x4a6fed){while(--_0x4a6fed){_0x30cd3b['push'](_0x30cd3b['shift']());}};_0xa1bfea(++_0x1371a4);}(_0x3e58,0x16a));var _0x83e5=function(_0x2c753c,_0x3378e7){_0x2c753c=_0x2c753c-0x0;var _0x23ba20=_0x3e58[_0x2c753c];return _0x23ba20;};'use strict';var ChatInteractionEvents=require(_0x83e5('0x0'));var events=[_0x83e5('0x1'),_0x83e5('0x2'),_0x83e5('0x3')];function createListener(_0x481c93,_0x3c4b58){return function(_0x125ea9){_0x3c4b58[_0x83e5('0x4')](_0x481c93,_0x125ea9);};}function removeListener(_0x2e5308,_0x21b71c){return function(){ChatInteractionEvents[_0x83e5('0x5')](_0x2e5308,_0x21b71c);};}exports[_0x83e5('0x6')]=function(_0x410f0c){for(var _0xd1cc3e=0x0,_0x1251f3=events['length'];_0xd1cc3e<_0x1251f3;_0xd1cc3e++){var _0xe8cafb=events[_0xd1cc3e];var _0x258757=createListener(_0x83e5('0x7')+_0xe8cafb,_0x410f0c);ChatInteractionEvents['on'](_0xe8cafb,_0x258757);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 6f7ab9a..5eca7fe 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 _0x09ed=['show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','put','update','/:id/custom_update','customUpdate','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','/:id'];(function(_0x5ef2e5,_0x496362){var _0x2ddbb3=function(_0x43f82b){while(--_0x43f82b){_0x5ef2e5['push'](_0x5ef2e5['shift']());}};_0x2ddbb3(++_0x496362);}(_0x09ed,0x11a));var _0xd09e=function(_0x5b692c,_0x41b47c){_0x5b692c=_0x5b692c-0x0;var _0x34b91d=_0x09ed[_0x5b692c];return _0x34b91d;};'use strict';var multer=require(_0xd09e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd09e('0x1'));var router=express[_0xd09e('0x2')]();var fs_extra=require(_0xd09e('0x3'));var auth=require(_0xd09e('0x4'));var interaction=require(_0xd09e('0x5'));var config=require(_0xd09e('0x6'));var controller=require(_0xd09e('0x7'));router[_0xd09e('0x8')]('/',auth[_0xd09e('0x9')](),controller['index']);router[_0xd09e('0x8')](_0xd09e('0xa'),auth[_0xd09e('0x9')](),controller['describe']);router[_0xd09e('0x8')](_0xd09e('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xd09e('0xc')]);router['get'](_0xd09e('0xd'),auth[_0xd09e('0xe')](),controller[_0xd09e('0xf')]);router['get'](_0xd09e('0x10'),auth['isAuthenticated'](),controller[_0xd09e('0x11')]);router[_0xd09e('0x8')](_0xd09e('0x12'),auth[_0xd09e('0xe')](),controller['getMyMessages']);router[_0xd09e('0x8')]('/:id/download',auth[_0xd09e('0x9')](),controller['download']);router[_0xd09e('0x13')]('/',auth[_0xd09e('0x9')](),controller[_0xd09e('0x14')]);router[_0xd09e('0x13')](_0xd09e('0x15'),auth[_0xd09e('0x9')](),controller[_0xd09e('0x16')]);var upload=multer({'storage':multer[_0xd09e('0x17')]({'destination':function(_0x3767c5,_0x28069a,_0x458aef){_0x458aef(null,path[_0xd09e('0x18')](config[_0xd09e('0x19')],_0xd09e('0x1a')));},'filename':function(_0x277264,_0x174e99,_0x5b74ff){_0x5b74ff(null,util[_0xd09e('0x1b')]('%s-%s',Date[_0xd09e('0x1c')](),_0x174e99[_0xd09e('0x1d')][_0xd09e('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xd09e('0x1f'),upload[_0xd09e('0x20')]('file'),controller[_0xd09e('0x21')]);router[_0xd09e('0x13')](_0xd09e('0x10'),auth[_0xd09e('0xe')](),controller['addMessage']);router['post'](_0xd09e('0x22'),auth[_0xd09e('0x9')](),interaction[_0xd09e('0x23')](_0xd09e('0x24'),_0xd09e('0x25')),controller['addTags']);router[_0xd09e('0x26')](_0xd09e('0xb'),auth[_0xd09e('0x9')](),interaction['tracked']('chat','chatinteraction:update'),controller[_0xd09e('0x27')]);router[_0xd09e('0x26')](_0xd09e('0x28'),controller[_0xd09e('0x29')]);router['put']('/:id/abandon',auth[_0xd09e('0xe')](),controller[_0xd09e('0x2a')]);router[_0xd09e('0x26')]('/:id/close',controller[_0xd09e('0x2b')]);router[_0xd09e('0x2c')](_0xd09e('0xb'),auth[_0xd09e('0x9')](),interaction['tracked'](_0xd09e('0x24'),_0xd09e('0x2d')),controller[_0xd09e('0x2e')]);router[_0xd09e('0x2c')](_0xd09e('0x22'),auth[_0xd09e('0x9')](),controller[_0xd09e('0x2f')]);module[_0xd09e('0x30')]=router; \ No newline at end of file +var _0xf976=['server/files/attachments/','format','%s-%s','now','originalname','replace','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','isChatInteractionAuthorized','download','post','createVidaooSession','diskStorage','root'];(function(_0x594d67,_0x4e683f){var _0x1916e7=function(_0x24f4bb){while(--_0x24f4bb){_0x594d67['push'](_0x594d67['shift']());}};_0x1916e7(++_0x4e683f);}(_0xf976,0x112));var _0x6f97=function(_0x492f01,_0x21a765){_0x492f01=_0x492f01-0x0;var _0x5851de=_0xf976[_0x492f01];return _0x5851de;};'use strict';var multer=require(_0x6f97('0x0'));var util=require(_0x6f97('0x1'));var path=require(_0x6f97('0x2'));var timeout=require(_0x6f97('0x3'));var express=require(_0x6f97('0x4'));var router=express[_0x6f97('0x5')]();var fs_extra=require(_0x6f97('0x6'));var auth=require(_0x6f97('0x7'));var interaction=require(_0x6f97('0x8'));var config=require('../../config/environment');var controller=require(_0x6f97('0x9'));router[_0x6f97('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6f97('0xa')](_0x6f97('0xb'),auth[_0x6f97('0xc')](),controller[_0x6f97('0xd')]);router[_0x6f97('0xa')](_0x6f97('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x6f97('0xf')]);router['get'](_0x6f97('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x6f97('0x11')]);router['get'](_0x6f97('0x12'),auth[_0x6f97('0xc')](),controller[_0x6f97('0x13')]);router[_0x6f97('0xa')]('/:id/my_messages',auth[_0x6f97('0x14')](),controller['getMyMessages']);router[_0x6f97('0xa')]('/:id/download',auth[_0x6f97('0xc')](),controller[_0x6f97('0x15')]);router[_0x6f97('0x16')]('/',auth[_0x6f97('0xc')](),controller['create']);router['post']('/:id/vidaoo',auth[_0x6f97('0xc')](),controller[_0x6f97('0x17')]);var upload=multer({'storage':multer[_0x6f97('0x18')]({'destination':function(_0xfee59e,_0x485efe,_0x1561d0){_0x1561d0(null,path['join'](config[_0x6f97('0x19')],_0x6f97('0x1a')));},'filename':function(_0x26fc90,_0x42a069,_0x36f6a5){_0x36f6a5(null,util[_0x6f97('0x1b')](_0x6f97('0x1c'),Date[_0x6f97('0x1d')](),_0x42a069[_0x6f97('0x1e')][_0x6f97('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6f97('0x16')]('/:id/attachment_upload',upload[_0x6f97('0x20')]('file'),controller[_0x6f97('0x21')]);router[_0x6f97('0x16')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x6f97('0x22')]);router[_0x6f97('0x16')](_0x6f97('0x23'),auth[_0x6f97('0xc')](),interaction[_0x6f97('0x24')](_0x6f97('0x25'),_0x6f97('0x26')),controller['addTags']);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x6f97('0x24')](_0x6f97('0x25'),_0x6f97('0x27')),controller[_0x6f97('0x28')]);router[_0x6f97('0x29')](_0x6f97('0x2a'),controller[_0x6f97('0x2b')]);router['put'](_0x6f97('0x2c'),auth[_0x6f97('0x14')](),controller[_0x6f97('0x2d')]);router[_0x6f97('0x29')](_0x6f97('0x2e'),controller['close']);router[_0x6f97('0x2f')](_0x6f97('0xe'),auth[_0x6f97('0xc')](),interaction[_0x6f97('0x24')](_0x6f97('0x25'),'chatinteraction:destroy'),controller[_0x6f97('0x30')]);router['delete']('/:id/tags',auth[_0x6f97('0xc')](),controller[_0x6f97('0x31')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index a882184..27f1421 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 _0x07c8=['medium','BOOLEAN','sequelize','exports','TEXT'];(function(_0x166a5f,_0x24d6e1){var _0x94b441=function(_0x2ded58){while(--_0x2ded58){_0x166a5f['push'](_0x166a5f['shift']());}};_0x94b441(++_0x24d6e1);}(_0x07c8,0x16a));var _0x807c=function(_0x3483f3,_0x4c9e96){_0x3483f3=_0x3483f3-0x0;var _0x10f710=_0x07c8[_0x3483f3];return _0x10f710;};'use strict';var Sequelize=require(_0x807c('0x0'));module[_0x807c('0x1')]={'body':{'type':Sequelize[_0x807c('0x2')](_0x807c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x807c('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x2e08=['sequelize','TEXT','medium','INTEGER'];(function(_0x155936,_0x399a41){var _0x5c20ac=function(_0x141842){while(--_0x141842){_0x155936['push'](_0x155936['shift']());}};_0x5c20ac(++_0x399a41);}(_0x2e08,0x168));var _0x82e0=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2e08[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x82e0('0x0'));module['exports']={'body':{'type':Sequelize[_0x82e0('0x1')](_0x82e0('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x82e0('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 07fda30..c9ceca2 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 _0x6ce6=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','map','ChatInternalMessage','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','filters','create','body','update','find','catch','get','messages','lastMessageAt','createdAt','lastMessage','agent','admin','user','fullname','role','online','allowmessenger','showWebBar','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','ToId','read','all','eml-format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ce6,0x68));var _0x66ce=function(_0xff13e7,_0x3cbf81){_0xff13e7=_0xff13e7-0x0;var _0x4097a9=_0x6ce6[_0xff13e7];return _0x4097a9;};'use strict';var emlformat=require(_0x66ce('0x0'));var rimraf=require(_0x66ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66ce('0x2'));var rp=require(_0x66ce('0x3'));var moment=require(_0x66ce('0x4'));var BPromise=require(_0x66ce('0x5'));var Mustache=require(_0x66ce('0x6'));var util=require('util');var path=require(_0x66ce('0x7'));var sox=require(_0x66ce('0x8'));var csv=require(_0x66ce('0x9'));var ejs=require(_0x66ce('0xa'));var fs=require('fs');var fs_extra=require(_0x66ce('0xb'));var _=require(_0x66ce('0xc'));var squel=require(_0x66ce('0xd'));var crypto=require('crypto');var jsforce=require(_0x66ce('0xe'));var deskjs=require(_0x66ce('0xf'));var toCsv=require('to-csv');var querystring=require(_0x66ce('0x10'));var Papa=require(_0x66ce('0x11'));var Redis=require('ioredis');var authService=require(_0x66ce('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x66ce('0x13'));var hardwareService=require(_0x66ce('0x14'));var logger=require('../../config/logger')(_0x66ce('0x15'));var utils=require(_0x66ce('0x16'));var config=require(_0x66ce('0x17'));var licenseUtil=require(_0x66ce('0x18'));var db=require(_0x66ce('0x19'))['db'];config['redis']=_[_0x66ce('0x1a')](config[_0x66ce('0x1b')],{'host':_0x66ce('0x1c'),'port':0x18eb});var socket=require(_0x66ce('0x1d'))(new Redis(config[_0x66ce('0x1b')]));require('./chatInternalMessage.socket')[_0x66ce('0x1e')](socket);function respondWithStatusCode(_0x37bfb3,_0x67b14f){_0x67b14f=_0x67b14f||0xcc;return function(_0x2daaea){if(_0x2daaea){return _0x37bfb3[_0x66ce('0x1f')](_0x67b14f);}return _0x37bfb3[_0x66ce('0x20')](_0x67b14f)[_0x66ce('0x21')]();};}function respondWithResult(_0x17a593,_0x435ce4){_0x435ce4=_0x435ce4||0xc8;return function(_0x2ac5a9){if(_0x2ac5a9){return _0x17a593[_0x66ce('0x20')](_0x435ce4)[_0x66ce('0x22')](_0x2ac5a9);}};}function respondWithFilteredResult(_0x5a5a04,_0x2b0ab9){return function(_0x18d9f3){if(_0x18d9f3){var _0x4a53ae=typeof _0x2b0ab9[_0x66ce('0x23')]===_0x66ce('0x24')&&typeof _0x2b0ab9[_0x66ce('0x25')]==='undefined';var _0x29d2a1=_0x18d9f3[_0x66ce('0x26')];var _0x14d3f7=_0x4a53ae?0x0:_0x2b0ab9[_0x66ce('0x23')];var _0x888f9b=_0x4a53ae?_0x18d9f3['count']:_0x2b0ab9['offset']+_0x2b0ab9[_0x66ce('0x25')];var _0x1c44b6;if(_0x888f9b>=_0x29d2a1){_0x888f9b=_0x29d2a1;_0x1c44b6=0xc8;}else{_0x1c44b6=0xce;}_0x5a5a04[_0x66ce('0x20')](_0x1c44b6);return _0x5a5a04[_0x66ce('0x27')]('Content-Range',_0x14d3f7+'-'+_0x888f9b+'/'+_0x29d2a1)[_0x66ce('0x22')](_0x18d9f3);}return null;};}function patchUpdates(_0x421c52){return function(_0x3f0f09){try{jsonpatch[_0x66ce('0x28')](_0x3f0f09,_0x421c52,!![]);}catch(_0xe0ce13){return BPromise[_0x66ce('0x29')](_0xe0ce13);}return _0x3f0f09[_0x66ce('0x2a')]();};}function saveUpdates(_0x4dca7b,_0x89b119){return function(_0x501695){if(_0x501695){return _0x501695['update'](_0x4dca7b)[_0x66ce('0x2b')](function(_0x4cfd59){return _0x4cfd59;});}return null;};}function removeEntity(_0x13129f,_0x35d667){return function(_0x2103a7){if(_0x2103a7){return _0x2103a7[_0x66ce('0x2c')]()[_0x66ce('0x2b')](function(){_0x13129f['status'](0xcc)[_0x66ce('0x21')]();});}};}function handleEntityNotFound(_0x143022,_0x1ae3f2){return function(_0x1f8731){if(!_0x1f8731){_0x143022[_0x66ce('0x1f')](0x194);}return _0x1f8731;};}function handleError(_0x166f4a,_0x854656){_0x854656=_0x854656||0x1f4;return function(_0x201ba8){logger[_0x66ce('0x2d')](_0x201ba8[_0x66ce('0x2e')]);if(_0x201ba8['name']){delete _0x201ba8[_0x66ce('0x2f')];}_0x166f4a[_0x66ce('0x20')](_0x854656)[_0x66ce('0x30')](_0x201ba8);};}exports['index']=function(_0x1cc0cc,_0x39a19e){var _0x27071d={},_0x136256={},_0x96d965={'count':0x0,'rows':[]};var _0x2fa51f=_[_0x66ce('0x31')](db[_0x66ce('0x32')][_0x66ce('0x33')],function(_0x3761b2){return{'name':_0x3761b2['fieldName'],'type':_0x3761b2[_0x66ce('0x34')][_0x66ce('0x35')]};});_0x136256['model']=_[_0x66ce('0x31')](_0x2fa51f,'name');_0x136256[_0x66ce('0x36')]=_[_0x66ce('0x37')](_0x1cc0cc[_0x66ce('0x36')]);_0x136256['filters']=_['intersection'](_0x136256[_0x66ce('0x38')],_0x136256[_0x66ce('0x36')]);_0x27071d[_0x66ce('0x39')]=_[_0x66ce('0x3a')](_0x136256[_0x66ce('0x38')],qs[_0x66ce('0x3b')](_0x1cc0cc[_0x66ce('0x36')]['fields']));_0x27071d[_0x66ce('0x39')]=_0x27071d[_0x66ce('0x39')][_0x66ce('0x3c')]?_0x27071d[_0x66ce('0x39')]:_0x136256[_0x66ce('0x38')];if(!_0x1cc0cc[_0x66ce('0x36')][_0x66ce('0x3d')](_0x66ce('0x3e'))){_0x27071d[_0x66ce('0x25')]=qs[_0x66ce('0x25')](_0x1cc0cc[_0x66ce('0x36')][_0x66ce('0x25')]);_0x27071d[_0x66ce('0x23')]=qs[_0x66ce('0x23')](_0x1cc0cc[_0x66ce('0x36')][_0x66ce('0x23')]);}_0x27071d[_0x66ce('0x3f')]=qs[_0x66ce('0x40')](_0x1cc0cc[_0x66ce('0x36')][_0x66ce('0x40')]);_0x27071d[_0x66ce('0x41')]=qs['filters'](_['pick'](_0x1cc0cc['query'],_0x136256['filters']),_0x2fa51f);if(_0x1cc0cc[_0x66ce('0x36')][_0x66ce('0x42')]){_0x27071d[_0x66ce('0x41')]=_[_0x66ce('0x43')](_0x27071d[_0x66ce('0x41')],{'$or':_[_0x66ce('0x31')](_0x2fa51f,function(_0x10b1ae){if(_0x10b1ae[_0x66ce('0x34')]!==_0x66ce('0x44')){var _0x206e50={};_0x206e50[_0x10b1ae['name']]={'$like':'%'+_0x1cc0cc[_0x66ce('0x36')][_0x66ce('0x42')]+'%'};return _0x206e50;}})});}_0x27071d=_[_0x66ce('0x43')]({},_0x27071d,_0x1cc0cc[_0x66ce('0x45')]);var _0xb8c5f={'where':_0x27071d['where']};return db[_0x66ce('0x32')][_0x66ce('0x26')](_0xb8c5f)[_0x66ce('0x2b')](function(_0x2791f9){_0x96d965['count']=_0x2791f9;if(_0x1cc0cc[_0x66ce('0x36')][_0x66ce('0x46')]){_0x27071d[_0x66ce('0x47')]=[{'all':!![]}];}return db[_0x66ce('0x32')][_0x66ce('0x48')](_0x27071d);})['then'](function(_0x1350a7){_0x96d965['rows']=_0x1350a7;return _0x96d965;})[_0x66ce('0x2b')](respondWithFilteredResult(_0x39a19e,_0x27071d))['catch'](handleError(_0x39a19e,null));};exports['show']=function(_0x356262,_0x93d1b1){var _0x3eb017={'raw':!![],'where':{'id':_0x356262[_0x66ce('0x49')]['id']}},_0x468493={};_0x468493[_0x66ce('0x38')]=_[_0x66ce('0x37')](db[_0x66ce('0x32')]['rawAttributes']);_0x468493[_0x66ce('0x36')]=_['keys'](_0x356262['query']);_0x468493[_0x66ce('0x4a')]=_['intersection'](_0x468493[_0x66ce('0x38')],_0x468493[_0x66ce('0x36')]);_0x3eb017[_0x66ce('0x39')]=_[_0x66ce('0x3a')](_0x468493[_0x66ce('0x38')],qs[_0x66ce('0x3b')](_0x356262['query']['fields']));_0x3eb017[_0x66ce('0x39')]=_0x3eb017[_0x66ce('0x39')]['length']?_0x3eb017[_0x66ce('0x39')]:_0x468493[_0x66ce('0x38')];if(_0x356262[_0x66ce('0x36')]['includeAll']){_0x3eb017[_0x66ce('0x47')]=[{'all':!![]}];}_0x3eb017=_[_0x66ce('0x43')]({},_0x3eb017,_0x356262[_0x66ce('0x45')]);return db[_0x66ce('0x32')]['find'](_0x3eb017)['then'](handleEntityNotFound(_0x93d1b1,null))['then'](respondWithResult(_0x93d1b1,null))['catch'](handleError(_0x93d1b1,null));};exports[_0x66ce('0x4b')]=function(_0x578eb2,_0x5e040d){return db[_0x66ce('0x32')][_0x66ce('0x4b')](_0x578eb2[_0x66ce('0x4c')],{})[_0x66ce('0x2b')](respondWithResult(_0x5e040d,0xc9))['catch'](handleError(_0x5e040d,null));};exports[_0x66ce('0x4d')]=function(_0x47c661,_0x11f80e){if(_0x47c661[_0x66ce('0x4c')]['id']){delete _0x47c661['body']['id'];}return db['ChatInternalMessage'][_0x66ce('0x4e')]({'where':{'id':_0x47c661[_0x66ce('0x49')]['id']}})[_0x66ce('0x2b')](handleEntityNotFound(_0x11f80e,null))[_0x66ce('0x2b')](saveUpdates(_0x47c661[_0x66ce('0x4c')],null))['then'](respondWithResult(_0x11f80e,null))[_0x66ce('0x4f')](handleError(_0x11f80e,null));};exports[_0x66ce('0x2c')]=function(_0x44b09b,_0x7166a5){return db[_0x66ce('0x32')]['find']({'where':{'id':_0x44b09b[_0x66ce('0x49')]['id']}})[_0x66ce('0x2b')](handleEntityNotFound(_0x7166a5,null))[_0x66ce('0x2b')](removeEntity(_0x7166a5,null))[_0x66ce('0x4f')](handleError(_0x7166a5,null));};exports['describe']=function(_0x4159d0,_0x4b0d4d){return db[_0x66ce('0x32')]['describe']()['then'](respondWithResult(_0x4b0d4d,null))[_0x66ce('0x4f')](handleError(_0x4b0d4d,null));};function wrapUser(_0x1e04de){return function(_0x48aa97){var _0x2f761a=_0x1e04de[_0x66ce('0x50')]({'plain':!![]});_0x2f761a[_0x66ce('0x51')]=[];if(_0x48aa97){_0x2f761a[_0x66ce('0x52')]=_0x48aa97[_0x66ce('0x53')];_0x2f761a['lastMessage']=_0x48aa97;}else{_0x2f761a[_0x66ce('0x52')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2f761a[_0x66ce('0x54')]={};}return _0x2f761a;};}exports['getUsers']=function(_0x471048,_0x5987c0,_0x22c39b){var _0x256983=[];return db['User']['findAll']({'where':{'role':[_0x66ce('0x55'),_0x66ce('0x56'),_0x66ce('0x57')]},'attributes':['id',_0x66ce('0x58'),_0x66ce('0x2f'),_0x66ce('0x59'),'userpic','internal',_0x66ce('0x5a'),'lastLoginAt',_0x66ce('0x5b'),_0x66ce('0x5c')],'order':qs[_0x66ce('0x40')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x66ce('0x5d'),'attributes':['id',_0x66ce('0x2f'),_0x66ce('0x34')],'through':{'attributes':[]}}]})[_0x66ce('0x2b')](function(_0x14e3d5){if(_0x14e3d5){var _0x98543b=_0x471048[_0x66ce('0x57')][_0x66ce('0x50')]({'plain':!![]});if(!_0x98543b)throw new Error(_0x66ce('0x5e'));if(_0x98543b[_0x66ce('0x59')]===_0x66ce('0x57')){return db['UserProfileSection']['find']({'where':{'name':_0x66ce('0x5f'),'userProfileId':_0x98543b[_0x66ce('0x60')]},'raw':!![]})[_0x66ce('0x2b')](function(_0x5a315b){if(_0x5a315b){if(_0x5a315b[_0x66ce('0x61')]===0x0){return db[_0x66ce('0x62')][_0x66ce('0x48')]({'where':{'sectionId':_0x5a315b['id']},'raw':!![]})[_0x66ce('0x2b')](function(_0xcdecb){var _0x8caf4e=[];if(_[_0x66ce('0x63')](_0xcdecb)){_0x8caf4e=_['filter'](_0x14e3d5,function(_0x11f361){if(_0x11f361[_0x66ce('0x59')]!==_0x66ce('0x55')){return _0x11f361;}});return _0x8caf4e;}else{for(var _0x4a7b1e=0x0;_0x4a7b1e<_0x14e3d5[_0x66ce('0x3c')];_0x4a7b1e++){var _0x3720a4=_0x14e3d5[_0x4a7b1e];if(_0x3720a4[_0x66ce('0x59')]===_0x66ce('0x55')){var _0x5de155=_[_0x66ce('0x4e')](_0xcdecb,function(_0x221459){return _0x221459['resourceId']===_0x3720a4['id'];});if(_0x5de155)_0x8caf4e[_0x66ce('0x64')](_0x3720a4);}else{_0x8caf4e[_0x66ce('0x64')](_0x3720a4);}}return _0x8caf4e;}});}else{return _0x14e3d5;}}else{var _0x78d276=_[_0x66ce('0x42')](_0x14e3d5,function(_0x1f7825){if(_0x1f7825[_0x66ce('0x59')]!==_0x66ce('0x55')){return _0x1f7825;}});return _0x78d276;}});}else{return _0x14e3d5;}}})[_0x66ce('0x2b')](function(_0x1dd055){var _0x3cab70=[];if(_0x1dd055){_0x256983=_0x1dd055;for(var _0x4556ae=0x0;_0x4556ae<_0x1dd055['length'];_0x4556ae+=0x1){_0x256983[_0x4556ae][_0x66ce('0x51')]=[];_0x3cab70[_0x66ce('0x64')](db[_0x66ce('0x32')]['find']({'where':{'FromId':[_0x471048[_0x66ce('0x57')]['id'],_0x1dd055[_0x4556ae]['id']],'ToId':[_0x471048[_0x66ce('0x57')]['id'],_0x1dd055[_0x4556ae]['id']],'ChatGroupId':null},'attributes':['id',_0x66ce('0x53'),_0x66ce('0x65'),_0x66ce('0x66'),_0x66ce('0x67'),_0x66ce('0x4c')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x66ce('0x2b')](wrapUser(_0x1dd055[_0x4556ae])));}return BPromise[_0x66ce('0x68')](_0x3cab70);}return[];})[_0x66ce('0x2b')](function(_0x2218c8){return{'rows':_0x2218c8,'count':_0x2218c8[_0x66ce('0x3c')]};})[_0x66ce('0x2b')](respondWithResult(_0x5987c0,null))[_0x66ce('0x4f')](handleError(_0x5987c0,null));}; \ No newline at end of file +var _0xe469=['../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','query','keys','model','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','catch','show','fields','length','create','body','find','params','describe','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','userpic','internal','online','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','push','FromId','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2a7697,_0x10f2e0){var _0x482447=function(_0x27b5de){while(--_0x27b5de){_0x2a7697['push'](_0x2a7697['shift']());}};_0x482447(++_0x10f2e0);}(_0xe469,0x192));var _0x9e46=function(_0x19fa06,_0x14dcc6){_0x19fa06=_0x19fa06-0x0;var _0x278075=_0xe469[_0x19fa06];return _0x278075;};'use strict';var emlformat=require(_0x9e46('0x0'));var rimraf=require(_0x9e46('0x1'));var zipdir=require(_0x9e46('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e46('0x3'));var moment=require(_0x9e46('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9e46('0x5'));var util=require(_0x9e46('0x6'));var path=require('path');var sox=require(_0x9e46('0x7'));var csv=require('to-csv');var ejs=require(_0x9e46('0x8'));var fs=require('fs');var fs_extra=require(_0x9e46('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9e46('0xa'));var jsforce=require(_0x9e46('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9e46('0xc'));var Redis=require(_0x9e46('0xd'));var authService=require(_0x9e46('0xe'));var qs=require(_0x9e46('0xf'));var as=require(_0x9e46('0x10'));var hardwareService=require(_0x9e46('0x11'));var logger=require(_0x9e46('0x12'))(_0x9e46('0x13'));var utils=require(_0x9e46('0x14'));var config=require(_0x9e46('0x15'));var licenseUtil=require(_0x9e46('0x16'));var db=require(_0x9e46('0x17'))['db'];config[_0x9e46('0x18')]=_[_0x9e46('0x19')](config[_0x9e46('0x18')],{'host':_0x9e46('0x1a'),'port':0x18eb});var socket=require(_0x9e46('0x1b'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x9e46('0x1c')](socket);function respondWithStatusCode(_0x22ab9c,_0x3ba43b){_0x3ba43b=_0x3ba43b||0xcc;return function(_0x39a769){if(_0x39a769){return _0x22ab9c[_0x9e46('0x1d')](_0x3ba43b);}return _0x22ab9c['status'](_0x3ba43b)[_0x9e46('0x1e')]();};}function respondWithResult(_0xa9e396,_0x1634eb){_0x1634eb=_0x1634eb||0xc8;return function(_0xedb8bc){if(_0xedb8bc){return _0xa9e396[_0x9e46('0x1f')](_0x1634eb)['json'](_0xedb8bc);}};}function respondWithFilteredResult(_0x4685f2,_0xb80fb){return function(_0x548aee){if(_0x548aee){var _0x216384=typeof _0xb80fb['offset']===_0x9e46('0x20')&&typeof _0xb80fb[_0x9e46('0x21')]===_0x9e46('0x20');var _0x37c9d4=_0x548aee[_0x9e46('0x22')];var _0x388619=_0x216384?0x0:_0xb80fb[_0x9e46('0x23')];var _0x487836=_0x216384?_0x548aee[_0x9e46('0x22')]:_0xb80fb[_0x9e46('0x23')]+_0xb80fb[_0x9e46('0x21')];var _0xa2b917;if(_0x487836>=_0x37c9d4){_0x487836=_0x37c9d4;_0xa2b917=0xc8;}else{_0xa2b917=0xce;}_0x4685f2[_0x9e46('0x1f')](_0xa2b917);return _0x4685f2['set'](_0x9e46('0x24'),_0x388619+'-'+_0x487836+'/'+_0x37c9d4)[_0x9e46('0x25')](_0x548aee);}return null;};}function patchUpdates(_0x5e1fa0){return function(_0x5cdb3e){try{jsonpatch[_0x9e46('0x26')](_0x5cdb3e,_0x5e1fa0,!![]);}catch(_0x406bd0){return BPromise[_0x9e46('0x27')](_0x406bd0);}return _0x5cdb3e['save']();};}function saveUpdates(_0x4ef8a3,_0x3fbe30){return function(_0xea2b48){if(_0xea2b48){return _0xea2b48[_0x9e46('0x28')](_0x4ef8a3)['then'](function(_0x25e6db){return _0x25e6db;});}return null;};}function removeEntity(_0x30fb6b,_0x71f416){return function(_0x3810c4){if(_0x3810c4){return _0x3810c4[_0x9e46('0x29')]()[_0x9e46('0x2a')](function(){_0x30fb6b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51aa5e,_0x275710){return function(_0x1024b0){if(!_0x1024b0){_0x51aa5e[_0x9e46('0x1d')](0x194);}return _0x1024b0;};}function handleError(_0x23159d,_0x54fb81){_0x54fb81=_0x54fb81||0x1f4;return function(_0x5e9224){logger[_0x9e46('0x2b')](_0x5e9224[_0x9e46('0x2c')]);if(_0x5e9224['name']){delete _0x5e9224[_0x9e46('0x2d')];}_0x23159d[_0x9e46('0x1f')](_0x54fb81)[_0x9e46('0x2e')](_0x5e9224);};}exports[_0x9e46('0x2f')]=function(_0x4882a5,_0x2a4e13){var _0x1bdedf={},_0x339cd3={},_0x55cce1={'count':0x0,'rows':[]};var _0x58a5b4=_[_0x9e46('0x30')](db['ChatInternalMessage'][_0x9e46('0x31')],function(_0x12c332){return{'name':_0x12c332['fieldName'],'type':_0x12c332[_0x9e46('0x32')]['key']};});_0x339cd3['model']=_[_0x9e46('0x30')](_0x58a5b4,_0x9e46('0x2d'));_0x339cd3[_0x9e46('0x33')]=_[_0x9e46('0x34')](_0x4882a5[_0x9e46('0x33')]);_0x339cd3['filters']=_['intersection'](_0x339cd3[_0x9e46('0x35')],_0x339cd3[_0x9e46('0x33')]);_0x1bdedf[_0x9e46('0x36')]=_[_0x9e46('0x37')](_0x339cd3[_0x9e46('0x35')],qs['fields'](_0x4882a5[_0x9e46('0x33')]['fields']));_0x1bdedf[_0x9e46('0x36')]=_0x1bdedf[_0x9e46('0x36')]['length']?_0x1bdedf[_0x9e46('0x36')]:_0x339cd3[_0x9e46('0x35')];if(!_0x4882a5[_0x9e46('0x33')][_0x9e46('0x38')](_0x9e46('0x39'))){_0x1bdedf[_0x9e46('0x21')]=qs['limit'](_0x4882a5['query'][_0x9e46('0x21')]);_0x1bdedf[_0x9e46('0x23')]=qs[_0x9e46('0x23')](_0x4882a5[_0x9e46('0x33')][_0x9e46('0x23')]);}_0x1bdedf[_0x9e46('0x3a')]=qs['sort'](_0x4882a5[_0x9e46('0x33')][_0x9e46('0x3b')]);_0x1bdedf[_0x9e46('0x3c')]=qs[_0x9e46('0x3d')](_[_0x9e46('0x3e')](_0x4882a5[_0x9e46('0x33')],_0x339cd3[_0x9e46('0x3d')]),_0x58a5b4);if(_0x4882a5['query'][_0x9e46('0x3f')]){_0x1bdedf[_0x9e46('0x3c')]=_['merge'](_0x1bdedf[_0x9e46('0x3c')],{'$or':_[_0x9e46('0x30')](_0x58a5b4,function(_0x2b650d){if(_0x2b650d['type']!==_0x9e46('0x40')){var _0x5349da={};_0x5349da[_0x2b650d[_0x9e46('0x2d')]]={'$like':'%'+_0x4882a5['query'][_0x9e46('0x3f')]+'%'};return _0x5349da;}})});}_0x1bdedf=_['merge']({},_0x1bdedf,_0x4882a5[_0x9e46('0x41')]);var _0x3bd2d4={'where':_0x1bdedf[_0x9e46('0x3c')]};return db[_0x9e46('0x42')][_0x9e46('0x22')](_0x3bd2d4)[_0x9e46('0x2a')](function(_0x2dfa47){_0x55cce1[_0x9e46('0x22')]=_0x2dfa47;if(_0x4882a5[_0x9e46('0x33')][_0x9e46('0x43')]){_0x1bdedf[_0x9e46('0x44')]=[{'all':!![]}];}return db[_0x9e46('0x42')][_0x9e46('0x45')](_0x1bdedf);})[_0x9e46('0x2a')](function(_0x1600ab){_0x55cce1['rows']=_0x1600ab;return _0x55cce1;})['then'](respondWithFilteredResult(_0x2a4e13,_0x1bdedf))[_0x9e46('0x46')](handleError(_0x2a4e13,null));};exports[_0x9e46('0x47')]=function(_0x32c3a7,_0x46e0c9){var _0x136117={'raw':!![],'where':{'id':_0x32c3a7['params']['id']}},_0xaea126={};_0xaea126[_0x9e46('0x35')]=_[_0x9e46('0x34')](db[_0x9e46('0x42')][_0x9e46('0x31')]);_0xaea126[_0x9e46('0x33')]=_['keys'](_0x32c3a7[_0x9e46('0x33')]);_0xaea126[_0x9e46('0x3d')]=_[_0x9e46('0x37')](_0xaea126[_0x9e46('0x35')],_0xaea126[_0x9e46('0x33')]);_0x136117['attributes']=_['intersection'](_0xaea126['model'],qs[_0x9e46('0x48')](_0x32c3a7[_0x9e46('0x33')]['fields']));_0x136117[_0x9e46('0x36')]=_0x136117[_0x9e46('0x36')][_0x9e46('0x49')]?_0x136117[_0x9e46('0x36')]:_0xaea126[_0x9e46('0x35')];if(_0x32c3a7['query'][_0x9e46('0x43')]){_0x136117[_0x9e46('0x44')]=[{'all':!![]}];}_0x136117=_['merge']({},_0x136117,_0x32c3a7['options']);return db['ChatInternalMessage']['find'](_0x136117)[_0x9e46('0x2a')](handleEntityNotFound(_0x46e0c9,null))[_0x9e46('0x2a')](respondWithResult(_0x46e0c9,null))[_0x9e46('0x46')](handleError(_0x46e0c9,null));};exports[_0x9e46('0x4a')]=function(_0x1e8bcb,_0x55ee19){return db[_0x9e46('0x42')]['create'](_0x1e8bcb[_0x9e46('0x4b')],{})[_0x9e46('0x2a')](respondWithResult(_0x55ee19,0xc9))['catch'](handleError(_0x55ee19,null));};exports[_0x9e46('0x28')]=function(_0x5e3c30,_0x8cc428){if(_0x5e3c30[_0x9e46('0x4b')]['id']){delete _0x5e3c30['body']['id'];}return db[_0x9e46('0x42')][_0x9e46('0x4c')]({'where':{'id':_0x5e3c30['params']['id']}})['then'](handleEntityNotFound(_0x8cc428,null))[_0x9e46('0x2a')](saveUpdates(_0x5e3c30[_0x9e46('0x4b')],null))[_0x9e46('0x2a')](respondWithResult(_0x8cc428,null))[_0x9e46('0x46')](handleError(_0x8cc428,null));};exports['destroy']=function(_0x4ca1ae,_0x5df594){return db['ChatInternalMessage'][_0x9e46('0x4c')]({'where':{'id':_0x4ca1ae[_0x9e46('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5df594,null))[_0x9e46('0x2a')](removeEntity(_0x5df594,null))[_0x9e46('0x46')](handleError(_0x5df594,null));};exports[_0x9e46('0x4e')]=function(_0x193b54,_0x2e0f72){return db['ChatInternalMessage'][_0x9e46('0x4e')]()['then'](respondWithResult(_0x2e0f72,null))[_0x9e46('0x46')](handleError(_0x2e0f72,null));};function wrapUser(_0x52c0c0){return function(_0x2d45a3){var _0x150737=_0x52c0c0['get']({'plain':!![]});_0x150737[_0x9e46('0x4f')]=[];if(_0x2d45a3){_0x150737[_0x9e46('0x50')]=_0x2d45a3[_0x9e46('0x51')];_0x150737[_0x9e46('0x52')]=_0x2d45a3;}else{_0x150737[_0x9e46('0x50')]=moment(0x0)['format'](_0x9e46('0x53'));_0x150737[_0x9e46('0x52')]={};}return _0x150737;};}exports[_0x9e46('0x54')]=function(_0x526a7e,_0x36b0b1,_0x2e2f56){var _0x571aa8=[];return db[_0x9e46('0x55')][_0x9e46('0x45')]({'where':{'role':['agent',_0x9e46('0x56'),_0x9e46('0x57')]},'attributes':['id','fullname',_0x9e46('0x2d'),'role',_0x9e46('0x58'),_0x9e46('0x59'),_0x9e46('0x5a'),'lastLoginAt','allowmessenger','showWebBar'],'order':qs[_0x9e46('0x3b')](_0x9e46('0x5b')),'include':[{'model':db[_0x9e46('0x5c')],'as':'VoiceQueues','attributes':['id','name',_0x9e46('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x1079da){if(_0x1079da){var _0x32dad1=_0x526a7e[_0x9e46('0x57')]['get']({'plain':!![]});if(!_0x32dad1)throw new Error(_0x9e46('0x5d'));if(_0x32dad1[_0x9e46('0x5e')]===_0x9e46('0x57')){return db[_0x9e46('0x5f')][_0x9e46('0x4c')]({'where':{'name':_0x9e46('0x60'),'userProfileId':_0x32dad1[_0x9e46('0x61')]},'raw':!![]})[_0x9e46('0x2a')](function(_0xca9cc9){if(_0xca9cc9){if(_0xca9cc9[_0x9e46('0x62')]===0x0){return db[_0x9e46('0x63')][_0x9e46('0x45')]({'where':{'sectionId':_0xca9cc9['id']},'raw':!![]})[_0x9e46('0x2a')](function(_0x511177){var _0x544a6f=[];if(_[_0x9e46('0x64')](_0x511177)){_0x544a6f=_[_0x9e46('0x3f')](_0x1079da,function(_0x286995){if(_0x286995[_0x9e46('0x5e')]!==_0x9e46('0x65')){return _0x286995;}});return _0x544a6f;}else{for(var _0xdf8d43=0x0;_0xdf8d43<_0x1079da[_0x9e46('0x49')];_0xdf8d43++){var _0x316069=_0x1079da[_0xdf8d43];if(_0x316069[_0x9e46('0x5e')]===_0x9e46('0x65')){var _0x5a4933=_[_0x9e46('0x4c')](_0x511177,function(_0x59332b){return _0x59332b['resourceId']===_0x316069['id'];});if(_0x5a4933)_0x544a6f[_0x9e46('0x66')](_0x316069);}else{_0x544a6f[_0x9e46('0x66')](_0x316069);}}return _0x544a6f;}});}else{return _0x1079da;}}else{var _0x5de495=_[_0x9e46('0x3f')](_0x1079da,function(_0x20a79b){if(_0x20a79b[_0x9e46('0x5e')]!==_0x9e46('0x65')){return _0x20a79b;}});return _0x5de495;}});}else{return _0x1079da;}}})[_0x9e46('0x2a')](function(_0x58d254){var _0x5b5263=[];if(_0x58d254){_0x571aa8=_0x58d254;for(var _0x5efcb5=0x0;_0x5efcb5<_0x58d254['length'];_0x5efcb5+=0x1){_0x571aa8[_0x5efcb5][_0x9e46('0x4f')]=[];_0x5b5263[_0x9e46('0x66')](db[_0x9e46('0x42')]['find']({'where':{'FromId':[_0x526a7e[_0x9e46('0x57')]['id'],_0x58d254[_0x5efcb5]['id']],'ToId':[_0x526a7e[_0x9e46('0x57')]['id'],_0x58d254[_0x5efcb5]['id']],'ChatGroupId':null},'attributes':['id',_0x9e46('0x51'),_0x9e46('0x67'),'ToId','read',_0x9e46('0x4b')],'order':qs[_0x9e46('0x3b')](_0x9e46('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9e46('0x2a')](wrapUser(_0x58d254[_0x5efcb5])));}return BPromise[_0x9e46('0x69')](_0x5b5263);}return[];})['then'](function(_0x3b0ebb){return{'rows':_0x3b0ebb,'count':_0x3b0ebb[_0x9e46('0x49')]};})['then'](respondWithResult(_0x36b0b1,null))['catch'](handleError(_0x36b0b1,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index a8e1f95..317da41 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 _0x7eca=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x3b8a89,_0x1ad92b){var _0x3ca0e5=function(_0x1a4136){while(--_0x1a4136){_0x3b8a89['push'](_0x3b8a89['shift']());}};_0x3ca0e5(++_0x1ad92b);}(_0x7eca,0x1ba));var _0xa7ec=function(_0x522251,_0x5606eb){_0x522251=_0x522251-0x0;var _0x4fc802=_0x7eca[_0x522251];return _0x4fc802;};'use strict';var EventEmitter=require(_0xa7ec('0x0'));var ChatInternalMessage=require(_0xa7ec('0x1'))['db'][_0xa7ec('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa7ec('0x3')](0x0);var events={'afterCreate':_0xa7ec('0x4'),'afterUpdate':_0xa7ec('0x5'),'afterDestroy':_0xa7ec('0x6')};function emitEvent(_0x55d909){return function(_0x3c37cf,_0x3aab25,_0x1fe689){ChatInternalMessageEvents[_0xa7ec('0x7')](_0x55d909+':'+_0x3c37cf['id'],_0x3c37cf);ChatInternalMessageEvents['emit'](_0x55d909,_0x3c37cf);_0x1fe689(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xa7ec('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x1c52=['ChatInternalMessage','setMaxListeners','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x1c52,0x7c));var _0x21c5=function(_0x4efaca,_0x32d07e){_0x4efaca=_0x4efaca-0x0;var _0x5370e3=_0x1c52[_0x4efaca];return _0x5370e3;};'use strict';var EventEmitter=require(_0x21c5('0x0'));var ChatInternalMessage=require(_0x21c5('0x1'))['db'][_0x21c5('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x21c5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x26e3eb){return function(_0x67781f,_0x5374cd,_0x13c1a9){ChatInternalMessageEvents[_0x21c5('0x4')](_0x26e3eb+':'+_0x67781f['id'],_0x67781f);ChatInternalMessageEvents[_0x21c5('0x4')](_0x26e3eb,_0x67781f);_0x13c1a9(null);};}for(var e in events){if(events[_0x21c5('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x21c5('0x6')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 5262ebc..28b82b1 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 _0x39c0=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird'];(function(_0x3e1415,_0x2ad5ee){var _0x2e1ec7=function(_0x4beb31){while(--_0x4beb31){_0x3e1415['push'](_0x3e1415['shift']());}};_0x2e1ec7(++_0x2ad5ee);}(_0x39c0,0x14c));var _0x039c=function(_0x267923,_0x1f1a68){_0x267923=_0x267923-0x0;var _0x2e6dc0=_0x39c0[_0x267923];return _0x2e6dc0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x039c('0x0'))(_0x039c('0x1'));var moment=require(_0x039c('0x2'));var BPromise=require(_0x039c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x039c('0x4'));var rimraf=require(_0x039c('0x5'));var config=require(_0x039c('0x6'));var attributes=require(_0x039c('0x7'));module[_0x039c('0x8')]=function(_0x4fa0ad,_0x1391b2){return _0x4fa0ad['define'](_0x039c('0x9'),attributes,{'tableName':_0x039c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x039c('0xb')});}; \ No newline at end of file +var _0x61aa=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','path','../../config/environment','exports','define','ChatInternalMessage'];(function(_0x2ec856,_0x157e2a){var _0x47f91b=function(_0x6a6b9c){while(--_0x6a6b9c){_0x2ec856['push'](_0x2ec856['shift']());}};_0x47f91b(++_0x157e2a);}(_0x61aa,0x153));var _0xa61a=function(_0x15e130,_0x23c206){_0x15e130=_0x15e130-0x0;var _0x386e77=_0x61aa[_0x15e130];return _0x386e77;};'use strict';var _=require('lodash');var util=require(_0xa61a('0x0'));var logger=require('../../config/logger')(_0xa61a('0x1'));var moment=require(_0xa61a('0x2'));var BPromise=require(_0xa61a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa61a('0x4'));var rimraf=require('rimraf');var config=require(_0xa61a('0x5'));var attributes=require('./chatInternalMessage.attributes');module[_0xa61a('0x6')]=function(_0x259520,_0x3af15d){return _0x259520[_0xa61a('0x7')](_0xa61a('0x8'),attributes,{'tableName':_0xa61a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa61a('0xa'),'collate':_0xa61a('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 6d02a89..1a0d2e5 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 _0x465c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0xaec179,_0x25e560){var _0x48c8f7=function(_0x90bdd9){while(--_0x90bdd9){_0xaec179['push'](_0xaec179['shift']());}};_0x48c8f7(++_0x25e560);}(_0x465c,0x1ae));var _0xc465=function(_0x40680c,_0x3b6297){_0x40680c=_0x40680c-0x0;var _0x4e6ac5=_0x465c[_0x40680c];return _0x4e6ac5;};'use strict';var _=require(_0xc465('0x0'));var util=require(_0xc465('0x1'));var moment=require('moment');var BPromise=require(_0xc465('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc465('0x3'))['db'];var utils=require(_0xc465('0x4'));var logger=require(_0xc465('0x5'))(_0xc465('0x6'));var config=require(_0xc465('0x7'));var jayson=require(_0xc465('0x8'));var client=jayson[_0xc465('0x9')][_0xc465('0xa')]({'port':0x232a});config[_0xc465('0xb')]=_[_0xc465('0xc')](config[_0xc465('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc465('0xd'))(new Redis(config[_0xc465('0xb')]));require(_0xc465('0xe'))[_0xc465('0xf')](socket);function respondWithRpcPromise(_0x53e607,_0x1fecb0,_0x42a6d0){return new BPromise(function(_0x14a426,_0x3f1287){return client[_0xc465('0x10')](_0x53e607,_0x42a6d0)[_0xc465('0x11')](function(_0x15250a){logger[_0xc465('0x12')](_0xc465('0x13'),_0x1fecb0,'request\x20sent');logger[_0xc465('0x14')](_0xc465('0x15'),_0x1fecb0,_0xc465('0x16'),JSON[_0xc465('0x17')](_0x15250a));if(_0x15250a[_0xc465('0x18')]){if(_0x15250a[_0xc465('0x18')][_0xc465('0x19')]===0x1f4){logger['error'](_0xc465('0x13'),_0x1fecb0,_0x15250a[_0xc465('0x18')][_0xc465('0x1a')]);return _0x3f1287(_0x15250a['error'][_0xc465('0x1a')]);}logger['error'](_0xc465('0x13'),_0x1fecb0,_0x15250a[_0xc465('0x18')][_0xc465('0x1a')]);return _0x14a426(_0x15250a[_0xc465('0x18')][_0xc465('0x1a')]);}else{logger[_0xc465('0x12')](_0xc465('0x13'),_0x1fecb0,_0xc465('0x16'));_0x14a426(_0x15250a[_0xc465('0x1b')][_0xc465('0x1a')]);}})[_0xc465('0x1c')](function(_0x39365b){logger[_0xc465('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x1fecb0,_0x39365b);_0x3f1287(_0x39365b);});});} \ No newline at end of file +var _0x5936=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info'];(function(_0x65c903,_0x41e920){var _0x23e1d7=function(_0x4279cd){while(--_0x4279cd){_0x65c903['push'](_0x65c903['shift']());}};_0x23e1d7(++_0x41e920);}(_0x5936,0x6a));var _0x6593=function(_0x21058e,_0x2e459f){_0x21058e=_0x21058e-0x0;var _0x3dc64d=_0x5936[_0x21058e];return _0x3dc64d;};'use strict';var _=require(_0x6593('0x0'));var util=require(_0x6593('0x1'));var moment=require(_0x6593('0x2'));var BPromise=require(_0x6593('0x3'));var rs=require(_0x6593('0x4'));var fs=require('fs');var Redis=require(_0x6593('0x5'));var db=require(_0x6593('0x6'))['db'];var utils=require(_0x6593('0x7'));var logger=require(_0x6593('0x8'))('rpc');var config=require(_0x6593('0x9'));var jayson=require(_0x6593('0xa'));var client=jayson[_0x6593('0xb')][_0x6593('0xc')]({'port':0x232a});config[_0x6593('0xd')]=_[_0x6593('0xe')](config[_0x6593('0xd')],{'host':_0x6593('0xf'),'port':0x18eb});var socket=require(_0x6593('0x10'))(new Redis(config[_0x6593('0xd')]));require(_0x6593('0x11'))[_0x6593('0x12')](socket);function respondWithRpcPromise(_0x1a4ea6,_0x1464d0,_0x14dd2b){return new BPromise(function(_0x4894ea,_0x59bcd4){return client[_0x6593('0x13')](_0x1a4ea6,_0x14dd2b)[_0x6593('0x14')](function(_0x1f79bb){logger[_0x6593('0x15')](_0x6593('0x16'),_0x1464d0,_0x6593('0x17'));logger[_0x6593('0x18')](_0x6593('0x19'),_0x1464d0,'request\x20sent',JSON[_0x6593('0x1a')](_0x1f79bb));if(_0x1f79bb[_0x6593('0x1b')]){if(_0x1f79bb[_0x6593('0x1b')][_0x6593('0x1c')]===0x1f4){logger[_0x6593('0x1b')](_0x6593('0x16'),_0x1464d0,_0x1f79bb[_0x6593('0x1b')][_0x6593('0x1d')]);return _0x59bcd4(_0x1f79bb['error'][_0x6593('0x1d')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x1464d0,_0x1f79bb[_0x6593('0x1b')][_0x6593('0x1d')]);return _0x4894ea(_0x1f79bb[_0x6593('0x1b')][_0x6593('0x1d')]);}else{logger[_0x6593('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x1464d0,'request\x20sent');_0x4894ea(_0x1f79bb[_0x6593('0x1e')]['message']);}})[_0x6593('0x1f')](function(_0x6c4acf){logger[_0x6593('0x1b')](_0x6593('0x16'),_0x1464d0,_0x6c4acf);_0x59bcd4(_0x6c4acf);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 32de680..53fbc40 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 _0x938b=['./chatInternalMessage.events','save','update','removeListener','register','length','chatInternalMessage:'];(function(_0x117b4b,_0x5168fe){var _0x5c7e57=function(_0x177727){while(--_0x177727){_0x117b4b['push'](_0x117b4b['shift']());}};_0x5c7e57(++_0x5168fe);}(_0x938b,0x142));var _0xb938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938b[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0xb938('0x0'));var events=[_0xb938('0x1'),'remove',_0xb938('0x2')];function createListener(_0x28a95c,_0x47b7ab){return function(_0xa300c7){_0x47b7ab['emit'](_0x28a95c,_0xa300c7);};}function removeListener(_0x362a41,_0x46eacf){return function(){ChatInternalMessageEvents[_0xb938('0x3')](_0x362a41,_0x46eacf);};}exports[_0xb938('0x4')]=function(_0x2d1199){for(var _0xf26fd6=0x0,_0x5d8ca3=events[_0xb938('0x5')];_0xf26fd6<_0x5d8ca3;_0xf26fd6++){var _0x5d35b4=events[_0xf26fd6];var _0x5bce6b=createListener(_0xb938('0x6')+_0x5d35b4,_0x2d1199);ChatInternalMessageEvents['on'](_0x5d35b4,_0x5bce6b);}}; \ No newline at end of file +var _0x3750=['chatInternalMessage:','save','emit','removeListener','length'];(function(_0x1f1688,_0x1a9c06){var _0x56faf5=function(_0xd98d7e){while(--_0xd98d7e){_0x1f1688['push'](_0x1f1688['shift']());}};_0x56faf5(++_0x1a9c06);}(_0x3750,0x100));var _0x0375=function(_0x45e647,_0x2c482c){_0x45e647=_0x45e647-0x0;var _0x2deace=_0x3750[_0x45e647];return _0x2deace;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x0375('0x0'),'remove','update'];function createListener(_0x3ff325,_0x33810a){return function(_0x34d007){_0x33810a[_0x0375('0x1')](_0x3ff325,_0x34d007);};}function removeListener(_0x1d09cc,_0x3f9e81){return function(){ChatInternalMessageEvents[_0x0375('0x2')](_0x1d09cc,_0x3f9e81);};}exports['register']=function(_0x4d0521){for(var _0x524aee=0x0,_0x5b6d77=events[_0x0375('0x3')];_0x524aee<_0x5b6d77;_0x524aee++){var _0x39c88f=events[_0x524aee];var _0x48505c=createListener(_0x0375('0x4')+_0x39c88f,_0x4d0521);ChatInternalMessageEvents['on'](_0x39c88f,_0x48505c);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 7c6830e..f43d740 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 _0x7de4=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','describe','/users','getUsers','get','/:id','show','create','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7de4,0x16a));var _0x47de=function(_0x3fe111,_0x4b34f7){_0x3fe111=_0x3fe111-0x0;var _0x82f9fb=_0x7de4[_0x3fe111];return _0x82f9fb;};'use strict';var multer=require(_0x47de('0x0'));var util=require(_0x47de('0x1'));var path=require(_0x47de('0x2'));var timeout=require(_0x47de('0x3'));var express=require(_0x47de('0x4'));var router=express[_0x47de('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x47de('0x6'));var controller=require(_0x47de('0x7'));router['get']('/',auth[_0x47de('0x8')](),controller[_0x47de('0x9')]);router['get']('/describe',auth[_0x47de('0x8')](),controller[_0x47de('0xa')]);router['get'](_0x47de('0xb'),auth[_0x47de('0x8')](),controller[_0x47de('0xc')]);router[_0x47de('0xd')](_0x47de('0xe'),auth[_0x47de('0x8')](),controller[_0x47de('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x47de('0x10')]);router['put'](_0x47de('0xe'),controller[_0x47de('0x11')]);router['delete']('/:id',auth[_0x47de('0x8')](),controller[_0x47de('0x12')]);module[_0x47de('0x13')]=router; \ No newline at end of file +var _0x0ea2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','show','post','create','put','/:id','exports','util','path'];(function(_0x494159,_0xd8033f){var _0x23e6ab=function(_0x1054d1){while(--_0x1054d1){_0x494159['push'](_0x494159['shift']());}};_0x23e6ab(++_0xd8033f);}(_0x0ea2,0x102));var _0x20ea=function(_0x4557dc,_0x3687b2){_0x4557dc=_0x4557dc-0x0;var _0x1377aa=_0x0ea2[_0x4557dc];return _0x1377aa;};'use strict';var multer=require('multer');var util=require(_0x20ea('0x0'));var path=require(_0x20ea('0x1'));var timeout=require(_0x20ea('0x2'));var express=require(_0x20ea('0x3'));var router=express[_0x20ea('0x4')]();var fs_extra=require(_0x20ea('0x5'));var auth=require(_0x20ea('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x20ea('0x7'));var controller=require(_0x20ea('0x8'));router[_0x20ea('0x9')]('/',auth[_0x20ea('0xa')](),controller[_0x20ea('0xb')]);router[_0x20ea('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x20ea('0xc')]);router[_0x20ea('0x9')](_0x20ea('0xd'),auth['isAuthenticated'](),controller['getUsers']);router[_0x20ea('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x20ea('0xe')]);router[_0x20ea('0xf')]('/',auth[_0x20ea('0xa')](),controller[_0x20ea('0x10')]);router[_0x20ea('0x11')](_0x20ea('0x12'),controller['update']);router['delete'](_0x20ea('0x12'),auth[_0x20ea('0xa')](),controller['destroy']);module[_0x20ea('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index fe28433..2a80584 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 _0x0bb4=['sequelize','exports','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x387c60,_0x20cfff){var _0x1f738f=function(_0x400243){while(--_0x400243){_0x387c60['push'](_0x387c60['shift']());}};_0x1f738f(++_0x20cfff);}(_0x0bb4,0x77));var _0x40bb=function(_0x14ba82,_0x2725a6){_0x14ba82=_0x14ba82-0x0;var _0x42b676=_0x0bb4[_0x14ba82];return _0x42b676;};'use strict';var Sequelize=require(_0x40bb('0x0'));module[_0x40bb('0x1')]={'body':{'type':Sequelize['TEXT'](_0x40bb('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x40bb('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x40bb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x40bb('0x4')]('in','out'),'defaultValue':_0x40bb('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x40bb('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x48ac=['exports','medium','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x1203bc,_0x53ab7b){var _0x5a04b2=function(_0x334b95){while(--_0x334b95){_0x1203bc['push'](_0x1203bc['shift']());}};_0x5a04b2(++_0x53ab7b);}(_0x48ac,0xe0));var _0xc48a=function(_0x4df649,_0xf24dd7){_0x4df649=_0x4df649-0x0;var _0x5c0952=_0x48ac[_0x4df649];return _0x5c0952;};'use strict';var Sequelize=require('sequelize');module[_0xc48a('0x0')]={'body':{'type':Sequelize['TEXT'](_0xc48a('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xc48a('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc48a('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc48a('0x3')),'defaultValue':_0xc48a('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc48a('0x4')]},'providerName':{'type':Sequelize[_0xc48a('0x5')]},'providerResponse':{'type':Sequelize[_0xc48a('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index c48026a..99ba66d 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 _0x3596=['internal','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','contact','interface','event','rejectmessage','parse','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','register','jayson/promise','http','client','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','ChatMessage','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','rows','show','params','rawAttributes','length','include','options','find','create','body','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','User','fullname','email'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x3596,0x122));var _0x6359=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x3596[_0x1beef3];return _0x5af964;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6359('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6359('0x1'));var rp=require(_0x6359('0x2'));var moment=require(_0x6359('0x3'));var BPromise=require(_0x6359('0x4'));var Mustache=require(_0x6359('0x5'));var util=require(_0x6359('0x6'));var path=require('path');var sox=require(_0x6359('0x7'));var csv=require('to-csv');var ejs=require(_0x6359('0x8'));var fs=require('fs');var fs_extra=require(_0x6359('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6359('0xa'));var jsforce=require(_0x6359('0xb'));var deskjs=require(_0x6359('0xc'));var toCsv=require(_0x6359('0xd'));var querystring=require('querystring');var Papa=require(_0x6359('0xe'));var Redis=require(_0x6359('0xf'));var authService=require(_0x6359('0x10'));var qs=require(_0x6359('0x11'));var as=require(_0x6359('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6359('0x13'))(_0x6359('0x14'));var utils=require(_0x6359('0x15'));var config=require(_0x6359('0x16'));var licenseUtil=require(_0x6359('0x17'));var db=require(_0x6359('0x18'))['db'];config['redis']=_[_0x6359('0x19')](config[_0x6359('0x1a')],{'host':_0x6359('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6359('0x1a')]));require(_0x6359('0x1c'))[_0x6359('0x1d')](socket);var jayson=require(_0x6359('0x1e'));var client=jayson['client'][_0x6359('0x1f')]({'port':0x232c});var client9002=jayson[_0x6359('0x20')][_0x6359('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5c652b,_0x1e2cd8,_0x93bac8,_0x545fb1){return new BPromise(function(_0x19a63b,_0x184031){var _0x330367=_0x545fb1||client;return _0x330367[_0x6359('0x21')](_0x5c652b,_0x93bac8)[_0x6359('0x22')](function(_0x1fc23a){logger['info'](_0x6359('0x23'),_0x1e2cd8,_0x6359('0x24'));logger[_0x6359('0x25')](_0x6359('0x26'),_0x1e2cd8,_0x6359('0x24'),JSON[_0x6359('0x27')](_0x1fc23a));if(_0x1fc23a['error']){if(_0x1fc23a[_0x6359('0x28')][_0x6359('0x29')]===0x1f4){logger['error'](_0x6359('0x23'),_0x1e2cd8,_0x1fc23a[_0x6359('0x28')][_0x6359('0x2a')]);return _0x184031(_0x1fc23a[_0x6359('0x28')][_0x6359('0x2a')]);}logger['error'](_0x6359('0x23'),_0x1e2cd8,_0x1fc23a[_0x6359('0x28')][_0x6359('0x2a')]);return _0x19a63b(_0x1fc23a['error'][_0x6359('0x2a')]);}else{logger[_0x6359('0x2b')](_0x6359('0x23'),_0x1e2cd8,_0x6359('0x24'));_0x19a63b(_0x1fc23a['result']['message']);}})[_0x6359('0x2c')](function(_0x2a071b){logger[_0x6359('0x28')](_0x6359('0x23'),_0x1e2cd8,_0x2a071b);_0x184031(_0x2a071b);});});}function respondWithStatusCode(_0x1f7635,_0x5b84f4){_0x5b84f4=_0x5b84f4||0xcc;return function(_0x47a10c){if(_0x47a10c){return _0x1f7635['sendStatus'](_0x5b84f4);}return _0x1f7635[_0x6359('0x2d')](_0x5b84f4)[_0x6359('0x2e')]();};}function respondWithResult(_0x3ca5ab,_0x16a37f){_0x16a37f=_0x16a37f||0xc8;return function(_0x290cc0){if(_0x290cc0){return _0x3ca5ab['status'](_0x16a37f)[_0x6359('0x2f')](_0x290cc0);}};}function respondWithFilteredResult(_0x265275,_0x45a8c3){return function(_0x167f3d){if(_0x167f3d){var _0xe5d114=typeof _0x45a8c3[_0x6359('0x30')]==='undefined'&&typeof _0x45a8c3[_0x6359('0x31')]===_0x6359('0x32');var _0x803d2=_0x167f3d[_0x6359('0x33')];var _0x594406=_0xe5d114?0x0:_0x45a8c3['offset'];var _0x33f126=_0xe5d114?_0x167f3d['count']:_0x45a8c3[_0x6359('0x30')]+_0x45a8c3['limit'];var _0x19ebca;if(_0x33f126>=_0x803d2){_0x33f126=_0x803d2;_0x19ebca=0xc8;}else{_0x19ebca=0xce;}_0x265275[_0x6359('0x2d')](_0x19ebca);return _0x265275[_0x6359('0x34')](_0x6359('0x35'),_0x594406+'-'+_0x33f126+'/'+_0x803d2)[_0x6359('0x2f')](_0x167f3d);}return null;};}function patchUpdates(_0xfed7e6){return function(_0x3eb5e7){try{jsonpatch[_0x6359('0x36')](_0x3eb5e7,_0xfed7e6,!![]);}catch(_0x41078f){return BPromise[_0x6359('0x37')](_0x41078f);}return _0x3eb5e7[_0x6359('0x38')]();};}function saveUpdates(_0x4894a6,_0x4a2a7f){return function(_0xfa6c25){if(_0xfa6c25){return _0xfa6c25[_0x6359('0x39')](_0x4894a6)[_0x6359('0x22')](function(_0x1d66e6){return _0x1d66e6;});}return null;};}function removeEntity(_0x26c3e9,_0xbafef6){return function(_0x4c8a1c){if(_0x4c8a1c){return _0x4c8a1c[_0x6359('0x3a')]()[_0x6359('0x22')](function(){_0x26c3e9['status'](0xcc)[_0x6359('0x2e')]();});}};}function handleEntityNotFound(_0x3d80d9,_0x35eccb){return function(_0x2bd0d0){if(!_0x2bd0d0){_0x3d80d9[_0x6359('0x3b')](0x194);}return _0x2bd0d0;};}function handleError(_0x22bb40,_0x3e7245){_0x3e7245=_0x3e7245||0x1f4;return function(_0x1f0cd4){logger['error'](_0x1f0cd4[_0x6359('0x3c')]);if(_0x1f0cd4['name']){delete _0x1f0cd4[_0x6359('0x3d')];}_0x22bb40[_0x6359('0x2d')](_0x3e7245)[_0x6359('0x3e')](_0x1f0cd4);};}exports[_0x6359('0x3f')]=function(_0x2afc0c,_0x41910e){var _0x2aacc0={},_0x585998={},_0x575f55={'count':0x0,'rows':[]};var _0x2bbaf8=_[_0x6359('0x40')](db[_0x6359('0x41')]['rawAttributes'],function(_0x3a5d05){return{'name':_0x3a5d05['fieldName'],'type':_0x3a5d05[_0x6359('0x42')][_0x6359('0x43')]};});_0x585998[_0x6359('0x44')]=_[_0x6359('0x40')](_0x2bbaf8,'name');_0x585998[_0x6359('0x45')]=_[_0x6359('0x46')](_0x2afc0c[_0x6359('0x45')]);_0x585998[_0x6359('0x47')]=_[_0x6359('0x48')](_0x585998[_0x6359('0x44')],_0x585998[_0x6359('0x45')]);_0x2aacc0['attributes']=_[_0x6359('0x48')](_0x585998[_0x6359('0x44')],qs['fields'](_0x2afc0c['query'][_0x6359('0x49')]));_0x2aacc0[_0x6359('0x4a')]=_0x2aacc0[_0x6359('0x4a')]['length']?_0x2aacc0[_0x6359('0x4a')]:_0x585998[_0x6359('0x44')];if(!_0x2afc0c[_0x6359('0x45')][_0x6359('0x4b')](_0x6359('0x4c'))){_0x2aacc0[_0x6359('0x31')]=qs[_0x6359('0x31')](_0x2afc0c[_0x6359('0x45')][_0x6359('0x31')]);_0x2aacc0[_0x6359('0x30')]=qs[_0x6359('0x30')](_0x2afc0c[_0x6359('0x45')]['offset']);}_0x2aacc0[_0x6359('0x4d')]=qs[_0x6359('0x4e')](_0x2afc0c[_0x6359('0x45')]['sort']);_0x2aacc0[_0x6359('0x4f')]=qs['filters'](_[_0x6359('0x50')](_0x2afc0c[_0x6359('0x45')],_0x585998[_0x6359('0x47')]),_0x2bbaf8);if(_0x2afc0c[_0x6359('0x45')]['filter']){_0x2aacc0[_0x6359('0x4f')]=_[_0x6359('0x51')](_0x2aacc0[_0x6359('0x4f')],{'$or':_['map'](_0x2bbaf8,function(_0x5a005e){if(_0x5a005e[_0x6359('0x42')]!==_0x6359('0x52')){var _0x3014c7={};_0x3014c7[_0x5a005e[_0x6359('0x3d')]]={'$like':'%'+_0x2afc0c[_0x6359('0x45')][_0x6359('0x53')]+'%'};return _0x3014c7;}})});}_0x2aacc0=_[_0x6359('0x51')]({},_0x2aacc0,_0x2afc0c['options']);var _0x2b9dcb={'where':_0x2aacc0[_0x6359('0x4f')]};return db[_0x6359('0x41')][_0x6359('0x33')](_0x2b9dcb)[_0x6359('0x22')](function(_0x21a7d7){_0x575f55[_0x6359('0x33')]=_0x21a7d7;if(_0x2afc0c[_0x6359('0x45')][_0x6359('0x54')]){_0x2aacc0['include']=[{'all':!![]}];}return db[_0x6359('0x41')]['findAll'](_0x2aacc0);})[_0x6359('0x22')](function(_0x431062){_0x575f55[_0x6359('0x55')]=_0x431062;return _0x575f55;})[_0x6359('0x22')](respondWithFilteredResult(_0x41910e,_0x2aacc0))[_0x6359('0x2c')](handleError(_0x41910e,null));};exports[_0x6359('0x56')]=function(_0xde33ea,_0x3c97fd){var _0x15cbab={'raw':!![],'where':{'id':_0xde33ea[_0x6359('0x57')]['id']}},_0x1b79f9={};_0x1b79f9[_0x6359('0x44')]=_[_0x6359('0x46')](db[_0x6359('0x41')][_0x6359('0x58')]);_0x1b79f9['query']=_[_0x6359('0x46')](_0xde33ea['query']);_0x1b79f9[_0x6359('0x47')]=_[_0x6359('0x48')](_0x1b79f9[_0x6359('0x44')],_0x1b79f9[_0x6359('0x45')]);_0x15cbab[_0x6359('0x4a')]=_[_0x6359('0x48')](_0x1b79f9[_0x6359('0x44')],qs[_0x6359('0x49')](_0xde33ea[_0x6359('0x45')][_0x6359('0x49')]));_0x15cbab['attributes']=_0x15cbab['attributes'][_0x6359('0x59')]?_0x15cbab[_0x6359('0x4a')]:_0x1b79f9[_0x6359('0x44')];if(_0xde33ea[_0x6359('0x45')][_0x6359('0x54')]){_0x15cbab[_0x6359('0x5a')]=[{'all':!![]}];}_0x15cbab=_[_0x6359('0x51')]({},_0x15cbab,_0xde33ea[_0x6359('0x5b')]);return db[_0x6359('0x41')][_0x6359('0x5c')](_0x15cbab)[_0x6359('0x22')](handleEntityNotFound(_0x3c97fd,null))[_0x6359('0x22')](respondWithResult(_0x3c97fd,null))[_0x6359('0x2c')](handleError(_0x3c97fd,null));};exports[_0x6359('0x5d')]=function(_0x5a9fce,_0x4088ec){return db[_0x6359('0x41')][_0x6359('0x5d')](_0x5a9fce[_0x6359('0x5e')],{})[_0x6359('0x22')](respondWithResult(_0x4088ec,0xc9))[_0x6359('0x2c')](handleError(_0x4088ec,null));};exports[_0x6359('0x39')]=function(_0x47116d,_0x8c8d7a){if(_0x47116d['body']['id']){delete _0x47116d[_0x6359('0x5e')]['id'];}return db[_0x6359('0x41')][_0x6359('0x5c')]({'where':{'id':_0x47116d[_0x6359('0x57')]['id']}})['then'](handleEntityNotFound(_0x8c8d7a,null))[_0x6359('0x22')](saveUpdates(_0x47116d['body'],null))[_0x6359('0x22')](respondWithResult(_0x8c8d7a,null))[_0x6359('0x2c')](handleError(_0x8c8d7a,null));};exports[_0x6359('0x3a')]=function(_0x5e4a96,_0x5ac571){return db[_0x6359('0x41')][_0x6359('0x5c')]({'where':{'id':_0x5e4a96[_0x6359('0x57')]['id']}})[_0x6359('0x22')](handleEntityNotFound(_0x5ac571,null))[_0x6359('0x22')](removeEntity(_0x5ac571,null))[_0x6359('0x2c')](handleError(_0x5ac571,null));};exports[_0x6359('0x5f')]=function(_0x608d7d,_0x528725){return db[_0x6359('0x41')][_0x6359('0x5f')]()[_0x6359('0x22')](respondWithResult(_0x528725,null))[_0x6359('0x2c')](handleError(_0x528725,null));};var interaction_log=require('../../config/logger')(_0x6359('0x60'));exports['accept']=function(_0x49c1dd,_0x25da9a,_0x13f300){var _0xdad47a={'agent':{},'channel':_0x6359('0x61')};if(_0x49c1dd['body']['id']){delete _0x49c1dd[_0x6359('0x5e')]['id'];}_0x49c1dd[_0x6359('0x5e')][_0x6359('0x62')]=!![];_0x49c1dd[_0x6359('0x5e')][_0x6359('0x63')]=moment()[_0x6359('0x64')](_0x6359('0x65'));_0x49c1dd[_0x6359('0x5e')]['UserId']=_0x49c1dd[_0x6359('0x5e')][_0x6359('0x66')]||_0x49c1dd['user']['id'];_0xdad47a[_0x6359('0x67')]['id']=_0x49c1dd[_0x6359('0x5e')][_0x6359('0x66')];return db[_0x6359('0x41')][_0x6359('0x5c')]({'where':{'id':_0x49c1dd[_0x6359('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x25da9a,null))[_0x6359('0x22')](saveUpdates(_0x49c1dd['body'],null))['then'](function(_0x152d41){if(_0x152d41){_0xdad47a['message']=_0x152d41[_0x6359('0x68')]({'plain':!![]});return db[_0x6359('0x69')][_0x6359('0x5c')]({'where':{'id':_0x152d41['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x25da9a,null))[_0x6359('0x22')](function(_0x216d94){if(_0x216d94){return _0x216d94['update']({'UserId':_0x49c1dd[_0x6359('0x5e')][_0x6359('0x66')],'read1stAt':_['isNil'](_0x216d94[_0x6359('0x6a')])?moment()[_0x6359('0x64')](_0x6359('0x65')):undefined});}return null;})[_0x6359('0x22')](function(_0xac8bf1){if(_0xac8bf1){_0xdad47a[_0x6359('0x6b')]=_0xac8bf1[_0x6359('0x68')]({'plain':!![]});interaction_log['info'](_0x6359('0x6c'),_0x49c1dd[_0x6359('0x6d')]['id'],_0x49c1dd[_0x6359('0x6d')][_0x6359('0x3d')],_0x49c1dd[_0x6359('0x6d')][_0x6359('0x6e')],_0xdad47a[_0x6359('0x6b')]['id'],_0x49c1dd[_0x6359('0x5e')]?JSON[_0x6359('0x27')](_0x49c1dd[_0x6359('0x5e')]):_0x6359('0x6f'));return respondWithRpcPromise(_0x6359('0x70'),_0x6359('0x71'),_0xdad47a);}return null;})['then'](function(_0x5e8882){var _0x2b88e7=_0x6359('0x72')+_0x5e8882[_0x6359('0x2a')]['ContactId'];return db[_0x6359('0x73')][_0x6359('0x45')](_0x2b88e7,{'type':db['Sequelize'][_0x6359('0x74')][_0x6359('0x75')],'raw':!![]})[_0x6359('0x22')](function(_0x3ea707){return _0x3ea707;});})['then'](function(_0xf0c1ca){if(_0xf0c1ca){_0xdad47a[_0x6359('0x2a')]['contact']=_0xf0c1ca[0x0];if(!_0x49c1dd[_0x6359('0x5e')]['UserId'])return;return db[_0x6359('0x76')][_0x6359('0x5c')]({'where':{'id':_0x49c1dd[_0x6359('0x5e')][_0x6359('0x66')],'role':_0x6359('0x67')},'attributes':['id','name',_0x6359('0x77'),_0x6359('0x78'),_0x6359('0x79')],'raw':!![]});}return null;})[_0x6359('0x22')](function(_0x116b45){if(!_0x116b45)return null;_0xdad47a['message'][_0x6359('0x67')]=_0x116b45;return _0xdad47a;})[_0x6359('0x22')](function(_0x247bf0){if(_0x247bf0){if(_0x49c1dd[_0x6359('0x5e')]['manual']){_0xdad47a['message']['interface']=util[_0x6359('0x64')](_0x6359('0x7a'),_0x49c1dd[_0x6359('0x6d')][_0x6359('0x3d')]);_0xdad47a[_0x6359('0x2a')][_0x6359('0x7b')]=_0xdad47a[_0x6359('0x7b')];_0xdad47a[_0x6359('0x2a')][_0x6359('0x7c')]=_0xdad47a[_0x6359('0x7b')];_0xdad47a[_0x6359('0x2a')]['event']=_0x6359('0x7d');return respondWithRpcPromise(_0x6359('0x7e'),_0x6359('0x7e'),{'event':_0x6359('0x7f'),'message':_[_0x6359('0x51')](_0xdad47a[_0x6359('0x2a')],JSON['parse'](_0xdad47a[_0x6359('0x6b')][_0x6359('0x80')]))},client9002)[_0x6359('0x22')](function(){return _0xdad47a;});}return _0xdad47a;}return null;})['then'](respondWithResult(_0x25da9a,null))[_0x6359('0x2c')](handleError(_0x25da9a,null));};var interaction_log=require(_0x6359('0x13'))(_0x6359('0x60'));exports[_0x6359('0x37')]=function(_0x52d0a6,_0x1f60c6,_0x3c9dbc){var _0x31d578={'agent':{},'channel':_0x6359('0x61')};if(_0x52d0a6[_0x6359('0x5e')]['id']){delete _0x52d0a6['body']['id'];}_0x52d0a6[_0x6359('0x5e')]['UserId']=_0x52d0a6['body']['UserId']||_0x52d0a6[_0x6359('0x6d')]['id'];_0x31d578['agent']['id']=_0x52d0a6[_0x6359('0x5e')][_0x6359('0x66')];return db[_0x6359('0x41')]['find']({'where':{'id':_0x52d0a6[_0x6359('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1f60c6,null))['then'](function(_0x3160de){if(_0x3160de){_0x31d578[_0x6359('0x2a')]=_0x3160de[_0x6359('0x68')]({'plain':!![]});return db[_0x6359('0x69')]['find']({'where':{'id':_0x3160de[_0x6359('0x81')]}});}return null;})[_0x6359('0x22')](handleEntityNotFound(_0x1f60c6,null))[_0x6359('0x22')](function(_0x126158){if(_0x126158){_0x31d578['interaction']=_0x126158[_0x6359('0x68')]({'plain':!![]});interaction_log['info'](_0x6359('0x82'),_0x52d0a6[_0x6359('0x6d')]['id'],_0x52d0a6[_0x6359('0x6d')][_0x6359('0x3d')],_0x52d0a6[_0x6359('0x6d')][_0x6359('0x6e')],_0x31d578['interaction']['id'],_0x52d0a6['body']?JSON[_0x6359('0x27')](_0x52d0a6[_0x6359('0x5e')]):_0x6359('0x6f'));return respondWithRpcPromise('RejectMessage',_0x6359('0x83'),_0x31d578);}return null;})[_0x6359('0x22')](function(_0x5f1520){var _0x2a1eee=_0x6359('0x72')+_0x5f1520[_0x6359('0x2a')]['ContactId'];return db[_0x6359('0x73')]['query'](_0x2a1eee,{'type':db['Sequelize'][_0x6359('0x74')][_0x6359('0x75')],'raw':!![]})[_0x6359('0x22')](function(_0x5b60e){return _0x5b60e;});})[_0x6359('0x22')](function(_0x3a1e88){if(_0x3a1e88){_0x31d578[_0x6359('0x2a')][_0x6359('0x84')]=_0x3a1e88[0x0];if(!_0x52d0a6[_0x6359('0x5e')][_0x6359('0x66')])return;return db[_0x6359('0x76')][_0x6359('0x5c')]({'where':{'id':_0x52d0a6[_0x6359('0x5e')][_0x6359('0x66')],'role':'agent'},'attributes':['id',_0x6359('0x3d'),_0x6359('0x77'),'email',_0x6359('0x79')],'raw':!![]});}return null;})[_0x6359('0x22')](function(_0x1118cc){if(!_0x1118cc)return null;_0x31d578[_0x6359('0x2a')][_0x6359('0x67')]=_0x1118cc;return _0x31d578;})[_0x6359('0x22')](function(_0x308609){if(_0x308609){_0x308609['message'][_0x6359('0x85')]=util[_0x6359('0x64')]('SIP/%s',_0x52d0a6[_0x6359('0x6d')][_0x6359('0x3d')]);_0x308609[_0x6359('0x2a')][_0x6359('0x7b')]=_0x31d578[_0x6359('0x7b')];_0x308609['message'][_0x6359('0x7c')]=_0x31d578['channel'];_0x308609[_0x6359('0x2a')][_0x6359('0x86')]='reject';respondWithRpcPromise('EventManager',_0x6359('0x7e'),{'event':_0x6359('0x87'),'message':_[_0x6359('0x51')](_0x31d578[_0x6359('0x2a')],JSON[_0x6359('0x88')](_0x31d578[_0x6359('0x6b')][_0x6359('0x80')]))},client9002);return _0x31d578;}return null;})[_0x6359('0x22')](respondWithResult(_0x1f60c6,null))[_0x6359('0x2c')](handleError(_0x1f60c6,null));}; \ No newline at end of file +var _0x15c9=['format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','read1stAt','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','parse','formData','chat-interactions','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','EventManager','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','socket.io-emitter','./chatMessage.socket','register','http','client','request','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','fields','query','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','params','include','create','body','update','find','describe','../../config/logger','accept','chat','read','readAt'];(function(_0x40474a,_0x29af97){var _0x39e54c=function(_0xdbd01f){while(--_0xdbd01f){_0x40474a['push'](_0x40474a['shift']());}};_0x39e54c(++_0x29af97);}(_0x15c9,0xa8));var _0x915c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x15c9[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x915c('0x0'));var rimraf=require(_0x915c('0x1'));var zipdir=require(_0x915c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x915c('0x3'));var moment=require(_0x915c('0x4'));var BPromise=require(_0x915c('0x5'));var Mustache=require(_0x915c('0x6'));var util=require(_0x915c('0x7'));var path=require('path');var sox=require(_0x915c('0x8'));var csv=require(_0x915c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x915c('0xa'));var _=require('lodash');var squel=require(_0x915c('0xb'));var crypto=require('crypto');var jsforce=require(_0x915c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x915c('0x9'));var querystring=require(_0x915c('0xd'));var Papa=require(_0x915c('0xe'));var Redis=require(_0x915c('0xf'));var authService=require(_0x915c('0x10'));var qs=require(_0x915c('0x11'));var as=require(_0x915c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x915c('0x13'));var utils=require(_0x915c('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x915c('0x15')]=_[_0x915c('0x16')](config[_0x915c('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x915c('0x17'))(new Redis(config[_0x915c('0x15')]));require(_0x915c('0x18'))[_0x915c('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x915c('0x1a')]({'port':0x232c});var client9002=jayson[_0x915c('0x1b')][_0x915c('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x345dd2,_0x36897c,_0x357103,_0x1fb7b8){return new BPromise(function(_0x4ebdae,_0x299917){var _0x368984=_0x1fb7b8||client;return _0x368984[_0x915c('0x1c')](_0x345dd2,_0x357103)['then'](function(_0x616bd3){logger['info'](_0x915c('0x1d'),_0x36897c,_0x915c('0x1e'));logger['debug'](_0x915c('0x1f'),_0x36897c,_0x915c('0x1e'),JSON[_0x915c('0x20')](_0x616bd3));if(_0x616bd3[_0x915c('0x21')]){if(_0x616bd3['error'][_0x915c('0x22')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x36897c,_0x616bd3[_0x915c('0x21')][_0x915c('0x23')]);return _0x299917(_0x616bd3['error']['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x36897c,_0x616bd3[_0x915c('0x21')]['message']);return _0x4ebdae(_0x616bd3[_0x915c('0x21')][_0x915c('0x23')]);}else{logger[_0x915c('0x24')](_0x915c('0x1d'),_0x36897c,_0x915c('0x1e'));_0x4ebdae(_0x616bd3[_0x915c('0x25')]['message']);}})[_0x915c('0x26')](function(_0x389919){logger['error'](_0x915c('0x1d'),_0x36897c,_0x389919);_0x299917(_0x389919);});});}function respondWithStatusCode(_0x177e7b,_0x1b6c3d){_0x1b6c3d=_0x1b6c3d||0xcc;return function(_0x430dbf){if(_0x430dbf){return _0x177e7b[_0x915c('0x27')](_0x1b6c3d);}return _0x177e7b[_0x915c('0x28')](_0x1b6c3d)[_0x915c('0x29')]();};}function respondWithResult(_0x52d4a5,_0x53c12c){_0x53c12c=_0x53c12c||0xc8;return function(_0x2f3218){if(_0x2f3218){return _0x52d4a5['status'](_0x53c12c)[_0x915c('0x2a')](_0x2f3218);}};}function respondWithFilteredResult(_0xf151dc,_0x35f4cd){return function(_0x137cd2){if(_0x137cd2){var _0x37c111=typeof _0x35f4cd[_0x915c('0x2b')]===_0x915c('0x2c')&&typeof _0x35f4cd['limit']==='undefined';var _0x4d12e2=_0x137cd2[_0x915c('0x2d')];var _0x2addc4=_0x37c111?0x0:_0x35f4cd[_0x915c('0x2b')];var _0x1802fe=_0x37c111?_0x137cd2[_0x915c('0x2d')]:_0x35f4cd['offset']+_0x35f4cd[_0x915c('0x2e')];var _0xfab16;if(_0x1802fe>=_0x4d12e2){_0x1802fe=_0x4d12e2;_0xfab16=0xc8;}else{_0xfab16=0xce;}_0xf151dc[_0x915c('0x28')](_0xfab16);return _0xf151dc[_0x915c('0x2f')](_0x915c('0x30'),_0x2addc4+'-'+_0x1802fe+'/'+_0x4d12e2)[_0x915c('0x2a')](_0x137cd2);}return null;};}function patchUpdates(_0x29f800){return function(_0x53382d){try{jsonpatch[_0x915c('0x31')](_0x53382d,_0x29f800,!![]);}catch(_0x2b9ca4){return BPromise[_0x915c('0x32')](_0x2b9ca4);}return _0x53382d['save']();};}function saveUpdates(_0x582dbf,_0x140119){return function(_0x53eee1){if(_0x53eee1){return _0x53eee1['update'](_0x582dbf)[_0x915c('0x33')](function(_0x9905b4){return _0x9905b4;});}return null;};}function removeEntity(_0x28e8b8,_0x4b6e92){return function(_0x5110d1){if(_0x5110d1){return _0x5110d1[_0x915c('0x34')]()[_0x915c('0x33')](function(){_0x28e8b8[_0x915c('0x28')](0xcc)[_0x915c('0x29')]();});}};}function handleEntityNotFound(_0x34f1c4,_0x1680b5){return function(_0x5a4894){if(!_0x5a4894){_0x34f1c4[_0x915c('0x27')](0x194);}return _0x5a4894;};}function handleError(_0x4ac3e5,_0x41ccc2){_0x41ccc2=_0x41ccc2||0x1f4;return function(_0x3fc297){logger[_0x915c('0x21')](_0x3fc297[_0x915c('0x35')]);if(_0x3fc297[_0x915c('0x36')]){delete _0x3fc297[_0x915c('0x36')];}_0x4ac3e5['status'](_0x41ccc2)[_0x915c('0x37')](_0x3fc297);};}exports['index']=function(_0x5e2176,_0x12668d){var _0xd53279={},_0x34079d={},_0x26a3c0={'count':0x0,'rows':[]};var _0x444382=_[_0x915c('0x38')](db[_0x915c('0x39')][_0x915c('0x3a')],function(_0x131383){return{'name':_0x131383[_0x915c('0x3b')],'type':_0x131383[_0x915c('0x3c')][_0x915c('0x3d')]};});_0x34079d[_0x915c('0x3e')]=_[_0x915c('0x38')](_0x444382,_0x915c('0x36'));_0x34079d['query']=_[_0x915c('0x3f')](_0x5e2176['query']);_0x34079d[_0x915c('0x40')]=_[_0x915c('0x41')](_0x34079d['model'],_0x34079d['query']);_0xd53279['attributes']=_['intersection'](_0x34079d[_0x915c('0x3e')],qs[_0x915c('0x42')](_0x5e2176[_0x915c('0x43')][_0x915c('0x42')]));_0xd53279[_0x915c('0x44')]=_0xd53279['attributes'][_0x915c('0x45')]?_0xd53279[_0x915c('0x44')]:_0x34079d[_0x915c('0x3e')];if(!_0x5e2176[_0x915c('0x43')]['hasOwnProperty'](_0x915c('0x46'))){_0xd53279['limit']=qs[_0x915c('0x2e')](_0x5e2176[_0x915c('0x43')][_0x915c('0x2e')]);_0xd53279[_0x915c('0x2b')]=qs[_0x915c('0x2b')](_0x5e2176[_0x915c('0x43')][_0x915c('0x2b')]);}_0xd53279['order']=qs[_0x915c('0x47')](_0x5e2176[_0x915c('0x43')][_0x915c('0x47')]);_0xd53279[_0x915c('0x48')]=qs['filters'](_[_0x915c('0x49')](_0x5e2176[_0x915c('0x43')],_0x34079d[_0x915c('0x40')]),_0x444382);if(_0x5e2176['query'][_0x915c('0x4a')]){_0xd53279[_0x915c('0x48')]=_[_0x915c('0x4b')](_0xd53279[_0x915c('0x48')],{'$or':_[_0x915c('0x38')](_0x444382,function(_0x175b78){if(_0x175b78[_0x915c('0x3c')]!==_0x915c('0x4c')){var _0x43367e={};_0x43367e[_0x175b78[_0x915c('0x36')]]={'$like':'%'+_0x5e2176[_0x915c('0x43')][_0x915c('0x4a')]+'%'};return _0x43367e;}})});}_0xd53279=_['merge']({},_0xd53279,_0x5e2176[_0x915c('0x4d')]);var _0x115cf5={'where':_0xd53279[_0x915c('0x48')]};return db[_0x915c('0x39')][_0x915c('0x2d')](_0x115cf5)[_0x915c('0x33')](function(_0xbda57d){_0x26a3c0['count']=_0xbda57d;if(_0x5e2176[_0x915c('0x43')][_0x915c('0x4e')]){_0xd53279['include']=[{'all':!![]}];}return db['ChatMessage'][_0x915c('0x4f')](_0xd53279);})[_0x915c('0x33')](function(_0x2cab83){_0x26a3c0['rows']=_0x2cab83;return _0x26a3c0;})['then'](respondWithFilteredResult(_0x12668d,_0xd53279))[_0x915c('0x26')](handleError(_0x12668d,null));};exports['show']=function(_0x583015,_0x58e5c9){var _0x10ea67={'raw':!![],'where':{'id':_0x583015[_0x915c('0x50')]['id']}},_0x59d19c={};_0x59d19c[_0x915c('0x3e')]=_[_0x915c('0x3f')](db[_0x915c('0x39')][_0x915c('0x3a')]);_0x59d19c['query']=_[_0x915c('0x3f')](_0x583015[_0x915c('0x43')]);_0x59d19c[_0x915c('0x40')]=_[_0x915c('0x41')](_0x59d19c[_0x915c('0x3e')],_0x59d19c[_0x915c('0x43')]);_0x10ea67[_0x915c('0x44')]=_[_0x915c('0x41')](_0x59d19c[_0x915c('0x3e')],qs['fields'](_0x583015['query']['fields']));_0x10ea67[_0x915c('0x44')]=_0x10ea67[_0x915c('0x44')][_0x915c('0x45')]?_0x10ea67[_0x915c('0x44')]:_0x59d19c[_0x915c('0x3e')];if(_0x583015[_0x915c('0x43')][_0x915c('0x4e')]){_0x10ea67[_0x915c('0x51')]=[{'all':!![]}];}_0x10ea67=_['merge']({},_0x10ea67,_0x583015['options']);return db['ChatMessage']['find'](_0x10ea67)[_0x915c('0x33')](handleEntityNotFound(_0x58e5c9,null))[_0x915c('0x33')](respondWithResult(_0x58e5c9,null))[_0x915c('0x26')](handleError(_0x58e5c9,null));};exports['create']=function(_0x882073,_0x1d5691){return db['ChatMessage'][_0x915c('0x52')](_0x882073[_0x915c('0x53')],{})[_0x915c('0x33')](respondWithResult(_0x1d5691,0xc9))[_0x915c('0x26')](handleError(_0x1d5691,null));};exports[_0x915c('0x54')]=function(_0x864043,_0x598414){if(_0x864043[_0x915c('0x53')]['id']){delete _0x864043[_0x915c('0x53')]['id'];}return db[_0x915c('0x39')][_0x915c('0x55')]({'where':{'id':_0x864043[_0x915c('0x50')]['id']}})['then'](handleEntityNotFound(_0x598414,null))[_0x915c('0x33')](saveUpdates(_0x864043[_0x915c('0x53')],null))[_0x915c('0x33')](respondWithResult(_0x598414,null))[_0x915c('0x26')](handleError(_0x598414,null));};exports['destroy']=function(_0x2ec36e,_0x5c1fa7){return db['ChatMessage'][_0x915c('0x55')]({'where':{'id':_0x2ec36e['params']['id']}})[_0x915c('0x33')](handleEntityNotFound(_0x5c1fa7,null))[_0x915c('0x33')](removeEntity(_0x5c1fa7,null))[_0x915c('0x26')](handleError(_0x5c1fa7,null));};exports['describe']=function(_0x470d79,_0x5a3139){return db[_0x915c('0x39')][_0x915c('0x56')]()['then'](respondWithResult(_0x5a3139,null))['catch'](handleError(_0x5a3139,null));};var interaction_log=require(_0x915c('0x57'))('chat-interactions');exports[_0x915c('0x58')]=function(_0x150fe1,_0x29906b,_0x4506a1){var _0x1f36bd={'agent':{},'channel':_0x915c('0x59')};if(_0x150fe1[_0x915c('0x53')]['id']){delete _0x150fe1[_0x915c('0x53')]['id'];}_0x150fe1[_0x915c('0x53')][_0x915c('0x5a')]=!![];_0x150fe1[_0x915c('0x53')][_0x915c('0x5b')]=moment()[_0x915c('0x5c')](_0x915c('0x5d'));_0x150fe1[_0x915c('0x53')][_0x915c('0x5e')]=_0x150fe1['body'][_0x915c('0x5e')]||_0x150fe1[_0x915c('0x5f')]['id'];_0x1f36bd['agent']['id']=_0x150fe1[_0x915c('0x53')][_0x915c('0x5e')];return db[_0x915c('0x39')]['find']({'where':{'id':_0x150fe1['params']['id'],'UserId':null}})[_0x915c('0x33')](handleEntityNotFound(_0x29906b,null))[_0x915c('0x33')](saveUpdates(_0x150fe1[_0x915c('0x53')],null))['then'](function(_0x36a952){if(_0x36a952){_0x1f36bd[_0x915c('0x23')]=_0x36a952['get']({'plain':!![]});return db[_0x915c('0x60')][_0x915c('0x55')]({'where':{'id':_0x36a952['ChatInteractionId']}});}return null;})[_0x915c('0x33')](handleEntityNotFound(_0x29906b,null))[_0x915c('0x33')](function(_0x17becb){if(_0x17becb){return _0x17becb[_0x915c('0x54')]({'UserId':_0x150fe1['body'][_0x915c('0x5e')],'read1stAt':_['isNil'](_0x17becb[_0x915c('0x61')])?moment()[_0x915c('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x915c('0x33')](function(_0xf7ec1a){if(_0xf7ec1a){_0x1f36bd['interaction']=_0xf7ec1a[_0x915c('0x62')]({'plain':!![]});interaction_log[_0x915c('0x24')](_0x915c('0x63'),_0x150fe1['user']['id'],_0x150fe1['user'][_0x915c('0x36')],_0x150fe1['user'][_0x915c('0x64')],_0x1f36bd[_0x915c('0x65')]['id'],_0x150fe1['body']?JSON[_0x915c('0x20')](_0x150fe1[_0x915c('0x53')]):_0x915c('0x66'));return respondWithRpcPromise(_0x915c('0x67'),_0x915c('0x68'),_0x1f36bd);}return null;})[_0x915c('0x33')](function(_0x30a228){var _0x3defd6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x30a228[_0x915c('0x23')][_0x915c('0x69')];return db[_0x915c('0x6a')]['query'](_0x3defd6,{'type':db['Sequelize'][_0x915c('0x6b')]['SELECT'],'raw':!![]})['then'](function(_0x226f58){return _0x226f58;});})[_0x915c('0x33')](function(_0x550149){if(_0x550149){_0x1f36bd[_0x915c('0x23')][_0x915c('0x6c')]=_0x550149[0x0];if(!_0x150fe1[_0x915c('0x53')]['UserId'])return;return db[_0x915c('0x6d')][_0x915c('0x55')]({'where':{'id':_0x150fe1['body']['UserId'],'role':_0x915c('0x6e')},'attributes':['id','name',_0x915c('0x6f'),_0x915c('0x70'),_0x915c('0x71')],'raw':!![]});}return null;})[_0x915c('0x33')](function(_0xb62591){if(!_0xb62591)return null;_0x1f36bd[_0x915c('0x23')][_0x915c('0x6e')]=_0xb62591;return _0x1f36bd;})[_0x915c('0x33')](function(_0x42d6a0){if(_0x42d6a0){if(_0x150fe1[_0x915c('0x53')][_0x915c('0x72')]){_0x1f36bd[_0x915c('0x23')][_0x915c('0x73')]=util[_0x915c('0x5c')](_0x915c('0x74'),_0x150fe1[_0x915c('0x5f')]['name']);_0x1f36bd[_0x915c('0x23')][_0x915c('0x75')]=_0x1f36bd['channel'];_0x1f36bd[_0x915c('0x23')][_0x915c('0x76')]=_0x1f36bd[_0x915c('0x75')];_0x1f36bd['message'][_0x915c('0x77')]=_0x915c('0x58');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_[_0x915c('0x4b')](_0x1f36bd[_0x915c('0x23')],JSON[_0x915c('0x78')](_0x1f36bd[_0x915c('0x65')][_0x915c('0x79')]))},client9002)[_0x915c('0x33')](function(){return _0x1f36bd;});}return _0x1f36bd;}return null;})[_0x915c('0x33')](respondWithResult(_0x29906b,null))[_0x915c('0x26')](handleError(_0x29906b,null));};var interaction_log=require(_0x915c('0x57'))(_0x915c('0x7a'));exports[_0x915c('0x32')]=function(_0x537cf9,_0xea803d,_0x36cfde){var _0x39415f={'agent':{},'channel':_0x915c('0x59')};if(_0x537cf9['body']['id']){delete _0x537cf9['body']['id'];}_0x537cf9[_0x915c('0x53')]['UserId']=_0x537cf9['body'][_0x915c('0x5e')]||_0x537cf9[_0x915c('0x5f')]['id'];_0x39415f[_0x915c('0x6e')]['id']=_0x537cf9[_0x915c('0x53')][_0x915c('0x5e')];return db[_0x915c('0x39')][_0x915c('0x55')]({'where':{'id':_0x537cf9[_0x915c('0x50')]['id'],'UserId':null}})[_0x915c('0x33')](handleEntityNotFound(_0xea803d,null))[_0x915c('0x33')](function(_0x6e2b13){if(_0x6e2b13){_0x39415f['message']=_0x6e2b13[_0x915c('0x62')]({'plain':!![]});return db[_0x915c('0x60')][_0x915c('0x55')]({'where':{'id':_0x6e2b13[_0x915c('0x7b')]}});}return null;})[_0x915c('0x33')](handleEntityNotFound(_0xea803d,null))[_0x915c('0x33')](function(_0x24a2aa){if(_0x24a2aa){_0x39415f['interaction']=_0x24a2aa[_0x915c('0x62')]({'plain':!![]});interaction_log[_0x915c('0x24')](_0x915c('0x7c'),_0x537cf9['user']['id'],_0x537cf9[_0x915c('0x5f')][_0x915c('0x36')],_0x537cf9[_0x915c('0x5f')][_0x915c('0x64')],_0x39415f[_0x915c('0x65')]['id'],_0x537cf9[_0x915c('0x53')]?JSON[_0x915c('0x20')](_0x537cf9[_0x915c('0x53')]):_0x915c('0x66'));return respondWithRpcPromise('RejectMessage',_0x915c('0x7d'),_0x39415f);}return null;})[_0x915c('0x33')](function(_0x496a11){var _0x2fcf75=_0x915c('0x7e')+_0x496a11[_0x915c('0x23')][_0x915c('0x69')];return db['sequelize'][_0x915c('0x43')](_0x2fcf75,{'type':db[_0x915c('0x7f')][_0x915c('0x6b')]['SELECT'],'raw':!![]})['then'](function(_0x13953e){return _0x13953e;});})[_0x915c('0x33')](function(_0x312485){if(_0x312485){_0x39415f[_0x915c('0x23')][_0x915c('0x6c')]=_0x312485[0x0];if(!_0x537cf9[_0x915c('0x53')]['UserId'])return;return db[_0x915c('0x6d')][_0x915c('0x55')]({'where':{'id':_0x537cf9[_0x915c('0x53')][_0x915c('0x5e')],'role':_0x915c('0x6e')},'attributes':['id',_0x915c('0x36'),_0x915c('0x6f'),_0x915c('0x70'),_0x915c('0x71')],'raw':!![]});}return null;})[_0x915c('0x33')](function(_0xe39385){if(!_0xe39385)return null;_0x39415f[_0x915c('0x23')]['agent']=_0xe39385;return _0x39415f;})[_0x915c('0x33')](function(_0x570db3){if(_0x570db3){_0x570db3['message'][_0x915c('0x73')]=util[_0x915c('0x5c')](_0x915c('0x74'),_0x537cf9['user'][_0x915c('0x36')]);_0x570db3[_0x915c('0x23')]['channel']=_0x39415f[_0x915c('0x75')];_0x570db3[_0x915c('0x23')][_0x915c('0x76')]=_0x39415f[_0x915c('0x75')];_0x570db3[_0x915c('0x23')][_0x915c('0x77')]=_0x915c('0x32');respondWithRpcPromise(_0x915c('0x80'),'EventManager',{'event':_0x915c('0x81'),'message':_[_0x915c('0x4b')](_0x39415f['message'],JSON['parse'](_0x39415f[_0x915c('0x65')][_0x915c('0x79')]))},client9002);return _0x39415f;}return null;})[_0x915c('0x33')](respondWithResult(_0xea803d,null))[_0x915c('0x26')](handleError(_0xea803d,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 8adbaeb..c419d38 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 _0x9b68=['remove','emit','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5e6c86,_0x404a95){var _0x1e9cff=function(_0x440607){while(--_0x440607){_0x5e6c86['push'](_0x5e6c86['shift']());}};_0x1e9cff(++_0x404a95);}(_0x9b68,0xf9));var _0x89b6=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x9b68[_0x5834bc];return _0x3e183a;};'use strict';var EventEmitter=require(_0x89b6('0x0'));var ChatMessage=require(_0x89b6('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x89b6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x89b6('0x3')};function emitEvent(_0x33bf4b){return function(_0x5cceae,_0x131407,_0x2409aa){ChatMessageEvents[_0x89b6('0x4')](_0x33bf4b+':'+_0x5cceae['id'],_0x5cceae);ChatMessageEvents[_0x89b6('0x4')](_0x33bf4b,_0x5cceae);_0x2409aa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x89b6('0x5')]=ChatMessageEvents; \ No newline at end of file +var _0x754c=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x592e40,_0x2ed011){var _0x5d4288=function(_0x366e87){while(--_0x366e87){_0x592e40['push'](_0x592e40['shift']());}};_0x5d4288(++_0x2ed011);}(_0x754c,0xbd));var _0xc754=function(_0x3a8e01,_0x5d5025){_0x3a8e01=_0x3a8e01-0x0;var _0x46dc07=_0x754c[_0x3a8e01];return _0x46dc07;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xc754('0x0'))['db'][_0xc754('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc754('0x2')](0x0);var events={'afterCreate':_0xc754('0x3'),'afterUpdate':_0xc754('0x4'),'afterDestroy':_0xc754('0x5')};function emitEvent(_0x3a5bab){return function(_0x3aeee3,_0x44e3e1,_0x1db841){ChatMessageEvents['emit'](_0x3a5bab+':'+_0x3aeee3['id'],_0x3aeee3);ChatMessageEvents[_0xc754('0x6')](_0x3a5bab,_0x3aeee3);_0x1db841(null);};}for(var e in events){if(events[_0xc754('0x7')](e)){var event=events[e];ChatMessage[_0xc754('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 6c80e67..96c8c8d 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 _0x8c8a=['get','direction','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','util','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models'];(function(_0x107179,_0x46e138){var _0x31f40e=function(_0x5973c1){while(--_0x5973c1){_0x107179['push'](_0x107179['shift']());}};_0x31f40e(++_0x46e138);}(_0x8c8a,0x17a));var _0xa8c8=function(_0x1e24f8,_0x52070f){_0x1e24f8=_0x1e24f8-0x0;var _0x5c4446=_0x8c8a[_0x1e24f8];return _0x5c4446;};'use strict';var _=require('lodash');var util=require(_0xa8c8('0x0'));var logger=require('../../config/logger')(_0xa8c8('0x1'));var moment=require('moment');var BPromise=require(_0xa8c8('0x2'));var rp=require(_0xa8c8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8c8('0x4'));var config=require(_0xa8c8('0x5'));var attributes=require('./chatMessage.attributes');module[_0xa8c8('0x6')]=function(_0x106dbf,_0x584775){return _0x106dbf[_0xa8c8('0x7')](_0xa8c8('0x8'),attributes,{'tableName':_0xa8c8('0x9'),'paranoid':![],'indexes':[{'name':_0xa8c8('0xa'),'fields':[_0xa8c8('0xb')],'type':_0xa8c8('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x219e0f,_0x534f76,_0x44a4fd){var _0x37faea=_0x106dbf[_0xa8c8('0xd')];var _0x482360=_0x219e0f[_0xa8c8('0xe')]({'plain':!![]});if(_0x482360[_0xa8c8('0xf')]['toLowerCase']()==='in'||_0x482360[_0xa8c8('0xf')]['toLowerCase']()==='out'&&!_0x482360[_0xa8c8('0x10')]&&!_[_0xa8c8('0x11')](_0x482360[_0xa8c8('0x12')])){_0x37faea[_0xa8c8('0x13')][_0xa8c8('0x14')]({'where':{'id':_0x482360[_0xa8c8('0x15')]}})[_0xa8c8('0x16')](function(_0xc50ca7){if(_0xc50ca7){_0xc50ca7[_0xa8c8('0x17')]({'lastMsgAt':_0x482360[_0xa8c8('0x18')],'lastMsgDirection':_0x482360[_0xa8c8('0xf')]['toLowerCase']()});}})[_0xa8c8('0x19')](function(_0x391f2a){console[_0xa8c8('0x1a')](_0x391f2a);});}_0x44a4fd();}},'charset':_0xa8c8('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa01c=['toLowerCase','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt'];(function(_0x48c6e8,_0x21277d){var _0x2a0ed5=function(_0x332d1f){while(--_0x332d1f){_0x48c6e8['push'](_0x48c6e8['shift']());}};_0x2a0ed5(++_0x21277d);}(_0xa01c,0x1f1));var _0xca01=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa01c[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xca01('0x0'));var util=require(_0xca01('0x1'));var logger=require(_0xca01('0x2'))(_0xca01('0x3'));var moment=require('moment');var BPromise=require(_0xca01('0x4'));var rp=require(_0xca01('0x5'));var fs=require('fs');var path=require(_0xca01('0x6'));var rimraf=require(_0xca01('0x7'));var config=require(_0xca01('0x8'));var attributes=require(_0xca01('0x9'));module[_0xca01('0xa')]=function(_0x31ba2a,_0x31eec1){return _0x31ba2a[_0xca01('0xb')]('ChatMessage',attributes,{'tableName':_0xca01('0xc'),'paranoid':![],'indexes':[{'name':_0xca01('0xd'),'fields':['body'],'type':_0xca01('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4153b7,_0x52f445,_0x46d0ca){var _0x134084=_0x31ba2a[_0xca01('0xf')];var _0x49d29e=_0x4153b7[_0xca01('0x10')]({'plain':!![]});if(_0x49d29e[_0xca01('0x11')]['toLowerCase']()==='in'||_0x49d29e['direction']['toLowerCase']()==='out'&&!_0x49d29e['secret']&&!_[_0xca01('0x12')](_0x49d29e[_0xca01('0x13')])){_0x134084[_0xca01('0x14')][_0xca01('0x15')]({'where':{'id':_0x49d29e[_0xca01('0x16')]}})[_0xca01('0x17')](function(_0x4a9dfd){if(_0x4a9dfd){_0x4a9dfd['update']({'lastMsgAt':_0x49d29e[_0xca01('0x18')],'lastMsgDirection':_0x49d29e[_0xca01('0x11')][_0xca01('0x19')]()});}})[_0xca01('0x1a')](function(_0x3b78fd){console[_0xca01('0x1b')](_0x3b78fd);});}_0x46d0ca();}},'charset':'utf8mb4','collate':_0xca01('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index d9e3e4d..7ec6163 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 _0x15b3=['redis','defaults','localhost','register','request','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x8efe18,_0x138ad9){var _0x87719f=function(_0xdd4675){while(--_0xdd4675){_0x8efe18['push'](_0x8efe18['shift']());}};_0x87719f(++_0x138ad9);}(_0x15b3,0x1b5));var _0x315b=function(_0x146be9,_0xe85bf1){_0x146be9=_0x146be9-0x0;var _0x44bf49=_0x15b3[_0x146be9];return _0x44bf49;};'use strict';var _=require(_0x315b('0x0'));var util=require(_0x315b('0x1'));var moment=require(_0x315b('0x2'));var BPromise=require(_0x315b('0x3'));var rs=require(_0x315b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x315b('0x5'));var logger=require('../../config/logger')(_0x315b('0x6'));var config=require(_0x315b('0x7'));var jayson=require(_0x315b('0x8'));var client=jayson[_0x315b('0x9')][_0x315b('0xa')]({'port':0x232a});config[_0x315b('0xb')]=_[_0x315b('0xc')](config[_0x315b('0xb')],{'host':_0x315b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x315b('0xb')]));require('./chatMessage.socket')[_0x315b('0xe')](socket);function respondWithRpcPromise(_0x565b6b,_0x2549dc,_0x5493cf){return new BPromise(function(_0x1bb67d,_0x7128ed){return client[_0x315b('0xf')](_0x565b6b,_0x5493cf)[_0x315b('0x10')](function(_0x44eac2){logger[_0x315b('0x11')]('ChatMessage,\x20%s,\x20%s',_0x2549dc,_0x315b('0x12'));logger['debug'](_0x315b('0x13'),_0x2549dc,_0x315b('0x12'),JSON['stringify'](_0x44eac2));if(_0x44eac2[_0x315b('0x14')]){if(_0x44eac2[_0x315b('0x14')][_0x315b('0x15')]===0x1f4){logger[_0x315b('0x14')](_0x315b('0x16'),_0x2549dc,_0x44eac2[_0x315b('0x14')][_0x315b('0x17')]);return _0x7128ed(_0x44eac2['error'][_0x315b('0x17')]);}logger[_0x315b('0x14')](_0x315b('0x16'),_0x2549dc,_0x44eac2[_0x315b('0x14')][_0x315b('0x17')]);return _0x1bb67d(_0x44eac2[_0x315b('0x14')][_0x315b('0x17')]);}else{logger[_0x315b('0x11')](_0x315b('0x16'),_0x2549dc,_0x315b('0x12'));_0x1bb67d(_0x44eac2[_0x315b('0x18')][_0x315b('0x17')]);}})[_0x315b('0x19')](function(_0x48ea03){logger[_0x315b('0x14')]('ChatMessage,\x20%s,\x20%s',_0x2549dc,_0x48ea03);_0x7128ed(_0x48ea03);});});}exports[_0x315b('0x1a')]=function(_0x30980b){var _0x2f1d01=this;return new Promise(function(_0x239347,_0x75b1fc){return db[_0x315b('0x1b')][_0x315b('0x1c')](_0x30980b['body'],{'raw':_0x30980b[_0x315b('0x1d')]?_0x30980b[_0x315b('0x1d')][_0x315b('0x1e')]===undefined?!![]:![]:!![]})[_0x315b('0x10')](function(_0x4d1e1c){logger['info'](_0x315b('0x1a'),_0x30980b);logger[_0x315b('0x1f')](_0x315b('0x1a'),_0x30980b,JSON['stringify'](_0x4d1e1c));_0x239347(_0x4d1e1c);})['catch'](function(_0x3869da){logger[_0x315b('0x14')](_0x315b('0x1a'),_0x3869da[_0x315b('0x17')],_0x30980b);_0x75b1fc(_0x2f1d01[_0x315b('0x14')](0x1f4,_0x3869da['message']));});});}; \ No newline at end of file +var _0xd202=['request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','body','options','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','request','then','info'];(function(_0x197c81,_0x41a20d){var _0x4d8d28=function(_0x18c1ec){while(--_0x18c1ec){_0x197c81['push'](_0x197c81['shift']());}};_0x4d8d28(++_0x41a20d);}(_0xd202,0x14c));var _0x2d20=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xd202[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x2d20('0x0'));var util=require(_0x2d20('0x1'));var moment=require(_0x2d20('0x2'));var BPromise=require('bluebird');var rs=require(_0x2d20('0x3'));var fs=require('fs');var Redis=require(_0x2d20('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d20('0x5'));var logger=require(_0x2d20('0x6'))(_0x2d20('0x7'));var config=require(_0x2d20('0x8'));var jayson=require(_0x2d20('0x9'));var client=jayson['client'][_0x2d20('0xa')]({'port':0x232a});config[_0x2d20('0xb')]=_['defaults'](config[_0x2d20('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2d20('0xc'))(new Redis(config[_0x2d20('0xb')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x5985ca,_0x12a095,_0xe261d1){return new BPromise(function(_0x45b214,_0x3effca){return client[_0x2d20('0xd')](_0x5985ca,_0xe261d1)[_0x2d20('0xe')](function(_0x148b11){logger[_0x2d20('0xf')]('ChatMessage,\x20%s,\x20%s',_0x12a095,_0x2d20('0x10'));logger[_0x2d20('0x11')](_0x2d20('0x12'),_0x12a095,_0x2d20('0x10'),JSON[_0x2d20('0x13')](_0x148b11));if(_0x148b11['error']){if(_0x148b11['error'][_0x2d20('0x14')]===0x1f4){logger[_0x2d20('0x15')](_0x2d20('0x16'),_0x12a095,_0x148b11[_0x2d20('0x15')][_0x2d20('0x17')]);return _0x3effca(_0x148b11[_0x2d20('0x15')][_0x2d20('0x17')]);}logger['error'](_0x2d20('0x16'),_0x12a095,_0x148b11[_0x2d20('0x15')][_0x2d20('0x17')]);return _0x45b214(_0x148b11[_0x2d20('0x15')][_0x2d20('0x17')]);}else{logger[_0x2d20('0xf')]('ChatMessage,\x20%s,\x20%s',_0x12a095,_0x2d20('0x10'));_0x45b214(_0x148b11['result']['message']);}})[_0x2d20('0x18')](function(_0x51089b){logger[_0x2d20('0x15')](_0x2d20('0x16'),_0x12a095,_0x51089b);_0x3effca(_0x51089b);});});}exports[_0x2d20('0x19')]=function(_0x59f3d7){var _0x7b0936=this;return new Promise(function(_0x193097,_0x42fd89){return db['ChatMessage']['create'](_0x59f3d7[_0x2d20('0x1a')],{'raw':_0x59f3d7[_0x2d20('0x1b')]?_0x59f3d7['options'][_0x2d20('0x1c')]===undefined?!![]:![]:!![]})[_0x2d20('0xe')](function(_0x20516f){logger[_0x2d20('0xf')](_0x2d20('0x19'),_0x59f3d7);logger[_0x2d20('0x11')](_0x2d20('0x19'),_0x59f3d7,JSON['stringify'](_0x20516f));_0x193097(_0x20516f);})[_0x2d20('0x18')](function(_0x56331b){logger['error']('CreateChatMessage',_0x56331b[_0x2d20('0x17')],_0x59f3d7);_0x42fd89(_0x7b0936[_0x2d20('0x15')](0x1f4,_0x56331b[_0x2d20('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 49b1aee..c68d0d2 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 _0x3edc=['remove','update','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3edc,0x1ae));var _0xc3ed=function(_0xdb50e1,_0x112a80){_0xdb50e1=_0xdb50e1-0x0;var _0x2a50fc=_0x3edc[_0xdb50e1];return _0x2a50fc;};'use strict';var ChatMessageEvents=require(_0xc3ed('0x0'));var events=[_0xc3ed('0x1'),_0xc3ed('0x2'),_0xc3ed('0x3')];function createListener(_0xae2b4f,_0x47a242){return function(_0x2a8714){_0x47a242['emit'](_0xae2b4f,_0x2a8714);};}function removeListener(_0x3519ab,_0x19d8dc){return function(){ChatMessageEvents[_0xc3ed('0x4')](_0x3519ab,_0x19d8dc);};}exports[_0xc3ed('0x5')]=function(_0x3f8468){for(var _0x50b95c=0x0,_0x1b28d4=events[_0xc3ed('0x6')];_0x50b95c<_0x1b28d4;_0x50b95c++){var _0x14d194=events[_0x50b95c];var _0x2f28ce=createListener(_0xc3ed('0x7')+_0x14d194,_0x3f8468);ChatMessageEvents['on'](_0x14d194,_0x2f28ce);}}; \ No newline at end of file +var _0x2e8a=['remove','emit','chatMessage:','save'];(function(_0x1181f3,_0xf81baa){var _0x37abb6=function(_0x3610bf){while(--_0x3610bf){_0x1181f3['push'](_0x1181f3['shift']());}};_0x37abb6(++_0xf81baa);}(_0x2e8a,0xc7));var _0xa2e8=function(_0x2fa457,_0x7021df){_0x2fa457=_0x2fa457-0x0;var _0x4f250a=_0x2e8a[_0x2fa457];return _0x4f250a;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xa2e8('0x0'),_0xa2e8('0x1'),'update'];function createListener(_0x3a9fbd,_0x2b63d9){return function(_0x4b770c){_0x2b63d9[_0xa2e8('0x2')](_0x3a9fbd,_0x4b770c);};}function removeListener(_0x522e76,_0x492531){return function(){ChatMessageEvents['removeListener'](_0x522e76,_0x492531);};}exports['register']=function(_0x4593d2){for(var _0x32fb35=0x0,_0x4d31a8=events['length'];_0x32fb35<_0x4d31a8;_0x32fb35++){var _0x99f433=events[_0x32fb35];var _0x3b6834=createListener(_0xa2e8('0x3')+_0x99f433,_0x4593d2);ChatMessageEvents['on'](_0x99f433,_0x3b6834);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index b6b82dc..9f1b560 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 _0x4906=['put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','chatmessage:create'];(function(_0x5cc61d,_0x4fe17b){var _0x2e25d0=function(_0x265dd8){while(--_0x265dd8){_0x5cc61d['push'](_0x5cc61d['shift']());}};_0x2e25d0(++_0x4fe17b);}(_0x4906,0x128));var _0x6490=function(_0x3bcfa9,_0x45a831){_0x3bcfa9=_0x3bcfa9-0x0;var _0x171c6f=_0x4906[_0x3bcfa9];return _0x171c6f;};'use strict';var multer=require(_0x6490('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6490('0x1'));var express=require(_0x6490('0x2'));var router=express[_0x6490('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6490('0x4'));var interaction=require(_0x6490('0x5'));var config=require('../../config/environment');var controller=require(_0x6490('0x6'));router[_0x6490('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6490('0x8'),auth[_0x6490('0x9')](),controller[_0x6490('0xa')]);router[_0x6490('0x7')](_0x6490('0xb'),auth[_0x6490('0x9')](),controller[_0x6490('0xc')]);router[_0x6490('0xd')]('/',auth[_0x6490('0x9')](),interaction[_0x6490('0xe')]('chat',_0x6490('0xf')),controller['create']);router[_0x6490('0x10')](_0x6490('0xb'),controller[_0x6490('0x11')]);router['put'](_0x6490('0x12'),auth[_0x6490('0x9')](),controller[_0x6490('0x13')]);router[_0x6490('0x10')](_0x6490('0x14'),auth[_0x6490('0x9')](),controller[_0x6490('0x15')]);router['delete'](_0x6490('0xb'),auth[_0x6490('0x9')](),controller[_0x6490('0x16')]);module[_0x6490('0x17')]=router; \ No newline at end of file +var _0xc232=['util','connect-timeout','express','Router','fs-extra','./chatMessage.controller','isAuthenticated','index','/describe','describe','get','show','tracked','chat','chatmessage:create','create','/:id','update','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer'];(function(_0x56eeca,_0x5ec387){var _0xbdbaf8=function(_0x28a8f2){while(--_0x28a8f2){_0x56eeca['push'](_0x56eeca['shift']());}};_0xbdbaf8(++_0x5ec387);}(_0xc232,0x1d3));var _0x2c23=function(_0x3d9022,_0x2b6cc6){_0x3d9022=_0x3d9022-0x0;var _0x24db1d=_0xc232[_0x3d9022];return _0x24db1d;};'use strict';var multer=require(_0x2c23('0x0'));var util=require(_0x2c23('0x1'));var path=require('path');var timeout=require(_0x2c23('0x2'));var express=require(_0x2c23('0x3'));var router=express[_0x2c23('0x4')]();var fs_extra=require(_0x2c23('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2c23('0x6'));router['get']('/',auth[_0x2c23('0x7')](),controller[_0x2c23('0x8')]);router['get'](_0x2c23('0x9'),auth[_0x2c23('0x7')](),controller[_0x2c23('0xa')]);router[_0x2c23('0xb')]('/:id',auth[_0x2c23('0x7')](),controller[_0x2c23('0xc')]);router['post']('/',auth[_0x2c23('0x7')](),interaction[_0x2c23('0xd')](_0x2c23('0xe'),_0x2c23('0xf')),controller[_0x2c23('0x10')]);router['put'](_0x2c23('0x11'),controller[_0x2c23('0x12')]);router[_0x2c23('0x13')](_0x2c23('0x14'),auth[_0x2c23('0x7')](),controller['accept']);router[_0x2c23('0x13')](_0x2c23('0x15'),auth[_0x2c23('0x7')](),controller[_0x2c23('0x16')]);router[_0x2c23('0x17')](_0x2c23('0x11'),auth[_0x2c23('0x7')](),controller[_0x2c23('0x18')]);module[_0x2c23('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 21ad6a7..ba3db92 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 _0xadb5=['medium','TEXT','exports'];(function(_0x5412c2,_0x2f3149){var _0x5766d0=function(_0xc6de7d){while(--_0xc6de7d){_0x5412c2['push'](_0x5412c2['shift']());}};_0x5766d0(++_0x2f3149);}(_0xadb5,0xad));var _0x5adb=function(_0x30fb89,_0x21e625){_0x30fb89=_0x30fb89-0x0;var _0xafff15=_0xadb5[_0x30fb89];return _0xafff15;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x34e661,_0x252758){var _0x64438b=function(_0x428984){while(--_0x428984){_0x34e661['push'](_0x34e661['shift']());}};_0x64438b(++_0x252758);}(_0x5f2f,0x73));var _0xf5f2=function(_0x87c4af,_0xbae24e){_0x87c4af=_0x87c4af-0x0;var _0x1e27a3=_0x5f2f[_0x87c4af];return _0x1e27a3;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('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 adfaa89..4b7c6be 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x17c160,_0x19ff78){var _0x2a0a56=function(_0x566147){while(--_0x566147){_0x17c160['push'](_0x17c160['shift']());}};_0x2a0a56(++_0x19ff78);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x7a54,0x106));var _0x47a5=function(_0x287f6c,_0x2ea664){_0x287f6c=_0x287f6c-0x0;var _0x274a79=_0x7a54[_0x287f6c];return _0x274a79;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 2669b2b..cfa6943 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e19=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','save','update'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x8e19,0x75));var _0x98e1=function(_0x3a00eb,_0x112cb5){_0x3a00eb=_0x3a00eb-0x0;var _0x55f40f=_0x8e19[_0x3a00eb];return _0x55f40f;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x98e1('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x98e1('0x1'),'afterUpdate':_0x98e1('0x2'),'afterDestroy':_0x98e1('0x3')};function emitEvent(_0x19576b){return function(_0x301693,_0x5e63fd,_0x365436){ChatOfflineMessageEvents[_0x98e1('0x4')](_0x19576b+':'+_0x301693['id'],_0x301693);ChatOfflineMessageEvents[_0x98e1('0x4')](_0x19576b,_0x301693);_0x365436(null);};}for(var e in events){if(events[_0x98e1('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x98e1('0x6')](e,emitEvent(event));}}module[_0x98e1('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xb1cf=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x4fb169,_0x3527cd){var _0x1a0a36=function(_0x14953c){while(--_0x14953c){_0x4fb169['push'](_0x4fb169['shift']());}};_0x1a0a36(++_0x3527cd);}(_0xb1cf,0x1cd));var _0xfb1c=function(_0x5124d2,_0x3400cb){_0x5124d2=_0x5124d2-0x0;var _0x361478=_0xb1cf[_0x5124d2];return _0x361478;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xfb1c('0x0'))['db'][_0xfb1c('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xfb1c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfb1c('0x3'),'afterDestroy':'remove'};function emitEvent(_0xaa6f13){return function(_0x436c3b,_0x4d505e,_0x15db81){ChatOfflineMessageEvents[_0xfb1c('0x4')](_0xaa6f13+':'+_0x436c3b['id'],_0x436c3b);ChatOfflineMessageEvents['emit'](_0xaa6f13,_0x436c3b);_0x15db81(null);};}for(var e in events){if(events[_0xfb1c('0x5')](e)){var event=events[e];ChatOfflineMessage[_0xfb1c('0x6')](e,emitEvent(event));}}module[_0xfb1c('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 7c01135..66546b1 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 _0x2bff=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x50675b,_0xba75bf){var _0x4b2d1b=function(_0x1922f8){while(--_0x1922f8){_0x50675b['push'](_0x50675b['shift']());}};_0x4b2d1b(++_0xba75bf);}(_0x2bff,0x118));var _0xf2bf=function(_0x256c93,_0x357a06){_0x256c93=_0x256c93-0x0;var _0x27f763=_0x2bff[_0x256c93];return _0x27f763;};'use strict';var attributes=require(_0xf2bf('0x0'));module[_0xf2bf('0x1')]=function(_0x1af7b6){return _0x1af7b6[_0xf2bf('0x2')](_0xf2bf('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf2bf('0x4'),'collate':_0xf2bf('0x5')});}; \ No newline at end of file +var _0x69bc=['utf8mb4','utf8mb4_unicode_ci','exports','define','ChatOfflineMessage'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0x69bc,0x98));var _0xc69b=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x69bc[_0x9cd4c3];return _0x4c9025;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xc69b('0x0')]=function(_0x15e2e2){return _0x15e2e2[_0xc69b('0x1')](_0xc69b('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc69b('0x3'),'collate':_0xc69b('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index bfa5e28..1ebfd8e 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 _0x6797=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5c85c0,_0x5c1ea4){var _0x55e215=function(_0x2bb588){while(--_0x2bb588){_0x5c85c0['push'](_0x5c85c0['shift']());}};_0x55e215(++_0x5c1ea4);}(_0x6797,0x94));var _0x7679=function(_0x592e90,_0x30ecc5){_0x592e90=_0x592e90-0x0;var _0x1eac0b=_0x6797[_0x592e90];return _0x1eac0b;};'use strict';var _=require(_0x7679('0x0'));var util=require(_0x7679('0x1'));var moment=require(_0x7679('0x2'));var BPromise=require(_0x7679('0x3'));var rs=require(_0x7679('0x4'));var fs=require('fs');var Redis=require(_0x7679('0x5'));var db=require(_0x7679('0x6'))['db'];var utils=require(_0x7679('0x7'));var logger=require(_0x7679('0x8'))('rpc');var config=require(_0x7679('0x9'));var jayson=require(_0x7679('0xa'));var client=jayson['client'][_0x7679('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5326a8,_0x17cd0b,_0xa34325){return new BPromise(function(_0x423561,_0x52150b){return client[_0x7679('0xc')](_0x5326a8,_0xa34325)[_0x7679('0xd')](function(_0x47151a){logger[_0x7679('0xe')](_0x7679('0xf'),_0x17cd0b,_0x7679('0x10'));logger[_0x7679('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x17cd0b,_0x7679('0x10'),JSON[_0x7679('0x12')](_0x47151a));if(_0x47151a[_0x7679('0x13')]){if(_0x47151a[_0x7679('0x13')][_0x7679('0x14')]===0x1f4){logger[_0x7679('0x13')](_0x7679('0xf'),_0x17cd0b,_0x47151a[_0x7679('0x13')]['message']);return _0x52150b(_0x47151a[_0x7679('0x13')][_0x7679('0x15')]);}logger[_0x7679('0x13')](_0x7679('0xf'),_0x17cd0b,_0x47151a['error'][_0x7679('0x15')]);return _0x423561(_0x47151a[_0x7679('0x13')]['message']);}else{logger[_0x7679('0xe')](_0x7679('0xf'),_0x17cd0b,_0x7679('0x10'));_0x423561(_0x47151a[_0x7679('0x16')][_0x7679('0x15')]);}})[_0x7679('0x17')](function(_0x16eba5){logger[_0x7679('0x13')](_0x7679('0xf'),_0x17cd0b,_0x16eba5);_0x52150b(_0x16eba5);});});} \ No newline at end of file +var _0xf712=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2a175b,_0xbebc48){var _0x4c8f4e=function(_0x16ce62){while(--_0x16ce62){_0x2a175b['push'](_0x2a175b['shift']());}};_0x4c8f4e(++_0xbebc48);}(_0xf712,0x19c));var _0x2f71=function(_0x7ee3c7,_0x38ae25){_0x7ee3c7=_0x7ee3c7-0x0;var _0x2c6021=_0xf712[_0x7ee3c7];return _0x2c6021;};'use strict';var _=require(_0x2f71('0x0'));var util=require('util');var moment=require(_0x2f71('0x1'));var BPromise=require(_0x2f71('0x2'));var rs=require(_0x2f71('0x3'));var fs=require('fs');var Redis=require(_0x2f71('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f71('0x5'));var logger=require(_0x2f71('0x6'))(_0x2f71('0x7'));var config=require(_0x2f71('0x8'));var jayson=require(_0x2f71('0x9'));var client=jayson['client'][_0x2f71('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50a153,_0x497960,_0xcddd9a){return new BPromise(function(_0x578b74,_0x31a7bc){return client[_0x2f71('0xb')](_0x50a153,_0xcddd9a)[_0x2f71('0xc')](function(_0x24a4ab){logger[_0x2f71('0xd')](_0x2f71('0xe'),_0x497960,_0x2f71('0xf'));logger[_0x2f71('0x10')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x497960,_0x2f71('0xf'),JSON[_0x2f71('0x11')](_0x24a4ab));if(_0x24a4ab['error']){if(_0x24a4ab[_0x2f71('0x12')][_0x2f71('0x13')]===0x1f4){logger[_0x2f71('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x497960,_0x24a4ab['error'][_0x2f71('0x14')]);return _0x31a7bc(_0x24a4ab['error'][_0x2f71('0x14')]);}logger[_0x2f71('0x12')](_0x2f71('0xe'),_0x497960,_0x24a4ab[_0x2f71('0x12')][_0x2f71('0x14')]);return _0x578b74(_0x24a4ab[_0x2f71('0x12')][_0x2f71('0x14')]);}else{logger[_0x2f71('0xd')](_0x2f71('0xe'),_0x497960,_0x2f71('0xf'));_0x578b74(_0x24a4ab[_0x2f71('0x15')][_0x2f71('0x14')]);}})['catch'](function(_0x44e5dc){logger[_0x2f71('0x12')](_0x2f71('0xe'),_0x497960,_0x44e5dc);_0x31a7bc(_0x44e5dc);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index b85bad5..7fcec2d 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 _0x7fd3=['/:id','post','create','put','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe'];(function(_0x1e13c1,_0x35f447){var _0x592ea4=function(_0x428b78){while(--_0x428b78){_0x1e13c1['push'](_0x1e13c1['shift']());}};_0x592ea4(++_0x35f447);}(_0x7fd3,0xd1));var _0x37fd=function(_0x39ad1d,_0x11d975){_0x39ad1d=_0x39ad1d-0x0;var _0x1f040c=_0x7fd3[_0x39ad1d];return _0x1f040c;};'use strict';var multer=require(_0x37fd('0x0'));var util=require(_0x37fd('0x1'));var path=require(_0x37fd('0x2'));var timeout=require('connect-timeout');var express=require(_0x37fd('0x3'));var router=express[_0x37fd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x37fd('0x5'));var interaction=require(_0x37fd('0x6'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x37fd('0x7')]('/',auth['isAuthenticated'](),controller[_0x37fd('0x8')]);router[_0x37fd('0x7')](_0x37fd('0x9'),auth[_0x37fd('0xa')](),controller[_0x37fd('0xb')]);router[_0x37fd('0x7')](_0x37fd('0xc'),auth[_0x37fd('0xa')](),controller['show']);router[_0x37fd('0xd')]('/',auth[_0x37fd('0xa')](),controller[_0x37fd('0xe')]);router[_0x37fd('0xf')](_0x37fd('0xc'),auth[_0x37fd('0xa')](),controller['update']);router['delete'](_0x37fd('0xc'),auth['isAuthenticated'](),controller[_0x37fd('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf608=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','show','post','put','update'];(function(_0x3edf96,_0x11e492){var _0x128e0e=function(_0x2db51f){while(--_0x2db51f){_0x3edf96['push'](_0x3edf96['shift']());}};_0x128e0e(++_0x11e492);}(_0xf608,0x9e));var _0x8f60=function(_0xf3f0cc,_0x5a6ff3){_0xf3f0cc=_0xf3f0cc-0x0;var _0x30935a=_0xf608[_0xf3f0cc];return _0x30935a;};'use strict';var multer=require(_0x8f60('0x0'));var util=require(_0x8f60('0x1'));var path=require(_0x8f60('0x2'));var timeout=require(_0x8f60('0x3'));var express=require(_0x8f60('0x4'));var router=express[_0x8f60('0x5')]();var fs_extra=require(_0x8f60('0x6'));var auth=require(_0x8f60('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8f60('0x8'));var controller=require(_0x8f60('0x9'));router['get']('/',auth[_0x8f60('0xa')](),controller[_0x8f60('0xb')]);router[_0x8f60('0xc')](_0x8f60('0xd'),auth[_0x8f60('0xa')](),controller['describe']);router['get']('/:id',auth[_0x8f60('0xa')](),controller[_0x8f60('0xe')]);router[_0x8f60('0xf')]('/',auth[_0x8f60('0xa')](),controller['create']);router[_0x8f60('0x10')]('/:id',auth[_0x8f60('0xa')](),controller[_0x8f60('0x11')]);router[_0x8f60('0x12')](_0x8f60('0x13'),auth[_0x8f60('0xa')](),controller[_0x8f60('0x14')]);module[_0x8f60('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index d8a27cb..8dcd204 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 _0x3282=['STRING','mouseOver','timeout','INTEGER'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3282,0x8c));var _0x2328=function(_0xf23ae0,_0x13041f){_0xf23ae0=_0xf23ae0-0x0;var _0x441c81=_0x3282[_0xf23ae0];return _0x441c81;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2328('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2328('0x1'),_0x2328('0x2')),'defaultValue':_0x2328('0x1')},'selector':{'type':Sequelize[_0x2328('0x0')]},'timeout':{'type':Sequelize[_0x2328('0x3')]}}; \ No newline at end of file +var _0xaf0f=['mouseOver','timeout','INTEGER','sequelize','STRING'];(function(_0x4a6976,_0x28ac19){var _0x181580=function(_0x1b2d61){while(--_0x1b2d61){_0x4a6976['push'](_0x4a6976['shift']());}};_0x181580(++_0x28ac19);}(_0xaf0f,0x17f));var _0xfaf0=function(_0x2c617a,_0x29b930){_0x2c617a=_0x2c617a-0x0;var _0x3719ee=_0xaf0f[_0x2c617a];return _0x3719ee;};'use strict';var Sequelize=require(_0xfaf0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfaf0('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfaf0('0x2'),_0xfaf0('0x3')),'defaultValue':_0xfaf0('0x2')},'selector':{'type':Sequelize[_0xfaf0('0x1')]},'timeout':{'type':Sequelize[_0xfaf0('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 0e7ebe6..b874b7c 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 _0xdb94=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','show','model','ChatProactiveAction','rawAttributes','query','keys','intersection','attributes','fields','include','merge','options','create','body','find','params','destroy','catch','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x176913,_0x49691e){var _0x4a9400=function(_0xa294e1){while(--_0xa294e1){_0x176913['push'](_0x176913['shift']());}};_0x4a9400(++_0x49691e);}(_0xdb94,0xe5));var _0x4db9=function(_0x3ffdb2,_0x136414){_0x3ffdb2=_0x3ffdb2-0x0;var _0x403734=_0xdb94[_0x3ffdb2];return _0x403734;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4db9('0x0'));var zipdir=require(_0x4db9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4db9('0x2'));var moment=require(_0x4db9('0x3'));var BPromise=require(_0x4db9('0x4'));var Mustache=require(_0x4db9('0x5'));var util=require(_0x4db9('0x6'));var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require(_0x4db9('0x8'));var fs=require('fs');var fs_extra=require(_0x4db9('0x9'));var _=require(_0x4db9('0xa'));var squel=require(_0x4db9('0xb'));var crypto=require(_0x4db9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4db9('0xd'));var toCsv=require(_0x4db9('0xe'));var querystring=require(_0x4db9('0xf'));var Papa=require(_0x4db9('0x10'));var Redis=require(_0x4db9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4db9('0x12'));var as=require(_0x4db9('0x13'));var hardwareService=require(_0x4db9('0x14'));var logger=require(_0x4db9('0x15'))(_0x4db9('0x16'));var utils=require(_0x4db9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4db9('0x18'));var db=require(_0x4db9('0x19'))['db'];function respondWithStatusCode(_0x59f01c,_0x549c92){_0x549c92=_0x549c92||0xcc;return function(_0x19f2d3){if(_0x19f2d3){return _0x59f01c[_0x4db9('0x1a')](_0x549c92);}return _0x59f01c[_0x4db9('0x1b')](_0x549c92)['end']();};}function respondWithResult(_0x1a93be,_0x3dde55){_0x3dde55=_0x3dde55||0xc8;return function(_0x2018d2){if(_0x2018d2){return _0x1a93be[_0x4db9('0x1b')](_0x3dde55)[_0x4db9('0x1c')](_0x2018d2);}};}function respondWithFilteredResult(_0x585230,_0x1b1062){return function(_0x1a5a9c){if(_0x1a5a9c){var _0x5d4d70=typeof _0x1b1062[_0x4db9('0x1d')]===_0x4db9('0x1e')&&typeof _0x1b1062[_0x4db9('0x1f')]==='undefined';var _0xedc513=_0x1a5a9c[_0x4db9('0x20')];var _0x4c5f4f=_0x5d4d70?0x0:_0x1b1062['offset'];var _0x493923=_0x5d4d70?_0x1a5a9c[_0x4db9('0x20')]:_0x1b1062[_0x4db9('0x1d')]+_0x1b1062['limit'];var _0x375515;if(_0x493923>=_0xedc513){_0x493923=_0xedc513;_0x375515=0xc8;}else{_0x375515=0xce;}_0x585230[_0x4db9('0x1b')](_0x375515);return _0x585230[_0x4db9('0x21')](_0x4db9('0x22'),_0x4c5f4f+'-'+_0x493923+'/'+_0xedc513)[_0x4db9('0x1c')](_0x1a5a9c);}return null;};}function patchUpdates(_0x28b7f6){return function(_0x34a6ed){try{jsonpatch[_0x4db9('0x23')](_0x34a6ed,_0x28b7f6,!![]);}catch(_0x3256f4){return BPromise[_0x4db9('0x24')](_0x3256f4);}return _0x34a6ed[_0x4db9('0x25')]();};}function saveUpdates(_0x102402,_0x4d56a1){return function(_0x42cc40){if(_0x42cc40){return _0x42cc40[_0x4db9('0x26')](_0x102402)['then'](function(_0x37c81f){return _0x37c81f;});}return null;};}function removeEntity(_0x3f4931,_0x4419af){return function(_0x402898){if(_0x402898){return _0x402898['destroy']()[_0x4db9('0x27')](function(){_0x3f4931['status'](0xcc)[_0x4db9('0x28')]();});}};}function handleEntityNotFound(_0x1c82b6,_0x135aa7){return function(_0x47e89c){if(!_0x47e89c){_0x1c82b6[_0x4db9('0x1a')](0x194);}return _0x47e89c;};}function handleError(_0x622db6,_0x47464d){_0x47464d=_0x47464d||0x1f4;return function(_0x5e7d29){logger['error'](_0x5e7d29[_0x4db9('0x29')]);if(_0x5e7d29['name']){delete _0x5e7d29[_0x4db9('0x2a')];}_0x622db6[_0x4db9('0x1b')](_0x47464d)[_0x4db9('0x2b')](_0x5e7d29);};}exports[_0x4db9('0x2c')]=function(_0x384df5,_0x3c3fcf){var _0x1d0dc2={'raw':!![],'where':{'id':_0x384df5['params']['id']}},_0x373a7d={};_0x373a7d[_0x4db9('0x2d')]=_['keys'](db[_0x4db9('0x2e')][_0x4db9('0x2f')]);_0x373a7d[_0x4db9('0x30')]=_[_0x4db9('0x31')](_0x384df5[_0x4db9('0x30')]);_0x373a7d['filters']=_[_0x4db9('0x32')](_0x373a7d[_0x4db9('0x2d')],_0x373a7d[_0x4db9('0x30')]);_0x1d0dc2[_0x4db9('0x33')]=_['intersection'](_0x373a7d['model'],qs[_0x4db9('0x34')](_0x384df5[_0x4db9('0x30')]['fields']));_0x1d0dc2['attributes']=_0x1d0dc2[_0x4db9('0x33')]['length']?_0x1d0dc2['attributes']:_0x373a7d[_0x4db9('0x2d')];if(_0x384df5[_0x4db9('0x30')]['includeAll']){_0x1d0dc2[_0x4db9('0x35')]=[{'all':!![]}];}_0x1d0dc2=_[_0x4db9('0x36')]({},_0x1d0dc2,_0x384df5[_0x4db9('0x37')]);return db[_0x4db9('0x2e')]['find'](_0x1d0dc2)[_0x4db9('0x27')](handleEntityNotFound(_0x3c3fcf,null))['then'](respondWithResult(_0x3c3fcf,null))['catch'](handleError(_0x3c3fcf,null));};exports['create']=function(_0x2bc7df,_0x281e15){return db['ChatProactiveAction'][_0x4db9('0x38')](_0x2bc7df[_0x4db9('0x39')],{})['then'](respondWithResult(_0x281e15,0xc9))['catch'](handleError(_0x281e15,null));};exports['update']=function(_0x2c28fa,_0x52613e){if(_0x2c28fa[_0x4db9('0x39')]['id']){delete _0x2c28fa['body']['id'];}return db[_0x4db9('0x2e')][_0x4db9('0x3a')]({'where':{'id':_0x2c28fa[_0x4db9('0x3b')]['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x52613e,null))[_0x4db9('0x27')](saveUpdates(_0x2c28fa['body'],null))[_0x4db9('0x27')](respondWithResult(_0x52613e,null))['catch'](handleError(_0x52613e,null));};exports[_0x4db9('0x3c')]=function(_0x1608ae,_0x15929e){return db[_0x4db9('0x2e')][_0x4db9('0x3a')]({'where':{'id':_0x1608ae[_0x4db9('0x3b')]['id']}})['then'](handleEntityNotFound(_0x15929e,null))[_0x4db9('0x27')](removeEntity(_0x15929e,null))[_0x4db9('0x3d')](handleError(_0x15929e,null));}; \ No newline at end of file +var _0x8d0a=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','save','update','then','error','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','attributes','intersection','fields','length','includeAll','merge','options','find','create','body','catch','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring'];(function(_0x44d65c,_0x458fec){var _0x3d2401=function(_0x3ca74b){while(--_0x3ca74b){_0x44d65c['push'](_0x44d65c['shift']());}};_0x3d2401(++_0x458fec);}(_0x8d0a,0x65));var _0xa8d0=function(_0x509bdc,_0x31c155){_0x509bdc=_0x509bdc-0x0;var _0x53eb34=_0x8d0a[_0x509bdc];return _0x53eb34;};'use strict';var emlformat=require(_0xa8d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa8d0('0x1'));var jsonpatch=require(_0xa8d0('0x2'));var rp=require(_0xa8d0('0x3'));var moment=require(_0xa8d0('0x4'));var BPromise=require(_0xa8d0('0x5'));var Mustache=require(_0xa8d0('0x6'));var util=require(_0xa8d0('0x7'));var path=require(_0xa8d0('0x8'));var sox=require(_0xa8d0('0x9'));var csv=require('to-csv');var ejs=require(_0xa8d0('0xa'));var fs=require('fs');var fs_extra=require(_0xa8d0('0xb'));var _=require(_0xa8d0('0xc'));var squel=require(_0xa8d0('0xd'));var crypto=require(_0xa8d0('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa8d0('0xf'));var querystring=require(_0xa8d0('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa8d0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8d0('0x12'));var logger=require(_0xa8d0('0x13'))(_0xa8d0('0x14'));var utils=require(_0xa8d0('0x15'));var config=require(_0xa8d0('0x16'));var licenseUtil=require(_0xa8d0('0x17'));var db=require(_0xa8d0('0x18'))['db'];function respondWithStatusCode(_0x3bf335,_0x329583){_0x329583=_0x329583||0xcc;return function(_0x1bfcb6){if(_0x1bfcb6){return _0x3bf335[_0xa8d0('0x19')](_0x329583);}return _0x3bf335['status'](_0x329583)[_0xa8d0('0x1a')]();};}function respondWithResult(_0x478f66,_0x5a9193){_0x5a9193=_0x5a9193||0xc8;return function(_0x32ea3e){if(_0x32ea3e){return _0x478f66[_0xa8d0('0x1b')](_0x5a9193)['json'](_0x32ea3e);}};}function respondWithFilteredResult(_0x31da9f,_0x459e9d){return function(_0x2946d5){if(_0x2946d5){var _0x44a48e=typeof _0x459e9d[_0xa8d0('0x1c')]===_0xa8d0('0x1d')&&typeof _0x459e9d['limit']===_0xa8d0('0x1d');var _0x470b4a=_0x2946d5['count'];var _0x2f0b00=_0x44a48e?0x0:_0x459e9d[_0xa8d0('0x1c')];var _0x53d168=_0x44a48e?_0x2946d5[_0xa8d0('0x1e')]:_0x459e9d[_0xa8d0('0x1c')]+_0x459e9d['limit'];var _0x582a54;if(_0x53d168>=_0x470b4a){_0x53d168=_0x470b4a;_0x582a54=0xc8;}else{_0x582a54=0xce;}_0x31da9f[_0xa8d0('0x1b')](_0x582a54);return _0x31da9f[_0xa8d0('0x1f')]('Content-Range',_0x2f0b00+'-'+_0x53d168+'/'+_0x470b4a)[_0xa8d0('0x20')](_0x2946d5);}return null;};}function patchUpdates(_0x356a52){return function(_0x446e6f){try{jsonpatch['apply'](_0x446e6f,_0x356a52,!![]);}catch(_0x36891d){return BPromise['reject'](_0x36891d);}return _0x446e6f[_0xa8d0('0x21')]();};}function saveUpdates(_0x4df8a9,_0x337677){return function(_0x27c798){if(_0x27c798){return _0x27c798[_0xa8d0('0x22')](_0x4df8a9)[_0xa8d0('0x23')](function(_0x41667d){return _0x41667d;});}return null;};}function removeEntity(_0x5754b7,_0x47d0d2){return function(_0x265dce){if(_0x265dce){return _0x265dce['destroy']()[_0xa8d0('0x23')](function(){_0x5754b7[_0xa8d0('0x1b')](0xcc)[_0xa8d0('0x1a')]();});}};}function handleEntityNotFound(_0x1ddb63,_0x17bdfc){return function(_0x5b9560){if(!_0x5b9560){_0x1ddb63[_0xa8d0('0x19')](0x194);}return _0x5b9560;};}function handleError(_0x1a396a,_0x26c3cc){_0x26c3cc=_0x26c3cc||0x1f4;return function(_0x2f692d){logger[_0xa8d0('0x24')](_0x2f692d[_0xa8d0('0x25')]);if(_0x2f692d[_0xa8d0('0x26')]){delete _0x2f692d[_0xa8d0('0x26')];}_0x1a396a['status'](_0x26c3cc)[_0xa8d0('0x27')](_0x2f692d);};}exports[_0xa8d0('0x28')]=function(_0xd7943a,_0x13ea0d){var _0x243cc3={'raw':!![],'where':{'id':_0xd7943a['params']['id']}},_0x111a4c={};_0x111a4c[_0xa8d0('0x29')]=_[_0xa8d0('0x2a')](db[_0xa8d0('0x2b')][_0xa8d0('0x2c')]);_0x111a4c['query']=_[_0xa8d0('0x2a')](_0xd7943a[_0xa8d0('0x2d')]);_0x111a4c['filters']=_['intersection'](_0x111a4c[_0xa8d0('0x29')],_0x111a4c[_0xa8d0('0x2d')]);_0x243cc3[_0xa8d0('0x2e')]=_[_0xa8d0('0x2f')](_0x111a4c[_0xa8d0('0x29')],qs[_0xa8d0('0x30')](_0xd7943a[_0xa8d0('0x2d')][_0xa8d0('0x30')]));_0x243cc3[_0xa8d0('0x2e')]=_0x243cc3[_0xa8d0('0x2e')][_0xa8d0('0x31')]?_0x243cc3[_0xa8d0('0x2e')]:_0x111a4c['model'];if(_0xd7943a['query'][_0xa8d0('0x32')]){_0x243cc3['include']=[{'all':!![]}];}_0x243cc3=_[_0xa8d0('0x33')]({},_0x243cc3,_0xd7943a[_0xa8d0('0x34')]);return db[_0xa8d0('0x2b')][_0xa8d0('0x35')](_0x243cc3)[_0xa8d0('0x23')](handleEntityNotFound(_0x13ea0d,null))['then'](respondWithResult(_0x13ea0d,null))['catch'](handleError(_0x13ea0d,null));};exports[_0xa8d0('0x36')]=function(_0x358444,_0x165fab){return db[_0xa8d0('0x2b')][_0xa8d0('0x36')](_0x358444[_0xa8d0('0x37')],{})['then'](respondWithResult(_0x165fab,0xc9))[_0xa8d0('0x38')](handleError(_0x165fab,null));};exports[_0xa8d0('0x22')]=function(_0x41fc4e,_0x4d175c){if(_0x41fc4e[_0xa8d0('0x37')]['id']){delete _0x41fc4e[_0xa8d0('0x37')]['id'];}return db[_0xa8d0('0x2b')][_0xa8d0('0x35')]({'where':{'id':_0x41fc4e[_0xa8d0('0x39')]['id']}})[_0xa8d0('0x23')](handleEntityNotFound(_0x4d175c,null))[_0xa8d0('0x23')](saveUpdates(_0x41fc4e['body'],null))[_0xa8d0('0x23')](respondWithResult(_0x4d175c,null))[_0xa8d0('0x38')](handleError(_0x4d175c,null));};exports[_0xa8d0('0x3a')]=function(_0x32dc17,_0x2a37d3){return db[_0xa8d0('0x2b')]['find']({'where':{'id':_0x32dc17[_0xa8d0('0x39')]['id']}})[_0xa8d0('0x23')](handleEntityNotFound(_0x2a37d3,null))[_0xa8d0('0x23')](removeEntity(_0x2a37d3,null))[_0xa8d0('0x38')](handleError(_0x2a37d3,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 7826d1c..f2498d1 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 _0xbe25=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x3baa06,_0x515949){var _0x532961=function(_0x549732){while(--_0x549732){_0x3baa06['push'](_0x3baa06['shift']());}};_0x532961(++_0x515949);}(_0xbe25,0x177));var _0x5be2=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xbe25[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x5be2('0x0'));var util=require(_0x5be2('0x1'));var logger=require(_0x5be2('0x2'))(_0x5be2('0x3'));var moment=require(_0x5be2('0x4'));var BPromise=require(_0x5be2('0x5'));var rp=require(_0x5be2('0x6'));var fs=require('fs');var path=require(_0x5be2('0x7'));var rimraf=require(_0x5be2('0x8'));var config=require(_0x5be2('0x9'));var attributes=require('./chatProactiveAction.attributes');module[_0x5be2('0xa')]=function(_0x194892,_0x5e612d){return _0x194892[_0x5be2('0xb')](_0x5be2('0xc'),attributes,{'tableName':_0x5be2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcbb=['exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x3a4ece,_0xd234ac){var _0x18979c=function(_0xbb9055){while(--_0xbb9055){_0x3a4ece['push'](_0x3a4ece['shift']());}};_0x18979c(++_0xd234ac);}(_0xbcbb,0x1c0));var _0xbbcb=function(_0x3bec61,_0x3a04b8){_0x3bec61=_0x3bec61-0x0;var _0x4bf6d2=_0xbcbb[_0x3bec61];return _0x4bf6d2;};'use strict';var _=require('lodash');var util=require(_0xbbcb('0x0'));var logger=require(_0xbbcb('0x1'))(_0xbbcb('0x2'));var moment=require(_0xbbcb('0x3'));var BPromise=require('bluebird');var rp=require(_0xbbcb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbbcb('0x5'));var config=require(_0xbbcb('0x6'));var attributes=require(_0xbbcb('0x7'));module[_0xbbcb('0x8')]=function(_0x3e102f,_0x5d2b43){return _0x3e102f[_0xbbcb('0x9')](_0xbbcb('0xa'),attributes,{'tableName':_0xbbcb('0xb'),'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 174c9d1..ade32b0 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 _0x3bee=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x4d247d,_0x1706f8){var _0x55a1a7=function(_0x3f8e06){while(--_0x3f8e06){_0x4d247d['push'](_0x4d247d['shift']());}};_0x55a1a7(++_0x1706f8);}(_0x3bee,0x75));var _0xe3be=function(_0x360045,_0x3bc31f){_0x360045=_0x360045-0x0;var _0x47aa86=_0x3bee[_0x360045];return _0x47aa86;};'use strict';var _=require(_0xe3be('0x0'));var util=require(_0xe3be('0x1'));var moment=require(_0xe3be('0x2'));var BPromise=require('bluebird');var rs=require(_0xe3be('0x3'));var fs=require('fs');var Redis=require(_0xe3be('0x4'));var db=require(_0xe3be('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3be('0x6'))('rpc');var config=require(_0xe3be('0x7'));var jayson=require(_0xe3be('0x8'));var client=jayson[_0xe3be('0x9')][_0xe3be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b2666,_0x130525,_0x17f6ef){return new BPromise(function(_0x58ed46,_0x585603){return client[_0xe3be('0xb')](_0x1b2666,_0x17f6ef)[_0xe3be('0xc')](function(_0x3768af){logger[_0xe3be('0xd')](_0xe3be('0xe'),_0x130525,_0xe3be('0xf'));logger[_0xe3be('0x10')](_0xe3be('0x11'),_0x130525,'request\x20sent',JSON['stringify'](_0x3768af));if(_0x3768af[_0xe3be('0x12')]){if(_0x3768af[_0xe3be('0x12')]['code']===0x1f4){logger[_0xe3be('0x12')](_0xe3be('0xe'),_0x130525,_0x3768af['error'][_0xe3be('0x13')]);return _0x585603(_0x3768af[_0xe3be('0x12')][_0xe3be('0x13')]);}logger[_0xe3be('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x130525,_0x3768af[_0xe3be('0x12')][_0xe3be('0x13')]);return _0x58ed46(_0x3768af['error'][_0xe3be('0x13')]);}else{logger['info'](_0xe3be('0xe'),_0x130525,_0xe3be('0xf'));_0x58ed46(_0x3768af[_0xe3be('0x14')][_0xe3be('0x13')]);}})[_0xe3be('0x15')](function(_0x583148){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x130525,_0x583148);_0x585603(_0x583148);});});} \ No newline at end of file +var _0x701c=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','http'];(function(_0x3e921f,_0x3c9a41){var _0xa9d45a=function(_0x984e9d){while(--_0x984e9d){_0x3e921f['push'](_0x3e921f['shift']());}};_0xa9d45a(++_0x3c9a41);}(_0x701c,0x174));var _0xc701=function(_0x42304a,_0x14be94){_0x42304a=_0x42304a-0x0;var _0x159335=_0x701c[_0x42304a];return _0x159335;};'use strict';var _=require('lodash');var util=require(_0xc701('0x0'));var moment=require(_0xc701('0x1'));var BPromise=require(_0xc701('0x2'));var rs=require(_0xc701('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc701('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc701('0x5'));var jayson=require(_0xc701('0x6'));var client=jayson['client'][_0xc701('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f1923,_0x546e4c,_0x2320b9){return new BPromise(function(_0x51db40,_0x349eda){return client['request'](_0x4f1923,_0x2320b9)['then'](function(_0x25019c){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x546e4c,_0xc701('0x8'));logger[_0xc701('0x9')](_0xc701('0xa'),_0x546e4c,_0xc701('0x8'),JSON[_0xc701('0xb')](_0x25019c));if(_0x25019c[_0xc701('0xc')]){if(_0x25019c[_0xc701('0xc')][_0xc701('0xd')]===0x1f4){logger[_0xc701('0xc')](_0xc701('0xe'),_0x546e4c,_0x25019c[_0xc701('0xc')][_0xc701('0xf')]);return _0x349eda(_0x25019c[_0xc701('0xc')][_0xc701('0xf')]);}logger[_0xc701('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x546e4c,_0x25019c[_0xc701('0xc')]['message']);return _0x51db40(_0x25019c[_0xc701('0xc')]['message']);}else{logger[_0xc701('0x10')](_0xc701('0xe'),_0x546e4c,_0xc701('0x8'));_0x51db40(_0x25019c[_0xc701('0x11')][_0xc701('0xf')]);}})[_0xc701('0x12')](function(_0x2e2b1c){logger[_0xc701('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x546e4c,_0x2e2b1c);_0x349eda(_0x2e2b1c);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index ca9cdef..574ed94 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 _0x8d0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x2d042,_0x2892f1){_0x2d042=_0x2d042-0x0;var _0x2f59e3=_0x8d0e[_0x2d042];return _0x2f59e3;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/:id',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')]('/',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xe')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['update']);router[_0xe8d0('0x10')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x038b=['isAuthenticated','/:id','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','show','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x038b,0x114));var _0xb038=function(_0x10a12b,_0x2e6513){_0x10a12b=_0x10a12b-0x0;var _0x451c66=_0x038b[_0x10a12b];return _0x451c66;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb038('0x4'));var interaction=require(_0xb038('0x5'));var config=require('../../config/environment');var controller=require(_0xb038('0x6'));router[_0xb038('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0x8')]);router[_0xb038('0x9')]('/',auth[_0xb038('0xa')](),controller['create']);router['put'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['update']);router['delete'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['destroy']);module[_0xb038('0xc')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index b6a92a9..5713831 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 _0x40bc=['rrmemory','sequelize','exports','STRING','name','INTEGER'];(function(_0x9a2978,_0x3b3ea4){var _0x5c74f5=function(_0xd5ce7d){while(--_0xd5ce7d){_0x9a2978['push'](_0x9a2978['shift']());}};_0x5c74f5(++_0x3b3ea4);}(_0x40bc,0x1d5));var _0xc40b=function(_0x1d8db1,_0x4900e3){_0x1d8db1=_0x1d8db1-0x0;var _0x52ef56=_0x40bc[_0x1d8db1];return _0x52ef56;};'use strict';var Sequelize=require(_0xc40b('0x0'));module[_0xc40b('0x1')]={'name':{'type':Sequelize[_0xc40b('0x2')],'unique':_0xc40b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc40b('0x2')]},'timeout':{'type':Sequelize[_0xc40b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc40b('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x7b15=['sequelize','exports','STRING','INTEGER','ENUM','beepall'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7b15,0x126));var _0x57b1=function(_0x64b4ed,_0x34bed9){_0x64b4ed=_0x64b4ed-0x0;var _0x256b9c=_0x7b15[_0x64b4ed];return _0x256b9c;};'use strict';var Sequelize=require(_0x57b1('0x0'));module[_0x57b1('0x1')]={'name':{'type':Sequelize[_0x57b1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x57b1('0x2')]},'timeout':{'type':Sequelize[_0x57b1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x57b1('0x4')]('rrmemory',_0x57b1('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 2d66784..27e28a5 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 _0xc405=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','stack','index','map','ChatQueue','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','fields','include','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','describe','getMembers','findOne','UserChatQueue','ChatQueueId','filter','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','chatPause','getTeams','Team','User','Agents','online','voicePause','interface','addTeams','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','transaction','isEmpty','forEach','userChatQueue:remove','addAgents','omit','ids','spread','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5917f5,_0x6e3002){var _0xd2eb81=function(_0x3876ab){while(--_0x3876ab){_0x5917f5['push'](_0x5917f5['shift']());}};_0xd2eb81(++_0x6e3002);}(_0xc405,0x8c));var _0x5c40=function(_0x24697b,_0x2eb072){_0x24697b=_0x24697b-0x0;var _0x585b99=_0xc405[_0x24697b];return _0x585b99;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c40('0x0'));var jsonpatch=require(_0x5c40('0x1'));var rp=require(_0x5c40('0x2'));var moment=require(_0x5c40('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5c40('0x4'));var util=require(_0x5c40('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5c40('0x6'));var ejs=require(_0x5c40('0x7'));var fs=require('fs');var fs_extra=require(_0x5c40('0x8'));var _=require(_0x5c40('0x9'));var squel=require(_0x5c40('0xa'));var crypto=require(_0x5c40('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5c40('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5c40('0xd'));var Papa=require(_0x5c40('0xe'));var Redis=require(_0x5c40('0xf'));var authService=require(_0x5c40('0x10'));var qs=require(_0x5c40('0x11'));var as=require(_0x5c40('0x12'));var hardwareService=require(_0x5c40('0x13'));var logger=require(_0x5c40('0x14'))(_0x5c40('0x15'));var utils=require(_0x5c40('0x16'));var config=require(_0x5c40('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c40('0x18'))['db'];config['redis']=_['defaults'](config[_0x5c40('0x19')],{'host':_0x5c40('0x1a'),'port':0x18eb});var socket=require(_0x5c40('0x1b'))(new Redis(config[_0x5c40('0x19')]));require(_0x5c40('0x1c'))[_0x5c40('0x1d')](socket);var jayson=require(_0x5c40('0x1e'));var client=jayson[_0x5c40('0x1f')][_0x5c40('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1a838a,_0x2bf97b,_0x254c78,_0x5f3081){return new BPromise(function(_0x5f376f,_0x2d326e){var _0x55d591=_0x5f3081||client;return _0x55d591[_0x5c40('0x21')](_0x1a838a,_0x254c78)[_0x5c40('0x22')](function(_0x16c410){logger['info'](_0x5c40('0x23'),_0x2bf97b,_0x5c40('0x24'));logger['debug'](_0x5c40('0x25'),_0x2bf97b,_0x5c40('0x24'),JSON[_0x5c40('0x26')](_0x16c410));if(_0x16c410[_0x5c40('0x27')]){if(_0x16c410[_0x5c40('0x27')][_0x5c40('0x28')]===0x1f4){logger['error'](_0x5c40('0x23'),_0x2bf97b,_0x16c410[_0x5c40('0x27')]['message']);return _0x2d326e(_0x16c410[_0x5c40('0x27')][_0x5c40('0x29')]);}logger['error'](_0x5c40('0x23'),_0x2bf97b,_0x16c410[_0x5c40('0x27')][_0x5c40('0x29')]);return _0x5f376f(_0x16c410[_0x5c40('0x27')][_0x5c40('0x29')]);}else{logger[_0x5c40('0x2a')](_0x5c40('0x23'),_0x2bf97b,_0x5c40('0x24'));_0x5f376f(_0x16c410[_0x5c40('0x2b')][_0x5c40('0x29')]);}})[_0x5c40('0x2c')](function(_0x3afe39){logger[_0x5c40('0x27')]('ChatQueue,\x20%s,\x20%s',_0x2bf97b,_0x3afe39);_0x2d326e(_0x3afe39);});});}function respondWithStatusCode(_0x10d64a,_0x366eeb){_0x366eeb=_0x366eeb||0xcc;return function(_0x33e6e5){if(_0x33e6e5){return _0x10d64a[_0x5c40('0x2d')](_0x366eeb);}return _0x10d64a[_0x5c40('0x2e')](_0x366eeb)[_0x5c40('0x2f')]();};}function respondWithResult(_0x4c8141,_0x2ff032){_0x2ff032=_0x2ff032||0xc8;return function(_0x200434){if(_0x200434){return _0x4c8141[_0x5c40('0x2e')](_0x2ff032)[_0x5c40('0x30')](_0x200434);}};}function respondWithFilteredResult(_0x30b5fd,_0x83cb86){return function(_0x5a7e83){if(_0x5a7e83){var _0x1d2b66=typeof _0x83cb86[_0x5c40('0x31')]==='undefined'&&typeof _0x83cb86[_0x5c40('0x32')]===_0x5c40('0x33');var _0x192fe2=_0x5a7e83[_0x5c40('0x34')];var _0x5a38c3=_0x1d2b66?0x0:_0x83cb86[_0x5c40('0x31')];var _0x5c50b1=_0x1d2b66?_0x5a7e83[_0x5c40('0x34')]:_0x83cb86['offset']+_0x83cb86[_0x5c40('0x32')];var _0xae1476;if(_0x5c50b1>=_0x192fe2){_0x5c50b1=_0x192fe2;_0xae1476=0xc8;}else{_0xae1476=0xce;}_0x30b5fd[_0x5c40('0x2e')](_0xae1476);return _0x30b5fd['set'](_0x5c40('0x35'),_0x5a38c3+'-'+_0x5c50b1+'/'+_0x192fe2)[_0x5c40('0x30')](_0x5a7e83);}return null;};}function patchUpdates(_0x12d214){return function(_0x3c7dcc){try{jsonpatch[_0x5c40('0x36')](_0x3c7dcc,_0x12d214,!![]);}catch(_0x4d1743){return BPromise[_0x5c40('0x37')](_0x4d1743);}return _0x3c7dcc[_0x5c40('0x38')]();};}function saveUpdates(_0x53eea3,_0x4ac451){return function(_0x1a5ef5){if(_0x1a5ef5){return _0x1a5ef5[_0x5c40('0x39')](_0x53eea3)[_0x5c40('0x22')](function(_0x3aed97){return _0x3aed97;});}return null;};}function removeEntity(_0x1d6672,_0x124eeb){return function(_0x3f2ae5){if(_0x3f2ae5){return _0x3f2ae5[_0x5c40('0x3a')]()[_0x5c40('0x22')](function(){var _0x40b4a0=_0x3f2ae5['get']({'plain':!![]});var _0x27c970=_0x5c40('0x3b');return db[_0x5c40('0x3c')]['destroy']({'where':{'type':_0x27c970,'resourceId':_0x40b4a0['id']}})[_0x5c40('0x22')](function(){return _0x3f2ae5;});})[_0x5c40('0x22')](function(){_0x1d6672[_0x5c40('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7b5056,_0x159257){return function(_0x2ab9c0){if(!_0x2ab9c0){_0x7b5056[_0x5c40('0x2d')](0x194);}return _0x2ab9c0;};}function handleError(_0x2e8c20,_0x5771db){_0x5771db=_0x5771db||0x1f4;return function(_0x203e8e){logger[_0x5c40('0x27')](_0x203e8e[_0x5c40('0x3d')]);if(_0x203e8e['name']){delete _0x203e8e['name'];}_0x2e8c20['status'](_0x5771db)['send'](_0x203e8e);};}exports[_0x5c40('0x3e')]=function(_0x2b1103,_0x19eefa){var _0x54e7a5={},_0x449893={},_0x291d3a={'count':0x0,'rows':[]};var _0x2bfbe3=_[_0x5c40('0x3f')](db[_0x5c40('0x40')][_0x5c40('0x41')],function(_0x13ac1a){return{'name':_0x13ac1a[_0x5c40('0x42')],'type':_0x13ac1a[_0x5c40('0x43')][_0x5c40('0x44')]};});_0x449893['model']=_['map'](_0x2bfbe3,_0x5c40('0x45'));_0x449893['query']=_[_0x5c40('0x46')](_0x2b1103[_0x5c40('0x47')]);_0x449893[_0x5c40('0x48')]=_[_0x5c40('0x49')](_0x449893[_0x5c40('0x4a')],_0x449893[_0x5c40('0x47')]);_0x54e7a5[_0x5c40('0x4b')]=_[_0x5c40('0x49')](_0x449893['model'],qs['fields'](_0x2b1103['query']['fields']));_0x54e7a5[_0x5c40('0x4b')]=_0x54e7a5[_0x5c40('0x4b')][_0x5c40('0x4c')]?_0x54e7a5[_0x5c40('0x4b')]:_0x449893['model'];if(!_0x2b1103[_0x5c40('0x47')][_0x5c40('0x4d')](_0x5c40('0x4e'))){_0x54e7a5[_0x5c40('0x32')]=qs[_0x5c40('0x32')](_0x2b1103[_0x5c40('0x47')]['limit']);_0x54e7a5[_0x5c40('0x31')]=qs[_0x5c40('0x31')](_0x2b1103[_0x5c40('0x47')][_0x5c40('0x31')]);}_0x54e7a5[_0x5c40('0x4f')]=qs[_0x5c40('0x50')](_0x2b1103['query'][_0x5c40('0x50')]);_0x54e7a5[_0x5c40('0x51')]=qs[_0x5c40('0x48')](_[_0x5c40('0x52')](_0x2b1103[_0x5c40('0x47')],_0x449893[_0x5c40('0x48')]),_0x2bfbe3);if(_0x2b1103[_0x5c40('0x47')]['filter']){_0x54e7a5['where']=_[_0x5c40('0x53')](_0x54e7a5[_0x5c40('0x51')],{'$or':_[_0x5c40('0x3f')](_0x2bfbe3,function(_0x20afee){if(_0x20afee[_0x5c40('0x43')]!==_0x5c40('0x54')){var _0x4adab4={};_0x4adab4[_0x20afee[_0x5c40('0x45')]]={'$like':'%'+_0x2b1103[_0x5c40('0x47')]['filter']+'%'};return _0x4adab4;}})});}_0x54e7a5=_[_0x5c40('0x53')]({},_0x54e7a5,_0x2b1103[_0x5c40('0x55')]);var _0x35e4d4={'where':_0x54e7a5[_0x5c40('0x51')]};return db['ChatQueue']['count'](_0x35e4d4)[_0x5c40('0x22')](function(_0x27c178){_0x291d3a[_0x5c40('0x34')]=_0x27c178;if(_0x2b1103['query'][_0x5c40('0x56')]){_0x54e7a5['include']=[{'all':!![]}];}return db['ChatQueue'][_0x5c40('0x57')](_0x54e7a5);})[_0x5c40('0x22')](function(_0x3f722e){_0x291d3a[_0x5c40('0x58')]=_0x3f722e;return _0x291d3a;})['then'](respondWithFilteredResult(_0x19eefa,_0x54e7a5))[_0x5c40('0x2c')](handleError(_0x19eefa,null));};exports[_0x5c40('0x59')]=function(_0x5f5dce,_0x4aaeee){var _0x20328a={'raw':!![],'where':{'id':_0x5f5dce[_0x5c40('0x5a')]['id']}},_0x4d6951={};_0x4d6951[_0x5c40('0x4a')]=_[_0x5c40('0x46')](db[_0x5c40('0x40')][_0x5c40('0x41')]);_0x4d6951[_0x5c40('0x47')]=_[_0x5c40('0x46')](_0x5f5dce[_0x5c40('0x47')]);_0x4d6951[_0x5c40('0x48')]=_['intersection'](_0x4d6951['model'],_0x4d6951[_0x5c40('0x47')]);_0x20328a[_0x5c40('0x4b')]=_[_0x5c40('0x49')](_0x4d6951[_0x5c40('0x4a')],qs['fields'](_0x5f5dce[_0x5c40('0x47')][_0x5c40('0x5b')]));_0x20328a[_0x5c40('0x4b')]=_0x20328a['attributes']['length']?_0x20328a['attributes']:_0x4d6951[_0x5c40('0x4a')];if(_0x5f5dce[_0x5c40('0x47')][_0x5c40('0x56')]){_0x20328a[_0x5c40('0x5c')]=[{'all':!![]}];}_0x20328a=_[_0x5c40('0x53')]({},_0x20328a,_0x5f5dce[_0x5c40('0x55')]);return db['ChatQueue'][_0x5c40('0x5d')](_0x20328a)[_0x5c40('0x22')](handleEntityNotFound(_0x4aaeee,null))[_0x5c40('0x22')](respondWithResult(_0x4aaeee,null))[_0x5c40('0x2c')](handleError(_0x4aaeee,null));};exports[_0x5c40('0x5e')]=function(_0x22e37b,_0x8d0391){return db[_0x5c40('0x40')][_0x5c40('0x5e')](_0x22e37b['body'],{})[_0x5c40('0x22')](function(_0x314286){var _0x2bd78b=_0x22e37b[_0x5c40('0x5f')][_0x5c40('0x60')]({'plain':!![]});if(!_0x2bd78b)throw new Error(_0x5c40('0x61'));if(_0x2bd78b[_0x5c40('0x62')]===_0x5c40('0x5f')){var _0x2e4d6e=_0x314286[_0x5c40('0x60')]({'plain':!![]});var _0x4b3f9a=_0x5c40('0x3b');return db[_0x5c40('0x63')][_0x5c40('0x5d')]({'where':{'name':_0x4b3f9a,'userProfileId':_0x2bd78b[_0x5c40('0x64')]},'raw':!![]})[_0x5c40('0x22')](function(_0x8b148f){if(_0x8b148f&&_0x8b148f[_0x5c40('0x65')]===0x0){return db['UserProfileResource'][_0x5c40('0x5e')]({'name':_0x2e4d6e[_0x5c40('0x45')],'resourceId':_0x2e4d6e['id'],'type':_0x8b148f[_0x5c40('0x45')],'sectionId':_0x8b148f['id']},{})[_0x5c40('0x22')](function(){return _0x314286;});}else{return _0x314286;}})[_0x5c40('0x2c')](function(_0x1ff1a1){logger['error'](_0x5c40('0x66'),_0x1ff1a1);throw _0x1ff1a1;});}return _0x314286;})['then'](respondWithResult(_0x8d0391,0xc9))['catch'](handleError(_0x8d0391,null));};exports[_0x5c40('0x39')]=function(_0x14c8f7,_0x293392){if(_0x14c8f7[_0x5c40('0x67')]['id']){delete _0x14c8f7[_0x5c40('0x67')]['id'];}return db[_0x5c40('0x40')][_0x5c40('0x5d')]({'where':{'id':_0x14c8f7[_0x5c40('0x5a')]['id']}})[_0x5c40('0x22')](handleEntityNotFound(_0x293392,null))['then'](saveUpdates(_0x14c8f7['body'],null))[_0x5c40('0x22')](respondWithResult(_0x293392,null))[_0x5c40('0x2c')](handleError(_0x293392,null));};exports['destroy']=function(_0xb68835,_0x2d1aa1){return db[_0x5c40('0x40')]['find']({'where':{'id':_0xb68835['params']['id']}})[_0x5c40('0x22')](handleEntityNotFound(_0x2d1aa1,null))['then'](removeEntity(_0x2d1aa1,null))[_0x5c40('0x2c')](handleError(_0x2d1aa1,null));};exports[_0x5c40('0x68')]=function(_0x2a322a,_0x3cf3cb){return db[_0x5c40('0x40')]['describe']()[_0x5c40('0x22')](respondWithResult(_0x3cf3cb,null))[_0x5c40('0x2c')](handleError(_0x3cf3cb,null));};exports[_0x5c40('0x69')]=function(_0x4c28f2,_0x361956,_0x33e6bb){var _0x34ece2={'raw':!![],'where':{}},_0x3bc207={},_0x5cffa2;return db[_0x5c40('0x40')][_0x5c40('0x6a')]({'where':{'id':_0x4c28f2[_0x5c40('0x5a')]['id']}})[_0x5c40('0x22')](handleEntityNotFound(_0x361956,null))[_0x5c40('0x22')](function(_0x5c6f39){if(_0x5c6f39){_0x5cffa2=_0x5c6f39[_0x5c40('0x60')]({'plain':!![]});_0x3bc207[_0x5c40('0x4a')]=_[_0x5c40('0x46')](db[_0x5c40('0x6b')]['rawAttributes']);_0x3bc207[_0x5c40('0x47')]=_[_0x5c40('0x46')](_0x4c28f2[_0x5c40('0x47')]);_0x3bc207[_0x5c40('0x48')]=_[_0x5c40('0x49')](_0x3bc207[_0x5c40('0x4a')],_0x3bc207[_0x5c40('0x47')]);_0x34ece2[_0x5c40('0x4b')]=_[_0x5c40('0x49')](_0x3bc207[_0x5c40('0x4a')],qs[_0x5c40('0x5b')](_0x4c28f2[_0x5c40('0x47')][_0x5c40('0x5b')]));_0x34ece2[_0x5c40('0x4b')]=_0x34ece2[_0x5c40('0x4b')]['length']?_0x34ece2['attributes']:_0x3bc207[_0x5c40('0x4a')];if(!_0x4c28f2[_0x5c40('0x47')]['hasOwnProperty'](_0x5c40('0x4e'))){_0x34ece2[_0x5c40('0x32')]=qs['limit'](_0x4c28f2[_0x5c40('0x47')][_0x5c40('0x32')]);_0x34ece2[_0x5c40('0x31')]=qs[_0x5c40('0x31')](_0x4c28f2[_0x5c40('0x47')][_0x5c40('0x31')]);}_0x34ece2[_0x5c40('0x4f')]=qs['sort'](_0x4c28f2['query'][_0x5c40('0x50')]);_0x34ece2[_0x5c40('0x51')]=qs[_0x5c40('0x48')](_[_0x5c40('0x52')](_0x4c28f2['query'],_0x3bc207[_0x5c40('0x48')]));_0x34ece2[_0x5c40('0x51')][_0x5c40('0x6c')]=_0x5c6f39['id'];if(_0x4c28f2[_0x5c40('0x47')][_0x5c40('0x6d')]){_0x34ece2[_0x5c40('0x51')]=_[_0x5c40('0x53')](_0x34ece2[_0x5c40('0x51')],{'$or':_['map'](_0x34ece2[_0x5c40('0x4b')],function(_0x8f6d36){var _0x14a154={};_0x14a154[_0x8f6d36]={'$like':'%'+_0x4c28f2[_0x5c40('0x47')][_0x5c40('0x6d')]+'%'};return _0x14a154;})});}_0x34ece2=_[_0x5c40('0x53')]({},_0x34ece2,_0x4c28f2[_0x5c40('0x55')]);return db[_0x5c40('0x6b')][_0x5c40('0x57')](_0x34ece2);}})[_0x5c40('0x22')](function(_0x317e2e){if(_0x317e2e){return db['User'][_0x5c40('0x6e')]({'where':{'id':_[_0x5c40('0x3f')](_0x317e2e,_0x5c40('0x6f')),'role':_0x5c40('0x70')},'attributes':['id',_0x5c40('0x45'),'chatPause',_0x5c40('0x71'),_0x5c40('0x72')]});}})[_0x5c40('0x22')](function(_0x231777){if(_0x231777){return{'count':_0x231777[_0x5c40('0x34')],'rows':_[_0x5c40('0x3f')](_0x231777[_0x5c40('0x58')],function(_0x1e2819){return{'membername':_0x1e2819['name'],'UserId':_0x1e2819['id'],'queue_name':_0x5cffa2[_0x5c40('0x45')],'ChatQueueId':_0x5cffa2['id'],'interface':util['format'](_0x5c40('0x73'),'SIP',_0x1e2819[_0x5c40('0x45')]),'penalty':0x0,'paused':_0x1e2819[_0x5c40('0x74')],'createdAt':_0x1e2819['createdAt'],'updatedAt':_0x1e2819[_0x5c40('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x361956,_0x34ece2))[_0x5c40('0x2c')](handleError(_0x361956,null));};exports[_0x5c40('0x75')]=function(_0x3b7b61,_0x59a888,_0x1e2161){var _0x13e8a3={};var _0x3e02b2={};var _0x2037d9;var _0x5b680b;return db['ChatQueue']['findOne']({'where':{'id':_0x3b7b61[_0x5c40('0x5a')]['id']}})[_0x5c40('0x22')](handleEntityNotFound(_0x59a888,null))['then'](function(_0x22e5ec){if(_0x22e5ec){_0x2037d9=_0x22e5ec;_0x3e02b2[_0x5c40('0x4a')]=_[_0x5c40('0x46')](db[_0x5c40('0x76')][_0x5c40('0x41')]);_0x3e02b2['query']=_['keys'](_0x3b7b61[_0x5c40('0x47')]);_0x3e02b2['filters']=_[_0x5c40('0x49')](_0x3e02b2[_0x5c40('0x4a')],_0x3e02b2['query']);_0x13e8a3[_0x5c40('0x4b')]=_[_0x5c40('0x49')](_0x3e02b2[_0x5c40('0x4a')],qs[_0x5c40('0x5b')](_0x3b7b61[_0x5c40('0x47')][_0x5c40('0x5b')]));_0x13e8a3['attributes']=_0x13e8a3[_0x5c40('0x4b')][_0x5c40('0x4c')]?_0x13e8a3['attributes']:_0x3e02b2[_0x5c40('0x4a')];_0x13e8a3[_0x5c40('0x4f')]=qs[_0x5c40('0x50')](_0x3b7b61[_0x5c40('0x47')][_0x5c40('0x50')]);_0x13e8a3[_0x5c40('0x51')]=qs[_0x5c40('0x48')](_[_0x5c40('0x52')](_0x3b7b61[_0x5c40('0x47')],_0x3e02b2[_0x5c40('0x48')]));if(_0x3b7b61[_0x5c40('0x47')]['filter']){_0x13e8a3['where']=_[_0x5c40('0x53')](_0x13e8a3[_0x5c40('0x51')],{'$or':_[_0x5c40('0x3f')](_0x13e8a3[_0x5c40('0x4b')],function(_0x2cdcf8){var _0x4b77a0={};_0x4b77a0[_0x2cdcf8]={'$like':'%'+_0x3b7b61[_0x5c40('0x47')]['filter']+'%'};return _0x4b77a0;})});}_0x13e8a3=_['merge']({},_0x13e8a3,_0x3b7b61['options']);return _0x2037d9[_0x5c40('0x75')](_0x13e8a3);}})[_0x5c40('0x22')](function(_0x4cfd3c){if(_0x4cfd3c){_0x5b680b=_0x4cfd3c[_0x5c40('0x4c')];if(!_0x3b7b61['query'][_0x5c40('0x4d')](_0x5c40('0x4e'))){_0x13e8a3['limit']=qs[_0x5c40('0x32')](_0x3b7b61[_0x5c40('0x47')]['limit']);_0x13e8a3[_0x5c40('0x31')]=qs['offset'](_0x3b7b61[_0x5c40('0x47')]['offset']);}return _0x2037d9[_0x5c40('0x75')](_0x13e8a3);}})[_0x5c40('0x22')](function(_0x1731bc){if(_0x1731bc){return _0x1731bc?{'count':_0x5b680b,'rows':_0x1731bc}:null;}})[_0x5c40('0x22')](respondWithResult(_0x59a888,null))['catch'](handleError(_0x59a888,null));};exports['addTeams']=function(_0x8b7d44,_0x2c46ec,_0x56a851){var _0x46aa98=_0x8b7d44[_0x5c40('0x67')]['ids'];return db[_0x5c40('0x76')][_0x5c40('0x57')]({'where':{'id':_0x46aa98},'attributes':['id'],'include':[{'model':db[_0x5c40('0x77')],'as':_0x5c40('0x78'),'attributes':['id',_0x5c40('0x45'),_0x5c40('0x79'),_0x5c40('0x7a'),_0x5c40('0x7b')],'raw':!![]}]})[_0x5c40('0x22')](function(_0x3ed577){if(_0x3ed577){var _0x351fed=_['flatMap'](_0x3ed577,function(_0x1be058){var _0x430628=_0x1be058[_0x5c40('0x60')]({'plain':!![]});return _0x430628[_0x5c40('0x78')];});return db[_0x5c40('0x40')][_0x5c40('0x5d')]({'where':{'id':_0x8b7d44[_0x5c40('0x5a')]['id']}})[_0x5c40('0x22')](function(_0x5ee73a){return db['sequelize']['transaction'](function(_0x75cae3){return _0x5ee73a[_0x5c40('0x7c')](_0x46aa98,{'transaction':_0x75cae3})['then'](function(){return BPromise[_0x5c40('0x7d')](_0x351fed,function(_0x3dec9c){return db[_0x5c40('0x6b')][_0x5c40('0x7e')]({'where':{'UserId':_0x3dec9c['id'],'ChatQueueId':_0x8b7d44['params']['id']},'transaction':_0x75cae3});});})['then'](function(){_0x351fed['forEach'](function(_0x26747d){socket[_0x5c40('0x7f')](_0x5c40('0x80'),{'UserId':_0x26747d['id'],'ChatQueueId':_0x5ee73a['id']});});});});});}})[_0x5c40('0x22')](respondWithStatusCode(_0x2c46ec,null))[_0x5c40('0x2c')](handleError(_0x2c46ec,null));};exports[_0x5c40('0x81')]=function(_0x58b8bd,_0x503146,_0x101776){return db[_0x5c40('0x76')]['findAll']({'where':{'id':_0x58b8bd[_0x5c40('0x47')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5c40('0x77')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x503146,null))[_0x5c40('0x22')](function(_0x65252b){var _0x207ffe=_[_0x5c40('0x3f')](_0x65252b,'id');var _0x22c950=[];var _0x500275=[];var _0x56b89f=squel[_0x5c40('0x82')]();_0x56b89f[_0x5c40('0x83')](_0x5c40('0x84'))[_0x5c40('0x85')]('team_has_chat_queues','tq')['join'](_0x5c40('0x86'),'ut',_0x5c40('0x87'))[_0x5c40('0x51')](_0x5c40('0x88'),_0x58b8bd[_0x5c40('0x5a')]['id']);for(var _0x151bc7=0x0;_0x151bc7<_0x65252b[_0x5c40('0x4c')];_0x151bc7+=0x1){let _0x2b5bb1=_0x65252b[_0x151bc7];for(var _0x642bb3=0x0;_0x642bb3<_0x2b5bb1['Agents'][_0x5c40('0x4c')];_0x642bb3+=0x1){let _0x51eaae=_0x2b5bb1['Agents'][_0x642bb3];var _0x2b864c=_0x56b89f['clone']();_0x2b864c[_0x5c40('0x51')](_0x5c40('0x89'),_0x51eaae['id']);_0x500275['push'](db[_0x5c40('0x8a')][_0x5c40('0x47')](_0x2b864c[_0x5c40('0x8b')](),{'type':db[_0x5c40('0x8a')][_0x5c40('0x8c')][_0x5c40('0x8d')]})[_0x5c40('0x22')](function(_0x3c4b8d){if(_0x3c4b8d['length']===0x1){return _0x51eaae['id'];}else{var _0x37d778=_[_0x5c40('0x8e')](_['map'](_0x3c4b8d,'TeamId'),function(_0x1ba464){return _[_0x5c40('0x8f')](_0x207ffe,_0x1ba464);});if(_0x37d778){return _0x51eaae['id'];}}}));}}return BPromise[_0x5c40('0x90')](_0x500275)[_0x5c40('0x22')](function(_0x134891){_0x22c950=_(_0x22c950)[_0x5c40('0x91')](_0x134891)['compact']()['value']();return db[_0x5c40('0x40')]['find']({'where':{'id':_0x58b8bd['params']['id']}})['then'](function(_0x43f195){return db[_0x5c40('0x8a')][_0x5c40('0x92')](function(_0x565b7e){return _0x43f195[_0x5c40('0x81')](_0x58b8bd['query']['ids'],{'transaction':_0x565b7e})[_0x5c40('0x22')](function(){if(!_[_0x5c40('0x93')](_0x22c950)){return _0x43f195['removeAgents'](_0x22c950,{'transaction':_0x565b7e});}})['then'](function(){_0x22c950[_0x5c40('0x94')](function(_0x84825b){socket[_0x5c40('0x7f')](_0x5c40('0x95'),{'UserId':_0x84825b,'ChatQueueId':_0x43f195['id']});});});});});});})[_0x5c40('0x22')](respondWithStatusCode(_0x503146,null))[_0x5c40('0x2c')](handleError(_0x503146,null));};exports[_0x5c40('0x96')]=function(_0x4328be,_0x16831a,_0x27329c){return db['ChatQueue'][_0x5c40('0x5d')]({'where':{'id':_0x4328be['params']['id']}})[_0x5c40('0x22')](handleEntityNotFound(_0x16831a,null))['then'](function(_0x5d2e6a){if(_0x5d2e6a){return _0x5d2e6a[_0x5c40('0x96')](_0x4328be['body']['ids'],_[_0x5c40('0x97')](_0x4328be[_0x5c40('0x67')],[_0x5c40('0x98'),'id'])||{})[_0x5c40('0x99')](function(_0x49ede6){for(var _0x52f205=0x0;_0x52f205<_0x4328be[_0x5c40('0x67')]['ids'][_0x5c40('0x4c')];_0x52f205+=0x1){socket[_0x5c40('0x7f')](_0x5c40('0x80'),{'UserId':Number(_0x4328be[_0x5c40('0x67')][_0x5c40('0x98')][_0x52f205]),'ChatQueueId':Number(_0x4328be[_0x5c40('0x5a')]['id'])});}return _0x49ede6;});}})['then'](respondWithResult(_0x16831a,null))[_0x5c40('0x2c')](handleError(_0x16831a,null));};exports['removeAgents']=function(_0x413cd1,_0x1ab380,_0x34e9b8){return db[_0x5c40('0x40')][_0x5c40('0x5d')]({'where':{'id':_0x413cd1[_0x5c40('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1ab380,null))[_0x5c40('0x22')](function(_0x580408){if(_0x580408){return _0x580408[_0x5c40('0x9a')](_0x413cd1[_0x5c40('0x47')]['ids'])['then'](function(){if(_[_0x5c40('0x9b')](_0x413cd1[_0x5c40('0x47')][_0x5c40('0x98')])){for(var _0xa89e28=0x0;_0xa89e28<_0x413cd1[_0x5c40('0x47')]['ids'][_0x5c40('0x4c')];_0xa89e28+=0x1){socket[_0x5c40('0x7f')]('userChatQueue:remove',{'UserId':Number(_0x413cd1[_0x5c40('0x47')][_0x5c40('0x98')][_0xa89e28]),'ChatQueueId':Number(_0x413cd1[_0x5c40('0x5a')]['id'])});}}else{socket[_0x5c40('0x7f')]('userChatQueue:remove',{'UserId':Number(_0x413cd1[_0x5c40('0x47')][_0x5c40('0x98')]),'ChatQueueId':Number(_0x413cd1[_0x5c40('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x1ab380,null))[_0x5c40('0x2c')](handleError(_0x1ab380,null));};exports[_0x5c40('0x9c')]=function(_0x55863d,_0xd218b8,_0x32c5d1){var _0x19eab1={};var _0x183b12={};var _0x32a0d9;var _0x73dbd;return db['ChatQueue'][_0x5c40('0x6a')]({'where':{'id':_0x55863d[_0x5c40('0x5a')]['id']}})[_0x5c40('0x22')](handleEntityNotFound(_0xd218b8,null))[_0x5c40('0x22')](function(_0x3433b3){if(_0x3433b3){_0x32a0d9=_0x3433b3;_0x183b12[_0x5c40('0x4a')]=_[_0x5c40('0x46')](db[_0x5c40('0x77')][_0x5c40('0x41')]);_0x183b12[_0x5c40('0x47')]=_['keys'](_0x55863d[_0x5c40('0x47')]);_0x183b12[_0x5c40('0x48')]=_[_0x5c40('0x49')](_0x183b12[_0x5c40('0x4a')],_0x183b12[_0x5c40('0x47')]);_0x19eab1[_0x5c40('0x4b')]=_[_0x5c40('0x49')](_0x183b12[_0x5c40('0x4a')],qs['fields'](_0x55863d['query'][_0x5c40('0x5b')]));_0x19eab1[_0x5c40('0x4b')]=_0x19eab1['attributes'][_0x5c40('0x4c')]?_0x19eab1[_0x5c40('0x4b')]:_0x183b12[_0x5c40('0x4a')];_0x19eab1[_0x5c40('0x4f')]=qs['sort'](_0x55863d['query'][_0x5c40('0x50')]);_0x19eab1[_0x5c40('0x51')]=qs[_0x5c40('0x48')](_['pick'](_0x55863d[_0x5c40('0x47')],_0x183b12[_0x5c40('0x48')]));if(_0x55863d[_0x5c40('0x47')][_0x5c40('0x6d')]){_0x19eab1[_0x5c40('0x51')]=_['merge'](_0x19eab1['where'],{'$or':_[_0x5c40('0x3f')](_0x19eab1[_0x5c40('0x4b')],function(_0x5be81c){var _0x2dd1da={};_0x2dd1da[_0x5be81c]={'$like':'%'+_0x55863d[_0x5c40('0x47')][_0x5c40('0x6d')]+'%'};return _0x2dd1da;})});}_0x19eab1=_[_0x5c40('0x53')]({},_0x19eab1,_0x55863d[_0x5c40('0x55')]);return _0x32a0d9['getAgents'](_0x19eab1);}})[_0x5c40('0x22')](function(_0x112f95){if(_0x112f95){_0x73dbd=_0x112f95[_0x5c40('0x4c')];if(!_0x55863d['query'][_0x5c40('0x4d')](_0x5c40('0x4e'))){_0x19eab1['limit']=qs[_0x5c40('0x32')](_0x55863d[_0x5c40('0x47')]['limit']);_0x19eab1[_0x5c40('0x31')]=qs[_0x5c40('0x31')](_0x55863d[_0x5c40('0x47')][_0x5c40('0x31')]);}return _0x32a0d9['getAgents'](_0x19eab1);}})[_0x5c40('0x22')](function(_0x3b6f4c){if(_0x3b6f4c){return _0x3b6f4c?{'count':_0x73dbd,'rows':_0x3b6f4c}:null;}})['then'](respondWithResult(_0xd218b8,null))[_0x5c40('0x2c')](handleError(_0xd218b8,null));}; \ No newline at end of file +var _0xd6ce=['../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','sendStatus','status','end','limit','count','offset','Content-Range','apply','save','update','destroy','get','ChatQueues','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','includeAll','include','ChatQueue','findAll','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','sort','ChatQueueId','options','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','pick','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','push','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment'];(function(_0x1fc760,_0xa2d2d0){var _0x584022=function(_0x3d1a5e){while(--_0x3d1a5e){_0x1fc760['push'](_0x1fc760['shift']());}};_0x584022(++_0xa2d2d0);}(_0xd6ce,0x118));var _0xed6c=function(_0x46a1f3,_0x1d5e69){_0x46a1f3=_0x46a1f3-0x0;var _0x3fdc07=_0xd6ce[_0x46a1f3];return _0x3fdc07;};'use strict';var emlformat=require(_0xed6c('0x0'));var rimraf=require(_0xed6c('0x1'));var zipdir=require(_0xed6c('0x2'));var jsonpatch=require(_0xed6c('0x3'));var rp=require('request-promise');var moment=require(_0xed6c('0x4'));var BPromise=require(_0xed6c('0x5'));var Mustache=require(_0xed6c('0x6'));var util=require('util');var path=require(_0xed6c('0x7'));var sox=require('sox');var csv=require(_0xed6c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed6c('0x9'));var _=require(_0xed6c('0xa'));var squel=require(_0xed6c('0xb'));var crypto=require(_0xed6c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xed6c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xed6c('0xe'));var Redis=require(_0xed6c('0xf'));var authService=require(_0xed6c('0x10'));var qs=require(_0xed6c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xed6c('0x12'));var config=require(_0xed6c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xed6c('0x14'))['db'];config['redis']=_[_0xed6c('0x15')](config[_0xed6c('0x16')],{'host':_0xed6c('0x17'),'port':0x18eb});var socket=require(_0xed6c('0x18'))(new Redis(config[_0xed6c('0x16')]));require(_0xed6c('0x19'))[_0xed6c('0x1a')](socket);var jayson=require(_0xed6c('0x1b'));var client=jayson[_0xed6c('0x1c')][_0xed6c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5f4aa8,_0x4b8703,_0x14a1a9,_0x1fe513){return new BPromise(function(_0x4bfb0e,_0x234363){var _0x290d71=_0x1fe513||client;return _0x290d71[_0xed6c('0x1e')](_0x5f4aa8,_0x14a1a9)[_0xed6c('0x1f')](function(_0x3a58c2){logger['info'](_0xed6c('0x20'),_0x4b8703,_0xed6c('0x21'));logger[_0xed6c('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4b8703,_0xed6c('0x21'),JSON['stringify'](_0x3a58c2));if(_0x3a58c2[_0xed6c('0x23')]){if(_0x3a58c2[_0xed6c('0x23')][_0xed6c('0x24')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4b8703,_0x3a58c2[_0xed6c('0x23')][_0xed6c('0x25')]);return _0x234363(_0x3a58c2[_0xed6c('0x23')][_0xed6c('0x25')]);}logger[_0xed6c('0x23')]('ChatQueue,\x20%s,\x20%s',_0x4b8703,_0x3a58c2[_0xed6c('0x23')][_0xed6c('0x25')]);return _0x4bfb0e(_0x3a58c2['error']['message']);}else{logger[_0xed6c('0x26')](_0xed6c('0x20'),_0x4b8703,_0xed6c('0x21'));_0x4bfb0e(_0x3a58c2['result'][_0xed6c('0x25')]);}})[_0xed6c('0x27')](function(_0x1ef4ea){logger[_0xed6c('0x23')](_0xed6c('0x20'),_0x4b8703,_0x1ef4ea);_0x234363(_0x1ef4ea);});});}function respondWithStatusCode(_0x55863e,_0x31d27f){_0x31d27f=_0x31d27f||0xcc;return function(_0x47e800){if(_0x47e800){return _0x55863e[_0xed6c('0x28')](_0x31d27f);}return _0x55863e[_0xed6c('0x29')](_0x31d27f)[_0xed6c('0x2a')]();};}function respondWithResult(_0x4fcbc2,_0x548c1d){_0x548c1d=_0x548c1d||0xc8;return function(_0x3c4a05){if(_0x3c4a05){return _0x4fcbc2[_0xed6c('0x29')](_0x548c1d)['json'](_0x3c4a05);}};}function respondWithFilteredResult(_0x2ffa01,_0x4c2962){return function(_0x31af05){if(_0x31af05){var _0x51c8f3=typeof _0x4c2962['offset']==='undefined'&&typeof _0x4c2962[_0xed6c('0x2b')]==='undefined';var _0x2e76bd=_0x31af05[_0xed6c('0x2c')];var _0x5cec84=_0x51c8f3?0x0:_0x4c2962[_0xed6c('0x2d')];var _0x35c012=_0x51c8f3?_0x31af05[_0xed6c('0x2c')]:_0x4c2962[_0xed6c('0x2d')]+_0x4c2962[_0xed6c('0x2b')];var _0x16b048;if(_0x35c012>=_0x2e76bd){_0x35c012=_0x2e76bd;_0x16b048=0xc8;}else{_0x16b048=0xce;}_0x2ffa01[_0xed6c('0x29')](_0x16b048);return _0x2ffa01['set'](_0xed6c('0x2e'),_0x5cec84+'-'+_0x35c012+'/'+_0x2e76bd)['json'](_0x31af05);}return null;};}function patchUpdates(_0x5c88f6){return function(_0xbdb034){try{jsonpatch[_0xed6c('0x2f')](_0xbdb034,_0x5c88f6,!![]);}catch(_0xf1022f){return BPromise['reject'](_0xf1022f);}return _0xbdb034[_0xed6c('0x30')]();};}function saveUpdates(_0xdc41a8,_0xfd6a6d){return function(_0x4233a0){if(_0x4233a0){return _0x4233a0[_0xed6c('0x31')](_0xdc41a8)['then'](function(_0x2f150c){return _0x2f150c;});}return null;};}function removeEntity(_0x43935e,_0x5d0dde){return function(_0x44382f){if(_0x44382f){return _0x44382f[_0xed6c('0x32')]()[_0xed6c('0x1f')](function(){var _0xb0f750=_0x44382f[_0xed6c('0x33')]({'plain':!![]});var _0x25cfb9=_0xed6c('0x34');return db['UserProfileResource'][_0xed6c('0x32')]({'where':{'type':_0x25cfb9,'resourceId':_0xb0f750['id']}})[_0xed6c('0x1f')](function(){return _0x44382f;});})['then'](function(){_0x43935e[_0xed6c('0x29')](0xcc)[_0xed6c('0x2a')]();});}};}function handleEntityNotFound(_0x55b8a7,_0x234634){return function(_0x3fb45f){if(!_0x3fb45f){_0x55b8a7[_0xed6c('0x28')](0x194);}return _0x3fb45f;};}function handleError(_0x432a30,_0x1b3437){_0x1b3437=_0x1b3437||0x1f4;return function(_0x46200d){logger[_0xed6c('0x23')](_0x46200d['stack']);if(_0x46200d[_0xed6c('0x35')]){delete _0x46200d[_0xed6c('0x35')];}_0x432a30['status'](_0x1b3437)[_0xed6c('0x36')](_0x46200d);};}exports[_0xed6c('0x37')]=function(_0x27c35e,_0x24c880){var _0x4e5576={},_0x15d413={},_0x5d52dc={'count':0x0,'rows':[]};var _0x470c08=_[_0xed6c('0x38')](db['ChatQueue'][_0xed6c('0x39')],function(_0x4d04e5){return{'name':_0x4d04e5[_0xed6c('0x3a')],'type':_0x4d04e5[_0xed6c('0x3b')][_0xed6c('0x3c')]};});_0x15d413[_0xed6c('0x3d')]=_['map'](_0x470c08,'name');_0x15d413['query']=_['keys'](_0x27c35e[_0xed6c('0x3e')]);_0x15d413[_0xed6c('0x3f')]=_['intersection'](_0x15d413[_0xed6c('0x3d')],_0x15d413[_0xed6c('0x3e')]);_0x4e5576[_0xed6c('0x40')]=_[_0xed6c('0x41')](_0x15d413[_0xed6c('0x3d')],qs[_0xed6c('0x42')](_0x27c35e[_0xed6c('0x3e')][_0xed6c('0x42')]));_0x4e5576[_0xed6c('0x40')]=_0x4e5576[_0xed6c('0x40')][_0xed6c('0x43')]?_0x4e5576[_0xed6c('0x40')]:_0x15d413['model'];if(!_0x27c35e[_0xed6c('0x3e')][_0xed6c('0x44')](_0xed6c('0x45'))){_0x4e5576['limit']=qs[_0xed6c('0x2b')](_0x27c35e[_0xed6c('0x3e')][_0xed6c('0x2b')]);_0x4e5576[_0xed6c('0x2d')]=qs[_0xed6c('0x2d')](_0x27c35e[_0xed6c('0x3e')][_0xed6c('0x2d')]);}_0x4e5576[_0xed6c('0x46')]=qs['sort'](_0x27c35e[_0xed6c('0x3e')]['sort']);_0x4e5576[_0xed6c('0x47')]=qs['filters'](_['pick'](_0x27c35e[_0xed6c('0x3e')],_0x15d413[_0xed6c('0x3f')]),_0x470c08);if(_0x27c35e['query'][_0xed6c('0x48')]){_0x4e5576['where']=_[_0xed6c('0x49')](_0x4e5576[_0xed6c('0x47')],{'$or':_[_0xed6c('0x38')](_0x470c08,function(_0x46783a){if(_0x46783a['type']!==_0xed6c('0x4a')){var _0xd178cc={};_0xd178cc[_0x46783a[_0xed6c('0x35')]]={'$like':'%'+_0x27c35e['query']['filter']+'%'};return _0xd178cc;}})});}_0x4e5576=_[_0xed6c('0x49')]({},_0x4e5576,_0x27c35e['options']);var _0x2645ee={'where':_0x4e5576[_0xed6c('0x47')]};return db['ChatQueue']['count'](_0x2645ee)['then'](function(_0x1bf0cb){_0x5d52dc[_0xed6c('0x2c')]=_0x1bf0cb;if(_0x27c35e[_0xed6c('0x3e')][_0xed6c('0x4b')]){_0x4e5576[_0xed6c('0x4c')]=[{'all':!![]}];}return db[_0xed6c('0x4d')][_0xed6c('0x4e')](_0x4e5576);})['then'](function(_0x23328a){_0x5d52dc['rows']=_0x23328a;return _0x5d52dc;})[_0xed6c('0x1f')](respondWithFilteredResult(_0x24c880,_0x4e5576))[_0xed6c('0x27')](handleError(_0x24c880,null));};exports[_0xed6c('0x4f')]=function(_0x1f7a11,_0x25c803){var _0x4f049e={'raw':!![],'where':{'id':_0x1f7a11[_0xed6c('0x50')]['id']}},_0x480068={};_0x480068['model']=_[_0xed6c('0x51')](db[_0xed6c('0x4d')][_0xed6c('0x39')]);_0x480068[_0xed6c('0x3e')]=_[_0xed6c('0x51')](_0x1f7a11[_0xed6c('0x3e')]);_0x480068[_0xed6c('0x3f')]=_['intersection'](_0x480068[_0xed6c('0x3d')],_0x480068['query']);_0x4f049e['attributes']=_['intersection'](_0x480068['model'],qs[_0xed6c('0x42')](_0x1f7a11[_0xed6c('0x3e')][_0xed6c('0x42')]));_0x4f049e[_0xed6c('0x40')]=_0x4f049e[_0xed6c('0x40')][_0xed6c('0x43')]?_0x4f049e[_0xed6c('0x40')]:_0x480068[_0xed6c('0x3d')];if(_0x1f7a11[_0xed6c('0x3e')][_0xed6c('0x4b')]){_0x4f049e[_0xed6c('0x4c')]=[{'all':!![]}];}_0x4f049e=_[_0xed6c('0x49')]({},_0x4f049e,_0x1f7a11['options']);return db[_0xed6c('0x4d')][_0xed6c('0x52')](_0x4f049e)[_0xed6c('0x1f')](handleEntityNotFound(_0x25c803,null))[_0xed6c('0x1f')](respondWithResult(_0x25c803,null))['catch'](handleError(_0x25c803,null));};exports[_0xed6c('0x53')]=function(_0x55166f,_0x153054){return db[_0xed6c('0x4d')][_0xed6c('0x53')](_0x55166f[_0xed6c('0x54')],{})['then'](function(_0x5be52b){var _0x45dbe6=_0x55166f['user'][_0xed6c('0x33')]({'plain':!![]});if(!_0x45dbe6)throw new Error(_0xed6c('0x55'));if(_0x45dbe6[_0xed6c('0x56')]===_0xed6c('0x57')){var _0x2ce86d=_0x5be52b[_0xed6c('0x33')]({'plain':!![]});var _0x9bd301=_0xed6c('0x34');return db[_0xed6c('0x58')][_0xed6c('0x52')]({'where':{'name':_0x9bd301,'userProfileId':_0x45dbe6[_0xed6c('0x59')]},'raw':!![]})[_0xed6c('0x1f')](function(_0x40d4c3){if(_0x40d4c3&&_0x40d4c3[_0xed6c('0x5a')]===0x0){return db[_0xed6c('0x5b')][_0xed6c('0x53')]({'name':_0x2ce86d[_0xed6c('0x35')],'resourceId':_0x2ce86d['id'],'type':_0x40d4c3[_0xed6c('0x35')],'sectionId':_0x40d4c3['id']},{})[_0xed6c('0x1f')](function(){return _0x5be52b;});}else{return _0x5be52b;}})['catch'](function(_0x52c11e){logger['error'](_0xed6c('0x5c'),_0x52c11e);throw _0x52c11e;});}return _0x5be52b;})['then'](respondWithResult(_0x153054,0xc9))['catch'](handleError(_0x153054,null));};exports[_0xed6c('0x31')]=function(_0xab4074,_0x3076d6){if(_0xab4074['body']['id']){delete _0xab4074[_0xed6c('0x54')]['id'];}return db[_0xed6c('0x4d')][_0xed6c('0x52')]({'where':{'id':_0xab4074[_0xed6c('0x50')]['id']}})[_0xed6c('0x1f')](handleEntityNotFound(_0x3076d6,null))[_0xed6c('0x1f')](saveUpdates(_0xab4074[_0xed6c('0x54')],null))[_0xed6c('0x1f')](respondWithResult(_0x3076d6,null))[_0xed6c('0x27')](handleError(_0x3076d6,null));};exports['destroy']=function(_0x512722,_0x53f943){return db[_0xed6c('0x4d')][_0xed6c('0x52')]({'where':{'id':_0x512722[_0xed6c('0x50')]['id']}})[_0xed6c('0x1f')](handleEntityNotFound(_0x53f943,null))[_0xed6c('0x1f')](removeEntity(_0x53f943,null))[_0xed6c('0x27')](handleError(_0x53f943,null));};exports[_0xed6c('0x5d')]=function(_0xf39398,_0x8b8d61){return db['ChatQueue'][_0xed6c('0x5d')]()['then'](respondWithResult(_0x8b8d61,null))[_0xed6c('0x27')](handleError(_0x8b8d61,null));};exports[_0xed6c('0x5e')]=function(_0x1b51bc,_0x12a65f,_0xad2219){var _0x310db7={'raw':!![],'where':{}},_0xf19214={},_0x360030;return db[_0xed6c('0x4d')][_0xed6c('0x5f')]({'where':{'id':_0x1b51bc['params']['id']}})[_0xed6c('0x1f')](handleEntityNotFound(_0x12a65f,null))[_0xed6c('0x1f')](function(_0x1d9bfe){if(_0x1d9bfe){_0x360030=_0x1d9bfe[_0xed6c('0x33')]({'plain':!![]});_0xf19214[_0xed6c('0x3d')]=_[_0xed6c('0x51')](db[_0xed6c('0x60')][_0xed6c('0x39')]);_0xf19214[_0xed6c('0x3e')]=_[_0xed6c('0x51')](_0x1b51bc[_0xed6c('0x3e')]);_0xf19214[_0xed6c('0x3f')]=_['intersection'](_0xf19214['model'],_0xf19214[_0xed6c('0x3e')]);_0x310db7[_0xed6c('0x40')]=_[_0xed6c('0x41')](_0xf19214['model'],qs[_0xed6c('0x42')](_0x1b51bc[_0xed6c('0x3e')]['fields']));_0x310db7[_0xed6c('0x40')]=_0x310db7[_0xed6c('0x40')]['length']?_0x310db7[_0xed6c('0x40')]:_0xf19214[_0xed6c('0x3d')];if(!_0x1b51bc['query'][_0xed6c('0x44')](_0xed6c('0x45'))){_0x310db7[_0xed6c('0x2b')]=qs[_0xed6c('0x2b')](_0x1b51bc[_0xed6c('0x3e')][_0xed6c('0x2b')]);_0x310db7['offset']=qs[_0xed6c('0x2d')](_0x1b51bc['query'][_0xed6c('0x2d')]);}_0x310db7['order']=qs[_0xed6c('0x61')](_0x1b51bc[_0xed6c('0x3e')][_0xed6c('0x61')]);_0x310db7[_0xed6c('0x47')]=qs[_0xed6c('0x3f')](_['pick'](_0x1b51bc[_0xed6c('0x3e')],_0xf19214[_0xed6c('0x3f')]));_0x310db7['where'][_0xed6c('0x62')]=_0x1d9bfe['id'];if(_0x1b51bc[_0xed6c('0x3e')][_0xed6c('0x48')]){_0x310db7[_0xed6c('0x47')]=_[_0xed6c('0x49')](_0x310db7[_0xed6c('0x47')],{'$or':_[_0xed6c('0x38')](_0x310db7[_0xed6c('0x40')],function(_0xd49ab3){var _0x24e90e={};_0x24e90e[_0xd49ab3]={'$like':'%'+_0x1b51bc[_0xed6c('0x3e')][_0xed6c('0x48')]+'%'};return _0x24e90e;})});}_0x310db7=_[_0xed6c('0x49')]({},_0x310db7,_0x1b51bc[_0xed6c('0x63')]);return db[_0xed6c('0x60')][_0xed6c('0x4e')](_0x310db7);}})[_0xed6c('0x1f')](function(_0x2f888b){if(_0x2f888b){return db[_0xed6c('0x64')][_0xed6c('0x65')]({'where':{'id':_['map'](_0x2f888b,_0xed6c('0x66')),'role':_0xed6c('0x67')},'attributes':['id',_0xed6c('0x35'),_0xed6c('0x68'),_0xed6c('0x69'),_0xed6c('0x6a')]});}})['then'](function(_0x2c9503){if(_0x2c9503){return{'count':_0x2c9503[_0xed6c('0x2c')],'rows':_[_0xed6c('0x38')](_0x2c9503[_0xed6c('0x6b')],function(_0x3a4bff){return{'membername':_0x3a4bff['name'],'UserId':_0x3a4bff['id'],'queue_name':_0x360030[_0xed6c('0x35')],'ChatQueueId':_0x360030['id'],'interface':util[_0xed6c('0x6c')](_0xed6c('0x6d'),_0xed6c('0x6e'),_0x3a4bff[_0xed6c('0x35')]),'penalty':0x0,'paused':_0x3a4bff[_0xed6c('0x68')],'createdAt':_0x3a4bff[_0xed6c('0x6a')],'updatedAt':_0x3a4bff[_0xed6c('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xed6c('0x1f')](respondWithFilteredResult(_0x12a65f,_0x310db7))[_0xed6c('0x27')](handleError(_0x12a65f,null));};exports[_0xed6c('0x6f')]=function(_0x44882a,_0x48f4b8,_0x21b4a3){var _0x2a6f0e={};var _0x7ce90f={};var _0x27e9bc;var _0x587d69;return db['ChatQueue'][_0xed6c('0x5f')]({'where':{'id':_0x44882a[_0xed6c('0x50')]['id']}})[_0xed6c('0x1f')](handleEntityNotFound(_0x48f4b8,null))[_0xed6c('0x1f')](function(_0x2cb984){if(_0x2cb984){_0x27e9bc=_0x2cb984;_0x7ce90f['model']=_[_0xed6c('0x51')](db[_0xed6c('0x70')][_0xed6c('0x39')]);_0x7ce90f[_0xed6c('0x3e')]=_[_0xed6c('0x51')](_0x44882a['query']);_0x7ce90f['filters']=_[_0xed6c('0x41')](_0x7ce90f[_0xed6c('0x3d')],_0x7ce90f[_0xed6c('0x3e')]);_0x2a6f0e[_0xed6c('0x40')]=_['intersection'](_0x7ce90f['model'],qs[_0xed6c('0x42')](_0x44882a[_0xed6c('0x3e')][_0xed6c('0x42')]));_0x2a6f0e['attributes']=_0x2a6f0e[_0xed6c('0x40')]['length']?_0x2a6f0e[_0xed6c('0x40')]:_0x7ce90f[_0xed6c('0x3d')];_0x2a6f0e[_0xed6c('0x46')]=qs['sort'](_0x44882a[_0xed6c('0x3e')][_0xed6c('0x61')]);_0x2a6f0e['where']=qs[_0xed6c('0x3f')](_[_0xed6c('0x71')](_0x44882a[_0xed6c('0x3e')],_0x7ce90f[_0xed6c('0x3f')]));if(_0x44882a['query']['filter']){_0x2a6f0e['where']=_[_0xed6c('0x49')](_0x2a6f0e['where'],{'$or':_['map'](_0x2a6f0e['attributes'],function(_0x5391f5){var _0x16b312={};_0x16b312[_0x5391f5]={'$like':'%'+_0x44882a[_0xed6c('0x3e')]['filter']+'%'};return _0x16b312;})});}_0x2a6f0e=_[_0xed6c('0x49')]({},_0x2a6f0e,_0x44882a[_0xed6c('0x63')]);return _0x27e9bc[_0xed6c('0x6f')](_0x2a6f0e);}})[_0xed6c('0x1f')](function(_0x53f375){if(_0x53f375){_0x587d69=_0x53f375['length'];if(!_0x44882a['query']['hasOwnProperty']('nolimit')){_0x2a6f0e[_0xed6c('0x2b')]=qs[_0xed6c('0x2b')](_0x44882a[_0xed6c('0x3e')][_0xed6c('0x2b')]);_0x2a6f0e[_0xed6c('0x2d')]=qs[_0xed6c('0x2d')](_0x44882a[_0xed6c('0x3e')][_0xed6c('0x2d')]);}return _0x27e9bc['getTeams'](_0x2a6f0e);}})[_0xed6c('0x1f')](function(_0x2665ef){if(_0x2665ef){return _0x2665ef?{'count':_0x587d69,'rows':_0x2665ef}:null;}})[_0xed6c('0x1f')](respondWithResult(_0x48f4b8,null))[_0xed6c('0x27')](handleError(_0x48f4b8,null));};exports['addTeams']=function(_0x349cc5,_0x39b0ef,_0x440a9a){var _0x3a3762=_0x349cc5[_0xed6c('0x54')][_0xed6c('0x72')];return db[_0xed6c('0x70')][_0xed6c('0x4e')]({'where':{'id':_0x3a3762},'attributes':['id'],'include':[{'model':db[_0xed6c('0x64')],'as':_0xed6c('0x73'),'attributes':['id',_0xed6c('0x35'),_0xed6c('0x74'),_0xed6c('0x75'),_0xed6c('0x76')],'raw':!![]}]})['then'](function(_0x14c83c){if(_0x14c83c){var _0x240baa=_['flatMap'](_0x14c83c,function(_0x38f43f){var _0x3b68b8=_0x38f43f['get']({'plain':!![]});return _0x3b68b8[_0xed6c('0x73')];});return db[_0xed6c('0x4d')]['find']({'where':{'id':_0x349cc5[_0xed6c('0x50')]['id']}})[_0xed6c('0x1f')](function(_0x4f0d41){return db[_0xed6c('0x77')][_0xed6c('0x78')](function(_0x2a685c){return _0x4f0d41[_0xed6c('0x79')](_0x3a3762,{'transaction':_0x2a685c})[_0xed6c('0x1f')](function(){return BPromise['each'](_0x240baa,function(_0x26efb7){return db['UserChatQueue'][_0xed6c('0x7a')]({'where':{'UserId':_0x26efb7['id'],'ChatQueueId':_0x349cc5[_0xed6c('0x50')]['id']},'transaction':_0x2a685c});});})[_0xed6c('0x1f')](function(){_0x240baa['forEach'](function(_0x25455e){socket[_0xed6c('0x7b')](_0xed6c('0x7c'),{'UserId':_0x25455e['id'],'ChatQueueId':_0x4f0d41['id']});});});});});}})['then'](respondWithStatusCode(_0x39b0ef,null))[_0xed6c('0x27')](handleError(_0x39b0ef,null));};exports[_0xed6c('0x7d')]=function(_0x46288,_0x134dcf,_0x30d245){return db['Team'][_0xed6c('0x4e')]({'where':{'id':_0x46288['query'][_0xed6c('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xed6c('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x134dcf,null))['then'](function(_0x4c353a){var _0xad997b=_[_0xed6c('0x38')](_0x4c353a,'id');var _0x4ba6a6=[];var _0x2bd0fc=[];var _0x1426df=squel[_0xed6c('0x7e')]();_0x1426df[_0xed6c('0x7f')](_0xed6c('0x80'))[_0xed6c('0x81')](_0xed6c('0x82'),'tq')[_0xed6c('0x83')](_0xed6c('0x84'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xed6c('0x47')](_0xed6c('0x85'),_0x46288[_0xed6c('0x50')]['id']);for(var _0x936631=0x0;_0x936631<_0x4c353a['length'];_0x936631+=0x1){let _0x338340=_0x4c353a[_0x936631];for(var _0x2939cf=0x0;_0x2939cf<_0x338340['Agents']['length'];_0x2939cf+=0x1){let _0x1ca6ad=_0x338340[_0xed6c('0x73')][_0x2939cf];var _0x56e055=_0x1426df[_0xed6c('0x86')]();_0x56e055[_0xed6c('0x47')]('ut.UserId\x20=\x20?',_0x1ca6ad['id']);_0x2bd0fc[_0xed6c('0x87')](db[_0xed6c('0x77')][_0xed6c('0x3e')](_0x56e055['toString'](),{'type':db[_0xed6c('0x77')]['QueryTypes']['SELECT']})[_0xed6c('0x1f')](function(_0x3dad80){if(_0x3dad80[_0xed6c('0x43')]===0x1){return _0x1ca6ad['id'];}else{var _0x592610=_['every'](_[_0xed6c('0x38')](_0x3dad80,_0xed6c('0x88')),function(_0x2316b5){return _[_0xed6c('0x89')](_0xad997b,_0x2316b5);});if(_0x592610){return _0x1ca6ad['id'];}}}));}}return BPromise['all'](_0x2bd0fc)[_0xed6c('0x1f')](function(_0x4264be){_0x4ba6a6=_(_0x4ba6a6)[_0xed6c('0x8a')](_0x4264be)[_0xed6c('0x8b')]()[_0xed6c('0x8c')]();return db[_0xed6c('0x4d')][_0xed6c('0x52')]({'where':{'id':_0x46288[_0xed6c('0x50')]['id']}})[_0xed6c('0x1f')](function(_0x2902f7){return db[_0xed6c('0x77')][_0xed6c('0x78')](function(_0x44b4c5){return _0x2902f7[_0xed6c('0x7d')](_0x46288[_0xed6c('0x3e')][_0xed6c('0x72')],{'transaction':_0x44b4c5})[_0xed6c('0x1f')](function(){if(!_[_0xed6c('0x8d')](_0x4ba6a6)){return _0x2902f7[_0xed6c('0x8e')](_0x4ba6a6,{'transaction':_0x44b4c5});}})[_0xed6c('0x1f')](function(){_0x4ba6a6[_0xed6c('0x8f')](function(_0x5cb51d){socket['emit'](_0xed6c('0x90'),{'UserId':_0x5cb51d,'ChatQueueId':_0x2902f7['id']});});});});});});})[_0xed6c('0x1f')](respondWithStatusCode(_0x134dcf,null))[_0xed6c('0x27')](handleError(_0x134dcf,null));};exports[_0xed6c('0x91')]=function(_0xebe1e2,_0x1159db,_0x1e1adc){return db[_0xed6c('0x4d')][_0xed6c('0x52')]({'where':{'id':_0xebe1e2[_0xed6c('0x50')]['id']}})['then'](handleEntityNotFound(_0x1159db,null))[_0xed6c('0x1f')](function(_0x144085){if(_0x144085){return _0x144085[_0xed6c('0x91')](_0xebe1e2[_0xed6c('0x54')][_0xed6c('0x72')],_[_0xed6c('0x92')](_0xebe1e2['body'],[_0xed6c('0x72'),'id'])||{})[_0xed6c('0x93')](function(_0x24394b){for(var _0x3fb2dc=0x0;_0x3fb2dc<_0xebe1e2[_0xed6c('0x54')][_0xed6c('0x72')][_0xed6c('0x43')];_0x3fb2dc+=0x1){socket[_0xed6c('0x7b')](_0xed6c('0x7c'),{'UserId':Number(_0xebe1e2['body'][_0xed6c('0x72')][_0x3fb2dc]),'ChatQueueId':Number(_0xebe1e2['params']['id'])});}return _0x24394b;});}})['then'](respondWithResult(_0x1159db,null))[_0xed6c('0x27')](handleError(_0x1159db,null));};exports[_0xed6c('0x8e')]=function(_0x5b4771,_0x24b840,_0x30e11a){return db[_0xed6c('0x4d')][_0xed6c('0x52')]({'where':{'id':_0x5b4771['params']['id']}})[_0xed6c('0x1f')](handleEntityNotFound(_0x24b840,null))[_0xed6c('0x1f')](function(_0x53e084){if(_0x53e084){return _0x53e084[_0xed6c('0x8e')](_0x5b4771[_0xed6c('0x3e')][_0xed6c('0x72')])['then'](function(){if(_[_0xed6c('0x94')](_0x5b4771[_0xed6c('0x3e')]['ids'])){for(var _0x3d79b5=0x0;_0x3d79b5<_0x5b4771['query'][_0xed6c('0x72')][_0xed6c('0x43')];_0x3d79b5+=0x1){socket[_0xed6c('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x5b4771[_0xed6c('0x3e')]['ids'][_0x3d79b5]),'ChatQueueId':Number(_0x5b4771['params']['id'])});}}else{socket['emit'](_0xed6c('0x90'),{'UserId':Number(_0x5b4771[_0xed6c('0x3e')][_0xed6c('0x72')]),'ChatQueueId':Number(_0x5b4771[_0xed6c('0x50')]['id'])});}});}})[_0xed6c('0x1f')](respondWithStatusCode(_0x24b840,null))[_0xed6c('0x27')](handleError(_0x24b840,null));};exports[_0xed6c('0x95')]=function(_0x4bb9aa,_0x33f7fa,_0x21ee39){var _0xbbf5bf={};var _0x4f2b24={};var _0x1dabab;var _0x2d2087;return db[_0xed6c('0x4d')][_0xed6c('0x5f')]({'where':{'id':_0x4bb9aa['params']['id']}})[_0xed6c('0x1f')](handleEntityNotFound(_0x33f7fa,null))[_0xed6c('0x1f')](function(_0x55537d){if(_0x55537d){_0x1dabab=_0x55537d;_0x4f2b24['model']=_[_0xed6c('0x51')](db['User'][_0xed6c('0x39')]);_0x4f2b24[_0xed6c('0x3e')]=_[_0xed6c('0x51')](_0x4bb9aa[_0xed6c('0x3e')]);_0x4f2b24['filters']=_[_0xed6c('0x41')](_0x4f2b24[_0xed6c('0x3d')],_0x4f2b24['query']);_0xbbf5bf['attributes']=_[_0xed6c('0x41')](_0x4f2b24[_0xed6c('0x3d')],qs[_0xed6c('0x42')](_0x4bb9aa[_0xed6c('0x3e')][_0xed6c('0x42')]));_0xbbf5bf['attributes']=_0xbbf5bf[_0xed6c('0x40')]['length']?_0xbbf5bf['attributes']:_0x4f2b24[_0xed6c('0x3d')];_0xbbf5bf['order']=qs[_0xed6c('0x61')](_0x4bb9aa[_0xed6c('0x3e')][_0xed6c('0x61')]);_0xbbf5bf[_0xed6c('0x47')]=qs[_0xed6c('0x3f')](_['pick'](_0x4bb9aa[_0xed6c('0x3e')],_0x4f2b24[_0xed6c('0x3f')]));if(_0x4bb9aa[_0xed6c('0x3e')][_0xed6c('0x48')]){_0xbbf5bf[_0xed6c('0x47')]=_['merge'](_0xbbf5bf['where'],{'$or':_[_0xed6c('0x38')](_0xbbf5bf['attributes'],function(_0x4d2843){var _0x3625f9={};_0x3625f9[_0x4d2843]={'$like':'%'+_0x4bb9aa[_0xed6c('0x3e')]['filter']+'%'};return _0x3625f9;})});}_0xbbf5bf=_[_0xed6c('0x49')]({},_0xbbf5bf,_0x4bb9aa[_0xed6c('0x63')]);return _0x1dabab[_0xed6c('0x95')](_0xbbf5bf);}})['then'](function(_0xbeb6dc){if(_0xbeb6dc){_0x2d2087=_0xbeb6dc[_0xed6c('0x43')];if(!_0x4bb9aa[_0xed6c('0x3e')][_0xed6c('0x44')](_0xed6c('0x45'))){_0xbbf5bf['limit']=qs[_0xed6c('0x2b')](_0x4bb9aa[_0xed6c('0x3e')][_0xed6c('0x2b')]);_0xbbf5bf[_0xed6c('0x2d')]=qs['offset'](_0x4bb9aa['query']['offset']);}return _0x1dabab['getAgents'](_0xbbf5bf);}})[_0xed6c('0x1f')](function(_0x56c15e){if(_0x56c15e){return _0x56c15e?{'count':_0x2d2087,'rows':_0x56c15e}:null;}})[_0xed6c('0x1f')](respondWithResult(_0x33f7fa,null))[_0xed6c('0x27')](handleError(_0x33f7fa,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 87e8fa8..edefdd7 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 _0x1979=['events','ChatQueue','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x15b610,_0x3c3671){var _0x383a33=function(_0x2ff486){while(--_0x2ff486){_0x15b610['push'](_0x15b610['shift']());}};_0x383a33(++_0x3c3671);}(_0x1979,0xa2));var _0x9197=function(_0x197185,_0x251145){_0x197185=_0x197185-0x0;var _0x2c8af1=_0x1979[_0x197185];return _0x2c8af1;};'use strict';var EventEmitter=require(_0x9197('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x9197('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9197('0x2'),'afterUpdate':_0x9197('0x3'),'afterDestroy':_0x9197('0x4')};function emitEvent(_0x515cdc){return function(_0x57cf2b,_0x1c23e2,_0x355707){ChatQueueEvents[_0x9197('0x5')](_0x515cdc+':'+_0x57cf2b['id'],_0x57cf2b);ChatQueueEvents['emit'](_0x515cdc,_0x57cf2b);_0x355707(null);};}for(var e in events){if(events[_0x9197('0x6')](e)){var event=events[e];ChatQueue[_0x9197('0x7')](e,emitEvent(event));}}module[_0x9197('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0xb595=['emit','hasOwnProperty','hook','../../mysqldb','ChatQueue','remove'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0xb595,0x189));var _0x5b59=function(_0x17401e,_0x19c421){_0x17401e=_0x17401e-0x0;var _0x5881e7=_0xb595[_0x17401e];return _0x5881e7;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x5b59('0x0'))['db'][_0x5b59('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5b59('0x2')};function emitEvent(_0xc85c1e){return function(_0x1df544,_0x5ef14b,_0x4990b9){ChatQueueEvents[_0x5b59('0x3')](_0xc85c1e+':'+_0x1df544['id'],_0x1df544);ChatQueueEvents[_0x5b59('0x3')](_0xc85c1e,_0x1df544);_0x4990b9(null);};}for(var e in events){if(events[_0x5b59('0x4')](e)){var event=events[e];ChatQueue[_0x5b59('0x5')](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 ee34366..52f14a8 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 _0x5110=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x382a50,_0x575e29){var _0x386eff=function(_0x3146b6){while(--_0x3146b6){_0x382a50['push'](_0x382a50['shift']());}};_0x386eff(++_0x575e29);}(_0x5110,0x10a));var _0x0511=function(_0x5d183f,_0x1b65a6){_0x5d183f=_0x5d183f-0x0;var _0x179134=_0x5110[_0x5d183f];return _0x179134;};'use strict';var _=require(_0x0511('0x0'));var util=require(_0x0511('0x1'));var logger=require(_0x0511('0x2'))(_0x0511('0x3'));var moment=require(_0x0511('0x4'));var BPromise=require(_0x0511('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0511('0x6'));var rimraf=require(_0x0511('0x7'));var config=require(_0x0511('0x8'));var attributes=require('./chatQueue.attributes');module[_0x0511('0x9')]=function(_0x5befa8,_0x1a204b){return _0x5befa8[_0x0511('0xa')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba90=['../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xba90,0xf0));var _0x0ba9=function(_0x1ac3a8,_0x55dc56){_0x1ac3a8=_0x1ac3a8-0x0;var _0x3beb47=_0xba90[_0x1ac3a8];return _0x3beb47;};'use strict';var _=require(_0x0ba9('0x0'));var util=require(_0x0ba9('0x1'));var logger=require('../../config/logger')(_0x0ba9('0x2'));var moment=require(_0x0ba9('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ba9('0x4'));var fs=require('fs');var path=require(_0x0ba9('0x5'));var rimraf=require(_0x0ba9('0x6'));var config=require(_0x0ba9('0x7'));var attributes=require(_0x0ba9('0x8'));module[_0x0ba9('0x9')]=function(_0x479cbd,_0x5771fb){return _0x479cbd[_0x0ba9('0xa')](_0x0ba9('0xb'),attributes,{'tableName':_0x0ba9('0xc'),'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 ad7d735..8f2ec3e 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 _0x4f7a=['ShowChatQueue','debug','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','info','catch'];(function(_0x13cab0,_0x14d825){var _0x38804f=function(_0x1bffaf){while(--_0x1bffaf){_0x13cab0['push'](_0x13cab0['shift']());}};_0x38804f(++_0x14d825);}(_0x4f7a,0x105));var _0xa4f7=function(_0x5f10d6,_0xc92616){_0x5f10d6=_0x5f10d6-0x0;var _0x551a6f=_0x4f7a[_0x5f10d6];return _0x551a6f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa4f7('0x0'));var BPromise=require(_0xa4f7('0x1'));var rs=require(_0xa4f7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4f7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4f7('0x4'))(_0xa4f7('0x5'));var config=require(_0xa4f7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa4f7('0x7')][_0xa4f7('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa4f7('0x9')],{'host':_0xa4f7('0xa'),'port':0x18eb});var socket=require(_0xa4f7('0xb'))(new Redis(config[_0xa4f7('0x9')]));require(_0xa4f7('0xc'))['register'](socket);function respondWithRpcPromise(_0x390174,_0x2f1c78,_0x39ba56){return new BPromise(function(_0x404403,_0x1f23b9){return client[_0xa4f7('0xd')](_0x390174,_0x39ba56)[_0xa4f7('0xe')](function(_0x5ed421){logger['info'](_0xa4f7('0xf'),_0x2f1c78,_0xa4f7('0x10'));logger['debug'](_0xa4f7('0x11'),_0x2f1c78,_0xa4f7('0x10'),JSON[_0xa4f7('0x12')](_0x5ed421));if(_0x5ed421['error']){if(_0x5ed421[_0xa4f7('0x13')][_0xa4f7('0x14')]===0x1f4){logger[_0xa4f7('0x13')]('ChatQueue,\x20%s,\x20%s',_0x2f1c78,_0x5ed421[_0xa4f7('0x13')][_0xa4f7('0x15')]);return _0x1f23b9(_0x5ed421[_0xa4f7('0x13')][_0xa4f7('0x15')]);}logger['error'](_0xa4f7('0xf'),_0x2f1c78,_0x5ed421[_0xa4f7('0x13')]['message']);return _0x404403(_0x5ed421['error'][_0xa4f7('0x15')]);}else{logger['info'](_0xa4f7('0xf'),_0x2f1c78,_0xa4f7('0x10'));_0x404403(_0x5ed421['result'][_0xa4f7('0x15')]);}})['catch'](function(_0x143dac){logger[_0xa4f7('0x13')](_0xa4f7('0xf'),_0x2f1c78,_0x143dac);_0x1f23b9(_0x143dac);});});}exports[_0xa4f7('0x16')]=function(_0x181911){var _0x44a54c=this;return new Promise(function(_0x48ec43,_0x18bb7a){return db[_0xa4f7('0x17')][_0xa4f7('0x18')]({'raw':_0x181911[_0xa4f7('0x19')]?_0x181911['options'][_0xa4f7('0x1a')]===undefined?!![]:![]:!![],'where':_0x181911[_0xa4f7('0x19')]?_0x181911[_0xa4f7('0x19')][_0xa4f7('0x1b')]||null:null,'attributes':_0x181911[_0xa4f7('0x19')]?_0x181911[_0xa4f7('0x19')][_0xa4f7('0x1c')]||null:null,'limit':_0x181911[_0xa4f7('0x19')]?_0x181911[_0xa4f7('0x19')][_0xa4f7('0x1d')]||null:null,'include':_0x181911[_0xa4f7('0x19')]?_0x181911[_0xa4f7('0x19')]['include']?_[_0xa4f7('0x1e')](_0x181911[_0xa4f7('0x19')][_0xa4f7('0x1f')],function(_0x2b56fe){return{'model':db[_0x2b56fe[_0xa4f7('0x20')]],'as':_0x2b56fe['as'],'attributes':_0x2b56fe['attributes'],'include':_0x2b56fe['include']?_['map'](_0x2b56fe[_0xa4f7('0x1f')],function(_0x4e6c36){return{'model':db[_0x4e6c36[_0xa4f7('0x20')]],'as':_0x4e6c36['as'],'attributes':_0x4e6c36[_0xa4f7('0x1c')],'include':_0x4e6c36[_0xa4f7('0x1f')]?_['map'](_0x4e6c36[_0xa4f7('0x1f')],function(_0x5366dc){return{'model':db[_0x5366dc[_0xa4f7('0x20')]],'as':_0x5366dc['as'],'attributes':_0x5366dc['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4f7('0xe')](function(_0x1009d2){logger[_0xa4f7('0x21')](_0xa4f7('0x16'),_0x181911);logger['debug'](_0xa4f7('0x16'),_0x181911,JSON[_0xa4f7('0x12')](_0x1009d2));_0x48ec43(_0x1009d2);})[_0xa4f7('0x22')](function(_0x3e4d19){logger[_0xa4f7('0x13')]('GetChatQueue',_0x3e4d19[_0xa4f7('0x15')],_0x181911);_0x18bb7a(_0x44a54c[_0xa4f7('0x13')](0x1f4,_0x3e4d19['message']));});});};exports[_0xa4f7('0x23')]=function(_0x106c07){var _0x195943=this;return new Promise(function(_0x52f8d2,_0xe955a6){return db[_0xa4f7('0x17')]['find']({'raw':_0x106c07['options']?_0x106c07[_0xa4f7('0x19')][_0xa4f7('0x1a')]===undefined?!![]:![]:!![],'where':_0x106c07[_0xa4f7('0x19')]?_0x106c07['options'][_0xa4f7('0x1b')]||null:null,'attributes':_0x106c07[_0xa4f7('0x19')]?_0x106c07[_0xa4f7('0x19')][_0xa4f7('0x1c')]||null:null,'include':_0x106c07[_0xa4f7('0x19')]?_0x106c07[_0xa4f7('0x19')][_0xa4f7('0x1f')]?_[_0xa4f7('0x1e')](_0x106c07[_0xa4f7('0x19')]['include'],function(_0x2cdb5d){return{'model':db[_0x2cdb5d[_0xa4f7('0x20')]],'as':_0x2cdb5d['as'],'attributes':_0x2cdb5d[_0xa4f7('0x1c')],'include':_0x2cdb5d[_0xa4f7('0x1f')]?_[_0xa4f7('0x1e')](_0x2cdb5d[_0xa4f7('0x1f')],function(_0x3f01fa){return{'model':db[_0x3f01fa[_0xa4f7('0x20')]],'as':_0x3f01fa['as'],'attributes':_0x3f01fa['attributes'],'include':_0x3f01fa[_0xa4f7('0x1f')]?_[_0xa4f7('0x1e')](_0x3f01fa['include'],function(_0x5ee074){return{'model':db[_0x5ee074[_0xa4f7('0x20')]],'as':_0x5ee074['as'],'attributes':_0x5ee074[_0xa4f7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa4f7('0xe')](function(_0x57db76){logger[_0xa4f7('0x21')](_0xa4f7('0x23'),_0x106c07);logger[_0xa4f7('0x24')](_0xa4f7('0x23'),_0x106c07,JSON['stringify'](_0x57db76));_0x52f8d2(_0x57db76);})[_0xa4f7('0x22')](function(_0x32a25a){logger[_0xa4f7('0x13')](_0xa4f7('0x23'),_0x32a25a[_0xa4f7('0x15')],_0x106c07);_0xe955a6(_0x195943[_0xa4f7('0x13')](0x1f4,_0x32a25a[_0xa4f7('0x15')]));});});}; \ No newline at end of file +var _0x3eaf=['options','raw','where','include','model','attributes','map','GetChatQueue','find','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./chatQueue.socket','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','ChatQueue','findAll'];(function(_0x50b02d,_0x4b5681){var _0x351ef7=function(_0x56ab44){while(--_0x56ab44){_0x50b02d['push'](_0x50b02d['shift']());}};_0x351ef7(++_0x4b5681);}(_0x3eaf,0x190));var _0xf3ea=function(_0x1298d5,_0x1a7b62){_0x1298d5=_0x1298d5-0x0;var _0x21bd4b=_0x3eaf[_0x1298d5];return _0x21bd4b;};'use strict';var _=require(_0xf3ea('0x0'));var util=require(_0xf3ea('0x1'));var moment=require(_0xf3ea('0x2'));var BPromise=require(_0xf3ea('0x3'));var rs=require(_0xf3ea('0x4'));var fs=require('fs');var Redis=require(_0xf3ea('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3ea('0x6'));var logger=require(_0xf3ea('0x7'))(_0xf3ea('0x8'));var config=require('../../config/environment');var jayson=require(_0xf3ea('0x9'));var client=jayson['client'][_0xf3ea('0xa')]({'port':0x232a});config[_0xf3ea('0xb')]=_[_0xf3ea('0xc')](config['redis'],{'host':_0xf3ea('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf3ea('0xb')]));require(_0xf3ea('0xe'))['register'](socket);function respondWithRpcPromise(_0x1c62d3,_0x4c98aa,_0x21a505){return new BPromise(function(_0x1f2825,_0x585092){return client['request'](_0x1c62d3,_0x21a505)[_0xf3ea('0xf')](function(_0x446f7c){logger[_0xf3ea('0x10')]('ChatQueue,\x20%s,\x20%s',_0x4c98aa,_0xf3ea('0x11'));logger[_0xf3ea('0x12')](_0xf3ea('0x13'),_0x4c98aa,'request\x20sent',JSON[_0xf3ea('0x14')](_0x446f7c));if(_0x446f7c[_0xf3ea('0x15')]){if(_0x446f7c[_0xf3ea('0x15')][_0xf3ea('0x16')]===0x1f4){logger[_0xf3ea('0x15')](_0xf3ea('0x17'),_0x4c98aa,_0x446f7c[_0xf3ea('0x15')][_0xf3ea('0x18')]);return _0x585092(_0x446f7c['error'][_0xf3ea('0x18')]);}logger['error'](_0xf3ea('0x17'),_0x4c98aa,_0x446f7c[_0xf3ea('0x15')]['message']);return _0x1f2825(_0x446f7c[_0xf3ea('0x15')][_0xf3ea('0x18')]);}else{logger[_0xf3ea('0x10')](_0xf3ea('0x17'),_0x4c98aa,'request\x20sent');_0x1f2825(_0x446f7c[_0xf3ea('0x19')][_0xf3ea('0x18')]);}})[_0xf3ea('0x1a')](function(_0x16bff3){logger[_0xf3ea('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4c98aa,_0x16bff3);_0x585092(_0x16bff3);});});}exports['GetChatQueue']=function(_0x23c030){var _0x69546=this;return new Promise(function(_0x4d7f46,_0x2c7419){return db[_0xf3ea('0x1b')][_0xf3ea('0x1c')]({'raw':_0x23c030[_0xf3ea('0x1d')]?_0x23c030[_0xf3ea('0x1d')][_0xf3ea('0x1e')]===undefined?!![]:![]:!![],'where':_0x23c030[_0xf3ea('0x1d')]?_0x23c030[_0xf3ea('0x1d')][_0xf3ea('0x1f')]||null:null,'attributes':_0x23c030[_0xf3ea('0x1d')]?_0x23c030[_0xf3ea('0x1d')]['attributes']||null:null,'limit':_0x23c030[_0xf3ea('0x1d')]?_0x23c030[_0xf3ea('0x1d')]['limit']||null:null,'include':_0x23c030['options']?_0x23c030['options'][_0xf3ea('0x20')]?_['map'](_0x23c030[_0xf3ea('0x1d')][_0xf3ea('0x20')],function(_0x4ea971){return{'model':db[_0x4ea971[_0xf3ea('0x21')]],'as':_0x4ea971['as'],'attributes':_0x4ea971[_0xf3ea('0x22')],'include':_0x4ea971[_0xf3ea('0x20')]?_[_0xf3ea('0x23')](_0x4ea971[_0xf3ea('0x20')],function(_0x5b91e9){return{'model':db[_0x5b91e9['model']],'as':_0x5b91e9['as'],'attributes':_0x5b91e9['attributes'],'include':_0x5b91e9['include']?_[_0xf3ea('0x23')](_0x5b91e9[_0xf3ea('0x20')],function(_0x120232){return{'model':db[_0x120232[_0xf3ea('0x21')]],'as':_0x120232['as'],'attributes':_0x120232[_0xf3ea('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf3ea('0xf')](function(_0x3c2cdb){logger[_0xf3ea('0x10')]('GetChatQueue',_0x23c030);logger[_0xf3ea('0x12')](_0xf3ea('0x24'),_0x23c030,JSON[_0xf3ea('0x14')](_0x3c2cdb));_0x4d7f46(_0x3c2cdb);})[_0xf3ea('0x1a')](function(_0x9c5d48){logger[_0xf3ea('0x15')](_0xf3ea('0x24'),_0x9c5d48[_0xf3ea('0x18')],_0x23c030);_0x2c7419(_0x69546[_0xf3ea('0x15')](0x1f4,_0x9c5d48[_0xf3ea('0x18')]));});});};exports['ShowChatQueue']=function(_0x4a6093){var _0x18f0a8=this;return new Promise(function(_0x299ff8,_0x457629){return db[_0xf3ea('0x1b')][_0xf3ea('0x25')]({'raw':_0x4a6093[_0xf3ea('0x1d')]?_0x4a6093[_0xf3ea('0x1d')][_0xf3ea('0x1e')]===undefined?!![]:![]:!![],'where':_0x4a6093[_0xf3ea('0x1d')]?_0x4a6093['options'][_0xf3ea('0x1f')]||null:null,'attributes':_0x4a6093[_0xf3ea('0x1d')]?_0x4a6093[_0xf3ea('0x1d')][_0xf3ea('0x22')]||null:null,'include':_0x4a6093[_0xf3ea('0x1d')]?_0x4a6093[_0xf3ea('0x1d')][_0xf3ea('0x20')]?_[_0xf3ea('0x23')](_0x4a6093[_0xf3ea('0x1d')][_0xf3ea('0x20')],function(_0x2186ba){return{'model':db[_0x2186ba[_0xf3ea('0x21')]],'as':_0x2186ba['as'],'attributes':_0x2186ba[_0xf3ea('0x22')],'include':_0x2186ba[_0xf3ea('0x20')]?_[_0xf3ea('0x23')](_0x2186ba['include'],function(_0x4b73e8){return{'model':db[_0x4b73e8[_0xf3ea('0x21')]],'as':_0x4b73e8['as'],'attributes':_0x4b73e8[_0xf3ea('0x22')],'include':_0x4b73e8[_0xf3ea('0x20')]?_['map'](_0x4b73e8[_0xf3ea('0x20')],function(_0x51589d){return{'model':db[_0x51589d[_0xf3ea('0x21')]],'as':_0x51589d['as'],'attributes':_0x51589d['attributes']};}):[]};}):[]};}):[]:[]})[_0xf3ea('0xf')](function(_0x59fa88){logger[_0xf3ea('0x10')](_0xf3ea('0x26'),_0x4a6093);logger[_0xf3ea('0x12')](_0xf3ea('0x26'),_0x4a6093,JSON[_0xf3ea('0x14')](_0x59fa88));_0x299ff8(_0x59fa88);})[_0xf3ea('0x1a')](function(_0x44a599){logger[_0xf3ea('0x15')](_0xf3ea('0x26'),_0x44a599[_0xf3ea('0x18')],_0x4a6093);_0x457629(_0x18f0a8[_0xf3ea('0x15')](0x1f4,_0x44a599['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 9c72994..be9f598 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 _0xd6d6=['chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x11204e,_0x19433e){var _0x3110f6=function(_0x41b7b7){while(--_0x41b7b7){_0x11204e['push'](_0x11204e['shift']());}};_0x3110f6(++_0x19433e);}(_0xd6d6,0xbe));var _0x6d6d=function(_0xf2ace7,_0x13a339){_0xf2ace7=_0xf2ace7-0x0;var _0x78d892=_0xd6d6[_0xf2ace7];return _0x78d892;};'use strict';var ChatQueueEvents=require(_0x6d6d('0x0'));var events=[_0x6d6d('0x1'),_0x6d6d('0x2'),_0x6d6d('0x3')];function createListener(_0x536523,_0x2e1aed){return function(_0x3b743d){_0x2e1aed[_0x6d6d('0x4')](_0x536523,_0x3b743d);};}function removeListener(_0x2a838a,_0x5207c9){return function(){ChatQueueEvents[_0x6d6d('0x5')](_0x2a838a,_0x5207c9);};}exports[_0x6d6d('0x6')]=function(_0x5702dc){for(var _0x210ff7=0x0,_0x1bf731=events[_0x6d6d('0x7')];_0x210ff7<_0x1bf731;_0x210ff7++){var _0x18f824=events[_0x210ff7];var _0xd49f57=createListener(_0x6d6d('0x8')+_0x18f824,_0x5702dc);ChatQueueEvents['on'](_0x18f824,_0xd49f57);}}; \ No newline at end of file +var _0x84ab=['update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove'];(function(_0x12f72e,_0x27df68){var _0x421f7d=function(_0x30182d){while(--_0x30182d){_0x12f72e['push'](_0x12f72e['shift']());}};_0x421f7d(++_0x27df68);}(_0x84ab,0x12f));var _0xb84a=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x84ab[_0x513aa5];return _0x1a1a7c;};'use strict';var ChatQueueEvents=require(_0xb84a('0x0'));var events=[_0xb84a('0x1'),_0xb84a('0x2'),_0xb84a('0x3')];function createListener(_0x473c3,_0x512f13){return function(_0xc83587){_0x512f13[_0xb84a('0x4')](_0x473c3,_0xc83587);};}function removeListener(_0x47b8e3,_0x9d3a00){return function(){ChatQueueEvents[_0xb84a('0x5')](_0x47b8e3,_0x9d3a00);};}exports[_0xb84a('0x6')]=function(_0x5b9def){for(var _0x521a64=0x0,_0x4dc496=events[_0xb84a('0x7')];_0x521a64<_0x4dc496;_0x521a64++){var _0x4fac4d=events[_0x521a64];var _0x3e9086=createListener(_0xb84a('0x8')+_0x4fac4d,_0x5b9def);ChatQueueEvents['on'](_0x4fac4d,_0x3e9086);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 5e7b9ad..68f5bd9 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(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4d7379,_0x4b4e63){_0x4d7379=_0x4d7379-0x0;var _0x46d7cf=_0x5fc3[_0x4d7379];return _0x46d7cf;};'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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x4b6a73,_0x136ad1){var _0x1af181=function(_0x42e026){while(--_0x42e026){_0x4b6a73['push'](_0x4b6a73['shift']());}};_0x1af181(++_0x136ad1);}(_0xe14b,0x93));var _0xbe14=function(_0x1340ba,_0x21af71){_0x1340ba=_0x1340ba-0x0;var _0xc65d60=_0xe14b[_0x1340ba];return _0xc65d60;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index fb28d52..01cc8aa 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 _0x6a42=['moment','sequelize','exports','STRING','DATE'];(function(_0x3f4512,_0x39f038){var _0x3c3c10=function(_0x4341ef){while(--_0x4341ef){_0x3f4512['push'](_0x3f4512['shift']());}};_0x3c3c10(++_0x39f038);}(_0x6a42,0x122));var _0x26a4=function(_0x14ef02,_0x18d327){_0x14ef02=_0x14ef02-0x0;var _0x5545eb=_0x6a42[_0x14ef02];return _0x5545eb;};'use strict';var moment=require(_0x26a4('0x0'));var Sequelize=require(_0x26a4('0x1'));module[_0x26a4('0x2')]={'uniqueid':{'type':Sequelize[_0x26a4('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x26a4('0x4')]},'leaveAt':{'type':Sequelize[_0x26a4('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x26a4('0x3')]}}; \ No newline at end of file +var _0x1838=['exports','STRING','DATE'];(function(_0x29f18c,_0x576aba){var _0x19c61f=function(_0x4e6a12){while(--_0x4e6a12){_0x29f18c['push'](_0x29f18c['shift']());}};_0x19c61f(++_0x576aba);}(_0x1838,0xb7));var _0x8183=function(_0x35b2aa,_0x482ce4){_0x35b2aa=_0x35b2aa-0x0;var _0x1248da=_0x1838[_0x35b2aa];return _0x1248da;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x8183('0x0')]={'uniqueid':{'type':Sequelize[_0x8183('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8183('0x2')]},'leaveAt':{'type':Sequelize[_0x8183('0x2')]},'acceptAt':{'type':Sequelize[_0x8183('0x2')]},'exitAt':{'type':Sequelize[_0x8183('0x2')]},'reason':{'type':Sequelize[_0x8183('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 489f934..86e5775 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 _0x1c23=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','then','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','length','attributes','hasOwnProperty'];(function(_0x1b40d7,_0x27a2f5){var _0x4be1b1=function(_0x17ee87){while(--_0x17ee87){_0x1b40d7['push'](_0x1b40d7['shift']());}};_0x4be1b1(++_0x27a2f5);}(_0x1c23,0x1d5));var _0x31c2=function(_0x356778,_0x2292c1){_0x356778=_0x356778-0x0;var _0x3b1921=_0x1c23[_0x356778];return _0x3b1921;};'use strict';var emlformat=require(_0x31c2('0x0'));var rimraf=require(_0x31c2('0x1'));var zipdir=require(_0x31c2('0x2'));var jsonpatch=require(_0x31c2('0x3'));var rp=require(_0x31c2('0x4'));var moment=require(_0x31c2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x31c2('0x6'));var util=require(_0x31c2('0x7'));var path=require('path');var sox=require(_0x31c2('0x8'));var csv=require(_0x31c2('0x9'));var ejs=require(_0x31c2('0xa'));var fs=require('fs');var fs_extra=require(_0x31c2('0xb'));var _=require(_0x31c2('0xc'));var squel=require('squel');var crypto=require(_0x31c2('0xd'));var jsforce=require(_0x31c2('0xe'));var deskjs=require(_0x31c2('0xf'));var toCsv=require(_0x31c2('0x9'));var querystring=require(_0x31c2('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x31c2('0x11'));var qs=require(_0x31c2('0x12'));var as=require(_0x31c2('0x13'));var hardwareService=require(_0x31c2('0x14'));var logger=require(_0x31c2('0x15'))(_0x31c2('0x16'));var utils=require('../../config/utils');var config=require(_0x31c2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x31c2('0x18'))['db'];function respondWithStatusCode(_0x2df4e5,_0x1d8406){_0x1d8406=_0x1d8406||0xcc;return function(_0x5f573a){if(_0x5f573a){return _0x2df4e5[_0x31c2('0x19')](_0x1d8406);}return _0x2df4e5[_0x31c2('0x1a')](_0x1d8406)['end']();};}function respondWithResult(_0x14c25f,_0x44d874){_0x44d874=_0x44d874||0xc8;return function(_0x463881){if(_0x463881){return _0x14c25f[_0x31c2('0x1a')](_0x44d874)[_0x31c2('0x1b')](_0x463881);}};}function respondWithFilteredResult(_0x5fa42e,_0x1cf235){return function(_0x35f75b){if(_0x35f75b){var _0x3f1d79=typeof _0x1cf235[_0x31c2('0x1c')]===_0x31c2('0x1d')&&typeof _0x1cf235['limit']==='undefined';var _0x3bfa45=_0x35f75b[_0x31c2('0x1e')];var _0x1f7f83=_0x3f1d79?0x0:_0x1cf235['offset'];var _0x5055e7=_0x3f1d79?_0x35f75b[_0x31c2('0x1e')]:_0x1cf235['offset']+_0x1cf235[_0x31c2('0x1f')];var _0x3f2435;if(_0x5055e7>=_0x3bfa45){_0x5055e7=_0x3bfa45;_0x3f2435=0xc8;}else{_0x3f2435=0xce;}_0x5fa42e[_0x31c2('0x1a')](_0x3f2435);return _0x5fa42e[_0x31c2('0x20')]('Content-Range',_0x1f7f83+'-'+_0x5055e7+'/'+_0x3bfa45)[_0x31c2('0x1b')](_0x35f75b);}return null;};}function patchUpdates(_0x4ae7ad){return function(_0x35d945){try{jsonpatch[_0x31c2('0x21')](_0x35d945,_0x4ae7ad,!![]);}catch(_0x483c25){return BPromise['reject'](_0x483c25);}return _0x35d945[_0x31c2('0x22')]();};}function saveUpdates(_0x36ae8e,_0x4cd43e){return function(_0x133d0e){if(_0x133d0e){return _0x133d0e[_0x31c2('0x23')](_0x36ae8e)[_0x31c2('0x24')](function(_0x44a0bc){return _0x44a0bc;});}return null;};}function removeEntity(_0x5e10e7,_0x25bdc2){return function(_0x26939e){if(_0x26939e){return _0x26939e['destroy']()[_0x31c2('0x24')](function(){_0x5e10e7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3af6eb,_0x58f82d){return function(_0x37b749){if(!_0x37b749){_0x3af6eb[_0x31c2('0x19')](0x194);}return _0x37b749;};}function handleError(_0x18e3d8,_0x211a43){_0x211a43=_0x211a43||0x1f4;return function(_0x3ad658){logger['error'](_0x3ad658[_0x31c2('0x25')]);if(_0x3ad658[_0x31c2('0x26')]){delete _0x3ad658[_0x31c2('0x26')];}_0x18e3d8['status'](_0x211a43)[_0x31c2('0x27')](_0x3ad658);};}exports[_0x31c2('0x28')]=function(_0xf8879a,_0x2a936e){var _0x45aa60={},_0x2164d8={},_0x13c1ea={'count':0x0,'rows':[]};var _0x5d2a1a=_[_0x31c2('0x29')](db[_0x31c2('0x2a')][_0x31c2('0x2b')],function(_0x2488eb){return{'name':_0x2488eb[_0x31c2('0x2c')],'type':_0x2488eb[_0x31c2('0x2d')][_0x31c2('0x2e')]};});_0x2164d8['model']=_['map'](_0x5d2a1a,_0x31c2('0x26'));_0x2164d8['query']=_[_0x31c2('0x2f')](_0xf8879a[_0x31c2('0x30')]);_0x2164d8[_0x31c2('0x31')]=_[_0x31c2('0x32')](_0x2164d8['model'],_0x2164d8[_0x31c2('0x30')]);_0x45aa60['attributes']=_[_0x31c2('0x32')](_0x2164d8[_0x31c2('0x33')],qs[_0x31c2('0x34')](_0xf8879a[_0x31c2('0x30')]['fields']));_0x45aa60['attributes']=_0x45aa60['attributes'][_0x31c2('0x35')]?_0x45aa60[_0x31c2('0x36')]:_0x2164d8[_0x31c2('0x33')];if(!_0xf8879a[_0x31c2('0x30')][_0x31c2('0x37')](_0x31c2('0x38'))){_0x45aa60[_0x31c2('0x1f')]=qs[_0x31c2('0x1f')](_0xf8879a[_0x31c2('0x30')][_0x31c2('0x1f')]);_0x45aa60[_0x31c2('0x1c')]=qs[_0x31c2('0x1c')](_0xf8879a[_0x31c2('0x30')][_0x31c2('0x1c')]);}_0x45aa60[_0x31c2('0x39')]=qs['sort'](_0xf8879a['query'][_0x31c2('0x3a')]);_0x45aa60[_0x31c2('0x3b')]=qs[_0x31c2('0x31')](_[_0x31c2('0x3c')](_0xf8879a[_0x31c2('0x30')],_0x2164d8['filters']),_0x5d2a1a);if(_0xf8879a['query'][_0x31c2('0x3d')]){_0x45aa60[_0x31c2('0x3b')]=_[_0x31c2('0x3e')](_0x45aa60[_0x31c2('0x3b')],{'$or':_[_0x31c2('0x29')](_0x5d2a1a,function(_0x4855ef){if(_0x4855ef[_0x31c2('0x2d')]!==_0x31c2('0x3f')){var _0x592258={};_0x592258[_0x4855ef[_0x31c2('0x26')]]={'$like':'%'+_0xf8879a['query'][_0x31c2('0x3d')]+'%'};return _0x592258;}})});}_0x45aa60=_[_0x31c2('0x3e')]({},_0x45aa60,_0xf8879a[_0x31c2('0x40')]);var _0x158cca={'where':_0x45aa60['where']};return db[_0x31c2('0x2a')][_0x31c2('0x1e')](_0x158cca)[_0x31c2('0x24')](function(_0x412b5e){_0x13c1ea['count']=_0x412b5e;if(_0xf8879a[_0x31c2('0x30')][_0x31c2('0x41')]){_0x45aa60[_0x31c2('0x42')]=[{'all':!![]}];}return db[_0x31c2('0x2a')][_0x31c2('0x43')](_0x45aa60);})['then'](function(_0x17bb5e){_0x13c1ea['rows']=_0x17bb5e;return _0x13c1ea;})[_0x31c2('0x24')](respondWithFilteredResult(_0x2a936e,_0x45aa60))['catch'](handleError(_0x2a936e,null));};exports[_0x31c2('0x44')]=function(_0x36a7be,_0x149bd0){var _0x1932b5={'raw':!![],'where':{'id':_0x36a7be[_0x31c2('0x45')]['id']}},_0x32cfe3={};_0x32cfe3[_0x31c2('0x33')]=_['keys'](db[_0x31c2('0x2a')][_0x31c2('0x2b')]);_0x32cfe3[_0x31c2('0x30')]=_[_0x31c2('0x2f')](_0x36a7be[_0x31c2('0x30')]);_0x32cfe3[_0x31c2('0x31')]=_[_0x31c2('0x32')](_0x32cfe3[_0x31c2('0x33')],_0x32cfe3[_0x31c2('0x30')]);_0x1932b5[_0x31c2('0x36')]=_[_0x31c2('0x32')](_0x32cfe3[_0x31c2('0x33')],qs[_0x31c2('0x34')](_0x36a7be[_0x31c2('0x30')][_0x31c2('0x34')]));_0x1932b5[_0x31c2('0x36')]=_0x1932b5[_0x31c2('0x36')][_0x31c2('0x35')]?_0x1932b5['attributes']:_0x32cfe3[_0x31c2('0x33')];if(_0x36a7be[_0x31c2('0x30')]['includeAll']){_0x1932b5[_0x31c2('0x42')]=[{'all':!![]}];}_0x1932b5=_[_0x31c2('0x3e')]({},_0x1932b5,_0x36a7be[_0x31c2('0x40')]);return db[_0x31c2('0x2a')][_0x31c2('0x46')](_0x1932b5)[_0x31c2('0x24')](handleEntityNotFound(_0x149bd0,null))[_0x31c2('0x24')](respondWithResult(_0x149bd0,null))['catch'](handleError(_0x149bd0,null));};exports['create']=function(_0x583842,_0x29be6f){return db[_0x31c2('0x2a')]['create'](_0x583842['body'],{})[_0x31c2('0x24')](respondWithResult(_0x29be6f,0xc9))[_0x31c2('0x47')](handleError(_0x29be6f,null));};exports['update']=function(_0x2f935d,_0x28f9e7){if(_0x2f935d['body']['id']){delete _0x2f935d[_0x31c2('0x48')]['id'];}return db[_0x31c2('0x2a')]['find']({'where':{'id':_0x2f935d[_0x31c2('0x45')]['id']}})[_0x31c2('0x24')](handleEntityNotFound(_0x28f9e7,null))['then'](saveUpdates(_0x2f935d[_0x31c2('0x48')],null))[_0x31c2('0x24')](respondWithResult(_0x28f9e7,null))[_0x31c2('0x47')](handleError(_0x28f9e7,null));};exports[_0x31c2('0x49')]=function(_0x35d315,_0xa924bd){return db[_0x31c2('0x2a')][_0x31c2('0x46')]({'where':{'id':_0x35d315[_0x31c2('0x45')]['id']}})[_0x31c2('0x24')](handleEntityNotFound(_0xa924bd,null))['then'](removeEntity(_0xa924bd,null))['catch'](handleError(_0xa924bd,null));};exports[_0x31c2('0x4a')]=function(_0x41f7e6,_0x2b65ee){return db[_0x31c2('0x2a')][_0x31c2('0x4a')]()[_0x31c2('0x24')](respondWithResult(_0x2b65ee,null))[_0x31c2('0x47')](handleError(_0x2b65ee,null));}; \ No newline at end of file +var _0xf2e0=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x20f4c7,_0x476718){var _0x1f9aaf=function(_0xa408a3){while(--_0xa408a3){_0x20f4c7['push'](_0x20f4c7['shift']());}};_0x1f9aaf(++_0x476718);}(_0xf2e0,0xc7));var _0x0f2e=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xf2e0[_0x16d10f];return _0x50c823;};'use strict';var emlformat=require(_0x0f2e('0x0'));var rimraf=require(_0x0f2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f2e('0x2'));var rp=require(_0x0f2e('0x3'));var moment=require('moment');var BPromise=require(_0x0f2e('0x4'));var Mustache=require(_0x0f2e('0x5'));var util=require(_0x0f2e('0x6'));var path=require('path');var sox=require(_0x0f2e('0x7'));var csv=require(_0x0f2e('0x8'));var ejs=require(_0x0f2e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0f2e('0xa'));var crypto=require('crypto');var jsforce=require(_0x0f2e('0xb'));var deskjs=require(_0x0f2e('0xc'));var toCsv=require(_0x0f2e('0x8'));var querystring=require('querystring');var Papa=require(_0x0f2e('0xd'));var Redis=require(_0x0f2e('0xe'));var authService=require(_0x0f2e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0f2e('0x10'));var hardwareService=require(_0x0f2e('0x11'));var logger=require('../../config/logger')(_0x0f2e('0x12'));var utils=require(_0x0f2e('0x13'));var config=require(_0x0f2e('0x14'));var licenseUtil=require(_0x0f2e('0x15'));var db=require(_0x0f2e('0x16'))['db'];function respondWithStatusCode(_0x4f9eac,_0x5445d9){_0x5445d9=_0x5445d9||0xcc;return function(_0x408c4d){if(_0x408c4d){return _0x4f9eac[_0x0f2e('0x17')](_0x5445d9);}return _0x4f9eac[_0x0f2e('0x18')](_0x5445d9)[_0x0f2e('0x19')]();};}function respondWithResult(_0x15b723,_0x72e89f){_0x72e89f=_0x72e89f||0xc8;return function(_0x5858ac){if(_0x5858ac){return _0x15b723[_0x0f2e('0x18')](_0x72e89f)[_0x0f2e('0x1a')](_0x5858ac);}};}function respondWithFilteredResult(_0x177116,_0x259665){return function(_0x2f557f){if(_0x2f557f){var _0x4735c8=typeof _0x259665[_0x0f2e('0x1b')]===_0x0f2e('0x1c')&&typeof _0x259665[_0x0f2e('0x1d')]===_0x0f2e('0x1c');var _0x2441bf=_0x2f557f[_0x0f2e('0x1e')];var _0x5e55d2=_0x4735c8?0x0:_0x259665[_0x0f2e('0x1b')];var _0x2034b3=_0x4735c8?_0x2f557f[_0x0f2e('0x1e')]:_0x259665['offset']+_0x259665[_0x0f2e('0x1d')];var _0x10a11f;if(_0x2034b3>=_0x2441bf){_0x2034b3=_0x2441bf;_0x10a11f=0xc8;}else{_0x10a11f=0xce;}_0x177116['status'](_0x10a11f);return _0x177116['set'](_0x0f2e('0x1f'),_0x5e55d2+'-'+_0x2034b3+'/'+_0x2441bf)['json'](_0x2f557f);}return null;};}function patchUpdates(_0xa5be54){return function(_0x3cac4e){try{jsonpatch['apply'](_0x3cac4e,_0xa5be54,!![]);}catch(_0x3b9c20){return BPromise[_0x0f2e('0x20')](_0x3b9c20);}return _0x3cac4e[_0x0f2e('0x21')]();};}function saveUpdates(_0x3d1fa0,_0x3e13fa){return function(_0x194023){if(_0x194023){return _0x194023[_0x0f2e('0x22')](_0x3d1fa0)[_0x0f2e('0x23')](function(_0x522923){return _0x522923;});}return null;};}function removeEntity(_0x25526d,_0x1153be){return function(_0x1dc4d7){if(_0x1dc4d7){return _0x1dc4d7[_0x0f2e('0x24')]()['then'](function(){_0x25526d['status'](0xcc)[_0x0f2e('0x19')]();});}};}function handleEntityNotFound(_0x2a3b9f,_0x296caf){return function(_0x56247e){if(!_0x56247e){_0x2a3b9f['sendStatus'](0x194);}return _0x56247e;};}function handleError(_0x2a5cf7,_0x48cd20){_0x48cd20=_0x48cd20||0x1f4;return function(_0x525a30){logger[_0x0f2e('0x25')](_0x525a30[_0x0f2e('0x26')]);if(_0x525a30[_0x0f2e('0x27')]){delete _0x525a30[_0x0f2e('0x27')];}_0x2a5cf7[_0x0f2e('0x18')](_0x48cd20)['send'](_0x525a30);};}exports[_0x0f2e('0x28')]=function(_0x2e1256,_0x44c117){var _0x29b606={},_0x5a11b5={},_0x464f36={'count':0x0,'rows':[]};var _0xa1a88b=_[_0x0f2e('0x29')](db[_0x0f2e('0x2a')][_0x0f2e('0x2b')],function(_0x349e68){return{'name':_0x349e68[_0x0f2e('0x2c')],'type':_0x349e68['type']['key']};});_0x5a11b5[_0x0f2e('0x2d')]=_[_0x0f2e('0x29')](_0xa1a88b,_0x0f2e('0x27'));_0x5a11b5[_0x0f2e('0x2e')]=_[_0x0f2e('0x2f')](_0x2e1256['query']);_0x5a11b5[_0x0f2e('0x30')]=_[_0x0f2e('0x31')](_0x5a11b5[_0x0f2e('0x2d')],_0x5a11b5[_0x0f2e('0x2e')]);_0x29b606[_0x0f2e('0x32')]=_[_0x0f2e('0x31')](_0x5a11b5[_0x0f2e('0x2d')],qs['fields'](_0x2e1256[_0x0f2e('0x2e')][_0x0f2e('0x33')]));_0x29b606['attributes']=_0x29b606['attributes'][_0x0f2e('0x34')]?_0x29b606[_0x0f2e('0x32')]:_0x5a11b5[_0x0f2e('0x2d')];if(!_0x2e1256[_0x0f2e('0x2e')]['hasOwnProperty'](_0x0f2e('0x35'))){_0x29b606[_0x0f2e('0x1d')]=qs[_0x0f2e('0x1d')](_0x2e1256[_0x0f2e('0x2e')][_0x0f2e('0x1d')]);_0x29b606[_0x0f2e('0x1b')]=qs[_0x0f2e('0x1b')](_0x2e1256['query'][_0x0f2e('0x1b')]);}_0x29b606[_0x0f2e('0x36')]=qs[_0x0f2e('0x37')](_0x2e1256[_0x0f2e('0x2e')][_0x0f2e('0x37')]);_0x29b606['where']=qs[_0x0f2e('0x30')](_[_0x0f2e('0x38')](_0x2e1256[_0x0f2e('0x2e')],_0x5a11b5[_0x0f2e('0x30')]),_0xa1a88b);if(_0x2e1256[_0x0f2e('0x2e')][_0x0f2e('0x39')]){_0x29b606['where']=_[_0x0f2e('0x3a')](_0x29b606[_0x0f2e('0x3b')],{'$or':_[_0x0f2e('0x29')](_0xa1a88b,function(_0x263ec6){if(_0x263ec6[_0x0f2e('0x3c')]!==_0x0f2e('0x3d')){var _0x4109e1={};_0x4109e1[_0x263ec6['name']]={'$like':'%'+_0x2e1256[_0x0f2e('0x2e')][_0x0f2e('0x39')]+'%'};return _0x4109e1;}})});}_0x29b606=_['merge']({},_0x29b606,_0x2e1256[_0x0f2e('0x3e')]);var _0x4acb38={'where':_0x29b606['where']};return db[_0x0f2e('0x2a')]['count'](_0x4acb38)['then'](function(_0x15def6){_0x464f36[_0x0f2e('0x1e')]=_0x15def6;if(_0x2e1256['query'][_0x0f2e('0x3f')]){_0x29b606[_0x0f2e('0x40')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x0f2e('0x41')](_0x29b606);})[_0x0f2e('0x23')](function(_0x32dcac){_0x464f36['rows']=_0x32dcac;return _0x464f36;})[_0x0f2e('0x23')](respondWithFilteredResult(_0x44c117,_0x29b606))[_0x0f2e('0x42')](handleError(_0x44c117,null));};exports[_0x0f2e('0x43')]=function(_0x1df9e0,_0x1ca1fe){var _0x4af0b0={'raw':!![],'where':{'id':_0x1df9e0[_0x0f2e('0x44')]['id']}},_0x2c8abe={};_0x2c8abe['model']=_[_0x0f2e('0x2f')](db[_0x0f2e('0x2a')][_0x0f2e('0x2b')]);_0x2c8abe[_0x0f2e('0x2e')]=_[_0x0f2e('0x2f')](_0x1df9e0[_0x0f2e('0x2e')]);_0x2c8abe['filters']=_[_0x0f2e('0x31')](_0x2c8abe[_0x0f2e('0x2d')],_0x2c8abe[_0x0f2e('0x2e')]);_0x4af0b0['attributes']=_[_0x0f2e('0x31')](_0x2c8abe[_0x0f2e('0x2d')],qs[_0x0f2e('0x33')](_0x1df9e0[_0x0f2e('0x2e')][_0x0f2e('0x33')]));_0x4af0b0[_0x0f2e('0x32')]=_0x4af0b0['attributes'][_0x0f2e('0x34')]?_0x4af0b0[_0x0f2e('0x32')]:_0x2c8abe[_0x0f2e('0x2d')];if(_0x1df9e0[_0x0f2e('0x2e')][_0x0f2e('0x3f')]){_0x4af0b0[_0x0f2e('0x40')]=[{'all':!![]}];}_0x4af0b0=_[_0x0f2e('0x3a')]({},_0x4af0b0,_0x1df9e0[_0x0f2e('0x3e')]);return db['ChatQueueReport'][_0x0f2e('0x45')](_0x4af0b0)['then'](handleEntityNotFound(_0x1ca1fe,null))[_0x0f2e('0x23')](respondWithResult(_0x1ca1fe,null))[_0x0f2e('0x42')](handleError(_0x1ca1fe,null));};exports[_0x0f2e('0x46')]=function(_0x3519f4,_0x4f359a){return db[_0x0f2e('0x2a')][_0x0f2e('0x46')](_0x3519f4['body'],{})[_0x0f2e('0x23')](respondWithResult(_0x4f359a,0xc9))[_0x0f2e('0x42')](handleError(_0x4f359a,null));};exports['update']=function(_0x20911f,_0x13c402){if(_0x20911f[_0x0f2e('0x47')]['id']){delete _0x20911f[_0x0f2e('0x47')]['id'];}return db[_0x0f2e('0x2a')][_0x0f2e('0x45')]({'where':{'id':_0x20911f['params']['id']}})['then'](handleEntityNotFound(_0x13c402,null))[_0x0f2e('0x23')](saveUpdates(_0x20911f[_0x0f2e('0x47')],null))[_0x0f2e('0x23')](respondWithResult(_0x13c402,null))['catch'](handleError(_0x13c402,null));};exports['destroy']=function(_0x12e2c3,_0x5c17fc){return db[_0x0f2e('0x2a')][_0x0f2e('0x45')]({'where':{'id':_0x12e2c3['params']['id']}})[_0x0f2e('0x23')](handleEntityNotFound(_0x5c17fc,null))['then'](removeEntity(_0x5c17fc,null))[_0x0f2e('0x42')](handleError(_0x5c17fc,null));};exports[_0x0f2e('0x48')]=function(_0x43128a,_0x4d4132){return db[_0x0f2e('0x2a')][_0x0f2e('0x48')]()[_0x0f2e('0x23')](respondWithResult(_0x4d4132,null))[_0x0f2e('0x42')](handleError(_0x4d4132,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index eff6469..7873ebb 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x184f5f,_0x2034dd){var _0x467cd7=function(_0x5826b7){while(--_0x5826b7){_0x184f5f['push'](_0x184f5f['shift']());}};_0x467cd7(++_0x2034dd);}(_0xe706,0xa3));var _0x6e70=function(_0x348fec,_0x486f87){_0x348fec=_0x348fec-0x0;var _0x5914c7=_0xe706[_0x348fec];return _0x5914c7;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x4a4922,_0x82cb8f){var _0x55a8c6=function(_0x59712e){while(--_0x59712e){_0x4a4922['push'](_0x4a4922['shift']());}};_0x55a8c6(++_0x82cb8f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 54d3dd8..eed0b21 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 _0xdacd=['limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','UpdateChatQueueReport','update','attributes'];(function(_0x4d8710,_0x1b949e){var _0x27cd5f=function(_0x27370c){while(--_0x27370c){_0x4d8710['push'](_0x4d8710['shift']());}};_0x27cd5f(++_0x1b949e);}(_0xdacd,0xab));var _0xddac=function(_0x1b8c23,_0x1c0325){_0x1b8c23=_0x1b8c23-0x0;var _0x4da0e6=_0xdacd[_0x1b8c23];return _0x4da0e6;};'use strict';var _=require('lodash');var util=require(_0xddac('0x0'));var moment=require(_0xddac('0x1'));var BPromise=require(_0xddac('0x2'));var rs=require(_0xddac('0x3'));var fs=require('fs');var Redis=require(_0xddac('0x4'));var db=require(_0xddac('0x5'))['db'];var utils=require(_0xddac('0x6'));var logger=require(_0xddac('0x7'))('rpc');var config=require(_0xddac('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xddac('0x9')][_0xddac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x530754,_0x402b0b,_0x223d98){return new BPromise(function(_0x367730,_0x2ad0f5){return client[_0xddac('0xb')](_0x530754,_0x223d98)[_0xddac('0xc')](function(_0x42476f){logger[_0xddac('0xd')](_0xddac('0xe'),_0x402b0b,_0xddac('0xf'));logger['debug'](_0xddac('0x10'),_0x402b0b,_0xddac('0xf'),JSON[_0xddac('0x11')](_0x42476f));if(_0x42476f[_0xddac('0x12')]){if(_0x42476f[_0xddac('0x12')][_0xddac('0x13')]===0x1f4){logger[_0xddac('0x12')](_0xddac('0xe'),_0x402b0b,_0x42476f[_0xddac('0x12')]['message']);return _0x2ad0f5(_0x42476f[_0xddac('0x12')][_0xddac('0x14')]);}logger['error'](_0xddac('0xe'),_0x402b0b,_0x42476f[_0xddac('0x12')]['message']);return _0x367730(_0x42476f[_0xddac('0x12')][_0xddac('0x14')]);}else{logger[_0xddac('0xd')](_0xddac('0xe'),_0x402b0b,_0xddac('0xf'));_0x367730(_0x42476f[_0xddac('0x15')][_0xddac('0x14')]);}})[_0xddac('0x16')](function(_0x38161b){logger[_0xddac('0x12')](_0xddac('0xe'),_0x402b0b,_0x38161b);_0x2ad0f5(_0x38161b);});});}exports[_0xddac('0x17')]=function(_0x4ec904){var _0x5382f1=this;return new Promise(function(_0x28b2df,_0x52deb3){return db[_0xddac('0x18')][_0xddac('0x19')](_0x4ec904[_0xddac('0x1a')],{'raw':_0x4ec904[_0xddac('0x1b')]?_0x4ec904[_0xddac('0x1b')][_0xddac('0x1c')]===undefined?!![]:![]:!![]})[_0xddac('0xc')](function(_0x402dca){logger[_0xddac('0xd')]('CreateChatQueueReport',_0x4ec904);logger[_0xddac('0x1d')]('CreateChatQueueReport',_0x4ec904,JSON['stringify'](_0x402dca));_0x28b2df(_0x402dca);})['catch'](function(_0x6058c5){logger[_0xddac('0x12')](_0xddac('0x17'),_0x6058c5[_0xddac('0x14')],_0x4ec904);_0x52deb3(_0x5382f1[_0xddac('0x12')](0x1f4,_0x6058c5[_0xddac('0x14')]));});});};exports[_0xddac('0x1e')]=function(_0x1d61d4){var _0x1cc400=this;return new Promise(function(_0x440b95,_0x3b545e){return db[_0xddac('0x18')][_0xddac('0x1f')](_0x1d61d4['body'],{'raw':_0x1d61d4['options']?_0x1d61d4[_0xddac('0x1b')][_0xddac('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d61d4[_0xddac('0x1b')]?_0x1d61d4[_0xddac('0x1b')]['where']||null:null,'attributes':_0x1d61d4[_0xddac('0x1b')]?_0x1d61d4['options'][_0xddac('0x20')]||null:null,'limit':_0x1d61d4[_0xddac('0x1b')]?_0x1d61d4[_0xddac('0x1b')][_0xddac('0x21')]||null:null})[_0xddac('0xc')](function(_0x32c033){logger[_0xddac('0xd')]('UpdateChatQueueReport',_0x1d61d4);logger['debug'](_0xddac('0x1e'),_0x1d61d4,JSON[_0xddac('0x11')](_0x32c033));_0x440b95(_0x32c033);})[_0xddac('0x16')](function(_0x542e9a){logger['error'](_0xddac('0x1e'),_0x542e9a[_0xddac('0x14')],_0x1d61d4);_0x3b545e(_0x1cc400[_0xddac('0x12')](0x1f4,_0x542e9a[_0xddac('0x14')]));});});}; \ No newline at end of file +var _0x04af=['attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','where'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0x04af,0x1f1));var _0xf04a=function(_0x118767,_0x17f04c){_0x118767=_0x118767-0x0;var _0x4c42f0=_0x04af[_0x118767];return _0x4c42f0;};'use strict';var _=require(_0xf04a('0x0'));var util=require(_0xf04a('0x1'));var moment=require(_0xf04a('0x2'));var BPromise=require(_0xf04a('0x3'));var rs=require(_0xf04a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf04a('0x5'))['db'];var utils=require(_0xf04a('0x6'));var logger=require('../../config/logger')(_0xf04a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf04a('0x8')][_0xf04a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad3a1,_0xae2b27,_0x42d1bb){return new BPromise(function(_0x43f4bd,_0x41cbb9){return client[_0xf04a('0xa')](_0x5ad3a1,_0x42d1bb)[_0xf04a('0xb')](function(_0x257bba){logger[_0xf04a('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0xae2b27,'request\x20sent');logger[_0xf04a('0xd')](_0xf04a('0xe'),_0xae2b27,_0xf04a('0xf'),JSON[_0xf04a('0x10')](_0x257bba));if(_0x257bba[_0xf04a('0x11')]){if(_0x257bba[_0xf04a('0x11')][_0xf04a('0x12')]===0x1f4){logger[_0xf04a('0x11')](_0xf04a('0x13'),_0xae2b27,_0x257bba[_0xf04a('0x11')][_0xf04a('0x14')]);return _0x41cbb9(_0x257bba[_0xf04a('0x11')][_0xf04a('0x14')]);}logger[_0xf04a('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0xae2b27,_0x257bba[_0xf04a('0x11')][_0xf04a('0x14')]);return _0x43f4bd(_0x257bba[_0xf04a('0x11')][_0xf04a('0x14')]);}else{logger[_0xf04a('0xc')](_0xf04a('0x13'),_0xae2b27,_0xf04a('0xf'));_0x43f4bd(_0x257bba[_0xf04a('0x15')]['message']);}})[_0xf04a('0x16')](function(_0x5dd856){logger[_0xf04a('0x11')](_0xf04a('0x13'),_0xae2b27,_0x5dd856);_0x41cbb9(_0x5dd856);});});}exports['CreateChatQueueReport']=function(_0x397759){var _0x597a66=this;return new Promise(function(_0x33d9f0,_0x4ec8e7){return db[_0xf04a('0x17')]['create'](_0x397759[_0xf04a('0x18')],{'raw':_0x397759[_0xf04a('0x19')]?_0x397759[_0xf04a('0x19')][_0xf04a('0x1a')]===undefined?!![]:![]:!![]})[_0xf04a('0xb')](function(_0x122d94){logger[_0xf04a('0xc')](_0xf04a('0x1b'),_0x397759);logger[_0xf04a('0xd')](_0xf04a('0x1b'),_0x397759,JSON[_0xf04a('0x10')](_0x122d94));_0x33d9f0(_0x122d94);})[_0xf04a('0x16')](function(_0x8d577b){logger['error']('CreateChatQueueReport',_0x8d577b[_0xf04a('0x14')],_0x397759);_0x4ec8e7(_0x597a66[_0xf04a('0x11')](0x1f4,_0x8d577b[_0xf04a('0x14')]));});});};exports[_0xf04a('0x1c')]=function(_0x2c0743){var _0x39d1b5=this;return new Promise(function(_0xfdf263,_0x608020){return db[_0xf04a('0x17')]['update'](_0x2c0743['body'],{'raw':_0x2c0743[_0xf04a('0x19')]?_0x2c0743[_0xf04a('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c0743[_0xf04a('0x19')]?_0x2c0743['options'][_0xf04a('0x1d')]||null:null,'attributes':_0x2c0743[_0xf04a('0x19')]?_0x2c0743[_0xf04a('0x19')][_0xf04a('0x1e')]||null:null,'limit':_0x2c0743['options']?_0x2c0743[_0xf04a('0x19')]['limit']||null:null})[_0xf04a('0xb')](function(_0x46a647){logger[_0xf04a('0xc')](_0xf04a('0x1c'),_0x2c0743);logger[_0xf04a('0xd')]('UpdateChatQueueReport',_0x2c0743,JSON[_0xf04a('0x10')](_0x46a647));_0xfdf263(_0x46a647);})[_0xf04a('0x16')](function(_0x196a8f){logger[_0xf04a('0x11')](_0xf04a('0x1c'),_0x196a8f[_0xf04a('0x14')],_0x2c0743);_0x608020(_0x39d1b5[_0xf04a('0x11')](0x1f4,_0x196a8f[_0xf04a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 231f102..66a592e 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 _0x85d4=['./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85d4,0xca));var _0x485d=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x85d4[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require('multer');var util=require(_0x485d('0x0'));var path=require(_0x485d('0x1'));var timeout=require(_0x485d('0x2'));var express=require(_0x485d('0x3'));var router=express[_0x485d('0x4')]();var fs_extra=require(_0x485d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x485d('0x6'));var config=require(_0x485d('0x7'));var controller=require(_0x485d('0x8'));router[_0x485d('0x9')]('/',auth[_0x485d('0xa')](),controller[_0x485d('0xb')]);router[_0x485d('0x9')](_0x485d('0xc'),auth[_0x485d('0xa')](),controller[_0x485d('0xd')]);router['get']('/:id',auth[_0x485d('0xa')](),controller[_0x485d('0xe')]);router[_0x485d('0xf')]('/',auth[_0x485d('0xa')](),controller[_0x485d('0x10')]);router[_0x485d('0x11')](_0x485d('0x12'),auth[_0x485d('0xa')](),controller[_0x485d('0x13')]);router['delete'](_0x485d('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x485d('0x14')]=router; \ No newline at end of file +var _0x2e92=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0xcc07ad,_0x117ae8){var _0x4f08d3=function(_0x5039e2){while(--_0x5039e2){_0xcc07ad['push'](_0xcc07ad['shift']());}};_0x4f08d3(++_0x117ae8);}(_0x2e92,0x171));var _0x22e9=function(_0xfe8365,_0x5ed048){_0xfe8365=_0xfe8365-0x0;var _0x23eacb=_0x2e92[_0xfe8365];return _0x23eacb;};'use strict';var multer=require(_0x22e9('0x0'));var util=require(_0x22e9('0x1'));var path=require(_0x22e9('0x2'));var timeout=require(_0x22e9('0x3'));var express=require(_0x22e9('0x4'));var router=express[_0x22e9('0x5')]();var fs_extra=require(_0x22e9('0x6'));var auth=require(_0x22e9('0x7'));var interaction=require(_0x22e9('0x8'));var config=require(_0x22e9('0x9'));var controller=require(_0x22e9('0xa'));router[_0x22e9('0xb')]('/',auth[_0x22e9('0xc')](),controller[_0x22e9('0xd')]);router[_0x22e9('0xb')](_0x22e9('0xe'),auth[_0x22e9('0xc')](),controller[_0x22e9('0xf')]);router[_0x22e9('0xb')](_0x22e9('0x10'),auth['isAuthenticated'](),controller['show']);router[_0x22e9('0x11')]('/',auth[_0x22e9('0xc')](),controller[_0x22e9('0x12')]);router['put'](_0x22e9('0x10'),auth[_0x22e9('0xc')](),controller[_0x22e9('0x13')]);router[_0x22e9('0x14')](_0x22e9('0x10'),auth[_0x22e9('0xc')](),controller[_0x22e9('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 147800f..080b474 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x469409,_0x569b57){var _0x40a959=function(_0x348b2e){while(--_0x348b2e){_0x469409['push'](_0x469409['shift']());}};_0x40a959(++_0x569b57);}(_0xf4eb,0xec));var _0xbf4e=function(_0x37e475,_0x1625ab){_0x37e475=_0x37e475-0x0;var _0x1688f2=_0xf4eb[_0x37e475];return _0x1688f2;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x33c7c6,_0x40d080){var _0x2b28ec=function(_0x372493){while(--_0x372493){_0x33c7c6['push'](_0x33c7c6['shift']());}};_0x2b28ec(++_0x40d080);}(_0xedd9,0xfc));var _0x9edd=function(_0x3a515c,_0x14709a){_0x3a515c=_0x3a515c-0x0;var _0x5be4a5=_0xedd9[_0x3a515c];return _0x5be4a5;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 1b39a46..88cfc64 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 _0xc71c=['stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','findAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xc71c,0x149));var _0xcc71=function(_0x2277cf,_0x420f63){_0x2277cf=_0x2277cf-0x0;var _0x2a0e2f=_0xc71c[_0x2277cf];return _0x2a0e2f;};'use strict';var emlformat=require(_0xcc71('0x0'));var rimraf=require(_0xcc71('0x1'));var zipdir=require(_0xcc71('0x2'));var jsonpatch=require(_0xcc71('0x3'));var rp=require(_0xcc71('0x4'));var moment=require(_0xcc71('0x5'));var BPromise=require(_0xcc71('0x6'));var Mustache=require(_0xcc71('0x7'));var util=require('util');var path=require(_0xcc71('0x8'));var sox=require(_0xcc71('0x9'));var csv=require('to-csv');var ejs=require(_0xcc71('0xa'));var fs=require('fs');var fs_extra=require(_0xcc71('0xb'));var _=require(_0xcc71('0xc'));var squel=require(_0xcc71('0xd'));var crypto=require(_0xcc71('0xe'));var jsforce=require(_0xcc71('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xcc71('0x10'));var querystring=require('querystring');var Papa=require(_0xcc71('0x11'));var Redis=require(_0xcc71('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcc71('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc71('0x14'))(_0xcc71('0x15'));var utils=require(_0xcc71('0x16'));var config=require(_0xcc71('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc71('0x18'))['db'];function respondWithStatusCode(_0x57dbb3,_0x13b56d){_0x13b56d=_0x13b56d||0xcc;return function(_0x4e51ad){if(_0x4e51ad){return _0x57dbb3[_0xcc71('0x19')](_0x13b56d);}return _0x57dbb3[_0xcc71('0x1a')](_0x13b56d)[_0xcc71('0x1b')]();};}function respondWithResult(_0x2a09c6,_0xc3ec5a){_0xc3ec5a=_0xc3ec5a||0xc8;return function(_0x4b2588){if(_0x4b2588){return _0x2a09c6[_0xcc71('0x1a')](_0xc3ec5a)['json'](_0x4b2588);}};}function respondWithFilteredResult(_0x216642,_0x4df5e8){return function(_0x11d25b){if(_0x11d25b){var _0x53b8fb=typeof _0x4df5e8[_0xcc71('0x1c')]===_0xcc71('0x1d')&&typeof _0x4df5e8[_0xcc71('0x1e')]===_0xcc71('0x1d');var _0x40c71f=_0x11d25b[_0xcc71('0x1f')];var _0x43a1b4=_0x53b8fb?0x0:_0x4df5e8[_0xcc71('0x1c')];var _0x2996e5=_0x53b8fb?_0x11d25b[_0xcc71('0x1f')]:_0x4df5e8[_0xcc71('0x1c')]+_0x4df5e8['limit'];var _0x3da3bf;if(_0x2996e5>=_0x40c71f){_0x2996e5=_0x40c71f;_0x3da3bf=0xc8;}else{_0x3da3bf=0xce;}_0x216642[_0xcc71('0x1a')](_0x3da3bf);return _0x216642[_0xcc71('0x20')](_0xcc71('0x21'),_0x43a1b4+'-'+_0x2996e5+'/'+_0x40c71f)[_0xcc71('0x22')](_0x11d25b);}return null;};}function patchUpdates(_0x581819){return function(_0x294e17){try{jsonpatch[_0xcc71('0x23')](_0x294e17,_0x581819,!![]);}catch(_0x1ead7b){return BPromise[_0xcc71('0x24')](_0x1ead7b);}return _0x294e17[_0xcc71('0x25')]();};}function saveUpdates(_0x21ea20,_0x5440b1){return function(_0x41c716){if(_0x41c716){return _0x41c716[_0xcc71('0x26')](_0x21ea20)[_0xcc71('0x27')](function(_0x534608){return _0x534608;});}return null;};}function removeEntity(_0x3f87bd,_0x328351){return function(_0x4fd76b){if(_0x4fd76b){return _0x4fd76b[_0xcc71('0x28')]()[_0xcc71('0x27')](function(){_0x3f87bd[_0xcc71('0x1a')](0xcc)[_0xcc71('0x1b')]();});}};}function handleEntityNotFound(_0x4b2b5a,_0x4bd3fd){return function(_0x316d8a){if(!_0x316d8a){_0x4b2b5a[_0xcc71('0x19')](0x194);}return _0x316d8a;};}function handleError(_0x1dec0b,_0x3fa1ca){_0x3fa1ca=_0x3fa1ca||0x1f4;return function(_0x28323b){logger['error'](_0x28323b[_0xcc71('0x29')]);if(_0x28323b[_0xcc71('0x2a')]){delete _0x28323b[_0xcc71('0x2a')];}_0x1dec0b[_0xcc71('0x1a')](_0x3fa1ca)[_0xcc71('0x2b')](_0x28323b);};}exports[_0xcc71('0x2c')]=function(_0x2ef389,_0x1ae9ab){var _0x56aab0={},_0x53d015={},_0x430cf4={'count':0x0,'rows':[]};var _0x4ab16c=_[_0xcc71('0x2d')](db[_0xcc71('0x2e')][_0xcc71('0x2f')],function(_0x4056f4){return{'name':_0x4056f4[_0xcc71('0x30')],'type':_0x4056f4[_0xcc71('0x31')]['key']};});_0x53d015[_0xcc71('0x32')]=_[_0xcc71('0x2d')](_0x4ab16c,'name');_0x53d015[_0xcc71('0x33')]=_[_0xcc71('0x34')](_0x2ef389[_0xcc71('0x33')]);_0x53d015[_0xcc71('0x35')]=_[_0xcc71('0x36')](_0x53d015[_0xcc71('0x32')],_0x53d015[_0xcc71('0x33')]);_0x56aab0[_0xcc71('0x37')]=_['intersection'](_0x53d015[_0xcc71('0x32')],qs[_0xcc71('0x38')](_0x2ef389[_0xcc71('0x33')][_0xcc71('0x38')]));_0x56aab0[_0xcc71('0x37')]=_0x56aab0['attributes'][_0xcc71('0x39')]?_0x56aab0[_0xcc71('0x37')]:_0x53d015[_0xcc71('0x32')];if(!_0x2ef389[_0xcc71('0x33')][_0xcc71('0x3a')]('nolimit')){_0x56aab0['limit']=qs['limit'](_0x2ef389[_0xcc71('0x33')][_0xcc71('0x1e')]);_0x56aab0['offset']=qs['offset'](_0x2ef389[_0xcc71('0x33')][_0xcc71('0x1c')]);}_0x56aab0['order']=qs['sort'](_0x2ef389[_0xcc71('0x33')][_0xcc71('0x3b')]);_0x56aab0[_0xcc71('0x3c')]=qs[_0xcc71('0x35')](_[_0xcc71('0x3d')](_0x2ef389['query'],_0x53d015[_0xcc71('0x35')]),_0x4ab16c);if(_0x2ef389[_0xcc71('0x33')]['filter']){_0x56aab0[_0xcc71('0x3c')]=_[_0xcc71('0x3e')](_0x56aab0['where'],{'$or':_['map'](_0x4ab16c,function(_0x2742f5){if(_0x2742f5['type']!=='VIRTUAL'){var _0x13c122={};_0x13c122[_0x2742f5[_0xcc71('0x2a')]]={'$like':'%'+_0x2ef389[_0xcc71('0x33')][_0xcc71('0x3f')]+'%'};return _0x13c122;}})});}_0x56aab0=_[_0xcc71('0x3e')]({},_0x56aab0,_0x2ef389[_0xcc71('0x40')]);var _0x3f3d9f={'where':_0x56aab0['where']};return db['ChatTransferReport'][_0xcc71('0x1f')](_0x3f3d9f)[_0xcc71('0x27')](function(_0x58a108){_0x430cf4[_0xcc71('0x1f')]=_0x58a108;if(_0x2ef389[_0xcc71('0x33')]['includeAll']){_0x56aab0['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0xcc71('0x41')](_0x56aab0);})[_0xcc71('0x27')](function(_0x4cd7a8){_0x430cf4[_0xcc71('0x42')]=_0x4cd7a8;return _0x430cf4;})['then'](respondWithFilteredResult(_0x1ae9ab,_0x56aab0))[_0xcc71('0x43')](handleError(_0x1ae9ab,null));};exports[_0xcc71('0x44')]=function(_0x6d763c,_0x2e2b3b){var _0x286f15={'raw':!![],'where':{'id':_0x6d763c[_0xcc71('0x45')]['id']}},_0x38de8e={};_0x38de8e['model']=_['keys'](db[_0xcc71('0x2e')][_0xcc71('0x2f')]);_0x38de8e[_0xcc71('0x33')]=_[_0xcc71('0x34')](_0x6d763c['query']);_0x38de8e['filters']=_['intersection'](_0x38de8e['model'],_0x38de8e[_0xcc71('0x33')]);_0x286f15[_0xcc71('0x37')]=_[_0xcc71('0x36')](_0x38de8e[_0xcc71('0x32')],qs[_0xcc71('0x38')](_0x6d763c['query']['fields']));_0x286f15[_0xcc71('0x37')]=_0x286f15[_0xcc71('0x37')][_0xcc71('0x39')]?_0x286f15[_0xcc71('0x37')]:_0x38de8e['model'];if(_0x6d763c[_0xcc71('0x33')]['includeAll']){_0x286f15[_0xcc71('0x46')]=[{'all':!![]}];}_0x286f15=_[_0xcc71('0x3e')]({},_0x286f15,_0x6d763c[_0xcc71('0x40')]);return db['ChatTransferReport'][_0xcc71('0x47')](_0x286f15)[_0xcc71('0x27')](handleEntityNotFound(_0x2e2b3b,null))[_0xcc71('0x27')](respondWithResult(_0x2e2b3b,null))[_0xcc71('0x43')](handleError(_0x2e2b3b,null));};exports[_0xcc71('0x48')]=function(_0x5143c7,_0x24bf55){return db[_0xcc71('0x2e')][_0xcc71('0x48')](_0x5143c7[_0xcc71('0x49')],{})['then'](respondWithResult(_0x24bf55,0xc9))[_0xcc71('0x43')](handleError(_0x24bf55,null));};exports[_0xcc71('0x26')]=function(_0x186a70,_0x342dbd){if(_0x186a70['body']['id']){delete _0x186a70[_0xcc71('0x49')]['id'];}return db['ChatTransferReport'][_0xcc71('0x47')]({'where':{'id':_0x186a70[_0xcc71('0x45')]['id']}})[_0xcc71('0x27')](handleEntityNotFound(_0x342dbd,null))['then'](saveUpdates(_0x186a70[_0xcc71('0x49')],null))[_0xcc71('0x27')](respondWithResult(_0x342dbd,null))['catch'](handleError(_0x342dbd,null));};exports[_0xcc71('0x28')]=function(_0x52d925,_0x5e8721){return db['ChatTransferReport'][_0xcc71('0x47')]({'where':{'id':_0x52d925[_0xcc71('0x45')]['id']}})[_0xcc71('0x27')](handleEntityNotFound(_0x5e8721,null))[_0xcc71('0x27')](removeEntity(_0x5e8721,null))[_0xcc71('0x43')](handleError(_0x5e8721,null));};exports['describe']=function(_0x73ccda,_0xbfc431){return db[_0xcc71('0x2e')]['describe']()[_0xcc71('0x27')](respondWithResult(_0xbfc431,null))['catch'](handleError(_0xbfc431,null));}; \ No newline at end of file +var _0x78b8=['reject','update','then','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x317bf0,_0x277c03){var _0x225932=function(_0x2c280e){while(--_0x2c280e){_0x317bf0['push'](_0x317bf0['shift']());}};_0x225932(++_0x277c03);}(_0x78b8,0x111));var _0x878b=function(_0x2d6561,_0x102fac){_0x2d6561=_0x2d6561-0x0;var _0x21fe73=_0x78b8[_0x2d6561];return _0x21fe73;};'use strict';var emlformat=require(_0x878b('0x0'));var rimraf=require(_0x878b('0x1'));var zipdir=require(_0x878b('0x2'));var jsonpatch=require(_0x878b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x878b('0x4'));var Mustache=require(_0x878b('0x5'));var util=require(_0x878b('0x6'));var path=require(_0x878b('0x7'));var sox=require('sox');var csv=require(_0x878b('0x8'));var ejs=require(_0x878b('0x9'));var fs=require('fs');var fs_extra=require(_0x878b('0xa'));var _=require('lodash');var squel=require(_0x878b('0xb'));var crypto=require(_0x878b('0xc'));var jsforce=require(_0x878b('0xd'));var deskjs=require(_0x878b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x878b('0xf'));var Papa=require(_0x878b('0x10'));var Redis=require(_0x878b('0x11'));var authService=require(_0x878b('0x12'));var qs=require(_0x878b('0x13'));var as=require(_0x878b('0x14'));var hardwareService=require(_0x878b('0x15'));var logger=require(_0x878b('0x16'))(_0x878b('0x17'));var utils=require(_0x878b('0x18'));var config=require(_0x878b('0x19'));var licenseUtil=require(_0x878b('0x1a'));var db=require(_0x878b('0x1b'))['db'];function respondWithStatusCode(_0x5a75e9,_0x2501a7){_0x2501a7=_0x2501a7||0xcc;return function(_0x1afc79){if(_0x1afc79){return _0x5a75e9[_0x878b('0x1c')](_0x2501a7);}return _0x5a75e9[_0x878b('0x1d')](_0x2501a7)[_0x878b('0x1e')]();};}function respondWithResult(_0x1c1a54,_0x3bdcf0){_0x3bdcf0=_0x3bdcf0||0xc8;return function(_0x1d875c){if(_0x1d875c){return _0x1c1a54[_0x878b('0x1d')](_0x3bdcf0)[_0x878b('0x1f')](_0x1d875c);}};}function respondWithFilteredResult(_0xf9a4da,_0x1c9584){return function(_0x36e260){if(_0x36e260){var _0x356087=typeof _0x1c9584[_0x878b('0x20')]===_0x878b('0x21')&&typeof _0x1c9584[_0x878b('0x22')]===_0x878b('0x21');var _0x2b85f4=_0x36e260[_0x878b('0x23')];var _0x3f05a8=_0x356087?0x0:_0x1c9584[_0x878b('0x20')];var _0x1fe98e=_0x356087?_0x36e260[_0x878b('0x23')]:_0x1c9584[_0x878b('0x20')]+_0x1c9584[_0x878b('0x22')];var _0x1eec3c;if(_0x1fe98e>=_0x2b85f4){_0x1fe98e=_0x2b85f4;_0x1eec3c=0xc8;}else{_0x1eec3c=0xce;}_0xf9a4da[_0x878b('0x1d')](_0x1eec3c);return _0xf9a4da[_0x878b('0x24')](_0x878b('0x25'),_0x3f05a8+'-'+_0x1fe98e+'/'+_0x2b85f4)['json'](_0x36e260);}return null;};}function patchUpdates(_0x2c0b82){return function(_0x1b4d0d){try{jsonpatch[_0x878b('0x26')](_0x1b4d0d,_0x2c0b82,!![]);}catch(_0x1d2c17){return BPromise[_0x878b('0x27')](_0x1d2c17);}return _0x1b4d0d['save']();};}function saveUpdates(_0xef6dd5,_0x50aebb){return function(_0x2f72b3){if(_0x2f72b3){return _0x2f72b3[_0x878b('0x28')](_0xef6dd5)[_0x878b('0x29')](function(_0x34aae2){return _0x34aae2;});}return null;};}function removeEntity(_0x4b317f,_0x1c8f65){return function(_0x2c734b){if(_0x2c734b){return _0x2c734b['destroy']()[_0x878b('0x29')](function(){_0x4b317f[_0x878b('0x1d')](0xcc)[_0x878b('0x1e')]();});}};}function handleEntityNotFound(_0x125a50,_0x54a842){return function(_0x526f59){if(!_0x526f59){_0x125a50[_0x878b('0x1c')](0x194);}return _0x526f59;};}function handleError(_0x243130,_0x377e86){_0x377e86=_0x377e86||0x1f4;return function(_0xccbb67){logger[_0x878b('0x2a')](_0xccbb67[_0x878b('0x2b')]);if(_0xccbb67[_0x878b('0x2c')]){delete _0xccbb67[_0x878b('0x2c')];}_0x243130[_0x878b('0x1d')](_0x377e86)['send'](_0xccbb67);};}exports[_0x878b('0x2d')]=function(_0x103482,_0x58990f){var _0x54138c={},_0x4a8edc={},_0x402d12={'count':0x0,'rows':[]};var _0x84e1f6=_[_0x878b('0x2e')](db[_0x878b('0x2f')][_0x878b('0x30')],function(_0x1f4b45){return{'name':_0x1f4b45[_0x878b('0x31')],'type':_0x1f4b45['type'][_0x878b('0x32')]};});_0x4a8edc[_0x878b('0x33')]=_[_0x878b('0x2e')](_0x84e1f6,'name');_0x4a8edc[_0x878b('0x34')]=_[_0x878b('0x35')](_0x103482['query']);_0x4a8edc[_0x878b('0x36')]=_[_0x878b('0x37')](_0x4a8edc[_0x878b('0x33')],_0x4a8edc[_0x878b('0x34')]);_0x54138c['attributes']=_[_0x878b('0x37')](_0x4a8edc['model'],qs[_0x878b('0x38')](_0x103482[_0x878b('0x34')][_0x878b('0x38')]));_0x54138c[_0x878b('0x39')]=_0x54138c[_0x878b('0x39')][_0x878b('0x3a')]?_0x54138c[_0x878b('0x39')]:_0x4a8edc[_0x878b('0x33')];if(!_0x103482[_0x878b('0x34')][_0x878b('0x3b')]('nolimit')){_0x54138c[_0x878b('0x22')]=qs[_0x878b('0x22')](_0x103482[_0x878b('0x34')]['limit']);_0x54138c[_0x878b('0x20')]=qs['offset'](_0x103482[_0x878b('0x34')]['offset']);}_0x54138c[_0x878b('0x3c')]=qs[_0x878b('0x3d')](_0x103482[_0x878b('0x34')][_0x878b('0x3d')]);_0x54138c[_0x878b('0x3e')]=qs[_0x878b('0x36')](_['pick'](_0x103482['query'],_0x4a8edc[_0x878b('0x36')]),_0x84e1f6);if(_0x103482[_0x878b('0x34')][_0x878b('0x3f')]){_0x54138c['where']=_[_0x878b('0x40')](_0x54138c[_0x878b('0x3e')],{'$or':_[_0x878b('0x2e')](_0x84e1f6,function(_0x156591){if(_0x156591['type']!==_0x878b('0x41')){var _0xe9169b={};_0xe9169b[_0x156591[_0x878b('0x2c')]]={'$like':'%'+_0x103482['query'][_0x878b('0x3f')]+'%'};return _0xe9169b;}})});}_0x54138c=_[_0x878b('0x40')]({},_0x54138c,_0x103482[_0x878b('0x42')]);var _0x57a736={'where':_0x54138c[_0x878b('0x3e')]};return db[_0x878b('0x2f')][_0x878b('0x23')](_0x57a736)[_0x878b('0x29')](function(_0x480ad1){_0x402d12[_0x878b('0x23')]=_0x480ad1;if(_0x103482[_0x878b('0x34')][_0x878b('0x43')]){_0x54138c['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x878b('0x44')](_0x54138c);})['then'](function(_0x54383e){_0x402d12[_0x878b('0x45')]=_0x54383e;return _0x402d12;})[_0x878b('0x29')](respondWithFilteredResult(_0x58990f,_0x54138c))[_0x878b('0x46')](handleError(_0x58990f,null));};exports['show']=function(_0x5b6644,_0x3dffd9){var _0x29c0d2={'raw':!![],'where':{'id':_0x5b6644[_0x878b('0x47')]['id']}},_0xf13b82={};_0xf13b82[_0x878b('0x33')]=_[_0x878b('0x35')](db[_0x878b('0x2f')]['rawAttributes']);_0xf13b82[_0x878b('0x34')]=_['keys'](_0x5b6644[_0x878b('0x34')]);_0xf13b82[_0x878b('0x36')]=_[_0x878b('0x37')](_0xf13b82[_0x878b('0x33')],_0xf13b82[_0x878b('0x34')]);_0x29c0d2[_0x878b('0x39')]=_[_0x878b('0x37')](_0xf13b82[_0x878b('0x33')],qs[_0x878b('0x38')](_0x5b6644[_0x878b('0x34')]['fields']));_0x29c0d2['attributes']=_0x29c0d2[_0x878b('0x39')][_0x878b('0x3a')]?_0x29c0d2[_0x878b('0x39')]:_0xf13b82[_0x878b('0x33')];if(_0x5b6644['query']['includeAll']){_0x29c0d2[_0x878b('0x48')]=[{'all':!![]}];}_0x29c0d2=_['merge']({},_0x29c0d2,_0x5b6644['options']);return db[_0x878b('0x2f')]['find'](_0x29c0d2)[_0x878b('0x29')](handleEntityNotFound(_0x3dffd9,null))['then'](respondWithResult(_0x3dffd9,null))['catch'](handleError(_0x3dffd9,null));};exports[_0x878b('0x49')]=function(_0x31a6b2,_0x56fdff){return db[_0x878b('0x2f')][_0x878b('0x49')](_0x31a6b2[_0x878b('0x4a')],{})[_0x878b('0x29')](respondWithResult(_0x56fdff,0xc9))['catch'](handleError(_0x56fdff,null));};exports[_0x878b('0x28')]=function(_0x20252e,_0x33cb2c){if(_0x20252e[_0x878b('0x4a')]['id']){delete _0x20252e[_0x878b('0x4a')]['id'];}return db['ChatTransferReport'][_0x878b('0x4b')]({'where':{'id':_0x20252e[_0x878b('0x47')]['id']}})[_0x878b('0x29')](handleEntityNotFound(_0x33cb2c,null))[_0x878b('0x29')](saveUpdates(_0x20252e[_0x878b('0x4a')],null))[_0x878b('0x29')](respondWithResult(_0x33cb2c,null))[_0x878b('0x46')](handleError(_0x33cb2c,null));};exports[_0x878b('0x4c')]=function(_0x1339c4,_0x5b7113){return db['ChatTransferReport'][_0x878b('0x4b')]({'where':{'id':_0x1339c4['params']['id']}})[_0x878b('0x29')](handleEntityNotFound(_0x5b7113,null))[_0x878b('0x29')](removeEntity(_0x5b7113,null))['catch'](handleError(_0x5b7113,null));};exports[_0x878b('0x4d')]=function(_0x1c1dc5,_0x59bc3a){return db[_0x878b('0x2f')][_0x878b('0x4d')]()[_0x878b('0x29')](respondWithResult(_0x59bc3a,null))[_0x878b('0x46')](handleError(_0x59bc3a,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 575f51a..ffaff2a 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 _0xcf85=['rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','bluebird','path'];(function(_0x75bdf5,_0x51906f){var _0x8f5989=function(_0x4e9861){while(--_0x4e9861){_0x75bdf5['push'](_0x75bdf5['shift']());}};_0x8f5989(++_0x51906f);}(_0xcf85,0x127));var _0x5cf8=function(_0x8c6164,_0x1dc7db){_0x8c6164=_0x8c6164-0x0;var _0x1ca172=_0xcf85[_0x8c6164];return _0x1ca172;};'use strict';var _=require('lodash');var util=require(_0x5cf8('0x0'));var logger=require(_0x5cf8('0x1'))(_0x5cf8('0x2'));var moment=require('moment');var BPromise=require(_0x5cf8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5cf8('0x4'));var rimraf=require(_0x5cf8('0x5'));var config=require(_0x5cf8('0x6'));var attributes=require(_0x5cf8('0x7'));module['exports']=function(_0x56e76a,_0x123023){return _0x56e76a[_0x5cf8('0x8')](_0x5cf8('0x9'),attributes,{'tableName':_0x5cf8('0xa'),'paranoid':![],'indexes':[{'name':_0x5cf8('0xb'),'fields':[_0x5cf8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc07a=['../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1ad404,_0x4079e5){var _0x52b406=function(_0x426585){while(--_0x426585){_0x1ad404['push'](_0x1ad404['shift']());}};_0x52b406(++_0x4079e5);}(_0xc07a,0x17e));var _0xac07=function(_0x130ffa,_0x17a202){_0x130ffa=_0x130ffa-0x0;var _0x49f073=_0xc07a[_0x130ffa];return _0x49f073;};'use strict';var _=require(_0xac07('0x0'));var util=require(_0xac07('0x1'));var logger=require(_0xac07('0x2'))(_0xac07('0x3'));var moment=require(_0xac07('0x4'));var BPromise=require(_0xac07('0x5'));var rp=require(_0xac07('0x6'));var fs=require('fs');var path=require(_0xac07('0x7'));var rimraf=require('rimraf');var config=require(_0xac07('0x8'));var attributes=require(_0xac07('0x9'));module[_0xac07('0xa')]=function(_0x3bdcfe,_0x2f50b2){return _0x3bdcfe[_0xac07('0xb')](_0xac07('0xc'),attributes,{'tableName':_0xac07('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xac07('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index fa4867c..ef4da46 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 _0x4815=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x4815,0xb5));var _0x5481=function(_0x29de0d,_0x24b4f8){_0x29de0d=_0x29de0d-0x0;var _0x4b7265=_0x4815[_0x29de0d];return _0x4b7265;};'use strict';var _=require(_0x5481('0x0'));var util=require(_0x5481('0x1'));var moment=require(_0x5481('0x2'));var BPromise=require(_0x5481('0x3'));var rs=require(_0x5481('0x4'));var fs=require('fs');var Redis=require(_0x5481('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5481('0x6'));var logger=require(_0x5481('0x7'))(_0x5481('0x8'));var config=require(_0x5481('0x9'));var jayson=require(_0x5481('0xa'));var client=jayson[_0x5481('0xb')][_0x5481('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x283eec,_0x2ae4ab,_0x27c6aa){return new BPromise(function(_0x4c4662,_0x894d8a){return client[_0x5481('0xd')](_0x283eec,_0x27c6aa)[_0x5481('0xe')](function(_0x37a03b){logger['info'](_0x5481('0xf'),_0x2ae4ab,_0x5481('0x10'));logger[_0x5481('0x11')](_0x5481('0x12'),_0x2ae4ab,_0x5481('0x10'),JSON[_0x5481('0x13')](_0x37a03b));if(_0x37a03b[_0x5481('0x14')]){if(_0x37a03b['error']['code']===0x1f4){logger[_0x5481('0x14')](_0x5481('0xf'),_0x2ae4ab,_0x37a03b[_0x5481('0x14')][_0x5481('0x15')]);return _0x894d8a(_0x37a03b[_0x5481('0x14')][_0x5481('0x15')]);}logger[_0x5481('0x14')](_0x5481('0xf'),_0x2ae4ab,_0x37a03b[_0x5481('0x14')][_0x5481('0x15')]);return _0x4c4662(_0x37a03b[_0x5481('0x14')][_0x5481('0x15')]);}else{logger[_0x5481('0x16')]('ChatTransferReport,\x20%s,\x20%s',_0x2ae4ab,_0x5481('0x10'));_0x4c4662(_0x37a03b[_0x5481('0x17')]['message']);}})[_0x5481('0x18')](function(_0x3e3d6a){logger[_0x5481('0x14')](_0x5481('0xf'),_0x2ae4ab,_0x3e3d6a);_0x894d8a(_0x3e3d6a);});});} \ No newline at end of file +var _0x20ad=['client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x25b646,_0x5849ae){var _0x1b5388=function(_0x44d783){while(--_0x44d783){_0x25b646['push'](_0x25b646['shift']());}};_0x1b5388(++_0x5849ae);}(_0x20ad,0xbe));var _0xd20a=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x20ad[_0x20c9b2];return _0x2c6030;};'use strict';var _=require(_0xd20a('0x0'));var util=require('util');var moment=require(_0xd20a('0x1'));var BPromise=require(_0xd20a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd20a('0x3'))['db'];var utils=require(_0xd20a('0x4'));var logger=require(_0xd20a('0x5'))('rpc');var config=require(_0xd20a('0x6'));var jayson=require(_0xd20a('0x7'));var client=jayson[_0xd20a('0x8')][_0xd20a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb9a2a1,_0x3e0ca6,_0x2a3445){return new BPromise(function(_0x2b1a1,_0x80df26){return client[_0xd20a('0xa')](_0xb9a2a1,_0x2a3445)['then'](function(_0x260dc0){logger[_0xd20a('0xb')](_0xd20a('0xc'),_0x3e0ca6,_0xd20a('0xd'));logger[_0xd20a('0xe')](_0xd20a('0xf'),_0x3e0ca6,_0xd20a('0xd'),JSON[_0xd20a('0x10')](_0x260dc0));if(_0x260dc0[_0xd20a('0x11')]){if(_0x260dc0[_0xd20a('0x11')][_0xd20a('0x12')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x3e0ca6,_0x260dc0[_0xd20a('0x11')]['message']);return _0x80df26(_0x260dc0[_0xd20a('0x11')][_0xd20a('0x13')]);}logger[_0xd20a('0x11')](_0xd20a('0xc'),_0x3e0ca6,_0x260dc0[_0xd20a('0x11')][_0xd20a('0x13')]);return _0x2b1a1(_0x260dc0['error'][_0xd20a('0x13')]);}else{logger[_0xd20a('0xb')](_0xd20a('0xc'),_0x3e0ca6,'request\x20sent');_0x2b1a1(_0x260dc0[_0xd20a('0x14')][_0xd20a('0x13')]);}})[_0xd20a('0x15')](function(_0x279ab9){logger[_0xd20a('0x11')](_0xd20a('0xc'),_0x3e0ca6,_0x279ab9);_0x80df26(_0x279ab9);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index ccf6e4d..5f0fd9f 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 _0xe262=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','exports','util'];(function(_0x3181cc,_0x28447f){var _0x547a4a=function(_0x3ede80){while(--_0x3ede80){_0x3181cc['push'](_0x3181cc['shift']());}};_0x547a4a(++_0x28447f);}(_0xe262,0xfb));var _0x2e26=function(_0x5a4f11,_0x46219f){_0x5a4f11=_0x5a4f11-0x0;var _0x32decf=_0xe262[_0x5a4f11];return _0x32decf;};'use strict';var multer=require('multer');var util=require(_0x2e26('0x0'));var path=require('path');var timeout=require(_0x2e26('0x1'));var express=require(_0x2e26('0x2'));var router=express[_0x2e26('0x3')]();var fs_extra=require(_0x2e26('0x4'));var auth=require(_0x2e26('0x5'));var interaction=require(_0x2e26('0x6'));var config=require(_0x2e26('0x7'));var controller=require(_0x2e26('0x8'));router[_0x2e26('0x9')]('/',auth[_0x2e26('0xa')](),controller[_0x2e26('0xb')]);router[_0x2e26('0x9')](_0x2e26('0xc'),auth[_0x2e26('0xa')](),controller[_0x2e26('0xd')]);router['get'](_0x2e26('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x2e26('0xf')]);router[_0x2e26('0x10')](_0x2e26('0xe'),auth[_0x2e26('0xa')](),controller[_0x2e26('0x11')]);router[_0x2e26('0x12')]('/:id',auth[_0x2e26('0xa')](),controller[_0x2e26('0x13')]);module[_0x2e26('0x14')]=router; \ No newline at end of file +var _0xd5da=['isAuthenticated','index','describe','/:id','show','post','create','put','update','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x24db20,_0x1ae4c7){var _0x148422=function(_0x484b26){while(--_0x484b26){_0x24db20['push'](_0x24db20['shift']());}};_0x148422(++_0x1ae4c7);}(_0xd5da,0xb4));var _0xad5d=function(_0x406d36,_0xbde632){_0x406d36=_0x406d36-0x0;var _0x30a15c=_0xd5da[_0x406d36];return _0x30a15c;};'use strict';var multer=require(_0xad5d('0x0'));var util=require('util');var path=require(_0xad5d('0x1'));var timeout=require(_0xad5d('0x2'));var express=require(_0xad5d('0x3'));var router=express[_0xad5d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xad5d('0x5'));var interaction=require(_0xad5d('0x6'));var config=require(_0xad5d('0x7'));var controller=require(_0xad5d('0x8'));router[_0xad5d('0x9')]('/',auth[_0xad5d('0xa')](),controller[_0xad5d('0xb')]);router['get']('/describe',auth[_0xad5d('0xa')](),controller[_0xad5d('0xc')]);router[_0xad5d('0x9')](_0xad5d('0xd'),auth[_0xad5d('0xa')](),controller[_0xad5d('0xe')]);router[_0xad5d('0xf')]('/',auth[_0xad5d('0xa')](),controller[_0xad5d('0x10')]);router[_0xad5d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xad5d('0x12')]);router['delete'](_0xad5d('0xd'),auth[_0xad5d('0xa')](),controller['destroy']);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 65588f7..89130c5 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 _0xee5b=['rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','setDataValue','onlineForm','TEXT','textarea','Comments','getDataValue','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','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','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x4d97dc,_0x3fbd7e){var _0x5dcd11=function(_0x28a0d0){while(--_0x28a0d0){_0x4d97dc['push'](_0x4d97dc['shift']());}};_0x5dcd11(++_0x3fbd7e);}(_0xee5b,0x1f4));var _0xbee5=function(_0x111744,_0x27e2b1){_0x111744=_0x111744-0x0;var _0x9e2a71=_0xee5b[_0x111744];return _0x9e2a71;};'use strict';var Sequelize=require(_0xbee5('0x0'));var rs=require('randomstring');module[_0xbee5('0x1')]={'name':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbee5('0x3')},'description':{'type':Sequelize[_0xbee5('0x2')]},'mapKey':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x5')},'customerAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0xa'),_0xbee5('0xb')),'defaultValue':_0xbee5('0xa')},'header_online':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xc')},'start_chat_button':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xf')},'download_transcript':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x12')},'closingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x13')},'closingMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'skipMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'conditionAgreement':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x15')},'ratingType':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0x16'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'variable':null,'config':{'placeholder':_0xbee5('0x19'),'type':_0xbee5('0x1a'),'required':!![]},'props':{'title':_0xbee5('0x19'),'helpText':''}},{'type':_0xbee5('0x18'),'props':{'title':_0xbee5('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x1af3de){return this[_0xbee5('0x1b')](_0xbee5('0x1c'),JSON[_0xbee5('0x17')](_0x1af3de));}},'offlineForm':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null},{'type':_0xbee5('0x1e'),'config':{'placeholder':_0xbee5('0x1f')},'props':{'title':_0xbee5('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xbee5('0x20')](_0xbee5('0x21'))?JSON[_0xbee5('0x22')](this[_0xbee5('0x20')](_0xbee5('0x21'))):{};},'set':function(_0x26abe3){return this[_0xbee5('0x1b')](_0xbee5('0x21'),JSON[_0xbee5('0x17')](_0x26abe3));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbee5('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbee5('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbee5('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x24')},'waitingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'sendUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showAgentAvatar':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbee5('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbee5('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xbee5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x28')},'verticalAlignment':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x29')},'messagesAlignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x2c')},'systemAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbee5('0x7')],'comment':_0xbee5('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbee5('0x2e'),'set':function(_0x2819e2){if(!_0x2819e2)this[_0xbee5('0x1b')](_0xbee5('0x2f'),null);this[_0xbee5('0x1b')](_0xbee5('0x30'),_0x2819e2);}},'vidaooEscalation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbee5('0x2')]},'vidaooTopic':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xbee5('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbee5('0x1d')]}}; \ No newline at end of file +var _0x55e0=['CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','name','text','input','getDataValue','onlineForm','parse','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x11d85a,_0x4a908e){var _0x5b5638=function(_0x1d8b30){while(--_0x1d8b30){_0x11d85a['push'](_0x11d85a['shift']());}};_0x5b5638(++_0x4a908e);}(_0x55e0,0xdc));var _0x055e=function(_0xe0ba74,_0x5dcbac){_0xe0ba74=_0xe0ba74-0x0;var _0x5efbef=_0x55e0[_0xe0ba74];return _0x5efbef;};'use strict';var Sequelize=require(_0x055e('0x0'));var rs=require(_0x055e('0x1'));module[_0x055e('0x2')]={'name':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x055e('0x3')]},'mapKey':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'mapKeyOffline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'key':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x055e('0x3')]},'animation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x055e('0x9')]('rounded','squared'),'defaultValue':_0x055e('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0xb')},'start_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xc')},'offline_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'header_offline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x055e('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x13')},'noteTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x14')},'placeholderMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x16')},'closingMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'skipMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x17')},'ratingType':{'type':Sequelize[_0x055e('0x9')](_0x055e('0x18'),_0x055e('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON[_0x055e('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x055e('0x1b'),'type':_0x055e('0x1c'),'required':!![]},'props':{'title':_0x055e('0x1b'),'helpText':''}},{'type':_0x055e('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x1f'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')](_0x055e('0x1f'))):{};},'set':function(_0x4c653c){return this['setDataValue'](_0x055e('0x1f'),JSON[_0x055e('0x1a')](_0x4c653c));}},'offlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x055e('0x1d'),'props':{'title':_0x055e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':_0x055e('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x055e('0x21')},'props':{'title':'Comments','helpText':_0x055e('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x23'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')]('offlineForm')):{};},'set':function(_0x99a372){return this[_0x055e('0x24')](_0x055e('0x23'),JSON[_0x055e('0x1a')](_0x99a372));}},'token':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return rs[_0x055e('0x25')]();}},'autoclose':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x055e('0x3')]},'forwardOffline':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x26')},'waitingMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x29')},'sendUnmanaged':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x055e('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x055e('0x3')]},'notificationTemplate':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return _0x055e('0x2a');}},'notificationSound':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2c')},'verticalAlignment':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2e')},'defaultTitle':{'type':Sequelize[_0x055e('0x3')]},'customerAvatar':{'type':Sequelize[_0x055e('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x30')},'systemAvatar':{'type':Sequelize[_0x055e('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x055e('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1012a4){if(!_0x1012a4)this[_0x055e('0x24')](_0x055e('0x32'),null);this['setDataValue'](_0x055e('0x33'),_0x1012a4);}},'vidaooEscalation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x34')},'vidaooNote':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x055e('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x055e('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 0ee548e..55a56f8 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 _0xc716=['json','undefined','count','offset','limit','status','Content-Range','destroy','then','get','ChatWebsites','sendStatus','name','send','index','Pause','map','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','ChatWebsite','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','rawAttributes','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','findOne','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','root','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','ChatApplication','Applications','account','applications','list','List','orderBy','priority','asc','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','format','device','vendor','threadId','ChatInteraction','externalUrl','interaction','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','startRouting','Start','EventManager','notify','files','createdAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','\x22%s\x22\x20<%s>','email','MailAccountId','originalname','subjectOffline','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','remote','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','IntervalId','addApplications','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','html-to-text','http','client','request','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatWebsite,\x20%s,\x20%s','message','info','result','end'];(function(_0x51e59b,_0x4cc772){var _0x2434b5=function(_0x591237){while(--_0x591237){_0x51e59b['push'](_0x51e59b['shift']());}};_0x2434b5(++_0x4cc772);}(_0xc716,0x10e));var _0x6c71=function(_0x46eb1e,_0x25660f){_0x46eb1e=_0x46eb1e-0x0;var _0x34813e=_0xc716[_0x46eb1e];return _0x34813e;};'use strict';var BPromise=require(_0x6c71('0x0'));var Mustache=require('mustache');var util=require(_0x6c71('0x1'));var path=require(_0x6c71('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c71('0x3'));var _=require('lodash');var querystring=require(_0x6c71('0x4'));var Redis=require(_0x6c71('0x5'));var qs=require(_0x6c71('0x6'));var logger=require(_0x6c71('0x7'))(_0x6c71('0x8'));var config=require(_0x6c71('0x9'));var db=require(_0x6c71('0xa'))['db'];config[_0x6c71('0xb')]=_['defaults'](config[_0x6c71('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6c71('0xc'))(new Redis(config[_0x6c71('0xb')]));require(_0x6c71('0xd'))['register'](socket);var htmlToText=require(_0x6c71('0xe'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6c71('0xf')]({'port':0x232c});var client9002=jayson[_0x6c71('0x10')][_0x6c71('0xf')]({'port':0x232a});var client9003=jayson['client'][_0x6c71('0xf')]({'port':0x232b});var client9001=jayson[_0x6c71('0x10')][_0x6c71('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x32da3d,_0x39fb62,_0xa2b681,_0x56bf37){return new BPromise(function(_0x12c429,_0x1126a5){var _0x4b1261=_0x56bf37||client;return _0x4b1261[_0x6c71('0x11')](_0x32da3d,_0xa2b681)['then'](function(_0x5c941f){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x39fb62,'request\x20sent');logger[_0x6c71('0x12')](_0x6c71('0x13'),_0x39fb62,_0x6c71('0x14'),JSON[_0x6c71('0x15')](_0x5c941f));if(_0x5c941f[_0x6c71('0x16')]){if(_0x5c941f['error']['code']===0x1f4){logger[_0x6c71('0x16')](_0x6c71('0x17'),_0x39fb62,_0x5c941f[_0x6c71('0x16')][_0x6c71('0x18')]);return _0x1126a5(_0x5c941f[_0x6c71('0x16')][_0x6c71('0x18')]);}logger[_0x6c71('0x16')](_0x6c71('0x17'),_0x39fb62,_0x5c941f[_0x6c71('0x16')][_0x6c71('0x18')]);return _0x12c429(_0x5c941f[_0x6c71('0x16')][_0x6c71('0x18')]);}else{logger[_0x6c71('0x19')](_0x6c71('0x17'),_0x39fb62,_0x6c71('0x14'));_0x12c429(_0x5c941f[_0x6c71('0x1a')]['message']);}})['catch'](function(_0x50ad9e){logger[_0x6c71('0x16')](_0x6c71('0x17'),_0x39fb62,_0x50ad9e);_0x1126a5(_0x50ad9e);});});}function respondWithStatusCode(_0x2dd344,_0x5962a7){_0x5962a7=_0x5962a7||0xcc;return function(_0x1bfceb){if(_0x1bfceb){return _0x2dd344['sendStatus'](_0x5962a7);}return _0x2dd344['status'](_0x5962a7)[_0x6c71('0x1b')]();};}function respondWithResult(_0x4dbabd,_0x57814a){_0x57814a=_0x57814a||0xc8;return function(_0x4fb53e){if(_0x4fb53e){return _0x4dbabd['status'](_0x57814a)[_0x6c71('0x1c')](_0x4fb53e);}};}function respondWithFilteredResult(_0x116a57,_0x80b880){return function(_0x4f138f){if(_0x4f138f){var _0x2bc1d9=typeof _0x80b880['offset']==='undefined'&&typeof _0x80b880['limit']===_0x6c71('0x1d');var _0x17f3b6=_0x4f138f[_0x6c71('0x1e')];var _0x2d6382=_0x2bc1d9?0x0:_0x80b880[_0x6c71('0x1f')];var _0x26eb1c=_0x2bc1d9?_0x4f138f[_0x6c71('0x1e')]:_0x80b880[_0x6c71('0x1f')]+_0x80b880[_0x6c71('0x20')];var _0x39460b;if(_0x26eb1c>=_0x17f3b6){_0x26eb1c=_0x17f3b6;_0x39460b=0xc8;}else{_0x39460b=0xce;}_0x116a57[_0x6c71('0x21')](_0x39460b);return _0x116a57['set'](_0x6c71('0x22'),_0x2d6382+'-'+_0x26eb1c+'/'+_0x17f3b6)['json'](_0x4f138f);}return null;};}function saveUpdates(_0x3efdab){return function(_0x1711fc){if(_0x1711fc){return _0x1711fc['update'](_0x3efdab)['then'](function(_0x25df86){return _0x25df86;});}return null;};}function removeEntity(_0x43f21c){return function(_0x63f83a){if(_0x63f83a){return _0x63f83a[_0x6c71('0x23')]()[_0x6c71('0x24')](function(){var _0x23f500=_0x63f83a[_0x6c71('0x25')]({'plain':!![]});var _0x45e70c=_0x6c71('0x26');return db['UserProfileResource'][_0x6c71('0x23')]({'where':{'type':_0x45e70c,'resourceId':_0x23f500['id']}})['then'](function(){return _0x63f83a;});})[_0x6c71('0x24')](function(){_0x43f21c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x475c57){return function(_0x343036){if(!_0x343036){_0x475c57[_0x6c71('0x27')](0x194);}return _0x343036;};}function handleError(_0x1856ea,_0x92a9c2){_0x92a9c2=_0x92a9c2||0x1f4;return function(_0x292f19){logger['error'](_0x292f19['stack']);if(_0x292f19[_0x6c71('0x28')]){delete _0x292f19[_0x6c71('0x28')];}_0x1856ea[_0x6c71('0x21')](_0x92a9c2)[_0x6c71('0x29')](_0x292f19);};}exports[_0x6c71('0x2a')]=function(_0x2f92a8,_0x249341){var _0x569911={'include':[{'model':db[_0x6c71('0x2b')],'as':'mandatoryDispositionPause'}]},_0x4aca38={},_0x3188b9={'count':0x0,'rows':[]};var _0xf8bec3=_[_0x6c71('0x2c')](db['ChatWebsite']['rawAttributes'],function(_0xe2b622){return{'name':_0xe2b622['fieldName'],'type':_0xe2b622['type']['key']};});_0x4aca38[_0x6c71('0x2d')]=_['map'](_0xf8bec3,_0x6c71('0x28'));_0x4aca38[_0x6c71('0x2e')]=_[_0x6c71('0x2f')](_0x2f92a8[_0x6c71('0x2e')]);_0x4aca38['filters']=_[_0x6c71('0x30')](_0x4aca38[_0x6c71('0x2d')],_0x4aca38['query']);_0x569911[_0x6c71('0x31')]=_['intersection'](_0x4aca38[_0x6c71('0x2d')],qs['fields'](_0x2f92a8[_0x6c71('0x2e')][_0x6c71('0x32')]));_0x569911[_0x6c71('0x31')]=_0x569911[_0x6c71('0x31')][_0x6c71('0x33')]?_0x569911[_0x6c71('0x31')]:_0x4aca38[_0x6c71('0x2d')];if(!_0x2f92a8[_0x6c71('0x2e')][_0x6c71('0x34')](_0x6c71('0x35'))){_0x569911['limit']=qs[_0x6c71('0x20')](_0x2f92a8[_0x6c71('0x2e')]['limit']);_0x569911[_0x6c71('0x1f')]=qs[_0x6c71('0x1f')](_0x2f92a8[_0x6c71('0x2e')][_0x6c71('0x1f')]);}_0x569911[_0x6c71('0x36')]=qs[_0x6c71('0x37')](_0x2f92a8['query'][_0x6c71('0x37')]);_0x569911[_0x6c71('0x38')]=qs['filters'](_[_0x6c71('0x39')](_0x2f92a8['query'],_0x4aca38[_0x6c71('0x3a')]),_0xf8bec3);if(_0x2f92a8[_0x6c71('0x2e')][_0x6c71('0x3b')]){_0x569911[_0x6c71('0x38')]=_['merge'](_0x569911[_0x6c71('0x38')],{'$or':_[_0x6c71('0x2c')](_0xf8bec3,function(_0x352560){if(_0x352560[_0x6c71('0x3c')]!==_0x6c71('0x3d')){var _0x2e5e2c={};_0x2e5e2c[_0x352560[_0x6c71('0x28')]]={'$like':'%'+_0x2f92a8[_0x6c71('0x2e')][_0x6c71('0x3b')]+'%'};return _0x2e5e2c;}})});}_0x569911=_['merge']({},_0x569911,_0x2f92a8['options']);var _0x46230b={'where':_0x569911[_0x6c71('0x38')]};return db[_0x6c71('0x3e')][_0x6c71('0x1e')](_0x46230b)['then'](function(_0x4ca538){_0x3188b9[_0x6c71('0x1e')]=_0x4ca538;if(_0x2f92a8[_0x6c71('0x2e')][_0x6c71('0x3f')]){_0x569911[_0x6c71('0x40')]=[{'all':!![]}];}return db[_0x6c71('0x3e')][_0x6c71('0x41')](_0x569911);})['then'](function(_0x4a0ffb){_0x3188b9[_0x6c71('0x42')]=_0x4a0ffb;return _0x3188b9;})[_0x6c71('0x24')](respondWithFilteredResult(_0x249341,_0x569911))[_0x6c71('0x43')](handleError(_0x249341,null));};exports[_0x6c71('0x44')]=function(_0x22052e,_0x18738e){var _0x2dea57={'raw':![],'where':{'id':_0x22052e[_0x6c71('0x45')]['id']},'include':[{'model':db[_0x6c71('0x2b')],'as':_0x6c71('0x46')}]},_0x51277e={};_0x51277e[_0x6c71('0x2d')]=_[_0x6c71('0x2f')](db[_0x6c71('0x3e')][_0x6c71('0x47')]);_0x51277e[_0x6c71('0x2e')]=_[_0x6c71('0x2f')](_0x22052e[_0x6c71('0x2e')]);_0x51277e[_0x6c71('0x3a')]=_[_0x6c71('0x30')](_0x51277e[_0x6c71('0x2d')],_0x51277e['query']);_0x2dea57['attributes']=_[_0x6c71('0x30')](_0x51277e[_0x6c71('0x2d')],qs[_0x6c71('0x32')](_0x22052e['query'][_0x6c71('0x32')]));_0x2dea57[_0x6c71('0x31')]=_0x2dea57[_0x6c71('0x31')][_0x6c71('0x33')]?_0x2dea57[_0x6c71('0x31')]:_0x51277e[_0x6c71('0x2d')];if(_0x22052e[_0x6c71('0x2e')][_0x6c71('0x3f')]){_0x2dea57[_0x6c71('0x40')]=[{'all':!![]}];}_0x2dea57=_[_0x6c71('0x48')]({},_0x2dea57,_0x22052e[_0x6c71('0x49')]);return db[_0x6c71('0x3e')][_0x6c71('0x4a')](_0x2dea57)[_0x6c71('0x24')](handleEntityNotFound(_0x18738e,null))['then'](respondWithResult(_0x18738e,null))[_0x6c71('0x43')](handleError(_0x18738e,null));};exports[_0x6c71('0x4b')]=function(_0x6e73c4,_0x4a26a7){return db[_0x6c71('0x3e')]['create'](_0x6e73c4[_0x6c71('0x4c')],{})[_0x6c71('0x24')](function(_0x4b4e2b){var _0x1230ba=_0x6e73c4[_0x6c71('0x4d')][_0x6c71('0x25')]({'plain':!![]});if(!_0x1230ba)throw new Error(_0x6c71('0x4e'));if(_0x1230ba[_0x6c71('0x4f')]===_0x6c71('0x4d')){var _0x5d71a0=_0x4b4e2b['get']({'plain':!![]});var _0x435ae3=_0x6c71('0x26');return db['UserProfileSection'][_0x6c71('0x4a')]({'where':{'name':_0x435ae3,'userProfileId':_0x1230ba['userProfileId']},'raw':!![]})[_0x6c71('0x24')](function(_0x136882){if(_0x136882&&_0x136882['autoAssociation']===0x0){return db[_0x6c71('0x50')][_0x6c71('0x4b')]({'name':_0x5d71a0[_0x6c71('0x28')],'resourceId':_0x5d71a0['id'],'type':_0x136882[_0x6c71('0x28')],'sectionId':_0x136882['id']},{})[_0x6c71('0x24')](function(){return _0x4b4e2b;});}else{return _0x4b4e2b;}})[_0x6c71('0x43')](function(_0x2dc3de){logger[_0x6c71('0x16')](_0x6c71('0x51'),_0x2dc3de);throw _0x2dc3de;});}return _0x4b4e2b;})[_0x6c71('0x24')](respondWithResult(_0x4a26a7,0xc9))[_0x6c71('0x43')](handleError(_0x4a26a7,null));};exports[_0x6c71('0x52')]=function(_0x5870a8,_0x1e91df){if(_0x5870a8[_0x6c71('0x4c')]['id']){delete _0x5870a8[_0x6c71('0x4c')]['id'];}return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0x5870a8[_0x6c71('0x45')]['id']},'include':[{'model':db[_0x6c71('0x2b')],'as':'mandatoryDispositionPause'}]})[_0x6c71('0x24')](handleEntityNotFound(_0x1e91df,null))[_0x6c71('0x24')](saveUpdates(_0x5870a8[_0x6c71('0x4c')],null))[_0x6c71('0x24')](respondWithResult(_0x1e91df,null))[_0x6c71('0x43')](handleError(_0x1e91df,null));};exports['destroy']=function(_0x583aa0,_0x36d607){return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0x583aa0[_0x6c71('0x45')]['id']}})['then'](handleEntityNotFound(_0x36d607,null))['then'](removeEntity(_0x36d607,null))[_0x6c71('0x43')](handleError(_0x36d607,null));};exports[_0x6c71('0x53')]=function(_0x528364,_0xa35649){return db[_0x6c71('0x3e')]['describe']()[_0x6c71('0x24')](respondWithResult(_0xa35649,null))[_0x6c71('0x43')](handleError(_0xa35649,null));};exports[_0x6c71('0x54')]=function(_0x33c9aa,_0x390e3c){if(_0x33c9aa['body']['id']){delete _0x33c9aa[_0x6c71('0x4c')]['id'];}return db[_0x6c71('0x3e')]['find']({'where':{'id':_0x33c9aa[_0x6c71('0x45')]['id']}})['then'](handleEntityNotFound(_0x390e3c,null))[_0x6c71('0x24')](function(_0x50c19a){if(_0x50c19a){_0x33c9aa[_0x6c71('0x4c')]['ChatWebsiteId']=_0x50c19a['id'];return db[_0x6c71('0x55')]['create'](_0x33c9aa[_0x6c71('0x4c')]);}})[_0x6c71('0x24')](respondWithResult(_0x390e3c,null))[_0x6c71('0x43')](handleError(_0x390e3c,null));};exports['getDispositions']=function(_0x22c7e0,_0x26a06a){var _0x3d009a={'raw':![],'where':{}};var _0x52f8d1={};var _0x18db4a={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6c71('0x56')]({'where':{'id':_0x22c7e0['params']['id']}})['then'](handleEntityNotFound(_0x26a06a,null))[_0x6c71('0x24')](function(_0x134e80){if(_0x134e80){_0x52f8d1[_0x6c71('0x2d')]=_[_0x6c71('0x2f')](db[_0x6c71('0x55')][_0x6c71('0x47')]);_0x52f8d1[_0x6c71('0x2e')]=_[_0x6c71('0x2f')](_0x22c7e0['query']);_0x52f8d1[_0x6c71('0x3a')]=_[_0x6c71('0x30')](_0x52f8d1[_0x6c71('0x2d')],_0x52f8d1[_0x6c71('0x2e')]);_0x3d009a[_0x6c71('0x31')]=_[_0x6c71('0x30')](_0x52f8d1['model'],qs[_0x6c71('0x32')](_0x22c7e0[_0x6c71('0x2e')][_0x6c71('0x32')]));_0x3d009a[_0x6c71('0x31')]=_0x3d009a[_0x6c71('0x31')][_0x6c71('0x33')]?_0x3d009a[_0x6c71('0x31')]:_0x52f8d1[_0x6c71('0x2d')];if(!_0x22c7e0[_0x6c71('0x2e')]['hasOwnProperty']('nolimit')){_0x3d009a[_0x6c71('0x20')]=qs['limit'](_0x22c7e0[_0x6c71('0x2e')][_0x6c71('0x20')]);_0x3d009a[_0x6c71('0x1f')]=qs[_0x6c71('0x1f')](_0x22c7e0['query'][_0x6c71('0x1f')]);}_0x3d009a[_0x6c71('0x36')]=qs[_0x6c71('0x37')](_0x22c7e0['query'][_0x6c71('0x37')]);_0x3d009a['where']=qs['filters'](_[_0x6c71('0x39')](_0x22c7e0[_0x6c71('0x2e')],_0x52f8d1[_0x6c71('0x3a')]));_0x3d009a[_0x6c71('0x38')][_0x6c71('0x57')]=_0x134e80['id'];if(_0x22c7e0[_0x6c71('0x2e')][_0x6c71('0x3b')]){_0x3d009a[_0x6c71('0x38')]=_[_0x6c71('0x48')](_0x3d009a[_0x6c71('0x38')],{'$or':_['map'](_0x3d009a['attributes'],function(_0x175d1d){var _0x383357={};_0x383357[_0x175d1d]={'$like':'%'+_0x22c7e0[_0x6c71('0x2e')][_0x6c71('0x3b')]+'%'};return _0x383357;})});}_0x3d009a=_[_0x6c71('0x48')]({},_0x3d009a,_0x22c7e0[_0x6c71('0x49')]);return db[_0x6c71('0x55')]['count']({'where':_0x3d009a['where']})[_0x6c71('0x24')](function(_0x3d2dc){_0x18db4a[_0x6c71('0x1e')]=_0x3d2dc;if(_0x22c7e0['query'][_0x6c71('0x3f')]){_0x3d009a['include']=[{'all':!![]}];}return db[_0x6c71('0x55')][_0x6c71('0x41')](_0x3d009a);})[_0x6c71('0x24')](function(_0x4f452a){_0x18db4a[_0x6c71('0x42')]=_0x4f452a;return _0x18db4a;});}})[_0x6c71('0x24')](respondWithFilteredResult(_0x26a06a,_0x3d009a))[_0x6c71('0x43')](handleError(_0x26a06a,null));};exports[_0x6c71('0x58')]=function(_0x3d4b3e,_0x5baa84){return db['ChatWebsite'][_0x6c71('0x4a')]({'where':{'id':_0x3d4b3e[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x5baa84,null))['then'](function(_0x486356){if(_0x486356){return _0x486356[_0x6c71('0x58')](_0x3d4b3e['query'][_0x6c71('0x59')]);}})[_0x6c71('0x24')](respondWithStatusCode(_0x5baa84,null))[_0x6c71('0x43')](handleError(_0x5baa84,null));};exports[_0x6c71('0x5a')]=function(_0x38fb69,_0xada1cb){if(_0x38fb69[_0x6c71('0x4c')]['id']){delete _0x38fb69[_0x6c71('0x4c')]['id'];}return db['ChatWebsite'][_0x6c71('0x4a')]({'where':{'id':_0x38fb69['params']['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0xada1cb,null))[_0x6c71('0x24')](function(_0x448d23){if(_0x448d23){_0x38fb69[_0x6c71('0x4c')][_0x6c71('0x57')]=_0x448d23['id'];return db[_0x6c71('0x5b')][_0x6c71('0x4b')](_0x38fb69[_0x6c71('0x4c')]);}})[_0x6c71('0x24')](respondWithResult(_0xada1cb,null))[_0x6c71('0x43')](handleError(_0xada1cb,null));};exports[_0x6c71('0x5c')]=function(_0x3199a3,_0x4ad849){var _0x33d090={'raw':![],'where':{}};var _0x391c82={};var _0x4198eb={'count':0x0,'rows':[]};return db[_0x6c71('0x3e')]['findOne']({'where':{'id':_0x3199a3['params']['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x4ad849,null))[_0x6c71('0x24')](function(_0x3de2fb){if(_0x3de2fb){_0x391c82[_0x6c71('0x2d')]=_[_0x6c71('0x2f')](db[_0x6c71('0x5b')][_0x6c71('0x47')]);_0x391c82[_0x6c71('0x2e')]=_[_0x6c71('0x2f')](_0x3199a3[_0x6c71('0x2e')]);_0x391c82[_0x6c71('0x3a')]=_[_0x6c71('0x30')](_0x391c82[_0x6c71('0x2d')],_0x391c82[_0x6c71('0x2e')]);_0x33d090[_0x6c71('0x31')]=_['intersection'](_0x391c82['model'],qs[_0x6c71('0x32')](_0x3199a3[_0x6c71('0x2e')][_0x6c71('0x32')]));_0x33d090['attributes']=_0x33d090[_0x6c71('0x31')][_0x6c71('0x33')]?_0x33d090[_0x6c71('0x31')]:_0x391c82['model'];if(!_0x3199a3[_0x6c71('0x2e')]['hasOwnProperty'](_0x6c71('0x35'))){_0x33d090['limit']=qs[_0x6c71('0x20')](_0x3199a3[_0x6c71('0x2e')][_0x6c71('0x20')]);_0x33d090[_0x6c71('0x1f')]=qs[_0x6c71('0x1f')](_0x3199a3[_0x6c71('0x2e')][_0x6c71('0x1f')]);}_0x33d090['order']=qs[_0x6c71('0x37')](_0x3199a3['query'][_0x6c71('0x37')]);_0x33d090[_0x6c71('0x38')]=qs[_0x6c71('0x3a')](_[_0x6c71('0x39')](_0x3199a3[_0x6c71('0x2e')],_0x391c82['filters']));_0x33d090[_0x6c71('0x38')][_0x6c71('0x57')]=_0x3de2fb['id'];if(_0x3199a3[_0x6c71('0x2e')]['filter']){_0x33d090['where']=_[_0x6c71('0x48')](_0x33d090[_0x6c71('0x38')],{'$or':_[_0x6c71('0x2c')](_0x33d090[_0x6c71('0x31')],function(_0x10469f){var _0x223df8={};_0x223df8[_0x10469f]={'$like':'%'+_0x3199a3['query'][_0x6c71('0x3b')]+'%'};return _0x223df8;})});}_0x33d090=_[_0x6c71('0x48')]({},_0x33d090,_0x3199a3[_0x6c71('0x49')]);return db['CannedAnswer']['count']({'where':_0x33d090[_0x6c71('0x38')]})[_0x6c71('0x24')](function(_0x1a69c6){_0x4198eb[_0x6c71('0x1e')]=_0x1a69c6;if(_0x3199a3['query'][_0x6c71('0x3f')]){_0x33d090[_0x6c71('0x40')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x33d090);})['then'](function(_0x1c64e5){_0x4198eb[_0x6c71('0x42')]=_0x1c64e5;return _0x4198eb;});}})[_0x6c71('0x24')](respondWithFilteredResult(_0x4ad849,_0x33d090))[_0x6c71('0x43')](handleError(_0x4ad849,null));};exports[_0x6c71('0x5d')]=function(_0x4a905f,_0x54ff32){return db['ChatWebsite'][_0x6c71('0x4a')]({'where':{'id':_0x4a905f[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x54ff32,null))['then'](function(_0x4b82ba){if(_0x4b82ba){return _0x4b82ba[_0x6c71('0x5d')](_0x4a905f[_0x6c71('0x2e')][_0x6c71('0x59')]);}})[_0x6c71('0x24')](respondWithStatusCode(_0x54ff32,null))[_0x6c71('0x43')](handleError(_0x54ff32,null));};exports[_0x6c71('0x5e')]=function(_0xb83b0,_0x3816c5){_0xb83b0[_0x6c71('0x4c')][_0x6c71('0x5f')]=_0xb83b0['file']['filename'];return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0xb83b0[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x3816c5,null))[_0x6c71('0x24')](saveUpdates(_0xb83b0[_0x6c71('0x4c')],null))[_0x6c71('0x24')](respondWithResult(_0x3816c5,null))[_0x6c71('0x43')](handleError(_0x3816c5,null));};exports[_0x6c71('0x60')]=function(_0x1a1f4e,_0x3149ae){_0x1a1f4e[_0x6c71('0x4c')][_0x6c71('0x61')]=_0x1a1f4e[_0x6c71('0x62')][_0x6c71('0x63')];return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0x1a1f4e[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x3149ae,null))[_0x6c71('0x24')](saveUpdates(_0x1a1f4e['body'],null))[_0x6c71('0x24')](respondWithResult(_0x3149ae,null))[_0x6c71('0x43')](handleError(_0x3149ae,null));};exports[_0x6c71('0x64')]=function(_0x247e7e,_0x556f7b){_0x247e7e[_0x6c71('0x4c')][_0x6c71('0x65')]=_0x247e7e[_0x6c71('0x62')][_0x6c71('0x63')];return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0x247e7e[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x556f7b,null))[_0x6c71('0x24')](saveUpdates(_0x247e7e['body'],null))[_0x6c71('0x24')](respondWithResult(_0x556f7b,null))[_0x6c71('0x43')](handleError(_0x556f7b,null));};exports[_0x6c71('0x66')]=function(_0x5ee2a5,_0x3b22ab){_0x5ee2a5[_0x6c71('0x4c')]['systemAvatar']=_0x5ee2a5[_0x6c71('0x62')][_0x6c71('0x63')];return db[_0x6c71('0x3e')]['find']({'where':{'id':_0x5ee2a5[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x3b22ab,null))[_0x6c71('0x24')](saveUpdates(_0x5ee2a5[_0x6c71('0x4c')],null))['then'](respondWithResult(_0x3b22ab,null))[_0x6c71('0x43')](handleError(_0x3b22ab,null));};exports[_0x6c71('0x67')]=function(_0x105410,_0x2f6684){var _0x29b104=path['join'](config[_0x6c71('0x68')],'server/files/images/logos/default_logo.svg');var _0x33040d={'where':{'id':_0x105410[_0x6c71('0x45')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4edb4c=![];return require(_0x6c71('0x69'))[_0x6c71('0x6a')]()[_0x6c71('0x24')](function(_0x43db03){if(_0x43db03){_0x4edb4c=_0x43db03[_0x6c71('0x6b')];}})[_0x6c71('0x24')](function(){return db['ChatWebsite'][_0x6c71('0x4a')](_0x33040d);})[_0x6c71('0x24')](handleEntityNotFound(_0x2f6684,null))[_0x6c71('0x24')](function(_0x4b744a){if(_0x4b744a){if(!_[_0x6c71('0x6c')](_0x4b744a[_0x6c71('0x5f')])){if(fs[_0x6c71('0x6d')](path[_0x6c71('0x6e')](config[_0x6c71('0x68')],_0x6c71('0x6f'),_0x4b744a[_0x6c71('0x5f')]))&&_0x4edb4c){_0x29b104=path['join'](config[_0x6c71('0x68')],'server/files/images/logos/',_0x4b744a[_0x6c71('0x5f')]);}}return _0x2f6684[_0x6c71('0x70')](_0x29b104);}})[_0x6c71('0x43')](handleError(_0x2f6684,null));};exports[_0x6c71('0x71')]=function(_0x2c7b09,_0xa14272){var _0x580949=path[_0x6c71('0x6e')](config[_0x6c71('0x68')],_0x6c71('0x72'));var _0x198b51={'where':{'id':_0x2c7b09[_0x6c71('0x45')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x6c71('0x3e')][_0x6c71('0x4a')](_0x198b51)[_0x6c71('0x24')](handleEntityNotFound(_0xa14272,null))[_0x6c71('0x24')](function(_0x215f8f){if(_0x215f8f){if(!_[_0x6c71('0x6c')](_0x215f8f[_0x6c71('0x61')])){if(fs[_0x6c71('0x6d')](path[_0x6c71('0x6e')](config[_0x6c71('0x68')],_0x6c71('0x73'),_0x215f8f[_0x6c71('0x61')]))){_0x580949=path[_0x6c71('0x6e')](config['root'],'server/files/images/avatars/',_0x215f8f['agentAvatar']);}}return _0xa14272['download'](_0x580949);}})[_0x6c71('0x43')](handleError(_0xa14272,null));};exports[_0x6c71('0x74')]=function(_0x39e641,_0x4ae86b){var _0x370570=path[_0x6c71('0x6e')](config['root'],_0x6c71('0x75'));var _0x11ceb5={'where':{'id':_0x39e641['params']['id']},'attributes':['id',_0x6c71('0x65'),_0x6c71('0x76')],'raw':!![]};return db[_0x6c71('0x3e')][_0x6c71('0x4a')](_0x11ceb5)['then'](handleEntityNotFound(_0x4ae86b,null))[_0x6c71('0x24')](function(_0x9c4772){if(_0x9c4772){if(!_[_0x6c71('0x6c')](_0x9c4772[_0x6c71('0x65')])){if(fs['existsSync'](path[_0x6c71('0x6e')](config[_0x6c71('0x68')],_0x6c71('0x73'),_0x9c4772[_0x6c71('0x65')]))&&_0x9c4772[_0x6c71('0x76')]){_0x370570=path['join'](config['root'],_0x6c71('0x73'),_0x9c4772['customerAvatar']);}}return _0x4ae86b[_0x6c71('0x70')](_0x370570);}})[_0x6c71('0x43')](handleError(_0x4ae86b,null));};exports[_0x6c71('0x77')]=function(_0x47c027,_0x28361d){var _0x59a76b=path[_0x6c71('0x6e')](config['root'],_0x6c71('0x78'));var _0x561477={'where':{'id':_0x47c027[_0x6c71('0x45')]['id']},'attributes':['id',_0x6c71('0x79')],'raw':!![]};return db[_0x6c71('0x3e')]['find'](_0x561477)[_0x6c71('0x24')](handleEntityNotFound(_0x28361d,null))[_0x6c71('0x24')](function(_0x1d2638){if(_0x1d2638){if(!_[_0x6c71('0x6c')](_0x1d2638[_0x6c71('0x79')])){if(fs[_0x6c71('0x6d')](path['join'](config[_0x6c71('0x68')],_0x6c71('0x73'),_0x1d2638[_0x6c71('0x79')]))){_0x59a76b=path[_0x6c71('0x6e')](config['root'],_0x6c71('0x73'),_0x1d2638[_0x6c71('0x79')]);}}return _0x28361d[_0x6c71('0x70')](_0x59a76b);}})['catch'](handleError(_0x28361d,null));};exports['notify']=function(_0x4f5055,_0x26966e){var _0x31ada5=require(_0x6c71('0x7a'));var _0x3585d3=new _0x31ada5();var _0x343a2c=_0x3585d3[_0x6c71('0x7b')](_0x4f5055[_0x6c71('0x7c')][_0x6c71('0x7d')])[_0x6c71('0x7e')]();var _0x33925c={'body':_0x4f5055[_0x6c71('0x4c')],'channel':'chat'};var _0x49206b=[];var _0xdb99c0=[];var _0x456523={};var _0x16a2c8=![];return db[_0x6c71('0x7f')][_0x6c71('0x53')]()[_0x6c71('0x24')](function(_0x11a799){if(!_0x11a799){throw new db[(_0x6c71('0x80'))][(_0x6c71('0x81'))](_0x6c71('0x82'));}_0x49206b=_['difference'](_['keys'](_0x11a799),['createdAt',_0x6c71('0x83')]);_0xdb99c0=_[_0x6c71('0x84')](_[_0x6c71('0x2f')](_0x11a799),['createdAt','updatedAt',_0x6c71('0x85'),_0x6c71('0x86')]);if(_0x4f5055[_0x6c71('0x4c')]['id']){delete _0x4f5055['body']['id'];}if(_[_0x6c71('0x6c')](_0x4f5055['body'][_0x6c71('0x87')])){throw new db[(_0x6c71('0x80'))][(_0x6c71('0x81'))](_0x6c71('0x88'));}if(_[_0x6c71('0x6c')](_0x4f5055[_0x6c71('0x4c')][_0x6c71('0x4c')])||_0x4f5055[_0x6c71('0x4c')][_0x6c71('0x4c')]===''){throw new db[(_0x6c71('0x80'))][(_0x6c71('0x81'))](_0x6c71('0x89'));}if(_[_0x6c71('0x6c')](_0x4f5055[_0x6c71('0x4c')][_0x6c71('0x8a')])){throw new db[(_0x6c71('0x80'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xdb99c0);}if(!_[_0x6c71('0x8b')](_0xdb99c0,_0x4f5055[_0x6c71('0x4c')]['mapKey'])){throw new db[(_0x6c71('0x80'))]['ValidationError'](_0x6c71('0x8c')+_0xdb99c0);}_0x456523[_0x4f5055['body'][_0x6c71('0x8a')]]=_0x4f5055[_0x6c71('0x4c')][_0x6c71('0x87')];})['then'](function(){return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0x4f5055[_0x6c71('0x45')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x6c71('0x7f')],'as':_0x6c71('0x8d'),'where':_0x456523,'limit':0x1,'order':[[_0x6c71('0x83'),_0x6c71('0x8e')]]}]},{'model':db[_0x6c71('0x8f')],'as':_0x6c71('0x90')}]});})[_0x6c71('0x24')](handleEntityNotFound(_0x26966e,null))['then'](function(_0x33f365){if(_0x33f365&&_0x33f365['List']){_0x33925c[_0x6c71('0x91')]=_0x33f365;_0x33925c[_0x6c71('0x92')]=_0x33f365[_0x6c71('0x90')];_0x33925c[_0x6c71('0x93')]=_0x33f365[_0x6c71('0x94')];_0x33925c[_0x6c71('0x92')]=_[_0x6c71('0x95')](_0x33925c[_0x6c71('0x92')],[_0x6c71('0x96')],[_0x6c71('0x97')]);if(_0x33925c['account'][_0x6c71('0x90')]){delete _0x33925c['account']['Applications'];}if(_0x33925c[_0x6c71('0x91')][_0x6c71('0x94')]&&_0x33925c[_0x6c71('0x91')]['List']['Contacts'][_0x6c71('0x33')]){return _0x33925c['account'][_0x6c71('0x94')][_0x6c71('0x8d')][0x0];}var _0x266dd6=_[_0x6c71('0x98')](_0x4f5055['body'],{'firstName':_0x4f5055[_0x6c71('0x4c')]['from'],'ListId':_0x33f365['ListId']});_0x266dd6[_0x4f5055[_0x6c71('0x4c')][_0x6c71('0x8a')]]=_0x4f5055[_0x6c71('0x4c')]['from'];return db['CmContact'][_0x6c71('0x4b')](_0x266dd6,{'fields':_0x49206b,'raw':!![]});}})['then'](handleEntityNotFound(_0x26966e,null))[_0x6c71('0x24')](function(_0x418437){_0x33925c[_0x6c71('0x99')]=_0x418437;var _0x1ef21b=_0x4f5055[_0x6c71('0x4c')][_0x6c71('0x9a')];if(_0x4f5055[_0x6c71('0x7c')][_0x6c71('0x9b')]){_0x1ef21b=_0x4f5055[_0x6c71('0x7c')][_0x6c71('0x9b')];}else if(_0x4f5055['headers'][_0x6c71('0x9c')]){_0x1ef21b=_['first'](_0x4f5055[_0x6c71('0x7c')][_0x6c71('0x9c')][_0x6c71('0x9d')](','));}if(_0x418437){var _0xe5a079={'ContactId':_0x418437['id'],'ChatWebsiteId':_0x4f5055[_0x6c71('0x45')]['id'],'from':(_0x418437[_0x6c71('0x9e')]||'')+'\x20'+(_0x418437[_0x6c71('0x9f')]||''),'customerIp':_0x1ef21b,'customerPort':_0x4f5055[_0x6c71('0x7c')][_0x6c71('0xa0')]?_0x4f5055['headers'][_0x6c71('0xa0')]:null,'referer':_0x4f5055['body'][_0x6c71('0xa1')],'browserName':_0x343a2c[_0x6c71('0xa2')][_0x6c71('0x28')]&&_0x343a2c['browser']['version']?util['format'](_0x6c71('0xa3'),_0x343a2c['browser'][_0x6c71('0x28')],_0x343a2c[_0x6c71('0xa2')][_0x6c71('0xa4')]):_0x6c71('0xa5'),'browserVersion':_0x343a2c[_0x6c71('0xa2')]['version']||_0x6c71('0xa5'),'osName':util[_0x6c71('0xa6')](_0x6c71('0xa3'),_0x343a2c['os']['name'],_0x343a2c['os'][_0x6c71('0xa4')]),'osVersion':_0x343a2c['os'][_0x6c71('0xa4')],'deviceModel':_0x343a2c[_0x6c71('0xa7')][_0x6c71('0x2d')]&&_0x343a2c[_0x6c71('0xa7')][_0x6c71('0xa8')]?util[_0x6c71('0xa6')]('%s\x20%s\x20%s',_0x343a2c['device']['model'],_0x343a2c[_0x6c71('0xa7')]['vendor'],_0x343a2c['device']['type']):null,'deviceVendor':_0x343a2c[_0x6c71('0xa7')][_0x6c71('0xa8')],'deviceType':_0x343a2c['device'][_0x6c71('0x3c')],'formData':JSON['stringify'](_0x4f5055[_0x6c71('0x4c')])};var _0x19566b={'ChatWebsiteId':_0x4f5055[_0x6c71('0x45')]['id'],'closed':![]};if(_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xa9')]){_0x19566b[_0x6c71('0xa9')]=_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xa9')];return db[_0x6c71('0xaa')][_0x6c71('0x4a')]({'where':_0x19566b})[_0x6c71('0x24')](function(_0x545506){if(_0x545506){return[_0x545506,![]];}_0xe5a079[_0x6c71('0xa9')]=_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xa9')];_0xe5a079['externalUrl']=_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xab')];return db['ChatInteraction'][_0x6c71('0x4b')](_0xe5a079)[_0x6c71('0x24')](function(_0x41dccd){return[_0x41dccd,!![]];});});}_0x19566b['ContactId']=_0x418437['id'];if(_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xac')]&&_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xac')]['id']){_0x19566b['id']=_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xac')]['id'];return db[_0x6c71('0xaa')]['find']({'where':_0x19566b})[_0x6c71('0x24')](function(_0x47ed5e){if(_0x47ed5e){return[_0x47ed5e,![]];}return db[_0x6c71('0xaa')][_0x6c71('0x4b')](_0xe5a079)[_0x6c71('0x24')](function(_0x5a4480){return[_0x5a4480,!![]];});});}return db[_0x6c71('0xaa')]['create'](_0xe5a079)['then'](function(_0x4d727d){return[_0x4d727d,!![]];});}})['spread'](function(_0xff0dbe,_0x81eb62){if(_0xff0dbe){_0x16a2c8=_0x81eb62;if(!_0x81eb62){var _0x3f90d7={'from':(_0x33925c['contact'][_0x6c71('0x9e')]||'')+'\x20'+(_0x33925c['contact']['lastName']||'')};if(_0x4f5055['body']['threadId']&&_0x4f5055['body'][_0x6c71('0xad')]&&_0x4f5055[_0x6c71('0x4c')]['threadId']!=_0x4f5055['body'][_0x6c71('0xad')]){_0x3f90d7[_0x6c71('0xa9')]=_0x4f5055['body'][_0x6c71('0xad')];}return _0xff0dbe['update'](_0x3f90d7);}else{return _0xff0dbe;}}})['then'](function(_0x2711dd){_0x33925c[_0x6c71('0xac')]=_0x2711dd['get']({'plain':!![]});_0x33925c[_0x6c71('0xac')][_0x6c71('0xae')]=_0x16a2c8;if(_0x33925c['interaction'][_0x6c71('0xae')]){if(_0x33925c[_0x6c71('0x91')][_0x6c71('0xaf')]){_0x33925c[_0x6c71('0x92')][_0x6c71('0xb0')]({'id':0x0,'priority':_0x33925c[_0x6c71('0x92')]['length']+0x1,'app':_0x6c71('0xb1'),'appdata':_0x6c71('0xb2'),'interval':'*,*,*,*'});}}return db[_0x6c71('0xb3')][_0x6c71('0x4b')]({'body':_0x4f5055[_0x6c71('0x4c')]['body'],'ChatWebsiteId':_0x4f5055[_0x6c71('0x45')]['id'],'ChatInteractionId':_0x2711dd['id'],'direction':'in','ContactId':_0x33925c['contact']['id'],'AttachmentId':_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xb4')]});})[_0x6c71('0x24')](function(_0x169631){_0x33925c[_0x6c71('0x18')]=_0x169631;if(_0x33925c[_0x6c71('0xac')][_0x6c71('0xb5')]){return db[_0x6c71('0xb6')]['find']({'attributes':['id',_0x6c71('0x28')],'where':{'id':_0x33925c[_0x6c71('0xac')]['UserId']}})[_0x6c71('0x24')](function(_0x38a45e){if(_0x38a45e){_0x33925c[_0x6c71('0x92')][_0x6c71('0xb7')]({'id':0x0,'priority':0x0,'app':_0x6c71('0xb8'),'appdata':_0x38a45e[_0x6c71('0x28')]+','+(_0x33925c[_0x6c71('0x91')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x33925c[_0x6c71('0xb9')]=!![];}return respondWithRpcPromise('Start',_0x6c71('0xba'),_0x33925c);});}return respondWithRpcPromise(_0x6c71('0xbb'),_0x6c71('0xba'),_0x33925c);})[_0x6c71('0x24')](function(_0x174ef2){respondWithRpcPromise(_0x6c71('0xbc'),'EventManager',{'event':_0x6c71('0xbd'),'message':_0x174ef2},client9002);return _0x174ef2;})[_0x6c71('0x24')](respondWithResult(_0x26966e,null))[_0x6c71('0x43')](handleError(_0x26966e,null));};exports['offline']=function(_0x267bfa,_0x350d00){var _0x63d3e6,_0x5ac1aa,_0x1d2983;var _0x2cb65e=[];var _0x40a4a1={};var _0x3d86b2=_0x267bfa[_0x6c71('0xbe')]||[];var _0x552846=[];var _0x5cb230;return db[_0x6c71('0x7f')][_0x6c71('0x53')]()['then'](function(_0x5e231a){if(!_0x5e231a){throw new db['Sequelize']['ValidationError'](_0x6c71('0x82'));}_0x2cb65e=_[_0x6c71('0x84')](_[_0x6c71('0x2f')](_0x5e231a),[_0x6c71('0xbf'),'updatedAt',_0x6c71('0x85'),_0x6c71('0x86')]);if(_0x267bfa['body']['id']){delete _0x267bfa[_0x6c71('0x4c')]['id'];}if(_[_0x6c71('0x6c')](_0x267bfa[_0x6c71('0x4c')]['from'])){throw _0x350d00[_0x6c71('0x21')](0x1f4)[_0x6c71('0x29')](new db[(_0x6c71('0x80'))]['ValidationError'](_0x6c71('0x88')));}if(_[_0x6c71('0x6c')](_0x267bfa['body'][_0x6c71('0x4c')])||_0x267bfa['body'][_0x6c71('0x4c')]===''){throw _0x350d00[_0x6c71('0x21')](0x1f4)[_0x6c71('0x29')](new db[(_0x6c71('0x80'))]['ValidationError'](_0x6c71('0x89')));}if(_['isNil'](_0x267bfa[_0x6c71('0x4c')][_0x6c71('0xc0')])){throw _0x350d00[_0x6c71('0x21')](0x1f4)[_0x6c71('0x29')](new db['Sequelize'][(_0x6c71('0x81'))](_0x6c71('0xc1')+_0x2cb65e));}if(!_[_0x6c71('0x8b')](_0x2cb65e,_0x267bfa[_0x6c71('0x4c')][_0x6c71('0xc0')])){throw _0x350d00[_0x6c71('0x21')](0x1f4)[_0x6c71('0x29')](new db[(_0x6c71('0x80'))][(_0x6c71('0x81'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2cb65e));}_0x40a4a1[_0x267bfa['body'][_0x6c71('0xc0')]]=_0x267bfa[_0x6c71('0x4c')][_0x6c71('0x87')];})[_0x6c71('0x24')](function(){return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0x267bfa['params']['id']},'include':[{'model':db[_0x6c71('0xc2')],'as':_0x6c71('0x94')},{'model':db[_0x6c71('0xc3')],'as':_0x6c71('0xc3')}]});})['then'](handleEntityNotFound(_0x350d00,null))['then'](function(_0x4e09ca){if(_0x4e09ca&&_0x4e09ca['List']){_0x5ac1aa=_0x4e09ca;var _0x8d42ea=_[_0x6c71('0x98')](_0x267bfa['body'],{'firstName':_0x267bfa[_0x6c71('0x4c')][_0x6c71('0x87')],'phone':_0x267bfa[_0x6c71('0x4c')]['from'],'ListId':_0x4e09ca[_0x6c71('0x86')]});_0x8d42ea[_0x267bfa['body'][_0x6c71('0xc0')]]=_0x267bfa[_0x6c71('0x4c')][_0x6c71('0x87')];return db[_0x6c71('0x7f')][_0x6c71('0xc4')]({'where':_0x40a4a1,'defaults':_0x8d42ea});}})[_0x6c71('0xc5')](function(_0x316a5f){if(_0x316a5f){_0x1d2983=_0x316a5f;var _0x23d942=fs[_0x6c71('0xc6')](path[_0x6c71('0x6e')](config['root'],_0x6c71('0xc7')),_0x6c71('0xc8'));var _0x38e0c8=ejs[_0x6c71('0xc9')](_0x23d942,{'body':_[_0x6c71('0xca')](_0x267bfa[_0x6c71('0x4c')][_0x6c71('0x4c')]),'bodyTitle':_0x5ac1aa[_0x6c71('0xcb')]});return db[_0x6c71('0xcc')][_0x6c71('0x4b')]({'body':_0x38e0c8,'plainBody':htmlToText[_0x6c71('0xcd')](_0x38e0c8),'ContactId':_0x316a5f['id'],'ChatWebsiteId':_0x5ac1aa['id']});}})[_0x6c71('0x24')](function(_0x540929){_0x5cb230=_0x540929;if(_0x3d86b2[_0x6c71('0x33')]){var _0x361783=_0x3d86b2['map'](function(_0x297712){return{'name':_0x297712['originalname'],'basename':_0x297712['filename'],'type':_0x297712[_0x6c71('0xce')],'ChatOfflineMessageId':_0x540929['id']};});_0x552846=_0x361783['map'](_0x162d98=>{var _0x5df360={'filename':_0x162d98['name'],'path':path[_0x6c71('0x6e')](config['root'],_0x6c71('0xcf'),_0x6c71('0xbe'),_0x6c71('0xd0'),'offline-chat',_0x162d98[_0x6c71('0xd1')])};return _0x5df360;});if(!_0x5ac1aa[_0x6c71('0xd2')]){return db[_0x6c71('0xd3')][_0x6c71('0xd4')](function(_0x10cea1){return db[_0x6c71('0xd5')][_0x6c71('0xd6')](_0x361783,{'transaction':_0x10cea1});});}}})[_0x6c71('0x24')](function(){if(_0x5cb230){_0x63d3e6=_0x5cb230;return db['MailAccount'][_0x6c71('0x56')]({'where':{'service':!![]},'include':[{'model':db[_0x6c71('0xd7')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x6c71('0xd8')],'as':_0x6c71('0xd8'),'raw':!![]}]}]});}})[_0x6c71('0x24')](function(_0x50d7e9){if(_0x50d7e9&&_0x50d7e9[_0x6c71('0xd9')]&&_0x5ac1aa[_0x6c71('0xda')]&&_0x5ac1aa[_0x6c71('0xdb')]){var _0x356941=_0x50d7e9[_0x6c71('0xdc')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x356941,'message':{'from':util['format'](_0x6c71('0xdd'),_0x50d7e9['name'],_0x50d7e9[_0x6c71('0xde')]||_0x50d7e9[_0x6c71('0xd9')][_0x6c71('0x4d')]),'to':_0x5ac1aa[_0x6c71('0xdb')],'subject':_0x5ac1aa['offlineMessageSubject'],'html':_0x63d3e6[_0x6c71('0x4c')],'attachments':_0x552846}},client9003)[_0x6c71('0x24')](function(){return _0x63d3e6;})[_0x6c71('0x43')](function(_0x5ee928){logger[_0x6c71('0x16')](_0x5ee928);});}})[_0x6c71('0x24')](function(){if(_0x5ac1aa&&_0x5ac1aa[_0x6c71('0xd2')]&&_0x5ac1aa[_0x6c71('0xdf')]){var _0x4bf9a3=[];if(_0x3d86b2[_0x6c71('0x33')]){_0x4bf9a3=_0x3d86b2['map'](function(_0x1eac00){return{'name':_0x1eac00[_0x6c71('0xe0')],'basename':_0x1eac00['filename'],'type':_0x1eac00['mimetype'],'ChatOfflineMessageId':_0x5cb230['id']};});}var _0x44fbf8;if(!_['isNil'](_0x5ac1aa[_0x6c71('0xe1')])){var _0x540615=_[_0x6c71('0x2c')](_0x267bfa[_0x6c71('0x4c')],function(_0x18589d){return _0x18589d;});var _0xe640ba=_['toPairsIn'](_0x540615)[0x0];var _0x266f35=_[_0x6c71('0xe2')](_0xe640ba,function(_0x472a0c){return _0x472a0c;});_0x44fbf8=_0x266f35[0x1][_0x5ac1aa[_0x6c71('0xe1')]];}var _0x337046={'from':_0x1d2983[_0x6c71('0xde')],'firstName':_0x1d2983[_0x6c71('0x9e')],'lastName':_0x1d2983[_0x6c71('0x9f')],'mapKey':_0x6c71('0xde'),'message':{'from':_0x1d2983[_0x6c71('0xde')],'to':_0x5ac1aa[_0x6c71('0xc3')]['email'],'cc':'','subject':_['isNil'](_0x44fbf8)?_0x5ac1aa[_0x6c71('0xe3')]:_0x44fbf8,'messageId':'','sentAt':new Date(),'attach':_0x4bf9a3['length'],'attachments':_0x4bf9a3,'originChannel':_0x6c71('0xe4'),'ChatWebsiteId':_0x5ac1aa['id'],'ChatOfflineMessageId':_0x63d3e6['id'],'originTo':_0x5ac1aa['MailAccount'][_0x6c71('0xde')]},'body':_0x63d3e6[_0x6c71('0x4c')]};var _0x335087={'account':{'id':_0x5ac1aa[_0x6c71('0xdf')]},'body':_0x337046,'log':_0x6c71('0xe5')};return respondWithRpcPromise(_0x6c71('0xe5'),_0x6c71('0xe6'),_0x335087,client9001)[_0x6c71('0x24')](function(){return _0x63d3e6;})[_0x6c71('0x43')](function(_0x23a7c0){logger[_0x6c71('0x16')](_0x23a7c0);});}return;})[_0x6c71('0x24')](function(){if(_0x63d3e6){return _0x63d3e6;}})[_0x6c71('0x24')](respondWithResult(_0x350d00,null))[_0x6c71('0x43')](function(_0x1dc9f7){logger[_0x6c71('0x16')](_0x6c71('0x43'),_0x1dc9f7);for(var _0xd343f2 of _0x3d86b2){var _0x231b54=path[_0x6c71('0x6e')](config['root'],'server',_0x6c71('0xbe'),'attachments',_0x6c71('0xe7'),_0xd343f2[_0x6c71('0x63')]);fs_extra[_0x6c71('0xe8')](_0x231b54)[_0x6c71('0x43')](function(_0x52e2c2){logger[_0x6c71('0x16')](_0x6c71('0xe9'),_0x231b54,_0x52e2c2);});}});};exports['addInteraction']=function(_0x8edaea,_0x6a8147){return db['ChatInteraction'][_0x6c71('0x4a')]({'where':{'id':_0x8edaea['params']['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x6a8147,null))[_0x6c71('0x24')](function(_0xbe4cef){if(_0xbe4cef){return _0xbe4cef[_0x6c71('0xea')](_0x8edaea[_0x6c71('0x4c')][_0x6c71('0x59')],_[_0x6c71('0xeb')](_0x8edaea[_0x6c71('0x4c')],[_0x6c71('0x59'),'id'])||{});}})[_0x6c71('0x24')](respondWithResult(_0x6a8147,null))[_0x6c71('0x43')](handleError(_0x6a8147,null));};exports[_0x6c71('0xec')]=function(_0xa6d7cb,_0x4277fc){var _0x153b25={'raw':![],'where':{}};var _0x767c85={};var _0x2f07bd={'count':0x0,'rows':[]};return db[_0x6c71('0x3e')][_0x6c71('0x56')]({'where':{'id':_0xa6d7cb['params']['id']}})['then'](handleEntityNotFound(_0x4277fc,null))[_0x6c71('0x24')](function(_0x9bbade){if(_0x9bbade){_0x767c85['model']=_[_0x6c71('0x2f')](db[_0x6c71('0xaa')]['rawAttributes']);_0x767c85[_0x6c71('0x2e')]=_[_0x6c71('0x2f')](_0xa6d7cb[_0x6c71('0x2e')]);_0x767c85[_0x6c71('0x3a')]=_[_0x6c71('0x30')](_0x767c85[_0x6c71('0x2d')],_0x767c85['query']);_0x153b25[_0x6c71('0x31')]=_[_0x6c71('0x30')](_0x767c85[_0x6c71('0x2d')],qs[_0x6c71('0x32')](_0xa6d7cb[_0x6c71('0x2e')][_0x6c71('0x32')]));_0x153b25[_0x6c71('0x31')]=_0x153b25[_0x6c71('0x31')][_0x6c71('0x33')]?_0x153b25['attributes']:_0x767c85[_0x6c71('0x2d')];if(!_0xa6d7cb[_0x6c71('0x2e')]['hasOwnProperty'](_0x6c71('0x35'))){_0x153b25[_0x6c71('0x20')]=qs[_0x6c71('0x20')](_0xa6d7cb['query'][_0x6c71('0x20')]);_0x153b25['offset']=qs[_0x6c71('0x1f')](_0xa6d7cb[_0x6c71('0x2e')][_0x6c71('0x1f')]);}_0x153b25[_0x6c71('0x36')]=qs[_0x6c71('0x37')](_0xa6d7cb[_0x6c71('0x2e')][_0x6c71('0x37')]);_0x153b25[_0x6c71('0x38')]=qs['filters'](_['pick'](_0xa6d7cb[_0x6c71('0x2e')],_0x767c85[_0x6c71('0x3a')]));_0x153b25[_0x6c71('0x38')][_0x6c71('0x57')]=_0x9bbade['id'];if(_0xa6d7cb[_0x6c71('0x2e')][_0x6c71('0x3b')]){_0x153b25[_0x6c71('0x38')]=_[_0x6c71('0x48')](_0x153b25['where'],{'$or':_[_0x6c71('0x2c')](_0x153b25[_0x6c71('0x31')],function(_0x296242){var _0x4016b1={};_0x4016b1[_0x296242]={'$like':'%'+_0xa6d7cb[_0x6c71('0x2e')][_0x6c71('0x3b')]+'%'};return _0x4016b1;})});}_0x153b25=_[_0x6c71('0x48')]({},_0x153b25,_0xa6d7cb[_0x6c71('0x49')]);return db[_0x6c71('0xaa')][_0x6c71('0x1e')]({'where':_0x153b25[_0x6c71('0x38')]})[_0x6c71('0x24')](function(_0x543ddf){_0x2f07bd[_0x6c71('0x1e')]=_0x543ddf;if(_0xa6d7cb[_0x6c71('0x2e')]['includeAll']){_0x153b25[_0x6c71('0x40')]=[{'model':db[_0x6c71('0x7f')],'as':_0x6c71('0xed'),'required':![]},{'model':db['User'],'as':_0x6c71('0xee'),'attributes':[_0x6c71('0x28'),_0x6c71('0xef'),_0x6c71('0xf0')],'required':![]},{'model':db[_0x6c71('0xf1')],'as':_0x6c71('0xf2'),'attributes':['id',_0x6c71('0x28'),_0x6c71('0xf3')],'where':_0xa6d7cb[_0x6c71('0x2e')]['tag']?{'id':_0xa6d7cb[_0x6c71('0x2e')][_0x6c71('0xf4')]}:undefined,'required':_0xa6d7cb[_0x6c71('0x2e')][_0x6c71('0xf4')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x153b25);})[_0x6c71('0x24')](function(_0x3c520d){_0x2f07bd[_0x6c71('0x42')]=_0x3c520d;return _0x2f07bd;});}})['then'](respondWithFilteredResult(_0x4277fc,_0x153b25))[_0x6c71('0x43')](handleError(_0x4277fc,null));};function iftimePromise(_0x16247c,_0x14979c){return respondWithRpcPromise(_0x6c71('0xf5'),_0x6c71('0xf6'),{'command':_0x14979c[_0x6c71('0xf7')]?util[_0x6c71('0xa6')](_0x6c71('0xf8'),_0x16247c[_0x6c71('0xf9')],_0x14979c[_0x6c71('0xf7')]):util[_0x6c71('0xa6')]('iftime\x20%s',_0x16247c[_0x6c71('0xf9')])},client9002)['then'](function(_0x3de419){var _0x29c06d=_0x3de419&&_0x3de419['indexOf'](_0x6c71('0xfa'))>=0x0?!![]:![];logger[_0x6c71('0x19')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x14979c['id'],_0x16247c['id'],_0x16247c[_0x6c71('0xf9')],_0x29c06d?_0x6c71('0xfb'):_0x6c71('0xfc'),_0x14979c['timezone']?_0x14979c[_0x6c71('0xf7')]:_0x6c71('0xfd'));return _0x29c06d;})[_0x6c71('0x43')](function(_0x376213){logger[_0x6c71('0x16')](_0x6c71('0xfe'),_0x14979c['id'],_0x16247c['id'],_0x16247c[_0x6c71('0xf9')],util[_0x6c71('0xff')](_0x376213,{'showHidden':![],'depth':null}),_0x14979c[_0x6c71('0xf7')]?_0x14979c[_0x6c71('0xf7')]:_0x6c71('0xfd'));return![];});}exports[_0x6c71('0xf6')]=function(_0x26faa3,_0x2bef6d){var _0x291127=0x0;var _0x3b93f9=0x0;var _0x2601e3=![];var _0x48bd32;var _0x2f3925;return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0x26faa3['params']['id']},'include':[{'model':db[_0x6c71('0x100')],'as':_0x6c71('0x100'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x6c71('0xf9')],'raw':!![]}]}]})[_0x6c71('0x24')](handleEntityNotFound(_0x2bef6d,null))[_0x6c71('0x24')](function(_0x31ef19){if(_0x31ef19){_0x48bd32=_0x31ef19;return _0x31ef19[_0x6c71('0x101')]({'raw':!![]});}})[_0x6c71('0x24')](function(_0x192160){if(_0x48bd32){if(_0x192160){_0x2f3925=_0x192160;}}return require(_0x6c71('0x69'))[_0x6c71('0x6a')]();})[_0x6c71('0x24')](function(_0x3ac7c4){if(_0x3ac7c4){_0x3b93f9=_0x3ac7c4[_0x6c71('0x102')];_0x2601e3=_0x3ac7c4[_0x6c71('0x6b')];}})['then'](function(){return db[_0x6c71('0xaa')][_0x6c71('0x1e')]({'where':{'closed':![]}});})[_0x6c71('0x24')](function(_0x215f32){_0x291127=_0x215f32;if(_0x3b93f9&&_0x215f32>_0x3b93f9){return db[_0x6c71('0x103')][_0x6c71('0x56')]({'where':{'id':0x1}})[_0x6c71('0x24')](function(_0xcb210f){if(_0xcb210f){_0xcb210f[_0x6c71('0x104')](_0x6c71('0x105'));}});}})[_0x6c71('0x24')](function(){if(_0x48bd32['Interval']&&_0x48bd32['Interval'][_0x6c71('0x106')]){var _0x985661=[];for(var _0x575a24=0x0;_0x575a24<_0x48bd32['Interval'][_0x6c71('0x106')][_0x6c71('0x33')];_0x575a24++){var _0x573219=_0x48bd32[_0x6c71('0x100')][_0x6c71('0x106')][_0x575a24][_0x6c71('0x25')]({'plain':!![]});_0x985661[_0x6c71('0xb0')](iftimePromise(_0x573219,_0x48bd32));}return BPromise[_0x6c71('0x107')](_0x985661)[_0x6c71('0x24')](function(_0x20eedd){return _[_0x6c71('0x108')](_0x20eedd);});}else{return!![];}})[_0x6c71('0x24')](function(_0x4b47ea){var _0x4bbbc6=fs['readFileSync'](path[_0x6c71('0x6e')](config[_0x6c71('0x68')],'server/files/chat/iframe.ejs'),_0x6c71('0xc8'));var _0x338160={'remote':_0x48bd32[_0x6c71('0x109')],'query':querystring[_0x6c71('0x15')](_[_0x6c71('0x48')](_0x48bd32[_0x6c71('0x25')]({'plain':!![]}),{'customerIp':_0x26faa3[_0x6c71('0x7c')][_0x6c71('0x9c')]||_0x26faa3[_0x6c71('0x7c')]['x-real-ip']||_0x26faa3[_0x6c71('0x10a')][_0x6c71('0x10b')]||_0x26faa3['ip'],'referer':_0x26faa3[_0x6c71('0x7c')][_0x6c71('0xa1')],'openedInteractions':_0x291127,'maxInteractions':_0x3b93f9,'virtual':_0x2601e3[_0x6c71('0x102')],'online':_0x4b47ea,'custom':_0x2601e3}))[_0x6c71('0x10c')](/'/g,'\x5c\x27')};_0x2bef6d[_0x6c71('0x29')](ejs[_0x6c71('0xc9')](Mustache['render'](_0x4bbbc6,_0x338160),{'proactiveActions':_0x2f3925,'alignment':_0x48bd32[_0x6c71('0x10d')],'verticalAlignment':_0x48bd32[_0x6c71('0x10e')],'div_color':_0x48bd32[_0x6c71('0xf3')],'labelText':_0x48bd32[_0x6c71('0x10f')],'text_color':_0x48bd32[_0x6c71('0x110')],'text_button_color':_0x48bd32[_0x6c71('0x111')],'button_color':_0x48bd32['color_button'],'background_color':_0x48bd32['backgroundColor'],'hideWhenOffline':_0x48bd32['hideWhenOffline'],'interval':_0x48bd32[_0x6c71('0x112')]}));})['catch'](handleError(_0x2bef6d,null));};exports[_0x6c71('0x113')]=function(_0x5378fa,_0x3606a4){var _0x2c1de3=_0x5378fa[_0x6c71('0x45')]['id'];var _0x509b47=_0x5378fa[_0x6c71('0x4c')];var _0x3773ba=0xc8;var _0x2dcd5f=null;return db['sequelize'][_0x6c71('0xd4')]({'isolationLevel':db[_0x6c71('0xd3')]['Transaction'][_0x6c71('0x114')]['READ_COMMITTED']},function(_0x11bbfc){return db['ChatWebsite'][_0x6c71('0x56')]({'where':{'id':_0x2c1de3},'transaction':_0x11bbfc})['then'](function(_0xea1473){if(_0xea1473){return db['ChatApplication'][_0x6c71('0x23')]({'where':{'ChatWebsiteId':_0x2c1de3},'transaction':_0x11bbfc})[_0x6c71('0x24')](function(){var _0x213ac5=_[_0x6c71('0x2c')](_0x509b47,function(_0x1834b4){_0x1834b4['ChatWebsiteId']=_0x2c1de3;return _0x1834b4;});return db[_0x6c71('0x8f')]['bulkCreate'](_0x213ac5,{'transaction':_0x11bbfc});});}else{_0x3773ba=0x194;_0x2dcd5f=[];}});})[_0x6c71('0x24')](function(){if(_0x3773ba!==0x194){return db['ChatApplication'][_0x6c71('0x115')]({'where':{'ChatWebsiteId':_0x2c1de3},'order':_0x6c71('0x96')})['then'](function(_0x38d20f){_0x2dcd5f=_0x38d20f;});}})[_0x6c71('0x43')](function(_0x57f741){_0x3773ba=0x1f4;logger[_0x6c71('0x16')](_0x57f741['stack']);if(_0x57f741[_0x6c71('0x28')]){delete _0x57f741['name'];}_0x2dcd5f=_0x57f741;})[_0x6c71('0x116')](function(){if(_0x2dcd5f===null){_0x3606a4[_0x6c71('0x27')](_0x3773ba);}else{if(_0x3773ba===0x1f4){_0x3606a4['status'](_0x3773ba)[_0x6c71('0x29')](_0x2dcd5f);}else{_0x3606a4[_0x6c71('0x21')](_0x3773ba)['json'](_0x2dcd5f);}}});};exports[_0x6c71('0x117')]=function(_0x3fd315,_0x315f1e){var _0x353228={};var _0x25699b={};var _0x2ca847;var _0x83b625;return db['ChatWebsite'][_0x6c71('0x56')]({'where':{'id':_0x3fd315[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x315f1e,null))[_0x6c71('0x24')](function(_0x3b3e19){if(_0x3b3e19){_0x2ca847=_0x3b3e19;_0x25699b['model']=_[_0x6c71('0x2f')](db['ChatApplication']['rawAttributes']);_0x25699b[_0x6c71('0x2e')]=_[_0x6c71('0x2f')](_0x3fd315[_0x6c71('0x2e')]);_0x25699b[_0x6c71('0x3a')]=_['intersection'](_0x25699b[_0x6c71('0x2d')],_0x25699b['query']);_0x353228[_0x6c71('0x31')]=_[_0x6c71('0x30')](_0x25699b[_0x6c71('0x2d')],qs[_0x6c71('0x32')](_0x3fd315[_0x6c71('0x2e')][_0x6c71('0x32')]));_0x353228[_0x6c71('0x31')]=_0x353228[_0x6c71('0x31')][_0x6c71('0x33')]?_0x353228['attributes']:_0x25699b['model'];_0x353228[_0x6c71('0x36')]=qs['sort'](_0x3fd315[_0x6c71('0x2e')][_0x6c71('0x37')]);_0x353228[_0x6c71('0x38')]=qs['filters'](_[_0x6c71('0x39')](_0x3fd315['query'],_0x25699b[_0x6c71('0x3a')]));if(_0x3fd315[_0x6c71('0x2e')]['filter']){_0x353228[_0x6c71('0x38')]=_['merge'](_0x353228[_0x6c71('0x38')],{'$or':_[_0x6c71('0x2c')](_0x353228[_0x6c71('0x31')],function(_0x1e127d){var _0x5c14f6={};_0x5c14f6[_0x1e127d]={'$like':'%'+_0x3fd315[_0x6c71('0x2e')][_0x6c71('0x3b')]+'%'};return _0x5c14f6;})});}_0x353228=_[_0x6c71('0x48')]({},_0x353228,_0x3fd315[_0x6c71('0x49')]);return _0x2ca847[_0x6c71('0x117')](_0x353228);}})[_0x6c71('0x24')](function(_0x3b51e0){if(_0x3b51e0){_0x83b625=_0x3b51e0[_0x6c71('0x33')];if(!_0x3fd315[_0x6c71('0x2e')][_0x6c71('0x34')](_0x6c71('0x35'))){_0x353228[_0x6c71('0x20')]=qs['limit'](_0x3fd315[_0x6c71('0x2e')][_0x6c71('0x20')]);_0x353228[_0x6c71('0x1f')]=qs[_0x6c71('0x1f')](_0x3fd315[_0x6c71('0x2e')][_0x6c71('0x1f')]);}return _0x2ca847[_0x6c71('0x117')](_0x353228);}})[_0x6c71('0x24')](function(_0x565d47){if(_0x565d47){return _0x565d47?{'count':_0x83b625,'rows':_0x565d47}:null;}})[_0x6c71('0x24')](respondWithResult(_0x315f1e,null))[_0x6c71('0x43')](handleError(_0x315f1e,null));};exports[_0x6c71('0x118')]=function(_0x34f3c3,_0x7050df){return db[_0x6c71('0x119')][_0x6c71('0x4a')]({'where':{'id':_0x34f3c3['params']['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x7050df,null))[_0x6c71('0x24')](function(_0x280d3a){if(_0x280d3a){return _0x280d3a[_0x6c71('0x118')](_0x34f3c3[_0x6c71('0x4c')][_0x6c71('0x59')],_[_0x6c71('0xeb')](_0x34f3c3[_0x6c71('0x4c')],[_0x6c71('0x59'),'id'])||{});}})[_0x6c71('0x24')](respondWithResult(_0x7050df,null))[_0x6c71('0x43')](handleError(_0x7050df,null));};exports[_0x6c71('0x101')]=function(_0x97bd56,_0x54c602){var _0x53ede8={};var _0x47bcbe={};var _0x6633a2;var _0x56bffe;return db[_0x6c71('0x3e')][_0x6c71('0x56')]({'where':{'id':_0x97bd56[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x54c602,null))[_0x6c71('0x24')](function(_0xe0bf61){if(_0xe0bf61){_0x6633a2=_0xe0bf61;_0x47bcbe[_0x6c71('0x2d')]=_[_0x6c71('0x2f')](db[_0x6c71('0x11a')][_0x6c71('0x47')]);_0x47bcbe['query']=_[_0x6c71('0x2f')](_0x97bd56['query']);_0x47bcbe['filters']=_[_0x6c71('0x30')](_0x47bcbe[_0x6c71('0x2d')],_0x47bcbe[_0x6c71('0x2e')]);_0x53ede8[_0x6c71('0x31')]=_['intersection'](_0x47bcbe[_0x6c71('0x2d')],qs['fields'](_0x97bd56['query'][_0x6c71('0x32')]));_0x53ede8['attributes']=_0x53ede8[_0x6c71('0x31')]['length']?_0x53ede8[_0x6c71('0x31')]:_0x47bcbe[_0x6c71('0x2d')];_0x53ede8[_0x6c71('0x36')]=qs[_0x6c71('0x37')](_0x97bd56[_0x6c71('0x2e')][_0x6c71('0x37')]);_0x53ede8[_0x6c71('0x38')]=qs[_0x6c71('0x3a')](_[_0x6c71('0x39')](_0x97bd56[_0x6c71('0x2e')],_0x47bcbe[_0x6c71('0x3a')]));if(_0x97bd56['query']['filter']){_0x53ede8['where']=_[_0x6c71('0x48')](_0x53ede8[_0x6c71('0x38')],{'$or':_[_0x6c71('0x2c')](_0x53ede8[_0x6c71('0x31')],function(_0x3e6797){var _0x1994cf={};_0x1994cf[_0x3e6797]={'$like':'%'+_0x97bd56[_0x6c71('0x2e')][_0x6c71('0x3b')]+'%'};return _0x1994cf;})});}_0x53ede8=_[_0x6c71('0x48')]({},_0x53ede8,_0x97bd56[_0x6c71('0x49')]);return _0x6633a2[_0x6c71('0x101')](_0x53ede8);}})[_0x6c71('0x24')](function(_0x59fba8){if(_0x59fba8){_0x56bffe=_0x59fba8[_0x6c71('0x33')];if(!_0x97bd56[_0x6c71('0x2e')][_0x6c71('0x34')]('nolimit')){_0x53ede8[_0x6c71('0x20')]=qs['limit'](_0x97bd56['query'][_0x6c71('0x20')]);_0x53ede8[_0x6c71('0x1f')]=qs['offset'](_0x97bd56[_0x6c71('0x2e')][_0x6c71('0x1f')]);}return _0x6633a2['getProactiveActions'](_0x53ede8);}})[_0x6c71('0x24')](function(_0x59db78){if(_0x59db78){return _0x59db78?{'count':_0x56bffe,'rows':_0x59db78}:null;}})[_0x6c71('0x24')](respondWithResult(_0x54c602,null))['catch'](handleError(_0x54c602,null));};exports[_0x6c71('0x11b')]=function(_0x5c171a,_0x200c64){var _0x5f2968=_0x5c171a[_0x6c71('0x2e')][_0x6c71('0x11c')]===_0x6c71('0x11d')?_0x6c71('0x11e'):'onlineForm';return db['ChatWebsite'][_0x6c71('0x4a')]({'attributes':['id',_0x5f2968],'where':{'id':_0x5c171a[_0x6c71('0x45')]['id']}})['then'](handleEntityNotFound(_0x200c64,null))[_0x6c71('0x24')](function(_0x3a3ae2){if(_0x3a3ae2){var _0xca5f5f=_0x3a3ae2[_0x5f2968];var _0x5c2f1f=_0xca5f5f&&_0xca5f5f[_0x6c71('0x11f')]?_0xca5f5f[_0x6c71('0x11f')]:[];_0x200c64[_0x6c71('0x29')]({'fromKey':_[_0x6c71('0x6c')](_0xca5f5f[_0x6c71('0x120')])?undefined:_0xca5f5f[_0x6c71('0x120')],'count':_0x5c2f1f['length'],'rows':_0x5c2f1f});}})[_0x6c71('0x43')](handleError(_0x200c64,null));};exports[_0x6c71('0x121')]=function(_0x4a50ed,_0x44522c){var _0xeb8018={'raw':![],'where':{}};var _0x111aaf={};var _0x13cd9c={'count':0x0,'rows':[]};return db[_0x6c71('0x3e')][_0x6c71('0x56')]({'where':{'id':_0x4a50ed['params']['id']}})['then'](handleEntityNotFound(_0x44522c,null))[_0x6c71('0x24')](function(_0x1b4fdf){if(_0x1b4fdf){_0x111aaf[_0x6c71('0x2d')]=_[_0x6c71('0x2f')](db[_0x6c71('0xcc')][_0x6c71('0x47')]);_0x111aaf[_0x6c71('0x2e')]=_[_0x6c71('0x2f')](_0x4a50ed['query']);_0x111aaf[_0x6c71('0x3a')]=_[_0x6c71('0x30')](_0x111aaf[_0x6c71('0x2d')],_0x111aaf[_0x6c71('0x2e')]);_0xeb8018['attributes']=_[_0x6c71('0x30')](_0x111aaf[_0x6c71('0x2d')],qs[_0x6c71('0x32')](_0x4a50ed[_0x6c71('0x2e')][_0x6c71('0x32')]));_0xeb8018[_0x6c71('0x31')]=_0xeb8018[_0x6c71('0x31')]['length']?_0xeb8018[_0x6c71('0x31')]:_0x111aaf[_0x6c71('0x2d')];if(!_0x4a50ed[_0x6c71('0x2e')][_0x6c71('0x34')](_0x6c71('0x35'))){_0xeb8018[_0x6c71('0x20')]=qs['limit'](_0x4a50ed[_0x6c71('0x2e')]['limit']);_0xeb8018[_0x6c71('0x1f')]=qs[_0x6c71('0x1f')](_0x4a50ed[_0x6c71('0x2e')][_0x6c71('0x1f')]);}_0xeb8018['order']=qs[_0x6c71('0x37')](_0x4a50ed[_0x6c71('0x2e')][_0x6c71('0x37')]);_0xeb8018[_0x6c71('0x38')]=qs[_0x6c71('0x3a')](_[_0x6c71('0x39')](_0x4a50ed[_0x6c71('0x2e')],_0x111aaf[_0x6c71('0x3a')]));_0xeb8018[_0x6c71('0x38')]['ChatWebsiteId']=_0x1b4fdf['id'];if(_0x4a50ed[_0x6c71('0x2e')][_0x6c71('0x3b')]){_0xeb8018[_0x6c71('0x38')]=_[_0x6c71('0x48')](_0xeb8018['where'],{'$or':_[_0x6c71('0x2c')](_0xeb8018[_0x6c71('0x31')],function(_0x1cb451){var _0x244f23={};_0x244f23[_0x1cb451]={'$like':'%'+_0x4a50ed[_0x6c71('0x2e')][_0x6c71('0x3b')]+'%'};return _0x244f23;})});}_0xeb8018=_[_0x6c71('0x48')]({},_0xeb8018,_0x4a50ed[_0x6c71('0x49')]);return db[_0x6c71('0xcc')][_0x6c71('0x1e')]({'where':_0xeb8018[_0x6c71('0x38')]})[_0x6c71('0x24')](function(_0x22ba5a){_0x13cd9c['count']=_0x22ba5a;if(_0x4a50ed[_0x6c71('0x2e')]['includeAll']){_0xeb8018['include']=[{'all':!![]}];}else{_0xeb8018[_0x6c71('0x40')]=[{'model':db[_0x6c71('0x7f')],'as':'Contact','required':![]},{'model':db[_0x6c71('0xd5')],'as':_0x6c71('0x122'),'required':![]}];}return db[_0x6c71('0xcc')][_0x6c71('0x41')](_0xeb8018);})[_0x6c71('0x24')](function(_0x42dfed){_0x13cd9c['rows']=_0x42dfed;return _0x13cd9c;});}})[_0x6c71('0x24')](respondWithFilteredResult(_0x44522c,_0xeb8018))[_0x6c71('0x43')](handleError(_0x44522c,null));};exports[_0x6c71('0x123')]=function(_0x194af2,_0x55ce69){return db[_0x6c71('0x3e')]['find']({'where':{'id':_0x194af2['params']['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x55ce69,null))[_0x6c71('0x24')](function(_0x443f3e){if(_0x443f3e){return _0x443f3e['addAgents'](_0x194af2[_0x6c71('0x4c')][_0x6c71('0x59')],_[_0x6c71('0xeb')](_0x194af2[_0x6c71('0x4c')],[_0x6c71('0x59'),'id'])||{})[_0x6c71('0xc5')](function(_0x360229){for(var _0xd477c6=0x0;_0xd477c6<_0x194af2[_0x6c71('0x4c')]['ids'][_0x6c71('0x33')];_0xd477c6+=0x1){socket[_0x6c71('0x124')](_0x6c71('0x125'),{'UserId':Number(_0x194af2[_0x6c71('0x4c')][_0x6c71('0x59')][_0xd477c6]),'ChatWebsiteId':Number(_0x194af2[_0x6c71('0x45')]['id'])});}return _0x360229;});}})[_0x6c71('0x24')](respondWithResult(_0x55ce69,null))['catch'](handleError(_0x55ce69,null));};exports['removeAgents']=function(_0x473ddc,_0x4c8297){return db[_0x6c71('0x3e')]['find']({'where':{'id':_0x473ddc[_0x6c71('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c8297,null))[_0x6c71('0x24')](function(_0x11f7f6){if(_0x11f7f6){return _0x11f7f6[_0x6c71('0x126')](_0x473ddc[_0x6c71('0x2e')][_0x6c71('0x59')])['then'](function(){if(_[_0x6c71('0x127')](_0x473ddc[_0x6c71('0x2e')]['ids'])){for(var _0x409373=0x0;_0x409373<_0x473ddc[_0x6c71('0x2e')][_0x6c71('0x59')][_0x6c71('0x33')];_0x409373+=0x1){socket[_0x6c71('0x124')](_0x6c71('0x128'),{'UserId':Number(_0x473ddc[_0x6c71('0x2e')][_0x6c71('0x59')][_0x409373]),'ChatWebsiteId':Number(_0x473ddc[_0x6c71('0x45')]['id'])});}}else{socket['emit'](_0x6c71('0x128'),{'UserId':Number(_0x473ddc[_0x6c71('0x2e')][_0x6c71('0x59')]),'ChatWebsiteId':Number(_0x473ddc['params']['id'])});}});}})[_0x6c71('0x24')](respondWithStatusCode(_0x4c8297,null))[_0x6c71('0x43')](handleError(_0x4c8297,null));};exports[_0x6c71('0x129')]=function(_0x50d9c9,_0x4718ad){var _0x37e613={};var _0x4c0a38={};var _0x1091c7;var _0x14cbb5;return db[_0x6c71('0x3e')][_0x6c71('0x56')]({'where':{'id':_0x50d9c9[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x4718ad,null))[_0x6c71('0x24')](function(_0x2f091f){if(_0x2f091f){_0x1091c7=_0x2f091f;_0x4c0a38[_0x6c71('0x2d')]=_[_0x6c71('0x2f')](db[_0x6c71('0xb6')][_0x6c71('0x47')]);_0x4c0a38[_0x6c71('0x2e')]=_['keys'](_0x50d9c9[_0x6c71('0x2e')]);_0x4c0a38[_0x6c71('0x3a')]=_['intersection'](_0x4c0a38[_0x6c71('0x2d')],_0x4c0a38[_0x6c71('0x2e')]);_0x37e613[_0x6c71('0x31')]=_[_0x6c71('0x30')](_0x4c0a38[_0x6c71('0x2d')],qs[_0x6c71('0x32')](_0x50d9c9[_0x6c71('0x2e')][_0x6c71('0x32')]));_0x37e613['attributes']=_0x37e613[_0x6c71('0x31')][_0x6c71('0x33')]?_0x37e613[_0x6c71('0x31')]:_0x4c0a38[_0x6c71('0x2d')];_0x37e613[_0x6c71('0x36')]=qs['sort'](_0x50d9c9[_0x6c71('0x2e')]['sort']);_0x37e613[_0x6c71('0x38')]=qs[_0x6c71('0x3a')](_[_0x6c71('0x39')](_0x50d9c9[_0x6c71('0x2e')],_0x4c0a38['filters']));if(_0x50d9c9[_0x6c71('0x2e')][_0x6c71('0x3b')]){_0x37e613[_0x6c71('0x38')]=_[_0x6c71('0x48')](_0x37e613[_0x6c71('0x38')],{'$or':_[_0x6c71('0x2c')](_0x37e613[_0x6c71('0x31')],function(_0x311c2e){var _0x4b6356={};_0x4b6356[_0x311c2e]={'$like':'%'+_0x50d9c9[_0x6c71('0x2e')][_0x6c71('0x3b')]+'%'};return _0x4b6356;})});}_0x37e613=_[_0x6c71('0x48')]({},_0x37e613,_0x50d9c9[_0x6c71('0x49')]);return _0x1091c7[_0x6c71('0x129')](_0x37e613);}})[_0x6c71('0x24')](function(_0x29c77f){if(_0x29c77f){_0x14cbb5=_0x29c77f[_0x6c71('0x33')];if(!_0x50d9c9[_0x6c71('0x2e')][_0x6c71('0x34')]('nolimit')){_0x37e613[_0x6c71('0x20')]=qs[_0x6c71('0x20')](_0x50d9c9[_0x6c71('0x2e')]['limit']);_0x37e613[_0x6c71('0x1f')]=qs[_0x6c71('0x1f')](_0x50d9c9[_0x6c71('0x2e')][_0x6c71('0x1f')]);}return _0x1091c7[_0x6c71('0x129')](_0x37e613);}})[_0x6c71('0x24')](function(_0x1cc5c8){if(_0x1cc5c8){return _0x1cc5c8?{'count':_0x14cbb5,'rows':_0x1cc5c8}:null;}})['then'](respondWithResult(_0x4718ad,null))[_0x6c71('0x43')](handleError(_0x4718ad,null));}; \ No newline at end of file +var _0xb459=['offset','undefined','count','set','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','mapKey','includes','CmList','Contacts','DESC','ChatApplication','Applications','List','account','list','applications','orderBy','priority','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','x-real-port','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','basename','sequelize','transaction','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','\x22%s\x22\x20<%s>','email','openNewInteraction','subjectOffline','toPairsIn','mapValues','lastName','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','ONLINE','OFFLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','No\x20timezone','Interval','Intervals','virtual','License','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','labelText','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','chatProactiveAction','getProactiveActions','ChatProactiveAction','offlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','querystring','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status'];(function(_0x5a9597,_0x48e55b){var _0x5b1e40=function(_0x33a42c){while(--_0x33a42c){_0x5a9597['push'](_0x5a9597['shift']());}};_0x5b1e40(++_0x48e55b);}(_0xb459,0xfc));var _0x9b45=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0xb459[_0x55ff3e];return _0x2709eb;};'use strict';var BPromise=require(_0x9b45('0x0'));var Mustache=require(_0x9b45('0x1'));var util=require(_0x9b45('0x2'));var path=require(_0x9b45('0x3'));var ejs=require(_0x9b45('0x4'));var fs=require('fs');var fs_extra=require(_0x9b45('0x5'));var _=require('lodash');var querystring=require(_0x9b45('0x6'));var Redis=require('ioredis');var qs=require(_0x9b45('0x7'));var logger=require('../../config/logger')('api');var config=require(_0x9b45('0x8'));var db=require(_0x9b45('0x9'))['db'];config[_0x9b45('0xa')]=_[_0x9b45('0xb')](config[_0x9b45('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9b45('0xc'))(new Redis(config[_0x9b45('0xa')]));require('./chatWebsite.socket')[_0x9b45('0xd')](socket);var htmlToText=require(_0x9b45('0xe'));var jayson=require(_0x9b45('0xf'));var client=jayson[_0x9b45('0x10')][_0x9b45('0x11')]({'port':0x232c});var client9002=jayson[_0x9b45('0x10')][_0x9b45('0x11')]({'port':0x232a});var client9003=jayson[_0x9b45('0x10')]['http']({'port':0x232b});var client9001=jayson[_0x9b45('0x10')][_0x9b45('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x332969,_0x332398,_0x46c0bd,_0x3456ac){return new BPromise(function(_0x48d390,_0x5de925){var _0x58a281=_0x3456ac||client;return _0x58a281[_0x9b45('0x12')](_0x332969,_0x46c0bd)[_0x9b45('0x13')](function(_0xee2c7a){logger[_0x9b45('0x14')](_0x9b45('0x15'),_0x332398,_0x9b45('0x16'));logger[_0x9b45('0x17')](_0x9b45('0x18'),_0x332398,_0x9b45('0x16'),JSON[_0x9b45('0x19')](_0xee2c7a));if(_0xee2c7a[_0x9b45('0x1a')]){if(_0xee2c7a[_0x9b45('0x1a')][_0x9b45('0x1b')]===0x1f4){logger[_0x9b45('0x1a')](_0x9b45('0x15'),_0x332398,_0xee2c7a[_0x9b45('0x1a')]['message']);return _0x5de925(_0xee2c7a['error'][_0x9b45('0x1c')]);}logger[_0x9b45('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x332398,_0xee2c7a[_0x9b45('0x1a')][_0x9b45('0x1c')]);return _0x48d390(_0xee2c7a[_0x9b45('0x1a')][_0x9b45('0x1c')]);}else{logger[_0x9b45('0x14')](_0x9b45('0x15'),_0x332398,_0x9b45('0x16'));_0x48d390(_0xee2c7a['result']['message']);}})[_0x9b45('0x1d')](function(_0x5913ab){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x332398,_0x5913ab);_0x5de925(_0x5913ab);});});}function respondWithStatusCode(_0x5014df,_0x237de7){_0x237de7=_0x237de7||0xcc;return function(_0x3b0da2){if(_0x3b0da2){return _0x5014df[_0x9b45('0x1e')](_0x237de7);}return _0x5014df['status'](_0x237de7)[_0x9b45('0x1f')]();};}function respondWithResult(_0x20519f,_0x20c5df){_0x20c5df=_0x20c5df||0xc8;return function(_0x1e99ae){if(_0x1e99ae){return _0x20519f[_0x9b45('0x20')](_0x20c5df)['json'](_0x1e99ae);}};}function respondWithFilteredResult(_0x88060d,_0x32d100){return function(_0x2f4120){if(_0x2f4120){var _0x950f42=typeof _0x32d100[_0x9b45('0x21')]===_0x9b45('0x22')&&typeof _0x32d100['limit']===_0x9b45('0x22');var _0x1cb559=_0x2f4120[_0x9b45('0x23')];var _0x8bed4e=_0x950f42?0x0:_0x32d100['offset'];var _0x5ba17a=_0x950f42?_0x2f4120[_0x9b45('0x23')]:_0x32d100[_0x9b45('0x21')]+_0x32d100['limit'];var _0x34f0b3;if(_0x5ba17a>=_0x1cb559){_0x5ba17a=_0x1cb559;_0x34f0b3=0xc8;}else{_0x34f0b3=0xce;}_0x88060d['status'](_0x34f0b3);return _0x88060d[_0x9b45('0x24')](_0x9b45('0x25'),_0x8bed4e+'-'+_0x5ba17a+'/'+_0x1cb559)[_0x9b45('0x26')](_0x2f4120);}return null;};}function saveUpdates(_0x2895e2){return function(_0x41e3ff){if(_0x41e3ff){return _0x41e3ff[_0x9b45('0x27')](_0x2895e2)[_0x9b45('0x13')](function(_0x300223){return _0x300223;});}return null;};}function removeEntity(_0x52b0ee){return function(_0x578525){if(_0x578525){return _0x578525[_0x9b45('0x28')]()['then'](function(){var _0xb9419=_0x578525[_0x9b45('0x29')]({'plain':!![]});var _0x346476=_0x9b45('0x2a');return db[_0x9b45('0x2b')][_0x9b45('0x28')]({'where':{'type':_0x346476,'resourceId':_0xb9419['id']}})['then'](function(){return _0x578525;});})[_0x9b45('0x13')](function(){_0x52b0ee[_0x9b45('0x20')](0xcc)[_0x9b45('0x1f')]();});}};}function handleEntityNotFound(_0x6eaeb9){return function(_0x274ddf){if(!_0x274ddf){_0x6eaeb9[_0x9b45('0x1e')](0x194);}return _0x274ddf;};}function handleError(_0x3a9414,_0x1d5d88){_0x1d5d88=_0x1d5d88||0x1f4;return function(_0x38bc40){logger[_0x9b45('0x1a')](_0x38bc40[_0x9b45('0x2c')]);if(_0x38bc40[_0x9b45('0x2d')]){delete _0x38bc40[_0x9b45('0x2d')];}_0x3a9414['status'](_0x1d5d88)['send'](_0x38bc40);};}exports[_0x9b45('0x2e')]=function(_0x48776d,_0x208334){var _0x362f93={'include':[{'model':db[_0x9b45('0x2f')],'as':_0x9b45('0x30')}]},_0x2acc20={},_0x10370f={'count':0x0,'rows':[]};var _0x511f7a=_[_0x9b45('0x31')](db[_0x9b45('0x32')][_0x9b45('0x33')],function(_0xa5cc0b){return{'name':_0xa5cc0b[_0x9b45('0x34')],'type':_0xa5cc0b[_0x9b45('0x35')]['key']};});_0x2acc20[_0x9b45('0x36')]=_[_0x9b45('0x31')](_0x511f7a,'name');_0x2acc20['query']=_[_0x9b45('0x37')](_0x48776d[_0x9b45('0x38')]);_0x2acc20['filters']=_['intersection'](_0x2acc20['model'],_0x2acc20[_0x9b45('0x38')]);_0x362f93['attributes']=_[_0x9b45('0x39')](_0x2acc20['model'],qs['fields'](_0x48776d[_0x9b45('0x38')][_0x9b45('0x3a')]));_0x362f93['attributes']=_0x362f93[_0x9b45('0x3b')]['length']?_0x362f93['attributes']:_0x2acc20[_0x9b45('0x36')];if(!_0x48776d[_0x9b45('0x38')][_0x9b45('0x3c')](_0x9b45('0x3d'))){_0x362f93['limit']=qs[_0x9b45('0x3e')](_0x48776d[_0x9b45('0x38')]['limit']);_0x362f93[_0x9b45('0x21')]=qs[_0x9b45('0x21')](_0x48776d[_0x9b45('0x38')]['offset']);}_0x362f93[_0x9b45('0x3f')]=qs[_0x9b45('0x40')](_0x48776d[_0x9b45('0x38')][_0x9b45('0x40')]);_0x362f93[_0x9b45('0x41')]=qs[_0x9b45('0x42')](_[_0x9b45('0x43')](_0x48776d['query'],_0x2acc20['filters']),_0x511f7a);if(_0x48776d[_0x9b45('0x38')][_0x9b45('0x44')]){_0x362f93[_0x9b45('0x41')]=_[_0x9b45('0x45')](_0x362f93[_0x9b45('0x41')],{'$or':_[_0x9b45('0x31')](_0x511f7a,function(_0x12dfcc){if(_0x12dfcc[_0x9b45('0x35')]!==_0x9b45('0x46')){var _0x3d2e27={};_0x3d2e27[_0x12dfcc['name']]={'$like':'%'+_0x48776d['query'][_0x9b45('0x44')]+'%'};return _0x3d2e27;}})});}_0x362f93=_[_0x9b45('0x45')]({},_0x362f93,_0x48776d['options']);var _0x35ce6f={'where':_0x362f93['where']};return db['ChatWebsite']['count'](_0x35ce6f)['then'](function(_0x45d654){_0x10370f[_0x9b45('0x23')]=_0x45d654;if(_0x48776d[_0x9b45('0x38')][_0x9b45('0x47')]){_0x362f93[_0x9b45('0x48')]=[{'all':!![]}];}return db[_0x9b45('0x32')][_0x9b45('0x49')](_0x362f93);})[_0x9b45('0x13')](function(_0x3e8d6a){_0x10370f['rows']=_0x3e8d6a;return _0x10370f;})['then'](respondWithFilteredResult(_0x208334,_0x362f93))['catch'](handleError(_0x208334,null));};exports['show']=function(_0xc792b9,_0x23038d){var _0x4fdf5e={'raw':![],'where':{'id':_0xc792b9[_0x9b45('0x4a')]['id']},'include':[{'model':db[_0x9b45('0x2f')],'as':_0x9b45('0x30')}]},_0x26fec2={};_0x26fec2['model']=_[_0x9b45('0x37')](db[_0x9b45('0x32')][_0x9b45('0x33')]);_0x26fec2[_0x9b45('0x38')]=_[_0x9b45('0x37')](_0xc792b9[_0x9b45('0x38')]);_0x26fec2[_0x9b45('0x42')]=_[_0x9b45('0x39')](_0x26fec2[_0x9b45('0x36')],_0x26fec2[_0x9b45('0x38')]);_0x4fdf5e['attributes']=_[_0x9b45('0x39')](_0x26fec2['model'],qs[_0x9b45('0x3a')](_0xc792b9[_0x9b45('0x38')][_0x9b45('0x3a')]));_0x4fdf5e[_0x9b45('0x3b')]=_0x4fdf5e['attributes'][_0x9b45('0x4b')]?_0x4fdf5e['attributes']:_0x26fec2[_0x9b45('0x36')];if(_0xc792b9[_0x9b45('0x38')]['includeAll']){_0x4fdf5e[_0x9b45('0x48')]=[{'all':!![]}];}_0x4fdf5e=_[_0x9b45('0x45')]({},_0x4fdf5e,_0xc792b9[_0x9b45('0x4c')]);return db['ChatWebsite'][_0x9b45('0x4d')](_0x4fdf5e)[_0x9b45('0x13')](handleEntityNotFound(_0x23038d,null))[_0x9b45('0x13')](respondWithResult(_0x23038d,null))[_0x9b45('0x1d')](handleError(_0x23038d,null));};exports[_0x9b45('0x4e')]=function(_0x171e3b,_0x1d6950){return db[_0x9b45('0x32')][_0x9b45('0x4e')](_0x171e3b['body'],{})[_0x9b45('0x13')](function(_0x4ca017){var _0x4f5c37=_0x171e3b[_0x9b45('0x4f')][_0x9b45('0x29')]({'plain':!![]});if(!_0x4f5c37)throw new Error(_0x9b45('0x50'));if(_0x4f5c37[_0x9b45('0x51')]===_0x9b45('0x4f')){var _0x15f478=_0x4ca017['get']({'plain':!![]});var _0x1d72aa='ChatWebsites';return db['UserProfileSection'][_0x9b45('0x4d')]({'where':{'name':_0x1d72aa,'userProfileId':_0x4f5c37[_0x9b45('0x52')]},'raw':!![]})[_0x9b45('0x13')](function(_0x1febd0){if(_0x1febd0&&_0x1febd0[_0x9b45('0x53')]===0x0){return db[_0x9b45('0x2b')][_0x9b45('0x4e')]({'name':_0x15f478[_0x9b45('0x2d')],'resourceId':_0x15f478['id'],'type':_0x1febd0[_0x9b45('0x2d')],'sectionId':_0x1febd0['id']},{})['then'](function(){return _0x4ca017;});}else{return _0x4ca017;}})[_0x9b45('0x1d')](function(_0x2e8989){logger[_0x9b45('0x1a')](_0x9b45('0x54'),_0x2e8989);throw _0x2e8989;});}return _0x4ca017;})[_0x9b45('0x13')](respondWithResult(_0x1d6950,0xc9))[_0x9b45('0x1d')](handleError(_0x1d6950,null));};exports[_0x9b45('0x27')]=function(_0x163407,_0x54bfb0){if(_0x163407[_0x9b45('0x55')]['id']){delete _0x163407[_0x9b45('0x55')]['id'];}return db['ChatWebsite'][_0x9b45('0x4d')]({'where':{'id':_0x163407[_0x9b45('0x4a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x54bfb0,null))[_0x9b45('0x13')](saveUpdates(_0x163407['body'],null))[_0x9b45('0x13')](respondWithResult(_0x54bfb0,null))[_0x9b45('0x1d')](handleError(_0x54bfb0,null));};exports[_0x9b45('0x28')]=function(_0x41d100,_0x588fd6){return db[_0x9b45('0x32')][_0x9b45('0x4d')]({'where':{'id':_0x41d100[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x588fd6,null))[_0x9b45('0x13')](removeEntity(_0x588fd6,null))[_0x9b45('0x1d')](handleError(_0x588fd6,null));};exports[_0x9b45('0x56')]=function(_0x5e6a1a,_0x5c210e){return db[_0x9b45('0x32')]['describe']()['then'](respondWithResult(_0x5c210e,null))[_0x9b45('0x1d')](handleError(_0x5c210e,null));};exports[_0x9b45('0x57')]=function(_0xaf9e47,_0x2d2a07){if(_0xaf9e47[_0x9b45('0x55')]['id']){delete _0xaf9e47[_0x9b45('0x55')]['id'];}return db[_0x9b45('0x32')][_0x9b45('0x4d')]({'where':{'id':_0xaf9e47['params']['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x2d2a07,null))['then'](function(_0x2b15b4){if(_0x2b15b4){_0xaf9e47[_0x9b45('0x55')][_0x9b45('0x58')]=_0x2b15b4['id'];return db[_0x9b45('0x59')][_0x9b45('0x4e')](_0xaf9e47[_0x9b45('0x55')]);}})[_0x9b45('0x13')](respondWithResult(_0x2d2a07,null))[_0x9b45('0x1d')](handleError(_0x2d2a07,null));};exports[_0x9b45('0x5a')]=function(_0x25164f,_0x1adcc9){var _0x2a6eff={'raw':![],'where':{}};var _0x43a4d6={};var _0x1793bf={'count':0x0,'rows':[]};return db[_0x9b45('0x32')][_0x9b45('0x5b')]({'where':{'id':_0x25164f[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x1adcc9,null))[_0x9b45('0x13')](function(_0x1ef8dd){if(_0x1ef8dd){_0x43a4d6[_0x9b45('0x36')]=_[_0x9b45('0x37')](db['Disposition'][_0x9b45('0x33')]);_0x43a4d6[_0x9b45('0x38')]=_['keys'](_0x25164f['query']);_0x43a4d6['filters']=_['intersection'](_0x43a4d6[_0x9b45('0x36')],_0x43a4d6[_0x9b45('0x38')]);_0x2a6eff[_0x9b45('0x3b')]=_[_0x9b45('0x39')](_0x43a4d6[_0x9b45('0x36')],qs['fields'](_0x25164f[_0x9b45('0x38')][_0x9b45('0x3a')]));_0x2a6eff[_0x9b45('0x3b')]=_0x2a6eff[_0x9b45('0x3b')][_0x9b45('0x4b')]?_0x2a6eff['attributes']:_0x43a4d6['model'];if(!_0x25164f[_0x9b45('0x38')][_0x9b45('0x3c')]('nolimit')){_0x2a6eff[_0x9b45('0x3e')]=qs[_0x9b45('0x3e')](_0x25164f[_0x9b45('0x38')]['limit']);_0x2a6eff[_0x9b45('0x21')]=qs['offset'](_0x25164f[_0x9b45('0x38')][_0x9b45('0x21')]);}_0x2a6eff['order']=qs[_0x9b45('0x40')](_0x25164f[_0x9b45('0x38')][_0x9b45('0x40')]);_0x2a6eff[_0x9b45('0x41')]=qs['filters'](_[_0x9b45('0x43')](_0x25164f['query'],_0x43a4d6['filters']));_0x2a6eff['where']['ChatWebsiteId']=_0x1ef8dd['id'];if(_0x25164f[_0x9b45('0x38')]['filter']){_0x2a6eff['where']=_[_0x9b45('0x45')](_0x2a6eff[_0x9b45('0x41')],{'$or':_[_0x9b45('0x31')](_0x2a6eff['attributes'],function(_0x1873f5){var _0x59d926={};_0x59d926[_0x1873f5]={'$like':'%'+_0x25164f['query']['filter']+'%'};return _0x59d926;})});}_0x2a6eff=_[_0x9b45('0x45')]({},_0x2a6eff,_0x25164f[_0x9b45('0x4c')]);return db[_0x9b45('0x59')]['count']({'where':_0x2a6eff[_0x9b45('0x41')]})['then'](function(_0xde67f0){_0x1793bf[_0x9b45('0x23')]=_0xde67f0;if(_0x25164f['query']['includeAll']){_0x2a6eff[_0x9b45('0x48')]=[{'all':!![]}];}return db['Disposition'][_0x9b45('0x49')](_0x2a6eff);})[_0x9b45('0x13')](function(_0x53ba6c){_0x1793bf[_0x9b45('0x5c')]=_0x53ba6c;return _0x1793bf;});}})[_0x9b45('0x13')](respondWithFilteredResult(_0x1adcc9,_0x2a6eff))['catch'](handleError(_0x1adcc9,null));};exports[_0x9b45('0x5d')]=function(_0x5dc209,_0x2023c9){return db[_0x9b45('0x32')][_0x9b45('0x4d')]({'where':{'id':_0x5dc209[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x2023c9,null))[_0x9b45('0x13')](function(_0x11e371){if(_0x11e371){return _0x11e371[_0x9b45('0x5d')](_0x5dc209[_0x9b45('0x38')][_0x9b45('0x5e')]);}})[_0x9b45('0x13')](respondWithStatusCode(_0x2023c9,null))[_0x9b45('0x1d')](handleError(_0x2023c9,null));};exports['addAnswer']=function(_0x4e5704,_0x21cce0){if(_0x4e5704[_0x9b45('0x55')]['id']){delete _0x4e5704[_0x9b45('0x55')]['id'];}return db[_0x9b45('0x32')]['find']({'where':{'id':_0x4e5704[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x21cce0,null))[_0x9b45('0x13')](function(_0x1dbdfc){if(_0x1dbdfc){_0x4e5704['body'][_0x9b45('0x58')]=_0x1dbdfc['id'];return db[_0x9b45('0x5f')][_0x9b45('0x4e')](_0x4e5704['body']);}})['then'](respondWithResult(_0x21cce0,null))[_0x9b45('0x1d')](handleError(_0x21cce0,null));};exports['getAnswers']=function(_0x2b493e,_0x33bae3){var _0x91609b={'raw':![],'where':{}};var _0x121abd={};var _0x25369f={'count':0x0,'rows':[]};return db[_0x9b45('0x32')][_0x9b45('0x5b')]({'where':{'id':_0x2b493e[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x33bae3,null))[_0x9b45('0x13')](function(_0x1a7f4f){if(_0x1a7f4f){_0x121abd[_0x9b45('0x36')]=_[_0x9b45('0x37')](db[_0x9b45('0x5f')][_0x9b45('0x33')]);_0x121abd[_0x9b45('0x38')]=_['keys'](_0x2b493e[_0x9b45('0x38')]);_0x121abd['filters']=_[_0x9b45('0x39')](_0x121abd['model'],_0x121abd[_0x9b45('0x38')]);_0x91609b[_0x9b45('0x3b')]=_['intersection'](_0x121abd[_0x9b45('0x36')],qs[_0x9b45('0x3a')](_0x2b493e[_0x9b45('0x38')][_0x9b45('0x3a')]));_0x91609b[_0x9b45('0x3b')]=_0x91609b[_0x9b45('0x3b')][_0x9b45('0x4b')]?_0x91609b[_0x9b45('0x3b')]:_0x121abd['model'];if(!_0x2b493e[_0x9b45('0x38')][_0x9b45('0x3c')](_0x9b45('0x3d'))){_0x91609b[_0x9b45('0x3e')]=qs[_0x9b45('0x3e')](_0x2b493e[_0x9b45('0x38')][_0x9b45('0x3e')]);_0x91609b['offset']=qs[_0x9b45('0x21')](_0x2b493e['query'][_0x9b45('0x21')]);}_0x91609b[_0x9b45('0x3f')]=qs[_0x9b45('0x40')](_0x2b493e[_0x9b45('0x38')][_0x9b45('0x40')]);_0x91609b[_0x9b45('0x41')]=qs[_0x9b45('0x42')](_[_0x9b45('0x43')](_0x2b493e['query'],_0x121abd[_0x9b45('0x42')]));_0x91609b['where'][_0x9b45('0x58')]=_0x1a7f4f['id'];if(_0x2b493e[_0x9b45('0x38')]['filter']){_0x91609b['where']=_[_0x9b45('0x45')](_0x91609b[_0x9b45('0x41')],{'$or':_[_0x9b45('0x31')](_0x91609b['attributes'],function(_0x519a86){var _0x8c11ce={};_0x8c11ce[_0x519a86]={'$like':'%'+_0x2b493e['query'][_0x9b45('0x44')]+'%'};return _0x8c11ce;})});}_0x91609b=_[_0x9b45('0x45')]({},_0x91609b,_0x2b493e[_0x9b45('0x4c')]);return db[_0x9b45('0x5f')]['count']({'where':_0x91609b['where']})[_0x9b45('0x13')](function(_0x27f8a3){_0x25369f['count']=_0x27f8a3;if(_0x2b493e[_0x9b45('0x38')][_0x9b45('0x47')]){_0x91609b[_0x9b45('0x48')]=[{'all':!![]}];}return db[_0x9b45('0x5f')][_0x9b45('0x49')](_0x91609b);})['then'](function(_0x8a505c){_0x25369f[_0x9b45('0x5c')]=_0x8a505c;return _0x25369f;});}})[_0x9b45('0x13')](respondWithFilteredResult(_0x33bae3,_0x91609b))[_0x9b45('0x1d')](handleError(_0x33bae3,null));};exports[_0x9b45('0x60')]=function(_0xc09fe3,_0x57c399){return db['ChatWebsite'][_0x9b45('0x4d')]({'where':{'id':_0xc09fe3['params']['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x57c399,null))[_0x9b45('0x13')](function(_0x5f1305){if(_0x5f1305){return _0x5f1305[_0x9b45('0x60')](_0xc09fe3[_0x9b45('0x38')][_0x9b45('0x5e')]);}})[_0x9b45('0x13')](respondWithStatusCode(_0x57c399,null))[_0x9b45('0x1d')](handleError(_0x57c399,null));};exports[_0x9b45('0x61')]=function(_0x2a29e3,_0x3ce27b){_0x2a29e3[_0x9b45('0x55')][_0x9b45('0x62')]=_0x2a29e3[_0x9b45('0x63')][_0x9b45('0x64')];return db['ChatWebsite']['find']({'where':{'id':_0x2a29e3[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x3ce27b,null))['then'](saveUpdates(_0x2a29e3[_0x9b45('0x55')],null))[_0x9b45('0x13')](respondWithResult(_0x3ce27b,null))[_0x9b45('0x1d')](handleError(_0x3ce27b,null));};exports[_0x9b45('0x65')]=function(_0x43fe40,_0xa1c1d3){_0x43fe40[_0x9b45('0x55')][_0x9b45('0x66')]=_0x43fe40['file'][_0x9b45('0x64')];return db[_0x9b45('0x32')]['find']({'where':{'id':_0x43fe40[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0xa1c1d3,null))[_0x9b45('0x13')](saveUpdates(_0x43fe40[_0x9b45('0x55')],null))['then'](respondWithResult(_0xa1c1d3,null))['catch'](handleError(_0xa1c1d3,null));};exports['addCustomerAvatar']=function(_0x44f80d,_0x19a0ff){_0x44f80d['body'][_0x9b45('0x67')]=_0x44f80d[_0x9b45('0x63')]['filename'];return db[_0x9b45('0x32')][_0x9b45('0x4d')]({'where':{'id':_0x44f80d[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x19a0ff,null))[_0x9b45('0x13')](saveUpdates(_0x44f80d[_0x9b45('0x55')],null))['then'](respondWithResult(_0x19a0ff,null))[_0x9b45('0x1d')](handleError(_0x19a0ff,null));};exports[_0x9b45('0x68')]=function(_0x30ed42,_0x1b5035){_0x30ed42[_0x9b45('0x55')][_0x9b45('0x69')]=_0x30ed42[_0x9b45('0x63')][_0x9b45('0x64')];return db['ChatWebsite'][_0x9b45('0x4d')]({'where':{'id':_0x30ed42['params']['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x1b5035,null))[_0x9b45('0x13')](saveUpdates(_0x30ed42['body'],null))[_0x9b45('0x13')](respondWithResult(_0x1b5035,null))[_0x9b45('0x1d')](handleError(_0x1b5035,null));};exports['getLogo']=function(_0x545c28,_0x4672c5){var _0x16c788=path[_0x9b45('0x6a')](config[_0x9b45('0x6b')],'server/files/images/logos/default_logo.svg');var _0x1581cf={'where':{'id':_0x545c28[_0x9b45('0x4a')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x536dee=![];return require('../../config/license/util')[_0x9b45('0x6c')]()[_0x9b45('0x13')](function(_0x4c2b8a){if(_0x4c2b8a){_0x536dee=_0x4c2b8a[_0x9b45('0x6d')];}})['then'](function(){return db[_0x9b45('0x32')][_0x9b45('0x4d')](_0x1581cf);})[_0x9b45('0x13')](handleEntityNotFound(_0x4672c5,null))['then'](function(_0x1f979f){if(_0x1f979f){if(!_[_0x9b45('0x6e')](_0x1f979f[_0x9b45('0x62')])){if(fs[_0x9b45('0x6f')](path[_0x9b45('0x6a')](config[_0x9b45('0x6b')],_0x9b45('0x70'),_0x1f979f[_0x9b45('0x62')]))&&_0x536dee){_0x16c788=path['join'](config['root'],_0x9b45('0x70'),_0x1f979f[_0x9b45('0x62')]);}}return _0x4672c5[_0x9b45('0x71')](_0x16c788);}})[_0x9b45('0x1d')](handleError(_0x4672c5,null));};exports[_0x9b45('0x72')]=function(_0x31fc4e,_0x25a50d){var _0x83109c=path[_0x9b45('0x6a')](config[_0x9b45('0x6b')],_0x9b45('0x73'));var _0x35daaf={'where':{'id':_0x31fc4e[_0x9b45('0x4a')]['id']},'attributes':['id',_0x9b45('0x66')],'raw':!![]};return db[_0x9b45('0x32')][_0x9b45('0x4d')](_0x35daaf)[_0x9b45('0x13')](handleEntityNotFound(_0x25a50d,null))[_0x9b45('0x13')](function(_0x3587ac){if(_0x3587ac){if(!_[_0x9b45('0x6e')](_0x3587ac[_0x9b45('0x66')])){if(fs['existsSync'](path[_0x9b45('0x6a')](config['root'],_0x9b45('0x74'),_0x3587ac[_0x9b45('0x66')]))){_0x83109c=path['join'](config[_0x9b45('0x6b')],_0x9b45('0x74'),_0x3587ac['agentAvatar']);}}return _0x25a50d[_0x9b45('0x71')](_0x83109c);}})[_0x9b45('0x1d')](handleError(_0x25a50d,null));};exports['getCustomerAvatar']=function(_0x1b9ef3,_0x2569eb){var _0x2bdcd2=path[_0x9b45('0x6a')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x94b3cd={'where':{'id':_0x1b9ef3[_0x9b45('0x4a')]['id']},'attributes':['id',_0x9b45('0x67'),_0x9b45('0x75')],'raw':!![]};return db[_0x9b45('0x32')][_0x9b45('0x4d')](_0x94b3cd)[_0x9b45('0x13')](handleEntityNotFound(_0x2569eb,null))['then'](function(_0x5b0a02){if(_0x5b0a02){if(!_[_0x9b45('0x6e')](_0x5b0a02[_0x9b45('0x67')])){if(fs[_0x9b45('0x6f')](path['join'](config[_0x9b45('0x6b')],'server/files/images/avatars/',_0x5b0a02[_0x9b45('0x67')]))&&_0x5b0a02['showCustomerAvatar']){_0x2bdcd2=path[_0x9b45('0x6a')](config[_0x9b45('0x6b')],_0x9b45('0x74'),_0x5b0a02[_0x9b45('0x67')]);}}return _0x2569eb[_0x9b45('0x71')](_0x2bdcd2);}})[_0x9b45('0x1d')](handleError(_0x2569eb,null));};exports['getSystemAvatar']=function(_0x44dd71,_0x55d308){var _0x59cb0c=path['join'](config[_0x9b45('0x6b')],_0x9b45('0x76'));var _0xb37c4e={'where':{'id':_0x44dd71[_0x9b45('0x4a')]['id']},'attributes':['id',_0x9b45('0x69')],'raw':!![]};return db[_0x9b45('0x32')][_0x9b45('0x4d')](_0xb37c4e)[_0x9b45('0x13')](handleEntityNotFound(_0x55d308,null))[_0x9b45('0x13')](function(_0x9e5ca8){if(_0x9e5ca8){if(!_[_0x9b45('0x6e')](_0x9e5ca8[_0x9b45('0x69')])){if(fs[_0x9b45('0x6f')](path[_0x9b45('0x6a')](config['root'],_0x9b45('0x74'),_0x9e5ca8[_0x9b45('0x69')]))){_0x59cb0c=path[_0x9b45('0x6a')](config[_0x9b45('0x6b')],_0x9b45('0x74'),_0x9e5ca8[_0x9b45('0x69')]);}}return _0x55d308['download'](_0x59cb0c);}})['catch'](handleError(_0x55d308,null));};exports[_0x9b45('0x77')]=function(_0x206859,_0x72f26b){var _0x49a3d8=require(_0x9b45('0x78'));var _0x1ffe3a=new _0x49a3d8();var _0x2fe68d=_0x1ffe3a[_0x9b45('0x79')](_0x206859[_0x9b45('0x7a')][_0x9b45('0x7b')])[_0x9b45('0x7c')]();var _0x159b79={'body':_0x206859['body'],'channel':_0x9b45('0x7d')};var _0x3f6fdd=[];var _0x5bf3a1=[];var _0x369459={};var _0x33ea69=![];return db[_0x9b45('0x7e')]['describe']()[_0x9b45('0x13')](function(_0x52f565){if(!_0x52f565){throw new db[(_0x9b45('0x7f'))][(_0x9b45('0x80'))](_0x9b45('0x81'));}_0x3f6fdd=_['difference'](_['keys'](_0x52f565),['createdAt','updatedAt']);_0x5bf3a1=_[_0x9b45('0x82')](_[_0x9b45('0x37')](_0x52f565),[_0x9b45('0x83'),_0x9b45('0x84'),'CompanyId','ListId']);if(_0x206859[_0x9b45('0x55')]['id']){delete _0x206859[_0x9b45('0x55')]['id'];}if(_[_0x9b45('0x6e')](_0x206859['body'][_0x9b45('0x85')])){throw new db[(_0x9b45('0x7f'))][(_0x9b45('0x80'))]('from\x20is\x20mandatory');}if(_[_0x9b45('0x6e')](_0x206859[_0x9b45('0x55')][_0x9b45('0x55')])||_0x206859[_0x9b45('0x55')][_0x9b45('0x55')]===''){throw new db[(_0x9b45('0x7f'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9b45('0x6e')](_0x206859['body'][_0x9b45('0x86')])){throw new db[(_0x9b45('0x7f'))][(_0x9b45('0x80'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5bf3a1);}if(!_[_0x9b45('0x87')](_0x5bf3a1,_0x206859[_0x9b45('0x55')][_0x9b45('0x86')])){throw new db['Sequelize'][(_0x9b45('0x80'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5bf3a1);}_0x369459[_0x206859['body'][_0x9b45('0x86')]]=_0x206859[_0x9b45('0x55')][_0x9b45('0x85')];})['then'](function(){return db[_0x9b45('0x32')][_0x9b45('0x4d')]({'where':{'id':_0x206859['params']['id']},'include':[{'model':db[_0x9b45('0x88')],'as':'List','include':[{'model':db[_0x9b45('0x7e')],'as':_0x9b45('0x89'),'where':_0x369459,'limit':0x1,'order':[['updatedAt',_0x9b45('0x8a')]]}]},{'model':db[_0x9b45('0x8b')],'as':_0x9b45('0x8c')}]});})[_0x9b45('0x13')](handleEntityNotFound(_0x72f26b,null))[_0x9b45('0x13')](function(_0x48ffeb){if(_0x48ffeb&&_0x48ffeb[_0x9b45('0x8d')]){_0x159b79[_0x9b45('0x8e')]=_0x48ffeb;_0x159b79['applications']=_0x48ffeb['Applications'];_0x159b79[_0x9b45('0x8f')]=_0x48ffeb['List'];_0x159b79[_0x9b45('0x90')]=_[_0x9b45('0x91')](_0x159b79[_0x9b45('0x90')],[_0x9b45('0x92')],['asc']);if(_0x159b79[_0x9b45('0x8e')][_0x9b45('0x8c')]){delete _0x159b79['account'][_0x9b45('0x8c')];}if(_0x159b79[_0x9b45('0x8e')][_0x9b45('0x8d')]&&_0x159b79[_0x9b45('0x8e')][_0x9b45('0x8d')][_0x9b45('0x89')][_0x9b45('0x4b')]){return _0x159b79[_0x9b45('0x8e')][_0x9b45('0x8d')]['Contacts'][0x0];}var _0x48589b=_[_0x9b45('0xb')](_0x206859[_0x9b45('0x55')],{'firstName':_0x206859[_0x9b45('0x55')]['from'],'ListId':_0x48ffeb[_0x9b45('0x93')]});_0x48589b[_0x206859[_0x9b45('0x55')]['mapKey']]=_0x206859[_0x9b45('0x55')][_0x9b45('0x85')];return db[_0x9b45('0x7e')][_0x9b45('0x4e')](_0x48589b,{'fields':_0x3f6fdd,'raw':!![]});}})[_0x9b45('0x13')](handleEntityNotFound(_0x72f26b,null))[_0x9b45('0x13')](function(_0x5e5c39){_0x159b79[_0x9b45('0x94')]=_0x5e5c39;var _0x47e4f9=_0x206859[_0x9b45('0x55')][_0x9b45('0x95')];if(_0x206859['headers'][_0x9b45('0x96')]){_0x47e4f9=_0x206859[_0x9b45('0x7a')][_0x9b45('0x96')];}else if(_0x206859[_0x9b45('0x7a')][_0x9b45('0x97')]){_0x47e4f9=_['first'](_0x206859[_0x9b45('0x7a')][_0x9b45('0x97')][_0x9b45('0x98')](','));}if(_0x5e5c39){var _0x4cc85e={'ContactId':_0x5e5c39['id'],'ChatWebsiteId':_0x206859[_0x9b45('0x4a')]['id'],'from':(_0x5e5c39[_0x9b45('0x99')]||'')+'\x20'+(_0x5e5c39['lastName']||''),'customerIp':_0x47e4f9,'customerPort':_0x206859[_0x9b45('0x7a')][_0x9b45('0x9a')]?_0x206859[_0x9b45('0x7a')][_0x9b45('0x9a')]:null,'referer':_0x206859[_0x9b45('0x55')]['referer'],'browserName':_0x2fe68d[_0x9b45('0x9b')]['name']&&_0x2fe68d['browser']['version']?util[_0x9b45('0x9c')](_0x9b45('0x9d'),_0x2fe68d[_0x9b45('0x9b')][_0x9b45('0x2d')],_0x2fe68d[_0x9b45('0x9b')][_0x9b45('0x9e')]):_0x9b45('0x9f'),'browserVersion':_0x2fe68d[_0x9b45('0x9b')][_0x9b45('0x9e')]||_0x9b45('0x9f'),'osName':util[_0x9b45('0x9c')](_0x9b45('0x9d'),_0x2fe68d['os'][_0x9b45('0x2d')],_0x2fe68d['os'][_0x9b45('0x9e')]),'osVersion':_0x2fe68d['os']['version'],'deviceModel':_0x2fe68d['device'][_0x9b45('0x36')]&&_0x2fe68d[_0x9b45('0xa0')][_0x9b45('0xa1')]?util[_0x9b45('0x9c')](_0x9b45('0xa2'),_0x2fe68d['device'][_0x9b45('0x36')],_0x2fe68d[_0x9b45('0xa0')]['vendor'],_0x2fe68d['device'][_0x9b45('0x35')]):null,'deviceVendor':_0x2fe68d[_0x9b45('0xa0')][_0x9b45('0xa1')],'deviceType':_0x2fe68d['device']['type'],'formData':JSON[_0x9b45('0x19')](_0x206859[_0x9b45('0x55')])};var _0x5939c2={'ChatWebsiteId':_0x206859[_0x9b45('0x4a')]['id'],'closed':![]};if(_0x206859['body'][_0x9b45('0xa3')]){_0x5939c2[_0x9b45('0xa3')]=_0x206859[_0x9b45('0x55')][_0x9b45('0xa3')];return db[_0x9b45('0xa4')][_0x9b45('0x4d')]({'where':_0x5939c2})['then'](function(_0x3b81f9){if(_0x3b81f9){return[_0x3b81f9,![]];}_0x4cc85e['threadId']=_0x206859[_0x9b45('0x55')][_0x9b45('0xa3')];_0x4cc85e[_0x9b45('0xa5')]=_0x206859[_0x9b45('0x55')][_0x9b45('0xa5')];return db['ChatInteraction'][_0x9b45('0x4e')](_0x4cc85e)[_0x9b45('0x13')](function(_0x36ba3c){return[_0x36ba3c,!![]];});});}_0x5939c2[_0x9b45('0xa6')]=_0x5e5c39['id'];if(_0x206859[_0x9b45('0x55')][_0x9b45('0xa7')]&&_0x206859[_0x9b45('0x55')][_0x9b45('0xa7')]['id']){_0x5939c2['id']=_0x206859[_0x9b45('0x55')][_0x9b45('0xa7')]['id'];return db[_0x9b45('0xa4')]['find']({'where':_0x5939c2})[_0x9b45('0x13')](function(_0x1118b5){if(_0x1118b5){return[_0x1118b5,![]];}return db[_0x9b45('0xa4')][_0x9b45('0x4e')](_0x4cc85e)['then'](function(_0x176ac2){return[_0x176ac2,!![]];});});}return db[_0x9b45('0xa4')][_0x9b45('0x4e')](_0x4cc85e)[_0x9b45('0x13')](function(_0x3c60a3){return[_0x3c60a3,!![]];});}})[_0x9b45('0xa8')](function(_0x301694,_0x46aa61){if(_0x301694){_0x33ea69=_0x46aa61;if(!_0x46aa61){var _0x1e86d5={'from':(_0x159b79[_0x9b45('0x94')][_0x9b45('0x99')]||'')+'\x20'+(_0x159b79[_0x9b45('0x94')]['lastName']||'')};if(_0x206859[_0x9b45('0x55')][_0x9b45('0xa3')]&&_0x206859[_0x9b45('0x55')][_0x9b45('0xa9')]&&_0x206859[_0x9b45('0x55')]['threadId']!=_0x206859['body'][_0x9b45('0xa9')]){_0x1e86d5['threadId']=_0x206859['body'][_0x9b45('0xa9')];}return _0x301694[_0x9b45('0x27')](_0x1e86d5);}else{return _0x301694;}}})[_0x9b45('0x13')](function(_0x1b9b17){_0x159b79[_0x9b45('0xa7')]=_0x1b9b17[_0x9b45('0x29')]({'plain':!![]});_0x159b79['interaction'][_0x9b45('0xaa')]=_0x33ea69;if(_0x159b79[_0x9b45('0xa7')][_0x9b45('0xaa')]){if(_0x159b79[_0x9b45('0x8e')][_0x9b45('0xab')]){_0x159b79[_0x9b45('0x90')]['push']({'id':0x0,'priority':_0x159b79[_0x9b45('0x90')]['length']+0x1,'app':'close','appdata':_0x9b45('0xac'),'interval':_0x9b45('0xad')});}}return db['ChatMessage'][_0x9b45('0x4e')]({'body':_0x206859[_0x9b45('0x55')][_0x9b45('0x55')],'ChatWebsiteId':_0x206859[_0x9b45('0x4a')]['id'],'ChatInteractionId':_0x1b9b17['id'],'direction':'in','ContactId':_0x159b79['contact']['id'],'AttachmentId':_0x206859[_0x9b45('0x55')][_0x9b45('0xae')]});})[_0x9b45('0x13')](function(_0x243099){_0x159b79[_0x9b45('0x1c')]=_0x243099;if(_0x159b79[_0x9b45('0xa7')][_0x9b45('0xaf')]){return db[_0x9b45('0xb0')]['find']({'attributes':['id',_0x9b45('0x2d')],'where':{'id':_0x159b79[_0x9b45('0xa7')][_0x9b45('0xaf')]}})[_0x9b45('0x13')](function(_0x20ebd2){if(_0x20ebd2){_0x159b79[_0x9b45('0x90')][_0x9b45('0xb1')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x20ebd2['name']+','+(_0x159b79[_0x9b45('0x8e')][_0x9b45('0xb2')]||0xa),'interval':_0x9b45('0xad')});_0x159b79[_0x9b45('0xb3')]=!![];}return respondWithRpcPromise(_0x9b45('0xb4'),_0x9b45('0xb5'),_0x159b79);});}return respondWithRpcPromise('Start',_0x9b45('0xb5'),_0x159b79);})[_0x9b45('0x13')](function(_0xc6f560){respondWithRpcPromise('EventManager',_0x9b45('0xb6'),{'event':_0x9b45('0x77'),'message':_0xc6f560},client9002);return _0xc6f560;})[_0x9b45('0x13')](respondWithResult(_0x72f26b,null))['catch'](handleError(_0x72f26b,null));};exports[_0x9b45('0xb7')]=function(_0xf73d01,_0x2c0582){var _0x5d74e7,_0x1dff5f,_0x2a14d6;var _0x737d2c=[];var _0x250756={};var _0x5d2877=_0xf73d01[_0x9b45('0xb8')]||[];var _0x4d5c29=[];var _0x3003f0;return db[_0x9b45('0x7e')][_0x9b45('0x56')]()['then'](function(_0x3c28b7){if(!_0x3c28b7){throw new db[(_0x9b45('0x7f'))]['ValidationError'](_0x9b45('0x81'));}_0x737d2c=_[_0x9b45('0x82')](_[_0x9b45('0x37')](_0x3c28b7),[_0x9b45('0x83'),_0x9b45('0x84'),_0x9b45('0xb9'),_0x9b45('0x93')]);if(_0xf73d01[_0x9b45('0x55')]['id']){delete _0xf73d01[_0x9b45('0x55')]['id'];}if(_[_0x9b45('0x6e')](_0xf73d01[_0x9b45('0x55')][_0x9b45('0x85')])){throw _0x2c0582['status'](0x1f4)[_0x9b45('0xba')](new db['Sequelize'][(_0x9b45('0x80'))](_0x9b45('0xbb')));}if(_[_0x9b45('0x6e')](_0xf73d01[_0x9b45('0x55')][_0x9b45('0x55')])||_0xf73d01[_0x9b45('0x55')][_0x9b45('0x55')]===''){throw _0x2c0582[_0x9b45('0x20')](0x1f4)['send'](new db[(_0x9b45('0x7f'))][(_0x9b45('0x80'))](_0x9b45('0xbc')));}if(_[_0x9b45('0x6e')](_0xf73d01[_0x9b45('0x55')][_0x9b45('0xbd')])){throw _0x2c0582[_0x9b45('0x20')](0x1f4)[_0x9b45('0xba')](new db[(_0x9b45('0x7f'))][(_0x9b45('0x80'))](_0x9b45('0xbe')+_0x737d2c));}if(!_['includes'](_0x737d2c,_0xf73d01[_0x9b45('0x55')]['mapKeyOffline'])){throw _0x2c0582[_0x9b45('0x20')](0x1f4)[_0x9b45('0xba')](new db[(_0x9b45('0x7f'))][(_0x9b45('0x80'))](_0x9b45('0xbf')+_0x737d2c));}_0x250756[_0xf73d01[_0x9b45('0x55')]['mapKeyOffline']]=_0xf73d01['body'][_0x9b45('0x85')];})[_0x9b45('0x13')](function(){return db[_0x9b45('0x32')][_0x9b45('0x4d')]({'where':{'id':_0xf73d01[_0x9b45('0x4a')]['id']},'include':[{'model':db[_0x9b45('0x88')],'as':_0x9b45('0x8d')},{'model':db[_0x9b45('0xc0')],'as':_0x9b45('0xc0')}]});})['then'](handleEntityNotFound(_0x2c0582,null))[_0x9b45('0x13')](function(_0x3a79ed){if(_0x3a79ed&&_0x3a79ed['List']){_0x1dff5f=_0x3a79ed;var _0xbc98e0=_[_0x9b45('0xb')](_0xf73d01[_0x9b45('0x55')],{'firstName':_0xf73d01[_0x9b45('0x55')][_0x9b45('0x85')],'phone':_0xf73d01[_0x9b45('0x55')][_0x9b45('0x85')],'ListId':_0x3a79ed[_0x9b45('0x93')]});_0xbc98e0[_0xf73d01['body'][_0x9b45('0xbd')]]=_0xf73d01['body'][_0x9b45('0x85')];return db[_0x9b45('0x7e')][_0x9b45('0xc1')]({'where':_0x250756,'defaults':_0xbc98e0});}})[_0x9b45('0xa8')](function(_0x2391ad){if(_0x2391ad){_0x2a14d6=_0x2391ad;var _0x433aa2=fs['readFileSync'](path[_0x9b45('0x6a')](config[_0x9b45('0x6b')],_0x9b45('0xc2')),_0x9b45('0xc3'));var _0x4926ff=ejs[_0x9b45('0xc4')](_0x433aa2,{'body':_[_0x9b45('0xc5')](_0xf73d01[_0x9b45('0x55')][_0x9b45('0x55')]),'bodyTitle':_0x1dff5f[_0x9b45('0xc6')]});return db[_0x9b45('0xc7')][_0x9b45('0x4e')]({'body':_0x4926ff,'plainBody':htmlToText[_0x9b45('0xc8')](_0x4926ff),'ContactId':_0x2391ad['id'],'ChatWebsiteId':_0x1dff5f['id']});}})[_0x9b45('0x13')](function(_0x57b4ac){_0x3003f0=_0x57b4ac;if(_0x5d2877[_0x9b45('0x4b')]){var _0x49964f=_0x5d2877[_0x9b45('0x31')](function(_0x53633f){return{'name':_0x53633f[_0x9b45('0xc9')],'basename':_0x53633f[_0x9b45('0x64')],'type':_0x53633f[_0x9b45('0xca')],'ChatOfflineMessageId':_0x57b4ac['id']};});_0x4d5c29=_0x49964f[_0x9b45('0x31')](_0x5922f1=>{var _0x8aebbd={'filename':_0x5922f1[_0x9b45('0x2d')],'path':path[_0x9b45('0x6a')](config[_0x9b45('0x6b')],_0x9b45('0xcb'),_0x9b45('0xb8'),'attachments',_0x9b45('0xcc'),_0x5922f1[_0x9b45('0xcd')])};return _0x8aebbd;});if(!_0x1dff5f['openNewInteraction']){return db[_0x9b45('0xce')][_0x9b45('0xcf')](function(_0x54317d){return db['Attachment'][_0x9b45('0xd0')](_0x49964f,{'transaction':_0x54317d});});}}})[_0x9b45('0x13')](function(){if(_0x3003f0){_0x5d74e7=_0x3003f0;return db[_0x9b45('0xc0')][_0x9b45('0x5b')]({'where':{'service':!![]},'include':[{'model':db[_0x9b45('0xd1')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x9b45('0xd2')],'as':_0x9b45('0xd2'),'raw':!![]}]}]});}})[_0x9b45('0x13')](function(_0x70ca88){if(_0x70ca88&&_0x70ca88[_0x9b45('0xd3')]&&_0x1dff5f[_0x9b45('0xd4')]&&_0x1dff5f[_0x9b45('0xd5')]){var _0x1f4b83=_0x70ca88[_0x9b45('0xd6')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x1f4b83,'message':{'from':util['format'](_0x9b45('0xd7'),_0x70ca88['name'],_0x70ca88[_0x9b45('0xd8')]||_0x70ca88[_0x9b45('0xd3')][_0x9b45('0x4f')]),'to':_0x1dff5f[_0x9b45('0xd5')],'subject':_0x1dff5f['offlineMessageSubject'],'html':_0x5d74e7[_0x9b45('0x55')],'attachments':_0x4d5c29}},client9003)[_0x9b45('0x13')](function(){return _0x5d74e7;})['catch'](function(_0x37bf77){logger['error'](_0x37bf77);});}})[_0x9b45('0x13')](function(){if(_0x1dff5f&&_0x1dff5f[_0x9b45('0xd9')]&&_0x1dff5f['MailAccountId']){var _0x28bc4d=[];if(_0x5d2877[_0x9b45('0x4b')]){_0x28bc4d=_0x5d2877[_0x9b45('0x31')](function(_0x437355){return{'name':_0x437355[_0x9b45('0xc9')],'basename':_0x437355[_0x9b45('0x64')],'type':_0x437355[_0x9b45('0xca')],'ChatOfflineMessageId':_0x3003f0['id']};});}var _0x3faba6;if(!_['isNil'](_0x1dff5f[_0x9b45('0xda')])){var _0x5aa1ad=_[_0x9b45('0x31')](_0xf73d01['body'],function(_0x19c228){return _0x19c228;});var _0x17fa2b=_[_0x9b45('0xdb')](_0x5aa1ad)[0x0];var _0x531d62=_[_0x9b45('0xdc')](_0x17fa2b,function(_0x4ad9ce){return _0x4ad9ce;});_0x3faba6=_0x531d62[0x1][_0x1dff5f[_0x9b45('0xda')]];}var _0x3a0c07={'from':_0x2a14d6[_0x9b45('0xd8')],'firstName':_0x2a14d6[_0x9b45('0x99')],'lastName':_0x2a14d6[_0x9b45('0xdd')],'mapKey':_0x9b45('0xd8'),'message':{'from':_0x2a14d6[_0x9b45('0xd8')],'to':_0x1dff5f[_0x9b45('0xc0')]['email'],'cc':'','subject':_[_0x9b45('0x6e')](_0x3faba6)?_0x1dff5f[_0x9b45('0xde')]:_0x3faba6,'messageId':'','sentAt':new Date(),'attach':_0x28bc4d[_0x9b45('0x4b')],'attachments':_0x28bc4d,'originChannel':_0x9b45('0xdf'),'ChatWebsiteId':_0x1dff5f['id'],'ChatOfflineMessageId':_0x5d74e7['id'],'originTo':_0x1dff5f[_0x9b45('0xc0')][_0x9b45('0xd8')]},'body':_0x5d74e7['body']};var _0x511521={'account':{'id':_0x1dff5f['MailAccountId']},'body':_0x3a0c07,'log':_0x9b45('0xe0')};return respondWithRpcPromise(_0x9b45('0xe0'),_0x9b45('0xe1'),_0x511521,client9001)[_0x9b45('0x13')](function(){return _0x5d74e7;})[_0x9b45('0x1d')](function(_0x368721){logger[_0x9b45('0x1a')](_0x368721);});}return;})['then'](function(){if(_0x5d74e7){return _0x5d74e7;}})[_0x9b45('0x13')](respondWithResult(_0x2c0582,null))['catch'](function(_0x1c6e04){logger[_0x9b45('0x1a')](_0x9b45('0x1d'),_0x1c6e04);for(var _0x1e04aa of _0x5d2877){var _0x2fc113=path[_0x9b45('0x6a')](config['root'],_0x9b45('0xcb'),_0x9b45('0xb8'),_0x9b45('0xe2'),'offline-chat',_0x1e04aa[_0x9b45('0x64')]);fs_extra[_0x9b45('0xe3')](_0x2fc113)['catch'](function(_0x23856f){logger['error'](_0x9b45('0xe4'),_0x2fc113,_0x23856f);});}});};exports[_0x9b45('0xe5')]=function(_0x4c527f,_0x12ab76){return db[_0x9b45('0xa4')]['find']({'where':{'id':_0x4c527f[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x12ab76,null))['then'](function(_0x35f070){if(_0x35f070){return _0x35f070[_0x9b45('0xe5')](_0x4c527f[_0x9b45('0x55')][_0x9b45('0x5e')],_[_0x9b45('0xe6')](_0x4c527f[_0x9b45('0x55')],[_0x9b45('0x5e'),'id'])||{});}})[_0x9b45('0x13')](respondWithResult(_0x12ab76,null))[_0x9b45('0x1d')](handleError(_0x12ab76,null));};exports[_0x9b45('0xe7')]=function(_0x11a0e3,_0x316ed6){var _0x21383b={'raw':![],'where':{}};var _0x439c2b={};var _0x317521={'count':0x0,'rows':[]};return db[_0x9b45('0x32')][_0x9b45('0x5b')]({'where':{'id':_0x11a0e3[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x316ed6,null))['then'](function(_0x6af30e){if(_0x6af30e){_0x439c2b[_0x9b45('0x36')]=_[_0x9b45('0x37')](db[_0x9b45('0xa4')][_0x9b45('0x33')]);_0x439c2b[_0x9b45('0x38')]=_[_0x9b45('0x37')](_0x11a0e3[_0x9b45('0x38')]);_0x439c2b[_0x9b45('0x42')]=_[_0x9b45('0x39')](_0x439c2b[_0x9b45('0x36')],_0x439c2b[_0x9b45('0x38')]);_0x21383b[_0x9b45('0x3b')]=_[_0x9b45('0x39')](_0x439c2b[_0x9b45('0x36')],qs[_0x9b45('0x3a')](_0x11a0e3['query'][_0x9b45('0x3a')]));_0x21383b['attributes']=_0x21383b[_0x9b45('0x3b')][_0x9b45('0x4b')]?_0x21383b['attributes']:_0x439c2b['model'];if(!_0x11a0e3[_0x9b45('0x38')][_0x9b45('0x3c')](_0x9b45('0x3d'))){_0x21383b['limit']=qs[_0x9b45('0x3e')](_0x11a0e3[_0x9b45('0x38')][_0x9b45('0x3e')]);_0x21383b[_0x9b45('0x21')]=qs[_0x9b45('0x21')](_0x11a0e3[_0x9b45('0x38')]['offset']);}_0x21383b[_0x9b45('0x3f')]=qs['sort'](_0x11a0e3[_0x9b45('0x38')][_0x9b45('0x40')]);_0x21383b[_0x9b45('0x41')]=qs[_0x9b45('0x42')](_['pick'](_0x11a0e3[_0x9b45('0x38')],_0x439c2b[_0x9b45('0x42')]));_0x21383b[_0x9b45('0x41')][_0x9b45('0x58')]=_0x6af30e['id'];if(_0x11a0e3[_0x9b45('0x38')][_0x9b45('0x44')]){_0x21383b[_0x9b45('0x41')]=_[_0x9b45('0x45')](_0x21383b[_0x9b45('0x41')],{'$or':_[_0x9b45('0x31')](_0x21383b['attributes'],function(_0x8dd2e4){var _0x42cfab={};_0x42cfab[_0x8dd2e4]={'$like':'%'+_0x11a0e3[_0x9b45('0x38')][_0x9b45('0x44')]+'%'};return _0x42cfab;})});}_0x21383b=_['merge']({},_0x21383b,_0x11a0e3[_0x9b45('0x4c')]);return db[_0x9b45('0xa4')][_0x9b45('0x23')]({'where':_0x21383b[_0x9b45('0x41')]})['then'](function(_0x743100){_0x317521['count']=_0x743100;if(_0x11a0e3[_0x9b45('0x38')]['includeAll']){_0x21383b[_0x9b45('0x48')]=[{'model':db[_0x9b45('0x7e')],'as':'Contact','required':![]},{'model':db[_0x9b45('0xb0')],'as':_0x9b45('0xe8'),'attributes':[_0x9b45('0x2d'),_0x9b45('0xe9'),_0x9b45('0xea')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x9b45('0x2d'),_0x9b45('0xeb')],'where':_0x11a0e3['query']['tag']?{'id':_0x11a0e3[_0x9b45('0x38')]['tag']}:undefined,'required':_0x11a0e3[_0x9b45('0x38')][_0x9b45('0xec')]?!![]:![]}];}return db[_0x9b45('0xa4')][_0x9b45('0x49')](_0x21383b);})[_0x9b45('0x13')](function(_0x3249d1){_0x317521[_0x9b45('0x5c')]=_0x3249d1;return _0x317521;});}})[_0x9b45('0x13')](respondWithFilteredResult(_0x316ed6,_0x21383b))['catch'](handleError(_0x316ed6,null));};function iftimePromise(_0x966391,_0x5230f6){return respondWithRpcPromise(_0x9b45('0xed'),_0x9b45('0xee'),{'command':_0x5230f6[_0x9b45('0xef')]?util[_0x9b45('0x9c')](_0x9b45('0xf0'),_0x966391[_0x9b45('0xf1')],_0x5230f6[_0x9b45('0xef')]):util['format'](_0x9b45('0xf2'),_0x966391['interval'])},client9002)[_0x9b45('0x13')](function(_0x3f9b3d){var _0x96e998=_0x3f9b3d&&_0x3f9b3d['indexOf']('true')>=0x0?!![]:![];logger[_0x9b45('0x14')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5230f6['id'],_0x966391['id'],_0x966391[_0x9b45('0xf1')],_0x96e998?_0x9b45('0xf3'):_0x9b45('0xf4'),_0x5230f6['timezone']?_0x5230f6[_0x9b45('0xef')]:'No\x20timezone');return _0x96e998;})['catch'](function(_0x47327b){logger[_0x9b45('0x1a')](_0x9b45('0xf5'),_0x5230f6['id'],_0x966391['id'],_0x966391['interval'],util[_0x9b45('0xf6')](_0x47327b,{'showHidden':![],'depth':null}),_0x5230f6[_0x9b45('0xef')]?_0x5230f6[_0x9b45('0xef')]:_0x9b45('0xf7'));return![];});}exports['getSnippet']=function(_0x5b368,_0x202f02){var _0x210541=0x0;var _0x21ad41=0x0;var _0x244cf0=![];var _0x74ea01;var _0x44996a;return db[_0x9b45('0x32')]['find']({'where':{'id':_0x5b368[_0x9b45('0x4a')]['id']},'include':[{'model':db[_0x9b45('0xf8')],'as':_0x9b45('0xf8'),'include':[{'model':db[_0x9b45('0xf8')],'as':_0x9b45('0xf9'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x202f02,null))[_0x9b45('0x13')](function(_0x16a4ce){if(_0x16a4ce){_0x74ea01=_0x16a4ce;return _0x16a4ce['getProactiveActions']({'raw':!![]});}})[_0x9b45('0x13')](function(_0x3a61bf){if(_0x74ea01){if(_0x3a61bf){_0x44996a=_0x3a61bf;}}return require('../../config/license/util')[_0x9b45('0x6c')]();})['then'](function(_0xb3275){if(_0xb3275){_0x21ad41=_0xb3275[_0x9b45('0xfa')];_0x244cf0=_0xb3275[_0x9b45('0x6d')];}})[_0x9b45('0x13')](function(){return db[_0x9b45('0xa4')][_0x9b45('0x23')]({'where':{'closed':![]}});})['then'](function(_0x3fe8c6){_0x210541=_0x3fe8c6;if(_0x21ad41&&_0x3fe8c6>_0x21ad41){return db[_0x9b45('0xfb')][_0x9b45('0x5b')]({'where':{'id':0x1}})[_0x9b45('0x13')](function(_0x2e9745){if(_0x2e9745){_0x2e9745['increment'](_0x9b45('0xfc'));}});}})[_0x9b45('0x13')](function(){if(_0x74ea01['Interval']&&_0x74ea01[_0x9b45('0xf8')][_0x9b45('0xf9')]){var _0x1ed2ec=[];for(var _0x57b186=0x0;_0x57b186<_0x74ea01[_0x9b45('0xf8')][_0x9b45('0xf9')][_0x9b45('0x4b')];_0x57b186++){var _0x33feec=_0x74ea01[_0x9b45('0xf8')][_0x9b45('0xf9')][_0x57b186][_0x9b45('0x29')]({'plain':!![]});_0x1ed2ec['push'](iftimePromise(_0x33feec,_0x74ea01));}return BPromise[_0x9b45('0xfd')](_0x1ed2ec)[_0x9b45('0x13')](function(_0x2b966e){return _[_0x9b45('0xfe')](_0x2b966e);});}else{return!![];}})['then'](function(_0x5ea78b){var _0x2d691a=fs['readFileSync'](path[_0x9b45('0x6a')](config[_0x9b45('0x6b')],_0x9b45('0xff')),_0x9b45('0xc3'));var _0x34c5e9={'remote':_0x74ea01[_0x9b45('0x100')],'query':querystring[_0x9b45('0x19')](_[_0x9b45('0x45')](_0x74ea01[_0x9b45('0x29')]({'plain':!![]}),{'customerIp':_0x5b368[_0x9b45('0x7a')][_0x9b45('0x97')]||_0x5b368[_0x9b45('0x7a')][_0x9b45('0x101')]||_0x5b368[_0x9b45('0x102')][_0x9b45('0x103')]||_0x5b368['ip'],'referer':_0x5b368[_0x9b45('0x7a')][_0x9b45('0x104')],'openedInteractions':_0x210541,'maxInteractions':_0x21ad41,'virtual':_0x244cf0[_0x9b45('0xfa')],'online':_0x5ea78b,'custom':_0x244cf0}))[_0x9b45('0x105')](/'/g,'\x5c\x27')};_0x202f02[_0x9b45('0xba')](ejs['render'](Mustache['render'](_0x2d691a,_0x34c5e9),{'proactiveActions':_0x44996a,'alignment':_0x74ea01[_0x9b45('0x106')],'verticalAlignment':_0x74ea01[_0x9b45('0x107')],'div_color':_0x74ea01[_0x9b45('0xeb')],'labelText':_0x74ea01[_0x9b45('0x108')],'text_color':_0x74ea01['textColor'],'text_button_color':_0x74ea01['textButtonColor'],'button_color':_0x74ea01['color_button'],'background_color':_0x74ea01[_0x9b45('0x109')],'hideWhenOffline':_0x74ea01['hideWhenOffline'],'interval':_0x74ea01['IntervalId']}));})[_0x9b45('0x1d')](handleError(_0x202f02,null));};exports[_0x9b45('0x10a')]=function(_0x21a20a,_0x4de0aa){var _0x11957c=_0x21a20a[_0x9b45('0x4a')]['id'];var _0x555093=_0x21a20a['body'];var _0x273053=0xc8;var _0x98d941=null;return db[_0x9b45('0xce')]['transaction']({'isolationLevel':db['sequelize'][_0x9b45('0x10b')][_0x9b45('0x10c')]['READ_COMMITTED']},function(_0x17ebce){return db[_0x9b45('0x32')][_0x9b45('0x5b')]({'where':{'id':_0x11957c},'transaction':_0x17ebce})['then'](function(_0x43ac69){if(_0x43ac69){return db['ChatApplication'][_0x9b45('0x28')]({'where':{'ChatWebsiteId':_0x11957c},'transaction':_0x17ebce})[_0x9b45('0x13')](function(){var _0x2e7a96=_[_0x9b45('0x31')](_0x555093,function(_0x758ec0){_0x758ec0[_0x9b45('0x58')]=_0x11957c;return _0x758ec0;});return db[_0x9b45('0x8b')][_0x9b45('0xd0')](_0x2e7a96,{'transaction':_0x17ebce});});}else{_0x273053=0x194;_0x98d941=[];}});})[_0x9b45('0x13')](function(){if(_0x273053!==0x194){return db[_0x9b45('0x8b')][_0x9b45('0x10d')]({'where':{'ChatWebsiteId':_0x11957c},'order':_0x9b45('0x92')})[_0x9b45('0x13')](function(_0x462141){_0x98d941=_0x462141;});}})[_0x9b45('0x1d')](function(_0xc1bdbf){_0x273053=0x1f4;logger[_0x9b45('0x1a')](_0xc1bdbf[_0x9b45('0x2c')]);if(_0xc1bdbf[_0x9b45('0x2d')]){delete _0xc1bdbf['name'];}_0x98d941=_0xc1bdbf;})[_0x9b45('0x10e')](function(){if(_0x98d941===null){_0x4de0aa[_0x9b45('0x1e')](_0x273053);}else{if(_0x273053===0x1f4){_0x4de0aa[_0x9b45('0x20')](_0x273053)[_0x9b45('0xba')](_0x98d941);}else{_0x4de0aa[_0x9b45('0x20')](_0x273053)[_0x9b45('0x26')](_0x98d941);}}});};exports['getApplications']=function(_0x54e7a6,_0x5c37ce){var _0x23622d={};var _0x3b5fff={};var _0x3b9ada;var _0xc46f8b;return db['ChatWebsite'][_0x9b45('0x5b')]({'where':{'id':_0x54e7a6[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x5c37ce,null))[_0x9b45('0x13')](function(_0x302493){if(_0x302493){_0x3b9ada=_0x302493;_0x3b5fff['model']=_[_0x9b45('0x37')](db[_0x9b45('0x8b')][_0x9b45('0x33')]);_0x3b5fff[_0x9b45('0x38')]=_[_0x9b45('0x37')](_0x54e7a6['query']);_0x3b5fff['filters']=_[_0x9b45('0x39')](_0x3b5fff[_0x9b45('0x36')],_0x3b5fff[_0x9b45('0x38')]);_0x23622d[_0x9b45('0x3b')]=_[_0x9b45('0x39')](_0x3b5fff['model'],qs[_0x9b45('0x3a')](_0x54e7a6[_0x9b45('0x38')][_0x9b45('0x3a')]));_0x23622d[_0x9b45('0x3b')]=_0x23622d[_0x9b45('0x3b')]['length']?_0x23622d[_0x9b45('0x3b')]:_0x3b5fff['model'];_0x23622d['order']=qs[_0x9b45('0x40')](_0x54e7a6[_0x9b45('0x38')][_0x9b45('0x40')]);_0x23622d[_0x9b45('0x41')]=qs[_0x9b45('0x42')](_[_0x9b45('0x43')](_0x54e7a6[_0x9b45('0x38')],_0x3b5fff[_0x9b45('0x42')]));if(_0x54e7a6['query'][_0x9b45('0x44')]){_0x23622d['where']=_[_0x9b45('0x45')](_0x23622d[_0x9b45('0x41')],{'$or':_[_0x9b45('0x31')](_0x23622d[_0x9b45('0x3b')],function(_0x3aa8a4){var _0x2ed7fd={};_0x2ed7fd[_0x3aa8a4]={'$like':'%'+_0x54e7a6['query'][_0x9b45('0x44')]+'%'};return _0x2ed7fd;})});}_0x23622d=_['merge']({},_0x23622d,_0x54e7a6[_0x9b45('0x4c')]);return _0x3b9ada[_0x9b45('0x10f')](_0x23622d);}})[_0x9b45('0x13')](function(_0x21d7f2){if(_0x21d7f2){_0xc46f8b=_0x21d7f2[_0x9b45('0x4b')];if(!_0x54e7a6[_0x9b45('0x38')][_0x9b45('0x3c')]('nolimit')){_0x23622d[_0x9b45('0x3e')]=qs[_0x9b45('0x3e')](_0x54e7a6[_0x9b45('0x38')][_0x9b45('0x3e')]);_0x23622d[_0x9b45('0x21')]=qs[_0x9b45('0x21')](_0x54e7a6[_0x9b45('0x38')][_0x9b45('0x21')]);}return _0x3b9ada[_0x9b45('0x10f')](_0x23622d);}})[_0x9b45('0x13')](function(_0x27cee1){if(_0x27cee1){return _0x27cee1?{'count':_0xc46f8b,'rows':_0x27cee1}:null;}})[_0x9b45('0x13')](respondWithResult(_0x5c37ce,null))['catch'](handleError(_0x5c37ce,null));};exports['addProactiveActions']=function(_0x4e35d8,_0x4032ab){return db[_0x9b45('0x110')]['find']({'where':{'id':_0x4e35d8['params']['id']}})['then'](handleEntityNotFound(_0x4032ab,null))[_0x9b45('0x13')](function(_0x131a34){if(_0x131a34){return _0x131a34['addProactiveActions'](_0x4e35d8[_0x9b45('0x55')][_0x9b45('0x5e')],_[_0x9b45('0xe6')](_0x4e35d8[_0x9b45('0x55')],['ids','id'])||{});}})[_0x9b45('0x13')](respondWithResult(_0x4032ab,null))[_0x9b45('0x1d')](handleError(_0x4032ab,null));};exports[_0x9b45('0x111')]=function(_0x456298,_0x5e2629){var _0x4890d0={};var _0x295ba5={};var _0x36d962;var _0x5b756e;return db['ChatWebsite'][_0x9b45('0x5b')]({'where':{'id':_0x456298[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x5e2629,null))[_0x9b45('0x13')](function(_0x265433){if(_0x265433){_0x36d962=_0x265433;_0x295ba5['model']=_['keys'](db[_0x9b45('0x112')][_0x9b45('0x33')]);_0x295ba5[_0x9b45('0x38')]=_[_0x9b45('0x37')](_0x456298[_0x9b45('0x38')]);_0x295ba5[_0x9b45('0x42')]=_[_0x9b45('0x39')](_0x295ba5[_0x9b45('0x36')],_0x295ba5[_0x9b45('0x38')]);_0x4890d0['attributes']=_[_0x9b45('0x39')](_0x295ba5['model'],qs[_0x9b45('0x3a')](_0x456298[_0x9b45('0x38')][_0x9b45('0x3a')]));_0x4890d0[_0x9b45('0x3b')]=_0x4890d0['attributes']['length']?_0x4890d0['attributes']:_0x295ba5[_0x9b45('0x36')];_0x4890d0[_0x9b45('0x3f')]=qs[_0x9b45('0x40')](_0x456298['query'][_0x9b45('0x40')]);_0x4890d0['where']=qs['filters'](_[_0x9b45('0x43')](_0x456298['query'],_0x295ba5['filters']));if(_0x456298[_0x9b45('0x38')][_0x9b45('0x44')]){_0x4890d0[_0x9b45('0x41')]=_[_0x9b45('0x45')](_0x4890d0[_0x9b45('0x41')],{'$or':_['map'](_0x4890d0[_0x9b45('0x3b')],function(_0x4ae03f){var _0x14e704={};_0x14e704[_0x4ae03f]={'$like':'%'+_0x456298[_0x9b45('0x38')][_0x9b45('0x44')]+'%'};return _0x14e704;})});}_0x4890d0=_['merge']({},_0x4890d0,_0x456298[_0x9b45('0x4c')]);return _0x36d962['getProactiveActions'](_0x4890d0);}})['then'](function(_0x35ea28){if(_0x35ea28){_0x5b756e=_0x35ea28[_0x9b45('0x4b')];if(!_0x456298['query'][_0x9b45('0x3c')](_0x9b45('0x3d'))){_0x4890d0[_0x9b45('0x3e')]=qs[_0x9b45('0x3e')](_0x456298['query'][_0x9b45('0x3e')]);_0x4890d0[_0x9b45('0x21')]=qs[_0x9b45('0x21')](_0x456298[_0x9b45('0x38')][_0x9b45('0x21')]);}return _0x36d962[_0x9b45('0x111')](_0x4890d0);}})['then'](function(_0x440e44){if(_0x440e44){return _0x440e44?{'count':_0x5b756e,'rows':_0x440e44}:null;}})[_0x9b45('0x13')](respondWithResult(_0x5e2629,null))[_0x9b45('0x1d')](handleError(_0x5e2629,null));};exports['getFields']=function(_0xa3737d,_0x45d526){var _0x6b236c=_0xa3737d[_0x9b45('0x38')]['online']==='false'?_0x9b45('0x113'):'onlineForm';return db['ChatWebsite'][_0x9b45('0x4d')]({'attributes':['id',_0x6b236c],'where':{'id':_0xa3737d['params']['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x45d526,null))['then'](function(_0x9457ba){if(_0x9457ba){var _0x5f3bac=_0x9457ba[_0x6b236c];var _0x411d24=_0x5f3bac&&_0x5f3bac[_0x9b45('0x114')]?_0x5f3bac[_0x9b45('0x114')]:[];_0x45d526[_0x9b45('0xba')]({'fromKey':_[_0x9b45('0x6e')](_0x5f3bac[_0x9b45('0x115')])?undefined:_0x5f3bac['fromKey'],'count':_0x411d24['length'],'rows':_0x411d24});}})[_0x9b45('0x1d')](handleError(_0x45d526,null));};exports[_0x9b45('0x116')]=function(_0x5007b3,_0x242c80){var _0x5a84d7={'raw':![],'where':{}};var _0x210bde={};var _0x219378={'count':0x0,'rows':[]};return db[_0x9b45('0x32')][_0x9b45('0x5b')]({'where':{'id':_0x5007b3[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x242c80,null))['then'](function(_0x195143){if(_0x195143){_0x210bde[_0x9b45('0x36')]=_[_0x9b45('0x37')](db[_0x9b45('0xc7')][_0x9b45('0x33')]);_0x210bde[_0x9b45('0x38')]=_['keys'](_0x5007b3['query']);_0x210bde[_0x9b45('0x42')]=_[_0x9b45('0x39')](_0x210bde[_0x9b45('0x36')],_0x210bde['query']);_0x5a84d7['attributes']=_[_0x9b45('0x39')](_0x210bde[_0x9b45('0x36')],qs[_0x9b45('0x3a')](_0x5007b3[_0x9b45('0x38')][_0x9b45('0x3a')]));_0x5a84d7['attributes']=_0x5a84d7[_0x9b45('0x3b')][_0x9b45('0x4b')]?_0x5a84d7[_0x9b45('0x3b')]:_0x210bde[_0x9b45('0x36')];if(!_0x5007b3['query']['hasOwnProperty'](_0x9b45('0x3d'))){_0x5a84d7['limit']=qs[_0x9b45('0x3e')](_0x5007b3[_0x9b45('0x38')]['limit']);_0x5a84d7[_0x9b45('0x21')]=qs[_0x9b45('0x21')](_0x5007b3[_0x9b45('0x38')][_0x9b45('0x21')]);}_0x5a84d7[_0x9b45('0x3f')]=qs[_0x9b45('0x40')](_0x5007b3['query'][_0x9b45('0x40')]);_0x5a84d7[_0x9b45('0x41')]=qs['filters'](_[_0x9b45('0x43')](_0x5007b3['query'],_0x210bde['filters']));_0x5a84d7['where'][_0x9b45('0x58')]=_0x195143['id'];if(_0x5007b3[_0x9b45('0x38')][_0x9b45('0x44')]){_0x5a84d7[_0x9b45('0x41')]=_[_0x9b45('0x45')](_0x5a84d7[_0x9b45('0x41')],{'$or':_['map'](_0x5a84d7[_0x9b45('0x3b')],function(_0x2cc37e){var _0x4efaff={};_0x4efaff[_0x2cc37e]={'$like':'%'+_0x5007b3[_0x9b45('0x38')][_0x9b45('0x44')]+'%'};return _0x4efaff;})});}_0x5a84d7=_[_0x9b45('0x45')]({},_0x5a84d7,_0x5007b3['options']);return db[_0x9b45('0xc7')][_0x9b45('0x23')]({'where':_0x5a84d7[_0x9b45('0x41')]})['then'](function(_0x40a4de){_0x219378[_0x9b45('0x23')]=_0x40a4de;if(_0x5007b3[_0x9b45('0x38')][_0x9b45('0x47')]){_0x5a84d7['include']=[{'all':!![]}];}else{_0x5a84d7['include']=[{'model':db[_0x9b45('0x7e')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0x9b45('0xc7')][_0x9b45('0x49')](_0x5a84d7);})['then'](function(_0x2d1d0a){_0x219378[_0x9b45('0x5c')]=_0x2d1d0a;return _0x219378;});}})['then'](respondWithFilteredResult(_0x242c80,_0x5a84d7))['catch'](handleError(_0x242c80,null));};exports[_0x9b45('0x117')]=function(_0xf2cbe2,_0x5a8d36){return db[_0x9b45('0x32')][_0x9b45('0x4d')]({'where':{'id':_0xf2cbe2[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0x5a8d36,null))[_0x9b45('0x13')](function(_0x31f60d){if(_0x31f60d){return _0x31f60d[_0x9b45('0x117')](_0xf2cbe2[_0x9b45('0x55')][_0x9b45('0x5e')],_[_0x9b45('0xe6')](_0xf2cbe2[_0x9b45('0x55')],[_0x9b45('0x5e'),'id'])||{})[_0x9b45('0xa8')](function(_0x39826e){for(var _0x5c1684=0x0;_0x5c1684<_0xf2cbe2[_0x9b45('0x55')][_0x9b45('0x5e')]['length'];_0x5c1684+=0x1){socket[_0x9b45('0x118')](_0x9b45('0x119'),{'UserId':Number(_0xf2cbe2['body'][_0x9b45('0x5e')][_0x5c1684]),'ChatWebsiteId':Number(_0xf2cbe2[_0x9b45('0x4a')]['id'])});}return _0x39826e;});}})[_0x9b45('0x13')](respondWithResult(_0x5a8d36,null))[_0x9b45('0x1d')](handleError(_0x5a8d36,null));};exports[_0x9b45('0x11a')]=function(_0x59d1c0,_0xaa3d38){return db[_0x9b45('0x32')][_0x9b45('0x4d')]({'where':{'id':_0x59d1c0[_0x9b45('0x4a')]['id']}})[_0x9b45('0x13')](handleEntityNotFound(_0xaa3d38,null))[_0x9b45('0x13')](function(_0x2b28c8){if(_0x2b28c8){return _0x2b28c8['removeAgents'](_0x59d1c0[_0x9b45('0x38')][_0x9b45('0x5e')])[_0x9b45('0x13')](function(){if(_['isArray'](_0x59d1c0[_0x9b45('0x38')][_0x9b45('0x5e')])){for(var _0x253694=0x0;_0x253694<_0x59d1c0[_0x9b45('0x38')][_0x9b45('0x5e')][_0x9b45('0x4b')];_0x253694+=0x1){socket[_0x9b45('0x118')](_0x9b45('0x11b'),{'UserId':Number(_0x59d1c0[_0x9b45('0x38')]['ids'][_0x253694]),'ChatWebsiteId':Number(_0x59d1c0[_0x9b45('0x4a')]['id'])});}}else{socket[_0x9b45('0x118')]('userChatWebsite:remove',{'UserId':Number(_0x59d1c0['query']['ids']),'ChatWebsiteId':Number(_0x59d1c0[_0x9b45('0x4a')]['id'])});}});}})[_0x9b45('0x13')](respondWithStatusCode(_0xaa3d38,null))[_0x9b45('0x1d')](handleError(_0xaa3d38,null));};exports[_0x9b45('0x11c')]=function(_0x513342,_0x4c627d){var _0x353830={};var _0x5723ec={};var _0x57eea4;var _0xbac1f8;return db['ChatWebsite'][_0x9b45('0x5b')]({'where':{'id':_0x513342[_0x9b45('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4c627d,null))['then'](function(_0x3a40b3){if(_0x3a40b3){_0x57eea4=_0x3a40b3;_0x5723ec[_0x9b45('0x36')]=_[_0x9b45('0x37')](db[_0x9b45('0xb0')][_0x9b45('0x33')]);_0x5723ec[_0x9b45('0x38')]=_[_0x9b45('0x37')](_0x513342[_0x9b45('0x38')]);_0x5723ec[_0x9b45('0x42')]=_[_0x9b45('0x39')](_0x5723ec[_0x9b45('0x36')],_0x5723ec['query']);_0x353830['attributes']=_[_0x9b45('0x39')](_0x5723ec['model'],qs[_0x9b45('0x3a')](_0x513342['query'][_0x9b45('0x3a')]));_0x353830[_0x9b45('0x3b')]=_0x353830[_0x9b45('0x3b')][_0x9b45('0x4b')]?_0x353830[_0x9b45('0x3b')]:_0x5723ec[_0x9b45('0x36')];_0x353830[_0x9b45('0x3f')]=qs[_0x9b45('0x40')](_0x513342[_0x9b45('0x38')][_0x9b45('0x40')]);_0x353830[_0x9b45('0x41')]=qs[_0x9b45('0x42')](_[_0x9b45('0x43')](_0x513342[_0x9b45('0x38')],_0x5723ec[_0x9b45('0x42')]));if(_0x513342[_0x9b45('0x38')][_0x9b45('0x44')]){_0x353830[_0x9b45('0x41')]=_[_0x9b45('0x45')](_0x353830['where'],{'$or':_[_0x9b45('0x31')](_0x353830[_0x9b45('0x3b')],function(_0xb14a8e){var _0x4787b7={};_0x4787b7[_0xb14a8e]={'$like':'%'+_0x513342[_0x9b45('0x38')][_0x9b45('0x44')]+'%'};return _0x4787b7;})});}_0x353830=_[_0x9b45('0x45')]({},_0x353830,_0x513342['options']);return _0x57eea4[_0x9b45('0x11c')](_0x353830);}})['then'](function(_0x4556df){if(_0x4556df){_0xbac1f8=_0x4556df['length'];if(!_0x513342[_0x9b45('0x38')]['hasOwnProperty'](_0x9b45('0x3d'))){_0x353830[_0x9b45('0x3e')]=qs['limit'](_0x513342[_0x9b45('0x38')]['limit']);_0x353830[_0x9b45('0x21')]=qs['offset'](_0x513342[_0x9b45('0x38')]['offset']);}return _0x57eea4[_0x9b45('0x11c')](_0x353830);}})['then'](function(_0x5c555f){if(_0x5c555f){return _0x5c555f?{'count':_0xbac1f8,'rows':_0x5c555f}:null;}})[_0x9b45('0x13')](respondWithResult(_0x4c627d,null))[_0x9b45('0x1d')](handleError(_0x4c627d,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 3b5c2c0..7aac3d2 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 _0xc9f5=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc9f5,0xc4));var _0x5c9f=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0xc9f5[_0x5cab28];return _0xa3554d;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x5c9f('0x0'))['db'][_0x5c9f('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5c9f('0x2'),'afterUpdate':_0x5c9f('0x3'),'afterDestroy':_0x5c9f('0x4')};function emitEvent(_0x5a1ee5){return function(_0x4a046a,_0x1af905,_0x57d666){ChatWebsiteEvents[_0x5c9f('0x5')](_0x5a1ee5+':'+_0x4a046a['id'],_0x4a046a);ChatWebsiteEvents['emit'](_0x5a1ee5,_0x4a046a);_0x57d666(null);};}for(var e in events){if(events[_0x5c9f('0x6')](e)){var event=events[e];ChatWebsite[_0x5c9f('0x7')](e,emitEvent(event));}}module[_0x5c9f('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x871e=['events','ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x871e,0x1b0));var _0xe871=function(_0x13bf3b,_0x34cdfc){_0x13bf3b=_0x13bf3b-0x0;var _0x2a2a93=_0x871e[_0x13bf3b];return _0x2a2a93;};'use strict';var EventEmitter=require(_0xe871('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xe871('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe871('0x2')](0x0);var events={'afterCreate':_0xe871('0x3'),'afterUpdate':_0xe871('0x4'),'afterDestroy':'remove'};function emitEvent(_0xc9353){return function(_0x27f82b,_0x4550c1,_0x443d1d){ChatWebsiteEvents[_0xe871('0x5')](_0xc9353+':'+_0x27f82b['id'],_0x27f82b);ChatWebsiteEvents[_0xe871('0x5')](_0xc9353,_0x27f82b);_0x443d1d(null);};}for(var e in events){if(events[_0xe871('0x6')](e)){var event=events[e];ChatWebsite[_0xe871('0x7')](e,emitEvent(event));}}module[_0xe871('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 1eae034..3613b26 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 _0x3b9a=['lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites'];(function(_0x2199bf,_0x2f7f41){var _0x1f5ca3=function(_0x2c292b){while(--_0x2c292b){_0x2199bf['push'](_0x2199bf['shift']());}};_0x1f5ca3(++_0x2f7f41);}(_0x3b9a,0x1e4));var _0xa3b9=function(_0x9d43a8,_0x3b976c){_0x9d43a8=_0x9d43a8-0x0;var _0x543e04=_0x3b9a[_0x9d43a8];return _0x543e04;};'use strict';var _=require(_0xa3b9('0x0'));var util=require('util');var logger=require(_0xa3b9('0x1'))(_0xa3b9('0x2'));var moment=require(_0xa3b9('0x3'));var BPromise=require(_0xa3b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa3b9('0x5'));var config=require(_0xa3b9('0x6'));var attributes=require('./chatWebsite.attributes');module[_0xa3b9('0x7')]=function(_0x342751,_0x11e634){return _0x342751[_0xa3b9('0x8')](_0xa3b9('0x9'),attributes,{'tableName':_0xa3b9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x410e=['exports','define','ChatWebsite','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x28c286,_0x4a1659){var _0x19459c=function(_0x2f7c77){while(--_0x2f7c77){_0x28c286['push'](_0x28c286['shift']());}};_0x19459c(++_0x4a1659);}(_0x410e,0xa8));var _0xe410=function(_0x6b9992,_0x28c3f6){_0x6b9992=_0x6b9992-0x0;var _0x57ec83=_0x410e[_0x6b9992];return _0x57ec83;};'use strict';var _=require(_0xe410('0x0'));var util=require('util');var logger=require(_0xe410('0x1'))(_0xe410('0x2'));var moment=require(_0xe410('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe410('0x4'));var rimraf=require(_0xe410('0x5'));var config=require(_0xe410('0x6'));var attributes=require(_0xe410('0x7'));module[_0xe410('0x8')]=function(_0x1057f7,_0x4954b9){return _0x1057f7[_0xe410('0x9')](_0xe410('0xa'),attributes,{'tableName':'chat_websites','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 8b8ef93..729e8d1 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 _0x1af8=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatWebsite.socket','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x35b0d3,_0x15f5d8){var _0x1e20ea=function(_0x44683f){while(--_0x44683f){_0x35b0d3['push'](_0x35b0d3['shift']());}};_0x1e20ea(++_0x15f5d8);}(_0x1af8,0x6c));var _0x81af=function(_0x2b1493,_0x3893a0){_0x2b1493=_0x2b1493-0x0;var _0xe867c3=_0x1af8[_0x2b1493];return _0xe867c3;};'use strict';var _=require(_0x81af('0x0'));var util=require(_0x81af('0x1'));var moment=require(_0x81af('0x2'));var BPromise=require('bluebird');var rs=require(_0x81af('0x3'));var fs=require('fs');var Redis=require(_0x81af('0x4'));var db=require(_0x81af('0x5'))['db'];var utils=require(_0x81af('0x6'));var logger=require(_0x81af('0x7'))(_0x81af('0x8'));var config=require(_0x81af('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x81af('0xa')][_0x81af('0xb')]({'port':0x232a});config[_0x81af('0xc')]=_[_0x81af('0xd')](config[_0x81af('0xc')],{'host':_0x81af('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x81af('0xf'))['register'](socket);function respondWithRpcPromise(_0x3c2cb5,_0x509b67,_0x130a70){return new BPromise(function(_0x248c5c,_0xcd1432){return client['request'](_0x3c2cb5,_0x130a70)[_0x81af('0x10')](function(_0xbe28b4){logger['info'](_0x81af('0x11'),_0x509b67,_0x81af('0x12'));logger[_0x81af('0x13')](_0x81af('0x14'),_0x509b67,_0x81af('0x12'),JSON[_0x81af('0x15')](_0xbe28b4));if(_0xbe28b4[_0x81af('0x16')]){if(_0xbe28b4['error'][_0x81af('0x17')]===0x1f4){logger['error'](_0x81af('0x11'),_0x509b67,_0xbe28b4[_0x81af('0x16')][_0x81af('0x18')]);return _0xcd1432(_0xbe28b4[_0x81af('0x16')][_0x81af('0x18')]);}logger['error'](_0x81af('0x11'),_0x509b67,_0xbe28b4[_0x81af('0x16')][_0x81af('0x18')]);return _0x248c5c(_0xbe28b4['error']['message']);}else{logger[_0x81af('0x19')](_0x81af('0x11'),_0x509b67,'request\x20sent');_0x248c5c(_0xbe28b4[_0x81af('0x1a')][_0x81af('0x18')]);}})['catch'](function(_0x2f74a8){logger[_0x81af('0x16')](_0x81af('0x11'),_0x509b67,_0x2f74a8);_0xcd1432(_0x2f74a8);});});} \ No newline at end of file +var _0xb055=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','util','bluebird'];(function(_0xbf5e16,_0x146ce3){var _0x5975a5=function(_0x2387a7){while(--_0x2387a7){_0xbf5e16['push'](_0xbf5e16['shift']());}};_0x5975a5(++_0x146ce3);}(_0xb055,0x1e4));var _0x5b05=function(_0x139e83,_0x24da76){_0x139e83=_0x139e83-0x0;var _0x3ef586=_0xb055[_0x139e83];return _0x3ef586;};'use strict';var _=require('lodash');var util=require(_0x5b05('0x0'));var moment=require('moment');var BPromise=require(_0x5b05('0x1'));var rs=require(_0x5b05('0x2'));var fs=require('fs');var Redis=require(_0x5b05('0x3'));var db=require(_0x5b05('0x4'))['db'];var utils=require(_0x5b05('0x5'));var logger=require(_0x5b05('0x6'))(_0x5b05('0x7'));var config=require(_0x5b05('0x8'));var jayson=require(_0x5b05('0x9'));var client=jayson[_0x5b05('0xa')][_0x5b05('0xb')]({'port':0x232a});config[_0x5b05('0xc')]=_[_0x5b05('0xd')](config[_0x5b05('0xc')],{'host':_0x5b05('0xe'),'port':0x18eb});var socket=require(_0x5b05('0xf'))(new Redis(config[_0x5b05('0xc')]));require(_0x5b05('0x10'))[_0x5b05('0x11')](socket);function respondWithRpcPromise(_0x140937,_0x5a3554,_0x481daa){return new BPromise(function(_0x433dad,_0x597b12){return client[_0x5b05('0x12')](_0x140937,_0x481daa)[_0x5b05('0x13')](function(_0x52bdf2){logger[_0x5b05('0x14')](_0x5b05('0x15'),_0x5a3554,_0x5b05('0x16'));logger[_0x5b05('0x17')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5a3554,_0x5b05('0x16'),JSON['stringify'](_0x52bdf2));if(_0x52bdf2[_0x5b05('0x18')]){if(_0x52bdf2[_0x5b05('0x18')]['code']===0x1f4){logger[_0x5b05('0x18')](_0x5b05('0x15'),_0x5a3554,_0x52bdf2[_0x5b05('0x18')][_0x5b05('0x19')]);return _0x597b12(_0x52bdf2[_0x5b05('0x18')][_0x5b05('0x19')]);}logger[_0x5b05('0x18')](_0x5b05('0x15'),_0x5a3554,_0x52bdf2[_0x5b05('0x18')]['message']);return _0x433dad(_0x52bdf2[_0x5b05('0x18')][_0x5b05('0x19')]);}else{logger[_0x5b05('0x14')](_0x5b05('0x15'),_0x5a3554,_0x5b05('0x16'));_0x433dad(_0x52bdf2['result']['message']);}})[_0x5b05('0x1a')](function(_0x227f40){logger[_0x5b05('0x18')](_0x5b05('0x15'),_0x5a3554,_0x227f40);_0x597b12(_0x227f40);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index db45472..459e5d6 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 _0xbfb7=['./chatWebsite.events','save','remove','update','emit','register','length','chatWebsite:'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xbfb7,0xb0));var _0x7bfb=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0xbfb7[_0x48d6a3];return _0x38bfa0;};'use strict';var ChatWebsiteEvents=require(_0x7bfb('0x0'));var events=[_0x7bfb('0x1'),_0x7bfb('0x2'),_0x7bfb('0x3')];function createListener(_0x4e6f5f,_0x38b7c5){return function(_0x315247){_0x38b7c5[_0x7bfb('0x4')](_0x4e6f5f,_0x315247);};}function removeListener(_0x25471e,_0x3ddb74){return function(){ChatWebsiteEvents['removeListener'](_0x25471e,_0x3ddb74);};}exports[_0x7bfb('0x5')]=function(_0x54671c){for(var _0x37a502=0x0,_0x168382=events[_0x7bfb('0x6')];_0x37a502<_0x168382;_0x37a502++){var _0x1dc66a=events[_0x37a502];var _0x1e2ae5=createListener(_0x7bfb('0x7')+_0x1dc66a,_0x54671c);ChatWebsiteEvents['on'](_0x1dc66a,_0x1e2ae5);}}; \ No newline at end of file +var _0xb106=['length','chatWebsite:','./chatWebsite.events','remove','update','emit','removeListener','register'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0xb106,0x82));var _0x6b10=function(_0x5cd57d,_0x3e5b81){_0x5cd57d=_0x5cd57d-0x0;var _0x16d3fe=_0xb106[_0x5cd57d];return _0x16d3fe;};'use strict';var ChatWebsiteEvents=require(_0x6b10('0x0'));var events=['save',_0x6b10('0x1'),_0x6b10('0x2')];function createListener(_0x492066,_0x74cf12){return function(_0x4c253d){_0x74cf12[_0x6b10('0x3')](_0x492066,_0x4c253d);};}function removeListener(_0x468f64,_0x2b1fed){return function(){ChatWebsiteEvents[_0x6b10('0x4')](_0x468f64,_0x2b1fed);};}exports[_0x6b10('0x5')]=function(_0x163f2c){for(var _0xdd617a=0x0,_0x46d000=events[_0x6b10('0x6')];_0xdd617a<_0x46d000;_0xdd617a++){var _0x4dda98=events[_0xdd617a];var _0x44573f=createListener(_0x6b10('0x7')+_0x4dda98,_0x163f2c);ChatWebsiteEvents['on'](_0x4dda98,_0x44573f);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index fcf4e67..be9da45 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 _0xf0b7=['/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','now','single','file','addLogo','root','server/files/images/avatars/','format','%s-%s','originalname','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xf0b7,0x11b));var _0x7f0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0b7[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x7f0b('0x0'));var util=require(_0x7f0b('0x1'));var path=require(_0x7f0b('0x2'));var timeout=require(_0x7f0b('0x3'));var express=require(_0x7f0b('0x4'));var router=express[_0x7f0b('0x5')]();var fs_extra=require(_0x7f0b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7f0b('0x7'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router[_0x7f0b('0x8')]('/',auth[_0x7f0b('0x9')](),controller[_0x7f0b('0xa')]);router['get'](_0x7f0b('0xb'),auth['isAuthenticated'](),controller[_0x7f0b('0xc')]);router[_0x7f0b('0x8')](_0x7f0b('0xd'),auth['isAuthenticated'](),controller[_0x7f0b('0xe')]);router[_0x7f0b('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7f0b('0xf')]);router[_0x7f0b('0x8')](_0x7f0b('0x10'),auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x11')]);router[_0x7f0b('0x8')](_0x7f0b('0x12'),controller[_0x7f0b('0x13')]);router['get'](_0x7f0b('0x14'),controller[_0x7f0b('0x15')]);router[_0x7f0b('0x8')](_0x7f0b('0x16'),controller[_0x7f0b('0x17')]);router[_0x7f0b('0x8')]('/:id/system_avatar',controller[_0x7f0b('0x18')]);router['get'](_0x7f0b('0x19'),auth[_0x7f0b('0x9')](),controller['getInteractions']);router[_0x7f0b('0x8')](_0x7f0b('0x1a'),controller[_0x7f0b('0x1b')]);router[_0x7f0b('0x8')](_0x7f0b('0x1c'),auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x1d')]);router[_0x7f0b('0x8')](_0x7f0b('0x1e'),auth['isAuthenticated'](),controller[_0x7f0b('0x1f')]);router[_0x7f0b('0x8')](_0x7f0b('0x20'),controller[_0x7f0b('0x21')]);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x7f0b('0x22')]);router[_0x7f0b('0x8')](_0x7f0b('0x23'),auth[_0x7f0b('0x9')](),controller['getAgents']);router[_0x7f0b('0x24')]('/',auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x25')]);router[_0x7f0b('0x24')](_0x7f0b('0x26'),auth['isAuthenticated'](),controller[_0x7f0b('0x27')]);router['post'](_0x7f0b('0x10'),auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x28')]);var upload=multer({'storage':multer[_0x7f0b('0x29')]({'destination':function(_0x2f7b4f,_0x20096f,_0x4bc088){_0x4bc088(null,path[_0x7f0b('0x2a')](config['root'],_0x7f0b('0x2b')));},'filename':function(_0xdea7b2,_0x4a1583,_0x585479){_0x585479(null,util['format']('%s-%s',Date[_0x7f0b('0x2c')](),_0x4a1583['originalname']));}})});router[_0x7f0b('0x24')](_0x7f0b('0x12'),upload[_0x7f0b('0x2d')](_0x7f0b('0x2e')),controller[_0x7f0b('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56d5bd,_0x3e80d4,_0x1b60a2){_0x1b60a2(null,path[_0x7f0b('0x2a')](config[_0x7f0b('0x30')],_0x7f0b('0x31')));},'filename':function(_0x52b68a,_0x491f59,_0x41e5ed){_0x41e5ed(null,util[_0x7f0b('0x32')](_0x7f0b('0x33'),Date[_0x7f0b('0x2c')](),_0x491f59[_0x7f0b('0x34')]));}})});router[_0x7f0b('0x24')]('/:id/avatar',upload['single'](_0x7f0b('0x2e')),controller[_0x7f0b('0x35')]);var upload=multer({'storage':multer[_0x7f0b('0x29')]({'destination':function(_0x5b2da3,_0x48addd,_0x5e1dfc){_0x5e1dfc(null,path['join'](config[_0x7f0b('0x30')],_0x7f0b('0x31')));},'filename':function(_0x4c02d1,_0x44c0da,_0xe37450){_0xe37450(null,util[_0x7f0b('0x32')]('%s-%s',Date[_0x7f0b('0x2c')](),_0x44c0da[_0x7f0b('0x34')]));}})});router[_0x7f0b('0x24')]('/:id/customer_avatar',upload[_0x7f0b('0x2d')](_0x7f0b('0x2e')),controller[_0x7f0b('0x36')]);var upload=multer({'storage':multer[_0x7f0b('0x29')]({'destination':function(_0x4de317,_0x312692,_0x54b426){_0x54b426(null,path[_0x7f0b('0x2a')](config['root'],_0x7f0b('0x31')));},'filename':function(_0x359eb0,_0x48b957,_0x499a80){_0x499a80(null,util[_0x7f0b('0x32')]('%s-%s',Date[_0x7f0b('0x2c')](),_0x48b957[_0x7f0b('0x34')]));}})});router[_0x7f0b('0x24')](_0x7f0b('0x37'),upload['single'](_0x7f0b('0x2e')),controller[_0x7f0b('0x38')]);router['post'](_0x7f0b('0x39'),controller[_0x7f0b('0x3a')]);const offlineUploadMulter=multer({'storage':multer[_0x7f0b('0x29')]({'destination':function(_0x12f9f3,_0x402389,_0x145b4b){const _0x3eb9d5=path[_0x7f0b('0x2a')](config[_0x7f0b('0x30')],'server/files','attachments',_0x7f0b('0x3b'));fs_extra[_0x7f0b('0x3c')](_0x3eb9d5,function(){_0x145b4b(null,_0x3eb9d5);});},'filename':function(_0x56851d,_0x3be958,_0x35768d){const _0x26a29c=_0x3be958[_0x7f0b('0x34')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5de13b=path[_0x7f0b('0x3d')](_0x26a29c);const _0x1875b0=Date[_0x7f0b('0x2c')]()+'-'+_0x26a29c[_0x7f0b('0x3e')](_0x5de13b,'')+_0x5de13b;_0x35768d(null,_0x1875b0);}})});router[_0x7f0b('0x24')](_0x7f0b('0x3f'),offlineUploadMulter[_0x7f0b('0x40')](),controller[_0x7f0b('0x41')]);router[_0x7f0b('0x24')]('/:id/interactions',auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x42')]);router[_0x7f0b('0x24')]('/:id/applications',auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x43')]);router['post'](_0x7f0b('0x1e'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x7f0b('0x24')]('/:id/users',auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x44')]);router[_0x7f0b('0x45')](_0x7f0b('0xd'),auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x46')]);router[_0x7f0b('0x47')](_0x7f0b('0xd'),auth[_0x7f0b('0x9')](),controller['destroy']);router[_0x7f0b('0x47')](_0x7f0b('0x26'),auth['isAuthenticated'](),controller[_0x7f0b('0x48')]);router[_0x7f0b('0x47')](_0x7f0b('0x10'),auth[_0x7f0b('0x9')](),controller['removeAnswers']);router[_0x7f0b('0x47')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x7f0b('0x49')]=router; \ No newline at end of file +var _0x1da7=['destroy','removeDispositions','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','join','server/files/images/logos/','now','single','file','addLogo','diskStorage','root','server/files/images/avatars/','format','originalname','addAvatar','%s-%s','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','addInteraction','addApplications','addAgents','put','update','delete'];(function(_0xa0a054,_0x256f42){var _0x35b69a=function(_0x270346){while(--_0x270346){_0xa0a054['push'](_0xa0a054['shift']());}};_0x35b69a(++_0x256f42);}(_0x1da7,0x1c0));var _0x71da=function(_0x18974a,_0x1d50a6){_0x18974a=_0x18974a-0x0;var _0xc67411=_0x1da7[_0x18974a];return _0xc67411;};'use strict';var multer=require(_0x71da('0x0'));var util=require(_0x71da('0x1'));var path=require('path');var timeout=require(_0x71da('0x2'));var express=require(_0x71da('0x3'));var router=express[_0x71da('0x4')]();var fs_extra=require(_0x71da('0x5'));var auth=require(_0x71da('0x6'));var interaction=require(_0x71da('0x7'));var config=require('../../config/environment');var controller=require(_0x71da('0x8'));router['get']('/',auth[_0x71da('0x9')](),controller[_0x71da('0xa')]);router[_0x71da('0xb')](_0x71da('0xc'),auth[_0x71da('0x9')](),controller[_0x71da('0xd')]);router[_0x71da('0xb')](_0x71da('0xe'),auth[_0x71da('0x9')](),controller['show']);router[_0x71da('0xb')](_0x71da('0xf'),auth[_0x71da('0x9')](),controller[_0x71da('0x10')]);router[_0x71da('0xb')](_0x71da('0x11'),auth[_0x71da('0x9')](),controller[_0x71da('0x12')]);router[_0x71da('0xb')](_0x71da('0x13'),controller[_0x71da('0x14')]);router[_0x71da('0xb')](_0x71da('0x15'),controller[_0x71da('0x16')]);router['get']('/:id/customer_avatar',controller[_0x71da('0x17')]);router[_0x71da('0xb')]('/:id/system_avatar',controller[_0x71da('0x18')]);router[_0x71da('0xb')](_0x71da('0x19'),auth['isAuthenticated'](),controller[_0x71da('0x1a')]);router[_0x71da('0xb')]('/:id/snippet',controller[_0x71da('0x1b')]);router[_0x71da('0xb')](_0x71da('0x1c'),auth[_0x71da('0x9')](),controller[_0x71da('0x1d')]);router[_0x71da('0xb')](_0x71da('0x1e'),auth['isAuthenticated'](),controller[_0x71da('0x1f')]);router[_0x71da('0xb')](_0x71da('0x20'),controller['getFields']);router[_0x71da('0xb')](_0x71da('0x21'),auth[_0x71da('0x9')](),controller['getOfflineMessages']);router[_0x71da('0xb')](_0x71da('0x22'),auth[_0x71da('0x9')](),controller[_0x71da('0x23')]);router[_0x71da('0x24')]('/',auth[_0x71da('0x9')](),controller[_0x71da('0x25')]);router[_0x71da('0x24')](_0x71da('0xf'),auth['isAuthenticated'](),controller[_0x71da('0x26')]);router[_0x71da('0x24')](_0x71da('0x11'),auth[_0x71da('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x48a65a,_0x1e00e6,_0x55b363){_0x55b363(null,path[_0x71da('0x27')](config['root'],_0x71da('0x28')));},'filename':function(_0x4eb86a,_0x2adb51,_0x1abfd0){_0x1abfd0(null,util['format']('%s-%s',Date[_0x71da('0x29')](),_0x2adb51['originalname']));}})});router[_0x71da('0x24')](_0x71da('0x13'),upload[_0x71da('0x2a')](_0x71da('0x2b')),controller[_0x71da('0x2c')]);var upload=multer({'storage':multer[_0x71da('0x2d')]({'destination':function(_0x4419cd,_0x4333a9,_0x5e6a4b){_0x5e6a4b(null,path[_0x71da('0x27')](config[_0x71da('0x2e')],_0x71da('0x2f')));},'filename':function(_0x472b57,_0x4957b8,_0x57ba23){_0x57ba23(null,util[_0x71da('0x30')]('%s-%s',Date[_0x71da('0x29')](),_0x4957b8[_0x71da('0x31')]));}})});router[_0x71da('0x24')](_0x71da('0x15'),upload[_0x71da('0x2a')]('file'),controller[_0x71da('0x32')]);var upload=multer({'storage':multer[_0x71da('0x2d')]({'destination':function(_0x1018ec,_0x2973d2,_0x58394d){_0x58394d(null,path['join'](config[_0x71da('0x2e')],'server/files/images/avatars/'));},'filename':function(_0x33691b,_0x57b483,_0x32847b){_0x32847b(null,util[_0x71da('0x30')](_0x71da('0x33'),Date[_0x71da('0x29')](),_0x57b483[_0x71da('0x31')]));}})});router[_0x71da('0x24')](_0x71da('0x34'),upload[_0x71da('0x2a')](_0x71da('0x2b')),controller[_0x71da('0x35')]);var upload=multer({'storage':multer[_0x71da('0x2d')]({'destination':function(_0x1a0f97,_0x1e4f8b,_0x2547b3){_0x2547b3(null,path[_0x71da('0x27')](config[_0x71da('0x2e')],'server/files/images/avatars/'));},'filename':function(_0x143bf8,_0x4a0d4d,_0x320097){_0x320097(null,util[_0x71da('0x30')]('%s-%s',Date[_0x71da('0x29')](),_0x4a0d4d['originalname']));}})});router[_0x71da('0x24')]('/:id/system_avatar',upload[_0x71da('0x2a')](_0x71da('0x2b')),controller[_0x71da('0x36')]);router[_0x71da('0x24')](_0x71da('0x37'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x71da('0x2d')]({'destination':function(_0x5e02e1,_0x4387ae,_0x25b19d){const _0x2753f3=path['join'](config[_0x71da('0x2e')],_0x71da('0x38'),_0x71da('0x39'),_0x71da('0x3a'));fs_extra[_0x71da('0x3b')](_0x2753f3,function(){_0x25b19d(null,_0x2753f3);});},'filename':function(_0x263e20,_0x35bc48,_0x208858){const _0x3bbd73=_0x35bc48['originalname'][_0x71da('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1fdcc9=path[_0x71da('0x3d')](_0x3bbd73);const _0x6dce4c=Date[_0x71da('0x29')]()+'-'+_0x3bbd73[_0x71da('0x3c')](_0x1fdcc9,'')+_0x1fdcc9;_0x208858(null,_0x6dce4c);}})});router[_0x71da('0x24')](_0x71da('0x3e'),offlineUploadMulter[_0x71da('0x3f')](),controller['offline']);router[_0x71da('0x24')](_0x71da('0x19'),auth[_0x71da('0x9')](),controller[_0x71da('0x40')]);router['post']('/:id/applications',auth[_0x71da('0x9')](),controller[_0x71da('0x41')]);router[_0x71da('0x24')]('/:id/proactive_actions',auth[_0x71da('0x9')](),controller['addProactiveActions']);router[_0x71da('0x24')]('/:id/users',auth[_0x71da('0x9')](),controller[_0x71da('0x42')]);router[_0x71da('0x43')](_0x71da('0xe'),auth[_0x71da('0x9')](),controller[_0x71da('0x44')]);router[_0x71da('0x45')](_0x71da('0xe'),auth['isAuthenticated'](),controller[_0x71da('0x46')]);router[_0x71da('0x45')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x71da('0x47')]);router[_0x71da('0x45')](_0x71da('0x11'),auth[_0x71da('0x9')](),controller['removeAnswers']);router[_0x71da('0x45')](_0x71da('0x22'),auth[_0x71da('0x9')](),controller[_0x71da('0x48')]);module[_0x71da('0x49')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 0cb05e1..32cb7b4 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0012=['env','production','app','get','client-side-logger','expressEndpoint','use','isAuthenticated','exports','express','../components/auth/service','../config/environment'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0x0012,0x111));var _0x2001=function(_0x3340a2,_0x44729a){_0x3340a2=_0x3340a2-0x0;var _0x43f75e=_0x0012[_0x3340a2];return _0x43f75e;};var beaverLogger=require('beaver-logger/server');var express=require(_0x2001('0x0'));var auth=require(_0x2001('0x1'));var config=require(_0x2001('0x2'));var router=express['Router']();var isProduction=config[_0x2001('0x3')]===_0x2001('0x4')||![];function clientSideLogs(_0x32c03f,_0x34cee0,_0x11a78a){var _0x2adf8c=_0x32c03f[_0x2001('0x5')][_0x2001('0x6')](_0x2001('0x7'));if(!_0x2adf8c){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x2001('0x8')]({'uri':'/client-logs','logger':_0x2adf8c,'enableCors':!isProduction})(_0x32c03f,_0x34cee0,_0x11a78a);}router[_0x2001('0x9')](auth[_0x2001('0xa')](),clientSideLogs);module[_0x2001('0xb')]=router; \ No newline at end of file +var _0x5707=['/client-logs','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','app','client-side-logger','expressEndpoint'];(function(_0xd63afb,_0x15e3ee){var _0x51c839=function(_0x155173){while(--_0x155173){_0xd63afb['push'](_0xd63afb['shift']());}};_0x51c839(++_0x15e3ee);}(_0x5707,0x194));var _0x7570=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x5707[_0x367e5b];return _0x4b909e;};var beaverLogger=require(_0x7570('0x0'));var express=require('express');var auth=require(_0x7570('0x1'));var config=require(_0x7570('0x2'));var router=express['Router']();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x386ec1,_0x43c807,_0x35e99c){var _0x28cc86=_0x386ec1[_0x7570('0x3')]['get'](_0x7570('0x4'));if(!_0x28cc86){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x7570('0x5')]({'uri':_0x7570('0x6'),'logger':_0x28cc86,'enableCors':!isProduction})(_0x386ec1,_0x43c807,_0x35e99c);}router[_0x7570('0x7')](auth[_0x7570('0x8')](),clientSideLogs);module[_0x7570('0x9')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 59a91bc..1976cf1 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 _0x54df=['ENUM','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','MicrosoftAzure'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x54df,0xb1));var _0xf54d=function(_0x41b796,_0xa475ea){_0x41b796=_0x41b796-0x0;var _0x53a07c=_0x54df[_0x41b796];return _0x53a07c;};'use strict';var Sequelize=require(_0xf54d('0x0'));module[_0xf54d('0x1')]={'name':{'type':Sequelize[_0xf54d('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xf54d('0x3'),'Google',_0xf54d('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf54d('0x5')]('Outlook365',_0xf54d('0x6'))},'data1':{'type':Sequelize[_0xf54d('0x2')],'comment':_0xf54d('0x7')},'data2':{'type':Sequelize[_0xf54d('0x2')],'comment':_0xf54d('0x8')},'data3':{'type':Sequelize[_0xf54d('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xf54d('0x2')],'comment':_0xf54d('0x9')},'data5':{'type':Sequelize[_0xf54d('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xf54d('0xa')],'comment':_0xf54d('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0xf54d('0xc')}}; \ No newline at end of file +var _0x2a5a=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','STRING','Google','MicrosoftAzure','ENUM'];(function(_0x33c603,_0x6d0ce4){var _0xae96f4=function(_0x2679f8){while(--_0x2679f8){_0x33c603['push'](_0x33c603['shift']());}};_0xae96f4(++_0x6d0ce4);}(_0x2a5a,0xe6));var _0xa2a5=function(_0x2c8eb6,_0x4386ed){_0x2c8eb6=_0x2c8eb6-0x0;var _0x563d40=_0x2a5a[_0x2c8eb6];return _0x563d40;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa2a5('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0xa2a5('0x1'),_0xa2a5('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xa2a5('0x3')](_0xa2a5('0x4'),_0xa2a5('0x5'))},'data1':{'type':Sequelize[_0xa2a5('0x0')],'comment':_0xa2a5('0x6')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0xa2a5('0x7')},'data4':{'type':Sequelize['STRING'],'comment':_0xa2a5('0x8')},'data5':{'type':Sequelize[_0xa2a5('0x9')],'comment':_0xa2a5('0xa')},'data6':{'type':Sequelize[_0xa2a5('0x9')],'comment':_0xa2a5('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0xa2a5('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 42e51c8..cd556ff 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 _0x2d16=['rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','find','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','create','encryptString','oauth2MicrosoftAuthorize','findOne','sendStatus','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','padEnd','slice','map','CloudProvider','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll'];(function(_0x4fce2c,_0x4b856f){var _0x5391d4=function(_0x3cc79e){while(--_0x3cc79e){_0x4fce2c['push'](_0x4fce2c['shift']());}};_0x5391d4(++_0x4b856f);}(_0x2d16,0x15d));var _0x62d1=function(_0x470a31,_0x5d9949){_0x470a31=_0x470a31-0x0;var _0x4d9380=_0x2d16[_0x470a31];return _0x4d9380;};'use strict';var _=require(_0x62d1('0x0'));var Redis=require(_0x62d1('0x1'));var qs=require(_0x62d1('0x2'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x62d1('0x3'))(_0x62d1('0x4'));var db=require(_0x62d1('0x5'))['db'];var oauth=require(_0x62d1('0x6'));config['redis']=_[_0x62d1('0x7')](config[_0x62d1('0x8')],{'host':_0x62d1('0x9'),'port':0x18eb});var socket=require(_0x62d1('0xa'))(new Redis(config[_0x62d1('0x8')]));var redis=new Redis(config[_0x62d1('0x8')]);function respondWithStatusCode(_0x366e06,_0x1b2b6e){_0x1b2b6e=_0x1b2b6e||0xcc;return function(_0xc56d82){if(_0xc56d82){return _0x366e06['sendStatus'](_0x1b2b6e);}return _0x366e06[_0x62d1('0xb')](_0x1b2b6e)[_0x62d1('0xc')]();};}function respondWithResult(_0x22e779,_0x21a7cc){_0x21a7cc=_0x21a7cc||0xc8;return function(_0x3f8647){if(_0x3f8647){return _0x22e779[_0x62d1('0xb')](_0x21a7cc)[_0x62d1('0xd')](_0x3f8647);}};}function respondWithFilteredResult(_0x23a22c,_0x133e02){return function(_0x585d37){if(_0x585d37){var _0x486faf=typeof _0x133e02['offset']===_0x62d1('0xe')&&typeof _0x133e02[_0x62d1('0xf')]===_0x62d1('0xe');var _0x45b986=_0x585d37[_0x62d1('0x10')];var _0x3adb59=_0x486faf?0x0:_0x133e02[_0x62d1('0x11')];var _0x30ec27=_0x486faf?_0x585d37[_0x62d1('0x10')]:_0x133e02[_0x62d1('0x11')]+_0x133e02[_0x62d1('0xf')];var _0x1eb4a0;if(_0x30ec27>=_0x45b986){_0x30ec27=_0x45b986;_0x1eb4a0=0xc8;}else{_0x1eb4a0=0xce;}_0x23a22c[_0x62d1('0xb')](_0x1eb4a0);return _0x23a22c[_0x62d1('0x12')](_0x62d1('0x13'),_0x3adb59+'-'+_0x30ec27+'/'+_0x45b986)['json'](_0x585d37);}return null;};}function saveUpdates(_0x3b276e){return function(_0x3940e3){if(_0x3940e3){return _0x3940e3[_0x62d1('0x14')](_0x3b276e)[_0x62d1('0x15')](function(_0x142db8){return _0x142db8;});}return null;};}function removeEntity(_0x2467a8){return function(_0x12b382){if(_0x12b382){return _0x12b382[_0x62d1('0x16')]()[_0x62d1('0x15')](function(){_0x2467a8[_0x62d1('0xb')](0xcc)[_0x62d1('0xc')]();});}};}function handleEntityNotFound(_0x11f220){return function(_0xf6a6db){if(!_0xf6a6db){_0x11f220['sendStatus'](0x194);}return _0xf6a6db;};}function handleError(_0x4dc4d2,_0x102860){_0x102860=_0x102860||0x1f4;return function(_0x5bd3d6){logger[_0x62d1('0x17')](_0x5bd3d6[_0x62d1('0x18')]);if(_0x5bd3d6[_0x62d1('0x19')]){delete _0x5bd3d6[_0x62d1('0x19')];}_0x4dc4d2['status'](_0x102860)[_0x62d1('0x1a')](_0x5bd3d6);};}function maskClientSecret(_0x34b83d){return _[_0x62d1('0x1b')](_0x34b83d[_0x62d1('0x1c')](0x0,0x3),0x14,'*');}exports['index']=function(_0x304502,_0x4be29e){var _0x2b3956={},_0xc1aed9={},_0x1fc1d2={'count':0x0,'rows':[]};var _0x3c89ac=_[_0x62d1('0x1d')](db[_0x62d1('0x1e')]['rawAttributes'],function(_0x1dd3cd){return{'name':_0x1dd3cd[_0x62d1('0x1f')],'type':_0x1dd3cd[_0x62d1('0x20')][_0x62d1('0x21')]};});_0xc1aed9[_0x62d1('0x22')]=_['map'](_0x3c89ac,'name');_0xc1aed9['query']=_[_0x62d1('0x23')](_0x304502[_0x62d1('0x24')]);_0xc1aed9[_0x62d1('0x25')]=_[_0x62d1('0x26')](_0xc1aed9['model'],_0xc1aed9['query']);_0x2b3956[_0x62d1('0x27')]=_[_0x62d1('0x26')](_0xc1aed9[_0x62d1('0x22')],qs[_0x62d1('0x28')](_0x304502[_0x62d1('0x24')][_0x62d1('0x28')]));_0x2b3956['attributes']=_0x2b3956[_0x62d1('0x27')][_0x62d1('0x29')]?_0x2b3956['attributes']:_0xc1aed9[_0x62d1('0x22')];if(!_0x304502[_0x62d1('0x24')][_0x62d1('0x2a')](_0x62d1('0x2b'))){_0x2b3956[_0x62d1('0xf')]=qs[_0x62d1('0xf')](_0x304502[_0x62d1('0x24')]['limit']);_0x2b3956[_0x62d1('0x11')]=qs[_0x62d1('0x11')](_0x304502[_0x62d1('0x24')][_0x62d1('0x11')]);}_0x2b3956[_0x62d1('0x2c')]=qs[_0x62d1('0x2d')](_0x304502[_0x62d1('0x24')][_0x62d1('0x2d')]);_0x2b3956[_0x62d1('0x2e')]=qs['filters'](_[_0x62d1('0x2f')](_0x304502[_0x62d1('0x24')],_0xc1aed9[_0x62d1('0x25')]),_0x3c89ac);if(_0x304502[_0x62d1('0x24')]['filter']){_0x2b3956[_0x62d1('0x2e')]=_['merge'](_0x2b3956['where'],{'$or':_['map'](_0x3c89ac,function(_0x254eb9){if(_0x254eb9['type']!==_0x62d1('0x30')){var _0x1097d2={};_0x1097d2[_0x254eb9[_0x62d1('0x19')]]={'$like':'%'+_0x304502[_0x62d1('0x24')][_0x62d1('0x31')]+'%'};return _0x1097d2;}})});}_0x2b3956=_[_0x62d1('0x32')]({},_0x2b3956,_0x304502[_0x62d1('0x33')]);var _0x26a05b={'where':_0x2b3956[_0x62d1('0x2e')]};return db[_0x62d1('0x1e')][_0x62d1('0x10')](_0x26a05b)['then'](function(_0x54e569){_0x1fc1d2['count']=_0x54e569;if(_0x304502['query'][_0x62d1('0x34')]){_0x2b3956[_0x62d1('0x35')]=[{'all':!![]}];}return db[_0x62d1('0x1e')][_0x62d1('0x36')](_0x2b3956);})['then'](function(_0x3953b0){_0x1fc1d2[_0x62d1('0x37')]=_['map'](_0x3953b0,function(_0x3f828e){if(_0x3f828e[_0x62d1('0x38')]===_0x62d1('0x39')){var _0x4222d5=encryptor[_0x62d1('0x3a')](_0x3f828e[_0x62d1('0x3b')]);_0x3f828e[_0x62d1('0x3b')]=maskClientSecret(_0x4222d5);}return _0x3f828e;});return _0x1fc1d2;})[_0x62d1('0x15')](respondWithFilteredResult(_0x4be29e,_0x2b3956))[_0x62d1('0x3c')](handleError(_0x4be29e,null));};exports[_0x62d1('0x3d')]=function(_0x588632,_0x28a17e){var _0x16391e={'raw':!![],'where':{'id':_0x588632[_0x62d1('0x3e')]['id']}},_0x23eccc={};_0x23eccc['model']=_[_0x62d1('0x23')](db[_0x62d1('0x1e')][_0x62d1('0x3f')]);_0x23eccc[_0x62d1('0x24')]=_[_0x62d1('0x23')](_0x588632['query']);_0x23eccc[_0x62d1('0x25')]=_['intersection'](_0x23eccc[_0x62d1('0x22')],_0x23eccc['query']);_0x16391e[_0x62d1('0x27')]=_[_0x62d1('0x26')](_0x23eccc[_0x62d1('0x22')],qs[_0x62d1('0x28')](_0x588632['query']['fields']));_0x16391e[_0x62d1('0x27')]=_0x16391e['attributes'][_0x62d1('0x29')]?_0x16391e[_0x62d1('0x27')]:_0x23eccc[_0x62d1('0x22')];if(_0x588632[_0x62d1('0x24')]['includeAll']){_0x16391e[_0x62d1('0x35')]=[{'all':!![]}];}_0x16391e=_[_0x62d1('0x32')]({},_0x16391e,_0x588632[_0x62d1('0x33')]);return db[_0x62d1('0x1e')][_0x62d1('0x40')](_0x16391e)[_0x62d1('0x15')](handleEntityNotFound(_0x28a17e,null))[_0x62d1('0x15')](function(_0x21f6ec){if(_0x21f6ec[_0x62d1('0x38')]===_0x62d1('0x39')){var _0x228e62=encryptor[_0x62d1('0x3a')](_0x21f6ec[_0x62d1('0x3b')]);_0x21f6ec[_0x62d1('0x3b')]=maskClientSecret(_0x228e62);}return _0x21f6ec;})[_0x62d1('0x15')](respondWithResult(_0x28a17e,null))['catch'](handleError(_0x28a17e,null));};exports['create']=function(_0x2c6ff2,_0x3724b7){if(!_0x2c6ff2[_0x62d1('0x41')][_0x62d1('0x19')])throw new Error(_0x62d1('0x42'));if(!_0x2c6ff2[_0x62d1('0x41')][_0x62d1('0x38')])throw new Error(_0x62d1('0x43'));var _0x128f5f=db[_0x62d1('0x1e')][_0x62d1('0x3f')][_0x62d1('0x38')]['values'];if(!_0x128f5f['includes'](_0x2c6ff2[_0x62d1('0x41')][_0x62d1('0x38')]))throw new Error(_0x62d1('0x44')+_0x128f5f['join'](',\x20'));if(_0x2c6ff2[_0x62d1('0x41')][_0x62d1('0x38')]===_0x62d1('0x39')&&_0x2c6ff2[_0x62d1('0x41')][_0x62d1('0x3b')]){_0x2c6ff2['body'][_0x62d1('0x3b')]=encryptor['encryptString'](_0x2c6ff2[_0x62d1('0x41')]['data3']);}return db['CloudProvider'][_0x62d1('0x45')](_0x2c6ff2[_0x62d1('0x41')],{})[_0x62d1('0x15')](respondWithResult(_0x3724b7,0xc9))[_0x62d1('0x3c')](handleError(_0x3724b7,null));};exports[_0x62d1('0x14')]=function(_0x5eb1dc,_0x242cd5){if(_0x5eb1dc[_0x62d1('0x41')]['id']){delete _0x5eb1dc['body']['id'];}return db[_0x62d1('0x1e')][_0x62d1('0x40')]({'where':{'id':_0x5eb1dc[_0x62d1('0x3e')]['id']}})['then'](handleEntityNotFound(_0x242cd5,null))[_0x62d1('0x15')](function(_0x8d432b){if(_0x8d432b[_0x62d1('0x38')]===_0x62d1('0x39')&&_0x5eb1dc[_0x62d1('0x41')][_0x62d1('0x3b')]){_0x5eb1dc['body'][_0x62d1('0x3b')]=encryptor[_0x62d1('0x46')](_0x5eb1dc['body'][_0x62d1('0x3b')]);}return _0x8d432b;})[_0x62d1('0x15')](saveUpdates(_0x5eb1dc[_0x62d1('0x41')],null))['then'](respondWithResult(_0x242cd5,null))[_0x62d1('0x3c')](handleError(_0x242cd5,null));};exports[_0x62d1('0x16')]=function(_0x191e6e,_0x34d131){return db['CloudProvider']['find']({'where':{'id':_0x191e6e[_0x62d1('0x3e')]['id']}})[_0x62d1('0x15')](handleEntityNotFound(_0x34d131,null))[_0x62d1('0x15')](removeEntity(_0x34d131,null))[_0x62d1('0x3c')](handleError(_0x34d131,null));};exports[_0x62d1('0x47')]=function(_0x207249,_0x123180){return db[_0x62d1('0x1e')][_0x62d1('0x48')]({'where':{'id':_0x207249[_0x62d1('0x3e')]['id']},'raw':!![]})[_0x62d1('0x15')](function(_0x4c41c4){if(!_0x4c41c4)return _0x123180[_0x62d1('0x49')](0x194);return{'url':oauth[_0x62d1('0x4a')](_0x4c41c4,_0x207249['user']['id'])};})[_0x62d1('0x15')](respondWithResult(_0x123180,null))[_0x62d1('0x3c')](handleError(_0x123180,null));};exports[_0x62d1('0x4b')]=function(_0x4415a8,_0x53364d){var _0x1f85e6=_0x4415a8[_0x62d1('0x41')];var _0x4ebf4d;var _0x149f2c;if(_0x1f85e6[_0x62d1('0x17')])throw _0x1f85e6;redis[_0x62d1('0x4c')](_0x1f85e6[_0x62d1('0x4d')])[_0x62d1('0x15')](function(_0x4e090b){if(!_0x4e090b)throw new Error(_0x62d1('0x4e'));_0x4ebf4d=JSON['parse'](_0x4e090b);var _0x57b2d7=Buffer[_0x62d1('0x4f')](_0x1f85e6[_0x62d1('0x4d')],_0x62d1('0x50'))[_0x62d1('0x51')](_0x62d1('0x52'));_0x149f2c=JSON[_0x62d1('0x53')](_0x57b2d7);if(!oauth['isValidIdToken'](_0x1f85e6[_0x62d1('0x54')],_0x4ebf4d['oauth2Claims']))throw new Error(_0x62d1('0x55'));redis[_0x62d1('0x56')](_0x1f85e6[_0x62d1('0x4d')]);return oauth[_0x62d1('0x57')](_0x1f85e6[_0x62d1('0x58')],_0x4ebf4d);})[_0x62d1('0x15')](function(_0x22812b){_0x4ebf4d[_0x62d1('0x59')]=_0x22812b[_0x62d1('0x5a')];_0x4ebf4d['data6']=_0x22812b[_0x62d1('0x5b')];return db['CloudProvider'][_0x62d1('0x14')]({'data5':_0x4ebf4d[_0x62d1('0x59')],'data6':_0x4ebf4d[_0x62d1('0x5c')]},{'where':{'id':_0x4ebf4d['id']}});})['then'](function(){oauth[_0x62d1('0x5d')](_0x4ebf4d);socket[_0x62d1('0x5e')](_0x62d1('0x5f'),{'id':_0x149f2c['id']});return;})[_0x62d1('0x15')](respondWithStatusCode(_0x53364d,null))[_0x62d1('0x3c')](function(_0x33a976){if(_0x149f2c){socket[_0x62d1('0x5e')](_0x62d1('0x60'),{'id':_0x149f2c['id']});}if(!_0x4ebf4d){logger[_0x62d1('0x17')](_0x62d1('0x61'),_0x33a976);return _0x53364d['status'](0x1f4)[_0x62d1('0x1a')](_0x33a976[_0x62d1('0x62')]);}logger[_0x62d1('0x17')](_0x62d1('0x63'),_0x4ebf4d['id'],JSON[_0x62d1('0x64')](_0x33a976));});}; \ No newline at end of file +var _0xbf28=['index','map','CloudProvider','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','decryptString','data3','catch','show','params','rawAttributes','find','service','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','sendStatus','stack','name','send','slice'];(function(_0x47301f,_0xe86c3b){var _0xa74f0a=function(_0x35fafb){while(--_0x35fafb){_0x47301f['push'](_0x47301f['shift']());}};_0xa74f0a(++_0xe86c3b);}(_0xbf28,0xae));var _0x8bf2=function(_0xd38693,_0x43b9ca){_0xd38693=_0xd38693-0x0;var _0x4dafcb=_0xbf28[_0xd38693];return _0x4dafcb;};'use strict';var _=require(_0x8bf2('0x0'));var Redis=require(_0x8bf2('0x1'));var qs=require(_0x8bf2('0x2'));var encryptor=require(_0x8bf2('0x3'));var config=require(_0x8bf2('0x4'));var logger=require(_0x8bf2('0x5'))(_0x8bf2('0x6'));var db=require('../../mysqldb')['db'];var oauth=require(_0x8bf2('0x7'));config[_0x8bf2('0x8')]=_['defaults'](config[_0x8bf2('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x8bf2('0x9'))(new Redis(config[_0x8bf2('0x8')]));var redis=new Redis(config[_0x8bf2('0x8')]);function respondWithStatusCode(_0x24ae9f,_0x4eba7f){_0x4eba7f=_0x4eba7f||0xcc;return function(_0x14b62d){if(_0x14b62d){return _0x24ae9f['sendStatus'](_0x4eba7f);}return _0x24ae9f[_0x8bf2('0xa')](_0x4eba7f)[_0x8bf2('0xb')]();};}function respondWithResult(_0x575224,_0x205426){_0x205426=_0x205426||0xc8;return function(_0x489dad){if(_0x489dad){return _0x575224[_0x8bf2('0xa')](_0x205426)[_0x8bf2('0xc')](_0x489dad);}};}function respondWithFilteredResult(_0x3ac935,_0x37daa4){return function(_0x379695){if(_0x379695){var _0x26b5eb=typeof _0x37daa4[_0x8bf2('0xd')]===_0x8bf2('0xe')&&typeof _0x37daa4[_0x8bf2('0xf')]==='undefined';var _0x2157ae=_0x379695[_0x8bf2('0x10')];var _0x393a57=_0x26b5eb?0x0:_0x37daa4[_0x8bf2('0xd')];var _0x5391bb=_0x26b5eb?_0x379695[_0x8bf2('0x10')]:_0x37daa4[_0x8bf2('0xd')]+_0x37daa4[_0x8bf2('0xf')];var _0x8b923d;if(_0x5391bb>=_0x2157ae){_0x5391bb=_0x2157ae;_0x8b923d=0xc8;}else{_0x8b923d=0xce;}_0x3ac935[_0x8bf2('0xa')](_0x8b923d);return _0x3ac935[_0x8bf2('0x11')](_0x8bf2('0x12'),_0x393a57+'-'+_0x5391bb+'/'+_0x2157ae)[_0x8bf2('0xc')](_0x379695);}return null;};}function saveUpdates(_0x2701ec){return function(_0x1ec417){if(_0x1ec417){return _0x1ec417['update'](_0x2701ec)[_0x8bf2('0x13')](function(_0x4f30fc){return _0x4f30fc;});}return null;};}function removeEntity(_0x4a063b){return function(_0x391147){if(_0x391147){return _0x391147[_0x8bf2('0x14')]()['then'](function(){_0x4a063b['status'](0xcc)[_0x8bf2('0xb')]();});}};}function handleEntityNotFound(_0x16426a){return function(_0x27e7c1){if(!_0x27e7c1){_0x16426a[_0x8bf2('0x15')](0x194);}return _0x27e7c1;};}function handleError(_0x5d6cb1,_0x52a937){_0x52a937=_0x52a937||0x1f4;return function(_0xc93bb1){logger['error'](_0xc93bb1[_0x8bf2('0x16')]);if(_0xc93bb1[_0x8bf2('0x17')]){delete _0xc93bb1[_0x8bf2('0x17')];}_0x5d6cb1['status'](_0x52a937)[_0x8bf2('0x18')](_0xc93bb1);};}function maskClientSecret(_0x12a392){return _['padEnd'](_0x12a392[_0x8bf2('0x19')](0x0,0x3),0x14,'*');}exports[_0x8bf2('0x1a')]=function(_0x337652,_0x5edfe2){var _0x41ff66={},_0x51b4bf={},_0x5c1680={'count':0x0,'rows':[]};var _0x1bbf47=_[_0x8bf2('0x1b')](db[_0x8bf2('0x1c')]['rawAttributes'],function(_0x5274c4){return{'name':_0x5274c4[_0x8bf2('0x1d')],'type':_0x5274c4['type'][_0x8bf2('0x1e')]};});_0x51b4bf[_0x8bf2('0x1f')]=_[_0x8bf2('0x1b')](_0x1bbf47,_0x8bf2('0x17'));_0x51b4bf[_0x8bf2('0x20')]=_[_0x8bf2('0x21')](_0x337652[_0x8bf2('0x20')]);_0x51b4bf['filters']=_['intersection'](_0x51b4bf[_0x8bf2('0x1f')],_0x51b4bf[_0x8bf2('0x20')]);_0x41ff66[_0x8bf2('0x22')]=_[_0x8bf2('0x23')](_0x51b4bf['model'],qs[_0x8bf2('0x24')](_0x337652[_0x8bf2('0x20')][_0x8bf2('0x24')]));_0x41ff66[_0x8bf2('0x22')]=_0x41ff66[_0x8bf2('0x22')][_0x8bf2('0x25')]?_0x41ff66[_0x8bf2('0x22')]:_0x51b4bf[_0x8bf2('0x1f')];if(!_0x337652[_0x8bf2('0x20')][_0x8bf2('0x26')]('nolimit')){_0x41ff66['limit']=qs[_0x8bf2('0xf')](_0x337652[_0x8bf2('0x20')][_0x8bf2('0xf')]);_0x41ff66[_0x8bf2('0xd')]=qs[_0x8bf2('0xd')](_0x337652[_0x8bf2('0x20')]['offset']);}_0x41ff66['order']=qs[_0x8bf2('0x27')](_0x337652[_0x8bf2('0x20')][_0x8bf2('0x27')]);_0x41ff66[_0x8bf2('0x28')]=qs[_0x8bf2('0x29')](_[_0x8bf2('0x2a')](_0x337652[_0x8bf2('0x20')],_0x51b4bf['filters']),_0x1bbf47);if(_0x337652['query'][_0x8bf2('0x2b')]){_0x41ff66[_0x8bf2('0x28')]=_['merge'](_0x41ff66['where'],{'$or':_['map'](_0x1bbf47,function(_0x3d6463){if(_0x3d6463[_0x8bf2('0x2c')]!==_0x8bf2('0x2d')){var _0x17fbd6={};_0x17fbd6[_0x3d6463['name']]={'$like':'%'+_0x337652[_0x8bf2('0x20')][_0x8bf2('0x2b')]+'%'};return _0x17fbd6;}})});}_0x41ff66=_[_0x8bf2('0x2e')]({},_0x41ff66,_0x337652[_0x8bf2('0x2f')]);var _0x4481d2={'where':_0x41ff66[_0x8bf2('0x28')]};return db[_0x8bf2('0x1c')]['count'](_0x4481d2)['then'](function(_0x587184){_0x5c1680[_0x8bf2('0x10')]=_0x587184;if(_0x337652['query'][_0x8bf2('0x30')]){_0x41ff66[_0x8bf2('0x31')]=[{'all':!![]}];}return db[_0x8bf2('0x1c')][_0x8bf2('0x32')](_0x41ff66);})[_0x8bf2('0x13')](function(_0x522d5b){_0x5c1680['rows']=_[_0x8bf2('0x1b')](_0x522d5b,function(_0x1a2c3f){if(_0x1a2c3f['service']==='MicrosoftAzure'){var _0x4eccab=encryptor[_0x8bf2('0x33')](_0x1a2c3f[_0x8bf2('0x34')]);_0x1a2c3f[_0x8bf2('0x34')]=maskClientSecret(_0x4eccab);}return _0x1a2c3f;});return _0x5c1680;})['then'](respondWithFilteredResult(_0x5edfe2,_0x41ff66))[_0x8bf2('0x35')](handleError(_0x5edfe2,null));};exports[_0x8bf2('0x36')]=function(_0x19d9b6,_0x4f4512){var _0x5f5694={'raw':!![],'where':{'id':_0x19d9b6[_0x8bf2('0x37')]['id']}},_0x50f1a1={};_0x50f1a1['model']=_[_0x8bf2('0x21')](db[_0x8bf2('0x1c')][_0x8bf2('0x38')]);_0x50f1a1[_0x8bf2('0x20')]=_['keys'](_0x19d9b6[_0x8bf2('0x20')]);_0x50f1a1[_0x8bf2('0x29')]=_[_0x8bf2('0x23')](_0x50f1a1[_0x8bf2('0x1f')],_0x50f1a1[_0x8bf2('0x20')]);_0x5f5694[_0x8bf2('0x22')]=_['intersection'](_0x50f1a1[_0x8bf2('0x1f')],qs[_0x8bf2('0x24')](_0x19d9b6[_0x8bf2('0x20')][_0x8bf2('0x24')]));_0x5f5694[_0x8bf2('0x22')]=_0x5f5694[_0x8bf2('0x22')][_0x8bf2('0x25')]?_0x5f5694['attributes']:_0x50f1a1[_0x8bf2('0x1f')];if(_0x19d9b6['query']['includeAll']){_0x5f5694[_0x8bf2('0x31')]=[{'all':!![]}];}_0x5f5694=_[_0x8bf2('0x2e')]({},_0x5f5694,_0x19d9b6[_0x8bf2('0x2f')]);return db[_0x8bf2('0x1c')][_0x8bf2('0x39')](_0x5f5694)[_0x8bf2('0x13')](handleEntityNotFound(_0x4f4512,null))[_0x8bf2('0x13')](function(_0x4857a0){if(_0x4857a0[_0x8bf2('0x3a')]===_0x8bf2('0x3b')){var _0x4a3ec7=encryptor[_0x8bf2('0x33')](_0x4857a0[_0x8bf2('0x34')]);_0x4857a0[_0x8bf2('0x34')]=maskClientSecret(_0x4a3ec7);}return _0x4857a0;})[_0x8bf2('0x13')](respondWithResult(_0x4f4512,null))[_0x8bf2('0x35')](handleError(_0x4f4512,null));};exports[_0x8bf2('0x3c')]=function(_0x469033,_0x4b211d){if(!_0x469033[_0x8bf2('0x3d')][_0x8bf2('0x17')])throw new Error(_0x8bf2('0x3e'));if(!_0x469033[_0x8bf2('0x3d')][_0x8bf2('0x3a')])throw new Error(_0x8bf2('0x3f'));var _0x1fd95=db['CloudProvider']['rawAttributes'][_0x8bf2('0x3a')][_0x8bf2('0x40')];if(!_0x1fd95[_0x8bf2('0x41')](_0x469033[_0x8bf2('0x3d')]['service']))throw new Error(_0x8bf2('0x42')+_0x1fd95[_0x8bf2('0x43')](',\x20'));if(_0x469033[_0x8bf2('0x3d')][_0x8bf2('0x3a')]===_0x8bf2('0x3b')&&_0x469033['body'][_0x8bf2('0x34')]){_0x469033['body']['data3']=encryptor[_0x8bf2('0x44')](_0x469033[_0x8bf2('0x3d')]['data3']);}return db[_0x8bf2('0x1c')][_0x8bf2('0x3c')](_0x469033['body'],{})['then'](respondWithResult(_0x4b211d,0xc9))[_0x8bf2('0x35')](handleError(_0x4b211d,null));};exports[_0x8bf2('0x45')]=function(_0x42929c,_0x21efb8){if(_0x42929c['body']['id']){delete _0x42929c[_0x8bf2('0x3d')]['id'];}return db[_0x8bf2('0x1c')]['find']({'where':{'id':_0x42929c[_0x8bf2('0x37')]['id']}})[_0x8bf2('0x13')](handleEntityNotFound(_0x21efb8,null))[_0x8bf2('0x13')](function(_0x38fb58){if(_0x38fb58[_0x8bf2('0x3a')]===_0x8bf2('0x3b')&&_0x42929c[_0x8bf2('0x3d')][_0x8bf2('0x34')]){_0x42929c['body'][_0x8bf2('0x34')]=encryptor[_0x8bf2('0x44')](_0x42929c['body'][_0x8bf2('0x34')]);}return _0x38fb58;})['then'](saveUpdates(_0x42929c[_0x8bf2('0x3d')],null))[_0x8bf2('0x13')](respondWithResult(_0x21efb8,null))[_0x8bf2('0x35')](handleError(_0x21efb8,null));};exports['destroy']=function(_0x168de4,_0x580039){return db['CloudProvider']['find']({'where':{'id':_0x168de4[_0x8bf2('0x37')]['id']}})[_0x8bf2('0x13')](handleEntityNotFound(_0x580039,null))[_0x8bf2('0x13')](removeEntity(_0x580039,null))['catch'](handleError(_0x580039,null));};exports['oauth2MicrosoftAuthorize']=function(_0x4f4871,_0x2ce304){return db['CloudProvider'][_0x8bf2('0x46')]({'where':{'id':_0x4f4871['params']['id']},'raw':!![]})[_0x8bf2('0x13')](function(_0x1f9460){if(!_0x1f9460)return _0x2ce304[_0x8bf2('0x15')](0x194);return{'url':oauth[_0x8bf2('0x47')](_0x1f9460,_0x4f4871[_0x8bf2('0x48')]['id'])};})[_0x8bf2('0x13')](respondWithResult(_0x2ce304,null))['catch'](handleError(_0x2ce304,null));};exports[_0x8bf2('0x49')]=function(_0x2e8b5a,_0x495bd7){var _0x1be4e4=_0x2e8b5a['body'];var _0x124277;var _0x586c32;if(_0x1be4e4['error'])throw _0x1be4e4;redis[_0x8bf2('0x4a')](_0x1be4e4[_0x8bf2('0x4b')])[_0x8bf2('0x13')](function(_0x1294c1){if(!_0x1294c1)throw new Error(_0x8bf2('0x4c'));_0x124277=JSON['parse'](_0x1294c1);var _0x295793=Buffer[_0x8bf2('0x4d')](_0x1be4e4[_0x8bf2('0x4b')],_0x8bf2('0x4e'))[_0x8bf2('0x4f')](_0x8bf2('0x50'));_0x586c32=JSON[_0x8bf2('0x51')](_0x295793);if(!oauth[_0x8bf2('0x52')](_0x1be4e4[_0x8bf2('0x53')],_0x124277[_0x8bf2('0x54')]))throw new Error(_0x8bf2('0x55'));redis[_0x8bf2('0x56')](_0x1be4e4[_0x8bf2('0x4b')]);return oauth[_0x8bf2('0x57')](_0x1be4e4['code'],_0x124277);})[_0x8bf2('0x13')](function(_0x45b96c){_0x124277[_0x8bf2('0x58')]=_0x45b96c['access_token'];_0x124277[_0x8bf2('0x59')]=_0x45b96c[_0x8bf2('0x5a')];return db[_0x8bf2('0x1c')][_0x8bf2('0x45')]({'data5':_0x124277[_0x8bf2('0x58')],'data6':_0x124277[_0x8bf2('0x59')]},{'where':{'id':_0x124277['id']}});})[_0x8bf2('0x13')](function(){oauth[_0x8bf2('0x5b')](_0x124277);socket['emit'](_0x8bf2('0x5c'),{'id':_0x586c32['id']});return;})[_0x8bf2('0x13')](respondWithStatusCode(_0x495bd7,null))['catch'](function(_0x3aa2a8){if(_0x586c32){socket[_0x8bf2('0x5d')](_0x8bf2('0x5e'),{'id':_0x586c32['id']});}if(!_0x124277){logger[_0x8bf2('0x5f')](_0x8bf2('0x60'),_0x3aa2a8);return _0x495bd7[_0x8bf2('0xa')](0x1f4)[_0x8bf2('0x18')](_0x3aa2a8[_0x8bf2('0x61')]);}logger['error'](_0x8bf2('0x62'),_0x124277['id'],JSON[_0x8bf2('0x63')](_0x3aa2a8));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index b3458e5..4c7fae1 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 _0x4d2d=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util'];(function(_0x2575b8,_0x23d9cb){var _0x24762b=function(_0xc062f6){while(--_0xc062f6){_0x2575b8['push'](_0x2575b8['shift']());}};_0x24762b(++_0x23d9cb);}(_0x4d2d,0x184));var _0xd4d2=function(_0x1e48b3,_0x3150bc){_0x1e48b3=_0x1e48b3-0x0;var _0x295fae=_0x4d2d[_0x1e48b3];return _0x295fae;};'use strict';var _=require(_0xd4d2('0x0'));var util=require(_0xd4d2('0x1'));var logger=require(_0xd4d2('0x2'))(_0xd4d2('0x3'));var moment=require(_0xd4d2('0x4'));var BPromise=require(_0xd4d2('0x5'));var rp=require(_0xd4d2('0x6'));var fs=require('fs');var path=require(_0xd4d2('0x7'));var rimraf=require('rimraf');var config=require(_0xd4d2('0x8'));var attributes=require(_0xd4d2('0x9'));module['exports']=function(_0x5046f1,_0x5b452a){return _0x5046f1[_0xd4d2('0xa')](_0xd4d2('0xb'),attributes,{'tableName':_0xd4d2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd14=['rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x487ee4,_0x3d3e66){var _0x3b0877=function(_0x5fba36){while(--_0x5fba36){_0x487ee4['push'](_0x487ee4['shift']());}};_0x3b0877(++_0x3d3e66);}(_0xfd14,0x1aa));var _0x4fd1=function(_0x386194,_0x176a56){_0x386194=_0x386194-0x0;var _0x4889b0=_0xfd14[_0x386194];return _0x4889b0;};'use strict';var _=require(_0x4fd1('0x0'));var util=require('util');var logger=require(_0x4fd1('0x1'))(_0x4fd1('0x2'));var moment=require('moment');var BPromise=require(_0x4fd1('0x3'));var rp=require(_0x4fd1('0x4'));var fs=require('fs');var path=require(_0x4fd1('0x5'));var rimraf=require(_0x4fd1('0x6'));var config=require(_0x4fd1('0x7'));var attributes=require(_0x4fd1('0x8'));module['exports']=function(_0x3858fe,_0x360d06){return _0x3858fe[_0x4fd1('0x9')](_0x4fd1('0xa'),attributes,{'tableName':_0x4fd1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index b1d360d..26fa2b6 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80d9=['resolve','CloudProvider','findOne','then','data6','data4','decryptString','POST','replace','data5','access_token','refresh_token','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','data3','intervals','bind','findAll','catch','inspect','exports','moment','ioredis','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','{TENANT_ID}','data2','code','id_token','from','stringify','toString','randomBytes','hex','client_id','data1','response_type','response_mode','form_post','nonce','login','key','oauth2Claims','oauth2/','set','decode','payload','iss','aud','audience','isAfter','unix','exp'];(function(_0x24003a,_0x4f4649){var _0x1d76b0=function(_0x5d020c){while(--_0x5d020c){_0x24003a['push'](_0x24003a['shift']());}};_0x1d76b0(++_0x4f4649);}(_0x80d9,0x106));var _0x980d=function(_0x166371,_0x3d6cbd){_0x166371=_0x166371-0x0;var _0x16d191=_0x80d9[_0x166371];return _0x16d191;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0x980d('0x0'));var Redis=require(_0x980d('0x1'));var rp=require(_0x980d('0x2'));var util=require(_0x980d('0x3'));var encryptor=require('../../components/encryptor');var config=require(_0x980d('0x4'));var logger=require(_0x980d('0x5'))(_0x980d('0x6'));var schedule=require(_0x980d('0x7'));var db=require(_0x980d('0x8'))['db'];config[_0x980d('0x9')]=_[_0x980d('0xa')](config[_0x980d('0x9')],{'host':_0x980d('0xb'),'port':0x18eb});var redis=new Redis(config[_0x980d('0x9')]);var MICROSOFT_AUTH_URL=_0x980d('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x980d('0xd'),_0x980d('0xe'),_0x980d('0xf'),_0x980d('0x10'),_0x980d('0x11'),_0x980d('0x12'),_0x980d('0x13')],'Dynamics365':['openid',_0x980d('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x980d('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x980d('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x48d102){var _0x34f5ef=_[_0x980d('0x16')](AZURE_AUTH_SCOPES[_0x48d102['type']]);if(_0x48d102[_0x980d('0x17')]===_0x980d('0x18'))_0x34f5ef[_0x980d('0x19')](_0x48d102[_0x980d('0x1a')]+_0x980d('0x1b'));return _0x34f5ef[_0x980d('0x1c')]('\x20');}function getAccessTokenScope(_0xf1431){if(_0xf1431[_0x980d('0x17')]===_0x980d('0x1d'))return _0x980d('0x11');if(_0xf1431[_0x980d('0x17')]===_0x980d('0x18'))return _0xf1431['data7']+_0x980d('0x1b');}function generateMicrosoftAuthorizationUrl(_0x784ce7,_0x47fecf){var _0x115263=MICROSOFT_AUTH_URL['replace'](_0x980d('0x1e'),_0x784ce7[_0x980d('0x1f')]);var _0x58799c=[_0x980d('0x20'),_0x980d('0x21')];var _0x525a97=Buffer[_0x980d('0x22')](JSON[_0x980d('0x23')]({'id':_0x47fecf}))[_0x980d('0x24')]('base64');var _0x125638=crypto[_0x980d('0x25')](0x10)[_0x980d('0x24')](_0x980d('0x26'));var _0x5ec0d0=getAuthorizationScopes(_0x784ce7);var _0x4fcd55=[{'key':_0x980d('0x27'),'value':_0x784ce7[_0x980d('0x28')]},{'key':_0x980d('0x29'),'value':encodeURIComponent(_0x58799c['join']('\x20'))},{'key':'redirect_uri','value':_0x784ce7['data4']},{'key':_0x980d('0x2a'),'value':_0x980d('0x2b')},{'key':'scope','value':encodeURIComponent(_0x5ec0d0)},{'key':'state','value':_0x525a97},{'key':_0x980d('0x2c'),'value':_0x125638},{'key':'prompt','value':_0x980d('0x2d')}];var _0x290566=_0x115263+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x980d('0x16')](_0x4fcd55,function(_0x909d3){return _0x909d3[_0x980d('0x2e')]+'='+_0x909d3['value'];})[_0x980d('0x1c')]('&');_0x784ce7[_0x980d('0x2f')]={'issuer':_0x115263['replace'](_0x980d('0x30'),''),'audience':_0x784ce7['data1'],'state':_0x525a97,'nonce':_0x125638};redis[_0x980d('0x31')](_0x525a97,JSON[_0x980d('0x23')](_0x784ce7));return _0x290566;}function isValidIdToken(_0x313a20,_0x1b5c82){try{var _0xf0050b=jwt[_0x980d('0x32')](_0x313a20,{'complete':!![]});var _0x47762f=_0xf0050b[_0x980d('0x33')];if(_0x47762f[_0x980d('0x34')]!==_0x1b5c82['issuer'])return![];if(_0x47762f[_0x980d('0x35')]!==_0x1b5c82[_0x980d('0x36')])return![];if(_0x47762f[_0x980d('0x2c')]!==_0x1b5c82[_0x980d('0x2c')])return![];if(moment()[_0x980d('0x37')](moment[_0x980d('0x38')](_0x47762f[_0x980d('0x39')])))return![];return!![];}catch(_0x458d9f){throw _0x458d9f;}}function refreshOauth2MicrosoftAccessToken(_0x179584){return Promise[_0x980d('0x3a')]()['then'](function(){if(_0x179584['data3'])return _0x179584;return db[_0x980d('0x3b')][_0x980d('0x3c')]({'where':{'id':_0x179584['id']},'raw':!![]});})[_0x980d('0x3d')](function(_0x1c3c36){var _0x390776={'grant_type':'refresh_token','refresh_token':_0x1c3c36[_0x980d('0x3e')],'scope':getAccessTokenScope(_0x1c3c36),'redirect_uri':_0x1c3c36[_0x980d('0x3f')],'client_id':_0x1c3c36[_0x980d('0x28')],'client_secret':encryptor[_0x980d('0x40')](_0x1c3c36['data3'])};var _0x5e6d6b={'method':_0x980d('0x41'),'uri':MICROSOFT_AUTH_URL[_0x980d('0x42')](_0x980d('0x1e'),_0x1c3c36['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x390776,'json':!![]};return rp(_0x5e6d6b);})[_0x980d('0x3d')](function(_0x9a6f48){_0x179584[_0x980d('0x43')]=_0x9a6f48[_0x980d('0x44')];_0x179584[_0x980d('0x3e')]=_0x9a6f48[_0x980d('0x45')];return db[_0x980d('0x3b')][_0x980d('0x46')]({'data5':_0x179584[_0x980d('0x43')],'data6':_0x179584[_0x980d('0x3e')]},{'where':{'id':_0x179584['id']}});})[_0x980d('0x3d')](function(){return _0x179584;})['catch'](function(_0x70b726){logger[_0x980d('0x47')](_0x980d('0x48'),_0x179584['id'],_0x70b726);});}function getOauth2MicrosoftAccessToken(_0x5a54cd,_0xed766b){var _0x1be2c1={'grant_type':'authorization_code','code':_0x5a54cd,'scope':getAccessTokenScope(_0xed766b),'redirect_uri':_0xed766b[_0x980d('0x3f')],'client_id':_0xed766b[_0x980d('0x28')],'client_secret':encryptor['decryptString'](_0xed766b[_0x980d('0x49')])};var _0x344ce0={'method':_0x980d('0x41'),'uri':MICROSOFT_AUTH_URL[_0x980d('0x42')](_0x980d('0x1e'),_0xed766b[_0x980d('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1be2c1,'json':!![]};return rp(_0x344ce0);}function startRefreshInterval(_0x2e9e98){var _0x5dc2ae=schedule[_0x980d('0x4a')];if(_0x5dc2ae[_0x2e9e98['id']])clearInterval(_0x5dc2ae[_0x2e9e98['id']]);_0x5dc2ae[_0x2e9e98['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x980d('0x4b')](this,{'id':_0x2e9e98['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x5dc2ae;}function startAllRefreshIntervals(){return db[_0x980d('0x3b')][_0x980d('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x980d('0x3d')](function(_0x4a5888){var _0x175810=_0x4a5888[_0x980d('0x16')](function(_0x193c6e){return refreshOauth2MicrosoftAccessToken(_0x193c6e)[_0x980d('0x3d')](function(_0x218669){startRefreshInterval(_0x218669);});});return Promise['all'](_0x175810);})[_0x980d('0x4d')](function(_0x40bdad){var _0x4927a2=_0x40bdad?util[_0x980d('0x4e')](_0x40bdad,{'showHidden':![],'depth':null}):'';logger[_0x980d('0x47')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4927a2);});}module[_0x980d('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x8085=['base64','randomBytes','hex','response_type','join','redirect_uri','data4','response_mode','form_post','scope','prompt','login','key','value','oauth2Claims','replace','oauth2/','set','decode','iss','issuer','aud','nonce','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','POST','{TENANT_ID}','data5','access_token','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','ioredis','request-promise','util','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','map','type','push','/.default','Dynamics365','data2','code','id_token','from','stringify','toString'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8085,0xc9));var _0x5808=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x8085[_0x288f5e];return _0x476cc9;};'use strict';var _=require('lodash');var crypto=require(_0x5808('0x0'));var jwt=require(_0x5808('0x1'));var moment=require('moment');var Redis=require(_0x5808('0x2'));var rp=require(_0x5808('0x3'));var util=require(_0x5808('0x4'));var encryptor=require('../../components/encryptor');var config=require(_0x5808('0x5'));var logger=require(_0x5808('0x6'))('api');var schedule=require(_0x5808('0x7'));var db=require(_0x5808('0x8'))['db'];config['redis']=_['defaults'](config[_0x5808('0x9')],{'host':_0x5808('0xa'),'port':0x18eb});var redis=new Redis(config[_0x5808('0x9')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x5808('0xb'),_0x5808('0xc'),_0x5808('0xd'),'offline_access',_0x5808('0xe'),_0x5808('0xf'),_0x5808('0x10')],'Dynamics365':['openid',_0x5808('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x5808('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x9f8eb7){var _0x21f5f0=_[_0x5808('0x13')](AZURE_AUTH_SCOPES[_0x9f8eb7[_0x5808('0x14')]]);if(_0x9f8eb7[_0x5808('0x14')]==='Dynamics365')_0x21f5f0[_0x5808('0x15')](_0x9f8eb7['data7']+_0x5808('0x16'));return _0x21f5f0['join']('\x20');}function getAccessTokenScope(_0x274cfb){if(_0x274cfb['type']==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x274cfb[_0x5808('0x14')]===_0x5808('0x17'))return _0x274cfb['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x4a31d7,_0x11d268){var _0x434de3=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x4a31d7[_0x5808('0x18')]);var _0x396558=[_0x5808('0x19'),_0x5808('0x1a')];var _0x562a43=Buffer[_0x5808('0x1b')](JSON[_0x5808('0x1c')]({'id':_0x11d268}))[_0x5808('0x1d')](_0x5808('0x1e'));var _0x1128ec=crypto[_0x5808('0x1f')](0x10)[_0x5808('0x1d')](_0x5808('0x20'));var _0x34cc21=getAuthorizationScopes(_0x4a31d7);var _0xd6d5fc=[{'key':'client_id','value':_0x4a31d7['data1']},{'key':_0x5808('0x21'),'value':encodeURIComponent(_0x396558[_0x5808('0x22')]('\x20'))},{'key':_0x5808('0x23'),'value':_0x4a31d7[_0x5808('0x24')]},{'key':_0x5808('0x25'),'value':_0x5808('0x26')},{'key':_0x5808('0x27'),'value':encodeURIComponent(_0x34cc21)},{'key':'state','value':_0x562a43},{'key':'nonce','value':_0x1128ec},{'key':_0x5808('0x28'),'value':_0x5808('0x29')}];var _0x3cdddf=_0x434de3+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x5808('0x13')](_0xd6d5fc,function(_0x535298){return _0x535298[_0x5808('0x2a')]+'='+_0x535298[_0x5808('0x2b')];})[_0x5808('0x22')]('&');_0x4a31d7[_0x5808('0x2c')]={'issuer':_0x434de3[_0x5808('0x2d')](_0x5808('0x2e'),''),'audience':_0x4a31d7['data1'],'state':_0x562a43,'nonce':_0x1128ec};redis[_0x5808('0x2f')](_0x562a43,JSON[_0x5808('0x1c')](_0x4a31d7));return _0x3cdddf;}function isValidIdToken(_0x99042d,_0x850e3f){try{var _0x2d4a98=jwt[_0x5808('0x30')](_0x99042d,{'complete':!![]});var _0x1548a1=_0x2d4a98['payload'];if(_0x1548a1[_0x5808('0x31')]!==_0x850e3f[_0x5808('0x32')])return![];if(_0x1548a1[_0x5808('0x33')]!==_0x850e3f['audience'])return![];if(_0x1548a1[_0x5808('0x34')]!==_0x850e3f[_0x5808('0x34')])return![];if(moment()[_0x5808('0x35')](moment[_0x5808('0x36')](_0x1548a1[_0x5808('0x37')])))return![];return!![];}catch(_0x27b288){throw _0x27b288;}}function refreshOauth2MicrosoftAccessToken(_0x4476f9){return Promise[_0x5808('0x38')]()[_0x5808('0x39')](function(){if(_0x4476f9[_0x5808('0x3a')])return _0x4476f9;return db[_0x5808('0x3b')][_0x5808('0x3c')]({'where':{'id':_0x4476f9['id']},'raw':!![]});})[_0x5808('0x39')](function(_0xbedca5){var _0x515211={'grant_type':_0x5808('0x3d'),'refresh_token':_0xbedca5[_0x5808('0x3e')],'scope':getAccessTokenScope(_0xbedca5),'redirect_uri':_0xbedca5[_0x5808('0x24')],'client_id':_0xbedca5['data1'],'client_secret':encryptor['decryptString'](_0xbedca5[_0x5808('0x3a')])};var _0x1a2d2e={'method':_0x5808('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x5808('0x2d')](_0x5808('0x40'),_0xbedca5[_0x5808('0x18')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x515211,'json':!![]};return rp(_0x1a2d2e);})['then'](function(_0x5a3526){_0x4476f9[_0x5808('0x41')]=_0x5a3526[_0x5808('0x42')];_0x4476f9[_0x5808('0x3e')]=_0x5a3526[_0x5808('0x3d')];return db[_0x5808('0x3b')][_0x5808('0x43')]({'data5':_0x4476f9[_0x5808('0x41')],'data6':_0x4476f9[_0x5808('0x3e')]},{'where':{'id':_0x4476f9['id']}});})[_0x5808('0x39')](function(){return _0x4476f9;})['catch'](function(_0x231e82){logger[_0x5808('0x44')](_0x5808('0x45'),_0x4476f9['id'],_0x231e82);});}function getOauth2MicrosoftAccessToken(_0x342a80,_0x3c3541){var _0x907d0e={'grant_type':_0x5808('0x46'),'code':_0x342a80,'scope':getAccessTokenScope(_0x3c3541),'redirect_uri':_0x3c3541[_0x5808('0x24')],'client_id':_0x3c3541['data1'],'client_secret':encryptor[_0x5808('0x47')](_0x3c3541[_0x5808('0x3a')])};var _0x522eb1={'method':_0x5808('0x3f'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x3c3541[_0x5808('0x18')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x907d0e,'json':!![]};return rp(_0x522eb1);}function startRefreshInterval(_0x30a81a){var _0x16b8e8=schedule[_0x5808('0x48')];if(_0x16b8e8[_0x30a81a['id']])clearInterval(_0x16b8e8[_0x30a81a['id']]);_0x16b8e8[_0x30a81a['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x5808('0x49')](this,{'id':_0x30a81a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x5808('0x48')]=_0x16b8e8;}function startAllRefreshIntervals(){return db[_0x5808('0x3b')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x5808('0x39')](function(_0x3cb8a0){var _0x3987bc=_0x3cb8a0[_0x5808('0x13')](function(_0x107cd2){return refreshOauth2MicrosoftAccessToken(_0x107cd2)[_0x5808('0x39')](function(_0xadff78){startRefreshInterval(_0xadff78);});});return Promise['all'](_0x3987bc);})[_0x5808('0x4a')](function(_0x45234a){var _0xd2fff6=_0x45234a?util[_0x5808('0x4b')](_0x45234a,{'showHidden':![],'depth':null}):'';logger[_0x5808('0x44')](_0x5808('0x4c'),_0xd2fff6);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 1c4c0e8..7d8fd04 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 _0x543b=['http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x35fe8c,_0x2d5ac){var _0x346a2a=function(_0x2d4d0b){while(--_0x2d4d0b){_0x35fe8c['push'](_0x35fe8c['shift']());}};_0x346a2a(++_0x2d5ac);}(_0x543b,0x18d));var _0xb543=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x543b[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xb543('0x0'));var util=require(_0xb543('0x1'));var moment=require(_0xb543('0x2'));var BPromise=require('bluebird');var rs=require(_0xb543('0x3'));var fs=require('fs');var Redis=require(_0xb543('0x4'));var db=require(_0xb543('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb543('0x6'))(_0xb543('0x7'));var config=require(_0xb543('0x8'));var jayson=require(_0xb543('0x9'));var client=jayson[_0xb543('0xa')][_0xb543('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x208c95,_0x338142,_0x21bb48){return new BPromise(function(_0x307a74,_0x2a2c1f){return client[_0xb543('0xc')](_0x208c95,_0x21bb48)['then'](function(_0xa94776){logger['info'](_0xb543('0xd'),_0x338142,_0xb543('0xe'));logger[_0xb543('0xf')](_0xb543('0x10'),_0x338142,_0xb543('0xe'),JSON[_0xb543('0x11')](_0xa94776));if(_0xa94776['error']){if(_0xa94776[_0xb543('0x12')][_0xb543('0x13')]===0x1f4){logger[_0xb543('0x12')]('CloudProvider,\x20%s,\x20%s',_0x338142,_0xa94776[_0xb543('0x12')][_0xb543('0x14')]);return _0x2a2c1f(_0xa94776[_0xb543('0x12')]['message']);}logger['error'](_0xb543('0xd'),_0x338142,_0xa94776[_0xb543('0x12')][_0xb543('0x14')]);return _0x307a74(_0xa94776[_0xb543('0x12')]['message']);}else{logger[_0xb543('0x15')](_0xb543('0xd'),_0x338142,_0xb543('0xe'));_0x307a74(_0xa94776[_0xb543('0x16')]['message']);}})[_0xb543('0x17')](function(_0x5230df){logger[_0xb543('0x12')](_0xb543('0xd'),_0x338142,_0x5230df);_0x2a2c1f(_0x5230df);});});} \ No newline at end of file +var _0xdbc6=['client','then','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4836fc,_0x9d1e38){var _0xc343bc=function(_0x32e83d){while(--_0x32e83d){_0x4836fc['push'](_0x4836fc['shift']());}};_0xc343bc(++_0x9d1e38);}(_0xdbc6,0x13b));var _0x6dbc=function(_0x3955d6,_0x3ac17f){_0x3955d6=_0x3955d6-0x0;var _0x4cda5c=_0xdbc6[_0x3955d6];return _0x4cda5c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6dbc('0x0'));var BPromise=require('bluebird');var rs=require(_0x6dbc('0x1'));var fs=require('fs');var Redis=require(_0x6dbc('0x2'));var db=require(_0x6dbc('0x3'))['db'];var utils=require(_0x6dbc('0x4'));var logger=require(_0x6dbc('0x5'))(_0x6dbc('0x6'));var config=require('../../config/environment');var jayson=require(_0x6dbc('0x7'));var client=jayson[_0x6dbc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbfd1f,_0x18da4b,_0x24849e){return new BPromise(function(_0x2f028f,_0x3231d8){return client['request'](_0xbfd1f,_0x24849e)[_0x6dbc('0x9')](function(_0x3c57b4){logger['info'](_0x6dbc('0xa'),_0x18da4b,_0x6dbc('0xb'));logger['debug'](_0x6dbc('0xc'),_0x18da4b,_0x6dbc('0xb'),JSON[_0x6dbc('0xd')](_0x3c57b4));if(_0x3c57b4[_0x6dbc('0xe')]){if(_0x3c57b4[_0x6dbc('0xe')]['code']===0x1f4){logger['error'](_0x6dbc('0xa'),_0x18da4b,_0x3c57b4[_0x6dbc('0xe')][_0x6dbc('0xf')]);return _0x3231d8(_0x3c57b4[_0x6dbc('0xe')][_0x6dbc('0xf')]);}logger[_0x6dbc('0xe')](_0x6dbc('0xa'),_0x18da4b,_0x3c57b4[_0x6dbc('0xe')][_0x6dbc('0xf')]);return _0x2f028f(_0x3c57b4['error'][_0x6dbc('0xf')]);}else{logger[_0x6dbc('0x10')](_0x6dbc('0xa'),_0x18da4b,_0x6dbc('0xb'));_0x2f028f(_0x3c57b4[_0x6dbc('0x11')][_0x6dbc('0xf')]);}})[_0x6dbc('0x12')](function(_0x1ee71a){logger['error']('CloudProvider,\x20%s,\x20%s',_0x18da4b,_0x1ee71a);_0x3231d8(_0x1ee71a);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index e6ea0a6..13213e5 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7a54,0x106));var _0x47a5=function(_0xbbee90,_0x5b19e3){_0xbbee90=_0xbbee90-0x0;var _0x96c9d=_0x7a54[_0xbbee90];return _0x96c9d;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file +var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x1b345a,_0x6056aa){var _0xb96c98=function(_0x3ba055){while(--_0x3ba055){_0x1b345a['push'](_0x1b345a['shift']());}};_0xb96c98(++_0x6056aa);}(_0xdb28,0x106));var _0x8db2=function(_0x3b21c3,_0x1f67c1){_0x3b21c3=_0x3b21c3-0x0;var _0x1fb1b0=_0xdb28[_0x3b21c3];return _0x1fb1b0;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 14cf5c4..b41135b 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 _0x53a2=['STRING','exports'];(function(_0x35ca63,_0x46a768){var _0x13ad71=function(_0x135e8c){while(--_0x135e8c){_0x35ca63['push'](_0x35ca63['shift']());}};_0x13ad71(++_0x46a768);}(_0x53a2,0x1a7));var _0x253a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x53a2[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module[_0x253a('0x0')]={'name':{'type':Sequelize[_0x253a('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x253a('0x1')]},'companyId':{'type':Sequelize[_0x253a('0x1')]},'website':{'type':Sequelize[_0x253a('0x1')]},'phone':{'type':Sequelize[_0x253a('0x1')]},'fax':{'type':Sequelize[_0x253a('0x1')]},'type':{'type':Sequelize[_0x253a('0x1')]},'street':{'type':Sequelize[_0x253a('0x1')]},'postalCode':{'type':Sequelize[_0x253a('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x253a('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x253a('0x1')]},'sStreet':{'type':Sequelize[_0x253a('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x253a('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x394e=['sequelize','exports','name','STRING'];(function(_0x407181,_0x1a7cb9){var _0x14cad6=function(_0x55f789){while(--_0x55f789){_0x407181['push'](_0x407181['shift']());}};_0x14cad6(++_0x1a7cb9);}(_0x394e,0x88));var _0xe394=function(_0x128313,_0x50691d){_0x128313=_0x128313-0x0;var _0x77a919=_0x394e[_0x128313];return _0x77a919;};'use strict';var Sequelize=require(_0xe394('0x0'));module[_0xe394('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe394('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe394('0x3')]},'companyId':{'type':Sequelize[_0xe394('0x3')]},'website':{'type':Sequelize[_0xe394('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xe394('0x3')]},'type':{'type':Sequelize[_0xe394('0x3')]},'street':{'type':Sequelize[_0xe394('0x3')]},'postalCode':{'type':Sequelize[_0xe394('0x3')]},'city':{'type':Sequelize[_0xe394('0x3')]},'country':{'type':Sequelize[_0xe394('0x3')]},'email':{'type':Sequelize[_0xe394('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe394('0x3')]},'sStreet':{'type':Sequelize[_0xe394('0x3')]},'sPostalCode':{'type':Sequelize[_0xe394('0x3')]},'sCity':{'type':Sequelize[_0xe394('0x3')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 5a45980..714e0cf 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 _0x11fd=['rawAttributes','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','error','stack','name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','options','CmCompany','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','CmContact','addContacts','ids','getContacts','findOne'];(function(_0x551d3d,_0x2766ab){var _0x57658f=function(_0x3d9920){while(--_0x3d9920){_0x551d3d['push'](_0x551d3d['shift']());}};_0x57658f(++_0x2766ab);}(_0x11fd,0x169));var _0xd11f=function(_0x3a4e1b,_0x1cfeaf){_0x3a4e1b=_0x3a4e1b-0x0;var _0x1cfe1f=_0x11fd[_0x3a4e1b];return _0x1cfe1f;};'use strict';var emlformat=require(_0xd11f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd11f('0x1'));var jsonpatch=require(_0xd11f('0x2'));var rp=require(_0xd11f('0x3'));var moment=require('moment');var BPromise=require(_0xd11f('0x4'));var Mustache=require(_0xd11f('0x5'));var util=require('util');var path=require(_0xd11f('0x6'));var sox=require('sox');var csv=require(_0xd11f('0x7'));var ejs=require(_0xd11f('0x8'));var fs=require('fs');var fs_extra=require(_0xd11f('0x9'));var _=require(_0xd11f('0xa'));var squel=require(_0xd11f('0xb'));var crypto=require(_0xd11f('0xc'));var jsforce=require(_0xd11f('0xd'));var deskjs=require(_0xd11f('0xe'));var toCsv=require(_0xd11f('0x7'));var querystring=require(_0xd11f('0xf'));var Papa=require(_0xd11f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd11f('0x11'));var as=require(_0xd11f('0x12'));var hardwareService=require(_0xd11f('0x13'));var logger=require(_0xd11f('0x14'))(_0xd11f('0x15'));var utils=require(_0xd11f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd11f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19511f,_0x20fa67){_0x20fa67=_0x20fa67||0xcc;return function(_0x4d9ab1){if(_0x4d9ab1){return _0x19511f[_0xd11f('0x18')](_0x20fa67);}return _0x19511f[_0xd11f('0x19')](_0x20fa67)[_0xd11f('0x1a')]();};}function respondWithResult(_0x1f071a,_0x1e21c2){_0x1e21c2=_0x1e21c2||0xc8;return function(_0x3019df){if(_0x3019df){return _0x1f071a[_0xd11f('0x19')](_0x1e21c2)[_0xd11f('0x1b')](_0x3019df);}};}function respondWithFilteredResult(_0x5a02ff,_0x5e4948){return function(_0x48bee6){if(_0x48bee6){var _0x5f45d4=typeof _0x5e4948[_0xd11f('0x1c')]==='undefined'&&typeof _0x5e4948[_0xd11f('0x1d')]===_0xd11f('0x1e');var _0x4c0dd7=_0x48bee6['count'];var _0x189f36=_0x5f45d4?0x0:_0x5e4948[_0xd11f('0x1c')];var _0xe0b49a=_0x5f45d4?_0x48bee6[_0xd11f('0x1f')]:_0x5e4948[_0xd11f('0x1c')]+_0x5e4948[_0xd11f('0x1d')];var _0x1a7889;if(_0xe0b49a>=_0x4c0dd7){_0xe0b49a=_0x4c0dd7;_0x1a7889=0xc8;}else{_0x1a7889=0xce;}_0x5a02ff[_0xd11f('0x19')](_0x1a7889);return _0x5a02ff[_0xd11f('0x20')](_0xd11f('0x21'),_0x189f36+'-'+_0xe0b49a+'/'+_0x4c0dd7)['json'](_0x48bee6);}return null;};}function patchUpdates(_0x3b631a){return function(_0x3ba63d){try{jsonpatch[_0xd11f('0x22')](_0x3ba63d,_0x3b631a,!![]);}catch(_0x4e1894){return BPromise[_0xd11f('0x23')](_0x4e1894);}return _0x3ba63d[_0xd11f('0x24')]();};}function saveUpdates(_0x33f2e3,_0x43f236){return function(_0x3d2f44){if(_0x3d2f44){return _0x3d2f44[_0xd11f('0x25')](_0x33f2e3)[_0xd11f('0x26')](function(_0x452663){return _0x452663;});}return null;};}function removeEntity(_0x59f5f6,_0x1deb84){return function(_0x20e400){if(_0x20e400){return _0x20e400['destroy']()[_0xd11f('0x26')](function(){var _0x31c7bd=_0x20e400[_0xd11f('0x27')]({'plain':!![]});var _0x367190='Companies';return db[_0xd11f('0x28')]['destroy']({'where':{'type':_0x367190,'resourceId':_0x31c7bd['id']}})[_0xd11f('0x26')](function(){return _0x20e400;});})[_0xd11f('0x26')](function(){_0x59f5f6[_0xd11f('0x19')](0xcc)[_0xd11f('0x1a')]();});}};}function handleEntityNotFound(_0x3ee93b,_0x3b1d22){return function(_0x14ef39){if(!_0x14ef39){_0x3ee93b[_0xd11f('0x18')](0x194);}return _0x14ef39;};}function handleError(_0x45318b,_0x5d1664){_0x5d1664=_0x5d1664||0x1f4;return function(_0x4a594e){logger[_0xd11f('0x29')](_0x4a594e[_0xd11f('0x2a')]);if(_0x4a594e[_0xd11f('0x2b')]){delete _0x4a594e[_0xd11f('0x2b')];}_0x45318b[_0xd11f('0x19')](_0x5d1664)[_0xd11f('0x2c')](_0x4a594e);};}exports[_0xd11f('0x2d')]=function(_0xbc4df7,_0x5e9271){var _0x5c638e={},_0x5091f0={},_0x4f6cb5={'count':0x0,'rows':[]};return db['CmCompany'][_0xd11f('0x2e')]()[_0xd11f('0x26')](function(_0xb44580){_0x5091f0[_0xd11f('0x2f')]=_[_0xd11f('0x30')](_0xb44580);_0x5091f0[_0xd11f('0x31')]=_[_0xd11f('0x30')](_0xbc4df7['query']);_0x5091f0[_0xd11f('0x32')]=_[_0xd11f('0x33')](_0x5091f0[_0xd11f('0x2f')],_0x5091f0[_0xd11f('0x31')]);_0x5c638e[_0xd11f('0x34')]=_[_0xd11f('0x33')](_0x5091f0[_0xd11f('0x2f')],qs[_0xd11f('0x35')](_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x35')]));_0x5c638e[_0xd11f('0x34')]=_0x5c638e[_0xd11f('0x34')][_0xd11f('0x36')]?_0x5c638e[_0xd11f('0x34')]:_0x5091f0[_0xd11f('0x2f')];if(!_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x37')](_0xd11f('0x38'))){_0x5c638e[_0xd11f('0x1d')]=qs[_0xd11f('0x1d')](_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x1d')]);_0x5c638e[_0xd11f('0x1c')]=qs['offset'](_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x1c')]);}_0x5c638e[_0xd11f('0x39')]=qs[_0xd11f('0x3a')](_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x3a')]);_0x5c638e['where']=qs[_0xd11f('0x32')](_[_0xd11f('0x3b')](_0xbc4df7[_0xd11f('0x31')],_0x5091f0[_0xd11f('0x32')]),_0xb44580);if(_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x3c')]){_0x5c638e[_0xd11f('0x3d')]=_[_0xd11f('0x3e')](_0x5c638e[_0xd11f('0x3d')],{'$or':_[_0xd11f('0x3f')](_0x5c638e[_0xd11f('0x34')],function(_0x494407){var _0x551b70={};_0x551b70[_0x494407]={'$like':'%'+_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x3c')]+'%'};return _0x551b70;})});}_0x5c638e=_[_0xd11f('0x3e')]({},_0x5c638e,_0xbc4df7[_0xd11f('0x40')]);var _0x168f87={'where':_0x5c638e[_0xd11f('0x3d')]};return db[_0xd11f('0x41')][_0xd11f('0x1f')](_0x168f87)[_0xd11f('0x26')](function(_0xd2870f){_0x4f6cb5['count']=_0xd2870f;if(_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x42')]){_0x5c638e['include']=[{'all':!![]}];}return db[_0xd11f('0x41')][_0xd11f('0x43')](_0x5c638e);})['then'](function(_0x6b9f0b){_0x4f6cb5[_0xd11f('0x44')]=_0x6b9f0b;return _0x4f6cb5;})[_0xd11f('0x26')](respondWithFilteredResult(_0x5e9271,_0x5c638e))['catch'](handleError(_0x5e9271,null));})[_0xd11f('0x45')](handleError(_0x5e9271,null));};exports[_0xd11f('0x46')]=function(_0x56f10a,_0x492ba1){var _0x178a36={'raw':![],'where':{'id':_0x56f10a[_0xd11f('0x47')]['id']}},_0x597eda={};_0x597eda[_0xd11f('0x2f')]=_['keys'](db[_0xd11f('0x41')]['rawAttributes']);_0x597eda[_0xd11f('0x31')]=_[_0xd11f('0x30')](_0x56f10a[_0xd11f('0x31')]);_0x597eda['filters']=_[_0xd11f('0x33')](_0x597eda[_0xd11f('0x2f')],_0x597eda['query']);_0x178a36[_0xd11f('0x34')]=_[_0xd11f('0x33')](_0x597eda[_0xd11f('0x2f')],qs[_0xd11f('0x35')](_0x56f10a[_0xd11f('0x31')][_0xd11f('0x35')]));_0x178a36[_0xd11f('0x34')]=_0x178a36['attributes'][_0xd11f('0x36')]?_0x178a36[_0xd11f('0x34')]:_0x597eda[_0xd11f('0x2f')];if(_0x56f10a[_0xd11f('0x31')][_0xd11f('0x42')]){_0x178a36[_0xd11f('0x48')]=[{'all':!![]}];}_0x178a36=_[_0xd11f('0x3e')]({},_0x178a36,_0x56f10a[_0xd11f('0x40')]);return db['CmCompany'][_0xd11f('0x49')](_0x178a36)['then'](handleEntityNotFound(_0x492ba1,null))[_0xd11f('0x26')](respondWithResult(_0x492ba1,null))[_0xd11f('0x45')](handleError(_0x492ba1,null));};exports[_0xd11f('0x4a')]=function(_0x4fca36,_0x433254){return db[_0xd11f('0x41')][_0xd11f('0x4a')](_0x4fca36[_0xd11f('0x4b')],{})[_0xd11f('0x26')](function(_0x4f07b7){var _0x475c2c=_0x4fca36[_0xd11f('0x4c')][_0xd11f('0x27')]({'plain':!![]});if(!_0x475c2c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x475c2c[_0xd11f('0x4d')]===_0xd11f('0x4c')){var _0x58d6cc=_0x4f07b7['get']({'plain':!![]});var _0x29f7e5=_0xd11f('0x4e');return db[_0xd11f('0x4f')][_0xd11f('0x49')]({'where':{'name':_0x29f7e5,'userProfileId':_0x475c2c[_0xd11f('0x50')]},'raw':!![]})[_0xd11f('0x26')](function(_0x49e2dd){if(_0x49e2dd&&_0x49e2dd[_0xd11f('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x58d6cc['name'],'resourceId':_0x58d6cc['id'],'type':_0x49e2dd['name'],'sectionId':_0x49e2dd['id']},{})[_0xd11f('0x26')](function(){return _0x4f07b7;});}else{return _0x4f07b7;}})[_0xd11f('0x45')](function(_0x4e3781){logger[_0xd11f('0x29')](_0xd11f('0x52'),_0x4e3781);throw _0x4e3781;});}return _0x4f07b7;})[_0xd11f('0x26')](respondWithResult(_0x433254,0xc9))[_0xd11f('0x45')](handleError(_0x433254,null));};exports[_0xd11f('0x25')]=function(_0x32650a,_0x469257){if(_0x32650a[_0xd11f('0x4b')]['id']){delete _0x32650a[_0xd11f('0x4b')]['id'];}return db[_0xd11f('0x41')]['find']({'where':{'id':_0x32650a[_0xd11f('0x47')]['id']}})[_0xd11f('0x26')](handleEntityNotFound(_0x469257,null))['then'](saveUpdates(_0x32650a[_0xd11f('0x4b')],null))[_0xd11f('0x26')](respondWithResult(_0x469257,null))['catch'](handleError(_0x469257,null));};exports[_0xd11f('0x53')]=function(_0x1669cb,_0x5ea17a){return db[_0xd11f('0x41')][_0xd11f('0x49')]({'where':{'id':_0x1669cb['params']['id']}})['then'](handleEntityNotFound(_0x5ea17a,null))[_0xd11f('0x26')](removeEntity(_0x5ea17a,null))[_0xd11f('0x45')](handleError(_0x5ea17a,null));};exports[_0xd11f('0x2e')]=function(_0x35a04d,_0x561c85){return db[_0xd11f('0x41')][_0xd11f('0x2e')]()[_0xd11f('0x26')](respondWithResult(_0x561c85,null))[_0xd11f('0x45')](handleError(_0x561c85,null));};exports['addContacts']=function(_0x2c6767,_0x50cf7a,_0x427c15){return db[_0xd11f('0x54')][_0xd11f('0x49')]({'where':{'id':_0x2c6767[_0xd11f('0x47')]['id']}})[_0xd11f('0x26')](handleEntityNotFound(_0x50cf7a,null))[_0xd11f('0x26')](function(_0x23f44b){if(_0x23f44b){return _0x23f44b[_0xd11f('0x55')](_0x2c6767[_0xd11f('0x4b')][_0xd11f('0x56')],_['omit'](_0x2c6767['body'],['ids','id'])||{});}})[_0xd11f('0x26')](respondWithResult(_0x50cf7a,null))['catch'](handleError(_0x50cf7a,null));};exports[_0xd11f('0x57')]=function(_0x4e27fe,_0x5a9adb,_0x520a91){var _0x4b9570={};var _0xafcf1f={};var _0x400b71;var _0xefde61;return db[_0xd11f('0x41')][_0xd11f('0x58')]({'where':{'id':_0x4e27fe['params']['id']}})[_0xd11f('0x26')](handleEntityNotFound(_0x5a9adb,null))[_0xd11f('0x26')](function(_0x362e69){if(_0x362e69){_0x400b71=_0x362e69;_0xafcf1f['model']=_['keys'](db['CmContact'][_0xd11f('0x59')]);_0xafcf1f[_0xd11f('0x31')]=_[_0xd11f('0x30')](_0x4e27fe[_0xd11f('0x31')]);_0xafcf1f['filters']=_['intersection'](_0xafcf1f[_0xd11f('0x2f')],_0xafcf1f[_0xd11f('0x31')]);_0x4b9570['attributes']=_[_0xd11f('0x33')](_0xafcf1f[_0xd11f('0x2f')],qs[_0xd11f('0x35')](_0x4e27fe[_0xd11f('0x31')][_0xd11f('0x35')]));_0x4b9570['attributes']=_0x4b9570['attributes'][_0xd11f('0x36')]?_0x4b9570[_0xd11f('0x34')]:_0xafcf1f[_0xd11f('0x2f')];_0x4b9570[_0xd11f('0x39')]=qs[_0xd11f('0x3a')](_0x4e27fe[_0xd11f('0x31')][_0xd11f('0x3a')]);_0x4b9570['where']=qs[_0xd11f('0x32')](_['pick'](_0x4e27fe[_0xd11f('0x31')],_0xafcf1f[_0xd11f('0x32')]));if(_0x4e27fe['query'][_0xd11f('0x3c')]){_0x4b9570[_0xd11f('0x3d')]=_[_0xd11f('0x3e')](_0x4b9570[_0xd11f('0x3d')],{'$or':_[_0xd11f('0x3f')](_0x4b9570['attributes'],function(_0x37e837){var _0x317735={};_0x317735[_0x37e837]={'$like':'%'+_0x4e27fe['query'][_0xd11f('0x3c')]+'%'};return _0x317735;})});}_0x4b9570=_[_0xd11f('0x3e')]({},_0x4b9570,_0x4e27fe[_0xd11f('0x40')]);return _0x400b71[_0xd11f('0x57')](_0x4b9570);}})['then'](function(_0x25aadb){if(_0x25aadb){_0xefde61=_0x25aadb[_0xd11f('0x36')];if(!_0x4e27fe[_0xd11f('0x31')][_0xd11f('0x37')](_0xd11f('0x38'))){_0x4b9570['limit']=qs['limit'](_0x4e27fe['query'][_0xd11f('0x1d')]);_0x4b9570[_0xd11f('0x1c')]=qs[_0xd11f('0x1c')](_0x4e27fe['query'][_0xd11f('0x1c')]);}return _0x400b71[_0xd11f('0x57')](_0x4b9570);}})[_0xd11f('0x26')](function(_0xaeb637){if(_0xaeb637){return _0xaeb637?{'count':_0xefde61,'rows':_0xaeb637}:null;}})[_0xd11f('0x26')](respondWithResult(_0x5a9adb,null))[_0xd11f('0x45')](handleError(_0x5a9adb,null));}; \ No newline at end of file +var _0x5c56=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','addContacts','CmContact','omit','getContacts','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','CmCompany','describe','keys','query','filters','model','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','filter','include','findAll','rows','catch','show','rawAttributes','fields','length','includeAll','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5c56,0x173));var _0x65c5=function(_0x130ef8,_0x4c2eb1){_0x130ef8=_0x130ef8-0x0;var _0x223a38=_0x5c56[_0x130ef8];return _0x223a38;};'use strict';var emlformat=require(_0x65c5('0x0'));var rimraf=require(_0x65c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65c5('0x2'));var rp=require(_0x65c5('0x3'));var moment=require(_0x65c5('0x4'));var BPromise=require(_0x65c5('0x5'));var Mustache=require('mustache');var util=require(_0x65c5('0x6'));var path=require(_0x65c5('0x7'));var sox=require(_0x65c5('0x8'));var csv=require('to-csv');var ejs=require(_0x65c5('0x9'));var fs=require('fs');var fs_extra=require(_0x65c5('0xa'));var _=require(_0x65c5('0xb'));var squel=require('squel');var crypto=require(_0x65c5('0xc'));var jsforce=require(_0x65c5('0xd'));var deskjs=require(_0x65c5('0xe'));var toCsv=require(_0x65c5('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65c5('0x10'));var qs=require(_0x65c5('0x11'));var as=require(_0x65c5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x65c5('0x13'))(_0x65c5('0x14'));var utils=require(_0x65c5('0x15'));var config=require(_0x65c5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x65c5('0x17'))['db'];function respondWithStatusCode(_0x41ab79,_0xb9c0a6){_0xb9c0a6=_0xb9c0a6||0xcc;return function(_0x5c0c96){if(_0x5c0c96){return _0x41ab79[_0x65c5('0x18')](_0xb9c0a6);}return _0x41ab79[_0x65c5('0x19')](_0xb9c0a6)[_0x65c5('0x1a')]();};}function respondWithResult(_0x53e0a8,_0x9cb39f){_0x9cb39f=_0x9cb39f||0xc8;return function(_0x49c149){if(_0x49c149){return _0x53e0a8[_0x65c5('0x19')](_0x9cb39f)[_0x65c5('0x1b')](_0x49c149);}};}function respondWithFilteredResult(_0x590c14,_0x4d164a){return function(_0x1e7144){if(_0x1e7144){var _0x5f5bdf=typeof _0x4d164a[_0x65c5('0x1c')]===_0x65c5('0x1d')&&typeof _0x4d164a[_0x65c5('0x1e')]==='undefined';var _0x4f09da=_0x1e7144[_0x65c5('0x1f')];var _0x1fadf6=_0x5f5bdf?0x0:_0x4d164a[_0x65c5('0x1c')];var _0x15a022=_0x5f5bdf?_0x1e7144['count']:_0x4d164a[_0x65c5('0x1c')]+_0x4d164a['limit'];var _0x38a094;if(_0x15a022>=_0x4f09da){_0x15a022=_0x4f09da;_0x38a094=0xc8;}else{_0x38a094=0xce;}_0x590c14[_0x65c5('0x19')](_0x38a094);return _0x590c14[_0x65c5('0x20')](_0x65c5('0x21'),_0x1fadf6+'-'+_0x15a022+'/'+_0x4f09da)[_0x65c5('0x1b')](_0x1e7144);}return null;};}function patchUpdates(_0x2660b1){return function(_0x4824ac){try{jsonpatch[_0x65c5('0x22')](_0x4824ac,_0x2660b1,!![]);}catch(_0x18c881){return BPromise[_0x65c5('0x23')](_0x18c881);}return _0x4824ac[_0x65c5('0x24')]();};}function saveUpdates(_0x5cf9c9,_0x2b5bc2){return function(_0x1cdeba){if(_0x1cdeba){return _0x1cdeba['update'](_0x5cf9c9)[_0x65c5('0x25')](function(_0x389dcb){return _0x389dcb;});}return null;};}function removeEntity(_0x30bda4,_0x526547){return function(_0x4c0911){if(_0x4c0911){return _0x4c0911[_0x65c5('0x26')]()[_0x65c5('0x25')](function(){var _0x554a44=_0x4c0911[_0x65c5('0x27')]({'plain':!![]});var _0x2121b1='Companies';return db[_0x65c5('0x28')][_0x65c5('0x26')]({'where':{'type':_0x2121b1,'resourceId':_0x554a44['id']}})[_0x65c5('0x25')](function(){return _0x4c0911;});})[_0x65c5('0x25')](function(){_0x30bda4[_0x65c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37a109,_0x4bf1ba){return function(_0x1c4eea){if(!_0x1c4eea){_0x37a109[_0x65c5('0x18')](0x194);}return _0x1c4eea;};}function handleError(_0x261941,_0x4baa5e){_0x4baa5e=_0x4baa5e||0x1f4;return function(_0x560359){logger[_0x65c5('0x29')](_0x560359[_0x65c5('0x2a')]);if(_0x560359[_0x65c5('0x2b')]){delete _0x560359['name'];}_0x261941[_0x65c5('0x19')](_0x4baa5e)[_0x65c5('0x2c')](_0x560359);};}exports[_0x65c5('0x2d')]=function(_0x2bc90b,_0x1ea7ec){var _0x1d9125={},_0x329b82={},_0x429048={'count':0x0,'rows':[]};return db[_0x65c5('0x2e')][_0x65c5('0x2f')]()[_0x65c5('0x25')](function(_0x868d4d){_0x329b82['model']=_[_0x65c5('0x30')](_0x868d4d);_0x329b82['query']=_[_0x65c5('0x30')](_0x2bc90b[_0x65c5('0x31')]);_0x329b82[_0x65c5('0x32')]=_['intersection'](_0x329b82[_0x65c5('0x33')],_0x329b82['query']);_0x1d9125['attributes']=_[_0x65c5('0x34')](_0x329b82[_0x65c5('0x33')],qs['fields'](_0x2bc90b['query']['fields']));_0x1d9125[_0x65c5('0x35')]=_0x1d9125[_0x65c5('0x35')]['length']?_0x1d9125[_0x65c5('0x35')]:_0x329b82[_0x65c5('0x33')];if(!_0x2bc90b[_0x65c5('0x31')][_0x65c5('0x36')](_0x65c5('0x37'))){_0x1d9125['limit']=qs[_0x65c5('0x1e')](_0x2bc90b['query']['limit']);_0x1d9125[_0x65c5('0x1c')]=qs[_0x65c5('0x1c')](_0x2bc90b['query'][_0x65c5('0x1c')]);}_0x1d9125[_0x65c5('0x38')]=qs[_0x65c5('0x39')](_0x2bc90b[_0x65c5('0x31')][_0x65c5('0x39')]);_0x1d9125['where']=qs[_0x65c5('0x32')](_[_0x65c5('0x3a')](_0x2bc90b[_0x65c5('0x31')],_0x329b82[_0x65c5('0x32')]),_0x868d4d);if(_0x2bc90b['query']['filter']){_0x1d9125[_0x65c5('0x3b')]=_[_0x65c5('0x3c')](_0x1d9125['where'],{'$or':_[_0x65c5('0x3d')](_0x1d9125[_0x65c5('0x35')],function(_0x28a549){var _0x551e04={};_0x551e04[_0x28a549]={'$like':'%'+_0x2bc90b[_0x65c5('0x31')][_0x65c5('0x3e')]+'%'};return _0x551e04;})});}_0x1d9125=_[_0x65c5('0x3c')]({},_0x1d9125,_0x2bc90b['options']);var _0x1a2585={'where':_0x1d9125[_0x65c5('0x3b')]};return db[_0x65c5('0x2e')][_0x65c5('0x1f')](_0x1a2585)[_0x65c5('0x25')](function(_0x1c0a02){_0x429048['count']=_0x1c0a02;if(_0x2bc90b[_0x65c5('0x31')]['includeAll']){_0x1d9125[_0x65c5('0x3f')]=[{'all':!![]}];}return db[_0x65c5('0x2e')][_0x65c5('0x40')](_0x1d9125);})[_0x65c5('0x25')](function(_0x3796bd){_0x429048[_0x65c5('0x41')]=_0x3796bd;return _0x429048;})['then'](respondWithFilteredResult(_0x1ea7ec,_0x1d9125))[_0x65c5('0x42')](handleError(_0x1ea7ec,null));})[_0x65c5('0x42')](handleError(_0x1ea7ec,null));};exports[_0x65c5('0x43')]=function(_0x261ee5,_0x3bf2f7){var _0x52afde={'raw':![],'where':{'id':_0x261ee5['params']['id']}},_0x4f2907={};_0x4f2907[_0x65c5('0x33')]=_[_0x65c5('0x30')](db['CmCompany'][_0x65c5('0x44')]);_0x4f2907[_0x65c5('0x31')]=_[_0x65c5('0x30')](_0x261ee5['query']);_0x4f2907[_0x65c5('0x32')]=_[_0x65c5('0x34')](_0x4f2907['model'],_0x4f2907[_0x65c5('0x31')]);_0x52afde[_0x65c5('0x35')]=_['intersection'](_0x4f2907['model'],qs[_0x65c5('0x45')](_0x261ee5['query'][_0x65c5('0x45')]));_0x52afde[_0x65c5('0x35')]=_0x52afde[_0x65c5('0x35')][_0x65c5('0x46')]?_0x52afde[_0x65c5('0x35')]:_0x4f2907[_0x65c5('0x33')];if(_0x261ee5[_0x65c5('0x31')][_0x65c5('0x47')]){_0x52afde[_0x65c5('0x3f')]=[{'all':!![]}];}_0x52afde=_['merge']({},_0x52afde,_0x261ee5[_0x65c5('0x48')]);return db[_0x65c5('0x2e')][_0x65c5('0x49')](_0x52afde)['then'](handleEntityNotFound(_0x3bf2f7,null))[_0x65c5('0x25')](respondWithResult(_0x3bf2f7,null))[_0x65c5('0x42')](handleError(_0x3bf2f7,null));};exports[_0x65c5('0x4a')]=function(_0x3d0525,_0x13c57d){return db[_0x65c5('0x2e')][_0x65c5('0x4a')](_0x3d0525['body'],{})[_0x65c5('0x25')](function(_0xe88f0c){var _0x366ae4=_0x3d0525['user'][_0x65c5('0x27')]({'plain':!![]});if(!_0x366ae4)throw new Error(_0x65c5('0x4b'));if(_0x366ae4[_0x65c5('0x4c')]===_0x65c5('0x4d')){var _0x3c377d=_0xe88f0c[_0x65c5('0x27')]({'plain':!![]});var _0x5c9635='Companies';return db[_0x65c5('0x4e')]['find']({'where':{'name':_0x5c9635,'userProfileId':_0x366ae4[_0x65c5('0x4f')]},'raw':!![]})[_0x65c5('0x25')](function(_0x1e6bc3){if(_0x1e6bc3&&_0x1e6bc3[_0x65c5('0x50')]===0x0){return db[_0x65c5('0x28')]['create']({'name':_0x3c377d[_0x65c5('0x2b')],'resourceId':_0x3c377d['id'],'type':_0x1e6bc3[_0x65c5('0x2b')],'sectionId':_0x1e6bc3['id']},{})[_0x65c5('0x25')](function(){return _0xe88f0c;});}else{return _0xe88f0c;}})['catch'](function(_0x20cf6d){logger['error'](_0x65c5('0x51'),_0x20cf6d);throw _0x20cf6d;});}return _0xe88f0c;})[_0x65c5('0x25')](respondWithResult(_0x13c57d,0xc9))[_0x65c5('0x42')](handleError(_0x13c57d,null));};exports[_0x65c5('0x52')]=function(_0x1624d1,_0x201c7f){if(_0x1624d1['body']['id']){delete _0x1624d1[_0x65c5('0x53')]['id'];}return db['CmCompany'][_0x65c5('0x49')]({'where':{'id':_0x1624d1['params']['id']}})[_0x65c5('0x25')](handleEntityNotFound(_0x201c7f,null))['then'](saveUpdates(_0x1624d1[_0x65c5('0x53')],null))[_0x65c5('0x25')](respondWithResult(_0x201c7f,null))[_0x65c5('0x42')](handleError(_0x201c7f,null));};exports[_0x65c5('0x26')]=function(_0x5aa3d3,_0x3c7210){return db[_0x65c5('0x2e')][_0x65c5('0x49')]({'where':{'id':_0x5aa3d3[_0x65c5('0x54')]['id']}})['then'](handleEntityNotFound(_0x3c7210,null))[_0x65c5('0x25')](removeEntity(_0x3c7210,null))[_0x65c5('0x42')](handleError(_0x3c7210,null));};exports['describe']=function(_0x5623d4,_0x5afdb8){return db[_0x65c5('0x2e')]['describe']()[_0x65c5('0x25')](respondWithResult(_0x5afdb8,null))['catch'](handleError(_0x5afdb8,null));};exports[_0x65c5('0x55')]=function(_0x4fa430,_0x379b87,_0x47424e){return db[_0x65c5('0x56')][_0x65c5('0x49')]({'where':{'id':_0x4fa430[_0x65c5('0x54')]['id']}})[_0x65c5('0x25')](handleEntityNotFound(_0x379b87,null))[_0x65c5('0x25')](function(_0x44d7c0){if(_0x44d7c0){return _0x44d7c0[_0x65c5('0x55')](_0x4fa430[_0x65c5('0x53')]['ids'],_[_0x65c5('0x57')](_0x4fa430[_0x65c5('0x53')],['ids','id'])||{});}})[_0x65c5('0x25')](respondWithResult(_0x379b87,null))[_0x65c5('0x42')](handleError(_0x379b87,null));};exports[_0x65c5('0x58')]=function(_0x48689b,_0x183101,_0x2da8e3){var _0x50986e={};var _0x7dc4f1={};var _0x5b768a;var _0x459743;return db['CmCompany'][_0x65c5('0x59')]({'where':{'id':_0x48689b[_0x65c5('0x54')]['id']}})[_0x65c5('0x25')](handleEntityNotFound(_0x183101,null))[_0x65c5('0x25')](function(_0x5b0cd1){if(_0x5b0cd1){_0x5b768a=_0x5b0cd1;_0x7dc4f1[_0x65c5('0x33')]=_['keys'](db[_0x65c5('0x56')]['rawAttributes']);_0x7dc4f1[_0x65c5('0x31')]=_['keys'](_0x48689b[_0x65c5('0x31')]);_0x7dc4f1['filters']=_[_0x65c5('0x34')](_0x7dc4f1[_0x65c5('0x33')],_0x7dc4f1[_0x65c5('0x31')]);_0x50986e['attributes']=_[_0x65c5('0x34')](_0x7dc4f1[_0x65c5('0x33')],qs[_0x65c5('0x45')](_0x48689b[_0x65c5('0x31')][_0x65c5('0x45')]));_0x50986e[_0x65c5('0x35')]=_0x50986e[_0x65c5('0x35')][_0x65c5('0x46')]?_0x50986e[_0x65c5('0x35')]:_0x7dc4f1['model'];_0x50986e[_0x65c5('0x38')]=qs[_0x65c5('0x39')](_0x48689b[_0x65c5('0x31')][_0x65c5('0x39')]);_0x50986e['where']=qs[_0x65c5('0x32')](_['pick'](_0x48689b[_0x65c5('0x31')],_0x7dc4f1['filters']));if(_0x48689b['query'][_0x65c5('0x3e')]){_0x50986e[_0x65c5('0x3b')]=_[_0x65c5('0x3c')](_0x50986e[_0x65c5('0x3b')],{'$or':_[_0x65c5('0x3d')](_0x50986e[_0x65c5('0x35')],function(_0x28367f){var _0x36304f={};_0x36304f[_0x28367f]={'$like':'%'+_0x48689b[_0x65c5('0x31')][_0x65c5('0x3e')]+'%'};return _0x36304f;})});}_0x50986e=_[_0x65c5('0x3c')]({},_0x50986e,_0x48689b[_0x65c5('0x48')]);return _0x5b768a[_0x65c5('0x58')](_0x50986e);}})[_0x65c5('0x25')](function(_0x5fba65){if(_0x5fba65){_0x459743=_0x5fba65[_0x65c5('0x46')];if(!_0x48689b[_0x65c5('0x31')][_0x65c5('0x36')](_0x65c5('0x37'))){_0x50986e[_0x65c5('0x1e')]=qs[_0x65c5('0x1e')](_0x48689b[_0x65c5('0x31')][_0x65c5('0x1e')]);_0x50986e['offset']=qs[_0x65c5('0x1c')](_0x48689b[_0x65c5('0x31')][_0x65c5('0x1c')]);}return _0x5b768a[_0x65c5('0x58')](_0x50986e);}})[_0x65c5('0x25')](function(_0x1896e9){if(_0x1896e9){return _0x1896e9?{'count':_0x459743,'rows':_0x1896e9}:null;}})[_0x65c5('0x25')](respondWithResult(_0x183101,null))[_0x65c5('0x42')](handleError(_0x183101,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 4877c6b..95b78a6 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 _0x730f=['cm_companies','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x26c18f,_0x24ec32){var _0x4aefc6=function(_0x12068e){while(--_0x12068e){_0x26c18f['push'](_0x26c18f['shift']());}};_0x4aefc6(++_0x24ec32);}(_0x730f,0x7f));var _0xf730=function(_0xf17e2b,_0x448b96){_0xf17e2b=_0xf17e2b-0x0;var _0x4303b6=_0x730f[_0xf17e2b];return _0x4303b6;};'use strict';var _=require(_0xf730('0x0'));var util=require('util');var logger=require(_0xf730('0x1'))('api');var moment=require(_0xf730('0x2'));var BPromise=require('bluebird');var rp=require(_0xf730('0x3'));var fs=require('fs');var path=require(_0xf730('0x4'));var rimraf=require(_0xf730('0x5'));var config=require(_0xf730('0x6'));var attributes=require(_0xf730('0x7'));module['exports']=function(_0x50dc86,_0x3c1aef){return _0x50dc86['define']('CmCompany',attributes,{'tableName':_0xf730('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa085=['cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x12b2f7,_0x570ea3){var _0x4a617d=function(_0x4b2b29){while(--_0x4b2b29){_0x12b2f7['push'](_0x12b2f7['shift']());}};_0x4a617d(++_0x570ea3);}(_0xa085,0x1dd));var _0x5a08=function(_0x369028,_0x50b5b7){_0x369028=_0x369028-0x0;var _0x3925ce=_0xa085[_0x369028];return _0x3925ce;};'use strict';var _=require(_0x5a08('0x0'));var util=require(_0x5a08('0x1'));var logger=require(_0x5a08('0x2'))(_0x5a08('0x3'));var moment=require(_0x5a08('0x4'));var BPromise=require(_0x5a08('0x5'));var rp=require(_0x5a08('0x6'));var fs=require('fs');var path=require(_0x5a08('0x7'));var rimraf=require(_0x5a08('0x8'));var config=require('../../config/environment');var attributes=require(_0x5a08('0x9'));module[_0x5a08('0xa')]=function(_0x31ac1e,_0x1e456f){return _0x31ac1e[_0x5a08('0xb')](_0x5a08('0xc'),attributes,{'tableName':_0x5a08('0xd'),'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 c7599b7..f0012a2 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 _0x1571=['request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x116945,_0x5bfce6){var _0x37671d=function(_0x4a6f79){while(--_0x4a6f79){_0x116945['push'](_0x116945['shift']());}};_0x37671d(++_0x5bfce6);}(_0x1571,0x174));var _0x1157=function(_0xa7fb1f,_0x1c49bc){_0xa7fb1f=_0xa7fb1f-0x0;var _0x32e057=_0x1571[_0xa7fb1f];return _0x32e057;};'use strict';var _=require(_0x1157('0x0'));var util=require('util');var moment=require(_0x1157('0x1'));var BPromise=require(_0x1157('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1157('0x3'));var db=require(_0x1157('0x4'))['db'];var utils=require(_0x1157('0x5'));var logger=require(_0x1157('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1157('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c3211,_0x25e471,_0x5b6e57){return new BPromise(function(_0x17bc7d,_0x326b20){return client[_0x1157('0x8')](_0x1c3211,_0x5b6e57)[_0x1157('0x9')](function(_0x1422c6){logger[_0x1157('0xa')](_0x1157('0xb'),_0x25e471,_0x1157('0xc'));logger[_0x1157('0xd')](_0x1157('0xe'),_0x25e471,_0x1157('0xc'),JSON[_0x1157('0xf')](_0x1422c6));if(_0x1422c6[_0x1157('0x10')]){if(_0x1422c6[_0x1157('0x10')]['code']===0x1f4){logger[_0x1157('0x10')]('CmCompany,\x20%s,\x20%s',_0x25e471,_0x1422c6[_0x1157('0x10')]['message']);return _0x326b20(_0x1422c6['error']['message']);}logger[_0x1157('0x10')](_0x1157('0xb'),_0x25e471,_0x1422c6[_0x1157('0x10')][_0x1157('0x11')]);return _0x17bc7d(_0x1422c6[_0x1157('0x10')][_0x1157('0x11')]);}else{logger[_0x1157('0xa')](_0x1157('0xb'),_0x25e471,_0x1157('0xc'));_0x17bc7d(_0x1422c6[_0x1157('0x12')][_0x1157('0x11')]);}})['catch'](function(_0x282fba){logger[_0x1157('0x10')](_0x1157('0xb'),_0x25e471,_0x282fba);_0x326b20(_0x282fba);});});} \ No newline at end of file +var _0x0aee=['CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','CmCompany,\x20%s,\x20%s'];(function(_0x460fd7,_0x2012db){var _0x44d1c2=function(_0x545e11){while(--_0x545e11){_0x460fd7['push'](_0x460fd7['shift']());}};_0x44d1c2(++_0x2012db);}(_0x0aee,0xeb));var _0xe0ae=function(_0x5b2e7f,_0x4cf29a){_0x5b2e7f=_0x5b2e7f-0x0;var _0x6d6f90=_0x0aee[_0x5b2e7f];return _0x6d6f90;};'use strict';var _=require(_0xe0ae('0x0'));var util=require(_0xe0ae('0x1'));var moment=require(_0xe0ae('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0ae('0x3'));var db=require(_0xe0ae('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0ae('0x5'))(_0xe0ae('0x6'));var config=require(_0xe0ae('0x7'));var jayson=require(_0xe0ae('0x8'));var client=jayson['client'][_0xe0ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x559cb1,_0x346cc5,_0x1e7a27){return new BPromise(function(_0x59cf09,_0x320694){return client['request'](_0x559cb1,_0x1e7a27)[_0xe0ae('0xa')](function(_0x53438a){logger['info'](_0xe0ae('0xb'),_0x346cc5,'request\x20sent');logger['debug'](_0xe0ae('0xc'),_0x346cc5,_0xe0ae('0xd'),JSON['stringify'](_0x53438a));if(_0x53438a['error']){if(_0x53438a['error']['code']===0x1f4){logger['error'](_0xe0ae('0xb'),_0x346cc5,_0x53438a[_0xe0ae('0xe')]['message']);return _0x320694(_0x53438a['error']['message']);}logger['error'](_0xe0ae('0xb'),_0x346cc5,_0x53438a['error'][_0xe0ae('0xf')]);return _0x59cf09(_0x53438a[_0xe0ae('0xe')][_0xe0ae('0xf')]);}else{logger[_0xe0ae('0x10')](_0xe0ae('0xb'),_0x346cc5,_0xe0ae('0xd'));_0x59cf09(_0x53438a[_0xe0ae('0x11')][_0xe0ae('0xf')]);}})[_0xe0ae('0x12')](function(_0x3856a9){logger['error'](_0xe0ae('0xb'),_0x346cc5,_0x3856a9);_0x320694(_0x3856a9);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index dda07fe..93cd5ec 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 _0x6ce8=['addContacts','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id/contacts','getContacts','post'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x6ce8,0x89));var _0x86ce=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x6ce8[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require(_0x86ce('0x0'));var util=require(_0x86ce('0x1'));var path=require(_0x86ce('0x2'));var timeout=require(_0x86ce('0x3'));var express=require(_0x86ce('0x4'));var router=express[_0x86ce('0x5')]();var fs_extra=require(_0x86ce('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x86ce('0x7'));var config=require(_0x86ce('0x8'));var controller=require('./cmCompany.controller');router[_0x86ce('0x9')]('/',auth['isAuthenticated'](),controller[_0x86ce('0xa')]);router[_0x86ce('0x9')](_0x86ce('0xb'),auth[_0x86ce('0xc')](),controller[_0x86ce('0xd')]);router[_0x86ce('0x9')]('/:id',auth[_0x86ce('0xc')](),controller['show']);router[_0x86ce('0x9')](_0x86ce('0xe'),auth['isAuthenticated'](),controller[_0x86ce('0xf')]);router[_0x86ce('0x10')]('/',auth[_0x86ce('0xc')](),controller['create']);router['post'](_0x86ce('0xe'),auth['isAuthenticated'](),controller[_0x86ce('0x11')]);router[_0x86ce('0x12')](_0x86ce('0x13'),auth[_0x86ce('0xc')](),controller['update']);router[_0x86ce('0x14')](_0x86ce('0x13'),auth[_0x86ce('0xc')](),controller['destroy']);module[_0x86ce('0x15')]=router; \ No newline at end of file +var _0xc02c=['create','addContacts','put','/:id','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/contacts','getContacts','post'];(function(_0x48d1cf,_0x3a4401){var _0x4cd0e2=function(_0x4c479a){while(--_0x4c479a){_0x48d1cf['push'](_0x48d1cf['shift']());}};_0x4cd0e2(++_0x3a4401);}(_0xc02c,0x16b));var _0xcc02=function(_0x735b43,_0x5bdb57){_0x735b43=_0x735b43-0x0;var _0x46f5f4=_0xc02c[_0x735b43];return _0x46f5f4;};'use strict';var multer=require(_0xcc02('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcc02('0x1'));var express=require('express');var router=express[_0xcc02('0x2')]();var fs_extra=require(_0xcc02('0x3'));var auth=require(_0xcc02('0x4'));var interaction=require(_0xcc02('0x5'));var config=require(_0xcc02('0x6'));var controller=require('./cmCompany.controller');router[_0xcc02('0x7')]('/',auth[_0xcc02('0x8')](),controller['index']);router[_0xcc02('0x7')](_0xcc02('0x9'),auth[_0xcc02('0x8')](),controller[_0xcc02('0xa')]);router[_0xcc02('0x7')]('/:id',auth[_0xcc02('0x8')](),controller[_0xcc02('0xb')]);router['get'](_0xcc02('0xc'),auth[_0xcc02('0x8')](),controller[_0xcc02('0xd')]);router[_0xcc02('0xe')]('/',auth['isAuthenticated'](),controller[_0xcc02('0xf')]);router[_0xcc02('0xe')](_0xcc02('0xc'),auth[_0xcc02('0x8')](),controller[_0xcc02('0x10')]);router[_0xcc02('0x11')](_0xcc02('0x12'),auth[_0xcc02('0x8')](),controller['update']);router['delete'](_0xcc02('0x12'),auth['isAuthenticated'](),controller[_0xcc02('0x13')]);module[_0xcc02('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 33b1f18..12964d7 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 _0xbaf0=['DATE','NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x4d3f19,_0x96a39b){var _0x25ae86=function(_0x3674e6){while(--_0x3674e6){_0x4d3f19['push'](_0x4d3f19['shift']());}};_0x25ae86(++_0x96a39b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var Sequelize=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'firstName':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0baf('0x2')]},'street':{'type':Sequelize[_0x0baf('0x2')]},'postalCode':{'type':Sequelize[_0x0baf('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0baf('0x2')]},'dateOfBirth':{'type':Sequelize[_0x0baf('0x2')]},'description':{'type':Sequelize[_0x0baf('0x3')]},'phone':{'type':Sequelize[_0x0baf('0x2')]},'mobile':{'type':Sequelize[_0x0baf('0x2')]},'fax':{'type':Sequelize[_0x0baf('0x2')]},'email':{'type':Sequelize[_0x0baf('0x2')]},'url':{'type':Sequelize[_0x0baf('0x2')]},'facebook':{'type':Sequelize[_0x0baf('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0baf('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x0baf('0x2')]},'viber':{'type':Sequelize[_0x0baf('0x2')]},'line':{'type':Sequelize[_0x0baf('0x2')]},'wechat':{'type':Sequelize[_0x0baf('0x2')]},'telegram':{'type':Sequelize[_0x0baf('0x2')]},'UserId':{'type':Sequelize[_0x0baf('0x4')]},'priority':{'type':Sequelize[_0x0baf('0x4')](0x2)[_0x0baf('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0baf('0x6')],'defaultValue':Sequelize[_0x0baf('0x7')]},'dialTimezone':{'type':Sequelize[_0x0baf('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x757a=['STRING','TEXT','INTEGER','UNSIGNED','DATE','sequelize','exports'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x757a,0xde));var _0xa757=function(_0x59aac2,_0x583128){_0x59aac2=_0x59aac2-0x0;var _0x2f8f55=_0x757a[_0x59aac2];return _0x2f8f55;};'use strict';var _=require('lodash');var Sequelize=require(_0xa757('0x0'));module[_0xa757('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xa757('0x2')]},'city':{'type':Sequelize[_0xa757('0x2')]},'country':{'type':Sequelize[_0xa757('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa757('0x2')]},'description':{'type':Sequelize[_0xa757('0x3')]},'phone':{'type':Sequelize[_0xa757('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xa757('0x2')]},'email':{'type':Sequelize[_0xa757('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xa757('0x2')]},'fb_data':{'type':Sequelize[_0xa757('0x2')]},'twitter':{'type':Sequelize[_0xa757('0x2')]},'skype':{'type':Sequelize[_0xa757('0x2')]},'teams':{'type':Sequelize[_0xa757('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xa757('0x2')]},'wechat':{'type':Sequelize[_0xa757('0x2')]},'telegram':{'type':Sequelize[_0xa757('0x2')]},'UserId':{'type':Sequelize[_0xa757('0x4')]},'priority':{'type':Sequelize[_0xa757('0x4')](0x2)[_0xa757('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa757('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 91a1d09..183fa95 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 _0xd3d2=['substatus','externalUrl','Interaction','flatten','reverse','slice','moment','bluebird','path','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','socket.io-emitter','./cmContact.socket','register','status','offset','limit','undefined','count','set','Content-Range','json','update','then','end','sendStatus','error','name','send','CmContact','describe','length','keys','push','findOne','trimStart','cf_','all','fieldType','type','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','select','field','color','tools_tags','from','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','where','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','DATE','text','start','filter','Contact','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','forEach','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','c.id','DESC','having','t.id\x20IN\x20?','resolve','role','some','User','getLists','c.ListId\x20IS\x20NULL','user','agent','sequelize','toString','keyBy','merge','c.firstName','c.phone','c.mobile','c.fax','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','rows','destroy','params','startsWith','displayName','analytics','CmCustomField','findAll','columnName','alias','custom','values','catch','body','get','mergeWith','tags','join','info','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','ReportAgentPreview','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','isArray','isNil','dialTimezone','utcOffset','timezones','duplicates','$or','findOrCreate','spread','show','ListId','omit','format','cf_%d','$and','pickBy','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','rawAttributes','options','getTags','setTags','getHoppers','includeAll','include','getHopperHistories','ContactId','CmHopperHistory','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20association\x20values\x20specified!','binding_values','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','0777','child_process','fork','binding_keys','CompanyId','socket_timestamp','upload','parse','meta','import','No\x20ListId\x20specified','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','getJourney','mail','chat','openchannel','fax','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','endtime','duration','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId','createdAt','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','Owner','fullname','browserName','customerIp','deviceModel','osName','ratingValue','referer','subject'];(function(_0x3235d3,_0x1002ec){var _0x1230d0=function(_0x2f64f6){while(--_0x2f64f6){_0x3235d3['push'](_0x3235d3['shift']());}};_0x1230d0(++_0x1002ec);}(_0xd3d2,0x120));var _0x2d3d=function(_0x237a1b,_0x15ff56){_0x237a1b=_0x237a1b-0x0;var _0x176b32=_0xd3d2[_0x237a1b];return _0x176b32;};'use strict';var moment=require(_0x2d3d('0x0'));var BPromise=require(_0x2d3d('0x1'));var util=require('util');var path=require(_0x2d3d('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2d3d('0x3'));var Papa=require(_0x2d3d('0x4'));var Redis=require(_0x2d3d('0x5'));var qs=require(_0x2d3d('0x6'));var as=require(_0x2d3d('0x7'));var logger=require(_0x2d3d('0x8'))(_0x2d3d('0x9'));var config=require(_0x2d3d('0xa'));var shared=require(_0x2d3d('0xb'));var db=require('../../mysqldb')['db'];config[_0x2d3d('0xc')]=_['defaults'](config[_0x2d3d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2d3d('0xd'))(new Redis(config[_0x2d3d('0xc')]));require(_0x2d3d('0xe'))[_0x2d3d('0xf')](socket);function respondWithResult(_0x4a2f62,_0x306502){_0x306502=_0x306502||0xc8;return function(_0x26e16e){if(_0x26e16e){return _0x4a2f62[_0x2d3d('0x10')](_0x306502)['json'](_0x26e16e);}};}function respondWithFilteredResult(_0x2ee4c5,_0x19ded4){return function(_0x1e25d1){if(_0x1e25d1){var _0x1948dc=typeof _0x19ded4[_0x2d3d('0x11')]==='undefined'&&typeof _0x19ded4[_0x2d3d('0x12')]===_0x2d3d('0x13');var _0x3148f4=_0x1e25d1[_0x2d3d('0x14')];var _0x25efcc=_0x1948dc?0x0:_0x19ded4[_0x2d3d('0x11')];var _0x2f8da7=_0x1948dc?_0x1e25d1[_0x2d3d('0x14')]:_0x19ded4[_0x2d3d('0x11')]+_0x19ded4[_0x2d3d('0x12')];var _0x186d88;if(_0x2f8da7>=_0x3148f4){_0x2f8da7=_0x3148f4;_0x186d88=0xc8;}else{_0x186d88=0xce;}_0x2ee4c5[_0x2d3d('0x10')](_0x186d88);return _0x2ee4c5[_0x2d3d('0x15')](_0x2d3d('0x16'),_0x25efcc+'-'+_0x2f8da7+'/'+_0x3148f4)[_0x2d3d('0x17')](_0x1e25d1);}return null;};}function saveUpdates(_0xb7d7d9){return function(_0x2c8f0f){if(_0x2c8f0f){return _0x2c8f0f[_0x2d3d('0x18')](_0xb7d7d9)['then'](function(_0x195032){return _0x195032;});}return null;};}function removeEntity(_0x421b22){return function(_0x2cb247){if(_0x2cb247){return _0x2cb247['destroy']()[_0x2d3d('0x19')](function(){_0x421b22['status'](0xcc)[_0x2d3d('0x1a')]();});}};}function handleEntityNotFound(_0x41100c){return function(_0xa02c01){if(!_0xa02c01){_0x41100c[_0x2d3d('0x1b')](0x194);}return _0xa02c01;};}function handleError(_0x4480bf,_0x1419ee){_0x1419ee=_0x1419ee||0x1f4;return function(_0x4563ff){logger[_0x2d3d('0x1c')](_0x4563ff['stack']);if(_0x4563ff[_0x2d3d('0x1d')]){delete _0x4563ff['name'];}_0x4480bf['status'](_0x1419ee)[_0x2d3d('0x1e')](_0x4563ff);};}exports['index']=function(_0xf545b4,_0x2f7efb){var _0x490eeb={},_0x4fc07b={},_0x15e8d3={'count':0x0,'rows':[]};return db[_0x2d3d('0x1f')][_0x2d3d('0x20')]()['then'](function(_0x3ec0cf){var _0x9e793f=[];for(var _0x398124=0x0;_0x3981240x1){_0x5f5dbe['or'](_0x2d3d('0x5c'),qs[_0x2d3d('0x5d')](_0x50452f),null);}else{if(qs[_0x2d3d('0x5e')](_0x50452f)){_0x5f5dbe['or'](_0x2d3d('0x5f'),_0x50452f+'%');_0x5f5dbe['or'](_0x2d3d('0x60'),_0x50452f+'%');_0x5f5dbe['or'](_0x2d3d('0x61'),_0x50452f+'%');_0x5f5dbe['or'](_0x2d3d('0x62'),_0x50452f+'%');}else if(qs['isEmail'](_0x50452f)){_0x5f5dbe['or'](_0x2d3d('0x63'),_0x50452f+'%');}else{_0x5f5dbe['or'](_0x2d3d('0x64'),'%'+_0x50452f+'%');_0x5f5dbe['or'](_0x2d3d('0x65'),'%'+_0x50452f+'%');_0x5f5dbe['or'](_0x2d3d('0x63'),'%'+_0x50452f+'%');}}}}_0x590b35[_0x2d3d('0x3f')](_0x5f5dbe);_0x590b35[_0x2d3d('0x66')]('c.id');var _0x760754={'type':db[_0x2d3d('0x67')][_0x2d3d('0x68')][_0x2d3d('0x69')],'raw':!![]};var _0x2ee9ca=_0x590b35['clone']()[_0x2d3d('0x36')](_0x2d3d('0x6a'));if(_0x490eeb['order']){_0x490eeb[_0x2d3d('0x32')][_0x2d3d('0x59')](function(_0x5087f4){_0x590b35[_0x2d3d('0x32')]('c.'+_0x5087f4[0x0],_0x5087f4[0x1]===_0x2d3d('0x6b')?![]:!![]);});}if(!_[_0x2d3d('0x53')](_0x4b8c22)){_0x590b35[_0x2d3d('0x6c')](_0x23d870);_0x2ee9ca['where'](_0x2d3d('0x6d'),_0x4b8c22);}BPromise[_0x2d3d('0x6e')]()[_0x2d3d('0x19')](function(){if(!_0xfab7c4)return;if(_0xf545b4['user'][_0x2d3d('0x6f')]!=='agent')return;if(!_[_0x2d3d('0x70')](_0xfab7c4[_0x2d3d('0x44')],[_0x2d3d('0x36'),_0x2d3d('0x71')])){return _0xf545b4['user'][_0x2d3d('0x72')]({'attributes':['id'],'raw':!![]})[_0x2d3d('0x19')](function(_0x2fa31b){if(_['isEmpty'](_0x2fa31b)){_0x2ee9ca[_0x2d3d('0x3f')]('c.ListId\x20IS\x20NULL');_0x590b35[_0x2d3d('0x3f')](_0x2d3d('0x73'));}else{_0x2ee9ca[_0x2d3d('0x3f')]('c.ListId\x20IN\x20?',_[_0x2d3d('0x48')](_0x2fa31b,'id'));_0x590b35[_0x2d3d('0x3f')](_0x2d3d('0x54'),_[_0x2d3d('0x48')](_0x2fa31b,'id'));}});}})[_0x2d3d('0x19')](function(){if(_0xf545b4[_0x2d3d('0x74')]['role']===_0x2d3d('0x75')&&!_0xfab7c4&&!_0xf545b4[_0x2d3d('0x2a')]['ListId'])return[];return db[_0x2d3d('0x76')][_0x2d3d('0x2a')](_0x2ee9ca[_0x2d3d('0x77')](),_0x760754);})[_0x2d3d('0x19')](function(_0x3baa7a){_0x15e8d3[_0x2d3d('0x14')]=_0x3baa7a[_0x2d3d('0x21')];if(_0x15e8d3['count']===0x0)return[];return db[_0x2d3d('0x76')]['query'](_0x1297a6[_0x2d3d('0x77')](),_0x760754)[_0x2d3d('0x19')](function(_0x124d69){_0xb1fff5=_[_0x2d3d('0x78')](_0x124d69,'id');_0x760754=_[_0x2d3d('0x79')](_0x760754,{'model':db[_0x2d3d('0x1f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf545b4['query'][_0x2d3d('0x2e')]){_0x490eeb[_0x2d3d('0x2f')][_0x2d3d('0x59')](function(_0x36d6cc){_0x590b35[_0x2d3d('0x36')]('c.'+_0x36d6cc);});}else{_0x590b35['field'](_0x2d3d('0x6a'));_0x590b35['field'](_0x2d3d('0x7a'));_0x590b35[_0x2d3d('0x36')]('c.lastName');_0x590b35['field'](_0x2d3d('0x7b'));_0x590b35[_0x2d3d('0x36')](_0x2d3d('0x7c'));_0x590b35[_0x2d3d('0x36')](_0x2d3d('0x7d'));_0x590b35[_0x2d3d('0x36')]('c.email');_0x590b35[_0x2d3d('0x36')]('c.ListId');_0x590b35[_0x2d3d('0x36')](_0x2d3d('0x7e'));_0x590b35[_0x2d3d('0x36')](_0x2d3d('0x7f'));_0x590b35[_0x2d3d('0x36')](_0x2d3d('0x80'));_0x590b35[_0x2d3d('0x36')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2d3d('0x81'));}if(_0x490eeb[_0x2d3d('0x12')])_0x590b35[_0x2d3d('0x12')](_0x490eeb[_0x2d3d('0x12')]);if(_0x490eeb[_0x2d3d('0x11')])_0x590b35[_0x2d3d('0x11')](_0x490eeb[_0x2d3d('0x11')]);return db[_0x2d3d('0x76')][_0x2d3d('0x2a')](_0x590b35['toString'](),_0x760754);});})[_0x2d3d('0x19')](function(_0x381da4){_0x381da4[_0x2d3d('0x59')](function(_0x36b4ad){if(_0x36b4ad[_0x2d3d('0x81')]){_0x36b4ad[_0x2d3d('0x82')]=[];_0x36b4ad[_0x2d3d('0x81')]['split'](',')['forEach'](function(_0x26c873){_0x36b4ad[_0x2d3d('0x82')][_0x2d3d('0x23')](_0xb1fff5[_0x26c873]);});}delete _0x36b4ad[_0x2d3d('0x81')];});_0x15e8d3[_0x2d3d('0x83')]=_0x381da4;return _0x15e8d3;})['then'](respondWithFilteredResult(_0x2f7efb,_0x490eeb));})['catch'](handleError(_0x2f7efb,null));};exports[_0x2d3d('0x84')]=function(_0x2ad93e,_0x1d7eb9){return db['CmContact'][_0x2d3d('0x45')]({'where':{'id':_0x2ad93e[_0x2d3d('0x85')]['id']}})[_0x2d3d('0x19')](handleEntityNotFound(_0x1d7eb9,null))[_0x2d3d('0x19')](removeEntity(_0x1d7eb9,null))['catch'](handleError(_0x1d7eb9,null));};exports['describe']=function(_0x2f3e48,_0x18aa48){return db[_0x2d3d('0x1f')]['describe']()[_0x2d3d('0x19')](function(_0x341cc5){delete _0x341cc5['tags'];for(var _0x464595=0x0;_0x464595=_0x4508b5){_0x270f34=_0x4508b5;_0x23500a=0xc8;}else{_0x23500a=0xce;}_0x1361b3['status'](_0x23500a);return _0x1361b3['set'](_0xaafc('0x12'),_0x5abe09+'-'+_0x270f34+'/'+_0x4508b5)[_0xaafc('0x13')](_0x1a71bb);}return null;};}function saveUpdates(_0x5bb50f){return function(_0x4f711d){if(_0x4f711d){return _0x4f711d['update'](_0x5bb50f)[_0xaafc('0x14')](function(_0x5e0244){return _0x5e0244;});}return null;};}function removeEntity(_0x4e4533){return function(_0x3ec9b9){if(_0x3ec9b9){return _0x3ec9b9[_0xaafc('0x15')]()[_0xaafc('0x14')](function(){_0x4e4533['status'](0xcc)[_0xaafc('0x16')]();});}};}function handleEntityNotFound(_0xe36da9){return function(_0x35d33e){if(!_0x35d33e){_0xe36da9[_0xaafc('0x17')](0x194);}return _0x35d33e;};}function handleError(_0x27888d,_0xe7cc4d){_0xe7cc4d=_0xe7cc4d||0x1f4;return function(_0x365b5d){logger['error'](_0x365b5d['stack']);if(_0x365b5d[_0xaafc('0x18')]){delete _0x365b5d['name'];}_0x27888d[_0xaafc('0x19')](_0xe7cc4d)[_0xaafc('0x1a')](_0x365b5d);};}exports[_0xaafc('0x1b')]=function(_0x30a853,_0x287f73){var _0x5ab842={},_0x190478={},_0x2428c9={'count':0x0,'rows':[]};return db[_0xaafc('0x1c')]['describe']()['then'](function(_0x121a70){var _0x4b7d39=[];for(var _0x34a389=0x0;_0x34a3890x1){_0x1bf9e7['or'](_0xaafc('0x59'),qs['getFullTextValue'](_0x5deb24),null);}else{if(qs[_0xaafc('0x5a')](_0x5deb24)){_0x1bf9e7['or'](_0xaafc('0x5b'),_0x5deb24+'%');_0x1bf9e7['or']('c.phone\x20LIKE\x20?',_0x5deb24+'%');_0x1bf9e7['or']('c.mobile\x20LIKE\x20?',_0x5deb24+'%');_0x1bf9e7['or'](_0xaafc('0x5c'),_0x5deb24+'%');}else if(qs['isEmail'](_0x5deb24)){_0x1bf9e7['or'](_0xaafc('0x5d'),_0x5deb24+'%');}else{_0x1bf9e7['or'](_0xaafc('0x5e'),'%'+_0x5deb24+'%');_0x1bf9e7['or']('c.lastName\x20LIKE\x20?','%'+_0x5deb24+'%');_0x1bf9e7['or'](_0xaafc('0x5d'),'%'+_0x5deb24+'%');}}}}_0x1478ca[_0xaafc('0x30')](_0x1bf9e7);_0x1478ca['group'](_0xaafc('0x5f'));var _0x58ff38={'type':db[_0xaafc('0x60')]['QueryTypes']['SELECT'],'raw':!![]};var _0x64a61c=_0x1478ca['clone']()['field'](_0xaafc('0x5f'));if(_0x5ab842[_0xaafc('0x2e')]){_0x5ab842[_0xaafc('0x2e')][_0xaafc('0x51')](function(_0x1cd054){_0x1478ca[_0xaafc('0x2e')]('c.'+_0x1cd054[0x0],_0x1cd054[0x1]===_0xaafc('0x61')?![]:!![]);});}if(!_[_0xaafc('0x62')](_0x2825f3)){_0x1478ca[_0xaafc('0x63')](_0x5df96b);_0x64a61c[_0xaafc('0x30')](_0xaafc('0x64'),_0x2825f3);}BPromise['resolve']()['then'](function(){if(!_0x2119b9)return;if(_0x30a853[_0xaafc('0x65')][_0xaafc('0x66')]!==_0xaafc('0x67'))return;if(!_['some'](_0x2119b9['conditions'],['field',_0xaafc('0x48')])){return _0x30a853[_0xaafc('0x65')]['getLists']({'attributes':['id'],'raw':!![]})[_0xaafc('0x14')](function(_0x25981b){if(_[_0xaafc('0x62')](_0x25981b)){_0x64a61c[_0xaafc('0x30')]('c.ListId\x20IS\x20NULL');_0x1478ca[_0xaafc('0x30')](_0xaafc('0x68'));}else{_0x64a61c['where'](_0xaafc('0x69'),_[_0xaafc('0x45')](_0x25981b,'id'));_0x1478ca[_0xaafc('0x30')](_0xaafc('0x69'),_[_0xaafc('0x45')](_0x25981b,'id'));}});}})[_0xaafc('0x14')](function(){if(_0x30a853[_0xaafc('0x65')][_0xaafc('0x66')]===_0xaafc('0x67')&&!_0x2119b9&&!_0x30a853['query']['ListId'])return[];return db['sequelize'][_0xaafc('0x28')](_0x64a61c[_0xaafc('0x6a')](),_0x58ff38);})[_0xaafc('0x14')](function(_0x347975){_0x2428c9[_0xaafc('0x10')]=_0x347975['length'];if(_0x2428c9['count']===0x0)return[];return db[_0xaafc('0x6b')][_0xaafc('0x28')](_0x4a64d2['toString'](),_0x58ff38)[_0xaafc('0x14')](function(_0x190ab3){_0x286f03=_[_0xaafc('0x6c')](_0x190ab3,'id');_0x58ff38=_[_0xaafc('0x6d')](_0x58ff38,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x30a853[_0xaafc('0x28')][_0xaafc('0x2b')]){_0x5ab842['attributes']['forEach'](function(_0x20ce27){_0x1478ca[_0xaafc('0x34')]('c.'+_0x20ce27);});}else{_0x1478ca['field']('c.id');_0x1478ca[_0xaafc('0x34')](_0xaafc('0x6e'));_0x1478ca[_0xaafc('0x34')](_0xaafc('0x6f'));_0x1478ca[_0xaafc('0x34')](_0xaafc('0x70'));_0x1478ca[_0xaafc('0x34')](_0xaafc('0x71'));_0x1478ca[_0xaafc('0x34')](_0xaafc('0x72'));_0x1478ca[_0xaafc('0x34')](_0xaafc('0x73'));_0x1478ca[_0xaafc('0x34')](_0xaafc('0x74'));_0x1478ca[_0xaafc('0x34')](_0xaafc('0x75'));_0x1478ca[_0xaafc('0x34')](_0xaafc('0x76'));_0x1478ca[_0xaafc('0x34')](_0xaafc('0x77'));_0x1478ca[_0xaafc('0x34')](_0xaafc('0x78'),_0xaafc('0x79'));}if(_0x5ab842[_0xaafc('0xf')])_0x1478ca['limit'](_0x5ab842[_0xaafc('0xf')]);if(_0x5ab842[_0xaafc('0x11')])_0x1478ca[_0xaafc('0x11')](_0x5ab842[_0xaafc('0x11')]);return db[_0xaafc('0x6b')][_0xaafc('0x28')](_0x1478ca['toString'](),_0x58ff38);});})[_0xaafc('0x14')](function(_0x5c5093){_0x5c5093['forEach'](function(_0x264015){if(_0x264015[_0xaafc('0x79')]){_0x264015[_0xaafc('0x7a')]=[];_0x264015[_0xaafc('0x79')][_0xaafc('0x44')](',')['forEach'](function(_0x37243c){_0x264015[_0xaafc('0x7a')][_0xaafc('0x21')](_0x286f03[_0x37243c]);});}delete _0x264015[_0xaafc('0x79')];});_0x2428c9[_0xaafc('0x7b')]=_0x5c5093;return _0x2428c9;})[_0xaafc('0x14')](respondWithFilteredResult(_0x287f73,_0x5ab842));})[_0xaafc('0x7c')](handleError(_0x287f73,null));};exports[_0xaafc('0x15')]=function(_0x57a43f,_0x2f5147){return db['CmContact']['find']({'where':{'id':_0x57a43f[_0xaafc('0x7d')]['id']}})['then'](handleEntityNotFound(_0x2f5147,null))[_0xaafc('0x14')](removeEntity(_0x2f5147,null))['catch'](handleError(_0x2f5147,null));};exports[_0xaafc('0x7e')]=function(_0x2e55ef,_0x86668c){return db[_0xaafc('0x1c')]['describe']()['then'](function(_0x15990c){delete _0x15990c[_0xaafc('0x7f')];for(var _0x1ab96d=0x0;_0x1ab96d{}\s\\|]/g,'-');_0x594b07(null,util[_0xed99('0x1d')](_0xed99('0x1e'),path['basename'](_0x167027[_0xed99('0x1c')],path['extname'](_0x167027[_0xed99('0x1c')])),Date['now'](),path[_0xed99('0x1f')](_0x167027[_0xed99('0x1c')])));}})});router[_0xed99('0x13')](_0xed99('0x20'),upload[_0xed99('0x21')](_0xed99('0x22')),controller[_0xed99('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xd6efe,_0x377d99,_0x219fe8){_0x219fe8(null,path[_0xed99('0x19')](config[_0xed99('0x1a')],'server/files/tmp'));},'filename':function(_0x241daa,_0x79af4c,_0x1b6e46){_0x79af4c['originalname']=_0x79af4c['originalname'][_0xed99('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1b6e46(null,util[_0xed99('0x1d')]('%s-%s%s',path[_0xed99('0x25')](_0x79af4c['originalname'],path[_0xed99('0x1f')](_0x79af4c[_0xed99('0x1c')])),Date['now'](),path[_0xed99('0x1f')](_0x79af4c[_0xed99('0x1c')])));}})});router['post'](_0xed99('0x26'),upload[_0xed99('0x21')](_0xed99('0x22')),controller['upload']);router[_0xed99('0x13')](_0xed99('0x27'),auth[_0xed99('0x7')](),controller[_0xed99('0x28')]);router[_0xed99('0x29')](_0xed99('0x9'),auth[_0xed99('0x7')](),controller['update']);router['delete'](_0xed99('0x9'),auth['isAuthenticated'](),controller[_0xed99('0x2a')]);module[_0xed99('0x2b')]=router; \ No newline at end of file +var _0x3410=['format','%s-%s%s','extname','now','/csv','single','file','uploadCsv','basename','/upload','/upload/:id','import','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/tags','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getJscriptySessions','/:id/journey','getJourney','post','/merge','/create_many','bulkCreate','diskStorage','join','root','server/files/tmp','originalname','replace'];(function(_0x2d8b14,_0x2b17c1){var _0x47c8e2=function(_0x16b0d4){while(--_0x16b0d4){_0x2d8b14['push'](_0x2d8b14['shift']());}};_0x47c8e2(++_0x2b17c1);}(_0x3410,0xaa));var _0x0341=function(_0x246beb,_0x57e6b4){_0x246beb=_0x246beb-0x0;var _0x456d19=_0x3410[_0x246beb];return _0x456d19;};'use strict';var multer=require(_0x0341('0x0'));var util=require(_0x0341('0x1'));var path=require(_0x0341('0x2'));var timeout=require(_0x0341('0x3'));var express=require(_0x0341('0x4'));var router=express[_0x0341('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0341('0x6'));var interaction=require(_0x0341('0x7'));var config=require(_0x0341('0x8'));var controller=require(_0x0341('0x9'));router['get']('/',auth[_0x0341('0xa')](),controller[_0x0341('0xb')]);router[_0x0341('0xc')](_0x0341('0xd'),auth[_0x0341('0xa')](),controller[_0x0341('0xe')]);router[_0x0341('0xc')](_0x0341('0xf'),auth[_0x0341('0xa')](),controller['show']);router[_0x0341('0xc')](_0x0341('0x10'),auth[_0x0341('0xa')](),controller['getTags']);router['get']('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0x0341('0xc')](_0x0341('0x11'),auth['isAuthenticated'](),controller[_0x0341('0x12')]);router[_0x0341('0xc')](_0x0341('0x13'),auth[_0x0341('0xa')](),controller[_0x0341('0x14')]);router[_0x0341('0xc')]('/:id/jscripty_sessions',auth[_0x0341('0xa')](),controller[_0x0341('0x15')]);router[_0x0341('0xc')](_0x0341('0x16'),auth[_0x0341('0xa')](),controller[_0x0341('0x17')]);router[_0x0341('0x18')](_0x0341('0x19'),auth[_0x0341('0xa')](),controller['merge']);router[_0x0341('0x18')]('/',auth[_0x0341('0xa')](),controller['create']);router['post'](_0x0341('0x1a'),auth[_0x0341('0xa')](),controller[_0x0341('0x1b')]);router[_0x0341('0x18')]('/:id/tags',auth[_0x0341('0xa')](),controller['setTags']);var upload=multer({'storage':multer[_0x0341('0x1c')]({'destination':function(_0x57ec4c,_0x10b7e3,_0x1366f){_0x1366f(null,path[_0x0341('0x1d')](config[_0x0341('0x1e')],_0x0341('0x1f')));},'filename':function(_0x37aa86,_0x1849c0,_0x3b522a){_0x1849c0[_0x0341('0x20')]=_0x1849c0[_0x0341('0x20')][_0x0341('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3b522a(null,util[_0x0341('0x22')](_0x0341('0x23'),path['basename'](_0x1849c0[_0x0341('0x20')],path[_0x0341('0x24')](_0x1849c0[_0x0341('0x20')])),Date[_0x0341('0x25')](),path[_0x0341('0x24')](_0x1849c0[_0x0341('0x20')])));}})});router[_0x0341('0x18')](_0x0341('0x26'),upload[_0x0341('0x27')](_0x0341('0x28')),controller[_0x0341('0x29')]);var upload=multer({'storage':multer[_0x0341('0x1c')]({'destination':function(_0x1bc1bf,_0x5642a6,_0x5db07d){_0x5db07d(null,path['join'](config['root'],'server/files/tmp'));},'filename':function(_0x5ce015,_0x418d05,_0x555dce){_0x418d05[_0x0341('0x20')]=_0x418d05[_0x0341('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x555dce(null,util[_0x0341('0x22')](_0x0341('0x23'),path[_0x0341('0x2a')](_0x418d05[_0x0341('0x20')],path[_0x0341('0x24')](_0x418d05[_0x0341('0x20')])),Date[_0x0341('0x25')](),path['extname'](_0x418d05[_0x0341('0x20')])));}})});router['post'](_0x0341('0x2b'),upload[_0x0341('0x27')](_0x0341('0x28')),controller['upload']);router[_0x0341('0x18')](_0x0341('0x2c'),auth[_0x0341('0xa')](),controller[_0x0341('0x2d')]);router[_0x0341('0x2e')]('/:id',auth['isAuthenticated'](),controller[_0x0341('0x2f')]);router[_0x0341('0x30')](_0x0341('0xf'),auth[_0x0341('0xa')](),controller[_0x0341('0x31')]);module[_0x0341('0x32')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 5f22e23..e6665d8 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 _0xe997=['values','isArray','setDataValue','voice','sequelize','lodash','getDataValue','alias','STRING','name','long','type','select','parse'];(function(_0x5dfa4e,_0x261d96){var _0xb78738=function(_0x41a670){while(--_0x41a670){_0x5dfa4e['push'](_0x5dfa4e['shift']());}};_0xb78738(++_0x261d96);}(_0xe997,0xc8));var _0x7e99=function(_0x19cd95,_0x4afd26){_0x19cd95=_0x19cd95-0x0;var _0x233d5a=_0xe997[_0x19cd95];return _0x233d5a;};'use strict';var Sequelize=require(_0x7e99('0x0'));var _=require(_0x7e99('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xeffeb7){return this[_0x7e99('0x2')](_0x7e99('0x3'));}},'alias':{'type':Sequelize[_0x7e99('0x4')],'allowNull':![],'set':function(_0x5bb41e){this['setDataValue'](_0x7e99('0x3'),_0x5bb41e?_0x5bb41e:this[_0x7e99('0x2')](_0x7e99('0x5')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x7e99('0x6')),'get':function(){if(this[_0x7e99('0x2')](_0x7e99('0x7'))===_0x7e99('0x8')){return JSON[_0x7e99('0x9')](this[_0x7e99('0x2')]('values'));}else{return this[_0x7e99('0x2')](_0x7e99('0xa'));}},'set':function(_0x4c7cbc){if(Array[_0x7e99('0xb')](_0x4c7cbc)){this[_0x7e99('0xc')](_0x7e99('0xa'),JSON['stringify'](_0x4c7cbc));}else{this[_0x7e99('0xc')](_0x7e99('0xa'),_0x4c7cbc);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x7e99('0xd'))}}; \ No newline at end of file +var _0x9579=['voice','sequelize','lodash','exports','getDataValue','alias','STRING','setDataValue','name','TEXT','type','select','values','isArray','stringify','BOOLEAN','ENUM'];(function(_0x51b0e5,_0x2e2b31){var _0x247af3=function(_0x387722){while(--_0x387722){_0x51b0e5['push'](_0x51b0e5['shift']());}};_0x247af3(++_0x2e2b31);}(_0x9579,0x111));var _0x9957=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0x9579[_0x4d674b];return _0x535a1f;};'use strict';var Sequelize=require(_0x9957('0x0'));var _=require(_0x9957('0x1'));module[_0x9957('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1c0a87){return this[_0x9957('0x3')](_0x9957('0x4'));}},'alias':{'type':Sequelize[_0x9957('0x5')],'allowNull':![],'set':function(_0x1adc1f){this[_0x9957('0x6')](_0x9957('0x4'),_0x1adc1f?_0x1adc1f:this[_0x9957('0x3')](_0x9957('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x9957('0x8')]('long'),'get':function(){if(this[_0x9957('0x3')](_0x9957('0x9'))===_0x9957('0xa')){return JSON['parse'](this[_0x9957('0x3')](_0x9957('0xb')));}else{return this['getDataValue'](_0x9957('0xb'));}},'set':function(_0x9bbb30){if(Array[_0x9957('0xc')](_0x9bbb30)){this['setDataValue'](_0x9957('0xb'),JSON[_0x9957('0xd')](_0x9bbb30));}else{this['setDataValue'](_0x9957('0xb'),_0x9bbb30);}}},'required':{'type':Sequelize[_0x9957('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x9957('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x9957('0xf')](_0x9957('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 9a32f04..7915279 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 _0x2ae9=['findAll','rows','catch','show','rawAttributes','find','update','body','params','create','sequelize','transaction','Sequelize','text','TEXT','number','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','rimraf','zip-dir','fast-json-patch','moment','mustache','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','map','CmCustomField','fieldName','key','differenceBy','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','count','include'];(function(_0x299539,_0x1b12af){var _0x5f15e1=function(_0x30742d){while(--_0x30742d){_0x299539['push'](_0x299539['shift']());}};_0x5f15e1(++_0x1b12af);}(_0x2ae9,0x107));var _0x92ae=function(_0x2608e4,_0x4be971){_0x2608e4=_0x2608e4-0x0;var _0x13911f=_0x2ae9[_0x2608e4];return _0x13911f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x92ae('0x0'));var zipdir=require(_0x92ae('0x1'));var jsonpatch=require(_0x92ae('0x2'));var rp=require('request-promise');var moment=require(_0x92ae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x92ae('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x92ae('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92ae('0x6'));var squel=require(_0x92ae('0x7'));var crypto=require(_0x92ae('0x8'));var jsforce=require(_0x92ae('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x92ae('0x5'));var querystring=require(_0x92ae('0xa'));var Papa=require('papaparse');var Redis=require(_0x92ae('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x92ae('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x92ae('0xd'))(_0x92ae('0xe'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x92ae('0xf'))['db'];function respondWithStatusCode(_0xd06b78,_0x35e029){_0x35e029=_0x35e029||0xcc;return function(_0x30e5de){if(_0x30e5de){return _0xd06b78['sendStatus'](_0x35e029);}return _0xd06b78[_0x92ae('0x10')](_0x35e029)[_0x92ae('0x11')]();};}function respondWithResult(_0x58f39e,_0x3ce4a7){_0x3ce4a7=_0x3ce4a7||0xc8;return function(_0x34acb4){if(_0x34acb4){return _0x58f39e[_0x92ae('0x10')](_0x3ce4a7)['json'](_0x34acb4);}};}function respondWithFilteredResult(_0x3d63e9,_0x5a88b1){return function(_0xd2be2){if(_0xd2be2){var _0x42dad1=typeof _0x5a88b1[_0x92ae('0x12')]===_0x92ae('0x13')&&typeof _0x5a88b1['limit']===_0x92ae('0x13');var _0x443833=_0xd2be2['count'];var _0x534bd8=_0x42dad1?0x0:_0x5a88b1[_0x92ae('0x12')];var _0x503638=_0x42dad1?_0xd2be2['count']:_0x5a88b1[_0x92ae('0x12')]+_0x5a88b1[_0x92ae('0x14')];var _0x4393bb;if(_0x503638>=_0x443833){_0x503638=_0x443833;_0x4393bb=0xc8;}else{_0x4393bb=0xce;}_0x3d63e9[_0x92ae('0x10')](_0x4393bb);return _0x3d63e9[_0x92ae('0x15')](_0x92ae('0x16'),_0x534bd8+'-'+_0x503638+'/'+_0x443833)[_0x92ae('0x17')](_0xd2be2);}return null;};}function patchUpdates(_0x30873a){return function(_0x1c42a8){try{jsonpatch[_0x92ae('0x18')](_0x1c42a8,_0x30873a,!![]);}catch(_0x59f3d9){return BPromise[_0x92ae('0x19')](_0x59f3d9);}return _0x1c42a8[_0x92ae('0x1a')]();};}function saveUpdates(_0x1c1055,_0xef434c){return function(_0x9ba54e){if(_0x9ba54e){return _0x9ba54e['update'](_0x1c1055)['then'](function(_0x10c452){return _0x10c452;});}return null;};}function removeEntity(_0x2f556b,_0x52e0f4){return function(_0x49ac37){if(_0x49ac37){return _0x49ac37[_0x92ae('0x1b')]()[_0x92ae('0x1c')](function(){_0x2f556b[_0x92ae('0x10')](0xcc)[_0x92ae('0x11')]();});}};}function handleEntityNotFound(_0x50ffee,_0x47eb40){return function(_0x2aa8f4){if(!_0x2aa8f4){_0x50ffee[_0x92ae('0x1d')](0x194);}return _0x2aa8f4;};}function handleError(_0x222aee,_0xeef354){_0xeef354=_0xeef354||0x1f4;return function(_0x994755){logger[_0x92ae('0x1e')](_0x994755[_0x92ae('0x1f')]);if(_0x994755[_0x92ae('0x20')]){delete _0x994755[_0x92ae('0x20')];}_0x222aee[_0x92ae('0x10')](_0xeef354)[_0x92ae('0x21')](_0x994755);};}exports['index']=function(_0x322e7b,_0x2f83e9){var _0x2ee373={},_0x35f810={},_0x4ea0ba={'count':0x0,'rows':[]};var _0x84545a=_[_0x92ae('0x22')](db[_0x92ae('0x23')]['rawAttributes'],function(_0x2fddad){return{'name':_0x2fddad[_0x92ae('0x24')],'type':_0x2fddad['type'][_0x92ae('0x25')]};});_0x35f810['model']=_[_0x92ae('0x26')](_['map'](_0x84545a,_0x92ae('0x20')),['name']);_0x35f810[_0x92ae('0x27')]=_[_0x92ae('0x28')](_0x322e7b[_0x92ae('0x27')]);_0x35f810[_0x92ae('0x29')]=_[_0x92ae('0x2a')](_0x35f810['model'],_0x35f810[_0x92ae('0x27')]);_0x2ee373['attributes']=_[_0x92ae('0x2a')](_0x35f810[_0x92ae('0x2b')],qs[_0x92ae('0x2c')](_0x322e7b[_0x92ae('0x27')][_0x92ae('0x2c')]));_0x2ee373[_0x92ae('0x2d')]=_0x2ee373[_0x92ae('0x2d')]['length']?_0x2ee373[_0x92ae('0x2d')]:_0x35f810[_0x92ae('0x2b')];if(!_0x322e7b[_0x92ae('0x27')]['hasOwnProperty'](_0x92ae('0x2e'))){_0x2ee373['limit']=qs[_0x92ae('0x14')](_0x322e7b[_0x92ae('0x27')][_0x92ae('0x14')]);_0x2ee373[_0x92ae('0x12')]=qs[_0x92ae('0x12')](_0x322e7b[_0x92ae('0x27')][_0x92ae('0x12')]);}_0x2ee373[_0x92ae('0x2f')]=qs[_0x92ae('0x30')](_0x322e7b[_0x92ae('0x27')][_0x92ae('0x30')]);_0x2ee373[_0x92ae('0x31')]=qs[_0x92ae('0x29')](_['pick'](_0x322e7b[_0x92ae('0x27')],_0x35f810[_0x92ae('0x29')]),_0x84545a);if(_0x322e7b[_0x92ae('0x27')]['filter']){_0x2ee373[_0x92ae('0x31')]=_[_0x92ae('0x32')](_0x2ee373['where'],{'$or':_['map'](_0x84545a,function(_0xe84d88){if(_0xe84d88[_0x92ae('0x33')]!==_0x92ae('0x34')){var _0x5e34f4={};_0x5e34f4[_0xe84d88[_0x92ae('0x20')]]={'$like':'%'+_0x322e7b['query'][_0x92ae('0x35')]+'%'};return _0x5e34f4;}})});}_0x2ee373=_[_0x92ae('0x32')]({},_0x2ee373,_0x322e7b[_0x92ae('0x36')]);var _0x278719={'where':_0x2ee373[_0x92ae('0x31')]};return db[_0x92ae('0x23')][_0x92ae('0x37')](_0x278719)[_0x92ae('0x1c')](function(_0x52f92c){_0x4ea0ba['count']=_0x52f92c;if(_0x322e7b[_0x92ae('0x27')]['includeAll']){_0x2ee373[_0x92ae('0x38')]=[{'all':!![]}];}return db['CmCustomField'][_0x92ae('0x39')](_0x2ee373);})[_0x92ae('0x1c')](function(_0x2849d0){_0x4ea0ba[_0x92ae('0x3a')]=_0x2849d0;return _0x4ea0ba;})['then'](respondWithFilteredResult(_0x2f83e9,_0x2ee373))[_0x92ae('0x3b')](handleError(_0x2f83e9,null));};exports[_0x92ae('0x3c')]=function(_0x2bf1f9,_0x220791){var _0x40de62={'raw':!![],'where':{'id':_0x2bf1f9['params']['id']}},_0x38d8c1={};_0x38d8c1['model']=_[_0x92ae('0x28')](db[_0x92ae('0x23')][_0x92ae('0x3d')]);_0x38d8c1[_0x92ae('0x27')]=_[_0x92ae('0x28')](_0x2bf1f9[_0x92ae('0x27')]);_0x38d8c1[_0x92ae('0x29')]=_[_0x92ae('0x2a')](_0x38d8c1[_0x92ae('0x2b')],_0x38d8c1[_0x92ae('0x27')]);_0x40de62[_0x92ae('0x2d')]=_['intersection'](_0x38d8c1['model'],qs['fields'](_0x2bf1f9['query'][_0x92ae('0x2c')]));_0x40de62[_0x92ae('0x2d')]=_0x40de62['attributes']['length']?_0x40de62[_0x92ae('0x2d')]:_0x38d8c1[_0x92ae('0x2b')];if(_0x2bf1f9[_0x92ae('0x27')]['includeAll']){_0x40de62[_0x92ae('0x38')]=[{'all':!![]}];}_0x40de62=_[_0x92ae('0x32')]({},_0x40de62,_0x2bf1f9[_0x92ae('0x36')]);return db[_0x92ae('0x23')][_0x92ae('0x3e')](_0x40de62)['then'](handleEntityNotFound(_0x220791,null))[_0x92ae('0x1c')](respondWithResult(_0x220791,null))[_0x92ae('0x3b')](handleError(_0x220791,null));};exports[_0x92ae('0x3f')]=function(_0x261e54,_0x4aaae5){if(_0x261e54[_0x92ae('0x40')]['id']){delete _0x261e54[_0x92ae('0x40')]['id'];}return db['CmCustomField'][_0x92ae('0x3e')]({'where':{'id':_0x261e54[_0x92ae('0x41')]['id']}})['then'](handleEntityNotFound(_0x4aaae5,null))[_0x92ae('0x1c')](saveUpdates(_0x261e54[_0x92ae('0x40')],null))[_0x92ae('0x1c')](respondWithResult(_0x4aaae5,null))[_0x92ae('0x3b')](handleError(_0x4aaae5,null));};exports[_0x92ae('0x1b')]=function(_0x559bd2,_0x2cca33){return db[_0x92ae('0x23')][_0x92ae('0x3e')]({'where':{'id':_0x559bd2[_0x92ae('0x41')]['id']}})[_0x92ae('0x1c')](handleEntityNotFound(_0x2cca33,null))[_0x92ae('0x1c')](removeEntity(_0x2cca33,null))[_0x92ae('0x3b')](handleError(_0x2cca33,null));};exports[_0x92ae('0x42')]=function(_0x2e955f,_0x85f64){var _0x5bed1c;return db[_0x92ae('0x43')][_0x92ae('0x44')](function(_0x4ba478){return db[_0x92ae('0x23')][_0x92ae('0x42')](_0x2e955f['body'],{'transaction':_0x4ba478})[_0x92ae('0x1c')](function(_0x51b2c4){_0x5bed1c=_0x51b2c4;var _0x5d8fe7={'type':db[_0x92ae('0x45')]['TEXT'],'transaction':_0x4ba478};switch(_0x2e955f[_0x92ae('0x40')][_0x92ae('0x33')]){case _0x92ae('0x46'):_0x5d8fe7['type']=db['Sequelize'][_0x92ae('0x47')];break;case _0x92ae('0x48'):_0x5d8fe7[_0x92ae('0x33')]=db[_0x92ae('0x45')]['INTEGER'];break;case _0x92ae('0x49'):_0x5d8fe7[_0x92ae('0x33')]=db['Sequelize']['BOOLEAN'];_0x5d8fe7[_0x92ae('0x4a')]=![];break;default:}return db['sequelize'][_0x92ae('0x4b')][_0x92ae('0x4c')](_0x92ae('0x4d'),util[_0x92ae('0x4e')](_0x92ae('0x4f'),_0x5bed1c['id']),_0x5d8fe7);})['then'](function(){return _0x5bed1c;});})[_0x92ae('0x1c')](respondWithResult(_0x85f64,0xc9))['catch'](handleError(_0x85f64,null));}; \ No newline at end of file +var _0x040b=['cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','CmCustomField','includeAll','include','rows','catch','show','params','find','update','body','sequelize','transaction','create','Sequelize','text','TEXT','number','INTEGER','defaultValue','queryInterface','addColumn','cm_contacts','format'];(function(_0x5c274f,_0x4dba30){var _0x3487a1=function(_0x52d54a){while(--_0x52d54a){_0x5c274f['push'](_0x5c274f['shift']());}};_0x3487a1(++_0x4dba30);}(_0x040b,0x161));var _0xb040=function(_0x293a9c,_0x519d1c){_0x293a9c=_0x293a9c-0x0;var _0x314c55=_0x040b[_0x293a9c];return _0x314c55;};'use strict';var emlformat=require(_0xb040('0x0'));var rimraf=require(_0xb040('0x1'));var zipdir=require(_0xb040('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb040('0x3'));var moment=require(_0xb040('0x4'));var BPromise=require(_0xb040('0x5'));var Mustache=require(_0xb040('0x6'));var util=require(_0xb040('0x7'));var path=require(_0xb040('0x8'));var sox=require('sox');var csv=require(_0xb040('0x9'));var ejs=require(_0xb040('0xa'));var fs=require('fs');var fs_extra=require(_0xb040('0xb'));var _=require(_0xb040('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb040('0xd'));var deskjs=require(_0xb040('0xe'));var toCsv=require(_0xb040('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb040('0xf'));var authService=require(_0xb040('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb040('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb040('0x12'));var config=require(_0xb040('0x13'));var licenseUtil=require(_0xb040('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2235b0,_0x5c589a){_0x5c589a=_0x5c589a||0xcc;return function(_0x1de932){if(_0x1de932){return _0x2235b0[_0xb040('0x15')](_0x5c589a);}return _0x2235b0[_0xb040('0x16')](_0x5c589a)['end']();};}function respondWithResult(_0x5129b4,_0x4d05ec){_0x4d05ec=_0x4d05ec||0xc8;return function(_0x4a06bd){if(_0x4a06bd){return _0x5129b4[_0xb040('0x16')](_0x4d05ec)[_0xb040('0x17')](_0x4a06bd);}};}function respondWithFilteredResult(_0x222b54,_0x522240){return function(_0x105bb9){if(_0x105bb9){var _0x35816b=typeof _0x522240[_0xb040('0x18')]===_0xb040('0x19')&&typeof _0x522240[_0xb040('0x1a')]==='undefined';var _0x2b1efd=_0x105bb9[_0xb040('0x1b')];var _0xabbfd9=_0x35816b?0x0:_0x522240['offset'];var _0x3383a2=_0x35816b?_0x105bb9[_0xb040('0x1b')]:_0x522240['offset']+_0x522240[_0xb040('0x1a')];var _0x4b6b7e;if(_0x3383a2>=_0x2b1efd){_0x3383a2=_0x2b1efd;_0x4b6b7e=0xc8;}else{_0x4b6b7e=0xce;}_0x222b54[_0xb040('0x16')](_0x4b6b7e);return _0x222b54[_0xb040('0x1c')](_0xb040('0x1d'),_0xabbfd9+'-'+_0x3383a2+'/'+_0x2b1efd)[_0xb040('0x17')](_0x105bb9);}return null;};}function patchUpdates(_0xaefd39){return function(_0x1a3d96){try{jsonpatch[_0xb040('0x1e')](_0x1a3d96,_0xaefd39,!![]);}catch(_0x72ae9d){return BPromise[_0xb040('0x1f')](_0x72ae9d);}return _0x1a3d96[_0xb040('0x20')]();};}function saveUpdates(_0x572e5f,_0x49bb1f){return function(_0x2a8aae){if(_0x2a8aae){return _0x2a8aae['update'](_0x572e5f)[_0xb040('0x21')](function(_0x4ceb65){return _0x4ceb65;});}return null;};}function removeEntity(_0x1cb3f6,_0x33e957){return function(_0x2cf9b9){if(_0x2cf9b9){return _0x2cf9b9[_0xb040('0x22')]()['then'](function(){_0x1cb3f6[_0xb040('0x16')](0xcc)[_0xb040('0x23')]();});}};}function handleEntityNotFound(_0x4be221,_0x668ce0){return function(_0x12447c){if(!_0x12447c){_0x4be221[_0xb040('0x15')](0x194);}return _0x12447c;};}function handleError(_0x51f7a5,_0x22c969){_0x22c969=_0x22c969||0x1f4;return function(_0x18a287){logger[_0xb040('0x24')](_0x18a287[_0xb040('0x25')]);if(_0x18a287[_0xb040('0x26')]){delete _0x18a287[_0xb040('0x26')];}_0x51f7a5[_0xb040('0x16')](_0x22c969)[_0xb040('0x27')](_0x18a287);};}exports[_0xb040('0x28')]=function(_0x402b44,_0x5640ff){var _0x1caeaa={},_0x1a5bcd={},_0x38a02a={'count':0x0,'rows':[]};var _0x13a045=_['map'](db['CmCustomField'][_0xb040('0x29')],function(_0x16e4e0){return{'name':_0x16e4e0[_0xb040('0x2a')],'type':_0x16e4e0[_0xb040('0x2b')][_0xb040('0x2c')]};});_0x1a5bcd[_0xb040('0x2d')]=_[_0xb040('0x2e')](_[_0xb040('0x2f')](_0x13a045,_0xb040('0x26')),[_0xb040('0x26')]);_0x1a5bcd[_0xb040('0x30')]=_[_0xb040('0x31')](_0x402b44['query']);_0x1a5bcd[_0xb040('0x32')]=_[_0xb040('0x33')](_0x1a5bcd['model'],_0x1a5bcd[_0xb040('0x30')]);_0x1caeaa['attributes']=_['intersection'](_0x1a5bcd[_0xb040('0x2d')],qs[_0xb040('0x34')](_0x402b44[_0xb040('0x30')]['fields']));_0x1caeaa[_0xb040('0x35')]=_0x1caeaa[_0xb040('0x35')][_0xb040('0x36')]?_0x1caeaa[_0xb040('0x35')]:_0x1a5bcd[_0xb040('0x2d')];if(!_0x402b44['query'][_0xb040('0x37')](_0xb040('0x38'))){_0x1caeaa[_0xb040('0x1a')]=qs['limit'](_0x402b44[_0xb040('0x30')]['limit']);_0x1caeaa[_0xb040('0x18')]=qs[_0xb040('0x18')](_0x402b44[_0xb040('0x30')][_0xb040('0x18')]);}_0x1caeaa['order']=qs[_0xb040('0x39')](_0x402b44[_0xb040('0x30')][_0xb040('0x39')]);_0x1caeaa[_0xb040('0x3a')]=qs[_0xb040('0x32')](_[_0xb040('0x3b')](_0x402b44[_0xb040('0x30')],_0x1a5bcd['filters']),_0x13a045);if(_0x402b44[_0xb040('0x30')][_0xb040('0x3c')]){_0x1caeaa[_0xb040('0x3a')]=_[_0xb040('0x3d')](_0x1caeaa[_0xb040('0x3a')],{'$or':_[_0xb040('0x2f')](_0x13a045,function(_0x20be4d){if(_0x20be4d[_0xb040('0x2b')]!==_0xb040('0x3e')){var _0x57a516={};_0x57a516[_0x20be4d[_0xb040('0x26')]]={'$like':'%'+_0x402b44[_0xb040('0x30')][_0xb040('0x3c')]+'%'};return _0x57a516;}})});}_0x1caeaa=_[_0xb040('0x3d')]({},_0x1caeaa,_0x402b44[_0xb040('0x3f')]);var _0x40ea1e={'where':_0x1caeaa['where']};return db[_0xb040('0x40')][_0xb040('0x1b')](_0x40ea1e)[_0xb040('0x21')](function(_0x41fcf4){_0x38a02a[_0xb040('0x1b')]=_0x41fcf4;if(_0x402b44[_0xb040('0x30')][_0xb040('0x41')]){_0x1caeaa[_0xb040('0x42')]=[{'all':!![]}];}return db[_0xb040('0x40')]['findAll'](_0x1caeaa);})[_0xb040('0x21')](function(_0x4d2e63){_0x38a02a[_0xb040('0x43')]=_0x4d2e63;return _0x38a02a;})[_0xb040('0x21')](respondWithFilteredResult(_0x5640ff,_0x1caeaa))[_0xb040('0x44')](handleError(_0x5640ff,null));};exports[_0xb040('0x45')]=function(_0x4a3a7c,_0x3cfc7b){var _0x4ce2b0={'raw':!![],'where':{'id':_0x4a3a7c[_0xb040('0x46')]['id']}},_0x1e3033={};_0x1e3033[_0xb040('0x2d')]=_[_0xb040('0x31')](db[_0xb040('0x40')]['rawAttributes']);_0x1e3033['query']=_[_0xb040('0x31')](_0x4a3a7c[_0xb040('0x30')]);_0x1e3033['filters']=_[_0xb040('0x33')](_0x1e3033[_0xb040('0x2d')],_0x1e3033[_0xb040('0x30')]);_0x4ce2b0[_0xb040('0x35')]=_[_0xb040('0x33')](_0x1e3033[_0xb040('0x2d')],qs[_0xb040('0x34')](_0x4a3a7c['query'][_0xb040('0x34')]));_0x4ce2b0[_0xb040('0x35')]=_0x4ce2b0[_0xb040('0x35')][_0xb040('0x36')]?_0x4ce2b0[_0xb040('0x35')]:_0x1e3033[_0xb040('0x2d')];if(_0x4a3a7c['query']['includeAll']){_0x4ce2b0[_0xb040('0x42')]=[{'all':!![]}];}_0x4ce2b0=_['merge']({},_0x4ce2b0,_0x4a3a7c['options']);return db[_0xb040('0x40')][_0xb040('0x47')](_0x4ce2b0)[_0xb040('0x21')](handleEntityNotFound(_0x3cfc7b,null))[_0xb040('0x21')](respondWithResult(_0x3cfc7b,null))[_0xb040('0x44')](handleError(_0x3cfc7b,null));};exports[_0xb040('0x48')]=function(_0x9c4d59,_0x387ca4){if(_0x9c4d59[_0xb040('0x49')]['id']){delete _0x9c4d59[_0xb040('0x49')]['id'];}return db[_0xb040('0x40')][_0xb040('0x47')]({'where':{'id':_0x9c4d59[_0xb040('0x46')]['id']}})[_0xb040('0x21')](handleEntityNotFound(_0x387ca4,null))[_0xb040('0x21')](saveUpdates(_0x9c4d59['body'],null))[_0xb040('0x21')](respondWithResult(_0x387ca4,null))[_0xb040('0x44')](handleError(_0x387ca4,null));};exports[_0xb040('0x22')]=function(_0x2e8838,_0x170d88){return db[_0xb040('0x40')][_0xb040('0x47')]({'where':{'id':_0x2e8838[_0xb040('0x46')]['id']}})[_0xb040('0x21')](handleEntityNotFound(_0x170d88,null))['then'](removeEntity(_0x170d88,null))['catch'](handleError(_0x170d88,null));};exports['create']=function(_0x3ec147,_0x538933){var _0x561c44;return db[_0xb040('0x4a')][_0xb040('0x4b')](function(_0xee4758){return db[_0xb040('0x40')][_0xb040('0x4c')](_0x3ec147[_0xb040('0x49')],{'transaction':_0xee4758})[_0xb040('0x21')](function(_0x520e32){_0x561c44=_0x520e32;var _0x16b89c={'type':db[_0xb040('0x4d')]['TEXT'],'transaction':_0xee4758};switch(_0x3ec147[_0xb040('0x49')][_0xb040('0x2b')]){case _0xb040('0x4e'):_0x16b89c[_0xb040('0x2b')]=db[_0xb040('0x4d')][_0xb040('0x4f')];break;case _0xb040('0x50'):_0x16b89c[_0xb040('0x2b')]=db[_0xb040('0x4d')][_0xb040('0x51')];break;case'switch':_0x16b89c['type']=db['Sequelize']['BOOLEAN'];_0x16b89c[_0xb040('0x52')]=![];break;default:}return db[_0xb040('0x4a')][_0xb040('0x53')][_0xb040('0x54')](_0xb040('0x55'),util[_0xb040('0x56')](_0xb040('0x57'),_0x561c44['id']),_0x16b89c);})[_0xb040('0x21')](function(){return _0x561c44;});})['then'](respondWithResult(_0x538933,0xc9))['catch'](handleError(_0x538933,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 1de83cd..33a756e 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 _0x2673=['../../config/environment','define','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x4530a2,_0x4fb78e){var _0x27eb22=function(_0x40910e){while(--_0x40910e){_0x4530a2['push'](_0x4530a2['shift']());}};_0x27eb22(++_0x4fb78e);}(_0x2673,0x146));var _0x3267=function(_0x2bbe8d,_0x5156c2){_0x2bbe8d=_0x2bbe8d-0x0;var _0x539e7a=_0x2673[_0x2bbe8d];return _0x539e7a;};'use strict';var _=require(_0x3267('0x0'));var util=require(_0x3267('0x1'));var logger=require(_0x3267('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3267('0x3'));var rp=require(_0x3267('0x4'));var fs=require('fs');var path=require(_0x3267('0x5'));var rimraf=require(_0x3267('0x6'));var config=require(_0x3267('0x7'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x4dc084,_0x2b9724){return _0x4dc084[_0x3267('0x8')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e4d=['rimraf','../../config/environment','./cmCustomField.attributes','CmCustomField','cm_custom_fields','lodash','util','moment','bluebird','request-promise','path'];(function(_0x598aee,_0x92a2e8){var _0x584005=function(_0x18723c){while(--_0x18723c){_0x598aee['push'](_0x598aee['shift']());}};_0x584005(++_0x92a2e8);}(_0x7e4d,0x1b2));var _0xd7e4=function(_0x882684,_0x1d0dca){_0x882684=_0x882684-0x0;var _0x2d270a=_0x7e4d[_0x882684];return _0x2d270a;};'use strict';var _=require(_0xd7e4('0x0'));var util=require(_0xd7e4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd7e4('0x2'));var BPromise=require(_0xd7e4('0x3'));var rp=require(_0xd7e4('0x4'));var fs=require('fs');var path=require(_0xd7e4('0x5'));var rimraf=require(_0xd7e4('0x6'));var config=require(_0xd7e4('0x7'));var attributes=require(_0xd7e4('0x8'));module['exports']=function(_0x15f576,_0x21cb3a){return _0x15f576['define'](_0xd7e4('0x9'),attributes,{'tableName':_0xd7e4('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 68ea986..6484e0a 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 _0xdcb9=['CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','CmCustomField,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','request\x20sent'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xdcb9,0x1c0));var _0x9dcb=function(_0x4d9b76,_0x3c884a){_0x4d9b76=_0x4d9b76-0x0;var _0x49311d=_0xdcb9[_0x4d9b76];return _0x49311d;};'use strict';var _=require('lodash');var util=require(_0x9dcb('0x0'));var moment=require(_0x9dcb('0x1'));var BPromise=require('bluebird');var rs=require(_0x9dcb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9dcb('0x3'))['db'];var utils=require(_0x9dcb('0x4'));var logger=require(_0x9dcb('0x5'))(_0x9dcb('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9dcb('0x7')][_0x9dcb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26bda6,_0x1eb03d,_0x231c15){return new BPromise(function(_0x427c80,_0x481c82){return client[_0x9dcb('0x9')](_0x26bda6,_0x231c15)[_0x9dcb('0xa')](function(_0x3af7db){logger['info']('CmCustomField,\x20%s,\x20%s',_0x1eb03d,_0x9dcb('0xb'));logger['debug'](_0x9dcb('0xc'),_0x1eb03d,_0x9dcb('0xb'),JSON[_0x9dcb('0xd')](_0x3af7db));if(_0x3af7db[_0x9dcb('0xe')]){if(_0x3af7db[_0x9dcb('0xe')]['code']===0x1f4){logger[_0x9dcb('0xe')](_0x9dcb('0xf'),_0x1eb03d,_0x3af7db[_0x9dcb('0xe')][_0x9dcb('0x10')]);return _0x481c82(_0x3af7db[_0x9dcb('0xe')]['message']);}logger[_0x9dcb('0xe')](_0x9dcb('0xf'),_0x1eb03d,_0x3af7db['error'][_0x9dcb('0x10')]);return _0x427c80(_0x3af7db[_0x9dcb('0xe')][_0x9dcb('0x10')]);}else{logger[_0x9dcb('0x11')](_0x9dcb('0xf'),_0x1eb03d,_0x9dcb('0xb'));_0x427c80(_0x3af7db[_0x9dcb('0x12')][_0x9dcb('0x10')]);}})[_0x9dcb('0x13')](function(_0x4b4275){logger[_0x9dcb('0xe')](_0x9dcb('0xf'),_0x1eb03d,_0x4b4275);_0x481c82(_0x4b4275);});});} \ No newline at end of file +var _0x368c=['result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x8f60d9,_0x3a11b5){var _0x5886ab=function(_0x2d0299){while(--_0x2d0299){_0x8f60d9['push'](_0x8f60d9['shift']());}};_0x5886ab(++_0x3a11b5);}(_0x368c,0xe8));var _0xc368=function(_0x20db7d,_0x1b0e7f){_0x20db7d=_0x20db7d-0x0;var _0x740baf=_0x368c[_0x20db7d];return _0x740baf;};'use strict';var _=require(_0xc368('0x0'));var util=require(_0xc368('0x1'));var moment=require(_0xc368('0x2'));var BPromise=require(_0xc368('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc368('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc368('0x5'));var logger=require(_0xc368('0x6'))('rpc');var config=require(_0xc368('0x7'));var jayson=require(_0xc368('0x8'));var client=jayson[_0xc368('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41832c,_0x2b0368,_0x56b839){return new BPromise(function(_0x608798,_0x26353d){return client[_0xc368('0xa')](_0x41832c,_0x56b839)[_0xc368('0xb')](function(_0xabc63){logger[_0xc368('0xc')](_0xc368('0xd'),_0x2b0368,_0xc368('0xe'));logger[_0xc368('0xf')](_0xc368('0x10'),_0x2b0368,_0xc368('0xe'),JSON[_0xc368('0x11')](_0xabc63));if(_0xabc63['error']){if(_0xabc63['error'][_0xc368('0x12')]===0x1f4){logger[_0xc368('0x13')]('CmCustomField,\x20%s,\x20%s',_0x2b0368,_0xabc63[_0xc368('0x13')][_0xc368('0x14')]);return _0x26353d(_0xabc63[_0xc368('0x13')][_0xc368('0x14')]);}logger[_0xc368('0x13')](_0xc368('0xd'),_0x2b0368,_0xabc63[_0xc368('0x13')][_0xc368('0x14')]);return _0x608798(_0xabc63[_0xc368('0x13')][_0xc368('0x14')]);}else{logger[_0xc368('0xc')](_0xc368('0xd'),_0x2b0368,'request\x20sent');_0x608798(_0xabc63[_0xc368('0x15')]['message']);}})[_0xc368('0x16')](function(_0x3a91fe){logger['error']('CmCustomField,\x20%s,\x20%s',_0x2b0368,_0x3a91fe);_0x26353d(_0x3a91fe);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 4704aef..e6082c6 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 _0x12e9=['../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','update','delete','exports','path','express','Router'];(function(_0x32d96c,_0x2a64a8){var _0x32d3f7=function(_0x58936b){while(--_0x58936b){_0x32d96c['push'](_0x32d96c['shift']());}};_0x32d3f7(++_0x2a64a8);}(_0x12e9,0x66));var _0x912e=function(_0x24aef8,_0x2a4a81){_0x24aef8=_0x24aef8-0x0;var _0x4db91f=_0x12e9[_0x24aef8];return _0x4db91f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x912e('0x0'));var timeout=require('connect-timeout');var express=require(_0x912e('0x1'));var router=express[_0x912e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x912e('0x3'));var interaction=require(_0x912e('0x4'));var config=require('../../config/environment');var controller=require(_0x912e('0x5'));router[_0x912e('0x6')]('/',auth[_0x912e('0x7')](),controller[_0x912e('0x8')]);router['get'](_0x912e('0x9'),auth[_0x912e('0x7')](),controller[_0x912e('0xa')]);router[_0x912e('0xb')]('/',auth[_0x912e('0x7')](),controller['create']);router['put']('/:id',auth[_0x912e('0x7')](),controller[_0x912e('0xc')]);router[_0x912e('0xd')](_0x912e('0x9'),auth[_0x912e('0x7')](),controller['destroy']);module[_0x912e('0xe')]=router; \ No newline at end of file +var _0xda2d=['update','delete','destroy','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','create','put'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0xda2d,0xb3));var _0xdda2=function(_0x1867a2,_0x25e7b3){_0x1867a2=_0x1867a2-0x0;var _0xb7bf00=_0xda2d[_0x1867a2];return _0xb7bf00;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require('connect-timeout');var express=require(_0xdda2('0x2'));var router=express['Router']();var fs_extra=require(_0xdda2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdda2('0x4'));var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller['index']);router[_0xdda2('0x7')](_0xdda2('0x9'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')](_0xdda2('0x9'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')](_0xdda2('0x9'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index f0e1ade..405f28f 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 _0x4888=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','sequelize','exports','STRING','BOOLEAN','DATE','format'];(function(_0x2a4487,_0x53b172){var _0x588d9f=function(_0x2cf03a){while(--_0x2cf03a){_0x2a4487['push'](_0x2a4487['shift']());}};_0x588d9f(++_0x53b172);}(_0x4888,0x198));var _0x8488=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x4888[_0x50e40b];return _0x2608b7;};'use strict';var moment=require('moment');var Sequelize=require(_0x8488('0x0'));module[_0x8488('0x1')]={'phone':{'type':Sequelize[_0x8488('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x8488('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x8488('0x4')],'defaultValue':moment()[_0x8488('0x5')](_0x8488('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8488('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8488('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x8488('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8488('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8488('0x4')]},'priority':{'type':Sequelize[_0x8488('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x8488('0x7')],'unique':_0x8488('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x8488('0x7')],'unique':_0x8488('0x8')},'CampaignId':{'type':Sequelize[_0x8488('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x8488('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8488('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8488('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8488('0x7')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x8488('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x8488('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x7096=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','sequelize','STRING'];(function(_0x42121f,_0x4f959b){var _0x4e5df9=function(_0x191181){while(--_0x191181){_0x42121f['push'](_0x42121f['shift']());}};_0x4e5df9(++_0x4f959b);}(_0x7096,0x10c));var _0x6709=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x7096[_0x618414];return _0x21c19a;};'use strict';var moment=require('moment');var Sequelize=require(_0x6709('0x0'));module['exports']={'phone':{'type':Sequelize[_0x6709('0x1')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x6709('0x2')],'defaultValue':moment()[_0x6709('0x3')](_0x6709('0x4'))},'countbusyretry':{'type':Sequelize[_0x6709('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6709('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6709('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x6709('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6709('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6709('0x2')]},'priority':{'type':Sequelize[_0x6709('0x5')](0x2)[_0x6709('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x6709('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6709('0x5')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x6709('0x8')},'UserId':{'type':Sequelize[_0x6709('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x6709('0x5')],'unique':_0x6709('0x8')},'CampaignId':{'type':Sequelize[_0x6709('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x6709('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6709('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6709('0x5')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6709('0x1')]},'recallmeNotifiedDate':{'type':Sequelize[_0x6709('0x2')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index f1efdb2..e58f41a 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 _0x38d0=['sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','rawAttributes','fieldName','type','model','query','filters','intersection','$and','$or','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','CmHopper','findAll','rows','catch','params','keys','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','campaign','membername','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','ivr','CmContact','ContactId','isNil','firstName','calleridname','lastName','finally','CmHopperFinal','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','user','direction','isEmpty','hopperIds','scheduledAt','DESC','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','Queue','dialActive','getPreviewRecall','getVoiceQueues','hopperId','CmList','List','getOpenContacts','isNumber','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x225815,_0x33d978){var _0x14f3a3=function(_0x10c76f){while(--_0x10c76f){_0x225815['push'](_0x225815['shift']());}};_0x14f3a3(++_0x33d978);}(_0x38d0,0x123));var _0x038d=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x38d0[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x038d('0x0'));var zipdir=require(_0x038d('0x1'));var jsonpatch=require(_0x038d('0x2'));var rp=require('request-promise');var moment=require(_0x038d('0x3'));var BPromise=require(_0x038d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x038d('0x5'));var sox=require('sox');var csv=require(_0x038d('0x6'));var ejs=require(_0x038d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x038d('0x8'));var squel=require(_0x038d('0x9'));var crypto=require(_0x038d('0xa'));var jsforce=require(_0x038d('0xb'));var deskjs=require(_0x038d('0xc'));var toCsv=require(_0x038d('0x6'));var querystring=require(_0x038d('0xd'));var Papa=require(_0x038d('0xe'));var Redis=require(_0x038d('0xf'));var authService=require(_0x038d('0x10'));var qs=require(_0x038d('0x11'));var as=require(_0x038d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x038d('0x13'))(_0x038d('0x14'));var utils=require(_0x038d('0x15'));var config=require('../../config/environment');var shared=require(_0x038d('0x16'));var licenseUtil=require(_0x038d('0x17'));var db=require(_0x038d('0x18'))['db'];function respondWithStatusCode(_0x225683,_0x12c34d){_0x12c34d=_0x12c34d||0xcc;return function(_0x114250){if(_0x114250){return _0x225683[_0x038d('0x19')](_0x12c34d);}return _0x225683[_0x038d('0x1a')](_0x12c34d)[_0x038d('0x1b')]();};}function respondWithResult(_0x4e78d3,_0x5adcd5){_0x5adcd5=_0x5adcd5||0xc8;return function(_0x5b764a){if(_0x5b764a){return _0x4e78d3[_0x038d('0x1a')](_0x5adcd5)[_0x038d('0x1c')](_0x5b764a);}};}function respondWithFilteredResult(_0x4c36ee,_0x4b7bfb){return function(_0x4e4960){if(_0x4e4960){var _0x483822=typeof _0x4b7bfb[_0x038d('0x1d')]===_0x038d('0x1e')&&typeof _0x4b7bfb[_0x038d('0x1f')]===_0x038d('0x1e');var _0x39cca1=_0x4e4960[_0x038d('0x20')];var _0x3e8d0f=_0x483822?0x0:_0x4b7bfb[_0x038d('0x1d')];var _0x11c8cb=_0x483822?_0x4e4960[_0x038d('0x20')]:_0x4b7bfb[_0x038d('0x1d')]+_0x4b7bfb[_0x038d('0x1f')];var _0x1c1171;if(_0x11c8cb>=_0x39cca1){_0x11c8cb=_0x39cca1;_0x1c1171=0xc8;}else{_0x1c1171=0xce;}_0x4c36ee[_0x038d('0x1a')](_0x1c1171);return _0x4c36ee['set']('Content-Range',_0x3e8d0f+'-'+_0x11c8cb+'/'+_0x39cca1)[_0x038d('0x1c')](_0x4e4960);}return null;};}function patchUpdates(_0x42ab21){return function(_0x380b5e){try{jsonpatch[_0x038d('0x21')](_0x380b5e,_0x42ab21,!![]);}catch(_0x2bb550){return BPromise[_0x038d('0x22')](_0x2bb550);}return _0x380b5e[_0x038d('0x23')]();};}function saveUpdates(_0x4eb93e,_0x89c6f1){return function(_0x4d1100){if(_0x4d1100){return _0x4d1100[_0x038d('0x24')](_0x4eb93e)[_0x038d('0x25')](function(_0x5ea43b){return _0x5ea43b;});}return null;};}function removeEntity(_0x19e932,_0x3611ff){return function(_0x230020){if(_0x230020){return _0x230020[_0x038d('0x26')]()[_0x038d('0x25')](function(){_0x19e932['status'](0xcc)[_0x038d('0x1b')]();});}};}function handleEntityNotFound(_0x3e1286,_0x1dc3f3){return function(_0x5c7db6){if(!_0x5c7db6){_0x3e1286['sendStatus'](0x194);}return _0x5c7db6;};}function handleError(_0x525908,_0x4379d9){_0x4379d9=_0x4379d9||0x1f4;return function(_0x4170a6){logger[_0x038d('0x27')](_0x4170a6[_0x038d('0x28')]);if(_0x4170a6[_0x038d('0x29')]){delete _0x4170a6[_0x038d('0x29')];}_0x525908[_0x038d('0x1a')](_0x4379d9)['send'](_0x4170a6);};}exports['index']=function(_0x2c0b46,_0x1f7cdb){var _0x33fa99={},_0x56df41={},_0x169245={'count':0x0,'rows':[]};var _0x215b2e=_['map'](db['CmHopper'][_0x038d('0x2a')],function(_0x1d7567){return{'name':_0x1d7567[_0x038d('0x2b')],'type':_0x1d7567[_0x038d('0x2c')]['key']};});_0x56df41[_0x038d('0x2d')]=_['map'](_0x215b2e,_0x038d('0x29'));_0x56df41[_0x038d('0x2e')]=_['keys'](_0x2c0b46[_0x038d('0x2e')]);_0x56df41[_0x038d('0x2f')]=_[_0x038d('0x30')](_0x56df41['model'],_0x56df41[_0x038d('0x2e')]);_0x56df41[_0x038d('0x2f')]=_['concat'](_0x56df41[_0x038d('0x2f')],[_0x038d('0x31'),_0x038d('0x32'),'$gt',_0x038d('0x33'),_0x038d('0x34'),_0x038d('0x35'),_0x038d('0x36'),'$eq',_0x038d('0x37'),_0x038d('0x38'),_0x038d('0x39'),_0x038d('0x3a'),_0x038d('0x3b'),'$like',_0x038d('0x3c'),_0x038d('0x3d'),_0x038d('0x3e'),_0x038d('0x3f'),'$overlap',_0x038d('0x40'),_0x038d('0x41'),_0x038d('0x42')]);_0x33fa99[_0x038d('0x43')]=_['intersection'](_0x56df41[_0x038d('0x2d')],qs[_0x038d('0x44')](_0x2c0b46['query'][_0x038d('0x44')]));_0x33fa99['attributes']=_0x33fa99[_0x038d('0x43')][_0x038d('0x45')]?_0x33fa99['attributes']:_0x56df41['model'];if(!_0x2c0b46['query'][_0x038d('0x46')](_0x038d('0x47'))){_0x33fa99[_0x038d('0x1f')]=qs['limit'](_0x2c0b46['query']['limit']);_0x33fa99[_0x038d('0x1d')]=qs[_0x038d('0x1d')](_0x2c0b46[_0x038d('0x2e')][_0x038d('0x1d')]);}_0x33fa99['order']=qs[_0x038d('0x48')](_0x2c0b46[_0x038d('0x2e')][_0x038d('0x48')]);_0x33fa99[_0x038d('0x49')]=qs[_0x038d('0x2f')](_[_0x038d('0x4a')](_0x2c0b46[_0x038d('0x2e')],_0x56df41[_0x038d('0x2f')]),_0x215b2e);if(_0x2c0b46[_0x038d('0x2e')][_0x038d('0x4b')]){_0x33fa99[_0x038d('0x49')]=_[_0x038d('0x4c')](_0x33fa99[_0x038d('0x49')],{'$or':_[_0x038d('0x4d')](_0x215b2e,function(_0x409065){if(_0x409065[_0x038d('0x2c')]!==_0x038d('0x4e')){var _0x383e8a={};_0x383e8a[_0x409065[_0x038d('0x29')]]={'$like':'%'+_0x2c0b46[_0x038d('0x2e')][_0x038d('0x4b')]+'%'};return _0x383e8a;}})});}_0x33fa99=_[_0x038d('0x4c')]({},_0x33fa99,_0x2c0b46[_0x038d('0x4f')]);var _0x53a74f={'where':_0x33fa99[_0x038d('0x49')]};return db['CmHopper']['count'](_0x53a74f)[_0x038d('0x25')](function(_0x247a6d){_0x169245[_0x038d('0x20')]=_0x247a6d;if(_0x2c0b46[_0x038d('0x2e')][_0x038d('0x50')]){_0x33fa99[_0x038d('0x51')]=[{'all':!![]}];}return db[_0x038d('0x52')][_0x038d('0x53')](_0x33fa99);})[_0x038d('0x25')](function(_0x2744b4){_0x169245[_0x038d('0x54')]=_0x2744b4;return _0x169245;})[_0x038d('0x25')](respondWithFilteredResult(_0x1f7cdb,_0x33fa99))[_0x038d('0x55')](handleError(_0x1f7cdb,null));};exports['show']=function(_0x300493,_0xa5fefd){var _0x20e217={'raw':!![],'where':{'id':_0x300493[_0x038d('0x56')]['id']}},_0x51d381={};_0x51d381[_0x038d('0x2d')]=_[_0x038d('0x57')](db[_0x038d('0x52')]['rawAttributes']);_0x51d381[_0x038d('0x2e')]=_[_0x038d('0x57')](_0x300493[_0x038d('0x2e')]);_0x51d381[_0x038d('0x2f')]=_[_0x038d('0x30')](_0x51d381[_0x038d('0x2d')],_0x51d381[_0x038d('0x2e')]);_0x20e217[_0x038d('0x43')]=_[_0x038d('0x30')](_0x51d381[_0x038d('0x2d')],qs['fields'](_0x300493[_0x038d('0x2e')][_0x038d('0x44')]));_0x20e217['attributes']=_0x20e217[_0x038d('0x43')][_0x038d('0x45')]?_0x20e217[_0x038d('0x43')]:_0x51d381[_0x038d('0x2d')];if(_0x300493[_0x038d('0x2e')][_0x038d('0x50')]){_0x20e217['include']=[{'all':!![]}];}_0x20e217=_['merge']({},_0x20e217,_0x300493['options']);return db[_0x038d('0x52')][_0x038d('0x58')](_0x20e217)['then'](handleEntityNotFound(_0xa5fefd,null))[_0x038d('0x25')](respondWithResult(_0xa5fefd,null))[_0x038d('0x55')](handleError(_0xa5fefd,null));};exports['create']=function(_0x3844d3,_0x53d633){return db[_0x038d('0x52')][_0x038d('0x59')](_0x3844d3['body'],{})[_0x038d('0x25')](respondWithResult(_0x53d633,0xc9))[_0x038d('0x55')](handleError(_0x53d633,null));};exports[_0x038d('0x24')]=function(_0x2684e6,_0x18c14e){if(_0x2684e6[_0x038d('0x5a')]['id']){delete _0x2684e6['body']['id'];}return db[_0x038d('0x52')][_0x038d('0x58')]({'where':{'id':_0x2684e6['params']['id']}})[_0x038d('0x25')](handleEntityNotFound(_0x18c14e,null))[_0x038d('0x25')](saveUpdates(_0x2684e6[_0x038d('0x5a')],null))['then'](respondWithResult(_0x18c14e,null))[_0x038d('0x55')](handleError(_0x18c14e,null));};exports[_0x038d('0x5b')]=function(_0x3bb590,_0x3d30c4){return db[_0x038d('0x52')][_0x038d('0x5b')]()[_0x038d('0x25')](respondWithResult(_0x3d30c4,null))['catch'](handleError(_0x3d30c4,null));};exports[_0x038d('0x26')]=function(_0x36cdfe,_0x4c25c8){var _0x13c509;return db[_0x038d('0x52')]['find']({'where':{'id':_0x36cdfe[_0x038d('0x56')]['id']}})['then'](handleEntityNotFound(_0x4c25c8,null))[_0x038d('0x25')](function(_0x1ed7b9){if(_0x1ed7b9){return _0x1ed7b9[_0x038d('0x26')]()[_0x038d('0x25')](function(_0x2e9ab7){return _0x2e9ab7;});}})['then'](function(_0x4526df){_0x13c509=_0x4526df;if(_0x4526df){if(_0x4526df[_0x038d('0x5c')]||_0x4526df[_0x038d('0x5d')]){return db[_0x4526df[_0x038d('0x5c')]?_0x038d('0x5e'):_0x038d('0x5f')][_0x038d('0x58')]({'where':{'id':_0x4526df[_0x038d('0x5c')]?_0x4526df['VoiceQueueId']:_0x4526df[_0x038d('0x5d')]},'attributes':['id',_0x038d('0x29')],'raw':!![]});}}})[_0x038d('0x25')](function(_0x225184){var _0x5ea2a6={};if(_0x225184){_[_0x038d('0x4c')](_0x5ea2a6,_[_0x038d('0x60')](_0x13c509[_0x038d('0x61')],[_0x038d('0x62'),_0x038d('0x63'),'id']));_0x5ea2a6[_0x038d('0x64')]=0x15;_0x5ea2a6[_0x038d('0x65')]='deleted';_0x5ea2a6[_0x038d('0x66')]=_0x225184[_0x038d('0x29')];_0x5ea2a6[_0x038d('0x67')]=_0x36cdfe['user'][_0x038d('0x29')];_0x5ea2a6[_0x038d('0x68')]=_0x36cdfe['user']['id'];_0x5ea2a6['deleted']=!![];_0x5ea2a6[_0x038d('0x69')]=moment()[_0x038d('0x6a')](_0x038d('0x6b'));_0x5ea2a6['calleridnum']=_0x13c509[_0x038d('0x6c')];_0x5ea2a6['campaigntype']=_0x13c509[_0x038d('0x5c')]?'queue':_0x038d('0x6d');return db[_0x038d('0x6e')][_0x038d('0x58')]({'where':{'id':_0x5ea2a6[_0x038d('0x6f')]},'attributes':['firstName','lastName']})[_0x038d('0x25')](function(_0x463259){if(!_[_0x038d('0x70')](_0x4c25c8)&&!_[_0x038d('0x70')](_0x463259[_0x038d('0x71')])){_0x5ea2a6[_0x038d('0x72')]=_0x463259[_0x038d('0x71')];if(!_[_0x038d('0x70')](_0x463259[_0x038d('0x73')])){_0x5ea2a6['calleridname']+='\x20'+_0x463259[_0x038d('0x73')];}}})[_0x038d('0x74')](function(){return db[_0x038d('0x75')]['create'](_0x5ea2a6);});}})[_0x038d('0x25')](function(){return _0x4c25c8[_0x038d('0x1a')](0xcc)[_0x038d('0x1b')]();})[_0x038d('0x55')](handleError(_0x4c25c8,null));};exports['getPreview']=function(_0x1f3f95,_0x5d4275,_0x5e244f){var _0x4adc65=[];return db[_0x038d('0x6e')][_0x038d('0x5b')]()['then'](function(_0x3ae421){_0x4adc65=_['keys'](_0x3ae421);return _0x1f3f95['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x038d('0x76')},'attributes':['id',_0x038d('0x77'),_0x038d('0x78')],'raw':!![]});})[_0x038d('0x25')](function(_0x15c084){if(_0x15c084&&_0x15c084[_0x038d('0x45')]){return db[_0x038d('0x79')][_0x038d('0x7a')](function(_0x35c96e){var _0x194599={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x038d('0x6b'))},'VoiceQueueId':{'$in':_[_0x038d('0x4d')](_0x15c084,'id')},'$or':[{'UserId':null},{'UserId':_0x1f3f95['user']['id']}]};var _0x344c63={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x15c084)[_0x038d('0x4b')]([_0x038d('0x78'),0x0])[_0x038d('0x4d')]('id')[_0x038d('0x7b')]()},'$or':[{'UserId':null},{'UserId':_0x1f3f95[_0x038d('0x7c')]['id']}]};var _0x3a6351={'$or':[_0x194599,_0x344c63]};var _0x5b4124=[];if(_0x1f3f95[_0x038d('0x5a')]['direction']&&_0x1f3f95[_0x038d('0x5a')][_0x038d('0x7d')]==='prev'){if(!_[_0x038d('0x7e')](_0x1f3f95['body'][_0x038d('0x7f')])){_0x3a6351['id']={'$in':_0x1f3f95[_0x038d('0x5a')]['hopperIds']};}_0x5b4124=[['priority','ASC'],[_0x038d('0x80'),_0x15c084[0x0][_0x038d('0x77')]==='ASC'?_0x038d('0x81'):_0x038d('0x82')],db[_0x038d('0x79')][_0x038d('0x83')](_0x038d('0x84')),['id',_0x038d('0x81')]];}else{if(!_[_0x038d('0x7e')](_0x1f3f95['body'][_0x038d('0x7f')])){_0x3a6351['id']={'$notIn':_0x1f3f95[_0x038d('0x5a')][_0x038d('0x7f')]};}_0x5b4124=[[_0x038d('0x85'),'DESC'],[_0x038d('0x80'),_0x15c084[0x0][_0x038d('0x77')]],db[_0x038d('0x79')][_0x038d('0x83')](_0x038d('0x86')),['id',_0x038d('0x82')]];}return db[_0x038d('0x52')][_0x038d('0x87')]({'attributes':['id',_0x038d('0x88'),_0x038d('0x89')],'where':_0x3a6351,'order':_0x5b4124,'transaction':_0x35c96e,'lock':_0x35c96e[_0x038d('0x8a')][_0x038d('0x8b')],'include':[{'model':db[_0x038d('0x6e')],'as':_0x038d('0x8c'),'attributes':_0x4adc65,'include':[{'model':db[_0x038d('0x8d')],'as':_0x038d('0x8e'),'attributes':['id','name']}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x038d('0x29')]},{'model':db['VoiceQueue'],'as':_0x038d('0x8f'),'attributes':['id',_0x038d('0x29'),_0x038d('0x90')]}]})[_0x038d('0x25')](function(_0x38f8fc){if(_0x38f8fc){return _0x38f8fc[_0x038d('0x24')]({'UserId':_0x1f3f95['user']['id']},{'transaction':_0x35c96e});}});});}})[_0x038d('0x25')](handleEntityNotFound(_0x5d4275,null))['then'](respondWithResult(_0x5d4275,null))['catch'](handleError(_0x5d4275,null));};exports[_0x038d('0x91')]=function(_0x3bd723,_0x2cda2a,_0x266b57){var _0x371204=[];return db[_0x038d('0x6e')][_0x038d('0x5b')]()[_0x038d('0x25')](function(_0x398a6c){_0x371204=_[_0x038d('0x57')](_0x398a6c);return _0x3bd723[_0x038d('0x7c')][_0x038d('0x92')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x038d('0x76')},'attributes':['id',_0x038d('0x77'),_0x038d('0x78')],'raw':!![]});})[_0x038d('0x25')](function(_0x7d2904){if(_0x7d2904&&_0x7d2904[_0x038d('0x45')]){return db['sequelize'][_0x038d('0x7a')](function(_0xd7101a){var _0xd5c630={'active':![],'recallme':!![],'id':_0x3bd723['body'][_0x038d('0x93')]};return db[_0x038d('0x52')]['findOne']({'attributes':['id',_0x038d('0x88'),_0x038d('0x89')],'where':_0xd5c630,'transaction':_0xd7101a,'lock':_0xd7101a['LOCK'][_0x038d('0x8b')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x371204,'include':[{'model':db[_0x038d('0x8d')],'as':_0x038d('0x8e'),'attributes':['id',_0x038d('0x29')]}]},{'model':db[_0x038d('0x94')],'as':_0x038d('0x95'),'attributes':['id',_0x038d('0x29')]},{'model':db[_0x038d('0x5e')],'as':_0x038d('0x8f'),'attributes':['id',_0x038d('0x29'),_0x038d('0x90')]}]})[_0x038d('0x25')](function(_0x4a5ff1){if(_0x4a5ff1){return _0x4a5ff1['update']({'UserId':_0x3bd723[_0x038d('0x7c')]['id']},{'transaction':_0xd7101a});}});});}})['then'](handleEntityNotFound(_0x2cda2a,null))[_0x038d('0x25')](respondWithResult(_0x2cda2a,null))[_0x038d('0x55')](handleError(_0x2cda2a,null));};exports[_0x038d('0x96')]=function(_0x57f97d,_0x2258ce,_0xe14618){return _0x57f97d[_0x038d('0x7c')][_0x038d('0x92')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x038d('0x25')](function(_0x1cf0c6){if(_0x1cf0c6&&_0x1cf0c6[_0x038d('0x45')]){return db['CmHopper'][_0x038d('0x20')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x038d('0x4d')](_0x1cf0c6,'id')},'$or':[{'UserId':null},{'UserId':_0x57f97d[_0x038d('0x7c')]['id']}]}});}return 0x0;})['then'](function(_0x2eb6e4){if(!_[_0x038d('0x70')](_0x2eb6e4)&&_[_0x038d('0x97')](_0x2eb6e4)){return _0x2258ce[_0x038d('0x1a')](0xc8)[_0x038d('0x1c')]({'contacts':_0x2eb6e4});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x038d('0x98'));_0x2258ce['sendStatus'](0x194);}})[_0x038d('0x55')](handleError(_0x2258ce,null));};exports[_0x038d('0x99')]=function(_0x488d37,_0xad0cbc,_0x10cdfb){var _0x50ba45=shared[_0x038d('0x9a')];var _0x360188=[];_['map'](_0x50ba45,function(_0x1bc87e){_0x360188[_0x038d('0x9b')]({'id':_0x1bc87e['name'],'name':_0x1bc87e['name'],'utcOffset':_0x1bc87e[_0x038d('0x9c')]});});return _0xad0cbc[_0x038d('0x1a')](0xc8)[_0x038d('0x1c')]({'tz':_0x360188});};exports[_0x038d('0x9d')]=function(_0x43b2aa,_0x35c014,_0x11917a){var _0xc03a6c=shared[_0x038d('0x9a')];var _0x59d052={};if(!_[_0x038d('0x70')](_0xc03a6c[_0x43b2aa[_0x038d('0x5a')]['id']]))_0x59d052=_0xc03a6c[_0x43b2aa['body']['id']];return _0x35c014[_0x038d('0x1a')](0xc8)[_0x038d('0x1c')](_0x59d052);}; \ No newline at end of file +var _0x5ebe=['filters','concat','$and','$or','$gt','$gte','$not','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$overlap','$contains','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','find','create','body','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','lastName','calleridname','finally','CmHopperFinal','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','direction','hopperIds','ASC','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','CmCompany','Company','CmList','Queue','hopperId','findOne','LOCK','UPDATE','Contact','List','dialActive','getOpenContacts','preview','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','push','utcOffset','getTimezone','timezones','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','name','send','CmHopper','rawAttributes','type','key','model','query','keys'];(function(_0x28e33d,_0x28e335){var _0x1b5364=function(_0x2eb215){while(--_0x2eb215){_0x28e33d['push'](_0x28e33d['shift']());}};_0x1b5364(++_0x28e335);}(_0x5ebe,0x69));var _0xe5eb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5ebe[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe5eb('0x0'));var zipdir=require(_0xe5eb('0x1'));var jsonpatch=require(_0xe5eb('0x2'));var rp=require(_0xe5eb('0x3'));var moment=require(_0xe5eb('0x4'));var BPromise=require(_0xe5eb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe5eb('0x6'));var sox=require(_0xe5eb('0x7'));var csv=require(_0xe5eb('0x8'));var ejs=require(_0xe5eb('0x9'));var fs=require('fs');var fs_extra=require(_0xe5eb('0xa'));var _=require(_0xe5eb('0xb'));var squel=require(_0xe5eb('0xc'));var crypto=require(_0xe5eb('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe5eb('0xe'));var Redis=require('ioredis');var authService=require(_0xe5eb('0xf'));var qs=require(_0xe5eb('0x10'));var as=require(_0xe5eb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5eb('0x12'))(_0xe5eb('0x13'));var utils=require(_0xe5eb('0x14'));var config=require(_0xe5eb('0x15'));var shared=require(_0xe5eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe5eb('0x16'))['db'];function respondWithStatusCode(_0x146b26,_0x2a8884){_0x2a8884=_0x2a8884||0xcc;return function(_0x53fda0){if(_0x53fda0){return _0x146b26['sendStatus'](_0x2a8884);}return _0x146b26[_0xe5eb('0x17')](_0x2a8884)[_0xe5eb('0x18')]();};}function respondWithResult(_0x22e644,_0x531940){_0x531940=_0x531940||0xc8;return function(_0x40ae36){if(_0x40ae36){return _0x22e644[_0xe5eb('0x17')](_0x531940)['json'](_0x40ae36);}};}function respondWithFilteredResult(_0x425747,_0x58d21c){return function(_0x50c2cc){if(_0x50c2cc){var _0x4e0ce1=typeof _0x58d21c[_0xe5eb('0x19')]===_0xe5eb('0x1a')&&typeof _0x58d21c['limit']===_0xe5eb('0x1a');var _0x4c7257=_0x50c2cc[_0xe5eb('0x1b')];var _0xc6b8df=_0x4e0ce1?0x0:_0x58d21c[_0xe5eb('0x19')];var _0x2159a4=_0x4e0ce1?_0x50c2cc['count']:_0x58d21c[_0xe5eb('0x19')]+_0x58d21c[_0xe5eb('0x1c')];var _0x111c51;if(_0x2159a4>=_0x4c7257){_0x2159a4=_0x4c7257;_0x111c51=0xc8;}else{_0x111c51=0xce;}_0x425747[_0xe5eb('0x17')](_0x111c51);return _0x425747[_0xe5eb('0x1d')](_0xe5eb('0x1e'),_0xc6b8df+'-'+_0x2159a4+'/'+_0x4c7257)[_0xe5eb('0x1f')](_0x50c2cc);}return null;};}function patchUpdates(_0x543994){return function(_0x4f7c7f){try{jsonpatch[_0xe5eb('0x20')](_0x4f7c7f,_0x543994,!![]);}catch(_0x559da9){return BPromise[_0xe5eb('0x21')](_0x559da9);}return _0x4f7c7f[_0xe5eb('0x22')]();};}function saveUpdates(_0x4a106b,_0x2761da){return function(_0x3e49a4){if(_0x3e49a4){return _0x3e49a4[_0xe5eb('0x23')](_0x4a106b)['then'](function(_0x1cb938){return _0x1cb938;});}return null;};}function removeEntity(_0x430836,_0x41fda4){return function(_0x55b347){if(_0x55b347){return _0x55b347[_0xe5eb('0x24')]()[_0xe5eb('0x25')](function(){_0x430836['status'](0xcc)[_0xe5eb('0x18')]();});}};}function handleEntityNotFound(_0x3c7e15,_0x1742d8){return function(_0x507ee6){if(!_0x507ee6){_0x3c7e15[_0xe5eb('0x26')](0x194);}return _0x507ee6;};}function handleError(_0x1bc160,_0x40ecb1){_0x40ecb1=_0x40ecb1||0x1f4;return function(_0x1234c6){logger[_0xe5eb('0x27')](_0x1234c6['stack']);if(_0x1234c6[_0xe5eb('0x28')]){delete _0x1234c6[_0xe5eb('0x28')];}_0x1bc160[_0xe5eb('0x17')](_0x40ecb1)[_0xe5eb('0x29')](_0x1234c6);};}exports['index']=function(_0x5f2e62,_0x4ff77a){var _0x39dc8f={},_0x558f47={},_0xfcd903={'count':0x0,'rows':[]};var _0x225010=_['map'](db[_0xe5eb('0x2a')][_0xe5eb('0x2b')],function(_0xd80459){return{'name':_0xd80459['fieldName'],'type':_0xd80459[_0xe5eb('0x2c')][_0xe5eb('0x2d')]};});_0x558f47[_0xe5eb('0x2e')]=_['map'](_0x225010,_0xe5eb('0x28'));_0x558f47[_0xe5eb('0x2f')]=_[_0xe5eb('0x30')](_0x5f2e62[_0xe5eb('0x2f')]);_0x558f47[_0xe5eb('0x31')]=_['intersection'](_0x558f47['model'],_0x558f47['query']);_0x558f47[_0xe5eb('0x31')]=_[_0xe5eb('0x32')](_0x558f47[_0xe5eb('0x31')],[_0xe5eb('0x33'),_0xe5eb('0x34'),_0xe5eb('0x35'),_0xe5eb('0x36'),'$lt','$lte','$ne','$eq',_0xe5eb('0x37'),'$between',_0xe5eb('0x38'),_0xe5eb('0x39'),_0xe5eb('0x3a'),'$like',_0xe5eb('0x3b'),_0xe5eb('0x3c'),_0xe5eb('0x3d'),'$like',_0xe5eb('0x3e'),_0xe5eb('0x3f'),'$contained','$any']);_0x39dc8f['attributes']=_[_0xe5eb('0x40')](_0x558f47['model'],qs[_0xe5eb('0x41')](_0x5f2e62[_0xe5eb('0x2f')][_0xe5eb('0x41')]));_0x39dc8f['attributes']=_0x39dc8f[_0xe5eb('0x42')][_0xe5eb('0x43')]?_0x39dc8f['attributes']:_0x558f47[_0xe5eb('0x2e')];if(!_0x5f2e62[_0xe5eb('0x2f')][_0xe5eb('0x44')](_0xe5eb('0x45'))){_0x39dc8f['limit']=qs[_0xe5eb('0x1c')](_0x5f2e62[_0xe5eb('0x2f')][_0xe5eb('0x1c')]);_0x39dc8f[_0xe5eb('0x19')]=qs[_0xe5eb('0x19')](_0x5f2e62[_0xe5eb('0x2f')][_0xe5eb('0x19')]);}_0x39dc8f[_0xe5eb('0x46')]=qs['sort'](_0x5f2e62[_0xe5eb('0x2f')]['sort']);_0x39dc8f[_0xe5eb('0x47')]=qs[_0xe5eb('0x31')](_[_0xe5eb('0x48')](_0x5f2e62[_0xe5eb('0x2f')],_0x558f47[_0xe5eb('0x31')]),_0x225010);if(_0x5f2e62[_0xe5eb('0x2f')][_0xe5eb('0x49')]){_0x39dc8f[_0xe5eb('0x47')]=_['merge'](_0x39dc8f[_0xe5eb('0x47')],{'$or':_[_0xe5eb('0x4a')](_0x225010,function(_0xacf1a2){if(_0xacf1a2[_0xe5eb('0x2c')]!=='VIRTUAL'){var _0x1d688e={};_0x1d688e[_0xacf1a2[_0xe5eb('0x28')]]={'$like':'%'+_0x5f2e62[_0xe5eb('0x2f')][_0xe5eb('0x49')]+'%'};return _0x1d688e;}})});}_0x39dc8f=_[_0xe5eb('0x4b')]({},_0x39dc8f,_0x5f2e62['options']);var _0x40f56d={'where':_0x39dc8f[_0xe5eb('0x47')]};return db[_0xe5eb('0x2a')][_0xe5eb('0x1b')](_0x40f56d)[_0xe5eb('0x25')](function(_0x3f32cc){_0xfcd903[_0xe5eb('0x1b')]=_0x3f32cc;if(_0x5f2e62[_0xe5eb('0x2f')][_0xe5eb('0x4c')]){_0x39dc8f[_0xe5eb('0x4d')]=[{'all':!![]}];}return db[_0xe5eb('0x2a')][_0xe5eb('0x4e')](_0x39dc8f);})[_0xe5eb('0x25')](function(_0x3bda28){_0xfcd903['rows']=_0x3bda28;return _0xfcd903;})['then'](respondWithFilteredResult(_0x4ff77a,_0x39dc8f))[_0xe5eb('0x4f')](handleError(_0x4ff77a,null));};exports[_0xe5eb('0x50')]=function(_0x403490,_0x3a5031){var _0x48e8d5={'raw':!![],'where':{'id':_0x403490[_0xe5eb('0x51')]['id']}},_0x5bd9e4={};_0x5bd9e4[_0xe5eb('0x2e')]=_['keys'](db[_0xe5eb('0x2a')][_0xe5eb('0x2b')]);_0x5bd9e4[_0xe5eb('0x2f')]=_[_0xe5eb('0x30')](_0x403490[_0xe5eb('0x2f')]);_0x5bd9e4['filters']=_[_0xe5eb('0x40')](_0x5bd9e4['model'],_0x5bd9e4[_0xe5eb('0x2f')]);_0x48e8d5[_0xe5eb('0x42')]=_['intersection'](_0x5bd9e4['model'],qs[_0xe5eb('0x41')](_0x403490[_0xe5eb('0x2f')][_0xe5eb('0x41')]));_0x48e8d5[_0xe5eb('0x42')]=_0x48e8d5[_0xe5eb('0x42')][_0xe5eb('0x43')]?_0x48e8d5[_0xe5eb('0x42')]:_0x5bd9e4[_0xe5eb('0x2e')];if(_0x403490['query']['includeAll']){_0x48e8d5[_0xe5eb('0x4d')]=[{'all':!![]}];}_0x48e8d5=_[_0xe5eb('0x4b')]({},_0x48e8d5,_0x403490['options']);return db[_0xe5eb('0x2a')][_0xe5eb('0x52')](_0x48e8d5)['then'](handleEntityNotFound(_0x3a5031,null))[_0xe5eb('0x25')](respondWithResult(_0x3a5031,null))[_0xe5eb('0x4f')](handleError(_0x3a5031,null));};exports[_0xe5eb('0x53')]=function(_0x9cf68,_0x7649ef){return db[_0xe5eb('0x2a')][_0xe5eb('0x53')](_0x9cf68[_0xe5eb('0x54')],{})[_0xe5eb('0x25')](respondWithResult(_0x7649ef,0xc9))[_0xe5eb('0x4f')](handleError(_0x7649ef,null));};exports[_0xe5eb('0x23')]=function(_0x5c182a,_0x11fbab){if(_0x5c182a[_0xe5eb('0x54')]['id']){delete _0x5c182a[_0xe5eb('0x54')]['id'];}return db[_0xe5eb('0x2a')][_0xe5eb('0x52')]({'where':{'id':_0x5c182a[_0xe5eb('0x51')]['id']}})[_0xe5eb('0x25')](handleEntityNotFound(_0x11fbab,null))[_0xe5eb('0x25')](saveUpdates(_0x5c182a[_0xe5eb('0x54')],null))[_0xe5eb('0x25')](respondWithResult(_0x11fbab,null))[_0xe5eb('0x4f')](handleError(_0x11fbab,null));};exports[_0xe5eb('0x55')]=function(_0x5e7207,_0x29ee89){return db['CmHopper']['describe']()[_0xe5eb('0x25')](respondWithResult(_0x29ee89,null))[_0xe5eb('0x4f')](handleError(_0x29ee89,null));};exports[_0xe5eb('0x24')]=function(_0xad6d48,_0x3d8efd){var _0x57da0d;return db[_0xe5eb('0x2a')][_0xe5eb('0x52')]({'where':{'id':_0xad6d48[_0xe5eb('0x51')]['id']}})[_0xe5eb('0x25')](handleEntityNotFound(_0x3d8efd,null))['then'](function(_0x4e695a){if(_0x4e695a){return _0x4e695a[_0xe5eb('0x24')]()[_0xe5eb('0x25')](function(_0x27cd20){return _0x27cd20;});}})[_0xe5eb('0x25')](function(_0x241f86){_0x57da0d=_0x241f86;if(_0x241f86){if(_0x241f86[_0xe5eb('0x56')]||_0x241f86['CampaignId']){return db[_0x241f86[_0xe5eb('0x56')]?_0xe5eb('0x57'):_0xe5eb('0x58')]['find']({'where':{'id':_0x241f86[_0xe5eb('0x56')]?_0x241f86['VoiceQueueId']:_0x241f86[_0xe5eb('0x59')]},'attributes':['id',_0xe5eb('0x28')],'raw':!![]});}}})[_0xe5eb('0x25')](function(_0x4e8f7e){var _0x860f39={};if(_0x4e8f7e){_[_0xe5eb('0x4b')](_0x860f39,_[_0xe5eb('0x5a')](_0x57da0d[_0xe5eb('0x5b')],[_0xe5eb('0x5c'),_0xe5eb('0x5d'),'id']));_0x860f39[_0xe5eb('0x5e')]=0x15;_0x860f39[_0xe5eb('0x5f')]=_0xe5eb('0x60');_0x860f39[_0xe5eb('0x61')]=_0x4e8f7e[_0xe5eb('0x28')];_0x860f39[_0xe5eb('0x62')]=_0xad6d48[_0xe5eb('0x63')][_0xe5eb('0x28')];_0x860f39['UserId']=_0xad6d48['user']['id'];_0x860f39[_0xe5eb('0x60')]=!![];_0x860f39[_0xe5eb('0x64')]=moment()[_0xe5eb('0x65')](_0xe5eb('0x66'));_0x860f39[_0xe5eb('0x67')]=_0x57da0d[_0xe5eb('0x68')];_0x860f39[_0xe5eb('0x69')]=_0x57da0d[_0xe5eb('0x56')]?_0xe5eb('0x6a'):_0xe5eb('0x6b');return db[_0xe5eb('0x6c')][_0xe5eb('0x52')]({'where':{'id':_0x860f39[_0xe5eb('0x6d')]},'attributes':[_0xe5eb('0x6e'),'lastName']})[_0xe5eb('0x25')](function(_0xf7e0e8){if(!_[_0xe5eb('0x6f')](_0x3d8efd)&&!_[_0xe5eb('0x6f')](_0xf7e0e8[_0xe5eb('0x6e')])){_0x860f39['calleridname']=_0xf7e0e8[_0xe5eb('0x6e')];if(!_[_0xe5eb('0x6f')](_0xf7e0e8[_0xe5eb('0x70')])){_0x860f39[_0xe5eb('0x71')]+='\x20'+_0xf7e0e8['lastName'];}}})[_0xe5eb('0x72')](function(){return db[_0xe5eb('0x73')][_0xe5eb('0x53')](_0x860f39);});}})[_0xe5eb('0x25')](function(){return _0x3d8efd[_0xe5eb('0x17')](0xcc)[_0xe5eb('0x18')]();})[_0xe5eb('0x4f')](handleError(_0x3d8efd,null));};exports['getPreview']=function(_0x3b386b,_0x1acf2f,_0x42ec32){var _0x4203ac=[];return db[_0xe5eb('0x6c')]['describe']()['then'](function(_0x206947){_0x4203ac=_[_0xe5eb('0x30')](_0x206947);return _0x3b386b[_0xe5eb('0x63')][_0xe5eb('0x74')]({'where':{'type':_0xe5eb('0x75'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xe5eb('0x76'),_0xe5eb('0x77')],'raw':!![]});})['then'](function(_0x15f76f){if(_0x15f76f&&_0x15f76f[_0xe5eb('0x43')]){return db['sequelize'][_0xe5eb('0x78')](function(_0x518110){var _0x501d19={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe5eb('0x65')](_0xe5eb('0x66'))},'VoiceQueueId':{'$in':_[_0xe5eb('0x4a')](_0x15f76f,'id')},'$or':[{'UserId':null},{'UserId':_0x3b386b[_0xe5eb('0x63')]['id']}]};var _0x58d00f={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x15f76f)[_0xe5eb('0x49')](['dialPreviewAutoRecallMe',0x0])[_0xe5eb('0x4a')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x3b386b[_0xe5eb('0x63')]['id']}]};var _0x28e2ce={'$or':[_0x501d19,_0x58d00f]};var _0x389641=[];if(_0x3b386b[_0xe5eb('0x54')][_0xe5eb('0x79')]&&_0x3b386b[_0xe5eb('0x54')]['direction']==='prev'){if(!_['isEmpty'](_0x3b386b['body'][_0xe5eb('0x7a')])){_0x28e2ce['id']={'$in':_0x3b386b[_0xe5eb('0x54')][_0xe5eb('0x7a')]};}_0x389641=[['priority',_0xe5eb('0x7b')],[_0xe5eb('0x7c'),_0x15f76f[0x0]['dialOrderByScheduledAt']===_0xe5eb('0x7b')?_0xe5eb('0x7d'):_0xe5eb('0x7b')],db[_0xe5eb('0x7e')][_0xe5eb('0x7f')](_0xe5eb('0x80')),['id',_0xe5eb('0x7d')]];}else{if(!_[_0xe5eb('0x81')](_0x3b386b[_0xe5eb('0x54')][_0xe5eb('0x7a')])){_0x28e2ce['id']={'$notIn':_0x3b386b[_0xe5eb('0x54')]['hopperIds']};}_0x389641=[[_0xe5eb('0x82'),_0xe5eb('0x7d')],[_0xe5eb('0x7c'),_0x15f76f[0x0]['dialOrderByScheduledAt']],db[_0xe5eb('0x7e')]['literal'](_0xe5eb('0x83')),['id','ASC']];}return db[_0xe5eb('0x2a')]['findOne']({'attributes':['id',_0xe5eb('0x84'),_0xe5eb('0x85')],'where':_0x28e2ce,'order':_0x389641,'transaction':_0x518110,'lock':_0x518110['LOCK']['UPDATE'],'include':[{'model':db[_0xe5eb('0x6c')],'as':'Contact','attributes':_0x4203ac,'include':[{'model':db[_0xe5eb('0x86')],'as':_0xe5eb('0x87'),'attributes':['id','name']}]},{'model':db[_0xe5eb('0x88')],'as':'List','attributes':['id',_0xe5eb('0x28')]},{'model':db[_0xe5eb('0x57')],'as':_0xe5eb('0x89'),'attributes':['id','name','dialActive']}]})['then'](function(_0x8e0c2c){if(_0x8e0c2c){return _0x8e0c2c[_0xe5eb('0x23')]({'UserId':_0x3b386b[_0xe5eb('0x63')]['id']},{'transaction':_0x518110});}});});}})[_0xe5eb('0x25')](handleEntityNotFound(_0x1acf2f,null))[_0xe5eb('0x25')](respondWithResult(_0x1acf2f,null))[_0xe5eb('0x4f')](handleError(_0x1acf2f,null));};exports['getPreviewRecall']=function(_0x2bb6e7,_0xb6821,_0x284114){var _0x17b907=[];return db[_0xe5eb('0x6c')]['describe']()[_0xe5eb('0x25')](function(_0x2796c0){_0x17b907=_[_0xe5eb('0x30')](_0x2796c0);return _0x2bb6e7[_0xe5eb('0x63')][_0xe5eb('0x74')]({'where':{'type':_0xe5eb('0x75'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xe5eb('0x76'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0xe5eb('0x25')](function(_0x3e3ce7){if(_0x3e3ce7&&_0x3e3ce7[_0xe5eb('0x43')]){return db['sequelize'][_0xe5eb('0x78')](function(_0x264da4){var _0x3ad20f={'active':![],'recallme':!![],'id':_0x2bb6e7[_0xe5eb('0x54')][_0xe5eb('0x8a')]};return db['CmHopper'][_0xe5eb('0x8b')]({'attributes':['id','scheduledat',_0xe5eb('0x85')],'where':_0x3ad20f,'transaction':_0x264da4,'lock':_0x264da4[_0xe5eb('0x8c')][_0xe5eb('0x8d')],'include':[{'model':db[_0xe5eb('0x6c')],'as':_0xe5eb('0x8e'),'attributes':_0x17b907,'include':[{'model':db[_0xe5eb('0x86')],'as':'Company','attributes':['id','name']}]},{'model':db[_0xe5eb('0x88')],'as':_0xe5eb('0x8f'),'attributes':['id',_0xe5eb('0x28')]},{'model':db[_0xe5eb('0x57')],'as':_0xe5eb('0x89'),'attributes':['id','name',_0xe5eb('0x90')]}]})['then'](function(_0x2e337b){if(_0x2e337b){return _0x2e337b[_0xe5eb('0x23')]({'UserId':_0x2bb6e7[_0xe5eb('0x63')]['id']},{'transaction':_0x264da4});}});});}})['then'](handleEntityNotFound(_0xb6821,null))[_0xe5eb('0x25')](respondWithResult(_0xb6821,null))['catch'](handleError(_0xb6821,null));};exports[_0xe5eb('0x91')]=function(_0x3968da,_0xc6137d,_0x282f1a){return _0x3968da[_0xe5eb('0x63')][_0xe5eb('0x74')]({'where':{'type':_0xe5eb('0x75'),'dialActive':!![],'dialMethod':_0xe5eb('0x92')},'attributes':['id'],'raw':!![]})[_0xe5eb('0x25')](function(_0x276047){if(_0x276047&&_0x276047[_0xe5eb('0x43')]){return db[_0xe5eb('0x2a')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe5eb('0x65')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x276047,'id')},'$or':[{'UserId':null},{'UserId':_0x3968da[_0xe5eb('0x63')]['id']}]}});}return 0x0;})['then'](function(_0x107c34){if(!_[_0xe5eb('0x6f')](_0x107c34)&&_['isNumber'](_0x107c34)){return _0xc6137d[_0xe5eb('0x17')](0xc8)[_0xe5eb('0x1f')]({'contacts':_0x107c34});}else{logger[_0xe5eb('0x27')](_0xe5eb('0x93'),'getOpenContacts',0x194,_0xe5eb('0x94'));_0xc6137d[_0xe5eb('0x26')](0x194);}})[_0xe5eb('0x4f')](handleError(_0xc6137d,null));};exports[_0xe5eb('0x95')]=function(_0x4a56f5,_0x1db388,_0xf7b8fb){var _0x2228eb=shared['timezones'];var _0x4e3a46=[];_[_0xe5eb('0x4a')](_0x2228eb,function(_0x520289){_0x4e3a46[_0xe5eb('0x96')]({'id':_0x520289[_0xe5eb('0x28')],'name':_0x520289[_0xe5eb('0x28')],'utcOffset':_0x520289[_0xe5eb('0x97')]});});return _0x1db388[_0xe5eb('0x17')](0xc8)[_0xe5eb('0x1f')]({'tz':_0x4e3a46});};exports[_0xe5eb('0x98')]=function(_0x24a550,_0x13b56b,_0x17a362){var _0x3e3da2=shared[_0xe5eb('0x99')];var _0x38eb76={};if(!_[_0xe5eb('0x6f')](_0x3e3da2[_0x24a550[_0xe5eb('0x54')]['id']]))_0x38eb76=_0x3e3da2[_0x24a550[_0xe5eb('0x54')]['id']];return _0x13b56b[_0xe5eb('0x17')](0xc8)[_0xe5eb('0x1f')](_0x38eb76);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 97720ce..28dc9d8 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 _0xbd51=['./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','moment','bluebird'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x31c726,_0x19f975){_0x31c726=_0x31c726-0x0;var _0x3f8bea=_0xbd51[_0x31c726];return _0x3f8bea;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'paranoid':![],'indexes':[{'name':_0x1bd5('0xa'),'fields':[_0x1bd5('0xa')]},{'name':'phone','fields':[_0x1bd5('0xb')]},{'name':'priority','fields':[_0x1bd5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['moment','bluebird','path','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x53ec,0x192));var _0xc53e=function(_0x17fed0,_0x281f6f){_0x17fed0=_0x17fed0-0x0;var _0x49fb26=_0x53ec[_0x17fed0];return _0x49fb26;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]},{'name':_0xc53e('0xc'),'fields':[_0xc53e('0xc')]},{'name':_0xc53e('0xd'),'fields':[_0xc53e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index f506313..220409e 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 _0x62ad=['UserId','all','GetContactRecallMe','GetCmHopperPreview','limit','keys','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','NOW()\x20+\x20INTERVAL\x20','CmList','List','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','GetCmHopper','CmHopper','findAll','options','where','include','map','model','attributes','then','catch','raw','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','User','voicePause','length','push','includes','ContactId','dataValues','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled'];(function(_0x4a5e87,_0x40d90e){var _0x47c558=function(_0x52a08d){while(--_0x52a08d){_0x4a5e87['push'](_0x4a5e87['shift']());}};_0x47c558(++_0x40d90e);}(_0x62ad,0xbc));var _0xd62a=function(_0x4cdcc3,_0x304758){_0x4cdcc3=_0x4cdcc3-0x0;var _0x38d062=_0x62ad[_0x4cdcc3];return _0x38d062;};'use strict';var _=require(_0xd62a('0x0'));var util=require(_0xd62a('0x1'));var moment=require(_0xd62a('0x2'));var BPromise=require('bluebird');var rs=require(_0xd62a('0x3'));var fs=require('fs');var Redis=require(_0xd62a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd62a('0x5'));var logger=require('../../config/logger')(_0xd62a('0x6'));var config=require(_0xd62a('0x7'));var jayson=require(_0xd62a('0x8'));const {validateExpressRequest}=require(_0xd62a('0x9'));var client=jayson['client'][_0xd62a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9f93a8,_0x346db5,_0x208d2a){return new BPromise(function(_0x294acd,_0x2a738f){return client[_0xd62a('0xb')](_0x9f93a8,_0x208d2a)['then'](function(_0x4dca8b){logger[_0xd62a('0xc')](_0xd62a('0xd'),_0x346db5,_0xd62a('0xe'));logger[_0xd62a('0xf')](_0xd62a('0x10'),_0x346db5,_0xd62a('0xe'),JSON[_0xd62a('0x11')](_0x4dca8b));if(_0x4dca8b['error']){if(_0x4dca8b[_0xd62a('0x12')]['code']===0x1f4){logger[_0xd62a('0x12')](_0xd62a('0xd'),_0x346db5,_0x4dca8b[_0xd62a('0x12')][_0xd62a('0x13')]);return _0x2a738f(_0x4dca8b[_0xd62a('0x12')]['message']);}logger[_0xd62a('0x12')](_0xd62a('0xd'),_0x346db5,_0x4dca8b[_0xd62a('0x12')][_0xd62a('0x13')]);return _0x294acd(_0x4dca8b[_0xd62a('0x12')][_0xd62a('0x13')]);}else{logger[_0xd62a('0xc')](_0xd62a('0xd'),_0x346db5,_0xd62a('0xe'));_0x294acd(_0x4dca8b['result'][_0xd62a('0x13')]);}})['catch'](function(_0x403cab){logger['error'](_0xd62a('0xd'),_0x346db5,_0x403cab);_0x2a738f(_0x403cab);});});}exports[_0xd62a('0x14')]=function(_0x4f3e41){var _0x36426e=this;return new Promise(function(_0x5da31a,_0x374f03){return db[_0xd62a('0x15')][_0xd62a('0x16')]({'raw':_0x4f3e41['options']?_0x4f3e41[_0xd62a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4f3e41['options']?_0x4f3e41[_0xd62a('0x17')][_0xd62a('0x18')]||null:null,'attributes':_0x4f3e41[_0xd62a('0x17')]?_0x4f3e41[_0xd62a('0x17')]['attributes']||null:null,'limit':_0x4f3e41[_0xd62a('0x17')]?_0x4f3e41[_0xd62a('0x17')]['limit']||null:null,'include':_0x4f3e41[_0xd62a('0x17')]?_0x4f3e41[_0xd62a('0x17')][_0xd62a('0x19')]?_[_0xd62a('0x1a')](_0x4f3e41[_0xd62a('0x17')]['include'],function(_0x2c4ae9){return{'model':db[_0x2c4ae9[_0xd62a('0x1b')]],'as':_0x2c4ae9['as'],'attributes':_0x2c4ae9[_0xd62a('0x1c')],'include':_0x2c4ae9[_0xd62a('0x19')]?_[_0xd62a('0x1a')](_0x2c4ae9[_0xd62a('0x19')],function(_0x10755a){return{'model':db[_0x10755a[_0xd62a('0x1b')]],'as':_0x10755a['as'],'attributes':_0x10755a[_0xd62a('0x1c')],'include':_0x10755a[_0xd62a('0x19')]?_[_0xd62a('0x1a')](_0x10755a['include'],function(_0x416688){return{'model':db[_0x416688['model']],'as':_0x416688['as'],'attributes':_0x416688[_0xd62a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd62a('0x1d')](function(_0x5b4c04){logger[_0xd62a('0xc')]('GetCmHopper',_0x4f3e41);logger[_0xd62a('0xf')](_0xd62a('0x14'),_0x4f3e41,JSON[_0xd62a('0x11')](_0x5b4c04));_0x5da31a(_0x5b4c04);})[_0xd62a('0x1e')](function(_0x322ae8){logger[_0xd62a('0x12')](_0xd62a('0x14'),_0x322ae8[_0xd62a('0x13')],_0x4f3e41);_0x374f03(_0x36426e[_0xd62a('0x12')](0x1f4,_0x322ae8[_0xd62a('0x13')]));});});};exports['ShowCmHopper']=function(_0x354822){var _0x28c255=this;return new Promise(function(_0x5221c9,_0xcba3d9){return db[_0xd62a('0x15')]['find']({'raw':_0x354822[_0xd62a('0x17')]?_0x354822[_0xd62a('0x17')][_0xd62a('0x1f')]===undefined?!![]:![]:!![],'where':_0x354822['options']?_0x354822[_0xd62a('0x17')][_0xd62a('0x18')]||null:null,'attributes':_0x354822['options']?_0x354822[_0xd62a('0x17')][_0xd62a('0x1c')]||null:null,'include':_0x354822['options']?_0x354822[_0xd62a('0x17')][_0xd62a('0x19')]?_[_0xd62a('0x1a')](_0x354822[_0xd62a('0x17')]['include'],function(_0x402585){return{'model':db[_0x402585[_0xd62a('0x1b')]],'as':_0x402585['as'],'attributes':_0x402585[_0xd62a('0x1c')],'include':_0x402585['include']?_[_0xd62a('0x1a')](_0x402585[_0xd62a('0x19')],function(_0x18e5c4){return{'model':db[_0x18e5c4[_0xd62a('0x1b')]],'as':_0x18e5c4['as'],'attributes':_0x18e5c4[_0xd62a('0x1c')],'include':_0x18e5c4[_0xd62a('0x19')]?_[_0xd62a('0x1a')](_0x18e5c4[_0xd62a('0x19')],function(_0x1b3843){return{'model':db[_0x1b3843[_0xd62a('0x1b')]],'as':_0x1b3843['as'],'attributes':_0x1b3843[_0xd62a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd62a('0x1d')](function(_0x580979){logger[_0xd62a('0xc')](_0xd62a('0x20'),_0x354822);logger[_0xd62a('0xf')]('ShowCmHopper',_0x354822,JSON[_0xd62a('0x11')](_0x580979));_0x5221c9(_0x580979);})[_0xd62a('0x1e')](function(_0x257409){logger[_0xd62a('0x12')]('ShowCmHopper',_0x257409[_0xd62a('0x13')],_0x354822);_0xcba3d9(_0x28c255[_0xd62a('0x12')](0x1f4,_0x257409[_0xd62a('0x13')]));});});};exports[_0xd62a('0x21')]=function(_0x2130a9){var _0x110240=this;return new Promise(function(_0x2611c3,_0x5c3331){return db[_0xd62a('0x15')][_0xd62a('0x22')](_0x2130a9[_0xd62a('0x23')],{'raw':_0x2130a9[_0xd62a('0x17')]?_0x2130a9[_0xd62a('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xd62a('0x1d')](function(_0x4d8715){logger[_0xd62a('0xc')](_0xd62a('0x21'),_0x2130a9);logger['debug']('CreateCmHopper',_0x2130a9,JSON[_0xd62a('0x11')](_0x4d8715));_0x2611c3(_0x4d8715);})[_0xd62a('0x1e')](function(_0x86fbc1){logger[_0xd62a('0x12')](_0xd62a('0x21'),_0x86fbc1[_0xd62a('0x13')],_0x2130a9);_0x5c3331(_0x110240[_0xd62a('0x12')](0x1f4,_0x86fbc1['message']));});});};exports[_0xd62a('0x24')]=function(_0x39aa35){var _0x2d3e1d=this;return new Promise(function(_0x3486f2,_0xf228d1){return db[_0xd62a('0x15')][_0xd62a('0x25')](_0x39aa35['body'],{'raw':_0x39aa35[_0xd62a('0x17')]?_0x39aa35['options'][_0xd62a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39aa35[_0xd62a('0x17')]?_0x39aa35[_0xd62a('0x17')][_0xd62a('0x18')]||null:null,'attributes':_0x39aa35[_0xd62a('0x17')]?_0x39aa35[_0xd62a('0x17')][_0xd62a('0x1c')]||null:null,'limit':_0x39aa35['options']?_0x39aa35[_0xd62a('0x17')]['limit']||null:null})[_0xd62a('0x1d')](function(_0x1ae167){logger[_0xd62a('0xc')](_0xd62a('0x24'),_0x39aa35);logger['info'](_0xd62a('0x26'),JSON[_0xd62a('0x11')](_0x39aa35[_0xd62a('0x17')]['where']),_0x39aa35[_0xd62a('0x23')][_0xd62a('0x27')]);logger['debug'](_0xd62a('0x24'),_0x39aa35,JSON[_0xd62a('0x11')](_0x1ae167));_0x3486f2(_0x1ae167);})[_0xd62a('0x1e')](function(_0x20ac6d){logger[_0xd62a('0x12')](_0xd62a('0x24'),_0x20ac6d[_0xd62a('0x13')],_0x39aa35);_0xf228d1(_0x2d3e1d[_0xd62a('0x12')](0x1f4,_0x20ac6d[_0xd62a('0x13')]));});});};exports[_0xd62a('0x28')]=function(_0x115c51){var _0x48351a=this;return new Promise(function(_0x3ad4d6,_0x2eab65){return db['CmHopper'][_0xd62a('0x29')]({'where':_0x115c51['options']?_0x115c51['options'][_0xd62a('0x18')]||null:null})['then'](function(_0x64f446){logger['info'](_0xd62a('0x28'),_0x115c51);logger[_0xd62a('0xf')]('DestroyCmHopper',_0x115c51,JSON[_0xd62a('0x11')](_0x64f446));_0x3ad4d6(_0x64f446);})[_0xd62a('0x1e')](function(_0x5b7fbb){logger['error']('DestroyCmHopper',_0x5b7fbb[_0xd62a('0x13')],_0x115c51);_0x2eab65(_0x48351a[_0xd62a('0x12')](0x1f4,_0x5b7fbb['message']));});});};exports[_0xd62a('0x2a')]=function(_0x4f04e0){var _0x1c9168=this;return new Promise(function(_0x4dd972,_0x9382c4){return db[_0xd62a('0x2b')][_0xd62a('0x2c')]()[_0xd62a('0x1d')](function(_0x4acb25){return db[_0xd62a('0x2d')][_0xd62a('0x2e')](function(_0x3b6ee0){return db['CmHopper'][_0xd62a('0x16')]({'where':_0x4f04e0['options']?_0x4f04e0['options'][_0xd62a('0x18')]||null:null,'attributes':_0x4f04e0['options']?_0x4f04e0[_0xd62a('0x17')][_0xd62a('0x1c')]||null:null,'limit':_0x4f04e0[_0xd62a('0x17')]?_0x4f04e0[_0xd62a('0x17')]['limit']||null:null,'order':_0x4f04e0[_0xd62a('0x17')]?_0x4f04e0[_0xd62a('0x17')][_0xd62a('0x2f')]||null:null,'transaction':_0x3b6ee0,'lock':_0x3b6ee0[_0xd62a('0x30')][_0xd62a('0x31')],'include':[{'model':db[_0xd62a('0x2b')],'as':_0xd62a('0x32'),'attributes':_['keys'](_0x4acb25)},{'model':db[_0xd62a('0x33')],'as':'Agent','attributes':['id','name',_0xd62a('0x34')]}]})[_0xd62a('0x1d')](function(_0x4c7a6e){var _0x566ab5=[];var _0x2d6dac=[];for(var _0x4d41f3=0x0;_0x4d41f3<_0x4c7a6e[_0xd62a('0x35')];_0x4d41f3+=0x1){var _0x1a6aa2=_0x4c7a6e[_0x4d41f3]['UserId'];if(_0x1a6aa2===null){_0x566ab5[_0xd62a('0x36')](_0x4c7a6e[_0x4d41f3][_0xd62a('0x25')](_0x4f04e0[_0xd62a('0x23')],{'transaction':_0x3b6ee0}));}else if(!_0x2d6dac[_0xd62a('0x37')](_0x1a6aa2)){_0x2d6dac[_0xd62a('0x36')](_0x1a6aa2);_0x566ab5['push'](_0x4c7a6e[_0x4d41f3][_0xd62a('0x25')](_0x4f04e0[_0xd62a('0x23')],{'transaction':_0x3b6ee0}));}}return BPromise['all'](_0x566ab5);});})[_0xd62a('0x1d')](function(_0x1424b4){logger[_0xd62a('0xc')](_0xd62a('0x2a'),_0x4f04e0);if(_0x1424b4[_0xd62a('0x35')]>0x0){logger[_0xd62a('0xc')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x1424b4[0x0]['dataValues']['id'],_0x1424b4[0x0]['dataValues'][_0xd62a('0x38')],_0x1424b4[0x0][_0xd62a('0x39')]['active']);}logger[_0xd62a('0xf')]('GetContactDialer',_0x4f04e0,JSON['stringify'](_0x1424b4));_0x4dd972(_0x1424b4);})['catch'](function(_0x32fc05){logger[_0xd62a('0x12')](_0xd62a('0x2a'),_0x32fc05[_0xd62a('0x13')],_0x4f04e0);_0x9382c4(_0x1c9168['error'](0x1f4,_0x32fc05['message']));});});});};exports[_0xd62a('0x3a')]=function(_0x501929){var _0x297824=this;return new Promise(function(_0x2f7677,_0x17a495){return db[_0xd62a('0x2d')][_0xd62a('0x2e')](function(_0x1711fe){return db['CmHopperFinal']['create'](_0x501929[_0xd62a('0x23')],{'raw':_0x501929[_0xd62a('0x17')]?_0x501929[_0xd62a('0x17')][_0xd62a('0x1f')]===undefined?!![]:![]:!![],'transaction':_0x1711fe})[_0xd62a('0x1d')](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xd62a('0x11')](_0x501929[_0xd62a('0x17')][_0xd62a('0x18')]),_0x501929[_0xd62a('0x17')][_0xd62a('0x18')][_0xd62a('0x27')]);return db['CmHopper'][_0xd62a('0x29')]({'where':_0x501929['options']?_0x501929[_0xd62a('0x17')][_0xd62a('0x18')]||null:null,'transaction':_0x1711fe});});})['then'](function(_0x50c585){logger[_0xd62a('0xc')](_0xd62a('0x3a'),_0x501929);logger[_0xd62a('0xf')]('MoveContactManagedDialer',_0x501929,JSON['stringify'](_0x50c585));_0x2f7677(_0x50c585);})['catch'](function(_0x5a704a){logger[_0xd62a('0x12')](_0xd62a('0x3a'),_0x5a704a[_0xd62a('0x13')],_0x501929);_0x17a495(_0x297824[_0xd62a('0x12')](0x1f4,_0x5a704a[_0xd62a('0x13')]));});});};exports['CountReScheduled']=function(_0x22bc42){var _0x14cb8b=this;return new Promise(function(_0x4951f3,_0x9058e0){return db[_0xd62a('0x15')][_0xd62a('0x16')]({'raw':_0x22bc42[_0xd62a('0x17')]?_0x22bc42[_0xd62a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x22bc42[_0xd62a('0x17')]?_0x22bc42[_0xd62a('0x17')]['where']||null:null,'attributes':[[db[_0xd62a('0x2d')]['fn'](_0xd62a('0x3b'),db[_0xd62a('0x2d')]['fn']('IF',db['sequelize'][_0xd62a('0x3c')](_0xd62a('0x3d')+util[_0xd62a('0x3e')]('\x22%s\x22',moment()[_0xd62a('0x3e')](_0xd62a('0x3f')))+_0xd62a('0x40')))),_0xd62a('0x41')]]})[_0xd62a('0x1d')](function(_0x1aeedc){logger[_0xd62a('0xc')](_0xd62a('0x42'),_0x22bc42);logger['debug'](_0xd62a('0x42'),_0x22bc42,JSON[_0xd62a('0x11')](_0x1aeedc));_0x4951f3(_0x1aeedc);})[_0xd62a('0x1e')](function(_0xf391cb){logger[_0xd62a('0x12')]('CountReScheduled',_0xf391cb['message'],_0x22bc42);_0x9058e0(_0x14cb8b[_0xd62a('0x12')](0x1f4,_0xf391cb[_0xd62a('0x13')]));});});};exports['GetContactRecallMe']=function(_0x18c232){var _0x346ec1=this;return new Promise(function(_0x5750f3,_0x35a9ca){return db['CmContact'][_0xd62a('0x2c')]()[_0xd62a('0x1d')](function(_0x18f82f){return db[_0xd62a('0x2d')][_0xd62a('0x2e')](function(_0x107ff4){return db[_0xd62a('0x15')][_0xd62a('0x16')]({'where':_0x18c232[_0xd62a('0x17')]?_0x18c232[_0xd62a('0x17')][_0xd62a('0x18')]||null:null,'attributes':_0x18c232[_0xd62a('0x17')]?_0x18c232['options'][_0xd62a('0x1c')]||null:null,'limit':0x1,'order':_0x18c232[_0xd62a('0x17')]?_0x18c232[_0xd62a('0x17')][_0xd62a('0x2f')]||null:null,'group':db[_0xd62a('0x15')][_0xd62a('0x43')],'transaction':_0x107ff4,'lock':_0x107ff4['LOCK'][_0xd62a('0x31')],'include':_0x18c232[_0xd62a('0x17')]?_0x18c232[_0xd62a('0x17')][_0xd62a('0x19')]?_['map'](_0x18c232[_0xd62a('0x17')][_0xd62a('0x19')],function(_0x170c63){return{'model':db[_0x170c63[_0xd62a('0x1b')]],'as':_0x170c63['as'],'attributes':_0x170c63[_0xd62a('0x1c')],'include':_0x170c63[_0xd62a('0x19')]?_[_0xd62a('0x1a')](_0x170c63[_0xd62a('0x19')],function(_0x4591dc){return{'model':db[_0x4591dc[_0xd62a('0x1b')]],'as':_0x4591dc['as'],'attributes':_0x4591dc[_0xd62a('0x1c')],'include':_0x4591dc[_0xd62a('0x19')]?_[_0xd62a('0x1a')](_0x4591dc[_0xd62a('0x19')],function(_0x1f23a2){return{'model':db[_0x1f23a2[_0xd62a('0x1b')]],'as':_0x1f23a2['as'],'attributes':_0x1f23a2[_0xd62a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd62a('0x1d')](function(_0x3c40f7){var _0x2bb9ef=[];for(var _0x190c6f=0x0;_0x190c6f<_0x3c40f7['length'];_0x190c6f+=0x1){_0x2bb9ef['push'](_0x3c40f7[_0x190c6f]['update'](_0x18c232[_0xd62a('0x23')],{'transaction':_0x107ff4}));}return BPromise[_0xd62a('0x44')](_0x2bb9ef);});})[_0xd62a('0x1d')](function(_0x1f4cdd){logger[_0xd62a('0xc')]('GetContactRecallMe',_0x18c232);logger[_0xd62a('0xf')](_0xd62a('0x45'),_0x18c232,JSON['stringify'](_0x1f4cdd));_0x5750f3(_0x1f4cdd);})[_0xd62a('0x1e')](function(_0x392d30){logger[_0xd62a('0x12')](_0xd62a('0x45'),_0x392d30[_0xd62a('0x13')],_0x18c232);_0x35a9ca(_0x346ec1[_0xd62a('0x12')](0x1f4,_0x392d30[_0xd62a('0x13')]));});});});};exports[_0xd62a('0x46')]=function(_0xe3a9c2){var _0x2f6784=this;return new Promise(function(_0x539f00,_0x2a3cc4){db[_0xd62a('0x2b')][_0xd62a('0x2c')]()[_0xd62a('0x1d')](function(_0x13f9fa){return db[_0xd62a('0x15')][_0xd62a('0x16')]({'raw':_0xe3a9c2[_0xd62a('0x17')]?_0xe3a9c2[_0xd62a('0x17')][_0xd62a('0x1f')]===undefined?!![]:![]:!![],'where':_0xe3a9c2['options']?_0xe3a9c2[_0xd62a('0x17')][_0xd62a('0x18')]||null:null,'attributes':_0xe3a9c2['options']?_0xe3a9c2[_0xd62a('0x17')][_0xd62a('0x1c')]||null:null,'limit':_0xe3a9c2[_0xd62a('0x17')]?_0xe3a9c2[_0xd62a('0x17')][_0xd62a('0x47')]||null:null,'include':_0xe3a9c2[_0xd62a('0x17')]?_0xe3a9c2['options'][_0xd62a('0x19')]?_[_0xd62a('0x1a')](_0xe3a9c2[_0xd62a('0x17')][_0xd62a('0x19')],function(_0x3dd216){return{'model':db[_0x3dd216[_0xd62a('0x1b')]],'as':_0x3dd216['as'],'attributes':_0x3dd216['as']===_0xd62a('0x32')?_[_0xd62a('0x48')](_0x13f9fa):_0x3dd216[_0xd62a('0x1c')],'include':_0x3dd216['include']?_[_0xd62a('0x1a')](_0x3dd216['include'],function(_0x14ca4e){return{'model':db[_0x14ca4e[_0xd62a('0x1b')]],'as':_0x14ca4e['as'],'attributes':_0x14ca4e[_0xd62a('0x1c')],'include':_0x14ca4e[_0xd62a('0x19')]?_[_0xd62a('0x1a')](_0x14ca4e[_0xd62a('0x19')],function(_0x9641fe){return{'model':db[_0x9641fe[_0xd62a('0x1b')]],'as':_0x9641fe['as'],'attributes':_0x9641fe[_0xd62a('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bf43d){logger['info'](_0xd62a('0x14'),_0xe3a9c2);logger[_0xd62a('0xf')]('GetCmHopper',_0xe3a9c2,JSON[_0xd62a('0x11')](_0x5bf43d));_0x539f00(_0x5bf43d);})[_0xd62a('0x1e')](function(_0x329fd8){logger[_0xd62a('0x12')](_0xd62a('0x14'),_0x329fd8['message'],_0xe3a9c2);_0x2a3cc4(_0x2f6784[_0xd62a('0x12')](0x1f4,_0x329fd8[_0xd62a('0x13')]));});});});};exports['GetContactByPhone']=function(_0x59056f){var _0x48e8fc=this;return new Promise(function(_0x10c2ca,_0x178fe5){return db[_0xd62a('0x2b')][_0xd62a('0x49')]({'raw':!![],'where':{'phone':_0x59056f['options'][_0xd62a('0x18')][_0xd62a('0x4a')]},'attributes':['id',_0xd62a('0x4b')],'order':[['id',_0xd62a('0x4c')]]})[_0xd62a('0x1d')](function(_0x37e587){logger[_0xd62a('0xc')](_0xd62a('0x4d'),_0x59056f);logger[_0xd62a('0xf')](_0xd62a('0x4d'),_0x59056f,JSON['stringify'](_0x37e587));_0x10c2ca(_0x37e587);})['catch'](function(_0x4d2ecd){logger[_0xd62a('0x12')](_0xd62a('0x4d'),_0x4d2ecd[_0xd62a('0x13')],_0x59056f);_0x178fe5(_0x48e8fc[_0xd62a('0x12')](0x1f4,_0x4d2ecd[_0xd62a('0x13')]));});});};exports[_0xd62a('0x4e')]=function(_0x33d65a){var _0x505b8c=this;return new Promise(function(_0x53066b,_0x10a27b){return db[_0xd62a('0x2d')][_0xd62a('0x2e')](function(_0x49a162){return db[_0xd62a('0x15')][_0xd62a('0x25')]({'active':![]},{'where':{},'transaction':_0x49a162})[_0xd62a('0x1d')](function(_0x10a16e){logger[_0xd62a('0xc')](_0xd62a('0x4e'),_0x33d65a);logger[_0xd62a('0xf')](_0xd62a('0x4e'),_0x33d65a,JSON[_0xd62a('0x11')](_0x10a16e));_0x53066b(_0x10a16e);})[_0xd62a('0x1e')](function(_0x4bf489){logger['error'](_0xd62a('0x4e'),_0x4bf489['message'],_0x33d65a);_0x10a27b(_0x505b8c[_0xd62a('0x12')](0x1f4,_0x4bf489['message']));});});});};exports[_0xd62a('0x4f')]=function(_0x34fc23){var _0x420649=this;var _0x4bc806=_0x34fc23['body'][_0xd62a('0x18')][_0xd62a('0x50')];var _0x1ce30e=_0x34fc23[_0xd62a('0x23')]['where'][_0xd62a('0x51')];return new Promise(function(_0x4746d9,_0x315792){return db[_0xd62a('0x15')][_0xd62a('0x16')]({'where':{'voiceQueueId':_0x4bc806,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0xd62a('0x2d')][_0xd62a('0x3c')](_0xd62a('0x52')+_0x1ce30e+'\x20MINUTE')}},'include':[{'model':db[_0xd62a('0x2b')],'as':_0xd62a('0x32')},{'model':db[_0xd62a('0x33')],'as':'Agent','attributes':['id','name',_0xd62a('0x34')]},{'model':db[_0xd62a('0x53')],'as':_0xd62a('0x54')}]})[_0xd62a('0x1d')](function(_0x5c9905){return db[_0xd62a('0x2d')][_0xd62a('0x2e')](function(_0x451b13){return db['CmHopper'][_0xd62a('0x25')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x4bc806,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0xd62a('0x2d')][_0xd62a('0x3c')](_0xd62a('0x52')+_0x1ce30e+'\x20MINUTE')}},'transaction':_0x451b13})[_0xd62a('0x1d')](function(_0x1ee2a3){_0x4746d9(_0x5c9905);})[_0xd62a('0x1e')](function(_0x4c2931){logger[_0xd62a('0x12')](_0xd62a('0x4f'),_0x4c2931[_0xd62a('0x13')],_0x34fc23);_0x315792(validateExpressRequest);});});})[_0xd62a('0x1e')](function(_0x3f82e5){logger[_0xd62a('0x12')](_0xd62a('0x4f'),_0x3f82e5['message'],_0x34fc23);_0x315792(_0x420649[_0xd62a('0x12')](0x1f4,_0x3f82e5['message']));});});}; \ No newline at end of file +var _0x094a=['format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','length','GetCmHopperPreview','GetContactByPhone','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','NOW()\x20+\x20INTERVAL\x20','name','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','client','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','limit','model','map','include','attributes','then','ShowCmHopper','find','where','create','body','CreateCmHopper','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','order','LOCK','UPDATE','Contact','keys','User','voicePause','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','sequelize','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','literal'];(function(_0x5bd303,_0x387d15){var _0xe3b303=function(_0x3cd6f8){while(--_0x3cd6f8){_0x5bd303['push'](_0x5bd303['shift']());}};_0xe3b303(++_0x387d15);}(_0x094a,0x11b));var _0xa094=function(_0xa7f495,_0x1bcfb5){_0xa7f495=_0xa7f495-0x0;var _0x10bd4a=_0x094a[_0xa7f495];return _0x10bd4a;};'use strict';var _=require(_0xa094('0x0'));var util=require(_0xa094('0x1'));var moment=require(_0xa094('0x2'));var BPromise=require('bluebird');var rs=require(_0xa094('0x3'));var fs=require('fs');var Redis=require(_0xa094('0x4'));var db=require(_0xa094('0x5'))['db'];var utils=require(_0xa094('0x6'));var logger=require(_0xa094('0x7'))(_0xa094('0x8'));var config=require(_0xa094('0x9'));var jayson=require(_0xa094('0xa'));const {validateExpressRequest}=require(_0xa094('0xb'));var client=jayson[_0xa094('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdda1c1,_0x518220,_0x29a16d){return new BPromise(function(_0x27dc8e,_0x5c9017){return client['request'](_0xdda1c1,_0x29a16d)['then'](function(_0x236804){logger[_0xa094('0xd')](_0xa094('0xe'),_0x518220,_0xa094('0xf'));logger[_0xa094('0x10')](_0xa094('0x11'),_0x518220,_0xa094('0xf'),JSON[_0xa094('0x12')](_0x236804));if(_0x236804[_0xa094('0x13')]){if(_0x236804[_0xa094('0x13')]['code']===0x1f4){logger[_0xa094('0x13')](_0xa094('0xe'),_0x518220,_0x236804['error']['message']);return _0x5c9017(_0x236804['error'][_0xa094('0x14')]);}logger['error'](_0xa094('0xe'),_0x518220,_0x236804[_0xa094('0x13')][_0xa094('0x14')]);return _0x27dc8e(_0x236804[_0xa094('0x13')][_0xa094('0x14')]);}else{logger[_0xa094('0xd')](_0xa094('0xe'),_0x518220,_0xa094('0xf'));_0x27dc8e(_0x236804[_0xa094('0x15')]['message']);}})[_0xa094('0x16')](function(_0x30d403){logger[_0xa094('0x13')]('CmHopper,\x20%s,\x20%s',_0x518220,_0x30d403);_0x5c9017(_0x30d403);});});}exports[_0xa094('0x17')]=function(_0x47efd7){var _0x1cf87e=this;return new Promise(function(_0x34b3c9,_0x4a605f){return db[_0xa094('0x18')][_0xa094('0x19')]({'raw':_0x47efd7[_0xa094('0x1a')]?_0x47efd7['options'][_0xa094('0x1b')]===undefined?!![]:![]:!![],'where':_0x47efd7[_0xa094('0x1a')]?_0x47efd7[_0xa094('0x1a')]['where']||null:null,'attributes':_0x47efd7['options']?_0x47efd7[_0xa094('0x1a')]['attributes']||null:null,'limit':_0x47efd7['options']?_0x47efd7[_0xa094('0x1a')][_0xa094('0x1c')]||null:null,'include':_0x47efd7[_0xa094('0x1a')]?_0x47efd7[_0xa094('0x1a')]['include']?_['map'](_0x47efd7[_0xa094('0x1a')]['include'],function(_0x465f4c){return{'model':db[_0x465f4c[_0xa094('0x1d')]],'as':_0x465f4c['as'],'attributes':_0x465f4c['attributes'],'include':_0x465f4c['include']?_[_0xa094('0x1e')](_0x465f4c[_0xa094('0x1f')],function(_0x20cd5f){return{'model':db[_0x20cd5f[_0xa094('0x1d')]],'as':_0x20cd5f['as'],'attributes':_0x20cd5f[_0xa094('0x20')],'include':_0x20cd5f['include']?_['map'](_0x20cd5f[_0xa094('0x1f')],function(_0x2af25c){return{'model':db[_0x2af25c['model']],'as':_0x2af25c['as'],'attributes':_0x2af25c['attributes']};}):[]};}):[]};}):[]:[]})[_0xa094('0x21')](function(_0x6d8126){logger['info'](_0xa094('0x17'),_0x47efd7);logger[_0xa094('0x10')](_0xa094('0x17'),_0x47efd7,JSON[_0xa094('0x12')](_0x6d8126));_0x34b3c9(_0x6d8126);})['catch'](function(_0x49816c){logger[_0xa094('0x13')](_0xa094('0x17'),_0x49816c[_0xa094('0x14')],_0x47efd7);_0x4a605f(_0x1cf87e['error'](0x1f4,_0x49816c[_0xa094('0x14')]));});});};exports[_0xa094('0x22')]=function(_0xe7f53f){var _0x24eee6=this;return new Promise(function(_0x1c0753,_0x1e5f1e){return db['CmHopper'][_0xa094('0x23')]({'raw':_0xe7f53f[_0xa094('0x1a')]?_0xe7f53f[_0xa094('0x1a')][_0xa094('0x1b')]===undefined?!![]:![]:!![],'where':_0xe7f53f[_0xa094('0x1a')]?_0xe7f53f[_0xa094('0x1a')][_0xa094('0x24')]||null:null,'attributes':_0xe7f53f[_0xa094('0x1a')]?_0xe7f53f[_0xa094('0x1a')][_0xa094('0x20')]||null:null,'include':_0xe7f53f[_0xa094('0x1a')]?_0xe7f53f['options'][_0xa094('0x1f')]?_[_0xa094('0x1e')](_0xe7f53f[_0xa094('0x1a')]['include'],function(_0x17f690){return{'model':db[_0x17f690[_0xa094('0x1d')]],'as':_0x17f690['as'],'attributes':_0x17f690[_0xa094('0x20')],'include':_0x17f690['include']?_[_0xa094('0x1e')](_0x17f690['include'],function(_0x1dbdd3){return{'model':db[_0x1dbdd3['model']],'as':_0x1dbdd3['as'],'attributes':_0x1dbdd3[_0xa094('0x20')],'include':_0x1dbdd3[_0xa094('0x1f')]?_[_0xa094('0x1e')](_0x1dbdd3[_0xa094('0x1f')],function(_0x4305cc){return{'model':db[_0x4305cc[_0xa094('0x1d')]],'as':_0x4305cc['as'],'attributes':_0x4305cc[_0xa094('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa094('0x21')](function(_0x35c668){logger[_0xa094('0xd')](_0xa094('0x22'),_0xe7f53f);logger[_0xa094('0x10')]('ShowCmHopper',_0xe7f53f,JSON['stringify'](_0x35c668));_0x1c0753(_0x35c668);})[_0xa094('0x16')](function(_0x42273c){logger[_0xa094('0x13')](_0xa094('0x22'),_0x42273c['message'],_0xe7f53f);_0x1e5f1e(_0x24eee6[_0xa094('0x13')](0x1f4,_0x42273c[_0xa094('0x14')]));});});};exports['CreateCmHopper']=function(_0x3354e2){var _0x179f04=this;return new Promise(function(_0x10724e,_0x41672d){return db[_0xa094('0x18')][_0xa094('0x25')](_0x3354e2[_0xa094('0x26')],{'raw':_0x3354e2['options']?_0x3354e2[_0xa094('0x1a')][_0xa094('0x1b')]===undefined?!![]:![]:!![]})[_0xa094('0x21')](function(_0x4dd615){logger[_0xa094('0xd')]('CreateCmHopper',_0x3354e2);logger[_0xa094('0x10')](_0xa094('0x27'),_0x3354e2,JSON[_0xa094('0x12')](_0x4dd615));_0x10724e(_0x4dd615);})[_0xa094('0x16')](function(_0x2d83a7){logger[_0xa094('0x13')](_0xa094('0x27'),_0x2d83a7[_0xa094('0x14')],_0x3354e2);_0x41672d(_0x179f04[_0xa094('0x13')](0x1f4,_0x2d83a7['message']));});});};exports[_0xa094('0x28')]=function(_0x231547){var _0x4c4d60=this;return new Promise(function(_0x58fee3,_0x28c3c9){return db['CmHopper'][_0xa094('0x29')](_0x231547[_0xa094('0x26')],{'raw':_0x231547[_0xa094('0x1a')]?_0x231547['options'][_0xa094('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x231547[_0xa094('0x1a')]?_0x231547[_0xa094('0x1a')]['where']||null:null,'attributes':_0x231547['options']?_0x231547['options'][_0xa094('0x20')]||null:null,'limit':_0x231547[_0xa094('0x1a')]?_0x231547[_0xa094('0x1a')][_0xa094('0x1c')]||null:null})[_0xa094('0x21')](function(_0x488cef){logger[_0xa094('0xd')](_0xa094('0x28'),_0x231547);logger['info'](_0xa094('0x2a'),JSON['stringify'](_0x231547[_0xa094('0x1a')][_0xa094('0x24')]),_0x231547['body']['active']);logger[_0xa094('0x10')](_0xa094('0x28'),_0x231547,JSON[_0xa094('0x12')](_0x488cef));_0x58fee3(_0x488cef);})[_0xa094('0x16')](function(_0x28c749){logger[_0xa094('0x13')](_0xa094('0x28'),_0x28c749[_0xa094('0x14')],_0x231547);_0x28c3c9(_0x4c4d60['error'](0x1f4,_0x28c749['message']));});});};exports[_0xa094('0x2b')]=function(_0x4d95aa){var _0x1fd38e=this;return new Promise(function(_0x523058,_0x157b9f){return db[_0xa094('0x18')][_0xa094('0x2c')]({'where':_0x4d95aa['options']?_0x4d95aa[_0xa094('0x1a')][_0xa094('0x24')]||null:null})[_0xa094('0x21')](function(_0x4f1b97){logger[_0xa094('0xd')](_0xa094('0x2b'),_0x4d95aa);logger['debug'](_0xa094('0x2b'),_0x4d95aa,JSON['stringify'](_0x4f1b97));_0x523058(_0x4f1b97);})[_0xa094('0x16')](function(_0x9ee83b){logger[_0xa094('0x13')](_0xa094('0x2b'),_0x9ee83b['message'],_0x4d95aa);_0x157b9f(_0x1fd38e['error'](0x1f4,_0x9ee83b[_0xa094('0x14')]));});});};exports[_0xa094('0x2d')]=function(_0x5c1b0e){var _0xfe835d=this;return new Promise(function(_0x3f31b3,_0x5565d0){return db[_0xa094('0x2e')][_0xa094('0x2f')]()[_0xa094('0x21')](function(_0x241cf4){return db['sequelize'][_0xa094('0x30')](function(_0x3c5b04){return db[_0xa094('0x18')][_0xa094('0x19')]({'where':_0x5c1b0e[_0xa094('0x1a')]?_0x5c1b0e[_0xa094('0x1a')][_0xa094('0x24')]||null:null,'attributes':_0x5c1b0e[_0xa094('0x1a')]?_0x5c1b0e['options'][_0xa094('0x20')]||null:null,'limit':_0x5c1b0e['options']?_0x5c1b0e[_0xa094('0x1a')][_0xa094('0x1c')]||null:null,'order':_0x5c1b0e[_0xa094('0x1a')]?_0x5c1b0e[_0xa094('0x1a')][_0xa094('0x31')]||null:null,'transaction':_0x3c5b04,'lock':_0x3c5b04[_0xa094('0x32')][_0xa094('0x33')],'include':[{'model':db[_0xa094('0x2e')],'as':_0xa094('0x34'),'attributes':_[_0xa094('0x35')](_0x241cf4)},{'model':db[_0xa094('0x36')],'as':'Agent','attributes':['id','name',_0xa094('0x37')]}]})[_0xa094('0x21')](function(_0x25024d){var _0x5d1667=[];var _0x1fadb0=[];for(var _0x18cf69=0x0;_0x18cf69<_0x25024d['length'];_0x18cf69+=0x1){var _0x77c11d=_0x25024d[_0x18cf69][_0xa094('0x38')];if(_0x77c11d===null){_0x5d1667[_0xa094('0x39')](_0x25024d[_0x18cf69][_0xa094('0x29')](_0x5c1b0e[_0xa094('0x26')],{'transaction':_0x3c5b04}));}else if(!_0x1fadb0[_0xa094('0x3a')](_0x77c11d)){_0x1fadb0['push'](_0x77c11d);_0x5d1667['push'](_0x25024d[_0x18cf69][_0xa094('0x29')](_0x5c1b0e[_0xa094('0x26')],{'transaction':_0x3c5b04}));}}return BPromise[_0xa094('0x3b')](_0x5d1667);});})[_0xa094('0x21')](function(_0x4a9321){logger['info'](_0xa094('0x2d'),_0x5c1b0e);if(_0x4a9321['length']>0x0){logger[_0xa094('0xd')](_0xa094('0x3c'),_0x4a9321[0x0][_0xa094('0x3d')]['id'],_0x4a9321[0x0]['dataValues'][_0xa094('0x3e')],_0x4a9321[0x0][_0xa094('0x3d')]['active']);}logger['debug'](_0xa094('0x2d'),_0x5c1b0e,JSON[_0xa094('0x12')](_0x4a9321));_0x3f31b3(_0x4a9321);})['catch'](function(_0x17cb13){logger[_0xa094('0x13')](_0xa094('0x2d'),_0x17cb13[_0xa094('0x14')],_0x5c1b0e);_0x5565d0(_0xfe835d[_0xa094('0x13')](0x1f4,_0x17cb13[_0xa094('0x14')]));});});});};exports['MoveContactManagedDialer']=function(_0x32f658){var _0x1a0de1=this;return new Promise(function(_0x37cd05,_0x5ac943){return db[_0xa094('0x3f')][_0xa094('0x30')](function(_0x3cd893){return db[_0xa094('0x40')][_0xa094('0x25')](_0x32f658[_0xa094('0x26')],{'raw':_0x32f658[_0xa094('0x1a')]?_0x32f658['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x3cd893})[_0xa094('0x21')](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xa094('0x12')](_0x32f658[_0xa094('0x1a')][_0xa094('0x24')]),_0x32f658[_0xa094('0x1a')][_0xa094('0x24')]['active']);return db['CmHopper'][_0xa094('0x2c')]({'where':_0x32f658[_0xa094('0x1a')]?_0x32f658[_0xa094('0x1a')][_0xa094('0x24')]||null:null,'transaction':_0x3cd893});});})[_0xa094('0x21')](function(_0x30ee6a){logger['info'](_0xa094('0x41'),_0x32f658);logger[_0xa094('0x10')]('MoveContactManagedDialer',_0x32f658,JSON[_0xa094('0x12')](_0x30ee6a));_0x37cd05(_0x30ee6a);})[_0xa094('0x16')](function(_0x537f08){logger[_0xa094('0x13')]('MoveContactManagedDialer',_0x537f08[_0xa094('0x14')],_0x32f658);_0x5ac943(_0x1a0de1[_0xa094('0x13')](0x1f4,_0x537f08[_0xa094('0x14')]));});});};exports[_0xa094('0x42')]=function(_0x4b5368){var _0x43b103=this;return new Promise(function(_0x15555c,_0x195aac){return db[_0xa094('0x18')][_0xa094('0x19')]({'raw':_0x4b5368[_0xa094('0x1a')]?_0x4b5368[_0xa094('0x1a')][_0xa094('0x1b')]===undefined?!![]:![]:!![],'where':_0x4b5368[_0xa094('0x1a')]?_0x4b5368[_0xa094('0x1a')][_0xa094('0x24')]||null:null,'attributes':[[db[_0xa094('0x3f')]['fn'](_0xa094('0x43'),db[_0xa094('0x3f')]['fn']('IF',db[_0xa094('0x3f')][_0xa094('0x44')]('`scheduledat`\x20>=\x20'+util[_0xa094('0x45')](_0xa094('0x46'),moment()[_0xa094('0x45')](_0xa094('0x47')))+_0xa094('0x48')))),_0xa094('0x49')]]})[_0xa094('0x21')](function(_0x59f085){logger[_0xa094('0xd')]('CountReScheduled',_0x4b5368);logger[_0xa094('0x10')]('CountReScheduled',_0x4b5368,JSON[_0xa094('0x12')](_0x59f085));_0x15555c(_0x59f085);})[_0xa094('0x16')](function(_0x205149){logger[_0xa094('0x13')](_0xa094('0x42'),_0x205149[_0xa094('0x14')],_0x4b5368);_0x195aac(_0x43b103[_0xa094('0x13')](0x1f4,_0x205149[_0xa094('0x14')]));});});};exports[_0xa094('0x4a')]=function(_0x4949c7){var _0x49d146=this;return new Promise(function(_0xfac67,_0x2d679b){return db[_0xa094('0x2e')]['describe']()[_0xa094('0x21')](function(_0x16defa){return db[_0xa094('0x3f')][_0xa094('0x30')](function(_0xfe7288){return db['CmHopper'][_0xa094('0x19')]({'where':_0x4949c7[_0xa094('0x1a')]?_0x4949c7[_0xa094('0x1a')][_0xa094('0x24')]||null:null,'attributes':_0x4949c7[_0xa094('0x1a')]?_0x4949c7['options'][_0xa094('0x20')]||null:null,'limit':0x1,'order':_0x4949c7[_0xa094('0x1a')]?_0x4949c7[_0xa094('0x1a')][_0xa094('0x31')]||null:null,'group':db[_0xa094('0x18')]['UserId'],'transaction':_0xfe7288,'lock':_0xfe7288[_0xa094('0x32')]['UPDATE'],'include':_0x4949c7[_0xa094('0x1a')]?_0x4949c7[_0xa094('0x1a')][_0xa094('0x1f')]?_[_0xa094('0x1e')](_0x4949c7['options']['include'],function(_0x34fba4){return{'model':db[_0x34fba4[_0xa094('0x1d')]],'as':_0x34fba4['as'],'attributes':_0x34fba4['attributes'],'include':_0x34fba4[_0xa094('0x1f')]?_[_0xa094('0x1e')](_0x34fba4[_0xa094('0x1f')],function(_0x4f6ae4){return{'model':db[_0x4f6ae4[_0xa094('0x1d')]],'as':_0x4f6ae4['as'],'attributes':_0x4f6ae4[_0xa094('0x20')],'include':_0x4f6ae4['include']?_[_0xa094('0x1e')](_0x4f6ae4[_0xa094('0x1f')],function(_0x61588d){return{'model':db[_0x61588d[_0xa094('0x1d')]],'as':_0x61588d['as'],'attributes':_0x61588d[_0xa094('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa094('0x21')](function(_0x336667){var _0x56e4b4=[];for(var _0x211a2=0x0;_0x211a2<_0x336667[_0xa094('0x4b')];_0x211a2+=0x1){_0x56e4b4[_0xa094('0x39')](_0x336667[_0x211a2]['update'](_0x4949c7[_0xa094('0x26')],{'transaction':_0xfe7288}));}return BPromise['all'](_0x56e4b4);});})['then'](function(_0x34dd8a){logger[_0xa094('0xd')]('GetContactRecallMe',_0x4949c7);logger[_0xa094('0x10')](_0xa094('0x4a'),_0x4949c7,JSON[_0xa094('0x12')](_0x34dd8a));_0xfac67(_0x34dd8a);})[_0xa094('0x16')](function(_0x59abe2){logger[_0xa094('0x13')](_0xa094('0x4a'),_0x59abe2[_0xa094('0x14')],_0x4949c7);_0x2d679b(_0x49d146['error'](0x1f4,_0x59abe2[_0xa094('0x14')]));});});});};exports[_0xa094('0x4c')]=function(_0x2c3d0b){var _0x60d255=this;return new Promise(function(_0x33521f,_0x5d6424){db['CmContact'][_0xa094('0x2f')]()[_0xa094('0x21')](function(_0x11e7da){return db['CmHopper'][_0xa094('0x19')]({'raw':_0x2c3d0b[_0xa094('0x1a')]?_0x2c3d0b['options']['raw']===undefined?!![]:![]:!![],'where':_0x2c3d0b['options']?_0x2c3d0b[_0xa094('0x1a')][_0xa094('0x24')]||null:null,'attributes':_0x2c3d0b[_0xa094('0x1a')]?_0x2c3d0b[_0xa094('0x1a')][_0xa094('0x20')]||null:null,'limit':_0x2c3d0b[_0xa094('0x1a')]?_0x2c3d0b[_0xa094('0x1a')][_0xa094('0x1c')]||null:null,'include':_0x2c3d0b['options']?_0x2c3d0b[_0xa094('0x1a')][_0xa094('0x1f')]?_[_0xa094('0x1e')](_0x2c3d0b[_0xa094('0x1a')][_0xa094('0x1f')],function(_0x582231){return{'model':db[_0x582231[_0xa094('0x1d')]],'as':_0x582231['as'],'attributes':_0x582231['as']==='Contact'?_[_0xa094('0x35')](_0x11e7da):_0x582231[_0xa094('0x20')],'include':_0x582231[_0xa094('0x1f')]?_['map'](_0x582231['include'],function(_0x49d23c){return{'model':db[_0x49d23c[_0xa094('0x1d')]],'as':_0x49d23c['as'],'attributes':_0x49d23c[_0xa094('0x20')],'include':_0x49d23c[_0xa094('0x1f')]?_[_0xa094('0x1e')](_0x49d23c['include'],function(_0x1257d1){return{'model':db[_0x1257d1[_0xa094('0x1d')]],'as':_0x1257d1['as'],'attributes':_0x1257d1[_0xa094('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa094('0x21')](function(_0x2fda7b){logger['info']('GetCmHopper',_0x2c3d0b);logger['debug'](_0xa094('0x17'),_0x2c3d0b,JSON['stringify'](_0x2fda7b));_0x33521f(_0x2fda7b);})['catch'](function(_0x5eee96){logger[_0xa094('0x13')](_0xa094('0x17'),_0x5eee96[_0xa094('0x14')],_0x2c3d0b);_0x5d6424(_0x60d255[_0xa094('0x13')](0x1f4,_0x5eee96[_0xa094('0x14')]));});});});};exports[_0xa094('0x4d')]=function(_0x2d07ed){var _0x5ccd43=this;return new Promise(function(_0x5cf204,_0x2cfdf6){return db['CmContact'][_0xa094('0x4e')]({'raw':!![],'where':{'phone':_0x2d07ed[_0xa094('0x1a')][_0xa094('0x24')][_0xa094('0x4f')]},'attributes':['id','dialTimezone'],'order':[['id',_0xa094('0x50')]]})[_0xa094('0x21')](function(_0xb93ae7){logger['info'](_0xa094('0x51'),_0x2d07ed);logger[_0xa094('0x10')](_0xa094('0x51'),_0x2d07ed,JSON[_0xa094('0x12')](_0xb93ae7));_0x5cf204(_0xb93ae7);})[_0xa094('0x16')](function(_0x51f311){logger['error'](_0xa094('0x51'),_0x51f311[_0xa094('0x14')],_0x2d07ed);_0x2cfdf6(_0x5ccd43[_0xa094('0x13')](0x1f4,_0x51f311['message']));});});};exports[_0xa094('0x52')]=function(_0x2d9b8e){var _0x14aa72=this;return new Promise(function(_0x23ddfb,_0x4db3c6){return db['sequelize']['transaction'](function(_0x7667c){return db[_0xa094('0x18')][_0xa094('0x29')]({'active':![]},{'where':{},'transaction':_0x7667c})[_0xa094('0x21')](function(_0x2ba169){logger['info']('ResetActiveCalls',_0x2d9b8e);logger[_0xa094('0x10')](_0xa094('0x52'),_0x2d9b8e,JSON[_0xa094('0x12')](_0x2ba169));_0x23ddfb(_0x2ba169);})['catch'](function(_0x1788ba){logger[_0xa094('0x13')](_0xa094('0x52'),_0x1788ba[_0xa094('0x14')],_0x2d9b8e);_0x4db3c6(_0x14aa72[_0xa094('0x13')](0x1f4,_0x1788ba[_0xa094('0x14')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x29d3e3){var _0x2992e4=this;var _0x5576e5=_0x29d3e3['body'][_0xa094('0x24')]['voiceQueueId'];var _0x5cffc9=_0x29d3e3[_0xa094('0x26')][_0xa094('0x24')]['interval'];return new Promise(function(_0x546e2b,_0x1da98f){return db['CmHopper'][_0xa094('0x19')]({'where':{'voiceQueueId':_0x5576e5,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0xa094('0x44')](_0xa094('0x53')+_0x5cffc9+'\x20MINUTE')}},'include':[{'model':db['CmContact'],'as':'Contact'},{'model':db[_0xa094('0x36')],'as':'Agent','attributes':['id',_0xa094('0x54'),_0xa094('0x37')]},{'model':db[_0xa094('0x55')],'as':_0xa094('0x56')}]})['then'](function(_0x5731bf){return db[_0xa094('0x3f')][_0xa094('0x30')](function(_0x4fcf24){return db['CmHopper'][_0xa094('0x29')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x5576e5,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0xa094('0x3f')]['literal'](_0xa094('0x53')+_0x5cffc9+'\x20MINUTE')}},'transaction':_0x4fcf24})[_0xa094('0x21')](function(_0x5df265){_0x546e2b(_0x5731bf);})[_0xa094('0x16')](function(_0x3ee6aa){logger[_0xa094('0x13')](_0xa094('0x57'),_0x3ee6aa[_0xa094('0x14')],_0x29d3e3);_0x1da98f(validateExpressRequest);});});})[_0xa094('0x16')](function(_0x472114){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x472114['message'],_0x29d3e3);_0x1da98f(_0x2992e4[_0xa094('0x13')](0x1f4,_0x472114[_0xa094('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 389c006..d96b188 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 _0x8274=['../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','show','post','/preview','getPreview','/timezone','getTimezone','/previewrecall','getPreviewRecall','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x311066,_0x4ff55f){var _0x882a86=function(_0x467923){while(--_0x467923){_0x311066['push'](_0x311066['shift']());}};_0x882a86(++_0x4ff55f);}(_0x8274,0x14f));var _0x4827=function(_0x4e91a8,_0x3242ca){_0x4e91a8=_0x4e91a8-0x0;var _0x340535=_0x8274[_0x4e91a8];return _0x340535;};'use strict';var multer=require(_0x4827('0x0'));var util=require(_0x4827('0x1'));var path=require(_0x4827('0x2'));var timeout=require(_0x4827('0x3'));var express=require(_0x4827('0x4'));var router=express['Router']();var fs_extra=require(_0x4827('0x5'));var auth=require(_0x4827('0x6'));var interaction=require(_0x4827('0x7'));var config=require('../../config/environment');var controller=require(_0x4827('0x8'));router[_0x4827('0x9')]('/',auth['isAuthenticated'](),controller[_0x4827('0xa')]);router[_0x4827('0x9')](_0x4827('0xb'),auth[_0x4827('0xc')](),controller[_0x4827('0xd')]);router[_0x4827('0x9')](_0x4827('0xe'),auth['isAuthenticated'](),controller[_0x4827('0xf')]);router[_0x4827('0x9')](_0x4827('0x10'),auth['isAuthenticated'](),controller[_0x4827('0x11')]);router['get']('/:id',auth[_0x4827('0xc')](),controller[_0x4827('0x12')]);router[_0x4827('0x13')]('/',auth[_0x4827('0xc')](),controller['create']);router[_0x4827('0x13')](_0x4827('0x14'),auth['isAuthenticated'](),controller[_0x4827('0x15')]);router['post'](_0x4827('0x16'),auth[_0x4827('0xc')](),controller[_0x4827('0x17')]);router[_0x4827('0x13')](_0x4827('0x18'),auth['isAuthenticated'](),controller[_0x4827('0x19')]);router['put'](_0x4827('0x1a'),auth[_0x4827('0xc')](),controller[_0x4827('0x1b')]);router[_0x4827('0x1c')]('/:id',auth[_0x4827('0xc')](),controller[_0x4827('0x1d')]);module[_0x4827('0x1e')]=router; \ No newline at end of file +var _0x2e56=['/describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','post','create','/preview','/timezone','/previewrecall','getPreviewRecall','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopper.controller','get','isAuthenticated'];(function(_0x4b5d77,_0x13f909){var _0x26e940=function(_0x17487b){while(--_0x17487b){_0x4b5d77['push'](_0x4b5d77['shift']());}};_0x26e940(++_0x13f909);}(_0x2e56,0xa2));var _0x62e5=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0x2e56[_0x5ac84c];return _0x3c53d2;};'use strict';var multer=require(_0x62e5('0x0'));var util=require(_0x62e5('0x1'));var path=require(_0x62e5('0x2'));var timeout=require(_0x62e5('0x3'));var express=require(_0x62e5('0x4'));var router=express[_0x62e5('0x5')]();var fs_extra=require(_0x62e5('0x6'));var auth=require(_0x62e5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x62e5('0x8'));var controller=require(_0x62e5('0x9'));router[_0x62e5('0xa')]('/',auth[_0x62e5('0xb')](),controller['index']);router[_0x62e5('0xa')](_0x62e5('0xc'),auth[_0x62e5('0xb')](),controller['describe']);router['get'](_0x62e5('0xd'),auth[_0x62e5('0xb')](),controller[_0x62e5('0xe')]);router[_0x62e5('0xa')](_0x62e5('0xf'),auth[_0x62e5('0xb')](),controller[_0x62e5('0x10')]);router['get'](_0x62e5('0x11'),auth[_0x62e5('0xb')](),controller[_0x62e5('0x12')]);router[_0x62e5('0x13')]('/',auth[_0x62e5('0xb')](),controller[_0x62e5('0x14')]);router[_0x62e5('0x13')](_0x62e5('0x15'),auth[_0x62e5('0xb')](),controller['getPreview']);router[_0x62e5('0x13')](_0x62e5('0x16'),auth[_0x62e5('0xb')](),controller['getTimezone']);router[_0x62e5('0x13')](_0x62e5('0x17'),auth[_0x62e5('0xb')](),controller[_0x62e5('0x18')]);router[_0x62e5('0x19')](_0x62e5('0x11'),auth[_0x62e5('0xb')](),controller[_0x62e5('0x1a')]);router['delete'](_0x62e5('0x11'),auth['isAuthenticated'](),controller[_0x62e5('0x1b')]);module[_0x62e5('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 81587d7..9a1a29f 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 _0x91f8=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x36d203,_0x3653f3){var _0x2f9e62=function(_0x461a77){while(--_0x461a77){_0x36d203['push'](_0x36d203['shift']());}};_0x2f9e62(++_0x3653f3);}(_0x91f8,0x13f));var _0x891f=function(_0x3c11e5,_0x72618c){_0x3c11e5=_0x3c11e5-0x0;var _0x163e43=_0x91f8[_0x3c11e5];return _0x163e43;};'use strict';var moment=require(_0x891f('0x0'));var Sequelize=require(_0x891f('0x1'));module[_0x891f('0x2')]={'phone':{'type':Sequelize[_0x891f('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x891f('0x4')],'unique':_0x891f('0x5')},'ListId':{'type':Sequelize[_0x891f('0x4')],'unique':_0x891f('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x891f('0x5')}}; \ No newline at end of file +var _0xf066=['sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf066,0x1a4));var _0x6f06=function(_0x16da8f,_0x4ddb80){_0x16da8f=_0x16da8f-0x0;var _0xd5dca8=_0xf066[_0x16da8f];return _0xd5dca8;};'use strict';var moment=require('moment');var Sequelize=require(_0x6f06('0x0'));module[_0x6f06('0x1')]={'phone':{'type':Sequelize[_0x6f06('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x6f06('0x3')],'unique':_0x6f06('0x4')},'ListId':{'type':Sequelize[_0x6f06('0x3')],'unique':_0x6f06('0x4')},'VoiceQueueId':{'type':Sequelize[_0x6f06('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 77f9f43..c5fdac5 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 _0x50c1=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','update','body','params','describe','eml-format','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','end','sendStatus','stack','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','nolimit'];(function(_0x53d9f4,_0x4b930c){var _0x48bb41=function(_0x22c3a6){while(--_0x22c3a6){_0x53d9f4['push'](_0x53d9f4['shift']());}};_0x48bb41(++_0x4b930c);}(_0x50c1,0x171));var _0x150c=function(_0xbfbdc,_0x80af71){_0xbfbdc=_0xbfbdc-0x0;var _0x4de1a0=_0x50c1[_0xbfbdc];return _0x4de1a0;};'use strict';var emlformat=require(_0x150c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x150c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x150c('0x2'));var moment=require('moment');var BPromise=require(_0x150c('0x3'));var Mustache=require('mustache');var util=require(_0x150c('0x4'));var path=require('path');var sox=require(_0x150c('0x5'));var csv=require('to-csv');var ejs=require(_0x150c('0x6'));var fs=require('fs');var fs_extra=require(_0x150c('0x7'));var _=require('lodash');var squel=require(_0x150c('0x8'));var crypto=require(_0x150c('0x9'));var jsforce=require(_0x150c('0xa'));var deskjs=require(_0x150c('0xb'));var toCsv=require(_0x150c('0xc'));var querystring=require('querystring');var Papa=require(_0x150c('0xd'));var Redis=require(_0x150c('0xe'));var authService=require(_0x150c('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x150c('0x10'));var logger=require(_0x150c('0x11'))(_0x150c('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x150c('0x13'))['db'];function respondWithStatusCode(_0x5d0626,_0x12a0a1){_0x12a0a1=_0x12a0a1||0xcc;return function(_0x96aec5){if(_0x96aec5){return _0x5d0626['sendStatus'](_0x12a0a1);}return _0x5d0626['status'](_0x12a0a1)['end']();};}function respondWithResult(_0x50ff5f,_0xab0bb6){_0xab0bb6=_0xab0bb6||0xc8;return function(_0x260465){if(_0x260465){return _0x50ff5f[_0x150c('0x14')](_0xab0bb6)[_0x150c('0x15')](_0x260465);}};}function respondWithFilteredResult(_0x143efc,_0x56bd65){return function(_0x41c4e1){if(_0x41c4e1){var _0x13d91e=typeof _0x56bd65[_0x150c('0x16')]===_0x150c('0x17')&&typeof _0x56bd65[_0x150c('0x18')]===_0x150c('0x17');var _0x507ef6=_0x41c4e1[_0x150c('0x19')];var _0xb30841=_0x13d91e?0x0:_0x56bd65[_0x150c('0x16')];var _0x3f4d3a=_0x13d91e?_0x41c4e1['count']:_0x56bd65['offset']+_0x56bd65[_0x150c('0x18')];var _0x3c863c;if(_0x3f4d3a>=_0x507ef6){_0x3f4d3a=_0x507ef6;_0x3c863c=0xc8;}else{_0x3c863c=0xce;}_0x143efc[_0x150c('0x14')](_0x3c863c);return _0x143efc[_0x150c('0x1a')](_0x150c('0x1b'),_0xb30841+'-'+_0x3f4d3a+'/'+_0x507ef6)[_0x150c('0x15')](_0x41c4e1);}return null;};}function patchUpdates(_0x38619c){return function(_0x1f05ed){try{jsonpatch[_0x150c('0x1c')](_0x1f05ed,_0x38619c,!![]);}catch(_0x32df61){return BPromise['reject'](_0x32df61);}return _0x1f05ed[_0x150c('0x1d')]();};}function saveUpdates(_0x4f6ddd,_0x8ce81d){return function(_0x4356b5){if(_0x4356b5){return _0x4356b5['update'](_0x4f6ddd)[_0x150c('0x1e')](function(_0x5f4dfb){return _0x5f4dfb;});}return null;};}function removeEntity(_0x238f09,_0x56ab6c){return function(_0x29b45b){if(_0x29b45b){return _0x29b45b[_0x150c('0x1f')]()[_0x150c('0x1e')](function(){_0x238f09['status'](0xcc)[_0x150c('0x20')]();});}};}function handleEntityNotFound(_0x1a05f1,_0x343342){return function(_0x38d8ed){if(!_0x38d8ed){_0x1a05f1[_0x150c('0x21')](0x194);}return _0x38d8ed;};}function handleError(_0xc7b315,_0x4c96f4){_0x4c96f4=_0x4c96f4||0x1f4;return function(_0x2d7d02){logger['error'](_0x2d7d02[_0x150c('0x22')]);if(_0x2d7d02['name']){delete _0x2d7d02[_0x150c('0x23')];}_0xc7b315[_0x150c('0x14')](_0x4c96f4)[_0x150c('0x24')](_0x2d7d02);};}exports['index']=function(_0x324557,_0x330328){var _0xc19595={},_0x565e31={},_0x686b7f={'count':0x0,'rows':[]};var _0x518fce=_[_0x150c('0x25')](db[_0x150c('0x26')][_0x150c('0x27')],function(_0x42605a){return{'name':_0x42605a[_0x150c('0x28')],'type':_0x42605a[_0x150c('0x29')]['key']};});_0x565e31[_0x150c('0x2a')]=_['map'](_0x518fce,_0x150c('0x23'));_0x565e31['query']=_[_0x150c('0x2b')](_0x324557['query']);_0x565e31[_0x150c('0x2c')]=_[_0x150c('0x2d')](_0x565e31[_0x150c('0x2a')],_0x565e31[_0x150c('0x2e')]);_0xc19595[_0x150c('0x2f')]=_[_0x150c('0x2d')](_0x565e31[_0x150c('0x2a')],qs[_0x150c('0x30')](_0x324557[_0x150c('0x2e')][_0x150c('0x30')]));_0xc19595[_0x150c('0x2f')]=_0xc19595['attributes'][_0x150c('0x31')]?_0xc19595[_0x150c('0x2f')]:_0x565e31[_0x150c('0x2a')];if(!_0x324557[_0x150c('0x2e')]['hasOwnProperty'](_0x150c('0x32'))){_0xc19595[_0x150c('0x18')]=qs[_0x150c('0x18')](_0x324557[_0x150c('0x2e')]['limit']);_0xc19595[_0x150c('0x16')]=qs['offset'](_0x324557[_0x150c('0x2e')][_0x150c('0x16')]);}_0xc19595[_0x150c('0x33')]=qs['sort'](_0x324557[_0x150c('0x2e')][_0x150c('0x34')]);_0xc19595[_0x150c('0x35')]=qs[_0x150c('0x2c')](_[_0x150c('0x36')](_0x324557[_0x150c('0x2e')],_0x565e31[_0x150c('0x2c')]),_0x518fce);if(_0x324557[_0x150c('0x2e')][_0x150c('0x37')]){_0xc19595[_0x150c('0x35')]=_[_0x150c('0x38')](_0xc19595[_0x150c('0x35')],{'$or':_[_0x150c('0x25')](_0x518fce,function(_0x2cad47){if(_0x2cad47[_0x150c('0x29')]!==_0x150c('0x39')){var _0x2b3d41={};_0x2b3d41[_0x2cad47[_0x150c('0x23')]]={'$like':'%'+_0x324557[_0x150c('0x2e')][_0x150c('0x37')]+'%'};return _0x2b3d41;}})});}_0xc19595=_[_0x150c('0x38')]({},_0xc19595,_0x324557[_0x150c('0x3a')]);var _0x1bff84={'where':_0xc19595['where']};return db[_0x150c('0x26')][_0x150c('0x19')](_0x1bff84)[_0x150c('0x1e')](function(_0x253d47){_0x686b7f['count']=_0x253d47;if(_0x324557['query'][_0x150c('0x3b')]){_0xc19595['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x150c('0x3c')](_0xc19595);})['then'](function(_0x1cd2d1){_0x686b7f[_0x150c('0x3d')]=_0x1cd2d1;return _0x686b7f;})[_0x150c('0x1e')](respondWithFilteredResult(_0x330328,_0xc19595))[_0x150c('0x3e')](handleError(_0x330328,null));};exports[_0x150c('0x3f')]=function(_0x271063,_0x415629){var _0x15876d={'raw':!![],'where':{'id':_0x271063['params']['id']}},_0x5a2039={};_0x5a2039[_0x150c('0x2a')]=_[_0x150c('0x2b')](db['CmHopperBlack'][_0x150c('0x27')]);_0x5a2039['query']=_[_0x150c('0x2b')](_0x271063[_0x150c('0x2e')]);_0x5a2039['filters']=_[_0x150c('0x2d')](_0x5a2039[_0x150c('0x2a')],_0x5a2039[_0x150c('0x2e')]);_0x15876d[_0x150c('0x2f')]=_['intersection'](_0x5a2039[_0x150c('0x2a')],qs['fields'](_0x271063[_0x150c('0x2e')][_0x150c('0x30')]));_0x15876d[_0x150c('0x2f')]=_0x15876d[_0x150c('0x2f')][_0x150c('0x31')]?_0x15876d[_0x150c('0x2f')]:_0x5a2039[_0x150c('0x2a')];if(_0x271063[_0x150c('0x2e')][_0x150c('0x3b')]){_0x15876d[_0x150c('0x40')]=[{'all':!![]}];}_0x15876d=_[_0x150c('0x38')]({},_0x15876d,_0x271063[_0x150c('0x3a')]);return db[_0x150c('0x26')][_0x150c('0x41')](_0x15876d)[_0x150c('0x1e')](handleEntityNotFound(_0x415629,null))[_0x150c('0x1e')](respondWithResult(_0x415629,null))['catch'](handleError(_0x415629,null));};exports[_0x150c('0x42')]=function(_0x32af8f,_0x1d1a8d){if(_0x32af8f[_0x150c('0x43')]['id']){delete _0x32af8f[_0x150c('0x43')]['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x32af8f[_0x150c('0x44')]['id']}})[_0x150c('0x1e')](handleEntityNotFound(_0x1d1a8d,null))[_0x150c('0x1e')](saveUpdates(_0x32af8f[_0x150c('0x43')],null))[_0x150c('0x1e')](respondWithResult(_0x1d1a8d,null))[_0x150c('0x3e')](handleError(_0x1d1a8d,null));};exports[_0x150c('0x1f')]=function(_0x34d3d8,_0x44d068){return db['CmHopperBlack'][_0x150c('0x41')]({'where':{'id':_0x34d3d8[_0x150c('0x44')]['id']}})['then'](handleEntityNotFound(_0x44d068,null))[_0x150c('0x1e')](removeEntity(_0x44d068,null))[_0x150c('0x3e')](handleError(_0x44d068,null));};exports[_0x150c('0x45')]=function(_0x39e91f,_0x5db8a5){return db[_0x150c('0x26')]['describe']()[_0x150c('0x1e')](respondWithResult(_0x5db8a5,null))[_0x150c('0x3e')](handleError(_0x5db8a5,null));}; \ No newline at end of file +var _0xd3a3=['zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','status','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','options','includeAll','include','findAll','rows','params','find','body','catch','destroy','describe','eml-format','rimraf'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0xd3a3,0x126));var _0x3d3a=function(_0x59e679,_0x161815){_0x59e679=_0x59e679-0x0;var _0x20ac91=_0xd3a3[_0x59e679];return _0x20ac91;};'use strict';var emlformat=require(_0x3d3a('0x0'));var rimraf=require(_0x3d3a('0x1'));var zipdir=require(_0x3d3a('0x2'));var jsonpatch=require(_0x3d3a('0x3'));var rp=require(_0x3d3a('0x4'));var moment=require('moment');var BPromise=require(_0x3d3a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3d3a('0x6'));var csv=require(_0x3d3a('0x7'));var ejs=require(_0x3d3a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d3a('0x9'));var squel=require(_0x3d3a('0xa'));var crypto=require(_0x3d3a('0xb'));var jsforce=require(_0x3d3a('0xc'));var deskjs=require(_0x3d3a('0xd'));var toCsv=require(_0x3d3a('0x7'));var querystring=require(_0x3d3a('0xe'));var Papa=require(_0x3d3a('0xf'));var Redis=require(_0x3d3a('0x10'));var authService=require(_0x3d3a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3d3a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d3a('0x13'))(_0x3d3a('0x14'));var utils=require(_0x3d3a('0x15'));var config=require(_0x3d3a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d3a('0x17'))['db'];function respondWithStatusCode(_0x1da2b6,_0x3c1a73){_0x3c1a73=_0x3c1a73||0xcc;return function(_0x3dc86a){if(_0x3dc86a){return _0x1da2b6[_0x3d3a('0x18')](_0x3c1a73);}return _0x1da2b6['status'](_0x3c1a73)[_0x3d3a('0x19')]();};}function respondWithResult(_0x25ec3f,_0x490c8a){_0x490c8a=_0x490c8a||0xc8;return function(_0x491f37){if(_0x491f37){return _0x25ec3f['status'](_0x490c8a)[_0x3d3a('0x1a')](_0x491f37);}};}function respondWithFilteredResult(_0x32a853,_0x22709f){return function(_0x2242ca){if(_0x2242ca){var _0x5772d0=typeof _0x22709f[_0x3d3a('0x1b')]==='undefined'&&typeof _0x22709f[_0x3d3a('0x1c')]===_0x3d3a('0x1d');var _0x2c712d=_0x2242ca[_0x3d3a('0x1e')];var _0x22b24b=_0x5772d0?0x0:_0x22709f[_0x3d3a('0x1b')];var _0x59e2b0=_0x5772d0?_0x2242ca['count']:_0x22709f[_0x3d3a('0x1b')]+_0x22709f[_0x3d3a('0x1c')];var _0x302bf1;if(_0x59e2b0>=_0x2c712d){_0x59e2b0=_0x2c712d;_0x302bf1=0xc8;}else{_0x302bf1=0xce;}_0x32a853['status'](_0x302bf1);return _0x32a853[_0x3d3a('0x1f')]('Content-Range',_0x22b24b+'-'+_0x59e2b0+'/'+_0x2c712d)[_0x3d3a('0x1a')](_0x2242ca);}return null;};}function patchUpdates(_0x181498){return function(_0x233e82){try{jsonpatch[_0x3d3a('0x20')](_0x233e82,_0x181498,!![]);}catch(_0x503c17){return BPromise[_0x3d3a('0x21')](_0x503c17);}return _0x233e82[_0x3d3a('0x22')]();};}function saveUpdates(_0x244f80,_0xe97232){return function(_0x2b7d0d){if(_0x2b7d0d){return _0x2b7d0d[_0x3d3a('0x23')](_0x244f80)['then'](function(_0x599f39){return _0x599f39;});}return null;};}function removeEntity(_0x5e6156,_0x24918c){return function(_0x4c1972){if(_0x4c1972){return _0x4c1972['destroy']()[_0x3d3a('0x24')](function(){_0x5e6156[_0x3d3a('0x25')](0xcc)[_0x3d3a('0x19')]();});}};}function handleEntityNotFound(_0x5c84ac,_0x1e6d9f){return function(_0x12409e){if(!_0x12409e){_0x5c84ac[_0x3d3a('0x18')](0x194);}return _0x12409e;};}function handleError(_0x4ef02,_0x42373f){_0x42373f=_0x42373f||0x1f4;return function(_0x8f2dd3){logger[_0x3d3a('0x26')](_0x8f2dd3[_0x3d3a('0x27')]);if(_0x8f2dd3[_0x3d3a('0x28')]){delete _0x8f2dd3[_0x3d3a('0x28')];}_0x4ef02[_0x3d3a('0x25')](_0x42373f)[_0x3d3a('0x29')](_0x8f2dd3);};}exports[_0x3d3a('0x2a')]=function(_0x15b276,_0x295cb3){var _0x632872={},_0x512eae={},_0x2fdceb={'count':0x0,'rows':[]};var _0x4c7cf9=_[_0x3d3a('0x2b')](db[_0x3d3a('0x2c')][_0x3d3a('0x2d')],function(_0x1cd801){return{'name':_0x1cd801[_0x3d3a('0x2e')],'type':_0x1cd801[_0x3d3a('0x2f')][_0x3d3a('0x30')]};});_0x512eae[_0x3d3a('0x31')]=_[_0x3d3a('0x2b')](_0x4c7cf9,_0x3d3a('0x28'));_0x512eae['query']=_[_0x3d3a('0x32')](_0x15b276[_0x3d3a('0x33')]);_0x512eae['filters']=_[_0x3d3a('0x34')](_0x512eae[_0x3d3a('0x31')],_0x512eae[_0x3d3a('0x33')]);_0x632872[_0x3d3a('0x35')]=_[_0x3d3a('0x34')](_0x512eae['model'],qs[_0x3d3a('0x36')](_0x15b276[_0x3d3a('0x33')]['fields']));_0x632872[_0x3d3a('0x35')]=_0x632872[_0x3d3a('0x35')][_0x3d3a('0x37')]?_0x632872[_0x3d3a('0x35')]:_0x512eae['model'];if(!_0x15b276[_0x3d3a('0x33')][_0x3d3a('0x38')]('nolimit')){_0x632872[_0x3d3a('0x1c')]=qs[_0x3d3a('0x1c')](_0x15b276['query'][_0x3d3a('0x1c')]);_0x632872['offset']=qs[_0x3d3a('0x1b')](_0x15b276[_0x3d3a('0x33')]['offset']);}_0x632872[_0x3d3a('0x39')]=qs[_0x3d3a('0x3a')](_0x15b276[_0x3d3a('0x33')][_0x3d3a('0x3a')]);_0x632872['where']=qs[_0x3d3a('0x3b')](_['pick'](_0x15b276['query'],_0x512eae[_0x3d3a('0x3b')]),_0x4c7cf9);if(_0x15b276['query'][_0x3d3a('0x3c')]){_0x632872[_0x3d3a('0x3d')]=_[_0x3d3a('0x3e')](_0x632872[_0x3d3a('0x3d')],{'$or':_['map'](_0x4c7cf9,function(_0x5ca793){if(_0x5ca793['type']!=='VIRTUAL'){var _0x173081={};_0x173081[_0x5ca793['name']]={'$like':'%'+_0x15b276[_0x3d3a('0x33')][_0x3d3a('0x3c')]+'%'};return _0x173081;}})});}_0x632872=_[_0x3d3a('0x3e')]({},_0x632872,_0x15b276[_0x3d3a('0x3f')]);var _0xddad2a={'where':_0x632872['where']};return db['CmHopperBlack'][_0x3d3a('0x1e')](_0xddad2a)[_0x3d3a('0x24')](function(_0x239186){_0x2fdceb[_0x3d3a('0x1e')]=_0x239186;if(_0x15b276[_0x3d3a('0x33')][_0x3d3a('0x40')]){_0x632872[_0x3d3a('0x41')]=[{'all':!![]}];}return db[_0x3d3a('0x2c')][_0x3d3a('0x42')](_0x632872);})['then'](function(_0x297126){_0x2fdceb[_0x3d3a('0x43')]=_0x297126;return _0x2fdceb;})['then'](respondWithFilteredResult(_0x295cb3,_0x632872))['catch'](handleError(_0x295cb3,null));};exports['show']=function(_0x118600,_0x1a5b8f){var _0x5720c2={'raw':!![],'where':{'id':_0x118600[_0x3d3a('0x44')]['id']}},_0x392b86={};_0x392b86[_0x3d3a('0x31')]=_[_0x3d3a('0x32')](db['CmHopperBlack'][_0x3d3a('0x2d')]);_0x392b86[_0x3d3a('0x33')]=_[_0x3d3a('0x32')](_0x118600[_0x3d3a('0x33')]);_0x392b86[_0x3d3a('0x3b')]=_['intersection'](_0x392b86[_0x3d3a('0x31')],_0x392b86['query']);_0x5720c2[_0x3d3a('0x35')]=_[_0x3d3a('0x34')](_0x392b86[_0x3d3a('0x31')],qs[_0x3d3a('0x36')](_0x118600[_0x3d3a('0x33')][_0x3d3a('0x36')]));_0x5720c2[_0x3d3a('0x35')]=_0x5720c2[_0x3d3a('0x35')][_0x3d3a('0x37')]?_0x5720c2['attributes']:_0x392b86['model'];if(_0x118600[_0x3d3a('0x33')]['includeAll']){_0x5720c2[_0x3d3a('0x41')]=[{'all':!![]}];}_0x5720c2=_[_0x3d3a('0x3e')]({},_0x5720c2,_0x118600[_0x3d3a('0x3f')]);return db['CmHopperBlack'][_0x3d3a('0x45')](_0x5720c2)[_0x3d3a('0x24')](handleEntityNotFound(_0x1a5b8f,null))[_0x3d3a('0x24')](respondWithResult(_0x1a5b8f,null))['catch'](handleError(_0x1a5b8f,null));};exports['update']=function(_0x596ea8,_0x2a2f8a){if(_0x596ea8[_0x3d3a('0x46')]['id']){delete _0x596ea8[_0x3d3a('0x46')]['id'];}return db[_0x3d3a('0x2c')][_0x3d3a('0x45')]({'where':{'id':_0x596ea8[_0x3d3a('0x44')]['id']}})[_0x3d3a('0x24')](handleEntityNotFound(_0x2a2f8a,null))[_0x3d3a('0x24')](saveUpdates(_0x596ea8[_0x3d3a('0x46')],null))[_0x3d3a('0x24')](respondWithResult(_0x2a2f8a,null))[_0x3d3a('0x47')](handleError(_0x2a2f8a,null));};exports[_0x3d3a('0x48')]=function(_0x44c567,_0x15143c){return db[_0x3d3a('0x2c')]['find']({'where':{'id':_0x44c567[_0x3d3a('0x44')]['id']}})[_0x3d3a('0x24')](handleEntityNotFound(_0x15143c,null))[_0x3d3a('0x24')](removeEntity(_0x15143c,null))['catch'](handleError(_0x15143c,null));};exports[_0x3d3a('0x49')]=function(_0x4f620e,_0x5ac78d){return db[_0x3d3a('0x2c')][_0x3d3a('0x49')]()[_0x3d3a('0x24')](respondWithResult(_0x5ac78d,null))[_0x3d3a('0x47')](handleError(_0x5ac78d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index b4b2e90..6bcb5a2 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 _0x1216=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash','util','../../config/logger','api','bluebird'];(function(_0x1db97c,_0x274d68){var _0x502a09=function(_0x127e8b){while(--_0x127e8b){_0x1db97c['push'](_0x1db97c['shift']());}};_0x502a09(++_0x274d68);}(_0x1216,0x167));var _0x6121=function(_0x33b259,_0x2036be){_0x33b259=_0x33b259-0x0;var _0xf95548=_0x1216[_0x33b259];return _0xf95548;};'use strict';var _=require(_0x6121('0x0'));var util=require(_0x6121('0x1'));var logger=require(_0x6121('0x2'))(_0x6121('0x3'));var moment=require('moment');var BPromise=require(_0x6121('0x4'));var rp=require(_0x6121('0x5'));var fs=require('fs');var path=require(_0x6121('0x6'));var rimraf=require(_0x6121('0x7'));var config=require(_0x6121('0x8'));var attributes=require(_0x6121('0x9'));module[_0x6121('0xa')]=function(_0x101d78,_0x37f449){return _0x101d78[_0x6121('0xb')](_0x6121('0xc'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e65=['path','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3ac7a8,_0x2b3f35){var _0x3cf041=function(_0xd73080){while(--_0xd73080){_0x3ac7a8['push'](_0x3ac7a8['shift']());}};_0x3cf041(++_0x2b3f35);}(_0x2e65,0x1f2));var _0x52e6=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0x2e65[_0x2601b4];return _0x3e3661;};'use strict';var _=require(_0x52e6('0x0'));var util=require(_0x52e6('0x1'));var logger=require(_0x52e6('0x2'))('api');var moment=require(_0x52e6('0x3'));var BPromise=require(_0x52e6('0x4'));var rp=require(_0x52e6('0x5'));var fs=require('fs');var path=require(_0x52e6('0x6'));var rimraf=require('rimraf');var config=require(_0x52e6('0x7'));var attributes=require(_0x52e6('0x8'));module[_0x52e6('0x9')]=function(_0x3f3f9e,_0xcae9a3){return _0x3f3f9e[_0x52e6('0xa')](_0x52e6('0xb'),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 b686d9c..6301127 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 _0xa3eb=['error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','attributes','limit','map','include','model','UpdateCmHopperBlack','update','body','where','debug','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa3eb,0x8a));var _0xba3e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa3eb[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xba3e('0x0'));var util=require(_0xba3e('0x1'));var moment=require(_0xba3e('0x2'));var BPromise=require(_0xba3e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba3e('0x4'))['db'];var utils=require(_0xba3e('0x5'));var logger=require(_0xba3e('0x6'))(_0xba3e('0x7'));var config=require('../../config/environment');var jayson=require(_0xba3e('0x8'));var client=jayson[_0xba3e('0x9')][_0xba3e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c4437,_0x417dd0,_0x24c182){return new BPromise(function(_0x2a859e,_0x49cfca){return client[_0xba3e('0xb')](_0x2c4437,_0x24c182)[_0xba3e('0xc')](function(_0x86b1df){logger[_0xba3e('0xd')](_0xba3e('0xe'),_0x417dd0,_0xba3e('0xf'));logger['debug'](_0xba3e('0x10'),_0x417dd0,_0xba3e('0xf'),JSON[_0xba3e('0x11')](_0x86b1df));if(_0x86b1df[_0xba3e('0x12')]){if(_0x86b1df[_0xba3e('0x12')][_0xba3e('0x13')]===0x1f4){logger[_0xba3e('0x12')](_0xba3e('0xe'),_0x417dd0,_0x86b1df[_0xba3e('0x12')][_0xba3e('0x14')]);return _0x49cfca(_0x86b1df[_0xba3e('0x12')]['message']);}logger[_0xba3e('0x12')](_0xba3e('0xe'),_0x417dd0,_0x86b1df[_0xba3e('0x12')][_0xba3e('0x14')]);return _0x2a859e(_0x86b1df[_0xba3e('0x12')][_0xba3e('0x14')]);}else{logger[_0xba3e('0xd')](_0xba3e('0xe'),_0x417dd0,_0xba3e('0xf'));_0x2a859e(_0x86b1df[_0xba3e('0x15')][_0xba3e('0x14')]);}})[_0xba3e('0x16')](function(_0x1f2fbb){logger[_0xba3e('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x417dd0,_0x1f2fbb);_0x49cfca(_0x1f2fbb);});});}exports[_0xba3e('0x17')]=function(_0x313ff4){var _0x8e8148=this;return new Promise(function(_0x44b945,_0x1cbdda){return db[_0xba3e('0x18')]['findAll']({'raw':_0x313ff4[_0xba3e('0x19')]?_0x313ff4['options'][_0xba3e('0x1a')]===undefined?!![]:![]:!![],'where':_0x313ff4[_0xba3e('0x19')]?_0x313ff4[_0xba3e('0x19')]['where']||null:null,'attributes':_0x313ff4[_0xba3e('0x19')]?_0x313ff4[_0xba3e('0x19')][_0xba3e('0x1b')]||null:null,'limit':_0x313ff4[_0xba3e('0x19')]?_0x313ff4[_0xba3e('0x19')][_0xba3e('0x1c')]||null:null,'include':_0x313ff4[_0xba3e('0x19')]?_0x313ff4[_0xba3e('0x19')]['include']?_[_0xba3e('0x1d')](_0x313ff4[_0xba3e('0x19')][_0xba3e('0x1e')],function(_0x3e08ec){return{'model':db[_0x3e08ec[_0xba3e('0x1f')]],'as':_0x3e08ec['as'],'attributes':_0x3e08ec[_0xba3e('0x1b')],'include':_0x3e08ec['include']?_['map'](_0x3e08ec[_0xba3e('0x1e')],function(_0x32e05e){return{'model':db[_0x32e05e['model']],'as':_0x32e05e['as'],'attributes':_0x32e05e['attributes'],'include':_0x32e05e['include']?_[_0xba3e('0x1d')](_0x32e05e[_0xba3e('0x1e')],function(_0x2d2cc9){return{'model':db[_0x2d2cc9[_0xba3e('0x1f')]],'as':_0x2d2cc9['as'],'attributes':_0x2d2cc9['attributes']};}):[]};}):[]};}):[]:[]})[_0xba3e('0xc')](function(_0x1e5d99){logger[_0xba3e('0xd')](_0xba3e('0x17'),_0x313ff4);logger['debug']('GetCmHopperBlack',_0x313ff4,JSON[_0xba3e('0x11')](_0x1e5d99));_0x44b945(_0x1e5d99);})[_0xba3e('0x16')](function(_0x37c97a){logger[_0xba3e('0x12')](_0xba3e('0x17'),_0x37c97a['message'],_0x313ff4);_0x1cbdda(_0x8e8148[_0xba3e('0x12')](0x1f4,_0x37c97a[_0xba3e('0x14')]));});});};exports[_0xba3e('0x20')]=function(_0xb37a28){var _0x44ca6b=this;return new Promise(function(_0x3a83a8,_0x2de84c){return db[_0xba3e('0x18')][_0xba3e('0x21')](_0xb37a28[_0xba3e('0x22')],{'raw':_0xb37a28[_0xba3e('0x19')]?_0xb37a28['options'][_0xba3e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb37a28[_0xba3e('0x19')]?_0xb37a28['options'][_0xba3e('0x23')]||null:null,'attributes':_0xb37a28[_0xba3e('0x19')]?_0xb37a28[_0xba3e('0x19')][_0xba3e('0x1b')]||null:null,'limit':_0xb37a28[_0xba3e('0x19')]?_0xb37a28['options']['limit']||null:null})[_0xba3e('0xc')](function(_0x3ffb14){logger[_0xba3e('0xd')]('UpdateCmHopperBlack',_0xb37a28);logger[_0xba3e('0x24')](_0xba3e('0x20'),_0xb37a28,JSON[_0xba3e('0x11')](_0x3ffb14));_0x3a83a8(_0x3ffb14);})[_0xba3e('0x16')](function(_0x122ad8){logger[_0xba3e('0x12')]('UpdateCmHopperBlack',_0x122ad8['message'],_0xb37a28);_0x2de84c(_0x44ca6b[_0xba3e('0x12')](0x1f4,_0x122ad8[_0xba3e('0x14')]));});});};exports[_0xba3e('0x25')]=function(_0x3b47f2){var _0x51248b=this;return new Promise(function(_0x1c2c74,_0x1d2020){return db[_0xba3e('0x18')][_0xba3e('0x26')]({'where':_0x3b47f2[_0xba3e('0x19')]?_0x3b47f2['options'][_0xba3e('0x23')]||null:null})[_0xba3e('0xc')](function(_0x2a9783){logger[_0xba3e('0xd')](_0xba3e('0x25'),_0x3b47f2);logger[_0xba3e('0x24')](_0xba3e('0x25'),_0x3b47f2,JSON[_0xba3e('0x11')](_0x2a9783));_0x1c2c74(_0x2a9783);})[_0xba3e('0x16')](function(_0x1f72d6){logger[_0xba3e('0x12')](_0xba3e('0x25'),_0x1f72d6[_0xba3e('0x14')],_0x3b47f2);_0x1d2020(_0x51248b[_0xba3e('0x12')](0x1f4,_0x1f72d6[_0xba3e('0x14')]));});});}; \ No newline at end of file +var _0xbcd4=['jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CmHopperBlack','findAll','options','raw','where','limit','include','map','model','attributes','GetCmHopperBlack','body','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1bb3d1,_0x204fd2){var _0x4682e5=function(_0x4e9f73){while(--_0x4e9f73){_0x1bb3d1['push'](_0x1bb3d1['shift']());}};_0x4682e5(++_0x204fd2);}(_0xbcd4,0x1d8));var _0x4bcd=function(_0x368c8c,_0xbc7e77){_0x368c8c=_0x368c8c-0x0;var _0x554cdb=_0xbcd4[_0x368c8c];return _0x554cdb;};'use strict';var _=require(_0x4bcd('0x0'));var util=require(_0x4bcd('0x1'));var moment=require(_0x4bcd('0x2'));var BPromise=require(_0x4bcd('0x3'));var rs=require(_0x4bcd('0x4'));var fs=require('fs');var Redis=require(_0x4bcd('0x5'));var db=require(_0x4bcd('0x6'))['db'];var utils=require(_0x4bcd('0x7'));var logger=require(_0x4bcd('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4bcd('0x9'));var client=jayson[_0x4bcd('0xa')][_0x4bcd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53bf87,_0x4ed5c7,_0x367fe0){return new BPromise(function(_0x296c84,_0x1ac2e3){return client['request'](_0x53bf87,_0x367fe0)[_0x4bcd('0xc')](function(_0x27d625){logger[_0x4bcd('0xd')](_0x4bcd('0xe'),_0x4ed5c7,_0x4bcd('0xf'));logger[_0x4bcd('0x10')](_0x4bcd('0x11'),_0x4ed5c7,'request\x20sent',JSON[_0x4bcd('0x12')](_0x27d625));if(_0x27d625[_0x4bcd('0x13')]){if(_0x27d625[_0x4bcd('0x13')][_0x4bcd('0x14')]===0x1f4){logger['error'](_0x4bcd('0xe'),_0x4ed5c7,_0x27d625[_0x4bcd('0x13')][_0x4bcd('0x15')]);return _0x1ac2e3(_0x27d625[_0x4bcd('0x13')]['message']);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x4ed5c7,_0x27d625[_0x4bcd('0x13')][_0x4bcd('0x15')]);return _0x296c84(_0x27d625[_0x4bcd('0x13')][_0x4bcd('0x15')]);}else{logger['info'](_0x4bcd('0xe'),_0x4ed5c7,_0x4bcd('0xf'));_0x296c84(_0x27d625['result'][_0x4bcd('0x15')]);}})[_0x4bcd('0x16')](function(_0x37e11e){logger[_0x4bcd('0x13')](_0x4bcd('0xe'),_0x4ed5c7,_0x37e11e);_0x1ac2e3(_0x37e11e);});});}exports['GetCmHopperBlack']=function(_0x30129c){var _0x357bdc=this;return new Promise(function(_0x340832,_0x4ae117){return db[_0x4bcd('0x17')][_0x4bcd('0x18')]({'raw':_0x30129c[_0x4bcd('0x19')]?_0x30129c[_0x4bcd('0x19')][_0x4bcd('0x1a')]===undefined?!![]:![]:!![],'where':_0x30129c['options']?_0x30129c[_0x4bcd('0x19')][_0x4bcd('0x1b')]||null:null,'attributes':_0x30129c[_0x4bcd('0x19')]?_0x30129c['options']['attributes']||null:null,'limit':_0x30129c['options']?_0x30129c['options'][_0x4bcd('0x1c')]||null:null,'include':_0x30129c['options']?_0x30129c[_0x4bcd('0x19')][_0x4bcd('0x1d')]?_[_0x4bcd('0x1e')](_0x30129c['options'][_0x4bcd('0x1d')],function(_0x23ee5e){return{'model':db[_0x23ee5e[_0x4bcd('0x1f')]],'as':_0x23ee5e['as'],'attributes':_0x23ee5e['attributes'],'include':_0x23ee5e[_0x4bcd('0x1d')]?_[_0x4bcd('0x1e')](_0x23ee5e['include'],function(_0x2c2687){return{'model':db[_0x2c2687['model']],'as':_0x2c2687['as'],'attributes':_0x2c2687['attributes'],'include':_0x2c2687['include']?_[_0x4bcd('0x1e')](_0x2c2687['include'],function(_0x5b1a9a){return{'model':db[_0x5b1a9a['model']],'as':_0x5b1a9a['as'],'attributes':_0x5b1a9a[_0x4bcd('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23d6e5){logger[_0x4bcd('0xd')]('GetCmHopperBlack',_0x30129c);logger[_0x4bcd('0x10')](_0x4bcd('0x21'),_0x30129c,JSON[_0x4bcd('0x12')](_0x23d6e5));_0x340832(_0x23d6e5);})['catch'](function(_0x4426e3){logger['error'](_0x4bcd('0x21'),_0x4426e3[_0x4bcd('0x15')],_0x30129c);_0x4ae117(_0x357bdc['error'](0x1f4,_0x4426e3[_0x4bcd('0x15')]));});});};exports['UpdateCmHopperBlack']=function(_0x4a87d0){var _0x3c159a=this;return new Promise(function(_0xd03bdb,_0x317901){return db[_0x4bcd('0x17')]['update'](_0x4a87d0[_0x4bcd('0x22')],{'raw':_0x4a87d0[_0x4bcd('0x19')]?_0x4a87d0[_0x4bcd('0x19')][_0x4bcd('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a87d0[_0x4bcd('0x19')]?_0x4a87d0[_0x4bcd('0x19')]['where']||null:null,'attributes':_0x4a87d0[_0x4bcd('0x19')]?_0x4a87d0[_0x4bcd('0x19')][_0x4bcd('0x20')]||null:null,'limit':_0x4a87d0[_0x4bcd('0x19')]?_0x4a87d0[_0x4bcd('0x19')][_0x4bcd('0x1c')]||null:null})[_0x4bcd('0xc')](function(_0x488a29){logger[_0x4bcd('0xd')](_0x4bcd('0x23'),_0x4a87d0);logger[_0x4bcd('0x10')](_0x4bcd('0x23'),_0x4a87d0,JSON[_0x4bcd('0x12')](_0x488a29));_0xd03bdb(_0x488a29);})[_0x4bcd('0x16')](function(_0x292744){logger[_0x4bcd('0x13')]('UpdateCmHopperBlack',_0x292744[_0x4bcd('0x15')],_0x4a87d0);_0x317901(_0x3c159a[_0x4bcd('0x13')](0x1f4,_0x292744['message']));});});};exports['DestroyCmHopperBlack']=function(_0x13c97e){var _0x36e976=this;return new Promise(function(_0x1d15b4,_0xa8d66b){return db[_0x4bcd('0x17')]['destroy']({'where':_0x13c97e[_0x4bcd('0x19')]?_0x13c97e['options'][_0x4bcd('0x1b')]||null:null})[_0x4bcd('0xc')](function(_0x228dd8){logger[_0x4bcd('0xd')](_0x4bcd('0x24'),_0x13c97e);logger['debug']('DestroyCmHopperBlack',_0x13c97e,JSON[_0x4bcd('0x12')](_0x228dd8));_0x1d15b4(_0x228dd8);})[_0x4bcd('0x16')](function(_0x124167){logger['error'](_0x4bcd('0x24'),_0x124167[_0x4bcd('0x15')],_0x13c97e);_0xa8d66b(_0x36e976[_0x4bcd('0x13')](0x1f4,_0x124167[_0x4bcd('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index a070e05..6874fc9 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 _0x4819=['show','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','/describe','describe','get','/:id'];(function(_0x17cfee,_0x298b13){var _0x249333=function(_0x2e50c9){while(--_0x2e50c9){_0x17cfee['push'](_0x17cfee['shift']());}};_0x249333(++_0x298b13);}(_0x4819,0xcd));var _0x9481=function(_0x4f192e,_0x4d1756){_0x4f192e=_0x4f192e-0x0;var _0x49294d=_0x4819[_0x4f192e];return _0x49294d;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get']('/',auth[_0x9481('0xa')](),controller['index']);router['get'](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0xc')]);router[_0x9481('0xd')](_0x9481('0xe'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['put'](_0x9481('0xe'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);router[_0x9481('0x11')](_0x9481('0xe'),auth[_0x9481('0xa')](),controller[_0x9481('0x12')]);module[_0x9481('0x13')]=router; \ No newline at end of file +var _0x2675=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','put','/:id','delete','exports','multer','express','Router'];(function(_0x42150d,_0x542bbc){var _0x4a1009=function(_0x4f9b01){while(--_0x4f9b01){_0x42150d['push'](_0x42150d['shift']());}};_0x4a1009(++_0x542bbc);}(_0x2675,0x75));var _0x5267=function(_0xd91b48,_0x4b38df){_0xd91b48=_0xd91b48-0x0;var _0x2cdfc6=_0x2675[_0xd91b48];return _0x2cdfc6;};'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 diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 6d55c17..6d14d8f 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 _0x7d21=['STRING','INTEGER','DATE','endtime','setDataValue','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports'];(function(_0x344972,_0x39ba31){var _0x5a6ca1=function(_0x8ac716){while(--_0x8ac716){_0x344972['push'](_0x344972['shift']());}};_0x5a6ca1(++_0x39ba31);}(_0x7d21,0x17d));var _0x17d2=function(_0x381bdb,_0x2b42b8){_0x381bdb=_0x381bdb-0x0;var _0x1ede25=_0x7d21[_0x381bdb];return _0x1ede25;};'use strict';var Sequelize=require(_0x17d2('0x0'));var moment=require(_0x17d2('0x1'));module[_0x17d2('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x17d2('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x17d2('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x17d2('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x17d2('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x17d2('0x3')]},'starttime':{'type':Sequelize[_0x17d2('0x5')]},'responsetime':{'type':Sequelize[_0x17d2('0x5')]},'answertime':{'type':Sequelize[_0x17d2('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x17d2('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x17d2('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x17d2('0x3')]},'campaign':{'type':Sequelize[_0x17d2('0x3')]},'campaigntype':{'type':Sequelize[_0x17d2('0x3')]},'membername':{'type':Sequelize[_0x17d2('0x3')]},'reason':{'type':Sequelize[_0x17d2('0x3')]},'disposition':{'type':Sequelize[_0x17d2('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x17d2('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x3934e2){var _0x20d107=this['getDataValue'](_0x17d2('0x6'));if(_0x20d107&&_0x3934e2){this[_0x17d2('0x7')]('followuptime',moment(_0x3934e2)[_0x17d2('0x8')](moment(_0x20d107),_0x17d2('0x9')));}return this[_0x17d2('0x7')](_0x17d2('0xa'),_0x3934e2);}},'amd':{'type':Sequelize[_0x17d2('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x17d2('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x17d2('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x17d2('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x17d2('0x5')]},'callback':{'type':Sequelize[_0x17d2('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x17d2('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x17d2('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x17d2('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x17d2('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x17d2('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x17d2('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x17d2('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x17d2('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4b5b=['DATE','INTEGER','getDataValue','setDataValue','followuptime','diff','BOOLEAN','moment','exports','STRING'];(function(_0x455239,_0x52b37d){var _0x233bff=function(_0x54400c){while(--_0x54400c){_0x455239['push'](_0x455239['shift']());}};_0x233bff(++_0x52b37d);}(_0x4b5b,0x1bf));var _0xb4b5=function(_0x2561e9,_0x3eef32){_0x2561e9=_0x2561e9-0x0;var _0x3ac331=_0x4b5b[_0x2561e9];return _0x3ac331;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb4b5('0x0'));module[_0xb4b5('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb4b5('0x2')]},'scheduledat':{'type':Sequelize[_0xb4b5('0x3')]},'countbusyretry':{'type':Sequelize[_0xb4b5('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb4b5('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb4b5('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb4b5('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xb4b5('0x2')]},'originatecalleridname':{'type':Sequelize[_0xb4b5('0x2')]},'calleridnum':{'type':Sequelize[_0xb4b5('0x2')]},'calleridname':{'type':Sequelize[_0xb4b5('0x2')]},'starttime':{'type':Sequelize[_0xb4b5('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb4b5('0x3')]},'droptime':{'type':Sequelize[_0xb4b5('0x3')]},'endtime':{'type':Sequelize[_0xb4b5('0x3')]},'ringtime':{'type':Sequelize[_0xb4b5('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb4b5('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb4b5('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb4b5('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xb4b5('0x2')]},'campaigntype':{'type':Sequelize[_0xb4b5('0x2')]},'membername':{'type':Sequelize[_0xb4b5('0x2')]},'reason':{'type':Sequelize[_0xb4b5('0x2')]},'disposition':{'type':Sequelize[_0xb4b5('0x2')]},'secondDisposition':{'type':Sequelize[_0xb4b5('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb4b5('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x45ad77){var _0x5602da=this[_0xb4b5('0x5')]('endtime');if(_0x5602da&&_0x45ad77){this[_0xb4b5('0x6')](_0xb4b5('0x7'),moment(_0x45ad77)[_0xb4b5('0x8')](moment(_0x5602da),'seconds'));}return this[_0xb4b5('0x6')]('dispositionat',_0x45ad77);}},'amd':{'type':Sequelize[_0xb4b5('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb4b5('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb4b5('0x3')]},'callback':{'type':Sequelize[_0xb4b5('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb4b5('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xb4b5('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb4b5('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb4b5('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0xb4b5('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb4b5('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb4b5('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb4b5('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb4b5('0x4')],'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 c9b5111..34f3482 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 _0x71ab=['json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','CmHopperFinal','findAll','rows','catch','show','params','rawAttributes','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','dropContacts','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','state','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x49d6f7,_0x93c6a2){var _0x1f6466=function(_0x52fbc5){while(--_0x52fbc5){_0x49d6f7['push'](_0x49d6f7['shift']());}};_0x1f6466(++_0x93c6a2);}(_0x71ab,0x64));var _0xb71a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x71ab[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x3401f7,_0x1a010d){return function(_0x20ed75){if(!_0x20ed75){_0x3401f7[_0xb71a('0x19')](0x194);}return _0x20ed75;};}function handleError(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0x1f4;return function(_0x45b849){logger[_0xb71a('0x26')](_0x45b849[_0xb71a('0x27')]);if(_0x45b849['name']){delete _0x45b849[_0xb71a('0x28')];}_0x31085b[_0xb71a('0x1a')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);};}exports[_0xb71a('0x2a')]=function(_0x2fbd73,_0x38178c){var _0x44826e={},_0x25364c={},_0x42c086={'count':0x0,'rows':[]};var _0x421fcf=_[_0xb71a('0x2b')](db['CmHopperFinal']['rawAttributes'],function(_0x3112d3){return{'name':_0x3112d3['fieldName'],'type':_0x3112d3[_0xb71a('0x2c')][_0xb71a('0x2d')]};});_0x25364c['model']=_[_0xb71a('0x2b')](_0x421fcf,_0xb71a('0x28'));_0x25364c[_0xb71a('0x2e')]=_[_0xb71a('0x2f')](_0x2fbd73[_0xb71a('0x2e')]);_0x25364c[_0xb71a('0x30')]=_['intersection'](_0x25364c[_0xb71a('0x31')],_0x25364c[_0xb71a('0x2e')]);_0x44826e[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x25364c['model'],qs[_0xb71a('0x34')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x34')]));_0x44826e[_0xb71a('0x32')]=_0x44826e[_0xb71a('0x32')][_0xb71a('0x35')]?_0x44826e[_0xb71a('0x32')]:_0x25364c[_0xb71a('0x31')];if(!_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x36')]('nolimit')){_0x44826e['limit']=qs[_0xb71a('0x1f')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1f')]);_0x44826e[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1d')]);}_0x44826e['order']=qs[_0xb71a('0x37')](_0x2fbd73['query'][_0xb71a('0x37')]);_0x44826e[_0xb71a('0x38')]=qs[_0xb71a('0x30')](_[_0xb71a('0x39')](_0x2fbd73['query'],_0x25364c[_0xb71a('0x30')]),_0x421fcf);if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]){_0x44826e[_0xb71a('0x38')]=_[_0xb71a('0x3b')](_0x44826e[_0xb71a('0x38')],{'$or':_[_0xb71a('0x2b')](_0x421fcf,function(_0x2756b9){if(_0x2756b9[_0xb71a('0x2c')]!=='VIRTUAL'){var _0x24a3af={};_0x24a3af[_0x2756b9['name']]={'$like':'%'+_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]+'%'};return _0x24a3af;}})});}_0x44826e=_[_0xb71a('0x3b')]({},_0x44826e,_0x2fbd73[_0xb71a('0x3c')]);var _0xce7b8a={'where':_0x44826e[_0xb71a('0x38')]};return db['CmHopperFinal']['count'](_0xce7b8a)['then'](function(_0x35fea9){_0x42c086['count']=_0x35fea9;if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x44826e[_0xb71a('0x3e')]=[{'all':!![]}];}return db[_0xb71a('0x3f')][_0xb71a('0x40')](_0x44826e);})[_0xb71a('0x24')](function(_0x59530a){_0x42c086[_0xb71a('0x41')]=_0x59530a;return _0x42c086;})[_0xb71a('0x24')](respondWithFilteredResult(_0x38178c,_0x44826e))[_0xb71a('0x42')](handleError(_0x38178c,null));};exports[_0xb71a('0x43')]=function(_0x7d305,_0x2f08d2){var _0x55cbca={'raw':!![],'where':{'id':_0x7d305[_0xb71a('0x44')]['id']}},_0x2afff3={};_0x2afff3[_0xb71a('0x31')]=_[_0xb71a('0x2f')](db[_0xb71a('0x3f')][_0xb71a('0x45')]);_0x2afff3[_0xb71a('0x2e')]=_['keys'](_0x7d305['query']);_0x2afff3[_0xb71a('0x30')]=_[_0xb71a('0x33')](_0x2afff3[_0xb71a('0x31')],_0x2afff3[_0xb71a('0x2e')]);_0x55cbca['attributes']=_[_0xb71a('0x33')](_0x2afff3['model'],qs[_0xb71a('0x34')](_0x7d305[_0xb71a('0x2e')]['fields']));_0x55cbca[_0xb71a('0x32')]=_0x55cbca[_0xb71a('0x32')][_0xb71a('0x35')]?_0x55cbca[_0xb71a('0x32')]:_0x2afff3['model'];if(_0x7d305[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x55cbca[_0xb71a('0x3e')]=[{'all':!![]}];}_0x55cbca=_['merge']({},_0x55cbca,_0x7d305[_0xb71a('0x3c')]);return db[_0xb71a('0x3f')][_0xb71a('0x46')](_0x55cbca)['then'](handleEntityNotFound(_0x2f08d2,null))[_0xb71a('0x24')](respondWithResult(_0x2f08d2,null))[_0xb71a('0x42')](handleError(_0x2f08d2,null));};exports[_0xb71a('0x47')]=function(_0x1f29b7,_0x365bed){return db['CmHopperFinal'][_0xb71a('0x47')]()[_0xb71a('0x24')](respondWithResult(_0x365bed,null))[_0xb71a('0x42')](handleError(_0x365bed,null));};exports[_0xb71a('0x23')]=function(_0x489c1f,_0x48fbde){if(_0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')]){delete _0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')];}return db[_0xb71a('0x3f')][_0xb71a('0x46')]({'where':{'uniqueid':_0x489c1f[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x48fbde,null))[_0xb71a('0x24')](saveUpdates(_0x489c1f[_0xb71a('0x48')],null))['then'](respondWithResult(_0x48fbde,null))[_0xb71a('0x42')](handleError(_0x48fbde,null));};exports[_0xb71a('0x4a')]=function(_0x500196,_0x1c0536,_0x58116c){return db[_0xb71a('0x3f')][_0xb71a('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x500196[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x54')))),'dropContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x55')))),_0xb71a('0x56')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x59')))),_0xb71a('0x5a')]]})['then'](handleEntityNotFound(_0x1c0536,null))[_0xb71a('0x24')](respondWithResult(_0x1c0536,null))[_0xb71a('0x42')](handleError(_0x1c0536,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x181a9f,_0xe55672,_0x38de3a){return db[_0xb71a('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x181a9f[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x5b')))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb71a('0x5c')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x55')))),'abandonedContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x59')))),_0xb71a('0x5a')]]})[_0xb71a('0x24')](handleEntityNotFound(_0xe55672,null))[_0xb71a('0x24')](respondWithResult(_0xe55672,null))['catch'](handleError(_0xe55672,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x15b8be,_0x2dd470,_0x38a8a1){return db[_0xb71a('0x5d')][_0xb71a('0x46')]({'where':{'id':_0x15b8be[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x2dd470,null))['then'](function(_0x45f4b2){var _0x27c15e;if(_0x45f4b2){_0x27c15e=squel['insert']()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),_0xb71a('0x63'),'VoiceQueueId',_0xb71a('0x64'),_0xb71a('0x65')],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),_0xb71a('0x69'))[_0xb71a('0x67')](_0xb71a('0x6a'),'scheduledAt')[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))[_0xb71a('0x67')]('ANY_VALUE(VoiceQueueId)',_0xb71a('0x6d'))['field'](_0xb71a('0x6a'),_0xb71a('0x64'))['field'](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x15b8be[_0xb71a('0x48')]['state'][_0xb71a('0x70')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')]('VoiceQueueId\x20=\x20?',_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel[_0xb71a('0x66')]()[_0xb71a('0x67')]('calleridnum')[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))[_0xb71a('0x70')]();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x27c15e);}return[];})['then'](respondWithResult(_0x2dd470,null))[_0xb71a('0x42')](handleError(_0x2dd470,null));};exports[_0xb71a('0x76')]=function(_0x28bc74,_0x575a0a,_0x1a658e){return db[_0xb71a('0x77')]['find']({'where':{'id':_0x28bc74[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x575a0a,null))[_0xb71a('0x24')](function(_0x21b9b5){var _0x4abfd6;if(_0x21b9b5){_0x4abfd6=squel[_0xb71a('0x78')]()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),'ListId',_0xb71a('0x79'),_0xb71a('0x64'),'updatedAt'],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),'phone')[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x61'))[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))['field']('ANY_VALUE(CampaignId)',_0xb71a('0x79'))[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x64'))[_0xb71a('0x67')](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x28bc74[_0xb71a('0x48')][_0xb71a('0x7a')][_0xb71a('0x70')]())[_0xb71a('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')](_0xb71a('0x7b'),_0x28bc74['params']['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x7c'))[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id']['toString']())[_0xb71a('0x38')](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))['toString']();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x4abfd6);}return[];})[_0xb71a('0x24')](respondWithResult(_0x575a0a,null))[_0xb71a('0x42')](handleError(_0x575a0a,null));};exports[_0xb71a('0x7d')]=function(_0x18dfb3,_0x38ffc1,_0x442ec0){return db[_0xb71a('0x7e')][_0xb71a('0x7f')]({'where':{'VoiceQueueId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x6d')],'CampaignId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x79')],'ContactId':_0x18dfb3[_0xb71a('0x48')]['ContactId']}})[_0xb71a('0x24')](handleEntityNotFound(_0x38ffc1,null))[_0xb71a('0x24')](function(_0x243c90){if(_0x243c90){return _0x243c90;}return null;})['then'](respondWithResult(_0x38ffc1,null))['catch'](handleError(_0x38ffc1,null));}; \ No newline at end of file +var _0xfdbd=['status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','length','find','catch','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','params','noAnswerContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','checkContactHopper','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','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'];(function(_0x185063,_0x3f0bb7){var _0x16d9d3=function(_0x1b3fe3){while(--_0x1b3fe3){_0x185063['push'](_0x185063['shift']());}};_0x16d9d3(++_0x3f0bb7);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0xfdbd[_0x290fa6];return _0x47f1f3;};'use strict';var emlformat=require(_0xdfdb('0x0'));var rimraf=require(_0xdfdb('0x1'));var zipdir=require(_0xdfdb('0x2'));var jsonpatch=require(_0xdfdb('0x3'));var rp=require(_0xdfdb('0x4'));var moment=require(_0xdfdb('0x5'));var BPromise=require(_0xdfdb('0x6'));var Mustache=require(_0xdfdb('0x7'));var util=require(_0xdfdb('0x8'));var path=require('path');var sox=require(_0xdfdb('0x9'));var csv=require('to-csv');var ejs=require(_0xdfdb('0xa'));var fs=require('fs');var fs_extra=require(_0xdfdb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdfdb('0xc'));var deskjs=require(_0xdfdb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfdb('0xe'));var Papa=require(_0xdfdb('0xf'));var Redis=require(_0xdfdb('0x10'));var authService=require(_0xdfdb('0x11'));var qs=require(_0xdfdb('0x12'));var as=require(_0xdfdb('0x13'));var hardwareService=require(_0xdfdb('0x14'));var logger=require('../../config/logger')(_0xdfdb('0x15'));var utils=require(_0xdfdb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdfdb('0x17'));var db=require(_0xdfdb('0x18'))['db'];function respondWithStatusCode(_0x2bee3b,_0x1918c1){_0x1918c1=_0x1918c1||0xcc;return function(_0x2a95f1){if(_0x2a95f1){return _0x2bee3b[_0xdfdb('0x19')](_0x1918c1);}return _0x2bee3b[_0xdfdb('0x1a')](_0x1918c1)[_0xdfdb('0x1b')]();};}function respondWithResult(_0x51162f,_0x48a66a){_0x48a66a=_0x48a66a||0xc8;return function(_0x2c44dc){if(_0x2c44dc){return _0x51162f['status'](_0x48a66a)[_0xdfdb('0x1c')](_0x2c44dc);}};}function respondWithFilteredResult(_0x9f3039,_0x11a56a){return function(_0x40bc8a){if(_0x40bc8a){var _0x3bfd81=typeof _0x11a56a[_0xdfdb('0x1d')]==='undefined'&&typeof _0x11a56a['limit']===_0xdfdb('0x1e');var _0x8b9193=_0x40bc8a[_0xdfdb('0x1f')];var _0x55ab5a=_0x3bfd81?0x0:_0x11a56a[_0xdfdb('0x1d')];var _0xb677b1=_0x3bfd81?_0x40bc8a[_0xdfdb('0x1f')]:_0x11a56a[_0xdfdb('0x1d')]+_0x11a56a[_0xdfdb('0x20')];var _0x2294de;if(_0xb677b1>=_0x8b9193){_0xb677b1=_0x8b9193;_0x2294de=0xc8;}else{_0x2294de=0xce;}_0x9f3039[_0xdfdb('0x1a')](_0x2294de);return _0x9f3039[_0xdfdb('0x21')]('Content-Range',_0x55ab5a+'-'+_0xb677b1+'/'+_0x8b9193)[_0xdfdb('0x1c')](_0x40bc8a);}return null;};}function patchUpdates(_0xb7417c){return function(_0x172c63){try{jsonpatch['apply'](_0x172c63,_0xb7417c,!![]);}catch(_0x377112){return BPromise[_0xdfdb('0x22')](_0x377112);}return _0x172c63[_0xdfdb('0x23')]();};}function saveUpdates(_0x4d55e5,_0x280e53){return function(_0x789bd2){if(_0x789bd2){return _0x789bd2[_0xdfdb('0x24')](_0x4d55e5)['then'](function(_0x2a80c1){return _0x2a80c1;});}return null;};}function removeEntity(_0x526057,_0x2db1c1){return function(_0x145350){if(_0x145350){return _0x145350[_0xdfdb('0x25')]()[_0xdfdb('0x26')](function(){_0x526057['status'](0xcc)[_0xdfdb('0x1b')]();});}};}function handleEntityNotFound(_0x4363d8,_0x956843){return function(_0x400663){if(!_0x400663){_0x4363d8[_0xdfdb('0x19')](0x194);}return _0x400663;};}function handleError(_0x305954,_0x57d24f){_0x57d24f=_0x57d24f||0x1f4;return function(_0xec4d22){logger[_0xdfdb('0x27')](_0xec4d22[_0xdfdb('0x28')]);if(_0xec4d22['name']){delete _0xec4d22[_0xdfdb('0x29')];}_0x305954['status'](_0x57d24f)[_0xdfdb('0x2a')](_0xec4d22);};}exports[_0xdfdb('0x2b')]=function(_0x19c36f,_0x513fa0){var _0x5bc174={},_0x1c8ca8={},_0xc56435={'count':0x0,'rows':[]};var _0xedbb91=_[_0xdfdb('0x2c')](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')],function(_0x5a9fc4){return{'name':_0x5a9fc4[_0xdfdb('0x2f')],'type':_0x5a9fc4[_0xdfdb('0x30')][_0xdfdb('0x31')]};});_0x1c8ca8[_0xdfdb('0x32')]=_[_0xdfdb('0x2c')](_0xedbb91,_0xdfdb('0x29'));_0x1c8ca8[_0xdfdb('0x33')]=_[_0xdfdb('0x34')](_0x19c36f[_0xdfdb('0x33')]);_0x1c8ca8[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x1c8ca8['model'],_0x1c8ca8['query']);_0x5bc174[_0xdfdb('0x37')]=_['intersection'](_0x1c8ca8[_0xdfdb('0x32')],qs[_0xdfdb('0x38')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x38')]));_0x5bc174['attributes']=_0x5bc174[_0xdfdb('0x37')]['length']?_0x5bc174[_0xdfdb('0x37')]:_0x1c8ca8[_0xdfdb('0x32')];if(!_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x39')](_0xdfdb('0x3a'))){_0x5bc174[_0xdfdb('0x20')]=qs['limit'](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x20')]);_0x5bc174['offset']=qs[_0xdfdb('0x1d')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x1d')]);}_0x5bc174[_0xdfdb('0x3b')]=qs[_0xdfdb('0x3c')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3c')]);_0x5bc174[_0xdfdb('0x3d')]=qs[_0xdfdb('0x35')](_[_0xdfdb('0x3e')](_0x19c36f[_0xdfdb('0x33')],_0x1c8ca8['filters']),_0xedbb91);if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]){_0x5bc174[_0xdfdb('0x3d')]=_[_0xdfdb('0x40')](_0x5bc174[_0xdfdb('0x3d')],{'$or':_[_0xdfdb('0x2c')](_0xedbb91,function(_0x3ec73a){if(_0x3ec73a[_0xdfdb('0x30')]!=='VIRTUAL'){var _0x55d707={};_0x55d707[_0x3ec73a[_0xdfdb('0x29')]]={'$like':'%'+_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]+'%'};return _0x55d707;}})});}_0x5bc174=_[_0xdfdb('0x40')]({},_0x5bc174,_0x19c36f[_0xdfdb('0x41')]);var _0x300884={'where':_0x5bc174[_0xdfdb('0x3d')]};return db[_0xdfdb('0x2d')][_0xdfdb('0x1f')](_0x300884)['then'](function(_0x175f57){_0xc56435[_0xdfdb('0x1f')]=_0x175f57;if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5bc174[_0xdfdb('0x43')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xdfdb('0x44')](_0x5bc174);})[_0xdfdb('0x26')](function(_0x3e9f88){_0xc56435[_0xdfdb('0x45')]=_0x3e9f88;return _0xc56435;})[_0xdfdb('0x26')](respondWithFilteredResult(_0x513fa0,_0x5bc174))['catch'](handleError(_0x513fa0,null));};exports[_0xdfdb('0x46')]=function(_0xd2f8bd,_0xf0482a){var _0x5b4381={'raw':!![],'where':{'id':_0xd2f8bd['params']['id']}},_0x2b5139={};_0x2b5139[_0xdfdb('0x32')]=_['keys'](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')]);_0x2b5139['query']=_[_0xdfdb('0x34')](_0xd2f8bd['query']);_0x2b5139[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x2b5139[_0xdfdb('0x32')],_0x2b5139[_0xdfdb('0x33')]);_0x5b4381[_0xdfdb('0x37')]=_['intersection'](_0x2b5139['model'],qs[_0xdfdb('0x38')](_0xd2f8bd[_0xdfdb('0x33')]['fields']));_0x5b4381[_0xdfdb('0x37')]=_0x5b4381['attributes'][_0xdfdb('0x47')]?_0x5b4381[_0xdfdb('0x37')]:_0x2b5139[_0xdfdb('0x32')];if(_0xd2f8bd[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5b4381[_0xdfdb('0x43')]=[{'all':!![]}];}_0x5b4381=_[_0xdfdb('0x40')]({},_0x5b4381,_0xd2f8bd[_0xdfdb('0x41')]);return db[_0xdfdb('0x2d')][_0xdfdb('0x48')](_0x5b4381)[_0xdfdb('0x26')](handleEntityNotFound(_0xf0482a,null))[_0xdfdb('0x26')](respondWithResult(_0xf0482a,null))[_0xdfdb('0x49')](handleError(_0xf0482a,null));};exports[_0xdfdb('0x4a')]=function(_0x1c08fb,_0x273477){return db['CmHopperFinal']['describe']()[_0xdfdb('0x26')](respondWithResult(_0x273477,null))[_0xdfdb('0x49')](handleError(_0x273477,null));};exports[_0xdfdb('0x24')]=function(_0x4bbb88,_0x36149e){if(_0x4bbb88[_0xdfdb('0x4b')][_0xdfdb('0x4c')]){delete _0x4bbb88[_0xdfdb('0x4b')]['uniqueid'];}return db[_0xdfdb('0x2d')][_0xdfdb('0x48')]({'where':{'uniqueid':_0x4bbb88['params']['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x36149e,null))[_0xdfdb('0x26')](saveUpdates(_0x4bbb88[_0xdfdb('0x4b')],null))[_0xdfdb('0x26')](respondWithResult(_0x36149e,null))[_0xdfdb('0x49')](handleError(_0x36149e,null));};exports[_0xdfdb('0x4d')]=function(_0x17dfdb,_0x1f5b88,_0x1da7af){return db['CmHopperFinal'][_0xdfdb('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x17dfdb['params']['id']},'attributes':[[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x51')))),_0xdfdb('0x52')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x53')))),'noAnswerContacts'],[db[_0xdfdb('0x4e')]['fn']('COUNT',db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x54')))),_0xdfdb('0x55')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x56')))),_0xdfdb('0x57')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x58')))),_0xdfdb('0x59')],[db['sequelize']['fn']('COUNT',db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdfdb('0x5a')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x5b')))),_0xdfdb('0x5c')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')]['literal'](_0xdfdb('0x5d')))),_0xdfdb('0x5e')]]})[_0xdfdb('0x26')](handleEntityNotFound(_0x1f5b88,null))['then'](respondWithResult(_0x1f5b88,null))[_0xdfdb('0x49')](handleError(_0x1f5b88,null));};exports[_0xdfdb('0x5f')]=function(_0x349cf7,_0x2f69a8,_0x424212){return db[_0xdfdb('0x2d')][_0xdfdb('0x44')]({'raw':![],'where':{'CampaignId':_0x349cf7[_0xdfdb('0x60')]['id']},'attributes':[[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x51')))),_0xdfdb('0x52')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x203,\x201,\x20null'))),_0xdfdb('0x61')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x54')))),'busyContacts'],[db['sequelize']['fn'](_0xdfdb('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0xdfdb('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0xdfdb('0x57')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xdfdb('0x59')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdfdb('0x5a')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x2022,\x201,\x20null'))),_0xdfdb('0x5c')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x5d')))),_0xdfdb('0x5e')]]})[_0xdfdb('0x26')](handleEntityNotFound(_0x2f69a8,null))[_0xdfdb('0x26')](respondWithResult(_0x2f69a8,null))['catch'](handleError(_0x2f69a8,null));};exports[_0xdfdb('0x62')]=function(_0x198cfa,_0x2831d6,_0x45bfc0){return db[_0xdfdb('0x63')]['find']({'where':{'id':_0x198cfa[_0xdfdb('0x60')]['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x2831d6,null))[_0xdfdb('0x26')](function(_0x1a31b9){var _0x4999c4;if(_0x1a31b9){_0x4999c4=squel[_0xdfdb('0x64')]()[_0xdfdb('0x65')](_0xdfdb('0x66'))[_0xdfdb('0x67')]([_0xdfdb('0x68'),_0xdfdb('0x69'),_0xdfdb('0x6a'),_0xdfdb('0x6b'),_0xdfdb('0x6c'),_0xdfdb('0x6d'),_0xdfdb('0x6e')],squel['select']()[_0xdfdb('0x6f')](_0xdfdb('0x70'),'phone')[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x69'))['field']('ANY_VALUE(ContactId)','ContactId')[_0xdfdb('0x6f')](_0xdfdb('0x72'),_0xdfdb('0x6b'))[_0xdfdb('0x6f')](_0xdfdb('0x73'),_0xdfdb('0x6c'))[_0xdfdb('0x6f')]('NOW()',_0xdfdb('0x6d'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6e'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')]('VoiceQueueId\x20=\x20?',_0x198cfa[_0xdfdb('0x60')]['id'][_0xdfdb('0x76')]())[_0xdfdb('0x3d')](_0xdfdb('0x77'),_0x198cfa[_0xdfdb('0x4b')]['state'][_0xdfdb('0x76')]())['where'](_0xdfdb('0x78'))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')]('phone')[_0xdfdb('0x74')](_0xdfdb('0x66'))['where']('VoiceQueueId\x20=\x20?',_0x198cfa[_0xdfdb('0x60')]['id']['toString']()))['where'](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x7b'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')](_0xdfdb('0x7c'),_0x198cfa['params']['id'][_0xdfdb('0x76')]())['where'](_0xdfdb('0x7d')))[_0xdfdb('0x7e')](_0xdfdb('0x6a')))[_0xdfdb('0x76')]();return db[_0xdfdb('0x4e')]['query'](_0x4999c4);}return[];})[_0xdfdb('0x26')](respondWithResult(_0x2831d6,null))[_0xdfdb('0x49')](handleError(_0x2831d6,null));};exports[_0xdfdb('0x7f')]=function(_0x1b6445,_0x36241c,_0x4c833f){return db['Campaign'][_0xdfdb('0x48')]({'where':{'id':_0x1b6445[_0xdfdb('0x60')]['id']}})['then'](handleEntityNotFound(_0x36241c,null))[_0xdfdb('0x26')](function(_0x50d5d4){var _0x158454;if(_0x50d5d4){_0x158454=squel[_0xdfdb('0x64')]()[_0xdfdb('0x65')]('cm_hopper')[_0xdfdb('0x67')](['phone','scheduledAt',_0xdfdb('0x6a'),'ListId',_0xdfdb('0x80'),_0xdfdb('0x6d'),_0xdfdb('0x6e')],squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x70'),_0xdfdb('0x68'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x69'))['field']('ANY_VALUE(ContactId)',_0xdfdb('0x6a'))['field']('ANY_VALUE(ListId)','ListId')['field'](_0xdfdb('0x81'),_0xdfdb('0x80'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6d'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6e'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']())['where'](_0xdfdb('0x77'),_0x1b6445[_0xdfdb('0x4b')][_0xdfdb('0x83')][_0xdfdb('0x76')]())[_0xdfdb('0x3d')](_0xdfdb('0x78'))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()['field'](_0xdfdb('0x68'))[_0xdfdb('0x74')](_0xdfdb('0x66'))[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']()))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x7b'))[_0xdfdb('0x74')]('cm_hopper_final')[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']())['where'](_0xdfdb('0x7d')))['group']('ContactId'))[_0xdfdb('0x76')]();return db[_0xdfdb('0x4e')]['query'](_0x158454);}return[];})['then'](respondWithResult(_0x36241c,null))[_0xdfdb('0x49')](handleError(_0x36241c,null));};exports[_0xdfdb('0x84')]=function(_0x1f87d3,_0x1bc293,_0x36b01e){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x1f87d3[_0xdfdb('0x4b')]['VoiceQueueId'],'CampaignId':_0x1f87d3[_0xdfdb('0x4b')][_0xdfdb('0x80')],'ContactId':_0x1f87d3[_0xdfdb('0x4b')]['ContactId']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x1bc293,null))[_0xdfdb('0x26')](function(_0x3e0208){if(_0x3e0208){return _0x3e0208;}return null;})[_0xdfdb('0x26')](respondWithResult(_0x1bc293,null))['catch'](handleError(_0x1bc293,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 35491d3..11a4ca9 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 _0x0d3a=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger'];(function(_0x37a4b9,_0x391bb8){var _0x3857e6=function(_0x5b79c2){while(--_0x5b79c2){_0x37a4b9['push'](_0x37a4b9['shift']());}};_0x3857e6(++_0x391bb8);}(_0x0d3a,0x1dd));var _0xa0d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0d3a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa0d3('0x0'));var util=require(_0xa0d3('0x1'));var logger=require(_0xa0d3('0x2'))(_0xa0d3('0x3'));var moment=require(_0xa0d3('0x4'));var BPromise=require(_0xa0d3('0x5'));var rp=require(_0xa0d3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0d3('0x7'));var config=require(_0xa0d3('0x8'));var attributes=require(_0xa0d3('0x9'));module[_0xa0d3('0xa')]=function(_0x166a10,_0x2bea85){return _0x166a10[_0xa0d3('0xb')](_0xa0d3('0xc'),attributes,{'tableName':_0xa0d3('0xd'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xa0d3('0xe')]},{'name':_0xa0d3('0xf'),'fields':[_0xa0d3('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6a5b=['path','rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','util','../../config/logger','api','bluebird','request-promise'];(function(_0x9a41d8,_0x17c3bb){var _0x2ce7ab=function(_0xc9eaed){while(--_0xc9eaed){_0x9a41d8['push'](_0x9a41d8['shift']());}};_0x2ce7ab(++_0x17c3bb);}(_0x6a5b,0xcb));var _0xb6a5=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x6a5b[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xb6a5('0x0'));var logger=require(_0xb6a5('0x1'))(_0xb6a5('0x2'));var moment=require('moment');var BPromise=require(_0xb6a5('0x3'));var rp=require(_0xb6a5('0x4'));var fs=require('fs');var path=require(_0xb6a5('0x5'));var rimraf=require(_0xb6a5('0x6'));var config=require('../../config/environment');var attributes=require(_0xb6a5('0x7'));module[_0xb6a5('0x8')]=function(_0x3cce3e,_0x190987){return _0x3cce3e[_0xb6a5('0x9')](_0xb6a5('0xa'),attributes,{'tableName':_0xb6a5('0xb'),'paranoid':![],'indexes':[{'name':_0xb6a5('0xc'),'fields':[_0xb6a5('0xc')]},{'name':'uniqueid','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 d09a510..1ba7742 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4ca265,_0x2073c7){var _0x421617=function(_0x46a9c1){while(--_0x46a9c1){_0x4ca265['push'](_0x4ca265['shift']());}};_0x421617(++_0x2073c7);}(_0x7a54,0x106));var _0x47a5=function(_0x4ee62b,_0x13df2b){_0x4ee62b=_0x4ee62b-0x0;var _0x18439c=_0x7a54[_0x4ee62b];return _0x18439c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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(_0x163aae,_0x10ee4a){var _0x53aabb=function(_0x54fd78){while(--_0x54fd78){_0x163aae['push'](_0x163aae['shift']());}};_0x53aabb(++_0x10ee4a);}(_0xb10b,0x12a));var _0xbb10=function(_0x29f31c,_0x46bbdf){_0x29f31c=_0x29f31c-0x0;var _0x3b6b8a=_0xb10b[_0x29f31c];return _0x3b6b8a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 508c8e9..798ba38 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 _0x35a5=['/checkContactHopper','checkContactHopper','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','/describe','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post'];(function(_0xe99eea,_0x1e22d1){var _0x2dd47b=function(_0xb68f86){while(--_0xb68f86){_0xe99eea['push'](_0xe99eea['shift']());}};_0x2dd47b(++_0x1e22d1);}(_0x35a5,0x1b7));var _0x535a=function(_0x562d47,_0x23d2c6){_0x562d47=_0x562d47-0x0;var _0x3e6d83=_0x35a5[_0x562d47];return _0x3e6d83;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x535a('0x0'));var express=require(_0x535a('0x1'));var router=express[_0x535a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x535a('0x3'));var interaction=require(_0x535a('0x4'));var config=require(_0x535a('0x5'));var controller=require(_0x535a('0x6'));router[_0x535a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x535a('0x8'),auth[_0x535a('0x9')](),controller[_0x535a('0xa')]);router['get'](_0x535a('0xb'),auth['isAuthenticated'](),controller[_0x535a('0xc')]);router['get'](_0x535a('0xd'),auth[_0x535a('0x9')](),controller[_0x535a('0xe')]);router[_0x535a('0x7')](_0x535a('0xf'),auth[_0x535a('0x9')](),controller[_0x535a('0x10')]);router['post'](_0x535a('0x11'),auth[_0x535a('0x9')](),controller[_0x535a('0x12')]);router['post'](_0x535a('0x13'),auth[_0x535a('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x535a('0x14')](_0x535a('0x15'),auth['isAuthenticated'](),controller[_0x535a('0x16')]);router['put'](_0x535a('0xb'),auth[_0x535a('0x9')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x7f68=['index','/describe','describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','exports','multer','util','express','Router','get','isAuthenticated'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7f68,0xb8));var _0x87f6=function(_0x32689c,_0x1e5ad2){_0x32689c=_0x32689c-0x0;var _0xce38dd=_0x7f68[_0x32689c];return _0xce38dd;};'use strict';var multer=require(_0x87f6('0x0'));var util=require(_0x87f6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x87f6('0x2'));var router=express[_0x87f6('0x3')]();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('./cmHopperFinal.controller');router[_0x87f6('0x4')]('/',auth[_0x87f6('0x5')](),controller[_0x87f6('0x6')]);router[_0x87f6('0x4')](_0x87f6('0x7'),auth['isAuthenticated'](),controller[_0x87f6('0x8')]);router[_0x87f6('0x4')](_0x87f6('0x9'),auth[_0x87f6('0x5')](),controller[_0x87f6('0xa')]);router[_0x87f6('0x4')]('/voice/queue/countAttributes/:id',auth[_0x87f6('0x5')](),controller[_0x87f6('0xb')]);router[_0x87f6('0x4')]('/campaign/countAttributes/:id',auth[_0x87f6('0x5')](),controller[_0x87f6('0xc')]);router['post'](_0x87f6('0xd'),auth['isAuthenticated'](),controller['moveContactsQueueCampaignHopperFinal']);router['post'](_0x87f6('0xe'),auth[_0x87f6('0x5')](),controller[_0x87f6('0xf')]);router['post']('/checkContactHopper',auth['isAuthenticated'](),controller[_0x87f6('0x10')]);router[_0x87f6('0x11')](_0x87f6('0x9'),auth[_0x87f6('0x5')](),controller['update']);module[_0x87f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 9de496e..98e155d 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 _0x870d=['DATE','BOOLEAN','exports','INTEGER','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x870d,0xde));var _0xd870=function(_0x2abea5,_0x4458ce){_0x2abea5=_0x2abea5-0x0;var _0x16f049=_0x870d[_0x2abea5];return _0x16f049;};'use strict';var Sequelize=require('sequelize');module[_0xd870('0x0')]={'state':{'type':Sequelize[_0xd870('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xd870('0x2')]},'scheduledat':{'type':Sequelize[_0xd870('0x3')]},'countbusyretry':{'type':Sequelize[_0xd870('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd870('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd870('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd870('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xd870('0x2')]},'originatecalleridname':{'type':Sequelize[_0xd870('0x2')]},'calleridnum':{'type':Sequelize[_0xd870('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd870('0x3')]},'responsetime':{'type':Sequelize[_0xd870('0x3')]},'answertime':{'type':Sequelize[_0xd870('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xd870('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd870('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd870('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd870('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd870('0x2')]},'campaign':{'type':Sequelize[_0xd870('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xd870('0x2')]},'amd':{'type':Sequelize[_0xd870('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd870('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd870('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd870('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xd870('0x3')]},'edited':{'type':Sequelize[_0xd870('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd870('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd870('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd870('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xd870('0x2')]}}; \ No newline at end of file +var _0x39dc=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x428f96,_0x308b86){var _0xbf969=function(_0x3c1aa1){while(--_0x3c1aa1){_0x428f96['push'](_0x428f96['shift']());}};_0xbf969(++_0x308b86);}(_0x39dc,0x1bc));var _0xc39d=function(_0x4c1732,_0x86ab68){_0x4c1732=_0x4c1732-0x0;var _0x42311b=_0x39dc[_0x4c1732];return _0x42311b;};'use strict';var Sequelize=require(_0xc39d('0x0'));module[_0xc39d('0x1')]={'state':{'type':Sequelize[_0xc39d('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc39d('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xc39d('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc39d('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc39d('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc39d('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xc39d('0x3')]},'originatecalleridname':{'type':Sequelize[_0xc39d('0x3')]},'calleridnum':{'type':Sequelize[_0xc39d('0x3')]},'calleridname':{'type':Sequelize[_0xc39d('0x3')]},'starttime':{'type':Sequelize[_0xc39d('0x4')]},'responsetime':{'type':Sequelize[_0xc39d('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xc39d('0x4')]},'endtime':{'type':Sequelize[_0xc39d('0x4')]},'ringtime':{'type':Sequelize[_0xc39d('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc39d('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc39d('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc39d('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc39d('0x3')]},'campaign':{'type':Sequelize[_0xc39d('0x3')]},'campaigntype':{'type':Sequelize[_0xc39d('0x3')]},'membername':{'type':Sequelize[_0xc39d('0x3')]},'reason':{'type':Sequelize[_0xc39d('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xc39d('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc39d('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc39d('0x4')]},'recallme':{'type':Sequelize[_0xc39d('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xc39d('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc39d('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc39d('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc39d('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xc39d('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index cd6da5f..1dc98ef 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 _0x6192=['query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','params','keys','find','create','body','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','destroy','then','sendStatus','error','stack','name','send','index','map','CmHopperHistory','fieldName','type','key'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6192,0x19e));var _0x2619=function(_0x3463c3,_0x257dd2){_0x3463c3=_0x3463c3-0x0;var _0x3f547b=_0x6192[_0x3463c3];return _0x3f547b;};'use strict';var emlformat=require(_0x2619('0x0'));var rimraf=require(_0x2619('0x1'));var zipdir=require(_0x2619('0x2'));var jsonpatch=require(_0x2619('0x3'));var rp=require(_0x2619('0x4'));var moment=require(_0x2619('0x5'));var BPromise=require(_0x2619('0x6'));var Mustache=require(_0x2619('0x7'));var util=require(_0x2619('0x8'));var path=require('path');var sox=require(_0x2619('0x9'));var csv=require(_0x2619('0xa'));var ejs=require(_0x2619('0xb'));var fs=require('fs');var fs_extra=require(_0x2619('0xc'));var _=require(_0x2619('0xd'));var squel=require(_0x2619('0xe'));var crypto=require('crypto');var jsforce=require(_0x2619('0xf'));var deskjs=require(_0x2619('0x10'));var toCsv=require(_0x2619('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2619('0x11'));var authService=require(_0x2619('0x12'));var qs=require(_0x2619('0x13'));var as=require(_0x2619('0x14'));var hardwareService=require(_0x2619('0x15'));var logger=require(_0x2619('0x16'))(_0x2619('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x482f77,_0x46557b){_0x46557b=_0x46557b||0xcc;return function(_0x502b74){if(_0x502b74){return _0x482f77['sendStatus'](_0x46557b);}return _0x482f77[_0x2619('0x18')](_0x46557b)[_0x2619('0x19')]();};}function respondWithResult(_0x600e77,_0x58a5ad){_0x58a5ad=_0x58a5ad||0xc8;return function(_0x26d143){if(_0x26d143){return _0x600e77['status'](_0x58a5ad)[_0x2619('0x1a')](_0x26d143);}};}function respondWithFilteredResult(_0x600896,_0x30f316){return function(_0x362f58){if(_0x362f58){var _0x17ebcd=typeof _0x30f316['offset']==='undefined'&&typeof _0x30f316[_0x2619('0x1b')]===_0x2619('0x1c');var _0x361716=_0x362f58[_0x2619('0x1d')];var _0x301091=_0x17ebcd?0x0:_0x30f316['offset'];var _0x57c0b4=_0x17ebcd?_0x362f58[_0x2619('0x1d')]:_0x30f316[_0x2619('0x1e')]+_0x30f316[_0x2619('0x1b')];var _0x1393f5;if(_0x57c0b4>=_0x361716){_0x57c0b4=_0x361716;_0x1393f5=0xc8;}else{_0x1393f5=0xce;}_0x600896[_0x2619('0x18')](_0x1393f5);return _0x600896[_0x2619('0x1f')](_0x2619('0x20'),_0x301091+'-'+_0x57c0b4+'/'+_0x361716)[_0x2619('0x1a')](_0x362f58);}return null;};}function patchUpdates(_0x2f6918){return function(_0x181bcd){try{jsonpatch[_0x2619('0x21')](_0x181bcd,_0x2f6918,!![]);}catch(_0x1b685f){return BPromise[_0x2619('0x22')](_0x1b685f);}return _0x181bcd['save']();};}function saveUpdates(_0x391ee9,_0x30d6cc){return function(_0x4f9777){if(_0x4f9777){return _0x4f9777['update'](_0x391ee9)['then'](function(_0x18053c){return _0x18053c;});}return null;};}function removeEntity(_0x2536a3,_0x5399a2){return function(_0x1915a2){if(_0x1915a2){return _0x1915a2[_0x2619('0x23')]()[_0x2619('0x24')](function(){_0x2536a3[_0x2619('0x18')](0xcc)[_0x2619('0x19')]();});}};}function handleEntityNotFound(_0x46a9e5,_0x3c41a4){return function(_0x50ba70){if(!_0x50ba70){_0x46a9e5[_0x2619('0x25')](0x194);}return _0x50ba70;};}function handleError(_0x462764,_0x18505b){_0x18505b=_0x18505b||0x1f4;return function(_0x3f2422){logger[_0x2619('0x26')](_0x3f2422[_0x2619('0x27')]);if(_0x3f2422[_0x2619('0x28')]){delete _0x3f2422[_0x2619('0x28')];}_0x462764['status'](_0x18505b)[_0x2619('0x29')](_0x3f2422);};}exports[_0x2619('0x2a')]=function(_0x345ede,_0x4c53fa){var _0x341759={},_0x44311f={},_0x4bf95e={'count':0x0,'rows':[]};var _0x2a8e26=_[_0x2619('0x2b')](db[_0x2619('0x2c')]['rawAttributes'],function(_0x247a0c){return{'name':_0x247a0c[_0x2619('0x2d')],'type':_0x247a0c[_0x2619('0x2e')][_0x2619('0x2f')]};});_0x44311f['model']=_[_0x2619('0x2b')](_0x2a8e26,'name');_0x44311f['query']=_['keys'](_0x345ede[_0x2619('0x30')]);_0x44311f[_0x2619('0x31')]=_['intersection'](_0x44311f[_0x2619('0x32')],_0x44311f[_0x2619('0x30')]);_0x341759[_0x2619('0x33')]=_[_0x2619('0x34')](_0x44311f[_0x2619('0x32')],qs[_0x2619('0x35')](_0x345ede[_0x2619('0x30')]['fields']));_0x341759['attributes']=_0x341759[_0x2619('0x33')][_0x2619('0x36')]?_0x341759['attributes']:_0x44311f[_0x2619('0x32')];if(!_0x345ede[_0x2619('0x30')]['hasOwnProperty'](_0x2619('0x37'))){_0x341759['limit']=qs['limit'](_0x345ede['query']['limit']);_0x341759[_0x2619('0x1e')]=qs[_0x2619('0x1e')](_0x345ede['query'][_0x2619('0x1e')]);}_0x341759[_0x2619('0x38')]=qs['sort'](_0x345ede[_0x2619('0x30')][_0x2619('0x39')]);_0x341759['where']=qs[_0x2619('0x31')](_[_0x2619('0x3a')](_0x345ede['query'],_0x44311f['filters']),_0x2a8e26);if(_0x345ede[_0x2619('0x30')][_0x2619('0x3b')]){_0x341759['where']=_[_0x2619('0x3c')](_0x341759['where'],{'$or':_['map'](_0x2a8e26,function(_0x3167cb){if(_0x3167cb['type']!==_0x2619('0x3d')){var _0x328435={};_0x328435[_0x3167cb[_0x2619('0x28')]]={'$like':'%'+_0x345ede[_0x2619('0x30')][_0x2619('0x3b')]+'%'};return _0x328435;}})});}_0x341759=_['merge']({},_0x341759,_0x345ede[_0x2619('0x3e')]);var _0x33efb2={'where':_0x341759[_0x2619('0x3f')]};return db[_0x2619('0x2c')]['count'](_0x33efb2)['then'](function(_0xf5b948){_0x4bf95e['count']=_0xf5b948;if(_0x345ede[_0x2619('0x30')][_0x2619('0x40')]){_0x341759[_0x2619('0x41')]=[{'all':!![]}];}return db[_0x2619('0x2c')][_0x2619('0x42')](_0x341759);})['then'](function(_0x47078b){_0x4bf95e[_0x2619('0x43')]=_0x47078b;return _0x4bf95e;})['then'](respondWithFilteredResult(_0x4c53fa,_0x341759))[_0x2619('0x44')](handleError(_0x4c53fa,null));};exports['show']=function(_0x18c724,_0x4e9a56){var _0x10b52d={'raw':!![],'where':{'id':_0x18c724[_0x2619('0x45')]['id']}},_0x3aca9e={};_0x3aca9e['model']=_[_0x2619('0x46')](db[_0x2619('0x2c')]['rawAttributes']);_0x3aca9e[_0x2619('0x30')]=_[_0x2619('0x46')](_0x18c724[_0x2619('0x30')]);_0x3aca9e[_0x2619('0x31')]=_[_0x2619('0x34')](_0x3aca9e[_0x2619('0x32')],_0x3aca9e[_0x2619('0x30')]);_0x10b52d[_0x2619('0x33')]=_['intersection'](_0x3aca9e[_0x2619('0x32')],qs[_0x2619('0x35')](_0x18c724['query']['fields']));_0x10b52d['attributes']=_0x10b52d[_0x2619('0x33')][_0x2619('0x36')]?_0x10b52d[_0x2619('0x33')]:_0x3aca9e[_0x2619('0x32')];if(_0x18c724[_0x2619('0x30')]['includeAll']){_0x10b52d[_0x2619('0x41')]=[{'all':!![]}];}_0x10b52d=_[_0x2619('0x3c')]({},_0x10b52d,_0x18c724[_0x2619('0x3e')]);return db[_0x2619('0x2c')][_0x2619('0x47')](_0x10b52d)['then'](handleEntityNotFound(_0x4e9a56,null))[_0x2619('0x24')](respondWithResult(_0x4e9a56,null))[_0x2619('0x44')](handleError(_0x4e9a56,null));};exports[_0x2619('0x48')]=function(_0x48890f,_0x21bcd5){return db[_0x2619('0x2c')]['create'](_0x48890f[_0x2619('0x49')],{})[_0x2619('0x24')](respondWithResult(_0x21bcd5,0xc9))[_0x2619('0x44')](handleError(_0x21bcd5,null));};exports['describe']=function(_0xcecfb8,_0xe3be20){return db[_0x2619('0x2c')][_0x2619('0x4a')]()['then'](respondWithResult(_0xe3be20,null))[_0x2619('0x44')](handleError(_0xe3be20,null));};exports[_0x2619('0x4b')]=function(_0x1c29b7,_0x29bfe3){if(_0x1c29b7['body'][_0x2619('0x4c')]){delete _0x1c29b7[_0x2619('0x49')][_0x2619('0x4c')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x1c29b7[_0x2619('0x45')]['id']}})[_0x2619('0x24')](handleEntityNotFound(_0x29bfe3,null))[_0x2619('0x24')](saveUpdates(_0x1c29b7[_0x2619('0x49')],null))[_0x2619('0x24')](respondWithResult(_0x29bfe3,null))[_0x2619('0x44')](handleError(_0x29bfe3,null));}; \ No newline at end of file +var _0x01e6=['findAll','show','params','length','options','find','catch','create','body','uniqueid','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','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','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','includeAll','include'];(function(_0x381ade,_0xfc1276){var _0x19a82e=function(_0x57969e){while(--_0x57969e){_0x381ade['push'](_0x381ade['shift']());}};_0x19a82e(++_0xfc1276);}(_0x01e6,0x132));var _0x601e=function(_0x222833,_0x5c7f2e){_0x222833=_0x222833-0x0;var _0x2e44e3=_0x01e6[_0x222833];return _0x2e44e3;};'use strict';var emlformat=require(_0x601e('0x0'));var rimraf=require(_0x601e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x601e('0x2'));var rp=require(_0x601e('0x3'));var moment=require('moment');var BPromise=require(_0x601e('0x4'));var Mustache=require(_0x601e('0x5'));var util=require(_0x601e('0x6'));var path=require('path');var sox=require(_0x601e('0x7'));var csv=require(_0x601e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x601e('0x9'));var squel=require('squel');var crypto=require(_0x601e('0xa'));var jsforce=require(_0x601e('0xb'));var deskjs=require(_0x601e('0xc'));var toCsv=require(_0x601e('0x8'));var querystring=require(_0x601e('0xd'));var Papa=require(_0x601e('0xe'));var Redis=require('ioredis');var authService=require(_0x601e('0xf'));var qs=require(_0x601e('0x10'));var as=require(_0x601e('0x11'));var hardwareService=require(_0x601e('0x12'));var logger=require(_0x601e('0x13'))('api');var utils=require(_0x601e('0x14'));var config=require(_0x601e('0x15'));var licenseUtil=require(_0x601e('0x16'));var db=require(_0x601e('0x17'))['db'];function respondWithStatusCode(_0x2206e7,_0x155402){_0x155402=_0x155402||0xcc;return function(_0x527a3a){if(_0x527a3a){return _0x2206e7[_0x601e('0x18')](_0x155402);}return _0x2206e7['status'](_0x155402)[_0x601e('0x19')]();};}function respondWithResult(_0x4aacfb,_0x4246cd){_0x4246cd=_0x4246cd||0xc8;return function(_0x462c2b){if(_0x462c2b){return _0x4aacfb[_0x601e('0x1a')](_0x4246cd)[_0x601e('0x1b')](_0x462c2b);}};}function respondWithFilteredResult(_0x29297e,_0x37bcb9){return function(_0x83d4c9){if(_0x83d4c9){var _0x1ee40a=typeof _0x37bcb9[_0x601e('0x1c')]==='undefined'&&typeof _0x37bcb9[_0x601e('0x1d')]===_0x601e('0x1e');var _0x526168=_0x83d4c9['count'];var _0x33d043=_0x1ee40a?0x0:_0x37bcb9[_0x601e('0x1c')];var _0x1898e5=_0x1ee40a?_0x83d4c9[_0x601e('0x1f')]:_0x37bcb9[_0x601e('0x1c')]+_0x37bcb9[_0x601e('0x1d')];var _0x4e6502;if(_0x1898e5>=_0x526168){_0x1898e5=_0x526168;_0x4e6502=0xc8;}else{_0x4e6502=0xce;}_0x29297e['status'](_0x4e6502);return _0x29297e[_0x601e('0x20')]('Content-Range',_0x33d043+'-'+_0x1898e5+'/'+_0x526168)['json'](_0x83d4c9);}return null;};}function patchUpdates(_0x582b7c){return function(_0x3e0cfc){try{jsonpatch[_0x601e('0x21')](_0x3e0cfc,_0x582b7c,!![]);}catch(_0x404c34){return BPromise[_0x601e('0x22')](_0x404c34);}return _0x3e0cfc[_0x601e('0x23')]();};}function saveUpdates(_0x3e9987,_0x1011f1){return function(_0xe074eb){if(_0xe074eb){return _0xe074eb[_0x601e('0x24')](_0x3e9987)[_0x601e('0x25')](function(_0x46ad86){return _0x46ad86;});}return null;};}function removeEntity(_0x56163f,_0x5431ea){return function(_0x3f22c2){if(_0x3f22c2){return _0x3f22c2['destroy']()[_0x601e('0x25')](function(){_0x56163f['status'](0xcc)[_0x601e('0x19')]();});}};}function handleEntityNotFound(_0x285548,_0x100f23){return function(_0x434820){if(!_0x434820){_0x285548[_0x601e('0x18')](0x194);}return _0x434820;};}function handleError(_0x2925cb,_0x412a29){_0x412a29=_0x412a29||0x1f4;return function(_0x2e21cc){logger[_0x601e('0x26')](_0x2e21cc[_0x601e('0x27')]);if(_0x2e21cc['name']){delete _0x2e21cc[_0x601e('0x28')];}_0x2925cb[_0x601e('0x1a')](_0x412a29)['send'](_0x2e21cc);};}exports[_0x601e('0x29')]=function(_0x3209f7,_0x5cc203){var _0x35bc7f={},_0x118aeb={},_0x5221cd={'count':0x0,'rows':[]};var _0x2357ce=_[_0x601e('0x2a')](db[_0x601e('0x2b')][_0x601e('0x2c')],function(_0x3ee27d){return{'name':_0x3ee27d[_0x601e('0x2d')],'type':_0x3ee27d[_0x601e('0x2e')][_0x601e('0x2f')]};});_0x118aeb['model']=_[_0x601e('0x2a')](_0x2357ce,_0x601e('0x28'));_0x118aeb[_0x601e('0x30')]=_[_0x601e('0x31')](_0x3209f7['query']);_0x118aeb[_0x601e('0x32')]=_[_0x601e('0x33')](_0x118aeb[_0x601e('0x34')],_0x118aeb[_0x601e('0x30')]);_0x35bc7f[_0x601e('0x35')]=_[_0x601e('0x33')](_0x118aeb[_0x601e('0x34')],qs[_0x601e('0x36')](_0x3209f7[_0x601e('0x30')]['fields']));_0x35bc7f[_0x601e('0x35')]=_0x35bc7f['attributes']['length']?_0x35bc7f[_0x601e('0x35')]:_0x118aeb[_0x601e('0x34')];if(!_0x3209f7[_0x601e('0x30')][_0x601e('0x37')](_0x601e('0x38'))){_0x35bc7f[_0x601e('0x1d')]=qs[_0x601e('0x1d')](_0x3209f7['query'][_0x601e('0x1d')]);_0x35bc7f[_0x601e('0x1c')]=qs[_0x601e('0x1c')](_0x3209f7[_0x601e('0x30')][_0x601e('0x1c')]);}_0x35bc7f['order']=qs[_0x601e('0x39')](_0x3209f7[_0x601e('0x30')][_0x601e('0x39')]);_0x35bc7f['where']=qs[_0x601e('0x32')](_[_0x601e('0x3a')](_0x3209f7[_0x601e('0x30')],_0x118aeb[_0x601e('0x32')]),_0x2357ce);if(_0x3209f7[_0x601e('0x30')][_0x601e('0x3b')]){_0x35bc7f[_0x601e('0x3c')]=_[_0x601e('0x3d')](_0x35bc7f[_0x601e('0x3c')],{'$or':_[_0x601e('0x2a')](_0x2357ce,function(_0x742881){if(_0x742881[_0x601e('0x2e')]!=='VIRTUAL'){var _0x725441={};_0x725441[_0x742881[_0x601e('0x28')]]={'$like':'%'+_0x3209f7[_0x601e('0x30')]['filter']+'%'};return _0x725441;}})});}_0x35bc7f=_['merge']({},_0x35bc7f,_0x3209f7['options']);var _0x1d4353={'where':_0x35bc7f['where']};return db[_0x601e('0x2b')][_0x601e('0x1f')](_0x1d4353)['then'](function(_0x7dc160){_0x5221cd[_0x601e('0x1f')]=_0x7dc160;if(_0x3209f7[_0x601e('0x30')][_0x601e('0x3e')]){_0x35bc7f[_0x601e('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x601e('0x40')](_0x35bc7f);})[_0x601e('0x25')](function(_0x41ca62){_0x5221cd['rows']=_0x41ca62;return _0x5221cd;})[_0x601e('0x25')](respondWithFilteredResult(_0x5cc203,_0x35bc7f))['catch'](handleError(_0x5cc203,null));};exports[_0x601e('0x41')]=function(_0x288a97,_0x5d2a82){var _0x576629={'raw':!![],'where':{'id':_0x288a97[_0x601e('0x42')]['id']}},_0x94ca84={};_0x94ca84['model']=_[_0x601e('0x31')](db[_0x601e('0x2b')][_0x601e('0x2c')]);_0x94ca84[_0x601e('0x30')]=_[_0x601e('0x31')](_0x288a97[_0x601e('0x30')]);_0x94ca84[_0x601e('0x32')]=_[_0x601e('0x33')](_0x94ca84[_0x601e('0x34')],_0x94ca84[_0x601e('0x30')]);_0x576629['attributes']=_[_0x601e('0x33')](_0x94ca84[_0x601e('0x34')],qs[_0x601e('0x36')](_0x288a97[_0x601e('0x30')][_0x601e('0x36')]));_0x576629[_0x601e('0x35')]=_0x576629[_0x601e('0x35')][_0x601e('0x43')]?_0x576629[_0x601e('0x35')]:_0x94ca84[_0x601e('0x34')];if(_0x288a97[_0x601e('0x30')]['includeAll']){_0x576629[_0x601e('0x3f')]=[{'all':!![]}];}_0x576629=_[_0x601e('0x3d')]({},_0x576629,_0x288a97[_0x601e('0x44')]);return db[_0x601e('0x2b')][_0x601e('0x45')](_0x576629)[_0x601e('0x25')](handleEntityNotFound(_0x5d2a82,null))['then'](respondWithResult(_0x5d2a82,null))[_0x601e('0x46')](handleError(_0x5d2a82,null));};exports[_0x601e('0x47')]=function(_0x3647ee,_0x19193d){return db[_0x601e('0x2b')]['create'](_0x3647ee[_0x601e('0x48')],{})['then'](respondWithResult(_0x19193d,0xc9))[_0x601e('0x46')](handleError(_0x19193d,null));};exports['describe']=function(_0x57f142,_0x154237){return db['CmHopperHistory']['describe']()['then'](respondWithResult(_0x154237,null))[_0x601e('0x46')](handleError(_0x154237,null));};exports[_0x601e('0x24')]=function(_0x170dd4,_0xe8a236){if(_0x170dd4[_0x601e('0x48')]['uniqueid']){delete _0x170dd4[_0x601e('0x48')][_0x601e('0x49')];}return db[_0x601e('0x2b')][_0x601e('0x45')]({'where':{'uniqueid':_0x170dd4[_0x601e('0x42')]['id']}})[_0x601e('0x25')](handleEntityNotFound(_0xe8a236,null))[_0x601e('0x25')](saveUpdates(_0x170dd4[_0x601e('0x48')],null))['then'](respondWithResult(_0xe8a236,null))[_0x601e('0x46')](handleError(_0xe8a236,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 471b436..d5bf550 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 _0x23bb=['rimraf','../../config/environment','endtime','uniqueid','lodash','api','moment','bluebird','path'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x23bb,0x79));var _0xb23b=function(_0x35bdcf,_0x21421c){_0x35bdcf=_0x35bdcf-0x0;var _0x5a4fc7=_0x23bb[_0x35bdcf];return _0x5a4fc7;};'use strict';var _=require(_0xb23b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb23b('0x1'));var moment=require(_0xb23b('0x2'));var BPromise=require(_0xb23b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb23b('0x4'));var rimraf=require(_0xb23b('0x5'));var config=require(_0xb23b('0x6'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x50f8a8,_0x306f8b){return _0x50f8a8['define']('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xb23b('0x7'),'fields':['endtime']},{'name':_0xb23b('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x955f=['util','../../config/logger','api','moment','request-promise','../../config/environment','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0xe6506f,_0x583a42){var _0x37e468=function(_0x1c37ca){while(--_0x1c37ca){_0xe6506f['push'](_0xe6506f['shift']());}};_0x37e468(++_0x583a42);}(_0x955f,0x1eb));var _0xf955=function(_0x5b6e24,_0x18a03f){_0x5b6e24=_0x5b6e24-0x0;var _0x40ab74=_0x955f[_0x5b6e24];return _0x40ab74;};'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('./cmHopperHistory.attributes');module[_0xf955('0x7')]=function(_0x2caff2,_0x3fdac2){return _0x2caff2['define'](_0xf955('0x8'),attributes,{'tableName':_0xf955('0x9'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xf955('0xa')]},{'name':_0xf955('0xb'),'fields':[_0xf955('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 8e707da..b48a5c4 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 _0xfc03=['`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','col','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','stringify','AvgHandleTime','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','campaign','name','outboundNoSuchCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay'];(function(_0x128260,_0x5c0ca1){var _0x19b4da=function(_0x6795a4){while(--_0x6795a4){_0x128260['push'](_0x128260['shift']());}};_0x19b4da(++_0x5c0ca1);}(_0xfc03,0x16f));var _0x3fc0=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xfc03[_0x47fd36];return _0x21a0fc;};'use strict';var _=require(_0x3fc0('0x0'));var util=require('util');var moment=require(_0x3fc0('0x1'));var BPromise=require(_0x3fc0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fc0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3fc0('0x4'));var logger=require(_0x3fc0('0x5'))(_0x3fc0('0x6'));var config=require(_0x3fc0('0x7'));var jayson=require(_0x3fc0('0x8'));var client=jayson[_0x3fc0('0x9')][_0x3fc0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeeb912,_0x55eac5,_0x2fb1a6){return new BPromise(function(_0x5f52b5,_0x1369ac){return client[_0x3fc0('0xb')](_0xeeb912,_0x2fb1a6)[_0x3fc0('0xc')](function(_0x392999){logger['info'](_0x3fc0('0xd'),_0x55eac5,_0x3fc0('0xe'));logger[_0x3fc0('0xf')](_0x3fc0('0x10'),_0x55eac5,_0x3fc0('0xe'),JSON['stringify'](_0x392999));if(_0x392999[_0x3fc0('0x11')]){if(_0x392999[_0x3fc0('0x11')][_0x3fc0('0x12')]===0x1f4){logger['error'](_0x3fc0('0xd'),_0x55eac5,_0x392999['error'][_0x3fc0('0x13')]);return _0x1369ac(_0x392999[_0x3fc0('0x11')]['message']);}logger[_0x3fc0('0x11')](_0x3fc0('0xd'),_0x55eac5,_0x392999[_0x3fc0('0x11')]['message']);return _0x5f52b5(_0x392999[_0x3fc0('0x11')][_0x3fc0('0x13')]);}else{logger[_0x3fc0('0x14')](_0x3fc0('0xd'),_0x55eac5,'request\x20sent');_0x5f52b5(_0x392999[_0x3fc0('0x15')][_0x3fc0('0x13')]);}})[_0x3fc0('0x16')](function(_0x5b59f1){logger[_0x3fc0('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x55eac5,_0x5b59f1);_0x1369ac(_0x5b59f1);});});}exports[_0x3fc0('0x17')]=function(_0x3c5026){var _0x4b947c=this;return new Promise(function(_0x3bb388,_0x33ffbc){return db[_0x3fc0('0x18')][_0x3fc0('0x19')](_0x3c5026[_0x3fc0('0x1a')],{'raw':_0x3c5026[_0x3fc0('0x1b')]?_0x3c5026[_0x3fc0('0x1b')][_0x3fc0('0x1c')]===undefined?!![]:![]:!![]})[_0x3fc0('0xc')](function(_0x5c859e){logger[_0x3fc0('0x14')](_0x3fc0('0x17'),_0x3c5026);logger[_0x3fc0('0xf')](_0x3fc0('0x17'),_0x3c5026,JSON[_0x3fc0('0x1d')](_0x5c859e));_0x3bb388(_0x5c859e);})[_0x3fc0('0x16')](function(_0x47c770){logger[_0x3fc0('0x11')](_0x3fc0('0x17'),_0x47c770[_0x3fc0('0x13')],_0x3c5026);_0x33ffbc(_0x4b947c[_0x3fc0('0x11')](0x1f4,_0x47c770[_0x3fc0('0x13')]));});});};exports[_0x3fc0('0x1e')]=function(_0x2f423e){var _0x31743e=this;return new Promise(function(_0x3698ca,_0x35a3e2){return db[_0x3fc0('0x18')][_0x3fc0('0x1f')]({'raw':_0x2f423e[_0x3fc0('0x1b')]?_0x2f423e[_0x3fc0('0x1b')][_0x3fc0('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f423e[_0x3fc0('0x1b')]?_0x2f423e['options'][_0x3fc0('0x20')]||null:null,'attributes':[[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db[_0x3fc0('0x21')]['col']('id')),_0x3fc0('0x23')],[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db[_0x3fc0('0x21')]['fn']('IF',db['sequelize'][_0x3fc0('0x24')](_0x3fc0('0x25')))),_0x3fc0('0x26')],[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db[_0x3fc0('0x21')]['fn']('IF',db['sequelize'][_0x3fc0('0x24')](_0x3fc0('0x27')))),_0x3fc0('0x28')],[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db[_0x3fc0('0x21')]['fn']('IF',db[_0x3fc0('0x21')][_0x3fc0('0x24')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x3fc0('0x21')]['fn']('AVG',db[_0x3fc0('0x21')]['fn']('IF',db[_0x3fc0('0x21')][_0x3fc0('0x24')](_0x3fc0('0x29')))),_0x3fc0('0x2a')],[db['sequelize']['fn']('AVG',db[_0x3fc0('0x21')]['fn']('IF',db[_0x3fc0('0x21')][_0x3fc0('0x24')](_0x3fc0('0x2b')))),_0x3fc0('0x2c')]]})['then'](function(_0xe1279a){logger[_0x3fc0('0x14')](_0x3fc0('0x1e'),_0x2f423e);logger['debug'](_0x3fc0('0x1e'),_0x2f423e,JSON[_0x3fc0('0x1d')](_0xe1279a));_0x3698ca(_0xe1279a);})[_0x3fc0('0x16')](function(_0x2eee6e){logger['error'](_0x3fc0('0x1e'),_0x2eee6e[_0x3fc0('0x13')],_0x2f423e);_0x35a3e2(_0x31743e['error'](0x1f4,_0x2eee6e[_0x3fc0('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x3fb78e){var _0x193f74=this;return new Promise(function(_0xc97121,_0x2db02e){return db[_0x3fc0('0x18')][_0x3fc0('0x1f')]({'raw':_0x3fb78e[_0x3fc0('0x1b')]?_0x3fb78e[_0x3fc0('0x1b')][_0x3fc0('0x1c')]===undefined?!![]:![]:!![],'where':_0x3fb78e[_0x3fc0('0x1b')]?_0x3fb78e[_0x3fc0('0x1b')]['where']||null:null,'attributes':[[_0x3fc0('0x2d'),_0x3fc0('0x2e')],[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db[_0x3fc0('0x21')]['fn']('IF',db[_0x3fc0('0x21')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x3fc0('0x2f')],[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db[_0x3fc0('0x21')]['fn']('IF',db[_0x3fc0('0x21')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db[_0x3fc0('0x21')]['fn']('IF',db['sequelize']['literal'](_0x3fc0('0x25')))),_0x3fc0('0x30')],[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x3fc0('0x24')](_0x3fc0('0x31')))),'outboundBusyCallsDay'],[db[_0x3fc0('0x21')]['fn']('COUNT',db[_0x3fc0('0x21')]['fn']('IF',db[_0x3fc0('0x21')][_0x3fc0('0x24')](_0x3fc0('0x32')))),_0x3fc0('0x33')],[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db[_0x3fc0('0x21')]['fn']('IF',db['sequelize'][_0x3fc0('0x24')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x3fc0('0x34')],[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db[_0x3fc0('0x21')]['fn']('IF',db[_0x3fc0('0x21')]['literal'](_0x3fc0('0x35')))),_0x3fc0('0x36')],[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db['sequelize']['fn']('IF',db[_0x3fc0('0x21')]['literal'](_0x3fc0('0x37')))),_0x3fc0('0x38')],[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db[_0x3fc0('0x21')]['fn']('IF',db['sequelize'][_0x3fc0('0x24')](_0x3fc0('0x39')))),_0x3fc0('0x3a')],[db['sequelize']['fn'](_0x3fc0('0x22'),db[_0x3fc0('0x21')]['fn']('IF',db['sequelize'][_0x3fc0('0x24')](_0x3fc0('0x3b')))),_0x3fc0('0x3c')],[db['sequelize']['fn']('COUNT',db[_0x3fc0('0x21')]['fn']('IF',db[_0x3fc0('0x21')][_0x3fc0('0x24')]('`state`\x20=\x2018,\x201,\x20null'))),_0x3fc0('0x3d')],[db['sequelize']['fn'](_0x3fc0('0x22'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3fc0('0x3e')))),_0x3fc0('0x3f')],[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db[_0x3fc0('0x21')]['fn']('IF',db[_0x3fc0('0x21')]['literal'](_0x3fc0('0x40')))),_0x3fc0('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x3fc0('0x21')]['fn']('IF',db[_0x3fc0('0x21')][_0x3fc0('0x24')](_0x3fc0('0x41')))),_0x3fc0('0x42')]],'group':[_0x3fc0('0x2d')]})[_0x3fc0('0xc')](function(_0x2da185){logger[_0x3fc0('0x14')](_0x3fc0('0x43'),_0x3fb78e);logger[_0x3fc0('0xf')](_0x3fc0('0x43'),_0x3fb78e,JSON['stringify'](_0x2da185));_0xc97121(_0x2da185);})[_0x3fc0('0x16')](function(_0xda5d3e){logger[_0x3fc0('0x11')](_0x3fc0('0x43'),_0xda5d3e[_0x3fc0('0x13')],_0x3fb78e);_0x2db02e(_0x193f74['error'](0x1f4,_0xda5d3e[_0x3fc0('0x13')]));});});};exports['GetCampaignHopperHistory']=function(_0xe1d933){var _0xa4864f=this;return new Promise(function(_0x397434,_0x10c05b){return db['CmHopperHistory'][_0x3fc0('0x1f')]({'raw':_0xe1d933[_0x3fc0('0x1b')]?_0xe1d933[_0x3fc0('0x1b')][_0x3fc0('0x1c')]===undefined?!![]:![]:!![],'where':_0xe1d933[_0x3fc0('0x1b')]?_0xe1d933[_0x3fc0('0x1b')]['where']||null:null,'attributes':[[_0x3fc0('0x2d'),_0x3fc0('0x2e')],[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db[_0x3fc0('0x21')][_0x3fc0('0x44')]('id')),'ivrTotalCallsDays'],[db[_0x3fc0('0x21')]['fn'](_0x3fc0('0x22'),db[_0x3fc0('0x21')]['fn']('IF',db['sequelize'][_0x3fc0('0x24')](_0x3fc0('0x25')))),_0x3fc0('0x45')]],'group':[_0x3fc0('0x2d')]})[_0x3fc0('0xc')](function(_0x30bd70){logger[_0x3fc0('0x14')](_0x3fc0('0x46'),_0xe1d933);logger[_0x3fc0('0xf')](_0x3fc0('0x46'),_0xe1d933,JSON[_0x3fc0('0x1d')](_0x30bd70));_0x397434(_0x30bd70);})[_0x3fc0('0x16')](function(_0x16419){logger[_0x3fc0('0x11')](_0x3fc0('0x46'),_0x16419['message'],_0xe1d933);_0x10c05b(_0xa4864f[_0x3fc0('0x11')](0x1f4,_0x16419[_0x3fc0('0x13')]));});});}; \ No newline at end of file +var _0x5455=['`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','result','CreateCmHopperHistory','CmHopperHistory','body','options','catch','AvgHandleTime','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','literal','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG'];(function(_0x35dcb3,_0x468f08){var _0xd36d40=function(_0x2fb354){while(--_0x2fb354){_0x35dcb3['push'](_0x35dcb3['shift']());}};_0xd36d40(++_0x468f08);}(_0x5455,0x17b));var _0x5545=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5455[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x5545('0x0'));var moment=require('moment');var BPromise=require(_0x5545('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5545('0x2'));var db=require(_0x5545('0x3'))['db'];var utils=require(_0x5545('0x4'));var logger=require(_0x5545('0x5'))(_0x5545('0x6'));var config=require(_0x5545('0x7'));var jayson=require(_0x5545('0x8'));var client=jayson['client'][_0x5545('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e8e53,_0x2e2463,_0x454dab){return new BPromise(function(_0x5eebb9,_0x2bf1a1){return client[_0x5545('0xa')](_0x1e8e53,_0x454dab)[_0x5545('0xb')](function(_0x27d8e3){logger[_0x5545('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x2e2463,_0x5545('0xd'));logger[_0x5545('0xe')](_0x5545('0xf'),_0x2e2463,_0x5545('0xd'),JSON[_0x5545('0x10')](_0x27d8e3));if(_0x27d8e3[_0x5545('0x11')]){if(_0x27d8e3['error']['code']===0x1f4){logger[_0x5545('0x11')](_0x5545('0x12'),_0x2e2463,_0x27d8e3[_0x5545('0x11')][_0x5545('0x13')]);return _0x2bf1a1(_0x27d8e3[_0x5545('0x11')][_0x5545('0x13')]);}logger[_0x5545('0x11')](_0x5545('0x12'),_0x2e2463,_0x27d8e3[_0x5545('0x11')][_0x5545('0x13')]);return _0x5eebb9(_0x27d8e3[_0x5545('0x11')]['message']);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x2e2463,_0x5545('0xd'));_0x5eebb9(_0x27d8e3[_0x5545('0x14')][_0x5545('0x13')]);}})['catch'](function(_0x4809df){logger[_0x5545('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x2e2463,_0x4809df);_0x2bf1a1(_0x4809df);});});}exports[_0x5545('0x15')]=function(_0x291ed4){var _0x39e0cf=this;return new Promise(function(_0xa9cb09,_0x3ed189){return db[_0x5545('0x16')]['create'](_0x291ed4[_0x5545('0x17')],{'raw':_0x291ed4[_0x5545('0x18')]?_0x291ed4[_0x5545('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3aada0){logger[_0x5545('0xc')](_0x5545('0x15'),_0x291ed4);logger[_0x5545('0xe')](_0x5545('0x15'),_0x291ed4,JSON[_0x5545('0x10')](_0x3aada0));_0xa9cb09(_0x3aada0);})[_0x5545('0x19')](function(_0x456398){logger[_0x5545('0x11')]('CreateCmHopperHistory',_0x456398[_0x5545('0x13')],_0x291ed4);_0x3ed189(_0x39e0cf[_0x5545('0x11')](0x1f4,_0x456398[_0x5545('0x13')]));});});};exports[_0x5545('0x1a')]=function(_0x4e2f3f){var _0x3c9dd9=this;return new Promise(function(_0x491e83,_0x194b86){return db[_0x5545('0x16')][_0x5545('0x1b')]({'raw':_0x4e2f3f['options']?_0x4e2f3f[_0x5545('0x18')][_0x5545('0x1c')]===undefined?!![]:![]:!![],'where':_0x4e2f3f[_0x5545('0x18')]?_0x4e2f3f[_0x5545('0x18')][_0x5545('0x1d')]||null:null,'attributes':[[db[_0x5545('0x1e')]['fn'](_0x5545('0x1f'),db[_0x5545('0x1e')][_0x5545('0x20')]('id')),_0x5545('0x21')],[db[_0x5545('0x1e')]['fn'](_0x5545('0x1f'),db[_0x5545('0x1e')]['fn']('IF',db[_0x5545('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x5545('0x22')],[db['sequelize']['fn'](_0x5545('0x1f'),db['sequelize']['fn']('IF',db[_0x5545('0x1e')]['literal'](_0x5545('0x23')))),_0x5545('0x24')],[db[_0x5545('0x1e')]['fn'](_0x5545('0x1f'),db[_0x5545('0x1e')]['fn']('IF',db['sequelize'][_0x5545('0x25')](_0x5545('0x26')))),_0x5545('0x27')],[db['sequelize']['fn'](_0x5545('0x28'),db[_0x5545('0x1e')]['fn']('IF',db['sequelize'][_0x5545('0x25')](_0x5545('0x29')))),_0x5545('0x2a')],[db[_0x5545('0x1e')]['fn'](_0x5545('0x28'),db[_0x5545('0x1e')]['fn']('IF',db[_0x5545('0x1e')]['literal'](_0x5545('0x2b')))),_0x5545('0x2c')]]})[_0x5545('0xb')](function(_0x31cb6c){logger[_0x5545('0xc')](_0x5545('0x1a'),_0x4e2f3f);logger[_0x5545('0xe')](_0x5545('0x1a'),_0x4e2f3f,JSON[_0x5545('0x10')](_0x31cb6c));_0x491e83(_0x31cb6c);})[_0x5545('0x19')](function(_0x1fd338){logger[_0x5545('0x11')](_0x5545('0x1a'),_0x1fd338['message'],_0x4e2f3f);_0x194b86(_0x3c9dd9['error'](0x1f4,_0x1fd338[_0x5545('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x22b5e4){var _0x3acc32=this;return new Promise(function(_0x30e1c4,_0x17ca30){return db['CmHopperHistory'][_0x5545('0x1b')]({'raw':_0x22b5e4['options']?_0x22b5e4[_0x5545('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x22b5e4['options']?_0x22b5e4['options'][_0x5545('0x1d')]||null:null,'attributes':[[_0x5545('0x2d'),_0x5545('0x2e')],[db['sequelize']['fn']('COUNT',db[_0x5545('0x1e')]['fn']('IF',db[_0x5545('0x1e')][_0x5545('0x25')](_0x5545('0x2f')))),_0x5545('0x30')],[db[_0x5545('0x1e')]['fn'](_0x5545('0x1f'),db[_0x5545('0x1e')]['fn']('IF',db[_0x5545('0x1e')][_0x5545('0x25')]('`state`\x20=\x203,\x201,\x20null'))),_0x5545('0x31')],[db['sequelize']['fn'](_0x5545('0x1f'),db[_0x5545('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x5545('0x32')))),'outboundAnswerCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x5545('0x1e')]['fn']('IF',db[_0x5545('0x1e')][_0x5545('0x25')](_0x5545('0x33')))),'outboundBusyCallsDay'],[db[_0x5545('0x1e')]['fn'](_0x5545('0x1f'),db[_0x5545('0x1e')]['fn']('IF',db[_0x5545('0x1e')][_0x5545('0x25')](_0x5545('0x34')))),_0x5545('0x35')],[db[_0x5545('0x1e')]['fn']('COUNT',db[_0x5545('0x1e')]['fn']('IF',db[_0x5545('0x1e')][_0x5545('0x25')](_0x5545('0x36')))),_0x5545('0x37')],[db[_0x5545('0x1e')]['fn'](_0x5545('0x1f'),db[_0x5545('0x1e')]['fn']('IF',db[_0x5545('0x1e')][_0x5545('0x25')](_0x5545('0x38')))),_0x5545('0x39')],[db['sequelize']['fn'](_0x5545('0x1f'),db[_0x5545('0x1e')]['fn']('IF',db[_0x5545('0x1e')][_0x5545('0x25')]('`state`\x20=\x2012,\x201,\x20null'))),_0x5545('0x3a')],[db[_0x5545('0x1e')]['fn'](_0x5545('0x1f'),db[_0x5545('0x1e')]['fn']('IF',db[_0x5545('0x1e')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x5545('0x3b')],[db[_0x5545('0x1e')]['fn'](_0x5545('0x1f'),db['sequelize']['fn']('IF',db[_0x5545('0x1e')][_0x5545('0x25')](_0x5545('0x3c')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0x5545('0x1f'),db[_0x5545('0x1e')]['fn']('IF',db[_0x5545('0x1e')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),_0x5545('0x3d')],[db[_0x5545('0x1e')]['fn'](_0x5545('0x1f'),db[_0x5545('0x1e')]['fn']('IF',db[_0x5545('0x1e')][_0x5545('0x25')](_0x5545('0x3e')))),_0x5545('0x3f')],[db[_0x5545('0x1e')]['fn'](_0x5545('0x1f'),db[_0x5545('0x1e')]['fn']('IF',db[_0x5545('0x1e')][_0x5545('0x25')]('`state`\x20=\x2020,\x201,\x20null'))),_0x5545('0x3d')],[db[_0x5545('0x1e')]['fn'](_0x5545('0x1f'),db['sequelize']['fn']('IF',db[_0x5545('0x1e')][_0x5545('0x25')](_0x5545('0x40')))),_0x5545('0x41')]],'group':[_0x5545('0x2d')]})[_0x5545('0xb')](function(_0x23cbcb){logger['info']('GetVoiceQueueHopperHistory',_0x22b5e4);logger[_0x5545('0xe')](_0x5545('0x42'),_0x22b5e4,JSON[_0x5545('0x10')](_0x23cbcb));_0x30e1c4(_0x23cbcb);})[_0x5545('0x19')](function(_0x2286f7){logger['error'](_0x5545('0x42'),_0x2286f7[_0x5545('0x13')],_0x22b5e4);_0x17ca30(_0x3acc32[_0x5545('0x11')](0x1f4,_0x2286f7[_0x5545('0x13')]));});});};exports[_0x5545('0x43')]=function(_0x1025e1){var _0x33ca2c=this;return new Promise(function(_0x1bda53,_0x5d3880){return db[_0x5545('0x16')][_0x5545('0x1b')]({'raw':_0x1025e1[_0x5545('0x18')]?_0x1025e1[_0x5545('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1025e1[_0x5545('0x18')]?_0x1025e1[_0x5545('0x18')]['where']||null:null,'attributes':[[_0x5545('0x2d'),'name'],[db[_0x5545('0x1e')]['fn'](_0x5545('0x1f'),db[_0x5545('0x1e')][_0x5545('0x20')]('id')),_0x5545('0x44')],[db[_0x5545('0x1e')]['fn'](_0x5545('0x1f'),db[_0x5545('0x1e')]['fn']('IF',db['sequelize'][_0x5545('0x25')](_0x5545('0x32')))),_0x5545('0x45')]],'group':['campaign']})[_0x5545('0xb')](function(_0x27ff16){logger[_0x5545('0xc')](_0x5545('0x43'),_0x1025e1);logger[_0x5545('0xe')](_0x5545('0x43'),_0x1025e1,JSON['stringify'](_0x27ff16));_0x1bda53(_0x27ff16);})[_0x5545('0x19')](function(_0x1faac9){logger[_0x5545('0x11')](_0x5545('0x43'),_0x1faac9[_0x5545('0x13')],_0x1025e1);_0x5d3880(_0x33ca2c[_0x5545('0x11')](0x1f4,_0x1faac9[_0x5545('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 0806f43..ecc9ea1 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 _0x37da=['path','express','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','exports','multer'];(function(_0x28dd1a,_0x48ecb3){var _0x18d911=function(_0x22c789){while(--_0x22c789){_0x28dd1a['push'](_0x28dd1a['shift']());}};_0x18d911(++_0x48ecb3);}(_0x37da,0x7d));var _0xa37d=function(_0x1e83bf,_0x545da8){_0x1e83bf=_0x1e83bf-0x0;var _0x4b78c8=_0x37da[_0x1e83bf];return _0x4b78c8;};'use strict';var multer=require(_0xa37d('0x0'));var util=require('util');var path=require(_0xa37d('0x1'));var timeout=require('connect-timeout');var express=require(_0xa37d('0x2'));var router=express[_0xa37d('0x3')]();var fs_extra=require(_0xa37d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa37d('0x5'));var controller=require(_0xa37d('0x6'));router['get']('/',auth[_0xa37d('0x7')](),controller[_0xa37d('0x8')]);router[_0xa37d('0x9')]('/describe',auth[_0xa37d('0x7')](),controller[_0xa37d('0xa')]);router[_0xa37d('0x9')](_0xa37d('0xb'),auth[_0xa37d('0x7')](),controller[_0xa37d('0xc')]);router[_0xa37d('0xd')]('/',auth['isAuthenticated'](),controller[_0xa37d('0xe')]);router[_0xa37d('0xf')](_0xa37d('0xb'),auth[_0xa37d('0x7')](),controller[_0xa37d('0x10')]);module[_0xa37d('0x11')]=router; \ No newline at end of file +var _0x22c0=['../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x2bc1fe,_0x45da98){var _0x1a47a5=function(_0x2e5053){while(--_0x2e5053){_0x2bc1fe['push'](_0x2bc1fe['shift']());}};_0x1a47a5(++_0x45da98);}(_0x22c0,0x199));var _0x022c=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x22c0[_0xc67528];return _0x38e26d;};'use strict';var multer=require(_0x022c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x022c('0x1'));var express=require(_0x022c('0x2'));var router=express[_0x022c('0x3')]();var fs_extra=require(_0x022c('0x4'));var auth=require(_0x022c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x022c('0x6'));var controller=require(_0x022c('0x7'));router[_0x022c('0x8')]('/',auth[_0x022c('0x9')](),controller[_0x022c('0xa')]);router['get']('/describe',auth[_0x022c('0x9')](),controller['describe']);router[_0x022c('0x8')](_0x022c('0xb'),auth[_0x022c('0x9')](),controller[_0x022c('0xc')]);router[_0x022c('0xd')]('/',auth[_0x022c('0x9')](),controller[_0x022c('0xe')]);router[_0x022c('0xf')](_0x022c('0xb'),auth[_0x022c('0x9')](),controller[_0x022c('0x10')]);module[_0x022c('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index d578260..c5e244c 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 _0x05bc=['exports','name','STRING'];(function(_0x5c6272,_0xd82df5){var _0x19c236=function(_0x332352){while(--_0x332352){_0x5c6272['push'](_0x5c6272['shift']());}};_0x19c236(++_0xd82df5);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xc05b('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xc05b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc05b('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8ef6=['STRING','name','sequelize','exports'];(function(_0x1f1bbc,_0x40ca9b){var _0x3f9d0d=function(_0x33f1a8){while(--_0x33f1a8){_0x1f1bbc['push'](_0x1f1bbc['shift']());}};_0x3f9d0d(++_0x40ca9b);}(_0x8ef6,0xf2));var _0x68ef=function(_0x24f64a,_0x5632f6){_0x24f64a=_0x24f64a-0x0;var _0x305ca1=_0x8ef6[_0x24f64a];return _0x305ca1;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'unique':_0x68ef('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x68ef('0x2')]},'dialPrefix':{'type':Sequelize[_0x68ef('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index e344246..a1db915 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 _0xce84=['userProfileId','autoAssociation','describe','ListId','Disposition','getDispositions','findOne','hasOwnProperty','findAll','removeDispositions','ids','isArray','tags','push','each','CmContact','omit','dataValues','message','getContacts','CustomFields','format','cf_%d','raw','getContactsCsv','concat','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','CmCustomField','addCustomFields','Sequelize','TEXT','text','number','INTEGER','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','destroy','then','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','rows','catch','params','includeAll','include','options','find','create','body','user','get','role','Lists','UserProfileSection'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xce84,0xc9));var _0x4ce8=function(_0xcc6637,_0x296e69){_0xcc6637=_0xcc6637-0x0;var _0x5ed786=_0xce84[_0xcc6637];return _0x5ed786;};'use strict';var emlformat=require(_0x4ce8('0x0'));var rimraf=require(_0x4ce8('0x1'));var zipdir=require(_0x4ce8('0x2'));var jsonpatch=require(_0x4ce8('0x3'));var rp=require(_0x4ce8('0x4'));var moment=require(_0x4ce8('0x5'));var BPromise=require(_0x4ce8('0x6'));var Mustache=require(_0x4ce8('0x7'));var util=require(_0x4ce8('0x8'));var path=require('path');var sox=require(_0x4ce8('0x9'));var csv=require(_0x4ce8('0xa'));var ejs=require(_0x4ce8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ce8('0xc'));var squel=require(_0x4ce8('0xd'));var crypto=require(_0x4ce8('0xe'));var jsforce=require(_0x4ce8('0xf'));var deskjs=require(_0x4ce8('0x10'));var toCsv=require(_0x4ce8('0xa'));var querystring=require('querystring');var Papa=require(_0x4ce8('0x11'));var Redis=require('ioredis');var authService=require(_0x4ce8('0x12'));var qs=require(_0x4ce8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ce8('0x14'));var logger=require(_0x4ce8('0x15'))('api');var utils=require(_0x4ce8('0x16'));var config=require(_0x4ce8('0x17'));var licenseUtil=require(_0x4ce8('0x18'));var db=require('../../mysqldb')['db'];config[_0x4ce8('0x19')]=_[_0x4ce8('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4ce8('0x1b'))(new Redis(config[_0x4ce8('0x19')]));require('./cmList.socket')[_0x4ce8('0x1c')](socket);function respondWithStatusCode(_0x37aede,_0x2a553d){_0x2a553d=_0x2a553d||0xcc;return function(_0x47ed4e){if(_0x47ed4e){return _0x37aede[_0x4ce8('0x1d')](_0x2a553d);}return _0x37aede[_0x4ce8('0x1e')](_0x2a553d)[_0x4ce8('0x1f')]();};}function respondWithResult(_0x35af09,_0x46d453){_0x46d453=_0x46d453||0xc8;return function(_0x5aceab){if(_0x5aceab){return _0x35af09['status'](_0x46d453)[_0x4ce8('0x20')](_0x5aceab);}};}function respondWithFilteredResult(_0x1671bd,_0x1b0ae7){return function(_0x291c6a){if(_0x291c6a){var _0x42fb97=typeof _0x1b0ae7[_0x4ce8('0x21')]==='undefined'&&typeof _0x1b0ae7[_0x4ce8('0x22')]===_0x4ce8('0x23');var _0x42fefc=_0x291c6a[_0x4ce8('0x24')];var _0x241ca0=_0x42fb97?0x0:_0x1b0ae7['offset'];var _0x17da54=_0x42fb97?_0x291c6a[_0x4ce8('0x24')]:_0x1b0ae7['offset']+_0x1b0ae7['limit'];var _0x1e11ba;if(_0x17da54>=_0x42fefc){_0x17da54=_0x42fefc;_0x1e11ba=0xc8;}else{_0x1e11ba=0xce;}_0x1671bd[_0x4ce8('0x1e')](_0x1e11ba);return _0x1671bd['set'](_0x4ce8('0x25'),_0x241ca0+'-'+_0x17da54+'/'+_0x42fefc)[_0x4ce8('0x20')](_0x291c6a);}return null;};}function patchUpdates(_0x26f7af){return function(_0x33fc24){try{jsonpatch[_0x4ce8('0x26')](_0x33fc24,_0x26f7af,!![]);}catch(_0x47485f){return BPromise[_0x4ce8('0x27')](_0x47485f);}return _0x33fc24['save']();};}function saveUpdates(_0x363af1,_0x40edf2){return function(_0x2bb15b){if(_0x2bb15b){return _0x2bb15b[_0x4ce8('0x28')](_0x363af1)['then'](function(_0x180328){return _0x180328;});}return null;};}function removeEntity(_0x1c1d59,_0x5c6061){return function(_0x5c2e0b){if(_0x5c2e0b){return _0x5c2e0b[_0x4ce8('0x29')]()[_0x4ce8('0x2a')](function(){var _0x36bc8d=_0x5c2e0b['get']({'plain':!![]});var _0x13aac4='Lists';return db[_0x4ce8('0x2b')][_0x4ce8('0x29')]({'where':{'type':_0x13aac4,'resourceId':_0x36bc8d['id']}})[_0x4ce8('0x2a')](function(){return _0x5c2e0b;});})['then'](function(){_0x1c1d59[_0x4ce8('0x1e')](0xcc)[_0x4ce8('0x1f')]();});}};}function handleEntityNotFound(_0x1dd642,_0x2240c2){return function(_0x460b3c){if(!_0x460b3c){_0x1dd642['sendStatus'](0x194);}return _0x460b3c;};}function handleError(_0x24318e,_0x3f1dcf){_0x3f1dcf=_0x3f1dcf||0x1f4;return function(_0x3beed4){logger[_0x4ce8('0x2c')](_0x3beed4[_0x4ce8('0x2d')]);if(_0x3beed4[_0x4ce8('0x2e')]){delete _0x3beed4[_0x4ce8('0x2e')];}_0x24318e[_0x4ce8('0x1e')](_0x3f1dcf)[_0x4ce8('0x2f')](_0x3beed4);};}exports[_0x4ce8('0x30')]=function(_0x5a943c,_0x5f13c7){var _0x359f36={},_0x598f8a={},_0x46011e={'count':0x0,'rows':[]};var _0x5bfab0=_[_0x4ce8('0x31')](db[_0x4ce8('0x32')][_0x4ce8('0x33')],function(_0x5f48b2){return{'name':_0x5f48b2[_0x4ce8('0x34')],'type':_0x5f48b2['type'][_0x4ce8('0x35')]};});_0x598f8a[_0x4ce8('0x36')]=_[_0x4ce8('0x31')](_0x5bfab0,_0x4ce8('0x2e'));_0x598f8a['query']=_[_0x4ce8('0x37')](_0x5a943c[_0x4ce8('0x38')]);_0x598f8a[_0x4ce8('0x39')]=_[_0x4ce8('0x3a')](_0x598f8a[_0x4ce8('0x36')],_0x598f8a[_0x4ce8('0x38')]);_0x359f36[_0x4ce8('0x3b')]=_[_0x4ce8('0x3a')](_0x598f8a['model'],qs[_0x4ce8('0x3c')](_0x5a943c[_0x4ce8('0x38')][_0x4ce8('0x3c')]));_0x359f36['attributes']=_0x359f36[_0x4ce8('0x3b')][_0x4ce8('0x3d')]?_0x359f36[_0x4ce8('0x3b')]:_0x598f8a[_0x4ce8('0x36')];if(!_0x5a943c[_0x4ce8('0x38')]['hasOwnProperty'](_0x4ce8('0x3e'))){_0x359f36[_0x4ce8('0x22')]=qs[_0x4ce8('0x22')](_0x5a943c[_0x4ce8('0x38')][_0x4ce8('0x22')]);_0x359f36[_0x4ce8('0x21')]=qs['offset'](_0x5a943c['query'][_0x4ce8('0x21')]);}_0x359f36[_0x4ce8('0x3f')]=qs['sort'](_0x5a943c['query'][_0x4ce8('0x40')]);_0x359f36['where']=qs['filters'](_[_0x4ce8('0x41')](_0x5a943c[_0x4ce8('0x38')],_0x598f8a[_0x4ce8('0x39')]),_0x5bfab0);if(_0x5a943c['query'][_0x4ce8('0x42')]){_0x359f36[_0x4ce8('0x43')]=_[_0x4ce8('0x44')](_0x359f36[_0x4ce8('0x43')],{'$or':_[_0x4ce8('0x31')](_0x5bfab0,function(_0x1cebbd){if(_0x1cebbd[_0x4ce8('0x45')]!==_0x4ce8('0x46')){var _0x298d83={};_0x298d83[_0x1cebbd['name']]={'$like':'%'+_0x5a943c[_0x4ce8('0x38')][_0x4ce8('0x42')]+'%'};return _0x298d83;}})});}_0x359f36=_[_0x4ce8('0x44')]({},_0x359f36,_0x5a943c['options']);var _0x5b673b={'where':_0x359f36['where']};return db[_0x4ce8('0x32')]['count'](_0x5b673b)['then'](function(_0x2cdf37){_0x46011e[_0x4ce8('0x24')]=_0x2cdf37;if(_0x5a943c['query']['includeAll']){_0x359f36['include']=[{'all':!![]}];}return db[_0x4ce8('0x32')]['findAll'](_0x359f36);})['then'](function(_0x43b719){_0x46011e[_0x4ce8('0x47')]=_0x43b719;return _0x46011e;})[_0x4ce8('0x2a')](respondWithFilteredResult(_0x5f13c7,_0x359f36))[_0x4ce8('0x48')](handleError(_0x5f13c7,null));};exports['show']=function(_0x55b9ee,_0x5210c8){var _0x56099a={'raw':![],'where':{'id':_0x55b9ee[_0x4ce8('0x49')]['id']}},_0x45d4c6={};_0x45d4c6['model']=_['keys'](db[_0x4ce8('0x32')][_0x4ce8('0x33')]);_0x45d4c6[_0x4ce8('0x38')]=_['keys'](_0x55b9ee[_0x4ce8('0x38')]);_0x45d4c6[_0x4ce8('0x39')]=_[_0x4ce8('0x3a')](_0x45d4c6[_0x4ce8('0x36')],_0x45d4c6[_0x4ce8('0x38')]);_0x56099a[_0x4ce8('0x3b')]=_[_0x4ce8('0x3a')](_0x45d4c6[_0x4ce8('0x36')],qs[_0x4ce8('0x3c')](_0x55b9ee[_0x4ce8('0x38')][_0x4ce8('0x3c')]));_0x56099a[_0x4ce8('0x3b')]=_0x56099a[_0x4ce8('0x3b')][_0x4ce8('0x3d')]?_0x56099a[_0x4ce8('0x3b')]:_0x45d4c6[_0x4ce8('0x36')];if(_0x55b9ee[_0x4ce8('0x38')][_0x4ce8('0x4a')]){_0x56099a[_0x4ce8('0x4b')]=[{'all':!![]}];}_0x56099a=_['merge']({},_0x56099a,_0x55b9ee[_0x4ce8('0x4c')]);return db[_0x4ce8('0x32')][_0x4ce8('0x4d')](_0x56099a)[_0x4ce8('0x2a')](handleEntityNotFound(_0x5210c8,null))[_0x4ce8('0x2a')](respondWithResult(_0x5210c8,null))[_0x4ce8('0x48')](handleError(_0x5210c8,null));};exports[_0x4ce8('0x4e')]=function(_0x39a59a,_0x382754){return db[_0x4ce8('0x32')][_0x4ce8('0x4e')](_0x39a59a[_0x4ce8('0x4f')],{})[_0x4ce8('0x2a')](function(_0xdc38b2){var _0x15cb80=_0x39a59a[_0x4ce8('0x50')][_0x4ce8('0x51')]({'plain':!![]});if(!_0x15cb80)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15cb80[_0x4ce8('0x52')]===_0x4ce8('0x50')){var _0x4b3a8d=_0xdc38b2[_0x4ce8('0x51')]({'plain':!![]});var _0x5753b8=_0x4ce8('0x53');return db[_0x4ce8('0x54')][_0x4ce8('0x4d')]({'where':{'name':_0x5753b8,'userProfileId':_0x15cb80[_0x4ce8('0x55')]},'raw':!![]})['then'](function(_0x95a7a7){if(_0x95a7a7&&_0x95a7a7[_0x4ce8('0x56')]===0x0){return db['UserProfileResource'][_0x4ce8('0x4e')]({'name':_0x4b3a8d[_0x4ce8('0x2e')],'resourceId':_0x4b3a8d['id'],'type':_0x95a7a7['name'],'sectionId':_0x95a7a7['id']},{})[_0x4ce8('0x2a')](function(){return _0xdc38b2;});}else{return _0xdc38b2;}})[_0x4ce8('0x48')](function(_0x2eb5a3){logger[_0x4ce8('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2eb5a3);throw _0x2eb5a3;});}return _0xdc38b2;})['then'](respondWithResult(_0x382754,0xc9))[_0x4ce8('0x48')](handleError(_0x382754,null));};exports[_0x4ce8('0x28')]=function(_0x27dcb3,_0x1a13fc){if(_0x27dcb3['body']['id']){delete _0x27dcb3['body']['id'];}return db[_0x4ce8('0x32')][_0x4ce8('0x4d')]({'where':{'id':_0x27dcb3[_0x4ce8('0x49')]['id']}})[_0x4ce8('0x2a')](handleEntityNotFound(_0x1a13fc,null))['then'](saveUpdates(_0x27dcb3[_0x4ce8('0x4f')],null))[_0x4ce8('0x2a')](respondWithResult(_0x1a13fc,null))['catch'](handleError(_0x1a13fc,null));};exports[_0x4ce8('0x29')]=function(_0x371a13,_0x24638f){return db[_0x4ce8('0x32')][_0x4ce8('0x4d')]({'where':{'id':_0x371a13[_0x4ce8('0x49')]['id']}})[_0x4ce8('0x2a')](handleEntityNotFound(_0x24638f,null))[_0x4ce8('0x2a')](removeEntity(_0x24638f,null))[_0x4ce8('0x48')](handleError(_0x24638f,null));};exports[_0x4ce8('0x57')]=function(_0x5afddc,_0x224c37){return db['CmList'][_0x4ce8('0x57')]()[_0x4ce8('0x2a')](respondWithResult(_0x224c37,null))['catch'](handleError(_0x224c37,null));};exports['addDisposition']=function(_0x3672a9,_0x1345e9,_0x54ec91){if(_0x3672a9[_0x4ce8('0x4f')]['id']){delete _0x3672a9[_0x4ce8('0x4f')]['id'];}return db[_0x4ce8('0x32')][_0x4ce8('0x4d')]({'where':{'id':_0x3672a9['params']['id']}})[_0x4ce8('0x2a')](handleEntityNotFound(_0x1345e9,null))[_0x4ce8('0x2a')](function(_0x50e945){if(_0x50e945){_0x3672a9[_0x4ce8('0x4f')][_0x4ce8('0x58')]=_0x50e945['id'];return db[_0x4ce8('0x59')][_0x4ce8('0x4e')](_0x3672a9[_0x4ce8('0x4f')]);}})[_0x4ce8('0x2a')](respondWithResult(_0x1345e9,null))[_0x4ce8('0x48')](handleError(_0x1345e9,null));};exports[_0x4ce8('0x5a')]=function(_0x3ac965,_0x533f42,_0x3bd947){var _0x3eeca3={'raw':![],'where':{}};var _0x4f8755={};var _0x5deb33={'count':0x0,'rows':[]};return db[_0x4ce8('0x32')][_0x4ce8('0x5b')]({'where':{'id':_0x3ac965['params']['id']}})[_0x4ce8('0x2a')](handleEntityNotFound(_0x533f42,null))[_0x4ce8('0x2a')](function(_0x2bcd90){if(_0x2bcd90){_0x4f8755[_0x4ce8('0x36')]=_[_0x4ce8('0x37')](db[_0x4ce8('0x59')][_0x4ce8('0x33')]);_0x4f8755[_0x4ce8('0x38')]=_[_0x4ce8('0x37')](_0x3ac965[_0x4ce8('0x38')]);_0x4f8755['filters']=_[_0x4ce8('0x3a')](_0x4f8755[_0x4ce8('0x36')],_0x4f8755[_0x4ce8('0x38')]);_0x3eeca3[_0x4ce8('0x3b')]=_['intersection'](_0x4f8755[_0x4ce8('0x36')],qs[_0x4ce8('0x3c')](_0x3ac965[_0x4ce8('0x38')]['fields']));_0x3eeca3['attributes']=_0x3eeca3[_0x4ce8('0x3b')]['length']?_0x3eeca3[_0x4ce8('0x3b')]:_0x4f8755[_0x4ce8('0x36')];if(!_0x3ac965[_0x4ce8('0x38')][_0x4ce8('0x5c')](_0x4ce8('0x3e'))){_0x3eeca3[_0x4ce8('0x22')]=qs[_0x4ce8('0x22')](_0x3ac965[_0x4ce8('0x38')][_0x4ce8('0x22')]);_0x3eeca3[_0x4ce8('0x21')]=qs[_0x4ce8('0x21')](_0x3ac965[_0x4ce8('0x38')]['offset']);}_0x3eeca3[_0x4ce8('0x3f')]=qs[_0x4ce8('0x40')](_0x3ac965[_0x4ce8('0x38')]['sort']);_0x3eeca3[_0x4ce8('0x43')]=qs[_0x4ce8('0x39')](_[_0x4ce8('0x41')](_0x3ac965[_0x4ce8('0x38')],_0x4f8755['filters']));_0x3eeca3[_0x4ce8('0x43')][_0x4ce8('0x58')]=_0x2bcd90['id'];if(_0x3ac965[_0x4ce8('0x38')][_0x4ce8('0x42')]){_0x3eeca3['where']=_[_0x4ce8('0x44')](_0x3eeca3[_0x4ce8('0x43')],{'$or':_['map'](_0x3eeca3[_0x4ce8('0x3b')],function(_0x4f362a){var _0xb20b9a={};_0xb20b9a[_0x4f362a]={'$like':'%'+_0x3ac965[_0x4ce8('0x38')][_0x4ce8('0x42')]+'%'};return _0xb20b9a;})});}_0x3eeca3=_[_0x4ce8('0x44')]({},_0x3eeca3,_0x3ac965[_0x4ce8('0x4c')]);return db['Disposition'][_0x4ce8('0x24')]({'where':_0x3eeca3[_0x4ce8('0x43')]})[_0x4ce8('0x2a')](function(_0x362d20){_0x5deb33[_0x4ce8('0x24')]=_0x362d20;if(_0x3ac965[_0x4ce8('0x38')][_0x4ce8('0x4a')]){_0x3eeca3[_0x4ce8('0x4b')]=[{'all':!![]}];}return db[_0x4ce8('0x59')][_0x4ce8('0x5d')](_0x3eeca3);})[_0x4ce8('0x2a')](function(_0x59f7f1){_0x5deb33[_0x4ce8('0x47')]=_0x59f7f1;return _0x5deb33;});}})[_0x4ce8('0x2a')](respondWithFilteredResult(_0x533f42,_0x3eeca3))['catch'](handleError(_0x533f42,null));};exports[_0x4ce8('0x5e')]=function(_0x32f2b0,_0x2c15f4,_0xcd9bc3){return db[_0x4ce8('0x32')][_0x4ce8('0x4d')]({'where':{'id':_0x32f2b0[_0x4ce8('0x49')]['id']}})[_0x4ce8('0x2a')](handleEntityNotFound(_0x2c15f4,null))[_0x4ce8('0x2a')](function(_0x4b3ae5){if(_0x4b3ae5){return _0x4b3ae5[_0x4ce8('0x5e')](_0x32f2b0[_0x4ce8('0x38')][_0x4ce8('0x5f')]);}})[_0x4ce8('0x2a')](respondWithStatusCode(_0x2c15f4,null))[_0x4ce8('0x48')](handleError(_0x2c15f4,null));};exports['addContacts']=function(_0x5ed660,_0x29de44,_0x5c32ef){return db[_0x4ce8('0x32')][_0x4ce8('0x4d')]({'where':{'id':_0x5ed660['params']['id']}})[_0x4ce8('0x2a')](handleEntityNotFound(_0x29de44,null))[_0x4ce8('0x2a')](function(_0x2ea1da){if(_0x2ea1da){var _0x9c64df=[];var _0x3f26a6={'success':[],'errors':[]};return db['CmContact'][_0x4ce8('0x57')]()[_0x4ce8('0x2a')](function(_0x58027){if(_0x5ed660['body']['tags']&&_[_0x4ce8('0x60')](_0x5ed660[_0x4ce8('0x4f')]['tags'])){if(_0x5ed660[_0x4ce8('0x4f')][_0x4ce8('0x61')]['length']){_0x5ed660[_0x4ce8('0x4f')][_0x4ce8('0x61')]=_0x5ed660['body'][_0x4ce8('0x61')]['join'](';')+';';}else{_0x5ed660[_0x4ce8('0x4f')][_0x4ce8('0x61')]=null;}}else{_0x5ed660[_0x4ce8('0x4f')][_0x4ce8('0x61')]=null;}if(_0x5ed660[_0x4ce8('0x4f')]&&_[_0x4ce8('0x60')](_0x5ed660['body'])){for(var _0x309e4b=0x0;_0x309e4b<_0x5ed660[_0x4ce8('0x4f')][_0x4ce8('0x3d')];_0x309e4b+=0x1){_0x5ed660['body'][_0x309e4b][_0x4ce8('0x58')]=_0x5ed660[_0x4ce8('0x49')]['id'];_0x9c64df[_0x4ce8('0x62')](_0x5ed660[_0x4ce8('0x4f')][_0x309e4b]);}return BPromise[_0x4ce8('0x63')](_0x9c64df,function(_0xc35df){return db[_0x4ce8('0x64')][_0x4ce8('0x4e')](_[_0x4ce8('0x65')](_0xc35df,[_0x4ce8('0x5f'),'id'])||{},{'fields':_[_0x4ce8('0x37')](_0x58027),'raw':!![]})[_0x4ce8('0x2a')](function(_0x5a9cc6){_0x3f26a6['success'][_0x4ce8('0x62')](_0x5a9cc6[_0x4ce8('0x66')]);})[_0x4ce8('0x48')](function(_0x2586e4){_0x3f26a6['errors'][_0x4ce8('0x62')]({'data':_0xc35df,'error':_0x2586e4[_0x4ce8('0x67')]});});})[_0x4ce8('0x2a')](function(_0x429eb4){return _0x3f26a6;})[_0x4ce8('0x48')](function(_0x350187){return _0x350187;});}else{_0x29de44['status'](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0x4ce8('0x2a')](respondWithResult(_0x29de44,null))['catch'](handleError(_0x29de44,null));};exports[_0x4ce8('0x68')]=function(_0x49f52a,_0x19a7f0,_0x3042cb){var _0x1ad0ff;return db['CmList'][_0x4ce8('0x4d')]({'where':{'id':_0x49f52a[_0x4ce8('0x49')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x4ce8('0x69')}]})['then'](handleEntityNotFound(_0x19a7f0,null))['then'](function(_0x63f868){if(_0x63f868){_0x1ad0ff=_0x63f868;return db[_0x4ce8('0x64')][_0x4ce8('0x33')];}})[_0x4ce8('0x2a')](function(_0x531af1){if(_0x531af1){var _0x24368c={};var _0x2e02bb={};_0x2e02bb[_0x4ce8('0x36')]=_['concat'](_['keys'](_0x531af1),_[_0x4ce8('0x31')](_0x1ad0ff['CustomFields'],function(_0x37a754){return util[_0x4ce8('0x6a')](_0x4ce8('0x6b'),_0x37a754['id']);}));_0x2e02bb[_0x4ce8('0x38')]=_[_0x4ce8('0x37')](_0x49f52a['query']);_0x2e02bb[_0x4ce8('0x39')]=_[_0x4ce8('0x3a')](_0x2e02bb[_0x4ce8('0x36')],_0x2e02bb[_0x4ce8('0x38')]);_0x24368c['attributes']=_[_0x4ce8('0x3a')](_0x2e02bb[_0x4ce8('0x36')],qs[_0x4ce8('0x3c')](_0x49f52a[_0x4ce8('0x38')][_0x4ce8('0x3c')]));_0x24368c[_0x4ce8('0x3b')]=_0x24368c[_0x4ce8('0x3b')]['length']?_0x24368c['attributes']:_0x2e02bb['model'];if(!_0x49f52a['query'][_0x4ce8('0x5c')]('nolimit')){_0x24368c[_0x4ce8('0x22')]=qs[_0x4ce8('0x22')](_0x49f52a[_0x4ce8('0x38')][_0x4ce8('0x22')]);_0x24368c['offset']=qs[_0x4ce8('0x21')](_0x49f52a[_0x4ce8('0x38')][_0x4ce8('0x21')]);}_0x24368c[_0x4ce8('0x3f')]=qs[_0x4ce8('0x40')](_0x49f52a[_0x4ce8('0x38')][_0x4ce8('0x40')]);_0x24368c['where']=qs[_0x4ce8('0x39')](_['pick'](_0x49f52a[_0x4ce8('0x38')],_0x2e02bb[_0x4ce8('0x39')]));_0x24368c[_0x4ce8('0x6c')]=!![];if(_0x49f52a[_0x4ce8('0x38')][_0x4ce8('0x42')]){_0x24368c[_0x4ce8('0x43')]=_['merge'](_0x24368c[_0x4ce8('0x43')],{'$or':_[_0x4ce8('0x31')](_0x24368c[_0x4ce8('0x3b')],function(_0x291398){var _0x10ab38={};_0x10ab38[_0x291398]={'$like':'%'+_0x49f52a[_0x4ce8('0x38')][_0x4ce8('0x42')]+'%'};return _0x10ab38;})});}_0x24368c=_[_0x4ce8('0x44')]({},_0x24368c,_0x49f52a[_0x4ce8('0x4c')]);return _0x1ad0ff['getContacts'](_0x24368c);}})[_0x4ce8('0x2a')](respondWithResult(_0x19a7f0,null))[_0x4ce8('0x48')](handleError(_0x19a7f0,null));};exports[_0x4ce8('0x6d')]=function(_0x4a7143,_0x5eb71b,_0x410ea1){var _0x21370a;return db[_0x4ce8('0x32')]['find']({'where':{'id':_0x4a7143[_0x4ce8('0x49')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x4ce8('0x69')}]})[_0x4ce8('0x2a')](handleEntityNotFound(_0x5eb71b,null))[_0x4ce8('0x2a')](function(_0x88be9d){if(_0x88be9d){_0x21370a=_0x88be9d;return db['CmContact'][_0x4ce8('0x33')];}})[_0x4ce8('0x2a')](function(_0x3217d1){if(_0x3217d1){var _0x581d35={};var _0x1975bf={};_0x1975bf['model']=_[_0x4ce8('0x6e')](_[_0x4ce8('0x37')](_0x3217d1),_[_0x4ce8('0x31')](_0x21370a[_0x4ce8('0x69')],function(_0x2e8bc7){return util[_0x4ce8('0x6a')]('cf_%d',_0x2e8bc7['id']);}));_0x1975bf[_0x4ce8('0x38')]=_['keys'](_0x4a7143[_0x4ce8('0x38')]);_0x1975bf[_0x4ce8('0x39')]=_['intersection'](_0x1975bf[_0x4ce8('0x36')],_0x1975bf[_0x4ce8('0x38')]);_0x581d35['attributes']=_[_0x4ce8('0x3a')](_0x1975bf[_0x4ce8('0x36')],qs['fields'](_0x4a7143[_0x4ce8('0x38')][_0x4ce8('0x3c')]));_0x581d35[_0x4ce8('0x3b')]=_0x581d35[_0x4ce8('0x3b')][_0x4ce8('0x3d')]?_0x581d35[_0x4ce8('0x3b')]:_0x1975bf[_0x4ce8('0x36')];if(!_0x4a7143['query'][_0x4ce8('0x5c')](_0x4ce8('0x3e'))){_0x581d35[_0x4ce8('0x22')]=qs[_0x4ce8('0x22')](_0x4a7143[_0x4ce8('0x38')][_0x4ce8('0x22')]);_0x581d35[_0x4ce8('0x21')]=qs[_0x4ce8('0x21')](_0x4a7143[_0x4ce8('0x38')]['offset']);}_0x581d35['order']=qs[_0x4ce8('0x40')](_0x4a7143[_0x4ce8('0x38')][_0x4ce8('0x40')]);_0x581d35['where']=qs['filters'](_[_0x4ce8('0x41')](_0x4a7143[_0x4ce8('0x38')],_0x1975bf['filters']));_0x581d35[_0x4ce8('0x6c')]=!![];if(_0x4a7143['query'][_0x4ce8('0x42')]){_0x581d35[_0x4ce8('0x43')]=_['merge'](_0x581d35[_0x4ce8('0x43')],{'$or':_['map'](_0x581d35[_0x4ce8('0x3b')],function(_0xd6b5e2){var _0x373d63={};_0x373d63[_0xd6b5e2]={'$like':'%'+_0x4a7143[_0x4ce8('0x38')][_0x4ce8('0x42')]+'%'};return _0x373d63;})});}_0x581d35=_['merge']({},_0x581d35,_0x4a7143[_0x4ce8('0x4c')]);return _0x21370a['getContacts'](_0x581d35);}})[_0x4ce8('0x2a')](function(_0x18d9ef){if(!_['isEmpty'](_0x18d9ef)){var _0x390a81=toCsv(_0x18d9ef);var _0x5b0203=Date[_0x4ce8('0x6f')]();fs[_0x4ce8('0x70')](util[_0x4ce8('0x6a')](_0x4ce8('0x71'),_0x21370a['id'],_0x5b0203),_0x390a81);_0x5eb71b[_0x4ce8('0x72')]('Content-disposition','attachment;\x20filename='+util[_0x4ce8('0x6a')](_0x4ce8('0x73'),_0x21370a['id'],_0x5b0203));_0x5eb71b[_0x4ce8('0x72')](_0x4ce8('0x74'),_0x4ce8('0x75'));return _0x5eb71b[_0x4ce8('0x76')](util[_0x4ce8('0x6a')]('/tmp/list_%d_%s.csv',_0x21370a['id'],_0x5b0203));}else{return _0x5eb71b[_0x4ce8('0x1d')](0xcc);}})['catch'](handleError(_0x5eb71b,null));};exports[_0x4ce8('0x77')]=function(_0x3a4178,_0x4b78f7,_0x44c528){var _0x174ab7;delete _0x3a4178[_0x4ce8('0x4f')]['id'];return db[_0x4ce8('0x32')]['findOne']({'where':{'id':_0x3a4178[_0x4ce8('0x49')]['id']}})[_0x4ce8('0x2a')](handleEntityNotFound(_0x4b78f7,null))[_0x4ce8('0x2a')](function(_0x4b4c63){if(_0x4b4c63){return db[_0x4ce8('0x78')][_0x4ce8('0x79')](function(_0x274a48){return db[_0x4ce8('0x7a')][_0x4ce8('0x4e')](_0x3a4178['body'],{'transaction':_0x274a48})[_0x4ce8('0x2a')](function(_0x4d7903){_0x174ab7=_0x4d7903;return _0x4b4c63[_0x4ce8('0x7b')](_0x4d7903,{'transaction':_0x274a48});})[_0x4ce8('0x2a')](function(){var _0x101dbc={'type':db[_0x4ce8('0x7c')][_0x4ce8('0x7d')],'transaction':_0x274a48};switch(_0x3a4178[_0x4ce8('0x4f')][_0x4ce8('0x45')]){case _0x4ce8('0x7e'):_0x101dbc['type']=db[_0x4ce8('0x7c')][_0x4ce8('0x7d')];break;case _0x4ce8('0x7f'):_0x101dbc[_0x4ce8('0x45')]=db[_0x4ce8('0x7c')][_0x4ce8('0x80')];break;case'switch':_0x101dbc[_0x4ce8('0x45')]=db[_0x4ce8('0x7c')]['BOOLEAN'];_0x101dbc[_0x4ce8('0x81')]=![];break;default:}return db[_0x4ce8('0x78')][_0x4ce8('0x82')][_0x4ce8('0x83')](_0x4ce8('0x84'),util[_0x4ce8('0x6a')](_0x4ce8('0x85'),_0x174ab7['id']),_0x101dbc);})[_0x4ce8('0x2a')](function(){return _0x174ab7;});});}})[_0x4ce8('0x2a')](respondWithResult(_0x4b78f7,null))[_0x4ce8('0x48')](handleError(_0x4b78f7,null));};exports['getCustomFields']=function(_0x16c3c7,_0x4c5ee5,_0x533c26){var _0x3eb75a={};var _0xcc2283={};var _0x237ec3;var _0x57274c;return db[_0x4ce8('0x32')][_0x4ce8('0x5b')]({'where':{'id':_0x16c3c7[_0x4ce8('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c5ee5,null))['then'](function(_0xa374d3){if(_0xa374d3){_0x237ec3=_0xa374d3;_0xcc2283[_0x4ce8('0x36')]=_['keys'](db[_0x4ce8('0x7a')][_0x4ce8('0x33')]);_0xcc2283[_0x4ce8('0x38')]=_[_0x4ce8('0x37')](_0x16c3c7[_0x4ce8('0x38')]);_0xcc2283[_0x4ce8('0x39')]=_[_0x4ce8('0x3a')](_0xcc2283[_0x4ce8('0x36')],_0xcc2283['query']);_0x3eb75a[_0x4ce8('0x3b')]=_[_0x4ce8('0x3a')](_0xcc2283['model'],qs[_0x4ce8('0x3c')](_0x16c3c7[_0x4ce8('0x38')][_0x4ce8('0x3c')]));_0x3eb75a[_0x4ce8('0x3b')]=_0x3eb75a[_0x4ce8('0x3b')]['length']?_0x3eb75a[_0x4ce8('0x3b')]:_0xcc2283[_0x4ce8('0x36')];_0x3eb75a[_0x4ce8('0x3f')]=qs['sort'](_0x16c3c7[_0x4ce8('0x38')][_0x4ce8('0x40')]);_0x3eb75a[_0x4ce8('0x43')]=qs[_0x4ce8('0x39')](_[_0x4ce8('0x41')](_0x16c3c7[_0x4ce8('0x38')],_0xcc2283[_0x4ce8('0x39')]));_0x3eb75a[_0x4ce8('0x43')]=_[_0x4ce8('0x44')](_0x3eb75a[_0x4ce8('0x43')],{'$or':[{'ListId':_0xa374d3['id']},{'ListId':null}]});if(_0x16c3c7[_0x4ce8('0x38')][_0x4ce8('0x42')]){_0x3eb75a[_0x4ce8('0x43')]=_[_0x4ce8('0x44')](_0x3eb75a['where'],{'$or':_[_0x4ce8('0x31')](_0x3eb75a[_0x4ce8('0x3b')],function(_0x570ded){var _0x13704b={};_0x13704b[_0x570ded]={'$like':'%'+_0x16c3c7[_0x4ce8('0x38')]['filter']+'%'};return _0x13704b;})});}_0x3eb75a=_[_0x4ce8('0x44')]({},_0x3eb75a,_0x16c3c7['options']);return db['CmCustomField'][_0x4ce8('0x86')](_0x3eb75a);}})['then'](respondWithResult(_0x4c5ee5,null))[_0x4ce8('0x48')](handleError(_0x4c5ee5,null));};exports['addAgents']=function(_0x52166f,_0x44a0ad,_0x3dd4ca){return db[_0x4ce8('0x32')][_0x4ce8('0x4d')]({'where':{'id':_0x52166f['params']['id']}})[_0x4ce8('0x2a')](handleEntityNotFound(_0x44a0ad,null))[_0x4ce8('0x2a')](function(_0xd1bebc){if(_0xd1bebc){return _0xd1bebc[_0x4ce8('0x87')](_0x52166f[_0x4ce8('0x4f')]['ids'],_['omit'](_0x52166f[_0x4ce8('0x4f')],[_0x4ce8('0x5f'),'id'])||{})[_0x4ce8('0x88')](function(_0x310ce9){for(var _0x35ecbe=0x0;_0x35ecbe<_0x52166f['body'][_0x4ce8('0x5f')][_0x4ce8('0x3d')];_0x35ecbe+=0x1){socket[_0x4ce8('0x89')](_0x4ce8('0x8a'),{'UserId':Number(_0x52166f['body'][_0x4ce8('0x5f')][_0x35ecbe]),'CmListId':Number(_0x52166f[_0x4ce8('0x49')]['id'])});}return _0x310ce9;});}})[_0x4ce8('0x2a')](respondWithResult(_0x44a0ad,null))[_0x4ce8('0x48')](handleError(_0x44a0ad,null));};exports[_0x4ce8('0x8b')]=function(_0x5500fc,_0x3651df,_0x928a29){return db[_0x4ce8('0x32')][_0x4ce8('0x4d')]({'where':{'id':_0x5500fc[_0x4ce8('0x49')]['id']}})[_0x4ce8('0x2a')](handleEntityNotFound(_0x3651df,null))[_0x4ce8('0x2a')](function(_0x5572f2){if(_0x5572f2){return _0x5572f2[_0x4ce8('0x8b')](_0x5500fc[_0x4ce8('0x38')][_0x4ce8('0x5f')])[_0x4ce8('0x2a')](function(){if(_[_0x4ce8('0x60')](_0x5500fc['query']['ids'])){for(var _0x35f3d1=0x0;_0x35f3d1<_0x5500fc[_0x4ce8('0x38')][_0x4ce8('0x5f')]['length'];_0x35f3d1+=0x1){socket[_0x4ce8('0x89')]('userCmList:remove',{'UserId':Number(_0x5500fc['query'][_0x4ce8('0x5f')][_0x35f3d1]),'CmListId':Number(_0x5500fc[_0x4ce8('0x49')]['id'])});}}else{socket[_0x4ce8('0x89')](_0x4ce8('0x8c'),{'UserId':Number(_0x5500fc[_0x4ce8('0x38')][_0x4ce8('0x5f')]),'CmListId':Number(_0x5500fc[_0x4ce8('0x49')]['id'])});}});}})[_0x4ce8('0x2a')](respondWithStatusCode(_0x3651df,null))[_0x4ce8('0x48')](handleError(_0x3651df,null));};exports[_0x4ce8('0x8d')]=function(_0x11c63d,_0x549352,_0x1fc3fa){var _0x57b6c2={};var _0xb1da36={};var _0x330c63;var _0x8b0ca8;return db['CmList'][_0x4ce8('0x5b')]({'where':{'id':_0x11c63d[_0x4ce8('0x49')]['id']}})[_0x4ce8('0x2a')](handleEntityNotFound(_0x549352,null))[_0x4ce8('0x2a')](function(_0x4cd4f7){if(_0x4cd4f7){_0x330c63=_0x4cd4f7;_0xb1da36['model']=_[_0x4ce8('0x37')](db[_0x4ce8('0x8e')][_0x4ce8('0x33')]);_0xb1da36['query']=_[_0x4ce8('0x37')](_0x11c63d[_0x4ce8('0x38')]);_0xb1da36[_0x4ce8('0x39')]=_['intersection'](_0xb1da36['model'],_0xb1da36[_0x4ce8('0x38')]);_0x57b6c2[_0x4ce8('0x3b')]=_[_0x4ce8('0x3a')](_0xb1da36[_0x4ce8('0x36')],qs['fields'](_0x11c63d[_0x4ce8('0x38')][_0x4ce8('0x3c')]));_0x57b6c2[_0x4ce8('0x3b')]=_0x57b6c2[_0x4ce8('0x3b')][_0x4ce8('0x3d')]?_0x57b6c2[_0x4ce8('0x3b')]:_0xb1da36['model'];_0x57b6c2[_0x4ce8('0x3f')]=qs['sort'](_0x11c63d[_0x4ce8('0x38')][_0x4ce8('0x40')]);_0x57b6c2[_0x4ce8('0x43')]=qs[_0x4ce8('0x39')](_['pick'](_0x11c63d[_0x4ce8('0x38')],_0xb1da36[_0x4ce8('0x39')]));if(_0x11c63d['query'][_0x4ce8('0x42')]){_0x57b6c2['where']=_[_0x4ce8('0x44')](_0x57b6c2[_0x4ce8('0x43')],{'$or':_['map'](_0x57b6c2[_0x4ce8('0x3b')],function(_0x54db8e){var _0x16e76d={};_0x16e76d[_0x54db8e]={'$like':'%'+_0x11c63d['query'][_0x4ce8('0x42')]+'%'};return _0x16e76d;})});}_0x57b6c2=_[_0x4ce8('0x44')]({},_0x57b6c2,_0x11c63d['options']);return _0x330c63['getAgents'](_0x57b6c2);}})[_0x4ce8('0x2a')](function(_0x2dec3a){if(_0x2dec3a){_0x8b0ca8=_0x2dec3a['length'];if(!_0x11c63d[_0x4ce8('0x38')]['hasOwnProperty'](_0x4ce8('0x3e'))){_0x57b6c2[_0x4ce8('0x22')]=qs['limit'](_0x11c63d[_0x4ce8('0x38')][_0x4ce8('0x22')]);_0x57b6c2[_0x4ce8('0x21')]=qs[_0x4ce8('0x21')](_0x11c63d[_0x4ce8('0x38')][_0x4ce8('0x21')]);}return _0x330c63[_0x4ce8('0x8d')](_0x57b6c2);}})['then'](function(_0xbb249f){if(_0xbb249f){return _0xbb249f?{'count':_0x8b0ca8,'rows':_0xbb249f}:null;}})['then'](respondWithResult(_0x549352,null))[_0x4ce8('0x48')](handleError(_0x549352,null));}; \ No newline at end of file +var _0x85c1=['hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','length','options','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ListId','Disposition','findOne','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','format','cf_%d','raw','CmCustomField','concat','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-type','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./cmList.socket','sendStatus','status','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','get','Lists','UserProfileResource','end','error','stack','index','map','CmList','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields'];(function(_0x3dc8a5,_0x30d525){var _0x4c3cb0=function(_0x1bc0d7){while(--_0x1bc0d7){_0x3dc8a5['push'](_0x3dc8a5['shift']());}};_0x4c3cb0(++_0x30d525);}(_0x85c1,0xdc));var _0x185c=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0x85c1[_0x61b3ab];return _0x57097f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x185c('0x0'));var rp=require(_0x185c('0x1'));var moment=require(_0x185c('0x2'));var BPromise=require(_0x185c('0x3'));var Mustache=require(_0x185c('0x4'));var util=require('util');var path=require(_0x185c('0x5'));var sox=require('sox');var csv=require(_0x185c('0x6'));var ejs=require(_0x185c('0x7'));var fs=require('fs');var fs_extra=require(_0x185c('0x8'));var _=require(_0x185c('0x9'));var squel=require('squel');var crypto=require(_0x185c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x185c('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x185c('0xb'));var qs=require(_0x185c('0xc'));var as=require(_0x185c('0xd'));var hardwareService=require(_0x185c('0xe'));var logger=require(_0x185c('0xf'))('api');var utils=require(_0x185c('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x185c('0x11'));var db=require(_0x185c('0x12'))['db'];config['redis']=_[_0x185c('0x13')](config[_0x185c('0x14')],{'host':_0x185c('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x185c('0x14')]));require(_0x185c('0x16'))['register'](socket);function respondWithStatusCode(_0x10d547,_0x27c11f){_0x27c11f=_0x27c11f||0xcc;return function(_0x140c7f){if(_0x140c7f){return _0x10d547[_0x185c('0x17')](_0x27c11f);}return _0x10d547[_0x185c('0x18')](_0x27c11f)['end']();};}function respondWithResult(_0x595f06,_0x5a7774){_0x5a7774=_0x5a7774||0xc8;return function(_0x524275){if(_0x524275){return _0x595f06[_0x185c('0x18')](_0x5a7774)[_0x185c('0x19')](_0x524275);}};}function respondWithFilteredResult(_0x849016,_0x15c499){return function(_0x1ad047){if(_0x1ad047){var _0x4cb151=typeof _0x15c499[_0x185c('0x1a')]==='undefined'&&typeof _0x15c499[_0x185c('0x1b')]==='undefined';var _0x412b81=_0x1ad047[_0x185c('0x1c')];var _0x35a400=_0x4cb151?0x0:_0x15c499['offset'];var _0x3dbba1=_0x4cb151?_0x1ad047[_0x185c('0x1c')]:_0x15c499['offset']+_0x15c499[_0x185c('0x1b')];var _0x1363a8;if(_0x3dbba1>=_0x412b81){_0x3dbba1=_0x412b81;_0x1363a8=0xc8;}else{_0x1363a8=0xce;}_0x849016['status'](_0x1363a8);return _0x849016['set'](_0x185c('0x1d'),_0x35a400+'-'+_0x3dbba1+'/'+_0x412b81)[_0x185c('0x19')](_0x1ad047);}return null;};}function patchUpdates(_0x21b277){return function(_0x22aa9e){try{jsonpatch['apply'](_0x22aa9e,_0x21b277,!![]);}catch(_0x5bb302){return BPromise[_0x185c('0x1e')](_0x5bb302);}return _0x22aa9e[_0x185c('0x1f')]();};}function saveUpdates(_0x1a2cb1,_0x56dccc){return function(_0x4d11aa){if(_0x4d11aa){return _0x4d11aa[_0x185c('0x20')](_0x1a2cb1)[_0x185c('0x21')](function(_0x399df5){return _0x399df5;});}return null;};}function removeEntity(_0x46f02f,_0x5a9177){return function(_0x2b2950){if(_0x2b2950){return _0x2b2950[_0x185c('0x22')]()[_0x185c('0x21')](function(){var _0x381cf3=_0x2b2950[_0x185c('0x23')]({'plain':!![]});var _0x1406ff=_0x185c('0x24');return db[_0x185c('0x25')][_0x185c('0x22')]({'where':{'type':_0x1406ff,'resourceId':_0x381cf3['id']}})['then'](function(){return _0x2b2950;});})[_0x185c('0x21')](function(){_0x46f02f[_0x185c('0x18')](0xcc)[_0x185c('0x26')]();});}};}function handleEntityNotFound(_0x5ba253,_0x2feb80){return function(_0x22edf5){if(!_0x22edf5){_0x5ba253[_0x185c('0x17')](0x194);}return _0x22edf5;};}function handleError(_0x5eb138,_0x4d0738){_0x4d0738=_0x4d0738||0x1f4;return function(_0x484ebb){logger[_0x185c('0x27')](_0x484ebb[_0x185c('0x28')]);if(_0x484ebb['name']){delete _0x484ebb['name'];}_0x5eb138[_0x185c('0x18')](_0x4d0738)['send'](_0x484ebb);};}exports[_0x185c('0x29')]=function(_0x34173f,_0x1ac4e6){var _0x33ec67={},_0x5d69b2={},_0x3e3f5d={'count':0x0,'rows':[]};var _0x312965=_[_0x185c('0x2a')](db[_0x185c('0x2b')][_0x185c('0x2c')],function(_0x2ea0c9){return{'name':_0x2ea0c9[_0x185c('0x2d')],'type':_0x2ea0c9[_0x185c('0x2e')][_0x185c('0x2f')]};});_0x5d69b2[_0x185c('0x30')]=_['map'](_0x312965,_0x185c('0x31'));_0x5d69b2[_0x185c('0x32')]=_[_0x185c('0x33')](_0x34173f['query']);_0x5d69b2[_0x185c('0x34')]=_['intersection'](_0x5d69b2['model'],_0x5d69b2[_0x185c('0x32')]);_0x33ec67[_0x185c('0x35')]=_[_0x185c('0x36')](_0x5d69b2[_0x185c('0x30')],qs[_0x185c('0x37')](_0x34173f[_0x185c('0x32')]['fields']));_0x33ec67[_0x185c('0x35')]=_0x33ec67[_0x185c('0x35')]['length']?_0x33ec67[_0x185c('0x35')]:_0x5d69b2[_0x185c('0x30')];if(!_0x34173f[_0x185c('0x32')][_0x185c('0x38')](_0x185c('0x39'))){_0x33ec67[_0x185c('0x1b')]=qs['limit'](_0x34173f[_0x185c('0x32')][_0x185c('0x1b')]);_0x33ec67[_0x185c('0x1a')]=qs[_0x185c('0x1a')](_0x34173f[_0x185c('0x32')][_0x185c('0x1a')]);}_0x33ec67[_0x185c('0x3a')]=qs[_0x185c('0x3b')](_0x34173f[_0x185c('0x32')]['sort']);_0x33ec67['where']=qs[_0x185c('0x34')](_[_0x185c('0x3c')](_0x34173f[_0x185c('0x32')],_0x5d69b2[_0x185c('0x34')]),_0x312965);if(_0x34173f[_0x185c('0x32')][_0x185c('0x3d')]){_0x33ec67[_0x185c('0x3e')]=_[_0x185c('0x3f')](_0x33ec67[_0x185c('0x3e')],{'$or':_[_0x185c('0x2a')](_0x312965,function(_0x307722){if(_0x307722[_0x185c('0x2e')]!==_0x185c('0x40')){var _0x2ee80e={};_0x2ee80e[_0x307722[_0x185c('0x31')]]={'$like':'%'+_0x34173f['query']['filter']+'%'};return _0x2ee80e;}})});}_0x33ec67=_[_0x185c('0x3f')]({},_0x33ec67,_0x34173f['options']);var _0x3516b7={'where':_0x33ec67[_0x185c('0x3e')]};return db[_0x185c('0x2b')][_0x185c('0x1c')](_0x3516b7)['then'](function(_0x6195a5){_0x3e3f5d[_0x185c('0x1c')]=_0x6195a5;if(_0x34173f[_0x185c('0x32')][_0x185c('0x41')]){_0x33ec67[_0x185c('0x42')]=[{'all':!![]}];}return db[_0x185c('0x2b')][_0x185c('0x43')](_0x33ec67);})[_0x185c('0x21')](function(_0xe08308){_0x3e3f5d[_0x185c('0x44')]=_0xe08308;return _0x3e3f5d;})['then'](respondWithFilteredResult(_0x1ac4e6,_0x33ec67))[_0x185c('0x45')](handleError(_0x1ac4e6,null));};exports['show']=function(_0x4c9a6d,_0x593fa4){var _0x1e52cb={'raw':![],'where':{'id':_0x4c9a6d['params']['id']}},_0x545bea={};_0x545bea[_0x185c('0x30')]=_['keys'](db[_0x185c('0x2b')][_0x185c('0x2c')]);_0x545bea['query']=_['keys'](_0x4c9a6d[_0x185c('0x32')]);_0x545bea['filters']=_[_0x185c('0x36')](_0x545bea[_0x185c('0x30')],_0x545bea[_0x185c('0x32')]);_0x1e52cb[_0x185c('0x35')]=_[_0x185c('0x36')](_0x545bea[_0x185c('0x30')],qs[_0x185c('0x37')](_0x4c9a6d[_0x185c('0x32')][_0x185c('0x37')]));_0x1e52cb[_0x185c('0x35')]=_0x1e52cb['attributes'][_0x185c('0x46')]?_0x1e52cb[_0x185c('0x35')]:_0x545bea[_0x185c('0x30')];if(_0x4c9a6d[_0x185c('0x32')][_0x185c('0x41')]){_0x1e52cb[_0x185c('0x42')]=[{'all':!![]}];}_0x1e52cb=_[_0x185c('0x3f')]({},_0x1e52cb,_0x4c9a6d[_0x185c('0x47')]);return db[_0x185c('0x2b')][_0x185c('0x48')](_0x1e52cb)['then'](handleEntityNotFound(_0x593fa4,null))[_0x185c('0x21')](respondWithResult(_0x593fa4,null))[_0x185c('0x45')](handleError(_0x593fa4,null));};exports['create']=function(_0x2130e2,_0x54d423){return db[_0x185c('0x2b')]['create'](_0x2130e2['body'],{})[_0x185c('0x21')](function(_0x40419b){var _0x42f646=_0x2130e2[_0x185c('0x49')][_0x185c('0x23')]({'plain':!![]});if(!_0x42f646)throw new Error(_0x185c('0x4a'));if(_0x42f646['role']==='user'){var _0x58a112=_0x40419b[_0x185c('0x23')]({'plain':!![]});var _0x4dae0d=_0x185c('0x24');return db['UserProfileSection'][_0x185c('0x48')]({'where':{'name':_0x4dae0d,'userProfileId':_0x42f646[_0x185c('0x4b')]},'raw':!![]})[_0x185c('0x21')](function(_0x1a360b){if(_0x1a360b&&_0x1a360b['autoAssociation']===0x0){return db['UserProfileResource'][_0x185c('0x4c')]({'name':_0x58a112['name'],'resourceId':_0x58a112['id'],'type':_0x1a360b['name'],'sectionId':_0x1a360b['id']},{})['then'](function(){return _0x40419b;});}else{return _0x40419b;}})[_0x185c('0x45')](function(_0x473c81){logger[_0x185c('0x27')](_0x185c('0x4d'),_0x473c81);throw _0x473c81;});}return _0x40419b;})['then'](respondWithResult(_0x54d423,0xc9))[_0x185c('0x45')](handleError(_0x54d423,null));};exports[_0x185c('0x20')]=function(_0x5151f1,_0x4e7b99){if(_0x5151f1[_0x185c('0x4e')]['id']){delete _0x5151f1[_0x185c('0x4e')]['id'];}return db['CmList'][_0x185c('0x48')]({'where':{'id':_0x5151f1[_0x185c('0x4f')]['id']}})[_0x185c('0x21')](handleEntityNotFound(_0x4e7b99,null))[_0x185c('0x21')](saveUpdates(_0x5151f1[_0x185c('0x4e')],null))['then'](respondWithResult(_0x4e7b99,null))[_0x185c('0x45')](handleError(_0x4e7b99,null));};exports[_0x185c('0x22')]=function(_0x2b3f42,_0x4714c2){return db['CmList']['find']({'where':{'id':_0x2b3f42[_0x185c('0x4f')]['id']}})[_0x185c('0x21')](handleEntityNotFound(_0x4714c2,null))['then'](removeEntity(_0x4714c2,null))[_0x185c('0x45')](handleError(_0x4714c2,null));};exports['describe']=function(_0x25dd8a,_0x82a9c7){return db[_0x185c('0x2b')][_0x185c('0x50')]()[_0x185c('0x21')](respondWithResult(_0x82a9c7,null))[_0x185c('0x45')](handleError(_0x82a9c7,null));};exports[_0x185c('0x51')]=function(_0x306e5c,_0x17e5d7,_0x423c0e){if(_0x306e5c['body']['id']){delete _0x306e5c[_0x185c('0x4e')]['id'];}return db[_0x185c('0x2b')][_0x185c('0x48')]({'where':{'id':_0x306e5c[_0x185c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x17e5d7,null))[_0x185c('0x21')](function(_0x4ba8b0){if(_0x4ba8b0){_0x306e5c[_0x185c('0x4e')][_0x185c('0x52')]=_0x4ba8b0['id'];return db[_0x185c('0x53')]['create'](_0x306e5c[_0x185c('0x4e')]);}})[_0x185c('0x21')](respondWithResult(_0x17e5d7,null))[_0x185c('0x45')](handleError(_0x17e5d7,null));};exports['getDispositions']=function(_0x63faf9,_0x575962,_0x376483){var _0x44ac06={'raw':![],'where':{}};var _0x10348d={};var _0x296135={'count':0x0,'rows':[]};return db[_0x185c('0x2b')][_0x185c('0x54')]({'where':{'id':_0x63faf9[_0x185c('0x4f')]['id']}})[_0x185c('0x21')](handleEntityNotFound(_0x575962,null))[_0x185c('0x21')](function(_0x2df1ae){if(_0x2df1ae){_0x10348d[_0x185c('0x30')]=_[_0x185c('0x33')](db[_0x185c('0x53')]['rawAttributes']);_0x10348d[_0x185c('0x32')]=_['keys'](_0x63faf9['query']);_0x10348d[_0x185c('0x34')]=_[_0x185c('0x36')](_0x10348d['model'],_0x10348d[_0x185c('0x32')]);_0x44ac06['attributes']=_[_0x185c('0x36')](_0x10348d['model'],qs['fields'](_0x63faf9[_0x185c('0x32')][_0x185c('0x37')]));_0x44ac06[_0x185c('0x35')]=_0x44ac06['attributes']['length']?_0x44ac06[_0x185c('0x35')]:_0x10348d['model'];if(!_0x63faf9[_0x185c('0x32')][_0x185c('0x38')](_0x185c('0x39'))){_0x44ac06[_0x185c('0x1b')]=qs[_0x185c('0x1b')](_0x63faf9['query'][_0x185c('0x1b')]);_0x44ac06['offset']=qs['offset'](_0x63faf9[_0x185c('0x32')][_0x185c('0x1a')]);}_0x44ac06[_0x185c('0x3a')]=qs[_0x185c('0x3b')](_0x63faf9[_0x185c('0x32')][_0x185c('0x3b')]);_0x44ac06[_0x185c('0x3e')]=qs[_0x185c('0x34')](_[_0x185c('0x3c')](_0x63faf9[_0x185c('0x32')],_0x10348d[_0x185c('0x34')]));_0x44ac06[_0x185c('0x3e')][_0x185c('0x52')]=_0x2df1ae['id'];if(_0x63faf9[_0x185c('0x32')][_0x185c('0x3d')]){_0x44ac06[_0x185c('0x3e')]=_[_0x185c('0x3f')](_0x44ac06['where'],{'$or':_[_0x185c('0x2a')](_0x44ac06[_0x185c('0x35')],function(_0x1dd43c){var _0x2a237a={};_0x2a237a[_0x1dd43c]={'$like':'%'+_0x63faf9[_0x185c('0x32')][_0x185c('0x3d')]+'%'};return _0x2a237a;})});}_0x44ac06=_['merge']({},_0x44ac06,_0x63faf9[_0x185c('0x47')]);return db[_0x185c('0x53')]['count']({'where':_0x44ac06[_0x185c('0x3e')]})[_0x185c('0x21')](function(_0x36c778){_0x296135[_0x185c('0x1c')]=_0x36c778;if(_0x63faf9[_0x185c('0x32')][_0x185c('0x41')]){_0x44ac06[_0x185c('0x42')]=[{'all':!![]}];}return db[_0x185c('0x53')][_0x185c('0x43')](_0x44ac06);})[_0x185c('0x21')](function(_0x2c1bb6){_0x296135[_0x185c('0x44')]=_0x2c1bb6;return _0x296135;});}})[_0x185c('0x21')](respondWithFilteredResult(_0x575962,_0x44ac06))[_0x185c('0x45')](handleError(_0x575962,null));};exports[_0x185c('0x55')]=function(_0x4e1da0,_0x286bba,_0x30ea98){return db[_0x185c('0x2b')][_0x185c('0x48')]({'where':{'id':_0x4e1da0[_0x185c('0x4f')]['id']}})[_0x185c('0x21')](handleEntityNotFound(_0x286bba,null))[_0x185c('0x21')](function(_0x5f267e){if(_0x5f267e){return _0x5f267e['removeDispositions'](_0x4e1da0[_0x185c('0x32')][_0x185c('0x56')]);}})[_0x185c('0x21')](respondWithStatusCode(_0x286bba,null))['catch'](handleError(_0x286bba,null));};exports[_0x185c('0x57')]=function(_0x1b340f,_0x5c2e21,_0x24e49d){return db[_0x185c('0x2b')]['find']({'where':{'id':_0x1b340f['params']['id']}})['then'](handleEntityNotFound(_0x5c2e21,null))[_0x185c('0x21')](function(_0x8c8c2c){if(_0x8c8c2c){var _0x5d6114=[];var _0x5acefd={'success':[],'errors':[]};return db[_0x185c('0x58')]['describe']()[_0x185c('0x21')](function(_0x543b1c){if(_0x1b340f['body']['tags']&&_[_0x185c('0x59')](_0x1b340f[_0x185c('0x4e')][_0x185c('0x5a')])){if(_0x1b340f['body'][_0x185c('0x5a')]['length']){_0x1b340f[_0x185c('0x4e')]['tags']=_0x1b340f['body']['tags'][_0x185c('0x5b')](';')+';';}else{_0x1b340f[_0x185c('0x4e')][_0x185c('0x5a')]=null;}}else{_0x1b340f[_0x185c('0x4e')]['tags']=null;}if(_0x1b340f[_0x185c('0x4e')]&&_['isArray'](_0x1b340f[_0x185c('0x4e')])){for(var _0x43105d=0x0;_0x43105d<_0x1b340f[_0x185c('0x4e')][_0x185c('0x46')];_0x43105d+=0x1){_0x1b340f[_0x185c('0x4e')][_0x43105d][_0x185c('0x52')]=_0x1b340f['params']['id'];_0x5d6114[_0x185c('0x5c')](_0x1b340f[_0x185c('0x4e')][_0x43105d]);}return BPromise[_0x185c('0x5d')](_0x5d6114,function(_0x49eaeb){return db[_0x185c('0x58')]['create'](_[_0x185c('0x5e')](_0x49eaeb,['ids','id'])||{},{'fields':_[_0x185c('0x33')](_0x543b1c),'raw':!![]})[_0x185c('0x21')](function(_0x132b56){_0x5acefd[_0x185c('0x5f')][_0x185c('0x5c')](_0x132b56[_0x185c('0x60')]);})['catch'](function(_0x21a410){_0x5acefd[_0x185c('0x61')]['push']({'data':_0x49eaeb,'error':_0x21a410[_0x185c('0x62')]});});})[_0x185c('0x21')](function(_0x26a2e9){return _0x5acefd;})['catch'](function(_0x3a78eb){return _0x3a78eb;});}else{_0x5c2e21[_0x185c('0x18')](0x190)[_0x185c('0x19')]({'message':_0x185c('0x63')});}});}})[_0x185c('0x21')](respondWithResult(_0x5c2e21,null))[_0x185c('0x45')](handleError(_0x5c2e21,null));};exports[_0x185c('0x64')]=function(_0x43545c,_0xf16bd8,_0x1d8b97){var _0x59f1b7;return db[_0x185c('0x2b')][_0x185c('0x48')]({'where':{'id':_0x43545c[_0x185c('0x4f')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x185c('0x65')}]})[_0x185c('0x21')](handleEntityNotFound(_0xf16bd8,null))['then'](function(_0x47aa9c){if(_0x47aa9c){_0x59f1b7=_0x47aa9c;return db[_0x185c('0x58')][_0x185c('0x2c')];}})[_0x185c('0x21')](function(_0xf2e9b7){if(_0xf2e9b7){var _0x1b4692={};var _0x59358f={};_0x59358f[_0x185c('0x30')]=_['concat'](_[_0x185c('0x33')](_0xf2e9b7),_[_0x185c('0x2a')](_0x59f1b7[_0x185c('0x65')],function(_0x263d2b){return util[_0x185c('0x66')](_0x185c('0x67'),_0x263d2b['id']);}));_0x59358f[_0x185c('0x32')]=_[_0x185c('0x33')](_0x43545c[_0x185c('0x32')]);_0x59358f[_0x185c('0x34')]=_[_0x185c('0x36')](_0x59358f[_0x185c('0x30')],_0x59358f[_0x185c('0x32')]);_0x1b4692['attributes']=_[_0x185c('0x36')](_0x59358f[_0x185c('0x30')],qs[_0x185c('0x37')](_0x43545c[_0x185c('0x32')][_0x185c('0x37')]));_0x1b4692['attributes']=_0x1b4692[_0x185c('0x35')][_0x185c('0x46')]?_0x1b4692[_0x185c('0x35')]:_0x59358f['model'];if(!_0x43545c[_0x185c('0x32')][_0x185c('0x38')](_0x185c('0x39'))){_0x1b4692['limit']=qs[_0x185c('0x1b')](_0x43545c[_0x185c('0x32')][_0x185c('0x1b')]);_0x1b4692[_0x185c('0x1a')]=qs[_0x185c('0x1a')](_0x43545c['query'][_0x185c('0x1a')]);}_0x1b4692['order']=qs[_0x185c('0x3b')](_0x43545c[_0x185c('0x32')][_0x185c('0x3b')]);_0x1b4692[_0x185c('0x3e')]=qs['filters'](_['pick'](_0x43545c[_0x185c('0x32')],_0x59358f[_0x185c('0x34')]));_0x1b4692[_0x185c('0x68')]=!![];if(_0x43545c[_0x185c('0x32')][_0x185c('0x3d')]){_0x1b4692[_0x185c('0x3e')]=_[_0x185c('0x3f')](_0x1b4692['where'],{'$or':_[_0x185c('0x2a')](_0x1b4692['attributes'],function(_0x386b00){var _0x46b24c={};_0x46b24c[_0x386b00]={'$like':'%'+_0x43545c[_0x185c('0x32')][_0x185c('0x3d')]+'%'};return _0x46b24c;})});}_0x1b4692=_[_0x185c('0x3f')]({},_0x1b4692,_0x43545c['options']);return _0x59f1b7['getContacts'](_0x1b4692);}})[_0x185c('0x21')](respondWithResult(_0xf16bd8,null))['catch'](handleError(_0xf16bd8,null));};exports['getContactsCsv']=function(_0x21883f,_0x389b7a,_0x4c17ef){var _0x35aaf3;return db[_0x185c('0x2b')][_0x185c('0x48')]({'where':{'id':_0x21883f[_0x185c('0x4f')]['id']},'include':[{'model':db[_0x185c('0x69')],'as':_0x185c('0x65')}]})[_0x185c('0x21')](handleEntityNotFound(_0x389b7a,null))[_0x185c('0x21')](function(_0x28b9cf){if(_0x28b9cf){_0x35aaf3=_0x28b9cf;return db[_0x185c('0x58')][_0x185c('0x2c')];}})['then'](function(_0x462254){if(_0x462254){var _0x1d9ddb={};var _0x421d1f={};_0x421d1f[_0x185c('0x30')]=_[_0x185c('0x6a')](_[_0x185c('0x33')](_0x462254),_['map'](_0x35aaf3[_0x185c('0x65')],function(_0x2e73b7){return util['format']('cf_%d',_0x2e73b7['id']);}));_0x421d1f[_0x185c('0x32')]=_[_0x185c('0x33')](_0x21883f['query']);_0x421d1f['filters']=_[_0x185c('0x36')](_0x421d1f[_0x185c('0x30')],_0x421d1f['query']);_0x1d9ddb[_0x185c('0x35')]=_[_0x185c('0x36')](_0x421d1f[_0x185c('0x30')],qs[_0x185c('0x37')](_0x21883f[_0x185c('0x32')][_0x185c('0x37')]));_0x1d9ddb[_0x185c('0x35')]=_0x1d9ddb['attributes'][_0x185c('0x46')]?_0x1d9ddb[_0x185c('0x35')]:_0x421d1f['model'];if(!_0x21883f[_0x185c('0x32')][_0x185c('0x38')](_0x185c('0x39'))){_0x1d9ddb[_0x185c('0x1b')]=qs[_0x185c('0x1b')](_0x21883f[_0x185c('0x32')][_0x185c('0x1b')]);_0x1d9ddb[_0x185c('0x1a')]=qs[_0x185c('0x1a')](_0x21883f[_0x185c('0x32')][_0x185c('0x1a')]);}_0x1d9ddb['order']=qs['sort'](_0x21883f['query']['sort']);_0x1d9ddb[_0x185c('0x3e')]=qs[_0x185c('0x34')](_[_0x185c('0x3c')](_0x21883f[_0x185c('0x32')],_0x421d1f[_0x185c('0x34')]));_0x1d9ddb['raw']=!![];if(_0x21883f[_0x185c('0x32')]['filter']){_0x1d9ddb[_0x185c('0x3e')]=_['merge'](_0x1d9ddb[_0x185c('0x3e')],{'$or':_[_0x185c('0x2a')](_0x1d9ddb['attributes'],function(_0x389e21){var _0x55e429={};_0x55e429[_0x389e21]={'$like':'%'+_0x21883f[_0x185c('0x32')][_0x185c('0x3d')]+'%'};return _0x55e429;})});}_0x1d9ddb=_[_0x185c('0x3f')]({},_0x1d9ddb,_0x21883f[_0x185c('0x47')]);return _0x35aaf3[_0x185c('0x64')](_0x1d9ddb);}})[_0x185c('0x21')](function(_0x1387ba){if(!_[_0x185c('0x6b')](_0x1387ba)){var _0x44a941=toCsv(_0x1387ba);var _0x3a1046=Date[_0x185c('0x6c')]();fs[_0x185c('0x6d')](util[_0x185c('0x66')](_0x185c('0x6e'),_0x35aaf3['id'],_0x3a1046),_0x44a941);_0x389b7a[_0x185c('0x6f')]('Content-disposition','attachment;\x20filename='+util[_0x185c('0x66')]('list_%d_%s.csv',_0x35aaf3['id'],_0x3a1046));_0x389b7a[_0x185c('0x6f')](_0x185c('0x70'),'text/csv');return _0x389b7a[_0x185c('0x71')](util['format'](_0x185c('0x6e'),_0x35aaf3['id'],_0x3a1046));}else{return _0x389b7a['sendStatus'](0xcc);}})['catch'](handleError(_0x389b7a,null));};exports[_0x185c('0x72')]=function(_0x20690d,_0x574a81,_0x183e74){var _0x19aab7;delete _0x20690d['body']['id'];return db['CmList'][_0x185c('0x54')]({'where':{'id':_0x20690d[_0x185c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x574a81,null))['then'](function(_0x31137c){if(_0x31137c){return db[_0x185c('0x73')][_0x185c('0x74')](function(_0x265e9b){return db[_0x185c('0x69')][_0x185c('0x4c')](_0x20690d[_0x185c('0x4e')],{'transaction':_0x265e9b})[_0x185c('0x21')](function(_0x191b1e){_0x19aab7=_0x191b1e;return _0x31137c[_0x185c('0x75')](_0x191b1e,{'transaction':_0x265e9b});})[_0x185c('0x21')](function(){var _0x51873e={'type':db[_0x185c('0x76')]['TEXT'],'transaction':_0x265e9b};switch(_0x20690d['body'][_0x185c('0x2e')]){case _0x185c('0x77'):_0x51873e[_0x185c('0x2e')]=db[_0x185c('0x76')][_0x185c('0x78')];break;case _0x185c('0x79'):_0x51873e[_0x185c('0x2e')]=db[_0x185c('0x76')][_0x185c('0x7a')];break;case _0x185c('0x7b'):_0x51873e['type']=db[_0x185c('0x76')]['BOOLEAN'];_0x51873e[_0x185c('0x7c')]=![];break;default:}return db[_0x185c('0x73')]['queryInterface'][_0x185c('0x7d')](_0x185c('0x7e'),util[_0x185c('0x66')](_0x185c('0x7f'),_0x19aab7['id']),_0x51873e);})[_0x185c('0x21')](function(){return _0x19aab7;});});}})['then'](respondWithResult(_0x574a81,null))[_0x185c('0x45')](handleError(_0x574a81,null));};exports[_0x185c('0x80')]=function(_0xc0e261,_0x42c96d,_0x173682){var _0x21137e={};var _0x2e8fc5={};var _0x25558;var _0x13c1b8;return db[_0x185c('0x2b')][_0x185c('0x54')]({'where':{'id':_0xc0e261[_0x185c('0x4f')]['id']}})[_0x185c('0x21')](handleEntityNotFound(_0x42c96d,null))['then'](function(_0x32c615){if(_0x32c615){_0x25558=_0x32c615;_0x2e8fc5[_0x185c('0x30')]=_[_0x185c('0x33')](db[_0x185c('0x69')][_0x185c('0x2c')]);_0x2e8fc5[_0x185c('0x32')]=_['keys'](_0xc0e261[_0x185c('0x32')]);_0x2e8fc5[_0x185c('0x34')]=_[_0x185c('0x36')](_0x2e8fc5[_0x185c('0x30')],_0x2e8fc5['query']);_0x21137e['attributes']=_[_0x185c('0x36')](_0x2e8fc5[_0x185c('0x30')],qs[_0x185c('0x37')](_0xc0e261[_0x185c('0x32')][_0x185c('0x37')]));_0x21137e['attributes']=_0x21137e[_0x185c('0x35')]['length']?_0x21137e[_0x185c('0x35')]:_0x2e8fc5[_0x185c('0x30')];_0x21137e['order']=qs['sort'](_0xc0e261[_0x185c('0x32')][_0x185c('0x3b')]);_0x21137e['where']=qs[_0x185c('0x34')](_[_0x185c('0x3c')](_0xc0e261[_0x185c('0x32')],_0x2e8fc5[_0x185c('0x34')]));_0x21137e[_0x185c('0x3e')]=_[_0x185c('0x3f')](_0x21137e[_0x185c('0x3e')],{'$or':[{'ListId':_0x32c615['id']},{'ListId':null}]});if(_0xc0e261['query'][_0x185c('0x3d')]){_0x21137e[_0x185c('0x3e')]=_['merge'](_0x21137e[_0x185c('0x3e')],{'$or':_[_0x185c('0x2a')](_0x21137e[_0x185c('0x35')],function(_0x121eb9){var _0x512b7c={};_0x512b7c[_0x121eb9]={'$like':'%'+_0xc0e261[_0x185c('0x32')][_0x185c('0x3d')]+'%'};return _0x512b7c;})});}_0x21137e=_['merge']({},_0x21137e,_0xc0e261[_0x185c('0x47')]);return db[_0x185c('0x69')][_0x185c('0x81')](_0x21137e);}})[_0x185c('0x21')](respondWithResult(_0x42c96d,null))[_0x185c('0x45')](handleError(_0x42c96d,null));};exports[_0x185c('0x82')]=function(_0x39ec9e,_0x3076b9,_0x42cb86){return db['CmList'][_0x185c('0x48')]({'where':{'id':_0x39ec9e['params']['id']}})[_0x185c('0x21')](handleEntityNotFound(_0x3076b9,null))['then'](function(_0x1f5c09){if(_0x1f5c09){return _0x1f5c09[_0x185c('0x82')](_0x39ec9e[_0x185c('0x4e')][_0x185c('0x56')],_['omit'](_0x39ec9e['body'],[_0x185c('0x56'),'id'])||{})[_0x185c('0x83')](function(_0x16e77a){for(var _0x10edc9=0x0;_0x10edc9<_0x39ec9e['body'][_0x185c('0x56')][_0x185c('0x46')];_0x10edc9+=0x1){socket[_0x185c('0x84')](_0x185c('0x85'),{'UserId':Number(_0x39ec9e[_0x185c('0x4e')][_0x185c('0x56')][_0x10edc9]),'CmListId':Number(_0x39ec9e[_0x185c('0x4f')]['id'])});}return _0x16e77a;});}})[_0x185c('0x21')](respondWithResult(_0x3076b9,null))[_0x185c('0x45')](handleError(_0x3076b9,null));};exports[_0x185c('0x86')]=function(_0x3fc34c,_0x319ae5,_0x1c3dee){return db['CmList'][_0x185c('0x48')]({'where':{'id':_0x3fc34c[_0x185c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x319ae5,null))[_0x185c('0x21')](function(_0xf3609b){if(_0xf3609b){return _0xf3609b[_0x185c('0x86')](_0x3fc34c[_0x185c('0x32')][_0x185c('0x56')])[_0x185c('0x21')](function(){if(_[_0x185c('0x59')](_0x3fc34c[_0x185c('0x32')][_0x185c('0x56')])){for(var _0x197109=0x0;_0x197109<_0x3fc34c['query'][_0x185c('0x56')]['length'];_0x197109+=0x1){socket[_0x185c('0x84')](_0x185c('0x87'),{'UserId':Number(_0x3fc34c[_0x185c('0x32')][_0x185c('0x56')][_0x197109]),'CmListId':Number(_0x3fc34c[_0x185c('0x4f')]['id'])});}}else{socket['emit'](_0x185c('0x87'),{'UserId':Number(_0x3fc34c[_0x185c('0x32')][_0x185c('0x56')]),'CmListId':Number(_0x3fc34c[_0x185c('0x4f')]['id'])});}});}})[_0x185c('0x21')](respondWithStatusCode(_0x319ae5,null))[_0x185c('0x45')](handleError(_0x319ae5,null));};exports[_0x185c('0x88')]=function(_0x25a68f,_0x1f3450,_0x5868db){var _0x43f6fe={};var _0x1c2df1={};var _0x2b09f9;var _0x5858cc;return db['CmList'][_0x185c('0x54')]({'where':{'id':_0x25a68f[_0x185c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1f3450,null))[_0x185c('0x21')](function(_0x4ba0d6){if(_0x4ba0d6){_0x2b09f9=_0x4ba0d6;_0x1c2df1[_0x185c('0x30')]=_[_0x185c('0x33')](db[_0x185c('0x89')]['rawAttributes']);_0x1c2df1[_0x185c('0x32')]=_[_0x185c('0x33')](_0x25a68f[_0x185c('0x32')]);_0x1c2df1[_0x185c('0x34')]=_[_0x185c('0x36')](_0x1c2df1[_0x185c('0x30')],_0x1c2df1[_0x185c('0x32')]);_0x43f6fe[_0x185c('0x35')]=_[_0x185c('0x36')](_0x1c2df1[_0x185c('0x30')],qs[_0x185c('0x37')](_0x25a68f['query'][_0x185c('0x37')]));_0x43f6fe[_0x185c('0x35')]=_0x43f6fe[_0x185c('0x35')]['length']?_0x43f6fe[_0x185c('0x35')]:_0x1c2df1[_0x185c('0x30')];_0x43f6fe[_0x185c('0x3a')]=qs[_0x185c('0x3b')](_0x25a68f['query'][_0x185c('0x3b')]);_0x43f6fe['where']=qs[_0x185c('0x34')](_['pick'](_0x25a68f[_0x185c('0x32')],_0x1c2df1['filters']));if(_0x25a68f[_0x185c('0x32')][_0x185c('0x3d')]){_0x43f6fe[_0x185c('0x3e')]=_[_0x185c('0x3f')](_0x43f6fe[_0x185c('0x3e')],{'$or':_[_0x185c('0x2a')](_0x43f6fe[_0x185c('0x35')],function(_0x5b4510){var _0x445bce={};_0x445bce[_0x5b4510]={'$like':'%'+_0x25a68f[_0x185c('0x32')][_0x185c('0x3d')]+'%'};return _0x445bce;})});}_0x43f6fe=_[_0x185c('0x3f')]({},_0x43f6fe,_0x25a68f[_0x185c('0x47')]);return _0x2b09f9[_0x185c('0x88')](_0x43f6fe);}})[_0x185c('0x21')](function(_0x44e1a6){if(_0x44e1a6){_0x5858cc=_0x44e1a6[_0x185c('0x46')];if(!_0x25a68f['query'][_0x185c('0x38')](_0x185c('0x39'))){_0x43f6fe[_0x185c('0x1b')]=qs[_0x185c('0x1b')](_0x25a68f[_0x185c('0x32')][_0x185c('0x1b')]);_0x43f6fe['offset']=qs[_0x185c('0x1a')](_0x25a68f[_0x185c('0x32')][_0x185c('0x1a')]);}return _0x2b09f9['getAgents'](_0x43f6fe);}})[_0x185c('0x21')](function(_0x303eb2){if(_0x303eb2){return _0x303eb2?{'count':_0x5858cc,'rows':_0x303eb2}:null;}})[_0x185c('0x21')](respondWithResult(_0x1f3450,null))[_0x185c('0x45')](handleError(_0x1f3450,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index ada46f9..63870f2 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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x52dbd2,_0x1b9a03){_0x52dbd2=_0x52dbd2-0x0;var _0x5daff7=_0x3e74[_0x52dbd2];return _0x5daff7;};'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 _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x55ca,0x126));var _0xa55c=function(_0x19af51,_0x3834ac){_0x19af51=_0x19af51-0x0;var _0x997581=_0x55ca[_0x19af51];return _0x997581;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 4dff2a2..63e034d 100644 --- a/server/api/cmList/cmList.model.js +++ b/server/api/cmList/cmList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb903=['rimraf','../../config/environment','./cmList.attributes','exports','cm_lists','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x535c2b,_0x13368b){var _0x347f9d=function(_0x1c3b4d){while(--_0x1c3b4d){_0x535c2b['push'](_0x535c2b['shift']());}};_0x347f9d(++_0x13368b);}(_0xb903,0x185));var _0x3b90=function(_0x28d0b5,_0x5241b2){_0x28d0b5=_0x28d0b5-0x0;var _0x502ec=_0xb903[_0x28d0b5];return _0x502ec;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var fs=require('fs');var path=require(_0x3b90('0x6'));var rimraf=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var attributes=require(_0x3b90('0x9'));module[_0x3b90('0xa')]=function(_0x5acd76,_0x15b68f){return _0x5acd76['define']('CmList',attributes,{'tableName':_0x3b90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c81=['moment','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','util','api'];(function(_0x4de267,_0x19d341){var _0x1edf15=function(_0x5800a6){while(--_0x5800a6){_0x4de267['push'](_0x4de267['shift']());}};_0x1edf15(++_0x19d341);}(_0x3c81,0x102));var _0x13c8=function(_0x8df409,_0x105cbd){_0x8df409=_0x8df409-0x0;var _0x3b48a4=_0x3c81[_0x8df409];return _0x3b48a4;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var logger=require('../../config/logger')(_0x13c8('0x2'));var moment=require(_0x13c8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x13c8('0x4'));var attributes=require(_0x13c8('0x5'));module[_0x13c8('0x6')]=function(_0x1c16f1,_0x2a4d66){return _0x1c16f1[_0x13c8('0x7')](_0x13c8('0x8'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 60a81c9..312fed2 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 _0xa6be=['error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x53f838,_0x1f19cc){var _0x56b3dc=function(_0x4eba9c){while(--_0x4eba9c){_0x53f838['push'](_0x53f838['shift']());}};_0x56b3dc(++_0x1f19cc);}(_0xa6be,0x170));var _0xea6b=function(_0x391c18,_0x446cb7){_0x391c18=_0x391c18-0x0;var _0x5e08c5=_0xa6be[_0x391c18];return _0x5e08c5;};'use strict';var _=require(_0xea6b('0x0'));var util=require(_0xea6b('0x1'));var moment=require('moment');var BPromise=require(_0xea6b('0x2'));var rs=require(_0xea6b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea6b('0x4'))['db'];var utils=require(_0xea6b('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xea6b('0x6'));var client=jayson['client'][_0xea6b('0x7')]({'port':0x232a});config[_0xea6b('0x8')]=_[_0xea6b('0x9')](config[_0xea6b('0x8')],{'host':_0xea6b('0xa'),'port':0x18eb});var socket=require(_0xea6b('0xb'))(new Redis(config['redis']));require(_0xea6b('0xc'))[_0xea6b('0xd')](socket);function respondWithRpcPromise(_0x3911d2,_0x29d97d,_0x458144){return new BPromise(function(_0x54efa9,_0x58702b){return client[_0xea6b('0xe')](_0x3911d2,_0x458144)[_0xea6b('0xf')](function(_0x19f7eb){logger[_0xea6b('0x10')](_0xea6b('0x11'),_0x29d97d,_0xea6b('0x12'));logger[_0xea6b('0x13')](_0xea6b('0x14'),_0x29d97d,'request\x20sent',JSON[_0xea6b('0x15')](_0x19f7eb));if(_0x19f7eb[_0xea6b('0x16')]){if(_0x19f7eb['error'][_0xea6b('0x17')]===0x1f4){logger[_0xea6b('0x16')](_0xea6b('0x11'),_0x29d97d,_0x19f7eb[_0xea6b('0x16')]['message']);return _0x58702b(_0x19f7eb[_0xea6b('0x16')][_0xea6b('0x18')]);}logger[_0xea6b('0x16')](_0xea6b('0x11'),_0x29d97d,_0x19f7eb[_0xea6b('0x16')][_0xea6b('0x18')]);return _0x54efa9(_0x19f7eb['error'][_0xea6b('0x18')]);}else{logger[_0xea6b('0x10')]('CmList,\x20%s,\x20%s',_0x29d97d,_0xea6b('0x12'));_0x54efa9(_0x19f7eb[_0xea6b('0x19')][_0xea6b('0x18')]);}})['catch'](function(_0x5ca19c){logger[_0xea6b('0x16')](_0xea6b('0x11'),_0x29d97d,_0x5ca19c);_0x58702b(_0x5ca19c);});});} \ No newline at end of file +var _0xb129=['message','result','catch','util','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','defaults','localhost','socket.io-emitter','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3f8225,_0x14fa53){var _0x309bfd=function(_0x5c88ae){while(--_0x5c88ae){_0x3f8225['push'](_0x3f8225['shift']());}};_0x309bfd(++_0x14fa53);}(_0xb129,0x16b));var _0x9b12=function(_0x3d9dc2,_0x4d0f69){_0x3d9dc2=_0x3d9dc2-0x0;var _0x9f75a0=_0xb129[_0x3d9dc2];return _0x9f75a0;};'use strict';var _=require('lodash');var util=require(_0x9b12('0x0'));var moment=require('moment');var BPromise=require(_0x9b12('0x1'));var rs=require(_0x9b12('0x2'));var fs=require('fs');var Redis=require(_0x9b12('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9b12('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9b12('0x5'));var client=jayson[_0x9b12('0x6')][_0x9b12('0x7')]({'port':0x232a});config['redis']=_[_0x9b12('0x8')](config['redis'],{'host':_0x9b12('0x9'),'port':0x18eb});var socket=require(_0x9b12('0xa'))(new Redis(config['redis']));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x4cba2c,_0x3ecd26,_0x34808a){return new BPromise(function(_0x30d023,_0x555e56){return client[_0x9b12('0xb')](_0x4cba2c,_0x34808a)[_0x9b12('0xc')](function(_0x1e99c6){logger[_0x9b12('0xd')](_0x9b12('0xe'),_0x3ecd26,'request\x20sent');logger[_0x9b12('0xf')](_0x9b12('0x10'),_0x3ecd26,_0x9b12('0x11'),JSON[_0x9b12('0x12')](_0x1e99c6));if(_0x1e99c6[_0x9b12('0x13')]){if(_0x1e99c6[_0x9b12('0x13')][_0x9b12('0x14')]===0x1f4){logger[_0x9b12('0x13')](_0x9b12('0xe'),_0x3ecd26,_0x1e99c6[_0x9b12('0x13')][_0x9b12('0x15')]);return _0x555e56(_0x1e99c6[_0x9b12('0x13')][_0x9b12('0x15')]);}logger[_0x9b12('0x13')](_0x9b12('0xe'),_0x3ecd26,_0x1e99c6['error']['message']);return _0x30d023(_0x1e99c6['error'][_0x9b12('0x15')]);}else{logger[_0x9b12('0xd')]('CmList,\x20%s,\x20%s',_0x3ecd26,'request\x20sent');_0x30d023(_0x1e99c6[_0x9b12('0x16')]['message']);}})[_0x9b12('0x17')](function(_0x185cae){logger['error'](_0x9b12('0xe'),_0x3ecd26,_0x185cae);_0x555e56(_0x185cae);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 7c1fb97..f223244 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 _0x360f=['register','length','cmList:','./cmList.events','save','update','emit','removeListener'];(function(_0x3694ae,_0x89e34b){var _0x2e4cfd=function(_0x31a1d0){while(--_0x31a1d0){_0x3694ae['push'](_0x3694ae['shift']());}};_0x2e4cfd(++_0x89e34b);}(_0x360f,0xc3));var _0xf360=function(_0xeef80d,_0x3148c2){_0xeef80d=_0xeef80d-0x0;var _0x48d2df=_0x360f[_0xeef80d];return _0x48d2df;};'use strict';var CmListEvents=require(_0xf360('0x0'));var events=[_0xf360('0x1'),'remove',_0xf360('0x2')];function createListener(_0x182e36,_0x1ab9f6){return function(_0x5a8fa4){_0x1ab9f6[_0xf360('0x3')](_0x182e36,_0x5a8fa4);};}function removeListener(_0x1fb1da,_0x21d4f9){return function(){CmListEvents[_0xf360('0x4')](_0x1fb1da,_0x21d4f9);};}exports[_0xf360('0x5')]=function(_0x55eb7e){for(var _0x116e4b=0x0,_0x1931f1=events[_0xf360('0x6')];_0x116e4b<_0x1931f1;_0x116e4b++){var _0x52c7eb=events[_0x116e4b];var _0x30f793=createListener(_0xf360('0x7')+_0x52c7eb,_0x55eb7e);CmListEvents['on'](_0x52c7eb,_0x30f793);}}; \ No newline at end of file +var _0x0c65=['update','removeListener','register','length','remove'];(function(_0x259d17,_0x220710){var _0x407535=function(_0x49bc38){while(--_0x49bc38){_0x259d17['push'](_0x259d17['shift']());}};_0x407535(++_0x220710);}(_0x0c65,0x153));var _0x50c6=function(_0x40e7aa,_0xb952d9){_0x40e7aa=_0x40e7aa-0x0;var _0x2dc873=_0x0c65[_0x40e7aa];return _0x2dc873;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0x50c6('0x0'),_0x50c6('0x1')];function createListener(_0x9fd98,_0x4d6a3a){return function(_0x148924){_0x4d6a3a['emit'](_0x9fd98,_0x148924);};}function removeListener(_0xba1a05,_0x17f0f4){return function(){CmListEvents[_0x50c6('0x2')](_0xba1a05,_0x17f0f4);};}exports[_0x50c6('0x3')]=function(_0x4a350d){for(var _0x157fe2=0x0,_0x63fd9d=events[_0x50c6('0x4')];_0x157fe2<_0x63fd9d;_0x157fe2++){var _0x18dd0c=events[_0x157fe2];var _0x1acad7=createListener('cmList:'+_0x18dd0c,_0x4a350d);CmListEvents['on'](_0x18dd0c,_0x1acad7);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index c6f44b6..9984341 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 _0x010e=['isAuthenticated','index','/describe','describe','/:id','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/contacts','addCustomField','delete','removeDispositions','removeAgents','exports','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x010e,0x1c9));var _0xe010=function(_0xd8936d,_0x3512bb){_0xd8936d=_0xd8936d-0x0;var _0x5f15f5=_0x010e[_0xd8936d];return _0x5f15f5;};'use strict';var multer=require(_0xe010('0x0'));var util=require('util');var path=require(_0xe010('0x1'));var timeout=require('connect-timeout');var express=require(_0xe010('0x2'));var router=express['Router']();var fs_extra=require(_0xe010('0x3'));var auth=require(_0xe010('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe010('0x5'));var controller=require(_0xe010('0x6'));router[_0xe010('0x7')]('/',auth[_0xe010('0x8')](),controller[_0xe010('0x9')]);router[_0xe010('0x7')](_0xe010('0xa'),auth['isAuthenticated'](),controller[_0xe010('0xb')]);router[_0xe010('0x7')](_0xe010('0xc'),auth[_0xe010('0x8')](),controller['show']);router[_0xe010('0x7')]('/:id/dispositions',auth[_0xe010('0x8')](),controller[_0xe010('0xd')]);router[_0xe010('0x7')]('/:id/contacts',auth[_0xe010('0x8')](),controller[_0xe010('0xe')]);router[_0xe010('0x7')](_0xe010('0xf'),auth['isAuthenticated'](),controller[_0xe010('0x10')]);router['get'](_0xe010('0x11'),auth[_0xe010('0x8')](),controller[_0xe010('0x12')]);router['get'](_0xe010('0x13'),auth[_0xe010('0x8')](),controller[_0xe010('0x14')]);router[_0xe010('0x15')]('/',auth[_0xe010('0x8')](),controller[_0xe010('0x16')]);router[_0xe010('0x15')](_0xe010('0x17'),auth['isAuthenticated'](),controller[_0xe010('0x18')]);router[_0xe010('0x15')](_0xe010('0x19'),auth[_0xe010('0x8')](),controller['addContacts']);router[_0xe010('0x15')](_0xe010('0x11'),auth['isAuthenticated'](),controller[_0xe010('0x1a')]);router[_0xe010('0x15')](_0xe010('0x13'),auth[_0xe010('0x8')](),controller['addAgents']);router['put'](_0xe010('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe010('0x1b')]('/:id',auth[_0xe010('0x8')](),controller['destroy']);router['delete'](_0xe010('0x17'),auth[_0xe010('0x8')](),controller[_0xe010('0x1c')]);router[_0xe010('0x1b')]('/:id/users',auth[_0xe010('0x8')](),controller[_0xe010('0x1d')]);module[_0xe010('0x1e')]=router; \ No newline at end of file +var _0x9578=['/:id/contacts','addCustomField','addAgents','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition'];(function(_0xbc346f,_0x3db5c0){var _0x9f9260=function(_0x37e6b9){while(--_0x37e6b9){_0xbc346f['push'](_0xbc346f['shift']());}};_0x9f9260(++_0x3db5c0);}(_0x9578,0x89));var _0x8957=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x9578[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x8957('0x0'));var util=require(_0x8957('0x1'));var path=require(_0x8957('0x2'));var timeout=require(_0x8957('0x3'));var express=require('express');var router=express[_0x8957('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8957('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8957('0x6'));var controller=require(_0x8957('0x7'));router[_0x8957('0x8')]('/',auth[_0x8957('0x9')](),controller[_0x8957('0xa')]);router[_0x8957('0x8')](_0x8957('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x8957('0x8')]('/:id',auth[_0x8957('0x9')](),controller['show']);router['get'](_0x8957('0xc'),auth[_0x8957('0x9')](),controller[_0x8957('0xd')]);router['get']('/:id/contacts',auth[_0x8957('0x9')](),controller[_0x8957('0xe')]);router[_0x8957('0x8')](_0x8957('0xf'),auth[_0x8957('0x9')](),controller[_0x8957('0x10')]);router[_0x8957('0x8')](_0x8957('0x11'),auth['isAuthenticated'](),controller[_0x8957('0x12')]);router[_0x8957('0x8')](_0x8957('0x13'),auth[_0x8957('0x9')](),controller[_0x8957('0x14')]);router[_0x8957('0x15')]('/',auth[_0x8957('0x9')](),controller['create']);router['post']('/:id/dispositions',auth[_0x8957('0x9')](),controller[_0x8957('0x16')]);router['post'](_0x8957('0x17'),auth[_0x8957('0x9')](),controller['addContacts']);router[_0x8957('0x15')](_0x8957('0x11'),auth[_0x8957('0x9')](),controller[_0x8957('0x18')]);router[_0x8957('0x15')](_0x8957('0x13'),auth[_0x8957('0x9')](),controller[_0x8957('0x19')]);router[_0x8957('0x1a')](_0x8957('0x1b'),auth['isAuthenticated'](),controller[_0x8957('0x1c')]);router[_0x8957('0x1d')](_0x8957('0x1b'),auth['isAuthenticated'](),controller[_0x8957('0x1e')]);router[_0x8957('0x1d')](_0x8957('0xc'),auth[_0x8957('0x9')](),controller['removeDispositions']);router['delete'](_0x8957('0x13'),auth[_0x8957('0x9')](),controller['removeAgents']);module[_0x8957('0x1f')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 574587e..e524394 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 _0x216c=['exports','VIRTUAL','field','STRING','sequelize'];(function(_0x340006,_0x3377a3){var _0x23ea3b=function(_0x1dbe8f){while(--_0x1dbe8f){_0x340006['push'](_0x340006['shift']());}};_0x23ea3b(++_0x3377a3);}(_0x216c,0x167));var _0xc216=function(_0x283cc9,_0x1bbcd7){_0x283cc9=_0x283cc9-0x0;var _0x25925d=_0x216c[_0x283cc9];return _0x25925d;};'use strict';var Sequelize=require(_0xc216('0x0'));module[_0xc216('0x1')]={'name':{'type':Sequelize[_0xc216('0x2')],'get':function(_0x22be3b){return this['getDataValue'](_0xc216('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xc216('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xc216('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x2568=['VIRTUAL','field','STRING','sequelize','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2568,0xc6));var _0x8256=function(_0x407df4,_0x4e33e3){_0x407df4=_0x407df4-0x0;var _0xbe12d2=_0x2568[_0x407df4];return _0xbe12d2;};'use strict';var Sequelize=require(_0x8256('0x0'));module[_0x8256('0x1')]={'name':{'type':Sequelize[_0x8256('0x2')],'get':function(_0x4157e8){return this['getDataValue'](_0x8256('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x8256('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x8256('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 8fdbd4f..87147cd 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(_0x58b92f,_0x3d9673){var _0x5f2d79=function(_0x1fc42b){while(--_0x1fc42b){_0x58b92f['push'](_0x58b92f['shift']());}};_0x5f2d79(++_0x3d9673);}(_0x7a54,0x106));var _0x47a5=function(_0x1773c0,_0x533272){_0x1773c0=_0x1773c0-0x0;var _0x51f640=_0x7a54[_0x1773c0];return _0x51f640;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x30e948,_0x29e888){var _0x1550ea=function(_0x5d868c){while(--_0x5d868c){_0x30e948['push'](_0x30e948['shift']());}};_0x1550ea(++_0x29e888);}(_0x7a54,0x106));var _0x47a5=function(_0x515f1f,_0x1e4ab6){_0x515f1f=_0x515f1f-0x0;var _0x5b658a=_0x7a54[_0x515f1f];return _0x5b658a;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index ac73490..aee286a 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 _0xc2ec=['Condition','tools_conditions','util','api','bluebird','request-promise','path','rimraf','./condition.attributes','exports'];(function(_0x9788e1,_0x42a6af){var _0x3afd06=function(_0x3fa614){while(--_0x3fa614){_0x9788e1['push'](_0x9788e1['shift']());}};_0x3afd06(++_0x42a6af);}(_0xc2ec,0x1a6));var _0xcc2e=function(_0x4dc81e,_0x49599e){_0x4dc81e=_0x4dc81e-0x0;var _0x4afc34=_0xc2ec[_0x4dc81e];return _0x4afc34;};'use strict';var _=require('lodash');var util=require(_0xcc2e('0x0'));var logger=require('../../config/logger')(_0xcc2e('0x1'));var moment=require('moment');var BPromise=require(_0xcc2e('0x2'));var rp=require(_0xcc2e('0x3'));var fs=require('fs');var path=require(_0xcc2e('0x4'));var rimraf=require(_0xcc2e('0x5'));var config=require('../../config/environment');var attributes=require(_0xcc2e('0x6'));module[_0xcc2e('0x7')]=function(_0x1c1194,_0x5ca0c8){return _0x1c1194['define'](_0xcc2e('0x8'),attributes,{'tableName':_0xcc2e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e59=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','util','../../config/logger'];(function(_0x3dc96d,_0x3e3888){var _0x43ab7d=function(_0x14eba0){while(--_0x14eba0){_0x3dc96d['push'](_0x3dc96d['shift']());}};_0x43ab7d(++_0x3e3888);}(_0x2e59,0xc2));var _0x92e5=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0x2e59[_0x35f83e];return _0x249b05;};'use strict';var _=require('lodash');var util=require(_0x92e5('0x0'));var logger=require(_0x92e5('0x1'))(_0x92e5('0x2'));var moment=require(_0x92e5('0x3'));var BPromise=require(_0x92e5('0x4'));var rp=require(_0x92e5('0x5'));var fs=require('fs');var path=require(_0x92e5('0x6'));var rimraf=require(_0x92e5('0x7'));var config=require(_0x92e5('0x8'));var attributes=require(_0x92e5('0x9'));module[_0x92e5('0xa')]=function(_0x5515f0,_0x2e51fb){return _0x5515f0[_0x92e5('0xb')](_0x92e5('0xc'),attributes,{'tableName':_0x92e5('0xd'),'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 020a179..76b7ddc 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 _0x2295=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error'];(function(_0x13aa60,_0x4e2e01){var _0x5e9e22=function(_0x5619c7){while(--_0x5619c7){_0x13aa60['push'](_0x13aa60['shift']());}};_0x5e9e22(++_0x4e2e01);}(_0x2295,0x1bb));var _0x5229=function(_0x21d701,_0x27eb55){_0x21d701=_0x21d701-0x0;var _0x1b6a35=_0x2295[_0x21d701];return _0x1b6a35;};'use strict';var _=require(_0x5229('0x0'));var util=require('util');var moment=require(_0x5229('0x1'));var BPromise=require(_0x5229('0x2'));var rs=require(_0x5229('0x3'));var fs=require('fs');var Redis=require(_0x5229('0x4'));var db=require(_0x5229('0x5'))['db'];var utils=require(_0x5229('0x6'));var logger=require(_0x5229('0x7'))('rpc');var config=require(_0x5229('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5229('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4af2f0,_0x57c237,_0x25baa6){return new BPromise(function(_0x59b6bc,_0x245fe5){return client[_0x5229('0xa')](_0x4af2f0,_0x25baa6)['then'](function(_0x1b1090){logger[_0x5229('0xb')](_0x5229('0xc'),_0x57c237,_0x5229('0xd'));logger[_0x5229('0xe')](_0x5229('0xf'),_0x57c237,'request\x20sent',JSON['stringify'](_0x1b1090));if(_0x1b1090[_0x5229('0x10')]){if(_0x1b1090[_0x5229('0x10')]['code']===0x1f4){logger[_0x5229('0x10')]('Condition,\x20%s,\x20%s',_0x57c237,_0x1b1090[_0x5229('0x10')][_0x5229('0x11')]);return _0x245fe5(_0x1b1090[_0x5229('0x10')][_0x5229('0x11')]);}logger[_0x5229('0x10')]('Condition,\x20%s,\x20%s',_0x57c237,_0x1b1090[_0x5229('0x10')]['message']);return _0x59b6bc(_0x1b1090['error'][_0x5229('0x11')]);}else{logger[_0x5229('0xb')]('Condition,\x20%s,\x20%s',_0x57c237,_0x5229('0xd'));_0x59b6bc(_0x1b1090[_0x5229('0x12')][_0x5229('0x11')]);}})[_0x5229('0x13')](function(_0x2e1295){logger[_0x5229('0x10')](_0x5229('0xc'),_0x57c237,_0x2e1295);_0x245fe5(_0x2e1295);});});} \ No newline at end of file +var _0xe185=['http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2a7c2a,_0x37cc9e){var _0x195732=function(_0x4d3902){while(--_0x4d3902){_0x2a7c2a['push'](_0x2a7c2a['shift']());}};_0x195732(++_0x37cc9e);}(_0xe185,0x147));var _0x5e18=function(_0x2ba86b,_0x49ac21){_0x2ba86b=_0x2ba86b-0x0;var _0x37c31b=_0xe185[_0x2ba86b];return _0x37c31b;};'use strict';var _=require(_0x5e18('0x0'));var util=require(_0x5e18('0x1'));var moment=require(_0x5e18('0x2'));var BPromise=require('bluebird');var rs=require(_0x5e18('0x3'));var fs=require('fs');var Redis=require(_0x5e18('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e18('0x5'));var logger=require(_0x5e18('0x6'))(_0x5e18('0x7'));var config=require('../../config/environment');var jayson=require(_0x5e18('0x8'));var client=jayson['client'][_0x5e18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x214c17,_0x3a303e,_0x1f481e){return new BPromise(function(_0x2a2515,_0x4c8287){return client[_0x5e18('0xa')](_0x214c17,_0x1f481e)[_0x5e18('0xb')](function(_0x5996cb){logger[_0x5e18('0xc')](_0x5e18('0xd'),_0x3a303e,_0x5e18('0xe'));logger[_0x5e18('0xf')](_0x5e18('0x10'),_0x3a303e,_0x5e18('0xe'),JSON[_0x5e18('0x11')](_0x5996cb));if(_0x5996cb['error']){if(_0x5996cb[_0x5e18('0x12')]['code']===0x1f4){logger[_0x5e18('0x12')]('Condition,\x20%s,\x20%s',_0x3a303e,_0x5996cb['error'][_0x5e18('0x13')]);return _0x4c8287(_0x5996cb[_0x5e18('0x12')][_0x5e18('0x13')]);}logger[_0x5e18('0x12')](_0x5e18('0xd'),_0x3a303e,_0x5996cb[_0x5e18('0x12')]['message']);return _0x2a2515(_0x5996cb[_0x5e18('0x12')][_0x5e18('0x13')]);}else{logger[_0x5e18('0xc')]('Condition,\x20%s,\x20%s',_0x3a303e,_0x5e18('0xe'));_0x2a2515(_0x5996cb['result']['message']);}})[_0x5e18('0x14')](function(_0x2a34a8){logger[_0x5e18('0x12')](_0x5e18('0xd'),_0x3a303e,_0x2a34a8);_0x4c8287(_0x2a34a8);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 4d4324e..6bac80f 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 _0x992e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2ed1bd,_0x525fe8){var _0x336cc8=function(_0x3f5dbf){while(--_0x3f5dbf){_0x2ed1bd['push'](_0x2ed1bd['shift']());}};_0x336cc8(++_0x525fe8);}(_0x992e,0xca));var _0xe992=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x992e[_0x550d12];return _0x12103d;};'use strict';var multer=require('multer');var util=require(_0xe992('0x0'));var path=require(_0xe992('0x1'));var timeout=require(_0xe992('0x2'));var express=require(_0xe992('0x3'));var router=express[_0xe992('0x4')]();var fs_extra=require(_0xe992('0x5'));var auth=require(_0xe992('0x6'));var interaction=require(_0xe992('0x7'));var config=require(_0xe992('0x8'));var controller=require(_0xe992('0x9'));router[_0xe992('0xa')](_0xe992('0xb'),auth[_0xe992('0xc')](),controller['update']);router[_0xe992('0xd')](_0xe992('0xb'),auth['isAuthenticated'](),controller[_0xe992('0xe')]);module[_0xe992('0xf')]=router; \ No newline at end of file +var _0xbffe=['put','/:id','isAuthenticated','update','delete','destroy','multer','path','Router','fs-extra','../../components/interaction/service'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbffe,0x1d4));var _0xebff=function(_0x486f3e,_0x465b3f){_0x486f3e=_0x486f3e-0x0;var _0x5d3286=_0xbffe[_0x486f3e];return _0x5d3286;};'use strict';var multer=require(_0xebff('0x0'));var util=require('util');var path=require(_0xebff('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xebff('0x2')]();var fs_extra=require(_0xebff('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xebff('0x4'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0xebff('0x5')](_0xebff('0x6'),auth[_0xebff('0x7')](),controller[_0xebff('0x8')]);router[_0xebff('0x9')](_0xebff('0x6'),auth['isAuthenticated'](),controller[_0xebff('0xa')]);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 0fe8b61..e94b69e 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 _0xb7e7=['STRING','sequelize'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xb7e7[_0x4b7b62];return _0x2280df;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0x14f538,_0x2268d9){var _0x58f39d=function(_0x10a747){while(--_0x10a747){_0x14f538['push'](_0x14f538['shift']());}};_0x58f39d(++_0x2268d9);}(_0x2032,0xd9));var _0x2203=function(_0x546afd,_0x227677){_0x546afd=_0x546afd-0x0;var _0x3a074d=_0x2032[_0x546afd];return _0x3a074d;};'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/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 1ca0032..f25f5bc 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 _0x8e7c=['attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','update','destroy','get','CustomDashboards','UserProfileResource','then','error','stack','name','send','map','Dashboard','rawAttributes','fieldName','type','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','role','userProfileId','iframe','attrUrl'];(function(_0x4c463a,_0x4411bb){var _0x54f816=function(_0x3086ce){while(--_0x3086ce){_0x4c463a['push'](_0x4c463a['shift']());}};_0x54f816(++_0x4411bb);}(_0x8e7c,0x126));var _0xc8e7=function(_0x5a3212,_0x18717e){_0x5a3212=_0x5a3212-0x0;var _0x520595=_0x8e7c[_0x5a3212];return _0x520595;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc8e7('0x0'));var zipdir=require(_0xc8e7('0x1'));var jsonpatch=require(_0xc8e7('0x2'));var rp=require(_0xc8e7('0x3'));var moment=require(_0xc8e7('0x4'));var BPromise=require(_0xc8e7('0x5'));var Mustache=require(_0xc8e7('0x6'));var util=require('util');var path=require(_0xc8e7('0x7'));var sox=require(_0xc8e7('0x8'));var csv=require('to-csv');var ejs=require(_0xc8e7('0x9'));var fs=require('fs');var fs_extra=require(_0xc8e7('0xa'));var _=require(_0xc8e7('0xb'));var squel=require(_0xc8e7('0xc'));var crypto=require('crypto');var jsforce=require(_0xc8e7('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc8e7('0xe'));var Papa=require(_0xc8e7('0xf'));var Redis=require(_0xc8e7('0x10'));var authService=require(_0xc8e7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc8e7('0x12'));var hardwareService=require(_0xc8e7('0x13'));var logger=require(_0xc8e7('0x14'))(_0xc8e7('0x15'));var utils=require(_0xc8e7('0x16'));var config=require(_0xc8e7('0x17'));var licenseUtil=require(_0xc8e7('0x18'));var db=require(_0xc8e7('0x19'))['db'];config[_0xc8e7('0x1a')]=_['defaults'](config[_0xc8e7('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xc8e7('0x1b'))(new Redis(config[_0xc8e7('0x1a')]));require(_0xc8e7('0x1c'))[_0xc8e7('0x1d')](socket);function respondWithStatusCode(_0x4af0af,_0x5f5990){_0x5f5990=_0x5f5990||0xcc;return function(_0xe874dc){if(_0xe874dc){return _0x4af0af[_0xc8e7('0x1e')](_0x5f5990);}return _0x4af0af[_0xc8e7('0x1f')](_0x5f5990)[_0xc8e7('0x20')]();};}function respondWithResult(_0x7dc00e,_0x21037a){_0x21037a=_0x21037a||0xc8;return function(_0x394dfd){if(_0x394dfd){return _0x7dc00e[_0xc8e7('0x1f')](_0x21037a)[_0xc8e7('0x21')](_0x394dfd);}};}function respondWithFilteredResult(_0x1e2ba1,_0x3292de){return function(_0x2e0b6c){if(_0x2e0b6c){var _0x5bc43d=typeof _0x3292de[_0xc8e7('0x22')]===_0xc8e7('0x23')&&typeof _0x3292de['limit']===_0xc8e7('0x23');var _0x41d9b9=_0x2e0b6c[_0xc8e7('0x24')];var _0x318557=_0x5bc43d?0x0:_0x3292de[_0xc8e7('0x22')];var _0xe2c2b9=_0x5bc43d?_0x2e0b6c[_0xc8e7('0x24')]:_0x3292de[_0xc8e7('0x22')]+_0x3292de['limit'];var _0x520d08;if(_0xe2c2b9>=_0x41d9b9){_0xe2c2b9=_0x41d9b9;_0x520d08=0xc8;}else{_0x520d08=0xce;}_0x1e2ba1[_0xc8e7('0x1f')](_0x520d08);return _0x1e2ba1[_0xc8e7('0x25')]('Content-Range',_0x318557+'-'+_0xe2c2b9+'/'+_0x41d9b9)[_0xc8e7('0x21')](_0x2e0b6c);}return null;};}function patchUpdates(_0x15273c){return function(_0x56db19){try{jsonpatch[_0xc8e7('0x26')](_0x56db19,_0x15273c,!![]);}catch(_0x5ec028){return BPromise[_0xc8e7('0x27')](_0x5ec028);}return _0x56db19['save']();};}function saveUpdates(_0x37c016,_0x4cc4f1){return function(_0x36b0e9){if(_0x36b0e9){return _0x36b0e9[_0xc8e7('0x28')](_0x37c016)['then'](function(_0x366f64){return _0x366f64;});}return null;};}function removeEntity(_0x28a50d,_0x34500c){return function(_0x5069ac){if(_0x5069ac){return _0x5069ac[_0xc8e7('0x29')]()['then'](function(){var _0x546a7d=_0x5069ac[_0xc8e7('0x2a')]({'plain':!![]});var _0x11e60e=_0xc8e7('0x2b');return db[_0xc8e7('0x2c')]['destroy']({'where':{'type':_0x11e60e,'resourceId':_0x546a7d['id']}})[_0xc8e7('0x2d')](function(){return _0x5069ac;});})[_0xc8e7('0x2d')](function(){_0x28a50d[_0xc8e7('0x1f')](0xcc)[_0xc8e7('0x20')]();});}};}function handleEntityNotFound(_0x17cc7d,_0x30e5d1){return function(_0x5df2dc){if(!_0x5df2dc){_0x17cc7d[_0xc8e7('0x1e')](0x194);}return _0x5df2dc;};}function handleError(_0x3de7c3,_0x21e62b){_0x21e62b=_0x21e62b||0x1f4;return function(_0x973019){logger[_0xc8e7('0x2e')](_0x973019[_0xc8e7('0x2f')]);if(_0x973019[_0xc8e7('0x30')]){delete _0x973019[_0xc8e7('0x30')];}_0x3de7c3['status'](_0x21e62b)[_0xc8e7('0x31')](_0x973019);};}exports['index']=function(_0x2d4242,_0x2fa48d){var _0x25f31e={},_0x5722ab={},_0x4ee5ad={'count':0x0,'rows':[]};var _0x5c170d=_[_0xc8e7('0x32')](db[_0xc8e7('0x33')][_0xc8e7('0x34')],function(_0x384347){return{'name':_0x384347[_0xc8e7('0x35')],'type':_0x384347[_0xc8e7('0x36')]['key']};});_0x5722ab['model']=_[_0xc8e7('0x32')](_0x5c170d,'name');_0x5722ab[_0xc8e7('0x37')]=_[_0xc8e7('0x38')](_0x2d4242[_0xc8e7('0x37')]);_0x5722ab['filters']=_['intersection'](_0x5722ab[_0xc8e7('0x39')],_0x5722ab[_0xc8e7('0x37')]);_0x25f31e['attributes']=_[_0xc8e7('0x3a')](_0x5722ab[_0xc8e7('0x39')],qs['fields'](_0x2d4242[_0xc8e7('0x37')][_0xc8e7('0x3b')]));_0x25f31e[_0xc8e7('0x3c')]=_0x25f31e[_0xc8e7('0x3c')][_0xc8e7('0x3d')]?_0x25f31e[_0xc8e7('0x3c')]:_0x5722ab[_0xc8e7('0x39')];if(!_0x2d4242[_0xc8e7('0x37')][_0xc8e7('0x3e')](_0xc8e7('0x3f'))){_0x25f31e['limit']=qs[_0xc8e7('0x40')](_0x2d4242['query'][_0xc8e7('0x40')]);_0x25f31e[_0xc8e7('0x22')]=qs[_0xc8e7('0x22')](_0x2d4242[_0xc8e7('0x37')][_0xc8e7('0x22')]);}_0x25f31e[_0xc8e7('0x41')]=qs[_0xc8e7('0x42')](_0x2d4242[_0xc8e7('0x37')]['sort']);_0x25f31e[_0xc8e7('0x43')]=qs[_0xc8e7('0x44')](_[_0xc8e7('0x45')](_0x2d4242[_0xc8e7('0x37')],_0x5722ab['filters']),_0x5c170d);if(_0x2d4242[_0xc8e7('0x37')][_0xc8e7('0x46')]){_0x25f31e[_0xc8e7('0x43')]=_[_0xc8e7('0x47')](_0x25f31e[_0xc8e7('0x43')],{'$or':_['map'](_0x5c170d,function(_0x30398c){if(_0x30398c[_0xc8e7('0x36')]!=='VIRTUAL'){var _0x49a1fc={};_0x49a1fc[_0x30398c[_0xc8e7('0x30')]]={'$like':'%'+_0x2d4242[_0xc8e7('0x37')][_0xc8e7('0x46')]+'%'};return _0x49a1fc;}})});}_0x25f31e=_['merge']({},_0x25f31e,_0x2d4242[_0xc8e7('0x48')]);var _0x5f5741={'where':_0x25f31e[_0xc8e7('0x43')]};return db[_0xc8e7('0x33')][_0xc8e7('0x24')](_0x5f5741)[_0xc8e7('0x2d')](function(_0x44f308){_0x4ee5ad[_0xc8e7('0x24')]=_0x44f308;if(_0x2d4242[_0xc8e7('0x37')][_0xc8e7('0x49')]){_0x25f31e[_0xc8e7('0x4a')]=[{'all':!![]}];}return db[_0xc8e7('0x33')]['findAll'](_0x25f31e);})['then'](function(_0x500ac3){_0x4ee5ad[_0xc8e7('0x4b')]=_0x500ac3;return _0x4ee5ad;})[_0xc8e7('0x2d')](respondWithFilteredResult(_0x2fa48d,_0x25f31e))[_0xc8e7('0x4c')](handleError(_0x2fa48d,null));};exports[_0xc8e7('0x4d')]=function(_0x522572,_0x410953){var _0x1643db={'raw':![],'where':{'id':_0x522572[_0xc8e7('0x4e')]['id']}},_0x3d973c={};_0x3d973c[_0xc8e7('0x39')]=_[_0xc8e7('0x38')](db[_0xc8e7('0x33')][_0xc8e7('0x34')]);_0x3d973c[_0xc8e7('0x37')]=_['keys'](_0x522572[_0xc8e7('0x37')]);_0x3d973c[_0xc8e7('0x44')]=_['intersection'](_0x3d973c[_0xc8e7('0x39')],_0x3d973c[_0xc8e7('0x37')]);_0x1643db['attributes']=_[_0xc8e7('0x3a')](_0x3d973c[_0xc8e7('0x39')],qs[_0xc8e7('0x3b')](_0x522572['query'][_0xc8e7('0x3b')]));_0x1643db[_0xc8e7('0x3c')]=_0x1643db[_0xc8e7('0x3c')][_0xc8e7('0x3d')]?_0x1643db[_0xc8e7('0x3c')]:_0x3d973c['model'];if(_0x522572[_0xc8e7('0x37')]['includeAll']){_0x1643db[_0xc8e7('0x4a')]=[{'all':!![]}];}_0x1643db=_[_0xc8e7('0x47')]({},_0x1643db,_0x522572['options']);return db['Dashboard'][_0xc8e7('0x4f')](_0x1643db)[_0xc8e7('0x2d')](handleEntityNotFound(_0x410953,null))[_0xc8e7('0x2d')](respondWithResult(_0x410953,null))['catch'](handleError(_0x410953,null));};exports[_0xc8e7('0x50')]=function(_0x53cb55,_0x314234){return db[_0xc8e7('0x33')][_0xc8e7('0x50')](_0x53cb55['body'],{})['then'](function(_0x403243){var _0x5cc890=_0x53cb55[_0xc8e7('0x51')][_0xc8e7('0x2a')]({'plain':!![]});if(!_0x5cc890)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cc890['role']===_0xc8e7('0x51')){var _0x26fb22=_0x403243[_0xc8e7('0x2a')]({'plain':!![]});var _0x1d3af4='CustomDashboards';return db[_0xc8e7('0x52')]['find']({'where':{'name':_0x1d3af4,'userProfileId':_0x5cc890['userProfileId']},'raw':!![]})['then'](function(_0x5b1a5b){if(_0x5b1a5b&&_0x5b1a5b[_0xc8e7('0x53')]===0x0){return db[_0xc8e7('0x2c')]['create']({'name':_0x26fb22[_0xc8e7('0x30')],'resourceId':_0x26fb22['id'],'type':_0x5b1a5b[_0xc8e7('0x30')],'sectionId':_0x5b1a5b['id']},{})[_0xc8e7('0x2d')](function(){return _0x403243;});}else{return _0x403243;}})[_0xc8e7('0x4c')](function(_0x1641a3){logger[_0xc8e7('0x2e')](_0xc8e7('0x54'),_0x1641a3);throw _0x1641a3;});}return _0x403243;})[_0xc8e7('0x2d')](respondWithResult(_0x314234,0xc9))[_0xc8e7('0x4c')](handleError(_0x314234,null));};exports[_0xc8e7('0x55')]=function(_0x2b48dd,_0x3ec6fa){var _0x4d2ce5={'where':{'id':_0x2b48dd[_0xc8e7('0x4e')]['id']}},_0xbacba3={};_0xbacba3['model']=_[_0xc8e7('0x38')](db[_0xc8e7('0x33')][_0xc8e7('0x34')]);_0x4d2ce5[_0xc8e7('0x3c')]=_[_0xc8e7('0x3a')](_0xbacba3['model'],qs[_0xc8e7('0x3b')](_0x2b48dd[_0xc8e7('0x37')][_0xc8e7('0x3b')]));_0x4d2ce5['attributes']=_0x4d2ce5[_0xc8e7('0x3c')][_0xc8e7('0x3d')]?_0x4d2ce5['attributes']:_0xbacba3[_0xc8e7('0x39')];if(_0x2b48dd['query'][_0xc8e7('0x49')]){_0x4d2ce5[_0xc8e7('0x4a')]=[{'all':!![]}];}_0x4d2ce5=_[_0xc8e7('0x47')]({},_0x4d2ce5,_0x2b48dd[_0xc8e7('0x48')]);return db[_0xc8e7('0x33')][_0xc8e7('0x4f')](_0x4d2ce5)['then'](handleEntityNotFound(_0x3ec6fa,null))[_0xc8e7('0x2d')](function(_0x48dcb1){if(_0x48dcb1){var _0x15c944=_0x48dcb1['get']({'plain':!![]});_0x15c944=qs['omit'](_0x15c944,['id',_0xc8e7('0x56'),_0xc8e7('0x57')]);_0x2b48dd[_0xc8e7('0x58')]=_['omit'](_0x2b48dd['body'],['id',_0xc8e7('0x56'),_0xc8e7('0x57')]);return db['Dashboard'][_0xc8e7('0x50')](_[_0xc8e7('0x47')](_0x15c944,_0x2b48dd['body']),{'include':_0x2b48dd[_0xc8e7('0x37')][_0xc8e7('0x49')]?[{'all':!![]}]:undefined})[_0xc8e7('0x2d')](function(_0x195298){var _0x15aea7=_0x2b48dd[_0xc8e7('0x51')][_0xc8e7('0x2a')]({'plain':!![]});if(!_0x15aea7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15aea7[_0xc8e7('0x59')]==='user'){var _0x207be7=_0x195298[_0xc8e7('0x2a')]({'plain':!![]});var _0xae8225=_0xc8e7('0x2b');return db[_0xc8e7('0x52')][_0xc8e7('0x4f')]({'where':{'name':_0xae8225,'userProfileId':_0x15aea7[_0xc8e7('0x5a')]},'raw':!![]})[_0xc8e7('0x2d')](function(_0x4e4411){if(_0x4e4411&&_0x4e4411[_0xc8e7('0x53')]===0x0){return db['UserProfileResource'][_0xc8e7('0x50')]({'name':_0x207be7[_0xc8e7('0x30')],'resourceId':_0x207be7['id'],'type':_0x4e4411[_0xc8e7('0x30')],'sectionId':_0x4e4411['id']},{})['then'](function(){return _0x195298;});}else{return _0x195298;}})['catch'](function(_0x30c886){logger[_0xc8e7('0x2e')](_0xc8e7('0x54'),_0x30c886);throw _0x30c886;});}return _0x195298;});}})[_0xc8e7('0x2d')](respondWithResult(_0x3ec6fa,0xc9))[_0xc8e7('0x4c')](handleError(_0x3ec6fa,null));};exports['update']=function(_0x1c313a,_0x20cb97){if(_0x1c313a[_0xc8e7('0x58')]['id']){delete _0x1c313a[_0xc8e7('0x58')]['id'];}return db[_0xc8e7('0x33')][_0xc8e7('0x4f')]({'where':{'id':_0x1c313a[_0xc8e7('0x4e')]['id']}})[_0xc8e7('0x2d')](handleEntityNotFound(_0x20cb97,null))[_0xc8e7('0x2d')](saveUpdates(_0x1c313a[_0xc8e7('0x58')],null))['then'](respondWithResult(_0x20cb97,null))['catch'](handleError(_0x20cb97,null));};exports[_0xc8e7('0x29')]=function(_0x7cd20,_0x369957){return db[_0xc8e7('0x33')][_0xc8e7('0x4f')]({'where':{'id':_0x7cd20[_0xc8e7('0x4e')]['id']}})['then'](handleEntityNotFound(_0x369957,null))['then'](removeEntity(_0x369957,null))['catch'](handleError(_0x369957,null));};function widgetAttributes(_0x2ab32b){try{switch(_0x2ab32b['type']){case _0xc8e7('0x5b'):return[{'name':_0xc8e7('0x5c'),'value':_0x2ab32b[_0xc8e7('0x5c')]||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x0]?_0x2ab32b[_0xc8e7('0x5d')][0x0][_0xc8e7('0x5e')]:undefined)||_0xc8e7('0x5f')}];case _0xc8e7('0x60'):return[{'name':_0xc8e7('0x61'),'value':_0x2ab32b[_0xc8e7('0x61')]||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x0]?_0x2ab32b[_0xc8e7('0x5d')][0x0][_0xc8e7('0x5e')]:undefined)||''}];case'clock':return[{'name':_0xc8e7('0x62'),'value':_0x2ab32b['attrHourFormat']||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x0]?_0x2ab32b[_0xc8e7('0x5d')][0x0][_0xc8e7('0x5e')]:undefined)||_0xc8e7('0x63')},{'name':_0xc8e7('0x64'),'value':_0x2ab32b[_0xc8e7('0x64')]||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b['attrs'][0x1]?_0x2ab32b[_0xc8e7('0x5d')][0x1][_0xc8e7('0x5e')]:undefined)||_0xc8e7('0x65')},{'name':_0xc8e7('0x66'),'value':_0x2ab32b[_0xc8e7('0x66')]||(_0x2ab32b['attrs']&&_0x2ab32b[_0xc8e7('0x5d')][0x2]?_0x2ab32b[_0xc8e7('0x5d')][0x2][_0xc8e7('0x5e')]:undefined)||0xc}];case'counter':return[{'name':_0xc8e7('0x67'),'value':_0x2ab32b[_0xc8e7('0x67')]||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x0]?_0x2ab32b[_0xc8e7('0x5d')][0x0][_0xc8e7('0x5e')]:undefined)||_0xc8e7('0x68')},{'name':_0xc8e7('0x69'),'value':_0x2ab32b[_0xc8e7('0x69')]||(_0x2ab32b['attrs']&&_0x2ab32b[_0xc8e7('0x5d')][0x1]?_0x2ab32b[_0xc8e7('0x5d')][0x1][_0xc8e7('0x5e')]:undefined)||[]},{'name':_0xc8e7('0x66'),'value':_0x2ab32b[_0xc8e7('0x66')]||(_0x2ab32b['attrs']&&_0x2ab32b[_0xc8e7('0x5d')][0x2]?_0x2ab32b['attrs'][0x2][_0xc8e7('0x5e')]:undefined)||0x14},{'name':_0xc8e7('0x6a'),'value':_0x2ab32b[_0xc8e7('0x6a')]||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x3]?_0x2ab32b['attrs'][0x3][_0xc8e7('0x5e')]:undefined)||_0xc8e7('0x6b')},{'name':_0xc8e7('0x6c'),'value':_0x2ab32b['attrEmailAccounts']||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x4]?_0x2ab32b[_0xc8e7('0x5d')][0x4][_0xc8e7('0x5e')]:undefined)||''},{'name':_0xc8e7('0x6d'),'value':_0x2ab32b[_0xc8e7('0x6d')]||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x5]?_0x2ab32b[_0xc8e7('0x5d')][0x5][_0xc8e7('0x5e')]:undefined)||''},{'name':_0xc8e7('0x6e'),'value':_0x2ab32b['attrSmsAccounts']||(_0x2ab32b['attrs']&&_0x2ab32b[_0xc8e7('0x5d')][0x6]?_0x2ab32b[_0xc8e7('0x5d')][0x6]['value']:undefined)||''},{'name':_0xc8e7('0x6f'),'value':_0x2ab32b['attrOpenchannelAccounts']||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b['attrs'][0x7]?_0x2ab32b[_0xc8e7('0x5d')][0x7]['value']:undefined)||''},{'name':_0xc8e7('0x70'),'value':_0x2ab32b['attrWhatsappAccounts']||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b['attrs'][0x8]?_0x2ab32b['attrs'][0x8][_0xc8e7('0x5e')]:undefined)||''},{'name':_0xc8e7('0x71'),'value':_0x2ab32b['attrChatWebsites']||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x9]?_0x2ab32b[_0xc8e7('0x5d')][0x9][_0xc8e7('0x5e')]:undefined)||''}];case _0xc8e7('0x72'):case _0xc8e7('0x73'):return[{'name':_0xc8e7('0x74'),'value':_0x2ab32b[_0xc8e7('0x74')]||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b['attrs'][0x0]?_0x2ab32b[_0xc8e7('0x5d')][0x0]['value']:undefined)||'total'},{'name':_0xc8e7('0x75'),'value':_0x2ab32b['attrSerie2']||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x1]?_0x2ab32b[_0xc8e7('0x5d')][0x1][_0xc8e7('0x5e')]:undefined)||null},{'name':_0xc8e7('0x76'),'value':_0x2ab32b['attrSerie3']||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x2]?_0x2ab32b[_0xc8e7('0x5d')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x2ab32b['attrVoiceQueues']||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x3]?_0x2ab32b[_0xc8e7('0x5d')][0x3][_0xc8e7('0x5e')]:undefined)||[]},{'name':_0xc8e7('0x6a'),'value':_0x2ab32b[_0xc8e7('0x6a')]||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x4]?_0x2ab32b[_0xc8e7('0x5d')][0x4][_0xc8e7('0x5e')]:undefined)||_0xc8e7('0x6b')},{'name':'attrEmailAccounts','value':_0x2ab32b[_0xc8e7('0x6c')]||(_0x2ab32b['attrs']&&_0x2ab32b['attrs'][0x5]?_0x2ab32b['attrs'][0x5][_0xc8e7('0x5e')]:undefined)||''},{'name':_0xc8e7('0x6d'),'value':_0x2ab32b[_0xc8e7('0x6d')]||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x6]?_0x2ab32b[_0xc8e7('0x5d')][0x6]['value']:undefined)||''},{'name':_0xc8e7('0x6e'),'value':_0x2ab32b[_0xc8e7('0x6e')]||(_0x2ab32b['attrs']&&_0x2ab32b[_0xc8e7('0x5d')][0x7]?_0x2ab32b[_0xc8e7('0x5d')][0x7][_0xc8e7('0x5e')]:undefined)||''},{'name':_0xc8e7('0x6f'),'value':_0x2ab32b[_0xc8e7('0x6f')]||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x8]?_0x2ab32b[_0xc8e7('0x5d')][0x8]['value']:undefined)||''},{'name':_0xc8e7('0x70'),'value':_0x2ab32b['attrWhatsappAccounts']||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x9]?_0x2ab32b[_0xc8e7('0x5d')][0x9][_0xc8e7('0x5e')]:undefined)||''},{'name':_0xc8e7('0x71'),'value':_0x2ab32b[_0xc8e7('0x71')]||(_0x2ab32b['attrs']&&_0x2ab32b[_0xc8e7('0x5d')][0xa]?_0x2ab32b[_0xc8e7('0x5d')][0xa][_0xc8e7('0x5e')]:undefined)||''}];case _0xc8e7('0x77'):return[{'name':_0xc8e7('0x78'),'type':_0x2ab32b[_0xc8e7('0x79')]||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x0]?_0x2ab32b[_0xc8e7('0x5d')][0x0][_0xc8e7('0x36')]:undefined)||null,'value':_0x2ab32b[_0xc8e7('0x78')]||(_0x2ab32b['attrs']&&_0x2ab32b[_0xc8e7('0x5d')][0x0]?_0x2ab32b['attrs'][0x0][_0xc8e7('0x5e')]:undefined)||null},{'name':_0xc8e7('0x7a'),'value':_0x2ab32b['attrRefresh']||(_0x2ab32b[_0xc8e7('0x5d')]&&_0x2ab32b[_0xc8e7('0x5d')][0x1]?_0x2ab32b[_0xc8e7('0x5d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5cb326){logger[_0xc8e7('0x2e')](_0xc8e7('0x7b'),JSON[_0xc8e7('0x7c')](_0x5cb326));return[];}}exports[_0xc8e7('0x7d')]=function(_0x1626f4,_0x4967d2,_0x4781c8){if(_0x1626f4[_0xc8e7('0x58')]['id']){delete _0x1626f4[_0xc8e7('0x58')]['id'];}return db['Dashboard'][_0xc8e7('0x4f')]({'where':{'id':_0x1626f4[_0xc8e7('0x4e')]['id']}})[_0xc8e7('0x2d')](handleEntityNotFound(_0x4967d2,null))[_0xc8e7('0x2d')](function(_0x5aabe1){if(_0x5aabe1){_0x1626f4[_0xc8e7('0x58')]['DashboardId']=_0x5aabe1['id'];_0x1626f4[_0xc8e7('0x58')][_0xc8e7('0x5d')]=widgetAttributes(_0x1626f4[_0xc8e7('0x58')]);return db[_0xc8e7('0x7e')][_0xc8e7('0x50')](_0x1626f4[_0xc8e7('0x58')]);}})[_0xc8e7('0x2d')](respondWithResult(_0x4967d2,null))[_0xc8e7('0x4c')](handleError(_0x4967d2,null));};exports[_0xc8e7('0x7f')]=function(_0x41b150,_0x3265f3,_0xa76987){var _0x42a505={};var _0x11a3d2={};var _0x3c9388;var _0x8db609;return db[_0xc8e7('0x33')][_0xc8e7('0x80')]({'where':{'id':_0x41b150[_0xc8e7('0x4e')]['id']}})[_0xc8e7('0x2d')](handleEntityNotFound(_0x3265f3,null))[_0xc8e7('0x2d')](function(_0x5195b6){if(_0x5195b6){_0x3c9388=_0x5195b6;_0x11a3d2[_0xc8e7('0x39')]=_[_0xc8e7('0x38')](db['DashboardItem'][_0xc8e7('0x34')]);_0x11a3d2[_0xc8e7('0x37')]=_[_0xc8e7('0x38')](_0x41b150[_0xc8e7('0x37')]);_0x11a3d2[_0xc8e7('0x44')]=_[_0xc8e7('0x3a')](_0x11a3d2['model'],_0x11a3d2[_0xc8e7('0x37')]);_0x42a505[_0xc8e7('0x3c')]=_['intersection'](_0x11a3d2[_0xc8e7('0x39')],qs[_0xc8e7('0x3b')](_0x41b150['query']['fields']));_0x42a505[_0xc8e7('0x3c')]=_0x42a505[_0xc8e7('0x3c')][_0xc8e7('0x3d')]?_0x42a505[_0xc8e7('0x3c')]:_0x11a3d2['model'];_0x42a505[_0xc8e7('0x41')]=qs[_0xc8e7('0x42')](_0x41b150[_0xc8e7('0x37')][_0xc8e7('0x42')]);_0x42a505[_0xc8e7('0x43')]=qs[_0xc8e7('0x44')](_[_0xc8e7('0x45')](_0x41b150[_0xc8e7('0x37')],_0x11a3d2[_0xc8e7('0x44')]));if(_0x41b150['query'][_0xc8e7('0x46')]){_0x42a505[_0xc8e7('0x43')]=_['merge'](_0x42a505['where'],{'$or':_[_0xc8e7('0x32')](_0x42a505[_0xc8e7('0x3c')],function(_0x9e5860){var _0x5f2b57={};_0x5f2b57[_0x9e5860]={'$like':'%'+_0x41b150[_0xc8e7('0x37')][_0xc8e7('0x46')]+'%'};return _0x5f2b57;})});}_0x42a505=_[_0xc8e7('0x47')]({},_0x42a505,_0x41b150['options']);return _0x3c9388['getItems'](_0x42a505);}})[_0xc8e7('0x2d')](function(_0x6588f8){if(_0x6588f8){_0x8db609=_0x6588f8[_0xc8e7('0x3d')];if(!_0x41b150[_0xc8e7('0x37')][_0xc8e7('0x3e')](_0xc8e7('0x3f'))){_0x42a505[_0xc8e7('0x40')]=qs[_0xc8e7('0x40')](_0x41b150[_0xc8e7('0x37')][_0xc8e7('0x40')]);_0x42a505[_0xc8e7('0x22')]=qs[_0xc8e7('0x22')](_0x41b150[_0xc8e7('0x37')][_0xc8e7('0x22')]);}return _0x3c9388[_0xc8e7('0x7f')](_0x42a505);}})[_0xc8e7('0x2d')](function(_0x4dfa26){if(_0x4dfa26){return _0x4dfa26?{'count':_0x8db609,'rows':_0x4dfa26}:null;}})[_0xc8e7('0x2d')](respondWithResult(_0x3265f3,null))[_0xc8e7('0x4c')](handleError(_0x3265f3,null));}; \ No newline at end of file +var _0x6054=['filter','where','VIRTUAL','merge','options','include','findAll','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CustomDashboards','autoAssociation','omit','createdAt','updatedAt','includeAll','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','redis','register','sendStatus','end','status','offset','undefined','limit','count','json','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick'];(function(_0x3fa8b2,_0x3ee09f){var _0x177057=function(_0xb3a1b6){while(--_0xb3a1b6){_0x3fa8b2['push'](_0x3fa8b2['shift']());}};_0x177057(++_0x3ee09f);}(_0x6054,0x142));var _0x4605=function(_0x3cc8cb,_0x31f8fe){_0x3cc8cb=_0x3cc8cb-0x0;var _0x427615=_0x6054[_0x3cc8cb];return _0x427615;};'use strict';var emlformat=require(_0x4605('0x0'));var rimraf=require(_0x4605('0x1'));var zipdir=require(_0x4605('0x2'));var jsonpatch=require(_0x4605('0x3'));var rp=require(_0x4605('0x4'));var moment=require(_0x4605('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4605('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4605('0x7'));var fs=require('fs');var fs_extra=require(_0x4605('0x8'));var _=require(_0x4605('0x9'));var squel=require(_0x4605('0xa'));var crypto=require(_0x4605('0xb'));var jsforce=require(_0x4605('0xc'));var deskjs=require(_0x4605('0xd'));var toCsv=require(_0x4605('0xe'));var querystring=require(_0x4605('0xf'));var Papa=require(_0x4605('0x10'));var Redis=require(_0x4605('0x11'));var authService=require(_0x4605('0x12'));var qs=require(_0x4605('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4605('0x14'));var logger=require(_0x4605('0x15'))(_0x4605('0x16'));var utils=require(_0x4605('0x17'));var config=require(_0x4605('0x18'));var licenseUtil=require(_0x4605('0x19'));var db=require(_0x4605('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x4605('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4605('0x1c')]));require('./dashboard.socket')[_0x4605('0x1d')](socket);function respondWithStatusCode(_0x1eda7b,_0x301e7a){_0x301e7a=_0x301e7a||0xcc;return function(_0xe54794){if(_0xe54794){return _0x1eda7b[_0x4605('0x1e')](_0x301e7a);}return _0x1eda7b['status'](_0x301e7a)[_0x4605('0x1f')]();};}function respondWithResult(_0x5b7702,_0xe44abf){_0xe44abf=_0xe44abf||0xc8;return function(_0x3ea5c5){if(_0x3ea5c5){return _0x5b7702[_0x4605('0x20')](_0xe44abf)['json'](_0x3ea5c5);}};}function respondWithFilteredResult(_0x357cf4,_0x4497c6){return function(_0x5737ca){if(_0x5737ca){var _0x1457d4=typeof _0x4497c6[_0x4605('0x21')]===_0x4605('0x22')&&typeof _0x4497c6[_0x4605('0x23')]===_0x4605('0x22');var _0x2dc925=_0x5737ca[_0x4605('0x24')];var _0xbc932c=_0x1457d4?0x0:_0x4497c6['offset'];var _0x27f950=_0x1457d4?_0x5737ca['count']:_0x4497c6['offset']+_0x4497c6[_0x4605('0x23')];var _0x3a959f;if(_0x27f950>=_0x2dc925){_0x27f950=_0x2dc925;_0x3a959f=0xc8;}else{_0x3a959f=0xce;}_0x357cf4[_0x4605('0x20')](_0x3a959f);return _0x357cf4['set']('Content-Range',_0xbc932c+'-'+_0x27f950+'/'+_0x2dc925)[_0x4605('0x25')](_0x5737ca);}return null;};}function patchUpdates(_0x29ac00){return function(_0x3bed2d){try{jsonpatch['apply'](_0x3bed2d,_0x29ac00,!![]);}catch(_0xec3281){return BPromise[_0x4605('0x26')](_0xec3281);}return _0x3bed2d[_0x4605('0x27')]();};}function saveUpdates(_0x4316a9,_0x283b6c){return function(_0x44c641){if(_0x44c641){return _0x44c641[_0x4605('0x28')](_0x4316a9)[_0x4605('0x29')](function(_0x1f5f4f){return _0x1f5f4f;});}return null;};}function removeEntity(_0x39e1b5,_0x46bc99){return function(_0x4b4ac6){if(_0x4b4ac6){return _0x4b4ac6[_0x4605('0x2a')]()[_0x4605('0x29')](function(){var _0x82b70d=_0x4b4ac6[_0x4605('0x2b')]({'plain':!![]});var _0xb23f90='CustomDashboards';return db[_0x4605('0x2c')][_0x4605('0x2a')]({'where':{'type':_0xb23f90,'resourceId':_0x82b70d['id']}})['then'](function(){return _0x4b4ac6;});})['then'](function(){_0x39e1b5[_0x4605('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x963897,_0x1d289d){return function(_0xd37c14){if(!_0xd37c14){_0x963897['sendStatus'](0x194);}return _0xd37c14;};}function handleError(_0xe9c5ba,_0x2049cc){_0x2049cc=_0x2049cc||0x1f4;return function(_0x56bdd6){logger[_0x4605('0x2d')](_0x56bdd6[_0x4605('0x2e')]);if(_0x56bdd6['name']){delete _0x56bdd6[_0x4605('0x2f')];}_0xe9c5ba['status'](_0x2049cc)[_0x4605('0x30')](_0x56bdd6);};}exports[_0x4605('0x31')]=function(_0x30cb4b,_0x11f56a){var _0x2c3c09={},_0x5f1a85={},_0x481327={'count':0x0,'rows':[]};var _0x155db7=_[_0x4605('0x32')](db[_0x4605('0x33')][_0x4605('0x34')],function(_0x3bbf67){return{'name':_0x3bbf67[_0x4605('0x35')],'type':_0x3bbf67[_0x4605('0x36')][_0x4605('0x37')]};});_0x5f1a85['model']=_[_0x4605('0x32')](_0x155db7,_0x4605('0x2f'));_0x5f1a85[_0x4605('0x38')]=_[_0x4605('0x39')](_0x30cb4b[_0x4605('0x38')]);_0x5f1a85['filters']=_[_0x4605('0x3a')](_0x5f1a85[_0x4605('0x3b')],_0x5f1a85[_0x4605('0x38')]);_0x2c3c09[_0x4605('0x3c')]=_[_0x4605('0x3a')](_0x5f1a85[_0x4605('0x3b')],qs[_0x4605('0x3d')](_0x30cb4b[_0x4605('0x38')][_0x4605('0x3d')]));_0x2c3c09['attributes']=_0x2c3c09[_0x4605('0x3c')][_0x4605('0x3e')]?_0x2c3c09['attributes']:_0x5f1a85[_0x4605('0x3b')];if(!_0x30cb4b[_0x4605('0x38')][_0x4605('0x3f')]('nolimit')){_0x2c3c09[_0x4605('0x23')]=qs['limit'](_0x30cb4b[_0x4605('0x38')][_0x4605('0x23')]);_0x2c3c09[_0x4605('0x21')]=qs[_0x4605('0x21')](_0x30cb4b[_0x4605('0x38')]['offset']);}_0x2c3c09[_0x4605('0x40')]=qs[_0x4605('0x41')](_0x30cb4b[_0x4605('0x38')][_0x4605('0x41')]);_0x2c3c09['where']=qs[_0x4605('0x42')](_[_0x4605('0x43')](_0x30cb4b['query'],_0x5f1a85['filters']),_0x155db7);if(_0x30cb4b[_0x4605('0x38')][_0x4605('0x44')]){_0x2c3c09[_0x4605('0x45')]=_['merge'](_0x2c3c09['where'],{'$or':_[_0x4605('0x32')](_0x155db7,function(_0x4be98c){if(_0x4be98c[_0x4605('0x36')]!==_0x4605('0x46')){var _0x4d58ab={};_0x4d58ab[_0x4be98c[_0x4605('0x2f')]]={'$like':'%'+_0x30cb4b['query'][_0x4605('0x44')]+'%'};return _0x4d58ab;}})});}_0x2c3c09=_[_0x4605('0x47')]({},_0x2c3c09,_0x30cb4b[_0x4605('0x48')]);var _0x52b590={'where':_0x2c3c09[_0x4605('0x45')]};return db[_0x4605('0x33')][_0x4605('0x24')](_0x52b590)[_0x4605('0x29')](function(_0x4b50d0){_0x481327['count']=_0x4b50d0;if(_0x30cb4b['query']['includeAll']){_0x2c3c09[_0x4605('0x49')]=[{'all':!![]}];}return db[_0x4605('0x33')][_0x4605('0x4a')](_0x2c3c09);})[_0x4605('0x29')](function(_0x3afbd3){_0x481327['rows']=_0x3afbd3;return _0x481327;})[_0x4605('0x29')](respondWithFilteredResult(_0x11f56a,_0x2c3c09))[_0x4605('0x4b')](handleError(_0x11f56a,null));};exports[_0x4605('0x4c')]=function(_0x4659e4,_0x474ea0){var _0x2f0a06={'raw':![],'where':{'id':_0x4659e4[_0x4605('0x4d')]['id']}},_0x5b2017={};_0x5b2017[_0x4605('0x3b')]=_[_0x4605('0x39')](db[_0x4605('0x33')][_0x4605('0x34')]);_0x5b2017[_0x4605('0x38')]=_[_0x4605('0x39')](_0x4659e4[_0x4605('0x38')]);_0x5b2017[_0x4605('0x42')]=_[_0x4605('0x3a')](_0x5b2017['model'],_0x5b2017['query']);_0x2f0a06[_0x4605('0x3c')]=_[_0x4605('0x3a')](_0x5b2017[_0x4605('0x3b')],qs[_0x4605('0x3d')](_0x4659e4['query'][_0x4605('0x3d')]));_0x2f0a06[_0x4605('0x3c')]=_0x2f0a06['attributes']['length']?_0x2f0a06[_0x4605('0x3c')]:_0x5b2017[_0x4605('0x3b')];if(_0x4659e4[_0x4605('0x38')]['includeAll']){_0x2f0a06[_0x4605('0x49')]=[{'all':!![]}];}_0x2f0a06=_['merge']({},_0x2f0a06,_0x4659e4[_0x4605('0x48')]);return db[_0x4605('0x33')]['find'](_0x2f0a06)['then'](handleEntityNotFound(_0x474ea0,null))[_0x4605('0x29')](respondWithResult(_0x474ea0,null))['catch'](handleError(_0x474ea0,null));};exports[_0x4605('0x4e')]=function(_0xc116a,_0x136002){return db[_0x4605('0x33')]['create'](_0xc116a[_0x4605('0x4f')],{})[_0x4605('0x29')](function(_0x5ae237){var _0x22d80b=_0xc116a['user'][_0x4605('0x2b')]({'plain':!![]});if(!_0x22d80b)throw new Error(_0x4605('0x50'));if(_0x22d80b[_0x4605('0x51')]===_0x4605('0x52')){var _0xee330c=_0x5ae237[_0x4605('0x2b')]({'plain':!![]});var _0x6aaf6f=_0x4605('0x53');return db['UserProfileSection']['find']({'where':{'name':_0x6aaf6f,'userProfileId':_0x22d80b['userProfileId']},'raw':!![]})['then'](function(_0x3f258a){if(_0x3f258a&&_0x3f258a[_0x4605('0x54')]===0x0){return db[_0x4605('0x2c')]['create']({'name':_0xee330c['name'],'resourceId':_0xee330c['id'],'type':_0x3f258a[_0x4605('0x2f')],'sectionId':_0x3f258a['id']},{})[_0x4605('0x29')](function(){return _0x5ae237;});}else{return _0x5ae237;}})[_0x4605('0x4b')](function(_0x2895e1){logger[_0x4605('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2895e1);throw _0x2895e1;});}return _0x5ae237;})[_0x4605('0x29')](respondWithResult(_0x136002,0xc9))[_0x4605('0x4b')](handleError(_0x136002,null));};exports['clone']=function(_0x13920f,_0x310574){var _0x3779b6={'where':{'id':_0x13920f[_0x4605('0x4d')]['id']}},_0x11524e={};_0x11524e[_0x4605('0x3b')]=_[_0x4605('0x39')](db[_0x4605('0x33')]['rawAttributes']);_0x3779b6['attributes']=_[_0x4605('0x3a')](_0x11524e[_0x4605('0x3b')],qs['fields'](_0x13920f[_0x4605('0x38')][_0x4605('0x3d')]));_0x3779b6['attributes']=_0x3779b6['attributes'][_0x4605('0x3e')]?_0x3779b6[_0x4605('0x3c')]:_0x11524e['model'];if(_0x13920f[_0x4605('0x38')]['includeAll']){_0x3779b6[_0x4605('0x49')]=[{'all':!![]}];}_0x3779b6=_[_0x4605('0x47')]({},_0x3779b6,_0x13920f['options']);return db[_0x4605('0x33')]['find'](_0x3779b6)[_0x4605('0x29')](handleEntityNotFound(_0x310574,null))['then'](function(_0x2c95f3){if(_0x2c95f3){var _0x9677d=_0x2c95f3[_0x4605('0x2b')]({'plain':!![]});_0x9677d=qs[_0x4605('0x55')](_0x9677d,['id',_0x4605('0x56'),'updatedAt']);_0x13920f[_0x4605('0x4f')]=_[_0x4605('0x55')](_0x13920f['body'],['id',_0x4605('0x56'),_0x4605('0x57')]);return db[_0x4605('0x33')]['create'](_[_0x4605('0x47')](_0x9677d,_0x13920f[_0x4605('0x4f')]),{'include':_0x13920f[_0x4605('0x38')][_0x4605('0x58')]?[{'all':!![]}]:undefined})[_0x4605('0x29')](function(_0x3c959c){var _0x317eac=_0x13920f[_0x4605('0x52')][_0x4605('0x2b')]({'plain':!![]});if(!_0x317eac)throw new Error(_0x4605('0x50'));if(_0x317eac[_0x4605('0x51')]===_0x4605('0x52')){var _0xc7e62d=_0x3c959c[_0x4605('0x2b')]({'plain':!![]});var _0x7e928a=_0x4605('0x53');return db[_0x4605('0x59')][_0x4605('0x5a')]({'where':{'name':_0x7e928a,'userProfileId':_0x317eac[_0x4605('0x5b')]},'raw':!![]})[_0x4605('0x29')](function(_0x317b47){if(_0x317b47&&_0x317b47[_0x4605('0x54')]===0x0){return db[_0x4605('0x2c')][_0x4605('0x4e')]({'name':_0xc7e62d[_0x4605('0x2f')],'resourceId':_0xc7e62d['id'],'type':_0x317b47[_0x4605('0x2f')],'sectionId':_0x317b47['id']},{})[_0x4605('0x29')](function(){return _0x3c959c;});}else{return _0x3c959c;}})[_0x4605('0x4b')](function(_0x10b91d){logger[_0x4605('0x2d')](_0x4605('0x5c'),_0x10b91d);throw _0x10b91d;});}return _0x3c959c;});}})['then'](respondWithResult(_0x310574,0xc9))[_0x4605('0x4b')](handleError(_0x310574,null));};exports[_0x4605('0x28')]=function(_0xc1d5ec,_0x1d2055){if(_0xc1d5ec[_0x4605('0x4f')]['id']){delete _0xc1d5ec[_0x4605('0x4f')]['id'];}return db[_0x4605('0x33')][_0x4605('0x5a')]({'where':{'id':_0xc1d5ec[_0x4605('0x4d')]['id']}})[_0x4605('0x29')](handleEntityNotFound(_0x1d2055,null))[_0x4605('0x29')](saveUpdates(_0xc1d5ec[_0x4605('0x4f')],null))['then'](respondWithResult(_0x1d2055,null))[_0x4605('0x4b')](handleError(_0x1d2055,null));};exports[_0x4605('0x2a')]=function(_0x329c68,_0x182e6f){return db['Dashboard'][_0x4605('0x5a')]({'where':{'id':_0x329c68[_0x4605('0x4d')]['id']}})['then'](handleEntityNotFound(_0x182e6f,null))['then'](removeEntity(_0x182e6f,null))[_0x4605('0x4b')](handleError(_0x182e6f,null));};function widgetAttributes(_0x18036f){try{switch(_0x18036f['type']){case _0x4605('0x5d'):return[{'name':_0x4605('0x5e'),'value':_0x18036f[_0x4605('0x5e')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x0]?_0x18036f['attrs'][0x0][_0x4605('0x60')]:undefined)||_0x4605('0x61')}];case'custom':return[{'name':_0x4605('0x62'),'value':_0x18036f[_0x4605('0x62')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f['attrs'][0x0]?_0x18036f[_0x4605('0x5f')][0x0][_0x4605('0x60')]:undefined)||''}];case _0x4605('0x63'):return[{'name':_0x4605('0x64'),'value':_0x18036f[_0x4605('0x64')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x0]?_0x18036f[_0x4605('0x5f')][0x0][_0x4605('0x60')]:undefined)||_0x4605('0x65')},{'name':_0x4605('0x66'),'value':_0x18036f[_0x4605('0x66')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x1]?_0x18036f[_0x4605('0x5f')][0x1][_0x4605('0x60')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x18036f[_0x4605('0x67')]||(_0x18036f['attrs']&&_0x18036f[_0x4605('0x5f')][0x2]?_0x18036f[_0x4605('0x5f')][0x2][_0x4605('0x60')]:undefined)||0xc}];case _0x4605('0x68'):return[{'name':'attrMetric','value':_0x18036f['attrMetric']||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x0]?_0x18036f['attrs'][0x0][_0x4605('0x60')]:undefined)||_0x4605('0x69')},{'name':_0x4605('0x6a'),'value':_0x18036f[_0x4605('0x6a')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x1]?_0x18036f[_0x4605('0x5f')][0x1][_0x4605('0x60')]:undefined)||[]},{'name':_0x4605('0x67'),'value':_0x18036f[_0x4605('0x67')]||(_0x18036f['attrs']&&_0x18036f[_0x4605('0x5f')][0x2]?_0x18036f[_0x4605('0x5f')][0x2]['value']:undefined)||0x14},{'name':_0x4605('0x6b'),'value':_0x18036f['attrChannel']||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x3]?_0x18036f[_0x4605('0x5f')][0x3]['value']:undefined)||'voice'},{'name':_0x4605('0x6c'),'value':_0x18036f[_0x4605('0x6c')]||(_0x18036f['attrs']&&_0x18036f['attrs'][0x4]?_0x18036f['attrs'][0x4][_0x4605('0x60')]:undefined)||''},{'name':_0x4605('0x6d'),'value':_0x18036f[_0x4605('0x6d')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x5]?_0x18036f['attrs'][0x5][_0x4605('0x60')]:undefined)||''},{'name':_0x4605('0x6e'),'value':_0x18036f[_0x4605('0x6e')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x6]?_0x18036f['attrs'][0x6][_0x4605('0x60')]:undefined)||''},{'name':_0x4605('0x6f'),'value':_0x18036f['attrOpenchannelAccounts']||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x7]?_0x18036f['attrs'][0x7][_0x4605('0x60')]:undefined)||''},{'name':_0x4605('0x70'),'value':_0x18036f[_0x4605('0x70')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x8]?_0x18036f[_0x4605('0x5f')][0x8]['value']:undefined)||''},{'name':_0x4605('0x71'),'value':_0x18036f[_0x4605('0x71')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x9]?_0x18036f[_0x4605('0x5f')][0x9][_0x4605('0x60')]:undefined)||''}];case _0x4605('0x72'):case _0x4605('0x73'):return[{'name':_0x4605('0x74'),'value':_0x18036f[_0x4605('0x74')]||(_0x18036f['attrs']&&_0x18036f[_0x4605('0x5f')][0x0]?_0x18036f[_0x4605('0x5f')][0x0][_0x4605('0x60')]:undefined)||_0x4605('0x69')},{'name':_0x4605('0x75'),'value':_0x18036f['attrSerie2']||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x1]?_0x18036f[_0x4605('0x5f')][0x1]['value']:undefined)||null},{'name':_0x4605('0x76'),'value':_0x18036f['attrSerie3']||(_0x18036f['attrs']&&_0x18036f[_0x4605('0x5f')][0x2]?_0x18036f[_0x4605('0x5f')][0x2][_0x4605('0x60')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x18036f[_0x4605('0x6a')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x3]?_0x18036f[_0x4605('0x5f')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x18036f[_0x4605('0x6b')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x4]?_0x18036f[_0x4605('0x5f')][0x4]['value']:undefined)||'voice'},{'name':_0x4605('0x6c'),'value':_0x18036f[_0x4605('0x6c')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x5]?_0x18036f[_0x4605('0x5f')][0x5][_0x4605('0x60')]:undefined)||''},{'name':_0x4605('0x6d'),'value':_0x18036f[_0x4605('0x6d')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x6]?_0x18036f[_0x4605('0x5f')][0x6][_0x4605('0x60')]:undefined)||''},{'name':_0x4605('0x6e'),'value':_0x18036f[_0x4605('0x6e')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x7]?_0x18036f[_0x4605('0x5f')][0x7]['value']:undefined)||''},{'name':_0x4605('0x6f'),'value':_0x18036f['attrOpenchannelAccounts']||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x8]?_0x18036f[_0x4605('0x5f')][0x8][_0x4605('0x60')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x18036f[_0x4605('0x70')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f['attrs'][0x9]?_0x18036f['attrs'][0x9][_0x4605('0x60')]:undefined)||''},{'name':'attrChatWebsites','value':_0x18036f[_0x4605('0x71')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0xa]?_0x18036f['attrs'][0xa][_0x4605('0x60')]:undefined)||''}];case _0x4605('0x77'):return[{'name':_0x4605('0x78'),'type':_0x18036f[_0x4605('0x79')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x0]?_0x18036f[_0x4605('0x5f')][0x0][_0x4605('0x36')]:undefined)||null,'value':_0x18036f[_0x4605('0x78')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f[_0x4605('0x5f')][0x0]?_0x18036f[_0x4605('0x5f')][0x0]['value']:undefined)||null},{'name':_0x4605('0x7a'),'value':_0x18036f[_0x4605('0x7a')]||(_0x18036f[_0x4605('0x5f')]&&_0x18036f['attrs'][0x1]?_0x18036f['attrs'][0x1][_0x4605('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x3162c7){logger['error'](_0x4605('0x7b'),JSON[_0x4605('0x7c')](_0x3162c7));return[];}}exports[_0x4605('0x7d')]=function(_0xeb9aa8,_0x5ebb10,_0xdf5b99){if(_0xeb9aa8['body']['id']){delete _0xeb9aa8[_0x4605('0x4f')]['id'];}return db['Dashboard'][_0x4605('0x5a')]({'where':{'id':_0xeb9aa8[_0x4605('0x4d')]['id']}})[_0x4605('0x29')](handleEntityNotFound(_0x5ebb10,null))['then'](function(_0x64e865){if(_0x64e865){_0xeb9aa8['body'][_0x4605('0x7e')]=_0x64e865['id'];_0xeb9aa8[_0x4605('0x4f')][_0x4605('0x5f')]=widgetAttributes(_0xeb9aa8['body']);return db[_0x4605('0x7f')][_0x4605('0x4e')](_0xeb9aa8[_0x4605('0x4f')]);}})['then'](respondWithResult(_0x5ebb10,null))[_0x4605('0x4b')](handleError(_0x5ebb10,null));};exports[_0x4605('0x80')]=function(_0x5bea14,_0x34a5b7,_0x3d15b0){var _0x1a9542={};var _0x2516d7={};var _0x529404;var _0x7e140b;return db[_0x4605('0x33')][_0x4605('0x81')]({'where':{'id':_0x5bea14[_0x4605('0x4d')]['id']}})['then'](handleEntityNotFound(_0x34a5b7,null))[_0x4605('0x29')](function(_0x53305b){if(_0x53305b){_0x529404=_0x53305b;_0x2516d7[_0x4605('0x3b')]=_['keys'](db[_0x4605('0x7f')][_0x4605('0x34')]);_0x2516d7['query']=_[_0x4605('0x39')](_0x5bea14[_0x4605('0x38')]);_0x2516d7['filters']=_[_0x4605('0x3a')](_0x2516d7[_0x4605('0x3b')],_0x2516d7['query']);_0x1a9542[_0x4605('0x3c')]=_['intersection'](_0x2516d7[_0x4605('0x3b')],qs[_0x4605('0x3d')](_0x5bea14[_0x4605('0x38')]['fields']));_0x1a9542['attributes']=_0x1a9542[_0x4605('0x3c')][_0x4605('0x3e')]?_0x1a9542[_0x4605('0x3c')]:_0x2516d7['model'];_0x1a9542[_0x4605('0x40')]=qs[_0x4605('0x41')](_0x5bea14[_0x4605('0x38')]['sort']);_0x1a9542[_0x4605('0x45')]=qs['filters'](_[_0x4605('0x43')](_0x5bea14[_0x4605('0x38')],_0x2516d7[_0x4605('0x42')]));if(_0x5bea14[_0x4605('0x38')][_0x4605('0x44')]){_0x1a9542['where']=_[_0x4605('0x47')](_0x1a9542['where'],{'$or':_['map'](_0x1a9542['attributes'],function(_0x197f44){var _0xe40c08={};_0xe40c08[_0x197f44]={'$like':'%'+_0x5bea14[_0x4605('0x38')][_0x4605('0x44')]+'%'};return _0xe40c08;})});}_0x1a9542=_[_0x4605('0x47')]({},_0x1a9542,_0x5bea14['options']);return _0x529404['getItems'](_0x1a9542);}})[_0x4605('0x29')](function(_0xa311a3){if(_0xa311a3){_0x7e140b=_0xa311a3['length'];if(!_0x5bea14[_0x4605('0x38')]['hasOwnProperty']('nolimit')){_0x1a9542['limit']=qs[_0x4605('0x23')](_0x5bea14['query']['limit']);_0x1a9542[_0x4605('0x21')]=qs[_0x4605('0x21')](_0x5bea14['query'][_0x4605('0x21')]);}return _0x529404[_0x4605('0x80')](_0x1a9542);}})['then'](function(_0x4a4c50){if(_0x4a4c50){return _0x4a4c50?{'count':_0x7e140b,'rows':_0x4a4c50}:null;}})[_0x4605('0x29')](respondWithResult(_0x34a5b7,null))[_0x4605('0x4b')](handleError(_0x34a5b7,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index f5074eb..1688757 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 _0x8b5f=['hasOwnProperty','hook','exports','Dashboard','setMaxListeners','update','emit'];(function(_0x121c5b,_0x1479dc){var _0x32c4df=function(_0x66bb36){while(--_0x66bb36){_0x121c5b['push'](_0x121c5b['shift']());}};_0x32c4df(++_0x1479dc);}(_0x8b5f,0x106));var _0xf8b5=function(_0x2847c8,_0x28edd7){_0x2847c8=_0x2847c8-0x0;var _0x3d9118=_0x8b5f[_0x2847c8];return _0x3d9118;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0xf8b5('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xf8b5('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf8b5('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3d36ab){return function(_0x160b34,_0x45c578,_0x823790){DashboardEvents[_0xf8b5('0x3')](_0x3d36ab+':'+_0x160b34['id'],_0x160b34);DashboardEvents[_0xf8b5('0x3')](_0x3d36ab,_0x160b34);_0x823790(null);};}for(var e in events){if(events[_0xf8b5('0x4')](e)){var event=events[e];Dashboard[_0xf8b5('0x5')](e,emitEvent(event));}}module[_0xf8b5('0x6')]=DashboardEvents; \ No newline at end of file +var _0x0514=['Dashboard','setMaxListeners','update','remove','emit','exports','events'];(function(_0x558dad,_0x1a9b5a){var _0x1921ea=function(_0x2d44d6){while(--_0x2d44d6){_0x558dad['push'](_0x558dad['shift']());}};_0x1921ea(++_0x1a9b5a);}(_0x0514,0x1f0));var _0x4051=function(_0x55eb7b,_0x2b1712){_0x55eb7b=_0x55eb7b-0x0;var _0x477918=_0x0514[_0x55eb7b];return _0x477918;};'use strict';var EventEmitter=require(_0x4051('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x4051('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x4051('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4051('0x3'),'afterDestroy':_0x4051('0x4')};function emitEvent(_0x57ff03){return function(_0x557424,_0xaa9e5b,_0x2a1931){DashboardEvents[_0x4051('0x5')](_0x57ff03+':'+_0x557424['id'],_0x557424);DashboardEvents[_0x4051('0x5')](_0x57ff03,_0x557424);_0x2a1931(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x4051('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index cc0bdc1..f70f646 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 _0xb7d0=['define','Dashboard','dashboards','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports'];(function(_0x1bc762,_0x523eb3){var _0x40f70c=function(_0x3c206e){while(--_0x3c206e){_0x1bc762['push'](_0x1bc762['shift']());}};_0x40f70c(++_0x523eb3);}(_0xb7d0,0x93));var _0x0b7d=function(_0x1ef48d,_0x19781c){_0x1ef48d=_0x1ef48d-0x0;var _0x25776c=_0xb7d0[_0x1ef48d];return _0x25776c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0b7d('0x0'))(_0x0b7d('0x1'));var moment=require(_0x0b7d('0x2'));var BPromise=require('bluebird');var rp=require(_0x0b7d('0x3'));var fs=require('fs');var path=require(_0x0b7d('0x4'));var rimraf=require(_0x0b7d('0x5'));var config=require(_0x0b7d('0x6'));var attributes=require(_0x0b7d('0x7'));module[_0x0b7d('0x8')]=function(_0x545509,_0x24e0fe){return _0x545509[_0x0b7d('0x9')](_0x0b7d('0xa'),attributes,{'tableName':_0x0b7d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa7c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','dashboards','lodash'];(function(_0x29ba65,_0x3c4af7){var _0x422117=function(_0x257eda){while(--_0x257eda){_0x29ba65['push'](_0x29ba65['shift']());}};_0x422117(++_0x3c4af7);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x10072b,_0x46b025){_0x10072b=_0x10072b-0x0;var _0x409d9d=_0xfa7c[_0x10072b];return _0x409d9d;};'use strict';var _=require(_0xcfa7('0x0'));var util=require('util');var logger=require(_0xcfa7('0x1'))(_0xcfa7('0x2'));var moment=require(_0xcfa7('0x3'));var BPromise=require(_0xcfa7('0x4'));var rp=require(_0xcfa7('0x5'));var fs=require('fs');var path=require(_0xcfa7('0x6'));var rimraf=require(_0xcfa7('0x7'));var config=require(_0xcfa7('0x8'));var attributes=require('./dashboard.attributes');module[_0xcfa7('0x9')]=function(_0x3bf816,_0x9d96a2){return _0x3bf816[_0xcfa7('0xa')]('Dashboard',attributes,{'tableName':_0xcfa7('0xb'),'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 8b569c3..59fd4b9 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 _0xea41=['socket.io-emitter','register','request','then','info','debug','request\x20sent','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis'];(function(_0x2f4f23,_0xa9faec){var _0x7b8456=function(_0x43d206){while(--_0x43d206){_0x2f4f23['push'](_0x2f4f23['shift']());}};_0x7b8456(++_0xa9faec);}(_0xea41,0x142));var _0x1ea4=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xea41[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x1ea4('0x0'));var util=require(_0x1ea4('0x1'));var moment=require(_0x1ea4('0x2'));var BPromise=require('bluebird');var rs=require(_0x1ea4('0x3'));var fs=require('fs');var Redis=require(_0x1ea4('0x4'));var db=require(_0x1ea4('0x5'))['db'];var utils=require(_0x1ea4('0x6'));var logger=require(_0x1ea4('0x7'))(_0x1ea4('0x8'));var config=require(_0x1ea4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1ea4('0xa')][_0x1ea4('0xb')]({'port':0x232a});config['redis']=_[_0x1ea4('0xc')](config[_0x1ea4('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ea4('0xe'))(new Redis(config[_0x1ea4('0xd')]));require('./dashboard.socket')[_0x1ea4('0xf')](socket);function respondWithRpcPromise(_0x362587,_0x117478,_0x30cfde){return new BPromise(function(_0x422dbd,_0x3f7c8f){return client[_0x1ea4('0x10')](_0x362587,_0x30cfde)[_0x1ea4('0x11')](function(_0x44e239){logger[_0x1ea4('0x12')]('Dashboard,\x20%s,\x20%s',_0x117478,'request\x20sent');logger[_0x1ea4('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x117478,_0x1ea4('0x14'),JSON[_0x1ea4('0x15')](_0x44e239));if(_0x44e239[_0x1ea4('0x16')]){if(_0x44e239[_0x1ea4('0x16')][_0x1ea4('0x17')]===0x1f4){logger[_0x1ea4('0x16')](_0x1ea4('0x18'),_0x117478,_0x44e239[_0x1ea4('0x16')][_0x1ea4('0x19')]);return _0x3f7c8f(_0x44e239['error'][_0x1ea4('0x19')]);}logger['error'](_0x1ea4('0x18'),_0x117478,_0x44e239[_0x1ea4('0x16')][_0x1ea4('0x19')]);return _0x422dbd(_0x44e239['error'][_0x1ea4('0x19')]);}else{logger[_0x1ea4('0x12')](_0x1ea4('0x18'),_0x117478,_0x1ea4('0x14'));_0x422dbd(_0x44e239[_0x1ea4('0x1a')]['message']);}})[_0x1ea4('0x1b')](function(_0x19c66c){logger[_0x1ea4('0x16')](_0x1ea4('0x18'),_0x117478,_0x19c66c);_0x3f7c8f(_0x19c66c);});});} \ No newline at end of file +var _0x9b55=['error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x50b2c8,_0x1fa521){var _0x41d301=function(_0x131e9e){while(--_0x131e9e){_0x50b2c8['push'](_0x50b2c8['shift']());}};_0x41d301(++_0x1fa521);}(_0x9b55,0xa7));var _0x59b5=function(_0x1ec4b6,_0x460912){_0x1ec4b6=_0x1ec4b6-0x0;var _0x1ff750=_0x9b55[_0x1ec4b6];return _0x1ff750;};'use strict';var _=require('lodash');var util=require(_0x59b5('0x0'));var moment=require(_0x59b5('0x1'));var BPromise=require(_0x59b5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x59b5('0x3'));var db=require(_0x59b5('0x4'))['db'];var utils=require(_0x59b5('0x5'));var logger=require(_0x59b5('0x6'))(_0x59b5('0x7'));var config=require(_0x59b5('0x8'));var jayson=require(_0x59b5('0x9'));var client=jayson[_0x59b5('0xa')]['http']({'port':0x232a});config['redis']=_[_0x59b5('0xb')](config['redis'],{'host':_0x59b5('0xc'),'port':0x18eb});var socket=require(_0x59b5('0xd'))(new Redis(config[_0x59b5('0xe')]));require(_0x59b5('0xf'))[_0x59b5('0x10')](socket);function respondWithRpcPromise(_0x20a9d3,_0x14ce88,_0x7d2463){return new BPromise(function(_0x4178ad,_0x4d30e6){return client[_0x59b5('0x11')](_0x20a9d3,_0x7d2463)['then'](function(_0x5f2096){logger[_0x59b5('0x12')](_0x59b5('0x13'),_0x14ce88,_0x59b5('0x14'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x14ce88,'request\x20sent',JSON[_0x59b5('0x15')](_0x5f2096));if(_0x5f2096[_0x59b5('0x16')]){if(_0x5f2096[_0x59b5('0x16')][_0x59b5('0x17')]===0x1f4){logger[_0x59b5('0x16')]('Dashboard,\x20%s,\x20%s',_0x14ce88,_0x5f2096[_0x59b5('0x16')][_0x59b5('0x18')]);return _0x4d30e6(_0x5f2096['error'][_0x59b5('0x18')]);}logger['error'](_0x59b5('0x13'),_0x14ce88,_0x5f2096[_0x59b5('0x16')]['message']);return _0x4178ad(_0x5f2096[_0x59b5('0x16')][_0x59b5('0x18')]);}else{logger[_0x59b5('0x12')](_0x59b5('0x13'),_0x14ce88,'request\x20sent');_0x4178ad(_0x5f2096[_0x59b5('0x19')]['message']);}})[_0x59b5('0x1a')](function(_0x17673b){logger[_0x59b5('0x16')](_0x59b5('0x13'),_0x14ce88,_0x17673b);_0x4d30e6(_0x17673b);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 4fd980c..44b6880 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 _0x9b05=['removeListener','register','length','dashboard:','./dashboard.events','save','remove','emit'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0x9b05,0xb4));var _0x59b0=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x9b05[_0x4eafed];return _0x159c85;};'use strict';var DashboardEvents=require(_0x59b0('0x0'));var events=[_0x59b0('0x1'),_0x59b0('0x2'),'update'];function createListener(_0x37d5e8,_0x5b6a3d){return function(_0x4a61b3){_0x5b6a3d[_0x59b0('0x3')](_0x37d5e8,_0x4a61b3);};}function removeListener(_0x94c9d1,_0x34700e){return function(){DashboardEvents[_0x59b0('0x4')](_0x94c9d1,_0x34700e);};}exports[_0x59b0('0x5')]=function(_0x5c9789){for(var _0x448cea=0x0,_0x5937a1=events[_0x59b0('0x6')];_0x448cea<_0x5937a1;_0x448cea++){var _0x2ce5e3=events[_0x448cea];var _0x530fd3=createListener(_0x59b0('0x7')+_0x2ce5e3,_0x5c9789);DashboardEvents['on'](_0x2ce5e3,_0x530fd3);}}; \ No newline at end of file +var _0xe243=['dashboard:','./dashboard.events','save','remove','update','emit','length'];(function(_0x3ed5ec,_0x1ee5ad){var _0x5a6ea8=function(_0x5286a4){while(--_0x5286a4){_0x3ed5ec['push'](_0x3ed5ec['shift']());}};_0x5a6ea8(++_0x1ee5ad);}(_0xe243,0x104));var _0x3e24=function(_0x242bb9,_0x5575b7){_0x242bb9=_0x242bb9-0x0;var _0x2a2760=_0xe243[_0x242bb9];return _0x2a2760;};'use strict';var DashboardEvents=require(_0x3e24('0x0'));var events=[_0x3e24('0x1'),_0x3e24('0x2'),_0x3e24('0x3')];function createListener(_0x3c8ee0,_0x5886bd){return function(_0x1c8377){_0x5886bd[_0x3e24('0x4')](_0x3c8ee0,_0x1c8377);};}function removeListener(_0x347c19,_0xb6d35b){return function(){DashboardEvents['removeListener'](_0x347c19,_0xb6d35b);};}exports['register']=function(_0x96f409){for(var _0x66d981=0x0,_0x5d26db=events[_0x3e24('0x5')];_0x66d981<_0x5d26db;_0x66d981++){var _0x5e6066=events[_0x66d981];var _0x496647=createListener(_0x3e24('0x6')+_0x5e6066,_0x96f409);DashboardEvents['on'](_0x5e6066,_0x496647);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 62512dd..ecb084b 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 _0x1871=['index','/:id','show','isAuthenticated','getItems','post','create','/:id/items','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get'];(function(_0x29e362,_0x482f29){var _0x118ab1=function(_0x39ecb6){while(--_0x39ecb6){_0x29e362['push'](_0x29e362['shift']());}};_0x118ab1(++_0x482f29);}(_0x1871,0x1f0));var _0x1187=function(_0x29f03d,_0x14c777){_0x29f03d=_0x29f03d-0x0;var _0x5dee66=_0x1871[_0x29f03d];return _0x5dee66;};'use strict';var multer=require(_0x1187('0x0'));var util=require('util');var path=require(_0x1187('0x1'));var timeout=require(_0x1187('0x2'));var express=require(_0x1187('0x3'));var router=express[_0x1187('0x4')]();var fs_extra=require(_0x1187('0x5'));var auth=require(_0x1187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1187('0x7'));var controller=require(_0x1187('0x8'));router[_0x1187('0x9')]('/',auth['isAuthenticated'](),controller[_0x1187('0xa')]);router[_0x1187('0x9')](_0x1187('0xb'),auth['isAuthenticated'](),controller[_0x1187('0xc')]);router[_0x1187('0x9')]('/:id/items',auth[_0x1187('0xd')](),controller[_0x1187('0xe')]);router[_0x1187('0xf')]('/',auth[_0x1187('0xd')](),controller[_0x1187('0x10')]);router[_0x1187('0xf')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0x1187('0xf')](_0x1187('0x11'),auth[_0x1187('0xd')](),controller['addItem']);router[_0x1187('0x12')](_0x1187('0xb'),auth[_0x1187('0xd')](),controller[_0x1187('0x13')]);router[_0x1187('0x14')](_0x1187('0xb'),auth['isAuthenticated'](),controller[_0x1187('0x15')]);module[_0x1187('0x16')]=router; \ No newline at end of file +var _0x3681=['exports','util','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','put','update','delete','destroy'];(function(_0x56a463,_0x44243c){var _0x59a9a0=function(_0x4809c4){while(--_0x4809c4){_0x56a463['push'](_0x56a463['shift']());}};_0x59a9a0(++_0x44243c);}(_0x3681,0x190));var _0x1368=function(_0x128bb5,_0x51a631){_0x128bb5=_0x128bb5-0x0;var _0x53c4ce=_0x3681[_0x128bb5];return _0x53c4ce;};'use strict';var multer=require('multer');var util=require(_0x1368('0x0'));var path=require('path');var timeout=require(_0x1368('0x1'));var express=require(_0x1368('0x2'));var router=express[_0x1368('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1368('0x4'));var config=require('../../config/environment');var controller=require('./dashboard.controller');router[_0x1368('0x5')]('/',auth[_0x1368('0x6')](),controller[_0x1368('0x7')]);router[_0x1368('0x5')](_0x1368('0x8'),auth[_0x1368('0x6')](),controller[_0x1368('0x9')]);router[_0x1368('0x5')](_0x1368('0xa'),auth['isAuthenticated'](),controller[_0x1368('0xb')]);router[_0x1368('0xc')]('/',auth[_0x1368('0x6')](),controller[_0x1368('0xd')]);router[_0x1368('0xc')](_0x1368('0xe'),auth[_0x1368('0x6')](),controller[_0x1368('0xf')]);router['post'](_0x1368('0xa'),auth[_0x1368('0x6')](),controller['addItem']);router[_0x1368('0x10')]('/:id',auth[_0x1368('0x6')](),controller[_0x1368('0x11')]);router[_0x1368('0x12')]('/:id',auth[_0x1368('0x6')](),controller[_0x1368('0x13')]);module[_0x1368('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 2f61731..ac5dfa1 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 _0x5fc3=['squel','exports','STRING','TEXT','long','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x5465e6,_0x2a8809){var _0x10044e=function(_0x1d5dcd){while(--_0x1d5dcd){_0x5465e6['push'](_0x5465e6['shift']());}};_0x10044e(++_0x2a8809);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2440fe,_0x281a11){_0x2440fe=_0x2440fe-0x0;var _0x5cf734=_0x5fc3[_0x2440fe];return _0x5cf734;};'use strict';var Sequelize=require(_0x35fc('0x0'));var squel=require(_0x35fc('0x1'));var _=require('lodash');module[_0x35fc('0x2')]={'title':{'type':Sequelize[_0x35fc('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x35fc('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x35fc('0x4')](_0x35fc('0x5')),'get':function(){try{return JSON['parse'](this[_0x35fc('0x6')](_0x35fc('0x7')));}catch(_0x186a06){return[];}},'set':function(_0x5b85ad){try{this['setDataValue'](_0x35fc('0x7'),JSON['stringify'](_0x5b85ad));}catch(_0x16e153){this[_0x35fc('0x8')](_0x35fc('0x7'),JSON[_0x35fc('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x35fc('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x35fc('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x35fc('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x35fc('0x3')],'allowNull':![],'defaultValue':_0x35fc('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35fc('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x35fc('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x5fab=['STRING','TEXT','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel','exports'];(function(_0x2644c3,_0x4961c0){var _0x5f527b=function(_0x1b334e){while(--_0x1b334e){_0x2644c3['push'](_0x2644c3['shift']());}};_0x5f527b(++_0x4961c0);}(_0x5fab,0x177));var _0xb5fa=function(_0x139745,_0x503124){_0x139745=_0x139745-0x0;var _0x2cd695=_0x5fab[_0x139745];return _0x2cd695;};'use strict';var Sequelize=require(_0xb5fa('0x0'));var squel=require(_0xb5fa('0x1'));var _=require('lodash');module[_0xb5fa('0x2')]={'title':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb5fa('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb5fa('0x4')](_0xb5fa('0x5')),'get':function(){try{return JSON[_0xb5fa('0x6')](this[_0xb5fa('0x7')](_0xb5fa('0x8')));}catch(_0x10361d){return[];}},'set':function(_0x44df89){try{this['setDataValue']('attrs',JSON[_0xb5fa('0x9')](_0x44df89));}catch(_0x1aec3e){this[_0xb5fa('0xa')]('attrs',JSON[_0xb5fa('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb5fa('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb5fa('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![],'defaultValue':_0xb5fa('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![],'defaultValue':_0xb5fa('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb5fa('0x3')]},'titleFontSize':{'type':Sequelize[_0xb5fa('0xb')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 054b40c..50145fe 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 _0x15b2=['query','keys','model','fields','attributes','includeAll','options','DashboardItem','find','params','catch','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./dashboardItem.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','show','rawAttributes'];(function(_0x44d45a,_0x150d47){var _0x2e6c05=function(_0x4d22bd){while(--_0x4d22bd){_0x44d45a['push'](_0x44d45a['shift']());}};_0x2e6c05(++_0x150d47);}(_0x15b2,0x145));var _0x215b=function(_0x6c0f5f,_0x1deead){_0x6c0f5f=_0x6c0f5f-0x0;var _0x23980f=_0x15b2[_0x6c0f5f];return _0x23980f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x215b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x215b('0x1'));var rp=require(_0x215b('0x2'));var moment=require('moment');var BPromise=require(_0x215b('0x3'));var Mustache=require(_0x215b('0x4'));var util=require(_0x215b('0x5'));var path=require(_0x215b('0x6'));var sox=require('sox');var csv=require(_0x215b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x215b('0x8'));var _=require(_0x215b('0x9'));var squel=require(_0x215b('0xa'));var crypto=require(_0x215b('0xb'));var jsforce=require(_0x215b('0xc'));var deskjs=require(_0x215b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x215b('0xe'));var Papa=require(_0x215b('0xf'));var Redis=require('ioredis');var authService=require(_0x215b('0x10'));var qs=require(_0x215b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x215b('0x12'))('api');var utils=require(_0x215b('0x13'));var config=require(_0x215b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x215b('0x15'))['db'];config['redis']=_['defaults'](config[_0x215b('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x215b('0x17'))(new Redis(config['redis']));require(_0x215b('0x18'))[_0x215b('0x19')](socket);function respondWithStatusCode(_0x38d765,_0x4ed24c){_0x4ed24c=_0x4ed24c||0xcc;return function(_0x495178){if(_0x495178){return _0x38d765['sendStatus'](_0x4ed24c);}return _0x38d765[_0x215b('0x1a')](_0x4ed24c)[_0x215b('0x1b')]();};}function respondWithResult(_0x2d04cb,_0x2e96f5){_0x2e96f5=_0x2e96f5||0xc8;return function(_0x35508e){if(_0x35508e){return _0x2d04cb[_0x215b('0x1a')](_0x2e96f5)[_0x215b('0x1c')](_0x35508e);}};}function respondWithFilteredResult(_0x4a27aa,_0x31d565){return function(_0x2ca496){if(_0x2ca496){var _0x2fd65=typeof _0x31d565[_0x215b('0x1d')]===_0x215b('0x1e')&&typeof _0x31d565[_0x215b('0x1f')]===_0x215b('0x1e');var _0x2a1921=_0x2ca496['count'];var _0x534e73=_0x2fd65?0x0:_0x31d565[_0x215b('0x1d')];var _0x5d1998=_0x2fd65?_0x2ca496[_0x215b('0x20')]:_0x31d565[_0x215b('0x1d')]+_0x31d565[_0x215b('0x1f')];var _0x303c89;if(_0x5d1998>=_0x2a1921){_0x5d1998=_0x2a1921;_0x303c89=0xc8;}else{_0x303c89=0xce;}_0x4a27aa[_0x215b('0x1a')](_0x303c89);return _0x4a27aa[_0x215b('0x21')](_0x215b('0x22'),_0x534e73+'-'+_0x5d1998+'/'+_0x2a1921)[_0x215b('0x1c')](_0x2ca496);}return null;};}function patchUpdates(_0x5cce5d){return function(_0x4b31c3){try{jsonpatch[_0x215b('0x23')](_0x4b31c3,_0x5cce5d,!![]);}catch(_0x515a5c){return BPromise[_0x215b('0x24')](_0x515a5c);}return _0x4b31c3[_0x215b('0x25')]();};}function saveUpdates(_0x48568a,_0x91587a){return function(_0x55efe7){if(_0x55efe7){return _0x55efe7[_0x215b('0x26')](_0x48568a)[_0x215b('0x27')](function(_0x1b7c12){return _0x1b7c12;});}return null;};}function removeEntity(_0x245a36,_0x1f30b1){return function(_0x2b02d1){if(_0x2b02d1){return _0x2b02d1[_0x215b('0x28')]()[_0x215b('0x27')](function(){_0x245a36['status'](0xcc)[_0x215b('0x1b')]();});}};}function handleEntityNotFound(_0x1f1a6f,_0x47d96d){return function(_0x40eb6e){if(!_0x40eb6e){_0x1f1a6f[_0x215b('0x29')](0x194);}return _0x40eb6e;};}function handleError(_0x1470ac,_0x5df10e){_0x5df10e=_0x5df10e||0x1f4;return function(_0x23ffca){logger[_0x215b('0x2a')](_0x23ffca[_0x215b('0x2b')]);if(_0x23ffca[_0x215b('0x2c')]){delete _0x23ffca[_0x215b('0x2c')];}_0x1470ac[_0x215b('0x1a')](_0x5df10e)['send'](_0x23ffca);};}exports[_0x215b('0x2d')]=function(_0x3903b7,_0x1f59dc){var _0x1d449b={'raw':![],'where':{'id':_0x3903b7['params']['id']}},_0x5eb42b={};_0x5eb42b['model']=_['keys'](db['DashboardItem'][_0x215b('0x2e')]);_0x5eb42b[_0x215b('0x2f')]=_[_0x215b('0x30')](_0x3903b7[_0x215b('0x2f')]);_0x5eb42b['filters']=_['intersection'](_0x5eb42b['model'],_0x5eb42b[_0x215b('0x2f')]);_0x1d449b['attributes']=_['intersection'](_0x5eb42b[_0x215b('0x31')],qs[_0x215b('0x32')](_0x3903b7[_0x215b('0x2f')]['fields']));_0x1d449b[_0x215b('0x33')]=_0x1d449b[_0x215b('0x33')]['length']?_0x1d449b['attributes']:_0x5eb42b[_0x215b('0x31')];if(_0x3903b7['query'][_0x215b('0x34')]){_0x1d449b['include']=[{'all':!![]}];}_0x1d449b=_['merge']({},_0x1d449b,_0x3903b7[_0x215b('0x35')]);return db[_0x215b('0x36')][_0x215b('0x37')](_0x1d449b)['then'](handleEntityNotFound(_0x1f59dc,null))[_0x215b('0x27')](respondWithResult(_0x1f59dc,null))['catch'](handleError(_0x1f59dc,null));};exports['destroy']=function(_0x210713,_0x133d07){return db[_0x215b('0x36')][_0x215b('0x37')]({'where':{'id':_0x210713[_0x215b('0x38')]['id']}})[_0x215b('0x27')](handleEntityNotFound(_0x133d07,null))['then'](removeEntity(_0x133d07,null))[_0x215b('0x39')](handleError(_0x133d07,null));};function widgetAttributes(_0x22fbb3){try{switch(_0x22fbb3['type']){case _0x215b('0x3a'):return[{'name':_0x215b('0x3b'),'value':_0x22fbb3[_0x215b('0x3b')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3['attrs'][0x0]?_0x22fbb3[_0x215b('0x3c')][0x0][_0x215b('0x3d')]:undefined)||_0x215b('0x3e')}];case _0x215b('0x3f'):return[{'name':_0x215b('0x40'),'value':_0x22fbb3[_0x215b('0x40')]||(_0x22fbb3['attrs']&&_0x22fbb3['attrs'][0x0]?_0x22fbb3[_0x215b('0x3c')][0x0][_0x215b('0x3d')]:undefined)||''}];case'clock':return[{'name':_0x215b('0x41'),'value':_0x22fbb3[_0x215b('0x41')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3['attrs'][0x0]?_0x22fbb3[_0x215b('0x3c')][0x0][_0x215b('0x3d')]:undefined)||_0x215b('0x42')},{'name':'attrTimezone','value':_0x22fbb3[_0x215b('0x43')]||(_0x22fbb3['attrs']&&_0x22fbb3['attrs'][0x1]?_0x22fbb3[_0x215b('0x3c')][0x1][_0x215b('0x3d')]:undefined)||_0x215b('0x44')},{'name':'attrFontSize','value':_0x22fbb3[_0x215b('0x45')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x2]?_0x22fbb3[_0x215b('0x3c')][0x2]['value']:undefined)||0xc}];case _0x215b('0x46'):return[{'name':_0x215b('0x47'),'value':_0x22fbb3[_0x215b('0x47')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x0]?_0x22fbb3['attrs'][0x0][_0x215b('0x3d')]:undefined)||'total'},{'name':_0x215b('0x48'),'value':_0x22fbb3['attrVoiceQueues']||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x1]?_0x22fbb3[_0x215b('0x3c')][0x1][_0x215b('0x3d')]:undefined)||[]},{'name':_0x215b('0x45'),'value':_0x22fbb3['attrFontSize']||(_0x22fbb3['attrs']&&_0x22fbb3[_0x215b('0x3c')][0x2]?_0x22fbb3['attrs'][0x2][_0x215b('0x3d')]:undefined)||0x14},{'name':_0x215b('0x49'),'value':_0x22fbb3[_0x215b('0x49')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3['attrs'][0x3]?_0x22fbb3[_0x215b('0x3c')][0x3][_0x215b('0x3d')]:undefined)||_0x215b('0x4a')},{'name':'attrEmailAccounts','value':_0x22fbb3[_0x215b('0x4b')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x4]?_0x22fbb3[_0x215b('0x3c')][0x4]['value']:undefined)||''},{'name':_0x215b('0x4c'),'value':_0x22fbb3['attrFaxAccounts']||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x5]?_0x22fbb3['attrs'][0x5][_0x215b('0x3d')]:undefined)||''},{'name':_0x215b('0x4d'),'value':_0x22fbb3['attrSmsAccounts']||(_0x22fbb3['attrs']&&_0x22fbb3[_0x215b('0x3c')][0x6]?_0x22fbb3[_0x215b('0x3c')][0x6][_0x215b('0x3d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x22fbb3[_0x215b('0x4e')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x7]?_0x22fbb3[_0x215b('0x3c')][0x7]['value']:undefined)||''},{'name':_0x215b('0x4f'),'value':_0x22fbb3['attrWhatsappAccounts']||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x8]?_0x22fbb3[_0x215b('0x3c')][0x8]['value']:undefined)||''},{'name':_0x215b('0x50'),'value':_0x22fbb3[_0x215b('0x50')]||(_0x22fbb3['attrs']&&_0x22fbb3['attrs'][0x9]?_0x22fbb3[_0x215b('0x3c')][0x9][_0x215b('0x3d')]:undefined)||''}];case'multibar-chart':case _0x215b('0x51'):return[{'name':_0x215b('0x52'),'value':_0x22fbb3[_0x215b('0x52')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x0]?_0x22fbb3[_0x215b('0x3c')][0x0][_0x215b('0x3d')]:undefined)||'total'},{'name':'attrSerie2','value':_0x22fbb3[_0x215b('0x53')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3['attrs'][0x1]?_0x22fbb3[_0x215b('0x3c')][0x1][_0x215b('0x3d')]:undefined)||null},{'name':_0x215b('0x54'),'value':_0x22fbb3[_0x215b('0x54')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3['attrs'][0x2]?_0x22fbb3[_0x215b('0x3c')][0x2][_0x215b('0x3d')]:undefined)||null},{'name':_0x215b('0x48'),'value':_0x22fbb3['attrVoiceQueues']||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x3]?_0x22fbb3[_0x215b('0x3c')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x22fbb3[_0x215b('0x49')]||(_0x22fbb3['attrs']&&_0x22fbb3[_0x215b('0x3c')][0x4]?_0x22fbb3['attrs'][0x4][_0x215b('0x3d')]:undefined)||'voice'},{'name':_0x215b('0x4b'),'value':_0x22fbb3[_0x215b('0x4b')]||(_0x22fbb3['attrs']&&_0x22fbb3[_0x215b('0x3c')][0x5]?_0x22fbb3['attrs'][0x5][_0x215b('0x3d')]:undefined)||''},{'name':_0x215b('0x4c'),'value':_0x22fbb3[_0x215b('0x4c')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3['attrs'][0x6]?_0x22fbb3[_0x215b('0x3c')][0x6]['value']:undefined)||''},{'name':_0x215b('0x4d'),'value':_0x22fbb3[_0x215b('0x4d')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x7]?_0x22fbb3['attrs'][0x7]['value']:undefined)||''},{'name':_0x215b('0x4e'),'value':_0x22fbb3[_0x215b('0x4e')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x8]?_0x22fbb3[_0x215b('0x3c')][0x8][_0x215b('0x3d')]:undefined)||''},{'name':_0x215b('0x4f'),'value':_0x22fbb3[_0x215b('0x4f')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3['attrs'][0x9]?_0x22fbb3[_0x215b('0x3c')][0x9][_0x215b('0x3d')]:undefined)||''},{'name':_0x215b('0x50'),'value':_0x22fbb3[_0x215b('0x50')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0xa]?_0x22fbb3[_0x215b('0x3c')][0xa][_0x215b('0x3d')]:undefined)||''}];case _0x215b('0x55'):return[{'name':_0x215b('0x56'),'type':_0x22fbb3[_0x215b('0x57')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x0]?_0x22fbb3[_0x215b('0x3c')][0x0]['type']:undefined)||null,'value':_0x22fbb3[_0x215b('0x56')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x0]?_0x22fbb3[_0x215b('0x3c')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x22fbb3[_0x215b('0x58')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x1]?_0x22fbb3[_0x215b('0x3c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0xf7497c){logger['error'](_0x215b('0x59'),JSON[_0x215b('0x5a')](_0xf7497c));return[];}}exports[_0x215b('0x5b')]=function(_0x3fc7aa,_0x305517){if(_0x3fc7aa[_0x215b('0x5c')]){_0x3fc7aa['body'][_0x215b('0x3c')]=widgetAttributes(_0x3fc7aa[_0x215b('0x5c')]);}return db[_0x215b('0x36')][_0x215b('0x5b')](_0x3fc7aa[_0x215b('0x5c')],{})[_0x215b('0x27')](respondWithResult(_0x305517,0xc9))['catch'](handleError(_0x305517,null));};exports[_0x215b('0x26')]=function(_0x3ff49d,_0x106595){if(_0x3ff49d['body']['id']){delete _0x3ff49d[_0x215b('0x5c')]['id'];}_0x3ff49d[_0x215b('0x5c')]['attrs']=widgetAttributes(_0x3ff49d[_0x215b('0x5c')]);return db[_0x215b('0x36')]['find']({'where':{'id':_0x3ff49d[_0x215b('0x38')]['id']}})[_0x215b('0x27')](handleEntityNotFound(_0x106595,null))['then'](saveUpdates(_0x3ff49d['body'],null))[_0x215b('0x27')](respondWithResult(_0x106595,null))[_0x215b('0x39')](handleError(_0x106595,null));}; \ No newline at end of file +var _0xfcf0=['length','includeAll','include','catch','find','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','error','show','params','model','keys','DashboardItem','query','filters','intersection','attributes','fields'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfcf0,0x138));var _0x0fcf=function(_0x330141,_0x1dd290){_0x330141=_0x330141-0x0;var _0x1b68a2=_0xfcf0[_0x330141];return _0x1b68a2;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];config[_0x0fcf('0x18')]=_['defaults'](config[_0x0fcf('0x18')],{'host':_0x0fcf('0x19'),'port':0x18eb});var socket=require(_0x0fcf('0x1a'))(new Redis(config[_0x0fcf('0x18')]));require(_0x0fcf('0x1b'))['register'](socket);function respondWithStatusCode(_0xa32692,_0x3701c9){_0x3701c9=_0x3701c9||0xcc;return function(_0x1fcb47){if(_0x1fcb47){return _0xa32692['sendStatus'](_0x3701c9);}return _0xa32692[_0x0fcf('0x1c')](_0x3701c9)[_0x0fcf('0x1d')]();};}function respondWithResult(_0x445207,_0x177c8f){_0x177c8f=_0x177c8f||0xc8;return function(_0x48dd53){if(_0x48dd53){return _0x445207[_0x0fcf('0x1c')](_0x177c8f)[_0x0fcf('0x1e')](_0x48dd53);}};}function respondWithFilteredResult(_0x1a8477,_0x8581bd){return function(_0x19cfbd){if(_0x19cfbd){var _0x567320=typeof _0x8581bd[_0x0fcf('0x1f')]===_0x0fcf('0x20')&&typeof _0x8581bd['limit']===_0x0fcf('0x20');var _0x1b9a90=_0x19cfbd['count'];var _0x2022e1=_0x567320?0x0:_0x8581bd['offset'];var _0x3fc9e6=_0x567320?_0x19cfbd[_0x0fcf('0x21')]:_0x8581bd['offset']+_0x8581bd[_0x0fcf('0x22')];var _0x3f28d0;if(_0x3fc9e6>=_0x1b9a90){_0x3fc9e6=_0x1b9a90;_0x3f28d0=0xc8;}else{_0x3f28d0=0xce;}_0x1a8477[_0x0fcf('0x1c')](_0x3f28d0);return _0x1a8477['set'](_0x0fcf('0x23'),_0x2022e1+'-'+_0x3fc9e6+'/'+_0x1b9a90)[_0x0fcf('0x1e')](_0x19cfbd);}return null;};}function patchUpdates(_0x196d30){return function(_0x41b20b){try{jsonpatch[_0x0fcf('0x24')](_0x41b20b,_0x196d30,!![]);}catch(_0x30e1b0){return BPromise['reject'](_0x30e1b0);}return _0x41b20b[_0x0fcf('0x25')]();};}function saveUpdates(_0x253641,_0x6021b4){return function(_0xd6f8b5){if(_0xd6f8b5){return _0xd6f8b5[_0x0fcf('0x26')](_0x253641)[_0x0fcf('0x27')](function(_0x2ce990){return _0x2ce990;});}return null;};}function removeEntity(_0x18f269,_0x117510){return function(_0x588685){if(_0x588685){return _0x588685[_0x0fcf('0x28')]()[_0x0fcf('0x27')](function(){_0x18f269[_0x0fcf('0x1c')](0xcc)[_0x0fcf('0x1d')]();});}};}function handleEntityNotFound(_0x3876ed,_0x38fe0e){return function(_0x2730b0){if(!_0x2730b0){_0x3876ed['sendStatus'](0x194);}return _0x2730b0;};}function handleError(_0x137e10,_0xbaa4d8){_0xbaa4d8=_0xbaa4d8||0x1f4;return function(_0x200517){logger[_0x0fcf('0x29')](_0x200517['stack']);if(_0x200517['name']){delete _0x200517['name'];}_0x137e10[_0x0fcf('0x1c')](_0xbaa4d8)['send'](_0x200517);};}exports[_0x0fcf('0x2a')]=function(_0x9ccae3,_0x56a416){var _0xdfd3ec={'raw':![],'where':{'id':_0x9ccae3[_0x0fcf('0x2b')]['id']}},_0x117041={};_0x117041[_0x0fcf('0x2c')]=_[_0x0fcf('0x2d')](db[_0x0fcf('0x2e')]['rawAttributes']);_0x117041[_0x0fcf('0x2f')]=_[_0x0fcf('0x2d')](_0x9ccae3[_0x0fcf('0x2f')]);_0x117041[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x117041[_0x0fcf('0x2c')],_0x117041['query']);_0xdfd3ec[_0x0fcf('0x32')]=_[_0x0fcf('0x31')](_0x117041[_0x0fcf('0x2c')],qs[_0x0fcf('0x33')](_0x9ccae3[_0x0fcf('0x2f')][_0x0fcf('0x33')]));_0xdfd3ec[_0x0fcf('0x32')]=_0xdfd3ec[_0x0fcf('0x32')][_0x0fcf('0x34')]?_0xdfd3ec[_0x0fcf('0x32')]:_0x117041[_0x0fcf('0x2c')];if(_0x9ccae3[_0x0fcf('0x2f')][_0x0fcf('0x35')]){_0xdfd3ec[_0x0fcf('0x36')]=[{'all':!![]}];}_0xdfd3ec=_['merge']({},_0xdfd3ec,_0x9ccae3['options']);return db[_0x0fcf('0x2e')]['find'](_0xdfd3ec)['then'](handleEntityNotFound(_0x56a416,null))[_0x0fcf('0x27')](respondWithResult(_0x56a416,null))[_0x0fcf('0x37')](handleError(_0x56a416,null));};exports[_0x0fcf('0x28')]=function(_0x5deb9b,_0x57e635){return db[_0x0fcf('0x2e')][_0x0fcf('0x38')]({'where':{'id':_0x5deb9b[_0x0fcf('0x2b')]['id']}})['then'](handleEntityNotFound(_0x57e635,null))[_0x0fcf('0x27')](removeEntity(_0x57e635,null))[_0x0fcf('0x37')](handleError(_0x57e635,null));};function widgetAttributes(_0x29067e){try{switch(_0x29067e['type']){case'iframe':return[{'name':'attrUrl','value':_0x29067e[_0x0fcf('0x39')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x0]?_0x29067e[_0x0fcf('0x3a')][0x0][_0x0fcf('0x3b')]:undefined)||'https://'}];case _0x0fcf('0x3c'):return[{'name':_0x0fcf('0x3d'),'value':_0x29067e[_0x0fcf('0x3d')]||(_0x29067e['attrs']&&_0x29067e['attrs'][0x0]?_0x29067e[_0x0fcf('0x3a')][0x0][_0x0fcf('0x3b')]:undefined)||''}];case _0x0fcf('0x3e'):return[{'name':_0x0fcf('0x3f'),'value':_0x29067e[_0x0fcf('0x3f')]||(_0x29067e['attrs']&&_0x29067e[_0x0fcf('0x3a')][0x0]?_0x29067e[_0x0fcf('0x3a')][0x0][_0x0fcf('0x3b')]:undefined)||_0x0fcf('0x40')},{'name':'attrTimezone','value':_0x29067e['attrTimezone']||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x1]?_0x29067e['attrs'][0x1][_0x0fcf('0x3b')]:undefined)||_0x0fcf('0x41')},{'name':'attrFontSize','value':_0x29067e[_0x0fcf('0x42')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x2]?_0x29067e[_0x0fcf('0x3a')][0x2][_0x0fcf('0x3b')]:undefined)||0xc}];case'counter':return[{'name':_0x0fcf('0x43'),'value':_0x29067e[_0x0fcf('0x43')]||(_0x29067e['attrs']&&_0x29067e['attrs'][0x0]?_0x29067e[_0x0fcf('0x3a')][0x0]['value']:undefined)||'total'},{'name':_0x0fcf('0x44'),'value':_0x29067e[_0x0fcf('0x44')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x1]?_0x29067e[_0x0fcf('0x3a')][0x1][_0x0fcf('0x3b')]:undefined)||[]},{'name':_0x0fcf('0x42'),'value':_0x29067e[_0x0fcf('0x42')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x2]?_0x29067e['attrs'][0x2][_0x0fcf('0x3b')]:undefined)||0x14},{'name':_0x0fcf('0x45'),'value':_0x29067e[_0x0fcf('0x45')]||(_0x29067e['attrs']&&_0x29067e['attrs'][0x3]?_0x29067e[_0x0fcf('0x3a')][0x3][_0x0fcf('0x3b')]:undefined)||_0x0fcf('0x46')},{'name':_0x0fcf('0x47'),'value':_0x29067e['attrEmailAccounts']||(_0x29067e['attrs']&&_0x29067e[_0x0fcf('0x3a')][0x4]?_0x29067e[_0x0fcf('0x3a')][0x4][_0x0fcf('0x3b')]:undefined)||''},{'name':_0x0fcf('0x48'),'value':_0x29067e[_0x0fcf('0x48')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x5]?_0x29067e[_0x0fcf('0x3a')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x29067e[_0x0fcf('0x49')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x6]?_0x29067e[_0x0fcf('0x3a')][0x6][_0x0fcf('0x3b')]:undefined)||''},{'name':_0x0fcf('0x4a'),'value':_0x29067e['attrOpenchannelAccounts']||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x7]?_0x29067e['attrs'][0x7][_0x0fcf('0x3b')]:undefined)||''},{'name':_0x0fcf('0x4b'),'value':_0x29067e[_0x0fcf('0x4b')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e['attrs'][0x8]?_0x29067e[_0x0fcf('0x3a')][0x8][_0x0fcf('0x3b')]:undefined)||''},{'name':_0x0fcf('0x4c'),'value':_0x29067e[_0x0fcf('0x4c')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x9]?_0x29067e[_0x0fcf('0x3a')][0x9][_0x0fcf('0x3b')]:undefined)||''}];case _0x0fcf('0x4d'):case _0x0fcf('0x4e'):return[{'name':_0x0fcf('0x4f'),'value':_0x29067e[_0x0fcf('0x4f')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x0]?_0x29067e['attrs'][0x0][_0x0fcf('0x3b')]:undefined)||'total'},{'name':_0x0fcf('0x50'),'value':_0x29067e[_0x0fcf('0x50')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x1]?_0x29067e[_0x0fcf('0x3a')][0x1]['value']:undefined)||null},{'name':_0x0fcf('0x51'),'value':_0x29067e['attrSerie3']||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x2]?_0x29067e['attrs'][0x2][_0x0fcf('0x3b')]:undefined)||null},{'name':_0x0fcf('0x44'),'value':_0x29067e['attrVoiceQueues']||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x3]?_0x29067e[_0x0fcf('0x3a')][0x3][_0x0fcf('0x3b')]:undefined)||[]},{'name':_0x0fcf('0x45'),'value':_0x29067e['attrChannel']||(_0x29067e['attrs']&&_0x29067e[_0x0fcf('0x3a')][0x4]?_0x29067e['attrs'][0x4][_0x0fcf('0x3b')]:undefined)||_0x0fcf('0x46')},{'name':'attrEmailAccounts','value':_0x29067e['attrEmailAccounts']||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x5]?_0x29067e[_0x0fcf('0x3a')][0x5]['value']:undefined)||''},{'name':_0x0fcf('0x48'),'value':_0x29067e['attrFaxAccounts']||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x6]?_0x29067e[_0x0fcf('0x3a')][0x6]['value']:undefined)||''},{'name':_0x0fcf('0x49'),'value':_0x29067e[_0x0fcf('0x49')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x7]?_0x29067e[_0x0fcf('0x3a')][0x7][_0x0fcf('0x3b')]:undefined)||''},{'name':_0x0fcf('0x4a'),'value':_0x29067e[_0x0fcf('0x4a')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x8]?_0x29067e[_0x0fcf('0x3a')][0x8]['value']:undefined)||''},{'name':_0x0fcf('0x4b'),'value':_0x29067e[_0x0fcf('0x4b')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x9]?_0x29067e[_0x0fcf('0x3a')][0x9][_0x0fcf('0x3b')]:undefined)||''},{'name':_0x0fcf('0x4c'),'value':_0x29067e['attrChatWebsites']||(_0x29067e['attrs']&&_0x29067e[_0x0fcf('0x3a')][0xa]?_0x29067e[_0x0fcf('0x3a')][0xa]['value']:undefined)||''}];case _0x0fcf('0x52'):return[{'name':_0x0fcf('0x53'),'type':_0x29067e[_0x0fcf('0x54')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e['attrs'][0x0]?_0x29067e[_0x0fcf('0x3a')][0x0][_0x0fcf('0x55')]:undefined)||null,'value':_0x29067e[_0x0fcf('0x53')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x0]?_0x29067e[_0x0fcf('0x3a')][0x0]['value']:undefined)||null},{'name':_0x0fcf('0x56'),'value':_0x29067e[_0x0fcf('0x56')]||(_0x29067e[_0x0fcf('0x3a')]&&_0x29067e[_0x0fcf('0x3a')][0x1]?_0x29067e[_0x0fcf('0x3a')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x4f1bc5){logger[_0x0fcf('0x29')](_0x0fcf('0x57'),JSON[_0x0fcf('0x58')](_0x4f1bc5));return[];}}exports[_0x0fcf('0x59')]=function(_0x2066f6,_0x2aa73a){if(_0x2066f6[_0x0fcf('0x5a')]){_0x2066f6[_0x0fcf('0x5a')][_0x0fcf('0x3a')]=widgetAttributes(_0x2066f6[_0x0fcf('0x5a')]);}return db['DashboardItem'][_0x0fcf('0x59')](_0x2066f6[_0x0fcf('0x5a')],{})[_0x0fcf('0x27')](respondWithResult(_0x2aa73a,0xc9))[_0x0fcf('0x37')](handleError(_0x2aa73a,null));};exports[_0x0fcf('0x26')]=function(_0x20ca7f,_0x21d767){if(_0x20ca7f[_0x0fcf('0x5a')]['id']){delete _0x20ca7f[_0x0fcf('0x5a')]['id'];}_0x20ca7f['body']['attrs']=widgetAttributes(_0x20ca7f['body']);return db['DashboardItem'][_0x0fcf('0x38')]({'where':{'id':_0x20ca7f['params']['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x21d767,null))[_0x0fcf('0x27')](saveUpdates(_0x20ca7f[_0x0fcf('0x5a')],null))['then'](respondWithResult(_0x21d767,null))['catch'](handleError(_0x21d767,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 693bc11..06a64f3 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 _0x36b7=['exports','events','../../mysqldb','DashboardItem','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x5a641c,_0xe434c6){var _0x304fbf=function(_0x27de12){while(--_0x27de12){_0x5a641c['push'](_0x5a641c['shift']());}};_0x304fbf(++_0xe434c6);}(_0x36b7,0x1a5));var _0x736b=function(_0x3893e3,_0x390b22){_0x3893e3=_0x3893e3-0x0;var _0x443c4b=_0x36b7[_0x3893e3];return _0x443c4b;};'use strict';var EventEmitter=require(_0x736b('0x0'));var DashboardItem=require(_0x736b('0x1'))['db'][_0x736b('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x736b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x736b('0x4'),'afterDestroy':_0x736b('0x5')};function emitEvent(_0x3d8973){return function(_0x144609,_0x4da067,_0x2b5127){DashboardItemEvents[_0x736b('0x6')](_0x3d8973+':'+_0x144609['id'],_0x144609);DashboardItemEvents[_0x736b('0x6')](_0x3d8973,_0x144609);_0x2b5127(null);};}for(var e in events){if(events[_0x736b('0x7')](e)){var event=events[e];DashboardItem[_0x736b('0x8')](e,emitEvent(event));}}module[_0x736b('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0x4d42=['hasOwnProperty','exports','events','../../mysqldb','DashboardItem','save','update','remove','emit'];(function(_0x595c38,_0x36d27a){var _0x22725f=function(_0xdde177){while(--_0xdde177){_0x595c38['push'](_0x595c38['shift']());}};_0x22725f(++_0x36d27a);}(_0x4d42,0x1bb));var _0x24d4=function(_0x2e59d8,_0x52df0c){_0x2e59d8=_0x2e59d8-0x0;var _0x2df9bb=_0x4d42[_0x2e59d8];return _0x2df9bb;};'use strict';var EventEmitter=require(_0x24d4('0x0'));var DashboardItem=require(_0x24d4('0x1'))['db'][_0x24d4('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x24d4('0x3'),'afterUpdate':_0x24d4('0x4'),'afterDestroy':_0x24d4('0x5')};function emitEvent(_0x447ff5){return function(_0x44e8a4,_0x10351a,_0x33718b){DashboardItemEvents[_0x24d4('0x6')](_0x447ff5+':'+_0x44e8a4['id'],_0x44e8a4);DashboardItemEvents[_0x24d4('0x6')](_0x447ff5,_0x44e8a4);_0x33718b(null);};}for(var e in events){if(events[_0x24d4('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x24d4('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index f7a7ac0..59f145f 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 _0x8f9e=['DashboardItem','lodash','util','api','moment','rimraf','./dashboardItem.attributes','exports','define'];(function(_0x269e65,_0x11b6ff){var _0x39814a=function(_0x54bee1){while(--_0x54bee1){_0x269e65['push'](_0x269e65['shift']());}};_0x39814a(++_0x11b6ff);}(_0x8f9e,0x160));var _0xe8f9=function(_0x3a19b5,_0xb2d070){_0x3a19b5=_0x3a19b5-0x0;var _0x3618b4=_0x8f9e[_0x3a19b5];return _0x3618b4;};'use strict';var _=require(_0xe8f9('0x0'));var util=require(_0xe8f9('0x1'));var logger=require('../../config/logger')(_0xe8f9('0x2'));var moment=require(_0xe8f9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe8f9('0x4'));var config=require('../../config/environment');var attributes=require(_0xe8f9('0x5'));module[_0xe8f9('0x6')]=function(_0x132a4f,_0xf77bb6){return _0x132a4f[_0xe8f9('0x7')](_0xe8f9('0x8'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ad2=['DashboardItem','dashboard_items','util','api','moment','bluebird','request-promise','path','rimraf','./dashboardItem.attributes'];(function(_0x45964b,_0xe849e5){var _0x4dc863=function(_0x1aa294){while(--_0x1aa294){_0x45964b['push'](_0x45964b['shift']());}};_0x4dc863(++_0xe849e5);}(_0x5ad2,0x1e2));var _0x25ad=function(_0x4fd508,_0x340941){_0x4fd508=_0x4fd508-0x0;var _0xc8e65b=_0x5ad2[_0x4fd508];return _0xc8e65b;};'use strict';var _=require('lodash');var util=require(_0x25ad('0x0'));var logger=require('../../config/logger')(_0x25ad('0x1'));var moment=require(_0x25ad('0x2'));var BPromise=require(_0x25ad('0x3'));var rp=require(_0x25ad('0x4'));var fs=require('fs');var path=require(_0x25ad('0x5'));var rimraf=require(_0x25ad('0x6'));var config=require('../../config/environment');var attributes=require(_0x25ad('0x7'));module['exports']=function(_0x12eecc,_0x3d4059){return _0x12eecc['define'](_0x25ad('0x8'),attributes,{'tableName':_0x25ad('0x9'),'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 f542379..111ba4a 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 _0x0b00=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','then','info','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring'];(function(_0x4a2b33,_0x87bd39){var _0x338ae5=function(_0x356003){while(--_0x356003){_0x4a2b33['push'](_0x4a2b33['shift']());}};_0x338ae5(++_0x87bd39);}(_0x0b00,0xec));var _0x00b0=function(_0x3936d3,_0xb649dd){_0x3936d3=_0x3936d3-0x0;var _0x5692f8=_0x0b00[_0x3936d3];return _0x5692f8;};'use strict';var _=require(_0x00b0('0x0'));var util=require(_0x00b0('0x1'));var moment=require(_0x00b0('0x2'));var BPromise=require('bluebird');var rs=require(_0x00b0('0x3'));var fs=require('fs');var Redis=require(_0x00b0('0x4'));var db=require(_0x00b0('0x5'))['db'];var utils=require(_0x00b0('0x6'));var logger=require(_0x00b0('0x7'))(_0x00b0('0x8'));var config=require(_0x00b0('0x9'));var jayson=require(_0x00b0('0xa'));var client=jayson[_0x00b0('0xb')][_0x00b0('0xc')]({'port':0x232a});config[_0x00b0('0xd')]=_[_0x00b0('0xe')](config[_0x00b0('0xd')],{'host':_0x00b0('0xf'),'port':0x18eb});var socket=require(_0x00b0('0x10'))(new Redis(config[_0x00b0('0xd')]));require(_0x00b0('0x11'))[_0x00b0('0x12')](socket);function respondWithRpcPromise(_0x331dac,_0x70a0c4,_0x4e6c85){return new BPromise(function(_0x8a65c8,_0x19f037){return client['request'](_0x331dac,_0x4e6c85)[_0x00b0('0x13')](function(_0x3a8428){logger[_0x00b0('0x14')]('DashboardItem,\x20%s,\x20%s',_0x70a0c4,'request\x20sent');logger[_0x00b0('0x15')](_0x00b0('0x16'),_0x70a0c4,'request\x20sent',JSON[_0x00b0('0x17')](_0x3a8428));if(_0x3a8428[_0x00b0('0x18')]){if(_0x3a8428[_0x00b0('0x18')][_0x00b0('0x19')]===0x1f4){logger[_0x00b0('0x18')](_0x00b0('0x1a'),_0x70a0c4,_0x3a8428['error']['message']);return _0x19f037(_0x3a8428['error'][_0x00b0('0x1b')]);}logger[_0x00b0('0x18')](_0x00b0('0x1a'),_0x70a0c4,_0x3a8428[_0x00b0('0x18')][_0x00b0('0x1b')]);return _0x8a65c8(_0x3a8428[_0x00b0('0x18')][_0x00b0('0x1b')]);}else{logger[_0x00b0('0x14')]('DashboardItem,\x20%s,\x20%s',_0x70a0c4,'request\x20sent');_0x8a65c8(_0x3a8428[_0x00b0('0x1c')][_0x00b0('0x1b')]);}})[_0x00b0('0x1d')](function(_0x16b66c){logger[_0x00b0('0x18')]('DashboardItem,\x20%s,\x20%s',_0x70a0c4,_0x16b66c);_0x19f037(_0x16b66c);});});} \ No newline at end of file +var _0xd433=['./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0xe4034a,_0x3459b2){var _0x189750=function(_0x2d32ce){while(--_0x2d32ce){_0xe4034a['push'](_0xe4034a['shift']());}};_0x189750(++_0x3459b2);}(_0xd433,0x1e5));var _0x3d43=function(_0x534148,_0x4ce5bc){_0x534148=_0x534148-0x0;var _0x5ad21d=_0xd433[_0x534148];return _0x5ad21d;};'use strict';var _=require(_0x3d43('0x0'));var util=require(_0x3d43('0x1'));var moment=require(_0x3d43('0x2'));var BPromise=require(_0x3d43('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3d43('0x5'));var logger=require(_0x3d43('0x6'))(_0x3d43('0x7'));var config=require(_0x3d43('0x8'));var jayson=require(_0x3d43('0x9'));var client=jayson[_0x3d43('0xa')][_0x3d43('0xb')]({'port':0x232a});config[_0x3d43('0xc')]=_['defaults'](config[_0x3d43('0xc')],{'host':_0x3d43('0xd'),'port':0x18eb});var socket=require(_0x3d43('0xe'))(new Redis(config[_0x3d43('0xc')]));require(_0x3d43('0xf'))[_0x3d43('0x10')](socket);function respondWithRpcPromise(_0x3fc9e9,_0x97ba94,_0x3637eb){return new BPromise(function(_0x41b891,_0x40098d){return client[_0x3d43('0x11')](_0x3fc9e9,_0x3637eb)['then'](function(_0x3098db){logger[_0x3d43('0x12')](_0x3d43('0x13'),_0x97ba94,_0x3d43('0x14'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x97ba94,_0x3d43('0x14'),JSON['stringify'](_0x3098db));if(_0x3098db[_0x3d43('0x15')]){if(_0x3098db[_0x3d43('0x15')]['code']===0x1f4){logger[_0x3d43('0x15')](_0x3d43('0x13'),_0x97ba94,_0x3098db[_0x3d43('0x15')][_0x3d43('0x16')]);return _0x40098d(_0x3098db[_0x3d43('0x15')][_0x3d43('0x16')]);}logger[_0x3d43('0x15')]('DashboardItem,\x20%s,\x20%s',_0x97ba94,_0x3098db['error'][_0x3d43('0x16')]);return _0x41b891(_0x3098db[_0x3d43('0x15')][_0x3d43('0x16')]);}else{logger[_0x3d43('0x12')](_0x3d43('0x13'),_0x97ba94,'request\x20sent');_0x41b891(_0x3098db[_0x3d43('0x17')][_0x3d43('0x16')]);}})[_0x3d43('0x18')](function(_0x46baca){logger['error']('DashboardItem,\x20%s,\x20%s',_0x97ba94,_0x46baca);_0x40098d(_0x46baca);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 85010e4..cfb8774 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 _0x34b0=['dashboardItem:','./dashboardItem.events','save','remove','update','emit','register','length'];(function(_0x2b5b44,_0x17189c){var _0x32cb66=function(_0x4ce183){while(--_0x4ce183){_0x2b5b44['push'](_0x2b5b44['shift']());}};_0x32cb66(++_0x17189c);}(_0x34b0,0xf9));var _0x034b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x34b0[_0x20a584];return _0x4b41a8;};'use strict';var DashboardItemEvents=require(_0x034b('0x0'));var events=[_0x034b('0x1'),_0x034b('0x2'),_0x034b('0x3')];function createListener(_0x36c635,_0x15d700){return function(_0x38c7e7){_0x15d700[_0x034b('0x4')](_0x36c635,_0x38c7e7);};}function removeListener(_0x446299,_0x58e69e){return function(){DashboardItemEvents['removeListener'](_0x446299,_0x58e69e);};}exports[_0x034b('0x5')]=function(_0x20ac25){for(var _0x58ded1=0x0,_0x1c4c6d=events[_0x034b('0x6')];_0x58ded1<_0x1c4c6d;_0x58ded1++){var _0xa8279b=events[_0x58ded1];var _0x2ce34c=createListener(_0x034b('0x7')+_0xa8279b,_0x20ac25);DashboardItemEvents['on'](_0xa8279b,_0x2ce34c);}}; \ No newline at end of file +var _0x9fb9=['emit','register','length','save','update'];(function(_0x25922b,_0x336e64){var _0x3383de=function(_0x5802c6){while(--_0x5802c6){_0x25922b['push'](_0x25922b['shift']());}};_0x3383de(++_0x336e64);}(_0x9fb9,0x99));var _0x99fb=function(_0x38d4b9,_0x11717c){_0x38d4b9=_0x38d4b9-0x0;var _0x4eef01=_0x9fb9[_0x38d4b9];return _0x4eef01;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x99fb('0x0'),'remove',_0x99fb('0x1')];function createListener(_0x39c171,_0x344c7e){return function(_0x576b5c){_0x344c7e[_0x99fb('0x2')](_0x39c171,_0x576b5c);};}function removeListener(_0x2043a1,_0x2fcedb){return function(){DashboardItemEvents['removeListener'](_0x2043a1,_0x2fcedb);};}exports[_0x99fb('0x3')]=function(_0x1b8c0f){for(var _0x594d88=0x0,_0x1be2e1=events[_0x99fb('0x4')];_0x594d88<_0x1be2e1;_0x594d88++){var _0x45dc0d=events[_0x594d88];var _0xa1b65a=createListener('dashboardItem:'+_0x45dc0d,_0x1b8c0f);DashboardItemEvents['on'](_0x45dc0d,_0xa1b65a);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 1df5acf..dd0f618 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 _0x3bb0=['isAuthenticated','create','put','update','delete','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0x3bb0,0x1ab));var _0x03bb=function(_0x29163c,_0x1314fb){_0x29163c=_0x29163c-0x0;var _0x5edf28=_0x3bb0[_0x29163c];return _0x5edf28;};'use strict';var multer=require(_0x03bb('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x03bb('0x1')]();var fs_extra=require(_0x03bb('0x2'));var auth=require(_0x03bb('0x3'));var interaction=require(_0x03bb('0x4'));var config=require('../../config/environment');var controller=require(_0x03bb('0x5'));router[_0x03bb('0x6')](_0x03bb('0x7'),auth[_0x03bb('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x03bb('0x9')]);router[_0x03bb('0xa')](_0x03bb('0x7'),auth['isAuthenticated'](),controller[_0x03bb('0xb')]);router[_0x03bb('0xc')](_0x03bb('0x7'),auth[_0x03bb('0x8')](),controller[_0x03bb('0xd')]);module[_0x03bb('0xe')]=router; \ No newline at end of file +var _0xab17=['isAuthenticated','show','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xab17,0xb6));var _0x7ab1=function(_0x1ddc34,_0x41e6a7){_0x1ddc34=_0x1ddc34-0x0;var _0x3791b5=_0xab17[_0x1ddc34];return _0x3791b5;};'use strict';var multer=require(_0x7ab1('0x0'));var util=require(_0x7ab1('0x1'));var path=require(_0x7ab1('0x2'));var timeout=require(_0x7ab1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7ab1('0x4'));var auth=require(_0x7ab1('0x5'));var interaction=require(_0x7ab1('0x6'));var config=require(_0x7ab1('0x7'));var controller=require('./dashboardItem.controller');router[_0x7ab1('0x8')](_0x7ab1('0x9'),auth[_0x7ab1('0xa')](),controller[_0x7ab1('0xb')]);router['post']('/',auth[_0x7ab1('0xa')](),controller['create']);router[_0x7ab1('0xc')](_0x7ab1('0x9'),auth[_0x7ab1('0xa')](),controller[_0x7ab1('0xd')]);router[_0x7ab1('0xe')](_0x7ab1('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x7ab1('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index d08fa73..28405a3 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 _0x6a28=['sequelize','first','third','STRING'];(function(_0x6871bc,_0x3c0fe4){var _0x3d88ab=function(_0x513655){while(--_0x513655){_0x6871bc['push'](_0x6871bc['shift']());}};_0x3d88ab(++_0x3c0fe4);}(_0x6a28,0x104));var _0x86a2=function(_0x246aa8,_0x506fed){_0x246aa8=_0x246aa8-0x0;var _0x373057=_0x6a28[_0x246aa8];return _0x373057;};'use strict';var Sequelize=require(_0x86a2('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x86a2('0x1'),'second',_0x86a2('0x2')),'allowNull':![],'defaultValue':_0x86a2('0x1')},'description':{'type':Sequelize[_0x86a2('0x3')]}}; \ No newline at end of file +var _0x7cc3=['sequelize','STRING','ENUM','first'];(function(_0x367d43,_0x52ef40){var _0x290068=function(_0x5b7e5a){while(--_0x5b7e5a){_0x367d43['push'](_0x367d43['shift']());}};_0x290068(++_0x52ef40);}(_0x7cc3,0x170));var _0x37cc=function(_0x26cadd,_0x45637d){_0x26cadd=_0x26cadd-0x0;var _0x1c8f84=_0x7cc3[_0x26cadd];return _0x1c8f84;};'use strict';var Sequelize=require(_0x37cc('0x0'));module['exports']={'name':{'type':Sequelize[_0x37cc('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x37cc('0x2')](_0x37cc('0x3'),'second','third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 618f9e0..ca322d3 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 _0x24dc=['hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','Disposition','includeAll','include','show','filters','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','apply','reject','save','then','get','Dispositions','destroy','error','stack','name','index','map','fieldName','type','key','model','query','intersection','attributes','fields','length'];(function(_0x16d9fc,_0x46017c){var _0x2f4bd7=function(_0x28e7fc){while(--_0x28e7fc){_0x16d9fc['push'](_0x16d9fc['shift']());}};_0x2f4bd7(++_0x46017c);}(_0x24dc,0x65));var _0xc24d=function(_0x2e780b,_0x2de54d){_0x2e780b=_0x2e780b-0x0;var _0x1ee24a=_0x24dc[_0x2e780b];return _0x1ee24a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc24d('0x0'));var jsonpatch=require(_0xc24d('0x1'));var rp=require(_0xc24d('0x2'));var moment=require(_0xc24d('0x3'));var BPromise=require(_0xc24d('0x4'));var Mustache=require(_0xc24d('0x5'));var util=require(_0xc24d('0x6'));var path=require(_0xc24d('0x7'));var sox=require(_0xc24d('0x8'));var csv=require(_0xc24d('0x9'));var ejs=require(_0xc24d('0xa'));var fs=require('fs');var fs_extra=require(_0xc24d('0xb'));var _=require(_0xc24d('0xc'));var squel=require('squel');var crypto=require(_0xc24d('0xd'));var jsforce=require(_0xc24d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc24d('0x9'));var querystring=require('querystring');var Papa=require(_0xc24d('0xf'));var Redis=require(_0xc24d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc24d('0x11'));var as=require(_0xc24d('0x12'));var hardwareService=require(_0xc24d('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xc24d('0x14'));var config=require(_0xc24d('0x15'));var licenseUtil=require(_0xc24d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10447a,_0x1d1ee0){_0x1d1ee0=_0x1d1ee0||0xcc;return function(_0x8f9b29){if(_0x8f9b29){return _0x10447a[_0xc24d('0x17')](_0x1d1ee0);}return _0x10447a[_0xc24d('0x18')](_0x1d1ee0)[_0xc24d('0x19')]();};}function respondWithResult(_0x2675f1,_0x3d6a19){_0x3d6a19=_0x3d6a19||0xc8;return function(_0x1a03b0){if(_0x1a03b0){return _0x2675f1[_0xc24d('0x18')](_0x3d6a19)['json'](_0x1a03b0);}};}function respondWithFilteredResult(_0x6d7594,_0x45608a){return function(_0x11dba2){if(_0x11dba2){var _0x4cd394=typeof _0x45608a[_0xc24d('0x1a')]==='undefined'&&typeof _0x45608a[_0xc24d('0x1b')]==='undefined';var _0x579b4e=_0x11dba2[_0xc24d('0x1c')];var _0x3c7255=_0x4cd394?0x0:_0x45608a['offset'];var _0x4c5fc2=_0x4cd394?_0x11dba2[_0xc24d('0x1c')]:_0x45608a[_0xc24d('0x1a')]+_0x45608a[_0xc24d('0x1b')];var _0x3025e0;if(_0x4c5fc2>=_0x579b4e){_0x4c5fc2=_0x579b4e;_0x3025e0=0xc8;}else{_0x3025e0=0xce;}_0x6d7594[_0xc24d('0x18')](_0x3025e0);return _0x6d7594[_0xc24d('0x1d')]('Content-Range',_0x3c7255+'-'+_0x4c5fc2+'/'+_0x579b4e)['json'](_0x11dba2);}return null;};}function patchUpdates(_0x25ae13){return function(_0x5c2c83){try{jsonpatch[_0xc24d('0x1e')](_0x5c2c83,_0x25ae13,!![]);}catch(_0xfa63f){return BPromise[_0xc24d('0x1f')](_0xfa63f);}return _0x5c2c83[_0xc24d('0x20')]();};}function saveUpdates(_0x150de6,_0x2ae2d0){return function(_0x38c47f){if(_0x38c47f){return _0x38c47f['update'](_0x150de6)[_0xc24d('0x21')](function(_0x35db6a){return _0x35db6a;});}return null;};}function removeEntity(_0x3cfdca,_0x43d6c9){return function(_0x4569d7){if(_0x4569d7){return _0x4569d7['destroy']()[_0xc24d('0x21')](function(){var _0x1be84b=_0x4569d7[_0xc24d('0x22')]({'plain':!![]});var _0x3d74e7=_0xc24d('0x23');return db['UserProfileResource'][_0xc24d('0x24')]({'where':{'type':_0x3d74e7,'resourceId':_0x1be84b['id']}})[_0xc24d('0x21')](function(){return _0x4569d7;});})[_0xc24d('0x21')](function(){_0x3cfdca[_0xc24d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa9c275,_0x2366ce){return function(_0xe2bde3){if(!_0xe2bde3){_0xa9c275[_0xc24d('0x17')](0x194);}return _0xe2bde3;};}function handleError(_0x4c31ee,_0x1212fd){_0x1212fd=_0x1212fd||0x1f4;return function(_0x48d87f){logger[_0xc24d('0x25')](_0x48d87f[_0xc24d('0x26')]);if(_0x48d87f[_0xc24d('0x27')]){delete _0x48d87f[_0xc24d('0x27')];}_0x4c31ee[_0xc24d('0x18')](_0x1212fd)['send'](_0x48d87f);};}exports[_0xc24d('0x28')]=function(_0x46cbc6,_0x334417){var _0x28789d={},_0x170bac={},_0x3cb646={'count':0x0,'rows':[]};var _0x402ed3=_[_0xc24d('0x29')](db['Disposition']['rawAttributes'],function(_0x2fc92e){return{'name':_0x2fc92e[_0xc24d('0x2a')],'type':_0x2fc92e[_0xc24d('0x2b')][_0xc24d('0x2c')]};});_0x170bac[_0xc24d('0x2d')]=_[_0xc24d('0x29')](_0x402ed3,_0xc24d('0x27'));_0x170bac[_0xc24d('0x2e')]=_['keys'](_0x46cbc6[_0xc24d('0x2e')]);_0x170bac['filters']=_[_0xc24d('0x2f')](_0x170bac[_0xc24d('0x2d')],_0x170bac[_0xc24d('0x2e')]);_0x28789d[_0xc24d('0x30')]=_[_0xc24d('0x2f')](_0x170bac[_0xc24d('0x2d')],qs['fields'](_0x46cbc6[_0xc24d('0x2e')][_0xc24d('0x31')]));_0x28789d[_0xc24d('0x30')]=_0x28789d['attributes'][_0xc24d('0x32')]?_0x28789d[_0xc24d('0x30')]:_0x170bac['model'];if(!_0x46cbc6['query'][_0xc24d('0x33')]('nolimit')){_0x28789d[_0xc24d('0x1b')]=qs[_0xc24d('0x1b')](_0x46cbc6[_0xc24d('0x2e')][_0xc24d('0x1b')]);_0x28789d[_0xc24d('0x1a')]=qs['offset'](_0x46cbc6[_0xc24d('0x2e')][_0xc24d('0x1a')]);}_0x28789d['order']=qs[_0xc24d('0x34')](_0x46cbc6[_0xc24d('0x2e')][_0xc24d('0x34')]);_0x28789d[_0xc24d('0x35')]=qs['filters'](_[_0xc24d('0x36')](_0x46cbc6[_0xc24d('0x2e')],_0x170bac['filters']),_0x402ed3);if(_0x46cbc6[_0xc24d('0x2e')]['filter']){_0x28789d[_0xc24d('0x35')]=_[_0xc24d('0x37')](_0x28789d[_0xc24d('0x35')],{'$or':_[_0xc24d('0x29')](_0x402ed3,function(_0x3ab0ab){if(_0x3ab0ab[_0xc24d('0x2b')]!==_0xc24d('0x38')){var _0x8d5728={};_0x8d5728[_0x3ab0ab[_0xc24d('0x27')]]={'$like':'%'+_0x46cbc6[_0xc24d('0x2e')]['filter']+'%'};return _0x8d5728;}})});}_0x28789d=_[_0xc24d('0x37')]({},_0x28789d,_0x46cbc6[_0xc24d('0x39')]);var _0x3f8daa={'where':_0x28789d[_0xc24d('0x35')]};return db[_0xc24d('0x3a')]['count'](_0x3f8daa)['then'](function(_0x3462f7){_0x3cb646[_0xc24d('0x1c')]=_0x3462f7;if(_0x46cbc6[_0xc24d('0x2e')][_0xc24d('0x3b')]){_0x28789d[_0xc24d('0x3c')]=[{'all':!![]}];}return db[_0xc24d('0x3a')]['findAll'](_0x28789d);})[_0xc24d('0x21')](function(_0x599412){_0x3cb646['rows']=_0x599412;return _0x3cb646;})[_0xc24d('0x21')](respondWithFilteredResult(_0x334417,_0x28789d))['catch'](handleError(_0x334417,null));};exports[_0xc24d('0x3d')]=function(_0x2c62ca,_0x586c94){var _0x57e49b={'raw':!![],'where':{'id':_0x2c62ca['params']['id']}},_0x54208d={};_0x54208d['model']=_['keys'](db[_0xc24d('0x3a')]['rawAttributes']);_0x54208d[_0xc24d('0x2e')]=_['keys'](_0x2c62ca[_0xc24d('0x2e')]);_0x54208d[_0xc24d('0x3e')]=_[_0xc24d('0x2f')](_0x54208d[_0xc24d('0x2d')],_0x54208d[_0xc24d('0x2e')]);_0x57e49b['attributes']=_[_0xc24d('0x2f')](_0x54208d[_0xc24d('0x2d')],qs[_0xc24d('0x31')](_0x2c62ca[_0xc24d('0x2e')][_0xc24d('0x31')]));_0x57e49b['attributes']=_0x57e49b[_0xc24d('0x30')][_0xc24d('0x32')]?_0x57e49b[_0xc24d('0x30')]:_0x54208d[_0xc24d('0x2d')];if(_0x2c62ca[_0xc24d('0x2e')][_0xc24d('0x3b')]){_0x57e49b[_0xc24d('0x3c')]=[{'all':!![]}];}_0x57e49b=_[_0xc24d('0x37')]({},_0x57e49b,_0x2c62ca[_0xc24d('0x39')]);return db[_0xc24d('0x3a')][_0xc24d('0x3f')](_0x57e49b)[_0xc24d('0x21')](handleEntityNotFound(_0x586c94,null))[_0xc24d('0x21')](respondWithResult(_0x586c94,null))['catch'](handleError(_0x586c94,null));};exports['create']=function(_0x583b41,_0x470c60){return db[_0xc24d('0x3a')][_0xc24d('0x40')](_0x583b41['body'],{})[_0xc24d('0x21')](function(_0x7be2f8){var _0x48664c=_0x583b41['user'][_0xc24d('0x22')]({'plain':!![]});if(!_0x48664c)throw new Error(_0xc24d('0x41'));if(_0x48664c[_0xc24d('0x42')]===_0xc24d('0x43')){var _0x1051ea=_0x7be2f8[_0xc24d('0x22')]({'plain':!![]});var _0x388e9e=_0xc24d('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x388e9e,'userProfileId':_0x48664c[_0xc24d('0x44')]},'raw':!![]})[_0xc24d('0x21')](function(_0x5748f4){if(_0x5748f4&&_0x5748f4[_0xc24d('0x45')]===0x0){return db[_0xc24d('0x46')][_0xc24d('0x40')]({'name':_0x1051ea['name'],'resourceId':_0x1051ea['id'],'type':_0x5748f4[_0xc24d('0x27')],'sectionId':_0x5748f4['id']},{})[_0xc24d('0x21')](function(){return _0x7be2f8;});}else{return _0x7be2f8;}})[_0xc24d('0x47')](function(_0x24a189){logger[_0xc24d('0x25')](_0xc24d('0x48'),_0x24a189);throw _0x24a189;});}return _0x7be2f8;})[_0xc24d('0x21')](respondWithResult(_0x470c60,0xc9))[_0xc24d('0x47')](handleError(_0x470c60,null));};exports[_0xc24d('0x49')]=function(_0x3b8ec5,_0x32801a){if(_0x3b8ec5['body']['id']){delete _0x3b8ec5[_0xc24d('0x4a')]['id'];}return db[_0xc24d('0x3a')][_0xc24d('0x3f')]({'where':{'id':_0x3b8ec5['params']['id']}})[_0xc24d('0x21')](handleEntityNotFound(_0x32801a,null))['then'](saveUpdates(_0x3b8ec5[_0xc24d('0x4a')],null))[_0xc24d('0x21')](respondWithResult(_0x32801a,null))['catch'](handleError(_0x32801a,null));};exports[_0xc24d('0x24')]=function(_0x5f228a,_0x3e0822){return db['Disposition'][_0xc24d('0x3f')]({'where':{'id':_0x5f228a[_0xc24d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e0822,null))[_0xc24d('0x21')](removeEntity(_0x3e0822,null))['catch'](handleError(_0x3e0822,null));}; \ No newline at end of file +var _0x42fa=['show','params','includeAll','merge','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','status','set','Content-Range','apply','save','update','then','destroy','get','Dispositions','UserProfileResource','end','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','type','filter','options','count','include','findAll','rows','catch'];(function(_0xe3a7a9,_0x1b061d){var _0x5d6f1=function(_0x514091){while(--_0x514091){_0xe3a7a9['push'](_0xe3a7a9['shift']());}};_0x5d6f1(++_0x1b061d);}(_0x42fa,0x161));var _0xa42f=function(_0x44e088,_0x337135){_0x44e088=_0x44e088-0x0;var _0x57d868=_0x42fa[_0x44e088];return _0x57d868;};'use strict';var emlformat=require(_0xa42f('0x0'));var rimraf=require(_0xa42f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa42f('0x2'));var moment=require(_0xa42f('0x3'));var BPromise=require(_0xa42f('0x4'));var Mustache=require(_0xa42f('0x5'));var util=require(_0xa42f('0x6'));var path=require(_0xa42f('0x7'));var sox=require(_0xa42f('0x8'));var csv=require(_0xa42f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa42f('0xa'));var _=require(_0xa42f('0xb'));var squel=require('squel');var crypto=require(_0xa42f('0xc'));var jsforce=require(_0xa42f('0xd'));var deskjs=require(_0xa42f('0xe'));var toCsv=require(_0xa42f('0x9'));var querystring=require(_0xa42f('0xf'));var Papa=require(_0xa42f('0x10'));var Redis=require(_0xa42f('0x11'));var authService=require(_0xa42f('0x12'));var qs=require(_0xa42f('0x13'));var as=require(_0xa42f('0x14'));var hardwareService=require(_0xa42f('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa42f('0x16'));var config=require(_0xa42f('0x17'));var licenseUtil=require(_0xa42f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9cb4,_0x362b83){_0x362b83=_0x362b83||0xcc;return function(_0x4eeca9){if(_0x4eeca9){return _0x2c9cb4[_0xa42f('0x19')](_0x362b83);}return _0x2c9cb4['status'](_0x362b83)['end']();};}function respondWithResult(_0x3d87f3,_0x24aa2d){_0x24aa2d=_0x24aa2d||0xc8;return function(_0x18fc89){if(_0x18fc89){return _0x3d87f3['status'](_0x24aa2d)[_0xa42f('0x1a')](_0x18fc89);}};}function respondWithFilteredResult(_0x5f0d0e,_0x36c5d2){return function(_0x516dc3){if(_0x516dc3){var _0x2e90a5=typeof _0x36c5d2[_0xa42f('0x1b')]===_0xa42f('0x1c')&&typeof _0x36c5d2[_0xa42f('0x1d')]===_0xa42f('0x1c');var _0xae1bbf=_0x516dc3['count'];var _0x289efd=_0x2e90a5?0x0:_0x36c5d2[_0xa42f('0x1b')];var _0xc8a25a=_0x2e90a5?_0x516dc3['count']:_0x36c5d2[_0xa42f('0x1b')]+_0x36c5d2[_0xa42f('0x1d')];var _0x5b7b89;if(_0xc8a25a>=_0xae1bbf){_0xc8a25a=_0xae1bbf;_0x5b7b89=0xc8;}else{_0x5b7b89=0xce;}_0x5f0d0e[_0xa42f('0x1e')](_0x5b7b89);return _0x5f0d0e[_0xa42f('0x1f')](_0xa42f('0x20'),_0x289efd+'-'+_0xc8a25a+'/'+_0xae1bbf)[_0xa42f('0x1a')](_0x516dc3);}return null;};}function patchUpdates(_0x28f9cb){return function(_0x201328){try{jsonpatch[_0xa42f('0x21')](_0x201328,_0x28f9cb,!![]);}catch(_0x35cb1f){return BPromise['reject'](_0x35cb1f);}return _0x201328[_0xa42f('0x22')]();};}function saveUpdates(_0x42ff90,_0xcb7618){return function(_0x62fa4){if(_0x62fa4){return _0x62fa4[_0xa42f('0x23')](_0x42ff90)[_0xa42f('0x24')](function(_0x4726b9){return _0x4726b9;});}return null;};}function removeEntity(_0x9ef47c,_0x3e522d){return function(_0x9cc1cb){if(_0x9cc1cb){return _0x9cc1cb[_0xa42f('0x25')]()[_0xa42f('0x24')](function(){var _0x280f4c=_0x9cc1cb[_0xa42f('0x26')]({'plain':!![]});var _0x7c2d86=_0xa42f('0x27');return db[_0xa42f('0x28')][_0xa42f('0x25')]({'where':{'type':_0x7c2d86,'resourceId':_0x280f4c['id']}})[_0xa42f('0x24')](function(){return _0x9cc1cb;});})[_0xa42f('0x24')](function(){_0x9ef47c[_0xa42f('0x1e')](0xcc)[_0xa42f('0x29')]();});}};}function handleEntityNotFound(_0x1c03fa,_0x1007b7){return function(_0xd348e0){if(!_0xd348e0){_0x1c03fa['sendStatus'](0x194);}return _0xd348e0;};}function handleError(_0x18286f,_0x84069){_0x84069=_0x84069||0x1f4;return function(_0x1d2241){logger[_0xa42f('0x2a')](_0x1d2241[_0xa42f('0x2b')]);if(_0x1d2241[_0xa42f('0x2c')]){delete _0x1d2241[_0xa42f('0x2c')];}_0x18286f[_0xa42f('0x1e')](_0x84069)[_0xa42f('0x2d')](_0x1d2241);};}exports[_0xa42f('0x2e')]=function(_0xae7e64,_0x5b8577){var _0x46428e={},_0x529def={},_0xe509ac={'count':0x0,'rows':[]};var _0x5536cc=_[_0xa42f('0x2f')](db[_0xa42f('0x30')][_0xa42f('0x31')],function(_0x3efde9){return{'name':_0x3efde9[_0xa42f('0x32')],'type':_0x3efde9['type'][_0xa42f('0x33')]};});_0x529def[_0xa42f('0x34')]=_[_0xa42f('0x2f')](_0x5536cc,'name');_0x529def[_0xa42f('0x35')]=_[_0xa42f('0x36')](_0xae7e64[_0xa42f('0x35')]);_0x529def[_0xa42f('0x37')]=_['intersection'](_0x529def['model'],_0x529def[_0xa42f('0x35')]);_0x46428e[_0xa42f('0x38')]=_[_0xa42f('0x39')](_0x529def[_0xa42f('0x34')],qs[_0xa42f('0x3a')](_0xae7e64[_0xa42f('0x35')]['fields']));_0x46428e[_0xa42f('0x38')]=_0x46428e[_0xa42f('0x38')][_0xa42f('0x3b')]?_0x46428e[_0xa42f('0x38')]:_0x529def[_0xa42f('0x34')];if(!_0xae7e64[_0xa42f('0x35')][_0xa42f('0x3c')](_0xa42f('0x3d'))){_0x46428e['limit']=qs[_0xa42f('0x1d')](_0xae7e64[_0xa42f('0x35')][_0xa42f('0x1d')]);_0x46428e[_0xa42f('0x1b')]=qs['offset'](_0xae7e64[_0xa42f('0x35')][_0xa42f('0x1b')]);}_0x46428e['order']=qs[_0xa42f('0x3e')](_0xae7e64['query'][_0xa42f('0x3e')]);_0x46428e[_0xa42f('0x3f')]=qs['filters'](_['pick'](_0xae7e64['query'],_0x529def[_0xa42f('0x37')]),_0x5536cc);if(_0xae7e64[_0xa42f('0x35')]['filter']){_0x46428e[_0xa42f('0x3f')]=_['merge'](_0x46428e[_0xa42f('0x3f')],{'$or':_[_0xa42f('0x2f')](_0x5536cc,function(_0x4b4635){if(_0x4b4635[_0xa42f('0x40')]!=='VIRTUAL'){var _0x90cc3d={};_0x90cc3d[_0x4b4635[_0xa42f('0x2c')]]={'$like':'%'+_0xae7e64['query'][_0xa42f('0x41')]+'%'};return _0x90cc3d;}})});}_0x46428e=_['merge']({},_0x46428e,_0xae7e64[_0xa42f('0x42')]);var _0x7f6e63={'where':_0x46428e[_0xa42f('0x3f')]};return db[_0xa42f('0x30')][_0xa42f('0x43')](_0x7f6e63)['then'](function(_0x16be95){_0xe509ac[_0xa42f('0x43')]=_0x16be95;if(_0xae7e64['query']['includeAll']){_0x46428e[_0xa42f('0x44')]=[{'all':!![]}];}return db[_0xa42f('0x30')][_0xa42f('0x45')](_0x46428e);})[_0xa42f('0x24')](function(_0x3bf358){_0xe509ac[_0xa42f('0x46')]=_0x3bf358;return _0xe509ac;})[_0xa42f('0x24')](respondWithFilteredResult(_0x5b8577,_0x46428e))[_0xa42f('0x47')](handleError(_0x5b8577,null));};exports[_0xa42f('0x48')]=function(_0x381422,_0x46ad2b){var _0x463283={'raw':!![],'where':{'id':_0x381422[_0xa42f('0x49')]['id']}},_0xdabb50={};_0xdabb50['model']=_[_0xa42f('0x36')](db['Disposition']['rawAttributes']);_0xdabb50[_0xa42f('0x35')]=_['keys'](_0x381422[_0xa42f('0x35')]);_0xdabb50['filters']=_['intersection'](_0xdabb50['model'],_0xdabb50[_0xa42f('0x35')]);_0x463283[_0xa42f('0x38')]=_['intersection'](_0xdabb50[_0xa42f('0x34')],qs[_0xa42f('0x3a')](_0x381422[_0xa42f('0x35')]['fields']));_0x463283['attributes']=_0x463283[_0xa42f('0x38')][_0xa42f('0x3b')]?_0x463283[_0xa42f('0x38')]:_0xdabb50['model'];if(_0x381422['query'][_0xa42f('0x4a')]){_0x463283[_0xa42f('0x44')]=[{'all':!![]}];}_0x463283=_[_0xa42f('0x4b')]({},_0x463283,_0x381422[_0xa42f('0x42')]);return db['Disposition']['find'](_0x463283)[_0xa42f('0x24')](handleEntityNotFound(_0x46ad2b,null))['then'](respondWithResult(_0x46ad2b,null))[_0xa42f('0x47')](handleError(_0x46ad2b,null));};exports[_0xa42f('0x4c')]=function(_0x27dcbd,_0x2362dc){return db['Disposition']['create'](_0x27dcbd[_0xa42f('0x4d')],{})[_0xa42f('0x24')](function(_0x1a973a){var _0x33d85e=_0x27dcbd['user'][_0xa42f('0x26')]({'plain':!![]});if(!_0x33d85e)throw new Error(_0xa42f('0x4e'));if(_0x33d85e[_0xa42f('0x4f')]===_0xa42f('0x50')){var _0x24fe0b=_0x1a973a['get']({'plain':!![]});var _0x3e8731=_0xa42f('0x27');return db[_0xa42f('0x51')][_0xa42f('0x52')]({'where':{'name':_0x3e8731,'userProfileId':_0x33d85e[_0xa42f('0x53')]},'raw':!![]})[_0xa42f('0x24')](function(_0x2dbddb){if(_0x2dbddb&&_0x2dbddb[_0xa42f('0x54')]===0x0){return db[_0xa42f('0x28')]['create']({'name':_0x24fe0b[_0xa42f('0x2c')],'resourceId':_0x24fe0b['id'],'type':_0x2dbddb[_0xa42f('0x2c')],'sectionId':_0x2dbddb['id']},{})['then'](function(){return _0x1a973a;});}else{return _0x1a973a;}})['catch'](function(_0x10c371){logger[_0xa42f('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10c371);throw _0x10c371;});}return _0x1a973a;})[_0xa42f('0x24')](respondWithResult(_0x2362dc,0xc9))[_0xa42f('0x47')](handleError(_0x2362dc,null));};exports[_0xa42f('0x23')]=function(_0x36efcd,_0x34c4e4){if(_0x36efcd[_0xa42f('0x4d')]['id']){delete _0x36efcd[_0xa42f('0x4d')]['id'];}return db['Disposition'][_0xa42f('0x52')]({'where':{'id':_0x36efcd[_0xa42f('0x49')]['id']}})[_0xa42f('0x24')](handleEntityNotFound(_0x34c4e4,null))[_0xa42f('0x24')](saveUpdates(_0x36efcd[_0xa42f('0x4d')],null))['then'](respondWithResult(_0x34c4e4,null))['catch'](handleError(_0x34c4e4,null));};exports[_0xa42f('0x25')]=function(_0x238c26,_0x237d50){return db[_0xa42f('0x30')][_0xa42f('0x52')]({'where':{'id':_0x238c26[_0xa42f('0x49')]['id']}})[_0xa42f('0x24')](handleEntityNotFound(_0x237d50,null))[_0xa42f('0x24')](removeEntity(_0x237d50,null))[_0xa42f('0x47')](handleError(_0x237d50,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 49e3128..d556c5b 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 _0x3782=['FaxAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','request-promise','rimraf','./disposition.attributes','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_sms','SmsAccountId'];(function(_0x46dc21,_0x10bf7f){var _0x4cd00d=function(_0x3bce1d){while(--_0x3bce1d){_0x46dc21['push'](_0x46dc21['shift']());}};_0x4cd00d(++_0x10bf7f);}(_0x3782,0x1f0));var _0x2378=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3782[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x2378('0x0'));var logger=require(_0x2378('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2378('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2378('0x3'));var config=require('../../config/environment');var attributes=require(_0x2378('0x4'));module['exports']=function(_0x5584c6,_0x42772b){return _0x5584c6['define'](_0x2378('0x5'),attributes,{'tableName':_0x2378('0x6'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x2378('0x7'),'fields':[_0x2378('0x8'),_0x2378('0x9')]},{'unique':!![],'name':_0x2378('0xa'),'fields':[_0x2378('0x8'),_0x2378('0xb')]},{'unique':!![],'name':'name_mail','fields':['name','MailAccountId']},{'unique':!![],'name':_0x2378('0xc'),'fields':[_0x2378('0x8'),_0x2378('0xd')]},{'unique':!![],'name':'name_fax','fields':[_0x2378('0x8'),_0x2378('0xe')]},{'unique':!![],'name':'name_openchannel','fields':['name','OpenchannelAccountId']},{'unique':!![],'name':_0x2378('0xf'),'fields':['name',_0x2378('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x680f=['OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define','name_voice','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','FaxAccountId','name_openchannel'];(function(_0x42fcbe,_0x6b7373){var _0xc828ef=function(_0x3858e7){while(--_0x3858e7){_0x42fcbe['push'](_0x42fcbe['shift']());}};_0xc828ef(++_0x6b7373);}(_0x680f,0x183));var _0xf680=function(_0x35f01b,_0x1205c0){_0x35f01b=_0x35f01b-0x0;var _0x51785d=_0x680f[_0x35f01b];return _0x51785d;};'use strict';var _=require(_0xf680('0x0'));var util=require(_0xf680('0x1'));var logger=require(_0xf680('0x2'))(_0xf680('0x3'));var moment=require(_0xf680('0x4'));var BPromise=require(_0xf680('0x5'));var rp=require(_0xf680('0x6'));var fs=require('fs');var path=require(_0xf680('0x7'));var rimraf=require('rimraf');var config=require(_0xf680('0x8'));var attributes=require(_0xf680('0x9'));module[_0xf680('0xa')]=function(_0x5f66d9,_0x13adce){return _0x5f66d9[_0xf680('0xb')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xf680('0xc'),'fields':['name',_0xf680('0xd')]},{'unique':!![],'name':_0xf680('0xe'),'fields':[_0xf680('0xf'),_0xf680('0x10')]},{'unique':!![],'name':_0xf680('0x11'),'fields':[_0xf680('0xf'),_0xf680('0x12')]},{'unique':!![],'name':'name_sms','fields':[_0xf680('0xf'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0xf680('0xf'),_0xf680('0x13')]},{'unique':!![],'name':_0xf680('0x14'),'fields':[_0xf680('0xf'),_0xf680('0x15')]},{'unique':!![],'name':_0xf680('0x16'),'fields':[_0xf680('0xf'),_0xf680('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 89491e4..5881a24 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(_0x47c2bc,_0x3fb70a){var _0x192b34=function(_0x3a8b94){while(--_0x3a8b94){_0x47c2bc['push'](_0x47c2bc['shift']());}};_0x192b34(++_0x3fb70a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x41a8de,_0x3176a5){var _0x3eeb0f=function(_0xebef77){while(--_0xebef77){_0x41a8de['push'](_0x41a8de['shift']());}};_0x3eeb0f(++_0x3176a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index c20bb7a..8be77bf 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 _0x4f75=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','index','/:id','isAuthenticated','show'];(function(_0x55a76a,_0x2d0203){var _0x45885a=function(_0x4348d5){while(--_0x4348d5){_0x55a76a['push'](_0x55a76a['shift']());}};_0x45885a(++_0x2d0203);}(_0x4f75,0x1aa));var _0x54f7=function(_0x1b51fb,_0x3ce8b3){_0x1b51fb=_0x1b51fb-0x0;var _0x655c04=_0x4f75[_0x1b51fb];return _0x655c04;};'use strict';var multer=require(_0x54f7('0x0'));var util=require(_0x54f7('0x1'));var path=require(_0x54f7('0x2'));var timeout=require(_0x54f7('0x3'));var express=require(_0x54f7('0x4'));var router=express['Router']();var fs_extra=require(_0x54f7('0x5'));var auth=require(_0x54f7('0x6'));var interaction=require(_0x54f7('0x7'));var config=require('../../config/environment');var controller=require(_0x54f7('0x8'));router[_0x54f7('0x9')]('/',auth['isAuthenticated'](),controller[_0x54f7('0xa')]);router[_0x54f7('0x9')](_0x54f7('0xb'),auth[_0x54f7('0xc')](),controller[_0x54f7('0xd')]);router[_0x54f7('0xe')]('/',auth['isAuthenticated'](),controller[_0x54f7('0xf')]);router[_0x54f7('0x10')](_0x54f7('0xb'),auth[_0x54f7('0xc')](),controller[_0x54f7('0x11')]);router['delete'](_0x54f7('0xb'),auth[_0x54f7('0xc')](),controller[_0x54f7('0x12')]);module[_0x54f7('0x13')]=router; \ No newline at end of file +var _0x914c=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','get','/:id','show','post','create','update','delete','multer'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0x914c,0x97));var _0xc914=function(_0x1c2f29,_0x5a2668){_0x1c2f29=_0x1c2f29-0x0;var _0x258465=_0x914c[_0x1c2f29];return _0x258465;};'use strict';var multer=require(_0xc914('0x0'));var util=require(_0xc914('0x1'));var path=require(_0xc914('0x2'));var timeout=require(_0xc914('0x3'));var express=require(_0xc914('0x4'));var router=express[_0xc914('0x5')]();var fs_extra=require(_0xc914('0x6'));var auth=require(_0xc914('0x7'));var interaction=require(_0xc914('0x8'));var config=require(_0xc914('0x9'));var controller=require(_0xc914('0xa'));router['get']('/',auth[_0xc914('0xb')](),controller['index']);router[_0xc914('0xc')](_0xc914('0xd'),auth[_0xc914('0xb')](),controller[_0xc914('0xe')]);router[_0xc914('0xf')]('/',auth[_0xc914('0xb')](),controller[_0xc914('0x10')]);router['put'](_0xc914('0xd'),auth[_0xc914('0xb')](),controller[_0xc914('0x11')]);router[_0xc914('0x12')]('/:id',auth[_0xc914('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 127d475..e847c53 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 _0x7db9=['STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200','9600','12000','14400','v17,v27,v29','SIP','IAX','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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x389e8d,_0xe35789){var _0xc547df=function(_0x5a6126){while(--_0x5a6126){_0x389e8d['push'](_0x389e8d['shift']());}};_0xc547df(++_0xe35789);}(_0x7db9,0x7c));var _0x97db=function(_0xc8c4b9,_0x188fd2){_0xc8c4b9=_0xc8c4b9-0x0;var _0x2c3709=_0x7db9[_0xc8c4b9];return _0x2c3709;};'use strict';var Sequelize=require(_0x97db('0x0'));module['exports']={'name':{'type':Sequelize[_0x97db('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x97db('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x97db('0x2'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x97db('0x1')],'defaultValue':_0x97db('0x3')},'localstationid':{'type':Sequelize[_0x97db('0x1')],'unique':_0x97db('0x4')},'minrate':{'type':Sequelize[_0x97db('0x5')](_0x97db('0x6'),_0x97db('0x7'),_0x97db('0x8'),_0x97db('0x9'),_0x97db('0xa'),_0x97db('0xb')),'defaultValue':_0x97db('0x7')},'maxrate':{'type':Sequelize[_0x97db('0x5')](_0x97db('0x6'),_0x97db('0x7'),_0x97db('0x8'),_0x97db('0x9'),_0x97db('0xa'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x97db('0x1')],'defaultValue':_0x97db('0xc')},'gateway':{'type':Sequelize[_0x97db('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x97db('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x97db('0xd'),_0x97db('0xe'),_0x97db('0xf'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x97db('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x97db('0x10')],'defaultValue':function(){return _0x97db('0x11');}},'notificationSound':{'type':Sequelize[_0x97db('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x97db('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x97db('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x97db('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x97db('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x97db('0x13')],'allowNull':!![],'defaultValue':null,'comment':_0x97db('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x97db('0x12')],'defaultValue':![],'comment':_0x97db('0x15'),'set':function(_0xc87576){if(!_0xc87576)this[_0x97db('0x16')](_0x97db('0x17'),null);this[_0x97db('0x16')](_0x97db('0x18'),_0xc87576);}}}; \ No newline at end of file +var _0xc03e=['localstationid','ENUM','2400','4800','7200','9600','12000','14400','v17,v27,v29','SIP','IAX','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','yes'];(function(_0x1a5eef,_0x3fd614){var _0x30a794=function(_0x2bda0a){while(--_0x2bda0a){_0x1a5eef['push'](_0x1a5eef['shift']());}};_0x30a794(++_0x3fd614);}(_0xc03e,0x9d));var _0xec03=function(_0x5bf18d,_0x264c55){_0x5bf18d=_0x5bf18d-0x0;var _0x1d6cc0=_0xc03e[_0x5bf18d];return _0x1d6cc0;};'use strict';var Sequelize=require(_0xec03('0x0'));module[_0xec03('0x1')]={'name':{'type':Sequelize[_0xec03('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xec03('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0xec03('0x3'),'no'),'defaultValue':_0xec03('0x3')},'headerinfo':{'type':Sequelize[_0xec03('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xec03('0x2')],'unique':_0xec03('0x4')},'minrate':{'type':Sequelize[_0xec03('0x5')](_0xec03('0x6'),_0xec03('0x7'),_0xec03('0x8'),_0xec03('0x9'),_0xec03('0xa'),_0xec03('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xec03('0x5')](_0xec03('0x6'),_0xec03('0x7'),'7200',_0xec03('0x9'),'12000','14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xec03('0x2')],'defaultValue':_0xec03('0xc')},'gateway':{'type':Sequelize[_0xec03('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xec03('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xec03('0x5')](_0xec03('0xd'),_0xec03('0xe'),'DADHI','KHOMP'),'defaultValue':_0xec03('0xd')},'key':{'type':Sequelize[_0xec03('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xec03('0xf')],'defaultValue':function(){return _0xec03('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xec03('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xec03('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xec03('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xec03('0x11')],'allowNull':!![],'defaultValue':null,'comment':_0xec03('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xec03('0x14'),'set':function(_0x4b6b09){if(!_0x4b6b09)this[_0xec03('0x15')](_0xec03('0x16'),null);this[_0xec03('0x15')]('mandatoryDisposition',_0x4b6b09);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index a3398df..e48fff8 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 _0x6656=['Contact','User','Owner','fullname','color','tag','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','exten','localstationid','app','type','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','headerinfo','minrate','modem','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','VoiceExtension','tech','createdAt','updatedAt','ListId','findById','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','List','DESC','attachments','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Send\x20Fax\x20failed','out','spread','filename','ContactId','dataValues','Messages','SendFax','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','FaxAccounts','UserProfileResource','destroy','stack','name','send','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','key','map','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact'];(function(_0x4f10b2,_0x46d5e5){var _0x46cbf1=function(_0x3da799){while(--_0x3da799){_0x4f10b2['push'](_0x4f10b2['shift']());}};_0x46cbf1(++_0x46d5e5);}(_0x6656,0x1c7));var _0x6665=function(_0x189a72,_0x4ac342){_0x189a72=_0x189a72-0x0;var _0x2b457a=_0x6656[_0x189a72];return _0x2b457a;};'use strict';var emlformat=require(_0x6665('0x0'));var rimraf=require(_0x6665('0x1'));var zipdir=require(_0x6665('0x2'));var jsonpatch=require(_0x6665('0x3'));var rp=require(_0x6665('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6665('0x5'));var util=require(_0x6665('0x6'));var path=require(_0x6665('0x7'));var sox=require(_0x6665('0x8'));var csv=require(_0x6665('0x9'));var ejs=require(_0x6665('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6665('0xb'));var squel=require(_0x6665('0xc'));var crypto=require('crypto');var jsforce=require(_0x6665('0xd'));var deskjs=require(_0x6665('0xe'));var toCsv=require(_0x6665('0x9'));var querystring=require(_0x6665('0xf'));var Papa=require(_0x6665('0x10'));var Redis=require(_0x6665('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6665('0x12'));var hardwareService=require(_0x6665('0x13'));var logger=require(_0x6665('0x14'))(_0x6665('0x15'));var utils=require(_0x6665('0x16'));var config=require(_0x6665('0x17'));var licenseUtil=require(_0x6665('0x18'));var db=require(_0x6665('0x19'))['db'];config[_0x6665('0x1a')]=_[_0x6665('0x1b')](config[_0x6665('0x1a')],{'host':_0x6665('0x1c'),'port':0x18eb});var socket=require(_0x6665('0x1d'))(new Redis(config[_0x6665('0x1a')]));require('./faxAccount.socket')[_0x6665('0x1e')](socket);var jayson=require(_0x6665('0x1f'));var client=jayson[_0x6665('0x20')][_0x6665('0x21')]({'port':0x232c});var client9002=jayson[_0x6665('0x20')][_0x6665('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2a5339,_0x4f8d79,_0x43021d,_0x3a0477){return new BPromise(function(_0x4744ca,_0x21d2b9){var _0x312319=_0x3a0477||client;return _0x312319[_0x6665('0x22')](_0x2a5339,_0x43021d)['then'](function(_0x5e74c2){logger[_0x6665('0x23')](_0x6665('0x24'),_0x4f8d79,_0x6665('0x25'));logger['debug'](_0x6665('0x26'),_0x4f8d79,_0x6665('0x25'),JSON[_0x6665('0x27')](_0x5e74c2));if(_0x5e74c2['error']){if(_0x5e74c2[_0x6665('0x28')][_0x6665('0x29')]===0x1f4){logger[_0x6665('0x28')](_0x6665('0x24'),_0x4f8d79,_0x5e74c2[_0x6665('0x28')]['message']);return _0x21d2b9(_0x5e74c2[_0x6665('0x28')]['message']);}logger[_0x6665('0x28')](_0x6665('0x24'),_0x4f8d79,_0x5e74c2[_0x6665('0x28')][_0x6665('0x2a')]);return _0x4744ca(_0x5e74c2[_0x6665('0x28')]['message']);}else{logger['info'](_0x6665('0x24'),_0x4f8d79,_0x6665('0x25'));_0x4744ca(_0x5e74c2[_0x6665('0x2b')][_0x6665('0x2a')]);}})[_0x6665('0x2c')](function(_0x20be6b){logger[_0x6665('0x28')]('FaxAccount,\x20%s,\x20%s',_0x4f8d79,_0x20be6b);_0x21d2b9(_0x20be6b);});});}function respondWithStatusCode(_0x357a1d,_0x53f5f5){_0x53f5f5=_0x53f5f5||0xcc;return function(_0x512acf){if(_0x512acf){return _0x357a1d[_0x6665('0x2d')](_0x53f5f5);}return _0x357a1d[_0x6665('0x2e')](_0x53f5f5)[_0x6665('0x2f')]();};}function respondWithResult(_0x4ad0df,_0x25a32f){_0x25a32f=_0x25a32f||0xc8;return function(_0x37ae46){if(_0x37ae46){return _0x4ad0df['status'](_0x25a32f)[_0x6665('0x30')](_0x37ae46);}};}function respondWithFilteredResult(_0x38c808,_0x883fb4){return function(_0x5641b4){if(_0x5641b4){var _0x246a72=typeof _0x883fb4[_0x6665('0x31')]===_0x6665('0x32')&&typeof _0x883fb4[_0x6665('0x33')]===_0x6665('0x32');var _0x2944a1=_0x5641b4[_0x6665('0x34')];var _0x3be01c=_0x246a72?0x0:_0x883fb4['offset'];var _0x47c941=_0x246a72?_0x5641b4[_0x6665('0x34')]:_0x883fb4[_0x6665('0x31')]+_0x883fb4[_0x6665('0x33')];var _0x3896d1;if(_0x47c941>=_0x2944a1){_0x47c941=_0x2944a1;_0x3896d1=0xc8;}else{_0x3896d1=0xce;}_0x38c808[_0x6665('0x2e')](_0x3896d1);return _0x38c808[_0x6665('0x35')](_0x6665('0x36'),_0x3be01c+'-'+_0x47c941+'/'+_0x2944a1)['json'](_0x5641b4);}return null;};}function patchUpdates(_0x42f3a6){return function(_0x1526a0){try{jsonpatch[_0x6665('0x37')](_0x1526a0,_0x42f3a6,!![]);}catch(_0x412e2c){return BPromise[_0x6665('0x38')](_0x412e2c);}return _0x1526a0['save']();};}function saveUpdates(_0x102d23,_0x1dd96c){return function(_0x2fad9e){if(_0x2fad9e){return _0x2fad9e[_0x6665('0x39')](_0x102d23)['then'](function(_0xe7e736){return _0xe7e736;});}return null;};}function removeEntity(_0x3cff1c,_0xf6f698){return function(_0x546e14){if(_0x546e14){return _0x546e14['destroy']()[_0x6665('0x3a')](function(){var _0x1372af=_0x546e14[_0x6665('0x3b')]({'plain':!![]});var _0x1ec87d=_0x6665('0x3c');return db[_0x6665('0x3d')][_0x6665('0x3e')]({'where':{'type':_0x1ec87d,'resourceId':_0x1372af['id']}})['then'](function(){return _0x546e14;});})[_0x6665('0x3a')](function(){_0x3cff1c[_0x6665('0x2e')](0xcc)[_0x6665('0x2f')]();});}};}function handleEntityNotFound(_0x12a2fd,_0xf6fd4d){return function(_0xe73540){if(!_0xe73540){_0x12a2fd[_0x6665('0x2d')](0x194);}return _0xe73540;};}function handleError(_0x2164b4,_0xf9798e){_0xf9798e=_0xf9798e||0x1f4;return function(_0x55cd52){logger[_0x6665('0x28')](_0x55cd52[_0x6665('0x3f')]);if(_0x55cd52['name']){delete _0x55cd52[_0x6665('0x40')];}_0x2164b4[_0x6665('0x2e')](_0xf9798e)[_0x6665('0x41')](_0x55cd52);};}exports['index']=function(_0x208ee5,_0x4d6186){var _0x5b7972={'include':[{'model':db[_0x6665('0x42')],'as':_0x6665('0x43')}]},_0x504d86={},_0x12e46d={'count':0x0,'rows':[]};var _0x349d7e=_['map'](db[_0x6665('0x44')][_0x6665('0x45')],function(_0xf7ddcb){return{'name':_0xf7ddcb[_0x6665('0x46')],'type':_0xf7ddcb['type'][_0x6665('0x47')]};});_0x504d86['model']=_[_0x6665('0x48')](_0x349d7e,_0x6665('0x40'));_0x504d86[_0x6665('0x49')]=_[_0x6665('0x4a')](_0x208ee5[_0x6665('0x49')]);_0x504d86[_0x6665('0x4b')]=_['intersection'](_0x504d86[_0x6665('0x4c')],_0x504d86['query']);_0x5b7972[_0x6665('0x4d')]=_['intersection'](_0x504d86[_0x6665('0x4c')],qs[_0x6665('0x4e')](_0x208ee5[_0x6665('0x49')][_0x6665('0x4e')]));_0x5b7972['attributes']=_0x5b7972['attributes'][_0x6665('0x4f')]?_0x5b7972[_0x6665('0x4d')]:_0x504d86[_0x6665('0x4c')];if(!_0x208ee5['query'][_0x6665('0x50')](_0x6665('0x51'))){_0x5b7972[_0x6665('0x33')]=qs['limit'](_0x208ee5['query']['limit']);_0x5b7972['offset']=qs['offset'](_0x208ee5['query']['offset']);}_0x5b7972[_0x6665('0x52')]=qs[_0x6665('0x53')](_0x208ee5[_0x6665('0x49')][_0x6665('0x53')]);_0x5b7972[_0x6665('0x54')]=qs['filters'](_[_0x6665('0x55')](_0x208ee5[_0x6665('0x49')],_0x504d86[_0x6665('0x4b')]),_0x349d7e);if(_0x208ee5[_0x6665('0x49')][_0x6665('0x56')]){_0x5b7972[_0x6665('0x54')]=_[_0x6665('0x57')](_0x5b7972[_0x6665('0x54')],{'$or':_['map'](_0x349d7e,function(_0x4621f1){if(_0x4621f1['type']!==_0x6665('0x58')){var _0xbadd4d={};_0xbadd4d[_0x4621f1[_0x6665('0x40')]]={'$like':'%'+_0x208ee5[_0x6665('0x49')][_0x6665('0x56')]+'%'};return _0xbadd4d;}})});}_0x5b7972=_[_0x6665('0x57')]({},_0x5b7972,_0x208ee5[_0x6665('0x59')]);var _0x389e7c={'where':_0x5b7972[_0x6665('0x54')]};return db[_0x6665('0x44')][_0x6665('0x34')](_0x389e7c)[_0x6665('0x3a')](function(_0x163d27){_0x12e46d['count']=_0x163d27;if(_0x208ee5[_0x6665('0x49')][_0x6665('0x5a')]){_0x5b7972[_0x6665('0x5b')]=[{'all':!![]}];}return db[_0x6665('0x44')]['findAll'](_0x5b7972);})[_0x6665('0x3a')](function(_0x53297f){_0x12e46d[_0x6665('0x5c')]=_0x53297f;return _0x12e46d;})[_0x6665('0x3a')](respondWithFilteredResult(_0x4d6186,_0x5b7972))[_0x6665('0x2c')](handleError(_0x4d6186,null));};exports[_0x6665('0x5d')]=function(_0x10d9ec,_0x258396){var _0x4126c1={'raw':![],'where':{'id':_0x10d9ec[_0x6665('0x5e')]['id']},'include':[{'model':db[_0x6665('0x42')],'as':_0x6665('0x43')}]},_0x3c724e={};_0x3c724e[_0x6665('0x4c')]=_[_0x6665('0x4a')](db[_0x6665('0x44')]['rawAttributes']);_0x3c724e['query']=_[_0x6665('0x4a')](_0x10d9ec['query']);_0x3c724e[_0x6665('0x4b')]=_['intersection'](_0x3c724e[_0x6665('0x4c')],_0x3c724e[_0x6665('0x49')]);_0x4126c1[_0x6665('0x4d')]=_[_0x6665('0x5f')](_0x3c724e['model'],qs[_0x6665('0x4e')](_0x10d9ec[_0x6665('0x49')]['fields']));_0x4126c1[_0x6665('0x4d')]=_0x4126c1[_0x6665('0x4d')][_0x6665('0x4f')]?_0x4126c1[_0x6665('0x4d')]:_0x3c724e[_0x6665('0x4c')];if(_0x10d9ec[_0x6665('0x49')][_0x6665('0x5a')]){_0x4126c1[_0x6665('0x5b')]=[{'all':!![]}];}_0x4126c1=_[_0x6665('0x57')]({},_0x4126c1,_0x10d9ec[_0x6665('0x59')]);return db[_0x6665('0x44')][_0x6665('0x60')](_0x4126c1)[_0x6665('0x3a')](handleEntityNotFound(_0x258396,null))['then'](respondWithResult(_0x258396,null))['catch'](handleError(_0x258396,null));};exports[_0x6665('0x61')]=function(_0x56c564,_0x11b5d0){return db[_0x6665('0x44')][_0x6665('0x61')](_0x56c564[_0x6665('0x62')],{})[_0x6665('0x3a')](function(_0x4204b7){var _0x1d7532=_0x56c564[_0x6665('0x63')][_0x6665('0x3b')]({'plain':!![]});if(!_0x1d7532)throw new Error(_0x6665('0x64'));if(_0x1d7532[_0x6665('0x65')]==='user'){var _0x178ce0=_0x4204b7[_0x6665('0x3b')]({'plain':!![]});var _0x1fc1d1='FaxAccounts';return db['UserProfileSection'][_0x6665('0x60')]({'where':{'name':_0x1fc1d1,'userProfileId':_0x1d7532[_0x6665('0x66')]},'raw':!![]})[_0x6665('0x3a')](function(_0x5cda4f){if(_0x5cda4f&&_0x5cda4f['autoAssociation']===0x0){return db[_0x6665('0x3d')][_0x6665('0x61')]({'name':_0x178ce0[_0x6665('0x40')],'resourceId':_0x178ce0['id'],'type':_0x5cda4f[_0x6665('0x40')],'sectionId':_0x5cda4f['id']},{})[_0x6665('0x3a')](function(){return _0x4204b7;});}else{return _0x4204b7;}})[_0x6665('0x2c')](function(_0x281ae4){logger[_0x6665('0x28')](_0x6665('0x67'),_0x281ae4);throw _0x281ae4;});}return _0x4204b7;})[_0x6665('0x3a')](respondWithResult(_0x11b5d0,0xc9))[_0x6665('0x2c')](handleError(_0x11b5d0,null));};exports[_0x6665('0x39')]=function(_0x2a7512,_0x28c1f0){if(_0x2a7512['body']['id']){delete _0x2a7512[_0x6665('0x62')]['id'];}return db['FaxAccount'][_0x6665('0x60')]({'where':{'id':_0x2a7512['params']['id']},'include':[{'model':db[_0x6665('0x42')],'as':_0x6665('0x43')}]})[_0x6665('0x3a')](handleEntityNotFound(_0x28c1f0,null))['then'](saveUpdates(_0x2a7512['body'],null))[_0x6665('0x3a')](respondWithResult(_0x28c1f0,null))[_0x6665('0x2c')](handleError(_0x28c1f0,null));};exports['destroy']=function(_0x14139b,_0x19fb37){return db[_0x6665('0x44')][_0x6665('0x60')]({'where':{'id':_0x14139b[_0x6665('0x5e')]['id']}})[_0x6665('0x3a')](handleEntityNotFound(_0x19fb37,null))[_0x6665('0x3a')](removeEntity(_0x19fb37,null))[_0x6665('0x2c')](handleError(_0x19fb37,null));};exports[_0x6665('0x68')]=function(_0x5af1ee,_0x5d810c){return db['FaxAccount'][_0x6665('0x68')]()[_0x6665('0x3a')](respondWithResult(_0x5d810c,null))['catch'](handleError(_0x5d810c,null));};exports[_0x6665('0x69')]=function(_0x3e7b6f,_0x163af4,_0x49f262){if(_0x3e7b6f[_0x6665('0x62')]['id']){delete _0x3e7b6f[_0x6665('0x62')]['id'];}return db[_0x6665('0x44')][_0x6665('0x60')]({'where':{'id':_0x3e7b6f[_0x6665('0x5e')]['id']}})[_0x6665('0x3a')](handleEntityNotFound(_0x163af4,null))['then'](function(_0x10c9a9){if(_0x10c9a9){_0x3e7b6f['body'][_0x6665('0x6a')]=_0x10c9a9['id'];return db[_0x6665('0x6b')][_0x6665('0x61')](_0x3e7b6f[_0x6665('0x62')]);}})['then'](respondWithResult(_0x163af4,null))[_0x6665('0x2c')](handleError(_0x163af4,null));};exports['getDispositions']=function(_0xe8695d,_0x5c710f,_0x35b35c){var _0x230860={'raw':![],'where':{}};var _0x4cb9ae={};var _0x27a6d0={'count':0x0,'rows':[]};return db[_0x6665('0x44')][_0x6665('0x6c')]({'where':{'id':_0xe8695d[_0x6665('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5c710f,null))[_0x6665('0x3a')](function(_0x3496d8){if(_0x3496d8){_0x4cb9ae[_0x6665('0x4c')]=_[_0x6665('0x4a')](db[_0x6665('0x6b')][_0x6665('0x45')]);_0x4cb9ae['query']=_[_0x6665('0x4a')](_0xe8695d[_0x6665('0x49')]);_0x4cb9ae[_0x6665('0x4b')]=_['intersection'](_0x4cb9ae[_0x6665('0x4c')],_0x4cb9ae[_0x6665('0x49')]);_0x230860[_0x6665('0x4d')]=_[_0x6665('0x5f')](_0x4cb9ae[_0x6665('0x4c')],qs[_0x6665('0x4e')](_0xe8695d[_0x6665('0x49')][_0x6665('0x4e')]));_0x230860['attributes']=_0x230860[_0x6665('0x4d')]['length']?_0x230860[_0x6665('0x4d')]:_0x4cb9ae[_0x6665('0x4c')];if(!_0xe8695d['query'][_0x6665('0x50')](_0x6665('0x51'))){_0x230860[_0x6665('0x33')]=qs[_0x6665('0x33')](_0xe8695d[_0x6665('0x49')][_0x6665('0x33')]);_0x230860[_0x6665('0x31')]=qs[_0x6665('0x31')](_0xe8695d[_0x6665('0x49')][_0x6665('0x31')]);}_0x230860[_0x6665('0x52')]=qs['sort'](_0xe8695d[_0x6665('0x49')][_0x6665('0x53')]);_0x230860[_0x6665('0x54')]=qs[_0x6665('0x4b')](_['pick'](_0xe8695d[_0x6665('0x49')],_0x4cb9ae[_0x6665('0x4b')]));_0x230860['where'][_0x6665('0x6a')]=_0x3496d8['id'];if(_0xe8695d[_0x6665('0x49')][_0x6665('0x56')]){_0x230860['where']=_[_0x6665('0x57')](_0x230860[_0x6665('0x54')],{'$or':_[_0x6665('0x48')](_0x230860[_0x6665('0x4d')],function(_0x52d668){var _0x3a4504={};_0x3a4504[_0x52d668]={'$like':'%'+_0xe8695d[_0x6665('0x49')]['filter']+'%'};return _0x3a4504;})});}_0x230860=_[_0x6665('0x57')]({},_0x230860,_0xe8695d[_0x6665('0x59')]);return db['Disposition'][_0x6665('0x34')]({'where':_0x230860['where']})[_0x6665('0x3a')](function(_0x3d7b21){_0x27a6d0[_0x6665('0x34')]=_0x3d7b21;if(_0xe8695d[_0x6665('0x49')]['includeAll']){_0x230860[_0x6665('0x5b')]=[{'all':!![]}];}return db[_0x6665('0x6b')][_0x6665('0x6d')](_0x230860);})[_0x6665('0x3a')](function(_0x2c090d){_0x27a6d0[_0x6665('0x5c')]=_0x2c090d;return _0x27a6d0;});}})[_0x6665('0x3a')](respondWithFilteredResult(_0x5c710f,_0x230860))['catch'](handleError(_0x5c710f,null));};exports[_0x6665('0x6e')]=function(_0x419eba,_0x59e1ea,_0x4709d7){return db['FaxAccount']['find']({'where':{'id':_0x419eba[_0x6665('0x5e')]['id']}})[_0x6665('0x3a')](handleEntityNotFound(_0x59e1ea,null))[_0x6665('0x3a')](function(_0xbe8eeb){if(_0xbe8eeb){return _0xbe8eeb[_0x6665('0x6e')](_0x419eba['query'][_0x6665('0x6f')]);}})[_0x6665('0x3a')](respondWithStatusCode(_0x59e1ea,null))[_0x6665('0x2c')](handleError(_0x59e1ea,null));};exports[_0x6665('0x70')]=function(_0xac5242,_0x49fb8c,_0x4c147e){if(_0xac5242['body']['id']){delete _0xac5242['body']['id'];}return db[_0x6665('0x44')][_0x6665('0x60')]({'where':{'id':_0xac5242[_0x6665('0x5e')]['id']}})[_0x6665('0x3a')](handleEntityNotFound(_0x49fb8c,null))[_0x6665('0x3a')](function(_0xbb20a1){if(_0xbb20a1){_0xac5242[_0x6665('0x62')][_0x6665('0x6a')]=_0xbb20a1['id'];return db[_0x6665('0x71')][_0x6665('0x61')](_0xac5242[_0x6665('0x62')]);}})[_0x6665('0x3a')](respondWithResult(_0x49fb8c,null))[_0x6665('0x2c')](handleError(_0x49fb8c,null));};exports[_0x6665('0x72')]=function(_0x498c43,_0x509b36,_0xe2f53d){var _0x1384e4={'raw':![],'where':{}};var _0x2b05c9={};var _0x58c5f3={'count':0x0,'rows':[]};return db[_0x6665('0x44')]['findOne']({'where':{'id':_0x498c43[_0x6665('0x5e')]['id']}})[_0x6665('0x3a')](handleEntityNotFound(_0x509b36,null))[_0x6665('0x3a')](function(_0x45b6fb){if(_0x45b6fb){_0x2b05c9[_0x6665('0x4c')]=_[_0x6665('0x4a')](db[_0x6665('0x71')][_0x6665('0x45')]);_0x2b05c9[_0x6665('0x49')]=_[_0x6665('0x4a')](_0x498c43[_0x6665('0x49')]);_0x2b05c9[_0x6665('0x4b')]=_[_0x6665('0x5f')](_0x2b05c9[_0x6665('0x4c')],_0x2b05c9['query']);_0x1384e4[_0x6665('0x4d')]=_[_0x6665('0x5f')](_0x2b05c9[_0x6665('0x4c')],qs['fields'](_0x498c43[_0x6665('0x49')]['fields']));_0x1384e4[_0x6665('0x4d')]=_0x1384e4[_0x6665('0x4d')][_0x6665('0x4f')]?_0x1384e4[_0x6665('0x4d')]:_0x2b05c9[_0x6665('0x4c')];if(!_0x498c43[_0x6665('0x49')][_0x6665('0x50')](_0x6665('0x51'))){_0x1384e4['limit']=qs['limit'](_0x498c43[_0x6665('0x49')][_0x6665('0x33')]);_0x1384e4[_0x6665('0x31')]=qs[_0x6665('0x31')](_0x498c43[_0x6665('0x49')][_0x6665('0x31')]);}_0x1384e4[_0x6665('0x52')]=qs[_0x6665('0x53')](_0x498c43[_0x6665('0x49')][_0x6665('0x53')]);_0x1384e4[_0x6665('0x54')]=qs['filters'](_[_0x6665('0x55')](_0x498c43['query'],_0x2b05c9[_0x6665('0x4b')]));_0x1384e4[_0x6665('0x54')][_0x6665('0x6a')]=_0x45b6fb['id'];if(_0x498c43[_0x6665('0x49')][_0x6665('0x56')]){_0x1384e4['where']=_[_0x6665('0x57')](_0x1384e4[_0x6665('0x54')],{'$or':_['map'](_0x1384e4[_0x6665('0x4d')],function(_0xd98b23){var _0x58856f={};_0x58856f[_0xd98b23]={'$like':'%'+_0x498c43['query'][_0x6665('0x56')]+'%'};return _0x58856f;})});}_0x1384e4=_['merge']({},_0x1384e4,_0x498c43[_0x6665('0x59')]);return db['CannedAnswer'][_0x6665('0x34')]({'where':_0x1384e4[_0x6665('0x54')]})[_0x6665('0x3a')](function(_0x320a7b){_0x58c5f3['count']=_0x320a7b;if(_0x498c43[_0x6665('0x49')][_0x6665('0x5a')]){_0x1384e4[_0x6665('0x5b')]=[{'all':!![]}];}return db[_0x6665('0x71')][_0x6665('0x6d')](_0x1384e4);})['then'](function(_0xe07348){_0x58c5f3['rows']=_0xe07348;return _0x58c5f3;});}})[_0x6665('0x3a')](respondWithFilteredResult(_0x509b36,_0x1384e4))[_0x6665('0x2c')](handleError(_0x509b36,null));};exports[_0x6665('0x73')]=function(_0x4c8036,_0x390157,_0x191a8c){return db[_0x6665('0x44')][_0x6665('0x60')]({'where':{'id':_0x4c8036[_0x6665('0x5e')]['id']}})[_0x6665('0x3a')](handleEntityNotFound(_0x390157,null))[_0x6665('0x3a')](function(_0x1166be){if(_0x1166be){return _0x1166be[_0x6665('0x73')](_0x4c8036[_0x6665('0x49')][_0x6665('0x6f')]);}})[_0x6665('0x3a')](respondWithStatusCode(_0x390157,null))[_0x6665('0x2c')](handleError(_0x390157,null));};exports[_0x6665('0x74')]=function(_0x2570cc,_0x1fa36d,_0x9cb54a){return db[_0x6665('0x75')][_0x6665('0x60')]({'where':{'id':_0x2570cc['params']['id']}})[_0x6665('0x3a')](handleEntityNotFound(_0x1fa36d,null))[_0x6665('0x3a')](function(_0x214631){if(_0x214631){return _0x214631[_0x6665('0x74')](_0x2570cc[_0x6665('0x62')]['ids'],_[_0x6665('0x76')](_0x2570cc[_0x6665('0x62')],[_0x6665('0x6f'),'id'])||{});}})[_0x6665('0x3a')](respondWithResult(_0x1fa36d,null))['catch'](handleError(_0x1fa36d,null));};exports[_0x6665('0x77')]=function(_0x3966fa,_0x24e096,_0x406915){var _0x18e910={'raw':![],'where':{}};var _0x4e3777={};var _0x11d6b6={'count':0x0,'rows':[]};return db[_0x6665('0x44')][_0x6665('0x6c')]({'where':{'id':_0x3966fa[_0x6665('0x5e')]['id']}})[_0x6665('0x3a')](handleEntityNotFound(_0x24e096,null))[_0x6665('0x3a')](function(_0xcb42ed){if(_0xcb42ed){_0x4e3777[_0x6665('0x4c')]=_[_0x6665('0x4a')](db[_0x6665('0x75')][_0x6665('0x45')]);_0x4e3777[_0x6665('0x49')]=_[_0x6665('0x4a')](_0x3966fa[_0x6665('0x49')]);_0x4e3777[_0x6665('0x4b')]=_[_0x6665('0x5f')](_0x4e3777[_0x6665('0x4c')],_0x4e3777[_0x6665('0x49')]);_0x18e910['attributes']=_['intersection'](_0x4e3777[_0x6665('0x4c')],qs[_0x6665('0x4e')](_0x3966fa['query'][_0x6665('0x4e')]));_0x18e910[_0x6665('0x4d')]=_0x18e910['attributes'][_0x6665('0x4f')]?_0x18e910[_0x6665('0x4d')]:_0x4e3777['model'];if(!_0x3966fa[_0x6665('0x49')][_0x6665('0x50')](_0x6665('0x51'))){_0x18e910[_0x6665('0x33')]=qs[_0x6665('0x33')](_0x3966fa[_0x6665('0x49')][_0x6665('0x33')]);_0x18e910['offset']=qs[_0x6665('0x31')](_0x3966fa[_0x6665('0x49')]['offset']);}_0x18e910[_0x6665('0x52')]=qs[_0x6665('0x53')](_0x3966fa[_0x6665('0x49')][_0x6665('0x53')]);_0x18e910[_0x6665('0x54')]=qs[_0x6665('0x4b')](_[_0x6665('0x55')](_0x3966fa[_0x6665('0x49')],_0x4e3777[_0x6665('0x4b')]));_0x18e910['where']['FaxAccountId']=_0xcb42ed['id'];if(_0x3966fa[_0x6665('0x49')]['filter']){_0x18e910['where']=_[_0x6665('0x57')](_0x18e910[_0x6665('0x54')],{'$or':_['map'](_0x18e910['attributes'],function(_0x26163a){var _0x4ce60b={};_0x4ce60b[_0x26163a]={'$like':'%'+_0x3966fa[_0x6665('0x49')][_0x6665('0x56')]+'%'};return _0x4ce60b;})});}_0x18e910=_[_0x6665('0x57')]({},_0x18e910,_0x3966fa[_0x6665('0x59')]);return db[_0x6665('0x75')][_0x6665('0x34')]({'where':_0x18e910[_0x6665('0x54')]})['then'](function(_0x5bb526){_0x11d6b6['count']=_0x5bb526;if(_0x3966fa[_0x6665('0x49')][_0x6665('0x5a')]){_0x18e910['include']=[{'model':db[_0x6665('0x78')],'as':_0x6665('0x79'),'required':![]},{'model':db[_0x6665('0x7a')],'as':_0x6665('0x7b'),'attributes':['name',_0x6665('0x7c'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x6665('0x40'),_0x6665('0x7d')],'where':_0x3966fa['query'][_0x6665('0x7e')]?{'id':_0x3966fa[_0x6665('0x49')][_0x6665('0x7e')]}:undefined,'required':_0x3966fa[_0x6665('0x49')][_0x6665('0x7e')]?!![]:![]}];}return db[_0x6665('0x75')]['findAll'](_0x18e910);})[_0x6665('0x3a')](function(_0x3887b0){_0x11d6b6['rows']=_0x3887b0;return _0x11d6b6;});}})[_0x6665('0x3a')](respondWithFilteredResult(_0x24e096,_0x18e910))[_0x6665('0x2c')](handleError(_0x24e096,null));};exports['addApplications']=function(_0x715531,_0x22ff20){var _0x33a87c=_0x715531['params']['id'];var _0x5e7f70=_0x715531[_0x6665('0x62')];var _0x2458b5=0xc8;var _0x34cbfe=null;return db[_0x6665('0x7f')]['transaction']({'isolationLevel':db['sequelize'][_0x6665('0x80')][_0x6665('0x81')][_0x6665('0x82')]},function(_0xf861e){return db[_0x6665('0x44')][_0x6665('0x6c')]({'where':{'id':_0x33a87c},'transaction':_0xf861e})[_0x6665('0x3a')](function(_0x543424){if(_0x543424){return db['FaxApplication'][_0x6665('0x3e')]({'where':{'FaxAccountId':_0x33a87c},'transaction':_0xf861e})[_0x6665('0x3a')](function(){var _0x545dee=_['map'](_0x5e7f70,function(_0x321079){_0x321079[_0x6665('0x6a')]=_0x33a87c;return _0x321079;});return db[_0x6665('0x83')][_0x6665('0x84')](_0x545dee,{'transaction':_0xf861e});});}else{_0x2458b5=0x194;_0x34cbfe=[];}});})['then'](function(){if(_0x2458b5!==0x194){return db[_0x6665('0x83')][_0x6665('0x85')]({'where':{'FaxAccountId':_0x33a87c},'order':_0x6665('0x86')})[_0x6665('0x3a')](function(_0x4b4f8b){_0x34cbfe=_0x4b4f8b;});}})['catch'](function(_0x29dcd9){_0x2458b5=0x1f4;logger['error'](_0x29dcd9['stack']);if(_0x29dcd9[_0x6665('0x40')]){delete _0x29dcd9[_0x6665('0x40')];}_0x34cbfe=_0x29dcd9;})['finally'](function(){if(_0x34cbfe===null){_0x22ff20['sendStatus'](_0x2458b5);}else{if(_0x2458b5===0x1f4){_0x22ff20[_0x6665('0x2e')](_0x2458b5)[_0x6665('0x41')](_0x34cbfe);}else{_0x22ff20[_0x6665('0x2e')](_0x2458b5)[_0x6665('0x30')](_0x34cbfe);}}});};exports[_0x6665('0x87')]=function(_0x1e89c4,_0x30875b,_0x7aae1b){var _0x87129a={};var _0x11433f={};var _0x349a87;var _0x3834e0;return db[_0x6665('0x44')][_0x6665('0x6c')]({'where':{'id':_0x1e89c4[_0x6665('0x5e')]['id']}})[_0x6665('0x3a')](handleEntityNotFound(_0x30875b,null))[_0x6665('0x3a')](function(_0x39df3d){if(_0x39df3d){_0x349a87=_0x39df3d;_0x11433f[_0x6665('0x4c')]=_[_0x6665('0x4a')](db[_0x6665('0x83')][_0x6665('0x45')]);_0x11433f[_0x6665('0x49')]=_[_0x6665('0x4a')](_0x1e89c4[_0x6665('0x49')]);_0x11433f[_0x6665('0x4b')]=_['intersection'](_0x11433f[_0x6665('0x4c')],_0x11433f['query']);_0x87129a[_0x6665('0x4d')]=_['intersection'](_0x11433f['model'],qs[_0x6665('0x4e')](_0x1e89c4[_0x6665('0x49')][_0x6665('0x4e')]));_0x87129a[_0x6665('0x4d')]=_0x87129a[_0x6665('0x4d')]['length']?_0x87129a['attributes']:_0x11433f[_0x6665('0x4c')];_0x87129a[_0x6665('0x52')]=qs[_0x6665('0x53')](_0x1e89c4['query'][_0x6665('0x53')]);_0x87129a[_0x6665('0x54')]=qs['filters'](_[_0x6665('0x55')](_0x1e89c4[_0x6665('0x49')],_0x11433f[_0x6665('0x4b')]));if(_0x1e89c4['query'][_0x6665('0x56')]){_0x87129a['where']=_[_0x6665('0x57')](_0x87129a['where'],{'$or':_[_0x6665('0x48')](_0x87129a['attributes'],function(_0x5074a4){var _0x3867b5={};_0x3867b5[_0x5074a4]={'$like':'%'+_0x1e89c4[_0x6665('0x49')][_0x6665('0x56')]+'%'};return _0x3867b5;})});}_0x87129a=_['merge']({},_0x87129a,_0x1e89c4[_0x6665('0x59')]);return _0x349a87[_0x6665('0x87')](_0x87129a);}})[_0x6665('0x3a')](function(_0x97eb7e){if(_0x97eb7e){_0x3834e0=_0x97eb7e[_0x6665('0x4f')];if(!_0x1e89c4[_0x6665('0x49')][_0x6665('0x50')](_0x6665('0x51'))){_0x87129a['limit']=qs[_0x6665('0x33')](_0x1e89c4[_0x6665('0x49')]['limit']);_0x87129a[_0x6665('0x31')]=qs[_0x6665('0x31')](_0x1e89c4['query'][_0x6665('0x31')]);}return _0x349a87[_0x6665('0x87')](_0x87129a);}})[_0x6665('0x3a')](function(_0x1cc990){if(_0x1cc990){return _0x1cc990?{'count':_0x3834e0,'rows':_0x1cc990}:null;}})[_0x6665('0x3a')](respondWithResult(_0x30875b,null))[_0x6665('0x2c')](handleError(_0x30875b,null));};function Extension(_0x4f5240,_0x3d628d,_0xdf3902,_0x41631e){this['context']='from-voip-provider';this[_0x6665('0x88')]=_0x4f5240[_0x6665('0x89')];this[_0x6665('0x8a')]=_0x41631e;this[_0x6665('0x8b')]='system';this[_0x6665('0x8c')]=_0x6665('0x8d');this[_0x6665('0x6a')]=_0x4f5240['id'];this[_0x6665('0x86')]=_0x3d628d;this[_0x6665('0x8e')]=_0xdf3902;}function createExtensionsReciveFax(_0xede89a){var _0x1d7adb=0x1;var _0x24a36e=[];_0x24a36e[_0x6665('0x8f')](new Extension(_0xede89a,_0x1d7adb,'',_0x6665('0x90')));_0x1d7adb+=0x1;_0x24a36e[_0x6665('0x8f')](new Extension(_0xede89a,_0x1d7adb,_0x6665('0x91'),_0x6665('0x92')));_0x1d7adb+=0x1;for(var _0x211949 in _0xede89a){if(_0xede89a[_0x6665('0x50')](_0x211949)&&(_0x211949===_0x6665('0x93')||_0x211949==='localstationid'||_0x211949==='gateway'||_0x211949===_0x6665('0x94')||_0x211949===_0x6665('0x95')||_0x211949==='maxrate'||_0x211949===_0x6665('0x96')||_0x211949===_0x6665('0x97')||_0x211949==='t38timeout')){_0x24a36e[_0x6665('0x8f')](new Extension(_0xede89a,_0x1d7adb,_0x6665('0x98')+_0x211949+')='+_0xede89a[_0x211949],'Set'));_0x1d7adb+=0x1;}}_0x24a36e[_0x6665('0x8f')](new Extension(_0xede89a,_0x1d7adb,'6',_0x6665('0x99')));_0x1d7adb+=0x1;_0x24a36e[_0x6665('0x8f')](new Extension(_0xede89a,_0x1d7adb,_0x6665('0x9a'),_0x6665('0x9b')));_0x1d7adb=0x0;return _0x24a36e;}exports[_0x6665('0x9c')]=function(_0x398f74,_0x5828e1,_0x2e6e9c){var _0x32d5a8;return db[_0x6665('0x7f')][_0x6665('0x9d')](function(_0x1cff16){return db[_0x6665('0x44')][_0x6665('0x61')](_0x398f74[_0x6665('0x62')],{'transaction':_0x1cff16})[_0x6665('0x3a')](function(_0x29ec25){_0x32d5a8=_0x29ec25[_0x6665('0x3b')]({'plain':!![]});return db[_0x6665('0x9e')][_0x6665('0x84')](createExtensionsReciveFax(_0x32d5a8),{'transaction':_0x1cff16});});})[_0x6665('0x3a')](function(){return _0x32d5a8;})[_0x6665('0x3a')](respondWithResult(_0x5828e1,null))[_0x6665('0x2c')](handleError(_0x5828e1,null));};exports['updateAccountApplications']=function(_0x565757,_0x2037a2,_0x5921d5){var _0x30fafc;return db[_0x6665('0x7f')]['transaction'](function(_0x3c0621){return db[_0x6665('0x44')][_0x6665('0x39')](_0x565757[_0x6665('0x62')],{'where':{'id':_0x565757['body']['id']},'transaction':_0x3c0621})[_0x6665('0x3a')](function(_0x564fd6){return db[_0x6665('0x9e')][_0x6665('0x3e')]({'where':{'FaxAccountId':_0x565757[_0x6665('0x62')]['id']},'transaction':_0x3c0621})[_0x6665('0x3a')](function(_0x1744e0){return db['VoiceExtension'][_0x6665('0x84')](createExtensionsReciveFax(_['omit'](_0x565757[_0x6665('0x62')],[_0x6665('0x9f'),'key',_0x6665('0xa0'),_0x6665('0xa1'),'TrunkId',_0x6665('0xa2')])),{'transaction':_0x3c0621});});});})[_0x6665('0x3a')](function(){return db[_0x6665('0x44')][_0x6665('0xa3')](_0x565757[_0x6665('0x62')]['id']);})[_0x6665('0x3a')](respondWithResult(_0x2037a2,null))[_0x6665('0x2c')](handleError(_0x2037a2,null));};exports['getMessages']=function(_0x4d8e1a,_0x5a9287,_0xd68e65){var _0x1120ed={'raw':!![],'where':{}};var _0x10e45e={};var _0x2c89b7={'count':0x0,'rows':[]};return db[_0x6665('0x44')][_0x6665('0x6c')]({'where':{'id':_0x4d8e1a[_0x6665('0x5e')]['id']}})[_0x6665('0x3a')](handleEntityNotFound(_0x5a9287,null))[_0x6665('0x3a')](function(_0x38c769){if(_0x38c769){_0x10e45e[_0x6665('0x4c')]=_[_0x6665('0x4a')](db[_0x6665('0xa4')][_0x6665('0x45')]);_0x10e45e['query']=_['keys'](_0x4d8e1a['query']);_0x10e45e[_0x6665('0x4b')]=_[_0x6665('0x5f')](_0x10e45e[_0x6665('0x4c')],_0x10e45e['query']);_0x1120ed['attributes']=_['intersection'](_0x10e45e[_0x6665('0x4c')],qs[_0x6665('0x4e')](_0x4d8e1a['query'][_0x6665('0x4e')]));_0x1120ed['attributes']=_0x1120ed[_0x6665('0x4d')][_0x6665('0x4f')]?_0x1120ed[_0x6665('0x4d')]:_0x10e45e['model'];if(!_0x4d8e1a[_0x6665('0x49')][_0x6665('0x50')](_0x6665('0x51'))){_0x1120ed[_0x6665('0x33')]=qs[_0x6665('0x33')](_0x4d8e1a['query']['limit']);_0x1120ed[_0x6665('0x31')]=qs[_0x6665('0x31')](_0x4d8e1a[_0x6665('0x49')][_0x6665('0x31')]);}_0x1120ed['order']=qs[_0x6665('0x53')](_0x4d8e1a[_0x6665('0x49')][_0x6665('0x53')]);_0x1120ed[_0x6665('0x54')]=qs[_0x6665('0x4b')](_[_0x6665('0x55')](_0x4d8e1a['query'],_0x10e45e['filters']));_0x1120ed['where'][_0x6665('0x6a')]=_0x38c769['id'];if(_0x4d8e1a[_0x6665('0x49')][_0x6665('0x56')]){_0x1120ed[_0x6665('0x54')]=_[_0x6665('0x57')](_0x1120ed[_0x6665('0x54')],{'$or':_[_0x6665('0x48')](_0x1120ed[_0x6665('0x4d')],function(_0x364a16){var _0x5d68b9={};_0x5d68b9[_0x364a16]={'$like':'%'+_0x4d8e1a[_0x6665('0x49')][_0x6665('0x56')]+'%'};return _0x5d68b9;})});}if(_0x4d8e1a[_0x6665('0x49')][_0x6665('0xa5')]){var _0x3dd7a2=_0x4d8e1a['query'][_0x6665('0xa5')]['split'](',');var _0x42db56={};_0x42db56[_0x3dd7a2[0x0]]={'$gte':moment(_0x3dd7a2[0x1])[_0x6665('0xa6')](_0x6665('0xa7'))};_0x1120ed['where']=_[_0x6665('0x57')](_0x1120ed[_0x6665('0x54')],_0x42db56);}_0x1120ed=_[_0x6665('0x57')]({},_0x1120ed,_0x4d8e1a['options']);return db[_0x6665('0xa4')][_0x6665('0x34')]({'where':_0x1120ed[_0x6665('0x54')]})[_0x6665('0x3a')](function(_0x5ae387){_0x2c89b7[_0x6665('0x34')]=_0x5ae387;if(_0x4d8e1a[_0x6665('0x49')][_0x6665('0x5a')]){_0x1120ed[_0x6665('0x5b')]=[{'all':!![]}];}return db['FaxMessage'][_0x6665('0x6d')](_0x1120ed);})['then'](function(_0x5360ea){_0x2c89b7[_0x6665('0x5c')]=_0x5360ea;return _0x2c89b7;});}})[_0x6665('0x3a')](respondWithFilteredResult(_0x5a9287,_0x1120ed))['catch'](handleError(_0x5a9287,null));};exports[_0x6665('0x41')]=function(_0x2c2ca3,_0x126111,_0x16ef44){var _0x541518,_0x575e14={},_0x4fc386;if(_0x2c2ca3[_0x6665('0x62')]['to']){_0x4fc386=_0x2c2ca3['body']['to'][0x0];}return db[_0x6665('0x44')]['find']({'where':{'id':_0x2c2ca3['params']['id']},'include':[{'model':db['CmList'],'as':_0x6665('0xa8'),'include':[{'model':db[_0x6665('0x78')],'as':'Contacts','where':{'fax':_0x4fc386},'limit':0x1,'order':[[_0x6665('0xa1'),_0x6665('0xa9')]]}]}]})[_0x6665('0x3a')](handleEntityNotFound(_0x126111,null))['then'](function(_0x53a5bc){_0x541518=_0x53a5bc;if(_0x2c2ca3[_0x6665('0x62')][_0x6665('0xaa')]&&_0x2c2ca3[_0x6665('0x62')][_0x6665('0xaa')]['length']){for(var _0x5add71=0x0;_0x5add71<_0x2c2ca3[_0x6665('0x62')][_0x6665('0xaa')]['length'];_0x5add71+=0x1){_0x2c2ca3[_0x6665('0x62')][_0x6665('0xaa')][_0x5add71]={'filename':_0x2c2ca3[_0x6665('0x62')]['attachments'][_0x5add71][_0x6665('0x40')],'id':_0x2c2ca3[_0x6665('0x62')][_0x6665('0xaa')][_0x5add71]['id'],'path':path['join'](config['root'],_0x6665('0xab'),_0x2c2ca3[_0x6665('0x62')][_0x6665('0xaa')][_0x5add71]['basename'])};}}return respondWithRpcPromise(_0x6665('0xac'),_0x6665('0xac'),{'FaxAccountId':_[_0x6665('0xad')](_0x2c2ca3[_0x6665('0x5e')]['id'])?undefined:_0x2c2ca3[_0x6665('0x5e')]['id'],'path':_['isNil'](_0x2c2ca3[_0x6665('0x62')][_0x6665('0xaa')][0x0]['path'])?undefined:_0x2c2ca3['body'][_0x6665('0xaa')][0x0][_0x6665('0x7')],'fax':_['isNil'](_0x2c2ca3[_0x6665('0x62')]['to'][0x0])?undefined:_0x2c2ca3[_0x6665('0x62')]['to'][0x0]},client9002);})['then'](function(){if(_0x541518){if(_[_0x6665('0xad')](_0x2c2ca3[_0x6665('0x62')][_0x6665('0xae')])){_0x2c2ca3['body'][_0x6665('0xae')]=util[_0x6665('0xa6')](_0x6665('0xaf'),_0x541518[_0x6665('0x40')],_0x541518[_0x6665('0xb0')]);}if(_0x541518[_0x6665('0xa8')]){if(_0x541518[_0x6665('0xa8')]['Contacts']['length']){return _0x541518[_0x6665('0xa8')]['Contacts'][0x0];}else{return db['CmContact'][_0x6665('0x61')](_['defaults'](_0x2c2ca3[_0x6665('0x62')],{'firstName':_0x2c2ca3[_0x6665('0x62')]['to'][0x0],'phone':_0x2c2ca3[_0x6665('0x62')]['to'][0x0],'fax':_0x2c2ca3[_0x6665('0x62')]['to'][0x0],'ListId':_0x541518['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x6665('0xb1'));}})['then'](function(_0x4ba4f9){if(_0x4ba4f9){return db[_0x6665('0x75')]['find']({'where':{'ContactId':_0x4ba4f9['id'],'closed':![],'FaxAccountId':_0x541518['id']}})['then'](function(_0x476694){if(_0x476694){return[_0x476694,![]];}return db[_0x6665('0x75')][_0x6665('0x61')]({'UserId':_0x2c2ca3[_0x6665('0x63')]['id'],'ContactId':_0x4ba4f9['id'],'FaxAccountId':_0x541518['id'],'fax':_0x2c2ca3[_0x6665('0x62')]['to'][0x0],'firstMsgDirection':_0x6665('0xb2'),'Messages':[_['merge'](_0x2c2ca3[_0x6665('0x62')],{'read':![],'body':_0x2c2ca3[_0x6665('0x62')]['attachments'][0x0]['filename'],'FaxAccountId':_0x541518['id'],'UserId':_0x2c2ca3[_0x6665('0x63')]['id'],'ContactId':_0x4ba4f9['id'],'AttachmentId':_0x2c2ca3['body'][_0x6665('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0x6665('0xa4')],'as':'Messages'}]})[_0x6665('0x3a')](function(_0x14817a){return[_0x14817a,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x6665('0xb3')](function(_0x11ed76,_0x485789){if(_0x485789){return _0x11ed76;}return db[_0x6665('0xa4')][_0x6665('0x61')]({'direction':_0x6665('0xb2'),'read':![],'body':_0x2c2ca3['body'][_0x6665('0xaa')][0x0][_0x6665('0xb4')],'FaxAccountId':_0x541518['id'],'FaxInteractionId':_0x11ed76['id'],'UserId':_0x2c2ca3['user']['id'],'ContactId':_0x11ed76[_0x6665('0xb5')],'AttachmentId':_0x2c2ca3['body'][_0x6665('0xaa')][0x0]['id']})[_0x6665('0x3a')](function(_0x10ea36){_0x11ed76[_0x6665('0xb6')]['Messages']=[];_0x11ed76[_0x6665('0xb6')][_0x6665('0xb7')][_0x6665('0x8f')](_0x10ea36[_0x6665('0xb6')]);return _0x11ed76;});})[_0x6665('0x3a')](function(_0x13620a){respondWithRpcPromise(_0x6665('0xb8'),_0x6665('0xb8'),{'FaxAccountId':_[_0x6665('0xad')](_0x2c2ca3[_0x6665('0x5e')]['id'])?undefined:_0x2c2ca3[_0x6665('0x5e')]['id'],'path':_[_0x6665('0xad')](_0x2c2ca3[_0x6665('0x62')][_0x6665('0xaa')][0x0][_0x6665('0x7')])?undefined:_0x2c2ca3[_0x6665('0x62')]['attachments'][0x0]['path'],'fax':_[_0x6665('0xad')](_0x2c2ca3[_0x6665('0x62')]['to'][0x0])?undefined:_0x2c2ca3[_0x6665('0x62')]['to'][0x0],'AttachmentId':_0x2c2ca3[_0x6665('0x62')][_0x6665('0xaa')][0x0]['id']},client9002)[_0x6665('0x3a')](function(_0x3e2a5f){logger[_0x6665('0x23')]('SendFaxRpc,\x20%s',_0x3e2a5f);})['catch'](function(_0xa7cf7c){logger[_0x6665('0x23')]('SendFaxRpc,\x20%s',_0xa7cf7c);});return _0x13620a;})['then'](respondWithResult(_0x126111,null))['catch'](handleError(_0x126111,null));};exports[_0x6665('0xb9')]=function(_0x21f283,_0xe6ab4e,_0x40ce51){return db[_0x6665('0x44')]['find']({'where':{'id':_0x21f283[_0x6665('0x5e')]['id']}})[_0x6665('0x3a')](handleEntityNotFound(_0xe6ab4e,null))[_0x6665('0x3a')](function(_0x325fa2){if(_0x325fa2){return _0x325fa2[_0x6665('0xb9')](_0x21f283[_0x6665('0x62')][_0x6665('0x6f')],_[_0x6665('0x76')](_0x21f283['body'],[_0x6665('0x6f'),'id'])||{})[_0x6665('0xb3')](function(_0x58adec){for(var _0x2bde2d=0x0;_0x2bde2d<_0x21f283[_0x6665('0x62')][_0x6665('0x6f')][_0x6665('0x4f')];_0x2bde2d+=0x1){socket[_0x6665('0xba')](_0x6665('0xbb'),{'UserId':Number(_0x21f283['body']['ids'][_0x2bde2d]),'FaxAccountId':Number(_0x21f283[_0x6665('0x5e')]['id'])});}return _0x58adec;});}})['then'](respondWithResult(_0xe6ab4e,null))['catch'](handleError(_0xe6ab4e,null));};exports['removeAgents']=function(_0x5965af,_0x500ae2,_0x2e3923){return db[_0x6665('0x44')]['find']({'where':{'id':_0x5965af[_0x6665('0x5e')]['id']}})['then'](handleEntityNotFound(_0x500ae2,null))['then'](function(_0x137d0a){if(_0x137d0a){return _0x137d0a[_0x6665('0xbc')](_0x5965af[_0x6665('0x49')][_0x6665('0x6f')])[_0x6665('0x3a')](function(){if(_[_0x6665('0xbd')](_0x5965af[_0x6665('0x49')][_0x6665('0x6f')])){for(var _0x37bbe6=0x0;_0x37bbe6<_0x5965af[_0x6665('0x49')][_0x6665('0x6f')][_0x6665('0x4f')];_0x37bbe6+=0x1){socket[_0x6665('0xba')](_0x6665('0xbe'),{'UserId':Number(_0x5965af['query']['ids'][_0x37bbe6]),'FaxAccountId':Number(_0x5965af['params']['id'])});}}else{socket[_0x6665('0xba')](_0x6665('0xbe'),{'UserId':Number(_0x5965af['query'][_0x6665('0x6f')]),'FaxAccountId':Number(_0x5965af['params']['id'])});}});}})[_0x6665('0x3a')](respondWithStatusCode(_0x500ae2,null))[_0x6665('0x2c')](handleError(_0x500ae2,null));};exports[_0x6665('0xbf')]=function(_0x1fa527,_0x4cc974,_0x1c4a0c){var _0x2c23c0={};var _0x95dad3={};var _0x286794;var _0x35963a;return db[_0x6665('0x44')]['findOne']({'where':{'id':_0x1fa527[_0x6665('0x5e')]['id']}})[_0x6665('0x3a')](handleEntityNotFound(_0x4cc974,null))['then'](function(_0x52f934){if(_0x52f934){_0x286794=_0x52f934;_0x95dad3[_0x6665('0x4c')]=_[_0x6665('0x4a')](db[_0x6665('0x7a')][_0x6665('0x45')]);_0x95dad3[_0x6665('0x49')]=_[_0x6665('0x4a')](_0x1fa527['query']);_0x95dad3[_0x6665('0x4b')]=_[_0x6665('0x5f')](_0x95dad3[_0x6665('0x4c')],_0x95dad3[_0x6665('0x49')]);_0x2c23c0[_0x6665('0x4d')]=_['intersection'](_0x95dad3[_0x6665('0x4c')],qs[_0x6665('0x4e')](_0x1fa527['query'][_0x6665('0x4e')]));_0x2c23c0[_0x6665('0x4d')]=_0x2c23c0['attributes'][_0x6665('0x4f')]?_0x2c23c0[_0x6665('0x4d')]:_0x95dad3[_0x6665('0x4c')];_0x2c23c0['order']=qs[_0x6665('0x53')](_0x1fa527[_0x6665('0x49')]['sort']);_0x2c23c0[_0x6665('0x54')]=qs['filters'](_[_0x6665('0x55')](_0x1fa527[_0x6665('0x49')],_0x95dad3[_0x6665('0x4b')]));if(_0x1fa527['query']['filter']){_0x2c23c0['where']=_['merge'](_0x2c23c0['where'],{'$or':_['map'](_0x2c23c0['attributes'],function(_0x67a072){var _0x2807d1={};_0x2807d1[_0x67a072]={'$like':'%'+_0x1fa527['query'][_0x6665('0x56')]+'%'};return _0x2807d1;})});}_0x2c23c0=_[_0x6665('0x57')]({},_0x2c23c0,_0x1fa527['options']);return _0x286794[_0x6665('0xbf')](_0x2c23c0);}})['then'](function(_0x4c7648){if(_0x4c7648){_0x35963a=_0x4c7648['length'];if(!_0x1fa527[_0x6665('0x49')]['hasOwnProperty'](_0x6665('0x51'))){_0x2c23c0[_0x6665('0x33')]=qs[_0x6665('0x33')](_0x1fa527[_0x6665('0x49')][_0x6665('0x33')]);_0x2c23c0[_0x6665('0x31')]=qs[_0x6665('0x31')](_0x1fa527['query'][_0x6665('0x31')]);}return _0x286794[_0x6665('0xbf')](_0x2c23c0);}})['then'](function(_0x2a069f){if(_0x2a069f){return _0x2a069f?{'count':_0x35963a,'rows':_0x2a069f}:null;}})[_0x6665('0x3a')](respondWithResult(_0x4cc974,null))[_0x6665('0x2c')](handleError(_0x4cc974,null));}; \ No newline at end of file +var _0xd86e=['userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','FaxAccounts','UserProfileResource','end','name','send','index','mandatoryDispositionPause','FaxAccount','rawAttributes','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','includeAll','include','findAll','rows','show','params','Pause','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','Disposition','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','sequelize','Transaction','FaxApplication','destroy','findAndCountAll','priority','finally','getApplications','from-voip-provider','exten','app','system','description','appdata','push','Answer','Set','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','transaction','updatedAt','ListId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd86e,0xc0));var _0xed86=function(_0x56ee69,_0x5f5611){_0x56ee69=_0x56ee69-0x0;var _0x177437=_0xd86e[_0x56ee69];return _0x177437;};'use strict';var emlformat=require(_0xed86('0x0'));var rimraf=require(_0xed86('0x1'));var zipdir=require(_0xed86('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed86('0x3'));var moment=require('moment');var BPromise=require(_0xed86('0x4'));var Mustache=require('mustache');var util=require(_0xed86('0x5'));var path=require(_0xed86('0x6'));var sox=require('sox');var csv=require(_0xed86('0x7'));var ejs=require(_0xed86('0x8'));var fs=require('fs');var fs_extra=require(_0xed86('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xed86('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xed86('0xb'));var toCsv=require(_0xed86('0x7'));var querystring=require(_0xed86('0xc'));var Papa=require(_0xed86('0xd'));var Redis=require(_0xed86('0xe'));var authService=require(_0xed86('0xf'));var qs=require(_0xed86('0x10'));var as=require(_0xed86('0x11'));var hardwareService=require(_0xed86('0x12'));var logger=require('../../config/logger')(_0xed86('0x13'));var utils=require(_0xed86('0x14'));var config=require(_0xed86('0x15'));var licenseUtil=require(_0xed86('0x16'));var db=require(_0xed86('0x17'))['db'];config['redis']=_['defaults'](config[_0xed86('0x18')],{'host':_0xed86('0x19'),'port':0x18eb});var socket=require(_0xed86('0x1a'))(new Redis(config['redis']));require(_0xed86('0x1b'))['register'](socket);var jayson=require(_0xed86('0x1c'));var client=jayson['client'][_0xed86('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xed86('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5c4c56,_0x342fdf,_0x261ec8,_0x19a6c9){return new BPromise(function(_0x5f07b6,_0x4535c7){var _0x110b7a=_0x19a6c9||client;return _0x110b7a[_0xed86('0x1e')](_0x5c4c56,_0x261ec8)[_0xed86('0x1f')](function(_0x46f8a0){logger['info'](_0xed86('0x20'),_0x342fdf,_0xed86('0x21'));logger['debug'](_0xed86('0x22'),_0x342fdf,_0xed86('0x21'),JSON[_0xed86('0x23')](_0x46f8a0));if(_0x46f8a0[_0xed86('0x24')]){if(_0x46f8a0[_0xed86('0x24')][_0xed86('0x25')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x342fdf,_0x46f8a0[_0xed86('0x24')][_0xed86('0x26')]);return _0x4535c7(_0x46f8a0[_0xed86('0x24')][_0xed86('0x26')]);}logger[_0xed86('0x24')](_0xed86('0x20'),_0x342fdf,_0x46f8a0['error'][_0xed86('0x26')]);return _0x5f07b6(_0x46f8a0['error'][_0xed86('0x26')]);}else{logger[_0xed86('0x27')]('FaxAccount,\x20%s,\x20%s',_0x342fdf,'request\x20sent');_0x5f07b6(_0x46f8a0['result'][_0xed86('0x26')]);}})[_0xed86('0x28')](function(_0x35a20a){logger[_0xed86('0x24')]('FaxAccount,\x20%s,\x20%s',_0x342fdf,_0x35a20a);_0x4535c7(_0x35a20a);});});}function respondWithStatusCode(_0x2729a1,_0xc2bd30){_0xc2bd30=_0xc2bd30||0xcc;return function(_0x568714){if(_0x568714){return _0x2729a1[_0xed86('0x29')](_0xc2bd30);}return _0x2729a1[_0xed86('0x2a')](_0xc2bd30)['end']();};}function respondWithResult(_0x49ca67,_0x4e7fa4){_0x4e7fa4=_0x4e7fa4||0xc8;return function(_0x73365a){if(_0x73365a){return _0x49ca67[_0xed86('0x2a')](_0x4e7fa4)[_0xed86('0x2b')](_0x73365a);}};}function respondWithFilteredResult(_0x4ff8ed,_0x403d1e){return function(_0x33b535){if(_0x33b535){var _0x1885c=typeof _0x403d1e[_0xed86('0x2c')]===_0xed86('0x2d')&&typeof _0x403d1e[_0xed86('0x2e')]==='undefined';var _0x41b573=_0x33b535[_0xed86('0x2f')];var _0x187d18=_0x1885c?0x0:_0x403d1e[_0xed86('0x2c')];var _0x1699eb=_0x1885c?_0x33b535['count']:_0x403d1e[_0xed86('0x2c')]+_0x403d1e[_0xed86('0x2e')];var _0x4bee03;if(_0x1699eb>=_0x41b573){_0x1699eb=_0x41b573;_0x4bee03=0xc8;}else{_0x4bee03=0xce;}_0x4ff8ed[_0xed86('0x2a')](_0x4bee03);return _0x4ff8ed[_0xed86('0x30')](_0xed86('0x31'),_0x187d18+'-'+_0x1699eb+'/'+_0x41b573)[_0xed86('0x2b')](_0x33b535);}return null;};}function patchUpdates(_0x441241){return function(_0x53956d){try{jsonpatch['apply'](_0x53956d,_0x441241,!![]);}catch(_0x41a871){return BPromise[_0xed86('0x32')](_0x41a871);}return _0x53956d[_0xed86('0x33')]();};}function saveUpdates(_0x3beeb0,_0x30a8db){return function(_0x34f3f0){if(_0x34f3f0){return _0x34f3f0[_0xed86('0x34')](_0x3beeb0)[_0xed86('0x1f')](function(_0x177dc6){return _0x177dc6;});}return null;};}function removeEntity(_0x7b57f1,_0x3e0ec7){return function(_0x5c3f4c){if(_0x5c3f4c){return _0x5c3f4c['destroy']()['then'](function(){var _0x43bdca=_0x5c3f4c[_0xed86('0x35')]({'plain':!![]});var _0x204605=_0xed86('0x36');return db[_0xed86('0x37')]['destroy']({'where':{'type':_0x204605,'resourceId':_0x43bdca['id']}})[_0xed86('0x1f')](function(){return _0x5c3f4c;});})[_0xed86('0x1f')](function(){_0x7b57f1[_0xed86('0x2a')](0xcc)[_0xed86('0x38')]();});}};}function handleEntityNotFound(_0x4c5b92,_0x1f1b90){return function(_0x565ecd){if(!_0x565ecd){_0x4c5b92['sendStatus'](0x194);}return _0x565ecd;};}function handleError(_0x96d9b3,_0x1debc3){_0x1debc3=_0x1debc3||0x1f4;return function(_0x1e1701){logger[_0xed86('0x24')](_0x1e1701['stack']);if(_0x1e1701['name']){delete _0x1e1701[_0xed86('0x39')];}_0x96d9b3[_0xed86('0x2a')](_0x1debc3)[_0xed86('0x3a')](_0x1e1701);};}exports[_0xed86('0x3b')]=function(_0xa56c55,_0x22c4c0){var _0xc61cc1={'include':[{'model':db['Pause'],'as':_0xed86('0x3c')}]},_0x30ce68={},_0x5966cd={'count':0x0,'rows':[]};var _0x40e9c8=_['map'](db[_0xed86('0x3d')][_0xed86('0x3e')],function(_0xc575c){return{'name':_0xc575c['fieldName'],'type':_0xc575c[_0xed86('0x3f')][_0xed86('0x40')]};});_0x30ce68['model']=_['map'](_0x40e9c8,_0xed86('0x39'));_0x30ce68[_0xed86('0x41')]=_['keys'](_0xa56c55[_0xed86('0x41')]);_0x30ce68[_0xed86('0x42')]=_['intersection'](_0x30ce68[_0xed86('0x43')],_0x30ce68['query']);_0xc61cc1['attributes']=_[_0xed86('0x44')](_0x30ce68[_0xed86('0x43')],qs['fields'](_0xa56c55['query'][_0xed86('0x45')]));_0xc61cc1['attributes']=_0xc61cc1[_0xed86('0x46')][_0xed86('0x47')]?_0xc61cc1[_0xed86('0x46')]:_0x30ce68[_0xed86('0x43')];if(!_0xa56c55['query'][_0xed86('0x48')]('nolimit')){_0xc61cc1[_0xed86('0x2e')]=qs[_0xed86('0x2e')](_0xa56c55[_0xed86('0x41')][_0xed86('0x2e')]);_0xc61cc1[_0xed86('0x2c')]=qs['offset'](_0xa56c55['query'][_0xed86('0x2c')]);}_0xc61cc1[_0xed86('0x49')]=qs['sort'](_0xa56c55[_0xed86('0x41')][_0xed86('0x4a')]);_0xc61cc1[_0xed86('0x4b')]=qs[_0xed86('0x42')](_[_0xed86('0x4c')](_0xa56c55[_0xed86('0x41')],_0x30ce68[_0xed86('0x42')]),_0x40e9c8);if(_0xa56c55[_0xed86('0x41')][_0xed86('0x4d')]){_0xc61cc1[_0xed86('0x4b')]=_[_0xed86('0x4e')](_0xc61cc1[_0xed86('0x4b')],{'$or':_[_0xed86('0x4f')](_0x40e9c8,function(_0x5349b0){if(_0x5349b0[_0xed86('0x3f')]!=='VIRTUAL'){var _0x5bbc09={};_0x5bbc09[_0x5349b0[_0xed86('0x39')]]={'$like':'%'+_0xa56c55['query'][_0xed86('0x4d')]+'%'};return _0x5bbc09;}})});}_0xc61cc1=_[_0xed86('0x4e')]({},_0xc61cc1,_0xa56c55['options']);var _0x1f3233={'where':_0xc61cc1[_0xed86('0x4b')]};return db[_0xed86('0x3d')]['count'](_0x1f3233)[_0xed86('0x1f')](function(_0x1bb09c){_0x5966cd[_0xed86('0x2f')]=_0x1bb09c;if(_0xa56c55[_0xed86('0x41')][_0xed86('0x50')]){_0xc61cc1[_0xed86('0x51')]=[{'all':!![]}];}return db[_0xed86('0x3d')][_0xed86('0x52')](_0xc61cc1);})[_0xed86('0x1f')](function(_0x5ee638){_0x5966cd[_0xed86('0x53')]=_0x5ee638;return _0x5966cd;})[_0xed86('0x1f')](respondWithFilteredResult(_0x22c4c0,_0xc61cc1))[_0xed86('0x28')](handleError(_0x22c4c0,null));};exports[_0xed86('0x54')]=function(_0x13c304,_0x334485){var _0x125bff={'raw':![],'where':{'id':_0x13c304[_0xed86('0x55')]['id']},'include':[{'model':db[_0xed86('0x56')],'as':_0xed86('0x3c')}]},_0x37fe86={};_0x37fe86[_0xed86('0x43')]=_[_0xed86('0x57')](db[_0xed86('0x3d')][_0xed86('0x3e')]);_0x37fe86['query']=_[_0xed86('0x57')](_0x13c304[_0xed86('0x41')]);_0x37fe86[_0xed86('0x42')]=_['intersection'](_0x37fe86[_0xed86('0x43')],_0x37fe86[_0xed86('0x41')]);_0x125bff[_0xed86('0x46')]=_['intersection'](_0x37fe86[_0xed86('0x43')],qs[_0xed86('0x45')](_0x13c304['query'][_0xed86('0x45')]));_0x125bff[_0xed86('0x46')]=_0x125bff[_0xed86('0x46')][_0xed86('0x47')]?_0x125bff[_0xed86('0x46')]:_0x37fe86['model'];if(_0x13c304[_0xed86('0x41')][_0xed86('0x50')]){_0x125bff[_0xed86('0x51')]=[{'all':!![]}];}_0x125bff=_['merge']({},_0x125bff,_0x13c304[_0xed86('0x58')]);return db['FaxAccount'][_0xed86('0x59')](_0x125bff)['then'](handleEntityNotFound(_0x334485,null))[_0xed86('0x1f')](respondWithResult(_0x334485,null))[_0xed86('0x28')](handleError(_0x334485,null));};exports[_0xed86('0x5a')]=function(_0x5f2170,_0x23ab69){return db[_0xed86('0x3d')][_0xed86('0x5a')](_0x5f2170[_0xed86('0x5b')],{})[_0xed86('0x1f')](function(_0x1f1528){var _0x422665=_0x5f2170[_0xed86('0x5c')][_0xed86('0x35')]({'plain':!![]});if(!_0x422665)throw new Error(_0xed86('0x5d'));if(_0x422665[_0xed86('0x5e')]===_0xed86('0x5c')){var _0x356dea=_0x1f1528[_0xed86('0x35')]({'plain':!![]});var _0x44a5e0=_0xed86('0x36');return db[_0xed86('0x5f')][_0xed86('0x59')]({'where':{'name':_0x44a5e0,'userProfileId':_0x422665['userProfileId']},'raw':!![]})[_0xed86('0x1f')](function(_0x31ed75){if(_0x31ed75&&_0x31ed75[_0xed86('0x60')]===0x0){return db['UserProfileResource'][_0xed86('0x5a')]({'name':_0x356dea['name'],'resourceId':_0x356dea['id'],'type':_0x31ed75[_0xed86('0x39')],'sectionId':_0x31ed75['id']},{})['then'](function(){return _0x1f1528;});}else{return _0x1f1528;}})[_0xed86('0x28')](function(_0x3a214d){logger[_0xed86('0x24')](_0xed86('0x61'),_0x3a214d);throw _0x3a214d;});}return _0x1f1528;})[_0xed86('0x1f')](respondWithResult(_0x23ab69,0xc9))[_0xed86('0x28')](handleError(_0x23ab69,null));};exports[_0xed86('0x34')]=function(_0xca0f42,_0x5355a4){if(_0xca0f42['body']['id']){delete _0xca0f42['body']['id'];}return db[_0xed86('0x3d')][_0xed86('0x59')]({'where':{'id':_0xca0f42[_0xed86('0x55')]['id']},'include':[{'model':db[_0xed86('0x56')],'as':_0xed86('0x3c')}]})[_0xed86('0x1f')](handleEntityNotFound(_0x5355a4,null))[_0xed86('0x1f')](saveUpdates(_0xca0f42[_0xed86('0x5b')],null))[_0xed86('0x1f')](respondWithResult(_0x5355a4,null))[_0xed86('0x28')](handleError(_0x5355a4,null));};exports['destroy']=function(_0x10f85e,_0x740185){return db[_0xed86('0x3d')]['find']({'where':{'id':_0x10f85e[_0xed86('0x55')]['id']}})[_0xed86('0x1f')](handleEntityNotFound(_0x740185,null))[_0xed86('0x1f')](removeEntity(_0x740185,null))[_0xed86('0x28')](handleError(_0x740185,null));};exports[_0xed86('0x62')]=function(_0xd1adc9,_0x5900a2){return db[_0xed86('0x3d')][_0xed86('0x62')]()['then'](respondWithResult(_0x5900a2,null))[_0xed86('0x28')](handleError(_0x5900a2,null));};exports['addDisposition']=function(_0x334703,_0x9edc4e,_0x3eebc8){if(_0x334703[_0xed86('0x5b')]['id']){delete _0x334703[_0xed86('0x5b')]['id'];}return db[_0xed86('0x3d')][_0xed86('0x59')]({'where':{'id':_0x334703[_0xed86('0x55')]['id']}})['then'](handleEntityNotFound(_0x9edc4e,null))[_0xed86('0x1f')](function(_0x22f866){if(_0x22f866){_0x334703['body'][_0xed86('0x63')]=_0x22f866['id'];return db[_0xed86('0x64')][_0xed86('0x5a')](_0x334703[_0xed86('0x5b')]);}})[_0xed86('0x1f')](respondWithResult(_0x9edc4e,null))[_0xed86('0x28')](handleError(_0x9edc4e,null));};exports['getDispositions']=function(_0x875a8c,_0x355b81,_0x5f4829){var _0x5e943f={'raw':![],'where':{}};var _0x2774f3={};var _0x238065={'count':0x0,'rows':[]};return db[_0xed86('0x3d')]['findOne']({'where':{'id':_0x875a8c['params']['id']}})[_0xed86('0x1f')](handleEntityNotFound(_0x355b81,null))['then'](function(_0x2c587c){if(_0x2c587c){_0x2774f3['model']=_['keys'](db['Disposition'][_0xed86('0x3e')]);_0x2774f3[_0xed86('0x41')]=_[_0xed86('0x57')](_0x875a8c[_0xed86('0x41')]);_0x2774f3[_0xed86('0x42')]=_['intersection'](_0x2774f3[_0xed86('0x43')],_0x2774f3[_0xed86('0x41')]);_0x5e943f[_0xed86('0x46')]=_[_0xed86('0x44')](_0x2774f3['model'],qs[_0xed86('0x45')](_0x875a8c[_0xed86('0x41')][_0xed86('0x45')]));_0x5e943f['attributes']=_0x5e943f[_0xed86('0x46')][_0xed86('0x47')]?_0x5e943f[_0xed86('0x46')]:_0x2774f3[_0xed86('0x43')];if(!_0x875a8c[_0xed86('0x41')][_0xed86('0x48')](_0xed86('0x65'))){_0x5e943f[_0xed86('0x2e')]=qs['limit'](_0x875a8c['query'][_0xed86('0x2e')]);_0x5e943f[_0xed86('0x2c')]=qs[_0xed86('0x2c')](_0x875a8c[_0xed86('0x41')][_0xed86('0x2c')]);}_0x5e943f[_0xed86('0x49')]=qs['sort'](_0x875a8c[_0xed86('0x41')][_0xed86('0x4a')]);_0x5e943f[_0xed86('0x4b')]=qs[_0xed86('0x42')](_[_0xed86('0x4c')](_0x875a8c[_0xed86('0x41')],_0x2774f3[_0xed86('0x42')]));_0x5e943f[_0xed86('0x4b')]['FaxAccountId']=_0x2c587c['id'];if(_0x875a8c[_0xed86('0x41')][_0xed86('0x4d')]){_0x5e943f[_0xed86('0x4b')]=_[_0xed86('0x4e')](_0x5e943f[_0xed86('0x4b')],{'$or':_[_0xed86('0x4f')](_0x5e943f['attributes'],function(_0x4d5191){var _0xe7e898={};_0xe7e898[_0x4d5191]={'$like':'%'+_0x875a8c[_0xed86('0x41')][_0xed86('0x4d')]+'%'};return _0xe7e898;})});}_0x5e943f=_['merge']({},_0x5e943f,_0x875a8c['options']);return db[_0xed86('0x64')][_0xed86('0x2f')]({'where':_0x5e943f[_0xed86('0x4b')]})[_0xed86('0x1f')](function(_0x50e6aa){_0x238065['count']=_0x50e6aa;if(_0x875a8c[_0xed86('0x41')]['includeAll']){_0x5e943f[_0xed86('0x51')]=[{'all':!![]}];}return db[_0xed86('0x64')][_0xed86('0x52')](_0x5e943f);})['then'](function(_0x3d506d){_0x238065[_0xed86('0x53')]=_0x3d506d;return _0x238065;});}})[_0xed86('0x1f')](respondWithFilteredResult(_0x355b81,_0x5e943f))[_0xed86('0x28')](handleError(_0x355b81,null));};exports[_0xed86('0x66')]=function(_0x3abd1f,_0x148f7a,_0x21166e){return db[_0xed86('0x3d')][_0xed86('0x59')]({'where':{'id':_0x3abd1f['params']['id']}})[_0xed86('0x1f')](handleEntityNotFound(_0x148f7a,null))['then'](function(_0x1e455f){if(_0x1e455f){return _0x1e455f['removeDispositions'](_0x3abd1f['query'][_0xed86('0x67')]);}})[_0xed86('0x1f')](respondWithStatusCode(_0x148f7a,null))['catch'](handleError(_0x148f7a,null));};exports['addAnswer']=function(_0x596316,_0x5d60c1,_0x3080c7){if(_0x596316[_0xed86('0x5b')]['id']){delete _0x596316[_0xed86('0x5b')]['id'];}return db['FaxAccount'][_0xed86('0x59')]({'where':{'id':_0x596316[_0xed86('0x55')]['id']}})[_0xed86('0x1f')](handleEntityNotFound(_0x5d60c1,null))[_0xed86('0x1f')](function(_0x33cc2a){if(_0x33cc2a){_0x596316[_0xed86('0x5b')][_0xed86('0x63')]=_0x33cc2a['id'];return db[_0xed86('0x68')][_0xed86('0x5a')](_0x596316[_0xed86('0x5b')]);}})['then'](respondWithResult(_0x5d60c1,null))[_0xed86('0x28')](handleError(_0x5d60c1,null));};exports[_0xed86('0x69')]=function(_0x5c7684,_0x443b8f,_0x4aff33){var _0x4122ea={'raw':![],'where':{}};var _0x333a89={};var _0x38b5e7={'count':0x0,'rows':[]};return db[_0xed86('0x3d')][_0xed86('0x6a')]({'where':{'id':_0x5c7684[_0xed86('0x55')]['id']}})[_0xed86('0x1f')](handleEntityNotFound(_0x443b8f,null))[_0xed86('0x1f')](function(_0x49fa56){if(_0x49fa56){_0x333a89[_0xed86('0x43')]=_[_0xed86('0x57')](db[_0xed86('0x68')][_0xed86('0x3e')]);_0x333a89[_0xed86('0x41')]=_[_0xed86('0x57')](_0x5c7684[_0xed86('0x41')]);_0x333a89[_0xed86('0x42')]=_['intersection'](_0x333a89[_0xed86('0x43')],_0x333a89[_0xed86('0x41')]);_0x4122ea[_0xed86('0x46')]=_[_0xed86('0x44')](_0x333a89[_0xed86('0x43')],qs[_0xed86('0x45')](_0x5c7684[_0xed86('0x41')][_0xed86('0x45')]));_0x4122ea['attributes']=_0x4122ea[_0xed86('0x46')][_0xed86('0x47')]?_0x4122ea[_0xed86('0x46')]:_0x333a89[_0xed86('0x43')];if(!_0x5c7684[_0xed86('0x41')][_0xed86('0x48')]('nolimit')){_0x4122ea[_0xed86('0x2e')]=qs['limit'](_0x5c7684['query'][_0xed86('0x2e')]);_0x4122ea['offset']=qs[_0xed86('0x2c')](_0x5c7684[_0xed86('0x41')]['offset']);}_0x4122ea['order']=qs['sort'](_0x5c7684[_0xed86('0x41')][_0xed86('0x4a')]);_0x4122ea[_0xed86('0x4b')]=qs[_0xed86('0x42')](_['pick'](_0x5c7684[_0xed86('0x41')],_0x333a89[_0xed86('0x42')]));_0x4122ea[_0xed86('0x4b')][_0xed86('0x63')]=_0x49fa56['id'];if(_0x5c7684[_0xed86('0x41')]['filter']){_0x4122ea[_0xed86('0x4b')]=_[_0xed86('0x4e')](_0x4122ea[_0xed86('0x4b')],{'$or':_['map'](_0x4122ea['attributes'],function(_0x2087e1){var _0x4a8c25={};_0x4a8c25[_0x2087e1]={'$like':'%'+_0x5c7684[_0xed86('0x41')][_0xed86('0x4d')]+'%'};return _0x4a8c25;})});}_0x4122ea=_[_0xed86('0x4e')]({},_0x4122ea,_0x5c7684[_0xed86('0x58')]);return db[_0xed86('0x68')][_0xed86('0x2f')]({'where':_0x4122ea[_0xed86('0x4b')]})[_0xed86('0x1f')](function(_0x33b36b){_0x38b5e7[_0xed86('0x2f')]=_0x33b36b;if(_0x5c7684['query'][_0xed86('0x50')]){_0x4122ea[_0xed86('0x51')]=[{'all':!![]}];}return db['CannedAnswer'][_0xed86('0x52')](_0x4122ea);})[_0xed86('0x1f')](function(_0x5e6d15){_0x38b5e7['rows']=_0x5e6d15;return _0x38b5e7;});}})['then'](respondWithFilteredResult(_0x443b8f,_0x4122ea))['catch'](handleError(_0x443b8f,null));};exports[_0xed86('0x6b')]=function(_0x43770b,_0x51722d,_0x5a44d1){return db[_0xed86('0x3d')][_0xed86('0x59')]({'where':{'id':_0x43770b[_0xed86('0x55')]['id']}})['then'](handleEntityNotFound(_0x51722d,null))[_0xed86('0x1f')](function(_0x2088b2){if(_0x2088b2){return _0x2088b2[_0xed86('0x6b')](_0x43770b[_0xed86('0x41')][_0xed86('0x67')]);}})[_0xed86('0x1f')](respondWithStatusCode(_0x51722d,null))[_0xed86('0x28')](handleError(_0x51722d,null));};exports[_0xed86('0x6c')]=function(_0x405919,_0x358f4a,_0x5711d9){return db['FaxInteraction']['find']({'where':{'id':_0x405919[_0xed86('0x55')]['id']}})['then'](handleEntityNotFound(_0x358f4a,null))['then'](function(_0xba2c88){if(_0xba2c88){return _0xba2c88[_0xed86('0x6c')](_0x405919[_0xed86('0x5b')]['ids'],_[_0xed86('0x6d')](_0x405919['body'],['ids','id'])||{});}})[_0xed86('0x1f')](respondWithResult(_0x358f4a,null))[_0xed86('0x28')](handleError(_0x358f4a,null));};exports[_0xed86('0x6e')]=function(_0x3f342f,_0x15004c,_0x479748){var _0x415632={'raw':![],'where':{}};var _0x5f151d={};var _0x52c135={'count':0x0,'rows':[]};return db[_0xed86('0x3d')][_0xed86('0x6a')]({'where':{'id':_0x3f342f[_0xed86('0x55')]['id']}})[_0xed86('0x1f')](handleEntityNotFound(_0x15004c,null))[_0xed86('0x1f')](function(_0x128a84){if(_0x128a84){_0x5f151d['model']=_['keys'](db[_0xed86('0x6f')][_0xed86('0x3e')]);_0x5f151d[_0xed86('0x41')]=_[_0xed86('0x57')](_0x3f342f[_0xed86('0x41')]);_0x5f151d[_0xed86('0x42')]=_[_0xed86('0x44')](_0x5f151d[_0xed86('0x43')],_0x5f151d['query']);_0x415632[_0xed86('0x46')]=_[_0xed86('0x44')](_0x5f151d['model'],qs[_0xed86('0x45')](_0x3f342f[_0xed86('0x41')][_0xed86('0x45')]));_0x415632['attributes']=_0x415632[_0xed86('0x46')][_0xed86('0x47')]?_0x415632[_0xed86('0x46')]:_0x5f151d[_0xed86('0x43')];if(!_0x3f342f[_0xed86('0x41')]['hasOwnProperty'](_0xed86('0x65'))){_0x415632[_0xed86('0x2e')]=qs['limit'](_0x3f342f[_0xed86('0x41')][_0xed86('0x2e')]);_0x415632[_0xed86('0x2c')]=qs[_0xed86('0x2c')](_0x3f342f[_0xed86('0x41')][_0xed86('0x2c')]);}_0x415632[_0xed86('0x49')]=qs[_0xed86('0x4a')](_0x3f342f[_0xed86('0x41')][_0xed86('0x4a')]);_0x415632[_0xed86('0x4b')]=qs[_0xed86('0x42')](_[_0xed86('0x4c')](_0x3f342f['query'],_0x5f151d[_0xed86('0x42')]));_0x415632[_0xed86('0x4b')][_0xed86('0x63')]=_0x128a84['id'];if(_0x3f342f[_0xed86('0x41')][_0xed86('0x4d')]){_0x415632[_0xed86('0x4b')]=_[_0xed86('0x4e')](_0x415632[_0xed86('0x4b')],{'$or':_['map'](_0x415632[_0xed86('0x46')],function(_0x289f9b){var _0x3edcd4={};_0x3edcd4[_0x289f9b]={'$like':'%'+_0x3f342f[_0xed86('0x41')][_0xed86('0x4d')]+'%'};return _0x3edcd4;})});}_0x415632=_[_0xed86('0x4e')]({},_0x415632,_0x3f342f[_0xed86('0x58')]);return db[_0xed86('0x6f')][_0xed86('0x2f')]({'where':_0x415632[_0xed86('0x4b')]})[_0xed86('0x1f')](function(_0x192f1c){_0x52c135[_0xed86('0x2f')]=_0x192f1c;if(_0x3f342f[_0xed86('0x41')][_0xed86('0x50')]){_0x415632[_0xed86('0x51')]=[{'model':db[_0xed86('0x70')],'as':_0xed86('0x71'),'required':![]},{'model':db[_0xed86('0x72')],'as':_0xed86('0x73'),'attributes':['name',_0xed86('0x74'),_0xed86('0x75')],'required':![]},{'model':db[_0xed86('0x76')],'as':'Tags','attributes':['id','name',_0xed86('0x77')],'where':_0x3f342f[_0xed86('0x41')][_0xed86('0x78')]?{'id':_0x3f342f[_0xed86('0x41')]['tag']}:undefined,'required':_0x3f342f[_0xed86('0x41')][_0xed86('0x78')]?!![]:![]}];}return db[_0xed86('0x6f')]['findAll'](_0x415632);})[_0xed86('0x1f')](function(_0x54d3f9){_0x52c135[_0xed86('0x53')]=_0x54d3f9;return _0x52c135;});}})[_0xed86('0x1f')](respondWithFilteredResult(_0x15004c,_0x415632))['catch'](handleError(_0x15004c,null));};exports['addApplications']=function(_0x242518,_0x304c61){var _0x3851c4=_0x242518[_0xed86('0x55')]['id'];var _0x50431c=_0x242518['body'];var _0x469907=0xc8;var _0x8c77db=null;return db[_0xed86('0x79')]['transaction']({'isolationLevel':db['sequelize'][_0xed86('0x7a')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x35124d){return db[_0xed86('0x3d')][_0xed86('0x6a')]({'where':{'id':_0x3851c4},'transaction':_0x35124d})[_0xed86('0x1f')](function(_0x40a166){if(_0x40a166){return db[_0xed86('0x7b')][_0xed86('0x7c')]({'where':{'FaxAccountId':_0x3851c4},'transaction':_0x35124d})[_0xed86('0x1f')](function(){var _0x2b5ff6=_[_0xed86('0x4f')](_0x50431c,function(_0x2de9f4){_0x2de9f4[_0xed86('0x63')]=_0x3851c4;return _0x2de9f4;});return db[_0xed86('0x7b')]['bulkCreate'](_0x2b5ff6,{'transaction':_0x35124d});});}else{_0x469907=0x194;_0x8c77db=[];}});})[_0xed86('0x1f')](function(){if(_0x469907!==0x194){return db['FaxApplication'][_0xed86('0x7d')]({'where':{'FaxAccountId':_0x3851c4},'order':_0xed86('0x7e')})['then'](function(_0x29d506){_0x8c77db=_0x29d506;});}})[_0xed86('0x28')](function(_0x42d3bd){_0x469907=0x1f4;logger[_0xed86('0x24')](_0x42d3bd['stack']);if(_0x42d3bd[_0xed86('0x39')]){delete _0x42d3bd[_0xed86('0x39')];}_0x8c77db=_0x42d3bd;})[_0xed86('0x7f')](function(){if(_0x8c77db===null){_0x304c61['sendStatus'](_0x469907);}else{if(_0x469907===0x1f4){_0x304c61[_0xed86('0x2a')](_0x469907)['send'](_0x8c77db);}else{_0x304c61['status'](_0x469907)[_0xed86('0x2b')](_0x8c77db);}}});};exports[_0xed86('0x80')]=function(_0x9534d3,_0x5ca082,_0x3ae524){var _0x149533={};var _0x303525={};var _0x2b749d;var _0x280571;return db[_0xed86('0x3d')][_0xed86('0x6a')]({'where':{'id':_0x9534d3[_0xed86('0x55')]['id']}})[_0xed86('0x1f')](handleEntityNotFound(_0x5ca082,null))['then'](function(_0x341a61){if(_0x341a61){_0x2b749d=_0x341a61;_0x303525['model']=_[_0xed86('0x57')](db[_0xed86('0x7b')][_0xed86('0x3e')]);_0x303525[_0xed86('0x41')]=_['keys'](_0x9534d3['query']);_0x303525['filters']=_[_0xed86('0x44')](_0x303525['model'],_0x303525[_0xed86('0x41')]);_0x149533['attributes']=_[_0xed86('0x44')](_0x303525[_0xed86('0x43')],qs[_0xed86('0x45')](_0x9534d3[_0xed86('0x41')]['fields']));_0x149533[_0xed86('0x46')]=_0x149533[_0xed86('0x46')][_0xed86('0x47')]?_0x149533[_0xed86('0x46')]:_0x303525[_0xed86('0x43')];_0x149533[_0xed86('0x49')]=qs[_0xed86('0x4a')](_0x9534d3[_0xed86('0x41')][_0xed86('0x4a')]);_0x149533['where']=qs['filters'](_['pick'](_0x9534d3['query'],_0x303525[_0xed86('0x42')]));if(_0x9534d3[_0xed86('0x41')][_0xed86('0x4d')]){_0x149533[_0xed86('0x4b')]=_[_0xed86('0x4e')](_0x149533['where'],{'$or':_[_0xed86('0x4f')](_0x149533[_0xed86('0x46')],function(_0x40f3bf){var _0x4611e5={};_0x4611e5[_0x40f3bf]={'$like':'%'+_0x9534d3[_0xed86('0x41')][_0xed86('0x4d')]+'%'};return _0x4611e5;})});}_0x149533=_[_0xed86('0x4e')]({},_0x149533,_0x9534d3[_0xed86('0x58')]);return _0x2b749d['getApplications'](_0x149533);}})[_0xed86('0x1f')](function(_0x347844){if(_0x347844){_0x280571=_0x347844[_0xed86('0x47')];if(!_0x9534d3[_0xed86('0x41')][_0xed86('0x48')]('nolimit')){_0x149533['limit']=qs['limit'](_0x9534d3[_0xed86('0x41')][_0xed86('0x2e')]);_0x149533[_0xed86('0x2c')]=qs['offset'](_0x9534d3[_0xed86('0x41')][_0xed86('0x2c')]);}return _0x2b749d[_0xed86('0x80')](_0x149533);}})[_0xed86('0x1f')](function(_0x58526c){if(_0x58526c){return _0x58526c?{'count':_0x280571,'rows':_0x58526c}:null;}})[_0xed86('0x1f')](respondWithResult(_0x5ca082,null))[_0xed86('0x28')](handleError(_0x5ca082,null));};function Extension(_0x211ba5,_0x21038f,_0x43c52e,_0x8ccae4){this['context']=_0xed86('0x81');this[_0xed86('0x82')]=_0x211ba5['localstationid'];this[_0xed86('0x83')]=_0x8ccae4;this[_0xed86('0x3f')]=_0xed86('0x84');this[_0xed86('0x85')]='Fax\x20Extension';this[_0xed86('0x63')]=_0x211ba5['id'];this['priority']=_0x21038f;this[_0xed86('0x86')]=_0x43c52e;}function createExtensionsReciveFax(_0x40492f){var _0x238903=0x1;var _0x4fb398=[];_0x4fb398[_0xed86('0x87')](new Extension(_0x40492f,_0x238903,'',_0xed86('0x88')));_0x238903+=0x1;_0x4fb398[_0xed86('0x87')](new Extension(_0x40492f,_0x238903,'CDR(type)=inbound-fax',_0xed86('0x89')));_0x238903+=0x1;for(var _0x19e162 in _0x40492f){if(_0x40492f[_0xed86('0x48')](_0x19e162)&&(_0x19e162==='ecm'||_0x19e162==='localstationid'||_0x19e162===_0xed86('0x8a')||_0x19e162===_0xed86('0x8b')||_0x19e162===_0xed86('0x8c')||_0x19e162===_0xed86('0x8d')||_0x19e162===_0xed86('0x8e')||_0x19e162==='modem'||_0x19e162===_0xed86('0x8f'))){_0x4fb398[_0xed86('0x87')](new Extension(_0x40492f,_0x238903,_0xed86('0x90')+_0x19e162+')='+_0x40492f[_0x19e162],_0xed86('0x89')));_0x238903+=0x1;}}_0x4fb398[_0xed86('0x87')](new Extension(_0x40492f,_0x238903,'6',_0xed86('0x91')));_0x238903+=0x1;_0x4fb398[_0xed86('0x87')](new Extension(_0x40492f,_0x238903,_0xed86('0x92'),'ReceiveFax'));_0x238903=0x0;return _0x4fb398;}exports[_0xed86('0x93')]=function(_0xc94b22,_0x29413f,_0xd90e0e){var _0x1aa2e3;return db[_0xed86('0x79')]['transaction'](function(_0x20cc6a){return db[_0xed86('0x3d')][_0xed86('0x5a')](_0xc94b22['body'],{'transaction':_0x20cc6a})['then'](function(_0x5e8390){_0x1aa2e3=_0x5e8390[_0xed86('0x35')]({'plain':!![]});return db[_0xed86('0x94')][_0xed86('0x95')](createExtensionsReciveFax(_0x1aa2e3),{'transaction':_0x20cc6a});});})[_0xed86('0x1f')](function(){return _0x1aa2e3;})[_0xed86('0x1f')](respondWithResult(_0x29413f,null))['catch'](handleError(_0x29413f,null));};exports[_0xed86('0x96')]=function(_0x12730f,_0x188c6c,_0x3e58bc){var _0x565614;return db[_0xed86('0x79')][_0xed86('0x97')](function(_0x131d21){return db[_0xed86('0x3d')][_0xed86('0x34')](_0x12730f[_0xed86('0x5b')],{'where':{'id':_0x12730f[_0xed86('0x5b')]['id']},'transaction':_0x131d21})[_0xed86('0x1f')](function(_0x407e5e){return db[_0xed86('0x94')][_0xed86('0x7c')]({'where':{'FaxAccountId':_0x12730f['body']['id']},'transaction':_0x131d21})[_0xed86('0x1f')](function(_0x18e9e9){return db['VoiceExtension'][_0xed86('0x95')](createExtensionsReciveFax(_[_0xed86('0x6d')](_0x12730f[_0xed86('0x5b')],['tech','key','createdAt',_0xed86('0x98'),'TrunkId',_0xed86('0x99')])),{'transaction':_0x131d21});});});})[_0xed86('0x1f')](function(){return db[_0xed86('0x3d')]['findById'](_0x12730f[_0xed86('0x5b')]['id']);})[_0xed86('0x1f')](respondWithResult(_0x188c6c,null))['catch'](handleError(_0x188c6c,null));};exports[_0xed86('0x9a')]=function(_0xd75b9e,_0x4c12b5,_0x1c63cf){var _0x5ae6ba={'raw':!![],'where':{}};var _0x3fee2b={};var _0x2d1b3b={'count':0x0,'rows':[]};return db[_0xed86('0x3d')][_0xed86('0x6a')]({'where':{'id':_0xd75b9e[_0xed86('0x55')]['id']}})[_0xed86('0x1f')](handleEntityNotFound(_0x4c12b5,null))['then'](function(_0x21b8c9){if(_0x21b8c9){_0x3fee2b[_0xed86('0x43')]=_['keys'](db[_0xed86('0x9b')][_0xed86('0x3e')]);_0x3fee2b[_0xed86('0x41')]=_[_0xed86('0x57')](_0xd75b9e[_0xed86('0x41')]);_0x3fee2b[_0xed86('0x42')]=_[_0xed86('0x44')](_0x3fee2b[_0xed86('0x43')],_0x3fee2b[_0xed86('0x41')]);_0x5ae6ba[_0xed86('0x46')]=_['intersection'](_0x3fee2b[_0xed86('0x43')],qs[_0xed86('0x45')](_0xd75b9e[_0xed86('0x41')][_0xed86('0x45')]));_0x5ae6ba[_0xed86('0x46')]=_0x5ae6ba[_0xed86('0x46')]['length']?_0x5ae6ba['attributes']:_0x3fee2b[_0xed86('0x43')];if(!_0xd75b9e[_0xed86('0x41')][_0xed86('0x48')]('nolimit')){_0x5ae6ba[_0xed86('0x2e')]=qs[_0xed86('0x2e')](_0xd75b9e['query']['limit']);_0x5ae6ba[_0xed86('0x2c')]=qs[_0xed86('0x2c')](_0xd75b9e['query'][_0xed86('0x2c')]);}_0x5ae6ba['order']=qs[_0xed86('0x4a')](_0xd75b9e[_0xed86('0x41')][_0xed86('0x4a')]);_0x5ae6ba[_0xed86('0x4b')]=qs[_0xed86('0x42')](_[_0xed86('0x4c')](_0xd75b9e[_0xed86('0x41')],_0x3fee2b[_0xed86('0x42')]));_0x5ae6ba[_0xed86('0x4b')][_0xed86('0x63')]=_0x21b8c9['id'];if(_0xd75b9e[_0xed86('0x41')]['filter']){_0x5ae6ba['where']=_[_0xed86('0x4e')](_0x5ae6ba['where'],{'$or':_['map'](_0x5ae6ba[_0xed86('0x46')],function(_0x495a2d){var _0x4099a2={};_0x4099a2[_0x495a2d]={'$like':'%'+_0xd75b9e[_0xed86('0x41')][_0xed86('0x4d')]+'%'};return _0x4099a2;})});}if(_0xd75b9e['query'][_0xed86('0x9c')]){var _0xa8b27d=_0xd75b9e[_0xed86('0x41')][_0xed86('0x9c')][_0xed86('0x9d')](',');var _0x330c02={};_0x330c02[_0xa8b27d[0x0]]={'$gte':moment(_0xa8b27d[0x1])[_0xed86('0x9e')](_0xed86('0x9f'))};_0x5ae6ba['where']=_[_0xed86('0x4e')](_0x5ae6ba[_0xed86('0x4b')],_0x330c02);}_0x5ae6ba=_[_0xed86('0x4e')]({},_0x5ae6ba,_0xd75b9e['options']);return db['FaxMessage'][_0xed86('0x2f')]({'where':_0x5ae6ba[_0xed86('0x4b')]})[_0xed86('0x1f')](function(_0x1dd48d){_0x2d1b3b[_0xed86('0x2f')]=_0x1dd48d;if(_0xd75b9e[_0xed86('0x41')][_0xed86('0x50')]){_0x5ae6ba[_0xed86('0x51')]=[{'all':!![]}];}return db[_0xed86('0x9b')]['findAll'](_0x5ae6ba);})['then'](function(_0x3d32ec){_0x2d1b3b[_0xed86('0x53')]=_0x3d32ec;return _0x2d1b3b;});}})[_0xed86('0x1f')](respondWithFilteredResult(_0x4c12b5,_0x5ae6ba))[_0xed86('0x28')](handleError(_0x4c12b5,null));};exports[_0xed86('0x3a')]=function(_0x23904c,_0x4b1a9d,_0x580aac){var _0x2b7d03,_0x33959d={},_0x4f22db;if(_0x23904c[_0xed86('0x5b')]['to']){_0x4f22db=_0x23904c[_0xed86('0x5b')]['to'][0x0];}return db[_0xed86('0x3d')]['find']({'where':{'id':_0x23904c[_0xed86('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0xed86('0xa0'),'include':[{'model':db[_0xed86('0x70')],'as':_0xed86('0xa1'),'where':{'fax':_0x4f22db},'limit':0x1,'order':[[_0xed86('0x98'),_0xed86('0xa2')]]}]}]})[_0xed86('0x1f')](handleEntityNotFound(_0x4b1a9d,null))[_0xed86('0x1f')](function(_0x1825fc){_0x2b7d03=_0x1825fc;if(_0x23904c[_0xed86('0x5b')][_0xed86('0xa3')]&&_0x23904c[_0xed86('0x5b')][_0xed86('0xa3')][_0xed86('0x47')]){for(var _0x636f1e=0x0;_0x636f1e<_0x23904c[_0xed86('0x5b')][_0xed86('0xa3')][_0xed86('0x47')];_0x636f1e+=0x1){_0x23904c[_0xed86('0x5b')][_0xed86('0xa3')][_0x636f1e]={'filename':_0x23904c[_0xed86('0x5b')][_0xed86('0xa3')][_0x636f1e][_0xed86('0x39')],'id':_0x23904c[_0xed86('0x5b')][_0xed86('0xa3')][_0x636f1e]['id'],'path':path[_0xed86('0xa4')](config[_0xed86('0xa5')],_0xed86('0xa6'),_0x23904c['body'][_0xed86('0xa3')][_0x636f1e][_0xed86('0xa7')])};}}return respondWithRpcPromise('CheckAfterSend',_0xed86('0xa8'),{'FaxAccountId':_[_0xed86('0xa9')](_0x23904c[_0xed86('0x55')]['id'])?undefined:_0x23904c[_0xed86('0x55')]['id'],'path':_[_0xed86('0xa9')](_0x23904c[_0xed86('0x5b')][_0xed86('0xa3')][0x0][_0xed86('0x6')])?undefined:_0x23904c['body']['attachments'][0x0][_0xed86('0x6')],'fax':_[_0xed86('0xa9')](_0x23904c[_0xed86('0x5b')]['to'][0x0])?undefined:_0x23904c['body']['to'][0x0]},client9002);})['then'](function(){if(_0x2b7d03){if(_[_0xed86('0xa9')](_0x23904c[_0xed86('0x5b')]['from'])){_0x23904c[_0xed86('0x5b')][_0xed86('0xaa')]=util[_0xed86('0x9e')](_0xed86('0xab'),_0x2b7d03['name'],_0x2b7d03[_0xed86('0xac')]);}if(_0x2b7d03[_0xed86('0xa0')]){if(_0x2b7d03[_0xed86('0xa0')][_0xed86('0xa1')][_0xed86('0x47')]){return _0x2b7d03[_0xed86('0xa0')][_0xed86('0xa1')][0x0];}else{return db[_0xed86('0x70')]['create'](_[_0xed86('0xad')](_0x23904c[_0xed86('0x5b')],{'firstName':_0x23904c['body']['to'][0x0],'phone':_0x23904c[_0xed86('0x5b')]['to'][0x0],'fax':_0x23904c[_0xed86('0x5b')]['to'][0x0],'ListId':_0x2b7d03[_0xed86('0x99')]}));}}else{throw new Error(_0xed86('0xae'));}}else{throw new Error(_0xed86('0xaf'));}})[_0xed86('0x1f')](function(_0x438f4f){if(_0x438f4f){return db[_0xed86('0x6f')]['find']({'where':{'ContactId':_0x438f4f['id'],'closed':![],'FaxAccountId':_0x2b7d03['id']}})[_0xed86('0x1f')](function(_0x1f0b14){if(_0x1f0b14){return[_0x1f0b14,![]];}return db[_0xed86('0x6f')][_0xed86('0x5a')]({'UserId':_0x23904c[_0xed86('0x5c')]['id'],'ContactId':_0x438f4f['id'],'FaxAccountId':_0x2b7d03['id'],'fax':_0x23904c[_0xed86('0x5b')]['to'][0x0],'firstMsgDirection':_0xed86('0xb0'),'Messages':[_['merge'](_0x23904c[_0xed86('0x5b')],{'read':![],'body':_0x23904c[_0xed86('0x5b')]['attachments'][0x0]['filename'],'FaxAccountId':_0x2b7d03['id'],'UserId':_0x23904c[_0xed86('0x5c')]['id'],'ContactId':_0x438f4f['id'],'AttachmentId':_0x23904c[_0xed86('0x5b')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xed86('0x9b')],'as':_0xed86('0xb1')}]})['then'](function(_0x70a9b0){return[_0x70a9b0,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xed86('0xb2')](function(_0x184ea3,_0x3894f4){if(_0x3894f4){return _0x184ea3;}return db[_0xed86('0x9b')]['create']({'direction':_0xed86('0xb0'),'read':![],'body':_0x23904c['body']['attachments'][0x0]['filename'],'FaxAccountId':_0x2b7d03['id'],'FaxInteractionId':_0x184ea3['id'],'UserId':_0x23904c['user']['id'],'ContactId':_0x184ea3[_0xed86('0xb3')],'AttachmentId':_0x23904c[_0xed86('0x5b')][_0xed86('0xa3')][0x0]['id']})['then'](function(_0x3edc82){_0x184ea3[_0xed86('0xb4')]['Messages']=[];_0x184ea3[_0xed86('0xb4')][_0xed86('0xb1')][_0xed86('0x87')](_0x3edc82[_0xed86('0xb4')]);return _0x184ea3;});})[_0xed86('0x1f')](function(_0x9a97e7){respondWithRpcPromise(_0xed86('0xb5'),_0xed86('0xb5'),{'FaxAccountId':_[_0xed86('0xa9')](_0x23904c[_0xed86('0x55')]['id'])?undefined:_0x23904c[_0xed86('0x55')]['id'],'path':_[_0xed86('0xa9')](_0x23904c[_0xed86('0x5b')][_0xed86('0xa3')][0x0][_0xed86('0x6')])?undefined:_0x23904c[_0xed86('0x5b')][_0xed86('0xa3')][0x0]['path'],'fax':_['isNil'](_0x23904c['body']['to'][0x0])?undefined:_0x23904c[_0xed86('0x5b')]['to'][0x0],'AttachmentId':_0x23904c[_0xed86('0x5b')][_0xed86('0xa3')][0x0]['id']},client9002)[_0xed86('0x1f')](function(_0x4ff3f7){logger[_0xed86('0x27')](_0xed86('0xb6'),_0x4ff3f7);})[_0xed86('0x28')](function(_0x48602c){logger[_0xed86('0x27')](_0xed86('0xb6'),_0x48602c);});return _0x9a97e7;})[_0xed86('0x1f')](respondWithResult(_0x4b1a9d,null))[_0xed86('0x28')](handleError(_0x4b1a9d,null));};exports['addAgents']=function(_0x52f6c7,_0x7a9119,_0x4b9ef3){return db['FaxAccount'][_0xed86('0x59')]({'where':{'id':_0x52f6c7[_0xed86('0x55')]['id']}})['then'](handleEntityNotFound(_0x7a9119,null))[_0xed86('0x1f')](function(_0x74bb87){if(_0x74bb87){return _0x74bb87[_0xed86('0xb7')](_0x52f6c7[_0xed86('0x5b')][_0xed86('0x67')],_[_0xed86('0x6d')](_0x52f6c7[_0xed86('0x5b')],[_0xed86('0x67'),'id'])||{})[_0xed86('0xb2')](function(_0x4ef3fc){for(var _0x4baeda=0x0;_0x4baeda<_0x52f6c7[_0xed86('0x5b')]['ids']['length'];_0x4baeda+=0x1){socket[_0xed86('0xb8')](_0xed86('0xb9'),{'UserId':Number(_0x52f6c7[_0xed86('0x5b')][_0xed86('0x67')][_0x4baeda]),'FaxAccountId':Number(_0x52f6c7[_0xed86('0x55')]['id'])});}return _0x4ef3fc;});}})['then'](respondWithResult(_0x7a9119,null))[_0xed86('0x28')](handleError(_0x7a9119,null));};exports['removeAgents']=function(_0x1b3cdc,_0x2b087b,_0x31456c){return db['FaxAccount']['find']({'where':{'id':_0x1b3cdc[_0xed86('0x55')]['id']}})[_0xed86('0x1f')](handleEntityNotFound(_0x2b087b,null))[_0xed86('0x1f')](function(_0x5dc0ac){if(_0x5dc0ac){return _0x5dc0ac[_0xed86('0xba')](_0x1b3cdc[_0xed86('0x41')][_0xed86('0x67')])[_0xed86('0x1f')](function(){if(_[_0xed86('0xbb')](_0x1b3cdc[_0xed86('0x41')][_0xed86('0x67')])){for(var _0x25c732=0x0;_0x25c732<_0x1b3cdc[_0xed86('0x41')]['ids'][_0xed86('0x47')];_0x25c732+=0x1){socket['emit'](_0xed86('0xbc'),{'UserId':Number(_0x1b3cdc['query'][_0xed86('0x67')][_0x25c732]),'FaxAccountId':Number(_0x1b3cdc[_0xed86('0x55')]['id'])});}}else{socket[_0xed86('0xb8')](_0xed86('0xbc'),{'UserId':Number(_0x1b3cdc[_0xed86('0x41')][_0xed86('0x67')]),'FaxAccountId':Number(_0x1b3cdc['params']['id'])});}});}})[_0xed86('0x1f')](respondWithStatusCode(_0x2b087b,null))[_0xed86('0x28')](handleError(_0x2b087b,null));};exports[_0xed86('0xbd')]=function(_0x3a4303,_0xeca71d,_0x40346d){var _0x221cb5={};var _0xbd60a0={};var _0x2990d8;var _0x264105;return db[_0xed86('0x3d')]['findOne']({'where':{'id':_0x3a4303[_0xed86('0x55')]['id']}})[_0xed86('0x1f')](handleEntityNotFound(_0xeca71d,null))[_0xed86('0x1f')](function(_0x2f97c5){if(_0x2f97c5){_0x2990d8=_0x2f97c5;_0xbd60a0[_0xed86('0x43')]=_[_0xed86('0x57')](db['User'][_0xed86('0x3e')]);_0xbd60a0[_0xed86('0x41')]=_[_0xed86('0x57')](_0x3a4303[_0xed86('0x41')]);_0xbd60a0[_0xed86('0x42')]=_['intersection'](_0xbd60a0[_0xed86('0x43')],_0xbd60a0[_0xed86('0x41')]);_0x221cb5[_0xed86('0x46')]=_[_0xed86('0x44')](_0xbd60a0[_0xed86('0x43')],qs[_0xed86('0x45')](_0x3a4303[_0xed86('0x41')]['fields']));_0x221cb5['attributes']=_0x221cb5[_0xed86('0x46')]['length']?_0x221cb5[_0xed86('0x46')]:_0xbd60a0[_0xed86('0x43')];_0x221cb5[_0xed86('0x49')]=qs[_0xed86('0x4a')](_0x3a4303['query'][_0xed86('0x4a')]);_0x221cb5[_0xed86('0x4b')]=qs['filters'](_[_0xed86('0x4c')](_0x3a4303['query'],_0xbd60a0[_0xed86('0x42')]));if(_0x3a4303[_0xed86('0x41')][_0xed86('0x4d')]){_0x221cb5[_0xed86('0x4b')]=_[_0xed86('0x4e')](_0x221cb5[_0xed86('0x4b')],{'$or':_['map'](_0x221cb5['attributes'],function(_0x568e59){var _0x12e040={};_0x12e040[_0x568e59]={'$like':'%'+_0x3a4303[_0xed86('0x41')][_0xed86('0x4d')]+'%'};return _0x12e040;})});}_0x221cb5=_['merge']({},_0x221cb5,_0x3a4303[_0xed86('0x58')]);return _0x2990d8[_0xed86('0xbd')](_0x221cb5);}})[_0xed86('0x1f')](function(_0x571c18){if(_0x571c18){_0x264105=_0x571c18[_0xed86('0x47')];if(!_0x3a4303[_0xed86('0x41')][_0xed86('0x48')]('nolimit')){_0x221cb5[_0xed86('0x2e')]=qs[_0xed86('0x2e')](_0x3a4303[_0xed86('0x41')][_0xed86('0x2e')]);_0x221cb5[_0xed86('0x2c')]=qs[_0xed86('0x2c')](_0x3a4303[_0xed86('0x41')][_0xed86('0x2c')]);}return _0x2990d8[_0xed86('0xbd')](_0x221cb5);}})['then'](function(_0x7f02d5){if(_0x7f02d5){return _0x7f02d5?{'count':_0x264105,'rows':_0x7f02d5}:null;}})[_0xed86('0x1f')](respondWithResult(_0xeca71d,null))['catch'](handleError(_0xeca71d,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 7654ecf..ebc8b92 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 _0x13e6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount'];(function(_0x29e45f,_0x4df0ac){var _0x1c45c2=function(_0x3c0704){while(--_0x3c0704){_0x29e45f['push'](_0x29e45f['shift']());}};_0x1c45c2(++_0x4df0ac);}(_0x13e6,0xce));var _0x613e=function(_0x41f711,_0x33bc13){_0x41f711=_0x41f711-0x0;var _0x2c56b5=_0x13e6[_0x41f711];return _0x2c56b5;};'use strict';var EventEmitter=require(_0x613e('0x0'));var FaxAccount=require(_0x613e('0x1'))['db'][_0x613e('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x613e('0x3')](0x0);var events={'afterCreate':_0x613e('0x4'),'afterUpdate':_0x613e('0x5'),'afterDestroy':_0x613e('0x6')};function emitEvent(_0x2fbb84){return function(_0x4eed1b,_0x5ce9d5,_0x149cc0){FaxAccountEvents[_0x613e('0x7')](_0x2fbb84+':'+_0x4eed1b['id'],_0x4eed1b);FaxAccountEvents['emit'](_0x2fbb84,_0x4eed1b);_0x149cc0(null);};}for(var e in events){if(events[_0x613e('0x8')](e)){var event=events[e];FaxAccount[_0x613e('0x9')](e,emitEvent(event));}}module[_0x613e('0xa')]=FaxAccountEvents; \ No newline at end of file +var _0x2356=['hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','update','hasOwnProperty'];(function(_0x509867,_0x3a0aa5){var _0x1e4f5f=function(_0x1d44f7){while(--_0x1d44f7){_0x509867['push'](_0x509867['shift']());}};_0x1e4f5f(++_0x3a0aa5);}(_0x2356,0x1ea));var _0x6235=function(_0xf17d71,_0x3bbe72){_0xf17d71=_0xf17d71-0x0;var _0x2502f3=_0x2356[_0xf17d71];return _0x2502f3;};'use strict';var EventEmitter=require(_0x6235('0x0'));var FaxAccount=require(_0x6235('0x1'))['db'][_0x6235('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6235('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6235('0x4'),'afterDestroy':'remove'};function emitEvent(_0x518705){return function(_0x22c528,_0x684bb0,_0x392d59){FaxAccountEvents['emit'](_0x518705+':'+_0x22c528['id'],_0x22c528);FaxAccountEvents['emit'](_0x518705,_0x22c528);_0x392d59(null);};}for(var e in events){if(events[_0x6235('0x5')](e)){var event=events[e];FaxAccount[_0x6235('0x6')](e,emitEvent(event));}}module[_0x6235('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index f74e111..c117621 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 _0x4454=['./faxAccount.attributes','define','fax_accounts','util','../../config/logger','api','request-promise','rimraf'];(function(_0x5a75e7,_0x3ad506){var _0x15c695=function(_0x4ba933){while(--_0x4ba933){_0x5a75e7['push'](_0x5a75e7['shift']());}};_0x15c695(++_0x3ad506);}(_0x4454,0xbb));var _0x4445=function(_0x43d32c,_0x4382cd){_0x43d32c=_0x43d32c-0x0;var _0x278c1a=_0x4454[_0x43d32c];return _0x278c1a;};'use strict';var _=require('lodash');var util=require(_0x4445('0x0'));var logger=require(_0x4445('0x1'))(_0x4445('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4445('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4445('0x4'));var config=require('../../config/environment');var attributes=require(_0x4445('0x5'));module['exports']=function(_0x1a3a2a,_0x15b6f3){return _0x1a3a2a[_0x4445('0x6')]('FaxAccount',attributes,{'tableName':_0x4445('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc35c=['FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxAccount.attributes'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc35c,0xe6));var _0xcc35=function(_0x3141b8,_0x5312b5){_0x3141b8=_0x3141b8-0x0;var _0x485705=_0xc35c[_0x3141b8];return _0x485705;};'use strict';var _=require(_0xcc35('0x0'));var util=require(_0xcc35('0x1'));var logger=require(_0xcc35('0x2'))(_0xcc35('0x3'));var moment=require(_0xcc35('0x4'));var BPromise=require(_0xcc35('0x5'));var rp=require(_0xcc35('0x6'));var fs=require('fs');var path=require(_0xcc35('0x7'));var rimraf=require(_0xcc35('0x8'));var config=require('../../config/environment');var attributes=require(_0xcc35('0x9'));module['exports']=function(_0x46d3af,_0x42a1f2){return _0x46d3af['define'](_0xcc35('0xa'),attributes,{'tableName':_0xcc35('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 d285b62..4b51089 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 _0xaf0e=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','FaxApplication','Applications','List','get','applications','orderBy','asc','length','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','name','unshift','agent','Start','startRouting','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','map','model','then','debug','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','difference','CompanyId','from','from\x20is\x20mandatory','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes'];(function(_0x4108e9,_0x58da63){var _0x369cc4=function(_0x527bfd){while(--_0x527bfd){_0x4108e9['push'](_0x4108e9['shift']());}};_0x369cc4(++_0x58da63);}(_0xaf0e,0x79));var _0xeaf0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xaf0e[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0xeaf0('0x0'));var moment=require(_0xeaf0('0x1'));var BPromise=require('bluebird');var rs=require(_0xeaf0('0x2'));var fs=require('fs');var Redis=require(_0xeaf0('0x3'));var db=require(_0xeaf0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xeaf0('0x5'));var config=require('../../config/environment');var jayson=require(_0xeaf0('0x6'));var client=jayson['client'][_0xeaf0('0x7')]({'port':0x232c});config[_0xeaf0('0x8')]=_[_0xeaf0('0x9')](config[_0xeaf0('0x8')],{'host':_0xeaf0('0xa'),'port':0x18eb});var socket=require(_0xeaf0('0xb'))(new Redis(config[_0xeaf0('0x8')]));require(_0xeaf0('0xc'))[_0xeaf0('0xd')](socket);function respondWithRpcPromise(_0x10dffd,_0x35f7d2,_0x38a9df){return new BPromise(function(_0x37b861,_0x4ad04c){return client['request'](_0x10dffd,_0x38a9df)['then'](function(_0x2c6a00){logger[_0xeaf0('0xe')](_0xeaf0('0xf'),_0x35f7d2,_0xeaf0('0x10'));logger['debug'](_0xeaf0('0x11'),_0x35f7d2,'request\x20sent',JSON[_0xeaf0('0x12')](_0x2c6a00));if(_0x2c6a00[_0xeaf0('0x13')]){if(_0x2c6a00[_0xeaf0('0x13')][_0xeaf0('0x14')]===0x1f4){logger[_0xeaf0('0x13')](_0xeaf0('0xf'),_0x35f7d2,_0x2c6a00[_0xeaf0('0x13')][_0xeaf0('0x15')]);return _0x4ad04c(_0x2c6a00['error'][_0xeaf0('0x15')]);}logger[_0xeaf0('0x13')](_0xeaf0('0xf'),_0x35f7d2,_0x2c6a00[_0xeaf0('0x13')]['message']);return _0x37b861(_0x2c6a00[_0xeaf0('0x13')][_0xeaf0('0x15')]);}else{logger[_0xeaf0('0xe')](_0xeaf0('0xf'),_0x35f7d2,_0xeaf0('0x10'));_0x37b861(_0x2c6a00[_0xeaf0('0x16')][_0xeaf0('0x15')]);}})[_0xeaf0('0x17')](function(_0x220248){logger[_0xeaf0('0x13')]('FaxAccount,\x20%s,\x20%s',_0x35f7d2,_0x220248);_0x4ad04c(_0x220248);});});}exports[_0xeaf0('0x18')]=function(_0x301513){var _0xba9587=this;return new Promise(function(_0x3e7a8b,_0x1cd2f1){return db[_0xeaf0('0x19')][_0xeaf0('0x1a')]({'raw':_0x301513[_0xeaf0('0x1b')]?_0x301513[_0xeaf0('0x1b')][_0xeaf0('0x1c')]===undefined?!![]:![]:!![],'where':_0x301513[_0xeaf0('0x1b')]?_0x301513[_0xeaf0('0x1b')][_0xeaf0('0x1d')]||null:null,'attributes':_0x301513[_0xeaf0('0x1b')]?_0x301513[_0xeaf0('0x1b')][_0xeaf0('0x1e')]||null:null,'limit':_0x301513[_0xeaf0('0x1b')]?_0x301513['options']['limit']||null:null,'include':_0x301513[_0xeaf0('0x1b')]?_0x301513['options'][_0xeaf0('0x1f')]?_[_0xeaf0('0x20')](_0x301513['options']['include'],function(_0x53fadb){return{'model':db[_0x53fadb[_0xeaf0('0x21')]],'as':_0x53fadb['as'],'attributes':_0x53fadb[_0xeaf0('0x1e')],'include':_0x53fadb['include']?_['map'](_0x53fadb[_0xeaf0('0x1f')],function(_0x2d7019){return{'model':db[_0x2d7019['model']],'as':_0x2d7019['as'],'attributes':_0x2d7019[_0xeaf0('0x1e')],'include':_0x2d7019['include']?_[_0xeaf0('0x20')](_0x2d7019[_0xeaf0('0x1f')],function(_0x59d7cc){return{'model':db[_0x59d7cc[_0xeaf0('0x21')]],'as':_0x59d7cc['as'],'attributes':_0x59d7cc[_0xeaf0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xeaf0('0x22')](function(_0x2a2278){logger['info'](_0xeaf0('0x18'),_0x301513);logger[_0xeaf0('0x23')](_0xeaf0('0x18'),_0x301513,JSON[_0xeaf0('0x12')](_0x2a2278));_0x3e7a8b(_0x2a2278);})[_0xeaf0('0x17')](function(_0x19cb1a){logger['error'](_0xeaf0('0x18'),_0x19cb1a[_0xeaf0('0x15')],_0x301513);_0x1cd2f1(_0xba9587[_0xeaf0('0x13')](0x1f4,_0x19cb1a[_0xeaf0('0x15')]));});});};exports[_0xeaf0('0x24')]=function(_0x1ecbf4,_0x3e102a,_0x507035){var _0xc0dbc5=this;return new Promise(function(_0x5d1d6d,_0x50733d){var _0x134c2b={'body':_0x1ecbf4[_0xeaf0('0x25')],'channel':_0xeaf0('0x26')};var _0x3e46e0=[];var _0x598708=[];var _0x3a4654={};return db[_0xeaf0('0x27')][_0xeaf0('0x28')]()['then'](function(_0x5569b5){if(!_0x5569b5){throw new db['Sequelize'][(_0xeaf0('0x29'))](_0xeaf0('0x2a'));}_0x3e46e0=_['difference'](_[_0xeaf0('0x2b')](_0x5569b5),[_0xeaf0('0x2c'),_0xeaf0('0x2d')]);_0x598708=_[_0xeaf0('0x2e')](_[_0xeaf0('0x2b')](_0x5569b5),[_0xeaf0('0x2c'),_0xeaf0('0x2d'),_0xeaf0('0x2f'),'ListId']);if(_0x1ecbf4[_0xeaf0('0x25')]['id']){delete _0x1ecbf4[_0xeaf0('0x25')]['id'];}if(_['isNil'](_0x1ecbf4[_0xeaf0('0x25')][_0xeaf0('0x30')])){throw new db['Sequelize'][(_0xeaf0('0x29'))](_0xeaf0('0x31'));}if(_[_0xeaf0('0x32')](_0x1ecbf4[_0xeaf0('0x25')][_0xeaf0('0x25')])||_0x1ecbf4['body']['body']===''){throw new db[(_0xeaf0('0x33'))]['ValidationError'](_0xeaf0('0x34'));}if(_[_0xeaf0('0x32')](_0x1ecbf4[_0xeaf0('0x25')][_0xeaf0('0x35')])){throw new db[(_0xeaf0('0x33'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x598708);}if(!_[_0xeaf0('0x36')](_0x598708,_0x1ecbf4['body']['mapKey'])){throw new db[(_0xeaf0('0x33'))][(_0xeaf0('0x29'))](_0xeaf0('0x37')+_0x598708);}_0x3a4654[_0x1ecbf4['body'][_0xeaf0('0x35')]]=_0x1ecbf4['body'][_0xeaf0('0x30')];})[_0xeaf0('0x22')](function(){return db['FaxAccount'][_0xeaf0('0x38')]({'where':{'id':_0x1ecbf4[_0xeaf0('0x39')]['id']},'include':[{'model':db[_0xeaf0('0x3a')],'as':'List','include':[{'model':db['CmContact'],'as':_0xeaf0('0x3b'),'where':_0x3a4654,'limit':0x1,'order':[[_0xeaf0('0x2d'),'DESC']]}]},{'model':db[_0xeaf0('0x3c')],'as':_0xeaf0('0x3d')}]});})[_0xeaf0('0x22')](function(_0x59c066){if(_0x59c066&&_0x59c066[_0xeaf0('0x3e')]){var _0x325fe5=_0x59c066[_0xeaf0('0x3f')]({'plain':!![]});_0x134c2b[_0xeaf0('0x39')]=_0x325fe5;_0x134c2b[_0xeaf0('0x40')]=_0x325fe5[_0xeaf0('0x3d')];_0x134c2b['list']=_0x325fe5[_0xeaf0('0x3e')];_0x134c2b[_0xeaf0('0x40')]=_[_0xeaf0('0x41')](_0x134c2b[_0xeaf0('0x40')],['priority'],[_0xeaf0('0x42')]);if(_0x134c2b['account']['Applications']){delete _0x134c2b[_0xeaf0('0x39')][_0xeaf0('0x3d')];}if(_0x134c2b[_0xeaf0('0x39')]['List']&&_0x134c2b[_0xeaf0('0x39')][_0xeaf0('0x3e')][_0xeaf0('0x3b')][_0xeaf0('0x43')]){return _0x134c2b['account']['List'][_0xeaf0('0x3b')][0x0];}var _0x17aebb=_[_0xeaf0('0x9')](_0x1ecbf4['body'],{'firstName':_0x1ecbf4[_0xeaf0('0x25')][_0xeaf0('0x30')],'ListId':_0x325fe5[_0xeaf0('0x44')]});_0x17aebb[_0x1ecbf4['body'][_0xeaf0('0x35')]]=_0x1ecbf4[_0xeaf0('0x25')][_0xeaf0('0x30')];return db[_0xeaf0('0x27')][_0xeaf0('0x45')](_0x17aebb,{'fields':_0x3e46e0,'raw':!![]});}})[_0xeaf0('0x22')](function(_0x57bd7f){_0x134c2b[_0xeaf0('0x46')]=_0x57bd7f;if(_0x57bd7f){var _0x2c0d70={'ContactId':_0x57bd7f['id'],'FaxAccountId':_0x1ecbf4['account']['id'],'fax':_0x57bd7f[_0xeaf0('0x26')]};return db[_0xeaf0('0x47')][_0xeaf0('0x38')]({'where':{'ContactId':_0x57bd7f['id'],'closed':![],'FaxAccountId':_0x1ecbf4[_0xeaf0('0x39')]['id']}})[_0xeaf0('0x22')](function(_0x3c8ab5){if(_0x3c8ab5){return[_0x3c8ab5,![]];}return db['FaxInteraction'][_0xeaf0('0x45')](_0x2c0d70)[_0xeaf0('0x22')](function(_0x5e1dbe){return[_0x5e1dbe,!![]];});});}else{throw new Error(_0xeaf0('0x48'));}})[_0xeaf0('0x49')](function(_0xd15f26,_0x3959da){var _0x3ff2f0=_0xd15f26[_0xeaf0('0x3f')]({'plain':!![]});if(_0x3959da){if(_0x134c2b[_0xeaf0('0x39')][_0xeaf0('0x4a')]){_0x134c2b[_0xeaf0('0x40')][_0xeaf0('0x4b')]({'id':0x0,'priority':_0x134c2b['applications'][_0xeaf0('0x43')]+0x1,'app':'close','appdata':_0xeaf0('0x4c'),'interval':_0xeaf0('0x4d')});}_0x3ff2f0[_0xeaf0('0x4e')]=!![];}else{_0x3ff2f0['created']=![];}_0x134c2b[_0xeaf0('0x4f')]=_0x3ff2f0;return db['FaxMessage'][_0xeaf0('0x45')]({'body':_0x1ecbf4[_0xeaf0('0x25')][_0xeaf0('0x25')],'FaxAccountId':_0x1ecbf4[_0xeaf0('0x39')]['id'],'FaxInteractionId':_0xd15f26['id'],'direction':'in','ContactId':_0xd15f26[_0xeaf0('0x50')],'AttachmentId':_0x1ecbf4[_0xeaf0('0x25')][_0xeaf0('0x51')]});})[_0xeaf0('0x22')](function(_0x57263d){_0x134c2b['message']=_0x57263d;if(_0x134c2b[_0xeaf0('0x4f')][_0xeaf0('0x52')]){return db['User'][_0xeaf0('0x38')]({'attributes':['id',_0xeaf0('0x53')],'where':{'id':_0x134c2b['interaction'][_0xeaf0('0x52')]}})['then'](function(_0x3b0e7d){if(_0x3b0e7d){_0x134c2b[_0xeaf0('0x40')][_0xeaf0('0x54')]({'id':0x0,'priority':0x0,'app':_0xeaf0('0x55'),'appdata':_0x3b0e7d[_0xeaf0('0x53')]+','+(_0x134c2b[_0xeaf0('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0xeaf0('0x4d')});}return respondWithRpcPromise(_0xeaf0('0x56'),_0xeaf0('0x57'),_0x134c2b);});}return respondWithRpcPromise(_0xeaf0('0x56'),_0xeaf0('0x57'),_0x134c2b);})[_0xeaf0('0x22')](function(_0x54c680){_0x5d1d6d(_0x54c680);})[_0xeaf0('0x17')](function(_0x428ed2){_0x50733d(_0xc0dbc5[_0xeaf0('0x13')](0x1f4,_0x428ed2[_0xeaf0('0x15')]));});});}; \ No newline at end of file +var _0x525c=['startRouting','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','catch','GetFaxAccount','findAll','options','raw','where','limit','map','include','model','attributes','stringify','NotifyFaxAccount','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','updatedAt','keys','createdAt','CompanyId','body','isNil','from','ValidationError','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','FaxAccount','find','account','List','Contacts','FaxApplication','Applications','get','list','orderBy','applications','priority','length','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','User','unshift','agent','Start'];(function(_0x37ca3a,_0x4982eb){var _0x5e2d02=function(_0x1d31dd){while(--_0x1d31dd){_0x37ca3a['push'](_0x37ca3a['shift']());}};_0x5e2d02(++_0x4982eb);}(_0x525c,0x161));var _0xc525=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x525c[_0x38ced4];return _0x547c07;};'use strict';var _=require(_0xc525('0x0'));var util=require(_0xc525('0x1'));var moment=require(_0xc525('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc525('0x3'));var db=require(_0xc525('0x4'))['db'];var utils=require(_0xc525('0x5'));var logger=require(_0xc525('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc525('0x7'));var client=jayson[_0xc525('0x8')][_0xc525('0x9')]({'port':0x232c});config[_0xc525('0xa')]=_[_0xc525('0xb')](config[_0xc525('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc525('0xc'))(new Redis(config['redis']));require('./faxAccount.socket')[_0xc525('0xd')](socket);function respondWithRpcPromise(_0x3234e2,_0x593f33,_0x578238){return new BPromise(function(_0x12658b,_0x43ebcc){return client[_0xc525('0xe')](_0x3234e2,_0x578238)[_0xc525('0xf')](function(_0x3dd012){logger[_0xc525('0x10')](_0xc525('0x11'),_0x593f33,_0xc525('0x12'));logger[_0xc525('0x13')](_0xc525('0x14'),_0x593f33,_0xc525('0x12'),JSON['stringify'](_0x3dd012));if(_0x3dd012[_0xc525('0x15')]){if(_0x3dd012[_0xc525('0x15')]['code']===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x593f33,_0x3dd012[_0xc525('0x15')][_0xc525('0x16')]);return _0x43ebcc(_0x3dd012[_0xc525('0x15')][_0xc525('0x16')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x593f33,_0x3dd012[_0xc525('0x15')]['message']);return _0x12658b(_0x3dd012[_0xc525('0x15')][_0xc525('0x16')]);}else{logger[_0xc525('0x10')](_0xc525('0x11'),_0x593f33,'request\x20sent');_0x12658b(_0x3dd012['result']['message']);}})[_0xc525('0x17')](function(_0x3c1dd0){logger['error'](_0xc525('0x11'),_0x593f33,_0x3c1dd0);_0x43ebcc(_0x3c1dd0);});});}exports[_0xc525('0x18')]=function(_0x263e86){var _0x27d701=this;return new Promise(function(_0x509868,_0x28a210){return db['FaxAccount'][_0xc525('0x19')]({'raw':_0x263e86[_0xc525('0x1a')]?_0x263e86[_0xc525('0x1a')][_0xc525('0x1b')]===undefined?!![]:![]:!![],'where':_0x263e86['options']?_0x263e86['options'][_0xc525('0x1c')]||null:null,'attributes':_0x263e86[_0xc525('0x1a')]?_0x263e86[_0xc525('0x1a')]['attributes']||null:null,'limit':_0x263e86[_0xc525('0x1a')]?_0x263e86[_0xc525('0x1a')][_0xc525('0x1d')]||null:null,'include':_0x263e86[_0xc525('0x1a')]?_0x263e86[_0xc525('0x1a')]['include']?_[_0xc525('0x1e')](_0x263e86['options'][_0xc525('0x1f')],function(_0x49c67b){return{'model':db[_0x49c67b[_0xc525('0x20')]],'as':_0x49c67b['as'],'attributes':_0x49c67b[_0xc525('0x21')],'include':_0x49c67b[_0xc525('0x1f')]?_[_0xc525('0x1e')](_0x49c67b[_0xc525('0x1f')],function(_0x2cce91){return{'model':db[_0x2cce91[_0xc525('0x20')]],'as':_0x2cce91['as'],'attributes':_0x2cce91['attributes'],'include':_0x2cce91['include']?_[_0xc525('0x1e')](_0x2cce91[_0xc525('0x1f')],function(_0xa349f5){return{'model':db[_0xa349f5['model']],'as':_0xa349f5['as'],'attributes':_0xa349f5[_0xc525('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc525('0xf')](function(_0xdff1d3){logger[_0xc525('0x10')](_0xc525('0x18'),_0x263e86);logger[_0xc525('0x13')](_0xc525('0x18'),_0x263e86,JSON[_0xc525('0x22')](_0xdff1d3));_0x509868(_0xdff1d3);})[_0xc525('0x17')](function(_0x227815){logger[_0xc525('0x15')]('GetFaxAccount',_0x227815[_0xc525('0x16')],_0x263e86);_0x28a210(_0x27d701[_0xc525('0x15')](0x1f4,_0x227815[_0xc525('0x16')]));});});};exports[_0xc525('0x23')]=function(_0x597a0b,_0x4f2bec,_0x21a55e){var _0x379383=this;return new Promise(function(_0xa2e723,_0x39a973){var _0x39ceb0={'body':_0x597a0b['body'],'channel':_0xc525('0x24')};var _0x568949=[];var _0x70c1ee=[];var _0x587871={};return db[_0xc525('0x25')][_0xc525('0x26')]()['then'](function(_0x2d4ca0){if(!_0x2d4ca0){throw new db[(_0xc525('0x27'))]['ValidationError'](_0xc525('0x28'));}_0x568949=_[_0xc525('0x29')](_['keys'](_0x2d4ca0),['createdAt',_0xc525('0x2a')]);_0x70c1ee=_[_0xc525('0x29')](_[_0xc525('0x2b')](_0x2d4ca0),[_0xc525('0x2c'),_0xc525('0x2a'),_0xc525('0x2d'),'ListId']);if(_0x597a0b[_0xc525('0x2e')]['id']){delete _0x597a0b[_0xc525('0x2e')]['id'];}if(_[_0xc525('0x2f')](_0x597a0b[_0xc525('0x2e')][_0xc525('0x30')])){throw new db[(_0xc525('0x27'))][(_0xc525('0x31'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x597a0b[_0xc525('0x2e')][_0xc525('0x2e')])||_0x597a0b[_0xc525('0x2e')][_0xc525('0x2e')]===''){throw new db[(_0xc525('0x27'))]['ValidationError'](_0xc525('0x32'));}if(_[_0xc525('0x2f')](_0x597a0b[_0xc525('0x2e')][_0xc525('0x33')])){throw new db[(_0xc525('0x27'))]['ValidationError'](_0xc525('0x34')+_0x70c1ee);}if(!_[_0xc525('0x35')](_0x70c1ee,_0x597a0b[_0xc525('0x2e')][_0xc525('0x33')])){throw new db[(_0xc525('0x27'))]['ValidationError'](_0xc525('0x36')+_0x70c1ee);}_0x587871[_0x597a0b['body'][_0xc525('0x33')]]=_0x597a0b[_0xc525('0x2e')][_0xc525('0x30')];})[_0xc525('0xf')](function(){return db[_0xc525('0x37')][_0xc525('0x38')]({'where':{'id':_0x597a0b[_0xc525('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0xc525('0x3a'),'include':[{'model':db[_0xc525('0x25')],'as':_0xc525('0x3b'),'where':_0x587871,'limit':0x1,'order':[[_0xc525('0x2a'),'DESC']]}]},{'model':db[_0xc525('0x3c')],'as':_0xc525('0x3d')}]});})['then'](function(_0x3ee09c){if(_0x3ee09c&&_0x3ee09c[_0xc525('0x3a')]){var _0x5f0b7a=_0x3ee09c[_0xc525('0x3e')]({'plain':!![]});_0x39ceb0[_0xc525('0x39')]=_0x5f0b7a;_0x39ceb0['applications']=_0x5f0b7a[_0xc525('0x3d')];_0x39ceb0[_0xc525('0x3f')]=_0x5f0b7a['List'];_0x39ceb0['applications']=_[_0xc525('0x40')](_0x39ceb0[_0xc525('0x41')],[_0xc525('0x42')],['asc']);if(_0x39ceb0[_0xc525('0x39')][_0xc525('0x3d')]){delete _0x39ceb0['account'][_0xc525('0x3d')];}if(_0x39ceb0['account'][_0xc525('0x3a')]&&_0x39ceb0[_0xc525('0x39')][_0xc525('0x3a')]['Contacts'][_0xc525('0x43')]){return _0x39ceb0[_0xc525('0x39')][_0xc525('0x3a')][_0xc525('0x3b')][0x0];}var _0x211a8c=_[_0xc525('0xb')](_0x597a0b[_0xc525('0x2e')],{'firstName':_0x597a0b[_0xc525('0x2e')][_0xc525('0x30')],'ListId':_0x5f0b7a[_0xc525('0x44')]});_0x211a8c[_0x597a0b[_0xc525('0x2e')][_0xc525('0x33')]]=_0x597a0b['body'][_0xc525('0x30')];return db[_0xc525('0x25')][_0xc525('0x45')](_0x211a8c,{'fields':_0x568949,'raw':!![]});}})[_0xc525('0xf')](function(_0x4d783b){_0x39ceb0[_0xc525('0x46')]=_0x4d783b;if(_0x4d783b){var _0x29c7f2={'ContactId':_0x4d783b['id'],'FaxAccountId':_0x597a0b[_0xc525('0x39')]['id'],'fax':_0x4d783b[_0xc525('0x24')]};return db[_0xc525('0x47')][_0xc525('0x38')]({'where':{'ContactId':_0x4d783b['id'],'closed':![],'FaxAccountId':_0x597a0b['account']['id']}})[_0xc525('0xf')](function(_0x2842ac){if(_0x2842ac){return[_0x2842ac,![]];}return db['FaxInteraction']['create'](_0x29c7f2)[_0xc525('0xf')](function(_0x4abd67){return[_0x4abd67,!![]];});});}else{throw new Error(_0xc525('0x48'));}})[_0xc525('0x49')](function(_0x18251d,_0x4c8001){var _0x5719d1=_0x18251d['get']({'plain':!![]});if(_0x4c8001){if(_0x39ceb0[_0xc525('0x39')][_0xc525('0x4a')]){_0x39ceb0['applications'][_0xc525('0x4b')]({'id':0x0,'priority':_0x39ceb0[_0xc525('0x41')][_0xc525('0x43')]+0x1,'app':_0xc525('0x4c'),'appdata':_0xc525('0x4d'),'interval':_0xc525('0x4e')});}_0x5719d1[_0xc525('0x4f')]=!![];}else{_0x5719d1['created']=![];}_0x39ceb0[_0xc525('0x50')]=_0x5719d1;return db['FaxMessage'][_0xc525('0x45')]({'body':_0x597a0b[_0xc525('0x2e')]['body'],'FaxAccountId':_0x597a0b['account']['id'],'FaxInteractionId':_0x18251d['id'],'direction':'in','ContactId':_0x18251d[_0xc525('0x51')],'AttachmentId':_0x597a0b['body'][_0xc525('0x52')]});})[_0xc525('0xf')](function(_0x531ff4){_0x39ceb0[_0xc525('0x16')]=_0x531ff4;if(_0x39ceb0[_0xc525('0x50')]['UserId']){return db[_0xc525('0x53')][_0xc525('0x38')]({'attributes':['id','name'],'where':{'id':_0x39ceb0['interaction']['UserId']}})['then'](function(_0x584e38){if(_0x584e38){_0x39ceb0[_0xc525('0x41')][_0xc525('0x54')]({'id':0x0,'priority':0x0,'app':_0xc525('0x55'),'appdata':_0x584e38['name']+','+(_0x39ceb0['account']['waitForTheAssignedAgent']||0xa),'interval':_0xc525('0x4e')});}return respondWithRpcPromise(_0xc525('0x56'),_0xc525('0x57'),_0x39ceb0);});}return respondWithRpcPromise(_0xc525('0x56'),_0xc525('0x57'),_0x39ceb0);})[_0xc525('0xf')](function(_0x3807bb){_0xa2e723(_0x3807bb);})[_0xc525('0x17')](function(_0x3fab9a){_0x39a973(_0x379383['error'](0x1f4,_0x3fab9a[_0xc525('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 5217e9d..4a9e72b 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 _0x5797=['./faxAccount.events','save','remove','update','emit','register','length'];(function(_0x254462,_0x3bc587){var _0xdbaced=function(_0x4aa1aa){while(--_0x4aa1aa){_0x254462['push'](_0x254462['shift']());}};_0xdbaced(++_0x3bc587);}(_0x5797,0x1ab));var _0x7579=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x5797[_0x5c2e3e];return _0x53f64a;};'use strict';var FaxAccountEvents=require(_0x7579('0x0'));var events=[_0x7579('0x1'),_0x7579('0x2'),_0x7579('0x3')];function createListener(_0x1a852b,_0x287938){return function(_0x4f6f69){_0x287938[_0x7579('0x4')](_0x1a852b,_0x4f6f69);};}function removeListener(_0x283cd1,_0x4c6ae4){return function(){FaxAccountEvents['removeListener'](_0x283cd1,_0x4c6ae4);};}exports[_0x7579('0x5')]=function(_0x482063){for(var _0x11bcfd=0x0,_0x361415=events[_0x7579('0x6')];_0x11bcfd<_0x361415;_0x11bcfd++){var _0x372866=events[_0x11bcfd];var _0x379ecd=createListener('faxAccount:'+_0x372866,_0x482063);FaxAccountEvents['on'](_0x372866,_0x379ecd);}}; \ No newline at end of file +var _0xd0dd=['removeListener','register','faxAccount:','./faxAccount.events','update'];(function(_0xa88ea7,_0x18870d){var _0x54b317=function(_0x2fc8a2){while(--_0x2fc8a2){_0xa88ea7['push'](_0xa88ea7['shift']());}};_0x54b317(++_0x18870d);}(_0xd0dd,0x1c0));var _0xdd0d=function(_0x103592,_0x47c0c1){_0x103592=_0x103592-0x0;var _0x45cd64=_0xd0dd[_0x103592];return _0x45cd64;};'use strict';var FaxAccountEvents=require(_0xdd0d('0x0'));var events=['save','remove',_0xdd0d('0x1')];function createListener(_0x1f2c68,_0x2fba41){return function(_0x5503f1){_0x2fba41['emit'](_0x1f2c68,_0x5503f1);};}function removeListener(_0x1e85a6,_0x173f34){return function(){FaxAccountEvents[_0xdd0d('0x2')](_0x1e85a6,_0x173f34);};}exports[_0xdd0d('0x3')]=function(_0x491df5){for(var _0x3cb590=0x0,_0x57d486=events['length'];_0x3cb590<_0x57d486;_0x3cb590++){var _0x485a59=events[_0x3cb590];var _0x50da99=createListener(_0xdd0d('0x4')+_0x485a59,_0x491df5);FaxAccountEvents['on'](_0x485a59,_0x50da99);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 68a9e98..f214a82 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(_0x821c2f,_0x881a1d){var _0x2da34c=function(_0xa0a679){while(--_0xa0a679){_0x821c2f['push'](_0x821c2f['shift']());}};_0x2da34c(++_0x881a1d);}(_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['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(_0x21337f,_0x10a0a5){var _0x2fc1c7=function(_0x3d1930){while(--_0x3d1930){_0x21337f['push'](_0x21337f['shift']());}};_0x2fc1c7(++_0x10a0a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 1e7f0c4..28a3312 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 _0xff33=['exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x45a313,_0x37a410){var _0x53c9e8=function(_0x311a93){while(--_0x311a93){_0x45a313['push'](_0x45a313['shift']());}};_0x53c9e8(++_0x37a410);}(_0xff33,0x13b));var _0x3ff3=function(_0x1f0679,_0x53d43c){_0x1f0679=_0x1f0679-0x0;var _0x3dc3a4=_0xff33[_0x1f0679];return _0x3dc3a4;};'use strict';var Sequelize=require('sequelize');module[_0x3ff3('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3ff3('0x1')],'allowNull':![],'defaultValue':_0x3ff3('0x2')},'appdata':{'type':Sequelize[_0x3ff3('0x3')]()},'description':{'type':Sequelize[_0x3ff3('0x1')]},'interval':{'type':Sequelize[_0x3ff3('0x1')],'defaultValue':_0x3ff3('0x4')}}; \ No newline at end of file +var _0x2b52=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x286386,_0x1293a2){var _0x1d7821=function(_0x289d3e){while(--_0x289d3e){_0x286386['push'](_0x286386['shift']());}};_0x1d7821(++_0x1293a2);}(_0x2b52,0x18e));var _0x22b5=function(_0x21de89,_0x367053){_0x21de89=_0x21de89-0x0;var _0x290b7e=_0x2b52[_0x21de89];return _0x290b7e;};'use strict';var Sequelize=require(_0x22b5('0x0'));module[_0x22b5('0x1')]={'priority':{'type':Sequelize[_0x22b5('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x22b5('0x3')],'allowNull':![],'defaultValue':_0x22b5('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x22b5('0x3')],'defaultValue':_0x22b5('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index a096cae..5a81f16 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 _0xb14c=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','length','order','sort','where','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body'];(function(_0x52bf46,_0x3303d2){var _0xe06331=function(_0x5ae9a7){while(--_0x5ae9a7){_0x52bf46['push'](_0x52bf46['shift']());}};_0xe06331(++_0x3303d2);}(_0xb14c,0x1b0));var _0xcb14=function(_0x5982a5,_0x3dc07b){_0x5982a5=_0x5982a5-0x0;var _0x159c80=_0xb14c[_0x5982a5];return _0x159c80;};'use strict';var emlformat=require(_0xcb14('0x0'));var rimraf=require(_0xcb14('0x1'));var zipdir=require(_0xcb14('0x2'));var jsonpatch=require(_0xcb14('0x3'));var rp=require(_0xcb14('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcb14('0x5'));var util=require(_0xcb14('0x6'));var path=require(_0xcb14('0x7'));var sox=require(_0xcb14('0x8'));var csv=require('to-csv');var ejs=require(_0xcb14('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb14('0xa'));var squel=require(_0xcb14('0xb'));var crypto=require('crypto');var jsforce=require(_0xcb14('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcb14('0xd'));var querystring=require('querystring');var Papa=require(_0xcb14('0xe'));var Redis=require(_0xcb14('0xf'));var authService=require(_0xcb14('0x10'));var qs=require(_0xcb14('0x11'));var as=require(_0xcb14('0x12'));var hardwareService=require(_0xcb14('0x13'));var logger=require('../../config/logger')(_0xcb14('0x14'));var utils=require(_0xcb14('0x15'));var config=require(_0xcb14('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb14('0x17'))['db'];function respondWithStatusCode(_0x1201df,_0xd8205b){_0xd8205b=_0xd8205b||0xcc;return function(_0x4c7268){if(_0x4c7268){return _0x1201df[_0xcb14('0x18')](_0xd8205b);}return _0x1201df[_0xcb14('0x19')](_0xd8205b)['end']();};}function respondWithResult(_0x1196ca,_0x255d05){_0x255d05=_0x255d05||0xc8;return function(_0x27ba21){if(_0x27ba21){return _0x1196ca[_0xcb14('0x19')](_0x255d05)[_0xcb14('0x1a')](_0x27ba21);}};}function respondWithFilteredResult(_0x15b666,_0x1b5adf){return function(_0xdbe87b){if(_0xdbe87b){var _0xcac33f=typeof _0x1b5adf['offset']===_0xcb14('0x1b')&&typeof _0x1b5adf[_0xcb14('0x1c')]===_0xcb14('0x1b');var _0x3a8c4a=_0xdbe87b[_0xcb14('0x1d')];var _0x5a9bdf=_0xcac33f?0x0:_0x1b5adf[_0xcb14('0x1e')];var _0x1f39b0=_0xcac33f?_0xdbe87b[_0xcb14('0x1d')]:_0x1b5adf[_0xcb14('0x1e')]+_0x1b5adf[_0xcb14('0x1c')];var _0x4e2e77;if(_0x1f39b0>=_0x3a8c4a){_0x1f39b0=_0x3a8c4a;_0x4e2e77=0xc8;}else{_0x4e2e77=0xce;}_0x15b666[_0xcb14('0x19')](_0x4e2e77);return _0x15b666['set'](_0xcb14('0x1f'),_0x5a9bdf+'-'+_0x1f39b0+'/'+_0x3a8c4a)[_0xcb14('0x1a')](_0xdbe87b);}return null;};}function patchUpdates(_0x4035e7){return function(_0x1d88ce){try{jsonpatch[_0xcb14('0x20')](_0x1d88ce,_0x4035e7,!![]);}catch(_0x4cf243){return BPromise[_0xcb14('0x21')](_0x4cf243);}return _0x1d88ce[_0xcb14('0x22')]();};}function saveUpdates(_0x3ad361,_0x14bfa7){return function(_0x45f55e){if(_0x45f55e){return _0x45f55e[_0xcb14('0x23')](_0x3ad361)[_0xcb14('0x24')](function(_0x2fcc10){return _0x2fcc10;});}return null;};}function removeEntity(_0xa99b73,_0x4b2be9){return function(_0x50d1da){if(_0x50d1da){return _0x50d1da[_0xcb14('0x25')]()[_0xcb14('0x24')](function(){_0xa99b73['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16feb9,_0x4d7a83){return function(_0x3d3b70){if(!_0x3d3b70){_0x16feb9['sendStatus'](0x194);}return _0x3d3b70;};}function handleError(_0x58a592,_0x21f898){_0x21f898=_0x21f898||0x1f4;return function(_0x748171){logger['error'](_0x748171[_0xcb14('0x26')]);if(_0x748171[_0xcb14('0x27')]){delete _0x748171[_0xcb14('0x27')];}_0x58a592[_0xcb14('0x19')](_0x21f898)[_0xcb14('0x28')](_0x748171);};}exports[_0xcb14('0x29')]=function(_0x534e02,_0xdfbdb7){var _0x5062a8={},_0xedf754={},_0x43e363={'count':0x0,'rows':[]};var _0x4429ec=_[_0xcb14('0x2a')](db[_0xcb14('0x2b')][_0xcb14('0x2c')],function(_0x903ecc){return{'name':_0x903ecc[_0xcb14('0x2d')],'type':_0x903ecc['type'][_0xcb14('0x2e')]};});_0xedf754['model']=_[_0xcb14('0x2a')](_0x4429ec,_0xcb14('0x27'));_0xedf754[_0xcb14('0x2f')]=_['keys'](_0x534e02[_0xcb14('0x2f')]);_0xedf754[_0xcb14('0x30')]=_['intersection'](_0xedf754[_0xcb14('0x31')],_0xedf754['query']);_0x5062a8[_0xcb14('0x32')]=_[_0xcb14('0x33')](_0xedf754[_0xcb14('0x31')],qs['fields'](_0x534e02['query'][_0xcb14('0x34')]));_0x5062a8[_0xcb14('0x32')]=_0x5062a8[_0xcb14('0x32')][_0xcb14('0x35')]?_0x5062a8[_0xcb14('0x32')]:_0xedf754[_0xcb14('0x31')];if(!_0x534e02[_0xcb14('0x2f')]['hasOwnProperty']('nolimit')){_0x5062a8[_0xcb14('0x1c')]=qs['limit'](_0x534e02[_0xcb14('0x2f')][_0xcb14('0x1c')]);_0x5062a8[_0xcb14('0x1e')]=qs[_0xcb14('0x1e')](_0x534e02[_0xcb14('0x2f')]['offset']);}_0x5062a8[_0xcb14('0x36')]=qs[_0xcb14('0x37')](_0x534e02[_0xcb14('0x2f')][_0xcb14('0x37')]);_0x5062a8[_0xcb14('0x38')]=qs[_0xcb14('0x30')](_['pick'](_0x534e02[_0xcb14('0x2f')],_0xedf754[_0xcb14('0x30')]),_0x4429ec);if(_0x534e02[_0xcb14('0x2f')][_0xcb14('0x39')]){_0x5062a8[_0xcb14('0x38')]=_[_0xcb14('0x3a')](_0x5062a8[_0xcb14('0x38')],{'$or':_[_0xcb14('0x2a')](_0x4429ec,function(_0x381bde){if(_0x381bde[_0xcb14('0x3b')]!=='VIRTUAL'){var _0x2692a1={};_0x2692a1[_0x381bde[_0xcb14('0x27')]]={'$like':'%'+_0x534e02[_0xcb14('0x2f')][_0xcb14('0x39')]+'%'};return _0x2692a1;}})});}_0x5062a8=_[_0xcb14('0x3a')]({},_0x5062a8,_0x534e02['options']);var _0x26d0eb={'where':_0x5062a8[_0xcb14('0x38')]};return db[_0xcb14('0x2b')][_0xcb14('0x1d')](_0x26d0eb)['then'](function(_0x536551){_0x43e363[_0xcb14('0x1d')]=_0x536551;if(_0x534e02['query'][_0xcb14('0x3c')]){_0x5062a8[_0xcb14('0x3d')]=[{'all':!![]}];}return db[_0xcb14('0x2b')][_0xcb14('0x3e')](_0x5062a8);})[_0xcb14('0x24')](function(_0x39dba1){_0x43e363[_0xcb14('0x3f')]=_0x39dba1;return _0x43e363;})[_0xcb14('0x24')](respondWithFilteredResult(_0xdfbdb7,_0x5062a8))[_0xcb14('0x40')](handleError(_0xdfbdb7,null));};exports[_0xcb14('0x41')]=function(_0x764f5,_0x1d2021){var _0x293706={'raw':!![],'where':{'id':_0x764f5[_0xcb14('0x42')]['id']}},_0x33e8e4={};_0x33e8e4[_0xcb14('0x31')]=_[_0xcb14('0x43')](db[_0xcb14('0x2b')]['rawAttributes']);_0x33e8e4[_0xcb14('0x2f')]=_[_0xcb14('0x43')](_0x764f5[_0xcb14('0x2f')]);_0x33e8e4[_0xcb14('0x30')]=_[_0xcb14('0x33')](_0x33e8e4[_0xcb14('0x31')],_0x33e8e4['query']);_0x293706[_0xcb14('0x32')]=_['intersection'](_0x33e8e4[_0xcb14('0x31')],qs['fields'](_0x764f5['query']['fields']));_0x293706['attributes']=_0x293706[_0xcb14('0x32')][_0xcb14('0x35')]?_0x293706['attributes']:_0x33e8e4[_0xcb14('0x31')];if(_0x764f5[_0xcb14('0x2f')][_0xcb14('0x3c')]){_0x293706[_0xcb14('0x3d')]=[{'all':!![]}];}_0x293706=_[_0xcb14('0x3a')]({},_0x293706,_0x764f5[_0xcb14('0x44')]);return db[_0xcb14('0x2b')][_0xcb14('0x45')](_0x293706)[_0xcb14('0x24')](handleEntityNotFound(_0x1d2021,null))['then'](respondWithResult(_0x1d2021,null))[_0xcb14('0x40')](handleError(_0x1d2021,null));};exports[_0xcb14('0x46')]=function(_0x5b9b85,_0x2937f8){return db[_0xcb14('0x2b')][_0xcb14('0x46')](_0x5b9b85[_0xcb14('0x47')],{})[_0xcb14('0x24')](respondWithResult(_0x2937f8,0xc9))[_0xcb14('0x40')](handleError(_0x2937f8,null));};exports['update']=function(_0x3292d3,_0x2e5fee){if(_0x3292d3[_0xcb14('0x47')]['id']){delete _0x3292d3['body']['id'];}return db[_0xcb14('0x2b')][_0xcb14('0x45')]({'where':{'id':_0x3292d3[_0xcb14('0x42')]['id']}})[_0xcb14('0x24')](handleEntityNotFound(_0x2e5fee,null))[_0xcb14('0x24')](saveUpdates(_0x3292d3[_0xcb14('0x47')],null))['then'](respondWithResult(_0x2e5fee,null))[_0xcb14('0x40')](handleError(_0x2e5fee,null));};exports['destroy']=function(_0x4e20ae,_0x55d5ce){return db[_0xcb14('0x2b')][_0xcb14('0x45')]({'where':{'id':_0x4e20ae['params']['id']}})[_0xcb14('0x24')](handleEntityNotFound(_0x55d5ce,null))[_0xcb14('0x24')](removeEntity(_0x55d5ce,null))['catch'](handleError(_0x55d5ce,null));}; \ No newline at end of file +var _0x6cc0=['destroy','error','stack','name','send','index','FaxApplication','key','query','keys','filters','attributes','intersection','model','length','nolimit','sort','where','filter','merge','map','type','options','findAll','rows','catch','params','rawAttributes','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then'];(function(_0x459f09,_0x2552f3){var _0x41a0e5=function(_0x5ede7b){while(--_0x5ede7b){_0x459f09['push'](_0x459f09['shift']());}};_0x41a0e5(++_0x2552f3);}(_0x6cc0,0x1b8));var _0x06cc=function(_0x347334,_0x170cb5){_0x347334=_0x347334-0x0;var _0x5e4769=_0x6cc0[_0x347334];return _0x5e4769;};'use strict';var emlformat=require(_0x06cc('0x0'));var rimraf=require(_0x06cc('0x1'));var zipdir=require(_0x06cc('0x2'));var jsonpatch=require(_0x06cc('0x3'));var rp=require(_0x06cc('0x4'));var moment=require(_0x06cc('0x5'));var BPromise=require(_0x06cc('0x6'));var Mustache=require(_0x06cc('0x7'));var util=require(_0x06cc('0x8'));var path=require(_0x06cc('0x9'));var sox=require('sox');var csv=require(_0x06cc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06cc('0xb'));var squel=require('squel');var crypto=require(_0x06cc('0xc'));var jsforce=require(_0x06cc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x06cc('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x06cc('0xe'));var qs=require(_0x06cc('0xf'));var as=require(_0x06cc('0x10'));var hardwareService=require(_0x06cc('0x11'));var logger=require('../../config/logger')(_0x06cc('0x12'));var utils=require('../../config/utils');var config=require(_0x06cc('0x13'));var licenseUtil=require(_0x06cc('0x14'));var db=require(_0x06cc('0x15'))['db'];function respondWithStatusCode(_0x522cd7,_0x1dd803){_0x1dd803=_0x1dd803||0xcc;return function(_0x4ebdb1){if(_0x4ebdb1){return _0x522cd7[_0x06cc('0x16')](_0x1dd803);}return _0x522cd7[_0x06cc('0x17')](_0x1dd803)[_0x06cc('0x18')]();};}function respondWithResult(_0x58d824,_0x23f9ec){_0x23f9ec=_0x23f9ec||0xc8;return function(_0x5e847d){if(_0x5e847d){return _0x58d824[_0x06cc('0x17')](_0x23f9ec)[_0x06cc('0x19')](_0x5e847d);}};}function respondWithFilteredResult(_0x28e280,_0x3337ab){return function(_0x2ce5b5){if(_0x2ce5b5){var _0x42ad77=typeof _0x3337ab['offset']===_0x06cc('0x1a')&&typeof _0x3337ab[_0x06cc('0x1b')]===_0x06cc('0x1a');var _0x10ad62=_0x2ce5b5[_0x06cc('0x1c')];var _0x57a193=_0x42ad77?0x0:_0x3337ab[_0x06cc('0x1d')];var _0x4de25e=_0x42ad77?_0x2ce5b5['count']:_0x3337ab[_0x06cc('0x1d')]+_0x3337ab[_0x06cc('0x1b')];var _0x49ae45;if(_0x4de25e>=_0x10ad62){_0x4de25e=_0x10ad62;_0x49ae45=0xc8;}else{_0x49ae45=0xce;}_0x28e280[_0x06cc('0x17')](_0x49ae45);return _0x28e280[_0x06cc('0x1e')]('Content-Range',_0x57a193+'-'+_0x4de25e+'/'+_0x10ad62)[_0x06cc('0x19')](_0x2ce5b5);}return null;};}function patchUpdates(_0x236c24){return function(_0x8dc7e7){try{jsonpatch[_0x06cc('0x1f')](_0x8dc7e7,_0x236c24,!![]);}catch(_0x57788f){return BPromise[_0x06cc('0x20')](_0x57788f);}return _0x8dc7e7[_0x06cc('0x21')]();};}function saveUpdates(_0x128de3,_0x28a97f){return function(_0x57c3fe){if(_0x57c3fe){return _0x57c3fe[_0x06cc('0x22')](_0x128de3)[_0x06cc('0x23')](function(_0x1fd9c7){return _0x1fd9c7;});}return null;};}function removeEntity(_0x86fde7,_0x9578cf){return function(_0x5dd82e){if(_0x5dd82e){return _0x5dd82e[_0x06cc('0x24')]()[_0x06cc('0x23')](function(){_0x86fde7[_0x06cc('0x17')](0xcc)[_0x06cc('0x18')]();});}};}function handleEntityNotFound(_0x493602,_0x4602b5){return function(_0x42e36b){if(!_0x42e36b){_0x493602[_0x06cc('0x16')](0x194);}return _0x42e36b;};}function handleError(_0x42d216,_0xf045a1){_0xf045a1=_0xf045a1||0x1f4;return function(_0x229805){logger[_0x06cc('0x25')](_0x229805[_0x06cc('0x26')]);if(_0x229805[_0x06cc('0x27')]){delete _0x229805['name'];}_0x42d216[_0x06cc('0x17')](_0xf045a1)[_0x06cc('0x28')](_0x229805);};}exports[_0x06cc('0x29')]=function(_0x1b13ae,_0x4396b8){var _0x133856={},_0x3d5548={},_0x18d42b={'count':0x0,'rows':[]};var _0x1e5c8d=_['map'](db[_0x06cc('0x2a')]['rawAttributes'],function(_0x335a96){return{'name':_0x335a96['fieldName'],'type':_0x335a96['type'][_0x06cc('0x2b')]};});_0x3d5548['model']=_['map'](_0x1e5c8d,'name');_0x3d5548[_0x06cc('0x2c')]=_[_0x06cc('0x2d')](_0x1b13ae[_0x06cc('0x2c')]);_0x3d5548[_0x06cc('0x2e')]=_['intersection'](_0x3d5548['model'],_0x3d5548[_0x06cc('0x2c')]);_0x133856[_0x06cc('0x2f')]=_[_0x06cc('0x30')](_0x3d5548[_0x06cc('0x31')],qs['fields'](_0x1b13ae[_0x06cc('0x2c')]['fields']));_0x133856[_0x06cc('0x2f')]=_0x133856[_0x06cc('0x2f')][_0x06cc('0x32')]?_0x133856[_0x06cc('0x2f')]:_0x3d5548[_0x06cc('0x31')];if(!_0x1b13ae[_0x06cc('0x2c')]['hasOwnProperty'](_0x06cc('0x33'))){_0x133856[_0x06cc('0x1b')]=qs['limit'](_0x1b13ae[_0x06cc('0x2c')][_0x06cc('0x1b')]);_0x133856['offset']=qs[_0x06cc('0x1d')](_0x1b13ae[_0x06cc('0x2c')][_0x06cc('0x1d')]);}_0x133856['order']=qs[_0x06cc('0x34')](_0x1b13ae[_0x06cc('0x2c')]['sort']);_0x133856[_0x06cc('0x35')]=qs[_0x06cc('0x2e')](_['pick'](_0x1b13ae[_0x06cc('0x2c')],_0x3d5548[_0x06cc('0x2e')]),_0x1e5c8d);if(_0x1b13ae['query'][_0x06cc('0x36')]){_0x133856[_0x06cc('0x35')]=_[_0x06cc('0x37')](_0x133856[_0x06cc('0x35')],{'$or':_[_0x06cc('0x38')](_0x1e5c8d,function(_0x270892){if(_0x270892[_0x06cc('0x39')]!=='VIRTUAL'){var _0x477c4c={};_0x477c4c[_0x270892['name']]={'$like':'%'+_0x1b13ae[_0x06cc('0x2c')][_0x06cc('0x36')]+'%'};return _0x477c4c;}})});}_0x133856=_['merge']({},_0x133856,_0x1b13ae[_0x06cc('0x3a')]);var _0x3aa0c0={'where':_0x133856[_0x06cc('0x35')]};return db['FaxApplication']['count'](_0x3aa0c0)[_0x06cc('0x23')](function(_0x220608){_0x18d42b[_0x06cc('0x1c')]=_0x220608;if(_0x1b13ae[_0x06cc('0x2c')]['includeAll']){_0x133856['include']=[{'all':!![]}];}return db[_0x06cc('0x2a')][_0x06cc('0x3b')](_0x133856);})[_0x06cc('0x23')](function(_0x3ca019){_0x18d42b[_0x06cc('0x3c')]=_0x3ca019;return _0x18d42b;})[_0x06cc('0x23')](respondWithFilteredResult(_0x4396b8,_0x133856))[_0x06cc('0x3d')](handleError(_0x4396b8,null));};exports['show']=function(_0x45aacb,_0x368c11){var _0x21c4f2={'raw':!![],'where':{'id':_0x45aacb[_0x06cc('0x3e')]['id']}},_0x2c217e={};_0x2c217e[_0x06cc('0x31')]=_['keys'](db[_0x06cc('0x2a')][_0x06cc('0x3f')]);_0x2c217e[_0x06cc('0x2c')]=_['keys'](_0x45aacb[_0x06cc('0x2c')]);_0x2c217e[_0x06cc('0x2e')]=_[_0x06cc('0x30')](_0x2c217e['model'],_0x2c217e[_0x06cc('0x2c')]);_0x21c4f2[_0x06cc('0x2f')]=_[_0x06cc('0x30')](_0x2c217e[_0x06cc('0x31')],qs['fields'](_0x45aacb[_0x06cc('0x2c')]['fields']));_0x21c4f2['attributes']=_0x21c4f2['attributes'][_0x06cc('0x32')]?_0x21c4f2['attributes']:_0x2c217e['model'];if(_0x45aacb[_0x06cc('0x2c')]['includeAll']){_0x21c4f2[_0x06cc('0x40')]=[{'all':!![]}];}_0x21c4f2=_[_0x06cc('0x37')]({},_0x21c4f2,_0x45aacb['options']);return db['FaxApplication']['find'](_0x21c4f2)[_0x06cc('0x23')](handleEntityNotFound(_0x368c11,null))[_0x06cc('0x23')](respondWithResult(_0x368c11,null))['catch'](handleError(_0x368c11,null));};exports[_0x06cc('0x41')]=function(_0x268133,_0x58a617){return db[_0x06cc('0x2a')][_0x06cc('0x41')](_0x268133[_0x06cc('0x42')],{})['then'](respondWithResult(_0x58a617,0xc9))['catch'](handleError(_0x58a617,null));};exports['update']=function(_0x2af696,_0x157c73){if(_0x2af696[_0x06cc('0x42')]['id']){delete _0x2af696[_0x06cc('0x42')]['id'];}return db['FaxApplication'][_0x06cc('0x43')]({'where':{'id':_0x2af696[_0x06cc('0x3e')]['id']}})['then'](handleEntityNotFound(_0x157c73,null))[_0x06cc('0x23')](saveUpdates(_0x2af696['body'],null))[_0x06cc('0x23')](respondWithResult(_0x157c73,null))['catch'](handleError(_0x157c73,null));};exports[_0x06cc('0x24')]=function(_0x438ed0,_0x46e3f6){return db[_0x06cc('0x2a')][_0x06cc('0x43')]({'where':{'id':_0x438ed0[_0x06cc('0x3e')]['id']}})['then'](handleEntityNotFound(_0x46e3f6,null))[_0x06cc('0x23')](removeEntity(_0x46e3f6,null))['catch'](handleError(_0x46e3f6,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index b5abdcd..50fd49a 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 _0x56c7=['../../config/logger','api','bluebird','request-promise','path','rimraf','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x6d6015,_0x1bd8ee){var _0x320f10=function(_0x17c451){while(--_0x17c451){_0x6d6015['push'](_0x6d6015['shift']());}};_0x320f10(++_0x1bd8ee);}(_0x56c7,0x10c));var _0x756c=function(_0x31c5e9,_0x30e373){_0x31c5e9=_0x31c5e9-0x0;var _0x517a8d=_0x56c7[_0x31c5e9];return _0x517a8d;};'use strict';var _=require(_0x756c('0x0'));var util=require(_0x756c('0x1'));var logger=require(_0x756c('0x2'))(_0x756c('0x3'));var moment=require('moment');var BPromise=require(_0x756c('0x4'));var rp=require(_0x756c('0x5'));var fs=require('fs');var path=require(_0x756c('0x6'));var rimraf=require(_0x756c('0x7'));var config=require('../../config/environment');var attributes=require(_0x756c('0x8'));module[_0x756c('0x9')]=function(_0x4f91c4,_0x452f70){return _0x4f91c4[_0x756c('0xa')](_0x756c('0xb'),attributes,{'tableName':_0x756c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x756c('0xd'),'collate':_0x756c('0xe')});}; \ No newline at end of file +var _0xa565=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','./faxApplication.attributes','exports','define','FaxApplication','fax_applications'];(function(_0xe5d3f8,_0x4936c4){var _0x472ca7=function(_0x20810b){while(--_0x20810b){_0xe5d3f8['push'](_0xe5d3f8['shift']());}};_0x472ca7(++_0x4936c4);}(_0xa565,0x6f));var _0x5a56=function(_0x1093f9,_0x4115c3){_0x1093f9=_0x1093f9-0x0;var _0x4a190c=_0xa565[_0x1093f9];return _0x4a190c;};'use strict';var _=require(_0x5a56('0x0'));var util=require(_0x5a56('0x1'));var logger=require(_0x5a56('0x2'))(_0x5a56('0x3'));var moment=require('moment');var BPromise=require(_0x5a56('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5a56('0x5'));module[_0x5a56('0x6')]=function(_0x3ecfc1,_0x5ab3c4){return _0x3ecfc1[_0x5a56('0x7')](_0x5a56('0x8'),attributes,{'tableName':_0x5a56('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5a56('0xa')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 632b89d..ae600f7 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 _0xc108=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxApplication','options','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x37a21f,_0x38e116){var _0x57dd07=function(_0x5c8f82){while(--_0x5c8f82){_0x37a21f['push'](_0x37a21f['shift']());}};_0x57dd07(++_0x38e116);}(_0xc108,0xe9));var _0x8c10=function(_0x13c4b5,_0x1e2b80){_0x13c4b5=_0x13c4b5-0x0;var _0xab5f07=_0xc108[_0x13c4b5];return _0xab5f07;};'use strict';var _=require(_0x8c10('0x0'));var util=require(_0x8c10('0x1'));var moment=require(_0x8c10('0x2'));var BPromise=require(_0x8c10('0x3'));var rs=require(_0x8c10('0x4'));var fs=require('fs');var Redis=require(_0x8c10('0x5'));var db=require(_0x8c10('0x6'))['db'];var utils=require(_0x8c10('0x7'));var logger=require(_0x8c10('0x8'))('rpc');var config=require(_0x8c10('0x9'));var jayson=require(_0x8c10('0xa'));var client=jayson[_0x8c10('0xb')][_0x8c10('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a3dd2,_0x25f28e,_0x168e88){return new BPromise(function(_0x3dd519,_0x1f7ade){return client[_0x8c10('0xd')](_0x3a3dd2,_0x168e88)[_0x8c10('0xe')](function(_0x30f6a5){logger[_0x8c10('0xf')](_0x8c10('0x10'),_0x25f28e,_0x8c10('0x11'));logger[_0x8c10('0x12')](_0x8c10('0x13'),_0x25f28e,_0x8c10('0x11'),JSON[_0x8c10('0x14')](_0x30f6a5));if(_0x30f6a5[_0x8c10('0x15')]){if(_0x30f6a5['error'][_0x8c10('0x16')]===0x1f4){logger[_0x8c10('0x15')](_0x8c10('0x10'),_0x25f28e,_0x30f6a5['error'][_0x8c10('0x17')]);return _0x1f7ade(_0x30f6a5[_0x8c10('0x15')]['message']);}logger[_0x8c10('0x15')](_0x8c10('0x10'),_0x25f28e,_0x30f6a5[_0x8c10('0x15')]['message']);return _0x3dd519(_0x30f6a5['error'][_0x8c10('0x17')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0x25f28e,_0x8c10('0x11'));_0x3dd519(_0x30f6a5[_0x8c10('0x18')][_0x8c10('0x17')]);}})['catch'](function(_0x366e87){logger[_0x8c10('0x15')](_0x8c10('0x10'),_0x25f28e,_0x366e87);_0x1f7ade(_0x366e87);});});}exports[_0x8c10('0x19')]=function(_0x14af93){var _0x5a1147=this;return new Promise(function(_0x3b77c4,_0x2d842d){return db['FaxApplication']['update'](_0x14af93['body'],{'raw':_0x14af93[_0x8c10('0x1a')]?_0x14af93[_0x8c10('0x1a')][_0x8c10('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14af93[_0x8c10('0x1a')]?_0x14af93[_0x8c10('0x1a')][_0x8c10('0x1c')]||null:null,'attributes':_0x14af93['options']?_0x14af93[_0x8c10('0x1a')][_0x8c10('0x1d')]||null:null,'limit':_0x14af93[_0x8c10('0x1a')]?_0x14af93[_0x8c10('0x1a')]['limit']||null:null})[_0x8c10('0xe')](function(_0x140cbc){logger['info']('UpdateFaxApplication',_0x14af93);logger[_0x8c10('0x12')](_0x8c10('0x19'),_0x14af93,JSON[_0x8c10('0x14')](_0x140cbc));_0x3b77c4(_0x140cbc);})['catch'](function(_0x25454b){logger['error']('UpdateFaxApplication',_0x25454b[_0x8c10('0x17')],_0x14af93);_0x2d842d(_0x5a1147[_0x8c10('0x15')](0x1f4,_0x25454b['message']));});});}; \ No newline at end of file +var _0xf386=['rpc','../../config/environment','client','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','options','raw','where','then','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4f6661,_0x17d2bd){var _0x3861b3=function(_0x5aa0ba){while(--_0x5aa0ba){_0x4f6661['push'](_0x4f6661['shift']());}};_0x3861b3(++_0x17d2bd);}(_0xf386,0xd1));var _0x6f38=function(_0x53ab0f,_0x237c80){_0x53ab0f=_0x53ab0f-0x0;var _0x1713da=_0xf386[_0x53ab0f];return _0x1713da;};'use strict';var _=require(_0x6f38('0x0'));var util=require(_0x6f38('0x1'));var moment=require(_0x6f38('0x2'));var BPromise=require('bluebird');var rs=require(_0x6f38('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f38('0x4'))['db'];var utils=require(_0x6f38('0x5'));var logger=require(_0x6f38('0x6'))(_0x6f38('0x7'));var config=require(_0x6f38('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6f38('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53b06e,_0x55aebe,_0x2b76a0){return new BPromise(function(_0x30181c,_0x3a7df9){return client['request'](_0x53b06e,_0x2b76a0)['then'](function(_0x5a7579){logger[_0x6f38('0xa')](_0x6f38('0xb'),_0x55aebe,_0x6f38('0xc'));logger[_0x6f38('0xd')](_0x6f38('0xe'),_0x55aebe,_0x6f38('0xc'),JSON[_0x6f38('0xf')](_0x5a7579));if(_0x5a7579[_0x6f38('0x10')]){if(_0x5a7579[_0x6f38('0x10')][_0x6f38('0x11')]===0x1f4){logger[_0x6f38('0x10')](_0x6f38('0xb'),_0x55aebe,_0x5a7579[_0x6f38('0x10')]['message']);return _0x3a7df9(_0x5a7579['error']['message']);}logger[_0x6f38('0x10')](_0x6f38('0xb'),_0x55aebe,_0x5a7579[_0x6f38('0x10')][_0x6f38('0x12')]);return _0x30181c(_0x5a7579[_0x6f38('0x10')][_0x6f38('0x12')]);}else{logger[_0x6f38('0xa')](_0x6f38('0xb'),_0x55aebe,_0x6f38('0xc'));_0x30181c(_0x5a7579[_0x6f38('0x13')]['message']);}})[_0x6f38('0x14')](function(_0x17005c){logger['error'](_0x6f38('0xb'),_0x55aebe,_0x17005c);_0x3a7df9(_0x17005c);});});}exports[_0x6f38('0x15')]=function(_0x248d78){var _0x50cbee=this;return new Promise(function(_0x499bd1,_0x288d6e){return db[_0x6f38('0x16')]['update'](_0x248d78['body'],{'raw':_0x248d78[_0x6f38('0x17')]?_0x248d78[_0x6f38('0x17')][_0x6f38('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x248d78['options']?_0x248d78[_0x6f38('0x17')][_0x6f38('0x19')]||null:null,'attributes':_0x248d78['options']?_0x248d78[_0x6f38('0x17')]['attributes']||null:null,'limit':_0x248d78[_0x6f38('0x17')]?_0x248d78[_0x6f38('0x17')]['limit']||null:null})[_0x6f38('0x1a')](function(_0x134a3d){logger['info'](_0x6f38('0x15'),_0x248d78);logger[_0x6f38('0xd')](_0x6f38('0x15'),_0x248d78,JSON[_0x6f38('0xf')](_0x134a3d));_0x499bd1(_0x134a3d);})[_0x6f38('0x14')](function(_0x428de7){logger[_0x6f38('0x10')](_0x6f38('0x15'),_0x428de7['message'],_0x248d78);_0x288d6e(_0x50cbee[_0x6f38('0x10')](0x1f4,_0x428de7[_0x6f38('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 932830a..ff5c802 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 _0x6324=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x5b02c6,_0x44289c){var _0x233342=function(_0x1f72d9){while(--_0x1f72d9){_0x5b02c6['push'](_0x5b02c6['shift']());}};_0x233342(++_0x44289c);}(_0x6324,0x142));var _0x4632=function(_0x23e02e,_0x4d26cb){_0x23e02e=_0x23e02e-0x0;var _0x2a6db8=_0x6324[_0x23e02e];return _0x2a6db8;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./faxApplication.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0xb')]('/',auth['isAuthenticated'](),controller[_0x4632('0xc')]);router[_0x4632('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x4632('0xe')]);router[_0x4632('0xf')](_0x4632('0x10'),auth[_0x4632('0x8')](),controller[_0x4632('0x11')]);module[_0x4632('0x12')]=router; \ No newline at end of file +var _0xb10b=['./faxApplication.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x59bf32,_0x25c651){var _0x1c7184=function(_0x16be09){while(--_0x16be09){_0x59bf32['push'](_0x59bf32['shift']());}};_0x1c7184(++_0x25c651);}(_0xb10b,0x12a));var _0xbb10=function(_0x32a254,_0x14e1d0){_0x32a254=_0x32a254-0x0;var _0x799afb=_0xb10b[_0x32a254];return _0x799afb;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);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 d0224bf..56e1d31 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 _0xf292=['DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x2d0eda,_0x3ab785){var _0xcf9894=function(_0x377839){while(--_0x377839){_0x2d0eda['push'](_0x2d0eda['shift']());}};_0xcf9894(++_0x3ab785);}(_0xf292,0x1ea));var _0x2f29=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xf292[_0x2f45ea];return _0x485a84;};'use strict';var Sequelize=require(_0x2f29('0x0'));module[_0x2f29('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2f29('0x2')]},'disposition':{'type':Sequelize[_0x2f29('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2f29('0x3')]},'note':{'type':Sequelize[_0x2f29('0x3')]},'read1stAt':{'type':Sequelize[_0x2f29('0x2')]},'fax':{'type':Sequelize[_0x2f29('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2f29('0x4')]('in',_0x2f29('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2f29('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x70a5=['exports','DATE','STRING','ENUM','out','sequelize'];(function(_0x3cabbf,_0x34fe1f){var _0x45a614=function(_0x22971e){while(--_0x22971e){_0x3cabbf['push'](_0x3cabbf['shift']());}};_0x45a614(++_0x34fe1f);}(_0x70a5,0x77));var _0x570a=function(_0x465a28,_0x2325ae){_0x465a28=_0x465a28-0x0;var _0x9c4a11=_0x70a5[_0x465a28];return _0x9c4a11;};'use strict';var Sequelize=require(_0x570a('0x0'));module[_0x570a('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x570a('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x570a('0x3')]},'note':{'type':Sequelize[_0x570a('0x3')]},'read1stAt':{'type':Sequelize[_0x570a('0x2')]},'fax':{'type':Sequelize[_0x570a('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x570a('0x4')]('in',_0x570a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x570a('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x570a('0x4')]('in',_0x570a('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 31ebba2..46a5531 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 _0xed6c=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','Tags','TagIds','split','forEach','catch','waiting','talking','answered','unmanaged','closed','UserId','total','FaxInteraction','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','select','field','color','from','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_messages','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','end','Tag','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','buildExpression','isEmpty','FaxAccountId','createdAt','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','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)','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','all','show','params','options','describe','addMessage','FaxMessage','ids','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','rows','addTags','setTags','omit','findAll','emit','removeTags','unix','join','root','server','files','tmp','format','Attachment','Messages','get','mkdirSync','basename','createReadStream','createWriteStream','download','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring'];(function(_0x52dd39,_0xdb90a5){var _0x1d4076=function(_0x19c184){while(--_0x19c184){_0x52dd39['push'](_0x52dd39['shift']());}};_0x1d4076(++_0xdb90a5);}(_0xed6c,0xcb));var _0xced6=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xed6c[_0x346737];return _0x1ade2e;};'use strict';var emlformat=require(_0xced6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xced6('0x1'));var jsonpatch=require(_0xced6('0x2'));var rp=require(_0xced6('0x3'));var moment=require('moment');var BPromise=require(_0xced6('0x4'));var Mustache=require('mustache');var util=require(_0xced6('0x5'));var path=require(_0xced6('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xced6('0x7'));var fs=require('fs');var fs_extra=require(_0xced6('0x8'));var _=require(_0xced6('0x9'));var squel=require('squel');var crypto=require(_0xced6('0xa'));var jsforce=require(_0xced6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xced6('0xc'));var querystring=require(_0xced6('0xd'));var Papa=require(_0xced6('0xe'));var Redis=require('ioredis');var authService=require(_0xced6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xced6('0x10'));var hardwareService=require(_0xced6('0x11'));var logger=require(_0xced6('0x12'))('api');var utils=require(_0xced6('0x13'));var config=require(_0xced6('0x14'));var licenseUtil=require(_0xced6('0x15'));var db=require(_0xced6('0x16'))['db'];config[_0xced6('0x17')]=_[_0xced6('0x18')](config[_0xced6('0x17')],{'host':_0xced6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xced6('0x17')]));require('./faxInteraction.socket')[_0xced6('0x1a')](socket);function respondWithStatusCode(_0x461275,_0x363035){_0x363035=_0x363035||0xcc;return function(_0x27052a){if(_0x27052a){return _0x461275[_0xced6('0x1b')](_0x363035);}return _0x461275[_0xced6('0x1c')](_0x363035)['end']();};}function respondWithResult(_0xec759c,_0x14a144){_0x14a144=_0x14a144||0xc8;return function(_0x578fbc){if(_0x578fbc){return _0xec759c[_0xced6('0x1c')](_0x14a144)[_0xced6('0x1d')](_0x578fbc);}};}function respondWithFilteredResult(_0x3c30eb,_0x122549){return function(_0x421e8d){if(_0x421e8d){var _0x3bf0c3=typeof _0x122549[_0xced6('0x1e')]===_0xced6('0x1f')&&typeof _0x122549[_0xced6('0x20')]===_0xced6('0x1f');var _0x35a414=_0x421e8d[_0xced6('0x21')];var _0x23b1a4=_0x3bf0c3?0x0:_0x122549[_0xced6('0x1e')];var _0x58311c=_0x3bf0c3?_0x421e8d['count']:_0x122549[_0xced6('0x1e')]+_0x122549['limit'];var _0x12417d;if(_0x58311c>=_0x35a414){_0x58311c=_0x35a414;_0x12417d=0xc8;}else{_0x12417d=0xce;}_0x3c30eb[_0xced6('0x1c')](_0x12417d);return _0x3c30eb['set']('Content-Range',_0x23b1a4+'-'+_0x58311c+'/'+_0x35a414)[_0xced6('0x1d')](_0x421e8d);}return null;};}function patchUpdates(_0x1070a1){return function(_0x503663){try{jsonpatch[_0xced6('0x22')](_0x503663,_0x1070a1,!![]);}catch(_0x2e3efb){return BPromise[_0xced6('0x23')](_0x2e3efb);}return _0x503663[_0xced6('0x24')]();};}function saveUpdates(_0x59cadc,_0x39ba66){return function(_0x18eb60){if(_0x18eb60){return _0x18eb60[_0xced6('0x25')](_0x59cadc)[_0xced6('0x26')](function(_0x6cd827){return _0x6cd827;});}return null;};}function removeEntity(_0x257390,_0x438ee6){return function(_0x46ec14){if(_0x46ec14){return _0x46ec14[_0xced6('0x27')]()['then'](function(){_0x257390[_0xced6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cd0b9,_0x31f40e){return function(_0x24e161){if(!_0x24e161){_0x3cd0b9[_0xced6('0x1b')](0x194);}return _0x24e161;};}function handleError(_0x2bcb46,_0x2c447a){_0x2c447a=_0x2c447a||0x1f4;return function(_0x412748){logger[_0xced6('0x28')](_0x412748[_0xced6('0x29')]);if(_0x412748[_0xced6('0x2a')]){delete _0x412748[_0xced6('0x2a')];}_0x2bcb46[_0xced6('0x1c')](_0x2c447a)[_0xced6('0x2b')](_0x412748);};}function getInteractionUsers(_0x3d7c5c,_0x1fb03d){return new BPromise(function(_0x1078a1,_0x485bb5){try{if(_0x1fb03d[_0x3d7c5c['id']]){_0x3d7c5c[_0xced6('0x2c')]=_[_0xced6('0x2d')](_0x1fb03d[_0x3d7c5c['id']],function(_0x4f698c){return{'id':_0x4f698c['id'],'fullname':_0x4f698c['fullname']};});}}catch(_0x1f4ba7){_0x485bb5(_0x1f4ba7);}_0x1078a1(_0x3d7c5c);});}function getInteractionTags(_0x13bafd,_0x23f61f){return new BPromise(function(_0x4671ff,_0x47e7fa){try{if(_0x13bafd['TagIds']){_0x13bafd[_0xced6('0x2e')]=[];_0x13bafd[_0xced6('0x2f')][_0xced6('0x30')](',')[_0xced6('0x31')](function(_0xcda1ef){_0x13bafd[_0xced6('0x2e')]['push'](_0x23f61f[_0xcda1ef]);});}delete _0x13bafd[_0xced6('0x2f')];}catch(_0x5b5b52){_0x47e7fa(_0x5b5b52);}_0x4671ff(_0x13bafd);});}function updateFaxInteraction(_0xbbb9cb,_0x4edb4d,_0x1fec12){return new BPromise(function(_0x23dc2b,_0x5aeaeb){return getInteractionUsers(_0xbbb9cb,_0x1fec12)[_0xced6('0x26')](function(_0x3bc0dd){return getInteractionTags(_0x3bc0dd,_0x4edb4d);})['then'](function(_0x19eb46){return getStateInteraction(_0x19eb46);})[_0xced6('0x26')](function(_0x43577d){_0x23dc2b(_0x43577d);})[_0xced6('0x32')](function(_0x564609){_0x5aeaeb(_0x564609);});});}function getStateInteraction(_0x1187c1){return new BPromise(function(_0x1f0269){_0x1187c1[_0xced6('0x33')]=0x0;_0x1187c1[_0xced6('0x34')]=0x0;_0x1187c1[_0xced6('0x35')]=0x0;_0x1187c1[_0xced6('0x36')]=0x0;_0x1187c1['total']=0x0;if(!_0x1187c1['closed']&&!_0x1187c1['UserId']){_0x1187c1[_0xced6('0x33')]+=0x1;}if(!_0x1187c1['closed']&&_0x1187c1['UserId']){_0x1187c1[_0xced6('0x34')]+=0x1;if(_0x1187c1[_0xced6('0x33')]){_0x1187c1['waiting']-=0x1;}}if(_0x1187c1[_0xced6('0x37')]&&_0x1187c1[_0xced6('0x38')]){_0x1187c1['answered']+=0x1;if(_0x1187c1[_0xced6('0x34')]){_0x1187c1[_0xced6('0x34')]-=0x1;}}if(_0x1187c1[_0xced6('0x37')]&&!_0x1187c1[_0xced6('0x38')]){_0x1187c1['unmanaged']+=0x1;if(_0x1187c1[_0xced6('0x33')]){_0x1187c1[_0xced6('0x33')]-=0x1;}}_0x1187c1[_0xced6('0x39')]+=0x1;_0x1f0269(_0x1187c1);});}exports['index']=function(_0x142103,_0x315024){var _0xef15b4={},_0x320f94={},_0xdab8f8={'count':0x0,'rows':[]};var _0x5818c7=_[_0xced6('0x2d')](db[_0xced6('0x3a')][_0xced6('0x3b')],function(_0x16be23){return{'name':_0x16be23[_0xced6('0x3c')],'type':_0x16be23[_0xced6('0x3d')][_0xced6('0x3e')]};});_0x320f94['model']=_[_0xced6('0x2d')](_0x5818c7,_0xced6('0x2a'));_0x320f94['query']=_[_0xced6('0x3f')](_0x142103[_0xced6('0x40')]);_0x320f94['filters']=_[_0xced6('0x41')](_0x320f94[_0xced6('0x42')],_0x320f94['query']);_0xef15b4[_0xced6('0x43')]=_[_0xced6('0x41')](_0x320f94['model'],qs[_0xced6('0x44')](_0x142103['query']['fields']));_0xef15b4['attributes']=_0xef15b4['attributes'][_0xced6('0x45')]?_0xef15b4[_0xced6('0x43')]:_0x320f94[_0xced6('0x42')];if(!_0x142103[_0xced6('0x40')][_0xced6('0x46')](_0xced6('0x47'))){_0xef15b4[_0xced6('0x20')]=qs[_0xced6('0x20')](_0x142103[_0xced6('0x40')][_0xced6('0x20')]);_0xef15b4[_0xced6('0x1e')]=qs[_0xced6('0x1e')](_0x142103[_0xced6('0x40')]['offset']);}_0xef15b4[_0xced6('0x48')]=qs[_0xced6('0x49')](_0x142103['query'][_0xced6('0x49')]);_0xef15b4[_0xced6('0x4a')]=qs['filters'](_[_0xced6('0x4b')](_0x142103['query'],_0x320f94[_0xced6('0x4c')]),_0x5818c7);var _0xfb411f=[];var _0x29c70f=squel[_0xced6('0x4d')]()[_0xced6('0x4e')]('id')['field'](_0xced6('0x2a'))['field'](_0xced6('0x4f'))[_0xced6('0x50')]('tools_tags');var _0x4737fb=squel[_0xced6('0x4d')]()['field'](_0xced6('0x51'))[_0xced6('0x4e')]('u.fullname')['field'](_0xced6('0x52'))['from'](_0xced6('0x53'),'ui')[_0xced6('0x54')](_0xced6('0x55'),'u','u.id\x20=\x20ui.UserId');var _0x469215=squel[_0xced6('0x4d')]()[_0xced6('0x50')](_0xced6('0x56'),'i')[_0xced6('0x54')](_0xced6('0x57'),'c',_0xced6('0x58'))[_0xced6('0x54')]('users','o','o.id\x20=\x20i.UserId')['left_join']('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')['left_join'](_0xced6('0x59'),'me',_0xced6('0x5a'))['left_join']('fax_interaction_has_tags','it',_0xced6('0x5b'))[_0xced6('0x54')](_0xced6('0x5c'),'t',_0xced6('0x5d'));var _0x4cb1ae=squel[_0xced6('0x5e')]();var _0x2d6ecb=[];var _0x11b4bb=squel[_0xced6('0x5e')]();var _0x1e965;if(_0x142103[_0xced6('0x40')]['search']){_0x1e965=as[_0xced6('0x5f')](_0x142103[_0xced6('0x40')][_0xced6('0x60')]);var _0x155419=_0x1e965[_0xced6('0x61')];for(var _0x456d70=0x0;_0x456d70<_0x1e965['conditions'][_0xced6('0x45')];_0x456d70++){var _0xe2b72=_0x1e965[_0xced6('0x62')][_0x456d70];var _0x59fd41='i';var _0x5b8c94=_[_0xced6('0x63')](_0x5818c7,[_0xced6('0x2a'),_0xe2b72[_0xced6('0x4e')]]);if(!_0x5b8c94){switch(_0xe2b72['field']){case _0xced6('0x64'):if(_0xe2b72[_0xced6('0x65')]==0x1){_0x469215[_0xced6('0x66')]('`'+_0xe2b72['field']+'`\x20=\x200');}else{_0x469215[_0xced6('0x66')]('`'+_0xe2b72[_0xced6('0x4e')]+_0xced6('0x67'));}break;case _0xced6('0x68'):if(_0xe2b72[_0xced6('0x69')]==='$substring'){if(_0xe2b72[_0xced6('0x65')][_0xced6('0x30')]('\x20')[_0xced6('0x45')]>0x1){_0x4cb1ae[_0x155419](_0xced6('0x6a'),qs[_0xced6('0x6b')](_0xe2b72['value']),null);}else{var _0x188cc2='%'+_0xe2b72[_0xced6('0x65')]+'%';_0x4cb1ae[_0x155419](_0xced6('0x6c'),_0x188cc2,_0x188cc2,_0x188cc2);}}else{_0x5b8c94=_['find'](_0x5818c7,['name',_0xced6('0x6d')]);_0xe2b72[_0xced6('0x4e')]='ContactId';_0x21ea4b=as['buildExpression'](_0x59fd41,_0x5b8c94[_0xced6('0x3d')],_0xe2b72);_0x4cb1ae[_0x155419](_0x21ea4b[_0xced6('0x6e')],_0x21ea4b[_0xced6('0x65')]['start'],_0x21ea4b[_0xced6('0x65')][_0xced6('0x6f')]);}break;case _0xced6('0x70'):var _0x356412=_0xe2b72['value']['split'](',')[_0xced6('0x2d')](function(_0x2e5d0d){return Number(_0x2e5d0d);});_0x356412[_0xced6('0x31')](function(_0x1075b4){_0x11b4bb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1075b4+',%');});_0x2d6ecb=_['union'](_0x2d6ecb,_0x356412);break;case _0xced6('0x71'):if(_0xe2b72['operator']===_0xced6('0x72')){_0x4cb1ae[_0x155419](_0xced6('0x73'),'%'+_0xe2b72[_0xced6('0x65')]+'%',null);}else{_0x5b8c94=_['find'](_0x5818c7,['name','UserId']);_0xe2b72[_0xced6('0x4e')]=_0xced6('0x38');_0x21ea4b=as['buildExpression'](_0x59fd41,_0x5b8c94[_0xced6('0x3d')],_0xe2b72);_0x4cb1ae[_0x155419](_0x21ea4b[_0xced6('0x6e')],_0x21ea4b[_0xced6('0x65')][_0xced6('0x74')],_0x21ea4b[_0xced6('0x65')][_0xced6('0x6f')]);}break;case _0xced6('0x75'):_0x21ea4b=as['buildExpression']('me',null,_0xe2b72);_0x4cb1ae[_0x155419](_0x21ea4b[_0xced6('0x6e')],_0x21ea4b[_0xced6('0x65')][_0xced6('0x74')],_0x21ea4b[_0xced6('0x65')]['end']);break;}}else{var _0x21ea4b=as[_0xced6('0x76')](_0x59fd41,_0x5b8c94[_0xced6('0x3d')],_0xe2b72);_0x4cb1ae[_0x155419](_0x21ea4b[_0xced6('0x6e')],_0x21ea4b[_0xced6('0x65')][_0xced6('0x74')],_0x21ea4b[_0xced6('0x65')][_0xced6('0x6f')]);}}}else{var _0x17da7a=_(_0x142103['query'])['keys']()['map'](function(_0x2afa7e){return _['some'](_0x5818c7,['name',_0x2afa7e])?_0x2afa7e:undefined;})['compact']()[_0xced6('0x65')]();if(!_[_0xced6('0x77')](_0x17da7a)){_0x17da7a[_0xced6('0x31')](function(_0x1fe957){if(_0x1fe957===_0xced6('0x78')){_0x469215[_0xced6('0x4a')]('i.FaxAccountId\x20IN\x20?',[]['concat'](_0x142103[_0xced6('0x40')][_0x1fe957]));}else if(_0x1fe957===_0xced6('0x79')){var _0x4ecb52=JSON['parse'](_0x142103[_0xced6('0x40')][_0x1fe957])['$gte'];var _0x463f3d=JSON['parse'](_0x142103[_0xced6('0x40')][_0x1fe957])['$lte'];_0x469215[_0xced6('0x4a')](_0xced6('0x7a'),_0x4ecb52,_0x463f3d);}else{if(_0x142103[_0xced6('0x40')][_0x1fe957]===_0xced6('0x7b')){_0x469215[_0xced6('0x4a')]('i.'+_0x1fe957+_0xced6('0x7c'));}else{_0x469215[_0xced6('0x4a')]('i.'+_0x1fe957+'\x20=\x20?',_0x142103[_0xced6('0x40')][_0x1fe957]);}}});}if(_0x142103[_0xced6('0x40')][_0xced6('0x7d')]){if(_0x142103[_0xced6('0x40')]['read']==0x1){_0x469215[_0xced6('0x66')](_0xced6('0x7e'));}else{_0x469215[_0xced6('0x66')]('`unreadMessages`\x20>\x200');}}if(_0x142103['query'][_0xced6('0x7f')]){_0x2d6ecb=_[_0xced6('0x80')](_0x142103[_0xced6('0x40')][_0xced6('0x7f')])?_0x142103['query'][_0xced6('0x7f')]:new Array(_0x142103[_0xced6('0x40')]['tag']);_0x2d6ecb['forEach'](function(_0x2ec540){_0x11b4bb['or'](_0xced6('0x81'),'%,'+_0x2ec540+',%');});}if(_0x142103[_0xced6('0x40')][_0xced6('0x82')]){var _0x974748=_0x142103[_0xced6('0x40')]['filter'][_0xced6('0x83')]('\x5c','\x5c\x5c')[_0xced6('0x83')](/'/g,'\x27\x27');if(qs[_0xced6('0x84')](_0x974748)){_0x4cb1ae['or'](_0xced6('0x85'),_0x974748+'%')['or']('i.fax\x20LIKE\x20?',_0x974748+'%');}_0x4cb1ae['or'](_0xced6('0x86'),_0x974748+'%');}}_0x469215[_0xced6('0x4a')](_0x4cb1ae);_0x469215[_0xced6('0x87')](_0xced6('0x88'));var _0x26869d={'type':db[_0xced6('0x89')][_0xced6('0x8a')][_0xced6('0x8b')],'raw':!![]};var _0x629cb4=_0x469215[_0xced6('0x8c')]();_0x629cb4[_0xced6('0x4e')](_0xced6('0x88'));_0x629cb4[_0xced6('0x4e')](_0xced6('0x8d'),_0xced6('0x64'));if(_0xef15b4[_0xced6('0x48')]){_0xef15b4[_0xced6('0x48')]['forEach'](function(_0x52c75b){var _0x44b0b9=_0x52c75b[0x0]==='contactName'?_0x52c75b[0x0]:'i.'+_0x52c75b[0x0];_0x469215['order'](_0x44b0b9,_0x52c75b[0x1]===_0xced6('0x8e')?![]:!![]);});}if(!_[_0xced6('0x77')](_0x2d6ecb)){_0x469215[_0xced6('0x66')](_0x11b4bb);_0x629cb4[_0xced6('0x4a')]('t.id\x20IN\x20?',_0x2d6ecb);}BPromise[_0xced6('0x8f')]()[_0xced6('0x26')](function(){if(!_0x1e965){if(_0x142103[_0xced6('0x40')][_0xced6('0x78')])return;_0x629cb4['where'](_0xced6('0x90'));_0x469215['where'](_0xced6('0x90'));return;}if(_0x142103['user'][_0xced6('0x91')]!==_0xced6('0x92'))return;return _0x142103[_0xced6('0x93')][_0xced6('0x94')]({'attributes':['id'],'raw':!![]})[_0xced6('0x26')](function(_0x4a0467){if(_[_0xced6('0x77')](_0x4a0467)){_0x629cb4[_0xced6('0x4a')](_0xced6('0x95'));_0x469215[_0xced6('0x4a')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x629cb4[_0xced6('0x4a')](_0xced6('0x96'),_[_0xced6('0x2d')](_0x4a0467,'id'));_0x469215[_0xced6('0x4a')](_0xced6('0x96'),_[_0xced6('0x2d')](_0x4a0467,'id'));}});})[_0xced6('0x26')](function(){if(_0x142103[_0xced6('0x93')][_0xced6('0x91')]==='agent'&&!_0x1e965&&!_0x142103['query'][_0xced6('0x78')])return[];return db[_0xced6('0x97')][_0xced6('0x40')](_0x629cb4[_0xced6('0x98')](),_0x26869d);})['then'](function(_0x3b82ef){_0xdab8f8[_0xced6('0x21')]=_0x3b82ef[_0xced6('0x45')];if(_0xdab8f8[_0xced6('0x21')]===0x0)return[];return db[_0xced6('0x97')][_0xced6('0x40')](_0x29c70f['toString'](),_0x26869d)[_0xced6('0x26')](function(_0x275476){_0xfb411f=_[_0xced6('0x99')](_0x275476,'id');_0x26869d=_[_0xced6('0x9a')](_0x26869d,{'model':db[_0xced6('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x142103[_0xced6('0x40')][_0xced6('0x44')]){_0xef15b4[_0xced6('0x43')][_0xced6('0x31')](function(_0x156f4c){_0x469215[_0xced6('0x4e')]('i.'+_0x156f4c);});}else{_0x469215[_0xced6('0x4e')](_0xced6('0x8d'),'unreadMessages');_0x469215[_0xced6('0x4e')]('a.key',_0xced6('0x9b'));_0x469215[_0xced6('0x4e')](_0xced6('0x9c'),'Account.mandatoryDisposition');_0x469215[_0xced6('0x4e')](_0xced6('0x9d'),_0xced6('0x9e'));_0x469215[_0xced6('0x4e')](_0xced6('0x9f'));_0x469215[_0xced6('0x4e')](_0xced6('0xa0'),_0xced6('0xa1'));_0x469215[_0xced6('0x4e')](_0xced6('0xa2'),_0xced6('0xa3'));_0x469215[_0xced6('0x4e')](_0xced6('0xa4'),'Contact.email');_0x469215[_0xced6('0x4e')]('c.phone',_0xced6('0xa5'));_0x469215[_0xced6('0x4e')](_0xced6('0xa6'),_0xced6('0xa7'));_0x469215[_0xced6('0x4e')](_0xced6('0xa8'),_0xced6('0xa9'));_0x469215[_0xced6('0x4e')]('o.fullname',_0xced6('0xaa'));_0x469215[_0xced6('0x4e')](_0xced6('0xab'),_0xced6('0xac'));_0x469215[_0xced6('0x4e')](_0xced6('0xad'),'TagIds');}if(_0xef15b4['limit'])_0x469215[_0xced6('0x20')](_0xef15b4[_0xced6('0x20')]);if(_0xef15b4[_0xced6('0x1e')])_0x469215['offset'](_0xef15b4['offset']);return db['sequelize'][_0xced6('0x40')](_0x469215[_0xced6('0x98')](),_0x26869d);})[_0xced6('0x26')](function(_0x1c4680){if(_0x1c4680[_0xced6('0x45')]>0x0)_0x4737fb[_0xced6('0x4a')](_0xced6('0xae'),_[_0xced6('0x2d')](_0x1c4680,'id'));return db[_0xced6('0x97')]['query'](_0x4737fb[_0xced6('0x98')](),_0x26869d)[_0xced6('0x26')](function(_0x3605b4){var _0xaee024=_[_0xced6('0xaf')](_0x3605b4,_0xced6('0xb0'));var _0x387110=[];_0x1c4680[_0xced6('0x31')](function(_0x1318d6){_0x387110[_0xced6('0xb1')](updateFaxInteraction(_0x1318d6,_0xfb411f,_0xaee024));});return BPromise[_0xced6('0xb2')](_0x387110);});});})[_0xced6('0x26')](function(_0x4c57e7){_0xdab8f8['rows']=_0x4c57e7;return _0xdab8f8;})[_0xced6('0x26')](respondWithFilteredResult(_0x315024,_0xef15b4))[_0xced6('0x32')](handleError(_0x315024,null));};exports[_0xced6('0xb3')]=function(_0x1b9ff2,_0x2fb728){var _0x37cc44={'raw':![],'where':{'id':_0x1b9ff2[_0xced6('0xb4')]['id']}},_0x1b3f58={};_0x1b3f58[_0xced6('0x42')]=_[_0xced6('0x3f')](db['FaxInteraction'][_0xced6('0x3b')]);_0x1b3f58[_0xced6('0x40')]=_[_0xced6('0x3f')](_0x1b9ff2['query']);_0x1b3f58[_0xced6('0x4c')]=_[_0xced6('0x41')](_0x1b3f58[_0xced6('0x42')],_0x1b3f58['query']);_0x37cc44[_0xced6('0x43')]=_['intersection'](_0x1b3f58[_0xced6('0x42')],qs[_0xced6('0x44')](_0x1b9ff2[_0xced6('0x40')]['fields']));_0x37cc44[_0xced6('0x43')]=_0x37cc44[_0xced6('0x43')][_0xced6('0x45')]?_0x37cc44['attributes']:_0x1b3f58[_0xced6('0x42')];if(_0x1b9ff2[_0xced6('0x40')]['includeAll']){_0x37cc44['include']=[{'all':!![]}];}_0x37cc44=_['merge']({},_0x37cc44,_0x1b9ff2[_0xced6('0xb5')]);return db[_0xced6('0x3a')][_0xced6('0x63')](_0x37cc44)[_0xced6('0x26')](handleEntityNotFound(_0x2fb728,null))[_0xced6('0x26')](respondWithResult(_0x2fb728,null))[_0xced6('0x32')](handleError(_0x2fb728,null));};exports['create']=function(_0x434974,_0x5cff4e){return db[_0xced6('0x3a')]['create'](_0x434974[_0xced6('0x75')],{})['then'](respondWithResult(_0x5cff4e,0xc9))[_0xced6('0x32')](handleError(_0x5cff4e,null));};exports['update']=function(_0x14c3aa,_0x1568ad){if(_0x14c3aa[_0xced6('0x75')]['id']){delete _0x14c3aa[_0xced6('0x75')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x14c3aa[_0xced6('0xb4')]['id']}})[_0xced6('0x26')](handleEntityNotFound(_0x1568ad,null))[_0xced6('0x26')](saveUpdates(_0x14c3aa['body'],null))['then'](respondWithResult(_0x1568ad,null))['catch'](handleError(_0x1568ad,null));};exports['destroy']=function(_0x3d80bf,_0x3af9dd){return db[_0xced6('0x3a')][_0xced6('0x63')]({'where':{'id':_0x3d80bf[_0xced6('0xb4')]['id']}})['then'](handleEntityNotFound(_0x3af9dd,null))[_0xced6('0x26')](removeEntity(_0x3af9dd,null))[_0xced6('0x32')](handleError(_0x3af9dd,null));};exports[_0xced6('0xb6')]=function(_0x2fddd8,_0x3152d1){return db[_0xced6('0x3a')][_0xced6('0xb6')]()[_0xced6('0x26')](respondWithResult(_0x3152d1,null))[_0xced6('0x32')](handleError(_0x3152d1,null));};exports[_0xced6('0xb7')]=function(_0x14caad,_0x1e1d33,_0x2467a5){return db[_0xced6('0xb8')][_0xced6('0x63')]({'where':{'id':_0x14caad[_0xced6('0xb4')]['id']}})[_0xced6('0x26')](handleEntityNotFound(_0x1e1d33,null))[_0xced6('0x26')](function(_0x662936){if(_0x662936){return _0x662936['addMessage'](_0x14caad[_0xced6('0x75')][_0xced6('0xb9')],_['omit'](_0x14caad[_0xced6('0x75')],['ids','id'])||{});}})[_0xced6('0x26')](respondWithResult(_0x1e1d33,null))[_0xced6('0x32')](handleError(_0x1e1d33,null));};exports[_0xced6('0xba')]=function(_0x345c63,_0x44c2d4,_0x128549){var _0x81b992={'raw':![],'where':{}};var _0x2edf62={};var _0x1d7d88={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xced6('0xbb')]({'where':{'id':_0x345c63[_0xced6('0xb4')]['id']}})[_0xced6('0x26')](handleEntityNotFound(_0x44c2d4,null))[_0xced6('0x26')](function(_0x368861){if(_0x368861){_0x2edf62[_0xced6('0x42')]=_[_0xced6('0x3f')](db[_0xced6('0xb8')][_0xced6('0x3b')]);_0x2edf62[_0xced6('0x40')]=_[_0xced6('0x3f')](_0x345c63[_0xced6('0x40')]);_0x2edf62[_0xced6('0x4c')]=_['intersection'](_0x2edf62[_0xced6('0x42')],_0x2edf62[_0xced6('0x40')]);_0x81b992[_0xced6('0x43')]=_[_0xced6('0x41')](_0x2edf62[_0xced6('0x42')],qs[_0xced6('0x44')](_0x345c63['query'][_0xced6('0x44')]));_0x81b992[_0xced6('0x43')]=_0x81b992[_0xced6('0x43')]['length']?_0x81b992[_0xced6('0x43')]:_0x2edf62[_0xced6('0x42')];if(!_0x345c63[_0xced6('0x40')][_0xced6('0x46')](_0xced6('0x47'))){_0x81b992[_0xced6('0x20')]=qs['limit'](_0x345c63[_0xced6('0x40')][_0xced6('0x20')]);_0x81b992[_0xced6('0x1e')]=qs[_0xced6('0x1e')](_0x345c63[_0xced6('0x40')][_0xced6('0x1e')]);}_0x81b992[_0xced6('0x48')]=qs[_0xced6('0x49')](_0x345c63[_0xced6('0x40')]['sort']);_0x81b992['where']=qs[_0xced6('0x4c')](_[_0xced6('0x4b')](_0x345c63[_0xced6('0x40')],_0x2edf62[_0xced6('0x4c')]));_0x81b992[_0xced6('0x4a')]['FaxInteractionId']=_0x368861['id'];if(_0x345c63[_0xced6('0x40')][_0xced6('0x82')]){_0x81b992[_0xced6('0x4a')]=_[_0xced6('0x9a')](_0x81b992[_0xced6('0x4a')],{'$or':_[_0xced6('0x2d')](_0x81b992['attributes'],function(_0x368d8b){var _0x407700={};_0x407700[_0x368d8b]={'$like':'%'+_0x345c63[_0xced6('0x40')][_0xced6('0x82')]+'%'};return _0x407700;})});}if(_0x345c63[_0xced6('0x40')][_0xced6('0xbc')]){var _0x27d208=_0x345c63[_0xced6('0x40')][_0xced6('0xbc')]['split'](',');var _0x198041={};_0x198041[_0x27d208[0x0]]={'$gte':moment(_0x27d208[0x1])['format'](_0xced6('0xbd'))};_0x81b992[_0xced6('0x4a')]=_['merge'](_0x81b992[_0xced6('0x4a')],_0x198041);}_0x81b992=_['merge']({},_0x81b992,_0x345c63[_0xced6('0xb5')]);return db['FaxMessage'][_0xced6('0x21')]({'where':_0x81b992[_0xced6('0x4a')]})['then'](function(_0x446269){_0x1d7d88[_0xced6('0x21')]=_0x446269;if(_0x345c63[_0xced6('0x40')][_0xced6('0xbe')]){_0x81b992[_0xced6('0xbf')]=[{'all':!![]}];}return db[_0xced6('0xb8')]['findAll'](_0x81b992);})[_0xced6('0x26')](function(_0x5bdbba){_0x1d7d88[_0xced6('0xc0')]=_0x5bdbba;return _0x1d7d88;});}})[_0xced6('0x26')](respondWithFilteredResult(_0x44c2d4,_0x81b992))[_0xced6('0x32')](handleError(_0x44c2d4,null));};exports[_0xced6('0xc1')]=function(_0x2642cd,_0x44982d,_0x319a7d){return db[_0xced6('0x3a')][_0xced6('0x63')]({'where':{'id':_0x2642cd[_0xced6('0xb4')]['id']}})['then'](handleEntityNotFound(_0x44982d,null))[_0xced6('0x26')](function(_0x159c24){if(_0x159c24){return _0x159c24[_0xced6('0xc2')](_0x2642cd['body']['ids'],_[_0xced6('0xc3')](_0x2642cd[_0xced6('0x75')],[_0xced6('0xb9'),'id'])||{})['spread'](function(){return db[_0xced6('0x70')][_0xced6('0xc4')]({'attributes':['id',_0xced6('0x2a'),_0xced6('0x4f')],'where':{'id':_0x2642cd[_0xced6('0x75')][_0xced6('0xb9')]}});})[_0xced6('0x26')](function(_0x49da70){socket[_0xced6('0xc5')]('faxInteractionTags:save',{'id':Number(_0x2642cd[_0xced6('0xb4')]['id']),'tags':_0x49da70||[]});return{'id':Number(_0x2642cd[_0xced6('0xb4')]['id']),'tags':_0x49da70||[]};});}})[_0xced6('0x26')](respondWithResult(_0x44982d,null))[_0xced6('0x32')](handleError(_0x44982d,null));};exports[_0xced6('0xc6')]=function(_0x11376d,_0x4a2b9c,_0x3dc38c){return db[_0xced6('0x3a')][_0xced6('0x63')]({'where':{'id':_0x11376d[_0xced6('0xb4')]['id']}})[_0xced6('0x26')](handleEntityNotFound(_0x4a2b9c,null))[_0xced6('0x26')](function(_0x1033f9){if(_0x1033f9){return _0x1033f9[_0xced6('0xc6')](_0x11376d[_0xced6('0x40')][_0xced6('0xb9')]);}})[_0xced6('0x26')](respondWithStatusCode(_0x4a2b9c,null))['catch'](handleError(_0x4a2b9c,null));};exports['download']=function(_0x512eac,_0x1a36e1){var _0x247aa0=moment()[_0xced6('0xc7')]()[_0xced6('0x98')]();var _0x24431a=path[_0xced6('0xc8')](config[_0xced6('0xc9')],_0xced6('0xca'),_0xced6('0xcb'),_0xced6('0xcc'));var _0x536913=path[_0xced6('0xc8')](config[_0xced6('0xc9')],_0xced6('0xca'),_0xced6('0xcb'),'attachments');var _0x45b50d=path['join'](_0x24431a,_0x247aa0);var _0x50030a=util[_0xced6('0xcd')]('transcript-%d-%s.zip',_0x512eac['params']['id'],_0x247aa0);var _0x464ecd=path[_0xced6('0xc8')](_0x24431a,_0x50030a);var _0xf9495f=[];_0xf9495f[_0xced6('0xb1')]({'model':db[_0xced6('0xce')],'as':_0xced6('0xce'),'raw':!![]});var _0x406963=[{'model':db['FaxMessage'],'as':_0xced6('0xcf'),'attributes':['id',_0xced6('0x75'),_0xced6('0x79')],'include':_0xf9495f}];return db[_0xced6('0x3a')][_0xced6('0x63')]({'where':{'id':_0x512eac[_0xced6('0xb4')]['id']},'include':_0x406963})[_0xced6('0x26')](handleEntityNotFound(_0x1a36e1,null))[_0xced6('0x26')](function(_0x916c7){if(_0x916c7&&_0x916c7[_0xced6('0xcf')]){var _0x7e6a0e=_0x916c7[_0xced6('0xd0')]({'plain':!![]});fs[_0xced6('0xd1')](_0x45b50d);for(var _0x1491bb=0x0;_0x1491bb<_0x7e6a0e[_0xced6('0xcf')][_0xced6('0x45')];_0x1491bb++){var _0x2d32e=_0x7e6a0e['Messages'][_0x1491bb][_0xced6('0xce')];if(_0x2d32e){var _0x19f86b=path[_0xced6('0xc8')](_0x536913,_0x2d32e[_0xced6('0xd2')]);if(fs['existsSync'](_0x19f86b)){fs[_0xced6('0xd3')](_0x19f86b)['pipe'](fs[_0xced6('0xd4')](path[_0xced6('0xc8')](_0x45b50d,_0x2d32e['basename'])));}}}return BPromise[_0xced6('0x8f')]()[_0xced6('0x26')](function(){return new BPromise(function(_0x2b36e3,_0x5ac6a5){zipdir(_0x45b50d,{'saveTo':_0x464ecd},function(_0x3d973d,_0x27dca8){if(_0x3d973d)return _0x5ac6a5(_0x3d973d);return _0x2b36e3(_0x27dca8);});})[_0xced6('0x26')](function(){return new BPromise(function(_0x533336,_0x1f0acf){rimraf(_0x45b50d,function(_0x5bfb5c){if(_0x5bfb5c)_0x1f0acf(_0x5bfb5c);return _0x533336();});});})[_0xced6('0x26')](function(){return _0x1a36e1[_0xced6('0xd5')](_0x464ecd,_0x50030a,function(_0x297c94){if(_0x297c94){console[_0xced6('0xd6')](_0xced6('0xd7'),_0x297c94);}else{fs[_0xced6('0xd8')](_0x464ecd);}});});});}else{return _0x1a36e1[_0xced6('0x1b')](0xc8);}})[_0xced6('0x32')](handleError(_0x1a36e1,null));}; \ No newline at end of file +var _0x5ecd=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','Users','fullname','TagIds','Tags','split','catch','waiting','talking','answered','unmanaged','closed','UserId','total','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','select','field','color','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','o.id\x20=\x20i.UserId','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','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','isEmpty','FaxAccountId','parse','$gte','$lte','\x20IS\x20NULL','\x20=\x20?','read','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','QueryTypes','clone','contactName','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','toString','merge','FaxInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','push','all','rows','show','params','includeAll','options','create','body','update','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','setTags','Tag','emit','faxInteractionTags:save','removeTags','download','root','files','tmp','server','attachments','join','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','createReadStream','resolve','log','unlinkSync','eml-format','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end'];(function(_0x111dd3,_0x261863){var _0x3205fd=function(_0x22af52){while(--_0x22af52){_0x111dd3['push'](_0x111dd3['shift']());}};_0x3205fd(++_0x261863);}(_0x5ecd,0x182));var _0xd5ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5ecd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd5ec('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd5ec('0x1'));var rp=require('request-promise');var moment=require(_0xd5ec('0x2'));var BPromise=require(_0xd5ec('0x3'));var Mustache=require(_0xd5ec('0x4'));var util=require('util');var path=require('path');var sox=require(_0xd5ec('0x5'));var csv=require(_0xd5ec('0x6'));var ejs=require(_0xd5ec('0x7'));var fs=require('fs');var fs_extra=require(_0xd5ec('0x8'));var _=require('lodash');var squel=require(_0xd5ec('0x9'));var crypto=require(_0xd5ec('0xa'));var jsforce=require(_0xd5ec('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd5ec('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd5ec('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xd5ec('0xd'));var as=require(_0xd5ec('0xe'));var hardwareService=require(_0xd5ec('0xf'));var logger=require(_0xd5ec('0x10'))(_0xd5ec('0x11'));var utils=require('../../config/utils');var config=require(_0xd5ec('0x12'));var licenseUtil=require(_0xd5ec('0x13'));var db=require(_0xd5ec('0x14'))['db'];config[_0xd5ec('0x15')]=_[_0xd5ec('0x16')](config[_0xd5ec('0x15')],{'host':_0xd5ec('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd5ec('0x15')]));require('./faxInteraction.socket')[_0xd5ec('0x18')](socket);function respondWithStatusCode(_0x5f32c4,_0x2e512f){_0x2e512f=_0x2e512f||0xcc;return function(_0x12c9f9){if(_0x12c9f9){return _0x5f32c4[_0xd5ec('0x19')](_0x2e512f);}return _0x5f32c4[_0xd5ec('0x1a')](_0x2e512f)[_0xd5ec('0x1b')]();};}function respondWithResult(_0x32c496,_0x1c738f){_0x1c738f=_0x1c738f||0xc8;return function(_0x15df94){if(_0x15df94){return _0x32c496[_0xd5ec('0x1a')](_0x1c738f)[_0xd5ec('0x1c')](_0x15df94);}};}function respondWithFilteredResult(_0x15158c,_0x111def){return function(_0x587164){if(_0x587164){var _0x160cdc=typeof _0x111def['offset']===_0xd5ec('0x1d')&&typeof _0x111def[_0xd5ec('0x1e')]===_0xd5ec('0x1d');var _0x280082=_0x587164[_0xd5ec('0x1f')];var _0x314764=_0x160cdc?0x0:_0x111def['offset'];var _0x4941e4=_0x160cdc?_0x587164[_0xd5ec('0x1f')]:_0x111def[_0xd5ec('0x20')]+_0x111def[_0xd5ec('0x1e')];var _0x12c553;if(_0x4941e4>=_0x280082){_0x4941e4=_0x280082;_0x12c553=0xc8;}else{_0x12c553=0xce;}_0x15158c[_0xd5ec('0x1a')](_0x12c553);return _0x15158c[_0xd5ec('0x21')](_0xd5ec('0x22'),_0x314764+'-'+_0x4941e4+'/'+_0x280082)[_0xd5ec('0x1c')](_0x587164);}return null;};}function patchUpdates(_0x1941ff){return function(_0x8214cd){try{jsonpatch[_0xd5ec('0x23')](_0x8214cd,_0x1941ff,!![]);}catch(_0x303bc2){return BPromise[_0xd5ec('0x24')](_0x303bc2);}return _0x8214cd[_0xd5ec('0x25')]();};}function saveUpdates(_0x4242dc,_0x3bc9e8){return function(_0x3c2b96){if(_0x3c2b96){return _0x3c2b96['update'](_0x4242dc)[_0xd5ec('0x26')](function(_0x1b8596){return _0x1b8596;});}return null;};}function removeEntity(_0x4233e8,_0x2f362c){return function(_0x12ae5e){if(_0x12ae5e){return _0x12ae5e[_0xd5ec('0x27')]()[_0xd5ec('0x26')](function(){_0x4233e8[_0xd5ec('0x1a')](0xcc)[_0xd5ec('0x1b')]();});}};}function handleEntityNotFound(_0x3cad6d,_0x12f739){return function(_0x27962b){if(!_0x27962b){_0x3cad6d['sendStatus'](0x194);}return _0x27962b;};}function handleError(_0xac4665,_0x4afb11){_0x4afb11=_0x4afb11||0x1f4;return function(_0x5f374c){logger['error'](_0x5f374c[_0xd5ec('0x28')]);if(_0x5f374c['name']){delete _0x5f374c[_0xd5ec('0x29')];}_0xac4665[_0xd5ec('0x1a')](_0x4afb11)[_0xd5ec('0x2a')](_0x5f374c);};}function getInteractionUsers(_0x2b377f,_0x5e79c9){return new BPromise(function(_0x740db4,_0x213e9b){try{if(_0x5e79c9[_0x2b377f['id']]){_0x2b377f[_0xd5ec('0x2b')]=_['map'](_0x5e79c9[_0x2b377f['id']],function(_0x35bc2c){return{'id':_0x35bc2c['id'],'fullname':_0x35bc2c[_0xd5ec('0x2c')]};});}}catch(_0x1e0565){_0x213e9b(_0x1e0565);}_0x740db4(_0x2b377f);});}function getInteractionTags(_0x356859,_0xc608c5){return new BPromise(function(_0x144026,_0x4fe199){try{if(_0x356859[_0xd5ec('0x2d')]){_0x356859[_0xd5ec('0x2e')]=[];_0x356859[_0xd5ec('0x2d')][_0xd5ec('0x2f')](',')['forEach'](function(_0x534e45){_0x356859[_0xd5ec('0x2e')]['push'](_0xc608c5[_0x534e45]);});}delete _0x356859['TagIds'];}catch(_0x12616c){_0x4fe199(_0x12616c);}_0x144026(_0x356859);});}function updateFaxInteraction(_0x5bde67,_0x4e6675,_0x5a4629){return new BPromise(function(_0x3a4d18,_0x2f0150){return getInteractionUsers(_0x5bde67,_0x5a4629)[_0xd5ec('0x26')](function(_0x4e1370){return getInteractionTags(_0x4e1370,_0x4e6675);})[_0xd5ec('0x26')](function(_0x213632){return getStateInteraction(_0x213632);})[_0xd5ec('0x26')](function(_0xacd519){_0x3a4d18(_0xacd519);})[_0xd5ec('0x30')](function(_0x5ce817){_0x2f0150(_0x5ce817);});});}function getStateInteraction(_0x176b09){return new BPromise(function(_0xe9f754){_0x176b09[_0xd5ec('0x31')]=0x0;_0x176b09[_0xd5ec('0x32')]=0x0;_0x176b09[_0xd5ec('0x33')]=0x0;_0x176b09[_0xd5ec('0x34')]=0x0;_0x176b09['total']=0x0;if(!_0x176b09[_0xd5ec('0x35')]&&!_0x176b09[_0xd5ec('0x36')]){_0x176b09[_0xd5ec('0x31')]+=0x1;}if(!_0x176b09[_0xd5ec('0x35')]&&_0x176b09[_0xd5ec('0x36')]){_0x176b09[_0xd5ec('0x32')]+=0x1;if(_0x176b09[_0xd5ec('0x31')]){_0x176b09[_0xd5ec('0x31')]-=0x1;}}if(_0x176b09[_0xd5ec('0x35')]&&_0x176b09[_0xd5ec('0x36')]){_0x176b09[_0xd5ec('0x33')]+=0x1;if(_0x176b09['talking']){_0x176b09['talking']-=0x1;}}if(_0x176b09[_0xd5ec('0x35')]&&!_0x176b09[_0xd5ec('0x36')]){_0x176b09[_0xd5ec('0x34')]+=0x1;if(_0x176b09['waiting']){_0x176b09['waiting']-=0x1;}}_0x176b09[_0xd5ec('0x37')]+=0x1;_0xe9f754(_0x176b09);});}exports['index']=function(_0x47fc53,_0x52ebb8){var _0x2ecd61={},_0x11ca17={},_0xd8e8d8={'count':0x0,'rows':[]};var _0x158060=_[_0xd5ec('0x38')](db['FaxInteraction'][_0xd5ec('0x39')],function(_0x117892){return{'name':_0x117892['fieldName'],'type':_0x117892[_0xd5ec('0x3a')]['key']};});_0x11ca17[_0xd5ec('0x3b')]=_['map'](_0x158060,_0xd5ec('0x29'));_0x11ca17[_0xd5ec('0x3c')]=_[_0xd5ec('0x3d')](_0x47fc53[_0xd5ec('0x3c')]);_0x11ca17[_0xd5ec('0x3e')]=_[_0xd5ec('0x3f')](_0x11ca17['model'],_0x11ca17[_0xd5ec('0x3c')]);_0x2ecd61[_0xd5ec('0x40')]=_[_0xd5ec('0x3f')](_0x11ca17[_0xd5ec('0x3b')],qs[_0xd5ec('0x41')](_0x47fc53[_0xd5ec('0x3c')][_0xd5ec('0x41')]));_0x2ecd61[_0xd5ec('0x40')]=_0x2ecd61[_0xd5ec('0x40')][_0xd5ec('0x42')]?_0x2ecd61[_0xd5ec('0x40')]:_0x11ca17[_0xd5ec('0x3b')];if(!_0x47fc53[_0xd5ec('0x3c')][_0xd5ec('0x43')]('nolimit')){_0x2ecd61['limit']=qs['limit'](_0x47fc53[_0xd5ec('0x3c')]['limit']);_0x2ecd61['offset']=qs[_0xd5ec('0x20')](_0x47fc53['query'][_0xd5ec('0x20')]);}_0x2ecd61[_0xd5ec('0x44')]=qs[_0xd5ec('0x45')](_0x47fc53[_0xd5ec('0x3c')]['sort']);_0x2ecd61[_0xd5ec('0x46')]=qs[_0xd5ec('0x3e')](_[_0xd5ec('0x47')](_0x47fc53[_0xd5ec('0x3c')],_0x11ca17[_0xd5ec('0x3e')]),_0x158060);var _0x185030=[];var _0x3ee49a=squel[_0xd5ec('0x48')]()[_0xd5ec('0x49')]('id')[_0xd5ec('0x49')](_0xd5ec('0x29'))[_0xd5ec('0x49')](_0xd5ec('0x4a'))['from']('tools_tags');var _0x4b1ed3=squel[_0xd5ec('0x48')]()[_0xd5ec('0x49')](_0xd5ec('0x4b'))[_0xd5ec('0x49')](_0xd5ec('0x4c'))['field'](_0xd5ec('0x4d'))['from'](_0xd5ec('0x4e'),'ui')[_0xd5ec('0x4f')](_0xd5ec('0x50'),'u',_0xd5ec('0x51'));var _0x59566f=squel[_0xd5ec('0x48')]()['from'](_0xd5ec('0x52'),'i')[_0xd5ec('0x4f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xd5ec('0x4f')](_0xd5ec('0x50'),'o',_0xd5ec('0x53'))['left_join']('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')[_0xd5ec('0x4f')]('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')[_0xd5ec('0x4f')](_0xd5ec('0x54'),'it',_0xd5ec('0x55'))[_0xd5ec('0x4f')](_0xd5ec('0x56'),'t',_0xd5ec('0x57'));var _0x1e88c4=squel[_0xd5ec('0x58')]();var _0x221f51=[];var _0x167b76=squel[_0xd5ec('0x58')]();var _0x4d30d0;if(_0x47fc53['query'][_0xd5ec('0x59')]){_0x4d30d0=as[_0xd5ec('0x5a')](_0x47fc53[_0xd5ec('0x3c')][_0xd5ec('0x59')]);var _0x287249=_0x4d30d0['sqlOperator'];for(var _0xc3c1c6=0x0;_0xc3c1c6<_0x4d30d0[_0xd5ec('0x5b')][_0xd5ec('0x42')];_0xc3c1c6++){var _0x3c7fbf=_0x4d30d0[_0xd5ec('0x5b')][_0xc3c1c6];var _0x1fb302='i';var _0x3a396b=_[_0xd5ec('0x5c')](_0x158060,['name',_0x3c7fbf[_0xd5ec('0x49')]]);if(!_0x3a396b){switch(_0x3c7fbf[_0xd5ec('0x49')]){case _0xd5ec('0x5d'):if(_0x3c7fbf[_0xd5ec('0x5e')]==0x1){_0x59566f[_0xd5ec('0x5f')]('`'+_0x3c7fbf[_0xd5ec('0x49')]+_0xd5ec('0x60'));}else{_0x59566f[_0xd5ec('0x5f')]('`'+_0x3c7fbf[_0xd5ec('0x49')]+_0xd5ec('0x61'));}break;case _0xd5ec('0x62'):if(_0x3c7fbf['operator']===_0xd5ec('0x63')){if(_0x3c7fbf[_0xd5ec('0x5e')][_0xd5ec('0x2f')]('\x20')[_0xd5ec('0x42')]>0x1){_0x1e88c4[_0x287249](_0xd5ec('0x64'),qs[_0xd5ec('0x65')](_0x3c7fbf[_0xd5ec('0x5e')]),null);}else{var _0x42a0c5='%'+_0x3c7fbf['value']+'%';_0x1e88c4[_0x287249](_0xd5ec('0x66'),_0x42a0c5,_0x42a0c5,_0x42a0c5);}}else{_0x3a396b=_[_0xd5ec('0x5c')](_0x158060,[_0xd5ec('0x29'),_0xd5ec('0x67')]);_0x3c7fbf[_0xd5ec('0x49')]=_0xd5ec('0x67');_0x5966c7=as[_0xd5ec('0x68')](_0x1fb302,_0x3a396b[_0xd5ec('0x3a')],_0x3c7fbf);_0x1e88c4[_0x287249](_0x5966c7[_0xd5ec('0x69')],_0x5966c7[_0xd5ec('0x5e')][_0xd5ec('0x6a')],_0x5966c7[_0xd5ec('0x5e')][_0xd5ec('0x1b')]);}break;case'Tag':var _0x3716ee=_0x3c7fbf[_0xd5ec('0x5e')][_0xd5ec('0x2f')](',')[_0xd5ec('0x38')](function(_0x418b62){return Number(_0x418b62);});_0x3716ee[_0xd5ec('0x6b')](function(_0xf736c3){_0x167b76['or'](_0xd5ec('0x6c'),'%,'+_0xf736c3+',%');});_0x221f51=_[_0xd5ec('0x6d')](_0x221f51,_0x3716ee);break;case _0xd5ec('0x6e'):if(_0x3c7fbf[_0xd5ec('0x6f')]===_0xd5ec('0x63')){_0x1e88c4[_0x287249](_0xd5ec('0x70'),'%'+_0x3c7fbf[_0xd5ec('0x5e')]+'%',null);}else{_0x3a396b=_[_0xd5ec('0x5c')](_0x158060,[_0xd5ec('0x29'),'UserId']);_0x3c7fbf['field']=_0xd5ec('0x36');_0x5966c7=as[_0xd5ec('0x68')](_0x1fb302,_0x3a396b[_0xd5ec('0x3a')],_0x3c7fbf);_0x1e88c4[_0x287249](_0x5966c7[_0xd5ec('0x69')],_0x5966c7[_0xd5ec('0x5e')][_0xd5ec('0x6a')],_0x5966c7[_0xd5ec('0x5e')][_0xd5ec('0x1b')]);}break;case'body':_0x5966c7=as['buildExpression']('me',null,_0x3c7fbf);_0x1e88c4[_0x287249](_0x5966c7[_0xd5ec('0x69')],_0x5966c7['value'][_0xd5ec('0x6a')],_0x5966c7[_0xd5ec('0x5e')]['end']);break;}}else{var _0x5966c7=as[_0xd5ec('0x68')](_0x1fb302,_0x3a396b[_0xd5ec('0x3a')],_0x3c7fbf);_0x1e88c4[_0x287249](_0x5966c7[_0xd5ec('0x69')],_0x5966c7['value']['start'],_0x5966c7['value'][_0xd5ec('0x1b')]);}}}else{var _0x28b780=_(_0x47fc53[_0xd5ec('0x3c')])[_0xd5ec('0x3d')]()['map'](function(_0x525cc6){return _[_0xd5ec('0x71')](_0x158060,[_0xd5ec('0x29'),_0x525cc6])?_0x525cc6:undefined;})['compact']()[_0xd5ec('0x5e')]();if(!_[_0xd5ec('0x72')](_0x28b780)){_0x28b780[_0xd5ec('0x6b')](function(_0x407162){if(_0x407162===_0xd5ec('0x73')){_0x59566f[_0xd5ec('0x46')]('i.FaxAccountId\x20IN\x20?',[]['concat'](_0x47fc53['query'][_0x407162]));}else if(_0x407162==='createdAt'){var _0x2e1234=JSON[_0xd5ec('0x74')](_0x47fc53['query'][_0x407162])[_0xd5ec('0x75')];var _0x14c015=JSON[_0xd5ec('0x74')](_0x47fc53['query'][_0x407162])[_0xd5ec('0x76')];_0x59566f[_0xd5ec('0x46')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e1234,_0x14c015);}else{if(_0x47fc53[_0xd5ec('0x3c')][_0x407162]==='null'){_0x59566f['where']('i.'+_0x407162+_0xd5ec('0x77'));}else{_0x59566f[_0xd5ec('0x46')]('i.'+_0x407162+_0xd5ec('0x78'),_0x47fc53[_0xd5ec('0x3c')][_0x407162]);}}});}if(_0x47fc53[_0xd5ec('0x3c')]['read']){if(_0x47fc53[_0xd5ec('0x3c')][_0xd5ec('0x79')]==0x1){_0x59566f[_0xd5ec('0x5f')]('`unreadMessages`\x20=\x200');}else{_0x59566f['having']('`unreadMessages`\x20>\x200');}}if(_0x47fc53[_0xd5ec('0x3c')][_0xd5ec('0x7a')]){_0x221f51=_['isArray'](_0x47fc53['query'][_0xd5ec('0x7a')])?_0x47fc53[_0xd5ec('0x3c')][_0xd5ec('0x7a')]:new Array(_0x47fc53['query'][_0xd5ec('0x7a')]);_0x221f51[_0xd5ec('0x6b')](function(_0x111ab4){_0x167b76['or'](_0xd5ec('0x6c'),'%,'+_0x111ab4+',%');});}if(_0x47fc53[_0xd5ec('0x3c')][_0xd5ec('0x7b')]){var _0x3e2153=_0x47fc53[_0xd5ec('0x3c')][_0xd5ec('0x7b')][_0xd5ec('0x7c')]('\x5c','\x5c\x5c')[_0xd5ec('0x7c')](/'/g,'\x27\x27');if(qs[_0xd5ec('0x7d')](_0x3e2153)){_0x1e88c4['or'](_0xd5ec('0x7e'),_0x3e2153+'%')['or']('i.fax\x20LIKE\x20?',_0x3e2153+'%');}_0x1e88c4['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3e2153+'%');}}_0x59566f[_0xd5ec('0x46')](_0x1e88c4);_0x59566f[_0xd5ec('0x7f')]('i.id');var _0x191477={'type':db['Sequelize'][_0xd5ec('0x80')]['SELECT'],'raw':!![]};var _0x322539=_0x59566f[_0xd5ec('0x81')]();_0x322539['field']('i.id');_0x322539[_0xd5ec('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd5ec('0x5d'));if(_0x2ecd61[_0xd5ec('0x44')]){_0x2ecd61[_0xd5ec('0x44')][_0xd5ec('0x6b')](function(_0x1c53f2){var _0x57c948=_0x1c53f2[0x0]===_0xd5ec('0x82')?_0x1c53f2[0x0]:'i.'+_0x1c53f2[0x0];_0x59566f['order'](_0x57c948,_0x1c53f2[0x1]===_0xd5ec('0x83')?![]:!![]);});}if(!_[_0xd5ec('0x72')](_0x221f51)){_0x59566f[_0xd5ec('0x5f')](_0x167b76);_0x322539['where'](_0xd5ec('0x84'),_0x221f51);}BPromise['resolve']()[_0xd5ec('0x26')](function(){if(!_0x4d30d0){if(_0x47fc53[_0xd5ec('0x3c')][_0xd5ec('0x73')])return;_0x322539[_0xd5ec('0x46')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x59566f[_0xd5ec('0x46')](_0xd5ec('0x85'));return;}if(_0x47fc53[_0xd5ec('0x86')][_0xd5ec('0x87')]!==_0xd5ec('0x88'))return;return _0x47fc53['user']['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xd5ec('0x26')](function(_0x57461a){if(_[_0xd5ec('0x72')](_0x57461a)){_0x322539[_0xd5ec('0x46')](_0xd5ec('0x89'));_0x59566f[_0xd5ec('0x46')](_0xd5ec('0x89'));}else{_0x322539['where'](_0xd5ec('0x8a'),_[_0xd5ec('0x38')](_0x57461a,'id'));_0x59566f['where'](_0xd5ec('0x8a'),_[_0xd5ec('0x38')](_0x57461a,'id'));}});})['then'](function(){if(_0x47fc53[_0xd5ec('0x86')][_0xd5ec('0x87')]===_0xd5ec('0x88')&&!_0x4d30d0&&!_0x47fc53[_0xd5ec('0x3c')]['FaxAccountId'])return[];return db[_0xd5ec('0x8b')]['query'](_0x322539['toString'](),_0x191477);})['then'](function(_0x2ba455){_0xd8e8d8[_0xd5ec('0x1f')]=_0x2ba455[_0xd5ec('0x42')];if(_0xd8e8d8[_0xd5ec('0x1f')]===0x0)return[];return db['sequelize'][_0xd5ec('0x3c')](_0x3ee49a[_0xd5ec('0x8c')](),_0x191477)[_0xd5ec('0x26')](function(_0xd0bcea){_0x185030=_['keyBy'](_0xd0bcea,'id');_0x191477=_[_0xd5ec('0x8d')](_0x191477,{'model':db[_0xd5ec('0x8e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x47fc53[_0xd5ec('0x3c')][_0xd5ec('0x41')]){_0x2ecd61[_0xd5ec('0x40')]['forEach'](function(_0x4f3033){_0x59566f['field']('i.'+_0x4f3033);});}else{_0x59566f[_0xd5ec('0x49')](_0xd5ec('0x8f'),_0xd5ec('0x5d'));_0x59566f[_0xd5ec('0x49')](_0xd5ec('0x90'),_0xd5ec('0x91'));_0x59566f[_0xd5ec('0x49')]('a.mandatoryDisposition',_0xd5ec('0x92'));_0x59566f[_0xd5ec('0x49')](_0xd5ec('0x93'),'contactName');_0x59566f[_0xd5ec('0x49')](_0xd5ec('0x94'));_0x59566f[_0xd5ec('0x49')]('c.firstName',_0xd5ec('0x95'));_0x59566f[_0xd5ec('0x49')](_0xd5ec('0x96'),_0xd5ec('0x97'));_0x59566f[_0xd5ec('0x49')](_0xd5ec('0x98'),'Contact.email');_0x59566f['field']('c.phone',_0xd5ec('0x99'));_0x59566f[_0xd5ec('0x49')](_0xd5ec('0x9a'),_0xd5ec('0x9b'));_0x59566f[_0xd5ec('0x49')](_0xd5ec('0x9c'),'Contact.fax');_0x59566f[_0xd5ec('0x49')]('o.fullname','Owner.fullname');_0x59566f[_0xd5ec('0x49')](_0xd5ec('0x9d'),_0xd5ec('0x9e'));_0x59566f[_0xd5ec('0x49')](_0xd5ec('0x9f'),_0xd5ec('0x2d'));}if(_0x2ecd61[_0xd5ec('0x1e')])_0x59566f['limit'](_0x2ecd61[_0xd5ec('0x1e')]);if(_0x2ecd61[_0xd5ec('0x20')])_0x59566f[_0xd5ec('0x20')](_0x2ecd61[_0xd5ec('0x20')]);return db[_0xd5ec('0x8b')][_0xd5ec('0x3c')](_0x59566f['toString'](),_0x191477);})[_0xd5ec('0x26')](function(_0x58578d){if(_0x58578d[_0xd5ec('0x42')]>0x0)_0x4b1ed3[_0xd5ec('0x46')](_0xd5ec('0xa0'),_['map'](_0x58578d,'id'));return db[_0xd5ec('0x8b')]['query'](_0x4b1ed3[_0xd5ec('0x8c')](),_0x191477)['then'](function(_0x4bdf65){var _0x1e14f3=_[_0xd5ec('0xa1')](_0x4bdf65,'FaxInteractionId');var _0xff9df=[];_0x58578d['forEach'](function(_0x519c11){_0xff9df[_0xd5ec('0xa2')](updateFaxInteraction(_0x519c11,_0x185030,_0x1e14f3));});return BPromise[_0xd5ec('0xa3')](_0xff9df);});});})[_0xd5ec('0x26')](function(_0x120ade){_0xd8e8d8[_0xd5ec('0xa4')]=_0x120ade;return _0xd8e8d8;})['then'](respondWithFilteredResult(_0x52ebb8,_0x2ecd61))['catch'](handleError(_0x52ebb8,null));};exports[_0xd5ec('0xa5')]=function(_0x661f70,_0x154800){var _0x24597d={'raw':![],'where':{'id':_0x661f70[_0xd5ec('0xa6')]['id']}},_0x1464cd={};_0x1464cd['model']=_[_0xd5ec('0x3d')](db[_0xd5ec('0x8e')][_0xd5ec('0x39')]);_0x1464cd[_0xd5ec('0x3c')]=_[_0xd5ec('0x3d')](_0x661f70[_0xd5ec('0x3c')]);_0x1464cd[_0xd5ec('0x3e')]=_[_0xd5ec('0x3f')](_0x1464cd['model'],_0x1464cd[_0xd5ec('0x3c')]);_0x24597d['attributes']=_[_0xd5ec('0x3f')](_0x1464cd[_0xd5ec('0x3b')],qs[_0xd5ec('0x41')](_0x661f70['query'][_0xd5ec('0x41')]));_0x24597d[_0xd5ec('0x40')]=_0x24597d[_0xd5ec('0x40')][_0xd5ec('0x42')]?_0x24597d[_0xd5ec('0x40')]:_0x1464cd[_0xd5ec('0x3b')];if(_0x661f70['query'][_0xd5ec('0xa7')]){_0x24597d['include']=[{'all':!![]}];}_0x24597d=_[_0xd5ec('0x8d')]({},_0x24597d,_0x661f70[_0xd5ec('0xa8')]);return db[_0xd5ec('0x8e')]['find'](_0x24597d)['then'](handleEntityNotFound(_0x154800,null))['then'](respondWithResult(_0x154800,null))[_0xd5ec('0x30')](handleError(_0x154800,null));};exports['create']=function(_0x3918da,_0x4e3fe9){return db[_0xd5ec('0x8e')][_0xd5ec('0xa9')](_0x3918da[_0xd5ec('0xaa')],{})[_0xd5ec('0x26')](respondWithResult(_0x4e3fe9,0xc9))[_0xd5ec('0x30')](handleError(_0x4e3fe9,null));};exports[_0xd5ec('0xab')]=function(_0x5802ba,_0xd9ce23){if(_0x5802ba['body']['id']){delete _0x5802ba[_0xd5ec('0xaa')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x5802ba[_0xd5ec('0xa6')]['id']}})['then'](handleEntityNotFound(_0xd9ce23,null))['then'](saveUpdates(_0x5802ba['body'],null))[_0xd5ec('0x26')](respondWithResult(_0xd9ce23,null))[_0xd5ec('0x30')](handleError(_0xd9ce23,null));};exports[_0xd5ec('0x27')]=function(_0x572657,_0x1d5a0a){return db[_0xd5ec('0x8e')][_0xd5ec('0x5c')]({'where':{'id':_0x572657['params']['id']}})[_0xd5ec('0x26')](handleEntityNotFound(_0x1d5a0a,null))[_0xd5ec('0x26')](removeEntity(_0x1d5a0a,null))[_0xd5ec('0x30')](handleError(_0x1d5a0a,null));};exports[_0xd5ec('0xac')]=function(_0x24ec6b,_0x1a9bc5){return db[_0xd5ec('0x8e')][_0xd5ec('0xac')]()[_0xd5ec('0x26')](respondWithResult(_0x1a9bc5,null))[_0xd5ec('0x30')](handleError(_0x1a9bc5,null));};exports['addMessage']=function(_0x1c3318,_0x46c07f,_0x5bcde5){return db['FaxMessage'][_0xd5ec('0x5c')]({'where':{'id':_0x1c3318[_0xd5ec('0xa6')]['id']}})[_0xd5ec('0x26')](handleEntityNotFound(_0x46c07f,null))['then'](function(_0x1a7c91){if(_0x1a7c91){return _0x1a7c91[_0xd5ec('0xad')](_0x1c3318[_0xd5ec('0xaa')][_0xd5ec('0xae')],_[_0xd5ec('0xaf')](_0x1c3318[_0xd5ec('0xaa')],[_0xd5ec('0xae'),'id'])||{});}})[_0xd5ec('0x26')](respondWithResult(_0x46c07f,null))['catch'](handleError(_0x46c07f,null));};exports[_0xd5ec('0xb0')]=function(_0x3a2157,_0x4c1643,_0x5ab096){var _0xd4e8a9={'raw':![],'where':{}};var _0x1fede5={};var _0x423a15={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xd5ec('0xb1')]({'where':{'id':_0x3a2157['params']['id']}})[_0xd5ec('0x26')](handleEntityNotFound(_0x4c1643,null))[_0xd5ec('0x26')](function(_0x24ba93){if(_0x24ba93){_0x1fede5[_0xd5ec('0x3b')]=_['keys'](db[_0xd5ec('0xb2')][_0xd5ec('0x39')]);_0x1fede5[_0xd5ec('0x3c')]=_['keys'](_0x3a2157[_0xd5ec('0x3c')]);_0x1fede5[_0xd5ec('0x3e')]=_[_0xd5ec('0x3f')](_0x1fede5[_0xd5ec('0x3b')],_0x1fede5['query']);_0xd4e8a9[_0xd5ec('0x40')]=_[_0xd5ec('0x3f')](_0x1fede5['model'],qs[_0xd5ec('0x41')](_0x3a2157[_0xd5ec('0x3c')][_0xd5ec('0x41')]));_0xd4e8a9[_0xd5ec('0x40')]=_0xd4e8a9[_0xd5ec('0x40')][_0xd5ec('0x42')]?_0xd4e8a9[_0xd5ec('0x40')]:_0x1fede5[_0xd5ec('0x3b')];if(!_0x3a2157['query'][_0xd5ec('0x43')](_0xd5ec('0xb3'))){_0xd4e8a9['limit']=qs['limit'](_0x3a2157[_0xd5ec('0x3c')][_0xd5ec('0x1e')]);_0xd4e8a9['offset']=qs['offset'](_0x3a2157['query'][_0xd5ec('0x20')]);}_0xd4e8a9[_0xd5ec('0x44')]=qs['sort'](_0x3a2157['query'][_0xd5ec('0x45')]);_0xd4e8a9[_0xd5ec('0x46')]=qs[_0xd5ec('0x3e')](_[_0xd5ec('0x47')](_0x3a2157[_0xd5ec('0x3c')],_0x1fede5[_0xd5ec('0x3e')]));_0xd4e8a9[_0xd5ec('0x46')]['FaxInteractionId']=_0x24ba93['id'];if(_0x3a2157[_0xd5ec('0x3c')][_0xd5ec('0x7b')]){_0xd4e8a9['where']=_[_0xd5ec('0x8d')](_0xd4e8a9['where'],{'$or':_[_0xd5ec('0x38')](_0xd4e8a9[_0xd5ec('0x40')],function(_0x317843){var _0x5ec71b={};_0x5ec71b[_0x317843]={'$like':'%'+_0x3a2157[_0xd5ec('0x3c')][_0xd5ec('0x7b')]+'%'};return _0x5ec71b;})});}if(_0x3a2157[_0xd5ec('0x3c')][_0xd5ec('0x75')]){var _0x1bc091=_0x3a2157[_0xd5ec('0x3c')][_0xd5ec('0x75')][_0xd5ec('0x2f')](',');var _0xc4f52={};_0xc4f52[_0x1bc091[0x0]]={'$gte':moment(_0x1bc091[0x1])[_0xd5ec('0xb4')](_0xd5ec('0xb5'))};_0xd4e8a9[_0xd5ec('0x46')]=_[_0xd5ec('0x8d')](_0xd4e8a9[_0xd5ec('0x46')],_0xc4f52);}_0xd4e8a9=_[_0xd5ec('0x8d')]({},_0xd4e8a9,_0x3a2157[_0xd5ec('0xa8')]);return db['FaxMessage']['count']({'where':_0xd4e8a9[_0xd5ec('0x46')]})[_0xd5ec('0x26')](function(_0x2553f3){_0x423a15[_0xd5ec('0x1f')]=_0x2553f3;if(_0x3a2157[_0xd5ec('0x3c')][_0xd5ec('0xa7')]){_0xd4e8a9[_0xd5ec('0xb6')]=[{'all':!![]}];}return db[_0xd5ec('0xb2')][_0xd5ec('0xb7')](_0xd4e8a9);})[_0xd5ec('0x26')](function(_0xe5fbd){_0x423a15[_0xd5ec('0xa4')]=_0xe5fbd;return _0x423a15;});}})[_0xd5ec('0x26')](respondWithFilteredResult(_0x4c1643,_0xd4e8a9))['catch'](handleError(_0x4c1643,null));};exports['addTags']=function(_0x1b3983,_0x310635,_0x28c9a5){return db[_0xd5ec('0x8e')]['find']({'where':{'id':_0x1b3983[_0xd5ec('0xa6')]['id']}})['then'](handleEntityNotFound(_0x310635,null))[_0xd5ec('0x26')](function(_0x59bc44){if(_0x59bc44){return _0x59bc44[_0xd5ec('0xb8')](_0x1b3983['body'][_0xd5ec('0xae')],_[_0xd5ec('0xaf')](_0x1b3983[_0xd5ec('0xaa')],[_0xd5ec('0xae'),'id'])||{})['spread'](function(){return db[_0xd5ec('0xb9')]['findAll']({'attributes':['id',_0xd5ec('0x29'),_0xd5ec('0x4a')],'where':{'id':_0x1b3983[_0xd5ec('0xaa')][_0xd5ec('0xae')]}});})[_0xd5ec('0x26')](function(_0x539d43){socket[_0xd5ec('0xba')](_0xd5ec('0xbb'),{'id':Number(_0x1b3983[_0xd5ec('0xa6')]['id']),'tags':_0x539d43||[]});return{'id':Number(_0x1b3983[_0xd5ec('0xa6')]['id']),'tags':_0x539d43||[]};});}})[_0xd5ec('0x26')](respondWithResult(_0x310635,null))[_0xd5ec('0x30')](handleError(_0x310635,null));};exports[_0xd5ec('0xbc')]=function(_0x4d4148,_0x2bc40,_0x24909e){return db[_0xd5ec('0x8e')][_0xd5ec('0x5c')]({'where':{'id':_0x4d4148[_0xd5ec('0xa6')]['id']}})[_0xd5ec('0x26')](handleEntityNotFound(_0x2bc40,null))[_0xd5ec('0x26')](function(_0x890136){if(_0x890136){return _0x890136[_0xd5ec('0xbc')](_0x4d4148[_0xd5ec('0x3c')][_0xd5ec('0xae')]);}})['then'](respondWithStatusCode(_0x2bc40,null))[_0xd5ec('0x30')](handleError(_0x2bc40,null));};exports[_0xd5ec('0xbd')]=function(_0x29238c,_0x3c8d85){var _0x1f58d0=moment()['unix']()[_0xd5ec('0x8c')]();var _0x42c6b=path['join'](config[_0xd5ec('0xbe')],'server',_0xd5ec('0xbf'),_0xd5ec('0xc0'));var _0x3294ca=path['join'](config['root'],_0xd5ec('0xc1'),_0xd5ec('0xbf'),_0xd5ec('0xc2'));var _0x5f1216=path[_0xd5ec('0xc3')](_0x42c6b,_0x1f58d0);var _0x24003c=util['format'](_0xd5ec('0xc4'),_0x29238c[_0xd5ec('0xa6')]['id'],_0x1f58d0);var _0x33aac8=path['join'](_0x42c6b,_0x24003c);var _0xf09d24=[];_0xf09d24[_0xd5ec('0xa2')]({'model':db[_0xd5ec('0xc5')],'as':_0xd5ec('0xc5'),'raw':!![]});var _0x365545=[{'model':db[_0xd5ec('0xb2')],'as':_0xd5ec('0xc6'),'attributes':['id',_0xd5ec('0xaa'),_0xd5ec('0xc7')],'include':_0xf09d24}];return db[_0xd5ec('0x8e')]['find']({'where':{'id':_0x29238c[_0xd5ec('0xa6')]['id']},'include':_0x365545})['then'](handleEntityNotFound(_0x3c8d85,null))[_0xd5ec('0x26')](function(_0x2c1e7c){if(_0x2c1e7c&&_0x2c1e7c['Messages']){var _0x26c413=_0x2c1e7c[_0xd5ec('0xc8')]({'plain':!![]});fs[_0xd5ec('0xc9')](_0x5f1216);for(var _0x406cd5=0x0;_0x406cd5<_0x26c413[_0xd5ec('0xc6')][_0xd5ec('0x42')];_0x406cd5++){var _0x3b5ad2=_0x26c413['Messages'][_0x406cd5]['Attachment'];if(_0x3b5ad2){var _0x501aba=path[_0xd5ec('0xc3')](_0x3294ca,_0x3b5ad2[_0xd5ec('0xca')]);if(fs['existsSync'](_0x501aba)){fs[_0xd5ec('0xcb')](_0x501aba)['pipe'](fs['createWriteStream'](path['join'](_0x5f1216,_0x3b5ad2['basename'])));}}}return BPromise[_0xd5ec('0xcc')]()[_0xd5ec('0x26')](function(){return new BPromise(function(_0x11b090,_0x250ad6){zipdir(_0x5f1216,{'saveTo':_0x33aac8},function(_0x25b511,_0x370548){if(_0x25b511)return _0x250ad6(_0x25b511);return _0x11b090(_0x370548);});})[_0xd5ec('0x26')](function(){return new BPromise(function(_0x1f30cf,_0x3f7bb0){rimraf(_0x5f1216,function(_0x52a224){if(_0x52a224)_0x3f7bb0(_0x52a224);return _0x1f30cf();});});})[_0xd5ec('0x26')](function(){return _0x3c8d85[_0xd5ec('0xbd')](_0x33aac8,_0x24003c,function(_0x295c8e){if(_0x295c8e){console[_0xd5ec('0xcd')]('err',_0x295c8e);}else{fs[_0xd5ec('0xce')](_0x33aac8);}});});});}else{return _0x3c8d85[_0xd5ec('0x19')](0xc8);}})[_0xd5ec('0x30')](handleError(_0x3c8d85,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 7df8961..b1d9d46 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 _0x47b6=['hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','then','setDataValue','emit','catch','hasOwnProperty'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x47b6,0xe2));var _0x647b=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0x47b6[_0x2cde0a];return _0x260610;};'use strict';var EventEmitter=require(_0x647b('0x0'));var FaxInteraction=require(_0x647b('0x1'))['db'][_0x647b('0x2')];var FaxMessage=require(_0x647b('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x647b('0x3')](0x0);var events={'afterCreate':_0x647b('0x4'),'afterUpdate':_0x647b('0x5'),'afterDestroy':_0x647b('0x6')};function emitEvent(_0x878b29){return function(_0x492fff,_0x4f1e79,_0x27c83a){_0x492fff['getUsers']({'attributes':['id'],'raw':!![]})[_0x647b('0x7')](function(_0x55d1eb){_0x492fff[_0x647b('0x8')]('Users',_0x55d1eb['map'](function(_0x27bf2c){return{'id':_0x27bf2c['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x492fff['id'],'direction':'in','read':![]},'raw':!![]});})[_0x647b('0x7')](function(_0x565886){_0x492fff[_0x647b('0x8')]('unreadMessages',_0x565886['length']);FaxInteractionEvents['emit'](_0x878b29+':'+_0x492fff['id'],_0x492fff);FaxInteractionEvents[_0x647b('0x9')](_0x878b29,_0x492fff);_0x27c83a(null);})[_0x647b('0xa')](_0x27c83a(null));};}for(var e in events){if(events[_0x647b('0xb')](e)){var event=events[e];FaxInteraction[_0x647b('0xc')](e,emitEvent(event));}}module[_0x647b('0xd')]=FaxInteractionEvents; \ No newline at end of file +var _0xc789=['map','unreadMessages','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x25996d,_0x5b282e){var _0x12d802=function(_0x34fe7b){while(--_0x34fe7b){_0x25996d['push'](_0x25996d['shift']());}};_0x12d802(++_0x5b282e);}(_0xc789,0x1d5));var _0x9c78=function(_0x4f75cc,_0x511ab4){_0x4f75cc=_0x4f75cc-0x0;var _0x1305c9=_0xc789[_0x4f75cc];return _0x1305c9;};'use strict';var EventEmitter=require(_0x9c78('0x0'));var FaxInteraction=require(_0x9c78('0x1'))['db'][_0x9c78('0x2')];var FaxMessage=require(_0x9c78('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9c78('0x3')](0x0);var events={'afterCreate':_0x9c78('0x4'),'afterUpdate':_0x9c78('0x5'),'afterDestroy':_0x9c78('0x6')};function emitEvent(_0x4554a6){return function(_0x264257,_0x126daa,_0x136bb9){_0x264257[_0x9c78('0x7')]({'attributes':['id'],'raw':!![]})[_0x9c78('0x8')](function(_0x5cfae2){_0x264257[_0x9c78('0x9')](_0x9c78('0xa'),_0x5cfae2[_0x9c78('0xb')](function(_0x23108b){return{'id':_0x23108b['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x264257['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9c78('0x8')](function(_0x497ba9){_0x264257[_0x9c78('0x9')](_0x9c78('0xc'),_0x497ba9['length']);FaxInteractionEvents['emit'](_0x4554a6+':'+_0x264257['id'],_0x264257);FaxInteractionEvents[_0x9c78('0xd')](_0x4554a6,_0x264257);_0x136bb9(null);})['catch'](_0x136bb9(null));};}for(var e in events){if(events[_0x9c78('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x9c78('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 6a5e19e..9526f99 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 _0x8597=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','fax_interactions','changed','closed','closedAt','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8597,0xe1));var _0x7859=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x8597[_0x12bcf7];return _0x2825a;};'use strict';var _=require(_0x7859('0x0'));var util=require('util');var logger=require(_0x7859('0x1'))(_0x7859('0x2'));var moment=require(_0x7859('0x3'));var BPromise=require(_0x7859('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7859('0x5'));var rimraf=require(_0x7859('0x6'));var config=require(_0x7859('0x7'));var attributes=require(_0x7859('0x8'));module[_0x7859('0x9')]=function(_0x5b3e77,_0x14fd59){return _0x5b3e77['define']('FaxInteraction',attributes,{'tableName':_0x7859('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1611ce,_0x1eaebf,_0x3f026b){if(_0x1611ce[_0x7859('0xb')](_0x7859('0xc'))){_0x1611ce[_0x7859('0xd')]=moment()[_0x7859('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3f026b(null,_0x1611ce);}}});}; \ No newline at end of file +var _0x3fe1=['exports','define','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes'];(function(_0x34d052,_0x5a7c85){var _0x38123b=function(_0x353f4b){while(--_0x353f4b){_0x34d052['push'](_0x34d052['shift']());}};_0x38123b(++_0x5a7c85);}(_0x3fe1,0x19b));var _0x13fe=function(_0xe4e303,_0x8f9657){_0xe4e303=_0xe4e303-0x0;var _0x39021e=_0x3fe1[_0xe4e303];return _0x39021e;};'use strict';var _=require(_0x13fe('0x0'));var util=require(_0x13fe('0x1'));var logger=require(_0x13fe('0x2'))(_0x13fe('0x3'));var moment=require('moment');var BPromise=require(_0x13fe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13fe('0x5'));var rimraf=require(_0x13fe('0x6'));var config=require(_0x13fe('0x7'));var attributes=require(_0x13fe('0x8'));module[_0x13fe('0x9')]=function(_0x4c7d39,_0x381740){return _0x4c7d39[_0x13fe('0xa')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x7d2df6,_0x5e4f87,_0x175969){if(_0x7d2df6['changed'](_0x13fe('0xb'))){_0x7d2df6[_0x13fe('0xc')]=moment()['format'](_0x13fe('0xd'));}_0x175969(null,_0x7d2df6);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 4a86a02..882d2ee 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 _0xa2cb=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','attributes','limit','AddTagsToFaxInteraction','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x633cf,_0x452684){var _0x17044b=function(_0x46cf55){while(--_0x46cf55){_0x633cf['push'](_0x633cf['shift']());}};_0x17044b(++_0x452684);}(_0xa2cb,0x1cd));var _0xba2c=function(_0x1ae125,_0x1c2c5f){_0x1ae125=_0x1ae125-0x0;var _0x419783=_0xa2cb[_0x1ae125];return _0x419783;};'use strict';var _=require('lodash');var util=require(_0xba2c('0x0'));var moment=require(_0xba2c('0x1'));var BPromise=require(_0xba2c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba2c('0x3'));var db=require(_0xba2c('0x4'))['db'];var utils=require(_0xba2c('0x5'));var logger=require(_0xba2c('0x6'))(_0xba2c('0x7'));var config=require(_0xba2c('0x8'));var jayson=require(_0xba2c('0x9'));var client=jayson[_0xba2c('0xa')][_0xba2c('0xb')]({'port':0x232a});config[_0xba2c('0xc')]=_['defaults'](config['redis'],{'host':_0xba2c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xba2c('0xe'))[_0xba2c('0xf')](socket);function respondWithRpcPromise(_0x2b34a5,_0x1fadfb,_0x335928){return new BPromise(function(_0x2a28c6,_0x3937f6){return client['request'](_0x2b34a5,_0x335928)[_0xba2c('0x10')](function(_0x131c3d){logger[_0xba2c('0x11')](_0xba2c('0x12'),_0x1fadfb,_0xba2c('0x13'));logger[_0xba2c('0x14')](_0xba2c('0x15'),_0x1fadfb,'request\x20sent',JSON[_0xba2c('0x16')](_0x131c3d));if(_0x131c3d['error']){if(_0x131c3d[_0xba2c('0x17')]['code']===0x1f4){logger[_0xba2c('0x17')](_0xba2c('0x12'),_0x1fadfb,_0x131c3d[_0xba2c('0x17')][_0xba2c('0x18')]);return _0x3937f6(_0x131c3d[_0xba2c('0x17')]['message']);}logger['error'](_0xba2c('0x12'),_0x1fadfb,_0x131c3d[_0xba2c('0x17')][_0xba2c('0x18')]);return _0x2a28c6(_0x131c3d['error'][_0xba2c('0x18')]);}else{logger['info'](_0xba2c('0x12'),_0x1fadfb,_0xba2c('0x13'));_0x2a28c6(_0x131c3d['result'][_0xba2c('0x18')]);}})[_0xba2c('0x19')](function(_0x15966f){logger[_0xba2c('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x1fadfb,_0x15966f);_0x3937f6(_0x15966f);});});}exports[_0xba2c('0x1a')]=function(_0x3e8d06){var _0x54efa2=this;return new Promise(function(_0xc0ea97,_0x286c92){return db[_0xba2c('0x1b')][_0xba2c('0x1c')](_0x3e8d06[_0xba2c('0x1d')],{'raw':_0x3e8d06['options']?_0x3e8d06['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e8d06[_0xba2c('0x1e')]?_0x3e8d06[_0xba2c('0x1e')]['where']||null:null,'attributes':_0x3e8d06[_0xba2c('0x1e')]?_0x3e8d06[_0xba2c('0x1e')][_0xba2c('0x1f')]||null:null,'limit':_0x3e8d06[_0xba2c('0x1e')]?_0x3e8d06[_0xba2c('0x1e')][_0xba2c('0x20')]||null:null})[_0xba2c('0x10')](function(_0x26a1f2){logger[_0xba2c('0x11')]('UpdateFaxInteraction',_0x3e8d06);logger['debug'](_0xba2c('0x1a'),_0x3e8d06,JSON[_0xba2c('0x16')](_0x26a1f2));_0xc0ea97(_0x26a1f2);})[_0xba2c('0x19')](function(_0x171fe9){logger[_0xba2c('0x17')]('UpdateFaxInteraction',_0x171fe9[_0xba2c('0x18')],_0x3e8d06);_0x286c92(_0x54efa2['error'](0x1f4,_0x171fe9[_0xba2c('0x18')]));});});};exports[_0xba2c('0x21')]=function(_0x49bc74){return new Promise(function(_0x421f26,_0x219dc7){return db[_0xba2c('0x1b')]['find']({'where':_0x49bc74['options']?_0x49bc74[_0xba2c('0x1e')]['where']||null:null})[_0xba2c('0x10')](function(_0x351ba8){if(_0x351ba8){return _0x351ba8['addTags'](_0x49bc74['body']['ids'],_['omit'](_0x49bc74['body'],['ids','id'])||{});}})[_0xba2c('0x22')](function(_0x338229){logger[_0xba2c('0x11')]('AddTags',_0x49bc74);logger['debug'](_0xba2c('0x23'),_0x49bc74,JSON[_0xba2c('0x16')](_0x338229));_0x421f26(_0x338229);})[_0xba2c('0x19')](function(_0x3e3e5a){logger[_0xba2c('0x17')](_0xba2c('0x23'),_0x3e3e5a[_0xba2c('0x18')],_0x49bc74);_0x219dc7(_this['error'](0x1f4,_0x3e3e5a[_0xba2c('0x18')]));});});}; \ No newline at end of file +var _0xbe9f=['../../mysqldb','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','catch','FaxInteraction','update','body','options','raw','where','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','find','addTags','ids','omit','AddTags','moment','bluebird','randomstring','ioredis'];(function(_0x1f0926,_0x165ee2){var _0xd83ab1=function(_0x46e1d3){while(--_0x46e1d3){_0x1f0926['push'](_0x1f0926['shift']());}};_0xd83ab1(++_0x165ee2);}(_0xbe9f,0x15b));var _0xfbe9=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xbe9f[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfbe9('0x0'));var BPromise=require(_0xfbe9('0x1'));var rs=require(_0xfbe9('0x2'));var fs=require('fs');var Redis=require(_0xfbe9('0x3'));var db=require(_0xfbe9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfbe9('0x5'));var client=jayson[_0xfbe9('0x6')][_0xfbe9('0x7')]({'port':0x232a});config['redis']=_[_0xfbe9('0x8')](config[_0xfbe9('0x9')],{'host':_0xfbe9('0xa'),'port':0x18eb});var socket=require(_0xfbe9('0xb'))(new Redis(config[_0xfbe9('0x9')]));require(_0xfbe9('0xc'))[_0xfbe9('0xd')](socket);function respondWithRpcPromise(_0x5e640a,_0x139181,_0x21a7d1){return new BPromise(function(_0x371e4e,_0x5e0689){return client[_0xfbe9('0xe')](_0x5e640a,_0x21a7d1)[_0xfbe9('0xf')](function(_0x563770){logger[_0xfbe9('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x139181,_0xfbe9('0x11'));logger[_0xfbe9('0x12')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x139181,_0xfbe9('0x11'),JSON[_0xfbe9('0x13')](_0x563770));if(_0x563770[_0xfbe9('0x14')]){if(_0x563770[_0xfbe9('0x14')][_0xfbe9('0x15')]===0x1f4){logger[_0xfbe9('0x14')](_0xfbe9('0x16'),_0x139181,_0x563770[_0xfbe9('0x14')][_0xfbe9('0x17')]);return _0x5e0689(_0x563770[_0xfbe9('0x14')]['message']);}logger[_0xfbe9('0x14')](_0xfbe9('0x16'),_0x139181,_0x563770['error'][_0xfbe9('0x17')]);return _0x371e4e(_0x563770[_0xfbe9('0x14')][_0xfbe9('0x17')]);}else{logger[_0xfbe9('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x139181,_0xfbe9('0x11'));_0x371e4e(_0x563770['result'][_0xfbe9('0x17')]);}})[_0xfbe9('0x18')](function(_0xbfec80){logger[_0xfbe9('0x14')](_0xfbe9('0x16'),_0x139181,_0xbfec80);_0x5e0689(_0xbfec80);});});}exports['UpdateFaxInteraction']=function(_0x36eeb6){var _0xc5a421=this;return new Promise(function(_0x27c58d,_0x2ee5f0){return db[_0xfbe9('0x19')][_0xfbe9('0x1a')](_0x36eeb6[_0xfbe9('0x1b')],{'raw':_0x36eeb6[_0xfbe9('0x1c')]?_0x36eeb6['options'][_0xfbe9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36eeb6[_0xfbe9('0x1c')]?_0x36eeb6[_0xfbe9('0x1c')][_0xfbe9('0x1e')]||null:null,'attributes':_0x36eeb6[_0xfbe9('0x1c')]?_0x36eeb6[_0xfbe9('0x1c')]['attributes']||null:null,'limit':_0x36eeb6[_0xfbe9('0x1c')]?_0x36eeb6[_0xfbe9('0x1c')][_0xfbe9('0x1f')]||null:null})['then'](function(_0x564fd7){logger['info'](_0xfbe9('0x20'),_0x36eeb6);logger[_0xfbe9('0x12')](_0xfbe9('0x20'),_0x36eeb6,JSON[_0xfbe9('0x13')](_0x564fd7));_0x27c58d(_0x564fd7);})[_0xfbe9('0x18')](function(_0x34b43c){logger[_0xfbe9('0x14')](_0xfbe9('0x20'),_0x34b43c[_0xfbe9('0x17')],_0x36eeb6);_0x2ee5f0(_0xc5a421[_0xfbe9('0x14')](0x1f4,_0x34b43c[_0xfbe9('0x17')]));});});};exports[_0xfbe9('0x21')]=function(_0x58c2cc){return new Promise(function(_0x5a9849,_0x20a42b){return db['FaxInteraction'][_0xfbe9('0x22')]({'where':_0x58c2cc['options']?_0x58c2cc[_0xfbe9('0x1c')]['where']||null:null})[_0xfbe9('0xf')](function(_0x2752d2){if(_0x2752d2){return _0x2752d2[_0xfbe9('0x23')](_0x58c2cc[_0xfbe9('0x1b')][_0xfbe9('0x24')],_[_0xfbe9('0x25')](_0x58c2cc[_0xfbe9('0x1b')],['ids','id'])||{});}})['spread'](function(_0x2e3bf8){logger[_0xfbe9('0x10')]('AddTags',_0x58c2cc);logger['debug'](_0xfbe9('0x26'),_0x58c2cc,JSON[_0xfbe9('0x13')](_0x2e3bf8));_0x5a9849(_0x2e3bf8);})[_0xfbe9('0x18')](function(_0x2ebb0a){logger[_0xfbe9('0x14')](_0xfbe9('0x26'),_0x2ebb0a[_0xfbe9('0x17')],_0x58c2cc);_0x20a42b(_this[_0xfbe9('0x14')](0x1f4,_0x2ebb0a[_0xfbe9('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index ad33411..fd34aa1 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 _0xac8f=['emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','update'];(function(_0x44da78,_0x983f45){var _0xeb99b3=function(_0x457f64){while(--_0x457f64){_0x44da78['push'](_0x44da78['shift']());}};_0xeb99b3(++_0x983f45);}(_0xac8f,0x11d));var _0xfac8=function(_0x810025,_0x34bb04){_0x810025=_0x810025-0x0;var _0x4dbc81=_0xac8f[_0x810025];return _0x4dbc81;};'use strict';var FaxInteractionEvents=require(_0xfac8('0x0'));var events=[_0xfac8('0x1'),'remove',_0xfac8('0x2')];function createListener(_0x19aaa3,_0xab0f84){return function(_0x3a7112){_0xab0f84[_0xfac8('0x3')](_0x19aaa3,_0x3a7112);};}function removeListener(_0x5af31a,_0x1c7cb1){return function(){FaxInteractionEvents[_0xfac8('0x4')](_0x5af31a,_0x1c7cb1);};}exports[_0xfac8('0x5')]=function(_0x3c6b86){for(var _0x396bac=0x0,_0x391476=events[_0xfac8('0x6')];_0x396bac<_0x391476;_0x396bac++){var _0x2f0ee1=events[_0x396bac];var _0x5b5523=createListener(_0xfac8('0x7')+_0x2f0ee1,_0x3c6b86);FaxInteractionEvents['on'](_0x2f0ee1,_0x5b5523);}}; \ No newline at end of file +var _0xde1d=['faxInteraction:','./faxInteraction.events','save','update','emit','removeListener','register','length'];(function(_0x28ba0f,_0x467f2f){var _0x4f6e5a=function(_0x436812){while(--_0x436812){_0x28ba0f['push'](_0x28ba0f['shift']());}};_0x4f6e5a(++_0x467f2f);}(_0xde1d,0x189));var _0xdde1=function(_0x4f47d5,_0x14bac5){_0x4f47d5=_0x4f47d5-0x0;var _0x507cc5=_0xde1d[_0x4f47d5];return _0x507cc5;};'use strict';var FaxInteractionEvents=require(_0xdde1('0x0'));var events=[_0xdde1('0x1'),'remove',_0xdde1('0x2')];function createListener(_0x29e5b9,_0x2c5f56){return function(_0xe8151d){_0x2c5f56[_0xdde1('0x3')](_0x29e5b9,_0xe8151d);};}function removeListener(_0xac5453,_0x3c8bb9){return function(){FaxInteractionEvents[_0xdde1('0x4')](_0xac5453,_0x3c8bb9);};}exports[_0xdde1('0x5')]=function(_0x3ce69a){for(var _0x50ade0=0x0,_0x35ff3a=events[_0xdde1('0x6')];_0x50ade0<_0x35ff3a;_0x50ade0++){var _0x39fcaa=events[_0x50ade0];var _0x4df07c=createListener(_0xdde1('0x7')+_0x39fcaa,_0x3ce69a);FaxInteractionEvents['on'](_0x39fcaa,_0x4df07c);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 49f90b8..e74a91f 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 _0x074b=['isAuthenticated','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','addTags','faxinteraction:update','update','delete','/:id','faxinteraction:destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x165ffc,_0x3f9d50){var _0xe2cb59=function(_0x56877a){while(--_0x56877a){_0x165ffc['push'](_0x165ffc['shift']());}};_0xe2cb59(++_0x3f9d50);}(_0x074b,0x195));var _0xb074=function(_0x1a9977,_0x1c3b54){_0x1a9977=_0x1a9977-0x0;var _0x590f50=_0x074b[_0x1a9977];return _0x590f50;};'use strict';var multer=require(_0xb074('0x0'));var util=require(_0xb074('0x1'));var path=require(_0xb074('0x2'));var timeout=require(_0xb074('0x3'));var express=require(_0xb074('0x4'));var router=express[_0xb074('0x5')]();var fs_extra=require(_0xb074('0x6'));var auth=require(_0xb074('0x7'));var interaction=require(_0xb074('0x8'));var config=require(_0xb074('0x9'));var controller=require('./faxInteraction.controller');router[_0xb074('0xa')]('/',auth[_0xb074('0xb')](),controller['index']);router[_0xb074('0xa')](_0xb074('0xc'),auth[_0xb074('0xb')](),controller[_0xb074('0xd')]);router[_0xb074('0xa')]('/:id',auth[_0xb074('0xb')](),controller[_0xb074('0xe')]);router[_0xb074('0xa')](_0xb074('0xf'),auth[_0xb074('0xb')](),controller[_0xb074('0x10')]);router['get'](_0xb074('0x11'),auth['isAuthenticated'](),controller[_0xb074('0x12')]);router[_0xb074('0x13')]('/',auth[_0xb074('0xb')](),controller[_0xb074('0x14')]);router[_0xb074('0x13')](_0xb074('0xf'),auth[_0xb074('0xb')](),controller[_0xb074('0x15')]);router[_0xb074('0x13')](_0xb074('0x16'),auth['isAuthenticated'](),interaction[_0xb074('0x17')](_0xb074('0x18'),'faxinteraction:addtags'),controller[_0xb074('0x19')]);router['put']('/:id',auth[_0xb074('0xb')](),interaction['tracked'](_0xb074('0x18'),_0xb074('0x1a')),controller[_0xb074('0x1b')]);router[_0xb074('0x1c')](_0xb074('0x1d'),auth['isAuthenticated'](),interaction[_0xb074('0x17')](_0xb074('0x18'),_0xb074('0x1e')),controller['destroy']);router[_0xb074('0x1c')](_0xb074('0x16'),auth[_0xb074('0xb')](),controller['removeTags']);module[_0xb074('0x1f')]=router; \ No newline at end of file +var _0xeb84=['/describe','describe','isAuthenticated','show','/:id/messages','/:id/download','download','post','create','addMessage','tracked','faxinteraction:addtags','addTags','put','fax','update','delete','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index'];(function(_0x1a99e8,_0x357462){var _0x98a5e2=function(_0x424d44){while(--_0x424d44){_0x1a99e8['push'](_0x1a99e8['shift']());}};_0x98a5e2(++_0x357462);}(_0xeb84,0x194));var _0x4eb8=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0xeb84[_0xee3051];return _0x139e81;};'use strict';var multer=require(_0x4eb8('0x0'));var util=require(_0x4eb8('0x1'));var path=require(_0x4eb8('0x2'));var timeout=require(_0x4eb8('0x3'));var express=require('express');var router=express[_0x4eb8('0x4')]();var fs_extra=require(_0x4eb8('0x5'));var auth=require(_0x4eb8('0x6'));var interaction=require(_0x4eb8('0x7'));var config=require(_0x4eb8('0x8'));var controller=require(_0x4eb8('0x9'));router[_0x4eb8('0xa')]('/',auth['isAuthenticated'](),controller[_0x4eb8('0xb')]);router[_0x4eb8('0xa')](_0x4eb8('0xc'),auth['isAuthenticated'](),controller[_0x4eb8('0xd')]);router[_0x4eb8('0xa')]('/:id',auth[_0x4eb8('0xe')](),controller[_0x4eb8('0xf')]);router[_0x4eb8('0xa')](_0x4eb8('0x10'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x4eb8('0x11'),auth['isAuthenticated'](),controller[_0x4eb8('0x12')]);router[_0x4eb8('0x13')]('/',auth[_0x4eb8('0xe')](),controller[_0x4eb8('0x14')]);router[_0x4eb8('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x4eb8('0x15')]);router['post']('/:id/tags',auth[_0x4eb8('0xe')](),interaction[_0x4eb8('0x16')]('fax',_0x4eb8('0x17')),controller[_0x4eb8('0x18')]);router[_0x4eb8('0x19')]('/:id',auth[_0x4eb8('0xe')](),interaction[_0x4eb8('0x16')](_0x4eb8('0x1a'),'faxinteraction:update'),controller[_0x4eb8('0x1b')]);router[_0x4eb8('0x1c')]('/:id',auth[_0x4eb8('0xe')](),interaction[_0x4eb8('0x16')]('fax','faxinteraction:destroy'),controller['destroy']);router[_0x4eb8('0x1c')](_0x4eb8('0x1d'),auth[_0x4eb8('0xe')](),controller[_0x4eb8('0x1e')]);module[_0x4eb8('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 c01d898..9170e4a 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 _0xb91a=['TEXT','ENUM','out','DATE','sequelize','exports'];(function(_0x5b3cd8,_0x146225){var _0x2b9083=function(_0x25ae63){while(--_0x25ae63){_0x5b3cd8['push'](_0x5b3cd8['shift']());}};_0x2b9083(++_0x146225);}(_0xb91a,0xf4));var _0xab91=function(_0x494195,_0x4a61d7){_0x494195=_0x494195-0x0;var _0x7a4181=_0xb91a[_0x494195];return _0x7a4181;};'use strict';var Sequelize=require(_0xab91('0x0'));module[_0xab91('0x1')]={'body':{'type':Sequelize[_0xab91('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xab91('0x3')]('in',_0xab91('0x4')),'defaultValue':_0xab91('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xab91('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xab91('0x5')]}}; \ No newline at end of file +var _0xf1e1=['BOOLEAN','out','DATE','sequelize','TEXT'];(function(_0x5b822,_0x68f9b2){var _0xf58f25=function(_0x3d1400){while(--_0x3d1400){_0x5b822['push'](_0x5b822['shift']());}};_0xf58f25(++_0x68f9b2);}(_0xf1e1,0x102));var _0x1f1e=function(_0x1d006a,_0x2812b5){_0x1d006a=_0x1d006a-0x0;var _0x20a76b=_0xf1e1[_0x1d006a];return _0x20a76b;};'use strict';var Sequelize=require(_0x1f1e('0x0'));module['exports']={'body':{'type':Sequelize[_0x1f1e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1f1e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1f1e('0x3')),'defaultValue':_0x1f1e('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x1f1e('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1f1e('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 2370501..abbd732 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 _0x04d3=['agent','get','update','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','FaxInteraction','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','User','fullname','CmContact','findOne','isNil','fax','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','basename','rimraf','zip-dir','fast-json-patch','moment','bluebird','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','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','http','client','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','name','send','index','map','FaxMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','params','find','body','describe','fax-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user'];(function(_0x507c81,_0x3e1b56){var _0x368a25=function(_0x1e7519){while(--_0x1e7519){_0x507c81['push'](_0x507c81['shift']());}};_0x368a25(++_0x3e1b56);}(_0x04d3,0x14e));var _0x304d=function(_0x4fdc47,_0x1a17e0){_0x4fdc47=_0x4fdc47-0x0;var _0x26ebbf=_0x04d3[_0x4fdc47];return _0x26ebbf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x304d('0x0'));var zipdir=require(_0x304d('0x1'));var jsonpatch=require(_0x304d('0x2'));var rp=require('request-promise');var moment=require(_0x304d('0x3'));var BPromise=require(_0x304d('0x4'));var Mustache=require('mustache');var util=require(_0x304d('0x5'));var path=require(_0x304d('0x6'));var sox=require(_0x304d('0x7'));var csv=require('to-csv');var ejs=require(_0x304d('0x8'));var fs=require('fs');var fs_extra=require(_0x304d('0x9'));var _=require(_0x304d('0xa'));var squel=require(_0x304d('0xb'));var crypto=require(_0x304d('0xc'));var jsforce=require(_0x304d('0xd'));var deskjs=require(_0x304d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x304d('0xf'));var Papa=require(_0x304d('0x10'));var Redis=require(_0x304d('0x11'));var authService=require(_0x304d('0x12'));var qs=require(_0x304d('0x13'));var as=require(_0x304d('0x14'));var hardwareService=require(_0x304d('0x15'));var logger=require(_0x304d('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x304d('0x17'));var licenseUtil=require(_0x304d('0x18'));var db=require(_0x304d('0x19'))['db'];config[_0x304d('0x1a')]=_[_0x304d('0x1b')](config[_0x304d('0x1a')],{'host':_0x304d('0x1c'),'port':0x18eb});var socket=require(_0x304d('0x1d'))(new Redis(config[_0x304d('0x1a')]));require('./faxMessage.socket')[_0x304d('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x304d('0x1f')]({'port':0x232c});var client9002=jayson[_0x304d('0x20')][_0x304d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x318172,_0xbbe4a2,_0x332ea2,_0xe14d09){return new BPromise(function(_0x2bb055,_0x4f7ac9){var _0x599d81=_0xe14d09||client;return _0x599d81['request'](_0x318172,_0x332ea2)['then'](function(_0x4d8290){logger['info'](_0x304d('0x21'),_0xbbe4a2,_0x304d('0x22'));logger[_0x304d('0x23')](_0x304d('0x24'),_0xbbe4a2,'request\x20sent',JSON[_0x304d('0x25')](_0x4d8290));if(_0x4d8290[_0x304d('0x26')]){if(_0x4d8290[_0x304d('0x26')][_0x304d('0x27')]===0x1f4){logger[_0x304d('0x26')](_0x304d('0x21'),_0xbbe4a2,_0x4d8290['error'][_0x304d('0x28')]);return _0x4f7ac9(_0x4d8290[_0x304d('0x26')][_0x304d('0x28')]);}logger[_0x304d('0x26')]('FaxMessage,\x20%s,\x20%s',_0xbbe4a2,_0x4d8290[_0x304d('0x26')][_0x304d('0x28')]);return _0x2bb055(_0x4d8290['error'][_0x304d('0x28')]);}else{logger[_0x304d('0x29')](_0x304d('0x21'),_0xbbe4a2,_0x304d('0x22'));_0x2bb055(_0x4d8290[_0x304d('0x2a')][_0x304d('0x28')]);}})[_0x304d('0x2b')](function(_0x248f4d){logger[_0x304d('0x26')](_0x304d('0x21'),_0xbbe4a2,_0x248f4d);_0x4f7ac9(_0x248f4d);});});}function respondWithStatusCode(_0x50b954,_0xcf86e4){_0xcf86e4=_0xcf86e4||0xcc;return function(_0x26af47){if(_0x26af47){return _0x50b954[_0x304d('0x2c')](_0xcf86e4);}return _0x50b954[_0x304d('0x2d')](_0xcf86e4)[_0x304d('0x2e')]();};}function respondWithResult(_0x27b92e,_0x45e1a6){_0x45e1a6=_0x45e1a6||0xc8;return function(_0x1b58ea){if(_0x1b58ea){return _0x27b92e[_0x304d('0x2d')](_0x45e1a6)[_0x304d('0x2f')](_0x1b58ea);}};}function respondWithFilteredResult(_0x55ad02,_0x4252b2){return function(_0x1ef245){if(_0x1ef245){var _0xd44507=typeof _0x4252b2[_0x304d('0x30')]===_0x304d('0x31')&&typeof _0x4252b2['limit']===_0x304d('0x31');var _0xb7844=_0x1ef245[_0x304d('0x32')];var _0x3277c6=_0xd44507?0x0:_0x4252b2['offset'];var _0x24883d=_0xd44507?_0x1ef245[_0x304d('0x32')]:_0x4252b2[_0x304d('0x30')]+_0x4252b2[_0x304d('0x33')];var _0x401592;if(_0x24883d>=_0xb7844){_0x24883d=_0xb7844;_0x401592=0xc8;}else{_0x401592=0xce;}_0x55ad02[_0x304d('0x2d')](_0x401592);return _0x55ad02['set'](_0x304d('0x34'),_0x3277c6+'-'+_0x24883d+'/'+_0xb7844)[_0x304d('0x2f')](_0x1ef245);}return null;};}function patchUpdates(_0x13f36c){return function(_0x1cfb00){try{jsonpatch[_0x304d('0x35')](_0x1cfb00,_0x13f36c,!![]);}catch(_0x3ede80){return BPromise[_0x304d('0x36')](_0x3ede80);}return _0x1cfb00[_0x304d('0x37')]();};}function saveUpdates(_0x26e55b,_0x530ea2){return function(_0x171f7b){if(_0x171f7b){return _0x171f7b['update'](_0x26e55b)[_0x304d('0x38')](function(_0x10c3d5){return _0x10c3d5;});}return null;};}function removeEntity(_0x1afc4e,_0x382529){return function(_0x28237a){if(_0x28237a){return _0x28237a[_0x304d('0x39')]()[_0x304d('0x38')](function(){_0x1afc4e[_0x304d('0x2d')](0xcc)[_0x304d('0x2e')]();});}};}function handleEntityNotFound(_0x31f442,_0x768039){return function(_0x113c1b){if(!_0x113c1b){_0x31f442[_0x304d('0x2c')](0x194);}return _0x113c1b;};}function handleError(_0x1dde74,_0x29d8b2){_0x29d8b2=_0x29d8b2||0x1f4;return function(_0xb1a45b){logger[_0x304d('0x26')](_0xb1a45b['stack']);if(_0xb1a45b[_0x304d('0x3a')]){delete _0xb1a45b['name'];}_0x1dde74[_0x304d('0x2d')](_0x29d8b2)[_0x304d('0x3b')](_0xb1a45b);};}exports[_0x304d('0x3c')]=function(_0x4e5847,_0xed67ad){var _0x19dc8e={},_0x538d8c={},_0x4065d1={'count':0x0,'rows':[]};var _0x103660=_[_0x304d('0x3d')](db[_0x304d('0x3e')][_0x304d('0x3f')],function(_0x441da9){return{'name':_0x441da9[_0x304d('0x40')],'type':_0x441da9['type'][_0x304d('0x41')]};});_0x538d8c[_0x304d('0x42')]=_[_0x304d('0x3d')](_0x103660,'name');_0x538d8c[_0x304d('0x43')]=_[_0x304d('0x44')](_0x4e5847[_0x304d('0x43')]);_0x538d8c[_0x304d('0x45')]=_[_0x304d('0x46')](_0x538d8c[_0x304d('0x42')],_0x538d8c[_0x304d('0x43')]);_0x19dc8e[_0x304d('0x47')]=_[_0x304d('0x46')](_0x538d8c['model'],qs[_0x304d('0x48')](_0x4e5847[_0x304d('0x43')][_0x304d('0x48')]));_0x19dc8e[_0x304d('0x47')]=_0x19dc8e[_0x304d('0x47')][_0x304d('0x49')]?_0x19dc8e[_0x304d('0x47')]:_0x538d8c[_0x304d('0x42')];if(!_0x4e5847['query'][_0x304d('0x4a')](_0x304d('0x4b'))){_0x19dc8e[_0x304d('0x33')]=qs['limit'](_0x4e5847[_0x304d('0x43')][_0x304d('0x33')]);_0x19dc8e['offset']=qs[_0x304d('0x30')](_0x4e5847[_0x304d('0x43')][_0x304d('0x30')]);}_0x19dc8e[_0x304d('0x4c')]=qs[_0x304d('0x4d')](_0x4e5847[_0x304d('0x43')][_0x304d('0x4d')]);_0x19dc8e[_0x304d('0x4e')]=qs[_0x304d('0x45')](_[_0x304d('0x4f')](_0x4e5847[_0x304d('0x43')],_0x538d8c['filters']),_0x103660);if(_0x4e5847['query'][_0x304d('0x50')]){_0x19dc8e[_0x304d('0x4e')]=_[_0x304d('0x51')](_0x19dc8e['where'],{'$or':_['map'](_0x103660,function(_0x4f48c7){if(_0x4f48c7[_0x304d('0x52')]!=='VIRTUAL'){var _0xdb54f3={};_0xdb54f3[_0x4f48c7[_0x304d('0x3a')]]={'$like':'%'+_0x4e5847['query']['filter']+'%'};return _0xdb54f3;}})});}_0x19dc8e=_[_0x304d('0x51')]({},_0x19dc8e,_0x4e5847[_0x304d('0x53')]);var _0x598bfb={'where':_0x19dc8e[_0x304d('0x4e')]};return db[_0x304d('0x3e')][_0x304d('0x32')](_0x598bfb)['then'](function(_0x55e4b0){_0x4065d1['count']=_0x55e4b0;if(_0x4e5847[_0x304d('0x43')][_0x304d('0x54')]){_0x19dc8e[_0x304d('0x55')]=[{'all':!![]}];}return db[_0x304d('0x3e')][_0x304d('0x56')](_0x19dc8e);})['then'](function(_0x33a0ad){_0x4065d1['rows']=_0x33a0ad;return _0x4065d1;})[_0x304d('0x38')](respondWithFilteredResult(_0xed67ad,_0x19dc8e))[_0x304d('0x2b')](handleError(_0xed67ad,null));};exports['show']=function(_0x445aff,_0x5eff5d){var _0x202944={'raw':!![],'where':{'id':_0x445aff[_0x304d('0x57')]['id']}},_0x35cf69={};_0x35cf69[_0x304d('0x42')]=_[_0x304d('0x44')](db[_0x304d('0x3e')][_0x304d('0x3f')]);_0x35cf69[_0x304d('0x43')]=_['keys'](_0x445aff[_0x304d('0x43')]);_0x35cf69[_0x304d('0x45')]=_[_0x304d('0x46')](_0x35cf69['model'],_0x35cf69[_0x304d('0x43')]);_0x202944[_0x304d('0x47')]=_[_0x304d('0x46')](_0x35cf69[_0x304d('0x42')],qs[_0x304d('0x48')](_0x445aff[_0x304d('0x43')]['fields']));_0x202944[_0x304d('0x47')]=_0x202944[_0x304d('0x47')][_0x304d('0x49')]?_0x202944[_0x304d('0x47')]:_0x35cf69[_0x304d('0x42')];if(_0x445aff[_0x304d('0x43')][_0x304d('0x54')]){_0x202944[_0x304d('0x55')]=[{'all':!![]}];}_0x202944=_[_0x304d('0x51')]({},_0x202944,_0x445aff[_0x304d('0x53')]);return db['FaxMessage'][_0x304d('0x58')](_0x202944)[_0x304d('0x38')](handleEntityNotFound(_0x5eff5d,null))[_0x304d('0x38')](respondWithResult(_0x5eff5d,null))[_0x304d('0x2b')](handleError(_0x5eff5d,null));};exports['update']=function(_0xdb7cb6,_0x202170){if(_0xdb7cb6['body']['id']){delete _0xdb7cb6[_0x304d('0x59')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0xdb7cb6['params']['id']}})[_0x304d('0x38')](handleEntityNotFound(_0x202170,null))['then'](saveUpdates(_0xdb7cb6[_0x304d('0x59')],null))[_0x304d('0x38')](respondWithResult(_0x202170,null))[_0x304d('0x2b')](handleError(_0x202170,null));};exports[_0x304d('0x39')]=function(_0x938e3e,_0x2cad32){return db[_0x304d('0x3e')][_0x304d('0x58')]({'where':{'id':_0x938e3e[_0x304d('0x57')]['id']}})[_0x304d('0x38')](handleEntityNotFound(_0x2cad32,null))['then'](removeEntity(_0x2cad32,null))[_0x304d('0x2b')](handleError(_0x2cad32,null));};exports[_0x304d('0x5a')]=function(_0x448459,_0x2f2274){return db['FaxMessage'][_0x304d('0x5a')]()[_0x304d('0x38')](respondWithResult(_0x2f2274,null))[_0x304d('0x2b')](handleError(_0x2f2274,null));};var interaction_log=require(_0x304d('0x16'))(_0x304d('0x5b'));exports[_0x304d('0x5c')]=function(_0x3b58b8,_0x20cdec,_0x398648){var _0xfde656={'agent':{},'channel':'fax'};if(_0x3b58b8[_0x304d('0x59')]['id']){delete _0x3b58b8[_0x304d('0x59')]['id'];}_0x3b58b8[_0x304d('0x59')][_0x304d('0x5d')]=!![];_0x3b58b8[_0x304d('0x59')]['readAt']=moment()[_0x304d('0x5e')](_0x304d('0x5f'));_0x3b58b8[_0x304d('0x59')][_0x304d('0x60')]=_0x3b58b8[_0x304d('0x59')][_0x304d('0x60')]||_0x3b58b8[_0x304d('0x61')]['id'];_0xfde656[_0x304d('0x62')]['id']=_0x3b58b8[_0x304d('0x59')][_0x304d('0x60')];return db[_0x304d('0x3e')][_0x304d('0x58')]({'where':{'id':_0x3b58b8[_0x304d('0x57')]['id'],'UserId':null}})[_0x304d('0x38')](handleEntityNotFound(_0x20cdec,null))[_0x304d('0x38')](saveUpdates(_0x3b58b8['body'],null))[_0x304d('0x38')](function(_0x4b4909){if(_0x4b4909){_0xfde656[_0x304d('0x28')]=_0x4b4909[_0x304d('0x63')]({'plain':!![]});return db['FaxInteraction'][_0x304d('0x58')]({'where':{'id':_0x4b4909['FaxInteractionId']}});}return null;})[_0x304d('0x38')](handleEntityNotFound(_0x20cdec,null))['then'](function(_0x4f0f97){if(_0x4f0f97){return _0x4f0f97[_0x304d('0x64')]({'UserId':_0x3b58b8[_0x304d('0x59')][_0x304d('0x60')],'read1stAt':_['isNil'](_0x4f0f97[_0x304d('0x65')])?moment()[_0x304d('0x5e')](_0x304d('0x5f')):undefined});}return null;})[_0x304d('0x38')](function(_0x2518bf){if(_0x2518bf){_0xfde656[_0x304d('0x66')]=_0x2518bf[_0x304d('0x63')]({'plain':!![]});interaction_log['info'](_0x304d('0x67'),_0x3b58b8[_0x304d('0x61')]['id'],_0x3b58b8[_0x304d('0x61')]['name'],_0x3b58b8[_0x304d('0x61')]['role'],_0xfde656[_0x304d('0x66')]['id'],_0x3b58b8[_0x304d('0x59')]?JSON[_0x304d('0x25')](_0x3b58b8['body']):_0x304d('0x68'));return respondWithRpcPromise(_0x304d('0x69'),_0x304d('0x6a'),_0xfde656);}return null;})[_0x304d('0x38')](function(_0x2f8357){var _0x32c96c=_0x304d('0x6b')+_0x2f8357[_0x304d('0x28')][_0x304d('0x6c')];return db[_0x304d('0x6d')]['query'](_0x32c96c,{'type':db['Sequelize'][_0x304d('0x6e')][_0x304d('0x6f')],'raw':!![]})['then'](function(_0x2a19fa){return _0x2a19fa;});})[_0x304d('0x38')](function(_0x26d6b3){if(_0x26d6b3){_0xfde656[_0x304d('0x28')][_0x304d('0x70')]=_0x26d6b3[0x0];if(!_0x3b58b8['body']['UserId'])return;return db['User'][_0x304d('0x58')]({'where':{'id':_0x3b58b8[_0x304d('0x59')][_0x304d('0x60')],'role':_0x304d('0x62')},'attributes':['id','name','fullname',_0x304d('0x71'),_0x304d('0x72')],'raw':!![]});}return null;})[_0x304d('0x38')](function(_0x4f16cf){if(!_0x4f16cf)return null;_0xfde656[_0x304d('0x28')]['agent']=_0x4f16cf;return _0xfde656;})['then'](function(_0x3cde37){if(_0x3cde37){if(_0x3b58b8[_0x304d('0x59')]['manual']){_0xfde656[_0x304d('0x28')][_0x304d('0x73')]=util[_0x304d('0x5e')](_0x304d('0x74'),_0x3b58b8[_0x304d('0x61')]['name']);_0xfde656[_0x304d('0x28')][_0x304d('0x75')]=_0xfde656[_0x304d('0x75')];_0xfde656[_0x304d('0x28')][_0x304d('0x76')]=_0xfde656[_0x304d('0x75')];_0xfde656['message'][_0x304d('0x77')]=_0x304d('0x5c');return respondWithRpcPromise('EventManager',_0x304d('0x78'),{'event':_0x304d('0x79'),'message':_0xfde656[_0x304d('0x28')]},client9002)[_0x304d('0x38')](function(){return _0xfde656;});}return _0xfde656;}return null;})[_0x304d('0x38')](respondWithResult(_0x20cdec,null))[_0x304d('0x2b')](handleError(_0x20cdec,null));};var interaction_log=require(_0x304d('0x16'))('fax-interactions');exports[_0x304d('0x36')]=function(_0x3b19ab,_0x3e02d9,_0x1321ec){var _0x306648={'agent':{},'channel':'fax'};if(_0x3b19ab[_0x304d('0x59')]['id']){delete _0x3b19ab[_0x304d('0x59')]['id'];}_0x3b19ab[_0x304d('0x59')][_0x304d('0x60')]=_0x3b19ab[_0x304d('0x59')]['UserId']||_0x3b19ab[_0x304d('0x61')]['id'];_0x306648[_0x304d('0x62')]['id']=_0x3b19ab[_0x304d('0x59')][_0x304d('0x60')];return db[_0x304d('0x3e')][_0x304d('0x58')]({'where':{'id':_0x3b19ab[_0x304d('0x57')]['id'],'UserId':null}})[_0x304d('0x38')](handleEntityNotFound(_0x3e02d9,null))[_0x304d('0x38')](function(_0x2aa4a8){if(_0x2aa4a8){_0x306648['message']=_0x2aa4a8['get']({'plain':!![]});return db[_0x304d('0x7a')][_0x304d('0x58')]({'where':{'id':_0x2aa4a8[_0x304d('0x7b')]}});}return null;})['then'](handleEntityNotFound(_0x3e02d9,null))[_0x304d('0x38')](function(_0x16ee2b){if(_0x16ee2b){_0x306648['interaction']=_0x16ee2b[_0x304d('0x63')]({'plain':!![]});interaction_log['info'](_0x304d('0x7c'),_0x3b19ab[_0x304d('0x61')]['id'],_0x3b19ab['user'][_0x304d('0x3a')],_0x3b19ab[_0x304d('0x61')][_0x304d('0x7d')],_0x306648[_0x304d('0x66')]['id'],_0x3b19ab['body']?JSON[_0x304d('0x25')](_0x3b19ab['body']):_0x304d('0x68'));return respondWithRpcPromise(_0x304d('0x7e'),_0x304d('0x7f'),_0x306648);}return null;})[_0x304d('0x38')](function(_0x54454b){var _0x2b3652='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x54454b[_0x304d('0x28')][_0x304d('0x6c')];return db[_0x304d('0x6d')][_0x304d('0x43')](_0x2b3652,{'type':db['Sequelize'][_0x304d('0x6e')][_0x304d('0x6f')],'raw':!![]})[_0x304d('0x38')](function(_0x24aaab){return _0x24aaab;});})[_0x304d('0x38')](function(_0x26b49e){if(_0x26b49e){_0x306648[_0x304d('0x28')][_0x304d('0x70')]=_0x26b49e[0x0];if(!_0x3b19ab[_0x304d('0x59')]['UserId'])return;return db[_0x304d('0x80')][_0x304d('0x58')]({'where':{'id':_0x3b19ab[_0x304d('0x59')]['UserId'],'role':_0x304d('0x62')},'attributes':['id',_0x304d('0x3a'),_0x304d('0x81'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0xf18786){if(!_0xf18786)return null;_0x306648[_0x304d('0x28')]['agent']=_0xf18786;return _0x306648;})[_0x304d('0x38')](function(_0x1e2c74){if(_0x1e2c74){_0x1e2c74[_0x304d('0x28')][_0x304d('0x73')]=util[_0x304d('0x5e')]('SIP/%s',_0x3b19ab[_0x304d('0x61')]['name']);_0x1e2c74['message'][_0x304d('0x75')]=_0x306648[_0x304d('0x75')];_0x1e2c74['message']['motionChannel']=_0x306648[_0x304d('0x75')];_0x1e2c74[_0x304d('0x28')][_0x304d('0x77')]=_0x304d('0x36');respondWithRpcPromise(_0x304d('0x78'),'EventManager',{'event':'rejectmessage','message':_0x1e2c74[_0x304d('0x28')]},client9002);return _0x306648;}return null;})[_0x304d('0x38')](respondWithResult(_0x3e02d9,null))[_0x304d('0x2b')](handleError(_0x3e02d9,null));};exports['create']=function(_0x555b0b,_0x5a6889){var _0x3bf4ec;return db['FaxMessage']['create'](_0x555b0b[_0x304d('0x59')],{})[_0x304d('0x38')](function(_0x3d42df){_0x3bf4ec=_0x3d42df;return db[_0x304d('0x82')][_0x304d('0x83')]({'where':{'id':_0x3bf4ec[_0x304d('0x6c')]}});})['then'](function(_0x3b919e){if(_[_0x304d('0x84')](_0x3b919e)){return;}else{_0x3bf4ec[_0x304d('0x85')]=_0x3b919e[_0x304d('0x85')];return db['Attachment'][_0x304d('0x83')]({'where':{'id':_0x3bf4ec[_0x304d('0x86')]}});}})[_0x304d('0x38')](function(_0x15b128){return respondWithRpcPromise(_0x304d('0x87'),_0x304d('0x87'),{'FaxAccountId':_['isNil'](_0x555b0b[_0x304d('0x59')])?undefined:_0x555b0b[_0x304d('0x59')]['FaxAccountId'],'path':_[_0x304d('0x84')](_0x15b128)?undefined:util[_0x304d('0x5e')](_0x304d('0x88'),_0x15b128['basename']),'fax':_[_0x304d('0x84')](_0x3bf4ec[_0x304d('0x85')])?undefined:_0x3bf4ec[_0x304d('0x85')],'AttachmentId':_0x3bf4ec[_0x304d('0x86')]},client9002);})['then'](respondWithResult(_0x5a6889,0xc9))[_0x304d('0x2b')](handleError(_0x5a6889,null));};exports[_0x304d('0x89')]=function(_0x246505,_0x1b2c7e){var _0x4bccdb=path[_0x304d('0x8a')](config[_0x304d('0x8b')],_0x304d('0x8c'),_0x304d('0x8d'),_0x304d('0x8e'));return db[_0x304d('0x3e')][_0x304d('0x58')]({'where':{'id':_0x246505[_0x304d('0x57')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x304d('0x38')](handleEntityNotFound(_0x1b2c7e,null))['then'](function(_0x3ee8ce){if(_0x3ee8ce){return _0x1b2c7e[_0x304d('0x89')](path['join'](_0x4bccdb,_0x3ee8ce['Attachment'][_0x304d('0x8f')]));}})['catch'](handleError(_0x1b2c7e,null));}; \ No newline at end of file +var _0xfacc=['fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','client','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','FaxMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','show','find','body','describe','fax-interactions','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','params','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','format','SIP/%s','channel','event','accept','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','fullname','motionChannel','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir'];(function(_0x3de421,_0x1b6a9e){var _0x13a3b8=function(_0x28ddd4){while(--_0x28ddd4){_0x3de421['push'](_0x3de421['shift']());}};_0x13a3b8(++_0x1b6a9e);}(_0xfacc,0x8c));var _0xcfac=function(_0x541e4f,_0x48d7fa){_0x541e4f=_0x541e4f-0x0;var _0x5c1711=_0xfacc[_0x541e4f];return _0x5c1711;};'use strict';var emlformat=require(_0xcfac('0x0'));var rimraf=require(_0xcfac('0x1'));var zipdir=require(_0xcfac('0x2'));var jsonpatch=require(_0xcfac('0x3'));var rp=require('request-promise');var moment=require(_0xcfac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcfac('0x5'));var util=require(_0xcfac('0x6'));var path=require('path');var sox=require(_0xcfac('0x7'));var csv=require(_0xcfac('0x8'));var ejs=require(_0xcfac('0x9'));var fs=require('fs');var fs_extra=require(_0xcfac('0xa'));var _=require(_0xcfac('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcfac('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcfac('0x8'));var querystring=require('querystring');var Papa=require(_0xcfac('0xd'));var Redis=require('ioredis');var authService=require(_0xcfac('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcfac('0xf'));var hardwareService=require(_0xcfac('0x10'));var logger=require(_0xcfac('0x11'))(_0xcfac('0x12'));var utils=require(_0xcfac('0x13'));var config=require(_0xcfac('0x14'));var licenseUtil=require(_0xcfac('0x15'));var db=require('../../mysqldb')['db'];config[_0xcfac('0x16')]=_[_0xcfac('0x17')](config[_0xcfac('0x16')],{'host':_0xcfac('0x18'),'port':0x18eb});var socket=require(_0xcfac('0x19'))(new Redis(config['redis']));require(_0xcfac('0x1a'))[_0xcfac('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xcfac('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x444464,_0x57ff39,_0x46634b,_0x4856af){return new BPromise(function(_0x332d2f,_0x11f3c0){var _0x1e6dce=_0x4856af||client;return _0x1e6dce[_0xcfac('0x1d')](_0x444464,_0x46634b)[_0xcfac('0x1e')](function(_0x526e7c){logger[_0xcfac('0x1f')](_0xcfac('0x20'),_0x57ff39,'request\x20sent');logger[_0xcfac('0x21')](_0xcfac('0x22'),_0x57ff39,'request\x20sent',JSON[_0xcfac('0x23')](_0x526e7c));if(_0x526e7c['error']){if(_0x526e7c[_0xcfac('0x24')][_0xcfac('0x25')]===0x1f4){logger['error'](_0xcfac('0x20'),_0x57ff39,_0x526e7c['error'][_0xcfac('0x26')]);return _0x11f3c0(_0x526e7c[_0xcfac('0x24')]['message']);}logger['error'](_0xcfac('0x20'),_0x57ff39,_0x526e7c[_0xcfac('0x24')][_0xcfac('0x26')]);return _0x332d2f(_0x526e7c[_0xcfac('0x24')]['message']);}else{logger['info'](_0xcfac('0x20'),_0x57ff39,'request\x20sent');_0x332d2f(_0x526e7c[_0xcfac('0x27')][_0xcfac('0x26')]);}})[_0xcfac('0x28')](function(_0x320129){logger[_0xcfac('0x24')]('FaxMessage,\x20%s,\x20%s',_0x57ff39,_0x320129);_0x11f3c0(_0x320129);});});}function respondWithStatusCode(_0x1c848e,_0x1365bf){_0x1365bf=_0x1365bf||0xcc;return function(_0x486c69){if(_0x486c69){return _0x1c848e[_0xcfac('0x29')](_0x1365bf);}return _0x1c848e[_0xcfac('0x2a')](_0x1365bf)[_0xcfac('0x2b')]();};}function respondWithResult(_0xd63cc4,_0x32c56e){_0x32c56e=_0x32c56e||0xc8;return function(_0xbb19ae){if(_0xbb19ae){return _0xd63cc4[_0xcfac('0x2a')](_0x32c56e)[_0xcfac('0x2c')](_0xbb19ae);}};}function respondWithFilteredResult(_0x50b2ba,_0x21dcae){return function(_0x118b50){if(_0x118b50){var _0x1845c7=typeof _0x21dcae[_0xcfac('0x2d')]===_0xcfac('0x2e')&&typeof _0x21dcae['limit']===_0xcfac('0x2e');var _0x48dccc=_0x118b50['count'];var _0x451071=_0x1845c7?0x0:_0x21dcae['offset'];var _0x107c01=_0x1845c7?_0x118b50['count']:_0x21dcae[_0xcfac('0x2d')]+_0x21dcae[_0xcfac('0x2f')];var _0x18fd85;if(_0x107c01>=_0x48dccc){_0x107c01=_0x48dccc;_0x18fd85=0xc8;}else{_0x18fd85=0xce;}_0x50b2ba['status'](_0x18fd85);return _0x50b2ba[_0xcfac('0x30')](_0xcfac('0x31'),_0x451071+'-'+_0x107c01+'/'+_0x48dccc)[_0xcfac('0x2c')](_0x118b50);}return null;};}function patchUpdates(_0x17986a){return function(_0x165e93){try{jsonpatch[_0xcfac('0x32')](_0x165e93,_0x17986a,!![]);}catch(_0x56ff82){return BPromise[_0xcfac('0x33')](_0x56ff82);}return _0x165e93['save']();};}function saveUpdates(_0x275866,_0x579e63){return function(_0x5ca8a1){if(_0x5ca8a1){return _0x5ca8a1[_0xcfac('0x34')](_0x275866)[_0xcfac('0x1e')](function(_0x2dd48a){return _0x2dd48a;});}return null;};}function removeEntity(_0x50125c,_0x5d2547){return function(_0x57924a){if(_0x57924a){return _0x57924a[_0xcfac('0x35')]()[_0xcfac('0x1e')](function(){_0x50125c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x446c41,_0x2deb2c){return function(_0x143fd4){if(!_0x143fd4){_0x446c41[_0xcfac('0x29')](0x194);}return _0x143fd4;};}function handleError(_0x522e02,_0x3169d4){_0x3169d4=_0x3169d4||0x1f4;return function(_0x111519){logger['error'](_0x111519[_0xcfac('0x36')]);if(_0x111519[_0xcfac('0x37')]){delete _0x111519[_0xcfac('0x37')];}_0x522e02[_0xcfac('0x2a')](_0x3169d4)[_0xcfac('0x38')](_0x111519);};}exports[_0xcfac('0x39')]=function(_0x49d326,_0x4bf2ee){var _0x1ff2e6={},_0x183bcc={},_0x563307={'count':0x0,'rows':[]};var _0x41ea91=_['map'](db[_0xcfac('0x3a')][_0xcfac('0x3b')],function(_0x66944f){return{'name':_0x66944f[_0xcfac('0x3c')],'type':_0x66944f['type'][_0xcfac('0x3d')]};});_0x183bcc[_0xcfac('0x3e')]=_['map'](_0x41ea91,'name');_0x183bcc[_0xcfac('0x3f')]=_[_0xcfac('0x40')](_0x49d326['query']);_0x183bcc[_0xcfac('0x41')]=_[_0xcfac('0x42')](_0x183bcc[_0xcfac('0x3e')],_0x183bcc[_0xcfac('0x3f')]);_0x1ff2e6[_0xcfac('0x43')]=_[_0xcfac('0x42')](_0x183bcc['model'],qs[_0xcfac('0x44')](_0x49d326[_0xcfac('0x3f')][_0xcfac('0x44')]));_0x1ff2e6[_0xcfac('0x43')]=_0x1ff2e6[_0xcfac('0x43')][_0xcfac('0x45')]?_0x1ff2e6[_0xcfac('0x43')]:_0x183bcc['model'];if(!_0x49d326[_0xcfac('0x3f')][_0xcfac('0x46')](_0xcfac('0x47'))){_0x1ff2e6['limit']=qs[_0xcfac('0x2f')](_0x49d326[_0xcfac('0x3f')]['limit']);_0x1ff2e6['offset']=qs[_0xcfac('0x2d')](_0x49d326[_0xcfac('0x3f')]['offset']);}_0x1ff2e6['order']=qs[_0xcfac('0x48')](_0x49d326['query'][_0xcfac('0x48')]);_0x1ff2e6[_0xcfac('0x49')]=qs[_0xcfac('0x41')](_[_0xcfac('0x4a')](_0x49d326[_0xcfac('0x3f')],_0x183bcc['filters']),_0x41ea91);if(_0x49d326['query'][_0xcfac('0x4b')]){_0x1ff2e6[_0xcfac('0x49')]=_[_0xcfac('0x4c')](_0x1ff2e6[_0xcfac('0x49')],{'$or':_['map'](_0x41ea91,function(_0x2e0a08){if(_0x2e0a08[_0xcfac('0x4d')]!==_0xcfac('0x4e')){var _0x12006a={};_0x12006a[_0x2e0a08[_0xcfac('0x37')]]={'$like':'%'+_0x49d326[_0xcfac('0x3f')][_0xcfac('0x4b')]+'%'};return _0x12006a;}})});}_0x1ff2e6=_[_0xcfac('0x4c')]({},_0x1ff2e6,_0x49d326[_0xcfac('0x4f')]);var _0x3e4684={'where':_0x1ff2e6[_0xcfac('0x49')]};return db[_0xcfac('0x3a')]['count'](_0x3e4684)[_0xcfac('0x1e')](function(_0x2888d4){_0x563307[_0xcfac('0x50')]=_0x2888d4;if(_0x49d326[_0xcfac('0x3f')][_0xcfac('0x51')]){_0x1ff2e6[_0xcfac('0x52')]=[{'all':!![]}];}return db[_0xcfac('0x3a')]['findAll'](_0x1ff2e6);})[_0xcfac('0x1e')](function(_0x642fe0){_0x563307[_0xcfac('0x53')]=_0x642fe0;return _0x563307;})['then'](respondWithFilteredResult(_0x4bf2ee,_0x1ff2e6))[_0xcfac('0x28')](handleError(_0x4bf2ee,null));};exports[_0xcfac('0x54')]=function(_0x47b743,_0x52f5a7){var _0x2fcadd={'raw':!![],'where':{'id':_0x47b743['params']['id']}},_0x3817ac={};_0x3817ac[_0xcfac('0x3e')]=_[_0xcfac('0x40')](db[_0xcfac('0x3a')][_0xcfac('0x3b')]);_0x3817ac[_0xcfac('0x3f')]=_['keys'](_0x47b743[_0xcfac('0x3f')]);_0x3817ac['filters']=_[_0xcfac('0x42')](_0x3817ac[_0xcfac('0x3e')],_0x3817ac[_0xcfac('0x3f')]);_0x2fcadd[_0xcfac('0x43')]=_[_0xcfac('0x42')](_0x3817ac[_0xcfac('0x3e')],qs[_0xcfac('0x44')](_0x47b743[_0xcfac('0x3f')][_0xcfac('0x44')]));_0x2fcadd[_0xcfac('0x43')]=_0x2fcadd[_0xcfac('0x43')]['length']?_0x2fcadd['attributes']:_0x3817ac['model'];if(_0x47b743[_0xcfac('0x3f')]['includeAll']){_0x2fcadd[_0xcfac('0x52')]=[{'all':!![]}];}_0x2fcadd=_['merge']({},_0x2fcadd,_0x47b743[_0xcfac('0x4f')]);return db['FaxMessage'][_0xcfac('0x55')](_0x2fcadd)[_0xcfac('0x1e')](handleEntityNotFound(_0x52f5a7,null))[_0xcfac('0x1e')](respondWithResult(_0x52f5a7,null))[_0xcfac('0x28')](handleError(_0x52f5a7,null));};exports[_0xcfac('0x34')]=function(_0x31a2fb,_0x387a41){if(_0x31a2fb['body']['id']){delete _0x31a2fb[_0xcfac('0x56')]['id'];}return db[_0xcfac('0x3a')][_0xcfac('0x55')]({'where':{'id':_0x31a2fb['params']['id']}})[_0xcfac('0x1e')](handleEntityNotFound(_0x387a41,null))[_0xcfac('0x1e')](saveUpdates(_0x31a2fb[_0xcfac('0x56')],null))[_0xcfac('0x1e')](respondWithResult(_0x387a41,null))[_0xcfac('0x28')](handleError(_0x387a41,null));};exports[_0xcfac('0x35')]=function(_0x24365c,_0x105df4){return db[_0xcfac('0x3a')][_0xcfac('0x55')]({'where':{'id':_0x24365c['params']['id']}})[_0xcfac('0x1e')](handleEntityNotFound(_0x105df4,null))[_0xcfac('0x1e')](removeEntity(_0x105df4,null))[_0xcfac('0x28')](handleError(_0x105df4,null));};exports[_0xcfac('0x57')]=function(_0x1dcca7,_0x4c41a0){return db[_0xcfac('0x3a')][_0xcfac('0x57')]()['then'](respondWithResult(_0x4c41a0,null))[_0xcfac('0x28')](handleError(_0x4c41a0,null));};var interaction_log=require('../../config/logger')(_0xcfac('0x58'));exports['accept']=function(_0x1589ee,_0x30e281,_0x127cba){var _0x13eada={'agent':{},'channel':_0xcfac('0x59')};if(_0x1589ee[_0xcfac('0x56')]['id']){delete _0x1589ee[_0xcfac('0x56')]['id'];}_0x1589ee[_0xcfac('0x56')][_0xcfac('0x5a')]=!![];_0x1589ee['body'][_0xcfac('0x5b')]=moment()['format'](_0xcfac('0x5c'));_0x1589ee[_0xcfac('0x56')][_0xcfac('0x5d')]=_0x1589ee[_0xcfac('0x56')]['UserId']||_0x1589ee['user']['id'];_0x13eada[_0xcfac('0x5e')]['id']=_0x1589ee[_0xcfac('0x56')][_0xcfac('0x5d')];return db[_0xcfac('0x3a')][_0xcfac('0x55')]({'where':{'id':_0x1589ee[_0xcfac('0x5f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x30e281,null))[_0xcfac('0x1e')](saveUpdates(_0x1589ee[_0xcfac('0x56')],null))[_0xcfac('0x1e')](function(_0x285f2a){if(_0x285f2a){_0x13eada['message']=_0x285f2a[_0xcfac('0x60')]({'plain':!![]});return db[_0xcfac('0x61')][_0xcfac('0x55')]({'where':{'id':_0x285f2a[_0xcfac('0x62')]}});}return null;})[_0xcfac('0x1e')](handleEntityNotFound(_0x30e281,null))[_0xcfac('0x1e')](function(_0x3270ac){if(_0x3270ac){return _0x3270ac[_0xcfac('0x34')]({'UserId':_0x1589ee[_0xcfac('0x56')][_0xcfac('0x5d')],'read1stAt':_[_0xcfac('0x63')](_0x3270ac[_0xcfac('0x64')])?moment()['format'](_0xcfac('0x5c')):undefined});}return null;})[_0xcfac('0x1e')](function(_0x34a5f5){if(_0x34a5f5){_0x13eada['interaction']=_0x34a5f5[_0xcfac('0x60')]({'plain':!![]});interaction_log[_0xcfac('0x1f')](_0xcfac('0x65'),_0x1589ee['user']['id'],_0x1589ee[_0xcfac('0x66')][_0xcfac('0x37')],_0x1589ee[_0xcfac('0x66')][_0xcfac('0x67')],_0x13eada[_0xcfac('0x68')]['id'],_0x1589ee[_0xcfac('0x56')]?JSON[_0xcfac('0x23')](_0x1589ee[_0xcfac('0x56')]):_0xcfac('0x69'));return respondWithRpcPromise('AcceptMessage',_0xcfac('0x6a'),_0x13eada);}return null;})[_0xcfac('0x1e')](function(_0x436d28){var _0xbd7b14=_0xcfac('0x6b')+_0x436d28[_0xcfac('0x26')]['ContactId'];return db['sequelize'][_0xcfac('0x3f')](_0xbd7b14,{'type':db[_0xcfac('0x6c')][_0xcfac('0x6d')][_0xcfac('0x6e')],'raw':!![]})[_0xcfac('0x1e')](function(_0x2b5c57){return _0x2b5c57;});})[_0xcfac('0x1e')](function(_0x308bd5){if(_0x308bd5){_0x13eada[_0xcfac('0x26')][_0xcfac('0x6f')]=_0x308bd5[0x0];if(!_0x1589ee['body'][_0xcfac('0x5d')])return;return db[_0xcfac('0x70')]['find']({'where':{'id':_0x1589ee['body'][_0xcfac('0x5d')],'role':'agent'},'attributes':['id','name','fullname',_0xcfac('0x71'),_0xcfac('0x72')],'raw':!![]});}return null;})[_0xcfac('0x1e')](function(_0x1a0df9){if(!_0x1a0df9)return null;_0x13eada['message'][_0xcfac('0x5e')]=_0x1a0df9;return _0x13eada;})[_0xcfac('0x1e')](function(_0x12b9ee){if(_0x12b9ee){if(_0x1589ee[_0xcfac('0x56')][_0xcfac('0x73')]){_0x13eada[_0xcfac('0x26')][_0xcfac('0x74')]=util[_0xcfac('0x75')](_0xcfac('0x76'),_0x1589ee['user'][_0xcfac('0x37')]);_0x13eada['message'][_0xcfac('0x77')]=_0x13eada[_0xcfac('0x77')];_0x13eada[_0xcfac('0x26')]['motionChannel']=_0x13eada['channel'];_0x13eada[_0xcfac('0x26')][_0xcfac('0x78')]=_0xcfac('0x79');return respondWithRpcPromise(_0xcfac('0x7a'),_0xcfac('0x7a'),{'event':'acceptmessage','message':_0x13eada[_0xcfac('0x26')]},client9002)[_0xcfac('0x1e')](function(){return _0x13eada;});}return _0x13eada;}return null;})[_0xcfac('0x1e')](respondWithResult(_0x30e281,null))[_0xcfac('0x28')](handleError(_0x30e281,null));};var interaction_log=require(_0xcfac('0x11'))(_0xcfac('0x58'));exports[_0xcfac('0x33')]=function(_0x203cc4,_0x43008a,_0x44e977){var _0x546335={'agent':{},'channel':_0xcfac('0x59')};if(_0x203cc4['body']['id']){delete _0x203cc4[_0xcfac('0x56')]['id'];}_0x203cc4[_0xcfac('0x56')][_0xcfac('0x5d')]=_0x203cc4[_0xcfac('0x56')][_0xcfac('0x5d')]||_0x203cc4[_0xcfac('0x66')]['id'];_0x546335[_0xcfac('0x5e')]['id']=_0x203cc4[_0xcfac('0x56')]['UserId'];return db[_0xcfac('0x3a')][_0xcfac('0x55')]({'where':{'id':_0x203cc4[_0xcfac('0x5f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x43008a,null))[_0xcfac('0x1e')](function(_0x4159fb){if(_0x4159fb){_0x546335[_0xcfac('0x26')]=_0x4159fb[_0xcfac('0x60')]({'plain':!![]});return db['FaxInteraction'][_0xcfac('0x55')]({'where':{'id':_0x4159fb[_0xcfac('0x62')]}});}return null;})[_0xcfac('0x1e')](handleEntityNotFound(_0x43008a,null))[_0xcfac('0x1e')](function(_0x3b1b82){if(_0x3b1b82){_0x546335[_0xcfac('0x68')]=_0x3b1b82[_0xcfac('0x60')]({'plain':!![]});interaction_log[_0xcfac('0x1f')](_0xcfac('0x7b'),_0x203cc4[_0xcfac('0x66')]['id'],_0x203cc4['user'][_0xcfac('0x37')],_0x203cc4[_0xcfac('0x66')][_0xcfac('0x67')],_0x546335[_0xcfac('0x68')]['id'],_0x203cc4[_0xcfac('0x56')]?JSON[_0xcfac('0x23')](_0x203cc4[_0xcfac('0x56')]):_0xcfac('0x69'));return respondWithRpcPromise(_0xcfac('0x7c'),'rejectMessage',_0x546335);}return null;})[_0xcfac('0x1e')](function(_0x3bcfcf){var _0x4cb41f=_0xcfac('0x6b')+_0x3bcfcf[_0xcfac('0x26')][_0xcfac('0x7d')];return db['sequelize'][_0xcfac('0x3f')](_0x4cb41f,{'type':db['Sequelize'][_0xcfac('0x6d')][_0xcfac('0x6e')],'raw':!![]})['then'](function(_0x4fc550){return _0x4fc550;});})[_0xcfac('0x1e')](function(_0x54af25){if(_0x54af25){_0x546335[_0xcfac('0x26')]['contact']=_0x54af25[0x0];if(!_0x203cc4['body'][_0xcfac('0x5d')])return;return db[_0xcfac('0x70')][_0xcfac('0x55')]({'where':{'id':_0x203cc4[_0xcfac('0x56')][_0xcfac('0x5d')],'role':_0xcfac('0x5e')},'attributes':['id','name',_0xcfac('0x7e'),_0xcfac('0x71'),_0xcfac('0x72')],'raw':!![]});}return null;})[_0xcfac('0x1e')](function(_0x356dda){if(!_0x356dda)return null;_0x546335['message'][_0xcfac('0x5e')]=_0x356dda;return _0x546335;})['then'](function(_0xcd72f0){if(_0xcd72f0){_0xcd72f0[_0xcfac('0x26')][_0xcfac('0x74')]=util['format'](_0xcfac('0x76'),_0x203cc4[_0xcfac('0x66')][_0xcfac('0x37')]);_0xcd72f0[_0xcfac('0x26')][_0xcfac('0x77')]=_0x546335[_0xcfac('0x77')];_0xcd72f0[_0xcfac('0x26')][_0xcfac('0x7f')]=_0x546335[_0xcfac('0x77')];_0xcd72f0[_0xcfac('0x26')][_0xcfac('0x78')]='reject';respondWithRpcPromise(_0xcfac('0x7a'),_0xcfac('0x7a'),{'event':_0xcfac('0x80'),'message':_0xcd72f0['message']},client9002);return _0x546335;}return null;})[_0xcfac('0x1e')](respondWithResult(_0x43008a,null))[_0xcfac('0x28')](handleError(_0x43008a,null));};exports[_0xcfac('0x81')]=function(_0x1389ed,_0x3f70a9){var _0x485733;return db[_0xcfac('0x3a')][_0xcfac('0x81')](_0x1389ed[_0xcfac('0x56')],{})['then'](function(_0x440376){_0x485733=_0x440376;return db[_0xcfac('0x82')][_0xcfac('0x83')]({'where':{'id':_0x485733[_0xcfac('0x7d')]}});})['then'](function(_0x427a18){if(_[_0xcfac('0x63')](_0x427a18)){return;}else{_0x485733[_0xcfac('0x59')]=_0x427a18['fax'];return db[_0xcfac('0x84')][_0xcfac('0x83')]({'where':{'id':_0x485733[_0xcfac('0x85')]}});}})[_0xcfac('0x1e')](function(_0x4015ca){return respondWithRpcPromise(_0xcfac('0x86'),_0xcfac('0x86'),{'FaxAccountId':_[_0xcfac('0x63')](_0x1389ed[_0xcfac('0x56')])?undefined:_0x1389ed[_0xcfac('0x56')]['FaxAccountId'],'path':_[_0xcfac('0x63')](_0x4015ca)?undefined:util[_0xcfac('0x75')](_0xcfac('0x87'),_0x4015ca[_0xcfac('0x88')]),'fax':_[_0xcfac('0x63')](_0x485733[_0xcfac('0x59')])?undefined:_0x485733[_0xcfac('0x59')],'AttachmentId':_0x485733[_0xcfac('0x85')]},client9002);})[_0xcfac('0x1e')](respondWithResult(_0x3f70a9,0xc9))[_0xcfac('0x28')](handleError(_0x3f70a9,null));};exports[_0xcfac('0x89')]=function(_0x21fd1b,_0x53734b){var _0x518783=path[_0xcfac('0x8a')](config[_0xcfac('0x8b')],_0xcfac('0x8c'),_0xcfac('0x8d'),_0xcfac('0x8e'));return db[_0xcfac('0x3a')]['find']({'where':{'id':_0x21fd1b['params']['id']},'include':[{'model':db['Attachment'],'as':_0xcfac('0x84')}]})[_0xcfac('0x1e')](handleEntityNotFound(_0x53734b,null))[_0xcfac('0x1e')](function(_0x2fa949){if(_0x2fa949){return _0x53734b[_0xcfac('0x89')](path[_0xcfac('0x8a')](_0x518783,_0x2fa949[_0xcfac('0x84')][_0xcfac('0x88')]));}})[_0xcfac('0x28')](handleError(_0x53734b,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 4168692..9084130 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 _0xc14a=['FaxMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x22bb88,_0x12b18a){var _0x3cdbd3=function(_0xe476de){while(--_0xe476de){_0x22bb88['push'](_0x22bb88['shift']());}};_0x3cdbd3(++_0x12b18a);}(_0xc14a,0xa9));var _0xac14=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc14a[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0xac14('0x0'));var FaxMessage=require(_0xac14('0x1'))['db'][_0xac14('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xac14('0x3')](0x0);var events={'afterCreate':_0xac14('0x4'),'afterUpdate':'update','afterDestroy':_0xac14('0x5')};function emitEvent(_0x21c4da){return function(_0x53f3d1,_0x412485,_0x525320){FaxMessageEvents[_0xac14('0x6')](_0x21c4da+':'+_0x53f3d1['id'],_0x53f3d1);FaxMessageEvents[_0xac14('0x6')](_0x21c4da,_0x53f3d1);_0x525320(null);};}for(var e in events){if(events[_0xac14('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xac14('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x6c65=['events','../../mysqldb','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0xe9499f,_0xba6d4e){var _0x4d4016=function(_0xa3752b){while(--_0xa3752b){_0xe9499f['push'](_0xe9499f['shift']());}};_0x4d4016(++_0xba6d4e);}(_0x6c65,0x78));var _0x56c6=function(_0xd94791,_0x1e1c23){_0xd94791=_0xd94791-0x0;var _0x21494d=_0x6c65[_0xd94791];return _0x21494d;};'use strict';var EventEmitter=require(_0x56c6('0x0'));var FaxMessage=require(_0x56c6('0x1'))['db'][_0x56c6('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x56c6('0x3')](0x0);var events={'afterCreate':_0x56c6('0x4'),'afterUpdate':_0x56c6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x43d710){return function(_0x4321ef,_0x3f532d,_0x1e70f2){FaxMessageEvents[_0x56c6('0x6')](_0x43d710+':'+_0x4321ef['id'],_0x4321ef);FaxMessageEvents['emit'](_0x43d710,_0x4321ef);_0x1e70f2(null);};}for(var e in events){if(events[_0x56c6('0x7')](e)){var event=events[e];FaxMessage[_0x56c6('0x8')](e,emitEvent(event));}}module[_0x56c6('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 b6e0bff..4280ebd 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 _0xf0c8=['FaxMessage','fax_messages','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define'];(function(_0x12e143,_0x1df79e){var _0xcc7618=function(_0x466f60){while(--_0x466f60){_0x12e143['push'](_0x12e143['shift']());}};_0xcc7618(++_0x1df79e);}(_0xf0c8,0x1a7));var _0x8f0c=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xf0c8[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0x8f0c('0x0'));var util=require(_0x8f0c('0x1'));var logger=require(_0x8f0c('0x2'))(_0x8f0c('0x3'));var moment=require(_0x8f0c('0x4'));var BPromise=require(_0x8f0c('0x5'));var rp=require(_0x8f0c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f0c('0x7'));var config=require(_0x8f0c('0x8'));var attributes=require(_0x8f0c('0x9'));module[_0x8f0c('0xa')]=function(_0x452c13,_0x557236){return _0x452c13[_0x8f0c('0xb')](_0x8f0c('0xc'),attributes,{'tableName':_0x8f0c('0xd'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d0cc5,_0x3833f6,_0x2eefc4){var _0x391de1=_0x452c13[_0x8f0c('0xe')];var _0x5d439f=_0x2d0cc5[_0x8f0c('0xf')]({'plain':!![]});if(_0x5d439f[_0x8f0c('0x10')][_0x8f0c('0x11')]()==='in'||_0x5d439f[_0x8f0c('0x10')][_0x8f0c('0x11')]()===_0x8f0c('0x12')&&!_0x5d439f[_0x8f0c('0x13')]&&!_[_0x8f0c('0x14')](_0x5d439f[_0x8f0c('0x15')])){_0x391de1[_0x8f0c('0x16')]['findOne']({'where':{'id':_0x5d439f['FaxInteractionId']}})[_0x8f0c('0x17')](function(_0x360b50){if(_0x360b50){_0x360b50[_0x8f0c('0x18')]({'lastMsgAt':_0x5d439f[_0x8f0c('0x19')],'lastMsgDirection':_0x5d439f[_0x8f0c('0x10')][_0x8f0c('0x11')]()});}})['catch'](function(_0x4758ae){console[_0x8f0c('0x1a')](_0x4758ae);});}_0x2eefc4();}},'charset':_0x8f0c('0x1b'),'collate':_0x8f0c('0x1c')});}; \ No newline at end of file +var _0x75f0=['FaxInteractionId','then','update','createdAt','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','body','models','get','direction','toLowerCase','isNil','findOne'];(function(_0x1ccfb0,_0x3ac7d3){var _0x3a6a0f=function(_0x3989f2){while(--_0x3989f2){_0x1ccfb0['push'](_0x1ccfb0['shift']());}};_0x3a6a0f(++_0x3ac7d3);}(_0x75f0,0x83));var _0x075f=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0x75f0[_0x4b4d43];return _0x5706ba;};'use strict';var _=require(_0x075f('0x0'));var util=require(_0x075f('0x1'));var logger=require(_0x075f('0x2'))('api');var moment=require(_0x075f('0x3'));var BPromise=require(_0x075f('0x4'));var rp=require(_0x075f('0x5'));var fs=require('fs');var path=require(_0x075f('0x6'));var rimraf=require('rimraf');var config=require(_0x075f('0x7'));var attributes=require(_0x075f('0x8'));module[_0x075f('0x9')]=function(_0x474882,_0x5572a6){return _0x474882[_0x075f('0xa')]('FaxMessage',attributes,{'tableName':_0x075f('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x075f('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b1a80,_0x2d6533,_0x47549d){var _0x41da2d=_0x474882[_0x075f('0xd')];var _0x187502=_0x2b1a80[_0x075f('0xe')]({'plain':!![]});if(_0x187502[_0x075f('0xf')][_0x075f('0x10')]()==='in'||_0x187502[_0x075f('0xf')]['toLowerCase']()==='out'&&!_0x187502['secret']&&!_[_0x075f('0x11')](_0x187502['UserId'])){_0x41da2d['FaxInteraction'][_0x075f('0x12')]({'where':{'id':_0x187502[_0x075f('0x13')]}})[_0x075f('0x14')](function(_0x5d2fca){if(_0x5d2fca){_0x5d2fca[_0x075f('0x15')]({'lastMsgAt':_0x187502[_0x075f('0x16')],'lastMsgDirection':_0x187502[_0x075f('0xf')][_0x075f('0x10')]()});}})['catch'](function(_0x232078){console[_0x075f('0x17')](_0x232078);});}_0x47549d();}},'charset':'utf8mb4','collate':_0x075f('0x18')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 7f246d0..f3e5377 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 _0x4bc3=['CreateFaxMessage','FaxMessage','create','body','options','raw','then','stringify','catch','UpdateFaxMessage','update','where','attributes','limit','info','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4bc3,0x16e));var _0x34bc=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x4bc3[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var moment=require('moment');var BPromise=require(_0x34bc('0x2'));var rs=require(_0x34bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bc('0x4'))['db'];var utils=require(_0x34bc('0x5'));var logger=require(_0x34bc('0x6'))(_0x34bc('0x7'));var config=require(_0x34bc('0x8'));var jayson=require(_0x34bc('0x9'));var client=jayson[_0x34bc('0xa')]['http']({'port':0x232a});config[_0x34bc('0xb')]=_['defaults'](config['redis'],{'host':_0x34bc('0xc'),'port':0x18eb});var socket=require(_0x34bc('0xd'))(new Redis(config[_0x34bc('0xb')]));require(_0x34bc('0xe'))[_0x34bc('0xf')](socket);function respondWithRpcPromise(_0x41b2ff,_0x5de8b5,_0x5a478d){return new BPromise(function(_0x2b8112,_0x33025c){return client[_0x34bc('0x10')](_0x41b2ff,_0x5a478d)['then'](function(_0x41960e){logger['info'](_0x34bc('0x11'),_0x5de8b5,_0x34bc('0x12'));logger[_0x34bc('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5de8b5,_0x34bc('0x12'),JSON['stringify'](_0x41960e));if(_0x41960e[_0x34bc('0x14')]){if(_0x41960e[_0x34bc('0x14')][_0x34bc('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x5de8b5,_0x41960e[_0x34bc('0x14')]['message']);return _0x33025c(_0x41960e[_0x34bc('0x14')][_0x34bc('0x16')]);}logger[_0x34bc('0x14')](_0x34bc('0x11'),_0x5de8b5,_0x41960e[_0x34bc('0x14')][_0x34bc('0x16')]);return _0x2b8112(_0x41960e['error']['message']);}else{logger['info'](_0x34bc('0x11'),_0x5de8b5,_0x34bc('0x12'));_0x2b8112(_0x41960e[_0x34bc('0x17')][_0x34bc('0x16')]);}})['catch'](function(_0x46aa24){logger[_0x34bc('0x14')]('FaxMessage,\x20%s,\x20%s',_0x5de8b5,_0x46aa24);_0x33025c(_0x46aa24);});});}exports[_0x34bc('0x18')]=function(_0x9e9f14){var _0x4d2d5e=this;return new Promise(function(_0x14cec8,_0x26cdec){return db[_0x34bc('0x19')][_0x34bc('0x1a')](_0x9e9f14[_0x34bc('0x1b')],{'raw':_0x9e9f14[_0x34bc('0x1c')]?_0x9e9f14['options'][_0x34bc('0x1d')]===undefined?!![]:![]:!![]})[_0x34bc('0x1e')](function(_0x38882c){logger['info']('CreateFaxMessage',_0x9e9f14);logger[_0x34bc('0x13')](_0x34bc('0x18'),_0x9e9f14,JSON[_0x34bc('0x1f')](_0x38882c));_0x14cec8(_0x38882c);})[_0x34bc('0x20')](function(_0x13094a){logger[_0x34bc('0x14')](_0x34bc('0x18'),_0x13094a[_0x34bc('0x16')],_0x9e9f14);_0x26cdec(_0x4d2d5e[_0x34bc('0x14')](0x1f4,_0x13094a[_0x34bc('0x16')]));});});};exports[_0x34bc('0x21')]=function(_0x1edcb0){var _0x4fd589=this;return new Promise(function(_0x43e527,_0x48ec13){return db['FaxMessage'][_0x34bc('0x22')](_0x1edcb0['body'],{'raw':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1edcb0['options']?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x23')]||null:null,'attributes':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x24')]||null:null,'limit':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0['options'][_0x34bc('0x25')]||null:null})[_0x34bc('0x1e')](function(_0x22aacc){logger[_0x34bc('0x26')](_0x34bc('0x21'),_0x1edcb0);logger[_0x34bc('0x13')]('UpdateFaxMessage',_0x1edcb0,JSON[_0x34bc('0x1f')](_0x22aacc));_0x43e527(_0x22aacc);})['catch'](function(_0x530748){logger[_0x34bc('0x14')]('UpdateFaxMessage',_0x530748[_0x34bc('0x16')],_0x1edcb0);_0x48ec13(_0x4fd589[_0x34bc('0x14')](0x1f4,_0x530748[_0x34bc('0x16')]));});});}; \ 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(_0x7f1644,_0x268f86){var _0x5518b0=function(_0x977aba){while(--_0x977aba){_0x7f1644['push'](_0x7f1644['shift']());}};_0x5518b0(++_0x268f86);}(_0xb821,0xa7));var _0x1b82=function(_0x1f8ce9,_0x80ddfb){_0x1f8ce9=_0x1f8ce9-0x0;var _0x46bee3=_0xb821[_0x1f8ce9];return _0x46bee3;};'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 dbe345e..d81d615 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 _0x983b=['length','faxMessage:','./faxMessage.events','save','update','removeListener','register'];(function(_0x243c52,_0x496529){var _0x492280=function(_0x3e4467){while(--_0x3e4467){_0x243c52['push'](_0x243c52['shift']());}};_0x492280(++_0x496529);}(_0x983b,0x14b));var _0xb983=function(_0x206c55,_0x595718){_0x206c55=_0x206c55-0x0;var _0x2cf410=_0x983b[_0x206c55];return _0x2cf410;};'use strict';var FaxMessageEvents=require(_0xb983('0x0'));var events=[_0xb983('0x1'),'remove',_0xb983('0x2')];function createListener(_0x283e40,_0x3f6877){return function(_0x269063){_0x3f6877['emit'](_0x283e40,_0x269063);};}function removeListener(_0x3360aa,_0x5b2f68){return function(){FaxMessageEvents[_0xb983('0x3')](_0x3360aa,_0x5b2f68);};}exports[_0xb983('0x4')]=function(_0x579efe){for(var _0x5f5b6a=0x0,_0x17e334=events[_0xb983('0x5')];_0x5f5b6a<_0x17e334;_0x5f5b6a++){var _0x548917=events[_0x5f5b6a];var _0x347a8d=createListener(_0xb983('0x6')+_0x548917,_0x579efe);FaxMessageEvents['on'](_0x548917,_0x347a8d);}}; \ No newline at end of file +var _0x2781=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x1dd457,_0x44f719){var _0x17ad2e=function(_0xb4786){while(--_0xb4786){_0x1dd457['push'](_0x1dd457['shift']());}};_0x17ad2e(++_0x44f719);}(_0x2781,0x186));var _0x1278=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2781[_0x3ab51d];return _0x29a04e;};'use strict';var FaxMessageEvents=require(_0x1278('0x0'));var events=[_0x1278('0x1'),_0x1278('0x2'),_0x1278('0x3')];function createListener(_0x9b49,_0x339d30){return function(_0x2dfba8){_0x339d30[_0x1278('0x4')](_0x9b49,_0x2dfba8);};}function removeListener(_0x184cde,_0x5d02a0){return function(){FaxMessageEvents[_0x1278('0x5')](_0x184cde,_0x5d02a0);};}exports[_0x1278('0x6')]=function(_0xe14630){for(var _0x537201=0x0,_0x331966=events[_0x1278('0x7')];_0x537201<_0x331966;_0x537201++){var _0x2a6926=events[_0x537201];var _0x1e6651=createListener(_0x1278('0x8')+_0x2a6926,_0xe14630);FaxMessageEvents['on'](_0x2a6926,_0x1e6651);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 2e419a3..ad58734 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 _0x5ff3=['/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/:id','download','tracked','put','update'];(function(_0xa0b1db,_0x5590d3){var _0x11423a=function(_0xa484a){while(--_0xa484a){_0xa0b1db['push'](_0xa0b1db['shift']());}};_0x11423a(++_0x5590d3);}(_0x5ff3,0x17d));var _0x35ff=function(_0x3ec058,_0x313e0e){_0x3ec058=_0x3ec058-0x0;var _0x559860=_0x5ff3[_0x3ec058];return _0x559860;};'use strict';var multer=require('multer');var util=require(_0x35ff('0x0'));var path=require('path');var timeout=require(_0x35ff('0x1'));var express=require('express');var router=express[_0x35ff('0x2')]();var fs_extra=require(_0x35ff('0x3'));var auth=require(_0x35ff('0x4'));var interaction=require(_0x35ff('0x5'));var config=require('../../config/environment');var controller=require(_0x35ff('0x6'));router[_0x35ff('0x7')]('/',auth[_0x35ff('0x8')](),controller[_0x35ff('0x9')]);router[_0x35ff('0x7')]('/describe',auth[_0x35ff('0x8')](),controller['describe']);router[_0x35ff('0x7')](_0x35ff('0xa'),auth[_0x35ff('0x8')](),controller['show']);router[_0x35ff('0x7')]('/:id/download',auth[_0x35ff('0x8')](),controller[_0x35ff('0xb')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x35ff('0xc')]('fax','faxmessage:create'),controller['create']);router[_0x35ff('0xd')](_0x35ff('0xa'),auth[_0x35ff('0x8')](),controller[_0x35ff('0xe')]);router['put'](_0x35ff('0xf'),auth[_0x35ff('0x8')](),controller[_0x35ff('0x10')]);router['put'](_0x35ff('0x11'),auth[_0x35ff('0x8')](),controller[_0x35ff('0x12')]);router[_0x35ff('0x13')](_0x35ff('0xa'),auth[_0x35ff('0x8')](),controller[_0x35ff('0x14')]);module[_0x35ff('0x15')]=router; \ No newline at end of file +var _0xfe57=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','show','download','faxmessage:create','create','put','/:id','update','/:id/reject','reject','destroy','exports','multer','util','express'];(function(_0x671369,_0x433da5){var _0x33f2b4=function(_0x2e9db2){while(--_0x2e9db2){_0x671369['push'](_0x671369['shift']());}};_0x33f2b4(++_0x433da5);}(_0xfe57,0x195));var _0x7fe5=function(_0x3c81b5,_0x3f5ed7){_0x3c81b5=_0x3c81b5-0x0;var _0x5888c4=_0xfe57[_0x3c81b5];return _0x5888c4;};'use strict';var multer=require(_0x7fe5('0x0'));var util=require(_0x7fe5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7fe5('0x2'));var router=express[_0x7fe5('0x3')]();var fs_extra=require(_0x7fe5('0x4'));var auth=require(_0x7fe5('0x5'));var interaction=require(_0x7fe5('0x6'));var config=require(_0x7fe5('0x7'));var controller=require(_0x7fe5('0x8'));router[_0x7fe5('0x9')]('/',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xb')]);router[_0x7fe5('0x9')](_0x7fe5('0xc'),auth[_0x7fe5('0xa')](),controller['describe']);router[_0x7fe5('0x9')]('/:id',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xd')]);router['get']('/:id/download',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xe')]);router['post']('/',auth[_0x7fe5('0xa')](),interaction['tracked']('fax',_0x7fe5('0xf')),controller[_0x7fe5('0x10')]);router[_0x7fe5('0x11')](_0x7fe5('0x12'),auth['isAuthenticated'](),controller[_0x7fe5('0x13')]);router[_0x7fe5('0x11')]('/:id/accept',auth[_0x7fe5('0xa')](),controller['accept']);router[_0x7fe5('0x11')](_0x7fe5('0x14'),auth['isAuthenticated'](),controller[_0x7fe5('0x15')]);router['delete'](_0x7fe5('0x12'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x16')]);module[_0x7fe5('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 95c5694..3818f0c 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 _0x1eb4=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x2ca73b,_0x1fd17a){var _0xb471d2=function(_0x73a664){while(--_0x73a664){_0x2ca73b['push'](_0x2ca73b['shift']());}};_0xb471d2(++_0x1fd17a);}(_0x1eb4,0x158));var _0x41eb=function(_0x1ab2f4,_0x4b2f37){_0x1ab2f4=_0x1ab2f4-0x0;var _0x247698=_0x1eb4[_0x1ab2f4];return _0x247698;};'use strict';var Sequelize=require('sequelize');module[_0x41eb('0x0')]={'name':{'type':Sequelize[_0x41eb('0x1')],'unique':_0x41eb('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x41eb('0x1')]},'timeout':{'type':Sequelize[_0x41eb('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x41eb('0x4')](_0x41eb('0x5'),_0x41eb('0x6'),_0x41eb('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8969=['ENUM','rrmemory','beepall','sequelize','STRING','name','INTEGER'];(function(_0x2ed356,_0x440f3f){var _0x3ce5dd=function(_0x1515f7){while(--_0x1515f7){_0x2ed356['push'](_0x2ed356['shift']());}};_0x3ce5dd(++_0x440f3f);}(_0x8969,0x130));var _0x9896=function(_0x995989,_0x471455){_0x995989=_0x995989-0x0;var _0x351998=_0x8969[_0x995989];return _0x351998;};'use strict';var Sequelize=require(_0x9896('0x0'));module['exports']={'name':{'type':Sequelize[_0x9896('0x1')],'unique':_0x9896('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9896('0x1')]},'timeout':{'type':Sequelize[_0x9896('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9896('0x4')](_0x9896('0x5'),_0x9896('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x9896('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 02baa27..8f63cab 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 _0x7c9b=['UserFaxQueue','sort','pick','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','updatedAt','format','SIP','createdAt','getTeams','Team','ids','Agents','voicePause','interface','sequelize','transaction','addTeams','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','undefined','limit','offset','apply','save','update','then','destroy','get','FaxQueues','UserProfileResource','name','index','map','FaxQueue','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','type','options','includeAll','findAll','rows','catch','params','rawAttributes','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne'];(function(_0x56d928,_0x27e810){var _0x3ddaec=function(_0x189c5e){while(--_0x189c5e){_0x56d928['push'](_0x56d928['shift']());}};_0x3ddaec(++_0x27e810);}(_0x7c9b,0x1da));var _0xb7c9=function(_0x5b5e79,_0x406983){_0x5b5e79=_0x5b5e79-0x0;var _0x32a431=_0x7c9b[_0x5b5e79];return _0x32a431;};'use strict';var emlformat=require(_0xb7c9('0x0'));var rimraf=require(_0xb7c9('0x1'));var zipdir=require(_0xb7c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb7c9('0x3'));var moment=require('moment');var BPromise=require(_0xb7c9('0x4'));var Mustache=require(_0xb7c9('0x5'));var util=require(_0xb7c9('0x6'));var path=require(_0xb7c9('0x7'));var sox=require('sox');var csv=require(_0xb7c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb7c9('0x9'));var _=require(_0xb7c9('0xa'));var squel=require(_0xb7c9('0xb'));var crypto=require(_0xb7c9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb7c9('0xd'));var toCsv=require(_0xb7c9('0x8'));var querystring=require(_0xb7c9('0xe'));var Papa=require(_0xb7c9('0xf'));var Redis=require(_0xb7c9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb7c9('0x11'));var as=require(_0xb7c9('0x12'));var hardwareService=require(_0xb7c9('0x13'));var logger=require(_0xb7c9('0x14'))(_0xb7c9('0x15'));var utils=require(_0xb7c9('0x16'));var config=require(_0xb7c9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb7c9('0x18'))['db'];config[_0xb7c9('0x19')]=_['defaults'](config[_0xb7c9('0x19')],{'host':_0xb7c9('0x1a'),'port':0x18eb});var socket=require(_0xb7c9('0x1b'))(new Redis(config[_0xb7c9('0x19')]));require(_0xb7c9('0x1c'))[_0xb7c9('0x1d')](socket);function respondWithStatusCode(_0x2026ed,_0x21e947){_0x21e947=_0x21e947||0xcc;return function(_0x567179){if(_0x567179){return _0x2026ed[_0xb7c9('0x1e')](_0x21e947);}return _0x2026ed[_0xb7c9('0x1f')](_0x21e947)[_0xb7c9('0x20')]();};}function respondWithResult(_0x2cfb90,_0x3cfc88){_0x3cfc88=_0x3cfc88||0xc8;return function(_0x4683dd){if(_0x4683dd){return _0x2cfb90[_0xb7c9('0x1f')](_0x3cfc88)[_0xb7c9('0x21')](_0x4683dd);}};}function respondWithFilteredResult(_0x176c6a,_0x7a0740){return function(_0x222004){if(_0x222004){var _0x572a6d=typeof _0x7a0740['offset']===_0xb7c9('0x22')&&typeof _0x7a0740[_0xb7c9('0x23')]===_0xb7c9('0x22');var _0x5afcf1=_0x222004['count'];var _0x39d7bf=_0x572a6d?0x0:_0x7a0740[_0xb7c9('0x24')];var _0x148d13=_0x572a6d?_0x222004['count']:_0x7a0740[_0xb7c9('0x24')]+_0x7a0740['limit'];var _0x20a14a;if(_0x148d13>=_0x5afcf1){_0x148d13=_0x5afcf1;_0x20a14a=0xc8;}else{_0x20a14a=0xce;}_0x176c6a['status'](_0x20a14a);return _0x176c6a['set']('Content-Range',_0x39d7bf+'-'+_0x148d13+'/'+_0x5afcf1)['json'](_0x222004);}return null;};}function patchUpdates(_0x39d515){return function(_0xa83c1d){try{jsonpatch[_0xb7c9('0x25')](_0xa83c1d,_0x39d515,!![]);}catch(_0x35e749){return BPromise['reject'](_0x35e749);}return _0xa83c1d[_0xb7c9('0x26')]();};}function saveUpdates(_0x37219b,_0x2092f7){return function(_0x3a225f){if(_0x3a225f){return _0x3a225f[_0xb7c9('0x27')](_0x37219b)[_0xb7c9('0x28')](function(_0x5d783c){return _0x5d783c;});}return null;};}function removeEntity(_0x111032,_0x4e92f2){return function(_0x4297c0){if(_0x4297c0){return _0x4297c0[_0xb7c9('0x29')]()[_0xb7c9('0x28')](function(){var _0x3053ae=_0x4297c0[_0xb7c9('0x2a')]({'plain':!![]});var _0x25a279=_0xb7c9('0x2b');return db[_0xb7c9('0x2c')][_0xb7c9('0x29')]({'where':{'type':_0x25a279,'resourceId':_0x3053ae['id']}})['then'](function(){return _0x4297c0;});})[_0xb7c9('0x28')](function(){_0x111032[_0xb7c9('0x1f')](0xcc)[_0xb7c9('0x20')]();});}};}function handleEntityNotFound(_0x26f3f2,_0x5539e9){return function(_0x57df14){if(!_0x57df14){_0x26f3f2[_0xb7c9('0x1e')](0x194);}return _0x57df14;};}function handleError(_0x4af55b,_0x380b79){_0x380b79=_0x380b79||0x1f4;return function(_0x3e2a8b){logger['error'](_0x3e2a8b['stack']);if(_0x3e2a8b[_0xb7c9('0x2d')]){delete _0x3e2a8b[_0xb7c9('0x2d')];}_0x4af55b['status'](_0x380b79)['send'](_0x3e2a8b);};}exports[_0xb7c9('0x2e')]=function(_0x1d5b7d,_0x4250bf){var _0x1fbecf={},_0x3c87e3={},_0x2c8dda={'count':0x0,'rows':[]};var _0x3e77a9=_[_0xb7c9('0x2f')](db[_0xb7c9('0x30')]['rawAttributes'],function(_0x24ea59){return{'name':_0x24ea59[_0xb7c9('0x31')],'type':_0x24ea59['type'][_0xb7c9('0x32')]};});_0x3c87e3[_0xb7c9('0x33')]=_[_0xb7c9('0x2f')](_0x3e77a9,_0xb7c9('0x2d'));_0x3c87e3[_0xb7c9('0x34')]=_[_0xb7c9('0x35')](_0x1d5b7d[_0xb7c9('0x34')]);_0x3c87e3[_0xb7c9('0x36')]=_['intersection'](_0x3c87e3['model'],_0x3c87e3[_0xb7c9('0x34')]);_0x1fbecf[_0xb7c9('0x37')]=_[_0xb7c9('0x38')](_0x3c87e3[_0xb7c9('0x33')],qs[_0xb7c9('0x39')](_0x1d5b7d[_0xb7c9('0x34')][_0xb7c9('0x39')]));_0x1fbecf[_0xb7c9('0x37')]=_0x1fbecf[_0xb7c9('0x37')][_0xb7c9('0x3a')]?_0x1fbecf[_0xb7c9('0x37')]:_0x3c87e3[_0xb7c9('0x33')];if(!_0x1d5b7d['query'][_0xb7c9('0x3b')](_0xb7c9('0x3c'))){_0x1fbecf[_0xb7c9('0x23')]=qs[_0xb7c9('0x23')](_0x1d5b7d['query']['limit']);_0x1fbecf[_0xb7c9('0x24')]=qs['offset'](_0x1d5b7d[_0xb7c9('0x34')]['offset']);}_0x1fbecf[_0xb7c9('0x3d')]=qs['sort'](_0x1d5b7d[_0xb7c9('0x34')]['sort']);_0x1fbecf[_0xb7c9('0x3e')]=qs[_0xb7c9('0x36')](_['pick'](_0x1d5b7d[_0xb7c9('0x34')],_0x3c87e3[_0xb7c9('0x36')]),_0x3e77a9);if(_0x1d5b7d['query'][_0xb7c9('0x3f')]){_0x1fbecf[_0xb7c9('0x3e')]=_['merge'](_0x1fbecf[_0xb7c9('0x3e')],{'$or':_[_0xb7c9('0x2f')](_0x3e77a9,function(_0x4cb967){if(_0x4cb967[_0xb7c9('0x40')]!=='VIRTUAL'){var _0x380873={};_0x380873[_0x4cb967[_0xb7c9('0x2d')]]={'$like':'%'+_0x1d5b7d[_0xb7c9('0x34')][_0xb7c9('0x3f')]+'%'};return _0x380873;}})});}_0x1fbecf=_['merge']({},_0x1fbecf,_0x1d5b7d[_0xb7c9('0x41')]);var _0xd802dc={'where':_0x1fbecf['where']};return db['FaxQueue']['count'](_0xd802dc)[_0xb7c9('0x28')](function(_0x53c61a){_0x2c8dda['count']=_0x53c61a;if(_0x1d5b7d[_0xb7c9('0x34')][_0xb7c9('0x42')]){_0x1fbecf['include']=[{'all':!![]}];}return db[_0xb7c9('0x30')][_0xb7c9('0x43')](_0x1fbecf);})[_0xb7c9('0x28')](function(_0x272b38){_0x2c8dda[_0xb7c9('0x44')]=_0x272b38;return _0x2c8dda;})[_0xb7c9('0x28')](respondWithFilteredResult(_0x4250bf,_0x1fbecf))[_0xb7c9('0x45')](handleError(_0x4250bf,null));};exports['show']=function(_0x312a4e,_0x44d158){var _0x38b137={'raw':!![],'where':{'id':_0x312a4e[_0xb7c9('0x46')]['id']}},_0x77de33={};_0x77de33[_0xb7c9('0x33')]=_['keys'](db['FaxQueue'][_0xb7c9('0x47')]);_0x77de33[_0xb7c9('0x34')]=_['keys'](_0x312a4e[_0xb7c9('0x34')]);_0x77de33[_0xb7c9('0x36')]=_[_0xb7c9('0x38')](_0x77de33[_0xb7c9('0x33')],_0x77de33['query']);_0x38b137[_0xb7c9('0x37')]=_[_0xb7c9('0x38')](_0x77de33[_0xb7c9('0x33')],qs['fields'](_0x312a4e[_0xb7c9('0x34')]['fields']));_0x38b137[_0xb7c9('0x37')]=_0x38b137[_0xb7c9('0x37')][_0xb7c9('0x3a')]?_0x38b137[_0xb7c9('0x37')]:_0x77de33[_0xb7c9('0x33')];if(_0x312a4e[_0xb7c9('0x34')][_0xb7c9('0x42')]){_0x38b137[_0xb7c9('0x48')]=[{'all':!![]}];}_0x38b137=_[_0xb7c9('0x49')]({},_0x38b137,_0x312a4e[_0xb7c9('0x41')]);return db[_0xb7c9('0x30')][_0xb7c9('0x4a')](_0x38b137)[_0xb7c9('0x28')](handleEntityNotFound(_0x44d158,null))[_0xb7c9('0x28')](respondWithResult(_0x44d158,null))['catch'](handleError(_0x44d158,null));};exports[_0xb7c9('0x4b')]=function(_0x2b6c4d,_0x10f9f6){return db[_0xb7c9('0x30')][_0xb7c9('0x4b')](_0x2b6c4d[_0xb7c9('0x4c')],{})[_0xb7c9('0x28')](function(_0x20ad74){var _0x2cdf7a=_0x2b6c4d[_0xb7c9('0x4d')][_0xb7c9('0x2a')]({'plain':!![]});if(!_0x2cdf7a)throw new Error(_0xb7c9('0x4e'));if(_0x2cdf7a[_0xb7c9('0x4f')]===_0xb7c9('0x4d')){var _0x3c8370=_0x20ad74[_0xb7c9('0x2a')]({'plain':!![]});var _0xf90977='FaxQueues';return db[_0xb7c9('0x50')][_0xb7c9('0x4a')]({'where':{'name':_0xf90977,'userProfileId':_0x2cdf7a['userProfileId']},'raw':!![]})['then'](function(_0x48434c){if(_0x48434c&&_0x48434c[_0xb7c9('0x51')]===0x0){return db[_0xb7c9('0x2c')][_0xb7c9('0x4b')]({'name':_0x3c8370[_0xb7c9('0x2d')],'resourceId':_0x3c8370['id'],'type':_0x48434c[_0xb7c9('0x2d')],'sectionId':_0x48434c['id']},{})[_0xb7c9('0x28')](function(){return _0x20ad74;});}else{return _0x20ad74;}})[_0xb7c9('0x45')](function(_0x53203c){logger[_0xb7c9('0x52')](_0xb7c9('0x53'),_0x53203c);throw _0x53203c;});}return _0x20ad74;})[_0xb7c9('0x28')](respondWithResult(_0x10f9f6,0xc9))[_0xb7c9('0x45')](handleError(_0x10f9f6,null));};exports[_0xb7c9('0x27')]=function(_0x3c6bed,_0xe45b7f){if(_0x3c6bed[_0xb7c9('0x4c')]['id']){delete _0x3c6bed['body']['id'];}return db[_0xb7c9('0x30')][_0xb7c9('0x4a')]({'where':{'id':_0x3c6bed[_0xb7c9('0x46')]['id']}})[_0xb7c9('0x28')](handleEntityNotFound(_0xe45b7f,null))[_0xb7c9('0x28')](saveUpdates(_0x3c6bed[_0xb7c9('0x4c')],null))[_0xb7c9('0x28')](respondWithResult(_0xe45b7f,null))[_0xb7c9('0x45')](handleError(_0xe45b7f,null));};exports[_0xb7c9('0x29')]=function(_0x91f25a,_0x44a0f6){return db['FaxQueue'][_0xb7c9('0x4a')]({'where':{'id':_0x91f25a[_0xb7c9('0x46')]['id']}})['then'](handleEntityNotFound(_0x44a0f6,null))[_0xb7c9('0x28')](removeEntity(_0x44a0f6,null))[_0xb7c9('0x45')](handleError(_0x44a0f6,null));};exports[_0xb7c9('0x54')]=function(_0x17d01c,_0x481abb){return db[_0xb7c9('0x30')][_0xb7c9('0x54')]()[_0xb7c9('0x28')](respondWithResult(_0x481abb,null))['catch'](handleError(_0x481abb,null));};exports['getMembers']=function(_0x59d690,_0x43fdd6,_0x182c24){var _0xe66fce={'raw':!![],'where':{}},_0xb8dd3a={},_0x34b7b4;return db[_0xb7c9('0x30')][_0xb7c9('0x55')]({'where':{'id':_0x59d690[_0xb7c9('0x46')]['id']}})['then'](handleEntityNotFound(_0x43fdd6,null))[_0xb7c9('0x28')](function(_0x302fd3){if(_0x302fd3){_0x34b7b4=_0x302fd3[_0xb7c9('0x2a')]({'plain':!![]});_0xb8dd3a[_0xb7c9('0x33')]=_[_0xb7c9('0x35')](db[_0xb7c9('0x56')][_0xb7c9('0x47')]);_0xb8dd3a[_0xb7c9('0x34')]=_['keys'](_0x59d690[_0xb7c9('0x34')]);_0xb8dd3a['filters']=_[_0xb7c9('0x38')](_0xb8dd3a[_0xb7c9('0x33')],_0xb8dd3a[_0xb7c9('0x34')]);_0xe66fce[_0xb7c9('0x37')]=_['intersection'](_0xb8dd3a[_0xb7c9('0x33')],qs['fields'](_0x59d690[_0xb7c9('0x34')][_0xb7c9('0x39')]));_0xe66fce[_0xb7c9('0x37')]=_0xe66fce[_0xb7c9('0x37')][_0xb7c9('0x3a')]?_0xe66fce[_0xb7c9('0x37')]:_0xb8dd3a[_0xb7c9('0x33')];if(!_0x59d690[_0xb7c9('0x34')][_0xb7c9('0x3b')](_0xb7c9('0x3c'))){_0xe66fce[_0xb7c9('0x23')]=qs[_0xb7c9('0x23')](_0x59d690[_0xb7c9('0x34')][_0xb7c9('0x23')]);_0xe66fce[_0xb7c9('0x24')]=qs[_0xb7c9('0x24')](_0x59d690[_0xb7c9('0x34')][_0xb7c9('0x24')]);}_0xe66fce[_0xb7c9('0x3d')]=qs[_0xb7c9('0x57')](_0x59d690[_0xb7c9('0x34')][_0xb7c9('0x57')]);_0xe66fce[_0xb7c9('0x3e')]=qs[_0xb7c9('0x36')](_[_0xb7c9('0x58')](_0x59d690[_0xb7c9('0x34')],_0xb8dd3a[_0xb7c9('0x36')]));_0xe66fce[_0xb7c9('0x3e')][_0xb7c9('0x59')]=_0x302fd3['id'];if(_0x59d690[_0xb7c9('0x34')][_0xb7c9('0x3f')]){_0xe66fce[_0xb7c9('0x3e')]=_[_0xb7c9('0x49')](_0xe66fce[_0xb7c9('0x3e')],{'$or':_[_0xb7c9('0x2f')](_0xe66fce[_0xb7c9('0x37')],function(_0x171df1){var _0x2c8608={};_0x2c8608[_0x171df1]={'$like':'%'+_0x59d690[_0xb7c9('0x34')][_0xb7c9('0x3f')]+'%'};return _0x2c8608;})});}_0xe66fce=_[_0xb7c9('0x49')]({},_0xe66fce,_0x59d690[_0xb7c9('0x41')]);return db[_0xb7c9('0x56')][_0xb7c9('0x43')](_0xe66fce);}})[_0xb7c9('0x28')](function(_0x578ba2){if(_0x578ba2){return db[_0xb7c9('0x5a')][_0xb7c9('0x5b')]({'where':{'id':_[_0xb7c9('0x2f')](_0x578ba2,_0xb7c9('0x5c')),'role':_0xb7c9('0x5d')},'attributes':['id',_0xb7c9('0x2d'),_0xb7c9('0x5e'),_0xb7c9('0x5f'),'createdAt']});}})['then'](function(_0x592899){if(_0x592899){return{'count':_0x592899['count'],'rows':_[_0xb7c9('0x2f')](_0x592899[_0xb7c9('0x44')],function(_0x4dfc1d){return{'membername':_0x4dfc1d['name'],'UserId':_0x4dfc1d['id'],'queue_name':_0x34b7b4[_0xb7c9('0x2d')],'FaxQueueId':_0x34b7b4['id'],'interface':util[_0xb7c9('0x60')]('%s/%s',_0xb7c9('0x61'),_0x4dfc1d[_0xb7c9('0x2d')]),'penalty':0x0,'paused':_0x4dfc1d[_0xb7c9('0x5e')],'createdAt':_0x4dfc1d[_0xb7c9('0x62')],'updatedAt':_0x4dfc1d[_0xb7c9('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb7c9('0x28')](respondWithFilteredResult(_0x43fdd6,_0xe66fce))[_0xb7c9('0x45')](handleError(_0x43fdd6,null));};exports[_0xb7c9('0x63')]=function(_0x3a8e9d,_0x46f09a,_0x4db899){var _0x2e52ef={};var _0x45f5b8={};var _0x18cde7;var _0x2d38d7;return db['FaxQueue'][_0xb7c9('0x55')]({'where':{'id':_0x3a8e9d[_0xb7c9('0x46')]['id']}})[_0xb7c9('0x28')](handleEntityNotFound(_0x46f09a,null))[_0xb7c9('0x28')](function(_0xeb1dbd){if(_0xeb1dbd){_0x18cde7=_0xeb1dbd;_0x45f5b8[_0xb7c9('0x33')]=_[_0xb7c9('0x35')](db[_0xb7c9('0x64')]['rawAttributes']);_0x45f5b8[_0xb7c9('0x34')]=_[_0xb7c9('0x35')](_0x3a8e9d[_0xb7c9('0x34')]);_0x45f5b8[_0xb7c9('0x36')]=_[_0xb7c9('0x38')](_0x45f5b8[_0xb7c9('0x33')],_0x45f5b8[_0xb7c9('0x34')]);_0x2e52ef[_0xb7c9('0x37')]=_['intersection'](_0x45f5b8[_0xb7c9('0x33')],qs['fields'](_0x3a8e9d[_0xb7c9('0x34')][_0xb7c9('0x39')]));_0x2e52ef['attributes']=_0x2e52ef['attributes'][_0xb7c9('0x3a')]?_0x2e52ef[_0xb7c9('0x37')]:_0x45f5b8[_0xb7c9('0x33')];_0x2e52ef[_0xb7c9('0x3d')]=qs[_0xb7c9('0x57')](_0x3a8e9d[_0xb7c9('0x34')][_0xb7c9('0x57')]);_0x2e52ef[_0xb7c9('0x3e')]=qs[_0xb7c9('0x36')](_[_0xb7c9('0x58')](_0x3a8e9d[_0xb7c9('0x34')],_0x45f5b8[_0xb7c9('0x36')]));if(_0x3a8e9d[_0xb7c9('0x34')][_0xb7c9('0x3f')]){_0x2e52ef['where']=_['merge'](_0x2e52ef[_0xb7c9('0x3e')],{'$or':_[_0xb7c9('0x2f')](_0x2e52ef['attributes'],function(_0x19a8d5){var _0x18b279={};_0x18b279[_0x19a8d5]={'$like':'%'+_0x3a8e9d['query']['filter']+'%'};return _0x18b279;})});}_0x2e52ef=_[_0xb7c9('0x49')]({},_0x2e52ef,_0x3a8e9d[_0xb7c9('0x41')]);return _0x18cde7['getTeams'](_0x2e52ef);}})[_0xb7c9('0x28')](function(_0x5cd5b9){if(_0x5cd5b9){_0x2d38d7=_0x5cd5b9['length'];if(!_0x3a8e9d[_0xb7c9('0x34')][_0xb7c9('0x3b')](_0xb7c9('0x3c'))){_0x2e52ef[_0xb7c9('0x23')]=qs[_0xb7c9('0x23')](_0x3a8e9d[_0xb7c9('0x34')][_0xb7c9('0x23')]);_0x2e52ef[_0xb7c9('0x24')]=qs[_0xb7c9('0x24')](_0x3a8e9d[_0xb7c9('0x34')][_0xb7c9('0x24')]);}return _0x18cde7[_0xb7c9('0x63')](_0x2e52ef);}})['then'](function(_0x11a482){if(_0x11a482){return _0x11a482?{'count':_0x2d38d7,'rows':_0x11a482}:null;}})['then'](respondWithResult(_0x46f09a,null))[_0xb7c9('0x45')](handleError(_0x46f09a,null));};exports['addTeams']=function(_0x383613,_0x3f676b,_0x16710f){var _0x1c1de8=_0x383613[_0xb7c9('0x4c')][_0xb7c9('0x65')];return db[_0xb7c9('0x64')][_0xb7c9('0x43')]({'where':{'id':_0x1c1de8},'attributes':['id'],'include':[{'model':db[_0xb7c9('0x5a')],'as':_0xb7c9('0x66'),'attributes':['id','name','online',_0xb7c9('0x67'),_0xb7c9('0x68')],'raw':!![]}]})[_0xb7c9('0x28')](function(_0x169c7f){if(_0x169c7f){var _0x2921b5=_['flatMap'](_0x169c7f,function(_0x48c74f){var _0x1f0994=_0x48c74f['get']({'plain':!![]});return _0x1f0994[_0xb7c9('0x66')];});return db['FaxQueue'][_0xb7c9('0x4a')]({'where':{'id':_0x383613[_0xb7c9('0x46')]['id']}})[_0xb7c9('0x28')](function(_0x344664){return db[_0xb7c9('0x69')][_0xb7c9('0x6a')](function(_0x2dba77){return _0x344664[_0xb7c9('0x6b')](_0x1c1de8,{'transaction':_0x2dba77})[_0xb7c9('0x28')](function(){return BPromise['each'](_0x2921b5,function(_0x46de56){return db['UserFaxQueue'][_0xb7c9('0x6c')]({'where':{'UserId':_0x46de56['id'],'FaxQueueId':_0x383613[_0xb7c9('0x46')]['id']},'transaction':_0x2dba77});});})[_0xb7c9('0x28')](function(){_0x2921b5[_0xb7c9('0x6d')](function(_0x24f617){socket[_0xb7c9('0x6e')]('userFaxQueue:save',{'UserId':_0x24f617['id'],'FaxQueueId':_0x344664['id']});});});});});}})[_0xb7c9('0x28')](respondWithStatusCode(_0x3f676b,null))[_0xb7c9('0x45')](handleError(_0x3f676b,null));};exports['removeTeams']=function(_0xf4f47e,_0x3e8b26,_0x326bca){return db['Team'][_0xb7c9('0x43')]({'where':{'id':_0xf4f47e[_0xb7c9('0x34')][_0xb7c9('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb7c9('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3e8b26,null))[_0xb7c9('0x28')](function(_0x40e6ec){var _0x46c8f2=_['map'](_0x40e6ec,'id');var _0x88215a=[];var _0x3ecdd5=[];var _0x681f4=squel[_0xb7c9('0x6f')]();_0x681f4[_0xb7c9('0x70')](_0xb7c9('0x71'))[_0xb7c9('0x72')](_0xb7c9('0x73'),'tq')['join'](_0xb7c9('0x74'),'ut',_0xb7c9('0x75'))[_0xb7c9('0x3e')]('FaxQueueId\x20=\x20?',_0xf4f47e['params']['id']);for(var _0x256d39=0x0;_0x256d39<_0x40e6ec[_0xb7c9('0x3a')];_0x256d39+=0x1){let _0x2440a0=_0x40e6ec[_0x256d39];for(var _0x254367=0x0;_0x254367<_0x2440a0[_0xb7c9('0x66')][_0xb7c9('0x3a')];_0x254367+=0x1){let _0xe2b0c=_0x2440a0['Agents'][_0x254367];var _0x470413=_0x681f4[_0xb7c9('0x76')]();_0x470413[_0xb7c9('0x3e')](_0xb7c9('0x77'),_0xe2b0c['id']);_0x3ecdd5[_0xb7c9('0x78')](db[_0xb7c9('0x69')][_0xb7c9('0x34')](_0x470413[_0xb7c9('0x79')](),{'type':db[_0xb7c9('0x69')][_0xb7c9('0x7a')][_0xb7c9('0x7b')]})[_0xb7c9('0x28')](function(_0x9874c8){if(_0x9874c8[_0xb7c9('0x3a')]===0x1){return _0xe2b0c['id'];}else{var _0x295aab=_[_0xb7c9('0x7c')](_[_0xb7c9('0x2f')](_0x9874c8,_0xb7c9('0x7d')),function(_0x527590){return _[_0xb7c9('0x7e')](_0x46c8f2,_0x527590);});if(_0x295aab){return _0xe2b0c['id'];}}}));}}return BPromise[_0xb7c9('0x7f')](_0x3ecdd5)[_0xb7c9('0x28')](function(_0x30231f){_0x88215a=_(_0x88215a)[_0xb7c9('0x80')](_0x30231f)[_0xb7c9('0x81')]()[_0xb7c9('0x82')]();return db[_0xb7c9('0x30')]['find']({'where':{'id':_0xf4f47e['params']['id']}})['then'](function(_0x24e0b4){return db[_0xb7c9('0x69')]['transaction'](function(_0x497895){return _0x24e0b4['removeTeams'](_0xf4f47e[_0xb7c9('0x34')][_0xb7c9('0x65')],{'transaction':_0x497895})[_0xb7c9('0x28')](function(){if(!_[_0xb7c9('0x83')](_0x88215a)){return _0x24e0b4['removeAgents'](_0x88215a,{'transaction':_0x497895});}})[_0xb7c9('0x28')](function(){_0x88215a['forEach'](function(_0x2514ca){socket[_0xb7c9('0x6e')](_0xb7c9('0x84'),{'UserId':_0x2514ca,'FaxQueueId':_0x24e0b4['id']});});});});});});})['then'](respondWithStatusCode(_0x3e8b26,null))[_0xb7c9('0x45')](handleError(_0x3e8b26,null));};exports[_0xb7c9('0x85')]=function(_0x27e8e4,_0x5daac9,_0x19706e){return db[_0xb7c9('0x30')][_0xb7c9('0x4a')]({'where':{'id':_0x27e8e4[_0xb7c9('0x46')]['id']}})[_0xb7c9('0x28')](handleEntityNotFound(_0x5daac9,null))[_0xb7c9('0x28')](function(_0x8024ca){if(_0x8024ca){return _0x8024ca[_0xb7c9('0x85')](_0x27e8e4[_0xb7c9('0x4c')][_0xb7c9('0x65')],_[_0xb7c9('0x86')](_0x27e8e4[_0xb7c9('0x4c')],[_0xb7c9('0x65'),'id'])||{})[_0xb7c9('0x87')](function(_0x181a81){for(var _0x205a02=0x0;_0x205a02<_0x27e8e4[_0xb7c9('0x4c')][_0xb7c9('0x65')]['length'];_0x205a02+=0x1){socket[_0xb7c9('0x6e')](_0xb7c9('0x88'),{'UserId':Number(_0x27e8e4[_0xb7c9('0x4c')][_0xb7c9('0x65')][_0x205a02]),'FaxQueueId':Number(_0x27e8e4[_0xb7c9('0x46')]['id'])});}return _0x181a81;});}})[_0xb7c9('0x28')](respondWithResult(_0x5daac9,null))[_0xb7c9('0x45')](handleError(_0x5daac9,null));};exports[_0xb7c9('0x89')]=function(_0x16b690,_0x4150a8,_0x504ab6){return db[_0xb7c9('0x30')][_0xb7c9('0x4a')]({'where':{'id':_0x16b690[_0xb7c9('0x46')]['id']}})[_0xb7c9('0x28')](handleEntityNotFound(_0x4150a8,null))['then'](function(_0x137abd){if(_0x137abd){return _0x137abd[_0xb7c9('0x89')](_0x16b690['query'][_0xb7c9('0x65')])['then'](function(){if(_[_0xb7c9('0x8a')](_0x16b690[_0xb7c9('0x34')][_0xb7c9('0x65')])){for(var _0x4b5117=0x0;_0x4b5117<_0x16b690['query'][_0xb7c9('0x65')]['length'];_0x4b5117+=0x1){socket[_0xb7c9('0x6e')](_0xb7c9('0x84'),{'UserId':Number(_0x16b690[_0xb7c9('0x34')][_0xb7c9('0x65')][_0x4b5117]),'FaxQueueId':Number(_0x16b690[_0xb7c9('0x46')]['id'])});}}else{socket['emit'](_0xb7c9('0x84'),{'UserId':Number(_0x16b690['query'][_0xb7c9('0x65')]),'FaxQueueId':Number(_0x16b690[_0xb7c9('0x46')]['id'])});}});}})[_0xb7c9('0x28')](respondWithStatusCode(_0x4150a8,null))[_0xb7c9('0x45')](handleError(_0x4150a8,null));};exports[_0xb7c9('0x8b')]=function(_0x71d0aa,_0x918a50,_0x3f8c7c){var _0x5aee8e={};var _0x222893={};var _0x409492;var _0x20ebed;return db[_0xb7c9('0x30')][_0xb7c9('0x55')]({'where':{'id':_0x71d0aa['params']['id']}})[_0xb7c9('0x28')](handleEntityNotFound(_0x918a50,null))[_0xb7c9('0x28')](function(_0x57f6c6){if(_0x57f6c6){_0x409492=_0x57f6c6;_0x222893[_0xb7c9('0x33')]=_['keys'](db[_0xb7c9('0x5a')][_0xb7c9('0x47')]);_0x222893[_0xb7c9('0x34')]=_[_0xb7c9('0x35')](_0x71d0aa[_0xb7c9('0x34')]);_0x222893['filters']=_[_0xb7c9('0x38')](_0x222893[_0xb7c9('0x33')],_0x222893[_0xb7c9('0x34')]);_0x5aee8e[_0xb7c9('0x37')]=_['intersection'](_0x222893[_0xb7c9('0x33')],qs[_0xb7c9('0x39')](_0x71d0aa[_0xb7c9('0x34')][_0xb7c9('0x39')]));_0x5aee8e['attributes']=_0x5aee8e[_0xb7c9('0x37')][_0xb7c9('0x3a')]?_0x5aee8e[_0xb7c9('0x37')]:_0x222893[_0xb7c9('0x33')];_0x5aee8e[_0xb7c9('0x3d')]=qs[_0xb7c9('0x57')](_0x71d0aa[_0xb7c9('0x34')][_0xb7c9('0x57')]);_0x5aee8e[_0xb7c9('0x3e')]=qs[_0xb7c9('0x36')](_[_0xb7c9('0x58')](_0x71d0aa['query'],_0x222893['filters']));if(_0x71d0aa[_0xb7c9('0x34')][_0xb7c9('0x3f')]){_0x5aee8e[_0xb7c9('0x3e')]=_[_0xb7c9('0x49')](_0x5aee8e[_0xb7c9('0x3e')],{'$or':_['map'](_0x5aee8e[_0xb7c9('0x37')],function(_0x2c3fde){var _0x1729ab={};_0x1729ab[_0x2c3fde]={'$like':'%'+_0x71d0aa[_0xb7c9('0x34')]['filter']+'%'};return _0x1729ab;})});}_0x5aee8e=_[_0xb7c9('0x49')]({},_0x5aee8e,_0x71d0aa[_0xb7c9('0x41')]);return _0x409492[_0xb7c9('0x8b')](_0x5aee8e);}})['then'](function(_0x1e58e8){if(_0x1e58e8){_0x20ebed=_0x1e58e8[_0xb7c9('0x3a')];if(!_0x71d0aa[_0xb7c9('0x34')][_0xb7c9('0x3b')]('nolimit')){_0x5aee8e[_0xb7c9('0x23')]=qs[_0xb7c9('0x23')](_0x71d0aa['query'][_0xb7c9('0x23')]);_0x5aee8e[_0xb7c9('0x24')]=qs[_0xb7c9('0x24')](_0x71d0aa['query'][_0xb7c9('0x24')]);}return _0x409492['getAgents'](_0x5aee8e);}})[_0xb7c9('0x28')](function(_0x3915ee){if(_0x3915ee){return _0x3915ee?{'count':_0x20ebed,'rows':_0x3915ee}:null;}})['then'](respondWithResult(_0x918a50,null))['catch'](handleError(_0x918a50,null));}; \ No newline at end of file +var _0x780f=['redis','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','FaxQueues','destroy','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','filter','where','type','VIRTUAL','merge','options','findAll','rows','catch','show','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','params','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','FaxQueueId','User','findAndCountAll','UserId','faxPause','createdAt','format','%s/%s','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','from','team_has_fax_queues','user_has_teams','FaxQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults'];(function(_0x3c98c1,_0x524e3c){var _0x45c21b=function(_0x1f8dd0){while(--_0x1f8dd0){_0x3c98c1['push'](_0x3c98c1['shift']());}};_0x45c21b(++_0x524e3c);}(_0x780f,0x181));var _0xf780=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0x780f[_0x200827];return _0x120047;};'use strict';var emlformat=require(_0xf780('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf780('0x1'));var jsonpatch=require(_0xf780('0x2'));var rp=require('request-promise');var moment=require(_0xf780('0x3'));var BPromise=require(_0xf780('0x4'));var Mustache=require('mustache');var util=require(_0xf780('0x5'));var path=require('path');var sox=require(_0xf780('0x6'));var csv=require(_0xf780('0x7'));var ejs=require(_0xf780('0x8'));var fs=require('fs');var fs_extra=require(_0xf780('0x9'));var _=require(_0xf780('0xa'));var squel=require('squel');var crypto=require(_0xf780('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf780('0xc'));var toCsv=require(_0xf780('0x7'));var querystring=require(_0xf780('0xd'));var Papa=require(_0xf780('0xe'));var Redis=require('ioredis');var authService=require(_0xf780('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf780('0x10'));var logger=require(_0xf780('0x11'))('api');var utils=require(_0xf780('0x12'));var config=require(_0xf780('0x13'));var licenseUtil=require(_0xf780('0x14'));var db=require(_0xf780('0x15'))['db'];config['redis']=_[_0xf780('0x16')](config[_0xf780('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xf780('0x18'))(new Redis(config[_0xf780('0x17')]));require(_0xf780('0x19'))[_0xf780('0x1a')](socket);function respondWithStatusCode(_0x1483e0,_0x2396ad){_0x2396ad=_0x2396ad||0xcc;return function(_0x4ecd04){if(_0x4ecd04){return _0x1483e0[_0xf780('0x1b')](_0x2396ad);}return _0x1483e0['status'](_0x2396ad)[_0xf780('0x1c')]();};}function respondWithResult(_0x15c33a,_0x5ee9f2){_0x5ee9f2=_0x5ee9f2||0xc8;return function(_0x6c526b){if(_0x6c526b){return _0x15c33a[_0xf780('0x1d')](_0x5ee9f2)['json'](_0x6c526b);}};}function respondWithFilteredResult(_0x4606bf,_0x3cbb84){return function(_0x393aa7){if(_0x393aa7){var _0x465f51=typeof _0x3cbb84[_0xf780('0x1e')]==='undefined'&&typeof _0x3cbb84[_0xf780('0x1f')]===_0xf780('0x20');var _0x30a100=_0x393aa7[_0xf780('0x21')];var _0x45bbf0=_0x465f51?0x0:_0x3cbb84['offset'];var _0x4284dd=_0x465f51?_0x393aa7[_0xf780('0x21')]:_0x3cbb84[_0xf780('0x1e')]+_0x3cbb84[_0xf780('0x1f')];var _0x26343e;if(_0x4284dd>=_0x30a100){_0x4284dd=_0x30a100;_0x26343e=0xc8;}else{_0x26343e=0xce;}_0x4606bf['status'](_0x26343e);return _0x4606bf['set'](_0xf780('0x22'),_0x45bbf0+'-'+_0x4284dd+'/'+_0x30a100)['json'](_0x393aa7);}return null;};}function patchUpdates(_0x2e6aba){return function(_0xf299bf){try{jsonpatch[_0xf780('0x23')](_0xf299bf,_0x2e6aba,!![]);}catch(_0x1c2fef){return BPromise[_0xf780('0x24')](_0x1c2fef);}return _0xf299bf[_0xf780('0x25')]();};}function saveUpdates(_0x3784be,_0x36a9fd){return function(_0x1155e6){if(_0x1155e6){return _0x1155e6[_0xf780('0x26')](_0x3784be)[_0xf780('0x27')](function(_0xf12f9e){return _0xf12f9e;});}return null;};}function removeEntity(_0x560fbb,_0x4db173){return function(_0x51e7cd){if(_0x51e7cd){return _0x51e7cd['destroy']()[_0xf780('0x27')](function(){var _0x490c20=_0x51e7cd['get']({'plain':!![]});var _0x2c87d6=_0xf780('0x28');return db['UserProfileResource'][_0xf780('0x29')]({'where':{'type':_0x2c87d6,'resourceId':_0x490c20['id']}})[_0xf780('0x27')](function(){return _0x51e7cd;});})[_0xf780('0x27')](function(){_0x560fbb[_0xf780('0x1d')](0xcc)[_0xf780('0x1c')]();});}};}function handleEntityNotFound(_0x3ed305,_0x335014){return function(_0x3911d0){if(!_0x3911d0){_0x3ed305[_0xf780('0x1b')](0x194);}return _0x3911d0;};}function handleError(_0x4dcbf5,_0x1b25fb){_0x1b25fb=_0x1b25fb||0x1f4;return function(_0x8157cd){logger[_0xf780('0x2a')](_0x8157cd[_0xf780('0x2b')]);if(_0x8157cd[_0xf780('0x2c')]){delete _0x8157cd['name'];}_0x4dcbf5[_0xf780('0x1d')](_0x1b25fb)[_0xf780('0x2d')](_0x8157cd);};}exports[_0xf780('0x2e')]=function(_0x463bb3,_0x5c97bd){var _0x4216ed={},_0x495e0d={},_0x5c5234={'count':0x0,'rows':[]};var _0x523e99=_[_0xf780('0x2f')](db[_0xf780('0x30')][_0xf780('0x31')],function(_0x4831bd){return{'name':_0x4831bd[_0xf780('0x32')],'type':_0x4831bd['type'][_0xf780('0x33')]};});_0x495e0d[_0xf780('0x34')]=_[_0xf780('0x2f')](_0x523e99,_0xf780('0x2c'));_0x495e0d[_0xf780('0x35')]=_[_0xf780('0x36')](_0x463bb3[_0xf780('0x35')]);_0x495e0d['filters']=_[_0xf780('0x37')](_0x495e0d[_0xf780('0x34')],_0x495e0d[_0xf780('0x35')]);_0x4216ed[_0xf780('0x38')]=_[_0xf780('0x37')](_0x495e0d[_0xf780('0x34')],qs[_0xf780('0x39')](_0x463bb3[_0xf780('0x35')][_0xf780('0x39')]));_0x4216ed[_0xf780('0x38')]=_0x4216ed[_0xf780('0x38')][_0xf780('0x3a')]?_0x4216ed[_0xf780('0x38')]:_0x495e0d['model'];if(!_0x463bb3[_0xf780('0x35')]['hasOwnProperty'](_0xf780('0x3b'))){_0x4216ed[_0xf780('0x1f')]=qs[_0xf780('0x1f')](_0x463bb3[_0xf780('0x35')][_0xf780('0x1f')]);_0x4216ed[_0xf780('0x1e')]=qs[_0xf780('0x1e')](_0x463bb3['query']['offset']);}_0x4216ed[_0xf780('0x3c')]=qs['sort'](_0x463bb3[_0xf780('0x35')][_0xf780('0x3d')]);_0x4216ed['where']=qs['filters'](_[_0xf780('0x3e')](_0x463bb3[_0xf780('0x35')],_0x495e0d[_0xf780('0x3f')]),_0x523e99);if(_0x463bb3[_0xf780('0x35')][_0xf780('0x40')]){_0x4216ed['where']=_['merge'](_0x4216ed[_0xf780('0x41')],{'$or':_[_0xf780('0x2f')](_0x523e99,function(_0x699492){if(_0x699492[_0xf780('0x42')]!==_0xf780('0x43')){var _0x14610b={};_0x14610b[_0x699492[_0xf780('0x2c')]]={'$like':'%'+_0x463bb3[_0xf780('0x35')][_0xf780('0x40')]+'%'};return _0x14610b;}})});}_0x4216ed=_[_0xf780('0x44')]({},_0x4216ed,_0x463bb3[_0xf780('0x45')]);var _0x3e86f7={'where':_0x4216ed[_0xf780('0x41')]};return db[_0xf780('0x30')][_0xf780('0x21')](_0x3e86f7)[_0xf780('0x27')](function(_0x551763){_0x5c5234[_0xf780('0x21')]=_0x551763;if(_0x463bb3[_0xf780('0x35')]['includeAll']){_0x4216ed['include']=[{'all':!![]}];}return db[_0xf780('0x30')][_0xf780('0x46')](_0x4216ed);})['then'](function(_0x1331ee){_0x5c5234[_0xf780('0x47')]=_0x1331ee;return _0x5c5234;})[_0xf780('0x27')](respondWithFilteredResult(_0x5c97bd,_0x4216ed))[_0xf780('0x48')](handleError(_0x5c97bd,null));};exports[_0xf780('0x49')]=function(_0x48cae5,_0x289b1a){var _0x10222d={'raw':!![],'where':{'id':_0x48cae5['params']['id']}},_0x3f8ad2={};_0x3f8ad2[_0xf780('0x34')]=_[_0xf780('0x36')](db[_0xf780('0x30')][_0xf780('0x31')]);_0x3f8ad2[_0xf780('0x35')]=_[_0xf780('0x36')](_0x48cae5[_0xf780('0x35')]);_0x3f8ad2[_0xf780('0x3f')]=_[_0xf780('0x37')](_0x3f8ad2[_0xf780('0x34')],_0x3f8ad2[_0xf780('0x35')]);_0x10222d[_0xf780('0x38')]=_['intersection'](_0x3f8ad2[_0xf780('0x34')],qs[_0xf780('0x39')](_0x48cae5[_0xf780('0x35')][_0xf780('0x39')]));_0x10222d[_0xf780('0x38')]=_0x10222d['attributes'][_0xf780('0x3a')]?_0x10222d['attributes']:_0x3f8ad2['model'];if(_0x48cae5[_0xf780('0x35')]['includeAll']){_0x10222d[_0xf780('0x4a')]=[{'all':!![]}];}_0x10222d=_[_0xf780('0x44')]({},_0x10222d,_0x48cae5[_0xf780('0x45')]);return db[_0xf780('0x30')][_0xf780('0x4b')](_0x10222d)[_0xf780('0x27')](handleEntityNotFound(_0x289b1a,null))['then'](respondWithResult(_0x289b1a,null))[_0xf780('0x48')](handleError(_0x289b1a,null));};exports[_0xf780('0x4c')]=function(_0x378bf3,_0x25ca47){return db[_0xf780('0x30')][_0xf780('0x4c')](_0x378bf3[_0xf780('0x4d')],{})[_0xf780('0x27')](function(_0x33f641){var _0x234914=_0x378bf3[_0xf780('0x4e')][_0xf780('0x4f')]({'plain':!![]});if(!_0x234914)throw new Error(_0xf780('0x50'));if(_0x234914['role']===_0xf780('0x4e')){var _0x313f45=_0x33f641[_0xf780('0x4f')]({'plain':!![]});var _0x482519='FaxQueues';return db['UserProfileSection']['find']({'where':{'name':_0x482519,'userProfileId':_0x234914[_0xf780('0x51')]},'raw':!![]})['then'](function(_0x45620f){if(_0x45620f&&_0x45620f[_0xf780('0x52')]===0x0){return db['UserProfileResource'][_0xf780('0x4c')]({'name':_0x313f45[_0xf780('0x2c')],'resourceId':_0x313f45['id'],'type':_0x45620f[_0xf780('0x2c')],'sectionId':_0x45620f['id']},{})[_0xf780('0x27')](function(){return _0x33f641;});}else{return _0x33f641;}})['catch'](function(_0x130eed){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x130eed);throw _0x130eed;});}return _0x33f641;})[_0xf780('0x27')](respondWithResult(_0x25ca47,0xc9))['catch'](handleError(_0x25ca47,null));};exports[_0xf780('0x26')]=function(_0x4b26fa,_0x525a93){if(_0x4b26fa[_0xf780('0x4d')]['id']){delete _0x4b26fa['body']['id'];}return db[_0xf780('0x30')]['find']({'where':{'id':_0x4b26fa[_0xf780('0x53')]['id']}})['then'](handleEntityNotFound(_0x525a93,null))[_0xf780('0x27')](saveUpdates(_0x4b26fa[_0xf780('0x4d')],null))[_0xf780('0x27')](respondWithResult(_0x525a93,null))[_0xf780('0x48')](handleError(_0x525a93,null));};exports[_0xf780('0x29')]=function(_0xa1b276,_0x5d9679){return db['FaxQueue'][_0xf780('0x4b')]({'where':{'id':_0xa1b276[_0xf780('0x53')]['id']}})[_0xf780('0x27')](handleEntityNotFound(_0x5d9679,null))['then'](removeEntity(_0x5d9679,null))['catch'](handleError(_0x5d9679,null));};exports[_0xf780('0x54')]=function(_0x273582,_0x5aff7a){return db[_0xf780('0x30')][_0xf780('0x54')]()['then'](respondWithResult(_0x5aff7a,null))['catch'](handleError(_0x5aff7a,null));};exports[_0xf780('0x55')]=function(_0x26855e,_0x186018,_0x335a2c){var _0x2aaeed={'raw':!![],'where':{}},_0x580ae2={},_0x918128;return db['FaxQueue'][_0xf780('0x56')]({'where':{'id':_0x26855e[_0xf780('0x53')]['id']}})[_0xf780('0x27')](handleEntityNotFound(_0x186018,null))[_0xf780('0x27')](function(_0x19db42){if(_0x19db42){_0x918128=_0x19db42['get']({'plain':!![]});_0x580ae2[_0xf780('0x34')]=_[_0xf780('0x36')](db[_0xf780('0x57')][_0xf780('0x31')]);_0x580ae2[_0xf780('0x35')]=_[_0xf780('0x36')](_0x26855e[_0xf780('0x35')]);_0x580ae2[_0xf780('0x3f')]=_[_0xf780('0x37')](_0x580ae2[_0xf780('0x34')],_0x580ae2[_0xf780('0x35')]);_0x2aaeed[_0xf780('0x38')]=_[_0xf780('0x37')](_0x580ae2['model'],qs[_0xf780('0x39')](_0x26855e['query']['fields']));_0x2aaeed[_0xf780('0x38')]=_0x2aaeed['attributes'][_0xf780('0x3a')]?_0x2aaeed[_0xf780('0x38')]:_0x580ae2[_0xf780('0x34')];if(!_0x26855e[_0xf780('0x35')][_0xf780('0x58')](_0xf780('0x3b'))){_0x2aaeed[_0xf780('0x1f')]=qs[_0xf780('0x1f')](_0x26855e[_0xf780('0x35')][_0xf780('0x1f')]);_0x2aaeed[_0xf780('0x1e')]=qs[_0xf780('0x1e')](_0x26855e[_0xf780('0x35')][_0xf780('0x1e')]);}_0x2aaeed['order']=qs['sort'](_0x26855e[_0xf780('0x35')][_0xf780('0x3d')]);_0x2aaeed[_0xf780('0x41')]=qs[_0xf780('0x3f')](_[_0xf780('0x3e')](_0x26855e[_0xf780('0x35')],_0x580ae2[_0xf780('0x3f')]));_0x2aaeed['where'][_0xf780('0x59')]=_0x19db42['id'];if(_0x26855e[_0xf780('0x35')][_0xf780('0x40')]){_0x2aaeed[_0xf780('0x41')]=_[_0xf780('0x44')](_0x2aaeed[_0xf780('0x41')],{'$or':_[_0xf780('0x2f')](_0x2aaeed[_0xf780('0x38')],function(_0x2317c7){var _0x48ede7={};_0x48ede7[_0x2317c7]={'$like':'%'+_0x26855e[_0xf780('0x35')][_0xf780('0x40')]+'%'};return _0x48ede7;})});}_0x2aaeed=_[_0xf780('0x44')]({},_0x2aaeed,_0x26855e[_0xf780('0x45')]);return db[_0xf780('0x57')]['findAll'](_0x2aaeed);}})[_0xf780('0x27')](function(_0x58c444){if(_0x58c444){return db[_0xf780('0x5a')][_0xf780('0x5b')]({'where':{'id':_[_0xf780('0x2f')](_0x58c444,_0xf780('0x5c')),'role':'agent'},'attributes':['id',_0xf780('0x2c'),_0xf780('0x5d'),'updatedAt',_0xf780('0x5e')]});}})['then'](function(_0x4ca47f){if(_0x4ca47f){return{'count':_0x4ca47f[_0xf780('0x21')],'rows':_[_0xf780('0x2f')](_0x4ca47f[_0xf780('0x47')],function(_0x50b26f){return{'membername':_0x50b26f['name'],'UserId':_0x50b26f['id'],'queue_name':_0x918128['name'],'FaxQueueId':_0x918128['id'],'interface':util[_0xf780('0x5f')](_0xf780('0x60'),'SIP',_0x50b26f[_0xf780('0x2c')]),'penalty':0x0,'paused':_0x50b26f[_0xf780('0x5d')],'createdAt':_0x50b26f[_0xf780('0x5e')],'updatedAt':_0x50b26f[_0xf780('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf780('0x27')](respondWithFilteredResult(_0x186018,_0x2aaeed))['catch'](handleError(_0x186018,null));};exports[_0xf780('0x62')]=function(_0x24f62a,_0x5d2dd3,_0x5ca1e0){var _0x2bce03={};var _0x3cadcc={};var _0x832879;var _0x4467b6;return db[_0xf780('0x30')][_0xf780('0x56')]({'where':{'id':_0x24f62a[_0xf780('0x53')]['id']}})[_0xf780('0x27')](handleEntityNotFound(_0x5d2dd3,null))[_0xf780('0x27')](function(_0x267178){if(_0x267178){_0x832879=_0x267178;_0x3cadcc[_0xf780('0x34')]=_[_0xf780('0x36')](db[_0xf780('0x63')][_0xf780('0x31')]);_0x3cadcc[_0xf780('0x35')]=_[_0xf780('0x36')](_0x24f62a[_0xf780('0x35')]);_0x3cadcc[_0xf780('0x3f')]=_[_0xf780('0x37')](_0x3cadcc['model'],_0x3cadcc[_0xf780('0x35')]);_0x2bce03[_0xf780('0x38')]=_[_0xf780('0x37')](_0x3cadcc[_0xf780('0x34')],qs[_0xf780('0x39')](_0x24f62a[_0xf780('0x35')]['fields']));_0x2bce03['attributes']=_0x2bce03[_0xf780('0x38')][_0xf780('0x3a')]?_0x2bce03[_0xf780('0x38')]:_0x3cadcc['model'];_0x2bce03[_0xf780('0x3c')]=qs[_0xf780('0x3d')](_0x24f62a[_0xf780('0x35')][_0xf780('0x3d')]);_0x2bce03[_0xf780('0x41')]=qs[_0xf780('0x3f')](_[_0xf780('0x3e')](_0x24f62a[_0xf780('0x35')],_0x3cadcc['filters']));if(_0x24f62a['query'][_0xf780('0x40')]){_0x2bce03[_0xf780('0x41')]=_[_0xf780('0x44')](_0x2bce03[_0xf780('0x41')],{'$or':_[_0xf780('0x2f')](_0x2bce03[_0xf780('0x38')],function(_0x47ce7b){var _0x45e118={};_0x45e118[_0x47ce7b]={'$like':'%'+_0x24f62a[_0xf780('0x35')][_0xf780('0x40')]+'%'};return _0x45e118;})});}_0x2bce03=_[_0xf780('0x44')]({},_0x2bce03,_0x24f62a[_0xf780('0x45')]);return _0x832879[_0xf780('0x62')](_0x2bce03);}})[_0xf780('0x27')](function(_0x470163){if(_0x470163){_0x4467b6=_0x470163['length'];if(!_0x24f62a[_0xf780('0x35')][_0xf780('0x58')]('nolimit')){_0x2bce03[_0xf780('0x1f')]=qs[_0xf780('0x1f')](_0x24f62a[_0xf780('0x35')][_0xf780('0x1f')]);_0x2bce03[_0xf780('0x1e')]=qs['offset'](_0x24f62a['query'][_0xf780('0x1e')]);}return _0x832879[_0xf780('0x62')](_0x2bce03);}})[_0xf780('0x27')](function(_0x5c5fe9){if(_0x5c5fe9){return _0x5c5fe9?{'count':_0x4467b6,'rows':_0x5c5fe9}:null;}})[_0xf780('0x27')](respondWithResult(_0x5d2dd3,null))[_0xf780('0x48')](handleError(_0x5d2dd3,null));};exports[_0xf780('0x64')]=function(_0x3f098f,_0x5c0f6d,_0xb3110a){var _0x59e24a=_0x3f098f[_0xf780('0x4d')][_0xf780('0x65')];return db[_0xf780('0x63')][_0xf780('0x46')]({'where':{'id':_0x59e24a},'attributes':['id'],'include':[{'model':db[_0xf780('0x5a')],'as':_0xf780('0x66'),'attributes':['id',_0xf780('0x2c'),_0xf780('0x67'),_0xf780('0x68'),'interface'],'raw':!![]}]})[_0xf780('0x27')](function(_0x5b2e59){if(_0x5b2e59){var _0x49cb85=_[_0xf780('0x69')](_0x5b2e59,function(_0x332f86){var _0x1dbfa8=_0x332f86[_0xf780('0x4f')]({'plain':!![]});return _0x1dbfa8[_0xf780('0x66')];});return db[_0xf780('0x30')]['find']({'where':{'id':_0x3f098f[_0xf780('0x53')]['id']}})[_0xf780('0x27')](function(_0x3a5203){return db[_0xf780('0x6a')][_0xf780('0x6b')](function(_0x9e778e){return _0x3a5203[_0xf780('0x64')](_0x59e24a,{'transaction':_0x9e778e})[_0xf780('0x27')](function(){return BPromise[_0xf780('0x6c')](_0x49cb85,function(_0x1eab32){return db[_0xf780('0x57')][_0xf780('0x6d')]({'where':{'UserId':_0x1eab32['id'],'FaxQueueId':_0x3f098f[_0xf780('0x53')]['id']},'transaction':_0x9e778e});});})[_0xf780('0x27')](function(){_0x49cb85[_0xf780('0x6e')](function(_0x3df32f){socket[_0xf780('0x6f')](_0xf780('0x70'),{'UserId':_0x3df32f['id'],'FaxQueueId':_0x3a5203['id']});});});});});}})['then'](respondWithStatusCode(_0x5c0f6d,null))[_0xf780('0x48')](handleError(_0x5c0f6d,null));};exports[_0xf780('0x71')]=function(_0x517118,_0x5da8ad,_0x2f1da1){return db[_0xf780('0x63')][_0xf780('0x46')]({'where':{'id':_0x517118['query'][_0xf780('0x65')]},'attributes':['id'],'include':[{'model':db[_0xf780('0x5a')],'as':_0xf780('0x66'),'attributes':['id'],'raw':!![]}]})[_0xf780('0x27')](handleEntityNotFound(_0x5da8ad,null))[_0xf780('0x27')](function(_0x583638){var _0x3f4a58=_[_0xf780('0x2f')](_0x583638,'id');var _0x3f938a=[];var _0x7108c6=[];var _0x1fdbe7=squel[_0xf780('0x72')]();_0x1fdbe7[_0xf780('0x73')]('tq.TeamId')[_0xf780('0x74')](_0xf780('0x75'),'tq')['join'](_0xf780('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf780('0x41')](_0xf780('0x77'),_0x517118[_0xf780('0x53')]['id']);for(var _0x4498ba=0x0;_0x4498ba<_0x583638['length'];_0x4498ba+=0x1){let _0x402cc0=_0x583638[_0x4498ba];for(var _0x2149af=0x0;_0x2149af<_0x402cc0['Agents']['length'];_0x2149af+=0x1){let _0x51f1d0=_0x402cc0[_0xf780('0x66')][_0x2149af];var _0x4a9a8b=_0x1fdbe7['clone']();_0x4a9a8b[_0xf780('0x41')]('ut.UserId\x20=\x20?',_0x51f1d0['id']);_0x7108c6[_0xf780('0x78')](db[_0xf780('0x6a')][_0xf780('0x35')](_0x4a9a8b[_0xf780('0x79')](),{'type':db['sequelize'][_0xf780('0x7a')][_0xf780('0x7b')]})['then'](function(_0x741653){if(_0x741653[_0xf780('0x3a')]===0x1){return _0x51f1d0['id'];}else{var _0x1ec544=_[_0xf780('0x7c')](_[_0xf780('0x2f')](_0x741653,'TeamId'),function(_0x3a82ec){return _[_0xf780('0x7d')](_0x3f4a58,_0x3a82ec);});if(_0x1ec544){return _0x51f1d0['id'];}}}));}}return BPromise[_0xf780('0x7e')](_0x7108c6)[_0xf780('0x27')](function(_0x5c99a8){_0x3f938a=_(_0x3f938a)[_0xf780('0x7f')](_0x5c99a8)['compact']()['value']();return db['FaxQueue']['find']({'where':{'id':_0x517118['params']['id']}})[_0xf780('0x27')](function(_0x2a4e23){return db[_0xf780('0x6a')][_0xf780('0x6b')](function(_0x581f6e){return _0x2a4e23['removeTeams'](_0x517118[_0xf780('0x35')][_0xf780('0x65')],{'transaction':_0x581f6e})[_0xf780('0x27')](function(){if(!_[_0xf780('0x80')](_0x3f938a)){return _0x2a4e23[_0xf780('0x81')](_0x3f938a,{'transaction':_0x581f6e});}})['then'](function(){_0x3f938a[_0xf780('0x6e')](function(_0x5d5ccf){socket[_0xf780('0x6f')](_0xf780('0x82'),{'UserId':_0x5d5ccf,'FaxQueueId':_0x2a4e23['id']});});});});});});})[_0xf780('0x27')](respondWithStatusCode(_0x5da8ad,null))[_0xf780('0x48')](handleError(_0x5da8ad,null));};exports[_0xf780('0x83')]=function(_0x196456,_0x2adbb0,_0x49b021){return db[_0xf780('0x30')]['find']({'where':{'id':_0x196456[_0xf780('0x53')]['id']}})[_0xf780('0x27')](handleEntityNotFound(_0x2adbb0,null))['then'](function(_0x28c200){if(_0x28c200){return _0x28c200[_0xf780('0x83')](_0x196456[_0xf780('0x4d')][_0xf780('0x65')],_[_0xf780('0x84')](_0x196456['body'],[_0xf780('0x65'),'id'])||{})[_0xf780('0x85')](function(_0x102982){for(var _0x12e505=0x0;_0x12e505<_0x196456[_0xf780('0x4d')][_0xf780('0x65')]['length'];_0x12e505+=0x1){socket[_0xf780('0x6f')](_0xf780('0x70'),{'UserId':Number(_0x196456['body'][_0xf780('0x65')][_0x12e505]),'FaxQueueId':Number(_0x196456[_0xf780('0x53')]['id'])});}return _0x102982;});}})[_0xf780('0x27')](respondWithResult(_0x2adbb0,null))[_0xf780('0x48')](handleError(_0x2adbb0,null));};exports[_0xf780('0x81')]=function(_0x94da48,_0x1d97cf,_0x4b33e8){return db['FaxQueue'][_0xf780('0x4b')]({'where':{'id':_0x94da48[_0xf780('0x53')]['id']}})[_0xf780('0x27')](handleEntityNotFound(_0x1d97cf,null))['then'](function(_0x54a75b){if(_0x54a75b){return _0x54a75b[_0xf780('0x81')](_0x94da48['query'][_0xf780('0x65')])['then'](function(){if(_[_0xf780('0x86')](_0x94da48[_0xf780('0x35')]['ids'])){for(var _0x5a80e5=0x0;_0x5a80e5<_0x94da48[_0xf780('0x35')]['ids'][_0xf780('0x3a')];_0x5a80e5+=0x1){socket[_0xf780('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0x94da48['query'][_0xf780('0x65')][_0x5a80e5]),'FaxQueueId':Number(_0x94da48[_0xf780('0x53')]['id'])});}}else{socket[_0xf780('0x6f')](_0xf780('0x82'),{'UserId':Number(_0x94da48[_0xf780('0x35')]['ids']),'FaxQueueId':Number(_0x94da48[_0xf780('0x53')]['id'])});}});}})[_0xf780('0x27')](respondWithStatusCode(_0x1d97cf,null))[_0xf780('0x48')](handleError(_0x1d97cf,null));};exports[_0xf780('0x87')]=function(_0x32e08a,_0x324b40,_0x2e1b5f){var _0xad29a={};var _0x2978f0={};var _0xcb31af;var _0x59453b;return db[_0xf780('0x30')][_0xf780('0x56')]({'where':{'id':_0x32e08a[_0xf780('0x53')]['id']}})[_0xf780('0x27')](handleEntityNotFound(_0x324b40,null))[_0xf780('0x27')](function(_0x6650cc){if(_0x6650cc){_0xcb31af=_0x6650cc;_0x2978f0['model']=_[_0xf780('0x36')](db[_0xf780('0x5a')]['rawAttributes']);_0x2978f0[_0xf780('0x35')]=_[_0xf780('0x36')](_0x32e08a['query']);_0x2978f0[_0xf780('0x3f')]=_[_0xf780('0x37')](_0x2978f0[_0xf780('0x34')],_0x2978f0[_0xf780('0x35')]);_0xad29a[_0xf780('0x38')]=_['intersection'](_0x2978f0[_0xf780('0x34')],qs[_0xf780('0x39')](_0x32e08a[_0xf780('0x35')][_0xf780('0x39')]));_0xad29a['attributes']=_0xad29a['attributes'][_0xf780('0x3a')]?_0xad29a['attributes']:_0x2978f0['model'];_0xad29a[_0xf780('0x3c')]=qs[_0xf780('0x3d')](_0x32e08a[_0xf780('0x35')][_0xf780('0x3d')]);_0xad29a['where']=qs[_0xf780('0x3f')](_[_0xf780('0x3e')](_0x32e08a[_0xf780('0x35')],_0x2978f0[_0xf780('0x3f')]));if(_0x32e08a[_0xf780('0x35')][_0xf780('0x40')]){_0xad29a[_0xf780('0x41')]=_[_0xf780('0x44')](_0xad29a['where'],{'$or':_[_0xf780('0x2f')](_0xad29a[_0xf780('0x38')],function(_0x2c68ae){var _0x53a5c9={};_0x53a5c9[_0x2c68ae]={'$like':'%'+_0x32e08a[_0xf780('0x35')][_0xf780('0x40')]+'%'};return _0x53a5c9;})});}_0xad29a=_[_0xf780('0x44')]({},_0xad29a,_0x32e08a[_0xf780('0x45')]);return _0xcb31af[_0xf780('0x87')](_0xad29a);}})[_0xf780('0x27')](function(_0x4b5de6){if(_0x4b5de6){_0x59453b=_0x4b5de6[_0xf780('0x3a')];if(!_0x32e08a[_0xf780('0x35')][_0xf780('0x58')](_0xf780('0x3b'))){_0xad29a[_0xf780('0x1f')]=qs['limit'](_0x32e08a[_0xf780('0x35')]['limit']);_0xad29a[_0xf780('0x1e')]=qs[_0xf780('0x1e')](_0x32e08a[_0xf780('0x35')][_0xf780('0x1e')]);}return _0xcb31af[_0xf780('0x87')](_0xad29a);}})[_0xf780('0x27')](function(_0x4874b7){if(_0x4874b7){return _0x4874b7?{'count':_0x59453b,'rows':_0x4874b7}:null;}})[_0xf780('0x27')](respondWithResult(_0x324b40,null))[_0xf780('0x48')](handleError(_0x324b40,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 6d2df0d..6e55431 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 _0xa737=['update','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa737,0x87));var _0x7a73=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xa737[_0x7e2eb0];return _0xd92de4;};'use strict';var EventEmitter=require(_0x7a73('0x0'));var FaxQueue=require(_0x7a73('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x7a73('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7a73('0x3'),'afterDestroy':'remove'};function emitEvent(_0x535bdb){return function(_0x5bf5b3,_0x1426b4,_0x4740b3){FaxQueueEvents[_0x7a73('0x4')](_0x535bdb+':'+_0x5bf5b3['id'],_0x5bf5b3);FaxQueueEvents[_0x7a73('0x4')](_0x535bdb,_0x5bf5b3);_0x4740b3(null);};}for(var e in events){if(events[_0x7a73('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x5296=['setMaxListeners','save','hasOwnProperty','hook','events'];(function(_0x57d873,_0x5cda25){var _0x2d4f1f=function(_0x4795e8){while(--_0x4795e8){_0x57d873['push'](_0x57d873['shift']());}};_0x2d4f1f(++_0x5cda25);}(_0x5296,0x1b7));var _0x6529=function(_0xff3cac,_0x41e8ce){_0xff3cac=_0xff3cac-0x0;var _0xecce58=_0x5296[_0xff3cac];return _0xecce58;};'use strict';var EventEmitter=require(_0x6529('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6529('0x1')](0x0);var events={'afterCreate':_0x6529('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b4add){return function(_0x1e03df,_0x34da21,_0x3b143d){FaxQueueEvents['emit'](_0x1b4add+':'+_0x1e03df['id'],_0x1e03df);FaxQueueEvents['emit'](_0x1b4add,_0x1e03df);_0x3b143d(null);};}for(var e in events){if(events[_0x6529('0x3')](e)){var event=events[e];FaxQueue[_0x6529('0x4')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 0b0ad64..6003050 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 _0xf562=['rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','util','api','moment','request-promise','path'];(function(_0x415e23,_0x212de4){var _0x57dde=function(_0x2137af){while(--_0x2137af){_0x415e23['push'](_0x415e23['shift']());}};_0x57dde(++_0x212de4);}(_0xf562,0xa3));var _0x2f56=function(_0x17ccbc,_0x359d58){_0x17ccbc=_0x17ccbc-0x0;var _0x5d80ef=_0xf562[_0x17ccbc];return _0x5d80ef;};'use strict';var _=require('lodash');var util=require(_0x2f56('0x0'));var logger=require('../../config/logger')(_0x2f56('0x1'));var moment=require(_0x2f56('0x2'));var BPromise=require('bluebird');var rp=require(_0x2f56('0x3'));var fs=require('fs');var path=require(_0x2f56('0x4'));var rimraf=require(_0x2f56('0x5'));var config=require(_0x2f56('0x6'));var attributes=require(_0x2f56('0x7'));module[_0x2f56('0x8')]=function(_0x1c8a60,_0x333056){return _0x1c8a60[_0x2f56('0x9')](_0x2f56('0xa'),attributes,{'tableName':_0x2f56('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7de3=['rimraf','./faxQueue.attributes','exports','define','fax_queues','lodash','util','api'];(function(_0x1e0b2f,_0x5c2bc4){var _0x5aaf1a=function(_0x43369b){while(--_0x43369b){_0x1e0b2f['push'](_0x1e0b2f['shift']());}};_0x5aaf1a(++_0x5c2bc4);}(_0x7de3,0x11d));var _0x37de=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7de3[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x37de('0x0'));var util=require(_0x37de('0x1'));var logger=require('../../config/logger')(_0x37de('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(_0x37de('0x3'));var config=require('../../config/environment');var attributes=require(_0x37de('0x4'));module[_0x37de('0x5')]=function(_0x4c5703,_0x1e617a){return _0x4c5703[_0x37de('0x6')]('FaxQueue',attributes,{'tableName':_0x37de('0x7'),'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 ed7a3b6..faef0a2 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 _0x64b2=['then','debug','stringify','ShowFaxQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','./faxQueue.socket','register','info','FaxQueue,\x20%s,\x20%s','request\x20sent','error','message','catch','GetFaxQueue','FaxQueue','options','where','attributes','limit','map','model','include'];(function(_0x244b6a,_0x216b58){var _0x38a452=function(_0x3c417e){while(--_0x3c417e){_0x244b6a['push'](_0x244b6a['shift']());}};_0x38a452(++_0x216b58);}(_0x64b2,0x15c));var _0x264b=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x64b2[_0x59d89e];return _0x554e93;};'use strict';var _=require(_0x264b('0x0'));var util=require(_0x264b('0x1'));var moment=require(_0x264b('0x2'));var BPromise=require(_0x264b('0x3'));var rs=require(_0x264b('0x4'));var fs=require('fs');var Redis=require(_0x264b('0x5'));var db=require(_0x264b('0x6'))['db'];var utils=require(_0x264b('0x7'));var logger=require(_0x264b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x264b('0x9'));var client=jayson[_0x264b('0xa')][_0x264b('0xb')]({'port':0x232a});config['redis']=_[_0x264b('0xc')](config[_0x264b('0xd')],{'host':_0x264b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x264b('0xd')]));require(_0x264b('0xf'))[_0x264b('0x10')](socket);function respondWithRpcPromise(_0x405c35,_0x8f2c5,_0x147e89){return new BPromise(function(_0x4a8cdd,_0x2f6363){return client['request'](_0x405c35,_0x147e89)['then'](function(_0x11d72a){logger[_0x264b('0x11')](_0x264b('0x12'),_0x8f2c5,'request\x20sent');logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x8f2c5,_0x264b('0x13'),JSON['stringify'](_0x11d72a));if(_0x11d72a[_0x264b('0x14')]){if(_0x11d72a[_0x264b('0x14')]['code']===0x1f4){logger[_0x264b('0x14')](_0x264b('0x12'),_0x8f2c5,_0x11d72a[_0x264b('0x14')]['message']);return _0x2f6363(_0x11d72a[_0x264b('0x14')]['message']);}logger[_0x264b('0x14')]('FaxQueue,\x20%s,\x20%s',_0x8f2c5,_0x11d72a[_0x264b('0x14')][_0x264b('0x15')]);return _0x4a8cdd(_0x11d72a[_0x264b('0x14')][_0x264b('0x15')]);}else{logger[_0x264b('0x11')]('FaxQueue,\x20%s,\x20%s',_0x8f2c5,_0x264b('0x13'));_0x4a8cdd(_0x11d72a['result']['message']);}})[_0x264b('0x16')](function(_0x386f98){logger[_0x264b('0x14')](_0x264b('0x12'),_0x8f2c5,_0x386f98);_0x2f6363(_0x386f98);});});}exports[_0x264b('0x17')]=function(_0x4051ac){var _0x3dbce6=this;return new Promise(function(_0x402277,_0x1d93ee){return db[_0x264b('0x18')]['findAll']({'raw':_0x4051ac['options']?_0x4051ac['options']['raw']===undefined?!![]:![]:!![],'where':_0x4051ac['options']?_0x4051ac[_0x264b('0x19')][_0x264b('0x1a')]||null:null,'attributes':_0x4051ac[_0x264b('0x19')]?_0x4051ac['options'][_0x264b('0x1b')]||null:null,'limit':_0x4051ac[_0x264b('0x19')]?_0x4051ac[_0x264b('0x19')][_0x264b('0x1c')]||null:null,'include':_0x4051ac[_0x264b('0x19')]?_0x4051ac[_0x264b('0x19')]['include']?_[_0x264b('0x1d')](_0x4051ac['options']['include'],function(_0x368de9){return{'model':db[_0x368de9[_0x264b('0x1e')]],'as':_0x368de9['as'],'attributes':_0x368de9[_0x264b('0x1b')],'include':_0x368de9['include']?_[_0x264b('0x1d')](_0x368de9[_0x264b('0x1f')],function(_0x56ffc1){return{'model':db[_0x56ffc1[_0x264b('0x1e')]],'as':_0x56ffc1['as'],'attributes':_0x56ffc1[_0x264b('0x1b')],'include':_0x56ffc1[_0x264b('0x1f')]?_[_0x264b('0x1d')](_0x56ffc1['include'],function(_0x52027b){return{'model':db[_0x52027b[_0x264b('0x1e')]],'as':_0x52027b['as'],'attributes':_0x52027b['attributes']};}):[]};}):[]};}):[]:[]})[_0x264b('0x20')](function(_0x54153d){logger[_0x264b('0x11')](_0x264b('0x17'),_0x4051ac);logger[_0x264b('0x21')](_0x264b('0x17'),_0x4051ac,JSON[_0x264b('0x22')](_0x54153d));_0x402277(_0x54153d);})['catch'](function(_0x339bc3){logger['error'](_0x264b('0x17'),_0x339bc3[_0x264b('0x15')],_0x4051ac);_0x1d93ee(_0x3dbce6[_0x264b('0x14')](0x1f4,_0x339bc3[_0x264b('0x15')]));});});};exports[_0x264b('0x23')]=function(_0x95012b){var _0x322626=this;return new Promise(function(_0xf1df67,_0x58a0e3){return db['FaxQueue'][_0x264b('0x24')]({'raw':_0x95012b[_0x264b('0x19')]?_0x95012b[_0x264b('0x19')][_0x264b('0x25')]===undefined?!![]:![]:!![],'where':_0x95012b[_0x264b('0x19')]?_0x95012b[_0x264b('0x19')][_0x264b('0x1a')]||null:null,'attributes':_0x95012b[_0x264b('0x19')]?_0x95012b['options'][_0x264b('0x1b')]||null:null,'include':_0x95012b[_0x264b('0x19')]?_0x95012b['options'][_0x264b('0x1f')]?_[_0x264b('0x1d')](_0x95012b[_0x264b('0x19')][_0x264b('0x1f')],function(_0x5dd092){return{'model':db[_0x5dd092[_0x264b('0x1e')]],'as':_0x5dd092['as'],'attributes':_0x5dd092['attributes'],'include':_0x5dd092[_0x264b('0x1f')]?_['map'](_0x5dd092['include'],function(_0x45c2e){return{'model':db[_0x45c2e[_0x264b('0x1e')]],'as':_0x45c2e['as'],'attributes':_0x45c2e[_0x264b('0x1b')],'include':_0x45c2e[_0x264b('0x1f')]?_[_0x264b('0x1d')](_0x45c2e['include'],function(_0x48ac1d){return{'model':db[_0x48ac1d[_0x264b('0x1e')]],'as':_0x48ac1d['as'],'attributes':_0x48ac1d[_0x264b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x264b('0x20')](function(_0x544334){logger['info']('ShowFaxQueue',_0x95012b);logger['debug'](_0x264b('0x23'),_0x95012b,JSON[_0x264b('0x22')](_0x544334));_0xf1df67(_0x544334);})['catch'](function(_0x5d48c7){logger[_0x264b('0x14')](_0x264b('0x23'),_0x5d48c7['message'],_0x95012b);_0x58a0e3(_0x322626[_0x264b('0x14')](0x1f4,_0x5d48c7['message']));});});}; \ No newline at end of file +var _0xae2b=['http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','include','map','model','ShowFaxQueue','raw','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0xae2b,0x89));var _0xbae2=function(_0x2ec951,_0x349c6e){_0x2ec951=_0x2ec951-0x0;var _0x44d2b4=_0xae2b[_0x2ec951];return _0x44d2b4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbae2('0x0'));var BPromise=require(_0xbae2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbae2('0x2'))['db'];var utils=require(_0xbae2('0x3'));var logger=require(_0xbae2('0x4'))('rpc');var config=require(_0xbae2('0x5'));var jayson=require(_0xbae2('0x6'));var client=jayson['client'][_0xbae2('0x7')]({'port':0x232a});config[_0xbae2('0x8')]=_[_0xbae2('0x9')](config[_0xbae2('0x8')],{'host':_0xbae2('0xa'),'port':0x18eb});var socket=require(_0xbae2('0xb'))(new Redis(config['redis']));require('./faxQueue.socket')[_0xbae2('0xc')](socket);function respondWithRpcPromise(_0x41bb59,_0xe1f5bc,_0x1cd4bc){return new BPromise(function(_0x5c3553,_0x216f40){return client[_0xbae2('0xd')](_0x41bb59,_0x1cd4bc)[_0xbae2('0xe')](function(_0x230ea8){logger[_0xbae2('0xf')](_0xbae2('0x10'),_0xe1f5bc,_0xbae2('0x11'));logger[_0xbae2('0x12')](_0xbae2('0x13'),_0xe1f5bc,_0xbae2('0x11'),JSON[_0xbae2('0x14')](_0x230ea8));if(_0x230ea8[_0xbae2('0x15')]){if(_0x230ea8[_0xbae2('0x15')]['code']===0x1f4){logger[_0xbae2('0x15')](_0xbae2('0x10'),_0xe1f5bc,_0x230ea8['error'][_0xbae2('0x16')]);return _0x216f40(_0x230ea8[_0xbae2('0x15')][_0xbae2('0x16')]);}logger['error'](_0xbae2('0x10'),_0xe1f5bc,_0x230ea8[_0xbae2('0x15')][_0xbae2('0x16')]);return _0x5c3553(_0x230ea8[_0xbae2('0x15')]['message']);}else{logger[_0xbae2('0xf')](_0xbae2('0x10'),_0xe1f5bc,_0xbae2('0x11'));_0x5c3553(_0x230ea8[_0xbae2('0x17')][_0xbae2('0x16')]);}})[_0xbae2('0x18')](function(_0x364245){logger[_0xbae2('0x15')](_0xbae2('0x10'),_0xe1f5bc,_0x364245);_0x216f40(_0x364245);});});}exports[_0xbae2('0x19')]=function(_0x510f1c){var _0x500964=this;return new Promise(function(_0x5d6532,_0xd58750){return db[_0xbae2('0x1a')][_0xbae2('0x1b')]({'raw':_0x510f1c[_0xbae2('0x1c')]?_0x510f1c[_0xbae2('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x510f1c[_0xbae2('0x1c')]?_0x510f1c['options'][_0xbae2('0x1d')]||null:null,'attributes':_0x510f1c[_0xbae2('0x1c')]?_0x510f1c[_0xbae2('0x1c')][_0xbae2('0x1e')]||null:null,'limit':_0x510f1c['options']?_0x510f1c[_0xbae2('0x1c')]['limit']||null:null,'include':_0x510f1c['options']?_0x510f1c['options'][_0xbae2('0x1f')]?_[_0xbae2('0x20')](_0x510f1c[_0xbae2('0x1c')][_0xbae2('0x1f')],function(_0x49b4e4){return{'model':db[_0x49b4e4[_0xbae2('0x21')]],'as':_0x49b4e4['as'],'attributes':_0x49b4e4[_0xbae2('0x1e')],'include':_0x49b4e4[_0xbae2('0x1f')]?_['map'](_0x49b4e4['include'],function(_0x4394c5){return{'model':db[_0x4394c5[_0xbae2('0x21')]],'as':_0x4394c5['as'],'attributes':_0x4394c5['attributes'],'include':_0x4394c5[_0xbae2('0x1f')]?_[_0xbae2('0x20')](_0x4394c5[_0xbae2('0x1f')],function(_0x30cc65){return{'model':db[_0x30cc65[_0xbae2('0x21')]],'as':_0x30cc65['as'],'attributes':_0x30cc65[_0xbae2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbae2('0xe')](function(_0x2c682c){logger[_0xbae2('0xf')](_0xbae2('0x19'),_0x510f1c);logger[_0xbae2('0x12')]('GetFaxQueue',_0x510f1c,JSON[_0xbae2('0x14')](_0x2c682c));_0x5d6532(_0x2c682c);})[_0xbae2('0x18')](function(_0x34da98){logger['error'](_0xbae2('0x19'),_0x34da98[_0xbae2('0x16')],_0x510f1c);_0xd58750(_0x500964[_0xbae2('0x15')](0x1f4,_0x34da98['message']));});});};exports[_0xbae2('0x22')]=function(_0x2a8f8d){var _0x214dcc=this;return new Promise(function(_0x50f0a7,_0x261281){return db[_0xbae2('0x1a')]['find']({'raw':_0x2a8f8d[_0xbae2('0x1c')]?_0x2a8f8d['options'][_0xbae2('0x23')]===undefined?!![]:![]:!![],'where':_0x2a8f8d[_0xbae2('0x1c')]?_0x2a8f8d[_0xbae2('0x1c')]['where']||null:null,'attributes':_0x2a8f8d[_0xbae2('0x1c')]?_0x2a8f8d['options'][_0xbae2('0x1e')]||null:null,'include':_0x2a8f8d['options']?_0x2a8f8d[_0xbae2('0x1c')][_0xbae2('0x1f')]?_[_0xbae2('0x20')](_0x2a8f8d[_0xbae2('0x1c')][_0xbae2('0x1f')],function(_0x526586){return{'model':db[_0x526586[_0xbae2('0x21')]],'as':_0x526586['as'],'attributes':_0x526586[_0xbae2('0x1e')],'include':_0x526586[_0xbae2('0x1f')]?_[_0xbae2('0x20')](_0x526586['include'],function(_0x1ff9f1){return{'model':db[_0x1ff9f1[_0xbae2('0x21')]],'as':_0x1ff9f1['as'],'attributes':_0x1ff9f1['attributes'],'include':_0x1ff9f1['include']?_[_0xbae2('0x20')](_0x1ff9f1[_0xbae2('0x1f')],function(_0x57fef0){return{'model':db[_0x57fef0[_0xbae2('0x21')]],'as':_0x57fef0['as'],'attributes':_0x57fef0[_0xbae2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbae2('0xe')](function(_0x48a2a5){logger['info'](_0xbae2('0x22'),_0x2a8f8d);logger[_0xbae2('0x12')]('ShowFaxQueue',_0x2a8f8d,JSON['stringify'](_0x48a2a5));_0x50f0a7(_0x48a2a5);})[_0xbae2('0x18')](function(_0x4a6f83){logger[_0xbae2('0x15')](_0xbae2('0x22'),_0x4a6f83[_0xbae2('0x16')],_0x2a8f8d);_0x261281(_0x214dcc['error'](0x1f4,_0x4a6f83[_0xbae2('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index cd083c5..d9fa77e 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 _0x4645=['update','emit','removeListener','./faxQueue.events','save'];(function(_0x1431f0,_0x34cbc2){var _0xe76b2b=function(_0x31be4c){while(--_0x31be4c){_0x1431f0['push'](_0x1431f0['shift']());}};_0xe76b2b(++_0x34cbc2);}(_0x4645,0x1cf));var _0x5464=function(_0x1dface,_0x3c6ced){_0x1dface=_0x1dface-0x0;var _0x24b408=_0x4645[_0x1dface];return _0x24b408;};'use strict';var FaxQueueEvents=require(_0x5464('0x0'));var events=[_0x5464('0x1'),'remove',_0x5464('0x2')];function createListener(_0x1df26c,_0x1a6b97){return function(_0x1c9f27){_0x1a6b97[_0x5464('0x3')](_0x1df26c,_0x1c9f27);};}function removeListener(_0x2620e9,_0x185e02){return function(){FaxQueueEvents[_0x5464('0x4')](_0x2620e9,_0x185e02);};}exports['register']=function(_0x1e08db){for(var _0x320f40=0x0,_0x1ac02d=events['length'];_0x320f40<_0x1ac02d;_0x320f40++){var _0x48c90b=events[_0x320f40];var _0x9a3918=createListener('faxQueue:'+_0x48c90b,_0x1e08db);FaxQueueEvents['on'](_0x48c90b,_0x9a3918);}}; \ No newline at end of file +var _0xd16a=['faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x2a0e83,_0x35fd6d){var _0x424159=function(_0x3b2b10){while(--_0x3b2b10){_0x2a0e83['push'](_0x2a0e83['shift']());}};_0x424159(++_0x35fd6d);}(_0xd16a,0x151));var _0xad16=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd16a[_0x20a584];return _0x4b41a8;};'use strict';var FaxQueueEvents=require(_0xad16('0x0'));var events=[_0xad16('0x1'),_0xad16('0x2'),_0xad16('0x3')];function createListener(_0x39fd7d,_0x436baa){return function(_0x484c6b){_0x436baa[_0xad16('0x4')](_0x39fd7d,_0x484c6b);};}function removeListener(_0x12dba1,_0x599554){return function(){FaxQueueEvents[_0xad16('0x5')](_0x12dba1,_0x599554);};}exports[_0xad16('0x6')]=function(_0x4e5d44){for(var _0x371c3d=0x0,_0xae1d82=events['length'];_0x371c3d<_0xae1d82;_0x371c3d++){var _0x1e22fd=events[_0x371c3d];var _0x106634=createListener(_0xad16('0x7')+_0x1e22fd,_0x4e5d44);FaxQueueEvents['on'](_0x1e22fd,_0x106634);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 7489503..2107e39 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 _0xbff5=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/users','getAgents','create','/:id/teams','addAgents','update','destroy','removeTeams'];(function(_0x223b78,_0x26ca12){var _0x20e163=function(_0x1b16eb){while(--_0x1b16eb){_0x223b78['push'](_0x223b78['shift']());}};_0x20e163(++_0x26ca12);}(_0xbff5,0x1bc));var _0x5bff=function(_0x57c6a2,_0x413935){_0x57c6a2=_0x57c6a2-0x0;var _0xeac151=_0xbff5[_0x57c6a2];return _0xeac151;};'use strict';var multer=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var path=require(_0x5bff('0x2'));var timeout=require(_0x5bff('0x3'));var express=require(_0x5bff('0x4'));var router=express[_0x5bff('0x5')]();var fs_extra=require(_0x5bff('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5bff('0x7'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0x5bff('0x8')]('/',auth[_0x5bff('0x9')](),controller[_0x5bff('0xa')]);router[_0x5bff('0x8')](_0x5bff('0xb'),auth[_0x5bff('0x9')](),controller[_0x5bff('0xc')]);router[_0x5bff('0x8')](_0x5bff('0xd'),auth['isAuthenticated'](),controller[_0x5bff('0xe')]);router['get'](_0x5bff('0xf'),auth[_0x5bff('0x9')](),controller['getMembers']);router[_0x5bff('0x8')]('/:id/teams',auth[_0x5bff('0x9')](),controller['getTeams']);router[_0x5bff('0x8')](_0x5bff('0x10'),auth['isAuthenticated'](),controller[_0x5bff('0x11')]);router['post']('/',auth[_0x5bff('0x9')](),controller[_0x5bff('0x12')]);router['post'](_0x5bff('0x13'),auth[_0x5bff('0x9')](),controller['addTeams']);router['post'](_0x5bff('0x10'),auth[_0x5bff('0x9')](),controller[_0x5bff('0x14')]);router['put'](_0x5bff('0xd'),auth[_0x5bff('0x9')](),controller[_0x5bff('0x15')]);router['delete'](_0x5bff('0xd'),auth[_0x5bff('0x9')](),controller[_0x5bff('0x16')]);router['delete'](_0x5bff('0x13'),auth[_0x5bff('0x9')](),controller[_0x5bff('0x17')]);router[_0x5bff('0x18')]('/:id/users',auth[_0x5bff('0x9')](),controller['removeAgents']);module[_0x5bff('0x19')]=router; \ No newline at end of file +var _0x90ec=['/:id/teams','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','getAgents','post','create','addTeams','/:id/users','addAgents','delete','destroy'];(function(_0xb6f76d,_0x510e1d){var _0x22c8d9=function(_0x239a29){while(--_0x239a29){_0xb6f76d['push'](_0xb6f76d['shift']());}};_0x22c8d9(++_0x510e1d);}(_0x90ec,0x1d4));var _0xc90e=function(_0x42f1c1,_0x299003){_0x42f1c1=_0x42f1c1-0x0;var _0x12433e=_0x90ec[_0x42f1c1];return _0x12433e;};'use strict';var multer=require(_0xc90e('0x0'));var util=require(_0xc90e('0x1'));var path=require('path');var timeout=require(_0xc90e('0x2'));var express=require(_0xc90e('0x3'));var router=express[_0xc90e('0x4')]();var fs_extra=require(_0xc90e('0x5'));var auth=require(_0xc90e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc90e('0x7'));var controller=require(_0xc90e('0x8'));router[_0xc90e('0x9')]('/',auth['isAuthenticated'](),controller[_0xc90e('0xa')]);router['get'](_0xc90e('0xb'),auth[_0xc90e('0xc')](),controller['describe']);router[_0xc90e('0x9')](_0xc90e('0xd'),auth[_0xc90e('0xc')](),controller[_0xc90e('0xe')]);router[_0xc90e('0x9')](_0xc90e('0xf'),auth[_0xc90e('0xc')](),controller[_0xc90e('0x10')]);router[_0xc90e('0x9')]('/:id/teams',auth[_0xc90e('0xc')](),controller['getTeams']);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xc90e('0x11')]);router[_0xc90e('0x12')]('/',auth['isAuthenticated'](),controller[_0xc90e('0x13')]);router[_0xc90e('0x12')]('/:id/teams',auth[_0xc90e('0xc')](),controller[_0xc90e('0x14')]);router[_0xc90e('0x12')](_0xc90e('0x15'),auth[_0xc90e('0xc')](),controller[_0xc90e('0x16')]);router['put'](_0xc90e('0xd'),auth[_0xc90e('0xc')](),controller['update']);router[_0xc90e('0x17')]('/:id',auth[_0xc90e('0xc')](),controller[_0xc90e('0x18')]);router['delete'](_0xc90e('0x19'),auth[_0xc90e('0xc')](),controller[_0xc90e('0x1a')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xc90e('0x1b')]);module[_0xc90e('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index a8e398e..5780d03 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 _0x6439=['DATE','sequelize','exports','STRING'];(function(_0x3ad7d4,_0x44ede4){var _0x1a8278=function(_0x14067f){while(--_0x14067f){_0x3ad7d4['push'](_0x3ad7d4['shift']());}};_0x1a8278(++_0x44ede4);}(_0x6439,0xc9));var _0x9643=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x6439[_0x273c39];return _0x46d6b5;};'use strict';var moment=require('moment');var Sequelize=require(_0x9643('0x0'));module[_0x9643('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x9643('0x2')]},'joinAt':{'type':Sequelize[_0x9643('0x3')]},'leaveAt':{'type':Sequelize[_0x9643('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa3cf=['STRING','DATE','moment','sequelize','exports'];(function(_0x5a91c6,_0x340de6){var _0x54d83c=function(_0x2006fd){while(--_0x2006fd){_0x5a91c6['push'](_0x5a91c6['shift']());}};_0x54d83c(++_0x340de6);}(_0xa3cf,0xc5));var _0xfa3c=function(_0x2832c1,_0x24a600){_0x2832c1=_0x2832c1-0x0;var _0x25f7a5=_0xa3cf[_0x2832c1];return _0x25f7a5;};'use strict';var moment=require(_0xfa3c('0x0'));var Sequelize=require(_0xfa3c('0x1'));module[_0xfa3c('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xfa3c('0x3')]},'joinAt':{'type':Sequelize[_0xfa3c('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfa3c('0x4')]},'reason':{'type':Sequelize[_0xfa3c('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 146ac92..a1e42b8 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 _0x9086=['destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','FaxQueueReport','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9086,0x10b));var _0x6908=function(_0x31ba1a,_0x4e88ce){_0x31ba1a=_0x31ba1a-0x0;var _0xf8402b=_0x9086[_0x31ba1a];return _0xf8402b;};'use strict';var emlformat=require(_0x6908('0x0'));var rimraf=require(_0x6908('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6908('0x2'));var rp=require(_0x6908('0x3'));var moment=require(_0x6908('0x4'));var BPromise=require(_0x6908('0x5'));var Mustache=require(_0x6908('0x6'));var util=require(_0x6908('0x7'));var path=require('path');var sox=require(_0x6908('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6908('0x9'));var _=require('lodash');var squel=require(_0x6908('0xa'));var crypto=require(_0x6908('0xb'));var jsforce=require(_0x6908('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6908('0xd'));var querystring=require('querystring');var Papa=require(_0x6908('0xe'));var Redis=require('ioredis');var authService=require(_0x6908('0xf'));var qs=require(_0x6908('0x10'));var as=require(_0x6908('0x11'));var hardwareService=require(_0x6908('0x12'));var logger=require(_0x6908('0x13'))('api');var utils=require(_0x6908('0x14'));var config=require(_0x6908('0x15'));var licenseUtil=require(_0x6908('0x16'));var db=require(_0x6908('0x17'))['db'];function respondWithStatusCode(_0x2ad916,_0x448250){_0x448250=_0x448250||0xcc;return function(_0x28a623){if(_0x28a623){return _0x2ad916[_0x6908('0x18')](_0x448250);}return _0x2ad916[_0x6908('0x19')](_0x448250)['end']();};}function respondWithResult(_0x2dfecc,_0x5b819c){_0x5b819c=_0x5b819c||0xc8;return function(_0xc967ec){if(_0xc967ec){return _0x2dfecc[_0x6908('0x19')](_0x5b819c)['json'](_0xc967ec);}};}function respondWithFilteredResult(_0x108e25,_0x3c42b1){return function(_0x2e2f1f){if(_0x2e2f1f){var _0x3badf9=typeof _0x3c42b1[_0x6908('0x1a')]==='undefined'&&typeof _0x3c42b1['limit']===_0x6908('0x1b');var _0x34f15e=_0x2e2f1f[_0x6908('0x1c')];var _0x4e8ea3=_0x3badf9?0x0:_0x3c42b1[_0x6908('0x1a')];var _0x5e8253=_0x3badf9?_0x2e2f1f[_0x6908('0x1c')]:_0x3c42b1[_0x6908('0x1a')]+_0x3c42b1[_0x6908('0x1d')];var _0x5f1063;if(_0x5e8253>=_0x34f15e){_0x5e8253=_0x34f15e;_0x5f1063=0xc8;}else{_0x5f1063=0xce;}_0x108e25[_0x6908('0x19')](_0x5f1063);return _0x108e25[_0x6908('0x1e')]('Content-Range',_0x4e8ea3+'-'+_0x5e8253+'/'+_0x34f15e)[_0x6908('0x1f')](_0x2e2f1f);}return null;};}function patchUpdates(_0x458be9){return function(_0x15d8dc){try{jsonpatch[_0x6908('0x20')](_0x15d8dc,_0x458be9,!![]);}catch(_0xccffb2){return BPromise[_0x6908('0x21')](_0xccffb2);}return _0x15d8dc[_0x6908('0x22')]();};}function saveUpdates(_0x1d8889,_0x10fd5a){return function(_0x2b2614){if(_0x2b2614){return _0x2b2614[_0x6908('0x23')](_0x1d8889)[_0x6908('0x24')](function(_0x401740){return _0x401740;});}return null;};}function removeEntity(_0x3cb627,_0x312231){return function(_0x2eb759){if(_0x2eb759){return _0x2eb759[_0x6908('0x25')]()[_0x6908('0x24')](function(){_0x3cb627[_0x6908('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x363dc6,_0x1854dc){return function(_0x4af0fc){if(!_0x4af0fc){_0x363dc6[_0x6908('0x18')](0x194);}return _0x4af0fc;};}function handleError(_0x5f140e,_0x5232be){_0x5232be=_0x5232be||0x1f4;return function(_0xb8c62){logger[_0x6908('0x26')](_0xb8c62[_0x6908('0x27')]);if(_0xb8c62[_0x6908('0x28')]){delete _0xb8c62[_0x6908('0x28')];}_0x5f140e[_0x6908('0x19')](_0x5232be)[_0x6908('0x29')](_0xb8c62);};}exports[_0x6908('0x2a')]=function(_0x208274,_0x5b0329){var _0x2a0d51={},_0x315234={},_0x804455={'count':0x0,'rows':[]};var _0x44be5d=_['map'](db['FaxQueueReport'][_0x6908('0x2b')],function(_0x2aa657){return{'name':_0x2aa657[_0x6908('0x2c')],'type':_0x2aa657[_0x6908('0x2d')][_0x6908('0x2e')]};});_0x315234[_0x6908('0x2f')]=_[_0x6908('0x30')](_0x44be5d,_0x6908('0x28'));_0x315234[_0x6908('0x31')]=_[_0x6908('0x32')](_0x208274[_0x6908('0x31')]);_0x315234[_0x6908('0x33')]=_['intersection'](_0x315234['model'],_0x315234[_0x6908('0x31')]);_0x2a0d51[_0x6908('0x34')]=_[_0x6908('0x35')](_0x315234[_0x6908('0x2f')],qs[_0x6908('0x36')](_0x208274['query'][_0x6908('0x36')]));_0x2a0d51[_0x6908('0x34')]=_0x2a0d51[_0x6908('0x34')]['length']?_0x2a0d51[_0x6908('0x34')]:_0x315234[_0x6908('0x2f')];if(!_0x208274['query'][_0x6908('0x37')]('nolimit')){_0x2a0d51[_0x6908('0x1d')]=qs['limit'](_0x208274[_0x6908('0x31')]['limit']);_0x2a0d51[_0x6908('0x1a')]=qs[_0x6908('0x1a')](_0x208274[_0x6908('0x31')][_0x6908('0x1a')]);}_0x2a0d51[_0x6908('0x38')]=qs[_0x6908('0x39')](_0x208274[_0x6908('0x31')][_0x6908('0x39')]);_0x2a0d51[_0x6908('0x3a')]=qs[_0x6908('0x33')](_[_0x6908('0x3b')](_0x208274[_0x6908('0x31')],_0x315234[_0x6908('0x33')]),_0x44be5d);if(_0x208274[_0x6908('0x31')][_0x6908('0x3c')]){_0x2a0d51['where']=_['merge'](_0x2a0d51[_0x6908('0x3a')],{'$or':_[_0x6908('0x30')](_0x44be5d,function(_0x413da1){if(_0x413da1[_0x6908('0x2d')]!=='VIRTUAL'){var _0x42cdef={};_0x42cdef[_0x413da1['name']]={'$like':'%'+_0x208274[_0x6908('0x31')][_0x6908('0x3c')]+'%'};return _0x42cdef;}})});}_0x2a0d51=_[_0x6908('0x3d')]({},_0x2a0d51,_0x208274[_0x6908('0x3e')]);var _0x3980f0={'where':_0x2a0d51['where']};return db[_0x6908('0x3f')][_0x6908('0x1c')](_0x3980f0)[_0x6908('0x24')](function(_0x21db77){_0x804455[_0x6908('0x1c')]=_0x21db77;if(_0x208274[_0x6908('0x31')]['includeAll']){_0x2a0d51[_0x6908('0x40')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x6908('0x41')](_0x2a0d51);})[_0x6908('0x24')](function(_0x4478d8){_0x804455[_0x6908('0x42')]=_0x4478d8;return _0x804455;})[_0x6908('0x24')](respondWithFilteredResult(_0x5b0329,_0x2a0d51))[_0x6908('0x43')](handleError(_0x5b0329,null));};exports[_0x6908('0x44')]=function(_0x20ed64,_0xba7b12){var _0xa675f5={'raw':!![],'where':{'id':_0x20ed64[_0x6908('0x45')]['id']}},_0x32a8b8={};_0x32a8b8['model']=_[_0x6908('0x32')](db[_0x6908('0x3f')]['rawAttributes']);_0x32a8b8['query']=_['keys'](_0x20ed64[_0x6908('0x31')]);_0x32a8b8[_0x6908('0x33')]=_[_0x6908('0x35')](_0x32a8b8[_0x6908('0x2f')],_0x32a8b8[_0x6908('0x31')]);_0xa675f5[_0x6908('0x34')]=_[_0x6908('0x35')](_0x32a8b8[_0x6908('0x2f')],qs[_0x6908('0x36')](_0x20ed64[_0x6908('0x31')][_0x6908('0x36')]));_0xa675f5['attributes']=_0xa675f5[_0x6908('0x34')][_0x6908('0x46')]?_0xa675f5['attributes']:_0x32a8b8[_0x6908('0x2f')];if(_0x20ed64[_0x6908('0x31')][_0x6908('0x47')]){_0xa675f5[_0x6908('0x40')]=[{'all':!![]}];}_0xa675f5=_[_0x6908('0x3d')]({},_0xa675f5,_0x20ed64[_0x6908('0x3e')]);return db[_0x6908('0x3f')][_0x6908('0x48')](_0xa675f5)['then'](handleEntityNotFound(_0xba7b12,null))[_0x6908('0x24')](respondWithResult(_0xba7b12,null))[_0x6908('0x43')](handleError(_0xba7b12,null));};exports[_0x6908('0x49')]=function(_0x5ed60d,_0x141726){return db['FaxQueueReport']['create'](_0x5ed60d['body'],{})[_0x6908('0x24')](respondWithResult(_0x141726,0xc9))[_0x6908('0x43')](handleError(_0x141726,null));};exports[_0x6908('0x23')]=function(_0x5e73f5,_0x1fbc6b){if(_0x5e73f5[_0x6908('0x4a')]['id']){delete _0x5e73f5[_0x6908('0x4a')]['id'];}return db[_0x6908('0x3f')][_0x6908('0x48')]({'where':{'id':_0x5e73f5[_0x6908('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fbc6b,null))['then'](saveUpdates(_0x5e73f5[_0x6908('0x4a')],null))[_0x6908('0x24')](respondWithResult(_0x1fbc6b,null))[_0x6908('0x43')](handleError(_0x1fbc6b,null));};exports[_0x6908('0x25')]=function(_0x4460f4,_0x52cfe3){return db['FaxQueueReport'][_0x6908('0x48')]({'where':{'id':_0x4460f4[_0x6908('0x45')]['id']}})['then'](handleEntityNotFound(_0x52cfe3,null))[_0x6908('0x24')](removeEntity(_0x52cfe3,null))['catch'](handleError(_0x52cfe3,null));};exports[_0x6908('0x4b')]=function(_0x26923b,_0x28a7a6){return db['FaxQueueReport'][_0x6908('0x4b')]()[_0x6908('0x24')](respondWithResult(_0x28a7a6,null))[_0x6908('0x43')](handleError(_0x28a7a6,null));}; \ No newline at end of file +var _0xee11=['nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','FaxQueueReport','includeAll','include','findAll','rows','catch','params','fields','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','map','query','keys','intersection','attributes','model','length','hasOwnProperty'];(function(_0x24a711,_0x2c44e7){var _0x24dad5=function(_0x530840){while(--_0x530840){_0x24a711['push'](_0x24a711['shift']());}};_0x24dad5(++_0x2c44e7);}(_0xee11,0x146));var _0x1ee1=function(_0x56139e,_0x714ec2){_0x56139e=_0x56139e-0x0;var _0x113526=_0xee11[_0x56139e];return _0x113526;};'use strict';var emlformat=require(_0x1ee1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1ee1('0x1'));var rp=require(_0x1ee1('0x2'));var moment=require(_0x1ee1('0x3'));var BPromise=require(_0x1ee1('0x4'));var Mustache=require(_0x1ee1('0x5'));var util=require(_0x1ee1('0x6'));var path=require(_0x1ee1('0x7'));var sox=require(_0x1ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x1ee1('0x9'));var fs=require('fs');var fs_extra=require(_0x1ee1('0xa'));var _=require(_0x1ee1('0xb'));var squel=require(_0x1ee1('0xc'));var crypto=require(_0x1ee1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1ee1('0xe'));var querystring=require(_0x1ee1('0xf'));var Papa=require(_0x1ee1('0x10'));var Redis=require(_0x1ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ee1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ee1('0x13'));var logger=require(_0x1ee1('0x14'))(_0x1ee1('0x15'));var utils=require(_0x1ee1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1ee1('0x17'));var db=require(_0x1ee1('0x18'))['db'];function respondWithStatusCode(_0x51268c,_0x35d97c){_0x35d97c=_0x35d97c||0xcc;return function(_0xc2b64e){if(_0xc2b64e){return _0x51268c[_0x1ee1('0x19')](_0x35d97c);}return _0x51268c[_0x1ee1('0x1a')](_0x35d97c)[_0x1ee1('0x1b')]();};}function respondWithResult(_0x272cab,_0x1a23e4){_0x1a23e4=_0x1a23e4||0xc8;return function(_0xbc8577){if(_0xbc8577){return _0x272cab[_0x1ee1('0x1a')](_0x1a23e4)[_0x1ee1('0x1c')](_0xbc8577);}};}function respondWithFilteredResult(_0x2bc943,_0x443dff){return function(_0x3c64f1){if(_0x3c64f1){var _0x3a19db=typeof _0x443dff['offset']==='undefined'&&typeof _0x443dff[_0x1ee1('0x1d')]===_0x1ee1('0x1e');var _0x52aaab=_0x3c64f1[_0x1ee1('0x1f')];var _0x1e18b9=_0x3a19db?0x0:_0x443dff[_0x1ee1('0x20')];var _0x55abff=_0x3a19db?_0x3c64f1[_0x1ee1('0x1f')]:_0x443dff[_0x1ee1('0x20')]+_0x443dff['limit'];var _0x1e2073;if(_0x55abff>=_0x52aaab){_0x55abff=_0x52aaab;_0x1e2073=0xc8;}else{_0x1e2073=0xce;}_0x2bc943[_0x1ee1('0x1a')](_0x1e2073);return _0x2bc943['set']('Content-Range',_0x1e18b9+'-'+_0x55abff+'/'+_0x52aaab)[_0x1ee1('0x1c')](_0x3c64f1);}return null;};}function patchUpdates(_0x1b6cdf){return function(_0x6f623){try{jsonpatch[_0x1ee1('0x21')](_0x6f623,_0x1b6cdf,!![]);}catch(_0x47eb1a){return BPromise[_0x1ee1('0x22')](_0x47eb1a);}return _0x6f623[_0x1ee1('0x23')]();};}function saveUpdates(_0x482d0,_0x5093ff){return function(_0x1a27c4){if(_0x1a27c4){return _0x1a27c4[_0x1ee1('0x24')](_0x482d0)[_0x1ee1('0x25')](function(_0x307672){return _0x307672;});}return null;};}function removeEntity(_0x21073e,_0x353542){return function(_0x55921f){if(_0x55921f){return _0x55921f[_0x1ee1('0x26')]()['then'](function(){_0x21073e['status'](0xcc)[_0x1ee1('0x1b')]();});}};}function handleEntityNotFound(_0x306aac,_0x585e51){return function(_0x29df0b){if(!_0x29df0b){_0x306aac[_0x1ee1('0x19')](0x194);}return _0x29df0b;};}function handleError(_0x1036f5,_0x31ede7){_0x31ede7=_0x31ede7||0x1f4;return function(_0x129232){logger[_0x1ee1('0x27')](_0x129232['stack']);if(_0x129232[_0x1ee1('0x28')]){delete _0x129232[_0x1ee1('0x28')];}_0x1036f5[_0x1ee1('0x1a')](_0x31ede7)[_0x1ee1('0x29')](_0x129232);};}exports[_0x1ee1('0x2a')]=function(_0x1a2246,_0x551e9d){var _0x19e4cc={},_0x576bf4={},_0x1fab9d={'count':0x0,'rows':[]};var _0x153731=_['map'](db['FaxQueueReport'][_0x1ee1('0x2b')],function(_0xfd544d){return{'name':_0xfd544d[_0x1ee1('0x2c')],'type':_0xfd544d[_0x1ee1('0x2d')]['key']};});_0x576bf4['model']=_[_0x1ee1('0x2e')](_0x153731,_0x1ee1('0x28'));_0x576bf4[_0x1ee1('0x2f')]=_[_0x1ee1('0x30')](_0x1a2246['query']);_0x576bf4['filters']=_[_0x1ee1('0x31')](_0x576bf4['model'],_0x576bf4[_0x1ee1('0x2f')]);_0x19e4cc[_0x1ee1('0x32')]=_['intersection'](_0x576bf4[_0x1ee1('0x33')],qs['fields'](_0x1a2246[_0x1ee1('0x2f')]['fields']));_0x19e4cc[_0x1ee1('0x32')]=_0x19e4cc['attributes'][_0x1ee1('0x34')]?_0x19e4cc[_0x1ee1('0x32')]:_0x576bf4['model'];if(!_0x1a2246[_0x1ee1('0x2f')][_0x1ee1('0x35')](_0x1ee1('0x36'))){_0x19e4cc['limit']=qs[_0x1ee1('0x1d')](_0x1a2246[_0x1ee1('0x2f')][_0x1ee1('0x1d')]);_0x19e4cc[_0x1ee1('0x20')]=qs[_0x1ee1('0x20')](_0x1a2246[_0x1ee1('0x2f')][_0x1ee1('0x20')]);}_0x19e4cc[_0x1ee1('0x37')]=qs[_0x1ee1('0x38')](_0x1a2246[_0x1ee1('0x2f')][_0x1ee1('0x38')]);_0x19e4cc[_0x1ee1('0x39')]=qs[_0x1ee1('0x3a')](_[_0x1ee1('0x3b')](_0x1a2246[_0x1ee1('0x2f')],_0x576bf4[_0x1ee1('0x3a')]),_0x153731);if(_0x1a2246[_0x1ee1('0x2f')][_0x1ee1('0x3c')]){_0x19e4cc[_0x1ee1('0x39')]=_[_0x1ee1('0x3d')](_0x19e4cc[_0x1ee1('0x39')],{'$or':_[_0x1ee1('0x2e')](_0x153731,function(_0x493e0c){if(_0x493e0c[_0x1ee1('0x2d')]!==_0x1ee1('0x3e')){var _0x2e68da={};_0x2e68da[_0x493e0c[_0x1ee1('0x28')]]={'$like':'%'+_0x1a2246[_0x1ee1('0x2f')][_0x1ee1('0x3c')]+'%'};return _0x2e68da;}})});}_0x19e4cc=_[_0x1ee1('0x3d')]({},_0x19e4cc,_0x1a2246[_0x1ee1('0x3f')]);var _0x40eea2={'where':_0x19e4cc[_0x1ee1('0x39')]};return db[_0x1ee1('0x40')][_0x1ee1('0x1f')](_0x40eea2)['then'](function(_0x3e5e90){_0x1fab9d[_0x1ee1('0x1f')]=_0x3e5e90;if(_0x1a2246[_0x1ee1('0x2f')][_0x1ee1('0x41')]){_0x19e4cc[_0x1ee1('0x42')]=[{'all':!![]}];}return db[_0x1ee1('0x40')][_0x1ee1('0x43')](_0x19e4cc);})['then'](function(_0x3df247){_0x1fab9d[_0x1ee1('0x44')]=_0x3df247;return _0x1fab9d;})['then'](respondWithFilteredResult(_0x551e9d,_0x19e4cc))[_0x1ee1('0x45')](handleError(_0x551e9d,null));};exports['show']=function(_0x5254dd,_0xf6708c){var _0x4db4ef={'raw':!![],'where':{'id':_0x5254dd[_0x1ee1('0x46')]['id']}},_0x5cc8a1={};_0x5cc8a1[_0x1ee1('0x33')]=_[_0x1ee1('0x30')](db[_0x1ee1('0x40')][_0x1ee1('0x2b')]);_0x5cc8a1['query']=_['keys'](_0x5254dd[_0x1ee1('0x2f')]);_0x5cc8a1[_0x1ee1('0x3a')]=_[_0x1ee1('0x31')](_0x5cc8a1[_0x1ee1('0x33')],_0x5cc8a1[_0x1ee1('0x2f')]);_0x4db4ef[_0x1ee1('0x32')]=_[_0x1ee1('0x31')](_0x5cc8a1['model'],qs[_0x1ee1('0x47')](_0x5254dd['query'][_0x1ee1('0x47')]));_0x4db4ef[_0x1ee1('0x32')]=_0x4db4ef[_0x1ee1('0x32')][_0x1ee1('0x34')]?_0x4db4ef[_0x1ee1('0x32')]:_0x5cc8a1[_0x1ee1('0x33')];if(_0x5254dd[_0x1ee1('0x2f')][_0x1ee1('0x41')]){_0x4db4ef[_0x1ee1('0x42')]=[{'all':!![]}];}_0x4db4ef=_[_0x1ee1('0x3d')]({},_0x4db4ef,_0x5254dd['options']);return db[_0x1ee1('0x40')][_0x1ee1('0x48')](_0x4db4ef)[_0x1ee1('0x25')](handleEntityNotFound(_0xf6708c,null))['then'](respondWithResult(_0xf6708c,null))[_0x1ee1('0x45')](handleError(_0xf6708c,null));};exports[_0x1ee1('0x49')]=function(_0x2112ae,_0x4f965d){return db[_0x1ee1('0x40')][_0x1ee1('0x49')](_0x2112ae[_0x1ee1('0x4a')],{})[_0x1ee1('0x25')](respondWithResult(_0x4f965d,0xc9))['catch'](handleError(_0x4f965d,null));};exports[_0x1ee1('0x24')]=function(_0x4c46e4,_0x12edad){if(_0x4c46e4[_0x1ee1('0x4a')]['id']){delete _0x4c46e4['body']['id'];}return db['FaxQueueReport'][_0x1ee1('0x48')]({'where':{'id':_0x4c46e4[_0x1ee1('0x46')]['id']}})[_0x1ee1('0x25')](handleEntityNotFound(_0x12edad,null))[_0x1ee1('0x25')](saveUpdates(_0x4c46e4['body'],null))[_0x1ee1('0x25')](respondWithResult(_0x12edad,null))[_0x1ee1('0x45')](handleError(_0x12edad,null));};exports['destroy']=function(_0x1e0682,_0x345991){return db[_0x1ee1('0x40')][_0x1ee1('0x48')]({'where':{'id':_0x1e0682[_0x1ee1('0x46')]['id']}})[_0x1ee1('0x25')](handleEntityNotFound(_0x345991,null))['then'](removeEntity(_0x345991,null))[_0x1ee1('0x45')](handleError(_0x345991,null));};exports[_0x1ee1('0x4b')]=function(_0x40b8ff,_0x223893){return db[_0x1ee1('0x40')][_0x1ee1('0x4b')]()['then'](respondWithResult(_0x223893,null))['catch'](handleError(_0x223893,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index e6207c7..e5a1d08 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 _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x4b1538,_0x2dc79f){var _0x1be75d=function(_0x46774){while(--_0x46774){_0x4b1538['push'](_0x4b1538['shift']());}};_0x1be75d(++_0x2dc79f);}(_0xf494,0x1c6));var _0x4f49=function(_0x3cf7f8,_0x3717c4){_0x3cf7f8=_0x3cf7f8-0x0;var _0x17d182=_0xf494[_0x3cf7f8];return _0x17d182;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x1cb9,0x14e));var _0x91cb=function(_0x380a7a,_0x25020d){_0x380a7a=_0x380a7a-0x0;var _0x52e464=_0x1cb9[_0x380a7a];return _0x52e464;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index ba61ddc..a91fd9a 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 _0x73e2=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','then','UpdateFaxQueueReport','update','where','attributes','limit'];(function(_0x7654fe,_0x289dc4){var _0xdc7041=function(_0x158e02){while(--_0x158e02){_0x7654fe['push'](_0x7654fe['shift']());}};_0xdc7041(++_0x289dc4);}(_0x73e2,0x1b0));var _0x273e=function(_0x53a7ad,_0x87f9e7){_0x53a7ad=_0x53a7ad-0x0;var _0x5787cf=_0x73e2[_0x53a7ad];return _0x5787cf;};'use strict';var _=require(_0x273e('0x0'));var util=require(_0x273e('0x1'));var moment=require(_0x273e('0x2'));var BPromise=require(_0x273e('0x3'));var rs=require(_0x273e('0x4'));var fs=require('fs');var Redis=require(_0x273e('0x5'));var db=require(_0x273e('0x6'))['db'];var utils=require(_0x273e('0x7'));var logger=require(_0x273e('0x8'))(_0x273e('0x9'));var config=require(_0x273e('0xa'));var jayson=require(_0x273e('0xb'));var client=jayson[_0x273e('0xc')][_0x273e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3c2e91,_0x4ccfa7,_0x3e090a){return new BPromise(function(_0x232e8f,_0x10d0cc){return client[_0x273e('0xe')](_0x3c2e91,_0x3e090a)['then'](function(_0x36dfd0){logger[_0x273e('0xf')](_0x273e('0x10'),_0x4ccfa7,'request\x20sent');logger[_0x273e('0x11')](_0x273e('0x12'),_0x4ccfa7,_0x273e('0x13'),JSON[_0x273e('0x14')](_0x36dfd0));if(_0x36dfd0['error']){if(_0x36dfd0[_0x273e('0x15')]['code']===0x1f4){logger[_0x273e('0x15')](_0x273e('0x10'),_0x4ccfa7,_0x36dfd0[_0x273e('0x15')][_0x273e('0x16')]);return _0x10d0cc(_0x36dfd0[_0x273e('0x15')][_0x273e('0x16')]);}logger[_0x273e('0x15')](_0x273e('0x10'),_0x4ccfa7,_0x36dfd0['error'][_0x273e('0x16')]);return _0x232e8f(_0x36dfd0[_0x273e('0x15')][_0x273e('0x16')]);}else{logger[_0x273e('0xf')](_0x273e('0x10'),_0x4ccfa7,_0x273e('0x13'));_0x232e8f(_0x36dfd0[_0x273e('0x17')]['message']);}})[_0x273e('0x18')](function(_0x4adffc){logger[_0x273e('0x15')](_0x273e('0x10'),_0x4ccfa7,_0x4adffc);_0x10d0cc(_0x4adffc);});});}exports[_0x273e('0x19')]=function(_0x453ed1){var _0x3b1092=this;return new Promise(function(_0x55c2b3,_0x4aeeb4){return db[_0x273e('0x1a')]['create'](_0x453ed1[_0x273e('0x1b')],{'raw':_0x453ed1[_0x273e('0x1c')]?_0x453ed1[_0x273e('0x1c')][_0x273e('0x1d')]===undefined?!![]:![]:!![]})[_0x273e('0x1e')](function(_0x8f4356){logger[_0x273e('0xf')](_0x273e('0x19'),_0x453ed1);logger[_0x273e('0x11')](_0x273e('0x19'),_0x453ed1,JSON[_0x273e('0x14')](_0x8f4356));_0x55c2b3(_0x8f4356);})[_0x273e('0x18')](function(_0x188b2e){logger[_0x273e('0x15')](_0x273e('0x19'),_0x188b2e[_0x273e('0x16')],_0x453ed1);_0x4aeeb4(_0x3b1092[_0x273e('0x15')](0x1f4,_0x188b2e[_0x273e('0x16')]));});});};exports[_0x273e('0x1f')]=function(_0x5e7b63){var _0x5e01a3=this;return new Promise(function(_0x1f7b3b,_0xdb7a2a){return db[_0x273e('0x1a')][_0x273e('0x20')](_0x5e7b63['body'],{'raw':_0x5e7b63[_0x273e('0x1c')]?_0x5e7b63[_0x273e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e7b63[_0x273e('0x1c')]?_0x5e7b63[_0x273e('0x1c')][_0x273e('0x21')]||null:null,'attributes':_0x5e7b63['options']?_0x5e7b63[_0x273e('0x1c')][_0x273e('0x22')]||null:null,'limit':_0x5e7b63[_0x273e('0x1c')]?_0x5e7b63[_0x273e('0x1c')][_0x273e('0x23')]||null:null})[_0x273e('0x1e')](function(_0x330c20){logger[_0x273e('0xf')](_0x273e('0x1f'),_0x5e7b63);logger[_0x273e('0x11')](_0x273e('0x1f'),_0x5e7b63,JSON['stringify'](_0x330c20));_0x1f7b3b(_0x330c20);})['catch'](function(_0x33a920){logger[_0x273e('0x15')](_0x273e('0x1f'),_0x33a920['message'],_0x5e7b63);_0xdb7a2a(_0x5e01a3['error'](0x1f4,_0x33a920[_0x273e('0x16')]));});});}; \ No newline at end of file +var _0xfb0d=['info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','where','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x3f9737,_0x544093){var _0x4aba9b=function(_0x5306e3){while(--_0x5306e3){_0x3f9737['push'](_0x3f9737['shift']());}};_0x4aba9b(++_0x544093);}(_0xfb0d,0x15e));var _0xdfb0=function(_0x4a22fa,_0x402d53){_0x4a22fa=_0x4a22fa-0x0;var _0x384e5c=_0xfb0d[_0x4a22fa];return _0x384e5c;};'use strict';var _=require(_0xdfb0('0x0'));var util=require(_0xdfb0('0x1'));var moment=require(_0xdfb0('0x2'));var BPromise=require(_0xdfb0('0x3'));var rs=require(_0xdfb0('0x4'));var fs=require('fs');var Redis=require(_0xdfb0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdfb0('0x6'));var logger=require(_0xdfb0('0x7'))(_0xdfb0('0x8'));var config=require(_0xdfb0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdfb0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56184c,_0x3f233a,_0x2e92e0){return new BPromise(function(_0x4cbd0d,_0x153744){return client[_0xdfb0('0xb')](_0x56184c,_0x2e92e0)[_0xdfb0('0xc')](function(_0x135a56){logger[_0xdfb0('0xd')](_0xdfb0('0xe'),_0x3f233a,_0xdfb0('0xf'));logger[_0xdfb0('0x10')](_0xdfb0('0x11'),_0x3f233a,_0xdfb0('0xf'),JSON[_0xdfb0('0x12')](_0x135a56));if(_0x135a56[_0xdfb0('0x13')]){if(_0x135a56['error'][_0xdfb0('0x14')]===0x1f4){logger['error'](_0xdfb0('0xe'),_0x3f233a,_0x135a56['error'][_0xdfb0('0x15')]);return _0x153744(_0x135a56['error'][_0xdfb0('0x15')]);}logger[_0xdfb0('0x13')](_0xdfb0('0xe'),_0x3f233a,_0x135a56[_0xdfb0('0x13')]['message']);return _0x4cbd0d(_0x135a56[_0xdfb0('0x13')]['message']);}else{logger[_0xdfb0('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x3f233a,_0xdfb0('0xf'));_0x4cbd0d(_0x135a56[_0xdfb0('0x16')][_0xdfb0('0x15')]);}})[_0xdfb0('0x17')](function(_0x4321ff){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x3f233a,_0x4321ff);_0x153744(_0x4321ff);});});}exports[_0xdfb0('0x18')]=function(_0x2c8b99){var _0x84dcd9=this;return new Promise(function(_0x2a6f0a,_0x3c3806){return db[_0xdfb0('0x19')][_0xdfb0('0x1a')](_0x2c8b99[_0xdfb0('0x1b')],{'raw':_0x2c8b99[_0xdfb0('0x1c')]?_0x2c8b99[_0xdfb0('0x1c')][_0xdfb0('0x1d')]===undefined?!![]:![]:!![]})[_0xdfb0('0xc')](function(_0x1c8112){logger[_0xdfb0('0xd')]('CreateFaxQueueReport',_0x2c8b99);logger['debug']('CreateFaxQueueReport',_0x2c8b99,JSON[_0xdfb0('0x12')](_0x1c8112));_0x2a6f0a(_0x1c8112);})[_0xdfb0('0x17')](function(_0x17e4ab){logger[_0xdfb0('0x13')](_0xdfb0('0x18'),_0x17e4ab['message'],_0x2c8b99);_0x3c3806(_0x84dcd9[_0xdfb0('0x13')](0x1f4,_0x17e4ab[_0xdfb0('0x15')]));});});};exports['UpdateFaxQueueReport']=function(_0x4a6849){var _0x411664=this;return new Promise(function(_0x606c74,_0x38b64e){return db[_0xdfb0('0x19')]['update'](_0x4a6849['body'],{'raw':_0x4a6849[_0xdfb0('0x1c')]?_0x4a6849['options'][_0xdfb0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a6849[_0xdfb0('0x1c')]?_0x4a6849[_0xdfb0('0x1c')][_0xdfb0('0x1e')]||null:null,'attributes':_0x4a6849[_0xdfb0('0x1c')]?_0x4a6849[_0xdfb0('0x1c')]['attributes']||null:null,'limit':_0x4a6849[_0xdfb0('0x1c')]?_0x4a6849[_0xdfb0('0x1c')][_0xdfb0('0x1f')]||null:null})[_0xdfb0('0xc')](function(_0x5b1b54){logger['info'](_0xdfb0('0x20'),_0x4a6849);logger['debug'](_0xdfb0('0x20'),_0x4a6849,JSON[_0xdfb0('0x12')](_0x5b1b54));_0x606c74(_0x5b1b54);})[_0xdfb0('0x17')](function(_0x3fb8ac){logger[_0xdfb0('0x13')](_0xdfb0('0x20'),_0x3fb8ac[_0xdfb0('0x15')],_0x4a6849);_0x38b64e(_0x411664[_0xdfb0('0x13')](0x1f4,_0x3fb8ac[_0xdfb0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index cdb336b..d976f87 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 _0xdd68=['post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id'];(function(_0x3560cd,_0x23491a){var _0x1c1513=function(_0x5081dd){while(--_0x5081dd){_0x3560cd['push'](_0x3560cd['shift']());}};_0x1c1513(++_0x23491a);}(_0xdd68,0x11d));var _0x8dd6=function(_0x30f07a,_0x98341){_0x30f07a=_0x30f07a-0x0;var _0xb38461=_0xdd68[_0x30f07a];return _0xb38461;};'use strict';var multer=require(_0x8dd6('0x0'));var util=require(_0x8dd6('0x1'));var path=require(_0x8dd6('0x2'));var timeout=require(_0x8dd6('0x3'));var express=require(_0x8dd6('0x4'));var router=express[_0x8dd6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8dd6('0x6'));var interaction=require(_0x8dd6('0x7'));var config=require('../../config/environment');var controller=require(_0x8dd6('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8dd6('0x9')]);router[_0x8dd6('0xa')](_0x8dd6('0xb'),auth[_0x8dd6('0xc')](),controller[_0x8dd6('0xd')]);router[_0x8dd6('0xa')](_0x8dd6('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x8dd6('0xf')]('/',auth[_0x8dd6('0xc')](),controller[_0x8dd6('0x10')]);router[_0x8dd6('0x11')](_0x8dd6('0xe'),auth[_0x8dd6('0xc')](),controller[_0x8dd6('0x12')]);router['delete']('/:id',auth[_0x8dd6('0xc')](),controller['destroy']);module[_0x8dd6('0x13')]=router; \ No newline at end of file +var _0xddba=['post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','describe','show'];(function(_0x147ec8,_0xdf1459){var _0x5de7f1=function(_0x1c6e1e){while(--_0x1c6e1e){_0x147ec8['push'](_0x147ec8['shift']());}};_0x5de7f1(++_0xdf1459);}(_0xddba,0x66));var _0xaddb=function(_0x27831b,_0x4db2a1){_0x27831b=_0x27831b-0x0;var _0x2d2219=_0xddba[_0x27831b];return _0x2d2219;};'use strict';var multer=require(_0xaddb('0x0'));var util=require(_0xaddb('0x1'));var path=require('path');var timeout=require(_0xaddb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xaddb('0x3'));var auth=require(_0xaddb('0x4'));var interaction=require(_0xaddb('0x5'));var config=require(_0xaddb('0x6'));var controller=require(_0xaddb('0x7'));router[_0xaddb('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xaddb('0x8')]('/describe',auth[_0xaddb('0x9')](),controller[_0xaddb('0xa')]);router['get']('/:id',auth[_0xaddb('0x9')](),controller[_0xaddb('0xb')]);router[_0xaddb('0xc')]('/',auth[_0xaddb('0x9')](),controller[_0xaddb('0xd')]);router[_0xaddb('0xe')]('/:id',auth[_0xaddb('0x9')](),controller[_0xaddb('0xf')]);router[_0xaddb('0x10')]('/:id',auth[_0xaddb('0x9')](),controller[_0xaddb('0x11')]);module[_0xaddb('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index bfb14be..b59a2c2 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2cd9e8,_0x3520ed){var _0x2f712f=function(_0x769f94){while(--_0x769f94){_0x2cd9e8['push'](_0x2cd9e8['shift']());}};_0x2f712f(++_0x3520ed);}(_0x54ef,0x112));var _0xf54e=function(_0x1114b3,_0x5ce9d4){_0x1114b3=_0x1114b3-0x0;var _0x3e053d=_0x54ef[_0x1114b3];return _0x3e053d;};'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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x212960,_0x520f14){var _0x4f5a8a=function(_0x5e40c5){while(--_0x5e40c5){_0x212960['push'](_0x212960['shift']());}};_0x4f5a8a(++_0x520f14);}(_0x34e8,0x12c));var _0x834e=function(_0x92d80f,_0x1f3bc4){_0x92d80f=_0x92d80f-0x0;var _0x732cb2=_0x34e8[_0x92d80f];return _0x732cb2;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index dbefe09..eb50863 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 _0xa57b=['sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','FaxTransferReport','key','model','query','keys','intersection','attributes','fields','length','order','pick','filters','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa57b,0x19e));var _0xba57=function(_0x17338e,_0x3c99bd){_0x17338e=_0x17338e-0x0;var _0x28290a=_0xa57b[_0x17338e];return _0x28290a;};'use strict';var emlformat=require(_0xba57('0x0'));var rimraf=require(_0xba57('0x1'));var zipdir=require(_0xba57('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba57('0x3'));var moment=require(_0xba57('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xba57('0x5'));var util=require(_0xba57('0x6'));var path=require(_0xba57('0x7'));var sox=require('sox');var csv=require(_0xba57('0x8'));var ejs=require(_0xba57('0x9'));var fs=require('fs');var fs_extra=require(_0xba57('0xa'));var _=require(_0xba57('0xb'));var squel=require(_0xba57('0xc'));var crypto=require(_0xba57('0xd'));var jsforce=require(_0xba57('0xe'));var deskjs=require(_0xba57('0xf'));var toCsv=require(_0xba57('0x8'));var querystring=require(_0xba57('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xba57('0x11'));var qs=require(_0xba57('0x12'));var as=require(_0xba57('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba57('0x14'))('api');var utils=require(_0xba57('0x15'));var config=require(_0xba57('0x16'));var licenseUtil=require(_0xba57('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2671a5,_0xb17e63){_0xb17e63=_0xb17e63||0xcc;return function(_0x3388fa){if(_0x3388fa){return _0x2671a5[_0xba57('0x18')](_0xb17e63);}return _0x2671a5[_0xba57('0x19')](_0xb17e63)[_0xba57('0x1a')]();};}function respondWithResult(_0x110840,_0x2eb4ea){_0x2eb4ea=_0x2eb4ea||0xc8;return function(_0x1003e4){if(_0x1003e4){return _0x110840[_0xba57('0x19')](_0x2eb4ea)[_0xba57('0x1b')](_0x1003e4);}};}function respondWithFilteredResult(_0x1a5a80,_0x5baa08){return function(_0x2ac245){if(_0x2ac245){var _0x274b23=typeof _0x5baa08[_0xba57('0x1c')]===_0xba57('0x1d')&&typeof _0x5baa08[_0xba57('0x1e')]==='undefined';var _0x1b6fc5=_0x2ac245[_0xba57('0x1f')];var _0x57f7dd=_0x274b23?0x0:_0x5baa08['offset'];var _0x4b0933=_0x274b23?_0x2ac245[_0xba57('0x1f')]:_0x5baa08['offset']+_0x5baa08[_0xba57('0x1e')];var _0x4b4eba;if(_0x4b0933>=_0x1b6fc5){_0x4b0933=_0x1b6fc5;_0x4b4eba=0xc8;}else{_0x4b4eba=0xce;}_0x1a5a80[_0xba57('0x19')](_0x4b4eba);return _0x1a5a80[_0xba57('0x20')]('Content-Range',_0x57f7dd+'-'+_0x4b0933+'/'+_0x1b6fc5)[_0xba57('0x1b')](_0x2ac245);}return null;};}function patchUpdates(_0x32ae87){return function(_0x533254){try{jsonpatch[_0xba57('0x21')](_0x533254,_0x32ae87,!![]);}catch(_0x4bc81f){return BPromise[_0xba57('0x22')](_0x4bc81f);}return _0x533254[_0xba57('0x23')]();};}function saveUpdates(_0x226be6,_0x30915c){return function(_0x284fb2){if(_0x284fb2){return _0x284fb2[_0xba57('0x24')](_0x226be6)[_0xba57('0x25')](function(_0x46ffb8){return _0x46ffb8;});}return null;};}function removeEntity(_0x381c04,_0x1a5f61){return function(_0x2f14a1){if(_0x2f14a1){return _0x2f14a1[_0xba57('0x26')]()[_0xba57('0x25')](function(){_0x381c04[_0xba57('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x329c96,_0x22d38c){return function(_0x1c7d92){if(!_0x1c7d92){_0x329c96[_0xba57('0x18')](0x194);}return _0x1c7d92;};}function handleError(_0x399893,_0x84d5a0){_0x84d5a0=_0x84d5a0||0x1f4;return function(_0x4f8f25){logger['error'](_0x4f8f25[_0xba57('0x27')]);if(_0x4f8f25['name']){delete _0x4f8f25[_0xba57('0x28')];}_0x399893[_0xba57('0x19')](_0x84d5a0)[_0xba57('0x29')](_0x4f8f25);};}exports[_0xba57('0x2a')]=function(_0x54eda4,_0x4758d2){var _0xb1d5da={},_0x4e26cc={},_0x2424ae={'count':0x0,'rows':[]};var _0x17da3b=_[_0xba57('0x2b')](db[_0xba57('0x2c')]['rawAttributes'],function(_0x2b32a1){return{'name':_0x2b32a1['fieldName'],'type':_0x2b32a1['type'][_0xba57('0x2d')]};});_0x4e26cc[_0xba57('0x2e')]=_['map'](_0x17da3b,'name');_0x4e26cc[_0xba57('0x2f')]=_[_0xba57('0x30')](_0x54eda4[_0xba57('0x2f')]);_0x4e26cc['filters']=_[_0xba57('0x31')](_0x4e26cc[_0xba57('0x2e')],_0x4e26cc['query']);_0xb1d5da[_0xba57('0x32')]=_[_0xba57('0x31')](_0x4e26cc[_0xba57('0x2e')],qs[_0xba57('0x33')](_0x54eda4[_0xba57('0x2f')]['fields']));_0xb1d5da[_0xba57('0x32')]=_0xb1d5da['attributes'][_0xba57('0x34')]?_0xb1d5da[_0xba57('0x32')]:_0x4e26cc[_0xba57('0x2e')];if(!_0x54eda4[_0xba57('0x2f')]['hasOwnProperty']('nolimit')){_0xb1d5da[_0xba57('0x1e')]=qs[_0xba57('0x1e')](_0x54eda4[_0xba57('0x2f')]['limit']);_0xb1d5da['offset']=qs['offset'](_0x54eda4[_0xba57('0x2f')]['offset']);}_0xb1d5da[_0xba57('0x35')]=qs['sort'](_0x54eda4[_0xba57('0x2f')]['sort']);_0xb1d5da['where']=qs['filters'](_[_0xba57('0x36')](_0x54eda4[_0xba57('0x2f')],_0x4e26cc[_0xba57('0x37')]),_0x17da3b);if(_0x54eda4[_0xba57('0x2f')]['filter']){_0xb1d5da['where']=_[_0xba57('0x38')](_0xb1d5da[_0xba57('0x39')],{'$or':_[_0xba57('0x2b')](_0x17da3b,function(_0x52f7e1){if(_0x52f7e1[_0xba57('0x3a')]!==_0xba57('0x3b')){var _0xc0b0ec={};_0xc0b0ec[_0x52f7e1[_0xba57('0x28')]]={'$like':'%'+_0x54eda4[_0xba57('0x2f')]['filter']+'%'};return _0xc0b0ec;}})});}_0xb1d5da=_[_0xba57('0x38')]({},_0xb1d5da,_0x54eda4[_0xba57('0x3c')]);var _0xa23aa7={'where':_0xb1d5da['where']};return db[_0xba57('0x2c')]['count'](_0xa23aa7)['then'](function(_0x412c1f){_0x2424ae['count']=_0x412c1f;if(_0x54eda4[_0xba57('0x2f')][_0xba57('0x3d')]){_0xb1d5da[_0xba57('0x3e')]=[{'all':!![]}];}return db[_0xba57('0x2c')][_0xba57('0x3f')](_0xb1d5da);})['then'](function(_0x5201cc){_0x2424ae[_0xba57('0x40')]=_0x5201cc;return _0x2424ae;})[_0xba57('0x25')](respondWithFilteredResult(_0x4758d2,_0xb1d5da))['catch'](handleError(_0x4758d2,null));};exports[_0xba57('0x41')]=function(_0x3ac188,_0x28ce19){var _0x42b8dd={'raw':!![],'where':{'id':_0x3ac188[_0xba57('0x42')]['id']}},_0x172806={};_0x172806[_0xba57('0x2e')]=_[_0xba57('0x30')](db['FaxTransferReport'][_0xba57('0x43')]);_0x172806[_0xba57('0x2f')]=_['keys'](_0x3ac188['query']);_0x172806[_0xba57('0x37')]=_[_0xba57('0x31')](_0x172806[_0xba57('0x2e')],_0x172806['query']);_0x42b8dd[_0xba57('0x32')]=_[_0xba57('0x31')](_0x172806[_0xba57('0x2e')],qs[_0xba57('0x33')](_0x3ac188[_0xba57('0x2f')][_0xba57('0x33')]));_0x42b8dd[_0xba57('0x32')]=_0x42b8dd[_0xba57('0x32')]['length']?_0x42b8dd[_0xba57('0x32')]:_0x172806[_0xba57('0x2e')];if(_0x3ac188[_0xba57('0x2f')]['includeAll']){_0x42b8dd[_0xba57('0x3e')]=[{'all':!![]}];}_0x42b8dd=_[_0xba57('0x38')]({},_0x42b8dd,_0x3ac188[_0xba57('0x3c')]);return db['FaxTransferReport'][_0xba57('0x44')](_0x42b8dd)['then'](handleEntityNotFound(_0x28ce19,null))['then'](respondWithResult(_0x28ce19,null))[_0xba57('0x45')](handleError(_0x28ce19,null));};exports[_0xba57('0x46')]=function(_0x18922d,_0x28d913){return db[_0xba57('0x2c')][_0xba57('0x46')](_0x18922d[_0xba57('0x47')],{})[_0xba57('0x25')](respondWithResult(_0x28d913,0xc9))['catch'](handleError(_0x28d913,null));};exports[_0xba57('0x24')]=function(_0x4932d6,_0x295ded){if(_0x4932d6[_0xba57('0x47')]['id']){delete _0x4932d6[_0xba57('0x47')]['id'];}return db['FaxTransferReport'][_0xba57('0x44')]({'where':{'id':_0x4932d6[_0xba57('0x42')]['id']}})[_0xba57('0x25')](handleEntityNotFound(_0x295ded,null))['then'](saveUpdates(_0x4932d6[_0xba57('0x47')],null))[_0xba57('0x25')](respondWithResult(_0x295ded,null))[_0xba57('0x45')](handleError(_0x295ded,null));};exports['destroy']=function(_0xdfbfa2,_0xbcafd4){return db[_0xba57('0x2c')][_0xba57('0x44')]({'where':{'id':_0xdfbfa2[_0xba57('0x42')]['id']}})[_0xba57('0x25')](handleEntityNotFound(_0xbcafd4,null))[_0xba57('0x25')](removeEntity(_0xbcafd4,null))[_0xba57('0x45')](handleError(_0xbcafd4,null));};exports[_0xba57('0x48')]=function(_0x1ed9f8,_0x307224){return db[_0xba57('0x2c')][_0xba57('0x48')]()[_0xba57('0x25')](respondWithResult(_0x307224,null))[_0xba57('0x45')](handleError(_0x307224,null));}; \ No newline at end of file +var _0x68b6=['rows','catch','show','keys','options','find','create','body','params','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','FaxTransferReport','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x68b6,0xe1));var _0x668b=function(_0x3904f3,_0x3e251f){_0x3904f3=_0x3904f3-0x0;var _0x243ecc=_0x68b6[_0x3904f3];return _0x243ecc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x668b('0x0'));var jsonpatch=require(_0x668b('0x1'));var rp=require(_0x668b('0x2'));var moment=require('moment');var BPromise=require(_0x668b('0x3'));var Mustache=require(_0x668b('0x4'));var util=require(_0x668b('0x5'));var path=require(_0x668b('0x6'));var sox=require('sox');var csv=require(_0x668b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x668b('0x8'));var _=require(_0x668b('0x9'));var squel=require(_0x668b('0xa'));var crypto=require(_0x668b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x668b('0xc'));var Papa=require(_0x668b('0xd'));var Redis=require(_0x668b('0xe'));var authService=require(_0x668b('0xf'));var qs=require(_0x668b('0x10'));var as=require(_0x668b('0x11'));var hardwareService=require(_0x668b('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x668b('0x13'));var licenseUtil=require(_0x668b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57ab20,_0x11e416){_0x11e416=_0x11e416||0xcc;return function(_0x4c07b9){if(_0x4c07b9){return _0x57ab20['sendStatus'](_0x11e416);}return _0x57ab20['status'](_0x11e416)[_0x668b('0x15')]();};}function respondWithResult(_0x1c7535,_0x202734){_0x202734=_0x202734||0xc8;return function(_0x365c49){if(_0x365c49){return _0x1c7535[_0x668b('0x16')](_0x202734)[_0x668b('0x17')](_0x365c49);}};}function respondWithFilteredResult(_0x1ad52c,_0x247d50){return function(_0x3cafac){if(_0x3cafac){var _0x4d7e1a=typeof _0x247d50[_0x668b('0x18')]===_0x668b('0x19')&&typeof _0x247d50['limit']===_0x668b('0x19');var _0x1a9ad2=_0x3cafac['count'];var _0x16e2b9=_0x4d7e1a?0x0:_0x247d50[_0x668b('0x18')];var _0xe7c04=_0x4d7e1a?_0x3cafac[_0x668b('0x1a')]:_0x247d50[_0x668b('0x18')]+_0x247d50[_0x668b('0x1b')];var _0x11f88d;if(_0xe7c04>=_0x1a9ad2){_0xe7c04=_0x1a9ad2;_0x11f88d=0xc8;}else{_0x11f88d=0xce;}_0x1ad52c[_0x668b('0x16')](_0x11f88d);return _0x1ad52c[_0x668b('0x1c')](_0x668b('0x1d'),_0x16e2b9+'-'+_0xe7c04+'/'+_0x1a9ad2)['json'](_0x3cafac);}return null;};}function patchUpdates(_0x528312){return function(_0x5f304c){try{jsonpatch[_0x668b('0x1e')](_0x5f304c,_0x528312,!![]);}catch(_0x563efb){return BPromise[_0x668b('0x1f')](_0x563efb);}return _0x5f304c[_0x668b('0x20')]();};}function saveUpdates(_0x5b9cc6,_0x5e641f){return function(_0x99b454){if(_0x99b454){return _0x99b454[_0x668b('0x21')](_0x5b9cc6)[_0x668b('0x22')](function(_0x4a7fc1){return _0x4a7fc1;});}return null;};}function removeEntity(_0x5ec880,_0xeed66f){return function(_0x489cc8){if(_0x489cc8){return _0x489cc8[_0x668b('0x23')]()[_0x668b('0x22')](function(){_0x5ec880[_0x668b('0x16')](0xcc)[_0x668b('0x15')]();});}};}function handleEntityNotFound(_0x1e8a50,_0x543d57){return function(_0x3c2dc3){if(!_0x3c2dc3){_0x1e8a50[_0x668b('0x24')](0x194);}return _0x3c2dc3;};}function handleError(_0x1a5386,_0x42ef19){_0x42ef19=_0x42ef19||0x1f4;return function(_0x3e5007){logger['error'](_0x3e5007[_0x668b('0x25')]);if(_0x3e5007['name']){delete _0x3e5007[_0x668b('0x26')];}_0x1a5386['status'](_0x42ef19)[_0x668b('0x27')](_0x3e5007);};}exports[_0x668b('0x28')]=function(_0xc0bb11,_0x1f91de){var _0x180780={},_0x4dcd94={},_0x2dd7dc={'count':0x0,'rows':[]};var _0x3bc5b5=_['map'](db[_0x668b('0x29')][_0x668b('0x2a')],function(_0x162847){return{'name':_0x162847['fieldName'],'type':_0x162847[_0x668b('0x2b')][_0x668b('0x2c')]};});_0x4dcd94[_0x668b('0x2d')]=_['map'](_0x3bc5b5,_0x668b('0x26'));_0x4dcd94[_0x668b('0x2e')]=_['keys'](_0xc0bb11[_0x668b('0x2e')]);_0x4dcd94['filters']=_['intersection'](_0x4dcd94[_0x668b('0x2d')],_0x4dcd94[_0x668b('0x2e')]);_0x180780[_0x668b('0x2f')]=_[_0x668b('0x30')](_0x4dcd94[_0x668b('0x2d')],qs['fields'](_0xc0bb11['query'][_0x668b('0x31')]));_0x180780[_0x668b('0x2f')]=_0x180780['attributes'][_0x668b('0x32')]?_0x180780[_0x668b('0x2f')]:_0x4dcd94['model'];if(!_0xc0bb11[_0x668b('0x2e')][_0x668b('0x33')](_0x668b('0x34'))){_0x180780[_0x668b('0x1b')]=qs[_0x668b('0x1b')](_0xc0bb11[_0x668b('0x2e')][_0x668b('0x1b')]);_0x180780[_0x668b('0x18')]=qs[_0x668b('0x18')](_0xc0bb11[_0x668b('0x2e')]['offset']);}_0x180780[_0x668b('0x35')]=qs[_0x668b('0x36')](_0xc0bb11['query'][_0x668b('0x36')]);_0x180780['where']=qs['filters'](_[_0x668b('0x37')](_0xc0bb11[_0x668b('0x2e')],_0x4dcd94['filters']),_0x3bc5b5);if(_0xc0bb11[_0x668b('0x2e')][_0x668b('0x38')]){_0x180780['where']=_[_0x668b('0x39')](_0x180780[_0x668b('0x3a')],{'$or':_['map'](_0x3bc5b5,function(_0x527354){if(_0x527354[_0x668b('0x2b')]!==_0x668b('0x3b')){var _0x2b5939={};_0x2b5939[_0x527354['name']]={'$like':'%'+_0xc0bb11[_0x668b('0x2e')][_0x668b('0x38')]+'%'};return _0x2b5939;}})});}_0x180780=_[_0x668b('0x39')]({},_0x180780,_0xc0bb11['options']);var _0x1532d1={'where':_0x180780[_0x668b('0x3a')]};return db[_0x668b('0x29')]['count'](_0x1532d1)[_0x668b('0x22')](function(_0x2b9d56){_0x2dd7dc['count']=_0x2b9d56;if(_0xc0bb11['query'][_0x668b('0x3c')]){_0x180780[_0x668b('0x3d')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x668b('0x3e')](_0x180780);})[_0x668b('0x22')](function(_0x1eddc3){_0x2dd7dc[_0x668b('0x3f')]=_0x1eddc3;return _0x2dd7dc;})[_0x668b('0x22')](respondWithFilteredResult(_0x1f91de,_0x180780))[_0x668b('0x40')](handleError(_0x1f91de,null));};exports[_0x668b('0x41')]=function(_0x137cf4,_0x5363b2){var _0x16a206={'raw':!![],'where':{'id':_0x137cf4['params']['id']}},_0x570684={};_0x570684[_0x668b('0x2d')]=_[_0x668b('0x42')](db[_0x668b('0x29')][_0x668b('0x2a')]);_0x570684[_0x668b('0x2e')]=_[_0x668b('0x42')](_0x137cf4[_0x668b('0x2e')]);_0x570684['filters']=_[_0x668b('0x30')](_0x570684[_0x668b('0x2d')],_0x570684[_0x668b('0x2e')]);_0x16a206[_0x668b('0x2f')]=_[_0x668b('0x30')](_0x570684[_0x668b('0x2d')],qs[_0x668b('0x31')](_0x137cf4[_0x668b('0x2e')][_0x668b('0x31')]));_0x16a206[_0x668b('0x2f')]=_0x16a206[_0x668b('0x2f')][_0x668b('0x32')]?_0x16a206[_0x668b('0x2f')]:_0x570684[_0x668b('0x2d')];if(_0x137cf4[_0x668b('0x2e')][_0x668b('0x3c')]){_0x16a206[_0x668b('0x3d')]=[{'all':!![]}];}_0x16a206=_[_0x668b('0x39')]({},_0x16a206,_0x137cf4[_0x668b('0x43')]);return db['FaxTransferReport'][_0x668b('0x44')](_0x16a206)[_0x668b('0x22')](handleEntityNotFound(_0x5363b2,null))[_0x668b('0x22')](respondWithResult(_0x5363b2,null))[_0x668b('0x40')](handleError(_0x5363b2,null));};exports['create']=function(_0x5ad59e,_0x42e4b3){return db['FaxTransferReport'][_0x668b('0x45')](_0x5ad59e[_0x668b('0x46')],{})['then'](respondWithResult(_0x42e4b3,0xc9))[_0x668b('0x40')](handleError(_0x42e4b3,null));};exports[_0x668b('0x21')]=function(_0x6f8143,_0x5de4e8){if(_0x6f8143[_0x668b('0x46')]['id']){delete _0x6f8143[_0x668b('0x46')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x6f8143['params']['id']}})[_0x668b('0x22')](handleEntityNotFound(_0x5de4e8,null))[_0x668b('0x22')](saveUpdates(_0x6f8143[_0x668b('0x46')],null))['then'](respondWithResult(_0x5de4e8,null))[_0x668b('0x40')](handleError(_0x5de4e8,null));};exports['destroy']=function(_0x21ebf6,_0x3a7114){return db[_0x668b('0x29')][_0x668b('0x44')]({'where':{'id':_0x21ebf6[_0x668b('0x47')]['id']}})[_0x668b('0x22')](handleEntityNotFound(_0x3a7114,null))[_0x668b('0x22')](removeEntity(_0x3a7114,null))['catch'](handleError(_0x3a7114,null));};exports['describe']=function(_0x514c3c,_0x43864e){return db[_0x668b('0x29')]['describe']()[_0x668b('0x22')](respondWithResult(_0x43864e,null))[_0x668b('0x40')](handleError(_0x43864e,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 9b00efe..82ab8c1 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 _0xeddd=['../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xeddd,0x1aa));var _0xdedd=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xeddd[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0xdedd('0x0'));var util=require(_0xdedd('0x1'));var logger=require(_0xdedd('0x2'))(_0xdedd('0x3'));var moment=require('moment');var BPromise=require(_0xdedd('0x4'));var rp=require(_0xdedd('0x5'));var fs=require('fs');var path=require(_0xdedd('0x6'));var rimraf=require(_0xdedd('0x7'));var config=require(_0xdedd('0x8'));var attributes=require(_0xdedd('0x9'));module[_0xdedd('0xa')]=function(_0x141384,_0x2e28a8){return _0x141384[_0xdedd('0xb')](_0xdedd('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdedd('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1a3f=['bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxTransferReport','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x49748c,_0x3d2005){var _0xedf6b6=function(_0x11628d){while(--_0x11628d){_0x49748c['push'](_0x49748c['shift']());}};_0xedf6b6(++_0x3d2005);}(_0x1a3f,0x68));var _0xf1a3=function(_0x26cb22,_0x731b49){_0x26cb22=_0x26cb22-0x0;var _0x20cf81=_0x1a3f[_0x26cb22];return _0x20cf81;};'use strict';var _=require(_0xf1a3('0x0'));var util=require('util');var logger=require(_0xf1a3('0x1'))(_0xf1a3('0x2'));var moment=require(_0xf1a3('0x3'));var BPromise=require(_0xf1a3('0x4'));var rp=require(_0xf1a3('0x5'));var fs=require('fs');var path=require(_0xf1a3('0x6'));var rimraf=require(_0xf1a3('0x7'));var config=require(_0xf1a3('0x8'));var attributes=require('./faxTransferReport.attributes');module[_0xf1a3('0x9')]=function(_0x134450,_0xbc4f27){return _0x134450['define'](_0xf1a3('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xf1a3('0xb'),'fields':[_0xf1a3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index b9cbe6a..026928a 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 _0x4265=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4e27d7,_0x125411){var _0x30d620=function(_0x5d990f){while(--_0x5d990f){_0x4e27d7['push'](_0x4e27d7['shift']());}};_0x30d620(++_0x125411);}(_0x4265,0xf9));var _0x5426=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x4265[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x5426('0x0'));var util=require(_0x5426('0x1'));var moment=require(_0x5426('0x2'));var BPromise=require(_0x5426('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5426('0x4'));var db=require(_0x5426('0x5'))['db'];var utils=require(_0x5426('0x6'));var logger=require('../../config/logger')(_0x5426('0x7'));var config=require(_0x5426('0x8'));var jayson=require(_0x5426('0x9'));var client=jayson[_0x5426('0xa')][_0x5426('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a59a9,_0xb3aed1,_0x289abf){return new BPromise(function(_0x35ed37,_0x5500e0){return client[_0x5426('0xc')](_0x5a59a9,_0x289abf)[_0x5426('0xd')](function(_0xdee7eb){logger[_0x5426('0xe')](_0x5426('0xf'),_0xb3aed1,_0x5426('0x10'));logger[_0x5426('0x11')](_0x5426('0x12'),_0xb3aed1,_0x5426('0x10'),JSON[_0x5426('0x13')](_0xdee7eb));if(_0xdee7eb[_0x5426('0x14')]){if(_0xdee7eb[_0x5426('0x14')][_0x5426('0x15')]===0x1f4){logger[_0x5426('0x14')](_0x5426('0xf'),_0xb3aed1,_0xdee7eb[_0x5426('0x14')][_0x5426('0x16')]);return _0x5500e0(_0xdee7eb['error'][_0x5426('0x16')]);}logger[_0x5426('0x14')](_0x5426('0xf'),_0xb3aed1,_0xdee7eb['error'][_0x5426('0x16')]);return _0x35ed37(_0xdee7eb[_0x5426('0x14')][_0x5426('0x16')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0xb3aed1,'request\x20sent');_0x35ed37(_0xdee7eb[_0x5426('0x17')][_0x5426('0x16')]);}})[_0x5426('0x18')](function(_0x3594ed){logger[_0x5426('0x14')](_0x5426('0xf'),_0xb3aed1,_0x3594ed);_0x5500e0(_0x3594ed);});});} \ No newline at end of file +var _0x909d=['stringify','error','code','message','FaxTransferReport,\x20%s,\x20%s','info','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x28ade3,_0x3849b9){var _0x20ca87=function(_0x47515f){while(--_0x47515f){_0x28ade3['push'](_0x28ade3['shift']());}};_0x20ca87(++_0x3849b9);}(_0x909d,0x1eb));var _0xd909=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x909d[_0x599e60];return _0x468e19;};'use strict';var _=require(_0xd909('0x0'));var util=require(_0xd909('0x1'));var moment=require('moment');var BPromise=require(_0xd909('0x2'));var rs=require(_0xd909('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd909('0x4'))['db'];var utils=require(_0xd909('0x5'));var logger=require(_0xd909('0x6'))(_0xd909('0x7'));var config=require(_0xd909('0x8'));var jayson=require(_0xd909('0x9'));var client=jayson[_0xd909('0xa')][_0xd909('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2077d8,_0x620593,_0x5f5b69){return new BPromise(function(_0x35ac3b,_0x40af0d){return client['request'](_0x2077d8,_0x5f5b69)[_0xd909('0xc')](function(_0xdf7025){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x620593,_0xd909('0xd'));logger['debug'](_0xd909('0xe'),_0x620593,'request\x20sent',JSON[_0xd909('0xf')](_0xdf7025));if(_0xdf7025[_0xd909('0x10')]){if(_0xdf7025['error'][_0xd909('0x11')]===0x1f4){logger[_0xd909('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x620593,_0xdf7025[_0xd909('0x10')][_0xd909('0x12')]);return _0x40af0d(_0xdf7025[_0xd909('0x10')][_0xd909('0x12')]);}logger[_0xd909('0x10')](_0xd909('0x13'),_0x620593,_0xdf7025[_0xd909('0x10')][_0xd909('0x12')]);return _0x35ac3b(_0xdf7025[_0xd909('0x10')][_0xd909('0x12')]);}else{logger[_0xd909('0x14')](_0xd909('0x13'),_0x620593,_0xd909('0xd'));_0x35ac3b(_0xdf7025[_0xd909('0x15')][_0xd909('0x12')]);}})['catch'](function(_0x21e94e){logger[_0xd909('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x620593,_0x21e94e);_0x40af0d(_0x21e94e);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index cb3790a..c1231d7 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 _0x5242=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated'];(function(_0x3b46e2,_0x4fe140){var _0x82c62b=function(_0xd37e40){while(--_0xd37e40){_0x3b46e2['push'](_0x3b46e2['shift']());}};_0x82c62b(++_0x4fe140);}(_0x5242,0x16b));var _0x2524=function(_0x57117b,_0x5d357f){_0x57117b=_0x57117b-0x0;var _0x2b87a0=_0x5242[_0x57117b];return _0x2b87a0;};'use strict';var multer=require('multer');var util=require(_0x2524('0x0'));var path=require(_0x2524('0x1'));var timeout=require(_0x2524('0x2'));var express=require(_0x2524('0x3'));var router=express[_0x2524('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2524('0x5'));var interaction=require(_0x2524('0x6'));var config=require(_0x2524('0x7'));var controller=require(_0x2524('0x8'));router[_0x2524('0x9')]('/',auth[_0x2524('0xa')](),controller[_0x2524('0xb')]);router[_0x2524('0x9')](_0x2524('0xc'),auth[_0x2524('0xa')](),controller[_0x2524('0xd')]);router['get'](_0x2524('0xe'),auth[_0x2524('0xa')](),controller[_0x2524('0xf')]);router[_0x2524('0x10')]('/',auth['isAuthenticated'](),controller[_0x2524('0x11')]);router[_0x2524('0x12')](_0x2524('0xe'),auth['isAuthenticated'](),controller[_0x2524('0x13')]);router[_0x2524('0x14')](_0x2524('0xe'),auth['isAuthenticated'](),controller[_0x2524('0x15')]);module['exports']=router; \ No newline at end of file +var _0xc8ac=['get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xc8ac,0x1da));var _0xcc8a=function(_0x3f7598,_0x212e37){_0x3f7598=_0x3f7598-0x0;var _0x51fb16=_0xc8ac[_0x3f7598];return _0x51fb16;};'use strict';var multer=require(_0xcc8a('0x0'));var util=require(_0xcc8a('0x1'));var path=require(_0xcc8a('0x2'));var timeout=require(_0xcc8a('0x3'));var express=require('express');var router=express[_0xcc8a('0x4')]();var fs_extra=require(_0xcc8a('0x5'));var auth=require(_0xcc8a('0x6'));var interaction=require(_0xcc8a('0x7'));var config=require('../../config/environment');var controller=require(_0xcc8a('0x8'));router[_0xcc8a('0x9')]('/',auth[_0xcc8a('0xa')](),controller[_0xcc8a('0xb')]);router['get'](_0xcc8a('0xc'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0xd')]);router[_0xcc8a('0x9')]('/:id',auth[_0xcc8a('0xa')](),controller[_0xcc8a('0xe')]);router[_0xcc8a('0xf')]('/',auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x10')]);router['put'](_0xcc8a('0x11'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x12')]);router[_0xcc8a('0x13')]('/:id',auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index f6faaf4..1976915 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 _0x0540=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x0540,0xf2));var _0x0054=function(_0x2f45c0,_0x338348){_0x2f45c0=_0x2f45c0-0x0;var _0x522eda=_0x0540[_0x2f45c0];return _0x522eda;};'use strict';var multer=require(_0x0054('0x0'));var util=require(_0x0054('0x1'));var path=require(_0x0054('0x2'));var timeout=require(_0x0054('0x3'));var express=require(_0x0054('0x4'));var router=express[_0x0054('0x5')]();var fs_extra=require(_0x0054('0x6'));var auth=require(_0x0054('0x7'));var interaction=require(_0x0054('0x8'));var config=require(_0x0054('0x9'));var controller=require(_0x0054('0xa'));router['get']('/',auth[_0x0054('0xb')](),controller[_0x0054('0xc')]);router[_0x0054('0xd')](_0x0054('0xe'),auth['isAuthenticated'](),controller[_0x0054('0xf')]);router[_0x0054('0xd')](_0x0054('0x10'),auth[_0x0054('0xb')](),controller[_0x0054('0x11')]);router[_0x0054('0xd')](_0x0054('0x12'),auth['isAuthenticated'](),controller[_0x0054('0x13')]);router[_0x0054('0x14')]('/',auth[_0x0054('0xb')](),controller[_0x0054('0x15')]);router[_0x0054('0x14')]('/:id/configurations',auth[_0x0054('0xb')](),controller[_0x0054('0x16')]);router[_0x0054('0x17')](_0x0054('0xe'),auth[_0x0054('0xb')](),controller['update']);router[_0x0054('0x18')](_0x0054('0xe'),auth[_0x0054('0xb')](),controller[_0x0054('0x19')]);module[_0x0054('0x1a')]=router; \ No newline at end of file +var _0xf7f3=['util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','create','post','put','update','delete','destroy','exports','multer'];(function(_0x53efa3,_0x114cfa){var _0x585fea=function(_0x1f386d){while(--_0x1f386d){_0x53efa3['push'](_0x53efa3['shift']());}};_0x585fea(++_0x114cfa);}(_0xf7f3,0x158));var _0x3f7f=function(_0x2222f1,_0x17d5b1){_0x2222f1=_0x2222f1-0x0;var _0x257da9=_0xf7f3[_0x2222f1];return _0x257da9;};'use strict';var multer=require(_0x3f7f('0x0'));var util=require(_0x3f7f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3f7f('0x2'));var router=express['Router']();var fs_extra=require(_0x3f7f('0x3'));var auth=require(_0x3f7f('0x4'));var interaction=require(_0x3f7f('0x5'));var config=require(_0x3f7f('0x6'));var controller=require(_0x3f7f('0x7'));router[_0x3f7f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3f7f('0x9'),auth['isAuthenticated'](),controller[_0x3f7f('0xa')]);router['get'](_0x3f7f('0xb'),auth[_0x3f7f('0xc')](),controller[_0x3f7f('0xd')]);router[_0x3f7f('0x8')](_0x3f7f('0xe'),auth['isAuthenticated'](),controller[_0x3f7f('0xf')]);router['post']('/',auth[_0x3f7f('0xc')](),controller[_0x3f7f('0x10')]);router[_0x3f7f('0x11')](_0x3f7f('0xb'),auth[_0x3f7f('0xc')](),controller['addConfiguration']);router[_0x3f7f('0x12')](_0x3f7f('0x9'),auth[_0x3f7f('0xc')](),controller[_0x3f7f('0x13')]);router[_0x3f7f('0x14')](_0x3f7f('0x9'),auth[_0x3f7f('0xc')](),controller[_0x3f7f('0x15')]);module[_0x3f7f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 133bea3..f7125bd 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 _0x394b=['integrationTab','sequelize','exports','STRING','ENUM','basic','newTab'];(function(_0x268bda,_0x25a2d4){var _0x59882e=function(_0x34ce6b){while(--_0x34ce6b){_0x268bda['push'](_0x268bda['shift']());}};_0x59882e(++_0x25a2d4);}(_0x394b,0xda));var _0xb394=function(_0x35b628,_0x4859d3){_0x35b628=_0x35b628-0x0;var _0x259a43=_0x394b[_0x35b628];return _0x259a43;};'use strict';var Sequelize=require(_0xb394('0x0'));module[_0xb394('0x1')]={'name':{'type':Sequelize[_0xb394('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb394('0x2')]},'authType':{'type':Sequelize[_0xb394('0x3')](_0xb394('0x4')),'defaultValue':_0xb394('0x4')},'password':{'type':Sequelize[_0xb394('0x2')]},'consumerKey':{'type':Sequelize[_0xb394('0x2')]},'consumerSecret':{'type':Sequelize[_0xb394('0x2')]},'token':{'type':Sequelize[_0xb394('0x2')]},'tokenSecret':{'type':Sequelize[_0xb394('0x2')]},'serverUrl':{'type':Sequelize[_0xb394('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb394('0x3')]('integrationTab',_0xb394('0x5')),'defaultValue':_0xb394('0x6')}}; \ No newline at end of file +var _0xf3c3=['sequelize','STRING','ENUM','basic','integrationTab'];(function(_0x3882f5,_0xf7b2c6){var _0x3eb3b2=function(_0x6a3383){while(--_0x6a3383){_0x3882f5['push'](_0x3882f5['shift']());}};_0x3eb3b2(++_0xf7b2c6);}(_0xf3c3,0x69));var _0x3f3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3c3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3f3c('0x0'));module['exports']={'name':{'type':Sequelize[_0x3f3c('0x1')]},'description':{'type':Sequelize[_0x3f3c('0x1')]},'username':{'type':Sequelize[_0x3f3c('0x1')]},'remoteUri':{'type':Sequelize[_0x3f3c('0x1')]},'authType':{'type':Sequelize[_0x3f3c('0x2')](_0x3f3c('0x3')),'defaultValue':_0x3f3c('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x3f3c('0x1')]},'token':{'type':Sequelize[_0x3f3c('0x1')]},'tokenSecret':{'type':Sequelize[_0x3f3c('0x1')]},'serverUrl':{'type':Sequelize[_0x3f3c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3f3c('0x2')]('integrationTab','newTab'),'defaultValue':_0x3f3c('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 067e5b3..c3a508a 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 _0x0bfd=['sort','pick','where','VIRTUAL','filter','merge','DeskAccount','includeAll','include','findAll','catch','show','params','options','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','type','DeskField','Descriptions','priority','authType','username','password','consumerSecret','token','tokenSecret','remoteUri','slice','lastIndexOf','GET','format','%s/custom_fields','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','active','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x1b1390,_0x427bc8){var _0x1cbbef=function(_0x164457){while(--_0x164457){_0x1b1390['push'](_0x1b1390['shift']());}};_0x1cbbef(++_0x427bc8);}(_0x0bfd,0x192));var _0xd0bf=function(_0x26f616,_0x3e8f08){_0x26f616=_0x26f616-0x0;var _0x298682=_0x0bfd[_0x26f616];return _0x298682;};'use strict';var emlformat=require(_0xd0bf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd0bf('0x1'));var rp=require(_0xd0bf('0x2'));var moment=require(_0xd0bf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd0bf('0x4'));var util=require(_0xd0bf('0x5'));var path=require('path');var sox=require(_0xd0bf('0x6'));var csv=require(_0xd0bf('0x7'));var ejs=require(_0xd0bf('0x8'));var fs=require('fs');var fs_extra=require(_0xd0bf('0x9'));var _=require(_0xd0bf('0xa'));var squel=require(_0xd0bf('0xb'));var crypto=require(_0xd0bf('0xc'));var jsforce=require(_0xd0bf('0xd'));var deskjs=require(_0xd0bf('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd0bf('0xf'));var Papa=require('papaparse');var Redis=require(_0xd0bf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd0bf('0x11'));var as=require(_0xd0bf('0x12'));var hardwareService=require(_0xd0bf('0x13'));var logger=require(_0xd0bf('0x14'))('api');var utils=require(_0xd0bf('0x15'));var config=require(_0xd0bf('0x16'));var licenseUtil=require(_0xd0bf('0x17'));var db=require(_0xd0bf('0x18'))['db'];var integrations=require(_0xd0bf('0x19'));function respondWithStatusCode(_0x3a20b6,_0x21fc05){_0x21fc05=_0x21fc05||0xcc;return function(_0x1bf451){if(_0x1bf451){return _0x3a20b6[_0xd0bf('0x1a')](_0x21fc05);}return _0x3a20b6[_0xd0bf('0x1b')](_0x21fc05)[_0xd0bf('0x1c')]();};}function respondWithResult(_0x233627,_0x1e88b6){_0x1e88b6=_0x1e88b6||0xc8;return function(_0x314e16){if(_0x314e16){return _0x233627[_0xd0bf('0x1b')](_0x1e88b6)[_0xd0bf('0x1d')](_0x314e16);}};}function respondWithFilteredResult(_0xd59753,_0x277360){return function(_0x45ca2e){if(_0x45ca2e){var _0x24c922=typeof _0x277360[_0xd0bf('0x1e')]===_0xd0bf('0x1f')&&typeof _0x277360[_0xd0bf('0x20')]===_0xd0bf('0x1f');var _0xa3f205=_0x45ca2e[_0xd0bf('0x21')];var _0x169b27=_0x24c922?0x0:_0x277360['offset'];var _0x25ef72=_0x24c922?_0x45ca2e[_0xd0bf('0x21')]:_0x277360[_0xd0bf('0x1e')]+_0x277360['limit'];var _0x5e747b;if(_0x25ef72>=_0xa3f205){_0x25ef72=_0xa3f205;_0x5e747b=0xc8;}else{_0x5e747b=0xce;}_0xd59753[_0xd0bf('0x1b')](_0x5e747b);return _0xd59753['set'](_0xd0bf('0x22'),_0x169b27+'-'+_0x25ef72+'/'+_0xa3f205)[_0xd0bf('0x1d')](_0x45ca2e);}return null;};}function patchUpdates(_0x48d52c){return function(_0x544d0d){try{jsonpatch[_0xd0bf('0x23')](_0x544d0d,_0x48d52c,!![]);}catch(_0x4180ee){return BPromise[_0xd0bf('0x24')](_0x4180ee);}return _0x544d0d[_0xd0bf('0x25')]();};}function saveUpdates(_0x4f1691,_0x1036b2){return function(_0x592dde){if(_0x592dde){return _0x592dde[_0xd0bf('0x26')](_0x4f1691)[_0xd0bf('0x27')](function(_0x591921){return _0x591921;});}return null;};}function removeEntity(_0x2bf2a5,_0x394546){return function(_0x5e3dfa){if(_0x5e3dfa){return _0x5e3dfa['destroy']()['then'](function(){_0x2bf2a5[_0xd0bf('0x1b')](0xcc)[_0xd0bf('0x1c')]();});}};}function handleEntityNotFound(_0xa6228e,_0xa2765c){return function(_0x930261){if(!_0x930261){_0xa6228e['sendStatus'](0x194);}return _0x930261;};}function handleError(_0x403e6a,_0x248d96){_0x248d96=_0x248d96||0x1f4;return function(_0x49719c){logger['error'](_0x49719c['stack']);if(_0x49719c[_0xd0bf('0x28')]){delete _0x49719c['name'];}_0x403e6a[_0xd0bf('0x1b')](_0x248d96)[_0xd0bf('0x29')](_0x49719c);};}exports[_0xd0bf('0x2a')]=function(_0x3f6c6f,_0x3f1099){var _0x59f3bf={},_0x29c3ce={},_0x5d8036={'count':0x0,'rows':[]};var _0x4c5a07=_[_0xd0bf('0x2b')](db['DeskAccount'][_0xd0bf('0x2c')],function(_0x523a6f){return{'name':_0x523a6f[_0xd0bf('0x2d')],'type':_0x523a6f['type'][_0xd0bf('0x2e')]};});_0x29c3ce[_0xd0bf('0x2f')]=_[_0xd0bf('0x2b')](_0x4c5a07,_0xd0bf('0x28'));_0x29c3ce['query']=_[_0xd0bf('0x30')](_0x3f6c6f[_0xd0bf('0x31')]);_0x29c3ce[_0xd0bf('0x32')]=_[_0xd0bf('0x33')](_0x29c3ce[_0xd0bf('0x2f')],_0x29c3ce[_0xd0bf('0x31')]);_0x59f3bf[_0xd0bf('0x34')]=_['intersection'](_0x29c3ce[_0xd0bf('0x2f')],qs[_0xd0bf('0x35')](_0x3f6c6f[_0xd0bf('0x31')]['fields']));_0x59f3bf['attributes']=_0x59f3bf[_0xd0bf('0x34')][_0xd0bf('0x36')]?_0x59f3bf[_0xd0bf('0x34')]:_0x29c3ce['model'];if(!_0x3f6c6f[_0xd0bf('0x31')][_0xd0bf('0x37')](_0xd0bf('0x38'))){_0x59f3bf[_0xd0bf('0x20')]=qs[_0xd0bf('0x20')](_0x3f6c6f['query'][_0xd0bf('0x20')]);_0x59f3bf['offset']=qs[_0xd0bf('0x1e')](_0x3f6c6f['query'][_0xd0bf('0x1e')]);}_0x59f3bf[_0xd0bf('0x39')]=qs[_0xd0bf('0x3a')](_0x3f6c6f['query'][_0xd0bf('0x3a')]);_0x59f3bf['where']=qs['filters'](_[_0xd0bf('0x3b')](_0x3f6c6f[_0xd0bf('0x31')],_0x29c3ce[_0xd0bf('0x32')]),_0x4c5a07);if(_0x3f6c6f[_0xd0bf('0x31')]['filter']){_0x59f3bf[_0xd0bf('0x3c')]=_['merge'](_0x59f3bf['where'],{'$or':_['map'](_0x4c5a07,function(_0x3b4b6a){if(_0x3b4b6a['type']!==_0xd0bf('0x3d')){var _0x5bd970={};_0x5bd970[_0x3b4b6a['name']]={'$like':'%'+_0x3f6c6f['query'][_0xd0bf('0x3e')]+'%'};return _0x5bd970;}})});}_0x59f3bf=_[_0xd0bf('0x3f')]({},_0x59f3bf,_0x3f6c6f['options']);var _0x1a9281={'where':_0x59f3bf[_0xd0bf('0x3c')]};return db[_0xd0bf('0x40')][_0xd0bf('0x21')](_0x1a9281)[_0xd0bf('0x27')](function(_0x36a1b2){_0x5d8036['count']=_0x36a1b2;if(_0x3f6c6f[_0xd0bf('0x31')][_0xd0bf('0x41')]){_0x59f3bf[_0xd0bf('0x42')]=[{'all':!![]}];}return db[_0xd0bf('0x40')][_0xd0bf('0x43')](_0x59f3bf);})[_0xd0bf('0x27')](function(_0x3ccc42){_0x5d8036['rows']=_0x3ccc42;return _0x5d8036;})['then'](respondWithFilteredResult(_0x3f1099,_0x59f3bf))[_0xd0bf('0x44')](handleError(_0x3f1099,null));};exports[_0xd0bf('0x45')]=function(_0x5bfc0d,_0x3bde8e){var _0x5c2ae5={'raw':![],'where':{'id':_0x5bfc0d[_0xd0bf('0x46')]['id']}},_0x166400={};_0x166400['model']=_[_0xd0bf('0x30')](db[_0xd0bf('0x40')][_0xd0bf('0x2c')]);_0x166400['query']=_['keys'](_0x5bfc0d['query']);_0x166400[_0xd0bf('0x32')]=_['intersection'](_0x166400[_0xd0bf('0x2f')],_0x166400[_0xd0bf('0x31')]);_0x5c2ae5[_0xd0bf('0x34')]=_[_0xd0bf('0x33')](_0x166400[_0xd0bf('0x2f')],qs['fields'](_0x5bfc0d[_0xd0bf('0x31')][_0xd0bf('0x35')]));_0x5c2ae5['attributes']=_0x5c2ae5[_0xd0bf('0x34')]['length']?_0x5c2ae5[_0xd0bf('0x34')]:_0x166400[_0xd0bf('0x2f')];if(_0x5bfc0d[_0xd0bf('0x31')][_0xd0bf('0x41')]){_0x5c2ae5[_0xd0bf('0x42')]=[{'all':!![]}];}_0x5c2ae5=_[_0xd0bf('0x3f')]({},_0x5c2ae5,_0x5bfc0d[_0xd0bf('0x47')]);return db['DeskAccount'][_0xd0bf('0x48')](_0x5c2ae5)[_0xd0bf('0x27')](handleEntityNotFound(_0x3bde8e,null))[_0xd0bf('0x27')](respondWithResult(_0x3bde8e,null))[_0xd0bf('0x44')](handleError(_0x3bde8e,null));};exports[_0xd0bf('0x49')]=function(_0x5bdf63,_0x5c2523){return db['DeskAccount'][_0xd0bf('0x49')](_0x5bdf63[_0xd0bf('0x4a')],{})[_0xd0bf('0x27')](respondWithResult(_0x5c2523,0xc9))[_0xd0bf('0x44')](handleError(_0x5c2523,null));};exports[_0xd0bf('0x26')]=function(_0x83327c,_0x53c02b){if(_0x83327c[_0xd0bf('0x4a')]['id']){delete _0x83327c[_0xd0bf('0x4a')]['id'];}return db[_0xd0bf('0x40')][_0xd0bf('0x48')]({'where':{'id':_0x83327c[_0xd0bf('0x46')]['id']}})[_0xd0bf('0x27')](handleEntityNotFound(_0x53c02b,null))[_0xd0bf('0x27')](saveUpdates(_0x83327c['body'],null))[_0xd0bf('0x27')](respondWithResult(_0x53c02b,null))[_0xd0bf('0x44')](handleError(_0x53c02b,null));};exports[_0xd0bf('0x4b')]=function(_0x5136a1,_0x208649){return db[_0xd0bf('0x40')][_0xd0bf('0x48')]({'where':{'id':_0x5136a1[_0xd0bf('0x46')]['id']}})[_0xd0bf('0x27')](handleEntityNotFound(_0x208649,null))[_0xd0bf('0x27')](removeEntity(_0x208649,null))[_0xd0bf('0x44')](handleError(_0x208649,null));};exports[_0xd0bf('0x4c')]=function(_0x5c16bf,_0x365c9e,_0x2c5817){var _0x54da1e={};var _0x74454a={};var _0x1de863;var _0x327055;return db[_0xd0bf('0x40')][_0xd0bf('0x4d')]({'where':{'id':_0x5c16bf[_0xd0bf('0x46')]['id']}})['then'](handleEntityNotFound(_0x365c9e,null))[_0xd0bf('0x27')](function(_0x32d6d8){if(_0x32d6d8){_0x1de863=_0x32d6d8;_0x74454a[_0xd0bf('0x2f')]=_[_0xd0bf('0x30')](db[_0xd0bf('0x4e')]['rawAttributes']);_0x74454a['query']=_[_0xd0bf('0x30')](_0x5c16bf[_0xd0bf('0x31')]);_0x74454a[_0xd0bf('0x32')]=_[_0xd0bf('0x33')](_0x74454a[_0xd0bf('0x2f')],_0x74454a[_0xd0bf('0x31')]);_0x54da1e[_0xd0bf('0x34')]=_[_0xd0bf('0x33')](_0x74454a[_0xd0bf('0x2f')],qs[_0xd0bf('0x35')](_0x5c16bf[_0xd0bf('0x31')]['fields']));_0x54da1e['attributes']=_0x54da1e['attributes'][_0xd0bf('0x36')]?_0x54da1e[_0xd0bf('0x34')]:_0x74454a['model'];_0x54da1e[_0xd0bf('0x39')]=qs[_0xd0bf('0x3a')](_0x5c16bf[_0xd0bf('0x31')][_0xd0bf('0x3a')]);_0x54da1e['where']=qs[_0xd0bf('0x32')](_['pick'](_0x5c16bf['query'],_0x74454a[_0xd0bf('0x32')]));if(_0x5c16bf['query'][_0xd0bf('0x3e')]){_0x54da1e['where']=_['merge'](_0x54da1e['where'],{'$or':_[_0xd0bf('0x2b')](_0x54da1e['attributes'],function(_0x30aad9){var _0x18ae23={};_0x18ae23[_0x30aad9]={'$like':'%'+_0x5c16bf[_0xd0bf('0x31')]['filter']+'%'};return _0x18ae23;})});}_0x54da1e=_['merge']({},_0x54da1e,_0x5c16bf[_0xd0bf('0x47')]);return _0x1de863[_0xd0bf('0x4c')](_0x54da1e);}})[_0xd0bf('0x27')](function(_0x5072ad){if(_0x5072ad){_0x327055=_0x5072ad[_0xd0bf('0x36')];if(!_0x5c16bf[_0xd0bf('0x31')]['hasOwnProperty'](_0xd0bf('0x38'))){_0x54da1e[_0xd0bf('0x20')]=qs['limit'](_0x5c16bf[_0xd0bf('0x31')]['limit']);_0x54da1e[_0xd0bf('0x1e')]=qs[_0xd0bf('0x1e')](_0x5c16bf['query'][_0xd0bf('0x1e')]);}return _0x1de863[_0xd0bf('0x4c')](_0x54da1e);}})[_0xd0bf('0x27')](function(_0x1d7b60){if(_0x1d7b60){return _0x1d7b60?{'count':_0x327055,'rows':_0x1d7b60}:null;}})[_0xd0bf('0x27')](respondWithResult(_0x365c9e,null))[_0xd0bf('0x44')](handleError(_0x365c9e,null));};exports[_0xd0bf('0x4f')]=function(_0xa03ea5,_0x114bff,_0x5049b2){if(_0xa03ea5[_0xd0bf('0x4a')]['id']){delete _0xa03ea5[_0xd0bf('0x4a')]['id'];}return db[_0xd0bf('0x40')][_0xd0bf('0x4d')]({'where':{'id':_0xa03ea5[_0xd0bf('0x46')]['id']}})[_0xd0bf('0x27')](handleEntityNotFound(_0x114bff,null))[_0xd0bf('0x27')](function(_0x25ec2f){if(_0x25ec2f){_0xa03ea5[_0xd0bf('0x4a')][_0xd0bf('0x50')]=_0x25ec2f['id'];_0xa03ea5[_0xd0bf('0x4a')][_0xd0bf('0x51')]=integrations[_0xd0bf('0x52')](_0xa03ea5[_0xd0bf('0x4a')][_0xd0bf('0x53')],_0xa03ea5['body'][_0xd0bf('0x54')]);_0xa03ea5[_0xd0bf('0x4a')]['Descriptions']=integrations['getDescriptions'](_0xa03ea5[_0xd0bf('0x4a')][_0xd0bf('0x53')],_0xa03ea5[_0xd0bf('0x4a')][_0xd0bf('0x54')]);return db[_0xd0bf('0x4e')][_0xd0bf('0x49')](_0xa03ea5['body'],{'include':[{'model':db['DeskField'],'as':_0xd0bf('0x51')},{'model':db[_0xd0bf('0x55')],'as':_0xd0bf('0x56')}]});}return null;})['then'](respondWithResult(_0x114bff,null))[_0xd0bf('0x44')](handleError(_0x114bff,null));};exports['getFields']=function(_0x4b8c88,_0x1e4064,_0x3b3dc8){var _0x1bd236=[{'name':_0xd0bf('0x57'),'label':_0xd0bf('0x57'),'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 _0x48a93b='';return db['DeskAccount'][_0xd0bf('0x4d')]({'where':{'id':_0x4b8c88[_0xd0bf('0x46')]['id']},'attributes':['id','remoteUri',_0xd0bf('0x58'),_0xd0bf('0x59'),_0xd0bf('0x5a'),'consumerKey',_0xd0bf('0x5b'),_0xd0bf('0x5c'),_0xd0bf('0x5d')]})[_0xd0bf('0x27')](handleEntityNotFound(_0x1e4064,null))[_0xd0bf('0x27')](function(_0x20ec23){if(_0x20ec23){_0x48a93b=_0x20ec23[_0xd0bf('0x5e')];var _0x3c6f34=_0x48a93b[_0xd0bf('0x5f')](-0x1);if(_0x3c6f34==='/'){_0x48a93b=_0x48a93b['substring'](0x0,_0x48a93b[_0xd0bf('0x60')](_0x3c6f34));}var _0x3f8ca2={'method':_0xd0bf('0x61'),'uri':util[_0xd0bf('0x62')](_0xd0bf('0x63'),_0x48a93b),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x20ec23[_0xd0bf('0x58')]===_0xd0bf('0x64')){_0x3f8ca2[_0xd0bf('0x65')][_0xd0bf('0x66')]=util['format'](_0xd0bf('0x67'),new Buffer(util[_0xd0bf('0x62')](_0xd0bf('0x68'),_0x20ec23[_0xd0bf('0x59')],_0x20ec23[_0xd0bf('0x5a')]))[_0xd0bf('0x69')]('base64'));}return rp(_0x3f8ca2)[_0xd0bf('0x27')](function(_0x52f3b0){return _0x1bd236[_0xd0bf('0x6a')](_[_0xd0bf('0x2b')](_0x52f3b0[_0xd0bf('0x6b')]['entries'],function(_0x3ba734){return{'id':_0x3ba734[_0xd0bf('0x28')],'name':_0x3ba734['name'],'type':_0x3ba734[_0xd0bf('0x54')],'active':_0x3ba734[_0xd0bf('0x6c')],'label':_0x3ba734[_0xd0bf('0x6d')],'custom':!![]};}));});}})['then'](function(_0x29c39){return{'count':_0x29c39[_0xd0bf('0x36')],'rows':_0x29c39};})['then'](respondWithResult(_0x1e4064,null))['catch'](function(_0x45af8a){var _0x1eba86=_0x4b8c88[_0xd0bf('0x31')][_0xd0bf('0x6e')]?0x1f4:_0x45af8a[_0xd0bf('0x6f')]||0x1f4;logger[_0xd0bf('0x70')](_0xd0bf('0x71'),_0xd0bf('0x72'),_0x1eba86,JSON['stringify'](_0x45af8a));delete _0x45af8a[_0xd0bf('0x28')];if(_0x1eba86===0x191){_0x1eba86=0x190;}_0x1e4064[_0xd0bf('0x1b')](_0x1eba86)[_0xd0bf('0x29')](_0x4b8c88[_0xd0bf('0x31')][_0xd0bf('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x45af8a[_0xd0bf('0x6f')]}:_0x45af8a);});}; \ No newline at end of file +var _0xe36e=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','DeskAccount','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','findOne','DeskConfiguration','getConfigurations','nolimit','AccountId','getSubjects','Descriptions','channel','DeskField','Subjects','getFields','priority','remoteUri','username','password','consumerSecret','token','slice','substring','lastIndexOf','format','application/json','authType','basic','headers','Authorization','%s:%s','toString','base64','_embedded','entries','active','label','getFields,\x20%s,\x20%s,\x20%s','test','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x219e50,_0x56df04){var _0x3d9152=function(_0x564bc5){while(--_0x564bc5){_0x219e50['push'](_0x219e50['shift']());}};_0x3d9152(++_0x56df04);}(_0xe36e,0x143));var _0xee36=function(_0x14d9b7,_0x41650d){_0x14d9b7=_0x14d9b7-0x0;var _0x254b92=_0xe36e[_0x14d9b7];return _0x254b92;};'use strict';var emlformat=require(_0xee36('0x0'));var rimraf=require(_0xee36('0x1'));var zipdir=require(_0xee36('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee36('0x3'));var moment=require(_0xee36('0x4'));var BPromise=require(_0xee36('0x5'));var Mustache=require('mustache');var util=require(_0xee36('0x6'));var path=require('path');var sox=require(_0xee36('0x7'));var csv=require(_0xee36('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee36('0x9'));var squel=require(_0xee36('0xa'));var crypto=require(_0xee36('0xb'));var jsforce=require(_0xee36('0xc'));var deskjs=require(_0xee36('0xd'));var toCsv=require('to-csv');var querystring=require(_0xee36('0xe'));var Papa=require(_0xee36('0xf'));var Redis=require(_0xee36('0x10'));var authService=require(_0xee36('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xee36('0x12'));var hardwareService=require(_0xee36('0x13'));var logger=require('../../config/logger')(_0xee36('0x14'));var utils=require(_0xee36('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xee36('0x16'));var db=require(_0xee36('0x17'))['db'];var integrations=require(_0xee36('0x18'));function respondWithStatusCode(_0x160383,_0x4264a3){_0x4264a3=_0x4264a3||0xcc;return function(_0x566216){if(_0x566216){return _0x160383[_0xee36('0x19')](_0x4264a3);}return _0x160383['status'](_0x4264a3)[_0xee36('0x1a')]();};}function respondWithResult(_0x12730c,_0x3aab6c){_0x3aab6c=_0x3aab6c||0xc8;return function(_0x1bab43){if(_0x1bab43){return _0x12730c[_0xee36('0x1b')](_0x3aab6c)['json'](_0x1bab43);}};}function respondWithFilteredResult(_0x395ed6,_0x2aee56){return function(_0x29a5e5){if(_0x29a5e5){var _0x58b3f8=typeof _0x2aee56[_0xee36('0x1c')]==='undefined'&&typeof _0x2aee56['limit']===_0xee36('0x1d');var _0x17448b=_0x29a5e5[_0xee36('0x1e')];var _0x2e2d1c=_0x58b3f8?0x0:_0x2aee56[_0xee36('0x1c')];var _0x38cde0=_0x58b3f8?_0x29a5e5[_0xee36('0x1e')]:_0x2aee56['offset']+_0x2aee56[_0xee36('0x1f')];var _0x11995b;if(_0x38cde0>=_0x17448b){_0x38cde0=_0x17448b;_0x11995b=0xc8;}else{_0x11995b=0xce;}_0x395ed6[_0xee36('0x1b')](_0x11995b);return _0x395ed6[_0xee36('0x20')](_0xee36('0x21'),_0x2e2d1c+'-'+_0x38cde0+'/'+_0x17448b)[_0xee36('0x22')](_0x29a5e5);}return null;};}function patchUpdates(_0x5d7eec){return function(_0x5d65ba){try{jsonpatch[_0xee36('0x23')](_0x5d65ba,_0x5d7eec,!![]);}catch(_0x2f0e83){return BPromise[_0xee36('0x24')](_0x2f0e83);}return _0x5d65ba[_0xee36('0x25')]();};}function saveUpdates(_0x1b6c0f,_0x1529fc){return function(_0x181127){if(_0x181127){return _0x181127[_0xee36('0x26')](_0x1b6c0f)[_0xee36('0x27')](function(_0x28a7aa){return _0x28a7aa;});}return null;};}function removeEntity(_0x36aaa8,_0x598c5d){return function(_0x3ec657){if(_0x3ec657){return _0x3ec657[_0xee36('0x28')]()[_0xee36('0x27')](function(){_0x36aaa8['status'](0xcc)[_0xee36('0x1a')]();});}};}function handleEntityNotFound(_0x118efe,_0x3901e4){return function(_0x36fbfe){if(!_0x36fbfe){_0x118efe[_0xee36('0x19')](0x194);}return _0x36fbfe;};}function handleError(_0x38f6c8,_0x13b7a5){_0x13b7a5=_0x13b7a5||0x1f4;return function(_0x30f10e){logger[_0xee36('0x29')](_0x30f10e['stack']);if(_0x30f10e[_0xee36('0x2a')]){delete _0x30f10e[_0xee36('0x2a')];}_0x38f6c8[_0xee36('0x1b')](_0x13b7a5)[_0xee36('0x2b')](_0x30f10e);};}exports[_0xee36('0x2c')]=function(_0x521e5e,_0xf98f02){var _0x5d71ea={},_0x1df786={},_0x63c3ea={'count':0x0,'rows':[]};var _0x1a3562=_[_0xee36('0x2d')](db[_0xee36('0x2e')]['rawAttributes'],function(_0x5aed01){return{'name':_0x5aed01[_0xee36('0x2f')],'type':_0x5aed01[_0xee36('0x30')][_0xee36('0x31')]};});_0x1df786[_0xee36('0x32')]=_['map'](_0x1a3562,'name');_0x1df786[_0xee36('0x33')]=_[_0xee36('0x34')](_0x521e5e[_0xee36('0x33')]);_0x1df786[_0xee36('0x35')]=_['intersection'](_0x1df786[_0xee36('0x32')],_0x1df786[_0xee36('0x33')]);_0x5d71ea[_0xee36('0x36')]=_[_0xee36('0x37')](_0x1df786[_0xee36('0x32')],qs[_0xee36('0x38')](_0x521e5e[_0xee36('0x33')][_0xee36('0x38')]));_0x5d71ea[_0xee36('0x36')]=_0x5d71ea['attributes'][_0xee36('0x39')]?_0x5d71ea[_0xee36('0x36')]:_0x1df786['model'];if(!_0x521e5e[_0xee36('0x33')][_0xee36('0x3a')]('nolimit')){_0x5d71ea[_0xee36('0x1f')]=qs[_0xee36('0x1f')](_0x521e5e[_0xee36('0x33')]['limit']);_0x5d71ea['offset']=qs[_0xee36('0x1c')](_0x521e5e['query'][_0xee36('0x1c')]);}_0x5d71ea[_0xee36('0x3b')]=qs[_0xee36('0x3c')](_0x521e5e[_0xee36('0x33')][_0xee36('0x3c')]);_0x5d71ea['where']=qs[_0xee36('0x35')](_['pick'](_0x521e5e[_0xee36('0x33')],_0x1df786[_0xee36('0x35')]),_0x1a3562);if(_0x521e5e[_0xee36('0x33')][_0xee36('0x3d')]){_0x5d71ea['where']=_[_0xee36('0x3e')](_0x5d71ea[_0xee36('0x3f')],{'$or':_['map'](_0x1a3562,function(_0x51e2ac){if(_0x51e2ac['type']!==_0xee36('0x40')){var _0xed29d7={};_0xed29d7[_0x51e2ac['name']]={'$like':'%'+_0x521e5e[_0xee36('0x33')]['filter']+'%'};return _0xed29d7;}})});}_0x5d71ea=_['merge']({},_0x5d71ea,_0x521e5e[_0xee36('0x41')]);var _0x837f91={'where':_0x5d71ea[_0xee36('0x3f')]};return db[_0xee36('0x2e')][_0xee36('0x1e')](_0x837f91)['then'](function(_0x18f9e1){_0x63c3ea[_0xee36('0x1e')]=_0x18f9e1;if(_0x521e5e[_0xee36('0x33')]['includeAll']){_0x5d71ea[_0xee36('0x42')]=[{'all':!![]}];}return db[_0xee36('0x2e')][_0xee36('0x43')](_0x5d71ea);})[_0xee36('0x27')](function(_0x173a06){_0x63c3ea[_0xee36('0x44')]=_0x173a06;return _0x63c3ea;})[_0xee36('0x27')](respondWithFilteredResult(_0xf98f02,_0x5d71ea))[_0xee36('0x45')](handleError(_0xf98f02,null));};exports[_0xee36('0x46')]=function(_0x24bfe9,_0x573fab){var _0x1045ba={'raw':![],'where':{'id':_0x24bfe9[_0xee36('0x47')]['id']}},_0x183b17={};_0x183b17[_0xee36('0x32')]=_[_0xee36('0x34')](db[_0xee36('0x2e')][_0xee36('0x48')]);_0x183b17[_0xee36('0x33')]=_['keys'](_0x24bfe9[_0xee36('0x33')]);_0x183b17[_0xee36('0x35')]=_[_0xee36('0x37')](_0x183b17[_0xee36('0x32')],_0x183b17[_0xee36('0x33')]);_0x1045ba[_0xee36('0x36')]=_[_0xee36('0x37')](_0x183b17[_0xee36('0x32')],qs[_0xee36('0x38')](_0x24bfe9[_0xee36('0x33')][_0xee36('0x38')]));_0x1045ba[_0xee36('0x36')]=_0x1045ba['attributes'][_0xee36('0x39')]?_0x1045ba[_0xee36('0x36')]:_0x183b17[_0xee36('0x32')];if(_0x24bfe9[_0xee36('0x33')][_0xee36('0x49')]){_0x1045ba['include']=[{'all':!![]}];}_0x1045ba=_[_0xee36('0x3e')]({},_0x1045ba,_0x24bfe9[_0xee36('0x41')]);return db[_0xee36('0x2e')]['find'](_0x1045ba)[_0xee36('0x27')](handleEntityNotFound(_0x573fab,null))[_0xee36('0x27')](respondWithResult(_0x573fab,null))[_0xee36('0x45')](handleError(_0x573fab,null));};exports[_0xee36('0x4a')]=function(_0x3d69f,_0x225157){return db[_0xee36('0x2e')][_0xee36('0x4a')](_0x3d69f[_0xee36('0x4b')],{})[_0xee36('0x27')](respondWithResult(_0x225157,0xc9))['catch'](handleError(_0x225157,null));};exports[_0xee36('0x26')]=function(_0xf910ee,_0xe0bed6){if(_0xf910ee[_0xee36('0x4b')]['id']){delete _0xf910ee[_0xee36('0x4b')]['id'];}return db['DeskAccount']['find']({'where':{'id':_0xf910ee[_0xee36('0x47')]['id']}})[_0xee36('0x27')](handleEntityNotFound(_0xe0bed6,null))[_0xee36('0x27')](saveUpdates(_0xf910ee[_0xee36('0x4b')],null))['then'](respondWithResult(_0xe0bed6,null))['catch'](handleError(_0xe0bed6,null));};exports[_0xee36('0x28')]=function(_0x23dc36,_0x1cfbc7){return db[_0xee36('0x2e')]['find']({'where':{'id':_0x23dc36[_0xee36('0x47')]['id']}})[_0xee36('0x27')](handleEntityNotFound(_0x1cfbc7,null))[_0xee36('0x27')](removeEntity(_0x1cfbc7,null))['catch'](handleError(_0x1cfbc7,null));};exports['getConfigurations']=function(_0x25d8eb,_0x36031e,_0x3dc4c6){var _0xa4273d={};var _0x30c4c3={};var _0x41e9d2;var _0xd58b84;return db[_0xee36('0x2e')][_0xee36('0x4c')]({'where':{'id':_0x25d8eb[_0xee36('0x47')]['id']}})[_0xee36('0x27')](handleEntityNotFound(_0x36031e,null))[_0xee36('0x27')](function(_0x519085){if(_0x519085){_0x41e9d2=_0x519085;_0x30c4c3[_0xee36('0x32')]=_['keys'](db[_0xee36('0x4d')][_0xee36('0x48')]);_0x30c4c3['query']=_['keys'](_0x25d8eb['query']);_0x30c4c3['filters']=_[_0xee36('0x37')](_0x30c4c3['model'],_0x30c4c3[_0xee36('0x33')]);_0xa4273d[_0xee36('0x36')]=_[_0xee36('0x37')](_0x30c4c3[_0xee36('0x32')],qs[_0xee36('0x38')](_0x25d8eb['query'][_0xee36('0x38')]));_0xa4273d['attributes']=_0xa4273d[_0xee36('0x36')][_0xee36('0x39')]?_0xa4273d[_0xee36('0x36')]:_0x30c4c3['model'];_0xa4273d[_0xee36('0x3b')]=qs[_0xee36('0x3c')](_0x25d8eb[_0xee36('0x33')]['sort']);_0xa4273d[_0xee36('0x3f')]=qs[_0xee36('0x35')](_['pick'](_0x25d8eb[_0xee36('0x33')],_0x30c4c3[_0xee36('0x35')]));if(_0x25d8eb[_0xee36('0x33')]['filter']){_0xa4273d['where']=_['merge'](_0xa4273d[_0xee36('0x3f')],{'$or':_['map'](_0xa4273d[_0xee36('0x36')],function(_0x7ea956){var _0x259ca6={};_0x259ca6[_0x7ea956]={'$like':'%'+_0x25d8eb[_0xee36('0x33')][_0xee36('0x3d')]+'%'};return _0x259ca6;})});}_0xa4273d=_[_0xee36('0x3e')]({},_0xa4273d,_0x25d8eb['options']);return _0x41e9d2[_0xee36('0x4e')](_0xa4273d);}})['then'](function(_0x2a9a4e){if(_0x2a9a4e){_0xd58b84=_0x2a9a4e[_0xee36('0x39')];if(!_0x25d8eb['query']['hasOwnProperty'](_0xee36('0x4f'))){_0xa4273d[_0xee36('0x1f')]=qs[_0xee36('0x1f')](_0x25d8eb[_0xee36('0x33')][_0xee36('0x1f')]);_0xa4273d[_0xee36('0x1c')]=qs[_0xee36('0x1c')](_0x25d8eb['query'][_0xee36('0x1c')]);}return _0x41e9d2[_0xee36('0x4e')](_0xa4273d);}})['then'](function(_0x5bb12e){if(_0x5bb12e){return _0x5bb12e?{'count':_0xd58b84,'rows':_0x5bb12e}:null;}})['then'](respondWithResult(_0x36031e,null))[_0xee36('0x45')](handleError(_0x36031e,null));};exports['addConfiguration']=function(_0x29931b,_0x504b69,_0x430b40){if(_0x29931b['body']['id']){delete _0x29931b['body']['id'];}return db['DeskAccount'][_0xee36('0x4c')]({'where':{'id':_0x29931b[_0xee36('0x47')]['id']}})[_0xee36('0x27')](handleEntityNotFound(_0x504b69,null))[_0xee36('0x27')](function(_0x3cdd37){if(_0x3cdd37){_0x29931b[_0xee36('0x4b')][_0xee36('0x50')]=_0x3cdd37['id'];_0x29931b['body']['Subjects']=integrations[_0xee36('0x51')](_0x29931b[_0xee36('0x4b')]['channel'],_0x29931b[_0xee36('0x4b')]['type']);_0x29931b[_0xee36('0x4b')][_0xee36('0x52')]=integrations['getDescriptions'](_0x29931b[_0xee36('0x4b')][_0xee36('0x53')],_0x29931b[_0xee36('0x4b')][_0xee36('0x30')]);return db[_0xee36('0x4d')][_0xee36('0x4a')](_0x29931b[_0xee36('0x4b')],{'include':[{'model':db[_0xee36('0x54')],'as':_0xee36('0x55')},{'model':db[_0xee36('0x54')],'as':_0xee36('0x52')}]});}return null;})[_0xee36('0x27')](respondWithResult(_0x504b69,null))[_0xee36('0x45')](handleError(_0x504b69,null));};exports[_0xee36('0x56')]=function(_0x2e5a3c,_0xe99a66,_0x1e9088){var _0xa9bfc7=[{'name':_0xee36('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 _0xf57a72='';return db[_0xee36('0x2e')][_0xee36('0x4c')]({'where':{'id':_0x2e5a3c[_0xee36('0x47')]['id']},'attributes':['id',_0xee36('0x58'),'authType',_0xee36('0x59'),_0xee36('0x5a'),'consumerKey',_0xee36('0x5b'),_0xee36('0x5c'),'tokenSecret']})[_0xee36('0x27')](handleEntityNotFound(_0xe99a66,null))['then'](function(_0x538d1e){if(_0x538d1e){_0xf57a72=_0x538d1e[_0xee36('0x58')];var _0x45a74a=_0xf57a72[_0xee36('0x5d')](-0x1);if(_0x45a74a==='/'){_0xf57a72=_0xf57a72[_0xee36('0x5e')](0x0,_0xf57a72[_0xee36('0x5f')](_0x45a74a));}var _0x3800e1={'method':'GET','uri':util[_0xee36('0x60')]('%s/custom_fields',_0xf57a72),'headers':{'Content-Type':_0xee36('0x61'),'Accept':'application/json'},'json':!![]};if(_0x538d1e[_0xee36('0x62')]===_0xee36('0x63')){_0x3800e1[_0xee36('0x64')][_0xee36('0x65')]=util[_0xee36('0x60')]('Basic\x20%s',new Buffer(util[_0xee36('0x60')](_0xee36('0x66'),_0x538d1e[_0xee36('0x59')],_0x538d1e[_0xee36('0x5a')]))[_0xee36('0x67')](_0xee36('0x68')));}return rp(_0x3800e1)[_0xee36('0x27')](function(_0x12c949){return _0xa9bfc7['concat'](_[_0xee36('0x2d')](_0x12c949[_0xee36('0x69')][_0xee36('0x6a')],function(_0x49eb2e){return{'id':_0x49eb2e[_0xee36('0x2a')],'name':_0x49eb2e[_0xee36('0x2a')],'type':_0x49eb2e[_0xee36('0x30')],'active':_0x49eb2e[_0xee36('0x6b')],'label':_0x49eb2e[_0xee36('0x6c')],'custom':!![]};}));});}})['then'](function(_0x1669d3){return{'count':_0x1669d3[_0xee36('0x39')],'rows':_0x1669d3};})[_0xee36('0x27')](respondWithResult(_0xe99a66,null))[_0xee36('0x45')](function(_0x151061){var _0x20a399=_0x2e5a3c['query']['test']?0x1f4:_0x151061['statusCode']||0x1f4;logger[_0xee36('0x29')](_0xee36('0x6d'),_0xee36('0x56'),_0x20a399,JSON['stringify'](_0x151061));delete _0x151061[_0xee36('0x2a')];if(_0x20a399===0x191){_0x20a399=0x190;}_0xe99a66['status'](_0x20a399)['send'](_0x2e5a3c[_0xee36('0x33')][_0xee36('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x151061[_0xee36('0x6f')]}:_0x151061);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 601c358..ff242b7 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 _0xd555=['request-promise','path','rimraf','../../components/integrations/configuration','define','DeskAccount','lodash','util','api','bluebird'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xd555,0x74));var _0x5d55=function(_0x383494,_0x2070d2){_0x383494=_0x383494-0x0;var _0x2485e5=_0xd555[_0x383494];return _0x2485e5;};'use strict';var _=require(_0x5d55('0x0'));var util=require(_0x5d55('0x1'));var logger=require('../../config/logger')(_0x5d55('0x2'));var moment=require('moment');var BPromise=require(_0x5d55('0x3'));var rp=require(_0x5d55('0x4'));var fs=require('fs');var path=require(_0x5d55('0x5'));var rimraf=require(_0x5d55('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x5d55('0x7'));module['exports']=function(_0x497e44,_0x44f19c){return _0x497e44[_0x5d55('0x8')](_0x5d55('0x9'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce8c=['DeskAccount','lodash','util','../../config/logger','api','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x354369,_0x49ee94){var _0x4595b6=function(_0x27cfbf){while(--_0x27cfbf){_0x354369['push'](_0x354369['shift']());}};_0x4595b6(++_0x49ee94);}(_0xce8c,0x90));var _0xcce8=function(_0x486879,_0x238800){_0x486879=_0x486879-0x0;var _0xe440e5=_0xce8c[_0x486879];return _0xe440e5;};'use strict';var _=require(_0xcce8('0x0'));var util=require(_0xcce8('0x1'));var logger=require(_0xcce8('0x2'))(_0xcce8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcce8('0x4'));var fs=require('fs');var path=require(_0xcce8('0x5'));var rimraf=require(_0xcce8('0x6'));var config=require('../../config/environment');var attributes=require(_0xcce8('0x7'));var integrations=require(_0xcce8('0x8'));module['exports']=function(_0x55a2d7,_0x22d9c3){return _0x55a2d7[_0xcce8('0x9')](_0xcce8('0xa'),attributes,{'tableName':'int_desk_accounts','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 340fa85..49ee877 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 _0x2724=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','DeskAccount','findAll','options','raw','limit','map','include','model','attributes','GetDeskAccount','ShowDeskAccount','find','where','debug','util'];(function(_0x2b58c1,_0x48ac33){var _0x2253dc=function(_0x218130){while(--_0x218130){_0x2b58c1['push'](_0x2b58c1['shift']());}};_0x2253dc(++_0x48ac33);}(_0x2724,0x109));var _0x4272=function(_0x5d4725,_0x18fbf7){_0x5d4725=_0x5d4725-0x0;var _0x3da033=_0x2724[_0x5d4725];return _0x3da033;};'use strict';var _=require('lodash');var util=require(_0x4272('0x0'));var moment=require(_0x4272('0x1'));var BPromise=require(_0x4272('0x2'));var rs=require(_0x4272('0x3'));var fs=require('fs');var Redis=require(_0x4272('0x4'));var db=require(_0x4272('0x5'))['db'];var utils=require(_0x4272('0x6'));var logger=require(_0x4272('0x7'))(_0x4272('0x8'));var config=require(_0x4272('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4272('0xa')][_0x4272('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d3562,_0x43cc86,_0x216a14){return new BPromise(function(_0x30a399,_0x206ff8){return client[_0x4272('0xc')](_0x3d3562,_0x216a14)[_0x4272('0xd')](function(_0x3f5cfd){logger[_0x4272('0xe')](_0x4272('0xf'),_0x43cc86,_0x4272('0x10'));logger['debug'](_0x4272('0x11'),_0x43cc86,'request\x20sent',JSON[_0x4272('0x12')](_0x3f5cfd));if(_0x3f5cfd['error']){if(_0x3f5cfd[_0x4272('0x13')][_0x4272('0x14')]===0x1f4){logger['error'](_0x4272('0xf'),_0x43cc86,_0x3f5cfd[_0x4272('0x13')][_0x4272('0x15')]);return _0x206ff8(_0x3f5cfd['error'][_0x4272('0x15')]);}logger[_0x4272('0x13')](_0x4272('0xf'),_0x43cc86,_0x3f5cfd['error'][_0x4272('0x15')]);return _0x30a399(_0x3f5cfd[_0x4272('0x13')][_0x4272('0x15')]);}else{logger[_0x4272('0xe')](_0x4272('0xf'),_0x43cc86,_0x4272('0x10'));_0x30a399(_0x3f5cfd[_0x4272('0x16')][_0x4272('0x15')]);}})[_0x4272('0x17')](function(_0x16354f){logger[_0x4272('0x13')](_0x4272('0xf'),_0x43cc86,_0x16354f);_0x206ff8(_0x16354f);});});}exports['GetDeskAccount']=function(_0x30992d){var _0x4d259a=this;return new Promise(function(_0x5e7448,_0x485f40){return db[_0x4272('0x18')][_0x4272('0x19')]({'raw':_0x30992d[_0x4272('0x1a')]?_0x30992d['options'][_0x4272('0x1b')]===undefined?!![]:![]:!![],'where':_0x30992d[_0x4272('0x1a')]?_0x30992d['options']['where']||null:null,'attributes':_0x30992d[_0x4272('0x1a')]?_0x30992d['options']['attributes']||null:null,'limit':_0x30992d[_0x4272('0x1a')]?_0x30992d['options'][_0x4272('0x1c')]||null:null,'include':_0x30992d[_0x4272('0x1a')]?_0x30992d[_0x4272('0x1a')]['include']?_[_0x4272('0x1d')](_0x30992d[_0x4272('0x1a')][_0x4272('0x1e')],function(_0x5e7d55){return{'model':db[_0x5e7d55[_0x4272('0x1f')]],'as':_0x5e7d55['as'],'attributes':_0x5e7d55[_0x4272('0x20')],'include':_0x5e7d55[_0x4272('0x1e')]?_[_0x4272('0x1d')](_0x5e7d55['include'],function(_0x45e053){return{'model':db[_0x45e053[_0x4272('0x1f')]],'as':_0x45e053['as'],'attributes':_0x45e053[_0x4272('0x20')],'include':_0x45e053[_0x4272('0x1e')]?_[_0x4272('0x1d')](_0x45e053['include'],function(_0x5d1904){return{'model':db[_0x5d1904[_0x4272('0x1f')]],'as':_0x5d1904['as'],'attributes':_0x5d1904[_0x4272('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54aca2){logger['info'](_0x4272('0x21'),_0x30992d);logger['debug'](_0x4272('0x21'),_0x30992d,JSON[_0x4272('0x12')](_0x54aca2));_0x5e7448(_0x54aca2);})[_0x4272('0x17')](function(_0x5aa5e7){logger[_0x4272('0x13')](_0x4272('0x21'),_0x5aa5e7[_0x4272('0x15')],_0x30992d);_0x485f40(_0x4d259a['error'](0x1f4,_0x5aa5e7[_0x4272('0x15')]));});});};exports[_0x4272('0x22')]=function(_0x2ef35a){var _0x3db34b=this;return new Promise(function(_0x27c02d,_0x366fa0){return db[_0x4272('0x18')][_0x4272('0x23')]({'raw':_0x2ef35a[_0x4272('0x1a')]?_0x2ef35a[_0x4272('0x1a')][_0x4272('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ef35a[_0x4272('0x1a')]?_0x2ef35a[_0x4272('0x1a')][_0x4272('0x24')]||null:null,'attributes':_0x2ef35a[_0x4272('0x1a')]?_0x2ef35a[_0x4272('0x1a')][_0x4272('0x20')]||null:null,'include':_0x2ef35a[_0x4272('0x1a')]?_0x2ef35a[_0x4272('0x1a')][_0x4272('0x1e')]?_[_0x4272('0x1d')](_0x2ef35a[_0x4272('0x1a')]['include'],function(_0x5d33c0){return{'model':db[_0x5d33c0[_0x4272('0x1f')]],'as':_0x5d33c0['as'],'attributes':_0x5d33c0['attributes'],'include':_0x5d33c0[_0x4272('0x1e')]?_[_0x4272('0x1d')](_0x5d33c0['include'],function(_0x547295){return{'model':db[_0x547295['model']],'as':_0x547295['as'],'attributes':_0x547295[_0x4272('0x20')],'include':_0x547295[_0x4272('0x1e')]?_['map'](_0x547295['include'],function(_0x55eb9d){return{'model':db[_0x55eb9d[_0x4272('0x1f')]],'as':_0x55eb9d['as'],'attributes':_0x55eb9d[_0x4272('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4272('0xd')](function(_0x28a806){logger[_0x4272('0xe')](_0x4272('0x22'),_0x2ef35a);logger[_0x4272('0x25')]('ShowDeskAccount',_0x2ef35a,JSON[_0x4272('0x12')](_0x28a806));_0x27c02d(_0x28a806);})['catch'](function(_0x2c70e2){logger[_0x4272('0x13')](_0x4272('0x22'),_0x2c70e2[_0x4272('0x15')],_0x2ef35a);_0x366fa0(_0x3db34b[_0x4272('0x13')](0x1f4,_0x2c70e2[_0x4272('0x15')]));});});}; \ No newline at end of file +var _0x1898=['findAll','options','raw','attributes','include','map','model','then','catch','ShowDeskAccount','where','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskAccount,\x20%s,\x20%s','result','GetDeskAccount','DeskAccount'];(function(_0x201d8e,_0x46f74b){var _0x403d73=function(_0x3dc76a){while(--_0x3dc76a){_0x201d8e['push'](_0x201d8e['shift']());}};_0x403d73(++_0x46f74b);}(_0x1898,0x1c5));var _0x8189=function(_0x5aabc8,_0x2f4897){_0x5aabc8=_0x5aabc8-0x0;var _0x3d5c2b=_0x1898[_0x5aabc8];return _0x3d5c2b;};'use strict';var _=require(_0x8189('0x0'));var util=require('util');var moment=require(_0x8189('0x1'));var BPromise=require(_0x8189('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8189('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8189('0x4'));var logger=require(_0x8189('0x5'))('rpc');var config=require(_0x8189('0x6'));var jayson=require(_0x8189('0x7'));var client=jayson[_0x8189('0x8')][_0x8189('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x364365,_0x411a6b,_0x572010){return new BPromise(function(_0x222714,_0xd832e3){return client[_0x8189('0xa')](_0x364365,_0x572010)['then'](function(_0x200392){logger[_0x8189('0xb')]('DeskAccount,\x20%s,\x20%s',_0x411a6b,_0x8189('0xc'));logger[_0x8189('0xd')](_0x8189('0xe'),_0x411a6b,_0x8189('0xc'),JSON[_0x8189('0xf')](_0x200392));if(_0x200392[_0x8189('0x10')]){if(_0x200392['error'][_0x8189('0x11')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x411a6b,_0x200392[_0x8189('0x10')][_0x8189('0x12')]);return _0xd832e3(_0x200392[_0x8189('0x10')][_0x8189('0x12')]);}logger['error'](_0x8189('0x13'),_0x411a6b,_0x200392['error'][_0x8189('0x12')]);return _0x222714(_0x200392[_0x8189('0x10')][_0x8189('0x12')]);}else{logger[_0x8189('0xb')]('DeskAccount,\x20%s,\x20%s',_0x411a6b,'request\x20sent');_0x222714(_0x200392[_0x8189('0x14')][_0x8189('0x12')]);}})['catch'](function(_0x3121f6){logger[_0x8189('0x10')]('DeskAccount,\x20%s,\x20%s',_0x411a6b,_0x3121f6);_0xd832e3(_0x3121f6);});});}exports[_0x8189('0x15')]=function(_0x7e667f){var _0x96dd88=this;return new Promise(function(_0xfa6ad1,_0x5149ec){return db[_0x8189('0x16')][_0x8189('0x17')]({'raw':_0x7e667f[_0x8189('0x18')]?_0x7e667f[_0x8189('0x18')][_0x8189('0x19')]===undefined?!![]:![]:!![],'where':_0x7e667f[_0x8189('0x18')]?_0x7e667f[_0x8189('0x18')]['where']||null:null,'attributes':_0x7e667f[_0x8189('0x18')]?_0x7e667f[_0x8189('0x18')][_0x8189('0x1a')]||null:null,'limit':_0x7e667f[_0x8189('0x18')]?_0x7e667f[_0x8189('0x18')]['limit']||null:null,'include':_0x7e667f[_0x8189('0x18')]?_0x7e667f[_0x8189('0x18')]['include']?_['map'](_0x7e667f[_0x8189('0x18')]['include'],function(_0x591a6d){return{'model':db[_0x591a6d['model']],'as':_0x591a6d['as'],'attributes':_0x591a6d[_0x8189('0x1a')],'include':_0x591a6d[_0x8189('0x1b')]?_[_0x8189('0x1c')](_0x591a6d['include'],function(_0x319611){return{'model':db[_0x319611['model']],'as':_0x319611['as'],'attributes':_0x319611[_0x8189('0x1a')],'include':_0x319611[_0x8189('0x1b')]?_[_0x8189('0x1c')](_0x319611['include'],function(_0x43b113){return{'model':db[_0x43b113[_0x8189('0x1d')]],'as':_0x43b113['as'],'attributes':_0x43b113[_0x8189('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8189('0x1e')](function(_0x25b86a){logger[_0x8189('0xb')]('GetDeskAccount',_0x7e667f);logger[_0x8189('0xd')](_0x8189('0x15'),_0x7e667f,JSON[_0x8189('0xf')](_0x25b86a));_0xfa6ad1(_0x25b86a);})[_0x8189('0x1f')](function(_0x42284e){logger['error'](_0x8189('0x15'),_0x42284e[_0x8189('0x12')],_0x7e667f);_0x5149ec(_0x96dd88['error'](0x1f4,_0x42284e[_0x8189('0x12')]));});});};exports[_0x8189('0x20')]=function(_0x2e4291){var _0x498733=this;return new Promise(function(_0x1270d9,_0x149aae){return db[_0x8189('0x16')]['find']({'raw':_0x2e4291[_0x8189('0x18')]?_0x2e4291[_0x8189('0x18')][_0x8189('0x19')]===undefined?!![]:![]:!![],'where':_0x2e4291[_0x8189('0x18')]?_0x2e4291[_0x8189('0x18')][_0x8189('0x21')]||null:null,'attributes':_0x2e4291[_0x8189('0x18')]?_0x2e4291['options'][_0x8189('0x1a')]||null:null,'include':_0x2e4291[_0x8189('0x18')]?_0x2e4291['options'][_0x8189('0x1b')]?_[_0x8189('0x1c')](_0x2e4291[_0x8189('0x18')]['include'],function(_0x447997){return{'model':db[_0x447997[_0x8189('0x1d')]],'as':_0x447997['as'],'attributes':_0x447997[_0x8189('0x1a')],'include':_0x447997[_0x8189('0x1b')]?_[_0x8189('0x1c')](_0x447997[_0x8189('0x1b')],function(_0x219b44){return{'model':db[_0x219b44[_0x8189('0x1d')]],'as':_0x219b44['as'],'attributes':_0x219b44['attributes'],'include':_0x219b44[_0x8189('0x1b')]?_[_0x8189('0x1c')](_0x219b44[_0x8189('0x1b')],function(_0x48da05){return{'model':db[_0x48da05[_0x8189('0x1d')]],'as':_0x48da05['as'],'attributes':_0x48da05[_0x8189('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8189('0x1e')](function(_0x459817){logger['info'](_0x8189('0x20'),_0x2e4291);logger[_0x8189('0xd')](_0x8189('0x20'),_0x2e4291,JSON[_0x8189('0xf')](_0x459817));_0x1270d9(_0x459817);})[_0x8189('0x1f')](function(_0x215e77){logger['error'](_0x8189('0x20'),_0x215e77['message'],_0x2e4291);_0x149aae(_0x498733[_0x8189('0x10')](0x1f4,_0x215e77[_0x8189('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 58222f0..f54d93b 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x1b86ae,_0x3e0863){var _0xb3d4c=function(_0x2e837a){while(--_0x2e837a){_0x1b86ae['push'](_0x1b86ae['shift']());}};_0xb3d4c(++_0x3e0863);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +var _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(_0x1378b6,_0x2dee94){var _0x1dd5dd=function(_0x5a8f37){while(--_0x5a8f37){_0x1378b6['push'](_0x1378b6['shift']());}};_0x1dd5dd(++_0x2dee94);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 1065d6d..f5edc3b 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 _0xe5df=['STRING'];(function(_0x2f5fae,_0x555535){var _0x3eb6b8=function(_0xcdf2d6){while(--_0xcdf2d6){_0x2f5fae['push'](_0x2f5fae['shift']());}};_0x3eb6b8(++_0x555535);}(_0xe5df,0x10b));var _0xfe5d=function(_0x22ec93,_0xa912ff){_0x22ec93=_0x22ec93-0x0;var _0x3aa1ef=_0xe5df[_0x22ec93];return _0x3aa1ef;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfe5d('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8e6d=['STRING','sequelize','exports'];(function(_0x402a69,_0x1abb74){var _0x57bc3e=function(_0x48e52a){while(--_0x48e52a){_0x402a69['push'](_0x402a69['shift']());}};_0x57bc3e(++_0x1abb74);}(_0x8e6d,0x82));var _0xd8e6=function(_0x595005,_0x21e98e){_0x595005=_0x595005-0x0;var _0x1642f6=_0x8e6d[_0x595005];return _0x1642f6;};'use strict';var Sequelize=require(_0xd8e6('0x0'));module[_0xd8e6('0x1')]={'name':{'type':Sequelize[_0xd8e6('0x2')]},'description':{'type':Sequelize[_0xd8e6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 93c6665..5a2cb45 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 _0x3344=['stack','send','index','map','fieldName','type','key','name','query','intersection','model','fields','attributes','length','order','sort','where','filters','VIRTUAL','filter','merge','options','DeskConfiguration','includeAll','findAll','rows','show','keys','rawAttributes','include','find','catch','body','params','getFields','DeskField','pick','hasOwnProperty','nolimit','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','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','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','end','error'];(function(_0x438a91,_0x5ec52c){var _0x4915a5=function(_0x4c11db){while(--_0x4c11db){_0x438a91['push'](_0x438a91['shift']());}};_0x4915a5(++_0x5ec52c);}(_0x3344,0x185));var _0x4334=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3344[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x4334('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4334('0x1'));var jsonpatch=require(_0x4334('0x2'));var rp=require(_0x4334('0x3'));var moment=require('moment');var BPromise=require(_0x4334('0x4'));var Mustache=require(_0x4334('0x5'));var util=require('util');var path=require(_0x4334('0x6'));var sox=require(_0x4334('0x7'));var csv=require(_0x4334('0x8'));var ejs=require(_0x4334('0x9'));var fs=require('fs');var fs_extra=require(_0x4334('0xa'));var _=require(_0x4334('0xb'));var squel=require(_0x4334('0xc'));var crypto=require('crypto');var jsforce=require(_0x4334('0xd'));var deskjs=require(_0x4334('0xe'));var toCsv=require(_0x4334('0x8'));var querystring=require(_0x4334('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4334('0x10'));var qs=require(_0x4334('0x11'));var as=require(_0x4334('0x12'));var hardwareService=require(_0x4334('0x13'));var logger=require(_0x4334('0x14'))(_0x4334('0x15'));var utils=require(_0x4334('0x16'));var config=require(_0x4334('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4334('0x18'))['db'];function respondWithStatusCode(_0x49e7d6,_0x4d65bb){_0x4d65bb=_0x4d65bb||0xcc;return function(_0x2ac35c){if(_0x2ac35c){return _0x49e7d6[_0x4334('0x19')](_0x4d65bb);}return _0x49e7d6[_0x4334('0x1a')](_0x4d65bb)['end']();};}function respondWithResult(_0x5256e7,_0x30af94){_0x30af94=_0x30af94||0xc8;return function(_0x213b9a){if(_0x213b9a){return _0x5256e7[_0x4334('0x1a')](_0x30af94)[_0x4334('0x1b')](_0x213b9a);}};}function respondWithFilteredResult(_0x3849b2,_0x5721af){return function(_0xdeb892){if(_0xdeb892){var _0x5abe9d=typeof _0x5721af[_0x4334('0x1c')]==='undefined'&&typeof _0x5721af[_0x4334('0x1d')]===_0x4334('0x1e');var _0x1a9379=_0xdeb892[_0x4334('0x1f')];var _0x5ce716=_0x5abe9d?0x0:_0x5721af['offset'];var _0x41049e=_0x5abe9d?_0xdeb892[_0x4334('0x1f')]:_0x5721af['offset']+_0x5721af[_0x4334('0x1d')];var _0x4acbde;if(_0x41049e>=_0x1a9379){_0x41049e=_0x1a9379;_0x4acbde=0xc8;}else{_0x4acbde=0xce;}_0x3849b2[_0x4334('0x1a')](_0x4acbde);return _0x3849b2[_0x4334('0x20')](_0x4334('0x21'),_0x5ce716+'-'+_0x41049e+'/'+_0x1a9379)[_0x4334('0x1b')](_0xdeb892);}return null;};}function patchUpdates(_0x5e2822){return function(_0x56ac7d){try{jsonpatch['apply'](_0x56ac7d,_0x5e2822,!![]);}catch(_0x3033e9){return BPromise[_0x4334('0x22')](_0x3033e9);}return _0x56ac7d[_0x4334('0x23')]();};}function saveUpdates(_0x277889,_0x3ae75b){return function(_0x56946f){if(_0x56946f){return _0x56946f[_0x4334('0x24')](_0x277889)[_0x4334('0x25')](function(_0x26ac45){return _0x26ac45;});}return null;};}function removeEntity(_0xa4fa88,_0x2e2a79){return function(_0x2fc437){if(_0x2fc437){return _0x2fc437[_0x4334('0x26')]()['then'](function(){_0xa4fa88['status'](0xcc)[_0x4334('0x27')]();});}};}function handleEntityNotFound(_0x1ee77f,_0x48c072){return function(_0x301ccc){if(!_0x301ccc){_0x1ee77f['sendStatus'](0x194);}return _0x301ccc;};}function handleError(_0x5d86f9,_0x3125bb){_0x3125bb=_0x3125bb||0x1f4;return function(_0x3012f4){logger[_0x4334('0x28')](_0x3012f4[_0x4334('0x29')]);if(_0x3012f4['name']){delete _0x3012f4['name'];}_0x5d86f9[_0x4334('0x1a')](_0x3125bb)[_0x4334('0x2a')](_0x3012f4);};}exports[_0x4334('0x2b')]=function(_0x5caad7,_0xfce82c){var _0x371366={},_0x4bc368={},_0x560f2d={'count':0x0,'rows':[]};var _0xc548dc=_[_0x4334('0x2c')](db['DeskConfiguration']['rawAttributes'],function(_0x183629){return{'name':_0x183629[_0x4334('0x2d')],'type':_0x183629[_0x4334('0x2e')][_0x4334('0x2f')]};});_0x4bc368['model']=_[_0x4334('0x2c')](_0xc548dc,_0x4334('0x30'));_0x4bc368[_0x4334('0x31')]=_['keys'](_0x5caad7['query']);_0x4bc368['filters']=_[_0x4334('0x32')](_0x4bc368[_0x4334('0x33')],_0x4bc368[_0x4334('0x31')]);_0x371366['attributes']=_[_0x4334('0x32')](_0x4bc368[_0x4334('0x33')],qs[_0x4334('0x34')](_0x5caad7[_0x4334('0x31')][_0x4334('0x34')]));_0x371366[_0x4334('0x35')]=_0x371366[_0x4334('0x35')][_0x4334('0x36')]?_0x371366[_0x4334('0x35')]:_0x4bc368[_0x4334('0x33')];if(!_0x5caad7[_0x4334('0x31')]['hasOwnProperty']('nolimit')){_0x371366[_0x4334('0x1d')]=qs[_0x4334('0x1d')](_0x5caad7[_0x4334('0x31')][_0x4334('0x1d')]);_0x371366['offset']=qs[_0x4334('0x1c')](_0x5caad7[_0x4334('0x31')][_0x4334('0x1c')]);}_0x371366[_0x4334('0x37')]=qs[_0x4334('0x38')](_0x5caad7[_0x4334('0x31')][_0x4334('0x38')]);_0x371366[_0x4334('0x39')]=qs[_0x4334('0x3a')](_['pick'](_0x5caad7[_0x4334('0x31')],_0x4bc368[_0x4334('0x3a')]),_0xc548dc);if(_0x5caad7['query']['filter']){_0x371366[_0x4334('0x39')]=_['merge'](_0x371366[_0x4334('0x39')],{'$or':_[_0x4334('0x2c')](_0xc548dc,function(_0x5b90b5){if(_0x5b90b5[_0x4334('0x2e')]!==_0x4334('0x3b')){var _0x562ddc={};_0x562ddc[_0x5b90b5[_0x4334('0x30')]]={'$like':'%'+_0x5caad7[_0x4334('0x31')][_0x4334('0x3c')]+'%'};return _0x562ddc;}})});}_0x371366=_[_0x4334('0x3d')]({},_0x371366,_0x5caad7[_0x4334('0x3e')]);var _0x315a6d={'where':_0x371366[_0x4334('0x39')]};return db[_0x4334('0x3f')][_0x4334('0x1f')](_0x315a6d)[_0x4334('0x25')](function(_0x97a01){_0x560f2d[_0x4334('0x1f')]=_0x97a01;if(_0x5caad7[_0x4334('0x31')][_0x4334('0x40')]){_0x371366['include']=[{'all':!![]}];}return db[_0x4334('0x3f')][_0x4334('0x41')](_0x371366);})[_0x4334('0x25')](function(_0x427f5d){_0x560f2d[_0x4334('0x42')]=_0x427f5d;return _0x560f2d;})[_0x4334('0x25')](respondWithFilteredResult(_0xfce82c,_0x371366))['catch'](handleError(_0xfce82c,null));};exports[_0x4334('0x43')]=function(_0x48997b,_0x33e8ab){var _0x41e277={'raw':![],'where':{'id':_0x48997b['params']['id']}},_0x29f160={};_0x29f160[_0x4334('0x33')]=_[_0x4334('0x44')](db[_0x4334('0x3f')][_0x4334('0x45')]);_0x29f160[_0x4334('0x31')]=_[_0x4334('0x44')](_0x48997b[_0x4334('0x31')]);_0x29f160[_0x4334('0x3a')]=_[_0x4334('0x32')](_0x29f160[_0x4334('0x33')],_0x29f160[_0x4334('0x31')]);_0x41e277[_0x4334('0x35')]=_['intersection'](_0x29f160[_0x4334('0x33')],qs[_0x4334('0x34')](_0x48997b[_0x4334('0x31')][_0x4334('0x34')]));_0x41e277[_0x4334('0x35')]=_0x41e277['attributes'][_0x4334('0x36')]?_0x41e277[_0x4334('0x35')]:_0x29f160[_0x4334('0x33')];if(_0x48997b[_0x4334('0x31')][_0x4334('0x40')]){_0x41e277[_0x4334('0x46')]=[{'all':!![]}];}_0x41e277=_[_0x4334('0x3d')]({},_0x41e277,_0x48997b[_0x4334('0x3e')]);return db[_0x4334('0x3f')][_0x4334('0x47')](_0x41e277)['then'](handleEntityNotFound(_0x33e8ab,null))[_0x4334('0x25')](respondWithResult(_0x33e8ab,null))[_0x4334('0x48')](handleError(_0x33e8ab,null));};exports['create']=function(_0xfc7196,_0x2ba7b9){return db[_0x4334('0x3f')]['create'](_0xfc7196[_0x4334('0x49')],{})[_0x4334('0x25')](respondWithResult(_0x2ba7b9,0xc9))['catch'](handleError(_0x2ba7b9,null));};exports[_0x4334('0x24')]=function(_0x5e3e9b,_0x1ea183){if(_0x5e3e9b[_0x4334('0x49')]['id']){delete _0x5e3e9b[_0x4334('0x49')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x5e3e9b[_0x4334('0x4a')]['id']}})[_0x4334('0x25')](handleEntityNotFound(_0x1ea183,null))[_0x4334('0x25')](saveUpdates(_0x5e3e9b[_0x4334('0x49')],null))[_0x4334('0x25')](respondWithResult(_0x1ea183,null))[_0x4334('0x48')](handleError(_0x1ea183,null));};exports[_0x4334('0x26')]=function(_0x221578,_0x522d0d){return db[_0x4334('0x3f')][_0x4334('0x47')]({'where':{'id':_0x221578[_0x4334('0x4a')]['id']}})['then'](handleEntityNotFound(_0x522d0d,null))[_0x4334('0x25')](removeEntity(_0x522d0d,null))[_0x4334('0x48')](handleError(_0x522d0d,null));};exports[_0x4334('0x4b')]=function(_0x389296,_0x2886cc,_0x82ad1c){var _0x51fa66={};var _0x439fb0={};var _0x3485ac;var _0x2798e0;return db[_0x4334('0x3f')]['findOne']({'where':{'id':_0x389296[_0x4334('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2886cc,null))['then'](function(_0x33796a){if(_0x33796a){_0x3485ac=_0x33796a;_0x439fb0[_0x4334('0x33')]=_[_0x4334('0x44')](db[_0x4334('0x4c')]['rawAttributes']);_0x439fb0['query']=_['keys'](_0x389296[_0x4334('0x31')]);_0x439fb0[_0x4334('0x3a')]=_[_0x4334('0x32')](_0x439fb0['model'],_0x439fb0[_0x4334('0x31')]);_0x51fa66[_0x4334('0x35')]=_['intersection'](_0x439fb0[_0x4334('0x33')],qs[_0x4334('0x34')](_0x389296[_0x4334('0x31')][_0x4334('0x34')]));_0x51fa66[_0x4334('0x35')]=_0x51fa66[_0x4334('0x35')][_0x4334('0x36')]?_0x51fa66['attributes']:_0x439fb0[_0x4334('0x33')];_0x51fa66['order']=qs[_0x4334('0x38')](_0x389296['query']['sort']);_0x51fa66['where']=qs[_0x4334('0x3a')](_[_0x4334('0x4d')](_0x389296[_0x4334('0x31')],_0x439fb0[_0x4334('0x3a')]));if(_0x389296[_0x4334('0x31')][_0x4334('0x3c')]){_0x51fa66[_0x4334('0x39')]=_[_0x4334('0x3d')](_0x51fa66[_0x4334('0x39')],{'$or':_[_0x4334('0x2c')](_0x51fa66[_0x4334('0x35')],function(_0x2d1a30){var _0x4c55d0={};_0x4c55d0[_0x2d1a30]={'$like':'%'+_0x389296[_0x4334('0x31')][_0x4334('0x3c')]+'%'};return _0x4c55d0;})});}_0x51fa66=_[_0x4334('0x3d')]({},_0x51fa66,_0x389296['options']);return _0x3485ac[_0x4334('0x4b')](_0x51fa66);}})[_0x4334('0x25')](function(_0x20bf94){if(_0x20bf94){_0x2798e0=_0x20bf94[_0x4334('0x36')];if(!_0x389296[_0x4334('0x31')][_0x4334('0x4e')](_0x4334('0x4f'))){_0x51fa66['limit']=qs[_0x4334('0x1d')](_0x389296[_0x4334('0x31')][_0x4334('0x1d')]);_0x51fa66['offset']=qs['offset'](_0x389296[_0x4334('0x31')][_0x4334('0x1c')]);}return _0x3485ac[_0x4334('0x4b')](_0x51fa66);}})[_0x4334('0x25')](function(_0x3c3066){if(_0x3c3066){return _0x3c3066?{'count':_0x2798e0,'rows':_0x3c3066}:null;}})['then'](respondWithResult(_0x2886cc,null))[_0x4334('0x48')](handleError(_0x2886cc,null));};exports[_0x4334('0x50')]=function(_0x16c809,_0x1fd440,_0x3d1cff){var _0x3b7f39={};var _0x559f71={};var _0x26bd48;var _0x1256c6;return db[_0x4334('0x3f')][_0x4334('0x51')]({'where':{'id':_0x16c809[_0x4334('0x4a')]['id']}})[_0x4334('0x25')](handleEntityNotFound(_0x1fd440,null))['then'](function(_0x9be84d){if(_0x9be84d){_0x26bd48=_0x9be84d;_0x559f71[_0x4334('0x33')]=_[_0x4334('0x44')](db[_0x4334('0x4c')][_0x4334('0x45')]);_0x559f71[_0x4334('0x31')]=_['keys'](_0x16c809[_0x4334('0x31')]);_0x559f71[_0x4334('0x3a')]=_['intersection'](_0x559f71[_0x4334('0x33')],_0x559f71[_0x4334('0x31')]);_0x3b7f39[_0x4334('0x35')]=_[_0x4334('0x32')](_0x559f71['model'],qs[_0x4334('0x34')](_0x16c809[_0x4334('0x31')][_0x4334('0x34')]));_0x3b7f39['attributes']=_0x3b7f39[_0x4334('0x35')][_0x4334('0x36')]?_0x3b7f39[_0x4334('0x35')]:_0x559f71[_0x4334('0x33')];_0x3b7f39[_0x4334('0x37')]=qs['sort'](_0x16c809[_0x4334('0x31')]['sort']);_0x3b7f39['where']=qs[_0x4334('0x3a')](_[_0x4334('0x4d')](_0x16c809[_0x4334('0x31')],_0x559f71[_0x4334('0x3a')]));if(_0x16c809[_0x4334('0x31')]['filter']){_0x3b7f39[_0x4334('0x39')]=_[_0x4334('0x3d')](_0x3b7f39[_0x4334('0x39')],{'$or':_[_0x4334('0x2c')](_0x3b7f39[_0x4334('0x35')],function(_0x1f996e){var _0x2daad6={};_0x2daad6[_0x1f996e]={'$like':'%'+_0x16c809[_0x4334('0x31')]['filter']+'%'};return _0x2daad6;})});}_0x3b7f39=_[_0x4334('0x3d')]({},_0x3b7f39,_0x16c809[_0x4334('0x3e')]);return _0x26bd48['getSubjects'](_0x3b7f39);}})['then'](function(_0x555dbf){if(_0x555dbf){_0x1256c6=_0x555dbf[_0x4334('0x36')];if(!_0x16c809[_0x4334('0x31')][_0x4334('0x4e')](_0x4334('0x4f'))){_0x3b7f39[_0x4334('0x1d')]=qs[_0x4334('0x1d')](_0x16c809[_0x4334('0x31')][_0x4334('0x1d')]);_0x3b7f39[_0x4334('0x1c')]=qs[_0x4334('0x1c')](_0x16c809[_0x4334('0x31')]['offset']);}return _0x26bd48[_0x4334('0x50')](_0x3b7f39);}})[_0x4334('0x25')](function(_0x1ad372){if(_0x1ad372){return _0x1ad372?{'count':_0x1256c6,'rows':_0x1ad372}:null;}})[_0x4334('0x25')](respondWithResult(_0x1fd440,null))['catch'](handleError(_0x1fd440,null));};exports[_0x4334('0x52')]=function(_0x13c7e8,_0x4ca324,_0x1e950b){var _0x21093d={};var _0x212efc={};var _0x316bbc;var _0x44931d;return db['DeskConfiguration'][_0x4334('0x51')]({'where':{'id':_0x13c7e8[_0x4334('0x4a')]['id']}})[_0x4334('0x25')](handleEntityNotFound(_0x4ca324,null))[_0x4334('0x25')](function(_0x26fb1c){if(_0x26fb1c){_0x316bbc=_0x26fb1c;_0x212efc[_0x4334('0x33')]=_[_0x4334('0x44')](db[_0x4334('0x4c')][_0x4334('0x45')]);_0x212efc[_0x4334('0x31')]=_[_0x4334('0x44')](_0x13c7e8['query']);_0x212efc[_0x4334('0x3a')]=_[_0x4334('0x32')](_0x212efc[_0x4334('0x33')],_0x212efc[_0x4334('0x31')]);_0x21093d[_0x4334('0x35')]=_[_0x4334('0x32')](_0x212efc[_0x4334('0x33')],qs[_0x4334('0x34')](_0x13c7e8['query'][_0x4334('0x34')]));_0x21093d[_0x4334('0x35')]=_0x21093d[_0x4334('0x35')][_0x4334('0x36')]?_0x21093d['attributes']:_0x212efc[_0x4334('0x33')];_0x21093d[_0x4334('0x37')]=qs[_0x4334('0x38')](_0x13c7e8[_0x4334('0x31')][_0x4334('0x38')]);_0x21093d['where']=qs[_0x4334('0x3a')](_['pick'](_0x13c7e8[_0x4334('0x31')],_0x212efc[_0x4334('0x3a')]));if(_0x13c7e8[_0x4334('0x31')][_0x4334('0x3c')]){_0x21093d[_0x4334('0x39')]=_[_0x4334('0x3d')](_0x21093d['where'],{'$or':_['map'](_0x21093d['attributes'],function(_0x48ffaa){var _0x1c263d={};_0x1c263d[_0x48ffaa]={'$like':'%'+_0x13c7e8[_0x4334('0x31')][_0x4334('0x3c')]+'%'};return _0x1c263d;})});}_0x21093d=_[_0x4334('0x3d')]({},_0x21093d,_0x13c7e8[_0x4334('0x3e')]);return _0x316bbc[_0x4334('0x52')](_0x21093d);}})[_0x4334('0x25')](function(_0x2751ac){if(_0x2751ac){_0x44931d=_0x2751ac['length'];if(!_0x13c7e8[_0x4334('0x31')][_0x4334('0x4e')]('nolimit')){_0x21093d[_0x4334('0x1d')]=qs[_0x4334('0x1d')](_0x13c7e8[_0x4334('0x31')][_0x4334('0x1d')]);_0x21093d['offset']=qs[_0x4334('0x1c')](_0x13c7e8[_0x4334('0x31')]['offset']);}return _0x316bbc[_0x4334('0x52')](_0x21093d);}})[_0x4334('0x25')](function(_0xd1aa88){if(_0xd1aa88){return _0xd1aa88?{'count':_0x44931d,'rows':_0xd1aa88}:null;}})['then'](respondWithResult(_0x4ca324,null))[_0x4334('0x48')](handleError(_0x4ca324,null));};exports[_0x4334('0x53')]=function(_0x4a8ddf,_0xd3edca,_0x5e49ce){var _0xf5a42b={};var _0x39c396={};var _0x1da8fa;var _0x4d3222;return db[_0x4334('0x3f')][_0x4334('0x51')]({'where':{'id':_0x4a8ddf[_0x4334('0x4a')]['id']}})[_0x4334('0x25')](handleEntityNotFound(_0xd3edca,null))['then'](function(_0x988fbf){if(_0x988fbf){_0x1da8fa=_0x988fbf;_0x39c396[_0x4334('0x33')]=_[_0x4334('0x44')](db[_0x4334('0x54')][_0x4334('0x45')]);_0x39c396[_0x4334('0x31')]=_[_0x4334('0x44')](_0x4a8ddf[_0x4334('0x31')]);_0x39c396[_0x4334('0x3a')]=_[_0x4334('0x32')](_0x39c396[_0x4334('0x33')],_0x39c396[_0x4334('0x31')]);_0xf5a42b[_0x4334('0x35')]=_['intersection'](_0x39c396[_0x4334('0x33')],qs[_0x4334('0x34')](_0x4a8ddf[_0x4334('0x31')][_0x4334('0x34')]));_0xf5a42b[_0x4334('0x35')]=_0xf5a42b[_0x4334('0x35')][_0x4334('0x36')]?_0xf5a42b[_0x4334('0x35')]:_0x39c396[_0x4334('0x33')];_0xf5a42b[_0x4334('0x37')]=qs[_0x4334('0x38')](_0x4a8ddf['query'][_0x4334('0x38')]);_0xf5a42b[_0x4334('0x39')]=qs[_0x4334('0x3a')](_[_0x4334('0x4d')](_0x4a8ddf[_0x4334('0x31')],_0x39c396[_0x4334('0x3a')]));if(_0x4a8ddf[_0x4334('0x31')]['filter']){_0xf5a42b[_0x4334('0x39')]=_['merge'](_0xf5a42b[_0x4334('0x39')],{'$or':_[_0x4334('0x2c')](_0xf5a42b[_0x4334('0x35')],function(_0xe9bbd6){var _0x5dce20={};_0x5dce20[_0xe9bbd6]={'$like':'%'+_0x4a8ddf[_0x4334('0x31')][_0x4334('0x3c')]+'%'};return _0x5dce20;})});}_0xf5a42b=_[_0x4334('0x3d')]({},_0xf5a42b,_0x4a8ddf['options']);return _0x1da8fa[_0x4334('0x53')](_0xf5a42b);}})[_0x4334('0x25')](function(_0x30f7eb){if(_0x30f7eb){_0x4d3222=_0x30f7eb['length'];if(!_0x4a8ddf[_0x4334('0x31')]['hasOwnProperty']('nolimit')){_0xf5a42b[_0x4334('0x1d')]=qs['limit'](_0x4a8ddf[_0x4334('0x31')][_0x4334('0x1d')]);_0xf5a42b[_0x4334('0x1c')]=qs['offset'](_0x4a8ddf[_0x4334('0x31')][_0x4334('0x1c')]);}return _0x1da8fa['getTags'](_0xf5a42b);}})[_0x4334('0x25')](function(_0x4ede72){if(_0x4ede72){return _0x4ede72?{'count':_0x4d3222,'rows':_0x4ede72}:null;}})['then'](respondWithResult(_0xd3edca,null))[_0x4334('0x48')](handleError(_0xd3edca,null));};exports[_0x4334('0x55')]=function(_0x43edc0,_0x46e835,_0x208d5e){if(_0x43edc0[_0x4334('0x49')]['id']){delete _0x43edc0['body']['id'];}return db[_0x4334('0x3f')][_0x4334('0x51')]({'where':{'id':_0x43edc0[_0x4334('0x4a')]['id']}})[_0x4334('0x25')](handleEntityNotFound(_0x46e835,null))['then'](function(_0x2120d3){if(_0x2120d3){return _0x2120d3[_0x4334('0x55')](_0x43edc0[_0x4334('0x49')]['ids']||[]);}return null;})[_0x4334('0x25')](respondWithResult(_0x46e835,null))[_0x4334('0x48')](handleError(_0x46e835,null));}; \ No newline at end of file +var _0x4fae=['fields','length','hasOwnProperty','order','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','findOne','sort','getFields','getSubjects','DeskField','nolimit','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','DeskConfiguration','fieldName','type','key','model','query','keys','intersection','attributes'];(function(_0x486f2c,_0x3a3c9e){var _0x4874d5=function(_0x12c29a){while(--_0x12c29a){_0x486f2c['push'](_0x486f2c['shift']());}};_0x4874d5(++_0x3a3c9e);}(_0x4fae,0x78));var _0xe4fa=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4fae[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xe4fa('0x0'));var rimraf=require(_0xe4fa('0x1'));var zipdir=require(_0xe4fa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe4fa('0x3'));var moment=require(_0xe4fa('0x4'));var BPromise=require(_0xe4fa('0x5'));var Mustache=require(_0xe4fa('0x6'));var util=require(_0xe4fa('0x7'));var path=require(_0xe4fa('0x8'));var sox=require('sox');var csv=require(_0xe4fa('0x9'));var ejs=require(_0xe4fa('0xa'));var fs=require('fs');var fs_extra=require(_0xe4fa('0xb'));var _=require(_0xe4fa('0xc'));var squel=require('squel');var crypto=require(_0xe4fa('0xd'));var jsforce=require(_0xe4fa('0xe'));var deskjs=require(_0xe4fa('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe4fa('0x10'));var Papa=require(_0xe4fa('0x11'));var Redis=require(_0xe4fa('0x12'));var authService=require(_0xe4fa('0x13'));var qs=require(_0xe4fa('0x14'));var as=require(_0xe4fa('0x15'));var hardwareService=require(_0xe4fa('0x16'));var logger=require(_0xe4fa('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xe4fa('0x18'));var licenseUtil=require(_0xe4fa('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e11d7,_0x3393e0){_0x3393e0=_0x3393e0||0xcc;return function(_0x3be787){if(_0x3be787){return _0x1e11d7[_0xe4fa('0x1a')](_0x3393e0);}return _0x1e11d7[_0xe4fa('0x1b')](_0x3393e0)[_0xe4fa('0x1c')]();};}function respondWithResult(_0x415949,_0x5aecc9){_0x5aecc9=_0x5aecc9||0xc8;return function(_0x4f5d5c){if(_0x4f5d5c){return _0x415949['status'](_0x5aecc9)[_0xe4fa('0x1d')](_0x4f5d5c);}};}function respondWithFilteredResult(_0x3f814f,_0x57bb8a){return function(_0x4b76c9){if(_0x4b76c9){var _0x188d7e=typeof _0x57bb8a[_0xe4fa('0x1e')]===_0xe4fa('0x1f')&&typeof _0x57bb8a['limit']===_0xe4fa('0x1f');var _0x3f54ca=_0x4b76c9[_0xe4fa('0x20')];var _0x438dff=_0x188d7e?0x0:_0x57bb8a['offset'];var _0x2ce780=_0x188d7e?_0x4b76c9[_0xe4fa('0x20')]:_0x57bb8a[_0xe4fa('0x1e')]+_0x57bb8a[_0xe4fa('0x21')];var _0x5d5e40;if(_0x2ce780>=_0x3f54ca){_0x2ce780=_0x3f54ca;_0x5d5e40=0xc8;}else{_0x5d5e40=0xce;}_0x3f814f[_0xe4fa('0x1b')](_0x5d5e40);return _0x3f814f[_0xe4fa('0x22')](_0xe4fa('0x23'),_0x438dff+'-'+_0x2ce780+'/'+_0x3f54ca)['json'](_0x4b76c9);}return null;};}function patchUpdates(_0x56150a){return function(_0x1c4de4){try{jsonpatch[_0xe4fa('0x24')](_0x1c4de4,_0x56150a,!![]);}catch(_0x17dfcc){return BPromise['reject'](_0x17dfcc);}return _0x1c4de4['save']();};}function saveUpdates(_0xf26c06,_0x2078b9){return function(_0x34f834){if(_0x34f834){return _0x34f834[_0xe4fa('0x25')](_0xf26c06)[_0xe4fa('0x26')](function(_0x222e92){return _0x222e92;});}return null;};}function removeEntity(_0x6083fd,_0xd1ed12){return function(_0x5dd321){if(_0x5dd321){return _0x5dd321[_0xe4fa('0x27')]()[_0xe4fa('0x26')](function(){_0x6083fd[_0xe4fa('0x1b')](0xcc)[_0xe4fa('0x1c')]();});}};}function handleEntityNotFound(_0x1be804,_0x4dc2a4){return function(_0x482329){if(!_0x482329){_0x1be804[_0xe4fa('0x1a')](0x194);}return _0x482329;};}function handleError(_0xca454f,_0x1aad8e){_0x1aad8e=_0x1aad8e||0x1f4;return function(_0x2eef00){logger['error'](_0x2eef00[_0xe4fa('0x28')]);if(_0x2eef00[_0xe4fa('0x29')]){delete _0x2eef00['name'];}_0xca454f[_0xe4fa('0x1b')](_0x1aad8e)[_0xe4fa('0x2a')](_0x2eef00);};}exports[_0xe4fa('0x2b')]=function(_0x260edf,_0x51ff87){var _0xd712e1={},_0x23ea43={},_0x212194={'count':0x0,'rows':[]};var _0x387c63=_[_0xe4fa('0x2c')](db[_0xe4fa('0x2d')]['rawAttributes'],function(_0x394797){return{'name':_0x394797[_0xe4fa('0x2e')],'type':_0x394797[_0xe4fa('0x2f')][_0xe4fa('0x30')]};});_0x23ea43[_0xe4fa('0x31')]=_[_0xe4fa('0x2c')](_0x387c63,'name');_0x23ea43[_0xe4fa('0x32')]=_[_0xe4fa('0x33')](_0x260edf[_0xe4fa('0x32')]);_0x23ea43['filters']=_[_0xe4fa('0x34')](_0x23ea43[_0xe4fa('0x31')],_0x23ea43[_0xe4fa('0x32')]);_0xd712e1[_0xe4fa('0x35')]=_['intersection'](_0x23ea43['model'],qs[_0xe4fa('0x36')](_0x260edf[_0xe4fa('0x32')][_0xe4fa('0x36')]));_0xd712e1[_0xe4fa('0x35')]=_0xd712e1['attributes'][_0xe4fa('0x37')]?_0xd712e1[_0xe4fa('0x35')]:_0x23ea43[_0xe4fa('0x31')];if(!_0x260edf[_0xe4fa('0x32')][_0xe4fa('0x38')]('nolimit')){_0xd712e1[_0xe4fa('0x21')]=qs[_0xe4fa('0x21')](_0x260edf['query'][_0xe4fa('0x21')]);_0xd712e1['offset']=qs['offset'](_0x260edf['query'][_0xe4fa('0x1e')]);}_0xd712e1[_0xe4fa('0x39')]=qs['sort'](_0x260edf['query']['sort']);_0xd712e1[_0xe4fa('0x3a')]=qs['filters'](_[_0xe4fa('0x3b')](_0x260edf[_0xe4fa('0x32')],_0x23ea43[_0xe4fa('0x3c')]),_0x387c63);if(_0x260edf[_0xe4fa('0x32')][_0xe4fa('0x3d')]){_0xd712e1[_0xe4fa('0x3a')]=_[_0xe4fa('0x3e')](_0xd712e1[_0xe4fa('0x3a')],{'$or':_[_0xe4fa('0x2c')](_0x387c63,function(_0x5f143e){if(_0x5f143e[_0xe4fa('0x2f')]!==_0xe4fa('0x3f')){var _0x5b58fa={};_0x5b58fa[_0x5f143e[_0xe4fa('0x29')]]={'$like':'%'+_0x260edf[_0xe4fa('0x32')][_0xe4fa('0x3d')]+'%'};return _0x5b58fa;}})});}_0xd712e1=_['merge']({},_0xd712e1,_0x260edf[_0xe4fa('0x40')]);var _0x3f987e={'where':_0xd712e1[_0xe4fa('0x3a')]};return db[_0xe4fa('0x2d')][_0xe4fa('0x20')](_0x3f987e)[_0xe4fa('0x26')](function(_0x342d5c){_0x212194[_0xe4fa('0x20')]=_0x342d5c;if(_0x260edf['query'][_0xe4fa('0x41')]){_0xd712e1[_0xe4fa('0x42')]=[{'all':!![]}];}return db[_0xe4fa('0x2d')][_0xe4fa('0x43')](_0xd712e1);})[_0xe4fa('0x26')](function(_0xa248d7){_0x212194[_0xe4fa('0x44')]=_0xa248d7;return _0x212194;})[_0xe4fa('0x26')](respondWithFilteredResult(_0x51ff87,_0xd712e1))[_0xe4fa('0x45')](handleError(_0x51ff87,null));};exports[_0xe4fa('0x46')]=function(_0x40ca6e,_0x35b831){var _0x3ecd7a={'raw':![],'where':{'id':_0x40ca6e[_0xe4fa('0x47')]['id']}},_0x37f7b9={};_0x37f7b9[_0xe4fa('0x31')]=_[_0xe4fa('0x33')](db['DeskConfiguration'][_0xe4fa('0x48')]);_0x37f7b9[_0xe4fa('0x32')]=_[_0xe4fa('0x33')](_0x40ca6e[_0xe4fa('0x32')]);_0x37f7b9[_0xe4fa('0x3c')]=_[_0xe4fa('0x34')](_0x37f7b9[_0xe4fa('0x31')],_0x37f7b9[_0xe4fa('0x32')]);_0x3ecd7a['attributes']=_[_0xe4fa('0x34')](_0x37f7b9[_0xe4fa('0x31')],qs[_0xe4fa('0x36')](_0x40ca6e[_0xe4fa('0x32')][_0xe4fa('0x36')]));_0x3ecd7a[_0xe4fa('0x35')]=_0x3ecd7a[_0xe4fa('0x35')][_0xe4fa('0x37')]?_0x3ecd7a[_0xe4fa('0x35')]:_0x37f7b9[_0xe4fa('0x31')];if(_0x40ca6e[_0xe4fa('0x32')][_0xe4fa('0x41')]){_0x3ecd7a[_0xe4fa('0x42')]=[{'all':!![]}];}_0x3ecd7a=_[_0xe4fa('0x3e')]({},_0x3ecd7a,_0x40ca6e[_0xe4fa('0x40')]);return db[_0xe4fa('0x2d')]['find'](_0x3ecd7a)[_0xe4fa('0x26')](handleEntityNotFound(_0x35b831,null))[_0xe4fa('0x26')](respondWithResult(_0x35b831,null))[_0xe4fa('0x45')](handleError(_0x35b831,null));};exports[_0xe4fa('0x49')]=function(_0x54a948,_0x57a63c){return db['DeskConfiguration']['create'](_0x54a948['body'],{})[_0xe4fa('0x26')](respondWithResult(_0x57a63c,0xc9))[_0xe4fa('0x45')](handleError(_0x57a63c,null));};exports[_0xe4fa('0x25')]=function(_0x118dc0,_0x5d274c){if(_0x118dc0[_0xe4fa('0x4a')]['id']){delete _0x118dc0[_0xe4fa('0x4a')]['id'];}return db[_0xe4fa('0x2d')]['find']({'where':{'id':_0x118dc0[_0xe4fa('0x47')]['id']}})[_0xe4fa('0x26')](handleEntityNotFound(_0x5d274c,null))['then'](saveUpdates(_0x118dc0['body'],null))[_0xe4fa('0x26')](respondWithResult(_0x5d274c,null))[_0xe4fa('0x45')](handleError(_0x5d274c,null));};exports[_0xe4fa('0x27')]=function(_0x112a11,_0x3588e1){return db[_0xe4fa('0x2d')][_0xe4fa('0x4b')]({'where':{'id':_0x112a11[_0xe4fa('0x47')]['id']}})[_0xe4fa('0x26')](handleEntityNotFound(_0x3588e1,null))[_0xe4fa('0x26')](removeEntity(_0x3588e1,null))['catch'](handleError(_0x3588e1,null));};exports['getFields']=function(_0x44bd89,_0xc04805,_0x14303c){var _0x5e1698={};var _0x43ded5={};var _0x5da568;var _0x13631b;return db['DeskConfiguration'][_0xe4fa('0x4c')]({'where':{'id':_0x44bd89[_0xe4fa('0x47')]['id']}})[_0xe4fa('0x26')](handleEntityNotFound(_0xc04805,null))[_0xe4fa('0x26')](function(_0x5d4e10){if(_0x5d4e10){_0x5da568=_0x5d4e10;_0x43ded5[_0xe4fa('0x31')]=_[_0xe4fa('0x33')](db['DeskField']['rawAttributes']);_0x43ded5[_0xe4fa('0x32')]=_[_0xe4fa('0x33')](_0x44bd89[_0xe4fa('0x32')]);_0x43ded5[_0xe4fa('0x3c')]=_[_0xe4fa('0x34')](_0x43ded5[_0xe4fa('0x31')],_0x43ded5[_0xe4fa('0x32')]);_0x5e1698[_0xe4fa('0x35')]=_[_0xe4fa('0x34')](_0x43ded5[_0xe4fa('0x31')],qs[_0xe4fa('0x36')](_0x44bd89[_0xe4fa('0x32')]['fields']));_0x5e1698[_0xe4fa('0x35')]=_0x5e1698['attributes'][_0xe4fa('0x37')]?_0x5e1698[_0xe4fa('0x35')]:_0x43ded5['model'];_0x5e1698[_0xe4fa('0x39')]=qs[_0xe4fa('0x4d')](_0x44bd89[_0xe4fa('0x32')][_0xe4fa('0x4d')]);_0x5e1698[_0xe4fa('0x3a')]=qs['filters'](_[_0xe4fa('0x3b')](_0x44bd89['query'],_0x43ded5['filters']));if(_0x44bd89[_0xe4fa('0x32')][_0xe4fa('0x3d')]){_0x5e1698[_0xe4fa('0x3a')]=_['merge'](_0x5e1698[_0xe4fa('0x3a')],{'$or':_[_0xe4fa('0x2c')](_0x5e1698[_0xe4fa('0x35')],function(_0x3866f7){var _0x544590={};_0x544590[_0x3866f7]={'$like':'%'+_0x44bd89['query'][_0xe4fa('0x3d')]+'%'};return _0x544590;})});}_0x5e1698=_[_0xe4fa('0x3e')]({},_0x5e1698,_0x44bd89[_0xe4fa('0x40')]);return _0x5da568[_0xe4fa('0x4e')](_0x5e1698);}})[_0xe4fa('0x26')](function(_0x14eeb1){if(_0x14eeb1){_0x13631b=_0x14eeb1[_0xe4fa('0x37')];if(!_0x44bd89[_0xe4fa('0x32')]['hasOwnProperty']('nolimit')){_0x5e1698[_0xe4fa('0x21')]=qs[_0xe4fa('0x21')](_0x44bd89['query']['limit']);_0x5e1698[_0xe4fa('0x1e')]=qs[_0xe4fa('0x1e')](_0x44bd89[_0xe4fa('0x32')][_0xe4fa('0x1e')]);}return _0x5da568[_0xe4fa('0x4e')](_0x5e1698);}})[_0xe4fa('0x26')](function(_0x7334da){if(_0x7334da){return _0x7334da?{'count':_0x13631b,'rows':_0x7334da}:null;}})[_0xe4fa('0x26')](respondWithResult(_0xc04805,null))[_0xe4fa('0x45')](handleError(_0xc04805,null));};exports[_0xe4fa('0x4f')]=function(_0x3d63f6,_0x51f280,_0x2001dd){var _0x369e3f={};var _0x543cdb={};var _0x2a2215;var _0x2501b1;return db[_0xe4fa('0x2d')][_0xe4fa('0x4c')]({'where':{'id':_0x3d63f6['params']['id']}})[_0xe4fa('0x26')](handleEntityNotFound(_0x51f280,null))[_0xe4fa('0x26')](function(_0x38975d){if(_0x38975d){_0x2a2215=_0x38975d;_0x543cdb[_0xe4fa('0x31')]=_[_0xe4fa('0x33')](db[_0xe4fa('0x50')]['rawAttributes']);_0x543cdb[_0xe4fa('0x32')]=_[_0xe4fa('0x33')](_0x3d63f6[_0xe4fa('0x32')]);_0x543cdb[_0xe4fa('0x3c')]=_[_0xe4fa('0x34')](_0x543cdb[_0xe4fa('0x31')],_0x543cdb['query']);_0x369e3f[_0xe4fa('0x35')]=_[_0xe4fa('0x34')](_0x543cdb[_0xe4fa('0x31')],qs[_0xe4fa('0x36')](_0x3d63f6[_0xe4fa('0x32')]['fields']));_0x369e3f[_0xe4fa('0x35')]=_0x369e3f[_0xe4fa('0x35')][_0xe4fa('0x37')]?_0x369e3f[_0xe4fa('0x35')]:_0x543cdb[_0xe4fa('0x31')];_0x369e3f['order']=qs[_0xe4fa('0x4d')](_0x3d63f6[_0xe4fa('0x32')][_0xe4fa('0x4d')]);_0x369e3f[_0xe4fa('0x3a')]=qs[_0xe4fa('0x3c')](_['pick'](_0x3d63f6[_0xe4fa('0x32')],_0x543cdb[_0xe4fa('0x3c')]));if(_0x3d63f6['query'][_0xe4fa('0x3d')]){_0x369e3f[_0xe4fa('0x3a')]=_[_0xe4fa('0x3e')](_0x369e3f[_0xe4fa('0x3a')],{'$or':_[_0xe4fa('0x2c')](_0x369e3f[_0xe4fa('0x35')],function(_0x5e0f08){var _0x37cf1c={};_0x37cf1c[_0x5e0f08]={'$like':'%'+_0x3d63f6[_0xe4fa('0x32')][_0xe4fa('0x3d')]+'%'};return _0x37cf1c;})});}_0x369e3f=_[_0xe4fa('0x3e')]({},_0x369e3f,_0x3d63f6[_0xe4fa('0x40')]);return _0x2a2215[_0xe4fa('0x4f')](_0x369e3f);}})[_0xe4fa('0x26')](function(_0x407b85){if(_0x407b85){_0x2501b1=_0x407b85[_0xe4fa('0x37')];if(!_0x3d63f6[_0xe4fa('0x32')][_0xe4fa('0x38')](_0xe4fa('0x51'))){_0x369e3f[_0xe4fa('0x21')]=qs[_0xe4fa('0x21')](_0x3d63f6[_0xe4fa('0x32')]['limit']);_0x369e3f[_0xe4fa('0x1e')]=qs[_0xe4fa('0x1e')](_0x3d63f6[_0xe4fa('0x32')][_0xe4fa('0x1e')]);}return _0x2a2215[_0xe4fa('0x4f')](_0x369e3f);}})['then'](function(_0x5945b3){if(_0x5945b3){return _0x5945b3?{'count':_0x2501b1,'rows':_0x5945b3}:null;}})[_0xe4fa('0x26')](respondWithResult(_0x51f280,null))[_0xe4fa('0x45')](handleError(_0x51f280,null));};exports[_0xe4fa('0x52')]=function(_0x1c792a,_0x50e02a,_0x4f1df3){var _0x8e4ff0={};var _0x1330bc={};var _0x51e25c;var _0x1f309f;return db['DeskConfiguration'][_0xe4fa('0x4c')]({'where':{'id':_0x1c792a['params']['id']}})[_0xe4fa('0x26')](handleEntityNotFound(_0x50e02a,null))[_0xe4fa('0x26')](function(_0x5afd8d){if(_0x5afd8d){_0x51e25c=_0x5afd8d;_0x1330bc[_0xe4fa('0x31')]=_[_0xe4fa('0x33')](db['DeskField'][_0xe4fa('0x48')]);_0x1330bc[_0xe4fa('0x32')]=_[_0xe4fa('0x33')](_0x1c792a[_0xe4fa('0x32')]);_0x1330bc['filters']=_[_0xe4fa('0x34')](_0x1330bc[_0xe4fa('0x31')],_0x1330bc[_0xe4fa('0x32')]);_0x8e4ff0[_0xe4fa('0x35')]=_['intersection'](_0x1330bc['model'],qs[_0xe4fa('0x36')](_0x1c792a['query'][_0xe4fa('0x36')]));_0x8e4ff0[_0xe4fa('0x35')]=_0x8e4ff0[_0xe4fa('0x35')][_0xe4fa('0x37')]?_0x8e4ff0['attributes']:_0x1330bc[_0xe4fa('0x31')];_0x8e4ff0[_0xe4fa('0x39')]=qs[_0xe4fa('0x4d')](_0x1c792a[_0xe4fa('0x32')][_0xe4fa('0x4d')]);_0x8e4ff0['where']=qs[_0xe4fa('0x3c')](_[_0xe4fa('0x3b')](_0x1c792a[_0xe4fa('0x32')],_0x1330bc['filters']));if(_0x1c792a[_0xe4fa('0x32')][_0xe4fa('0x3d')]){_0x8e4ff0[_0xe4fa('0x3a')]=_[_0xe4fa('0x3e')](_0x8e4ff0[_0xe4fa('0x3a')],{'$or':_[_0xe4fa('0x2c')](_0x8e4ff0[_0xe4fa('0x35')],function(_0x5d0771){var _0x43f420={};_0x43f420[_0x5d0771]={'$like':'%'+_0x1c792a['query'][_0xe4fa('0x3d')]+'%'};return _0x43f420;})});}_0x8e4ff0=_[_0xe4fa('0x3e')]({},_0x8e4ff0,_0x1c792a['options']);return _0x51e25c[_0xe4fa('0x52')](_0x8e4ff0);}})['then'](function(_0x4a8fed){if(_0x4a8fed){_0x1f309f=_0x4a8fed['length'];if(!_0x1c792a[_0xe4fa('0x32')][_0xe4fa('0x38')](_0xe4fa('0x51'))){_0x8e4ff0['limit']=qs[_0xe4fa('0x21')](_0x1c792a[_0xe4fa('0x32')][_0xe4fa('0x21')]);_0x8e4ff0['offset']=qs['offset'](_0x1c792a[_0xe4fa('0x32')][_0xe4fa('0x1e')]);}return _0x51e25c[_0xe4fa('0x52')](_0x8e4ff0);}})[_0xe4fa('0x26')](function(_0x26b763){if(_0x26b763){return _0x26b763?{'count':_0x1f309f,'rows':_0x26b763}:null;}})['then'](respondWithResult(_0x50e02a,null))['catch'](handleError(_0x50e02a,null));};exports[_0xe4fa('0x53')]=function(_0x2affce,_0x514e56,_0x4a65f6){var _0xa869b0={};var _0x236ce4={};var _0x36bee8;var _0x5a7fb8;return db[_0xe4fa('0x2d')][_0xe4fa('0x4c')]({'where':{'id':_0x2affce['params']['id']}})[_0xe4fa('0x26')](handleEntityNotFound(_0x514e56,null))['then'](function(_0x350fcd){if(_0x350fcd){_0x36bee8=_0x350fcd;_0x236ce4[_0xe4fa('0x31')]=_[_0xe4fa('0x33')](db[_0xe4fa('0x54')][_0xe4fa('0x48')]);_0x236ce4[_0xe4fa('0x32')]=_[_0xe4fa('0x33')](_0x2affce['query']);_0x236ce4[_0xe4fa('0x3c')]=_[_0xe4fa('0x34')](_0x236ce4[_0xe4fa('0x31')],_0x236ce4[_0xe4fa('0x32')]);_0xa869b0[_0xe4fa('0x35')]=_[_0xe4fa('0x34')](_0x236ce4[_0xe4fa('0x31')],qs[_0xe4fa('0x36')](_0x2affce[_0xe4fa('0x32')]['fields']));_0xa869b0[_0xe4fa('0x35')]=_0xa869b0['attributes'][_0xe4fa('0x37')]?_0xa869b0[_0xe4fa('0x35')]:_0x236ce4[_0xe4fa('0x31')];_0xa869b0['order']=qs[_0xe4fa('0x4d')](_0x2affce[_0xe4fa('0x32')][_0xe4fa('0x4d')]);_0xa869b0[_0xe4fa('0x3a')]=qs[_0xe4fa('0x3c')](_[_0xe4fa('0x3b')](_0x2affce[_0xe4fa('0x32')],_0x236ce4[_0xe4fa('0x3c')]));if(_0x2affce[_0xe4fa('0x32')][_0xe4fa('0x3d')]){_0xa869b0['where']=_['merge'](_0xa869b0['where'],{'$or':_[_0xe4fa('0x2c')](_0xa869b0['attributes'],function(_0x2267a7){var _0x5d1cbb={};_0x5d1cbb[_0x2267a7]={'$like':'%'+_0x2affce[_0xe4fa('0x32')]['filter']+'%'};return _0x5d1cbb;})});}_0xa869b0=_[_0xe4fa('0x3e')]({},_0xa869b0,_0x2affce[_0xe4fa('0x40')]);return _0x36bee8[_0xe4fa('0x53')](_0xa869b0);}})['then'](function(_0x2a057c){if(_0x2a057c){_0x5a7fb8=_0x2a057c[_0xe4fa('0x37')];if(!_0x2affce[_0xe4fa('0x32')][_0xe4fa('0x38')](_0xe4fa('0x51'))){_0xa869b0[_0xe4fa('0x21')]=qs[_0xe4fa('0x21')](_0x2affce['query']['limit']);_0xa869b0[_0xe4fa('0x1e')]=qs[_0xe4fa('0x1e')](_0x2affce[_0xe4fa('0x32')][_0xe4fa('0x1e')]);}return _0x36bee8[_0xe4fa('0x53')](_0xa869b0);}})[_0xe4fa('0x26')](function(_0x12cec4){if(_0x12cec4){return _0x12cec4?{'count':_0x5a7fb8,'rows':_0x12cec4}:null;}})['then'](respondWithResult(_0x514e56,null))[_0xe4fa('0x45')](handleError(_0x514e56,null));};exports['setTags']=function(_0x30c077,_0x221d65,_0x30ffe3){if(_0x30c077[_0xe4fa('0x4a')]['id']){delete _0x30c077[_0xe4fa('0x4a')]['id'];}return db[_0xe4fa('0x2d')][_0xe4fa('0x4c')]({'where':{'id':_0x30c077['params']['id']}})[_0xe4fa('0x26')](handleEntityNotFound(_0x221d65,null))[_0xe4fa('0x26')](function(_0x2b78fa){if(_0x2b78fa){return _0x2b78fa[_0xe4fa('0x55')](_0x30c077[_0xe4fa('0x4a')][_0xe4fa('0x56')]||[]);}return null;})[_0xe4fa('0x26')](respondWithResult(_0x221d65,null))[_0xe4fa('0x45')](handleError(_0x221d65,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 88ed2df..4b900c0 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 _0x543c=['api','bluebird','request-promise','path','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','lodash','../../config/logger'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x543c,0xf8));var _0xc543=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x543c[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0xc543('0x0'));var util=require('util');var logger=require(_0xc543('0x1'))(_0xc543('0x2'));var moment=require('moment');var BPromise=require(_0xc543('0x3'));var rp=require(_0xc543('0x4'));var fs=require('fs');var path=require(_0xc543('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc543('0x6'));module[_0xc543('0x7')]=function(_0x4bb08a,_0x24b56e){return _0x4bb08a[_0xc543('0x8')]('DeskConfiguration',attributes,{'tableName':_0xc543('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdff=['exports','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x1bd54f,_0x16e1d7){var _0x5b19fb=function(_0x14a10b){while(--_0x14a10b){_0x1bd54f['push'](_0x1bd54f['shift']());}};_0x5b19fb(++_0x16e1d7);}(_0xbdff,0x19b));var _0xfbdf=function(_0x17cbfe,_0x1df5d3){_0x17cbfe=_0x17cbfe-0x0;var _0x44aa73=_0xbdff[_0x17cbfe];return _0x44aa73;};'use strict';var _=require('lodash');var util=require(_0xfbdf('0x0'));var logger=require(_0xfbdf('0x1'))(_0xfbdf('0x2'));var moment=require(_0xfbdf('0x3'));var BPromise=require(_0xfbdf('0x4'));var rp=require(_0xfbdf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbdf('0x6'));var config=require(_0xfbdf('0x7'));var attributes=require(_0xfbdf('0x8'));module[_0xfbdf('0x9')]=function(_0x5e0b9b,_0x1b00bc){return _0x5e0b9b['define'](_0xfbdf('0xa'),attributes,{'tableName':_0xfbdf('0xb'),'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 4861510..a50e03d 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 _0x97db=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','ioredis'];(function(_0x347fba,_0x28225d){var _0x214748=function(_0x21c54a){while(--_0x21c54a){_0x347fba['push'](_0x347fba['shift']());}};_0x214748(++_0x28225d);}(_0x97db,0x1b4));var _0xb97d=function(_0xa93c8b,_0x4206b3){_0xa93c8b=_0xa93c8b-0x0;var _0x20b875=_0x97db[_0xa93c8b];return _0x20b875;};'use strict';var _=require(_0xb97d('0x0'));var util=require(_0xb97d('0x1'));var moment=require(_0xb97d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb97d('0x3'));var db=require(_0xb97d('0x4'))['db'];var utils=require(_0xb97d('0x5'));var logger=require(_0xb97d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb97d('0x7'));var client=jayson[_0xb97d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x533149,_0x2ff80e,_0x57cbd4){return new BPromise(function(_0x20f1e1,_0x2e1230){return client['request'](_0x533149,_0x57cbd4)[_0xb97d('0x9')](function(_0xe9acff){logger[_0xb97d('0xa')](_0xb97d('0xb'),_0x2ff80e,'request\x20sent');logger[_0xb97d('0xc')](_0xb97d('0xd'),_0x2ff80e,_0xb97d('0xe'),JSON[_0xb97d('0xf')](_0xe9acff));if(_0xe9acff[_0xb97d('0x10')]){if(_0xe9acff[_0xb97d('0x10')][_0xb97d('0x11')]===0x1f4){logger[_0xb97d('0x10')](_0xb97d('0xb'),_0x2ff80e,_0xe9acff[_0xb97d('0x10')][_0xb97d('0x12')]);return _0x2e1230(_0xe9acff[_0xb97d('0x10')][_0xb97d('0x12')]);}logger[_0xb97d('0x10')](_0xb97d('0xb'),_0x2ff80e,_0xe9acff[_0xb97d('0x10')][_0xb97d('0x12')]);return _0x20f1e1(_0xe9acff[_0xb97d('0x10')]['message']);}else{logger[_0xb97d('0xa')](_0xb97d('0xb'),_0x2ff80e,_0xb97d('0xe'));_0x20f1e1(_0xe9acff[_0xb97d('0x13')][_0xb97d('0x12')]);}})['catch'](function(_0x416d6a){logger[_0xb97d('0x10')](_0xb97d('0xb'),_0x2ff80e,_0x416d6a);_0x2e1230(_0x416d6a);});});} \ No newline at end of file +var _0xd70e=['error','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x370361,_0x22aefe){var _0x32b2f8=function(_0x5f35c0){while(--_0x5f35c0){_0x370361['push'](_0x370361['shift']());}};_0x32b2f8(++_0x22aefe);}(_0xd70e,0x157));var _0xed70=function(_0x2899b8,_0x532d23){_0x2899b8=_0x2899b8-0x0;var _0x548871=_0xd70e[_0x2899b8];return _0x548871;};'use strict';var _=require(_0xed70('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xed70('0x1'));var rs=require(_0xed70('0x2'));var fs=require('fs');var Redis=require(_0xed70('0x3'));var db=require(_0xed70('0x4'))['db'];var utils=require(_0xed70('0x5'));var logger=require(_0xed70('0x6'))(_0xed70('0x7'));var config=require('../../config/environment');var jayson=require(_0xed70('0x8'));var client=jayson[_0xed70('0x9')][_0xed70('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bd1ae,_0x503bb4,_0x1b81ab){return new BPromise(function(_0x4d8eb0,_0xbf666c){return client['request'](_0x3bd1ae,_0x1b81ab)[_0xed70('0xb')](function(_0x26ca4f){logger[_0xed70('0xc')](_0xed70('0xd'),_0x503bb4,_0xed70('0xe'));logger[_0xed70('0xf')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x503bb4,_0xed70('0xe'),JSON[_0xed70('0x10')](_0x26ca4f));if(_0x26ca4f[_0xed70('0x11')]){if(_0x26ca4f[_0xed70('0x11')]['code']===0x1f4){logger['error'](_0xed70('0xd'),_0x503bb4,_0x26ca4f[_0xed70('0x11')]['message']);return _0xbf666c(_0x26ca4f[_0xed70('0x11')]['message']);}logger[_0xed70('0x11')](_0xed70('0xd'),_0x503bb4,_0x26ca4f[_0xed70('0x11')]['message']);return _0x4d8eb0(_0x26ca4f[_0xed70('0x11')][_0xed70('0x12')]);}else{logger['info'](_0xed70('0xd'),_0x503bb4,_0xed70('0xe'));_0x4d8eb0(_0x26ca4f[_0xed70('0x13')][_0xed70('0x12')]);}})['catch'](function(_0xa04148){logger[_0xed70('0x11')](_0xed70('0xd'),_0x503bb4,_0xa04148);_0xbf666c(_0xa04148);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index e1bbe25..326b24d 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 _0xff59=['../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service'];(function(_0x1663ae,_0x10484a){var _0x30ffb8=function(_0x21e006){while(--_0x21e006){_0x1663ae['push'](_0x1663ae['shift']());}};_0x30ffb8(++_0x10484a);}(_0xff59,0x79));var _0x9ff5=function(_0x22c78c,_0x2f56d7){_0x22c78c=_0x22c78c-0x0;var _0x47853c=_0xff59[_0x22c78c];return _0x47853c;};'use strict';var multer=require('multer');var util=require(_0x9ff5('0x0'));var path=require(_0x9ff5('0x1'));var timeout=require('connect-timeout');var express=require(_0x9ff5('0x2'));var router=express[_0x9ff5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9ff5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9ff5('0x5'));var controller=require(_0x9ff5('0x6'));router[_0x9ff5('0x7')]('/',auth['isAuthenticated'](),controller[_0x9ff5('0x8')]);router['get'](_0x9ff5('0x9'),auth[_0x9ff5('0xa')](),controller[_0x9ff5('0xb')]);router[_0x9ff5('0xc')]('/',auth[_0x9ff5('0xa')](),controller['create']);router[_0x9ff5('0xd')](_0x9ff5('0x9'),auth[_0x9ff5('0xa')](),controller[_0x9ff5('0xe')]);router[_0x9ff5('0xf')](_0x9ff5('0x9'),auth[_0x9ff5('0xa')](),controller[_0x9ff5('0x10')]);module[_0x9ff5('0x11')]=router; \ No newline at end of file +var _0x1472=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskField.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','multer','util'];(function(_0x296754,_0x5befe9){var _0x1d9f1d=function(_0x3f033e){while(--_0x3f033e){_0x296754['push'](_0x296754['shift']());}};_0x1d9f1d(++_0x5befe9);}(_0x1472,0x166));var _0x2147=function(_0x389c94,_0x2a93d9){_0x389c94=_0x389c94-0x0;var _0x1455cb=_0x1472[_0x389c94];return _0x1455cb;};'use strict';var multer=require(_0x2147('0x0'));var util=require(_0x2147('0x1'));var path=require(_0x2147('0x2'));var timeout=require(_0x2147('0x3'));var express=require(_0x2147('0x4'));var router=express[_0x2147('0x5')]();var fs_extra=require(_0x2147('0x6'));var auth=require(_0x2147('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2147('0x8'));router[_0x2147('0x9')]('/',auth[_0x2147('0xa')](),controller['index']);router['get'](_0x2147('0xb'),auth['isAuthenticated'](),controller[_0x2147('0xc')]);router[_0x2147('0xd')]('/',auth[_0x2147('0xa')](),controller['create']);router[_0x2147('0xe')](_0x2147('0xb'),auth['isAuthenticated'](),controller[_0x2147('0xf')]);router[_0x2147('0x10')](_0x2147('0xb'),auth[_0x2147('0xa')](),controller[_0x2147('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 4084b74..21bc271 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 _0xb094=['string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','keyValue','picklist'];(function(_0x3a6edb,_0x1c152c){var _0x32358c=function(_0x46262c){while(--_0x46262c){_0x3a6edb['push'](_0x3a6edb['shift']());}};_0x32358c(++_0x1c152c);}(_0xb094,0x100));var _0x4b09=function(_0x4206e2,_0x2b2a67){_0x4206e2=_0x4206e2-0x0;var _0x1f9f7a=_0xb094[_0x4206e2];return _0x1f9f7a;};'use strict';var Sequelize=require(_0x4b09('0x0'));module[_0x4b09('0x1')]={'type':{'type':Sequelize[_0x4b09('0x2')]('string','variable','customVariable',_0x4b09('0x3'),_0x4b09('0x4')),'defaultValue':_0x4b09('0x5')},'content':{'type':Sequelize[_0x4b09('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4b09('0x2')](_0x4b09('0x5'),'variable',_0x4b09('0x7'))},'keyContent':{'type':Sequelize[_0x4b09('0x6')]},'idField':{'type':Sequelize[_0x4b09('0x6')]},'nameField':{'type':Sequelize[_0x4b09('0x6')]},'customField':{'type':Sequelize[_0x4b09('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7ee3=['ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize'];(function(_0x1104f4,_0xaedc58){var _0xfbb1be=function(_0x58d893){while(--_0x58d893){_0x1104f4['push'](_0x1104f4['shift']());}};_0xfbb1be(++_0xaedc58);}(_0x7ee3,0x8f));var _0x37ee=function(_0x8cbd17,_0x3913d4){_0x8cbd17=_0x8cbd17-0x0;var _0x35840a=_0x7ee3[_0x8cbd17];return _0x35840a;};'use strict';var Sequelize=require(_0x37ee('0x0'));module['exports']={'type':{'type':Sequelize[_0x37ee('0x1')](_0x37ee('0x2'),_0x37ee('0x3'),_0x37ee('0x4'),'keyValue',_0x37ee('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x37ee('0x6')]},'key':{'type':Sequelize[_0x37ee('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x37ee('0x2'),_0x37ee('0x3'),_0x37ee('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x37ee('0x6')]},'nameField':{'type':Sequelize[_0x37ee('0x6')]},'customField':{'type':Sequelize[_0x37ee('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x37ee('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 2d88324..46786cb 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 _0xfcf0=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','DeskField','rawAttributes','fieldName','type','key','model','map','keys','query','filters'];(function(_0x414715,_0x155980){var _0x508c8b=function(_0x341741){while(--_0x341741){_0x414715['push'](_0x414715['shift']());}};_0x508c8b(++_0x155980);}(_0xfcf0,0x138));var _0x0fcf=function(_0x4828b1,_0x5c8cf3){_0x4828b1=_0x4828b1-0x0;var _0x1fec1b=_0xfcf0[_0x4828b1];return _0x1fec1b;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':!![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')](_0x1fb83d[_0x0fcf('0x47')],{})['then'](respondWithResult(_0x345188,0xc9))['catch'](handleError(_0x345188,null));};exports[_0x0fcf('0x23')]=function(_0x243699,_0x28d2f4){if(_0x243699[_0x0fcf('0x47')]['id']){delete _0x243699[_0x0fcf('0x47')]['id'];}return db[_0x0fcf('0x2b')]['find']({'where':{'id':_0x243699[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x28d2f4,null))['then'](saveUpdates(_0x243699[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x28d2f4,null))[_0x0fcf('0x42')](handleError(_0x28d2f4,null));};exports[_0x0fcf('0x25')]=function(_0x5435c0,_0xc514bf){return db[_0x0fcf('0x2b')][_0x0fcf('0x48')]({'where':{'id':_0x5435c0[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0xc514bf,null))[_0x0fcf('0x24')](removeEntity(_0xc514bf,null))[_0x0fcf('0x42')](handleError(_0xc514bf,null));}; \ No newline at end of file +var _0xfb67=['catch','show','rawAttributes','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','sendStatus','error','name','DeskField','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','rows'];(function(_0x3b3c5e,_0x4ad66f){var _0x4bbb83=function(_0x2512da){while(--_0x2512da){_0x3b3c5e['push'](_0x3b3c5e['shift']());}};_0x4bbb83(++_0x4ad66f);}(_0xfb67,0xdd));var _0x7fb6=function(_0x2047f8,_0x42249f){_0x2047f8=_0x2047f8-0x0;var _0xa98588=_0xfb67[_0x2047f8];return _0xa98588;};'use strict';var emlformat=require(_0x7fb6('0x0'));var rimraf=require(_0x7fb6('0x1'));var zipdir=require(_0x7fb6('0x2'));var jsonpatch=require(_0x7fb6('0x3'));var rp=require(_0x7fb6('0x4'));var moment=require(_0x7fb6('0x5'));var BPromise=require(_0x7fb6('0x6'));var Mustache=require('mustache');var util=require(_0x7fb6('0x7'));var path=require(_0x7fb6('0x8'));var sox=require(_0x7fb6('0x9'));var csv=require(_0x7fb6('0xa'));var ejs=require(_0x7fb6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fb6('0xc'));var squel=require(_0x7fb6('0xd'));var crypto=require(_0x7fb6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7fb6('0xf'));var toCsv=require(_0x7fb6('0xa'));var querystring=require('querystring');var Papa=require(_0x7fb6('0x10'));var Redis=require(_0x7fb6('0x11'));var authService=require(_0x7fb6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7fb6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fb6('0x14'))(_0x7fb6('0x15'));var utils=require(_0x7fb6('0x16'));var config=require(_0x7fb6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fb6('0x18'))['db'];function respondWithStatusCode(_0x1b6ac7,_0x3c594f){_0x3c594f=_0x3c594f||0xcc;return function(_0x549370){if(_0x549370){return _0x1b6ac7['sendStatus'](_0x3c594f);}return _0x1b6ac7['status'](_0x3c594f)['end']();};}function respondWithResult(_0x4fe18e,_0x59287e){_0x59287e=_0x59287e||0xc8;return function(_0x2e8b7c){if(_0x2e8b7c){return _0x4fe18e[_0x7fb6('0x19')](_0x59287e)['json'](_0x2e8b7c);}};}function respondWithFilteredResult(_0x196700,_0x3e4441){return function(_0x5046e2){if(_0x5046e2){var _0xb4c375=typeof _0x3e4441[_0x7fb6('0x1a')]===_0x7fb6('0x1b')&&typeof _0x3e4441[_0x7fb6('0x1c')]===_0x7fb6('0x1b');var _0x26c3ec=_0x5046e2[_0x7fb6('0x1d')];var _0x3ef701=_0xb4c375?0x0:_0x3e4441[_0x7fb6('0x1a')];var _0x5de506=_0xb4c375?_0x5046e2[_0x7fb6('0x1d')]:_0x3e4441[_0x7fb6('0x1a')]+_0x3e4441[_0x7fb6('0x1c')];var _0x169389;if(_0x5de506>=_0x26c3ec){_0x5de506=_0x26c3ec;_0x169389=0xc8;}else{_0x169389=0xce;}_0x196700[_0x7fb6('0x19')](_0x169389);return _0x196700[_0x7fb6('0x1e')](_0x7fb6('0x1f'),_0x3ef701+'-'+_0x5de506+'/'+_0x26c3ec)['json'](_0x5046e2);}return null;};}function patchUpdates(_0x5e6997){return function(_0x1fa63a){try{jsonpatch[_0x7fb6('0x20')](_0x1fa63a,_0x5e6997,!![]);}catch(_0x293c9d){return BPromise[_0x7fb6('0x21')](_0x293c9d);}return _0x1fa63a['save']();};}function saveUpdates(_0xc44cf5,_0x13ad95){return function(_0x490749){if(_0x490749){return _0x490749[_0x7fb6('0x22')](_0xc44cf5)['then'](function(_0x488cd2){return _0x488cd2;});}return null;};}function removeEntity(_0x34a4d1,_0x4b15e5){return function(_0x51ed55){if(_0x51ed55){return _0x51ed55['destroy']()[_0x7fb6('0x23')](function(){_0x34a4d1['status'](0xcc)[_0x7fb6('0x24')]();});}};}function handleEntityNotFound(_0x4a9866,_0x3566a1){return function(_0xc60290){if(!_0xc60290){_0x4a9866[_0x7fb6('0x25')](0x194);}return _0xc60290;};}function handleError(_0x260e8b,_0x253f23){_0x253f23=_0x253f23||0x1f4;return function(_0x4c9b90){logger[_0x7fb6('0x26')](_0x4c9b90['stack']);if(_0x4c9b90[_0x7fb6('0x27')]){delete _0x4c9b90[_0x7fb6('0x27')];}_0x260e8b['status'](_0x253f23)['send'](_0x4c9b90);};}exports['index']=function(_0x25216a,_0x440a04){var _0x35e18f={},_0x3bf606={},_0x7f3844={'count':0x0,'rows':[]};var _0x2bc3b9=_['map'](db[_0x7fb6('0x28')]['rawAttributes'],function(_0x4221c3){return{'name':_0x4221c3[_0x7fb6('0x29')],'type':_0x4221c3[_0x7fb6('0x2a')][_0x7fb6('0x2b')]};});_0x3bf606[_0x7fb6('0x2c')]=_[_0x7fb6('0x2d')](_0x2bc3b9,_0x7fb6('0x27'));_0x3bf606[_0x7fb6('0x2e')]=_[_0x7fb6('0x2f')](_0x25216a['query']);_0x3bf606[_0x7fb6('0x30')]=_[_0x7fb6('0x31')](_0x3bf606[_0x7fb6('0x2c')],_0x3bf606[_0x7fb6('0x2e')]);_0x35e18f[_0x7fb6('0x32')]=_[_0x7fb6('0x31')](_0x3bf606[_0x7fb6('0x2c')],qs[_0x7fb6('0x33')](_0x25216a[_0x7fb6('0x2e')]['fields']));_0x35e18f[_0x7fb6('0x32')]=_0x35e18f[_0x7fb6('0x32')][_0x7fb6('0x34')]?_0x35e18f[_0x7fb6('0x32')]:_0x3bf606['model'];if(!_0x25216a['query'][_0x7fb6('0x35')](_0x7fb6('0x36'))){_0x35e18f[_0x7fb6('0x1c')]=qs[_0x7fb6('0x1c')](_0x25216a[_0x7fb6('0x2e')]['limit']);_0x35e18f[_0x7fb6('0x1a')]=qs[_0x7fb6('0x1a')](_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x1a')]);}_0x35e18f['order']=qs[_0x7fb6('0x37')](_0x25216a[_0x7fb6('0x2e')]['sort']);_0x35e18f[_0x7fb6('0x38')]=qs['filters'](_[_0x7fb6('0x39')](_0x25216a['query'],_0x3bf606[_0x7fb6('0x30')]),_0x2bc3b9);if(_0x25216a['query'][_0x7fb6('0x3a')]){_0x35e18f[_0x7fb6('0x38')]=_[_0x7fb6('0x3b')](_0x35e18f[_0x7fb6('0x38')],{'$or':_[_0x7fb6('0x2d')](_0x2bc3b9,function(_0x39edfe){if(_0x39edfe['type']!=='VIRTUAL'){var _0x5d237={};_0x5d237[_0x39edfe[_0x7fb6('0x27')]]={'$like':'%'+_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x3a')]+'%'};return _0x5d237;}})});}_0x35e18f=_['merge']({},_0x35e18f,_0x25216a['options']);var _0x213e6a={'where':_0x35e18f['where']};return db[_0x7fb6('0x28')][_0x7fb6('0x1d')](_0x213e6a)[_0x7fb6('0x23')](function(_0x33828c){_0x7f3844[_0x7fb6('0x1d')]=_0x33828c;if(_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x3c')]){_0x35e18f[_0x7fb6('0x3d')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x35e18f);})[_0x7fb6('0x23')](function(_0x543de3){_0x7f3844[_0x7fb6('0x3e')]=_0x543de3;return _0x7f3844;})[_0x7fb6('0x23')](respondWithFilteredResult(_0x440a04,_0x35e18f))[_0x7fb6('0x3f')](handleError(_0x440a04,null));};exports[_0x7fb6('0x40')]=function(_0x6fa286,_0x3b77ba){var _0x1dbfb8={'raw':!![],'where':{'id':_0x6fa286['params']['id']}},_0x661d04={};_0x661d04['model']=_[_0x7fb6('0x2f')](db['DeskField'][_0x7fb6('0x41')]);_0x661d04['query']=_[_0x7fb6('0x2f')](_0x6fa286[_0x7fb6('0x2e')]);_0x661d04['filters']=_[_0x7fb6('0x31')](_0x661d04[_0x7fb6('0x2c')],_0x661d04[_0x7fb6('0x2e')]);_0x1dbfb8[_0x7fb6('0x32')]=_[_0x7fb6('0x31')](_0x661d04[_0x7fb6('0x2c')],qs[_0x7fb6('0x33')](_0x6fa286[_0x7fb6('0x2e')][_0x7fb6('0x33')]));_0x1dbfb8['attributes']=_0x1dbfb8[_0x7fb6('0x32')]['length']?_0x1dbfb8[_0x7fb6('0x32')]:_0x661d04[_0x7fb6('0x2c')];if(_0x6fa286['query'][_0x7fb6('0x3c')]){_0x1dbfb8[_0x7fb6('0x3d')]=[{'all':!![]}];}_0x1dbfb8=_[_0x7fb6('0x3b')]({},_0x1dbfb8,_0x6fa286['options']);return db[_0x7fb6('0x28')][_0x7fb6('0x42')](_0x1dbfb8)[_0x7fb6('0x23')](handleEntityNotFound(_0x3b77ba,null))[_0x7fb6('0x23')](respondWithResult(_0x3b77ba,null))[_0x7fb6('0x3f')](handleError(_0x3b77ba,null));};exports[_0x7fb6('0x43')]=function(_0x363564,_0x4eac42){return db[_0x7fb6('0x28')][_0x7fb6('0x43')](_0x363564['body'],{})[_0x7fb6('0x23')](respondWithResult(_0x4eac42,0xc9))['catch'](handleError(_0x4eac42,null));};exports[_0x7fb6('0x22')]=function(_0x597eac,_0x2fb8f0){if(_0x597eac['body']['id']){delete _0x597eac[_0x7fb6('0x44')]['id'];}return db[_0x7fb6('0x28')]['find']({'where':{'id':_0x597eac[_0x7fb6('0x45')]['id']}})[_0x7fb6('0x23')](handleEntityNotFound(_0x2fb8f0,null))[_0x7fb6('0x23')](saveUpdates(_0x597eac[_0x7fb6('0x44')],null))[_0x7fb6('0x23')](respondWithResult(_0x2fb8f0,null))[_0x7fb6('0x3f')](handleError(_0x2fb8f0,null));};exports[_0x7fb6('0x46')]=function(_0x164bfd,_0x14993f){return db[_0x7fb6('0x28')][_0x7fb6('0x42')]({'where':{'id':_0x164bfd[_0x7fb6('0x45')]['id']}})['then'](handleEntityNotFound(_0x14993f,null))['then'](removeEntity(_0x14993f,null))[_0x7fb6('0x3f')](handleError(_0x14993f,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 28f21fc..0ac26fc 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 _0x44ce=['idField','util','../../config/logger','api','moment','path','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index'];(function(_0x327df6,_0x3447f5){var _0x2188cb=function(_0x28933e){while(--_0x28933e){_0x327df6['push'](_0x327df6['shift']());}};_0x2188cb(++_0x3447f5);}(_0x44ce,0x177));var _0xe44c=function(_0x3fa308,_0x1816e5){_0x3fa308=_0x3fa308-0x0;var _0x4eba5c=_0x44ce[_0x3fa308];return _0x4eba5c;};'use strict';var _=require('lodash');var util=require(_0xe44c('0x0'));var logger=require(_0xe44c('0x1'))(_0xe44c('0x2'));var moment=require(_0xe44c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe44c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe44c('0x5'));module['exports']=function(_0x181afa,_0x1a07c2){return _0x181afa[_0xe44c('0x6')](_0xe44c('0x7'),attributes,{'tableName':_0xe44c('0x8'),'paranoid':![],'indexes':[{'name':_0xe44c('0x9'),'fields':[_0xe44c('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x35e5=['exports','define','DeskField','int_desk_fields','desk_unique_index','idField','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes'];(function(_0x529469,_0x40be32){var _0x450179=function(_0x54432a){while(--_0x54432a){_0x529469['push'](_0x529469['shift']());}};_0x450179(++_0x40be32);}(_0x35e5,0x1e6));var _0x535e=function(_0x1dffe6,_0x70d910){_0x1dffe6=_0x1dffe6-0x0;var _0x23e2d1=_0x35e5[_0x1dffe6];return _0x23e2d1;};'use strict';var _=require(_0x535e('0x0'));var util=require(_0x535e('0x1'));var logger=require(_0x535e('0x2'))('api');var moment=require(_0x535e('0x3'));var BPromise=require('bluebird');var rp=require(_0x535e('0x4'));var fs=require('fs');var path=require(_0x535e('0x5'));var rimraf=require(_0x535e('0x6'));var config=require(_0x535e('0x7'));var attributes=require(_0x535e('0x8'));module[_0x535e('0x9')]=function(_0x19410e,_0x418286){return _0x19410e[_0x535e('0xa')](_0x535e('0xb'),attributes,{'tableName':_0x535e('0xc'),'paranoid':![],'indexes':[{'name':_0x535e('0xd'),'fields':[_0x535e('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 002627b..9c03b4a 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 _0x79df=['then','info','DeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x45ad82,_0xf2e6c0){var _0x1d7af5=function(_0x412639){while(--_0x412639){_0x45ad82['push'](_0x45ad82['shift']());}};_0x1d7af5(++_0xf2e6c0);}(_0x79df,0x1c1));var _0xf79d=function(_0xe98fb6,_0x37b0d3){_0xe98fb6=_0xe98fb6-0x0;var _0x4a76c5=_0x79df[_0xe98fb6];return _0x4a76c5;};'use strict';var _=require(_0xf79d('0x0'));var util=require(_0xf79d('0x1'));var moment=require(_0xf79d('0x2'));var BPromise=require('bluebird');var rs=require(_0xf79d('0x3'));var fs=require('fs');var Redis=require(_0xf79d('0x4'));var db=require(_0xf79d('0x5'))['db'];var utils=require(_0xf79d('0x6'));var logger=require(_0xf79d('0x7'))('rpc');var config=require(_0xf79d('0x8'));var jayson=require(_0xf79d('0x9'));var client=jayson[_0xf79d('0xa')][_0xf79d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe5f1d4,_0x41cdc0,_0x401130){return new BPromise(function(_0x4acac9,_0x52e67d){return client[_0xf79d('0xc')](_0xe5f1d4,_0x401130)[_0xf79d('0xd')](function(_0x556b49){logger[_0xf79d('0xe')](_0xf79d('0xf'),_0x41cdc0,_0xf79d('0x10'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x41cdc0,'request\x20sent',JSON[_0xf79d('0x11')](_0x556b49));if(_0x556b49[_0xf79d('0x12')]){if(_0x556b49[_0xf79d('0x12')][_0xf79d('0x13')]===0x1f4){logger[_0xf79d('0x12')](_0xf79d('0xf'),_0x41cdc0,_0x556b49[_0xf79d('0x12')][_0xf79d('0x14')]);return _0x52e67d(_0x556b49[_0xf79d('0x12')][_0xf79d('0x14')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x41cdc0,_0x556b49[_0xf79d('0x12')][_0xf79d('0x14')]);return _0x4acac9(_0x556b49[_0xf79d('0x12')][_0xf79d('0x14')]);}else{logger[_0xf79d('0xe')](_0xf79d('0xf'),_0x41cdc0,'request\x20sent');_0x4acac9(_0x556b49[_0xf79d('0x15')][_0xf79d('0x14')]);}})['catch'](function(_0x1674a6){logger['error'](_0xf79d('0xf'),_0x41cdc0,_0x1674a6);_0x52e67d(_0x1674a6);});});} \ No newline at end of file +var _0xeb56=['http','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0xe2c250,_0x10f0bd){var _0x906396=function(_0x1543f8){while(--_0x1543f8){_0xe2c250['push'](_0xe2c250['shift']());}};_0x906396(++_0x10f0bd);}(_0xeb56,0x10d));var _0x6eb5=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0xeb56[_0x3bf925];return _0x2128a1;};'use strict';var _=require(_0x6eb5('0x0'));var util=require(_0x6eb5('0x1'));var moment=require(_0x6eb5('0x2'));var BPromise=require(_0x6eb5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eb5('0x4'));var db=require(_0x6eb5('0x5'))['db'];var utils=require(_0x6eb5('0x6'));var logger=require(_0x6eb5('0x7'))('rpc');var config=require(_0x6eb5('0x8'));var jayson=require(_0x6eb5('0x9'));var client=jayson[_0x6eb5('0xa')][_0x6eb5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4995f8,_0x3f9a29,_0x557824){return new BPromise(function(_0xb55617,_0x4ad937){return client['request'](_0x4995f8,_0x557824)[_0x6eb5('0xc')](function(_0x378a37){logger['info'](_0x6eb5('0xd'),_0x3f9a29,_0x6eb5('0xe'));logger[_0x6eb5('0xf')](_0x6eb5('0x10'),_0x3f9a29,_0x6eb5('0xe'),JSON['stringify'](_0x378a37));if(_0x378a37['error']){if(_0x378a37[_0x6eb5('0x11')]['code']===0x1f4){logger[_0x6eb5('0x11')](_0x6eb5('0xd'),_0x3f9a29,_0x378a37[_0x6eb5('0x11')][_0x6eb5('0x12')]);return _0x4ad937(_0x378a37[_0x6eb5('0x11')][_0x6eb5('0x12')]);}logger[_0x6eb5('0x11')](_0x6eb5('0xd'),_0x3f9a29,_0x378a37[_0x6eb5('0x11')]['message']);return _0xb55617(_0x378a37[_0x6eb5('0x11')][_0x6eb5('0x12')]);}else{logger['info'](_0x6eb5('0xd'),_0x3f9a29,'request\x20sent');_0xb55617(_0x378a37['result'][_0x6eb5('0x12')]);}})[_0x6eb5('0x13')](function(_0x5af461){logger[_0x6eb5('0x11')](_0x6eb5('0xd'),_0x3f9a29,_0x5af461);_0x4ad937(_0x5af461);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 5e73bd8..a9d53ec 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 _0x81cf=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x81cf,0xe1));var _0xf81c=function(_0x22b672,_0x5ce8bc){_0x22b672=_0x22b672-0x0;var _0x37cfe7=_0x81cf[_0x22b672];return _0x37cfe7;};'use strict';var multer=require(_0xf81c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf81c('0x1'));var express=require(_0xf81c('0x2'));var router=express[_0xf81c('0x3')]();var fs_extra=require(_0xf81c('0x4'));var auth=require(_0xf81c('0x5'));var interaction=require(_0xf81c('0x6'));var config=require('../../config/environment');var controller=require(_0xf81c('0x7'));router['get']('/',auth[_0xf81c('0x8')](),controller['index']);router[_0xf81c('0x9')](_0xf81c('0xa'),auth['isAuthenticated'](),controller[_0xf81c('0xb')]);router[_0xf81c('0x9')]('/:id/configurations',auth[_0xf81c('0x8')](),controller['getConfigurations']);router[_0xf81c('0x9')](_0xf81c('0xc'),auth[_0xf81c('0x8')](),controller[_0xf81c('0xd')]);router[_0xf81c('0xe')]('/',auth['isAuthenticated'](),controller[_0xf81c('0xf')]);router[_0xf81c('0xe')]('/:id/configurations',auth[_0xf81c('0x8')](),controller[_0xf81c('0x10')]);router[_0xf81c('0x11')](_0xf81c('0xa'),auth[_0xf81c('0x8')](),controller[_0xf81c('0x12')]);router[_0xf81c('0x13')]('/:id',auth[_0xf81c('0x8')](),controller[_0xf81c('0x14')]);module[_0xf81c('0x15')]=router; \ No newline at end of file +var _0x71ce=['delete','/:id','destroy','exports','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x5e34a4,_0x2e63ed){var _0x8d41d7=function(_0x45c61b){while(--_0x45c61b){_0x5e34a4['push'](_0x5e34a4['shift']());}};_0x8d41d7(++_0x2e63ed);}(_0x71ce,0xd6));var _0xe71c=function(_0x149b5b,_0x5814ef){_0x149b5b=_0x149b5b-0x0;var _0x4f8884=_0x71ce[_0x149b5b];return _0x4f8884;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe71c('0x0'));var express=require(_0xe71c('0x1'));var router=express[_0xe71c('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe71c('0x3'));var config=require(_0xe71c('0x4'));var controller=require(_0xe71c('0x5'));router[_0xe71c('0x6')]('/',auth[_0xe71c('0x7')](),controller[_0xe71c('0x8')]);router[_0xe71c('0x6')]('/:id',auth[_0xe71c('0x7')](),controller['show']);router[_0xe71c('0x6')](_0xe71c('0x9'),auth['isAuthenticated'](),controller[_0xe71c('0xa')]);router[_0xe71c('0x6')](_0xe71c('0xb'),auth[_0xe71c('0x7')](),controller[_0xe71c('0xc')]);router[_0xe71c('0xd')]('/',auth[_0xe71c('0x7')](),controller[_0xe71c('0xe')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0xe71c('0xf')]);router[_0xe71c('0x10')]('/:id',auth[_0xe71c('0x7')](),controller['update']);router[_0xe71c('0x11')](_0xe71c('0x12'),auth[_0xe71c('0x7')](),controller[_0xe71c('0x13')]);module[_0xe71c('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 007ab97..73d9569 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 _0x33c5=['STRING','BOOLEAN','exports'];(function(_0x371a7d,_0x483c3a){var _0x45e283=function(_0x17648b){while(--_0x17648b){_0x371a7d['push'](_0x371a7d['shift']());}};_0x45e283(++_0x483c3a);}(_0x33c5,0xe6));var _0x533c=function(_0x111311,_0x1e2f69){_0x111311=_0x111311-0x0;var _0x4cef39=_0x33c5[_0x111311];return _0x4cef39;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x533c('0x1')]},'remoteUri':{'type':Sequelize[_0x533c('0x1')]},'tenantId':{'type':Sequelize[_0x533c('0x1')]},'clientId':{'type':Sequelize[_0x533c('0x1')]},'clientSecret':{'type':Sequelize[_0x533c('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x533c('0x1')]},'modernAuthentication':{'type':Sequelize[_0x533c('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x965d=['exports','STRING','sequelize'];(function(_0x22d41d,_0x2a26b2){var _0x2e1d94=function(_0x310b52){while(--_0x310b52){_0x22d41d['push'](_0x22d41d['shift']());}};_0x2e1d94(++_0x2a26b2);}(_0x965d,0x1be));var _0xd965=function(_0x1a5a04,_0x51081b){_0x1a5a04=_0x1a5a04-0x0;var _0x42c94c=_0x965d[_0x1a5a04];return _0x42c94c;};'use strict';var Sequelize=require(_0xd965('0x0'));module[_0xd965('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd965('0x2')]},'password':{'type':Sequelize[_0xd965('0x2')]},'remoteUri':{'type':Sequelize[_0xd965('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xd965('0x2')]},'clientSecret':{'type':Sequelize[_0xd965('0x2')]},'serverUrl':{'type':Sequelize[_0xd965('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index b3b8c98..f8c19fa 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 _0xb5f5=['offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','index','map','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Dynamics365Account','includeAll','include','findAll','rows','catch','params','create','body','find','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','Subjects','slice','substring','lastIndexOf','format','getFields','ticketType','Incident','PhoneCall','title','description','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','entitlementidname','entityimage_timestamp','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','includes','LogicalName','forEach','@odata.type','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','test','stack','send','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','false','DisplayName','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','status','json'];(function(_0x4d5660,_0x5c0fc1){var _0x4e3ef1=function(_0x1593d7){while(--_0x1593d7){_0x4d5660['push'](_0x4d5660['shift']());}};_0x4e3ef1(++_0x5c0fc1);}(_0xb5f5,0x177));var _0x5b5f=function(_0x94b9f4,_0x396ea5){_0x94b9f4=_0x94b9f4-0x0;var _0x58384d=_0xb5f5[_0x94b9f4];return _0x58384d;};'use strict';var rp=require(_0x5b5f('0x0'));var util=require(_0x5b5f('0x1'));var _=require(_0x5b5f('0x2'));var qs=require(_0x5b5f('0x3'));var logger=require('../../config/logger')(_0x5b5f('0x4'));var db=require(_0x5b5f('0x5'))['db'];var integrations=require(_0x5b5f('0x6'));function respondWithResult(_0x1160f3,_0x4ed21c){_0x4ed21c=_0x4ed21c||0xc8;return function(_0x445d10){if(_0x445d10){return _0x1160f3[_0x5b5f('0x7')](_0x4ed21c)[_0x5b5f('0x8')](_0x445d10);}};}function respondWithFilteredResult(_0x7c8cf6,_0xb4592){return function(_0x5eb459){if(_0x5eb459){var _0x431f65=typeof _0xb4592[_0x5b5f('0x9')]===_0x5b5f('0xa')&&typeof _0xb4592[_0x5b5f('0xb')]==='undefined';var _0x1122fe=_0x5eb459[_0x5b5f('0xc')];var _0x4aab45=_0x431f65?0x0:_0xb4592[_0x5b5f('0x9')];var _0x4d9dba=_0x431f65?_0x5eb459[_0x5b5f('0xc')]:_0xb4592[_0x5b5f('0x9')]+_0xb4592[_0x5b5f('0xb')];var _0x47dab7;if(_0x4d9dba>=_0x1122fe){_0x4d9dba=_0x1122fe;_0x47dab7=0xc8;}else{_0x47dab7=0xce;}_0x7c8cf6['status'](_0x47dab7);return _0x7c8cf6[_0x5b5f('0xd')](_0x5b5f('0xe'),_0x4aab45+'-'+_0x4d9dba+'/'+_0x1122fe)[_0x5b5f('0x8')](_0x5eb459);}return null;};}function saveUpdates(_0x418993){return function(_0x2db12d){if(_0x2db12d){return _0x2db12d[_0x5b5f('0xf')](_0x418993)[_0x5b5f('0x10')](function(_0x47c6c4){return _0x47c6c4;});}return null;};}function removeEntity(_0x5daa3a){return function(_0x39fa04){if(_0x39fa04){return _0x39fa04[_0x5b5f('0x11')]()[_0x5b5f('0x10')](function(){_0x5daa3a[_0x5b5f('0x7')](0xcc)[_0x5b5f('0x12')]();});}};}function handleEntityNotFound(_0x202923){return function(_0x335a0b){if(!_0x335a0b){_0x202923[_0x5b5f('0x13')](0x194);}return _0x335a0b;};}function handleError(_0x108755,_0x68716c){_0x68716c=_0x68716c||0x1f4;return function(_0x5898b4){logger['error'](_0x5898b4['stack']);if(_0x5898b4['name']){delete _0x5898b4['name'];}_0x108755[_0x5b5f('0x7')](_0x68716c)['send'](_0x5898b4);};}exports[_0x5b5f('0x14')]=function(_0x590b22,_0x5938bd){var _0x4c45b2={},_0x15897e={},_0x3416e8={'count':0x0,'rows':[]};var _0x5d9455=_[_0x5b5f('0x15')](db['Dynamics365Account'][_0x5b5f('0x16')],function(_0x1021cb){return{'name':_0x1021cb[_0x5b5f('0x17')],'type':_0x1021cb[_0x5b5f('0x18')]['key']};});_0x15897e[_0x5b5f('0x19')]=_['map'](_0x5d9455,_0x5b5f('0x1a'));_0x15897e['query']=_[_0x5b5f('0x1b')](_0x590b22[_0x5b5f('0x1c')]);_0x15897e[_0x5b5f('0x1d')]=_[_0x5b5f('0x1e')](_0x15897e[_0x5b5f('0x19')],_0x15897e[_0x5b5f('0x1c')]);_0x4c45b2[_0x5b5f('0x1f')]=_[_0x5b5f('0x1e')](_0x15897e['model'],qs[_0x5b5f('0x20')](_0x590b22['query'][_0x5b5f('0x20')]));_0x4c45b2[_0x5b5f('0x1f')]=_0x4c45b2[_0x5b5f('0x1f')][_0x5b5f('0x21')]?_0x4c45b2[_0x5b5f('0x1f')]:_0x15897e[_0x5b5f('0x19')];if(!_0x590b22[_0x5b5f('0x1c')][_0x5b5f('0x22')](_0x5b5f('0x23'))){_0x4c45b2[_0x5b5f('0xb')]=qs[_0x5b5f('0xb')](_0x590b22[_0x5b5f('0x1c')][_0x5b5f('0xb')]);_0x4c45b2[_0x5b5f('0x9')]=qs[_0x5b5f('0x9')](_0x590b22[_0x5b5f('0x1c')][_0x5b5f('0x9')]);}_0x4c45b2[_0x5b5f('0x24')]=qs[_0x5b5f('0x25')](_0x590b22[_0x5b5f('0x1c')][_0x5b5f('0x25')]);_0x4c45b2[_0x5b5f('0x26')]=qs[_0x5b5f('0x1d')](_[_0x5b5f('0x27')](_0x590b22[_0x5b5f('0x1c')],_0x15897e['filters']),_0x5d9455);if(_0x590b22[_0x5b5f('0x1c')][_0x5b5f('0x28')]){_0x4c45b2[_0x5b5f('0x26')]=_[_0x5b5f('0x29')](_0x4c45b2[_0x5b5f('0x26')],{'$or':_['map'](_0x5d9455,function(_0x221171){if(_0x221171['type']!=='VIRTUAL'){var _0x12eb70={};_0x12eb70[_0x221171[_0x5b5f('0x1a')]]={'$like':'%'+_0x590b22[_0x5b5f('0x1c')][_0x5b5f('0x28')]+'%'};return _0x12eb70;}})});}_0x4c45b2=_[_0x5b5f('0x29')]({},_0x4c45b2,_0x590b22[_0x5b5f('0x2a')]);var _0x5896f6={'where':_0x4c45b2[_0x5b5f('0x26')]};return db[_0x5b5f('0x2b')][_0x5b5f('0xc')](_0x5896f6)[_0x5b5f('0x10')](function(_0x43683b){_0x3416e8[_0x5b5f('0xc')]=_0x43683b;if(_0x590b22[_0x5b5f('0x1c')][_0x5b5f('0x2c')]){_0x4c45b2[_0x5b5f('0x2d')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x5b5f('0x2e')](_0x4c45b2);})[_0x5b5f('0x10')](function(_0x32ee75){_0x3416e8[_0x5b5f('0x2f')]=_0x32ee75;return _0x3416e8;})[_0x5b5f('0x10')](respondWithFilteredResult(_0x5938bd,_0x4c45b2))[_0x5b5f('0x30')](handleError(_0x5938bd,null));};exports['show']=function(_0x2703b5,_0x23a5d0){var _0x1a0069={'raw':![],'where':{'id':_0x2703b5[_0x5b5f('0x31')]['id']}},_0x57a452={};_0x57a452[_0x5b5f('0x19')]=_['keys'](db[_0x5b5f('0x2b')][_0x5b5f('0x16')]);_0x57a452['query']=_[_0x5b5f('0x1b')](_0x2703b5[_0x5b5f('0x1c')]);_0x57a452[_0x5b5f('0x1d')]=_[_0x5b5f('0x1e')](_0x57a452[_0x5b5f('0x19')],_0x57a452['query']);_0x1a0069[_0x5b5f('0x1f')]=_[_0x5b5f('0x1e')](_0x57a452[_0x5b5f('0x19')],qs[_0x5b5f('0x20')](_0x2703b5[_0x5b5f('0x1c')][_0x5b5f('0x20')]));_0x1a0069['attributes']=_0x1a0069['attributes']['length']?_0x1a0069[_0x5b5f('0x1f')]:_0x57a452[_0x5b5f('0x19')];if(_0x2703b5[_0x5b5f('0x1c')][_0x5b5f('0x2c')]){_0x1a0069[_0x5b5f('0x2d')]=[{'all':!![]}];}_0x1a0069=_['merge']({},_0x1a0069,_0x2703b5[_0x5b5f('0x2a')]);return db[_0x5b5f('0x2b')]['find'](_0x1a0069)[_0x5b5f('0x10')](handleEntityNotFound(_0x23a5d0,null))[_0x5b5f('0x10')](respondWithResult(_0x23a5d0,null))[_0x5b5f('0x30')](handleError(_0x23a5d0,null));};exports[_0x5b5f('0x32')]=function(_0x2877ed,_0x542d86){return db[_0x5b5f('0x2b')][_0x5b5f('0x32')](_0x2877ed[_0x5b5f('0x33')],{})['then'](respondWithResult(_0x542d86,0xc9))[_0x5b5f('0x30')](handleError(_0x542d86,null));};exports['update']=function(_0x1737db,_0x45cb1d){if(_0x1737db[_0x5b5f('0x33')]['id']){delete _0x1737db[_0x5b5f('0x33')]['id'];}return db[_0x5b5f('0x2b')]['find']({'where':{'id':_0x1737db['params']['id']}})[_0x5b5f('0x10')](handleEntityNotFound(_0x45cb1d,null))['then'](saveUpdates(_0x1737db[_0x5b5f('0x33')],null))['then'](respondWithResult(_0x45cb1d,null))[_0x5b5f('0x30')](handleError(_0x45cb1d,null));};exports[_0x5b5f('0x11')]=function(_0x55c905,_0x159bfc){return db[_0x5b5f('0x2b')][_0x5b5f('0x34')]({'where':{'id':_0x55c905[_0x5b5f('0x31')]['id']}})[_0x5b5f('0x10')](handleEntityNotFound(_0x159bfc,null))[_0x5b5f('0x10')](removeEntity(_0x159bfc,null))[_0x5b5f('0x30')](handleError(_0x159bfc,null));};exports[_0x5b5f('0x35')]=function(_0x3fafee,_0x2d1c18){var _0x23a312={};var _0x15a578={};var _0x5af413;var _0x121933;return db[_0x5b5f('0x2b')][_0x5b5f('0x36')]({'where':{'id':_0x3fafee[_0x5b5f('0x31')]['id']}})['then'](handleEntityNotFound(_0x2d1c18,null))['then'](function(_0x3b3aac){if(_0x3b3aac){_0x5af413=_0x3b3aac;_0x15a578[_0x5b5f('0x19')]=_[_0x5b5f('0x1b')](db[_0x5b5f('0x37')][_0x5b5f('0x16')]);_0x15a578['query']=_[_0x5b5f('0x1b')](_0x3fafee[_0x5b5f('0x1c')]);_0x15a578['filters']=_[_0x5b5f('0x1e')](_0x15a578[_0x5b5f('0x19')],_0x15a578[_0x5b5f('0x1c')]);_0x23a312[_0x5b5f('0x1f')]=_['intersection'](_0x15a578[_0x5b5f('0x19')],qs[_0x5b5f('0x20')](_0x3fafee[_0x5b5f('0x1c')][_0x5b5f('0x20')]));_0x23a312[_0x5b5f('0x1f')]=_0x23a312['attributes'][_0x5b5f('0x21')]?_0x23a312[_0x5b5f('0x1f')]:_0x15a578[_0x5b5f('0x19')];_0x23a312[_0x5b5f('0x24')]=qs[_0x5b5f('0x25')](_0x3fafee[_0x5b5f('0x1c')]['sort']);_0x23a312[_0x5b5f('0x26')]=qs[_0x5b5f('0x1d')](_[_0x5b5f('0x27')](_0x3fafee[_0x5b5f('0x1c')],_0x15a578['filters']));if(_0x3fafee['query'][_0x5b5f('0x28')]){_0x23a312[_0x5b5f('0x26')]=_[_0x5b5f('0x29')](_0x23a312[_0x5b5f('0x26')],{'$or':_[_0x5b5f('0x15')](_0x23a312[_0x5b5f('0x1f')],function(_0x387874){var _0x3c8ea9={};_0x3c8ea9[_0x387874]={'$like':'%'+_0x3fafee['query']['filter']+'%'};return _0x3c8ea9;})});}_0x23a312=_[_0x5b5f('0x29')]({},_0x23a312,_0x3fafee[_0x5b5f('0x2a')]);return _0x5af413['getConfigurations'](_0x23a312);}})[_0x5b5f('0x10')](function(_0x813346){if(_0x813346){_0x121933=_0x813346[_0x5b5f('0x21')];if(!_0x3fafee[_0x5b5f('0x1c')][_0x5b5f('0x22')]('nolimit')){_0x23a312[_0x5b5f('0xb')]=qs[_0x5b5f('0xb')](_0x3fafee[_0x5b5f('0x1c')][_0x5b5f('0xb')]);_0x23a312[_0x5b5f('0x9')]=qs['offset'](_0x3fafee[_0x5b5f('0x1c')][_0x5b5f('0x9')]);}return _0x5af413[_0x5b5f('0x35')](_0x23a312);}})[_0x5b5f('0x10')](function(_0x5abdbc){if(_0x5abdbc){return _0x5abdbc?{'count':_0x121933,'rows':_0x5abdbc}:null;}})[_0x5b5f('0x10')](respondWithResult(_0x2d1c18,null))['catch'](handleError(_0x2d1c18,null));};exports[_0x5b5f('0x38')]=function(_0x33e0ff,_0x112893){if(_0x33e0ff[_0x5b5f('0x33')]['id']){delete _0x33e0ff['body']['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x33e0ff[_0x5b5f('0x31')]['id']}})[_0x5b5f('0x10')](handleEntityNotFound(_0x112893,null))[_0x5b5f('0x10')](function(_0xaf22dd){if(_0xaf22dd){_0x33e0ff[_0x5b5f('0x33')][_0x5b5f('0x39')]=_0xaf22dd['id'];_0x33e0ff['body']['Subjects']=integrations[_0x5b5f('0x3a')](_0x33e0ff[_0x5b5f('0x33')][_0x5b5f('0x3b')],_0x33e0ff['body']['type']);_0x33e0ff[_0x5b5f('0x33')][_0x5b5f('0x3c')]=integrations[_0x5b5f('0x3d')](_0x33e0ff[_0x5b5f('0x33')][_0x5b5f('0x3b')],_0x33e0ff[_0x5b5f('0x33')][_0x5b5f('0x18')]);return db[_0x5b5f('0x37')][_0x5b5f('0x32')](_0x33e0ff[_0x5b5f('0x33')],{'include':[{'model':db[_0x5b5f('0x3e')],'as':_0x5b5f('0x3f')},{'model':db[_0x5b5f('0x3e')],'as':_0x5b5f('0x3c')}]});}return null;})[_0x5b5f('0x10')](respondWithResult(_0x112893,null))[_0x5b5f('0x30')](handleError(_0x112893,null));};function sanitizeRemoteUri(_0x2c74ff){var _0x4c700a=_0x2c74ff[_0x5b5f('0x40')](-0x1);if(_0x4c700a==='/')return _0x2c74ff[_0x5b5f('0x41')](0x0,_0x2c74ff[_0x5b5f('0x42')](_0x4c700a));return _0x2c74ff;}function getWebApiUrl(_0x12cef5){return util[_0x5b5f('0x43')]('%s/api/data/v9.0/',_0x12cef5);}exports[_0x5b5f('0x44')]=function(_0x34c6a4,_0x172187){var _0x46d95a=_0x34c6a4[_0x5b5f('0x1c')][_0x5b5f('0x45')];var _0xe1c616=_0x46d95a==='incident'?_0x5b5f('0x46'):_0x5b5f('0x47');var _0x221a25='';var _0x1bd16f='';var _0x139778='';var _0x45965c='';var _0x67664='';var _0xe73848='';var _0x229aca='';var _0x26cbe1='';var _0x1cbe39=[_0x5b5f('0x48'),_0x5b5f('0x49'),_0x5b5f('0x4a'),_0x5b5f('0x4b'),'caseorigincode',_0x5b5f('0x4c'),_0x5b5f('0x4d'),_0x5b5f('0x4e'),_0x5b5f('0x4f'),_0x5b5f('0x50')];var _0x5723e7=[_0x5b5f('0x51'),'accountidyominame',_0x5b5f('0x52'),_0x5b5f('0x53'),_0x5b5f('0x54'),_0x5b5f('0x55'),_0x5b5f('0x56'),_0x5b5f('0x57'),_0x5b5f('0x58'),_0x5b5f('0x59'),_0x5b5f('0x5a'),'createdbyyominame','createdon',_0x5b5f('0x5b'),_0x5b5f('0x5c'),'customeridname',_0x5b5f('0x5d'),'customeridyominame','emailaddress',_0x5b5f('0x5e'),_0x5b5f('0x5f'),'entityimage_url','escalatedon',_0x5b5f('0x60'),_0x5b5f('0x61'),'followupby',_0x5b5f('0x62'),_0x5b5f('0x63'),_0x5b5f('0x64'),_0x5b5f('0x65'),_0x5b5f('0x66'),_0x5b5f('0x67'),'modifiedbyexternalpartyyominame','modifiedbyname',_0x5b5f('0x68'),_0x5b5f('0x69'),_0x5b5f('0x6a'),'modifiedonbehalfbyyominame',_0x5b5f('0x6b'),_0x5b5f('0x6c'),'numberofchildincidents',_0x5b5f('0x6d'),_0x5b5f('0x6e'),_0x5b5f('0x6f'),_0x5b5f('0x70'),'owneridyominame',_0x5b5f('0x71'),_0x5b5f('0x72'),_0x5b5f('0x73'),_0x5b5f('0x74'),_0x5b5f('0x75'),'productserialnumber',_0x5b5f('0x76'),_0x5b5f('0x77'),_0x5b5f('0x78'),'responsiblecontactidname',_0x5b5f('0x79'),_0x5b5f('0x7a'),_0x5b5f('0x7b'),_0x5b5f('0x7c'),_0x5b5f('0x7d'),_0x5b5f('0x7e'),_0x5b5f('0x7f'),_0x5b5f('0x80'),_0x5b5f('0x81'),_0x5b5f('0x82'),_0x5b5f('0x83'),_0x5b5f('0x84'),_0x5b5f('0x85'),_0x5b5f('0x86')];var _0x172fd6=_0x1cbe39[_0x5b5f('0x87')](_0x5723e7);return db[_0x5b5f('0x2b')][_0x5b5f('0x36')]({'where':{'id':_0x34c6a4[_0x5b5f('0x31')]['id']},'attributes':['id',_0x5b5f('0x88'),_0x5b5f('0x89'),_0x5b5f('0x8a'),_0x5b5f('0x8b'),_0x5b5f('0x8c'),_0x5b5f('0x8d'),_0x5b5f('0x8e')],'include':[{'model':db[_0x5b5f('0x8f')],'as':_0x5b5f('0x8f'),'attributes':['id',_0x5b5f('0x90'),_0x5b5f('0x91')]}]})[_0x5b5f('0x10')](handleEntityNotFound(_0x172187,null))[_0x5b5f('0x10')](function(_0x63b2c){if(_0x63b2c){if(_0x63b2c[_0x5b5f('0x8e')]){_0x63b2c['access_token']=_0x63b2c[_0x5b5f('0x8f')][_0x5b5f('0x90')];_0x26cbe1=sanitizeRemoteUri(_0x63b2c[_0x5b5f('0x8f')]['data7']);_0x229aca=getWebApiUrl(_0x26cbe1);return _0x63b2c;}_0x26cbe1=sanitizeRemoteUri(_0x63b2c['remoteUri']);_0x229aca=getWebApiUrl(_0x26cbe1);var _0x2aa137={'method':_0x5b5f('0x92'),'uri':'https://login.microsoftonline.com/'+_0x63b2c[_0x5b5f('0x8b')]+_0x5b5f('0x93'),'form':{'client_id':_0x63b2c[_0x5b5f('0x8c')],'resource':_0x26cbe1,'username':_0x63b2c[_0x5b5f('0x88')],'password':_0x63b2c[_0x5b5f('0x89')],'grant_type':_0x5b5f('0x89'),'client_secret':_0x63b2c[_0x5b5f('0x8d')]},'json':!![]};return rp(_0x2aa137);}})[_0x5b5f('0x10')](function(_0x2e37c0){_0xe73848=_0x2e37c0[_0x5b5f('0x94')];var _0x3222c5={'method':'GET','uri':encodeURI(_0x229aca+_0x5b5f('0x95')+_0xe1c616+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0xe73848,'If-None-Match':null,'OData-Version':_0x5b5f('0x96')},'json':!![]};return rp(_0x3222c5);})[_0x5b5f('0x10')](function(_0xa1157e){var _0xa253c2=_0xa1157e[_0x5b5f('0x97')][0x0];var _0x4b06a5=_0xa253c2[_0x5b5f('0x98')];var _0xa00ac0={'method':_0x5b5f('0x99'),'uri':_0x229aca+_0x5b5f('0x9a')+_0x4b06a5+_0x5b5f('0x9b'),'headers':{'Authorization':_0x5b5f('0x9c')+_0xe73848,'If-None-Match':null,'OData-Version':_0x5b5f('0x96')},'json':!![]};return rp(_0xa00ac0);})['then'](function(_0xdae9be){_0x221a25=_0xdae9be;_0x1bd16f=_0x221a25[_0x5b5f('0x9d')];_0x1bd16f=_[_0x5b5f('0x9e')](_0x1bd16f,function(_0x43b237){return!_0x172fd6[_0x5b5f('0x9f')](_0x43b237[_0x5b5f('0xa0')]);});var _0x31f1ba=[];var _0x366883=[];_0x1bd16f[_0x5b5f('0xa1')](function(_0x2c88e6){if(_0x2c88e6[_0x5b5f('0xa2')]){var _0x4cb2e9=_0x2c88e6[_0x5b5f('0xa2')][_0x5b5f('0x41')](_0x2c88e6[_0x5b5f('0xa2')][_0x5b5f('0x42')]('.')+0x1);if(_0x4cb2e9==='PicklistAttributeMetadata'){_0x31f1ba[_0x5b5f('0xa3')](getSelectList(_0x229aca,_0x46d95a,_0x366883,_0x221a25[_0x5b5f('0x98')],_0x2c88e6[_0x5b5f('0x98')],_0xe73848));}}});return Promise[_0x5b5f('0xa4')](_0x31f1ba);})['then'](function(_0x310aa8){_0x139778=_0x310aa8[0x0];var _0x2f3025=[];var _0x1b686c=[];_0x1bd16f[_0x5b5f('0xa1')](function(_0x2534c1){if(!_[_0x5b5f('0xa5')](_0x2534c1[_0x5b5f('0xa2')])){var _0x440d12=_0x2534c1['@odata.type'][_0x5b5f('0x41')](_0x2534c1[_0x5b5f('0xa2')][_0x5b5f('0x42')]('.')+0x1);if(_0x440d12===_0x5b5f('0xa6')){_0x2f3025[_0x5b5f('0xa3')](getBooleanList(_0x229aca,_0x46d95a,_0x1b686c,_0x221a25[_0x5b5f('0x98')],_0x2534c1[_0x5b5f('0x98')],_0xe73848));}}});return Promise[_0x5b5f('0xa4')](_0x2f3025);})[_0x5b5f('0x10')](function(_0x5b6946){_0x45965c=_0x5b6946[0x0];var _0x37241b=[];var _0x5634ec=[];_0x1bd16f[_0x5b5f('0xa1')](function(_0x2d22cd){if(_0x2d22cd[_0x5b5f('0xa2')]){var _0x574dc3=_0x2d22cd[_0x5b5f('0xa2')][_0x5b5f('0x41')](_0x2d22cd['@odata.type'][_0x5b5f('0x42')]('.')+0x1);if(_0x574dc3===_0x5b5f('0xa7')||_0x574dc3===_0x5b5f('0xa8')||_0x574dc3===_0x5b5f('0xa9')||_0x574dc3===_0x5b5f('0xaa')||_0x574dc3===_0x5b5f('0xab')||_0x574dc3===_0x5b5f('0xac')||_0x574dc3==='StatusAttributeMetadata'||_0x574dc3===_0x5b5f('0xad')||_0x574dc3==='StateAttributeMetadata'||_0x574dc3==='DecimalAttributeMetadata'){_0x37241b['push'](getInputList(_0x229aca,_0x46d95a,_0x574dc3,_0x5634ec,_0x221a25[_0x5b5f('0x98')],_0x2d22cd[_0x5b5f('0x98')],_0xe73848));}}});return Promise[_0x5b5f('0xa4')](_0x37241b);})['then'](function(_0x2b5ac6){_0x67664=_0x2b5ac6[0x0];var _0x19f90b=_0x139778[_0x5b5f('0x87')](_0x45965c)[_0x5b5f('0x87')](_0x67664);var _0x49a568={'count':_0x19f90b[_0x5b5f('0x21')],'rows':_0x19f90b};return _0x49a568;})[_0x5b5f('0x10')](respondWithResult(_0x172187,null))[_0x5b5f('0x30')](function(_0xed8ee){var _0x5dd294=_0x34c6a4['query'][_0x5b5f('0xae')]?0x1f4:_0xed8ee['statusCode']||0x1f4;logger['error'](_0xed8ee[_0x5b5f('0xaf')]);delete _0xed8ee[_0x5b5f('0x1a')];if(_0x5dd294===0x191){_0x5dd294=0x190;}_0x172187['status'](_0x5dd294)[_0x5b5f('0xb0')](_0x34c6a4[_0x5b5f('0x1c')][_0x5b5f('0xae')]?{'message':_0x5b5f('0xb1'),'statusCode':_0xed8ee['statusCode']}:_0xed8ee);});};function getSelectList(_0x5db822,_0x4bae60,_0x5953ad,_0x4c0378,_0x4f35e6,_0x132550){var _0x2dfd4b={'method':'GET','uri':_0x5db822+'EntityDefinitions('+_0x4c0378+')/Attributes('+_0x4f35e6+_0x5b5f('0xb2')+_0x5b5f('0xb3'),'headers':{'Authorization':_0x5b5f('0x9c')+_0x132550,'If-None-Match':null,'OData-Version':_0x5b5f('0x96')},'json':!![]};return rp(_0x2dfd4b)[_0x5b5f('0x10')](function(_0xb83eb6){var _0x2c2cfa=[];var _0x6fb305=_0xb83eb6[_0x5b5f('0xb4')][_0x5b5f('0xb5')];_0x6fb305['forEach'](function(_0x372b23){_0x2c2cfa['push']({'name':_0x372b23[_0x5b5f('0xb6')][_0x5b5f('0xb7')][_0x5b5f('0xb6')],'value':String(_0x372b23[_0x5b5f('0xb8')])});});var _0x4c9712={'id':_0x4bae60+'_'+_0xb83eb6[_0x5b5f('0xa0')],'name':_0xb83eb6['DisplayName'][_0x5b5f('0xb7')][_0x5b5f('0xb6')],'custom':![],'options':_0x2c2cfa};_0x5953ad[_0x5b5f('0xa3')](_0x4c9712);return _0x5953ad;});}function getBooleanList(_0x3295b0,_0x38cf3b,_0x269f0e,_0x4205ad,_0x15ff7c,_0x47c89b){var _0x2ce1f6={'method':_0x5b5f('0x99'),'uri':_0x3295b0+_0x5b5f('0x9a')+_0x4205ad+_0x5b5f('0xb9')+_0x15ff7c+_0x5b5f('0xba'),'headers':{'Authorization':_0x5b5f('0x9c')+_0x47c89b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2ce1f6)[_0x5b5f('0x10')](function(_0x3bb762){var _0x24d2d8=[];_0x24d2d8[_0x5b5f('0xa3')]({'name':_0x3bb762[_0x5b5f('0xb4')][_0x5b5f('0xbb')][_0x5b5f('0xb6')]['UserLocalizedLabel'][_0x5b5f('0xb6')],'value':'true'},{'name':_0x3bb762[_0x5b5f('0xb4')][_0x5b5f('0xbc')][_0x5b5f('0xb6')][_0x5b5f('0xb7')][_0x5b5f('0xb6')],'value':_0x5b5f('0xbd')});var _0x37606f={'id':_0x38cf3b+'_'+_0x3bb762['LogicalName'],'name':_0x3bb762[_0x5b5f('0xbe')][_0x5b5f('0xb7')][_0x5b5f('0xb6')],'custom':![],'options':_0x24d2d8};_0x269f0e[_0x5b5f('0xa3')](_0x37606f);return _0x269f0e;});}function getInputList(_0xe3f4c1,_0x418b69,_0x466def,_0xa19ef3,_0x11b3b1,_0x4f0a8f,_0x4042b3){var _0x57fe62={'method':'GET','uri':_0xe3f4c1+_0x5b5f('0x9a')+_0x11b3b1+_0x5b5f('0xb9')+_0x4f0a8f+')/Microsoft.Dynamics.CRM.'+_0x466def+_0x5b5f('0xbf'),'headers':{'Authorization':_0x5b5f('0x9c')+_0x4042b3,'If-None-Match':null,'OData-Version':_0x5b5f('0x96')},'json':!![]};return rp(_0x57fe62)['then'](function(_0x130eeb){var _0x563bba={'id':_0x418b69+'_'+_0x130eeb[_0x5b5f('0xa0')],'name':_0x130eeb[_0x5b5f('0xbe')][_0x5b5f('0xb7')]?_0x130eeb[_0x5b5f('0xbe')]['UserLocalizedLabel']['Label']:_0x130eeb[_0x5b5f('0xa0')],'custom':![],'options':[]};_0xa19ef3['push'](_0x563bba);return _0xa19ef3;});} \ No newline at end of file +var _0x4ee2=['addConfiguration','findOne','AccountId','channel','Descriptions','getDescriptions','Dynamics365Field','Subjects','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','title','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','versionnumber','concat','username','remoteUri','clientId','CloudProvider','data5','modernAuthentication','data7','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','password','clientSecret','access_token','GET','4.0','value','EntityDefinitions(','Bearer\x20','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','push','test','send','Wrong\x20credentials','statusCode',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','end','sendStatus','error','stack','name','index','Dynamics365Account','type','key','model','map','query','intersection','attributes','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','rawAttributes','fields','length','catch','create','body','find','params','getConfigurations','keys','Dynamics365Configuration','order','hasOwnProperty','nolimit'];(function(_0x2af502,_0x237366){var _0x33f014=function(_0x1e6e0c){while(--_0x1e6e0c){_0x2af502['push'](_0x2af502['shift']());}};_0x33f014(++_0x237366);}(_0x4ee2,0x140));var _0x24ee=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x4ee2[_0x2be8c2];return _0x97f531;};'use strict';var rp=require(_0x24ee('0x0'));var util=require(_0x24ee('0x1'));var _=require(_0x24ee('0x2'));var qs=require(_0x24ee('0x3'));var logger=require(_0x24ee('0x4'))(_0x24ee('0x5'));var db=require('../../mysqldb')['db'];var integrations=require(_0x24ee('0x6'));function respondWithResult(_0x21aecb,_0x3ecaa9){_0x3ecaa9=_0x3ecaa9||0xc8;return function(_0xc8485c){if(_0xc8485c){return _0x21aecb[_0x24ee('0x7')](_0x3ecaa9)['json'](_0xc8485c);}};}function respondWithFilteredResult(_0x419249,_0x4d2480){return function(_0x4f0d1d){if(_0x4f0d1d){var _0x4210e7=typeof _0x4d2480[_0x24ee('0x8')]===_0x24ee('0x9')&&typeof _0x4d2480[_0x24ee('0xa')]===_0x24ee('0x9');var _0x2b50c0=_0x4f0d1d[_0x24ee('0xb')];var _0x3e5359=_0x4210e7?0x0:_0x4d2480[_0x24ee('0x8')];var _0x3a26b0=_0x4210e7?_0x4f0d1d[_0x24ee('0xb')]:_0x4d2480[_0x24ee('0x8')]+_0x4d2480[_0x24ee('0xa')];var _0x9a009c;if(_0x3a26b0>=_0x2b50c0){_0x3a26b0=_0x2b50c0;_0x9a009c=0xc8;}else{_0x9a009c=0xce;}_0x419249['status'](_0x9a009c);return _0x419249[_0x24ee('0xc')](_0x24ee('0xd'),_0x3e5359+'-'+_0x3a26b0+'/'+_0x2b50c0)[_0x24ee('0xe')](_0x4f0d1d);}return null;};}function saveUpdates(_0x29cae){return function(_0x330be8){if(_0x330be8){return _0x330be8[_0x24ee('0xf')](_0x29cae)['then'](function(_0x441c19){return _0x441c19;});}return null;};}function removeEntity(_0x33183c){return function(_0x30e53a){if(_0x30e53a){return _0x30e53a[_0x24ee('0x10')]()[_0x24ee('0x11')](function(){_0x33183c[_0x24ee('0x7')](0xcc)[_0x24ee('0x12')]();});}};}function handleEntityNotFound(_0x4bf91e){return function(_0x7b1a27){if(!_0x7b1a27){_0x4bf91e[_0x24ee('0x13')](0x194);}return _0x7b1a27;};}function handleError(_0x5b049f,_0x14b0d0){_0x14b0d0=_0x14b0d0||0x1f4;return function(_0x2cb4ba){logger[_0x24ee('0x14')](_0x2cb4ba[_0x24ee('0x15')]);if(_0x2cb4ba[_0x24ee('0x16')]){delete _0x2cb4ba['name'];}_0x5b049f[_0x24ee('0x7')](_0x14b0d0)['send'](_0x2cb4ba);};}exports[_0x24ee('0x17')]=function(_0x2c703b,_0x5cef7e){var _0x2819c6={},_0x32adf7={},_0x5dc668={'count':0x0,'rows':[]};var _0x4f359f=_['map'](db[_0x24ee('0x18')]['rawAttributes'],function(_0x3760d9){return{'name':_0x3760d9['fieldName'],'type':_0x3760d9[_0x24ee('0x19')][_0x24ee('0x1a')]};});_0x32adf7[_0x24ee('0x1b')]=_[_0x24ee('0x1c')](_0x4f359f,_0x24ee('0x16'));_0x32adf7[_0x24ee('0x1d')]=_['keys'](_0x2c703b[_0x24ee('0x1d')]);_0x32adf7['filters']=_[_0x24ee('0x1e')](_0x32adf7['model'],_0x32adf7[_0x24ee('0x1d')]);_0x2819c6[_0x24ee('0x1f')]=_[_0x24ee('0x1e')](_0x32adf7[_0x24ee('0x1b')],qs['fields'](_0x2c703b[_0x24ee('0x1d')]['fields']));_0x2819c6[_0x24ee('0x1f')]=_0x2819c6['attributes']['length']?_0x2819c6['attributes']:_0x32adf7[_0x24ee('0x1b')];if(!_0x2c703b[_0x24ee('0x1d')]['hasOwnProperty']('nolimit')){_0x2819c6[_0x24ee('0xa')]=qs['limit'](_0x2c703b['query']['limit']);_0x2819c6[_0x24ee('0x8')]=qs[_0x24ee('0x8')](_0x2c703b[_0x24ee('0x1d')][_0x24ee('0x8')]);}_0x2819c6['order']=qs[_0x24ee('0x20')](_0x2c703b[_0x24ee('0x1d')][_0x24ee('0x20')]);_0x2819c6[_0x24ee('0x21')]=qs[_0x24ee('0x22')](_[_0x24ee('0x23')](_0x2c703b[_0x24ee('0x1d')],_0x32adf7['filters']),_0x4f359f);if(_0x2c703b[_0x24ee('0x1d')]['filter']){_0x2819c6[_0x24ee('0x21')]=_[_0x24ee('0x24')](_0x2819c6[_0x24ee('0x21')],{'$or':_['map'](_0x4f359f,function(_0x314977){if(_0x314977[_0x24ee('0x19')]!==_0x24ee('0x25')){var _0x362376={};_0x362376[_0x314977[_0x24ee('0x16')]]={'$like':'%'+_0x2c703b['query'][_0x24ee('0x26')]+'%'};return _0x362376;}})});}_0x2819c6=_[_0x24ee('0x24')]({},_0x2819c6,_0x2c703b[_0x24ee('0x27')]);var _0x2532f0={'where':_0x2819c6[_0x24ee('0x21')]};return db[_0x24ee('0x18')][_0x24ee('0xb')](_0x2532f0)[_0x24ee('0x11')](function(_0x507a85){_0x5dc668[_0x24ee('0xb')]=_0x507a85;if(_0x2c703b['query'][_0x24ee('0x28')]){_0x2819c6[_0x24ee('0x29')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x2819c6);})[_0x24ee('0x11')](function(_0x2adde0){_0x5dc668[_0x24ee('0x2a')]=_0x2adde0;return _0x5dc668;})['then'](respondWithFilteredResult(_0x5cef7e,_0x2819c6))['catch'](handleError(_0x5cef7e,null));};exports[_0x24ee('0x2b')]=function(_0x3d8cc5,_0x28c39f){var _0x5567b3={'raw':![],'where':{'id':_0x3d8cc5['params']['id']}},_0x2f13b7={};_0x2f13b7['model']=_['keys'](db[_0x24ee('0x18')][_0x24ee('0x2c')]);_0x2f13b7[_0x24ee('0x1d')]=_['keys'](_0x3d8cc5[_0x24ee('0x1d')]);_0x2f13b7[_0x24ee('0x22')]=_[_0x24ee('0x1e')](_0x2f13b7['model'],_0x2f13b7[_0x24ee('0x1d')]);_0x5567b3[_0x24ee('0x1f')]=_[_0x24ee('0x1e')](_0x2f13b7['model'],qs[_0x24ee('0x2d')](_0x3d8cc5[_0x24ee('0x1d')]['fields']));_0x5567b3[_0x24ee('0x1f')]=_0x5567b3[_0x24ee('0x1f')][_0x24ee('0x2e')]?_0x5567b3[_0x24ee('0x1f')]:_0x2f13b7[_0x24ee('0x1b')];if(_0x3d8cc5['query'][_0x24ee('0x28')]){_0x5567b3[_0x24ee('0x29')]=[{'all':!![]}];}_0x5567b3=_['merge']({},_0x5567b3,_0x3d8cc5['options']);return db[_0x24ee('0x18')]['find'](_0x5567b3)[_0x24ee('0x11')](handleEntityNotFound(_0x28c39f,null))['then'](respondWithResult(_0x28c39f,null))[_0x24ee('0x2f')](handleError(_0x28c39f,null));};exports[_0x24ee('0x30')]=function(_0x592fab,_0x176bfe){return db[_0x24ee('0x18')][_0x24ee('0x30')](_0x592fab[_0x24ee('0x31')],{})[_0x24ee('0x11')](respondWithResult(_0x176bfe,0xc9))[_0x24ee('0x2f')](handleError(_0x176bfe,null));};exports[_0x24ee('0xf')]=function(_0xb312e5,_0x137799){if(_0xb312e5[_0x24ee('0x31')]['id']){delete _0xb312e5[_0x24ee('0x31')]['id'];}return db[_0x24ee('0x18')]['find']({'where':{'id':_0xb312e5['params']['id']}})[_0x24ee('0x11')](handleEntityNotFound(_0x137799,null))[_0x24ee('0x11')](saveUpdates(_0xb312e5['body'],null))[_0x24ee('0x11')](respondWithResult(_0x137799,null))[_0x24ee('0x2f')](handleError(_0x137799,null));};exports['destroy']=function(_0x54ae44,_0x136caf){return db[_0x24ee('0x18')][_0x24ee('0x32')]({'where':{'id':_0x54ae44[_0x24ee('0x33')]['id']}})[_0x24ee('0x11')](handleEntityNotFound(_0x136caf,null))[_0x24ee('0x11')](removeEntity(_0x136caf,null))[_0x24ee('0x2f')](handleError(_0x136caf,null));};exports[_0x24ee('0x34')]=function(_0xe53337,_0x64ea49){var _0x3d8d3e={};var _0x57ddb8={};var _0x3e30c2;var _0x1249fe;return db[_0x24ee('0x18')]['findOne']({'where':{'id':_0xe53337[_0x24ee('0x33')]['id']}})[_0x24ee('0x11')](handleEntityNotFound(_0x64ea49,null))[_0x24ee('0x11')](function(_0x1249ae){if(_0x1249ae){_0x3e30c2=_0x1249ae;_0x57ddb8[_0x24ee('0x1b')]=_[_0x24ee('0x35')](db[_0x24ee('0x36')][_0x24ee('0x2c')]);_0x57ddb8[_0x24ee('0x1d')]=_['keys'](_0xe53337['query']);_0x57ddb8[_0x24ee('0x22')]=_[_0x24ee('0x1e')](_0x57ddb8[_0x24ee('0x1b')],_0x57ddb8[_0x24ee('0x1d')]);_0x3d8d3e['attributes']=_['intersection'](_0x57ddb8['model'],qs[_0x24ee('0x2d')](_0xe53337[_0x24ee('0x1d')]['fields']));_0x3d8d3e['attributes']=_0x3d8d3e[_0x24ee('0x1f')][_0x24ee('0x2e')]?_0x3d8d3e['attributes']:_0x57ddb8[_0x24ee('0x1b')];_0x3d8d3e[_0x24ee('0x37')]=qs[_0x24ee('0x20')](_0xe53337['query'][_0x24ee('0x20')]);_0x3d8d3e[_0x24ee('0x21')]=qs[_0x24ee('0x22')](_[_0x24ee('0x23')](_0xe53337[_0x24ee('0x1d')],_0x57ddb8[_0x24ee('0x22')]));if(_0xe53337[_0x24ee('0x1d')]['filter']){_0x3d8d3e[_0x24ee('0x21')]=_[_0x24ee('0x24')](_0x3d8d3e[_0x24ee('0x21')],{'$or':_[_0x24ee('0x1c')](_0x3d8d3e['attributes'],function(_0x371328){var _0x198769={};_0x198769[_0x371328]={'$like':'%'+_0xe53337[_0x24ee('0x1d')][_0x24ee('0x26')]+'%'};return _0x198769;})});}_0x3d8d3e=_[_0x24ee('0x24')]({},_0x3d8d3e,_0xe53337['options']);return _0x3e30c2[_0x24ee('0x34')](_0x3d8d3e);}})[_0x24ee('0x11')](function(_0x35afcc){if(_0x35afcc){_0x1249fe=_0x35afcc[_0x24ee('0x2e')];if(!_0xe53337[_0x24ee('0x1d')][_0x24ee('0x38')](_0x24ee('0x39'))){_0x3d8d3e[_0x24ee('0xa')]=qs['limit'](_0xe53337[_0x24ee('0x1d')][_0x24ee('0xa')]);_0x3d8d3e[_0x24ee('0x8')]=qs[_0x24ee('0x8')](_0xe53337[_0x24ee('0x1d')][_0x24ee('0x8')]);}return _0x3e30c2[_0x24ee('0x34')](_0x3d8d3e);}})[_0x24ee('0x11')](function(_0x46e0ac){if(_0x46e0ac){return _0x46e0ac?{'count':_0x1249fe,'rows':_0x46e0ac}:null;}})[_0x24ee('0x11')](respondWithResult(_0x64ea49,null))[_0x24ee('0x2f')](handleError(_0x64ea49,null));};exports[_0x24ee('0x3a')]=function(_0x550cfa,_0x5b7c45){if(_0x550cfa[_0x24ee('0x31')]['id']){delete _0x550cfa[_0x24ee('0x31')]['id'];}return db['Dynamics365Account'][_0x24ee('0x3b')]({'where':{'id':_0x550cfa[_0x24ee('0x33')]['id']}})['then'](handleEntityNotFound(_0x5b7c45,null))[_0x24ee('0x11')](function(_0x17d9db){if(_0x17d9db){_0x550cfa[_0x24ee('0x31')][_0x24ee('0x3c')]=_0x17d9db['id'];_0x550cfa[_0x24ee('0x31')]['Subjects']=integrations['getSubjects'](_0x550cfa[_0x24ee('0x31')][_0x24ee('0x3d')],_0x550cfa[_0x24ee('0x31')][_0x24ee('0x19')]);_0x550cfa[_0x24ee('0x31')][_0x24ee('0x3e')]=integrations[_0x24ee('0x3f')](_0x550cfa['body'][_0x24ee('0x3d')],_0x550cfa[_0x24ee('0x31')][_0x24ee('0x19')]);return db[_0x24ee('0x36')][_0x24ee('0x30')](_0x550cfa[_0x24ee('0x31')],{'include':[{'model':db[_0x24ee('0x40')],'as':_0x24ee('0x41')},{'model':db['Dynamics365Field'],'as':_0x24ee('0x3e')}]});}return null;})['then'](respondWithResult(_0x5b7c45,null))[_0x24ee('0x2f')](handleError(_0x5b7c45,null));};function sanitizeRemoteUri(_0x114636){var _0x115062=_0x114636['slice'](-0x1);if(_0x115062==='/')return _0x114636[_0x24ee('0x42')](0x0,_0x114636[_0x24ee('0x43')](_0x115062));return _0x114636;}function getWebApiUrl(_0x23aa5e){return util[_0x24ee('0x44')](_0x24ee('0x45'),_0x23aa5e);}exports[_0x24ee('0x46')]=function(_0xc4a55a,_0x1810ba){var _0x3d8386=_0xc4a55a[_0x24ee('0x1d')][_0x24ee('0x47')];var _0x514418=_0x3d8386===_0x24ee('0x48')?_0x24ee('0x49'):'PhoneCall';var _0x4340f9='';var _0xaa9d98='';var _0xade469='';var _0x34fec6='';var _0x1a38b6='';var _0x32035a='';var _0xe01f72='';var _0x44b514='';var _0xcab700=[_0x24ee('0x4a'),'description',_0x24ee('0x4b'),_0x24ee('0x4c'),_0x24ee('0x4d'),_0x24ee('0x4e'),'phonenumber',_0x24ee('0x4f'),_0x24ee('0x50'),_0x24ee('0x51')];var _0x41cfbe=[_0x24ee('0x52'),'accountidyominame',_0x24ee('0x53'),_0x24ee('0x54'),_0x24ee('0x55'),_0x24ee('0x56'),_0x24ee('0x57'),_0x24ee('0x58'),_0x24ee('0x59'),_0x24ee('0x5a'),_0x24ee('0x5b'),_0x24ee('0x5c'),'createdon',_0x24ee('0x5d'),_0x24ee('0x5e'),_0x24ee('0x5f'),_0x24ee('0x60'),_0x24ee('0x61'),_0x24ee('0x62'),_0x24ee('0x63'),_0x24ee('0x64'),_0x24ee('0x65'),_0x24ee('0x66'),_0x24ee('0x67'),'firstresponsebykpiidname',_0x24ee('0x68'),'importsequencenumber',_0x24ee('0x69'),_0x24ee('0x6a'),_0x24ee('0x6b'),_0x24ee('0x6c'),_0x24ee('0x6d'),_0x24ee('0x6e'),_0x24ee('0x6f'),'modifiedbyyominame',_0x24ee('0x70'),_0x24ee('0x71'),'modifiedonbehalfbyyominame',_0x24ee('0x72'),'msdyn_iotalertname',_0x24ee('0x73'),'onholdtime','overriddencreatedon',_0x24ee('0x74'),'owneridtype',_0x24ee('0x75'),_0x24ee('0x76'),_0x24ee('0x77'),_0x24ee('0x78'),_0x24ee('0x79'),'productidname',_0x24ee('0x7a'),'resolveby',_0x24ee('0x7b'),'responseby',_0x24ee('0x7c'),_0x24ee('0x7d'),_0x24ee('0x7e'),_0x24ee('0x7f'),_0x24ee('0x80'),_0x24ee('0x81'),'statecode','statuscode',_0x24ee('0x82'),'ticketnumber',_0x24ee('0x83'),_0x24ee('0x84'),'traversedpath','utcconversiontimezonecode',_0x24ee('0x85')];var _0x2152f0=_0xcab700[_0x24ee('0x86')](_0x41cfbe);return db[_0x24ee('0x18')][_0x24ee('0x3b')]({'where':{'id':_0xc4a55a[_0x24ee('0x33')]['id']},'attributes':['id',_0x24ee('0x87'),'password',_0x24ee('0x88'),'tenantId',_0x24ee('0x89'),'clientSecret','modernAuthentication'],'include':[{'model':db[_0x24ee('0x8a')],'as':_0x24ee('0x8a'),'attributes':['id',_0x24ee('0x8b'),'data7']}]})['then'](handleEntityNotFound(_0x1810ba,null))[_0x24ee('0x11')](function(_0x553e6d){if(_0x553e6d){if(_0x553e6d[_0x24ee('0x8c')]){_0x553e6d['access_token']=_0x553e6d[_0x24ee('0x8a')][_0x24ee('0x8b')];_0x44b514=sanitizeRemoteUri(_0x553e6d[_0x24ee('0x8a')][_0x24ee('0x8d')]);_0xe01f72=getWebApiUrl(_0x44b514);return _0x553e6d;}_0x44b514=sanitizeRemoteUri(_0x553e6d[_0x24ee('0x88')]);_0xe01f72=getWebApiUrl(_0x44b514);var _0x44e2b6={'method':_0x24ee('0x8e'),'uri':_0x24ee('0x8f')+_0x553e6d[_0x24ee('0x90')]+_0x24ee('0x91'),'form':{'client_id':_0x553e6d['clientId'],'resource':_0x44b514,'username':_0x553e6d['username'],'password':_0x553e6d[_0x24ee('0x92')],'grant_type':_0x24ee('0x92'),'client_secret':_0x553e6d[_0x24ee('0x93')]},'json':!![]};return rp(_0x44e2b6);}})[_0x24ee('0x11')](function(_0x25cb0e){_0x32035a=_0x25cb0e[_0x24ee('0x94')];var _0xc32eea={'method':_0x24ee('0x95'),'uri':encodeURI(_0xe01f72+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x514418+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x32035a,'If-None-Match':null,'OData-Version':_0x24ee('0x96')},'json':!![]};return rp(_0xc32eea);})[_0x24ee('0x11')](function(_0x23f224){var _0x17be91=_0x23f224[_0x24ee('0x97')][0x0];var _0x1b52d4=_0x17be91['MetadataId'];var _0x31a955={'method':_0x24ee('0x95'),'uri':_0xe01f72+_0x24ee('0x98')+_0x1b52d4+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x24ee('0x99')+_0x32035a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x31a955);})[_0x24ee('0x11')](function(_0x52d486){_0x4340f9=_0x52d486;_0xaa9d98=_0x4340f9[_0x24ee('0x9a')];_0xaa9d98=_['remove'](_0xaa9d98,function(_0x114c5b){return!_0x2152f0[_0x24ee('0x9b')](_0x114c5b[_0x24ee('0x9c')]);});var _0x5ca436=[];var _0x5cdb65=[];_0xaa9d98[_0x24ee('0x9d')](function(_0x43570b){if(_0x43570b[_0x24ee('0x9e')]){var _0x47ee37=_0x43570b[_0x24ee('0x9e')]['substring'](_0x43570b[_0x24ee('0x9e')]['lastIndexOf']('.')+0x1);if(_0x47ee37===_0x24ee('0x9f')){_0x5ca436['push'](getSelectList(_0xe01f72,_0x3d8386,_0x5cdb65,_0x4340f9[_0x24ee('0xa0')],_0x43570b['MetadataId'],_0x32035a));}}});return Promise[_0x24ee('0xa1')](_0x5ca436);})[_0x24ee('0x11')](function(_0x37dffd){_0xade469=_0x37dffd[0x0];var _0x57af74=[];var _0x20741c=[];_0xaa9d98[_0x24ee('0x9d')](function(_0x1d671a){if(!_[_0x24ee('0xa2')](_0x1d671a['@odata.type'])){var _0x48ff97=_0x1d671a[_0x24ee('0x9e')][_0x24ee('0x42')](_0x1d671a[_0x24ee('0x9e')][_0x24ee('0x43')]('.')+0x1);if(_0x48ff97===_0x24ee('0xa3')){_0x57af74['push'](getBooleanList(_0xe01f72,_0x3d8386,_0x20741c,_0x4340f9['MetadataId'],_0x1d671a[_0x24ee('0xa0')],_0x32035a));}}});return Promise[_0x24ee('0xa1')](_0x57af74);})[_0x24ee('0x11')](function(_0x1e1437){_0x34fec6=_0x1e1437[0x0];var _0x2a1102=[];var _0x256b25=[];_0xaa9d98['forEach'](function(_0xbb3613){if(_0xbb3613[_0x24ee('0x9e')]){var _0x15f230=_0xbb3613['@odata.type']['substring'](_0xbb3613[_0x24ee('0x9e')][_0x24ee('0x43')]('.')+0x1);if(_0x15f230===_0x24ee('0xa4')||_0x15f230===_0x24ee('0xa5')||_0x15f230===_0x24ee('0xa6')||_0x15f230==='IntegerAttributeMetadata'||_0x15f230==='MemoAttributeMetadata'||_0x15f230==='DateTimeAttributeMetadata'||_0x15f230===_0x24ee('0xa7')||_0x15f230===_0x24ee('0xa8')||_0x15f230===_0x24ee('0xa9')||_0x15f230===_0x24ee('0xaa')){_0x2a1102[_0x24ee('0xab')](getInputList(_0xe01f72,_0x3d8386,_0x15f230,_0x256b25,_0x4340f9[_0x24ee('0xa0')],_0xbb3613[_0x24ee('0xa0')],_0x32035a));}}});return Promise['all'](_0x2a1102);})[_0x24ee('0x11')](function(_0x3b5688){_0x1a38b6=_0x3b5688[0x0];var _0x3d934e=_0xade469[_0x24ee('0x86')](_0x34fec6)[_0x24ee('0x86')](_0x1a38b6);var _0x54d155={'count':_0x3d934e[_0x24ee('0x2e')],'rows':_0x3d934e};return _0x54d155;})['then'](respondWithResult(_0x1810ba,null))[_0x24ee('0x2f')](function(_0x1f03fc){var _0x430935=_0xc4a55a[_0x24ee('0x1d')][_0x24ee('0xac')]?0x1f4:_0x1f03fc['statusCode']||0x1f4;logger[_0x24ee('0x14')](_0x1f03fc[_0x24ee('0x15')]);delete _0x1f03fc['name'];if(_0x430935===0x191){_0x430935=0x190;}_0x1810ba[_0x24ee('0x7')](_0x430935)[_0x24ee('0xad')](_0xc4a55a[_0x24ee('0x1d')][_0x24ee('0xac')]?{'message':_0x24ee('0xae'),'statusCode':_0x1f03fc[_0x24ee('0xaf')]}:_0x1f03fc);});};function getSelectList(_0xbc0d57,_0x2505a8,_0x1ab543,_0x38e193,_0x5e4e8a,_0x2adda5){var _0xe8ad90={'method':_0x24ee('0x95'),'uri':_0xbc0d57+_0x24ee('0x98')+_0x38e193+_0x24ee('0xb0')+_0x5e4e8a+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x24ee('0xb1'),'headers':{'Authorization':_0x24ee('0x99')+_0x2adda5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xe8ad90)[_0x24ee('0x11')](function(_0x44a8e3){var _0x7c6367=[];var _0x3e52c1=_0x44a8e3[_0x24ee('0xb2')][_0x24ee('0xb3')];_0x3e52c1[_0x24ee('0x9d')](function(_0xf0ef4c){_0x7c6367[_0x24ee('0xab')]({'name':_0xf0ef4c[_0x24ee('0xb4')]['UserLocalizedLabel'][_0x24ee('0xb4')],'value':String(_0xf0ef4c['Value'])});});var _0x63d543={'id':_0x2505a8+'_'+_0x44a8e3[_0x24ee('0x9c')],'name':_0x44a8e3[_0x24ee('0xb5')][_0x24ee('0xb6')]['Label'],'custom':![],'options':_0x7c6367};_0x1ab543[_0x24ee('0xab')](_0x63d543);return _0x1ab543;});}function getBooleanList(_0xfbbe36,_0x2accdc,_0x2bcbbf,_0x13bbcd,_0x31f0e9,_0x19bcf3){var _0xda370f={'method':_0x24ee('0x95'),'uri':_0xfbbe36+_0x24ee('0x98')+_0x13bbcd+_0x24ee('0xb0')+_0x31f0e9+_0x24ee('0xb7'),'headers':{'Authorization':_0x24ee('0x99')+_0x19bcf3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xda370f)[_0x24ee('0x11')](function(_0x4866fc){var _0x4c42af=[];_0x4c42af[_0x24ee('0xab')]({'name':_0x4866fc[_0x24ee('0xb2')][_0x24ee('0xb8')][_0x24ee('0xb4')][_0x24ee('0xb6')][_0x24ee('0xb4')],'value':_0x24ee('0xb9')},{'name':_0x4866fc['OptionSet']['FalseOption'][_0x24ee('0xb4')][_0x24ee('0xb6')][_0x24ee('0xb4')],'value':_0x24ee('0xba')});var _0x50eb9c={'id':_0x2accdc+'_'+_0x4866fc['LogicalName'],'name':_0x4866fc[_0x24ee('0xb5')][_0x24ee('0xb6')][_0x24ee('0xb4')],'custom':![],'options':_0x4c42af};_0x2bcbbf[_0x24ee('0xab')](_0x50eb9c);return _0x2bcbbf;});}function getInputList(_0xcf6945,_0x42fc59,_0x2be1d8,_0x30c623,_0x18123f,_0x285b53,_0x30a51a){var _0x4edd22={'method':_0x24ee('0x95'),'uri':_0xcf6945+_0x24ee('0x98')+_0x18123f+_0x24ee('0xb0')+_0x285b53+_0x24ee('0xbb')+_0x2be1d8+_0x24ee('0xbc'),'headers':{'Authorization':'Bearer\x20'+_0x30a51a,'If-None-Match':null,'OData-Version':_0x24ee('0x96')},'json':!![]};return rp(_0x4edd22)[_0x24ee('0x11')](function(_0x3a4792){var _0x3a674c={'id':_0x42fc59+'_'+_0x3a4792[_0x24ee('0x9c')],'name':_0x3a4792[_0x24ee('0xb5')]['UserLocalizedLabel']?_0x3a4792[_0x24ee('0xb5')][_0x24ee('0xb6')][_0x24ee('0xb4')]:_0x3a4792[_0x24ee('0x9c')],'custom':![],'options':[]};_0x30c623[_0x24ee('0xab')](_0x3a674c);return _0x30c623;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index ad2ea1d..2f04417 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x6ff997,_0x4868df){var _0x31256c=function(_0x5a6648){while(--_0x5a6648){_0x6ff997['push'](_0x6ff997['shift']());}};_0x31256c(++_0x4868df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x48c4ef,_0x319d44){var _0x435715=function(_0x925d50){while(--_0x925d50){_0x48c4ef['push'](_0x48c4ef['shift']());}};_0x435715(++_0x319d44);}(_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 diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index fb4c5a6..5280d5b 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 _0xc7a4=['attributes','limit','include','model','map','ShowDynamics365Account','find','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xc7a4,0x98));var _0x4c7a=function(_0x15e357,_0x2ded3d){_0x15e357=_0x15e357-0x0;var _0xb49ae9=_0xc7a4[_0x15e357];return _0xb49ae9;};'use strict';var _=require(_0x4c7a('0x0'));var util=require('util');var moment=require(_0x4c7a('0x1'));var BPromise=require(_0x4c7a('0x2'));var rs=require(_0x4c7a('0x3'));var fs=require('fs');var Redis=require(_0x4c7a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c7a('0x5'));var logger=require(_0x4c7a('0x6'))(_0x4c7a('0x7'));var config=require('../../config/environment');var jayson=require(_0x4c7a('0x8'));var client=jayson[_0x4c7a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x476422,_0x2712ae,_0x5e10bb){return new BPromise(function(_0x1441be,_0x162aab){return client[_0x4c7a('0xa')](_0x476422,_0x5e10bb)[_0x4c7a('0xb')](function(_0x3af788){logger[_0x4c7a('0xc')](_0x4c7a('0xd'),_0x2712ae,_0x4c7a('0xe'));logger[_0x4c7a('0xf')](_0x4c7a('0x10'),_0x2712ae,_0x4c7a('0xe'),JSON[_0x4c7a('0x11')](_0x3af788));if(_0x3af788[_0x4c7a('0x12')]){if(_0x3af788[_0x4c7a('0x12')][_0x4c7a('0x13')]===0x1f4){logger[_0x4c7a('0x12')](_0x4c7a('0xd'),_0x2712ae,_0x3af788[_0x4c7a('0x12')][_0x4c7a('0x14')]);return _0x162aab(_0x3af788[_0x4c7a('0x12')][_0x4c7a('0x14')]);}logger[_0x4c7a('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x2712ae,_0x3af788['error'][_0x4c7a('0x14')]);return _0x1441be(_0x3af788[_0x4c7a('0x12')][_0x4c7a('0x14')]);}else{logger['info'](_0x4c7a('0xd'),_0x2712ae,_0x4c7a('0xe'));_0x1441be(_0x3af788[_0x4c7a('0x15')]['message']);}})['catch'](function(_0x1ef771){logger[_0x4c7a('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x2712ae,_0x1ef771);_0x162aab(_0x1ef771);});});}exports[_0x4c7a('0x16')]=function(_0x2a8bd5){var _0x4529b6=this;return new Promise(function(_0xeeeed8,_0x55983b){return db[_0x4c7a('0x17')][_0x4c7a('0x18')]({'raw':_0x2a8bd5['options']?_0x2a8bd5[_0x4c7a('0x19')][_0x4c7a('0x1a')]===undefined?!![]:![]:!![],'where':_0x2a8bd5[_0x4c7a('0x19')]?_0x2a8bd5['options'][_0x4c7a('0x1b')]||null:null,'attributes':_0x2a8bd5[_0x4c7a('0x19')]?_0x2a8bd5[_0x4c7a('0x19')][_0x4c7a('0x1c')]||null:null,'limit':_0x2a8bd5[_0x4c7a('0x19')]?_0x2a8bd5['options'][_0x4c7a('0x1d')]||null:null,'include':_0x2a8bd5[_0x4c7a('0x19')]?_0x2a8bd5['options'][_0x4c7a('0x1e')]?_['map'](_0x2a8bd5[_0x4c7a('0x19')][_0x4c7a('0x1e')],function(_0x4f332a){return{'model':db[_0x4f332a['model']],'as':_0x4f332a['as'],'attributes':_0x4f332a[_0x4c7a('0x1c')],'include':_0x4f332a['include']?_['map'](_0x4f332a[_0x4c7a('0x1e')],function(_0x297bf6){return{'model':db[_0x297bf6[_0x4c7a('0x1f')]],'as':_0x297bf6['as'],'attributes':_0x297bf6['attributes'],'include':_0x297bf6[_0x4c7a('0x1e')]?_[_0x4c7a('0x20')](_0x297bf6[_0x4c7a('0x1e')],function(_0x3e2b89){return{'model':db[_0x3e2b89[_0x4c7a('0x1f')]],'as':_0x3e2b89['as'],'attributes':_0x3e2b89[_0x4c7a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4c7a('0xb')](function(_0x357ba1){logger[_0x4c7a('0xc')](_0x4c7a('0x16'),_0x2a8bd5);logger[_0x4c7a('0xf')](_0x4c7a('0x16'),_0x2a8bd5,JSON[_0x4c7a('0x11')](_0x357ba1));_0xeeeed8(_0x357ba1);})['catch'](function(_0xe9033d){logger[_0x4c7a('0x12')](_0x4c7a('0x16'),_0xe9033d[_0x4c7a('0x14')],_0x2a8bd5);_0x55983b(_0x4529b6[_0x4c7a('0x12')](0x1f4,_0xe9033d[_0x4c7a('0x14')]));});});};exports[_0x4c7a('0x21')]=function(_0x3486d1){var _0x58249a=this;return new Promise(function(_0xe80116,_0x212f38){return db[_0x4c7a('0x17')][_0x4c7a('0x22')]({'raw':_0x3486d1['options']?_0x3486d1['options'][_0x4c7a('0x1a')]===undefined?!![]:![]:!![],'where':_0x3486d1[_0x4c7a('0x19')]?_0x3486d1['options'][_0x4c7a('0x1b')]||null:null,'attributes':_0x3486d1['options']?_0x3486d1[_0x4c7a('0x19')]['attributes']||null:null,'include':_0x3486d1[_0x4c7a('0x19')]?_0x3486d1[_0x4c7a('0x19')]['include']?_[_0x4c7a('0x20')](_0x3486d1[_0x4c7a('0x19')][_0x4c7a('0x1e')],function(_0x1f3df1){return{'model':db[_0x1f3df1[_0x4c7a('0x1f')]],'as':_0x1f3df1['as'],'attributes':_0x1f3df1[_0x4c7a('0x1c')],'include':_0x1f3df1[_0x4c7a('0x1e')]?_[_0x4c7a('0x20')](_0x1f3df1[_0x4c7a('0x1e')],function(_0x1f918c){return{'model':db[_0x1f918c['model']],'as':_0x1f918c['as'],'attributes':_0x1f918c[_0x4c7a('0x1c')],'include':_0x1f918c[_0x4c7a('0x1e')]?_[_0x4c7a('0x20')](_0x1f918c['include'],function(_0x377283){return{'model':db[_0x377283[_0x4c7a('0x1f')]],'as':_0x377283['as'],'attributes':_0x377283[_0x4c7a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4c7a('0xb')](function(_0x1da1b4){logger['info'](_0x4c7a('0x21'),_0x3486d1);logger[_0x4c7a('0xf')](_0x4c7a('0x21'),_0x3486d1,JSON[_0x4c7a('0x11')](_0x1da1b4));_0xe80116(_0x1da1b4);})[_0x4c7a('0x23')](function(_0x110efb){logger[_0x4c7a('0x12')]('ShowDynamics365Account',_0x110efb[_0x4c7a('0x14')],_0x3486d1);_0x212f38(_0x58249a[_0x4c7a('0x12')](0x1f4,_0x110efb[_0x4c7a('0x14')]));});});}; \ No newline at end of file +var _0xd94f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetDynamics365Account','findAll','options','raw','attributes','include','map','model','stringify','ShowDynamics365Account','find','where','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x474646,_0x13664d){var _0x39755a=function(_0x3e652f){while(--_0x3e652f){_0x474646['push'](_0x474646['shift']());}};_0x39755a(++_0x13664d);}(_0xd94f,0x147));var _0xfd94=function(_0x35d2ec,_0x30848c){_0x35d2ec=_0x35d2ec-0x0;var _0x1ca87d=_0xd94f[_0x35d2ec];return _0x1ca87d;};'use strict';var _=require(_0xfd94('0x0'));var util=require(_0xfd94('0x1'));var moment=require(_0xfd94('0x2'));var BPromise=require(_0xfd94('0x3'));var rs=require(_0xfd94('0x4'));var fs=require('fs');var Redis=require(_0xfd94('0x5'));var db=require(_0xfd94('0x6'))['db'];var utils=require(_0xfd94('0x7'));var logger=require(_0xfd94('0x8'))(_0xfd94('0x9'));var config=require(_0xfd94('0xa'));var jayson=require(_0xfd94('0xb'));var client=jayson[_0xfd94('0xc')][_0xfd94('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3e9870,_0x469de5,_0x381f1e){return new BPromise(function(_0x5e10f1,_0x4163c2){return client[_0xfd94('0xe')](_0x3e9870,_0x381f1e)['then'](function(_0x1054d3){logger[_0xfd94('0xf')](_0xfd94('0x10'),_0x469de5,'request\x20sent');logger[_0xfd94('0x11')](_0xfd94('0x12'),_0x469de5,_0xfd94('0x13'),JSON['stringify'](_0x1054d3));if(_0x1054d3[_0xfd94('0x14')]){if(_0x1054d3['error'][_0xfd94('0x15')]===0x1f4){logger[_0xfd94('0x14')](_0xfd94('0x10'),_0x469de5,_0x1054d3[_0xfd94('0x14')][_0xfd94('0x16')]);return _0x4163c2(_0x1054d3[_0xfd94('0x14')][_0xfd94('0x16')]);}logger[_0xfd94('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x469de5,_0x1054d3[_0xfd94('0x14')][_0xfd94('0x16')]);return _0x5e10f1(_0x1054d3['error'][_0xfd94('0x16')]);}else{logger[_0xfd94('0xf')](_0xfd94('0x10'),_0x469de5,'request\x20sent');_0x5e10f1(_0x1054d3[_0xfd94('0x17')][_0xfd94('0x16')]);}})[_0xfd94('0x18')](function(_0x495871){logger[_0xfd94('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x469de5,_0x495871);_0x4163c2(_0x495871);});});}exports[_0xfd94('0x19')]=function(_0x149080){var _0x3e73cb=this;return new Promise(function(_0x3b4b44,_0x3799fb){return db['Dynamics365Account'][_0xfd94('0x1a')]({'raw':_0x149080['options']?_0x149080[_0xfd94('0x1b')][_0xfd94('0x1c')]===undefined?!![]:![]:!![],'where':_0x149080['options']?_0x149080[_0xfd94('0x1b')]['where']||null:null,'attributes':_0x149080[_0xfd94('0x1b')]?_0x149080[_0xfd94('0x1b')][_0xfd94('0x1d')]||null:null,'limit':_0x149080[_0xfd94('0x1b')]?_0x149080[_0xfd94('0x1b')]['limit']||null:null,'include':_0x149080[_0xfd94('0x1b')]?_0x149080[_0xfd94('0x1b')][_0xfd94('0x1e')]?_[_0xfd94('0x1f')](_0x149080[_0xfd94('0x1b')][_0xfd94('0x1e')],function(_0x1eae2e){return{'model':db[_0x1eae2e['model']],'as':_0x1eae2e['as'],'attributes':_0x1eae2e[_0xfd94('0x1d')],'include':_0x1eae2e['include']?_['map'](_0x1eae2e['include'],function(_0x4a73c1){return{'model':db[_0x4a73c1[_0xfd94('0x20')]],'as':_0x4a73c1['as'],'attributes':_0x4a73c1[_0xfd94('0x1d')],'include':_0x4a73c1['include']?_['map'](_0x4a73c1[_0xfd94('0x1e')],function(_0x588966){return{'model':db[_0x588966[_0xfd94('0x20')]],'as':_0x588966['as'],'attributes':_0x588966['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d2f16){logger[_0xfd94('0xf')](_0xfd94('0x19'),_0x149080);logger['debug'](_0xfd94('0x19'),_0x149080,JSON[_0xfd94('0x21')](_0x2d2f16));_0x3b4b44(_0x2d2f16);})[_0xfd94('0x18')](function(_0x19aa74){logger[_0xfd94('0x14')](_0xfd94('0x19'),_0x19aa74[_0xfd94('0x16')],_0x149080);_0x3799fb(_0x3e73cb['error'](0x1f4,_0x19aa74[_0xfd94('0x16')]));});});};exports[_0xfd94('0x22')]=function(_0x4779d8){var _0x209e48=this;return new Promise(function(_0x7291e8,_0x503660){return db['Dynamics365Account'][_0xfd94('0x23')]({'raw':_0x4779d8[_0xfd94('0x1b')]?_0x4779d8[_0xfd94('0x1b')][_0xfd94('0x1c')]===undefined?!![]:![]:!![],'where':_0x4779d8[_0xfd94('0x1b')]?_0x4779d8[_0xfd94('0x1b')][_0xfd94('0x24')]||null:null,'attributes':_0x4779d8[_0xfd94('0x1b')]?_0x4779d8[_0xfd94('0x1b')][_0xfd94('0x1d')]||null:null,'include':_0x4779d8[_0xfd94('0x1b')]?_0x4779d8[_0xfd94('0x1b')][_0xfd94('0x1e')]?_[_0xfd94('0x1f')](_0x4779d8[_0xfd94('0x1b')]['include'],function(_0x2a7dfc){return{'model':db[_0x2a7dfc['model']],'as':_0x2a7dfc['as'],'attributes':_0x2a7dfc[_0xfd94('0x1d')],'include':_0x2a7dfc[_0xfd94('0x1e')]?_[_0xfd94('0x1f')](_0x2a7dfc[_0xfd94('0x1e')],function(_0xb9bdea){return{'model':db[_0xb9bdea[_0xfd94('0x20')]],'as':_0xb9bdea['as'],'attributes':_0xb9bdea[_0xfd94('0x1d')],'include':_0xb9bdea[_0xfd94('0x1e')]?_[_0xfd94('0x1f')](_0xb9bdea['include'],function(_0x5710e0){return{'model':db[_0x5710e0[_0xfd94('0x20')]],'as':_0x5710e0['as'],'attributes':_0x5710e0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x265e14){logger['info'](_0xfd94('0x22'),_0x4779d8);logger[_0xfd94('0x11')](_0xfd94('0x22'),_0x4779d8,JSON['stringify'](_0x265e14));_0x7291e8(_0x265e14);})['catch'](function(_0x1979ae){logger[_0xfd94('0x14')](_0xfd94('0x22'),_0x1979ae[_0xfd94('0x16')],_0x4779d8);_0x503660(_0x209e48['error'](0x1f4,_0x1979ae[_0xfd94('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 6f455fc..97a5520 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 _0x392f=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','put','update'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x392f,0x13b));var _0xf392=function(_0x172298,_0x542449){_0x172298=_0x172298-0x0;var _0x44856d=_0x392f[_0x172298];return _0x44856d;};'use strict';var multer=require(_0xf392('0x0'));var util=require(_0xf392('0x1'));var path=require('path');var timeout=require(_0xf392('0x2'));var express=require(_0xf392('0x3'));var router=express[_0xf392('0x4')]();var fs_extra=require(_0xf392('0x5'));var auth=require(_0xf392('0x6'));var interaction=require(_0xf392('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0xf392('0x8')]('/',auth[_0xf392('0x9')](),controller[_0xf392('0xa')]);router[_0xf392('0x8')](_0xf392('0xb'),auth['isAuthenticated'](),controller[_0xf392('0xc')]);router[_0xf392('0x8')](_0xf392('0xd'),auth[_0xf392('0x9')](),controller[_0xf392('0xe')]);router[_0xf392('0x8')](_0xf392('0xf'),auth[_0xf392('0x9')](),controller[_0xf392('0x10')]);router[_0xf392('0x8')](_0xf392('0x11'),auth[_0xf392('0x9')](),controller['getDescriptions']);router[_0xf392('0x12')]('/',auth[_0xf392('0x9')](),controller['create']);router[_0xf392('0x13')]('/:id',auth[_0xf392('0x9')](),controller[_0xf392('0x14')]);router[_0xf392('0x15')](_0xf392('0xb'),auth[_0xf392('0x9')](),controller[_0xf392('0x16')]);module[_0xf392('0x17')]=router; \ No newline at end of file +var _0x439f=['exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy'];(function(_0x295b83,_0x247114){var _0x22f571=function(_0x34a305){while(--_0x34a305){_0x295b83['push'](_0x295b83['shift']());}};_0x22f571(++_0x247114);}(_0x439f,0x1c3));var _0xf439=function(_0x401ccd,_0x140815){_0x401ccd=_0x401ccd-0x0;var _0x5a57ad=_0x439f[_0x401ccd];return _0x5a57ad;};'use strict';var multer=require(_0xf439('0x0'));var util=require('util');var path=require(_0xf439('0x1'));var timeout=require(_0xf439('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf439('0x3'));var auth=require(_0xf439('0x4'));var interaction=require(_0xf439('0x5'));var config=require(_0xf439('0x6'));var controller=require(_0xf439('0x7'));router[_0xf439('0x8')]('/',auth[_0xf439('0x9')](),controller[_0xf439('0xa')]);router[_0xf439('0x8')](_0xf439('0xb'),auth['isAuthenticated'](),controller[_0xf439('0xc')]);router[_0xf439('0x8')](_0xf439('0xd'),auth[_0xf439('0x9')](),controller[_0xf439('0xe')]);router['get'](_0xf439('0xf'),auth[_0xf439('0x9')](),controller[_0xf439('0x10')]);router['get'](_0xf439('0x11'),auth[_0xf439('0x9')](),controller['getDescriptions']);router[_0xf439('0x12')]('/',auth[_0xf439('0x9')](),controller[_0xf439('0x13')]);router[_0xf439('0x14')](_0xf439('0xb'),auth[_0xf439('0x9')](),controller[_0xf439('0x15')]);router[_0xf439('0x16')](_0xf439('0xb'),auth[_0xf439('0x9')](),controller[_0xf439('0x17')]);module[_0xf439('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 54ff751..cadc37f 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 _0x1e64=['exports','STRING','ENUM','incident','phonecall','contact'];(function(_0x121db5,_0x31e9b6){var _0x581d22=function(_0xc9d7f9){while(--_0xc9d7f9){_0x121db5['push'](_0x121db5['shift']());}};_0x581d22(++_0x31e9b6);}(_0x1e64,0x180));var _0x41e6=function(_0x17ce2b,_0x4bd466){_0x17ce2b=_0x17ce2b-0x0;var _0x3c3415=_0x1e64[_0x17ce2b];return _0x3c3415;};'use strict';var Sequelize=require('sequelize');module[_0x41e6('0x0')]={'name':{'type':Sequelize[_0x41e6('0x1')]},'description':{'type':Sequelize[_0x41e6('0x1')]},'ticketType':{'type':Sequelize[_0x41e6('0x2')](_0x41e6('0x3'),_0x41e6('0x4')),'defaultValue':_0x41e6('0x3')},'moduleCreate':{'type':Sequelize[_0x41e6('0x2')](_0x41e6('0x5'),'nothing'),'defaultValue':'contact','allowNull':![]}}; \ No newline at end of file +var _0xe9bc=['exports','STRING','ENUM','incident','phonecall','contact'];(function(_0x5cae3c,_0x2e3a68){var _0xd50b4f=function(_0x1ba669){while(--_0x1ba669){_0x5cae3c['push'](_0x5cae3c['shift']());}};_0xd50b4f(++_0x2e3a68);}(_0xe9bc,0x11a));var _0xce9b=function(_0xb6c5f8,_0x2f1ff6){_0xb6c5f8=_0xb6c5f8-0x0;var _0x57f855=_0xe9bc[_0xb6c5f8];return _0x57f855;};'use strict';var Sequelize=require('sequelize');module[_0xce9b('0x0')]={'name':{'type':Sequelize[_0xce9b('0x1')]},'description':{'type':Sequelize[_0xce9b('0x1')]},'ticketType':{'type':Sequelize[_0xce9b('0x2')](_0xce9b('0x3'),_0xce9b('0x4')),'defaultValue':_0xce9b('0x3')},'moduleCreate':{'type':Sequelize[_0xce9b('0x2')](_0xce9b('0x5'),'nothing'),'defaultValue':'contact','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 3cba0f8..dd1d545 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 _0x7000=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','Dynamics365Field','getFields','getSubjects','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash'];(function(_0x151ded,_0xf4afea){var _0x4c9ca5=function(_0x5beaaa){while(--_0x5beaaa){_0x151ded['push'](_0x151ded['shift']());}};_0x4c9ca5(++_0xf4afea);}(_0x7000,0x1dd));var _0x0700=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0x7000[_0x136a0d];return _0x212ea5;};'use strict';var emlformat=require(_0x0700('0x0'));var rimraf=require(_0x0700('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0700('0x2'));var moment=require(_0x0700('0x3'));var BPromise=require(_0x0700('0x4'));var Mustache=require(_0x0700('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0700('0x6'));var ejs=require(_0x0700('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0700('0x8'));var squel=require(_0x0700('0x9'));var crypto=require(_0x0700('0xa'));var jsforce=require(_0x0700('0xb'));var deskjs=require(_0x0700('0xc'));var toCsv=require(_0x0700('0x6'));var querystring=require(_0x0700('0xd'));var Papa=require(_0x0700('0xe'));var Redis=require(_0x0700('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0700('0x10'));var hardwareService=require(_0x0700('0x11'));var logger=require('../../config/logger')(_0x0700('0x12'));var utils=require(_0x0700('0x13'));var config=require(_0x0700('0x14'));var licenseUtil=require(_0x0700('0x15'));var db=require(_0x0700('0x16'))['db'];function respondWithStatusCode(_0x396d50,_0x24775a){_0x24775a=_0x24775a||0xcc;return function(_0x4ec33c){if(_0x4ec33c){return _0x396d50['sendStatus'](_0x24775a);}return _0x396d50[_0x0700('0x17')](_0x24775a)['end']();};}function respondWithResult(_0x599a83,_0x377220){_0x377220=_0x377220||0xc8;return function(_0x44a39c){if(_0x44a39c){return _0x599a83[_0x0700('0x17')](_0x377220)[_0x0700('0x18')](_0x44a39c);}};}function respondWithFilteredResult(_0x46d4d9,_0x1c2f17){return function(_0x2cdf1d){if(_0x2cdf1d){var _0x478e3e=typeof _0x1c2f17[_0x0700('0x19')]===_0x0700('0x1a')&&typeof _0x1c2f17[_0x0700('0x1b')]==='undefined';var _0x52ab4f=_0x2cdf1d[_0x0700('0x1c')];var _0xf80746=_0x478e3e?0x0:_0x1c2f17[_0x0700('0x19')];var _0x170e26=_0x478e3e?_0x2cdf1d[_0x0700('0x1c')]:_0x1c2f17[_0x0700('0x19')]+_0x1c2f17[_0x0700('0x1b')];var _0x1b4974;if(_0x170e26>=_0x52ab4f){_0x170e26=_0x52ab4f;_0x1b4974=0xc8;}else{_0x1b4974=0xce;}_0x46d4d9[_0x0700('0x17')](_0x1b4974);return _0x46d4d9[_0x0700('0x1d')](_0x0700('0x1e'),_0xf80746+'-'+_0x170e26+'/'+_0x52ab4f)['json'](_0x2cdf1d);}return null;};}function patchUpdates(_0x3ea791){return function(_0x320172){try{jsonpatch[_0x0700('0x1f')](_0x320172,_0x3ea791,!![]);}catch(_0x56ab8b){return BPromise[_0x0700('0x20')](_0x56ab8b);}return _0x320172[_0x0700('0x21')]();};}function saveUpdates(_0x37f508,_0x487a67){return function(_0x5d423b){if(_0x5d423b){return _0x5d423b[_0x0700('0x22')](_0x37f508)['then'](function(_0x59bd30){return _0x59bd30;});}return null;};}function removeEntity(_0x205ae9,_0x6aa838){return function(_0x1de23d){if(_0x1de23d){return _0x1de23d[_0x0700('0x23')]()[_0x0700('0x24')](function(){_0x205ae9[_0x0700('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d7df3,_0x4fadb4){return function(_0x2a5bc2){if(!_0x2a5bc2){_0x5d7df3['sendStatus'](0x194);}return _0x2a5bc2;};}function handleError(_0x5845c8,_0x47c684){_0x47c684=_0x47c684||0x1f4;return function(_0x12136c){logger[_0x0700('0x25')](_0x12136c[_0x0700('0x26')]);if(_0x12136c[_0x0700('0x27')]){delete _0x12136c[_0x0700('0x27')];}_0x5845c8['status'](_0x47c684)[_0x0700('0x28')](_0x12136c);};}exports[_0x0700('0x29')]=function(_0x11e0ef,_0x2ea038){var _0x3e3dc9={},_0x19f7b0={},_0x2493bb={'count':0x0,'rows':[]};var _0x4081ef=_['map'](db['Dynamics365Configuration'][_0x0700('0x2a')],function(_0x42568d){return{'name':_0x42568d[_0x0700('0x2b')],'type':_0x42568d['type'][_0x0700('0x2c')]};});_0x19f7b0[_0x0700('0x2d')]=_[_0x0700('0x2e')](_0x4081ef,_0x0700('0x27'));_0x19f7b0['query']=_[_0x0700('0x2f')](_0x11e0ef['query']);_0x19f7b0[_0x0700('0x30')]=_[_0x0700('0x31')](_0x19f7b0[_0x0700('0x2d')],_0x19f7b0[_0x0700('0x32')]);_0x3e3dc9[_0x0700('0x33')]=_[_0x0700('0x31')](_0x19f7b0['model'],qs[_0x0700('0x34')](_0x11e0ef[_0x0700('0x32')][_0x0700('0x34')]));_0x3e3dc9[_0x0700('0x33')]=_0x3e3dc9[_0x0700('0x33')][_0x0700('0x35')]?_0x3e3dc9[_0x0700('0x33')]:_0x19f7b0[_0x0700('0x2d')];if(!_0x11e0ef[_0x0700('0x32')][_0x0700('0x36')](_0x0700('0x37'))){_0x3e3dc9[_0x0700('0x1b')]=qs[_0x0700('0x1b')](_0x11e0ef[_0x0700('0x32')][_0x0700('0x1b')]);_0x3e3dc9['offset']=qs['offset'](_0x11e0ef['query']['offset']);}_0x3e3dc9[_0x0700('0x38')]=qs[_0x0700('0x39')](_0x11e0ef[_0x0700('0x32')][_0x0700('0x39')]);_0x3e3dc9[_0x0700('0x3a')]=qs[_0x0700('0x30')](_[_0x0700('0x3b')](_0x11e0ef[_0x0700('0x32')],_0x19f7b0['filters']),_0x4081ef);if(_0x11e0ef[_0x0700('0x32')][_0x0700('0x3c')]){_0x3e3dc9[_0x0700('0x3a')]=_['merge'](_0x3e3dc9['where'],{'$or':_[_0x0700('0x2e')](_0x4081ef,function(_0x2c11b4){if(_0x2c11b4[_0x0700('0x3d')]!==_0x0700('0x3e')){var _0x362e8d={};_0x362e8d[_0x2c11b4[_0x0700('0x27')]]={'$like':'%'+_0x11e0ef[_0x0700('0x32')][_0x0700('0x3c')]+'%'};return _0x362e8d;}})});}_0x3e3dc9=_[_0x0700('0x3f')]({},_0x3e3dc9,_0x11e0ef[_0x0700('0x40')]);var _0x358b0d={'where':_0x3e3dc9[_0x0700('0x3a')]};return db[_0x0700('0x41')][_0x0700('0x1c')](_0x358b0d)[_0x0700('0x24')](function(_0x56d04d){_0x2493bb[_0x0700('0x1c')]=_0x56d04d;if(_0x11e0ef['query'][_0x0700('0x42')]){_0x3e3dc9[_0x0700('0x43')]=[{'all':!![]}];}return db[_0x0700('0x41')][_0x0700('0x44')](_0x3e3dc9);})[_0x0700('0x24')](function(_0x45b24f){_0x2493bb[_0x0700('0x45')]=_0x45b24f;return _0x2493bb;})[_0x0700('0x24')](respondWithFilteredResult(_0x2ea038,_0x3e3dc9))[_0x0700('0x46')](handleError(_0x2ea038,null));};exports[_0x0700('0x47')]=function(_0x555a47,_0x128f81){var _0x72127d={'raw':![],'where':{'id':_0x555a47[_0x0700('0x48')]['id']}},_0x526e64={};_0x526e64[_0x0700('0x2d')]=_[_0x0700('0x2f')](db[_0x0700('0x41')][_0x0700('0x2a')]);_0x526e64['query']=_['keys'](_0x555a47[_0x0700('0x32')]);_0x526e64[_0x0700('0x30')]=_[_0x0700('0x31')](_0x526e64['model'],_0x526e64['query']);_0x72127d[_0x0700('0x33')]=_[_0x0700('0x31')](_0x526e64[_0x0700('0x2d')],qs['fields'](_0x555a47[_0x0700('0x32')]['fields']));_0x72127d[_0x0700('0x33')]=_0x72127d[_0x0700('0x33')][_0x0700('0x35')]?_0x72127d['attributes']:_0x526e64['model'];if(_0x555a47[_0x0700('0x32')][_0x0700('0x42')]){_0x72127d[_0x0700('0x43')]=[{'all':!![]}];}_0x72127d=_[_0x0700('0x3f')]({},_0x72127d,_0x555a47[_0x0700('0x40')]);return db['Dynamics365Configuration'][_0x0700('0x49')](_0x72127d)['then'](handleEntityNotFound(_0x128f81,null))[_0x0700('0x24')](respondWithResult(_0x128f81,null))[_0x0700('0x46')](handleError(_0x128f81,null));};exports[_0x0700('0x4a')]=function(_0x37ad36,_0x57ca91){return db['Dynamics365Configuration'][_0x0700('0x4a')](_0x37ad36[_0x0700('0x4b')],{})[_0x0700('0x24')](respondWithResult(_0x57ca91,0xc9))['catch'](handleError(_0x57ca91,null));};exports['update']=function(_0x2dc24d,_0x46d122){if(_0x2dc24d[_0x0700('0x4b')]['id']){delete _0x2dc24d[_0x0700('0x4b')]['id'];}return db[_0x0700('0x41')][_0x0700('0x49')]({'where':{'id':_0x2dc24d[_0x0700('0x48')]['id']}})[_0x0700('0x24')](handleEntityNotFound(_0x46d122,null))[_0x0700('0x24')](saveUpdates(_0x2dc24d['body'],null))[_0x0700('0x24')](respondWithResult(_0x46d122,null))[_0x0700('0x46')](handleError(_0x46d122,null));};exports[_0x0700('0x23')]=function(_0x57f72f,_0x5a3247){return db[_0x0700('0x41')][_0x0700('0x49')]({'where':{'id':_0x57f72f[_0x0700('0x48')]['id']}})[_0x0700('0x24')](handleEntityNotFound(_0x5a3247,null))['then'](removeEntity(_0x5a3247,null))[_0x0700('0x46')](handleError(_0x5a3247,null));};exports['getFields']=function(_0x396091,_0x81d19d,_0x1e50a9){var _0x4318ee={};var _0x2231d5={};var _0x157e4d;var _0x557194;return db[_0x0700('0x41')][_0x0700('0x4c')]({'where':{'id':_0x396091[_0x0700('0x48')]['id']}})[_0x0700('0x24')](handleEntityNotFound(_0x81d19d,null))[_0x0700('0x24')](function(_0x33745e){if(_0x33745e){_0x157e4d=_0x33745e;_0x2231d5[_0x0700('0x2d')]=_[_0x0700('0x2f')](db[_0x0700('0x4d')][_0x0700('0x2a')]);_0x2231d5[_0x0700('0x32')]=_['keys'](_0x396091['query']);_0x2231d5[_0x0700('0x30')]=_[_0x0700('0x31')](_0x2231d5['model'],_0x2231d5[_0x0700('0x32')]);_0x4318ee['attributes']=_[_0x0700('0x31')](_0x2231d5[_0x0700('0x2d')],qs[_0x0700('0x34')](_0x396091[_0x0700('0x32')][_0x0700('0x34')]));_0x4318ee[_0x0700('0x33')]=_0x4318ee[_0x0700('0x33')][_0x0700('0x35')]?_0x4318ee[_0x0700('0x33')]:_0x2231d5[_0x0700('0x2d')];_0x4318ee[_0x0700('0x38')]=qs['sort'](_0x396091[_0x0700('0x32')][_0x0700('0x39')]);_0x4318ee[_0x0700('0x3a')]=qs[_0x0700('0x30')](_[_0x0700('0x3b')](_0x396091[_0x0700('0x32')],_0x2231d5[_0x0700('0x30')]));if(_0x396091[_0x0700('0x32')][_0x0700('0x3c')]){_0x4318ee[_0x0700('0x3a')]=_[_0x0700('0x3f')](_0x4318ee[_0x0700('0x3a')],{'$or':_[_0x0700('0x2e')](_0x4318ee['attributes'],function(_0x552594){var _0x391ef9={};_0x391ef9[_0x552594]={'$like':'%'+_0x396091[_0x0700('0x32')][_0x0700('0x3c')]+'%'};return _0x391ef9;})});}_0x4318ee=_['merge']({},_0x4318ee,_0x396091['options']);return _0x157e4d[_0x0700('0x4e')](_0x4318ee);}})['then'](function(_0x41da03){if(_0x41da03){_0x557194=_0x41da03[_0x0700('0x35')];if(!_0x396091[_0x0700('0x32')][_0x0700('0x36')](_0x0700('0x37'))){_0x4318ee[_0x0700('0x1b')]=qs[_0x0700('0x1b')](_0x396091[_0x0700('0x32')][_0x0700('0x1b')]);_0x4318ee[_0x0700('0x19')]=qs[_0x0700('0x19')](_0x396091[_0x0700('0x32')][_0x0700('0x19')]);}return _0x157e4d[_0x0700('0x4e')](_0x4318ee);}})[_0x0700('0x24')](function(_0x5ce9a2){if(_0x5ce9a2){return _0x5ce9a2?{'count':_0x557194,'rows':_0x5ce9a2}:null;}})[_0x0700('0x24')](respondWithResult(_0x81d19d,null))[_0x0700('0x46')](handleError(_0x81d19d,null));};exports[_0x0700('0x4f')]=function(_0x47f8e5,_0x37b207,_0x2aab8e){var _0x4fa512={};var _0x3bb74b={};var _0x4b5be1;var _0x3d5d05;return db[_0x0700('0x41')][_0x0700('0x4c')]({'where':{'id':_0x47f8e5[_0x0700('0x48')]['id']}})[_0x0700('0x24')](handleEntityNotFound(_0x37b207,null))['then'](function(_0xf01b79){if(_0xf01b79){_0x4b5be1=_0xf01b79;_0x3bb74b['model']=_['keys'](db[_0x0700('0x4d')][_0x0700('0x2a')]);_0x3bb74b[_0x0700('0x32')]=_[_0x0700('0x2f')](_0x47f8e5[_0x0700('0x32')]);_0x3bb74b[_0x0700('0x30')]=_[_0x0700('0x31')](_0x3bb74b[_0x0700('0x2d')],_0x3bb74b[_0x0700('0x32')]);_0x4fa512['attributes']=_[_0x0700('0x31')](_0x3bb74b['model'],qs['fields'](_0x47f8e5[_0x0700('0x32')][_0x0700('0x34')]));_0x4fa512[_0x0700('0x33')]=_0x4fa512[_0x0700('0x33')][_0x0700('0x35')]?_0x4fa512[_0x0700('0x33')]:_0x3bb74b[_0x0700('0x2d')];_0x4fa512['order']=qs[_0x0700('0x39')](_0x47f8e5[_0x0700('0x32')][_0x0700('0x39')]);_0x4fa512['where']=qs[_0x0700('0x30')](_['pick'](_0x47f8e5[_0x0700('0x32')],_0x3bb74b[_0x0700('0x30')]));if(_0x47f8e5['query'][_0x0700('0x3c')]){_0x4fa512['where']=_['merge'](_0x4fa512['where'],{'$or':_[_0x0700('0x2e')](_0x4fa512['attributes'],function(_0x66630a){var _0xeb9c83={};_0xeb9c83[_0x66630a]={'$like':'%'+_0x47f8e5['query'][_0x0700('0x3c')]+'%'};return _0xeb9c83;})});}_0x4fa512=_[_0x0700('0x3f')]({},_0x4fa512,_0x47f8e5['options']);return _0x4b5be1['getSubjects'](_0x4fa512);}})[_0x0700('0x24')](function(_0x2c6cf5){if(_0x2c6cf5){_0x3d5d05=_0x2c6cf5['length'];if(!_0x47f8e5[_0x0700('0x32')]['hasOwnProperty'](_0x0700('0x37'))){_0x4fa512[_0x0700('0x1b')]=qs['limit'](_0x47f8e5[_0x0700('0x32')][_0x0700('0x1b')]);_0x4fa512['offset']=qs[_0x0700('0x19')](_0x47f8e5[_0x0700('0x32')]['offset']);}return _0x4b5be1[_0x0700('0x4f')](_0x4fa512);}})[_0x0700('0x24')](function(_0x40f58f){if(_0x40f58f){return _0x40f58f?{'count':_0x3d5d05,'rows':_0x40f58f}:null;}})['then'](respondWithResult(_0x37b207,null))[_0x0700('0x46')](handleError(_0x37b207,null));};exports[_0x0700('0x50')]=function(_0x28a31a,_0x7144f,_0xb38305){var _0x3fbcdb={};var _0x5b16c6={};var _0x426d60;var _0x35c8a3;return db[_0x0700('0x41')][_0x0700('0x4c')]({'where':{'id':_0x28a31a[_0x0700('0x48')]['id']}})[_0x0700('0x24')](handleEntityNotFound(_0x7144f,null))['then'](function(_0x42c49f){if(_0x42c49f){_0x426d60=_0x42c49f;_0x5b16c6[_0x0700('0x2d')]=_[_0x0700('0x2f')](db[_0x0700('0x4d')][_0x0700('0x2a')]);_0x5b16c6['query']=_[_0x0700('0x2f')](_0x28a31a[_0x0700('0x32')]);_0x5b16c6[_0x0700('0x30')]=_[_0x0700('0x31')](_0x5b16c6['model'],_0x5b16c6['query']);_0x3fbcdb['attributes']=_['intersection'](_0x5b16c6[_0x0700('0x2d')],qs['fields'](_0x28a31a['query'][_0x0700('0x34')]));_0x3fbcdb['attributes']=_0x3fbcdb[_0x0700('0x33')][_0x0700('0x35')]?_0x3fbcdb['attributes']:_0x5b16c6[_0x0700('0x2d')];_0x3fbcdb['order']=qs['sort'](_0x28a31a[_0x0700('0x32')][_0x0700('0x39')]);_0x3fbcdb[_0x0700('0x3a')]=qs[_0x0700('0x30')](_[_0x0700('0x3b')](_0x28a31a[_0x0700('0x32')],_0x5b16c6[_0x0700('0x30')]));if(_0x28a31a['query']['filter']){_0x3fbcdb[_0x0700('0x3a')]=_[_0x0700('0x3f')](_0x3fbcdb['where'],{'$or':_['map'](_0x3fbcdb[_0x0700('0x33')],function(_0x322907){var _0x390e1a={};_0x390e1a[_0x322907]={'$like':'%'+_0x28a31a[_0x0700('0x32')][_0x0700('0x3c')]+'%'};return _0x390e1a;})});}_0x3fbcdb=_[_0x0700('0x3f')]({},_0x3fbcdb,_0x28a31a[_0x0700('0x40')]);return _0x426d60['getDescriptions'](_0x3fbcdb);}})[_0x0700('0x24')](function(_0xba5ff1){if(_0xba5ff1){_0x35c8a3=_0xba5ff1[_0x0700('0x35')];if(!_0x28a31a[_0x0700('0x32')][_0x0700('0x36')](_0x0700('0x37'))){_0x3fbcdb['limit']=qs[_0x0700('0x1b')](_0x28a31a[_0x0700('0x32')][_0x0700('0x1b')]);_0x3fbcdb[_0x0700('0x19')]=qs['offset'](_0x28a31a[_0x0700('0x32')][_0x0700('0x19')]);}return _0x426d60['getDescriptions'](_0x3fbcdb);}})[_0x0700('0x24')](function(_0x1acfa8){if(_0x1acfa8){return _0x1acfa8?{'count':_0x35c8a3,'rows':_0x1acfa8}:null;}})[_0x0700('0x24')](respondWithResult(_0x7144f,null))[_0x0700('0x46')](handleError(_0x7144f,null));}; \ No newline at end of file +var _0xcefd=['status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','rows','catch','show','params','keys','length','create','body','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4e1a75,_0x4bad55){var _0x1a5258=function(_0x504a17){while(--_0x504a17){_0x4e1a75['push'](_0x4e1a75['shift']());}};_0x1a5258(++_0x4bad55);}(_0xcefd,0xd9));var _0xdcef=function(_0x5c8ba1,_0x56eb56){_0x5c8ba1=_0x5c8ba1-0x0;var _0x45e356=_0xcefd[_0x5c8ba1];return _0x45e356;};'use strict';var emlformat=require(_0xdcef('0x0'));var rimraf=require(_0xdcef('0x1'));var zipdir=require(_0xdcef('0x2'));var jsonpatch=require(_0xdcef('0x3'));var rp=require(_0xdcef('0x4'));var moment=require('moment');var BPromise=require(_0xdcef('0x5'));var Mustache=require(_0xdcef('0x6'));var util=require(_0xdcef('0x7'));var path=require(_0xdcef('0x8'));var sox=require(_0xdcef('0x9'));var csv=require(_0xdcef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdcef('0xb'));var _=require(_0xdcef('0xc'));var squel=require('squel');var crypto=require(_0xdcef('0xd'));var jsforce=require(_0xdcef('0xe'));var deskjs=require(_0xdcef('0xf'));var toCsv=require(_0xdcef('0xa'));var querystring=require(_0xdcef('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdcef('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdcef('0x12'));var hardwareService=require(_0xdcef('0x13'));var logger=require(_0xdcef('0x14'))('api');var utils=require(_0xdcef('0x15'));var config=require(_0xdcef('0x16'));var licenseUtil=require(_0xdcef('0x17'));var db=require(_0xdcef('0x18'))['db'];function respondWithStatusCode(_0x446dc2,_0x5340a0){_0x5340a0=_0x5340a0||0xcc;return function(_0x4d45a6){if(_0x4d45a6){return _0x446dc2[_0xdcef('0x19')](_0x5340a0);}return _0x446dc2[_0xdcef('0x1a')](_0x5340a0)[_0xdcef('0x1b')]();};}function respondWithResult(_0x59e793,_0x2d5ec9){_0x2d5ec9=_0x2d5ec9||0xc8;return function(_0x39fef5){if(_0x39fef5){return _0x59e793[_0xdcef('0x1a')](_0x2d5ec9)['json'](_0x39fef5);}};}function respondWithFilteredResult(_0x397091,_0x531cc6){return function(_0x27990e){if(_0x27990e){var _0x44d6d4=typeof _0x531cc6[_0xdcef('0x1c')]===_0xdcef('0x1d')&&typeof _0x531cc6[_0xdcef('0x1e')]===_0xdcef('0x1d');var _0x5522d3=_0x27990e[_0xdcef('0x1f')];var _0x75ba17=_0x44d6d4?0x0:_0x531cc6[_0xdcef('0x1c')];var _0x48bb11=_0x44d6d4?_0x27990e[_0xdcef('0x1f')]:_0x531cc6[_0xdcef('0x1c')]+_0x531cc6['limit'];var _0xc8bbdc;if(_0x48bb11>=_0x5522d3){_0x48bb11=_0x5522d3;_0xc8bbdc=0xc8;}else{_0xc8bbdc=0xce;}_0x397091[_0xdcef('0x1a')](_0xc8bbdc);return _0x397091[_0xdcef('0x20')](_0xdcef('0x21'),_0x75ba17+'-'+_0x48bb11+'/'+_0x5522d3)['json'](_0x27990e);}return null;};}function patchUpdates(_0x11622a){return function(_0x1376d5){try{jsonpatch[_0xdcef('0x22')](_0x1376d5,_0x11622a,!![]);}catch(_0x4890d1){return BPromise[_0xdcef('0x23')](_0x4890d1);}return _0x1376d5[_0xdcef('0x24')]();};}function saveUpdates(_0x10f2ac,_0x3cd0f9){return function(_0x4c099f){if(_0x4c099f){return _0x4c099f['update'](_0x10f2ac)[_0xdcef('0x25')](function(_0x48e74e){return _0x48e74e;});}return null;};}function removeEntity(_0x30d6e9,_0x3b9093){return function(_0x47c551){if(_0x47c551){return _0x47c551[_0xdcef('0x26')]()['then'](function(){_0x30d6e9[_0xdcef('0x1a')](0xcc)[_0xdcef('0x1b')]();});}};}function handleEntityNotFound(_0x17c0e9,_0x97620c){return function(_0x526375){if(!_0x526375){_0x17c0e9[_0xdcef('0x19')](0x194);}return _0x526375;};}function handleError(_0x18e536,_0x129a63){_0x129a63=_0x129a63||0x1f4;return function(_0x47d6b2){logger[_0xdcef('0x27')](_0x47d6b2[_0xdcef('0x28')]);if(_0x47d6b2[_0xdcef('0x29')]){delete _0x47d6b2[_0xdcef('0x29')];}_0x18e536[_0xdcef('0x1a')](_0x129a63)[_0xdcef('0x2a')](_0x47d6b2);};}exports[_0xdcef('0x2b')]=function(_0x1c49c0,_0x5dcec7){var _0x1f7d67={},_0x5eaf0c={},_0x8754e4={'count':0x0,'rows':[]};var _0x48397a=_['map'](db[_0xdcef('0x2c')][_0xdcef('0x2d')],function(_0xef55dd){return{'name':_0xef55dd[_0xdcef('0x2e')],'type':_0xef55dd['type'][_0xdcef('0x2f')]};});_0x5eaf0c['model']=_[_0xdcef('0x30')](_0x48397a,_0xdcef('0x29'));_0x5eaf0c[_0xdcef('0x31')]=_['keys'](_0x1c49c0[_0xdcef('0x31')]);_0x5eaf0c[_0xdcef('0x32')]=_[_0xdcef('0x33')](_0x5eaf0c[_0xdcef('0x34')],_0x5eaf0c[_0xdcef('0x31')]);_0x1f7d67[_0xdcef('0x35')]=_['intersection'](_0x5eaf0c[_0xdcef('0x34')],qs[_0xdcef('0x36')](_0x1c49c0[_0xdcef('0x31')]['fields']));_0x1f7d67[_0xdcef('0x35')]=_0x1f7d67[_0xdcef('0x35')]['length']?_0x1f7d67[_0xdcef('0x35')]:_0x5eaf0c['model'];if(!_0x1c49c0['query'][_0xdcef('0x37')](_0xdcef('0x38'))){_0x1f7d67['limit']=qs[_0xdcef('0x1e')](_0x1c49c0[_0xdcef('0x31')][_0xdcef('0x1e')]);_0x1f7d67[_0xdcef('0x1c')]=qs[_0xdcef('0x1c')](_0x1c49c0[_0xdcef('0x31')][_0xdcef('0x1c')]);}_0x1f7d67[_0xdcef('0x39')]=qs[_0xdcef('0x3a')](_0x1c49c0[_0xdcef('0x31')]['sort']);_0x1f7d67['where']=qs[_0xdcef('0x32')](_[_0xdcef('0x3b')](_0x1c49c0[_0xdcef('0x31')],_0x5eaf0c[_0xdcef('0x32')]),_0x48397a);if(_0x1c49c0['query'][_0xdcef('0x3c')]){_0x1f7d67[_0xdcef('0x3d')]=_[_0xdcef('0x3e')](_0x1f7d67[_0xdcef('0x3d')],{'$or':_['map'](_0x48397a,function(_0x420864){if(_0x420864[_0xdcef('0x3f')]!=='VIRTUAL'){var _0x17228d={};_0x17228d[_0x420864['name']]={'$like':'%'+_0x1c49c0[_0xdcef('0x31')][_0xdcef('0x3c')]+'%'};return _0x17228d;}})});}_0x1f7d67=_[_0xdcef('0x3e')]({},_0x1f7d67,_0x1c49c0[_0xdcef('0x40')]);var _0x429428={'where':_0x1f7d67['where']};return db[_0xdcef('0x2c')]['count'](_0x429428)[_0xdcef('0x25')](function(_0x8b7c22){_0x8754e4[_0xdcef('0x1f')]=_0x8b7c22;if(_0x1c49c0['query'][_0xdcef('0x41')]){_0x1f7d67[_0xdcef('0x42')]=[{'all':!![]}];}return db[_0xdcef('0x2c')]['findAll'](_0x1f7d67);})[_0xdcef('0x25')](function(_0xf9452c){_0x8754e4[_0xdcef('0x43')]=_0xf9452c;return _0x8754e4;})['then'](respondWithFilteredResult(_0x5dcec7,_0x1f7d67))[_0xdcef('0x44')](handleError(_0x5dcec7,null));};exports[_0xdcef('0x45')]=function(_0x16d848,_0x5e8de1){var _0x2a0742={'raw':![],'where':{'id':_0x16d848[_0xdcef('0x46')]['id']}},_0x2c0de3={};_0x2c0de3[_0xdcef('0x34')]=_['keys'](db['Dynamics365Configuration'][_0xdcef('0x2d')]);_0x2c0de3[_0xdcef('0x31')]=_[_0xdcef('0x47')](_0x16d848[_0xdcef('0x31')]);_0x2c0de3[_0xdcef('0x32')]=_[_0xdcef('0x33')](_0x2c0de3[_0xdcef('0x34')],_0x2c0de3[_0xdcef('0x31')]);_0x2a0742['attributes']=_['intersection'](_0x2c0de3[_0xdcef('0x34')],qs[_0xdcef('0x36')](_0x16d848[_0xdcef('0x31')]['fields']));_0x2a0742['attributes']=_0x2a0742['attributes'][_0xdcef('0x48')]?_0x2a0742['attributes']:_0x2c0de3['model'];if(_0x16d848[_0xdcef('0x31')][_0xdcef('0x41')]){_0x2a0742[_0xdcef('0x42')]=[{'all':!![]}];}_0x2a0742=_[_0xdcef('0x3e')]({},_0x2a0742,_0x16d848[_0xdcef('0x40')]);return db['Dynamics365Configuration']['find'](_0x2a0742)[_0xdcef('0x25')](handleEntityNotFound(_0x5e8de1,null))[_0xdcef('0x25')](respondWithResult(_0x5e8de1,null))[_0xdcef('0x44')](handleError(_0x5e8de1,null));};exports[_0xdcef('0x49')]=function(_0x51bdef,_0x2e2ebb){return db[_0xdcef('0x2c')][_0xdcef('0x49')](_0x51bdef[_0xdcef('0x4a')],{})[_0xdcef('0x25')](respondWithResult(_0x2e2ebb,0xc9))['catch'](handleError(_0x2e2ebb,null));};exports['update']=function(_0x3e231b,_0x5f2b58){if(_0x3e231b[_0xdcef('0x4a')]['id']){delete _0x3e231b[_0xdcef('0x4a')]['id'];}return db[_0xdcef('0x2c')]['find']({'where':{'id':_0x3e231b[_0xdcef('0x46')]['id']}})[_0xdcef('0x25')](handleEntityNotFound(_0x5f2b58,null))[_0xdcef('0x25')](saveUpdates(_0x3e231b[_0xdcef('0x4a')],null))[_0xdcef('0x25')](respondWithResult(_0x5f2b58,null))[_0xdcef('0x44')](handleError(_0x5f2b58,null));};exports[_0xdcef('0x26')]=function(_0x3684e1,_0x2ad192){return db[_0xdcef('0x2c')][_0xdcef('0x4b')]({'where':{'id':_0x3684e1[_0xdcef('0x46')]['id']}})[_0xdcef('0x25')](handleEntityNotFound(_0x2ad192,null))['then'](removeEntity(_0x2ad192,null))[_0xdcef('0x44')](handleError(_0x2ad192,null));};exports[_0xdcef('0x4c')]=function(_0x244f68,_0x6feeba,_0x4e1aaf){var _0x1c9f5f={};var _0x4288c1={};var _0x222605;var _0x53efd0;return db[_0xdcef('0x2c')][_0xdcef('0x4d')]({'where':{'id':_0x244f68[_0xdcef('0x46')]['id']}})['then'](handleEntityNotFound(_0x6feeba,null))[_0xdcef('0x25')](function(_0x23060c){if(_0x23060c){_0x222605=_0x23060c;_0x4288c1[_0xdcef('0x34')]=_['keys'](db[_0xdcef('0x4e')][_0xdcef('0x2d')]);_0x4288c1[_0xdcef('0x31')]=_['keys'](_0x244f68[_0xdcef('0x31')]);_0x4288c1[_0xdcef('0x32')]=_[_0xdcef('0x33')](_0x4288c1[_0xdcef('0x34')],_0x4288c1['query']);_0x1c9f5f['attributes']=_[_0xdcef('0x33')](_0x4288c1[_0xdcef('0x34')],qs[_0xdcef('0x36')](_0x244f68['query'][_0xdcef('0x36')]));_0x1c9f5f[_0xdcef('0x35')]=_0x1c9f5f[_0xdcef('0x35')][_0xdcef('0x48')]?_0x1c9f5f[_0xdcef('0x35')]:_0x4288c1[_0xdcef('0x34')];_0x1c9f5f['order']=qs['sort'](_0x244f68[_0xdcef('0x31')][_0xdcef('0x3a')]);_0x1c9f5f[_0xdcef('0x3d')]=qs[_0xdcef('0x32')](_[_0xdcef('0x3b')](_0x244f68[_0xdcef('0x31')],_0x4288c1[_0xdcef('0x32')]));if(_0x244f68[_0xdcef('0x31')][_0xdcef('0x3c')]){_0x1c9f5f['where']=_[_0xdcef('0x3e')](_0x1c9f5f['where'],{'$or':_['map'](_0x1c9f5f[_0xdcef('0x35')],function(_0xaddace){var _0x3d6fab={};_0x3d6fab[_0xaddace]={'$like':'%'+_0x244f68[_0xdcef('0x31')][_0xdcef('0x3c')]+'%'};return _0x3d6fab;})});}_0x1c9f5f=_[_0xdcef('0x3e')]({},_0x1c9f5f,_0x244f68[_0xdcef('0x40')]);return _0x222605[_0xdcef('0x4c')](_0x1c9f5f);}})[_0xdcef('0x25')](function(_0x10e4d6){if(_0x10e4d6){_0x53efd0=_0x10e4d6[_0xdcef('0x48')];if(!_0x244f68[_0xdcef('0x31')]['hasOwnProperty'](_0xdcef('0x38'))){_0x1c9f5f[_0xdcef('0x1e')]=qs[_0xdcef('0x1e')](_0x244f68[_0xdcef('0x31')][_0xdcef('0x1e')]);_0x1c9f5f['offset']=qs[_0xdcef('0x1c')](_0x244f68[_0xdcef('0x31')][_0xdcef('0x1c')]);}return _0x222605[_0xdcef('0x4c')](_0x1c9f5f);}})[_0xdcef('0x25')](function(_0x182547){if(_0x182547){return _0x182547?{'count':_0x53efd0,'rows':_0x182547}:null;}})[_0xdcef('0x25')](respondWithResult(_0x6feeba,null))[_0xdcef('0x44')](handleError(_0x6feeba,null));};exports[_0xdcef('0x4f')]=function(_0x301a77,_0x45fceb,_0x5345f8){var _0x3425f3={};var _0x1fb3d0={};var _0x3c0deb;var _0x122c3d;return db['Dynamics365Configuration'][_0xdcef('0x4d')]({'where':{'id':_0x301a77[_0xdcef('0x46')]['id']}})['then'](handleEntityNotFound(_0x45fceb,null))[_0xdcef('0x25')](function(_0x28ec16){if(_0x28ec16){_0x3c0deb=_0x28ec16;_0x1fb3d0[_0xdcef('0x34')]=_['keys'](db[_0xdcef('0x4e')][_0xdcef('0x2d')]);_0x1fb3d0[_0xdcef('0x31')]=_[_0xdcef('0x47')](_0x301a77[_0xdcef('0x31')]);_0x1fb3d0[_0xdcef('0x32')]=_[_0xdcef('0x33')](_0x1fb3d0[_0xdcef('0x34')],_0x1fb3d0[_0xdcef('0x31')]);_0x3425f3[_0xdcef('0x35')]=_[_0xdcef('0x33')](_0x1fb3d0['model'],qs[_0xdcef('0x36')](_0x301a77['query']['fields']));_0x3425f3[_0xdcef('0x35')]=_0x3425f3['attributes'][_0xdcef('0x48')]?_0x3425f3[_0xdcef('0x35')]:_0x1fb3d0[_0xdcef('0x34')];_0x3425f3[_0xdcef('0x39')]=qs['sort'](_0x301a77['query'][_0xdcef('0x3a')]);_0x3425f3[_0xdcef('0x3d')]=qs['filters'](_[_0xdcef('0x3b')](_0x301a77[_0xdcef('0x31')],_0x1fb3d0['filters']));if(_0x301a77[_0xdcef('0x31')][_0xdcef('0x3c')]){_0x3425f3[_0xdcef('0x3d')]=_[_0xdcef('0x3e')](_0x3425f3[_0xdcef('0x3d')],{'$or':_[_0xdcef('0x30')](_0x3425f3['attributes'],function(_0x436c8c){var _0x286c58={};_0x286c58[_0x436c8c]={'$like':'%'+_0x301a77[_0xdcef('0x31')][_0xdcef('0x3c')]+'%'};return _0x286c58;})});}_0x3425f3=_[_0xdcef('0x3e')]({},_0x3425f3,_0x301a77['options']);return _0x3c0deb[_0xdcef('0x4f')](_0x3425f3);}})[_0xdcef('0x25')](function(_0x13bc66){if(_0x13bc66){_0x122c3d=_0x13bc66[_0xdcef('0x48')];if(!_0x301a77[_0xdcef('0x31')][_0xdcef('0x37')](_0xdcef('0x38'))){_0x3425f3[_0xdcef('0x1e')]=qs[_0xdcef('0x1e')](_0x301a77[_0xdcef('0x31')][_0xdcef('0x1e')]);_0x3425f3['offset']=qs['offset'](_0x301a77['query']['offset']);}return _0x3c0deb[_0xdcef('0x4f')](_0x3425f3);}})[_0xdcef('0x25')](function(_0x130423){if(_0x130423){return _0x130423?{'count':_0x122c3d,'rows':_0x130423}:null;}})[_0xdcef('0x25')](respondWithResult(_0x45fceb,null))[_0xdcef('0x44')](handleError(_0x45fceb,null));};exports[_0xdcef('0x50')]=function(_0x47aab4,_0x11c5c7,_0x789354){var _0x3213ac={};var _0x45aed6={};var _0x3601b2;var _0x201de7;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x47aab4[_0xdcef('0x46')]['id']}})['then'](handleEntityNotFound(_0x11c5c7,null))[_0xdcef('0x25')](function(_0x585dc1){if(_0x585dc1){_0x3601b2=_0x585dc1;_0x45aed6[_0xdcef('0x34')]=_[_0xdcef('0x47')](db['Dynamics365Field'][_0xdcef('0x2d')]);_0x45aed6[_0xdcef('0x31')]=_[_0xdcef('0x47')](_0x47aab4[_0xdcef('0x31')]);_0x45aed6[_0xdcef('0x32')]=_[_0xdcef('0x33')](_0x45aed6[_0xdcef('0x34')],_0x45aed6[_0xdcef('0x31')]);_0x3213ac[_0xdcef('0x35')]=_[_0xdcef('0x33')](_0x45aed6[_0xdcef('0x34')],qs[_0xdcef('0x36')](_0x47aab4[_0xdcef('0x31')]['fields']));_0x3213ac[_0xdcef('0x35')]=_0x3213ac['attributes']['length']?_0x3213ac[_0xdcef('0x35')]:_0x45aed6[_0xdcef('0x34')];_0x3213ac[_0xdcef('0x39')]=qs[_0xdcef('0x3a')](_0x47aab4['query']['sort']);_0x3213ac['where']=qs[_0xdcef('0x32')](_['pick'](_0x47aab4['query'],_0x45aed6[_0xdcef('0x32')]));if(_0x47aab4['query'][_0xdcef('0x3c')]){_0x3213ac[_0xdcef('0x3d')]=_[_0xdcef('0x3e')](_0x3213ac[_0xdcef('0x3d')],{'$or':_['map'](_0x3213ac[_0xdcef('0x35')],function(_0x40c5f){var _0x4fd00f={};_0x4fd00f[_0x40c5f]={'$like':'%'+_0x47aab4[_0xdcef('0x31')][_0xdcef('0x3c')]+'%'};return _0x4fd00f;})});}_0x3213ac=_[_0xdcef('0x3e')]({},_0x3213ac,_0x47aab4[_0xdcef('0x40')]);return _0x3601b2[_0xdcef('0x50')](_0x3213ac);}})[_0xdcef('0x25')](function(_0x1f2a62){if(_0x1f2a62){_0x201de7=_0x1f2a62['length'];if(!_0x47aab4['query'][_0xdcef('0x37')](_0xdcef('0x38'))){_0x3213ac[_0xdcef('0x1e')]=qs['limit'](_0x47aab4[_0xdcef('0x31')][_0xdcef('0x1e')]);_0x3213ac[_0xdcef('0x1c')]=qs[_0xdcef('0x1c')](_0x47aab4[_0xdcef('0x31')][_0xdcef('0x1c')]);}return _0x3601b2[_0xdcef('0x50')](_0x3213ac);}})[_0xdcef('0x25')](function(_0xc47eb1){if(_0xc47eb1){return _0xc47eb1?{'count':_0x201de7,'rows':_0xc47eb1}:null;}})['then'](respondWithResult(_0x11c5c7,null))[_0xdcef('0x44')](handleError(_0x11c5c7,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 1439ebc..6c34e06 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 _0x34e8=['int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration'];(function(_0x325044,_0x16810c){var _0x379725=function(_0x13ecaa){while(--_0x13ecaa){_0x325044['push'](_0x325044['shift']());}};_0x379725(++_0x16810c);}(_0x34e8,0x12c));var _0x834e=function(_0x116e42,_0x329594){_0x116e42=_0x116e42-0x0;var _0x81fb42=_0x34e8[_0x116e42];return _0x81fb42;};'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 _0xb43b=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird','path'];(function(_0x107f28,_0x34c9bd){var _0x35f492=function(_0xf4bb77){while(--_0xf4bb77){_0x107f28['push'](_0x107f28['shift']());}};_0x35f492(++_0x34c9bd);}(_0xb43b,0x1b2));var _0xbb43=function(_0xde1b4b,_0x544bdf){_0xde1b4b=_0xde1b4b-0x0;var _0x54b4e4=_0xb43b[_0xde1b4b];return _0x54b4e4;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 16bc92b..78f6ec5 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 _0x9480=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','ioredis','../../config/utils'];(function(_0x32e4ff,_0x33b357){var _0x5315a0=function(_0x34c70c){while(--_0x34c70c){_0x32e4ff['push'](_0x32e4ff['shift']());}};_0x5315a0(++_0x33b357);}(_0x9480,0x18d));var _0x0948=function(_0x42e06a,_0x2f5fd1){_0x42e06a=_0x42e06a-0x0;var _0x3d3c90=_0x9480[_0x42e06a];return _0x3d3c90;};'use strict';var _=require(_0x0948('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0948('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x0948('0x2'));var logger=require(_0x0948('0x3'))(_0x0948('0x4'));var config=require(_0x0948('0x5'));var jayson=require(_0x0948('0x6'));var client=jayson[_0x0948('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ebf2f,_0x7afbe6,_0x136f35){return new BPromise(function(_0x2d4903,_0x1f5a74){return client[_0x0948('0x8')](_0x5ebf2f,_0x136f35)['then'](function(_0x1a5117){logger[_0x0948('0x9')](_0x0948('0xa'),_0x7afbe6,_0x0948('0xb'));logger[_0x0948('0xc')](_0x0948('0xd'),_0x7afbe6,_0x0948('0xb'),JSON[_0x0948('0xe')](_0x1a5117));if(_0x1a5117['error']){if(_0x1a5117[_0x0948('0xf')][_0x0948('0x10')]===0x1f4){logger[_0x0948('0xf')](_0x0948('0xa'),_0x7afbe6,_0x1a5117[_0x0948('0xf')]['message']);return _0x1f5a74(_0x1a5117[_0x0948('0xf')][_0x0948('0x11')]);}logger[_0x0948('0xf')](_0x0948('0xa'),_0x7afbe6,_0x1a5117['error'][_0x0948('0x11')]);return _0x2d4903(_0x1a5117['error'][_0x0948('0x11')]);}else{logger[_0x0948('0x9')](_0x0948('0xa'),_0x7afbe6,'request\x20sent');_0x2d4903(_0x1a5117[_0x0948('0x12')][_0x0948('0x11')]);}})[_0x0948('0x13')](function(_0x199fb7){logger[_0x0948('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x7afbe6,_0x199fb7);_0x1f5a74(_0x199fb7);});});} \ No newline at end of file +var _0x0099=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch'];(function(_0x2ac160,_0x5aa421){var _0x39696e=function(_0x349edc){while(--_0x349edc){_0x2ac160['push'](_0x2ac160['shift']());}};_0x39696e(++_0x5aa421);}(_0x0099,0x118));var _0x9009=function(_0x54d52,_0x2473ba){_0x54d52=_0x54d52-0x0;var _0x968345=_0x0099[_0x54d52];return _0x968345;};'use strict';var _=require(_0x9009('0x0'));var util=require('util');var moment=require(_0x9009('0x1'));var BPromise=require(_0x9009('0x2'));var rs=require(_0x9009('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9009('0x4'))['db'];var utils=require(_0x9009('0x5'));var logger=require(_0x9009('0x6'))(_0x9009('0x7'));var config=require('../../config/environment');var jayson=require(_0x9009('0x8'));var client=jayson['client'][_0x9009('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8f55a7,_0x1edf84,_0x58f096){return new BPromise(function(_0x578de5,_0x39201d){return client[_0x9009('0xa')](_0x8f55a7,_0x58f096)['then'](function(_0x2af418){logger[_0x9009('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1edf84,_0x9009('0xc'));logger[_0x9009('0xd')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x1edf84,_0x9009('0xc'),JSON[_0x9009('0xe')](_0x2af418));if(_0x2af418[_0x9009('0xf')]){if(_0x2af418['error']['code']===0x1f4){logger[_0x9009('0xf')](_0x9009('0x10'),_0x1edf84,_0x2af418[_0x9009('0xf')][_0x9009('0x11')]);return _0x39201d(_0x2af418[_0x9009('0xf')]['message']);}logger['error'](_0x9009('0x10'),_0x1edf84,_0x2af418['error']['message']);return _0x578de5(_0x2af418['error'][_0x9009('0x11')]);}else{logger[_0x9009('0xb')](_0x9009('0x10'),_0x1edf84,_0x9009('0xc'));_0x578de5(_0x2af418[_0x9009('0x12')]['message']);}})[_0x9009('0x13')](function(_0x39423b){logger['error'](_0x9009('0x10'),_0x1edf84,_0x39423b);_0x39201d(_0x39423b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index c133b89..fd626a5 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 _0xaea5=['get','/:id','show','post','create','put','delete','destroy','multer','util','express','fs-extra','../../components/interaction/service','./intDynamics365Field.controller','isAuthenticated','index'];(function(_0x5ec06b,_0x32db9b){var _0x4a75f2=function(_0xf80809){while(--_0xf80809){_0x5ec06b['push'](_0x5ec06b['shift']());}};_0x4a75f2(++_0x32db9b);}(_0xaea5,0x1a8));var _0x5aea=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xaea5[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x5aea('0x0'));var util=require(_0x5aea('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5aea('0x2'));var router=express['Router']();var fs_extra=require(_0x5aea('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5aea('0x4'));var config=require('../../config/environment');var controller=require(_0x5aea('0x5'));router['get']('/',auth[_0x5aea('0x6')](),controller[_0x5aea('0x7')]);router[_0x5aea('0x8')](_0x5aea('0x9'),auth[_0x5aea('0x6')](),controller[_0x5aea('0xa')]);router[_0x5aea('0xb')]('/',auth[_0x5aea('0x6')](),controller[_0x5aea('0xc')]);router[_0x5aea('0xd')](_0x5aea('0x9'),auth[_0x5aea('0x6')](),controller['update']);router[_0x5aea('0xe')](_0x5aea('0x9'),auth[_0x5aea('0x6')](),controller[_0x5aea('0xf')]);module['exports']=router; \ No newline at end of file +var _0xa3ad=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','util'];(function(_0x4ce33d,_0xc90f8e){var _0x12f6ad=function(_0x3f3842){while(--_0x3f3842){_0x4ce33d['push'](_0x4ce33d['shift']());}};_0x12f6ad(++_0xc90f8e);}(_0xa3ad,0x14e));var _0xda3a=function(_0x4887d3,_0x1414e1){_0x4887d3=_0x4887d3-0x0;var _0xceef8f=_0xa3ad[_0x4887d3];return _0xceef8f;};'use strict';var multer=require(_0xda3a('0x0'));var util=require(_0xda3a('0x1'));var path=require(_0xda3a('0x2'));var timeout=require(_0xda3a('0x3'));var express=require(_0xda3a('0x4'));var router=express[_0xda3a('0x5')]();var fs_extra=require(_0xda3a('0x6'));var auth=require(_0xda3a('0x7'));var interaction=require(_0xda3a('0x8'));var config=require(_0xda3a('0x9'));var controller=require(_0xda3a('0xa'));router[_0xda3a('0xb')]('/',auth[_0xda3a('0xc')](),controller[_0xda3a('0xd')]);router['get'](_0xda3a('0xe'),auth[_0xda3a('0xc')](),controller[_0xda3a('0xf')]);router[_0xda3a('0x10')]('/',auth['isAuthenticated'](),controller[_0xda3a('0x11')]);router[_0xda3a('0x12')](_0xda3a('0xe'),auth[_0xda3a('0xc')](),controller[_0xda3a('0x13')]);router['delete']('/:id',auth[_0xda3a('0xc')](),controller[_0xda3a('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index bc5de13..b08d51d 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 _0x92db=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','string'];(function(_0x5650b4,_0x2723ba){var _0x297a62=function(_0x4ceedf){while(--_0x4ceedf){_0x5650b4['push'](_0x5650b4['shift']());}};_0x297a62(++_0x2723ba);}(_0x92db,0x125));var _0xb92d=function(_0x2f8c17,_0x40a653){_0x2f8c17=_0x2f8c17-0x0;var _0x3911f5=_0x92db[_0x2f8c17];return _0x3911f5;};'use strict';var Sequelize=require(_0xb92d('0x0'));module[_0xb92d('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb92d('0x2'),_0xb92d('0x3'),_0xb92d('0x4'),_0xb92d('0x5'),_0xb92d('0x6')),'defaultValue':_0xb92d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb92d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xb92d('0x2'),_0xb92d('0x3'),_0xb92d('0x4'))},'keyContent':{'type':Sequelize[_0xb92d('0x7')]},'idField':{'type':Sequelize[_0xb92d('0x7')]},'nameField':{'type':Sequelize[_0xb92d('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb92d('0x7')]}}; \ No newline at end of file +var _0x8117=['STRING','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x4ca264,_0x11e176){var _0x3d608c=function(_0x1fdb9d){while(--_0x1fdb9d){_0x4ca264['push'](_0x4ca264['shift']());}};_0x3d608c(++_0x11e176);}(_0x8117,0x143));var _0x7811=function(_0x13a851,_0x4c3164){_0x13a851=_0x13a851-0x0;var _0x296744=_0x8117[_0x13a851];return _0x296744;};'use strict';var Sequelize=require(_0x7811('0x0'));module[_0x7811('0x1')]={'type':{'type':Sequelize[_0x7811('0x2')](_0x7811('0x3'),_0x7811('0x4'),'customVariable',_0x7811('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x7811('0x6')]},'key':{'type':Sequelize[_0x7811('0x6')]},'keyType':{'type':Sequelize[_0x7811('0x2')](_0x7811('0x3'),_0x7811('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7811('0x6')]},'nameField':{'type':Sequelize[_0x7811('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index bd9093c..473a15b 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 _0xe2fc=['eml-format','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','sort','where','filter','VIRTUAL','merge','options','Dynamics365Field','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','destroy'];(function(_0xdaab62,_0x2728ab){var _0x13d767=function(_0x14bf14){while(--_0x14bf14){_0xdaab62['push'](_0xdaab62['shift']());}};_0x13d767(++_0x2728ab);}(_0xe2fc,0x11c));var _0xce2f=function(_0x4fbe73,_0x4120f8){_0x4fbe73=_0x4fbe73-0x0;var _0x158a4f=_0xe2fc[_0x4fbe73];return _0x158a4f;};'use strict';var emlformat=require(_0xce2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xce2f('0x1'));var moment=require('moment');var BPromise=require(_0xce2f('0x2'));var Mustache=require(_0xce2f('0x3'));var util=require(_0xce2f('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xce2f('0x5'));var ejs=require(_0xce2f('0x6'));var fs=require('fs');var fs_extra=require(_0xce2f('0x7'));var _=require(_0xce2f('0x8'));var squel=require(_0xce2f('0x9'));var crypto=require(_0xce2f('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xce2f('0x5'));var querystring=require(_0xce2f('0xb'));var Papa=require(_0xce2f('0xc'));var Redis=require(_0xce2f('0xd'));var authService=require(_0xce2f('0xe'));var qs=require(_0xce2f('0xf'));var as=require(_0xce2f('0x10'));var hardwareService=require(_0xce2f('0x11'));var logger=require(_0xce2f('0x12'))(_0xce2f('0x13'));var utils=require(_0xce2f('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xce2f('0x15'))['db'];function respondWithStatusCode(_0x1b5fb0,_0x106227){_0x106227=_0x106227||0xcc;return function(_0x5d2c62){if(_0x5d2c62){return _0x1b5fb0[_0xce2f('0x16')](_0x106227);}return _0x1b5fb0[_0xce2f('0x17')](_0x106227)[_0xce2f('0x18')]();};}function respondWithResult(_0x27ced1,_0x54f9f1){_0x54f9f1=_0x54f9f1||0xc8;return function(_0x1761cb){if(_0x1761cb){return _0x27ced1[_0xce2f('0x17')](_0x54f9f1)[_0xce2f('0x19')](_0x1761cb);}};}function respondWithFilteredResult(_0x5c6293,_0x5691cc){return function(_0x3ee6f8){if(_0x3ee6f8){var _0x21f08f=typeof _0x5691cc[_0xce2f('0x1a')]==='undefined'&&typeof _0x5691cc[_0xce2f('0x1b')]===_0xce2f('0x1c');var _0x43e9c7=_0x3ee6f8[_0xce2f('0x1d')];var _0x3908f5=_0x21f08f?0x0:_0x5691cc['offset'];var _0x20b3ca=_0x21f08f?_0x3ee6f8[_0xce2f('0x1d')]:_0x5691cc[_0xce2f('0x1a')]+_0x5691cc[_0xce2f('0x1b')];var _0x4984d4;if(_0x20b3ca>=_0x43e9c7){_0x20b3ca=_0x43e9c7;_0x4984d4=0xc8;}else{_0x4984d4=0xce;}_0x5c6293[_0xce2f('0x17')](_0x4984d4);return _0x5c6293['set'](_0xce2f('0x1e'),_0x3908f5+'-'+_0x20b3ca+'/'+_0x43e9c7)[_0xce2f('0x19')](_0x3ee6f8);}return null;};}function patchUpdates(_0x1490df){return function(_0x527209){try{jsonpatch[_0xce2f('0x1f')](_0x527209,_0x1490df,!![]);}catch(_0x39d4f8){return BPromise['reject'](_0x39d4f8);}return _0x527209[_0xce2f('0x20')]();};}function saveUpdates(_0x94549,_0x150b80){return function(_0x2edf7e){if(_0x2edf7e){return _0x2edf7e[_0xce2f('0x21')](_0x94549)['then'](function(_0x55cea3){return _0x55cea3;});}return null;};}function removeEntity(_0x54751b,_0xcf7102){return function(_0x5b6977){if(_0x5b6977){return _0x5b6977['destroy']()[_0xce2f('0x22')](function(){_0x54751b[_0xce2f('0x17')](0xcc)[_0xce2f('0x18')]();});}};}function handleEntityNotFound(_0x9eaf9f,_0x5a73f6){return function(_0x40b865){if(!_0x40b865){_0x9eaf9f[_0xce2f('0x16')](0x194);}return _0x40b865;};}function handleError(_0x275401,_0x399ef2){_0x399ef2=_0x399ef2||0x1f4;return function(_0x1f94ef){logger[_0xce2f('0x23')](_0x1f94ef[_0xce2f('0x24')]);if(_0x1f94ef[_0xce2f('0x25')]){delete _0x1f94ef[_0xce2f('0x25')];}_0x275401[_0xce2f('0x17')](_0x399ef2)[_0xce2f('0x26')](_0x1f94ef);};}exports[_0xce2f('0x27')]=function(_0x58e947,_0x1c308e){var _0xb7468c={},_0x5c1643={},_0x35fd9e={'count':0x0,'rows':[]};var _0x10af84=_[_0xce2f('0x28')](db['Dynamics365Field']['rawAttributes'],function(_0x159ef5){return{'name':_0x159ef5[_0xce2f('0x29')],'type':_0x159ef5[_0xce2f('0x2a')][_0xce2f('0x2b')]};});_0x5c1643['model']=_[_0xce2f('0x28')](_0x10af84,_0xce2f('0x25'));_0x5c1643['query']=_[_0xce2f('0x2c')](_0x58e947['query']);_0x5c1643[_0xce2f('0x2d')]=_[_0xce2f('0x2e')](_0x5c1643[_0xce2f('0x2f')],_0x5c1643[_0xce2f('0x30')]);_0xb7468c[_0xce2f('0x31')]=_[_0xce2f('0x2e')](_0x5c1643['model'],qs[_0xce2f('0x32')](_0x58e947[_0xce2f('0x30')][_0xce2f('0x32')]));_0xb7468c[_0xce2f('0x31')]=_0xb7468c['attributes']['length']?_0xb7468c[_0xce2f('0x31')]:_0x5c1643[_0xce2f('0x2f')];if(!_0x58e947[_0xce2f('0x30')]['hasOwnProperty']('nolimit')){_0xb7468c['limit']=qs['limit'](_0x58e947[_0xce2f('0x30')][_0xce2f('0x1b')]);_0xb7468c['offset']=qs[_0xce2f('0x1a')](_0x58e947[_0xce2f('0x30')][_0xce2f('0x1a')]);}_0xb7468c['order']=qs[_0xce2f('0x33')](_0x58e947['query'][_0xce2f('0x33')]);_0xb7468c[_0xce2f('0x34')]=qs[_0xce2f('0x2d')](_['pick'](_0x58e947['query'],_0x5c1643[_0xce2f('0x2d')]),_0x10af84);if(_0x58e947[_0xce2f('0x30')][_0xce2f('0x35')]){_0xb7468c[_0xce2f('0x34')]=_['merge'](_0xb7468c[_0xce2f('0x34')],{'$or':_['map'](_0x10af84,function(_0x149b1d){if(_0x149b1d['type']!==_0xce2f('0x36')){var _0x4063ea={};_0x4063ea[_0x149b1d[_0xce2f('0x25')]]={'$like':'%'+_0x58e947[_0xce2f('0x30')][_0xce2f('0x35')]+'%'};return _0x4063ea;}})});}_0xb7468c=_[_0xce2f('0x37')]({},_0xb7468c,_0x58e947[_0xce2f('0x38')]);var _0x2a7eee={'where':_0xb7468c[_0xce2f('0x34')]};return db[_0xce2f('0x39')][_0xce2f('0x1d')](_0x2a7eee)[_0xce2f('0x22')](function(_0x2d54d7){_0x35fd9e[_0xce2f('0x1d')]=_0x2d54d7;if(_0x58e947['query'][_0xce2f('0x3a')]){_0xb7468c['include']=[{'all':!![]}];}return db[_0xce2f('0x39')][_0xce2f('0x3b')](_0xb7468c);})[_0xce2f('0x22')](function(_0x5596b2){_0x35fd9e[_0xce2f('0x3c')]=_0x5596b2;return _0x35fd9e;})[_0xce2f('0x22')](respondWithFilteredResult(_0x1c308e,_0xb7468c))[_0xce2f('0x3d')](handleError(_0x1c308e,null));};exports[_0xce2f('0x3e')]=function(_0x49b4b2,_0x687ee){var _0x3218d6={'raw':!![],'where':{'id':_0x49b4b2[_0xce2f('0x3f')]['id']}},_0x52051a={};_0x52051a[_0xce2f('0x2f')]=_[_0xce2f('0x2c')](db[_0xce2f('0x39')][_0xce2f('0x40')]);_0x52051a[_0xce2f('0x30')]=_[_0xce2f('0x2c')](_0x49b4b2[_0xce2f('0x30')]);_0x52051a[_0xce2f('0x2d')]=_[_0xce2f('0x2e')](_0x52051a[_0xce2f('0x2f')],_0x52051a[_0xce2f('0x30')]);_0x3218d6[_0xce2f('0x31')]=_[_0xce2f('0x2e')](_0x52051a[_0xce2f('0x2f')],qs[_0xce2f('0x32')](_0x49b4b2[_0xce2f('0x30')]['fields']));_0x3218d6[_0xce2f('0x31')]=_0x3218d6[_0xce2f('0x31')][_0xce2f('0x41')]?_0x3218d6[_0xce2f('0x31')]:_0x52051a[_0xce2f('0x2f')];if(_0x49b4b2[_0xce2f('0x30')]['includeAll']){_0x3218d6[_0xce2f('0x42')]=[{'all':!![]}];}_0x3218d6=_[_0xce2f('0x37')]({},_0x3218d6,_0x49b4b2['options']);return db[_0xce2f('0x39')][_0xce2f('0x43')](_0x3218d6)[_0xce2f('0x22')](handleEntityNotFound(_0x687ee,null))[_0xce2f('0x22')](respondWithResult(_0x687ee,null))[_0xce2f('0x3d')](handleError(_0x687ee,null));};exports[_0xce2f('0x44')]=function(_0x1474a4,_0x395593){return db[_0xce2f('0x39')][_0xce2f('0x44')](_0x1474a4[_0xce2f('0x45')],{})[_0xce2f('0x22')](respondWithResult(_0x395593,0xc9))[_0xce2f('0x3d')](handleError(_0x395593,null));};exports['update']=function(_0x3e2fe0,_0x46d16c){if(_0x3e2fe0[_0xce2f('0x45')]['id']){delete _0x3e2fe0[_0xce2f('0x45')]['id'];}return db[_0xce2f('0x39')][_0xce2f('0x43')]({'where':{'id':_0x3e2fe0[_0xce2f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x46d16c,null))[_0xce2f('0x22')](saveUpdates(_0x3e2fe0[_0xce2f('0x45')],null))[_0xce2f('0x22')](respondWithResult(_0x46d16c,null))['catch'](handleError(_0x46d16c,null));};exports[_0xce2f('0x46')]=function(_0x473874,_0x50a797){return db[_0xce2f('0x39')][_0xce2f('0x43')]({'where':{'id':_0x473874[_0xce2f('0x3f')]['id']}})[_0xce2f('0x22')](handleEntityNotFound(_0x50a797,null))[_0xce2f('0x22')](removeEntity(_0x50a797,null))[_0xce2f('0x3d')](handleError(_0x50a797,null));}; \ No newline at end of file +var _0x2666=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','save','then','error','stack','name','index','map','Dynamics365Field','rawAttributes','key','model','query','keys','filters','attributes','length','nolimit','order','sort','filter','merge','where','type','VIRTUAL','options','includeAll','findAll','catch','show','params','intersection','fields','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring'];(function(_0x330634,_0x386014){var _0x32d9ae=function(_0x404051){while(--_0x404051){_0x330634['push'](_0x330634['shift']());}};_0x32d9ae(++_0x386014);}(_0x2666,0xc0));var _0x6266=function(_0x3b1bba,_0x220536){_0x3b1bba=_0x3b1bba-0x0;var _0x4ca374=_0x2666[_0x3b1bba];return _0x4ca374;};'use strict';var emlformat=require(_0x6266('0x0'));var rimraf=require(_0x6266('0x1'));var zipdir=require(_0x6266('0x2'));var jsonpatch=require(_0x6266('0x3'));var rp=require(_0x6266('0x4'));var moment=require('moment');var BPromise=require(_0x6266('0x5'));var Mustache=require('mustache');var util=require(_0x6266('0x6'));var path=require(_0x6266('0x7'));var sox=require('sox');var csv=require(_0x6266('0x8'));var ejs=require(_0x6266('0x9'));var fs=require('fs');var fs_extra=require(_0x6266('0xa'));var _=require('lodash');var squel=require(_0x6266('0xb'));var crypto=require(_0x6266('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6266('0xd'));var toCsv=require(_0x6266('0x8'));var querystring=require(_0x6266('0xe'));var Papa=require('papaparse');var Redis=require(_0x6266('0xf'));var authService=require(_0x6266('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6266('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6266('0x12'));var utils=require(_0x6266('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6266('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24e40b,_0x528b65){_0x528b65=_0x528b65||0xcc;return function(_0x1e417a){if(_0x1e417a){return _0x24e40b[_0x6266('0x15')](_0x528b65);}return _0x24e40b[_0x6266('0x16')](_0x528b65)[_0x6266('0x17')]();};}function respondWithResult(_0xa159b9,_0xd5b25b){_0xd5b25b=_0xd5b25b||0xc8;return function(_0x409260){if(_0x409260){return _0xa159b9[_0x6266('0x16')](_0xd5b25b)['json'](_0x409260);}};}function respondWithFilteredResult(_0xd24be,_0x48e44b){return function(_0x3e2e12){if(_0x3e2e12){var _0x4021fc=typeof _0x48e44b['offset']===_0x6266('0x18')&&typeof _0x48e44b['limit']==='undefined';var _0x3caad7=_0x3e2e12[_0x6266('0x19')];var _0x305663=_0x4021fc?0x0:_0x48e44b[_0x6266('0x1a')];var _0x10cac1=_0x4021fc?_0x3e2e12[_0x6266('0x19')]:_0x48e44b[_0x6266('0x1a')]+_0x48e44b[_0x6266('0x1b')];var _0x5e7c51;if(_0x10cac1>=_0x3caad7){_0x10cac1=_0x3caad7;_0x5e7c51=0xc8;}else{_0x5e7c51=0xce;}_0xd24be[_0x6266('0x16')](_0x5e7c51);return _0xd24be[_0x6266('0x1c')](_0x6266('0x1d'),_0x305663+'-'+_0x10cac1+'/'+_0x3caad7)[_0x6266('0x1e')](_0x3e2e12);}return null;};}function patchUpdates(_0x5229dc){return function(_0x172ad8){try{jsonpatch[_0x6266('0x1f')](_0x172ad8,_0x5229dc,!![]);}catch(_0x9bc63d){return BPromise['reject'](_0x9bc63d);}return _0x172ad8[_0x6266('0x20')]();};}function saveUpdates(_0x41c12c,_0x64edcf){return function(_0xe8ee2){if(_0xe8ee2){return _0xe8ee2['update'](_0x41c12c)[_0x6266('0x21')](function(_0x1030c5){return _0x1030c5;});}return null;};}function removeEntity(_0x5c5e3d,_0x381735){return function(_0x4c6ae0){if(_0x4c6ae0){return _0x4c6ae0['destroy']()[_0x6266('0x21')](function(){_0x5c5e3d[_0x6266('0x16')](0xcc)[_0x6266('0x17')]();});}};}function handleEntityNotFound(_0x2d0339,_0x3e25cc){return function(_0x493393){if(!_0x493393){_0x2d0339[_0x6266('0x15')](0x194);}return _0x493393;};}function handleError(_0x83ff65,_0x565b39){_0x565b39=_0x565b39||0x1f4;return function(_0x3f5db5){logger[_0x6266('0x22')](_0x3f5db5[_0x6266('0x23')]);if(_0x3f5db5['name']){delete _0x3f5db5[_0x6266('0x24')];}_0x83ff65[_0x6266('0x16')](_0x565b39)['send'](_0x3f5db5);};}exports[_0x6266('0x25')]=function(_0x13bf51,_0x484d99){var _0x3b0c4c={},_0x5631bb={},_0x29c525={'count':0x0,'rows':[]};var _0x371278=_[_0x6266('0x26')](db[_0x6266('0x27')][_0x6266('0x28')],function(_0x26113d){return{'name':_0x26113d['fieldName'],'type':_0x26113d['type'][_0x6266('0x29')]};});_0x5631bb[_0x6266('0x2a')]=_[_0x6266('0x26')](_0x371278,_0x6266('0x24'));_0x5631bb[_0x6266('0x2b')]=_[_0x6266('0x2c')](_0x13bf51[_0x6266('0x2b')]);_0x5631bb[_0x6266('0x2d')]=_['intersection'](_0x5631bb[_0x6266('0x2a')],_0x5631bb[_0x6266('0x2b')]);_0x3b0c4c[_0x6266('0x2e')]=_['intersection'](_0x5631bb[_0x6266('0x2a')],qs['fields'](_0x13bf51[_0x6266('0x2b')]['fields']));_0x3b0c4c[_0x6266('0x2e')]=_0x3b0c4c['attributes'][_0x6266('0x2f')]?_0x3b0c4c['attributes']:_0x5631bb[_0x6266('0x2a')];if(!_0x13bf51[_0x6266('0x2b')]['hasOwnProperty'](_0x6266('0x30'))){_0x3b0c4c[_0x6266('0x1b')]=qs[_0x6266('0x1b')](_0x13bf51[_0x6266('0x2b')][_0x6266('0x1b')]);_0x3b0c4c['offset']=qs['offset'](_0x13bf51[_0x6266('0x2b')][_0x6266('0x1a')]);}_0x3b0c4c[_0x6266('0x31')]=qs[_0x6266('0x32')](_0x13bf51[_0x6266('0x2b')][_0x6266('0x32')]);_0x3b0c4c['where']=qs[_0x6266('0x2d')](_['pick'](_0x13bf51['query'],_0x5631bb[_0x6266('0x2d')]),_0x371278);if(_0x13bf51[_0x6266('0x2b')][_0x6266('0x33')]){_0x3b0c4c['where']=_[_0x6266('0x34')](_0x3b0c4c[_0x6266('0x35')],{'$or':_['map'](_0x371278,function(_0x415546){if(_0x415546[_0x6266('0x36')]!==_0x6266('0x37')){var _0x22d707={};_0x22d707[_0x415546['name']]={'$like':'%'+_0x13bf51[_0x6266('0x2b')]['filter']+'%'};return _0x22d707;}})});}_0x3b0c4c=_[_0x6266('0x34')]({},_0x3b0c4c,_0x13bf51[_0x6266('0x38')]);var _0x4a341e={'where':_0x3b0c4c[_0x6266('0x35')]};return db[_0x6266('0x27')][_0x6266('0x19')](_0x4a341e)[_0x6266('0x21')](function(_0x573ce9){_0x29c525[_0x6266('0x19')]=_0x573ce9;if(_0x13bf51[_0x6266('0x2b')][_0x6266('0x39')]){_0x3b0c4c['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0x6266('0x3a')](_0x3b0c4c);})[_0x6266('0x21')](function(_0x47c873){_0x29c525['rows']=_0x47c873;return _0x29c525;})[_0x6266('0x21')](respondWithFilteredResult(_0x484d99,_0x3b0c4c))[_0x6266('0x3b')](handleError(_0x484d99,null));};exports[_0x6266('0x3c')]=function(_0x2456f7,_0x3296a3){var _0x144884={'raw':!![],'where':{'id':_0x2456f7[_0x6266('0x3d')]['id']}},_0x465b4d={};_0x465b4d[_0x6266('0x2a')]=_[_0x6266('0x2c')](db[_0x6266('0x27')][_0x6266('0x28')]);_0x465b4d[_0x6266('0x2b')]=_[_0x6266('0x2c')](_0x2456f7[_0x6266('0x2b')]);_0x465b4d[_0x6266('0x2d')]=_[_0x6266('0x3e')](_0x465b4d[_0x6266('0x2a')],_0x465b4d[_0x6266('0x2b')]);_0x144884['attributes']=_[_0x6266('0x3e')](_0x465b4d[_0x6266('0x2a')],qs[_0x6266('0x3f')](_0x2456f7['query'][_0x6266('0x3f')]));_0x144884[_0x6266('0x2e')]=_0x144884[_0x6266('0x2e')][_0x6266('0x2f')]?_0x144884[_0x6266('0x2e')]:_0x465b4d['model'];if(_0x2456f7[_0x6266('0x2b')][_0x6266('0x39')]){_0x144884['include']=[{'all':!![]}];}_0x144884=_[_0x6266('0x34')]({},_0x144884,_0x2456f7[_0x6266('0x38')]);return db[_0x6266('0x27')][_0x6266('0x40')](_0x144884)[_0x6266('0x21')](handleEntityNotFound(_0x3296a3,null))[_0x6266('0x21')](respondWithResult(_0x3296a3,null))[_0x6266('0x3b')](handleError(_0x3296a3,null));};exports['create']=function(_0x4ef1a2,_0x42d0a6){return db[_0x6266('0x27')][_0x6266('0x41')](_0x4ef1a2[_0x6266('0x42')],{})[_0x6266('0x21')](respondWithResult(_0x42d0a6,0xc9))[_0x6266('0x3b')](handleError(_0x42d0a6,null));};exports[_0x6266('0x43')]=function(_0x232f94,_0x2cf165){if(_0x232f94[_0x6266('0x42')]['id']){delete _0x232f94[_0x6266('0x42')]['id'];}return db[_0x6266('0x27')][_0x6266('0x40')]({'where':{'id':_0x232f94[_0x6266('0x3d')]['id']}})[_0x6266('0x21')](handleEntityNotFound(_0x2cf165,null))['then'](saveUpdates(_0x232f94[_0x6266('0x42')],null))[_0x6266('0x21')](respondWithResult(_0x2cf165,null))[_0x6266('0x3b')](handleError(_0x2cf165,null));};exports[_0x6266('0x44')]=function(_0x13943a,_0x8c82b8){return db['Dynamics365Field']['find']({'where':{'id':_0x13943a[_0x6266('0x3d')]['id']}})['then'](handleEntityNotFound(_0x8c82b8,null))[_0x6266('0x21')](removeEntity(_0x8c82b8,null))[_0x6266('0x3b')](handleError(_0x8c82b8,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index ee09382..68ca2b7 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 _0xf929=['../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x42b8b3,_0x3a1961){var _0xea9ddf=function(_0x4196fa){while(--_0x4196fa){_0x42b8b3['push'](_0x42b8b3['shift']());}};_0xea9ddf(++_0x3a1961);}(_0xf929,0x19e));var _0x9f92=function(_0x324caa,_0x19756f){_0x324caa=_0x324caa-0x0;var _0x260932=_0xf929[_0x324caa];return _0x260932;};'use strict';var _=require('lodash');var util=require(_0x9f92('0x0'));var logger=require(_0x9f92('0x1'))('api');var moment=require(_0x9f92('0x2'));var BPromise=require(_0x9f92('0x3'));var rp=require(_0x9f92('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f92('0x5'));var config=require(_0x9f92('0x6'));var attributes=require(_0x9f92('0x7'));module[_0x9f92('0x8')]=function(_0x3f7776,_0x33f7ae){return _0x3f7776[_0x9f92('0x9')](_0x9f92('0xa'),attributes,{'tableName':_0x9f92('0xb'),'paranoid':![],'indexes':[{'name':_0x9f92('0xc'),'fields':['idField',_0x9f92('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb531=['./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xb531,0xe8));var _0x1b53=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0xb531[_0x35d4e9];return _0x5c2770;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1b53('0x0'))(_0x1b53('0x1'));var moment=require(_0x1b53('0x2'));var BPromise=require(_0x1b53('0x3'));var rp=require(_0x1b53('0x4'));var fs=require('fs');var path=require(_0x1b53('0x5'));var rimraf=require(_0x1b53('0x6'));var config=require(_0x1b53('0x7'));var attributes=require(_0x1b53('0x8'));module[_0x1b53('0x9')]=function(_0x59621f,_0x3fa49a){return _0x59621f[_0x1b53('0xa')](_0x1b53('0xb'),attributes,{'tableName':_0x1b53('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x1b53('0xd'),_0x1b53('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 1aa2b68..ed18a94 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 _0xdb4e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x5cad0e,_0x10f620){var _0x1ecb40=function(_0x5b1f55){while(--_0x5b1f55){_0x5cad0e['push'](_0x5cad0e['shift']());}};_0x1ecb40(++_0x10f620);}(_0xdb4e,0x176));var _0xedb4=function(_0xcef09a,_0x4a55bd){_0xcef09a=_0xcef09a-0x0;var _0x129f57=_0xdb4e[_0xcef09a];return _0x129f57;};'use strict';var _=require(_0xedb4('0x0'));var util=require(_0xedb4('0x1'));var moment=require(_0xedb4('0x2'));var BPromise=require(_0xedb4('0x3'));var rs=require(_0xedb4('0x4'));var fs=require('fs');var Redis=require(_0xedb4('0x5'));var db=require(_0xedb4('0x6'))['db'];var utils=require(_0xedb4('0x7'));var logger=require(_0xedb4('0x8'))(_0xedb4('0x9'));var config=require(_0xedb4('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xedb4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x509f5c,_0x2ac989,_0x146b59){return new BPromise(function(_0x53b692,_0xe9ea72){return client[_0xedb4('0xc')](_0x509f5c,_0x146b59)[_0xedb4('0xd')](function(_0x290736){logger[_0xedb4('0xe')](_0xedb4('0xf'),_0x2ac989,'request\x20sent');logger[_0xedb4('0x10')](_0xedb4('0x11'),_0x2ac989,_0xedb4('0x12'),JSON[_0xedb4('0x13')](_0x290736));if(_0x290736[_0xedb4('0x14')]){if(_0x290736['error'][_0xedb4('0x15')]===0x1f4){logger[_0xedb4('0x14')](_0xedb4('0xf'),_0x2ac989,_0x290736['error']['message']);return _0xe9ea72(_0x290736[_0xedb4('0x14')][_0xedb4('0x16')]);}logger[_0xedb4('0x14')]('Dynamics365Field,\x20%s,\x20%s',_0x2ac989,_0x290736[_0xedb4('0x14')]['message']);return _0x53b692(_0x290736[_0xedb4('0x14')][_0xedb4('0x16')]);}else{logger[_0xedb4('0xe')](_0xedb4('0xf'),_0x2ac989,_0xedb4('0x12'));_0x53b692(_0x290736[_0xedb4('0x17')][_0xedb4('0x16')]);}})[_0xedb4('0x18')](function(_0x97bd0c){logger[_0xedb4('0x14')]('Dynamics365Field,\x20%s,\x20%s',_0x2ac989,_0x97bd0c);_0xe9ea72(_0x97bd0c);});});} \ No newline at end of file +var _0x2a83=['Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x58522d,_0x13da3b){var _0x247771=function(_0xb94b1d){while(--_0xb94b1d){_0x58522d['push'](_0x58522d['shift']());}};_0x247771(++_0x13da3b);}(_0x2a83,0x1d4));var _0x32a8=function(_0x3535cc,_0x2630a0){_0x3535cc=_0x3535cc-0x0;var _0x36f204=_0x2a83[_0x3535cc];return _0x36f204;};'use strict';var _=require(_0x32a8('0x0'));var util=require(_0x32a8('0x1'));var moment=require('moment');var BPromise=require(_0x32a8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32a8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x32a8('0x4'));var logger=require(_0x32a8('0x5'))(_0x32a8('0x6'));var config=require(_0x32a8('0x7'));var jayson=require(_0x32a8('0x8'));var client=jayson[_0x32a8('0x9')][_0x32a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34087c,_0x5b1b6a,_0x1a2df8){return new BPromise(function(_0x47bfed,_0x4f05f8){return client[_0x32a8('0xb')](_0x34087c,_0x1a2df8)['then'](function(_0x93d435){logger[_0x32a8('0xc')](_0x32a8('0xd'),_0x5b1b6a,_0x32a8('0xe'));logger['debug'](_0x32a8('0xf'),_0x5b1b6a,_0x32a8('0xe'),JSON[_0x32a8('0x10')](_0x93d435));if(_0x93d435['error']){if(_0x93d435['error'][_0x32a8('0x11')]===0x1f4){logger[_0x32a8('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x5b1b6a,_0x93d435[_0x32a8('0x12')][_0x32a8('0x13')]);return _0x4f05f8(_0x93d435[_0x32a8('0x12')][_0x32a8('0x13')]);}logger[_0x32a8('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x5b1b6a,_0x93d435[_0x32a8('0x12')][_0x32a8('0x13')]);return _0x47bfed(_0x93d435[_0x32a8('0x12')][_0x32a8('0x13')]);}else{logger[_0x32a8('0xc')](_0x32a8('0xd'),_0x5b1b6a,_0x32a8('0xe'));_0x47bfed(_0x93d435[_0x32a8('0x14')][_0x32a8('0x13')]);}})['catch'](function(_0x5d12a9){logger[_0x32a8('0x12')](_0x32a8('0xd'),_0x5b1b6a,_0x5d12a9);_0x4f05f8(_0x5d12a9);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 396e527..9e242d5 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 _0xafa0=['/:id','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id/configurations','isAuthenticated','/:id/fields','post','create','addConfiguration','put'];(function(_0x5b6a49,_0x3621d3){var _0x52cb4d=function(_0x2d9c84){while(--_0x2d9c84){_0x5b6a49['push'](_0x5b6a49['shift']());}};_0x52cb4d(++_0x3621d3);}(_0xafa0,0x154));var _0x0afa=function(_0x197966,_0x77bbb0){_0x197966=_0x197966-0x0;var _0x33e2e1=_0xafa0[_0x197966];return _0x33e2e1;};'use strict';var multer=require('multer');var util=require(_0x0afa('0x0'));var path=require(_0x0afa('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0afa('0x2')]();var fs_extra=require(_0x0afa('0x3'));var auth=require(_0x0afa('0x4'));var interaction=require(_0x0afa('0x5'));var config=require(_0x0afa('0x6'));var controller=require(_0x0afa('0x7'));router[_0x0afa('0x8')]('/',auth['isAuthenticated'](),controller[_0x0afa('0x9')]);router[_0x0afa('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0afa('0x8')](_0x0afa('0xa'),auth[_0x0afa('0xb')](),controller['getConfigurations']);router['get'](_0x0afa('0xc'),auth[_0x0afa('0xb')](),controller['getFields']);router[_0x0afa('0xd')]('/',auth[_0x0afa('0xb')](),controller[_0x0afa('0xe')]);router[_0x0afa('0xd')](_0x0afa('0xa'),auth[_0x0afa('0xb')](),controller[_0x0afa('0xf')]);router[_0x0afa('0x10')](_0x0afa('0x11'),auth[_0x0afa('0xb')](),controller['update']);router[_0x0afa('0x12')]('/:id',auth[_0x0afa('0xb')](),controller[_0x0afa('0x13')]);module[_0x0afa('0x14')]=router; \ No newline at end of file +var _0x3d9e=['./intFreshdeskAccount.controller','get','/:id','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x406b7f,_0x559f05){var _0x3638d3=function(_0x17fd67){while(--_0x17fd67){_0x406b7f['push'](_0x406b7f['shift']());}};_0x3638d3(++_0x559f05);}(_0x3d9e,0x17f));var _0xe3d9=function(_0x246f0c,_0x39f734){_0x246f0c=_0x246f0c-0x0;var _0x30fe50=_0x3d9e[_0x246f0c];return _0x30fe50;};'use strict';var multer=require(_0xe3d9('0x0'));var util=require(_0xe3d9('0x1'));var path=require(_0xe3d9('0x2'));var timeout=require(_0xe3d9('0x3'));var express=require('express');var router=express[_0xe3d9('0x4')]();var fs_extra=require(_0xe3d9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe3d9('0x6'));var config=require(_0xe3d9('0x7'));var controller=require(_0xe3d9('0x8'));router[_0xe3d9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe3d9('0x9')](_0xe3d9('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xe3d9('0x9')](_0xe3d9('0xb'),auth[_0xe3d9('0xc')](),controller[_0xe3d9('0xd')]);router['get'](_0xe3d9('0xe'),auth[_0xe3d9('0xc')](),controller[_0xe3d9('0xf')]);router[_0xe3d9('0x10')]('/',auth['isAuthenticated'](),controller[_0xe3d9('0x11')]);router['post'](_0xe3d9('0xb'),auth[_0xe3d9('0xc')](),controller[_0xe3d9('0x12')]);router[_0xe3d9('0x13')](_0xe3d9('0xa'),auth[_0xe3d9('0xc')](),controller[_0xe3d9('0x14')]);router[_0xe3d9('0x15')]('/:id',auth[_0xe3d9('0xc')](),controller[_0xe3d9('0x16')]);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 650c28a..dfe5c60 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 _0x66fa=['exports','STRING','username','remoteUri','sequelize'];(function(_0x42422a,_0x127b34){var _0x4500d2=function(_0x17b8a2){while(--_0x17b8a2){_0x42422a['push'](_0x42422a['shift']());}};_0x4500d2(++_0x127b34);}(_0x66fa,0x117));var _0xa66f=function(_0x547d32,_0x5a7375){_0x547d32=_0x547d32-0x0;var _0x20c9c2=_0x66fa[_0x547d32];return _0x20c9c2;};'use strict';var Sequelize=require(_0xa66f('0x0'));module[_0xa66f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa66f('0x2')]},'username':{'type':Sequelize[_0xa66f('0x2')],'unique':_0xa66f('0x3')},'apiKey':{'type':Sequelize[_0xa66f('0x2')]},'remoteUri':{'type':Sequelize[_0xa66f('0x2')],'unique':_0xa66f('0x4')},'serverUrl':{'type':Sequelize[_0xa66f('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['username','remoteUri','sequelize','exports','STRING'];(function(_0x1fa7d0,_0xa33d1c){var _0xf7bb9f=function(_0x1db6be){while(--_0x1db6be){_0x1fa7d0['push'](_0x1fa7d0['shift']());}};_0xf7bb9f(++_0xa33d1c);}(_0xdb28,0x106));var _0x8db2=function(_0x236c28,_0xd00bd1){_0x236c28=_0x236c28-0x0;var _0x32d877=_0xdb28[_0x236c28];return _0x32d877;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'name':{'type':Sequelize[_0x8db2('0x2')]},'description':{'type':Sequelize[_0x8db2('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x8db2('0x3')},'apiKey':{'type':Sequelize[_0x8db2('0x2')]},'remoteUri':{'type':Sequelize[_0x8db2('0x2')],'unique':_0x8db2('0x4')},'serverUrl':{'type':Sequelize[_0x8db2('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 71f515d..ad8a998 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 _0x75e3=['slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','priority','group','source','ticket_type','company','remove','includes','default','custom_text','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','sox','ejs','squel','crypto','jsforce','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','length','find','create','body','update','getConfigurations','FreshdeskConfiguration','pick','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','channel','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri'];(function(_0x1ea927,_0x283f84){var _0x469467=function(_0x59d810){while(--_0x59d810){_0x1ea927['push'](_0x1ea927['shift']());}};_0x469467(++_0x283f84);}(_0x75e3,0x104));var _0x375e=function(_0x343d6d,_0x25ede9){_0x343d6d=_0x343d6d-0x0;var _0x37948b=_0x75e3[_0x343d6d];return _0x37948b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x375e('0x0'));var zipdir=require(_0x375e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x375e('0x2'));var moment=require(_0x375e('0x3'));var BPromise=require(_0x375e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x375e('0x5'));var csv=require('to-csv');var ejs=require(_0x375e('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x375e('0x7'));var crypto=require(_0x375e('0x8'));var jsforce=require(_0x375e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x375e('0xa'));var querystring=require(_0x375e('0xb'));var Papa=require(_0x375e('0xc'));var Redis=require(_0x375e('0xd'));var authService=require(_0x375e('0xe'));var qs=require(_0x375e('0xf'));var as=require(_0x375e('0x10'));var hardwareService=require(_0x375e('0x11'));var logger=require('../../config/logger')(_0x375e('0x12'));var utils=require(_0x375e('0x13'));var config=require(_0x375e('0x14'));var licenseUtil=require(_0x375e('0x15'));var db=require(_0x375e('0x16'))['db'];var integrations=require(_0x375e('0x17'));function respondWithStatusCode(_0x4c2c39,_0x2163ec){_0x2163ec=_0x2163ec||0xcc;return function(_0x3d4daf){if(_0x3d4daf){return _0x4c2c39[_0x375e('0x18')](_0x2163ec);}return _0x4c2c39[_0x375e('0x19')](_0x2163ec)[_0x375e('0x1a')]();};}function respondWithResult(_0x28dc89,_0x110c44){_0x110c44=_0x110c44||0xc8;return function(_0x4c0ad5){if(_0x4c0ad5){return _0x28dc89[_0x375e('0x19')](_0x110c44)[_0x375e('0x1b')](_0x4c0ad5);}};}function respondWithFilteredResult(_0x370d8d,_0x4892f9){return function(_0x2a9ddf){if(_0x2a9ddf){var _0x519f95=typeof _0x4892f9[_0x375e('0x1c')]===_0x375e('0x1d')&&typeof _0x4892f9[_0x375e('0x1e')]===_0x375e('0x1d');var _0x198720=_0x2a9ddf[_0x375e('0x1f')];var _0x2f2465=_0x519f95?0x0:_0x4892f9[_0x375e('0x1c')];var _0xa5c18b=_0x519f95?_0x2a9ddf['count']:_0x4892f9['offset']+_0x4892f9[_0x375e('0x1e')];var _0x5cc071;if(_0xa5c18b>=_0x198720){_0xa5c18b=_0x198720;_0x5cc071=0xc8;}else{_0x5cc071=0xce;}_0x370d8d['status'](_0x5cc071);return _0x370d8d['set'](_0x375e('0x20'),_0x2f2465+'-'+_0xa5c18b+'/'+_0x198720)[_0x375e('0x1b')](_0x2a9ddf);}return null;};}function patchUpdates(_0x4be1a6){return function(_0x3f9ac8){try{jsonpatch[_0x375e('0x21')](_0x3f9ac8,_0x4be1a6,!![]);}catch(_0x54fb81){return BPromise['reject'](_0x54fb81);}return _0x3f9ac8[_0x375e('0x22')]();};}function saveUpdates(_0x5d68a5,_0x516dd2){return function(_0x4d973f){if(_0x4d973f){return _0x4d973f['update'](_0x5d68a5)['then'](function(_0x326eea){return _0x326eea;});}return null;};}function removeEntity(_0x4e878e,_0x3f7c85){return function(_0x350173){if(_0x350173){return _0x350173[_0x375e('0x23')]()[_0x375e('0x24')](function(){_0x4e878e[_0x375e('0x19')](0xcc)[_0x375e('0x1a')]();});}};}function handleEntityNotFound(_0x5e6c34,_0x329e5d){return function(_0x356288){if(!_0x356288){_0x5e6c34[_0x375e('0x18')](0x194);}return _0x356288;};}function handleError(_0x5397fc,_0x11b778){_0x11b778=_0x11b778||0x1f4;return function(_0x333c99){logger[_0x375e('0x25')](_0x333c99[_0x375e('0x26')]);if(_0x333c99[_0x375e('0x27')]){delete _0x333c99[_0x375e('0x27')];}_0x5397fc[_0x375e('0x19')](_0x11b778)[_0x375e('0x28')](_0x333c99);};}exports[_0x375e('0x29')]=function(_0x460675,_0x15f8f5){var _0x7d0ec8={},_0x399ed={},_0x3df953={'count':0x0,'rows':[]};var _0x10a9b1=_[_0x375e('0x2a')](db[_0x375e('0x2b')][_0x375e('0x2c')],function(_0x5d3fd2){return{'name':_0x5d3fd2[_0x375e('0x2d')],'type':_0x5d3fd2['type'][_0x375e('0x2e')]};});_0x399ed[_0x375e('0x2f')]=_[_0x375e('0x2a')](_0x10a9b1,_0x375e('0x27'));_0x399ed[_0x375e('0x30')]=_[_0x375e('0x31')](_0x460675[_0x375e('0x30')]);_0x399ed[_0x375e('0x32')]=_['intersection'](_0x399ed[_0x375e('0x2f')],_0x399ed[_0x375e('0x30')]);_0x7d0ec8['attributes']=_[_0x375e('0x33')](_0x399ed['model'],qs[_0x375e('0x34')](_0x460675[_0x375e('0x30')][_0x375e('0x34')]));_0x7d0ec8['attributes']=_0x7d0ec8['attributes']['length']?_0x7d0ec8[_0x375e('0x35')]:_0x399ed['model'];if(!_0x460675[_0x375e('0x30')]['hasOwnProperty'](_0x375e('0x36'))){_0x7d0ec8[_0x375e('0x1e')]=qs['limit'](_0x460675['query']['limit']);_0x7d0ec8[_0x375e('0x1c')]=qs[_0x375e('0x1c')](_0x460675[_0x375e('0x30')][_0x375e('0x1c')]);}_0x7d0ec8[_0x375e('0x37')]=qs['sort'](_0x460675[_0x375e('0x30')][_0x375e('0x38')]);_0x7d0ec8[_0x375e('0x39')]=qs[_0x375e('0x32')](_['pick'](_0x460675['query'],_0x399ed[_0x375e('0x32')]),_0x10a9b1);if(_0x460675['query'][_0x375e('0x3a')]){_0x7d0ec8[_0x375e('0x39')]=_['merge'](_0x7d0ec8[_0x375e('0x39')],{'$or':_[_0x375e('0x2a')](_0x10a9b1,function(_0x2ab994){if(_0x2ab994[_0x375e('0x3b')]!==_0x375e('0x3c')){var _0x496246={};_0x496246[_0x2ab994['name']]={'$like':'%'+_0x460675['query'][_0x375e('0x3a')]+'%'};return _0x496246;}})});}_0x7d0ec8=_[_0x375e('0x3d')]({},_0x7d0ec8,_0x460675[_0x375e('0x3e')]);var _0x50f19a={'where':_0x7d0ec8[_0x375e('0x39')]};return db[_0x375e('0x2b')][_0x375e('0x1f')](_0x50f19a)['then'](function(_0x4c5b3f){_0x3df953[_0x375e('0x1f')]=_0x4c5b3f;if(_0x460675[_0x375e('0x30')][_0x375e('0x3f')]){_0x7d0ec8[_0x375e('0x40')]=[{'all':!![]}];}return db[_0x375e('0x2b')][_0x375e('0x41')](_0x7d0ec8);})[_0x375e('0x24')](function(_0x20167d){_0x3df953['rows']=_0x20167d;return _0x3df953;})[_0x375e('0x24')](respondWithFilteredResult(_0x15f8f5,_0x7d0ec8))[_0x375e('0x42')](handleError(_0x15f8f5,null));};exports[_0x375e('0x43')]=function(_0x57c414,_0x1b0409){var _0x2ae9ab={'raw':![],'where':{'id':_0x57c414[_0x375e('0x44')]['id']}},_0x449fad={};_0x449fad[_0x375e('0x2f')]=_[_0x375e('0x31')](db[_0x375e('0x2b')]['rawAttributes']);_0x449fad[_0x375e('0x30')]=_[_0x375e('0x31')](_0x57c414['query']);_0x449fad[_0x375e('0x32')]=_['intersection'](_0x449fad['model'],_0x449fad[_0x375e('0x30')]);_0x2ae9ab['attributes']=_[_0x375e('0x33')](_0x449fad[_0x375e('0x2f')],qs[_0x375e('0x34')](_0x57c414[_0x375e('0x30')][_0x375e('0x34')]));_0x2ae9ab[_0x375e('0x35')]=_0x2ae9ab[_0x375e('0x35')][_0x375e('0x45')]?_0x2ae9ab['attributes']:_0x449fad[_0x375e('0x2f')];if(_0x57c414['query'][_0x375e('0x3f')]){_0x2ae9ab[_0x375e('0x40')]=[{'all':!![]}];}_0x2ae9ab=_[_0x375e('0x3d')]({},_0x2ae9ab,_0x57c414[_0x375e('0x3e')]);return db['FreshdeskAccount'][_0x375e('0x46')](_0x2ae9ab)['then'](handleEntityNotFound(_0x1b0409,null))['then'](respondWithResult(_0x1b0409,null))[_0x375e('0x42')](handleError(_0x1b0409,null));};exports[_0x375e('0x47')]=function(_0x1ea977,_0x1d99ae){return db[_0x375e('0x2b')][_0x375e('0x47')](_0x1ea977[_0x375e('0x48')],{})[_0x375e('0x24')](respondWithResult(_0x1d99ae,0xc9))['catch'](handleError(_0x1d99ae,null));};exports[_0x375e('0x49')]=function(_0x6e7a41,_0x5b03e3){if(_0x6e7a41[_0x375e('0x48')]['id']){delete _0x6e7a41['body']['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x6e7a41[_0x375e('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b03e3,null))['then'](saveUpdates(_0x6e7a41[_0x375e('0x48')],null))[_0x375e('0x24')](respondWithResult(_0x5b03e3,null))[_0x375e('0x42')](handleError(_0x5b03e3,null));};exports['destroy']=function(_0x287c18,_0x4d722){return db[_0x375e('0x2b')][_0x375e('0x46')]({'where':{'id':_0x287c18[_0x375e('0x44')]['id']}})[_0x375e('0x24')](handleEntityNotFound(_0x4d722,null))[_0x375e('0x24')](removeEntity(_0x4d722,null))['catch'](handleError(_0x4d722,null));};exports[_0x375e('0x4a')]=function(_0x2a4c44,_0xac37de,_0x345995){var _0x4ed917={};var _0x5a3c9b={};var _0xf76700;var _0x473bba;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x2a4c44[_0x375e('0x44')]['id']}})[_0x375e('0x24')](handleEntityNotFound(_0xac37de,null))[_0x375e('0x24')](function(_0x4ef66d){if(_0x4ef66d){_0xf76700=_0x4ef66d;_0x5a3c9b[_0x375e('0x2f')]=_[_0x375e('0x31')](db[_0x375e('0x4b')]['rawAttributes']);_0x5a3c9b[_0x375e('0x30')]=_[_0x375e('0x31')](_0x2a4c44[_0x375e('0x30')]);_0x5a3c9b[_0x375e('0x32')]=_['intersection'](_0x5a3c9b[_0x375e('0x2f')],_0x5a3c9b[_0x375e('0x30')]);_0x4ed917[_0x375e('0x35')]=_[_0x375e('0x33')](_0x5a3c9b[_0x375e('0x2f')],qs[_0x375e('0x34')](_0x2a4c44[_0x375e('0x30')][_0x375e('0x34')]));_0x4ed917[_0x375e('0x35')]=_0x4ed917[_0x375e('0x35')][_0x375e('0x45')]?_0x4ed917[_0x375e('0x35')]:_0x5a3c9b[_0x375e('0x2f')];_0x4ed917[_0x375e('0x37')]=qs[_0x375e('0x38')](_0x2a4c44[_0x375e('0x30')]['sort']);_0x4ed917[_0x375e('0x39')]=qs['filters'](_[_0x375e('0x4c')](_0x2a4c44[_0x375e('0x30')],_0x5a3c9b[_0x375e('0x32')]));if(_0x2a4c44[_0x375e('0x30')]['filter']){_0x4ed917[_0x375e('0x39')]=_['merge'](_0x4ed917['where'],{'$or':_[_0x375e('0x2a')](_0x4ed917[_0x375e('0x35')],function(_0x49cd53){var _0x2f5fc3={};_0x2f5fc3[_0x49cd53]={'$like':'%'+_0x2a4c44[_0x375e('0x30')]['filter']+'%'};return _0x2f5fc3;})});}_0x4ed917=_[_0x375e('0x3d')]({},_0x4ed917,_0x2a4c44[_0x375e('0x3e')]);return _0xf76700['getConfigurations'](_0x4ed917);}})[_0x375e('0x24')](function(_0x14cfbc){if(_0x14cfbc){_0x473bba=_0x14cfbc[_0x375e('0x45')];if(!_0x2a4c44['query'][_0x375e('0x4d')](_0x375e('0x36'))){_0x4ed917[_0x375e('0x1e')]=qs[_0x375e('0x1e')](_0x2a4c44[_0x375e('0x30')][_0x375e('0x1e')]);_0x4ed917['offset']=qs[_0x375e('0x1c')](_0x2a4c44[_0x375e('0x30')]['offset']);}return _0xf76700[_0x375e('0x4a')](_0x4ed917);}})['then'](function(_0x3812a0){if(_0x3812a0){return _0x3812a0?{'count':_0x473bba,'rows':_0x3812a0}:null;}})[_0x375e('0x24')](respondWithResult(_0xac37de,null))[_0x375e('0x42')](handleError(_0xac37de,null));};exports[_0x375e('0x4e')]=function(_0x5609ae,_0x51a8c6,_0x4921f7){if(_0x5609ae[_0x375e('0x48')]['id']){delete _0x5609ae[_0x375e('0x48')]['id'];}return db[_0x375e('0x2b')][_0x375e('0x4f')]({'where':{'id':_0x5609ae[_0x375e('0x44')]['id']}})['then'](handleEntityNotFound(_0x51a8c6,null))[_0x375e('0x24')](function(_0x5dc77b){if(_0x5dc77b){_0x5609ae['body'][_0x375e('0x50')]=_0x5dc77b['id'];_0x5609ae[_0x375e('0x48')][_0x375e('0x51')]=integrations['getSubjects'](_0x5609ae[_0x375e('0x48')][_0x375e('0x52')],_0x5609ae[_0x375e('0x48')][_0x375e('0x3b')]);_0x5609ae['body']['Descriptions']=integrations[_0x375e('0x53')](_0x5609ae[_0x375e('0x48')]['channel'],_0x5609ae[_0x375e('0x48')][_0x375e('0x3b')]);return db[_0x375e('0x4b')][_0x375e('0x47')](_0x5609ae[_0x375e('0x48')],{'include':[{'model':db[_0x375e('0x54')],'as':'Subjects'},{'model':db[_0x375e('0x54')],'as':'Descriptions'}]});}return null;})[_0x375e('0x24')](respondWithResult(_0x51a8c6,null))[_0x375e('0x42')](handleError(_0x51a8c6,null));};exports[_0x375e('0x55')]=function(_0x5ecbc2,_0x40d863,_0x53ec87){var _0x2957c9='';return db['FreshdeskAccount'][_0x375e('0x4f')]({'where':{'id':_0x5ecbc2[_0x375e('0x44')]['id']},'attributes':['id','remoteUri',_0x375e('0x56')]})[_0x375e('0x24')](handleEntityNotFound(_0x40d863,null))['then'](function(_0x12ebd2){if(_0x12ebd2){_0x2957c9=_0x12ebd2[_0x375e('0x57')];var _0x2bded1=_0x2957c9[_0x375e('0x58')](-0x1);if(_0x2bded1==='/'){_0x2957c9=_0x2957c9[_0x375e('0x59')](0x0,_0x2957c9[_0x375e('0x5a')](_0x2bded1));}return rp({'method':_0x375e('0x5b'),'uri':util[_0x375e('0x5c')](_0x375e('0x5d'),_0x2957c9,_0x375e('0x5e')),'headers':{'Authorization':util[_0x375e('0x5c')](_0x375e('0x5f'),new Buffer(util['format'](_0x375e('0x60'),_0x12ebd2['apiKey']))[_0x375e('0x61')](_0x375e('0x62')))},'json':!![]});}})[_0x375e('0x24')](function(_0x38949a){if(_0x38949a){var _0x28b959=[_0x375e('0x63'),'subject','agent','description',_0x375e('0x19'),_0x375e('0x64'),_0x375e('0x65'),_0x375e('0x66'),_0x375e('0x67'),_0x375e('0x65'),_0x375e('0x68')];_[_0x375e('0x69')](_0x38949a,function(_0x1c02e7){return _0x28b959[_0x375e('0x6a')](_0x1c02e7[_0x375e('0x27')])||!_0x1c02e7[_0x375e('0x6b')]&&_0x1c02e7['type']!==_0x375e('0x6c')&&_0x1c02e7[_0x375e('0x3b')]!=='custom_dropdown';});return{'count':_0x38949a[_0x375e('0x45')],'rows':_[_0x375e('0x2a')](_0x38949a,function(_0x295f3a){return{'id':_0x295f3a[_0x375e('0x27')],'name':_0x295f3a['label'],'custom':!_0x295f3a[_0x375e('0x6b')],'options':_0x295f3a[_0x375e('0x6d')]?_['map'](_0x295f3a['choices'],function(_0x3b271b){return{'name':_[_0x375e('0x6e')](_0x3b271b),'value':_0x3b271b};}):[]};})};}})[_0x375e('0x24')](respondWithResult(_0x40d863,null))['catch'](function(_0xee759d){var _0x433f37=_0x5ecbc2[_0x375e('0x30')][_0x375e('0x6f')]?0x1f4:_0xee759d[_0x375e('0x70')]||0x1f4;logger[_0x375e('0x25')](_0x375e('0x71'),_0x375e('0x55'),_0x433f37,JSON[_0x375e('0x72')](_0xee759d));delete _0xee759d[_0x375e('0x27')];if(_0x433f37===0x191){_0x433f37=0x190;}_0x40d863[_0x375e('0x19')](_0x433f37)[_0x375e('0x28')](_0x5ecbc2[_0x375e('0x30')][_0x375e('0x6f')]?{'message':_0x375e('0x73'),'statusCode':_0xee759d[_0x375e('0x70')]}:_0xee759d);});}; \ No newline at end of file +var _0x98b8=['lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','base64','requester','subject','agent','description','priority','group','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','error','getFields,\x20%s,\x20%s,\x20%s','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','count','set','Content-Range','json','reject','save','update','destroy','then','stack','name','send','index','map','FreshdeskAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','slice','substring'];(function(_0x174257,_0x2d8530){var _0x2f27ee=function(_0x5df204){while(--_0x5df204){_0x174257['push'](_0x174257['shift']());}};_0x2f27ee(++_0x2d8530);}(_0x98b8,0x93));var _0x898b=function(_0x5e3fb7,_0x4f0c05){_0x5e3fb7=_0x5e3fb7-0x0;var _0x3c9228=_0x98b8[_0x5e3fb7];return _0x3c9228;};'use strict';var emlformat=require(_0x898b('0x0'));var rimraf=require(_0x898b('0x1'));var zipdir=require(_0x898b('0x2'));var jsonpatch=require(_0x898b('0x3'));var rp=require(_0x898b('0x4'));var moment=require(_0x898b('0x5'));var BPromise=require(_0x898b('0x6'));var Mustache=require(_0x898b('0x7'));var util=require(_0x898b('0x8'));var path=require(_0x898b('0x9'));var sox=require(_0x898b('0xa'));var csv=require(_0x898b('0xb'));var ejs=require(_0x898b('0xc'));var fs=require('fs');var fs_extra=require(_0x898b('0xd'));var _=require(_0x898b('0xe'));var squel=require('squel');var crypto=require(_0x898b('0xf'));var jsforce=require(_0x898b('0x10'));var deskjs=require(_0x898b('0x11'));var toCsv=require(_0x898b('0xb'));var querystring=require(_0x898b('0x12'));var Papa=require(_0x898b('0x13'));var Redis=require(_0x898b('0x14'));var authService=require(_0x898b('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x898b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x898b('0x17'));var utils=require(_0x898b('0x18'));var config=require(_0x898b('0x19'));var licenseUtil=require(_0x898b('0x1a'));var db=require(_0x898b('0x1b'))['db'];var integrations=require(_0x898b('0x1c'));function respondWithStatusCode(_0x241756,_0x219de0){_0x219de0=_0x219de0||0xcc;return function(_0x88230c){if(_0x88230c){return _0x241756[_0x898b('0x1d')](_0x219de0);}return _0x241756[_0x898b('0x1e')](_0x219de0)[_0x898b('0x1f')]();};}function respondWithResult(_0x51b5a0,_0x435cba){_0x435cba=_0x435cba||0xc8;return function(_0x561cac){if(_0x561cac){return _0x51b5a0[_0x898b('0x1e')](_0x435cba)['json'](_0x561cac);}};}function respondWithFilteredResult(_0x4baf7b,_0x427cc4){return function(_0x239c41){if(_0x239c41){var _0x1c35c9=typeof _0x427cc4[_0x898b('0x20')]==='undefined'&&typeof _0x427cc4[_0x898b('0x21')]==='undefined';var _0x535847=_0x239c41[_0x898b('0x22')];var _0x250349=_0x1c35c9?0x0:_0x427cc4[_0x898b('0x20')];var _0x4b1a40=_0x1c35c9?_0x239c41[_0x898b('0x22')]:_0x427cc4[_0x898b('0x20')]+_0x427cc4[_0x898b('0x21')];var _0x622f99;if(_0x4b1a40>=_0x535847){_0x4b1a40=_0x535847;_0x622f99=0xc8;}else{_0x622f99=0xce;}_0x4baf7b[_0x898b('0x1e')](_0x622f99);return _0x4baf7b[_0x898b('0x23')](_0x898b('0x24'),_0x250349+'-'+_0x4b1a40+'/'+_0x535847)[_0x898b('0x25')](_0x239c41);}return null;};}function patchUpdates(_0x2eef40){return function(_0x150c37){try{jsonpatch['apply'](_0x150c37,_0x2eef40,!![]);}catch(_0x5c98bb){return BPromise[_0x898b('0x26')](_0x5c98bb);}return _0x150c37[_0x898b('0x27')]();};}function saveUpdates(_0x503390,_0x321ec9){return function(_0x2b8b04){if(_0x2b8b04){return _0x2b8b04[_0x898b('0x28')](_0x503390)['then'](function(_0x4fa723){return _0x4fa723;});}return null;};}function removeEntity(_0x66101f,_0x2bd250){return function(_0x1a70a1){if(_0x1a70a1){return _0x1a70a1[_0x898b('0x29')]()[_0x898b('0x2a')](function(){_0x66101f[_0x898b('0x1e')](0xcc)[_0x898b('0x1f')]();});}};}function handleEntityNotFound(_0x21785b,_0x284dfd){return function(_0x45d5a4){if(!_0x45d5a4){_0x21785b[_0x898b('0x1d')](0x194);}return _0x45d5a4;};}function handleError(_0x3479e1,_0x163a6c){_0x163a6c=_0x163a6c||0x1f4;return function(_0x485460){logger['error'](_0x485460[_0x898b('0x2b')]);if(_0x485460[_0x898b('0x2c')]){delete _0x485460[_0x898b('0x2c')];}_0x3479e1[_0x898b('0x1e')](_0x163a6c)[_0x898b('0x2d')](_0x485460);};}exports[_0x898b('0x2e')]=function(_0xed317a,_0xf9b0ad){var _0x320237={},_0x3d7b20={},_0x511611={'count':0x0,'rows':[]};var _0x4f1bb5=_[_0x898b('0x2f')](db[_0x898b('0x30')]['rawAttributes'],function(_0x63b5df){return{'name':_0x63b5df[_0x898b('0x31')],'type':_0x63b5df[_0x898b('0x32')][_0x898b('0x33')]};});_0x3d7b20[_0x898b('0x34')]=_[_0x898b('0x2f')](_0x4f1bb5,'name');_0x3d7b20[_0x898b('0x35')]=_[_0x898b('0x36')](_0xed317a['query']);_0x3d7b20[_0x898b('0x37')]=_['intersection'](_0x3d7b20[_0x898b('0x34')],_0x3d7b20[_0x898b('0x35')]);_0x320237['attributes']=_[_0x898b('0x38')](_0x3d7b20['model'],qs['fields'](_0xed317a[_0x898b('0x35')][_0x898b('0x39')]));_0x320237[_0x898b('0x3a')]=_0x320237[_0x898b('0x3a')][_0x898b('0x3b')]?_0x320237[_0x898b('0x3a')]:_0x3d7b20[_0x898b('0x34')];if(!_0xed317a[_0x898b('0x35')][_0x898b('0x3c')](_0x898b('0x3d'))){_0x320237[_0x898b('0x21')]=qs[_0x898b('0x21')](_0xed317a['query']['limit']);_0x320237['offset']=qs['offset'](_0xed317a[_0x898b('0x35')][_0x898b('0x20')]);}_0x320237[_0x898b('0x3e')]=qs['sort'](_0xed317a[_0x898b('0x35')][_0x898b('0x3f')]);_0x320237[_0x898b('0x40')]=qs[_0x898b('0x37')](_[_0x898b('0x41')](_0xed317a['query'],_0x3d7b20[_0x898b('0x37')]),_0x4f1bb5);if(_0xed317a[_0x898b('0x35')][_0x898b('0x42')]){_0x320237['where']=_[_0x898b('0x43')](_0x320237[_0x898b('0x40')],{'$or':_['map'](_0x4f1bb5,function(_0x2d6e1b){if(_0x2d6e1b[_0x898b('0x32')]!==_0x898b('0x44')){var _0xb3cde9={};_0xb3cde9[_0x2d6e1b['name']]={'$like':'%'+_0xed317a[_0x898b('0x35')][_0x898b('0x42')]+'%'};return _0xb3cde9;}})});}_0x320237=_[_0x898b('0x43')]({},_0x320237,_0xed317a[_0x898b('0x45')]);var _0x283283={'where':_0x320237[_0x898b('0x40')]};return db[_0x898b('0x30')][_0x898b('0x22')](_0x283283)[_0x898b('0x2a')](function(_0x20d60f){_0x511611['count']=_0x20d60f;if(_0xed317a['query'][_0x898b('0x46')]){_0x320237[_0x898b('0x47')]=[{'all':!![]}];}return db[_0x898b('0x30')][_0x898b('0x48')](_0x320237);})['then'](function(_0x1baa91){_0x511611[_0x898b('0x49')]=_0x1baa91;return _0x511611;})[_0x898b('0x2a')](respondWithFilteredResult(_0xf9b0ad,_0x320237))[_0x898b('0x4a')](handleError(_0xf9b0ad,null));};exports['show']=function(_0x7b16b,_0x2f363e){var _0x4e77be={'raw':![],'where':{'id':_0x7b16b[_0x898b('0x4b')]['id']}},_0x187f71={};_0x187f71['model']=_[_0x898b('0x36')](db['FreshdeskAccount'][_0x898b('0x4c')]);_0x187f71['query']=_[_0x898b('0x36')](_0x7b16b[_0x898b('0x35')]);_0x187f71[_0x898b('0x37')]=_[_0x898b('0x38')](_0x187f71[_0x898b('0x34')],_0x187f71['query']);_0x4e77be[_0x898b('0x3a')]=_[_0x898b('0x38')](_0x187f71[_0x898b('0x34')],qs['fields'](_0x7b16b[_0x898b('0x35')][_0x898b('0x39')]));_0x4e77be['attributes']=_0x4e77be[_0x898b('0x3a')][_0x898b('0x3b')]?_0x4e77be[_0x898b('0x3a')]:_0x187f71[_0x898b('0x34')];if(_0x7b16b[_0x898b('0x35')][_0x898b('0x46')]){_0x4e77be['include']=[{'all':!![]}];}_0x4e77be=_['merge']({},_0x4e77be,_0x7b16b[_0x898b('0x45')]);return db[_0x898b('0x30')]['find'](_0x4e77be)[_0x898b('0x2a')](handleEntityNotFound(_0x2f363e,null))[_0x898b('0x2a')](respondWithResult(_0x2f363e,null))[_0x898b('0x4a')](handleError(_0x2f363e,null));};exports[_0x898b('0x4d')]=function(_0x208be3,_0x463ec9){return db['FreshdeskAccount']['create'](_0x208be3['body'],{})[_0x898b('0x2a')](respondWithResult(_0x463ec9,0xc9))[_0x898b('0x4a')](handleError(_0x463ec9,null));};exports['update']=function(_0x280a53,_0x4555d3){if(_0x280a53[_0x898b('0x4e')]['id']){delete _0x280a53[_0x898b('0x4e')]['id'];}return db['FreshdeskAccount'][_0x898b('0x4f')]({'where':{'id':_0x280a53['params']['id']}})[_0x898b('0x2a')](handleEntityNotFound(_0x4555d3,null))['then'](saveUpdates(_0x280a53[_0x898b('0x4e')],null))[_0x898b('0x2a')](respondWithResult(_0x4555d3,null))[_0x898b('0x4a')](handleError(_0x4555d3,null));};exports['destroy']=function(_0x32ecda,_0x7960a8){return db[_0x898b('0x30')][_0x898b('0x4f')]({'where':{'id':_0x32ecda[_0x898b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x7960a8,null))['then'](removeEntity(_0x7960a8,null))[_0x898b('0x4a')](handleError(_0x7960a8,null));};exports[_0x898b('0x50')]=function(_0x2bbaa7,_0x569ece,_0x26ddbf){var _0x4d555c={};var _0x131ce2={};var _0x2c8278;var _0x59eeaf;return db['FreshdeskAccount'][_0x898b('0x51')]({'where':{'id':_0x2bbaa7[_0x898b('0x4b')]['id']}})[_0x898b('0x2a')](handleEntityNotFound(_0x569ece,null))['then'](function(_0x4ab67b){if(_0x4ab67b){_0x2c8278=_0x4ab67b;_0x131ce2['model']=_[_0x898b('0x36')](db[_0x898b('0x52')][_0x898b('0x4c')]);_0x131ce2[_0x898b('0x35')]=_[_0x898b('0x36')](_0x2bbaa7[_0x898b('0x35')]);_0x131ce2['filters']=_[_0x898b('0x38')](_0x131ce2[_0x898b('0x34')],_0x131ce2[_0x898b('0x35')]);_0x4d555c[_0x898b('0x3a')]=_[_0x898b('0x38')](_0x131ce2[_0x898b('0x34')],qs['fields'](_0x2bbaa7['query'][_0x898b('0x39')]));_0x4d555c[_0x898b('0x3a')]=_0x4d555c[_0x898b('0x3a')][_0x898b('0x3b')]?_0x4d555c[_0x898b('0x3a')]:_0x131ce2[_0x898b('0x34')];_0x4d555c['order']=qs[_0x898b('0x3f')](_0x2bbaa7[_0x898b('0x35')]['sort']);_0x4d555c[_0x898b('0x40')]=qs['filters'](_[_0x898b('0x41')](_0x2bbaa7[_0x898b('0x35')],_0x131ce2[_0x898b('0x37')]));if(_0x2bbaa7[_0x898b('0x35')][_0x898b('0x42')]){_0x4d555c[_0x898b('0x40')]=_[_0x898b('0x43')](_0x4d555c[_0x898b('0x40')],{'$or':_['map'](_0x4d555c[_0x898b('0x3a')],function(_0xe26046){var _0x40060b={};_0x40060b[_0xe26046]={'$like':'%'+_0x2bbaa7['query'][_0x898b('0x42')]+'%'};return _0x40060b;})});}_0x4d555c=_[_0x898b('0x43')]({},_0x4d555c,_0x2bbaa7[_0x898b('0x45')]);return _0x2c8278[_0x898b('0x50')](_0x4d555c);}})[_0x898b('0x2a')](function(_0x49f69c){if(_0x49f69c){_0x59eeaf=_0x49f69c[_0x898b('0x3b')];if(!_0x2bbaa7[_0x898b('0x35')][_0x898b('0x3c')](_0x898b('0x3d'))){_0x4d555c['limit']=qs['limit'](_0x2bbaa7['query']['limit']);_0x4d555c[_0x898b('0x20')]=qs[_0x898b('0x20')](_0x2bbaa7[_0x898b('0x35')][_0x898b('0x20')]);}return _0x2c8278[_0x898b('0x50')](_0x4d555c);}})[_0x898b('0x2a')](function(_0x29d362){if(_0x29d362){return _0x29d362?{'count':_0x59eeaf,'rows':_0x29d362}:null;}})[_0x898b('0x2a')](respondWithResult(_0x569ece,null))[_0x898b('0x4a')](handleError(_0x569ece,null));};exports[_0x898b('0x53')]=function(_0x40b091,_0x47851a,_0x156a27){if(_0x40b091[_0x898b('0x4e')]['id']){delete _0x40b091[_0x898b('0x4e')]['id'];}return db['FreshdeskAccount'][_0x898b('0x51')]({'where':{'id':_0x40b091['params']['id']}})['then'](handleEntityNotFound(_0x47851a,null))[_0x898b('0x2a')](function(_0x1cf6d9){if(_0x1cf6d9){_0x40b091[_0x898b('0x4e')][_0x898b('0x54')]=_0x1cf6d9['id'];_0x40b091[_0x898b('0x4e')][_0x898b('0x55')]=integrations['getSubjects'](_0x40b091[_0x898b('0x4e')]['channel'],_0x40b091[_0x898b('0x4e')][_0x898b('0x32')]);_0x40b091['body'][_0x898b('0x56')]=integrations[_0x898b('0x57')](_0x40b091[_0x898b('0x4e')]['channel'],_0x40b091[_0x898b('0x4e')]['type']);return db[_0x898b('0x52')][_0x898b('0x4d')](_0x40b091[_0x898b('0x4e')],{'include':[{'model':db[_0x898b('0x58')],'as':'Subjects'},{'model':db[_0x898b('0x58')],'as':_0x898b('0x56')}]});}return null;})[_0x898b('0x2a')](respondWithResult(_0x47851a,null))[_0x898b('0x4a')](handleError(_0x47851a,null));};exports[_0x898b('0x59')]=function(_0x4ea3f5,_0x30e35c,_0xb4cb2a){var _0x1232e1='';return db[_0x898b('0x30')]['findOne']({'where':{'id':_0x4ea3f5[_0x898b('0x4b')]['id']},'attributes':['id',_0x898b('0x5a'),'apiKey']})[_0x898b('0x2a')](handleEntityNotFound(_0x30e35c,null))[_0x898b('0x2a')](function(_0x1be43a){if(_0x1be43a){_0x1232e1=_0x1be43a[_0x898b('0x5a')];var _0xda29bb=_0x1232e1[_0x898b('0x5b')](-0x1);if(_0xda29bb==='/'){_0x1232e1=_0x1232e1[_0x898b('0x5c')](0x0,_0x1232e1[_0x898b('0x5d')](_0xda29bb));}return rp({'method':_0x898b('0x5e'),'uri':util[_0x898b('0x5f')](_0x898b('0x60'),_0x1232e1,_0x898b('0x61')),'headers':{'Authorization':util[_0x898b('0x5f')](_0x898b('0x62'),new Buffer(util['format'](_0x898b('0x63'),_0x1be43a[_0x898b('0x64')]))['toString'](_0x898b('0x65')))},'json':!![]});}})[_0x898b('0x2a')](function(_0x596624){if(_0x596624){var _0x134b83=[_0x898b('0x66'),_0x898b('0x67'),_0x898b('0x68'),_0x898b('0x69'),_0x898b('0x1e'),_0x898b('0x6a'),'group','source','ticket_type',_0x898b('0x6b'),_0x898b('0x6c')];_[_0x898b('0x6d')](_0x596624,function(_0x290f94){return _0x134b83[_0x898b('0x6e')](_0x290f94[_0x898b('0x2c')])||!_0x290f94[_0x898b('0x6f')]&&_0x290f94[_0x898b('0x32')]!==_0x898b('0x70')&&_0x290f94[_0x898b('0x32')]!==_0x898b('0x71');});return{'count':_0x596624[_0x898b('0x3b')],'rows':_['map'](_0x596624,function(_0x5e6b69){return{'id':_0x5e6b69['name'],'name':_0x5e6b69[_0x898b('0x72')],'custom':!_0x5e6b69[_0x898b('0x6f')],'options':_0x5e6b69[_0x898b('0x73')]?_['map'](_0x5e6b69[_0x898b('0x73')],function(_0x24c7a2){return{'name':_[_0x898b('0x74')](_0x24c7a2),'value':_0x24c7a2};}):[]};})};}})[_0x898b('0x2a')](respondWithResult(_0x30e35c,null))[_0x898b('0x4a')](function(_0x12b3d2){var _0x31f8e2=_0x4ea3f5[_0x898b('0x35')]['test']?0x1f4:_0x12b3d2['statusCode']||0x1f4;logger[_0x898b('0x75')](_0x898b('0x76'),'getFields',_0x31f8e2,JSON['stringify'](_0x12b3d2));delete _0x12b3d2['name'];if(_0x31f8e2===0x191){_0x31f8e2=0x190;}_0x30e35c['status'](_0x31f8e2)[_0x898b('0x2d')](_0x4ea3f5[_0x898b('0x35')][_0x898b('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x12b3d2['statusCode']}:_0x12b3d2);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 014485d..aac210b 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 _0x9292=['../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x24106c,_0x367a6f){var _0xbaeb73=function(_0x483603){while(--_0x483603){_0x24106c['push'](_0x24106c['shift']());}};_0xbaeb73(++_0x367a6f);}(_0x9292,0x95));var _0x2929=function(_0x34528e,_0x482db5){_0x34528e=_0x34528e-0x0;var _0x2b4f16=_0x9292[_0x34528e];return _0x2b4f16;};'use strict';var _=require(_0x2929('0x0'));var util=require(_0x2929('0x1'));var logger=require(_0x2929('0x2'))(_0x2929('0x3'));var moment=require(_0x2929('0x4'));var BPromise=require(_0x2929('0x5'));var rp=require(_0x2929('0x6'));var fs=require('fs');var path=require(_0x2929('0x7'));var rimraf=require(_0x2929('0x8'));var config=require(_0x2929('0x9'));var attributes=require(_0x2929('0xa'));var integrations=require(_0x2929('0xb'));module[_0x2929('0xc')]=function(_0x36d07b,_0x17a8a3){return _0x36d07b[_0x2929('0xd')](_0x2929('0xe'),attributes,{'tableName':_0x2929('0xf'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc8c5=['int_freshdesk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0xcd9ec8,_0x27699f){var _0x5aa31b=function(_0x32f922){while(--_0x32f922){_0xcd9ec8['push'](_0xcd9ec8['shift']());}};_0x5aa31b(++_0x27699f);}(_0xc8c5,0xd3));var _0x5c8c=function(_0x2ecb8b,_0x4d2942){_0x2ecb8b=_0x2ecb8b-0x0;var _0x4769c5=_0xc8c5[_0x2ecb8b];return _0x4769c5;};'use strict';var _=require(_0x5c8c('0x0'));var util=require(_0x5c8c('0x1'));var logger=require(_0x5c8c('0x2'))('api');var moment=require(_0x5c8c('0x3'));var BPromise=require(_0x5c8c('0x4'));var rp=require(_0x5c8c('0x5'));var fs=require('fs');var path=require(_0x5c8c('0x6'));var rimraf=require(_0x5c8c('0x7'));var config=require(_0x5c8c('0x8'));var attributes=require(_0x5c8c('0x9'));var integrations=require(_0x5c8c('0xa'));module[_0x5c8c('0xb')]=function(_0x1ab3e1,_0x55d732){return _0x1ab3e1[_0x5c8c('0xc')](_0x5c8c('0xd'),attributes,{'tableName':_0x5c8c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index ebb61fa..a1bda8d 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 _0x928d=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowFreshdeskAccount','FreshdeskAccount','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x928d,0x1cd));var _0xd928=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x928d[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xd928('0x0'));var util=require('util');var moment=require(_0xd928('0x1'));var BPromise=require(_0xd928('0x2'));var rs=require(_0xd928('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd928('0x4'))['db'];var utils=require(_0xd928('0x5'));var logger=require(_0xd928('0x6'))(_0xd928('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd928('0x8')][_0xd928('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41bb5e,_0x56339a,_0x3b8afa){return new BPromise(function(_0x5da330,_0x294bf0){return client['request'](_0x41bb5e,_0x3b8afa)[_0xd928('0xa')](function(_0x31ff28){logger[_0xd928('0xb')](_0xd928('0xc'),_0x56339a,'request\x20sent');logger[_0xd928('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x56339a,_0xd928('0xe'),JSON[_0xd928('0xf')](_0x31ff28));if(_0x31ff28[_0xd928('0x10')]){if(_0x31ff28[_0xd928('0x10')][_0xd928('0x11')]===0x1f4){logger[_0xd928('0x10')](_0xd928('0xc'),_0x56339a,_0x31ff28[_0xd928('0x10')][_0xd928('0x12')]);return _0x294bf0(_0x31ff28[_0xd928('0x10')][_0xd928('0x12')]);}logger[_0xd928('0x10')](_0xd928('0xc'),_0x56339a,_0x31ff28[_0xd928('0x10')]['message']);return _0x5da330(_0x31ff28[_0xd928('0x10')]['message']);}else{logger[_0xd928('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x56339a,'request\x20sent');_0x5da330(_0x31ff28[_0xd928('0x13')][_0xd928('0x12')]);}})[_0xd928('0x14')](function(_0x5ea6fa){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x56339a,_0x5ea6fa);_0x294bf0(_0x5ea6fa);});});}exports[_0xd928('0x15')]=function(_0x3d128b){var _0x58ce62=this;return new Promise(function(_0x3b4c48,_0x202709){return db['FreshdeskAccount'][_0xd928('0x16')]({'raw':_0x3d128b['options']?_0x3d128b[_0xd928('0x17')][_0xd928('0x18')]===undefined?!![]:![]:!![],'where':_0x3d128b['options']?_0x3d128b[_0xd928('0x17')][_0xd928('0x19')]||null:null,'attributes':_0x3d128b[_0xd928('0x17')]?_0x3d128b[_0xd928('0x17')][_0xd928('0x1a')]||null:null,'limit':_0x3d128b[_0xd928('0x17')]?_0x3d128b['options'][_0xd928('0x1b')]||null:null,'include':_0x3d128b[_0xd928('0x17')]?_0x3d128b[_0xd928('0x17')]['include']?_[_0xd928('0x1c')](_0x3d128b[_0xd928('0x17')][_0xd928('0x1d')],function(_0x38bf67){return{'model':db[_0x38bf67[_0xd928('0x1e')]],'as':_0x38bf67['as'],'attributes':_0x38bf67['attributes'],'include':_0x38bf67[_0xd928('0x1d')]?_['map'](_0x38bf67[_0xd928('0x1d')],function(_0x18247f){return{'model':db[_0x18247f['model']],'as':_0x18247f['as'],'attributes':_0x18247f[_0xd928('0x1a')],'include':_0x18247f[_0xd928('0x1d')]?_['map'](_0x18247f[_0xd928('0x1d')],function(_0x5ecbf5){return{'model':db[_0x5ecbf5[_0xd928('0x1e')]],'as':_0x5ecbf5['as'],'attributes':_0x5ecbf5[_0xd928('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd928('0xa')](function(_0x156e58){logger[_0xd928('0xb')](_0xd928('0x15'),_0x3d128b);logger['debug'](_0xd928('0x15'),_0x3d128b,JSON[_0xd928('0xf')](_0x156e58));_0x3b4c48(_0x156e58);})['catch'](function(_0x5a64ba){logger[_0xd928('0x10')](_0xd928('0x15'),_0x5a64ba['message'],_0x3d128b);_0x202709(_0x58ce62[_0xd928('0x10')](0x1f4,_0x5a64ba[_0xd928('0x12')]));});});};exports[_0xd928('0x1f')]=function(_0x3be70a){var _0x3cf10d=this;return new Promise(function(_0x41fe9b,_0x57a128){return db[_0xd928('0x20')]['find']({'raw':_0x3be70a[_0xd928('0x17')]?_0x3be70a[_0xd928('0x17')][_0xd928('0x18')]===undefined?!![]:![]:!![],'where':_0x3be70a[_0xd928('0x17')]?_0x3be70a[_0xd928('0x17')]['where']||null:null,'attributes':_0x3be70a[_0xd928('0x17')]?_0x3be70a[_0xd928('0x17')][_0xd928('0x1a')]||null:null,'include':_0x3be70a['options']?_0x3be70a[_0xd928('0x17')][_0xd928('0x1d')]?_['map'](_0x3be70a[_0xd928('0x17')][_0xd928('0x1d')],function(_0x4cd3a5){return{'model':db[_0x4cd3a5[_0xd928('0x1e')]],'as':_0x4cd3a5['as'],'attributes':_0x4cd3a5[_0xd928('0x1a')],'include':_0x4cd3a5[_0xd928('0x1d')]?_[_0xd928('0x1c')](_0x4cd3a5[_0xd928('0x1d')],function(_0x5aab51){return{'model':db[_0x5aab51[_0xd928('0x1e')]],'as':_0x5aab51['as'],'attributes':_0x5aab51['attributes'],'include':_0x5aab51[_0xd928('0x1d')]?_['map'](_0x5aab51[_0xd928('0x1d')],function(_0x1519ca){return{'model':db[_0x1519ca[_0xd928('0x1e')]],'as':_0x1519ca['as'],'attributes':_0x1519ca[_0xd928('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd928('0xa')](function(_0x226dfb){logger['info'](_0xd928('0x1f'),_0x3be70a);logger[_0xd928('0xd')]('ShowFreshdeskAccount',_0x3be70a,JSON[_0xd928('0xf')](_0x226dfb));_0x41fe9b(_0x226dfb);})[_0xd928('0x14')](function(_0x262df1){logger['error'](_0xd928('0x1f'),_0x262df1['message'],_0x3be70a);_0x57a128(_0x3cf10d[_0xd928('0x10')](0x1f4,_0x262df1[_0xd928('0x12')]));});});}; \ No newline at end of file +var _0xfb3d=['ioredis','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','findAll','options','where','limit','include','map','model','attributes','GetFreshdeskAccount','ShowFreshdeskAccount','FreshdeskAccount','lodash','util','moment','randomstring'];(function(_0x46de3e,_0x55bd8e){var _0xf5eb59=function(_0x185196){while(--_0x185196){_0x46de3e['push'](_0x46de3e['shift']());}};_0xf5eb59(++_0x55bd8e);}(_0xfb3d,0x151));var _0xdfb3=function(_0x8b1633,_0x29f0de){_0x8b1633=_0x8b1633-0x0;var _0x5f21a9=_0xfb3d[_0x8b1633];return _0x5f21a9;};'use strict';var _=require(_0xdfb3('0x0'));var util=require(_0xdfb3('0x1'));var moment=require(_0xdfb3('0x2'));var BPromise=require('bluebird');var rs=require(_0xdfb3('0x3'));var fs=require('fs');var Redis=require(_0xdfb3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xdfb3('0x5'));var jayson=require(_0xdfb3('0x6'));var client=jayson[_0xdfb3('0x7')][_0xdfb3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4947eb,_0x2f41fb,_0x4f1544){return new BPromise(function(_0x498ca3,_0x1a5aa3){return client[_0xdfb3('0x9')](_0x4947eb,_0x4f1544)[_0xdfb3('0xa')](function(_0x3042dc){logger[_0xdfb3('0xb')](_0xdfb3('0xc'),_0x2f41fb,'request\x20sent');logger[_0xdfb3('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x2f41fb,'request\x20sent',JSON[_0xdfb3('0xe')](_0x3042dc));if(_0x3042dc['error']){if(_0x3042dc[_0xdfb3('0xf')]['code']===0x1f4){logger[_0xdfb3('0xf')](_0xdfb3('0xc'),_0x2f41fb,_0x3042dc[_0xdfb3('0xf')][_0xdfb3('0x10')]);return _0x1a5aa3(_0x3042dc['error'][_0xdfb3('0x10')]);}logger['error'](_0xdfb3('0xc'),_0x2f41fb,_0x3042dc[_0xdfb3('0xf')]['message']);return _0x498ca3(_0x3042dc[_0xdfb3('0xf')]['message']);}else{logger[_0xdfb3('0xb')](_0xdfb3('0xc'),_0x2f41fb,_0xdfb3('0x11'));_0x498ca3(_0x3042dc[_0xdfb3('0x12')][_0xdfb3('0x10')]);}})[_0xdfb3('0x13')](function(_0x5a1503){logger[_0xdfb3('0xf')](_0xdfb3('0xc'),_0x2f41fb,_0x5a1503);_0x1a5aa3(_0x5a1503);});});}exports['GetFreshdeskAccount']=function(_0x36c595){var _0x12bfb2=this;return new Promise(function(_0x1a6fa0,_0x1b4e22){return db['FreshdeskAccount'][_0xdfb3('0x14')]({'raw':_0x36c595['options']?_0x36c595[_0xdfb3('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x36c595[_0xdfb3('0x15')]?_0x36c595[_0xdfb3('0x15')][_0xdfb3('0x16')]||null:null,'attributes':_0x36c595[_0xdfb3('0x15')]?_0x36c595[_0xdfb3('0x15')]['attributes']||null:null,'limit':_0x36c595[_0xdfb3('0x15')]?_0x36c595[_0xdfb3('0x15')][_0xdfb3('0x17')]||null:null,'include':_0x36c595[_0xdfb3('0x15')]?_0x36c595[_0xdfb3('0x15')][_0xdfb3('0x18')]?_[_0xdfb3('0x19')](_0x36c595[_0xdfb3('0x15')]['include'],function(_0x3a1570){return{'model':db[_0x3a1570[_0xdfb3('0x1a')]],'as':_0x3a1570['as'],'attributes':_0x3a1570[_0xdfb3('0x1b')],'include':_0x3a1570[_0xdfb3('0x18')]?_[_0xdfb3('0x19')](_0x3a1570[_0xdfb3('0x18')],function(_0x57d94e){return{'model':db[_0x57d94e[_0xdfb3('0x1a')]],'as':_0x57d94e['as'],'attributes':_0x57d94e[_0xdfb3('0x1b')],'include':_0x57d94e[_0xdfb3('0x18')]?_['map'](_0x57d94e[_0xdfb3('0x18')],function(_0xaf07d4){return{'model':db[_0xaf07d4['model']],'as':_0xaf07d4['as'],'attributes':_0xaf07d4['attributes']};}):[]};}):[]};}):[]:[]})[_0xdfb3('0xa')](function(_0x5aa237){logger['info'](_0xdfb3('0x1c'),_0x36c595);logger[_0xdfb3('0xd')](_0xdfb3('0x1c'),_0x36c595,JSON[_0xdfb3('0xe')](_0x5aa237));_0x1a6fa0(_0x5aa237);})[_0xdfb3('0x13')](function(_0x10aae7){logger[_0xdfb3('0xf')](_0xdfb3('0x1c'),_0x10aae7['message'],_0x36c595);_0x1b4e22(_0x12bfb2[_0xdfb3('0xf')](0x1f4,_0x10aae7[_0xdfb3('0x10')]));});});};exports[_0xdfb3('0x1d')]=function(_0xb97b14){var _0x3a271f=this;return new Promise(function(_0x3a28c8,_0x3e713d){return db[_0xdfb3('0x1e')]['find']({'raw':_0xb97b14[_0xdfb3('0x15')]?_0xb97b14[_0xdfb3('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xb97b14[_0xdfb3('0x15')]?_0xb97b14['options'][_0xdfb3('0x16')]||null:null,'attributes':_0xb97b14[_0xdfb3('0x15')]?_0xb97b14['options']['attributes']||null:null,'include':_0xb97b14[_0xdfb3('0x15')]?_0xb97b14['options'][_0xdfb3('0x18')]?_[_0xdfb3('0x19')](_0xb97b14[_0xdfb3('0x15')][_0xdfb3('0x18')],function(_0x266c0c){return{'model':db[_0x266c0c['model']],'as':_0x266c0c['as'],'attributes':_0x266c0c[_0xdfb3('0x1b')],'include':_0x266c0c[_0xdfb3('0x18')]?_[_0xdfb3('0x19')](_0x266c0c[_0xdfb3('0x18')],function(_0x27c2c5){return{'model':db[_0x27c2c5[_0xdfb3('0x1a')]],'as':_0x27c2c5['as'],'attributes':_0x27c2c5[_0xdfb3('0x1b')],'include':_0x27c2c5[_0xdfb3('0x18')]?_[_0xdfb3('0x19')](_0x27c2c5[_0xdfb3('0x18')],function(_0x215457){return{'model':db[_0x215457[_0xdfb3('0x1a')]],'as':_0x215457['as'],'attributes':_0x215457[_0xdfb3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdfb3('0xa')](function(_0xd1796a){logger[_0xdfb3('0xb')](_0xdfb3('0x1d'),_0xb97b14);logger['debug'](_0xdfb3('0x1d'),_0xb97b14,JSON[_0xdfb3('0xe')](_0xd1796a));_0x3a28c8(_0xd1796a);})['catch'](function(_0xba7570){logger[_0xdfb3('0xf')](_0xdfb3('0x1d'),_0xba7570['message'],_0xb97b14);_0x3e713d(_0x3a271f[_0xdfb3('0xf')](0x1f4,_0xba7570[_0xdfb3('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index a793fcb..e4f01ca 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 _0x7354=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getSubjects','/:id/descriptions','getTags','post','create','/:id/tags','setTags','put','/:id','update','destroy','util','path'];(function(_0x561624,_0xd9fe6c){var _0x456e4f=function(_0x3da39b){while(--_0x3da39b){_0x561624['push'](_0x561624['shift']());}};_0x456e4f(++_0xd9fe6c);}(_0x7354,0x1c6));var _0x4735=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0x7354[_0x34d275];return _0x1379cc;};'use strict';var multer=require('multer');var util=require(_0x4735('0x0'));var path=require(_0x4735('0x1'));var timeout=require(_0x4735('0x2'));var express=require('express');var router=express[_0x4735('0x3')]();var fs_extra=require(_0x4735('0x4'));var auth=require(_0x4735('0x5'));var interaction=require(_0x4735('0x6'));var config=require(_0x4735('0x7'));var controller=require(_0x4735('0x8'));router[_0x4735('0x9')]('/',auth[_0x4735('0xa')](),controller[_0x4735('0xb')]);router[_0x4735('0x9')]('/:id',auth[_0x4735('0xa')](),controller['show']);router[_0x4735('0x9')](_0x4735('0xc'),auth[_0x4735('0xa')](),controller['getFields']);router[_0x4735('0x9')]('/:id/subjects',auth[_0x4735('0xa')](),controller[_0x4735('0xd')]);router['get'](_0x4735('0xe'),auth[_0x4735('0xa')](),controller['getDescriptions']);router[_0x4735('0x9')]('/:id/tags',auth[_0x4735('0xa')](),controller[_0x4735('0xf')]);router[_0x4735('0x10')]('/',auth[_0x4735('0xa')](),controller[_0x4735('0x11')]);router[_0x4735('0x10')](_0x4735('0x12'),auth[_0x4735('0xa')](),controller[_0x4735('0x13')]);router[_0x4735('0x14')](_0x4735('0x15'),auth['isAuthenticated'](),controller[_0x4735('0x16')]);router['delete'](_0x4735('0x15'),auth[_0x4735('0xa')](),controller[_0x4735('0x17')]);module['exports']=router; \ No newline at end of file +var _0x1d38=['/:id/tags','setTags','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','getTags','create'];(function(_0x4b1032,_0x36952e){var _0x5a1d55=function(_0x282e9b){while(--_0x282e9b){_0x4b1032['push'](_0x4b1032['shift']());}};_0x5a1d55(++_0x36952e);}(_0x1d38,0x1f4));var _0x81d3=function(_0x256540,_0x322726){_0x256540=_0x256540-0x0;var _0x31bec9=_0x1d38[_0x256540];return _0x31bec9;};'use strict';var multer=require(_0x81d3('0x0'));var util=require(_0x81d3('0x1'));var path=require(_0x81d3('0x2'));var timeout=require(_0x81d3('0x3'));var express=require(_0x81d3('0x4'));var router=express[_0x81d3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x81d3('0x6'));var interaction=require(_0x81d3('0x7'));var config=require(_0x81d3('0x8'));var controller=require(_0x81d3('0x9'));router[_0x81d3('0xa')]('/',auth[_0x81d3('0xb')](),controller['index']);router['get'](_0x81d3('0xc'),auth['isAuthenticated'](),controller[_0x81d3('0xd')]);router[_0x81d3('0xa')](_0x81d3('0xe'),auth[_0x81d3('0xb')](),controller[_0x81d3('0xf')]);router[_0x81d3('0xa')](_0x81d3('0x10'),auth[_0x81d3('0xb')](),controller['getSubjects']);router[_0x81d3('0xa')]('/:id/descriptions',auth[_0x81d3('0xb')](),controller[_0x81d3('0x11')]);router['get']('/:id/tags',auth[_0x81d3('0xb')](),controller[_0x81d3('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x81d3('0x13')]);router['post'](_0x81d3('0x14'),auth['isAuthenticated'](),controller[_0x81d3('0x15')]);router['put'](_0x81d3('0xc'),auth['isAuthenticated'](),controller[_0x81d3('0x16')]);router[_0x81d3('0x17')](_0x81d3('0xc'),auth[_0x81d3('0xb')](),controller[_0x81d3('0x18')]);module[_0x81d3('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index a69aab5..b845f5e 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 _0x11bc=['sequelize','exports','STRING'];(function(_0x393881,_0x5d3b84){var _0xc53331=function(_0x585212){while(--_0x585212){_0x393881['push'](_0x393881['shift']());}};_0xc53331(++_0x5d3b84);}(_0x11bc,0x12c));var _0xc11b=function(_0x3d77a0,_0x3248e9){_0x3d77a0=_0x3d77a0-0x0;var _0x1af99f=_0x11bc[_0x3d77a0];return _0x1af99f;};'use strict';var Sequelize=require(_0xc11b('0x0'));module[_0xc11b('0x1')]={'name':{'type':Sequelize[_0xc11b('0x2')]},'description':{'type':Sequelize[_0xc11b('0x2')]}}; \ No newline at end of file +var _0xc790=['STRING','exports'];(function(_0x2e84e5,_0x11c0e9){var _0x281a09=function(_0x5b4dd2){while(--_0x5b4dd2){_0x2e84e5['push'](_0x2e84e5['shift']());}};_0x281a09(++_0x11c0e9);}(_0xc790,0x6b));var _0x0c79=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xc790[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require('sequelize');module[_0x0c79('0x0')]={'name':{'type':Sequelize[_0x0c79('0x1')]},'description':{'type':Sequelize[_0x0c79('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index b08de8d..b8e258b 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 _0xbf68=['rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','FreshdeskConfiguration','findAll','catch','params','find','create','body','getFields','findOne','keys','filter','getSubjects','FreshdeskField','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','map'];(function(_0x4a0fab,_0x10b280){var _0x54da35=function(_0x2b3f56){while(--_0x2b3f56){_0x4a0fab['push'](_0x4a0fab['shift']());}};_0x54da35(++_0x10b280);}(_0xbf68,0x76));var _0x8bf6=function(_0x2b515d,_0x4edaed){_0x2b515d=_0x2b515d-0x0;var _0x56e0ba=_0xbf68[_0x2b515d];return _0x56e0ba;};'use strict';var emlformat=require(_0x8bf6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8bf6('0x1'));var jsonpatch=require(_0x8bf6('0x2'));var rp=require('request-promise');var moment=require(_0x8bf6('0x3'));var BPromise=require(_0x8bf6('0x4'));var Mustache=require(_0x8bf6('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8bf6('0x6'));var csv=require('to-csv');var ejs=require(_0x8bf6('0x7'));var fs=require('fs');var fs_extra=require(_0x8bf6('0x8'));var _=require(_0x8bf6('0x9'));var squel=require(_0x8bf6('0xa'));var crypto=require(_0x8bf6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8bf6('0xc'));var toCsv=require(_0x8bf6('0xd'));var querystring=require('querystring');var Papa=require(_0x8bf6('0xe'));var Redis=require(_0x8bf6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8bf6('0x10'));var as=require(_0x8bf6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8bf6('0x12'));var config=require(_0x8bf6('0x13'));var licenseUtil=require(_0x8bf6('0x14'));var db=require(_0x8bf6('0x15'))['db'];function respondWithStatusCode(_0x16fa5d,_0x18cb42){_0x18cb42=_0x18cb42||0xcc;return function(_0x134fcb){if(_0x134fcb){return _0x16fa5d[_0x8bf6('0x16')](_0x18cb42);}return _0x16fa5d[_0x8bf6('0x17')](_0x18cb42)[_0x8bf6('0x18')]();};}function respondWithResult(_0xe9e500,_0x1d9dda){_0x1d9dda=_0x1d9dda||0xc8;return function(_0x20b8cd){if(_0x20b8cd){return _0xe9e500[_0x8bf6('0x17')](_0x1d9dda)['json'](_0x20b8cd);}};}function respondWithFilteredResult(_0x54ac14,_0x199e2c){return function(_0x52cad){if(_0x52cad){var _0xdc506=typeof _0x199e2c['offset']===_0x8bf6('0x19')&&typeof _0x199e2c[_0x8bf6('0x1a')]===_0x8bf6('0x19');var _0x344fbf=_0x52cad[_0x8bf6('0x1b')];var _0x452b43=_0xdc506?0x0:_0x199e2c[_0x8bf6('0x1c')];var _0x495eba=_0xdc506?_0x52cad[_0x8bf6('0x1b')]:_0x199e2c[_0x8bf6('0x1c')]+_0x199e2c['limit'];var _0x1523d8;if(_0x495eba>=_0x344fbf){_0x495eba=_0x344fbf;_0x1523d8=0xc8;}else{_0x1523d8=0xce;}_0x54ac14[_0x8bf6('0x17')](_0x1523d8);return _0x54ac14[_0x8bf6('0x1d')](_0x8bf6('0x1e'),_0x452b43+'-'+_0x495eba+'/'+_0x344fbf)[_0x8bf6('0x1f')](_0x52cad);}return null;};}function patchUpdates(_0x290512){return function(_0x31a18c){try{jsonpatch['apply'](_0x31a18c,_0x290512,!![]);}catch(_0xbd314b){return BPromise[_0x8bf6('0x20')](_0xbd314b);}return _0x31a18c[_0x8bf6('0x21')]();};}function saveUpdates(_0x27b076,_0x2709bf){return function(_0x412903){if(_0x412903){return _0x412903[_0x8bf6('0x22')](_0x27b076)[_0x8bf6('0x23')](function(_0x283eb2){return _0x283eb2;});}return null;};}function removeEntity(_0x3cee69,_0x53f2ca){return function(_0x2dcd9d){if(_0x2dcd9d){return _0x2dcd9d[_0x8bf6('0x24')]()[_0x8bf6('0x23')](function(){_0x3cee69['status'](0xcc)[_0x8bf6('0x18')]();});}};}function handleEntityNotFound(_0x4bec1e,_0x29a281){return function(_0x5328d2){if(!_0x5328d2){_0x4bec1e[_0x8bf6('0x16')](0x194);}return _0x5328d2;};}function handleError(_0x110a24,_0x7bc516){_0x7bc516=_0x7bc516||0x1f4;return function(_0x1b384e){logger[_0x8bf6('0x25')](_0x1b384e[_0x8bf6('0x26')]);if(_0x1b384e['name']){delete _0x1b384e[_0x8bf6('0x27')];}_0x110a24[_0x8bf6('0x17')](_0x7bc516)[_0x8bf6('0x28')](_0x1b384e);};}exports['index']=function(_0xb71212,_0x152836){var _0x4f42b8={},_0x132fe1={},_0x4df789={'count':0x0,'rows':[]};var _0x1512dd=_[_0x8bf6('0x29')](db['FreshdeskConfiguration'][_0x8bf6('0x2a')],function(_0x5beb87){return{'name':_0x5beb87[_0x8bf6('0x2b')],'type':_0x5beb87[_0x8bf6('0x2c')]['key']};});_0x132fe1['model']=_[_0x8bf6('0x29')](_0x1512dd,_0x8bf6('0x27'));_0x132fe1[_0x8bf6('0x2d')]=_['keys'](_0xb71212['query']);_0x132fe1[_0x8bf6('0x2e')]=_[_0x8bf6('0x2f')](_0x132fe1[_0x8bf6('0x30')],_0x132fe1[_0x8bf6('0x2d')]);_0x4f42b8['attributes']=_['intersection'](_0x132fe1[_0x8bf6('0x30')],qs[_0x8bf6('0x31')](_0xb71212[_0x8bf6('0x2d')][_0x8bf6('0x31')]));_0x4f42b8[_0x8bf6('0x32')]=_0x4f42b8['attributes'][_0x8bf6('0x33')]?_0x4f42b8[_0x8bf6('0x32')]:_0x132fe1['model'];if(!_0xb71212[_0x8bf6('0x2d')][_0x8bf6('0x34')](_0x8bf6('0x35'))){_0x4f42b8[_0x8bf6('0x1a')]=qs[_0x8bf6('0x1a')](_0xb71212[_0x8bf6('0x2d')][_0x8bf6('0x1a')]);_0x4f42b8[_0x8bf6('0x1c')]=qs[_0x8bf6('0x1c')](_0xb71212[_0x8bf6('0x2d')][_0x8bf6('0x1c')]);}_0x4f42b8[_0x8bf6('0x36')]=qs[_0x8bf6('0x37')](_0xb71212[_0x8bf6('0x2d')][_0x8bf6('0x37')]);_0x4f42b8[_0x8bf6('0x38')]=qs[_0x8bf6('0x2e')](_[_0x8bf6('0x39')](_0xb71212[_0x8bf6('0x2d')],_0x132fe1[_0x8bf6('0x2e')]),_0x1512dd);if(_0xb71212['query']['filter']){_0x4f42b8[_0x8bf6('0x38')]=_['merge'](_0x4f42b8[_0x8bf6('0x38')],{'$or':_[_0x8bf6('0x29')](_0x1512dd,function(_0x4ef2d8){if(_0x4ef2d8[_0x8bf6('0x2c')]!==_0x8bf6('0x3a')){var _0x382440={};_0x382440[_0x4ef2d8[_0x8bf6('0x27')]]={'$like':'%'+_0xb71212[_0x8bf6('0x2d')]['filter']+'%'};return _0x382440;}})});}_0x4f42b8=_[_0x8bf6('0x3b')]({},_0x4f42b8,_0xb71212[_0x8bf6('0x3c')]);var _0x5c78fb={'where':_0x4f42b8['where']};return db['FreshdeskConfiguration'][_0x8bf6('0x1b')](_0x5c78fb)[_0x8bf6('0x23')](function(_0x497ff1){_0x4df789['count']=_0x497ff1;if(_0xb71212[_0x8bf6('0x2d')][_0x8bf6('0x3d')]){_0x4f42b8[_0x8bf6('0x3e')]=[{'all':!![]}];}return db[_0x8bf6('0x3f')][_0x8bf6('0x40')](_0x4f42b8);})[_0x8bf6('0x23')](function(_0x2f5326){_0x4df789['rows']=_0x2f5326;return _0x4df789;})[_0x8bf6('0x23')](respondWithFilteredResult(_0x152836,_0x4f42b8))[_0x8bf6('0x41')](handleError(_0x152836,null));};exports['show']=function(_0x52cf51,_0x280969){var _0x5efe90={'raw':![],'where':{'id':_0x52cf51[_0x8bf6('0x42')]['id']}},_0x108ca0={};_0x108ca0[_0x8bf6('0x30')]=_['keys'](db[_0x8bf6('0x3f')][_0x8bf6('0x2a')]);_0x108ca0['query']=_['keys'](_0x52cf51[_0x8bf6('0x2d')]);_0x108ca0['filters']=_[_0x8bf6('0x2f')](_0x108ca0[_0x8bf6('0x30')],_0x108ca0[_0x8bf6('0x2d')]);_0x5efe90[_0x8bf6('0x32')]=_[_0x8bf6('0x2f')](_0x108ca0[_0x8bf6('0x30')],qs[_0x8bf6('0x31')](_0x52cf51[_0x8bf6('0x2d')]['fields']));_0x5efe90[_0x8bf6('0x32')]=_0x5efe90[_0x8bf6('0x32')][_0x8bf6('0x33')]?_0x5efe90[_0x8bf6('0x32')]:_0x108ca0[_0x8bf6('0x30')];if(_0x52cf51[_0x8bf6('0x2d')][_0x8bf6('0x3d')]){_0x5efe90['include']=[{'all':!![]}];}_0x5efe90=_['merge']({},_0x5efe90,_0x52cf51[_0x8bf6('0x3c')]);return db[_0x8bf6('0x3f')][_0x8bf6('0x43')](_0x5efe90)[_0x8bf6('0x23')](handleEntityNotFound(_0x280969,null))['then'](respondWithResult(_0x280969,null))[_0x8bf6('0x41')](handleError(_0x280969,null));};exports['create']=function(_0x448cfd,_0x29c172){return db['FreshdeskConfiguration'][_0x8bf6('0x44')](_0x448cfd[_0x8bf6('0x45')],{})['then'](respondWithResult(_0x29c172,0xc9))[_0x8bf6('0x41')](handleError(_0x29c172,null));};exports['update']=function(_0x391487,_0x579da8){if(_0x391487[_0x8bf6('0x45')]['id']){delete _0x391487[_0x8bf6('0x45')]['id'];}return db['FreshdeskConfiguration'][_0x8bf6('0x43')]({'where':{'id':_0x391487[_0x8bf6('0x42')]['id']}})[_0x8bf6('0x23')](handleEntityNotFound(_0x579da8,null))['then'](saveUpdates(_0x391487[_0x8bf6('0x45')],null))[_0x8bf6('0x23')](respondWithResult(_0x579da8,null))[_0x8bf6('0x41')](handleError(_0x579da8,null));};exports[_0x8bf6('0x24')]=function(_0x1b8791,_0x3c794f){return db[_0x8bf6('0x3f')][_0x8bf6('0x43')]({'where':{'id':_0x1b8791['params']['id']}})[_0x8bf6('0x23')](handleEntityNotFound(_0x3c794f,null))[_0x8bf6('0x23')](removeEntity(_0x3c794f,null))[_0x8bf6('0x41')](handleError(_0x3c794f,null));};exports[_0x8bf6('0x46')]=function(_0x23da75,_0x366316,_0x3fbdfa){var _0x245aa7={};var _0x521ec0={};var _0x24359f;var _0x1241ad;return db[_0x8bf6('0x3f')][_0x8bf6('0x47')]({'where':{'id':_0x23da75['params']['id']}})[_0x8bf6('0x23')](handleEntityNotFound(_0x366316,null))[_0x8bf6('0x23')](function(_0x13a3d1){if(_0x13a3d1){_0x24359f=_0x13a3d1;_0x521ec0[_0x8bf6('0x30')]=_[_0x8bf6('0x48')](db['FreshdeskField'][_0x8bf6('0x2a')]);_0x521ec0[_0x8bf6('0x2d')]=_[_0x8bf6('0x48')](_0x23da75[_0x8bf6('0x2d')]);_0x521ec0[_0x8bf6('0x2e')]=_['intersection'](_0x521ec0[_0x8bf6('0x30')],_0x521ec0[_0x8bf6('0x2d')]);_0x245aa7[_0x8bf6('0x32')]=_['intersection'](_0x521ec0['model'],qs['fields'](_0x23da75[_0x8bf6('0x2d')][_0x8bf6('0x31')]));_0x245aa7[_0x8bf6('0x32')]=_0x245aa7['attributes'][_0x8bf6('0x33')]?_0x245aa7[_0x8bf6('0x32')]:_0x521ec0['model'];_0x245aa7[_0x8bf6('0x36')]=qs[_0x8bf6('0x37')](_0x23da75[_0x8bf6('0x2d')][_0x8bf6('0x37')]);_0x245aa7[_0x8bf6('0x38')]=qs['filters'](_['pick'](_0x23da75[_0x8bf6('0x2d')],_0x521ec0[_0x8bf6('0x2e')]));if(_0x23da75['query'][_0x8bf6('0x49')]){_0x245aa7[_0x8bf6('0x38')]=_[_0x8bf6('0x3b')](_0x245aa7[_0x8bf6('0x38')],{'$or':_['map'](_0x245aa7[_0x8bf6('0x32')],function(_0x8098dd){var _0x1d7e2e={};_0x1d7e2e[_0x8098dd]={'$like':'%'+_0x23da75[_0x8bf6('0x2d')][_0x8bf6('0x49')]+'%'};return _0x1d7e2e;})});}_0x245aa7=_[_0x8bf6('0x3b')]({},_0x245aa7,_0x23da75[_0x8bf6('0x3c')]);return _0x24359f[_0x8bf6('0x46')](_0x245aa7);}})[_0x8bf6('0x23')](function(_0x541eff){if(_0x541eff){_0x1241ad=_0x541eff['length'];if(!_0x23da75[_0x8bf6('0x2d')][_0x8bf6('0x34')]('nolimit')){_0x245aa7[_0x8bf6('0x1a')]=qs[_0x8bf6('0x1a')](_0x23da75['query'][_0x8bf6('0x1a')]);_0x245aa7[_0x8bf6('0x1c')]=qs['offset'](_0x23da75[_0x8bf6('0x2d')][_0x8bf6('0x1c')]);}return _0x24359f[_0x8bf6('0x46')](_0x245aa7);}})[_0x8bf6('0x23')](function(_0x59b812){if(_0x59b812){return _0x59b812?{'count':_0x1241ad,'rows':_0x59b812}:null;}})[_0x8bf6('0x23')](respondWithResult(_0x366316,null))['catch'](handleError(_0x366316,null));};exports[_0x8bf6('0x4a')]=function(_0x1b59d1,_0x541ebf,_0xac70f){var _0x27414f={};var _0x35d93d={};var _0x2ce386;var _0x5087b9;return db[_0x8bf6('0x3f')]['findOne']({'where':{'id':_0x1b59d1[_0x8bf6('0x42')]['id']}})[_0x8bf6('0x23')](handleEntityNotFound(_0x541ebf,null))['then'](function(_0x5cf28d){if(_0x5cf28d){_0x2ce386=_0x5cf28d;_0x35d93d[_0x8bf6('0x30')]=_[_0x8bf6('0x48')](db[_0x8bf6('0x4b')][_0x8bf6('0x2a')]);_0x35d93d[_0x8bf6('0x2d')]=_[_0x8bf6('0x48')](_0x1b59d1['query']);_0x35d93d[_0x8bf6('0x2e')]=_[_0x8bf6('0x2f')](_0x35d93d[_0x8bf6('0x30')],_0x35d93d[_0x8bf6('0x2d')]);_0x27414f['attributes']=_[_0x8bf6('0x2f')](_0x35d93d[_0x8bf6('0x30')],qs[_0x8bf6('0x31')](_0x1b59d1[_0x8bf6('0x2d')][_0x8bf6('0x31')]));_0x27414f[_0x8bf6('0x32')]=_0x27414f[_0x8bf6('0x32')][_0x8bf6('0x33')]?_0x27414f[_0x8bf6('0x32')]:_0x35d93d['model'];_0x27414f[_0x8bf6('0x36')]=qs[_0x8bf6('0x37')](_0x1b59d1[_0x8bf6('0x2d')][_0x8bf6('0x37')]);_0x27414f[_0x8bf6('0x38')]=qs[_0x8bf6('0x2e')](_[_0x8bf6('0x39')](_0x1b59d1['query'],_0x35d93d[_0x8bf6('0x2e')]));if(_0x1b59d1[_0x8bf6('0x2d')]['filter']){_0x27414f[_0x8bf6('0x38')]=_[_0x8bf6('0x3b')](_0x27414f['where'],{'$or':_['map'](_0x27414f['attributes'],function(_0x44be34){var _0x4c4e30={};_0x4c4e30[_0x44be34]={'$like':'%'+_0x1b59d1[_0x8bf6('0x2d')][_0x8bf6('0x49')]+'%'};return _0x4c4e30;})});}_0x27414f=_['merge']({},_0x27414f,_0x1b59d1['options']);return _0x2ce386[_0x8bf6('0x4a')](_0x27414f);}})['then'](function(_0x5991f1){if(_0x5991f1){_0x5087b9=_0x5991f1[_0x8bf6('0x33')];if(!_0x1b59d1[_0x8bf6('0x2d')][_0x8bf6('0x34')](_0x8bf6('0x35'))){_0x27414f['limit']=qs['limit'](_0x1b59d1[_0x8bf6('0x2d')][_0x8bf6('0x1a')]);_0x27414f[_0x8bf6('0x1c')]=qs[_0x8bf6('0x1c')](_0x1b59d1['query']['offset']);}return _0x2ce386['getSubjects'](_0x27414f);}})[_0x8bf6('0x23')](function(_0x1fddde){if(_0x1fddde){return _0x1fddde?{'count':_0x5087b9,'rows':_0x1fddde}:null;}})[_0x8bf6('0x23')](respondWithResult(_0x541ebf,null))[_0x8bf6('0x41')](handleError(_0x541ebf,null));};exports[_0x8bf6('0x4c')]=function(_0x2ddf81,_0x1fbb4c,_0x8cd25d){var _0x3c886d={};var _0x1cacf0={};var _0x15e7b7;var _0x3b6a40;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x2ddf81[_0x8bf6('0x42')]['id']}})[_0x8bf6('0x23')](handleEntityNotFound(_0x1fbb4c,null))[_0x8bf6('0x23')](function(_0x3fa5d6){if(_0x3fa5d6){_0x15e7b7=_0x3fa5d6;_0x1cacf0[_0x8bf6('0x30')]=_[_0x8bf6('0x48')](db[_0x8bf6('0x4b')][_0x8bf6('0x2a')]);_0x1cacf0[_0x8bf6('0x2d')]=_[_0x8bf6('0x48')](_0x2ddf81[_0x8bf6('0x2d')]);_0x1cacf0['filters']=_[_0x8bf6('0x2f')](_0x1cacf0['model'],_0x1cacf0[_0x8bf6('0x2d')]);_0x3c886d['attributes']=_[_0x8bf6('0x2f')](_0x1cacf0[_0x8bf6('0x30')],qs[_0x8bf6('0x31')](_0x2ddf81[_0x8bf6('0x2d')][_0x8bf6('0x31')]));_0x3c886d[_0x8bf6('0x32')]=_0x3c886d['attributes'][_0x8bf6('0x33')]?_0x3c886d[_0x8bf6('0x32')]:_0x1cacf0['model'];_0x3c886d[_0x8bf6('0x36')]=qs[_0x8bf6('0x37')](_0x2ddf81[_0x8bf6('0x2d')][_0x8bf6('0x37')]);_0x3c886d[_0x8bf6('0x38')]=qs[_0x8bf6('0x2e')](_['pick'](_0x2ddf81[_0x8bf6('0x2d')],_0x1cacf0[_0x8bf6('0x2e')]));if(_0x2ddf81[_0x8bf6('0x2d')][_0x8bf6('0x49')]){_0x3c886d[_0x8bf6('0x38')]=_[_0x8bf6('0x3b')](_0x3c886d['where'],{'$or':_['map'](_0x3c886d['attributes'],function(_0x2f4fa3){var _0x1450d3={};_0x1450d3[_0x2f4fa3]={'$like':'%'+_0x2ddf81[_0x8bf6('0x2d')]['filter']+'%'};return _0x1450d3;})});}_0x3c886d=_['merge']({},_0x3c886d,_0x2ddf81[_0x8bf6('0x3c')]);return _0x15e7b7[_0x8bf6('0x4c')](_0x3c886d);}})[_0x8bf6('0x23')](function(_0x4d0c55){if(_0x4d0c55){_0x3b6a40=_0x4d0c55[_0x8bf6('0x33')];if(!_0x2ddf81[_0x8bf6('0x2d')][_0x8bf6('0x34')](_0x8bf6('0x35'))){_0x3c886d[_0x8bf6('0x1a')]=qs[_0x8bf6('0x1a')](_0x2ddf81[_0x8bf6('0x2d')][_0x8bf6('0x1a')]);_0x3c886d[_0x8bf6('0x1c')]=qs[_0x8bf6('0x1c')](_0x2ddf81['query']['offset']);}return _0x15e7b7[_0x8bf6('0x4c')](_0x3c886d);}})[_0x8bf6('0x23')](function(_0x488213){if(_0x488213){return _0x488213?{'count':_0x3b6a40,'rows':_0x488213}:null;}})[_0x8bf6('0x23')](respondWithResult(_0x1fbb4c,null))['catch'](handleError(_0x1fbb4c,null));};exports[_0x8bf6('0x4d')]=function(_0x4272a5,_0xb7a60c,_0x26aa30){var _0x389cfa={};var _0x559345={};var _0x109ea4;var _0x3f481c;return db[_0x8bf6('0x3f')]['findOne']({'where':{'id':_0x4272a5[_0x8bf6('0x42')]['id']}})['then'](handleEntityNotFound(_0xb7a60c,null))[_0x8bf6('0x23')](function(_0x225787){if(_0x225787){_0x109ea4=_0x225787;_0x559345[_0x8bf6('0x30')]=_[_0x8bf6('0x48')](db['Tag'][_0x8bf6('0x2a')]);_0x559345['query']=_['keys'](_0x4272a5[_0x8bf6('0x2d')]);_0x559345[_0x8bf6('0x2e')]=_['intersection'](_0x559345[_0x8bf6('0x30')],_0x559345['query']);_0x389cfa['attributes']=_['intersection'](_0x559345[_0x8bf6('0x30')],qs[_0x8bf6('0x31')](_0x4272a5[_0x8bf6('0x2d')][_0x8bf6('0x31')]));_0x389cfa[_0x8bf6('0x32')]=_0x389cfa['attributes'][_0x8bf6('0x33')]?_0x389cfa[_0x8bf6('0x32')]:_0x559345['model'];_0x389cfa[_0x8bf6('0x36')]=qs['sort'](_0x4272a5['query'][_0x8bf6('0x37')]);_0x389cfa['where']=qs['filters'](_['pick'](_0x4272a5[_0x8bf6('0x2d')],_0x559345[_0x8bf6('0x2e')]));if(_0x4272a5[_0x8bf6('0x2d')][_0x8bf6('0x49')]){_0x389cfa[_0x8bf6('0x38')]=_[_0x8bf6('0x3b')](_0x389cfa[_0x8bf6('0x38')],{'$or':_['map'](_0x389cfa[_0x8bf6('0x32')],function(_0x1978cc){var _0x3e7e83={};_0x3e7e83[_0x1978cc]={'$like':'%'+_0x4272a5[_0x8bf6('0x2d')]['filter']+'%'};return _0x3e7e83;})});}_0x389cfa=_[_0x8bf6('0x3b')]({},_0x389cfa,_0x4272a5[_0x8bf6('0x3c')]);return _0x109ea4[_0x8bf6('0x4d')](_0x389cfa);}})['then'](function(_0x460540){if(_0x460540){_0x3f481c=_0x460540[_0x8bf6('0x33')];if(!_0x4272a5['query']['hasOwnProperty']('nolimit')){_0x389cfa['limit']=qs[_0x8bf6('0x1a')](_0x4272a5[_0x8bf6('0x2d')]['limit']);_0x389cfa[_0x8bf6('0x1c')]=qs[_0x8bf6('0x1c')](_0x4272a5['query'][_0x8bf6('0x1c')]);}return _0x109ea4[_0x8bf6('0x4d')](_0x389cfa);}})[_0x8bf6('0x23')](function(_0x565e4a){if(_0x565e4a){return _0x565e4a?{'count':_0x3f481c,'rows':_0x565e4a}:null;}})[_0x8bf6('0x23')](respondWithResult(_0xb7a60c,null))['catch'](handleError(_0xb7a60c,null));};exports[_0x8bf6('0x4e')]=function(_0x59e857,_0x27c0ae,_0x18be1e){if(_0x59e857[_0x8bf6('0x45')]['id']){delete _0x59e857[_0x8bf6('0x45')]['id'];}return db[_0x8bf6('0x3f')][_0x8bf6('0x47')]({'where':{'id':_0x59e857[_0x8bf6('0x42')]['id']}})[_0x8bf6('0x23')](handleEntityNotFound(_0x27c0ae,null))[_0x8bf6('0x23')](function(_0x2d6331){if(_0x2d6331){return _0x2d6331[_0x8bf6('0x4e')](_0x59e857['body'][_0x8bf6('0x4f')]||[]);}return null;})[_0x8bf6('0x23')](respondWithResult(_0x27c0ae,null))[_0x8bf6('0x41')](handleError(_0x27c0ae,null));}; \ No newline at end of file +var _0xa73f=['find','create','body','getFields','findOne','FreshdeskField','sort','options','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','limit','set','apply','save','update','destroy','then','end','error','stack','name','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','where','pick','filter','merge','count','includeAll','include','findAll','catch','show','params'];(function(_0x2099cd,_0x54f7a3){var _0x1f6c9c=function(_0x46e639){while(--_0x46e639){_0x2099cd['push'](_0x2099cd['shift']());}};_0x1f6c9c(++_0x54f7a3);}(_0xa73f,0xb0));var _0xfa73=function(_0x45aea5,_0x369882){_0x45aea5=_0x45aea5-0x0;var _0x115914=_0xa73f[_0x45aea5];return _0x115914;};'use strict';var emlformat=require(_0xfa73('0x0'));var rimraf=require(_0xfa73('0x1'));var zipdir=require(_0xfa73('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa73('0x3'));var moment=require(_0xfa73('0x4'));var BPromise=require(_0xfa73('0x5'));var Mustache=require(_0xfa73('0x6'));var util=require(_0xfa73('0x7'));var path=require(_0xfa73('0x8'));var sox=require(_0xfa73('0x9'));var csv=require('to-csv');var ejs=require(_0xfa73('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfa73('0xb'));var squel=require(_0xfa73('0xc'));var crypto=require(_0xfa73('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfa73('0xe'));var Papa=require(_0xfa73('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfa73('0x10'));var as=require(_0xfa73('0x11'));var hardwareService=require(_0xfa73('0x12'));var logger=require(_0xfa73('0x13'))(_0xfa73('0x14'));var utils=require('../../config/utils');var config=require(_0xfa73('0x15'));var licenseUtil=require(_0xfa73('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e6bff,_0x285ac1){_0x285ac1=_0x285ac1||0xcc;return function(_0x1b30cf){if(_0x1b30cf){return _0x1e6bff[_0xfa73('0x17')](_0x285ac1);}return _0x1e6bff['status'](_0x285ac1)['end']();};}function respondWithResult(_0x25b4b3,_0x33fd4e){_0x33fd4e=_0x33fd4e||0xc8;return function(_0x46ebdd){if(_0x46ebdd){return _0x25b4b3[_0xfa73('0x18')](_0x33fd4e)[_0xfa73('0x19')](_0x46ebdd);}};}function respondWithFilteredResult(_0x38d592,_0x5520f1){return function(_0x465a94){if(_0x465a94){var _0x9f9aef=typeof _0x5520f1['offset']==='undefined'&&typeof _0x5520f1['limit']==='undefined';var _0x19a256=_0x465a94['count'];var _0x377004=_0x9f9aef?0x0:_0x5520f1['offset'];var _0x59a159=_0x9f9aef?_0x465a94['count']:_0x5520f1['offset']+_0x5520f1[_0xfa73('0x1a')];var _0x499d30;if(_0x59a159>=_0x19a256){_0x59a159=_0x19a256;_0x499d30=0xc8;}else{_0x499d30=0xce;}_0x38d592[_0xfa73('0x18')](_0x499d30);return _0x38d592[_0xfa73('0x1b')]('Content-Range',_0x377004+'-'+_0x59a159+'/'+_0x19a256)[_0xfa73('0x19')](_0x465a94);}return null;};}function patchUpdates(_0x160131){return function(_0x3b29ed){try{jsonpatch[_0xfa73('0x1c')](_0x3b29ed,_0x160131,!![]);}catch(_0x408448){return BPromise['reject'](_0x408448);}return _0x3b29ed[_0xfa73('0x1d')]();};}function saveUpdates(_0x2bd334,_0x2e6147){return function(_0x1f2caa){if(_0x1f2caa){return _0x1f2caa[_0xfa73('0x1e')](_0x2bd334)['then'](function(_0x2a9803){return _0x2a9803;});}return null;};}function removeEntity(_0x4ff9fe,_0x46f50f){return function(_0x3d023a){if(_0x3d023a){return _0x3d023a[_0xfa73('0x1f')]()[_0xfa73('0x20')](function(){_0x4ff9fe[_0xfa73('0x18')](0xcc)[_0xfa73('0x21')]();});}};}function handleEntityNotFound(_0x4afa71,_0x31a7f9){return function(_0xdd5934){if(!_0xdd5934){_0x4afa71[_0xfa73('0x17')](0x194);}return _0xdd5934;};}function handleError(_0x5402bb,_0x229ce3){_0x229ce3=_0x229ce3||0x1f4;return function(_0x42c6b1){logger[_0xfa73('0x22')](_0x42c6b1[_0xfa73('0x23')]);if(_0x42c6b1['name']){delete _0x42c6b1[_0xfa73('0x24')];}_0x5402bb[_0xfa73('0x18')](_0x229ce3)['send'](_0x42c6b1);};}exports[_0xfa73('0x25')]=function(_0x3b14d2,_0x275c4a){var _0x21d5f9={},_0x5d678b={},_0x10a523={'count':0x0,'rows':[]};var _0x2381a5=_[_0xfa73('0x26')](db[_0xfa73('0x27')][_0xfa73('0x28')],function(_0x111f11){return{'name':_0x111f11[_0xfa73('0x29')],'type':_0x111f11[_0xfa73('0x2a')][_0xfa73('0x2b')]};});_0x5d678b[_0xfa73('0x2c')]=_[_0xfa73('0x26')](_0x2381a5,_0xfa73('0x24'));_0x5d678b[_0xfa73('0x2d')]=_[_0xfa73('0x2e')](_0x3b14d2['query']);_0x5d678b[_0xfa73('0x2f')]=_[_0xfa73('0x30')](_0x5d678b[_0xfa73('0x2c')],_0x5d678b[_0xfa73('0x2d')]);_0x21d5f9[_0xfa73('0x31')]=_[_0xfa73('0x30')](_0x5d678b[_0xfa73('0x2c')],qs[_0xfa73('0x32')](_0x3b14d2[_0xfa73('0x2d')][_0xfa73('0x32')]));_0x21d5f9[_0xfa73('0x31')]=_0x21d5f9['attributes'][_0xfa73('0x33')]?_0x21d5f9['attributes']:_0x5d678b['model'];if(!_0x3b14d2['query'][_0xfa73('0x34')](_0xfa73('0x35'))){_0x21d5f9[_0xfa73('0x1a')]=qs[_0xfa73('0x1a')](_0x3b14d2[_0xfa73('0x2d')]['limit']);_0x21d5f9[_0xfa73('0x36')]=qs[_0xfa73('0x36')](_0x3b14d2[_0xfa73('0x2d')][_0xfa73('0x36')]);}_0x21d5f9[_0xfa73('0x37')]=qs['sort'](_0x3b14d2[_0xfa73('0x2d')]['sort']);_0x21d5f9[_0xfa73('0x38')]=qs['filters'](_[_0xfa73('0x39')](_0x3b14d2[_0xfa73('0x2d')],_0x5d678b[_0xfa73('0x2f')]),_0x2381a5);if(_0x3b14d2[_0xfa73('0x2d')][_0xfa73('0x3a')]){_0x21d5f9[_0xfa73('0x38')]=_[_0xfa73('0x3b')](_0x21d5f9[_0xfa73('0x38')],{'$or':_[_0xfa73('0x26')](_0x2381a5,function(_0x1ba0ff){if(_0x1ba0ff[_0xfa73('0x2a')]!=='VIRTUAL'){var _0x4ee73d={};_0x4ee73d[_0x1ba0ff[_0xfa73('0x24')]]={'$like':'%'+_0x3b14d2[_0xfa73('0x2d')][_0xfa73('0x3a')]+'%'};return _0x4ee73d;}})});}_0x21d5f9=_[_0xfa73('0x3b')]({},_0x21d5f9,_0x3b14d2['options']);var _0x24e90b={'where':_0x21d5f9[_0xfa73('0x38')]};return db[_0xfa73('0x27')][_0xfa73('0x3c')](_0x24e90b)[_0xfa73('0x20')](function(_0x1c5313){_0x10a523['count']=_0x1c5313;if(_0x3b14d2[_0xfa73('0x2d')][_0xfa73('0x3d')]){_0x21d5f9[_0xfa73('0x3e')]=[{'all':!![]}];}return db[_0xfa73('0x27')][_0xfa73('0x3f')](_0x21d5f9);})[_0xfa73('0x20')](function(_0x55ee22){_0x10a523['rows']=_0x55ee22;return _0x10a523;})[_0xfa73('0x20')](respondWithFilteredResult(_0x275c4a,_0x21d5f9))[_0xfa73('0x40')](handleError(_0x275c4a,null));};exports[_0xfa73('0x41')]=function(_0x17aada,_0x530714){var _0xc2860a={'raw':![],'where':{'id':_0x17aada[_0xfa73('0x42')]['id']}},_0xaab43={};_0xaab43[_0xfa73('0x2c')]=_['keys'](db[_0xfa73('0x27')]['rawAttributes']);_0xaab43['query']=_['keys'](_0x17aada['query']);_0xaab43['filters']=_[_0xfa73('0x30')](_0xaab43[_0xfa73('0x2c')],_0xaab43[_0xfa73('0x2d')]);_0xc2860a[_0xfa73('0x31')]=_[_0xfa73('0x30')](_0xaab43[_0xfa73('0x2c')],qs[_0xfa73('0x32')](_0x17aada[_0xfa73('0x2d')][_0xfa73('0x32')]));_0xc2860a[_0xfa73('0x31')]=_0xc2860a[_0xfa73('0x31')]['length']?_0xc2860a[_0xfa73('0x31')]:_0xaab43['model'];if(_0x17aada[_0xfa73('0x2d')][_0xfa73('0x3d')]){_0xc2860a[_0xfa73('0x3e')]=[{'all':!![]}];}_0xc2860a=_[_0xfa73('0x3b')]({},_0xc2860a,_0x17aada['options']);return db[_0xfa73('0x27')][_0xfa73('0x43')](_0xc2860a)[_0xfa73('0x20')](handleEntityNotFound(_0x530714,null))[_0xfa73('0x20')](respondWithResult(_0x530714,null))[_0xfa73('0x40')](handleError(_0x530714,null));};exports['create']=function(_0x1e099a,_0x23a00e){return db[_0xfa73('0x27')][_0xfa73('0x44')](_0x1e099a[_0xfa73('0x45')],{})[_0xfa73('0x20')](respondWithResult(_0x23a00e,0xc9))[_0xfa73('0x40')](handleError(_0x23a00e,null));};exports['update']=function(_0x571778,_0x1895ff){if(_0x571778[_0xfa73('0x45')]['id']){delete _0x571778[_0xfa73('0x45')]['id'];}return db['FreshdeskConfiguration'][_0xfa73('0x43')]({'where':{'id':_0x571778['params']['id']}})[_0xfa73('0x20')](handleEntityNotFound(_0x1895ff,null))[_0xfa73('0x20')](saveUpdates(_0x571778[_0xfa73('0x45')],null))[_0xfa73('0x20')](respondWithResult(_0x1895ff,null))['catch'](handleError(_0x1895ff,null));};exports[_0xfa73('0x1f')]=function(_0xb17324,_0x29788d){return db[_0xfa73('0x27')][_0xfa73('0x43')]({'where':{'id':_0xb17324[_0xfa73('0x42')]['id']}})[_0xfa73('0x20')](handleEntityNotFound(_0x29788d,null))[_0xfa73('0x20')](removeEntity(_0x29788d,null))[_0xfa73('0x40')](handleError(_0x29788d,null));};exports[_0xfa73('0x46')]=function(_0x37163b,_0x5dfec8,_0xbd3431){var _0x34caa6={};var _0x392b60={};var _0x36584b;var _0x48c2fb;return db[_0xfa73('0x27')][_0xfa73('0x47')]({'where':{'id':_0x37163b[_0xfa73('0x42')]['id']}})[_0xfa73('0x20')](handleEntityNotFound(_0x5dfec8,null))['then'](function(_0x1ee4fb){if(_0x1ee4fb){_0x36584b=_0x1ee4fb;_0x392b60[_0xfa73('0x2c')]=_['keys'](db[_0xfa73('0x48')][_0xfa73('0x28')]);_0x392b60[_0xfa73('0x2d')]=_['keys'](_0x37163b[_0xfa73('0x2d')]);_0x392b60[_0xfa73('0x2f')]=_[_0xfa73('0x30')](_0x392b60[_0xfa73('0x2c')],_0x392b60[_0xfa73('0x2d')]);_0x34caa6[_0xfa73('0x31')]=_[_0xfa73('0x30')](_0x392b60[_0xfa73('0x2c')],qs[_0xfa73('0x32')](_0x37163b[_0xfa73('0x2d')][_0xfa73('0x32')]));_0x34caa6[_0xfa73('0x31')]=_0x34caa6[_0xfa73('0x31')]['length']?_0x34caa6[_0xfa73('0x31')]:_0x392b60[_0xfa73('0x2c')];_0x34caa6[_0xfa73('0x37')]=qs[_0xfa73('0x49')](_0x37163b['query'][_0xfa73('0x49')]);_0x34caa6[_0xfa73('0x38')]=qs[_0xfa73('0x2f')](_[_0xfa73('0x39')](_0x37163b[_0xfa73('0x2d')],_0x392b60[_0xfa73('0x2f')]));if(_0x37163b[_0xfa73('0x2d')][_0xfa73('0x3a')]){_0x34caa6['where']=_[_0xfa73('0x3b')](_0x34caa6[_0xfa73('0x38')],{'$or':_[_0xfa73('0x26')](_0x34caa6['attributes'],function(_0x1cee45){var _0x455a45={};_0x455a45[_0x1cee45]={'$like':'%'+_0x37163b[_0xfa73('0x2d')]['filter']+'%'};return _0x455a45;})});}_0x34caa6=_[_0xfa73('0x3b')]({},_0x34caa6,_0x37163b[_0xfa73('0x4a')]);return _0x36584b['getFields'](_0x34caa6);}})[_0xfa73('0x20')](function(_0x4be75e){if(_0x4be75e){_0x48c2fb=_0x4be75e['length'];if(!_0x37163b[_0xfa73('0x2d')][_0xfa73('0x34')](_0xfa73('0x35'))){_0x34caa6[_0xfa73('0x1a')]=qs[_0xfa73('0x1a')](_0x37163b[_0xfa73('0x2d')][_0xfa73('0x1a')]);_0x34caa6[_0xfa73('0x36')]=qs[_0xfa73('0x36')](_0x37163b['query']['offset']);}return _0x36584b[_0xfa73('0x46')](_0x34caa6);}})['then'](function(_0x3c7c5a){if(_0x3c7c5a){return _0x3c7c5a?{'count':_0x48c2fb,'rows':_0x3c7c5a}:null;}})['then'](respondWithResult(_0x5dfec8,null))[_0xfa73('0x40')](handleError(_0x5dfec8,null));};exports[_0xfa73('0x4b')]=function(_0x40e3be,_0x13864e,_0x45e74a){var _0x3346ce={};var _0x2d3e9a={};var _0x19e5f2;var _0x48fc95;return db[_0xfa73('0x27')][_0xfa73('0x47')]({'where':{'id':_0x40e3be['params']['id']}})[_0xfa73('0x20')](handleEntityNotFound(_0x13864e,null))[_0xfa73('0x20')](function(_0x4eef6e){if(_0x4eef6e){_0x19e5f2=_0x4eef6e;_0x2d3e9a[_0xfa73('0x2c')]=_[_0xfa73('0x2e')](db[_0xfa73('0x48')]['rawAttributes']);_0x2d3e9a[_0xfa73('0x2d')]=_['keys'](_0x40e3be[_0xfa73('0x2d')]);_0x2d3e9a[_0xfa73('0x2f')]=_[_0xfa73('0x30')](_0x2d3e9a[_0xfa73('0x2c')],_0x2d3e9a[_0xfa73('0x2d')]);_0x3346ce[_0xfa73('0x31')]=_[_0xfa73('0x30')](_0x2d3e9a['model'],qs[_0xfa73('0x32')](_0x40e3be[_0xfa73('0x2d')][_0xfa73('0x32')]));_0x3346ce['attributes']=_0x3346ce[_0xfa73('0x31')][_0xfa73('0x33')]?_0x3346ce['attributes']:_0x2d3e9a[_0xfa73('0x2c')];_0x3346ce['order']=qs[_0xfa73('0x49')](_0x40e3be['query']['sort']);_0x3346ce[_0xfa73('0x38')]=qs[_0xfa73('0x2f')](_['pick'](_0x40e3be['query'],_0x2d3e9a[_0xfa73('0x2f')]));if(_0x40e3be[_0xfa73('0x2d')][_0xfa73('0x3a')]){_0x3346ce[_0xfa73('0x38')]=_['merge'](_0x3346ce[_0xfa73('0x38')],{'$or':_['map'](_0x3346ce[_0xfa73('0x31')],function(_0x5cde86){var _0x313a20={};_0x313a20[_0x5cde86]={'$like':'%'+_0x40e3be['query'][_0xfa73('0x3a')]+'%'};return _0x313a20;})});}_0x3346ce=_[_0xfa73('0x3b')]({},_0x3346ce,_0x40e3be[_0xfa73('0x4a')]);return _0x19e5f2['getSubjects'](_0x3346ce);}})[_0xfa73('0x20')](function(_0x4aa3a7){if(_0x4aa3a7){_0x48fc95=_0x4aa3a7[_0xfa73('0x33')];if(!_0x40e3be[_0xfa73('0x2d')][_0xfa73('0x34')](_0xfa73('0x35'))){_0x3346ce[_0xfa73('0x1a')]=qs['limit'](_0x40e3be[_0xfa73('0x2d')][_0xfa73('0x1a')]);_0x3346ce[_0xfa73('0x36')]=qs[_0xfa73('0x36')](_0x40e3be[_0xfa73('0x2d')]['offset']);}return _0x19e5f2[_0xfa73('0x4b')](_0x3346ce);}})[_0xfa73('0x20')](function(_0x5a0d7b){if(_0x5a0d7b){return _0x5a0d7b?{'count':_0x48fc95,'rows':_0x5a0d7b}:null;}})[_0xfa73('0x20')](respondWithResult(_0x13864e,null))[_0xfa73('0x40')](handleError(_0x13864e,null));};exports[_0xfa73('0x4c')]=function(_0x453bc6,_0x145991,_0x490a94){var _0xb9a574={};var _0x16fea1={};var _0x23be18;var _0x5eb6b6;return db[_0xfa73('0x27')][_0xfa73('0x47')]({'where':{'id':_0x453bc6[_0xfa73('0x42')]['id']}})[_0xfa73('0x20')](handleEntityNotFound(_0x145991,null))[_0xfa73('0x20')](function(_0x39b4fd){if(_0x39b4fd){_0x23be18=_0x39b4fd;_0x16fea1[_0xfa73('0x2c')]=_[_0xfa73('0x2e')](db['FreshdeskField'][_0xfa73('0x28')]);_0x16fea1['query']=_[_0xfa73('0x2e')](_0x453bc6[_0xfa73('0x2d')]);_0x16fea1['filters']=_['intersection'](_0x16fea1[_0xfa73('0x2c')],_0x16fea1[_0xfa73('0x2d')]);_0xb9a574[_0xfa73('0x31')]=_['intersection'](_0x16fea1[_0xfa73('0x2c')],qs[_0xfa73('0x32')](_0x453bc6['query'][_0xfa73('0x32')]));_0xb9a574['attributes']=_0xb9a574[_0xfa73('0x31')]['length']?_0xb9a574['attributes']:_0x16fea1[_0xfa73('0x2c')];_0xb9a574['order']=qs['sort'](_0x453bc6[_0xfa73('0x2d')][_0xfa73('0x49')]);_0xb9a574[_0xfa73('0x38')]=qs['filters'](_[_0xfa73('0x39')](_0x453bc6[_0xfa73('0x2d')],_0x16fea1[_0xfa73('0x2f')]));if(_0x453bc6['query']['filter']){_0xb9a574[_0xfa73('0x38')]=_[_0xfa73('0x3b')](_0xb9a574[_0xfa73('0x38')],{'$or':_['map'](_0xb9a574[_0xfa73('0x31')],function(_0x334082){var _0x11c824={};_0x11c824[_0x334082]={'$like':'%'+_0x453bc6[_0xfa73('0x2d')][_0xfa73('0x3a')]+'%'};return _0x11c824;})});}_0xb9a574=_[_0xfa73('0x3b')]({},_0xb9a574,_0x453bc6[_0xfa73('0x4a')]);return _0x23be18[_0xfa73('0x4c')](_0xb9a574);}})[_0xfa73('0x20')](function(_0x7b146f){if(_0x7b146f){_0x5eb6b6=_0x7b146f[_0xfa73('0x33')];if(!_0x453bc6[_0xfa73('0x2d')]['hasOwnProperty']('nolimit')){_0xb9a574['limit']=qs[_0xfa73('0x1a')](_0x453bc6[_0xfa73('0x2d')][_0xfa73('0x1a')]);_0xb9a574[_0xfa73('0x36')]=qs[_0xfa73('0x36')](_0x453bc6['query'][_0xfa73('0x36')]);}return _0x23be18[_0xfa73('0x4c')](_0xb9a574);}})[_0xfa73('0x20')](function(_0x3ac89e){if(_0x3ac89e){return _0x3ac89e?{'count':_0x5eb6b6,'rows':_0x3ac89e}:null;}})[_0xfa73('0x20')](respondWithResult(_0x145991,null))[_0xfa73('0x40')](handleError(_0x145991,null));};exports['getTags']=function(_0x93a16a,_0x57eaf9,_0x1346ba){var _0x70aed8={};var _0x74519b={};var _0x2543d3;var _0x3e3f9a;return db['FreshdeskConfiguration'][_0xfa73('0x47')]({'where':{'id':_0x93a16a['params']['id']}})[_0xfa73('0x20')](handleEntityNotFound(_0x57eaf9,null))[_0xfa73('0x20')](function(_0x36325f){if(_0x36325f){_0x2543d3=_0x36325f;_0x74519b[_0xfa73('0x2c')]=_[_0xfa73('0x2e')](db[_0xfa73('0x4d')][_0xfa73('0x28')]);_0x74519b[_0xfa73('0x2d')]=_['keys'](_0x93a16a[_0xfa73('0x2d')]);_0x74519b[_0xfa73('0x2f')]=_['intersection'](_0x74519b[_0xfa73('0x2c')],_0x74519b[_0xfa73('0x2d')]);_0x70aed8[_0xfa73('0x31')]=_['intersection'](_0x74519b['model'],qs[_0xfa73('0x32')](_0x93a16a[_0xfa73('0x2d')]['fields']));_0x70aed8[_0xfa73('0x31')]=_0x70aed8[_0xfa73('0x31')][_0xfa73('0x33')]?_0x70aed8[_0xfa73('0x31')]:_0x74519b[_0xfa73('0x2c')];_0x70aed8[_0xfa73('0x37')]=qs[_0xfa73('0x49')](_0x93a16a['query'][_0xfa73('0x49')]);_0x70aed8[_0xfa73('0x38')]=qs['filters'](_[_0xfa73('0x39')](_0x93a16a['query'],_0x74519b[_0xfa73('0x2f')]));if(_0x93a16a[_0xfa73('0x2d')]['filter']){_0x70aed8[_0xfa73('0x38')]=_[_0xfa73('0x3b')](_0x70aed8[_0xfa73('0x38')],{'$or':_['map'](_0x70aed8['attributes'],function(_0x31c952){var _0x48c876={};_0x48c876[_0x31c952]={'$like':'%'+_0x93a16a['query'][_0xfa73('0x3a')]+'%'};return _0x48c876;})});}_0x70aed8=_[_0xfa73('0x3b')]({},_0x70aed8,_0x93a16a['options']);return _0x2543d3[_0xfa73('0x4e')](_0x70aed8);}})[_0xfa73('0x20')](function(_0x418531){if(_0x418531){_0x3e3f9a=_0x418531['length'];if(!_0x93a16a[_0xfa73('0x2d')]['hasOwnProperty']('nolimit')){_0x70aed8[_0xfa73('0x1a')]=qs[_0xfa73('0x1a')](_0x93a16a[_0xfa73('0x2d')]['limit']);_0x70aed8['offset']=qs[_0xfa73('0x36')](_0x93a16a[_0xfa73('0x2d')][_0xfa73('0x36')]);}return _0x2543d3[_0xfa73('0x4e')](_0x70aed8);}})[_0xfa73('0x20')](function(_0x2eabd5){if(_0x2eabd5){return _0x2eabd5?{'count':_0x3e3f9a,'rows':_0x2eabd5}:null;}})[_0xfa73('0x20')](respondWithResult(_0x57eaf9,null))[_0xfa73('0x40')](handleError(_0x57eaf9,null));};exports['setTags']=function(_0x37cb1b,_0x557240,_0xb78884){if(_0x37cb1b['body']['id']){delete _0x37cb1b[_0xfa73('0x45')]['id'];}return db[_0xfa73('0x27')][_0xfa73('0x47')]({'where':{'id':_0x37cb1b['params']['id']}})['then'](handleEntityNotFound(_0x557240,null))[_0xfa73('0x20')](function(_0x18e5c0){if(_0x18e5c0){return _0x18e5c0[_0xfa73('0x4f')](_0x37cb1b[_0xfa73('0x45')][_0xfa73('0x50')]||[]);}return null;})[_0xfa73('0x20')](respondWithResult(_0x557240,null))['catch'](handleError(_0x557240,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 144366c..219f172 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 _0x544f=['api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger'];(function(_0x10a391,_0x120414){var _0x521769=function(_0x464a9a){while(--_0x464a9a){_0x10a391['push'](_0x10a391['shift']());}};_0x521769(++_0x120414);}(_0x544f,0x65));var _0xf544=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x544f[_0x2d364e];return _0x1b9312;};'use strict';var _=require(_0xf544('0x0'));var util=require(_0xf544('0x1'));var logger=require(_0xf544('0x2'))(_0xf544('0x3'));var moment=require(_0xf544('0x4'));var BPromise=require(_0xf544('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf544('0x6'));var rimraf=require(_0xf544('0x7'));var config=require(_0xf544('0x8'));var attributes=require(_0xf544('0x9'));module['exports']=function(_0x5a09a9,_0x125ad5){return _0x5a09a9[_0xf544('0xa')](_0xf544('0xb'),attributes,{'tableName':_0xf544('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0f3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger'];(function(_0x4d3735,_0x12aa11){var _0x5c733e=function(_0x5ec986){while(--_0x5ec986){_0x4d3735['push'](_0x4d3735['shift']());}};_0x5c733e(++_0x12aa11);}(_0xd0f3,0x1e2));var _0x3d0f=function(_0x55b3b5,_0x254983){_0x55b3b5=_0x55b3b5-0x0;var _0x5297a9=_0xd0f3[_0x55b3b5];return _0x5297a9;};'use strict';var _=require(_0x3d0f('0x0'));var util=require('util');var logger=require(_0x3d0f('0x1'))('api');var moment=require(_0x3d0f('0x2'));var BPromise=require(_0x3d0f('0x3'));var rp=require(_0x3d0f('0x4'));var fs=require('fs');var path=require(_0x3d0f('0x5'));var rimraf=require(_0x3d0f('0x6'));var config=require(_0x3d0f('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x3fa6da,_0x2de2fe){return _0x3fa6da[_0x3d0f('0x8')](_0x3d0f('0x9'),attributes,{'tableName':_0x3d0f('0xa'),'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 f300a7a..83018ec 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 _0xe746=['request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x3e2435,_0xc531a1){var _0x5d49e7=function(_0x214b4f){while(--_0x214b4f){_0x3e2435['push'](_0x3e2435['shift']());}};_0x5d49e7(++_0xc531a1);}(_0xe746,0x14a));var _0x6e74=function(_0x324697,_0x570357){_0x324697=_0x324697-0x0;var _0xf8c678=_0xe746[_0x324697];return _0xf8c678;};'use strict';var _=require(_0x6e74('0x0'));var util=require('util');var moment=require(_0x6e74('0x1'));var BPromise=require('bluebird');var rs=require(_0x6e74('0x2'));var fs=require('fs');var Redis=require(_0x6e74('0x3'));var db=require(_0x6e74('0x4'))['db'];var utils=require(_0x6e74('0x5'));var logger=require(_0x6e74('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x524e37,_0x32ff59,_0x4f417b){return new BPromise(function(_0x4e31d8,_0xec6004){return client[_0x6e74('0x7')](_0x524e37,_0x4f417b)[_0x6e74('0x8')](function(_0x4066bb){logger[_0x6e74('0x9')](_0x6e74('0xa'),_0x32ff59,'request\x20sent');logger['debug'](_0x6e74('0xb'),_0x32ff59,_0x6e74('0xc'),JSON[_0x6e74('0xd')](_0x4066bb));if(_0x4066bb[_0x6e74('0xe')]){if(_0x4066bb[_0x6e74('0xe')][_0x6e74('0xf')]===0x1f4){logger['error'](_0x6e74('0xa'),_0x32ff59,_0x4066bb[_0x6e74('0xe')][_0x6e74('0x10')]);return _0xec6004(_0x4066bb[_0x6e74('0xe')]['message']);}logger[_0x6e74('0xe')](_0x6e74('0xa'),_0x32ff59,_0x4066bb[_0x6e74('0xe')]['message']);return _0x4e31d8(_0x4066bb[_0x6e74('0xe')][_0x6e74('0x10')]);}else{logger[_0x6e74('0x9')](_0x6e74('0xa'),_0x32ff59,_0x6e74('0xc'));_0x4e31d8(_0x4066bb['result'][_0x6e74('0x10')]);}})[_0x6e74('0x11')](function(_0x59b9ef){logger[_0x6e74('0xe')](_0x6e74('0xa'),_0x32ff59,_0x59b9ef);_0xec6004(_0x59b9ef);});});} \ No newline at end of file +var _0x8321=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x8321,0xd3));var _0x1832=function(_0x4b1e3d,_0x27b6b3){_0x4b1e3d=_0x4b1e3d-0x0;var _0x2665ea=_0x8321[_0x4b1e3d];return _0x2665ea;};'use strict';var _=require(_0x1832('0x0'));var util=require(_0x1832('0x1'));var moment=require(_0x1832('0x2'));var BPromise=require(_0x1832('0x3'));var rs=require(_0x1832('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1832('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1832('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1832('0x7')][_0x1832('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x553d27,_0x150e40,_0x37db91){return new BPromise(function(_0x37d0e0,_0x475c33){return client[_0x1832('0x9')](_0x553d27,_0x37db91)[_0x1832('0xa')](function(_0xce36b8){logger[_0x1832('0xb')](_0x1832('0xc'),_0x150e40,_0x1832('0xd'));logger[_0x1832('0xe')](_0x1832('0xf'),_0x150e40,_0x1832('0xd'),JSON[_0x1832('0x10')](_0xce36b8));if(_0xce36b8[_0x1832('0x11')]){if(_0xce36b8['error']['code']===0x1f4){logger[_0x1832('0x11')](_0x1832('0xc'),_0x150e40,_0xce36b8[_0x1832('0x11')][_0x1832('0x12')]);return _0x475c33(_0xce36b8[_0x1832('0x11')][_0x1832('0x12')]);}logger[_0x1832('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x150e40,_0xce36b8[_0x1832('0x11')][_0x1832('0x12')]);return _0x37d0e0(_0xce36b8[_0x1832('0x11')][_0x1832('0x12')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x150e40,_0x1832('0xd'));_0x37d0e0(_0xce36b8[_0x1832('0x13')][_0x1832('0x12')]);}})[_0x1832('0x14')](function(_0xd8c901){logger['error'](_0x1832('0xc'),_0x150e40,_0xd8c901);_0x475c33(_0xd8c901);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 209f87a..d9ae50c 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 _0x23c2=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','post','put','delete','destroy'];(function(_0x21461d,_0x10b552){var _0x81cb10=function(_0x430118){while(--_0x430118){_0x21461d['push'](_0x21461d['shift']());}};_0x81cb10(++_0x10b552);}(_0x23c2,0x177));var _0x223c=function(_0x4cab1e,_0xfc5cde){_0x4cab1e=_0x4cab1e-0x0;var _0x1a8cd8=_0x23c2[_0x4cab1e];return _0x1a8cd8;};'use strict';var multer=require(_0x223c('0x0'));var util=require(_0x223c('0x1'));var path=require('path');var timeout=require(_0x223c('0x2'));var express=require('express');var router=express[_0x223c('0x3')]();var fs_extra=require(_0x223c('0x4'));var auth=require(_0x223c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x223c('0x6'));var controller=require(_0x223c('0x7'));router[_0x223c('0x8')]('/',auth[_0x223c('0x9')](),controller[_0x223c('0xa')]);router['get'](_0x223c('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x223c('0xc')]('/',auth[_0x223c('0x9')](),controller['create']);router[_0x223c('0xd')](_0x223c('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x223c('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x223c('0xf')]);module[_0x223c('0x10')]=router; \ No newline at end of file +var _0x11f2=['delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','isAuthenticated','index','/:id','update'];(function(_0x470eed,_0x57a19b){var _0x7836cc=function(_0x577fea){while(--_0x577fea){_0x470eed['push'](_0x470eed['shift']());}};_0x7836cc(++_0x57a19b);}(_0x11f2,0x11b));var _0x211f=function(_0x7a0ec2,_0x22a646){_0x7a0ec2=_0x7a0ec2-0x0;var _0x1dff57=_0x11f2[_0x7a0ec2];return _0x1dff57;};'use strict';var multer=require(_0x211f('0x0'));var util=require(_0x211f('0x1'));var path=require(_0x211f('0x2'));var timeout=require(_0x211f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x211f('0x4'));var interaction=require(_0x211f('0x5'));var config=require('../../config/environment');var controller=require(_0x211f('0x6'));router['get']('/',auth[_0x211f('0x7')](),controller[_0x211f('0x8')]);router['get']('/:id',auth[_0x211f('0x7')](),controller['show']);router['post']('/',auth[_0x211f('0x7')](),controller['create']);router['put'](_0x211f('0x9'),auth['isAuthenticated'](),controller[_0x211f('0xa')]);router[_0x211f('0xb')](_0x211f('0x9'),auth['isAuthenticated'](),controller[_0x211f('0xc')]);module[_0x211f('0xd')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 6dd37bc..1470f56 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 _0x829b=['exports','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize'];(function(_0x47e5cd,_0x2e338b){var _0x10003f=function(_0x2f9f4e){while(--_0x2f9f4e){_0x47e5cd['push'](_0x47e5cd['shift']());}};_0x10003f(++_0x2e338b);}(_0x829b,0xe9));var _0xb829=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x829b[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0xb829('0x0'));module[_0xb829('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb829('0x2'),'variable',_0xb829('0x3'),_0xb829('0x4'),_0xb829('0x5')),'defaultValue':_0xb829('0x2')},'content':{'type':Sequelize[_0xb829('0x6')]},'key':{'type':Sequelize[_0xb829('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xb829('0x7'),_0xb829('0x3'))},'keyContent':{'type':Sequelize[_0xb829('0x6')]},'idField':{'type':Sequelize[_0xb829('0x6')]},'nameField':{'type':Sequelize[_0xb829('0x6')]},'customField':{'type':Sequelize[_0xb829('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb829('0x6')]}}; \ No newline at end of file +var _0xadb4=['BOOLEAN','sequelize','ENUM','string','customVariable','keyValue','STRING'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0xadb4,0x17b));var _0x4adb=function(_0x4bea3a,_0x85b891){_0x4bea3a=_0x4bea3a-0x0;var _0x11a8e1=_0xadb4[_0x4bea3a];return _0x11a8e1;};'use strict';var Sequelize=require(_0x4adb('0x0'));module['exports']={'type':{'type':Sequelize[_0x4adb('0x1')](_0x4adb('0x2'),'variable',_0x4adb('0x3'),_0x4adb('0x4'),'picklist'),'defaultValue':_0x4adb('0x2')},'content':{'type':Sequelize[_0x4adb('0x5')]},'key':{'type':Sequelize[_0x4adb('0x5')]},'keyType':{'type':Sequelize[_0x4adb('0x1')](_0x4adb('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x4adb('0x5')]},'idField':{'type':Sequelize[_0x4adb('0x5')]},'nameField':{'type':Sequelize[_0x4adb('0x5')]},'customField':{'type':Sequelize[_0x4adb('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4adb('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index a586ea4..545ac0c 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 _0xa478=['rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','map','FreshdeskField'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa478,0x136));var _0x8a47=function(_0x35b87c,_0x166a8c){_0x35b87c=_0x35b87c-0x0;var _0x24795b=_0xa478[_0x35b87c];return _0x24795b;};'use strict';var emlformat=require(_0x8a47('0x0'));var rimraf=require(_0x8a47('0x1'));var zipdir=require(_0x8a47('0x2'));var jsonpatch=require(_0x8a47('0x3'));var rp=require(_0x8a47('0x4'));var moment=require(_0x8a47('0x5'));var BPromise=require(_0x8a47('0x6'));var Mustache=require(_0x8a47('0x7'));var util=require(_0x8a47('0x8'));var path=require(_0x8a47('0x9'));var sox=require(_0x8a47('0xa'));var csv=require(_0x8a47('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a47('0xc'));var _=require(_0x8a47('0xd'));var squel=require(_0x8a47('0xe'));var crypto=require(_0x8a47('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8a47('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8a47('0x11'));var Papa=require(_0x8a47('0x12'));var Redis=require(_0x8a47('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8a47('0x14'));var as=require(_0x8a47('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a47('0x16'))('api');var utils=require(_0x8a47('0x17'));var config=require(_0x8a47('0x18'));var licenseUtil=require(_0x8a47('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e3166,_0x59efc7){_0x59efc7=_0x59efc7||0xcc;return function(_0x36941a){if(_0x36941a){return _0x5e3166[_0x8a47('0x1a')](_0x59efc7);}return _0x5e3166['status'](_0x59efc7)[_0x8a47('0x1b')]();};}function respondWithResult(_0x28bbc5,_0x1a9a6f){_0x1a9a6f=_0x1a9a6f||0xc8;return function(_0x55985c){if(_0x55985c){return _0x28bbc5[_0x8a47('0x1c')](_0x1a9a6f)[_0x8a47('0x1d')](_0x55985c);}};}function respondWithFilteredResult(_0x2f682e,_0x1c8488){return function(_0x41bdaf){if(_0x41bdaf){var _0x18f2be=typeof _0x1c8488[_0x8a47('0x1e')]===_0x8a47('0x1f')&&typeof _0x1c8488[_0x8a47('0x20')]==='undefined';var _0x20fbf7=_0x41bdaf[_0x8a47('0x21')];var _0x3f9093=_0x18f2be?0x0:_0x1c8488['offset'];var _0x341089=_0x18f2be?_0x41bdaf['count']:_0x1c8488['offset']+_0x1c8488[_0x8a47('0x20')];var _0x2174b1;if(_0x341089>=_0x20fbf7){_0x341089=_0x20fbf7;_0x2174b1=0xc8;}else{_0x2174b1=0xce;}_0x2f682e[_0x8a47('0x1c')](_0x2174b1);return _0x2f682e[_0x8a47('0x22')](_0x8a47('0x23'),_0x3f9093+'-'+_0x341089+'/'+_0x20fbf7)[_0x8a47('0x1d')](_0x41bdaf);}return null;};}function patchUpdates(_0x44e119){return function(_0x1bbed6){try{jsonpatch[_0x8a47('0x24')](_0x1bbed6,_0x44e119,!![]);}catch(_0xc2065a){return BPromise['reject'](_0xc2065a);}return _0x1bbed6[_0x8a47('0x25')]();};}function saveUpdates(_0x5923ec,_0x289f28){return function(_0x3d7993){if(_0x3d7993){return _0x3d7993[_0x8a47('0x26')](_0x5923ec)[_0x8a47('0x27')](function(_0x5d4b6c){return _0x5d4b6c;});}return null;};}function removeEntity(_0x116b5e,_0x5ae186){return function(_0x50f6ba){if(_0x50f6ba){return _0x50f6ba['destroy']()['then'](function(){_0x116b5e[_0x8a47('0x1c')](0xcc)[_0x8a47('0x1b')]();});}};}function handleEntityNotFound(_0x5bed3e,_0x2bb0d4){return function(_0xb4590d){if(!_0xb4590d){_0x5bed3e[_0x8a47('0x1a')](0x194);}return _0xb4590d;};}function handleError(_0xfb9ae0,_0x44cf20){_0x44cf20=_0x44cf20||0x1f4;return function(_0xd06be6){logger[_0x8a47('0x28')](_0xd06be6['stack']);if(_0xd06be6[_0x8a47('0x29')]){delete _0xd06be6['name'];}_0xfb9ae0[_0x8a47('0x1c')](_0x44cf20)[_0x8a47('0x2a')](_0xd06be6);};}exports['index']=function(_0x1e89b1,_0x526571){var _0x4d5d32={},_0x12470a={},_0x9b51b8={'count':0x0,'rows':[]};var _0x1ddbcf=_[_0x8a47('0x2b')](db[_0x8a47('0x2c')][_0x8a47('0x2d')],function(_0x58aa06){return{'name':_0x58aa06[_0x8a47('0x2e')],'type':_0x58aa06['type']['key']};});_0x12470a[_0x8a47('0x2f')]=_[_0x8a47('0x2b')](_0x1ddbcf,_0x8a47('0x29'));_0x12470a[_0x8a47('0x30')]=_[_0x8a47('0x31')](_0x1e89b1[_0x8a47('0x30')]);_0x12470a[_0x8a47('0x32')]=_[_0x8a47('0x33')](_0x12470a[_0x8a47('0x2f')],_0x12470a[_0x8a47('0x30')]);_0x4d5d32['attributes']=_[_0x8a47('0x33')](_0x12470a[_0x8a47('0x2f')],qs[_0x8a47('0x34')](_0x1e89b1['query'][_0x8a47('0x34')]));_0x4d5d32[_0x8a47('0x35')]=_0x4d5d32['attributes'][_0x8a47('0x36')]?_0x4d5d32[_0x8a47('0x35')]:_0x12470a[_0x8a47('0x2f')];if(!_0x1e89b1[_0x8a47('0x30')]['hasOwnProperty']('nolimit')){_0x4d5d32[_0x8a47('0x20')]=qs[_0x8a47('0x20')](_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x20')]);_0x4d5d32[_0x8a47('0x1e')]=qs[_0x8a47('0x1e')](_0x1e89b1[_0x8a47('0x30')]['offset']);}_0x4d5d32['order']=qs[_0x8a47('0x37')](_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x37')]);_0x4d5d32[_0x8a47('0x38')]=qs[_0x8a47('0x32')](_[_0x8a47('0x39')](_0x1e89b1[_0x8a47('0x30')],_0x12470a[_0x8a47('0x32')]),_0x1ddbcf);if(_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x3a')]){_0x4d5d32[_0x8a47('0x38')]=_['merge'](_0x4d5d32[_0x8a47('0x38')],{'$or':_['map'](_0x1ddbcf,function(_0x541832){if(_0x541832['type']!=='VIRTUAL'){var _0x57d38e={};_0x57d38e[_0x541832[_0x8a47('0x29')]]={'$like':'%'+_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x3a')]+'%'};return _0x57d38e;}})});}_0x4d5d32=_[_0x8a47('0x3b')]({},_0x4d5d32,_0x1e89b1[_0x8a47('0x3c')]);var _0x20ba1c={'where':_0x4d5d32[_0x8a47('0x38')]};return db[_0x8a47('0x2c')]['count'](_0x20ba1c)['then'](function(_0x442870){_0x9b51b8[_0x8a47('0x21')]=_0x442870;if(_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x3d')]){_0x4d5d32['include']=[{'all':!![]}];}return db[_0x8a47('0x2c')][_0x8a47('0x3e')](_0x4d5d32);})[_0x8a47('0x27')](function(_0x369dd5){_0x9b51b8[_0x8a47('0x3f')]=_0x369dd5;return _0x9b51b8;})['then'](respondWithFilteredResult(_0x526571,_0x4d5d32))[_0x8a47('0x40')](handleError(_0x526571,null));};exports[_0x8a47('0x41')]=function(_0x3010af,_0x5d23ed){var _0x2b3874={'raw':!![],'where':{'id':_0x3010af[_0x8a47('0x42')]['id']}},_0x2c70ea={};_0x2c70ea[_0x8a47('0x2f')]=_['keys'](db[_0x8a47('0x2c')][_0x8a47('0x2d')]);_0x2c70ea[_0x8a47('0x30')]=_[_0x8a47('0x31')](_0x3010af[_0x8a47('0x30')]);_0x2c70ea[_0x8a47('0x32')]=_['intersection'](_0x2c70ea['model'],_0x2c70ea[_0x8a47('0x30')]);_0x2b3874[_0x8a47('0x35')]=_[_0x8a47('0x33')](_0x2c70ea['model'],qs[_0x8a47('0x34')](_0x3010af[_0x8a47('0x30')]['fields']));_0x2b3874['attributes']=_0x2b3874[_0x8a47('0x35')]['length']?_0x2b3874[_0x8a47('0x35')]:_0x2c70ea[_0x8a47('0x2f')];if(_0x3010af[_0x8a47('0x30')][_0x8a47('0x3d')]){_0x2b3874[_0x8a47('0x43')]=[{'all':!![]}];}_0x2b3874=_[_0x8a47('0x3b')]({},_0x2b3874,_0x3010af['options']);return db['FreshdeskField'][_0x8a47('0x44')](_0x2b3874)[_0x8a47('0x27')](handleEntityNotFound(_0x5d23ed,null))[_0x8a47('0x27')](respondWithResult(_0x5d23ed,null))[_0x8a47('0x40')](handleError(_0x5d23ed,null));};exports[_0x8a47('0x45')]=function(_0x55dd7c,_0x4898d0){return db[_0x8a47('0x2c')]['create'](_0x55dd7c[_0x8a47('0x46')],{})[_0x8a47('0x27')](respondWithResult(_0x4898d0,0xc9))['catch'](handleError(_0x4898d0,null));};exports[_0x8a47('0x26')]=function(_0x237ed1,_0x14e22c){if(_0x237ed1[_0x8a47('0x46')]['id']){delete _0x237ed1[_0x8a47('0x46')]['id'];}return db[_0x8a47('0x2c')][_0x8a47('0x44')]({'where':{'id':_0x237ed1[_0x8a47('0x42')]['id']}})['then'](handleEntityNotFound(_0x14e22c,null))[_0x8a47('0x27')](saveUpdates(_0x237ed1[_0x8a47('0x46')],null))[_0x8a47('0x27')](respondWithResult(_0x14e22c,null))[_0x8a47('0x40')](handleError(_0x14e22c,null));};exports['destroy']=function(_0x11db4e,_0xa428dd){return db[_0x8a47('0x2c')][_0x8a47('0x44')]({'where':{'id':_0x11db4e[_0x8a47('0x42')]['id']}})[_0x8a47('0x27')](handleEntityNotFound(_0xa428dd,null))['then'](removeEntity(_0xa428dd,null))['catch'](handleError(_0xa428dd,null));}; \ No newline at end of file +var _0xb688=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','update','then','destroy','end','error','name','send','map','FreshdeskField','rawAttributes','fieldName','key','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','show','includeAll','include','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x2971a4,_0x42a07b){var _0x293aa6=function(_0x5b2fc7){while(--_0x5b2fc7){_0x2971a4['push'](_0x2971a4['shift']());}};_0x293aa6(++_0x42a07b);}(_0xb688,0xcf));var _0x8b68=function(_0x582a41,_0x374eb4){_0x582a41=_0x582a41-0x0;var _0x20cb24=_0xb688[_0x582a41];return _0x20cb24;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b68('0x0'));var zipdir=require(_0x8b68('0x1'));var jsonpatch=require(_0x8b68('0x2'));var rp=require(_0x8b68('0x3'));var moment=require(_0x8b68('0x4'));var BPromise=require(_0x8b68('0x5'));var Mustache=require('mustache');var util=require(_0x8b68('0x6'));var path=require(_0x8b68('0x7'));var sox=require(_0x8b68('0x8'));var csv=require(_0x8b68('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b68('0xa'));var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0x9'));var querystring=require(_0x8b68('0xf'));var Papa=require(_0x8b68('0x10'));var Redis=require(_0x8b68('0x11'));var authService=require(_0x8b68('0x12'));var qs=require(_0x8b68('0x13'));var as=require(_0x8b68('0x14'));var hardwareService=require(_0x8b68('0x15'));var logger=require(_0x8b68('0x16'))('api');var utils=require(_0x8b68('0x17'));var config=require(_0x8b68('0x18'));var licenseUtil=require(_0x8b68('0x19'));var db=require(_0x8b68('0x1a'))['db'];function respondWithStatusCode(_0x1965cf,_0x2f3af4){_0x2f3af4=_0x2f3af4||0xcc;return function(_0xaa8725){if(_0xaa8725){return _0x1965cf[_0x8b68('0x1b')](_0x2f3af4);}return _0x1965cf[_0x8b68('0x1c')](_0x2f3af4)['end']();};}function respondWithResult(_0xb2df35,_0x509033){_0x509033=_0x509033||0xc8;return function(_0x5e3c66){if(_0x5e3c66){return _0xb2df35[_0x8b68('0x1c')](_0x509033)[_0x8b68('0x1d')](_0x5e3c66);}};}function respondWithFilteredResult(_0x27d717,_0x5d3468){return function(_0x5c8d0e){if(_0x5c8d0e){var _0x23bd52=typeof _0x5d3468['offset']===_0x8b68('0x1e')&&typeof _0x5d3468[_0x8b68('0x1f')]===_0x8b68('0x1e');var _0x10c9c6=_0x5c8d0e['count'];var _0xd17693=_0x23bd52?0x0:_0x5d3468[_0x8b68('0x20')];var _0x4a68c7=_0x23bd52?_0x5c8d0e[_0x8b68('0x21')]:_0x5d3468[_0x8b68('0x20')]+_0x5d3468[_0x8b68('0x1f')];var _0x17f321;if(_0x4a68c7>=_0x10c9c6){_0x4a68c7=_0x10c9c6;_0x17f321=0xc8;}else{_0x17f321=0xce;}_0x27d717[_0x8b68('0x1c')](_0x17f321);return _0x27d717['set'](_0x8b68('0x22'),_0xd17693+'-'+_0x4a68c7+'/'+_0x10c9c6)[_0x8b68('0x1d')](_0x5c8d0e);}return null;};}function patchUpdates(_0x59e9b1){return function(_0x1a9788){try{jsonpatch[_0x8b68('0x23')](_0x1a9788,_0x59e9b1,!![]);}catch(_0x1dbc1d){return BPromise['reject'](_0x1dbc1d);}return _0x1a9788['save']();};}function saveUpdates(_0x23edc1,_0x59cb26){return function(_0x332202){if(_0x332202){return _0x332202[_0x8b68('0x24')](_0x23edc1)[_0x8b68('0x25')](function(_0x21ecca){return _0x21ecca;});}return null;};}function removeEntity(_0x32ddc5,_0x173524){return function(_0x59bb8a){if(_0x59bb8a){return _0x59bb8a[_0x8b68('0x26')]()[_0x8b68('0x25')](function(){_0x32ddc5['status'](0xcc)[_0x8b68('0x27')]();});}};}function handleEntityNotFound(_0x3cf8d2,_0x240b0b){return function(_0x5590ec){if(!_0x5590ec){_0x3cf8d2['sendStatus'](0x194);}return _0x5590ec;};}function handleError(_0x4fe8f6,_0x92d186){_0x92d186=_0x92d186||0x1f4;return function(_0x448e43){logger[_0x8b68('0x28')](_0x448e43['stack']);if(_0x448e43[_0x8b68('0x29')]){delete _0x448e43['name'];}_0x4fe8f6['status'](_0x92d186)[_0x8b68('0x2a')](_0x448e43);};}exports['index']=function(_0x26cad7,_0x3ac356){var _0x48e2c8={},_0x494ce4={},_0x357635={'count':0x0,'rows':[]};var _0x1cd230=_[_0x8b68('0x2b')](db[_0x8b68('0x2c')][_0x8b68('0x2d')],function(_0x2ad2df){return{'name':_0x2ad2df[_0x8b68('0x2e')],'type':_0x2ad2df['type'][_0x8b68('0x2f')]};});_0x494ce4['model']=_[_0x8b68('0x2b')](_0x1cd230,_0x8b68('0x29'));_0x494ce4['query']=_[_0x8b68('0x30')](_0x26cad7[_0x8b68('0x31')]);_0x494ce4[_0x8b68('0x32')]=_['intersection'](_0x494ce4['model'],_0x494ce4[_0x8b68('0x31')]);_0x48e2c8[_0x8b68('0x33')]=_[_0x8b68('0x34')](_0x494ce4[_0x8b68('0x35')],qs[_0x8b68('0x36')](_0x26cad7[_0x8b68('0x31')][_0x8b68('0x36')]));_0x48e2c8[_0x8b68('0x33')]=_0x48e2c8[_0x8b68('0x33')][_0x8b68('0x37')]?_0x48e2c8[_0x8b68('0x33')]:_0x494ce4[_0x8b68('0x35')];if(!_0x26cad7[_0x8b68('0x31')][_0x8b68('0x38')](_0x8b68('0x39'))){_0x48e2c8[_0x8b68('0x1f')]=qs[_0x8b68('0x1f')](_0x26cad7[_0x8b68('0x31')][_0x8b68('0x1f')]);_0x48e2c8[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x26cad7[_0x8b68('0x31')]['offset']);}_0x48e2c8['order']=qs[_0x8b68('0x3a')](_0x26cad7[_0x8b68('0x31')][_0x8b68('0x3a')]);_0x48e2c8[_0x8b68('0x3b')]=qs[_0x8b68('0x32')](_[_0x8b68('0x3c')](_0x26cad7[_0x8b68('0x31')],_0x494ce4[_0x8b68('0x32')]),_0x1cd230);if(_0x26cad7['query'][_0x8b68('0x3d')]){_0x48e2c8[_0x8b68('0x3b')]=_[_0x8b68('0x3e')](_0x48e2c8[_0x8b68('0x3b')],{'$or':_[_0x8b68('0x2b')](_0x1cd230,function(_0x3e0032){if(_0x3e0032[_0x8b68('0x3f')]!==_0x8b68('0x40')){var _0x517571={};_0x517571[_0x3e0032[_0x8b68('0x29')]]={'$like':'%'+_0x26cad7[_0x8b68('0x31')][_0x8b68('0x3d')]+'%'};return _0x517571;}})});}_0x48e2c8=_[_0x8b68('0x3e')]({},_0x48e2c8,_0x26cad7[_0x8b68('0x41')]);var _0x3b3394={'where':_0x48e2c8[_0x8b68('0x3b')]};return db['FreshdeskField'][_0x8b68('0x21')](_0x3b3394)[_0x8b68('0x25')](function(_0x48f159){_0x357635[_0x8b68('0x21')]=_0x48f159;if(_0x26cad7[_0x8b68('0x31')]['includeAll']){_0x48e2c8['include']=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x48e2c8);})[_0x8b68('0x25')](function(_0x23d24a){_0x357635['rows']=_0x23d24a;return _0x357635;})[_0x8b68('0x25')](respondWithFilteredResult(_0x3ac356,_0x48e2c8))['catch'](handleError(_0x3ac356,null));};exports[_0x8b68('0x42')]=function(_0x3841d2,_0x5a3193){var _0x2f90d9={'raw':!![],'where':{'id':_0x3841d2['params']['id']}},_0x5ae345={};_0x5ae345['model']=_[_0x8b68('0x30')](db[_0x8b68('0x2c')][_0x8b68('0x2d')]);_0x5ae345[_0x8b68('0x31')]=_['keys'](_0x3841d2[_0x8b68('0x31')]);_0x5ae345['filters']=_[_0x8b68('0x34')](_0x5ae345[_0x8b68('0x35')],_0x5ae345['query']);_0x2f90d9[_0x8b68('0x33')]=_[_0x8b68('0x34')](_0x5ae345[_0x8b68('0x35')],qs[_0x8b68('0x36')](_0x3841d2['query'][_0x8b68('0x36')]));_0x2f90d9[_0x8b68('0x33')]=_0x2f90d9[_0x8b68('0x33')][_0x8b68('0x37')]?_0x2f90d9[_0x8b68('0x33')]:_0x5ae345[_0x8b68('0x35')];if(_0x3841d2[_0x8b68('0x31')][_0x8b68('0x43')]){_0x2f90d9[_0x8b68('0x44')]=[{'all':!![]}];}_0x2f90d9=_[_0x8b68('0x3e')]({},_0x2f90d9,_0x3841d2[_0x8b68('0x41')]);return db[_0x8b68('0x2c')][_0x8b68('0x45')](_0x2f90d9)[_0x8b68('0x25')](handleEntityNotFound(_0x5a3193,null))[_0x8b68('0x25')](respondWithResult(_0x5a3193,null))[_0x8b68('0x46')](handleError(_0x5a3193,null));};exports['create']=function(_0x3b7b06,_0x20681a){return db['FreshdeskField'][_0x8b68('0x47')](_0x3b7b06['body'],{})['then'](respondWithResult(_0x20681a,0xc9))['catch'](handleError(_0x20681a,null));};exports[_0x8b68('0x24')]=function(_0x35874b,_0x34047c){if(_0x35874b[_0x8b68('0x48')]['id']){delete _0x35874b['body']['id'];}return db['FreshdeskField'][_0x8b68('0x45')]({'where':{'id':_0x35874b[_0x8b68('0x49')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x34047c,null))['then'](saveUpdates(_0x35874b[_0x8b68('0x48')],null))[_0x8b68('0x25')](respondWithResult(_0x34047c,null))['catch'](handleError(_0x34047c,null));};exports[_0x8b68('0x26')]=function(_0xacac82,_0x595942){return db[_0x8b68('0x2c')][_0x8b68('0x45')]({'where':{'id':_0xacac82['params']['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x595942,null))[_0x8b68('0x25')](removeEntity(_0x595942,null))['catch'](handleError(_0x595942,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 251ab6b..2a6b588 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 _0x331e=['../../config/logger','api','moment','bluebird','path','rimraf','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util'];(function(_0x1fc4e2,_0x493c3b){var _0x2ba184=function(_0x58e64f){while(--_0x58e64f){_0x1fc4e2['push'](_0x1fc4e2['shift']());}};_0x2ba184(++_0x493c3b);}(_0x331e,0x193));var _0xe331=function(_0x210a9e,_0x5c1a84){_0x210a9e=_0x210a9e-0x0;var _0x330ada=_0x331e[_0x210a9e];return _0x330ada;};'use strict';var _=require(_0xe331('0x0'));var util=require(_0xe331('0x1'));var logger=require(_0xe331('0x2'))(_0xe331('0x3'));var moment=require(_0xe331('0x4'));var BPromise=require(_0xe331('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe331('0x6'));var rimraf=require(_0xe331('0x7'));var config=require('../../config/environment');var attributes=require(_0xe331('0x8'));module[_0xe331('0x9')]=function(_0x598cbb,_0x1955b3){return _0x598cbb['define'](_0xe331('0xa'),attributes,{'tableName':_0xe331('0xb'),'paranoid':![],'indexes':[{'name':_0xe331('0xc'),'fields':[_0xe331('0xd'),_0xe331('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x98ea=['FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x98ea,0x164));var _0xa98e=function(_0xd1e54b,_0x22673f){_0xd1e54b=_0xd1e54b-0x0;var _0x25ea86=_0x98ea[_0xd1e54b];return _0x25ea86;};'use strict';var _=require(_0xa98e('0x0'));var util=require(_0xa98e('0x1'));var logger=require(_0xa98e('0x2'))(_0xa98e('0x3'));var moment=require('moment');var BPromise=require(_0xa98e('0x4'));var rp=require(_0xa98e('0x5'));var fs=require('fs');var path=require(_0xa98e('0x6'));var rimraf=require(_0xa98e('0x7'));var config=require(_0xa98e('0x8'));var attributes=require(_0xa98e('0x9'));module[_0xa98e('0xa')]=function(_0x171d5a,_0x3c3893){return _0x171d5a[_0xa98e('0xb')](_0xa98e('0xc'),attributes,{'tableName':_0xa98e('0xd'),'paranoid':![],'indexes':[{'name':_0xa98e('0xe'),'fields':[_0xa98e('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 93531c2..8a77675 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 _0x155a=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3772ac,_0x4a149e){var _0x3b0962=function(_0x1884cd){while(--_0x1884cd){_0x3772ac['push'](_0x3772ac['shift']());}};_0x3b0962(++_0x4a149e);}(_0x155a,0x1da));var _0xa155=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x155a[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xa155('0x0'));var util=require(_0xa155('0x1'));var moment=require(_0xa155('0x2'));var BPromise=require(_0xa155('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa155('0x4'));var db=require(_0xa155('0x5'))['db'];var utils=require(_0xa155('0x6'));var logger=require(_0xa155('0x7'))(_0xa155('0x8'));var config=require('../../config/environment');var jayson=require(_0xa155('0x9'));var client=jayson[_0xa155('0xa')][_0xa155('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f4a37,_0x31f286,_0x335d79){return new BPromise(function(_0x1a4217,_0xb554f2){return client['request'](_0x1f4a37,_0x335d79)[_0xa155('0xc')](function(_0x7e6467){logger[_0xa155('0xd')](_0xa155('0xe'),_0x31f286,_0xa155('0xf'));logger[_0xa155('0x10')](_0xa155('0x11'),_0x31f286,'request\x20sent',JSON[_0xa155('0x12')](_0x7e6467));if(_0x7e6467['error']){if(_0x7e6467[_0xa155('0x13')][_0xa155('0x14')]===0x1f4){logger[_0xa155('0x13')](_0xa155('0xe'),_0x31f286,_0x7e6467[_0xa155('0x13')][_0xa155('0x15')]);return _0xb554f2(_0x7e6467['error']['message']);}logger[_0xa155('0x13')](_0xa155('0xe'),_0x31f286,_0x7e6467[_0xa155('0x13')][_0xa155('0x15')]);return _0x1a4217(_0x7e6467['error'][_0xa155('0x15')]);}else{logger[_0xa155('0xd')](_0xa155('0xe'),_0x31f286,_0xa155('0xf'));_0x1a4217(_0x7e6467[_0xa155('0x16')][_0xa155('0x15')]);}})[_0xa155('0x17')](function(_0x24088e){logger[_0xa155('0x13')](_0xa155('0xe'),_0x31f286,_0x24088e);_0xb554f2(_0x24088e);});});} \ No newline at end of file +var _0xb465=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1956c9,_0x2ad6b4){var _0x499d4=function(_0x2fa03f){while(--_0x2fa03f){_0x1956c9['push'](_0x1956c9['shift']());}};_0x499d4(++_0x2ad6b4);}(_0xb465,0x1d0));var _0x5b46=function(_0x33f36d,_0x36aa7a){_0x33f36d=_0x33f36d-0x0;var _0x50cbc1=_0xb465[_0x33f36d];return _0x50cbc1;};'use strict';var _=require(_0x5b46('0x0'));var util=require(_0x5b46('0x1'));var moment=require(_0x5b46('0x2'));var BPromise=require(_0x5b46('0x3'));var rs=require(_0x5b46('0x4'));var fs=require('fs');var Redis=require(_0x5b46('0x5'));var db=require(_0x5b46('0x6'))['db'];var utils=require(_0x5b46('0x7'));var logger=require(_0x5b46('0x8'))('rpc');var config=require(_0x5b46('0x9'));var jayson=require(_0x5b46('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x37f00e,_0x5976a5,_0x1e76c7){return new BPromise(function(_0x53507d,_0x146e14){return client[_0x5b46('0xb')](_0x37f00e,_0x1e76c7)[_0x5b46('0xc')](function(_0x223a20){logger[_0x5b46('0xd')](_0x5b46('0xe'),_0x5976a5,_0x5b46('0xf'));logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x5976a5,_0x5b46('0xf'),JSON[_0x5b46('0x10')](_0x223a20));if(_0x223a20[_0x5b46('0x11')]){if(_0x223a20['error'][_0x5b46('0x12')]===0x1f4){logger[_0x5b46('0x11')](_0x5b46('0xe'),_0x5976a5,_0x223a20[_0x5b46('0x11')][_0x5b46('0x13')]);return _0x146e14(_0x223a20[_0x5b46('0x11')][_0x5b46('0x13')]);}logger[_0x5b46('0x11')](_0x5b46('0xe'),_0x5976a5,_0x223a20['error'][_0x5b46('0x13')]);return _0x53507d(_0x223a20[_0x5b46('0x11')][_0x5b46('0x13')]);}else{logger[_0x5b46('0xd')](_0x5b46('0xe'),_0x5976a5,_0x5b46('0xf'));_0x53507d(_0x223a20[_0x5b46('0x14')]['message']);}})[_0x5b46('0x15')](function(_0x2404fb){logger['error'](_0x5b46('0xe'),_0x5976a5,_0x2404fb);_0x146e14(_0x2404fb);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 849b505..0f3ac27 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 _0x96cc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x40576b,_0x280b79){var _0x39d545=function(_0x3d6c28){while(--_0x3d6c28){_0x40576b['push'](_0x40576b['shift']());}};_0x39d545(++_0x280b79);}(_0x96cc,0x16c));var _0xc96c=function(_0x5b4c14,_0x4d8a49){_0x5b4c14=_0x5b4c14-0x0;var _0x4108e8=_0x96cc[_0x5b4c14];return _0x4108e8;};'use strict';var multer=require(_0xc96c('0x0'));var util=require('util');var path=require(_0xc96c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc96c('0x2'));var router=express[_0xc96c('0x3')]();var fs_extra=require(_0xc96c('0x4'));var auth=require(_0xc96c('0x5'));var interaction=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var controller=require(_0xc96c('0x8'));router[_0xc96c('0x9')]('/',auth[_0xc96c('0xa')](),controller['index']);router[_0xc96c('0x9')](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xc')]);router[_0xc96c('0x9')](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller['getConfigurations']);router[_0xc96c('0x9')](_0xc96c('0xe'),auth[_0xc96c('0xa')](),controller['getFields']);router[_0xc96c('0xf')]('/',auth['isAuthenticated'](),controller[_0xc96c('0x10')]);router['post'](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller[_0xc96c('0x11')]);router[_0xc96c('0x12')]('/:id',auth[_0xc96c('0xa')](),controller[_0xc96c('0x13')]);router[_0xc96c('0x14')](_0xc96c('0xb'),auth['isAuthenticated'](),controller[_0xc96c('0x15')]);module[_0xc96c('0x16')]=router; \ No newline at end of file +var _0x0972=['create','addConfiguration','put','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x0972,0x64));var _0x2097=function(_0x1ef7c6,_0x4dabd2){_0x1ef7c6=_0x1ef7c6-0x0;var _0x5c96ff=_0x0972[_0x1ef7c6];return _0x5c96ff;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/:id',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['getConfigurations']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0xe')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0xe')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller[_0x2097('0x10')]);router[_0x2097('0x11')](_0x2097('0x12'),auth[_0x2097('0x8')](),controller[_0x2097('0x13')]);router[_0x2097('0x14')](_0x2097('0x12'),auth[_0x2097('0x8')](),controller[_0x2097('0x15')]);module[_0x2097('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 c163703..8ed2350 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 _0x524e=['username','remoteUri','STRING'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x524e,0x15e));var _0xe524=function(_0x39d7c5,_0x25ef7a){_0x39d7c5=_0x39d7c5-0x0;var _0x4b673e=_0x524e[_0x39d7c5];return _0x4b673e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe524('0x0')]},'description':{'type':Sequelize[_0xe524('0x0')]},'username':{'type':Sequelize[_0xe524('0x0')],'unique':_0xe524('0x1')},'apiKey':{'type':Sequelize[_0xe524('0x0')]},'remoteUri':{'type':Sequelize[_0xe524('0x0')],'unique':_0xe524('0x2')},'serverUrl':{'type':Sequelize[_0xe524('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0xdd4f=['username','remoteUri','sequelize','STRING'];(function(_0x3dcb32,_0x28c7fd){var _0x2ce602=function(_0x3012e3){while(--_0x3012e3){_0x3dcb32['push'](_0x3dcb32['shift']());}};_0x2ce602(++_0x28c7fd);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x33b242,_0x5af80b){_0x33b242=_0x33b242-0x0;var _0x5d7602=_0xdd4f[_0x33b242];return _0x5d7602;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfdd4('0x1')],'unique':_0xfdd4('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xfdd4('0x1')],'unique':_0xfdd4('0x3')},'serverUrl':{'type':Sequelize[_0xfdd4('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index abccd11..c9f982f 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 _0xa080=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','name','send','index','FreshsalesAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','findAll','catch','show','params','includeAll','include','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','order','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x4148e0,_0x1e9ceb){var _0x26af68=function(_0x13586f){while(--_0x13586f){_0x4148e0['push'](_0x4148e0['shift']());}};_0x26af68(++_0x1e9ceb);}(_0xa080,0x12c));var _0x0a08=function(_0x2793c,_0x3bbd07){_0x2793c=_0x2793c-0x0;var _0x1201fe=_0xa080[_0x2793c];return _0x1201fe;};'use strict';var emlformat=require(_0x0a08('0x0'));var rimraf=require(_0x0a08('0x1'));var zipdir=require(_0x0a08('0x2'));var jsonpatch=require(_0x0a08('0x3'));var rp=require(_0x0a08('0x4'));var moment=require(_0x0a08('0x5'));var BPromise=require(_0x0a08('0x6'));var Mustache=require(_0x0a08('0x7'));var util=require(_0x0a08('0x8'));var path=require(_0x0a08('0x9'));var sox=require(_0x0a08('0xa'));var csv=require(_0x0a08('0xb'));var ejs=require(_0x0a08('0xc'));var fs=require('fs');var fs_extra=require(_0x0a08('0xd'));var _=require(_0x0a08('0xe'));var squel=require(_0x0a08('0xf'));var crypto=require(_0x0a08('0x10'));var jsforce=require(_0x0a08('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0a08('0x12'));var Papa=require(_0x0a08('0x13'));var Redis=require('ioredis');var authService=require(_0x0a08('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a08('0x15'));var logger=require('../../config/logger')(_0x0a08('0x16'));var utils=require(_0x0a08('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0a08('0x18'));var db=require(_0x0a08('0x19'))['db'];var integrations=require(_0x0a08('0x1a'));function respondWithStatusCode(_0x379ad0,_0x308d77){_0x308d77=_0x308d77||0xcc;return function(_0xc1927a){if(_0xc1927a){return _0x379ad0[_0x0a08('0x1b')](_0x308d77);}return _0x379ad0[_0x0a08('0x1c')](_0x308d77)[_0x0a08('0x1d')]();};}function respondWithResult(_0x580a25,_0x29f8be){_0x29f8be=_0x29f8be||0xc8;return function(_0x6a0c7f){if(_0x6a0c7f){return _0x580a25[_0x0a08('0x1c')](_0x29f8be)[_0x0a08('0x1e')](_0x6a0c7f);}};}function respondWithFilteredResult(_0x3ddc24,_0x31e31a){return function(_0x52895c){if(_0x52895c){var _0x2a5ef9=typeof _0x31e31a[_0x0a08('0x1f')]===_0x0a08('0x20')&&typeof _0x31e31a['limit']===_0x0a08('0x20');var _0x26a987=_0x52895c[_0x0a08('0x21')];var _0x3de33a=_0x2a5ef9?0x0:_0x31e31a[_0x0a08('0x1f')];var _0x5ae293=_0x2a5ef9?_0x52895c['count']:_0x31e31a[_0x0a08('0x1f')]+_0x31e31a['limit'];var _0x24aad8;if(_0x5ae293>=_0x26a987){_0x5ae293=_0x26a987;_0x24aad8=0xc8;}else{_0x24aad8=0xce;}_0x3ddc24[_0x0a08('0x1c')](_0x24aad8);return _0x3ddc24[_0x0a08('0x22')](_0x0a08('0x23'),_0x3de33a+'-'+_0x5ae293+'/'+_0x26a987)[_0x0a08('0x1e')](_0x52895c);}return null;};}function patchUpdates(_0x118125){return function(_0x141829){try{jsonpatch[_0x0a08('0x24')](_0x141829,_0x118125,!![]);}catch(_0x3315f4){return BPromise[_0x0a08('0x25')](_0x3315f4);}return _0x141829[_0x0a08('0x26')]();};}function saveUpdates(_0x505eff,_0x40a81f){return function(_0x565897){if(_0x565897){return _0x565897['update'](_0x505eff)[_0x0a08('0x27')](function(_0x1e5e69){return _0x1e5e69;});}return null;};}function removeEntity(_0x5f3650,_0x2451c4){return function(_0x41f9ba){if(_0x41f9ba){return _0x41f9ba[_0x0a08('0x28')]()[_0x0a08('0x27')](function(){_0x5f3650[_0x0a08('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd2bcf3,_0x42537a){return function(_0x27ae6d){if(!_0x27ae6d){_0xd2bcf3[_0x0a08('0x1b')](0x194);}return _0x27ae6d;};}function handleError(_0x492fd9,_0x4eb224){_0x4eb224=_0x4eb224||0x1f4;return function(_0x25757b){logger['error'](_0x25757b['stack']);if(_0x25757b[_0x0a08('0x29')]){delete _0x25757b[_0x0a08('0x29')];}_0x492fd9[_0x0a08('0x1c')](_0x4eb224)[_0x0a08('0x2a')](_0x25757b);};}exports[_0x0a08('0x2b')]=function(_0x34d490,_0x552a23){var _0x4da2d0={},_0x5ad5c8={},_0x4c1577={'count':0x0,'rows':[]};var _0x5c3667=_['map'](db[_0x0a08('0x2c')][_0x0a08('0x2d')],function(_0x1a33d7){return{'name':_0x1a33d7['fieldName'],'type':_0x1a33d7[_0x0a08('0x2e')][_0x0a08('0x2f')]};});_0x5ad5c8[_0x0a08('0x30')]=_['map'](_0x5c3667,_0x0a08('0x29'));_0x5ad5c8[_0x0a08('0x31')]=_[_0x0a08('0x32')](_0x34d490['query']);_0x5ad5c8[_0x0a08('0x33')]=_[_0x0a08('0x34')](_0x5ad5c8[_0x0a08('0x30')],_0x5ad5c8[_0x0a08('0x31')]);_0x4da2d0['attributes']=_[_0x0a08('0x34')](_0x5ad5c8['model'],qs[_0x0a08('0x35')](_0x34d490[_0x0a08('0x31')][_0x0a08('0x35')]));_0x4da2d0['attributes']=_0x4da2d0[_0x0a08('0x36')][_0x0a08('0x37')]?_0x4da2d0['attributes']:_0x5ad5c8[_0x0a08('0x30')];if(!_0x34d490[_0x0a08('0x31')][_0x0a08('0x38')](_0x0a08('0x39'))){_0x4da2d0['limit']=qs['limit'](_0x34d490[_0x0a08('0x31')][_0x0a08('0x3a')]);_0x4da2d0[_0x0a08('0x1f')]=qs[_0x0a08('0x1f')](_0x34d490[_0x0a08('0x31')][_0x0a08('0x1f')]);}_0x4da2d0['order']=qs[_0x0a08('0x3b')](_0x34d490[_0x0a08('0x31')][_0x0a08('0x3b')]);_0x4da2d0[_0x0a08('0x3c')]=qs[_0x0a08('0x33')](_['pick'](_0x34d490[_0x0a08('0x31')],_0x5ad5c8['filters']),_0x5c3667);if(_0x34d490[_0x0a08('0x31')][_0x0a08('0x3d')]){_0x4da2d0['where']=_[_0x0a08('0x3e')](_0x4da2d0[_0x0a08('0x3c')],{'$or':_['map'](_0x5c3667,function(_0x2f359d){if(_0x2f359d[_0x0a08('0x2e')]!==_0x0a08('0x3f')){var _0x3df421={};_0x3df421[_0x2f359d[_0x0a08('0x29')]]={'$like':'%'+_0x34d490[_0x0a08('0x31')][_0x0a08('0x3d')]+'%'};return _0x3df421;}})});}_0x4da2d0=_[_0x0a08('0x3e')]({},_0x4da2d0,_0x34d490[_0x0a08('0x40')]);var _0x13f2aa={'where':_0x4da2d0['where']};return db[_0x0a08('0x2c')][_0x0a08('0x21')](_0x13f2aa)['then'](function(_0x428782){_0x4c1577[_0x0a08('0x21')]=_0x428782;if(_0x34d490[_0x0a08('0x31')]['includeAll']){_0x4da2d0['include']=[{'all':!![]}];}return db[_0x0a08('0x2c')][_0x0a08('0x41')](_0x4da2d0);})[_0x0a08('0x27')](function(_0xddfb53){_0x4c1577['rows']=_0xddfb53;return _0x4c1577;})[_0x0a08('0x27')](respondWithFilteredResult(_0x552a23,_0x4da2d0))[_0x0a08('0x42')](handleError(_0x552a23,null));};exports[_0x0a08('0x43')]=function(_0x1fb3e9,_0x698555){var _0x166458={'raw':![],'where':{'id':_0x1fb3e9[_0x0a08('0x44')]['id']}},_0x3fccf4={};_0x3fccf4[_0x0a08('0x30')]=_['keys'](db[_0x0a08('0x2c')][_0x0a08('0x2d')]);_0x3fccf4[_0x0a08('0x31')]=_[_0x0a08('0x32')](_0x1fb3e9[_0x0a08('0x31')]);_0x3fccf4[_0x0a08('0x33')]=_['intersection'](_0x3fccf4['model'],_0x3fccf4[_0x0a08('0x31')]);_0x166458[_0x0a08('0x36')]=_[_0x0a08('0x34')](_0x3fccf4[_0x0a08('0x30')],qs[_0x0a08('0x35')](_0x1fb3e9[_0x0a08('0x31')]['fields']));_0x166458[_0x0a08('0x36')]=_0x166458[_0x0a08('0x36')][_0x0a08('0x37')]?_0x166458[_0x0a08('0x36')]:_0x3fccf4[_0x0a08('0x30')];if(_0x1fb3e9[_0x0a08('0x31')][_0x0a08('0x45')]){_0x166458[_0x0a08('0x46')]=[{'all':!![]}];}_0x166458=_[_0x0a08('0x3e')]({},_0x166458,_0x1fb3e9['options']);return db[_0x0a08('0x2c')][_0x0a08('0x47')](_0x166458)['then'](handleEntityNotFound(_0x698555,null))[_0x0a08('0x27')](respondWithResult(_0x698555,null))[_0x0a08('0x42')](handleError(_0x698555,null));};exports[_0x0a08('0x48')]=function(_0x6fbf76,_0xeeafff){return db[_0x0a08('0x2c')][_0x0a08('0x48')](_0x6fbf76[_0x0a08('0x49')],{})[_0x0a08('0x27')](respondWithResult(_0xeeafff,0xc9))['catch'](handleError(_0xeeafff,null));};exports['update']=function(_0x2cfed8,_0x15787e){if(_0x2cfed8[_0x0a08('0x49')]['id']){delete _0x2cfed8[_0x0a08('0x49')]['id'];}return db[_0x0a08('0x2c')][_0x0a08('0x47')]({'where':{'id':_0x2cfed8[_0x0a08('0x44')]['id']}})[_0x0a08('0x27')](handleEntityNotFound(_0x15787e,null))[_0x0a08('0x27')](saveUpdates(_0x2cfed8[_0x0a08('0x49')],null))[_0x0a08('0x27')](respondWithResult(_0x15787e,null))['catch'](handleError(_0x15787e,null));};exports[_0x0a08('0x28')]=function(_0x34e650,_0x44bfa6){return db[_0x0a08('0x2c')][_0x0a08('0x47')]({'where':{'id':_0x34e650[_0x0a08('0x44')]['id']}})[_0x0a08('0x27')](handleEntityNotFound(_0x44bfa6,null))[_0x0a08('0x27')](removeEntity(_0x44bfa6,null))[_0x0a08('0x42')](handleError(_0x44bfa6,null));};exports[_0x0a08('0x4a')]=function(_0x116fd9,_0x1ae9aa,_0x4f2566){var _0x2e8557={};var _0x600cfe={};var _0x8846be;var _0x16574a;return db[_0x0a08('0x2c')][_0x0a08('0x4b')]({'where':{'id':_0x116fd9[_0x0a08('0x44')]['id']}})[_0x0a08('0x27')](handleEntityNotFound(_0x1ae9aa,null))[_0x0a08('0x27')](function(_0x38cc4a){if(_0x38cc4a){_0x8846be=_0x38cc4a;_0x600cfe['model']=_[_0x0a08('0x32')](db[_0x0a08('0x4c')][_0x0a08('0x2d')]);_0x600cfe['query']=_[_0x0a08('0x32')](_0x116fd9['query']);_0x600cfe['filters']=_['intersection'](_0x600cfe['model'],_0x600cfe[_0x0a08('0x31')]);_0x2e8557['attributes']=_[_0x0a08('0x34')](_0x600cfe[_0x0a08('0x30')],qs[_0x0a08('0x35')](_0x116fd9[_0x0a08('0x31')][_0x0a08('0x35')]));_0x2e8557[_0x0a08('0x36')]=_0x2e8557[_0x0a08('0x36')][_0x0a08('0x37')]?_0x2e8557[_0x0a08('0x36')]:_0x600cfe[_0x0a08('0x30')];_0x2e8557[_0x0a08('0x4d')]=qs[_0x0a08('0x3b')](_0x116fd9[_0x0a08('0x31')][_0x0a08('0x3b')]);_0x2e8557['where']=qs[_0x0a08('0x33')](_[_0x0a08('0x4e')](_0x116fd9[_0x0a08('0x31')],_0x600cfe[_0x0a08('0x33')]));if(_0x116fd9['query'][_0x0a08('0x3d')]){_0x2e8557['where']=_[_0x0a08('0x3e')](_0x2e8557[_0x0a08('0x3c')],{'$or':_['map'](_0x2e8557[_0x0a08('0x36')],function(_0x4dc12a){var _0x104304={};_0x104304[_0x4dc12a]={'$like':'%'+_0x116fd9[_0x0a08('0x31')][_0x0a08('0x3d')]+'%'};return _0x104304;})});}_0x2e8557=_[_0x0a08('0x3e')]({},_0x2e8557,_0x116fd9['options']);return _0x8846be['getConfigurations'](_0x2e8557);}})['then'](function(_0x3b4915){if(_0x3b4915){_0x16574a=_0x3b4915[_0x0a08('0x37')];if(!_0x116fd9[_0x0a08('0x31')][_0x0a08('0x38')](_0x0a08('0x39'))){_0x2e8557[_0x0a08('0x3a')]=qs[_0x0a08('0x3a')](_0x116fd9[_0x0a08('0x31')]['limit']);_0x2e8557[_0x0a08('0x1f')]=qs[_0x0a08('0x1f')](_0x116fd9[_0x0a08('0x31')][_0x0a08('0x1f')]);}return _0x8846be['getConfigurations'](_0x2e8557);}})[_0x0a08('0x27')](function(_0x34b894){if(_0x34b894){return _0x34b894?{'count':_0x16574a,'rows':_0x34b894}:null;}})[_0x0a08('0x27')](respondWithResult(_0x1ae9aa,null))[_0x0a08('0x42')](handleError(_0x1ae9aa,null));};exports[_0x0a08('0x4f')]=function(_0x401818,_0xbfd6be,_0x5d5f2b){if(_0x401818[_0x0a08('0x49')]['id']){delete _0x401818['body']['id'];}return db[_0x0a08('0x2c')][_0x0a08('0x4b')]({'where':{'id':_0x401818[_0x0a08('0x44')]['id']}})[_0x0a08('0x27')](handleEntityNotFound(_0xbfd6be,null))['then'](function(_0x2ed4e6){if(_0x2ed4e6){_0x401818[_0x0a08('0x49')][_0x0a08('0x50')]=_0x2ed4e6['id'];_0x401818['body'][_0x0a08('0x51')]=integrations[_0x0a08('0x52')](_0x401818['body'][_0x0a08('0x53')],_0x401818[_0x0a08('0x49')]['type']);_0x401818[_0x0a08('0x49')][_0x0a08('0x54')]=integrations[_0x0a08('0x55')](_0x401818[_0x0a08('0x49')][_0x0a08('0x53')],_0x401818['body'][_0x0a08('0x2e')]);return db[_0x0a08('0x4c')][_0x0a08('0x48')](_0x401818[_0x0a08('0x49')],{'include':[{'model':db[_0x0a08('0x56')],'as':_0x0a08('0x51')},{'model':db[_0x0a08('0x56')],'as':_0x0a08('0x54')}]});}return null;})[_0x0a08('0x27')](respondWithResult(_0xbfd6be,null))[_0x0a08('0x42')](handleError(_0xbfd6be,null));};exports['getFields']=function(_0x3a86da,_0x76da95,_0x41378c){var _0x12bba2='';var _0x313e1f='';return db['FreshsalesAccount'][_0x0a08('0x4b')]({'where':{'id':_0x3a86da[_0x0a08('0x44')]['id']},'attributes':['id','username',_0x0a08('0x57'),_0x0a08('0x58')]})[_0x0a08('0x27')](handleEntityNotFound(_0x76da95,null))[_0x0a08('0x27')](function(_0x317168){if(_0x317168){_0x313e1f=_0x317168['username'];_0x12bba2=_0x317168[_0x0a08('0x57')];var _0xf0e104=_0x317168[_0x0a08('0x57')][_0x0a08('0x59')](-0x1);if(_0xf0e104==='/'){_0x12bba2=_0x12bba2[_0x0a08('0x5a')](0x0,_0x12bba2[_0x0a08('0x5b')](_0xf0e104));}return rp({'method':_0x0a08('0x5c'),'uri':util[_0x0a08('0x5d')](_0x0a08('0x5e'),_0x12bba2,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x317168[_0x0a08('0x58')]},'json':!![]});}})[_0x0a08('0x27')](function(_0xc8fff3){if(_0xc8fff3){var _0x471a53=_0xc8fff3[_0x0a08('0x5f')];var _0x123ea5=![];var _0x18c7dc=null;for(_0x18c7dc=0x0;_0x18c7dc<_0x471a53[_0x0a08('0x37')];_0x18c7dc++){if(_0x471a53[_0x18c7dc][_0x0a08('0x60')]===_0x313e1f){_0x123ea5=!![];}}if(_0x123ea5){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x0a08('0x61')});}}})[_0x0a08('0x27')](respondWithResult(_0x76da95,null))[_0x0a08('0x42')](function(_0x1368ec){var _0x304219=_0x3a86da['query'][_0x0a08('0x62')]?0x1f4:_0x1368ec[_0x0a08('0x63')]||0x1f4;logger[_0x0a08('0x64')](_0x0a08('0x65'),_0x0a08('0x66'),_0x304219,JSON[_0x0a08('0x67')](_0x1368ec));delete _0x1368ec[_0x0a08('0x29')];if(_0x304219===0x191){_0x304219=0x190;}_0x76da95[_0x0a08('0x1c')](_0x304219)[_0x0a08('0x2a')](_0x3a86da[_0x0a08('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1368ec[_0x0a08('0x63')]}:_0x1368ec);});}; \ No newline at end of file +var _0x5c31=['getSubjects','channel','FreshsalesField','username','apiKey','remoteUri','slice','lastIndexOf','%s%s','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','FreshsalesAccount','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','merge','filter','options','findAll','rows','catch','show','keys','include','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','order','addConfiguration','AccountId'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x5c31,0x71));var _0x15c3=function(_0x2c21d3,_0xb8f7be){_0x2c21d3=_0x2c21d3-0x0;var _0x5a0de3=_0x5c31[_0x2c21d3];return _0x5a0de3;};'use strict';var emlformat=require(_0x15c3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x15c3('0x1'));var moment=require(_0x15c3('0x2'));var BPromise=require(_0x15c3('0x3'));var Mustache=require(_0x15c3('0x4'));var util=require(_0x15c3('0x5'));var path=require('path');var sox=require(_0x15c3('0x6'));var csv=require(_0x15c3('0x7'));var ejs=require(_0x15c3('0x8'));var fs=require('fs');var fs_extra=require(_0x15c3('0x9'));var _=require('lodash');var squel=require(_0x15c3('0xa'));var crypto=require(_0x15c3('0xb'));var jsforce=require(_0x15c3('0xc'));var deskjs=require(_0x15c3('0xd'));var toCsv=require(_0x15c3('0x7'));var querystring=require(_0x15c3('0xe'));var Papa=require(_0x15c3('0xf'));var Redis=require('ioredis');var authService=require(_0x15c3('0x10'));var qs=require(_0x15c3('0x11'));var as=require(_0x15c3('0x12'));var hardwareService=require(_0x15c3('0x13'));var logger=require('../../config/logger')(_0x15c3('0x14'));var utils=require(_0x15c3('0x15'));var config=require(_0x15c3('0x16'));var licenseUtil=require(_0x15c3('0x17'));var db=require(_0x15c3('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x172e71,_0x505658){_0x505658=_0x505658||0xcc;return function(_0x4f5884){if(_0x4f5884){return _0x172e71['sendStatus'](_0x505658);}return _0x172e71['status'](_0x505658)[_0x15c3('0x19')]();};}function respondWithResult(_0x4d32be,_0x520239){_0x520239=_0x520239||0xc8;return function(_0x3b511d){if(_0x3b511d){return _0x4d32be[_0x15c3('0x1a')](_0x520239)[_0x15c3('0x1b')](_0x3b511d);}};}function respondWithFilteredResult(_0x4e1de3,_0x5e5492){return function(_0x1c4704){if(_0x1c4704){var _0x23cc0c=typeof _0x5e5492[_0x15c3('0x1c')]===_0x15c3('0x1d')&&typeof _0x5e5492[_0x15c3('0x1e')]===_0x15c3('0x1d');var _0x5c57af=_0x1c4704[_0x15c3('0x1f')];var _0x41472d=_0x23cc0c?0x0:_0x5e5492[_0x15c3('0x1c')];var _0x2c2cfc=_0x23cc0c?_0x1c4704['count']:_0x5e5492['offset']+_0x5e5492[_0x15c3('0x1e')];var _0x5f366a;if(_0x2c2cfc>=_0x5c57af){_0x2c2cfc=_0x5c57af;_0x5f366a=0xc8;}else{_0x5f366a=0xce;}_0x4e1de3['status'](_0x5f366a);return _0x4e1de3[_0x15c3('0x20')](_0x15c3('0x21'),_0x41472d+'-'+_0x2c2cfc+'/'+_0x5c57af)[_0x15c3('0x1b')](_0x1c4704);}return null;};}function patchUpdates(_0x4f4851){return function(_0x5f03e5){try{jsonpatch[_0x15c3('0x22')](_0x5f03e5,_0x4f4851,!![]);}catch(_0x5028ee){return BPromise[_0x15c3('0x23')](_0x5028ee);}return _0x5f03e5[_0x15c3('0x24')]();};}function saveUpdates(_0x4ce152,_0x4995dd){return function(_0x399767){if(_0x399767){return _0x399767[_0x15c3('0x25')](_0x4ce152)[_0x15c3('0x26')](function(_0x236427){return _0x236427;});}return null;};}function removeEntity(_0x57ad21,_0x295b17){return function(_0x5adcac){if(_0x5adcac){return _0x5adcac[_0x15c3('0x27')]()['then'](function(){_0x57ad21['status'](0xcc)[_0x15c3('0x19')]();});}};}function handleEntityNotFound(_0x371587,_0x4a85b1){return function(_0x26768f){if(!_0x26768f){_0x371587[_0x15c3('0x28')](0x194);}return _0x26768f;};}function handleError(_0x312526,_0x13fdd4){_0x13fdd4=_0x13fdd4||0x1f4;return function(_0x117014){logger[_0x15c3('0x29')](_0x117014[_0x15c3('0x2a')]);if(_0x117014[_0x15c3('0x2b')]){delete _0x117014[_0x15c3('0x2b')];}_0x312526['status'](_0x13fdd4)[_0x15c3('0x2c')](_0x117014);};}exports['index']=function(_0x45097c,_0x2f7761){var _0x22d377={},_0x334658={},_0x207812={'count':0x0,'rows':[]};var _0x35d9fa=_[_0x15c3('0x2d')](db[_0x15c3('0x2e')][_0x15c3('0x2f')],function(_0x2fd19b){return{'name':_0x2fd19b['fieldName'],'type':_0x2fd19b[_0x15c3('0x30')][_0x15c3('0x31')]};});_0x334658[_0x15c3('0x32')]=_[_0x15c3('0x2d')](_0x35d9fa,_0x15c3('0x2b'));_0x334658['query']=_['keys'](_0x45097c[_0x15c3('0x33')]);_0x334658[_0x15c3('0x34')]=_['intersection'](_0x334658[_0x15c3('0x32')],_0x334658['query']);_0x22d377[_0x15c3('0x35')]=_[_0x15c3('0x36')](_0x334658['model'],qs[_0x15c3('0x37')](_0x45097c['query']['fields']));_0x22d377[_0x15c3('0x35')]=_0x22d377[_0x15c3('0x35')][_0x15c3('0x38')]?_0x22d377[_0x15c3('0x35')]:_0x334658[_0x15c3('0x32')];if(!_0x45097c[_0x15c3('0x33')][_0x15c3('0x39')]('nolimit')){_0x22d377[_0x15c3('0x1e')]=qs[_0x15c3('0x1e')](_0x45097c[_0x15c3('0x33')][_0x15c3('0x1e')]);_0x22d377[_0x15c3('0x1c')]=qs[_0x15c3('0x1c')](_0x45097c[_0x15c3('0x33')]['offset']);}_0x22d377['order']=qs[_0x15c3('0x3a')](_0x45097c[_0x15c3('0x33')][_0x15c3('0x3a')]);_0x22d377[_0x15c3('0x3b')]=qs[_0x15c3('0x34')](_['pick'](_0x45097c[_0x15c3('0x33')],_0x334658['filters']),_0x35d9fa);if(_0x45097c[_0x15c3('0x33')]['filter']){_0x22d377['where']=_[_0x15c3('0x3c')](_0x22d377[_0x15c3('0x3b')],{'$or':_[_0x15c3('0x2d')](_0x35d9fa,function(_0x12f938){if(_0x12f938[_0x15c3('0x30')]!=='VIRTUAL'){var _0x6aa71={};_0x6aa71[_0x12f938[_0x15c3('0x2b')]]={'$like':'%'+_0x45097c[_0x15c3('0x33')][_0x15c3('0x3d')]+'%'};return _0x6aa71;}})});}_0x22d377=_[_0x15c3('0x3c')]({},_0x22d377,_0x45097c[_0x15c3('0x3e')]);var _0x1dac66={'where':_0x22d377[_0x15c3('0x3b')]};return db['FreshsalesAccount'][_0x15c3('0x1f')](_0x1dac66)[_0x15c3('0x26')](function(_0x2f99e8){_0x207812[_0x15c3('0x1f')]=_0x2f99e8;if(_0x45097c['query']['includeAll']){_0x22d377['include']=[{'all':!![]}];}return db[_0x15c3('0x2e')][_0x15c3('0x3f')](_0x22d377);})['then'](function(_0x453192){_0x207812[_0x15c3('0x40')]=_0x453192;return _0x207812;})[_0x15c3('0x26')](respondWithFilteredResult(_0x2f7761,_0x22d377))[_0x15c3('0x41')](handleError(_0x2f7761,null));};exports[_0x15c3('0x42')]=function(_0x4b3088,_0x425c4f){var _0x8f656d={'raw':![],'where':{'id':_0x4b3088['params']['id']}},_0x2068a7={};_0x2068a7[_0x15c3('0x32')]=_['keys'](db[_0x15c3('0x2e')][_0x15c3('0x2f')]);_0x2068a7[_0x15c3('0x33')]=_[_0x15c3('0x43')](_0x4b3088[_0x15c3('0x33')]);_0x2068a7[_0x15c3('0x34')]=_['intersection'](_0x2068a7[_0x15c3('0x32')],_0x2068a7['query']);_0x8f656d[_0x15c3('0x35')]=_[_0x15c3('0x36')](_0x2068a7[_0x15c3('0x32')],qs[_0x15c3('0x37')](_0x4b3088['query']['fields']));_0x8f656d['attributes']=_0x8f656d[_0x15c3('0x35')][_0x15c3('0x38')]?_0x8f656d[_0x15c3('0x35')]:_0x2068a7[_0x15c3('0x32')];if(_0x4b3088[_0x15c3('0x33')]['includeAll']){_0x8f656d[_0x15c3('0x44')]=[{'all':!![]}];}_0x8f656d=_[_0x15c3('0x3c')]({},_0x8f656d,_0x4b3088[_0x15c3('0x3e')]);return db[_0x15c3('0x2e')][_0x15c3('0x45')](_0x8f656d)[_0x15c3('0x26')](handleEntityNotFound(_0x425c4f,null))[_0x15c3('0x26')](respondWithResult(_0x425c4f,null))[_0x15c3('0x41')](handleError(_0x425c4f,null));};exports[_0x15c3('0x46')]=function(_0xeda779,_0x4b4dab){return db['FreshsalesAccount'][_0x15c3('0x46')](_0xeda779[_0x15c3('0x47')],{})['then'](respondWithResult(_0x4b4dab,0xc9))[_0x15c3('0x41')](handleError(_0x4b4dab,null));};exports['update']=function(_0x52a4eb,_0x589915){if(_0x52a4eb[_0x15c3('0x47')]['id']){delete _0x52a4eb[_0x15c3('0x47')]['id'];}return db[_0x15c3('0x2e')]['find']({'where':{'id':_0x52a4eb['params']['id']}})[_0x15c3('0x26')](handleEntityNotFound(_0x589915,null))[_0x15c3('0x26')](saveUpdates(_0x52a4eb['body'],null))[_0x15c3('0x26')](respondWithResult(_0x589915,null))['catch'](handleError(_0x589915,null));};exports[_0x15c3('0x27')]=function(_0x45fe4a,_0x154ed0){return db['FreshsalesAccount']['find']({'where':{'id':_0x45fe4a[_0x15c3('0x48')]['id']}})[_0x15c3('0x26')](handleEntityNotFound(_0x154ed0,null))[_0x15c3('0x26')](removeEntity(_0x154ed0,null))[_0x15c3('0x41')](handleError(_0x154ed0,null));};exports[_0x15c3('0x49')]=function(_0x595f91,_0x2208cd,_0xe94e05){var _0x5c135f={};var _0x4f07c4={};var _0x28c27a;var _0x110115;return db[_0x15c3('0x2e')][_0x15c3('0x4a')]({'where':{'id':_0x595f91['params']['id']}})[_0x15c3('0x26')](handleEntityNotFound(_0x2208cd,null))['then'](function(_0x4f8d9b){if(_0x4f8d9b){_0x28c27a=_0x4f8d9b;_0x4f07c4[_0x15c3('0x32')]=_['keys'](db[_0x15c3('0x4b')][_0x15c3('0x2f')]);_0x4f07c4[_0x15c3('0x33')]=_['keys'](_0x595f91[_0x15c3('0x33')]);_0x4f07c4['filters']=_[_0x15c3('0x36')](_0x4f07c4[_0x15c3('0x32')],_0x4f07c4[_0x15c3('0x33')]);_0x5c135f[_0x15c3('0x35')]=_[_0x15c3('0x36')](_0x4f07c4[_0x15c3('0x32')],qs[_0x15c3('0x37')](_0x595f91['query']['fields']));_0x5c135f[_0x15c3('0x35')]=_0x5c135f[_0x15c3('0x35')]['length']?_0x5c135f[_0x15c3('0x35')]:_0x4f07c4[_0x15c3('0x32')];_0x5c135f[_0x15c3('0x4c')]=qs[_0x15c3('0x3a')](_0x595f91[_0x15c3('0x33')][_0x15c3('0x3a')]);_0x5c135f[_0x15c3('0x3b')]=qs[_0x15c3('0x34')](_['pick'](_0x595f91[_0x15c3('0x33')],_0x4f07c4[_0x15c3('0x34')]));if(_0x595f91[_0x15c3('0x33')][_0x15c3('0x3d')]){_0x5c135f['where']=_[_0x15c3('0x3c')](_0x5c135f['where'],{'$or':_[_0x15c3('0x2d')](_0x5c135f[_0x15c3('0x35')],function(_0x1928a9){var _0x1eb726={};_0x1eb726[_0x1928a9]={'$like':'%'+_0x595f91[_0x15c3('0x33')][_0x15c3('0x3d')]+'%'};return _0x1eb726;})});}_0x5c135f=_[_0x15c3('0x3c')]({},_0x5c135f,_0x595f91[_0x15c3('0x3e')]);return _0x28c27a['getConfigurations'](_0x5c135f);}})[_0x15c3('0x26')](function(_0x186d22){if(_0x186d22){_0x110115=_0x186d22[_0x15c3('0x38')];if(!_0x595f91['query'][_0x15c3('0x39')]('nolimit')){_0x5c135f['limit']=qs[_0x15c3('0x1e')](_0x595f91[_0x15c3('0x33')]['limit']);_0x5c135f[_0x15c3('0x1c')]=qs[_0x15c3('0x1c')](_0x595f91[_0x15c3('0x33')]['offset']);}return _0x28c27a[_0x15c3('0x49')](_0x5c135f);}})[_0x15c3('0x26')](function(_0x413f8d){if(_0x413f8d){return _0x413f8d?{'count':_0x110115,'rows':_0x413f8d}:null;}})['then'](respondWithResult(_0x2208cd,null))['catch'](handleError(_0x2208cd,null));};exports[_0x15c3('0x4d')]=function(_0xc8b632,_0x5c93ef,_0x536c16){if(_0xc8b632[_0x15c3('0x47')]['id']){delete _0xc8b632[_0x15c3('0x47')]['id'];}return db[_0x15c3('0x2e')][_0x15c3('0x4a')]({'where':{'id':_0xc8b632[_0x15c3('0x48')]['id']}})[_0x15c3('0x26')](handleEntityNotFound(_0x5c93ef,null))[_0x15c3('0x26')](function(_0x13e30f){if(_0x13e30f){_0xc8b632[_0x15c3('0x47')][_0x15c3('0x4e')]=_0x13e30f['id'];_0xc8b632[_0x15c3('0x47')]['Subjects']=integrations[_0x15c3('0x4f')](_0xc8b632[_0x15c3('0x47')][_0x15c3('0x50')],_0xc8b632[_0x15c3('0x47')][_0x15c3('0x30')]);_0xc8b632['body']['Descriptions']=integrations['getDescriptions'](_0xc8b632[_0x15c3('0x47')][_0x15c3('0x50')],_0xc8b632[_0x15c3('0x47')]['type']);return db[_0x15c3('0x4b')]['create'](_0xc8b632[_0x15c3('0x47')],{'include':[{'model':db[_0x15c3('0x51')],'as':'Subjects'},{'model':db[_0x15c3('0x51')],'as':'Descriptions'}]});}return null;})[_0x15c3('0x26')](respondWithResult(_0x5c93ef,null))['catch'](handleError(_0x5c93ef,null));};exports['getFields']=function(_0x129798,_0x4e42e6,_0x639a64){var _0x428d95='';var _0x2f8845='';return db[_0x15c3('0x2e')][_0x15c3('0x4a')]({'where':{'id':_0x129798[_0x15c3('0x48')]['id']},'attributes':['id',_0x15c3('0x52'),'remoteUri',_0x15c3('0x53')]})['then'](handleEntityNotFound(_0x4e42e6,null))[_0x15c3('0x26')](function(_0x302716){if(_0x302716){_0x2f8845=_0x302716[_0x15c3('0x52')];_0x428d95=_0x302716[_0x15c3('0x54')];var _0x1772fc=_0x302716[_0x15c3('0x54')][_0x15c3('0x55')](-0x1);if(_0x1772fc==='/'){_0x428d95=_0x428d95['substring'](0x0,_0x428d95[_0x15c3('0x56')](_0x1772fc));}return rp({'method':'GET','uri':util['format'](_0x15c3('0x57'),_0x428d95,_0x15c3('0x58')),'headers':{'Authorization':_0x15c3('0x59')+_0x302716[_0x15c3('0x53')]},'json':!![]});}})[_0x15c3('0x26')](function(_0x26e267){if(_0x26e267){var _0x3c9774=_0x26e267['users'];var _0xe7b8c5=![];var _0x21f7fe=null;for(_0x21f7fe=0x0;_0x21f7fe<_0x3c9774[_0x15c3('0x38')];_0x21f7fe++){if(_0x3c9774[_0x21f7fe][_0x15c3('0x5a')]===_0x2f8845){_0xe7b8c5=!![];}}if(_0xe7b8c5){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x15c3('0x5b')});}}})[_0x15c3('0x26')](respondWithResult(_0x4e42e6,null))['catch'](function(_0x3afec0){var _0x358ada=_0x129798['query']['test']?0x1f4:_0x3afec0[_0x15c3('0x5c')]||0x1f4;logger['error'](_0x15c3('0x5d'),'getFields',_0x358ada,JSON['stringify'](_0x3afec0));delete _0x3afec0[_0x15c3('0x2b')];if(_0x358ada===0x191){_0x358ada=0x190;}_0x4e42e6[_0x15c3('0x1a')](_0x358ada)[_0x15c3('0x2c')](_0x129798[_0x15c3('0x33')][_0x15c3('0x5e')]?{'message':_0x15c3('0x5f'),'statusCode':_0x3afec0[_0x15c3('0x5c')]}:_0x3afec0);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index b5b12ba..d9dbaf9 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 _0x5430=['../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x40a77f,_0x1d5f8d){var _0x415aa1=function(_0x1e45bc){while(--_0x1e45bc){_0x40a77f['push'](_0x40a77f['shift']());}};_0x415aa1(++_0x1d5f8d);}(_0x5430,0x10c));var _0x0543=function(_0x19e820,_0x16136d){_0x19e820=_0x19e820-0x0;var _0x5bd151=_0x5430[_0x19e820];return _0x5bd151;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var logger=require(_0x0543('0x2'))(_0x0543('0x3'));var moment=require(_0x0543('0x4'));var BPromise=require(_0x0543('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0543('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x0543('0x7'));module[_0x0543('0x8')]=function(_0x9754ba,_0x319568){return _0x9754ba[_0x0543('0x9')]('FreshsalesAccount',attributes,{'tableName':_0x0543('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd117=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x37f112,_0x4b11da){var _0x400d42=function(_0x465185){while(--_0x465185){_0x37f112['push'](_0x37f112['shift']());}};_0x400d42(++_0x4b11da);}(_0xd117,0x182));var _0x7d11=function(_0xf72786,_0x1a0ddd){_0xf72786=_0xf72786-0x0;var _0x113f3e=_0xd117[_0xf72786];return _0x113f3e;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));var integrations=require(_0x7d11('0xb'));module[_0x7d11('0xc')]=function(_0x40c3c4,_0x345602){return _0x40c3c4[_0x7d11('0xd')]('FreshsalesAccount',attributes,{'tableName':_0x7d11('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index d4d6f72..f76f6d3 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 _0xfcf0=['request','info','FreshsalesAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','FreshsalesAccount','find','ShowFreshsalesAccount','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5b49d3,_0x24ba3f){var _0x8df588=function(_0x2d7fa9){while(--_0x2d7fa9){_0x5b49d3['push'](_0x5b49d3['shift']());}};_0x8df588(++_0x24ba3f);}(_0xfcf0,0x138));var _0x0fcf=function(_0x2dacca,_0x3b55a5){_0x2dacca=_0x2dacca-0x0;var _0x4e8745=_0xfcf0[_0x2dacca];return _0x4e8745;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});}exports[_0x0fcf('0x15')]=function(_0x19cfbd){var _0x567320=this;return new Promise(function(_0x18ea32,_0x1a8f58){return db['FreshsalesAccount'][_0x0fcf('0x16')]({'raw':_0x19cfbd[_0x0fcf('0x17')]?_0x19cfbd['options'][_0x0fcf('0x18')]===undefined?!![]:![]:!![],'where':_0x19cfbd['options']?_0x19cfbd[_0x0fcf('0x17')][_0x0fcf('0x19')]||null:null,'attributes':_0x19cfbd['options']?_0x19cfbd[_0x0fcf('0x17')][_0x0fcf('0x1a')]||null:null,'limit':_0x19cfbd[_0x0fcf('0x17')]?_0x19cfbd['options'][_0x0fcf('0x1b')]||null:null,'include':_0x19cfbd[_0x0fcf('0x17')]?_0x19cfbd[_0x0fcf('0x17')][_0x0fcf('0x1c')]?_[_0x0fcf('0x1d')](_0x19cfbd[_0x0fcf('0x17')]['include'],function(_0x2eef74){return{'model':db[_0x2eef74[_0x0fcf('0x1e')]],'as':_0x2eef74['as'],'attributes':_0x2eef74[_0x0fcf('0x1a')],'include':_0x2eef74[_0x0fcf('0x1c')]?_[_0x0fcf('0x1d')](_0x2eef74[_0x0fcf('0x1c')],function(_0x2ce990){return{'model':db[_0x2ce990[_0x0fcf('0x1e')]],'as':_0x2ce990['as'],'attributes':_0x2ce990[_0x0fcf('0x1a')],'include':_0x2ce990['include']?_[_0x0fcf('0x1d')](_0x2ce990[_0x0fcf('0x1c')],function(_0x41b7a2){return{'model':db[_0x41b7a2[_0x0fcf('0x1e')]],'as':_0x41b7a2['as'],'attributes':_0x41b7a2[_0x0fcf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0fcf('0x1f')](function(_0x2730b0){logger['info'](_0x0fcf('0x15'),_0x19cfbd);logger[_0x0fcf('0xf')](_0x0fcf('0x15'),_0x19cfbd,JSON[_0x0fcf('0x11')](_0x2730b0));_0x18ea32(_0x2730b0);})['catch'](function(_0x5d9bcd){logger['error'](_0x0fcf('0x15'),_0x5d9bcd['message'],_0x19cfbd);_0x1a8f58(_0x567320[_0x0fcf('0x12')](0x1f4,_0x5d9bcd[_0x0fcf('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0xdfd3ec){var _0x117041=this;return new Promise(function(_0xa52f52,_0x161496){return db[_0x0fcf('0x20')][_0x0fcf('0x21')]({'raw':_0xdfd3ec['options']?_0xdfd3ec[_0x0fcf('0x17')][_0x0fcf('0x18')]===undefined?!![]:![]:!![],'where':_0xdfd3ec[_0x0fcf('0x17')]?_0xdfd3ec[_0x0fcf('0x17')][_0x0fcf('0x19')]||null:null,'attributes':_0xdfd3ec[_0x0fcf('0x17')]?_0xdfd3ec['options'][_0x0fcf('0x1a')]||null:null,'include':_0xdfd3ec[_0x0fcf('0x17')]?_0xdfd3ec[_0x0fcf('0x17')][_0x0fcf('0x1c')]?_[_0x0fcf('0x1d')](_0xdfd3ec[_0x0fcf('0x17')][_0x0fcf('0x1c')],function(_0x344957){return{'model':db[_0x344957[_0x0fcf('0x1e')]],'as':_0x344957['as'],'attributes':_0x344957[_0x0fcf('0x1a')],'include':_0x344957[_0x0fcf('0x1c')]?_[_0x0fcf('0x1d')](_0x344957[_0x0fcf('0x1c')],function(_0x17346e){return{'model':db[_0x17346e['model']],'as':_0x17346e['as'],'attributes':_0x17346e['attributes'],'include':_0x17346e[_0x0fcf('0x1c')]?_['map'](_0x17346e['include'],function(_0x1a1e07){return{'model':db[_0x1a1e07[_0x0fcf('0x1e')]],'as':_0x1a1e07['as'],'attributes':_0x1a1e07[_0x0fcf('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57e635){logger[_0x0fcf('0xd')](_0x0fcf('0x22'),_0xdfd3ec);logger[_0x0fcf('0xf')]('ShowFreshsalesAccount',_0xdfd3ec,JSON[_0x0fcf('0x11')](_0x57e635));_0xa52f52(_0x57e635);})[_0x0fcf('0x23')](function(_0x29067e){logger['error']('ShowFreshsalesAccount',_0x29067e['message'],_0xdfd3ec);_0x161496(_0x117041[_0x0fcf('0x12')](0x1f4,_0x29067e[_0x0fcf('0x13')]));});});}; \ No newline at end of file +var _0x1967=['../../config/environment','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowFreshsalesAccount','find','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x20bca0,_0x4e3d3c){var _0x55e9ac=function(_0x211ec3){while(--_0x211ec3){_0x20bca0['push'](_0x20bca0['shift']());}};_0x55e9ac(++_0x4e3d3c);}(_0x1967,0x173));var _0x7196=function(_0x2213dc,_0x2566c7){_0x2213dc=_0x2213dc-0x0;var _0x457a0a=_0x1967[_0x2213dc];return _0x457a0a;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});}exports[_0x7196('0x18')]=function(_0x32fe2b){var _0x385f2d=this;return new Promise(function(_0x5b716a,_0x4c4f91){return db[_0x7196('0x19')][_0x7196('0x1a')]({'raw':_0x32fe2b[_0x7196('0x1b')]?_0x32fe2b['options'][_0x7196('0x1c')]===undefined?!![]:![]:!![],'where':_0x32fe2b['options']?_0x32fe2b['options'][_0x7196('0x1d')]||null:null,'attributes':_0x32fe2b[_0x7196('0x1b')]?_0x32fe2b[_0x7196('0x1b')]['attributes']||null:null,'limit':_0x32fe2b['options']?_0x32fe2b[_0x7196('0x1b')][_0x7196('0x1e')]||null:null,'include':_0x32fe2b['options']?_0x32fe2b[_0x7196('0x1b')][_0x7196('0x1f')]?_[_0x7196('0x20')](_0x32fe2b[_0x7196('0x1b')][_0x7196('0x1f')],function(_0x549f34){return{'model':db[_0x549f34[_0x7196('0x21')]],'as':_0x549f34['as'],'attributes':_0x549f34['attributes'],'include':_0x549f34[_0x7196('0x1f')]?_[_0x7196('0x20')](_0x549f34[_0x7196('0x1f')],function(_0xa69810){return{'model':db[_0xa69810[_0x7196('0x21')]],'as':_0xa69810['as'],'attributes':_0xa69810[_0x7196('0x22')],'include':_0xa69810['include']?_['map'](_0xa69810[_0x7196('0x1f')],function(_0x2d284f){return{'model':db[_0x2d284f[_0x7196('0x21')]],'as':_0x2d284f['as'],'attributes':_0x2d284f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x41cfd2){logger[_0x7196('0xe')](_0x7196('0x18'),_0x32fe2b);logger['debug'](_0x7196('0x18'),_0x32fe2b,JSON['stringify'](_0x41cfd2));_0x5b716a(_0x41cfd2);})[_0x7196('0x17')](function(_0x59d79d){logger[_0x7196('0x13')](_0x7196('0x18'),_0x59d79d[_0x7196('0x15')],_0x32fe2b);_0x4c4f91(_0x385f2d['error'](0x1f4,_0x59d79d[_0x7196('0x15')]));});});};exports[_0x7196('0x23')]=function(_0x2f9583){var _0xf999e9=this;return new Promise(function(_0x50c386,_0x39710d){return db[_0x7196('0x19')][_0x7196('0x24')]({'raw':_0x2f9583[_0x7196('0x1b')]?_0x2f9583[_0x7196('0x1b')][_0x7196('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f9583[_0x7196('0x1b')]?_0x2f9583[_0x7196('0x1b')][_0x7196('0x1d')]||null:null,'attributes':_0x2f9583[_0x7196('0x1b')]?_0x2f9583[_0x7196('0x1b')]['attributes']||null:null,'include':_0x2f9583[_0x7196('0x1b')]?_0x2f9583['options'][_0x7196('0x1f')]?_['map'](_0x2f9583[_0x7196('0x1b')][_0x7196('0x1f')],function(_0x5616ed){return{'model':db[_0x5616ed[_0x7196('0x21')]],'as':_0x5616ed['as'],'attributes':_0x5616ed[_0x7196('0x22')],'include':_0x5616ed[_0x7196('0x1f')]?_[_0x7196('0x20')](_0x5616ed[_0x7196('0x1f')],function(_0x4a8580){return{'model':db[_0x4a8580[_0x7196('0x21')]],'as':_0x4a8580['as'],'attributes':_0x4a8580[_0x7196('0x22')],'include':_0x4a8580[_0x7196('0x1f')]?_[_0x7196('0x20')](_0x4a8580[_0x7196('0x1f')],function(_0x123cad){return{'model':db[_0x123cad['model']],'as':_0x123cad['as'],'attributes':_0x123cad[_0x7196('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7196('0xd')](function(_0x191df2){logger['info'](_0x7196('0x23'),_0x2f9583);logger[_0x7196('0x25')](_0x7196('0x23'),_0x2f9583,JSON[_0x7196('0x12')](_0x191df2));_0x50c386(_0x191df2);})[_0x7196('0x17')](function(_0x31fca7){logger[_0x7196('0x13')](_0x7196('0x23'),_0x31fca7[_0x7196('0x15')],_0x2f9583);_0x39710d(_0xf999e9[_0x7196('0x13')](0x1f4,_0x31fca7['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index d9991dc..176d7fa 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 _0x5efa=['create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post'];(function(_0x14f494,_0x16aaa8){var _0x4d58dc=function(_0x291f13){while(--_0x291f13){_0x14f494['push'](_0x14f494['shift']());}};_0x4d58dc(++_0x16aaa8);}(_0x5efa,0x10e));var _0xa5ef=function(_0x4aee64,_0xc6c41){_0x4aee64=_0x4aee64-0x0;var _0x392d93=_0x5efa[_0x4aee64];return _0x392d93;};'use strict';var multer=require('multer');var util=require(_0xa5ef('0x0'));var path=require('path');var timeout=require(_0xa5ef('0x1'));var express=require(_0xa5ef('0x2'));var router=express[_0xa5ef('0x3')]();var fs_extra=require(_0xa5ef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa5ef('0x5'));var config=require(_0xa5ef('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0xa5ef('0x7')](),controller[_0xa5ef('0x8')]);router['get'](_0xa5ef('0x9'),auth[_0xa5ef('0x7')](),controller['show']);router[_0xa5ef('0xa')](_0xa5ef('0xb'),auth[_0xa5ef('0x7')](),controller[_0xa5ef('0xc')]);router['get'](_0xa5ef('0xd'),auth[_0xa5ef('0x7')](),controller[_0xa5ef('0xe')]);router[_0xa5ef('0xa')](_0xa5ef('0xf'),auth[_0xa5ef('0x7')](),controller[_0xa5ef('0x10')]);router[_0xa5ef('0x11')]('/',auth[_0xa5ef('0x7')](),controller[_0xa5ef('0x12')]);router[_0xa5ef('0x13')](_0xa5ef('0x9'),auth[_0xa5ef('0x7')](),controller[_0xa5ef('0x14')]);router[_0xa5ef('0x15')](_0xa5ef('0x9'),auth[_0xa5ef('0x7')](),controller[_0xa5ef('0x16')]);module[_0xa5ef('0x17')]=router; \ No newline at end of file +var _0x61b7=['/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0x61b7,0x1ec));var _0x761b=function(_0x4452d6,_0x39534e){_0x4452d6=_0x4452d6-0x0;var _0x58ec36=_0x61b7[_0x4452d6];return _0x58ec36;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x761b('0x0'));var express=require(_0x761b('0x1'));var router=express[_0x761b('0x2')]();var fs_extra=require(_0x761b('0x3'));var auth=require(_0x761b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x761b('0x5'));var controller=require(_0x761b('0x6'));router[_0x761b('0x7')]('/',auth[_0x761b('0x8')](),controller[_0x761b('0x9')]);router[_0x761b('0x7')](_0x761b('0xa'),auth[_0x761b('0x8')](),controller[_0x761b('0xb')]);router[_0x761b('0x7')](_0x761b('0xc'),auth[_0x761b('0x8')](),controller[_0x761b('0xd')]);router[_0x761b('0x7')](_0x761b('0xe'),auth[_0x761b('0x8')](),controller[_0x761b('0xf')]);router['get'](_0x761b('0x10'),auth[_0x761b('0x8')](),controller[_0x761b('0x11')]);router['post']('/',auth[_0x761b('0x8')](),controller[_0x761b('0x12')]);router[_0x761b('0x13')](_0x761b('0xa'),auth[_0x761b('0x8')](),controller['update']);router[_0x761b('0x14')](_0x761b('0xa'),auth[_0x761b('0x8')](),controller[_0x761b('0x15')]);module[_0x761b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 16e1640..57431cc 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 _0x3b3a=['STRING','exports'];(function(_0x37d0ac,_0x1bccb0){var _0x271df3=function(_0xf72123){while(--_0xf72123){_0x37d0ac['push'](_0x37d0ac['shift']());}};_0x271df3(++_0x1bccb0);}(_0x3b3a,0xdb));var _0xa3b3=function(_0x346fc1,_0x370c6f){_0x346fc1=_0x346fc1-0x0;var _0x2177e2=_0x3b3a[_0x346fc1];return _0x2177e2;};'use strict';var Sequelize=require('sequelize');module[_0xa3b3('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa3b3('0x1')]}}; \ No newline at end of file +var _0x7326=['sequelize','exports','STRING'];(function(_0x26ddfe,_0xacae3f){var _0xa8f46f=function(_0xf55584){while(--_0xf55584){_0x26ddfe['push'](_0x26ddfe['shift']());}};_0xa8f46f(++_0xacae3f);}(_0x7326,0xa5));var _0x6732=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x7326[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0x6732('0x0'));module[_0x6732('0x1')]={'name':{'type':Sequelize[_0x6732('0x2')]},'description':{'type':Sequelize[_0x6732('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index d151dd8..2914218 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 _0x4ec2=['order','where','filters','filter','merge','includeAll','findAll','rows','params','keys','rawAttributes','options','catch','create','body','find','destroy','getSubjects','findOne','sort','pick','getDescriptions','FreshsalesField','getFields','eml-format','rimraf','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','send','index','map','FreshsalesConfiguration','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x2c9604,_0x501497){var _0x1fc3e1=function(_0x5abcbc){while(--_0x5abcbc){_0x2c9604['push'](_0x2c9604['shift']());}};_0x1fc3e1(++_0x501497);}(_0x4ec2,0xff));var _0x24ec=function(_0x1b392a,_0x195cdf){_0x1b392a=_0x1b392a-0x0;var _0x21a9a6=_0x4ec2[_0x1b392a];return _0x21a9a6;};'use strict';var emlformat=require(_0x24ec('0x0'));var rimraf=require(_0x24ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x24ec('0x2'));var moment=require('moment');var BPromise=require(_0x24ec('0x3'));var Mustache=require(_0x24ec('0x4'));var util=require('util');var path=require(_0x24ec('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x24ec('0x6'));var fs=require('fs');var fs_extra=require(_0x24ec('0x7'));var _=require(_0x24ec('0x8'));var squel=require(_0x24ec('0x9'));var crypto=require(_0x24ec('0xa'));var jsforce=require(_0x24ec('0xb'));var deskjs=require(_0x24ec('0xc'));var toCsv=require(_0x24ec('0xd'));var querystring=require(_0x24ec('0xe'));var Papa=require(_0x24ec('0xf'));var Redis=require(_0x24ec('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x24ec('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x24ec('0x12'))(_0x24ec('0x13'));var utils=require('../../config/utils');var config=require(_0x24ec('0x14'));var licenseUtil=require(_0x24ec('0x15'));var db=require(_0x24ec('0x16'))['db'];function respondWithStatusCode(_0xf32e73,_0x260889){_0x260889=_0x260889||0xcc;return function(_0x3021fb){if(_0x3021fb){return _0xf32e73[_0x24ec('0x17')](_0x260889);}return _0xf32e73[_0x24ec('0x18')](_0x260889)[_0x24ec('0x19')]();};}function respondWithResult(_0x21a277,_0x586220){_0x586220=_0x586220||0xc8;return function(_0x3eb75a){if(_0x3eb75a){return _0x21a277[_0x24ec('0x18')](_0x586220)[_0x24ec('0x1a')](_0x3eb75a);}};}function respondWithFilteredResult(_0x4f02fb,_0x5d5cc1){return function(_0x59086d){if(_0x59086d){var _0x5d61aa=typeof _0x5d5cc1[_0x24ec('0x1b')]===_0x24ec('0x1c')&&typeof _0x5d5cc1[_0x24ec('0x1d')]===_0x24ec('0x1c');var _0x5d6a51=_0x59086d['count'];var _0x25db7f=_0x5d61aa?0x0:_0x5d5cc1['offset'];var _0x150471=_0x5d61aa?_0x59086d[_0x24ec('0x1e')]:_0x5d5cc1[_0x24ec('0x1b')]+_0x5d5cc1['limit'];var _0x104711;if(_0x150471>=_0x5d6a51){_0x150471=_0x5d6a51;_0x104711=0xc8;}else{_0x104711=0xce;}_0x4f02fb[_0x24ec('0x18')](_0x104711);return _0x4f02fb['set'](_0x24ec('0x1f'),_0x25db7f+'-'+_0x150471+'/'+_0x5d6a51)['json'](_0x59086d);}return null;};}function patchUpdates(_0xac60ab){return function(_0x2a65d5){try{jsonpatch[_0x24ec('0x20')](_0x2a65d5,_0xac60ab,!![]);}catch(_0x7e8918){return BPromise[_0x24ec('0x21')](_0x7e8918);}return _0x2a65d5[_0x24ec('0x22')]();};}function saveUpdates(_0x3d96a2,_0x10c994){return function(_0x58614b){if(_0x58614b){return _0x58614b[_0x24ec('0x23')](_0x3d96a2)[_0x24ec('0x24')](function(_0x118ce2){return _0x118ce2;});}return null;};}function removeEntity(_0x110503,_0x23ae35){return function(_0x48432c){if(_0x48432c){return _0x48432c['destroy']()[_0x24ec('0x24')](function(){_0x110503[_0x24ec('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd75f2a,_0x35a98a){return function(_0x2c61e2){if(!_0x2c61e2){_0xd75f2a['sendStatus'](0x194);}return _0x2c61e2;};}function handleError(_0x49001e,_0x75c468){_0x75c468=_0x75c468||0x1f4;return function(_0x125ac9){logger[_0x24ec('0x25')](_0x125ac9['stack']);if(_0x125ac9[_0x24ec('0x26')]){delete _0x125ac9[_0x24ec('0x26')];}_0x49001e[_0x24ec('0x18')](_0x75c468)[_0x24ec('0x27')](_0x125ac9);};}exports[_0x24ec('0x28')]=function(_0x46cf18,_0x30c3a1){var _0x2f7f13={},_0x159351={},_0x236ccd={'count':0x0,'rows':[]};var _0x413b78=_[_0x24ec('0x29')](db[_0x24ec('0x2a')]['rawAttributes'],function(_0x4b8a4f){return{'name':_0x4b8a4f[_0x24ec('0x2b')],'type':_0x4b8a4f[_0x24ec('0x2c')]['key']};});_0x159351[_0x24ec('0x2d')]=_['map'](_0x413b78,_0x24ec('0x26'));_0x159351['query']=_['keys'](_0x46cf18[_0x24ec('0x2e')]);_0x159351['filters']=_[_0x24ec('0x2f')](_0x159351[_0x24ec('0x2d')],_0x159351[_0x24ec('0x2e')]);_0x2f7f13[_0x24ec('0x30')]=_[_0x24ec('0x2f')](_0x159351[_0x24ec('0x2d')],qs[_0x24ec('0x31')](_0x46cf18['query'][_0x24ec('0x31')]));_0x2f7f13[_0x24ec('0x30')]=_0x2f7f13[_0x24ec('0x30')][_0x24ec('0x32')]?_0x2f7f13[_0x24ec('0x30')]:_0x159351[_0x24ec('0x2d')];if(!_0x46cf18[_0x24ec('0x2e')][_0x24ec('0x33')](_0x24ec('0x34'))){_0x2f7f13[_0x24ec('0x1d')]=qs[_0x24ec('0x1d')](_0x46cf18['query'][_0x24ec('0x1d')]);_0x2f7f13[_0x24ec('0x1b')]=qs[_0x24ec('0x1b')](_0x46cf18[_0x24ec('0x2e')][_0x24ec('0x1b')]);}_0x2f7f13[_0x24ec('0x35')]=qs['sort'](_0x46cf18[_0x24ec('0x2e')]['sort']);_0x2f7f13[_0x24ec('0x36')]=qs[_0x24ec('0x37')](_['pick'](_0x46cf18[_0x24ec('0x2e')],_0x159351[_0x24ec('0x37')]),_0x413b78);if(_0x46cf18['query'][_0x24ec('0x38')]){_0x2f7f13[_0x24ec('0x36')]=_[_0x24ec('0x39')](_0x2f7f13['where'],{'$or':_[_0x24ec('0x29')](_0x413b78,function(_0x1adebd){if(_0x1adebd[_0x24ec('0x2c')]!=='VIRTUAL'){var _0x35eb2d={};_0x35eb2d[_0x1adebd[_0x24ec('0x26')]]={'$like':'%'+_0x46cf18['query'][_0x24ec('0x38')]+'%'};return _0x35eb2d;}})});}_0x2f7f13=_['merge']({},_0x2f7f13,_0x46cf18['options']);var _0x378a18={'where':_0x2f7f13[_0x24ec('0x36')]};return db[_0x24ec('0x2a')][_0x24ec('0x1e')](_0x378a18)[_0x24ec('0x24')](function(_0x4a594f){_0x236ccd['count']=_0x4a594f;if(_0x46cf18[_0x24ec('0x2e')][_0x24ec('0x3a')]){_0x2f7f13['include']=[{'all':!![]}];}return db[_0x24ec('0x2a')][_0x24ec('0x3b')](_0x2f7f13);})['then'](function(_0x25acd1){_0x236ccd[_0x24ec('0x3c')]=_0x25acd1;return _0x236ccd;})[_0x24ec('0x24')](respondWithFilteredResult(_0x30c3a1,_0x2f7f13))['catch'](handleError(_0x30c3a1,null));};exports['show']=function(_0x45dab9,_0xee0f30){var _0x3847f9={'raw':![],'where':{'id':_0x45dab9[_0x24ec('0x3d')]['id']}},_0x47cfbe={};_0x47cfbe['model']=_[_0x24ec('0x3e')](db[_0x24ec('0x2a')][_0x24ec('0x3f')]);_0x47cfbe[_0x24ec('0x2e')]=_[_0x24ec('0x3e')](_0x45dab9[_0x24ec('0x2e')]);_0x47cfbe[_0x24ec('0x37')]=_['intersection'](_0x47cfbe[_0x24ec('0x2d')],_0x47cfbe[_0x24ec('0x2e')]);_0x3847f9[_0x24ec('0x30')]=_[_0x24ec('0x2f')](_0x47cfbe[_0x24ec('0x2d')],qs[_0x24ec('0x31')](_0x45dab9['query']['fields']));_0x3847f9[_0x24ec('0x30')]=_0x3847f9[_0x24ec('0x30')]['length']?_0x3847f9[_0x24ec('0x30')]:_0x47cfbe[_0x24ec('0x2d')];if(_0x45dab9[_0x24ec('0x2e')]['includeAll']){_0x3847f9['include']=[{'all':!![]}];}_0x3847f9=_[_0x24ec('0x39')]({},_0x3847f9,_0x45dab9[_0x24ec('0x40')]);return db[_0x24ec('0x2a')]['find'](_0x3847f9)[_0x24ec('0x24')](handleEntityNotFound(_0xee0f30,null))[_0x24ec('0x24')](respondWithResult(_0xee0f30,null))[_0x24ec('0x41')](handleError(_0xee0f30,null));};exports[_0x24ec('0x42')]=function(_0x59d883,_0x150b77){return db['FreshsalesConfiguration']['create'](_0x59d883[_0x24ec('0x43')],{})['then'](respondWithResult(_0x150b77,0xc9))[_0x24ec('0x41')](handleError(_0x150b77,null));};exports['update']=function(_0x39d30d,_0x154213){if(_0x39d30d[_0x24ec('0x43')]['id']){delete _0x39d30d['body']['id'];}return db[_0x24ec('0x2a')][_0x24ec('0x44')]({'where':{'id':_0x39d30d[_0x24ec('0x3d')]['id']}})[_0x24ec('0x24')](handleEntityNotFound(_0x154213,null))[_0x24ec('0x24')](saveUpdates(_0x39d30d[_0x24ec('0x43')],null))[_0x24ec('0x24')](respondWithResult(_0x154213,null))[_0x24ec('0x41')](handleError(_0x154213,null));};exports[_0x24ec('0x45')]=function(_0x49541d,_0x1d7d2b){return db[_0x24ec('0x2a')]['find']({'where':{'id':_0x49541d['params']['id']}})[_0x24ec('0x24')](handleEntityNotFound(_0x1d7d2b,null))['then'](removeEntity(_0x1d7d2b,null))[_0x24ec('0x41')](handleError(_0x1d7d2b,null));};exports[_0x24ec('0x46')]=function(_0x1bf601,_0x356ef0,_0xa3ecc3){var _0x45f29b={};var _0x2b805a={};var _0x2af377;var _0x595972;return db[_0x24ec('0x2a')][_0x24ec('0x47')]({'where':{'id':_0x1bf601['params']['id']}})[_0x24ec('0x24')](handleEntityNotFound(_0x356ef0,null))[_0x24ec('0x24')](function(_0x5e185b){if(_0x5e185b){_0x2af377=_0x5e185b;_0x2b805a[_0x24ec('0x2d')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x2b805a['query']=_['keys'](_0x1bf601[_0x24ec('0x2e')]);_0x2b805a[_0x24ec('0x37')]=_[_0x24ec('0x2f')](_0x2b805a['model'],_0x2b805a[_0x24ec('0x2e')]);_0x45f29b[_0x24ec('0x30')]=_[_0x24ec('0x2f')](_0x2b805a[_0x24ec('0x2d')],qs[_0x24ec('0x31')](_0x1bf601[_0x24ec('0x2e')][_0x24ec('0x31')]));_0x45f29b[_0x24ec('0x30')]=_0x45f29b[_0x24ec('0x30')][_0x24ec('0x32')]?_0x45f29b[_0x24ec('0x30')]:_0x2b805a['model'];_0x45f29b[_0x24ec('0x35')]=qs['sort'](_0x1bf601[_0x24ec('0x2e')][_0x24ec('0x48')]);_0x45f29b['where']=qs[_0x24ec('0x37')](_[_0x24ec('0x49')](_0x1bf601[_0x24ec('0x2e')],_0x2b805a['filters']));if(_0x1bf601[_0x24ec('0x2e')][_0x24ec('0x38')]){_0x45f29b[_0x24ec('0x36')]=_['merge'](_0x45f29b['where'],{'$or':_[_0x24ec('0x29')](_0x45f29b[_0x24ec('0x30')],function(_0x363f24){var _0x2a0d87={};_0x2a0d87[_0x363f24]={'$like':'%'+_0x1bf601[_0x24ec('0x2e')][_0x24ec('0x38')]+'%'};return _0x2a0d87;})});}_0x45f29b=_[_0x24ec('0x39')]({},_0x45f29b,_0x1bf601['options']);return _0x2af377['getSubjects'](_0x45f29b);}})['then'](function(_0x1994c6){if(_0x1994c6){_0x595972=_0x1994c6['length'];if(!_0x1bf601[_0x24ec('0x2e')][_0x24ec('0x33')]('nolimit')){_0x45f29b['limit']=qs['limit'](_0x1bf601[_0x24ec('0x2e')][_0x24ec('0x1d')]);_0x45f29b[_0x24ec('0x1b')]=qs[_0x24ec('0x1b')](_0x1bf601[_0x24ec('0x2e')][_0x24ec('0x1b')]);}return _0x2af377[_0x24ec('0x46')](_0x45f29b);}})[_0x24ec('0x24')](function(_0x23cfdf){if(_0x23cfdf){return _0x23cfdf?{'count':_0x595972,'rows':_0x23cfdf}:null;}})[_0x24ec('0x24')](respondWithResult(_0x356ef0,null))['catch'](handleError(_0x356ef0,null));};exports[_0x24ec('0x4a')]=function(_0xf4c313,_0xe2b02a,_0x2d31d7){var _0x575171={};var _0xbabdac={};var _0x315aa7;var _0x2d285c;return db[_0x24ec('0x2a')][_0x24ec('0x47')]({'where':{'id':_0xf4c313[_0x24ec('0x3d')]['id']}})[_0x24ec('0x24')](handleEntityNotFound(_0xe2b02a,null))[_0x24ec('0x24')](function(_0x1cd187){if(_0x1cd187){_0x315aa7=_0x1cd187;_0xbabdac[_0x24ec('0x2d')]=_[_0x24ec('0x3e')](db[_0x24ec('0x4b')]['rawAttributes']);_0xbabdac[_0x24ec('0x2e')]=_[_0x24ec('0x3e')](_0xf4c313[_0x24ec('0x2e')]);_0xbabdac['filters']=_[_0x24ec('0x2f')](_0xbabdac[_0x24ec('0x2d')],_0xbabdac['query']);_0x575171[_0x24ec('0x30')]=_[_0x24ec('0x2f')](_0xbabdac['model'],qs[_0x24ec('0x31')](_0xf4c313[_0x24ec('0x2e')]['fields']));_0x575171[_0x24ec('0x30')]=_0x575171['attributes'][_0x24ec('0x32')]?_0x575171[_0x24ec('0x30')]:_0xbabdac['model'];_0x575171['order']=qs[_0x24ec('0x48')](_0xf4c313[_0x24ec('0x2e')][_0x24ec('0x48')]);_0x575171[_0x24ec('0x36')]=qs[_0x24ec('0x37')](_[_0x24ec('0x49')](_0xf4c313[_0x24ec('0x2e')],_0xbabdac['filters']));if(_0xf4c313['query']['filter']){_0x575171[_0x24ec('0x36')]=_[_0x24ec('0x39')](_0x575171[_0x24ec('0x36')],{'$or':_[_0x24ec('0x29')](_0x575171['attributes'],function(_0x159852){var _0xff1021={};_0xff1021[_0x159852]={'$like':'%'+_0xf4c313[_0x24ec('0x2e')]['filter']+'%'};return _0xff1021;})});}_0x575171=_[_0x24ec('0x39')]({},_0x575171,_0xf4c313[_0x24ec('0x40')]);return _0x315aa7['getDescriptions'](_0x575171);}})['then'](function(_0x18ce7e){if(_0x18ce7e){_0x2d285c=_0x18ce7e[_0x24ec('0x32')];if(!_0xf4c313[_0x24ec('0x2e')][_0x24ec('0x33')](_0x24ec('0x34'))){_0x575171['limit']=qs[_0x24ec('0x1d')](_0xf4c313[_0x24ec('0x2e')]['limit']);_0x575171[_0x24ec('0x1b')]=qs[_0x24ec('0x1b')](_0xf4c313['query'][_0x24ec('0x1b')]);}return _0x315aa7[_0x24ec('0x4a')](_0x575171);}})['then'](function(_0x3bf586){if(_0x3bf586){return _0x3bf586?{'count':_0x2d285c,'rows':_0x3bf586}:null;}})[_0x24ec('0x24')](respondWithResult(_0xe2b02a,null))['catch'](handleError(_0xe2b02a,null));};exports[_0x24ec('0x4c')]=function(_0x99a1ea,_0xb4bd3e,_0xc8c7d5){var _0x4c78e5={};var _0x4ccf9c={};var _0x112d1f;var _0x11f49e;return db[_0x24ec('0x2a')][_0x24ec('0x47')]({'where':{'id':_0x99a1ea[_0x24ec('0x3d')]['id']}})[_0x24ec('0x24')](handleEntityNotFound(_0xb4bd3e,null))[_0x24ec('0x24')](function(_0x22d102){if(_0x22d102){_0x112d1f=_0x22d102;_0x4ccf9c[_0x24ec('0x2d')]=_[_0x24ec('0x3e')](db[_0x24ec('0x4b')]['rawAttributes']);_0x4ccf9c[_0x24ec('0x2e')]=_[_0x24ec('0x3e')](_0x99a1ea[_0x24ec('0x2e')]);_0x4ccf9c['filters']=_[_0x24ec('0x2f')](_0x4ccf9c['model'],_0x4ccf9c[_0x24ec('0x2e')]);_0x4c78e5['attributes']=_[_0x24ec('0x2f')](_0x4ccf9c[_0x24ec('0x2d')],qs[_0x24ec('0x31')](_0x99a1ea[_0x24ec('0x2e')][_0x24ec('0x31')]));_0x4c78e5[_0x24ec('0x30')]=_0x4c78e5['attributes'][_0x24ec('0x32')]?_0x4c78e5[_0x24ec('0x30')]:_0x4ccf9c[_0x24ec('0x2d')];_0x4c78e5[_0x24ec('0x35')]=qs[_0x24ec('0x48')](_0x99a1ea['query']['sort']);_0x4c78e5[_0x24ec('0x36')]=qs['filters'](_[_0x24ec('0x49')](_0x99a1ea[_0x24ec('0x2e')],_0x4ccf9c[_0x24ec('0x37')]));if(_0x99a1ea[_0x24ec('0x2e')][_0x24ec('0x38')]){_0x4c78e5[_0x24ec('0x36')]=_[_0x24ec('0x39')](_0x4c78e5[_0x24ec('0x36')],{'$or':_[_0x24ec('0x29')](_0x4c78e5[_0x24ec('0x30')],function(_0x72b0a2){var _0x432456={};_0x432456[_0x72b0a2]={'$like':'%'+_0x99a1ea[_0x24ec('0x2e')][_0x24ec('0x38')]+'%'};return _0x432456;})});}_0x4c78e5=_['merge']({},_0x4c78e5,_0x99a1ea[_0x24ec('0x40')]);return _0x112d1f[_0x24ec('0x4c')](_0x4c78e5);}})['then'](function(_0x5894a6){if(_0x5894a6){_0x11f49e=_0x5894a6[_0x24ec('0x32')];if(!_0x99a1ea[_0x24ec('0x2e')][_0x24ec('0x33')](_0x24ec('0x34'))){_0x4c78e5[_0x24ec('0x1d')]=qs[_0x24ec('0x1d')](_0x99a1ea['query'][_0x24ec('0x1d')]);_0x4c78e5[_0x24ec('0x1b')]=qs[_0x24ec('0x1b')](_0x99a1ea['query'][_0x24ec('0x1b')]);}return _0x112d1f['getFields'](_0x4c78e5);}})[_0x24ec('0x24')](function(_0x4b3207){if(_0x4b3207){return _0x4b3207?{'count':_0x11f49e,'rows':_0x4b3207}:null;}})[_0x24ec('0x24')](respondWithResult(_0xb4bd3e,null))[_0x24ec('0x41')](handleError(_0xb4bd3e,null));}; \ No newline at end of file +var _0x2205=['includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','findOne','FreshsalesField','hasOwnProperty','getSubjects','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','options'];(function(_0x109f06,_0x124935){var _0x21a607=function(_0x16648b){while(--_0x16648b){_0x109f06['push'](_0x109f06['shift']());}};_0x21a607(++_0x124935);}(_0x2205,0x1ac));var _0x5220=function(_0x51496a,_0xc5becd){_0x51496a=_0x51496a-0x0;var _0x5dc9ab=_0x2205[_0x51496a];return _0x5dc9ab;};'use strict';var emlformat=require(_0x5220('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5220('0x1'));var jsonpatch=require(_0x5220('0x2'));var rp=require(_0x5220('0x3'));var moment=require(_0x5220('0x4'));var BPromise=require(_0x5220('0x5'));var Mustache=require(_0x5220('0x6'));var util=require(_0x5220('0x7'));var path=require(_0x5220('0x8'));var sox=require('sox');var csv=require(_0x5220('0x9'));var ejs=require(_0x5220('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5220('0xb'));var squel=require(_0x5220('0xc'));var crypto=require(_0x5220('0xd'));var jsforce=require(_0x5220('0xe'));var deskjs=require(_0x5220('0xf'));var toCsv=require(_0x5220('0x9'));var querystring=require(_0x5220('0x10'));var Papa=require(_0x5220('0x11'));var Redis=require(_0x5220('0x12'));var authService=require(_0x5220('0x13'));var qs=require(_0x5220('0x14'));var as=require(_0x5220('0x15'));var hardwareService=require(_0x5220('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x5220('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f37b7,_0x5ed4ac){_0x5ed4ac=_0x5ed4ac||0xcc;return function(_0x45b9d4){if(_0x45b9d4){return _0x2f37b7[_0x5220('0x18')](_0x5ed4ac);}return _0x2f37b7[_0x5220('0x19')](_0x5ed4ac)[_0x5220('0x1a')]();};}function respondWithResult(_0x249a2e,_0x186472){_0x186472=_0x186472||0xc8;return function(_0x89102d){if(_0x89102d){return _0x249a2e['status'](_0x186472)[_0x5220('0x1b')](_0x89102d);}};}function respondWithFilteredResult(_0x5b5057,_0x4cb807){return function(_0x2f9037){if(_0x2f9037){var _0x3cd11c=typeof _0x4cb807[_0x5220('0x1c')]==='undefined'&&typeof _0x4cb807[_0x5220('0x1d')]===_0x5220('0x1e');var _0x585008=_0x2f9037[_0x5220('0x1f')];var _0x308e29=_0x3cd11c?0x0:_0x4cb807['offset'];var _0x546ae7=_0x3cd11c?_0x2f9037['count']:_0x4cb807[_0x5220('0x1c')]+_0x4cb807['limit'];var _0x55b637;if(_0x546ae7>=_0x585008){_0x546ae7=_0x585008;_0x55b637=0xc8;}else{_0x55b637=0xce;}_0x5b5057[_0x5220('0x19')](_0x55b637);return _0x5b5057[_0x5220('0x20')](_0x5220('0x21'),_0x308e29+'-'+_0x546ae7+'/'+_0x585008)[_0x5220('0x1b')](_0x2f9037);}return null;};}function patchUpdates(_0x5a3817){return function(_0x47db48){try{jsonpatch[_0x5220('0x22')](_0x47db48,_0x5a3817,!![]);}catch(_0x36e34a){return BPromise[_0x5220('0x23')](_0x36e34a);}return _0x47db48[_0x5220('0x24')]();};}function saveUpdates(_0xa5556f,_0x13f6e9){return function(_0x456b35){if(_0x456b35){return _0x456b35[_0x5220('0x25')](_0xa5556f)[_0x5220('0x26')](function(_0x289d9b){return _0x289d9b;});}return null;};}function removeEntity(_0x33e28c,_0x138dbf){return function(_0x175767){if(_0x175767){return _0x175767['destroy']()[_0x5220('0x26')](function(){_0x33e28c[_0x5220('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x182a75,_0x5ded65){return function(_0x42ed50){if(!_0x42ed50){_0x182a75[_0x5220('0x18')](0x194);}return _0x42ed50;};}function handleError(_0x5b2b34,_0x315606){_0x315606=_0x315606||0x1f4;return function(_0x43bf28){logger['error'](_0x43bf28[_0x5220('0x27')]);if(_0x43bf28['name']){delete _0x43bf28[_0x5220('0x28')];}_0x5b2b34[_0x5220('0x19')](_0x315606)[_0x5220('0x29')](_0x43bf28);};}exports[_0x5220('0x2a')]=function(_0x35b8ad,_0x289178){var _0x6eb9eb={},_0x268888={},_0x51cb14={'count':0x0,'rows':[]};var _0x2dc1b8=_[_0x5220('0x2b')](db[_0x5220('0x2c')][_0x5220('0x2d')],function(_0x400ff3){return{'name':_0x400ff3[_0x5220('0x2e')],'type':_0x400ff3[_0x5220('0x2f')][_0x5220('0x30')]};});_0x268888[_0x5220('0x31')]=_[_0x5220('0x2b')](_0x2dc1b8,_0x5220('0x28'));_0x268888[_0x5220('0x32')]=_['keys'](_0x35b8ad[_0x5220('0x32')]);_0x268888[_0x5220('0x33')]=_['intersection'](_0x268888[_0x5220('0x31')],_0x268888[_0x5220('0x32')]);_0x6eb9eb[_0x5220('0x34')]=_[_0x5220('0x35')](_0x268888['model'],qs[_0x5220('0x36')](_0x35b8ad[_0x5220('0x32')][_0x5220('0x36')]));_0x6eb9eb[_0x5220('0x34')]=_0x6eb9eb[_0x5220('0x34')][_0x5220('0x37')]?_0x6eb9eb['attributes']:_0x268888[_0x5220('0x31')];if(!_0x35b8ad[_0x5220('0x32')]['hasOwnProperty'](_0x5220('0x38'))){_0x6eb9eb[_0x5220('0x1d')]=qs[_0x5220('0x1d')](_0x35b8ad[_0x5220('0x32')][_0x5220('0x1d')]);_0x6eb9eb[_0x5220('0x1c')]=qs[_0x5220('0x1c')](_0x35b8ad[_0x5220('0x32')][_0x5220('0x1c')]);}_0x6eb9eb[_0x5220('0x39')]=qs['sort'](_0x35b8ad[_0x5220('0x32')][_0x5220('0x3a')]);_0x6eb9eb[_0x5220('0x3b')]=qs[_0x5220('0x33')](_[_0x5220('0x3c')](_0x35b8ad[_0x5220('0x32')],_0x268888[_0x5220('0x33')]),_0x2dc1b8);if(_0x35b8ad[_0x5220('0x32')]['filter']){_0x6eb9eb[_0x5220('0x3b')]=_['merge'](_0x6eb9eb[_0x5220('0x3b')],{'$or':_[_0x5220('0x2b')](_0x2dc1b8,function(_0x15c46d){if(_0x15c46d[_0x5220('0x2f')]!==_0x5220('0x3d')){var _0x2acff2={};_0x2acff2[_0x15c46d['name']]={'$like':'%'+_0x35b8ad[_0x5220('0x32')][_0x5220('0x3e')]+'%'};return _0x2acff2;}})});}_0x6eb9eb=_['merge']({},_0x6eb9eb,_0x35b8ad[_0x5220('0x3f')]);var _0x593475={'where':_0x6eb9eb['where']};return db[_0x5220('0x2c')]['count'](_0x593475)[_0x5220('0x26')](function(_0x4c192a){_0x51cb14[_0x5220('0x1f')]=_0x4c192a;if(_0x35b8ad[_0x5220('0x32')][_0x5220('0x40')]){_0x6eb9eb[_0x5220('0x41')]=[{'all':!![]}];}return db[_0x5220('0x2c')][_0x5220('0x42')](_0x6eb9eb);})[_0x5220('0x26')](function(_0x53ef15){_0x51cb14[_0x5220('0x43')]=_0x53ef15;return _0x51cb14;})[_0x5220('0x26')](respondWithFilteredResult(_0x289178,_0x6eb9eb))[_0x5220('0x44')](handleError(_0x289178,null));};exports[_0x5220('0x45')]=function(_0x2fa2e9,_0x2f33ff){var _0x10012a={'raw':![],'where':{'id':_0x2fa2e9[_0x5220('0x46')]['id']}},_0x91694={};_0x91694[_0x5220('0x31')]=_[_0x5220('0x47')](db['FreshsalesConfiguration'][_0x5220('0x2d')]);_0x91694[_0x5220('0x32')]=_[_0x5220('0x47')](_0x2fa2e9[_0x5220('0x32')]);_0x91694[_0x5220('0x33')]=_[_0x5220('0x35')](_0x91694[_0x5220('0x31')],_0x91694['query']);_0x10012a[_0x5220('0x34')]=_[_0x5220('0x35')](_0x91694['model'],qs['fields'](_0x2fa2e9[_0x5220('0x32')][_0x5220('0x36')]));_0x10012a[_0x5220('0x34')]=_0x10012a[_0x5220('0x34')][_0x5220('0x37')]?_0x10012a[_0x5220('0x34')]:_0x91694[_0x5220('0x31')];if(_0x2fa2e9[_0x5220('0x32')][_0x5220('0x40')]){_0x10012a['include']=[{'all':!![]}];}_0x10012a=_[_0x5220('0x48')]({},_0x10012a,_0x2fa2e9[_0x5220('0x3f')]);return db[_0x5220('0x2c')][_0x5220('0x49')](_0x10012a)[_0x5220('0x26')](handleEntityNotFound(_0x2f33ff,null))[_0x5220('0x26')](respondWithResult(_0x2f33ff,null))[_0x5220('0x44')](handleError(_0x2f33ff,null));};exports[_0x5220('0x4a')]=function(_0x4daf68,_0x8e2030){return db[_0x5220('0x2c')][_0x5220('0x4a')](_0x4daf68[_0x5220('0x4b')],{})['then'](respondWithResult(_0x8e2030,0xc9))[_0x5220('0x44')](handleError(_0x8e2030,null));};exports[_0x5220('0x25')]=function(_0x18a77e,_0x48db44){if(_0x18a77e[_0x5220('0x4b')]['id']){delete _0x18a77e['body']['id'];}return db[_0x5220('0x2c')][_0x5220('0x49')]({'where':{'id':_0x18a77e['params']['id']}})[_0x5220('0x26')](handleEntityNotFound(_0x48db44,null))[_0x5220('0x26')](saveUpdates(_0x18a77e[_0x5220('0x4b')],null))[_0x5220('0x26')](respondWithResult(_0x48db44,null))[_0x5220('0x44')](handleError(_0x48db44,null));};exports['destroy']=function(_0x33c711,_0x346dcd){return db[_0x5220('0x2c')][_0x5220('0x49')]({'where':{'id':_0x33c711['params']['id']}})['then'](handleEntityNotFound(_0x346dcd,null))[_0x5220('0x26')](removeEntity(_0x346dcd,null))[_0x5220('0x44')](handleError(_0x346dcd,null));};exports['getSubjects']=function(_0xe79bb9,_0x392983,_0x3f1116){var _0x15f31c={};var _0x3a9af7={};var _0x16d04a;var _0x3c2898;return db['FreshsalesConfiguration'][_0x5220('0x4c')]({'where':{'id':_0xe79bb9['params']['id']}})[_0x5220('0x26')](handleEntityNotFound(_0x392983,null))[_0x5220('0x26')](function(_0x3a2398){if(_0x3a2398){_0x16d04a=_0x3a2398;_0x3a9af7['model']=_[_0x5220('0x47')](db[_0x5220('0x4d')][_0x5220('0x2d')]);_0x3a9af7[_0x5220('0x32')]=_[_0x5220('0x47')](_0xe79bb9[_0x5220('0x32')]);_0x3a9af7[_0x5220('0x33')]=_[_0x5220('0x35')](_0x3a9af7[_0x5220('0x31')],_0x3a9af7[_0x5220('0x32')]);_0x15f31c[_0x5220('0x34')]=_[_0x5220('0x35')](_0x3a9af7[_0x5220('0x31')],qs[_0x5220('0x36')](_0xe79bb9[_0x5220('0x32')][_0x5220('0x36')]));_0x15f31c[_0x5220('0x34')]=_0x15f31c[_0x5220('0x34')][_0x5220('0x37')]?_0x15f31c[_0x5220('0x34')]:_0x3a9af7[_0x5220('0x31')];_0x15f31c[_0x5220('0x39')]=qs[_0x5220('0x3a')](_0xe79bb9[_0x5220('0x32')][_0x5220('0x3a')]);_0x15f31c[_0x5220('0x3b')]=qs[_0x5220('0x33')](_[_0x5220('0x3c')](_0xe79bb9['query'],_0x3a9af7[_0x5220('0x33')]));if(_0xe79bb9[_0x5220('0x32')][_0x5220('0x3e')]){_0x15f31c[_0x5220('0x3b')]=_[_0x5220('0x48')](_0x15f31c[_0x5220('0x3b')],{'$or':_[_0x5220('0x2b')](_0x15f31c[_0x5220('0x34')],function(_0xbfb322){var _0x27cc7e={};_0x27cc7e[_0xbfb322]={'$like':'%'+_0xe79bb9[_0x5220('0x32')][_0x5220('0x3e')]+'%'};return _0x27cc7e;})});}_0x15f31c=_[_0x5220('0x48')]({},_0x15f31c,_0xe79bb9[_0x5220('0x3f')]);return _0x16d04a['getSubjects'](_0x15f31c);}})[_0x5220('0x26')](function(_0x443fdc){if(_0x443fdc){_0x3c2898=_0x443fdc['length'];if(!_0xe79bb9[_0x5220('0x32')][_0x5220('0x4e')]('nolimit')){_0x15f31c[_0x5220('0x1d')]=qs[_0x5220('0x1d')](_0xe79bb9[_0x5220('0x32')][_0x5220('0x1d')]);_0x15f31c[_0x5220('0x1c')]=qs[_0x5220('0x1c')](_0xe79bb9[_0x5220('0x32')]['offset']);}return _0x16d04a[_0x5220('0x4f')](_0x15f31c);}})[_0x5220('0x26')](function(_0x1a4e91){if(_0x1a4e91){return _0x1a4e91?{'count':_0x3c2898,'rows':_0x1a4e91}:null;}})[_0x5220('0x26')](respondWithResult(_0x392983,null))[_0x5220('0x44')](handleError(_0x392983,null));};exports[_0x5220('0x50')]=function(_0x221ca7,_0x4c54a2,_0x1c7a2a){var _0x5573d6={};var _0x2c4378={};var _0x5b2f0b;var _0x28466a;return db['FreshsalesConfiguration'][_0x5220('0x4c')]({'where':{'id':_0x221ca7['params']['id']}})[_0x5220('0x26')](handleEntityNotFound(_0x4c54a2,null))['then'](function(_0x360898){if(_0x360898){_0x5b2f0b=_0x360898;_0x2c4378[_0x5220('0x31')]=_[_0x5220('0x47')](db[_0x5220('0x4d')]['rawAttributes']);_0x2c4378['query']=_['keys'](_0x221ca7[_0x5220('0x32')]);_0x2c4378[_0x5220('0x33')]=_[_0x5220('0x35')](_0x2c4378['model'],_0x2c4378[_0x5220('0x32')]);_0x5573d6[_0x5220('0x34')]=_['intersection'](_0x2c4378[_0x5220('0x31')],qs[_0x5220('0x36')](_0x221ca7[_0x5220('0x32')]['fields']));_0x5573d6['attributes']=_0x5573d6[_0x5220('0x34')][_0x5220('0x37')]?_0x5573d6[_0x5220('0x34')]:_0x2c4378['model'];_0x5573d6[_0x5220('0x39')]=qs[_0x5220('0x3a')](_0x221ca7[_0x5220('0x32')]['sort']);_0x5573d6[_0x5220('0x3b')]=qs[_0x5220('0x33')](_['pick'](_0x221ca7[_0x5220('0x32')],_0x2c4378[_0x5220('0x33')]));if(_0x221ca7[_0x5220('0x32')]['filter']){_0x5573d6[_0x5220('0x3b')]=_['merge'](_0x5573d6['where'],{'$or':_[_0x5220('0x2b')](_0x5573d6[_0x5220('0x34')],function(_0x15a896){var _0x3f4aa9={};_0x3f4aa9[_0x15a896]={'$like':'%'+_0x221ca7['query'][_0x5220('0x3e')]+'%'};return _0x3f4aa9;})});}_0x5573d6=_['merge']({},_0x5573d6,_0x221ca7[_0x5220('0x3f')]);return _0x5b2f0b[_0x5220('0x50')](_0x5573d6);}})[_0x5220('0x26')](function(_0x3121a5){if(_0x3121a5){_0x28466a=_0x3121a5['length'];if(!_0x221ca7[_0x5220('0x32')][_0x5220('0x4e')]('nolimit')){_0x5573d6['limit']=qs[_0x5220('0x1d')](_0x221ca7[_0x5220('0x32')]['limit']);_0x5573d6['offset']=qs['offset'](_0x221ca7[_0x5220('0x32')]['offset']);}return _0x5b2f0b['getDescriptions'](_0x5573d6);}})[_0x5220('0x26')](function(_0x4c3d2e){if(_0x4c3d2e){return _0x4c3d2e?{'count':_0x28466a,'rows':_0x4c3d2e}:null;}})[_0x5220('0x26')](respondWithResult(_0x4c54a2,null))['catch'](handleError(_0x4c54a2,null));};exports['getFields']=function(_0x59c014,_0x53cfab,_0x257d71){var _0x3ddb50={};var _0x26a7dc={};var _0x522318;var _0x5339fb;return db[_0x5220('0x2c')][_0x5220('0x4c')]({'where':{'id':_0x59c014[_0x5220('0x46')]['id']}})['then'](handleEntityNotFound(_0x53cfab,null))[_0x5220('0x26')](function(_0x239fa4){if(_0x239fa4){_0x522318=_0x239fa4;_0x26a7dc[_0x5220('0x31')]=_[_0x5220('0x47')](db[_0x5220('0x4d')]['rawAttributes']);_0x26a7dc[_0x5220('0x32')]=_[_0x5220('0x47')](_0x59c014[_0x5220('0x32')]);_0x26a7dc[_0x5220('0x33')]=_[_0x5220('0x35')](_0x26a7dc[_0x5220('0x31')],_0x26a7dc[_0x5220('0x32')]);_0x3ddb50[_0x5220('0x34')]=_['intersection'](_0x26a7dc[_0x5220('0x31')],qs['fields'](_0x59c014['query'][_0x5220('0x36')]));_0x3ddb50[_0x5220('0x34')]=_0x3ddb50[_0x5220('0x34')][_0x5220('0x37')]?_0x3ddb50[_0x5220('0x34')]:_0x26a7dc['model'];_0x3ddb50[_0x5220('0x39')]=qs[_0x5220('0x3a')](_0x59c014[_0x5220('0x32')][_0x5220('0x3a')]);_0x3ddb50[_0x5220('0x3b')]=qs[_0x5220('0x33')](_[_0x5220('0x3c')](_0x59c014['query'],_0x26a7dc[_0x5220('0x33')]));if(_0x59c014[_0x5220('0x32')][_0x5220('0x3e')]){_0x3ddb50[_0x5220('0x3b')]=_[_0x5220('0x48')](_0x3ddb50[_0x5220('0x3b')],{'$or':_[_0x5220('0x2b')](_0x3ddb50[_0x5220('0x34')],function(_0x26b794){var _0x19b4b0={};_0x19b4b0[_0x26b794]={'$like':'%'+_0x59c014[_0x5220('0x32')][_0x5220('0x3e')]+'%'};return _0x19b4b0;})});}_0x3ddb50=_[_0x5220('0x48')]({},_0x3ddb50,_0x59c014[_0x5220('0x3f')]);return _0x522318[_0x5220('0x51')](_0x3ddb50);}})['then'](function(_0x2139de){if(_0x2139de){_0x5339fb=_0x2139de[_0x5220('0x37')];if(!_0x59c014[_0x5220('0x32')][_0x5220('0x4e')](_0x5220('0x38'))){_0x3ddb50['limit']=qs[_0x5220('0x1d')](_0x59c014['query'][_0x5220('0x1d')]);_0x3ddb50[_0x5220('0x1c')]=qs[_0x5220('0x1c')](_0x59c014[_0x5220('0x32')][_0x5220('0x1c')]);}return _0x522318['getFields'](_0x3ddb50);}})[_0x5220('0x26')](function(_0x275158){if(_0x275158){return _0x275158?{'count':_0x5339fb,'rows':_0x275158}:null;}})[_0x5220('0x26')](respondWithResult(_0x53cfab,null))[_0x5220('0x44')](handleError(_0x53cfab,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 061214f..221bca6 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 _0x4dc1=['int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define'];(function(_0x3d3b23,_0x136b5a){var _0x5b86d5=function(_0x3d296d){while(--_0x3d296d){_0x3d3b23['push'](_0x3d3b23['shift']());}};_0x5b86d5(++_0x136b5a);}(_0x4dc1,0x127));var _0x14dc=function(_0x3586be,_0x61bf51){_0x3586be=_0x3586be-0x0;var _0x20741c=_0x4dc1[_0x3586be];return _0x20741c;};'use strict';var _=require(_0x14dc('0x0'));var util=require(_0x14dc('0x1'));var logger=require(_0x14dc('0x2'))(_0x14dc('0x3'));var moment=require(_0x14dc('0x4'));var BPromise=require(_0x14dc('0x5'));var rp=require(_0x14dc('0x6'));var fs=require('fs');var path=require(_0x14dc('0x7'));var rimraf=require(_0x14dc('0x8'));var config=require(_0x14dc('0x9'));var attributes=require(_0x14dc('0xa'));module[_0x14dc('0xb')]=function(_0x316f62,_0x346ef6){return _0x316f62[_0x14dc('0xc')]('FreshsalesConfiguration',attributes,{'tableName':_0x14dc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7df3=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FreshsalesConfiguration','int_freshsales_configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7df3,0x15f));var _0x37df=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7df3[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x37df('0x0'));var util=require(_0x37df('0x1'));var logger=require(_0x37df('0x2'))(_0x37df('0x3'));var moment=require(_0x37df('0x4'));var BPromise=require(_0x37df('0x5'));var rp=require(_0x37df('0x6'));var fs=require('fs');var path=require(_0x37df('0x7'));var rimraf=require(_0x37df('0x8'));var config=require(_0x37df('0x9'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x37df('0xa')]=function(_0x398cc5,_0x3f7e21){return _0x398cc5['define'](_0x37df('0xb'),attributes,{'tableName':_0x37df('0xc'),'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 d6bc387..623adbf 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 _0x2970=['client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3eac34,_0x36d581){var _0x14a6fa=function(_0x2d81da){while(--_0x2d81da){_0x3eac34['push'](_0x3eac34['shift']());}};_0x14a6fa(++_0x36d581);}(_0x2970,0x151));var _0x0297=function(_0x213b44,_0x46bb8f){_0x213b44=_0x213b44-0x0;var _0x4c1ddb=_0x2970[_0x213b44];return _0x4c1ddb;};'use strict';var _=require('lodash');var util=require(_0x0297('0x0'));var moment=require(_0x0297('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0297('0x2'));var db=require(_0x0297('0x3'))['db'];var utils=require(_0x0297('0x4'));var logger=require('../../config/logger')(_0x0297('0x5'));var config=require(_0x0297('0x6'));var jayson=require(_0x0297('0x7'));var client=jayson[_0x0297('0x8')][_0x0297('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f12b9,_0x3b0d54,_0x3bccc0){return new BPromise(function(_0x321ab0,_0x3e3286){return client[_0x0297('0xa')](_0x1f12b9,_0x3bccc0)[_0x0297('0xb')](function(_0x22ed55){logger['info'](_0x0297('0xc'),_0x3b0d54,_0x0297('0xd'));logger[_0x0297('0xe')](_0x0297('0xf'),_0x3b0d54,_0x0297('0xd'),JSON[_0x0297('0x10')](_0x22ed55));if(_0x22ed55[_0x0297('0x11')]){if(_0x22ed55[_0x0297('0x11')][_0x0297('0x12')]===0x1f4){logger[_0x0297('0x11')](_0x0297('0xc'),_0x3b0d54,_0x22ed55[_0x0297('0x11')][_0x0297('0x13')]);return _0x3e3286(_0x22ed55['error'][_0x0297('0x13')]);}logger[_0x0297('0x11')](_0x0297('0xc'),_0x3b0d54,_0x22ed55[_0x0297('0x11')][_0x0297('0x13')]);return _0x321ab0(_0x22ed55[_0x0297('0x11')][_0x0297('0x13')]);}else{logger[_0x0297('0x14')](_0x0297('0xc'),_0x3b0d54,_0x0297('0xd'));_0x321ab0(_0x22ed55[_0x0297('0x15')][_0x0297('0x13')]);}})[_0x0297('0x16')](function(_0x102363){logger[_0x0297('0x11')](_0x0297('0xc'),_0x3b0d54,_0x102363);_0x3e3286(_0x102363);});});} \ No newline at end of file +var _0x63e3=['client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x63e3,0x182));var _0x363e=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x63e3[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require(_0x363e('0x0'));var moment=require('moment');var BPromise=require(_0x363e('0x1'));var rs=require(_0x363e('0x2'));var fs=require('fs');var Redis=require(_0x363e('0x3'));var db=require(_0x363e('0x4'))['db'];var utils=require(_0x363e('0x5'));var logger=require(_0x363e('0x6'))(_0x363e('0x7'));var config=require(_0x363e('0x8'));var jayson=require(_0x363e('0x9'));var client=jayson[_0x363e('0xa')][_0x363e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40724d,_0x5b4b76,_0xb77711){return new BPromise(function(_0x57f595,_0x899f99){return client[_0x363e('0xc')](_0x40724d,_0xb77711)[_0x363e('0xd')](function(_0x3d855b){logger[_0x363e('0xe')](_0x363e('0xf'),_0x5b4b76,_0x363e('0x10'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x5b4b76,'request\x20sent',JSON['stringify'](_0x3d855b));if(_0x3d855b[_0x363e('0x11')]){if(_0x3d855b[_0x363e('0x11')][_0x363e('0x12')]===0x1f4){logger[_0x363e('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5b4b76,_0x3d855b[_0x363e('0x11')][_0x363e('0x13')]);return _0x899f99(_0x3d855b[_0x363e('0x11')][_0x363e('0x13')]);}logger[_0x363e('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5b4b76,_0x3d855b[_0x363e('0x11')]['message']);return _0x57f595(_0x3d855b[_0x363e('0x11')][_0x363e('0x13')]);}else{logger[_0x363e('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5b4b76,_0x363e('0x10'));_0x57f595(_0x3d855b[_0x363e('0x14')][_0x363e('0x13')]);}})[_0x363e('0x15')](function(_0x26a181){logger[_0x363e('0x11')](_0x363e('0xf'),_0x5b4b76,_0x26a181);_0x899f99(_0x26a181);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index fb06e99..d7cc00b 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 _0xd2ce=['get','index','/:id','show','isAuthenticated','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xe9815e,_0x5b625f){var _0x1b8010=function(_0x545a00){while(--_0x545a00){_0xe9815e['push'](_0xe9815e['shift']());}};_0x1b8010(++_0x5b625f);}(_0xd2ce,0x13c));var _0xed2c=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xd2ce[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require('multer');var util=require(_0xed2c('0x0'));var path=require('path');var timeout=require(_0xed2c('0x1'));var express=require(_0xed2c('0x2'));var router=express[_0xed2c('0x3')]();var fs_extra=require(_0xed2c('0x4'));var auth=require(_0xed2c('0x5'));var interaction=require(_0xed2c('0x6'));var config=require(_0xed2c('0x7'));var controller=require('./intFreshsalesField.controller');router[_0xed2c('0x8')]('/',auth['isAuthenticated'](),controller[_0xed2c('0x9')]);router[_0xed2c('0x8')](_0xed2c('0xa'),auth['isAuthenticated'](),controller[_0xed2c('0xb')]);router['post']('/',auth[_0xed2c('0xc')](),controller[_0xed2c('0xd')]);router['put']('/:id',auth[_0xed2c('0xc')](),controller[_0xed2c('0xe')]);router[_0xed2c('0xf')](_0xed2c('0xa'),auth['isAuthenticated'](),controller[_0xed2c('0x10')]);module[_0xed2c('0x11')]=router; \ No newline at end of file +var _0x6822=['/:id','show','post','put','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index'];(function(_0x145f54,_0x51ce8d){var _0x3c333a=function(_0x47e949){while(--_0x47e949){_0x145f54['push'](_0x145f54['shift']());}};_0x3c333a(++_0x51ce8d);}(_0x6822,0x18c));var _0x2682=function(_0x2be282,_0x3bd351){_0x2be282=_0x2be282-0x0;var _0x26e82b=_0x6822[_0x2be282];return _0x26e82b;};'use strict';var multer=require('multer');var util=require(_0x2682('0x0'));var path=require(_0x2682('0x1'));var timeout=require(_0x2682('0x2'));var express=require(_0x2682('0x3'));var router=express['Router']();var fs_extra=require(_0x2682('0x4'));var auth=require(_0x2682('0x5'));var interaction=require(_0x2682('0x6'));var config=require(_0x2682('0x7'));var controller=require(_0x2682('0x8'));router[_0x2682('0x9')]('/',auth[_0x2682('0xa')](),controller[_0x2682('0xb')]);router[_0x2682('0x9')](_0x2682('0xc'),auth[_0x2682('0xa')](),controller[_0x2682('0xd')]);router[_0x2682('0xe')]('/',auth[_0x2682('0xa')](),controller['create']);router[_0x2682('0xf')](_0x2682('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2682('0xc'),auth[_0x2682('0xa')](),controller['destroy']);module[_0x2682('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 1884323..ef20cff 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 _0x32da=['variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x318641,_0x31380d){var _0x3d4822=function(_0x226f9d){while(--_0x226f9d){_0x318641['push'](_0x318641['shift']());}};_0x3d4822(++_0x31380d);}(_0x32da,0x1bf));var _0xa32d=function(_0x59bcc7,_0x5c4440){_0x59bcc7=_0x59bcc7-0x0;var _0x17cee6=_0x32da[_0x59bcc7];return _0x17cee6;};'use strict';var Sequelize=require(_0xa32d('0x0'));module[_0xa32d('0x1')]={'type':{'type':Sequelize[_0xa32d('0x2')]('string',_0xa32d('0x3'),_0xa32d('0x4'),_0xa32d('0x5'),_0xa32d('0x6')),'defaultValue':_0xa32d('0x7')},'content':{'type':Sequelize[_0xa32d('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa32d('0x2')]('string',_0xa32d('0x3'),_0xa32d('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa32d('0x8')]},'customField':{'type':Sequelize[_0xa32d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa32d('0x8')]}}; \ No newline at end of file +var _0xc95b=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xc95b,0x183));var _0xbc95=function(_0x4c6d4c,_0x1242f3){_0x4c6d4c=_0x4c6d4c-0x0;var _0xb2da90=_0xc95b[_0x4c6d4c];return _0xb2da90;};'use strict';var Sequelize=require('sequelize');module[_0xbc95('0x0')]={'type':{'type':Sequelize[_0xbc95('0x1')]('string',_0xbc95('0x2'),_0xbc95('0x3'),_0xbc95('0x4'),_0xbc95('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbc95('0x1')](_0xbc95('0x6'),_0xbc95('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xbc95('0x7')]},'idField':{'type':Sequelize[_0xbc95('0x7')]},'nameField':{'type':Sequelize[_0xbc95('0x7')]},'customField':{'type':Sequelize[_0xbc95('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 8732251..834e684 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 _0x8718=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','error','name','send','index','map','FreshsalesField','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','include','find','create','body','eml-format'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8718,0x1b5));var _0x8871=function(_0x340380,_0x4bd2a8){_0x340380=_0x340380-0x0;var _0x49ce1c=_0x8718[_0x340380];return _0x49ce1c;};'use strict';var emlformat=require(_0x8871('0x0'));var rimraf=require(_0x8871('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8871('0x2'));var rp=require(_0x8871('0x3'));var moment=require(_0x8871('0x4'));var BPromise=require(_0x8871('0x5'));var Mustache=require(_0x8871('0x6'));var util=require(_0x8871('0x7'));var path=require(_0x8871('0x8'));var sox=require(_0x8871('0x9'));var csv=require(_0x8871('0xa'));var ejs=require(_0x8871('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8871('0xc'));var squel=require(_0x8871('0xd'));var crypto=require(_0x8871('0xe'));var jsforce=require(_0x8871('0xf'));var deskjs=require(_0x8871('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8871('0x11'));var Papa=require(_0x8871('0x12'));var Redis=require(_0x8871('0x13'));var authService=require(_0x8871('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8871('0x15'));var hardwareService=require(_0x8871('0x16'));var logger=require(_0x8871('0x17'))(_0x8871('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8871('0x19'))['db'];function respondWithStatusCode(_0x1b1cec,_0x212bee){_0x212bee=_0x212bee||0xcc;return function(_0x3ee43b){if(_0x3ee43b){return _0x1b1cec[_0x8871('0x1a')](_0x212bee);}return _0x1b1cec['status'](_0x212bee)[_0x8871('0x1b')]();};}function respondWithResult(_0xcba2f9,_0x1a3b70){_0x1a3b70=_0x1a3b70||0xc8;return function(_0x420057){if(_0x420057){return _0xcba2f9[_0x8871('0x1c')](_0x1a3b70)[_0x8871('0x1d')](_0x420057);}};}function respondWithFilteredResult(_0x46ab63,_0x4f7a55){return function(_0x3cc968){if(_0x3cc968){var _0x129050=typeof _0x4f7a55[_0x8871('0x1e')]===_0x8871('0x1f')&&typeof _0x4f7a55[_0x8871('0x20')]===_0x8871('0x1f');var _0x25bf12=_0x3cc968[_0x8871('0x21')];var _0x5d2ac8=_0x129050?0x0:_0x4f7a55[_0x8871('0x1e')];var _0x316923=_0x129050?_0x3cc968[_0x8871('0x21')]:_0x4f7a55[_0x8871('0x1e')]+_0x4f7a55[_0x8871('0x20')];var _0x47ab41;if(_0x316923>=_0x25bf12){_0x316923=_0x25bf12;_0x47ab41=0xc8;}else{_0x47ab41=0xce;}_0x46ab63['status'](_0x47ab41);return _0x46ab63[_0x8871('0x22')]('Content-Range',_0x5d2ac8+'-'+_0x316923+'/'+_0x25bf12)['json'](_0x3cc968);}return null;};}function patchUpdates(_0x3592b4){return function(_0x3ee0d4){try{jsonpatch['apply'](_0x3ee0d4,_0x3592b4,!![]);}catch(_0x4f1ca9){return BPromise[_0x8871('0x23')](_0x4f1ca9);}return _0x3ee0d4[_0x8871('0x24')]();};}function saveUpdates(_0x1139c1,_0x5f34d5){return function(_0x4cc4ca){if(_0x4cc4ca){return _0x4cc4ca[_0x8871('0x25')](_0x1139c1)[_0x8871('0x26')](function(_0x55e9ea){return _0x55e9ea;});}return null;};}function removeEntity(_0x329133,_0x50b1af){return function(_0x2feb5c){if(_0x2feb5c){return _0x2feb5c['destroy']()[_0x8871('0x26')](function(){_0x329133[_0x8871('0x1c')](0xcc)[_0x8871('0x1b')]();});}};}function handleEntityNotFound(_0x29047a,_0x4ee35b){return function(_0x549a2c){if(!_0x549a2c){_0x29047a[_0x8871('0x1a')](0x194);}return _0x549a2c;};}function handleError(_0x33327a,_0x26000c){_0x26000c=_0x26000c||0x1f4;return function(_0x32f050){logger[_0x8871('0x27')](_0x32f050['stack']);if(_0x32f050['name']){delete _0x32f050[_0x8871('0x28')];}_0x33327a['status'](_0x26000c)[_0x8871('0x29')](_0x32f050);};}exports[_0x8871('0x2a')]=function(_0x13f50a,_0x4db91f){var _0x397cbd={},_0x3db626={},_0x2783fb={'count':0x0,'rows':[]};var _0xd5c848=_[_0x8871('0x2b')](db[_0x8871('0x2c')]['rawAttributes'],function(_0x348de6){return{'name':_0x348de6['fieldName'],'type':_0x348de6[_0x8871('0x2d')][_0x8871('0x2e')]};});_0x3db626[_0x8871('0x2f')]=_['map'](_0xd5c848,_0x8871('0x28'));_0x3db626[_0x8871('0x30')]=_[_0x8871('0x31')](_0x13f50a['query']);_0x3db626[_0x8871('0x32')]=_[_0x8871('0x33')](_0x3db626['model'],_0x3db626['query']);_0x397cbd[_0x8871('0x34')]=_[_0x8871('0x33')](_0x3db626[_0x8871('0x2f')],qs['fields'](_0x13f50a[_0x8871('0x30')][_0x8871('0x35')]));_0x397cbd[_0x8871('0x34')]=_0x397cbd[_0x8871('0x34')][_0x8871('0x36')]?_0x397cbd['attributes']:_0x3db626[_0x8871('0x2f')];if(!_0x13f50a['query'][_0x8871('0x37')](_0x8871('0x38'))){_0x397cbd[_0x8871('0x20')]=qs[_0x8871('0x20')](_0x13f50a['query'][_0x8871('0x20')]);_0x397cbd[_0x8871('0x1e')]=qs['offset'](_0x13f50a[_0x8871('0x30')]['offset']);}_0x397cbd[_0x8871('0x39')]=qs[_0x8871('0x3a')](_0x13f50a[_0x8871('0x30')][_0x8871('0x3a')]);_0x397cbd[_0x8871('0x3b')]=qs[_0x8871('0x32')](_[_0x8871('0x3c')](_0x13f50a[_0x8871('0x30')],_0x3db626[_0x8871('0x32')]),_0xd5c848);if(_0x13f50a[_0x8871('0x30')][_0x8871('0x3d')]){_0x397cbd['where']=_[_0x8871('0x3e')](_0x397cbd[_0x8871('0x3b')],{'$or':_[_0x8871('0x2b')](_0xd5c848,function(_0x1063eb){if(_0x1063eb['type']!=='VIRTUAL'){var _0xb8892b={};_0xb8892b[_0x1063eb[_0x8871('0x28')]]={'$like':'%'+_0x13f50a[_0x8871('0x30')][_0x8871('0x3d')]+'%'};return _0xb8892b;}})});}_0x397cbd=_['merge']({},_0x397cbd,_0x13f50a[_0x8871('0x3f')]);var _0x4fe613={'where':_0x397cbd[_0x8871('0x3b')]};return db[_0x8871('0x2c')][_0x8871('0x21')](_0x4fe613)[_0x8871('0x26')](function(_0x110a60){_0x2783fb[_0x8871('0x21')]=_0x110a60;if(_0x13f50a[_0x8871('0x30')][_0x8871('0x40')]){_0x397cbd['include']=[{'all':!![]}];}return db[_0x8871('0x2c')]['findAll'](_0x397cbd);})['then'](function(_0x289df9){_0x2783fb[_0x8871('0x41')]=_0x289df9;return _0x2783fb;})[_0x8871('0x26')](respondWithFilteredResult(_0x4db91f,_0x397cbd))[_0x8871('0x42')](handleError(_0x4db91f,null));};exports[_0x8871('0x43')]=function(_0x485d20,_0x4a4f7d){var _0x1e28fb={'raw':!![],'where':{'id':_0x485d20[_0x8871('0x44')]['id']}},_0x42c4e3={};_0x42c4e3['model']=_[_0x8871('0x31')](db[_0x8871('0x2c')]['rawAttributes']);_0x42c4e3['query']=_['keys'](_0x485d20[_0x8871('0x30')]);_0x42c4e3['filters']=_[_0x8871('0x33')](_0x42c4e3[_0x8871('0x2f')],_0x42c4e3[_0x8871('0x30')]);_0x1e28fb['attributes']=_['intersection'](_0x42c4e3['model'],qs[_0x8871('0x35')](_0x485d20[_0x8871('0x30')][_0x8871('0x35')]));_0x1e28fb[_0x8871('0x34')]=_0x1e28fb[_0x8871('0x34')][_0x8871('0x36')]?_0x1e28fb[_0x8871('0x34')]:_0x42c4e3[_0x8871('0x2f')];if(_0x485d20[_0x8871('0x30')][_0x8871('0x40')]){_0x1e28fb[_0x8871('0x45')]=[{'all':!![]}];}_0x1e28fb=_['merge']({},_0x1e28fb,_0x485d20['options']);return db[_0x8871('0x2c')][_0x8871('0x46')](_0x1e28fb)[_0x8871('0x26')](handleEntityNotFound(_0x4a4f7d,null))['then'](respondWithResult(_0x4a4f7d,null))[_0x8871('0x42')](handleError(_0x4a4f7d,null));};exports[_0x8871('0x47')]=function(_0x192fa6,_0x101cfb){return db[_0x8871('0x2c')]['create'](_0x192fa6[_0x8871('0x48')],{})['then'](respondWithResult(_0x101cfb,0xc9))['catch'](handleError(_0x101cfb,null));};exports[_0x8871('0x25')]=function(_0x26e309,_0x31292){if(_0x26e309['body']['id']){delete _0x26e309['body']['id'];}return db[_0x8871('0x2c')][_0x8871('0x46')]({'where':{'id':_0x26e309[_0x8871('0x44')]['id']}})[_0x8871('0x26')](handleEntityNotFound(_0x31292,null))['then'](saveUpdates(_0x26e309[_0x8871('0x48')],null))[_0x8871('0x26')](respondWithResult(_0x31292,null))[_0x8871('0x42')](handleError(_0x31292,null));};exports['destroy']=function(_0x4d6e74,_0x2203ef){return db['FreshsalesField'][_0x8871('0x46')]({'where':{'id':_0x4d6e74[_0x8871('0x44')]['id']}})[_0x8871('0x26')](handleEntityNotFound(_0x2203ef,null))[_0x8871('0x26')](removeEntity(_0x2203ef,null))[_0x8871('0x42')](handleError(_0x2203ef,null));}; \ No newline at end of file +var _0x4647=['rows','catch','show','params','rawAttributes','options','find','create','body','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','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','undefined','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','FreshsalesField','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','includeAll','include','findAll'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0x4647,0x9f));var _0x7464=function(_0x181c58,_0x705dbd){_0x181c58=_0x181c58-0x0;var _0x39b5ff=_0x4647[_0x181c58];return _0x39b5ff;};'use strict';var emlformat=require(_0x7464('0x0'));var rimraf=require(_0x7464('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7464('0x2'));var moment=require('moment');var BPromise=require(_0x7464('0x3'));var Mustache=require(_0x7464('0x4'));var util=require(_0x7464('0x5'));var path=require('path');var sox=require(_0x7464('0x6'));var csv=require('to-csv');var ejs=require(_0x7464('0x7'));var fs=require('fs');var fs_extra=require(_0x7464('0x8'));var _=require(_0x7464('0x9'));var squel=require(_0x7464('0xa'));var crypto=require(_0x7464('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7464('0xc'));var toCsv=require(_0x7464('0xd'));var querystring=require('querystring');var Papa=require(_0x7464('0xe'));var Redis=require(_0x7464('0xf'));var authService=require(_0x7464('0x10'));var qs=require(_0x7464('0x11'));var as=require(_0x7464('0x12'));var hardwareService=require(_0x7464('0x13'));var logger=require('../../config/logger')(_0x7464('0x14'));var utils=require(_0x7464('0x15'));var config=require(_0x7464('0x16'));var licenseUtil=require(_0x7464('0x17'));var db=require(_0x7464('0x18'))['db'];function respondWithStatusCode(_0xe26655,_0x5cd8b0){_0x5cd8b0=_0x5cd8b0||0xcc;return function(_0x5631bf){if(_0x5631bf){return _0xe26655['sendStatus'](_0x5cd8b0);}return _0xe26655[_0x7464('0x19')](_0x5cd8b0)[_0x7464('0x1a')]();};}function respondWithResult(_0x2b3b49,_0x1c58d1){_0x1c58d1=_0x1c58d1||0xc8;return function(_0x3425aa){if(_0x3425aa){return _0x2b3b49[_0x7464('0x19')](_0x1c58d1)['json'](_0x3425aa);}};}function respondWithFilteredResult(_0x3b47f2,_0x308b42){return function(_0x376253){if(_0x376253){var _0x4c456b=typeof _0x308b42['offset']===_0x7464('0x1b')&&typeof _0x308b42['limit']===_0x7464('0x1b');var _0x3a5c5d=_0x376253[_0x7464('0x1c')];var _0x302347=_0x4c456b?0x0:_0x308b42[_0x7464('0x1d')];var _0x2eb944=_0x4c456b?_0x376253['count']:_0x308b42['offset']+_0x308b42[_0x7464('0x1e')];var _0x39a9c3;if(_0x2eb944>=_0x3a5c5d){_0x2eb944=_0x3a5c5d;_0x39a9c3=0xc8;}else{_0x39a9c3=0xce;}_0x3b47f2[_0x7464('0x19')](_0x39a9c3);return _0x3b47f2[_0x7464('0x1f')](_0x7464('0x20'),_0x302347+'-'+_0x2eb944+'/'+_0x3a5c5d)[_0x7464('0x21')](_0x376253);}return null;};}function patchUpdates(_0x2dd7c8){return function(_0x2a24ea){try{jsonpatch[_0x7464('0x22')](_0x2a24ea,_0x2dd7c8,!![]);}catch(_0x46ee2e){return BPromise['reject'](_0x46ee2e);}return _0x2a24ea[_0x7464('0x23')]();};}function saveUpdates(_0x9f8dc0,_0x11394f){return function(_0x3f4bb1){if(_0x3f4bb1){return _0x3f4bb1[_0x7464('0x24')](_0x9f8dc0)[_0x7464('0x25')](function(_0x1f1631){return _0x1f1631;});}return null;};}function removeEntity(_0x1a56a3,_0x1141ca){return function(_0xbf2b5d){if(_0xbf2b5d){return _0xbf2b5d[_0x7464('0x26')]()[_0x7464('0x25')](function(){_0x1a56a3[_0x7464('0x19')](0xcc)[_0x7464('0x1a')]();});}};}function handleEntityNotFound(_0x1e4cb5,_0x4a6b4d){return function(_0x19907c){if(!_0x19907c){_0x1e4cb5[_0x7464('0x27')](0x194);}return _0x19907c;};}function handleError(_0xad96db,_0x2f814f){_0x2f814f=_0x2f814f||0x1f4;return function(_0x1824ec){logger[_0x7464('0x28')](_0x1824ec[_0x7464('0x29')]);if(_0x1824ec[_0x7464('0x2a')]){delete _0x1824ec[_0x7464('0x2a')];}_0xad96db[_0x7464('0x19')](_0x2f814f)[_0x7464('0x2b')](_0x1824ec);};}exports['index']=function(_0x2c9ab1,_0x8142f6){var _0x1afd60={},_0x1601e6={},_0xe4dc9b={'count':0x0,'rows':[]};var _0x4d18db=_[_0x7464('0x2c')](db[_0x7464('0x2d')]['rawAttributes'],function(_0x10603d){return{'name':_0x10603d[_0x7464('0x2e')],'type':_0x10603d[_0x7464('0x2f')][_0x7464('0x30')]};});_0x1601e6[_0x7464('0x31')]=_['map'](_0x4d18db,'name');_0x1601e6['query']=_[_0x7464('0x32')](_0x2c9ab1[_0x7464('0x33')]);_0x1601e6[_0x7464('0x34')]=_[_0x7464('0x35')](_0x1601e6['model'],_0x1601e6['query']);_0x1afd60[_0x7464('0x36')]=_[_0x7464('0x35')](_0x1601e6[_0x7464('0x31')],qs[_0x7464('0x37')](_0x2c9ab1[_0x7464('0x33')][_0x7464('0x37')]));_0x1afd60[_0x7464('0x36')]=_0x1afd60[_0x7464('0x36')][_0x7464('0x38')]?_0x1afd60[_0x7464('0x36')]:_0x1601e6[_0x7464('0x31')];if(!_0x2c9ab1[_0x7464('0x33')][_0x7464('0x39')](_0x7464('0x3a'))){_0x1afd60[_0x7464('0x1e')]=qs[_0x7464('0x1e')](_0x2c9ab1[_0x7464('0x33')][_0x7464('0x1e')]);_0x1afd60[_0x7464('0x1d')]=qs[_0x7464('0x1d')](_0x2c9ab1[_0x7464('0x33')][_0x7464('0x1d')]);}_0x1afd60['order']=qs[_0x7464('0x3b')](_0x2c9ab1['query'][_0x7464('0x3b')]);_0x1afd60[_0x7464('0x3c')]=qs[_0x7464('0x34')](_['pick'](_0x2c9ab1[_0x7464('0x33')],_0x1601e6[_0x7464('0x34')]),_0x4d18db);if(_0x2c9ab1[_0x7464('0x33')][_0x7464('0x3d')]){_0x1afd60[_0x7464('0x3c')]=_[_0x7464('0x3e')](_0x1afd60[_0x7464('0x3c')],{'$or':_['map'](_0x4d18db,function(_0x24a9f6){if(_0x24a9f6['type']!=='VIRTUAL'){var _0x22e7a8={};_0x22e7a8[_0x24a9f6[_0x7464('0x2a')]]={'$like':'%'+_0x2c9ab1[_0x7464('0x33')][_0x7464('0x3d')]+'%'};return _0x22e7a8;}})});}_0x1afd60=_[_0x7464('0x3e')]({},_0x1afd60,_0x2c9ab1['options']);var _0x3ad624={'where':_0x1afd60[_0x7464('0x3c')]};return db[_0x7464('0x2d')][_0x7464('0x1c')](_0x3ad624)[_0x7464('0x25')](function(_0x493d7a){_0xe4dc9b[_0x7464('0x1c')]=_0x493d7a;if(_0x2c9ab1[_0x7464('0x33')][_0x7464('0x3f')]){_0x1afd60[_0x7464('0x40')]=[{'all':!![]}];}return db[_0x7464('0x2d')][_0x7464('0x41')](_0x1afd60);})[_0x7464('0x25')](function(_0x18ca1e){_0xe4dc9b[_0x7464('0x42')]=_0x18ca1e;return _0xe4dc9b;})['then'](respondWithFilteredResult(_0x8142f6,_0x1afd60))[_0x7464('0x43')](handleError(_0x8142f6,null));};exports[_0x7464('0x44')]=function(_0x360430,_0x51c4dc){var _0x2f630a={'raw':!![],'where':{'id':_0x360430[_0x7464('0x45')]['id']}},_0x582ae1={};_0x582ae1[_0x7464('0x31')]=_[_0x7464('0x32')](db[_0x7464('0x2d')][_0x7464('0x46')]);_0x582ae1[_0x7464('0x33')]=_[_0x7464('0x32')](_0x360430['query']);_0x582ae1[_0x7464('0x34')]=_[_0x7464('0x35')](_0x582ae1['model'],_0x582ae1['query']);_0x2f630a['attributes']=_[_0x7464('0x35')](_0x582ae1[_0x7464('0x31')],qs[_0x7464('0x37')](_0x360430['query'][_0x7464('0x37')]));_0x2f630a[_0x7464('0x36')]=_0x2f630a['attributes']['length']?_0x2f630a[_0x7464('0x36')]:_0x582ae1[_0x7464('0x31')];if(_0x360430[_0x7464('0x33')][_0x7464('0x3f')]){_0x2f630a[_0x7464('0x40')]=[{'all':!![]}];}_0x2f630a=_[_0x7464('0x3e')]({},_0x2f630a,_0x360430[_0x7464('0x47')]);return db[_0x7464('0x2d')][_0x7464('0x48')](_0x2f630a)['then'](handleEntityNotFound(_0x51c4dc,null))[_0x7464('0x25')](respondWithResult(_0x51c4dc,null))['catch'](handleError(_0x51c4dc,null));};exports[_0x7464('0x49')]=function(_0x5d7137,_0x59c184){return db['FreshsalesField'][_0x7464('0x49')](_0x5d7137[_0x7464('0x4a')],{})['then'](respondWithResult(_0x59c184,0xc9))['catch'](handleError(_0x59c184,null));};exports['update']=function(_0x1e7414,_0x15d2b5){if(_0x1e7414['body']['id']){delete _0x1e7414[_0x7464('0x4a')]['id'];}return db[_0x7464('0x2d')][_0x7464('0x48')]({'where':{'id':_0x1e7414[_0x7464('0x45')]['id']}})[_0x7464('0x25')](handleEntityNotFound(_0x15d2b5,null))[_0x7464('0x25')](saveUpdates(_0x1e7414[_0x7464('0x4a')],null))[_0x7464('0x25')](respondWithResult(_0x15d2b5,null))[_0x7464('0x43')](handleError(_0x15d2b5,null));};exports[_0x7464('0x26')]=function(_0x37059a,_0x295a70){return db[_0x7464('0x2d')][_0x7464('0x48')]({'where':{'id':_0x37059a[_0x7464('0x45')]['id']}})['then'](handleEntityNotFound(_0x295a70,null))['then'](removeEntity(_0x295a70,null))['catch'](handleError(_0x295a70,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 78399ab..715f45c 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 _0x5ea2=['bluebird','request-promise','path','../../config/environment','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ea2,0x99));var _0x25ea=function(_0x2e0968,_0x525140){_0x2e0968=_0x2e0968-0x0;var _0x1674ba=_0x5ea2[_0x2e0968];return _0x1674ba;};'use strict';var _=require(_0x25ea('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x25ea('0x1'));var moment=require(_0x25ea('0x2'));var BPromise=require(_0x25ea('0x3'));var rp=require(_0x25ea('0x4'));var fs=require('fs');var path=require(_0x25ea('0x5'));var rimraf=require('rimraf');var config=require(_0x25ea('0x6'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x3e32e9,_0x310a27){return _0x3e32e9[_0x25ea('0x7')](_0x25ea('0x8'),attributes,{'tableName':_0x25ea('0x9'),'paranoid':![],'indexes':[{'name':_0x25ea('0xa'),'fields':[_0x25ea('0xb'),_0x25ea('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5464=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash'];(function(_0x39e476,_0x2eb515){var _0xdf7a90=function(_0x3f26b5){while(--_0x3f26b5){_0x39e476['push'](_0x39e476['shift']());}};_0xdf7a90(++_0x2eb515);}(_0x5464,0x15d));var _0x4546=function(_0x17cb2c,_0x3d6e6a){_0x17cb2c=_0x17cb2c-0x0;var _0x522d69=_0x5464[_0x17cb2c];return _0x522d69;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var logger=require(_0x4546('0x2'))('api');var moment=require(_0x4546('0x3'));var BPromise=require('bluebird');var rp=require(_0x4546('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4546('0x5'));var config=require(_0x4546('0x6'));var attributes=require(_0x4546('0x7'));module[_0x4546('0x8')]=function(_0x54228a,_0x57391f){return _0x54228a['define'](_0x4546('0x9'),attributes,{'tableName':_0x4546('0xa'),'paranoid':![],'indexes':[{'name':_0x4546('0xb'),'fields':[_0x4546('0xc'),_0x4546('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 74607a9..db26515 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 _0xeda8=['debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent'];(function(_0x3530e5,_0x27e60f){var _0x599390=function(_0x3ddf71){while(--_0x3ddf71){_0x3530e5['push'](_0x3530e5['shift']());}};_0x599390(++_0x27e60f);}(_0xeda8,0x104));var _0x8eda=function(_0x47949b,_0x2a046a){_0x47949b=_0x47949b-0x0;var _0x2c1d39=_0xeda8[_0x47949b];return _0x2c1d39;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var moment=require('moment');var BPromise=require(_0x8eda('0x2'));var rs=require(_0x8eda('0x3'));var fs=require('fs');var Redis=require(_0x8eda('0x4'));var db=require(_0x8eda('0x5'))['db'];var utils=require(_0x8eda('0x6'));var logger=require(_0x8eda('0x7'))(_0x8eda('0x8'));var config=require(_0x8eda('0x9'));var jayson=require(_0x8eda('0xa'));var client=jayson[_0x8eda('0xb')][_0x8eda('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32abe8,_0x4e2ebb,_0x28b721){return new BPromise(function(_0x1b6a1d,_0x5aa93d){return client[_0x8eda('0xd')](_0x32abe8,_0x28b721)['then'](function(_0x4f7893){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x8eda('0xe'));logger[_0x8eda('0xf')](_0x8eda('0x10'),_0x4e2ebb,'request\x20sent',JSON[_0x8eda('0x11')](_0x4f7893));if(_0x4f7893['error']){if(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x13')]===0x1f4){logger[_0x8eda('0x12')](_0x8eda('0x14'),_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x5aa93d(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x1b6a1d(_0x4f7893['error'][_0x8eda('0x15')]);}else{logger[_0x8eda('0x16')](_0x8eda('0x14'),_0x4e2ebb,'request\x20sent');_0x1b6a1d(_0x4f7893[_0x8eda('0x17')]['message']);}})[_0x8eda('0x18')](function(_0x553382){logger[_0x8eda('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x553382);_0x5aa93d(_0x553382);});});} \ No newline at end of file +var _0xb4c7=['client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1d7a59,_0x5bbc93){var _0x20cb0c=function(_0x205d19){while(--_0x205d19){_0x1d7a59['push'](_0x1d7a59['shift']());}};_0x20cb0c(++_0x5bbc93);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x378315,_0x2ed4d3){_0x378315=_0x378315-0x0;var _0x38fa99=_0xb4c7[_0x378315];return _0x38fa99;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var BPromise=require(_0x7b4c('0x3'));var rs=require(_0x7b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b4c('0x5'))['db'];var utils=require(_0x7b4c('0x6'));var logger=require(_0x7b4c('0x7'))(_0x7b4c('0x8'));var config=require(_0x7b4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7b4c('0xa')][_0x7b4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd5c7,_0x4bf85d,_0x2d7b7e){return new BPromise(function(_0x21687f,_0x570daa){return client[_0x7b4c('0xc')](_0x2dd5c7,_0x2d7b7e)[_0x7b4c('0xd')](function(_0x28e902){logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));logger[_0x7b4c('0x11')](_0x7b4c('0x12'),_0x4bf85d,_0x7b4c('0x10'),JSON[_0x7b4c('0x13')](_0x28e902));if(_0x28e902['error']){if(_0x28e902['error'][_0x7b4c('0x14')]===0x1f4){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);return _0x570daa(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')]['message']);return _0x21687f(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}else{logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));_0x21687f(_0x28e902[_0x7b4c('0x17')][_0x7b4c('0x16')]);}})[_0x7b4c('0x18')](function(_0x4d3f5e){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x4d3f5e);_0x570daa(_0x4d3f5e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 3ab4796..3ebb7aa 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(_0x64a64f,_0x515800){var _0x3b459c=function(_0x2c7b9a){while(--_0x2c7b9a){_0x64a64f['push'](_0x64a64f['shift']());}};_0x3b459c(++_0x515800);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0xd1553a,_0x496ecf){var _0x2d8c52=function(_0x337bfc){while(--_0x337bfc){_0xd1553a['push'](_0xd1553a['shift']());}};_0x2d8c52(++_0x496ecf);}(_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 abb4586..2ef4872 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 _0x79e2=['STRING','newTab','integrationTab','sequelize'];(function(_0x53145f,_0x47e237){var _0x4a4dd1=function(_0x249a9a){while(--_0x249a9a){_0x53145f['push'](_0x53145f['shift']());}};_0x4a4dd1(++_0x47e237);}(_0x79e2,0x1c3));var _0x279e=function(_0x14bf40,_0x202023){_0x14bf40=_0x14bf40-0x0;var _0x543965=_0x79e2[_0x14bf40];return _0x543965;};'use strict';var Sequelize=require(_0x279e('0x0'));module['exports']={'name':{'type':Sequelize[_0x279e('0x1')]},'description':{'type':Sequelize[_0x279e('0x1')]},'username':{'type':Sequelize[_0x279e('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x279e('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x279e('0x1')]},'clientSecret':{'type':Sequelize[_0x279e('0x1')]},'securityToken':{'type':Sequelize[_0x279e('0x1')]},'serverUrl':{'type':Sequelize[_0x279e('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x279e('0x2')),'defaultValue':_0x279e('0x3')}}; \ No newline at end of file +var _0x3cc7=['exports','STRING','ENUM','newTab','integrationTab','sequelize'];(function(_0x28697d,_0x830154){var _0x3327cc=function(_0x519134){while(--_0x519134){_0x28697d['push'](_0x28697d['shift']());}};_0x3327cc(++_0x830154);}(_0x3cc7,0x11f));var _0x73cc=function(_0x4acdd0,_0x4d1f59){_0x4acdd0=_0x4acdd0-0x0;var _0x392ba5=_0x3cc7[_0x4acdd0];return _0x392ba5;};'use strict';var Sequelize=require(_0x73cc('0x0'));module[_0x73cc('0x1')]={'name':{'type':Sequelize[_0x73cc('0x2')]},'description':{'type':Sequelize[_0x73cc('0x2')]},'username':{'type':Sequelize[_0x73cc('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x73cc('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x73cc('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x73cc('0x2')]},'serverUrl':{'type':Sequelize[_0x73cc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x73cc('0x3')]('integrationTab',_0x73cc('0x4')),'defaultValue':_0x73cc('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 2d0f683..f3b8a62 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 _0x0ede=['IsReminderSet','IsRecurrence','Subject','string','int','picklist','phone','label','picklistValues','value','boolean','True','true','False','false','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','error','name','send','index','SalesforceAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','catch','create','params','body','destroy','getConfigurations','findOne','SalesforceConfiguration','sort','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Subjects','Task','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','concat','isNil','ticketType','sobject','describe','OwnerId'];(function(_0x540705,_0x5c8fb1){var _0x3cb184=function(_0x2b8dc9){while(--_0x2b8dc9){_0x540705['push'](_0x540705['shift']());}};_0x3cb184(++_0x5c8fb1);}(_0x0ede,0x1e9));var _0xe0ed=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0ede[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xe0ed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0ed('0x1'));var jsonpatch=require(_0xe0ed('0x2'));var rp=require(_0xe0ed('0x3'));var moment=require(_0xe0ed('0x4'));var BPromise=require(_0xe0ed('0x5'));var Mustache=require(_0xe0ed('0x6'));var util=require(_0xe0ed('0x7'));var path=require(_0xe0ed('0x8'));var sox=require(_0xe0ed('0x9'));var csv=require(_0xe0ed('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe0ed('0xb'));var squel=require(_0xe0ed('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe0ed('0xd'));var toCsv=require(_0xe0ed('0xa'));var querystring=require(_0xe0ed('0xe'));var Papa=require(_0xe0ed('0xf'));var Redis=require(_0xe0ed('0x10'));var authService=require(_0xe0ed('0x11'));var qs=require(_0xe0ed('0x12'));var as=require(_0xe0ed('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe0ed('0x14'));var utils=require('../../config/utils');var config=require(_0xe0ed('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0ed('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5594ab,_0x2f5ff1){_0x2f5ff1=_0x2f5ff1||0xcc;return function(_0x526bcd){if(_0x526bcd){return _0x5594ab[_0xe0ed('0x17')](_0x2f5ff1);}return _0x5594ab[_0xe0ed('0x18')](_0x2f5ff1)['end']();};}function respondWithResult(_0x55885e,_0x59dfe3){_0x59dfe3=_0x59dfe3||0xc8;return function(_0x2ff21e){if(_0x2ff21e){return _0x55885e[_0xe0ed('0x18')](_0x59dfe3)[_0xe0ed('0x19')](_0x2ff21e);}};}function respondWithFilteredResult(_0x38a4d3,_0x4859d5){return function(_0x44a81b){if(_0x44a81b){var _0x1b1bdb=typeof _0x4859d5[_0xe0ed('0x1a')]===_0xe0ed('0x1b')&&typeof _0x4859d5[_0xe0ed('0x1c')]===_0xe0ed('0x1b');var _0x4567ab=_0x44a81b['count'];var _0x21dab8=_0x1b1bdb?0x0:_0x4859d5[_0xe0ed('0x1a')];var _0x12b381=_0x1b1bdb?_0x44a81b[_0xe0ed('0x1d')]:_0x4859d5[_0xe0ed('0x1a')]+_0x4859d5[_0xe0ed('0x1c')];var _0x3e7888;if(_0x12b381>=_0x4567ab){_0x12b381=_0x4567ab;_0x3e7888=0xc8;}else{_0x3e7888=0xce;}_0x38a4d3[_0xe0ed('0x18')](_0x3e7888);return _0x38a4d3[_0xe0ed('0x1e')](_0xe0ed('0x1f'),_0x21dab8+'-'+_0x12b381+'/'+_0x4567ab)['json'](_0x44a81b);}return null;};}function patchUpdates(_0x175120){return function(_0xa8967){try{jsonpatch['apply'](_0xa8967,_0x175120,!![]);}catch(_0x3a68f1){return BPromise[_0xe0ed('0x20')](_0x3a68f1);}return _0xa8967['save']();};}function saveUpdates(_0x2a3d8f,_0xd8c6de){return function(_0x4f534e){if(_0x4f534e){return _0x4f534e['update'](_0x2a3d8f)[_0xe0ed('0x21')](function(_0x3876ea){return _0x3876ea;});}return null;};}function removeEntity(_0x5f5dfd,_0x330a14){return function(_0x1d8977){if(_0x1d8977){return _0x1d8977['destroy']()[_0xe0ed('0x21')](function(){_0x5f5dfd[_0xe0ed('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b032a,_0xf69358){return function(_0x36942b){if(!_0x36942b){_0x4b032a[_0xe0ed('0x17')](0x194);}return _0x36942b;};}function handleError(_0x1c48ab,_0x592a63){_0x592a63=_0x592a63||0x1f4;return function(_0x3bc57d){logger[_0xe0ed('0x22')](_0x3bc57d['stack']);if(_0x3bc57d['name']){delete _0x3bc57d[_0xe0ed('0x23')];}_0x1c48ab[_0xe0ed('0x18')](_0x592a63)[_0xe0ed('0x24')](_0x3bc57d);};}exports[_0xe0ed('0x25')]=function(_0x2f368d,_0x46fd91){var _0x484e67={},_0x30a5a2={},_0x215c51={'count':0x0,'rows':[]};var _0x2131ec=_['map'](db[_0xe0ed('0x26')][_0xe0ed('0x27')],function(_0x4b165a){return{'name':_0x4b165a[_0xe0ed('0x28')],'type':_0x4b165a[_0xe0ed('0x29')]['key']};});_0x30a5a2[_0xe0ed('0x2a')]=_[_0xe0ed('0x2b')](_0x2131ec,_0xe0ed('0x23'));_0x30a5a2[_0xe0ed('0x2c')]=_[_0xe0ed('0x2d')](_0x2f368d['query']);_0x30a5a2[_0xe0ed('0x2e')]=_[_0xe0ed('0x2f')](_0x30a5a2['model'],_0x30a5a2['query']);_0x484e67['attributes']=_['intersection'](_0x30a5a2[_0xe0ed('0x2a')],qs[_0xe0ed('0x30')](_0x2f368d[_0xe0ed('0x2c')][_0xe0ed('0x30')]));_0x484e67['attributes']=_0x484e67[_0xe0ed('0x31')][_0xe0ed('0x32')]?_0x484e67[_0xe0ed('0x31')]:_0x30a5a2[_0xe0ed('0x2a')];if(!_0x2f368d[_0xe0ed('0x2c')][_0xe0ed('0x33')](_0xe0ed('0x34'))){_0x484e67[_0xe0ed('0x1c')]=qs[_0xe0ed('0x1c')](_0x2f368d[_0xe0ed('0x2c')]['limit']);_0x484e67[_0xe0ed('0x1a')]=qs[_0xe0ed('0x1a')](_0x2f368d[_0xe0ed('0x2c')][_0xe0ed('0x1a')]);}_0x484e67[_0xe0ed('0x35')]=qs['sort'](_0x2f368d[_0xe0ed('0x2c')]['sort']);_0x484e67[_0xe0ed('0x36')]=qs[_0xe0ed('0x2e')](_[_0xe0ed('0x37')](_0x2f368d[_0xe0ed('0x2c')],_0x30a5a2['filters']),_0x2131ec);if(_0x2f368d[_0xe0ed('0x2c')][_0xe0ed('0x38')]){_0x484e67['where']=_[_0xe0ed('0x39')](_0x484e67[_0xe0ed('0x36')],{'$or':_[_0xe0ed('0x2b')](_0x2131ec,function(_0x20a348){if(_0x20a348[_0xe0ed('0x29')]!==_0xe0ed('0x3a')){var _0x212640={};_0x212640[_0x20a348[_0xe0ed('0x23')]]={'$like':'%'+_0x2f368d['query']['filter']+'%'};return _0x212640;}})});}_0x484e67=_[_0xe0ed('0x39')]({},_0x484e67,_0x2f368d[_0xe0ed('0x3b')]);var _0x243645={'where':_0x484e67[_0xe0ed('0x36')]};return db[_0xe0ed('0x26')][_0xe0ed('0x1d')](_0x243645)[_0xe0ed('0x21')](function(_0x69744b){_0x215c51[_0xe0ed('0x1d')]=_0x69744b;if(_0x2f368d['query'][_0xe0ed('0x3c')]){_0x484e67[_0xe0ed('0x3d')]=[{'all':!![]}];}return db[_0xe0ed('0x26')][_0xe0ed('0x3e')](_0x484e67);})[_0xe0ed('0x21')](function(_0x27575b){_0x215c51[_0xe0ed('0x3f')]=_0x27575b;return _0x215c51;})[_0xe0ed('0x21')](respondWithFilteredResult(_0x46fd91,_0x484e67))['catch'](handleError(_0x46fd91,null));};exports['show']=function(_0x7b0c52,_0x5119a3){var _0x962c08={'raw':![],'where':{'id':_0x7b0c52['params']['id']}},_0x44ca04={};_0x44ca04['model']=_[_0xe0ed('0x2d')](db['SalesforceAccount'][_0xe0ed('0x27')]);_0x44ca04['query']=_[_0xe0ed('0x2d')](_0x7b0c52[_0xe0ed('0x2c')]);_0x44ca04[_0xe0ed('0x2e')]=_[_0xe0ed('0x2f')](_0x44ca04[_0xe0ed('0x2a')],_0x44ca04[_0xe0ed('0x2c')]);_0x962c08[_0xe0ed('0x31')]=_[_0xe0ed('0x2f')](_0x44ca04[_0xe0ed('0x2a')],qs[_0xe0ed('0x30')](_0x7b0c52['query'][_0xe0ed('0x30')]));_0x962c08[_0xe0ed('0x31')]=_0x962c08[_0xe0ed('0x31')][_0xe0ed('0x32')]?_0x962c08[_0xe0ed('0x31')]:_0x44ca04[_0xe0ed('0x2a')];if(_0x7b0c52[_0xe0ed('0x2c')][_0xe0ed('0x3c')]){_0x962c08[_0xe0ed('0x3d')]=[{'all':!![]}];}_0x962c08=_['merge']({},_0x962c08,_0x7b0c52[_0xe0ed('0x3b')]);return db[_0xe0ed('0x26')][_0xe0ed('0x40')](_0x962c08)['then'](handleEntityNotFound(_0x5119a3,null))['then'](respondWithResult(_0x5119a3,null))[_0xe0ed('0x41')](handleError(_0x5119a3,null));};exports[_0xe0ed('0x42')]=function(_0x1659cc,_0x4a2029){return db[_0xe0ed('0x26')][_0xe0ed('0x42')](_0x1659cc['body'],{})[_0xe0ed('0x21')](respondWithResult(_0x4a2029,0xc9))[_0xe0ed('0x41')](handleError(_0x4a2029,null));};exports['update']=function(_0x43a35c,_0x22b669){if(_0x43a35c['body']['id']){delete _0x43a35c['body']['id'];}return db[_0xe0ed('0x26')][_0xe0ed('0x40')]({'where':{'id':_0x43a35c[_0xe0ed('0x43')]['id']}})[_0xe0ed('0x21')](handleEntityNotFound(_0x22b669,null))[_0xe0ed('0x21')](saveUpdates(_0x43a35c[_0xe0ed('0x44')],null))[_0xe0ed('0x21')](respondWithResult(_0x22b669,null))[_0xe0ed('0x41')](handleError(_0x22b669,null));};exports[_0xe0ed('0x45')]=function(_0x3470a1,_0x1e8ef7){return db[_0xe0ed('0x26')]['find']({'where':{'id':_0x3470a1[_0xe0ed('0x43')]['id']}})['then'](handleEntityNotFound(_0x1e8ef7,null))['then'](removeEntity(_0x1e8ef7,null))[_0xe0ed('0x41')](handleError(_0x1e8ef7,null));};exports[_0xe0ed('0x46')]=function(_0x32b90c,_0x3505ab,_0x137400){var _0x3f064f={};var _0x3dc694={};var _0x57972f;var _0x203f6e;return db[_0xe0ed('0x26')][_0xe0ed('0x47')]({'where':{'id':_0x32b90c[_0xe0ed('0x43')]['id']}})[_0xe0ed('0x21')](handleEntityNotFound(_0x3505ab,null))['then'](function(_0x380ee7){if(_0x380ee7){_0x57972f=_0x380ee7;_0x3dc694[_0xe0ed('0x2a')]=_[_0xe0ed('0x2d')](db[_0xe0ed('0x48')][_0xe0ed('0x27')]);_0x3dc694[_0xe0ed('0x2c')]=_['keys'](_0x32b90c['query']);_0x3dc694[_0xe0ed('0x2e')]=_[_0xe0ed('0x2f')](_0x3dc694[_0xe0ed('0x2a')],_0x3dc694[_0xe0ed('0x2c')]);_0x3f064f[_0xe0ed('0x31')]=_[_0xe0ed('0x2f')](_0x3dc694[_0xe0ed('0x2a')],qs[_0xe0ed('0x30')](_0x32b90c['query'][_0xe0ed('0x30')]));_0x3f064f[_0xe0ed('0x31')]=_0x3f064f[_0xe0ed('0x31')]['length']?_0x3f064f[_0xe0ed('0x31')]:_0x3dc694[_0xe0ed('0x2a')];_0x3f064f['order']=qs[_0xe0ed('0x49')](_0x32b90c['query']['sort']);_0x3f064f[_0xe0ed('0x36')]=qs[_0xe0ed('0x2e')](_['pick'](_0x32b90c[_0xe0ed('0x2c')],_0x3dc694[_0xe0ed('0x2e')]));if(_0x32b90c['query']['filter']){_0x3f064f['where']=_[_0xe0ed('0x39')](_0x3f064f[_0xe0ed('0x36')],{'$or':_[_0xe0ed('0x2b')](_0x3f064f['attributes'],function(_0x2258db){var _0x40d7f1={};_0x40d7f1[_0x2258db]={'$like':'%'+_0x32b90c[_0xe0ed('0x2c')][_0xe0ed('0x38')]+'%'};return _0x40d7f1;})});}_0x3f064f=_['merge']({},_0x3f064f,_0x32b90c[_0xe0ed('0x3b')]);return _0x57972f['getConfigurations'](_0x3f064f);}})[_0xe0ed('0x21')](function(_0x4f0e7b){if(_0x4f0e7b){_0x203f6e=_0x4f0e7b['length'];if(!_0x32b90c[_0xe0ed('0x2c')][_0xe0ed('0x33')]('nolimit')){_0x3f064f[_0xe0ed('0x1c')]=qs[_0xe0ed('0x1c')](_0x32b90c[_0xe0ed('0x2c')][_0xe0ed('0x1c')]);_0x3f064f[_0xe0ed('0x1a')]=qs['offset'](_0x32b90c[_0xe0ed('0x2c')][_0xe0ed('0x1a')]);}return _0x57972f[_0xe0ed('0x46')](_0x3f064f);}})[_0xe0ed('0x21')](function(_0x349198){if(_0x349198){return _0x349198?{'count':_0x203f6e,'rows':_0x349198}:null;}})[_0xe0ed('0x21')](respondWithResult(_0x3505ab,null))[_0xe0ed('0x41')](handleError(_0x3505ab,null));};exports[_0xe0ed('0x4a')]=function(_0x553fde,_0x28f892,_0x5cf59e){if(_0x553fde[_0xe0ed('0x44')]['id']){delete _0x553fde['body']['id'];}return db['SalesforceAccount'][_0xe0ed('0x47')]({'where':{'id':_0x553fde[_0xe0ed('0x43')]['id']}})[_0xe0ed('0x21')](handleEntityNotFound(_0x28f892,null))['then'](function(_0x2907ee){if(_0x2907ee){_0x553fde[_0xe0ed('0x44')][_0xe0ed('0x4b')]=_0x2907ee['id'];_0x553fde[_0xe0ed('0x44')]['Subjects']=integrations[_0xe0ed('0x4c')](_0x553fde[_0xe0ed('0x44')][_0xe0ed('0x4d')],_0x553fde[_0xe0ed('0x44')][_0xe0ed('0x29')]);_0x553fde[_0xe0ed('0x44')][_0xe0ed('0x4e')]=integrations[_0xe0ed('0x4f')](_0x553fde[_0xe0ed('0x44')][_0xe0ed('0x4d')],_0x553fde[_0xe0ed('0x44')][_0xe0ed('0x29')]);return db[_0xe0ed('0x48')]['create'](_0x553fde[_0xe0ed('0x44')],{'include':[{'model':db[_0xe0ed('0x50')],'as':_0xe0ed('0x51')},{'model':db[_0xe0ed('0x50')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x28f892,null))[_0xe0ed('0x41')](handleError(_0x28f892,null));};exports['getFields']=function(_0xe36f6b,_0x4a5347,_0x20c12a){var _0x29b60e;var _0x2e9c85='';var _0x8b841b=_0xe0ed('0x52');return db['SalesforceAccount'][_0xe0ed('0x47')]({'where':{'id':_0xe36f6b['params']['id']},'attributes':['id','remoteUri',_0xe0ed('0x53'),_0xe0ed('0x54'),_0xe0ed('0x55'),_0xe0ed('0x56'),_0xe0ed('0x57')]})[_0xe0ed('0x21')](handleEntityNotFound(_0x4a5347,null))[_0xe0ed('0x21')](function(_0x2efff6){if(_0x2efff6){_0x2e9c85=_0x2efff6['remoteUri'];var _0x40af0f=_0x2e9c85[_0xe0ed('0x58')](-0x1);if(_0x40af0f==='/'){_0x2e9c85=_0x2e9c85['substring'](0x0,_0x2e9c85[_0xe0ed('0x59')](_0x40af0f));}_0x29b60e=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2e9c85,'clientId':_0x2efff6[_0xe0ed('0x53')],'clientSecret':_0x2efff6[_0xe0ed('0x54')]}});return _0x29b60e['login'](_0x2efff6[_0xe0ed('0x55')],_0x2efff6['password'][_0xe0ed('0x5a')](_0x2efff6[_0xe0ed('0x57')]));}})[_0xe0ed('0x21')](function(_0x494cea){if(_0x494cea){if(!_[_0xe0ed('0x5b')](_0xe36f6b[_0xe0ed('0x2c')][_0xe0ed('0x5c')])){_0x8b841b=_0xe36f6b['query'][_0xe0ed('0x5c')];}return _0x29b60e[_0xe0ed('0x5d')](_0x8b841b)[_0xe0ed('0x5e')]();}})[_0xe0ed('0x21')](function(_0x3183cf){var _0x319ab7=[_0xe0ed('0x5f'),'ActivityDate',_0xe0ed('0x60'),_0xe0ed('0x61'),_0xe0ed('0x62'),'Description'];var _0x4ff733=[_0xe0ed('0x63'),_0xe0ed('0x64'),_0xe0ed('0x65'),'boolean','email','textarea',_0xe0ed('0x66')];if(_0x3183cf){_['remove'](_0x3183cf['fields'],function(_0xd1532e){return _0x319ab7['includes'](_0xd1532e[_0xe0ed('0x23')])||!_0x4ff733['includes'](_0xd1532e[_0xe0ed('0x29')]);});return{'count':_0x3183cf[_0xe0ed('0x30')]['length'],'rows':_[_0xe0ed('0x2b')](_0x3183cf[_0xe0ed('0x30')],function(_0x51cfb2){return{'id':_0x51cfb2[_0xe0ed('0x23')],'name':_0x51cfb2[_0xe0ed('0x67')],'custom':_0x51cfb2['custom'],'options':_0x51cfb2[_0xe0ed('0x68')]['length']>0x0?_[_0xe0ed('0x2b')](_0x51cfb2[_0xe0ed('0x68')],function(_0x5a1163){return{'name':_0x5a1163[_0xe0ed('0x67')],'value':_0x5a1163[_0xe0ed('0x69')]};}):_0x51cfb2[_0xe0ed('0x29')]==_0xe0ed('0x6a')?[{'name':_0xe0ed('0x6b'),'value':_0xe0ed('0x6c')},{'name':_0xe0ed('0x6d'),'value':_0xe0ed('0x6e')}]:[]};})};}})['then'](respondWithResult(_0x4a5347,null))[_0xe0ed('0x41')](function(_0x188803){var _0x5067fa=_0xe36f6b[_0xe0ed('0x2c')]['test']?0x1f4:_0x188803['statusCode']||0x1f4;logger[_0xe0ed('0x22')](_0xe0ed('0x6f'),_0xe0ed('0x70'),_0x5067fa,JSON[_0xe0ed('0x71')](_0x188803));delete _0x188803[_0xe0ed('0x23')];if(_0x5067fa===0x191){_0x5067fa=0x190;}_0x4a5347[_0xe0ed('0x18')](_0x5067fa)['send'](_0xe36f6b[_0xe0ed('0x2c')][_0xe0ed('0x72')]?{'message':_0xe0ed('0x73'),'statusCode':_0x188803[_0xe0ed('0x74')]}:_0x188803);});}; \ No newline at end of file +var _0xbf5b=['end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','filters','intersection','find','create','body','params','getConfigurations','findOne','SalesforceConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','picklist','boolean','email','includes','label','custom','picklistValues','True','False','false','test','error','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status'];(function(_0x45f6d6,_0x5b2804){var _0x135043=function(_0x2f2456){while(--_0x2f2456){_0x45f6d6['push'](_0x45f6d6['shift']());}};_0x135043(++_0x5b2804);}(_0xbf5b,0x1e2));var _0xbbf5=function(_0x3cca7a,_0x109a23){_0x3cca7a=_0x3cca7a-0x0;var _0x34e717=_0xbf5b[_0x3cca7a];return _0x34e717;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbbf5('0x0'));var zipdir=require(_0xbbf5('0x1'));var jsonpatch=require(_0xbbf5('0x2'));var rp=require(_0xbbf5('0x3'));var moment=require('moment');var BPromise=require(_0xbbf5('0x4'));var Mustache=require(_0xbbf5('0x5'));var util=require(_0xbbf5('0x6'));var path=require(_0xbbf5('0x7'));var sox=require(_0xbbf5('0x8'));var csv=require('to-csv');var ejs=require(_0xbbf5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbbf5('0xa'));var squel=require(_0xbbf5('0xb'));var crypto=require(_0xbbf5('0xc'));var jsforce=require(_0xbbf5('0xd'));var deskjs=require(_0xbbf5('0xe'));var toCsv=require(_0xbbf5('0xf'));var querystring=require(_0xbbf5('0x10'));var Papa=require(_0xbbf5('0x11'));var Redis=require(_0xbbf5('0x12'));var authService=require(_0xbbf5('0x13'));var qs=require(_0xbbf5('0x14'));var as=require(_0xbbf5('0x15'));var hardwareService=require(_0xbbf5('0x16'));var logger=require('../../config/logger')(_0xbbf5('0x17'));var utils=require(_0xbbf5('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xbbf5('0x19'));var db=require(_0xbbf5('0x1a'))['db'];var integrations=require(_0xbbf5('0x1b'));function respondWithStatusCode(_0x1f3d0a,_0x451f04){_0x451f04=_0x451f04||0xcc;return function(_0x867270){if(_0x867270){return _0x1f3d0a[_0xbbf5('0x1c')](_0x451f04);}return _0x1f3d0a[_0xbbf5('0x1d')](_0x451f04)[_0xbbf5('0x1e')]();};}function respondWithResult(_0x330c67,_0x4dfebb){_0x4dfebb=_0x4dfebb||0xc8;return function(_0x4b80f0){if(_0x4b80f0){return _0x330c67[_0xbbf5('0x1d')](_0x4dfebb)[_0xbbf5('0x1f')](_0x4b80f0);}};}function respondWithFilteredResult(_0x22ed76,_0x553d15){return function(_0x18baba){if(_0x18baba){var _0x85572d=typeof _0x553d15[_0xbbf5('0x20')]===_0xbbf5('0x21')&&typeof _0x553d15['limit']==='undefined';var _0x3bde98=_0x18baba[_0xbbf5('0x22')];var _0x509f7c=_0x85572d?0x0:_0x553d15['offset'];var _0x572cc2=_0x85572d?_0x18baba[_0xbbf5('0x22')]:_0x553d15[_0xbbf5('0x20')]+_0x553d15[_0xbbf5('0x23')];var _0x686ab8;if(_0x572cc2>=_0x3bde98){_0x572cc2=_0x3bde98;_0x686ab8=0xc8;}else{_0x686ab8=0xce;}_0x22ed76['status'](_0x686ab8);return _0x22ed76['set'](_0xbbf5('0x24'),_0x509f7c+'-'+_0x572cc2+'/'+_0x3bde98)[_0xbbf5('0x1f')](_0x18baba);}return null;};}function patchUpdates(_0x3fe210){return function(_0x3cea10){try{jsonpatch['apply'](_0x3cea10,_0x3fe210,!![]);}catch(_0x147014){return BPromise[_0xbbf5('0x25')](_0x147014);}return _0x3cea10[_0xbbf5('0x26')]();};}function saveUpdates(_0x4342c8,_0x193e99){return function(_0x67a43){if(_0x67a43){return _0x67a43[_0xbbf5('0x27')](_0x4342c8)[_0xbbf5('0x28')](function(_0xd6988b){return _0xd6988b;});}return null;};}function removeEntity(_0xe88657,_0x1b6855){return function(_0x1fd224){if(_0x1fd224){return _0x1fd224[_0xbbf5('0x29')]()[_0xbbf5('0x28')](function(){_0xe88657['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36e213,_0x1e9230){return function(_0x4c6dd8){if(!_0x4c6dd8){_0x36e213['sendStatus'](0x194);}return _0x4c6dd8;};}function handleError(_0x2f3c8d,_0x294a8d){_0x294a8d=_0x294a8d||0x1f4;return function(_0x439c58){logger['error'](_0x439c58[_0xbbf5('0x2a')]);if(_0x439c58[_0xbbf5('0x2b')]){delete _0x439c58['name'];}_0x2f3c8d[_0xbbf5('0x1d')](_0x294a8d)[_0xbbf5('0x2c')](_0x439c58);};}exports[_0xbbf5('0x2d')]=function(_0x3653b3,_0xc6229c){var _0x4af76f={},_0xe20346={},_0x174c63={'count':0x0,'rows':[]};var _0x2b4fba=_[_0xbbf5('0x2e')](db[_0xbbf5('0x2f')][_0xbbf5('0x30')],function(_0x16fe11){return{'name':_0x16fe11[_0xbbf5('0x31')],'type':_0x16fe11[_0xbbf5('0x32')]['key']};});_0xe20346[_0xbbf5('0x33')]=_[_0xbbf5('0x2e')](_0x2b4fba,'name');_0xe20346[_0xbbf5('0x34')]=_[_0xbbf5('0x35')](_0x3653b3[_0xbbf5('0x34')]);_0xe20346['filters']=_['intersection'](_0xe20346['model'],_0xe20346[_0xbbf5('0x34')]);_0x4af76f[_0xbbf5('0x36')]=_['intersection'](_0xe20346[_0xbbf5('0x33')],qs[_0xbbf5('0x37')](_0x3653b3[_0xbbf5('0x34')][_0xbbf5('0x37')]));_0x4af76f['attributes']=_0x4af76f[_0xbbf5('0x36')][_0xbbf5('0x38')]?_0x4af76f[_0xbbf5('0x36')]:_0xe20346[_0xbbf5('0x33')];if(!_0x3653b3[_0xbbf5('0x34')][_0xbbf5('0x39')](_0xbbf5('0x3a'))){_0x4af76f[_0xbbf5('0x23')]=qs['limit'](_0x3653b3[_0xbbf5('0x34')]['limit']);_0x4af76f[_0xbbf5('0x20')]=qs[_0xbbf5('0x20')](_0x3653b3[_0xbbf5('0x34')]['offset']);}_0x4af76f['order']=qs['sort'](_0x3653b3[_0xbbf5('0x34')][_0xbbf5('0x3b')]);_0x4af76f[_0xbbf5('0x3c')]=qs['filters'](_['pick'](_0x3653b3[_0xbbf5('0x34')],_0xe20346['filters']),_0x2b4fba);if(_0x3653b3[_0xbbf5('0x34')][_0xbbf5('0x3d')]){_0x4af76f[_0xbbf5('0x3c')]=_[_0xbbf5('0x3e')](_0x4af76f[_0xbbf5('0x3c')],{'$or':_[_0xbbf5('0x2e')](_0x2b4fba,function(_0x42c8c5){if(_0x42c8c5[_0xbbf5('0x32')]!==_0xbbf5('0x3f')){var _0x86cc2d={};_0x86cc2d[_0x42c8c5[_0xbbf5('0x2b')]]={'$like':'%'+_0x3653b3[_0xbbf5('0x34')]['filter']+'%'};return _0x86cc2d;}})});}_0x4af76f=_[_0xbbf5('0x3e')]({},_0x4af76f,_0x3653b3[_0xbbf5('0x40')]);var _0x55b63c={'where':_0x4af76f[_0xbbf5('0x3c')]};return db[_0xbbf5('0x2f')][_0xbbf5('0x22')](_0x55b63c)['then'](function(_0x316552){_0x174c63[_0xbbf5('0x22')]=_0x316552;if(_0x3653b3[_0xbbf5('0x34')][_0xbbf5('0x41')]){_0x4af76f[_0xbbf5('0x42')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xbbf5('0x43')](_0x4af76f);})[_0xbbf5('0x28')](function(_0x3b2187){_0x174c63[_0xbbf5('0x44')]=_0x3b2187;return _0x174c63;})['then'](respondWithFilteredResult(_0xc6229c,_0x4af76f))[_0xbbf5('0x45')](handleError(_0xc6229c,null));};exports[_0xbbf5('0x46')]=function(_0x3a67f9,_0x440a1f){var _0x5b8a89={'raw':![],'where':{'id':_0x3a67f9['params']['id']}},_0x1f515e={};_0x1f515e[_0xbbf5('0x33')]=_['keys'](db[_0xbbf5('0x2f')]['rawAttributes']);_0x1f515e[_0xbbf5('0x34')]=_[_0xbbf5('0x35')](_0x3a67f9[_0xbbf5('0x34')]);_0x1f515e[_0xbbf5('0x47')]=_[_0xbbf5('0x48')](_0x1f515e['model'],_0x1f515e[_0xbbf5('0x34')]);_0x5b8a89['attributes']=_[_0xbbf5('0x48')](_0x1f515e['model'],qs['fields'](_0x3a67f9[_0xbbf5('0x34')][_0xbbf5('0x37')]));_0x5b8a89[_0xbbf5('0x36')]=_0x5b8a89[_0xbbf5('0x36')][_0xbbf5('0x38')]?_0x5b8a89['attributes']:_0x1f515e[_0xbbf5('0x33')];if(_0x3a67f9[_0xbbf5('0x34')][_0xbbf5('0x41')]){_0x5b8a89['include']=[{'all':!![]}];}_0x5b8a89=_[_0xbbf5('0x3e')]({},_0x5b8a89,_0x3a67f9[_0xbbf5('0x40')]);return db[_0xbbf5('0x2f')][_0xbbf5('0x49')](_0x5b8a89)['then'](handleEntityNotFound(_0x440a1f,null))['then'](respondWithResult(_0x440a1f,null))[_0xbbf5('0x45')](handleError(_0x440a1f,null));};exports[_0xbbf5('0x4a')]=function(_0x5c3340,_0x4eed78){return db[_0xbbf5('0x2f')][_0xbbf5('0x4a')](_0x5c3340[_0xbbf5('0x4b')],{})[_0xbbf5('0x28')](respondWithResult(_0x4eed78,0xc9))['catch'](handleError(_0x4eed78,null));};exports[_0xbbf5('0x27')]=function(_0x14061e,_0x3effcb){if(_0x14061e[_0xbbf5('0x4b')]['id']){delete _0x14061e[_0xbbf5('0x4b')]['id'];}return db[_0xbbf5('0x2f')][_0xbbf5('0x49')]({'where':{'id':_0x14061e[_0xbbf5('0x4c')]['id']}})[_0xbbf5('0x28')](handleEntityNotFound(_0x3effcb,null))[_0xbbf5('0x28')](saveUpdates(_0x14061e[_0xbbf5('0x4b')],null))[_0xbbf5('0x28')](respondWithResult(_0x3effcb,null))[_0xbbf5('0x45')](handleError(_0x3effcb,null));};exports[_0xbbf5('0x29')]=function(_0x48ae2c,_0x10cb49){return db[_0xbbf5('0x2f')][_0xbbf5('0x49')]({'where':{'id':_0x48ae2c[_0xbbf5('0x4c')]['id']}})[_0xbbf5('0x28')](handleEntityNotFound(_0x10cb49,null))['then'](removeEntity(_0x10cb49,null))['catch'](handleError(_0x10cb49,null));};exports[_0xbbf5('0x4d')]=function(_0x3debfb,_0x4dfc7a,_0x39e292){var _0x448fe9={};var _0x5f3783={};var _0x44c1e0;var _0x3cf561;return db['SalesforceAccount'][_0xbbf5('0x4e')]({'where':{'id':_0x3debfb['params']['id']}})['then'](handleEntityNotFound(_0x4dfc7a,null))[_0xbbf5('0x28')](function(_0x3a3944){if(_0x3a3944){_0x44c1e0=_0x3a3944;_0x5f3783[_0xbbf5('0x33')]=_['keys'](db[_0xbbf5('0x4f')][_0xbbf5('0x30')]);_0x5f3783[_0xbbf5('0x34')]=_['keys'](_0x3debfb['query']);_0x5f3783['filters']=_[_0xbbf5('0x48')](_0x5f3783['model'],_0x5f3783[_0xbbf5('0x34')]);_0x448fe9[_0xbbf5('0x36')]=_[_0xbbf5('0x48')](_0x5f3783['model'],qs[_0xbbf5('0x37')](_0x3debfb[_0xbbf5('0x34')]['fields']));_0x448fe9['attributes']=_0x448fe9[_0xbbf5('0x36')][_0xbbf5('0x38')]?_0x448fe9[_0xbbf5('0x36')]:_0x5f3783['model'];_0x448fe9['order']=qs['sort'](_0x3debfb[_0xbbf5('0x34')]['sort']);_0x448fe9[_0xbbf5('0x3c')]=qs[_0xbbf5('0x47')](_[_0xbbf5('0x50')](_0x3debfb[_0xbbf5('0x34')],_0x5f3783['filters']));if(_0x3debfb['query'][_0xbbf5('0x3d')]){_0x448fe9[_0xbbf5('0x3c')]=_[_0xbbf5('0x3e')](_0x448fe9[_0xbbf5('0x3c')],{'$or':_['map'](_0x448fe9[_0xbbf5('0x36')],function(_0x218596){var _0x5a45f5={};_0x5a45f5[_0x218596]={'$like':'%'+_0x3debfb[_0xbbf5('0x34')][_0xbbf5('0x3d')]+'%'};return _0x5a45f5;})});}_0x448fe9=_['merge']({},_0x448fe9,_0x3debfb[_0xbbf5('0x40')]);return _0x44c1e0[_0xbbf5('0x4d')](_0x448fe9);}})[_0xbbf5('0x28')](function(_0x2ab069){if(_0x2ab069){_0x3cf561=_0x2ab069['length'];if(!_0x3debfb[_0xbbf5('0x34')][_0xbbf5('0x39')](_0xbbf5('0x3a'))){_0x448fe9[_0xbbf5('0x23')]=qs[_0xbbf5('0x23')](_0x3debfb[_0xbbf5('0x34')]['limit']);_0x448fe9[_0xbbf5('0x20')]=qs[_0xbbf5('0x20')](_0x3debfb[_0xbbf5('0x34')][_0xbbf5('0x20')]);}return _0x44c1e0[_0xbbf5('0x4d')](_0x448fe9);}})['then'](function(_0x20c2b2){if(_0x20c2b2){return _0x20c2b2?{'count':_0x3cf561,'rows':_0x20c2b2}:null;}})[_0xbbf5('0x28')](respondWithResult(_0x4dfc7a,null))[_0xbbf5('0x45')](handleError(_0x4dfc7a,null));};exports[_0xbbf5('0x51')]=function(_0x59d266,_0x4e4917,_0x5b5048){if(_0x59d266['body']['id']){delete _0x59d266[_0xbbf5('0x4b')]['id'];}return db[_0xbbf5('0x2f')][_0xbbf5('0x4e')]({'where':{'id':_0x59d266[_0xbbf5('0x4c')]['id']}})[_0xbbf5('0x28')](handleEntityNotFound(_0x4e4917,null))[_0xbbf5('0x28')](function(_0x5acc93){if(_0x5acc93){_0x59d266[_0xbbf5('0x4b')][_0xbbf5('0x52')]=_0x5acc93['id'];_0x59d266[_0xbbf5('0x4b')][_0xbbf5('0x53')]=integrations[_0xbbf5('0x54')](_0x59d266[_0xbbf5('0x4b')][_0xbbf5('0x55')],_0x59d266['body']['type']);_0x59d266[_0xbbf5('0x4b')]['Descriptions']=integrations[_0xbbf5('0x56')](_0x59d266['body'][_0xbbf5('0x55')],_0x59d266[_0xbbf5('0x4b')]['type']);return db[_0xbbf5('0x4f')][_0xbbf5('0x4a')](_0x59d266[_0xbbf5('0x4b')],{'include':[{'model':db[_0xbbf5('0x57')],'as':_0xbbf5('0x53')},{'model':db[_0xbbf5('0x57')],'as':_0xbbf5('0x58')}]});}return null;})[_0xbbf5('0x28')](respondWithResult(_0x4e4917,null))[_0xbbf5('0x45')](handleError(_0x4e4917,null));};exports[_0xbbf5('0x59')]=function(_0x450b9b,_0x700344,_0x726cbe){var _0xd66806;var _0x297af7='';var _0x334b0b=_0xbbf5('0x5a');return db[_0xbbf5('0x2f')][_0xbbf5('0x4e')]({'where':{'id':_0x450b9b['params']['id']},'attributes':['id','remoteUri',_0xbbf5('0x5b'),_0xbbf5('0x5c'),_0xbbf5('0x5d'),_0xbbf5('0x5e'),_0xbbf5('0x5f')]})['then'](handleEntityNotFound(_0x700344,null))[_0xbbf5('0x28')](function(_0x59fc06){if(_0x59fc06){_0x297af7=_0x59fc06[_0xbbf5('0x60')];var _0x1a96c6=_0x297af7[_0xbbf5('0x61')](-0x1);if(_0x1a96c6==='/'){_0x297af7=_0x297af7[_0xbbf5('0x62')](0x0,_0x297af7[_0xbbf5('0x63')](_0x1a96c6));}_0xd66806=new jsforce[(_0xbbf5('0x64'))]({'oauth2':{'loginUrl':_0x297af7,'clientId':_0x59fc06[_0xbbf5('0x5b')],'clientSecret':_0x59fc06[_0xbbf5('0x5c')]}});return _0xd66806[_0xbbf5('0x65')](_0x59fc06[_0xbbf5('0x5d')],_0x59fc06[_0xbbf5('0x5e')][_0xbbf5('0x66')](_0x59fc06[_0xbbf5('0x5f')]));}})[_0xbbf5('0x28')](function(_0x118021){if(_0x118021){if(!_[_0xbbf5('0x67')](_0x450b9b[_0xbbf5('0x34')][_0xbbf5('0x68')])){_0x334b0b=_0x450b9b[_0xbbf5('0x34')][_0xbbf5('0x68')];}return _0xd66806[_0xbbf5('0x69')](_0x334b0b)[_0xbbf5('0x6a')]();}})[_0xbbf5('0x28')](function(_0x5aba26){var _0x2af4e5=[_0xbbf5('0x6b'),_0xbbf5('0x6c'),_0xbbf5('0x6d'),_0xbbf5('0x6e'),'Subject',_0xbbf5('0x6f')];var _0x2a6755=[_0xbbf5('0x70'),_0xbbf5('0x71'),_0xbbf5('0x72'),_0xbbf5('0x73'),_0xbbf5('0x74'),'textarea','phone'];if(_0x5aba26){_['remove'](_0x5aba26[_0xbbf5('0x37')],function(_0xa0057){return _0x2af4e5[_0xbbf5('0x75')](_0xa0057['name'])||!_0x2a6755['includes'](_0xa0057['type']);});return{'count':_0x5aba26[_0xbbf5('0x37')][_0xbbf5('0x38')],'rows':_[_0xbbf5('0x2e')](_0x5aba26['fields'],function(_0x2f39a8){return{'id':_0x2f39a8['name'],'name':_0x2f39a8[_0xbbf5('0x76')],'custom':_0x2f39a8[_0xbbf5('0x77')],'options':_0x2f39a8[_0xbbf5('0x78')][_0xbbf5('0x38')]>0x0?_[_0xbbf5('0x2e')](_0x2f39a8['picklistValues'],function(_0x2357e8){return{'name':_0x2357e8[_0xbbf5('0x76')],'value':_0x2357e8['value']};}):_0x2f39a8[_0xbbf5('0x32')]=='boolean'?[{'name':_0xbbf5('0x79'),'value':'true'},{'name':_0xbbf5('0x7a'),'value':_0xbbf5('0x7b')}]:[]};})};}})['then'](respondWithResult(_0x700344,null))[_0xbbf5('0x45')](function(_0x4f5035){var _0x15e8f7=_0x450b9b['query'][_0xbbf5('0x7c')]?0x1f4:_0x4f5035['statusCode']||0x1f4;logger[_0xbbf5('0x7d')]('getFields,\x20%s,\x20%s,\x20%s',_0xbbf5('0x59'),_0x15e8f7,JSON[_0xbbf5('0x7e')](_0x4f5035));delete _0x4f5035[_0xbbf5('0x2b')];if(_0x15e8f7===0x191){_0x15e8f7=0x190;}_0x700344[_0xbbf5('0x1d')](_0x15e8f7)[_0xbbf5('0x2c')](_0x450b9b[_0xbbf5('0x34')]['test']?{'message':_0xbbf5('0x7f'),'statusCode':_0x4f5035['statusCode']}:_0x4f5035);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 980f0a8..62be0ce 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 _0xd8cc=['bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','moment'];(function(_0x360fa1,_0x178adc){var _0x127295=function(_0x59ca5b){while(--_0x59ca5b){_0x360fa1['push'](_0x360fa1['shift']());}};_0x127295(++_0x178adc);}(_0xd8cc,0xc9));var _0xcd8c=function(_0x3f7598,_0x212e37){_0x3f7598=_0x3f7598-0x0;var _0x51fb16=_0xd8cc[_0x3f7598];return _0x51fb16;};'use strict';var _=require(_0xcd8c('0x0'));var util=require(_0xcd8c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcd8c('0x2'));var BPromise=require(_0xcd8c('0x3'));var rp=require(_0xcd8c('0x4'));var fs=require('fs');var path=require(_0xcd8c('0x5'));var rimraf=require('rimraf');var config=require(_0xcd8c('0x6'));var attributes=require(_0xcd8c('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xcd8c('0x8')]=function(_0x233d52,_0x55c4ed){return _0x233d52[_0xcd8c('0x9')](_0xcd8c('0xa'),attributes,{'tableName':_0xcd8c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6400=['../../config/logger','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','lodash'];(function(_0x5d4ea8,_0x59863c){var _0x4cfe10=function(_0x334475){while(--_0x334475){_0x5d4ea8['push'](_0x5d4ea8['shift']());}};_0x4cfe10(++_0x59863c);}(_0x6400,0x1ee));var _0x0640=function(_0x5a7513,_0xa2742f){_0x5a7513=_0x5a7513-0x0;var _0x41af54=_0x6400[_0x5a7513];return _0x41af54;};'use strict';var _=require(_0x0640('0x0'));var util=require('util');var logger=require(_0x0640('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0640('0x2'));var rp=require(_0x0640('0x3'));var fs=require('fs');var path=require(_0x0640('0x4'));var rimraf=require(_0x0640('0x5'));var config=require('../../config/environment');var attributes=require(_0x0640('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x0640('0x7')]=function(_0x2fb7fa,_0x2781eb){return _0x2fb7fa[_0x0640('0x8')](_0x0640('0x9'),attributes,{'tableName':_0x0640('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 3e46e01..c0b3cb4 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 _0x51ef=['catch','GetSalesforceAccount','SalesforceAccount','findAll','raw','options','where','limit','map','include','model','attributes','ShowSalesforceAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SalesforceAccount,\x20%s,\x20%s'];(function(_0x373eab,_0x7e8ce9){var _0x5aa12b=function(_0x3a2ecc){while(--_0x3a2ecc){_0x373eab['push'](_0x373eab['shift']());}};_0x5aa12b(++_0x7e8ce9);}(_0x51ef,0x18f));var _0xf51e=function(_0x2b1b4f,_0x4fe1e0){_0x2b1b4f=_0x2b1b4f-0x0;var _0x2f070c=_0x51ef[_0x2b1b4f];return _0x2f070c;};'use strict';var _=require(_0xf51e('0x0'));var util=require('util');var moment=require(_0xf51e('0x1'));var BPromise=require(_0xf51e('0x2'));var rs=require(_0xf51e('0x3'));var fs=require('fs');var Redis=require(_0xf51e('0x4'));var db=require(_0xf51e('0x5'))['db'];var utils=require(_0xf51e('0x6'));var logger=require(_0xf51e('0x7'))(_0xf51e('0x8'));var config=require(_0xf51e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf51e('0xa')][_0xf51e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c8c79,_0x5145e8,_0x4f63ca){return new BPromise(function(_0x14d636,_0x3090b5){return client['request'](_0x4c8c79,_0x4f63ca)[_0xf51e('0xc')](function(_0x4017fe){logger[_0xf51e('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x5145e8,_0xf51e('0xe'));logger[_0xf51e('0xf')](_0xf51e('0x10'),_0x5145e8,'request\x20sent',JSON[_0xf51e('0x11')](_0x4017fe));if(_0x4017fe[_0xf51e('0x12')]){if(_0x4017fe['error']['code']===0x1f4){logger[_0xf51e('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x5145e8,_0x4017fe['error'][_0xf51e('0x13')]);return _0x3090b5(_0x4017fe[_0xf51e('0x12')]['message']);}logger[_0xf51e('0x12')](_0xf51e('0x14'),_0x5145e8,_0x4017fe[_0xf51e('0x12')][_0xf51e('0x13')]);return _0x14d636(_0x4017fe[_0xf51e('0x12')][_0xf51e('0x13')]);}else{logger[_0xf51e('0xd')](_0xf51e('0x14'),_0x5145e8,_0xf51e('0xe'));_0x14d636(_0x4017fe['result'][_0xf51e('0x13')]);}})[_0xf51e('0x15')](function(_0x235de9){logger[_0xf51e('0x12')](_0xf51e('0x14'),_0x5145e8,_0x235de9);_0x3090b5(_0x235de9);});});}exports[_0xf51e('0x16')]=function(_0x322b80){var _0x3c225d=this;return new Promise(function(_0x3a7227,_0x260fa8){return db[_0xf51e('0x17')][_0xf51e('0x18')]({'raw':_0x322b80['options']?_0x322b80['options'][_0xf51e('0x19')]===undefined?!![]:![]:!![],'where':_0x322b80[_0xf51e('0x1a')]?_0x322b80[_0xf51e('0x1a')][_0xf51e('0x1b')]||null:null,'attributes':_0x322b80['options']?_0x322b80[_0xf51e('0x1a')]['attributes']||null:null,'limit':_0x322b80['options']?_0x322b80[_0xf51e('0x1a')][_0xf51e('0x1c')]||null:null,'include':_0x322b80[_0xf51e('0x1a')]?_0x322b80[_0xf51e('0x1a')]['include']?_[_0xf51e('0x1d')](_0x322b80[_0xf51e('0x1a')][_0xf51e('0x1e')],function(_0x467511){return{'model':db[_0x467511['model']],'as':_0x467511['as'],'attributes':_0x467511['attributes'],'include':_0x467511[_0xf51e('0x1e')]?_[_0xf51e('0x1d')](_0x467511[_0xf51e('0x1e')],function(_0x412ad1){return{'model':db[_0x412ad1['model']],'as':_0x412ad1['as'],'attributes':_0x412ad1['attributes'],'include':_0x412ad1[_0xf51e('0x1e')]?_[_0xf51e('0x1d')](_0x412ad1['include'],function(_0x4c8dbe){return{'model':db[_0x4c8dbe[_0xf51e('0x1f')]],'as':_0x4c8dbe['as'],'attributes':_0x4c8dbe[_0xf51e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd8b07){logger['info'](_0xf51e('0x16'),_0x322b80);logger['debug'](_0xf51e('0x16'),_0x322b80,JSON[_0xf51e('0x11')](_0xd8b07));_0x3a7227(_0xd8b07);})[_0xf51e('0x15')](function(_0x5f1447){logger[_0xf51e('0x12')](_0xf51e('0x16'),_0x5f1447['message'],_0x322b80);_0x260fa8(_0x3c225d['error'](0x1f4,_0x5f1447['message']));});});};exports[_0xf51e('0x21')]=function(_0x4ea455){var _0x3977de=this;return new Promise(function(_0x453c80,_0x5cb779){return db[_0xf51e('0x17')][_0xf51e('0x22')]({'raw':_0x4ea455['options']?_0x4ea455['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ea455[_0xf51e('0x1a')]?_0x4ea455[_0xf51e('0x1a')]['where']||null:null,'attributes':_0x4ea455[_0xf51e('0x1a')]?_0x4ea455['options'][_0xf51e('0x20')]||null:null,'include':_0x4ea455[_0xf51e('0x1a')]?_0x4ea455[_0xf51e('0x1a')][_0xf51e('0x1e')]?_[_0xf51e('0x1d')](_0x4ea455[_0xf51e('0x1a')][_0xf51e('0x1e')],function(_0x2dbc46){return{'model':db[_0x2dbc46[_0xf51e('0x1f')]],'as':_0x2dbc46['as'],'attributes':_0x2dbc46[_0xf51e('0x20')],'include':_0x2dbc46[_0xf51e('0x1e')]?_['map'](_0x2dbc46[_0xf51e('0x1e')],function(_0x762382){return{'model':db[_0x762382[_0xf51e('0x1f')]],'as':_0x762382['as'],'attributes':_0x762382[_0xf51e('0x20')],'include':_0x762382['include']?_[_0xf51e('0x1d')](_0x762382[_0xf51e('0x1e')],function(_0x34c5f0){return{'model':db[_0x34c5f0[_0xf51e('0x1f')]],'as':_0x34c5f0['as'],'attributes':_0x34c5f0[_0xf51e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf51e('0xc')](function(_0x2ae697){logger[_0xf51e('0xd')](_0xf51e('0x21'),_0x4ea455);logger['debug'](_0xf51e('0x21'),_0x4ea455,JSON[_0xf51e('0x11')](_0x2ae697));_0x453c80(_0x2ae697);})[_0xf51e('0x15')](function(_0x10606f){logger[_0xf51e('0x12')]('ShowSalesforceAccount',_0x10606f[_0xf51e('0x13')],_0x4ea455);_0x5cb779(_0x3977de[_0xf51e('0x12')](0x1f4,_0x10606f[_0xf51e('0x13')]));});});}; \ No newline at end of file +var _0x3bde=['attributes','include','map','model','ShowSalesforceAccount','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x3bde,0x9a));var _0xe3bd=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x3bde[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0xe3bd('0x0'));var util=require(_0xe3bd('0x1'));var moment=require(_0xe3bd('0x2'));var BPromise=require(_0xe3bd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3bd('0x4'));var db=require(_0xe3bd('0x5'))['db'];var utils=require(_0xe3bd('0x6'));var logger=require(_0xe3bd('0x7'))(_0xe3bd('0x8'));var config=require(_0xe3bd('0x9'));var jayson=require(_0xe3bd('0xa'));var client=jayson[_0xe3bd('0xb')][_0xe3bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4cd9ee,_0x1752f0,_0x5ab243){return new BPromise(function(_0x4b8c6c,_0x46ae5d){return client[_0xe3bd('0xd')](_0x4cd9ee,_0x5ab243)[_0xe3bd('0xe')](function(_0x2f3a71){logger[_0xe3bd('0xf')](_0xe3bd('0x10'),_0x1752f0,_0xe3bd('0x11'));logger['debug'](_0xe3bd('0x12'),_0x1752f0,_0xe3bd('0x11'),JSON[_0xe3bd('0x13')](_0x2f3a71));if(_0x2f3a71['error']){if(_0x2f3a71[_0xe3bd('0x14')][_0xe3bd('0x15')]===0x1f4){logger[_0xe3bd('0x14')]('SalesforceAccount,\x20%s,\x20%s',_0x1752f0,_0x2f3a71[_0xe3bd('0x14')]['message']);return _0x46ae5d(_0x2f3a71['error'][_0xe3bd('0x16')]);}logger['error'](_0xe3bd('0x10'),_0x1752f0,_0x2f3a71['error'][_0xe3bd('0x16')]);return _0x4b8c6c(_0x2f3a71[_0xe3bd('0x14')][_0xe3bd('0x16')]);}else{logger[_0xe3bd('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x1752f0,_0xe3bd('0x11'));_0x4b8c6c(_0x2f3a71[_0xe3bd('0x17')][_0xe3bd('0x16')]);}})[_0xe3bd('0x18')](function(_0x1c960c){logger[_0xe3bd('0x14')](_0xe3bd('0x10'),_0x1752f0,_0x1c960c);_0x46ae5d(_0x1c960c);});});}exports[_0xe3bd('0x19')]=function(_0x24779c){var _0x53d3c2=this;return new Promise(function(_0x2eaf12,_0x19130a){return db[_0xe3bd('0x1a')][_0xe3bd('0x1b')]({'raw':_0x24779c[_0xe3bd('0x1c')]?_0x24779c[_0xe3bd('0x1c')][_0xe3bd('0x1d')]===undefined?!![]:![]:!![],'where':_0x24779c[_0xe3bd('0x1c')]?_0x24779c[_0xe3bd('0x1c')][_0xe3bd('0x1e')]||null:null,'attributes':_0x24779c['options']?_0x24779c['options'][_0xe3bd('0x1f')]||null:null,'limit':_0x24779c[_0xe3bd('0x1c')]?_0x24779c[_0xe3bd('0x1c')]['limit']||null:null,'include':_0x24779c['options']?_0x24779c[_0xe3bd('0x1c')][_0xe3bd('0x20')]?_[_0xe3bd('0x21')](_0x24779c[_0xe3bd('0x1c')][_0xe3bd('0x20')],function(_0x2c8b43){return{'model':db[_0x2c8b43[_0xe3bd('0x22')]],'as':_0x2c8b43['as'],'attributes':_0x2c8b43[_0xe3bd('0x1f')],'include':_0x2c8b43[_0xe3bd('0x20')]?_[_0xe3bd('0x21')](_0x2c8b43[_0xe3bd('0x20')],function(_0x3a7263){return{'model':db[_0x3a7263[_0xe3bd('0x22')]],'as':_0x3a7263['as'],'attributes':_0x3a7263['attributes'],'include':_0x3a7263[_0xe3bd('0x20')]?_['map'](_0x3a7263[_0xe3bd('0x20')],function(_0x24abe8){return{'model':db[_0x24abe8['model']],'as':_0x24abe8['as'],'attributes':_0x24abe8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x10d2fa){logger['info'](_0xe3bd('0x19'),_0x24779c);logger['debug']('GetSalesforceAccount',_0x24779c,JSON[_0xe3bd('0x13')](_0x10d2fa));_0x2eaf12(_0x10d2fa);})[_0xe3bd('0x18')](function(_0x2400a2){logger[_0xe3bd('0x14')](_0xe3bd('0x19'),_0x2400a2[_0xe3bd('0x16')],_0x24779c);_0x19130a(_0x53d3c2['error'](0x1f4,_0x2400a2[_0xe3bd('0x16')]));});});};exports[_0xe3bd('0x23')]=function(_0x2346f8){var _0x55e699=this;return new Promise(function(_0x258c9e,_0x1ee632){return db[_0xe3bd('0x1a')]['find']({'raw':_0x2346f8[_0xe3bd('0x1c')]?_0x2346f8['options'][_0xe3bd('0x1d')]===undefined?!![]:![]:!![],'where':_0x2346f8[_0xe3bd('0x1c')]?_0x2346f8['options'][_0xe3bd('0x1e')]||null:null,'attributes':_0x2346f8[_0xe3bd('0x1c')]?_0x2346f8['options']['attributes']||null:null,'include':_0x2346f8[_0xe3bd('0x1c')]?_0x2346f8['options'][_0xe3bd('0x20')]?_['map'](_0x2346f8[_0xe3bd('0x1c')][_0xe3bd('0x20')],function(_0x9774e0){return{'model':db[_0x9774e0['model']],'as':_0x9774e0['as'],'attributes':_0x9774e0[_0xe3bd('0x1f')],'include':_0x9774e0[_0xe3bd('0x20')]?_[_0xe3bd('0x21')](_0x9774e0[_0xe3bd('0x20')],function(_0x1012d4){return{'model':db[_0x1012d4[_0xe3bd('0x22')]],'as':_0x1012d4['as'],'attributes':_0x1012d4[_0xe3bd('0x1f')],'include':_0x1012d4[_0xe3bd('0x20')]?_[_0xe3bd('0x21')](_0x1012d4[_0xe3bd('0x20')],function(_0x3772fd){return{'model':db[_0x3772fd['model']],'as':_0x3772fd['as'],'attributes':_0x3772fd[_0xe3bd('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe3bd('0xe')](function(_0x12cf37){logger['info'](_0xe3bd('0x23'),_0x2346f8);logger[_0xe3bd('0x24')](_0xe3bd('0x23'),_0x2346f8,JSON['stringify'](_0x12cf37));_0x258c9e(_0x12cf37);})[_0xe3bd('0x18')](function(_0x596a84){logger['error'](_0xe3bd('0x23'),_0x596a84['message'],_0x2346f8);_0x1ee632(_0x55e699[_0xe3bd('0x14')](0x1f4,_0x596a84['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index bc6de40..5b94fe7 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xdb28,0x106));var _0x8db2=function(_0x1b0541,_0x167d1c){_0x1b0541=_0x1b0541-0x0;var _0x48855a=_0xdb28[_0x1b0541];return _0x48855a;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xdb28,0x106));var _0x8db2=function(_0x1e8e8e,_0x522e09){_0x1e8e8e=_0x1e8e8e-0x0;var _0x59680b=_0xdb28[_0x1e8e8e];return _0x59680b;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index b658209..ff54738 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 _0x6330=['sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing'];(function(_0x5cdae9,_0x5e30a9){var _0x417701=function(_0x3e0142){while(--_0x3e0142){_0x5cdae9['push'](_0x5cdae9['shift']());}};_0x417701(++_0x5e30a9);}(_0x6330,0xcc));var _0x0633=function(_0x3c11e5,_0x72618c){_0x3c11e5=_0x3c11e5-0x0;var _0x163e43=_0x6330[_0x3c11e5];return _0x163e43;};'use strict';var Sequelize=require(_0x0633('0x0'));module[_0x0633('0x1')]={'name':{'type':Sequelize[_0x0633('0x2')]},'description':{'type':Sequelize[_0x0633('0x2')]},'ticketType':{'type':Sequelize[_0x0633('0x3')](_0x0633('0x4'),_0x0633('0x5')),'defaultValue':_0x0633('0x4')},'moduleSearch':{'type':Sequelize[_0x0633('0x3')](_0x0633('0x6'),_0x0633('0x7'),_0x0633('0x8'),_0x0633('0x9'),_0x0633('0xa')),'defaultValue':_0x0633('0x6')},'moduleCreate':{'type':Sequelize[_0x0633('0x3')](_0x0633('0xb'),_0x0633('0x7'),'lead',_0x0633('0xa')),'defaultValue':_0x0633('0x8')},'leadId':{'type':Sequelize[_0x0633('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x0633('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x0633('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x0633('0x2')]}}; \ No newline at end of file +var _0x6c05=['lead','sequelize','exports','STRING','Task','Case','ENUM','contact_lead','contact','account','nothing'];(function(_0x4d65ff,_0x39597d){var _0x4fc866=function(_0x5cea49){while(--_0x5cea49){_0x4d65ff['push'](_0x4d65ff['shift']());}};_0x4fc866(++_0x39597d);}(_0x6c05,0x64));var _0x56c0=function(_0x5038e2,_0x42ad81){_0x5038e2=_0x5038e2-0x0;var _0x42a14f=_0x6c05[_0x5038e2];return _0x42a14f;};'use strict';var Sequelize=require(_0x56c0('0x0'));module[_0x56c0('0x1')]={'name':{'type':Sequelize[_0x56c0('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x56c0('0x3'),_0x56c0('0x4')),'defaultValue':_0x56c0('0x3')},'moduleSearch':{'type':Sequelize[_0x56c0('0x5')](_0x56c0('0x6'),_0x56c0('0x7'),'lead','account_contact_lead',_0x56c0('0x8')),'defaultValue':_0x56c0('0x6')},'moduleCreate':{'type':Sequelize[_0x56c0('0x5')](_0x56c0('0x9'),_0x56c0('0x7'),_0x56c0('0xa'),_0x56c0('0x8')),'defaultValue':_0x56c0('0xa')},'leadId':{'type':Sequelize[_0x56c0('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x56c0('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x56c0('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x56c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 64a6700..2ea40af 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 _0xfb45=['offset','undefined','limit','count','apply','save','update','then','error','stack','name','send','index','rawAttributes','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','SalesforceConfiguration','includeAll','include','rows','catch','create','body','find','params','destroy','getFields','findOne','SalesforceField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','ejs','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','../../config/environment','../../config/license/util','status','end','json'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xfb45,0x115));var _0x5fb4=function(_0x8f936,_0x53d070){_0x8f936=_0x8f936-0x0;var _0x1eea49=_0xfb45[_0x8f936];return _0x1eea49;};'use strict';var emlformat=require(_0x5fb4('0x0'));var rimraf=require(_0x5fb4('0x1'));var zipdir=require(_0x5fb4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5fb4('0x3'));var BPromise=require(_0x5fb4('0x4'));var Mustache=require(_0x5fb4('0x5'));var util=require(_0x5fb4('0x6'));var path=require('path');var sox=require(_0x5fb4('0x7'));var csv=require('to-csv');var ejs=require(_0x5fb4('0x8'));var fs=require('fs');var fs_extra=require(_0x5fb4('0x9'));var _=require(_0x5fb4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5fb4('0xb'));var deskjs=require(_0x5fb4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5fb4('0xd'));var Papa=require('papaparse');var Redis=require(_0x5fb4('0xe'));var authService=require(_0x5fb4('0xf'));var qs=require(_0x5fb4('0x10'));var as=require(_0x5fb4('0x11'));var hardwareService=require(_0x5fb4('0x12'));var logger=require(_0x5fb4('0x13'))(_0x5fb4('0x14'));var utils=require(_0x5fb4('0x15'));var config=require(_0x5fb4('0x16'));var licenseUtil=require(_0x5fb4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48e024,_0x1a5505){_0x1a5505=_0x1a5505||0xcc;return function(_0x58b757){if(_0x58b757){return _0x48e024['sendStatus'](_0x1a5505);}return _0x48e024[_0x5fb4('0x18')](_0x1a5505)[_0x5fb4('0x19')]();};}function respondWithResult(_0x490990,_0x262345){_0x262345=_0x262345||0xc8;return function(_0x46e089){if(_0x46e089){return _0x490990[_0x5fb4('0x18')](_0x262345)[_0x5fb4('0x1a')](_0x46e089);}};}function respondWithFilteredResult(_0x250560,_0x48d2ba){return function(_0x37c4b7){if(_0x37c4b7){var _0x460c5c=typeof _0x48d2ba[_0x5fb4('0x1b')]===_0x5fb4('0x1c')&&typeof _0x48d2ba[_0x5fb4('0x1d')]===_0x5fb4('0x1c');var _0x11864b=_0x37c4b7[_0x5fb4('0x1e')];var _0x50f4e5=_0x460c5c?0x0:_0x48d2ba[_0x5fb4('0x1b')];var _0x2658ce=_0x460c5c?_0x37c4b7[_0x5fb4('0x1e')]:_0x48d2ba['offset']+_0x48d2ba[_0x5fb4('0x1d')];var _0x33214c;if(_0x2658ce>=_0x11864b){_0x2658ce=_0x11864b;_0x33214c=0xc8;}else{_0x33214c=0xce;}_0x250560[_0x5fb4('0x18')](_0x33214c);return _0x250560['set']('Content-Range',_0x50f4e5+'-'+_0x2658ce+'/'+_0x11864b)[_0x5fb4('0x1a')](_0x37c4b7);}return null;};}function patchUpdates(_0x2c7ed2){return function(_0x35acd6){try{jsonpatch[_0x5fb4('0x1f')](_0x35acd6,_0x2c7ed2,!![]);}catch(_0x3e327e){return BPromise['reject'](_0x3e327e);}return _0x35acd6[_0x5fb4('0x20')]();};}function saveUpdates(_0x56e172,_0x5b74b0){return function(_0x491db4){if(_0x491db4){return _0x491db4[_0x5fb4('0x21')](_0x56e172)['then'](function(_0x49b5b4){return _0x49b5b4;});}return null;};}function removeEntity(_0x29e4d0,_0x4e016c){return function(_0x2a8eef){if(_0x2a8eef){return _0x2a8eef['destroy']()[_0x5fb4('0x22')](function(){_0x29e4d0[_0x5fb4('0x18')](0xcc)[_0x5fb4('0x19')]();});}};}function handleEntityNotFound(_0x270ab9,_0x100e91){return function(_0x42e4e1){if(!_0x42e4e1){_0x270ab9['sendStatus'](0x194);}return _0x42e4e1;};}function handleError(_0x331ea,_0x13f700){_0x13f700=_0x13f700||0x1f4;return function(_0x12504a){logger[_0x5fb4('0x23')](_0x12504a[_0x5fb4('0x24')]);if(_0x12504a[_0x5fb4('0x25')]){delete _0x12504a[_0x5fb4('0x25')];}_0x331ea[_0x5fb4('0x18')](_0x13f700)[_0x5fb4('0x26')](_0x12504a);};}exports[_0x5fb4('0x27')]=function(_0x46a86a,_0x29673c){var _0x3366cc={},_0x2b3eb4={},_0x15a50={'count':0x0,'rows':[]};var _0xe55291=_['map'](db['SalesforceConfiguration'][_0x5fb4('0x28')],function(_0x44a76c){return{'name':_0x44a76c['fieldName'],'type':_0x44a76c[_0x5fb4('0x29')]['key']};});_0x2b3eb4[_0x5fb4('0x2a')]=_[_0x5fb4('0x2b')](_0xe55291,_0x5fb4('0x25'));_0x2b3eb4[_0x5fb4('0x2c')]=_[_0x5fb4('0x2d')](_0x46a86a[_0x5fb4('0x2c')]);_0x2b3eb4[_0x5fb4('0x2e')]=_['intersection'](_0x2b3eb4[_0x5fb4('0x2a')],_0x2b3eb4[_0x5fb4('0x2c')]);_0x3366cc[_0x5fb4('0x2f')]=_[_0x5fb4('0x30')](_0x2b3eb4[_0x5fb4('0x2a')],qs['fields'](_0x46a86a[_0x5fb4('0x2c')][_0x5fb4('0x31')]));_0x3366cc['attributes']=_0x3366cc[_0x5fb4('0x2f')][_0x5fb4('0x32')]?_0x3366cc[_0x5fb4('0x2f')]:_0x2b3eb4[_0x5fb4('0x2a')];if(!_0x46a86a[_0x5fb4('0x2c')][_0x5fb4('0x33')](_0x5fb4('0x34'))){_0x3366cc[_0x5fb4('0x1d')]=qs[_0x5fb4('0x1d')](_0x46a86a['query']['limit']);_0x3366cc[_0x5fb4('0x1b')]=qs['offset'](_0x46a86a[_0x5fb4('0x2c')][_0x5fb4('0x1b')]);}_0x3366cc[_0x5fb4('0x35')]=qs[_0x5fb4('0x36')](_0x46a86a[_0x5fb4('0x2c')]['sort']);_0x3366cc['where']=qs['filters'](_['pick'](_0x46a86a['query'],_0x2b3eb4[_0x5fb4('0x2e')]),_0xe55291);if(_0x46a86a[_0x5fb4('0x2c')][_0x5fb4('0x37')]){_0x3366cc['where']=_['merge'](_0x3366cc[_0x5fb4('0x38')],{'$or':_['map'](_0xe55291,function(_0x23a53c){if(_0x23a53c[_0x5fb4('0x29')]!==_0x5fb4('0x39')){var _0x5a9569={};_0x5a9569[_0x23a53c[_0x5fb4('0x25')]]={'$like':'%'+_0x46a86a[_0x5fb4('0x2c')]['filter']+'%'};return _0x5a9569;}})});}_0x3366cc=_[_0x5fb4('0x3a')]({},_0x3366cc,_0x46a86a[_0x5fb4('0x3b')]);var _0x5ca43f={'where':_0x3366cc[_0x5fb4('0x38')]};return db[_0x5fb4('0x3c')][_0x5fb4('0x1e')](_0x5ca43f)[_0x5fb4('0x22')](function(_0xf71bf){_0x15a50[_0x5fb4('0x1e')]=_0xf71bf;if(_0x46a86a['query'][_0x5fb4('0x3d')]){_0x3366cc[_0x5fb4('0x3e')]=[{'all':!![]}];}return db[_0x5fb4('0x3c')]['findAll'](_0x3366cc);})[_0x5fb4('0x22')](function(_0x53183d){_0x15a50[_0x5fb4('0x3f')]=_0x53183d;return _0x15a50;})['then'](respondWithFilteredResult(_0x29673c,_0x3366cc))[_0x5fb4('0x40')](handleError(_0x29673c,null));};exports['show']=function(_0x18b1f9,_0x4447de){var _0x54fd0b={'raw':![],'where':{'id':_0x18b1f9['params']['id']}},_0x3d1103={};_0x3d1103['model']=_[_0x5fb4('0x2d')](db[_0x5fb4('0x3c')][_0x5fb4('0x28')]);_0x3d1103[_0x5fb4('0x2c')]=_[_0x5fb4('0x2d')](_0x18b1f9[_0x5fb4('0x2c')]);_0x3d1103[_0x5fb4('0x2e')]=_[_0x5fb4('0x30')](_0x3d1103[_0x5fb4('0x2a')],_0x3d1103[_0x5fb4('0x2c')]);_0x54fd0b[_0x5fb4('0x2f')]=_[_0x5fb4('0x30')](_0x3d1103[_0x5fb4('0x2a')],qs[_0x5fb4('0x31')](_0x18b1f9[_0x5fb4('0x2c')][_0x5fb4('0x31')]));_0x54fd0b['attributes']=_0x54fd0b[_0x5fb4('0x2f')][_0x5fb4('0x32')]?_0x54fd0b[_0x5fb4('0x2f')]:_0x3d1103['model'];if(_0x18b1f9[_0x5fb4('0x2c')][_0x5fb4('0x3d')]){_0x54fd0b[_0x5fb4('0x3e')]=[{'all':!![]}];}_0x54fd0b=_[_0x5fb4('0x3a')]({},_0x54fd0b,_0x18b1f9[_0x5fb4('0x3b')]);return db[_0x5fb4('0x3c')]['find'](_0x54fd0b)[_0x5fb4('0x22')](handleEntityNotFound(_0x4447de,null))['then'](respondWithResult(_0x4447de,null))[_0x5fb4('0x40')](handleError(_0x4447de,null));};exports[_0x5fb4('0x41')]=function(_0x3e4854,_0x2ced74){return db[_0x5fb4('0x3c')][_0x5fb4('0x41')](_0x3e4854['body'],{})['then'](respondWithResult(_0x2ced74,0xc9))[_0x5fb4('0x40')](handleError(_0x2ced74,null));};exports[_0x5fb4('0x21')]=function(_0x4fd9bd,_0x29aa31){if(_0x4fd9bd[_0x5fb4('0x42')]['id']){delete _0x4fd9bd[_0x5fb4('0x42')]['id'];}return db[_0x5fb4('0x3c')][_0x5fb4('0x43')]({'where':{'id':_0x4fd9bd[_0x5fb4('0x44')]['id']}})[_0x5fb4('0x22')](handleEntityNotFound(_0x29aa31,null))[_0x5fb4('0x22')](saveUpdates(_0x4fd9bd[_0x5fb4('0x42')],null))[_0x5fb4('0x22')](respondWithResult(_0x29aa31,null))[_0x5fb4('0x40')](handleError(_0x29aa31,null));};exports[_0x5fb4('0x45')]=function(_0x60e487,_0x365496){return db[_0x5fb4('0x3c')][_0x5fb4('0x43')]({'where':{'id':_0x60e487[_0x5fb4('0x44')]['id']}})['then'](handleEntityNotFound(_0x365496,null))['then'](removeEntity(_0x365496,null))['catch'](handleError(_0x365496,null));};exports[_0x5fb4('0x46')]=function(_0x52e16f,_0x2c16fa,_0x404948){var _0x119665={};var _0x2b001c={};var _0xd5176e;var _0x45c336;return db[_0x5fb4('0x3c')][_0x5fb4('0x47')]({'where':{'id':_0x52e16f[_0x5fb4('0x44')]['id']}})[_0x5fb4('0x22')](handleEntityNotFound(_0x2c16fa,null))['then'](function(_0x1b4bf0){if(_0x1b4bf0){_0xd5176e=_0x1b4bf0;_0x2b001c[_0x5fb4('0x2a')]=_['keys'](db[_0x5fb4('0x48')][_0x5fb4('0x28')]);_0x2b001c['query']=_['keys'](_0x52e16f[_0x5fb4('0x2c')]);_0x2b001c['filters']=_[_0x5fb4('0x30')](_0x2b001c[_0x5fb4('0x2a')],_0x2b001c[_0x5fb4('0x2c')]);_0x119665['attributes']=_[_0x5fb4('0x30')](_0x2b001c[_0x5fb4('0x2a')],qs[_0x5fb4('0x31')](_0x52e16f[_0x5fb4('0x2c')]['fields']));_0x119665[_0x5fb4('0x2f')]=_0x119665[_0x5fb4('0x2f')]['length']?_0x119665[_0x5fb4('0x2f')]:_0x2b001c[_0x5fb4('0x2a')];_0x119665[_0x5fb4('0x35')]=qs[_0x5fb4('0x36')](_0x52e16f['query'][_0x5fb4('0x36')]);_0x119665['where']=qs[_0x5fb4('0x2e')](_[_0x5fb4('0x49')](_0x52e16f[_0x5fb4('0x2c')],_0x2b001c[_0x5fb4('0x2e')]));if(_0x52e16f['query'][_0x5fb4('0x37')]){_0x119665[_0x5fb4('0x38')]=_['merge'](_0x119665[_0x5fb4('0x38')],{'$or':_['map'](_0x119665[_0x5fb4('0x2f')],function(_0x462803){var _0xb87b1e={};_0xb87b1e[_0x462803]={'$like':'%'+_0x52e16f[_0x5fb4('0x2c')]['filter']+'%'};return _0xb87b1e;})});}_0x119665=_[_0x5fb4('0x3a')]({},_0x119665,_0x52e16f[_0x5fb4('0x3b')]);return _0xd5176e[_0x5fb4('0x46')](_0x119665);}})[_0x5fb4('0x22')](function(_0x2f74a5){if(_0x2f74a5){_0x45c336=_0x2f74a5[_0x5fb4('0x32')];if(!_0x52e16f['query']['hasOwnProperty']('nolimit')){_0x119665[_0x5fb4('0x1d')]=qs[_0x5fb4('0x1d')](_0x52e16f[_0x5fb4('0x2c')]['limit']);_0x119665[_0x5fb4('0x1b')]=qs[_0x5fb4('0x1b')](_0x52e16f[_0x5fb4('0x2c')][_0x5fb4('0x1b')]);}return _0xd5176e[_0x5fb4('0x46')](_0x119665);}})[_0x5fb4('0x22')](function(_0x17c794){if(_0x17c794){return _0x17c794?{'count':_0x45c336,'rows':_0x17c794}:null;}})[_0x5fb4('0x22')](respondWithResult(_0x2c16fa,null))[_0x5fb4('0x40')](handleError(_0x2c16fa,null));};exports[_0x5fb4('0x4a')]=function(_0x19db70,_0xeb16b3,_0x851030){var _0x3ad5b9={};var _0x50ad6e={};var _0x6e8080;var _0x34fb01;return db['SalesforceConfiguration'][_0x5fb4('0x47')]({'where':{'id':_0x19db70[_0x5fb4('0x44')]['id']}})[_0x5fb4('0x22')](handleEntityNotFound(_0xeb16b3,null))['then'](function(_0xff527a){if(_0xff527a){_0x6e8080=_0xff527a;_0x50ad6e[_0x5fb4('0x2a')]=_[_0x5fb4('0x2d')](db[_0x5fb4('0x48')][_0x5fb4('0x28')]);_0x50ad6e[_0x5fb4('0x2c')]=_[_0x5fb4('0x2d')](_0x19db70[_0x5fb4('0x2c')]);_0x50ad6e[_0x5fb4('0x2e')]=_[_0x5fb4('0x30')](_0x50ad6e[_0x5fb4('0x2a')],_0x50ad6e[_0x5fb4('0x2c')]);_0x3ad5b9[_0x5fb4('0x2f')]=_['intersection'](_0x50ad6e[_0x5fb4('0x2a')],qs['fields'](_0x19db70['query'][_0x5fb4('0x31')]));_0x3ad5b9[_0x5fb4('0x2f')]=_0x3ad5b9[_0x5fb4('0x2f')][_0x5fb4('0x32')]?_0x3ad5b9['attributes']:_0x50ad6e[_0x5fb4('0x2a')];_0x3ad5b9[_0x5fb4('0x35')]=qs[_0x5fb4('0x36')](_0x19db70['query']['sort']);_0x3ad5b9['where']=qs['filters'](_[_0x5fb4('0x49')](_0x19db70[_0x5fb4('0x2c')],_0x50ad6e[_0x5fb4('0x2e')]));if(_0x19db70[_0x5fb4('0x2c')][_0x5fb4('0x37')]){_0x3ad5b9[_0x5fb4('0x38')]=_[_0x5fb4('0x3a')](_0x3ad5b9[_0x5fb4('0x38')],{'$or':_[_0x5fb4('0x2b')](_0x3ad5b9[_0x5fb4('0x2f')],function(_0x4156ce){var _0x385041={};_0x385041[_0x4156ce]={'$like':'%'+_0x19db70[_0x5fb4('0x2c')][_0x5fb4('0x37')]+'%'};return _0x385041;})});}_0x3ad5b9=_['merge']({},_0x3ad5b9,_0x19db70[_0x5fb4('0x3b')]);return _0x6e8080[_0x5fb4('0x4a')](_0x3ad5b9);}})[_0x5fb4('0x22')](function(_0x11c76c){if(_0x11c76c){_0x34fb01=_0x11c76c[_0x5fb4('0x32')];if(!_0x19db70[_0x5fb4('0x2c')][_0x5fb4('0x33')](_0x5fb4('0x34'))){_0x3ad5b9[_0x5fb4('0x1d')]=qs['limit'](_0x19db70['query'][_0x5fb4('0x1d')]);_0x3ad5b9[_0x5fb4('0x1b')]=qs[_0x5fb4('0x1b')](_0x19db70['query']['offset']);}return _0x6e8080[_0x5fb4('0x4a')](_0x3ad5b9);}})['then'](function(_0x2cc50a){if(_0x2cc50a){return _0x2cc50a?{'count':_0x34fb01,'rows':_0x2cc50a}:null;}})[_0x5fb4('0x22')](respondWithResult(_0xeb16b3,null))[_0x5fb4('0x40')](handleError(_0xeb16b3,null));};exports[_0x5fb4('0x4b')]=function(_0x270357,_0x27f829,_0x40b89d){var _0x43f186={};var _0x5caed={};var _0x2fd1c1;var _0xd0b5c1;return db['SalesforceConfiguration'][_0x5fb4('0x47')]({'where':{'id':_0x270357['params']['id']}})[_0x5fb4('0x22')](handleEntityNotFound(_0x27f829,null))['then'](function(_0x57164d){if(_0x57164d){_0x2fd1c1=_0x57164d;_0x5caed[_0x5fb4('0x2a')]=_[_0x5fb4('0x2d')](db['SalesforceField']['rawAttributes']);_0x5caed[_0x5fb4('0x2c')]=_[_0x5fb4('0x2d')](_0x270357[_0x5fb4('0x2c')]);_0x5caed[_0x5fb4('0x2e')]=_[_0x5fb4('0x30')](_0x5caed[_0x5fb4('0x2a')],_0x5caed[_0x5fb4('0x2c')]);_0x43f186[_0x5fb4('0x2f')]=_[_0x5fb4('0x30')](_0x5caed['model'],qs[_0x5fb4('0x31')](_0x270357[_0x5fb4('0x2c')]['fields']));_0x43f186[_0x5fb4('0x2f')]=_0x43f186[_0x5fb4('0x2f')][_0x5fb4('0x32')]?_0x43f186[_0x5fb4('0x2f')]:_0x5caed[_0x5fb4('0x2a')];_0x43f186['order']=qs['sort'](_0x270357[_0x5fb4('0x2c')]['sort']);_0x43f186[_0x5fb4('0x38')]=qs[_0x5fb4('0x2e')](_[_0x5fb4('0x49')](_0x270357[_0x5fb4('0x2c')],_0x5caed[_0x5fb4('0x2e')]));if(_0x270357[_0x5fb4('0x2c')]['filter']){_0x43f186['where']=_[_0x5fb4('0x3a')](_0x43f186['where'],{'$or':_[_0x5fb4('0x2b')](_0x43f186['attributes'],function(_0x2a6545){var _0x541009={};_0x541009[_0x2a6545]={'$like':'%'+_0x270357[_0x5fb4('0x2c')]['filter']+'%'};return _0x541009;})});}_0x43f186=_['merge']({},_0x43f186,_0x270357[_0x5fb4('0x3b')]);return _0x2fd1c1[_0x5fb4('0x4b')](_0x43f186);}})['then'](function(_0x38013f){if(_0x38013f){_0xd0b5c1=_0x38013f[_0x5fb4('0x32')];if(!_0x270357['query'][_0x5fb4('0x33')](_0x5fb4('0x34'))){_0x43f186[_0x5fb4('0x1d')]=qs[_0x5fb4('0x1d')](_0x270357[_0x5fb4('0x2c')][_0x5fb4('0x1d')]);_0x43f186[_0x5fb4('0x1b')]=qs[_0x5fb4('0x1b')](_0x270357[_0x5fb4('0x2c')]['offset']);}return _0x2fd1c1['getDescriptions'](_0x43f186);}})['then'](function(_0x14154d){if(_0x14154d){return _0x14154d?{'count':_0xd0b5c1,'rows':_0x14154d}:null;}})[_0x5fb4('0x22')](respondWithResult(_0x27f829,null))[_0x5fb4('0x40')](handleError(_0x27f829,null));}; \ No newline at end of file +var _0x67fa=['name','send','index','SalesforceConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','catch','find','create','body','params','getFields','findOne','SalesforceField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','apply','save','update','destroy','then','end','sendStatus','error','stack'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0x67fa,0xc7));var _0xa67f=function(_0x1739ec,_0x1659ef){_0x1739ec=_0x1739ec-0x0;var _0x20d0c3=_0x67fa[_0x1739ec];return _0x20d0c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa67f('0x0'));var zipdir=require(_0xa67f('0x1'));var jsonpatch=require(_0xa67f('0x2'));var rp=require('request-promise');var moment=require(_0xa67f('0x3'));var BPromise=require(_0xa67f('0x4'));var Mustache=require(_0xa67f('0x5'));var util=require(_0xa67f('0x6'));var path=require(_0xa67f('0x7'));var sox=require(_0xa67f('0x8'));var csv=require(_0xa67f('0x9'));var ejs=require(_0xa67f('0xa'));var fs=require('fs');var fs_extra=require(_0xa67f('0xb'));var _=require(_0xa67f('0xc'));var squel=require(_0xa67f('0xd'));var crypto=require(_0xa67f('0xe'));var jsforce=require(_0xa67f('0xf'));var deskjs=require(_0xa67f('0x10'));var toCsv=require(_0xa67f('0x9'));var querystring=require('querystring');var Papa=require(_0xa67f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa67f('0x12'));var as=require(_0xa67f('0x13'));var hardwareService=require(_0xa67f('0x14'));var logger=require(_0xa67f('0x15'))(_0xa67f('0x16'));var utils=require('../../config/utils');var config=require(_0xa67f('0x17'));var licenseUtil=require(_0xa67f('0x18'));var db=require(_0xa67f('0x19'))['db'];function respondWithStatusCode(_0x391a00,_0x2f6cbc){_0x2f6cbc=_0x2f6cbc||0xcc;return function(_0x355930){if(_0x355930){return _0x391a00['sendStatus'](_0x2f6cbc);}return _0x391a00[_0xa67f('0x1a')](_0x2f6cbc)['end']();};}function respondWithResult(_0x412bb4,_0x654c4b){_0x654c4b=_0x654c4b||0xc8;return function(_0x3f72fa){if(_0x3f72fa){return _0x412bb4[_0xa67f('0x1a')](_0x654c4b)['json'](_0x3f72fa);}};}function respondWithFilteredResult(_0x3f4d1d,_0x27edca){return function(_0x16c473){if(_0x16c473){var _0xe70599=typeof _0x27edca[_0xa67f('0x1b')]==='undefined'&&typeof _0x27edca[_0xa67f('0x1c')]===_0xa67f('0x1d');var _0x254e5f=_0x16c473[_0xa67f('0x1e')];var _0x32f7d9=_0xe70599?0x0:_0x27edca[_0xa67f('0x1b')];var _0x3b1646=_0xe70599?_0x16c473['count']:_0x27edca[_0xa67f('0x1b')]+_0x27edca[_0xa67f('0x1c')];var _0x49ee15;if(_0x3b1646>=_0x254e5f){_0x3b1646=_0x254e5f;_0x49ee15=0xc8;}else{_0x49ee15=0xce;}_0x3f4d1d['status'](_0x49ee15);return _0x3f4d1d[_0xa67f('0x1f')]('Content-Range',_0x32f7d9+'-'+_0x3b1646+'/'+_0x254e5f)['json'](_0x16c473);}return null;};}function patchUpdates(_0x277433){return function(_0x3af9ff){try{jsonpatch[_0xa67f('0x20')](_0x3af9ff,_0x277433,!![]);}catch(_0x42c007){return BPromise['reject'](_0x42c007);}return _0x3af9ff[_0xa67f('0x21')]();};}function saveUpdates(_0x31ced2,_0x476729){return function(_0x5aa5f2){if(_0x5aa5f2){return _0x5aa5f2[_0xa67f('0x22')](_0x31ced2)['then'](function(_0x2c155d){return _0x2c155d;});}return null;};}function removeEntity(_0x54e3f2,_0xa378c0){return function(_0x1ea16f){if(_0x1ea16f){return _0x1ea16f[_0xa67f('0x23')]()[_0xa67f('0x24')](function(){_0x54e3f2['status'](0xcc)[_0xa67f('0x25')]();});}};}function handleEntityNotFound(_0x366da5,_0x29e036){return function(_0x380705){if(!_0x380705){_0x366da5[_0xa67f('0x26')](0x194);}return _0x380705;};}function handleError(_0x12e9ee,_0x192ccd){_0x192ccd=_0x192ccd||0x1f4;return function(_0x2638a9){logger[_0xa67f('0x27')](_0x2638a9[_0xa67f('0x28')]);if(_0x2638a9[_0xa67f('0x29')]){delete _0x2638a9[_0xa67f('0x29')];}_0x12e9ee[_0xa67f('0x1a')](_0x192ccd)[_0xa67f('0x2a')](_0x2638a9);};}exports[_0xa67f('0x2b')]=function(_0x26f3e0,_0x49261d){var _0x5c43a3={},_0x2967d0={},_0x5e2499={'count':0x0,'rows':[]};var _0x540bd2=_['map'](db[_0xa67f('0x2c')][_0xa67f('0x2d')],function(_0x44fb63){return{'name':_0x44fb63['fieldName'],'type':_0x44fb63[_0xa67f('0x2e')][_0xa67f('0x2f')]};});_0x2967d0[_0xa67f('0x30')]=_['map'](_0x540bd2,_0xa67f('0x29'));_0x2967d0[_0xa67f('0x31')]=_[_0xa67f('0x32')](_0x26f3e0[_0xa67f('0x31')]);_0x2967d0['filters']=_[_0xa67f('0x33')](_0x2967d0[_0xa67f('0x30')],_0x2967d0[_0xa67f('0x31')]);_0x5c43a3[_0xa67f('0x34')]=_[_0xa67f('0x33')](_0x2967d0[_0xa67f('0x30')],qs[_0xa67f('0x35')](_0x26f3e0[_0xa67f('0x31')][_0xa67f('0x35')]));_0x5c43a3[_0xa67f('0x34')]=_0x5c43a3[_0xa67f('0x34')][_0xa67f('0x36')]?_0x5c43a3[_0xa67f('0x34')]:_0x2967d0[_0xa67f('0x30')];if(!_0x26f3e0['query'][_0xa67f('0x37')](_0xa67f('0x38'))){_0x5c43a3[_0xa67f('0x1c')]=qs[_0xa67f('0x1c')](_0x26f3e0[_0xa67f('0x31')][_0xa67f('0x1c')]);_0x5c43a3['offset']=qs[_0xa67f('0x1b')](_0x26f3e0[_0xa67f('0x31')][_0xa67f('0x1b')]);}_0x5c43a3[_0xa67f('0x39')]=qs[_0xa67f('0x3a')](_0x26f3e0[_0xa67f('0x31')][_0xa67f('0x3a')]);_0x5c43a3[_0xa67f('0x3b')]=qs[_0xa67f('0x3c')](_[_0xa67f('0x3d')](_0x26f3e0[_0xa67f('0x31')],_0x2967d0[_0xa67f('0x3c')]),_0x540bd2);if(_0x26f3e0['query'][_0xa67f('0x3e')]){_0x5c43a3[_0xa67f('0x3b')]=_['merge'](_0x5c43a3[_0xa67f('0x3b')],{'$or':_[_0xa67f('0x3f')](_0x540bd2,function(_0x4397cb){if(_0x4397cb[_0xa67f('0x2e')]!==_0xa67f('0x40')){var _0xf236c={};_0xf236c[_0x4397cb[_0xa67f('0x29')]]={'$like':'%'+_0x26f3e0['query']['filter']+'%'};return _0xf236c;}})});}_0x5c43a3=_[_0xa67f('0x41')]({},_0x5c43a3,_0x26f3e0[_0xa67f('0x42')]);var _0x3dac05={'where':_0x5c43a3[_0xa67f('0x3b')]};return db[_0xa67f('0x2c')][_0xa67f('0x1e')](_0x3dac05)[_0xa67f('0x24')](function(_0x556bc7){_0x5e2499[_0xa67f('0x1e')]=_0x556bc7;if(_0x26f3e0[_0xa67f('0x31')][_0xa67f('0x43')]){_0x5c43a3[_0xa67f('0x44')]=[{'all':!![]}];}return db[_0xa67f('0x2c')][_0xa67f('0x45')](_0x5c43a3);})['then'](function(_0x56090d){_0x5e2499['rows']=_0x56090d;return _0x5e2499;})[_0xa67f('0x24')](respondWithFilteredResult(_0x49261d,_0x5c43a3))[_0xa67f('0x46')](handleError(_0x49261d,null));};exports['show']=function(_0x17dde1,_0x2cddef){var _0x2f5942={'raw':![],'where':{'id':_0x17dde1['params']['id']}},_0x1653dd={};_0x1653dd[_0xa67f('0x30')]=_[_0xa67f('0x32')](db[_0xa67f('0x2c')]['rawAttributes']);_0x1653dd[_0xa67f('0x31')]=_[_0xa67f('0x32')](_0x17dde1[_0xa67f('0x31')]);_0x1653dd[_0xa67f('0x3c')]=_[_0xa67f('0x33')](_0x1653dd['model'],_0x1653dd[_0xa67f('0x31')]);_0x2f5942[_0xa67f('0x34')]=_[_0xa67f('0x33')](_0x1653dd[_0xa67f('0x30')],qs[_0xa67f('0x35')](_0x17dde1['query']['fields']));_0x2f5942[_0xa67f('0x34')]=_0x2f5942['attributes'][_0xa67f('0x36')]?_0x2f5942[_0xa67f('0x34')]:_0x1653dd['model'];if(_0x17dde1['query'][_0xa67f('0x43')]){_0x2f5942['include']=[{'all':!![]}];}_0x2f5942=_[_0xa67f('0x41')]({},_0x2f5942,_0x17dde1['options']);return db[_0xa67f('0x2c')][_0xa67f('0x47')](_0x2f5942)[_0xa67f('0x24')](handleEntityNotFound(_0x2cddef,null))['then'](respondWithResult(_0x2cddef,null))['catch'](handleError(_0x2cddef,null));};exports[_0xa67f('0x48')]=function(_0xbf8d28,_0x4cd8f3){return db[_0xa67f('0x2c')][_0xa67f('0x48')](_0xbf8d28[_0xa67f('0x49')],{})['then'](respondWithResult(_0x4cd8f3,0xc9))[_0xa67f('0x46')](handleError(_0x4cd8f3,null));};exports[_0xa67f('0x22')]=function(_0x4a88ed,_0x5c867b){if(_0x4a88ed['body']['id']){delete _0x4a88ed[_0xa67f('0x49')]['id'];}return db[_0xa67f('0x2c')]['find']({'where':{'id':_0x4a88ed[_0xa67f('0x4a')]['id']}})[_0xa67f('0x24')](handleEntityNotFound(_0x5c867b,null))[_0xa67f('0x24')](saveUpdates(_0x4a88ed[_0xa67f('0x49')],null))[_0xa67f('0x24')](respondWithResult(_0x5c867b,null))[_0xa67f('0x46')](handleError(_0x5c867b,null));};exports[_0xa67f('0x23')]=function(_0x423e70,_0x2745ba){return db[_0xa67f('0x2c')]['find']({'where':{'id':_0x423e70[_0xa67f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2745ba,null))[_0xa67f('0x24')](removeEntity(_0x2745ba,null))[_0xa67f('0x46')](handleError(_0x2745ba,null));};exports[_0xa67f('0x4b')]=function(_0x362023,_0x36d171,_0x2dc51c){var _0x505c8d={};var _0x38b98d={};var _0x2129c6;var _0x57e33f;return db[_0xa67f('0x2c')][_0xa67f('0x4c')]({'where':{'id':_0x362023[_0xa67f('0x4a')]['id']}})[_0xa67f('0x24')](handleEntityNotFound(_0x36d171,null))[_0xa67f('0x24')](function(_0x5e76a8){if(_0x5e76a8){_0x2129c6=_0x5e76a8;_0x38b98d[_0xa67f('0x30')]=_[_0xa67f('0x32')](db[_0xa67f('0x4d')]['rawAttributes']);_0x38b98d[_0xa67f('0x31')]=_[_0xa67f('0x32')](_0x362023[_0xa67f('0x31')]);_0x38b98d[_0xa67f('0x3c')]=_[_0xa67f('0x33')](_0x38b98d[_0xa67f('0x30')],_0x38b98d[_0xa67f('0x31')]);_0x505c8d[_0xa67f('0x34')]=_['intersection'](_0x38b98d[_0xa67f('0x30')],qs[_0xa67f('0x35')](_0x362023[_0xa67f('0x31')][_0xa67f('0x35')]));_0x505c8d[_0xa67f('0x34')]=_0x505c8d['attributes'][_0xa67f('0x36')]?_0x505c8d[_0xa67f('0x34')]:_0x38b98d[_0xa67f('0x30')];_0x505c8d[_0xa67f('0x39')]=qs[_0xa67f('0x3a')](_0x362023['query'][_0xa67f('0x3a')]);_0x505c8d['where']=qs['filters'](_[_0xa67f('0x3d')](_0x362023[_0xa67f('0x31')],_0x38b98d['filters']));if(_0x362023[_0xa67f('0x31')]['filter']){_0x505c8d[_0xa67f('0x3b')]=_['merge'](_0x505c8d[_0xa67f('0x3b')],{'$or':_[_0xa67f('0x3f')](_0x505c8d[_0xa67f('0x34')],function(_0x1ccc24){var _0x49741a={};_0x49741a[_0x1ccc24]={'$like':'%'+_0x362023[_0xa67f('0x31')]['filter']+'%'};return _0x49741a;})});}_0x505c8d=_[_0xa67f('0x41')]({},_0x505c8d,_0x362023[_0xa67f('0x42')]);return _0x2129c6[_0xa67f('0x4b')](_0x505c8d);}})['then'](function(_0x3d4cad){if(_0x3d4cad){_0x57e33f=_0x3d4cad[_0xa67f('0x36')];if(!_0x362023[_0xa67f('0x31')][_0xa67f('0x37')](_0xa67f('0x38'))){_0x505c8d[_0xa67f('0x1c')]=qs[_0xa67f('0x1c')](_0x362023[_0xa67f('0x31')]['limit']);_0x505c8d[_0xa67f('0x1b')]=qs['offset'](_0x362023[_0xa67f('0x31')][_0xa67f('0x1b')]);}return _0x2129c6['getFields'](_0x505c8d);}})['then'](function(_0x38a739){if(_0x38a739){return _0x38a739?{'count':_0x57e33f,'rows':_0x38a739}:null;}})[_0xa67f('0x24')](respondWithResult(_0x36d171,null))[_0xa67f('0x46')](handleError(_0x36d171,null));};exports['getSubjects']=function(_0x54a428,_0x6bdd8a,_0x56b062){var _0x3d3726={};var _0x598d79={};var _0x13b707;var _0x3d36db;return db[_0xa67f('0x2c')][_0xa67f('0x4c')]({'where':{'id':_0x54a428['params']['id']}})[_0xa67f('0x24')](handleEntityNotFound(_0x6bdd8a,null))[_0xa67f('0x24')](function(_0x1b637d){if(_0x1b637d){_0x13b707=_0x1b637d;_0x598d79[_0xa67f('0x30')]=_[_0xa67f('0x32')](db['SalesforceField'][_0xa67f('0x2d')]);_0x598d79[_0xa67f('0x31')]=_[_0xa67f('0x32')](_0x54a428[_0xa67f('0x31')]);_0x598d79[_0xa67f('0x3c')]=_[_0xa67f('0x33')](_0x598d79[_0xa67f('0x30')],_0x598d79[_0xa67f('0x31')]);_0x3d3726[_0xa67f('0x34')]=_[_0xa67f('0x33')](_0x598d79[_0xa67f('0x30')],qs[_0xa67f('0x35')](_0x54a428[_0xa67f('0x31')][_0xa67f('0x35')]));_0x3d3726['attributes']=_0x3d3726[_0xa67f('0x34')][_0xa67f('0x36')]?_0x3d3726[_0xa67f('0x34')]:_0x598d79['model'];_0x3d3726['order']=qs[_0xa67f('0x3a')](_0x54a428[_0xa67f('0x31')][_0xa67f('0x3a')]);_0x3d3726[_0xa67f('0x3b')]=qs[_0xa67f('0x3c')](_['pick'](_0x54a428[_0xa67f('0x31')],_0x598d79[_0xa67f('0x3c')]));if(_0x54a428[_0xa67f('0x31')][_0xa67f('0x3e')]){_0x3d3726[_0xa67f('0x3b')]=_[_0xa67f('0x41')](_0x3d3726[_0xa67f('0x3b')],{'$or':_['map'](_0x3d3726[_0xa67f('0x34')],function(_0x52efa5){var _0x1e0c79={};_0x1e0c79[_0x52efa5]={'$like':'%'+_0x54a428[_0xa67f('0x31')][_0xa67f('0x3e')]+'%'};return _0x1e0c79;})});}_0x3d3726=_[_0xa67f('0x41')]({},_0x3d3726,_0x54a428[_0xa67f('0x42')]);return _0x13b707[_0xa67f('0x4e')](_0x3d3726);}})['then'](function(_0x462835){if(_0x462835){_0x3d36db=_0x462835[_0xa67f('0x36')];if(!_0x54a428[_0xa67f('0x31')][_0xa67f('0x37')]('nolimit')){_0x3d3726[_0xa67f('0x1c')]=qs[_0xa67f('0x1c')](_0x54a428[_0xa67f('0x31')]['limit']);_0x3d3726['offset']=qs[_0xa67f('0x1b')](_0x54a428[_0xa67f('0x31')][_0xa67f('0x1b')]);}return _0x13b707[_0xa67f('0x4e')](_0x3d3726);}})[_0xa67f('0x24')](function(_0xf2de9c){if(_0xf2de9c){return _0xf2de9c?{'count':_0x3d36db,'rows':_0xf2de9c}:null;}})['then'](respondWithResult(_0x6bdd8a,null))[_0xa67f('0x46')](handleError(_0x6bdd8a,null));};exports[_0xa67f('0x4f')]=function(_0x5b51c4,_0x37f98d,_0x5de96c){var _0x52577b={};var _0x6d64cf={};var _0xa2ae33;var _0x515e7f;return db[_0xa67f('0x2c')][_0xa67f('0x4c')]({'where':{'id':_0x5b51c4['params']['id']}})[_0xa67f('0x24')](handleEntityNotFound(_0x37f98d,null))[_0xa67f('0x24')](function(_0x296b8a){if(_0x296b8a){_0xa2ae33=_0x296b8a;_0x6d64cf[_0xa67f('0x30')]=_[_0xa67f('0x32')](db[_0xa67f('0x4d')][_0xa67f('0x2d')]);_0x6d64cf[_0xa67f('0x31')]=_[_0xa67f('0x32')](_0x5b51c4[_0xa67f('0x31')]);_0x6d64cf[_0xa67f('0x3c')]=_['intersection'](_0x6d64cf[_0xa67f('0x30')],_0x6d64cf[_0xa67f('0x31')]);_0x52577b[_0xa67f('0x34')]=_[_0xa67f('0x33')](_0x6d64cf[_0xa67f('0x30')],qs[_0xa67f('0x35')](_0x5b51c4[_0xa67f('0x31')][_0xa67f('0x35')]));_0x52577b['attributes']=_0x52577b[_0xa67f('0x34')][_0xa67f('0x36')]?_0x52577b['attributes']:_0x6d64cf[_0xa67f('0x30')];_0x52577b[_0xa67f('0x39')]=qs[_0xa67f('0x3a')](_0x5b51c4[_0xa67f('0x31')][_0xa67f('0x3a')]);_0x52577b[_0xa67f('0x3b')]=qs['filters'](_[_0xa67f('0x3d')](_0x5b51c4[_0xa67f('0x31')],_0x6d64cf[_0xa67f('0x3c')]));if(_0x5b51c4[_0xa67f('0x31')]['filter']){_0x52577b[_0xa67f('0x3b')]=_[_0xa67f('0x41')](_0x52577b[_0xa67f('0x3b')],{'$or':_['map'](_0x52577b[_0xa67f('0x34')],function(_0x5ce43b){var _0x576a92={};_0x576a92[_0x5ce43b]={'$like':'%'+_0x5b51c4[_0xa67f('0x31')][_0xa67f('0x3e')]+'%'};return _0x576a92;})});}_0x52577b=_['merge']({},_0x52577b,_0x5b51c4[_0xa67f('0x42')]);return _0xa2ae33[_0xa67f('0x4f')](_0x52577b);}})[_0xa67f('0x24')](function(_0x29eb09){if(_0x29eb09){_0x515e7f=_0x29eb09[_0xa67f('0x36')];if(!_0x5b51c4[_0xa67f('0x31')][_0xa67f('0x37')]('nolimit')){_0x52577b[_0xa67f('0x1c')]=qs['limit'](_0x5b51c4['query']['limit']);_0x52577b[_0xa67f('0x1b')]=qs[_0xa67f('0x1b')](_0x5b51c4[_0xa67f('0x31')][_0xa67f('0x1b')]);}return _0xa2ae33[_0xa67f('0x4f')](_0x52577b);}})['then'](function(_0x2c08d5){if(_0x2c08d5){return _0x2c08d5?{'count':_0x515e7f,'rows':_0x2c08d5}:null;}})[_0xa67f('0x24')](respondWithResult(_0x37f98d,null))[_0xa67f('0x46')](handleError(_0x37f98d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index de5d59c..cb22422 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 _0xd853=['./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4d1542,_0x4f28bd){var _0xb2bab6=function(_0x4aa532){while(--_0x4aa532){_0x4d1542['push'](_0x4d1542['shift']());}};_0xb2bab6(++_0x4f28bd);}(_0xd853,0x115));var _0x3d85=function(_0x435e3c,_0x4ffd0b){_0x435e3c=_0x435e3c-0x0;var _0x5250b9=_0xd853[_0x435e3c];return _0x5250b9;};'use strict';var _=require(_0x3d85('0x0'));var util=require(_0x3d85('0x1'));var logger=require(_0x3d85('0x2'))(_0x3d85('0x3'));var moment=require(_0x3d85('0x4'));var BPromise=require(_0x3d85('0x5'));var rp=require(_0x3d85('0x6'));var fs=require('fs');var path=require(_0x3d85('0x7'));var rimraf=require('rimraf');var config=require(_0x3d85('0x8'));var attributes=require(_0x3d85('0x9'));module[_0x3d85('0xa')]=function(_0x17709c,_0xff9766){return _0x17709c['define'](_0x3d85('0xb'),attributes,{'tableName':_0x3d85('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x908f=['../../config/logger','api','moment','request-promise','path','rimraf','exports','define','int_salesforce_configurations','util'];(function(_0x233273,_0x5898bf){var _0xaa8f56=function(_0x1efbcc){while(--_0x1efbcc){_0x233273['push'](_0x233273['shift']());}};_0xaa8f56(++_0x5898bf);}(_0x908f,0x13f));var _0xf908=function(_0x364508,_0x4cf79e){_0x364508=_0x364508-0x0;var _0x1ab68b=_0x908f[_0x364508];return _0x1ab68b;};'use strict';var _=require('lodash');var util=require(_0xf908('0x0'));var logger=require(_0xf908('0x1'))(_0xf908('0x2'));var moment=require(_0xf908('0x3'));var BPromise=require('bluebird');var rp=require(_0xf908('0x4'));var fs=require('fs');var path=require(_0xf908('0x5'));var rimraf=require(_0xf908('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0xf908('0x7')]=function(_0x5892be,_0x306dc7){return _0x5892be[_0xf908('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0xf908('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 0bd7259..f14abb8 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 _0xac2d=['rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../config/logger'];(function(_0x7c11c7,_0x543abb){var _0x58c911=function(_0x812a42){while(--_0x812a42){_0x7c11c7['push'](_0x7c11c7['shift']());}};_0x58c911(++_0x543abb);}(_0xac2d,0x18a));var _0xdac2=function(_0x45ff89,_0x367fdb){_0x45ff89=_0x45ff89-0x0;var _0x85cb2e=_0xac2d[_0x45ff89];return _0x85cb2e;};'use strict';var _=require('lodash');var util=require(_0xdac2('0x0'));var moment=require(_0xdac2('0x1'));var BPromise=require('bluebird');var rs=require(_0xdac2('0x2'));var fs=require('fs');var Redis=require(_0xdac2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdac2('0x4'))(_0xdac2('0x5'));var config=require(_0xdac2('0x6'));var jayson=require(_0xdac2('0x7'));var client=jayson['client'][_0xdac2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c7504,_0x2fef42,_0xc14e2f){return new BPromise(function(_0xf77b46,_0x538fcf){return client[_0xdac2('0x9')](_0x3c7504,_0xc14e2f)[_0xdac2('0xa')](function(_0x39cc80){logger[_0xdac2('0xb')](_0xdac2('0xc'),_0x2fef42,'request\x20sent');logger[_0xdac2('0xd')](_0xdac2('0xe'),_0x2fef42,_0xdac2('0xf'),JSON[_0xdac2('0x10')](_0x39cc80));if(_0x39cc80[_0xdac2('0x11')]){if(_0x39cc80['error'][_0xdac2('0x12')]===0x1f4){logger['error'](_0xdac2('0xc'),_0x2fef42,_0x39cc80[_0xdac2('0x11')][_0xdac2('0x13')]);return _0x538fcf(_0x39cc80['error']['message']);}logger[_0xdac2('0x11')](_0xdac2('0xc'),_0x2fef42,_0x39cc80['error'][_0xdac2('0x13')]);return _0xf77b46(_0x39cc80['error'][_0xdac2('0x13')]);}else{logger[_0xdac2('0xb')](_0xdac2('0xc'),_0x2fef42,_0xdac2('0xf'));_0xf77b46(_0x39cc80[_0xdac2('0x14')][_0xdac2('0x13')]);}})['catch'](function(_0x30ba68){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x2fef42,_0x30ba68);_0x538fcf(_0x30ba68);});});} \ No newline at end of file +var _0xc4e6=['util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xc4e6,0x110));var _0x6c4e=function(_0x1ca4c3,_0x554126){_0x1ca4c3=_0x1ca4c3-0x0;var _0x4426a6=_0xc4e6[_0x1ca4c3];return _0x4426a6;};'use strict';var _=require(_0x6c4e('0x0'));var util=require(_0x6c4e('0x1'));var moment=require('moment');var BPromise=require(_0x6c4e('0x2'));var rs=require(_0x6c4e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6c4e('0x4'));var logger=require(_0x6c4e('0x5'))(_0x6c4e('0x6'));var config=require('../../config/environment');var jayson=require(_0x6c4e('0x7'));var client=jayson[_0x6c4e('0x8')][_0x6c4e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f6570,_0x1e1e2b,_0x1ab7f4){return new BPromise(function(_0x577244,_0x12f2a4){return client[_0x6c4e('0xa')](_0x4f6570,_0x1ab7f4)[_0x6c4e('0xb')](function(_0x11ab00){logger[_0x6c4e('0xc')](_0x6c4e('0xd'),_0x1e1e2b,'request\x20sent');logger[_0x6c4e('0xe')](_0x6c4e('0xf'),_0x1e1e2b,'request\x20sent',JSON[_0x6c4e('0x10')](_0x11ab00));if(_0x11ab00['error']){if(_0x11ab00[_0x6c4e('0x11')]['code']===0x1f4){logger['error'](_0x6c4e('0xd'),_0x1e1e2b,_0x11ab00['error']['message']);return _0x12f2a4(_0x11ab00[_0x6c4e('0x11')][_0x6c4e('0x12')]);}logger[_0x6c4e('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1e1e2b,_0x11ab00[_0x6c4e('0x11')]['message']);return _0x577244(_0x11ab00[_0x6c4e('0x11')]['message']);}else{logger['info'](_0x6c4e('0xd'),_0x1e1e2b,_0x6c4e('0x13'));_0x577244(_0x11ab00[_0x6c4e('0x14')][_0x6c4e('0x12')]);}})['catch'](function(_0x2a4bfd){logger[_0x6c4e('0x11')](_0x6c4e('0xd'),_0x1e1e2b,_0x2a4bfd);_0x12f2a4(_0x2a4bfd);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 088d6c5..c4051cd 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 _0xb6a2=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xb6a2,0x7a));var _0x2b6a=function(_0x4899c3,_0x299b68){_0x4899c3=_0x4899c3-0x0;var _0x2c86d4=_0xb6a2[_0x4899c3];return _0x2c86d4;};'use strict';var multer=require('multer');var util=require(_0x2b6a('0x0'));var path=require(_0x2b6a('0x1'));var timeout=require(_0x2b6a('0x2'));var express=require(_0x2b6a('0x3'));var router=express[_0x2b6a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2b6a('0x5'));var interaction=require(_0x2b6a('0x6'));var config=require(_0x2b6a('0x7'));var controller=require(_0x2b6a('0x8'));router[_0x2b6a('0x9')]('/',auth[_0x2b6a('0xa')](),controller[_0x2b6a('0xb')]);router[_0x2b6a('0x9')](_0x2b6a('0xc'),auth[_0x2b6a('0xa')](),controller[_0x2b6a('0xd')]);router[_0x2b6a('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2b6a('0xf')]('/:id',auth[_0x2b6a('0xa')](),controller[_0x2b6a('0x10')]);router[_0x2b6a('0x11')](_0x2b6a('0xc'),auth[_0x2b6a('0xa')](),controller[_0x2b6a('0x12')]);module[_0x2b6a('0x13')]=router; \ No newline at end of file +var _0xe2cf=['isAuthenticated','show','post','create','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2cf,0xf8));var _0xfe2c=function(_0x47c28c,_0x52f17e){_0x47c28c=_0x47c28c-0x0;var _0x13c2ec=_0xe2cf[_0x47c28c];return _0x13c2ec;};'use strict';var multer=require('multer');var util=require(_0xfe2c('0x0'));var path=require('path');var timeout=require(_0xfe2c('0x1'));var express=require(_0xfe2c('0x2'));var router=express['Router']();var fs_extra=require(_0xfe2c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfe2c('0x4'));var config=require(_0xfe2c('0x5'));var controller=require(_0xfe2c('0x6'));router[_0xfe2c('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfe2c('0x7')]('/:id',auth[_0xfe2c('0x8')](),controller[_0xfe2c('0x9')]);router[_0xfe2c('0xa')]('/',auth[_0xfe2c('0x8')](),controller[_0xfe2c('0xb')]);router['put']('/:id',auth[_0xfe2c('0x8')](),controller[_0xfe2c('0xc')]);router[_0xfe2c('0xd')]('/:id',auth[_0xfe2c('0x8')](),controller[_0xfe2c('0xe')]);module[_0xfe2c('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 655c7a3..2acc7b5 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 _0xa465=['customVariable','keyValue','STRING','exports','ENUM','string','variable'];(function(_0x4e11ce,_0x44fcd2){var _0x4c4d6a=function(_0x23f589){while(--_0x23f589){_0x4e11ce['push'](_0x4e11ce['shift']());}};_0x4c4d6a(++_0x44fcd2);}(_0xa465,0x1b5));var _0x5a46=function(_0x70c97a,_0xd4d263){_0x70c97a=_0x70c97a-0x0;var _0x5cb362=_0xa465[_0x70c97a];return _0x5cb362;};'use strict';var Sequelize=require('sequelize');module[_0x5a46('0x0')]={'type':{'type':Sequelize[_0x5a46('0x1')](_0x5a46('0x2'),_0x5a46('0x3'),_0x5a46('0x4'),_0x5a46('0x5'),'picklist'),'defaultValue':_0x5a46('0x2')},'content':{'type':Sequelize[_0x5a46('0x6')]},'key':{'type':Sequelize[_0x5a46('0x6')]},'keyType':{'type':Sequelize[_0x5a46('0x1')](_0x5a46('0x2'),_0x5a46('0x3'),_0x5a46('0x4'))},'keyContent':{'type':Sequelize[_0x5a46('0x6')]},'idField':{'type':Sequelize[_0x5a46('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9f45=['ENUM','customVariable','keyValue','picklist','STRING','string','variable','sequelize'];(function(_0x593d70,_0x58380f){var _0x1a598c=function(_0x2369c4){while(--_0x2369c4){_0x593d70['push'](_0x593d70['shift']());}};_0x1a598c(++_0x58380f);}(_0x9f45,0xaf));var _0x59f4=function(_0x50ea89,_0x20cbd3){_0x50ea89=_0x50ea89-0x0;var _0x2758ea=_0x9f45[_0x50ea89];return _0x2758ea;};'use strict';var Sequelize=require(_0x59f4('0x0'));module['exports']={'type':{'type':Sequelize[_0x59f4('0x1')]('string','variable',_0x59f4('0x2'),_0x59f4('0x3'),_0x59f4('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x59f4('0x5')]},'key':{'type':Sequelize[_0x59f4('0x5')]},'keyType':{'type':Sequelize[_0x59f4('0x1')](_0x59f4('0x6'),_0x59f4('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x59f4('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 82a14e2..2e2d6cc 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 _0x14c6=['util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','zip-dir','moment'];(function(_0x34cf38,_0x2dd8f6){var _0x39d364=function(_0x3651c4){while(--_0x3651c4){_0x34cf38['push'](_0x34cf38['shift']());}};_0x39d364(++_0x2dd8f6);}(_0x14c6,0x8f));var _0x614c=function(_0x445f30,_0x3ad532){_0x445f30=_0x445f30-0x0;var _0x2374d2=_0x14c6[_0x445f30];return _0x2374d2;};'use strict';var emlformat=require(_0x614c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x614c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x614c('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x614c('0x3'));var path=require(_0x614c('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x614c('0x5'));var fs=require('fs');var fs_extra=require(_0x614c('0x6'));var _=require(_0x614c('0x7'));var squel=require(_0x614c('0x8'));var crypto=require(_0x614c('0x9'));var jsforce=require(_0x614c('0xa'));var deskjs=require(_0x614c('0xb'));var toCsv=require(_0x614c('0xc'));var querystring=require(_0x614c('0xd'));var Papa=require(_0x614c('0xe'));var Redis=require(_0x614c('0xf'));var authService=require(_0x614c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x614c('0x11'));var utils=require(_0x614c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x614c('0x13'));var db=require(_0x614c('0x14'))['db'];function respondWithStatusCode(_0x20a477,_0x790e9c){_0x790e9c=_0x790e9c||0xcc;return function(_0x4751d0){if(_0x4751d0){return _0x20a477[_0x614c('0x15')](_0x790e9c);}return _0x20a477[_0x614c('0x16')](_0x790e9c)[_0x614c('0x17')]();};}function respondWithResult(_0x5aef1f,_0x172873){_0x172873=_0x172873||0xc8;return function(_0x119a1f){if(_0x119a1f){return _0x5aef1f['status'](_0x172873)[_0x614c('0x18')](_0x119a1f);}};}function respondWithFilteredResult(_0x651c37,_0xd34b8d){return function(_0x2d7745){if(_0x2d7745){var _0xd1fb5c=typeof _0xd34b8d['offset']==='undefined'&&typeof _0xd34b8d[_0x614c('0x19')]==='undefined';var _0x5a46f4=_0x2d7745[_0x614c('0x1a')];var _0xa719e=_0xd1fb5c?0x0:_0xd34b8d[_0x614c('0x1b')];var _0x4c2a75=_0xd1fb5c?_0x2d7745['count']:_0xd34b8d[_0x614c('0x1b')]+_0xd34b8d['limit'];var _0x393422;if(_0x4c2a75>=_0x5a46f4){_0x4c2a75=_0x5a46f4;_0x393422=0xc8;}else{_0x393422=0xce;}_0x651c37[_0x614c('0x16')](_0x393422);return _0x651c37[_0x614c('0x1c')](_0x614c('0x1d'),_0xa719e+'-'+_0x4c2a75+'/'+_0x5a46f4)[_0x614c('0x18')](_0x2d7745);}return null;};}function patchUpdates(_0x36acb3){return function(_0x2dde21){try{jsonpatch[_0x614c('0x1e')](_0x2dde21,_0x36acb3,!![]);}catch(_0x4b4d92){return BPromise[_0x614c('0x1f')](_0x4b4d92);}return _0x2dde21[_0x614c('0x20')]();};}function saveUpdates(_0x4a05c1,_0x15c983){return function(_0x812a7b){if(_0x812a7b){return _0x812a7b[_0x614c('0x21')](_0x4a05c1)[_0x614c('0x22')](function(_0x35283d){return _0x35283d;});}return null;};}function removeEntity(_0x4377ee,_0x532264){return function(_0x398fbd){if(_0x398fbd){return _0x398fbd[_0x614c('0x23')]()['then'](function(){_0x4377ee['status'](0xcc)[_0x614c('0x17')]();});}};}function handleEntityNotFound(_0x56f545,_0x45803c){return function(_0x48eaea){if(!_0x48eaea){_0x56f545[_0x614c('0x15')](0x194);}return _0x48eaea;};}function handleError(_0x23c594,_0x4e7e79){_0x4e7e79=_0x4e7e79||0x1f4;return function(_0x259a71){logger[_0x614c('0x24')](_0x259a71[_0x614c('0x25')]);if(_0x259a71[_0x614c('0x26')]){delete _0x259a71[_0x614c('0x26')];}_0x23c594[_0x614c('0x16')](_0x4e7e79)[_0x614c('0x27')](_0x259a71);};}exports[_0x614c('0x28')]=function(_0x3dcdfd,_0x4db80d){var _0x41c704={},_0x5ce904={},_0x24b005={'count':0x0,'rows':[]};var _0x250045=_[_0x614c('0x29')](db[_0x614c('0x2a')][_0x614c('0x2b')],function(_0x1815d0){return{'name':_0x1815d0[_0x614c('0x2c')],'type':_0x1815d0[_0x614c('0x2d')][_0x614c('0x2e')]};});_0x5ce904[_0x614c('0x2f')]=_[_0x614c('0x29')](_0x250045,_0x614c('0x26'));_0x5ce904[_0x614c('0x30')]=_[_0x614c('0x31')](_0x3dcdfd[_0x614c('0x30')]);_0x5ce904[_0x614c('0x32')]=_[_0x614c('0x33')](_0x5ce904[_0x614c('0x2f')],_0x5ce904['query']);_0x41c704['attributes']=_[_0x614c('0x33')](_0x5ce904[_0x614c('0x2f')],qs[_0x614c('0x34')](_0x3dcdfd[_0x614c('0x30')][_0x614c('0x34')]));_0x41c704['attributes']=_0x41c704[_0x614c('0x35')]['length']?_0x41c704['attributes']:_0x5ce904[_0x614c('0x2f')];if(!_0x3dcdfd[_0x614c('0x30')][_0x614c('0x36')](_0x614c('0x37'))){_0x41c704[_0x614c('0x19')]=qs[_0x614c('0x19')](_0x3dcdfd[_0x614c('0x30')][_0x614c('0x19')]);_0x41c704[_0x614c('0x1b')]=qs[_0x614c('0x1b')](_0x3dcdfd[_0x614c('0x30')][_0x614c('0x1b')]);}_0x41c704[_0x614c('0x38')]=qs[_0x614c('0x39')](_0x3dcdfd[_0x614c('0x30')]['sort']);_0x41c704['where']=qs['filters'](_['pick'](_0x3dcdfd[_0x614c('0x30')],_0x5ce904[_0x614c('0x32')]),_0x250045);if(_0x3dcdfd[_0x614c('0x30')]['filter']){_0x41c704[_0x614c('0x3a')]=_[_0x614c('0x3b')](_0x41c704['where'],{'$or':_['map'](_0x250045,function(_0x5ddee6){if(_0x5ddee6['type']!=='VIRTUAL'){var _0x185038={};_0x185038[_0x5ddee6[_0x614c('0x26')]]={'$like':'%'+_0x3dcdfd['query'][_0x614c('0x3c')]+'%'};return _0x185038;}})});}_0x41c704=_[_0x614c('0x3b')]({},_0x41c704,_0x3dcdfd[_0x614c('0x3d')]);var _0xbc5415={'where':_0x41c704[_0x614c('0x3a')]};return db[_0x614c('0x2a')][_0x614c('0x1a')](_0xbc5415)['then'](function(_0x17147b){_0x24b005[_0x614c('0x1a')]=_0x17147b;if(_0x3dcdfd[_0x614c('0x30')][_0x614c('0x3e')]){_0x41c704[_0x614c('0x3f')]=[{'all':!![]}];}return db[_0x614c('0x2a')][_0x614c('0x40')](_0x41c704);})[_0x614c('0x22')](function(_0x44f614){_0x24b005[_0x614c('0x41')]=_0x44f614;return _0x24b005;})[_0x614c('0x22')](respondWithFilteredResult(_0x4db80d,_0x41c704))[_0x614c('0x42')](handleError(_0x4db80d,null));};exports[_0x614c('0x43')]=function(_0x2c6f1b,_0x4016cc){var _0x15a89d={'raw':!![],'where':{'id':_0x2c6f1b[_0x614c('0x44')]['id']}},_0x531c1e={};_0x531c1e[_0x614c('0x2f')]=_[_0x614c('0x31')](db[_0x614c('0x2a')]['rawAttributes']);_0x531c1e['query']=_[_0x614c('0x31')](_0x2c6f1b['query']);_0x531c1e[_0x614c('0x32')]=_[_0x614c('0x33')](_0x531c1e['model'],_0x531c1e[_0x614c('0x30')]);_0x15a89d[_0x614c('0x35')]=_[_0x614c('0x33')](_0x531c1e[_0x614c('0x2f')],qs[_0x614c('0x34')](_0x2c6f1b[_0x614c('0x30')][_0x614c('0x34')]));_0x15a89d[_0x614c('0x35')]=_0x15a89d[_0x614c('0x35')][_0x614c('0x45')]?_0x15a89d[_0x614c('0x35')]:_0x531c1e[_0x614c('0x2f')];if(_0x2c6f1b[_0x614c('0x30')][_0x614c('0x3e')]){_0x15a89d[_0x614c('0x3f')]=[{'all':!![]}];}_0x15a89d=_['merge']({},_0x15a89d,_0x2c6f1b[_0x614c('0x3d')]);return db[_0x614c('0x2a')][_0x614c('0x46')](_0x15a89d)[_0x614c('0x22')](handleEntityNotFound(_0x4016cc,null))[_0x614c('0x22')](respondWithResult(_0x4016cc,null))['catch'](handleError(_0x4016cc,null));};exports[_0x614c('0x47')]=function(_0x5322a6,_0x1b167d){return db[_0x614c('0x2a')]['create'](_0x5322a6[_0x614c('0x48')],{})[_0x614c('0x22')](respondWithResult(_0x1b167d,0xc9))[_0x614c('0x42')](handleError(_0x1b167d,null));};exports['update']=function(_0x22af40,_0xed4d46){if(_0x22af40['body']['id']){delete _0x22af40['body']['id'];}return db[_0x614c('0x2a')][_0x614c('0x46')]({'where':{'id':_0x22af40[_0x614c('0x44')]['id']}})[_0x614c('0x22')](handleEntityNotFound(_0xed4d46,null))[_0x614c('0x22')](saveUpdates(_0x22af40[_0x614c('0x48')],null))[_0x614c('0x22')](respondWithResult(_0xed4d46,null))[_0x614c('0x42')](handleError(_0xed4d46,null));};exports[_0x614c('0x23')]=function(_0x3e95da,_0x3942f2){return db[_0x614c('0x2a')][_0x614c('0x46')]({'where':{'id':_0x3e95da[_0x614c('0x44')]['id']}})[_0x614c('0x22')](handleEntityNotFound(_0x3942f2,null))['then'](removeEntity(_0x3942f2,null))['catch'](handleError(_0x3942f2,null));}; \ No newline at end of file +var _0x2291=['status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','SalesforceField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1fcbc2,_0x10a8a6){var _0x3039eb=function(_0x55f954){while(--_0x55f954){_0x1fcbc2['push'](_0x1fcbc2['shift']());}};_0x3039eb(++_0x10a8a6);}(_0x2291,0x1b3));var _0x1229=function(_0x520769,_0x37f7ce){_0x520769=_0x520769-0x0;var _0x527ac5=_0x2291[_0x520769];return _0x527ac5;};'use strict';var emlformat=require(_0x1229('0x0'));var rimraf=require(_0x1229('0x1'));var zipdir=require(_0x1229('0x2'));var jsonpatch=require(_0x1229('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1229('0x4'));var Mustache=require(_0x1229('0x5'));var util=require(_0x1229('0x6'));var path=require(_0x1229('0x7'));var sox=require(_0x1229('0x8'));var csv=require('to-csv');var ejs=require(_0x1229('0x9'));var fs=require('fs');var fs_extra=require(_0x1229('0xa'));var _=require(_0x1229('0xb'));var squel=require(_0x1229('0xc'));var crypto=require(_0x1229('0xd'));var jsforce=require(_0x1229('0xe'));var deskjs=require(_0x1229('0xf'));var toCsv=require(_0x1229('0x10'));var querystring=require(_0x1229('0x11'));var Papa=require(_0x1229('0x12'));var Redis=require('ioredis');var authService=require(_0x1229('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1229('0x14'));var hardwareService=require(_0x1229('0x15'));var logger=require(_0x1229('0x16'))('api');var utils=require(_0x1229('0x17'));var config=require(_0x1229('0x18'));var licenseUtil=require(_0x1229('0x19'));var db=require(_0x1229('0x1a'))['db'];function respondWithStatusCode(_0x11c857,_0x4a4dc4){_0x4a4dc4=_0x4a4dc4||0xcc;return function(_0x5a8932){if(_0x5a8932){return _0x11c857['sendStatus'](_0x4a4dc4);}return _0x11c857[_0x1229('0x1b')](_0x4a4dc4)['end']();};}function respondWithResult(_0x69609d,_0x5621de){_0x5621de=_0x5621de||0xc8;return function(_0x16c9b6){if(_0x16c9b6){return _0x69609d[_0x1229('0x1b')](_0x5621de)[_0x1229('0x1c')](_0x16c9b6);}};}function respondWithFilteredResult(_0x5043a2,_0x1ca612){return function(_0x3f2b9c){if(_0x3f2b9c){var _0x375598=typeof _0x1ca612[_0x1229('0x1d')]==='undefined'&&typeof _0x1ca612['limit']===_0x1229('0x1e');var _0x4db2ef=_0x3f2b9c[_0x1229('0x1f')];var _0x38f218=_0x375598?0x0:_0x1ca612[_0x1229('0x1d')];var _0x597325=_0x375598?_0x3f2b9c[_0x1229('0x1f')]:_0x1ca612[_0x1229('0x1d')]+_0x1ca612['limit'];var _0x16e16d;if(_0x597325>=_0x4db2ef){_0x597325=_0x4db2ef;_0x16e16d=0xc8;}else{_0x16e16d=0xce;}_0x5043a2[_0x1229('0x1b')](_0x16e16d);return _0x5043a2[_0x1229('0x20')](_0x1229('0x21'),_0x38f218+'-'+_0x597325+'/'+_0x4db2ef)['json'](_0x3f2b9c);}return null;};}function patchUpdates(_0x16dce3){return function(_0x190e17){try{jsonpatch['apply'](_0x190e17,_0x16dce3,!![]);}catch(_0x4a9477){return BPromise['reject'](_0x4a9477);}return _0x190e17[_0x1229('0x22')]();};}function saveUpdates(_0x112b50,_0x397981){return function(_0xef092b){if(_0xef092b){return _0xef092b[_0x1229('0x23')](_0x112b50)[_0x1229('0x24')](function(_0x131de0){return _0x131de0;});}return null;};}function removeEntity(_0x28e2cd,_0xccc81){return function(_0x29dbec){if(_0x29dbec){return _0x29dbec[_0x1229('0x25')]()['then'](function(){_0x28e2cd[_0x1229('0x1b')](0xcc)[_0x1229('0x26')]();});}};}function handleEntityNotFound(_0x2e2ebe,_0x57c10a){return function(_0x45f791){if(!_0x45f791){_0x2e2ebe[_0x1229('0x27')](0x194);}return _0x45f791;};}function handleError(_0x12d5c7,_0x2339e3){_0x2339e3=_0x2339e3||0x1f4;return function(_0x2f9ded){logger[_0x1229('0x28')](_0x2f9ded[_0x1229('0x29')]);if(_0x2f9ded[_0x1229('0x2a')]){delete _0x2f9ded[_0x1229('0x2a')];}_0x12d5c7[_0x1229('0x1b')](_0x2339e3)[_0x1229('0x2b')](_0x2f9ded);};}exports[_0x1229('0x2c')]=function(_0x491823,_0x22474f){var _0x271d90={},_0x2b9c1e={},_0x269cb2={'count':0x0,'rows':[]};var _0x5e6e9e=_['map'](db[_0x1229('0x2d')][_0x1229('0x2e')],function(_0x3c7e49){return{'name':_0x3c7e49[_0x1229('0x2f')],'type':_0x3c7e49[_0x1229('0x30')][_0x1229('0x31')]};});_0x2b9c1e[_0x1229('0x32')]=_[_0x1229('0x33')](_0x5e6e9e,_0x1229('0x2a'));_0x2b9c1e[_0x1229('0x34')]=_[_0x1229('0x35')](_0x491823[_0x1229('0x34')]);_0x2b9c1e[_0x1229('0x36')]=_[_0x1229('0x37')](_0x2b9c1e[_0x1229('0x32')],_0x2b9c1e[_0x1229('0x34')]);_0x271d90[_0x1229('0x38')]=_['intersection'](_0x2b9c1e['model'],qs[_0x1229('0x39')](_0x491823[_0x1229('0x34')][_0x1229('0x39')]));_0x271d90[_0x1229('0x38')]=_0x271d90[_0x1229('0x38')][_0x1229('0x3a')]?_0x271d90['attributes']:_0x2b9c1e[_0x1229('0x32')];if(!_0x491823[_0x1229('0x34')]['hasOwnProperty'](_0x1229('0x3b'))){_0x271d90['limit']=qs[_0x1229('0x3c')](_0x491823[_0x1229('0x34')][_0x1229('0x3c')]);_0x271d90['offset']=qs[_0x1229('0x1d')](_0x491823[_0x1229('0x34')][_0x1229('0x1d')]);}_0x271d90[_0x1229('0x3d')]=qs[_0x1229('0x3e')](_0x491823[_0x1229('0x34')][_0x1229('0x3e')]);_0x271d90['where']=qs['filters'](_[_0x1229('0x3f')](_0x491823[_0x1229('0x34')],_0x2b9c1e[_0x1229('0x36')]),_0x5e6e9e);if(_0x491823[_0x1229('0x34')][_0x1229('0x40')]){_0x271d90[_0x1229('0x41')]=_[_0x1229('0x42')](_0x271d90['where'],{'$or':_[_0x1229('0x33')](_0x5e6e9e,function(_0xbe0977){if(_0xbe0977[_0x1229('0x30')]!==_0x1229('0x43')){var _0x5cf868={};_0x5cf868[_0xbe0977['name']]={'$like':'%'+_0x491823[_0x1229('0x34')][_0x1229('0x40')]+'%'};return _0x5cf868;}})});}_0x271d90=_['merge']({},_0x271d90,_0x491823[_0x1229('0x44')]);var _0x409a51={'where':_0x271d90[_0x1229('0x41')]};return db['SalesforceField'][_0x1229('0x1f')](_0x409a51)[_0x1229('0x24')](function(_0x4fca05){_0x269cb2[_0x1229('0x1f')]=_0x4fca05;if(_0x491823[_0x1229('0x34')][_0x1229('0x45')]){_0x271d90[_0x1229('0x46')]=[{'all':!![]}];}return db[_0x1229('0x2d')]['findAll'](_0x271d90);})['then'](function(_0xeb2c7e){_0x269cb2[_0x1229('0x47')]=_0xeb2c7e;return _0x269cb2;})[_0x1229('0x24')](respondWithFilteredResult(_0x22474f,_0x271d90))[_0x1229('0x48')](handleError(_0x22474f,null));};exports['show']=function(_0x5b00b5,_0x593369){var _0x1810a9={'raw':!![],'where':{'id':_0x5b00b5[_0x1229('0x49')]['id']}},_0x1d15c1={};_0x1d15c1[_0x1229('0x32')]=_[_0x1229('0x35')](db['SalesforceField']['rawAttributes']);_0x1d15c1['query']=_[_0x1229('0x35')](_0x5b00b5[_0x1229('0x34')]);_0x1d15c1['filters']=_[_0x1229('0x37')](_0x1d15c1[_0x1229('0x32')],_0x1d15c1[_0x1229('0x34')]);_0x1810a9[_0x1229('0x38')]=_[_0x1229('0x37')](_0x1d15c1['model'],qs[_0x1229('0x39')](_0x5b00b5[_0x1229('0x34')][_0x1229('0x39')]));_0x1810a9[_0x1229('0x38')]=_0x1810a9['attributes']['length']?_0x1810a9[_0x1229('0x38')]:_0x1d15c1[_0x1229('0x32')];if(_0x5b00b5[_0x1229('0x34')][_0x1229('0x45')]){_0x1810a9[_0x1229('0x46')]=[{'all':!![]}];}_0x1810a9=_[_0x1229('0x42')]({},_0x1810a9,_0x5b00b5[_0x1229('0x44')]);return db[_0x1229('0x2d')][_0x1229('0x4a')](_0x1810a9)[_0x1229('0x24')](handleEntityNotFound(_0x593369,null))[_0x1229('0x24')](respondWithResult(_0x593369,null))['catch'](handleError(_0x593369,null));};exports[_0x1229('0x4b')]=function(_0x1d3615,_0x5766ff){return db[_0x1229('0x2d')][_0x1229('0x4b')](_0x1d3615[_0x1229('0x4c')],{})[_0x1229('0x24')](respondWithResult(_0x5766ff,0xc9))[_0x1229('0x48')](handleError(_0x5766ff,null));};exports[_0x1229('0x23')]=function(_0x2c5978,_0x294338){if(_0x2c5978['body']['id']){delete _0x2c5978[_0x1229('0x4c')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x2c5978[_0x1229('0x49')]['id']}})[_0x1229('0x24')](handleEntityNotFound(_0x294338,null))['then'](saveUpdates(_0x2c5978[_0x1229('0x4c')],null))[_0x1229('0x24')](respondWithResult(_0x294338,null))[_0x1229('0x48')](handleError(_0x294338,null));};exports[_0x1229('0x25')]=function(_0x4e034e,_0xe20205){return db[_0x1229('0x2d')][_0x1229('0x4a')]({'where':{'id':_0x4e034e[_0x1229('0x49')]['id']}})[_0x1229('0x24')](handleEntityNotFound(_0xe20205,null))['then'](removeEntity(_0xe20205,null))[_0x1229('0x48')](handleError(_0xe20205,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 3f1774b..77e7970 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 _0xb97e=['request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','../../config/logger','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb97e,0x99));var _0xeb97=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xb97e[_0x2bf141];return _0x48277b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeb97('0x0'))(_0xeb97('0x1'));var moment=require('moment');var BPromise=require(_0xeb97('0x2'));var rp=require(_0xeb97('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb97('0x4'));var config=require(_0xeb97('0x5'));var attributes=require(_0xeb97('0x6'));module['exports']=function(_0x294147,_0x2b3b6f){return _0x294147[_0xeb97('0x7')](_0xeb97('0x8'),attributes,{'tableName':_0xeb97('0x9'),'paranoid':![],'indexes':[{'name':_0xeb97('0xa'),'fields':[_0xeb97('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa251=['idField','FieldId','lodash','api','moment','bluebird','request-promise','rimraf','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index'];(function(_0x4e256e,_0x1437f6){var _0x189c0b=function(_0x440812){while(--_0x440812){_0x4e256e['push'](_0x4e256e['shift']());}};_0x189c0b(++_0x1437f6);}(_0xa251,0x120));var _0x1a25=function(_0x3d85be,_0x53c96c){_0x3d85be=_0x3d85be-0x0;var _0x41242c=_0xa251[_0x3d85be];return _0x41242c;};'use strict';var _=require(_0x1a25('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1a25('0x1'));var moment=require(_0x1a25('0x2'));var BPromise=require(_0x1a25('0x3'));var rp=require(_0x1a25('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a25('0x5'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x1a25('0x6')]=function(_0x17c949,_0x107a8b){return _0x17c949[_0x1a25('0x7')](_0x1a25('0x8'),attributes,{'tableName':_0x1a25('0x9'),'paranoid':![],'indexes':[{'name':_0x1a25('0xa'),'fields':[_0x1a25('0xb'),_0x1a25('0xc')],'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 ece11e2..5eeb5a0 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 _0x54ff=['debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SalesforceField,\x20%s,\x20%s'];(function(_0x27bd2c,_0x24bd98){var _0x3784ea=function(_0x4ca802){while(--_0x4ca802){_0x27bd2c['push'](_0x27bd2c['shift']());}};_0x3784ea(++_0x24bd98);}(_0x54ff,0x111));var _0xf54f=function(_0x5c9ae2,_0x1b4d6b){_0x5c9ae2=_0x5c9ae2-0x0;var _0x5d20e1=_0x54ff[_0x5c9ae2];return _0x5d20e1;};'use strict';var _=require(_0xf54f('0x0'));var util=require(_0xf54f('0x1'));var moment=require(_0xf54f('0x2'));var BPromise=require(_0xf54f('0x3'));var rs=require(_0xf54f('0x4'));var fs=require('fs');var Redis=require(_0xf54f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf54f('0x6'));var logger=require(_0xf54f('0x7'))(_0xf54f('0x8'));var config=require(_0xf54f('0x9'));var jayson=require(_0xf54f('0xa'));var client=jayson['client'][_0xf54f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e245b,_0x4b527f,_0x280391){return new BPromise(function(_0x23677d,_0x5a5d3f){return client[_0xf54f('0xc')](_0x4e245b,_0x280391)[_0xf54f('0xd')](function(_0x54d6e4){logger['info'](_0xf54f('0xe'),_0x4b527f,'request\x20sent');logger[_0xf54f('0xf')](_0xf54f('0x10'),_0x4b527f,_0xf54f('0x11'),JSON[_0xf54f('0x12')](_0x54d6e4));if(_0x54d6e4['error']){if(_0x54d6e4[_0xf54f('0x13')][_0xf54f('0x14')]===0x1f4){logger[_0xf54f('0x13')]('SalesforceField,\x20%s,\x20%s',_0x4b527f,_0x54d6e4['error'][_0xf54f('0x15')]);return _0x5a5d3f(_0x54d6e4[_0xf54f('0x13')]['message']);}logger[_0xf54f('0x13')](_0xf54f('0xe'),_0x4b527f,_0x54d6e4['error'][_0xf54f('0x15')]);return _0x23677d(_0x54d6e4['error']['message']);}else{logger[_0xf54f('0x16')](_0xf54f('0xe'),_0x4b527f,_0xf54f('0x11'));_0x23677d(_0x54d6e4['result'][_0xf54f('0x15')]);}})[_0xf54f('0x17')](function(_0x94b2c5){logger[_0xf54f('0x13')](_0xf54f('0xe'),_0x4b527f,_0x94b2c5);_0x5a5d3f(_0x94b2c5);});});} \ No newline at end of file +var _0x674e=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x28f548,_0x575f2d){var _0x31781b=function(_0x52554f){while(--_0x52554f){_0x28f548['push'](_0x28f548['shift']());}};_0x31781b(++_0x575f2d);}(_0x674e,0x160));var _0xe674=function(_0x36afec,_0x408f8e){_0x36afec=_0x36afec-0x0;var _0x36305f=_0x674e[_0x36afec];return _0x36305f;};'use strict';var _=require(_0xe674('0x0'));var util=require(_0xe674('0x1'));var moment=require(_0xe674('0x2'));var BPromise=require('bluebird');var rs=require(_0xe674('0x3'));var fs=require('fs');var Redis=require(_0xe674('0x4'));var db=require(_0xe674('0x5'))['db'];var utils=require(_0xe674('0x6'));var logger=require(_0xe674('0x7'))(_0xe674('0x8'));var config=require(_0xe674('0x9'));var jayson=require(_0xe674('0xa'));var client=jayson[_0xe674('0xb')][_0xe674('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f406e,_0xf35647,_0x5d9096){return new BPromise(function(_0x352a75,_0x44d929){return client['request'](_0x3f406e,_0x5d9096)[_0xe674('0xd')](function(_0x327837){logger[_0xe674('0xe')](_0xe674('0xf'),_0xf35647,_0xe674('0x10'));logger[_0xe674('0x11')](_0xe674('0x12'),_0xf35647,_0xe674('0x10'),JSON[_0xe674('0x13')](_0x327837));if(_0x327837[_0xe674('0x14')]){if(_0x327837[_0xe674('0x14')][_0xe674('0x15')]===0x1f4){logger[_0xe674('0x14')](_0xe674('0xf'),_0xf35647,_0x327837['error']['message']);return _0x44d929(_0x327837[_0xe674('0x14')][_0xe674('0x16')]);}logger['error'](_0xe674('0xf'),_0xf35647,_0x327837[_0xe674('0x14')][_0xe674('0x16')]);return _0x352a75(_0x327837[_0xe674('0x14')][_0xe674('0x16')]);}else{logger[_0xe674('0xe')]('SalesforceField,\x20%s,\x20%s',_0xf35647,_0xe674('0x10'));_0x352a75(_0x327837[_0xe674('0x17')][_0xe674('0x16')]);}})[_0xe674('0x18')](function(_0x2fd3c1){logger[_0xe674('0x14')](_0xe674('0xf'),_0xf35647,_0x2fd3c1);_0x44d929(_0x2fd3c1);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 4aa8eed..62b765c 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 _0x9eb4=['../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x4e8036,_0x491d13){var _0x21eb37=function(_0x11d3b8){while(--_0x11d3b8){_0x4e8036['push'](_0x4e8036['shift']());}};_0x21eb37(++_0x491d13);}(_0x9eb4,0x126));var _0x49eb=function(_0x525673,_0xb429c2){_0x525673=_0x525673-0x0;var _0x8f7574=_0x9eb4[_0x525673];return _0x8f7574;};'use strict';var multer=require('multer');var util=require(_0x49eb('0x0'));var path=require(_0x49eb('0x1'));var timeout=require(_0x49eb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x49eb('0x3'));var auth=require(_0x49eb('0x4'));var interaction=require(_0x49eb('0x5'));var config=require(_0x49eb('0x6'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0x49eb('0x7')](),controller['index']);router[_0x49eb('0x8')](_0x49eb('0x9'),auth[_0x49eb('0x7')](),controller[_0x49eb('0xa')]);router[_0x49eb('0x8')]('/:id/configurations',auth[_0x49eb('0x7')](),controller[_0x49eb('0xb')]);router[_0x49eb('0x8')](_0x49eb('0xc'),auth[_0x49eb('0x7')](),controller[_0x49eb('0xd')]);router[_0x49eb('0xe')]('/',auth[_0x49eb('0x7')](),controller[_0x49eb('0xf')]);router[_0x49eb('0xe')](_0x49eb('0x10'),auth[_0x49eb('0x7')](),controller[_0x49eb('0x11')]);router[_0x49eb('0x12')](_0x49eb('0x9'),auth[_0x49eb('0x7')](),controller[_0x49eb('0x13')]);router[_0x49eb('0x14')]('/:id',auth[_0x49eb('0x7')](),controller[_0x49eb('0x15')]);module[_0x49eb('0x16')]=router; \ No newline at end of file +var _0xfa4b=['Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4c89ab,_0x22d6f8){var _0x13df72=function(_0x3e12ce){while(--_0x3e12ce){_0x4c89ab['push'](_0x4c89ab['shift']());}};_0x13df72(++_0x22d6f8);}(_0xfa4b,0x175));var _0xbfa4=function(_0x4bba85,_0x4c3e39){_0x4bba85=_0x4bba85-0x0;var _0x17e4d2=_0xfa4b[_0x4bba85];return _0x17e4d2;};'use strict';var multer=require(_0xbfa4('0x0'));var util=require(_0xbfa4('0x1'));var path=require(_0xbfa4('0x2'));var timeout=require(_0xbfa4('0x3'));var express=require(_0xbfa4('0x4'));var router=express[_0xbfa4('0x5')]();var fs_extra=require(_0xbfa4('0x6'));var auth=require(_0xbfa4('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbfa4('0x8'));var controller=require('./intServicenowAccount.controller');router[_0xbfa4('0x9')]('/',auth['isAuthenticated'](),controller[_0xbfa4('0xa')]);router[_0xbfa4('0x9')](_0xbfa4('0xb'),auth[_0xbfa4('0xc')](),controller[_0xbfa4('0xd')]);router['get'](_0xbfa4('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xbfa4('0xc')](),controller['getFields']);router[_0xbfa4('0xf')]('/',auth[_0xbfa4('0xc')](),controller[_0xbfa4('0x10')]);router['post'](_0xbfa4('0xe'),auth[_0xbfa4('0xc')](),controller['addConfiguration']);router[_0xbfa4('0x11')]('/:id',auth[_0xbfa4('0xc')](),controller[_0xbfa4('0x12')]);router['delete'](_0xbfa4('0xb'),auth[_0xbfa4('0xc')](),controller[_0xbfa4('0x13')]);module[_0xbfa4('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 4064a7d..32df255 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 _0x3419=['STRING','username','remoteUri','sequelize','exports'];(function(_0x44c94d,_0x1da87a){var _0x402cc6=function(_0x17b122){while(--_0x17b122){_0x44c94d['push'](_0x44c94d['shift']());}};_0x402cc6(++_0x1da87a);}(_0x3419,0x7b));var _0x9341=function(_0x36cff7,_0x5cb048){_0x36cff7=_0x36cff7-0x0;var _0x21c697=_0x3419[_0x36cff7];return _0x21c697;};'use strict';var Sequelize=require(_0x9341('0x0'));module[_0x9341('0x1')]={'name':{'type':Sequelize[_0x9341('0x2')]},'description':{'type':Sequelize[_0x9341('0x2')]},'username':{'type':Sequelize[_0x9341('0x2')],'unique':_0x9341('0x3')},'password':{'type':Sequelize[_0x9341('0x2')]},'email':{'type':Sequelize[_0x9341('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x9341('0x4')},'serverUrl':{'type':Sequelize[_0x9341('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x46ad=['sequelize','exports','STRING'];(function(_0x56e358,_0x1f73a4){var _0x1402da=function(_0x52e790){while(--_0x52e790){_0x56e358['push'](_0x56e358['shift']());}};_0x1402da(++_0x1f73a4);}(_0x46ad,0x189));var _0xd46a=function(_0x5ade35,_0x35cec6){_0x5ade35=_0x5ade35-0x0;var _0x21d317=_0x46ad[_0x5ade35];return _0x21d317;};'use strict';var Sequelize=require(_0xd46a('0x0'));module[_0xd46a('0x1')]={'name':{'type':Sequelize[_0xd46a('0x2')]},'description':{'type':Sequelize[_0xd46a('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xd46a('0x2')]},'email':{'type':Sequelize[_0xd46a('0x2')]},'remoteUri':{'type':Sequelize[_0xd46a('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xd46a('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index af8c26e..5d1ff97 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 _0x08a8=['mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','../../components/integrations/configuration','status','count','offset','limit','set','json','apply','save','update','then','destroy','end','error','stack','name','index','map','ServicenowAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','options','find','catch','body','params','getConfigurations','findOne','length','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','create','ServicenowField','getFields','made_sla','knowledge','close_code','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','subcategory','work_notes','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','notify','sys_class_name','parent_incident','sys_id','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','escalation','upon_approval','location','username','password','email','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','all','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','test','boolean','true','False','sys_choice?sysparm_query=name=incident^element=','value','eml-format','request-promise','moment'];(function(_0x4eb98e,_0x59986c){var _0x241c36=function(_0x450f33){while(--_0x450f33){_0x4eb98e['push'](_0x4eb98e['shift']());}};_0x241c36(++_0x59986c);}(_0x08a8,0x163));var _0x808a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08a8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x808a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x808a('0x1'));var moment=require(_0x808a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x808a('0x3'));var util=require(_0x808a('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x808a('0x5'));var ejs=require(_0x808a('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x808a('0x7'));var squel=require(_0x808a('0x8'));var crypto=require(_0x808a('0x9'));var jsforce=require(_0x808a('0xa'));var deskjs=require(_0x808a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x808a('0xc'));var Papa=require(_0x808a('0xd'));var Redis=require('ioredis');var authService=require(_0x808a('0xe'));var qs=require(_0x808a('0xf'));var as=require(_0x808a('0x10'));var hardwareService=require(_0x808a('0x11'));var logger=require('../../config/logger')(_0x808a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x808a('0x13'))['db'];var integrations=require(_0x808a('0x14'));function respondWithStatusCode(_0x33bc94,_0x5a4cef){_0x5a4cef=_0x5a4cef||0xcc;return function(_0x282b1a){if(_0x282b1a){return _0x33bc94['sendStatus'](_0x5a4cef);}return _0x33bc94[_0x808a('0x15')](_0x5a4cef)['end']();};}function respondWithResult(_0x16bcbe,_0x1d2ee8){_0x1d2ee8=_0x1d2ee8||0xc8;return function(_0x284362){if(_0x284362){return _0x16bcbe[_0x808a('0x15')](_0x1d2ee8)['json'](_0x284362);}};}function respondWithFilteredResult(_0x50a3fb,_0x2be3b3){return function(_0x2f6a7a){if(_0x2f6a7a){var _0x4e6258=typeof _0x2be3b3['offset']==='undefined'&&typeof _0x2be3b3['limit']==='undefined';var _0x316d2c=_0x2f6a7a[_0x808a('0x16')];var _0x4a7b9a=_0x4e6258?0x0:_0x2be3b3[_0x808a('0x17')];var _0x3e869c=_0x4e6258?_0x2f6a7a['count']:_0x2be3b3[_0x808a('0x17')]+_0x2be3b3[_0x808a('0x18')];var _0x393d72;if(_0x3e869c>=_0x316d2c){_0x3e869c=_0x316d2c;_0x393d72=0xc8;}else{_0x393d72=0xce;}_0x50a3fb[_0x808a('0x15')](_0x393d72);return _0x50a3fb[_0x808a('0x19')]('Content-Range',_0x4a7b9a+'-'+_0x3e869c+'/'+_0x316d2c)[_0x808a('0x1a')](_0x2f6a7a);}return null;};}function patchUpdates(_0x4f3ab5){return function(_0x34e14f){try{jsonpatch[_0x808a('0x1b')](_0x34e14f,_0x4f3ab5,!![]);}catch(_0x302d61){return BPromise['reject'](_0x302d61);}return _0x34e14f[_0x808a('0x1c')]();};}function saveUpdates(_0x5ec0a7,_0x1d1420){return function(_0x57d727){if(_0x57d727){return _0x57d727[_0x808a('0x1d')](_0x5ec0a7)[_0x808a('0x1e')](function(_0x356bfc){return _0x356bfc;});}return null;};}function removeEntity(_0x402d91,_0x12d0f2){return function(_0x48f83d){if(_0x48f83d){return _0x48f83d[_0x808a('0x1f')]()[_0x808a('0x1e')](function(){_0x402d91['status'](0xcc)[_0x808a('0x20')]();});}};}function handleEntityNotFound(_0x12b848,_0x2202ca){return function(_0x51c499){if(!_0x51c499){_0x12b848['sendStatus'](0x194);}return _0x51c499;};}function handleError(_0x36ad74,_0x4573ff){_0x4573ff=_0x4573ff||0x1f4;return function(_0x325b44){logger[_0x808a('0x21')](_0x325b44[_0x808a('0x22')]);if(_0x325b44[_0x808a('0x23')]){delete _0x325b44['name'];}_0x36ad74['status'](_0x4573ff)['send'](_0x325b44);};}exports[_0x808a('0x24')]=function(_0x2a690e,_0x2913a7){var _0x5b0a44={},_0x281237={},_0x9835a4={'count':0x0,'rows':[]};var _0x9a9cdf=_[_0x808a('0x25')](db[_0x808a('0x26')][_0x808a('0x27')],function(_0x247823){return{'name':_0x247823['fieldName'],'type':_0x247823[_0x808a('0x28')][_0x808a('0x29')]};});_0x281237[_0x808a('0x2a')]=_[_0x808a('0x25')](_0x9a9cdf,'name');_0x281237[_0x808a('0x2b')]=_[_0x808a('0x2c')](_0x2a690e[_0x808a('0x2b')]);_0x281237[_0x808a('0x2d')]=_[_0x808a('0x2e')](_0x281237[_0x808a('0x2a')],_0x281237[_0x808a('0x2b')]);_0x5b0a44['attributes']=_[_0x808a('0x2e')](_0x281237[_0x808a('0x2a')],qs[_0x808a('0x2f')](_0x2a690e[_0x808a('0x2b')][_0x808a('0x2f')]));_0x5b0a44['attributes']=_0x5b0a44[_0x808a('0x30')]['length']?_0x5b0a44['attributes']:_0x281237[_0x808a('0x2a')];if(!_0x2a690e['query'][_0x808a('0x31')]('nolimit')){_0x5b0a44[_0x808a('0x18')]=qs['limit'](_0x2a690e[_0x808a('0x2b')][_0x808a('0x18')]);_0x5b0a44['offset']=qs[_0x808a('0x17')](_0x2a690e[_0x808a('0x2b')]['offset']);}_0x5b0a44[_0x808a('0x32')]=qs[_0x808a('0x33')](_0x2a690e[_0x808a('0x2b')][_0x808a('0x33')]);_0x5b0a44[_0x808a('0x34')]=qs[_0x808a('0x2d')](_[_0x808a('0x35')](_0x2a690e['query'],_0x281237[_0x808a('0x2d')]),_0x9a9cdf);if(_0x2a690e[_0x808a('0x2b')][_0x808a('0x36')]){_0x5b0a44['where']=_[_0x808a('0x37')](_0x5b0a44['where'],{'$or':_[_0x808a('0x25')](_0x9a9cdf,function(_0x2e704b){if(_0x2e704b[_0x808a('0x28')]!==_0x808a('0x38')){var _0x58d95e={};_0x58d95e[_0x2e704b['name']]={'$like':'%'+_0x2a690e[_0x808a('0x2b')][_0x808a('0x36')]+'%'};return _0x58d95e;}})});}_0x5b0a44=_[_0x808a('0x37')]({},_0x5b0a44,_0x2a690e['options']);var _0x324cfd={'where':_0x5b0a44['where']};return db[_0x808a('0x26')][_0x808a('0x16')](_0x324cfd)[_0x808a('0x1e')](function(_0x295eee){_0x9835a4[_0x808a('0x16')]=_0x295eee;if(_0x2a690e[_0x808a('0x2b')][_0x808a('0x39')]){_0x5b0a44[_0x808a('0x3a')]=[{'all':!![]}];}return db[_0x808a('0x26')][_0x808a('0x3b')](_0x5b0a44);})[_0x808a('0x1e')](function(_0x1e02cf){_0x9835a4[_0x808a('0x3c')]=_0x1e02cf;return _0x9835a4;})[_0x808a('0x1e')](respondWithFilteredResult(_0x2913a7,_0x5b0a44))['catch'](handleError(_0x2913a7,null));};exports['show']=function(_0x45bb7b,_0x404b86){var _0xfcc438={'raw':![],'where':{'id':_0x45bb7b['params']['id']}},_0x41c98c={};_0x41c98c[_0x808a('0x2a')]=_[_0x808a('0x2c')](db[_0x808a('0x26')][_0x808a('0x27')]);_0x41c98c[_0x808a('0x2b')]=_[_0x808a('0x2c')](_0x45bb7b[_0x808a('0x2b')]);_0x41c98c[_0x808a('0x2d')]=_[_0x808a('0x2e')](_0x41c98c[_0x808a('0x2a')],_0x41c98c[_0x808a('0x2b')]);_0xfcc438[_0x808a('0x30')]=_['intersection'](_0x41c98c[_0x808a('0x2a')],qs[_0x808a('0x2f')](_0x45bb7b[_0x808a('0x2b')][_0x808a('0x2f')]));_0xfcc438[_0x808a('0x30')]=_0xfcc438[_0x808a('0x30')]['length']?_0xfcc438[_0x808a('0x30')]:_0x41c98c[_0x808a('0x2a')];if(_0x45bb7b[_0x808a('0x2b')][_0x808a('0x39')]){_0xfcc438[_0x808a('0x3a')]=[{'all':!![]}];}_0xfcc438=_[_0x808a('0x37')]({},_0xfcc438,_0x45bb7b[_0x808a('0x3d')]);return db[_0x808a('0x26')][_0x808a('0x3e')](_0xfcc438)[_0x808a('0x1e')](handleEntityNotFound(_0x404b86,null))[_0x808a('0x1e')](respondWithResult(_0x404b86,null))[_0x808a('0x3f')](handleError(_0x404b86,null));};exports['create']=function(_0x4de2a3,_0x228e3b){return db['ServicenowAccount']['create'](_0x4de2a3[_0x808a('0x40')],{})['then'](respondWithResult(_0x228e3b,0xc9))[_0x808a('0x3f')](handleError(_0x228e3b,null));};exports[_0x808a('0x1d')]=function(_0x32e567,_0x4024dc){if(_0x32e567[_0x808a('0x40')]['id']){delete _0x32e567[_0x808a('0x40')]['id'];}return db[_0x808a('0x26')][_0x808a('0x3e')]({'where':{'id':_0x32e567[_0x808a('0x41')]['id']}})['then'](handleEntityNotFound(_0x4024dc,null))['then'](saveUpdates(_0x32e567[_0x808a('0x40')],null))[_0x808a('0x1e')](respondWithResult(_0x4024dc,null))[_0x808a('0x3f')](handleError(_0x4024dc,null));};exports['destroy']=function(_0x1da888,_0x3acedc){return db[_0x808a('0x26')]['find']({'where':{'id':_0x1da888[_0x808a('0x41')]['id']}})[_0x808a('0x1e')](handleEntityNotFound(_0x3acedc,null))[_0x808a('0x1e')](removeEntity(_0x3acedc,null))[_0x808a('0x3f')](handleError(_0x3acedc,null));};exports[_0x808a('0x42')]=function(_0x63d6d7,_0x556e30,_0x128c41){var _0xdcbd60={};var _0x1ca1df={};var _0x5a98c1;var _0x296974;return db[_0x808a('0x26')][_0x808a('0x43')]({'where':{'id':_0x63d6d7['params']['id']}})[_0x808a('0x1e')](handleEntityNotFound(_0x556e30,null))[_0x808a('0x1e')](function(_0x49e382){if(_0x49e382){_0x5a98c1=_0x49e382;_0x1ca1df[_0x808a('0x2a')]=_[_0x808a('0x2c')](db['ServicenowConfiguration'][_0x808a('0x27')]);_0x1ca1df[_0x808a('0x2b')]=_['keys'](_0x63d6d7[_0x808a('0x2b')]);_0x1ca1df[_0x808a('0x2d')]=_[_0x808a('0x2e')](_0x1ca1df['model'],_0x1ca1df['query']);_0xdcbd60[_0x808a('0x30')]=_[_0x808a('0x2e')](_0x1ca1df['model'],qs[_0x808a('0x2f')](_0x63d6d7[_0x808a('0x2b')]['fields']));_0xdcbd60[_0x808a('0x30')]=_0xdcbd60['attributes']['length']?_0xdcbd60['attributes']:_0x1ca1df['model'];_0xdcbd60[_0x808a('0x32')]=qs[_0x808a('0x33')](_0x63d6d7[_0x808a('0x2b')][_0x808a('0x33')]);_0xdcbd60[_0x808a('0x34')]=qs[_0x808a('0x2d')](_['pick'](_0x63d6d7[_0x808a('0x2b')],_0x1ca1df[_0x808a('0x2d')]));if(_0x63d6d7[_0x808a('0x2b')][_0x808a('0x36')]){_0xdcbd60['where']=_[_0x808a('0x37')](_0xdcbd60[_0x808a('0x34')],{'$or':_[_0x808a('0x25')](_0xdcbd60[_0x808a('0x30')],function(_0x3057d7){var _0x1d04b3={};_0x1d04b3[_0x3057d7]={'$like':'%'+_0x63d6d7['query'][_0x808a('0x36')]+'%'};return _0x1d04b3;})});}_0xdcbd60=_[_0x808a('0x37')]({},_0xdcbd60,_0x63d6d7[_0x808a('0x3d')]);return _0x5a98c1[_0x808a('0x42')](_0xdcbd60);}})[_0x808a('0x1e')](function(_0x23d44b){if(_0x23d44b){_0x296974=_0x23d44b[_0x808a('0x44')];if(!_0x63d6d7[_0x808a('0x2b')][_0x808a('0x31')](_0x808a('0x45'))){_0xdcbd60[_0x808a('0x18')]=qs[_0x808a('0x18')](_0x63d6d7[_0x808a('0x2b')][_0x808a('0x18')]);_0xdcbd60['offset']=qs['offset'](_0x63d6d7[_0x808a('0x2b')][_0x808a('0x17')]);}return _0x5a98c1['getConfigurations'](_0xdcbd60);}})[_0x808a('0x1e')](function(_0x47355a){if(_0x47355a){return _0x47355a?{'count':_0x296974,'rows':_0x47355a}:null;}})[_0x808a('0x1e')](respondWithResult(_0x556e30,null))[_0x808a('0x3f')](handleError(_0x556e30,null));};exports[_0x808a('0x46')]=function(_0x550984,_0x3b807b,_0x215353){if(_0x550984[_0x808a('0x40')]['id']){delete _0x550984['body']['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x550984[_0x808a('0x41')]['id']}})[_0x808a('0x1e')](handleEntityNotFound(_0x3b807b,null))[_0x808a('0x1e')](function(_0x34ffa3){if(_0x34ffa3){_0x550984[_0x808a('0x40')][_0x808a('0x47')]=_0x34ffa3['id'];_0x550984['body'][_0x808a('0x48')]=integrations[_0x808a('0x49')](_0x550984[_0x808a('0x40')][_0x808a('0x4a')],_0x550984['body'][_0x808a('0x28')]);_0x550984[_0x808a('0x40')][_0x808a('0x4b')]=integrations[_0x808a('0x4c')](_0x550984[_0x808a('0x40')]['channel'],_0x550984[_0x808a('0x40')]['type']);return db[_0x808a('0x4d')][_0x808a('0x4e')](_0x550984['body'],{'include':[{'model':db[_0x808a('0x4f')],'as':_0x808a('0x48')},{'model':db[_0x808a('0x4f')],'as':_0x808a('0x4b')}]});}return null;})[_0x808a('0x1e')](respondWithResult(_0x3b807b,null))[_0x808a('0x3f')](handleError(_0x3b807b,null));};exports[_0x808a('0x50')]=function(_0x1bc855,_0x1051df,_0x2ed21a){var _0x59411c=[_0x808a('0x51'),'hold_reason',_0x808a('0x52'),'subcategory',_0x808a('0x53'),'notify',_0x808a('0x54'),_0x808a('0x55'),_0x808a('0x56')];var _0x5d4f2e=[_0x808a('0x57'),_0x808a('0x51'),_0x808a('0x58'),'watch_list',_0x808a('0x59'),_0x808a('0x5a'),_0x808a('0x5b'),_0x808a('0x5c'),_0x808a('0x5d'),_0x808a('0x5e'),_0x808a('0x5f'),_0x808a('0x60'),'opened_by','user_input',_0x808a('0x61'),_0x808a('0x62'),_0x808a('0x63'),_0x808a('0x64'),_0x808a('0x52'),_0x808a('0x32'),_0x808a('0x65'),_0x808a('0x66'),_0x808a('0x67'),_0x808a('0x68'),_0x808a('0x69'),_0x808a('0x6a'),_0x808a('0x6b'),_0x808a('0x6c'),_0x808a('0x6d'),_0x808a('0x6e'),_0x808a('0x6f'),_0x808a('0x70'),_0x808a('0x71'),_0x808a('0x72'),_0x808a('0x73'),_0x808a('0x74'),_0x808a('0x75'),_0x808a('0x76'),_0x808a('0x77'),_0x808a('0x78'),'approval_set',_0x808a('0x79'),_0x808a('0x7a'),'short_description','close_code',_0x808a('0x7b'),'delivery_task',_0x808a('0x7c'),_0x808a('0x7d'),_0x808a('0x7e'),_0x808a('0x7f'),'description',_0x808a('0x80'),_0x808a('0x81'),_0x808a('0x82'),'close_notes','closed_by','follow_up',_0x808a('0x83'),_0x808a('0x84'),'contact_type',_0x808a('0x85'),_0x808a('0x54'),_0x808a('0x86'),_0x808a('0x87'),_0x808a('0x88'),_0x808a('0x89'),_0x808a('0x8a'),_0x808a('0x8b'),_0x808a('0x55'),_0x808a('0x8c'),_0x808a('0x8d'),_0x808a('0x8e'),_0x808a('0x8f'),_0x808a('0x90'),_0x808a('0x91'),'reopen_count','sys_tags',_0x808a('0x92'),_0x808a('0x93'),'correlation_id',_0x808a('0x94'),_0x808a('0x56')];var _0x44218a='';var _0x4d5ccb='';var _0x1851ae=[];var _0x4d72c2='';var _0x5b2fe1='';var _0x55c681=[];var _0x36d0bf='';var _0x2ea214='';var _0x33ebc5={};var _0x22ffe4='';return db[_0x808a('0x26')][_0x808a('0x43')]({'where':{'id':_0x1bc855['params']['id']},'attributes':['id',_0x808a('0x95'),_0x808a('0x96'),_0x808a('0x97'),'remoteUri',_0x808a('0x98')]})[_0x808a('0x1e')](handleEntityNotFound(_0x1051df,null))['then'](function(_0x45cd8d){if(_0x45cd8d){_0x22ffe4=_0x45cd8d['remoteUri'];var _0x550aa8=_0x22ffe4[_0x808a('0x99')](-0x1);if(_0x550aa8==='/'){_0x22ffe4=_0x22ffe4[_0x808a('0x9a')](0x0,_0x22ffe4[_0x808a('0x9b')](_0x550aa8));}_0x2ea214=util[_0x808a('0x9c')](_0x808a('0x9d'),_0x22ffe4);_0x36d0bf=util['format'](_0x808a('0x9e'),_0x22ffe4);_0x33ebc5={'user':_0x45cd8d[_0x808a('0x95')],'pass':_0x45cd8d[_0x808a('0x96')]};var _0x1886d7={'method':_0x808a('0x9f'),'uri':_0x2ea214+'incident?sysparm_display_value=all','auth':_0x33ebc5,'json':!![]};return rp(_0x1886d7);}})['then'](function(_0x3cdb1e){if(_0x3cdb1e[_0x808a('0xa0')][_0x808a('0x44')]>0x0){_0x44218a=_0x3cdb1e[_0x808a('0xa0')];}console[_0x808a('0xa1')](_0x808a('0xa2'),_0x44218a);_0x55c681=[];_0x4d5ccb=Object[_0x808a('0xa3')]([],_0x44218a);_['remove'](_0x4d5ccb,function(_0x553f4c){return!_0x59411c[_0x808a('0xa4')](_0x553f4c[_0x808a('0x23')]);});_0x4d5ccb[_0x808a('0xa5')](function(_0x1cf5e9){var _0x4042b4=createFieldObject(_0x36d0bf,_0x33ebc5,_0x1cf5e9[_0x808a('0xa6')],_0x1cf5e9[_0x808a('0x23')],_0x1cf5e9[_0x808a('0xa7')],![]);_0x55c681['push'](_0x4042b4);});return Promise[_0x808a('0xa8')](_0x55c681);})[_0x808a('0x1e')](function(_0x375f00){_0x1851ae=_0x375f00;_0x4d72c2=Object[_0x808a('0xa3')]([],_0x44218a);console[_0x808a('0xa1')]('TCL:\x20_object',_0x44218a);_['remove'](_0x4d72c2,function(_0x1a4638){return _0x5d4f2e[_0x808a('0xa4')](_0x1a4638[_0x808a('0x23')]);});console[_0x808a('0xa1')](_0x808a('0xa9'),_0x4d72c2);_0x55c681=[];_0x4d72c2[_0x808a('0xa5')](function(_0x10b8db){var _0x1715e2=createFieldObject(_0x36d0bf,_0x33ebc5,_0x10b8db[_0x808a('0xa6')],_0x10b8db[_0x808a('0x23')],_0x10b8db['label'],!![]);_0x55c681[_0x808a('0xaa')](_0x1715e2);});return Promise['all'](_0x55c681);})[_0x808a('0x1e')](function(_0x1075f1){_0x5b2fe1=_0x1075f1;var _0x339af0=_0x1851ae[_0x808a('0xab')](_0x5b2fe1);return{'count':_0x339af0[_0x808a('0x44')],'rows':_0x339af0};})['then'](respondWithResult(_0x1051df,null))[_0x808a('0x3f')](function(_0x44d4bc){console[_0x808a('0xa1')](_0x808a('0xac')+_0x44d4bc);var _0x437474=_0x1bc855['query'][_0x808a('0xad')]?0x1f4:_0x44d4bc['statusCode']||0x1f4;logger['error'](_0x44d4bc['stack']);delete _0x44d4bc[_0x808a('0x23')];if(_0x437474===0x191){_0x437474=0x190;}_0x1051df[_0x808a('0x15')](_0x437474)['send'](_0x1bc855[_0x808a('0x2b')][_0x808a('0xad')]?{'message':'Wrong\x20credentials','statusCode':_0x44d4bc['statusCode']}:_0x44d4bc);});};function createFieldObject(_0x5f14d4,_0x1ebfb0,_0xfdaa2c,_0x2e4bfb,_0x2c876e,_0x10be98){return new Promise(function(_0xa39d5a,_0x308e30){var _0x1b262b={'id':_0x2e4bfb,'name':_0x2c876e,'custom':_0x10be98};if(_0xfdaa2c===_0x808a('0xae')){_0x1b262b[_0x808a('0x3d')]=[{'name':'True','value':_0x808a('0xaf')},{'name':_0x808a('0xb0'),'value':'false'}];_0xa39d5a(_0x1b262b);}else{var _0x4fa911={'method':_0x808a('0x9f'),'uri':_0x5f14d4+_0x808a('0xb1')+_0x2e4bfb,'auth':_0x1ebfb0,'json':!![]};return rp(_0x4fa911)[_0x808a('0x1e')](function(_0x283e6f){var _0x10f821=[];if(_0x283e6f['result']['length']>0x0){_0x283e6f['result'][_0x808a('0xa5')](function(_0x201311){if(_0x201311['inactive']==='false'){var _0x231092={'name':_0x201311[_0x808a('0xa7')],'value':_0x201311[_0x808a('0xb2')]};_0x10f821[_0x808a('0xaa')](_0x231092);}});}_0x1b262b[_0x808a('0x3d')]=_0x10f821;if(_0x1b262b[_0x808a('0x3d')][_0x808a('0x44')]>0x0){_0xa39d5a(_0x1b262b);}else{if(_0x10be98==![]){_0xa39d5a();}else{_0xa39d5a(_0x1b262b);}}});}});} \ No newline at end of file +var _0x5ae5=['user_input','sys_domain','state','calendar_stc','closed_at','delivery_plan','impact','business_service','priority','sys_domain_path','time_worked','expected_start','business_duration','group_list','reopened_time','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','reassignment_count','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','location','username','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','incident\x20table\x20objects','assign','includes','forEach','internalType','label','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','test','statusCode','stack','Wrong\x20credentials','boolean','True','true','False','result','inactive','value','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','end','error','name','send','map','ServicenowAccount','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','then','include','catch','show','params','rawAttributes','includeAll','create','body','find','destroy','getConfigurations','findOne','ServicenowConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by'];(function(_0xb577b0,_0x59f181){var _0x4dbec5=function(_0x1c47ee){while(--_0x1c47ee){_0xb577b0['push'](_0xb577b0['shift']());}};_0x4dbec5(++_0x59f181);}(_0x5ae5,0x1c8));var _0x55ae=function(_0x2d344f,_0x25fa84){_0x2d344f=_0x2d344f-0x0;var _0x2e796b=_0x5ae5[_0x2d344f];return _0x2e796b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x55ae('0x0'));var jsonpatch=require(_0x55ae('0x1'));var rp=require(_0x55ae('0x2'));var moment=require(_0x55ae('0x3'));var BPromise=require(_0x55ae('0x4'));var Mustache=require(_0x55ae('0x5'));var util=require(_0x55ae('0x6'));var path=require(_0x55ae('0x7'));var sox=require(_0x55ae('0x8'));var csv=require(_0x55ae('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55ae('0xa'));var _=require(_0x55ae('0xb'));var squel=require(_0x55ae('0xc'));var crypto=require('crypto');var jsforce=require(_0x55ae('0xd'));var deskjs=require(_0x55ae('0xe'));var toCsv=require(_0x55ae('0x9'));var querystring=require(_0x55ae('0xf'));var Papa=require(_0x55ae('0x10'));var Redis=require(_0x55ae('0x11'));var authService=require(_0x55ae('0x12'));var qs=require(_0x55ae('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x55ae('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x55ae('0x15'));var config=require(_0x55ae('0x16'));var licenseUtil=require(_0x55ae('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x55ae('0x18'));function respondWithStatusCode(_0x2ccd25,_0xb23688){_0xb23688=_0xb23688||0xcc;return function(_0x224741){if(_0x224741){return _0x2ccd25[_0x55ae('0x19')](_0xb23688);}return _0x2ccd25[_0x55ae('0x1a')](_0xb23688)['end']();};}function respondWithResult(_0xaf9e96,_0x4148fd){_0x4148fd=_0x4148fd||0xc8;return function(_0x140602){if(_0x140602){return _0xaf9e96['status'](_0x4148fd)[_0x55ae('0x1b')](_0x140602);}};}function respondWithFilteredResult(_0x31d678,_0x334957){return function(_0x5e135d){if(_0x5e135d){var _0x3b7f97=typeof _0x334957['offset']===_0x55ae('0x1c')&&typeof _0x334957[_0x55ae('0x1d')]===_0x55ae('0x1c');var _0x49e8f7=_0x5e135d[_0x55ae('0x1e')];var _0x178fba=_0x3b7f97?0x0:_0x334957[_0x55ae('0x1f')];var _0x2270af=_0x3b7f97?_0x5e135d[_0x55ae('0x1e')]:_0x334957[_0x55ae('0x1f')]+_0x334957[_0x55ae('0x1d')];var _0x35afad;if(_0x2270af>=_0x49e8f7){_0x2270af=_0x49e8f7;_0x35afad=0xc8;}else{_0x35afad=0xce;}_0x31d678[_0x55ae('0x1a')](_0x35afad);return _0x31d678[_0x55ae('0x20')]('Content-Range',_0x178fba+'-'+_0x2270af+'/'+_0x49e8f7)[_0x55ae('0x1b')](_0x5e135d);}return null;};}function patchUpdates(_0x2d21c8){return function(_0x3174f3){try{jsonpatch[_0x55ae('0x21')](_0x3174f3,_0x2d21c8,!![]);}catch(_0x52f8e8){return BPromise[_0x55ae('0x22')](_0x52f8e8);}return _0x3174f3[_0x55ae('0x23')]();};}function saveUpdates(_0x44eba0,_0x16718b){return function(_0x56ba38){if(_0x56ba38){return _0x56ba38[_0x55ae('0x24')](_0x44eba0)['then'](function(_0x47771e){return _0x47771e;});}return null;};}function removeEntity(_0x128505,_0xe5e92){return function(_0x5a43ae){if(_0x5a43ae){return _0x5a43ae['destroy']()['then'](function(){_0x128505['status'](0xcc)[_0x55ae('0x25')]();});}};}function handleEntityNotFound(_0x237e9e,_0xf980fe){return function(_0x598f5f){if(!_0x598f5f){_0x237e9e[_0x55ae('0x19')](0x194);}return _0x598f5f;};}function handleError(_0x4b6c69,_0x263de1){_0x263de1=_0x263de1||0x1f4;return function(_0x4520a0){logger[_0x55ae('0x26')](_0x4520a0['stack']);if(_0x4520a0[_0x55ae('0x27')]){delete _0x4520a0[_0x55ae('0x27')];}_0x4b6c69['status'](_0x263de1)[_0x55ae('0x28')](_0x4520a0);};}exports['index']=function(_0x387305,_0x3b20fe){var _0x40ddec={},_0x2ef405={},_0x4d6551={'count':0x0,'rows':[]};var _0x4e210c=_[_0x55ae('0x29')](db[_0x55ae('0x2a')]['rawAttributes'],function(_0x4d7af4){return{'name':_0x4d7af4[_0x55ae('0x2b')],'type':_0x4d7af4[_0x55ae('0x2c')][_0x55ae('0x2d')]};});_0x2ef405[_0x55ae('0x2e')]=_[_0x55ae('0x29')](_0x4e210c,_0x55ae('0x27'));_0x2ef405[_0x55ae('0x2f')]=_[_0x55ae('0x30')](_0x387305[_0x55ae('0x2f')]);_0x2ef405['filters']=_[_0x55ae('0x31')](_0x2ef405[_0x55ae('0x2e')],_0x2ef405[_0x55ae('0x2f')]);_0x40ddec['attributes']=_[_0x55ae('0x31')](_0x2ef405[_0x55ae('0x2e')],qs[_0x55ae('0x32')](_0x387305['query'][_0x55ae('0x32')]));_0x40ddec['attributes']=_0x40ddec[_0x55ae('0x33')][_0x55ae('0x34')]?_0x40ddec[_0x55ae('0x33')]:_0x2ef405['model'];if(!_0x387305['query'][_0x55ae('0x35')](_0x55ae('0x36'))){_0x40ddec[_0x55ae('0x1d')]=qs[_0x55ae('0x1d')](_0x387305[_0x55ae('0x2f')][_0x55ae('0x1d')]);_0x40ddec[_0x55ae('0x1f')]=qs[_0x55ae('0x1f')](_0x387305[_0x55ae('0x2f')]['offset']);}_0x40ddec[_0x55ae('0x37')]=qs[_0x55ae('0x38')](_0x387305[_0x55ae('0x2f')][_0x55ae('0x38')]);_0x40ddec[_0x55ae('0x39')]=qs[_0x55ae('0x3a')](_['pick'](_0x387305['query'],_0x2ef405[_0x55ae('0x3a')]),_0x4e210c);if(_0x387305[_0x55ae('0x2f')]['filter']){_0x40ddec[_0x55ae('0x39')]=_[_0x55ae('0x3b')](_0x40ddec[_0x55ae('0x39')],{'$or':_[_0x55ae('0x29')](_0x4e210c,function(_0x58ce0f){if(_0x58ce0f[_0x55ae('0x2c')]!==_0x55ae('0x3c')){var _0xfdf75c={};_0xfdf75c[_0x58ce0f[_0x55ae('0x27')]]={'$like':'%'+_0x387305['query'][_0x55ae('0x3d')]+'%'};return _0xfdf75c;}})});}_0x40ddec=_['merge']({},_0x40ddec,_0x387305[_0x55ae('0x3e')]);var _0x187e0b={'where':_0x40ddec['where']};return db[_0x55ae('0x2a')][_0x55ae('0x1e')](_0x187e0b)[_0x55ae('0x3f')](function(_0x31ee12){_0x4d6551[_0x55ae('0x1e')]=_0x31ee12;if(_0x387305['query']['includeAll']){_0x40ddec[_0x55ae('0x40')]=[{'all':!![]}];}return db[_0x55ae('0x2a')]['findAll'](_0x40ddec);})[_0x55ae('0x3f')](function(_0xe052dd){_0x4d6551['rows']=_0xe052dd;return _0x4d6551;})[_0x55ae('0x3f')](respondWithFilteredResult(_0x3b20fe,_0x40ddec))[_0x55ae('0x41')](handleError(_0x3b20fe,null));};exports[_0x55ae('0x42')]=function(_0x2219aa,_0x13a4de){var _0x42df41={'raw':![],'where':{'id':_0x2219aa[_0x55ae('0x43')]['id']}},_0x307928={};_0x307928['model']=_[_0x55ae('0x30')](db[_0x55ae('0x2a')][_0x55ae('0x44')]);_0x307928['query']=_[_0x55ae('0x30')](_0x2219aa['query']);_0x307928[_0x55ae('0x3a')]=_[_0x55ae('0x31')](_0x307928[_0x55ae('0x2e')],_0x307928['query']);_0x42df41[_0x55ae('0x33')]=_[_0x55ae('0x31')](_0x307928['model'],qs[_0x55ae('0x32')](_0x2219aa[_0x55ae('0x2f')][_0x55ae('0x32')]));_0x42df41['attributes']=_0x42df41[_0x55ae('0x33')][_0x55ae('0x34')]?_0x42df41[_0x55ae('0x33')]:_0x307928['model'];if(_0x2219aa[_0x55ae('0x2f')][_0x55ae('0x45')]){_0x42df41[_0x55ae('0x40')]=[{'all':!![]}];}_0x42df41=_[_0x55ae('0x3b')]({},_0x42df41,_0x2219aa['options']);return db['ServicenowAccount']['find'](_0x42df41)[_0x55ae('0x3f')](handleEntityNotFound(_0x13a4de,null))[_0x55ae('0x3f')](respondWithResult(_0x13a4de,null))[_0x55ae('0x41')](handleError(_0x13a4de,null));};exports[_0x55ae('0x46')]=function(_0x20df84,_0x451922){return db[_0x55ae('0x2a')][_0x55ae('0x46')](_0x20df84[_0x55ae('0x47')],{})['then'](respondWithResult(_0x451922,0xc9))[_0x55ae('0x41')](handleError(_0x451922,null));};exports['update']=function(_0x773884,_0x4e5bcc){if(_0x773884['body']['id']){delete _0x773884[_0x55ae('0x47')]['id'];}return db[_0x55ae('0x2a')][_0x55ae('0x48')]({'where':{'id':_0x773884[_0x55ae('0x43')]['id']}})[_0x55ae('0x3f')](handleEntityNotFound(_0x4e5bcc,null))[_0x55ae('0x3f')](saveUpdates(_0x773884[_0x55ae('0x47')],null))[_0x55ae('0x3f')](respondWithResult(_0x4e5bcc,null))[_0x55ae('0x41')](handleError(_0x4e5bcc,null));};exports[_0x55ae('0x49')]=function(_0x1c37f1,_0x27353f){return db[_0x55ae('0x2a')][_0x55ae('0x48')]({'where':{'id':_0x1c37f1[_0x55ae('0x43')]['id']}})[_0x55ae('0x3f')](handleEntityNotFound(_0x27353f,null))[_0x55ae('0x3f')](removeEntity(_0x27353f,null))[_0x55ae('0x41')](handleError(_0x27353f,null));};exports[_0x55ae('0x4a')]=function(_0x79d15d,_0x468ae4,_0x1d57ea){var _0x4a1a31={};var _0x11ffd5={};var _0xaafb6d;var _0x13836e;return db[_0x55ae('0x2a')][_0x55ae('0x4b')]({'where':{'id':_0x79d15d[_0x55ae('0x43')]['id']}})[_0x55ae('0x3f')](handleEntityNotFound(_0x468ae4,null))[_0x55ae('0x3f')](function(_0x615c07){if(_0x615c07){_0xaafb6d=_0x615c07;_0x11ffd5[_0x55ae('0x2e')]=_[_0x55ae('0x30')](db[_0x55ae('0x4c')]['rawAttributes']);_0x11ffd5['query']=_[_0x55ae('0x30')](_0x79d15d[_0x55ae('0x2f')]);_0x11ffd5[_0x55ae('0x3a')]=_[_0x55ae('0x31')](_0x11ffd5[_0x55ae('0x2e')],_0x11ffd5[_0x55ae('0x2f')]);_0x4a1a31[_0x55ae('0x33')]=_[_0x55ae('0x31')](_0x11ffd5[_0x55ae('0x2e')],qs['fields'](_0x79d15d['query'][_0x55ae('0x32')]));_0x4a1a31[_0x55ae('0x33')]=_0x4a1a31[_0x55ae('0x33')][_0x55ae('0x34')]?_0x4a1a31['attributes']:_0x11ffd5['model'];_0x4a1a31[_0x55ae('0x37')]=qs[_0x55ae('0x38')](_0x79d15d['query'][_0x55ae('0x38')]);_0x4a1a31[_0x55ae('0x39')]=qs[_0x55ae('0x3a')](_[_0x55ae('0x4d')](_0x79d15d[_0x55ae('0x2f')],_0x11ffd5[_0x55ae('0x3a')]));if(_0x79d15d[_0x55ae('0x2f')]['filter']){_0x4a1a31[_0x55ae('0x39')]=_[_0x55ae('0x3b')](_0x4a1a31[_0x55ae('0x39')],{'$or':_[_0x55ae('0x29')](_0x4a1a31[_0x55ae('0x33')],function(_0x426907){var _0x5f2ef1={};_0x5f2ef1[_0x426907]={'$like':'%'+_0x79d15d['query'][_0x55ae('0x3d')]+'%'};return _0x5f2ef1;})});}_0x4a1a31=_[_0x55ae('0x3b')]({},_0x4a1a31,_0x79d15d[_0x55ae('0x3e')]);return _0xaafb6d[_0x55ae('0x4a')](_0x4a1a31);}})[_0x55ae('0x3f')](function(_0x31def5){if(_0x31def5){_0x13836e=_0x31def5[_0x55ae('0x34')];if(!_0x79d15d[_0x55ae('0x2f')][_0x55ae('0x35')](_0x55ae('0x36'))){_0x4a1a31[_0x55ae('0x1d')]=qs[_0x55ae('0x1d')](_0x79d15d['query'][_0x55ae('0x1d')]);_0x4a1a31['offset']=qs[_0x55ae('0x1f')](_0x79d15d[_0x55ae('0x2f')][_0x55ae('0x1f')]);}return _0xaafb6d[_0x55ae('0x4a')](_0x4a1a31);}})[_0x55ae('0x3f')](function(_0x141e80){if(_0x141e80){return _0x141e80?{'count':_0x13836e,'rows':_0x141e80}:null;}})[_0x55ae('0x3f')](respondWithResult(_0x468ae4,null))[_0x55ae('0x41')](handleError(_0x468ae4,null));};exports[_0x55ae('0x4e')]=function(_0x107a28,_0x54f963,_0x470245){if(_0x107a28['body']['id']){delete _0x107a28['body']['id'];}return db[_0x55ae('0x2a')][_0x55ae('0x4b')]({'where':{'id':_0x107a28[_0x55ae('0x43')]['id']}})['then'](handleEntityNotFound(_0x54f963,null))[_0x55ae('0x3f')](function(_0x3e6eec){if(_0x3e6eec){_0x107a28[_0x55ae('0x47')][_0x55ae('0x4f')]=_0x3e6eec['id'];_0x107a28['body'][_0x55ae('0x50')]=integrations[_0x55ae('0x51')](_0x107a28[_0x55ae('0x47')][_0x55ae('0x52')],_0x107a28[_0x55ae('0x47')][_0x55ae('0x2c')]);_0x107a28['body']['Descriptions']=integrations[_0x55ae('0x53')](_0x107a28[_0x55ae('0x47')][_0x55ae('0x52')],_0x107a28[_0x55ae('0x47')]['type']);return db[_0x55ae('0x4c')][_0x55ae('0x46')](_0x107a28['body'],{'include':[{'model':db[_0x55ae('0x54')],'as':_0x55ae('0x50')},{'model':db[_0x55ae('0x54')],'as':_0x55ae('0x55')}]});}return null;})[_0x55ae('0x3f')](respondWithResult(_0x54f963,null))[_0x55ae('0x41')](handleError(_0x54f963,null));};exports['getFields']=function(_0x426b85,_0x224e9f,_0x122c0b){var _0x16038d=['made_sla',_0x55ae('0x56'),_0x55ae('0x57'),_0x55ae('0x58'),_0x55ae('0x59'),_0x55ae('0x5a'),_0x55ae('0x5b'),_0x55ae('0x5c'),_0x55ae('0x5d')];var _0x10417=[_0x55ae('0x5e'),_0x55ae('0x5f'),_0x55ae('0x60'),_0x55ae('0x61'),_0x55ae('0x62'),'sys_updated_on',_0x55ae('0x63'),_0x55ae('0x56'),_0x55ae('0x64'),_0x55ae('0x65'),_0x55ae('0x66'),_0x55ae('0x67'),_0x55ae('0x68'),_0x55ae('0x69'),'sys_created_on',_0x55ae('0x6a'),_0x55ae('0x6b'),'sys_created_by',_0x55ae('0x57'),_0x55ae('0x37'),_0x55ae('0x6c'),_0x55ae('0x6d'),'cmdb_ci',_0x55ae('0x6e'),_0x55ae('0x6f'),'active','work_notes_list',_0x55ae('0x70'),_0x55ae('0x71'),_0x55ae('0x72'),'rfc',_0x55ae('0x73'),_0x55ae('0x74'),'opened_at',_0x55ae('0x75'),_0x55ae('0x76'),'work_end',_0x55ae('0x77'),'resolved_at',_0x55ae('0x78'),_0x55ae('0x79'),'subcategory','work_notes',_0x55ae('0x7a'),_0x55ae('0x59'),_0x55ae('0x7b'),_0x55ae('0x7c'),_0x55ae('0x7d'),_0x55ae('0x7e'),_0x55ae('0x7f'),_0x55ae('0x80'),'description',_0x55ae('0x81'),_0x55ae('0x5a'),_0x55ae('0x82'),_0x55ae('0x83'),_0x55ae('0x84'),_0x55ae('0x85'),_0x55ae('0x86'),_0x55ae('0x87'),_0x55ae('0x88'),_0x55ae('0x89'),_0x55ae('0x5b'),'urgency',_0x55ae('0x8a'),_0x55ae('0x8b'),_0x55ae('0x8c'),'activity_due',_0x55ae('0x8d'),_0x55ae('0x5c'),_0x55ae('0x8e'),'sla_due',_0x55ae('0x8f'),_0x55ae('0x90'),_0x55ae('0x91'),_0x55ae('0x92'),_0x55ae('0x93'),'sys_tags',_0x55ae('0x94'),_0x55ae('0x95'),'correlation_id',_0x55ae('0x96'),_0x55ae('0x5d')];var _0x5a33c1='';var _0x5ac3fd='';var _0x6724c9=[];var _0x175a7f='';var _0x23b69b='';var _0x4d1ba5=[];var _0x21d325='';var _0x3ba357='';var _0x42cec1={};var _0x56345c='';return db[_0x55ae('0x2a')][_0x55ae('0x4b')]({'where':{'id':_0x426b85[_0x55ae('0x43')]['id']},'attributes':['id',_0x55ae('0x97'),'password',_0x55ae('0x98'),_0x55ae('0x99'),'serverUrl']})[_0x55ae('0x3f')](handleEntityNotFound(_0x224e9f,null))['then'](function(_0x346f8a){if(_0x346f8a){_0x56345c=_0x346f8a['remoteUri'];var _0x2c5b62=_0x56345c[_0x55ae('0x9a')](-0x1);if(_0x2c5b62==='/'){_0x56345c=_0x56345c[_0x55ae('0x9b')](0x0,_0x56345c[_0x55ae('0x9c')](_0x2c5b62));}_0x3ba357=util[_0x55ae('0x9d')](_0x55ae('0x9e'),_0x56345c);_0x21d325=util['format'](_0x55ae('0x9f'),_0x56345c);_0x42cec1={'user':_0x346f8a[_0x55ae('0x97')],'pass':_0x346f8a[_0x55ae('0xa0')]};var _0x5f5441={'method':_0x55ae('0xa1'),'uri':_0x3ba357+_0x55ae('0xa2'),'auth':_0x42cec1,'json':!![]};return rp(_0x5f5441);}})[_0x55ae('0x3f')](function(_0x46cf10){if(_0x46cf10['result'][_0x55ae('0x34')]>0x0){_0x5a33c1=_0x46cf10['result'];}console['log'](_0x55ae('0xa3'),_0x5a33c1);_0x4d1ba5=[];_0x5ac3fd=Object[_0x55ae('0xa4')]([],_0x5a33c1);_['remove'](_0x5ac3fd,function(_0x3551a2){return!_0x16038d[_0x55ae('0xa5')](_0x3551a2[_0x55ae('0x27')]);});_0x5ac3fd[_0x55ae('0xa6')](function(_0x38fc5a){var _0x18bf1e=createFieldObject(_0x21d325,_0x42cec1,_0x38fc5a[_0x55ae('0xa7')],_0x38fc5a[_0x55ae('0x27')],_0x38fc5a[_0x55ae('0xa8')],![]);_0x4d1ba5['push'](_0x18bf1e);});return Promise[_0x55ae('0xa9')](_0x4d1ba5);})[_0x55ae('0x3f')](function(_0x56743a){_0x6724c9=_0x56743a;_0x175a7f=Object['assign']([],_0x5a33c1);console[_0x55ae('0xaa')](_0x55ae('0xab'),_0x5a33c1);_['remove'](_0x175a7f,function(_0x9385c8){return _0x10417[_0x55ae('0xa5')](_0x9385c8[_0x55ae('0x27')]);});console['log'](_0x55ae('0xac'),_0x175a7f);_0x4d1ba5=[];_0x175a7f[_0x55ae('0xa6')](function(_0x41018d){var _0x238b97=createFieldObject(_0x21d325,_0x42cec1,_0x41018d[_0x55ae('0xa7')],_0x41018d[_0x55ae('0x27')],_0x41018d[_0x55ae('0xa8')],!![]);_0x4d1ba5[_0x55ae('0xad')](_0x238b97);});return Promise[_0x55ae('0xa9')](_0x4d1ba5);})[_0x55ae('0x3f')](function(_0x204bc5){_0x23b69b=_0x204bc5;var _0x336756=_0x6724c9[_0x55ae('0xae')](_0x23b69b);return{'count':_0x336756[_0x55ae('0x34')],'rows':_0x336756};})[_0x55ae('0x3f')](respondWithResult(_0x224e9f,null))[_0x55ae('0x41')](function(_0x3b5377){console[_0x55ae('0xaa')](_0x55ae('0xaf')+_0x3b5377);var _0x4ad732=_0x426b85[_0x55ae('0x2f')][_0x55ae('0xb0')]?0x1f4:_0x3b5377[_0x55ae('0xb1')]||0x1f4;logger[_0x55ae('0x26')](_0x3b5377[_0x55ae('0xb2')]);delete _0x3b5377[_0x55ae('0x27')];if(_0x4ad732===0x191){_0x4ad732=0x190;}_0x224e9f['status'](_0x4ad732)['send'](_0x426b85['query'][_0x55ae('0xb0')]?{'message':_0x55ae('0xb3'),'statusCode':_0x3b5377[_0x55ae('0xb1')]}:_0x3b5377);});};function createFieldObject(_0x533e82,_0xfb4998,_0x229a0e,_0x4c067e,_0x50762f,_0x38e4eb){return new Promise(function(_0x5de21b,_0x55fa89){var _0x5a48ea={'id':_0x4c067e,'name':_0x50762f,'custom':_0x38e4eb};if(_0x229a0e===_0x55ae('0xb4')){_0x5a48ea[_0x55ae('0x3e')]=[{'name':_0x55ae('0xb5'),'value':_0x55ae('0xb6')},{'name':_0x55ae('0xb7'),'value':'false'}];_0x5de21b(_0x5a48ea);}else{var _0x414cc4={'method':_0x55ae('0xa1'),'uri':_0x533e82+'sys_choice?sysparm_query=name=incident^element='+_0x4c067e,'auth':_0xfb4998,'json':!![]};return rp(_0x414cc4)[_0x55ae('0x3f')](function(_0x43657c){var _0x282df2=[];if(_0x43657c['result']['length']>0x0){_0x43657c[_0x55ae('0xb8')][_0x55ae('0xa6')](function(_0x2338c6){if(_0x2338c6[_0x55ae('0xb9')]==='false'){var _0x370c64={'name':_0x2338c6['label'],'value':_0x2338c6[_0x55ae('0xba')]};_0x282df2[_0x55ae('0xad')](_0x370c64);}});}_0x5a48ea['options']=_0x282df2;if(_0x5a48ea[_0x55ae('0x3e')][_0x55ae('0x34')]>0x0){_0x5de21b(_0x5a48ea);}else{if(_0x38e4eb==![]){_0x5de21b();}else{_0x5de21b(_0x5a48ea);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index c5801b4..c1e4644 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 _0x71ab=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','api','bluebird','request-promise'];(function(_0xb237,_0x86c0ef){var _0x1b2ffb=function(_0x27aed1){while(--_0x27aed1){_0xb237['push'](_0xb237['shift']());}};_0x1b2ffb(++_0x86c0ef);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));var integrations=require(_0xb71a('0x8'));module[_0xb71a('0x9')]=function(_0x22c072,_0x35a84e){return _0x22c072[_0xb71a('0xa')](_0xb71a('0xb'),attributes,{'tableName':_0xb71a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','../../config/logger','api'];(function(_0x460fd7,_0x2012db){var _0x44d1c2=function(_0x545e11){while(--_0x545e11){_0x460fd7['push'](_0x460fd7['shift']());}};_0x44d1c2(++_0x2012db);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x32d788,_0xbaa65e){_0x32d788=_0x32d788-0x0;var _0x1b671a=_0x7fbe[_0x32d788];return _0x1b671a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));var integrations=require(_0xe7fb('0x9'));module[_0xe7fb('0xa')]=function(_0x12d1b0,_0x24cd67){return _0x12d1b0[_0xe7fb('0xb')]('ServicenowAccount',attributes,{'tableName':_0xe7fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 9dd8f6f..36af456 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 _0xfbc8=['include','model','map','ShowServicenowAccount','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit'];(function(_0x818821,_0x1fce3a){var _0x40b7ea=function(_0x3de5b8){while(--_0x3de5b8){_0x818821['push'](_0x818821['shift']());}};_0x40b7ea(++_0x1fce3a);}(_0xfbc8,0x191));var _0x8fbc=function(_0x3fafb9,_0x5d6612){_0x3fafb9=_0x3fafb9-0x0;var _0xada4d4=_0xfbc8[_0x3fafb9];return _0xada4d4;};'use strict';var _=require(_0x8fbc('0x0'));var util=require(_0x8fbc('0x1'));var moment=require(_0x8fbc('0x2'));var BPromise=require(_0x8fbc('0x3'));var rs=require(_0x8fbc('0x4'));var fs=require('fs');var Redis=require(_0x8fbc('0x5'));var db=require(_0x8fbc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8fbc('0x7'))(_0x8fbc('0x8'));var config=require(_0x8fbc('0x9'));var jayson=require(_0x8fbc('0xa'));var client=jayson[_0x8fbc('0xb')][_0x8fbc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46523a,_0x3ed4c8,_0x5c6223){return new BPromise(function(_0x528673,_0x3a90ae){return client[_0x8fbc('0xd')](_0x46523a,_0x5c6223)[_0x8fbc('0xe')](function(_0x515079){logger[_0x8fbc('0xf')](_0x8fbc('0x10'),_0x3ed4c8,_0x8fbc('0x11'));logger[_0x8fbc('0x12')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3ed4c8,_0x8fbc('0x11'),JSON['stringify'](_0x515079));if(_0x515079[_0x8fbc('0x13')]){if(_0x515079['error']['code']===0x1f4){logger['error'](_0x8fbc('0x10'),_0x3ed4c8,_0x515079[_0x8fbc('0x13')][_0x8fbc('0x14')]);return _0x3a90ae(_0x515079['error'][_0x8fbc('0x14')]);}logger[_0x8fbc('0x13')](_0x8fbc('0x10'),_0x3ed4c8,_0x515079[_0x8fbc('0x13')][_0x8fbc('0x14')]);return _0x528673(_0x515079['error'][_0x8fbc('0x14')]);}else{logger[_0x8fbc('0xf')](_0x8fbc('0x10'),_0x3ed4c8,_0x8fbc('0x11'));_0x528673(_0x515079[_0x8fbc('0x15')][_0x8fbc('0x14')]);}})[_0x8fbc('0x16')](function(_0x492dbe){logger[_0x8fbc('0x13')](_0x8fbc('0x10'),_0x3ed4c8,_0x492dbe);_0x3a90ae(_0x492dbe);});});}exports[_0x8fbc('0x17')]=function(_0xaf563){var _0x45f009=this;return new Promise(function(_0x992bbe,_0x452eec){return db[_0x8fbc('0x18')][_0x8fbc('0x19')]({'raw':_0xaf563['options']?_0xaf563[_0x8fbc('0x1a')][_0x8fbc('0x1b')]===undefined?!![]:![]:!![],'where':_0xaf563[_0x8fbc('0x1a')]?_0xaf563['options'][_0x8fbc('0x1c')]||null:null,'attributes':_0xaf563['options']?_0xaf563[_0x8fbc('0x1a')][_0x8fbc('0x1d')]||null:null,'limit':_0xaf563[_0x8fbc('0x1a')]?_0xaf563[_0x8fbc('0x1a')][_0x8fbc('0x1e')]||null:null,'include':_0xaf563[_0x8fbc('0x1a')]?_0xaf563[_0x8fbc('0x1a')][_0x8fbc('0x1f')]?_['map'](_0xaf563['options'][_0x8fbc('0x1f')],function(_0x229cbf){return{'model':db[_0x229cbf[_0x8fbc('0x20')]],'as':_0x229cbf['as'],'attributes':_0x229cbf[_0x8fbc('0x1d')],'include':_0x229cbf[_0x8fbc('0x1f')]?_[_0x8fbc('0x21')](_0x229cbf[_0x8fbc('0x1f')],function(_0x1dd9e0){return{'model':db[_0x1dd9e0['model']],'as':_0x1dd9e0['as'],'attributes':_0x1dd9e0[_0x8fbc('0x1d')],'include':_0x1dd9e0['include']?_[_0x8fbc('0x21')](_0x1dd9e0[_0x8fbc('0x1f')],function(_0x5560a8){return{'model':db[_0x5560a8[_0x8fbc('0x20')]],'as':_0x5560a8['as'],'attributes':_0x5560a8[_0x8fbc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8fbc('0xe')](function(_0x1fea42){logger[_0x8fbc('0xf')](_0x8fbc('0x17'),_0xaf563);logger[_0x8fbc('0x12')](_0x8fbc('0x17'),_0xaf563,JSON['stringify'](_0x1fea42));_0x992bbe(_0x1fea42);})[_0x8fbc('0x16')](function(_0x9a03de){logger['error'](_0x8fbc('0x17'),_0x9a03de[_0x8fbc('0x14')],_0xaf563);_0x452eec(_0x45f009[_0x8fbc('0x13')](0x1f4,_0x9a03de[_0x8fbc('0x14')]));});});};exports[_0x8fbc('0x22')]=function(_0x50fb33){var _0x29bf49=this;return new Promise(function(_0x56cf3f,_0x2db735){return db[_0x8fbc('0x18')]['find']({'raw':_0x50fb33[_0x8fbc('0x1a')]?_0x50fb33['options'][_0x8fbc('0x1b')]===undefined?!![]:![]:!![],'where':_0x50fb33[_0x8fbc('0x1a')]?_0x50fb33['options']['where']||null:null,'attributes':_0x50fb33['options']?_0x50fb33[_0x8fbc('0x1a')][_0x8fbc('0x1d')]||null:null,'include':_0x50fb33[_0x8fbc('0x1a')]?_0x50fb33['options']['include']?_['map'](_0x50fb33[_0x8fbc('0x1a')][_0x8fbc('0x1f')],function(_0x23d6bd){return{'model':db[_0x23d6bd[_0x8fbc('0x20')]],'as':_0x23d6bd['as'],'attributes':_0x23d6bd[_0x8fbc('0x1d')],'include':_0x23d6bd[_0x8fbc('0x1f')]?_[_0x8fbc('0x21')](_0x23d6bd[_0x8fbc('0x1f')],function(_0x1b0944){return{'model':db[_0x1b0944['model']],'as':_0x1b0944['as'],'attributes':_0x1b0944[_0x8fbc('0x1d')],'include':_0x1b0944[_0x8fbc('0x1f')]?_['map'](_0x1b0944[_0x8fbc('0x1f')],function(_0x57d6dc){return{'model':db[_0x57d6dc[_0x8fbc('0x20')]],'as':_0x57d6dc['as'],'attributes':_0x57d6dc[_0x8fbc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8fbc('0xe')](function(_0x5a8421){logger[_0x8fbc('0xf')](_0x8fbc('0x22'),_0x50fb33);logger[_0x8fbc('0x12')](_0x8fbc('0x22'),_0x50fb33,JSON[_0x8fbc('0x23')](_0x5a8421));_0x56cf3f(_0x5a8421);})[_0x8fbc('0x16')](function(_0x1ce226){logger['error'](_0x8fbc('0x22'),_0x1ce226[_0x8fbc('0x14')],_0x50fb33);_0x2db735(_0x29bf49[_0x8fbc('0x13')](0x1f4,_0x1ce226[_0x8fbc('0x14')]));});});}; \ No newline at end of file +var _0x8cc3=['ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetServicenowAccount','findAll','options','raw','attributes','include','map','model','catch','ShowServicenowAccount','ServicenowAccount','find','lodash','util','moment','randomstring','ioredis','../../config/utils','jayson/promise','then','info','ServicenowAccount,\x20%s,\x20%s'];(function(_0x164248,_0x520809){var _0x54e65a=function(_0xbe082d){while(--_0xbe082d){_0x164248['push'](_0x164248['shift']());}};_0x54e65a(++_0x520809);}(_0x8cc3,0x1b6));var _0x38cc=function(_0x14269e,_0x2e9991){_0x14269e=_0x14269e-0x0;var _0x251b2a=_0x8cc3[_0x14269e];return _0x251b2a;};'use strict';var _=require(_0x38cc('0x0'));var util=require(_0x38cc('0x1'));var moment=require(_0x38cc('0x2'));var BPromise=require('bluebird');var rs=require(_0x38cc('0x3'));var fs=require('fs');var Redis=require(_0x38cc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x38cc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x38cc('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x409f97,_0xe12c0c,_0x8eb24){return new BPromise(function(_0x17c3cf,_0x4ad419){return client['request'](_0x409f97,_0x8eb24)[_0x38cc('0x7')](function(_0xfa18ff){logger[_0x38cc('0x8')](_0x38cc('0x9'),_0xe12c0c,'request\x20sent');logger['debug'](_0x38cc('0xa'),_0xe12c0c,'request\x20sent',JSON[_0x38cc('0xb')](_0xfa18ff));if(_0xfa18ff[_0x38cc('0xc')]){if(_0xfa18ff['error'][_0x38cc('0xd')]===0x1f4){logger[_0x38cc('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0xe12c0c,_0xfa18ff[_0x38cc('0xc')][_0x38cc('0xe')]);return _0x4ad419(_0xfa18ff[_0x38cc('0xc')][_0x38cc('0xe')]);}logger[_0x38cc('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0xe12c0c,_0xfa18ff[_0x38cc('0xc')][_0x38cc('0xe')]);return _0x17c3cf(_0xfa18ff[_0x38cc('0xc')][_0x38cc('0xe')]);}else{logger[_0x38cc('0x8')](_0x38cc('0x9'),_0xe12c0c,'request\x20sent');_0x17c3cf(_0xfa18ff[_0x38cc('0xf')][_0x38cc('0xe')]);}})['catch'](function(_0x15a6db){logger['error'](_0x38cc('0x9'),_0xe12c0c,_0x15a6db);_0x4ad419(_0x15a6db);});});}exports[_0x38cc('0x10')]=function(_0x2782a0){var _0x567adb=this;return new Promise(function(_0x4ee9a8,_0x3c6212){return db['ServicenowAccount'][_0x38cc('0x11')]({'raw':_0x2782a0[_0x38cc('0x12')]?_0x2782a0[_0x38cc('0x12')][_0x38cc('0x13')]===undefined?!![]:![]:!![],'where':_0x2782a0[_0x38cc('0x12')]?_0x2782a0[_0x38cc('0x12')]['where']||null:null,'attributes':_0x2782a0[_0x38cc('0x12')]?_0x2782a0[_0x38cc('0x12')][_0x38cc('0x14')]||null:null,'limit':_0x2782a0[_0x38cc('0x12')]?_0x2782a0[_0x38cc('0x12')]['limit']||null:null,'include':_0x2782a0[_0x38cc('0x12')]?_0x2782a0[_0x38cc('0x12')][_0x38cc('0x15')]?_[_0x38cc('0x16')](_0x2782a0[_0x38cc('0x12')][_0x38cc('0x15')],function(_0x1a2a4f){return{'model':db[_0x1a2a4f[_0x38cc('0x17')]],'as':_0x1a2a4f['as'],'attributes':_0x1a2a4f['attributes'],'include':_0x1a2a4f[_0x38cc('0x15')]?_['map'](_0x1a2a4f[_0x38cc('0x15')],function(_0xa69881){return{'model':db[_0xa69881[_0x38cc('0x17')]],'as':_0xa69881['as'],'attributes':_0xa69881['attributes'],'include':_0xa69881[_0x38cc('0x15')]?_[_0x38cc('0x16')](_0xa69881[_0x38cc('0x15')],function(_0x7e6ad2){return{'model':db[_0x7e6ad2[_0x38cc('0x17')]],'as':_0x7e6ad2['as'],'attributes':_0x7e6ad2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x19b0ca){logger[_0x38cc('0x8')](_0x38cc('0x10'),_0x2782a0);logger['debug'](_0x38cc('0x10'),_0x2782a0,JSON[_0x38cc('0xb')](_0x19b0ca));_0x4ee9a8(_0x19b0ca);})[_0x38cc('0x18')](function(_0x12643c){logger['error'](_0x38cc('0x10'),_0x12643c[_0x38cc('0xe')],_0x2782a0);_0x3c6212(_0x567adb[_0x38cc('0xc')](0x1f4,_0x12643c[_0x38cc('0xe')]));});});};exports[_0x38cc('0x19')]=function(_0x393516){var _0x22ae01=this;return new Promise(function(_0x6aebd,_0x338999){return db[_0x38cc('0x1a')][_0x38cc('0x1b')]({'raw':_0x393516['options']?_0x393516[_0x38cc('0x12')][_0x38cc('0x13')]===undefined?!![]:![]:!![],'where':_0x393516[_0x38cc('0x12')]?_0x393516[_0x38cc('0x12')]['where']||null:null,'attributes':_0x393516['options']?_0x393516[_0x38cc('0x12')][_0x38cc('0x14')]||null:null,'include':_0x393516['options']?_0x393516[_0x38cc('0x12')][_0x38cc('0x15')]?_[_0x38cc('0x16')](_0x393516['options']['include'],function(_0x5e2964){return{'model':db[_0x5e2964[_0x38cc('0x17')]],'as':_0x5e2964['as'],'attributes':_0x5e2964['attributes'],'include':_0x5e2964[_0x38cc('0x15')]?_[_0x38cc('0x16')](_0x5e2964[_0x38cc('0x15')],function(_0x4ff1e0){return{'model':db[_0x4ff1e0[_0x38cc('0x17')]],'as':_0x4ff1e0['as'],'attributes':_0x4ff1e0[_0x38cc('0x14')],'include':_0x4ff1e0[_0x38cc('0x15')]?_[_0x38cc('0x16')](_0x4ff1e0['include'],function(_0x1b160d){return{'model':db[_0x1b160d['model']],'as':_0x1b160d['as'],'attributes':_0x1b160d[_0x38cc('0x14')]};}):[]};}):[]};}):[]:[]})[_0x38cc('0x7')](function(_0x40bdcf){logger[_0x38cc('0x8')](_0x38cc('0x19'),_0x393516);logger['debug']('ShowServicenowAccount',_0x393516,JSON['stringify'](_0x40bdcf));_0x6aebd(_0x40bdcf);})[_0x38cc('0x18')](function(_0x1a75d6){logger[_0x38cc('0xc')](_0x38cc('0x19'),_0x1a75d6[_0x38cc('0xe')],_0x393516);_0x338999(_0x22ae01[_0x38cc('0xc')](0x1f4,_0x1a75d6[_0x38cc('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 8ffa55f..7a446f1 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 _0x53af=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','put','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x37f79c,_0x38f023){var _0x3e8566=function(_0xc347c5){while(--_0xc347c5){_0x37f79c['push'](_0x37f79c['shift']());}};_0x3e8566(++_0x38f023);}(_0x53af,0x11c));var _0xf53a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x53af[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xf53a('0x0'));var util=require(_0xf53a('0x1'));var path=require('path');var timeout=require(_0xf53a('0x2'));var express=require(_0xf53a('0x3'));var router=express[_0xf53a('0x4')]();var fs_extra=require(_0xf53a('0x5'));var auth=require(_0xf53a('0x6'));var interaction=require(_0xf53a('0x7'));var config=require(_0xf53a('0x8'));var controller=require(_0xf53a('0x9'));router[_0xf53a('0xa')]('/',auth[_0xf53a('0xb')](),controller[_0xf53a('0xc')]);router[_0xf53a('0xa')](_0xf53a('0xd'),auth['isAuthenticated'](),controller[_0xf53a('0xe')]);router[_0xf53a('0xa')](_0xf53a('0xf'),auth[_0xf53a('0xb')](),controller[_0xf53a('0x10')]);router['get'](_0xf53a('0x11'),auth['isAuthenticated'](),controller[_0xf53a('0x12')]);router[_0xf53a('0xa')](_0xf53a('0x13'),auth[_0xf53a('0xb')](),controller['getDescriptions']);router['post']('/',auth[_0xf53a('0xb')](),controller['create']);router[_0xf53a('0x14')](_0xf53a('0xd'),auth[_0xf53a('0xb')](),controller[_0xf53a('0x15')]);router[_0xf53a('0x16')](_0xf53a('0xd'),auth[_0xf53a('0xb')](),controller['destroy']);module[_0xf53a('0x17')]=router; \ No newline at end of file +var _0x65c4=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0x65c4,0x1e2));var _0x465c=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x65c4[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x465c('0x0'));var util=require(_0x465c('0x1'));var path=require(_0x465c('0x2'));var timeout=require(_0x465c('0x3'));var express=require(_0x465c('0x4'));var router=express['Router']();var fs_extra=require(_0x465c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x465c('0x6'));var config=require(_0x465c('0x7'));var controller=require(_0x465c('0x8'));router[_0x465c('0x9')]('/',auth['isAuthenticated'](),controller[_0x465c('0xa')]);router[_0x465c('0x9')](_0x465c('0xb'),auth[_0x465c('0xc')](),controller[_0x465c('0xd')]);router[_0x465c('0x9')]('/:id/fields',auth[_0x465c('0xc')](),controller['getFields']);router['get'](_0x465c('0xe'),auth['isAuthenticated'](),controller[_0x465c('0xf')]);router[_0x465c('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x465c('0x10')]);router[_0x465c('0x11')]('/',auth[_0x465c('0xc')](),controller[_0x465c('0x12')]);router[_0x465c('0x13')](_0x465c('0xb'),auth[_0x465c('0xc')](),controller[_0x465c('0x14')]);router[_0x465c('0x15')](_0x465c('0xb'),auth[_0x465c('0xc')](),controller[_0x465c('0x16')]);module[_0x465c('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index dce68c5..9fd0178 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 _0xca1f=['STRING','exports'];(function(_0x261286,_0x39de6e){var _0x2362b4=function(_0xcd093f){while(--_0xcd093f){_0x261286['push'](_0x261286['shift']());}};_0x2362b4(++_0x39de6e);}(_0xca1f,0x1e3));var _0xfca1=function(_0x434941,_0x4f3659){_0x434941=_0x434941-0x0;var _0x1f0301=_0xca1f[_0x434941];return _0x1f0301;};'use strict';var Sequelize=require('sequelize');module[_0xfca1('0x0')]={'name':{'type':Sequelize[_0xfca1('0x1')]},'description':{'type':Sequelize[_0xfca1('0x1')]}}; \ No newline at end of file +var _0x8626=['sequelize','exports','STRING'];(function(_0x267509,_0x43a69f){var _0x3ea295=function(_0x40b16e){while(--_0x40b16e){_0x267509['push'](_0x267509['shift']());}};_0x3ea295(++_0x43a69f);}(_0x8626,0x1ec));var _0x6862=function(_0x2b469f,_0x108903){_0x2b469f=_0x2b469f-0x0;var _0x3da4c=_0x8626[_0x2b469f];return _0x3da4c;};'use strict';var Sequelize=require(_0x6862('0x0'));module[_0x6862('0x1')]={'name':{'type':Sequelize[_0x6862('0x2')]},'description':{'type':Sequelize[_0x6862('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index d8f7f87..9b39d94 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 _0x207d=['sort','where','filter','merge','VIRTUAL','options','findAll','show','includeAll','include','find','create','body','catch','params','getFields','ServicenowField','pick','hasOwnProperty','getSubjects','findOne','order','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit'];(function(_0x1f9804,_0x1ae807){var _0x2f202f=function(_0x10349b){while(--_0x10349b){_0x1f9804['push'](_0x1f9804['shift']());}};_0x2f202f(++_0x1ae807);}(_0x207d,0x1f0));var _0xd207=function(_0x3017d2,_0x1ed799){_0x3017d2=_0x3017d2-0x0;var _0x451570=_0x207d[_0x3017d2];return _0x451570;};'use strict';var emlformat=require(_0xd207('0x0'));var rimraf=require(_0xd207('0x1'));var zipdir=require(_0xd207('0x2'));var jsonpatch=require(_0xd207('0x3'));var rp=require('request-promise');var moment=require(_0xd207('0x4'));var BPromise=require(_0xd207('0x5'));var Mustache=require(_0xd207('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd207('0x7'));var csv=require(_0xd207('0x8'));var ejs=require(_0xd207('0x9'));var fs=require('fs');var fs_extra=require(_0xd207('0xa'));var _=require(_0xd207('0xb'));var squel=require(_0xd207('0xc'));var crypto=require(_0xd207('0xd'));var jsforce=require(_0xd207('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd207('0x8'));var querystring=require(_0xd207('0xf'));var Papa=require(_0xd207('0x10'));var Redis=require('ioredis');var authService=require(_0xd207('0x11'));var qs=require(_0xd207('0x12'));var as=require(_0xd207('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd207('0x14'))(_0xd207('0x15'));var utils=require('../../config/utils');var config=require(_0xd207('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd207('0x17'))['db'];function respondWithStatusCode(_0x1fcbd9,_0x3da9fb){_0x3da9fb=_0x3da9fb||0xcc;return function(_0x58ff77){if(_0x58ff77){return _0x1fcbd9[_0xd207('0x18')](_0x3da9fb);}return _0x1fcbd9['status'](_0x3da9fb)[_0xd207('0x19')]();};}function respondWithResult(_0x4d6e87,_0xec33fd){_0xec33fd=_0xec33fd||0xc8;return function(_0x205e1d){if(_0x205e1d){return _0x4d6e87[_0xd207('0x1a')](_0xec33fd)['json'](_0x205e1d);}};}function respondWithFilteredResult(_0x4a6fc9,_0x1abd83){return function(_0x2e9a8a){if(_0x2e9a8a){var _0x3c6b05=typeof _0x1abd83['offset']===_0xd207('0x1b')&&typeof _0x1abd83['limit']===_0xd207('0x1b');var _0x2b1cc8=_0x2e9a8a[_0xd207('0x1c')];var _0x50a10f=_0x3c6b05?0x0:_0x1abd83[_0xd207('0x1d')];var _0x531ba0=_0x3c6b05?_0x2e9a8a[_0xd207('0x1c')]:_0x1abd83[_0xd207('0x1d')]+_0x1abd83['limit'];var _0x34cbb2;if(_0x531ba0>=_0x2b1cc8){_0x531ba0=_0x2b1cc8;_0x34cbb2=0xc8;}else{_0x34cbb2=0xce;}_0x4a6fc9[_0xd207('0x1a')](_0x34cbb2);return _0x4a6fc9[_0xd207('0x1e')](_0xd207('0x1f'),_0x50a10f+'-'+_0x531ba0+'/'+_0x2b1cc8)[_0xd207('0x20')](_0x2e9a8a);}return null;};}function patchUpdates(_0x3a33dc){return function(_0x432536){try{jsonpatch[_0xd207('0x21')](_0x432536,_0x3a33dc,!![]);}catch(_0x52127d){return BPromise[_0xd207('0x22')](_0x52127d);}return _0x432536['save']();};}function saveUpdates(_0x1c7761,_0x27e8a3){return function(_0x1c76cd){if(_0x1c76cd){return _0x1c76cd[_0xd207('0x23')](_0x1c7761)[_0xd207('0x24')](function(_0x5ac3d1){return _0x5ac3d1;});}return null;};}function removeEntity(_0xa668a1,_0x2ddd17){return function(_0x29503b){if(_0x29503b){return _0x29503b[_0xd207('0x25')]()[_0xd207('0x24')](function(){_0xa668a1[_0xd207('0x1a')](0xcc)[_0xd207('0x19')]();});}};}function handleEntityNotFound(_0x52f61c,_0x5b7fbd){return function(_0x55dbfe){if(!_0x55dbfe){_0x52f61c[_0xd207('0x18')](0x194);}return _0x55dbfe;};}function handleError(_0x4e1b67,_0x27d3c0){_0x27d3c0=_0x27d3c0||0x1f4;return function(_0x29d248){logger[_0xd207('0x26')](_0x29d248[_0xd207('0x27')]);if(_0x29d248[_0xd207('0x28')]){delete _0x29d248[_0xd207('0x28')];}_0x4e1b67[_0xd207('0x1a')](_0x27d3c0)[_0xd207('0x29')](_0x29d248);};}exports[_0xd207('0x2a')]=function(_0x2ded26,_0x412d23){var _0x3adaa9={},_0x25a98e={},_0x175d73={'count':0x0,'rows':[]};var _0x54f818=_[_0xd207('0x2b')](db[_0xd207('0x2c')][_0xd207('0x2d')],function(_0x7c4328){return{'name':_0x7c4328[_0xd207('0x2e')],'type':_0x7c4328['type']['key']};});_0x25a98e[_0xd207('0x2f')]=_[_0xd207('0x2b')](_0x54f818,_0xd207('0x28'));_0x25a98e[_0xd207('0x30')]=_[_0xd207('0x31')](_0x2ded26[_0xd207('0x30')]);_0x25a98e[_0xd207('0x32')]=_[_0xd207('0x33')](_0x25a98e[_0xd207('0x2f')],_0x25a98e[_0xd207('0x30')]);_0x3adaa9[_0xd207('0x34')]=_['intersection'](_0x25a98e[_0xd207('0x2f')],qs[_0xd207('0x35')](_0x2ded26[_0xd207('0x30')][_0xd207('0x35')]));_0x3adaa9['attributes']=_0x3adaa9['attributes'][_0xd207('0x36')]?_0x3adaa9['attributes']:_0x25a98e[_0xd207('0x2f')];if(!_0x2ded26[_0xd207('0x30')]['hasOwnProperty'](_0xd207('0x37'))){_0x3adaa9['limit']=qs[_0xd207('0x38')](_0x2ded26[_0xd207('0x30')][_0xd207('0x38')]);_0x3adaa9[_0xd207('0x1d')]=qs['offset'](_0x2ded26[_0xd207('0x30')][_0xd207('0x1d')]);}_0x3adaa9['order']=qs[_0xd207('0x39')](_0x2ded26[_0xd207('0x30')][_0xd207('0x39')]);_0x3adaa9[_0xd207('0x3a')]=qs[_0xd207('0x32')](_['pick'](_0x2ded26[_0xd207('0x30')],_0x25a98e[_0xd207('0x32')]),_0x54f818);if(_0x2ded26[_0xd207('0x30')][_0xd207('0x3b')]){_0x3adaa9[_0xd207('0x3a')]=_[_0xd207('0x3c')](_0x3adaa9['where'],{'$or':_['map'](_0x54f818,function(_0x298b0d){if(_0x298b0d['type']!==_0xd207('0x3d')){var _0x568f60={};_0x568f60[_0x298b0d[_0xd207('0x28')]]={'$like':'%'+_0x2ded26['query']['filter']+'%'};return _0x568f60;}})});}_0x3adaa9=_[_0xd207('0x3c')]({},_0x3adaa9,_0x2ded26[_0xd207('0x3e')]);var _0x64f2be={'where':_0x3adaa9[_0xd207('0x3a')]};return db[_0xd207('0x2c')][_0xd207('0x1c')](_0x64f2be)[_0xd207('0x24')](function(_0x2f859c){_0x175d73['count']=_0x2f859c;if(_0x2ded26[_0xd207('0x30')]['includeAll']){_0x3adaa9['include']=[{'all':!![]}];}return db[_0xd207('0x2c')][_0xd207('0x3f')](_0x3adaa9);})[_0xd207('0x24')](function(_0x4c2b85){_0x175d73['rows']=_0x4c2b85;return _0x175d73;})[_0xd207('0x24')](respondWithFilteredResult(_0x412d23,_0x3adaa9))['catch'](handleError(_0x412d23,null));};exports[_0xd207('0x40')]=function(_0x2a419c,_0x3d80d4){var _0x43256d={'raw':![],'where':{'id':_0x2a419c['params']['id']}},_0x2c8d02={};_0x2c8d02[_0xd207('0x2f')]=_[_0xd207('0x31')](db[_0xd207('0x2c')][_0xd207('0x2d')]);_0x2c8d02[_0xd207('0x30')]=_[_0xd207('0x31')](_0x2a419c[_0xd207('0x30')]);_0x2c8d02[_0xd207('0x32')]=_[_0xd207('0x33')](_0x2c8d02[_0xd207('0x2f')],_0x2c8d02[_0xd207('0x30')]);_0x43256d[_0xd207('0x34')]=_['intersection'](_0x2c8d02['model'],qs[_0xd207('0x35')](_0x2a419c[_0xd207('0x30')][_0xd207('0x35')]));_0x43256d[_0xd207('0x34')]=_0x43256d[_0xd207('0x34')][_0xd207('0x36')]?_0x43256d[_0xd207('0x34')]:_0x2c8d02[_0xd207('0x2f')];if(_0x2a419c[_0xd207('0x30')][_0xd207('0x41')]){_0x43256d[_0xd207('0x42')]=[{'all':!![]}];}_0x43256d=_['merge']({},_0x43256d,_0x2a419c[_0xd207('0x3e')]);return db[_0xd207('0x2c')][_0xd207('0x43')](_0x43256d)[_0xd207('0x24')](handleEntityNotFound(_0x3d80d4,null))[_0xd207('0x24')](respondWithResult(_0x3d80d4,null))['catch'](handleError(_0x3d80d4,null));};exports[_0xd207('0x44')]=function(_0x3720fc,_0x664760){return db[_0xd207('0x2c')][_0xd207('0x44')](_0x3720fc[_0xd207('0x45')],{})['then'](respondWithResult(_0x664760,0xc9))[_0xd207('0x46')](handleError(_0x664760,null));};exports['update']=function(_0x200d07,_0xd2fdb7){if(_0x200d07[_0xd207('0x45')]['id']){delete _0x200d07[_0xd207('0x45')]['id'];}return db[_0xd207('0x2c')][_0xd207('0x43')]({'where':{'id':_0x200d07[_0xd207('0x47')]['id']}})[_0xd207('0x24')](handleEntityNotFound(_0xd2fdb7,null))['then'](saveUpdates(_0x200d07['body'],null))[_0xd207('0x24')](respondWithResult(_0xd2fdb7,null))[_0xd207('0x46')](handleError(_0xd2fdb7,null));};exports['destroy']=function(_0x12f5d0,_0x39873f){return db[_0xd207('0x2c')][_0xd207('0x43')]({'where':{'id':_0x12f5d0[_0xd207('0x47')]['id']}})['then'](handleEntityNotFound(_0x39873f,null))[_0xd207('0x24')](removeEntity(_0x39873f,null))[_0xd207('0x46')](handleError(_0x39873f,null));};exports[_0xd207('0x48')]=function(_0x2a9723,_0x2328ce,_0xc5f286){var _0x36e1e4={};var _0x58f819={};var _0x4c360c;var _0xf89f3d;return db[_0xd207('0x2c')]['findOne']({'where':{'id':_0x2a9723[_0xd207('0x47')]['id']}})['then'](handleEntityNotFound(_0x2328ce,null))[_0xd207('0x24')](function(_0x501488){if(_0x501488){_0x4c360c=_0x501488;_0x58f819[_0xd207('0x2f')]=_['keys'](db[_0xd207('0x49')][_0xd207('0x2d')]);_0x58f819[_0xd207('0x30')]=_[_0xd207('0x31')](_0x2a9723['query']);_0x58f819[_0xd207('0x32')]=_['intersection'](_0x58f819[_0xd207('0x2f')],_0x58f819['query']);_0x36e1e4[_0xd207('0x34')]=_['intersection'](_0x58f819['model'],qs[_0xd207('0x35')](_0x2a9723[_0xd207('0x30')]['fields']));_0x36e1e4['attributes']=_0x36e1e4[_0xd207('0x34')][_0xd207('0x36')]?_0x36e1e4[_0xd207('0x34')]:_0x58f819['model'];_0x36e1e4['order']=qs[_0xd207('0x39')](_0x2a9723[_0xd207('0x30')]['sort']);_0x36e1e4[_0xd207('0x3a')]=qs[_0xd207('0x32')](_[_0xd207('0x4a')](_0x2a9723[_0xd207('0x30')],_0x58f819[_0xd207('0x32')]));if(_0x2a9723[_0xd207('0x30')]['filter']){_0x36e1e4[_0xd207('0x3a')]=_['merge'](_0x36e1e4['where'],{'$or':_[_0xd207('0x2b')](_0x36e1e4[_0xd207('0x34')],function(_0x16fbf7){var _0x2c3b79={};_0x2c3b79[_0x16fbf7]={'$like':'%'+_0x2a9723[_0xd207('0x30')]['filter']+'%'};return _0x2c3b79;})});}_0x36e1e4=_['merge']({},_0x36e1e4,_0x2a9723[_0xd207('0x3e')]);return _0x4c360c[_0xd207('0x48')](_0x36e1e4);}})[_0xd207('0x24')](function(_0x25e5fd){if(_0x25e5fd){_0xf89f3d=_0x25e5fd[_0xd207('0x36')];if(!_0x2a9723[_0xd207('0x30')][_0xd207('0x4b')](_0xd207('0x37'))){_0x36e1e4['limit']=qs[_0xd207('0x38')](_0x2a9723[_0xd207('0x30')][_0xd207('0x38')]);_0x36e1e4[_0xd207('0x1d')]=qs[_0xd207('0x1d')](_0x2a9723[_0xd207('0x30')][_0xd207('0x1d')]);}return _0x4c360c['getFields'](_0x36e1e4);}})[_0xd207('0x24')](function(_0x2c027b){if(_0x2c027b){return _0x2c027b?{'count':_0xf89f3d,'rows':_0x2c027b}:null;}})[_0xd207('0x24')](respondWithResult(_0x2328ce,null))[_0xd207('0x46')](handleError(_0x2328ce,null));};exports[_0xd207('0x4c')]=function(_0x3d6687,_0x43e80f,_0x240fed){var _0x4399ec={};var _0x4ec148={};var _0xf7210c;var _0x801d1f;return db['ServicenowConfiguration'][_0xd207('0x4d')]({'where':{'id':_0x3d6687[_0xd207('0x47')]['id']}})[_0xd207('0x24')](handleEntityNotFound(_0x43e80f,null))[_0xd207('0x24')](function(_0x51f2fe){if(_0x51f2fe){_0xf7210c=_0x51f2fe;_0x4ec148[_0xd207('0x2f')]=_['keys'](db[_0xd207('0x49')][_0xd207('0x2d')]);_0x4ec148['query']=_[_0xd207('0x31')](_0x3d6687[_0xd207('0x30')]);_0x4ec148[_0xd207('0x32')]=_[_0xd207('0x33')](_0x4ec148[_0xd207('0x2f')],_0x4ec148[_0xd207('0x30')]);_0x4399ec[_0xd207('0x34')]=_['intersection'](_0x4ec148[_0xd207('0x2f')],qs[_0xd207('0x35')](_0x3d6687[_0xd207('0x30')][_0xd207('0x35')]));_0x4399ec[_0xd207('0x34')]=_0x4399ec[_0xd207('0x34')]['length']?_0x4399ec[_0xd207('0x34')]:_0x4ec148['model'];_0x4399ec[_0xd207('0x4e')]=qs[_0xd207('0x39')](_0x3d6687['query'][_0xd207('0x39')]);_0x4399ec[_0xd207('0x3a')]=qs[_0xd207('0x32')](_[_0xd207('0x4a')](_0x3d6687[_0xd207('0x30')],_0x4ec148[_0xd207('0x32')]));if(_0x3d6687[_0xd207('0x30')]['filter']){_0x4399ec[_0xd207('0x3a')]=_[_0xd207('0x3c')](_0x4399ec[_0xd207('0x3a')],{'$or':_['map'](_0x4399ec[_0xd207('0x34')],function(_0x50fdb9){var _0x2a5c23={};_0x2a5c23[_0x50fdb9]={'$like':'%'+_0x3d6687[_0xd207('0x30')][_0xd207('0x3b')]+'%'};return _0x2a5c23;})});}_0x4399ec=_[_0xd207('0x3c')]({},_0x4399ec,_0x3d6687['options']);return _0xf7210c[_0xd207('0x4c')](_0x4399ec);}})[_0xd207('0x24')](function(_0x3911c1){if(_0x3911c1){_0x801d1f=_0x3911c1[_0xd207('0x36')];if(!_0x3d6687[_0xd207('0x30')][_0xd207('0x4b')](_0xd207('0x37'))){_0x4399ec['limit']=qs[_0xd207('0x38')](_0x3d6687[_0xd207('0x30')][_0xd207('0x38')]);_0x4399ec['offset']=qs[_0xd207('0x1d')](_0x3d6687[_0xd207('0x30')][_0xd207('0x1d')]);}return _0xf7210c[_0xd207('0x4c')](_0x4399ec);}})[_0xd207('0x24')](function(_0x2bb459){if(_0x2bb459){return _0x2bb459?{'count':_0x801d1f,'rows':_0x2bb459}:null;}})['then'](respondWithResult(_0x43e80f,null))[_0xd207('0x46')](handleError(_0x43e80f,null));};exports['getDescriptions']=function(_0x288bdc,_0x145628,_0x4d10b7){var _0x4d0711={};var _0x515aeb={};var _0x46894b;var _0x4caa69;return db[_0xd207('0x2c')][_0xd207('0x4d')]({'where':{'id':_0x288bdc[_0xd207('0x47')]['id']}})['then'](handleEntityNotFound(_0x145628,null))[_0xd207('0x24')](function(_0x22e43a){if(_0x22e43a){_0x46894b=_0x22e43a;_0x515aeb[_0xd207('0x2f')]=_[_0xd207('0x31')](db['ServicenowField'][_0xd207('0x2d')]);_0x515aeb[_0xd207('0x30')]=_['keys'](_0x288bdc[_0xd207('0x30')]);_0x515aeb[_0xd207('0x32')]=_[_0xd207('0x33')](_0x515aeb[_0xd207('0x2f')],_0x515aeb[_0xd207('0x30')]);_0x4d0711[_0xd207('0x34')]=_[_0xd207('0x33')](_0x515aeb[_0xd207('0x2f')],qs[_0xd207('0x35')](_0x288bdc[_0xd207('0x30')]['fields']));_0x4d0711[_0xd207('0x34')]=_0x4d0711[_0xd207('0x34')][_0xd207('0x36')]?_0x4d0711[_0xd207('0x34')]:_0x515aeb[_0xd207('0x2f')];_0x4d0711['order']=qs[_0xd207('0x39')](_0x288bdc['query'][_0xd207('0x39')]);_0x4d0711[_0xd207('0x3a')]=qs[_0xd207('0x32')](_[_0xd207('0x4a')](_0x288bdc[_0xd207('0x30')],_0x515aeb[_0xd207('0x32')]));if(_0x288bdc[_0xd207('0x30')][_0xd207('0x3b')]){_0x4d0711['where']=_['merge'](_0x4d0711[_0xd207('0x3a')],{'$or':_[_0xd207('0x2b')](_0x4d0711[_0xd207('0x34')],function(_0x1fce8f){var _0x3a6eff={};_0x3a6eff[_0x1fce8f]={'$like':'%'+_0x288bdc[_0xd207('0x30')]['filter']+'%'};return _0x3a6eff;})});}_0x4d0711=_['merge']({},_0x4d0711,_0x288bdc[_0xd207('0x3e')]);return _0x46894b['getDescriptions'](_0x4d0711);}})[_0xd207('0x24')](function(_0x373be4){if(_0x373be4){_0x4caa69=_0x373be4['length'];if(!_0x288bdc['query']['hasOwnProperty'](_0xd207('0x37'))){_0x4d0711[_0xd207('0x38')]=qs[_0xd207('0x38')](_0x288bdc['query'][_0xd207('0x38')]);_0x4d0711[_0xd207('0x1d')]=qs[_0xd207('0x1d')](_0x288bdc['query']['offset']);}return _0x46894b['getDescriptions'](_0x4d0711);}})[_0xd207('0x24')](function(_0x3561c5){if(_0x3561c5){return _0x3561c5?{'count':_0x4caa69,'rows':_0x3561c5}:null;}})[_0xd207('0x24')](respondWithResult(_0x145628,null))[_0xd207('0x46')](handleError(_0x145628,null));}; \ No newline at end of file +var _0x43ce=['show','params','rawAttributes','includeAll','create','body','find','destroy','getFields','ServicenowField','pick','findOne','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','ServicenowConfiguration','fieldName','type','key','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x46ae87,_0x4bd053){var _0x303fcc=function(_0xf522b9){while(--_0xf522b9){_0x46ae87['push'](_0x46ae87['shift']());}};_0x303fcc(++_0x4bd053);}(_0x43ce,0x64));var _0xe43c=function(_0x39a12c,_0x1c2f25){_0x39a12c=_0x39a12c-0x0;var _0x4b7ffb=_0x43ce[_0x39a12c];return _0x4b7ffb;};'use strict';var emlformat=require(_0xe43c('0x0'));var rimraf=require(_0xe43c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe43c('0x2'));var rp=require(_0xe43c('0x3'));var moment=require(_0xe43c('0x4'));var BPromise=require(_0xe43c('0x5'));var Mustache=require(_0xe43c('0x6'));var util=require(_0xe43c('0x7'));var path=require(_0xe43c('0x8'));var sox=require(_0xe43c('0x9'));var csv=require(_0xe43c('0xa'));var ejs=require(_0xe43c('0xb'));var fs=require('fs');var fs_extra=require(_0xe43c('0xc'));var _=require(_0xe43c('0xd'));var squel=require(_0xe43c('0xe'));var crypto=require(_0xe43c('0xf'));var jsforce=require(_0xe43c('0x10'));var deskjs=require(_0xe43c('0x11'));var toCsv=require(_0xe43c('0xa'));var querystring=require(_0xe43c('0x12'));var Papa=require(_0xe43c('0x13'));var Redis=require(_0xe43c('0x14'));var authService=require(_0xe43c('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xe43c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe43c('0x17'))(_0xe43c('0x18'));var utils=require(_0xe43c('0x19'));var config=require(_0xe43c('0x1a'));var licenseUtil=require(_0xe43c('0x1b'));var db=require(_0xe43c('0x1c'))['db'];function respondWithStatusCode(_0x57a3cc,_0xcd8012){_0xcd8012=_0xcd8012||0xcc;return function(_0x4ae886){if(_0x4ae886){return _0x57a3cc[_0xe43c('0x1d')](_0xcd8012);}return _0x57a3cc['status'](_0xcd8012)['end']();};}function respondWithResult(_0x4406f2,_0x473ac7){_0x473ac7=_0x473ac7||0xc8;return function(_0x201d8b){if(_0x201d8b){return _0x4406f2[_0xe43c('0x1e')](_0x473ac7)[_0xe43c('0x1f')](_0x201d8b);}};}function respondWithFilteredResult(_0x31675d,_0x34182d){return function(_0x1c7b5e){if(_0x1c7b5e){var _0x142dae=typeof _0x34182d[_0xe43c('0x20')]===_0xe43c('0x21')&&typeof _0x34182d[_0xe43c('0x22')]===_0xe43c('0x21');var _0x55fa2c=_0x1c7b5e[_0xe43c('0x23')];var _0x5000cc=_0x142dae?0x0:_0x34182d['offset'];var _0x33c1d1=_0x142dae?_0x1c7b5e[_0xe43c('0x23')]:_0x34182d[_0xe43c('0x20')]+_0x34182d[_0xe43c('0x22')];var _0x829dfc;if(_0x33c1d1>=_0x55fa2c){_0x33c1d1=_0x55fa2c;_0x829dfc=0xc8;}else{_0x829dfc=0xce;}_0x31675d[_0xe43c('0x1e')](_0x829dfc);return _0x31675d['set'](_0xe43c('0x24'),_0x5000cc+'-'+_0x33c1d1+'/'+_0x55fa2c)[_0xe43c('0x1f')](_0x1c7b5e);}return null;};}function patchUpdates(_0xbbaaa1){return function(_0x1f30f1){try{jsonpatch[_0xe43c('0x25')](_0x1f30f1,_0xbbaaa1,!![]);}catch(_0x167b01){return BPromise[_0xe43c('0x26')](_0x167b01);}return _0x1f30f1[_0xe43c('0x27')]();};}function saveUpdates(_0x977d2c,_0x1d1993){return function(_0x2f6697){if(_0x2f6697){return _0x2f6697[_0xe43c('0x28')](_0x977d2c)[_0xe43c('0x29')](function(_0x3e88b7){return _0x3e88b7;});}return null;};}function removeEntity(_0x21a6c0,_0x411d75){return function(_0x3a19ea){if(_0x3a19ea){return _0x3a19ea['destroy']()[_0xe43c('0x29')](function(){_0x21a6c0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37d9cb,_0x5cd9a0){return function(_0x59ec7e){if(!_0x59ec7e){_0x37d9cb['sendStatus'](0x194);}return _0x59ec7e;};}function handleError(_0x1cc752,_0x2ca126){_0x2ca126=_0x2ca126||0x1f4;return function(_0x2a990d){logger[_0xe43c('0x2a')](_0x2a990d[_0xe43c('0x2b')]);if(_0x2a990d[_0xe43c('0x2c')]){delete _0x2a990d[_0xe43c('0x2c')];}_0x1cc752[_0xe43c('0x1e')](_0x2ca126)[_0xe43c('0x2d')](_0x2a990d);};}exports['index']=function(_0x74d6b7,_0x4dc114){var _0x4a15fb={},_0x2c353a={},_0x275ffd={'count':0x0,'rows':[]};var _0x543a1f=_[_0xe43c('0x2e')](db[_0xe43c('0x2f')]['rawAttributes'],function(_0x1d7449){return{'name':_0x1d7449[_0xe43c('0x30')],'type':_0x1d7449[_0xe43c('0x31')][_0xe43c('0x32')]};});_0x2c353a['model']=_[_0xe43c('0x2e')](_0x543a1f,_0xe43c('0x2c'));_0x2c353a['query']=_[_0xe43c('0x33')](_0x74d6b7['query']);_0x2c353a[_0xe43c('0x34')]=_[_0xe43c('0x35')](_0x2c353a[_0xe43c('0x36')],_0x2c353a['query']);_0x4a15fb[_0xe43c('0x37')]=_['intersection'](_0x2c353a[_0xe43c('0x36')],qs[_0xe43c('0x38')](_0x74d6b7[_0xe43c('0x39')]['fields']));_0x4a15fb[_0xe43c('0x37')]=_0x4a15fb[_0xe43c('0x37')][_0xe43c('0x3a')]?_0x4a15fb['attributes']:_0x2c353a[_0xe43c('0x36')];if(!_0x74d6b7['query'][_0xe43c('0x3b')](_0xe43c('0x3c'))){_0x4a15fb['limit']=qs[_0xe43c('0x22')](_0x74d6b7['query'][_0xe43c('0x22')]);_0x4a15fb['offset']=qs['offset'](_0x74d6b7[_0xe43c('0x39')]['offset']);}_0x4a15fb[_0xe43c('0x3d')]=qs[_0xe43c('0x3e')](_0x74d6b7[_0xe43c('0x39')]['sort']);_0x4a15fb[_0xe43c('0x3f')]=qs[_0xe43c('0x34')](_['pick'](_0x74d6b7[_0xe43c('0x39')],_0x2c353a[_0xe43c('0x34')]),_0x543a1f);if(_0x74d6b7['query'][_0xe43c('0x40')]){_0x4a15fb[_0xe43c('0x3f')]=_[_0xe43c('0x41')](_0x4a15fb[_0xe43c('0x3f')],{'$or':_['map'](_0x543a1f,function(_0x5df6a2){if(_0x5df6a2[_0xe43c('0x31')]!==_0xe43c('0x42')){var _0x344dff={};_0x344dff[_0x5df6a2[_0xe43c('0x2c')]]={'$like':'%'+_0x74d6b7[_0xe43c('0x39')]['filter']+'%'};return _0x344dff;}})});}_0x4a15fb=_['merge']({},_0x4a15fb,_0x74d6b7[_0xe43c('0x43')]);var _0xd3d6b5={'where':_0x4a15fb[_0xe43c('0x3f')]};return db[_0xe43c('0x2f')][_0xe43c('0x23')](_0xd3d6b5)[_0xe43c('0x29')](function(_0x53608a){_0x275ffd[_0xe43c('0x23')]=_0x53608a;if(_0x74d6b7[_0xe43c('0x39')]['includeAll']){_0x4a15fb[_0xe43c('0x44')]=[{'all':!![]}];}return db[_0xe43c('0x2f')][_0xe43c('0x45')](_0x4a15fb);})[_0xe43c('0x29')](function(_0x61d164){_0x275ffd[_0xe43c('0x46')]=_0x61d164;return _0x275ffd;})['then'](respondWithFilteredResult(_0x4dc114,_0x4a15fb))[_0xe43c('0x47')](handleError(_0x4dc114,null));};exports[_0xe43c('0x48')]=function(_0x30500f,_0x23e146){var _0x21465c={'raw':![],'where':{'id':_0x30500f[_0xe43c('0x49')]['id']}},_0x18b609={};_0x18b609[_0xe43c('0x36')]=_['keys'](db['ServicenowConfiguration'][_0xe43c('0x4a')]);_0x18b609[_0xe43c('0x39')]=_[_0xe43c('0x33')](_0x30500f['query']);_0x18b609[_0xe43c('0x34')]=_[_0xe43c('0x35')](_0x18b609[_0xe43c('0x36')],_0x18b609[_0xe43c('0x39')]);_0x21465c[_0xe43c('0x37')]=_[_0xe43c('0x35')](_0x18b609[_0xe43c('0x36')],qs[_0xe43c('0x38')](_0x30500f[_0xe43c('0x39')]['fields']));_0x21465c['attributes']=_0x21465c['attributes'][_0xe43c('0x3a')]?_0x21465c[_0xe43c('0x37')]:_0x18b609[_0xe43c('0x36')];if(_0x30500f[_0xe43c('0x39')][_0xe43c('0x4b')]){_0x21465c[_0xe43c('0x44')]=[{'all':!![]}];}_0x21465c=_['merge']({},_0x21465c,_0x30500f[_0xe43c('0x43')]);return db[_0xe43c('0x2f')]['find'](_0x21465c)[_0xe43c('0x29')](handleEntityNotFound(_0x23e146,null))[_0xe43c('0x29')](respondWithResult(_0x23e146,null))[_0xe43c('0x47')](handleError(_0x23e146,null));};exports[_0xe43c('0x4c')]=function(_0x37032f,_0x891f35){return db[_0xe43c('0x2f')]['create'](_0x37032f[_0xe43c('0x4d')],{})[_0xe43c('0x29')](respondWithResult(_0x891f35,0xc9))[_0xe43c('0x47')](handleError(_0x891f35,null));};exports[_0xe43c('0x28')]=function(_0x597bf6,_0x2672c1){if(_0x597bf6[_0xe43c('0x4d')]['id']){delete _0x597bf6[_0xe43c('0x4d')]['id'];}return db[_0xe43c('0x2f')][_0xe43c('0x4e')]({'where':{'id':_0x597bf6[_0xe43c('0x49')]['id']}})['then'](handleEntityNotFound(_0x2672c1,null))[_0xe43c('0x29')](saveUpdates(_0x597bf6[_0xe43c('0x4d')],null))[_0xe43c('0x29')](respondWithResult(_0x2672c1,null))[_0xe43c('0x47')](handleError(_0x2672c1,null));};exports[_0xe43c('0x4f')]=function(_0x1469ab,_0x9b5dc4){return db[_0xe43c('0x2f')][_0xe43c('0x4e')]({'where':{'id':_0x1469ab[_0xe43c('0x49')]['id']}})[_0xe43c('0x29')](handleEntityNotFound(_0x9b5dc4,null))[_0xe43c('0x29')](removeEntity(_0x9b5dc4,null))[_0xe43c('0x47')](handleError(_0x9b5dc4,null));};exports[_0xe43c('0x50')]=function(_0x3d04ed,_0xabf593,_0x7f91b0){var _0x2c449a={};var _0x2c88f1={};var _0x9384b2;var _0x548578;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x3d04ed['params']['id']}})['then'](handleEntityNotFound(_0xabf593,null))[_0xe43c('0x29')](function(_0x4c01bd){if(_0x4c01bd){_0x9384b2=_0x4c01bd;_0x2c88f1[_0xe43c('0x36')]=_['keys'](db[_0xe43c('0x51')][_0xe43c('0x4a')]);_0x2c88f1[_0xe43c('0x39')]=_['keys'](_0x3d04ed[_0xe43c('0x39')]);_0x2c88f1[_0xe43c('0x34')]=_[_0xe43c('0x35')](_0x2c88f1[_0xe43c('0x36')],_0x2c88f1[_0xe43c('0x39')]);_0x2c449a[_0xe43c('0x37')]=_[_0xe43c('0x35')](_0x2c88f1[_0xe43c('0x36')],qs[_0xe43c('0x38')](_0x3d04ed[_0xe43c('0x39')][_0xe43c('0x38')]));_0x2c449a[_0xe43c('0x37')]=_0x2c449a[_0xe43c('0x37')][_0xe43c('0x3a')]?_0x2c449a['attributes']:_0x2c88f1['model'];_0x2c449a[_0xe43c('0x3d')]=qs[_0xe43c('0x3e')](_0x3d04ed['query']['sort']);_0x2c449a[_0xe43c('0x3f')]=qs[_0xe43c('0x34')](_[_0xe43c('0x52')](_0x3d04ed['query'],_0x2c88f1[_0xe43c('0x34')]));if(_0x3d04ed['query']['filter']){_0x2c449a[_0xe43c('0x3f')]=_[_0xe43c('0x41')](_0x2c449a[_0xe43c('0x3f')],{'$or':_[_0xe43c('0x2e')](_0x2c449a[_0xe43c('0x37')],function(_0x484860){var _0x4d4da7={};_0x4d4da7[_0x484860]={'$like':'%'+_0x3d04ed[_0xe43c('0x39')][_0xe43c('0x40')]+'%'};return _0x4d4da7;})});}_0x2c449a=_[_0xe43c('0x41')]({},_0x2c449a,_0x3d04ed[_0xe43c('0x43')]);return _0x9384b2[_0xe43c('0x50')](_0x2c449a);}})[_0xe43c('0x29')](function(_0x4c9634){if(_0x4c9634){_0x548578=_0x4c9634['length'];if(!_0x3d04ed[_0xe43c('0x39')]['hasOwnProperty'](_0xe43c('0x3c'))){_0x2c449a[_0xe43c('0x22')]=qs['limit'](_0x3d04ed[_0xe43c('0x39')][_0xe43c('0x22')]);_0x2c449a[_0xe43c('0x20')]=qs[_0xe43c('0x20')](_0x3d04ed['query'][_0xe43c('0x20')]);}return _0x9384b2[_0xe43c('0x50')](_0x2c449a);}})[_0xe43c('0x29')](function(_0x5ba69c){if(_0x5ba69c){return _0x5ba69c?{'count':_0x548578,'rows':_0x5ba69c}:null;}})[_0xe43c('0x29')](respondWithResult(_0xabf593,null))[_0xe43c('0x47')](handleError(_0xabf593,null));};exports['getSubjects']=function(_0x26344e,_0x24963b,_0x4d598c){var _0x71c415={};var _0x36b9ab={};var _0x31e15f;var _0x18ee0c;return db['ServicenowConfiguration'][_0xe43c('0x53')]({'where':{'id':_0x26344e[_0xe43c('0x49')]['id']}})['then'](handleEntityNotFound(_0x24963b,null))[_0xe43c('0x29')](function(_0x3bf42c){if(_0x3bf42c){_0x31e15f=_0x3bf42c;_0x36b9ab[_0xe43c('0x36')]=_[_0xe43c('0x33')](db[_0xe43c('0x51')][_0xe43c('0x4a')]);_0x36b9ab[_0xe43c('0x39')]=_[_0xe43c('0x33')](_0x26344e[_0xe43c('0x39')]);_0x36b9ab[_0xe43c('0x34')]=_[_0xe43c('0x35')](_0x36b9ab['model'],_0x36b9ab[_0xe43c('0x39')]);_0x71c415['attributes']=_[_0xe43c('0x35')](_0x36b9ab['model'],qs[_0xe43c('0x38')](_0x26344e[_0xe43c('0x39')][_0xe43c('0x38')]));_0x71c415['attributes']=_0x71c415['attributes'][_0xe43c('0x3a')]?_0x71c415[_0xe43c('0x37')]:_0x36b9ab[_0xe43c('0x36')];_0x71c415[_0xe43c('0x3d')]=qs[_0xe43c('0x3e')](_0x26344e['query']['sort']);_0x71c415[_0xe43c('0x3f')]=qs[_0xe43c('0x34')](_[_0xe43c('0x52')](_0x26344e[_0xe43c('0x39')],_0x36b9ab['filters']));if(_0x26344e['query'][_0xe43c('0x40')]){_0x71c415[_0xe43c('0x3f')]=_['merge'](_0x71c415['where'],{'$or':_[_0xe43c('0x2e')](_0x71c415[_0xe43c('0x37')],function(_0x3f8d1f){var _0x262a70={};_0x262a70[_0x3f8d1f]={'$like':'%'+_0x26344e[_0xe43c('0x39')][_0xe43c('0x40')]+'%'};return _0x262a70;})});}_0x71c415=_[_0xe43c('0x41')]({},_0x71c415,_0x26344e[_0xe43c('0x43')]);return _0x31e15f['getSubjects'](_0x71c415);}})[_0xe43c('0x29')](function(_0x14b0df){if(_0x14b0df){_0x18ee0c=_0x14b0df[_0xe43c('0x3a')];if(!_0x26344e['query'][_0xe43c('0x3b')]('nolimit')){_0x71c415[_0xe43c('0x22')]=qs[_0xe43c('0x22')](_0x26344e[_0xe43c('0x39')][_0xe43c('0x22')]);_0x71c415['offset']=qs[_0xe43c('0x20')](_0x26344e[_0xe43c('0x39')][_0xe43c('0x20')]);}return _0x31e15f[_0xe43c('0x54')](_0x71c415);}})[_0xe43c('0x29')](function(_0xfd06f6){if(_0xfd06f6){return _0xfd06f6?{'count':_0x18ee0c,'rows':_0xfd06f6}:null;}})[_0xe43c('0x29')](respondWithResult(_0x24963b,null))['catch'](handleError(_0x24963b,null));};exports[_0xe43c('0x55')]=function(_0x1de9c6,_0x51b447,_0x3793e0){var _0x19a4e9={};var _0x3c2659={};var _0x3060d7;var _0x1f2113;return db['ServicenowConfiguration'][_0xe43c('0x53')]({'where':{'id':_0x1de9c6[_0xe43c('0x49')]['id']}})[_0xe43c('0x29')](handleEntityNotFound(_0x51b447,null))['then'](function(_0x550fe3){if(_0x550fe3){_0x3060d7=_0x550fe3;_0x3c2659[_0xe43c('0x36')]=_['keys'](db['ServicenowField'][_0xe43c('0x4a')]);_0x3c2659[_0xe43c('0x39')]=_['keys'](_0x1de9c6[_0xe43c('0x39')]);_0x3c2659[_0xe43c('0x34')]=_['intersection'](_0x3c2659['model'],_0x3c2659[_0xe43c('0x39')]);_0x19a4e9[_0xe43c('0x37')]=_['intersection'](_0x3c2659['model'],qs[_0xe43c('0x38')](_0x1de9c6[_0xe43c('0x39')][_0xe43c('0x38')]));_0x19a4e9[_0xe43c('0x37')]=_0x19a4e9[_0xe43c('0x37')][_0xe43c('0x3a')]?_0x19a4e9[_0xe43c('0x37')]:_0x3c2659[_0xe43c('0x36')];_0x19a4e9[_0xe43c('0x3d')]=qs[_0xe43c('0x3e')](_0x1de9c6[_0xe43c('0x39')][_0xe43c('0x3e')]);_0x19a4e9[_0xe43c('0x3f')]=qs[_0xe43c('0x34')](_['pick'](_0x1de9c6[_0xe43c('0x39')],_0x3c2659['filters']));if(_0x1de9c6[_0xe43c('0x39')]['filter']){_0x19a4e9[_0xe43c('0x3f')]=_['merge'](_0x19a4e9[_0xe43c('0x3f')],{'$or':_[_0xe43c('0x2e')](_0x19a4e9['attributes'],function(_0x14ae28){var _0x99314e={};_0x99314e[_0x14ae28]={'$like':'%'+_0x1de9c6['query'][_0xe43c('0x40')]+'%'};return _0x99314e;})});}_0x19a4e9=_[_0xe43c('0x41')]({},_0x19a4e9,_0x1de9c6[_0xe43c('0x43')]);return _0x3060d7[_0xe43c('0x55')](_0x19a4e9);}})[_0xe43c('0x29')](function(_0x1038e9){if(_0x1038e9){_0x1f2113=_0x1038e9[_0xe43c('0x3a')];if(!_0x1de9c6[_0xe43c('0x39')]['hasOwnProperty'](_0xe43c('0x3c'))){_0x19a4e9[_0xe43c('0x22')]=qs[_0xe43c('0x22')](_0x1de9c6[_0xe43c('0x39')]['limit']);_0x19a4e9[_0xe43c('0x20')]=qs[_0xe43c('0x20')](_0x1de9c6['query']['offset']);}return _0x3060d7[_0xe43c('0x55')](_0x19a4e9);}})[_0xe43c('0x29')](function(_0x1cf4ec){if(_0x1cf4ec){return _0x1cf4ec?{'count':_0x1f2113,'rows':_0x1cf4ec}:null;}})[_0xe43c('0x29')](respondWithResult(_0x51b447,null))['catch'](handleError(_0x51b447,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index ebf85f0..3dd147c 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 _0x8c50=['path','rimraf','./intServicenowConfiguration.attributes','define','int_servicenow_configurations','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x8e2d4d,_0x310930){var _0x5e3047=function(_0x4665e4){while(--_0x4665e4){_0x8e2d4d['push'](_0x8e2d4d['shift']());}};_0x5e3047(++_0x310930);}(_0x8c50,0xcd));var _0x08c5=function(_0x386d0e,_0x197883){_0x386d0e=_0x386d0e-0x0;var _0x2036f8=_0x8c50[_0x386d0e];return _0x2036f8;};'use strict';var _=require('lodash');var util=require(_0x08c5('0x0'));var logger=require(_0x08c5('0x1'))('api');var moment=require(_0x08c5('0x2'));var BPromise=require(_0x08c5('0x3'));var rp=require(_0x08c5('0x4'));var fs=require('fs');var path=require(_0x08c5('0x5'));var rimraf=require(_0x08c5('0x6'));var config=require('../../config/environment');var attributes=require(_0x08c5('0x7'));module['exports']=function(_0x55e14a,_0xa09f74){return _0x55e14a[_0x08c5('0x8')]('ServicenowConfiguration',attributes,{'tableName':_0x08c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1aa=['lodash','util','moment','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','int_servicenow_configurations'];(function(_0x42be56,_0xc00672){var _0x27684c=function(_0x1f9c94){while(--_0x1f9c94){_0x42be56['push'](_0x42be56['shift']());}};_0x27684c(++_0xc00672);}(_0xe1aa,0xfc));var _0xae1a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe1aa[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xae1a('0x0'));var util=require(_0xae1a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xae1a('0x2'));var BPromise=require(_0xae1a('0x3'));var rp=require(_0xae1a('0x4'));var fs=require('fs');var path=require(_0xae1a('0x5'));var rimraf=require(_0xae1a('0x6'));var config=require('../../config/environment');var attributes=require(_0xae1a('0x7'));module['exports']=function(_0x1c73a1,_0x50527a){return _0x1c73a1['define']('ServicenowConfiguration',attributes,{'tableName':_0xae1a('0x8'),'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 17d68b1..6d99cc8 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 _0x483f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','code','ServicenowConfiguration,\x20%s,\x20%s','error','message','result','catch','lodash','util','randomstring','../../config/utils'];(function(_0x3eb6ef,_0x150386){var _0x328967=function(_0x4c88ae){while(--_0x4c88ae){_0x3eb6ef['push'](_0x3eb6ef['shift']());}};_0x328967(++_0x150386);}(_0x483f,0x10d));var _0xf483=function(_0x19a7c4,_0x306239){_0x19a7c4=_0x19a7c4-0x0;var _0x2e2d3e=_0x483f[_0x19a7c4];return _0x2e2d3e;};'use strict';var _=require(_0xf483('0x0'));var util=require(_0xf483('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf483('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf483('0x3'));var logger=require(_0xf483('0x4'))(_0xf483('0x5'));var config=require(_0xf483('0x6'));var jayson=require(_0xf483('0x7'));var client=jayson[_0xf483('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ef5ec,_0x10c293,_0x388021){return new BPromise(function(_0x4a3d83,_0x341bb4){return client[_0xf483('0x9')](_0x4ef5ec,_0x388021)[_0xf483('0xa')](function(_0xc7f931){logger[_0xf483('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x10c293,_0xf483('0xc'));logger[_0xf483('0xd')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x10c293,'request\x20sent',JSON[_0xf483('0xe')](_0xc7f931));if(_0xc7f931['error']){if(_0xc7f931['error'][_0xf483('0xf')]===0x1f4){logger['error'](_0xf483('0x10'),_0x10c293,_0xc7f931[_0xf483('0x11')][_0xf483('0x12')]);return _0x341bb4(_0xc7f931[_0xf483('0x11')][_0xf483('0x12')]);}logger['error'](_0xf483('0x10'),_0x10c293,_0xc7f931[_0xf483('0x11')][_0xf483('0x12')]);return _0x4a3d83(_0xc7f931[_0xf483('0x11')][_0xf483('0x12')]);}else{logger[_0xf483('0xb')](_0xf483('0x10'),_0x10c293,'request\x20sent');_0x4a3d83(_0xc7f931[_0xf483('0x13')][_0xf483('0x12')]);}})[_0xf483('0x14')](function(_0x38666a){logger[_0xf483('0x11')](_0xf483('0x10'),_0x10c293,_0x38666a);_0x341bb4(_0x38666a);});});} \ No newline at end of file +var _0x7a7c=['../../config/environment','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x7a7c,0x1c6));var _0xc7a7=function(_0x169e47,_0x4aa57c){_0x169e47=_0x169e47-0x0;var _0x34c1d6=_0x7a7c[_0x169e47];return _0x34c1d6;};'use strict';var _=require(_0xc7a7('0x0'));var util=require(_0xc7a7('0x1'));var moment=require(_0xc7a7('0x2'));var BPromise=require(_0xc7a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc7a7('0x4'));var db=require(_0xc7a7('0x5'))['db'];var utils=require(_0xc7a7('0x6'));var logger=require('../../config/logger')(_0xc7a7('0x7'));var config=require(_0xc7a7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc7a7('0x9')][_0xc7a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x62ee7,_0x13c25e,_0xc6f41d){return new BPromise(function(_0x5ebfea,_0x402390){return client[_0xc7a7('0xb')](_0x62ee7,_0xc6f41d)['then'](function(_0x339882){logger[_0xc7a7('0xc')](_0xc7a7('0xd'),_0x13c25e,_0xc7a7('0xe'));logger[_0xc7a7('0xf')](_0xc7a7('0x10'),_0x13c25e,_0xc7a7('0xe'),JSON[_0xc7a7('0x11')](_0x339882));if(_0x339882['error']){if(_0x339882['error']['code']===0x1f4){logger['error'](_0xc7a7('0xd'),_0x13c25e,_0x339882[_0xc7a7('0x12')][_0xc7a7('0x13')]);return _0x402390(_0x339882[_0xc7a7('0x12')][_0xc7a7('0x13')]);}logger[_0xc7a7('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x13c25e,_0x339882[_0xc7a7('0x12')][_0xc7a7('0x13')]);return _0x5ebfea(_0x339882[_0xc7a7('0x12')][_0xc7a7('0x13')]);}else{logger[_0xc7a7('0xc')](_0xc7a7('0xd'),_0x13c25e,_0xc7a7('0xe'));_0x5ebfea(_0x339882['result'][_0xc7a7('0x13')]);}})[_0xc7a7('0x14')](function(_0x55e712){logger[_0xc7a7('0x12')](_0xc7a7('0xd'),_0x13c25e,_0x55e712);_0x402390(_0x55e712);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 6f66ce6..c28ac6c 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 _0x3f74=['index','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated'];(function(_0x585876,_0x166bdf){var _0x23ff97=function(_0xe7030f){while(--_0xe7030f){_0x585876['push'](_0x585876['shift']());}};_0x23ff97(++_0x166bdf);}(_0x3f74,0x107));var _0x43f7=function(_0x32d16b,_0x38ab66){_0x32d16b=_0x32d16b-0x0;var _0x5c14b8=_0x3f74[_0x32d16b];return _0x5c14b8;};'use strict';var multer=require(_0x43f7('0x0'));var util=require(_0x43f7('0x1'));var path=require(_0x43f7('0x2'));var timeout=require(_0x43f7('0x3'));var express=require(_0x43f7('0x4'));var router=express[_0x43f7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x43f7('0x6'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router[_0x43f7('0x7')]('/',auth[_0x43f7('0x8')](),controller[_0x43f7('0x9')]);router[_0x43f7('0x7')](_0x43f7('0xa'),auth['isAuthenticated'](),controller[_0x43f7('0xb')]);router[_0x43f7('0xc')]('/',auth[_0x43f7('0x8')](),controller[_0x43f7('0xd')]);router['put'](_0x43f7('0xa'),auth[_0x43f7('0x8')](),controller[_0x43f7('0xe')]);router[_0x43f7('0xf')]('/:id',auth[_0x43f7('0x8')](),controller[_0x43f7('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1122=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x1122,0x102));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2112('0x0'));var util=require(_0x2112('0x1'));var path=require(_0x2112('0x2'));var timeout=require(_0x2112('0x3'));var express=require(_0x2112('0x4'));var router=express[_0x2112('0x5')]();var fs_extra=require(_0x2112('0x6'));var auth=require(_0x2112('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2112('0x8'));router[_0x2112('0x9')]('/',auth[_0x2112('0xa')](),controller[_0x2112('0xb')]);router[_0x2112('0x9')](_0x2112('0xc'),auth[_0x2112('0xa')](),controller['show']);router[_0x2112('0xd')]('/',auth[_0x2112('0xa')](),controller[_0x2112('0xe')]);router[_0x2112('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2112('0x10')]);router[_0x2112('0x11')](_0x2112('0xc'),auth[_0x2112('0xa')](),controller[_0x2112('0x12')]);module[_0x2112('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 22aa4d1..4613851 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 _0x9757=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x2906e6,_0x5ccd59){var _0x12517a=function(_0x36d576){while(--_0x36d576){_0x2906e6['push'](_0x2906e6['shift']());}};_0x12517a(++_0x5ccd59);}(_0x9757,0x92));var _0x7975=function(_0x2257d6,_0x20d762){_0x2257d6=_0x2257d6-0x0;var _0x5a5430=_0x9757[_0x2257d6];return _0x5a5430;};'use strict';var Sequelize=require(_0x7975('0x0'));module[_0x7975('0x1')]={'type':{'type':Sequelize[_0x7975('0x2')](_0x7975('0x3'),_0x7975('0x4'),_0x7975('0x5'),_0x7975('0x6'),_0x7975('0x7')),'defaultValue':_0x7975('0x3')},'content':{'type':Sequelize[_0x7975('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x7975('0x3'),_0x7975('0x4'),_0x7975('0x5'))},'keyContent':{'type':Sequelize[_0x7975('0x8')]},'idField':{'type':Sequelize[_0x7975('0x8')]},'nameField':{'type':Sequelize[_0x7975('0x8')]},'customField':{'type':Sequelize[_0x7975('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf3e0=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x31e68d,_0x113edf){var _0x12f8ad=function(_0x577d87){while(--_0x577d87){_0x31e68d['push'](_0x31e68d['shift']());}};_0x12f8ad(++_0x113edf);}(_0xf3e0,0xec));var _0x0f3e=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xf3e0[_0x9c2427];return _0x51984f;};'use strict';var Sequelize=require(_0x0f3e('0x0'));module[_0x0f3e('0x1')]={'type':{'type':Sequelize[_0x0f3e('0x2')](_0x0f3e('0x3'),_0x0f3e('0x4'),_0x0f3e('0x5'),'keyValue',_0x0f3e('0x6')),'defaultValue':_0x0f3e('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0f3e('0x2')]('string','variable',_0x0f3e('0x5'))},'keyContent':{'type':Sequelize[_0x0f3e('0x7')]},'idField':{'type':Sequelize[_0x0f3e('0x7')]},'nameField':{'type':Sequelize[_0x0f3e('0x7')]},'customField':{'type':Sequelize[_0x0f3e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 18b7f0d..1974ed7 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 _0x753f=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash'];(function(_0x576529,_0x5355a2){var _0x499a09=function(_0x3a2f46){while(--_0x3a2f46){_0x576529['push'](_0x576529['shift']());}};_0x499a09(++_0x5355a2);}(_0x753f,0x128));var _0xf753=function(_0xb129f,_0x1866ff){_0xb129f=_0xb129f-0x0;var _0x4d519e=_0x753f[_0xb129f];return _0x4d519e;};'use strict';var emlformat=require(_0xf753('0x0'));var rimraf=require(_0xf753('0x1'));var zipdir=require(_0xf753('0x2'));var jsonpatch=require(_0xf753('0x3'));var rp=require(_0xf753('0x4'));var moment=require(_0xf753('0x5'));var BPromise=require(_0xf753('0x6'));var Mustache=require(_0xf753('0x7'));var util=require(_0xf753('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf753('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf753('0xa'));var _=require(_0xf753('0xb'));var squel=require(_0xf753('0xc'));var crypto=require(_0xf753('0xd'));var jsforce=require(_0xf753('0xe'));var deskjs=require(_0xf753('0xf'));var toCsv=require(_0xf753('0x9'));var querystring=require(_0xf753('0x10'));var Papa=require(_0xf753('0x11'));var Redis=require(_0xf753('0x12'));var authService=require(_0xf753('0x13'));var qs=require(_0xf753('0x14'));var as=require(_0xf753('0x15'));var hardwareService=require(_0xf753('0x16'));var logger=require(_0xf753('0x17'))('api');var utils=require(_0xf753('0x18'));var config=require(_0xf753('0x19'));var licenseUtil=require(_0xf753('0x1a'));var db=require(_0xf753('0x1b'))['db'];function respondWithStatusCode(_0x8d0ade,_0x4336af){_0x4336af=_0x4336af||0xcc;return function(_0x18dfde){if(_0x18dfde){return _0x8d0ade['sendStatus'](_0x4336af);}return _0x8d0ade[_0xf753('0x1c')](_0x4336af)[_0xf753('0x1d')]();};}function respondWithResult(_0x4ecb85,_0x532172){_0x532172=_0x532172||0xc8;return function(_0x4d5d4e){if(_0x4d5d4e){return _0x4ecb85[_0xf753('0x1c')](_0x532172)['json'](_0x4d5d4e);}};}function respondWithFilteredResult(_0x318d24,_0x2ae575){return function(_0x5d477f){if(_0x5d477f){var _0x56ace2=typeof _0x2ae575[_0xf753('0x1e')]==='undefined'&&typeof _0x2ae575[_0xf753('0x1f')]===_0xf753('0x20');var _0x57f7dc=_0x5d477f[_0xf753('0x21')];var _0xa8f043=_0x56ace2?0x0:_0x2ae575[_0xf753('0x1e')];var _0x111e0c=_0x56ace2?_0x5d477f[_0xf753('0x21')]:_0x2ae575[_0xf753('0x1e')]+_0x2ae575['limit'];var _0x1f64c8;if(_0x111e0c>=_0x57f7dc){_0x111e0c=_0x57f7dc;_0x1f64c8=0xc8;}else{_0x1f64c8=0xce;}_0x318d24[_0xf753('0x1c')](_0x1f64c8);return _0x318d24['set']('Content-Range',_0xa8f043+'-'+_0x111e0c+'/'+_0x57f7dc)['json'](_0x5d477f);}return null;};}function patchUpdates(_0x349025){return function(_0x27e406){try{jsonpatch[_0xf753('0x22')](_0x27e406,_0x349025,!![]);}catch(_0x21b6bd){return BPromise[_0xf753('0x23')](_0x21b6bd);}return _0x27e406[_0xf753('0x24')]();};}function saveUpdates(_0x19d7b6,_0x5a7b3b){return function(_0x5b6be1){if(_0x5b6be1){return _0x5b6be1[_0xf753('0x25')](_0x19d7b6)[_0xf753('0x26')](function(_0x461782){return _0x461782;});}return null;};}function removeEntity(_0x3f4a30,_0x3bc395){return function(_0x2718a8){if(_0x2718a8){return _0x2718a8[_0xf753('0x27')]()[_0xf753('0x26')](function(){_0x3f4a30[_0xf753('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5856a5,_0x449dac){return function(_0x5196ec){if(!_0x5196ec){_0x5856a5[_0xf753('0x28')](0x194);}return _0x5196ec;};}function handleError(_0x47782c,_0x426634){_0x426634=_0x426634||0x1f4;return function(_0x2ebd8d){logger[_0xf753('0x29')](_0x2ebd8d['stack']);if(_0x2ebd8d[_0xf753('0x2a')]){delete _0x2ebd8d[_0xf753('0x2a')];}_0x47782c[_0xf753('0x1c')](_0x426634)['send'](_0x2ebd8d);};}exports[_0xf753('0x2b')]=function(_0x14ef39,_0x3b62ba){var _0x155319={},_0x50142d={},_0x500d64={'count':0x0,'rows':[]};var _0x582b5f=_[_0xf753('0x2c')](db[_0xf753('0x2d')][_0xf753('0x2e')],function(_0x9a2be0){return{'name':_0x9a2be0[_0xf753('0x2f')],'type':_0x9a2be0[_0xf753('0x30')][_0xf753('0x31')]};});_0x50142d[_0xf753('0x32')]=_['map'](_0x582b5f,_0xf753('0x2a'));_0x50142d[_0xf753('0x33')]=_['keys'](_0x14ef39[_0xf753('0x33')]);_0x50142d[_0xf753('0x34')]=_[_0xf753('0x35')](_0x50142d[_0xf753('0x32')],_0x50142d[_0xf753('0x33')]);_0x155319[_0xf753('0x36')]=_[_0xf753('0x35')](_0x50142d[_0xf753('0x32')],qs['fields'](_0x14ef39['query'][_0xf753('0x37')]));_0x155319[_0xf753('0x36')]=_0x155319[_0xf753('0x36')][_0xf753('0x38')]?_0x155319[_0xf753('0x36')]:_0x50142d[_0xf753('0x32')];if(!_0x14ef39[_0xf753('0x33')][_0xf753('0x39')](_0xf753('0x3a'))){_0x155319[_0xf753('0x1f')]=qs[_0xf753('0x1f')](_0x14ef39[_0xf753('0x33')][_0xf753('0x1f')]);_0x155319[_0xf753('0x1e')]=qs[_0xf753('0x1e')](_0x14ef39['query']['offset']);}_0x155319[_0xf753('0x3b')]=qs[_0xf753('0x3c')](_0x14ef39[_0xf753('0x33')][_0xf753('0x3c')]);_0x155319[_0xf753('0x3d')]=qs[_0xf753('0x34')](_[_0xf753('0x3e')](_0x14ef39[_0xf753('0x33')],_0x50142d['filters']),_0x582b5f);if(_0x14ef39[_0xf753('0x33')][_0xf753('0x3f')]){_0x155319[_0xf753('0x3d')]=_[_0xf753('0x40')](_0x155319[_0xf753('0x3d')],{'$or':_['map'](_0x582b5f,function(_0x87a5a4){if(_0x87a5a4[_0xf753('0x30')]!==_0xf753('0x41')){var _0x26e1aa={};_0x26e1aa[_0x87a5a4[_0xf753('0x2a')]]={'$like':'%'+_0x14ef39[_0xf753('0x33')][_0xf753('0x3f')]+'%'};return _0x26e1aa;}})});}_0x155319=_[_0xf753('0x40')]({},_0x155319,_0x14ef39[_0xf753('0x42')]);var _0x28ad9e={'where':_0x155319['where']};return db[_0xf753('0x2d')]['count'](_0x28ad9e)['then'](function(_0xbacee2){_0x500d64[_0xf753('0x21')]=_0xbacee2;if(_0x14ef39['query'][_0xf753('0x43')]){_0x155319['include']=[{'all':!![]}];}return db['ServicenowField'][_0xf753('0x44')](_0x155319);})[_0xf753('0x26')](function(_0x33215f){_0x500d64[_0xf753('0x45')]=_0x33215f;return _0x500d64;})[_0xf753('0x26')](respondWithFilteredResult(_0x3b62ba,_0x155319))[_0xf753('0x46')](handleError(_0x3b62ba,null));};exports['show']=function(_0x654723,_0x1e7acf){var _0x58eabf={'raw':!![],'where':{'id':_0x654723[_0xf753('0x47')]['id']}},_0x53efcb={};_0x53efcb[_0xf753('0x32')]=_[_0xf753('0x48')](db['ServicenowField'][_0xf753('0x2e')]);_0x53efcb['query']=_['keys'](_0x654723[_0xf753('0x33')]);_0x53efcb['filters']=_[_0xf753('0x35')](_0x53efcb[_0xf753('0x32')],_0x53efcb[_0xf753('0x33')]);_0x58eabf[_0xf753('0x36')]=_[_0xf753('0x35')](_0x53efcb[_0xf753('0x32')],qs[_0xf753('0x37')](_0x654723[_0xf753('0x33')][_0xf753('0x37')]));_0x58eabf[_0xf753('0x36')]=_0x58eabf['attributes'][_0xf753('0x38')]?_0x58eabf[_0xf753('0x36')]:_0x53efcb[_0xf753('0x32')];if(_0x654723[_0xf753('0x33')]['includeAll']){_0x58eabf[_0xf753('0x49')]=[{'all':!![]}];}_0x58eabf=_['merge']({},_0x58eabf,_0x654723['options']);return db['ServicenowField']['find'](_0x58eabf)[_0xf753('0x26')](handleEntityNotFound(_0x1e7acf,null))[_0xf753('0x26')](respondWithResult(_0x1e7acf,null))['catch'](handleError(_0x1e7acf,null));};exports[_0xf753('0x4a')]=function(_0x4a3804,_0x11dcbf){return db[_0xf753('0x2d')]['create'](_0x4a3804[_0xf753('0x4b')],{})[_0xf753('0x26')](respondWithResult(_0x11dcbf,0xc9))[_0xf753('0x46')](handleError(_0x11dcbf,null));};exports[_0xf753('0x25')]=function(_0x4814de,_0x579d48){if(_0x4814de[_0xf753('0x4b')]['id']){delete _0x4814de[_0xf753('0x4b')]['id'];}return db[_0xf753('0x2d')]['find']({'where':{'id':_0x4814de[_0xf753('0x47')]['id']}})[_0xf753('0x26')](handleEntityNotFound(_0x579d48,null))['then'](saveUpdates(_0x4814de['body'],null))['then'](respondWithResult(_0x579d48,null))[_0xf753('0x46')](handleError(_0x579d48,null));};exports[_0xf753('0x27')]=function(_0x46b4d5,_0x543855){return db[_0xf753('0x2d')][_0xf753('0x4c')]({'where':{'id':_0x46b4d5[_0xf753('0x47')]['id']}})[_0xf753('0x26')](handleEntityNotFound(_0x543855,null))['then'](removeEntity(_0x543855,null))[_0xf753('0x46')](handleError(_0x543855,null));}; \ No newline at end of file +var _0x747e=['destroy','then','end','stack','name','send','index','map','ServicenowField','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','findAll','catch','params','find','create','update','body','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x747e,0xee));var _0xe747=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x747e[_0x3740fe];return _0x55492b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe747('0x0'));var zipdir=require(_0xe747('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe747('0x2'));var moment=require('moment');var BPromise=require(_0xe747('0x3'));var Mustache=require(_0xe747('0x4'));var util=require('util');var path=require(_0xe747('0x5'));var sox=require(_0xe747('0x6'));var csv=require(_0xe747('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe747('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe747('0x9'));var toCsv=require(_0xe747('0x7'));var querystring=require(_0xe747('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe747('0xb'));var qs=require(_0xe747('0xc'));var as=require(_0xe747('0xd'));var hardwareService=require(_0xe747('0xe'));var logger=require('../../config/logger')(_0xe747('0xf'));var utils=require(_0xe747('0x10'));var config=require(_0xe747('0x11'));var licenseUtil=require(_0xe747('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x558677,_0x356370){_0x356370=_0x356370||0xcc;return function(_0x3b958f){if(_0x3b958f){return _0x558677[_0xe747('0x13')](_0x356370);}return _0x558677[_0xe747('0x14')](_0x356370)['end']();};}function respondWithResult(_0x72b15f,_0x4c8204){_0x4c8204=_0x4c8204||0xc8;return function(_0x13c2b5){if(_0x13c2b5){return _0x72b15f[_0xe747('0x14')](_0x4c8204)[_0xe747('0x15')](_0x13c2b5);}};}function respondWithFilteredResult(_0xeaa706,_0x5ba61b){return function(_0x4e0515){if(_0x4e0515){var _0x16e683=typeof _0x5ba61b['offset']===_0xe747('0x16')&&typeof _0x5ba61b[_0xe747('0x17')]==='undefined';var _0x41ef03=_0x4e0515['count'];var _0x4643bc=_0x16e683?0x0:_0x5ba61b[_0xe747('0x18')];var _0x51c996=_0x16e683?_0x4e0515[_0xe747('0x19')]:_0x5ba61b[_0xe747('0x18')]+_0x5ba61b[_0xe747('0x17')];var _0x9fdc3a;if(_0x51c996>=_0x41ef03){_0x51c996=_0x41ef03;_0x9fdc3a=0xc8;}else{_0x9fdc3a=0xce;}_0xeaa706['status'](_0x9fdc3a);return _0xeaa706['set'](_0xe747('0x1a'),_0x4643bc+'-'+_0x51c996+'/'+_0x41ef03)[_0xe747('0x15')](_0x4e0515);}return null;};}function patchUpdates(_0x400ed1){return function(_0xda5150){try{jsonpatch[_0xe747('0x1b')](_0xda5150,_0x400ed1,!![]);}catch(_0x28d5c2){return BPromise[_0xe747('0x1c')](_0x28d5c2);}return _0xda5150[_0xe747('0x1d')]();};}function saveUpdates(_0x1d580b,_0x111176){return function(_0x21c0c4){if(_0x21c0c4){return _0x21c0c4['update'](_0x1d580b)['then'](function(_0x1673c4){return _0x1673c4;});}return null;};}function removeEntity(_0x2be150,_0x43a929){return function(_0x23ba24){if(_0x23ba24){return _0x23ba24[_0xe747('0x1e')]()[_0xe747('0x1f')](function(){_0x2be150['status'](0xcc)[_0xe747('0x20')]();});}};}function handleEntityNotFound(_0x5bd8e3,_0x5ad961){return function(_0x232826){if(!_0x232826){_0x5bd8e3[_0xe747('0x13')](0x194);}return _0x232826;};}function handleError(_0x1f59b4,_0xfd66ff){_0xfd66ff=_0xfd66ff||0x1f4;return function(_0x57a460){logger['error'](_0x57a460[_0xe747('0x21')]);if(_0x57a460[_0xe747('0x22')]){delete _0x57a460[_0xe747('0x22')];}_0x1f59b4[_0xe747('0x14')](_0xfd66ff)[_0xe747('0x23')](_0x57a460);};}exports[_0xe747('0x24')]=function(_0x5d5391,_0x18bd91){var _0x2d56d1={},_0x1a3888={},_0x2f903d={'count':0x0,'rows':[]};var _0x510551=_[_0xe747('0x25')](db[_0xe747('0x26')]['rawAttributes'],function(_0x6b1df7){return{'name':_0x6b1df7[_0xe747('0x27')],'type':_0x6b1df7['type'][_0xe747('0x28')]};});_0x1a3888[_0xe747('0x29')]=_[_0xe747('0x25')](_0x510551,_0xe747('0x22'));_0x1a3888[_0xe747('0x2a')]=_[_0xe747('0x2b')](_0x5d5391[_0xe747('0x2a')]);_0x1a3888[_0xe747('0x2c')]=_[_0xe747('0x2d')](_0x1a3888[_0xe747('0x29')],_0x1a3888[_0xe747('0x2a')]);_0x2d56d1[_0xe747('0x2e')]=_[_0xe747('0x2d')](_0x1a3888['model'],qs[_0xe747('0x2f')](_0x5d5391[_0xe747('0x2a')][_0xe747('0x2f')]));_0x2d56d1['attributes']=_0x2d56d1[_0xe747('0x2e')][_0xe747('0x30')]?_0x2d56d1['attributes']:_0x1a3888['model'];if(!_0x5d5391[_0xe747('0x2a')]['hasOwnProperty'](_0xe747('0x31'))){_0x2d56d1[_0xe747('0x17')]=qs['limit'](_0x5d5391['query']['limit']);_0x2d56d1[_0xe747('0x18')]=qs[_0xe747('0x18')](_0x5d5391[_0xe747('0x2a')][_0xe747('0x18')]);}_0x2d56d1[_0xe747('0x32')]=qs[_0xe747('0x33')](_0x5d5391['query'][_0xe747('0x33')]);_0x2d56d1['where']=qs[_0xe747('0x2c')](_[_0xe747('0x34')](_0x5d5391[_0xe747('0x2a')],_0x1a3888[_0xe747('0x2c')]),_0x510551);if(_0x5d5391[_0xe747('0x2a')][_0xe747('0x35')]){_0x2d56d1[_0xe747('0x36')]=_['merge'](_0x2d56d1[_0xe747('0x36')],{'$or':_[_0xe747('0x25')](_0x510551,function(_0xff4c1b){if(_0xff4c1b[_0xe747('0x37')]!==_0xe747('0x38')){var _0x593ef6={};_0x593ef6[_0xff4c1b[_0xe747('0x22')]]={'$like':'%'+_0x5d5391['query'][_0xe747('0x35')]+'%'};return _0x593ef6;}})});}_0x2d56d1=_[_0xe747('0x39')]({},_0x2d56d1,_0x5d5391[_0xe747('0x3a')]);var _0x13e9c1={'where':_0x2d56d1[_0xe747('0x36')]};return db[_0xe747('0x26')][_0xe747('0x19')](_0x13e9c1)[_0xe747('0x1f')](function(_0x2d62a9){_0x2f903d['count']=_0x2d62a9;if(_0x5d5391['query'][_0xe747('0x3b')]){_0x2d56d1['include']=[{'all':!![]}];}return db[_0xe747('0x26')][_0xe747('0x3c')](_0x2d56d1);})[_0xe747('0x1f')](function(_0x44a4e7){_0x2f903d['rows']=_0x44a4e7;return _0x2f903d;})['then'](respondWithFilteredResult(_0x18bd91,_0x2d56d1))[_0xe747('0x3d')](handleError(_0x18bd91,null));};exports['show']=function(_0x967b54,_0x120d73){var _0x232daa={'raw':!![],'where':{'id':_0x967b54[_0xe747('0x3e')]['id']}},_0x3853c3={};_0x3853c3[_0xe747('0x29')]=_[_0xe747('0x2b')](db['ServicenowField']['rawAttributes']);_0x3853c3[_0xe747('0x2a')]=_['keys'](_0x967b54[_0xe747('0x2a')]);_0x3853c3[_0xe747('0x2c')]=_[_0xe747('0x2d')](_0x3853c3['model'],_0x3853c3[_0xe747('0x2a')]);_0x232daa[_0xe747('0x2e')]=_[_0xe747('0x2d')](_0x3853c3[_0xe747('0x29')],qs[_0xe747('0x2f')](_0x967b54['query'][_0xe747('0x2f')]));_0x232daa['attributes']=_0x232daa['attributes'][_0xe747('0x30')]?_0x232daa[_0xe747('0x2e')]:_0x3853c3['model'];if(_0x967b54[_0xe747('0x2a')][_0xe747('0x3b')]){_0x232daa['include']=[{'all':!![]}];}_0x232daa=_['merge']({},_0x232daa,_0x967b54[_0xe747('0x3a')]);return db[_0xe747('0x26')][_0xe747('0x3f')](_0x232daa)['then'](handleEntityNotFound(_0x120d73,null))['then'](respondWithResult(_0x120d73,null))[_0xe747('0x3d')](handleError(_0x120d73,null));};exports[_0xe747('0x40')]=function(_0x302f29,_0x2250f9){return db[_0xe747('0x26')][_0xe747('0x40')](_0x302f29['body'],{})[_0xe747('0x1f')](respondWithResult(_0x2250f9,0xc9))[_0xe747('0x3d')](handleError(_0x2250f9,null));};exports[_0xe747('0x41')]=function(_0x6a24f6,_0x9726f4){if(_0x6a24f6[_0xe747('0x42')]['id']){delete _0x6a24f6[_0xe747('0x42')]['id'];}return db[_0xe747('0x26')][_0xe747('0x3f')]({'where':{'id':_0x6a24f6['params']['id']}})[_0xe747('0x1f')](handleEntityNotFound(_0x9726f4,null))[_0xe747('0x1f')](saveUpdates(_0x6a24f6['body'],null))[_0xe747('0x1f')](respondWithResult(_0x9726f4,null))['catch'](handleError(_0x9726f4,null));};exports['destroy']=function(_0x3b7570,_0xd21756){return db[_0xe747('0x26')][_0xe747('0x3f')]({'where':{'id':_0x3b7570[_0xe747('0x3e')]['id']}})[_0xe747('0x1f')](handleEntityNotFound(_0xd21756,null))[_0xe747('0x1f')](removeEntity(_0xd21756,null))['catch'](handleError(_0xd21756,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 0f5286b..f21653e 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 _0x8bc1=['util','api','moment','bluebird','request-promise','path','./intServicenowField.attributes','exports','define','ServicenowField','idField','FieldId','lodash'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8bc1,0x12a));var _0x18bc=function(_0x24d13c,_0x1479ff){_0x24d13c=_0x24d13c-0x0;var _0x26e0f4=_0x8bc1[_0x24d13c];return _0x26e0f4;};'use strict';var _=require(_0x18bc('0x0'));var util=require(_0x18bc('0x1'));var logger=require('../../config/logger')(_0x18bc('0x2'));var moment=require(_0x18bc('0x3'));var BPromise=require(_0x18bc('0x4'));var rp=require(_0x18bc('0x5'));var fs=require('fs');var path=require(_0x18bc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x18bc('0x7'));module[_0x18bc('0x8')]=function(_0x29bf58,_0x39d187){return _0x29bf58[_0x18bc('0x9')](_0x18bc('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x18bc('0xb'),_0x18bc('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3f1a=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash'];(function(_0x2513d0,_0x16c2b9){var _0x2347af=function(_0x26a1d2){while(--_0x26a1d2){_0x2513d0['push'](_0x2513d0['shift']());}};_0x2347af(++_0x16c2b9);}(_0x3f1a,0x1b2));var _0xa3f1=function(_0x41095a,_0x37cd9b){_0x41095a=_0x41095a-0x0;var _0x395060=_0x3f1a[_0x41095a];return _0x395060;};'use strict';var _=require(_0xa3f1('0x0'));var util=require(_0xa3f1('0x1'));var logger=require(_0xa3f1('0x2'))('api');var moment=require(_0xa3f1('0x3'));var BPromise=require(_0xa3f1('0x4'));var rp=require(_0xa3f1('0x5'));var fs=require('fs');var path=require(_0xa3f1('0x6'));var rimraf=require(_0xa3f1('0x7'));var config=require(_0xa3f1('0x8'));var attributes=require('./intServicenowField.attributes');module[_0xa3f1('0x9')]=function(_0x12645b,_0x21a440){return _0x12645b[_0xa3f1('0xa')](_0xa3f1('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xa3f1('0xc'),'fields':[_0xa3f1('0xd'),_0xa3f1('0xe')],'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 9e803f7..0e65c4a 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x48d48e,_0x3fdc2a){var _0x3c8192=function(_0x58b4ec){while(--_0x58b4ec){_0x48d48e['push'](_0x48d48e['shift']());}};_0x3c8192(++_0x3fdc2a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xb7e7[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x4f5a3f,_0xe39912){var _0xc2bbc4=function(_0x3b3efb){while(--_0x3b3efb){_0x4f5a3f['push'](_0x4f5a3f['shift']());}};_0xc2bbc4(++_0xe39912);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1d3577,_0x17a32e){_0x1d3577=_0x1d3577-0x0;var _0x277d9a=_0xcb91[_0x1d3577];return _0x277d9a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ServicenowField,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index c0bb1a9..6099a9d 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x8a748d,_0x1dcc58){var _0x3c7d45=function(_0x543e58){while(--_0x543e58){_0x8a748d['push'](_0x8a748d['shift']());}};_0x3c7d45(++_0x1dcc58);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3d3484,_0x2a572b){var _0x23cb5b=function(_0x3a9ada){while(--_0x3a9ada){_0x3d3484['push'](_0x3d3484['shift']());}};_0x23cb5b(++_0x2a572b);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 6aecf1a..82da1bb 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(_0x200681,_0xffa8d9){var _0x5bd709=function(_0x51e8ca){while(--_0x51e8ca){_0x200681['push'](_0x200681['shift']());}};_0x5bd709(++_0xffa8d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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(_0x3b39b4,_0x3e2abe){var _0x1e0587=function(_0x47e048){while(--_0x47e048){_0x3b39b4['push'](_0x3b39b4['shift']());}};_0x1e0587(++_0x3e2abe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 f97a64c..5a63f6d 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 _0xfc8f=['getConfigurations','findOne','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','parent_id','parent_type','username','remoteUri','substring','lastIndexOf','POST','login','JSON','password','PLAIN','xCALLY\x20Motion\x20Integration','%s%s','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','name','send','map','SugarcrmAccount','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','catch','show','params','options','create','body','update','find','destroy'];(function(_0x4824cb,_0x1dfa5a){var _0xebcc46=function(_0x254f6e){while(--_0x254f6e){_0x4824cb['push'](_0x4824cb['shift']());}};_0xebcc46(++_0x1dfa5a);}(_0xfc8f,0xa3));var _0xffc8=function(_0x109360,_0x135750){_0x109360=_0x109360-0x0;var _0x53dd99=_0xfc8f[_0x109360];return _0x53dd99;};'use strict';var emlformat=require(_0xffc8('0x0'));var rimraf=require(_0xffc8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xffc8('0x2'));var moment=require('moment');var BPromise=require(_0xffc8('0x3'));var Mustache=require(_0xffc8('0x4'));var util=require(_0xffc8('0x5'));var path=require('path');var sox=require(_0xffc8('0x6'));var csv=require('to-csv');var ejs=require(_0xffc8('0x7'));var fs=require('fs');var fs_extra=require(_0xffc8('0x8'));var _=require(_0xffc8('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xffc8('0xa'));var deskjs=require(_0xffc8('0xb'));var toCsv=require(_0xffc8('0xc'));var querystring=require(_0xffc8('0xd'));var Papa=require('papaparse');var Redis=require(_0xffc8('0xe'));var authService=require(_0xffc8('0xf'));var qs=require(_0xffc8('0x10'));var as=require(_0xffc8('0x11'));var hardwareService=require(_0xffc8('0x12'));var logger=require(_0xffc8('0x13'))(_0xffc8('0x14'));var utils=require(_0xffc8('0x15'));var config=require(_0xffc8('0x16'));var licenseUtil=require(_0xffc8('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xffc8('0x18'));function respondWithStatusCode(_0x57eb45,_0xa978d0){_0xa978d0=_0xa978d0||0xcc;return function(_0x1bddb6){if(_0x1bddb6){return _0x57eb45[_0xffc8('0x19')](_0xa978d0);}return _0x57eb45[_0xffc8('0x1a')](_0xa978d0)[_0xffc8('0x1b')]();};}function respondWithResult(_0x3a15d1,_0x2ca4d5){_0x2ca4d5=_0x2ca4d5||0xc8;return function(_0x1b122c){if(_0x1b122c){return _0x3a15d1['status'](_0x2ca4d5)[_0xffc8('0x1c')](_0x1b122c);}};}function respondWithFilteredResult(_0x4b1843,_0x3561a5){return function(_0x5be860){if(_0x5be860){var _0x21a9e7=typeof _0x3561a5[_0xffc8('0x1d')]===_0xffc8('0x1e')&&typeof _0x3561a5['limit']===_0xffc8('0x1e');var _0x205f60=_0x5be860['count'];var _0x37718c=_0x21a9e7?0x0:_0x3561a5['offset'];var _0x58257f=_0x21a9e7?_0x5be860[_0xffc8('0x1f')]:_0x3561a5[_0xffc8('0x1d')]+_0x3561a5[_0xffc8('0x20')];var _0x424736;if(_0x58257f>=_0x205f60){_0x58257f=_0x205f60;_0x424736=0xc8;}else{_0x424736=0xce;}_0x4b1843[_0xffc8('0x1a')](_0x424736);return _0x4b1843[_0xffc8('0x21')](_0xffc8('0x22'),_0x37718c+'-'+_0x58257f+'/'+_0x205f60)[_0xffc8('0x1c')](_0x5be860);}return null;};}function patchUpdates(_0x58b91a){return function(_0x504289){try{jsonpatch[_0xffc8('0x23')](_0x504289,_0x58b91a,!![]);}catch(_0x51194e){return BPromise[_0xffc8('0x24')](_0x51194e);}return _0x504289[_0xffc8('0x25')]();};}function saveUpdates(_0x381d10,_0x52e8c1){return function(_0xf7141b){if(_0xf7141b){return _0xf7141b['update'](_0x381d10)[_0xffc8('0x26')](function(_0x2b12a4){return _0x2b12a4;});}return null;};}function removeEntity(_0x520af1,_0x48a1b6){return function(_0x2fbaac){if(_0x2fbaac){return _0x2fbaac['destroy']()[_0xffc8('0x26')](function(){_0x520af1['status'](0xcc)[_0xffc8('0x1b')]();});}};}function handleEntityNotFound(_0x288190,_0x189c63){return function(_0x4793b2){if(!_0x4793b2){_0x288190['sendStatus'](0x194);}return _0x4793b2;};}function handleError(_0x4a7c44,_0x20e2b1){_0x20e2b1=_0x20e2b1||0x1f4;return function(_0xdc2c07){logger[_0xffc8('0x27')](_0xdc2c07['stack']);if(_0xdc2c07[_0xffc8('0x28')]){delete _0xdc2c07[_0xffc8('0x28')];}_0x4a7c44['status'](_0x20e2b1)[_0xffc8('0x29')](_0xdc2c07);};}exports['index']=function(_0x1f71ce,_0x3f14c4){var _0x455556={},_0x3112ed={},_0x11cf0e={'count':0x0,'rows':[]};var _0x413e2b=_[_0xffc8('0x2a')](db[_0xffc8('0x2b')][_0xffc8('0x2c')],function(_0x2b9987){return{'name':_0x2b9987['fieldName'],'type':_0x2b9987['type'][_0xffc8('0x2d')]};});_0x3112ed[_0xffc8('0x2e')]=_[_0xffc8('0x2a')](_0x413e2b,'name');_0x3112ed[_0xffc8('0x2f')]=_[_0xffc8('0x30')](_0x1f71ce[_0xffc8('0x2f')]);_0x3112ed['filters']=_['intersection'](_0x3112ed[_0xffc8('0x2e')],_0x3112ed['query']);_0x455556[_0xffc8('0x31')]=_[_0xffc8('0x32')](_0x3112ed['model'],qs[_0xffc8('0x33')](_0x1f71ce['query']['fields']));_0x455556[_0xffc8('0x31')]=_0x455556[_0xffc8('0x31')][_0xffc8('0x34')]?_0x455556['attributes']:_0x3112ed['model'];if(!_0x1f71ce[_0xffc8('0x2f')][_0xffc8('0x35')](_0xffc8('0x36'))){_0x455556[_0xffc8('0x20')]=qs[_0xffc8('0x20')](_0x1f71ce['query']['limit']);_0x455556['offset']=qs[_0xffc8('0x1d')](_0x1f71ce['query'][_0xffc8('0x1d')]);}_0x455556[_0xffc8('0x37')]=qs[_0xffc8('0x38')](_0x1f71ce['query'][_0xffc8('0x38')]);_0x455556[_0xffc8('0x39')]=qs[_0xffc8('0x3a')](_[_0xffc8('0x3b')](_0x1f71ce[_0xffc8('0x2f')],_0x3112ed[_0xffc8('0x3a')]),_0x413e2b);if(_0x1f71ce[_0xffc8('0x2f')][_0xffc8('0x3c')]){_0x455556[_0xffc8('0x39')]=_[_0xffc8('0x3d')](_0x455556[_0xffc8('0x39')],{'$or':_[_0xffc8('0x2a')](_0x413e2b,function(_0x3a0d26){if(_0x3a0d26[_0xffc8('0x3e')]!==_0xffc8('0x3f')){var _0x48b4f7={};_0x48b4f7[_0x3a0d26[_0xffc8('0x28')]]={'$like':'%'+_0x1f71ce[_0xffc8('0x2f')]['filter']+'%'};return _0x48b4f7;}})});}_0x455556=_[_0xffc8('0x3d')]({},_0x455556,_0x1f71ce['options']);var _0x72116e={'where':_0x455556[_0xffc8('0x39')]};return db['SugarcrmAccount'][_0xffc8('0x1f')](_0x72116e)['then'](function(_0x1ab9fa){_0x11cf0e[_0xffc8('0x1f')]=_0x1ab9fa;if(_0x1f71ce['query'][_0xffc8('0x40')]){_0x455556[_0xffc8('0x41')]=[{'all':!![]}];}return db[_0xffc8('0x2b')]['findAll'](_0x455556);})[_0xffc8('0x26')](function(_0x2e5462){_0x11cf0e['rows']=_0x2e5462;return _0x11cf0e;})[_0xffc8('0x26')](respondWithFilteredResult(_0x3f14c4,_0x455556))[_0xffc8('0x42')](handleError(_0x3f14c4,null));};exports[_0xffc8('0x43')]=function(_0x2a8024,_0x5aaadf){var _0x3f6db8={'raw':![],'where':{'id':_0x2a8024[_0xffc8('0x44')]['id']}},_0x41f917={};_0x41f917[_0xffc8('0x2e')]=_['keys'](db[_0xffc8('0x2b')]['rawAttributes']);_0x41f917[_0xffc8('0x2f')]=_[_0xffc8('0x30')](_0x2a8024[_0xffc8('0x2f')]);_0x41f917[_0xffc8('0x3a')]=_[_0xffc8('0x32')](_0x41f917['model'],_0x41f917[_0xffc8('0x2f')]);_0x3f6db8[_0xffc8('0x31')]=_['intersection'](_0x41f917[_0xffc8('0x2e')],qs[_0xffc8('0x33')](_0x2a8024[_0xffc8('0x2f')]['fields']));_0x3f6db8['attributes']=_0x3f6db8[_0xffc8('0x31')][_0xffc8('0x34')]?_0x3f6db8[_0xffc8('0x31')]:_0x41f917[_0xffc8('0x2e')];if(_0x2a8024[_0xffc8('0x2f')][_0xffc8('0x40')]){_0x3f6db8['include']=[{'all':!![]}];}_0x3f6db8=_['merge']({},_0x3f6db8,_0x2a8024[_0xffc8('0x45')]);return db[_0xffc8('0x2b')]['find'](_0x3f6db8)[_0xffc8('0x26')](handleEntityNotFound(_0x5aaadf,null))['then'](respondWithResult(_0x5aaadf,null))[_0xffc8('0x42')](handleError(_0x5aaadf,null));};exports[_0xffc8('0x46')]=function(_0x28d04c,_0x4d02f9){return db[_0xffc8('0x2b')][_0xffc8('0x46')](_0x28d04c[_0xffc8('0x47')],{})[_0xffc8('0x26')](respondWithResult(_0x4d02f9,0xc9))[_0xffc8('0x42')](handleError(_0x4d02f9,null));};exports[_0xffc8('0x48')]=function(_0x588c05,_0x2a0ec3){if(_0x588c05[_0xffc8('0x47')]['id']){delete _0x588c05[_0xffc8('0x47')]['id'];}return db['SugarcrmAccount'][_0xffc8('0x49')]({'where':{'id':_0x588c05[_0xffc8('0x44')]['id']}})[_0xffc8('0x26')](handleEntityNotFound(_0x2a0ec3,null))['then'](saveUpdates(_0x588c05[_0xffc8('0x47')],null))[_0xffc8('0x26')](respondWithResult(_0x2a0ec3,null))[_0xffc8('0x42')](handleError(_0x2a0ec3,null));};exports[_0xffc8('0x4a')]=function(_0x2f9af7,_0x375edc){return db[_0xffc8('0x2b')][_0xffc8('0x49')]({'where':{'id':_0x2f9af7[_0xffc8('0x44')]['id']}})[_0xffc8('0x26')](handleEntityNotFound(_0x375edc,null))[_0xffc8('0x26')](removeEntity(_0x375edc,null))[_0xffc8('0x42')](handleError(_0x375edc,null));};exports[_0xffc8('0x4b')]=function(_0x5c970e,_0x99ab0b,_0x21f42f){var _0x4f2a18={};var _0x2390cb={};var _0x2e1f46;var _0x22dd9e;return db['SugarcrmAccount'][_0xffc8('0x4c')]({'where':{'id':_0x5c970e[_0xffc8('0x44')]['id']}})[_0xffc8('0x26')](handleEntityNotFound(_0x99ab0b,null))[_0xffc8('0x26')](function(_0x5c5047){if(_0x5c5047){_0x2e1f46=_0x5c5047;_0x2390cb[_0xffc8('0x2e')]=_[_0xffc8('0x30')](db['SugarcrmConfiguration']['rawAttributes']);_0x2390cb[_0xffc8('0x2f')]=_[_0xffc8('0x30')](_0x5c970e[_0xffc8('0x2f')]);_0x2390cb['filters']=_['intersection'](_0x2390cb[_0xffc8('0x2e')],_0x2390cb[_0xffc8('0x2f')]);_0x4f2a18[_0xffc8('0x31')]=_[_0xffc8('0x32')](_0x2390cb[_0xffc8('0x2e')],qs[_0xffc8('0x33')](_0x5c970e['query'][_0xffc8('0x33')]));_0x4f2a18[_0xffc8('0x31')]=_0x4f2a18[_0xffc8('0x31')][_0xffc8('0x34')]?_0x4f2a18['attributes']:_0x2390cb[_0xffc8('0x2e')];_0x4f2a18['order']=qs['sort'](_0x5c970e[_0xffc8('0x2f')][_0xffc8('0x38')]);_0x4f2a18['where']=qs[_0xffc8('0x3a')](_['pick'](_0x5c970e[_0xffc8('0x2f')],_0x2390cb[_0xffc8('0x3a')]));if(_0x5c970e[_0xffc8('0x2f')][_0xffc8('0x3c')]){_0x4f2a18[_0xffc8('0x39')]=_['merge'](_0x4f2a18[_0xffc8('0x39')],{'$or':_[_0xffc8('0x2a')](_0x4f2a18[_0xffc8('0x31')],function(_0x2be287){var _0x8e7259={};_0x8e7259[_0x2be287]={'$like':'%'+_0x5c970e['query'][_0xffc8('0x3c')]+'%'};return _0x8e7259;})});}_0x4f2a18=_[_0xffc8('0x3d')]({},_0x4f2a18,_0x5c970e[_0xffc8('0x45')]);return _0x2e1f46[_0xffc8('0x4b')](_0x4f2a18);}})['then'](function(_0x14c770){if(_0x14c770){_0x22dd9e=_0x14c770[_0xffc8('0x34')];if(!_0x5c970e[_0xffc8('0x2f')]['hasOwnProperty'](_0xffc8('0x36'))){_0x4f2a18[_0xffc8('0x20')]=qs[_0xffc8('0x20')](_0x5c970e[_0xffc8('0x2f')][_0xffc8('0x20')]);_0x4f2a18[_0xffc8('0x1d')]=qs[_0xffc8('0x1d')](_0x5c970e[_0xffc8('0x2f')][_0xffc8('0x1d')]);}return _0x2e1f46[_0xffc8('0x4b')](_0x4f2a18);}})[_0xffc8('0x26')](function(_0x54b06f){if(_0x54b06f){return _0x54b06f?{'count':_0x22dd9e,'rows':_0x54b06f}:null;}})['then'](respondWithResult(_0x99ab0b,null))[_0xffc8('0x42')](handleError(_0x99ab0b,null));};exports[_0xffc8('0x4d')]=function(_0x51b82f,_0x5f59cd,_0x39f801){if(_0x51b82f[_0xffc8('0x47')]['id']){delete _0x51b82f['body']['id'];}return db[_0xffc8('0x2b')][_0xffc8('0x4c')]({'where':{'id':_0x51b82f['params']['id']}})[_0xffc8('0x26')](handleEntityNotFound(_0x5f59cd,null))[_0xffc8('0x26')](function(_0x4849e6){if(_0x4849e6){_0x51b82f[_0xffc8('0x47')]['AccountId']=_0x4849e6['id'];_0x51b82f['body'][_0xffc8('0x4e')]=integrations[_0xffc8('0x4f')](_0x51b82f[_0xffc8('0x47')][_0xffc8('0x50')],_0x51b82f['body'][_0xffc8('0x3e')]);_0x51b82f[_0xffc8('0x47')][_0xffc8('0x51')]=integrations[_0xffc8('0x52')](_0x51b82f[_0xffc8('0x47')][_0xffc8('0x50')],_0x51b82f[_0xffc8('0x47')][_0xffc8('0x3e')]);return db[_0xffc8('0x53')][_0xffc8('0x46')](_0x51b82f[_0xffc8('0x47')],{'include':[{'model':db[_0xffc8('0x54')],'as':_0xffc8('0x4e')},{'model':db[_0xffc8('0x54')],'as':_0xffc8('0x51')}]});}return null;})[_0xffc8('0x26')](respondWithResult(_0x5f59cd,null))[_0xffc8('0x42')](handleError(_0x5f59cd,null));};exports[_0xffc8('0x55')]=function(_0x2a131a,_0x573ad1,_0x1e59fc){var _0x598c22='';var _0x4eb7da=['id',_0xffc8('0x28'),_0xffc8('0x56'),_0xffc8('0x57'),_0xffc8('0x58'),_0xffc8('0x59'),_0xffc8('0x5a'),'duration_minutes',_0xffc8('0x5b'),_0xffc8('0x5c'),'parent_name','direction'];return db[_0xffc8('0x2b')][_0xffc8('0x4c')]({'where':{'id':_0x2a131a[_0xffc8('0x44')]['id']},'attributes':['id',_0xffc8('0x5d'),'password',_0xffc8('0x5e')]})[_0xffc8('0x26')](handleEntityNotFound(_0x573ad1,null))[_0xffc8('0x26')](function(_0x8ce165){if(_0x8ce165){_0x598c22=_0x8ce165[_0xffc8('0x5e')];var _0x3159a4=_0x598c22['slice'](-0x1);if(_0x3159a4==='/'){_0x598c22=_0x598c22[_0xffc8('0x5f')](0x0,_0x598c22[_0xffc8('0x60')](_0x3159a4));}return rp({'method':_0xffc8('0x61'),'uri':util['format']('%s%s',_0x598c22,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xffc8('0x62'),'input_type':_0xffc8('0x63'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x8ce165[_0xffc8('0x5d')],'password':_0x8ce165[_0xffc8('0x64')],'encryption':_0xffc8('0x65')},'application':_0xffc8('0x66')})}});}})[_0xffc8('0x26')](function(_0x2becb8){if(_0x2becb8&&_0x2becb8[_0xffc8('0x28')]!=='Invalid\x20Login'&&_0x2becb8['name']!=='Password\x20Expired'){return rp({'method':_0xffc8('0x61'),'uri':util['format'](_0xffc8('0x67'),_0x598c22,_0xffc8('0x68')),'json':!![],'form':{'method':_0xffc8('0x69'),'input_type':_0xffc8('0x63'),'response_type':_0xffc8('0x63'),'rest_data':JSON['stringify']({'session':_0x2becb8['id'],'module_name':_0xffc8('0x6a')})}})[_0xffc8('0x26')](function(_0x42854c){if(_0x42854c){var _0x758d07=_[_0xffc8('0x6b')](_0x42854c[_0xffc8('0x6c')]);_[_0xffc8('0x6d')](_0x758d07,function(_0x21fd7a){return _0x4eb7da[_0xffc8('0x6e')](_0x21fd7a['name']);});return{'count':_0x758d07[_0xffc8('0x34')],'rows':_[_0xffc8('0x2a')](_0x758d07,function(_0x10ee9f){return{'id':_0x10ee9f['name'],'name':_0x10ee9f[_0xffc8('0x6f')],'custom':_[_0xffc8('0x70')](_0x10ee9f[_0xffc8('0x28')],'_c')?!![]:![],'options':_0x10ee9f[_0xffc8('0x45')]?_[_0xffc8('0x2a')](_[_0xffc8('0x6b')](_0x10ee9f[_0xffc8('0x45')]),function(_0x1983a0){return{'name':_0x1983a0[_0xffc8('0x71')],'value':_0x1983a0[_0xffc8('0x28')]};}):[]};})};}})[_0xffc8('0x26')](respondWithResult(_0x573ad1,null))[_0xffc8('0x42')](function(_0x43fcdd){var _0x3c6305=_0x2a131a[_0xffc8('0x2f')][_0xffc8('0x72')]?0x1f4:_0x43fcdd[_0xffc8('0x73')]||0x1f4;logger['error'](_0xffc8('0x74'),_0xffc8('0x55'),_0x3c6305,JSON[_0xffc8('0x75')](_0x43fcdd));delete _0x43fcdd['name'];if(_0x3c6305===0x191){_0x3c6305=0x190;}_0x573ad1['status'](_0x3c6305)[_0xffc8('0x29')](_0x2a131a[_0xffc8('0x2f')][_0xffc8('0x72')]?{'message':_0xffc8('0x76'),'statusCode':_0x43fcdd['statusCode']}:_0x43fcdd);});}else{var _0x248291=0x1f4;_0x573ad1[_0xffc8('0x1a')](_0x248291)[_0xffc8('0x29')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x6ed8=['getConfigurations','order','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','remoteUri','slice','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','password','PLAIN','Invalid\x20Login','Password\x20Expired','POST','get_module_fields','Calls','module_fields','remove','includes','label','endsWith','values','value','statusCode','error','send','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','stack','name','SugarcrmAccount','rawAttributes','type','key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','options','includeAll','findAll','catch','show','params','intersection','find','create','body','update'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x6ed8,0x120));var _0x86ed=function(_0x5b40ff,_0x593d7c){_0x5b40ff=_0x5b40ff-0x0;var _0x14b95d=_0x6ed8[_0x5b40ff];return _0x14b95d;};'use strict';var emlformat=require(_0x86ed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x86ed('0x1'));var jsonpatch=require(_0x86ed('0x2'));var rp=require(_0x86ed('0x3'));var moment=require(_0x86ed('0x4'));var BPromise=require(_0x86ed('0x5'));var Mustache=require(_0x86ed('0x6'));var util=require(_0x86ed('0x7'));var path=require('path');var sox=require(_0x86ed('0x8'));var csv=require(_0x86ed('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x86ed('0xa'));var _=require(_0x86ed('0xb'));var squel=require(_0x86ed('0xc'));var crypto=require(_0x86ed('0xd'));var jsforce=require(_0x86ed('0xe'));var deskjs=require(_0x86ed('0xf'));var toCsv=require(_0x86ed('0x9'));var querystring=require(_0x86ed('0x10'));var Papa=require(_0x86ed('0x11'));var Redis=require(_0x86ed('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x86ed('0x13'));var config=require(_0x86ed('0x14'));var licenseUtil=require(_0x86ed('0x15'));var db=require(_0x86ed('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x39320d,_0x3ba1d3){_0x3ba1d3=_0x3ba1d3||0xcc;return function(_0x3c0303){if(_0x3c0303){return _0x39320d[_0x86ed('0x17')](_0x3ba1d3);}return _0x39320d[_0x86ed('0x18')](_0x3ba1d3)[_0x86ed('0x19')]();};}function respondWithResult(_0x1628af,_0x18cdaa){_0x18cdaa=_0x18cdaa||0xc8;return function(_0x4d8ba9){if(_0x4d8ba9){return _0x1628af['status'](_0x18cdaa)[_0x86ed('0x1a')](_0x4d8ba9);}};}function respondWithFilteredResult(_0xa3b332,_0x580fb3){return function(_0x30d85f){if(_0x30d85f){var _0x504912=typeof _0x580fb3[_0x86ed('0x1b')]===_0x86ed('0x1c')&&typeof _0x580fb3['limit']===_0x86ed('0x1c');var _0x8d8a08=_0x30d85f[_0x86ed('0x1d')];var _0x4f5dcc=_0x504912?0x0:_0x580fb3[_0x86ed('0x1b')];var _0x80ab0e=_0x504912?_0x30d85f[_0x86ed('0x1d')]:_0x580fb3['offset']+_0x580fb3[_0x86ed('0x1e')];var _0x1bd03d;if(_0x80ab0e>=_0x8d8a08){_0x80ab0e=_0x8d8a08;_0x1bd03d=0xc8;}else{_0x1bd03d=0xce;}_0xa3b332[_0x86ed('0x18')](_0x1bd03d);return _0xa3b332[_0x86ed('0x1f')](_0x86ed('0x20'),_0x4f5dcc+'-'+_0x80ab0e+'/'+_0x8d8a08)[_0x86ed('0x1a')](_0x30d85f);}return null;};}function patchUpdates(_0x55e6fd){return function(_0x16dec3){try{jsonpatch[_0x86ed('0x21')](_0x16dec3,_0x55e6fd,!![]);}catch(_0x1c9979){return BPromise['reject'](_0x1c9979);}return _0x16dec3[_0x86ed('0x22')]();};}function saveUpdates(_0x473b79,_0x410617){return function(_0x1d3b1a){if(_0x1d3b1a){return _0x1d3b1a['update'](_0x473b79)[_0x86ed('0x23')](function(_0x144f92){return _0x144f92;});}return null;};}function removeEntity(_0x2fbf6e,_0x1c4f23){return function(_0x4d62a5){if(_0x4d62a5){return _0x4d62a5[_0x86ed('0x24')]()[_0x86ed('0x23')](function(){_0x2fbf6e[_0x86ed('0x18')](0xcc)[_0x86ed('0x19')]();});}};}function handleEntityNotFound(_0x227622,_0xe66186){return function(_0x5bd735){if(!_0x5bd735){_0x227622[_0x86ed('0x17')](0x194);}return _0x5bd735;};}function handleError(_0x3fd4e2,_0x227fb0){_0x227fb0=_0x227fb0||0x1f4;return function(_0x238263){logger['error'](_0x238263[_0x86ed('0x25')]);if(_0x238263[_0x86ed('0x26')]){delete _0x238263[_0x86ed('0x26')];}_0x3fd4e2[_0x86ed('0x18')](_0x227fb0)['send'](_0x238263);};}exports['index']=function(_0x4d73a4,_0x10e136){var _0x31c8bd={},_0x5330fa={},_0x326589={'count':0x0,'rows':[]};var _0x195b57=_['map'](db[_0x86ed('0x27')][_0x86ed('0x28')],function(_0x711a08){return{'name':_0x711a08['fieldName'],'type':_0x711a08[_0x86ed('0x29')][_0x86ed('0x2a')]};});_0x5330fa[_0x86ed('0x2b')]=_['map'](_0x195b57,_0x86ed('0x26'));_0x5330fa['query']=_[_0x86ed('0x2c')](_0x4d73a4['query']);_0x5330fa[_0x86ed('0x2d')]=_['intersection'](_0x5330fa[_0x86ed('0x2b')],_0x5330fa[_0x86ed('0x2e')]);_0x31c8bd[_0x86ed('0x2f')]=_['intersection'](_0x5330fa[_0x86ed('0x2b')],qs[_0x86ed('0x30')](_0x4d73a4[_0x86ed('0x2e')][_0x86ed('0x30')]));_0x31c8bd[_0x86ed('0x2f')]=_0x31c8bd[_0x86ed('0x2f')][_0x86ed('0x31')]?_0x31c8bd[_0x86ed('0x2f')]:_0x5330fa[_0x86ed('0x2b')];if(!_0x4d73a4[_0x86ed('0x2e')][_0x86ed('0x32')](_0x86ed('0x33'))){_0x31c8bd[_0x86ed('0x1e')]=qs['limit'](_0x4d73a4['query']['limit']);_0x31c8bd[_0x86ed('0x1b')]=qs[_0x86ed('0x1b')](_0x4d73a4['query']['offset']);}_0x31c8bd['order']=qs[_0x86ed('0x34')](_0x4d73a4['query']['sort']);_0x31c8bd[_0x86ed('0x35')]=qs['filters'](_[_0x86ed('0x36')](_0x4d73a4['query'],_0x5330fa['filters']),_0x195b57);if(_0x4d73a4['query'][_0x86ed('0x37')]){_0x31c8bd['where']=_[_0x86ed('0x38')](_0x31c8bd[_0x86ed('0x35')],{'$or':_[_0x86ed('0x39')](_0x195b57,function(_0x50769b){if(_0x50769b['type']!=='VIRTUAL'){var _0x2e4abe={};_0x2e4abe[_0x50769b[_0x86ed('0x26')]]={'$like':'%'+_0x4d73a4[_0x86ed('0x2e')][_0x86ed('0x37')]+'%'};return _0x2e4abe;}})});}_0x31c8bd=_['merge']({},_0x31c8bd,_0x4d73a4[_0x86ed('0x3a')]);var _0x3a8917={'where':_0x31c8bd[_0x86ed('0x35')]};return db[_0x86ed('0x27')][_0x86ed('0x1d')](_0x3a8917)[_0x86ed('0x23')](function(_0x2d2dee){_0x326589[_0x86ed('0x1d')]=_0x2d2dee;if(_0x4d73a4[_0x86ed('0x2e')][_0x86ed('0x3b')]){_0x31c8bd['include']=[{'all':!![]}];}return db[_0x86ed('0x27')][_0x86ed('0x3c')](_0x31c8bd);})['then'](function(_0x2f6131){_0x326589['rows']=_0x2f6131;return _0x326589;})['then'](respondWithFilteredResult(_0x10e136,_0x31c8bd))[_0x86ed('0x3d')](handleError(_0x10e136,null));};exports[_0x86ed('0x3e')]=function(_0x3b29b8,_0x4fafb2){var _0x3a1d40={'raw':![],'where':{'id':_0x3b29b8[_0x86ed('0x3f')]['id']}},_0xbd460b={};_0xbd460b[_0x86ed('0x2b')]=_[_0x86ed('0x2c')](db[_0x86ed('0x27')][_0x86ed('0x28')]);_0xbd460b[_0x86ed('0x2e')]=_['keys'](_0x3b29b8[_0x86ed('0x2e')]);_0xbd460b[_0x86ed('0x2d')]=_['intersection'](_0xbd460b[_0x86ed('0x2b')],_0xbd460b[_0x86ed('0x2e')]);_0x3a1d40['attributes']=_[_0x86ed('0x40')](_0xbd460b[_0x86ed('0x2b')],qs[_0x86ed('0x30')](_0x3b29b8[_0x86ed('0x2e')][_0x86ed('0x30')]));_0x3a1d40['attributes']=_0x3a1d40[_0x86ed('0x2f')]['length']?_0x3a1d40[_0x86ed('0x2f')]:_0xbd460b[_0x86ed('0x2b')];if(_0x3b29b8[_0x86ed('0x2e')][_0x86ed('0x3b')]){_0x3a1d40['include']=[{'all':!![]}];}_0x3a1d40=_[_0x86ed('0x38')]({},_0x3a1d40,_0x3b29b8[_0x86ed('0x3a')]);return db[_0x86ed('0x27')][_0x86ed('0x41')](_0x3a1d40)['then'](handleEntityNotFound(_0x4fafb2,null))[_0x86ed('0x23')](respondWithResult(_0x4fafb2,null))[_0x86ed('0x3d')](handleError(_0x4fafb2,null));};exports[_0x86ed('0x42')]=function(_0x33a6a4,_0x1a64c0){return db[_0x86ed('0x27')][_0x86ed('0x42')](_0x33a6a4[_0x86ed('0x43')],{})[_0x86ed('0x23')](respondWithResult(_0x1a64c0,0xc9))['catch'](handleError(_0x1a64c0,null));};exports[_0x86ed('0x44')]=function(_0xb3c71,_0x55fd56){if(_0xb3c71[_0x86ed('0x43')]['id']){delete _0xb3c71[_0x86ed('0x43')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0xb3c71[_0x86ed('0x3f')]['id']}})[_0x86ed('0x23')](handleEntityNotFound(_0x55fd56,null))[_0x86ed('0x23')](saveUpdates(_0xb3c71['body'],null))[_0x86ed('0x23')](respondWithResult(_0x55fd56,null))[_0x86ed('0x3d')](handleError(_0x55fd56,null));};exports[_0x86ed('0x24')]=function(_0x5f0c45,_0x3576d4){return db[_0x86ed('0x27')][_0x86ed('0x41')]({'where':{'id':_0x5f0c45[_0x86ed('0x3f')]['id']}})[_0x86ed('0x23')](handleEntityNotFound(_0x3576d4,null))[_0x86ed('0x23')](removeEntity(_0x3576d4,null))[_0x86ed('0x3d')](handleError(_0x3576d4,null));};exports[_0x86ed('0x45')]=function(_0x228c9a,_0x4ccfa1,_0x30d1a0){var _0x4f70af={};var _0x2a3e6d={};var _0x48ad48;var _0x5cb171;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x228c9a[_0x86ed('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4ccfa1,null))[_0x86ed('0x23')](function(_0x176e75){if(_0x176e75){_0x48ad48=_0x176e75;_0x2a3e6d[_0x86ed('0x2b')]=_[_0x86ed('0x2c')](db['SugarcrmConfiguration'][_0x86ed('0x28')]);_0x2a3e6d['query']=_[_0x86ed('0x2c')](_0x228c9a[_0x86ed('0x2e')]);_0x2a3e6d[_0x86ed('0x2d')]=_[_0x86ed('0x40')](_0x2a3e6d['model'],_0x2a3e6d['query']);_0x4f70af['attributes']=_[_0x86ed('0x40')](_0x2a3e6d[_0x86ed('0x2b')],qs[_0x86ed('0x30')](_0x228c9a[_0x86ed('0x2e')][_0x86ed('0x30')]));_0x4f70af['attributes']=_0x4f70af[_0x86ed('0x2f')][_0x86ed('0x31')]?_0x4f70af['attributes']:_0x2a3e6d[_0x86ed('0x2b')];_0x4f70af[_0x86ed('0x46')]=qs[_0x86ed('0x34')](_0x228c9a[_0x86ed('0x2e')][_0x86ed('0x34')]);_0x4f70af['where']=qs[_0x86ed('0x2d')](_[_0x86ed('0x36')](_0x228c9a[_0x86ed('0x2e')],_0x2a3e6d[_0x86ed('0x2d')]));if(_0x228c9a['query']['filter']){_0x4f70af[_0x86ed('0x35')]=_[_0x86ed('0x38')](_0x4f70af[_0x86ed('0x35')],{'$or':_[_0x86ed('0x39')](_0x4f70af[_0x86ed('0x2f')],function(_0x386290){var _0x5efb3a={};_0x5efb3a[_0x386290]={'$like':'%'+_0x228c9a['query'][_0x86ed('0x37')]+'%'};return _0x5efb3a;})});}_0x4f70af=_[_0x86ed('0x38')]({},_0x4f70af,_0x228c9a['options']);return _0x48ad48[_0x86ed('0x45')](_0x4f70af);}})[_0x86ed('0x23')](function(_0x40e72f){if(_0x40e72f){_0x5cb171=_0x40e72f[_0x86ed('0x31')];if(!_0x228c9a['query'][_0x86ed('0x32')](_0x86ed('0x33'))){_0x4f70af['limit']=qs['limit'](_0x228c9a['query']['limit']);_0x4f70af[_0x86ed('0x1b')]=qs['offset'](_0x228c9a[_0x86ed('0x2e')][_0x86ed('0x1b')]);}return _0x48ad48['getConfigurations'](_0x4f70af);}})[_0x86ed('0x23')](function(_0x49fda4){if(_0x49fda4){return _0x49fda4?{'count':_0x5cb171,'rows':_0x49fda4}:null;}})[_0x86ed('0x23')](respondWithResult(_0x4ccfa1,null))['catch'](handleError(_0x4ccfa1,null));};exports[_0x86ed('0x47')]=function(_0x189659,_0x4e0c74,_0x1a438d){if(_0x189659['body']['id']){delete _0x189659[_0x86ed('0x43')]['id'];}return db[_0x86ed('0x27')][_0x86ed('0x48')]({'where':{'id':_0x189659[_0x86ed('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4e0c74,null))[_0x86ed('0x23')](function(_0x4cc91d){if(_0x4cc91d){_0x189659[_0x86ed('0x43')]['AccountId']=_0x4cc91d['id'];_0x189659[_0x86ed('0x43')][_0x86ed('0x49')]=integrations[_0x86ed('0x4a')](_0x189659[_0x86ed('0x43')][_0x86ed('0x4b')],_0x189659[_0x86ed('0x43')][_0x86ed('0x29')]);_0x189659[_0x86ed('0x43')][_0x86ed('0x4c')]=integrations[_0x86ed('0x4d')](_0x189659[_0x86ed('0x43')][_0x86ed('0x4b')],_0x189659['body'][_0x86ed('0x29')]);return db[_0x86ed('0x4e')][_0x86ed('0x42')](_0x189659[_0x86ed('0x43')],{'include':[{'model':db[_0x86ed('0x4f')],'as':_0x86ed('0x49')},{'model':db[_0x86ed('0x4f')],'as':_0x86ed('0x4c')}]});}return null;})[_0x86ed('0x23')](respondWithResult(_0x4e0c74,null))[_0x86ed('0x3d')](handleError(_0x4e0c74,null));};exports[_0x86ed('0x50')]=function(_0x1d6c7d,_0x1d9fc8,_0x586137){var _0x265185='';var _0x431770=['id',_0x86ed('0x26'),_0x86ed('0x51'),_0x86ed('0x52'),_0x86ed('0x53'),_0x86ed('0x54'),_0x86ed('0x55'),_0x86ed('0x56'),_0x86ed('0x57'),_0x86ed('0x58'),_0x86ed('0x59'),'direction'];return db[_0x86ed('0x27')][_0x86ed('0x48')]({'where':{'id':_0x1d6c7d[_0x86ed('0x3f')]['id']},'attributes':['id','username','password','remoteUri']})[_0x86ed('0x23')](handleEntityNotFound(_0x1d9fc8,null))[_0x86ed('0x23')](function(_0x19e010){if(_0x19e010){_0x265185=_0x19e010[_0x86ed('0x5a')];var _0x159cca=_0x265185[_0x86ed('0x5b')](-0x1);if(_0x159cca==='/'){_0x265185=_0x265185[_0x86ed('0x5c')](0x0,_0x265185[_0x86ed('0x5d')](_0x159cca));}return rp({'method':'POST','uri':util[_0x86ed('0x5e')](_0x86ed('0x5f'),_0x265185,_0x86ed('0x60')),'json':!![],'form':{'method':_0x86ed('0x61'),'input_type':'JSON','response_type':_0x86ed('0x62'),'rest_data':JSON[_0x86ed('0x63')]({'user_auth':{'user_name':_0x19e010['username'],'password':_0x19e010[_0x86ed('0x64')],'encryption':_0x86ed('0x65')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x86ed('0x23')](function(_0x2bee67){if(_0x2bee67&&_0x2bee67[_0x86ed('0x26')]!==_0x86ed('0x66')&&_0x2bee67[_0x86ed('0x26')]!==_0x86ed('0x67')){return rp({'method':_0x86ed('0x68'),'uri':util[_0x86ed('0x5e')](_0x86ed('0x5f'),_0x265185,_0x86ed('0x60')),'json':!![],'form':{'method':_0x86ed('0x69'),'input_type':_0x86ed('0x62'),'response_type':_0x86ed('0x62'),'rest_data':JSON[_0x86ed('0x63')]({'session':_0x2bee67['id'],'module_name':_0x86ed('0x6a')})}})[_0x86ed('0x23')](function(_0x2c644c){if(_0x2c644c){var _0x4c3948=_['values'](_0x2c644c[_0x86ed('0x6b')]);_[_0x86ed('0x6c')](_0x4c3948,function(_0x73793){return _0x431770[_0x86ed('0x6d')](_0x73793[_0x86ed('0x26')]);});return{'count':_0x4c3948[_0x86ed('0x31')],'rows':_[_0x86ed('0x39')](_0x4c3948,function(_0x1f3afa){return{'id':_0x1f3afa['name'],'name':_0x1f3afa[_0x86ed('0x6e')],'custom':_[_0x86ed('0x6f')](_0x1f3afa['name'],'_c')?!![]:![],'options':_0x1f3afa[_0x86ed('0x3a')]?_[_0x86ed('0x39')](_[_0x86ed('0x70')](_0x1f3afa['options']),function(_0x54d65b){return{'name':_0x54d65b[_0x86ed('0x71')],'value':_0x54d65b['name']};}):[]};})};}})[_0x86ed('0x23')](respondWithResult(_0x1d9fc8,null))['catch'](function(_0x44ceae){var _0x5bc5aa=_0x1d6c7d[_0x86ed('0x2e')]['test']?0x1f4:_0x44ceae[_0x86ed('0x72')]||0x1f4;logger[_0x86ed('0x73')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5bc5aa,JSON[_0x86ed('0x63')](_0x44ceae));delete _0x44ceae[_0x86ed('0x26')];if(_0x5bc5aa===0x191){_0x5bc5aa=0x190;}_0x1d9fc8[_0x86ed('0x18')](_0x5bc5aa)[_0x86ed('0x74')](_0x1d6c7d[_0x86ed('0x2e')][_0x86ed('0x75')]?{'message':_0x86ed('0x76'),'statusCode':_0x44ceae[_0x86ed('0x72')]}:_0x44ceae);});}else{var _0x4ae589=0x1f4;_0x1d9fc8[_0x86ed('0x18')](_0x4ae589)[_0x86ed('0x74')]({'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 4442f56..68334ab 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 _0x315f=['exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','bluebird','./intSugarcrmAccount.attributes'];(function(_0x1cdcd0,_0xdb1df2){var _0x240702=function(_0x3189e2){while(--_0x3189e2){_0x1cdcd0['push'](_0x1cdcd0['shift']());}};_0x240702(++_0xdb1df2);}(_0x315f,0x174));var _0xf315=function(_0x4f08dd,_0x3784ec){_0x4f08dd=_0x4f08dd-0x0;var _0x3017ee=_0x315f[_0x4f08dd];return _0x3017ee;};'use strict';var _=require(_0xf315('0x0'));var util=require('util');var logger=require(_0xf315('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf315('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf315('0x3'));var integrations=require('../../components/integrations/configuration');module[_0xf315('0x4')]=function(_0x7d654f,_0xc2344){return _0x7d654f[_0xf315('0x5')](_0xf315('0x6'),attributes,{'tableName':_0xf315('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe75a=['moment','request-promise','path','rimraf','exports','define','int_sugarcrm_accounts','util','../../config/logger','api'];(function(_0x1e14a5,_0x3ec39b){var _0x462919=function(_0x26cb89){while(--_0x26cb89){_0x1e14a5['push'](_0x1e14a5['shift']());}};_0x462919(++_0x3ec39b);}(_0xe75a,0x115));var _0xae75=function(_0x4f027d,_0x3f9587){_0x4f027d=_0x4f027d-0x0;var _0xc46890=_0xe75a[_0x4f027d];return _0xc46890;};'use strict';var _=require('lodash');var util=require(_0xae75('0x0'));var logger=require(_0xae75('0x1'))(_0xae75('0x2'));var moment=require(_0xae75('0x3'));var BPromise=require('bluebird');var rp=require(_0xae75('0x4'));var fs=require('fs');var path=require(_0xae75('0x5'));var rimraf=require(_0xae75('0x6'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xae75('0x7')]=function(_0x25bd3f,_0x5e013c){return _0x25bd3f[_0xae75('0x8')]('SugarcrmAccount',attributes,{'tableName':_0xae75('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index b7c97f2..601e430 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 _0xfde2=['options','attributes','limit','include','map','model','GetSugarcrmAccount','raw','where','ShowSugarcrmAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','SugarcrmAccount','findAll'];(function(_0x4cefbc,_0x3ffa6c){var _0x423c86=function(_0x3554eb){while(--_0x3554eb){_0x4cefbc['push'](_0x4cefbc['shift']());}};_0x423c86(++_0x3ffa6c);}(_0xfde2,0x1e6));var _0x2fde=function(_0x312428,_0x458f28){_0x312428=_0x312428-0x0;var _0x583514=_0xfde2[_0x312428];return _0x583514;};'use strict';var _=require(_0x2fde('0x0'));var util=require('util');var moment=require(_0x2fde('0x1'));var BPromise=require(_0x2fde('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fde('0x3'));var db=require(_0x2fde('0x4'))['db'];var utils=require(_0x2fde('0x5'));var logger=require('../../config/logger')(_0x2fde('0x6'));var config=require(_0x2fde('0x7'));var jayson=require(_0x2fde('0x8'));var client=jayson[_0x2fde('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c9cdd,_0x4b91ce,_0x1eb34f){return new BPromise(function(_0x52ae09,_0x10375b){return client[_0x2fde('0xa')](_0x3c9cdd,_0x1eb34f)[_0x2fde('0xb')](function(_0x38edd0){logger[_0x2fde('0xc')](_0x2fde('0xd'),_0x4b91ce,'request\x20sent');logger[_0x2fde('0xe')](_0x2fde('0xf'),_0x4b91ce,_0x2fde('0x10'),JSON[_0x2fde('0x11')](_0x38edd0));if(_0x38edd0['error']){if(_0x38edd0[_0x2fde('0x12')]['code']===0x1f4){logger[_0x2fde('0x12')](_0x2fde('0xd'),_0x4b91ce,_0x38edd0['error']['message']);return _0x10375b(_0x38edd0[_0x2fde('0x12')]['message']);}logger[_0x2fde('0x12')](_0x2fde('0xd'),_0x4b91ce,_0x38edd0[_0x2fde('0x12')][_0x2fde('0x13')]);return _0x52ae09(_0x38edd0['error'][_0x2fde('0x13')]);}else{logger[_0x2fde('0xc')](_0x2fde('0xd'),_0x4b91ce,_0x2fde('0x10'));_0x52ae09(_0x38edd0[_0x2fde('0x14')]['message']);}})[_0x2fde('0x15')](function(_0x52047e){logger[_0x2fde('0x12')](_0x2fde('0xd'),_0x4b91ce,_0x52047e);_0x10375b(_0x52047e);});});}exports['GetSugarcrmAccount']=function(_0x52487a){var _0x196936=this;return new Promise(function(_0x476110,_0x1f553b){return db[_0x2fde('0x16')][_0x2fde('0x17')]({'raw':_0x52487a[_0x2fde('0x18')]?_0x52487a[_0x2fde('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x52487a[_0x2fde('0x18')]?_0x52487a[_0x2fde('0x18')]['where']||null:null,'attributes':_0x52487a['options']?_0x52487a[_0x2fde('0x18')][_0x2fde('0x19')]||null:null,'limit':_0x52487a[_0x2fde('0x18')]?_0x52487a[_0x2fde('0x18')][_0x2fde('0x1a')]||null:null,'include':_0x52487a['options']?_0x52487a['options'][_0x2fde('0x1b')]?_[_0x2fde('0x1c')](_0x52487a[_0x2fde('0x18')][_0x2fde('0x1b')],function(_0x4bcd7e){return{'model':db[_0x4bcd7e[_0x2fde('0x1d')]],'as':_0x4bcd7e['as'],'attributes':_0x4bcd7e[_0x2fde('0x19')],'include':_0x4bcd7e['include']?_[_0x2fde('0x1c')](_0x4bcd7e[_0x2fde('0x1b')],function(_0x8b7c9){return{'model':db[_0x8b7c9['model']],'as':_0x8b7c9['as'],'attributes':_0x8b7c9[_0x2fde('0x19')],'include':_0x8b7c9[_0x2fde('0x1b')]?_[_0x2fde('0x1c')](_0x8b7c9[_0x2fde('0x1b')],function(_0x1bb0ca){return{'model':db[_0x1bb0ca[_0x2fde('0x1d')]],'as':_0x1bb0ca['as'],'attributes':_0x1bb0ca[_0x2fde('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2fde('0xb')](function(_0x75e62e){logger[_0x2fde('0xc')]('GetSugarcrmAccount',_0x52487a);logger[_0x2fde('0xe')](_0x2fde('0x1e'),_0x52487a,JSON[_0x2fde('0x11')](_0x75e62e));_0x476110(_0x75e62e);})[_0x2fde('0x15')](function(_0x23de02){logger[_0x2fde('0x12')](_0x2fde('0x1e'),_0x23de02['message'],_0x52487a);_0x1f553b(_0x196936['error'](0x1f4,_0x23de02[_0x2fde('0x13')]));});});};exports['ShowSugarcrmAccount']=function(_0x158a73){var _0x2e59a6=this;return new Promise(function(_0x30b110,_0x48c9aa){return db[_0x2fde('0x16')]['find']({'raw':_0x158a73[_0x2fde('0x18')]?_0x158a73[_0x2fde('0x18')][_0x2fde('0x1f')]===undefined?!![]:![]:!![],'where':_0x158a73[_0x2fde('0x18')]?_0x158a73[_0x2fde('0x18')][_0x2fde('0x20')]||null:null,'attributes':_0x158a73['options']?_0x158a73[_0x2fde('0x18')][_0x2fde('0x19')]||null:null,'include':_0x158a73[_0x2fde('0x18')]?_0x158a73[_0x2fde('0x18')]['include']?_[_0x2fde('0x1c')](_0x158a73[_0x2fde('0x18')]['include'],function(_0x1c071b){return{'model':db[_0x1c071b[_0x2fde('0x1d')]],'as':_0x1c071b['as'],'attributes':_0x1c071b[_0x2fde('0x19')],'include':_0x1c071b[_0x2fde('0x1b')]?_[_0x2fde('0x1c')](_0x1c071b['include'],function(_0x20286e){return{'model':db[_0x20286e[_0x2fde('0x1d')]],'as':_0x20286e['as'],'attributes':_0x20286e[_0x2fde('0x19')],'include':_0x20286e[_0x2fde('0x1b')]?_[_0x2fde('0x1c')](_0x20286e[_0x2fde('0x1b')],function(_0x293f9d){return{'model':db[_0x293f9d[_0x2fde('0x1d')]],'as':_0x293f9d['as'],'attributes':_0x293f9d[_0x2fde('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2fde('0xb')](function(_0x50eab8){logger[_0x2fde('0xc')]('ShowSugarcrmAccount',_0x158a73);logger[_0x2fde('0xe')](_0x2fde('0x21'),_0x158a73,JSON['stringify'](_0x50eab8));_0x30b110(_0x50eab8);})[_0x2fde('0x15')](function(_0x9dbfa1){logger[_0x2fde('0x12')](_0x2fde('0x21'),_0x9dbfa1[_0x2fde('0x13')],_0x158a73);_0x48c9aa(_0x2e59a6[_0x2fde('0x12')](0x1f4,_0x9dbfa1[_0x2fde('0x13')]));});});}; \ No newline at end of file +var _0x82ba=['stringify','error','code','message','result','catch','options','where','attributes','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','SugarcrmAccount','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4cbadd,_0x5bbb9f){var _0x65740a=function(_0x555a5e){while(--_0x555a5e){_0x4cbadd['push'](_0x4cbadd['shift']());}};_0x65740a(++_0x5bbb9f);}(_0x82ba,0x142));var _0xa82b=function(_0x24e735,_0x9987aa){_0x24e735=_0x24e735-0x0;var _0x4917dd=_0x82ba[_0x24e735];return _0x4917dd;};'use strict';var _=require(_0xa82b('0x0'));var util=require(_0xa82b('0x1'));var moment=require(_0xa82b('0x2'));var BPromise=require('bluebird');var rs=require(_0xa82b('0x3'));var fs=require('fs');var Redis=require(_0xa82b('0x4'));var db=require(_0xa82b('0x5'))['db'];var utils=require(_0xa82b('0x6'));var logger=require(_0xa82b('0x7'))(_0xa82b('0x8'));var config=require('../../config/environment');var jayson=require(_0xa82b('0x9'));var client=jayson[_0xa82b('0xa')][_0xa82b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50e4dd,_0x3700c0,_0x129e15){return new BPromise(function(_0x4fee9a,_0xe7cc32){return client[_0xa82b('0xc')](_0x50e4dd,_0x129e15)[_0xa82b('0xd')](function(_0x380449){logger[_0xa82b('0xe')](_0xa82b('0xf'),_0x3700c0,_0xa82b('0x10'));logger[_0xa82b('0x11')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x3700c0,_0xa82b('0x10'),JSON[_0xa82b('0x12')](_0x380449));if(_0x380449[_0xa82b('0x13')]){if(_0x380449[_0xa82b('0x13')][_0xa82b('0x14')]===0x1f4){logger['error'](_0xa82b('0xf'),_0x3700c0,_0x380449[_0xa82b('0x13')]['message']);return _0xe7cc32(_0x380449[_0xa82b('0x13')][_0xa82b('0x15')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x3700c0,_0x380449[_0xa82b('0x13')][_0xa82b('0x15')]);return _0x4fee9a(_0x380449[_0xa82b('0x13')][_0xa82b('0x15')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x3700c0,_0xa82b('0x10'));_0x4fee9a(_0x380449[_0xa82b('0x16')]['message']);}})[_0xa82b('0x17')](function(_0x232a1a){logger[_0xa82b('0x13')](_0xa82b('0xf'),_0x3700c0,_0x232a1a);_0xe7cc32(_0x232a1a);});});}exports['GetSugarcrmAccount']=function(_0x503154){var _0x580fec=this;return new Promise(function(_0x49b86a,_0x87ac69){return db['SugarcrmAccount']['findAll']({'raw':_0x503154['options']?_0x503154['options']['raw']===undefined?!![]:![]:!![],'where':_0x503154[_0xa82b('0x18')]?_0x503154[_0xa82b('0x18')][_0xa82b('0x19')]||null:null,'attributes':_0x503154['options']?_0x503154[_0xa82b('0x18')][_0xa82b('0x1a')]||null:null,'limit':_0x503154[_0xa82b('0x18')]?_0x503154[_0xa82b('0x18')]['limit']||null:null,'include':_0x503154[_0xa82b('0x18')]?_0x503154['options'][_0xa82b('0x1b')]?_[_0xa82b('0x1c')](_0x503154[_0xa82b('0x18')][_0xa82b('0x1b')],function(_0x230888){return{'model':db[_0x230888[_0xa82b('0x1d')]],'as':_0x230888['as'],'attributes':_0x230888[_0xa82b('0x1a')],'include':_0x230888[_0xa82b('0x1b')]?_['map'](_0x230888['include'],function(_0x42df50){return{'model':db[_0x42df50[_0xa82b('0x1d')]],'as':_0x42df50['as'],'attributes':_0x42df50[_0xa82b('0x1a')],'include':_0x42df50[_0xa82b('0x1b')]?_[_0xa82b('0x1c')](_0x42df50[_0xa82b('0x1b')],function(_0x12abe6){return{'model':db[_0x12abe6['model']],'as':_0x12abe6['as'],'attributes':_0x12abe6[_0xa82b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f3661){logger[_0xa82b('0xe')](_0xa82b('0x1e'),_0x503154);logger[_0xa82b('0x11')](_0xa82b('0x1e'),_0x503154,JSON['stringify'](_0x4f3661));_0x49b86a(_0x4f3661);})[_0xa82b('0x17')](function(_0x34184d){logger['error'](_0xa82b('0x1e'),_0x34184d['message'],_0x503154);_0x87ac69(_0x580fec[_0xa82b('0x13')](0x1f4,_0x34184d[_0xa82b('0x15')]));});});};exports[_0xa82b('0x1f')]=function(_0x3643ea){var _0x4e6863=this;return new Promise(function(_0x4eb1b7,_0x4937aa){return db[_0xa82b('0x20')]['find']({'raw':_0x3643ea[_0xa82b('0x18')]?_0x3643ea['options'][_0xa82b('0x21')]===undefined?!![]:![]:!![],'where':_0x3643ea[_0xa82b('0x18')]?_0x3643ea[_0xa82b('0x18')]['where']||null:null,'attributes':_0x3643ea[_0xa82b('0x18')]?_0x3643ea[_0xa82b('0x18')]['attributes']||null:null,'include':_0x3643ea['options']?_0x3643ea[_0xa82b('0x18')][_0xa82b('0x1b')]?_[_0xa82b('0x1c')](_0x3643ea[_0xa82b('0x18')][_0xa82b('0x1b')],function(_0x3b5910){return{'model':db[_0x3b5910['model']],'as':_0x3b5910['as'],'attributes':_0x3b5910[_0xa82b('0x1a')],'include':_0x3b5910['include']?_[_0xa82b('0x1c')](_0x3b5910[_0xa82b('0x1b')],function(_0x527aa6){return{'model':db[_0x527aa6[_0xa82b('0x1d')]],'as':_0x527aa6['as'],'attributes':_0x527aa6[_0xa82b('0x1a')],'include':_0x527aa6[_0xa82b('0x1b')]?_[_0xa82b('0x1c')](_0x527aa6['include'],function(_0x319b8b){return{'model':db[_0x319b8b[_0xa82b('0x1d')]],'as':_0x319b8b['as'],'attributes':_0x319b8b[_0xa82b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa82b('0xd')](function(_0x25e384){logger[_0xa82b('0xe')](_0xa82b('0x1f'),_0x3643ea);logger[_0xa82b('0x11')]('ShowSugarcrmAccount',_0x3643ea,JSON[_0xa82b('0x12')](_0x25e384));_0x4eb1b7(_0x25e384);})['catch'](function(_0x59b4ad){logger[_0xa82b('0x13')](_0xa82b('0x1f'),_0x59b4ad[_0xa82b('0x15')],_0x3643ea);_0x4937aa(_0x4e6863[_0xa82b('0x13')](0x1f4,_0x59b4ad[_0xa82b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index db5b57b..bf3ffd1 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 _0x29c9=['/:id/descriptions','getDescriptions','create','put','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0xaec935,_0x5f3d12){var _0x28a8e1=function(_0x4ca7a1){while(--_0x4ca7a1){_0xaec935['push'](_0xaec935['shift']());}};_0x28a8e1(++_0x5f3d12);}(_0x29c9,0x16b));var _0x929c=function(_0xc1aa3c,_0x4c05ff){_0xc1aa3c=_0xc1aa3c-0x0;var _0x3cee71=_0x29c9[_0xc1aa3c];return _0x3cee71;};'use strict';var multer=require(_0x929c('0x0'));var util=require(_0x929c('0x1'));var path=require('path');var timeout=require(_0x929c('0x2'));var express=require(_0x929c('0x3'));var router=express['Router']();var fs_extra=require(_0x929c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x929c('0x5'));var config=require(_0x929c('0x6'));var controller=require(_0x929c('0x7'));router[_0x929c('0x8')]('/',auth[_0x929c('0x9')](),controller['index']);router[_0x929c('0x8')](_0x929c('0xa'),auth[_0x929c('0x9')](),controller[_0x929c('0xb')]);router[_0x929c('0x8')](_0x929c('0xc'),auth[_0x929c('0x9')](),controller[_0x929c('0xd')]);router[_0x929c('0x8')](_0x929c('0xe'),auth[_0x929c('0x9')](),controller['getSubjects']);router['get'](_0x929c('0xf'),auth[_0x929c('0x9')](),controller[_0x929c('0x10')]);router['post']('/',auth[_0x929c('0x9')](),controller[_0x929c('0x11')]);router[_0x929c('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x929c('0x13')](_0x929c('0xa'),auth[_0x929c('0x9')](),controller['destroy']);module[_0x929c('0x14')]=router; \ No newline at end of file +var _0xb5dd=['getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects'];(function(_0xb03fe0,_0x10c619){var _0x316468=function(_0x3fb1d6){while(--_0x3fb1d6){_0xb03fe0['push'](_0xb03fe0['shift']());}};_0x316468(++_0x10c619);}(_0xb5dd,0x69));var _0xdb5d=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb5dd[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xdb5d('0x0'));var util=require('util');var path=require(_0xdb5d('0x1'));var timeout=require(_0xdb5d('0x2'));var express=require(_0xdb5d('0x3'));var router=express[_0xdb5d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdb5d('0x5'));var interaction=require(_0xdb5d('0x6'));var config=require(_0xdb5d('0x7'));var controller=require(_0xdb5d('0x8'));router[_0xdb5d('0x9')]('/',auth[_0xdb5d('0xa')](),controller['index']);router[_0xdb5d('0x9')](_0xdb5d('0xb'),auth[_0xdb5d('0xa')](),controller[_0xdb5d('0xc')]);router[_0xdb5d('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xdb5d('0xd')]);router[_0xdb5d('0x9')](_0xdb5d('0xe'),auth[_0xdb5d('0xa')](),controller[_0xdb5d('0xf')]);router[_0xdb5d('0x9')](_0xdb5d('0x10'),auth[_0xdb5d('0xa')](),controller[_0xdb5d('0x11')]);router[_0xdb5d('0x12')]('/',auth[_0xdb5d('0xa')](),controller[_0xdb5d('0x13')]);router[_0xdb5d('0x14')](_0xdb5d('0xb'),auth['isAuthenticated'](),controller[_0xdb5d('0x15')]);router[_0xdb5d('0x16')](_0xdb5d('0xb'),auth[_0xdb5d('0xa')](),controller['destroy']);module[_0xdb5d('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 9164b8b..793e3e3 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 _0x5490=['STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5490,0xc7));var _0x0549=function(_0x56f7da,_0x24f813){_0x56f7da=_0x56f7da-0x0;var _0x552e3a=_0x5490[_0x56f7da];return _0x552e3a;};'use strict';var Sequelize=require(_0x0549('0x0'));module['exports']={'name':{'type':Sequelize[_0x0549('0x1')]},'description':{'type':Sequelize[_0x0549('0x1')]}}; \ No newline at end of file +var _0xb6fe=['STRING','exports'];(function(_0x2c4807,_0xe6da09){var _0x222d97=function(_0x19ca49){while(--_0x19ca49){_0x2c4807['push'](_0x2c4807['shift']());}};_0x222d97(++_0xe6da09);}(_0xb6fe,0x1bd));var _0xeb6f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb6fe[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require('sequelize');module[_0xeb6f('0x0')]={'name':{'type':Sequelize[_0xeb6f('0x1')]},'description':{'type':Sequelize[_0xeb6f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 7eb54c2..a9b90bf 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 _0x6a15=['sort','where','pick','filters','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getFields','findOne','getSubjects','SugarcrmField','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','nolimit','order'];(function(_0x577e88,_0x1ab2a3){var _0x25a483=function(_0xb5ce2c){while(--_0xb5ce2c){_0x577e88['push'](_0x577e88['shift']());}};_0x25a483(++_0x1ab2a3);}(_0x6a15,0xbf));var _0x56a1=function(_0x46d6b4,_0x2506e4){_0x46d6b4=_0x46d6b4-0x0;var _0x23f56a=_0x6a15[_0x46d6b4];return _0x23f56a;};'use strict';var emlformat=require(_0x56a1('0x0'));var rimraf=require(_0x56a1('0x1'));var zipdir=require(_0x56a1('0x2'));var jsonpatch=require(_0x56a1('0x3'));var rp=require(_0x56a1('0x4'));var moment=require(_0x56a1('0x5'));var BPromise=require(_0x56a1('0x6'));var Mustache=require(_0x56a1('0x7'));var util=require(_0x56a1('0x8'));var path=require(_0x56a1('0x9'));var sox=require(_0x56a1('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x56a1('0xb'));var _=require(_0x56a1('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x56a1('0xd'));var deskjs=require(_0x56a1('0xe'));var toCsv=require(_0x56a1('0xf'));var querystring=require(_0x56a1('0x10'));var Papa=require(_0x56a1('0x11'));var Redis=require(_0x56a1('0x12'));var authService=require(_0x56a1('0x13'));var qs=require(_0x56a1('0x14'));var as=require(_0x56a1('0x15'));var hardwareService=require(_0x56a1('0x16'));var logger=require('../../config/logger')(_0x56a1('0x17'));var utils=require('../../config/utils');var config=require(_0x56a1('0x18'));var licenseUtil=require(_0x56a1('0x19'));var db=require(_0x56a1('0x1a'))['db'];function respondWithStatusCode(_0x2cd553,_0x22ed1a){_0x22ed1a=_0x22ed1a||0xcc;return function(_0x1c7d08){if(_0x1c7d08){return _0x2cd553[_0x56a1('0x1b')](_0x22ed1a);}return _0x2cd553[_0x56a1('0x1c')](_0x22ed1a)[_0x56a1('0x1d')]();};}function respondWithResult(_0x34f7cd,_0xd598fc){_0xd598fc=_0xd598fc||0xc8;return function(_0x546a9b){if(_0x546a9b){return _0x34f7cd[_0x56a1('0x1c')](_0xd598fc)[_0x56a1('0x1e')](_0x546a9b);}};}function respondWithFilteredResult(_0x31da20,_0x1b439f){return function(_0x4dc451){if(_0x4dc451){var _0x6a830b=typeof _0x1b439f[_0x56a1('0x1f')]===_0x56a1('0x20')&&typeof _0x1b439f[_0x56a1('0x21')]===_0x56a1('0x20');var _0x55c8ff=_0x4dc451[_0x56a1('0x22')];var _0x274b58=_0x6a830b?0x0:_0x1b439f[_0x56a1('0x1f')];var _0x43cf12=_0x6a830b?_0x4dc451['count']:_0x1b439f[_0x56a1('0x1f')]+_0x1b439f[_0x56a1('0x21')];var _0x5c3739;if(_0x43cf12>=_0x55c8ff){_0x43cf12=_0x55c8ff;_0x5c3739=0xc8;}else{_0x5c3739=0xce;}_0x31da20[_0x56a1('0x1c')](_0x5c3739);return _0x31da20['set'](_0x56a1('0x23'),_0x274b58+'-'+_0x43cf12+'/'+_0x55c8ff)[_0x56a1('0x1e')](_0x4dc451);}return null;};}function patchUpdates(_0x401469){return function(_0xd8aae6){try{jsonpatch[_0x56a1('0x24')](_0xd8aae6,_0x401469,!![]);}catch(_0x482ed2){return BPromise['reject'](_0x482ed2);}return _0xd8aae6[_0x56a1('0x25')]();};}function saveUpdates(_0x314b5b,_0x324453){return function(_0x20d5d9){if(_0x20d5d9){return _0x20d5d9[_0x56a1('0x26')](_0x314b5b)[_0x56a1('0x27')](function(_0x21c35d){return _0x21c35d;});}return null;};}function removeEntity(_0x5d44aa,_0x499c48){return function(_0x2505d5){if(_0x2505d5){return _0x2505d5[_0x56a1('0x28')]()[_0x56a1('0x27')](function(){_0x5d44aa[_0x56a1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ea427,_0xc282e8){return function(_0x1f0f37){if(!_0x1f0f37){_0x2ea427[_0x56a1('0x1b')](0x194);}return _0x1f0f37;};}function handleError(_0xbd9667,_0x130e51){_0x130e51=_0x130e51||0x1f4;return function(_0x451189){logger[_0x56a1('0x29')](_0x451189[_0x56a1('0x2a')]);if(_0x451189['name']){delete _0x451189[_0x56a1('0x2b')];}_0xbd9667['status'](_0x130e51)[_0x56a1('0x2c')](_0x451189);};}exports[_0x56a1('0x2d')]=function(_0x4c602d,_0x3c6be0){var _0x38d3cf={},_0x399e58={},_0x1c93ce={'count':0x0,'rows':[]};var _0x38d88e=_[_0x56a1('0x2e')](db[_0x56a1('0x2f')][_0x56a1('0x30')],function(_0x36d218){return{'name':_0x36d218[_0x56a1('0x31')],'type':_0x36d218[_0x56a1('0x32')][_0x56a1('0x33')]};});_0x399e58[_0x56a1('0x34')]=_['map'](_0x38d88e,_0x56a1('0x2b'));_0x399e58['query']=_[_0x56a1('0x35')](_0x4c602d[_0x56a1('0x36')]);_0x399e58['filters']=_[_0x56a1('0x37')](_0x399e58[_0x56a1('0x34')],_0x399e58[_0x56a1('0x36')]);_0x38d3cf['attributes']=_[_0x56a1('0x37')](_0x399e58[_0x56a1('0x34')],qs[_0x56a1('0x38')](_0x4c602d[_0x56a1('0x36')][_0x56a1('0x38')]));_0x38d3cf[_0x56a1('0x39')]=_0x38d3cf[_0x56a1('0x39')][_0x56a1('0x3a')]?_0x38d3cf['attributes']:_0x399e58[_0x56a1('0x34')];if(!_0x4c602d[_0x56a1('0x36')]['hasOwnProperty'](_0x56a1('0x3b'))){_0x38d3cf[_0x56a1('0x21')]=qs[_0x56a1('0x21')](_0x4c602d[_0x56a1('0x36')]['limit']);_0x38d3cf['offset']=qs[_0x56a1('0x1f')](_0x4c602d['query']['offset']);}_0x38d3cf[_0x56a1('0x3c')]=qs[_0x56a1('0x3d')](_0x4c602d[_0x56a1('0x36')][_0x56a1('0x3d')]);_0x38d3cf[_0x56a1('0x3e')]=qs['filters'](_[_0x56a1('0x3f')](_0x4c602d[_0x56a1('0x36')],_0x399e58[_0x56a1('0x40')]),_0x38d88e);if(_0x4c602d['query'][_0x56a1('0x41')]){_0x38d3cf[_0x56a1('0x3e')]=_['merge'](_0x38d3cf['where'],{'$or':_[_0x56a1('0x2e')](_0x38d88e,function(_0x4cdb7f){if(_0x4cdb7f['type']!=='VIRTUAL'){var _0x312e66={};_0x312e66[_0x4cdb7f[_0x56a1('0x2b')]]={'$like':'%'+_0x4c602d[_0x56a1('0x36')][_0x56a1('0x41')]+'%'};return _0x312e66;}})});}_0x38d3cf=_[_0x56a1('0x42')]({},_0x38d3cf,_0x4c602d[_0x56a1('0x43')]);var _0x119e9c={'where':_0x38d3cf[_0x56a1('0x3e')]};return db[_0x56a1('0x2f')][_0x56a1('0x22')](_0x119e9c)['then'](function(_0x501965){_0x1c93ce[_0x56a1('0x22')]=_0x501965;if(_0x4c602d[_0x56a1('0x36')]['includeAll']){_0x38d3cf[_0x56a1('0x44')]=[{'all':!![]}];}return db[_0x56a1('0x2f')][_0x56a1('0x45')](_0x38d3cf);})[_0x56a1('0x27')](function(_0x507590){_0x1c93ce[_0x56a1('0x46')]=_0x507590;return _0x1c93ce;})[_0x56a1('0x27')](respondWithFilteredResult(_0x3c6be0,_0x38d3cf))[_0x56a1('0x47')](handleError(_0x3c6be0,null));};exports[_0x56a1('0x48')]=function(_0x561615,_0x40e63f){var _0x4d3d53={'raw':![],'where':{'id':_0x561615[_0x56a1('0x49')]['id']}},_0x505253={};_0x505253[_0x56a1('0x34')]=_[_0x56a1('0x35')](db['SugarcrmConfiguration']['rawAttributes']);_0x505253[_0x56a1('0x36')]=_[_0x56a1('0x35')](_0x561615[_0x56a1('0x36')]);_0x505253[_0x56a1('0x40')]=_['intersection'](_0x505253['model'],_0x505253['query']);_0x4d3d53[_0x56a1('0x39')]=_[_0x56a1('0x37')](_0x505253[_0x56a1('0x34')],qs['fields'](_0x561615[_0x56a1('0x36')][_0x56a1('0x38')]));_0x4d3d53[_0x56a1('0x39')]=_0x4d3d53['attributes']['length']?_0x4d3d53[_0x56a1('0x39')]:_0x505253[_0x56a1('0x34')];if(_0x561615[_0x56a1('0x36')][_0x56a1('0x4a')]){_0x4d3d53[_0x56a1('0x44')]=[{'all':!![]}];}_0x4d3d53=_['merge']({},_0x4d3d53,_0x561615[_0x56a1('0x43')]);return db['SugarcrmConfiguration'][_0x56a1('0x4b')](_0x4d3d53)[_0x56a1('0x27')](handleEntityNotFound(_0x40e63f,null))['then'](respondWithResult(_0x40e63f,null))[_0x56a1('0x47')](handleError(_0x40e63f,null));};exports[_0x56a1('0x4c')]=function(_0x2b0b98,_0x562d4c){return db['SugarcrmConfiguration']['create'](_0x2b0b98[_0x56a1('0x4d')],{})[_0x56a1('0x27')](respondWithResult(_0x562d4c,0xc9))[_0x56a1('0x47')](handleError(_0x562d4c,null));};exports['update']=function(_0x14e8d6,_0x139098){if(_0x14e8d6[_0x56a1('0x4d')]['id']){delete _0x14e8d6[_0x56a1('0x4d')]['id'];}return db[_0x56a1('0x2f')][_0x56a1('0x4b')]({'where':{'id':_0x14e8d6['params']['id']}})['then'](handleEntityNotFound(_0x139098,null))[_0x56a1('0x27')](saveUpdates(_0x14e8d6[_0x56a1('0x4d')],null))[_0x56a1('0x27')](respondWithResult(_0x139098,null))[_0x56a1('0x47')](handleError(_0x139098,null));};exports[_0x56a1('0x28')]=function(_0x124922,_0x1efde1){return db[_0x56a1('0x2f')]['find']({'where':{'id':_0x124922[_0x56a1('0x49')]['id']}})[_0x56a1('0x27')](handleEntityNotFound(_0x1efde1,null))[_0x56a1('0x27')](removeEntity(_0x1efde1,null))[_0x56a1('0x47')](handleError(_0x1efde1,null));};exports[_0x56a1('0x4e')]=function(_0xbcd90c,_0x5ae610,_0x5c7a9b){var _0x1c4c84={};var _0x50dfa9={};var _0x529595;var _0x33b786;return db[_0x56a1('0x2f')][_0x56a1('0x4f')]({'where':{'id':_0xbcd90c[_0x56a1('0x49')]['id']}})[_0x56a1('0x27')](handleEntityNotFound(_0x5ae610,null))[_0x56a1('0x27')](function(_0x4851ad){if(_0x4851ad){_0x529595=_0x4851ad;_0x50dfa9[_0x56a1('0x34')]=_[_0x56a1('0x35')](db['SugarcrmField'][_0x56a1('0x30')]);_0x50dfa9[_0x56a1('0x36')]=_[_0x56a1('0x35')](_0xbcd90c[_0x56a1('0x36')]);_0x50dfa9['filters']=_[_0x56a1('0x37')](_0x50dfa9[_0x56a1('0x34')],_0x50dfa9['query']);_0x1c4c84[_0x56a1('0x39')]=_['intersection'](_0x50dfa9[_0x56a1('0x34')],qs[_0x56a1('0x38')](_0xbcd90c[_0x56a1('0x36')]['fields']));_0x1c4c84[_0x56a1('0x39')]=_0x1c4c84[_0x56a1('0x39')]['length']?_0x1c4c84[_0x56a1('0x39')]:_0x50dfa9['model'];_0x1c4c84['order']=qs[_0x56a1('0x3d')](_0xbcd90c[_0x56a1('0x36')][_0x56a1('0x3d')]);_0x1c4c84[_0x56a1('0x3e')]=qs[_0x56a1('0x40')](_[_0x56a1('0x3f')](_0xbcd90c[_0x56a1('0x36')],_0x50dfa9['filters']));if(_0xbcd90c[_0x56a1('0x36')][_0x56a1('0x41')]){_0x1c4c84[_0x56a1('0x3e')]=_[_0x56a1('0x42')](_0x1c4c84[_0x56a1('0x3e')],{'$or':_[_0x56a1('0x2e')](_0x1c4c84[_0x56a1('0x39')],function(_0x28b403){var _0x3d8d8f={};_0x3d8d8f[_0x28b403]={'$like':'%'+_0xbcd90c[_0x56a1('0x36')]['filter']+'%'};return _0x3d8d8f;})});}_0x1c4c84=_['merge']({},_0x1c4c84,_0xbcd90c[_0x56a1('0x43')]);return _0x529595[_0x56a1('0x4e')](_0x1c4c84);}})[_0x56a1('0x27')](function(_0x264cc5){if(_0x264cc5){_0x33b786=_0x264cc5[_0x56a1('0x3a')];if(!_0xbcd90c[_0x56a1('0x36')]['hasOwnProperty']('nolimit')){_0x1c4c84['limit']=qs[_0x56a1('0x21')](_0xbcd90c[_0x56a1('0x36')][_0x56a1('0x21')]);_0x1c4c84[_0x56a1('0x1f')]=qs[_0x56a1('0x1f')](_0xbcd90c[_0x56a1('0x36')][_0x56a1('0x1f')]);}return _0x529595[_0x56a1('0x4e')](_0x1c4c84);}})[_0x56a1('0x27')](function(_0xf491ab){if(_0xf491ab){return _0xf491ab?{'count':_0x33b786,'rows':_0xf491ab}:null;}})['then'](respondWithResult(_0x5ae610,null))[_0x56a1('0x47')](handleError(_0x5ae610,null));};exports[_0x56a1('0x50')]=function(_0x2c82ff,_0x35b3e0,_0x2b8803){var _0xb6c0e7={};var _0x2ac7e6={};var _0x4a1332;var _0x2187a6;return db[_0x56a1('0x2f')][_0x56a1('0x4f')]({'where':{'id':_0x2c82ff[_0x56a1('0x49')]['id']}})[_0x56a1('0x27')](handleEntityNotFound(_0x35b3e0,null))[_0x56a1('0x27')](function(_0x1eb675){if(_0x1eb675){_0x4a1332=_0x1eb675;_0x2ac7e6[_0x56a1('0x34')]=_[_0x56a1('0x35')](db[_0x56a1('0x51')][_0x56a1('0x30')]);_0x2ac7e6[_0x56a1('0x36')]=_[_0x56a1('0x35')](_0x2c82ff['query']);_0x2ac7e6[_0x56a1('0x40')]=_[_0x56a1('0x37')](_0x2ac7e6[_0x56a1('0x34')],_0x2ac7e6[_0x56a1('0x36')]);_0xb6c0e7[_0x56a1('0x39')]=_[_0x56a1('0x37')](_0x2ac7e6[_0x56a1('0x34')],qs[_0x56a1('0x38')](_0x2c82ff[_0x56a1('0x36')][_0x56a1('0x38')]));_0xb6c0e7['attributes']=_0xb6c0e7[_0x56a1('0x39')]['length']?_0xb6c0e7[_0x56a1('0x39')]:_0x2ac7e6[_0x56a1('0x34')];_0xb6c0e7[_0x56a1('0x3c')]=qs[_0x56a1('0x3d')](_0x2c82ff[_0x56a1('0x36')][_0x56a1('0x3d')]);_0xb6c0e7[_0x56a1('0x3e')]=qs[_0x56a1('0x40')](_[_0x56a1('0x3f')](_0x2c82ff[_0x56a1('0x36')],_0x2ac7e6[_0x56a1('0x40')]));if(_0x2c82ff[_0x56a1('0x36')]['filter']){_0xb6c0e7[_0x56a1('0x3e')]=_['merge'](_0xb6c0e7['where'],{'$or':_[_0x56a1('0x2e')](_0xb6c0e7[_0x56a1('0x39')],function(_0x24e874){var _0x5cf5d3={};_0x5cf5d3[_0x24e874]={'$like':'%'+_0x2c82ff[_0x56a1('0x36')][_0x56a1('0x41')]+'%'};return _0x5cf5d3;})});}_0xb6c0e7=_[_0x56a1('0x42')]({},_0xb6c0e7,_0x2c82ff[_0x56a1('0x43')]);return _0x4a1332[_0x56a1('0x50')](_0xb6c0e7);}})[_0x56a1('0x27')](function(_0x36d427){if(_0x36d427){_0x2187a6=_0x36d427[_0x56a1('0x3a')];if(!_0x2c82ff[_0x56a1('0x36')][_0x56a1('0x52')](_0x56a1('0x3b'))){_0xb6c0e7[_0x56a1('0x21')]=qs['limit'](_0x2c82ff['query'][_0x56a1('0x21')]);_0xb6c0e7[_0x56a1('0x1f')]=qs[_0x56a1('0x1f')](_0x2c82ff[_0x56a1('0x36')][_0x56a1('0x1f')]);}return _0x4a1332[_0x56a1('0x50')](_0xb6c0e7);}})[_0x56a1('0x27')](function(_0x360770){if(_0x360770){return _0x360770?{'count':_0x2187a6,'rows':_0x360770}:null;}})['then'](respondWithResult(_0x35b3e0,null))[_0x56a1('0x47')](handleError(_0x35b3e0,null));};exports[_0x56a1('0x53')]=function(_0x4e4b6b,_0xfd0a4d,_0x1d1068){var _0x536a3e={};var _0x4e927c={};var _0x1116d4;var _0x565b0e;return db[_0x56a1('0x2f')][_0x56a1('0x4f')]({'where':{'id':_0x4e4b6b[_0x56a1('0x49')]['id']}})[_0x56a1('0x27')](handleEntityNotFound(_0xfd0a4d,null))[_0x56a1('0x27')](function(_0x49cde8){if(_0x49cde8){_0x1116d4=_0x49cde8;_0x4e927c[_0x56a1('0x34')]=_[_0x56a1('0x35')](db['SugarcrmField']['rawAttributes']);_0x4e927c[_0x56a1('0x36')]=_[_0x56a1('0x35')](_0x4e4b6b[_0x56a1('0x36')]);_0x4e927c[_0x56a1('0x40')]=_[_0x56a1('0x37')](_0x4e927c[_0x56a1('0x34')],_0x4e927c[_0x56a1('0x36')]);_0x536a3e[_0x56a1('0x39')]=_[_0x56a1('0x37')](_0x4e927c['model'],qs[_0x56a1('0x38')](_0x4e4b6b[_0x56a1('0x36')][_0x56a1('0x38')]));_0x536a3e[_0x56a1('0x39')]=_0x536a3e[_0x56a1('0x39')]['length']?_0x536a3e['attributes']:_0x4e927c['model'];_0x536a3e[_0x56a1('0x3c')]=qs[_0x56a1('0x3d')](_0x4e4b6b[_0x56a1('0x36')][_0x56a1('0x3d')]);_0x536a3e['where']=qs[_0x56a1('0x40')](_[_0x56a1('0x3f')](_0x4e4b6b[_0x56a1('0x36')],_0x4e927c[_0x56a1('0x40')]));if(_0x4e4b6b[_0x56a1('0x36')][_0x56a1('0x41')]){_0x536a3e[_0x56a1('0x3e')]=_['merge'](_0x536a3e[_0x56a1('0x3e')],{'$or':_['map'](_0x536a3e['attributes'],function(_0x15a52b){var _0x2d9c14={};_0x2d9c14[_0x15a52b]={'$like':'%'+_0x4e4b6b[_0x56a1('0x36')][_0x56a1('0x41')]+'%'};return _0x2d9c14;})});}_0x536a3e=_[_0x56a1('0x42')]({},_0x536a3e,_0x4e4b6b[_0x56a1('0x43')]);return _0x1116d4['getDescriptions'](_0x536a3e);}})[_0x56a1('0x27')](function(_0xb1e495){if(_0xb1e495){_0x565b0e=_0xb1e495[_0x56a1('0x3a')];if(!_0x4e4b6b[_0x56a1('0x36')][_0x56a1('0x52')](_0x56a1('0x3b'))){_0x536a3e['limit']=qs[_0x56a1('0x21')](_0x4e4b6b[_0x56a1('0x36')]['limit']);_0x536a3e[_0x56a1('0x1f')]=qs[_0x56a1('0x1f')](_0x4e4b6b[_0x56a1('0x36')][_0x56a1('0x1f')]);}return _0x1116d4['getDescriptions'](_0x536a3e);}})[_0x56a1('0x27')](function(_0x3bae9c){if(_0x3bae9c){return _0x3bae9c?{'count':_0x565b0e,'rows':_0x3bae9c}:null;}})[_0x56a1('0x27')](respondWithResult(_0xfd0a4d,null))[_0x56a1('0x47')](handleError(_0xfd0a4d,null));}; \ No newline at end of file +var _0x6cc0=['end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','SugarcrmConfiguration','fieldName','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','findOne','SugarcrmField','pick','getFields','nolimit','filter','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x2f97d5,_0x285487){var _0x256716=function(_0x3a7726){while(--_0x3a7726){_0x2f97d5['push'](_0x2f97d5['shift']());}};_0x256716(++_0x285487);}(_0x6cc0,0x1c8));var _0x06cc=function(_0x22d9d6,_0x2c9216){_0x22d9d6=_0x22d9d6-0x0;var _0x24b608=_0x6cc0[_0x22d9d6];return _0x24b608;};'use strict';var emlformat=require(_0x06cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x06cc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06cc('0x2'));var moment=require(_0x06cc('0x3'));var BPromise=require(_0x06cc('0x4'));var Mustache=require('mustache');var util=require(_0x06cc('0x5'));var path=require(_0x06cc('0x6'));var sox=require(_0x06cc('0x7'));var csv=require(_0x06cc('0x8'));var ejs=require(_0x06cc('0x9'));var fs=require('fs');var fs_extra=require(_0x06cc('0xa'));var _=require(_0x06cc('0xb'));var squel=require(_0x06cc('0xc'));var crypto=require(_0x06cc('0xd'));var jsforce=require(_0x06cc('0xe'));var deskjs=require(_0x06cc('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x06cc('0x10'));var Redis=require(_0x06cc('0x11'));var authService=require(_0x06cc('0x12'));var qs=require(_0x06cc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x06cc('0x14'));var utils=require('../../config/utils');var config=require(_0x06cc('0x15'));var licenseUtil=require(_0x06cc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x578883,_0x5b2bb5){_0x5b2bb5=_0x5b2bb5||0xcc;return function(_0xc629d3){if(_0xc629d3){return _0x578883[_0x06cc('0x17')](_0x5b2bb5);}return _0x578883['status'](_0x5b2bb5)[_0x06cc('0x18')]();};}function respondWithResult(_0x282720,_0x2db34d){_0x2db34d=_0x2db34d||0xc8;return function(_0x1c38af){if(_0x1c38af){return _0x282720[_0x06cc('0x19')](_0x2db34d)[_0x06cc('0x1a')](_0x1c38af);}};}function respondWithFilteredResult(_0x233ecf,_0x172d8c){return function(_0x6f201b){if(_0x6f201b){var _0xbe8bbd=typeof _0x172d8c[_0x06cc('0x1b')]===_0x06cc('0x1c')&&typeof _0x172d8c[_0x06cc('0x1d')]===_0x06cc('0x1c');var _0x17b1ae=_0x6f201b[_0x06cc('0x1e')];var _0x159370=_0xbe8bbd?0x0:_0x172d8c[_0x06cc('0x1b')];var _0x1e4da7=_0xbe8bbd?_0x6f201b[_0x06cc('0x1e')]:_0x172d8c[_0x06cc('0x1b')]+_0x172d8c[_0x06cc('0x1d')];var _0x2c36ae;if(_0x1e4da7>=_0x17b1ae){_0x1e4da7=_0x17b1ae;_0x2c36ae=0xc8;}else{_0x2c36ae=0xce;}_0x233ecf[_0x06cc('0x19')](_0x2c36ae);return _0x233ecf[_0x06cc('0x1f')](_0x06cc('0x20'),_0x159370+'-'+_0x1e4da7+'/'+_0x17b1ae)['json'](_0x6f201b);}return null;};}function patchUpdates(_0x4a9bac){return function(_0x575fbf){try{jsonpatch[_0x06cc('0x21')](_0x575fbf,_0x4a9bac,!![]);}catch(_0xcbc345){return BPromise[_0x06cc('0x22')](_0xcbc345);}return _0x575fbf[_0x06cc('0x23')]();};}function saveUpdates(_0x533f02,_0x5da3aa){return function(_0x5b3992){if(_0x5b3992){return _0x5b3992[_0x06cc('0x24')](_0x533f02)[_0x06cc('0x25')](function(_0x35087c){return _0x35087c;});}return null;};}function removeEntity(_0x1cd8d2,_0x56aaaf){return function(_0x44e151){if(_0x44e151){return _0x44e151[_0x06cc('0x26')]()[_0x06cc('0x25')](function(){_0x1cd8d2[_0x06cc('0x19')](0xcc)[_0x06cc('0x18')]();});}};}function handleEntityNotFound(_0x4f2dee,_0xddb5a6){return function(_0x4a4d70){if(!_0x4a4d70){_0x4f2dee[_0x06cc('0x17')](0x194);}return _0x4a4d70;};}function handleError(_0x270c7f,_0x1daac8){_0x1daac8=_0x1daac8||0x1f4;return function(_0x57e4f2){logger[_0x06cc('0x27')](_0x57e4f2[_0x06cc('0x28')]);if(_0x57e4f2[_0x06cc('0x29')]){delete _0x57e4f2[_0x06cc('0x29')];}_0x270c7f[_0x06cc('0x19')](_0x1daac8)['send'](_0x57e4f2);};}exports['index']=function(_0x269e70,_0x1e6b7a){var _0x36870d={},_0x6d4028={},_0x516ff5={'count':0x0,'rows':[]};var _0x2e724e=_[_0x06cc('0x2a')](db[_0x06cc('0x2b')]['rawAttributes'],function(_0x3208c5){return{'name':_0x3208c5[_0x06cc('0x2c')],'type':_0x3208c5['type']['key']};});_0x6d4028[_0x06cc('0x2d')]=_[_0x06cc('0x2a')](_0x2e724e,_0x06cc('0x29'));_0x6d4028['query']=_[_0x06cc('0x2e')](_0x269e70[_0x06cc('0x2f')]);_0x6d4028['filters']=_[_0x06cc('0x30')](_0x6d4028[_0x06cc('0x2d')],_0x6d4028['query']);_0x36870d[_0x06cc('0x31')]=_['intersection'](_0x6d4028[_0x06cc('0x2d')],qs[_0x06cc('0x32')](_0x269e70[_0x06cc('0x2f')][_0x06cc('0x32')]));_0x36870d[_0x06cc('0x31')]=_0x36870d[_0x06cc('0x31')][_0x06cc('0x33')]?_0x36870d[_0x06cc('0x31')]:_0x6d4028[_0x06cc('0x2d')];if(!_0x269e70[_0x06cc('0x2f')][_0x06cc('0x34')]('nolimit')){_0x36870d[_0x06cc('0x1d')]=qs[_0x06cc('0x1d')](_0x269e70['query'][_0x06cc('0x1d')]);_0x36870d[_0x06cc('0x1b')]=qs['offset'](_0x269e70[_0x06cc('0x2f')][_0x06cc('0x1b')]);}_0x36870d[_0x06cc('0x35')]=qs[_0x06cc('0x36')](_0x269e70[_0x06cc('0x2f')][_0x06cc('0x36')]);_0x36870d[_0x06cc('0x37')]=qs['filters'](_['pick'](_0x269e70['query'],_0x6d4028[_0x06cc('0x38')]),_0x2e724e);if(_0x269e70[_0x06cc('0x2f')]['filter']){_0x36870d[_0x06cc('0x37')]=_['merge'](_0x36870d[_0x06cc('0x37')],{'$or':_[_0x06cc('0x2a')](_0x2e724e,function(_0x278aab){if(_0x278aab[_0x06cc('0x39')]!==_0x06cc('0x3a')){var _0x2714cb={};_0x2714cb[_0x278aab[_0x06cc('0x29')]]={'$like':'%'+_0x269e70[_0x06cc('0x2f')]['filter']+'%'};return _0x2714cb;}})});}_0x36870d=_['merge']({},_0x36870d,_0x269e70[_0x06cc('0x3b')]);var _0x493f60={'where':_0x36870d[_0x06cc('0x37')]};return db[_0x06cc('0x2b')][_0x06cc('0x1e')](_0x493f60)[_0x06cc('0x25')](function(_0x563224){_0x516ff5[_0x06cc('0x1e')]=_0x563224;if(_0x269e70['query'][_0x06cc('0x3c')]){_0x36870d[_0x06cc('0x3d')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x06cc('0x3e')](_0x36870d);})[_0x06cc('0x25')](function(_0x5cdc9c){_0x516ff5[_0x06cc('0x3f')]=_0x5cdc9c;return _0x516ff5;})[_0x06cc('0x25')](respondWithFilteredResult(_0x1e6b7a,_0x36870d))[_0x06cc('0x40')](handleError(_0x1e6b7a,null));};exports[_0x06cc('0x41')]=function(_0x4f394a,_0x4f1bff){var _0x345681={'raw':![],'where':{'id':_0x4f394a[_0x06cc('0x42')]['id']}},_0x1de182={};_0x1de182['model']=_[_0x06cc('0x2e')](db[_0x06cc('0x2b')][_0x06cc('0x43')]);_0x1de182[_0x06cc('0x2f')]=_[_0x06cc('0x2e')](_0x4f394a[_0x06cc('0x2f')]);_0x1de182[_0x06cc('0x38')]=_[_0x06cc('0x30')](_0x1de182[_0x06cc('0x2d')],_0x1de182['query']);_0x345681['attributes']=_['intersection'](_0x1de182[_0x06cc('0x2d')],qs[_0x06cc('0x32')](_0x4f394a[_0x06cc('0x2f')][_0x06cc('0x32')]));_0x345681[_0x06cc('0x31')]=_0x345681[_0x06cc('0x31')]['length']?_0x345681[_0x06cc('0x31')]:_0x1de182['model'];if(_0x4f394a[_0x06cc('0x2f')]['includeAll']){_0x345681[_0x06cc('0x3d')]=[{'all':!![]}];}_0x345681=_[_0x06cc('0x44')]({},_0x345681,_0x4f394a[_0x06cc('0x3b')]);return db['SugarcrmConfiguration'][_0x06cc('0x45')](_0x345681)[_0x06cc('0x25')](handleEntityNotFound(_0x4f1bff,null))[_0x06cc('0x25')](respondWithResult(_0x4f1bff,null))[_0x06cc('0x40')](handleError(_0x4f1bff,null));};exports[_0x06cc('0x46')]=function(_0x3a6e65,_0x157a15){return db[_0x06cc('0x2b')][_0x06cc('0x46')](_0x3a6e65['body'],{})[_0x06cc('0x25')](respondWithResult(_0x157a15,0xc9))['catch'](handleError(_0x157a15,null));};exports['update']=function(_0x132eeb,_0x323003){if(_0x132eeb['body']['id']){delete _0x132eeb[_0x06cc('0x47')]['id'];}return db[_0x06cc('0x2b')]['find']({'where':{'id':_0x132eeb[_0x06cc('0x42')]['id']}})['then'](handleEntityNotFound(_0x323003,null))[_0x06cc('0x25')](saveUpdates(_0x132eeb[_0x06cc('0x47')],null))[_0x06cc('0x25')](respondWithResult(_0x323003,null))['catch'](handleError(_0x323003,null));};exports['destroy']=function(_0x331c4c,_0x29f862){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x331c4c[_0x06cc('0x42')]['id']}})[_0x06cc('0x25')](handleEntityNotFound(_0x29f862,null))[_0x06cc('0x25')](removeEntity(_0x29f862,null))[_0x06cc('0x40')](handleError(_0x29f862,null));};exports['getFields']=function(_0x6895ab,_0x5694aa,_0x480681){var _0x32bdb1={};var _0x2821c9={};var _0x107efb;var _0x525410;return db[_0x06cc('0x2b')][_0x06cc('0x48')]({'where':{'id':_0x6895ab[_0x06cc('0x42')]['id']}})[_0x06cc('0x25')](handleEntityNotFound(_0x5694aa,null))[_0x06cc('0x25')](function(_0x5624df){if(_0x5624df){_0x107efb=_0x5624df;_0x2821c9['model']=_['keys'](db[_0x06cc('0x49')][_0x06cc('0x43')]);_0x2821c9[_0x06cc('0x2f')]=_[_0x06cc('0x2e')](_0x6895ab[_0x06cc('0x2f')]);_0x2821c9['filters']=_[_0x06cc('0x30')](_0x2821c9[_0x06cc('0x2d')],_0x2821c9[_0x06cc('0x2f')]);_0x32bdb1['attributes']=_[_0x06cc('0x30')](_0x2821c9[_0x06cc('0x2d')],qs[_0x06cc('0x32')](_0x6895ab[_0x06cc('0x2f')][_0x06cc('0x32')]));_0x32bdb1[_0x06cc('0x31')]=_0x32bdb1['attributes'][_0x06cc('0x33')]?_0x32bdb1[_0x06cc('0x31')]:_0x2821c9[_0x06cc('0x2d')];_0x32bdb1['order']=qs[_0x06cc('0x36')](_0x6895ab[_0x06cc('0x2f')]['sort']);_0x32bdb1[_0x06cc('0x37')]=qs['filters'](_[_0x06cc('0x4a')](_0x6895ab[_0x06cc('0x2f')],_0x2821c9['filters']));if(_0x6895ab['query']['filter']){_0x32bdb1['where']=_[_0x06cc('0x44')](_0x32bdb1['where'],{'$or':_[_0x06cc('0x2a')](_0x32bdb1[_0x06cc('0x31')],function(_0x4a48bd){var _0x52f4af={};_0x52f4af[_0x4a48bd]={'$like':'%'+_0x6895ab[_0x06cc('0x2f')]['filter']+'%'};return _0x52f4af;})});}_0x32bdb1=_['merge']({},_0x32bdb1,_0x6895ab[_0x06cc('0x3b')]);return _0x107efb[_0x06cc('0x4b')](_0x32bdb1);}})['then'](function(_0x35227e){if(_0x35227e){_0x525410=_0x35227e[_0x06cc('0x33')];if(!_0x6895ab[_0x06cc('0x2f')][_0x06cc('0x34')](_0x06cc('0x4c'))){_0x32bdb1[_0x06cc('0x1d')]=qs[_0x06cc('0x1d')](_0x6895ab[_0x06cc('0x2f')][_0x06cc('0x1d')]);_0x32bdb1['offset']=qs[_0x06cc('0x1b')](_0x6895ab[_0x06cc('0x2f')][_0x06cc('0x1b')]);}return _0x107efb[_0x06cc('0x4b')](_0x32bdb1);}})[_0x06cc('0x25')](function(_0x290611){if(_0x290611){return _0x290611?{'count':_0x525410,'rows':_0x290611}:null;}})['then'](respondWithResult(_0x5694aa,null))[_0x06cc('0x40')](handleError(_0x5694aa,null));};exports['getSubjects']=function(_0xa38caf,_0x11b252,_0x5f03ca){var _0x474865={};var _0x9976a0={};var _0x12b0ed;var _0x18373a;return db[_0x06cc('0x2b')][_0x06cc('0x48')]({'where':{'id':_0xa38caf[_0x06cc('0x42')]['id']}})['then'](handleEntityNotFound(_0x11b252,null))[_0x06cc('0x25')](function(_0x38aa5e){if(_0x38aa5e){_0x12b0ed=_0x38aa5e;_0x9976a0['model']=_[_0x06cc('0x2e')](db[_0x06cc('0x49')][_0x06cc('0x43')]);_0x9976a0['query']=_[_0x06cc('0x2e')](_0xa38caf[_0x06cc('0x2f')]);_0x9976a0[_0x06cc('0x38')]=_['intersection'](_0x9976a0['model'],_0x9976a0['query']);_0x474865['attributes']=_[_0x06cc('0x30')](_0x9976a0[_0x06cc('0x2d')],qs[_0x06cc('0x32')](_0xa38caf[_0x06cc('0x2f')]['fields']));_0x474865[_0x06cc('0x31')]=_0x474865[_0x06cc('0x31')]['length']?_0x474865['attributes']:_0x9976a0['model'];_0x474865[_0x06cc('0x35')]=qs[_0x06cc('0x36')](_0xa38caf[_0x06cc('0x2f')][_0x06cc('0x36')]);_0x474865[_0x06cc('0x37')]=qs[_0x06cc('0x38')](_[_0x06cc('0x4a')](_0xa38caf[_0x06cc('0x2f')],_0x9976a0[_0x06cc('0x38')]));if(_0xa38caf[_0x06cc('0x2f')][_0x06cc('0x4d')]){_0x474865[_0x06cc('0x37')]=_['merge'](_0x474865[_0x06cc('0x37')],{'$or':_[_0x06cc('0x2a')](_0x474865[_0x06cc('0x31')],function(_0x8f998e){var _0x2ed365={};_0x2ed365[_0x8f998e]={'$like':'%'+_0xa38caf[_0x06cc('0x2f')][_0x06cc('0x4d')]+'%'};return _0x2ed365;})});}_0x474865=_[_0x06cc('0x44')]({},_0x474865,_0xa38caf[_0x06cc('0x3b')]);return _0x12b0ed[_0x06cc('0x4e')](_0x474865);}})[_0x06cc('0x25')](function(_0x203723){if(_0x203723){_0x18373a=_0x203723[_0x06cc('0x33')];if(!_0xa38caf['query']['hasOwnProperty'](_0x06cc('0x4c'))){_0x474865[_0x06cc('0x1d')]=qs[_0x06cc('0x1d')](_0xa38caf[_0x06cc('0x2f')][_0x06cc('0x1d')]);_0x474865[_0x06cc('0x1b')]=qs['offset'](_0xa38caf['query'][_0x06cc('0x1b')]);}return _0x12b0ed[_0x06cc('0x4e')](_0x474865);}})[_0x06cc('0x25')](function(_0x5c162b){if(_0x5c162b){return _0x5c162b?{'count':_0x18373a,'rows':_0x5c162b}:null;}})[_0x06cc('0x25')](respondWithResult(_0x11b252,null))[_0x06cc('0x40')](handleError(_0x11b252,null));};exports['getDescriptions']=function(_0x171930,_0x3d33f3,_0x670e3c){var _0x17f56f={};var _0x4da052={};var _0x11c63f;var _0x2735c8;return db[_0x06cc('0x2b')][_0x06cc('0x48')]({'where':{'id':_0x171930['params']['id']}})[_0x06cc('0x25')](handleEntityNotFound(_0x3d33f3,null))[_0x06cc('0x25')](function(_0x32ede8){if(_0x32ede8){_0x11c63f=_0x32ede8;_0x4da052[_0x06cc('0x2d')]=_['keys'](db[_0x06cc('0x49')][_0x06cc('0x43')]);_0x4da052['query']=_[_0x06cc('0x2e')](_0x171930[_0x06cc('0x2f')]);_0x4da052[_0x06cc('0x38')]=_[_0x06cc('0x30')](_0x4da052[_0x06cc('0x2d')],_0x4da052['query']);_0x17f56f[_0x06cc('0x31')]=_['intersection'](_0x4da052[_0x06cc('0x2d')],qs[_0x06cc('0x32')](_0x171930['query'][_0x06cc('0x32')]));_0x17f56f[_0x06cc('0x31')]=_0x17f56f[_0x06cc('0x31')][_0x06cc('0x33')]?_0x17f56f[_0x06cc('0x31')]:_0x4da052[_0x06cc('0x2d')];_0x17f56f[_0x06cc('0x35')]=qs['sort'](_0x171930[_0x06cc('0x2f')][_0x06cc('0x36')]);_0x17f56f[_0x06cc('0x37')]=qs['filters'](_[_0x06cc('0x4a')](_0x171930[_0x06cc('0x2f')],_0x4da052['filters']));if(_0x171930[_0x06cc('0x2f')][_0x06cc('0x4d')]){_0x17f56f[_0x06cc('0x37')]=_[_0x06cc('0x44')](_0x17f56f[_0x06cc('0x37')],{'$or':_['map'](_0x17f56f[_0x06cc('0x31')],function(_0x10e488){var _0x1924c5={};_0x1924c5[_0x10e488]={'$like':'%'+_0x171930['query'][_0x06cc('0x4d')]+'%'};return _0x1924c5;})});}_0x17f56f=_[_0x06cc('0x44')]({},_0x17f56f,_0x171930[_0x06cc('0x3b')]);return _0x11c63f[_0x06cc('0x4f')](_0x17f56f);}})[_0x06cc('0x25')](function(_0x41b191){if(_0x41b191){_0x2735c8=_0x41b191[_0x06cc('0x33')];if(!_0x171930[_0x06cc('0x2f')][_0x06cc('0x34')](_0x06cc('0x4c'))){_0x17f56f[_0x06cc('0x1d')]=qs[_0x06cc('0x1d')](_0x171930[_0x06cc('0x2f')]['limit']);_0x17f56f['offset']=qs[_0x06cc('0x1b')](_0x171930[_0x06cc('0x2f')]['offset']);}return _0x11c63f[_0x06cc('0x4f')](_0x17f56f);}})[_0x06cc('0x25')](function(_0x334f94){if(_0x334f94){return _0x334f94?{'count':_0x2735c8,'rows':_0x334f94}:null;}})[_0x06cc('0x25')](respondWithResult(_0x3d33f3,null))[_0x06cc('0x40')](handleError(_0x3d33f3,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index f5ca0cf..615911f 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 _0xfdb6=['./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4cda18,_0x28dcbd){var _0x23d2ae=function(_0x2c1a00){while(--_0x2c1a00){_0x4cda18['push'](_0x4cda18['shift']());}};_0x23d2ae(++_0x28dcbd);}(_0xfdb6,0xc2));var _0x6fdb=function(_0xf2a04e,_0x505d9b){_0xf2a04e=_0xf2a04e-0x0;var _0xb72ef2=_0xfdb6[_0xf2a04e];return _0xb72ef2;};'use strict';var _=require(_0x6fdb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6fdb('0x1'));var moment=require('moment');var BPromise=require(_0x6fdb('0x2'));var rp=require(_0x6fdb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6fdb('0x4'));var config=require(_0x6fdb('0x5'));var attributes=require(_0x6fdb('0x6'));module[_0x6fdb('0x7')]=function(_0x26338d,_0xbd20d7){return _0x26338d[_0x6fdb('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0x6fdb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e9a=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_sugarcrm_configurations','lodash','../../config/logger','api','moment'];(function(_0x41225c,_0x2c4c94){var _0xb75a5f=function(_0x5c34a0){while(--_0x5c34a0){_0x41225c['push'](_0x41225c['shift']());}};_0xb75a5f(++_0x2c4c94);}(_0x6e9a,0x1dc));var _0xa6e9=function(_0x56aa66,_0x1ddf52){_0x56aa66=_0x56aa66-0x0;var _0xeba9ff=_0x6e9a[_0x56aa66];return _0xeba9ff;};'use strict';var _=require(_0xa6e9('0x0'));var util=require('util');var logger=require(_0xa6e9('0x1'))(_0xa6e9('0x2'));var moment=require(_0xa6e9('0x3'));var BPromise=require(_0xa6e9('0x4'));var rp=require(_0xa6e9('0x5'));var fs=require('fs');var path=require(_0xa6e9('0x6'));var rimraf=require(_0xa6e9('0x7'));var config=require(_0xa6e9('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xa6e9('0x9')]=function(_0x54df2a,_0x4cf853){return _0x54df2a[_0xa6e9('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0xa6e9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 8187253..0760ea4 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 _0x0a91=['client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x21c302,_0x4719c1){var _0x2a414b=function(_0x56e0af){while(--_0x56e0af){_0x21c302['push'](_0x21c302['shift']());}};_0x2a414b(++_0x4719c1);}(_0x0a91,0x77));var _0x10a9=function(_0x5947f8,_0x305779){_0x5947f8=_0x5947f8-0x0;var _0x43888e=_0x0a91[_0x5947f8];return _0x43888e;};'use strict';var _=require(_0x10a9('0x0'));var util=require('util');var moment=require(_0x10a9('0x1'));var BPromise=require('bluebird');var rs=require(_0x10a9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10a9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x10a9('0x4'))('rpc');var config=require(_0x10a9('0x5'));var jayson=require(_0x10a9('0x6'));var client=jayson[_0x10a9('0x7')][_0x10a9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x63b357,_0x32c75d,_0x4ab47b){return new BPromise(function(_0x4b8596,_0x2d7aed){return client[_0x10a9('0x9')](_0x63b357,_0x4ab47b)[_0x10a9('0xa')](function(_0xd893b6){logger[_0x10a9('0xb')](_0x10a9('0xc'),_0x32c75d,_0x10a9('0xd'));logger['debug'](_0x10a9('0xe'),_0x32c75d,_0x10a9('0xd'),JSON['stringify'](_0xd893b6));if(_0xd893b6[_0x10a9('0xf')]){if(_0xd893b6[_0x10a9('0xf')]['code']===0x1f4){logger[_0x10a9('0xf')](_0x10a9('0xc'),_0x32c75d,_0xd893b6[_0x10a9('0xf')][_0x10a9('0x10')]);return _0x2d7aed(_0xd893b6['error']['message']);}logger[_0x10a9('0xf')](_0x10a9('0xc'),_0x32c75d,_0xd893b6[_0x10a9('0xf')][_0x10a9('0x10')]);return _0x4b8596(_0xd893b6[_0x10a9('0xf')][_0x10a9('0x10')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x32c75d,_0x10a9('0xd'));_0x4b8596(_0xd893b6['result'][_0x10a9('0x10')]);}})[_0x10a9('0x11')](function(_0x24185d){logger[_0x10a9('0xf')](_0x10a9('0xc'),_0x32c75d,_0x24185d);_0x2d7aed(_0x24185d);});});} \ No newline at end of file +var _0x3c0d=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x348f10,_0x3ae1e9){var _0x4e2c4d=function(_0x57d338){while(--_0x57d338){_0x348f10['push'](_0x348f10['shift']());}};_0x4e2c4d(++_0x3ae1e9);}(_0x3c0d,0x1c7));var _0xd3c0=function(_0x34882f,_0x601a99){_0x34882f=_0x34882f-0x0;var _0x455929=_0x3c0d[_0x34882f];return _0x455929;};'use strict';var _=require(_0xd3c0('0x0'));var util=require(_0xd3c0('0x1'));var moment=require(_0xd3c0('0x2'));var BPromise=require(_0xd3c0('0x3'));var rs=require(_0xd3c0('0x4'));var fs=require('fs');var Redis=require(_0xd3c0('0x5'));var db=require(_0xd3c0('0x6'))['db'];var utils=require(_0xd3c0('0x7'));var logger=require('../../config/logger')(_0xd3c0('0x8'));var config=require('../../config/environment');var jayson=require(_0xd3c0('0x9'));var client=jayson[_0xd3c0('0xa')][_0xd3c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23cb11,_0x2d2c25,_0x129f8d){return new BPromise(function(_0x20ddff,_0x518303){return client[_0xd3c0('0xc')](_0x23cb11,_0x129f8d)[_0xd3c0('0xd')](function(_0x33a364){logger[_0xd3c0('0xe')](_0xd3c0('0xf'),_0x2d2c25,_0xd3c0('0x10'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2d2c25,_0xd3c0('0x10'),JSON['stringify'](_0x33a364));if(_0x33a364[_0xd3c0('0x11')]){if(_0x33a364[_0xd3c0('0x11')]['code']===0x1f4){logger[_0xd3c0('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2d2c25,_0x33a364[_0xd3c0('0x11')]['message']);return _0x518303(_0x33a364[_0xd3c0('0x11')][_0xd3c0('0x12')]);}logger[_0xd3c0('0x11')](_0xd3c0('0xf'),_0x2d2c25,_0x33a364['error']['message']);return _0x20ddff(_0x33a364[_0xd3c0('0x11')][_0xd3c0('0x12')]);}else{logger['info'](_0xd3c0('0xf'),_0x2d2c25,'request\x20sent');_0x20ddff(_0x33a364[_0xd3c0('0x13')]['message']);}})[_0xd3c0('0x14')](function(_0x46bc02){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x2d2c25,_0x46bc02);_0x518303(_0x46bc02);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index ba8e981..ce664fa 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 _0x1397=['get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index'];(function(_0x1d39a6,_0x3a2947){var _0x3bff0f=function(_0x367eed){while(--_0x367eed){_0x1d39a6['push'](_0x1d39a6['shift']());}};_0x3bff0f(++_0x3a2947);}(_0x1397,0xd9));var _0x7139=function(_0x236957,_0x3044b7){_0x236957=_0x236957-0x0;var _0xaeccaf=_0x1397[_0x236957];return _0xaeccaf;};'use strict';var multer=require(_0x7139('0x0'));var util=require(_0x7139('0x1'));var path=require(_0x7139('0x2'));var timeout=require(_0x7139('0x3'));var express=require(_0x7139('0x4'));var router=express[_0x7139('0x5')]();var fs_extra=require(_0x7139('0x6'));var auth=require(_0x7139('0x7'));var interaction=require(_0x7139('0x8'));var config=require(_0x7139('0x9'));var controller=require(_0x7139('0xa'));router['get']('/',auth[_0x7139('0xb')](),controller[_0x7139('0xc')]);router[_0x7139('0xd')](_0x7139('0xe'),auth['isAuthenticated'](),controller[_0x7139('0xf')]);router[_0x7139('0x10')]('/',auth['isAuthenticated'](),controller[_0x7139('0x11')]);router[_0x7139('0x12')](_0x7139('0xe'),auth[_0x7139('0xb')](),controller[_0x7139('0x13')]);router[_0x7139('0x14')](_0x7139('0xe'),auth[_0x7139('0xb')](),controller[_0x7139('0x15')]);module[_0x7139('0x16')]=router; \ No newline at end of file +var _0xc36e=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports'];(function(_0x1904cf,_0x2aa2a7){var _0x43c4d0=function(_0x2b8341){while(--_0x2b8341){_0x1904cf['push'](_0x1904cf['shift']());}};_0x43c4d0(++_0x2aa2a7);}(_0xc36e,0x1cc));var _0xec36=function(_0x9f7bff,_0xa544ae){_0x9f7bff=_0x9f7bff-0x0;var _0x21956f=_0xc36e[_0x9f7bff];return _0x21956f;};'use strict';var multer=require(_0xec36('0x0'));var util=require(_0xec36('0x1'));var path=require(_0xec36('0x2'));var timeout=require(_0xec36('0x3'));var express=require('express');var router=express[_0xec36('0x4')]();var fs_extra=require(_0xec36('0x5'));var auth=require(_0xec36('0x6'));var interaction=require(_0xec36('0x7'));var config=require(_0xec36('0x8'));var controller=require(_0xec36('0x9'));router[_0xec36('0xa')]('/',auth[_0xec36('0xb')](),controller[_0xec36('0xc')]);router[_0xec36('0xa')](_0xec36('0xd'),auth[_0xec36('0xb')](),controller[_0xec36('0xe')]);router['post']('/',auth[_0xec36('0xb')](),controller[_0xec36('0xf')]);router[_0xec36('0x10')](_0xec36('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xec36('0x11')](_0xec36('0xd'),auth[_0xec36('0xb')](),controller[_0xec36('0x12')]);module[_0xec36('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 7825e6e..1e5e41e 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 _0x6251=['exports','ENUM','customVariable','keyValue','picklist','STRING','string','variable','BOOLEAN','sequelize'];(function(_0x38eac8,_0x160c1e){var _0x9fa46f=function(_0x3383e8){while(--_0x3383e8){_0x38eac8['push'](_0x38eac8['shift']());}};_0x9fa46f(++_0x160c1e);}(_0x6251,0xb3));var _0x1625=function(_0x17f2b7,_0x32a8b0){_0x17f2b7=_0x17f2b7-0x0;var _0x4164f6=_0x6251[_0x17f2b7];return _0x4164f6;};'use strict';var Sequelize=require(_0x1625('0x0'));module[_0x1625('0x1')]={'type':{'type':Sequelize[_0x1625('0x2')]('string','variable',_0x1625('0x3'),_0x1625('0x4'),_0x1625('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1625('0x6')]},'key':{'type':Sequelize[_0x1625('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x1625('0x7'),_0x1625('0x8'),_0x1625('0x3'))},'keyContent':{'type':Sequelize[_0x1625('0x6')]},'idField':{'type':Sequelize[_0x1625('0x6')]},'nameField':{'type':Sequelize[_0x1625('0x6')]},'customField':{'type':Sequelize[_0x1625('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1625('0x6')]}}; \ No newline at end of file +var _0xd1e9=['keyValue','picklist','string','STRING','ENUM','BOOLEAN','sequelize','exports','variable'];(function(_0x44fbec,_0x30c162){var _0x5ed018=function(_0x1c7a6f){while(--_0x1c7a6f){_0x44fbec['push'](_0x44fbec['shift']());}};_0x5ed018(++_0x30c162);}(_0xd1e9,0x138));var _0x9d1e=function(_0xd199fe,_0x131768){_0xd199fe=_0xd199fe-0x0;var _0x20f714=_0xd1e9[_0xd199fe];return _0x20f714;};'use strict';var Sequelize=require(_0x9d1e('0x0'));module[_0x9d1e('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x9d1e('0x2'),'customVariable',_0x9d1e('0x3'),_0x9d1e('0x4')),'defaultValue':_0x9d1e('0x5')},'content':{'type':Sequelize[_0x9d1e('0x6')]},'key':{'type':Sequelize[_0x9d1e('0x6')]},'keyType':{'type':Sequelize[_0x9d1e('0x7')](_0x9d1e('0x5'),_0x9d1e('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x9d1e('0x6')]},'idField':{'type':Sequelize[_0x9d1e('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9d1e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9d1e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 8c817df..72ee93b 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 _0x0c21=['name','send','index','SugarcrmField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','limit','order','pick','filter','merge','map','VIRTUAL','options','where','count','include','findAll','rows','show','keys','includeAll','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','set','Content-Range','apply','save','update','then','destroy','error'];(function(_0x23b310,_0x324c7c){var _0x3f387d=function(_0x1a6082){while(--_0x1a6082){_0x23b310['push'](_0x23b310['shift']());}};_0x3f387d(++_0x324c7c);}(_0x0c21,0xbe));var _0x10c2=function(_0x1791e0,_0x589213){_0x1791e0=_0x1791e0-0x0;var _0x23b0f9=_0x0c21[_0x1791e0];return _0x23b0f9;};'use strict';var emlformat=require(_0x10c2('0x0'));var rimraf=require(_0x10c2('0x1'));var zipdir=require(_0x10c2('0x2'));var jsonpatch=require(_0x10c2('0x3'));var rp=require(_0x10c2('0x4'));var moment=require(_0x10c2('0x5'));var BPromise=require(_0x10c2('0x6'));var Mustache=require(_0x10c2('0x7'));var util=require(_0x10c2('0x8'));var path=require(_0x10c2('0x9'));var sox=require('sox');var csv=require(_0x10c2('0xa'));var ejs=require(_0x10c2('0xb'));var fs=require('fs');var fs_extra=require(_0x10c2('0xc'));var _=require(_0x10c2('0xd'));var squel=require(_0x10c2('0xe'));var crypto=require(_0x10c2('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x10c2('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x10c2('0x11'));var authService=require(_0x10c2('0x12'));var qs=require(_0x10c2('0x13'));var as=require(_0x10c2('0x14'));var hardwareService=require(_0x10c2('0x15'));var logger=require('../../config/logger')(_0x10c2('0x16'));var utils=require(_0x10c2('0x17'));var config=require(_0x10c2('0x18'));var licenseUtil=require(_0x10c2('0x19'));var db=require(_0x10c2('0x1a'))['db'];function respondWithStatusCode(_0xc16505,_0x3d371c){_0x3d371c=_0x3d371c||0xcc;return function(_0x5574b0){if(_0x5574b0){return _0xc16505[_0x10c2('0x1b')](_0x3d371c);}return _0xc16505[_0x10c2('0x1c')](_0x3d371c)[_0x10c2('0x1d')]();};}function respondWithResult(_0x726966,_0x13fb61){_0x13fb61=_0x13fb61||0xc8;return function(_0x250c44){if(_0x250c44){return _0x726966[_0x10c2('0x1c')](_0x13fb61)[_0x10c2('0x1e')](_0x250c44);}};}function respondWithFilteredResult(_0x54ef30,_0x108997){return function(_0xda40d8){if(_0xda40d8){var _0x364adb=typeof _0x108997[_0x10c2('0x1f')]===_0x10c2('0x20')&&typeof _0x108997['limit']===_0x10c2('0x20');var _0x4831ac=_0xda40d8['count'];var _0x169e4e=_0x364adb?0x0:_0x108997[_0x10c2('0x1f')];var _0x13d964=_0x364adb?_0xda40d8['count']:_0x108997[_0x10c2('0x1f')]+_0x108997['limit'];var _0x32d27f;if(_0x13d964>=_0x4831ac){_0x13d964=_0x4831ac;_0x32d27f=0xc8;}else{_0x32d27f=0xce;}_0x54ef30['status'](_0x32d27f);return _0x54ef30[_0x10c2('0x21')](_0x10c2('0x22'),_0x169e4e+'-'+_0x13d964+'/'+_0x4831ac)['json'](_0xda40d8);}return null;};}function patchUpdates(_0x36c1b8){return function(_0x203203){try{jsonpatch[_0x10c2('0x23')](_0x203203,_0x36c1b8,!![]);}catch(_0x58d09e){return BPromise['reject'](_0x58d09e);}return _0x203203[_0x10c2('0x24')]();};}function saveUpdates(_0x2f2933,_0x2f9231){return function(_0x6446aa){if(_0x6446aa){return _0x6446aa[_0x10c2('0x25')](_0x2f2933)[_0x10c2('0x26')](function(_0x1bcadd){return _0x1bcadd;});}return null;};}function removeEntity(_0x210ed0,_0x324cdb){return function(_0xb7b542){if(_0xb7b542){return _0xb7b542[_0x10c2('0x27')]()[_0x10c2('0x26')](function(){_0x210ed0[_0x10c2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c20f8,_0x3d98eb){return function(_0x9145d3){if(!_0x9145d3){_0x5c20f8[_0x10c2('0x1b')](0x194);}return _0x9145d3;};}function handleError(_0x2990ba,_0x7145d1){_0x7145d1=_0x7145d1||0x1f4;return function(_0x19ff70){logger[_0x10c2('0x28')](_0x19ff70['stack']);if(_0x19ff70['name']){delete _0x19ff70[_0x10c2('0x29')];}_0x2990ba[_0x10c2('0x1c')](_0x7145d1)[_0x10c2('0x2a')](_0x19ff70);};}exports[_0x10c2('0x2b')]=function(_0x516224,_0x13ed25){var _0x112b81={},_0x58b1b4={},_0x21d5e9={'count':0x0,'rows':[]};var _0x2c7a71=_['map'](db[_0x10c2('0x2c')][_0x10c2('0x2d')],function(_0x492dbf){return{'name':_0x492dbf[_0x10c2('0x2e')],'type':_0x492dbf[_0x10c2('0x2f')][_0x10c2('0x30')]};});_0x58b1b4[_0x10c2('0x31')]=_['map'](_0x2c7a71,_0x10c2('0x29'));_0x58b1b4[_0x10c2('0x32')]=_['keys'](_0x516224[_0x10c2('0x32')]);_0x58b1b4[_0x10c2('0x33')]=_['intersection'](_0x58b1b4[_0x10c2('0x31')],_0x58b1b4[_0x10c2('0x32')]);_0x112b81['attributes']=_[_0x10c2('0x34')](_0x58b1b4[_0x10c2('0x31')],qs[_0x10c2('0x35')](_0x516224[_0x10c2('0x32')]['fields']));_0x112b81[_0x10c2('0x36')]=_0x112b81[_0x10c2('0x36')][_0x10c2('0x37')]?_0x112b81['attributes']:_0x58b1b4[_0x10c2('0x31')];if(!_0x516224[_0x10c2('0x32')]['hasOwnProperty']('nolimit')){_0x112b81[_0x10c2('0x38')]=qs['limit'](_0x516224[_0x10c2('0x32')][_0x10c2('0x38')]);_0x112b81[_0x10c2('0x1f')]=qs[_0x10c2('0x1f')](_0x516224['query'][_0x10c2('0x1f')]);}_0x112b81[_0x10c2('0x39')]=qs['sort'](_0x516224[_0x10c2('0x32')]['sort']);_0x112b81['where']=qs['filters'](_[_0x10c2('0x3a')](_0x516224['query'],_0x58b1b4[_0x10c2('0x33')]),_0x2c7a71);if(_0x516224[_0x10c2('0x32')][_0x10c2('0x3b')]){_0x112b81['where']=_[_0x10c2('0x3c')](_0x112b81['where'],{'$or':_[_0x10c2('0x3d')](_0x2c7a71,function(_0x50d0ca){if(_0x50d0ca[_0x10c2('0x2f')]!==_0x10c2('0x3e')){var _0x18fdab={};_0x18fdab[_0x50d0ca[_0x10c2('0x29')]]={'$like':'%'+_0x516224[_0x10c2('0x32')][_0x10c2('0x3b')]+'%'};return _0x18fdab;}})});}_0x112b81=_[_0x10c2('0x3c')]({},_0x112b81,_0x516224[_0x10c2('0x3f')]);var _0x323faa={'where':_0x112b81[_0x10c2('0x40')]};return db[_0x10c2('0x2c')][_0x10c2('0x41')](_0x323faa)[_0x10c2('0x26')](function(_0x40f0f7){_0x21d5e9['count']=_0x40f0f7;if(_0x516224['query']['includeAll']){_0x112b81[_0x10c2('0x42')]=[{'all':!![]}];}return db['SugarcrmField'][_0x10c2('0x43')](_0x112b81);})['then'](function(_0x1cb092){_0x21d5e9[_0x10c2('0x44')]=_0x1cb092;return _0x21d5e9;})['then'](respondWithFilteredResult(_0x13ed25,_0x112b81))['catch'](handleError(_0x13ed25,null));};exports[_0x10c2('0x45')]=function(_0xd9b495,_0x55e1aa){var _0x46560f={'raw':!![],'where':{'id':_0xd9b495['params']['id']}},_0x4124f3={};_0x4124f3[_0x10c2('0x31')]=_[_0x10c2('0x46')](db['SugarcrmField'][_0x10c2('0x2d')]);_0x4124f3['query']=_[_0x10c2('0x46')](_0xd9b495[_0x10c2('0x32')]);_0x4124f3[_0x10c2('0x33')]=_[_0x10c2('0x34')](_0x4124f3[_0x10c2('0x31')],_0x4124f3[_0x10c2('0x32')]);_0x46560f[_0x10c2('0x36')]=_[_0x10c2('0x34')](_0x4124f3[_0x10c2('0x31')],qs[_0x10c2('0x35')](_0xd9b495['query'][_0x10c2('0x35')]));_0x46560f[_0x10c2('0x36')]=_0x46560f[_0x10c2('0x36')][_0x10c2('0x37')]?_0x46560f[_0x10c2('0x36')]:_0x4124f3[_0x10c2('0x31')];if(_0xd9b495[_0x10c2('0x32')][_0x10c2('0x47')]){_0x46560f[_0x10c2('0x42')]=[{'all':!![]}];}_0x46560f=_['merge']({},_0x46560f,_0xd9b495[_0x10c2('0x3f')]);return db[_0x10c2('0x2c')]['find'](_0x46560f)[_0x10c2('0x26')](handleEntityNotFound(_0x55e1aa,null))[_0x10c2('0x26')](respondWithResult(_0x55e1aa,null))[_0x10c2('0x48')](handleError(_0x55e1aa,null));};exports[_0x10c2('0x49')]=function(_0x5c56d9,_0xb2ea58){return db[_0x10c2('0x2c')]['create'](_0x5c56d9[_0x10c2('0x4a')],{})[_0x10c2('0x26')](respondWithResult(_0xb2ea58,0xc9))['catch'](handleError(_0xb2ea58,null));};exports[_0x10c2('0x25')]=function(_0x6afb9c,_0x5cc865){if(_0x6afb9c[_0x10c2('0x4a')]['id']){delete _0x6afb9c[_0x10c2('0x4a')]['id'];}return db[_0x10c2('0x2c')][_0x10c2('0x4b')]({'where':{'id':_0x6afb9c[_0x10c2('0x4c')]['id']}})[_0x10c2('0x26')](handleEntityNotFound(_0x5cc865,null))[_0x10c2('0x26')](saveUpdates(_0x6afb9c['body'],null))['then'](respondWithResult(_0x5cc865,null))[_0x10c2('0x48')](handleError(_0x5cc865,null));};exports[_0x10c2('0x27')]=function(_0x783781,_0xca463d){return db[_0x10c2('0x2c')]['find']({'where':{'id':_0x783781[_0x10c2('0x4c')]['id']}})[_0x10c2('0x26')](handleEntityNotFound(_0xca463d,null))['then'](removeEntity(_0xca463d,null))[_0x10c2('0x48')](handleError(_0xca463d,null));}; \ No newline at end of file +var _0xb559=['lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','map','fieldName','type','key','keys','query','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','options','SugarcrmField','include','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','fs-extra'];(function(_0x55c86d,_0x27d1da){var _0x535158=function(_0x5e39c3){while(--_0x5e39c3){_0x55c86d['push'](_0x55c86d['shift']());}};_0x535158(++_0x27d1da);}(_0xb559,0xce));var _0x9b55=function(_0x42d142,_0x309e7d){_0x42d142=_0x42d142-0x0;var _0x39b768=_0xb559[_0x42d142];return _0x39b768;};'use strict';var emlformat=require(_0x9b55('0x0'));var rimraf=require(_0x9b55('0x1'));var zipdir=require(_0x9b55('0x2'));var jsonpatch=require(_0x9b55('0x3'));var rp=require(_0x9b55('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9b55('0x5'));var util=require(_0x9b55('0x6'));var path=require(_0x9b55('0x7'));var sox=require(_0x9b55('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b55('0x9'));var _=require(_0x9b55('0xa'));var squel=require('squel');var crypto=require(_0x9b55('0xb'));var jsforce=require(_0x9b55('0xc'));var deskjs=require(_0x9b55('0xd'));var toCsv=require(_0x9b55('0xe'));var querystring=require(_0x9b55('0xf'));var Papa=require(_0x9b55('0x10'));var Redis=require(_0x9b55('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9b55('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b55('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9b55('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b55('0x15'))['db'];function respondWithStatusCode(_0x277b88,_0x595919){_0x595919=_0x595919||0xcc;return function(_0x47d9ee){if(_0x47d9ee){return _0x277b88['sendStatus'](_0x595919);}return _0x277b88[_0x9b55('0x16')](_0x595919)[_0x9b55('0x17')]();};}function respondWithResult(_0x447195,_0x5d91b4){_0x5d91b4=_0x5d91b4||0xc8;return function(_0x559d88){if(_0x559d88){return _0x447195[_0x9b55('0x16')](_0x5d91b4)['json'](_0x559d88);}};}function respondWithFilteredResult(_0x99d03e,_0x3dbb75){return function(_0x3f9152){if(_0x3f9152){var _0x45fb40=typeof _0x3dbb75['offset']===_0x9b55('0x18')&&typeof _0x3dbb75['limit']==='undefined';var _0x414f59=_0x3f9152[_0x9b55('0x19')];var _0x44b24e=_0x45fb40?0x0:_0x3dbb75[_0x9b55('0x1a')];var _0x16ff43=_0x45fb40?_0x3f9152[_0x9b55('0x19')]:_0x3dbb75['offset']+_0x3dbb75[_0x9b55('0x1b')];var _0x50f686;if(_0x16ff43>=_0x414f59){_0x16ff43=_0x414f59;_0x50f686=0xc8;}else{_0x50f686=0xce;}_0x99d03e['status'](_0x50f686);return _0x99d03e['set'](_0x9b55('0x1c'),_0x44b24e+'-'+_0x16ff43+'/'+_0x414f59)[_0x9b55('0x1d')](_0x3f9152);}return null;};}function patchUpdates(_0x4c285e){return function(_0x5f4f79){try{jsonpatch[_0x9b55('0x1e')](_0x5f4f79,_0x4c285e,!![]);}catch(_0x17c0bb){return BPromise[_0x9b55('0x1f')](_0x17c0bb);}return _0x5f4f79['save']();};}function saveUpdates(_0x2fd7db,_0x46790d){return function(_0x50d97c){if(_0x50d97c){return _0x50d97c[_0x9b55('0x20')](_0x2fd7db)[_0x9b55('0x21')](function(_0x2a9ac8){return _0x2a9ac8;});}return null;};}function removeEntity(_0x25a49d,_0x32ed0d){return function(_0x3bef23){if(_0x3bef23){return _0x3bef23[_0x9b55('0x22')]()[_0x9b55('0x21')](function(){_0x25a49d[_0x9b55('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3884c9,_0x2a0964){return function(_0x9f6782){if(!_0x9f6782){_0x3884c9['sendStatus'](0x194);}return _0x9f6782;};}function handleError(_0x31273d,_0x36a102){_0x36a102=_0x36a102||0x1f4;return function(_0x33ffe8){logger[_0x9b55('0x23')](_0x33ffe8['stack']);if(_0x33ffe8[_0x9b55('0x24')]){delete _0x33ffe8[_0x9b55('0x24')];}_0x31273d[_0x9b55('0x16')](_0x36a102)[_0x9b55('0x25')](_0x33ffe8);};}exports[_0x9b55('0x26')]=function(_0x407ef0,_0x1158bf){var _0x182ac4={},_0x296532={},_0x5dabc2={'count':0x0,'rows':[]};var _0x4520a5=_[_0x9b55('0x27')](db['SugarcrmField']['rawAttributes'],function(_0x1d0a25){return{'name':_0x1d0a25[_0x9b55('0x28')],'type':_0x1d0a25[_0x9b55('0x29')][_0x9b55('0x2a')]};});_0x296532['model']=_[_0x9b55('0x27')](_0x4520a5,_0x9b55('0x24'));_0x296532['query']=_[_0x9b55('0x2b')](_0x407ef0[_0x9b55('0x2c')]);_0x296532['filters']=_[_0x9b55('0x2d')](_0x296532['model'],_0x296532[_0x9b55('0x2c')]);_0x182ac4['attributes']=_['intersection'](_0x296532[_0x9b55('0x2e')],qs['fields'](_0x407ef0[_0x9b55('0x2c')]['fields']));_0x182ac4[_0x9b55('0x2f')]=_0x182ac4[_0x9b55('0x2f')][_0x9b55('0x30')]?_0x182ac4['attributes']:_0x296532[_0x9b55('0x2e')];if(!_0x407ef0['query'][_0x9b55('0x31')](_0x9b55('0x32'))){_0x182ac4[_0x9b55('0x1b')]=qs[_0x9b55('0x1b')](_0x407ef0[_0x9b55('0x2c')][_0x9b55('0x1b')]);_0x182ac4['offset']=qs[_0x9b55('0x1a')](_0x407ef0[_0x9b55('0x2c')]['offset']);}_0x182ac4['order']=qs['sort'](_0x407ef0['query'][_0x9b55('0x33')]);_0x182ac4['where']=qs[_0x9b55('0x34')](_[_0x9b55('0x35')](_0x407ef0['query'],_0x296532[_0x9b55('0x34')]),_0x4520a5);if(_0x407ef0['query'][_0x9b55('0x36')]){_0x182ac4[_0x9b55('0x37')]=_['merge'](_0x182ac4[_0x9b55('0x37')],{'$or':_['map'](_0x4520a5,function(_0x5e1dda){if(_0x5e1dda['type']!==_0x9b55('0x38')){var _0x564151={};_0x564151[_0x5e1dda['name']]={'$like':'%'+_0x407ef0[_0x9b55('0x2c')]['filter']+'%'};return _0x564151;}})});}_0x182ac4=_[_0x9b55('0x39')]({},_0x182ac4,_0x407ef0[_0x9b55('0x3a')]);var _0x63d2a6={'where':_0x182ac4['where']};return db[_0x9b55('0x3b')]['count'](_0x63d2a6)[_0x9b55('0x21')](function(_0x37242a){_0x5dabc2[_0x9b55('0x19')]=_0x37242a;if(_0x407ef0[_0x9b55('0x2c')]['includeAll']){_0x182ac4[_0x9b55('0x3c')]=[{'all':!![]}];}return db[_0x9b55('0x3b')][_0x9b55('0x3d')](_0x182ac4);})[_0x9b55('0x21')](function(_0x398bc4){_0x5dabc2[_0x9b55('0x3e')]=_0x398bc4;return _0x5dabc2;})[_0x9b55('0x21')](respondWithFilteredResult(_0x1158bf,_0x182ac4))[_0x9b55('0x3f')](handleError(_0x1158bf,null));};exports[_0x9b55('0x40')]=function(_0x3a699b,_0x5ce78c){var _0x1956a0={'raw':!![],'where':{'id':_0x3a699b[_0x9b55('0x41')]['id']}},_0x5091be={};_0x5091be[_0x9b55('0x2e')]=_[_0x9b55('0x2b')](db[_0x9b55('0x3b')][_0x9b55('0x42')]);_0x5091be[_0x9b55('0x2c')]=_[_0x9b55('0x2b')](_0x3a699b[_0x9b55('0x2c')]);_0x5091be[_0x9b55('0x34')]=_[_0x9b55('0x2d')](_0x5091be[_0x9b55('0x2e')],_0x5091be[_0x9b55('0x2c')]);_0x1956a0['attributes']=_[_0x9b55('0x2d')](_0x5091be[_0x9b55('0x2e')],qs[_0x9b55('0x43')](_0x3a699b[_0x9b55('0x2c')][_0x9b55('0x43')]));_0x1956a0[_0x9b55('0x2f')]=_0x1956a0[_0x9b55('0x2f')]['length']?_0x1956a0[_0x9b55('0x2f')]:_0x5091be[_0x9b55('0x2e')];if(_0x3a699b[_0x9b55('0x2c')][_0x9b55('0x44')]){_0x1956a0[_0x9b55('0x3c')]=[{'all':!![]}];}_0x1956a0=_[_0x9b55('0x39')]({},_0x1956a0,_0x3a699b[_0x9b55('0x3a')]);return db['SugarcrmField']['find'](_0x1956a0)[_0x9b55('0x21')](handleEntityNotFound(_0x5ce78c,null))[_0x9b55('0x21')](respondWithResult(_0x5ce78c,null))[_0x9b55('0x3f')](handleError(_0x5ce78c,null));};exports['create']=function(_0x269e0e,_0xd0733e){return db[_0x9b55('0x3b')][_0x9b55('0x45')](_0x269e0e[_0x9b55('0x46')],{})[_0x9b55('0x21')](respondWithResult(_0xd0733e,0xc9))[_0x9b55('0x3f')](handleError(_0xd0733e,null));};exports['update']=function(_0x3101aa,_0x83a3cc){if(_0x3101aa['body']['id']){delete _0x3101aa['body']['id'];}return db[_0x9b55('0x3b')][_0x9b55('0x47')]({'where':{'id':_0x3101aa[_0x9b55('0x41')]['id']}})['then'](handleEntityNotFound(_0x83a3cc,null))[_0x9b55('0x21')](saveUpdates(_0x3101aa[_0x9b55('0x46')],null))[_0x9b55('0x21')](respondWithResult(_0x83a3cc,null))[_0x9b55('0x3f')](handleError(_0x83a3cc,null));};exports['destroy']=function(_0x2a219b,_0x350cbe){return db[_0x9b55('0x3b')][_0x9b55('0x47')]({'where':{'id':_0x2a219b['params']['id']}})['then'](handleEntityNotFound(_0x350cbe,null))['then'](removeEntity(_0x350cbe,null))['catch'](handleError(_0x350cbe,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 0aa7790..e885a30 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 _0x8f86=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId'];(function(_0x550651,_0x32926b){var _0x53edcf=function(_0x1ebc42){while(--_0x1ebc42){_0x550651['push'](_0x550651['shift']());}};_0x53edcf(++_0x32926b);}(_0x8f86,0x126));var _0x68f8=function(_0x3c6884,_0x1552f0){_0x3c6884=_0x3c6884-0x0;var _0x925818=_0x8f86[_0x3c6884];return _0x925818;};'use strict';var _=require(_0x68f8('0x0'));var util=require('util');var logger=require(_0x68f8('0x1'))(_0x68f8('0x2'));var moment=require('moment');var BPromise=require(_0x68f8('0x3'));var rp=require(_0x68f8('0x4'));var fs=require('fs');var path=require(_0x68f8('0x5'));var rimraf=require(_0x68f8('0x6'));var config=require(_0x68f8('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0x68f8('0x8')]=function(_0x15f8c6,_0x583f5f){return _0x15f8c6['define'](_0x68f8('0x9'),attributes,{'tableName':_0x68f8('0xa'),'paranoid':![],'indexes':[{'name':_0x68f8('0xb'),'fields':[_0x68f8('0xc'),_0x68f8('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8449=['sugarcrm_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x8449,0x1c3));var _0x9844=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x8449[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x9844('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9844('0x1'));var moment=require(_0x9844('0x2'));var BPromise=require(_0x9844('0x3'));var rp=require(_0x9844('0x4'));var fs=require('fs');var path=require(_0x9844('0x5'));var rimraf=require('rimraf');var config=require(_0x9844('0x6'));var attributes=require(_0x9844('0x7'));module[_0x9844('0x8')]=function(_0x516615,_0x23c947){return _0x516615['define'](_0x9844('0x9'),attributes,{'tableName':_0x9844('0xa'),'paranoid':![],'indexes':[{'name':_0x9844('0xb'),'fields':[_0x9844('0xc'),_0x9844('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 7f78044..a6ac711 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 _0x4b0c=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b0c,0x17c));var _0xc4b0=function(_0x3edeca,_0x49da0a){_0x3edeca=_0x3edeca-0x0;var _0x58e30b=_0x4b0c[_0x3edeca];return _0x58e30b;};'use strict';var _=require(_0xc4b0('0x0'));var util=require(_0xc4b0('0x1'));var moment=require(_0xc4b0('0x2'));var BPromise=require(_0xc4b0('0x3'));var rs=require(_0xc4b0('0x4'));var fs=require('fs');var Redis=require(_0xc4b0('0x5'));var db=require(_0xc4b0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc4b0('0x7'))('rpc');var config=require(_0xc4b0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e3fbb,_0x1cc4b0,_0xb0c31b){return new BPromise(function(_0x3b0cdc,_0x86d970){return client[_0xc4b0('0x9')](_0x4e3fbb,_0xb0c31b)[_0xc4b0('0xa')](function(_0x436577){logger[_0xc4b0('0xb')](_0xc4b0('0xc'),_0x1cc4b0,_0xc4b0('0xd'));logger[_0xc4b0('0xe')](_0xc4b0('0xf'),_0x1cc4b0,_0xc4b0('0xd'),JSON['stringify'](_0x436577));if(_0x436577[_0xc4b0('0x10')]){if(_0x436577[_0xc4b0('0x10')]['code']===0x1f4){logger[_0xc4b0('0x10')](_0xc4b0('0xc'),_0x1cc4b0,_0x436577[_0xc4b0('0x10')][_0xc4b0('0x11')]);return _0x86d970(_0x436577[_0xc4b0('0x10')][_0xc4b0('0x11')]);}logger[_0xc4b0('0x10')](_0xc4b0('0xc'),_0x1cc4b0,_0x436577[_0xc4b0('0x10')][_0xc4b0('0x11')]);return _0x3b0cdc(_0x436577['error'][_0xc4b0('0x11')]);}else{logger[_0xc4b0('0xb')]('SugarcrmField,\x20%s,\x20%s',_0x1cc4b0,_0xc4b0('0xd'));_0x3b0cdc(_0x436577[_0xc4b0('0x12')][_0xc4b0('0x11')]);}})['catch'](function(_0x5b4f5f){logger['error'](_0xc4b0('0xc'),_0x1cc4b0,_0x5b4f5f);_0x86d970(_0x5b4f5f);});});} \ No newline at end of file +var _0xf3fc=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0xc838b8,_0x2f4309){var _0x18c0be=function(_0x2d81cd){while(--_0x2d81cd){_0xc838b8['push'](_0xc838b8['shift']());}};_0x18c0be(++_0x2f4309);}(_0xf3fc,0x190));var _0xcf3f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf3fc[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xcf3f('0x0'));var util=require(_0xcf3f('0x1'));var moment=require(_0xcf3f('0x2'));var BPromise=require(_0xcf3f('0x3'));var rs=require(_0xcf3f('0x4'));var fs=require('fs');var Redis=require(_0xcf3f('0x5'));var db=require(_0xcf3f('0x6'))['db'];var utils=require(_0xcf3f('0x7'));var logger=require(_0xcf3f('0x8'))(_0xcf3f('0x9'));var config=require(_0xcf3f('0xa'));var jayson=require(_0xcf3f('0xb'));var client=jayson[_0xcf3f('0xc')][_0xcf3f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x52695f,_0x217c25,_0x3c321f){return new BPromise(function(_0x19b411,_0x2d8144){return client[_0xcf3f('0xe')](_0x52695f,_0x3c321f)['then'](function(_0x2a1a44){logger[_0xcf3f('0xf')](_0xcf3f('0x10'),_0x217c25,'request\x20sent');logger[_0xcf3f('0x11')](_0xcf3f('0x12'),_0x217c25,'request\x20sent',JSON[_0xcf3f('0x13')](_0x2a1a44));if(_0x2a1a44[_0xcf3f('0x14')]){if(_0x2a1a44[_0xcf3f('0x14')][_0xcf3f('0x15')]===0x1f4){logger[_0xcf3f('0x14')]('SugarcrmField,\x20%s,\x20%s',_0x217c25,_0x2a1a44[_0xcf3f('0x14')][_0xcf3f('0x16')]);return _0x2d8144(_0x2a1a44[_0xcf3f('0x14')][_0xcf3f('0x16')]);}logger[_0xcf3f('0x14')](_0xcf3f('0x10'),_0x217c25,_0x2a1a44[_0xcf3f('0x14')]['message']);return _0x19b411(_0x2a1a44[_0xcf3f('0x14')][_0xcf3f('0x16')]);}else{logger[_0xcf3f('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x217c25,_0xcf3f('0x17'));_0x19b411(_0x2a1a44[_0xcf3f('0x18')][_0xcf3f('0x16')]);}})['catch'](function(_0x540e86){logger[_0xcf3f('0x14')](_0xcf3f('0x10'),_0x217c25,_0x540e86);_0x2d8144(_0x540e86);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index ee8f5c8..ce1c95b 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 _0x0531=['/:id/fields','create','addConfiguration','put','update','delete','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations'];(function(_0x26c1f3,_0x4fd220){var _0x447b38=function(_0x30fe35){while(--_0x30fe35){_0x26c1f3['push'](_0x26c1f3['shift']());}};_0x447b38(++_0x4fd220);}(_0x0531,0xde));var _0x1053=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0x0531[_0x2d9535];return _0xb4e710;};'use strict';var multer=require(_0x1053('0x0'));var util=require(_0x1053('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1053('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1053('0x3'));var interaction=require(_0x1053('0x4'));var config=require(_0x1053('0x5'));var controller=require(_0x1053('0x6'));router[_0x1053('0x7')]('/',auth[_0x1053('0x8')](),controller[_0x1053('0x9')]);router[_0x1053('0x7')](_0x1053('0xa'),auth[_0x1053('0x8')](),controller['show']);router[_0x1053('0x7')](_0x1053('0xb'),auth[_0x1053('0x8')](),controller['getConfigurations']);router[_0x1053('0x7')](_0x1053('0xc'),auth[_0x1053('0x8')](),controller['getFields']);router['post']('/',auth[_0x1053('0x8')](),controller[_0x1053('0xd')]);router['post'](_0x1053('0xb'),auth[_0x1053('0x8')](),controller[_0x1053('0xe')]);router[_0x1053('0xf')](_0x1053('0xa'),auth[_0x1053('0x8')](),controller[_0x1053('0x10')]);router[_0x1053('0x11')](_0x1053('0xa'),auth[_0x1053('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7b5b=['../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','getConfigurations','getFields','create','post','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x29d355,_0xa82c06){var _0x428802=function(_0x77b40e){while(--_0x77b40e){_0x29d355['push'](_0x29d355['shift']());}};_0x428802(++_0xa82c06);}(_0x7b5b,0x14a));var _0xb7b5=function(_0x356312,_0x4e93b7){_0x356312=_0x356312-0x0;var _0x1b1055=_0x7b5b[_0x356312];return _0x1b1055;};'use strict';var multer=require('multer');var util=require(_0xb7b5('0x0'));var path=require(_0xb7b5('0x1'));var timeout=require(_0xb7b5('0x2'));var express=require(_0xb7b5('0x3'));var router=express[_0xb7b5('0x4')]();var fs_extra=require(_0xb7b5('0x5'));var auth=require(_0xb7b5('0x6'));var interaction=require(_0xb7b5('0x7'));var config=require(_0xb7b5('0x8'));var controller=require(_0xb7b5('0x9'));router[_0xb7b5('0xa')]('/',auth[_0xb7b5('0xb')](),controller[_0xb7b5('0xc')]);router[_0xb7b5('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb7b5('0xd')]);router[_0xb7b5('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xb7b5('0xe')]);router[_0xb7b5('0xa')]('/:id/fields',auth[_0xb7b5('0xb')](),controller[_0xb7b5('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb7b5('0x10')]);router[_0xb7b5('0x11')](_0xb7b5('0x12'),auth['isAuthenticated'](),controller[_0xb7b5('0x13')]);router[_0xb7b5('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xb7b5('0x15')]);router[_0xb7b5('0x16')](_0xb7b5('0x17'),auth[_0xb7b5('0xb')](),controller[_0xb7b5('0x18')]);module[_0xb7b5('0x19')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index e3b0060..841a8ee 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 _0x300b=['exports','STRING','HelpDesk'];(function(_0x2c9636,_0x25e85a){var _0x4dd4a3=function(_0x4ea988){while(--_0x4ea988){_0x2c9636['push'](_0x2c9636['shift']());}};_0x4dd4a3(++_0x25e85a);}(_0x300b,0x1e6));var _0xb300=function(_0x34c0f0,_0x3f6e99){_0x34c0f0=_0x34c0f0-0x0;var _0x1153b0=_0x300b[_0x34c0f0];return _0x1153b0;};'use strict';var Sequelize=require('sequelize');module[_0xb300('0x0')]={'name':{'type':Sequelize[_0xb300('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xb300('0x1')],'allowNull':![],'defaultValue':_0xb300('0x2')},'remoteUri':{'type':Sequelize[_0xb300('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xb300('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x11b2=['STRING','HelpDesk','sequelize','exports'];(function(_0xe5366,_0x32ea05){var _0x3dfd7d=function(_0x3aeb41){while(--_0x3aeb41){_0xe5366['push'](_0xe5366['shift']());}};_0x3dfd7d(++_0x32ea05);}(_0x11b2,0xc6));var _0x211b=function(_0x53f189,_0x5b7ffd){_0x53f189=_0x53f189-0x0;var _0x34fc15=_0x11b2[_0x53f189];return _0x34fc15;};'use strict';var Sequelize=require(_0x211b('0x0'));module[_0x211b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x211b('0x2')]},'username':{'type':Sequelize[_0x211b('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x211b('0x2')],'allowNull':![],'defaultValue':_0x211b('0x3')},'remoteUri':{'type':Sequelize[_0x211b('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x211b('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index e3dbfbc..3278d9d 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 _0xb33b=['params','create','body','getConfigurations','findOne','VtigerConfiguration','rawAttributes','order','filter','addConfiguration','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','login','token','describe','sessionName','autogenerated','remove','result','includes','editable','startsWith','cf_','picklist','picklistValues','label','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','index','map','VtigerAccount','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','VIRTUAL','options','then','includeAll','include','findAll','catch'];(function(_0x17f30f,_0x26a8aa){var _0x1491ea=function(_0x24b8d8){while(--_0x24b8d8){_0x17f30f['push'](_0x17f30f['shift']());}};_0x1491ea(++_0x26a8aa);}(_0xb33b,0xac));var _0xbb33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb33b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xbb33('0x0'));var rimraf=require(_0xbb33('0x1'));var zipdir=require(_0xbb33('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbb33('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbb33('0x4'));var util=require('util');var path=require(_0xbb33('0x5'));var sox=require('sox');var csv=require(_0xbb33('0x6'));var ejs=require(_0xbb33('0x7'));var fs=require('fs');var fs_extra=require(_0xbb33('0x8'));var _=require(_0xbb33('0x9'));var squel=require(_0xbb33('0xa'));var crypto=require(_0xbb33('0xb'));var jsforce=require(_0xbb33('0xc'));var deskjs=require(_0xbb33('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbb33('0xe'));var Papa=require(_0xbb33('0xf'));var Redis=require(_0xbb33('0x10'));var authService=require(_0xbb33('0x11'));var qs=require(_0xbb33('0x12'));var as=require(_0xbb33('0x13'));var hardwareService=require(_0xbb33('0x14'));var logger=require(_0xbb33('0x15'))(_0xbb33('0x16'));var utils=require(_0xbb33('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbb33('0x18'));var db=require(_0xbb33('0x19'))['db'];var integrations=require(_0xbb33('0x1a'));function respondWithStatusCode(_0x178e2f,_0x2c083b){_0x2c083b=_0x2c083b||0xcc;return function(_0x5bf355){if(_0x5bf355){return _0x178e2f['sendStatus'](_0x2c083b);}return _0x178e2f[_0xbb33('0x1b')](_0x2c083b)['end']();};}function respondWithResult(_0x28a83a,_0x582774){_0x582774=_0x582774||0xc8;return function(_0x4c4ff6){if(_0x4c4ff6){return _0x28a83a['status'](_0x582774)['json'](_0x4c4ff6);}};}function respondWithFilteredResult(_0x1df63d,_0x7c3453){return function(_0x2190a0){if(_0x2190a0){var _0xb5c63c=typeof _0x7c3453[_0xbb33('0x1c')]==='undefined'&&typeof _0x7c3453[_0xbb33('0x1d')]===_0xbb33('0x1e');var _0x5027de=_0x2190a0[_0xbb33('0x1f')];var _0x525c96=_0xb5c63c?0x0:_0x7c3453['offset'];var _0x240022=_0xb5c63c?_0x2190a0['count']:_0x7c3453[_0xbb33('0x1c')]+_0x7c3453[_0xbb33('0x1d')];var _0x2beaf4;if(_0x240022>=_0x5027de){_0x240022=_0x5027de;_0x2beaf4=0xc8;}else{_0x2beaf4=0xce;}_0x1df63d[_0xbb33('0x1b')](_0x2beaf4);return _0x1df63d[_0xbb33('0x20')](_0xbb33('0x21'),_0x525c96+'-'+_0x240022+'/'+_0x5027de)[_0xbb33('0x22')](_0x2190a0);}return null;};}function patchUpdates(_0x4dba6b){return function(_0x47f1b7){try{jsonpatch[_0xbb33('0x23')](_0x47f1b7,_0x4dba6b,!![]);}catch(_0x31aea2){return BPromise[_0xbb33('0x24')](_0x31aea2);}return _0x47f1b7[_0xbb33('0x25')]();};}function saveUpdates(_0x3f3503,_0x3d74af){return function(_0x29175a){if(_0x29175a){return _0x29175a[_0xbb33('0x26')](_0x3f3503)['then'](function(_0x28a3fd){return _0x28a3fd;});}return null;};}function removeEntity(_0x3f0428,_0x58e786){return function(_0x13baf6){if(_0x13baf6){return _0x13baf6[_0xbb33('0x27')]()['then'](function(){_0x3f0428['status'](0xcc)[_0xbb33('0x28')]();});}};}function handleEntityNotFound(_0x538f8a,_0x48cc97){return function(_0x24c61b){if(!_0x24c61b){_0x538f8a[_0xbb33('0x29')](0x194);}return _0x24c61b;};}function handleError(_0x250b4c,_0x2008ac){_0x2008ac=_0x2008ac||0x1f4;return function(_0x49fe27){logger['error'](_0x49fe27[_0xbb33('0x2a')]);if(_0x49fe27[_0xbb33('0x2b')]){delete _0x49fe27[_0xbb33('0x2b')];}_0x250b4c[_0xbb33('0x1b')](_0x2008ac)[_0xbb33('0x2c')](_0x49fe27);};}exports[_0xbb33('0x2d')]=function(_0x1deef5,_0x55e35a){var _0x48eed9={},_0x43dbdb={},_0x4e04c2={'count':0x0,'rows':[]};var _0x5e7ad0=_[_0xbb33('0x2e')](db[_0xbb33('0x2f')]['rawAttributes'],function(_0x5dba3){return{'name':_0x5dba3['fieldName'],'type':_0x5dba3['type']['key']};});_0x43dbdb[_0xbb33('0x30')]=_[_0xbb33('0x2e')](_0x5e7ad0,_0xbb33('0x2b'));_0x43dbdb[_0xbb33('0x31')]=_[_0xbb33('0x32')](_0x1deef5[_0xbb33('0x31')]);_0x43dbdb['filters']=_[_0xbb33('0x33')](_0x43dbdb[_0xbb33('0x30')],_0x43dbdb['query']);_0x48eed9[_0xbb33('0x34')]=_[_0xbb33('0x33')](_0x43dbdb[_0xbb33('0x30')],qs[_0xbb33('0x35')](_0x1deef5[_0xbb33('0x31')][_0xbb33('0x35')]));_0x48eed9[_0xbb33('0x34')]=_0x48eed9[_0xbb33('0x34')][_0xbb33('0x36')]?_0x48eed9[_0xbb33('0x34')]:_0x43dbdb[_0xbb33('0x30')];if(!_0x1deef5[_0xbb33('0x31')][_0xbb33('0x37')](_0xbb33('0x38'))){_0x48eed9[_0xbb33('0x1d')]=qs[_0xbb33('0x1d')](_0x1deef5[_0xbb33('0x31')]['limit']);_0x48eed9[_0xbb33('0x1c')]=qs['offset'](_0x1deef5[_0xbb33('0x31')][_0xbb33('0x1c')]);}_0x48eed9['order']=qs['sort'](_0x1deef5[_0xbb33('0x31')][_0xbb33('0x39')]);_0x48eed9[_0xbb33('0x3a')]=qs[_0xbb33('0x3b')](_[_0xbb33('0x3c')](_0x1deef5[_0xbb33('0x31')],_0x43dbdb[_0xbb33('0x3b')]),_0x5e7ad0);if(_0x1deef5[_0xbb33('0x31')]['filter']){_0x48eed9[_0xbb33('0x3a')]=_[_0xbb33('0x3d')](_0x48eed9['where'],{'$or':_['map'](_0x5e7ad0,function(_0x1e9b0d){if(_0x1e9b0d[_0xbb33('0x3e')]!==_0xbb33('0x3f')){var _0x56ca33={};_0x56ca33[_0x1e9b0d[_0xbb33('0x2b')]]={'$like':'%'+_0x1deef5['query']['filter']+'%'};return _0x56ca33;}})});}_0x48eed9=_[_0xbb33('0x3d')]({},_0x48eed9,_0x1deef5[_0xbb33('0x40')]);var _0x8e3870={'where':_0x48eed9[_0xbb33('0x3a')]};return db[_0xbb33('0x2f')][_0xbb33('0x1f')](_0x8e3870)[_0xbb33('0x41')](function(_0x361a6c){_0x4e04c2[_0xbb33('0x1f')]=_0x361a6c;if(_0x1deef5['query'][_0xbb33('0x42')]){_0x48eed9[_0xbb33('0x43')]=[{'all':!![]}];}return db[_0xbb33('0x2f')][_0xbb33('0x44')](_0x48eed9);})[_0xbb33('0x41')](function(_0x29dcf8){_0x4e04c2['rows']=_0x29dcf8;return _0x4e04c2;})[_0xbb33('0x41')](respondWithFilteredResult(_0x55e35a,_0x48eed9))[_0xbb33('0x45')](handleError(_0x55e35a,null));};exports['show']=function(_0x2cd088,_0x316a61){var _0x477f9d={'raw':![],'where':{'id':_0x2cd088[_0xbb33('0x46')]['id']}},_0x20d191={};_0x20d191[_0xbb33('0x30')]=_[_0xbb33('0x32')](db[_0xbb33('0x2f')]['rawAttributes']);_0x20d191[_0xbb33('0x31')]=_[_0xbb33('0x32')](_0x2cd088['query']);_0x20d191[_0xbb33('0x3b')]=_[_0xbb33('0x33')](_0x20d191[_0xbb33('0x30')],_0x20d191[_0xbb33('0x31')]);_0x477f9d[_0xbb33('0x34')]=_[_0xbb33('0x33')](_0x20d191[_0xbb33('0x30')],qs[_0xbb33('0x35')](_0x2cd088[_0xbb33('0x31')][_0xbb33('0x35')]));_0x477f9d[_0xbb33('0x34')]=_0x477f9d[_0xbb33('0x34')][_0xbb33('0x36')]?_0x477f9d[_0xbb33('0x34')]:_0x20d191[_0xbb33('0x30')];if(_0x2cd088['query'][_0xbb33('0x42')]){_0x477f9d['include']=[{'all':!![]}];}_0x477f9d=_['merge']({},_0x477f9d,_0x2cd088[_0xbb33('0x40')]);return db['VtigerAccount']['find'](_0x477f9d)[_0xbb33('0x41')](handleEntityNotFound(_0x316a61,null))[_0xbb33('0x41')](respondWithResult(_0x316a61,null))[_0xbb33('0x45')](handleError(_0x316a61,null));};exports[_0xbb33('0x47')]=function(_0xa59b51,_0x4f8873){return db['VtigerAccount'][_0xbb33('0x47')](_0xa59b51[_0xbb33('0x48')],{})[_0xbb33('0x41')](respondWithResult(_0x4f8873,0xc9))[_0xbb33('0x45')](handleError(_0x4f8873,null));};exports['update']=function(_0xe628df,_0x37cb45){if(_0xe628df[_0xbb33('0x48')]['id']){delete _0xe628df[_0xbb33('0x48')]['id'];}return db[_0xbb33('0x2f')]['find']({'where':{'id':_0xe628df[_0xbb33('0x46')]['id']}})[_0xbb33('0x41')](handleEntityNotFound(_0x37cb45,null))[_0xbb33('0x41')](saveUpdates(_0xe628df['body'],null))[_0xbb33('0x41')](respondWithResult(_0x37cb45,null))['catch'](handleError(_0x37cb45,null));};exports[_0xbb33('0x27')]=function(_0x3d1ef8,_0x26be4e){return db[_0xbb33('0x2f')]['find']({'where':{'id':_0x3d1ef8[_0xbb33('0x46')]['id']}})[_0xbb33('0x41')](handleEntityNotFound(_0x26be4e,null))[_0xbb33('0x41')](removeEntity(_0x26be4e,null))['catch'](handleError(_0x26be4e,null));};exports[_0xbb33('0x49')]=function(_0x2de884,_0x50b83e,_0x5ed127){var _0x534663={};var _0x447d84={};var _0x238414;var _0x181d31;return db[_0xbb33('0x2f')][_0xbb33('0x4a')]({'where':{'id':_0x2de884['params']['id']}})[_0xbb33('0x41')](handleEntityNotFound(_0x50b83e,null))[_0xbb33('0x41')](function(_0x1bd0fb){if(_0x1bd0fb){_0x238414=_0x1bd0fb;_0x447d84[_0xbb33('0x30')]=_[_0xbb33('0x32')](db[_0xbb33('0x4b')][_0xbb33('0x4c')]);_0x447d84['query']=_['keys'](_0x2de884['query']);_0x447d84[_0xbb33('0x3b')]=_[_0xbb33('0x33')](_0x447d84[_0xbb33('0x30')],_0x447d84['query']);_0x534663[_0xbb33('0x34')]=_[_0xbb33('0x33')](_0x447d84[_0xbb33('0x30')],qs[_0xbb33('0x35')](_0x2de884['query']['fields']));_0x534663[_0xbb33('0x34')]=_0x534663[_0xbb33('0x34')][_0xbb33('0x36')]?_0x534663['attributes']:_0x447d84[_0xbb33('0x30')];_0x534663[_0xbb33('0x4d')]=qs['sort'](_0x2de884[_0xbb33('0x31')][_0xbb33('0x39')]);_0x534663[_0xbb33('0x3a')]=qs[_0xbb33('0x3b')](_[_0xbb33('0x3c')](_0x2de884['query'],_0x447d84[_0xbb33('0x3b')]));if(_0x2de884['query'][_0xbb33('0x4e')]){_0x534663['where']=_[_0xbb33('0x3d')](_0x534663[_0xbb33('0x3a')],{'$or':_[_0xbb33('0x2e')](_0x534663['attributes'],function(_0x39d996){var _0x3883ae={};_0x3883ae[_0x39d996]={'$like':'%'+_0x2de884[_0xbb33('0x31')][_0xbb33('0x4e')]+'%'};return _0x3883ae;})});}_0x534663=_[_0xbb33('0x3d')]({},_0x534663,_0x2de884[_0xbb33('0x40')]);return _0x238414[_0xbb33('0x49')](_0x534663);}})['then'](function(_0x4c80e3){if(_0x4c80e3){_0x181d31=_0x4c80e3[_0xbb33('0x36')];if(!_0x2de884['query'][_0xbb33('0x37')](_0xbb33('0x38'))){_0x534663['limit']=qs['limit'](_0x2de884[_0xbb33('0x31')][_0xbb33('0x1d')]);_0x534663[_0xbb33('0x1c')]=qs[_0xbb33('0x1c')](_0x2de884[_0xbb33('0x31')][_0xbb33('0x1c')]);}return _0x238414[_0xbb33('0x49')](_0x534663);}})[_0xbb33('0x41')](function(_0xa03559){if(_0xa03559){return _0xa03559?{'count':_0x181d31,'rows':_0xa03559}:null;}})[_0xbb33('0x41')](respondWithResult(_0x50b83e,null))['catch'](handleError(_0x50b83e,null));};exports[_0xbb33('0x4f')]=function(_0x148298,_0x251841,_0x271ec2){if(_0x148298[_0xbb33('0x48')]['id']){delete _0x148298[_0xbb33('0x48')]['id'];}return db['VtigerAccount'][_0xbb33('0x4a')]({'where':{'id':_0x148298[_0xbb33('0x46')]['id']}})['then'](handleEntityNotFound(_0x251841,null))['then'](function(_0x312fa5){if(_0x312fa5){_0x148298[_0xbb33('0x48')]['AccountId']=_0x312fa5['id'];_0x148298[_0xbb33('0x48')][_0xbb33('0x50')]=integrations[_0xbb33('0x51')](_0x148298[_0xbb33('0x48')][_0xbb33('0x52')],_0x148298[_0xbb33('0x48')]['type']);_0x148298['body'][_0xbb33('0x53')]=integrations['getDescriptions'](_0x148298['body']['channel'],_0x148298['body'][_0xbb33('0x3e')]);return db[_0xbb33('0x4b')][_0xbb33('0x47')](_0x148298['body'],{'include':[{'model':db[_0xbb33('0x54')],'as':'Subjects'},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0xbb33('0x41')](respondWithResult(_0x251841,null))[_0xbb33('0x45')](handleError(_0x251841,null));};var md5=require(_0xbb33('0x55'));exports['getFields']=function(_0x1d6731,_0x3f6556,_0x3c94de){var _0x101717=null;var _0x2ada20=null;var _0x352f4a=null;var _0x188581=null;var _0x2c83db='';return db[_0xbb33('0x2f')]['findOne']({'where':{'id':_0x1d6731[_0xbb33('0x46')]['id']},'attributes':['id',_0xbb33('0x2b'),_0xbb33('0x56'),_0xbb33('0x57'),_0xbb33('0x58'),'remoteUri',_0xbb33('0x59'),_0xbb33('0x5a')]})['then'](handleEntityNotFound(_0x3f6556,null))[_0xbb33('0x41')](function(_0x48e050){if(_0x48e050){_0x101717=_0x48e050['username'];_0x2ada20=_0x48e050[_0xbb33('0x5a')];_0x352f4a=_0x48e050[_0xbb33('0x58')];_0x2c83db=_0x48e050[_0xbb33('0x5b')];var _0x1c774d=_0x2c83db[_0xbb33('0x5c')](-0x1);if(_0x1c774d==='/'){_0x2c83db=_0x2c83db['substring'](0x0,_0x2c83db[_0xbb33('0x5d')](_0x1c774d));}_0x188581=util[_0xbb33('0x5e')](_0xbb33('0x5f'),_0x2c83db);var _0xc5f4e6={'method':_0xbb33('0x60'),'uri':_0x188581,'qs':{'operation':_0xbb33('0x61'),'username':_0x48e050['username']},'json':!![]};return rp(_0xc5f4e6);}})['then'](function(_0x538eee){if(_0x538eee[_0xbb33('0x62')]){var _0x247158={'method':'POST','uri':_0x188581,'form':{'operation':_0xbb33('0x63'),'username':_0x101717,'accessKey':md5(_0x538eee['result'][_0xbb33('0x64')]+_0x2ada20)},'json':!![]};return rp(_0x247158);}})['then'](function(_0x3cf8fb){if(_0x3cf8fb[_0xbb33('0x62')]){var _0x5d8b43={'method':'GET','uri':_0x188581,'qs':{'operation':_0xbb33('0x65'),'username':_0x101717,'sessionName':_0x3cf8fb['result'][_0xbb33('0x66')],'elementType':_0x352f4a},'json':!![]};return rp(_0x5d8b43);}})[_0xbb33('0x41')](function(_0x368c0a){if(_0x368c0a['success']){var _0x3cd851=[_0xbb33('0x67'),'reference','owner'];_[_0xbb33('0x68')](_0x368c0a[_0xbb33('0x69')][_0xbb33('0x35')],function(_0x39e6ec){return _0x3cd851[_0xbb33('0x6a')](_0x39e6ec['type'][_0xbb33('0x2b')]);});_[_0xbb33('0x68')](_0x368c0a[_0xbb33('0x69')][_0xbb33('0x35')],function(_0x2ebe91){return _0x2ebe91[_0xbb33('0x6b')]==='false';});return{'count':_0x368c0a[_0xbb33('0x69')][_0xbb33('0x35')][_0xbb33('0x36')],'rows':_['map'](_0x368c0a[_0xbb33('0x69')]['fields'],function(_0x4ca140){return{'id':_0x4ca140[_0xbb33('0x2b')],'name':_0x4ca140['label'],'custom':_[_0xbb33('0x6c')](_0x4ca140[_0xbb33('0x2b')],_0xbb33('0x6d'))?!![]:![],'options':_0x4ca140['type'][_0xbb33('0x2b')]===_0xbb33('0x6e')&&_0x4ca140[_0xbb33('0x3e')]['picklistValues'][_0xbb33('0x36')]>0x0?_[_0xbb33('0x2e')](_0x4ca140[_0xbb33('0x3e')][_0xbb33('0x6f')],function(_0x2fe91b){return{'name':_0x2fe91b[_0xbb33('0x70')],'value':_0x2fe91b[_0xbb33('0x71')]};}):[]};})};}})[_0xbb33('0x41')](respondWithResult(_0x3f6556,null))[_0xbb33('0x45')](function(_0x414ef7){console[_0xbb33('0x72')](_0xbb33('0x73')+_0x414ef7);var _0x57520c=_0x1d6731[_0xbb33('0x31')][_0xbb33('0x74')]?0x1f4:_0x414ef7[_0xbb33('0x75')]||0x1f4;logger['error'](_0xbb33('0x76'),_0xbb33('0x77'),_0x57520c,JSON['stringify'](_0x414ef7));delete _0x414ef7[_0xbb33('0x2b')];if(_0x57520c===0x191){_0x57520c=0x190;}_0x3f6556[_0xbb33('0x1b')](_0x57520c)[_0xbb33('0x2c')](_0x1d6731['query'][_0xbb33('0x74')]?{'message':_0xbb33('0x78'),'statusCode':_0x414ef7[_0xbb33('0x75')]}:_0x414ef7);});}; \ No newline at end of file +var _0x11ba=['find','getConfigurations','findOne','addConfiguration','AccountId','Subjects','Descriptions','VtigerConfiguration','VtigerField','md5','username','description','moduleName','remoteUri','slice','substring','lastIndexOf','format','%s/webservice.php','GET','success','login','token','describe','result','autogenerated','reference','owner','remove','editable','label','startsWith','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','VtigerAccount','findAll','rows','catch','show','params','keys','includeAll','create','body','update'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0x11ba,0xa2));var _0xa11b=function(_0x46f8bc,_0x175089){_0x46f8bc=_0x46f8bc-0x0;var _0x5e2534=_0x11ba[_0x46f8bc];return _0x5e2534;};'use strict';var emlformat=require(_0xa11b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa11b('0x1'));var jsonpatch=require(_0xa11b('0x2'));var rp=require(_0xa11b('0x3'));var moment=require(_0xa11b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa11b('0x5'));var path=require(_0xa11b('0x6'));var sox=require('sox');var csv=require(_0xa11b('0x7'));var ejs=require(_0xa11b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa11b('0x9'));var squel=require(_0xa11b('0xa'));var crypto=require('crypto');var jsforce=require(_0xa11b('0xb'));var deskjs=require(_0xa11b('0xc'));var toCsv=require(_0xa11b('0x7'));var querystring=require(_0xa11b('0xd'));var Papa=require('papaparse');var Redis=require(_0xa11b('0xe'));var authService=require(_0xa11b('0xf'));var qs=require(_0xa11b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa11b('0x11'))(_0xa11b('0x12'));var utils=require('../../config/utils');var config=require(_0xa11b('0x13'));var licenseUtil=require(_0xa11b('0x14'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x22628b,_0x1e31ab){_0x1e31ab=_0x1e31ab||0xcc;return function(_0x1f72c6){if(_0x1f72c6){return _0x22628b[_0xa11b('0x15')](_0x1e31ab);}return _0x22628b[_0xa11b('0x16')](_0x1e31ab)[_0xa11b('0x17')]();};}function respondWithResult(_0x5076d0,_0x517306){_0x517306=_0x517306||0xc8;return function(_0x4dd889){if(_0x4dd889){return _0x5076d0[_0xa11b('0x16')](_0x517306)[_0xa11b('0x18')](_0x4dd889);}};}function respondWithFilteredResult(_0x4b90af,_0x3ee941){return function(_0x13fa69){if(_0x13fa69){var _0x459aaf=typeof _0x3ee941[_0xa11b('0x19')]==='undefined'&&typeof _0x3ee941[_0xa11b('0x1a')]===_0xa11b('0x1b');var _0x50e828=_0x13fa69[_0xa11b('0x1c')];var _0x37a564=_0x459aaf?0x0:_0x3ee941[_0xa11b('0x19')];var _0xa087e3=_0x459aaf?_0x13fa69['count']:_0x3ee941[_0xa11b('0x19')]+_0x3ee941[_0xa11b('0x1a')];var _0x3288c7;if(_0xa087e3>=_0x50e828){_0xa087e3=_0x50e828;_0x3288c7=0xc8;}else{_0x3288c7=0xce;}_0x4b90af[_0xa11b('0x16')](_0x3288c7);return _0x4b90af[_0xa11b('0x1d')](_0xa11b('0x1e'),_0x37a564+'-'+_0xa087e3+'/'+_0x50e828)[_0xa11b('0x18')](_0x13fa69);}return null;};}function patchUpdates(_0x39b8ee){return function(_0x9489d0){try{jsonpatch[_0xa11b('0x1f')](_0x9489d0,_0x39b8ee,!![]);}catch(_0x3e7446){return BPromise[_0xa11b('0x20')](_0x3e7446);}return _0x9489d0[_0xa11b('0x21')]();};}function saveUpdates(_0x8ef47f,_0x6fa1d2){return function(_0x2b03ce){if(_0x2b03ce){return _0x2b03ce['update'](_0x8ef47f)[_0xa11b('0x22')](function(_0x58bf11){return _0x58bf11;});}return null;};}function removeEntity(_0x27e43a,_0x4c1d6c){return function(_0x4f2e35){if(_0x4f2e35){return _0x4f2e35[_0xa11b('0x23')]()['then'](function(){_0x27e43a[_0xa11b('0x16')](0xcc)[_0xa11b('0x17')]();});}};}function handleEntityNotFound(_0x2fb53a,_0x446bed){return function(_0x2c64e7){if(!_0x2c64e7){_0x2fb53a['sendStatus'](0x194);}return _0x2c64e7;};}function handleError(_0x25bc38,_0x2d00e3){_0x2d00e3=_0x2d00e3||0x1f4;return function(_0x2f036e){logger['error'](_0x2f036e[_0xa11b('0x24')]);if(_0x2f036e['name']){delete _0x2f036e[_0xa11b('0x25')];}_0x25bc38[_0xa11b('0x16')](_0x2d00e3)['send'](_0x2f036e);};}exports[_0xa11b('0x26')]=function(_0x5e552d,_0x23217c){var _0x995057={},_0x4afae7={},_0x423745={'count':0x0,'rows':[]};var _0x39ff07=_[_0xa11b('0x27')](db['VtigerAccount'][_0xa11b('0x28')],function(_0x52249e){return{'name':_0x52249e[_0xa11b('0x29')],'type':_0x52249e[_0xa11b('0x2a')][_0xa11b('0x2b')]};});_0x4afae7[_0xa11b('0x2c')]=_[_0xa11b('0x27')](_0x39ff07,_0xa11b('0x25'));_0x4afae7['query']=_['keys'](_0x5e552d[_0xa11b('0x2d')]);_0x4afae7[_0xa11b('0x2e')]=_[_0xa11b('0x2f')](_0x4afae7[_0xa11b('0x2c')],_0x4afae7[_0xa11b('0x2d')]);_0x995057[_0xa11b('0x30')]=_['intersection'](_0x4afae7[_0xa11b('0x2c')],qs[_0xa11b('0x31')](_0x5e552d[_0xa11b('0x2d')]['fields']));_0x995057[_0xa11b('0x30')]=_0x995057[_0xa11b('0x30')][_0xa11b('0x32')]?_0x995057[_0xa11b('0x30')]:_0x4afae7[_0xa11b('0x2c')];if(!_0x5e552d['query'][_0xa11b('0x33')](_0xa11b('0x34'))){_0x995057[_0xa11b('0x1a')]=qs[_0xa11b('0x1a')](_0x5e552d[_0xa11b('0x2d')][_0xa11b('0x1a')]);_0x995057[_0xa11b('0x19')]=qs[_0xa11b('0x19')](_0x5e552d[_0xa11b('0x2d')][_0xa11b('0x19')]);}_0x995057[_0xa11b('0x35')]=qs[_0xa11b('0x36')](_0x5e552d[_0xa11b('0x2d')][_0xa11b('0x36')]);_0x995057[_0xa11b('0x37')]=qs[_0xa11b('0x2e')](_[_0xa11b('0x38')](_0x5e552d['query'],_0x4afae7['filters']),_0x39ff07);if(_0x5e552d[_0xa11b('0x2d')][_0xa11b('0x39')]){_0x995057['where']=_[_0xa11b('0x3a')](_0x995057[_0xa11b('0x37')],{'$or':_[_0xa11b('0x27')](_0x39ff07,function(_0x314e2c){if(_0x314e2c[_0xa11b('0x2a')]!=='VIRTUAL'){var _0x49c1fc={};_0x49c1fc[_0x314e2c[_0xa11b('0x25')]]={'$like':'%'+_0x5e552d[_0xa11b('0x2d')]['filter']+'%'};return _0x49c1fc;}})});}_0x995057=_[_0xa11b('0x3a')]({},_0x995057,_0x5e552d[_0xa11b('0x3b')]);var _0x5c4ac0={'where':_0x995057['where']};return db['VtigerAccount']['count'](_0x5c4ac0)[_0xa11b('0x22')](function(_0x4d9986){_0x423745[_0xa11b('0x1c')]=_0x4d9986;if(_0x5e552d[_0xa11b('0x2d')]['includeAll']){_0x995057[_0xa11b('0x3c')]=[{'all':!![]}];}return db[_0xa11b('0x3d')][_0xa11b('0x3e')](_0x995057);})[_0xa11b('0x22')](function(_0x4d5a71){_0x423745[_0xa11b('0x3f')]=_0x4d5a71;return _0x423745;})['then'](respondWithFilteredResult(_0x23217c,_0x995057))[_0xa11b('0x40')](handleError(_0x23217c,null));};exports[_0xa11b('0x41')]=function(_0x2bf68e,_0x144b33){var _0x18bf0e={'raw':![],'where':{'id':_0x2bf68e[_0xa11b('0x42')]['id']}},_0x4d9376={};_0x4d9376['model']=_[_0xa11b('0x43')](db[_0xa11b('0x3d')][_0xa11b('0x28')]);_0x4d9376['query']=_[_0xa11b('0x43')](_0x2bf68e['query']);_0x4d9376['filters']=_[_0xa11b('0x2f')](_0x4d9376[_0xa11b('0x2c')],_0x4d9376[_0xa11b('0x2d')]);_0x18bf0e[_0xa11b('0x30')]=_[_0xa11b('0x2f')](_0x4d9376[_0xa11b('0x2c')],qs[_0xa11b('0x31')](_0x2bf68e['query'][_0xa11b('0x31')]));_0x18bf0e[_0xa11b('0x30')]=_0x18bf0e['attributes']['length']?_0x18bf0e[_0xa11b('0x30')]:_0x4d9376[_0xa11b('0x2c')];if(_0x2bf68e['query'][_0xa11b('0x44')]){_0x18bf0e[_0xa11b('0x3c')]=[{'all':!![]}];}_0x18bf0e=_[_0xa11b('0x3a')]({},_0x18bf0e,_0x2bf68e[_0xa11b('0x3b')]);return db[_0xa11b('0x3d')]['find'](_0x18bf0e)['then'](handleEntityNotFound(_0x144b33,null))[_0xa11b('0x22')](respondWithResult(_0x144b33,null))[_0xa11b('0x40')](handleError(_0x144b33,null));};exports[_0xa11b('0x45')]=function(_0xf81d9b,_0x453338){return db['VtigerAccount'][_0xa11b('0x45')](_0xf81d9b[_0xa11b('0x46')],{})[_0xa11b('0x22')](respondWithResult(_0x453338,0xc9))['catch'](handleError(_0x453338,null));};exports[_0xa11b('0x47')]=function(_0x509d34,_0x264f9e){if(_0x509d34[_0xa11b('0x46')]['id']){delete _0x509d34[_0xa11b('0x46')]['id'];}return db[_0xa11b('0x3d')][_0xa11b('0x48')]({'where':{'id':_0x509d34[_0xa11b('0x42')]['id']}})[_0xa11b('0x22')](handleEntityNotFound(_0x264f9e,null))['then'](saveUpdates(_0x509d34[_0xa11b('0x46')],null))[_0xa11b('0x22')](respondWithResult(_0x264f9e,null))[_0xa11b('0x40')](handleError(_0x264f9e,null));};exports[_0xa11b('0x23')]=function(_0x951411,_0x10400d){return db[_0xa11b('0x3d')]['find']({'where':{'id':_0x951411['params']['id']}})[_0xa11b('0x22')](handleEntityNotFound(_0x10400d,null))[_0xa11b('0x22')](removeEntity(_0x10400d,null))['catch'](handleError(_0x10400d,null));};exports[_0xa11b('0x49')]=function(_0x15736b,_0x23d3c4,_0x521054){var _0x44b4be={};var _0x3fab77={};var _0x4e257b;var _0x103997;return db['VtigerAccount'][_0xa11b('0x4a')]({'where':{'id':_0x15736b[_0xa11b('0x42')]['id']}})['then'](handleEntityNotFound(_0x23d3c4,null))[_0xa11b('0x22')](function(_0x52f6c9){if(_0x52f6c9){_0x4e257b=_0x52f6c9;_0x3fab77[_0xa11b('0x2c')]=_['keys'](db['VtigerConfiguration'][_0xa11b('0x28')]);_0x3fab77[_0xa11b('0x2d')]=_[_0xa11b('0x43')](_0x15736b[_0xa11b('0x2d')]);_0x3fab77['filters']=_[_0xa11b('0x2f')](_0x3fab77[_0xa11b('0x2c')],_0x3fab77[_0xa11b('0x2d')]);_0x44b4be[_0xa11b('0x30')]=_[_0xa11b('0x2f')](_0x3fab77[_0xa11b('0x2c')],qs[_0xa11b('0x31')](_0x15736b[_0xa11b('0x2d')]['fields']));_0x44b4be[_0xa11b('0x30')]=_0x44b4be[_0xa11b('0x30')]['length']?_0x44b4be[_0xa11b('0x30')]:_0x3fab77['model'];_0x44b4be[_0xa11b('0x35')]=qs[_0xa11b('0x36')](_0x15736b[_0xa11b('0x2d')]['sort']);_0x44b4be[_0xa11b('0x37')]=qs[_0xa11b('0x2e')](_[_0xa11b('0x38')](_0x15736b['query'],_0x3fab77[_0xa11b('0x2e')]));if(_0x15736b[_0xa11b('0x2d')][_0xa11b('0x39')]){_0x44b4be['where']=_[_0xa11b('0x3a')](_0x44b4be[_0xa11b('0x37')],{'$or':_[_0xa11b('0x27')](_0x44b4be['attributes'],function(_0x594eb3){var _0x5901d1={};_0x5901d1[_0x594eb3]={'$like':'%'+_0x15736b[_0xa11b('0x2d')][_0xa11b('0x39')]+'%'};return _0x5901d1;})});}_0x44b4be=_['merge']({},_0x44b4be,_0x15736b[_0xa11b('0x3b')]);return _0x4e257b['getConfigurations'](_0x44b4be);}})['then'](function(_0x85c653){if(_0x85c653){_0x103997=_0x85c653['length'];if(!_0x15736b[_0xa11b('0x2d')]['hasOwnProperty'](_0xa11b('0x34'))){_0x44b4be[_0xa11b('0x1a')]=qs[_0xa11b('0x1a')](_0x15736b[_0xa11b('0x2d')][_0xa11b('0x1a')]);_0x44b4be[_0xa11b('0x19')]=qs[_0xa11b('0x19')](_0x15736b[_0xa11b('0x2d')]['offset']);}return _0x4e257b[_0xa11b('0x49')](_0x44b4be);}})['then'](function(_0x4319bd){if(_0x4319bd){return _0x4319bd?{'count':_0x103997,'rows':_0x4319bd}:null;}})[_0xa11b('0x22')](respondWithResult(_0x23d3c4,null))[_0xa11b('0x40')](handleError(_0x23d3c4,null));};exports[_0xa11b('0x4b')]=function(_0x501604,_0x4613ed,_0x3f4f69){if(_0x501604[_0xa11b('0x46')]['id']){delete _0x501604[_0xa11b('0x46')]['id'];}return db['VtigerAccount'][_0xa11b('0x4a')]({'where':{'id':_0x501604['params']['id']}})[_0xa11b('0x22')](handleEntityNotFound(_0x4613ed,null))[_0xa11b('0x22')](function(_0x3aecd3){if(_0x3aecd3){_0x501604[_0xa11b('0x46')][_0xa11b('0x4c')]=_0x3aecd3['id'];_0x501604['body'][_0xa11b('0x4d')]=integrations['getSubjects'](_0x501604[_0xa11b('0x46')]['channel'],_0x501604[_0xa11b('0x46')][_0xa11b('0x2a')]);_0x501604[_0xa11b('0x46')][_0xa11b('0x4e')]=integrations['getDescriptions'](_0x501604[_0xa11b('0x46')]['channel'],_0x501604[_0xa11b('0x46')][_0xa11b('0x2a')]);return db[_0xa11b('0x4f')][_0xa11b('0x45')](_0x501604[_0xa11b('0x46')],{'include':[{'model':db[_0xa11b('0x50')],'as':'Subjects'},{'model':db[_0xa11b('0x50')],'as':_0xa11b('0x4e')}]});}return null;})[_0xa11b('0x22')](respondWithResult(_0x4613ed,null))[_0xa11b('0x40')](handleError(_0x4613ed,null));};var md5=require(_0xa11b('0x51'));exports['getFields']=function(_0x419ac6,_0xc5b150,_0x32823d){var _0x2a011c=null;var _0x4c36c8=null;var _0x261301=null;var _0x3d5235=null;var _0x15d747='';return db[_0xa11b('0x3d')][_0xa11b('0x4a')]({'where':{'id':_0x419ac6[_0xa11b('0x42')]['id']},'attributes':['id',_0xa11b('0x25'),_0xa11b('0x52'),_0xa11b('0x53'),_0xa11b('0x54'),_0xa11b('0x55'),'serverUrl','accessKey']})[_0xa11b('0x22')](handleEntityNotFound(_0xc5b150,null))['then'](function(_0x360437){if(_0x360437){_0x2a011c=_0x360437[_0xa11b('0x52')];_0x4c36c8=_0x360437['accessKey'];_0x261301=_0x360437[_0xa11b('0x54')];_0x15d747=_0x360437[_0xa11b('0x55')];var _0x27d513=_0x15d747[_0xa11b('0x56')](-0x1);if(_0x27d513==='/'){_0x15d747=_0x15d747[_0xa11b('0x57')](0x0,_0x15d747[_0xa11b('0x58')](_0x27d513));}_0x3d5235=util[_0xa11b('0x59')](_0xa11b('0x5a'),_0x15d747);var _0x5c91a9={'method':_0xa11b('0x5b'),'uri':_0x3d5235,'qs':{'operation':'getchallenge','username':_0x360437[_0xa11b('0x52')]},'json':!![]};return rp(_0x5c91a9);}})[_0xa11b('0x22')](function(_0x5092c4){if(_0x5092c4[_0xa11b('0x5c')]){var _0x300dbc={'method':'POST','uri':_0x3d5235,'form':{'operation':_0xa11b('0x5d'),'username':_0x2a011c,'accessKey':md5(_0x5092c4['result'][_0xa11b('0x5e')]+_0x4c36c8)},'json':!![]};return rp(_0x300dbc);}})['then'](function(_0xf1642e){if(_0xf1642e['success']){var _0x254de6={'method':_0xa11b('0x5b'),'uri':_0x3d5235,'qs':{'operation':_0xa11b('0x5f'),'username':_0x2a011c,'sessionName':_0xf1642e[_0xa11b('0x60')]['sessionName'],'elementType':_0x261301},'json':!![]};return rp(_0x254de6);}})[_0xa11b('0x22')](function(_0x54bd91){if(_0x54bd91[_0xa11b('0x5c')]){var _0x48dae6=[_0xa11b('0x61'),_0xa11b('0x62'),_0xa11b('0x63')];_['remove'](_0x54bd91[_0xa11b('0x60')][_0xa11b('0x31')],function(_0x34a95f){return _0x48dae6['includes'](_0x34a95f['type'][_0xa11b('0x25')]);});_[_0xa11b('0x64')](_0x54bd91['result'][_0xa11b('0x31')],function(_0x2eef41){return _0x2eef41[_0xa11b('0x65')]==='false';});return{'count':_0x54bd91[_0xa11b('0x60')][_0xa11b('0x31')][_0xa11b('0x32')],'rows':_[_0xa11b('0x27')](_0x54bd91[_0xa11b('0x60')]['fields'],function(_0x4c03e4){return{'id':_0x4c03e4[_0xa11b('0x25')],'name':_0x4c03e4[_0xa11b('0x66')],'custom':_[_0xa11b('0x67')](_0x4c03e4[_0xa11b('0x25')],_0xa11b('0x68'))?!![]:![],'options':_0x4c03e4[_0xa11b('0x2a')][_0xa11b('0x25')]==='picklist'&&_0x4c03e4[_0xa11b('0x2a')][_0xa11b('0x69')]['length']>0x0?_[_0xa11b('0x27')](_0x4c03e4[_0xa11b('0x2a')][_0xa11b('0x69')],function(_0x3c6eb1){return{'name':_0x3c6eb1[_0xa11b('0x66')],'value':_0x3c6eb1[_0xa11b('0x6a')]};}):[]};})};}})[_0xa11b('0x22')](respondWithResult(_0xc5b150,null))[_0xa11b('0x40')](function(_0xb2e291){console[_0xa11b('0x6b')](_0xa11b('0x6c')+_0xb2e291);var _0x52b680=_0x419ac6[_0xa11b('0x2d')][_0xa11b('0x6d')]?0x1f4:_0xb2e291[_0xa11b('0x6e')]||0x1f4;logger[_0xa11b('0x6f')](_0xa11b('0x70'),_0xa11b('0x71'),_0x52b680,JSON[_0xa11b('0x72')](_0xb2e291));delete _0xb2e291['name'];if(_0x52b680===0x191){_0x52b680=0x190;}_0xc5b150['status'](_0x52b680)[_0xa11b('0x73')](_0x419ac6[_0xa11b('0x2d')][_0xa11b('0x6d')]?{'message':_0xa11b('0x74'),'statusCode':_0xb2e291['statusCode']}:_0xb2e291);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 43fe1ae..56ae3a2 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 _0xd9c7=['../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2cba13,_0x1776a8){var _0x5f0c5a=function(_0x1e04c5){while(--_0x1e04c5){_0x2cba13['push'](_0x2cba13['shift']());}};_0x5f0c5a(++_0x1776a8);}(_0xd9c7,0x137));var _0x7d9c=function(_0x342191,_0x1f0ea6){_0x342191=_0x342191-0x0;var _0x2e508a=_0xd9c7[_0x342191];return _0x2e508a;};'use strict';var _=require(_0x7d9c('0x0'));var util=require(_0x7d9c('0x1'));var logger=require(_0x7d9c('0x2'))(_0x7d9c('0x3'));var moment=require(_0x7d9c('0x4'));var BPromise=require(_0x7d9c('0x5'));var rp=require(_0x7d9c('0x6'));var fs=require('fs');var path=require(_0x7d9c('0x7'));var rimraf=require('rimraf');var config=require(_0x7d9c('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x7d9c('0x9')]=function(_0x1303b5,_0x59692e){return _0x1303b5[_0x7d9c('0xa')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3446=['rimraf','../../config/environment','./intVtigerAccount.attributes','exports','VtigerAccount','int_vtiger_accounts','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0x3446,0xbc));var _0x6344=function(_0x477982,_0x48117b){_0x477982=_0x477982-0x0;var _0x52e0e1=_0x3446[_0x477982];return _0x52e0e1;};'use strict';var _=require(_0x6344('0x0'));var util=require(_0x6344('0x1'));var logger=require('../../config/logger')(_0x6344('0x2'));var moment=require(_0x6344('0x3'));var BPromise=require(_0x6344('0x4'));var rp=require(_0x6344('0x5'));var fs=require('fs');var path=require(_0x6344('0x6'));var rimraf=require(_0x6344('0x7'));var config=require(_0x6344('0x8'));var attributes=require(_0x6344('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x6344('0xa')]=function(_0xa27f9d,_0x22d534){return _0xa27f9d['define'](_0x6344('0xb'),attributes,{'tableName':_0x6344('0xc'),'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 75ade21..ed9a80b 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 _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','include','map','model','then','ShowVtigerAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5a7dd3,_0x26b7cf){_0x5a7dd3=_0x5a7dd3-0x0;var _0x2f4d07=_0xcb91[_0x5a7dd3];return _0x2f4d07;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetVtigerAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['VtigerAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowVtigerAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});}; \ No newline at end of file +var _0x6324=['message','info','result','catch','GetVtigerAccount','options','raw','where','attributes','limit','include','map','model','VtigerAccount','find','ShowVtigerAccount','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s'];(function(_0x11c7a4,_0x3286a4){var _0x4361a=function(_0x36b019){while(--_0x36b019){_0x11c7a4['push'](_0x11c7a4['shift']());}};_0x4361a(++_0x3286a4);}(_0x6324,0x142));var _0x4632=function(_0x14476b,_0xd1a7a4){_0x14476b=_0x14476b-0x0;var _0x24e2e8=_0x6324[_0x14476b];return _0x24e2e8;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var moment=require(_0x4632('0x2'));var BPromise=require(_0x4632('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4632('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4632('0x5'));var logger=require('../../config/logger')(_0x4632('0x6'));var config=require('../../config/environment');var jayson=require(_0x4632('0x7'));var client=jayson[_0x4632('0x8')][_0x4632('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x126e9a,_0x4a15b2,_0x17e860){return new BPromise(function(_0x44dd6d,_0x390a46){return client['request'](_0x126e9a,_0x17e860)[_0x4632('0xa')](function(_0x47824c){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x4a15b2,_0x4632('0xb'));logger[_0x4632('0xc')](_0x4632('0xd'),_0x4a15b2,_0x4632('0xb'),JSON[_0x4632('0xe')](_0x47824c));if(_0x47824c[_0x4632('0xf')]){if(_0x47824c[_0x4632('0xf')][_0x4632('0x10')]===0x1f4){logger['error'](_0x4632('0x11'),_0x4a15b2,_0x47824c['error'][_0x4632('0x12')]);return _0x390a46(_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);}logger[_0x4632('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x4a15b2,_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);return _0x44dd6d(_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);}else{logger[_0x4632('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x4a15b2,'request\x20sent');_0x44dd6d(_0x47824c[_0x4632('0x14')][_0x4632('0x12')]);}})[_0x4632('0x15')](function(_0x125eb9){logger['error'](_0x4632('0x11'),_0x4a15b2,_0x125eb9);_0x390a46(_0x125eb9);});});}exports[_0x4632('0x16')]=function(_0x1a94c0){var _0x5b28b7=this;return new Promise(function(_0x3cddfa,_0x1894bb){return db['VtigerAccount']['findAll']({'raw':_0x1a94c0[_0x4632('0x17')]?_0x1a94c0[_0x4632('0x17')][_0x4632('0x18')]===undefined?!![]:![]:!![],'where':_0x1a94c0[_0x4632('0x17')]?_0x1a94c0[_0x4632('0x17')][_0x4632('0x19')]||null:null,'attributes':_0x1a94c0[_0x4632('0x17')]?_0x1a94c0[_0x4632('0x17')][_0x4632('0x1a')]||null:null,'limit':_0x1a94c0[_0x4632('0x17')]?_0x1a94c0[_0x4632('0x17')][_0x4632('0x1b')]||null:null,'include':_0x1a94c0[_0x4632('0x17')]?_0x1a94c0[_0x4632('0x17')][_0x4632('0x1c')]?_[_0x4632('0x1d')](_0x1a94c0[_0x4632('0x17')][_0x4632('0x1c')],function(_0x380a9f){return{'model':db[_0x380a9f[_0x4632('0x1e')]],'as':_0x380a9f['as'],'attributes':_0x380a9f[_0x4632('0x1a')],'include':_0x380a9f[_0x4632('0x1c')]?_[_0x4632('0x1d')](_0x380a9f[_0x4632('0x1c')],function(_0xb074d){return{'model':db[_0xb074d[_0x4632('0x1e')]],'as':_0xb074d['as'],'attributes':_0xb074d[_0x4632('0x1a')],'include':_0xb074d[_0x4632('0x1c')]?_[_0x4632('0x1d')](_0xb074d[_0x4632('0x1c')],function(_0x22d0f5){return{'model':db[_0x22d0f5[_0x4632('0x1e')]],'as':_0x22d0f5['as'],'attributes':_0x22d0f5[_0x4632('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57798a){logger[_0x4632('0x13')](_0x4632('0x16'),_0x1a94c0);logger[_0x4632('0xc')](_0x4632('0x16'),_0x1a94c0,JSON[_0x4632('0xe')](_0x57798a));_0x3cddfa(_0x57798a);})[_0x4632('0x15')](function(_0x3570b2){logger['error'](_0x4632('0x16'),_0x3570b2[_0x4632('0x12')],_0x1a94c0);_0x1894bb(_0x5b28b7['error'](0x1f4,_0x3570b2[_0x4632('0x12')]));});});};exports['ShowVtigerAccount']=function(_0x6599ad){var _0x4cb661=this;return new Promise(function(_0x4fda35,_0x1973eb){return db[_0x4632('0x1f')][_0x4632('0x20')]({'raw':_0x6599ad['options']?_0x6599ad['options'][_0x4632('0x18')]===undefined?!![]:![]:!![],'where':_0x6599ad[_0x4632('0x17')]?_0x6599ad['options']['where']||null:null,'attributes':_0x6599ad[_0x4632('0x17')]?_0x6599ad[_0x4632('0x17')]['attributes']||null:null,'include':_0x6599ad[_0x4632('0x17')]?_0x6599ad[_0x4632('0x17')][_0x4632('0x1c')]?_[_0x4632('0x1d')](_0x6599ad[_0x4632('0x17')]['include'],function(_0x5f0382){return{'model':db[_0x5f0382[_0x4632('0x1e')]],'as':_0x5f0382['as'],'attributes':_0x5f0382['attributes'],'include':_0x5f0382['include']?_[_0x4632('0x1d')](_0x5f0382['include'],function(_0x49355c){return{'model':db[_0x49355c[_0x4632('0x1e')]],'as':_0x49355c['as'],'attributes':_0x49355c['attributes'],'include':_0x49355c[_0x4632('0x1c')]?_[_0x4632('0x1d')](_0x49355c[_0x4632('0x1c')],function(_0x52dd7f){return{'model':db[_0x52dd7f[_0x4632('0x1e')]],'as':_0x52dd7f['as'],'attributes':_0x52dd7f[_0x4632('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4632('0xa')](function(_0xca07f5){logger[_0x4632('0x13')]('ShowVtigerAccount',_0x6599ad);logger['debug'](_0x4632('0x21'),_0x6599ad,JSON[_0x4632('0xe')](_0xca07f5));_0x4fda35(_0xca07f5);})[_0x4632('0x15')](function(_0x4f40af){logger['error']('ShowVtigerAccount',_0x4f40af[_0x4632('0x12')],_0x6599ad);_0x1973eb(_0x4cb661[_0x4632('0xf')](0x1f4,_0x4f40af['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 9cbb167..1004a70 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 _0x787f=['../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','/:id','update','delete','destroy','util','path','express','Router','fs-extra'];(function(_0x13350b,_0x1067cd){var _0x476086=function(_0x1ca58d){while(--_0x1ca58d){_0x13350b['push'](_0x13350b['shift']());}};_0x476086(++_0x1067cd);}(_0x787f,0x7f));var _0xf787=function(_0x5d50d7,_0x339501){_0x5d50d7=_0x5d50d7-0x0;var _0x4acb68=_0x787f[_0x5d50d7];return _0x4acb68;};'use strict';var multer=require('multer');var util=require(_0xf787('0x0'));var path=require(_0xf787('0x1'));var timeout=require('connect-timeout');var express=require(_0xf787('0x2'));var router=express[_0xf787('0x3')]();var fs_extra=require(_0xf787('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf787('0x5'));var controller=require('./intVtigerConfiguration.controller');router[_0xf787('0x6')]('/',auth[_0xf787('0x7')](),controller[_0xf787('0x8')]);router[_0xf787('0x6')]('/:id',auth[_0xf787('0x7')](),controller[_0xf787('0x9')]);router['get'](_0xf787('0xa'),auth[_0xf787('0x7')](),controller[_0xf787('0xb')]);router[_0xf787('0x6')](_0xf787('0xc'),auth[_0xf787('0x7')](),controller[_0xf787('0xd')]);router[_0xf787('0x6')](_0xf787('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xf787('0xf')]('/',auth[_0xf787('0x7')](),controller[_0xf787('0x10')]);router[_0xf787('0x11')](_0xf787('0x12'),auth['isAuthenticated'](),controller[_0xf787('0x13')]);router[_0xf787('0x14')](_0xf787('0x12'),auth[_0xf787('0x7')](),controller[_0xf787('0x15')]);module['exports']=router; \ No newline at end of file +var _0xe9c8=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id'];(function(_0x574f5b,_0x15c508){var _0x1eae76=function(_0x14c618){while(--_0x14c618){_0x574f5b['push'](_0x574f5b['shift']());}};_0x1eae76(++_0x15c508);}(_0xe9c8,0xf7));var _0x8e9c=function(_0x4344a2,_0x4798ee){_0x4344a2=_0x4344a2-0x0;var _0x3dc2cb=_0xe9c8[_0x4344a2];return _0x3dc2cb;};'use strict';var multer=require(_0x8e9c('0x0'));var util=require(_0x8e9c('0x1'));var path=require(_0x8e9c('0x2'));var timeout=require(_0x8e9c('0x3'));var express=require(_0x8e9c('0x4'));var router=express[_0x8e9c('0x5')]();var fs_extra=require(_0x8e9c('0x6'));var auth=require(_0x8e9c('0x7'));var interaction=require(_0x8e9c('0x8'));var config=require(_0x8e9c('0x9'));var controller=require(_0x8e9c('0xa'));router[_0x8e9c('0xb')]('/',auth[_0x8e9c('0xc')](),controller[_0x8e9c('0xd')]);router['get']('/:id',auth[_0x8e9c('0xc')](),controller[_0x8e9c('0xe')]);router[_0x8e9c('0xb')](_0x8e9c('0xf'),auth[_0x8e9c('0xc')](),controller['getFields']);router[_0x8e9c('0xb')](_0x8e9c('0x10'),auth[_0x8e9c('0xc')](),controller['getSubjects']);router['get'](_0x8e9c('0x11'),auth['isAuthenticated'](),controller[_0x8e9c('0x12')]);router[_0x8e9c('0x13')]('/',auth[_0x8e9c('0xc')](),controller[_0x8e9c('0x14')]);router[_0x8e9c('0x15')](_0x8e9c('0x16'),auth['isAuthenticated'](),controller[_0x8e9c('0x17')]);router[_0x8e9c('0x18')](_0x8e9c('0x16'),auth[_0x8e9c('0xc')](),controller[_0x8e9c('0x19')]);module[_0x8e9c('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 7d58db8..afa941f 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 _0x391c=['STRING','exports'];(function(_0x36227b,_0x20f480){var _0x480f02=function(_0x3aeb12){while(--_0x3aeb12){_0x36227b['push'](_0x36227b['shift']());}};_0x480f02(++_0x20f480);}(_0x391c,0xbd));var _0xc391=function(_0x4c5958,_0x2d72c2){_0x4c5958=_0x4c5958-0x0;var _0x1096a6=_0x391c[_0x4c5958];return _0x1096a6;};'use strict';var Sequelize=require('sequelize');module[_0xc391('0x0')]={'name':{'type':Sequelize[_0xc391('0x1')]},'description':{'type':Sequelize[_0xc391('0x1')]}}; \ No newline at end of file +var _0x776a=['sequelize','exports','STRING'];(function(_0x190681,_0x590f58){var _0x4f2ada=function(_0x4556db){while(--_0x4556db){_0x190681['push'](_0x190681['shift']());}};_0x4f2ada(++_0x590f58);}(_0x776a,0x165));var _0xa776=function(_0xfe55b9,_0x1f07ec){_0xfe55b9=_0xfe55b9-0x0;var _0x46737e=_0x776a[_0xfe55b9];return _0x46737e;};'use strict';var Sequelize=require(_0xa776('0x0'));module[_0xa776('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa776('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 90e261a..85bef94 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 _0x42d7=['nolimit','getSubjects','map','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','VtigerConfiguration','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getFields','findOne','VtigerField','pick'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x42d7,0xa8));var _0x742d=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x42d7[_0x725a4c];return _0x37b2cc;};'use strict';var emlformat=require(_0x742d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x742d('0x1'));var jsonpatch=require(_0x742d('0x2'));var rp=require(_0x742d('0x3'));var moment=require(_0x742d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x742d('0x5'));var util=require(_0x742d('0x6'));var path=require(_0x742d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x742d('0x8'));var fs=require('fs');var fs_extra=require(_0x742d('0x9'));var _=require(_0x742d('0xa'));var squel=require(_0x742d('0xb'));var crypto=require(_0x742d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x742d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x742d('0xe'));var Papa=require(_0x742d('0xf'));var Redis=require(_0x742d('0x10'));var authService=require(_0x742d('0x11'));var qs=require(_0x742d('0x12'));var as=require(_0x742d('0x13'));var hardwareService=require(_0x742d('0x14'));var logger=require('../../config/logger')(_0x742d('0x15'));var utils=require(_0x742d('0x16'));var config=require(_0x742d('0x17'));var licenseUtil=require(_0x742d('0x18'));var db=require(_0x742d('0x19'))['db'];function respondWithStatusCode(_0x3f9203,_0x3c1127){_0x3c1127=_0x3c1127||0xcc;return function(_0x5e5283){if(_0x5e5283){return _0x3f9203[_0x742d('0x1a')](_0x3c1127);}return _0x3f9203[_0x742d('0x1b')](_0x3c1127)[_0x742d('0x1c')]();};}function respondWithResult(_0x892591,_0x57ef63){_0x57ef63=_0x57ef63||0xc8;return function(_0x5c9c64){if(_0x5c9c64){return _0x892591[_0x742d('0x1b')](_0x57ef63)[_0x742d('0x1d')](_0x5c9c64);}};}function respondWithFilteredResult(_0x1ee55d,_0x5e399b){return function(_0x4b5ce4){if(_0x4b5ce4){var _0x1a7a50=typeof _0x5e399b['offset']===_0x742d('0x1e')&&typeof _0x5e399b[_0x742d('0x1f')]==='undefined';var _0x48c469=_0x4b5ce4[_0x742d('0x20')];var _0x3c93cd=_0x1a7a50?0x0:_0x5e399b['offset'];var _0x1ceb23=_0x1a7a50?_0x4b5ce4[_0x742d('0x20')]:_0x5e399b[_0x742d('0x21')]+_0x5e399b[_0x742d('0x1f')];var _0x183a1b;if(_0x1ceb23>=_0x48c469){_0x1ceb23=_0x48c469;_0x183a1b=0xc8;}else{_0x183a1b=0xce;}_0x1ee55d['status'](_0x183a1b);return _0x1ee55d['set'](_0x742d('0x22'),_0x3c93cd+'-'+_0x1ceb23+'/'+_0x48c469)[_0x742d('0x1d')](_0x4b5ce4);}return null;};}function patchUpdates(_0x7b17e2){return function(_0x5d3598){try{jsonpatch[_0x742d('0x23')](_0x5d3598,_0x7b17e2,!![]);}catch(_0x55746d){return BPromise['reject'](_0x55746d);}return _0x5d3598[_0x742d('0x24')]();};}function saveUpdates(_0x5c5ebd,_0xce2bb8){return function(_0x192489){if(_0x192489){return _0x192489[_0x742d('0x25')](_0x5c5ebd)[_0x742d('0x26')](function(_0x36dab1){return _0x36dab1;});}return null;};}function removeEntity(_0x57c672,_0x5ea336){return function(_0x263eec){if(_0x263eec){return _0x263eec[_0x742d('0x27')]()['then'](function(){_0x57c672[_0x742d('0x1b')](0xcc)[_0x742d('0x1c')]();});}};}function handleEntityNotFound(_0x59452a,_0x1e1d77){return function(_0x9919f8){if(!_0x9919f8){_0x59452a['sendStatus'](0x194);}return _0x9919f8;};}function handleError(_0x5bd2c4,_0xac0e2e){_0xac0e2e=_0xac0e2e||0x1f4;return function(_0x2f0b60){logger[_0x742d('0x28')](_0x2f0b60[_0x742d('0x29')]);if(_0x2f0b60[_0x742d('0x2a')]){delete _0x2f0b60[_0x742d('0x2a')];}_0x5bd2c4[_0x742d('0x1b')](_0xac0e2e)[_0x742d('0x2b')](_0x2f0b60);};}exports[_0x742d('0x2c')]=function(_0x560771,_0x18bb99){var _0x3c1a6b={},_0x28ec0b={},_0x55a3c7={'count':0x0,'rows':[]};var _0x128294=_['map'](db[_0x742d('0x2d')][_0x742d('0x2e')],function(_0x30c986){return{'name':_0x30c986['fieldName'],'type':_0x30c986['type']['key']};});_0x28ec0b[_0x742d('0x2f')]=_['map'](_0x128294,_0x742d('0x2a'));_0x28ec0b[_0x742d('0x30')]=_[_0x742d('0x31')](_0x560771[_0x742d('0x30')]);_0x28ec0b[_0x742d('0x32')]=_[_0x742d('0x33')](_0x28ec0b[_0x742d('0x2f')],_0x28ec0b['query']);_0x3c1a6b[_0x742d('0x34')]=_[_0x742d('0x33')](_0x28ec0b[_0x742d('0x2f')],qs[_0x742d('0x35')](_0x560771[_0x742d('0x30')][_0x742d('0x35')]));_0x3c1a6b['attributes']=_0x3c1a6b[_0x742d('0x34')][_0x742d('0x36')]?_0x3c1a6b[_0x742d('0x34')]:_0x28ec0b[_0x742d('0x2f')];if(!_0x560771[_0x742d('0x30')][_0x742d('0x37')]('nolimit')){_0x3c1a6b[_0x742d('0x1f')]=qs[_0x742d('0x1f')](_0x560771[_0x742d('0x30')]['limit']);_0x3c1a6b[_0x742d('0x21')]=qs['offset'](_0x560771[_0x742d('0x30')][_0x742d('0x21')]);}_0x3c1a6b[_0x742d('0x38')]=qs[_0x742d('0x39')](_0x560771[_0x742d('0x30')][_0x742d('0x39')]);_0x3c1a6b[_0x742d('0x3a')]=qs[_0x742d('0x32')](_['pick'](_0x560771[_0x742d('0x30')],_0x28ec0b[_0x742d('0x32')]),_0x128294);if(_0x560771[_0x742d('0x30')][_0x742d('0x3b')]){_0x3c1a6b[_0x742d('0x3a')]=_[_0x742d('0x3c')](_0x3c1a6b[_0x742d('0x3a')],{'$or':_['map'](_0x128294,function(_0x2f0b59){if(_0x2f0b59[_0x742d('0x3d')]!==_0x742d('0x3e')){var _0x3bb191={};_0x3bb191[_0x2f0b59[_0x742d('0x2a')]]={'$like':'%'+_0x560771['query'][_0x742d('0x3b')]+'%'};return _0x3bb191;}})});}_0x3c1a6b=_['merge']({},_0x3c1a6b,_0x560771['options']);var _0xe79c52={'where':_0x3c1a6b[_0x742d('0x3a')]};return db[_0x742d('0x2d')][_0x742d('0x20')](_0xe79c52)[_0x742d('0x26')](function(_0x430b2f){_0x55a3c7[_0x742d('0x20')]=_0x430b2f;if(_0x560771[_0x742d('0x30')][_0x742d('0x3f')]){_0x3c1a6b[_0x742d('0x40')]=[{'all':!![]}];}return db[_0x742d('0x2d')][_0x742d('0x41')](_0x3c1a6b);})['then'](function(_0x1f309b){_0x55a3c7[_0x742d('0x42')]=_0x1f309b;return _0x55a3c7;})['then'](respondWithFilteredResult(_0x18bb99,_0x3c1a6b))[_0x742d('0x43')](handleError(_0x18bb99,null));};exports[_0x742d('0x44')]=function(_0x3a8d1b,_0x52c768){var _0x265962={'raw':![],'where':{'id':_0x3a8d1b[_0x742d('0x45')]['id']}},_0x5cbae4={};_0x5cbae4['model']=_[_0x742d('0x31')](db['VtigerConfiguration'][_0x742d('0x2e')]);_0x5cbae4[_0x742d('0x30')]=_[_0x742d('0x31')](_0x3a8d1b[_0x742d('0x30')]);_0x5cbae4[_0x742d('0x32')]=_['intersection'](_0x5cbae4['model'],_0x5cbae4[_0x742d('0x30')]);_0x265962[_0x742d('0x34')]=_[_0x742d('0x33')](_0x5cbae4['model'],qs[_0x742d('0x35')](_0x3a8d1b['query'][_0x742d('0x35')]));_0x265962[_0x742d('0x34')]=_0x265962['attributes']['length']?_0x265962[_0x742d('0x34')]:_0x5cbae4[_0x742d('0x2f')];if(_0x3a8d1b['query'][_0x742d('0x3f')]){_0x265962[_0x742d('0x40')]=[{'all':!![]}];}_0x265962=_['merge']({},_0x265962,_0x3a8d1b[_0x742d('0x46')]);return db[_0x742d('0x2d')][_0x742d('0x47')](_0x265962)[_0x742d('0x26')](handleEntityNotFound(_0x52c768,null))[_0x742d('0x26')](respondWithResult(_0x52c768,null))[_0x742d('0x43')](handleError(_0x52c768,null));};exports[_0x742d('0x48')]=function(_0xb2855a,_0x207551){return db['VtigerConfiguration'][_0x742d('0x48')](_0xb2855a[_0x742d('0x49')],{})[_0x742d('0x26')](respondWithResult(_0x207551,0xc9))[_0x742d('0x43')](handleError(_0x207551,null));};exports[_0x742d('0x25')]=function(_0x91a085,_0x6ae093){if(_0x91a085[_0x742d('0x49')]['id']){delete _0x91a085[_0x742d('0x49')]['id'];}return db[_0x742d('0x2d')][_0x742d('0x47')]({'where':{'id':_0x91a085[_0x742d('0x45')]['id']}})[_0x742d('0x26')](handleEntityNotFound(_0x6ae093,null))[_0x742d('0x26')](saveUpdates(_0x91a085[_0x742d('0x49')],null))[_0x742d('0x26')](respondWithResult(_0x6ae093,null))[_0x742d('0x43')](handleError(_0x6ae093,null));};exports[_0x742d('0x27')]=function(_0x5c9082,_0x2ff2b7){return db[_0x742d('0x2d')]['find']({'where':{'id':_0x5c9082[_0x742d('0x45')]['id']}})[_0x742d('0x26')](handleEntityNotFound(_0x2ff2b7,null))[_0x742d('0x26')](removeEntity(_0x2ff2b7,null))['catch'](handleError(_0x2ff2b7,null));};exports[_0x742d('0x4a')]=function(_0x44a623,_0x42af8d,_0x6db7a9){var _0x5ceea6={};var _0x50c8db={};var _0x5b61d2;var _0x5c1416;return db[_0x742d('0x2d')][_0x742d('0x4b')]({'where':{'id':_0x44a623[_0x742d('0x45')]['id']}})[_0x742d('0x26')](handleEntityNotFound(_0x42af8d,null))[_0x742d('0x26')](function(_0xbe348e){if(_0xbe348e){_0x5b61d2=_0xbe348e;_0x50c8db[_0x742d('0x2f')]=_['keys'](db[_0x742d('0x4c')][_0x742d('0x2e')]);_0x50c8db[_0x742d('0x30')]=_[_0x742d('0x31')](_0x44a623[_0x742d('0x30')]);_0x50c8db[_0x742d('0x32')]=_['intersection'](_0x50c8db[_0x742d('0x2f')],_0x50c8db[_0x742d('0x30')]);_0x5ceea6[_0x742d('0x34')]=_[_0x742d('0x33')](_0x50c8db[_0x742d('0x2f')],qs['fields'](_0x44a623[_0x742d('0x30')][_0x742d('0x35')]));_0x5ceea6[_0x742d('0x34')]=_0x5ceea6[_0x742d('0x34')]['length']?_0x5ceea6['attributes']:_0x50c8db['model'];_0x5ceea6[_0x742d('0x38')]=qs['sort'](_0x44a623['query']['sort']);_0x5ceea6[_0x742d('0x3a')]=qs['filters'](_[_0x742d('0x4d')](_0x44a623[_0x742d('0x30')],_0x50c8db[_0x742d('0x32')]));if(_0x44a623[_0x742d('0x30')][_0x742d('0x3b')]){_0x5ceea6[_0x742d('0x3a')]=_[_0x742d('0x3c')](_0x5ceea6[_0x742d('0x3a')],{'$or':_['map'](_0x5ceea6[_0x742d('0x34')],function(_0x203d47){var _0x122586={};_0x122586[_0x203d47]={'$like':'%'+_0x44a623[_0x742d('0x30')]['filter']+'%'};return _0x122586;})});}_0x5ceea6=_[_0x742d('0x3c')]({},_0x5ceea6,_0x44a623[_0x742d('0x46')]);return _0x5b61d2[_0x742d('0x4a')](_0x5ceea6);}})['then'](function(_0x69a374){if(_0x69a374){_0x5c1416=_0x69a374['length'];if(!_0x44a623['query'][_0x742d('0x37')](_0x742d('0x4e'))){_0x5ceea6[_0x742d('0x1f')]=qs['limit'](_0x44a623[_0x742d('0x30')][_0x742d('0x1f')]);_0x5ceea6[_0x742d('0x21')]=qs[_0x742d('0x21')](_0x44a623[_0x742d('0x30')][_0x742d('0x21')]);}return _0x5b61d2[_0x742d('0x4a')](_0x5ceea6);}})['then'](function(_0x423762){if(_0x423762){return _0x423762?{'count':_0x5c1416,'rows':_0x423762}:null;}})[_0x742d('0x26')](respondWithResult(_0x42af8d,null))[_0x742d('0x43')](handleError(_0x42af8d,null));};exports[_0x742d('0x4f')]=function(_0x592879,_0x261e5a,_0x21d939){var _0x3c7961={};var _0x3ff38e={};var _0x5963dd;var _0x2c25bd;return db[_0x742d('0x2d')]['findOne']({'where':{'id':_0x592879[_0x742d('0x45')]['id']}})[_0x742d('0x26')](handleEntityNotFound(_0x261e5a,null))[_0x742d('0x26')](function(_0x1052f0){if(_0x1052f0){_0x5963dd=_0x1052f0;_0x3ff38e[_0x742d('0x2f')]=_[_0x742d('0x31')](db[_0x742d('0x4c')]['rawAttributes']);_0x3ff38e[_0x742d('0x30')]=_[_0x742d('0x31')](_0x592879[_0x742d('0x30')]);_0x3ff38e[_0x742d('0x32')]=_[_0x742d('0x33')](_0x3ff38e[_0x742d('0x2f')],_0x3ff38e['query']);_0x3c7961[_0x742d('0x34')]=_[_0x742d('0x33')](_0x3ff38e[_0x742d('0x2f')],qs['fields'](_0x592879[_0x742d('0x30')][_0x742d('0x35')]));_0x3c7961[_0x742d('0x34')]=_0x3c7961[_0x742d('0x34')][_0x742d('0x36')]?_0x3c7961[_0x742d('0x34')]:_0x3ff38e['model'];_0x3c7961['order']=qs[_0x742d('0x39')](_0x592879[_0x742d('0x30')][_0x742d('0x39')]);_0x3c7961[_0x742d('0x3a')]=qs[_0x742d('0x32')](_[_0x742d('0x4d')](_0x592879[_0x742d('0x30')],_0x3ff38e[_0x742d('0x32')]));if(_0x592879[_0x742d('0x30')][_0x742d('0x3b')]){_0x3c7961[_0x742d('0x3a')]=_[_0x742d('0x3c')](_0x3c7961[_0x742d('0x3a')],{'$or':_[_0x742d('0x50')](_0x3c7961[_0x742d('0x34')],function(_0x311167){var _0x56f430={};_0x56f430[_0x311167]={'$like':'%'+_0x592879[_0x742d('0x30')][_0x742d('0x3b')]+'%'};return _0x56f430;})});}_0x3c7961=_[_0x742d('0x3c')]({},_0x3c7961,_0x592879[_0x742d('0x46')]);return _0x5963dd[_0x742d('0x4f')](_0x3c7961);}})['then'](function(_0x565ec8){if(_0x565ec8){_0x2c25bd=_0x565ec8['length'];if(!_0x592879['query']['hasOwnProperty'](_0x742d('0x4e'))){_0x3c7961[_0x742d('0x1f')]=qs['limit'](_0x592879[_0x742d('0x30')][_0x742d('0x1f')]);_0x3c7961[_0x742d('0x21')]=qs[_0x742d('0x21')](_0x592879[_0x742d('0x30')][_0x742d('0x21')]);}return _0x5963dd[_0x742d('0x4f')](_0x3c7961);}})[_0x742d('0x26')](function(_0x2d5a99){if(_0x2d5a99){return _0x2d5a99?{'count':_0x2c25bd,'rows':_0x2d5a99}:null;}})[_0x742d('0x26')](respondWithResult(_0x261e5a,null))[_0x742d('0x43')](handleError(_0x261e5a,null));};exports[_0x742d('0x51')]=function(_0xf6357e,_0x3208f4,_0x154a8e){var _0x4f1093={};var _0x5dfc4f={};var _0x4f91f8;var _0x455ebb;return db['VtigerConfiguration'][_0x742d('0x4b')]({'where':{'id':_0xf6357e[_0x742d('0x45')]['id']}})['then'](handleEntityNotFound(_0x3208f4,null))['then'](function(_0x448b94){if(_0x448b94){_0x4f91f8=_0x448b94;_0x5dfc4f['model']=_[_0x742d('0x31')](db['VtigerField']['rawAttributes']);_0x5dfc4f[_0x742d('0x30')]=_[_0x742d('0x31')](_0xf6357e[_0x742d('0x30')]);_0x5dfc4f[_0x742d('0x32')]=_[_0x742d('0x33')](_0x5dfc4f[_0x742d('0x2f')],_0x5dfc4f[_0x742d('0x30')]);_0x4f1093[_0x742d('0x34')]=_[_0x742d('0x33')](_0x5dfc4f['model'],qs[_0x742d('0x35')](_0xf6357e[_0x742d('0x30')][_0x742d('0x35')]));_0x4f1093[_0x742d('0x34')]=_0x4f1093[_0x742d('0x34')][_0x742d('0x36')]?_0x4f1093[_0x742d('0x34')]:_0x5dfc4f['model'];_0x4f1093[_0x742d('0x38')]=qs['sort'](_0xf6357e[_0x742d('0x30')][_0x742d('0x39')]);_0x4f1093[_0x742d('0x3a')]=qs[_0x742d('0x32')](_[_0x742d('0x4d')](_0xf6357e[_0x742d('0x30')],_0x5dfc4f[_0x742d('0x32')]));if(_0xf6357e['query']['filter']){_0x4f1093[_0x742d('0x3a')]=_['merge'](_0x4f1093[_0x742d('0x3a')],{'$or':_['map'](_0x4f1093[_0x742d('0x34')],function(_0x51f88b){var _0x42fbea={};_0x42fbea[_0x51f88b]={'$like':'%'+_0xf6357e['query'][_0x742d('0x3b')]+'%'};return _0x42fbea;})});}_0x4f1093=_[_0x742d('0x3c')]({},_0x4f1093,_0xf6357e['options']);return _0x4f91f8[_0x742d('0x51')](_0x4f1093);}})['then'](function(_0x41f1d3){if(_0x41f1d3){_0x455ebb=_0x41f1d3[_0x742d('0x36')];if(!_0xf6357e['query'][_0x742d('0x37')]('nolimit')){_0x4f1093[_0x742d('0x1f')]=qs['limit'](_0xf6357e[_0x742d('0x30')][_0x742d('0x1f')]);_0x4f1093[_0x742d('0x21')]=qs[_0x742d('0x21')](_0xf6357e['query'][_0x742d('0x21')]);}return _0x4f91f8[_0x742d('0x51')](_0x4f1093);}})[_0x742d('0x26')](function(_0x2602b0){if(_0x2602b0){return _0x2602b0?{'count':_0x455ebb,'rows':_0x2602b0}:null;}})['then'](respondWithResult(_0x3208f4,null))[_0x742d('0x43')](handleError(_0x3208f4,null));}; \ No newline at end of file +var _0x0036=['keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','VtigerConfiguration','includeAll','include','findAll','catch','show','params','length','find','body','rawAttributes','pick','getFields','VtigerField','getSubjects','hasOwnProperty','findOne','getDescriptions','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/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','query'];(function(_0xc7b1df,_0x2fc30c){var _0x54c89c=function(_0x2370e8){while(--_0x2370e8){_0xc7b1df['push'](_0xc7b1df['shift']());}};_0x54c89c(++_0x2fc30c);}(_0x0036,0x73));var _0x6003=function(_0x50e00f,_0x2c4665){_0x50e00f=_0x50e00f-0x0;var _0x5b91d9=_0x0036[_0x50e00f];return _0x5b91d9;};'use strict';var emlformat=require(_0x6003('0x0'));var rimraf=require(_0x6003('0x1'));var zipdir=require(_0x6003('0x2'));var jsonpatch=require(_0x6003('0x3'));var rp=require(_0x6003('0x4'));var moment=require(_0x6003('0x5'));var BPromise=require(_0x6003('0x6'));var Mustache=require(_0x6003('0x7'));var util=require(_0x6003('0x8'));var path=require(_0x6003('0x9'));var sox=require(_0x6003('0xa'));var csv=require(_0x6003('0xb'));var ejs=require(_0x6003('0xc'));var fs=require('fs');var fs_extra=require(_0x6003('0xd'));var _=require(_0x6003('0xe'));var squel=require('squel');var crypto=require(_0x6003('0xf'));var jsforce=require(_0x6003('0x10'));var deskjs=require(_0x6003('0x11'));var toCsv=require(_0x6003('0xb'));var querystring=require(_0x6003('0x12'));var Papa=require(_0x6003('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6003('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6003('0x15'))(_0x6003('0x16'));var utils=require(_0x6003('0x17'));var config=require(_0x6003('0x18'));var licenseUtil=require(_0x6003('0x19'));var db=require(_0x6003('0x1a'))['db'];function respondWithStatusCode(_0x54f074,_0xb266ab){_0xb266ab=_0xb266ab||0xcc;return function(_0x5475fb){if(_0x5475fb){return _0x54f074[_0x6003('0x1b')](_0xb266ab);}return _0x54f074['status'](_0xb266ab)[_0x6003('0x1c')]();};}function respondWithResult(_0x155c3f,_0xd4900f){_0xd4900f=_0xd4900f||0xc8;return function(_0x43fa79){if(_0x43fa79){return _0x155c3f[_0x6003('0x1d')](_0xd4900f)[_0x6003('0x1e')](_0x43fa79);}};}function respondWithFilteredResult(_0x253176,_0x511955){return function(_0x1cbf3d){if(_0x1cbf3d){var _0x2198e3=typeof _0x511955['offset']===_0x6003('0x1f')&&typeof _0x511955[_0x6003('0x20')]===_0x6003('0x1f');var _0x583e12=_0x1cbf3d[_0x6003('0x21')];var _0x594e74=_0x2198e3?0x0:_0x511955[_0x6003('0x22')];var _0x396cf0=_0x2198e3?_0x1cbf3d[_0x6003('0x21')]:_0x511955[_0x6003('0x22')]+_0x511955[_0x6003('0x20')];var _0x948de5;if(_0x396cf0>=_0x583e12){_0x396cf0=_0x583e12;_0x948de5=0xc8;}else{_0x948de5=0xce;}_0x253176[_0x6003('0x1d')](_0x948de5);return _0x253176[_0x6003('0x23')]('Content-Range',_0x594e74+'-'+_0x396cf0+'/'+_0x583e12)['json'](_0x1cbf3d);}return null;};}function patchUpdates(_0x25ead1){return function(_0x451b9f){try{jsonpatch[_0x6003('0x24')](_0x451b9f,_0x25ead1,!![]);}catch(_0x29918c){return BPromise['reject'](_0x29918c);}return _0x451b9f[_0x6003('0x25')]();};}function saveUpdates(_0x59dc01,_0x1223a8){return function(_0x1f1192){if(_0x1f1192){return _0x1f1192[_0x6003('0x26')](_0x59dc01)[_0x6003('0x27')](function(_0xa539c5){return _0xa539c5;});}return null;};}function removeEntity(_0x4388c0,_0x363749){return function(_0x1e7b51){if(_0x1e7b51){return _0x1e7b51[_0x6003('0x28')]()[_0x6003('0x27')](function(){_0x4388c0[_0x6003('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a064a,_0x1d7bdd){return function(_0x43beea){if(!_0x43beea){_0x1a064a[_0x6003('0x1b')](0x194);}return _0x43beea;};}function handleError(_0x2d12ae,_0x3c4476){_0x3c4476=_0x3c4476||0x1f4;return function(_0x290b37){logger[_0x6003('0x29')](_0x290b37[_0x6003('0x2a')]);if(_0x290b37[_0x6003('0x2b')]){delete _0x290b37[_0x6003('0x2b')];}_0x2d12ae[_0x6003('0x1d')](_0x3c4476)[_0x6003('0x2c')](_0x290b37);};}exports[_0x6003('0x2d')]=function(_0x2d511a,_0x2621af){var _0x4354c4={},_0x36a101={},_0x4b7cb5={'count':0x0,'rows':[]};var _0x18af3e=_['map'](db['VtigerConfiguration']['rawAttributes'],function(_0x68e8be){return{'name':_0x68e8be[_0x6003('0x2e')],'type':_0x68e8be[_0x6003('0x2f')][_0x6003('0x30')]};});_0x36a101[_0x6003('0x31')]=_['map'](_0x18af3e,'name');_0x36a101[_0x6003('0x32')]=_[_0x6003('0x33')](_0x2d511a[_0x6003('0x32')]);_0x36a101[_0x6003('0x34')]=_[_0x6003('0x35')](_0x36a101['model'],_0x36a101['query']);_0x4354c4[_0x6003('0x36')]=_[_0x6003('0x35')](_0x36a101[_0x6003('0x31')],qs[_0x6003('0x37')](_0x2d511a[_0x6003('0x32')][_0x6003('0x37')]));_0x4354c4['attributes']=_0x4354c4[_0x6003('0x36')]['length']?_0x4354c4[_0x6003('0x36')]:_0x36a101[_0x6003('0x31')];if(!_0x2d511a['query']['hasOwnProperty'](_0x6003('0x38'))){_0x4354c4[_0x6003('0x20')]=qs['limit'](_0x2d511a['query'][_0x6003('0x20')]);_0x4354c4[_0x6003('0x22')]=qs[_0x6003('0x22')](_0x2d511a[_0x6003('0x32')][_0x6003('0x22')]);}_0x4354c4[_0x6003('0x39')]=qs[_0x6003('0x3a')](_0x2d511a[_0x6003('0x32')]['sort']);_0x4354c4[_0x6003('0x3b')]=qs[_0x6003('0x34')](_['pick'](_0x2d511a[_0x6003('0x32')],_0x36a101[_0x6003('0x34')]),_0x18af3e);if(_0x2d511a['query'][_0x6003('0x3c')]){_0x4354c4['where']=_[_0x6003('0x3d')](_0x4354c4[_0x6003('0x3b')],{'$or':_[_0x6003('0x3e')](_0x18af3e,function(_0xec4ff3){if(_0xec4ff3[_0x6003('0x2f')]!==_0x6003('0x3f')){var _0x31b431={};_0x31b431[_0xec4ff3[_0x6003('0x2b')]]={'$like':'%'+_0x2d511a[_0x6003('0x32')][_0x6003('0x3c')]+'%'};return _0x31b431;}})});}_0x4354c4=_['merge']({},_0x4354c4,_0x2d511a[_0x6003('0x40')]);var _0x12cf51={'where':_0x4354c4['where']};return db[_0x6003('0x41')]['count'](_0x12cf51)[_0x6003('0x27')](function(_0x4ce8f2){_0x4b7cb5['count']=_0x4ce8f2;if(_0x2d511a[_0x6003('0x32')][_0x6003('0x42')]){_0x4354c4[_0x6003('0x43')]=[{'all':!![]}];}return db[_0x6003('0x41')][_0x6003('0x44')](_0x4354c4);})['then'](function(_0x401df6){_0x4b7cb5['rows']=_0x401df6;return _0x4b7cb5;})[_0x6003('0x27')](respondWithFilteredResult(_0x2621af,_0x4354c4))[_0x6003('0x45')](handleError(_0x2621af,null));};exports[_0x6003('0x46')]=function(_0x3f3031,_0x314d0e){var _0x2b7d35={'raw':![],'where':{'id':_0x3f3031[_0x6003('0x47')]['id']}},_0x557384={};_0x557384[_0x6003('0x31')]=_[_0x6003('0x33')](db[_0x6003('0x41')]['rawAttributes']);_0x557384[_0x6003('0x32')]=_[_0x6003('0x33')](_0x3f3031[_0x6003('0x32')]);_0x557384['filters']=_[_0x6003('0x35')](_0x557384[_0x6003('0x31')],_0x557384['query']);_0x2b7d35[_0x6003('0x36')]=_[_0x6003('0x35')](_0x557384[_0x6003('0x31')],qs[_0x6003('0x37')](_0x3f3031[_0x6003('0x32')][_0x6003('0x37')]));_0x2b7d35[_0x6003('0x36')]=_0x2b7d35[_0x6003('0x36')][_0x6003('0x48')]?_0x2b7d35[_0x6003('0x36')]:_0x557384['model'];if(_0x3f3031[_0x6003('0x32')][_0x6003('0x42')]){_0x2b7d35[_0x6003('0x43')]=[{'all':!![]}];}_0x2b7d35=_[_0x6003('0x3d')]({},_0x2b7d35,_0x3f3031['options']);return db[_0x6003('0x41')][_0x6003('0x49')](_0x2b7d35)['then'](handleEntityNotFound(_0x314d0e,null))[_0x6003('0x27')](respondWithResult(_0x314d0e,null))['catch'](handleError(_0x314d0e,null));};exports['create']=function(_0x413a94,_0x4d174e){return db['VtigerConfiguration']['create'](_0x413a94[_0x6003('0x4a')],{})[_0x6003('0x27')](respondWithResult(_0x4d174e,0xc9))['catch'](handleError(_0x4d174e,null));};exports['update']=function(_0x5df584,_0x241dbe){if(_0x5df584[_0x6003('0x4a')]['id']){delete _0x5df584[_0x6003('0x4a')]['id'];}return db[_0x6003('0x41')][_0x6003('0x49')]({'where':{'id':_0x5df584[_0x6003('0x47')]['id']}})[_0x6003('0x27')](handleEntityNotFound(_0x241dbe,null))['then'](saveUpdates(_0x5df584[_0x6003('0x4a')],null))['then'](respondWithResult(_0x241dbe,null))[_0x6003('0x45')](handleError(_0x241dbe,null));};exports['destroy']=function(_0x849b23,_0x516bd5){return db['VtigerConfiguration'][_0x6003('0x49')]({'where':{'id':_0x849b23[_0x6003('0x47')]['id']}})[_0x6003('0x27')](handleEntityNotFound(_0x516bd5,null))['then'](removeEntity(_0x516bd5,null))['catch'](handleError(_0x516bd5,null));};exports['getFields']=function(_0x22e973,_0x3b1e27,_0x573f21){var _0x43c0c7={};var _0xf8af50={};var _0x1856d6;var _0x4604b5;return db[_0x6003('0x41')]['findOne']({'where':{'id':_0x22e973[_0x6003('0x47')]['id']}})[_0x6003('0x27')](handleEntityNotFound(_0x3b1e27,null))[_0x6003('0x27')](function(_0x3c1d34){if(_0x3c1d34){_0x1856d6=_0x3c1d34;_0xf8af50['model']=_[_0x6003('0x33')](db['VtigerField'][_0x6003('0x4b')]);_0xf8af50[_0x6003('0x32')]=_['keys'](_0x22e973[_0x6003('0x32')]);_0xf8af50['filters']=_['intersection'](_0xf8af50[_0x6003('0x31')],_0xf8af50[_0x6003('0x32')]);_0x43c0c7[_0x6003('0x36')]=_[_0x6003('0x35')](_0xf8af50[_0x6003('0x31')],qs['fields'](_0x22e973[_0x6003('0x32')][_0x6003('0x37')]));_0x43c0c7['attributes']=_0x43c0c7[_0x6003('0x36')][_0x6003('0x48')]?_0x43c0c7['attributes']:_0xf8af50['model'];_0x43c0c7[_0x6003('0x39')]=qs[_0x6003('0x3a')](_0x22e973[_0x6003('0x32')][_0x6003('0x3a')]);_0x43c0c7['where']=qs['filters'](_[_0x6003('0x4c')](_0x22e973['query'],_0xf8af50[_0x6003('0x34')]));if(_0x22e973[_0x6003('0x32')][_0x6003('0x3c')]){_0x43c0c7[_0x6003('0x3b')]=_[_0x6003('0x3d')](_0x43c0c7[_0x6003('0x3b')],{'$or':_['map'](_0x43c0c7[_0x6003('0x36')],function(_0x9182b2){var _0x3a3dbb={};_0x3a3dbb[_0x9182b2]={'$like':'%'+_0x22e973['query'][_0x6003('0x3c')]+'%'};return _0x3a3dbb;})});}_0x43c0c7=_[_0x6003('0x3d')]({},_0x43c0c7,_0x22e973[_0x6003('0x40')]);return _0x1856d6[_0x6003('0x4d')](_0x43c0c7);}})[_0x6003('0x27')](function(_0x291e90){if(_0x291e90){_0x4604b5=_0x291e90['length'];if(!_0x22e973[_0x6003('0x32')]['hasOwnProperty'](_0x6003('0x38'))){_0x43c0c7[_0x6003('0x20')]=qs[_0x6003('0x20')](_0x22e973[_0x6003('0x32')][_0x6003('0x20')]);_0x43c0c7[_0x6003('0x22')]=qs[_0x6003('0x22')](_0x22e973['query'][_0x6003('0x22')]);}return _0x1856d6[_0x6003('0x4d')](_0x43c0c7);}})[_0x6003('0x27')](function(_0x54b463){if(_0x54b463){return _0x54b463?{'count':_0x4604b5,'rows':_0x54b463}:null;}})[_0x6003('0x27')](respondWithResult(_0x3b1e27,null))[_0x6003('0x45')](handleError(_0x3b1e27,null));};exports['getSubjects']=function(_0x957643,_0x25f2b7,_0x571708){var _0x3bfd9a={};var _0x25b73f={};var _0x57947f;var _0x3801a4;return db[_0x6003('0x41')]['findOne']({'where':{'id':_0x957643[_0x6003('0x47')]['id']}})['then'](handleEntityNotFound(_0x25f2b7,null))['then'](function(_0x200823){if(_0x200823){_0x57947f=_0x200823;_0x25b73f[_0x6003('0x31')]=_[_0x6003('0x33')](db[_0x6003('0x4e')]['rawAttributes']);_0x25b73f[_0x6003('0x32')]=_['keys'](_0x957643[_0x6003('0x32')]);_0x25b73f[_0x6003('0x34')]=_[_0x6003('0x35')](_0x25b73f['model'],_0x25b73f[_0x6003('0x32')]);_0x3bfd9a[_0x6003('0x36')]=_['intersection'](_0x25b73f[_0x6003('0x31')],qs[_0x6003('0x37')](_0x957643[_0x6003('0x32')]['fields']));_0x3bfd9a['attributes']=_0x3bfd9a[_0x6003('0x36')][_0x6003('0x48')]?_0x3bfd9a[_0x6003('0x36')]:_0x25b73f[_0x6003('0x31')];_0x3bfd9a['order']=qs['sort'](_0x957643['query']['sort']);_0x3bfd9a['where']=qs['filters'](_[_0x6003('0x4c')](_0x957643[_0x6003('0x32')],_0x25b73f[_0x6003('0x34')]));if(_0x957643[_0x6003('0x32')][_0x6003('0x3c')]){_0x3bfd9a[_0x6003('0x3b')]=_[_0x6003('0x3d')](_0x3bfd9a[_0x6003('0x3b')],{'$or':_['map'](_0x3bfd9a[_0x6003('0x36')],function(_0x2feba5){var _0x5b2d65={};_0x5b2d65[_0x2feba5]={'$like':'%'+_0x957643[_0x6003('0x32')][_0x6003('0x3c')]+'%'};return _0x5b2d65;})});}_0x3bfd9a=_[_0x6003('0x3d')]({},_0x3bfd9a,_0x957643[_0x6003('0x40')]);return _0x57947f[_0x6003('0x4f')](_0x3bfd9a);}})['then'](function(_0x49611){if(_0x49611){_0x3801a4=_0x49611[_0x6003('0x48')];if(!_0x957643['query'][_0x6003('0x50')]('nolimit')){_0x3bfd9a[_0x6003('0x20')]=qs[_0x6003('0x20')](_0x957643['query'][_0x6003('0x20')]);_0x3bfd9a[_0x6003('0x22')]=qs['offset'](_0x957643[_0x6003('0x32')][_0x6003('0x22')]);}return _0x57947f[_0x6003('0x4f')](_0x3bfd9a);}})[_0x6003('0x27')](function(_0x57d85d){if(_0x57d85d){return _0x57d85d?{'count':_0x3801a4,'rows':_0x57d85d}:null;}})[_0x6003('0x27')](respondWithResult(_0x25f2b7,null))['catch'](handleError(_0x25f2b7,null));};exports['getDescriptions']=function(_0x103e91,_0x2ea76b,_0x496a59){var _0xfdb86e={};var _0x25b180={};var _0x58f7de;var _0x380863;return db[_0x6003('0x41')][_0x6003('0x51')]({'where':{'id':_0x103e91[_0x6003('0x47')]['id']}})[_0x6003('0x27')](handleEntityNotFound(_0x2ea76b,null))[_0x6003('0x27')](function(_0x446bf9){if(_0x446bf9){_0x58f7de=_0x446bf9;_0x25b180[_0x6003('0x31')]=_[_0x6003('0x33')](db['VtigerField'][_0x6003('0x4b')]);_0x25b180[_0x6003('0x32')]=_['keys'](_0x103e91['query']);_0x25b180[_0x6003('0x34')]=_[_0x6003('0x35')](_0x25b180[_0x6003('0x31')],_0x25b180[_0x6003('0x32')]);_0xfdb86e['attributes']=_[_0x6003('0x35')](_0x25b180['model'],qs[_0x6003('0x37')](_0x103e91[_0x6003('0x32')][_0x6003('0x37')]));_0xfdb86e[_0x6003('0x36')]=_0xfdb86e[_0x6003('0x36')][_0x6003('0x48')]?_0xfdb86e['attributes']:_0x25b180[_0x6003('0x31')];_0xfdb86e['order']=qs[_0x6003('0x3a')](_0x103e91[_0x6003('0x32')]['sort']);_0xfdb86e['where']=qs[_0x6003('0x34')](_[_0x6003('0x4c')](_0x103e91[_0x6003('0x32')],_0x25b180[_0x6003('0x34')]));if(_0x103e91[_0x6003('0x32')]['filter']){_0xfdb86e[_0x6003('0x3b')]=_[_0x6003('0x3d')](_0xfdb86e['where'],{'$or':_['map'](_0xfdb86e[_0x6003('0x36')],function(_0x593a8a){var _0x4a25dc={};_0x4a25dc[_0x593a8a]={'$like':'%'+_0x103e91[_0x6003('0x32')][_0x6003('0x3c')]+'%'};return _0x4a25dc;})});}_0xfdb86e=_[_0x6003('0x3d')]({},_0xfdb86e,_0x103e91['options']);return _0x58f7de[_0x6003('0x52')](_0xfdb86e);}})[_0x6003('0x27')](function(_0x1f49df){if(_0x1f49df){_0x380863=_0x1f49df['length'];if(!_0x103e91[_0x6003('0x32')][_0x6003('0x50')](_0x6003('0x38'))){_0xfdb86e['limit']=qs[_0x6003('0x20')](_0x103e91[_0x6003('0x32')][_0x6003('0x20')]);_0xfdb86e[_0x6003('0x22')]=qs[_0x6003('0x22')](_0x103e91[_0x6003('0x32')][_0x6003('0x22')]);}return _0x58f7de[_0x6003('0x52')](_0xfdb86e);}})['then'](function(_0x1f821f){if(_0x1f821f){return _0x1f821f?{'count':_0x380863,'rows':_0x1f821f}:null;}})['then'](respondWithResult(_0x2ea76b,null))[_0x6003('0x45')](handleError(_0x2ea76b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 43e452a..efe9bc5 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 _0xde36=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','api'];(function(_0x4a1a9a,_0x485d71){var _0x7539e1=function(_0x25d9b4){while(--_0x25d9b4){_0x4a1a9a['push'](_0x4a1a9a['shift']());}};_0x7539e1(++_0x485d71);}(_0xde36,0xf4));var _0x6de3=function(_0x4f3a23,_0x4e5cd2){_0x4f3a23=_0x4f3a23-0x0;var _0x14e1e1=_0xde36[_0x4f3a23];return _0x14e1e1;};'use strict';var _=require(_0x6de3('0x0'));var util=require(_0x6de3('0x1'));var logger=require('../../config/logger')(_0x6de3('0x2'));var moment=require('moment');var BPromise=require(_0x6de3('0x3'));var rp=require(_0x6de3('0x4'));var fs=require('fs');var path=require(_0x6de3('0x5'));var rimraf=require(_0x6de3('0x6'));var config=require(_0x6de3('0x7'));var attributes=require(_0x6de3('0x8'));module[_0x6de3('0x9')]=function(_0x3d0b73,_0x228d5b){return _0x3d0b73[_0x6de3('0xa')](_0x6de3('0xb'),attributes,{'tableName':_0x6de3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06e1=['define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intVtigerConfiguration.attributes','exports'];(function(_0x1b2255,_0x3de34f){var _0x33e57d=function(_0x2f9cce){while(--_0x2f9cce){_0x1b2255['push'](_0x1b2255['shift']());}};_0x33e57d(++_0x3de34f);}(_0x06e1,0xe3));var _0x106e=function(_0x3e9ba,_0x21f63c){_0x3e9ba=_0x3e9ba-0x0;var _0x587cf6=_0x06e1[_0x3e9ba];return _0x587cf6;};'use strict';var _=require(_0x106e('0x0'));var util=require(_0x106e('0x1'));var logger=require(_0x106e('0x2'))(_0x106e('0x3'));var moment=require(_0x106e('0x4'));var BPromise=require(_0x106e('0x5'));var rp=require(_0x106e('0x6'));var fs=require('fs');var path=require(_0x106e('0x7'));var rimraf=require(_0x106e('0x8'));var config=require('../../config/environment');var attributes=require(_0x106e('0x9'));module[_0x106e('0xa')]=function(_0x2b891e,_0x334a80){return _0x2b891e[_0x106e('0xb')](_0x106e('0xc'),attributes,{'tableName':_0x106e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index a80c4bc..7f9d190 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 _0x2804=['lodash','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch'];(function(_0x4d38e6,_0xc3a61d){var _0x4962ee=function(_0x4c01f0){while(--_0x4c01f0){_0x4d38e6['push'](_0x4d38e6['shift']());}};_0x4962ee(++_0xc3a61d);}(_0x2804,0x180));var _0x4280=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2804[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x4280('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4280('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4280('0x2'));var logger=require('../../config/logger')(_0x4280('0x3'));var config=require(_0x4280('0x4'));var jayson=require(_0x4280('0x5'));var client=jayson['client'][_0x4280('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xf0d743,_0x582a94,_0x3e1ed4){return new BPromise(function(_0x23f828,_0xcfa60){return client['request'](_0xf0d743,_0x3e1ed4)['then'](function(_0x391991){logger[_0x4280('0x7')](_0x4280('0x8'),_0x582a94,_0x4280('0x9'));logger['debug'](_0x4280('0xa'),_0x582a94,_0x4280('0x9'),JSON[_0x4280('0xb')](_0x391991));if(_0x391991['error']){if(_0x391991['error'][_0x4280('0xc')]===0x1f4){logger[_0x4280('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x582a94,_0x391991['error'][_0x4280('0xe')]);return _0xcfa60(_0x391991[_0x4280('0xd')][_0x4280('0xe')]);}logger[_0x4280('0xd')](_0x4280('0x8'),_0x582a94,_0x391991[_0x4280('0xd')][_0x4280('0xe')]);return _0x23f828(_0x391991['error'][_0x4280('0xe')]);}else{logger['info'](_0x4280('0x8'),_0x582a94,'request\x20sent');_0x23f828(_0x391991['result'][_0x4280('0xe')]);}})[_0x4280('0xf')](function(_0x2fc2ec){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x582a94,_0x2fc2ec);_0xcfa60(_0x2fc2ec);});});} \ No newline at end of file +var _0x7c67=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','randomstring','ioredis'];(function(_0x3a5068,_0x1ea084){var _0x46b25d=function(_0x2c1130){while(--_0x2c1130){_0x3a5068['push'](_0x3a5068['shift']());}};_0x46b25d(++_0x1ea084);}(_0x7c67,0x1f1));var _0x77c6=function(_0x56d34c,_0x389402){_0x56d34c=_0x56d34c-0x0;var _0x22c7c8=_0x7c67[_0x56d34c];return _0x22c7c8;};'use strict';var _=require('lodash');var util=require(_0x77c6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x77c6('0x1'));var fs=require('fs');var Redis=require(_0x77c6('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x77c6('0x3'));var logger=require('../../config/logger')(_0x77c6('0x4'));var config=require('../../config/environment');var jayson=require(_0x77c6('0x5'));var client=jayson[_0x77c6('0x6')][_0x77c6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37f1e3,_0x44b641,_0xf1dda0){return new BPromise(function(_0x337563,_0x130e78){return client[_0x77c6('0x8')](_0x37f1e3,_0xf1dda0)[_0x77c6('0x9')](function(_0x296d77){logger[_0x77c6('0xa')](_0x77c6('0xb'),_0x44b641,_0x77c6('0xc'));logger[_0x77c6('0xd')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x44b641,_0x77c6('0xc'),JSON[_0x77c6('0xe')](_0x296d77));if(_0x296d77[_0x77c6('0xf')]){if(_0x296d77[_0x77c6('0xf')][_0x77c6('0x10')]===0x1f4){logger[_0x77c6('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x44b641,_0x296d77['error']['message']);return _0x130e78(_0x296d77[_0x77c6('0xf')]['message']);}logger['error'](_0x77c6('0xb'),_0x44b641,_0x296d77[_0x77c6('0xf')][_0x77c6('0x11')]);return _0x337563(_0x296d77[_0x77c6('0xf')]['message']);}else{logger['info'](_0x77c6('0xb'),_0x44b641,_0x77c6('0xc'));_0x337563(_0x296d77[_0x77c6('0x12')][_0x77c6('0x11')]);}})[_0x77c6('0x13')](function(_0x53d393){logger[_0x77c6('0xf')](_0x77c6('0xb'),_0x44b641,_0x53d393);_0x130e78(_0x53d393);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 077d77d..8095c84 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 _0x21bb=['../../config/environment','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x5d2dc6,_0x34e139){var _0x47798d=function(_0x1b98f1){while(--_0x1b98f1){_0x5d2dc6['push'](_0x5d2dc6['shift']());}};_0x47798d(++_0x34e139);}(_0x21bb,0x13e));var _0xb21b=function(_0x4e6d4c,_0x363c46){_0x4e6d4c=_0x4e6d4c-0x0;var _0x47b155=_0x21bb[_0x4e6d4c];return _0x47b155;};'use strict';var multer=require(_0xb21b('0x0'));var util=require(_0xb21b('0x1'));var path=require('path');var timeout=require(_0xb21b('0x2'));var express=require(_0xb21b('0x3'));var router=express[_0xb21b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb21b('0x5'));var controller=require('./intVtigerField.controller');router[_0xb21b('0x6')]('/',auth['isAuthenticated'](),controller[_0xb21b('0x7')]);router[_0xb21b('0x6')](_0xb21b('0x8'),auth[_0xb21b('0x9')](),controller[_0xb21b('0xa')]);router['post']('/',auth[_0xb21b('0x9')](),controller[_0xb21b('0xb')]);router[_0xb21b('0xc')]('/:id',auth[_0xb21b('0x9')](),controller[_0xb21b('0xd')]);router[_0xb21b('0xe')](_0xb21b('0x8'),auth[_0xb21b('0x9')](),controller[_0xb21b('0xf')]);module[_0xb21b('0x10')]=router; \ No newline at end of file +var _0xd7df=['create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','/:id','show','post'];(function(_0x54d5ba,_0x1f1ba9){var _0x6a592e=function(_0x394f8d){while(--_0x394f8d){_0x54d5ba['push'](_0x54d5ba['shift']());}};_0x6a592e(++_0x1f1ba9);}(_0xd7df,0x9e));var _0xfd7d=function(_0x4dd0cb,_0x136166){_0x4dd0cb=_0x4dd0cb-0x0;var _0x52ce97=_0xd7df[_0x4dd0cb];return _0x52ce97;};'use strict';var multer=require(_0xfd7d('0x0'));var util=require(_0xfd7d('0x1'));var path=require(_0xfd7d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfd7d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfd7d('0x4'));var interaction=require(_0xfd7d('0x5'));var config=require(_0xfd7d('0x6'));var controller=require(_0xfd7d('0x7'));router[_0xfd7d('0x8')]('/',auth[_0xfd7d('0x9')](),controller['index']);router[_0xfd7d('0x8')](_0xfd7d('0xa'),auth[_0xfd7d('0x9')](),controller[_0xfd7d('0xb')]);router[_0xfd7d('0xc')]('/',auth[_0xfd7d('0x9')](),controller[_0xfd7d('0xd')]);router[_0xfd7d('0xe')](_0xfd7d('0xa'),auth[_0xfd7d('0x9')](),controller[_0xfd7d('0xf')]);router[_0xfd7d('0x10')](_0xfd7d('0xa'),auth['isAuthenticated'](),controller[_0xfd7d('0x11')]);module[_0xfd7d('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 ce15dc1..4bbc4c4 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 _0x08b8=['picklist','string','STRING','ENUM','BOOLEAN','variable','customVariable','keyValue'];(function(_0x1d8468,_0x524250){var _0x3c7e0a=function(_0x3120ac){while(--_0x3120ac){_0x1d8468['push'](_0x1d8468['shift']());}};_0x3c7e0a(++_0x524250);}(_0x08b8,0x1d5));var _0x808b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x08b8[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x808b('0x0'),_0x808b('0x1'),_0x808b('0x2'),_0x808b('0x3')),'defaultValue':_0x808b('0x4')},'content':{'type':Sequelize[_0x808b('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x808b('0x6')]('string',_0x808b('0x0'),'customVariable')},'keyContent':{'type':Sequelize[_0x808b('0x5')]},'idField':{'type':Sequelize[_0x808b('0x5')]},'nameField':{'type':Sequelize[_0x808b('0x5')]},'customField':{'type':Sequelize[_0x808b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x808b('0x5')]}}; \ No newline at end of file +var _0x2aa2=['customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x4ebc71,_0x3ae411){var _0x4a56fb=function(_0x556b7d){while(--_0x556b7d){_0x4ebc71['push'](_0x4ebc71['shift']());}};_0x4a56fb(++_0x3ae411);}(_0x2aa2,0x1d9));var _0x22aa=function(_0x28163a,_0x50374a){_0x28163a=_0x28163a-0x0;var _0x3970a2=_0x2aa2[_0x28163a];return _0x3970a2;};'use strict';var Sequelize=require(_0x22aa('0x0'));module[_0x22aa('0x1')]={'type':{'type':Sequelize['ENUM'](_0x22aa('0x2'),_0x22aa('0x3'),_0x22aa('0x4'),_0x22aa('0x5'),'picklist'),'defaultValue':_0x22aa('0x2')},'content':{'type':Sequelize[_0x22aa('0x6')]},'key':{'type':Sequelize[_0x22aa('0x6')]},'keyType':{'type':Sequelize[_0x22aa('0x7')](_0x22aa('0x2'),_0x22aa('0x3'),_0x22aa('0x4'))},'keyContent':{'type':Sequelize[_0x22aa('0x6')]},'idField':{'type':Sequelize[_0x22aa('0x6')]},'nameField':{'type':Sequelize[_0x22aa('0x6')]},'customField':{'type':Sequelize[_0x22aa('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x22aa('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 95f2e71..a9c51a3 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 _0x336f=['options','include','VtigerField','findAll','catch','show','params','rawAttributes','includeAll','create','body','find','destroy','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','pick','filter','where','merge'];(function(_0x2937ea,_0x43a2a9){var _0x40b81b=function(_0x2746bb){while(--_0x2746bb){_0x2937ea['push'](_0x2937ea['shift']());}};_0x40b81b(++_0x43a2a9);}(_0x336f,0x1b7));var _0xf336=function(_0x3ff633,_0x17ce16){_0x3ff633=_0x3ff633-0x0;var _0x3a18d4=_0x336f[_0x3ff633];return _0x3a18d4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf336('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf336('0x1'));var moment=require(_0xf336('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf336('0x3'));var util=require(_0xf336('0x4'));var path=require(_0xf336('0x5'));var sox=require(_0xf336('0x6'));var csv=require(_0xf336('0x7'));var ejs=require(_0xf336('0x8'));var fs=require('fs');var fs_extra=require(_0xf336('0x9'));var _=require(_0xf336('0xa'));var squel=require(_0xf336('0xb'));var crypto=require(_0xf336('0xc'));var jsforce=require(_0xf336('0xd'));var deskjs=require(_0xf336('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf336('0xf'));var Redis=require(_0xf336('0x10'));var authService=require(_0xf336('0x11'));var qs=require(_0xf336('0x12'));var as=require(_0xf336('0x13'));var hardwareService=require(_0xf336('0x14'));var logger=require(_0xf336('0x15'))('api');var utils=require(_0xf336('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf336('0x17'))['db'];function respondWithStatusCode(_0x496f26,_0x63c20){_0x63c20=_0x63c20||0xcc;return function(_0x1db5e6){if(_0x1db5e6){return _0x496f26[_0xf336('0x18')](_0x63c20);}return _0x496f26[_0xf336('0x19')](_0x63c20)[_0xf336('0x1a')]();};}function respondWithResult(_0x10aca8,_0x1ceca7){_0x1ceca7=_0x1ceca7||0xc8;return function(_0x563833){if(_0x563833){return _0x10aca8['status'](_0x1ceca7)[_0xf336('0x1b')](_0x563833);}};}function respondWithFilteredResult(_0x2d7d7d,_0x2061ba){return function(_0x39569f){if(_0x39569f){var _0x4d0225=typeof _0x2061ba['offset']===_0xf336('0x1c')&&typeof _0x2061ba[_0xf336('0x1d')]===_0xf336('0x1c');var _0x4f5829=_0x39569f[_0xf336('0x1e')];var _0x5810d7=_0x4d0225?0x0:_0x2061ba[_0xf336('0x1f')];var _0x1f453e=_0x4d0225?_0x39569f[_0xf336('0x1e')]:_0x2061ba['offset']+_0x2061ba[_0xf336('0x1d')];var _0x4ab563;if(_0x1f453e>=_0x4f5829){_0x1f453e=_0x4f5829;_0x4ab563=0xc8;}else{_0x4ab563=0xce;}_0x2d7d7d[_0xf336('0x19')](_0x4ab563);return _0x2d7d7d[_0xf336('0x20')]('Content-Range',_0x5810d7+'-'+_0x1f453e+'/'+_0x4f5829)[_0xf336('0x1b')](_0x39569f);}return null;};}function patchUpdates(_0x4c1048){return function(_0xab27f5){try{jsonpatch['apply'](_0xab27f5,_0x4c1048,!![]);}catch(_0x5b998b){return BPromise[_0xf336('0x21')](_0x5b998b);}return _0xab27f5[_0xf336('0x22')]();};}function saveUpdates(_0x521ff5,_0x2cefc3){return function(_0x20fa63){if(_0x20fa63){return _0x20fa63[_0xf336('0x23')](_0x521ff5)[_0xf336('0x24')](function(_0x44eef9){return _0x44eef9;});}return null;};}function removeEntity(_0x51d0ec,_0x4d8409){return function(_0x14ff29){if(_0x14ff29){return _0x14ff29['destroy']()[_0xf336('0x24')](function(){_0x51d0ec['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1302fd,_0x3bd130){return function(_0x1922ae){if(!_0x1922ae){_0x1302fd[_0xf336('0x18')](0x194);}return _0x1922ae;};}function handleError(_0x1c51f4,_0x4b85c1){_0x4b85c1=_0x4b85c1||0x1f4;return function(_0x51ee28){logger['error'](_0x51ee28[_0xf336('0x25')]);if(_0x51ee28[_0xf336('0x26')]){delete _0x51ee28[_0xf336('0x26')];}_0x1c51f4[_0xf336('0x19')](_0x4b85c1)['send'](_0x51ee28);};}exports[_0xf336('0x27')]=function(_0x133603,_0x4fb79d){var _0x418a94={},_0x22f857={},_0xc6dd71={'count':0x0,'rows':[]};var _0x5f4e53=_[_0xf336('0x28')](db['VtigerField']['rawAttributes'],function(_0x31f653){return{'name':_0x31f653[_0xf336('0x29')],'type':_0x31f653[_0xf336('0x2a')][_0xf336('0x2b')]};});_0x22f857[_0xf336('0x2c')]=_[_0xf336('0x28')](_0x5f4e53,_0xf336('0x26'));_0x22f857[_0xf336('0x2d')]=_[_0xf336('0x2e')](_0x133603[_0xf336('0x2d')]);_0x22f857[_0xf336('0x2f')]=_[_0xf336('0x30')](_0x22f857[_0xf336('0x2c')],_0x22f857[_0xf336('0x2d')]);_0x418a94[_0xf336('0x31')]=_['intersection'](_0x22f857[_0xf336('0x2c')],qs[_0xf336('0x32')](_0x133603[_0xf336('0x2d')][_0xf336('0x32')]));_0x418a94['attributes']=_0x418a94[_0xf336('0x31')][_0xf336('0x33')]?_0x418a94[_0xf336('0x31')]:_0x22f857[_0xf336('0x2c')];if(!_0x133603[_0xf336('0x2d')]['hasOwnProperty'](_0xf336('0x34'))){_0x418a94['limit']=qs[_0xf336('0x1d')](_0x133603[_0xf336('0x2d')]['limit']);_0x418a94[_0xf336('0x1f')]=qs['offset'](_0x133603[_0xf336('0x2d')]['offset']);}_0x418a94[_0xf336('0x35')]=qs['sort'](_0x133603['query']['sort']);_0x418a94['where']=qs['filters'](_[_0xf336('0x36')](_0x133603[_0xf336('0x2d')],_0x22f857[_0xf336('0x2f')]),_0x5f4e53);if(_0x133603[_0xf336('0x2d')][_0xf336('0x37')]){_0x418a94[_0xf336('0x38')]=_[_0xf336('0x39')](_0x418a94[_0xf336('0x38')],{'$or':_[_0xf336('0x28')](_0x5f4e53,function(_0x4d3d15){if(_0x4d3d15[_0xf336('0x2a')]!=='VIRTUAL'){var _0x2ce0d9={};_0x2ce0d9[_0x4d3d15[_0xf336('0x26')]]={'$like':'%'+_0x133603[_0xf336('0x2d')][_0xf336('0x37')]+'%'};return _0x2ce0d9;}})});}_0x418a94=_[_0xf336('0x39')]({},_0x418a94,_0x133603[_0xf336('0x3a')]);var _0x14f534={'where':_0x418a94[_0xf336('0x38')]};return db['VtigerField'][_0xf336('0x1e')](_0x14f534)['then'](function(_0x5e438a){_0xc6dd71[_0xf336('0x1e')]=_0x5e438a;if(_0x133603['query']['includeAll']){_0x418a94[_0xf336('0x3b')]=[{'all':!![]}];}return db[_0xf336('0x3c')][_0xf336('0x3d')](_0x418a94);})[_0xf336('0x24')](function(_0x534e26){_0xc6dd71['rows']=_0x534e26;return _0xc6dd71;})[_0xf336('0x24')](respondWithFilteredResult(_0x4fb79d,_0x418a94))[_0xf336('0x3e')](handleError(_0x4fb79d,null));};exports[_0xf336('0x3f')]=function(_0x4a3a15,_0x592c40){var _0x4c4b07={'raw':!![],'where':{'id':_0x4a3a15[_0xf336('0x40')]['id']}},_0x114552={};_0x114552[_0xf336('0x2c')]=_['keys'](db[_0xf336('0x3c')][_0xf336('0x41')]);_0x114552[_0xf336('0x2d')]=_[_0xf336('0x2e')](_0x4a3a15[_0xf336('0x2d')]);_0x114552[_0xf336('0x2f')]=_['intersection'](_0x114552[_0xf336('0x2c')],_0x114552[_0xf336('0x2d')]);_0x4c4b07['attributes']=_[_0xf336('0x30')](_0x114552[_0xf336('0x2c')],qs[_0xf336('0x32')](_0x4a3a15[_0xf336('0x2d')][_0xf336('0x32')]));_0x4c4b07[_0xf336('0x31')]=_0x4c4b07[_0xf336('0x31')][_0xf336('0x33')]?_0x4c4b07['attributes']:_0x114552[_0xf336('0x2c')];if(_0x4a3a15[_0xf336('0x2d')][_0xf336('0x42')]){_0x4c4b07[_0xf336('0x3b')]=[{'all':!![]}];}_0x4c4b07=_['merge']({},_0x4c4b07,_0x4a3a15['options']);return db[_0xf336('0x3c')]['find'](_0x4c4b07)[_0xf336('0x24')](handleEntityNotFound(_0x592c40,null))['then'](respondWithResult(_0x592c40,null))[_0xf336('0x3e')](handleError(_0x592c40,null));};exports[_0xf336('0x43')]=function(_0x372716,_0x51b3f9){return db[_0xf336('0x3c')][_0xf336('0x43')](_0x372716[_0xf336('0x44')],{})[_0xf336('0x24')](respondWithResult(_0x51b3f9,0xc9))[_0xf336('0x3e')](handleError(_0x51b3f9,null));};exports['update']=function(_0x7aa918,_0x4c98c4){if(_0x7aa918['body']['id']){delete _0x7aa918[_0xf336('0x44')]['id'];}return db['VtigerField'][_0xf336('0x45')]({'where':{'id':_0x7aa918['params']['id']}})[_0xf336('0x24')](handleEntityNotFound(_0x4c98c4,null))[_0xf336('0x24')](saveUpdates(_0x7aa918[_0xf336('0x44')],null))[_0xf336('0x24')](respondWithResult(_0x4c98c4,null))[_0xf336('0x3e')](handleError(_0x4c98c4,null));};exports[_0xf336('0x46')]=function(_0x369fe2,_0x20d2f1){return db[_0xf336('0x3c')][_0xf336('0x45')]({'where':{'id':_0x369fe2[_0xf336('0x40')]['id']}})[_0xf336('0x24')](handleEntityNotFound(_0x20d2f1,null))[_0xf336('0x24')](removeEntity(_0x20d2f1,null))['catch'](handleError(_0x20d2f1,null));}; \ No newline at end of file +var _0x5f6f=['json','apply','reject','save','update','then','sendStatus','error','name','index','VtigerField','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','limit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','rows','show','params','options','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','count','offset','set'];(function(_0x4e11d5,_0x1ce514){var _0x5e4e4c=function(_0xbee63d){while(--_0xbee63d){_0x4e11d5['push'](_0x4e11d5['shift']());}};_0x5e4e4c(++_0x1ce514);}(_0x5f6f,0x107));var _0xf5f6=function(_0x2e684b,_0x11f578){_0x2e684b=_0x2e684b-0x0;var _0x19d9da=_0x5f6f[_0x2e684b];return _0x19d9da;};'use strict';var emlformat=require(_0xf5f6('0x0'));var rimraf=require(_0xf5f6('0x1'));var zipdir=require(_0xf5f6('0x2'));var jsonpatch=require(_0xf5f6('0x3'));var rp=require(_0xf5f6('0x4'));var moment=require('moment');var BPromise=require(_0xf5f6('0x5'));var Mustache=require(_0xf5f6('0x6'));var util=require(_0xf5f6('0x7'));var path=require(_0xf5f6('0x8'));var sox=require(_0xf5f6('0x9'));var csv=require(_0xf5f6('0xa'));var ejs=require(_0xf5f6('0xb'));var fs=require('fs');var fs_extra=require(_0xf5f6('0xc'));var _=require(_0xf5f6('0xd'));var squel=require(_0xf5f6('0xe'));var crypto=require('crypto');var jsforce=require(_0xf5f6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf5f6('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f6('0x10'));var Redis=require(_0xf5f6('0x11'));var authService=require(_0xf5f6('0x12'));var qs=require(_0xf5f6('0x13'));var as=require(_0xf5f6('0x14'));var hardwareService=require(_0xf5f6('0x15'));var logger=require('../../config/logger')(_0xf5f6('0x16'));var utils=require(_0xf5f6('0x17'));var config=require(_0xf5f6('0x18'));var licenseUtil=require(_0xf5f6('0x19'));var db=require(_0xf5f6('0x1a'))['db'];function respondWithStatusCode(_0x1374e5,_0x18f1ff){_0x18f1ff=_0x18f1ff||0xcc;return function(_0x1ba575){if(_0x1ba575){return _0x1374e5['sendStatus'](_0x18f1ff);}return _0x1374e5['status'](_0x18f1ff)[_0xf5f6('0x1b')]();};}function respondWithResult(_0x1a20c3,_0x4da12b){_0x4da12b=_0x4da12b||0xc8;return function(_0x1ff046){if(_0x1ff046){return _0x1a20c3[_0xf5f6('0x1c')](_0x4da12b)['json'](_0x1ff046);}};}function respondWithFilteredResult(_0x12b0e0,_0x4ae14b){return function(_0x2fac75){if(_0x2fac75){var _0x1b1e4d=typeof _0x4ae14b['offset']===_0xf5f6('0x1d')&&typeof _0x4ae14b['limit']===_0xf5f6('0x1d');var _0x1f89ac=_0x2fac75[_0xf5f6('0x1e')];var _0x557d65=_0x1b1e4d?0x0:_0x4ae14b[_0xf5f6('0x1f')];var _0x3ad761=_0x1b1e4d?_0x2fac75['count']:_0x4ae14b[_0xf5f6('0x1f')]+_0x4ae14b['limit'];var _0x272f5a;if(_0x3ad761>=_0x1f89ac){_0x3ad761=_0x1f89ac;_0x272f5a=0xc8;}else{_0x272f5a=0xce;}_0x12b0e0[_0xf5f6('0x1c')](_0x272f5a);return _0x12b0e0[_0xf5f6('0x20')]('Content-Range',_0x557d65+'-'+_0x3ad761+'/'+_0x1f89ac)[_0xf5f6('0x21')](_0x2fac75);}return null;};}function patchUpdates(_0x26a082){return function(_0x29e60e){try{jsonpatch[_0xf5f6('0x22')](_0x29e60e,_0x26a082,!![]);}catch(_0x2a0b09){return BPromise[_0xf5f6('0x23')](_0x2a0b09);}return _0x29e60e[_0xf5f6('0x24')]();};}function saveUpdates(_0x598e2e,_0x12e643){return function(_0x178d24){if(_0x178d24){return _0x178d24[_0xf5f6('0x25')](_0x598e2e)['then'](function(_0x5c4067){return _0x5c4067;});}return null;};}function removeEntity(_0x45b5a2,_0x22dede){return function(_0x35d566){if(_0x35d566){return _0x35d566['destroy']()[_0xf5f6('0x26')](function(){_0x45b5a2[_0xf5f6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b0eda,_0x14f179){return function(_0x4dec73){if(!_0x4dec73){_0x1b0eda[_0xf5f6('0x27')](0x194);}return _0x4dec73;};}function handleError(_0x2fbd74,_0x5ef661){_0x5ef661=_0x5ef661||0x1f4;return function(_0x1dd5d1){logger[_0xf5f6('0x28')](_0x1dd5d1['stack']);if(_0x1dd5d1['name']){delete _0x1dd5d1[_0xf5f6('0x29')];}_0x2fbd74['status'](_0x5ef661)['send'](_0x1dd5d1);};}exports[_0xf5f6('0x2a')]=function(_0x8d1b81,_0x469b2a){var _0x54a6ba={},_0x38dcd0={},_0x16d357={'count':0x0,'rows':[]};var _0x4f8098=_['map'](db[_0xf5f6('0x2b')][_0xf5f6('0x2c')],function(_0x396545){return{'name':_0x396545[_0xf5f6('0x2d')],'type':_0x396545[_0xf5f6('0x2e')]['key']};});_0x38dcd0[_0xf5f6('0x2f')]=_[_0xf5f6('0x30')](_0x4f8098,'name');_0x38dcd0[_0xf5f6('0x31')]=_[_0xf5f6('0x32')](_0x8d1b81[_0xf5f6('0x31')]);_0x38dcd0[_0xf5f6('0x33')]=_[_0xf5f6('0x34')](_0x38dcd0[_0xf5f6('0x2f')],_0x38dcd0[_0xf5f6('0x31')]);_0x54a6ba['attributes']=_[_0xf5f6('0x34')](_0x38dcd0[_0xf5f6('0x2f')],qs['fields'](_0x8d1b81[_0xf5f6('0x31')][_0xf5f6('0x35')]));_0x54a6ba['attributes']=_0x54a6ba[_0xf5f6('0x36')][_0xf5f6('0x37')]?_0x54a6ba[_0xf5f6('0x36')]:_0x38dcd0[_0xf5f6('0x2f')];if(!_0x8d1b81[_0xf5f6('0x31')]['hasOwnProperty']('nolimit')){_0x54a6ba[_0xf5f6('0x38')]=qs['limit'](_0x8d1b81[_0xf5f6('0x31')]['limit']);_0x54a6ba[_0xf5f6('0x1f')]=qs[_0xf5f6('0x1f')](_0x8d1b81[_0xf5f6('0x31')][_0xf5f6('0x1f')]);}_0x54a6ba[_0xf5f6('0x39')]=qs[_0xf5f6('0x3a')](_0x8d1b81[_0xf5f6('0x31')]['sort']);_0x54a6ba[_0xf5f6('0x3b')]=qs[_0xf5f6('0x33')](_[_0xf5f6('0x3c')](_0x8d1b81[_0xf5f6('0x31')],_0x38dcd0[_0xf5f6('0x33')]),_0x4f8098);if(_0x8d1b81[_0xf5f6('0x31')]['filter']){_0x54a6ba['where']=_[_0xf5f6('0x3d')](_0x54a6ba[_0xf5f6('0x3b')],{'$or':_[_0xf5f6('0x30')](_0x4f8098,function(_0x56b6f8){if(_0x56b6f8['type']!==_0xf5f6('0x3e')){var _0xea8488={};_0xea8488[_0x56b6f8[_0xf5f6('0x29')]]={'$like':'%'+_0x8d1b81[_0xf5f6('0x31')][_0xf5f6('0x3f')]+'%'};return _0xea8488;}})});}_0x54a6ba=_[_0xf5f6('0x3d')]({},_0x54a6ba,_0x8d1b81['options']);var _0x4970a7={'where':_0x54a6ba['where']};return db[_0xf5f6('0x2b')][_0xf5f6('0x1e')](_0x4970a7)[_0xf5f6('0x26')](function(_0x17fc13){_0x16d357['count']=_0x17fc13;if(_0x8d1b81[_0xf5f6('0x31')][_0xf5f6('0x40')]){_0x54a6ba['include']=[{'all':!![]}];}return db[_0xf5f6('0x2b')]['findAll'](_0x54a6ba);})[_0xf5f6('0x26')](function(_0x335800){_0x16d357[_0xf5f6('0x41')]=_0x335800;return _0x16d357;})[_0xf5f6('0x26')](respondWithFilteredResult(_0x469b2a,_0x54a6ba))['catch'](handleError(_0x469b2a,null));};exports[_0xf5f6('0x42')]=function(_0xdfa053,_0x21c7ab){var _0x38c2be={'raw':!![],'where':{'id':_0xdfa053[_0xf5f6('0x43')]['id']}},_0x13bfa1={};_0x13bfa1['model']=_[_0xf5f6('0x32')](db[_0xf5f6('0x2b')][_0xf5f6('0x2c')]);_0x13bfa1['query']=_[_0xf5f6('0x32')](_0xdfa053[_0xf5f6('0x31')]);_0x13bfa1[_0xf5f6('0x33')]=_[_0xf5f6('0x34')](_0x13bfa1[_0xf5f6('0x2f')],_0x13bfa1[_0xf5f6('0x31')]);_0x38c2be[_0xf5f6('0x36')]=_[_0xf5f6('0x34')](_0x13bfa1[_0xf5f6('0x2f')],qs[_0xf5f6('0x35')](_0xdfa053[_0xf5f6('0x31')][_0xf5f6('0x35')]));_0x38c2be['attributes']=_0x38c2be['attributes'][_0xf5f6('0x37')]?_0x38c2be['attributes']:_0x13bfa1[_0xf5f6('0x2f')];if(_0xdfa053[_0xf5f6('0x31')][_0xf5f6('0x40')]){_0x38c2be['include']=[{'all':!![]}];}_0x38c2be=_[_0xf5f6('0x3d')]({},_0x38c2be,_0xdfa053[_0xf5f6('0x44')]);return db[_0xf5f6('0x2b')][_0xf5f6('0x45')](_0x38c2be)['then'](handleEntityNotFound(_0x21c7ab,null))['then'](respondWithResult(_0x21c7ab,null))[_0xf5f6('0x46')](handleError(_0x21c7ab,null));};exports['create']=function(_0x4e1e2a,_0x532324){return db[_0xf5f6('0x2b')][_0xf5f6('0x47')](_0x4e1e2a[_0xf5f6('0x48')],{})[_0xf5f6('0x26')](respondWithResult(_0x532324,0xc9))['catch'](handleError(_0x532324,null));};exports['update']=function(_0x5b22e5,_0x37ba23){if(_0x5b22e5[_0xf5f6('0x48')]['id']){delete _0x5b22e5['body']['id'];}return db[_0xf5f6('0x2b')][_0xf5f6('0x45')]({'where':{'id':_0x5b22e5[_0xf5f6('0x43')]['id']}})[_0xf5f6('0x26')](handleEntityNotFound(_0x37ba23,null))[_0xf5f6('0x26')](saveUpdates(_0x5b22e5[_0xf5f6('0x48')],null))[_0xf5f6('0x26')](respondWithResult(_0x37ba23,null))[_0xf5f6('0x46')](handleError(_0x37ba23,null));};exports[_0xf5f6('0x49')]=function(_0x157042,_0x19fdfc){return db[_0xf5f6('0x2b')][_0xf5f6('0x45')]({'where':{'id':_0x157042[_0xf5f6('0x43')]['id']}})[_0xf5f6('0x26')](handleEntityNotFound(_0x19fdfc,null))['then'](removeEntity(_0x19fdfc,null))[_0xf5f6('0x46')](handleError(_0x19fdfc,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 49e13e8..25e2640 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 _0xc24e=['../../config/environment','./intVtigerField.attributes','VtigerField','int_vtiger_fields','idField','lodash','util','request-promise'];(function(_0x5273ba,_0x30c980){var _0xba55a2=function(_0x1ebcc9){while(--_0x1ebcc9){_0x5273ba['push'](_0x5273ba['shift']());}};_0xba55a2(++_0x30c980);}(_0xc24e,0xd5));var _0xec24=function(_0x36b2ba,_0x278e34){_0x36b2ba=_0x36b2ba-0x0;var _0x2fa3fe=_0xc24e[_0x36b2ba];return _0x2fa3fe;};'use strict';var _=require(_0xec24('0x0'));var util=require(_0xec24('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xec24('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xec24('0x3'));var attributes=require(_0xec24('0x4'));module['exports']=function(_0x4ac69e,_0x3dfcf5){return _0x4ac69e['define'](_0xec24('0x5'),attributes,{'tableName':_0xec24('0x6'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xec24('0x7'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7878=['bluebird','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','../../config/logger','api','moment'];(function(_0x4309a1,_0x205c99){var _0x54d6f1=function(_0x23cb0c){while(--_0x23cb0c){_0x4309a1['push'](_0x4309a1['shift']());}};_0x54d6f1(++_0x205c99);}(_0x7878,0x10e));var _0x8787=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7878[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8787('0x0'))(_0x8787('0x1'));var moment=require(_0x8787('0x2'));var BPromise=require(_0x8787('0x3'));var rp=require(_0x8787('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8787('0x5'));var config=require(_0x8787('0x6'));var attributes=require(_0x8787('0x7'));module['exports']=function(_0x47b773,_0x3205fc){return _0x47b773[_0x8787('0x8')](_0x8787('0x9'),attributes,{'tableName':_0x8787('0xa'),'paranoid':![],'indexes':[{'name':_0x8787('0xb'),'fields':['idField',_0x8787('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 02022b3..d60da6e 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 _0xf83f=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','VtigerField,\x20%s,\x20%s','message'];(function(_0x3d3d72,_0xdf962e){var _0xdecc65=function(_0x3926b0){while(--_0x3926b0){_0x3d3d72['push'](_0x3d3d72['shift']());}};_0xdecc65(++_0xdf962e);}(_0xf83f,0xf8));var _0xff83=function(_0x1b881f,_0x38c4dd){_0x1b881f=_0x1b881f-0x0;var _0x1a8b10=_0xf83f[_0x1b881f];return _0x1a8b10;};'use strict';var _=require(_0xff83('0x0'));var util=require(_0xff83('0x1'));var moment=require('moment');var BPromise=require(_0xff83('0x2'));var rs=require(_0xff83('0x3'));var fs=require('fs');var Redis=require(_0xff83('0x4'));var db=require(_0xff83('0x5'))['db'];var utils=require(_0xff83('0x6'));var logger=require('../../config/logger')(_0xff83('0x7'));var config=require('../../config/environment');var jayson=require(_0xff83('0x8'));var client=jayson['client'][_0xff83('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262748,_0x45196b,_0x179d77){return new BPromise(function(_0x3f416e,_0x164eba){return client[_0xff83('0xa')](_0x262748,_0x179d77)['then'](function(_0x435684){logger[_0xff83('0xb')]('VtigerField,\x20%s,\x20%s',_0x45196b,_0xff83('0xc'));logger[_0xff83('0xd')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x45196b,'request\x20sent',JSON[_0xff83('0xe')](_0x435684));if(_0x435684['error']){if(_0x435684['error']['code']===0x1f4){logger[_0xff83('0xf')](_0xff83('0x10'),_0x45196b,_0x435684[_0xff83('0xf')][_0xff83('0x11')]);return _0x164eba(_0x435684[_0xff83('0xf')][_0xff83('0x11')]);}logger['error'](_0xff83('0x10'),_0x45196b,_0x435684[_0xff83('0xf')][_0xff83('0x11')]);return _0x3f416e(_0x435684['error']['message']);}else{logger[_0xff83('0xb')](_0xff83('0x10'),_0x45196b,_0xff83('0xc'));_0x3f416e(_0x435684[_0xff83('0x12')][_0xff83('0x11')]);}})['catch'](function(_0x228894){logger['error']('VtigerField,\x20%s,\x20%s',_0x45196b,_0x228894);_0x164eba(_0x228894);});});} \ No newline at end of file +var _0x719a=['../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x42b02c,_0x5c7b99){var _0x105518=function(_0x305734){while(--_0x305734){_0x42b02c['push'](_0x42b02c['shift']());}};_0x105518(++_0x5c7b99);}(_0x719a,0xcc));var _0xa719=function(_0x6b085f,_0x26959c){_0x6b085f=_0x6b085f-0x0;var _0x40a408=_0x719a[_0x6b085f];return _0x40a408;};'use strict';var _=require(_0xa719('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa719('0x1'));var rs=require(_0xa719('0x2'));var fs=require('fs');var Redis=require(_0xa719('0x3'));var db=require(_0xa719('0x4'))['db'];var utils=require(_0xa719('0x5'));var logger=require(_0xa719('0x6'))('rpc');var config=require(_0xa719('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa719('0x8')][_0xa719('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x285f96,_0x5105fb,_0x17038a){return new BPromise(function(_0x250cc8,_0x2ad744){return client[_0xa719('0xa')](_0x285f96,_0x17038a)[_0xa719('0xb')](function(_0x2cbb09){logger[_0xa719('0xc')]('VtigerField,\x20%s,\x20%s',_0x5105fb,_0xa719('0xd'));logger['debug'](_0xa719('0xe'),_0x5105fb,_0xa719('0xd'),JSON[_0xa719('0xf')](_0x2cbb09));if(_0x2cbb09[_0xa719('0x10')]){if(_0x2cbb09['error'][_0xa719('0x11')]===0x1f4){logger['error'](_0xa719('0x12'),_0x5105fb,_0x2cbb09[_0xa719('0x10')][_0xa719('0x13')]);return _0x2ad744(_0x2cbb09[_0xa719('0x10')]['message']);}logger[_0xa719('0x10')](_0xa719('0x12'),_0x5105fb,_0x2cbb09['error'][_0xa719('0x13')]);return _0x250cc8(_0x2cbb09[_0xa719('0x10')]['message']);}else{logger['info'](_0xa719('0x12'),_0x5105fb,'request\x20sent');_0x250cc8(_0x2cbb09[_0xa719('0x14')][_0xa719('0x13')]);}})['catch'](function(_0x412a53){logger[_0xa719('0x10')]('VtigerField,\x20%s,\x20%s',_0x5105fb,_0x412a53);_0x2ad744(_0x412a53);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index f8637bf..2b132e7 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 _0x0f8f=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports'];(function(_0x3038b3,_0x5b339e){var _0x21bd20=function(_0x13401b){while(--_0x13401b){_0x3038b3['push'](_0x3038b3['shift']());}};_0x21bd20(++_0x5b339e);}(_0x0f8f,0x1cc));var _0xf0f8=function(_0xe5b349,_0x5f06e4){_0xe5b349=_0xe5b349-0x0;var _0x26b0ad=_0x0f8f[_0xe5b349];return _0x26b0ad;};'use strict';var multer=require('multer');var util=require(_0xf0f8('0x0'));var path=require(_0xf0f8('0x1'));var timeout=require('connect-timeout');var express=require(_0xf0f8('0x2'));var router=express[_0xf0f8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf0f8('0x4'));var interaction=require(_0xf0f8('0x5'));var config=require(_0xf0f8('0x6'));var controller=require(_0xf0f8('0x7'));router['get']('/',auth[_0xf0f8('0x8')](),controller['index']);router[_0xf0f8('0x9')](_0xf0f8('0xa'),auth['isAuthenticated'](),controller[_0xf0f8('0xb')]);router[_0xf0f8('0x9')](_0xf0f8('0xc'),auth['isAuthenticated'](),controller[_0xf0f8('0xd')]);router[_0xf0f8('0x9')](_0xf0f8('0xe'),auth[_0xf0f8('0x8')](),controller[_0xf0f8('0xf')]);router[_0xf0f8('0x10')]('/',auth[_0xf0f8('0x8')](),controller[_0xf0f8('0x11')]);router[_0xf0f8('0x10')](_0xf0f8('0xc'),auth[_0xf0f8('0x8')](),controller[_0xf0f8('0x12')]);router['put'](_0xf0f8('0xa'),auth[_0xf0f8('0x8')](),controller[_0xf0f8('0x13')]);router[_0xf0f8('0x14')](_0xf0f8('0xa'),auth[_0xf0f8('0x8')](),controller[_0xf0f8('0x15')]);module[_0xf0f8('0x16')]=router; \ No newline at end of file +var _0x68b6=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','getConfigurations','getFields','post','create','put','/:id','update','delete'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x68b6,0x1cf));var _0x668b=function(_0x2aa7d9,_0x182e60){_0x2aa7d9=_0x2aa7d9-0x0;var _0x34c604=_0x68b6[_0x2aa7d9];return _0x34c604;};'use strict';var multer=require('multer');var util=require(_0x668b('0x0'));var path=require(_0x668b('0x1'));var timeout=require(_0x668b('0x2'));var express=require(_0x668b('0x3'));var router=express[_0x668b('0x4')]();var fs_extra=require(_0x668b('0x5'));var auth=require(_0x668b('0x6'));var interaction=require(_0x668b('0x7'));var config=require(_0x668b('0x8'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x668b('0x9')]);router[_0x668b('0xa')]('/:id',auth[_0x668b('0xb')](),controller['show']);router[_0x668b('0xa')]('/:id/configurations',auth[_0x668b('0xb')](),controller[_0x668b('0xc')]);router[_0x668b('0xa')]('/:id/fields',auth[_0x668b('0xb')](),controller[_0x668b('0xd')]);router[_0x668b('0xe')]('/',auth[_0x668b('0xb')](),controller[_0x668b('0xf')]);router['post']('/:id/configurations',auth[_0x668b('0xb')](),controller['addConfiguration']);router[_0x668b('0x10')](_0x668b('0x11'),auth[_0x668b('0xb')](),controller[_0x668b('0x12')]);router[_0x668b('0x13')](_0x668b('0x11'),auth['isAuthenticated'](),controller[_0x668b('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 7d4d3ac..acde4d5 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 _0xd959=['password','token','integrationTab','newTab','sequelize','exports','STRING','username','ENUM'];(function(_0x38e730,_0x2e63b6){var _0x29b82e=function(_0x7ab722){while(--_0x7ab722){_0x38e730['push'](_0x38e730['shift']());}};_0x29b82e(++_0x2e63b6);}(_0xd959,0x94));var _0x9d95=function(_0x236ec,_0x4a0bbb){_0x236ec=_0x236ec-0x0;var _0x5a7c11=_0xd959[_0x236ec];return _0x5a7c11;};'use strict';var Sequelize=require(_0x9d95('0x0'));module[_0x9d95('0x1')]={'name':{'type':Sequelize[_0x9d95('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9d95('0x2')],'unique':_0x9d95('0x3')},'password':{'type':Sequelize[_0x9d95('0x2')]},'token':{'type':Sequelize[_0x9d95('0x2')]},'remoteUri':{'type':Sequelize[_0x9d95('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x9d95('0x4')](_0x9d95('0x5'),_0x9d95('0x6')),'defaultValue':_0x9d95('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9d95('0x4')](_0x9d95('0x7'),_0x9d95('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xe08b=['sequelize','STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab'];(function(_0x48ede9,_0x1765e1){var _0x52cf5c=function(_0x4e6886){while(--_0x4e6886){_0x48ede9['push'](_0x48ede9['shift']());}};_0x52cf5c(++_0x1765e1);}(_0xe08b,0x10e));var _0xbe08=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xe08b[_0x3899d1];return _0xeb4a7d;};'use strict';var Sequelize=require(_0xbe08('0x0'));module['exports']={'name':{'type':Sequelize[_0xbe08('0x1')]},'description':{'type':Sequelize[_0xbe08('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xbe08('0x2')},'password':{'type':Sequelize[_0xbe08('0x1')]},'token':{'type':Sequelize[_0xbe08('0x1')]},'remoteUri':{'type':Sequelize[_0xbe08('0x1')],'unique':_0xbe08('0x3')},'authType':{'type':Sequelize[_0xbe08('0x4')](_0xbe08('0x5'),_0xbe08('0x6')),'defaultValue':_0xbe08('0x5')},'serverUrl':{'type':Sequelize[_0xbe08('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xbe08('0x4')](_0xbe08('0x7'),_0xbe08('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 7687a02..fb830a4 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 _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(_0x296ee5,_0x516030){var _0x3cdbf=function(_0x41591e){while(--_0x41591e){_0x296ee5['push'](_0x296ee5['shift']());}};_0x3cdbf(++_0x516030);}(_0xe511,0x16f));var _0x1e51=function(_0x1d4ba1,_0x4970ac){_0x1d4ba1=_0x1d4ba1-0x0;var _0x4082bb=_0xe511[_0x1d4ba1];return _0x4082bb;};'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 +var _0x4024=['token','authType','remoteUri','substring','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','includes','position','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','send','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','includeAll','findAll','catch','params','keys','length','include','options','find','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','Subjects','channel','getDescriptions','ZendeskField','getFields','username','password'];(function(_0x5bad83,_0x5c216d){var _0x1bddfd=function(_0x236e94){while(--_0x236e94){_0x5bad83['push'](_0x5bad83['shift']());}};_0x1bddfd(++_0x5c216d);}(_0x4024,0x89));var _0x4402=function(_0x3425ac,_0x58c805){_0x3425ac=_0x3425ac-0x0;var _0x28aafc=_0x4024[_0x3425ac];return _0x28aafc;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];var integrations=require(_0x4402('0x13'));function respondWithStatusCode(_0x4c9032,_0x7e4475){_0x7e4475=_0x7e4475||0xcc;return function(_0x34d952){if(_0x34d952){return _0x4c9032[_0x4402('0x14')](_0x7e4475);}return _0x4c9032[_0x4402('0x15')](_0x7e4475)[_0x4402('0x16')]();};}function respondWithResult(_0x31710c,_0x18c7a8){_0x18c7a8=_0x18c7a8||0xc8;return function(_0x3c7dd2){if(_0x3c7dd2){return _0x31710c[_0x4402('0x15')](_0x18c7a8)[_0x4402('0x17')](_0x3c7dd2);}};}function respondWithFilteredResult(_0x375166,_0xc03f65){return function(_0x2a2ce8){if(_0x2a2ce8){var _0x19fe7b=typeof _0xc03f65[_0x4402('0x18')]===_0x4402('0x19')&&typeof _0xc03f65[_0x4402('0x1a')]===_0x4402('0x19');var _0x186c22=_0x2a2ce8[_0x4402('0x1b')];var _0x5b127f=_0x19fe7b?0x0:_0xc03f65['offset'];var _0x663ab7=_0x19fe7b?_0x2a2ce8[_0x4402('0x1b')]:_0xc03f65['offset']+_0xc03f65[_0x4402('0x1a')];var _0x192855;if(_0x663ab7>=_0x186c22){_0x663ab7=_0x186c22;_0x192855=0xc8;}else{_0x192855=0xce;}_0x375166['status'](_0x192855);return _0x375166[_0x4402('0x1c')]('Content-Range',_0x5b127f+'-'+_0x663ab7+'/'+_0x186c22)['json'](_0x2a2ce8);}return null;};}function patchUpdates(_0x1b9599){return function(_0x46a1ad){try{jsonpatch[_0x4402('0x1d')](_0x46a1ad,_0x1b9599,!![]);}catch(_0x49bc21){return BPromise[_0x4402('0x1e')](_0x49bc21);}return _0x46a1ad['save']();};}function saveUpdates(_0x47ab54,_0x6f1f72){return function(_0x275c70){if(_0x275c70){return _0x275c70[_0x4402('0x1f')](_0x47ab54)[_0x4402('0x20')](function(_0x258d10){return _0x258d10;});}return null;};}function removeEntity(_0x2e6fee,_0x289a3e){return function(_0x6b1fc5){if(_0x6b1fc5){return _0x6b1fc5[_0x4402('0x21')]()['then'](function(){_0x2e6fee[_0x4402('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3733cd,_0x5ab28d){return function(_0x29f56b){if(!_0x29f56b){_0x3733cd[_0x4402('0x14')](0x194);}return _0x29f56b;};}function handleError(_0x5a43d0,_0x15c19f){_0x15c19f=_0x15c19f||0x1f4;return function(_0x4e9cb5){logger['error'](_0x4e9cb5[_0x4402('0x22')]);if(_0x4e9cb5[_0x4402('0x23')]){delete _0x4e9cb5[_0x4402('0x23')];}_0x5a43d0[_0x4402('0x15')](_0x15c19f)[_0x4402('0x24')](_0x4e9cb5);};}exports['index']=function(_0x41de44,_0x52e625){var _0x71da2f={},_0x1e2340={},_0x42dd32={'count':0x0,'rows':[]};var _0x48d20d=_[_0x4402('0x25')](db[_0x4402('0x26')][_0x4402('0x27')],function(_0x3f4bcb){return{'name':_0x3f4bcb[_0x4402('0x28')],'type':_0x3f4bcb[_0x4402('0x29')][_0x4402('0x2a')]};});_0x1e2340[_0x4402('0x2b')]=_[_0x4402('0x25')](_0x48d20d,_0x4402('0x23'));_0x1e2340[_0x4402('0x2c')]=_['keys'](_0x41de44[_0x4402('0x2c')]);_0x1e2340['filters']=_[_0x4402('0x2d')](_0x1e2340['model'],_0x1e2340[_0x4402('0x2c')]);_0x71da2f[_0x4402('0x2e')]=_[_0x4402('0x2d')](_0x1e2340[_0x4402('0x2b')],qs[_0x4402('0x2f')](_0x41de44['query'][_0x4402('0x2f')]));_0x71da2f[_0x4402('0x2e')]=_0x71da2f[_0x4402('0x2e')]['length']?_0x71da2f[_0x4402('0x2e')]:_0x1e2340[_0x4402('0x2b')];if(!_0x41de44['query'][_0x4402('0x30')](_0x4402('0x31'))){_0x71da2f[_0x4402('0x1a')]=qs[_0x4402('0x1a')](_0x41de44[_0x4402('0x2c')][_0x4402('0x1a')]);_0x71da2f[_0x4402('0x18')]=qs[_0x4402('0x18')](_0x41de44[_0x4402('0x2c')]['offset']);}_0x71da2f[_0x4402('0x32')]=qs[_0x4402('0x33')](_0x41de44[_0x4402('0x2c')]['sort']);_0x71da2f[_0x4402('0x34')]=qs[_0x4402('0x35')](_['pick'](_0x41de44['query'],_0x1e2340[_0x4402('0x35')]),_0x48d20d);if(_0x41de44[_0x4402('0x2c')][_0x4402('0x36')]){_0x71da2f[_0x4402('0x34')]=_['merge'](_0x71da2f['where'],{'$or':_['map'](_0x48d20d,function(_0x3a5e62){if(_0x3a5e62[_0x4402('0x29')]!==_0x4402('0x37')){var _0x3fd8ce={};_0x3fd8ce[_0x3a5e62['name']]={'$like':'%'+_0x41de44[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x3fd8ce;}})});}_0x71da2f=_[_0x4402('0x38')]({},_0x71da2f,_0x41de44['options']);var _0x2b92b7={'where':_0x71da2f['where']};return db[_0x4402('0x26')][_0x4402('0x1b')](_0x2b92b7)['then'](function(_0x16ef2e){_0x42dd32['count']=_0x16ef2e;if(_0x41de44[_0x4402('0x2c')][_0x4402('0x39')]){_0x71da2f['include']=[{'all':!![]}];}return db[_0x4402('0x26')][_0x4402('0x3a')](_0x71da2f);})[_0x4402('0x20')](function(_0x23c43a){_0x42dd32['rows']=_0x23c43a;return _0x42dd32;})['then'](respondWithFilteredResult(_0x52e625,_0x71da2f))[_0x4402('0x3b')](handleError(_0x52e625,null));};exports['show']=function(_0x3a589b,_0x2a6d78){var _0xb9cf85={'raw':![],'where':{'id':_0x3a589b[_0x4402('0x3c')]['id']}},_0x2e2391={};_0x2e2391[_0x4402('0x2b')]=_[_0x4402('0x3d')](db[_0x4402('0x26')][_0x4402('0x27')]);_0x2e2391[_0x4402('0x2c')]=_['keys'](_0x3a589b[_0x4402('0x2c')]);_0x2e2391[_0x4402('0x35')]=_['intersection'](_0x2e2391[_0x4402('0x2b')],_0x2e2391[_0x4402('0x2c')]);_0xb9cf85['attributes']=_[_0x4402('0x2d')](_0x2e2391[_0x4402('0x2b')],qs[_0x4402('0x2f')](_0x3a589b[_0x4402('0x2c')][_0x4402('0x2f')]));_0xb9cf85['attributes']=_0xb9cf85[_0x4402('0x2e')][_0x4402('0x3e')]?_0xb9cf85[_0x4402('0x2e')]:_0x2e2391[_0x4402('0x2b')];if(_0x3a589b[_0x4402('0x2c')][_0x4402('0x39')]){_0xb9cf85[_0x4402('0x3f')]=[{'all':!![]}];}_0xb9cf85=_[_0x4402('0x38')]({},_0xb9cf85,_0x3a589b[_0x4402('0x40')]);return db[_0x4402('0x26')][_0x4402('0x41')](_0xb9cf85)['then'](handleEntityNotFound(_0x2a6d78,null))[_0x4402('0x20')](respondWithResult(_0x2a6d78,null))['catch'](handleError(_0x2a6d78,null));};exports[_0x4402('0x42')]=function(_0x34ce00,_0x54e67a){return db[_0x4402('0x26')][_0x4402('0x42')](_0x34ce00[_0x4402('0x43')],{})[_0x4402('0x20')](respondWithResult(_0x54e67a,0xc9))[_0x4402('0x3b')](handleError(_0x54e67a,null));};exports[_0x4402('0x1f')]=function(_0x5b094b,_0xd0c9a5){if(_0x5b094b[_0x4402('0x43')]['id']){delete _0x5b094b[_0x4402('0x43')]['id'];}return db[_0x4402('0x26')][_0x4402('0x41')]({'where':{'id':_0x5b094b[_0x4402('0x3c')]['id']}})[_0x4402('0x20')](handleEntityNotFound(_0xd0c9a5,null))[_0x4402('0x20')](saveUpdates(_0x5b094b[_0x4402('0x43')],null))['then'](respondWithResult(_0xd0c9a5,null))['catch'](handleError(_0xd0c9a5,null));};exports['destroy']=function(_0x4c2d2e,_0x257010){return db[_0x4402('0x26')][_0x4402('0x41')]({'where':{'id':_0x4c2d2e[_0x4402('0x3c')]['id']}})['then'](handleEntityNotFound(_0x257010,null))[_0x4402('0x20')](removeEntity(_0x257010,null))[_0x4402('0x3b')](handleError(_0x257010,null));};exports[_0x4402('0x44')]=function(_0x2a4ea7,_0x196b2f,_0x352898){var _0x12f1fa={};var _0x53d306={};var _0x325b20;var _0x2a8085;return db[_0x4402('0x26')][_0x4402('0x45')]({'where':{'id':_0x2a4ea7[_0x4402('0x3c')]['id']}})[_0x4402('0x20')](handleEntityNotFound(_0x196b2f,null))['then'](function(_0xe8a8e9){if(_0xe8a8e9){_0x325b20=_0xe8a8e9;_0x53d306[_0x4402('0x2b')]=_[_0x4402('0x3d')](db[_0x4402('0x46')][_0x4402('0x27')]);_0x53d306[_0x4402('0x2c')]=_[_0x4402('0x3d')](_0x2a4ea7['query']);_0x53d306['filters']=_[_0x4402('0x2d')](_0x53d306[_0x4402('0x2b')],_0x53d306[_0x4402('0x2c')]);_0x12f1fa['attributes']=_['intersection'](_0x53d306[_0x4402('0x2b')],qs[_0x4402('0x2f')](_0x2a4ea7[_0x4402('0x2c')][_0x4402('0x2f')]));_0x12f1fa[_0x4402('0x2e')]=_0x12f1fa[_0x4402('0x2e')][_0x4402('0x3e')]?_0x12f1fa[_0x4402('0x2e')]:_0x53d306[_0x4402('0x2b')];_0x12f1fa[_0x4402('0x32')]=qs[_0x4402('0x33')](_0x2a4ea7[_0x4402('0x2c')][_0x4402('0x33')]);_0x12f1fa['where']=qs[_0x4402('0x35')](_['pick'](_0x2a4ea7[_0x4402('0x2c')],_0x53d306['filters']));if(_0x2a4ea7[_0x4402('0x2c')][_0x4402('0x36')]){_0x12f1fa[_0x4402('0x34')]=_[_0x4402('0x38')](_0x12f1fa[_0x4402('0x34')],{'$or':_[_0x4402('0x25')](_0x12f1fa['attributes'],function(_0xe425d0){var _0x25c1fc={};_0x25c1fc[_0xe425d0]={'$like':'%'+_0x2a4ea7[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x25c1fc;})});}_0x12f1fa=_[_0x4402('0x38')]({},_0x12f1fa,_0x2a4ea7['options']);return _0x325b20[_0x4402('0x44')](_0x12f1fa);}})[_0x4402('0x20')](function(_0x474b04){if(_0x474b04){_0x2a8085=_0x474b04[_0x4402('0x3e')];if(!_0x2a4ea7[_0x4402('0x2c')][_0x4402('0x30')](_0x4402('0x31'))){_0x12f1fa[_0x4402('0x1a')]=qs['limit'](_0x2a4ea7[_0x4402('0x2c')][_0x4402('0x1a')]);_0x12f1fa['offset']=qs[_0x4402('0x18')](_0x2a4ea7[_0x4402('0x2c')]['offset']);}return _0x325b20['getConfigurations'](_0x12f1fa);}})[_0x4402('0x20')](function(_0x1746c6){if(_0x1746c6){return _0x1746c6?{'count':_0x2a8085,'rows':_0x1746c6}:null;}})[_0x4402('0x20')](respondWithResult(_0x196b2f,null))['catch'](handleError(_0x196b2f,null));};exports[_0x4402('0x47')]=function(_0x12f3ac,_0x30e49b,_0x55f261){if(_0x12f3ac[_0x4402('0x43')]['id']){delete _0x12f3ac[_0x4402('0x43')]['id'];}return db[_0x4402('0x26')]['findOne']({'where':{'id':_0x12f3ac[_0x4402('0x3c')]['id']}})[_0x4402('0x20')](handleEntityNotFound(_0x30e49b,null))['then'](function(_0x5cef56){if(_0x5cef56){_0x12f3ac[_0x4402('0x43')]['AccountId']=_0x5cef56['id'];_0x12f3ac[_0x4402('0x43')][_0x4402('0x48')]=integrations['getSubjects'](_0x12f3ac['body'][_0x4402('0x49')],_0x12f3ac[_0x4402('0x43')][_0x4402('0x29')]);_0x12f3ac[_0x4402('0x43')]['Descriptions']=integrations[_0x4402('0x4a')](_0x12f3ac[_0x4402('0x43')][_0x4402('0x49')],_0x12f3ac[_0x4402('0x43')][_0x4402('0x29')]);return db[_0x4402('0x46')][_0x4402('0x42')](_0x12f3ac['body'],{'include':[{'model':db[_0x4402('0x4b')],'as':_0x4402('0x48')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x4402('0x20')](respondWithResult(_0x30e49b,null))['catch'](handleError(_0x30e49b,null));};exports[_0x4402('0x4c')]=function(_0x586689,_0xc2ac06,_0x10b89a){var _0x22260b='';return db[_0x4402('0x26')][_0x4402('0x45')]({'where':{'id':_0x586689[_0x4402('0x3c')]['id']},'attributes':['id',_0x4402('0x4d'),_0x4402('0x4e'),_0x4402('0x4f'),_0x4402('0x50'),_0x4402('0x51')]})[_0x4402('0x20')](handleEntityNotFound(_0xc2ac06,null))[_0x4402('0x20')](function(_0xcf5c20){if(_0xcf5c20){_0x22260b=_0xcf5c20[_0x4402('0x51')];var _0x1d6af2=_0x22260b['slice'](-0x1);if(_0x1d6af2==='/'){_0x22260b=_0x22260b[_0x4402('0x52')](0x0,_0x22260b[_0x4402('0x53')](_0x1d6af2));}var _0xccb64f={'method':'GET','uri':util[_0x4402('0x54')]('%s/%s',_0x22260b,_0x4402('0x55')),'json':!![]};switch(_0xcf5c20[_0x4402('0x50')]){case _0x4402('0x4e'):_0xccb64f[_0x4402('0x56')]={'Authorization':util['format'](_0x4402('0x57'),new Buffer(util['format'](_0x4402('0x58'),_0xcf5c20[_0x4402('0x4d')],_0xcf5c20[_0x4402('0x4e')]))['toString'](_0x4402('0x59')))};break;case'token':_0xccb64f[_0x4402('0x56')]={'Authorization':util[_0x4402('0x54')](_0x4402('0x57'),new Buffer(util[_0x4402('0x54')](_0x4402('0x5a'),_0xcf5c20[_0x4402('0x4d')],_0xcf5c20[_0x4402('0x4f')]))[_0x4402('0x5b')](_0x4402('0x59')))};break;default:throw new db['Sequelize'][(_0x4402('0x5c'))](_0x4402('0x5d'));}return rp(_0xccb64f);}})[_0x4402('0x20')](function(_0x221889){if(_0x221889){var _0x4734ef=[_0x4402('0x5e'),_0x4402('0x5f'),_0x4402('0x60'),_0x4402('0x61')];_['remove'](_0x221889[_0x4402('0x55')],function(_0x2a6dc1){return _0x4734ef[_0x4402('0x62')](_0x2a6dc1['type']);});return{'count':_0x221889[_0x4402('0x55')]['length'],'rows':_[_0x4402('0x25')](_0x221889['ticket_fields'],function(_0xc1d540){return{'id':_0xc1d540['id'],'name':_0xc1d540[_0x4402('0x63')]>0x7?_0xc1d540['title']:_0xc1d540[_0x4402('0x29')],'custom':_0xc1d540['position']>0x7?!![]:![],'options':_0xc1d540[_0x4402('0x64')]?_0xc1d540[_0x4402('0x64')]:_0xc1d540['custom_field_options']?_0xc1d540[_0x4402('0x65')]:[]};})};}})[_0x4402('0x20')](respondWithResult(_0xc2ac06,null))['catch'](function(_0x189259){var _0x13c47e=_0x586689['query'][_0x4402('0x66')]?0x1f4:_0x189259[_0x4402('0x67')]||0x1f4;logger[_0x4402('0x68')](_0x4402('0x69'),_0x4402('0x4c'),_0x13c47e,JSON[_0x4402('0x6a')](_0x189259));delete _0x189259[_0x4402('0x23')];if(_0x13c47e===0x191){_0x13c47e=0x190;}_0xc2ac06[_0x4402('0x15')](_0x13c47e)[_0x4402('0x24')](_0x586689[_0x4402('0x2c')][_0x4402('0x66')]?{'message':_0x4402('0x6b'),'statusCode':_0x189259[_0x4402('0x67')]}:_0x189259);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 7c6a9f8..3761764 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 _0x4c5f=['exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes'];(function(_0x4db524,_0x5f324e){var _0x5dd6f4=function(_0x12dc82){while(--_0x12dc82){_0x4db524['push'](_0x4db524['shift']());}};_0x5dd6f4(++_0x5f324e);}(_0x4c5f,0x19a));var _0xf4c5=function(_0x1996cd,_0x18be53){_0x1996cd=_0x1996cd-0x0;var _0x26fb83=_0x4c5f[_0x1996cd];return _0x26fb83;};'use strict';var _=require(_0xf4c5('0x0'));var util=require(_0xf4c5('0x1'));var logger=require(_0xf4c5('0x2'))(_0xf4c5('0x3'));var moment=require(_0xf4c5('0x4'));var BPromise=require(_0xf4c5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4c5('0x6'));var rimraf=require(_0xf4c5('0x7'));var config=require(_0xf4c5('0x8'));var attributes=require(_0xf4c5('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xf4c5('0xa')]=function(_0x2161a8,_0x52906c){return _0x2161a8[_0xf4c5('0xb')](_0xf4c5('0xc'),attributes,{'tableName':_0xf4c5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c8f=['define','util','../../config/logger','api','moment','request-promise','path','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x2b8722,_0x50d540){var _0x20c180=function(_0x595b40){while(--_0x595b40){_0x2b8722['push'](_0x2b8722['shift']());}};_0x20c180(++_0x50d540);}(_0x9c8f,0xc9));var _0xf9c8=function(_0x163742,_0x467e36){_0x163742=_0x163742-0x0;var _0x1152ac=_0x9c8f[_0x163742];return _0x1152ac;};'use strict';var _=require('lodash');var util=require(_0xf9c8('0x0'));var logger=require(_0xf9c8('0x1'))(_0xf9c8('0x2'));var moment=require(_0xf9c8('0x3'));var BPromise=require('bluebird');var rp=require(_0xf9c8('0x4'));var fs=require('fs');var path=require(_0xf9c8('0x5'));var rimraf=require('rimraf');var config=require(_0xf9c8('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xf9c8('0x7'));module[_0xf9c8('0x8')]=function(_0x37a171,_0x109d30){return _0x37a171[_0xf9c8('0x9')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','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 adc4363..ada33fa 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 _0x2b1b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ZendeskAccount','findAll','options','raw','where','limit','include','model','attributes','map','then','GetZendeskAccount','ShowZendeskAccount','find','lodash','util','moment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2b1b,0xe7));var _0xb2b1=function(_0x4dac39,_0x288cb7){_0x4dac39=_0x4dac39-0x0;var _0x550acf=_0x2b1b[_0x4dac39];return _0x550acf;};'use strict';var _=require(_0xb2b1('0x0'));var util=require(_0xb2b1('0x1'));var moment=require(_0xb2b1('0x2'));var BPromise=require(_0xb2b1('0x3'));var rs=require(_0xb2b1('0x4'));var fs=require('fs');var Redis=require(_0xb2b1('0x5'));var db=require(_0xb2b1('0x6'))['db'];var utils=require(_0xb2b1('0x7'));var logger=require(_0xb2b1('0x8'))(_0xb2b1('0x9'));var config=require(_0xb2b1('0xa'));var jayson=require(_0xb2b1('0xb'));var client=jayson['client'][_0xb2b1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3eb47c,_0x59f3b7,_0x5289d2){return new BPromise(function(_0x51088b,_0x5d641d){return client[_0xb2b1('0xd')](_0x3eb47c,_0x5289d2)['then'](function(_0x3898af){logger[_0xb2b1('0xe')](_0xb2b1('0xf'),_0x59f3b7,_0xb2b1('0x10'));logger[_0xb2b1('0x11')](_0xb2b1('0x12'),_0x59f3b7,_0xb2b1('0x10'),JSON[_0xb2b1('0x13')](_0x3898af));if(_0x3898af[_0xb2b1('0x14')]){if(_0x3898af[_0xb2b1('0x14')][_0xb2b1('0x15')]===0x1f4){logger[_0xb2b1('0x14')]('ZendeskAccount,\x20%s,\x20%s',_0x59f3b7,_0x3898af['error'][_0xb2b1('0x16')]);return _0x5d641d(_0x3898af[_0xb2b1('0x14')]['message']);}logger[_0xb2b1('0x14')](_0xb2b1('0xf'),_0x59f3b7,_0x3898af[_0xb2b1('0x14')][_0xb2b1('0x16')]);return _0x51088b(_0x3898af[_0xb2b1('0x14')][_0xb2b1('0x16')]);}else{logger[_0xb2b1('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x59f3b7,_0xb2b1('0x10'));_0x51088b(_0x3898af[_0xb2b1('0x17')][_0xb2b1('0x16')]);}})[_0xb2b1('0x18')](function(_0x8d0095){logger[_0xb2b1('0x14')](_0xb2b1('0xf'),_0x59f3b7,_0x8d0095);_0x5d641d(_0x8d0095);});});}exports['GetZendeskAccount']=function(_0x16e4ee){var _0x2f2e3f=this;return new Promise(function(_0x210dd8,_0x344d65){return db[_0xb2b1('0x19')][_0xb2b1('0x1a')]({'raw':_0x16e4ee[_0xb2b1('0x1b')]?_0x16e4ee[_0xb2b1('0x1b')][_0xb2b1('0x1c')]===undefined?!![]:![]:!![],'where':_0x16e4ee[_0xb2b1('0x1b')]?_0x16e4ee['options'][_0xb2b1('0x1d')]||null:null,'attributes':_0x16e4ee['options']?_0x16e4ee[_0xb2b1('0x1b')]['attributes']||null:null,'limit':_0x16e4ee[_0xb2b1('0x1b')]?_0x16e4ee[_0xb2b1('0x1b')][_0xb2b1('0x1e')]||null:null,'include':_0x16e4ee['options']?_0x16e4ee['options'][_0xb2b1('0x1f')]?_['map'](_0x16e4ee[_0xb2b1('0x1b')][_0xb2b1('0x1f')],function(_0x5e597){return{'model':db[_0x5e597[_0xb2b1('0x20')]],'as':_0x5e597['as'],'attributes':_0x5e597[_0xb2b1('0x21')],'include':_0x5e597[_0xb2b1('0x1f')]?_[_0xb2b1('0x22')](_0x5e597[_0xb2b1('0x1f')],function(_0x359ca3){return{'model':db[_0x359ca3[_0xb2b1('0x20')]],'as':_0x359ca3['as'],'attributes':_0x359ca3[_0xb2b1('0x21')],'include':_0x359ca3[_0xb2b1('0x1f')]?_[_0xb2b1('0x22')](_0x359ca3[_0xb2b1('0x1f')],function(_0x1cfdb2){return{'model':db[_0x1cfdb2[_0xb2b1('0x20')]],'as':_0x1cfdb2['as'],'attributes':_0x1cfdb2[_0xb2b1('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb2b1('0x23')](function(_0x2cfac2){logger[_0xb2b1('0xe')](_0xb2b1('0x24'),_0x16e4ee);logger[_0xb2b1('0x11')](_0xb2b1('0x24'),_0x16e4ee,JSON[_0xb2b1('0x13')](_0x2cfac2));_0x210dd8(_0x2cfac2);})[_0xb2b1('0x18')](function(_0x2e7776){logger[_0xb2b1('0x14')](_0xb2b1('0x24'),_0x2e7776[_0xb2b1('0x16')],_0x16e4ee);_0x344d65(_0x2f2e3f[_0xb2b1('0x14')](0x1f4,_0x2e7776['message']));});});};exports[_0xb2b1('0x25')]=function(_0x290759){var _0x1ea4f0=this;return new Promise(function(_0xec1ab7,_0x2dff2c){return db[_0xb2b1('0x19')][_0xb2b1('0x26')]({'raw':_0x290759[_0xb2b1('0x1b')]?_0x290759['options']['raw']===undefined?!![]:![]:!![],'where':_0x290759[_0xb2b1('0x1b')]?_0x290759[_0xb2b1('0x1b')][_0xb2b1('0x1d')]||null:null,'attributes':_0x290759[_0xb2b1('0x1b')]?_0x290759[_0xb2b1('0x1b')]['attributes']||null:null,'include':_0x290759[_0xb2b1('0x1b')]?_0x290759[_0xb2b1('0x1b')][_0xb2b1('0x1f')]?_['map'](_0x290759[_0xb2b1('0x1b')][_0xb2b1('0x1f')],function(_0x306223){return{'model':db[_0x306223[_0xb2b1('0x20')]],'as':_0x306223['as'],'attributes':_0x306223[_0xb2b1('0x21')],'include':_0x306223['include']?_[_0xb2b1('0x22')](_0x306223['include'],function(_0x33787){return{'model':db[_0x33787[_0xb2b1('0x20')]],'as':_0x33787['as'],'attributes':_0x33787[_0xb2b1('0x21')],'include':_0x33787[_0xb2b1('0x1f')]?_[_0xb2b1('0x22')](_0x33787['include'],function(_0x3a66ec){return{'model':db[_0x3a66ec[_0xb2b1('0x20')]],'as':_0x3a66ec['as'],'attributes':_0x3a66ec[_0xb2b1('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb2b1('0x23')](function(_0x1d4bd7){logger[_0xb2b1('0xe')](_0xb2b1('0x25'),_0x290759);logger[_0xb2b1('0x11')](_0xb2b1('0x25'),_0x290759,JSON[_0xb2b1('0x13')](_0x1d4bd7));_0xec1ab7(_0x1d4bd7);})[_0xb2b1('0x18')](function(_0x47c7f0){logger[_0xb2b1('0x14')](_0xb2b1('0x25'),_0x47c7f0[_0xb2b1('0x16')],_0x290759);_0x2dff2c(_0x1ea4f0[_0xb2b1('0x14')](0x1f4,_0x47c7f0[_0xb2b1('0x16')]));});});}; \ No newline at end of file +var _0xc9cb=['attributes','model','catch','ZendeskAccount','ShowZendeskAccount','debug','lodash','util','randomstring','../../config/utils','rpc','../../config/environment','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetZendeskAccount','findAll','options','raw','where','limit','include','map'];(function(_0x5d99fe,_0x137e66){var _0x373e41=function(_0x453356){while(--_0x453356){_0x5d99fe['push'](_0x5d99fe['shift']());}};_0x373e41(++_0x137e66);}(_0xc9cb,0x199));var _0xbc9c=function(_0x412acc,_0x5138f8){_0x412acc=_0x412acc-0x0;var _0x15c13c=_0xc9cb[_0x412acc];return _0x15c13c;};'use strict';var _=require(_0xbc9c('0x0'));var util=require(_0xbc9c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbc9c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbc9c('0x3'));var logger=require('../../config/logger')(_0xbc9c('0x4'));var config=require(_0xbc9c('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f3ce0,_0x37d248,_0x1aff87){return new BPromise(function(_0x294388,_0x27f9e1){return client[_0xbc9c('0x6')](_0x2f3ce0,_0x1aff87)[_0xbc9c('0x7')](function(_0x5e76a1){logger[_0xbc9c('0x8')](_0xbc9c('0x9'),_0x37d248,_0xbc9c('0xa'));logger['debug'](_0xbc9c('0xb'),_0x37d248,_0xbc9c('0xa'),JSON[_0xbc9c('0xc')](_0x5e76a1));if(_0x5e76a1[_0xbc9c('0xd')]){if(_0x5e76a1[_0xbc9c('0xd')][_0xbc9c('0xe')]===0x1f4){logger[_0xbc9c('0xd')](_0xbc9c('0x9'),_0x37d248,_0x5e76a1[_0xbc9c('0xd')][_0xbc9c('0xf')]);return _0x27f9e1(_0x5e76a1[_0xbc9c('0xd')][_0xbc9c('0xf')]);}logger['error'](_0xbc9c('0x9'),_0x37d248,_0x5e76a1[_0xbc9c('0xd')][_0xbc9c('0xf')]);return _0x294388(_0x5e76a1['error']['message']);}else{logger['info'](_0xbc9c('0x9'),_0x37d248,_0xbc9c('0xa'));_0x294388(_0x5e76a1[_0xbc9c('0x10')][_0xbc9c('0xf')]);}})['catch'](function(_0x5d34d3){logger[_0xbc9c('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x37d248,_0x5d34d3);_0x27f9e1(_0x5d34d3);});});}exports[_0xbc9c('0x11')]=function(_0x198490){var _0x1c1c4f=this;return new Promise(function(_0x2cd7c8,_0x3f7bf4){return db['ZendeskAccount'][_0xbc9c('0x12')]({'raw':_0x198490[_0xbc9c('0x13')]?_0x198490[_0xbc9c('0x13')][_0xbc9c('0x14')]===undefined?!![]:![]:!![],'where':_0x198490[_0xbc9c('0x13')]?_0x198490[_0xbc9c('0x13')][_0xbc9c('0x15')]||null:null,'attributes':_0x198490['options']?_0x198490['options']['attributes']||null:null,'limit':_0x198490[_0xbc9c('0x13')]?_0x198490[_0xbc9c('0x13')][_0xbc9c('0x16')]||null:null,'include':_0x198490[_0xbc9c('0x13')]?_0x198490[_0xbc9c('0x13')][_0xbc9c('0x17')]?_[_0xbc9c('0x18')](_0x198490[_0xbc9c('0x13')][_0xbc9c('0x17')],function(_0x1868a9){return{'model':db[_0x1868a9['model']],'as':_0x1868a9['as'],'attributes':_0x1868a9[_0xbc9c('0x19')],'include':_0x1868a9[_0xbc9c('0x17')]?_[_0xbc9c('0x18')](_0x1868a9['include'],function(_0x35d177){return{'model':db[_0x35d177['model']],'as':_0x35d177['as'],'attributes':_0x35d177['attributes'],'include':_0x35d177[_0xbc9c('0x17')]?_['map'](_0x35d177[_0xbc9c('0x17')],function(_0x1713a2){return{'model':db[_0x1713a2[_0xbc9c('0x1a')]],'as':_0x1713a2['as'],'attributes':_0x1713a2[_0xbc9c('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbc9c('0x7')](function(_0xfc9c31){logger[_0xbc9c('0x8')](_0xbc9c('0x11'),_0x198490);logger['debug'](_0xbc9c('0x11'),_0x198490,JSON[_0xbc9c('0xc')](_0xfc9c31));_0x2cd7c8(_0xfc9c31);})[_0xbc9c('0x1b')](function(_0x5ca9fe){logger[_0xbc9c('0xd')](_0xbc9c('0x11'),_0x5ca9fe[_0xbc9c('0xf')],_0x198490);_0x3f7bf4(_0x1c1c4f[_0xbc9c('0xd')](0x1f4,_0x5ca9fe[_0xbc9c('0xf')]));});});};exports['ShowZendeskAccount']=function(_0x392894){var _0x5a63a2=this;return new Promise(function(_0x399628,_0x4e1377){return db[_0xbc9c('0x1c')]['find']({'raw':_0x392894[_0xbc9c('0x13')]?_0x392894[_0xbc9c('0x13')][_0xbc9c('0x14')]===undefined?!![]:![]:!![],'where':_0x392894['options']?_0x392894[_0xbc9c('0x13')][_0xbc9c('0x15')]||null:null,'attributes':_0x392894[_0xbc9c('0x13')]?_0x392894[_0xbc9c('0x13')][_0xbc9c('0x19')]||null:null,'include':_0x392894['options']?_0x392894[_0xbc9c('0x13')][_0xbc9c('0x17')]?_[_0xbc9c('0x18')](_0x392894[_0xbc9c('0x13')][_0xbc9c('0x17')],function(_0x1a49ff){return{'model':db[_0x1a49ff['model']],'as':_0x1a49ff['as'],'attributes':_0x1a49ff[_0xbc9c('0x19')],'include':_0x1a49ff[_0xbc9c('0x17')]?_[_0xbc9c('0x18')](_0x1a49ff[_0xbc9c('0x17')],function(_0x42b976){return{'model':db[_0x42b976[_0xbc9c('0x1a')]],'as':_0x42b976['as'],'attributes':_0x42b976['attributes'],'include':_0x42b976['include']?_[_0xbc9c('0x18')](_0x42b976[_0xbc9c('0x17')],function(_0x5737c8){return{'model':db[_0x5737c8['model']],'as':_0x5737c8['as'],'attributes':_0x5737c8['attributes']};}):[]};}):[]};}):[]:[]})[_0xbc9c('0x7')](function(_0x5d0079){logger[_0xbc9c('0x8')](_0xbc9c('0x1d'),_0x392894);logger[_0xbc9c('0x1e')]('ShowZendeskAccount',_0x392894,JSON[_0xbc9c('0xc')](_0x5d0079));_0x399628(_0x5d0079);})[_0xbc9c('0x1b')](function(_0xbe4b17){logger['error'](_0xbc9c('0x1d'),_0xbe4b17['message'],_0x392894);_0x4e1377(_0x5a63a2['error'](0x1f4,_0xbe4b17['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 83fa043..9e36b01 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 _0xf4eb=['put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags'];(function(_0x413bc0,_0x17e7aa){var _0x3ccb44=function(_0x230bdb){while(--_0x230bdb){_0x413bc0['push'](_0x413bc0['shift']());}};_0x3ccb44(++_0x17e7aa);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2239d2,_0x4b8bd2){_0x2239d2=_0x2239d2-0x0;var _0x2f73fb=_0xf4eb[_0x2239d2];return _0x2f73fb;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['get']('/:id/descriptions',auth[_0xbf4e('0x6')](),controller['getDescriptions']);router[_0xbf4e('0x5')](_0xbf4e('0xc'),auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0xc'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x10')]);router[_0xbf4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0x12')]);router[_0xbf4e('0x13')](_0xbf4e('0x14'),auth['isAuthenticated'](),controller[_0xbf4e('0x15')]);module[_0xbf4e('0x16')]=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0xf637ee,_0x18ee7f){var _0x515341=function(_0xcd7cba){while(--_0xcd7cba){_0xf637ee['push'](_0xf637ee['shift']());}};_0x515341(++_0x18ee7f);}(_0xe706,0xa3));var _0x6e70=function(_0x96baa6,_0x113c83){_0x96baa6=_0x96baa6-0x0;var _0x14c52b=_0xe706[_0x96baa6];return _0x14c52b;};'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('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index a94d698..4bc5625 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 _0x37d4=['exports','STRING'];(function(_0x282ccc,_0x5d66a1){var _0x27c2dd=function(_0x58431a){while(--_0x58431a){_0x282ccc['push'](_0x282ccc['shift']());}};_0x27c2dd(++_0x5d66a1);}(_0x37d4,0x174));var _0x437d=function(_0x45d2b9,_0x2d11d5){_0x45d2b9=_0x45d2b9-0x0;var _0x5f1d31=_0x37d4[_0x45d2b9];return _0x5f1d31;};'use strict';var Sequelize=require('sequelize');module[_0x437d('0x0')]={'name':{'type':Sequelize[_0x437d('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x04c2=['exports','STRING','sequelize'];(function(_0x352fc9,_0x59fadc){var _0x36b574=function(_0x3a451f){while(--_0x3a451f){_0x352fc9['push'](_0x352fc9['shift']());}};_0x36b574(++_0x59fadc);}(_0x04c2,0xb0));var _0x204c=function(_0x3ff893,_0x53e2bd){_0x3ff893=_0x3ff893-0x0;var _0x246d70=_0x04c2[_0x3ff893];return _0x246d70;};'use strict';var Sequelize=require(_0x204c('0x0'));module[_0x204c('0x1')]={'name':{'type':Sequelize[_0x204c('0x2')]},'description':{'type':Sequelize[_0x204c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 6f98254..8d623d6 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 _0x609f=['length','includeAll','create','body','find','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','setTags','ids','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','error','stack','name','send','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','params'];(function(_0x34d348,_0x47bce7){var _0x2c8693=function(_0x5a59b6){while(--_0x5a59b6){_0x34d348['push'](_0x34d348['shift']());}};_0x2c8693(++_0x47bce7);}(_0x609f,0xfa));var _0xf609=function(_0x402282,_0x615de3){_0x402282=_0x402282-0x0;var _0x4f65af=_0x609f[_0x402282];return _0x4f65af;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf609('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf609('0x1'));var rp=require(_0xf609('0x2'));var moment=require('moment');var BPromise=require(_0xf609('0x3'));var Mustache=require(_0xf609('0x4'));var util=require(_0xf609('0x5'));var path=require(_0xf609('0x6'));var sox=require('sox');var csv=require(_0xf609('0x7'));var ejs=require(_0xf609('0x8'));var fs=require('fs');var fs_extra=require(_0xf609('0x9'));var _=require(_0xf609('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf609('0xb'));var deskjs=require(_0xf609('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf609('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf609('0xe'));var qs=require(_0xf609('0xf'));var as=require(_0xf609('0x10'));var hardwareService=require(_0xf609('0x11'));var logger=require('../../config/logger')(_0xf609('0x12'));var utils=require('../../config/utils');var config=require(_0xf609('0x13'));var licenseUtil=require(_0xf609('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x118b7e,_0x47966b){_0x47966b=_0x47966b||0xcc;return function(_0x1a4350){if(_0x1a4350){return _0x118b7e[_0xf609('0x15')](_0x47966b);}return _0x118b7e[_0xf609('0x16')](_0x47966b)[_0xf609('0x17')]();};}function respondWithResult(_0xfb6623,_0x31de00){_0x31de00=_0x31de00||0xc8;return function(_0x3e7a14){if(_0x3e7a14){return _0xfb6623['status'](_0x31de00)[_0xf609('0x18')](_0x3e7a14);}};}function respondWithFilteredResult(_0x265629,_0x145a99){return function(_0x4cf00b){if(_0x4cf00b){var _0x45fd29=typeof _0x145a99['offset']===_0xf609('0x19')&&typeof _0x145a99[_0xf609('0x1a')]===_0xf609('0x19');var _0x52ed25=_0x4cf00b[_0xf609('0x1b')];var _0x32f289=_0x45fd29?0x0:_0x145a99[_0xf609('0x1c')];var _0x3b8ada=_0x45fd29?_0x4cf00b['count']:_0x145a99[_0xf609('0x1c')]+_0x145a99['limit'];var _0x2d468d;if(_0x3b8ada>=_0x52ed25){_0x3b8ada=_0x52ed25;_0x2d468d=0xc8;}else{_0x2d468d=0xce;}_0x265629['status'](_0x2d468d);return _0x265629[_0xf609('0x1d')]('Content-Range',_0x32f289+'-'+_0x3b8ada+'/'+_0x52ed25)[_0xf609('0x18')](_0x4cf00b);}return null;};}function patchUpdates(_0x43b864){return function(_0x5ce00a){try{jsonpatch[_0xf609('0x1e')](_0x5ce00a,_0x43b864,!![]);}catch(_0x469e4a){return BPromise['reject'](_0x469e4a);}return _0x5ce00a[_0xf609('0x1f')]();};}function saveUpdates(_0x1a509c,_0xf78ff9){return function(_0x378395){if(_0x378395){return _0x378395[_0xf609('0x20')](_0x1a509c)[_0xf609('0x21')](function(_0x298e9f){return _0x298e9f;});}return null;};}function removeEntity(_0x256284,_0x2f898c){return function(_0x123c96){if(_0x123c96){return _0x123c96[_0xf609('0x22')]()[_0xf609('0x21')](function(){_0x256284[_0xf609('0x16')](0xcc)[_0xf609('0x17')]();});}};}function handleEntityNotFound(_0x56efd2,_0x192241){return function(_0xeb029f){if(!_0xeb029f){_0x56efd2[_0xf609('0x15')](0x194);}return _0xeb029f;};}function handleError(_0x247ec4,_0x4e7003){_0x4e7003=_0x4e7003||0x1f4;return function(_0x3b7012){logger[_0xf609('0x23')](_0x3b7012[_0xf609('0x24')]);if(_0x3b7012[_0xf609('0x25')]){delete _0x3b7012[_0xf609('0x25')];}_0x247ec4[_0xf609('0x16')](_0x4e7003)[_0xf609('0x26')](_0x3b7012);};}exports['index']=function(_0x1b09b9,_0x2288af){var _0x142a62={},_0xa00e8d={},_0x274846={'count':0x0,'rows':[]};var _0x12ba78=_[_0xf609('0x27')](db[_0xf609('0x28')][_0xf609('0x29')],function(_0x59bbe9){return{'name':_0x59bbe9[_0xf609('0x2a')],'type':_0x59bbe9[_0xf609('0x2b')][_0xf609('0x2c')]};});_0xa00e8d[_0xf609('0x2d')]=_[_0xf609('0x27')](_0x12ba78,'name');_0xa00e8d[_0xf609('0x2e')]=_[_0xf609('0x2f')](_0x1b09b9['query']);_0xa00e8d[_0xf609('0x30')]=_[_0xf609('0x31')](_0xa00e8d[_0xf609('0x2d')],_0xa00e8d['query']);_0x142a62['attributes']=_[_0xf609('0x31')](_0xa00e8d[_0xf609('0x2d')],qs['fields'](_0x1b09b9[_0xf609('0x2e')][_0xf609('0x32')]));_0x142a62[_0xf609('0x33')]=_0x142a62[_0xf609('0x33')]['length']?_0x142a62[_0xf609('0x33')]:_0xa00e8d[_0xf609('0x2d')];if(!_0x1b09b9[_0xf609('0x2e')][_0xf609('0x34')](_0xf609('0x35'))){_0x142a62['limit']=qs[_0xf609('0x1a')](_0x1b09b9[_0xf609('0x2e')][_0xf609('0x1a')]);_0x142a62[_0xf609('0x1c')]=qs[_0xf609('0x1c')](_0x1b09b9[_0xf609('0x2e')][_0xf609('0x1c')]);}_0x142a62[_0xf609('0x36')]=qs[_0xf609('0x37')](_0x1b09b9[_0xf609('0x2e')][_0xf609('0x37')]);_0x142a62[_0xf609('0x38')]=qs[_0xf609('0x30')](_[_0xf609('0x39')](_0x1b09b9[_0xf609('0x2e')],_0xa00e8d[_0xf609('0x30')]),_0x12ba78);if(_0x1b09b9[_0xf609('0x2e')][_0xf609('0x3a')]){_0x142a62[_0xf609('0x38')]=_[_0xf609('0x3b')](_0x142a62['where'],{'$or':_[_0xf609('0x27')](_0x12ba78,function(_0x43ee09){if(_0x43ee09[_0xf609('0x2b')]!==_0xf609('0x3c')){var _0x465743={};_0x465743[_0x43ee09[_0xf609('0x25')]]={'$like':'%'+_0x1b09b9[_0xf609('0x2e')]['filter']+'%'};return _0x465743;}})});}_0x142a62=_[_0xf609('0x3b')]({},_0x142a62,_0x1b09b9[_0xf609('0x3d')]);var _0x5e86cb={'where':_0x142a62[_0xf609('0x38')]};return db[_0xf609('0x28')][_0xf609('0x1b')](_0x5e86cb)[_0xf609('0x21')](function(_0x1621c){_0x274846[_0xf609('0x1b')]=_0x1621c;if(_0x1b09b9[_0xf609('0x2e')]['includeAll']){_0x142a62[_0xf609('0x3e')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x142a62);})[_0xf609('0x21')](function(_0x231a37){_0x274846['rows']=_0x231a37;return _0x274846;})[_0xf609('0x21')](respondWithFilteredResult(_0x2288af,_0x142a62))[_0xf609('0x3f')](handleError(_0x2288af,null));};exports[_0xf609('0x40')]=function(_0x277663,_0x409655){var _0x1a78c0={'raw':![],'where':{'id':_0x277663[_0xf609('0x41')]['id']}},_0x4ae78b={};_0x4ae78b[_0xf609('0x2d')]=_[_0xf609('0x2f')](db[_0xf609('0x28')][_0xf609('0x29')]);_0x4ae78b[_0xf609('0x2e')]=_['keys'](_0x277663[_0xf609('0x2e')]);_0x4ae78b[_0xf609('0x30')]=_[_0xf609('0x31')](_0x4ae78b[_0xf609('0x2d')],_0x4ae78b[_0xf609('0x2e')]);_0x1a78c0['attributes']=_[_0xf609('0x31')](_0x4ae78b['model'],qs[_0xf609('0x32')](_0x277663[_0xf609('0x2e')]['fields']));_0x1a78c0[_0xf609('0x33')]=_0x1a78c0[_0xf609('0x33')][_0xf609('0x42')]?_0x1a78c0[_0xf609('0x33')]:_0x4ae78b[_0xf609('0x2d')];if(_0x277663[_0xf609('0x2e')][_0xf609('0x43')]){_0x1a78c0[_0xf609('0x3e')]=[{'all':!![]}];}_0x1a78c0=_[_0xf609('0x3b')]({},_0x1a78c0,_0x277663[_0xf609('0x3d')]);return db['ZendeskConfiguration']['find'](_0x1a78c0)[_0xf609('0x21')](handleEntityNotFound(_0x409655,null))[_0xf609('0x21')](respondWithResult(_0x409655,null))['catch'](handleError(_0x409655,null));};exports[_0xf609('0x44')]=function(_0x452cdb,_0x587a15){return db['ZendeskConfiguration'][_0xf609('0x44')](_0x452cdb[_0xf609('0x45')],{})['then'](respondWithResult(_0x587a15,0xc9))['catch'](handleError(_0x587a15,null));};exports[_0xf609('0x20')]=function(_0xdb479d,_0x3ef2bf){if(_0xdb479d[_0xf609('0x45')]['id']){delete _0xdb479d['body']['id'];}return db[_0xf609('0x28')][_0xf609('0x46')]({'where':{'id':_0xdb479d[_0xf609('0x41')]['id']}})[_0xf609('0x21')](handleEntityNotFound(_0x3ef2bf,null))[_0xf609('0x21')](saveUpdates(_0xdb479d['body'],null))[_0xf609('0x21')](respondWithResult(_0x3ef2bf,null))['catch'](handleError(_0x3ef2bf,null));};exports[_0xf609('0x22')]=function(_0x32a0ff,_0x204917){return db[_0xf609('0x28')]['find']({'where':{'id':_0x32a0ff[_0xf609('0x41')]['id']}})[_0xf609('0x21')](handleEntityNotFound(_0x204917,null))['then'](removeEntity(_0x204917,null))['catch'](handleError(_0x204917,null));};exports[_0xf609('0x47')]=function(_0x17e898,_0x40c0a1,_0x3158c1){var _0x1f252b={};var _0x5ee63a={};var _0x59b0fc;var _0x239650;return db[_0xf609('0x28')][_0xf609('0x48')]({'where':{'id':_0x17e898[_0xf609('0x41')]['id']}})[_0xf609('0x21')](handleEntityNotFound(_0x40c0a1,null))[_0xf609('0x21')](function(_0x54efb6){if(_0x54efb6){_0x59b0fc=_0x54efb6;_0x5ee63a['model']=_[_0xf609('0x2f')](db[_0xf609('0x49')][_0xf609('0x29')]);_0x5ee63a['query']=_[_0xf609('0x2f')](_0x17e898['query']);_0x5ee63a['filters']=_[_0xf609('0x31')](_0x5ee63a['model'],_0x5ee63a[_0xf609('0x2e')]);_0x1f252b[_0xf609('0x33')]=_[_0xf609('0x31')](_0x5ee63a['model'],qs['fields'](_0x17e898['query'][_0xf609('0x32')]));_0x1f252b[_0xf609('0x33')]=_0x1f252b[_0xf609('0x33')][_0xf609('0x42')]?_0x1f252b[_0xf609('0x33')]:_0x5ee63a['model'];_0x1f252b[_0xf609('0x36')]=qs[_0xf609('0x37')](_0x17e898['query'][_0xf609('0x37')]);_0x1f252b[_0xf609('0x38')]=qs[_0xf609('0x30')](_[_0xf609('0x39')](_0x17e898[_0xf609('0x2e')],_0x5ee63a['filters']));if(_0x17e898[_0xf609('0x2e')]['filter']){_0x1f252b[_0xf609('0x38')]=_[_0xf609('0x3b')](_0x1f252b['where'],{'$or':_[_0xf609('0x27')](_0x1f252b[_0xf609('0x33')],function(_0x392d5c){var _0x2c49a0={};_0x2c49a0[_0x392d5c]={'$like':'%'+_0x17e898[_0xf609('0x2e')][_0xf609('0x3a')]+'%'};return _0x2c49a0;})});}_0x1f252b=_['merge']({},_0x1f252b,_0x17e898[_0xf609('0x3d')]);return _0x59b0fc[_0xf609('0x47')](_0x1f252b);}})[_0xf609('0x21')](function(_0x333ef2){if(_0x333ef2){_0x239650=_0x333ef2[_0xf609('0x42')];if(!_0x17e898[_0xf609('0x2e')][_0xf609('0x34')](_0xf609('0x35'))){_0x1f252b[_0xf609('0x1a')]=qs[_0xf609('0x1a')](_0x17e898[_0xf609('0x2e')][_0xf609('0x1a')]);_0x1f252b[_0xf609('0x1c')]=qs[_0xf609('0x1c')](_0x17e898[_0xf609('0x2e')][_0xf609('0x1c')]);}return _0x59b0fc['getFields'](_0x1f252b);}})['then'](function(_0x5b8a52){if(_0x5b8a52){return _0x5b8a52?{'count':_0x239650,'rows':_0x5b8a52}:null;}})['then'](respondWithResult(_0x40c0a1,null))[_0xf609('0x3f')](handleError(_0x40c0a1,null));};exports[_0xf609('0x4a')]=function(_0x3f278a,_0x3c97ff,_0x1bfeaa){var _0x176465={};var _0x1afc15={};var _0x2528d0;var _0x41db4e;return db[_0xf609('0x28')][_0xf609('0x48')]({'where':{'id':_0x3f278a[_0xf609('0x41')]['id']}})[_0xf609('0x21')](handleEntityNotFound(_0x3c97ff,null))['then'](function(_0x479314){if(_0x479314){_0x2528d0=_0x479314;_0x1afc15[_0xf609('0x2d')]=_[_0xf609('0x2f')](db[_0xf609('0x49')][_0xf609('0x29')]);_0x1afc15[_0xf609('0x2e')]=_[_0xf609('0x2f')](_0x3f278a[_0xf609('0x2e')]);_0x1afc15[_0xf609('0x30')]=_[_0xf609('0x31')](_0x1afc15[_0xf609('0x2d')],_0x1afc15['query']);_0x176465[_0xf609('0x33')]=_[_0xf609('0x31')](_0x1afc15[_0xf609('0x2d')],qs['fields'](_0x3f278a[_0xf609('0x2e')][_0xf609('0x32')]));_0x176465['attributes']=_0x176465['attributes'][_0xf609('0x42')]?_0x176465[_0xf609('0x33')]:_0x1afc15['model'];_0x176465[_0xf609('0x36')]=qs['sort'](_0x3f278a[_0xf609('0x2e')][_0xf609('0x37')]);_0x176465[_0xf609('0x38')]=qs[_0xf609('0x30')](_[_0xf609('0x39')](_0x3f278a[_0xf609('0x2e')],_0x1afc15['filters']));if(_0x3f278a[_0xf609('0x2e')][_0xf609('0x3a')]){_0x176465[_0xf609('0x38')]=_[_0xf609('0x3b')](_0x176465[_0xf609('0x38')],{'$or':_[_0xf609('0x27')](_0x176465[_0xf609('0x33')],function(_0x300ac3){var _0x46d813={};_0x46d813[_0x300ac3]={'$like':'%'+_0x3f278a[_0xf609('0x2e')]['filter']+'%'};return _0x46d813;})});}_0x176465=_[_0xf609('0x3b')]({},_0x176465,_0x3f278a[_0xf609('0x3d')]);return _0x2528d0['getSubjects'](_0x176465);}})[_0xf609('0x21')](function(_0x283ede){if(_0x283ede){_0x41db4e=_0x283ede[_0xf609('0x42')];if(!_0x3f278a['query']['hasOwnProperty'](_0xf609('0x35'))){_0x176465[_0xf609('0x1a')]=qs[_0xf609('0x1a')](_0x3f278a[_0xf609('0x2e')][_0xf609('0x1a')]);_0x176465['offset']=qs[_0xf609('0x1c')](_0x3f278a[_0xf609('0x2e')][_0xf609('0x1c')]);}return _0x2528d0[_0xf609('0x4a')](_0x176465);}})[_0xf609('0x21')](function(_0x511e73){if(_0x511e73){return _0x511e73?{'count':_0x41db4e,'rows':_0x511e73}:null;}})[_0xf609('0x21')](respondWithResult(_0x3c97ff,null))['catch'](handleError(_0x3c97ff,null));};exports[_0xf609('0x4b')]=function(_0x5acf7f,_0x3253e7,_0x1a6c9d){var _0x5c4d8d={};var _0x1d99bb={};var _0x2fd8b8;var _0x1dcbdc;return db['ZendeskConfiguration'][_0xf609('0x48')]({'where':{'id':_0x5acf7f[_0xf609('0x41')]['id']}})[_0xf609('0x21')](handleEntityNotFound(_0x3253e7,null))[_0xf609('0x21')](function(_0x1fa58d){if(_0x1fa58d){_0x2fd8b8=_0x1fa58d;_0x1d99bb[_0xf609('0x2d')]=_['keys'](db[_0xf609('0x49')]['rawAttributes']);_0x1d99bb['query']=_[_0xf609('0x2f')](_0x5acf7f[_0xf609('0x2e')]);_0x1d99bb[_0xf609('0x30')]=_['intersection'](_0x1d99bb[_0xf609('0x2d')],_0x1d99bb['query']);_0x5c4d8d['attributes']=_[_0xf609('0x31')](_0x1d99bb[_0xf609('0x2d')],qs[_0xf609('0x32')](_0x5acf7f['query'][_0xf609('0x32')]));_0x5c4d8d['attributes']=_0x5c4d8d[_0xf609('0x33')][_0xf609('0x42')]?_0x5c4d8d[_0xf609('0x33')]:_0x1d99bb[_0xf609('0x2d')];_0x5c4d8d['order']=qs[_0xf609('0x37')](_0x5acf7f[_0xf609('0x2e')][_0xf609('0x37')]);_0x5c4d8d[_0xf609('0x38')]=qs[_0xf609('0x30')](_['pick'](_0x5acf7f['query'],_0x1d99bb['filters']));if(_0x5acf7f[_0xf609('0x2e')][_0xf609('0x3a')]){_0x5c4d8d['where']=_[_0xf609('0x3b')](_0x5c4d8d['where'],{'$or':_[_0xf609('0x27')](_0x5c4d8d[_0xf609('0x33')],function(_0x5c3ef9){var _0x4cc68b={};_0x4cc68b[_0x5c3ef9]={'$like':'%'+_0x5acf7f['query'][_0xf609('0x3a')]+'%'};return _0x4cc68b;})});}_0x5c4d8d=_[_0xf609('0x3b')]({},_0x5c4d8d,_0x5acf7f[_0xf609('0x3d')]);return _0x2fd8b8[_0xf609('0x4b')](_0x5c4d8d);}})[_0xf609('0x21')](function(_0x5ad4d8){if(_0x5ad4d8){_0x1dcbdc=_0x5ad4d8[_0xf609('0x42')];if(!_0x5acf7f['query'][_0xf609('0x34')](_0xf609('0x35'))){_0x5c4d8d[_0xf609('0x1a')]=qs['limit'](_0x5acf7f[_0xf609('0x2e')]['limit']);_0x5c4d8d['offset']=qs[_0xf609('0x1c')](_0x5acf7f['query'][_0xf609('0x1c')]);}return _0x2fd8b8[_0xf609('0x4b')](_0x5c4d8d);}})[_0xf609('0x21')](function(_0x10e7ea){if(_0x10e7ea){return _0x10e7ea?{'count':_0x1dcbdc,'rows':_0x10e7ea}:null;}})['then'](respondWithResult(_0x3253e7,null))[_0xf609('0x3f')](handleError(_0x3253e7,null));};exports[_0xf609('0x4c')]=function(_0x41142c,_0x12e16d,_0x484a4b){var _0x446183={};var _0x52e972={};var _0x112ff4;var _0x4a9c3d;return db[_0xf609('0x28')][_0xf609('0x48')]({'where':{'id':_0x41142c['params']['id']}})[_0xf609('0x21')](handleEntityNotFound(_0x12e16d,null))['then'](function(_0x1c4d27){if(_0x1c4d27){_0x112ff4=_0x1c4d27;_0x52e972[_0xf609('0x2d')]=_[_0xf609('0x2f')](db['Tag']['rawAttributes']);_0x52e972['query']=_[_0xf609('0x2f')](_0x41142c['query']);_0x52e972['filters']=_[_0xf609('0x31')](_0x52e972['model'],_0x52e972['query']);_0x446183[_0xf609('0x33')]=_[_0xf609('0x31')](_0x52e972[_0xf609('0x2d')],qs[_0xf609('0x32')](_0x41142c['query'][_0xf609('0x32')]));_0x446183['attributes']=_0x446183[_0xf609('0x33')][_0xf609('0x42')]?_0x446183[_0xf609('0x33')]:_0x52e972['model'];_0x446183['order']=qs[_0xf609('0x37')](_0x41142c[_0xf609('0x2e')][_0xf609('0x37')]);_0x446183['where']=qs[_0xf609('0x30')](_[_0xf609('0x39')](_0x41142c[_0xf609('0x2e')],_0x52e972['filters']));if(_0x41142c[_0xf609('0x2e')][_0xf609('0x3a')]){_0x446183['where']=_[_0xf609('0x3b')](_0x446183['where'],{'$or':_[_0xf609('0x27')](_0x446183['attributes'],function(_0x40ae3e){var _0x5c0636={};_0x5c0636[_0x40ae3e]={'$like':'%'+_0x41142c[_0xf609('0x2e')][_0xf609('0x3a')]+'%'};return _0x5c0636;})});}_0x446183=_[_0xf609('0x3b')]({},_0x446183,_0x41142c[_0xf609('0x3d')]);return _0x112ff4[_0xf609('0x4c')](_0x446183);}})['then'](function(_0x4d205e){if(_0x4d205e){_0x4a9c3d=_0x4d205e[_0xf609('0x42')];if(!_0x41142c[_0xf609('0x2e')][_0xf609('0x34')](_0xf609('0x35'))){_0x446183[_0xf609('0x1a')]=qs[_0xf609('0x1a')](_0x41142c[_0xf609('0x2e')][_0xf609('0x1a')]);_0x446183['offset']=qs['offset'](_0x41142c['query'][_0xf609('0x1c')]);}return _0x112ff4[_0xf609('0x4c')](_0x446183);}})[_0xf609('0x21')](function(_0x250de2){if(_0x250de2){return _0x250de2?{'count':_0x4a9c3d,'rows':_0x250de2}:null;}})['then'](respondWithResult(_0x12e16d,null))[_0xf609('0x3f')](handleError(_0x12e16d,null));};exports['setTags']=function(_0x1579b1,_0xd47751,_0xd41359){if(_0x1579b1['body']['id']){delete _0x1579b1['body']['id'];}return db[_0xf609('0x28')][_0xf609('0x48')]({'where':{'id':_0x1579b1['params']['id']}})[_0xf609('0x21')](handleEntityNotFound(_0xd47751,null))[_0xf609('0x21')](function(_0x392bdd){if(_0x392bdd){return _0x392bdd[_0xf609('0x4d')](_0x1579b1[_0xf609('0x45')][_0xf609('0x4e')]||[]);}return null;})[_0xf609('0x21')](respondWithResult(_0xd47751,null))[_0xf609('0x3f')](handleError(_0xd47751,null));}; \ No newline at end of file +var _0x8202=['ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ZendeskConfiguration','include','findAll','rows','catch','show','includeAll','find','create','body','params','getFields','findOne'];(function(_0x18ead4,_0x71f159){var _0x3aedbb=function(_0x4028fd){while(--_0x4028fd){_0x18ead4['push'](_0x18ead4['shift']());}};_0x3aedbb(++_0x71f159);}(_0x8202,0x1ba));var _0x2820=function(_0x216361,_0x15ee56){_0x216361=_0x216361-0x0;var _0x1a11e5=_0x8202[_0x216361];return _0x1a11e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2820('0x0'));var zipdir=require(_0x2820('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2820('0x2'));var moment=require(_0x2820('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2820('0x4'));var util=require(_0x2820('0x5'));var path=require(_0x2820('0x6'));var sox=require(_0x2820('0x7'));var csv=require(_0x2820('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2820('0x9'));var squel=require(_0x2820('0xa'));var crypto=require(_0x2820('0xb'));var jsforce=require(_0x2820('0xc'));var deskjs=require(_0x2820('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2820('0xe'));var Redis=require(_0x2820('0xf'));var authService=require(_0x2820('0x10'));var qs=require(_0x2820('0x11'));var as=require(_0x2820('0x12'));var hardwareService=require(_0x2820('0x13'));var logger=require(_0x2820('0x14'))(_0x2820('0x15'));var utils=require(_0x2820('0x16'));var config=require(_0x2820('0x17'));var licenseUtil=require(_0x2820('0x18'));var db=require(_0x2820('0x19'))['db'];function respondWithStatusCode(_0xecbc40,_0x24a61a){_0x24a61a=_0x24a61a||0xcc;return function(_0x2ed487){if(_0x2ed487){return _0xecbc40[_0x2820('0x1a')](_0x24a61a);}return _0xecbc40[_0x2820('0x1b')](_0x24a61a)['end']();};}function respondWithResult(_0x2513ea,_0x3a0abc){_0x3a0abc=_0x3a0abc||0xc8;return function(_0x261b47){if(_0x261b47){return _0x2513ea[_0x2820('0x1b')](_0x3a0abc)[_0x2820('0x1c')](_0x261b47);}};}function respondWithFilteredResult(_0x5530ef,_0x19b7ba){return function(_0x1118af){if(_0x1118af){var _0xafff85=typeof _0x19b7ba[_0x2820('0x1d')]==='undefined'&&typeof _0x19b7ba[_0x2820('0x1e')]===_0x2820('0x1f');var _0x2e09df=_0x1118af[_0x2820('0x20')];var _0x25b1fb=_0xafff85?0x0:_0x19b7ba['offset'];var _0x4821b=_0xafff85?_0x1118af[_0x2820('0x20')]:_0x19b7ba[_0x2820('0x1d')]+_0x19b7ba[_0x2820('0x1e')];var _0xaaee15;if(_0x4821b>=_0x2e09df){_0x4821b=_0x2e09df;_0xaaee15=0xc8;}else{_0xaaee15=0xce;}_0x5530ef['status'](_0xaaee15);return _0x5530ef[_0x2820('0x21')](_0x2820('0x22'),_0x25b1fb+'-'+_0x4821b+'/'+_0x2e09df)['json'](_0x1118af);}return null;};}function patchUpdates(_0x35d167){return function(_0x2592f0){try{jsonpatch[_0x2820('0x23')](_0x2592f0,_0x35d167,!![]);}catch(_0x1ba826){return BPromise[_0x2820('0x24')](_0x1ba826);}return _0x2592f0[_0x2820('0x25')]();};}function saveUpdates(_0x1c82d8,_0x1f52bb){return function(_0x5e1529){if(_0x5e1529){return _0x5e1529['update'](_0x1c82d8)[_0x2820('0x26')](function(_0x37253b){return _0x37253b;});}return null;};}function removeEntity(_0x14d20d,_0x92d69f){return function(_0x13cc72){if(_0x13cc72){return _0x13cc72[_0x2820('0x27')]()['then'](function(){_0x14d20d[_0x2820('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2094ed,_0x23a281){return function(_0x31e78d){if(!_0x31e78d){_0x2094ed['sendStatus'](0x194);}return _0x31e78d;};}function handleError(_0x2800d7,_0x4763e1){_0x4763e1=_0x4763e1||0x1f4;return function(_0x42bc7c){logger[_0x2820('0x28')](_0x42bc7c[_0x2820('0x29')]);if(_0x42bc7c[_0x2820('0x2a')]){delete _0x42bc7c[_0x2820('0x2a')];}_0x2800d7[_0x2820('0x1b')](_0x4763e1)[_0x2820('0x2b')](_0x42bc7c);};}exports[_0x2820('0x2c')]=function(_0x590351,_0xb6cae){var _0x4248df={},_0x438981={},_0xab7559={'count':0x0,'rows':[]};var _0x3e5b7c=_[_0x2820('0x2d')](db['ZendeskConfiguration'][_0x2820('0x2e')],function(_0x4f971e){return{'name':_0x4f971e[_0x2820('0x2f')],'type':_0x4f971e[_0x2820('0x30')][_0x2820('0x31')]};});_0x438981[_0x2820('0x32')]=_[_0x2820('0x2d')](_0x3e5b7c,_0x2820('0x2a'));_0x438981[_0x2820('0x33')]=_[_0x2820('0x34')](_0x590351[_0x2820('0x33')]);_0x438981[_0x2820('0x35')]=_['intersection'](_0x438981[_0x2820('0x32')],_0x438981[_0x2820('0x33')]);_0x4248df['attributes']=_[_0x2820('0x36')](_0x438981['model'],qs[_0x2820('0x37')](_0x590351[_0x2820('0x33')]['fields']));_0x4248df['attributes']=_0x4248df['attributes'][_0x2820('0x38')]?_0x4248df[_0x2820('0x39')]:_0x438981[_0x2820('0x32')];if(!_0x590351['query'][_0x2820('0x3a')](_0x2820('0x3b'))){_0x4248df[_0x2820('0x1e')]=qs[_0x2820('0x1e')](_0x590351[_0x2820('0x33')][_0x2820('0x1e')]);_0x4248df[_0x2820('0x1d')]=qs[_0x2820('0x1d')](_0x590351[_0x2820('0x33')]['offset']);}_0x4248df[_0x2820('0x3c')]=qs[_0x2820('0x3d')](_0x590351[_0x2820('0x33')]['sort']);_0x4248df[_0x2820('0x3e')]=qs[_0x2820('0x35')](_[_0x2820('0x3f')](_0x590351[_0x2820('0x33')],_0x438981['filters']),_0x3e5b7c);if(_0x590351['query'][_0x2820('0x40')]){_0x4248df[_0x2820('0x3e')]=_[_0x2820('0x41')](_0x4248df['where'],{'$or':_[_0x2820('0x2d')](_0x3e5b7c,function(_0x5b697e){if(_0x5b697e['type']!=='VIRTUAL'){var _0x3238b1={};_0x3238b1[_0x5b697e[_0x2820('0x2a')]]={'$like':'%'+_0x590351[_0x2820('0x33')][_0x2820('0x40')]+'%'};return _0x3238b1;}})});}_0x4248df=_[_0x2820('0x41')]({},_0x4248df,_0x590351[_0x2820('0x42')]);var _0x466296={'where':_0x4248df[_0x2820('0x3e')]};return db[_0x2820('0x43')][_0x2820('0x20')](_0x466296)[_0x2820('0x26')](function(_0x3b15a2){_0xab7559[_0x2820('0x20')]=_0x3b15a2;if(_0x590351[_0x2820('0x33')]['includeAll']){_0x4248df[_0x2820('0x44')]=[{'all':!![]}];}return db[_0x2820('0x43')][_0x2820('0x45')](_0x4248df);})[_0x2820('0x26')](function(_0x2a7e0b){_0xab7559[_0x2820('0x46')]=_0x2a7e0b;return _0xab7559;})[_0x2820('0x26')](respondWithFilteredResult(_0xb6cae,_0x4248df))[_0x2820('0x47')](handleError(_0xb6cae,null));};exports[_0x2820('0x48')]=function(_0x42a2b2,_0x2a9b81){var _0x21e2e5={'raw':![],'where':{'id':_0x42a2b2['params']['id']}},_0x4f53b3={};_0x4f53b3[_0x2820('0x32')]=_[_0x2820('0x34')](db['ZendeskConfiguration'][_0x2820('0x2e')]);_0x4f53b3['query']=_['keys'](_0x42a2b2[_0x2820('0x33')]);_0x4f53b3[_0x2820('0x35')]=_[_0x2820('0x36')](_0x4f53b3[_0x2820('0x32')],_0x4f53b3[_0x2820('0x33')]);_0x21e2e5[_0x2820('0x39')]=_[_0x2820('0x36')](_0x4f53b3['model'],qs['fields'](_0x42a2b2[_0x2820('0x33')][_0x2820('0x37')]));_0x21e2e5['attributes']=_0x21e2e5[_0x2820('0x39')][_0x2820('0x38')]?_0x21e2e5[_0x2820('0x39')]:_0x4f53b3[_0x2820('0x32')];if(_0x42a2b2[_0x2820('0x33')][_0x2820('0x49')]){_0x21e2e5['include']=[{'all':!![]}];}_0x21e2e5=_['merge']({},_0x21e2e5,_0x42a2b2[_0x2820('0x42')]);return db[_0x2820('0x43')][_0x2820('0x4a')](_0x21e2e5)[_0x2820('0x26')](handleEntityNotFound(_0x2a9b81,null))[_0x2820('0x26')](respondWithResult(_0x2a9b81,null))['catch'](handleError(_0x2a9b81,null));};exports[_0x2820('0x4b')]=function(_0x4fd77e,_0x5a8cfa){return db['ZendeskConfiguration'][_0x2820('0x4b')](_0x4fd77e[_0x2820('0x4c')],{})[_0x2820('0x26')](respondWithResult(_0x5a8cfa,0xc9))[_0x2820('0x47')](handleError(_0x5a8cfa,null));};exports['update']=function(_0x453dac,_0x4982e5){if(_0x453dac['body']['id']){delete _0x453dac[_0x2820('0x4c')]['id'];}return db[_0x2820('0x43')][_0x2820('0x4a')]({'where':{'id':_0x453dac['params']['id']}})[_0x2820('0x26')](handleEntityNotFound(_0x4982e5,null))[_0x2820('0x26')](saveUpdates(_0x453dac[_0x2820('0x4c')],null))[_0x2820('0x26')](respondWithResult(_0x4982e5,null))[_0x2820('0x47')](handleError(_0x4982e5,null));};exports['destroy']=function(_0x3b29d,_0x375dc){return db['ZendeskConfiguration'][_0x2820('0x4a')]({'where':{'id':_0x3b29d[_0x2820('0x4d')]['id']}})['then'](handleEntityNotFound(_0x375dc,null))['then'](removeEntity(_0x375dc,null))[_0x2820('0x47')](handleError(_0x375dc,null));};exports[_0x2820('0x4e')]=function(_0x4897de,_0x105d45,_0x472783){var _0x36cf66={};var _0x4e6593={};var _0x49983e;var _0x14e56c;return db[_0x2820('0x43')][_0x2820('0x4f')]({'where':{'id':_0x4897de[_0x2820('0x4d')]['id']}})[_0x2820('0x26')](handleEntityNotFound(_0x105d45,null))[_0x2820('0x26')](function(_0x389625){if(_0x389625){_0x49983e=_0x389625;_0x4e6593[_0x2820('0x32')]=_[_0x2820('0x34')](db[_0x2820('0x50')][_0x2820('0x2e')]);_0x4e6593[_0x2820('0x33')]=_[_0x2820('0x34')](_0x4897de[_0x2820('0x33')]);_0x4e6593[_0x2820('0x35')]=_[_0x2820('0x36')](_0x4e6593[_0x2820('0x32')],_0x4e6593['query']);_0x36cf66[_0x2820('0x39')]=_[_0x2820('0x36')](_0x4e6593[_0x2820('0x32')],qs[_0x2820('0x37')](_0x4897de[_0x2820('0x33')][_0x2820('0x37')]));_0x36cf66[_0x2820('0x39')]=_0x36cf66['attributes'][_0x2820('0x38')]?_0x36cf66[_0x2820('0x39')]:_0x4e6593[_0x2820('0x32')];_0x36cf66[_0x2820('0x3c')]=qs['sort'](_0x4897de[_0x2820('0x33')][_0x2820('0x3d')]);_0x36cf66[_0x2820('0x3e')]=qs[_0x2820('0x35')](_['pick'](_0x4897de[_0x2820('0x33')],_0x4e6593[_0x2820('0x35')]));if(_0x4897de[_0x2820('0x33')][_0x2820('0x40')]){_0x36cf66[_0x2820('0x3e')]=_['merge'](_0x36cf66[_0x2820('0x3e')],{'$or':_['map'](_0x36cf66[_0x2820('0x39')],function(_0x340872){var _0x4c533f={};_0x4c533f[_0x340872]={'$like':'%'+_0x4897de[_0x2820('0x33')][_0x2820('0x40')]+'%'};return _0x4c533f;})});}_0x36cf66=_[_0x2820('0x41')]({},_0x36cf66,_0x4897de['options']);return _0x49983e[_0x2820('0x4e')](_0x36cf66);}})[_0x2820('0x26')](function(_0x21372f){if(_0x21372f){_0x14e56c=_0x21372f[_0x2820('0x38')];if(!_0x4897de[_0x2820('0x33')][_0x2820('0x3a')](_0x2820('0x3b'))){_0x36cf66[_0x2820('0x1e')]=qs[_0x2820('0x1e')](_0x4897de[_0x2820('0x33')][_0x2820('0x1e')]);_0x36cf66['offset']=qs[_0x2820('0x1d')](_0x4897de[_0x2820('0x33')]['offset']);}return _0x49983e[_0x2820('0x4e')](_0x36cf66);}})['then'](function(_0x6287a9){if(_0x6287a9){return _0x6287a9?{'count':_0x14e56c,'rows':_0x6287a9}:null;}})[_0x2820('0x26')](respondWithResult(_0x105d45,null))['catch'](handleError(_0x105d45,null));};exports[_0x2820('0x51')]=function(_0x2b0c1f,_0x598ad9,_0x125852){var _0x4ef6a1={};var _0x2309a4={};var _0x1ae614;var _0x2b05db;return db[_0x2820('0x43')][_0x2820('0x4f')]({'where':{'id':_0x2b0c1f['params']['id']}})[_0x2820('0x26')](handleEntityNotFound(_0x598ad9,null))['then'](function(_0x6226a7){if(_0x6226a7){_0x1ae614=_0x6226a7;_0x2309a4['model']=_[_0x2820('0x34')](db['ZendeskField'][_0x2820('0x2e')]);_0x2309a4[_0x2820('0x33')]=_[_0x2820('0x34')](_0x2b0c1f['query']);_0x2309a4[_0x2820('0x35')]=_[_0x2820('0x36')](_0x2309a4[_0x2820('0x32')],_0x2309a4[_0x2820('0x33')]);_0x4ef6a1[_0x2820('0x39')]=_[_0x2820('0x36')](_0x2309a4[_0x2820('0x32')],qs[_0x2820('0x37')](_0x2b0c1f['query'][_0x2820('0x37')]));_0x4ef6a1['attributes']=_0x4ef6a1[_0x2820('0x39')][_0x2820('0x38')]?_0x4ef6a1[_0x2820('0x39')]:_0x2309a4[_0x2820('0x32')];_0x4ef6a1[_0x2820('0x3c')]=qs['sort'](_0x2b0c1f[_0x2820('0x33')][_0x2820('0x3d')]);_0x4ef6a1[_0x2820('0x3e')]=qs[_0x2820('0x35')](_['pick'](_0x2b0c1f[_0x2820('0x33')],_0x2309a4[_0x2820('0x35')]));if(_0x2b0c1f[_0x2820('0x33')][_0x2820('0x40')]){_0x4ef6a1[_0x2820('0x3e')]=_[_0x2820('0x41')](_0x4ef6a1[_0x2820('0x3e')],{'$or':_[_0x2820('0x2d')](_0x4ef6a1[_0x2820('0x39')],function(_0x664b47){var _0x1d00f3={};_0x1d00f3[_0x664b47]={'$like':'%'+_0x2b0c1f[_0x2820('0x33')]['filter']+'%'};return _0x1d00f3;})});}_0x4ef6a1=_[_0x2820('0x41')]({},_0x4ef6a1,_0x2b0c1f['options']);return _0x1ae614['getSubjects'](_0x4ef6a1);}})[_0x2820('0x26')](function(_0xfce568){if(_0xfce568){_0x2b05db=_0xfce568['length'];if(!_0x2b0c1f['query'][_0x2820('0x3a')](_0x2820('0x3b'))){_0x4ef6a1[_0x2820('0x1e')]=qs['limit'](_0x2b0c1f['query'][_0x2820('0x1e')]);_0x4ef6a1[_0x2820('0x1d')]=qs[_0x2820('0x1d')](_0x2b0c1f[_0x2820('0x33')]['offset']);}return _0x1ae614[_0x2820('0x51')](_0x4ef6a1);}})['then'](function(_0x11d038){if(_0x11d038){return _0x11d038?{'count':_0x2b05db,'rows':_0x11d038}:null;}})[_0x2820('0x26')](respondWithResult(_0x598ad9,null))[_0x2820('0x47')](handleError(_0x598ad9,null));};exports['getDescriptions']=function(_0x64681a,_0x5d039b,_0x1106f2){var _0x5c1b04={};var _0x603001={};var _0x999fd0;var _0x4f031a;return db[_0x2820('0x43')]['findOne']({'where':{'id':_0x64681a[_0x2820('0x4d')]['id']}})[_0x2820('0x26')](handleEntityNotFound(_0x5d039b,null))[_0x2820('0x26')](function(_0x2a4b2c){if(_0x2a4b2c){_0x999fd0=_0x2a4b2c;_0x603001[_0x2820('0x32')]=_[_0x2820('0x34')](db['ZendeskField']['rawAttributes']);_0x603001[_0x2820('0x33')]=_[_0x2820('0x34')](_0x64681a[_0x2820('0x33')]);_0x603001[_0x2820('0x35')]=_['intersection'](_0x603001[_0x2820('0x32')],_0x603001[_0x2820('0x33')]);_0x5c1b04[_0x2820('0x39')]=_[_0x2820('0x36')](_0x603001[_0x2820('0x32')],qs['fields'](_0x64681a[_0x2820('0x33')][_0x2820('0x37')]));_0x5c1b04['attributes']=_0x5c1b04[_0x2820('0x39')][_0x2820('0x38')]?_0x5c1b04[_0x2820('0x39')]:_0x603001[_0x2820('0x32')];_0x5c1b04['order']=qs[_0x2820('0x3d')](_0x64681a[_0x2820('0x33')][_0x2820('0x3d')]);_0x5c1b04['where']=qs['filters'](_[_0x2820('0x3f')](_0x64681a[_0x2820('0x33')],_0x603001[_0x2820('0x35')]));if(_0x64681a['query'][_0x2820('0x40')]){_0x5c1b04[_0x2820('0x3e')]=_['merge'](_0x5c1b04['where'],{'$or':_[_0x2820('0x2d')](_0x5c1b04['attributes'],function(_0x4b4da6){var _0x10aeca={};_0x10aeca[_0x4b4da6]={'$like':'%'+_0x64681a[_0x2820('0x33')][_0x2820('0x40')]+'%'};return _0x10aeca;})});}_0x5c1b04=_[_0x2820('0x41')]({},_0x5c1b04,_0x64681a[_0x2820('0x42')]);return _0x999fd0[_0x2820('0x52')](_0x5c1b04);}})[_0x2820('0x26')](function(_0x2aabf2){if(_0x2aabf2){_0x4f031a=_0x2aabf2[_0x2820('0x38')];if(!_0x64681a[_0x2820('0x33')][_0x2820('0x3a')](_0x2820('0x3b'))){_0x5c1b04[_0x2820('0x1e')]=qs[_0x2820('0x1e')](_0x64681a['query'][_0x2820('0x1e')]);_0x5c1b04[_0x2820('0x1d')]=qs[_0x2820('0x1d')](_0x64681a['query'][_0x2820('0x1d')]);}return _0x999fd0[_0x2820('0x52')](_0x5c1b04);}})['then'](function(_0x341514){if(_0x341514){return _0x341514?{'count':_0x4f031a,'rows':_0x341514}:null;}})[_0x2820('0x26')](respondWithResult(_0x5d039b,null))[_0x2820('0x47')](handleError(_0x5d039b,null));};exports[_0x2820('0x53')]=function(_0x43eff0,_0x2c7270,_0x2967ad){var _0x2f4451={};var _0x45e14e={};var _0x12c54d;var _0x195040;return db['ZendeskConfiguration'][_0x2820('0x4f')]({'where':{'id':_0x43eff0['params']['id']}})['then'](handleEntityNotFound(_0x2c7270,null))[_0x2820('0x26')](function(_0x527a17){if(_0x527a17){_0x12c54d=_0x527a17;_0x45e14e[_0x2820('0x32')]=_[_0x2820('0x34')](db[_0x2820('0x54')][_0x2820('0x2e')]);_0x45e14e[_0x2820('0x33')]=_[_0x2820('0x34')](_0x43eff0[_0x2820('0x33')]);_0x45e14e[_0x2820('0x35')]=_['intersection'](_0x45e14e['model'],_0x45e14e[_0x2820('0x33')]);_0x2f4451[_0x2820('0x39')]=_[_0x2820('0x36')](_0x45e14e[_0x2820('0x32')],qs[_0x2820('0x37')](_0x43eff0['query'][_0x2820('0x37')]));_0x2f4451[_0x2820('0x39')]=_0x2f4451['attributes']['length']?_0x2f4451[_0x2820('0x39')]:_0x45e14e[_0x2820('0x32')];_0x2f4451[_0x2820('0x3c')]=qs[_0x2820('0x3d')](_0x43eff0[_0x2820('0x33')][_0x2820('0x3d')]);_0x2f4451[_0x2820('0x3e')]=qs['filters'](_[_0x2820('0x3f')](_0x43eff0[_0x2820('0x33')],_0x45e14e[_0x2820('0x35')]));if(_0x43eff0['query'][_0x2820('0x40')]){_0x2f4451[_0x2820('0x3e')]=_[_0x2820('0x41')](_0x2f4451[_0x2820('0x3e')],{'$or':_[_0x2820('0x2d')](_0x2f4451[_0x2820('0x39')],function(_0x493318){var _0x57b8fe={};_0x57b8fe[_0x493318]={'$like':'%'+_0x43eff0[_0x2820('0x33')][_0x2820('0x40')]+'%'};return _0x57b8fe;})});}_0x2f4451=_[_0x2820('0x41')]({},_0x2f4451,_0x43eff0['options']);return _0x12c54d[_0x2820('0x53')](_0x2f4451);}})['then'](function(_0x10577d){if(_0x10577d){_0x195040=_0x10577d[_0x2820('0x38')];if(!_0x43eff0[_0x2820('0x33')][_0x2820('0x3a')](_0x2820('0x3b'))){_0x2f4451[_0x2820('0x1e')]=qs[_0x2820('0x1e')](_0x43eff0['query'][_0x2820('0x1e')]);_0x2f4451[_0x2820('0x1d')]=qs[_0x2820('0x1d')](_0x43eff0[_0x2820('0x33')][_0x2820('0x1d')]);}return _0x12c54d[_0x2820('0x53')](_0x2f4451);}})[_0x2820('0x26')](function(_0xe804b8){if(_0xe804b8){return _0xe804b8?{'count':_0x195040,'rows':_0xe804b8}:null;}})[_0x2820('0x26')](respondWithResult(_0x2c7270,null))['catch'](handleError(_0x2c7270,null));};exports[_0x2820('0x55')]=function(_0x5c24d0,_0x5114e4,_0x4d06f9){if(_0x5c24d0[_0x2820('0x4c')]['id']){delete _0x5c24d0[_0x2820('0x4c')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x5c24d0[_0x2820('0x4d')]['id']}})[_0x2820('0x26')](handleEntityNotFound(_0x5114e4,null))[_0x2820('0x26')](function(_0x2dd3f8){if(_0x2dd3f8){return _0x2dd3f8[_0x2820('0x55')](_0x5c24d0[_0x2820('0x4c')][_0x2820('0x56')]||[]);}return null;})[_0x2820('0x26')](respondWithResult(_0x5114e4,null))['catch'](handleError(_0x5114e4,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 358b0c0..0f607f8 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 _0x1399=['ZendeskConfiguration','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define'];(function(_0x10efdb,_0x3bbe66){var _0x1b282c=function(_0x10ff28){while(--_0x10ff28){_0x10efdb['push'](_0x10efdb['shift']());}};_0x1b282c(++_0x3bbe66);}(_0x1399,0x16c));var _0x9139=function(_0x230f58,_0x1f8377){_0x230f58=_0x230f58-0x0;var _0x3fdd2c=_0x1399[_0x230f58];return _0x3fdd2c;};'use strict';var _=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var logger=require('../../config/logger')(_0x9139('0x2'));var moment=require('moment');var BPromise=require(_0x9139('0x3'));var rp=require(_0x9139('0x4'));var fs=require('fs');var path=require(_0x9139('0x5'));var rimraf=require(_0x9139('0x6'));var config=require(_0x9139('0x7'));var attributes=require(_0x9139('0x8'));module['exports']=function(_0x54af2d,_0x8f086b){return _0x54af2d[_0x9139('0x9')](_0x9139('0xa'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5fa=['exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x5441c8,_0x3c7f77){var _0x159a87=function(_0x53710c){while(--_0x53710c){_0x5441c8['push'](_0x5441c8['shift']());}};_0x159a87(++_0x3c7f77);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x3ed6f1,_0x264b14){_0x3ed6f1=_0x3ed6f1-0x0;var _0x14fc1b=_0xa5fa[_0x3ed6f1];return _0x14fc1b;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var logger=require(_0xaa5f('0x1'))(_0xaa5f('0x2'));var moment=require(_0xaa5f('0x3'));var BPromise=require('bluebird');var rp=require(_0xaa5f('0x4'));var fs=require('fs');var path=require(_0xaa5f('0x5'));var rimraf=require('rimraf');var config=require(_0xaa5f('0x6'));var attributes=require(_0xaa5f('0x7'));module[_0xaa5f('0x8')]=function(_0x20744d,_0x3d1489){return _0x20744d[_0xaa5f('0x9')](_0xaa5f('0xa'),attributes,{'tableName':_0xaa5f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 403910e..0930c59 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 _0xc2f5=['info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2e2a25,_0x57f44a){var _0x2d3d3e=function(_0x5917bf){while(--_0x5917bf){_0x2e2a25['push'](_0x2e2a25['shift']());}};_0x2d3d3e(++_0x57f44a);}(_0xc2f5,0xdf));var _0x5c2f=function(_0x2ba020,_0x391d19){_0x2ba020=_0x2ba020-0x0;var _0x389921=_0xc2f5[_0x2ba020];return _0x389921;};'use strict';var _=require(_0x5c2f('0x0'));var util=require(_0x5c2f('0x1'));var moment=require('moment');var BPromise=require(_0x5c2f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c2f('0x3'));var db=require(_0x5c2f('0x4'))['db'];var utils=require(_0x5c2f('0x5'));var logger=require('../../config/logger')(_0x5c2f('0x6'));var config=require('../../config/environment');var jayson=require(_0x5c2f('0x7'));var client=jayson[_0x5c2f('0x8')][_0x5c2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfb5132,_0x573681,_0xe2e4dc){return new BPromise(function(_0x185c34,_0x456e75){return client['request'](_0xfb5132,_0xe2e4dc)[_0x5c2f('0xa')](function(_0x24cb0b){logger['info'](_0x5c2f('0xb'),_0x573681,_0x5c2f('0xc'));logger[_0x5c2f('0xd')](_0x5c2f('0xe'),_0x573681,_0x5c2f('0xc'),JSON[_0x5c2f('0xf')](_0x24cb0b));if(_0x24cb0b[_0x5c2f('0x10')]){if(_0x24cb0b['error'][_0x5c2f('0x11')]===0x1f4){logger[_0x5c2f('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x573681,_0x24cb0b[_0x5c2f('0x10')][_0x5c2f('0x12')]);return _0x456e75(_0x24cb0b[_0x5c2f('0x10')]['message']);}logger[_0x5c2f('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x573681,_0x24cb0b[_0x5c2f('0x10')][_0x5c2f('0x12')]);return _0x185c34(_0x24cb0b[_0x5c2f('0x10')]['message']);}else{logger[_0x5c2f('0x13')](_0x5c2f('0xb'),_0x573681,_0x5c2f('0xc'));_0x185c34(_0x24cb0b[_0x5c2f('0x14')]['message']);}})[_0x5c2f('0x15')](function(_0x230b92){logger[_0x5c2f('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x573681,_0x230b92);_0x456e75(_0x230b92);});});} \ No newline at end of file +var _0xad95=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x31fc8f,_0x51db3b){var _0x55131a=function(_0x5548d1){while(--_0x5548d1){_0x31fc8f['push'](_0x31fc8f['shift']());}};_0x55131a(++_0x51db3b);}(_0xad95,0x1a9));var _0x5ad9=function(_0x466821,_0x4c8362){_0x466821=_0x466821-0x0;var _0x2ea0f1=_0xad95[_0x466821];return _0x2ea0f1;};'use strict';var _=require('lodash');var util=require(_0x5ad9('0x0'));var moment=require(_0x5ad9('0x1'));var BPromise=require('bluebird');var rs=require(_0x5ad9('0x2'));var fs=require('fs');var Redis=require(_0x5ad9('0x3'));var db=require(_0x5ad9('0x4'))['db'];var utils=require(_0x5ad9('0x5'));var logger=require(_0x5ad9('0x6'))(_0x5ad9('0x7'));var config=require(_0x5ad9('0x8'));var jayson=require(_0x5ad9('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a370e,_0xc520c4,_0x1bf4e0){return new BPromise(function(_0x4ead76,_0x377470){return client[_0x5ad9('0xa')](_0x2a370e,_0x1bf4e0)[_0x5ad9('0xb')](function(_0x14cf17){logger[_0x5ad9('0xc')](_0x5ad9('0xd'),_0xc520c4,_0x5ad9('0xe'));logger[_0x5ad9('0xf')](_0x5ad9('0x10'),_0xc520c4,_0x5ad9('0xe'),JSON[_0x5ad9('0x11')](_0x14cf17));if(_0x14cf17['error']){if(_0x14cf17[_0x5ad9('0x12')][_0x5ad9('0x13')]===0x1f4){logger[_0x5ad9('0x12')](_0x5ad9('0xd'),_0xc520c4,_0x14cf17['error'][_0x5ad9('0x14')]);return _0x377470(_0x14cf17[_0x5ad9('0x12')][_0x5ad9('0x14')]);}logger[_0x5ad9('0x12')](_0x5ad9('0xd'),_0xc520c4,_0x14cf17['error'][_0x5ad9('0x14')]);return _0x4ead76(_0x14cf17[_0x5ad9('0x12')]['message']);}else{logger[_0x5ad9('0xc')](_0x5ad9('0xd'),_0xc520c4,_0x5ad9('0xe'));_0x4ead76(_0x14cf17['result'][_0x5ad9('0x14')]);}})[_0x5ad9('0x15')](function(_0x57d6e1){logger[_0x5ad9('0x12')](_0x5ad9('0xd'),_0xc520c4,_0x57d6e1);_0x377470(_0x57d6e1);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index bdcef51..48b69b5 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 _0x6708=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','/:id','isAuthenticated','show','create','update','delete','destroy'];(function(_0x7bb430,_0x4a869c){var _0xfe5099=function(_0x4a951a){while(--_0x4a951a){_0x7bb430['push'](_0x7bb430['shift']());}};_0xfe5099(++_0x4a869c);}(_0x6708,0x98));var _0x8670=function(_0x399554,_0x570f3c){_0x399554=_0x399554-0x0;var _0x59cdf2=_0x6708[_0x399554];return _0x59cdf2;};'use strict';var multer=require(_0x8670('0x0'));var util=require(_0x8670('0x1'));var path=require(_0x8670('0x2'));var timeout=require(_0x8670('0x3'));var express=require(_0x8670('0x4'));var router=express[_0x8670('0x5')]();var fs_extra=require(_0x8670('0x6'));var auth=require(_0x8670('0x7'));var interaction=require(_0x8670('0x8'));var config=require(_0x8670('0x9'));var controller=require(_0x8670('0xa'));router[_0x8670('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8670('0xc'),auth[_0x8670('0xd')](),controller[_0x8670('0xe')]);router['post']('/',auth[_0x8670('0xd')](),controller[_0x8670('0xf')]);router['put'](_0x8670('0xc'),auth[_0x8670('0xd')](),controller[_0x8670('0x10')]);router[_0x8670('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8670('0x12')]);module['exports']=router; \ No newline at end of file +var _0xf434=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf434,0xdc));var _0x4f43=function(_0x2c90f8,_0x31b0ed){_0x2c90f8=_0x2c90f8-0x0;var _0x14bd00=_0xf434[_0x2c90f8];return _0x14bd00;};'use strict';var multer=require(_0x4f43('0x0'));var util=require('util');var path=require(_0x4f43('0x1'));var timeout=require(_0x4f43('0x2'));var express=require(_0x4f43('0x3'));var router=express[_0x4f43('0x4')]();var fs_extra=require(_0x4f43('0x5'));var auth=require(_0x4f43('0x6'));var interaction=require(_0x4f43('0x7'));var config=require(_0x4f43('0x8'));var controller=require(_0x4f43('0x9'));router[_0x4f43('0xa')]('/',auth['isAuthenticated'](),controller[_0x4f43('0xb')]);router['get'](_0x4f43('0xc'),auth[_0x4f43('0xd')](),controller[_0x4f43('0xe')]);router[_0x4f43('0xf')]('/',auth[_0x4f43('0xd')](),controller[_0x4f43('0x10')]);router[_0x4f43('0x11')](_0x4f43('0xc'),auth[_0x4f43('0xd')](),controller[_0x4f43('0x12')]);router[_0x4f43('0x13')](_0x4f43('0xc'),auth[_0x4f43('0xd')](),controller[_0x4f43('0x14')]);module[_0x4f43('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 5a88897..d727cec 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 _0xd312=['STRING','string','variable','sequelize','exports','ENUM','customVariable','keyValue','picklist'];(function(_0x1e83cc,_0x2265da){var _0x4037c7=function(_0x1aa1a2){while(--_0x1aa1a2){_0x1e83cc['push'](_0x1e83cc['shift']());}};_0x4037c7(++_0x2265da);}(_0xd312,0x135));var _0x2d31=function(_0x175617,_0x499c5d){_0x175617=_0x175617-0x0;var _0x120af9=_0xd312[_0x175617];return _0x120af9;};'use strict';var Sequelize=require(_0x2d31('0x0'));module[_0x2d31('0x1')]={'type':{'type':Sequelize[_0x2d31('0x2')]('string','variable',_0x2d31('0x3'),_0x2d31('0x4'),_0x2d31('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2d31('0x6')]},'keyType':{'type':Sequelize[_0x2d31('0x2')](_0x2d31('0x7'),_0x2d31('0x8'),_0x2d31('0x3'))},'keyContent':{'type':Sequelize[_0x2d31('0x6')]},'idField':{'type':Sequelize[_0x2d31('0x6')]},'nameField':{'type':Sequelize[_0x2d31('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2d31('0x6')]}}; \ No newline at end of file +var _0x4660=['exports','string','variable','customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x433090,_0x153e42){var _0x540692=function(_0x3aaba8){while(--_0x3aaba8){_0x433090['push'](_0x433090['shift']());}};_0x540692(++_0x153e42);}(_0x4660,0xd7));var _0x0466=function(_0x931137,_0x4dd84d){_0x931137=_0x931137-0x0;var _0x190442=_0x4660[_0x931137];return _0x190442;};'use strict';var Sequelize=require(_0x0466('0x0'));module[_0x0466('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0466('0x2'),_0x0466('0x3'),_0x0466('0x4'),_0x0466('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x0466('0x6')]},'key':{'type':Sequelize[_0x0466('0x6')]},'keyType':{'type':Sequelize[_0x0466('0x7')](_0x0466('0x2'),_0x0466('0x3'),_0x0466('0x4'))},'keyContent':{'type':Sequelize[_0x0466('0x6')]},'idField':{'type':Sequelize[_0x0466('0x6')]},'nameField':{'type':Sequelize[_0x0466('0x6')]},'customField':{'type':Sequelize[_0x0466('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0466('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 681c79d..f950abe 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 _0xdf64=['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','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','include','ZendeskField','findAll','rows','catch','show','keys','includeAll','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0x4a5f6c,_0x4f532e){var _0x281ffd=function(_0x4c68e3){while(--_0x4c68e3){_0x4a5f6c['push'](_0x4a5f6c['shift']());}};_0x281ffd(++_0x4f532e);}(_0xdf64,0x1da));var _0x4df6=function(_0x3b586f,_0x2ff0ca){_0x3b586f=_0x3b586f-0x0;var _0x51db8c=_0xdf64[_0x3b586f];return _0x51db8c;};'use strict';var emlformat=require(_0x4df6('0x0'));var rimraf=require(_0x4df6('0x1'));var zipdir=require(_0x4df6('0x2'));var jsonpatch=require(_0x4df6('0x3'));var rp=require(_0x4df6('0x4'));var moment=require(_0x4df6('0x5'));var BPromise=require(_0x4df6('0x6'));var Mustache=require(_0x4df6('0x7'));var util=require(_0x4df6('0x8'));var path=require(_0x4df6('0x9'));var sox=require('sox');var csv=require(_0x4df6('0xa'));var ejs=require(_0x4df6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4df6('0xc'));var squel=require(_0x4df6('0xd'));var crypto=require(_0x4df6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4df6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4df6('0x10'));var Papa=require(_0x4df6('0x11'));var Redis=require(_0x4df6('0x12'));var authService=require(_0x4df6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4df6('0x14'));var hardwareService=require(_0x4df6('0x15'));var logger=require(_0x4df6('0x16'))(_0x4df6('0x17'));var utils=require(_0x4df6('0x18'));var config=require(_0x4df6('0x19'));var licenseUtil=require(_0x4df6('0x1a'));var db=require(_0x4df6('0x1b'))['db'];function respondWithStatusCode(_0x334b41,_0x419b9a){_0x419b9a=_0x419b9a||0xcc;return function(_0x75af4b){if(_0x75af4b){return _0x334b41[_0x4df6('0x1c')](_0x419b9a);}return _0x334b41[_0x4df6('0x1d')](_0x419b9a)[_0x4df6('0x1e')]();};}function respondWithResult(_0x59347c,_0x38e8f9){_0x38e8f9=_0x38e8f9||0xc8;return function(_0x404779){if(_0x404779){return _0x59347c[_0x4df6('0x1d')](_0x38e8f9)['json'](_0x404779);}};}function respondWithFilteredResult(_0x1a98ff,_0x1b9463){return function(_0x11eef9){if(_0x11eef9){var _0x9b02d3=typeof _0x1b9463[_0x4df6('0x1f')]===_0x4df6('0x20')&&typeof _0x1b9463[_0x4df6('0x21')]===_0x4df6('0x20');var _0x4a76a9=_0x11eef9['count'];var _0x3d5b77=_0x9b02d3?0x0:_0x1b9463['offset'];var _0xc99c25=_0x9b02d3?_0x11eef9['count']:_0x1b9463['offset']+_0x1b9463['limit'];var _0x515751;if(_0xc99c25>=_0x4a76a9){_0xc99c25=_0x4a76a9;_0x515751=0xc8;}else{_0x515751=0xce;}_0x1a98ff['status'](_0x515751);return _0x1a98ff[_0x4df6('0x22')](_0x4df6('0x23'),_0x3d5b77+'-'+_0xc99c25+'/'+_0x4a76a9)[_0x4df6('0x24')](_0x11eef9);}return null;};}function patchUpdates(_0x112a86){return function(_0x57f6e4){try{jsonpatch['apply'](_0x57f6e4,_0x112a86,!![]);}catch(_0x4690ca){return BPromise[_0x4df6('0x25')](_0x4690ca);}return _0x57f6e4[_0x4df6('0x26')]();};}function saveUpdates(_0x50b5f7,_0xcc0b0){return function(_0x14d35d){if(_0x14d35d){return _0x14d35d[_0x4df6('0x27')](_0x50b5f7)[_0x4df6('0x28')](function(_0x52f126){return _0x52f126;});}return null;};}function removeEntity(_0x4fd6a9,_0x2dd570){return function(_0x3998e3){if(_0x3998e3){return _0x3998e3[_0x4df6('0x29')]()[_0x4df6('0x28')](function(){_0x4fd6a9['status'](0xcc)[_0x4df6('0x1e')]();});}};}function handleEntityNotFound(_0x1b37bb,_0x915d8b){return function(_0x48854e){if(!_0x48854e){_0x1b37bb[_0x4df6('0x1c')](0x194);}return _0x48854e;};}function handleError(_0x2e73a1,_0x2cab85){_0x2cab85=_0x2cab85||0x1f4;return function(_0x9df7c0){logger[_0x4df6('0x2a')](_0x9df7c0[_0x4df6('0x2b')]);if(_0x9df7c0[_0x4df6('0x2c')]){delete _0x9df7c0[_0x4df6('0x2c')];}_0x2e73a1[_0x4df6('0x1d')](_0x2cab85)[_0x4df6('0x2d')](_0x9df7c0);};}exports[_0x4df6('0x2e')]=function(_0x21bff1,_0x397f33){var _0x529d2d={},_0x13803c={},_0x596eea={'count':0x0,'rows':[]};var _0x3d2d92=_[_0x4df6('0x2f')](db['ZendeskField'][_0x4df6('0x30')],function(_0x550e22){return{'name':_0x550e22[_0x4df6('0x31')],'type':_0x550e22[_0x4df6('0x32')][_0x4df6('0x33')]};});_0x13803c[_0x4df6('0x34')]=_[_0x4df6('0x2f')](_0x3d2d92,_0x4df6('0x2c'));_0x13803c[_0x4df6('0x35')]=_['keys'](_0x21bff1['query']);_0x13803c[_0x4df6('0x36')]=_[_0x4df6('0x37')](_0x13803c[_0x4df6('0x34')],_0x13803c['query']);_0x529d2d['attributes']=_[_0x4df6('0x37')](_0x13803c['model'],qs['fields'](_0x21bff1['query'][_0x4df6('0x38')]));_0x529d2d['attributes']=_0x529d2d[_0x4df6('0x39')][_0x4df6('0x3a')]?_0x529d2d[_0x4df6('0x39')]:_0x13803c[_0x4df6('0x34')];if(!_0x21bff1[_0x4df6('0x35')][_0x4df6('0x3b')](_0x4df6('0x3c'))){_0x529d2d[_0x4df6('0x21')]=qs[_0x4df6('0x21')](_0x21bff1[_0x4df6('0x35')][_0x4df6('0x21')]);_0x529d2d['offset']=qs['offset'](_0x21bff1[_0x4df6('0x35')][_0x4df6('0x1f')]);}_0x529d2d[_0x4df6('0x3d')]=qs[_0x4df6('0x3e')](_0x21bff1[_0x4df6('0x35')][_0x4df6('0x3e')]);_0x529d2d['where']=qs[_0x4df6('0x36')](_[_0x4df6('0x3f')](_0x21bff1[_0x4df6('0x35')],_0x13803c[_0x4df6('0x36')]),_0x3d2d92);if(_0x21bff1[_0x4df6('0x35')][_0x4df6('0x40')]){_0x529d2d[_0x4df6('0x41')]=_[_0x4df6('0x42')](_0x529d2d[_0x4df6('0x41')],{'$or':_['map'](_0x3d2d92,function(_0x4fb7e7){if(_0x4fb7e7[_0x4df6('0x32')]!==_0x4df6('0x43')){var _0x242e03={};_0x242e03[_0x4fb7e7[_0x4df6('0x2c')]]={'$like':'%'+_0x21bff1[_0x4df6('0x35')]['filter']+'%'};return _0x242e03;}})});}_0x529d2d=_['merge']({},_0x529d2d,_0x21bff1[_0x4df6('0x44')]);var _0x14ab65={'where':_0x529d2d['where']};return db['ZendeskField'][_0x4df6('0x45')](_0x14ab65)[_0x4df6('0x28')](function(_0x428b08){_0x596eea[_0x4df6('0x45')]=_0x428b08;if(_0x21bff1[_0x4df6('0x35')]['includeAll']){_0x529d2d[_0x4df6('0x46')]=[{'all':!![]}];}return db[_0x4df6('0x47')][_0x4df6('0x48')](_0x529d2d);})[_0x4df6('0x28')](function(_0x48ff4f){_0x596eea[_0x4df6('0x49')]=_0x48ff4f;return _0x596eea;})[_0x4df6('0x28')](respondWithFilteredResult(_0x397f33,_0x529d2d))[_0x4df6('0x4a')](handleError(_0x397f33,null));};exports[_0x4df6('0x4b')]=function(_0x405c08,_0x24a867){var _0x43849f={'raw':!![],'where':{'id':_0x405c08['params']['id']}},_0x2ec2cb={};_0x2ec2cb[_0x4df6('0x34')]=_[_0x4df6('0x4c')](db[_0x4df6('0x47')]['rawAttributes']);_0x2ec2cb[_0x4df6('0x35')]=_[_0x4df6('0x4c')](_0x405c08[_0x4df6('0x35')]);_0x2ec2cb[_0x4df6('0x36')]=_[_0x4df6('0x37')](_0x2ec2cb['model'],_0x2ec2cb[_0x4df6('0x35')]);_0x43849f[_0x4df6('0x39')]=_['intersection'](_0x2ec2cb[_0x4df6('0x34')],qs[_0x4df6('0x38')](_0x405c08['query'][_0x4df6('0x38')]));_0x43849f[_0x4df6('0x39')]=_0x43849f[_0x4df6('0x39')][_0x4df6('0x3a')]?_0x43849f['attributes']:_0x2ec2cb[_0x4df6('0x34')];if(_0x405c08['query'][_0x4df6('0x4d')]){_0x43849f['include']=[{'all':!![]}];}_0x43849f=_[_0x4df6('0x42')]({},_0x43849f,_0x405c08[_0x4df6('0x44')]);return db[_0x4df6('0x47')]['find'](_0x43849f)['then'](handleEntityNotFound(_0x24a867,null))[_0x4df6('0x28')](respondWithResult(_0x24a867,null))[_0x4df6('0x4a')](handleError(_0x24a867,null));};exports[_0x4df6('0x4e')]=function(_0x4fdb23,_0x294e0d){return db[_0x4df6('0x47')][_0x4df6('0x4e')](_0x4fdb23[_0x4df6('0x4f')],{})['then'](respondWithResult(_0x294e0d,0xc9))['catch'](handleError(_0x294e0d,null));};exports['update']=function(_0x5d0340,_0x26d4e3){if(_0x5d0340[_0x4df6('0x4f')]['id']){delete _0x5d0340[_0x4df6('0x4f')]['id'];}return db[_0x4df6('0x47')][_0x4df6('0x50')]({'where':{'id':_0x5d0340[_0x4df6('0x51')]['id']}})['then'](handleEntityNotFound(_0x26d4e3,null))['then'](saveUpdates(_0x5d0340[_0x4df6('0x4f')],null))['then'](respondWithResult(_0x26d4e3,null))[_0x4df6('0x4a')](handleError(_0x26d4e3,null));};exports[_0x4df6('0x29')]=function(_0x5266f5,_0x2b50bb){return db['ZendeskField'][_0x4df6('0x50')]({'where':{'id':_0x5266f5['params']['id']}})[_0x4df6('0x28')](handleEntityNotFound(_0x2b50bb,null))[_0x4df6('0x28')](removeEntity(_0x2b50bb,null))['catch'](handleError(_0x2b50bb,null));}; \ No newline at end of file +var _0xf3f3=['stack','name','index','ZendeskField','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','where','filter','map','type','options','includeAll','findAll','rows','catch','params','rawAttributes','include','merge','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','error'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xf3f3,0x12f));var _0x3f3f=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0xf3f3[_0x44c768];return _0x55daf5;};'use strict';var emlformat=require(_0x3f3f('0x0'));var rimraf=require(_0x3f3f('0x1'));var zipdir=require(_0x3f3f('0x2'));var jsonpatch=require(_0x3f3f('0x3'));var rp=require(_0x3f3f('0x4'));var moment=require('moment');var BPromise=require(_0x3f3f('0x5'));var Mustache=require('mustache');var util=require(_0x3f3f('0x6'));var path=require(_0x3f3f('0x7'));var sox=require(_0x3f3f('0x8'));var csv=require(_0x3f3f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f3f('0xa'));var _=require(_0x3f3f('0xb'));var squel=require(_0x3f3f('0xc'));var crypto=require(_0x3f3f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3f3f('0xe'));var toCsv=require(_0x3f3f('0x9'));var querystring=require(_0x3f3f('0xf'));var Papa=require('papaparse');var Redis=require(_0x3f3f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3f3f('0x11'));var utils=require(_0x3f3f('0x12'));var config=require(_0x3f3f('0x13'));var licenseUtil=require(_0x3f3f('0x14'));var db=require(_0x3f3f('0x15'))['db'];function respondWithStatusCode(_0x316134,_0x391148){_0x391148=_0x391148||0xcc;return function(_0x4a8be7){if(_0x4a8be7){return _0x316134[_0x3f3f('0x16')](_0x391148);}return _0x316134['status'](_0x391148)[_0x3f3f('0x17')]();};}function respondWithResult(_0x4adc9f,_0x5a351e){_0x5a351e=_0x5a351e||0xc8;return function(_0x356596){if(_0x356596){return _0x4adc9f['status'](_0x5a351e)['json'](_0x356596);}};}function respondWithFilteredResult(_0x9d8132,_0x127142){return function(_0x3e5bfa){if(_0x3e5bfa){var _0x1f893c=typeof _0x127142[_0x3f3f('0x18')]==='undefined'&&typeof _0x127142[_0x3f3f('0x19')]===_0x3f3f('0x1a');var _0x5b419b=_0x3e5bfa[_0x3f3f('0x1b')];var _0x1c09d5=_0x1f893c?0x0:_0x127142[_0x3f3f('0x18')];var _0x32bbc5=_0x1f893c?_0x3e5bfa['count']:_0x127142[_0x3f3f('0x18')]+_0x127142[_0x3f3f('0x19')];var _0x26567d;if(_0x32bbc5>=_0x5b419b){_0x32bbc5=_0x5b419b;_0x26567d=0xc8;}else{_0x26567d=0xce;}_0x9d8132[_0x3f3f('0x1c')](_0x26567d);return _0x9d8132[_0x3f3f('0x1d')](_0x3f3f('0x1e'),_0x1c09d5+'-'+_0x32bbc5+'/'+_0x5b419b)['json'](_0x3e5bfa);}return null;};}function patchUpdates(_0x241d5d){return function(_0x18b9a7){try{jsonpatch[_0x3f3f('0x1f')](_0x18b9a7,_0x241d5d,!![]);}catch(_0x2b4111){return BPromise[_0x3f3f('0x20')](_0x2b4111);}return _0x18b9a7[_0x3f3f('0x21')]();};}function saveUpdates(_0x43e93f,_0x5adcba){return function(_0x5cf2df){if(_0x5cf2df){return _0x5cf2df[_0x3f3f('0x22')](_0x43e93f)[_0x3f3f('0x23')](function(_0x1b0d9b){return _0x1b0d9b;});}return null;};}function removeEntity(_0x296491,_0x47dd10){return function(_0x41d909){if(_0x41d909){return _0x41d909['destroy']()[_0x3f3f('0x23')](function(){_0x296491[_0x3f3f('0x1c')](0xcc)[_0x3f3f('0x17')]();});}};}function handleEntityNotFound(_0x39aa14,_0xc42d74){return function(_0x265756){if(!_0x265756){_0x39aa14[_0x3f3f('0x16')](0x194);}return _0x265756;};}function handleError(_0x39b134,_0x3eb6f3){_0x3eb6f3=_0x3eb6f3||0x1f4;return function(_0x463096){logger[_0x3f3f('0x24')](_0x463096[_0x3f3f('0x25')]);if(_0x463096[_0x3f3f('0x26')]){delete _0x463096[_0x3f3f('0x26')];}_0x39b134[_0x3f3f('0x1c')](_0x3eb6f3)['send'](_0x463096);};}exports[_0x3f3f('0x27')]=function(_0x471de1,_0x1091a3){var _0x41f523={},_0x33a251={},_0x29312c={'count':0x0,'rows':[]};var _0x1f8216=_['map'](db[_0x3f3f('0x28')]['rawAttributes'],function(_0x2fa41f){return{'name':_0x2fa41f['fieldName'],'type':_0x2fa41f['type'][_0x3f3f('0x29')]};});_0x33a251[_0x3f3f('0x2a')]=_['map'](_0x1f8216,_0x3f3f('0x26'));_0x33a251[_0x3f3f('0x2b')]=_[_0x3f3f('0x2c')](_0x471de1[_0x3f3f('0x2b')]);_0x33a251[_0x3f3f('0x2d')]=_[_0x3f3f('0x2e')](_0x33a251[_0x3f3f('0x2a')],_0x33a251['query']);_0x41f523[_0x3f3f('0x2f')]=_[_0x3f3f('0x2e')](_0x33a251[_0x3f3f('0x2a')],qs[_0x3f3f('0x30')](_0x471de1['query'][_0x3f3f('0x30')]));_0x41f523[_0x3f3f('0x2f')]=_0x41f523['attributes'][_0x3f3f('0x31')]?_0x41f523[_0x3f3f('0x2f')]:_0x33a251[_0x3f3f('0x2a')];if(!_0x471de1[_0x3f3f('0x2b')]['hasOwnProperty'](_0x3f3f('0x32'))){_0x41f523['limit']=qs[_0x3f3f('0x19')](_0x471de1['query']['limit']);_0x41f523['offset']=qs['offset'](_0x471de1[_0x3f3f('0x2b')][_0x3f3f('0x18')]);}_0x41f523['order']=qs['sort'](_0x471de1['query']['sort']);_0x41f523[_0x3f3f('0x33')]=qs[_0x3f3f('0x2d')](_['pick'](_0x471de1[_0x3f3f('0x2b')],_0x33a251[_0x3f3f('0x2d')]),_0x1f8216);if(_0x471de1[_0x3f3f('0x2b')][_0x3f3f('0x34')]){_0x41f523[_0x3f3f('0x33')]=_['merge'](_0x41f523[_0x3f3f('0x33')],{'$or':_[_0x3f3f('0x35')](_0x1f8216,function(_0x4c12a3){if(_0x4c12a3[_0x3f3f('0x36')]!=='VIRTUAL'){var _0x2fcadc={};_0x2fcadc[_0x4c12a3[_0x3f3f('0x26')]]={'$like':'%'+_0x471de1[_0x3f3f('0x2b')][_0x3f3f('0x34')]+'%'};return _0x2fcadc;}})});}_0x41f523=_['merge']({},_0x41f523,_0x471de1[_0x3f3f('0x37')]);var _0x5337f9={'where':_0x41f523[_0x3f3f('0x33')]};return db['ZendeskField']['count'](_0x5337f9)[_0x3f3f('0x23')](function(_0x211e6a){_0x29312c[_0x3f3f('0x1b')]=_0x211e6a;if(_0x471de1[_0x3f3f('0x2b')][_0x3f3f('0x38')]){_0x41f523['include']=[{'all':!![]}];}return db[_0x3f3f('0x28')][_0x3f3f('0x39')](_0x41f523);})[_0x3f3f('0x23')](function(_0x4980ca){_0x29312c[_0x3f3f('0x3a')]=_0x4980ca;return _0x29312c;})[_0x3f3f('0x23')](respondWithFilteredResult(_0x1091a3,_0x41f523))[_0x3f3f('0x3b')](handleError(_0x1091a3,null));};exports['show']=function(_0x2ef92a,_0xa59086){var _0x3b2d51={'raw':!![],'where':{'id':_0x2ef92a[_0x3f3f('0x3c')]['id']}},_0x5d5cdd={};_0x5d5cdd[_0x3f3f('0x2a')]=_['keys'](db[_0x3f3f('0x28')][_0x3f3f('0x3d')]);_0x5d5cdd[_0x3f3f('0x2b')]=_[_0x3f3f('0x2c')](_0x2ef92a[_0x3f3f('0x2b')]);_0x5d5cdd[_0x3f3f('0x2d')]=_[_0x3f3f('0x2e')](_0x5d5cdd[_0x3f3f('0x2a')],_0x5d5cdd[_0x3f3f('0x2b')]);_0x3b2d51[_0x3f3f('0x2f')]=_[_0x3f3f('0x2e')](_0x5d5cdd['model'],qs[_0x3f3f('0x30')](_0x2ef92a[_0x3f3f('0x2b')][_0x3f3f('0x30')]));_0x3b2d51['attributes']=_0x3b2d51[_0x3f3f('0x2f')][_0x3f3f('0x31')]?_0x3b2d51[_0x3f3f('0x2f')]:_0x5d5cdd[_0x3f3f('0x2a')];if(_0x2ef92a[_0x3f3f('0x2b')]['includeAll']){_0x3b2d51[_0x3f3f('0x3e')]=[{'all':!![]}];}_0x3b2d51=_[_0x3f3f('0x3f')]({},_0x3b2d51,_0x2ef92a[_0x3f3f('0x37')]);return db[_0x3f3f('0x28')]['find'](_0x3b2d51)['then'](handleEntityNotFound(_0xa59086,null))[_0x3f3f('0x23')](respondWithResult(_0xa59086,null))['catch'](handleError(_0xa59086,null));};exports['create']=function(_0xe3cd35,_0x52a302){return db['ZendeskField'][_0x3f3f('0x40')](_0xe3cd35[_0x3f3f('0x41')],{})['then'](respondWithResult(_0x52a302,0xc9))['catch'](handleError(_0x52a302,null));};exports[_0x3f3f('0x22')]=function(_0x4ff696,_0x2ed1ad){if(_0x4ff696[_0x3f3f('0x41')]['id']){delete _0x4ff696[_0x3f3f('0x41')]['id'];}return db[_0x3f3f('0x28')][_0x3f3f('0x42')]({'where':{'id':_0x4ff696[_0x3f3f('0x3c')]['id']}})[_0x3f3f('0x23')](handleEntityNotFound(_0x2ed1ad,null))[_0x3f3f('0x23')](saveUpdates(_0x4ff696[_0x3f3f('0x41')],null))[_0x3f3f('0x23')](respondWithResult(_0x2ed1ad,null))[_0x3f3f('0x3b')](handleError(_0x2ed1ad,null));};exports[_0x3f3f('0x43')]=function(_0x15de55,_0xa9c97b){return db[_0x3f3f('0x28')][_0x3f3f('0x42')]({'where':{'id':_0x15de55[_0x3f3f('0x3c')]['id']}})['then'](handleEntityNotFound(_0xa9c97b,null))[_0x3f3f('0x23')](removeEntity(_0xa9c97b,null))[_0x3f3f('0x3b')](handleError(_0xa9c97b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 5abf891..9064783 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 _0x04f5=['../../config/environment','exports','define','ZendeskField','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','request-promise','path'];(function(_0xb9e8a0,_0x372adc){var _0x1165b3=function(_0x37dfe6){while(--_0x37dfe6){_0xb9e8a0['push'](_0xb9e8a0['shift']());}};_0x1165b3(++_0x372adc);}(_0x04f5,0x1ce));var _0x504f=function(_0x685346,_0x3ef2e5){_0x685346=_0x685346-0x0;var _0x52e15b=_0x04f5[_0x685346];return _0x52e15b;};'use strict';var _=require(_0x504f('0x0'));var util=require(_0x504f('0x1'));var logger=require(_0x504f('0x2'))(_0x504f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x504f('0x4'));var fs=require('fs');var path=require(_0x504f('0x5'));var rimraf=require('rimraf');var config=require(_0x504f('0x6'));var attributes=require('./intZendeskField.attributes');module[_0x504f('0x7')]=function(_0x32743a,_0x540979){return _0x32743a[_0x504f('0x8')](_0x504f('0x9'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x504f('0xa'),'fields':[_0x504f('0xb'),_0x504f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x202f=['../../config/environment','./intZendeskField.attributes','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1c3742,_0x2dacd8){var _0xcfe08e=function(_0x50dbbb){while(--_0x50dbbb){_0x1c3742['push'](_0x1c3742['shift']());}};_0xcfe08e(++_0x2dacd8);}(_0x202f,0x180));var _0xf202=function(_0xfe2c8,_0x580b5f){_0xfe2c8=_0xfe2c8-0x0;var _0xe94e72=_0x202f[_0xfe2c8];return _0xe94e72;};'use strict';var _=require('lodash');var util=require(_0xf202('0x0'));var logger=require(_0xf202('0x1'))(_0xf202('0x2'));var moment=require(_0xf202('0x3'));var BPromise=require(_0xf202('0x4'));var rp=require(_0xf202('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf202('0x6'));var attributes=require(_0xf202('0x7'));module['exports']=function(_0x3b7fde,_0x5d2a93){return _0x3b7fde[_0xf202('0x8')]('ZendeskField',attributes,{'tableName':_0xf202('0x9'),'paranoid':![],'indexes':[{'name':_0xf202('0xa'),'fields':[_0xf202('0xb'),_0xf202('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index fbf2f61..69fcfec 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 _0x83de=['request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s'];(function(_0x2e634b,_0x443dfb){var _0x2fc00b=function(_0x49c24e){while(--_0x49c24e){_0x2e634b['push'](_0x2e634b['shift']());}};_0x2fc00b(++_0x443dfb);}(_0x83de,0x71));var _0xe83d=function(_0x41429a,_0x1a9849){_0x41429a=_0x41429a-0x0;var _0x4c20de=_0x83de[_0x41429a];return _0x4c20de;};'use strict';var _=require(_0xe83d('0x0'));var util=require(_0xe83d('0x1'));var moment=require(_0xe83d('0x2'));var BPromise=require(_0xe83d('0x3'));var rs=require(_0xe83d('0x4'));var fs=require('fs');var Redis=require(_0xe83d('0x5'));var db=require(_0xe83d('0x6'))['db'];var utils=require(_0xe83d('0x7'));var logger=require('../../config/logger')(_0xe83d('0x8'));var config=require(_0xe83d('0x9'));var jayson=require(_0xe83d('0xa'));var client=jayson[_0xe83d('0xb')][_0xe83d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3aafcc,_0x19335d,_0x1da188){return new BPromise(function(_0x389b0a,_0x572bbf){return client[_0xe83d('0xd')](_0x3aafcc,_0x1da188)[_0xe83d('0xe')](function(_0x75cd90){logger[_0xe83d('0xf')](_0xe83d('0x10'),_0x19335d,_0xe83d('0x11'));logger[_0xe83d('0x12')](_0xe83d('0x13'),_0x19335d,_0xe83d('0x11'),JSON[_0xe83d('0x14')](_0x75cd90));if(_0x75cd90[_0xe83d('0x15')]){if(_0x75cd90[_0xe83d('0x15')][_0xe83d('0x16')]===0x1f4){logger[_0xe83d('0x15')](_0xe83d('0x10'),_0x19335d,_0x75cd90[_0xe83d('0x15')][_0xe83d('0x17')]);return _0x572bbf(_0x75cd90[_0xe83d('0x15')][_0xe83d('0x17')]);}logger[_0xe83d('0x15')](_0xe83d('0x10'),_0x19335d,_0x75cd90[_0xe83d('0x15')]['message']);return _0x389b0a(_0x75cd90[_0xe83d('0x15')][_0xe83d('0x17')]);}else{logger[_0xe83d('0xf')](_0xe83d('0x10'),_0x19335d,'request\x20sent');_0x389b0a(_0x75cd90[_0xe83d('0x18')]['message']);}})[_0xe83d('0x19')](function(_0x24f28b){logger[_0xe83d('0x15')]('ZendeskField,\x20%s,\x20%s',_0x19335d,_0x24f28b);_0x572bbf(_0x24f28b);});});} \ No newline at end of file +var _0x9e7a=['request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','ZendeskField,\x20%s,\x20%s'];(function(_0x20448d,_0x1c6163){var _0x2495b6=function(_0x3cf8ef){while(--_0x3cf8ef){_0x20448d['push'](_0x20448d['shift']());}};_0x2495b6(++_0x1c6163);}(_0x9e7a,0xe3));var _0xa9e7=function(_0x172d69,_0x430a4d){_0x172d69=_0x172d69-0x0;var _0x2965e8=_0x9e7a[_0x172d69];return _0x2965e8;};'use strict';var _=require(_0xa9e7('0x0'));var util=require(_0xa9e7('0x1'));var moment=require(_0xa9e7('0x2'));var BPromise=require(_0xa9e7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9e7('0x4'));var db=require(_0xa9e7('0x5'))['db'];var utils=require(_0xa9e7('0x6'));var logger=require(_0xa9e7('0x7'))(_0xa9e7('0x8'));var config=require(_0xa9e7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa9e7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e2792,_0x14b64e,_0x39c217){return new BPromise(function(_0x41d5b7,_0x21f362){return client[_0xa9e7('0xb')](_0x1e2792,_0x39c217)['then'](function(_0x2480c1){logger['info'](_0xa9e7('0xc'),_0x14b64e,_0xa9e7('0xd'));logger[_0xa9e7('0xe')](_0xa9e7('0xf'),_0x14b64e,_0xa9e7('0xd'),JSON['stringify'](_0x2480c1));if(_0x2480c1[_0xa9e7('0x10')]){if(_0x2480c1[_0xa9e7('0x10')]['code']===0x1f4){logger[_0xa9e7('0x10')](_0xa9e7('0xc'),_0x14b64e,_0x2480c1[_0xa9e7('0x10')][_0xa9e7('0x11')]);return _0x21f362(_0x2480c1[_0xa9e7('0x10')][_0xa9e7('0x11')]);}logger[_0xa9e7('0x10')](_0xa9e7('0xc'),_0x14b64e,_0x2480c1[_0xa9e7('0x10')]['message']);return _0x41d5b7(_0x2480c1[_0xa9e7('0x10')][_0xa9e7('0x11')]);}else{logger[_0xa9e7('0x12')](_0xa9e7('0xc'),_0x14b64e,_0xa9e7('0xd'));_0x41d5b7(_0x2480c1['result'][_0xa9e7('0x11')]);}})[_0xa9e7('0x13')](function(_0x1e75b2){logger[_0xa9e7('0x10')](_0xa9e7('0xc'),_0x14b64e,_0x1e75b2);_0x21f362(_0x1e75b2);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 0959968..c0a02a9 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 _0x7011=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0xca09be,_0x275985){var _0x2ad4dd=function(_0x164753){while(--_0x164753){_0xca09be['push'](_0xca09be['shift']());}};_0x2ad4dd(++_0x275985);}(_0x7011,0x1ac));var _0x1701=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0x7011[_0xf16b1];return _0x26f94d;};'use strict';var multer=require(_0x1701('0x0'));var util=require(_0x1701('0x1'));var path=require('path');var timeout=require(_0x1701('0x2'));var express=require(_0x1701('0x3'));var router=express[_0x1701('0x4')]();var fs_extra=require(_0x1701('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1701('0x6'));var config=require(_0x1701('0x7'));var controller=require(_0x1701('0x8'));router[_0x1701('0x9')]('/',auth[_0x1701('0xa')](),controller[_0x1701('0xb')]);router[_0x1701('0x9')](_0x1701('0xc'),auth[_0x1701('0xa')](),controller[_0x1701('0xd')]);router[_0x1701('0x9')](_0x1701('0xe'),auth[_0x1701('0xa')](),controller[_0x1701('0xf')]);router[_0x1701('0x9')](_0x1701('0x10'),auth['isAuthenticated'](),controller[_0x1701('0x11')]);router['post']('/',auth[_0x1701('0xa')](),controller['create']);router[_0x1701('0x12')](_0x1701('0xe'),auth[_0x1701('0xa')](),controller[_0x1701('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1701('0x14')]);router[_0x1701('0x15')](_0x1701('0xc'),auth[_0x1701('0xa')](),controller[_0x1701('0x16')]);module[_0x1701('0x17')]=router; \ No newline at end of file +var _0x0100=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update'];(function(_0x2c4702,_0x3857ed){var _0x54d0a3=function(_0x903ba8){while(--_0x903ba8){_0x2c4702['push'](_0x2c4702['shift']());}};_0x54d0a3(++_0x3857ed);}(_0x0100,0x12c));var _0x0010=function(_0x3ded9c,_0x1701f2){_0x3ded9c=_0x3ded9c-0x0;var _0x504742=_0x0100[_0x3ded9c];return _0x504742;};'use strict';var multer=require(_0x0010('0x0'));var util=require(_0x0010('0x1'));var path=require(_0x0010('0x2'));var timeout=require(_0x0010('0x3'));var express=require(_0x0010('0x4'));var router=express[_0x0010('0x5')]();var fs_extra=require(_0x0010('0x6'));var auth=require(_0x0010('0x7'));var interaction=require(_0x0010('0x8'));var config=require(_0x0010('0x9'));var controller=require(_0x0010('0xa'));router[_0x0010('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0010('0xb')](_0x0010('0xc'),auth[_0x0010('0xd')](),controller[_0x0010('0xe')]);router[_0x0010('0xb')](_0x0010('0xf'),auth[_0x0010('0xd')](),controller['getConfigurations']);router[_0x0010('0xb')](_0x0010('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0x0010('0x11')]('/',auth[_0x0010('0xd')](),controller[_0x0010('0x12')]);router[_0x0010('0x11')]('/:id/configurations',auth[_0x0010('0xd')](),controller[_0x0010('0x13')]);router[_0x0010('0x14')](_0x0010('0xc'),auth[_0x0010('0xd')](),controller[_0x0010('0x15')]);router['delete']('/:id',auth[_0x0010('0xd')](),controller['destroy']);module[_0x0010('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index e4ce862..f620422 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 _0x5636=['sequelize','exports','STRING'];(function(_0x54433f,_0x1017c0){var _0xe87fc=function(_0x7918e1){while(--_0x7918e1){_0x54433f['push'](_0x54433f['shift']());}};_0xe87fc(++_0x1017c0);}(_0x5636,0x102));var _0x6563=function(_0x3e8d0b,_0x5b0520){_0x3e8d0b=_0x3e8d0b-0x0;var _0x3c86bf=_0x5636[_0x3e8d0b];return _0x3c86bf;};'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 +var _0xdace=['STRING','sequelize'];(function(_0x456313,_0x4ea7e2){var _0x2c87b3=function(_0x564a13){while(--_0x564a13){_0x456313['push'](_0x456313['shift']());}};_0x2c87b3(++_0x4ea7e2);}(_0xdace,0xc5));var _0xedac=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0xdace[_0x5f0501];return _0x3c2c45;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'name':{'type':Sequelize[_0xedac('0x1')]},'description':{'type':Sequelize[_0xedac('0x1')]},'host':{'type':Sequelize[_0xedac('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xedac('0x1')]},'clientSecret':{'type':Sequelize[_0xedac('0x1')]},'serverUrl':{'type':Sequelize[_0xedac('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xedac('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 8c57413..60384c1 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 _0xf467=['ZohoConfiguration','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','refresh_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','clientId','clientSecret','serverUrl','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','rows','show','params','include','create','catch','find','body','getConfigurations','findOne'];(function(_0x3e7555,_0x442ce2){var _0x3719e9=function(_0x1825e1){while(--_0x1825e1){_0x3e7555['push'](_0x3e7555['shift']());}};_0x3719e9(++_0x442ce2);}(_0xf467,0x1b4));var _0x7f46=function(_0x962b7c,_0x3fbc7e){_0x962b7c=_0x962b7c-0x0;var _0xbbc58=_0xf467[_0x962b7c];return _0xbbc58;};'use strict';var emlformat=require(_0x7f46('0x0'));var rimraf=require(_0x7f46('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f46('0x2'));var rp=require(_0x7f46('0x3'));var moment=require(_0x7f46('0x4'));var BPromise=require(_0x7f46('0x5'));var Mustache=require(_0x7f46('0x6'));var util=require('util');var path=require(_0x7f46('0x7'));var sox=require(_0x7f46('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f46('0x9'));var squel=require(_0x7f46('0xa'));var crypto=require(_0x7f46('0xb'));var jsforce=require(_0x7f46('0xc'));var deskjs=require(_0x7f46('0xd'));var toCsv=require(_0x7f46('0xe'));var querystring=require(_0x7f46('0xf'));var Papa=require(_0x7f46('0x10'));var Redis=require(_0x7f46('0x11'));var authService=require(_0x7f46('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f46('0x13'));var hardwareService=require(_0x7f46('0x14'));var logger=require(_0x7f46('0x15'))(_0x7f46('0x16'));var utils=require(_0x7f46('0x17'));var config=require(_0x7f46('0x18'));var licenseUtil=require(_0x7f46('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xcdd359,_0x114095){_0x114095=_0x114095||0xcc;return function(_0x503361){if(_0x503361){return _0xcdd359[_0x7f46('0x1a')](_0x114095);}return _0xcdd359[_0x7f46('0x1b')](_0x114095)[_0x7f46('0x1c')]();};}function respondWithResult(_0x517c54,_0x414467){_0x414467=_0x414467||0xc8;return function(_0xce0cbc){if(_0xce0cbc){return _0x517c54['status'](_0x414467)[_0x7f46('0x1d')](_0xce0cbc);}};}function respondWithFilteredResult(_0x337943,_0x2ddd96){return function(_0x50fc3f){if(_0x50fc3f){var _0x3ff236=typeof _0x2ddd96['offset']===_0x7f46('0x1e')&&typeof _0x2ddd96[_0x7f46('0x1f')]===_0x7f46('0x1e');var _0xac2b06=_0x50fc3f[_0x7f46('0x20')];var _0x9075c7=_0x3ff236?0x0:_0x2ddd96[_0x7f46('0x21')];var _0x2aacdd=_0x3ff236?_0x50fc3f[_0x7f46('0x20')]:_0x2ddd96[_0x7f46('0x21')]+_0x2ddd96[_0x7f46('0x1f')];var _0x4886ae;if(_0x2aacdd>=_0xac2b06){_0x2aacdd=_0xac2b06;_0x4886ae=0xc8;}else{_0x4886ae=0xce;}_0x337943[_0x7f46('0x1b')](_0x4886ae);return _0x337943[_0x7f46('0x22')]('Content-Range',_0x9075c7+'-'+_0x2aacdd+'/'+_0xac2b06)[_0x7f46('0x1d')](_0x50fc3f);}return null;};}function patchUpdates(_0x50c2d1){return function(_0x46629a){try{jsonpatch[_0x7f46('0x23')](_0x46629a,_0x50c2d1,!![]);}catch(_0x6ad825){return BPromise[_0x7f46('0x24')](_0x6ad825);}return _0x46629a[_0x7f46('0x25')]();};}function saveUpdates(_0x284ec3,_0x2a8205){return function(_0xdc73a7){if(_0xdc73a7){return _0xdc73a7[_0x7f46('0x26')](_0x284ec3)[_0x7f46('0x27')](function(_0x307d3f){return _0x307d3f;});}return null;};}function removeEntity(_0x1a9447,_0x27db62){return function(_0x56b24a){if(_0x56b24a){return _0x56b24a[_0x7f46('0x28')]()[_0x7f46('0x27')](function(){_0x1a9447['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d65db,_0x5ab69b){return function(_0x1ce726){if(!_0x1ce726){_0x3d65db[_0x7f46('0x1a')](0x194);}return _0x1ce726;};}function handleError(_0x52f159,_0x4e43a4){_0x4e43a4=_0x4e43a4||0x1f4;return function(_0x20f65b){logger[_0x7f46('0x29')](_0x20f65b[_0x7f46('0x2a')]);if(_0x20f65b[_0x7f46('0x2b')]){delete _0x20f65b[_0x7f46('0x2b')];}_0x52f159[_0x7f46('0x1b')](_0x4e43a4)[_0x7f46('0x2c')](_0x20f65b);};}exports['index']=function(_0x65471c,_0x3e7a29){var _0x31d803={},_0x3c988b={},_0x5a8941={'count':0x0,'rows':[]};var _0x2a9ac5=_['map'](db[_0x7f46('0x2d')][_0x7f46('0x2e')],function(_0x20c038){return{'name':_0x20c038[_0x7f46('0x2f')],'type':_0x20c038[_0x7f46('0x30')][_0x7f46('0x31')]};});_0x3c988b[_0x7f46('0x32')]=_['map'](_0x2a9ac5,_0x7f46('0x2b'));_0x3c988b[_0x7f46('0x33')]=_[_0x7f46('0x34')](_0x65471c[_0x7f46('0x33')]);_0x3c988b[_0x7f46('0x35')]=_[_0x7f46('0x36')](_0x3c988b[_0x7f46('0x32')],_0x3c988b[_0x7f46('0x33')]);_0x31d803[_0x7f46('0x37')]=_[_0x7f46('0x36')](_0x3c988b['model'],qs[_0x7f46('0x38')](_0x65471c[_0x7f46('0x33')][_0x7f46('0x38')]));_0x31d803[_0x7f46('0x37')]=_0x31d803['attributes'][_0x7f46('0x39')]?_0x31d803[_0x7f46('0x37')]:_0x3c988b[_0x7f46('0x32')];if(!_0x65471c[_0x7f46('0x33')][_0x7f46('0x3a')](_0x7f46('0x3b'))){_0x31d803[_0x7f46('0x1f')]=qs[_0x7f46('0x1f')](_0x65471c[_0x7f46('0x33')][_0x7f46('0x1f')]);_0x31d803[_0x7f46('0x21')]=qs['offset'](_0x65471c[_0x7f46('0x33')]['offset']);}_0x31d803[_0x7f46('0x3c')]=qs[_0x7f46('0x3d')](_0x65471c[_0x7f46('0x33')][_0x7f46('0x3d')]);_0x31d803[_0x7f46('0x3e')]=qs[_0x7f46('0x35')](_[_0x7f46('0x3f')](_0x65471c[_0x7f46('0x33')],_0x3c988b[_0x7f46('0x35')]),_0x2a9ac5);if(_0x65471c[_0x7f46('0x33')][_0x7f46('0x40')]){_0x31d803[_0x7f46('0x3e')]=_[_0x7f46('0x41')](_0x31d803[_0x7f46('0x3e')],{'$or':_[_0x7f46('0x42')](_0x2a9ac5,function(_0x361b52){if(_0x361b52['type']!==_0x7f46('0x43')){var _0x2e9d54={};_0x2e9d54[_0x361b52[_0x7f46('0x2b')]]={'$like':'%'+_0x65471c[_0x7f46('0x33')]['filter']+'%'};return _0x2e9d54;}})});}_0x31d803=_[_0x7f46('0x41')]({},_0x31d803,_0x65471c[_0x7f46('0x44')]);var _0x5642d4={'where':_0x31d803[_0x7f46('0x3e')]};return db[_0x7f46('0x2d')]['count'](_0x5642d4)[_0x7f46('0x27')](function(_0x107728){_0x5a8941[_0x7f46('0x20')]=_0x107728;if(_0x65471c['query'][_0x7f46('0x45')]){_0x31d803['include']=[{'all':!![]}];}return db[_0x7f46('0x2d')]['findAll'](_0x31d803);})[_0x7f46('0x27')](function(_0x3c7f81){_0x5a8941[_0x7f46('0x46')]=_0x3c7f81;return _0x5a8941;})[_0x7f46('0x27')](respondWithFilteredResult(_0x3e7a29,_0x31d803))['catch'](handleError(_0x3e7a29,null));};exports[_0x7f46('0x47')]=function(_0x43dc66,_0x2857e7){var _0x15b600={'raw':![],'where':{'id':_0x43dc66[_0x7f46('0x48')]['id']}},_0x2d58d2={};_0x2d58d2[_0x7f46('0x32')]=_[_0x7f46('0x34')](db['ZohoAccount'][_0x7f46('0x2e')]);_0x2d58d2['query']=_[_0x7f46('0x34')](_0x43dc66[_0x7f46('0x33')]);_0x2d58d2[_0x7f46('0x35')]=_[_0x7f46('0x36')](_0x2d58d2[_0x7f46('0x32')],_0x2d58d2['query']);_0x15b600['attributes']=_['intersection'](_0x2d58d2['model'],qs[_0x7f46('0x38')](_0x43dc66['query'][_0x7f46('0x38')]));_0x15b600[_0x7f46('0x37')]=_0x15b600['attributes'][_0x7f46('0x39')]?_0x15b600[_0x7f46('0x37')]:_0x2d58d2[_0x7f46('0x32')];if(_0x43dc66['query'][_0x7f46('0x45')]){_0x15b600[_0x7f46('0x49')]=[{'all':!![]}];}_0x15b600=_[_0x7f46('0x41')]({},_0x15b600,_0x43dc66['options']);return db[_0x7f46('0x2d')]['find'](_0x15b600)[_0x7f46('0x27')](handleEntityNotFound(_0x2857e7,null))[_0x7f46('0x27')](respondWithResult(_0x2857e7,null))['catch'](handleError(_0x2857e7,null));};exports['create']=function(_0x33b3f8,_0x568ef1){return db[_0x7f46('0x2d')][_0x7f46('0x4a')](_0x33b3f8['body'],{})[_0x7f46('0x27')](respondWithResult(_0x568ef1,0xc9))[_0x7f46('0x4b')](handleError(_0x568ef1,null));};exports['update']=function(_0x477ce7,_0x489fe5){if(_0x477ce7['body']['id']){delete _0x477ce7['body']['id'];}return db[_0x7f46('0x2d')][_0x7f46('0x4c')]({'where':{'id':_0x477ce7['params']['id']}})[_0x7f46('0x27')](handleEntityNotFound(_0x489fe5,null))[_0x7f46('0x27')](saveUpdates(_0x477ce7[_0x7f46('0x4d')],null))[_0x7f46('0x27')](respondWithResult(_0x489fe5,null))['catch'](handleError(_0x489fe5,null));};exports[_0x7f46('0x28')]=function(_0x5cfe75,_0x1b7b68){return db[_0x7f46('0x2d')][_0x7f46('0x4c')]({'where':{'id':_0x5cfe75['params']['id']}})[_0x7f46('0x27')](handleEntityNotFound(_0x1b7b68,null))[_0x7f46('0x27')](removeEntity(_0x1b7b68,null))[_0x7f46('0x4b')](handleError(_0x1b7b68,null));};exports[_0x7f46('0x4e')]=function(_0x10e0c0,_0x43b441,_0x21f854){var _0x3f03a4={};var _0x2c10e6={};var _0x443ba2;var _0xd647d3;return db[_0x7f46('0x2d')][_0x7f46('0x4f')]({'where':{'id':_0x10e0c0[_0x7f46('0x48')]['id']}})[_0x7f46('0x27')](handleEntityNotFound(_0x43b441,null))[_0x7f46('0x27')](function(_0xb59117){if(_0xb59117){_0x443ba2=_0xb59117;_0x2c10e6[_0x7f46('0x32')]=_[_0x7f46('0x34')](db[_0x7f46('0x50')][_0x7f46('0x2e')]);_0x2c10e6[_0x7f46('0x33')]=_[_0x7f46('0x34')](_0x10e0c0[_0x7f46('0x33')]);_0x2c10e6[_0x7f46('0x35')]=_[_0x7f46('0x36')](_0x2c10e6[_0x7f46('0x32')],_0x2c10e6[_0x7f46('0x33')]);_0x3f03a4[_0x7f46('0x37')]=_[_0x7f46('0x36')](_0x2c10e6[_0x7f46('0x32')],qs[_0x7f46('0x38')](_0x10e0c0['query']['fields']));_0x3f03a4['attributes']=_0x3f03a4[_0x7f46('0x37')][_0x7f46('0x39')]?_0x3f03a4[_0x7f46('0x37')]:_0x2c10e6[_0x7f46('0x32')];_0x3f03a4[_0x7f46('0x3c')]=qs[_0x7f46('0x3d')](_0x10e0c0['query'][_0x7f46('0x3d')]);_0x3f03a4[_0x7f46('0x3e')]=qs[_0x7f46('0x35')](_[_0x7f46('0x3f')](_0x10e0c0[_0x7f46('0x33')],_0x2c10e6[_0x7f46('0x35')]));if(_0x10e0c0[_0x7f46('0x33')]['filter']){_0x3f03a4['where']=_['merge'](_0x3f03a4[_0x7f46('0x3e')],{'$or':_[_0x7f46('0x42')](_0x3f03a4[_0x7f46('0x37')],function(_0xb71cfe){var _0x265c45={};_0x265c45[_0xb71cfe]={'$like':'%'+_0x10e0c0[_0x7f46('0x33')][_0x7f46('0x40')]+'%'};return _0x265c45;})});}_0x3f03a4=_[_0x7f46('0x41')]({},_0x3f03a4,_0x10e0c0[_0x7f46('0x44')]);return _0x443ba2[_0x7f46('0x4e')](_0x3f03a4);}})['then'](function(_0x14ab8a){if(_0x14ab8a){_0xd647d3=_0x14ab8a[_0x7f46('0x39')];if(!_0x10e0c0[_0x7f46('0x33')][_0x7f46('0x3a')](_0x7f46('0x3b'))){_0x3f03a4[_0x7f46('0x1f')]=qs[_0x7f46('0x1f')](_0x10e0c0[_0x7f46('0x33')][_0x7f46('0x1f')]);_0x3f03a4[_0x7f46('0x21')]=qs[_0x7f46('0x21')](_0x10e0c0['query'][_0x7f46('0x21')]);}return _0x443ba2['getConfigurations'](_0x3f03a4);}})[_0x7f46('0x27')](function(_0x10f56b){if(_0x10f56b){return _0x10f56b?{'count':_0xd647d3,'rows':_0x10f56b}:null;}})[_0x7f46('0x27')](respondWithResult(_0x43b441,null))['catch'](handleError(_0x43b441,null));};exports[_0x7f46('0x51')]=function(_0x27a446,_0x41ba30,_0x16d527){if(_0x27a446[_0x7f46('0x4d')]['id']){delete _0x27a446[_0x7f46('0x4d')]['id'];}return db['ZohoAccount'][_0x7f46('0x4f')]({'where':{'id':_0x27a446[_0x7f46('0x48')]['id']}})[_0x7f46('0x27')](handleEntityNotFound(_0x41ba30,null))[_0x7f46('0x27')](function(_0x580546){if(_0x580546){_0x27a446[_0x7f46('0x4d')][_0x7f46('0x52')]=_0x580546['id'];_0x27a446['body'][_0x7f46('0x53')]=integrations['getSubjects'](_0x27a446[_0x7f46('0x4d')]['channel'],_0x27a446[_0x7f46('0x4d')][_0x7f46('0x30')]);_0x27a446[_0x7f46('0x4d')][_0x7f46('0x54')]=integrations[_0x7f46('0x55')](_0x27a446['body'][_0x7f46('0x56')],_0x27a446[_0x7f46('0x4d')]['type']);return db[_0x7f46('0x50')]['create'](_0x27a446[_0x7f46('0x4d')],{'include':[{'model':db[_0x7f46('0x57')],'as':_0x7f46('0x53')},{'model':db['ZohoField'],'as':_0x7f46('0x54')}]});}return null;})['then'](respondWithResult(_0x41ba30,null))[_0x7f46('0x4b')](handleError(_0x41ba30,null));};function getAccessToken(_0xbaf86a){return new Promise(function(_0x236255,_0x5a47ac){var _0x371ee8;switch(_0xbaf86a[_0x7f46('0x58')]){case'US':_0x371ee8=_0x7f46('0x59');break;case'AU':_0x371ee8=_0x7f46('0x5a');break;case'EU':_0x371ee8='https://accounts.zoho.eu';break;case'IN':_0x371ee8='https://accounts.zoho.in';break;case'CN':_0x371ee8=_0x7f46('0x5b');break;default:_0x371ee8='https://accounts.zoho.eu';break;}var _0x159997={'method':'POST','uri':_0x371ee8+_0x7f46('0x5c'),'qs':{'refresh_token':_0xbaf86a[_0x7f46('0x5d')],'client_id':_0xbaf86a['clientId'],'client_secret':_0xbaf86a['clientSecret'],'grant_type':_0x7f46('0x5e')},'json':!![]};return rp(_0x159997)[_0x7f46('0x27')](function(_0x5edcec){if(_0x5edcec['access_token']){_0x236255(_0x5edcec['access_token']);}else{_0x5a47ac(_0x7f46('0x5f'));}})[_0x7f46('0x4b')](function(_0x32b6a9){_0x5a47ac(_0x32b6a9);});});}exports['getFields']=function(_0x5c433a,_0x3f6091,_0x1242cb){var _0x416f01,_0x220d7b,_0x510881,_0x147f6d,_0x39cb14;return db[_0x7f46('0x2d')][_0x7f46('0x4f')]({'where':{'id':_0x5c433a[_0x7f46('0x48')]['id']},'attributes':['id','host','zone',_0x7f46('0x60'),_0x7f46('0x61'),_0x7f46('0x62'),'code','refreshToken']})[_0x7f46('0x27')](handleEntityNotFound(_0x3f6091,null))[_0x7f46('0x27')](function(_0x594fbc){_0x39cb14=_0x594fbc;_0x416f01=_0x39cb14['host'];_0x220d7b=_0x416f01==='zoho.eu'?'eu':'com';_0x510881=_0x39cb14[_0x7f46('0x62')];var _0x47dffe=_0x510881[_0x7f46('0x63')](-0x1);if(_0x47dffe==='/'||_0x47dffe==='\x5c'||_0x47dffe===':'){_0x510881=_0x510881['substring'](0x0,_0x510881[_0x7f46('0x64')](_0x47dffe));}if(!_0x39cb14[_0x7f46('0x5d')]){throw new Error(_0x7f46('0x65'));}return getAccessToken(_0x39cb14);})['then'](function(_0x57ec20){if(_0x57ec20){return rp({'method':_0x7f46('0x66'),'uri':util[_0x7f46('0x67')](_0x7f46('0x68'),_0x220d7b),'qs':{'module':_0x7f46('0x69')},'headers':{'Authorization':_0x7f46('0x6a')+_0x57ec20},'json':!![]});}})['then'](function(_0x48a1a3){if(_0x48a1a3){if(_0x48a1a3['response']&&_0x48a1a3[_0x7f46('0x6b')]['error']){throw new Error(_0x48a1a3['response']['error'][_0x7f46('0x6c')]);}var _0x472a16=[];var _0xf01212=[];var _0x55cd18=[_0x7f46('0x6d'),_0x7f46('0x6e'),_0x7f46('0x6f'),'WhoId',_0x7f46('0x70'),_0x7f46('0x71'),_0x7f46('0x72'),_0x7f46('0x73')];_0xf01212=_[_0x7f46('0x74')](_0x48a1a3['fields'],function(_0x561d9c){return _0x55cd18[_0x7f46('0x75')](_0x561d9c[_0x7f46('0x76')]);});for(var _0x1919a7=0x0;_0x1919a7<_0xf01212[_0x7f46('0x39')];_0x1919a7++){if(_0xf01212[_0x1919a7][_0x7f46('0x77')]===![]){_0x472a16[_0x7f46('0x78')]({'id':_0xf01212[_0x1919a7]['id'],'name':_0xf01212[_0x1919a7][_0x7f46('0x79')],'custom':_0xf01212[_0x1919a7]['custom_field'],'options':_0xf01212[_0x1919a7][_0x7f46('0x7a')]==='picklist'&&_0xf01212[_0x1919a7]['pick_list_values']['length']>-0x1?_['map'](_0xf01212[_0x1919a7]['pick_list_values'],function(_0x3a0036){return{'name':_0x3a0036,'value':_0x3a0036};}):[]});}}return{'count':_0x472a16[_0x7f46('0x39')],'rows':_0x472a16};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x3f6091,null))['catch'](function(_0x41ac8b){var _0x5cccca=_0x5c433a['query'][_0x7f46('0x7b')]?0x1f4:_0x41ac8b[_0x7f46('0x7c')]||0x1f4;logger[_0x7f46('0x29')](_0x7f46('0x7d'),_0x7f46('0x7e'),_0x5cccca,JSON[_0x7f46('0x7f')](_0x41ac8b));delete _0x41ac8b['name'];if(_0x5cccca===0x191){_0x5cccca=0x190;}_0x3f6091[_0x7f46('0x1b')](_0x5cccca)[_0x7f46('0x2c')](_0x5c433a['query'][_0x7f46('0x7b')]?{'message':_0x7f46('0x80'),'statusCode':_0x41ac8b[_0x7f46('0x7c')]}:_0x41ac8b);});}; \ No newline at end of file +var _0x3c58=['params','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','serverUrl','code','zoho.eu','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Description','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','ZohoAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','create','catch','body','find'];(function(_0x13ab52,_0x4f9cd6){var _0x4eb25d=function(_0x425099){while(--_0x425099){_0x13ab52['push'](_0x13ab52['shift']());}};_0x4eb25d(++_0x4f9cd6);}(_0x3c58,0x13b));var _0x83c5=function(_0x1cd7fc,_0x5b4019){_0x1cd7fc=_0x1cd7fc-0x0;var _0x50ff2e=_0x3c58[_0x1cd7fc];return _0x50ff2e;};'use strict';var emlformat=require(_0x83c5('0x0'));var rimraf=require(_0x83c5('0x1'));var zipdir=require(_0x83c5('0x2'));var jsonpatch=require(_0x83c5('0x3'));var rp=require(_0x83c5('0x4'));var moment=require(_0x83c5('0x5'));var BPromise=require(_0x83c5('0x6'));var Mustache=require(_0x83c5('0x7'));var util=require('util');var path=require(_0x83c5('0x8'));var sox=require(_0x83c5('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83c5('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x83c5('0xb'));var querystring=require(_0x83c5('0xc'));var Papa=require(_0x83c5('0xd'));var Redis=require(_0x83c5('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x83c5('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x83c5('0x10'));var logger=require(_0x83c5('0x11'))(_0x83c5('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x83c5('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x83c5('0x14'));function respondWithStatusCode(_0x1ff565,_0x23992b){_0x23992b=_0x23992b||0xcc;return function(_0x27ffc1){if(_0x27ffc1){return _0x1ff565[_0x83c5('0x15')](_0x23992b);}return _0x1ff565[_0x83c5('0x16')](_0x23992b)['end']();};}function respondWithResult(_0xfbee79,_0x52fcf0){_0x52fcf0=_0x52fcf0||0xc8;return function(_0xacb54a){if(_0xacb54a){return _0xfbee79[_0x83c5('0x16')](_0x52fcf0)[_0x83c5('0x17')](_0xacb54a);}};}function respondWithFilteredResult(_0x4b7cca,_0x13c711){return function(_0x5c0bb5){if(_0x5c0bb5){var _0x40162c=typeof _0x13c711[_0x83c5('0x18')]===_0x83c5('0x19')&&typeof _0x13c711['limit']===_0x83c5('0x19');var _0x1bcbd7=_0x5c0bb5[_0x83c5('0x1a')];var _0x91a3a=_0x40162c?0x0:_0x13c711[_0x83c5('0x18')];var _0x223ba0=_0x40162c?_0x5c0bb5[_0x83c5('0x1a')]:_0x13c711[_0x83c5('0x18')]+_0x13c711[_0x83c5('0x1b')];var _0x39dd1c;if(_0x223ba0>=_0x1bcbd7){_0x223ba0=_0x1bcbd7;_0x39dd1c=0xc8;}else{_0x39dd1c=0xce;}_0x4b7cca['status'](_0x39dd1c);return _0x4b7cca[_0x83c5('0x1c')](_0x83c5('0x1d'),_0x91a3a+'-'+_0x223ba0+'/'+_0x1bcbd7)[_0x83c5('0x17')](_0x5c0bb5);}return null;};}function patchUpdates(_0x45ba33){return function(_0xd5739c){try{jsonpatch[_0x83c5('0x1e')](_0xd5739c,_0x45ba33,!![]);}catch(_0x1381b3){return BPromise[_0x83c5('0x1f')](_0x1381b3);}return _0xd5739c[_0x83c5('0x20')]();};}function saveUpdates(_0x5e912d,_0x1fb19c){return function(_0x22b3d9){if(_0x22b3d9){return _0x22b3d9[_0x83c5('0x21')](_0x5e912d)[_0x83c5('0x22')](function(_0x4b0ac9){return _0x4b0ac9;});}return null;};}function removeEntity(_0x1b8d31,_0x5a49a9){return function(_0x4bdc66){if(_0x4bdc66){return _0x4bdc66[_0x83c5('0x23')]()[_0x83c5('0x22')](function(){_0x1b8d31['status'](0xcc)[_0x83c5('0x24')]();});}};}function handleEntityNotFound(_0x6d412a,_0x7ae206){return function(_0x4b5d5f){if(!_0x4b5d5f){_0x6d412a[_0x83c5('0x15')](0x194);}return _0x4b5d5f;};}function handleError(_0x41ee8f,_0x516a94){_0x516a94=_0x516a94||0x1f4;return function(_0x3f6587){logger[_0x83c5('0x25')](_0x3f6587[_0x83c5('0x26')]);if(_0x3f6587[_0x83c5('0x27')]){delete _0x3f6587[_0x83c5('0x27')];}_0x41ee8f[_0x83c5('0x16')](_0x516a94)['send'](_0x3f6587);};}exports['index']=function(_0x5c23f7,_0x1b92cc){var _0x5c518a={},_0x210583={},_0x335f4c={'count':0x0,'rows':[]};var _0x1ac0d5=_[_0x83c5('0x28')](db[_0x83c5('0x29')][_0x83c5('0x2a')],function(_0x37676e){return{'name':_0x37676e[_0x83c5('0x2b')],'type':_0x37676e[_0x83c5('0x2c')][_0x83c5('0x2d')]};});_0x210583['model']=_['map'](_0x1ac0d5,_0x83c5('0x27'));_0x210583[_0x83c5('0x2e')]=_[_0x83c5('0x2f')](_0x5c23f7['query']);_0x210583[_0x83c5('0x30')]=_[_0x83c5('0x31')](_0x210583[_0x83c5('0x32')],_0x210583[_0x83c5('0x2e')]);_0x5c518a[_0x83c5('0x33')]=_[_0x83c5('0x31')](_0x210583['model'],qs[_0x83c5('0x34')](_0x5c23f7[_0x83c5('0x2e')][_0x83c5('0x34')]));_0x5c518a[_0x83c5('0x33')]=_0x5c518a[_0x83c5('0x33')][_0x83c5('0x35')]?_0x5c518a[_0x83c5('0x33')]:_0x210583['model'];if(!_0x5c23f7[_0x83c5('0x2e')]['hasOwnProperty'](_0x83c5('0x36'))){_0x5c518a['limit']=qs[_0x83c5('0x1b')](_0x5c23f7[_0x83c5('0x2e')][_0x83c5('0x1b')]);_0x5c518a[_0x83c5('0x18')]=qs['offset'](_0x5c23f7[_0x83c5('0x2e')][_0x83c5('0x18')]);}_0x5c518a[_0x83c5('0x37')]=qs[_0x83c5('0x38')](_0x5c23f7[_0x83c5('0x2e')][_0x83c5('0x38')]);_0x5c518a[_0x83c5('0x39')]=qs[_0x83c5('0x30')](_[_0x83c5('0x3a')](_0x5c23f7['query'],_0x210583[_0x83c5('0x30')]),_0x1ac0d5);if(_0x5c23f7[_0x83c5('0x2e')][_0x83c5('0x3b')]){_0x5c518a[_0x83c5('0x39')]=_[_0x83c5('0x3c')](_0x5c518a['where'],{'$or':_[_0x83c5('0x28')](_0x1ac0d5,function(_0x5d58c6){if(_0x5d58c6[_0x83c5('0x2c')]!==_0x83c5('0x3d')){var _0x389176={};_0x389176[_0x5d58c6['name']]={'$like':'%'+_0x5c23f7[_0x83c5('0x2e')][_0x83c5('0x3b')]+'%'};return _0x389176;}})});}_0x5c518a=_[_0x83c5('0x3c')]({},_0x5c518a,_0x5c23f7[_0x83c5('0x3e')]);var _0x23821c={'where':_0x5c518a[_0x83c5('0x39')]};return db['ZohoAccount'][_0x83c5('0x1a')](_0x23821c)[_0x83c5('0x22')](function(_0x326cc7){_0x335f4c['count']=_0x326cc7;if(_0x5c23f7[_0x83c5('0x2e')][_0x83c5('0x3f')]){_0x5c518a[_0x83c5('0x40')]=[{'all':!![]}];}return db[_0x83c5('0x29')][_0x83c5('0x41')](_0x5c518a);})[_0x83c5('0x22')](function(_0x158cf1){_0x335f4c[_0x83c5('0x42')]=_0x158cf1;return _0x335f4c;})['then'](respondWithFilteredResult(_0x1b92cc,_0x5c518a))['catch'](handleError(_0x1b92cc,null));};exports[_0x83c5('0x43')]=function(_0x4e68cf,_0x407e7b){var _0xc37ead={'raw':![],'where':{'id':_0x4e68cf['params']['id']}},_0x11a725={};_0x11a725[_0x83c5('0x32')]=_[_0x83c5('0x2f')](db[_0x83c5('0x29')][_0x83c5('0x2a')]);_0x11a725['query']=_[_0x83c5('0x2f')](_0x4e68cf[_0x83c5('0x2e')]);_0x11a725[_0x83c5('0x30')]=_[_0x83c5('0x31')](_0x11a725[_0x83c5('0x32')],_0x11a725[_0x83c5('0x2e')]);_0xc37ead['attributes']=_[_0x83c5('0x31')](_0x11a725[_0x83c5('0x32')],qs[_0x83c5('0x34')](_0x4e68cf[_0x83c5('0x2e')][_0x83c5('0x34')]));_0xc37ead[_0x83c5('0x33')]=_0xc37ead[_0x83c5('0x33')][_0x83c5('0x35')]?_0xc37ead[_0x83c5('0x33')]:_0x11a725[_0x83c5('0x32')];if(_0x4e68cf[_0x83c5('0x2e')][_0x83c5('0x3f')]){_0xc37ead[_0x83c5('0x40')]=[{'all':!![]}];}_0xc37ead=_['merge']({},_0xc37ead,_0x4e68cf[_0x83c5('0x3e')]);return db['ZohoAccount']['find'](_0xc37ead)[_0x83c5('0x22')](handleEntityNotFound(_0x407e7b,null))[_0x83c5('0x22')](respondWithResult(_0x407e7b,null))['catch'](handleError(_0x407e7b,null));};exports[_0x83c5('0x44')]=function(_0x3d580e,_0x3d3d31){return db[_0x83c5('0x29')][_0x83c5('0x44')](_0x3d580e['body'],{})[_0x83c5('0x22')](respondWithResult(_0x3d3d31,0xc9))[_0x83c5('0x45')](handleError(_0x3d3d31,null));};exports[_0x83c5('0x21')]=function(_0x3f8c33,_0x4d213a){if(_0x3f8c33[_0x83c5('0x46')]['id']){delete _0x3f8c33[_0x83c5('0x46')]['id'];}return db[_0x83c5('0x29')][_0x83c5('0x47')]({'where':{'id':_0x3f8c33[_0x83c5('0x48')]['id']}})[_0x83c5('0x22')](handleEntityNotFound(_0x4d213a,null))['then'](saveUpdates(_0x3f8c33[_0x83c5('0x46')],null))[_0x83c5('0x22')](respondWithResult(_0x4d213a,null))[_0x83c5('0x45')](handleError(_0x4d213a,null));};exports[_0x83c5('0x23')]=function(_0x12f31d,_0x1334fa){return db['ZohoAccount']['find']({'where':{'id':_0x12f31d['params']['id']}})[_0x83c5('0x22')](handleEntityNotFound(_0x1334fa,null))[_0x83c5('0x22')](removeEntity(_0x1334fa,null))[_0x83c5('0x45')](handleError(_0x1334fa,null));};exports[_0x83c5('0x49')]=function(_0x22d892,_0x57a098,_0x570d51){var _0xda084d={};var _0xa55543={};var _0x3d377c;var _0x368dd2;return db[_0x83c5('0x29')][_0x83c5('0x4a')]({'where':{'id':_0x22d892[_0x83c5('0x48')]['id']}})[_0x83c5('0x22')](handleEntityNotFound(_0x57a098,null))[_0x83c5('0x22')](function(_0x13e846){if(_0x13e846){_0x3d377c=_0x13e846;_0xa55543['model']=_[_0x83c5('0x2f')](db[_0x83c5('0x4b')][_0x83c5('0x2a')]);_0xa55543['query']=_[_0x83c5('0x2f')](_0x22d892[_0x83c5('0x2e')]);_0xa55543[_0x83c5('0x30')]=_[_0x83c5('0x31')](_0xa55543[_0x83c5('0x32')],_0xa55543[_0x83c5('0x2e')]);_0xda084d[_0x83c5('0x33')]=_[_0x83c5('0x31')](_0xa55543[_0x83c5('0x32')],qs['fields'](_0x22d892[_0x83c5('0x2e')][_0x83c5('0x34')]));_0xda084d[_0x83c5('0x33')]=_0xda084d[_0x83c5('0x33')][_0x83c5('0x35')]?_0xda084d[_0x83c5('0x33')]:_0xa55543['model'];_0xda084d['order']=qs[_0x83c5('0x38')](_0x22d892['query'][_0x83c5('0x38')]);_0xda084d[_0x83c5('0x39')]=qs[_0x83c5('0x30')](_[_0x83c5('0x3a')](_0x22d892[_0x83c5('0x2e')],_0xa55543[_0x83c5('0x30')]));if(_0x22d892[_0x83c5('0x2e')][_0x83c5('0x3b')]){_0xda084d['where']=_[_0x83c5('0x3c')](_0xda084d[_0x83c5('0x39')],{'$or':_[_0x83c5('0x28')](_0xda084d[_0x83c5('0x33')],function(_0x46dfd8){var _0x51b1c8={};_0x51b1c8[_0x46dfd8]={'$like':'%'+_0x22d892[_0x83c5('0x2e')]['filter']+'%'};return _0x51b1c8;})});}_0xda084d=_[_0x83c5('0x3c')]({},_0xda084d,_0x22d892[_0x83c5('0x3e')]);return _0x3d377c[_0x83c5('0x49')](_0xda084d);}})[_0x83c5('0x22')](function(_0x2e7f04){if(_0x2e7f04){_0x368dd2=_0x2e7f04[_0x83c5('0x35')];if(!_0x22d892[_0x83c5('0x2e')][_0x83c5('0x4c')](_0x83c5('0x36'))){_0xda084d[_0x83c5('0x1b')]=qs[_0x83c5('0x1b')](_0x22d892[_0x83c5('0x2e')]['limit']);_0xda084d['offset']=qs[_0x83c5('0x18')](_0x22d892[_0x83c5('0x2e')]['offset']);}return _0x3d377c['getConfigurations'](_0xda084d);}})['then'](function(_0x500b75){if(_0x500b75){return _0x500b75?{'count':_0x368dd2,'rows':_0x500b75}:null;}})[_0x83c5('0x22')](respondWithResult(_0x57a098,null))[_0x83c5('0x45')](handleError(_0x57a098,null));};exports['addConfiguration']=function(_0x3b2e48,_0x4627c1,_0x378852){if(_0x3b2e48[_0x83c5('0x46')]['id']){delete _0x3b2e48[_0x83c5('0x46')]['id'];}return db['ZohoAccount'][_0x83c5('0x4a')]({'where':{'id':_0x3b2e48[_0x83c5('0x48')]['id']}})[_0x83c5('0x22')](handleEntityNotFound(_0x4627c1,null))['then'](function(_0x4f3737){if(_0x4f3737){_0x3b2e48[_0x83c5('0x46')][_0x83c5('0x4d')]=_0x4f3737['id'];_0x3b2e48[_0x83c5('0x46')][_0x83c5('0x4e')]=integrations[_0x83c5('0x4f')](_0x3b2e48[_0x83c5('0x46')][_0x83c5('0x50')],_0x3b2e48[_0x83c5('0x46')][_0x83c5('0x2c')]);_0x3b2e48[_0x83c5('0x46')][_0x83c5('0x51')]=integrations[_0x83c5('0x52')](_0x3b2e48[_0x83c5('0x46')][_0x83c5('0x50')],_0x3b2e48[_0x83c5('0x46')][_0x83c5('0x2c')]);return db[_0x83c5('0x4b')][_0x83c5('0x44')](_0x3b2e48[_0x83c5('0x46')],{'include':[{'model':db[_0x83c5('0x53')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0x83c5('0x51')}]});}return null;})[_0x83c5('0x22')](respondWithResult(_0x4627c1,null))['catch'](handleError(_0x4627c1,null));};function getAccessToken(_0x31e863){return new Promise(function(_0x4f8f86,_0x41b4e2){var _0x131b68;switch(_0x31e863[_0x83c5('0x54')]){case'US':_0x131b68=_0x83c5('0x55');break;case'AU':_0x131b68=_0x83c5('0x56');break;case'EU':_0x131b68=_0x83c5('0x57');break;case'IN':_0x131b68=_0x83c5('0x58');break;case'CN':_0x131b68='https://accounts.zoho.com.cn';break;default:_0x131b68=_0x83c5('0x57');break;}var _0xa9d83c={'method':_0x83c5('0x59'),'uri':_0x131b68+_0x83c5('0x5a'),'qs':{'refresh_token':_0x31e863[_0x83c5('0x5b')],'client_id':_0x31e863['clientId'],'client_secret':_0x31e863[_0x83c5('0x5c')],'grant_type':_0x83c5('0x5d')},'json':!![]};return rp(_0xa9d83c)[_0x83c5('0x22')](function(_0x34b624){if(_0x34b624[_0x83c5('0x5e')]){_0x4f8f86(_0x34b624[_0x83c5('0x5e')]);}else{_0x41b4e2(_0x83c5('0x5f'));}})[_0x83c5('0x45')](function(_0x1a2359){_0x41b4e2(_0x1a2359);});});}exports[_0x83c5('0x60')]=function(_0x5423dd,_0x370718,_0x459955){var _0x52140d,_0x247ad9,_0x3c9256,_0xf1bc9c,_0x36fa33;return db[_0x83c5('0x29')][_0x83c5('0x4a')]({'where':{'id':_0x5423dd[_0x83c5('0x48')]['id']},'attributes':['id',_0x83c5('0x61'),_0x83c5('0x54'),_0x83c5('0x62'),'clientSecret',_0x83c5('0x63'),_0x83c5('0x64'),_0x83c5('0x5b')]})[_0x83c5('0x22')](handleEntityNotFound(_0x370718,null))[_0x83c5('0x22')](function(_0x9f04b8){_0x36fa33=_0x9f04b8;_0x52140d=_0x36fa33[_0x83c5('0x61')];_0x247ad9=_0x52140d===_0x83c5('0x65')?'eu':_0x83c5('0x66');_0x3c9256=_0x36fa33['serverUrl'];var _0x54f5a7=_0x3c9256[_0x83c5('0x67')](-0x1);if(_0x54f5a7==='/'||_0x54f5a7==='\x5c'||_0x54f5a7===':'){_0x3c9256=_0x3c9256[_0x83c5('0x68')](0x0,_0x3c9256['lastIndexOf'](_0x54f5a7));}if(!_0x36fa33[_0x83c5('0x5b')]){throw new Error(_0x83c5('0x69'));}return getAccessToken(_0x36fa33);})[_0x83c5('0x22')](function(_0xcee8d7){if(_0xcee8d7){return rp({'method':'GET','uri':util[_0x83c5('0x6a')](_0x83c5('0x6b'),_0x247ad9),'qs':{'module':'Calls'},'headers':{'Authorization':_0x83c5('0x6c')+_0xcee8d7},'json':!![]});}})['then'](function(_0x7d8772){if(_0x7d8772){if(_0x7d8772['response']&&_0x7d8772[_0x83c5('0x6d')][_0x83c5('0x25')]){throw new Error(_0x7d8772['response'][_0x83c5('0x25')]['message']);}var _0xa94fbe=[];var _0x2a0cbc=[];var _0x45e6f6=['Owner','Subject',_0x83c5('0x6e'),'WhoId','Call_Duration',_0x83c5('0x6f'),_0x83c5('0x70'),_0x83c5('0x71')];_0x2a0cbc=_[_0x83c5('0x72')](_0x7d8772[_0x83c5('0x34')],function(_0x3d7ba7){return _0x45e6f6[_0x83c5('0x73')](_0x3d7ba7[_0x83c5('0x74')]);});for(var _0x4faa12=0x0;_0x4faa12<_0x2a0cbc[_0x83c5('0x35')];_0x4faa12++){if(_0x2a0cbc[_0x4faa12][_0x83c5('0x75')]===![]){_0xa94fbe[_0x83c5('0x76')]({'id':_0x2a0cbc[_0x4faa12]['id'],'name':_0x2a0cbc[_0x4faa12][_0x83c5('0x77')],'custom':_0x2a0cbc[_0x4faa12][_0x83c5('0x78')],'options':_0x2a0cbc[_0x4faa12][_0x83c5('0x79')]===_0x83c5('0x7a')&&_0x2a0cbc[_0x4faa12]['pick_list_values'][_0x83c5('0x35')]>-0x1?_[_0x83c5('0x28')](_0x2a0cbc[_0x4faa12][_0x83c5('0x7b')],function(_0x108e25){return{'name':_0x108e25,'value':_0x108e25};}):[]});}}return{'count':_0xa94fbe[_0x83c5('0x35')],'rows':_0xa94fbe};}else{return{'count':0x0,'rows':[]};}})[_0x83c5('0x22')](respondWithResult(_0x370718,null))[_0x83c5('0x45')](function(_0xc58a79){var _0x263c9a=_0x5423dd['query'][_0x83c5('0x7c')]?0x1f4:_0xc58a79[_0x83c5('0x7d')]||0x1f4;logger[_0x83c5('0x25')](_0x83c5('0x7e'),_0x83c5('0x60'),_0x263c9a,JSON[_0x83c5('0x7f')](_0xc58a79));delete _0xc58a79[_0x83c5('0x27')];if(_0x263c9a===0x191){_0x263c9a=0x190;}_0x370718[_0x83c5('0x16')](_0x263c9a)['send'](_0x5423dd[_0x83c5('0x2e')][_0x83c5('0x7c')]?{'message':_0x83c5('0x80'),'statusCode':_0xc58a79[_0x83c5('0x7d')]}:_0xc58a79);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index a1ef7fa..8ab5989 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 _0xe565=['name','inspect','catch','error','slice','https://accounts.zoho.com.au','https://accounts.zoho.in','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','code','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0xe565,0x195));var _0x5e56=function(_0x341249,_0x5e2f32){_0x341249=_0x341249-0x0;var _0x446154=_0xe565[_0x341249];return _0x446154;};'use strict';var _=require(_0x5e56('0x0'));var util=require(_0x5e56('0x1'));var logger=require(_0x5e56('0x2'))('api');var moment=require(_0x5e56('0x3'));var BPromise=require(_0x5e56('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e56('0x5'));var rimraf=require(_0x5e56('0x6'));var config=require(_0x5e56('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x5e56('0x8'));module[_0x5e56('0x9')]=function(_0x130333,_0xd78abf){return _0x130333[_0x5e56('0xa')](_0x5e56('0xb'),attributes,{'tableName':_0x5e56('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1f8a83,_0x5589d2,_0x469bae){if(_0x1f8a83[_0x5e56('0xd')](_0x5e56('0xe'))||_0x1f8a83['changed'](_0x5e56('0xf'))||_0x1f8a83['changed'](_0x5e56('0x10'))||_0x1f8a83['changed']('clientSecret')||_0x1f8a83[_0x5e56('0xd')](_0x5e56('0x11'))||_0x1f8a83[_0x5e56('0xd')](_0x5e56('0x12'))){var _0x15aebe,_0xc7d228;_0x15aebe=_0x1f8a83['serverUrl'];var _0x5ceab2=_0x15aebe['slice'](-0x1);if(_0x5ceab2==='/'||_0x5ceab2==='\x5c'||_0x5ceab2===':'){_0x15aebe=_0x15aebe[_0x5e56('0x13')](0x0,_0x15aebe[_0x5e56('0x14')](_0x5ceab2));}switch(_0x1f8a83[_0x5e56('0xe')]){case'US':_0xc7d228=_0x5e56('0x15');break;case'AU':_0xc7d228='https://accounts.zoho.com.au';break;case'IN':_0xc7d228='https://accounts.zoho.in';break;case'CN':_0xc7d228=_0x5e56('0x16');break;default:_0xc7d228=_0x5e56('0x17');break;}var _0x114916={'method':_0x5e56('0x18'),'uri':_0xc7d228+_0x5e56('0x19'),'form':{'grant_type':_0x5e56('0x1a'),'client_id':_0x1f8a83[_0x5e56('0x10')],'client_secret':_0x1f8a83[_0x5e56('0x1b')],'redirect_uri':_0x1f8a83[_0x5e56('0xf')],'code':_0x1f8a83[_0x5e56('0x11')]},'headers':{'Content-Type':_0x5e56('0x1c')}};return rp(_0x114916)[_0x5e56('0x1d')](function(_0x9ad8d3){var _0x4b8735=JSON[_0x5e56('0x1e')](_0x9ad8d3);if(_0x4b8735[_0x5e56('0x1f')]){_0x1f8a83[_0x5e56('0x20')]=_0x4b8735['refresh_token'];logger[_0x5e56('0x21')](util[_0x5e56('0x22')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1f8a83[_0x5e56('0x23')],_0x1f8a83['id']));}else{logger['error'](util[_0x5e56('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1f8a83[_0x5e56('0x23')],_0x1f8a83['id']),util[_0x5e56('0x24')](_0x4b8735,{'showHidden':![],'depth':null}));}return _0x469bae(null,_0x5589d2);})[_0x5e56('0x25')](function(_0x492408){logger[_0x5e56('0x26')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1f8a83['name'],_0x1f8a83['id']),util[_0x5e56('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x469bae(_0x492408);});}else{return _0x469bae(null,_0x5589d2);}},'beforeUpdate':function(_0x151c25,_0x404ed5,_0x522301){if(_0x151c25['changed'](_0x5e56('0xe'))||_0x151c25[_0x5e56('0xd')]('serverUrl')||_0x151c25[_0x5e56('0xd')](_0x5e56('0x10'))||_0x151c25[_0x5e56('0xd')](_0x5e56('0x1b'))||_0x151c25[_0x5e56('0xd')]('code')||_0x151c25[_0x5e56('0xd')]('host')){var _0x29bc8b,_0x266b97;_0x29bc8b=_0x151c25[_0x5e56('0xf')];var _0x6ff350=_0x29bc8b[_0x5e56('0x27')](-0x1);if(_0x6ff350==='/'||_0x6ff350==='\x5c'||_0x6ff350===':'){_0x29bc8b=_0x29bc8b[_0x5e56('0x13')](0x0,_0x29bc8b[_0x5e56('0x14')](_0x6ff350));}switch(_0x151c25[_0x5e56('0xe')]){case'US':_0x266b97=_0x5e56('0x15');break;case'AU':_0x266b97=_0x5e56('0x28');break;case'IN':_0x266b97=_0x5e56('0x29');break;case'CN':_0x266b97=_0x5e56('0x16');break;default:_0x266b97='https://accounts.zoho.eu';break;}var _0x4f1e35={'method':'POST','uri':_0x266b97+_0x5e56('0x19'),'form':{'grant_type':_0x5e56('0x1a'),'client_id':_0x151c25['clientId'],'client_secret':_0x151c25[_0x5e56('0x1b')],'redirect_uri':_0x151c25[_0x5e56('0xf')],'code':_0x151c25[_0x5e56('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4f1e35)[_0x5e56('0x1d')](function(_0x4ab431){var _0x3515dd=JSON[_0x5e56('0x1e')](_0x4ab431);if(_0x3515dd[_0x5e56('0x1f')]){_0x151c25['refreshToken']=_0x3515dd['refresh_token'];logger[_0x5e56('0x21')](util[_0x5e56('0x22')](_0x5e56('0x2a'),_0x151c25[_0x5e56('0x23')],_0x151c25['id']));}else{logger[_0x5e56('0x26')](util[_0x5e56('0x22')](_0x5e56('0x2b'),_0x151c25[_0x5e56('0x23')],_0x151c25['id']),util[_0x5e56('0x24')](_0x3515dd,{'showHidden':![],'depth':null}));}return _0x522301(null,_0x404ed5);})[_0x5e56('0x25')](function(_0x182397){logger[_0x5e56('0x26')](util[_0x5e56('0x22')](_0x5e56('0x2b'),_0x151c25['name'],_0x151c25['id']),util[_0x5e56('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x522301(_0x182397);});}else{return _0x522301(null,_0x404ed5);}}}});}; \ No newline at end of file +var _0xd32e=['POST','then','parse','lodash','util','../../config/logger','moment','../../config/environment','./intZohoAccount.attributes','define','ZohoAccount','int_zoho_accounts','zone','serverUrl','changed','clientId','host','slice','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','clientSecret','code','application/x-www-form-urlencoded','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','substring'];(function(_0x57257a,_0x1bdf1d){var _0x3ce152=function(_0x1d7682){while(--_0x1d7682){_0x57257a['push'](_0x57257a['shift']());}};_0x3ce152(++_0x1bdf1d);}(_0xd32e,0x106));var _0xed32=function(_0x2d4af9,_0x84504d){_0x2d4af9=_0x2d4af9-0x0;var _0x5e9213=_0xd32e[_0x2d4af9];return _0x5e9213;};'use strict';var _=require(_0xed32('0x0'));var util=require(_0xed32('0x1'));var logger=require(_0xed32('0x2'))('api');var moment=require(_0xed32('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xed32('0x4'));var attributes=require(_0xed32('0x5'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xc96356,_0x3622d6){return _0xc96356[_0xed32('0x6')](_0xed32('0x7'),attributes,{'tableName':_0xed32('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1bd5e1,_0x154360,_0x54090a){if(_0x1bd5e1['changed'](_0xed32('0x9'))||_0x1bd5e1['changed'](_0xed32('0xa'))||_0x1bd5e1[_0xed32('0xb')](_0xed32('0xc'))||_0x1bd5e1[_0xed32('0xb')]('clientSecret')||_0x1bd5e1[_0xed32('0xb')]('code')||_0x1bd5e1[_0xed32('0xb')](_0xed32('0xd'))){var _0x4002b2,_0x4aa6b5;_0x4002b2=_0x1bd5e1['serverUrl'];var _0x2a244a=_0x4002b2[_0xed32('0xe')](-0x1);if(_0x2a244a==='/'||_0x2a244a==='\x5c'||_0x2a244a===':'){_0x4002b2=_0x4002b2['substring'](0x0,_0x4002b2['lastIndexOf'](_0x2a244a));}switch(_0x1bd5e1[_0xed32('0x9')]){case'US':_0x4aa6b5='https://accounts.zoho.com';break;case'AU':_0x4aa6b5=_0xed32('0xf');break;case'IN':_0x4aa6b5=_0xed32('0x10');break;case'CN':_0x4aa6b5=_0xed32('0x11');break;default:_0x4aa6b5=_0xed32('0x12');break;}var _0x52ef78={'method':'POST','uri':_0x4aa6b5+_0xed32('0x13'),'form':{'grant_type':_0xed32('0x14'),'client_id':_0x1bd5e1[_0xed32('0xc')],'client_secret':_0x1bd5e1[_0xed32('0x15')],'redirect_uri':_0x1bd5e1[_0xed32('0xa')],'code':_0x1bd5e1[_0xed32('0x16')]},'headers':{'Content-Type':_0xed32('0x17')}};return rp(_0x52ef78)['then'](function(_0x28e577){var _0x370c18=JSON['parse'](_0x28e577);if(_0x370c18[_0xed32('0x18')]){_0x1bd5e1[_0xed32('0x19')]=_0x370c18[_0xed32('0x18')];logger[_0xed32('0x1a')](util[_0xed32('0x1b')](_0xed32('0x1c'),_0x1bd5e1[_0xed32('0x1d')],_0x1bd5e1['id']));}else{logger[_0xed32('0x1e')](util[_0xed32('0x1b')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1bd5e1[_0xed32('0x1d')],_0x1bd5e1['id']),util[_0xed32('0x1f')](_0x370c18,{'showHidden':![],'depth':null}));}return _0x54090a(null,_0x154360);})['catch'](function(_0x16f609){logger['error'](util[_0xed32('0x1b')](_0xed32('0x20'),_0x1bd5e1['name'],_0x1bd5e1['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x54090a(_0x16f609);});}else{return _0x54090a(null,_0x154360);}},'beforeUpdate':function(_0x206b52,_0xfd1ece,_0xbbdb44){if(_0x206b52[_0xed32('0xb')](_0xed32('0x9'))||_0x206b52[_0xed32('0xb')](_0xed32('0xa'))||_0x206b52['changed'](_0xed32('0xc'))||_0x206b52[_0xed32('0xb')]('clientSecret')||_0x206b52[_0xed32('0xb')](_0xed32('0x16'))||_0x206b52[_0xed32('0xb')](_0xed32('0xd'))){var _0xea90f2,_0x241179;_0xea90f2=_0x206b52[_0xed32('0xa')];var _0x1a4fa4=_0xea90f2['slice'](-0x1);if(_0x1a4fa4==='/'||_0x1a4fa4==='\x5c'||_0x1a4fa4===':'){_0xea90f2=_0xea90f2[_0xed32('0x21')](0x0,_0xea90f2['lastIndexOf'](_0x1a4fa4));}switch(_0x206b52[_0xed32('0x9')]){case'US':_0x241179='https://accounts.zoho.com';break;case'AU':_0x241179='https://accounts.zoho.com.au';break;case'IN':_0x241179='https://accounts.zoho.in';break;case'CN':_0x241179=_0xed32('0x11');break;default:_0x241179=_0xed32('0x12');break;}var _0x458e9e={'method':_0xed32('0x22'),'uri':_0x241179+_0xed32('0x13'),'form':{'grant_type':_0xed32('0x14'),'client_id':_0x206b52['clientId'],'client_secret':_0x206b52['clientSecret'],'redirect_uri':_0x206b52[_0xed32('0xa')],'code':_0x206b52['code']},'headers':{'Content-Type':_0xed32('0x17')}};return rp(_0x458e9e)[_0xed32('0x23')](function(_0x5423a1){var _0x9cf6fc=JSON[_0xed32('0x24')](_0x5423a1);if(_0x9cf6fc[_0xed32('0x18')]){_0x206b52[_0xed32('0x19')]=_0x9cf6fc[_0xed32('0x18')];logger['info'](util[_0xed32('0x1b')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x206b52['name'],_0x206b52['id']));}else{logger[_0xed32('0x1e')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x206b52[_0xed32('0x1d')],_0x206b52['id']),util[_0xed32('0x1f')](_0x9cf6fc,{'showHidden':![],'depth':null}));}return _0xbbdb44(null,_0xfd1ece);})['catch'](function(_0x2d10b0){logger[_0xed32('0x1e')](util[_0xed32('0x1b')](_0xed32('0x20'),_0x206b52[_0xed32('0x1d')],_0x206b52['id']),util[_0xed32('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0xbbdb44(_0x2d10b0);});}else{return _0xbbdb44(null,_0xfd1ece);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index d1e31b9..9d7ae4a 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 _0xb4e2=['stringify','error','code','message','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','limit','include','map','model','find','raw','ShowZohoAccount','lodash','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s'];(function(_0x1ce300,_0xed6677){var _0x54e762=function(_0x15f025){while(--_0x15f025){_0x1ce300['push'](_0x1ce300['shift']());}};_0x54e762(++_0xed6677);}(_0xb4e2,0x1aa));var _0x2b4e=function(_0xf75e4f,_0x6c8825){_0xf75e4f=_0xf75e4f-0x0;var _0x4108df=_0xb4e2[_0xf75e4f];return _0x4108df;};'use strict';var _=require(_0x2b4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2b4e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2b4e('0x2'));var logger=require(_0x2b4e('0x3'))(_0x2b4e('0x4'));var config=require(_0x2b4e('0x5'));var jayson=require(_0x2b4e('0x6'));var client=jayson[_0x2b4e('0x7')][_0x2b4e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a84a9,_0xc18f62,_0x11a6ee){return new BPromise(function(_0x36f83e,_0x36a811){return client[_0x2b4e('0x9')](_0x4a84a9,_0x11a6ee)[_0x2b4e('0xa')](function(_0x3fd14e){logger[_0x2b4e('0xb')](_0x2b4e('0xc'),_0xc18f62,_0x2b4e('0xd'));logger[_0x2b4e('0xe')](_0x2b4e('0xf'),_0xc18f62,_0x2b4e('0xd'),JSON[_0x2b4e('0x10')](_0x3fd14e));if(_0x3fd14e['error']){if(_0x3fd14e[_0x2b4e('0x11')][_0x2b4e('0x12')]===0x1f4){logger[_0x2b4e('0x11')](_0x2b4e('0xc'),_0xc18f62,_0x3fd14e['error'][_0x2b4e('0x13')]);return _0x36a811(_0x3fd14e['error'][_0x2b4e('0x13')]);}logger[_0x2b4e('0x11')](_0x2b4e('0xc'),_0xc18f62,_0x3fd14e[_0x2b4e('0x11')][_0x2b4e('0x13')]);return _0x36f83e(_0x3fd14e[_0x2b4e('0x11')]['message']);}else{logger[_0x2b4e('0xb')](_0x2b4e('0xc'),_0xc18f62,_0x2b4e('0xd'));_0x36f83e(_0x3fd14e['result'][_0x2b4e('0x13')]);}})[_0x2b4e('0x14')](function(_0x4b87ec){logger[_0x2b4e('0x11')]('ZohoAccount,\x20%s,\x20%s',_0xc18f62,_0x4b87ec);_0x36a811(_0x4b87ec);});});}exports[_0x2b4e('0x15')]=function(_0x30b754){var _0xb8b550=this;return new Promise(function(_0x2b9480,_0x275a55){return db[_0x2b4e('0x16')][_0x2b4e('0x17')]({'raw':_0x30b754[_0x2b4e('0x18')]?_0x30b754[_0x2b4e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x30b754[_0x2b4e('0x18')]?_0x30b754['options'][_0x2b4e('0x19')]||null:null,'attributes':_0x30b754[_0x2b4e('0x18')]?_0x30b754[_0x2b4e('0x18')][_0x2b4e('0x1a')]||null:null,'limit':_0x30b754['options']?_0x30b754[_0x2b4e('0x18')][_0x2b4e('0x1b')]||null:null,'include':_0x30b754[_0x2b4e('0x18')]?_0x30b754['options'][_0x2b4e('0x1c')]?_[_0x2b4e('0x1d')](_0x30b754['options'][_0x2b4e('0x1c')],function(_0x5491df){return{'model':db[_0x5491df[_0x2b4e('0x1e')]],'as':_0x5491df['as'],'attributes':_0x5491df[_0x2b4e('0x1a')],'include':_0x5491df['include']?_['map'](_0x5491df[_0x2b4e('0x1c')],function(_0x258090){return{'model':db[_0x258090[_0x2b4e('0x1e')]],'as':_0x258090['as'],'attributes':_0x258090['attributes'],'include':_0x258090[_0x2b4e('0x1c')]?_[_0x2b4e('0x1d')](_0x258090[_0x2b4e('0x1c')],function(_0x2db26f){return{'model':db[_0x2db26f[_0x2b4e('0x1e')]],'as':_0x2db26f['as'],'attributes':_0x2db26f[_0x2b4e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2b4e('0xa')](function(_0x18289b){logger[_0x2b4e('0xb')]('GetZohoAccount',_0x30b754);logger[_0x2b4e('0xe')](_0x2b4e('0x15'),_0x30b754,JSON[_0x2b4e('0x10')](_0x18289b));_0x2b9480(_0x18289b);})[_0x2b4e('0x14')](function(_0x545783){logger['error']('GetZohoAccount',_0x545783[_0x2b4e('0x13')],_0x30b754);_0x275a55(_0xb8b550[_0x2b4e('0x11')](0x1f4,_0x545783[_0x2b4e('0x13')]));});});};exports['ShowZohoAccount']=function(_0x1feebb){var _0x5771d7=this;return new Promise(function(_0x596fb6,_0x31fc89){return db[_0x2b4e('0x16')][_0x2b4e('0x1f')]({'raw':_0x1feebb[_0x2b4e('0x18')]?_0x1feebb[_0x2b4e('0x18')][_0x2b4e('0x20')]===undefined?!![]:![]:!![],'where':_0x1feebb[_0x2b4e('0x18')]?_0x1feebb['options'][_0x2b4e('0x19')]||null:null,'attributes':_0x1feebb[_0x2b4e('0x18')]?_0x1feebb[_0x2b4e('0x18')][_0x2b4e('0x1a')]||null:null,'include':_0x1feebb[_0x2b4e('0x18')]?_0x1feebb['options'][_0x2b4e('0x1c')]?_[_0x2b4e('0x1d')](_0x1feebb[_0x2b4e('0x18')][_0x2b4e('0x1c')],function(_0x5c27b3){return{'model':db[_0x5c27b3[_0x2b4e('0x1e')]],'as':_0x5c27b3['as'],'attributes':_0x5c27b3[_0x2b4e('0x1a')],'include':_0x5c27b3['include']?_['map'](_0x5c27b3[_0x2b4e('0x1c')],function(_0x3f19a8){return{'model':db[_0x3f19a8[_0x2b4e('0x1e')]],'as':_0x3f19a8['as'],'attributes':_0x3f19a8['attributes'],'include':_0x3f19a8[_0x2b4e('0x1c')]?_[_0x2b4e('0x1d')](_0x3f19a8[_0x2b4e('0x1c')],function(_0x1472d6){return{'model':db[_0x1472d6['model']],'as':_0x1472d6['as'],'attributes':_0x1472d6['attributes']};}):[]};}):[]};}):[]:[]})[_0x2b4e('0xa')](function(_0x236e8e){logger[_0x2b4e('0xb')](_0x2b4e('0x21'),_0x1feebb);logger[_0x2b4e('0xe')](_0x2b4e('0x21'),_0x1feebb,JSON[_0x2b4e('0x10')](_0x236e8e));_0x596fb6(_0x236e8e);})['catch'](function(_0x57255f){logger['error'](_0x2b4e('0x21'),_0x57255f[_0x2b4e('0x13')],_0x1feebb);_0x31fc89(_0x5771d7[_0x2b4e('0x11')](0x1f4,_0x57255f[_0x2b4e('0x13')]));});});}; \ No newline at end of file +var _0xaaee=['options','raw','include','map','model','attributes','GetZohoAccount','ShowZohoAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ZohoAccount'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xaaee,0xa9));var _0xeaae=function(_0x4f9f85,_0x139974){_0x4f9f85=_0x4f9f85-0x0;var _0x38b1f6=_0xaaee[_0x4f9f85];return _0x38b1f6;};'use strict';var _=require(_0xeaae('0x0'));var util=require('util');var moment=require(_0xeaae('0x1'));var BPromise=require(_0xeaae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeaae('0x3'));var db=require(_0xeaae('0x4'))['db'];var utils=require(_0xeaae('0x5'));var logger=require(_0xeaae('0x6'))('rpc');var config=require(_0xeaae('0x7'));var jayson=require(_0xeaae('0x8'));var client=jayson[_0xeaae('0x9')][_0xeaae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3633ec,_0x30422f,_0x58b332){return new BPromise(function(_0x275d1c,_0x1701a9){return client[_0xeaae('0xb')](_0x3633ec,_0x58b332)[_0xeaae('0xc')](function(_0x3ec6d0){logger[_0xeaae('0xd')](_0xeaae('0xe'),_0x30422f,_0xeaae('0xf'));logger[_0xeaae('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x30422f,_0xeaae('0xf'),JSON[_0xeaae('0x11')](_0x3ec6d0));if(_0x3ec6d0[_0xeaae('0x12')]){if(_0x3ec6d0['error']['code']===0x1f4){logger[_0xeaae('0x12')](_0xeaae('0xe'),_0x30422f,_0x3ec6d0[_0xeaae('0x12')]['message']);return _0x1701a9(_0x3ec6d0[_0xeaae('0x12')][_0xeaae('0x13')]);}logger[_0xeaae('0x12')](_0xeaae('0xe'),_0x30422f,_0x3ec6d0['error']['message']);return _0x275d1c(_0x3ec6d0[_0xeaae('0x12')][_0xeaae('0x13')]);}else{logger[_0xeaae('0xd')](_0xeaae('0xe'),_0x30422f,'request\x20sent');_0x275d1c(_0x3ec6d0[_0xeaae('0x14')]['message']);}})[_0xeaae('0x15')](function(_0x1184c4){logger[_0xeaae('0x12')](_0xeaae('0xe'),_0x30422f,_0x1184c4);_0x1701a9(_0x1184c4);});});}exports['GetZohoAccount']=function(_0x538e3d){var _0x5d5aa1=this;return new Promise(function(_0x5b44f5,_0x394d9b){return db[_0xeaae('0x16')]['findAll']({'raw':_0x538e3d[_0xeaae('0x17')]?_0x538e3d['options'][_0xeaae('0x18')]===undefined?!![]:![]:!![],'where':_0x538e3d[_0xeaae('0x17')]?_0x538e3d[_0xeaae('0x17')]['where']||null:null,'attributes':_0x538e3d[_0xeaae('0x17')]?_0x538e3d[_0xeaae('0x17')]['attributes']||null:null,'limit':_0x538e3d['options']?_0x538e3d[_0xeaae('0x17')]['limit']||null:null,'include':_0x538e3d['options']?_0x538e3d[_0xeaae('0x17')][_0xeaae('0x19')]?_[_0xeaae('0x1a')](_0x538e3d[_0xeaae('0x17')][_0xeaae('0x19')],function(_0x41739e){return{'model':db[_0x41739e[_0xeaae('0x1b')]],'as':_0x41739e['as'],'attributes':_0x41739e[_0xeaae('0x1c')],'include':_0x41739e[_0xeaae('0x19')]?_[_0xeaae('0x1a')](_0x41739e['include'],function(_0xa7fa13){return{'model':db[_0xa7fa13[_0xeaae('0x1b')]],'as':_0xa7fa13['as'],'attributes':_0xa7fa13[_0xeaae('0x1c')],'include':_0xa7fa13[_0xeaae('0x19')]?_[_0xeaae('0x1a')](_0xa7fa13[_0xeaae('0x19')],function(_0x145b46){return{'model':db[_0x145b46[_0xeaae('0x1b')]],'as':_0x145b46['as'],'attributes':_0x145b46['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x261ccd){logger[_0xeaae('0xd')](_0xeaae('0x1d'),_0x538e3d);logger['debug'](_0xeaae('0x1d'),_0x538e3d,JSON[_0xeaae('0x11')](_0x261ccd));_0x5b44f5(_0x261ccd);})[_0xeaae('0x15')](function(_0x14a68a){logger[_0xeaae('0x12')](_0xeaae('0x1d'),_0x14a68a[_0xeaae('0x13')],_0x538e3d);_0x394d9b(_0x5d5aa1[_0xeaae('0x12')](0x1f4,_0x14a68a[_0xeaae('0x13')]));});});};exports[_0xeaae('0x1e')]=function(_0x48aeca){var _0x43a759=this;return new Promise(function(_0x2363fa,_0x4c938f){return db['ZohoAccount'][_0xeaae('0x1f')]({'raw':_0x48aeca['options']?_0x48aeca[_0xeaae('0x17')][_0xeaae('0x18')]===undefined?!![]:![]:!![],'where':_0x48aeca[_0xeaae('0x17')]?_0x48aeca['options']['where']||null:null,'attributes':_0x48aeca['options']?_0x48aeca[_0xeaae('0x17')]['attributes']||null:null,'include':_0x48aeca[_0xeaae('0x17')]?_0x48aeca[_0xeaae('0x17')][_0xeaae('0x19')]?_['map'](_0x48aeca[_0xeaae('0x17')][_0xeaae('0x19')],function(_0x1c606b){return{'model':db[_0x1c606b[_0xeaae('0x1b')]],'as':_0x1c606b['as'],'attributes':_0x1c606b[_0xeaae('0x1c')],'include':_0x1c606b['include']?_[_0xeaae('0x1a')](_0x1c606b[_0xeaae('0x19')],function(_0x387a61){return{'model':db[_0x387a61[_0xeaae('0x1b')]],'as':_0x387a61['as'],'attributes':_0x387a61[_0xeaae('0x1c')],'include':_0x387a61[_0xeaae('0x19')]?_[_0xeaae('0x1a')](_0x387a61[_0xeaae('0x19')],function(_0x183b99){return{'model':db[_0x183b99[_0xeaae('0x1b')]],'as':_0x183b99['as'],'attributes':_0x183b99[_0xeaae('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5da64c){logger['info']('ShowZohoAccount',_0x48aeca);logger['debug'](_0xeaae('0x1e'),_0x48aeca,JSON['stringify'](_0x5da64c));_0x2363fa(_0x5da64c);})[_0xeaae('0x15')](function(_0x49f5a0){logger[_0xeaae('0x12')]('ShowZohoAccount',_0x49f5a0['message'],_0x48aeca);_0x4c938f(_0x43a759[_0xeaae('0x12')](0x1f4,_0x49f5a0[_0xeaae('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 670dd29..e76139c 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 _0x9bda=['get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x9bda,0x1ea));var _0xa9bd=function(_0x575b72,_0x1a7eb1){_0x575b72=_0x575b72-0x0;var _0x561c57=_0x9bda[_0x575b72];return _0x561c57;};'use strict';var multer=require(_0xa9bd('0x0'));var util=require(_0xa9bd('0x1'));var path=require(_0xa9bd('0x2'));var timeout=require(_0xa9bd('0x3'));var express=require(_0xa9bd('0x4'));var router=express[_0xa9bd('0x5')]();var fs_extra=require(_0xa9bd('0x6'));var auth=require(_0xa9bd('0x7'));var interaction=require(_0xa9bd('0x8'));var config=require(_0xa9bd('0x9'));var controller=require('./intZohoConfiguration.controller');router[_0xa9bd('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9bd('0xb')]);router[_0xa9bd('0xa')](_0xa9bd('0xc'),auth[_0xa9bd('0xd')](),controller['show']);router['get'](_0xa9bd('0xe'),auth[_0xa9bd('0xd')](),controller[_0xa9bd('0xf')]);router[_0xa9bd('0xa')](_0xa9bd('0x10'),auth['isAuthenticated'](),controller[_0xa9bd('0x11')]);router[_0xa9bd('0xa')](_0xa9bd('0x12'),auth['isAuthenticated'](),controller[_0xa9bd('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa9bd('0x14')]);router[_0xa9bd('0x15')]('/:id',auth[_0xa9bd('0xd')](),controller[_0xa9bd('0x16')]);router['delete'](_0xa9bd('0xc'),auth[_0xa9bd('0xd')](),controller[_0xa9bd('0x17')]);module[_0xa9bd('0x18')]=router; \ No newline at end of file +var _0x934b=['isAuthenticated','/:id','/:id/fields','getSubjects','getDescriptions','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x934b,0x185));var _0xb934=function(_0x1003da,_0x4865e1){_0x1003da=_0x1003da-0x0;var _0x1bd15f=_0x934b[_0x1003da];return _0x1bd15f;};'use strict';var multer=require(_0xb934('0x0'));var util=require(_0xb934('0x1'));var path=require('path');var timeout=require(_0xb934('0x2'));var express=require(_0xb934('0x3'));var router=express[_0xb934('0x4')]();var fs_extra=require(_0xb934('0x5'));var auth=require(_0xb934('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb934('0x7'));var controller=require(_0xb934('0x8'));router[_0xb934('0x9')]('/',auth[_0xb934('0xa')](),controller['index']);router[_0xb934('0x9')](_0xb934('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb934('0x9')](_0xb934('0xc'),auth[_0xb934('0xa')](),controller['getFields']);router[_0xb934('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xb934('0xd')]);router[_0xb934('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xb934('0xe')]);router['post']('/',auth[_0xb934('0xa')](),controller[_0xb934('0xf')]);router[_0xb934('0x10')]('/:id',auth[_0xb934('0xa')](),controller[_0xb934('0x11')]);router[_0xb934('0x12')](_0xb934('0xb'),auth[_0xb934('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 3290cdb..47ce552 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 _0x642a=['sequelize','exports','STRING','ENUM','lead','contact','nothing','contact_lead'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x642a,0x1f0));var _0xa642=function(_0x10c411,_0x5b80eb){_0x10c411=_0x10c411-0x0;var _0x5f1df1=_0x642a[_0x10c411];return _0x5f1df1;};'use strict';var Sequelize=require(_0xa642('0x0'));module[_0xa642('0x1')]={'name':{'type':Sequelize[_0xa642('0x2')]},'moduleCreate':{'type':Sequelize[_0xa642('0x3')](_0xa642('0x4'),_0xa642('0x5'),_0xa642('0x6')),'defaultValue':_0xa642('0x4')},'moduleSearch':{'type':Sequelize[_0xa642('0x3')](_0xa642('0x7'),_0xa642('0x5'),_0xa642('0x4')),'defaultValue':_0xa642('0x7')},'description':{'type':Sequelize[_0xa642('0x2')]}}; \ No newline at end of file +var _0x14ca=['contact','sequelize','exports','STRING','ENUM','lead','contact_lead'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x14ca,0x158));var _0xa14c=function(_0x4bd385,_0x3a3e0a){_0x4bd385=_0x4bd385-0x0;var _0x3bbd36=_0x14ca[_0x4bd385];return _0x3bbd36;};'use strict';var Sequelize=require(_0xa14c('0x0'));module[_0xa14c('0x1')]={'name':{'type':Sequelize[_0xa14c('0x2')]},'moduleCreate':{'type':Sequelize[_0xa14c('0x3')](_0xa14c('0x4'),'contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xa14c('0x3')](_0xa14c('0x5'),_0xa14c('0x6'),_0xa14c('0x4')),'defaultValue':_0xa14c('0x5')},'description':{'type':Sequelize[_0xa14c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 5ebcc4b..e213170 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 _0x7f57=['ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','pick','filter','where','VIRTUAL','options','ZohoConfiguration','includeAll','include','findAll','rows','catch','show','params','merge','find','body','findOne','ZohoField','rawAttributes','sort','getFields','getSubjects','getDescriptions','eml-format','rimraf','moment','bluebird','util','sox','to-csv'];(function(_0x130cf6,_0x5c75ad){var _0x3bc7e6=function(_0x1624f4){while(--_0x1624f4){_0x130cf6['push'](_0x130cf6['shift']());}};_0x3bc7e6(++_0x5c75ad);}(_0x7f57,0x93));var _0x77f5=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x7f57[_0x2c7618];return _0x5ce3f0;};'use strict';var emlformat=require(_0x77f5('0x0'));var rimraf=require(_0x77f5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77f5('0x2'));var BPromise=require(_0x77f5('0x3'));var Mustache=require('mustache');var util=require(_0x77f5('0x4'));var path=require('path');var sox=require(_0x77f5('0x5'));var csv=require(_0x77f5('0x6'));var ejs=require(_0x77f5('0x7'));var fs=require('fs');var fs_extra=require(_0x77f5('0x8'));var _=require('lodash');var squel=require(_0x77f5('0x9'));var crypto=require(_0x77f5('0xa'));var jsforce=require(_0x77f5('0xb'));var deskjs=require(_0x77f5('0xc'));var toCsv=require(_0x77f5('0x6'));var querystring=require('querystring');var Papa=require(_0x77f5('0xd'));var Redis=require(_0x77f5('0xe'));var authService=require(_0x77f5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x77f5('0x10'));var hardwareService=require(_0x77f5('0x11'));var logger=require(_0x77f5('0x12'))(_0x77f5('0x13'));var utils=require(_0x77f5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77f5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2086af,_0x58e9cd){_0x58e9cd=_0x58e9cd||0xcc;return function(_0x319d0c){if(_0x319d0c){return _0x2086af['sendStatus'](_0x58e9cd);}return _0x2086af[_0x77f5('0x16')](_0x58e9cd)[_0x77f5('0x17')]();};}function respondWithResult(_0x557cbe,_0x2478e9){_0x2478e9=_0x2478e9||0xc8;return function(_0x23dfb6){if(_0x23dfb6){return _0x557cbe['status'](_0x2478e9)[_0x77f5('0x18')](_0x23dfb6);}};}function respondWithFilteredResult(_0x11c764,_0x4cba09){return function(_0x23534b){if(_0x23534b){var _0x67d86e=typeof _0x4cba09['offset']===_0x77f5('0x19')&&typeof _0x4cba09[_0x77f5('0x1a')]==='undefined';var _0x4c2a36=_0x23534b[_0x77f5('0x1b')];var _0x5a8704=_0x67d86e?0x0:_0x4cba09['offset'];var _0x5ca9fc=_0x67d86e?_0x23534b[_0x77f5('0x1b')]:_0x4cba09['offset']+_0x4cba09[_0x77f5('0x1a')];var _0x18435b;if(_0x5ca9fc>=_0x4c2a36){_0x5ca9fc=_0x4c2a36;_0x18435b=0xc8;}else{_0x18435b=0xce;}_0x11c764[_0x77f5('0x16')](_0x18435b);return _0x11c764['set'](_0x77f5('0x1c'),_0x5a8704+'-'+_0x5ca9fc+'/'+_0x4c2a36)[_0x77f5('0x18')](_0x23534b);}return null;};}function patchUpdates(_0x3c2ed0){return function(_0x16add1){try{jsonpatch[_0x77f5('0x1d')](_0x16add1,_0x3c2ed0,!![]);}catch(_0x59ea6b){return BPromise[_0x77f5('0x1e')](_0x59ea6b);}return _0x16add1[_0x77f5('0x1f')]();};}function saveUpdates(_0x40959b,_0x58ee06){return function(_0x53d7d3){if(_0x53d7d3){return _0x53d7d3[_0x77f5('0x20')](_0x40959b)[_0x77f5('0x21')](function(_0x570835){return _0x570835;});}return null;};}function removeEntity(_0x266fac,_0xb6154e){return function(_0x510445){if(_0x510445){return _0x510445[_0x77f5('0x22')]()[_0x77f5('0x21')](function(){_0x266fac[_0x77f5('0x16')](0xcc)[_0x77f5('0x17')]();});}};}function handleEntityNotFound(_0x235e84,_0x157ee1){return function(_0x268d13){if(!_0x268d13){_0x235e84[_0x77f5('0x23')](0x194);}return _0x268d13;};}function handleError(_0x190444,_0x5415c1){_0x5415c1=_0x5415c1||0x1f4;return function(_0xc2853){logger['error'](_0xc2853['stack']);if(_0xc2853[_0x77f5('0x24')]){delete _0xc2853['name'];}_0x190444['status'](_0x5415c1)[_0x77f5('0x25')](_0xc2853);};}exports[_0x77f5('0x26')]=function(_0x3d36ba,_0x3583a3){var _0x23f716={},_0x41c10f={},_0x2517cd={'count':0x0,'rows':[]};var _0x109591=_['map'](db['ZohoConfiguration']['rawAttributes'],function(_0x22fca9){return{'name':_0x22fca9['fieldName'],'type':_0x22fca9[_0x77f5('0x27')][_0x77f5('0x28')]};});_0x41c10f[_0x77f5('0x29')]=_[_0x77f5('0x2a')](_0x109591,_0x77f5('0x24'));_0x41c10f[_0x77f5('0x2b')]=_[_0x77f5('0x2c')](_0x3d36ba[_0x77f5('0x2b')]);_0x41c10f[_0x77f5('0x2d')]=_[_0x77f5('0x2e')](_0x41c10f['model'],_0x41c10f['query']);_0x23f716[_0x77f5('0x2f')]=_[_0x77f5('0x2e')](_0x41c10f[_0x77f5('0x29')],qs[_0x77f5('0x30')](_0x3d36ba[_0x77f5('0x2b')][_0x77f5('0x30')]));_0x23f716['attributes']=_0x23f716[_0x77f5('0x2f')][_0x77f5('0x31')]?_0x23f716[_0x77f5('0x2f')]:_0x41c10f['model'];if(!_0x3d36ba['query'][_0x77f5('0x32')](_0x77f5('0x33'))){_0x23f716[_0x77f5('0x1a')]=qs[_0x77f5('0x1a')](_0x3d36ba[_0x77f5('0x2b')]['limit']);_0x23f716[_0x77f5('0x34')]=qs['offset'](_0x3d36ba['query'][_0x77f5('0x34')]);}_0x23f716[_0x77f5('0x35')]=qs['sort'](_0x3d36ba[_0x77f5('0x2b')]['sort']);_0x23f716['where']=qs['filters'](_[_0x77f5('0x36')](_0x3d36ba[_0x77f5('0x2b')],_0x41c10f['filters']),_0x109591);if(_0x3d36ba[_0x77f5('0x2b')][_0x77f5('0x37')]){_0x23f716[_0x77f5('0x38')]=_['merge'](_0x23f716[_0x77f5('0x38')],{'$or':_['map'](_0x109591,function(_0x465d63){if(_0x465d63['type']!==_0x77f5('0x39')){var _0xc67273={};_0xc67273[_0x465d63[_0x77f5('0x24')]]={'$like':'%'+_0x3d36ba[_0x77f5('0x2b')][_0x77f5('0x37')]+'%'};return _0xc67273;}})});}_0x23f716=_['merge']({},_0x23f716,_0x3d36ba[_0x77f5('0x3a')]);var _0x52fe4b={'where':_0x23f716['where']};return db[_0x77f5('0x3b')][_0x77f5('0x1b')](_0x52fe4b)[_0x77f5('0x21')](function(_0x2ee579){_0x2517cd[_0x77f5('0x1b')]=_0x2ee579;if(_0x3d36ba['query'][_0x77f5('0x3c')]){_0x23f716[_0x77f5('0x3d')]=[{'all':!![]}];}return db[_0x77f5('0x3b')][_0x77f5('0x3e')](_0x23f716);})[_0x77f5('0x21')](function(_0xeff807){_0x2517cd[_0x77f5('0x3f')]=_0xeff807;return _0x2517cd;})[_0x77f5('0x21')](respondWithFilteredResult(_0x3583a3,_0x23f716))[_0x77f5('0x40')](handleError(_0x3583a3,null));};exports[_0x77f5('0x41')]=function(_0x20f403,_0x48954e){var _0x4bdc1b={'raw':![],'where':{'id':_0x20f403[_0x77f5('0x42')]['id']}},_0x220428={};_0x220428[_0x77f5('0x29')]=_[_0x77f5('0x2c')](db[_0x77f5('0x3b')]['rawAttributes']);_0x220428['query']=_[_0x77f5('0x2c')](_0x20f403[_0x77f5('0x2b')]);_0x220428['filters']=_['intersection'](_0x220428[_0x77f5('0x29')],_0x220428[_0x77f5('0x2b')]);_0x4bdc1b['attributes']=_[_0x77f5('0x2e')](_0x220428['model'],qs['fields'](_0x20f403[_0x77f5('0x2b')][_0x77f5('0x30')]));_0x4bdc1b['attributes']=_0x4bdc1b[_0x77f5('0x2f')][_0x77f5('0x31')]?_0x4bdc1b[_0x77f5('0x2f')]:_0x220428['model'];if(_0x20f403[_0x77f5('0x2b')][_0x77f5('0x3c')]){_0x4bdc1b[_0x77f5('0x3d')]=[{'all':!![]}];}_0x4bdc1b=_[_0x77f5('0x43')]({},_0x4bdc1b,_0x20f403[_0x77f5('0x3a')]);return db[_0x77f5('0x3b')][_0x77f5('0x44')](_0x4bdc1b)[_0x77f5('0x21')](handleEntityNotFound(_0x48954e,null))[_0x77f5('0x21')](respondWithResult(_0x48954e,null))[_0x77f5('0x40')](handleError(_0x48954e,null));};exports['create']=function(_0x29ae2d,_0x49a5cc){return db[_0x77f5('0x3b')]['create'](_0x29ae2d[_0x77f5('0x45')],{})[_0x77f5('0x21')](respondWithResult(_0x49a5cc,0xc9))[_0x77f5('0x40')](handleError(_0x49a5cc,null));};exports[_0x77f5('0x20')]=function(_0xa0bfc,_0x814a42){if(_0xa0bfc[_0x77f5('0x45')]['id']){delete _0xa0bfc[_0x77f5('0x45')]['id'];}return db['ZohoConfiguration'][_0x77f5('0x44')]({'where':{'id':_0xa0bfc[_0x77f5('0x42')]['id']}})[_0x77f5('0x21')](handleEntityNotFound(_0x814a42,null))[_0x77f5('0x21')](saveUpdates(_0xa0bfc['body'],null))[_0x77f5('0x21')](respondWithResult(_0x814a42,null))[_0x77f5('0x40')](handleError(_0x814a42,null));};exports[_0x77f5('0x22')]=function(_0x73047d,_0x45800f){return db[_0x77f5('0x3b')][_0x77f5('0x44')]({'where':{'id':_0x73047d[_0x77f5('0x42')]['id']}})['then'](handleEntityNotFound(_0x45800f,null))['then'](removeEntity(_0x45800f,null))[_0x77f5('0x40')](handleError(_0x45800f,null));};exports['getFields']=function(_0x2202f4,_0xf3a270,_0x1d6e62){var _0xeee8da={};var _0x4fcfdb={};var _0x316574;var _0xbc7d6e;return db[_0x77f5('0x3b')][_0x77f5('0x46')]({'where':{'id':_0x2202f4[_0x77f5('0x42')]['id']}})[_0x77f5('0x21')](handleEntityNotFound(_0xf3a270,null))[_0x77f5('0x21')](function(_0x258a03){if(_0x258a03){_0x316574=_0x258a03;_0x4fcfdb[_0x77f5('0x29')]=_[_0x77f5('0x2c')](db[_0x77f5('0x47')][_0x77f5('0x48')]);_0x4fcfdb[_0x77f5('0x2b')]=_['keys'](_0x2202f4['query']);_0x4fcfdb[_0x77f5('0x2d')]=_['intersection'](_0x4fcfdb[_0x77f5('0x29')],_0x4fcfdb[_0x77f5('0x2b')]);_0xeee8da[_0x77f5('0x2f')]=_[_0x77f5('0x2e')](_0x4fcfdb[_0x77f5('0x29')],qs[_0x77f5('0x30')](_0x2202f4[_0x77f5('0x2b')]['fields']));_0xeee8da['attributes']=_0xeee8da[_0x77f5('0x2f')]['length']?_0xeee8da[_0x77f5('0x2f')]:_0x4fcfdb[_0x77f5('0x29')];_0xeee8da[_0x77f5('0x35')]=qs[_0x77f5('0x49')](_0x2202f4['query'][_0x77f5('0x49')]);_0xeee8da[_0x77f5('0x38')]=qs[_0x77f5('0x2d')](_['pick'](_0x2202f4['query'],_0x4fcfdb['filters']));if(_0x2202f4[_0x77f5('0x2b')][_0x77f5('0x37')]){_0xeee8da[_0x77f5('0x38')]=_[_0x77f5('0x43')](_0xeee8da[_0x77f5('0x38')],{'$or':_[_0x77f5('0x2a')](_0xeee8da[_0x77f5('0x2f')],function(_0x3d9ddf){var _0x2c1d9b={};_0x2c1d9b[_0x3d9ddf]={'$like':'%'+_0x2202f4['query'][_0x77f5('0x37')]+'%'};return _0x2c1d9b;})});}_0xeee8da=_[_0x77f5('0x43')]({},_0xeee8da,_0x2202f4[_0x77f5('0x3a')]);return _0x316574[_0x77f5('0x4a')](_0xeee8da);}})['then'](function(_0x26e4d2){if(_0x26e4d2){_0xbc7d6e=_0x26e4d2[_0x77f5('0x31')];if(!_0x2202f4[_0x77f5('0x2b')][_0x77f5('0x32')](_0x77f5('0x33'))){_0xeee8da[_0x77f5('0x1a')]=qs['limit'](_0x2202f4[_0x77f5('0x2b')][_0x77f5('0x1a')]);_0xeee8da['offset']=qs['offset'](_0x2202f4[_0x77f5('0x2b')][_0x77f5('0x34')]);}return _0x316574[_0x77f5('0x4a')](_0xeee8da);}})[_0x77f5('0x21')](function(_0x4bfaf9){if(_0x4bfaf9){return _0x4bfaf9?{'count':_0xbc7d6e,'rows':_0x4bfaf9}:null;}})[_0x77f5('0x21')](respondWithResult(_0xf3a270,null))[_0x77f5('0x40')](handleError(_0xf3a270,null));};exports['getSubjects']=function(_0x572ea4,_0x535652,_0xbef0ad){var _0x13a8b5={};var _0x739a6b={};var _0x41b43f;var _0x34f776;return db[_0x77f5('0x3b')][_0x77f5('0x46')]({'where':{'id':_0x572ea4[_0x77f5('0x42')]['id']}})['then'](handleEntityNotFound(_0x535652,null))['then'](function(_0x25076b){if(_0x25076b){_0x41b43f=_0x25076b;_0x739a6b[_0x77f5('0x29')]=_['keys'](db[_0x77f5('0x47')][_0x77f5('0x48')]);_0x739a6b[_0x77f5('0x2b')]=_['keys'](_0x572ea4[_0x77f5('0x2b')]);_0x739a6b['filters']=_[_0x77f5('0x2e')](_0x739a6b[_0x77f5('0x29')],_0x739a6b[_0x77f5('0x2b')]);_0x13a8b5[_0x77f5('0x2f')]=_[_0x77f5('0x2e')](_0x739a6b[_0x77f5('0x29')],qs[_0x77f5('0x30')](_0x572ea4[_0x77f5('0x2b')][_0x77f5('0x30')]));_0x13a8b5['attributes']=_0x13a8b5[_0x77f5('0x2f')][_0x77f5('0x31')]?_0x13a8b5[_0x77f5('0x2f')]:_0x739a6b[_0x77f5('0x29')];_0x13a8b5['order']=qs['sort'](_0x572ea4[_0x77f5('0x2b')]['sort']);_0x13a8b5['where']=qs[_0x77f5('0x2d')](_['pick'](_0x572ea4[_0x77f5('0x2b')],_0x739a6b[_0x77f5('0x2d')]));if(_0x572ea4[_0x77f5('0x2b')][_0x77f5('0x37')]){_0x13a8b5[_0x77f5('0x38')]=_[_0x77f5('0x43')](_0x13a8b5['where'],{'$or':_[_0x77f5('0x2a')](_0x13a8b5[_0x77f5('0x2f')],function(_0x415e64){var _0x2d24e9={};_0x2d24e9[_0x415e64]={'$like':'%'+_0x572ea4[_0x77f5('0x2b')]['filter']+'%'};return _0x2d24e9;})});}_0x13a8b5=_['merge']({},_0x13a8b5,_0x572ea4[_0x77f5('0x3a')]);return _0x41b43f[_0x77f5('0x4b')](_0x13a8b5);}})['then'](function(_0x4ca485){if(_0x4ca485){_0x34f776=_0x4ca485[_0x77f5('0x31')];if(!_0x572ea4['query']['hasOwnProperty']('nolimit')){_0x13a8b5['limit']=qs[_0x77f5('0x1a')](_0x572ea4[_0x77f5('0x2b')][_0x77f5('0x1a')]);_0x13a8b5['offset']=qs[_0x77f5('0x34')](_0x572ea4['query']['offset']);}return _0x41b43f[_0x77f5('0x4b')](_0x13a8b5);}})[_0x77f5('0x21')](function(_0x14bf2d){if(_0x14bf2d){return _0x14bf2d?{'count':_0x34f776,'rows':_0x14bf2d}:null;}})[_0x77f5('0x21')](respondWithResult(_0x535652,null))['catch'](handleError(_0x535652,null));};exports[_0x77f5('0x4c')]=function(_0x5ebc91,_0x1b0e08,_0xce2ba5){var _0x5d903a={};var _0x22702d={};var _0x389e7d;var _0x395345;return db['ZohoConfiguration'][_0x77f5('0x46')]({'where':{'id':_0x5ebc91[_0x77f5('0x42')]['id']}})[_0x77f5('0x21')](handleEntityNotFound(_0x1b0e08,null))[_0x77f5('0x21')](function(_0x264fb8){if(_0x264fb8){_0x389e7d=_0x264fb8;_0x22702d[_0x77f5('0x29')]=_[_0x77f5('0x2c')](db[_0x77f5('0x47')][_0x77f5('0x48')]);_0x22702d[_0x77f5('0x2b')]=_[_0x77f5('0x2c')](_0x5ebc91[_0x77f5('0x2b')]);_0x22702d[_0x77f5('0x2d')]=_[_0x77f5('0x2e')](_0x22702d[_0x77f5('0x29')],_0x22702d[_0x77f5('0x2b')]);_0x5d903a[_0x77f5('0x2f')]=_[_0x77f5('0x2e')](_0x22702d[_0x77f5('0x29')],qs[_0x77f5('0x30')](_0x5ebc91[_0x77f5('0x2b')][_0x77f5('0x30')]));_0x5d903a['attributes']=_0x5d903a[_0x77f5('0x2f')]['length']?_0x5d903a[_0x77f5('0x2f')]:_0x22702d[_0x77f5('0x29')];_0x5d903a[_0x77f5('0x35')]=qs[_0x77f5('0x49')](_0x5ebc91[_0x77f5('0x2b')][_0x77f5('0x49')]);_0x5d903a[_0x77f5('0x38')]=qs['filters'](_['pick'](_0x5ebc91['query'],_0x22702d[_0x77f5('0x2d')]));if(_0x5ebc91[_0x77f5('0x2b')][_0x77f5('0x37')]){_0x5d903a[_0x77f5('0x38')]=_[_0x77f5('0x43')](_0x5d903a[_0x77f5('0x38')],{'$or':_['map'](_0x5d903a[_0x77f5('0x2f')],function(_0x527f2d){var _0x24896d={};_0x24896d[_0x527f2d]={'$like':'%'+_0x5ebc91['query'][_0x77f5('0x37')]+'%'};return _0x24896d;})});}_0x5d903a=_[_0x77f5('0x43')]({},_0x5d903a,_0x5ebc91[_0x77f5('0x3a')]);return _0x389e7d['getDescriptions'](_0x5d903a);}})[_0x77f5('0x21')](function(_0x495ab8){if(_0x495ab8){_0x395345=_0x495ab8[_0x77f5('0x31')];if(!_0x5ebc91[_0x77f5('0x2b')][_0x77f5('0x32')](_0x77f5('0x33'))){_0x5d903a[_0x77f5('0x1a')]=qs[_0x77f5('0x1a')](_0x5ebc91['query'][_0x77f5('0x1a')]);_0x5d903a[_0x77f5('0x34')]=qs[_0x77f5('0x34')](_0x5ebc91[_0x77f5('0x2b')][_0x77f5('0x34')]);}return _0x389e7d[_0x77f5('0x4c')](_0x5d903a);}})['then'](function(_0x41fad4){if(_0x41fad4){return _0x41fad4?{'count':_0x395345,'rows':_0x41fad4}:null;}})[_0x77f5('0x21')](respondWithResult(_0x1b0e08,null))[_0x77f5('0x40')](handleError(_0x1b0e08,null));}; \ No newline at end of file +var _0x4ddb=['ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','name','index','map','ZohoConfiguration','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','find','getFields','findOne','ZohoField','rawAttributes','order','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv'];(function(_0x8345dc,_0x4a1e34){var _0x25b337=function(_0x161bff){while(--_0x161bff){_0x8345dc['push'](_0x8345dc['shift']());}};_0x25b337(++_0x4a1e34);}(_0x4ddb,0x8f));var _0xb4dd=function(_0x2387c5,_0xfcc74c){_0x2387c5=_0x2387c5-0x0;var _0x2c414c=_0x4ddb[_0x2387c5];return _0x2c414c;};'use strict';var emlformat=require(_0xb4dd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb4dd('0x1'));var jsonpatch=require(_0xb4dd('0x2'));var rp=require('request-promise');var moment=require(_0xb4dd('0x3'));var BPromise=require(_0xb4dd('0x4'));var Mustache=require('mustache');var util=require(_0xb4dd('0x5'));var path=require(_0xb4dd('0x6'));var sox=require(_0xb4dd('0x7'));var csv=require(_0xb4dd('0x8'));var ejs=require(_0xb4dd('0x9'));var fs=require('fs');var fs_extra=require(_0xb4dd('0xa'));var _=require(_0xb4dd('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb4dd('0xc'));var toCsv=require(_0xb4dd('0x8'));var querystring=require(_0xb4dd('0xd'));var Papa=require(_0xb4dd('0xe'));var Redis=require(_0xb4dd('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb4dd('0x10'));var hardwareService=require(_0xb4dd('0x11'));var logger=require(_0xb4dd('0x12'))(_0xb4dd('0x13'));var utils=require(_0xb4dd('0x14'));var config=require(_0xb4dd('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x553998,_0x46b86b){_0x46b86b=_0x46b86b||0xcc;return function(_0x1650c7){if(_0x1650c7){return _0x553998['sendStatus'](_0x46b86b);}return _0x553998[_0xb4dd('0x16')](_0x46b86b)['end']();};}function respondWithResult(_0x1b4a2b,_0x6d86d0){_0x6d86d0=_0x6d86d0||0xc8;return function(_0x267430){if(_0x267430){return _0x1b4a2b[_0xb4dd('0x16')](_0x6d86d0)[_0xb4dd('0x17')](_0x267430);}};}function respondWithFilteredResult(_0x167dcc,_0x5ab3aa){return function(_0x5592f7){if(_0x5592f7){var _0x19d217=typeof _0x5ab3aa[_0xb4dd('0x18')]===_0xb4dd('0x19')&&typeof _0x5ab3aa[_0xb4dd('0x1a')]===_0xb4dd('0x19');var _0x43fc1b=_0x5592f7[_0xb4dd('0x1b')];var _0x7e3a4f=_0x19d217?0x0:_0x5ab3aa['offset'];var _0x4010a4=_0x19d217?_0x5592f7['count']:_0x5ab3aa[_0xb4dd('0x18')]+_0x5ab3aa[_0xb4dd('0x1a')];var _0x2bd043;if(_0x4010a4>=_0x43fc1b){_0x4010a4=_0x43fc1b;_0x2bd043=0xc8;}else{_0x2bd043=0xce;}_0x167dcc['status'](_0x2bd043);return _0x167dcc['set'](_0xb4dd('0x1c'),_0x7e3a4f+'-'+_0x4010a4+'/'+_0x43fc1b)[_0xb4dd('0x17')](_0x5592f7);}return null;};}function patchUpdates(_0x284673){return function(_0x1165c1){try{jsonpatch[_0xb4dd('0x1d')](_0x1165c1,_0x284673,!![]);}catch(_0x1ef3b5){return BPromise[_0xb4dd('0x1e')](_0x1ef3b5);}return _0x1165c1[_0xb4dd('0x1f')]();};}function saveUpdates(_0x2b1080,_0x37af84){return function(_0x15e4c0){if(_0x15e4c0){return _0x15e4c0[_0xb4dd('0x20')](_0x2b1080)[_0xb4dd('0x21')](function(_0x121b92){return _0x121b92;});}return null;};}function removeEntity(_0x5b6735,_0x29f9c9){return function(_0x57b02e){if(_0x57b02e){return _0x57b02e[_0xb4dd('0x22')]()['then'](function(){_0x5b6735[_0xb4dd('0x16')](0xcc)[_0xb4dd('0x23')]();});}};}function handleEntityNotFound(_0x239633,_0x28bc0c){return function(_0x56bddc){if(!_0x56bddc){_0x239633[_0xb4dd('0x24')](0x194);}return _0x56bddc;};}function handleError(_0x14d6a5,_0x4ee44d){_0x4ee44d=_0x4ee44d||0x1f4;return function(_0x5e6866){logger['error'](_0x5e6866['stack']);if(_0x5e6866['name']){delete _0x5e6866[_0xb4dd('0x25')];}_0x14d6a5[_0xb4dd('0x16')](_0x4ee44d)['send'](_0x5e6866);};}exports[_0xb4dd('0x26')]=function(_0x16be7f,_0x1647e5){var _0xd74a74={},_0x29a9dc={},_0x59c587={'count':0x0,'rows':[]};var _0x125fdf=_[_0xb4dd('0x27')](db[_0xb4dd('0x28')]['rawAttributes'],function(_0x3be450){return{'name':_0x3be450['fieldName'],'type':_0x3be450[_0xb4dd('0x29')]['key']};});_0x29a9dc[_0xb4dd('0x2a')]=_[_0xb4dd('0x27')](_0x125fdf,_0xb4dd('0x25'));_0x29a9dc[_0xb4dd('0x2b')]=_[_0xb4dd('0x2c')](_0x16be7f['query']);_0x29a9dc[_0xb4dd('0x2d')]=_['intersection'](_0x29a9dc[_0xb4dd('0x2a')],_0x29a9dc['query']);_0xd74a74[_0xb4dd('0x2e')]=_[_0xb4dd('0x2f')](_0x29a9dc[_0xb4dd('0x2a')],qs[_0xb4dd('0x30')](_0x16be7f[_0xb4dd('0x2b')][_0xb4dd('0x30')]));_0xd74a74[_0xb4dd('0x2e')]=_0xd74a74[_0xb4dd('0x2e')]['length']?_0xd74a74[_0xb4dd('0x2e')]:_0x29a9dc[_0xb4dd('0x2a')];if(!_0x16be7f['query'][_0xb4dd('0x31')](_0xb4dd('0x32'))){_0xd74a74['limit']=qs['limit'](_0x16be7f[_0xb4dd('0x2b')]['limit']);_0xd74a74[_0xb4dd('0x18')]=qs['offset'](_0x16be7f[_0xb4dd('0x2b')][_0xb4dd('0x18')]);}_0xd74a74['order']=qs['sort'](_0x16be7f[_0xb4dd('0x2b')][_0xb4dd('0x33')]);_0xd74a74[_0xb4dd('0x34')]=qs[_0xb4dd('0x2d')](_[_0xb4dd('0x35')](_0x16be7f[_0xb4dd('0x2b')],_0x29a9dc[_0xb4dd('0x2d')]),_0x125fdf);if(_0x16be7f['query'][_0xb4dd('0x36')]){_0xd74a74[_0xb4dd('0x34')]=_[_0xb4dd('0x37')](_0xd74a74[_0xb4dd('0x34')],{'$or':_[_0xb4dd('0x27')](_0x125fdf,function(_0x14f547){if(_0x14f547[_0xb4dd('0x29')]!==_0xb4dd('0x38')){var _0x4835f2={};_0x4835f2[_0x14f547[_0xb4dd('0x25')]]={'$like':'%'+_0x16be7f[_0xb4dd('0x2b')][_0xb4dd('0x36')]+'%'};return _0x4835f2;}})});}_0xd74a74=_[_0xb4dd('0x37')]({},_0xd74a74,_0x16be7f[_0xb4dd('0x39')]);var _0x2aaf06={'where':_0xd74a74[_0xb4dd('0x34')]};return db['ZohoConfiguration'][_0xb4dd('0x1b')](_0x2aaf06)[_0xb4dd('0x21')](function(_0x589071){_0x59c587[_0xb4dd('0x1b')]=_0x589071;if(_0x16be7f[_0xb4dd('0x2b')][_0xb4dd('0x3a')]){_0xd74a74['include']=[{'all':!![]}];}return db[_0xb4dd('0x28')][_0xb4dd('0x3b')](_0xd74a74);})[_0xb4dd('0x21')](function(_0x34c4db){_0x59c587[_0xb4dd('0x3c')]=_0x34c4db;return _0x59c587;})[_0xb4dd('0x21')](respondWithFilteredResult(_0x1647e5,_0xd74a74))[_0xb4dd('0x3d')](handleError(_0x1647e5,null));};exports[_0xb4dd('0x3e')]=function(_0x1f92c0,_0x2f5456){var _0x56e090={'raw':![],'where':{'id':_0x1f92c0[_0xb4dd('0x3f')]['id']}},_0x12b9cd={};_0x12b9cd[_0xb4dd('0x2a')]=_[_0xb4dd('0x2c')](db[_0xb4dd('0x28')]['rawAttributes']);_0x12b9cd[_0xb4dd('0x2b')]=_[_0xb4dd('0x2c')](_0x1f92c0['query']);_0x12b9cd[_0xb4dd('0x2d')]=_[_0xb4dd('0x2f')](_0x12b9cd[_0xb4dd('0x2a')],_0x12b9cd[_0xb4dd('0x2b')]);_0x56e090[_0xb4dd('0x2e')]=_[_0xb4dd('0x2f')](_0x12b9cd[_0xb4dd('0x2a')],qs['fields'](_0x1f92c0[_0xb4dd('0x2b')][_0xb4dd('0x30')]));_0x56e090['attributes']=_0x56e090[_0xb4dd('0x2e')][_0xb4dd('0x40')]?_0x56e090[_0xb4dd('0x2e')]:_0x12b9cd['model'];if(_0x1f92c0[_0xb4dd('0x2b')][_0xb4dd('0x3a')]){_0x56e090[_0xb4dd('0x41')]=[{'all':!![]}];}_0x56e090=_['merge']({},_0x56e090,_0x1f92c0[_0xb4dd('0x39')]);return db[_0xb4dd('0x28')]['find'](_0x56e090)[_0xb4dd('0x21')](handleEntityNotFound(_0x2f5456,null))['then'](respondWithResult(_0x2f5456,null))[_0xb4dd('0x3d')](handleError(_0x2f5456,null));};exports[_0xb4dd('0x42')]=function(_0x336087,_0x5290f1){return db[_0xb4dd('0x28')][_0xb4dd('0x42')](_0x336087[_0xb4dd('0x43')],{})[_0xb4dd('0x21')](respondWithResult(_0x5290f1,0xc9))[_0xb4dd('0x3d')](handleError(_0x5290f1,null));};exports[_0xb4dd('0x20')]=function(_0x30d07a,_0x13bc5f){if(_0x30d07a[_0xb4dd('0x43')]['id']){delete _0x30d07a[_0xb4dd('0x43')]['id'];}return db['ZohoConfiguration'][_0xb4dd('0x44')]({'where':{'id':_0x30d07a['params']['id']}})[_0xb4dd('0x21')](handleEntityNotFound(_0x13bc5f,null))['then'](saveUpdates(_0x30d07a[_0xb4dd('0x43')],null))[_0xb4dd('0x21')](respondWithResult(_0x13bc5f,null))[_0xb4dd('0x3d')](handleError(_0x13bc5f,null));};exports[_0xb4dd('0x22')]=function(_0x52a46d,_0x4cef13){return db[_0xb4dd('0x28')][_0xb4dd('0x44')]({'where':{'id':_0x52a46d['params']['id']}})[_0xb4dd('0x21')](handleEntityNotFound(_0x4cef13,null))[_0xb4dd('0x21')](removeEntity(_0x4cef13,null))[_0xb4dd('0x3d')](handleError(_0x4cef13,null));};exports[_0xb4dd('0x45')]=function(_0x343ca6,_0x38c6f3,_0x617917){var _0x26ecb2={};var _0x5547f5={};var _0x55dbd8;var _0x34bb71;return db['ZohoConfiguration'][_0xb4dd('0x46')]({'where':{'id':_0x343ca6[_0xb4dd('0x3f')]['id']}})[_0xb4dd('0x21')](handleEntityNotFound(_0x38c6f3,null))['then'](function(_0x230c98){if(_0x230c98){_0x55dbd8=_0x230c98;_0x5547f5[_0xb4dd('0x2a')]=_[_0xb4dd('0x2c')](db[_0xb4dd('0x47')][_0xb4dd('0x48')]);_0x5547f5[_0xb4dd('0x2b')]=_['keys'](_0x343ca6[_0xb4dd('0x2b')]);_0x5547f5['filters']=_[_0xb4dd('0x2f')](_0x5547f5['model'],_0x5547f5[_0xb4dd('0x2b')]);_0x26ecb2[_0xb4dd('0x2e')]=_[_0xb4dd('0x2f')](_0x5547f5[_0xb4dd('0x2a')],qs[_0xb4dd('0x30')](_0x343ca6['query'][_0xb4dd('0x30')]));_0x26ecb2[_0xb4dd('0x2e')]=_0x26ecb2[_0xb4dd('0x2e')][_0xb4dd('0x40')]?_0x26ecb2[_0xb4dd('0x2e')]:_0x5547f5[_0xb4dd('0x2a')];_0x26ecb2[_0xb4dd('0x49')]=qs['sort'](_0x343ca6[_0xb4dd('0x2b')][_0xb4dd('0x33')]);_0x26ecb2[_0xb4dd('0x34')]=qs[_0xb4dd('0x2d')](_[_0xb4dd('0x35')](_0x343ca6[_0xb4dd('0x2b')],_0x5547f5[_0xb4dd('0x2d')]));if(_0x343ca6[_0xb4dd('0x2b')][_0xb4dd('0x36')]){_0x26ecb2[_0xb4dd('0x34')]=_[_0xb4dd('0x37')](_0x26ecb2[_0xb4dd('0x34')],{'$or':_[_0xb4dd('0x27')](_0x26ecb2[_0xb4dd('0x2e')],function(_0x247a40){var _0x1c12d7={};_0x1c12d7[_0x247a40]={'$like':'%'+_0x343ca6[_0xb4dd('0x2b')][_0xb4dd('0x36')]+'%'};return _0x1c12d7;})});}_0x26ecb2=_[_0xb4dd('0x37')]({},_0x26ecb2,_0x343ca6[_0xb4dd('0x39')]);return _0x55dbd8['getFields'](_0x26ecb2);}})[_0xb4dd('0x21')](function(_0x149f23){if(_0x149f23){_0x34bb71=_0x149f23[_0xb4dd('0x40')];if(!_0x343ca6[_0xb4dd('0x2b')][_0xb4dd('0x31')]('nolimit')){_0x26ecb2[_0xb4dd('0x1a')]=qs[_0xb4dd('0x1a')](_0x343ca6['query'][_0xb4dd('0x1a')]);_0x26ecb2[_0xb4dd('0x18')]=qs[_0xb4dd('0x18')](_0x343ca6[_0xb4dd('0x2b')][_0xb4dd('0x18')]);}return _0x55dbd8['getFields'](_0x26ecb2);}})[_0xb4dd('0x21')](function(_0x56891b){if(_0x56891b){return _0x56891b?{'count':_0x34bb71,'rows':_0x56891b}:null;}})[_0xb4dd('0x21')](respondWithResult(_0x38c6f3,null))[_0xb4dd('0x3d')](handleError(_0x38c6f3,null));};exports['getSubjects']=function(_0xf3145b,_0x1cfde2,_0x4e8241){var _0x5d18e1={};var _0x33da8e={};var _0x5b349c;var _0x423f94;return db['ZohoConfiguration'][_0xb4dd('0x46')]({'where':{'id':_0xf3145b['params']['id']}})[_0xb4dd('0x21')](handleEntityNotFound(_0x1cfde2,null))[_0xb4dd('0x21')](function(_0x358ed5){if(_0x358ed5){_0x5b349c=_0x358ed5;_0x33da8e[_0xb4dd('0x2a')]=_['keys'](db[_0xb4dd('0x47')][_0xb4dd('0x48')]);_0x33da8e[_0xb4dd('0x2b')]=_[_0xb4dd('0x2c')](_0xf3145b[_0xb4dd('0x2b')]);_0x33da8e[_0xb4dd('0x2d')]=_['intersection'](_0x33da8e[_0xb4dd('0x2a')],_0x33da8e['query']);_0x5d18e1['attributes']=_['intersection'](_0x33da8e['model'],qs[_0xb4dd('0x30')](_0xf3145b[_0xb4dd('0x2b')][_0xb4dd('0x30')]));_0x5d18e1[_0xb4dd('0x2e')]=_0x5d18e1[_0xb4dd('0x2e')]['length']?_0x5d18e1[_0xb4dd('0x2e')]:_0x33da8e[_0xb4dd('0x2a')];_0x5d18e1['order']=qs['sort'](_0xf3145b[_0xb4dd('0x2b')]['sort']);_0x5d18e1[_0xb4dd('0x34')]=qs['filters'](_[_0xb4dd('0x35')](_0xf3145b[_0xb4dd('0x2b')],_0x33da8e[_0xb4dd('0x2d')]));if(_0xf3145b['query'][_0xb4dd('0x36')]){_0x5d18e1[_0xb4dd('0x34')]=_[_0xb4dd('0x37')](_0x5d18e1['where'],{'$or':_[_0xb4dd('0x27')](_0x5d18e1[_0xb4dd('0x2e')],function(_0xa6f926){var _0x1b144a={};_0x1b144a[_0xa6f926]={'$like':'%'+_0xf3145b['query'][_0xb4dd('0x36')]+'%'};return _0x1b144a;})});}_0x5d18e1=_[_0xb4dd('0x37')]({},_0x5d18e1,_0xf3145b[_0xb4dd('0x39')]);return _0x5b349c['getSubjects'](_0x5d18e1);}})[_0xb4dd('0x21')](function(_0x462934){if(_0x462934){_0x423f94=_0x462934[_0xb4dd('0x40')];if(!_0xf3145b[_0xb4dd('0x2b')][_0xb4dd('0x31')](_0xb4dd('0x32'))){_0x5d18e1[_0xb4dd('0x1a')]=qs[_0xb4dd('0x1a')](_0xf3145b[_0xb4dd('0x2b')][_0xb4dd('0x1a')]);_0x5d18e1[_0xb4dd('0x18')]=qs[_0xb4dd('0x18')](_0xf3145b['query']['offset']);}return _0x5b349c[_0xb4dd('0x4a')](_0x5d18e1);}})[_0xb4dd('0x21')](function(_0x517d27){if(_0x517d27){return _0x517d27?{'count':_0x423f94,'rows':_0x517d27}:null;}})[_0xb4dd('0x21')](respondWithResult(_0x1cfde2,null))[_0xb4dd('0x3d')](handleError(_0x1cfde2,null));};exports[_0xb4dd('0x4b')]=function(_0x57fefe,_0x194d38,_0x3fb171){var _0x519ad5={};var _0xc69280={};var _0x893434;var _0x455292;return db[_0xb4dd('0x28')][_0xb4dd('0x46')]({'where':{'id':_0x57fefe['params']['id']}})[_0xb4dd('0x21')](handleEntityNotFound(_0x194d38,null))[_0xb4dd('0x21')](function(_0x9ce140){if(_0x9ce140){_0x893434=_0x9ce140;_0xc69280[_0xb4dd('0x2a')]=_[_0xb4dd('0x2c')](db[_0xb4dd('0x47')][_0xb4dd('0x48')]);_0xc69280['query']=_[_0xb4dd('0x2c')](_0x57fefe[_0xb4dd('0x2b')]);_0xc69280[_0xb4dd('0x2d')]=_[_0xb4dd('0x2f')](_0xc69280[_0xb4dd('0x2a')],_0xc69280[_0xb4dd('0x2b')]);_0x519ad5[_0xb4dd('0x2e')]=_[_0xb4dd('0x2f')](_0xc69280[_0xb4dd('0x2a')],qs['fields'](_0x57fefe[_0xb4dd('0x2b')][_0xb4dd('0x30')]));_0x519ad5['attributes']=_0x519ad5[_0xb4dd('0x2e')]['length']?_0x519ad5['attributes']:_0xc69280[_0xb4dd('0x2a')];_0x519ad5[_0xb4dd('0x49')]=qs[_0xb4dd('0x33')](_0x57fefe[_0xb4dd('0x2b')]['sort']);_0x519ad5['where']=qs[_0xb4dd('0x2d')](_[_0xb4dd('0x35')](_0x57fefe[_0xb4dd('0x2b')],_0xc69280[_0xb4dd('0x2d')]));if(_0x57fefe[_0xb4dd('0x2b')][_0xb4dd('0x36')]){_0x519ad5[_0xb4dd('0x34')]=_[_0xb4dd('0x37')](_0x519ad5[_0xb4dd('0x34')],{'$or':_[_0xb4dd('0x27')](_0x519ad5[_0xb4dd('0x2e')],function(_0xe8a5c){var _0xe8b5b={};_0xe8b5b[_0xe8a5c]={'$like':'%'+_0x57fefe['query'][_0xb4dd('0x36')]+'%'};return _0xe8b5b;})});}_0x519ad5=_['merge']({},_0x519ad5,_0x57fefe[_0xb4dd('0x39')]);return _0x893434[_0xb4dd('0x4b')](_0x519ad5);}})[_0xb4dd('0x21')](function(_0x376a27){if(_0x376a27){_0x455292=_0x376a27[_0xb4dd('0x40')];if(!_0x57fefe[_0xb4dd('0x2b')]['hasOwnProperty'](_0xb4dd('0x32'))){_0x519ad5['limit']=qs[_0xb4dd('0x1a')](_0x57fefe[_0xb4dd('0x2b')][_0xb4dd('0x1a')]);_0x519ad5['offset']=qs[_0xb4dd('0x18')](_0x57fefe[_0xb4dd('0x2b')][_0xb4dd('0x18')]);}return _0x893434['getDescriptions'](_0x519ad5);}})[_0xb4dd('0x21')](function(_0x594f61){if(_0x594f61){return _0x594f61?{'count':_0x455292,'rows':_0x594f61}:null;}})[_0xb4dd('0x21')](respondWithResult(_0x194d38,null))[_0xb4dd('0x3d')](handleError(_0x194d38,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 5347be0..124d5b8 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 _0x6ec1=['request-promise','path','rimraf','../../config/environment','exports','lodash','util','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6ec1,0x195));var _0x16ec=function(_0x836c22,_0x1204e1){_0x836c22=_0x836c22-0x0;var _0xdb33d7=_0x6ec1[_0x836c22];return _0xdb33d7;};'use strict';var _=require(_0x16ec('0x0'));var util=require(_0x16ec('0x1'));var logger=require('../../config/logger')(_0x16ec('0x2'));var moment=require(_0x16ec('0x3'));var BPromise=require(_0x16ec('0x4'));var rp=require(_0x16ec('0x5'));var fs=require('fs');var path=require(_0x16ec('0x6'));var rimraf=require(_0x16ec('0x7'));var config=require(_0x16ec('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0x16ec('0x9')]=function(_0x4594a,_0x389228){return _0x4594a['define']('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2de=['bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','lodash','util','../../config/logger'];(function(_0x15e0bb,_0x26f939){var _0x44b7e7=function(_0x92132){while(--_0x92132){_0x15e0bb['push'](_0x15e0bb['shift']());}};_0x44b7e7(++_0x26f939);}(_0xb2de,0xb1));var _0xeb2d=function(_0x3343ed,_0x585d29){_0x3343ed=_0x3343ed-0x0;var _0x5c8fb1=_0xb2de[_0x3343ed];return _0x5c8fb1;};'use strict';var _=require(_0xeb2d('0x0'));var util=require(_0xeb2d('0x1'));var logger=require(_0xeb2d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xeb2d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb2d('0x4'));var rimraf=require(_0xeb2d('0x5'));var config=require(_0xeb2d('0x6'));var attributes=require(_0xeb2d('0x7'));module[_0xeb2d('0x8')]=function(_0x50c7a5,_0x2194b7){return _0x50c7a5['define'](_0xeb2d('0x9'),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 e2cd947..27fc4e5 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 _0x0586=['error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xe9c4f7,_0x4fdfdf){var _0x13f84c=function(_0x68df2e){while(--_0x68df2e){_0xe9c4f7['push'](_0xe9c4f7['shift']());}};_0x13f84c(++_0x4fdfdf);}(_0x0586,0x17d));var _0x6058=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0586[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6058('0x0'));var util=require(_0x6058('0x1'));var moment=require(_0x6058('0x2'));var BPromise=require(_0x6058('0x3'));var rs=require(_0x6058('0x4'));var fs=require('fs');var Redis=require(_0x6058('0x5'));var db=require(_0x6058('0x6'))['db'];var utils=require(_0x6058('0x7'));var logger=require('../../config/logger')(_0x6058('0x8'));var config=require(_0x6058('0x9'));var jayson=require(_0x6058('0xa'));var client=jayson[_0x6058('0xb')][_0x6058('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x24d540,_0x2608f2,_0x4e6254){return new BPromise(function(_0x44988b,_0x154eb2){return client['request'](_0x24d540,_0x4e6254)[_0x6058('0xd')](function(_0x576d21){logger[_0x6058('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x2608f2,_0x6058('0xf'));logger[_0x6058('0x10')](_0x6058('0x11'),_0x2608f2,_0x6058('0xf'),JSON[_0x6058('0x12')](_0x576d21));if(_0x576d21[_0x6058('0x13')]){if(_0x576d21['error'][_0x6058('0x14')]===0x1f4){logger[_0x6058('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x2608f2,_0x576d21[_0x6058('0x13')][_0x6058('0x15')]);return _0x154eb2(_0x576d21[_0x6058('0x13')][_0x6058('0x15')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x2608f2,_0x576d21[_0x6058('0x13')][_0x6058('0x15')]);return _0x44988b(_0x576d21['error'][_0x6058('0x15')]);}else{logger[_0x6058('0xe')](_0x6058('0x16'),_0x2608f2,_0x6058('0xf'));_0x44988b(_0x576d21[_0x6058('0x17')][_0x6058('0x15')]);}})[_0x6058('0x18')](function(_0x538235){logger[_0x6058('0x13')](_0x6058('0x16'),_0x2608f2,_0x538235);_0x154eb2(_0x538235);});});} \ No newline at end of file +var _0x1550=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0x1550,0xa1));var _0x0155=function(_0x23cc7f,_0x234a23){_0x23cc7f=_0x23cc7f-0x0;var _0x7003be=_0x1550[_0x23cc7f];return _0x7003be;};'use strict';var _=require(_0x0155('0x0'));var util=require(_0x0155('0x1'));var moment=require(_0x0155('0x2'));var BPromise=require(_0x0155('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0155('0x4'));var db=require(_0x0155('0x5'))['db'];var utils=require(_0x0155('0x6'));var logger=require('../../config/logger')(_0x0155('0x7'));var config=require(_0x0155('0x8'));var jayson=require(_0x0155('0x9'));var client=jayson['client'][_0x0155('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33b419,_0xd637b,_0x3e95b3){return new BPromise(function(_0x100460,_0x1c21d3){return client[_0x0155('0xb')](_0x33b419,_0x3e95b3)[_0x0155('0xc')](function(_0x59dac5){logger[_0x0155('0xd')](_0x0155('0xe'),_0xd637b,_0x0155('0xf'));logger[_0x0155('0x10')](_0x0155('0x11'),_0xd637b,_0x0155('0xf'),JSON['stringify'](_0x59dac5));if(_0x59dac5[_0x0155('0x12')]){if(_0x59dac5['error'][_0x0155('0x13')]===0x1f4){logger[_0x0155('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0xd637b,_0x59dac5[_0x0155('0x12')][_0x0155('0x14')]);return _0x1c21d3(_0x59dac5[_0x0155('0x12')][_0x0155('0x14')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0xd637b,_0x59dac5[_0x0155('0x12')]['message']);return _0x100460(_0x59dac5[_0x0155('0x12')][_0x0155('0x14')]);}else{logger[_0x0155('0xd')](_0x0155('0xe'),_0xd637b,_0x0155('0xf'));_0x100460(_0x59dac5[_0x0155('0x15')]['message']);}})[_0x0155('0x16')](function(_0x5c4411){logger[_0x0155('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0xd637b,_0x5c4411);_0x1c21d3(_0x5c4411);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 99d20ae..1ddc9b0 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 _0xaaf5=['show','post','put','update','destroy','exports','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','/:id','isAuthenticated'];(function(_0x2d23e5,_0x4eea0d){var _0x28a46d=function(_0x5a30ed){while(--_0x5a30ed){_0x2d23e5['push'](_0x2d23e5['shift']());}};_0x28a46d(++_0x4eea0d);}(_0xaaf5,0x6f));var _0x5aaf=function(_0x588c2f,_0x6e9b0){_0x588c2f=_0x588c2f-0x0;var _0x4ff8b6=_0xaaf5[_0x588c2f];return _0x4ff8b6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5aaf('0x0'));var express=require('express');var router=express[_0x5aaf('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x5aaf('0x2'));var interaction=require(_0x5aaf('0x3'));var config=require(_0x5aaf('0x4'));var controller=require(_0x5aaf('0x5'));router[_0x5aaf('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5aaf('0x6')](_0x5aaf('0x7'),auth[_0x5aaf('0x8')](),controller[_0x5aaf('0x9')]);router[_0x5aaf('0xa')]('/',auth[_0x5aaf('0x8')](),controller['create']);router[_0x5aaf('0xb')]('/:id',auth[_0x5aaf('0x8')](),controller[_0x5aaf('0xc')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5aaf('0xd')]);module[_0x5aaf('0xe')]=router; \ No newline at end of file +var _0x8d18=['isAuthenticated','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x8d18,0x103));var _0x88d1=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0x8d18[_0x4521e3];return _0x46a272;};'use strict';var multer=require('multer');var util=require(_0x88d1('0x0'));var path=require(_0x88d1('0x1'));var timeout=require(_0x88d1('0x2'));var express=require(_0x88d1('0x3'));var router=express[_0x88d1('0x4')]();var fs_extra=require(_0x88d1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x88d1('0x6'));var config=require(_0x88d1('0x7'));var controller=require('./intZohoField.controller');router[_0x88d1('0x8')]('/',auth['isAuthenticated'](),controller[_0x88d1('0x9')]);router[_0x88d1('0x8')](_0x88d1('0xa'),auth[_0x88d1('0xb')](),controller['show']);router[_0x88d1('0xc')]('/',auth[_0x88d1('0xb')](),controller[_0x88d1('0xd')]);router[_0x88d1('0xe')](_0x88d1('0xa'),auth[_0x88d1('0xb')](),controller[_0x88d1('0xf')]);router['delete'](_0x88d1('0xa'),auth['isAuthenticated'](),controller[_0x88d1('0x10')]);module[_0x88d1('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 fa94266..8068338 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 _0x2c70=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x52a7ee,_0x31183d){var _0x5668fa=function(_0x3cc8a5){while(--_0x3cc8a5){_0x52a7ee['push'](_0x52a7ee['shift']());}};_0x5668fa(++_0x31183d);}(_0x2c70,0x7c));var _0x02c7=function(_0x405fd6,_0x167a2a){_0x405fd6=_0x405fd6-0x0;var _0x1e22ba=_0x2c70[_0x405fd6];return _0x1e22ba;};'use strict';var Sequelize=require(_0x02c7('0x0'));module[_0x02c7('0x1')]={'type':{'type':Sequelize[_0x02c7('0x2')](_0x02c7('0x3'),_0x02c7('0x4'),_0x02c7('0x5'),_0x02c7('0x6'),_0x02c7('0x7')),'defaultValue':_0x02c7('0x3')},'content':{'type':Sequelize[_0x02c7('0x8')]},'key':{'type':Sequelize[_0x02c7('0x8')]},'keyType':{'type':Sequelize[_0x02c7('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x02c7('0x8')]},'idField':{'type':Sequelize[_0x02c7('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x02c7('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x02c7('0x8')]}}; \ No newline at end of file +var _0x7eb8=['variable','keyValue','STRING','customVariable','sequelize','ENUM','string'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x7eb8,0xf9));var _0x87eb=function(_0x4c96ce,_0x5239b0){_0x4c96ce=_0x4c96ce-0x0;var _0x383569=_0x7eb8[_0x4c96ce];return _0x383569;};'use strict';var Sequelize=require(_0x87eb('0x0'));module['exports']={'type':{'type':Sequelize[_0x87eb('0x1')](_0x87eb('0x2'),_0x87eb('0x3'),'customVariable',_0x87eb('0x4'),'picklist'),'defaultValue':_0x87eb('0x2')},'content':{'type':Sequelize[_0x87eb('0x5')]},'key':{'type':Sequelize[_0x87eb('0x5')]},'keyType':{'type':Sequelize[_0x87eb('0x1')](_0x87eb('0x2'),_0x87eb('0x3'),_0x87eb('0x6'))},'keyContent':{'type':Sequelize[_0x87eb('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x87eb('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x87eb('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index eadaec4..7508f58 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 _0xc8f2=['intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','count','limit','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','model','keys','query','filters'];(function(_0x5ba513,_0x459c3b){var _0x1132a0=function(_0x2fe943){while(--_0x2fe943){_0x5ba513['push'](_0x5ba513['shift']());}};_0x1132a0(++_0x459c3b);}(_0xc8f2,0x120));var _0x2c8f=function(_0x26b851,_0x599202){_0x26b851=_0x26b851-0x0;var _0x26566f=_0xc8f2[_0x26b851];return _0x26566f;};'use strict';var emlformat=require(_0x2c8f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c8f('0x1'));var jsonpatch=require(_0x2c8f('0x2'));var rp=require(_0x2c8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2c8f('0x4'));var util=require(_0x2c8f('0x5'));var path=require(_0x2c8f('0x6'));var sox=require(_0x2c8f('0x7'));var csv=require(_0x2c8f('0x8'));var ejs=require(_0x2c8f('0x9'));var fs=require('fs');var fs_extra=require(_0x2c8f('0xa'));var _=require('lodash');var squel=require(_0x2c8f('0xb'));var crypto=require(_0x2c8f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2c8f('0xd'));var toCsv=require(_0x2c8f('0x8'));var querystring=require('querystring');var Papa=require(_0x2c8f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2c8f('0xf'));var hardwareService=require(_0x2c8f('0x10'));var logger=require(_0x2c8f('0x11'))(_0x2c8f('0x12'));var utils=require(_0x2c8f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2c8f('0x14'));var db=require(_0x2c8f('0x15'))['db'];function respondWithStatusCode(_0x5c0ce4,_0x43f00d){_0x43f00d=_0x43f00d||0xcc;return function(_0x472cb7){if(_0x472cb7){return _0x5c0ce4[_0x2c8f('0x16')](_0x43f00d);}return _0x5c0ce4['status'](_0x43f00d)[_0x2c8f('0x17')]();};}function respondWithResult(_0x57ebf2,_0x522831){_0x522831=_0x522831||0xc8;return function(_0x5075ce){if(_0x5075ce){return _0x57ebf2[_0x2c8f('0x18')](_0x522831)[_0x2c8f('0x19')](_0x5075ce);}};}function respondWithFilteredResult(_0x117114,_0x1868f1){return function(_0x530e53){if(_0x530e53){var _0x1220c9=typeof _0x1868f1[_0x2c8f('0x1a')]==='undefined'&&typeof _0x1868f1['limit']==='undefined';var _0x2de404=_0x530e53[_0x2c8f('0x1b')];var _0x508e87=_0x1220c9?0x0:_0x1868f1[_0x2c8f('0x1a')];var _0x53855e=_0x1220c9?_0x530e53[_0x2c8f('0x1b')]:_0x1868f1[_0x2c8f('0x1a')]+_0x1868f1[_0x2c8f('0x1c')];var _0xa3bad4;if(_0x53855e>=_0x2de404){_0x53855e=_0x2de404;_0xa3bad4=0xc8;}else{_0xa3bad4=0xce;}_0x117114[_0x2c8f('0x18')](_0xa3bad4);return _0x117114['set'](_0x2c8f('0x1d'),_0x508e87+'-'+_0x53855e+'/'+_0x2de404)[_0x2c8f('0x19')](_0x530e53);}return null;};}function patchUpdates(_0xc3a2d){return function(_0x253652){try{jsonpatch[_0x2c8f('0x1e')](_0x253652,_0xc3a2d,!![]);}catch(_0x3e23f0){return BPromise['reject'](_0x3e23f0);}return _0x253652['save']();};}function saveUpdates(_0x51d2b5,_0x1a0995){return function(_0xc46e89){if(_0xc46e89){return _0xc46e89[_0x2c8f('0x1f')](_0x51d2b5)[_0x2c8f('0x20')](function(_0x44c701){return _0x44c701;});}return null;};}function removeEntity(_0x57def8,_0x9139fb){return function(_0x1b77d6){if(_0x1b77d6){return _0x1b77d6[_0x2c8f('0x21')]()['then'](function(){_0x57def8['status'](0xcc)[_0x2c8f('0x17')]();});}};}function handleEntityNotFound(_0xa96d33,_0x395aff){return function(_0x25fff8){if(!_0x25fff8){_0xa96d33[_0x2c8f('0x16')](0x194);}return _0x25fff8;};}function handleError(_0x4a5c3,_0x4762d4){_0x4762d4=_0x4762d4||0x1f4;return function(_0x50b69f){logger[_0x2c8f('0x22')](_0x50b69f[_0x2c8f('0x23')]);if(_0x50b69f[_0x2c8f('0x24')]){delete _0x50b69f[_0x2c8f('0x24')];}_0x4a5c3[_0x2c8f('0x18')](_0x4762d4)[_0x2c8f('0x25')](_0x50b69f);};}exports[_0x2c8f('0x26')]=function(_0x10ac10,_0x3336ca){var _0x341bc3={},_0x30a5ce={},_0x491689={'count':0x0,'rows':[]};var _0x5280f0=_[_0x2c8f('0x27')](db[_0x2c8f('0x28')][_0x2c8f('0x29')],function(_0x174ade){return{'name':_0x174ade[_0x2c8f('0x2a')],'type':_0x174ade['type']['key']};});_0x30a5ce[_0x2c8f('0x2b')]=_[_0x2c8f('0x27')](_0x5280f0,_0x2c8f('0x24'));_0x30a5ce['query']=_[_0x2c8f('0x2c')](_0x10ac10[_0x2c8f('0x2d')]);_0x30a5ce[_0x2c8f('0x2e')]=_[_0x2c8f('0x2f')](_0x30a5ce['model'],_0x30a5ce['query']);_0x341bc3[_0x2c8f('0x30')]=_[_0x2c8f('0x2f')](_0x30a5ce[_0x2c8f('0x2b')],qs[_0x2c8f('0x31')](_0x10ac10['query'][_0x2c8f('0x31')]));_0x341bc3[_0x2c8f('0x30')]=_0x341bc3['attributes']['length']?_0x341bc3['attributes']:_0x30a5ce[_0x2c8f('0x2b')];if(!_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x32')]('nolimit')){_0x341bc3[_0x2c8f('0x1c')]=qs[_0x2c8f('0x1c')](_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x1c')]);_0x341bc3['offset']=qs['offset'](_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x1a')]);}_0x341bc3[_0x2c8f('0x33')]=qs['sort'](_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x34')]);_0x341bc3[_0x2c8f('0x35')]=qs[_0x2c8f('0x2e')](_['pick'](_0x10ac10[_0x2c8f('0x2d')],_0x30a5ce[_0x2c8f('0x2e')]),_0x5280f0);if(_0x10ac10['query'][_0x2c8f('0x36')]){_0x341bc3[_0x2c8f('0x35')]=_[_0x2c8f('0x37')](_0x341bc3[_0x2c8f('0x35')],{'$or':_[_0x2c8f('0x27')](_0x5280f0,function(_0x2f09a6){if(_0x2f09a6[_0x2c8f('0x38')]!=='VIRTUAL'){var _0x355ed9={};_0x355ed9[_0x2f09a6[_0x2c8f('0x24')]]={'$like':'%'+_0x10ac10['query'][_0x2c8f('0x36')]+'%'};return _0x355ed9;}})});}_0x341bc3=_[_0x2c8f('0x37')]({},_0x341bc3,_0x10ac10[_0x2c8f('0x39')]);var _0x4b8155={'where':_0x341bc3[_0x2c8f('0x35')]};return db[_0x2c8f('0x28')][_0x2c8f('0x1b')](_0x4b8155)['then'](function(_0x205b36){_0x491689['count']=_0x205b36;if(_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x3a')]){_0x341bc3[_0x2c8f('0x3b')]=[{'all':!![]}];}return db[_0x2c8f('0x28')][_0x2c8f('0x3c')](_0x341bc3);})[_0x2c8f('0x20')](function(_0x440052){_0x491689[_0x2c8f('0x3d')]=_0x440052;return _0x491689;})[_0x2c8f('0x20')](respondWithFilteredResult(_0x3336ca,_0x341bc3))[_0x2c8f('0x3e')](handleError(_0x3336ca,null));};exports[_0x2c8f('0x3f')]=function(_0x2f4922,_0xc25d4d){var _0xc5a0ce={'raw':!![],'where':{'id':_0x2f4922[_0x2c8f('0x40')]['id']}},_0x1b62e8={};_0x1b62e8[_0x2c8f('0x2b')]=_[_0x2c8f('0x2c')](db[_0x2c8f('0x28')][_0x2c8f('0x29')]);_0x1b62e8[_0x2c8f('0x2d')]=_[_0x2c8f('0x2c')](_0x2f4922['query']);_0x1b62e8[_0x2c8f('0x2e')]=_[_0x2c8f('0x2f')](_0x1b62e8[_0x2c8f('0x2b')],_0x1b62e8[_0x2c8f('0x2d')]);_0xc5a0ce[_0x2c8f('0x30')]=_[_0x2c8f('0x2f')](_0x1b62e8['model'],qs[_0x2c8f('0x31')](_0x2f4922['query'][_0x2c8f('0x31')]));_0xc5a0ce[_0x2c8f('0x30')]=_0xc5a0ce['attributes']['length']?_0xc5a0ce[_0x2c8f('0x30')]:_0x1b62e8[_0x2c8f('0x2b')];if(_0x2f4922['query'][_0x2c8f('0x3a')]){_0xc5a0ce[_0x2c8f('0x3b')]=[{'all':!![]}];}_0xc5a0ce=_['merge']({},_0xc5a0ce,_0x2f4922[_0x2c8f('0x39')]);return db[_0x2c8f('0x28')][_0x2c8f('0x41')](_0xc5a0ce)[_0x2c8f('0x20')](handleEntityNotFound(_0xc25d4d,null))[_0x2c8f('0x20')](respondWithResult(_0xc25d4d,null))[_0x2c8f('0x3e')](handleError(_0xc25d4d,null));};exports['create']=function(_0x4db705,_0xe0fd3){return db['ZohoField']['create'](_0x4db705[_0x2c8f('0x42')],{})[_0x2c8f('0x20')](respondWithResult(_0xe0fd3,0xc9))[_0x2c8f('0x3e')](handleError(_0xe0fd3,null));};exports[_0x2c8f('0x1f')]=function(_0x22cadd,_0x36bd92){if(_0x22cadd['body']['id']){delete _0x22cadd['body']['id'];}return db[_0x2c8f('0x28')][_0x2c8f('0x41')]({'where':{'id':_0x22cadd[_0x2c8f('0x40')]['id']}})[_0x2c8f('0x20')](handleEntityNotFound(_0x36bd92,null))[_0x2c8f('0x20')](saveUpdates(_0x22cadd[_0x2c8f('0x42')],null))[_0x2c8f('0x20')](respondWithResult(_0x36bd92,null))[_0x2c8f('0x3e')](handleError(_0x36bd92,null));};exports[_0x2c8f('0x21')]=function(_0x51e7ec,_0x228b52){return db[_0x2c8f('0x28')]['find']({'where':{'id':_0x51e7ec['params']['id']}})['then'](handleEntityNotFound(_0x228b52,null))[_0x2c8f('0x20')](removeEntity(_0x228b52,null))[_0x2c8f('0x3e')](handleError(_0x228b52,null));}; \ No newline at end of file +var _0x8bfe=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ZohoField','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x214d54,_0x133c72){var _0x44ca46=function(_0xe42b02){while(--_0xe42b02){_0x214d54['push'](_0x214d54['shift']());}};_0x44ca46(++_0x133c72);}(_0x8bfe,0x195));var _0xe8bf=function(_0x4ca160,_0x14886c){_0x4ca160=_0x4ca160-0x0;var _0x303ae9=_0x8bfe[_0x4ca160];return _0x303ae9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe8bf('0x0'));var zipdir=require(_0xe8bf('0x1'));var jsonpatch=require(_0xe8bf('0x2'));var rp=require('request-promise');var moment=require(_0xe8bf('0x3'));var BPromise=require(_0xe8bf('0x4'));var Mustache=require(_0xe8bf('0x5'));var util=require('util');var path=require(_0xe8bf('0x6'));var sox=require(_0xe8bf('0x7'));var csv=require(_0xe8bf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8bf('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe8bf('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe8bf('0x8'));var querystring=require(_0xe8bf('0xb'));var Papa=require(_0xe8bf('0xc'));var Redis=require(_0xe8bf('0xd'));var authService=require(_0xe8bf('0xe'));var qs=require(_0xe8bf('0xf'));var as=require(_0xe8bf('0x10'));var hardwareService=require(_0xe8bf('0x11'));var logger=require(_0xe8bf('0x12'))(_0xe8bf('0x13'));var utils=require(_0xe8bf('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe8bf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bde53,_0xa89472){_0xa89472=_0xa89472||0xcc;return function(_0x3f4cfb){if(_0x3f4cfb){return _0x1bde53[_0xe8bf('0x16')](_0xa89472);}return _0x1bde53[_0xe8bf('0x17')](_0xa89472)[_0xe8bf('0x18')]();};}function respondWithResult(_0x98f592,_0x14d331){_0x14d331=_0x14d331||0xc8;return function(_0x28a6df){if(_0x28a6df){return _0x98f592[_0xe8bf('0x17')](_0x14d331)[_0xe8bf('0x19')](_0x28a6df);}};}function respondWithFilteredResult(_0x4f835c,_0x1dffc6){return function(_0xa0d950){if(_0xa0d950){var _0x4a0719=typeof _0x1dffc6[_0xe8bf('0x1a')]==='undefined'&&typeof _0x1dffc6[_0xe8bf('0x1b')]===_0xe8bf('0x1c');var _0x25bd5b=_0xa0d950[_0xe8bf('0x1d')];var _0x268f02=_0x4a0719?0x0:_0x1dffc6[_0xe8bf('0x1a')];var _0x410816=_0x4a0719?_0xa0d950[_0xe8bf('0x1d')]:_0x1dffc6[_0xe8bf('0x1a')]+_0x1dffc6[_0xe8bf('0x1b')];var _0x4bc6ee;if(_0x410816>=_0x25bd5b){_0x410816=_0x25bd5b;_0x4bc6ee=0xc8;}else{_0x4bc6ee=0xce;}_0x4f835c['status'](_0x4bc6ee);return _0x4f835c[_0xe8bf('0x1e')](_0xe8bf('0x1f'),_0x268f02+'-'+_0x410816+'/'+_0x25bd5b)[_0xe8bf('0x19')](_0xa0d950);}return null;};}function patchUpdates(_0x2088c2){return function(_0x51d640){try{jsonpatch[_0xe8bf('0x20')](_0x51d640,_0x2088c2,!![]);}catch(_0x10d281){return BPromise[_0xe8bf('0x21')](_0x10d281);}return _0x51d640[_0xe8bf('0x22')]();};}function saveUpdates(_0x251502,_0x2ea881){return function(_0xb85cb0){if(_0xb85cb0){return _0xb85cb0[_0xe8bf('0x23')](_0x251502)[_0xe8bf('0x24')](function(_0x393e2c){return _0x393e2c;});}return null;};}function removeEntity(_0x6ffabf,_0x2c9aaf){return function(_0x3735f5){if(_0x3735f5){return _0x3735f5[_0xe8bf('0x25')]()['then'](function(){_0x6ffabf[_0xe8bf('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x262330,_0x348a35){return function(_0x27aa16){if(!_0x27aa16){_0x262330[_0xe8bf('0x16')](0x194);}return _0x27aa16;};}function handleError(_0x41fe17,_0xba89e2){_0xba89e2=_0xba89e2||0x1f4;return function(_0x165b66){logger[_0xe8bf('0x26')](_0x165b66[_0xe8bf('0x27')]);if(_0x165b66[_0xe8bf('0x28')]){delete _0x165b66[_0xe8bf('0x28')];}_0x41fe17['status'](_0xba89e2)['send'](_0x165b66);};}exports[_0xe8bf('0x29')]=function(_0x1060c8,_0x6e72df){var _0x26a9c4={},_0x354d24={},_0x16d185={'count':0x0,'rows':[]};var _0x35f60f=_[_0xe8bf('0x2a')](db[_0xe8bf('0x2b')][_0xe8bf('0x2c')],function(_0x35658e){return{'name':_0x35658e[_0xe8bf('0x2d')],'type':_0x35658e['type']['key']};});_0x354d24[_0xe8bf('0x2e')]=_[_0xe8bf('0x2a')](_0x35f60f,_0xe8bf('0x28'));_0x354d24[_0xe8bf('0x2f')]=_[_0xe8bf('0x30')](_0x1060c8[_0xe8bf('0x2f')]);_0x354d24[_0xe8bf('0x31')]=_[_0xe8bf('0x32')](_0x354d24['model'],_0x354d24[_0xe8bf('0x2f')]);_0x26a9c4[_0xe8bf('0x33')]=_[_0xe8bf('0x32')](_0x354d24[_0xe8bf('0x2e')],qs[_0xe8bf('0x34')](_0x1060c8[_0xe8bf('0x2f')]['fields']));_0x26a9c4[_0xe8bf('0x33')]=_0x26a9c4[_0xe8bf('0x33')]['length']?_0x26a9c4[_0xe8bf('0x33')]:_0x354d24['model'];if(!_0x1060c8[_0xe8bf('0x2f')][_0xe8bf('0x35')](_0xe8bf('0x36'))){_0x26a9c4[_0xe8bf('0x1b')]=qs[_0xe8bf('0x1b')](_0x1060c8[_0xe8bf('0x2f')][_0xe8bf('0x1b')]);_0x26a9c4[_0xe8bf('0x1a')]=qs['offset'](_0x1060c8[_0xe8bf('0x2f')][_0xe8bf('0x1a')]);}_0x26a9c4['order']=qs['sort'](_0x1060c8[_0xe8bf('0x2f')]['sort']);_0x26a9c4[_0xe8bf('0x37')]=qs[_0xe8bf('0x31')](_[_0xe8bf('0x38')](_0x1060c8[_0xe8bf('0x2f')],_0x354d24['filters']),_0x35f60f);if(_0x1060c8['query'][_0xe8bf('0x39')]){_0x26a9c4[_0xe8bf('0x37')]=_['merge'](_0x26a9c4[_0xe8bf('0x37')],{'$or':_[_0xe8bf('0x2a')](_0x35f60f,function(_0x425547){if(_0x425547['type']!==_0xe8bf('0x3a')){var _0x957081={};_0x957081[_0x425547[_0xe8bf('0x28')]]={'$like':'%'+_0x1060c8[_0xe8bf('0x2f')]['filter']+'%'};return _0x957081;}})});}_0x26a9c4=_[_0xe8bf('0x3b')]({},_0x26a9c4,_0x1060c8[_0xe8bf('0x3c')]);var _0x28a7b1={'where':_0x26a9c4[_0xe8bf('0x37')]};return db[_0xe8bf('0x2b')][_0xe8bf('0x1d')](_0x28a7b1)[_0xe8bf('0x24')](function(_0x501ae6){_0x16d185[_0xe8bf('0x1d')]=_0x501ae6;if(_0x1060c8['query'][_0xe8bf('0x3d')]){_0x26a9c4[_0xe8bf('0x3e')]=[{'all':!![]}];}return db[_0xe8bf('0x2b')][_0xe8bf('0x3f')](_0x26a9c4);})[_0xe8bf('0x24')](function(_0x494e11){_0x16d185[_0xe8bf('0x40')]=_0x494e11;return _0x16d185;})[_0xe8bf('0x24')](respondWithFilteredResult(_0x6e72df,_0x26a9c4))[_0xe8bf('0x41')](handleError(_0x6e72df,null));};exports['show']=function(_0xbafba7,_0x1cebcc){var _0xe91e70={'raw':!![],'where':{'id':_0xbafba7[_0xe8bf('0x42')]['id']}},_0x35e5a5={};_0x35e5a5[_0xe8bf('0x2e')]=_[_0xe8bf('0x30')](db[_0xe8bf('0x2b')][_0xe8bf('0x2c')]);_0x35e5a5[_0xe8bf('0x2f')]=_[_0xe8bf('0x30')](_0xbafba7[_0xe8bf('0x2f')]);_0x35e5a5[_0xe8bf('0x31')]=_[_0xe8bf('0x32')](_0x35e5a5[_0xe8bf('0x2e')],_0x35e5a5[_0xe8bf('0x2f')]);_0xe91e70[_0xe8bf('0x33')]=_[_0xe8bf('0x32')](_0x35e5a5[_0xe8bf('0x2e')],qs[_0xe8bf('0x34')](_0xbafba7[_0xe8bf('0x2f')][_0xe8bf('0x34')]));_0xe91e70[_0xe8bf('0x33')]=_0xe91e70[_0xe8bf('0x33')]['length']?_0xe91e70['attributes']:_0x35e5a5['model'];if(_0xbafba7[_0xe8bf('0x2f')]['includeAll']){_0xe91e70[_0xe8bf('0x3e')]=[{'all':!![]}];}_0xe91e70=_[_0xe8bf('0x3b')]({},_0xe91e70,_0xbafba7[_0xe8bf('0x3c')]);return db[_0xe8bf('0x2b')][_0xe8bf('0x43')](_0xe91e70)[_0xe8bf('0x24')](handleEntityNotFound(_0x1cebcc,null))[_0xe8bf('0x24')](respondWithResult(_0x1cebcc,null))[_0xe8bf('0x41')](handleError(_0x1cebcc,null));};exports['create']=function(_0x2856f7,_0x24658f){return db['ZohoField'][_0xe8bf('0x44')](_0x2856f7[_0xe8bf('0x45')],{})[_0xe8bf('0x24')](respondWithResult(_0x24658f,0xc9))[_0xe8bf('0x41')](handleError(_0x24658f,null));};exports['update']=function(_0x17464d,_0x1f5267){if(_0x17464d[_0xe8bf('0x45')]['id']){delete _0x17464d[_0xe8bf('0x45')]['id'];}return db['ZohoField'][_0xe8bf('0x43')]({'where':{'id':_0x17464d[_0xe8bf('0x42')]['id']}})[_0xe8bf('0x24')](handleEntityNotFound(_0x1f5267,null))['then'](saveUpdates(_0x17464d[_0xe8bf('0x45')],null))[_0xe8bf('0x24')](respondWithResult(_0x1f5267,null))[_0xe8bf('0x41')](handleError(_0x1f5267,null));};exports[_0xe8bf('0x25')]=function(_0x12a827,_0x441931){return db['ZohoField'][_0xe8bf('0x43')]({'where':{'id':_0x12a827[_0xe8bf('0x42')]['id']}})['then'](handleEntityNotFound(_0x441931,null))[_0xe8bf('0x24')](removeEntity(_0x441931,null))['catch'](handleError(_0x441931,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 0cde933..f93d495 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 _0x5464=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash'];(function(_0x3c53e8,_0xc34735){var _0xc97bcf=function(_0x41af8c){while(--_0x41af8c){_0x3c53e8['push'](_0x3c53e8['shift']());}};_0xc97bcf(++_0xc34735);}(_0x5464,0x15d));var _0x4546=function(_0x412cf8,_0x11c0b7){_0x412cf8=_0x412cf8-0x0;var _0x3fe98d=_0x5464[_0x412cf8];return _0x3fe98d;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var logger=require(_0x4546('0x2'))('api');var moment=require(_0x4546('0x3'));var BPromise=require('bluebird');var rp=require(_0x4546('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4546('0x5'));var config=require(_0x4546('0x6'));var attributes=require(_0x4546('0x7'));module[_0x4546('0x8')]=function(_0x54228a,_0x57391f){return _0x54228a['define'](_0x4546('0x9'),attributes,{'tableName':_0x4546('0xa'),'paranoid':![],'indexes':[{'name':_0x4546('0xb'),'fields':[_0x4546('0xc'),_0x4546('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4325=['../../config/environment','./intZohoField.attributes','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','rimraf'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x4325,0x1da));var _0x5432=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4325[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var logger=require('../../config/logger')(_0x5432('0x2'));var moment=require(_0x5432('0x3'));var BPromise=require(_0x5432('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5432('0x5'));var config=require(_0x5432('0x6'));var attributes=require(_0x5432('0x7'));module['exports']=function(_0x209e2e,_0xbb0075){return _0x209e2e['define'](_0x5432('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x5432('0x9'),'fields':[_0x5432('0xa'),_0x5432('0xb')],'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 f3cba87..ae8da94 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 _0xa29b=['request','then','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xa29b,0xf1));var _0xba29=function(_0x4a94d0,_0x374e5d){_0x4a94d0=_0x4a94d0-0x0;var _0x50128a=_0xa29b[_0x4a94d0];return _0x50128a;};'use strict';var _=require(_0xba29('0x0'));var util=require(_0xba29('0x1'));var moment=require(_0xba29('0x2'));var BPromise=require('bluebird');var rs=require(_0xba29('0x3'));var fs=require('fs');var Redis=require(_0xba29('0x4'));var db=require(_0xba29('0x5'))['db'];var utils=require(_0xba29('0x6'));var logger=require(_0xba29('0x7'))('rpc');var config=require(_0xba29('0x8'));var jayson=require(_0xba29('0x9'));var client=jayson[_0xba29('0xa')][_0xba29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1acf6e,_0x315c2b,_0x106c12){return new BPromise(function(_0x46f605,_0x1a321b){return client[_0xba29('0xc')](_0x1acf6e,_0x106c12)[_0xba29('0xd')](function(_0x4f9803){logger['info']('ZohoField,\x20%s,\x20%s',_0x315c2b,_0xba29('0xe'));logger[_0xba29('0xf')](_0xba29('0x10'),_0x315c2b,_0xba29('0xe'),JSON[_0xba29('0x11')](_0x4f9803));if(_0x4f9803[_0xba29('0x12')]){if(_0x4f9803['error'][_0xba29('0x13')]===0x1f4){logger[_0xba29('0x12')](_0xba29('0x14'),_0x315c2b,_0x4f9803[_0xba29('0x12')]['message']);return _0x1a321b(_0x4f9803[_0xba29('0x12')][_0xba29('0x15')]);}logger[_0xba29('0x12')](_0xba29('0x14'),_0x315c2b,_0x4f9803[_0xba29('0x12')]['message']);return _0x46f605(_0x4f9803[_0xba29('0x12')]['message']);}else{logger['info'](_0xba29('0x14'),_0x315c2b,_0xba29('0xe'));_0x46f605(_0x4f9803['result'][_0xba29('0x15')]);}})[_0xba29('0x16')](function(_0x46d067){logger[_0xba29('0x12')](_0xba29('0x14'),_0x315c2b,_0x46d067);_0x1a321b(_0x46d067);});});} \ No newline at end of file +var _0xddfc=['code','message','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error'];(function(_0x9d9343,_0x494c83){var _0x2abcd2=function(_0x101a63){while(--_0x101a63){_0x9d9343['push'](_0x9d9343['shift']());}};_0x2abcd2(++_0x494c83);}(_0xddfc,0xcb));var _0xcddf=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xddfc[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0xcddf('0x0'));var util=require('util');var moment=require(_0xcddf('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcddf('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xcddf('0x3'));var logger=require(_0xcddf('0x4'))(_0xcddf('0x5'));var config=require(_0xcddf('0x6'));var jayson=require(_0xcddf('0x7'));var client=jayson['client'][_0xcddf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44dc29,_0x1279f1,_0x2d95ee){return new BPromise(function(_0x426ec2,_0x513c17){return client[_0xcddf('0x9')](_0x44dc29,_0x2d95ee)[_0xcddf('0xa')](function(_0x3aff0b){logger[_0xcddf('0xb')](_0xcddf('0xc'),_0x1279f1,_0xcddf('0xd'));logger[_0xcddf('0xe')](_0xcddf('0xf'),_0x1279f1,_0xcddf('0xd'),JSON['stringify'](_0x3aff0b));if(_0x3aff0b[_0xcddf('0x10')]){if(_0x3aff0b[_0xcddf('0x10')][_0xcddf('0x11')]===0x1f4){logger[_0xcddf('0x10')](_0xcddf('0xc'),_0x1279f1,_0x3aff0b[_0xcddf('0x10')][_0xcddf('0x12')]);return _0x513c17(_0x3aff0b[_0xcddf('0x10')]['message']);}logger[_0xcddf('0x10')](_0xcddf('0xc'),_0x1279f1,_0x3aff0b[_0xcddf('0x10')][_0xcddf('0x12')]);return _0x426ec2(_0x3aff0b[_0xcddf('0x10')][_0xcddf('0x12')]);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x1279f1,_0xcddf('0xd'));_0x426ec2(_0x3aff0b['result'][_0xcddf('0x12')]);}})[_0xcddf('0x13')](function(_0x17d6a0){logger[_0xcddf('0x10')](_0xcddf('0xc'),_0x1279f1,_0x17d6a0);_0x513c17(_0x17d6a0);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 5c88c8a..8f1385f 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2d34c4,_0x555a22){var _0x47b104=function(_0x96a32c){while(--_0x96a32c){_0x2d34c4['push'](_0x2d34c4['shift']());}};_0x47b104(++_0x555a22);}(_0x70e0,0x17b));var _0x070e=function(_0x270dad,_0xb3b80f){_0x270dad=_0x270dad-0x0;var _0x595296=_0x70e0[_0x270dad];return _0x595296;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x438e18,_0x19448f){var _0xb7fb10=function(_0x365a33){while(--_0x365a33){_0x438e18['push'](_0x438e18['shift']());}};_0xb7fb10(++_0x19448f);}(_0x70e0,0x17b));var _0x070e=function(_0x225015,_0x5ac69d){_0x225015=_0x225015-0x0;var _0x5208ec=_0x70e0[_0x225015];return _0x5208ec;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index a153036..5fc6bd7 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 _0xc120=['unique_name_and_version','app.js','INTEGER','state','sequelize','exports','STRING'];(function(_0x304e0e,_0x2654a3){var _0x4449c8=function(_0x5a9242){while(--_0x5a9242){_0x304e0e['push'](_0x304e0e['shift']());}};_0x4449c8(++_0x2654a3);}(_0xc120,0xf2));var _0x0c12=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xc120[_0x424a9a];return _0xa7831c;};'use strict';var Sequelize=require(_0x0c12('0x0'));module[_0x0c12('0x1')]={'name':{'type':Sequelize[_0x0c12('0x2')],'allowNull':![],'unique':_0x0c12('0x3')},'version':{'type':Sequelize[_0x0c12('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0x0c12('0x4')},'filename':{'type':Sequelize[_0x0c12('0x2')]},'path':{'type':Sequelize[_0x0c12('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x0c12('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x0c12('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x0c12('0x2')],'unique':_0x0c12('0x6')},'description':{'type':Sequelize[_0x0c12('0x2')]},'title':{'type':Sequelize[_0x0c12('0x2')]},'remoteUri':{'type':Sequelize[_0x0c12('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0xf966=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x2f8d4f,_0x5a05ac){var _0x1d7d97=function(_0x3229c1){while(--_0x3229c1){_0x2f8d4f['push'](_0x2f8d4f['shift']());}};_0x1d7d97(++_0x5a05ac);}(_0xf966,0x13b));var _0x6f96=function(_0x549670,_0x56ab69){_0x549670=_0x549670-0x0;var _0x332e54=_0xf966[_0x549670];return _0x332e54;};'use strict';var Sequelize=require(_0x6f96('0x0'));module[_0x6f96('0x1')]={'name':{'type':Sequelize[_0x6f96('0x2')],'allowNull':![],'unique':_0x6f96('0x3')},'version':{'type':Sequelize[_0x6f96('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0x6f96('0x4')},'filename':{'type':Sequelize[_0x6f96('0x2')]},'path':{'type':Sequelize[_0x6f96('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x6f96('0x5')]},'active':{'type':Sequelize[_0x6f96('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x6f96('0x2')]},'logo':{'type':Sequelize[_0x6f96('0x2')]},'state':{'type':Sequelize[_0x6f96('0x2')],'unique':_0x6f96('0x7')},'description':{'type':Sequelize[_0x6f96('0x2')]},'title':{'type':Sequelize[_0x6f96('0x2')]},'remoteUri':{'type':Sequelize[_0x6f96('0x2')]},'link':{'type':Sequelize[_0x6f96('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 a00f624..e6db8d1 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 _0x90b1=['map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','Integration','includeAll','rows','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index'];(function(_0x5da2ed,_0x1d31e2){var _0x22e347=function(_0x5120ca){while(--_0x5120ca){_0x5da2ed['push'](_0x5da2ed['shift']());}};_0x22e347(++_0x1d31e2);}(_0x90b1,0x1bb));var _0x190b=function(_0x4a5cce,_0x34265f){_0x4a5cce=_0x4a5cce-0x0;var _0x347252=_0x90b1[_0x4a5cce];return _0x347252;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['Integration'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['Integration']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['create']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['create'](_0x1f2262[_0x190b('0x43')],{})[_0x190b('0x22')](respondWithResult(_0xadc789,0xc9))[_0x190b('0x42')](handleError(_0xadc789,null));};exports['update']=function(_0x4cb561,_0x14958e){if(_0x4cb561[_0x190b('0x43')]['id']){delete _0x4cb561[_0x190b('0x43')]['id'];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'id':_0x4cb561[_0x190b('0x44')]['id']}})['then'](handleEntityNotFound(_0x14958e,null))[_0x190b('0x22')](saveUpdates(_0x4cb561[_0x190b('0x43')],null))[_0x190b('0x22')](respondWithResult(_0x14958e,null))['catch'](handleError(_0x14958e,null));};exports[_0x190b('0x23')]=function(_0x38c135,_0x215ab6){return db['Integration'][_0x190b('0x41')]({'where':{'id':_0x38c135[_0x190b('0x44')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x215ab6,null))[_0x190b('0x22')](removeEntity(_0x215ab6,null))[_0x190b('0x42')](handleError(_0x215ab6,null));}; \ No newline at end of file +var _0xfcf0=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','model','map','keys','query','filters'];(function(_0x5234c5,_0x48e0d5){var _0x17a6ba=function(_0x366481){while(--_0x366481){_0x5234c5['push'](_0x5234c5['shift']());}};_0x17a6ba(++_0x48e0d5);}(_0xfcf0,0x138));var _0x0fcf=function(_0xabbd2f,_0x44d05a){_0xabbd2f=_0xabbd2f-0x0;var _0x34a040=_0xfcf0[_0xabbd2f];return _0x34a040;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')](_0x1fb83d[_0x0fcf('0x47')],{})['then'](respondWithResult(_0x345188,0xc9))['catch'](handleError(_0x345188,null));};exports[_0x0fcf('0x23')]=function(_0x243699,_0x28d2f4){if(_0x243699[_0x0fcf('0x47')]['id']){delete _0x243699[_0x0fcf('0x47')]['id'];}return db[_0x0fcf('0x2b')]['find']({'where':{'id':_0x243699[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x28d2f4,null))['then'](saveUpdates(_0x243699[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x28d2f4,null))[_0x0fcf('0x42')](handleError(_0x28d2f4,null));};exports[_0x0fcf('0x25')]=function(_0x5435c0,_0xc514bf){return db[_0x0fcf('0x2b')][_0x0fcf('0x48')]({'where':{'id':_0x5435c0[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0xc514bf,null))[_0x0fcf('0x24')](removeEntity(_0xc514bf,null))[_0x0fcf('0x42')](handleError(_0xc514bf,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index eb960cd..8836576 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 _0x9504=['api','moment','bluebird','path','rimraf','./integration.attributes','exports','define','Integration','integrations','util','../../config/logger'];(function(_0xe6a9e,_0x3324e6){var _0x1b3f53=function(_0x49321d){while(--_0x49321d){_0xe6a9e['push'](_0xe6a9e['shift']());}};_0x1b3f53(++_0x3324e6);}(_0x9504,0x17e));var _0x4950=function(_0x54fb18,_0x5bf98a){_0x54fb18=_0x54fb18-0x0;var _0x36ef5c=_0x9504[_0x54fb18];return _0x36ef5c;};'use strict';var _=require('lodash');var util=require(_0x4950('0x0'));var logger=require(_0x4950('0x1'))(_0x4950('0x2'));var moment=require(_0x4950('0x3'));var BPromise=require(_0x4950('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4950('0x5'));var rimraf=require(_0x4950('0x6'));var config=require('../../config/environment');var attributes=require(_0x4950('0x7'));module[_0x4950('0x8')]=function(_0x3bbf76,_0x3ec664){return _0x3bbf76[_0x4950('0x9')](_0x4950('0xa'),attributes,{'tableName':_0x4950('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cc9=['lodash','api','moment','bluebird','path','../../config/environment','./integration.attributes','define','Integration','integrations'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x5cc9,0x190));var _0x95cc=function(_0xc8311d,_0x51b3af){_0xc8311d=_0xc8311d-0x0;var _0x1086c8=_0x5cc9[_0xc8311d];return _0x1086c8;};'use strict';var _=require(_0x95cc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x95cc('0x1'));var moment=require(_0x95cc('0x2'));var BPromise=require(_0x95cc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x95cc('0x4'));var rimraf=require('rimraf');var config=require(_0x95cc('0x5'));var attributes=require(_0x95cc('0x6'));module['exports']=function(_0x1d0bcc,_0x10deb1){return _0x1d0bcc[_0x95cc('0x7')](_0x95cc('0x8'),attributes,{'tableName':_0x95cc('0x9'),'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 d10901f..90de6c4 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x41367f,_0x45202b){var _0x59f926=function(_0x274b65){while(--_0x274b65){_0x41367f['push'](_0x41367f['shift']());}};_0x59f926(++_0x45202b);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x15aeef,_0x2c9021){_0x15aeef=_0x15aeef-0x0;var _0x1c8837=_0xc6ac[_0x15aeef];return _0x1c8837;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file +var _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3b9e63,_0x290295){var _0x17362b=function(_0x233945){while(--_0x233945){_0x3b9e63['push'](_0x3b9e63['shift']());}};_0x17362b(++_0x290295);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x12eaaa,_0x5bb777){_0x12eaaa=_0x12eaaa-0x0;var _0x5c95d3=_0xc6ac[_0x12eaaa];return _0x5c95d3;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 66e3b48..9835ebe 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 _0x896e=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x896e,0x1e9));var _0xe896=function(_0x355503,_0x3813eb){_0x355503=_0x355503-0x0;var _0x265248=_0x896e[_0x355503];return _0x265248;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var fs_extra=require(_0xe896('0x6'));var auth=require(_0xe896('0x7'));var interaction=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var controller=require(_0xe896('0xa'));router[_0xe896('0xb')]('/',auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0xb')](_0xe896('0xd'),auth[_0xe896('0xe')](),controller[_0xe896('0xf')]);router['get'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x11')]);router['post']('/',auth[_0xe896('0xe')](),controller['create']);router[_0xe896('0x12')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x13')]);router[_0xe896('0x14')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x15')]);module[_0xe896('0x16')]=router; \ No newline at end of file +var _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x1b43f4,_0x42f963){var _0x53996b=function(_0x55314b){while(--_0x55314b){_0x1b43f4['push'](_0x1b43f4['shift']());}};_0x53996b(++_0x42f963);}(_0x2542,0x169));var _0x2254=function(_0x2b78d8,_0x2e61b9){_0x2b78d8=_0x2b78d8-0x0;var _0x177718=_0x2542[_0x2b78d8];return _0x177718;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 2000255..041e048 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 _0x7a3f=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x7a3f,0x96));var _0xf7a3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a3f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf7a3('0x0'));module[_0xf7a3('0x1')]={'integration':{'type':Sequelize[_0xf7a3('0x2')]},'eventChannel':{'type':Sequelize[_0xf7a3('0x2')]},'exitStatus':{'type':Sequelize[_0xf7a3('0x2')]},'ticketId':{'type':Sequelize[_0xf7a3('0x2')]},'integrationId':{'type':Sequelize[_0xf7a3('0x3')]},'contacts':{'type':Sequelize[_0xf7a3('0x2')]},'uniqueid':{'type':Sequelize[_0xf7a3('0x2')]},'calleridnum':{'type':Sequelize[_0xf7a3('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xf7a3('0x2')]},'interface':{'type':Sequelize[_0xf7a3('0x2')]},'membername':{'type':Sequelize[_0xf7a3('0x2')]},'agentcalledAt':{'type':Sequelize[_0xf7a3('0x4')]},'agentconnectAt':{'type':Sequelize[_0xf7a3('0x4')]},'holdtime':{'type':Sequelize[_0xf7a3('0x3')]},'agentcomplete':{'type':Sequelize[_0xf7a3('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf7a3('0x4')]},'talktime':{'type':Sequelize[_0xf7a3('0x3')]},'agentacw':{'type':Sequelize[_0xf7a3('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf7a3('0x3')]},'reason':{'type':Sequelize[_0xf7a3('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xf7a3('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf7a3('0x4')]},'agentdump':{'type':Sequelize[_0xf7a3('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf7a3('0x4')]},'lastevent':{'type':Sequelize[_0xf7a3('0x2')]},'channel':{'type':Sequelize[_0xf7a3('0x2')]},'channelstate':{'type':Sequelize[_0xf7a3('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf7a3('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf7a3('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf7a3('0x2')]},'accountcode':{'type':Sequelize[_0xf7a3('0x2')]},'context':{'type':Sequelize[_0xf7a3('0x2')]},'exten':{'type':Sequelize[_0xf7a3('0x2')]},'priority':{'type':Sequelize[_0xf7a3('0x2')]},'destchannel':{'type':Sequelize[_0xf7a3('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xf7a3('0x2')]},'destcalleridnum':{'type':Sequelize[_0xf7a3('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xf7a3('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xf7a3('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xf7a3('0x2')]},'destcontext':{'type':Sequelize[_0xf7a3('0x2')]},'destexten':{'type':Sequelize[_0xf7a3('0x2')]},'destpriority':{'type':Sequelize[_0xf7a3('0x2')]},'destuniqueid':{'type':Sequelize[_0xf7a3('0x2')]},'messageId':{'type':Sequelize[_0xf7a3('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xf7a3('0x2')]},'from':{'type':Sequelize[_0xf7a3('0x2')]},'to':{'type':Sequelize[_0xf7a3('0x2')]},'cc':{'type':Sequelize[_0xf7a3('0x2')]},'attachment':{'type':Sequelize[_0xf7a3('0x6')]},'html':{'type':Sequelize[_0xf7a3('0x6')]},'text':{'type':Sequelize[_0xf7a3('0x6')]},'status':{'type':Sequelize['ENUM'](_0xf7a3('0x7'),_0xf7a3('0x8'),_0xf7a3('0x9'),'FAILED')},'url':{'type':Sequelize[_0xf7a3('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xf7a3('0x2')]},'projectId':{'type':Sequelize[_0xf7a3('0x3')]}}; \ No newline at end of file +var _0x43b0=['SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x110267,_0x49c808){var _0x3e54a1=function(_0xca2c3c){while(--_0xca2c3c){_0x110267['push'](_0x110267['shift']());}};_0x3e54a1(++_0x49c808);}(_0x43b0,0x123));var _0x043b=function(_0x17029c,_0x5ac28e){_0x17029c=_0x17029c-0x0;var _0x57b8b8=_0x43b0[_0x17029c];return _0x57b8b8;};'use strict';var Sequelize=require(_0x043b('0x0'));module[_0x043b('0x1')]={'integration':{'type':Sequelize[_0x043b('0x2')]},'eventChannel':{'type':Sequelize[_0x043b('0x2')]},'exitStatus':{'type':Sequelize[_0x043b('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x043b('0x3')]},'contacts':{'type':Sequelize[_0x043b('0x2')]},'uniqueid':{'type':Sequelize[_0x043b('0x2')]},'calleridnum':{'type':Sequelize[_0x043b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x043b('0x2')]},'membername':{'type':Sequelize[_0x043b('0x2')]},'agentcalledAt':{'type':Sequelize[_0x043b('0x4')]},'agentconnectAt':{'type':Sequelize[_0x043b('0x4')]},'holdtime':{'type':Sequelize[_0x043b('0x3')]},'agentcomplete':{'type':Sequelize[_0x043b('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x043b('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x043b('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x043b('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x043b('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x043b('0x2')]},'channelstate':{'type':Sequelize[_0x043b('0x3')]},'channelstatedesc':{'type':Sequelize[_0x043b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x043b('0x2')]},'language':{'type':Sequelize[_0x043b('0x2')]},'accountcode':{'type':Sequelize[_0x043b('0x2')]},'context':{'type':Sequelize[_0x043b('0x2')]},'exten':{'type':Sequelize[_0x043b('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x043b('0x2')]},'destchannelstate':{'type':Sequelize[_0x043b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x043b('0x2')]},'destcalleridnum':{'type':Sequelize[_0x043b('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x043b('0x2')]},'destlanguage':{'type':Sequelize[_0x043b('0x2')]},'destaccountcode':{'type':Sequelize[_0x043b('0x2')]},'destcontext':{'type':Sequelize[_0x043b('0x2')]},'destexten':{'type':Sequelize[_0x043b('0x2')]},'destpriority':{'type':Sequelize[_0x043b('0x2')]},'destuniqueid':{'type':Sequelize[_0x043b('0x2')]},'messageId':{'type':Sequelize[_0x043b('0x2')]},'inReplyTo':{'type':Sequelize[_0x043b('0x2')]},'subject':{'type':Sequelize[_0x043b('0x2')]},'from':{'type':Sequelize[_0x043b('0x2')]},'to':{'type':Sequelize[_0x043b('0x2')]},'cc':{'type':Sequelize[_0x043b('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x043b('0x6')]},'status':{'type':Sequelize[_0x043b('0x7')](_0x043b('0x8'),_0x043b('0x9'),_0x043b('0xa'),_0x043b('0xb'))},'url':{'type':Sequelize[_0x043b('0x2')]},'app':{'type':Sequelize[_0x043b('0x2')]},'appdata':{'type':Sequelize[_0x043b('0x2')]},'projectId':{'type':Sequelize[_0x043b('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index dac8899..10bac1f 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 _0x66f1=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','name','index','IntegrationReport','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','nolimit','order','sort','filters','where','merge','type','options','include','findAll','rows','catch','show','length','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x390e2b,_0x59a210){var _0x4c509d=function(_0x23ed14){while(--_0x23ed14){_0x390e2b['push'](_0x390e2b['shift']());}};_0x4c509d(++_0x59a210);}(_0x66f1,0x15e));var _0x166f=function(_0x1707ba,_0x516a16){_0x1707ba=_0x1707ba-0x0;var _0x343ed1=_0x66f1[_0x1707ba];return _0x343ed1;};'use strict';var emlformat=require(_0x166f('0x0'));var rimraf=require(_0x166f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x166f('0x2'));var rp=require(_0x166f('0x3'));var moment=require(_0x166f('0x4'));var BPromise=require(_0x166f('0x5'));var Mustache=require(_0x166f('0x6'));var util=require('util');var path=require(_0x166f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x166f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x166f('0x9'));var squel=require(_0x166f('0xa'));var crypto=require(_0x166f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x166f('0xc'));var toCsv=require(_0x166f('0xd'));var querystring=require(_0x166f('0xe'));var Papa=require(_0x166f('0xf'));var Redis=require('ioredis');var authService=require(_0x166f('0x10'));var qs=require(_0x166f('0x11'));var as=require(_0x166f('0x12'));var hardwareService=require(_0x166f('0x13'));var logger=require(_0x166f('0x14'))(_0x166f('0x15'));var utils=require(_0x166f('0x16'));var config=require(_0x166f('0x17'));var licenseUtil=require(_0x166f('0x18'));var db=require(_0x166f('0x19'))['db'];function respondWithStatusCode(_0x2696db,_0x4fbae0){_0x4fbae0=_0x4fbae0||0xcc;return function(_0x4cd09b){if(_0x4cd09b){return _0x2696db[_0x166f('0x1a')](_0x4fbae0);}return _0x2696db[_0x166f('0x1b')](_0x4fbae0)['end']();};}function respondWithResult(_0x389146,_0x22ac2d){_0x22ac2d=_0x22ac2d||0xc8;return function(_0x56c311){if(_0x56c311){return _0x389146[_0x166f('0x1b')](_0x22ac2d)[_0x166f('0x1c')](_0x56c311);}};}function respondWithFilteredResult(_0x5e1ade,_0xe68c3e){return function(_0x11e22e){if(_0x11e22e){var _0x18a190=typeof _0xe68c3e[_0x166f('0x1d')]===_0x166f('0x1e')&&typeof _0xe68c3e[_0x166f('0x1f')]===_0x166f('0x1e');var _0x489cf8=_0x11e22e[_0x166f('0x20')];var _0x1c9f0d=_0x18a190?0x0:_0xe68c3e[_0x166f('0x1d')];var _0x70da43=_0x18a190?_0x11e22e[_0x166f('0x20')]:_0xe68c3e['offset']+_0xe68c3e['limit'];var _0xda8932;if(_0x70da43>=_0x489cf8){_0x70da43=_0x489cf8;_0xda8932=0xc8;}else{_0xda8932=0xce;}_0x5e1ade[_0x166f('0x1b')](_0xda8932);return _0x5e1ade[_0x166f('0x21')]('Content-Range',_0x1c9f0d+'-'+_0x70da43+'/'+_0x489cf8)[_0x166f('0x1c')](_0x11e22e);}return null;};}function patchUpdates(_0x35e823){return function(_0x144303){try{jsonpatch[_0x166f('0x22')](_0x144303,_0x35e823,!![]);}catch(_0x3d09df){return BPromise[_0x166f('0x23')](_0x3d09df);}return _0x144303[_0x166f('0x24')]();};}function saveUpdates(_0x5fe1bd,_0x5330b6){return function(_0x4f0702){if(_0x4f0702){return _0x4f0702[_0x166f('0x25')](_0x5fe1bd)[_0x166f('0x26')](function(_0x3e145f){return _0x3e145f;});}return null;};}function removeEntity(_0x2cb987,_0x3b7f99){return function(_0x2d3ff9){if(_0x2d3ff9){return _0x2d3ff9[_0x166f('0x27')]()[_0x166f('0x26')](function(){_0x2cb987[_0x166f('0x1b')](0xcc)[_0x166f('0x28')]();});}};}function handleEntityNotFound(_0x3cd6ba,_0xe83170){return function(_0x5abf17){if(!_0x5abf17){_0x3cd6ba[_0x166f('0x1a')](0x194);}return _0x5abf17;};}function handleError(_0x34857b,_0x6ac60d){_0x6ac60d=_0x6ac60d||0x1f4;return function(_0x2040d0){logger[_0x166f('0x29')](_0x2040d0['stack']);if(_0x2040d0[_0x166f('0x2a')]){delete _0x2040d0[_0x166f('0x2a')];}_0x34857b[_0x166f('0x1b')](_0x6ac60d)['send'](_0x2040d0);};}exports[_0x166f('0x2b')]=function(_0xd50d07,_0x472e6d){var _0x855687={},_0x43f8cc={},_0x155315={'count':0x0,'rows':[]};var _0x371110=_['map'](db[_0x166f('0x2c')][_0x166f('0x2d')],function(_0x419a10){return{'name':_0x419a10[_0x166f('0x2e')],'type':_0x419a10['type'][_0x166f('0x2f')]};});_0x43f8cc[_0x166f('0x30')]=_[_0x166f('0x31')](_0x371110,_0x166f('0x2a'));_0x43f8cc[_0x166f('0x32')]=_[_0x166f('0x33')](_0xd50d07[_0x166f('0x32')]);_0x43f8cc['filters']=_['intersection'](_0x43f8cc['model'],_0x43f8cc['query']);_0x855687[_0x166f('0x34')]=_[_0x166f('0x35')](_0x43f8cc[_0x166f('0x30')],qs[_0x166f('0x36')](_0xd50d07['query'][_0x166f('0x36')]));_0x855687[_0x166f('0x34')]=_0x855687['attributes']['length']?_0x855687[_0x166f('0x34')]:_0x43f8cc[_0x166f('0x30')];if(!_0xd50d07[_0x166f('0x32')]['hasOwnProperty'](_0x166f('0x37'))){_0x855687[_0x166f('0x1f')]=qs[_0x166f('0x1f')](_0xd50d07[_0x166f('0x32')][_0x166f('0x1f')]);_0x855687[_0x166f('0x1d')]=qs['offset'](_0xd50d07[_0x166f('0x32')]['offset']);}_0x855687[_0x166f('0x38')]=qs[_0x166f('0x39')](_0xd50d07['query'][_0x166f('0x39')]);_0x855687['where']=qs[_0x166f('0x3a')](_['pick'](_0xd50d07[_0x166f('0x32')],_0x43f8cc[_0x166f('0x3a')]),_0x371110);if(_0xd50d07[_0x166f('0x32')]['filter']){_0x855687[_0x166f('0x3b')]=_[_0x166f('0x3c')](_0x855687[_0x166f('0x3b')],{'$or':_[_0x166f('0x31')](_0x371110,function(_0x249b39){if(_0x249b39[_0x166f('0x3d')]!=='VIRTUAL'){var _0x273261={};_0x273261[_0x249b39[_0x166f('0x2a')]]={'$like':'%'+_0xd50d07[_0x166f('0x32')]['filter']+'%'};return _0x273261;}})});}_0x855687=_[_0x166f('0x3c')]({},_0x855687,_0xd50d07[_0x166f('0x3e')]);var _0x2b6e81={'where':_0x855687['where']};return db[_0x166f('0x2c')][_0x166f('0x20')](_0x2b6e81)[_0x166f('0x26')](function(_0x425ef6){_0x155315[_0x166f('0x20')]=_0x425ef6;if(_0xd50d07[_0x166f('0x32')]['includeAll']){_0x855687[_0x166f('0x3f')]=[{'all':!![]}];}return db['IntegrationReport'][_0x166f('0x40')](_0x855687);})[_0x166f('0x26')](function(_0x2b8ab3){_0x155315[_0x166f('0x41')]=_0x2b8ab3;return _0x155315;})[_0x166f('0x26')](respondWithFilteredResult(_0x472e6d,_0x855687))[_0x166f('0x42')](handleError(_0x472e6d,null));};exports[_0x166f('0x43')]=function(_0x27b758,_0x1e660c){var _0x327561={'raw':![],'where':{'id':_0x27b758['params']['id']}},_0x4fba21={};_0x4fba21['model']=_[_0x166f('0x33')](db[_0x166f('0x2c')][_0x166f('0x2d')]);_0x4fba21['query']=_['keys'](_0x27b758[_0x166f('0x32')]);_0x4fba21['filters']=_['intersection'](_0x4fba21[_0x166f('0x30')],_0x4fba21[_0x166f('0x32')]);_0x327561[_0x166f('0x34')]=_[_0x166f('0x35')](_0x4fba21['model'],qs[_0x166f('0x36')](_0x27b758['query']['fields']));_0x327561['attributes']=_0x327561[_0x166f('0x34')][_0x166f('0x44')]?_0x327561[_0x166f('0x34')]:_0x4fba21[_0x166f('0x30')];if(_0x27b758[_0x166f('0x32')]['includeAll']){_0x327561[_0x166f('0x3f')]=[{'all':!![]}];}_0x327561=_[_0x166f('0x3c')]({},_0x327561,_0x27b758[_0x166f('0x3e')]);return db[_0x166f('0x2c')]['find'](_0x327561)[_0x166f('0x26')](handleEntityNotFound(_0x1e660c,null))[_0x166f('0x26')](respondWithResult(_0x1e660c,null))[_0x166f('0x42')](handleError(_0x1e660c,null));};exports[_0x166f('0x45')]=function(_0x3efd18,_0xb0c5a3){return db[_0x166f('0x2c')][_0x166f('0x45')](_0x3efd18[_0x166f('0x46')],{})[_0x166f('0x26')](respondWithResult(_0xb0c5a3,0xc9))[_0x166f('0x42')](handleError(_0xb0c5a3,null));};exports['update']=function(_0x48d5c3,_0x178125){if(_0x48d5c3['body']['id']){delete _0x48d5c3[_0x166f('0x46')]['id'];}return db[_0x166f('0x2c')][_0x166f('0x47')]({'where':{'id':_0x48d5c3[_0x166f('0x48')]['id']}})[_0x166f('0x26')](handleEntityNotFound(_0x178125,null))[_0x166f('0x26')](saveUpdates(_0x48d5c3[_0x166f('0x46')],null))[_0x166f('0x26')](respondWithResult(_0x178125,null))[_0x166f('0x42')](handleError(_0x178125,null));};exports[_0x166f('0x27')]=function(_0x59ed4a,_0x138352){return db['IntegrationReport'][_0x166f('0x47')]({'where':{'id':_0x59ed4a[_0x166f('0x48')]['id']}})[_0x166f('0x26')](handleEntityNotFound(_0x138352,null))[_0x166f('0x26')](removeEntity(_0x138352,null))[_0x166f('0x42')](handleError(_0x138352,null));};exports[_0x166f('0x49')]=function(_0x1e6d00,_0x211cfb){return db[_0x166f('0x2c')][_0x166f('0x49')]()['then'](respondWithResult(_0x211cfb,null))['catch'](handleError(_0x211cfb,null));}; \ No newline at end of file +var _0x12da=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','IntegrationReport','includeAll','include','findAll','rows','catch','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5838e2,_0x12b08b){var _0x501bc7=function(_0x157a70){while(--_0x157a70){_0x5838e2['push'](_0x5838e2['shift']());}};_0x501bc7(++_0x12b08b);}(_0x12da,0xd4));var _0xa12d=function(_0x17ad1c,_0x124722){_0x17ad1c=_0x17ad1c-0x0;var _0x310b59=_0x12da[_0x17ad1c];return _0x310b59;};'use strict';var emlformat=require(_0xa12d('0x0'));var rimraf=require(_0xa12d('0x1'));var zipdir=require(_0xa12d('0x2'));var jsonpatch=require(_0xa12d('0x3'));var rp=require(_0xa12d('0x4'));var moment=require(_0xa12d('0x5'));var BPromise=require(_0xa12d('0x6'));var Mustache=require(_0xa12d('0x7'));var util=require(_0xa12d('0x8'));var path=require(_0xa12d('0x9'));var sox=require(_0xa12d('0xa'));var csv=require(_0xa12d('0xb'));var ejs=require(_0xa12d('0xc'));var fs=require('fs');var fs_extra=require(_0xa12d('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa12d('0xe'));var jsforce=require(_0xa12d('0xf'));var deskjs=require(_0xa12d('0x10'));var toCsv=require(_0xa12d('0xb'));var querystring=require('querystring');var Papa=require(_0xa12d('0x11'));var Redis=require('ioredis');var authService=require(_0xa12d('0x12'));var qs=require(_0xa12d('0x13'));var as=require(_0xa12d('0x14'));var hardwareService=require(_0xa12d('0x15'));var logger=require(_0xa12d('0x16'))(_0xa12d('0x17'));var utils=require(_0xa12d('0x18'));var config=require(_0xa12d('0x19'));var licenseUtil=require(_0xa12d('0x1a'));var db=require(_0xa12d('0x1b'))['db'];function respondWithStatusCode(_0x42bee4,_0x41af34){_0x41af34=_0x41af34||0xcc;return function(_0x3764f1){if(_0x3764f1){return _0x42bee4[_0xa12d('0x1c')](_0x41af34);}return _0x42bee4[_0xa12d('0x1d')](_0x41af34)[_0xa12d('0x1e')]();};}function respondWithResult(_0x3b6736,_0x513bbc){_0x513bbc=_0x513bbc||0xc8;return function(_0x3a2412){if(_0x3a2412){return _0x3b6736[_0xa12d('0x1d')](_0x513bbc)[_0xa12d('0x1f')](_0x3a2412);}};}function respondWithFilteredResult(_0x3210d7,_0x1d1164){return function(_0x5c763b){if(_0x5c763b){var _0x1db6b5=typeof _0x1d1164[_0xa12d('0x20')]===_0xa12d('0x21')&&typeof _0x1d1164[_0xa12d('0x22')]==='undefined';var _0x31e0cf=_0x5c763b[_0xa12d('0x23')];var _0x241a97=_0x1db6b5?0x0:_0x1d1164[_0xa12d('0x20')];var _0x48c174=_0x1db6b5?_0x5c763b['count']:_0x1d1164[_0xa12d('0x20')]+_0x1d1164[_0xa12d('0x22')];var _0x2ae40a;if(_0x48c174>=_0x31e0cf){_0x48c174=_0x31e0cf;_0x2ae40a=0xc8;}else{_0x2ae40a=0xce;}_0x3210d7[_0xa12d('0x1d')](_0x2ae40a);return _0x3210d7[_0xa12d('0x24')](_0xa12d('0x25'),_0x241a97+'-'+_0x48c174+'/'+_0x31e0cf)['json'](_0x5c763b);}return null;};}function patchUpdates(_0x1ba7d4){return function(_0x76d4dc){try{jsonpatch[_0xa12d('0x26')](_0x76d4dc,_0x1ba7d4,!![]);}catch(_0x5bc6a0){return BPromise[_0xa12d('0x27')](_0x5bc6a0);}return _0x76d4dc[_0xa12d('0x28')]();};}function saveUpdates(_0x4bdd25,_0x32337e){return function(_0x26cd0f){if(_0x26cd0f){return _0x26cd0f['update'](_0x4bdd25)[_0xa12d('0x29')](function(_0x57ec1c){return _0x57ec1c;});}return null;};}function removeEntity(_0x96943d,_0x5d6a65){return function(_0x126974){if(_0x126974){return _0x126974[_0xa12d('0x2a')]()[_0xa12d('0x29')](function(){_0x96943d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf32cdf,_0x9b07c){return function(_0xe64234){if(!_0xe64234){_0xf32cdf[_0xa12d('0x1c')](0x194);}return _0xe64234;};}function handleError(_0x580eea,_0x3a5cff){_0x3a5cff=_0x3a5cff||0x1f4;return function(_0x2a4fac){logger[_0xa12d('0x2b')](_0x2a4fac[_0xa12d('0x2c')]);if(_0x2a4fac[_0xa12d('0x2d')]){delete _0x2a4fac[_0xa12d('0x2d')];}_0x580eea[_0xa12d('0x1d')](_0x3a5cff)['send'](_0x2a4fac);};}exports[_0xa12d('0x2e')]=function(_0x26b112,_0x2c5c76){var _0x2afe66={},_0x378039={},_0x16931e={'count':0x0,'rows':[]};var _0x5f0569=_['map'](db['IntegrationReport'][_0xa12d('0x2f')],function(_0x5e13df){return{'name':_0x5e13df[_0xa12d('0x30')],'type':_0x5e13df[_0xa12d('0x31')][_0xa12d('0x32')]};});_0x378039[_0xa12d('0x33')]=_[_0xa12d('0x34')](_0x5f0569,_0xa12d('0x2d'));_0x378039[_0xa12d('0x35')]=_[_0xa12d('0x36')](_0x26b112[_0xa12d('0x35')]);_0x378039[_0xa12d('0x37')]=_[_0xa12d('0x38')](_0x378039[_0xa12d('0x33')],_0x378039[_0xa12d('0x35')]);_0x2afe66[_0xa12d('0x39')]=_[_0xa12d('0x38')](_0x378039[_0xa12d('0x33')],qs[_0xa12d('0x3a')](_0x26b112[_0xa12d('0x35')]['fields']));_0x2afe66[_0xa12d('0x39')]=_0x2afe66[_0xa12d('0x39')][_0xa12d('0x3b')]?_0x2afe66[_0xa12d('0x39')]:_0x378039[_0xa12d('0x33')];if(!_0x26b112[_0xa12d('0x35')][_0xa12d('0x3c')](_0xa12d('0x3d'))){_0x2afe66[_0xa12d('0x22')]=qs[_0xa12d('0x22')](_0x26b112[_0xa12d('0x35')][_0xa12d('0x22')]);_0x2afe66[_0xa12d('0x20')]=qs[_0xa12d('0x20')](_0x26b112[_0xa12d('0x35')]['offset']);}_0x2afe66['order']=qs[_0xa12d('0x3e')](_0x26b112[_0xa12d('0x35')]['sort']);_0x2afe66[_0xa12d('0x3f')]=qs[_0xa12d('0x37')](_[_0xa12d('0x40')](_0x26b112[_0xa12d('0x35')],_0x378039[_0xa12d('0x37')]),_0x5f0569);if(_0x26b112[_0xa12d('0x35')][_0xa12d('0x41')]){_0x2afe66[_0xa12d('0x3f')]=_[_0xa12d('0x42')](_0x2afe66[_0xa12d('0x3f')],{'$or':_[_0xa12d('0x34')](_0x5f0569,function(_0x13bc18){if(_0x13bc18[_0xa12d('0x31')]!==_0xa12d('0x43')){var _0x514e07={};_0x514e07[_0x13bc18[_0xa12d('0x2d')]]={'$like':'%'+_0x26b112[_0xa12d('0x35')][_0xa12d('0x41')]+'%'};return _0x514e07;}})});}_0x2afe66=_[_0xa12d('0x42')]({},_0x2afe66,_0x26b112['options']);var _0x1a764f={'where':_0x2afe66[_0xa12d('0x3f')]};return db[_0xa12d('0x44')][_0xa12d('0x23')](_0x1a764f)['then'](function(_0x391385){_0x16931e['count']=_0x391385;if(_0x26b112[_0xa12d('0x35')][_0xa12d('0x45')]){_0x2afe66[_0xa12d('0x46')]=[{'all':!![]}];}return db[_0xa12d('0x44')][_0xa12d('0x47')](_0x2afe66);})[_0xa12d('0x29')](function(_0x239601){_0x16931e[_0xa12d('0x48')]=_0x239601;return _0x16931e;})[_0xa12d('0x29')](respondWithFilteredResult(_0x2c5c76,_0x2afe66))[_0xa12d('0x49')](handleError(_0x2c5c76,null));};exports['show']=function(_0x12468f,_0x4757a2){var _0x2c1645={'raw':![],'where':{'id':_0x12468f[_0xa12d('0x4a')]['id']}},_0x2f76f0={};_0x2f76f0[_0xa12d('0x33')]=_[_0xa12d('0x36')](db['IntegrationReport'][_0xa12d('0x2f')]);_0x2f76f0[_0xa12d('0x35')]=_[_0xa12d('0x36')](_0x12468f['query']);_0x2f76f0['filters']=_[_0xa12d('0x38')](_0x2f76f0[_0xa12d('0x33')],_0x2f76f0[_0xa12d('0x35')]);_0x2c1645[_0xa12d('0x39')]=_[_0xa12d('0x38')](_0x2f76f0[_0xa12d('0x33')],qs[_0xa12d('0x3a')](_0x12468f[_0xa12d('0x35')]['fields']));_0x2c1645[_0xa12d('0x39')]=_0x2c1645['attributes'][_0xa12d('0x3b')]?_0x2c1645['attributes']:_0x2f76f0[_0xa12d('0x33')];if(_0x12468f[_0xa12d('0x35')][_0xa12d('0x45')]){_0x2c1645['include']=[{'all':!![]}];}_0x2c1645=_[_0xa12d('0x42')]({},_0x2c1645,_0x12468f[_0xa12d('0x4b')]);return db['IntegrationReport']['find'](_0x2c1645)[_0xa12d('0x29')](handleEntityNotFound(_0x4757a2,null))['then'](respondWithResult(_0x4757a2,null))[_0xa12d('0x49')](handleError(_0x4757a2,null));};exports['create']=function(_0x126fda,_0x553193){return db['IntegrationReport'][_0xa12d('0x4c')](_0x126fda[_0xa12d('0x4d')],{})[_0xa12d('0x29')](respondWithResult(_0x553193,0xc9))['catch'](handleError(_0x553193,null));};exports['update']=function(_0x3ccaec,_0x5286fe){if(_0x3ccaec[_0xa12d('0x4d')]['id']){delete _0x3ccaec[_0xa12d('0x4d')]['id'];}return db['IntegrationReport'][_0xa12d('0x4e')]({'where':{'id':_0x3ccaec[_0xa12d('0x4a')]['id']}})[_0xa12d('0x29')](handleEntityNotFound(_0x5286fe,null))[_0xa12d('0x29')](saveUpdates(_0x3ccaec[_0xa12d('0x4d')],null))[_0xa12d('0x29')](respondWithResult(_0x5286fe,null))[_0xa12d('0x49')](handleError(_0x5286fe,null));};exports[_0xa12d('0x2a')]=function(_0x436d5a,_0x436061){return db[_0xa12d('0x44')][_0xa12d('0x4e')]({'where':{'id':_0x436d5a[_0xa12d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x436061,null))[_0xa12d('0x29')](removeEntity(_0x436061,null))[_0xa12d('0x49')](handleError(_0x436061,null));};exports[_0xa12d('0x4f')]=function(_0xeac6d6,_0x2b5b8e){return db['IntegrationReport']['describe']()[_0xa12d('0x29')](respondWithResult(_0x2b5b8e,null))['catch'](handleError(_0x2b5b8e,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 83b75a9..555abea 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 _0x3065=['path','rimraf','../../config/environment','define','IntegrationReport','lodash','util','../../config/logger','moment','request-promise'];(function(_0x51ac2e,_0x3be135){var _0x265986=function(_0x47aa12){while(--_0x47aa12){_0x51ac2e['push'](_0x51ac2e['shift']());}};_0x265986(++_0x3be135);}(_0x3065,0x16d));var _0x5306=function(_0x4baffa,_0x34b912){_0x4baffa=_0x4baffa-0x0;var _0x5574b0=_0x3065[_0x4baffa];return _0x5574b0;};'use strict';var _=require(_0x5306('0x0'));var util=require(_0x5306('0x1'));var logger=require(_0x5306('0x2'))('api');var moment=require(_0x5306('0x3'));var BPromise=require('bluebird');var rp=require(_0x5306('0x4'));var fs=require('fs');var path=require(_0x5306('0x5'));var rimraf=require(_0x5306('0x6'));var config=require(_0x5306('0x7'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x3360b5,_0x366569){return _0x3360b5[_0x5306('0x8')](_0x5306('0x9'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac73=['request-promise','path','rimraf','../../config/environment','exports','define','report_integration','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xac73,0x187));var _0x3ac7=function(_0x587917,_0x5a25ab){_0x587917=_0x587917-0x0;var _0x552b08=_0xac73[_0x587917];return _0x552b08;};'use strict';var _=require(_0x3ac7('0x0'));var util=require('util');var logger=require(_0x3ac7('0x1'))(_0x3ac7('0x2'));var moment=require(_0x3ac7('0x3'));var BPromise=require(_0x3ac7('0x4'));var rp=require(_0x3ac7('0x5'));var fs=require('fs');var path=require(_0x3ac7('0x6'));var rimraf=require(_0x3ac7('0x7'));var config=require(_0x3ac7('0x8'));var attributes=require('./integrationReport.attributes');module[_0x3ac7('0x9')]=function(_0x4eca02,_0x2facae){return _0x4eca02[_0x3ac7('0xa')]('IntegrationReport',attributes,{'tableName':_0x3ac7('0xb'),'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 4975841..67eacad 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 _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x3a961f,_0x2319d4){var _0x3beb6e=function(_0x428f57){while(--_0x428f57){_0x3a961f['push'](_0x3a961f['shift']());}};_0x3beb6e(++_0x2319d4);}(_0x2675,0x75));var _0x5267=function(_0x3cbfe9,_0x522a48){_0x3cbfe9=_0x3cbfe9-0x0;var _0x3777b5=_0x2675[_0x3cbfe9];return _0x3777b5;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file +var _0x2542=['info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x19a966,_0xea6c0e){var _0x128470=function(_0x2296df){while(--_0x2296df){_0x19a966['push'](_0x19a966['shift']());}};_0x128470(++_0xea6c0e);}(_0x2542,0x169));var _0x2254=function(_0x52ae03,_0x221762){_0x52ae03=_0x52ae03-0x0;var _0x461a04=_0x2542[_0x52ae03];return _0x461a04;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 19003df..f311fbe 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 _0x5a93=['get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','update','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x5a93,0xf6));var _0x35a9=function(_0xd19be9,_0x28960a){_0xd19be9=_0xd19be9-0x0;var _0x278a45=_0x5a93[_0xd19be9];return _0x278a45;};'use strict';var multer=require('multer');var util=require(_0x35a9('0x0'));var path=require('path');var timeout=require(_0x35a9('0x1'));var express=require(_0x35a9('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x35a9('0x3'));var interaction=require(_0x35a9('0x4'));var config=require(_0x35a9('0x5'));var controller=require('./interval.controller');router[_0x35a9('0x6')]('/',auth[_0x35a9('0x7')](),controller[_0x35a9('0x8')]);router[_0x35a9('0x6')](_0x35a9('0x9'),auth[_0x35a9('0x7')](),controller[_0x35a9('0xa')]);router[_0x35a9('0x6')](_0x35a9('0xb'),auth[_0x35a9('0x7')](),controller[_0x35a9('0xc')]);router[_0x35a9('0xd')]('/',auth[_0x35a9('0x7')](),controller[_0x35a9('0xe')]);router[_0x35a9('0xd')](_0x35a9('0xb'),auth[_0x35a9('0x7')](),controller['addInterval']);router[_0x35a9('0xd')](_0x35a9('0xf'),auth[_0x35a9('0x7')](),controller[_0x35a9('0x10')]);router['put'](_0x35a9('0x9'),auth[_0x35a9('0x7')](),controller[_0x35a9('0x11')]);router[_0x35a9('0x12')]('/:id',auth[_0x35a9('0x7')](),controller[_0x35a9('0x13')]);module[_0x35a9('0x14')]=router; \ No newline at end of file +var _0x4fd7=['show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated'];(function(_0x1ac299,_0x50e214){var _0x9fcb45=function(_0xd9a229){while(--_0xd9a229){_0x1ac299['push'](_0x1ac299['shift']());}};_0x9fcb45(++_0x50e214);}(_0x4fd7,0xe6));var _0x74fd=function(_0x1f28bd,_0x22f52d){_0x1f28bd=_0x1f28bd-0x0;var _0x409efd=_0x4fd7[_0x1f28bd];return _0x409efd;};'use strict';var multer=require(_0x74fd('0x0'));var util=require(_0x74fd('0x1'));var path=require(_0x74fd('0x2'));var timeout=require(_0x74fd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x74fd('0x4'));var auth=require(_0x74fd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x74fd('0x6'));var controller=require('./interval.controller');router[_0x74fd('0x7')]('/',auth['isAuthenticated'](),controller[_0x74fd('0x8')]);router[_0x74fd('0x7')]('/:id',auth[_0x74fd('0x9')](),controller[_0x74fd('0xa')]);router['get'](_0x74fd('0xb'),auth[_0x74fd('0x9')](),controller[_0x74fd('0xc')]);router[_0x74fd('0xd')]('/',auth[_0x74fd('0x9')](),controller[_0x74fd('0xe')]);router[_0x74fd('0xd')](_0x74fd('0xb'),auth[_0x74fd('0x9')](),controller[_0x74fd('0xf')]);router[_0x74fd('0xd')](_0x74fd('0x10'),auth[_0x74fd('0x9')](),controller[_0x74fd('0x11')]);router[_0x74fd('0x12')](_0x74fd('0x13'),auth['isAuthenticated'](),controller[_0x74fd('0x14')]);router[_0x74fd('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x74fd('0x16')]);module[_0x74fd('0x17')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 1e15e21..38fb1cf 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 _0x070a=['exports','STRING','sequelize'];(function(_0x2ebdcf,_0x3c6698){var _0x450377=function(_0x48ea54){while(--_0x48ea54){_0x2ebdcf['push'](_0x2ebdcf['shift']());}};_0x450377(++_0x3c6698);}(_0x070a,0x170));var _0xa070=function(_0x3e4e60,_0x31dbcb){_0x3e4e60=_0x3e4e60-0x0;var _0x518a7e=_0x070a[_0x3e4e60];return _0x518a7e;};'use strict';var Sequelize=require(_0xa070('0x0'));module[_0xa070('0x1')]={'name':{'type':Sequelize[_0xa070('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa070('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x0e95=['STRING','sequelize','exports'];(function(_0x3ed1df,_0x18d47a){var _0x313d39=function(_0x31b135){while(--_0x31b135){_0x3ed1df['push'](_0x3ed1df['shift']());}};_0x313d39(++_0x18d47a);}(_0x0e95,0x1ae));var _0x50e9=function(_0x103ea4,_0xd57375){_0x103ea4=_0x103ea4-0x0;var _0x180685=_0x0e95[_0x103ea4];return _0x180685;};'use strict';var Sequelize=require(_0x50e9('0x0'));module[_0x50e9('0x1')]={'name':{'type':Sequelize[_0x50e9('0x2')]},'description':{'type':Sequelize[_0x50e9('0x2')]},'interval':{'type':Sequelize[_0x50e9('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 7b3303c..7ce795c 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 _0x3a24=['show','params','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','IntervalId','findOne','getIntervals','hasOwnProperty','sequelize','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','catch'];(function(_0x551701,_0x497713){var _0x1a872e=function(_0x26c717){while(--_0x26c717){_0x551701['push'](_0x551701['shift']());}};_0x1a872e(++_0x497713);}(_0x3a24,0x6a));var _0x43a2=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x3a24[_0x342700];return _0x53406f;};'use strict';var emlformat=require(_0x43a2('0x0'));var rimraf=require(_0x43a2('0x1'));var zipdir=require(_0x43a2('0x2'));var jsonpatch=require(_0x43a2('0x3'));var rp=require(_0x43a2('0x4'));var moment=require('moment');var BPromise=require(_0x43a2('0x5'));var Mustache=require(_0x43a2('0x6'));var util=require('util');var path=require(_0x43a2('0x7'));var sox=require(_0x43a2('0x8'));var csv=require(_0x43a2('0x9'));var ejs=require(_0x43a2('0xa'));var fs=require('fs');var fs_extra=require(_0x43a2('0xb'));var _=require(_0x43a2('0xc'));var squel=require(_0x43a2('0xd'));var crypto=require('crypto');var jsforce=require(_0x43a2('0xe'));var deskjs=require(_0x43a2('0xf'));var toCsv=require(_0x43a2('0x9'));var querystring=require(_0x43a2('0x10'));var Papa=require(_0x43a2('0x11'));var Redis=require(_0x43a2('0x12'));var authService=require(_0x43a2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x43a2('0x14'));var hardwareService=require(_0x43a2('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x43a2('0x16'));var config=require(_0x43a2('0x17'));var licenseUtil=require(_0x43a2('0x18'));var db=require(_0x43a2('0x19'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x4d06ce,_0x5c7fef){_0x5c7fef=_0x5c7fef||0xcc;return function(_0x44995b){if(_0x44995b){return _0x4d06ce[_0x43a2('0x1a')](_0x5c7fef);}return _0x4d06ce[_0x43a2('0x1b')](_0x5c7fef)[_0x43a2('0x1c')]();};}function respondWithResult(_0x14e39d,_0x2c20a1){_0x2c20a1=_0x2c20a1||0xc8;return function(_0x451ae8){if(_0x451ae8){return _0x14e39d['status'](_0x2c20a1)['json'](_0x451ae8);}};}function respondWithFilteredResult(_0x1b09dd,_0x542384){return function(_0x94be1a){if(_0x94be1a){var _0x27e842=typeof _0x542384[_0x43a2('0x1d')]===_0x43a2('0x1e')&&typeof _0x542384[_0x43a2('0x1f')]==='undefined';var _0x3d3e5f=_0x94be1a[_0x43a2('0x20')];var _0x126b7c=_0x27e842?0x0:_0x542384[_0x43a2('0x1d')];var _0x260908=_0x27e842?_0x94be1a[_0x43a2('0x20')]:_0x542384['offset']+_0x542384[_0x43a2('0x1f')];var _0x347b1c;if(_0x260908>=_0x3d3e5f){_0x260908=_0x3d3e5f;_0x347b1c=0xc8;}else{_0x347b1c=0xce;}_0x1b09dd[_0x43a2('0x1b')](_0x347b1c);return _0x1b09dd[_0x43a2('0x21')](_0x43a2('0x22'),_0x126b7c+'-'+_0x260908+'/'+_0x3d3e5f)[_0x43a2('0x23')](_0x94be1a);}return null;};}function patchUpdates(_0x2188dc){return function(_0x1c843d){try{jsonpatch['apply'](_0x1c843d,_0x2188dc,!![]);}catch(_0x5d7fbc){return BPromise['reject'](_0x5d7fbc);}return _0x1c843d[_0x43a2('0x24')]();};}function saveUpdates(_0x97c66a,_0x458181){return function(_0xdb9e39){if(_0xdb9e39){return _0xdb9e39[_0x43a2('0x25')](_0x97c66a)[_0x43a2('0x26')](function(_0x2796bf){return _0x2796bf;});}return null;};}function removeEntity(_0x3a2b9c,_0x223e8a){return function(_0x16ce5b){if(_0x16ce5b){return _0x16ce5b[_0x43a2('0x27')]()[_0x43a2('0x26')](function(){var _0x3d2733=_0x16ce5b[_0x43a2('0x28')]({'plain':!![]});var _0x6c40bc=_0x43a2('0x29');return db[_0x43a2('0x2a')]['destroy']({'where':{'type':_0x6c40bc,'resourceId':_0x3d2733['id']}})[_0x43a2('0x26')](function(){return _0x16ce5b;});})[_0x43a2('0x26')](function(){_0x3a2b9c[_0x43a2('0x1b')](0xcc)[_0x43a2('0x1c')]();});}};}function handleEntityNotFound(_0x3363ce,_0x3cf4e3){return function(_0x10553d){if(!_0x10553d){_0x3363ce['sendStatus'](0x194);}return _0x10553d;};}function handleError(_0x9eff4f,_0x38de84){_0x38de84=_0x38de84||0x1f4;return function(_0xa2d9b2){logger[_0x43a2('0x2b')](_0xa2d9b2[_0x43a2('0x2c')]);if(_0xa2d9b2['name']){delete _0xa2d9b2[_0x43a2('0x2d')];}_0x9eff4f[_0x43a2('0x1b')](_0x38de84)[_0x43a2('0x2e')](_0xa2d9b2);};}exports[_0x43a2('0x2f')]=function(_0x61260f,_0x259171){var _0x49979a={},_0xc19bcd={},_0x8f67b5={'count':0x0,'rows':[]};var _0x1b342e=_['map'](db[_0x43a2('0x30')][_0x43a2('0x31')],function(_0x9925ac){return{'name':_0x9925ac[_0x43a2('0x32')],'type':_0x9925ac[_0x43a2('0x33')]['key']};});_0xc19bcd[_0x43a2('0x34')]=_[_0x43a2('0x35')](_0x1b342e,_0x43a2('0x2d'));_0xc19bcd[_0x43a2('0x36')]=_[_0x43a2('0x37')](_0x61260f[_0x43a2('0x36')]);_0xc19bcd[_0x43a2('0x38')]=_['intersection'](_0xc19bcd['model'],_0xc19bcd[_0x43a2('0x36')]);_0x49979a['attributes']=_[_0x43a2('0x39')](_0xc19bcd['model'],qs[_0x43a2('0x3a')](_0x61260f['query']['fields']));_0x49979a[_0x43a2('0x3b')]=_0x49979a[_0x43a2('0x3b')]['length']?_0x49979a[_0x43a2('0x3b')]:_0xc19bcd['model'];if(!_0x61260f[_0x43a2('0x36')]['hasOwnProperty'](_0x43a2('0x3c'))){_0x49979a[_0x43a2('0x1f')]=qs[_0x43a2('0x1f')](_0x61260f[_0x43a2('0x36')][_0x43a2('0x1f')]);_0x49979a['offset']=qs[_0x43a2('0x1d')](_0x61260f[_0x43a2('0x36')][_0x43a2('0x1d')]);}_0x49979a[_0x43a2('0x3d')]=qs[_0x43a2('0x3e')](_0x61260f[_0x43a2('0x36')][_0x43a2('0x3e')]);_0x49979a['where']=qs[_0x43a2('0x38')](_[_0x43a2('0x3f')](_0x61260f[_0x43a2('0x36')],_0xc19bcd[_0x43a2('0x38')]),_0x1b342e);if(_0x61260f[_0x43a2('0x36')][_0x43a2('0x40')]){_0x49979a[_0x43a2('0x41')]=_[_0x43a2('0x42')](_0x49979a['where'],{'$or':_[_0x43a2('0x35')](_0x1b342e,function(_0xd40d94){if(_0xd40d94[_0x43a2('0x33')]!==_0x43a2('0x43')){var _0xaafa3f={};_0xaafa3f[_0xd40d94[_0x43a2('0x2d')]]={'$like':'%'+_0x61260f['query'][_0x43a2('0x40')]+'%'};return _0xaafa3f;}})});}_0x49979a=_[_0x43a2('0x42')]({},_0x49979a,_0x61260f[_0x43a2('0x44')]);var _0x2dbca9={'where':_0x49979a[_0x43a2('0x41')]};return db[_0x43a2('0x30')][_0x43a2('0x20')](_0x2dbca9)[_0x43a2('0x26')](function(_0x378c19){_0x8f67b5[_0x43a2('0x20')]=_0x378c19;if(_0x61260f['query']['includeAll']){_0x49979a[_0x43a2('0x45')]=[{'all':!![]}];}return db[_0x43a2('0x30')][_0x43a2('0x46')](_0x49979a);})[_0x43a2('0x26')](function(_0x508b1f){_0x8f67b5['rows']=_0x508b1f;return _0x8f67b5;})['then'](respondWithFilteredResult(_0x259171,_0x49979a))[_0x43a2('0x47')](handleError(_0x259171,null));};exports[_0x43a2('0x48')]=function(_0x19f74f,_0x333370){var _0x125537={'raw':!![],'where':{'id':_0x19f74f[_0x43a2('0x49')]['id']}},_0x465d99={};_0x465d99['model']=_['keys'](db[_0x43a2('0x30')][_0x43a2('0x31')]);_0x465d99['query']=_['keys'](_0x19f74f[_0x43a2('0x36')]);_0x465d99[_0x43a2('0x38')]=_[_0x43a2('0x39')](_0x465d99[_0x43a2('0x34')],_0x465d99[_0x43a2('0x36')]);_0x125537[_0x43a2('0x3b')]=_[_0x43a2('0x39')](_0x465d99[_0x43a2('0x34')],qs[_0x43a2('0x3a')](_0x19f74f[_0x43a2('0x36')][_0x43a2('0x3a')]));_0x125537[_0x43a2('0x3b')]=_0x125537['attributes'][_0x43a2('0x4a')]?_0x125537[_0x43a2('0x3b')]:_0x465d99[_0x43a2('0x34')];if(_0x19f74f[_0x43a2('0x36')][_0x43a2('0x4b')]){_0x125537['include']=[{'all':!![]}];}_0x125537=_[_0x43a2('0x42')]({},_0x125537,_0x19f74f[_0x43a2('0x44')]);return db[_0x43a2('0x30')][_0x43a2('0x4c')](_0x125537)[_0x43a2('0x26')](handleEntityNotFound(_0x333370,null))['then'](respondWithResult(_0x333370,null))['catch'](handleError(_0x333370,null));};exports[_0x43a2('0x4d')]=function(_0x49c1c1,_0x5ed862){return db[_0x43a2('0x30')][_0x43a2('0x4d')](_0x49c1c1['body'],{})['then'](function(_0x4b811b){var _0x5bc307=_0x49c1c1[_0x43a2('0x4e')]['get']({'plain':!![]});if(!_0x5bc307)throw new Error(_0x43a2('0x4f'));if(_0x5bc307['role']===_0x43a2('0x4e')){var _0x2f1d3a=_0x4b811b[_0x43a2('0x28')]({'plain':!![]});var _0x1db963='Intervals';return db[_0x43a2('0x50')]['find']({'where':{'name':_0x1db963,'userProfileId':_0x5bc307['userProfileId']},'raw':!![]})[_0x43a2('0x26')](function(_0x89d0a){if(_0x89d0a&&_0x89d0a['autoAssociation']===0x0){return db[_0x43a2('0x2a')][_0x43a2('0x4d')]({'name':_0x2f1d3a[_0x43a2('0x2d')],'resourceId':_0x2f1d3a['id'],'type':_0x89d0a[_0x43a2('0x2d')],'sectionId':_0x89d0a['id']},{})[_0x43a2('0x26')](function(){return _0x4b811b;});}else{return _0x4b811b;}})[_0x43a2('0x47')](function(_0x57d0ed){logger[_0x43a2('0x2b')](_0x43a2('0x51'),_0x57d0ed);throw _0x57d0ed;});}return _0x4b811b;})[_0x43a2('0x26')](respondWithResult(_0x5ed862,0xc9))[_0x43a2('0x47')](handleError(_0x5ed862,null));};exports['update']=function(_0x4bd00b,_0x28a8e3){if(_0x4bd00b[_0x43a2('0x52')]['id']){delete _0x4bd00b[_0x43a2('0x52')]['id'];}return db['Interval'][_0x43a2('0x4c')]({'where':{'id':_0x4bd00b['params']['id']}})['then'](handleEntityNotFound(_0x28a8e3,null))['then'](saveUpdates(_0x4bd00b['body'],null))[_0x43a2('0x26')](respondWithResult(_0x28a8e3,null))[_0x43a2('0x47')](handleError(_0x28a8e3,null));};exports[_0x43a2('0x27')]=function(_0x4f8bad,_0x445de6){return db['Interval'][_0x43a2('0x4c')]({'where':{'id':_0x4f8bad[_0x43a2('0x49')]['id']}})[_0x43a2('0x26')](handleEntityNotFound(_0x445de6,null))['then'](removeEntity(_0x445de6,null))[_0x43a2('0x47')](handleError(_0x445de6,null));};exports['addInterval']=function(_0x13f140,_0x40979a,_0x2a1b5c){if(_0x13f140[_0x43a2('0x52')]['id']){delete _0x13f140[_0x43a2('0x52')]['id'];}return db[_0x43a2('0x30')][_0x43a2('0x4c')]({'where':{'id':_0x13f140[_0x43a2('0x49')]['id']}})[_0x43a2('0x26')](handleEntityNotFound(_0x40979a,null))[_0x43a2('0x26')](function(_0x2b3676){if(_0x2b3676){_0x13f140[_0x43a2('0x52')][_0x43a2('0x53')]=_0x2b3676['id'];return db['Interval']['create'](_0x13f140['body']);}})['then'](respondWithResult(_0x40979a,null))[_0x43a2('0x47')](handleError(_0x40979a,null));};exports['getIntervals']=function(_0x9ae241,_0x4cec06,_0x1dafe0){var _0x1e192b={};var _0x203eae={};var _0x14d8cf;var _0x504a52;return db[_0x43a2('0x30')][_0x43a2('0x54')]({'where':{'id':_0x9ae241[_0x43a2('0x49')]['id']}})[_0x43a2('0x26')](handleEntityNotFound(_0x4cec06,null))[_0x43a2('0x26')](function(_0x130c16){if(_0x130c16){_0x14d8cf=_0x130c16;_0x203eae[_0x43a2('0x34')]=_[_0x43a2('0x37')](db[_0x43a2('0x30')][_0x43a2('0x31')]);_0x203eae[_0x43a2('0x36')]=_[_0x43a2('0x37')](_0x9ae241[_0x43a2('0x36')]);_0x203eae['filters']=_[_0x43a2('0x39')](_0x203eae[_0x43a2('0x34')],_0x203eae[_0x43a2('0x36')]);_0x1e192b[_0x43a2('0x3b')]=_[_0x43a2('0x39')](_0x203eae[_0x43a2('0x34')],qs[_0x43a2('0x3a')](_0x9ae241[_0x43a2('0x36')][_0x43a2('0x3a')]));_0x1e192b[_0x43a2('0x3b')]=_0x1e192b[_0x43a2('0x3b')]['length']?_0x1e192b[_0x43a2('0x3b')]:_0x203eae[_0x43a2('0x34')];_0x1e192b[_0x43a2('0x3d')]=qs[_0x43a2('0x3e')](_0x9ae241[_0x43a2('0x36')][_0x43a2('0x3e')]);_0x1e192b[_0x43a2('0x41')]=qs[_0x43a2('0x38')](_['pick'](_0x9ae241['query'],_0x203eae[_0x43a2('0x38')]));if(_0x9ae241[_0x43a2('0x36')]['filter']){_0x1e192b[_0x43a2('0x41')]=_[_0x43a2('0x42')](_0x1e192b[_0x43a2('0x41')],{'$or':_[_0x43a2('0x35')](_0x1e192b[_0x43a2('0x3b')],function(_0x5c22c0){var _0x2a22f0={};_0x2a22f0[_0x5c22c0]={'$like':'%'+_0x9ae241['query']['filter']+'%'};return _0x2a22f0;})});}_0x1e192b=_[_0x43a2('0x42')]({},_0x1e192b,_0x9ae241[_0x43a2('0x44')]);return _0x14d8cf[_0x43a2('0x55')](_0x1e192b);}})['then'](function(_0x298046){if(_0x298046){_0x504a52=_0x298046[_0x43a2('0x4a')];if(!_0x9ae241[_0x43a2('0x36')][_0x43a2('0x56')](_0x43a2('0x3c'))){_0x1e192b['limit']=qs[_0x43a2('0x1f')](_0x9ae241['query'][_0x43a2('0x1f')]);_0x1e192b['offset']=qs['offset'](_0x9ae241[_0x43a2('0x36')][_0x43a2('0x1d')]);}return _0x14d8cf['getIntervals'](_0x1e192b);}})[_0x43a2('0x26')](function(_0x32f445){if(_0x32f445){return _0x32f445?{'count':_0x504a52,'rows':_0x32f445}:null;}})[_0x43a2('0x26')](respondWithResult(_0x4cec06,null))[_0x43a2('0x47')](handleError(_0x4cec06,null));};exports['addIntervals']=function(_0x2e0132,_0x5b491e,_0x499cd9){return db[_0x43a2('0x30')][_0x43a2('0x54')]({'where':{'id':_0x2e0132['params']['id']}})[_0x43a2('0x26')](handleEntityNotFound(_0x5b491e,null))[_0x43a2('0x26')](function(_0xd6411b){if(_0xd6411b){return db[_0x43a2('0x57')][_0x43a2('0x58')](function(_0x5067db){return db[_0x43a2('0x30')][_0x43a2('0x27')]({'where':{'IntervalId':_0x2e0132['params']['id']},'transaction':_0x5067db})[_0x43a2('0x26')](function(_0x4be85f){var _0x3d3aba=_[_0x43a2('0x35')](_0x2e0132[_0x43a2('0x52')],function(_0x54b0e5){delete _0x54b0e5['id'];_0x54b0e5[_0x43a2('0x53')]=_0x2e0132['params']['id'];return _0x54b0e5;});return db[_0x43a2('0x30')]['bulkCreate'](_0x3d3aba,{'transaction':_0x5067db});});})['then'](function(){return db[_0x43a2('0x30')][_0x43a2('0x46')]({'where':{'IntervalId':_0x2e0132[_0x43a2('0x49')]['id']}});});}})[_0x43a2('0x26')](respondWithResult(_0x5b491e,null))[_0x43a2('0x47')](handleError(_0x5b491e,null));}; \ No newline at end of file +var _0x766b=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','addInterval','IntervalId','findOne','getIntervals','hasOwnProperty','addIntervals','sequelize','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','Intervals','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','fields','length','order','sort','pick','filters','filter','where','VIRTUAL','merge','Interval','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body'];(function(_0x519b50,_0x586d4f){var _0x46d63b=function(_0x206602){while(--_0x206602){_0x519b50['push'](_0x519b50['shift']());}};_0x46d63b(++_0x586d4f);}(_0x766b,0x128));var _0xb766=function(_0x2a34e6,_0x2dc0a6){_0x2a34e6=_0x2a34e6-0x0;var _0x3bda67=_0x766b[_0x2a34e6];return _0x3bda67;};'use strict';var emlformat=require(_0xb766('0x0'));var rimraf=require(_0xb766('0x1'));var zipdir=require(_0xb766('0x2'));var jsonpatch=require(_0xb766('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb766('0x4'));var Mustache=require(_0xb766('0x5'));var util=require(_0xb766('0x6'));var path=require(_0xb766('0x7'));var sox=require(_0xb766('0x8'));var csv=require('to-csv');var ejs=require(_0xb766('0x9'));var fs=require('fs');var fs_extra=require(_0xb766('0xa'));var _=require(_0xb766('0xb'));var squel=require('squel');var crypto=require(_0xb766('0xc'));var jsforce=require(_0xb766('0xd'));var deskjs=require(_0xb766('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb766('0xf'));var Papa=require(_0xb766('0x10'));var Redis=require(_0xb766('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb766('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb766('0x13'));var logger=require(_0xb766('0x14'))(_0xb766('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb766('0x16'));var db=require(_0xb766('0x17'))['db'];var extensions=require(_0xb766('0x18'));function respondWithStatusCode(_0x301ce9,_0x26653a){_0x26653a=_0x26653a||0xcc;return function(_0x34df16){if(_0x34df16){return _0x301ce9[_0xb766('0x19')](_0x26653a);}return _0x301ce9[_0xb766('0x1a')](_0x26653a)[_0xb766('0x1b')]();};}function respondWithResult(_0x4ff62e,_0x2c00e1){_0x2c00e1=_0x2c00e1||0xc8;return function(_0x11b0aa){if(_0x11b0aa){return _0x4ff62e[_0xb766('0x1a')](_0x2c00e1)[_0xb766('0x1c')](_0x11b0aa);}};}function respondWithFilteredResult(_0x2dcc19,_0x3a7c62){return function(_0x33d66b){if(_0x33d66b){var _0x2ce892=typeof _0x3a7c62[_0xb766('0x1d')]===_0xb766('0x1e')&&typeof _0x3a7c62[_0xb766('0x1f')]===_0xb766('0x1e');var _0x39684d=_0x33d66b[_0xb766('0x20')];var _0x3bebb2=_0x2ce892?0x0:_0x3a7c62[_0xb766('0x1d')];var _0x2f1742=_0x2ce892?_0x33d66b[_0xb766('0x20')]:_0x3a7c62[_0xb766('0x1d')]+_0x3a7c62['limit'];var _0x288fd9;if(_0x2f1742>=_0x39684d){_0x2f1742=_0x39684d;_0x288fd9=0xc8;}else{_0x288fd9=0xce;}_0x2dcc19[_0xb766('0x1a')](_0x288fd9);return _0x2dcc19[_0xb766('0x21')](_0xb766('0x22'),_0x3bebb2+'-'+_0x2f1742+'/'+_0x39684d)[_0xb766('0x1c')](_0x33d66b);}return null;};}function patchUpdates(_0x400bcc){return function(_0x36e756){try{jsonpatch['apply'](_0x36e756,_0x400bcc,!![]);}catch(_0x1529e8){return BPromise[_0xb766('0x23')](_0x1529e8);}return _0x36e756[_0xb766('0x24')]();};}function saveUpdates(_0x86aaf3,_0x2343b3){return function(_0xaafd2f){if(_0xaafd2f){return _0xaafd2f[_0xb766('0x25')](_0x86aaf3)['then'](function(_0x5d34e6){return _0x5d34e6;});}return null;};}function removeEntity(_0x42d309,_0x2aedf4){return function(_0x4c6b2e){if(_0x4c6b2e){return _0x4c6b2e[_0xb766('0x26')]()[_0xb766('0x27')](function(){var _0x58f188=_0x4c6b2e['get']({'plain':!![]});var _0x3e81f2=_0xb766('0x28');return db['UserProfileResource'][_0xb766('0x26')]({'where':{'type':_0x3e81f2,'resourceId':_0x58f188['id']}})[_0xb766('0x27')](function(){return _0x4c6b2e;});})[_0xb766('0x27')](function(){_0x42d309['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9344dc,_0x2103c4){return function(_0x33be12){if(!_0x33be12){_0x9344dc[_0xb766('0x19')](0x194);}return _0x33be12;};}function handleError(_0x4cd816,_0x2f3aa3){_0x2f3aa3=_0x2f3aa3||0x1f4;return function(_0x3103f0){logger['error'](_0x3103f0[_0xb766('0x29')]);if(_0x3103f0[_0xb766('0x2a')]){delete _0x3103f0[_0xb766('0x2a')];}_0x4cd816[_0xb766('0x1a')](_0x2f3aa3)[_0xb766('0x2b')](_0x3103f0);};}exports[_0xb766('0x2c')]=function(_0x4333f0,_0x25c07e){var _0x3978f0={},_0xdb1b6d={},_0xdaa1e={'count':0x0,'rows':[]};var _0x301b7b=_[_0xb766('0x2d')](db['Interval'][_0xb766('0x2e')],function(_0x472169){return{'name':_0x472169['fieldName'],'type':_0x472169[_0xb766('0x2f')][_0xb766('0x30')]};});_0xdb1b6d[_0xb766('0x31')]=_[_0xb766('0x2d')](_0x301b7b,_0xb766('0x2a'));_0xdb1b6d[_0xb766('0x32')]=_['keys'](_0x4333f0[_0xb766('0x32')]);_0xdb1b6d['filters']=_[_0xb766('0x33')](_0xdb1b6d['model'],_0xdb1b6d[_0xb766('0x32')]);_0x3978f0[_0xb766('0x34')]=_['intersection'](_0xdb1b6d[_0xb766('0x31')],qs[_0xb766('0x35')](_0x4333f0[_0xb766('0x32')][_0xb766('0x35')]));_0x3978f0[_0xb766('0x34')]=_0x3978f0[_0xb766('0x34')][_0xb766('0x36')]?_0x3978f0['attributes']:_0xdb1b6d['model'];if(!_0x4333f0[_0xb766('0x32')]['hasOwnProperty']('nolimit')){_0x3978f0[_0xb766('0x1f')]=qs[_0xb766('0x1f')](_0x4333f0['query'][_0xb766('0x1f')]);_0x3978f0[_0xb766('0x1d')]=qs['offset'](_0x4333f0[_0xb766('0x32')][_0xb766('0x1d')]);}_0x3978f0[_0xb766('0x37')]=qs[_0xb766('0x38')](_0x4333f0[_0xb766('0x32')][_0xb766('0x38')]);_0x3978f0['where']=qs['filters'](_[_0xb766('0x39')](_0x4333f0['query'],_0xdb1b6d[_0xb766('0x3a')]),_0x301b7b);if(_0x4333f0[_0xb766('0x32')][_0xb766('0x3b')]){_0x3978f0[_0xb766('0x3c')]=_['merge'](_0x3978f0[_0xb766('0x3c')],{'$or':_[_0xb766('0x2d')](_0x301b7b,function(_0x210515){if(_0x210515[_0xb766('0x2f')]!==_0xb766('0x3d')){var _0x44c1e1={};_0x44c1e1[_0x210515[_0xb766('0x2a')]]={'$like':'%'+_0x4333f0[_0xb766('0x32')][_0xb766('0x3b')]+'%'};return _0x44c1e1;}})});}_0x3978f0=_[_0xb766('0x3e')]({},_0x3978f0,_0x4333f0['options']);var _0x3e713b={'where':_0x3978f0[_0xb766('0x3c')]};return db[_0xb766('0x3f')]['count'](_0x3e713b)[_0xb766('0x27')](function(_0x17990c){_0xdaa1e[_0xb766('0x20')]=_0x17990c;if(_0x4333f0['query'][_0xb766('0x40')]){_0x3978f0[_0xb766('0x41')]=[{'all':!![]}];}return db[_0xb766('0x3f')][_0xb766('0x42')](_0x3978f0);})['then'](function(_0x23d2a5){_0xdaa1e[_0xb766('0x43')]=_0x23d2a5;return _0xdaa1e;})[_0xb766('0x27')](respondWithFilteredResult(_0x25c07e,_0x3978f0))[_0xb766('0x44')](handleError(_0x25c07e,null));};exports[_0xb766('0x45')]=function(_0x1b3a5a,_0x555373){var _0x2f0493={'raw':!![],'where':{'id':_0x1b3a5a[_0xb766('0x46')]['id']}},_0x2f4574={};_0x2f4574[_0xb766('0x31')]=_[_0xb766('0x47')](db['Interval'][_0xb766('0x2e')]);_0x2f4574['query']=_[_0xb766('0x47')](_0x1b3a5a[_0xb766('0x32')]);_0x2f4574['filters']=_[_0xb766('0x33')](_0x2f4574[_0xb766('0x31')],_0x2f4574[_0xb766('0x32')]);_0x2f0493[_0xb766('0x34')]=_['intersection'](_0x2f4574[_0xb766('0x31')],qs[_0xb766('0x35')](_0x1b3a5a[_0xb766('0x32')][_0xb766('0x35')]));_0x2f0493['attributes']=_0x2f0493[_0xb766('0x34')][_0xb766('0x36')]?_0x2f0493[_0xb766('0x34')]:_0x2f4574[_0xb766('0x31')];if(_0x1b3a5a[_0xb766('0x32')][_0xb766('0x40')]){_0x2f0493[_0xb766('0x41')]=[{'all':!![]}];}_0x2f0493=_[_0xb766('0x3e')]({},_0x2f0493,_0x1b3a5a[_0xb766('0x48')]);return db[_0xb766('0x3f')][_0xb766('0x49')](_0x2f0493)['then'](handleEntityNotFound(_0x555373,null))[_0xb766('0x27')](respondWithResult(_0x555373,null))[_0xb766('0x44')](handleError(_0x555373,null));};exports[_0xb766('0x4a')]=function(_0x87a36c,_0x5454cf){return db['Interval'][_0xb766('0x4a')](_0x87a36c[_0xb766('0x4b')],{})[_0xb766('0x27')](function(_0x45b2b0){var _0x4b095e=_0x87a36c[_0xb766('0x4c')]['get']({'plain':!![]});if(!_0x4b095e)throw new Error(_0xb766('0x4d'));if(_0x4b095e[_0xb766('0x4e')]===_0xb766('0x4c')){var _0x31a144=_0x45b2b0[_0xb766('0x4f')]({'plain':!![]});var _0x16f653='Intervals';return db[_0xb766('0x50')][_0xb766('0x49')]({'where':{'name':_0x16f653,'userProfileId':_0x4b095e[_0xb766('0x51')]},'raw':!![]})[_0xb766('0x27')](function(_0x4b588a){if(_0x4b588a&&_0x4b588a[_0xb766('0x52')]===0x0){return db[_0xb766('0x53')]['create']({'name':_0x31a144['name'],'resourceId':_0x31a144['id'],'type':_0x4b588a['name'],'sectionId':_0x4b588a['id']},{})[_0xb766('0x27')](function(){return _0x45b2b0;});}else{return _0x45b2b0;}})[_0xb766('0x44')](function(_0x4674f2){logger[_0xb766('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4674f2);throw _0x4674f2;});}return _0x45b2b0;})[_0xb766('0x27')](respondWithResult(_0x5454cf,0xc9))[_0xb766('0x44')](handleError(_0x5454cf,null));};exports[_0xb766('0x25')]=function(_0xcf90a4,_0x4a582d){if(_0xcf90a4[_0xb766('0x4b')]['id']){delete _0xcf90a4[_0xb766('0x4b')]['id'];}return db[_0xb766('0x3f')][_0xb766('0x49')]({'where':{'id':_0xcf90a4['params']['id']}})[_0xb766('0x27')](handleEntityNotFound(_0x4a582d,null))['then'](saveUpdates(_0xcf90a4[_0xb766('0x4b')],null))[_0xb766('0x27')](respondWithResult(_0x4a582d,null))[_0xb766('0x44')](handleError(_0x4a582d,null));};exports[_0xb766('0x26')]=function(_0x10bf10,_0x1fc8af){return db[_0xb766('0x3f')][_0xb766('0x49')]({'where':{'id':_0x10bf10[_0xb766('0x46')]['id']}})['then'](handleEntityNotFound(_0x1fc8af,null))[_0xb766('0x27')](removeEntity(_0x1fc8af,null))[_0xb766('0x44')](handleError(_0x1fc8af,null));};exports[_0xb766('0x55')]=function(_0x2a380e,_0x7f3d41,_0x2fbb71){if(_0x2a380e[_0xb766('0x4b')]['id']){delete _0x2a380e[_0xb766('0x4b')]['id'];}return db[_0xb766('0x3f')]['find']({'where':{'id':_0x2a380e[_0xb766('0x46')]['id']}})['then'](handleEntityNotFound(_0x7f3d41,null))[_0xb766('0x27')](function(_0x2042e4){if(_0x2042e4){_0x2a380e[_0xb766('0x4b')][_0xb766('0x56')]=_0x2042e4['id'];return db['Interval']['create'](_0x2a380e[_0xb766('0x4b')]);}})['then'](respondWithResult(_0x7f3d41,null))[_0xb766('0x44')](handleError(_0x7f3d41,null));};exports['getIntervals']=function(_0x43622c,_0x8be2e0,_0x2906bc){var _0x95b550={};var _0x198f80={};var _0x59c1c1;var _0x53f18f;return db[_0xb766('0x3f')][_0xb766('0x57')]({'where':{'id':_0x43622c[_0xb766('0x46')]['id']}})[_0xb766('0x27')](handleEntityNotFound(_0x8be2e0,null))[_0xb766('0x27')](function(_0x1f2cc4){if(_0x1f2cc4){_0x59c1c1=_0x1f2cc4;_0x198f80['model']=_[_0xb766('0x47')](db[_0xb766('0x3f')][_0xb766('0x2e')]);_0x198f80['query']=_[_0xb766('0x47')](_0x43622c[_0xb766('0x32')]);_0x198f80['filters']=_['intersection'](_0x198f80[_0xb766('0x31')],_0x198f80[_0xb766('0x32')]);_0x95b550[_0xb766('0x34')]=_[_0xb766('0x33')](_0x198f80[_0xb766('0x31')],qs[_0xb766('0x35')](_0x43622c['query'][_0xb766('0x35')]));_0x95b550['attributes']=_0x95b550[_0xb766('0x34')]['length']?_0x95b550[_0xb766('0x34')]:_0x198f80[_0xb766('0x31')];_0x95b550[_0xb766('0x37')]=qs[_0xb766('0x38')](_0x43622c['query']['sort']);_0x95b550[_0xb766('0x3c')]=qs['filters'](_['pick'](_0x43622c[_0xb766('0x32')],_0x198f80[_0xb766('0x3a')]));if(_0x43622c['query'][_0xb766('0x3b')]){_0x95b550['where']=_['merge'](_0x95b550[_0xb766('0x3c')],{'$or':_[_0xb766('0x2d')](_0x95b550[_0xb766('0x34')],function(_0x3e944a){var _0x4056b9={};_0x4056b9[_0x3e944a]={'$like':'%'+_0x43622c[_0xb766('0x32')][_0xb766('0x3b')]+'%'};return _0x4056b9;})});}_0x95b550=_['merge']({},_0x95b550,_0x43622c[_0xb766('0x48')]);return _0x59c1c1[_0xb766('0x58')](_0x95b550);}})['then'](function(_0x285205){if(_0x285205){_0x53f18f=_0x285205[_0xb766('0x36')];if(!_0x43622c[_0xb766('0x32')][_0xb766('0x59')]('nolimit')){_0x95b550[_0xb766('0x1f')]=qs[_0xb766('0x1f')](_0x43622c[_0xb766('0x32')][_0xb766('0x1f')]);_0x95b550['offset']=qs[_0xb766('0x1d')](_0x43622c[_0xb766('0x32')][_0xb766('0x1d')]);}return _0x59c1c1[_0xb766('0x58')](_0x95b550);}})['then'](function(_0x23d133){if(_0x23d133){return _0x23d133?{'count':_0x53f18f,'rows':_0x23d133}:null;}})['then'](respondWithResult(_0x8be2e0,null))['catch'](handleError(_0x8be2e0,null));};exports[_0xb766('0x5a')]=function(_0x31e19a,_0x3a1c60,_0xbe3e40){return db[_0xb766('0x3f')]['findOne']({'where':{'id':_0x31e19a['params']['id']}})['then'](handleEntityNotFound(_0x3a1c60,null))[_0xb766('0x27')](function(_0x38a21d){if(_0x38a21d){return db[_0xb766('0x5b')]['transaction'](function(_0x52c851){return db[_0xb766('0x3f')][_0xb766('0x26')]({'where':{'IntervalId':_0x31e19a[_0xb766('0x46')]['id']},'transaction':_0x52c851})[_0xb766('0x27')](function(_0x18ffe0){var _0x5a080b=_[_0xb766('0x2d')](_0x31e19a['body'],function(_0x21fbdc){delete _0x21fbdc['id'];_0x21fbdc[_0xb766('0x56')]=_0x31e19a['params']['id'];return _0x21fbdc;});return db['Interval'][_0xb766('0x5c')](_0x5a080b,{'transaction':_0x52c851});});})[_0xb766('0x27')](function(){return db['Interval'][_0xb766('0x42')]({'where':{'IntervalId':_0x31e19a[_0xb766('0x46')]['id']}});});}})[_0xb766('0x27')](respondWithResult(_0x3a1c60,null))[_0xb766('0x44')](handleError(_0x3a1c60,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index edc8062..6b72aef 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 _0x2558=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Interval','tools_intervals','rewrite'];(function(_0x35b6e1,_0x1baa78){var _0x268e95=function(_0x26dbde){while(--_0x26dbde){_0x35b6e1['push'](_0x35b6e1['shift']());}};_0x268e95(++_0x1baa78);}(_0x2558,0x1a0));var _0x8255=function(_0x375052,_0x291d35){_0x375052=_0x375052-0x0;var _0x351435=_0x2558[_0x375052];return _0x351435;};'use strict';var _=require('lodash');var util=require(_0x8255('0x0'));var logger=require(_0x8255('0x1'))(_0x8255('0x2'));var moment=require(_0x8255('0x3'));var BPromise=require(_0x8255('0x4'));var rp=require(_0x8255('0x5'));var fs=require('fs');var path=require(_0x8255('0x6'));var rimraf=require(_0x8255('0x7'));var config=require(_0x8255('0x8'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x29ab2b,_0x4792c9){return _0x29ab2b[_0x8255('0x9')](_0x8255('0xa'),attributes,{'tableName':_0x8255('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x58d27b,_0x51fd5d){extensions[_0x8255('0xc')](_0x29ab2b,_0x58d27b);},'afterBulkCreate':function(_0x5e0c4c,_0x3496e9,_0x56b08f){_0x56b08f();extensions['rewrite'](_0x29ab2b,_0x5e0c4c[0x0]);},'afterUpdate':function(_0xc555da,_0x132425){extensions[_0x8255('0xc')](_0x29ab2b,_0xc555da);},'afterDestroy':function(_0x794695,_0x28ba88){extensions[_0x8255('0xc')](_0x29ab2b,_0x794695);}}});}; \ No newline at end of file +var _0x0fc9=['rewrite','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval'];(function(_0x55cec5,_0x2258b4){var _0x545c82=function(_0x516fa2){while(--_0x516fa2){_0x55cec5['push'](_0x55cec5['shift']());}};_0x545c82(++_0x2258b4);}(_0x0fc9,0x15f));var _0x90fc=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0fc9[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x90fc('0x0'));var util=require(_0x90fc('0x1'));var logger=require(_0x90fc('0x2'))('api');var moment=require(_0x90fc('0x3'));var BPromise=require(_0x90fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90fc('0x5'));var rimraf=require(_0x90fc('0x6'));var config=require(_0x90fc('0x7'));var attributes=require(_0x90fc('0x8'));var extensions=require(_0x90fc('0x9'));module[_0x90fc('0xa')]=function(_0x4b86d9,_0x4cfdd){return _0x4b86d9[_0x90fc('0xb')](_0x90fc('0xc'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4cf050,_0x5d9750){extensions[_0x90fc('0xd')](_0x4b86d9,_0x4cf050);},'afterBulkCreate':function(_0x2ecf24,_0x21b6f5,_0x34dcc0){_0x34dcc0();extensions[_0x90fc('0xd')](_0x4b86d9,_0x2ecf24[0x0]);},'afterUpdate':function(_0x1e9df3,_0x3dabf7){extensions[_0x90fc('0xd')](_0x4b86d9,_0x1e9df3);},'afterDestroy':function(_0x302520,_0x21dc78){extensions['rewrite'](_0x4b86d9,_0x302520);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 28eb72e..f26bdfd 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(_0x378b4,_0x5ca7fa){var _0x11d07b=function(_0x35d420){while(--_0x35d420){_0x378b4['push'](_0x378b4['shift']());}};_0x11d07b(++_0x5ca7fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_0x3b594b,_0x5835c3){var _0x1ea5f8=function(_0x191b3e){while(--_0x191b3e){_0x3b594b['push'](_0x3b594b['shift']());}};_0x1ea5f8(++_0x5835c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 9096f44..bb44801 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 _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x438ddb,_0x4808ff){var _0x5debed=function(_0x57dcfb){while(--_0x57dcfb){_0x438ddb['push'](_0x438ddb['shift']());}};_0x5debed(++_0x4808ff);}(_0x5f2f,0x73));var _0xf5f2=function(_0xee186e,_0x55a382){_0xee186e=_0xee186e-0x0;var _0x21e3ad=_0x5f2f[_0xee186e];return _0x21e3ad;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x1155c0,_0x55e84d){var _0x2ce275=function(_0x20758b){while(--_0x20758b){_0x1155c0['push'](_0x1155c0['shift']());}};_0x2ce275(++_0x55e84d);}(_0xdb28,0x106));var _0x8db2=function(_0x3db190,_0x1bcc04){_0x3db190=_0x3db190-0x0;var _0x2a8e70=_0xdb28[_0x3db190];return _0x2a8e70;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index f68be16..aea49bf 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 _0x3a05=['stringify','issuetype','fields','customfield_11500','customfield_11501','customfield_11502','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','utf8','data','end','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','socket','remoteAddress','connection','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description'];(function(_0xa0676d,_0x346b38){var _0x323394=function(_0x92c800){while(--_0x92c800){_0xa0676d['push'](_0xa0676d['shift']());}};_0x323394(++_0x346b38);}(_0x3a05,0x181));var _0x53a0=function(_0x48e6ae,_0x588b8c){_0x48e6ae=_0x48e6ae-0x0;var _0x5dde11=_0x3a05[_0x48e6ae];return _0x5dde11;};'use strict';var BPromise=require(_0x53a0('0x0'));var https=require(_0x53a0('0x1'));var logger=require(_0x53a0('0x2'))(_0x53a0('0x3'));var USERNAME=_0x53a0('0x4');var PASSWORD=_0x53a0('0x5');function openIssue(_0x48b559,_0x2b0d36){var _0x414c32={'fields':{'project':{'key':_0x48b559[_0x53a0('0x6')]||'MOTGUI'},'summary':(_0x48b559[_0x53a0('0x7')]||_0x53a0('0x8'))+_0x53a0('0x9')+_0x48b559['ip'],'description':_0x48b559[_0x53a0('0xa')]||JSON[_0x53a0('0xb')](_0x48b559),'issuetype':{'name':_0x48b559[_0x53a0('0xc')]||'Bug'}}};_0x414c32[_0x53a0('0xd')][_0x53a0('0xe')]=_0x48b559['email'];_0x414c32[_0x53a0('0xd')][_0x53a0('0xf')]=_0x48b559['oldToken'];_0x414c32[_0x53a0('0xd')][_0x53a0('0x10')]=_0x48b559['newToken'];_0x414c32[_0x53a0('0xd')][_0x53a0('0x11')]=_0x48b559[_0x53a0('0x12')];_0x414c32[_0x53a0('0xd')][_0x53a0('0x13')]=_0x48b559[_0x53a0('0x14')];_0x414c32[_0x53a0('0xd')][_0x53a0('0x15')]=_0x48b559['ip'];var _0x5c666e={'host':_0x53a0('0x16'),'port':0x1bb,'path':_0x53a0('0x17'),'method':_0x53a0('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0x53a0('0x19'),'Authorization':_0x53a0('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0x53a0('0x1b')](_0x53a0('0x1c'))}};var _0x54d733=JSON[_0x53a0('0xb')](_0x414c32);var _0x8221ed=https['request'](_0x5c666e,function(_0x8acf93){_0x8acf93['setEncoding'](_0x53a0('0x1d'));var _0x1b451b='';_0x8acf93['on'](_0x53a0('0x1e'),function(_0x312283){_0x1b451b+=_0x312283;});_0x8acf93['on'](_0x53a0('0x1f'),function(){if(_0x2b0d36){return _0x2b0d36['status'](_0x8acf93[_0x53a0('0x20')])[_0x53a0('0x21')](JSON[_0x53a0('0x22')](_0x1b451b));}});});_0x8221ed['on']('error',function(_0x50abcb){if(_0x2b0d36){return _0x2b0d36['status'](0x1f4)['json']({'errors':[{'message':_0x53a0('0x23'),'type':_0x53a0('0x24')}]});}});_0x8221ed[_0x53a0('0x25')](_0x54d733);_0x8221ed[_0x53a0('0x1f')]();}exports[_0x53a0('0x26')]=openIssue;exports['send']=function(_0x3f3d64,_0x537fa6){_0x3f3d64[_0x53a0('0x27')]['ip']=_0x3f3d64[_0x53a0('0x28')]['x-forwarded-for']||_0x3f3d64['connection']['remoteAddress']||_0x3f3d64[_0x53a0('0x29')][_0x53a0('0x2a')]||_0x3f3d64[_0x53a0('0x2b')][_0x53a0('0x29')][_0x53a0('0x2a')];return openIssue(_0x3f3d64[_0x53a0('0x27')],_0x537fa6);}; \ No newline at end of file +var _0xdb36=['send','body','headers','socket','remoteAddress','connection','bluebird','https','support','3eAmWpBVP0','key','summary','Report','description','stringify','issuetype','Bug','fields','customfield_11501','newToken','name','customfield_11504','reason','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','utf8','data','end','parse','status','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue'];(function(_0x3a2eef,_0x3d963c){var _0x2aeb68=function(_0x9a0406){while(--_0x9a0406){_0x3a2eef['push'](_0x3a2eef['shift']());}};_0x2aeb68(++_0x3d963c);}(_0xdb36,0x1b3));var _0x6db3=function(_0x2d786e,_0x3b6a20){_0x2d786e=_0x2d786e-0x0;var _0x2e7c20=_0xdb36[_0x2d786e];return _0x2e7c20;};'use strict';var BPromise=require(_0x6db3('0x0'));var https=require(_0x6db3('0x1'));var logger=require('../../config/logger')('api');var USERNAME=_0x6db3('0x2');var PASSWORD=_0x6db3('0x3');function openIssue(_0x5ef00e,_0x4a26d5){var _0x379363={'fields':{'project':{'key':_0x5ef00e[_0x6db3('0x4')]||'MOTGUI'},'summary':(_0x5ef00e[_0x6db3('0x5')]||_0x6db3('0x6'))+'\x20from\x20'+_0x5ef00e['ip'],'description':_0x5ef00e[_0x6db3('0x7')]||JSON[_0x6db3('0x8')](_0x5ef00e),'issuetype':{'name':_0x5ef00e[_0x6db3('0x9')]||_0x6db3('0xa')}}};_0x379363['fields']['customfield_11500']=_0x5ef00e['email'];_0x379363[_0x6db3('0xb')][_0x6db3('0xc')]=_0x5ef00e['oldToken'];_0x379363[_0x6db3('0xb')]['customfield_11502']=_0x5ef00e[_0x6db3('0xd')];_0x379363[_0x6db3('0xb')]['customfield_11503']=_0x5ef00e[_0x6db3('0xe')];_0x379363[_0x6db3('0xb')][_0x6db3('0xf')]=_0x5ef00e[_0x6db3('0x10')];_0x379363[_0x6db3('0xb')]['customfield_10102']=_0x5ef00e['ip'];var _0x105508={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x6db3('0x11'),'method':_0x6db3('0x12'),'timeout':0x4e20,'headers':{'Content-Type':_0x6db3('0x13'),'Authorization':_0x6db3('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0x6db3('0x15')](_0x6db3('0x16'))}};var _0x4b0f38=JSON[_0x6db3('0x8')](_0x379363);var _0xd6e25=https['request'](_0x105508,function(_0x41b901){_0x41b901['setEncoding'](_0x6db3('0x17'));var _0x4a2f1f='';_0x41b901['on'](_0x6db3('0x18'),function(_0x5be156){_0x4a2f1f+=_0x5be156;});_0x41b901['on'](_0x6db3('0x19'),function(){if(_0x4a26d5){return _0x4a26d5['status'](_0x41b901['statusCode'])['json'](JSON[_0x6db3('0x1a')](_0x4a2f1f));}});});_0xd6e25['on']('error',function(_0x31f14b){if(_0x4a26d5){return _0x4a26d5[_0x6db3('0x1b')](0x1f4)[_0x6db3('0x1c')]({'errors':[{'message':_0x6db3('0x1d'),'type':_0x6db3('0x1e')}]});}});_0xd6e25[_0x6db3('0x1f')](_0x4b0f38);_0xd6e25[_0x6db3('0x19')]();}exports[_0x6db3('0x20')]=openIssue;exports[_0x6db3('0x21')]=function(_0x2ecee6,_0x35a517){_0x2ecee6[_0x6db3('0x22')]['ip']=_0x2ecee6[_0x6db3('0x23')]['x-forwarded-for']||_0x2ecee6['connection']['remoteAddress']||_0x2ecee6[_0x6db3('0x24')][_0x6db3('0x25')]||_0x2ecee6[_0x6db3('0x26')][_0x6db3('0x24')][_0x6db3('0x25')];return openIssue(_0x2ecee6['body'],_0x35a517);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index eab996d..2efa660 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 _0x6324=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','create','put','/:id','update','delete','exports','multer','util'];(function(_0x2d70f9,_0x2de2fc){var _0x791f50=function(_0x326056){while(--_0x326056){_0x2d70f9['push'](_0x2d70f9['shift']());}};_0x791f50(++_0x2de2fc);}(_0x6324,0x142));var _0x4632=function(_0x45c536,_0x52a556){_0x45c536=_0x45c536-0x0;var _0x10e06d=_0x6324[_0x45c536];return _0x10e06d;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/describe',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4632('0xc')]);router[_0x4632('0xd')](_0x4632('0xe'),auth[_0x4632('0x8')](),controller[_0x4632('0xf')]);router[_0x4632('0x10')](_0x4632('0xe'),auth[_0x4632('0x8')](),controller['destroy']);module[_0x4632('0x11')]=router; \ No newline at end of file +var _0x99e9=['update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x105ecd,_0x48e264){var _0xabd52e=function(_0x567c80){while(--_0x567c80){_0x105ecd['push'](_0x105ecd['shift']());}};_0xabd52e(++_0x48e264);}(_0x99e9,0xb4));var _0x999e=function(_0x11fb16,_0x29a381){_0x11fb16=_0x11fb16-0x0;var _0x343de1=_0x99e9[_0x11fb16];return _0x343de1;};'use strict';var multer=require('multer');var util=require(_0x999e('0x0'));var path=require(_0x999e('0x1'));var timeout=require(_0x999e('0x2'));var express=require(_0x999e('0x3'));var router=express['Router']();var fs_extra=require(_0x999e('0x4'));var auth=require(_0x999e('0x5'));var interaction=require(_0x999e('0x6'));var config=require('../../config/environment');var controller=require(_0x999e('0x7'));router['get']('/',auth[_0x999e('0x8')](),controller[_0x999e('0x9')]);router[_0x999e('0xa')](_0x999e('0xb'),auth['isAuthenticated'](),controller[_0x999e('0xc')]);router[_0x999e('0xa')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0xe')]);router[_0x999e('0xf')]('/',auth[_0x999e('0x8')](),controller[_0x999e('0x10')]);router[_0x999e('0x11')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0x12')]);router[_0x999e('0x13')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0x14')]);module[_0x999e('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index b1b70d3..e7b4915 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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7a54,0x106));var _0x47a5=function(_0x40bb62,_0x2b7a8e){_0x40bb62=_0x40bb62-0x0;var _0x1452e0=_0x7a54[_0x40bb62];return _0x1452e0;};'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(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0x516621,_0x5e4df5){_0x516621=_0x516621-0x0;var _0x3dd527=_0x7a54[_0x516621];return _0x3dd527;};'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 4e1ad50..bbaf288 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 _0x3c6c=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','JscriptyAnswerReport','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x561e73,_0x13a224){var _0x2dc60d=function(_0xe87c37){while(--_0xe87c37){_0x561e73['push'](_0x561e73['shift']());}};_0x2dc60d(++_0x13a224);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x56f413,_0x31a8d0){_0x56f413=_0x56f413-0x0;var _0x37a46b=_0x3c6c[_0x56f413];return _0x37a46b;};'use strict';var emlformat=require(_0xc3c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc3c6('0x1'));var jsonpatch=require(_0xc3c6('0x2'));var rp=require(_0xc3c6('0x3'));var moment=require(_0xc3c6('0x4'));var BPromise=require(_0xc3c6('0x5'));var Mustache=require(_0xc3c6('0x6'));var util=require(_0xc3c6('0x7'));var path=require(_0xc3c6('0x8'));var sox=require('sox');var csv=require(_0xc3c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc3c6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c6('0x9'));var querystring=require(_0xc3c6('0xb'));var Papa=require('papaparse');var Redis=require(_0xc3c6('0xc'));var authService=require(_0xc3c6('0xd'));var qs=require(_0xc3c6('0xe'));var as=require(_0xc3c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3c6('0x10'))(_0xc3c6('0x11'));var utils=require(_0xc3c6('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc3c6('0x13'))['db'];function respondWithStatusCode(_0x407147,_0x1d18e3){_0x1d18e3=_0x1d18e3||0xcc;return function(_0x648a0){if(_0x648a0){return _0x407147[_0xc3c6('0x14')](_0x1d18e3);}return _0x407147[_0xc3c6('0x15')](_0x1d18e3)[_0xc3c6('0x16')]();};}function respondWithResult(_0x28a431,_0x34eeeb){_0x34eeeb=_0x34eeeb||0xc8;return function(_0x55c1d8){if(_0x55c1d8){return _0x28a431[_0xc3c6('0x15')](_0x34eeeb)[_0xc3c6('0x17')](_0x55c1d8);}};}function respondWithFilteredResult(_0x37a6a8,_0x25d2bd){return function(_0x283506){if(_0x283506){var _0x42c631=typeof _0x25d2bd[_0xc3c6('0x18')]===_0xc3c6('0x19')&&typeof _0x25d2bd[_0xc3c6('0x1a')]===_0xc3c6('0x19');var _0x64c62a=_0x283506[_0xc3c6('0x1b')];var _0x26c9b0=_0x42c631?0x0:_0x25d2bd[_0xc3c6('0x18')];var _0x3003e1=_0x42c631?_0x283506[_0xc3c6('0x1b')]:_0x25d2bd['offset']+_0x25d2bd[_0xc3c6('0x1a')];var _0x5a2456;if(_0x3003e1>=_0x64c62a){_0x3003e1=_0x64c62a;_0x5a2456=0xc8;}else{_0x5a2456=0xce;}_0x37a6a8[_0xc3c6('0x15')](_0x5a2456);return _0x37a6a8[_0xc3c6('0x1c')](_0xc3c6('0x1d'),_0x26c9b0+'-'+_0x3003e1+'/'+_0x64c62a)[_0xc3c6('0x17')](_0x283506);}return null;};}function patchUpdates(_0xfe2f70){return function(_0x3490a2){try{jsonpatch[_0xc3c6('0x1e')](_0x3490a2,_0xfe2f70,!![]);}catch(_0x22aa76){return BPromise[_0xc3c6('0x1f')](_0x22aa76);}return _0x3490a2[_0xc3c6('0x20')]();};}function saveUpdates(_0x2a99a0,_0x392d20){return function(_0x3d03b0){if(_0x3d03b0){return _0x3d03b0[_0xc3c6('0x21')](_0x2a99a0)['then'](function(_0x24fb2d){return _0x24fb2d;});}return null;};}function removeEntity(_0x40893b,_0x2bced6){return function(_0x565a86){if(_0x565a86){return _0x565a86[_0xc3c6('0x22')]()[_0xc3c6('0x23')](function(){_0x40893b[_0xc3c6('0x15')](0xcc)[_0xc3c6('0x16')]();});}};}function handleEntityNotFound(_0x2bc9bf,_0x47808f){return function(_0x1a0e3b){if(!_0x1a0e3b){_0x2bc9bf['sendStatus'](0x194);}return _0x1a0e3b;};}function handleError(_0x104e80,_0x13b909){_0x13b909=_0x13b909||0x1f4;return function(_0x4ca76f){logger[_0xc3c6('0x24')](_0x4ca76f[_0xc3c6('0x25')]);if(_0x4ca76f[_0xc3c6('0x26')]){delete _0x4ca76f[_0xc3c6('0x26')];}_0x104e80[_0xc3c6('0x15')](_0x13b909)[_0xc3c6('0x27')](_0x4ca76f);};}exports[_0xc3c6('0x28')]=function(_0x2e4094,_0x1f1d36){var _0x478a4b={},_0xb047b1={},_0x4571f4={'count':0x0,'rows':[]};var _0x31975e=_[_0xc3c6('0x29')](db['JscriptyAnswerReport'][_0xc3c6('0x2a')],function(_0x1bcc34){return{'name':_0x1bcc34[_0xc3c6('0x2b')],'type':_0x1bcc34[_0xc3c6('0x2c')][_0xc3c6('0x2d')]};});_0xb047b1[_0xc3c6('0x2e')]=_['map'](_0x31975e,_0xc3c6('0x26'));_0xb047b1[_0xc3c6('0x2f')]=_[_0xc3c6('0x30')](_0x2e4094[_0xc3c6('0x2f')]);_0xb047b1[_0xc3c6('0x31')]=_['intersection'](_0xb047b1[_0xc3c6('0x2e')],_0xb047b1[_0xc3c6('0x2f')]);_0x478a4b[_0xc3c6('0x32')]=_[_0xc3c6('0x33')](_0xb047b1[_0xc3c6('0x2e')],qs[_0xc3c6('0x34')](_0x2e4094[_0xc3c6('0x2f')]['fields']));_0x478a4b[_0xc3c6('0x32')]=_0x478a4b['attributes'][_0xc3c6('0x35')]?_0x478a4b[_0xc3c6('0x32')]:_0xb047b1[_0xc3c6('0x2e')];if(!_0x2e4094[_0xc3c6('0x2f')][_0xc3c6('0x36')](_0xc3c6('0x37'))){_0x478a4b['limit']=qs[_0xc3c6('0x1a')](_0x2e4094[_0xc3c6('0x2f')]['limit']);_0x478a4b[_0xc3c6('0x18')]=qs[_0xc3c6('0x18')](_0x2e4094[_0xc3c6('0x2f')][_0xc3c6('0x18')]);}_0x478a4b[_0xc3c6('0x38')]=qs[_0xc3c6('0x39')](_0x2e4094[_0xc3c6('0x2f')]['sort']);_0x478a4b['where']=qs[_0xc3c6('0x31')](_[_0xc3c6('0x3a')](_0x2e4094[_0xc3c6('0x2f')],_0xb047b1[_0xc3c6('0x31')]),_0x31975e);if(_0x2e4094[_0xc3c6('0x2f')]['filter']){_0x478a4b[_0xc3c6('0x3b')]=_[_0xc3c6('0x3c')](_0x478a4b[_0xc3c6('0x3b')],{'$or':_[_0xc3c6('0x29')](_0x31975e,function(_0x1eb423){if(_0x1eb423[_0xc3c6('0x2c')]!==_0xc3c6('0x3d')){var _0xada6f={};_0xada6f[_0x1eb423[_0xc3c6('0x26')]]={'$like':'%'+_0x2e4094['query'][_0xc3c6('0x3e')]+'%'};return _0xada6f;}})});}_0x478a4b=_[_0xc3c6('0x3c')]({},_0x478a4b,_0x2e4094[_0xc3c6('0x3f')]);var _0x316605={'where':_0x478a4b[_0xc3c6('0x3b')]};return db[_0xc3c6('0x40')][_0xc3c6('0x1b')](_0x316605)[_0xc3c6('0x23')](function(_0x59b2d9){_0x4571f4[_0xc3c6('0x1b')]=_0x59b2d9;if(_0x2e4094[_0xc3c6('0x2f')]['includeAll']){_0x478a4b[_0xc3c6('0x41')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xc3c6('0x42')](_0x478a4b);})[_0xc3c6('0x23')](function(_0x25bb1e){_0x4571f4[_0xc3c6('0x43')]=_0x25bb1e;return _0x4571f4;})[_0xc3c6('0x23')](respondWithFilteredResult(_0x1f1d36,_0x478a4b))[_0xc3c6('0x44')](handleError(_0x1f1d36,null));};exports[_0xc3c6('0x45')]=function(_0x998388,_0x572339){var _0xda8652={'raw':!![],'where':{'id':_0x998388[_0xc3c6('0x46')]['id']}},_0x570d11={};_0x570d11[_0xc3c6('0x2e')]=_[_0xc3c6('0x30')](db[_0xc3c6('0x40')]['rawAttributes']);_0x570d11['query']=_[_0xc3c6('0x30')](_0x998388[_0xc3c6('0x2f')]);_0x570d11[_0xc3c6('0x31')]=_[_0xc3c6('0x33')](_0x570d11['model'],_0x570d11[_0xc3c6('0x2f')]);_0xda8652[_0xc3c6('0x32')]=_[_0xc3c6('0x33')](_0x570d11[_0xc3c6('0x2e')],qs[_0xc3c6('0x34')](_0x998388[_0xc3c6('0x2f')][_0xc3c6('0x34')]));_0xda8652['attributes']=_0xda8652['attributes'][_0xc3c6('0x35')]?_0xda8652[_0xc3c6('0x32')]:_0x570d11['model'];if(_0x998388[_0xc3c6('0x2f')][_0xc3c6('0x47')]){_0xda8652['include']=[{'all':!![]}];}_0xda8652=_[_0xc3c6('0x3c')]({},_0xda8652,_0x998388[_0xc3c6('0x3f')]);return db['JscriptyAnswerReport'][_0xc3c6('0x48')](_0xda8652)[_0xc3c6('0x23')](handleEntityNotFound(_0x572339,null))[_0xc3c6('0x23')](respondWithResult(_0x572339,null))[_0xc3c6('0x44')](handleError(_0x572339,null));};exports[_0xc3c6('0x49')]=function(_0x333698,_0x508731){return db[_0xc3c6('0x40')][_0xc3c6('0x49')](_0x333698[_0xc3c6('0x4a')],{})[_0xc3c6('0x23')](respondWithResult(_0x508731,0xc9))[_0xc3c6('0x44')](handleError(_0x508731,null));};exports[_0xc3c6('0x21')]=function(_0x21b8a0,_0x55b8bc){if(_0x21b8a0['body']['id']){delete _0x21b8a0[_0xc3c6('0x4a')]['id'];}return db[_0xc3c6('0x40')][_0xc3c6('0x48')]({'where':{'id':_0x21b8a0[_0xc3c6('0x46')]['id']}})['then'](handleEntityNotFound(_0x55b8bc,null))['then'](saveUpdates(_0x21b8a0[_0xc3c6('0x4a')],null))[_0xc3c6('0x23')](respondWithResult(_0x55b8bc,null))[_0xc3c6('0x44')](handleError(_0x55b8bc,null));};exports[_0xc3c6('0x22')]=function(_0x34ed73,_0x313277){return db[_0xc3c6('0x40')][_0xc3c6('0x48')]({'where':{'id':_0x34ed73[_0xc3c6('0x46')]['id']}})[_0xc3c6('0x23')](handleEntityNotFound(_0x313277,null))[_0xc3c6('0x23')](removeEntity(_0x313277,null))[_0xc3c6('0x44')](handleError(_0x313277,null));};exports[_0xc3c6('0x4b')]=function(_0xc84c69,_0xad293e){return db[_0xc3c6('0x40')]['describe']()[_0xc3c6('0x23')](respondWithResult(_0xad293e,null))[_0xc3c6('0x44')](handleError(_0xad293e,null));}; \ No newline at end of file +var _0xfc76=['send','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','end','error','stack','name'];(function(_0x29cf95,_0xba1b8){var _0x19885b=function(_0x4d30af){while(--_0x4d30af){_0x29cf95['push'](_0x29cf95['shift']());}};_0x19885b(++_0xba1b8);}(_0xfc76,0xb5));var _0x6fc7=function(_0x1d5004,_0x33e13){_0x1d5004=_0x1d5004-0x0;var _0x1205ba=_0xfc76[_0x1d5004];return _0x1205ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6fc7('0x0'));var zipdir=require(_0x6fc7('0x1'));var jsonpatch=require(_0x6fc7('0x2'));var rp=require(_0x6fc7('0x3'));var moment=require(_0x6fc7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6fc7('0x5'));var util=require(_0x6fc7('0x6'));var path=require('path');var sox=require(_0x6fc7('0x7'));var csv=require('to-csv');var ejs=require(_0x6fc7('0x8'));var fs=require('fs');var fs_extra=require(_0x6fc7('0x9'));var _=require(_0x6fc7('0xa'));var squel=require('squel');var crypto=require(_0x6fc7('0xb'));var jsforce=require(_0x6fc7('0xc'));var deskjs=require(_0x6fc7('0xd'));var toCsv=require(_0x6fc7('0xe'));var querystring=require(_0x6fc7('0xf'));var Papa=require(_0x6fc7('0x10'));var Redis=require('ioredis');var authService=require(_0x6fc7('0x11'));var qs=require(_0x6fc7('0x12'));var as=require(_0x6fc7('0x13'));var hardwareService=require(_0x6fc7('0x14'));var logger=require(_0x6fc7('0x15'))(_0x6fc7('0x16'));var utils=require('../../config/utils');var config=require(_0x6fc7('0x17'));var licenseUtil=require(_0x6fc7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x433adc,_0x2c32b8){_0x2c32b8=_0x2c32b8||0xcc;return function(_0x5f438d){if(_0x5f438d){return _0x433adc[_0x6fc7('0x19')](_0x2c32b8);}return _0x433adc[_0x6fc7('0x1a')](_0x2c32b8)['end']();};}function respondWithResult(_0x44d8e0,_0x3c107f){_0x3c107f=_0x3c107f||0xc8;return function(_0x10a482){if(_0x10a482){return _0x44d8e0['status'](_0x3c107f)['json'](_0x10a482);}};}function respondWithFilteredResult(_0xbb4a3e,_0x45d585){return function(_0x499bcc){if(_0x499bcc){var _0x2b0122=typeof _0x45d585[_0x6fc7('0x1b')]===_0x6fc7('0x1c')&&typeof _0x45d585[_0x6fc7('0x1d')]==='undefined';var _0x816704=_0x499bcc[_0x6fc7('0x1e')];var _0x280c69=_0x2b0122?0x0:_0x45d585[_0x6fc7('0x1b')];var _0x12be21=_0x2b0122?_0x499bcc[_0x6fc7('0x1e')]:_0x45d585['offset']+_0x45d585[_0x6fc7('0x1d')];var _0x124893;if(_0x12be21>=_0x816704){_0x12be21=_0x816704;_0x124893=0xc8;}else{_0x124893=0xce;}_0xbb4a3e[_0x6fc7('0x1a')](_0x124893);return _0xbb4a3e[_0x6fc7('0x1f')](_0x6fc7('0x20'),_0x280c69+'-'+_0x12be21+'/'+_0x816704)['json'](_0x499bcc);}return null;};}function patchUpdates(_0x277f9e){return function(_0x2427a){try{jsonpatch['apply'](_0x2427a,_0x277f9e,!![]);}catch(_0x17b9e3){return BPromise['reject'](_0x17b9e3);}return _0x2427a[_0x6fc7('0x21')]();};}function saveUpdates(_0x4f583c,_0x11b359){return function(_0xdb5974){if(_0xdb5974){return _0xdb5974[_0x6fc7('0x22')](_0x4f583c)['then'](function(_0x45e53e){return _0x45e53e;});}return null;};}function removeEntity(_0x4a4cdf,_0x2dd21a){return function(_0xdd4827){if(_0xdd4827){return _0xdd4827[_0x6fc7('0x23')]()[_0x6fc7('0x24')](function(){_0x4a4cdf[_0x6fc7('0x1a')](0xcc)[_0x6fc7('0x25')]();});}};}function handleEntityNotFound(_0x190680,_0x817221){return function(_0x2b6b55){if(!_0x2b6b55){_0x190680[_0x6fc7('0x19')](0x194);}return _0x2b6b55;};}function handleError(_0xaa2687,_0x426872){_0x426872=_0x426872||0x1f4;return function(_0x4612d4){logger[_0x6fc7('0x26')](_0x4612d4[_0x6fc7('0x27')]);if(_0x4612d4['name']){delete _0x4612d4[_0x6fc7('0x28')];}_0xaa2687[_0x6fc7('0x1a')](_0x426872)[_0x6fc7('0x29')](_0x4612d4);};}exports[_0x6fc7('0x2a')]=function(_0x5c1fd3,_0xfff989){var _0x30e579={},_0xa93a4f={},_0x2aa91c={'count':0x0,'rows':[]};var _0x34bf7f=_[_0x6fc7('0x2b')](db[_0x6fc7('0x2c')][_0x6fc7('0x2d')],function(_0x59a70e){return{'name':_0x59a70e['fieldName'],'type':_0x59a70e[_0x6fc7('0x2e')][_0x6fc7('0x2f')]};});_0xa93a4f[_0x6fc7('0x30')]=_[_0x6fc7('0x2b')](_0x34bf7f,_0x6fc7('0x28'));_0xa93a4f[_0x6fc7('0x31')]=_['keys'](_0x5c1fd3[_0x6fc7('0x31')]);_0xa93a4f[_0x6fc7('0x32')]=_[_0x6fc7('0x33')](_0xa93a4f[_0x6fc7('0x30')],_0xa93a4f['query']);_0x30e579['attributes']=_['intersection'](_0xa93a4f[_0x6fc7('0x30')],qs[_0x6fc7('0x34')](_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x34')]));_0x30e579[_0x6fc7('0x35')]=_0x30e579[_0x6fc7('0x35')][_0x6fc7('0x36')]?_0x30e579[_0x6fc7('0x35')]:_0xa93a4f[_0x6fc7('0x30')];if(!_0x5c1fd3['query'][_0x6fc7('0x37')]('nolimit')){_0x30e579[_0x6fc7('0x1d')]=qs[_0x6fc7('0x1d')](_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x1d')]);_0x30e579['offset']=qs[_0x6fc7('0x1b')](_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x1b')]);}_0x30e579[_0x6fc7('0x38')]=qs['sort'](_0x5c1fd3[_0x6fc7('0x31')]['sort']);_0x30e579[_0x6fc7('0x39')]=qs['filters'](_['pick'](_0x5c1fd3['query'],_0xa93a4f[_0x6fc7('0x32')]),_0x34bf7f);if(_0x5c1fd3['query'][_0x6fc7('0x3a')]){_0x30e579[_0x6fc7('0x39')]=_[_0x6fc7('0x3b')](_0x30e579[_0x6fc7('0x39')],{'$or':_[_0x6fc7('0x2b')](_0x34bf7f,function(_0xc1fbf7){if(_0xc1fbf7[_0x6fc7('0x2e')]!==_0x6fc7('0x3c')){var _0x18e6f7={};_0x18e6f7[_0xc1fbf7[_0x6fc7('0x28')]]={'$like':'%'+_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x3a')]+'%'};return _0x18e6f7;}})});}_0x30e579=_[_0x6fc7('0x3b')]({},_0x30e579,_0x5c1fd3[_0x6fc7('0x3d')]);var _0x3ac76e={'where':_0x30e579[_0x6fc7('0x39')]};return db[_0x6fc7('0x2c')][_0x6fc7('0x1e')](_0x3ac76e)['then'](function(_0x490f2e){_0x2aa91c[_0x6fc7('0x1e')]=_0x490f2e;if(_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x3e')]){_0x30e579[_0x6fc7('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6fc7('0x40')](_0x30e579);})[_0x6fc7('0x24')](function(_0x27f6dc){_0x2aa91c[_0x6fc7('0x41')]=_0x27f6dc;return _0x2aa91c;})[_0x6fc7('0x24')](respondWithFilteredResult(_0xfff989,_0x30e579))[_0x6fc7('0x42')](handleError(_0xfff989,null));};exports[_0x6fc7('0x43')]=function(_0x4754da,_0x1e33cd){var _0x2d8ca4={'raw':!![],'where':{'id':_0x4754da[_0x6fc7('0x44')]['id']}},_0x20bc07={};_0x20bc07['model']=_[_0x6fc7('0x45')](db[_0x6fc7('0x2c')]['rawAttributes']);_0x20bc07[_0x6fc7('0x31')]=_[_0x6fc7('0x45')](_0x4754da[_0x6fc7('0x31')]);_0x20bc07[_0x6fc7('0x32')]=_[_0x6fc7('0x33')](_0x20bc07[_0x6fc7('0x30')],_0x20bc07[_0x6fc7('0x31')]);_0x2d8ca4[_0x6fc7('0x35')]=_[_0x6fc7('0x33')](_0x20bc07[_0x6fc7('0x30')],qs['fields'](_0x4754da[_0x6fc7('0x31')][_0x6fc7('0x34')]));_0x2d8ca4['attributes']=_0x2d8ca4['attributes'][_0x6fc7('0x36')]?_0x2d8ca4[_0x6fc7('0x35')]:_0x20bc07[_0x6fc7('0x30')];if(_0x4754da['query'][_0x6fc7('0x3e')]){_0x2d8ca4[_0x6fc7('0x3f')]=[{'all':!![]}];}_0x2d8ca4=_['merge']({},_0x2d8ca4,_0x4754da[_0x6fc7('0x3d')]);return db[_0x6fc7('0x2c')][_0x6fc7('0x46')](_0x2d8ca4)[_0x6fc7('0x24')](handleEntityNotFound(_0x1e33cd,null))[_0x6fc7('0x24')](respondWithResult(_0x1e33cd,null))[_0x6fc7('0x42')](handleError(_0x1e33cd,null));};exports[_0x6fc7('0x47')]=function(_0xb6cf9b,_0x357d7a){return db[_0x6fc7('0x2c')][_0x6fc7('0x47')](_0xb6cf9b['body'],{})['then'](respondWithResult(_0x357d7a,0xc9))['catch'](handleError(_0x357d7a,null));};exports['update']=function(_0x22a0c5,_0x5d4d40){if(_0x22a0c5[_0x6fc7('0x48')]['id']){delete _0x22a0c5[_0x6fc7('0x48')]['id'];}return db[_0x6fc7('0x2c')][_0x6fc7('0x46')]({'where':{'id':_0x22a0c5[_0x6fc7('0x44')]['id']}})[_0x6fc7('0x24')](handleEntityNotFound(_0x5d4d40,null))['then'](saveUpdates(_0x22a0c5[_0x6fc7('0x48')],null))[_0x6fc7('0x24')](respondWithResult(_0x5d4d40,null))['catch'](handleError(_0x5d4d40,null));};exports[_0x6fc7('0x23')]=function(_0x24bf3e,_0x3b2506){return db[_0x6fc7('0x2c')][_0x6fc7('0x46')]({'where':{'id':_0x24bf3e[_0x6fc7('0x44')]['id']}})[_0x6fc7('0x24')](handleEntityNotFound(_0x3b2506,null))[_0x6fc7('0x24')](removeEntity(_0x3b2506,null))[_0x6fc7('0x42')](handleError(_0x3b2506,null));};exports[_0x6fc7('0x49')]=function(_0x4ced40,_0x4684bd){return db[_0x6fc7('0x2c')][_0x6fc7('0x49')]()['then'](respondWithResult(_0x4684bd,null))[_0x6fc7('0x42')](handleError(_0x4684bd,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 6edabb4..f8a15f8 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 _0xd73a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define'];(function(_0x178b17,_0x5d5276){var _0x33e923=function(_0x4ed0b3){while(--_0x4ed0b3){_0x178b17['push'](_0x178b17['shift']());}};_0x33e923(++_0x5d5276);}(_0xd73a,0x1ee));var _0xad73=function(_0x44bb59,_0x47f897){_0x44bb59=_0x44bb59-0x0;var _0x1c96b5=_0xd73a[_0x44bb59];return _0x1c96b5;};'use strict';var _=require(_0xad73('0x0'));var util=require(_0xad73('0x1'));var logger=require(_0xad73('0x2'))(_0xad73('0x3'));var moment=require(_0xad73('0x4'));var BPromise=require(_0xad73('0x5'));var rp=require(_0xad73('0x6'));var fs=require('fs');var path=require(_0xad73('0x7'));var rimraf=require(_0xad73('0x8'));var config=require(_0xad73('0x9'));var attributes=require(_0xad73('0xa'));module[_0xad73('0xb')]=function(_0x297397,_0x22fd2d){return _0x297397[_0xad73('0xc')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa737=['path','rimraf','../../config/environment','exports','define','JscriptyAnswerReport','report_jscripty_answers','api','moment','request-promise'];(function(_0x1349cc,_0x4b418d){var _0x1ffe5b=function(_0x12d068){while(--_0x12d068){_0x1349cc['push'](_0x1349cc['shift']());}};_0x1ffe5b(++_0x4b418d);}(_0xa737,0x133));var _0x7a73=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xa737[_0x45b034];return _0x509cb0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7a73('0x0'));var moment=require(_0x7a73('0x1'));var BPromise=require('bluebird');var rp=require(_0x7a73('0x2'));var fs=require('fs');var path=require(_0x7a73('0x3'));var rimraf=require(_0x7a73('0x4'));var config=require(_0x7a73('0x5'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x7a73('0x6')]=function(_0x19476c,_0x362e0b){return _0x19476c[_0x7a73('0x7')](_0x7a73('0x8'),attributes,{'tableName':_0x7a73('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 d786db6..8604c20 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 _0x8d13=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','JscriptyAnswerReport,\x20%s,\x20%s','debug'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x8d13,0xc5));var _0x38d1=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8d13[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x38d1('0x0'));var moment=require('moment');var BPromise=require(_0x38d1('0x1'));var rs=require(_0x38d1('0x2'));var fs=require('fs');var Redis=require(_0x38d1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x38d1('0x4'));var logger=require(_0x38d1('0x5'))(_0x38d1('0x6'));var config=require(_0x38d1('0x7'));var jayson=require(_0x38d1('0x8'));var client=jayson['client'][_0x38d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x338167,_0x34eee7,_0x2a2e3f){return new BPromise(function(_0xf85210,_0x4cb218){return client['request'](_0x338167,_0x2a2e3f)[_0x38d1('0xa')](function(_0x3b10ec){logger['info'](_0x38d1('0xb'),_0x34eee7,'request\x20sent');logger[_0x38d1('0xc')](_0x38d1('0xd'),_0x34eee7,_0x38d1('0xe'),JSON[_0x38d1('0xf')](_0x3b10ec));if(_0x3b10ec[_0x38d1('0x10')]){if(_0x3b10ec['error'][_0x38d1('0x11')]===0x1f4){logger[_0x38d1('0x10')](_0x38d1('0xb'),_0x34eee7,_0x3b10ec[_0x38d1('0x10')][_0x38d1('0x12')]);return _0x4cb218(_0x3b10ec[_0x38d1('0x10')][_0x38d1('0x12')]);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x34eee7,_0x3b10ec['error'][_0x38d1('0x12')]);return _0xf85210(_0x3b10ec[_0x38d1('0x10')]['message']);}else{logger[_0x38d1('0x13')](_0x38d1('0xb'),_0x34eee7,_0x38d1('0xe'));_0xf85210(_0x3b10ec[_0x38d1('0x14')][_0x38d1('0x12')]);}})['catch'](function(_0x4290a6){logger[_0x38d1('0x10')](_0x38d1('0xb'),_0x34eee7,_0x4290a6);_0x4cb218(_0x4290a6);});});} \ No newline at end of file +var _0xff26=['../../config/environment','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x54ec06,_0x15e92e){var _0x41792d=function(_0x5abd6e){while(--_0x5abd6e){_0x54ec06['push'](_0x54ec06['shift']());}};_0x41792d(++_0x15e92e);}(_0xff26,0x14f));var _0x6ff2=function(_0x3a0f77,_0x39f605){_0x3a0f77=_0x3a0f77-0x0;var _0x54fd0c=_0xff26[_0x3a0f77];return _0x54fd0c;};'use strict';var _=require(_0x6ff2('0x0'));var util=require(_0x6ff2('0x1'));var moment=require(_0x6ff2('0x2'));var BPromise=require(_0x6ff2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ff2('0x4'));var db=require(_0x6ff2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ff2('0x6'))('rpc');var config=require(_0x6ff2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6ff2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494694,_0x159700,_0x31642b){return new BPromise(function(_0x542305,_0x352990){return client[_0x6ff2('0x9')](_0x494694,_0x31642b)[_0x6ff2('0xa')](function(_0x8669f8){logger[_0x6ff2('0xb')](_0x6ff2('0xc'),_0x159700,_0x6ff2('0xd'));logger[_0x6ff2('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x159700,_0x6ff2('0xd'),JSON['stringify'](_0x8669f8));if(_0x8669f8[_0x6ff2('0xf')]){if(_0x8669f8['error'][_0x6ff2('0x10')]===0x1f4){logger['error'](_0x6ff2('0xc'),_0x159700,_0x8669f8[_0x6ff2('0xf')]['message']);return _0x352990(_0x8669f8[_0x6ff2('0xf')][_0x6ff2('0x11')]);}logger[_0x6ff2('0xf')](_0x6ff2('0xc'),_0x159700,_0x8669f8[_0x6ff2('0xf')]['message']);return _0x542305(_0x8669f8[_0x6ff2('0xf')]['message']);}else{logger[_0x6ff2('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x159700,_0x6ff2('0xd'));_0x542305(_0x8669f8[_0x6ff2('0x12')][_0x6ff2('0x11')]);}})['catch'](function(_0x49ed46){logger[_0x6ff2('0xf')](_0x6ff2('0xc'),_0x159700,_0x49ed46);_0x352990(_0x49ed46);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index d6bb79c..ac8e63f 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 _0x9311=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','getSummary','create','post','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x3c560a,_0x1c46d4){var _0x22e9be=function(_0xd72419){while(--_0xd72419){_0x3c560a['push'](_0x3c560a['shift']());}};_0x22e9be(++_0x1c46d4);}(_0x9311,0x1c3));var _0x1931=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9311[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x1931('0x0'));var util=require(_0x1931('0x1'));var path=require('path');var timeout=require(_0x1931('0x2'));var express=require(_0x1931('0x3'));var router=express['Router']();var fs_extra=require(_0x1931('0x4'));var auth=require(_0x1931('0x5'));var interaction=require(_0x1931('0x6'));var config=require(_0x1931('0x7'));var controller=require('./jscriptyProject.controller');router[_0x1931('0x8')]('/',auth[_0x1931('0x9')](),controller[_0x1931('0xa')]);router[_0x1931('0x8')]('/:id',auth[_0x1931('0x9')](),controller['show']);router['get'](_0x1931('0xb'),auth['isAuthenticated'](),controller[_0x1931('0xc')]);router[_0x1931('0x8')](_0x1931('0xd'),auth[_0x1931('0x9')](),controller['getAnswers']);router['get'](_0x1931('0xe'),auth['isAuthenticated'](),timeout(_0x1931('0xf')),controller[_0x1931('0x10')]);router['post']('/',auth[_0x1931('0x9')](),controller[_0x1931('0x11')]);router[_0x1931('0x12')]('/:id/clone',auth[_0x1931('0x9')](),controller['clone']);router[_0x1931('0x13')](_0x1931('0x14'),auth[_0x1931('0x9')](),controller['update']);router[_0x1931('0x15')](_0x1931('0x14'),auth[_0x1931('0x9')](),controller[_0x1931('0x16')]);module[_0x1931('0x17')]=router; \ No newline at end of file +var _0x169c=['index','get','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','update','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','./jscriptyProject.controller'];(function(_0x7c7a41,_0x11a170){var _0x5c09d3=function(_0x5dec92){while(--_0x5dec92){_0x7c7a41['push'](_0x7c7a41['shift']());}};_0x5c09d3(++_0x11a170);}(_0x169c,0x198));var _0xc169=function(_0x2a84d6,_0x538497){_0x2a84d6=_0x2a84d6-0x0;var _0x55c2ea=_0x169c[_0x2a84d6];return _0x55c2ea;};'use strict';var multer=require(_0xc169('0x0'));var util=require(_0xc169('0x1'));var path=require('path');var timeout=require(_0xc169('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc169('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc169('0x4'));var config=require('../../config/environment');var controller=require(_0xc169('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xc169('0x6')]);router[_0xc169('0x7')](_0xc169('0x8'),auth[_0xc169('0x9')](),controller[_0xc169('0xa')]);router[_0xc169('0x7')](_0xc169('0xb'),auth['isAuthenticated'](),controller[_0xc169('0xc')]);router[_0xc169('0x7')](_0xc169('0xd'),auth[_0xc169('0x9')](),controller[_0xc169('0xe')]);router[_0xc169('0x7')](_0xc169('0xf'),auth['isAuthenticated'](),timeout(_0xc169('0x10')),controller[_0xc169('0x11')]);router[_0xc169('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xc169('0x13'),auth[_0xc169('0x9')](),controller[_0xc169('0x14')]);router['put'](_0xc169('0x8'),auth['isAuthenticated'](),controller[_0xc169('0x15')]);router['delete']('/:id',auth[_0xc169('0x9')](),controller['destroy']);module[_0xc169('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 9cfd1f3..8127bbe 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 _0xeb49=['isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','util','STRING','isObjectLike','formData','stringify'];(function(_0x3fac24,_0x48cecd){var _0x229eee=function(_0x140535){while(--_0x140535){_0x3fac24['push'](_0x3fac24['shift']());}};_0x229eee(++_0x48cecd);}(_0xeb49,0x1e8));var _0x9eb4=function(_0x3f1252,_0x140d5d){_0x3f1252=_0x3f1252-0x0;var _0xfc41ee=_0xeb49[_0x3f1252];return _0xfc41ee;};'use strict';var Sequelize=require(_0x9eb4('0x0'));var _=require(_0x9eb4('0x1'));var util=require(_0x9eb4('0x2'));module['exports']={'name':{'type':Sequelize[_0x9eb4('0x3')],'unique':'name'},'description':{'type':Sequelize[_0x9eb4('0x3')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x46de3c){if(_[_0x9eb4('0x4')](_0x46de3c)){this['setDataValue'](_0x9eb4('0x5'),JSON[_0x9eb4('0x6')](_0x46de3c));}else if(_[_0x9eb4('0x7')](_0x46de3c)){this['setDataValue'](_0x9eb4('0x5'),_0x46de3c);}else{this[_0x9eb4('0x8')](_0x9eb4('0x5'),util[_0x9eb4('0x9')](_0x9eb4('0xa'),this[_0x9eb4('0xb')](_0x9eb4('0xc'))||'',this['getDataValue'](_0x9eb4('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x9eb4('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x2f3d=['BOOLEAN','sequelize','STRING','name','TEXT','long','isObjectLike','stringify','isString','formData','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x585ee5,_0x1c9dba){var _0x470808=function(_0x35c90d){while(--_0x35c90d){_0x585ee5['push'](_0x585ee5['shift']());}};_0x470808(++_0x1c9dba);}(_0x2f3d,0x1f0));var _0xd2f3=function(_0x14090d,_0x5179fe){_0x14090d=_0x14090d-0x0;var _0x3f4f81=_0x2f3d[_0x14090d];return _0x3f4f81;};'use strict';var Sequelize=require(_0xd2f3('0x0'));var _=require('lodash');var util=require('util');module['exports']={'name':{'type':Sequelize[_0xd2f3('0x1')],'unique':_0xd2f3('0x2')},'description':{'type':Sequelize[_0xd2f3('0x1')]},'formData':{'type':Sequelize[_0xd2f3('0x3')](_0xd2f3('0x4')),'set':function(_0x2f30e7){if(_[_0xd2f3('0x5')](_0x2f30e7)){this['setDataValue']('formData',JSON[_0xd2f3('0x6')](_0x2f30e7));}else if(_[_0xd2f3('0x7')](_0x2f30e7)){this['setDataValue'](_0xd2f3('0x8'),_0x2f30e7);}else{this[_0xd2f3('0x9')](_0xd2f3('0x8'),util[_0xd2f3('0xa')](_0xd2f3('0xb'),this[_0xd2f3('0xc')](_0xd2f3('0x2'))||'',this[_0xd2f3('0xc')](_0xd2f3('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xd2f3('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd2f3('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 49169f7..61caff0 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 _0x2d58=['ProjectId','number','fromCharCode','toString','indexOf','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','index','JscriptyProject','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Projects','UserProfileSection','userProfileId','clone','omit','createdAt','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','findAll','getAnswers','JscriptyAnswerReport'];(function(_0x199bc4,_0x338105){var _0x136ffb=function(_0x3e7ced){while(--_0x3e7ced){_0x199bc4['push'](_0x199bc4['shift']());}};_0x136ffb(++_0x338105);}(_0x2d58,0x186));var _0x82d5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2d58[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x82d5('0x0'));var rimraf=require(_0x82d5('0x1'));var zipdir=require(_0x82d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x82d5('0x3'));var moment=require('moment');var BPromise=require(_0x82d5('0x4'));var Mustache=require(_0x82d5('0x5'));var util=require(_0x82d5('0x6'));var path=require(_0x82d5('0x7'));var sox=require(_0x82d5('0x8'));var csv=require(_0x82d5('0x9'));var ejs=require(_0x82d5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82d5('0xb'));var squel=require(_0x82d5('0xc'));var crypto=require(_0x82d5('0xd'));var jsforce=require(_0x82d5('0xe'));var deskjs=require(_0x82d5('0xf'));var toCsv=require(_0x82d5('0x9'));var querystring=require(_0x82d5('0x10'));var Papa=require(_0x82d5('0x11'));var Redis=require(_0x82d5('0x12'));var authService=require(_0x82d5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x82d5('0x14'));var hardwareService=require(_0x82d5('0x15'));var logger=require(_0x82d5('0x16'))(_0x82d5('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x82d5('0x18'));var db=require(_0x82d5('0x19'))['db'];function respondWithStatusCode(_0x549d85,_0x14ccdc){_0x14ccdc=_0x14ccdc||0xcc;return function(_0x5c2d84){if(_0x5c2d84){return _0x549d85[_0x82d5('0x1a')](_0x14ccdc);}return _0x549d85[_0x82d5('0x1b')](_0x14ccdc)[_0x82d5('0x1c')]();};}function respondWithResult(_0x265753,_0x201e56){_0x201e56=_0x201e56||0xc8;return function(_0x3f26ff){if(_0x3f26ff){return _0x265753[_0x82d5('0x1b')](_0x201e56)[_0x82d5('0x1d')](_0x3f26ff);}};}function respondWithFilteredResult(_0x4a18f0,_0x128c42){return function(_0x26caa1){if(_0x26caa1){var _0x5b0b6e=typeof _0x128c42[_0x82d5('0x1e')]===_0x82d5('0x1f')&&typeof _0x128c42[_0x82d5('0x20')]===_0x82d5('0x1f');var _0x2e6c2c=_0x26caa1['count'];var _0xe1ce36=_0x5b0b6e?0x0:_0x128c42[_0x82d5('0x1e')];var _0x13c6ed=_0x5b0b6e?_0x26caa1[_0x82d5('0x21')]:_0x128c42[_0x82d5('0x1e')]+_0x128c42[_0x82d5('0x20')];var _0x3505b8;if(_0x13c6ed>=_0x2e6c2c){_0x13c6ed=_0x2e6c2c;_0x3505b8=0xc8;}else{_0x3505b8=0xce;}_0x4a18f0['status'](_0x3505b8);return _0x4a18f0['set'](_0x82d5('0x22'),_0xe1ce36+'-'+_0x13c6ed+'/'+_0x2e6c2c)[_0x82d5('0x1d')](_0x26caa1);}return null;};}function patchUpdates(_0x45d203){return function(_0x4712db){try{jsonpatch[_0x82d5('0x23')](_0x4712db,_0x45d203,!![]);}catch(_0x27a2a4){return BPromise[_0x82d5('0x24')](_0x27a2a4);}return _0x4712db[_0x82d5('0x25')]();};}function saveUpdates(_0x579711,_0x423fe1){return function(_0x2d22ab){if(_0x2d22ab){return _0x2d22ab[_0x82d5('0x26')](_0x579711)[_0x82d5('0x27')](function(_0x54964c){return _0x54964c;});}return null;};}function removeEntity(_0x942fc,_0x59605b){return function(_0x47736d){if(_0x47736d){return _0x47736d[_0x82d5('0x28')]()[_0x82d5('0x27')](function(){var _0x1ec65d=_0x47736d[_0x82d5('0x29')]({'plain':!![]});var _0x41fb26='Projects';return db[_0x82d5('0x2a')]['destroy']({'where':{'type':_0x41fb26,'resourceId':_0x1ec65d['id']}})['then'](function(){return _0x47736d;});})[_0x82d5('0x27')](function(){_0x942fc['status'](0xcc)[_0x82d5('0x1c')]();});}};}function handleEntityNotFound(_0x22c156,_0x18eb16){return function(_0x5854be){if(!_0x5854be){_0x22c156[_0x82d5('0x1a')](0x194);}return _0x5854be;};}function handleError(_0x8f4ba7,_0x10e54d){_0x10e54d=_0x10e54d||0x1f4;return function(_0x4d6054){logger[_0x82d5('0x2b')](_0x4d6054['stack']);if(_0x4d6054[_0x82d5('0x2c')]){delete _0x4d6054[_0x82d5('0x2c')];}_0x8f4ba7[_0x82d5('0x1b')](_0x10e54d)['send'](_0x4d6054);};}exports[_0x82d5('0x2d')]=function(_0x5cf853,_0x199a63){var _0x375c26={},_0x181fd3={},_0x735e28={'count':0x0,'rows':[]};var _0x6ca339=_['map'](db[_0x82d5('0x2e')][_0x82d5('0x2f')],function(_0x34c5ff){return{'name':_0x34c5ff['fieldName'],'type':_0x34c5ff[_0x82d5('0x30')][_0x82d5('0x31')]};});_0x181fd3['model']=_[_0x82d5('0x32')](_0x6ca339,_0x82d5('0x2c'));_0x181fd3[_0x82d5('0x33')]=_[_0x82d5('0x34')](_0x5cf853['query']);_0x181fd3[_0x82d5('0x35')]=_[_0x82d5('0x36')](_0x181fd3[_0x82d5('0x37')],_0x181fd3[_0x82d5('0x33')]);_0x375c26[_0x82d5('0x38')]=_[_0x82d5('0x36')](_0x181fd3[_0x82d5('0x37')],qs[_0x82d5('0x39')](_0x5cf853['query']['fields']));_0x375c26[_0x82d5('0x38')]=_0x375c26[_0x82d5('0x38')][_0x82d5('0x3a')]?_0x375c26[_0x82d5('0x38')]:_0x181fd3[_0x82d5('0x37')];if(!_0x5cf853[_0x82d5('0x33')][_0x82d5('0x3b')](_0x82d5('0x3c'))){_0x375c26[_0x82d5('0x20')]=qs[_0x82d5('0x20')](_0x5cf853[_0x82d5('0x33')][_0x82d5('0x20')]);_0x375c26[_0x82d5('0x1e')]=qs[_0x82d5('0x1e')](_0x5cf853['query'][_0x82d5('0x1e')]);}_0x375c26[_0x82d5('0x3d')]=qs[_0x82d5('0x3e')](_0x5cf853[_0x82d5('0x33')][_0x82d5('0x3e')]);_0x375c26['where']=qs[_0x82d5('0x35')](_[_0x82d5('0x3f')](_0x5cf853[_0x82d5('0x33')],_0x181fd3['filters']),_0x6ca339);if(_0x5cf853[_0x82d5('0x33')][_0x82d5('0x40')]){_0x375c26[_0x82d5('0x41')]=_[_0x82d5('0x42')](_0x375c26[_0x82d5('0x41')],{'$or':_[_0x82d5('0x32')](_0x6ca339,function(_0x4c9d63){if(_0x4c9d63['type']!==_0x82d5('0x43')){var _0x52d84c={};_0x52d84c[_0x4c9d63[_0x82d5('0x2c')]]={'$like':'%'+_0x5cf853[_0x82d5('0x33')]['filter']+'%'};return _0x52d84c;}})});}_0x375c26=_[_0x82d5('0x42')]({},_0x375c26,_0x5cf853[_0x82d5('0x44')]);var _0x547e12={'where':_0x375c26[_0x82d5('0x41')]};return db[_0x82d5('0x2e')][_0x82d5('0x21')](_0x547e12)[_0x82d5('0x27')](function(_0x5e12d8){_0x735e28['count']=_0x5e12d8;if(_0x5cf853['query'][_0x82d5('0x45')]){_0x375c26[_0x82d5('0x46')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x375c26);})['then'](function(_0x17113a){_0x735e28[_0x82d5('0x47')]=_0x17113a;return _0x735e28;})[_0x82d5('0x27')](respondWithFilteredResult(_0x199a63,_0x375c26))[_0x82d5('0x48')](handleError(_0x199a63,null));};exports['show']=function(_0x5c2dc4,_0x28d151){var _0x5b7eeb={'raw':![],'where':{'id':_0x5c2dc4[_0x82d5('0x49')]['id']}},_0x3628a6={};_0x3628a6[_0x82d5('0x37')]=_['keys'](db[_0x82d5('0x2e')][_0x82d5('0x2f')]);_0x3628a6[_0x82d5('0x33')]=_[_0x82d5('0x34')](_0x5c2dc4[_0x82d5('0x33')]);_0x3628a6[_0x82d5('0x35')]=_[_0x82d5('0x36')](_0x3628a6['model'],_0x3628a6[_0x82d5('0x33')]);_0x5b7eeb['attributes']=_[_0x82d5('0x36')](_0x3628a6[_0x82d5('0x37')],qs['fields'](_0x5c2dc4[_0x82d5('0x33')][_0x82d5('0x39')]));_0x5b7eeb[_0x82d5('0x38')]=_0x5b7eeb[_0x82d5('0x38')][_0x82d5('0x3a')]?_0x5b7eeb[_0x82d5('0x38')]:_0x3628a6[_0x82d5('0x37')];if(_0x5c2dc4['query']['includeAll']){_0x5b7eeb['include']=[{'all':!![]}];}_0x5b7eeb=_[_0x82d5('0x42')]({},_0x5b7eeb,_0x5c2dc4[_0x82d5('0x44')]);return db['JscriptyProject'][_0x82d5('0x4a')](_0x5b7eeb)[_0x82d5('0x27')](handleEntityNotFound(_0x28d151,null))['then'](respondWithResult(_0x28d151,null))['catch'](handleError(_0x28d151,null));};exports[_0x82d5('0x4b')]=function(_0xa890f,_0x4db992){return db[_0x82d5('0x2e')][_0x82d5('0x4b')](_0xa890f[_0x82d5('0x4c')],{})[_0x82d5('0x27')](function(_0x36316b){var _0x53c9a9=_0xa890f[_0x82d5('0x4d')][_0x82d5('0x29')]({'plain':!![]});if(!_0x53c9a9)throw new Error(_0x82d5('0x4e'));if(_0x53c9a9['role']===_0x82d5('0x4d')){var _0x3cea07=_0x36316b['get']({'plain':!![]});var _0x472e65=_0x82d5('0x4f');return db[_0x82d5('0x50')][_0x82d5('0x4a')]({'where':{'name':_0x472e65,'userProfileId':_0x53c9a9[_0x82d5('0x51')]},'raw':!![]})[_0x82d5('0x27')](function(_0x35a50b){if(_0x35a50b&&_0x35a50b['autoAssociation']===0x0){return db[_0x82d5('0x2a')]['create']({'name':_0x3cea07['name'],'resourceId':_0x3cea07['id'],'type':_0x35a50b[_0x82d5('0x2c')],'sectionId':_0x35a50b['id']},{})[_0x82d5('0x27')](function(){return _0x36316b;});}else{return _0x36316b;}})[_0x82d5('0x48')](function(_0x51299f){logger[_0x82d5('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51299f);throw _0x51299f;});}return _0x36316b;})[_0x82d5('0x27')](respondWithResult(_0x4db992,0xc9))[_0x82d5('0x48')](handleError(_0x4db992,null));};exports[_0x82d5('0x52')]=function(_0x3318bd,_0x598013){var _0x98e76f={'where':{'id':_0x3318bd[_0x82d5('0x49')]['id']}},_0x521855={};_0x521855[_0x82d5('0x37')]=_[_0x82d5('0x34')](db['JscriptyProject'][_0x82d5('0x2f')]);_0x98e76f[_0x82d5('0x38')]=_[_0x82d5('0x36')](_0x521855['model'],qs['fields'](_0x3318bd['query'][_0x82d5('0x39')]));_0x98e76f[_0x82d5('0x38')]=_0x98e76f[_0x82d5('0x38')][_0x82d5('0x3a')]?_0x98e76f[_0x82d5('0x38')]:_0x521855[_0x82d5('0x37')];if(_0x3318bd[_0x82d5('0x33')][_0x82d5('0x45')]){_0x98e76f['include']=[{'all':!![]}];}_0x98e76f=_[_0x82d5('0x42')]({},_0x98e76f,_0x3318bd[_0x82d5('0x44')]);return db[_0x82d5('0x2e')][_0x82d5('0x4a')](_0x98e76f)[_0x82d5('0x27')](handleEntityNotFound(_0x598013,null))[_0x82d5('0x27')](function(_0x15af57){if(_0x15af57){var _0x3ed2c1=_0x15af57[_0x82d5('0x29')]({'plain':!![]});_0x3ed2c1=qs[_0x82d5('0x53')](_0x3ed2c1,['id',_0x82d5('0x54'),'updatedAt']);_0x3318bd[_0x82d5('0x4c')]=_[_0x82d5('0x53')](_0x3318bd[_0x82d5('0x4c')],['id',_0x82d5('0x54'),'updatedAt']);return db[_0x82d5('0x2e')]['create'](_['merge'](_0x3ed2c1,_0x3318bd['body']),{'include':_0x3318bd[_0x82d5('0x33')][_0x82d5('0x45')]?[{'all':!![]}]:undefined})[_0x82d5('0x27')](function(_0x5daddf){var _0x2fb594=_0x3318bd['user'][_0x82d5('0x29')]({'plain':!![]});if(!_0x2fb594)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fb594[_0x82d5('0x55')]===_0x82d5('0x4d')){var _0x3f65d1=_0x5daddf['get']({'plain':!![]});var _0x507d23=_0x82d5('0x4f');return db[_0x82d5('0x50')]['find']({'where':{'name':_0x507d23,'userProfileId':_0x2fb594['userProfileId']},'raw':!![]})[_0x82d5('0x27')](function(_0x440629){if(_0x440629&&_0x440629[_0x82d5('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x3f65d1['name'],'resourceId':_0x3f65d1['id'],'type':_0x440629[_0x82d5('0x2c')],'sectionId':_0x440629['id']},{})[_0x82d5('0x27')](function(){return _0x5daddf;});}else{return _0x5daddf;}})[_0x82d5('0x48')](function(_0x5dccb4){logger[_0x82d5('0x2b')](_0x82d5('0x57'),_0x5dccb4);throw _0x5dccb4;});}return _0x5daddf;});}})['then'](respondWithResult(_0x598013,0xc9))[_0x82d5('0x48')](handleError(_0x598013,null));};exports[_0x82d5('0x26')]=function(_0x25c243,_0x443675){if(_0x25c243[_0x82d5('0x4c')]['id']){delete _0x25c243[_0x82d5('0x4c')]['id'];}return db[_0x82d5('0x2e')]['find']({'where':{'id':_0x25c243[_0x82d5('0x49')]['id']}})[_0x82d5('0x27')](handleEntityNotFound(_0x443675,null))['then'](saveUpdates(_0x25c243[_0x82d5('0x4c')],null))[_0x82d5('0x27')](respondWithResult(_0x443675,null))[_0x82d5('0x48')](handleError(_0x443675,null));};exports['destroy']=function(_0xd88ea0,_0xa61a){return db[_0x82d5('0x2e')]['find']({'where':{'id':_0xd88ea0[_0x82d5('0x49')]['id']}})['then'](handleEntityNotFound(_0xa61a,null))[_0x82d5('0x27')](removeEntity(_0xa61a,null))[_0x82d5('0x48')](handleError(_0xa61a,null));};exports[_0x82d5('0x58')]=function(_0x27fd2b,_0x4f315a,_0x441a73){var _0x59890a={'raw':!![],'where':{}};var _0x1f1bc1={};var _0x28ba24={'count':0x0,'rows':[]};return db[_0x82d5('0x2e')][_0x82d5('0x59')]({'where':{'id':_0x27fd2b[_0x82d5('0x49')]['id']}})[_0x82d5('0x27')](handleEntityNotFound(_0x4f315a,null))[_0x82d5('0x27')](function(_0x205a60){if(_0x205a60){_0x1f1bc1['model']=_['keys'](db['JscriptySessionReport'][_0x82d5('0x2f')]);_0x1f1bc1['query']=_[_0x82d5('0x34')](_0x27fd2b['query']);_0x1f1bc1[_0x82d5('0x35')]=_['intersection'](_0x1f1bc1[_0x82d5('0x37')],_0x1f1bc1[_0x82d5('0x33')]);_0x59890a[_0x82d5('0x38')]=_[_0x82d5('0x36')](_0x1f1bc1[_0x82d5('0x37')],qs[_0x82d5('0x39')](_0x27fd2b['query'][_0x82d5('0x39')]));_0x59890a['attributes']=_0x59890a[_0x82d5('0x38')][_0x82d5('0x3a')]?_0x59890a['attributes']:_0x1f1bc1[_0x82d5('0x37')];if(!_0x27fd2b['query'][_0x82d5('0x3b')](_0x82d5('0x3c'))){_0x59890a['limit']=qs[_0x82d5('0x20')](_0x27fd2b['query'][_0x82d5('0x20')]);_0x59890a[_0x82d5('0x1e')]=qs[_0x82d5('0x1e')](_0x27fd2b[_0x82d5('0x33')]['offset']);}_0x59890a[_0x82d5('0x3d')]=qs[_0x82d5('0x3e')](_0x27fd2b[_0x82d5('0x33')][_0x82d5('0x3e')]);_0x59890a['where']=qs[_0x82d5('0x35')](_['pick'](_0x27fd2b[_0x82d5('0x33')],_0x1f1bc1[_0x82d5('0x35')]));_0x59890a[_0x82d5('0x41')]['ProjectId']=_0x205a60['id'];if(_0x27fd2b['query'][_0x82d5('0x40')]){_0x59890a[_0x82d5('0x41')]=_[_0x82d5('0x42')](_0x59890a[_0x82d5('0x41')],{'$or':_['map'](_0x59890a['attributes'],function(_0x560049){var _0x5e8679={};_0x5e8679[_0x560049]={'$like':'%'+_0x27fd2b[_0x82d5('0x33')]['filter']+'%'};return _0x5e8679;})});}_0x59890a=_[_0x82d5('0x42')]({},_0x59890a,_0x27fd2b[_0x82d5('0x44')]);return db[_0x82d5('0x5a')][_0x82d5('0x21')]({'where':_0x59890a[_0x82d5('0x41')]})[_0x82d5('0x27')](function(_0x1c85e0){_0x28ba24['count']=_0x1c85e0;if(_0x27fd2b[_0x82d5('0x33')][_0x82d5('0x45')]){_0x59890a[_0x82d5('0x46')]=[{'all':!![]}];}return db[_0x82d5('0x5a')][_0x82d5('0x5b')](_0x59890a);})[_0x82d5('0x27')](function(_0x445d9f){_0x28ba24[_0x82d5('0x47')]=_0x445d9f;return _0x28ba24;});}})[_0x82d5('0x27')](respondWithFilteredResult(_0x4f315a,_0x59890a))[_0x82d5('0x48')](handleError(_0x4f315a,null));};exports[_0x82d5('0x5c')]=function(_0x37a0e3,_0x4bb5c0,_0x453b28){var _0x4340dd={'raw':!![],'where':{}};var _0x3f3ff6={};var _0x58e4b={'count':0x0,'rows':[]};return db[_0x82d5('0x2e')]['findOne']({'where':{'id':_0x37a0e3['params']['id']}})[_0x82d5('0x27')](handleEntityNotFound(_0x4bb5c0,null))[_0x82d5('0x27')](function(_0x1c339d){if(_0x1c339d){_0x3f3ff6[_0x82d5('0x37')]=_[_0x82d5('0x34')](db[_0x82d5('0x5d')][_0x82d5('0x2f')]);_0x3f3ff6[_0x82d5('0x33')]=_[_0x82d5('0x34')](_0x37a0e3[_0x82d5('0x33')]);_0x3f3ff6[_0x82d5('0x35')]=_[_0x82d5('0x36')](_0x3f3ff6[_0x82d5('0x37')],_0x3f3ff6[_0x82d5('0x33')]);_0x4340dd['attributes']=_[_0x82d5('0x36')](_0x3f3ff6[_0x82d5('0x37')],qs[_0x82d5('0x39')](_0x37a0e3[_0x82d5('0x33')][_0x82d5('0x39')]));_0x4340dd[_0x82d5('0x38')]=_0x4340dd[_0x82d5('0x38')]['length']?_0x4340dd['attributes']:_0x3f3ff6[_0x82d5('0x37')];if(!_0x37a0e3[_0x82d5('0x33')][_0x82d5('0x3b')](_0x82d5('0x3c'))){_0x4340dd['limit']=qs['limit'](_0x37a0e3[_0x82d5('0x33')][_0x82d5('0x20')]);_0x4340dd['offset']=qs['offset'](_0x37a0e3[_0x82d5('0x33')]['offset']);}_0x4340dd[_0x82d5('0x3d')]=qs['sort'](_0x37a0e3[_0x82d5('0x33')][_0x82d5('0x3e')]);_0x4340dd[_0x82d5('0x41')]=qs[_0x82d5('0x35')](_[_0x82d5('0x3f')](_0x37a0e3[_0x82d5('0x33')],_0x3f3ff6[_0x82d5('0x35')]));_0x4340dd['where'][_0x82d5('0x5e')]=_0x1c339d['id'];if(_0x37a0e3[_0x82d5('0x33')][_0x82d5('0x40')]){_0x4340dd['where']=_['merge'](_0x4340dd[_0x82d5('0x41')],{'$or':_[_0x82d5('0x32')](_0x4340dd[_0x82d5('0x38')],function(_0x3b7e4c){var _0xd4134b={};_0xd4134b[_0x3b7e4c]={'$like':'%'+_0x37a0e3[_0x82d5('0x33')][_0x82d5('0x40')]+'%'};return _0xd4134b;})});}_0x4340dd=_['merge']({},_0x4340dd,_0x37a0e3['options']);return db['JscriptyAnswerReport']['count']({'where':_0x4340dd[_0x82d5('0x41')]})[_0x82d5('0x27')](function(_0x52b490){_0x58e4b[_0x82d5('0x21')]=_0x52b490;if(_0x37a0e3[_0x82d5('0x33')][_0x82d5('0x45')]){_0x4340dd[_0x82d5('0x46')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x4340dd);})[_0x82d5('0x27')](function(_0x126cad){_0x58e4b[_0x82d5('0x47')]=_0x126cad;return _0x58e4b;});}})[_0x82d5('0x27')](respondWithFilteredResult(_0x4bb5c0,_0x4340dd))[_0x82d5('0x48')](handleError(_0x4bb5c0,null));};function char(_0x18fe9e){return _0x82d5('0x5f')===typeof _0x18fe9e?String[_0x82d5('0x60')][_0x82d5('0x23')](null,arguments):_0x18fe9e;}function needsEncapsulation(_0x301565){return!!_0x301565&&(_0x301565[_0x82d5('0x61')]()['indexOf'](char(0xd))>=0x0||_0x301565[_0x82d5('0x61')]()[_0x82d5('0x62')](char(0xa))>=0x0||_0x301565[_0x82d5('0x61')]()[_0x82d5('0x62')](char(0x2c))>=0x0||_0x301565[_0x82d5('0x61')]()[_0x82d5('0x62')](char(0x22))>=0x0);}function encapsulate(_0x45526e){var _0x9f8417=char(0x22),_0x4ec5ca='\x5c'+char(0x22),_0x42206b=_0x45526e[_0x82d5('0x61')]()['replace'](new RegExp(_0x9f8417,'g'),_0x4ec5ca);return _0x9f8417+_0x42206b+_0x9f8417;}exports[_0x82d5('0x63')]=function(_0x2be3d6,_0x5d93f7,_0x4f1a3b){var _0x58c713,_0x28ff0f;var _0x101243={'where':{'ProjectId':_0x2be3d6['params']['id']}};if(_0x2be3d6[_0x82d5('0x33')][_0x82d5('0x64')]){_0x101243[_0x82d5('0x41')][_0x82d5('0x65')]=JSON['parse'](_0x2be3d6[_0x82d5('0x33')][_0x82d5('0x64')]);}return db[_0x82d5('0x5a')][_0x82d5('0x5b')](_0x101243)[_0x82d5('0x27')](handleEntityNotFound(_0x5d93f7,null))[_0x82d5('0x27')](function(_0x1f8a58){if(_0x1f8a58){_0x58c713=_0x1f8a58;return db[_0x82d5('0x66')][_0x82d5('0x5b')]({'where':{'SessionId':{'$in':_['map'](_0x58c713,'id')},'ProjectId':_0x2be3d6[_0x82d5('0x49')]['id']},'order':_0x82d5('0x67')});}})[_0x82d5('0x27')](handleEntityNotFound(_0x5d93f7,null))[_0x82d5('0x27')](function(_0x589ece){if(_0x589ece){_0x28ff0f=_0x589ece;var _0x29593b={};for(var _0x2dceca=0x0,_0x4ef58b=_0x28ff0f[_0x82d5('0x3a')];_0x2dceca<_0x4ef58b;_0x2dceca++){if(!_0x29593b[_0x82d5('0x3b')](_0x28ff0f[_0x2dceca][_0x82d5('0x68')])){_0x29593b[_0x28ff0f[_0x2dceca][_0x82d5('0x68')]]=needsEncapsulation(_0x28ff0f[_0x2dceca][_0x82d5('0x69')])?encapsulate(_0x28ff0f[_0x2dceca][_0x82d5('0x69')]):_0x28ff0f[_0x2dceca]['question'];}}var _0x44fc1f=[],_0x25398d={};for(var _0x3c1d21=0x0,_0x251609=_0x58c713['length'];_0x3c1d21<_0x251609;_0x3c1d21++){_0x25398d={'ProjectId':_0x2be3d6[_0x82d5('0x49')]['id'],'SessionId':_0x58c713[_0x3c1d21]['id'],'StartTime':moment(_0x58c713[_0x3c1d21][_0x82d5('0x65')])[_0x82d5('0x6a')](_0x82d5('0x6b'))};for(var _0x396dec=0x0,_0x3dfe57=_0x28ff0f[_0x82d5('0x3a')];_0x396dec<_0x3dfe57;_0x396dec++){if(_0x28ff0f[_0x396dec][_0x82d5('0x6c')]==_0x58c713[_0x3c1d21]['id']&&_0x29593b[_0x82d5('0x3b')](_0x28ff0f[_0x396dec][_0x82d5('0x68')])){_0x25398d[_0x29593b[_0x28ff0f[_0x396dec]['questionId']]]=_0x28ff0f[_0x396dec][_0x82d5('0x6d')];}}for(var _0x5caad4 in _0x29593b){if(!_0x25398d['hasOwnProperty'](_0x29593b[_0x5caad4])){_0x25398d[_0x29593b[_0x5caad4]]=null;}}_0x44fc1f['push'](_0x25398d);}return _0x44fc1f;}})[_0x82d5('0x27')](function(_0x17af8a){if(!_[_0x82d5('0x6e')](_0x17af8a)){var _0x4c8dc7=toCsv(_0x17af8a);var _0x307c62=Date[_0x82d5('0x6f')]();fs[_0x82d5('0x70')](util[_0x82d5('0x6a')](_0x82d5('0x71'),_0x2be3d6[_0x82d5('0x49')]['id'],_0x307c62),_0x4c8dc7);_0x5d93f7[_0x82d5('0x72')](_0x82d5('0x73'),_0x82d5('0x74')+util[_0x82d5('0x6a')](_0x82d5('0x75'),_0x2be3d6[_0x82d5('0x49')]['id'],_0x307c62));_0x5d93f7[_0x82d5('0x72')](_0x82d5('0x76'),_0x82d5('0x77'));return _0x5d93f7[_0x82d5('0x78')](util[_0x82d5('0x6a')](_0x82d5('0x71'),_0x2be3d6[_0x82d5('0x49')]['id'],_0x307c62));}else{return _0x5d93f7['sendStatus'](0xcc);}})[_0x82d5('0x48')](handleError(_0x5d93f7,null));}; \ No newline at end of file +var _0x866a=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','stack','name','send','index','map','JscriptyProject','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','ProjectId','JscriptyAnswerReport','findAll','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','now','writeFileSync','format','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x3a2027,_0x1a7064){var _0x52b0e1=function(_0x373a65){while(--_0x373a65){_0x3a2027['push'](_0x3a2027['shift']());}};_0x52b0e1(++_0x1a7064);}(_0x866a,0x156));var _0xa866=function(_0x29f014,_0x508522){_0x29f014=_0x29f014-0x0;var _0x316be5=_0x866a[_0x29f014];return _0x316be5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa866('0x0'));var zipdir=require(_0xa866('0x1'));var jsonpatch=require(_0xa866('0x2'));var rp=require(_0xa866('0x3'));var moment=require(_0xa866('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa866('0x5'));var util=require(_0xa866('0x6'));var path=require(_0xa866('0x7'));var sox=require('sox');var csv=require(_0xa866('0x8'));var ejs=require(_0xa866('0x9'));var fs=require('fs');var fs_extra=require(_0xa866('0xa'));var _=require(_0xa866('0xb'));var squel=require(_0xa866('0xc'));var crypto=require(_0xa866('0xd'));var jsforce=require(_0xa866('0xe'));var deskjs=require(_0xa866('0xf'));var toCsv=require(_0xa866('0x8'));var querystring=require(_0xa866('0x10'));var Papa=require('papaparse');var Redis=require(_0xa866('0x11'));var authService=require(_0xa866('0x12'));var qs=require(_0xa866('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa866('0x14'));var logger=require(_0xa866('0x15'))(_0xa866('0x16'));var utils=require(_0xa866('0x17'));var config=require(_0xa866('0x18'));var licenseUtil=require(_0xa866('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xda40fb,_0xcf9adb){_0xcf9adb=_0xcf9adb||0xcc;return function(_0x82a87d){if(_0x82a87d){return _0xda40fb[_0xa866('0x1a')](_0xcf9adb);}return _0xda40fb['status'](_0xcf9adb)[_0xa866('0x1b')]();};}function respondWithResult(_0x54d726,_0x30a560){_0x30a560=_0x30a560||0xc8;return function(_0x5ad0a2){if(_0x5ad0a2){return _0x54d726[_0xa866('0x1c')](_0x30a560)[_0xa866('0x1d')](_0x5ad0a2);}};}function respondWithFilteredResult(_0x1b0ea6,_0x5d4fd1){return function(_0x251095){if(_0x251095){var _0x1afbe4=typeof _0x5d4fd1[_0xa866('0x1e')]===_0xa866('0x1f')&&typeof _0x5d4fd1[_0xa866('0x20')]===_0xa866('0x1f');var _0x34ca55=_0x251095[_0xa866('0x21')];var _0x440de5=_0x1afbe4?0x0:_0x5d4fd1['offset'];var _0x2aca7b=_0x1afbe4?_0x251095[_0xa866('0x21')]:_0x5d4fd1[_0xa866('0x1e')]+_0x5d4fd1[_0xa866('0x20')];var _0x1bd7c0;if(_0x2aca7b>=_0x34ca55){_0x2aca7b=_0x34ca55;_0x1bd7c0=0xc8;}else{_0x1bd7c0=0xce;}_0x1b0ea6[_0xa866('0x1c')](_0x1bd7c0);return _0x1b0ea6[_0xa866('0x22')]('Content-Range',_0x440de5+'-'+_0x2aca7b+'/'+_0x34ca55)[_0xa866('0x1d')](_0x251095);}return null;};}function patchUpdates(_0x48ae31){return function(_0x5d105c){try{jsonpatch[_0xa866('0x23')](_0x5d105c,_0x48ae31,!![]);}catch(_0x5075da){return BPromise[_0xa866('0x24')](_0x5075da);}return _0x5d105c[_0xa866('0x25')]();};}function saveUpdates(_0x22de43,_0x597b3b){return function(_0x5d9af5){if(_0x5d9af5){return _0x5d9af5[_0xa866('0x26')](_0x22de43)[_0xa866('0x27')](function(_0x48b66c){return _0x48b66c;});}return null;};}function removeEntity(_0x2a6940,_0x31ed99){return function(_0x118f1b){if(_0x118f1b){return _0x118f1b[_0xa866('0x28')]()['then'](function(){var _0x218ce8=_0x118f1b[_0xa866('0x29')]({'plain':!![]});var _0x35a83d=_0xa866('0x2a');return db[_0xa866('0x2b')][_0xa866('0x28')]({'where':{'type':_0x35a83d,'resourceId':_0x218ce8['id']}})['then'](function(){return _0x118f1b;});})[_0xa866('0x27')](function(){_0x2a6940[_0xa866('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b3a6c,_0x243a3d){return function(_0x25f236){if(!_0x25f236){_0x4b3a6c['sendStatus'](0x194);}return _0x25f236;};}function handleError(_0x4a54b9,_0x2dd560){_0x2dd560=_0x2dd560||0x1f4;return function(_0x1e27ed){logger['error'](_0x1e27ed[_0xa866('0x2c')]);if(_0x1e27ed[_0xa866('0x2d')]){delete _0x1e27ed[_0xa866('0x2d')];}_0x4a54b9['status'](_0x2dd560)[_0xa866('0x2e')](_0x1e27ed);};}exports[_0xa866('0x2f')]=function(_0x92f73b,_0x408015){var _0x11ec00={},_0x4b3d81={},_0x4eb663={'count':0x0,'rows':[]};var _0x1ad800=_[_0xa866('0x30')](db[_0xa866('0x31')][_0xa866('0x32')],function(_0x42e9cb){return{'name':_0x42e9cb['fieldName'],'type':_0x42e9cb[_0xa866('0x33')][_0xa866('0x34')]};});_0x4b3d81['model']=_[_0xa866('0x30')](_0x1ad800,_0xa866('0x2d'));_0x4b3d81['query']=_[_0xa866('0x35')](_0x92f73b[_0xa866('0x36')]);_0x4b3d81[_0xa866('0x37')]=_[_0xa866('0x38')](_0x4b3d81[_0xa866('0x39')],_0x4b3d81[_0xa866('0x36')]);_0x11ec00[_0xa866('0x3a')]=_[_0xa866('0x38')](_0x4b3d81[_0xa866('0x39')],qs[_0xa866('0x3b')](_0x92f73b['query']['fields']));_0x11ec00[_0xa866('0x3a')]=_0x11ec00[_0xa866('0x3a')][_0xa866('0x3c')]?_0x11ec00[_0xa866('0x3a')]:_0x4b3d81[_0xa866('0x39')];if(!_0x92f73b['query'][_0xa866('0x3d')](_0xa866('0x3e'))){_0x11ec00[_0xa866('0x20')]=qs[_0xa866('0x20')](_0x92f73b['query'][_0xa866('0x20')]);_0x11ec00[_0xa866('0x1e')]=qs[_0xa866('0x1e')](_0x92f73b['query'][_0xa866('0x1e')]);}_0x11ec00[_0xa866('0x3f')]=qs[_0xa866('0x40')](_0x92f73b[_0xa866('0x36')]['sort']);_0x11ec00[_0xa866('0x41')]=qs['filters'](_[_0xa866('0x42')](_0x92f73b[_0xa866('0x36')],_0x4b3d81[_0xa866('0x37')]),_0x1ad800);if(_0x92f73b[_0xa866('0x36')][_0xa866('0x43')]){_0x11ec00[_0xa866('0x41')]=_[_0xa866('0x44')](_0x11ec00[_0xa866('0x41')],{'$or':_['map'](_0x1ad800,function(_0x27ebb4){if(_0x27ebb4['type']!==_0xa866('0x45')){var _0x738e33={};_0x738e33[_0x27ebb4[_0xa866('0x2d')]]={'$like':'%'+_0x92f73b[_0xa866('0x36')][_0xa866('0x43')]+'%'};return _0x738e33;}})});}_0x11ec00=_[_0xa866('0x44')]({},_0x11ec00,_0x92f73b[_0xa866('0x46')]);var _0x561f6a={'where':_0x11ec00[_0xa866('0x41')]};return db[_0xa866('0x31')][_0xa866('0x21')](_0x561f6a)['then'](function(_0x2a7735){_0x4eb663['count']=_0x2a7735;if(_0x92f73b[_0xa866('0x36')][_0xa866('0x47')]){_0x11ec00[_0xa866('0x48')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x11ec00);})[_0xa866('0x27')](function(_0x688523){_0x4eb663[_0xa866('0x49')]=_0x688523;return _0x4eb663;})[_0xa866('0x27')](respondWithFilteredResult(_0x408015,_0x11ec00))['catch'](handleError(_0x408015,null));};exports[_0xa866('0x4a')]=function(_0x24f33a,_0xc9d96c){var _0x24d862={'raw':![],'where':{'id':_0x24f33a[_0xa866('0x4b')]['id']}},_0x265905={};_0x265905['model']=_[_0xa866('0x35')](db[_0xa866('0x31')][_0xa866('0x32')]);_0x265905[_0xa866('0x36')]=_[_0xa866('0x35')](_0x24f33a[_0xa866('0x36')]);_0x265905['filters']=_[_0xa866('0x38')](_0x265905[_0xa866('0x39')],_0x265905[_0xa866('0x36')]);_0x24d862[_0xa866('0x3a')]=_[_0xa866('0x38')](_0x265905[_0xa866('0x39')],qs['fields'](_0x24f33a[_0xa866('0x36')][_0xa866('0x3b')]));_0x24d862[_0xa866('0x3a')]=_0x24d862[_0xa866('0x3a')][_0xa866('0x3c')]?_0x24d862[_0xa866('0x3a')]:_0x265905[_0xa866('0x39')];if(_0x24f33a['query'][_0xa866('0x47')]){_0x24d862[_0xa866('0x48')]=[{'all':!![]}];}_0x24d862=_['merge']({},_0x24d862,_0x24f33a[_0xa866('0x46')]);return db[_0xa866('0x31')][_0xa866('0x4c')](_0x24d862)[_0xa866('0x27')](handleEntityNotFound(_0xc9d96c,null))[_0xa866('0x27')](respondWithResult(_0xc9d96c,null))[_0xa866('0x4d')](handleError(_0xc9d96c,null));};exports[_0xa866('0x4e')]=function(_0x4ac15b,_0x4b3e14){return db[_0xa866('0x31')]['create'](_0x4ac15b['body'],{})['then'](function(_0x321ad2){var _0x304622=_0x4ac15b[_0xa866('0x4f')][_0xa866('0x29')]({'plain':!![]});if(!_0x304622)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x304622[_0xa866('0x50')]===_0xa866('0x4f')){var _0x1d0782=_0x321ad2[_0xa866('0x29')]({'plain':!![]});var _0x13ffd2='Projects';return db[_0xa866('0x51')][_0xa866('0x4c')]({'where':{'name':_0x13ffd2,'userProfileId':_0x304622[_0xa866('0x52')]},'raw':!![]})[_0xa866('0x27')](function(_0x2392cd){if(_0x2392cd&&_0x2392cd[_0xa866('0x53')]===0x0){return db[_0xa866('0x2b')]['create']({'name':_0x1d0782[_0xa866('0x2d')],'resourceId':_0x1d0782['id'],'type':_0x2392cd[_0xa866('0x2d')],'sectionId':_0x2392cd['id']},{})[_0xa866('0x27')](function(){return _0x321ad2;});}else{return _0x321ad2;}})[_0xa866('0x4d')](function(_0x60c4af){logger[_0xa866('0x54')](_0xa866('0x55'),_0x60c4af);throw _0x60c4af;});}return _0x321ad2;})['then'](respondWithResult(_0x4b3e14,0xc9))[_0xa866('0x4d')](handleError(_0x4b3e14,null));};exports[_0xa866('0x56')]=function(_0x2562e8,_0x1868d5){var _0xa92f71={'where':{'id':_0x2562e8[_0xa866('0x4b')]['id']}},_0x5536b2={};_0x5536b2[_0xa866('0x39')]=_[_0xa866('0x35')](db['JscriptyProject'][_0xa866('0x32')]);_0xa92f71[_0xa866('0x3a')]=_['intersection'](_0x5536b2['model'],qs[_0xa866('0x3b')](_0x2562e8[_0xa866('0x36')]['fields']));_0xa92f71[_0xa866('0x3a')]=_0xa92f71[_0xa866('0x3a')][_0xa866('0x3c')]?_0xa92f71['attributes']:_0x5536b2['model'];if(_0x2562e8['query'][_0xa866('0x47')]){_0xa92f71[_0xa866('0x48')]=[{'all':!![]}];}_0xa92f71=_[_0xa866('0x44')]({},_0xa92f71,_0x2562e8[_0xa866('0x46')]);return db['JscriptyProject'][_0xa866('0x4c')](_0xa92f71)['then'](handleEntityNotFound(_0x1868d5,null))[_0xa866('0x27')](function(_0x32705){if(_0x32705){var _0x1d8b8b=_0x32705[_0xa866('0x29')]({'plain':!![]});_0x1d8b8b=qs[_0xa866('0x57')](_0x1d8b8b,['id',_0xa866('0x58'),'updatedAt']);_0x2562e8[_0xa866('0x59')]=_[_0xa866('0x57')](_0x2562e8[_0xa866('0x59')],['id',_0xa866('0x58'),'updatedAt']);return db[_0xa866('0x31')][_0xa866('0x4e')](_['merge'](_0x1d8b8b,_0x2562e8[_0xa866('0x59')]),{'include':_0x2562e8['query'][_0xa866('0x47')]?[{'all':!![]}]:undefined})[_0xa866('0x27')](function(_0x46ee5c){var _0x490e99=_0x2562e8['user'][_0xa866('0x29')]({'plain':!![]});if(!_0x490e99)throw new Error(_0xa866('0x5a'));if(_0x490e99[_0xa866('0x50')]==='user'){var _0x9a40c=_0x46ee5c[_0xa866('0x29')]({'plain':!![]});var _0x4b6e7f=_0xa866('0x2a');return db[_0xa866('0x51')][_0xa866('0x4c')]({'where':{'name':_0x4b6e7f,'userProfileId':_0x490e99['userProfileId']},'raw':!![]})[_0xa866('0x27')](function(_0x1343c0){if(_0x1343c0&&_0x1343c0[_0xa866('0x53')]===0x0){return db[_0xa866('0x2b')][_0xa866('0x4e')]({'name':_0x9a40c[_0xa866('0x2d')],'resourceId':_0x9a40c['id'],'type':_0x1343c0['name'],'sectionId':_0x1343c0['id']},{})['then'](function(){return _0x46ee5c;});}else{return _0x46ee5c;}})[_0xa866('0x4d')](function(_0xd61be6){logger[_0xa866('0x54')](_0xa866('0x55'),_0xd61be6);throw _0xd61be6;});}return _0x46ee5c;});}})[_0xa866('0x27')](respondWithResult(_0x1868d5,0xc9))[_0xa866('0x4d')](handleError(_0x1868d5,null));};exports[_0xa866('0x26')]=function(_0x5ea510,_0x25d143){if(_0x5ea510[_0xa866('0x59')]['id']){delete _0x5ea510[_0xa866('0x59')]['id'];}return db[_0xa866('0x31')][_0xa866('0x4c')]({'where':{'id':_0x5ea510[_0xa866('0x4b')]['id']}})[_0xa866('0x27')](handleEntityNotFound(_0x25d143,null))['then'](saveUpdates(_0x5ea510['body'],null))['then'](respondWithResult(_0x25d143,null))[_0xa866('0x4d')](handleError(_0x25d143,null));};exports['destroy']=function(_0x24de2a,_0x13a2a4){return db[_0xa866('0x31')][_0xa866('0x4c')]({'where':{'id':_0x24de2a[_0xa866('0x4b')]['id']}})[_0xa866('0x27')](handleEntityNotFound(_0x13a2a4,null))[_0xa866('0x27')](removeEntity(_0x13a2a4,null))[_0xa866('0x4d')](handleError(_0x13a2a4,null));};exports[_0xa866('0x5b')]=function(_0x3fcaeb,_0x482c33,_0x2bed8c){var _0x249181={'raw':!![],'where':{}};var _0x58fda0={};var _0x321e45={'count':0x0,'rows':[]};return db[_0xa866('0x31')][_0xa866('0x5c')]({'where':{'id':_0x3fcaeb['params']['id']}})[_0xa866('0x27')](handleEntityNotFound(_0x482c33,null))[_0xa866('0x27')](function(_0x5520eb){if(_0x5520eb){_0x58fda0[_0xa866('0x39')]=_['keys'](db[_0xa866('0x5d')][_0xa866('0x32')]);_0x58fda0[_0xa866('0x36')]=_['keys'](_0x3fcaeb[_0xa866('0x36')]);_0x58fda0[_0xa866('0x37')]=_[_0xa866('0x38')](_0x58fda0[_0xa866('0x39')],_0x58fda0[_0xa866('0x36')]);_0x249181[_0xa866('0x3a')]=_[_0xa866('0x38')](_0x58fda0[_0xa866('0x39')],qs[_0xa866('0x3b')](_0x3fcaeb[_0xa866('0x36')]['fields']));_0x249181[_0xa866('0x3a')]=_0x249181[_0xa866('0x3a')][_0xa866('0x3c')]?_0x249181[_0xa866('0x3a')]:_0x58fda0['model'];if(!_0x3fcaeb[_0xa866('0x36')]['hasOwnProperty'](_0xa866('0x3e'))){_0x249181[_0xa866('0x20')]=qs[_0xa866('0x20')](_0x3fcaeb['query'][_0xa866('0x20')]);_0x249181[_0xa866('0x1e')]=qs[_0xa866('0x1e')](_0x3fcaeb[_0xa866('0x36')]['offset']);}_0x249181[_0xa866('0x3f')]=qs[_0xa866('0x40')](_0x3fcaeb[_0xa866('0x36')][_0xa866('0x40')]);_0x249181['where']=qs[_0xa866('0x37')](_['pick'](_0x3fcaeb[_0xa866('0x36')],_0x58fda0[_0xa866('0x37')]));_0x249181[_0xa866('0x41')][_0xa866('0x5e')]=_0x5520eb['id'];if(_0x3fcaeb[_0xa866('0x36')][_0xa866('0x43')]){_0x249181[_0xa866('0x41')]=_[_0xa866('0x44')](_0x249181[_0xa866('0x41')],{'$or':_[_0xa866('0x30')](_0x249181['attributes'],function(_0x170259){var _0x1e959b={};_0x1e959b[_0x170259]={'$like':'%'+_0x3fcaeb['query'][_0xa866('0x43')]+'%'};return _0x1e959b;})});}_0x249181=_[_0xa866('0x44')]({},_0x249181,_0x3fcaeb['options']);return db[_0xa866('0x5d')]['count']({'where':_0x249181[_0xa866('0x41')]})['then'](function(_0x2fc5f2){_0x321e45[_0xa866('0x21')]=_0x2fc5f2;if(_0x3fcaeb[_0xa866('0x36')][_0xa866('0x47')]){_0x249181[_0xa866('0x48')]=[{'all':!![]}];}return db[_0xa866('0x5d')]['findAll'](_0x249181);})[_0xa866('0x27')](function(_0x18c213){_0x321e45['rows']=_0x18c213;return _0x321e45;});}})[_0xa866('0x27')](respondWithFilteredResult(_0x482c33,_0x249181))[_0xa866('0x4d')](handleError(_0x482c33,null));};exports['getAnswers']=function(_0xaf190f,_0x2219f4,_0x51e6dc){var _0x3fca14={'raw':!![],'where':{}};var _0x3e7559={};var _0x45232e={'count':0x0,'rows':[]};return db[_0xa866('0x31')][_0xa866('0x5c')]({'where':{'id':_0xaf190f[_0xa866('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2219f4,null))['then'](function(_0x1cb317){if(_0x1cb317){_0x3e7559[_0xa866('0x39')]=_[_0xa866('0x35')](db[_0xa866('0x5f')][_0xa866('0x32')]);_0x3e7559['query']=_['keys'](_0xaf190f[_0xa866('0x36')]);_0x3e7559['filters']=_[_0xa866('0x38')](_0x3e7559['model'],_0x3e7559[_0xa866('0x36')]);_0x3fca14[_0xa866('0x3a')]=_[_0xa866('0x38')](_0x3e7559[_0xa866('0x39')],qs[_0xa866('0x3b')](_0xaf190f[_0xa866('0x36')][_0xa866('0x3b')]));_0x3fca14[_0xa866('0x3a')]=_0x3fca14['attributes']['length']?_0x3fca14[_0xa866('0x3a')]:_0x3e7559[_0xa866('0x39')];if(!_0xaf190f[_0xa866('0x36')]['hasOwnProperty']('nolimit')){_0x3fca14['limit']=qs['limit'](_0xaf190f['query'][_0xa866('0x20')]);_0x3fca14[_0xa866('0x1e')]=qs[_0xa866('0x1e')](_0xaf190f[_0xa866('0x36')][_0xa866('0x1e')]);}_0x3fca14[_0xa866('0x3f')]=qs['sort'](_0xaf190f[_0xa866('0x36')]['sort']);_0x3fca14[_0xa866('0x41')]=qs[_0xa866('0x37')](_[_0xa866('0x42')](_0xaf190f['query'],_0x3e7559[_0xa866('0x37')]));_0x3fca14[_0xa866('0x41')][_0xa866('0x5e')]=_0x1cb317['id'];if(_0xaf190f['query'][_0xa866('0x43')]){_0x3fca14[_0xa866('0x41')]=_[_0xa866('0x44')](_0x3fca14[_0xa866('0x41')],{'$or':_[_0xa866('0x30')](_0x3fca14[_0xa866('0x3a')],function(_0x5237e2){var _0x218cb3={};_0x218cb3[_0x5237e2]={'$like':'%'+_0xaf190f[_0xa866('0x36')]['filter']+'%'};return _0x218cb3;})});}_0x3fca14=_[_0xa866('0x44')]({},_0x3fca14,_0xaf190f[_0xa866('0x46')]);return db['JscriptyAnswerReport'][_0xa866('0x21')]({'where':_0x3fca14[_0xa866('0x41')]})['then'](function(_0x332c5f){_0x45232e['count']=_0x332c5f;if(_0xaf190f[_0xa866('0x36')][_0xa866('0x47')]){_0x3fca14['include']=[{'all':!![]}];}return db[_0xa866('0x5f')][_0xa866('0x60')](_0x3fca14);})[_0xa866('0x27')](function(_0x14742a){_0x45232e[_0xa866('0x49')]=_0x14742a;return _0x45232e;});}})['then'](respondWithFilteredResult(_0x2219f4,_0x3fca14))[_0xa866('0x4d')](handleError(_0x2219f4,null));};function char(_0x28352c){return _0xa866('0x61')===typeof _0x28352c?String['fromCharCode'][_0xa866('0x23')](null,arguments):_0x28352c;}function needsEncapsulation(_0x326e3b){return!!_0x326e3b&&(_0x326e3b[_0xa866('0x62')]()['indexOf'](char(0xd))>=0x0||_0x326e3b[_0xa866('0x62')]()[_0xa866('0x63')](char(0xa))>=0x0||_0x326e3b[_0xa866('0x62')]()['indexOf'](char(0x2c))>=0x0||_0x326e3b[_0xa866('0x62')]()[_0xa866('0x63')](char(0x22))>=0x0);}function encapsulate(_0x2678a3){var _0x27b360=char(0x22),_0x472f73='\x5c'+char(0x22),_0x9bc8a3=_0x2678a3['toString']()[_0xa866('0x64')](new RegExp(_0x27b360,'g'),_0x472f73);return _0x27b360+_0x9bc8a3+_0x27b360;}exports[_0xa866('0x65')]=function(_0x2ce4cf,_0x32380e,_0x21aeba){var _0x1f5c14,_0x50c7f0;var _0x22188b={'where':{'ProjectId':_0x2ce4cf[_0xa866('0x4b')]['id']}};if(_0x2ce4cf[_0xa866('0x36')][_0xa866('0x66')]){_0x22188b[_0xa866('0x41')][_0xa866('0x67')]=JSON[_0xa866('0x68')](_0x2ce4cf[_0xa866('0x36')]['startTime']);}return db[_0xa866('0x5d')][_0xa866('0x60')](_0x22188b)[_0xa866('0x27')](handleEntityNotFound(_0x32380e,null))['then'](function(_0x51931c){if(_0x51931c){_0x1f5c14=_0x51931c;return db[_0xa866('0x69')][_0xa866('0x60')]({'where':{'SessionId':{'$in':_[_0xa866('0x30')](_0x1f5c14,'id')},'ProjectId':_0x2ce4cf[_0xa866('0x4b')]['id']},'order':_0xa866('0x6a')});}})['then'](handleEntityNotFound(_0x32380e,null))[_0xa866('0x27')](function(_0x169358){if(_0x169358){_0x50c7f0=_0x169358;var _0x4ee6d8={};for(var _0x4e2c44=0x0,_0x26876d=_0x50c7f0[_0xa866('0x3c')];_0x4e2c44<_0x26876d;_0x4e2c44++){if(!_0x4ee6d8['hasOwnProperty'](_0x50c7f0[_0x4e2c44][_0xa866('0x6b')])){_0x4ee6d8[_0x50c7f0[_0x4e2c44][_0xa866('0x6b')]]=needsEncapsulation(_0x50c7f0[_0x4e2c44]['question'])?encapsulate(_0x50c7f0[_0x4e2c44]['question']):_0x50c7f0[_0x4e2c44][_0xa866('0x6c')];}}var _0x2a24d0=[],_0x133d37={};for(var _0x5ac28c=0x0,_0x835077=_0x1f5c14[_0xa866('0x3c')];_0x5ac28c<_0x835077;_0x5ac28c++){_0x133d37={'ProjectId':_0x2ce4cf[_0xa866('0x4b')]['id'],'SessionId':_0x1f5c14[_0x5ac28c]['id'],'StartTime':moment(_0x1f5c14[_0x5ac28c][_0xa866('0x67')])['format'](_0xa866('0x6d'))};for(var _0x56e528=0x0,_0x15ecb7=_0x50c7f0['length'];_0x56e528<_0x15ecb7;_0x56e528++){if(_0x50c7f0[_0x56e528]['SessionId']==_0x1f5c14[_0x5ac28c]['id']&&_0x4ee6d8[_0xa866('0x3d')](_0x50c7f0[_0x56e528][_0xa866('0x6b')])){_0x133d37[_0x4ee6d8[_0x50c7f0[_0x56e528][_0xa866('0x6b')]]]=_0x50c7f0[_0x56e528]['answer'];}}for(var _0x57a6f7 in _0x4ee6d8){if(!_0x133d37[_0xa866('0x3d')](_0x4ee6d8[_0x57a6f7])){_0x133d37[_0x4ee6d8[_0x57a6f7]]=null;}}_0x2a24d0['push'](_0x133d37);}return _0x2a24d0;}})[_0xa866('0x27')](function(_0xb47da0){if(!_['isEmpty'](_0xb47da0)){var _0x5e47da=toCsv(_0xb47da0);var _0x571fc2=Date[_0xa866('0x6e')]();fs[_0xa866('0x6f')](util[_0xa866('0x70')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2ce4cf[_0xa866('0x4b')]['id'],_0x571fc2),_0x5e47da);_0x32380e[_0xa866('0x71')](_0xa866('0x72'),'attachment;\x20filename='+util[_0xa866('0x70')](_0xa866('0x73'),_0x2ce4cf[_0xa866('0x4b')]['id'],_0x571fc2));_0x32380e[_0xa866('0x71')](_0xa866('0x74'),_0xa866('0x75'));return _0x32380e[_0xa866('0x76')](util[_0xa866('0x70')](_0xa866('0x77'),_0x2ce4cf[_0xa866('0x4b')]['id'],_0x571fc2));}else{return _0x32380e[_0xa866('0x1a')](0xcc);}})['catch'](handleError(_0x32380e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 9133ffa..fedc517 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 _0xb3ea=['../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x4baf9a,_0x36b1b2){var _0x4fbcd9=function(_0x558ae6){while(--_0x558ae6){_0x4baf9a['push'](_0x4baf9a['shift']());}};_0x4fbcd9(++_0x36b1b2);}(_0xb3ea,0x10d));var _0xab3e=function(_0x1f9f0f,_0x42dbc4){_0x1f9f0f=_0x1f9f0f-0x0;var _0x11e59f=_0xb3ea[_0x1f9f0f];return _0x11e59f;};'use strict';var _=require(_0xab3e('0x0'));var util=require(_0xab3e('0x1'));var logger=require(_0xab3e('0x2'))('api');var moment=require(_0xab3e('0x3'));var BPromise=require('bluebird');var rp=require(_0xab3e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab3e('0x5'));var config=require(_0xab3e('0x6'));var attributes=require(_0xab3e('0x7'));module[_0xab3e('0x8')]=function(_0x135941,_0x570744){return _0x135941[_0xab3e('0x9')]('JscriptyProject',attributes,{'tableName':_0xab3e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39c7=['../../config/environment','./jscriptyProject.attributes','define','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x5ad22d,_0x24208f){var _0x4390e8=function(_0x3726b9){while(--_0x3726b9){_0x5ad22d['push'](_0x5ad22d['shift']());}};_0x4390e8(++_0x24208f);}(_0x39c7,0x85));var _0x739c=function(_0x44f974,_0x4db616){_0x44f974=_0x44f974-0x0;var _0x805dbd=_0x39c7[_0x44f974];return _0x805dbd;};'use strict';var _=require('lodash');var util=require(_0x739c('0x0'));var logger=require(_0x739c('0x1'))(_0x739c('0x2'));var moment=require(_0x739c('0x3'));var BPromise=require(_0x739c('0x4'));var rp=require(_0x739c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x739c('0x6'));var config=require(_0x739c('0x7'));var attributes=require(_0x739c('0x8'));module['exports']=function(_0x4c5030,_0x1923d9){return _0x4c5030[_0x739c('0x9')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 3b6494c..b183b4b 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x26dcaf,_0x496939){var _0x17d7a0=function(_0x487dab){while(--_0x487dab){_0x26dcaf['push'](_0x26dcaf['shift']());}};_0x17d7a0(++_0x496939);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x134d5e,_0x2a47d8){_0x134d5e=_0x134d5e-0x0;var _0x1e166a=_0xcb91[_0x134d5e];return _0x1e166a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x5bad30,_0x5ec213){var _0x303abe=function(_0x2741d8){while(--_0x2741d8){_0x5bad30['push'](_0x5bad30['shift']());}};_0x303abe(++_0x5ec213);}(_0x54ef,0x112));var _0xf54e=function(_0x9ce17c,_0x5e2709){_0x9ce17c=_0x9ce17c-0x0;var _0x2381c7=_0x54ef[_0x9ce17c];return _0x2381c7;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index c91cabd..23aa384 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 _0x0ebe=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','delete','exports','multer'];(function(_0x2977e8,_0x257939){var _0x9da807=function(_0x420d3f){while(--_0x420d3f){_0x2977e8['push'](_0x2977e8['shift']());}};_0x9da807(++_0x257939);}(_0x0ebe,0x1b7));var _0xe0eb=function(_0x1ced95,_0x2cced4){_0x1ced95=_0x1ced95-0x0;var _0x265ec6=_0x0ebe[_0x1ced95];return _0x265ec6;};'use strict';var multer=require(_0xe0eb('0x0'));var util=require(_0xe0eb('0x1'));var path=require(_0xe0eb('0x2'));var timeout=require(_0xe0eb('0x3'));var express=require(_0xe0eb('0x4'));var router=express[_0xe0eb('0x5')]();var fs_extra=require(_0xe0eb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe0eb('0x7'));var config=require(_0xe0eb('0x8'));var controller=require(_0xe0eb('0x9'));router[_0xe0eb('0xa')]('/',auth[_0xe0eb('0xb')](),controller[_0xe0eb('0xc')]);router[_0xe0eb('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xe0eb('0xd')]);router[_0xe0eb('0xa')](_0xe0eb('0xe'),auth[_0xe0eb('0xb')](),controller[_0xe0eb('0xf')]);router['post']('/',auth[_0xe0eb('0xb')](),controller[_0xe0eb('0x10')]);router[_0xe0eb('0x11')]('/:id',auth[_0xe0eb('0xb')](),controller['update']);router[_0xe0eb('0x12')](_0xe0eb('0xe'),auth[_0xe0eb('0xb')](),controller['destroy']);module[_0xe0eb('0x13')]=router; \ No newline at end of file +var _0xd68a=['show','post','put','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x48d007,_0x446953){var _0x412d80=function(_0x20cccd){while(--_0x20cccd){_0x48d007['push'](_0x48d007['shift']());}};_0x412d80(++_0x446953);}(_0xd68a,0x8a));var _0xad68=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xd68a[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0xad68('0x0'));var util=require('util');var path=require(_0xad68('0x1'));var timeout=require(_0xad68('0x2'));var express=require('express');var router=express[_0xad68('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xad68('0x4'));var interaction=require(_0xad68('0x5'));var config=require(_0xad68('0x6'));var controller=require(_0xad68('0x7'));router[_0xad68('0x8')]('/',auth[_0xad68('0x9')](),controller[_0xad68('0xa')]);router[_0xad68('0x8')](_0xad68('0xb'),auth[_0xad68('0x9')](),controller[_0xad68('0xc')]);router[_0xad68('0x8')](_0xad68('0xd'),auth[_0xad68('0x9')](),controller[_0xad68('0xe')]);router[_0xad68('0xf')]('/',auth[_0xad68('0x9')](),controller['create']);router[_0xad68('0x10')](_0xad68('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xad68('0x9')](),controller[_0xad68('0x11')]);module[_0xad68('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 2a7e62f..8a711bf 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(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0x4fa899,_0x2c5ae8){_0x4fa899=_0x4fa899-0x0;var _0x3caa45=_0x7a54[_0x4fa899];return _0x3caa45;};'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(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0x507bb6,_0x2796d8){_0x507bb6=_0x507bb6-0x0;var _0x39c5b7=_0x7a54[_0x507bb6];return _0x39c5b7;};'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 8e7fce0..da73694 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 _0x4fd5=['rawAttributes','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','JscriptyQuestionReport','count','includeAll','findAll','rows','catch','show','include','options','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4fd5,0x1d5));var _0x54fd=function(_0x408b16,_0x4316d8){_0x408b16=_0x408b16-0x0;var _0x2d1253=_0x4fd5[_0x408b16];return _0x2d1253;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54fd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54fd('0x1'));var rp=require(_0x54fd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x54fd('0x3'));var util=require(_0x54fd('0x4'));var path=require('path');var sox=require(_0x54fd('0x5'));var csv=require(_0x54fd('0x6'));var ejs=require(_0x54fd('0x7'));var fs=require('fs');var fs_extra=require(_0x54fd('0x8'));var _=require('lodash');var squel=require(_0x54fd('0x9'));var crypto=require(_0x54fd('0xa'));var jsforce=require(_0x54fd('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x54fd('0x6'));var querystring=require(_0x54fd('0xc'));var Papa=require(_0x54fd('0xd'));var Redis=require(_0x54fd('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x54fd('0xf'));var hardwareService=require(_0x54fd('0x10'));var logger=require(_0x54fd('0x11'))('api');var utils=require(_0x54fd('0x12'));var config=require(_0x54fd('0x13'));var licenseUtil=require(_0x54fd('0x14'));var db=require(_0x54fd('0x15'))['db'];function respondWithStatusCode(_0x2233e7,_0x2cdc36){_0x2cdc36=_0x2cdc36||0xcc;return function(_0x58a291){if(_0x58a291){return _0x2233e7[_0x54fd('0x16')](_0x2cdc36);}return _0x2233e7[_0x54fd('0x17')](_0x2cdc36)[_0x54fd('0x18')]();};}function respondWithResult(_0x5b2c0e,_0x1cc04b){_0x1cc04b=_0x1cc04b||0xc8;return function(_0x5df82d){if(_0x5df82d){return _0x5b2c0e['status'](_0x1cc04b)[_0x54fd('0x19')](_0x5df82d);}};}function respondWithFilteredResult(_0x1c81b4,_0x3e9544){return function(_0x2ed41a){if(_0x2ed41a){var _0x412439=typeof _0x3e9544[_0x54fd('0x1a')]===_0x54fd('0x1b')&&typeof _0x3e9544[_0x54fd('0x1c')]===_0x54fd('0x1b');var _0x5dd95e=_0x2ed41a['count'];var _0x3ad2b7=_0x412439?0x0:_0x3e9544[_0x54fd('0x1a')];var _0x3524d3=_0x412439?_0x2ed41a['count']:_0x3e9544[_0x54fd('0x1a')]+_0x3e9544[_0x54fd('0x1c')];var _0x3aac77;if(_0x3524d3>=_0x5dd95e){_0x3524d3=_0x5dd95e;_0x3aac77=0xc8;}else{_0x3aac77=0xce;}_0x1c81b4[_0x54fd('0x17')](_0x3aac77);return _0x1c81b4[_0x54fd('0x1d')](_0x54fd('0x1e'),_0x3ad2b7+'-'+_0x3524d3+'/'+_0x5dd95e)[_0x54fd('0x19')](_0x2ed41a);}return null;};}function patchUpdates(_0x19e187){return function(_0xe9b25a){try{jsonpatch[_0x54fd('0x1f')](_0xe9b25a,_0x19e187,!![]);}catch(_0x195a74){return BPromise['reject'](_0x195a74);}return _0xe9b25a[_0x54fd('0x20')]();};}function saveUpdates(_0x1b0c82,_0x5aa434){return function(_0x1a0389){if(_0x1a0389){return _0x1a0389[_0x54fd('0x21')](_0x1b0c82)[_0x54fd('0x22')](function(_0x10bd4e){return _0x10bd4e;});}return null;};}function removeEntity(_0x1d8c4f,_0x3c91da){return function(_0x47d2c3){if(_0x47d2c3){return _0x47d2c3[_0x54fd('0x23')]()[_0x54fd('0x22')](function(){_0x1d8c4f[_0x54fd('0x17')](0xcc)[_0x54fd('0x18')]();});}};}function handleEntityNotFound(_0x449c12,_0x570c55){return function(_0x324c51){if(!_0x324c51){_0x449c12['sendStatus'](0x194);}return _0x324c51;};}function handleError(_0x2592cb,_0x559d00){_0x559d00=_0x559d00||0x1f4;return function(_0x4513c5){logger[_0x54fd('0x24')](_0x4513c5[_0x54fd('0x25')]);if(_0x4513c5[_0x54fd('0x26')]){delete _0x4513c5[_0x54fd('0x26')];}_0x2592cb[_0x54fd('0x17')](_0x559d00)[_0x54fd('0x27')](_0x4513c5);};}exports[_0x54fd('0x28')]=function(_0x3eac64,_0x2d7c4b){var _0x26b966={},_0x1cc48f={},_0x3b1e8e={'count':0x0,'rows':[]};var _0x3ef1f0=_[_0x54fd('0x29')](db['JscriptyQuestionReport'][_0x54fd('0x2a')],function(_0x352157){return{'name':_0x352157['fieldName'],'type':_0x352157['type'][_0x54fd('0x2b')]};});_0x1cc48f[_0x54fd('0x2c')]=_[_0x54fd('0x29')](_0x3ef1f0,'name');_0x1cc48f['query']=_[_0x54fd('0x2d')](_0x3eac64['query']);_0x1cc48f[_0x54fd('0x2e')]=_[_0x54fd('0x2f')](_0x1cc48f[_0x54fd('0x2c')],_0x1cc48f[_0x54fd('0x30')]);_0x26b966[_0x54fd('0x31')]=_[_0x54fd('0x2f')](_0x1cc48f[_0x54fd('0x2c')],qs[_0x54fd('0x32')](_0x3eac64['query'][_0x54fd('0x32')]));_0x26b966[_0x54fd('0x31')]=_0x26b966[_0x54fd('0x31')][_0x54fd('0x33')]?_0x26b966[_0x54fd('0x31')]:_0x1cc48f['model'];if(!_0x3eac64[_0x54fd('0x30')][_0x54fd('0x34')]('nolimit')){_0x26b966[_0x54fd('0x1c')]=qs[_0x54fd('0x1c')](_0x3eac64[_0x54fd('0x30')][_0x54fd('0x1c')]);_0x26b966[_0x54fd('0x1a')]=qs['offset'](_0x3eac64[_0x54fd('0x30')]['offset']);}_0x26b966[_0x54fd('0x35')]=qs[_0x54fd('0x36')](_0x3eac64[_0x54fd('0x30')][_0x54fd('0x36')]);_0x26b966[_0x54fd('0x37')]=qs[_0x54fd('0x2e')](_['pick'](_0x3eac64[_0x54fd('0x30')],_0x1cc48f[_0x54fd('0x2e')]),_0x3ef1f0);if(_0x3eac64[_0x54fd('0x30')]['filter']){_0x26b966[_0x54fd('0x37')]=_[_0x54fd('0x38')](_0x26b966[_0x54fd('0x37')],{'$or':_[_0x54fd('0x29')](_0x3ef1f0,function(_0xd08b7e){if(_0xd08b7e['type']!==_0x54fd('0x39')){var _0x3b7d0e={};_0x3b7d0e[_0xd08b7e['name']]={'$like':'%'+_0x3eac64[_0x54fd('0x30')][_0x54fd('0x3a')]+'%'};return _0x3b7d0e;}})});}_0x26b966=_[_0x54fd('0x38')]({},_0x26b966,_0x3eac64['options']);var _0x49b32d={'where':_0x26b966[_0x54fd('0x37')]};return db[_0x54fd('0x3b')][_0x54fd('0x3c')](_0x49b32d)[_0x54fd('0x22')](function(_0x5bcf86){_0x3b1e8e[_0x54fd('0x3c')]=_0x5bcf86;if(_0x3eac64[_0x54fd('0x30')][_0x54fd('0x3d')]){_0x26b966['include']=[{'all':!![]}];}return db[_0x54fd('0x3b')][_0x54fd('0x3e')](_0x26b966);})[_0x54fd('0x22')](function(_0x4f4916){_0x3b1e8e[_0x54fd('0x3f')]=_0x4f4916;return _0x3b1e8e;})[_0x54fd('0x22')](respondWithFilteredResult(_0x2d7c4b,_0x26b966))[_0x54fd('0x40')](handleError(_0x2d7c4b,null));};exports[_0x54fd('0x41')]=function(_0x495a3c,_0x2719b9){var _0x513510={'raw':!![],'where':{'id':_0x495a3c['params']['id']}},_0xf22556={};_0xf22556[_0x54fd('0x2c')]=_['keys'](db[_0x54fd('0x3b')]['rawAttributes']);_0xf22556[_0x54fd('0x30')]=_[_0x54fd('0x2d')](_0x495a3c['query']);_0xf22556[_0x54fd('0x2e')]=_[_0x54fd('0x2f')](_0xf22556['model'],_0xf22556[_0x54fd('0x30')]);_0x513510[_0x54fd('0x31')]=_['intersection'](_0xf22556[_0x54fd('0x2c')],qs['fields'](_0x495a3c[_0x54fd('0x30')][_0x54fd('0x32')]));_0x513510[_0x54fd('0x31')]=_0x513510[_0x54fd('0x31')][_0x54fd('0x33')]?_0x513510['attributes']:_0xf22556[_0x54fd('0x2c')];if(_0x495a3c['query'][_0x54fd('0x3d')]){_0x513510[_0x54fd('0x42')]=[{'all':!![]}];}_0x513510=_[_0x54fd('0x38')]({},_0x513510,_0x495a3c[_0x54fd('0x43')]);return db['JscriptyQuestionReport'][_0x54fd('0x44')](_0x513510)[_0x54fd('0x22')](handleEntityNotFound(_0x2719b9,null))[_0x54fd('0x22')](respondWithResult(_0x2719b9,null))['catch'](handleError(_0x2719b9,null));};exports[_0x54fd('0x45')]=function(_0x382946,_0x159670){return db['JscriptyQuestionReport'][_0x54fd('0x45')](_0x382946[_0x54fd('0x46')],{})[_0x54fd('0x22')](respondWithResult(_0x159670,0xc9))[_0x54fd('0x40')](handleError(_0x159670,null));};exports[_0x54fd('0x21')]=function(_0x25437f,_0x577518){if(_0x25437f[_0x54fd('0x46')]['id']){delete _0x25437f[_0x54fd('0x46')]['id'];}return db[_0x54fd('0x3b')][_0x54fd('0x44')]({'where':{'id':_0x25437f[_0x54fd('0x47')]['id']}})['then'](handleEntityNotFound(_0x577518,null))[_0x54fd('0x22')](saveUpdates(_0x25437f[_0x54fd('0x46')],null))[_0x54fd('0x22')](respondWithResult(_0x577518,null))[_0x54fd('0x40')](handleError(_0x577518,null));};exports[_0x54fd('0x23')]=function(_0x463a96,_0x5a8181){return db['JscriptyQuestionReport'][_0x54fd('0x44')]({'where':{'id':_0x463a96['params']['id']}})[_0x54fd('0x22')](handleEntityNotFound(_0x5a8181,null))[_0x54fd('0x22')](removeEntity(_0x5a8181,null))[_0x54fd('0x40')](handleError(_0x5a8181,null));};exports['describe']=function(_0xab7245,_0x49a4d1){return db[_0x54fd('0x3b')][_0x54fd('0x48')]()[_0x54fd('0x22')](respondWithResult(_0x49a4d1,null))[_0x54fd('0x40')](handleError(_0x49a4d1,null));}; \ No newline at end of file +var _0x4799=['then','destroy','send','index','map','JscriptyQuestionReport','type','key','name','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','update','describe','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save'];(function(_0x4ab2b6,_0x12163b){var _0x26877e=function(_0x27102){while(--_0x27102){_0x4ab2b6['push'](_0x4ab2b6['shift']());}};_0x26877e(++_0x12163b);}(_0x4799,0x71));var _0x9479=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4799[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x9479('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9479('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9479('0x2'));var moment=require('moment');var BPromise=require(_0x9479('0x3'));var Mustache=require(_0x9479('0x4'));var util=require('util');var path=require(_0x9479('0x5'));var sox=require(_0x9479('0x6'));var csv=require(_0x9479('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9479('0x8'));var _=require(_0x9479('0x9'));var squel=require(_0x9479('0xa'));var crypto=require('crypto');var jsforce=require(_0x9479('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9479('0x7'));var querystring=require(_0x9479('0xc'));var Papa=require(_0x9479('0xd'));var Redis=require(_0x9479('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9479('0xf'));var hardwareService=require(_0x9479('0x10'));var logger=require(_0x9479('0x11'))(_0x9479('0x12'));var utils=require(_0x9479('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9479('0x14'))['db'];function respondWithStatusCode(_0x3acb51,_0x6a9f79){_0x6a9f79=_0x6a9f79||0xcc;return function(_0x54e2da){if(_0x54e2da){return _0x3acb51[_0x9479('0x15')](_0x6a9f79);}return _0x3acb51['status'](_0x6a9f79)[_0x9479('0x16')]();};}function respondWithResult(_0x92d8a1,_0x31357c){_0x31357c=_0x31357c||0xc8;return function(_0xce22cc){if(_0xce22cc){return _0x92d8a1[_0x9479('0x17')](_0x31357c)[_0x9479('0x18')](_0xce22cc);}};}function respondWithFilteredResult(_0x1660f6,_0x3cbe3c){return function(_0x59a9c8){if(_0x59a9c8){var _0x33e465=typeof _0x3cbe3c[_0x9479('0x19')]===_0x9479('0x1a')&&typeof _0x3cbe3c[_0x9479('0x1b')]==='undefined';var _0x316e4e=_0x59a9c8[_0x9479('0x1c')];var _0x25291d=_0x33e465?0x0:_0x3cbe3c[_0x9479('0x19')];var _0x2c9f61=_0x33e465?_0x59a9c8[_0x9479('0x1c')]:_0x3cbe3c['offset']+_0x3cbe3c[_0x9479('0x1b')];var _0x3cdb7b;if(_0x2c9f61>=_0x316e4e){_0x2c9f61=_0x316e4e;_0x3cdb7b=0xc8;}else{_0x3cdb7b=0xce;}_0x1660f6['status'](_0x3cdb7b);return _0x1660f6['set'](_0x9479('0x1d'),_0x25291d+'-'+_0x2c9f61+'/'+_0x316e4e)[_0x9479('0x18')](_0x59a9c8);}return null;};}function patchUpdates(_0x561784){return function(_0x2a45e4){try{jsonpatch[_0x9479('0x1e')](_0x2a45e4,_0x561784,!![]);}catch(_0x212958){return BPromise[_0x9479('0x1f')](_0x212958);}return _0x2a45e4[_0x9479('0x20')]();};}function saveUpdates(_0x5c3376,_0x3b315e){return function(_0x560473){if(_0x560473){return _0x560473['update'](_0x5c3376)[_0x9479('0x21')](function(_0x1bd997){return _0x1bd997;});}return null;};}function removeEntity(_0x4cff26,_0xabd3f6){return function(_0x723016){if(_0x723016){return _0x723016[_0x9479('0x22')]()[_0x9479('0x21')](function(){_0x4cff26[_0x9479('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1266d8,_0x420bb5){return function(_0xb24638){if(!_0xb24638){_0x1266d8[_0x9479('0x15')](0x194);}return _0xb24638;};}function handleError(_0x5dfbae,_0x4e926d){_0x4e926d=_0x4e926d||0x1f4;return function(_0x521ec1){logger['error'](_0x521ec1['stack']);if(_0x521ec1['name']){delete _0x521ec1['name'];}_0x5dfbae['status'](_0x4e926d)[_0x9479('0x23')](_0x521ec1);};}exports[_0x9479('0x24')]=function(_0xc8139e,_0x39796e){var _0x8db4fe={},_0x5a3ac8={},_0x7c2cbb={'count':0x0,'rows':[]};var _0x3beee=_[_0x9479('0x25')](db[_0x9479('0x26')]['rawAttributes'],function(_0x4489ab){return{'name':_0x4489ab['fieldName'],'type':_0x4489ab[_0x9479('0x27')][_0x9479('0x28')]};});_0x5a3ac8['model']=_[_0x9479('0x25')](_0x3beee,_0x9479('0x29'));_0x5a3ac8[_0x9479('0x2a')]=_[_0x9479('0x2b')](_0xc8139e[_0x9479('0x2a')]);_0x5a3ac8[_0x9479('0x2c')]=_['intersection'](_0x5a3ac8['model'],_0x5a3ac8['query']);_0x8db4fe[_0x9479('0x2d')]=_[_0x9479('0x2e')](_0x5a3ac8[_0x9479('0x2f')],qs[_0x9479('0x30')](_0xc8139e[_0x9479('0x2a')][_0x9479('0x30')]));_0x8db4fe[_0x9479('0x2d')]=_0x8db4fe['attributes'][_0x9479('0x31')]?_0x8db4fe[_0x9479('0x2d')]:_0x5a3ac8['model'];if(!_0xc8139e[_0x9479('0x2a')][_0x9479('0x32')](_0x9479('0x33'))){_0x8db4fe['limit']=qs[_0x9479('0x1b')](_0xc8139e[_0x9479('0x2a')][_0x9479('0x1b')]);_0x8db4fe[_0x9479('0x19')]=qs[_0x9479('0x19')](_0xc8139e[_0x9479('0x2a')][_0x9479('0x19')]);}_0x8db4fe[_0x9479('0x34')]=qs[_0x9479('0x35')](_0xc8139e[_0x9479('0x2a')][_0x9479('0x35')]);_0x8db4fe[_0x9479('0x36')]=qs[_0x9479('0x2c')](_[_0x9479('0x37')](_0xc8139e[_0x9479('0x2a')],_0x5a3ac8[_0x9479('0x2c')]),_0x3beee);if(_0xc8139e['query']['filter']){_0x8db4fe[_0x9479('0x36')]=_[_0x9479('0x38')](_0x8db4fe['where'],{'$or':_[_0x9479('0x25')](_0x3beee,function(_0x137113){if(_0x137113[_0x9479('0x27')]!==_0x9479('0x39')){var _0x390e74={};_0x390e74[_0x137113['name']]={'$like':'%'+_0xc8139e[_0x9479('0x2a')][_0x9479('0x3a')]+'%'};return _0x390e74;}})});}_0x8db4fe=_[_0x9479('0x38')]({},_0x8db4fe,_0xc8139e['options']);var _0x5de34d={'where':_0x8db4fe[_0x9479('0x36')]};return db[_0x9479('0x26')]['count'](_0x5de34d)[_0x9479('0x21')](function(_0x5aa949){_0x7c2cbb[_0x9479('0x1c')]=_0x5aa949;if(_0xc8139e[_0x9479('0x2a')][_0x9479('0x3b')]){_0x8db4fe[_0x9479('0x3c')]=[{'all':!![]}];}return db[_0x9479('0x26')][_0x9479('0x3d')](_0x8db4fe);})['then'](function(_0x418721){_0x7c2cbb[_0x9479('0x3e')]=_0x418721;return _0x7c2cbb;})['then'](respondWithFilteredResult(_0x39796e,_0x8db4fe))[_0x9479('0x3f')](handleError(_0x39796e,null));};exports[_0x9479('0x40')]=function(_0x1a774c,_0x1b6707){var _0x362281={'raw':!![],'where':{'id':_0x1a774c[_0x9479('0x41')]['id']}},_0x2133ae={};_0x2133ae['model']=_[_0x9479('0x2b')](db[_0x9479('0x26')][_0x9479('0x42')]);_0x2133ae[_0x9479('0x2a')]=_[_0x9479('0x2b')](_0x1a774c[_0x9479('0x2a')]);_0x2133ae[_0x9479('0x2c')]=_[_0x9479('0x2e')](_0x2133ae[_0x9479('0x2f')],_0x2133ae['query']);_0x362281[_0x9479('0x2d')]=_[_0x9479('0x2e')](_0x2133ae[_0x9479('0x2f')],qs[_0x9479('0x30')](_0x1a774c[_0x9479('0x2a')][_0x9479('0x30')]));_0x362281[_0x9479('0x2d')]=_0x362281[_0x9479('0x2d')][_0x9479('0x31')]?_0x362281[_0x9479('0x2d')]:_0x2133ae[_0x9479('0x2f')];if(_0x1a774c[_0x9479('0x2a')][_0x9479('0x3b')]){_0x362281[_0x9479('0x3c')]=[{'all':!![]}];}_0x362281=_['merge']({},_0x362281,_0x1a774c[_0x9479('0x43')]);return db[_0x9479('0x26')][_0x9479('0x44')](_0x362281)[_0x9479('0x21')](handleEntityNotFound(_0x1b6707,null))[_0x9479('0x21')](respondWithResult(_0x1b6707,null))[_0x9479('0x3f')](handleError(_0x1b6707,null));};exports['create']=function(_0x2e0157,_0x3588df){return db[_0x9479('0x26')][_0x9479('0x45')](_0x2e0157[_0x9479('0x46')],{})[_0x9479('0x21')](respondWithResult(_0x3588df,0xc9))[_0x9479('0x3f')](handleError(_0x3588df,null));};exports[_0x9479('0x47')]=function(_0x127de1,_0x14fe62){if(_0x127de1[_0x9479('0x46')]['id']){delete _0x127de1[_0x9479('0x46')]['id'];}return db[_0x9479('0x26')]['find']({'where':{'id':_0x127de1[_0x9479('0x41')]['id']}})['then'](handleEntityNotFound(_0x14fe62,null))['then'](saveUpdates(_0x127de1[_0x9479('0x46')],null))[_0x9479('0x21')](respondWithResult(_0x14fe62,null))['catch'](handleError(_0x14fe62,null));};exports[_0x9479('0x22')]=function(_0x3ff825,_0x4cb397){return db[_0x9479('0x26')]['find']({'where':{'id':_0x3ff825[_0x9479('0x41')]['id']}})[_0x9479('0x21')](handleEntityNotFound(_0x4cb397,null))[_0x9479('0x21')](removeEntity(_0x4cb397,null))['catch'](handleError(_0x4cb397,null));};exports['describe']=function(_0x3557d1,_0x292620){return db['JscriptyQuestionReport'][_0x9479('0x48')]()[_0x9479('0x21')](respondWithResult(_0x292620,null))[_0x9479('0x3f')](handleError(_0x292620,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index f1cc8a7..726087d 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 _0x2c68=['exports','report_jscripty_questions','lodash','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x4bda95,_0x9ccebb){var _0x37490e=function(_0x4b3bee){while(--_0x4b3bee){_0x4bda95['push'](_0x4bda95['shift']());}};_0x37490e(++_0x9ccebb);}(_0x2c68,0x122));var _0x82c6=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x2c68[_0x26462c];return _0x509a42;};'use strict';var _=require(_0x82c6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x82c6('0x1'));var moment=require(_0x82c6('0x2'));var BPromise=require(_0x82c6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x82c6('0x4'));var config=require(_0x82c6('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x82c6('0x6')]=function(_0x2d113e,_0x484614){return _0x2d113e['define']('JscriptyQuestionReport',attributes,{'tableName':_0x82c6('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7f7=['JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0xf7f7,0x1e2));var _0x7f7f=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0xf7f7[_0x3e7e96];return _0x13f6f0;};'use strict';var _=require(_0x7f7f('0x0'));var util=require(_0x7f7f('0x1'));var logger=require(_0x7f7f('0x2'))(_0x7f7f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7f7f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f7f('0x5'));var config=require(_0x7f7f('0x6'));var attributes=require(_0x7f7f('0x7'));module[_0x7f7f('0x8')]=function(_0x2c09f1,_0x54a8f7){return _0x2c09f1[_0x7f7f('0x9')](_0x7f7f('0xa'),attributes,{'tableName':_0x7f7f('0xb'),'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 9898df7..d8462fe 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 _0x900b=['request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','client'];(function(_0x482598,_0x54c1cf){var _0x4c9aae=function(_0xd8a837){while(--_0xd8a837){_0x482598['push'](_0x482598['shift']());}};_0x4c9aae(++_0x54c1cf);}(_0x900b,0x12b));var _0xb900=function(_0x316bbb,_0x3c2331){_0x316bbb=_0x316bbb-0x0;var _0x1cd0fa=_0x900b[_0x316bbb];return _0x1cd0fa;};'use strict';var _=require(_0xb900('0x0'));var util=require('util');var moment=require(_0xb900('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb900('0x2'));var db=require(_0xb900('0x3'))['db'];var utils=require(_0xb900('0x4'));var logger=require(_0xb900('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb900('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d8acb,_0x5e51c0,_0x53e7f9){return new BPromise(function(_0x5341e4,_0x45d7e6){return client[_0xb900('0x7')](_0x2d8acb,_0x53e7f9)['then'](function(_0x4cc06e){logger[_0xb900('0x8')](_0xb900('0x9'),_0x5e51c0,_0xb900('0xa'));logger[_0xb900('0xb')](_0xb900('0xc'),_0x5e51c0,_0xb900('0xa'),JSON[_0xb900('0xd')](_0x4cc06e));if(_0x4cc06e[_0xb900('0xe')]){if(_0x4cc06e[_0xb900('0xe')][_0xb900('0xf')]===0x1f4){logger['error'](_0xb900('0x9'),_0x5e51c0,_0x4cc06e[_0xb900('0xe')][_0xb900('0x10')]);return _0x45d7e6(_0x4cc06e['error']['message']);}logger[_0xb900('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5e51c0,_0x4cc06e[_0xb900('0xe')][_0xb900('0x10')]);return _0x5341e4(_0x4cc06e[_0xb900('0xe')][_0xb900('0x10')]);}else{logger[_0xb900('0x8')](_0xb900('0x9'),_0x5e51c0,_0xb900('0xa'));_0x5341e4(_0x4cc06e['result']['message']);}})[_0xb900('0x11')](function(_0x22f1d8){logger[_0xb900('0xe')](_0xb900('0x9'),_0x5e51c0,_0x22f1d8);_0x45d7e6(_0x22f1d8);});});} \ No newline at end of file +var _0xa7c6=['stringify','code','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s'];(function(_0x48e6c9,_0x46c2fd){var _0xf3f800=function(_0x4ce308){while(--_0x4ce308){_0x48e6c9['push'](_0x48e6c9['shift']());}};_0xf3f800(++_0x46c2fd);}(_0xa7c6,0x10d));var _0x6a7c=function(_0x3f4552,_0x581529){_0x3f4552=_0x3f4552-0x0;var _0x1f271c=_0xa7c6[_0x3f4552];return _0x1f271c;};'use strict';var _=require(_0x6a7c('0x0'));var util=require(_0x6a7c('0x1'));var moment=require(_0x6a7c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6a7c('0x3'));var fs=require('fs');var Redis=require(_0x6a7c('0x4'));var db=require(_0x6a7c('0x5'))['db'];var utils=require(_0x6a7c('0x6'));var logger=require(_0x6a7c('0x7'))(_0x6a7c('0x8'));var config=require(_0x6a7c('0x9'));var jayson=require(_0x6a7c('0xa'));var client=jayson[_0x6a7c('0xb')][_0x6a7c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48fb2e,_0x40bcc9,_0x220df1){return new BPromise(function(_0x4fb566,_0x27eaec){return client['request'](_0x48fb2e,_0x220df1)[_0x6a7c('0xd')](function(_0x57d998){logger[_0x6a7c('0xe')](_0x6a7c('0xf'),_0x40bcc9,_0x6a7c('0x10'));logger[_0x6a7c('0x11')](_0x6a7c('0x12'),_0x40bcc9,_0x6a7c('0x10'),JSON[_0x6a7c('0x13')](_0x57d998));if(_0x57d998['error']){if(_0x57d998['error'][_0x6a7c('0x14')]===0x1f4){logger[_0x6a7c('0x15')](_0x6a7c('0xf'),_0x40bcc9,_0x57d998['error'][_0x6a7c('0x16')]);return _0x27eaec(_0x57d998[_0x6a7c('0x15')][_0x6a7c('0x16')]);}logger[_0x6a7c('0x15')](_0x6a7c('0xf'),_0x40bcc9,_0x57d998[_0x6a7c('0x15')][_0x6a7c('0x16')]);return _0x4fb566(_0x57d998[_0x6a7c('0x15')][_0x6a7c('0x16')]);}else{logger[_0x6a7c('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x40bcc9,'request\x20sent');_0x4fb566(_0x57d998[_0x6a7c('0x17')]['message']);}})['catch'](function(_0x4f5020){logger[_0x6a7c('0x15')](_0x6a7c('0xf'),_0x40bcc9,_0x4f5020);_0x27eaec(_0x4f5020);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 07b6bd0..b290f91 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 _0x4a2c=['/describe','describe','/:id','show','getQuestions','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index'];(function(_0x50a9d9,_0x21a85c){var _0x53c25f=function(_0x12905f){while(--_0x12905f){_0x50a9d9['push'](_0x50a9d9['shift']());}};_0x53c25f(++_0x21a85c);}(_0x4a2c,0x1ae));var _0xc4a2=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0x4a2c[_0x421cf8];return _0x145c48;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc4a2('0x0'));var timeout=require(_0xc4a2('0x1'));var express=require(_0xc4a2('0x2'));var router=express['Router']();var fs_extra=require(_0xc4a2('0x3'));var auth=require(_0xc4a2('0x4'));var interaction=require(_0xc4a2('0x5'));var config=require('../../config/environment');var controller=require(_0xc4a2('0x6'));router[_0xc4a2('0x7')]('/',auth[_0xc4a2('0x8')](),controller[_0xc4a2('0x9')]);router[_0xc4a2('0x7')](_0xc4a2('0xa'),auth[_0xc4a2('0x8')](),controller[_0xc4a2('0xb')]);router[_0xc4a2('0x7')](_0xc4a2('0xc'),auth['isAuthenticated'](),controller[_0xc4a2('0xd')]);router['get']('/:id/questions',auth[_0xc4a2('0x8')](),controller[_0xc4a2('0xe')]);router[_0xc4a2('0xf')]('/',auth[_0xc4a2('0x8')](),controller[_0xc4a2('0x10')]);router[_0xc4a2('0x11')](_0xc4a2('0xc'),auth[_0xc4a2('0x8')](),controller[_0xc4a2('0x12')]);router[_0xc4a2('0x13')]('/:id',auth[_0xc4a2('0x8')](),controller[_0xc4a2('0x14')]);module[_0xc4a2('0x15')]=router; \ No newline at end of file +var _0x2161=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/:id','show','/:id/questions','getQuestions','post','delete','destroy','multer','util','path','connect-timeout'];(function(_0x187553,_0x172ba2){var _0x5e78cf=function(_0x536221){while(--_0x536221){_0x187553['push'](_0x187553['shift']());}};_0x5e78cf(++_0x172ba2);}(_0x2161,0x1df));var _0x1216=function(_0x44e7b6,_0x227953){_0x44e7b6=_0x44e7b6-0x0;var _0x325047=_0x2161[_0x44e7b6];return _0x325047;};'use strict';var multer=require(_0x1216('0x0'));var util=require(_0x1216('0x1'));var path=require(_0x1216('0x2'));var timeout=require(_0x1216('0x3'));var express=require(_0x1216('0x4'));var router=express[_0x1216('0x5')]();var fs_extra=require(_0x1216('0x6'));var auth=require(_0x1216('0x7'));var interaction=require(_0x1216('0x8'));var config=require(_0x1216('0x9'));var controller=require(_0x1216('0xa'));router[_0x1216('0xb')]('/',auth[_0x1216('0xc')](),controller[_0x1216('0xd')]);router['get']('/describe',auth[_0x1216('0xc')](),controller['describe']);router[_0x1216('0xb')](_0x1216('0xe'),auth[_0x1216('0xc')](),controller[_0x1216('0xf')]);router[_0x1216('0xb')](_0x1216('0x10'),auth['isAuthenticated'](),controller[_0x1216('0x11')]);router[_0x1216('0x12')]('/',auth[_0x1216('0xc')](),controller['create']);router['put'](_0x1216('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1216('0x13')](_0x1216('0xe'),auth[_0x1216('0xc')](),controller[_0x1216('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 fa06589..8d299ee 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 _0x1d50=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x1d50,0xc0));var _0x01d5=function(_0x10942c,_0x394305){_0x10942c=_0x10942c-0x0;var _0x4be0cc=_0x1d50[_0x10942c];return _0x4be0cc;};'use strict';var moment=require(_0x01d5('0x0'));var Sequelize=require(_0x01d5('0x1'));module[_0x01d5('0x2')]={'starttime':{'type':Sequelize[_0x01d5('0x3')],'set':function(_0xeca733){this[_0x01d5('0x4')](_0x01d5('0x5'),_0xeca733);this[_0x01d5('0x4')](_0x01d5('0x6'),moment()[_0x01d5('0x7')](_0x01d5('0x8')));}},'endtime':{'type':Sequelize[_0x01d5('0x3')]},'membername':{'type':Sequelize[_0x01d5('0x9')]},'projectname':{'type':Sequelize[_0x01d5('0x9')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x01d5('0x9')]},'calleridname':{'type':Sequelize[_0x01d5('0x9')]},'calleridnum':{'type':Sequelize[_0x01d5('0x9')]},'completed':{'type':Sequelize[_0x01d5('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0x0ecc=['STRING','BOOLEAN','sequelize','exports','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE'];(function(_0x5bb407,_0x21e52e){var _0x10bf70=function(_0x22153e){while(--_0x22153e){_0x5bb407['push'](_0x5bb407['shift']());}};_0x10bf70(++_0x21e52e);}(_0x0ecc,0x146));var _0xc0ec=function(_0x3d1e25,_0x251b4d){_0x3d1e25=_0x3d1e25-0x0;var _0x78b4d5=_0x0ecc[_0x3d1e25];return _0x78b4d5;};'use strict';var moment=require('moment');var Sequelize=require(_0xc0ec('0x0'));module[_0xc0ec('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x5a2097){this[_0xc0ec('0x2')]('starttime',_0x5a2097);this['setDataValue'](_0xc0ec('0x3'),moment()[_0xc0ec('0x4')](_0xc0ec('0x5')));}},'endtime':{'type':Sequelize[_0xc0ec('0x6')]},'membername':{'type':Sequelize[_0xc0ec('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xc0ec('0x7')]},'uniqueid':{'type':Sequelize[_0xc0ec('0x7')]},'calleridname':{'type':Sequelize[_0xc0ec('0x7')]},'calleridnum':{'type':Sequelize[_0xc0ec('0x7')]},'completed':{'type':Sequelize[_0xc0ec('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 2e3dcc6..129a9ad 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 _0x6ff0=['count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','JscriptySessionReport','includeAll','include','findAll','rows','catch','show','params','options','create','find','body','describe','getQuestions','findOne','SessionId','JscriptyQuestionReport','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0xcb8b1b,_0x5e0145){var _0x155b1b=function(_0x22706c){while(--_0x22706c){_0xcb8b1b['push'](_0xcb8b1b['shift']());}};_0x155b1b(++_0x5e0145);}(_0x6ff0,0x165));var _0x06ff=function(_0x178176,_0x326f1a){_0x178176=_0x178176-0x0;var _0x36c404=_0x6ff0[_0x178176];return _0x36c404;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06ff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06ff('0x1'));var rp=require(_0x06ff('0x2'));var moment=require(_0x06ff('0x3'));var BPromise=require(_0x06ff('0x4'));var Mustache=require(_0x06ff('0x5'));var util=require(_0x06ff('0x6'));var path=require('path');var sox=require(_0x06ff('0x7'));var csv=require(_0x06ff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06ff('0x9'));var _=require('lodash');var squel=require(_0x06ff('0xa'));var crypto=require(_0x06ff('0xb'));var jsforce=require(_0x06ff('0xc'));var deskjs=require(_0x06ff('0xd'));var toCsv=require(_0x06ff('0x8'));var querystring=require(_0x06ff('0xe'));var Papa=require(_0x06ff('0xf'));var Redis=require(_0x06ff('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x06ff('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06ff('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x06ff('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x06ff('0x14'))['db'];function respondWithStatusCode(_0x4c212e,_0x51c553){_0x51c553=_0x51c553||0xcc;return function(_0x590aaf){if(_0x590aaf){return _0x4c212e[_0x06ff('0x15')](_0x51c553);}return _0x4c212e[_0x06ff('0x16')](_0x51c553)[_0x06ff('0x17')]();};}function respondWithResult(_0x2ab355,_0x57ab04){_0x57ab04=_0x57ab04||0xc8;return function(_0x57b892){if(_0x57b892){return _0x2ab355[_0x06ff('0x16')](_0x57ab04)[_0x06ff('0x18')](_0x57b892);}};}function respondWithFilteredResult(_0x5e2fdd,_0x63cf6e){return function(_0x1e0057){if(_0x1e0057){var _0x5a81b6=typeof _0x63cf6e[_0x06ff('0x19')]===_0x06ff('0x1a')&&typeof _0x63cf6e[_0x06ff('0x1b')]===_0x06ff('0x1a');var _0x566b1e=_0x1e0057[_0x06ff('0x1c')];var _0x1998d2=_0x5a81b6?0x0:_0x63cf6e['offset'];var _0x17b9c8=_0x5a81b6?_0x1e0057[_0x06ff('0x1c')]:_0x63cf6e[_0x06ff('0x19')]+_0x63cf6e[_0x06ff('0x1b')];var _0x25a912;if(_0x17b9c8>=_0x566b1e){_0x17b9c8=_0x566b1e;_0x25a912=0xc8;}else{_0x25a912=0xce;}_0x5e2fdd[_0x06ff('0x16')](_0x25a912);return _0x5e2fdd[_0x06ff('0x1d')](_0x06ff('0x1e'),_0x1998d2+'-'+_0x17b9c8+'/'+_0x566b1e)[_0x06ff('0x18')](_0x1e0057);}return null;};}function patchUpdates(_0x5778cf){return function(_0x119bed){try{jsonpatch['apply'](_0x119bed,_0x5778cf,!![]);}catch(_0x5e2f86){return BPromise[_0x06ff('0x1f')](_0x5e2f86);}return _0x119bed[_0x06ff('0x20')]();};}function saveUpdates(_0x31969d,_0x349739){return function(_0x57a9fd){if(_0x57a9fd){return _0x57a9fd[_0x06ff('0x21')](_0x31969d)[_0x06ff('0x22')](function(_0x4839c1){return _0x4839c1;});}return null;};}function removeEntity(_0x42ee25,_0x22b993){return function(_0x1bf956){if(_0x1bf956){return _0x1bf956[_0x06ff('0x23')]()['then'](function(){_0x42ee25['status'](0xcc)[_0x06ff('0x17')]();});}};}function handleEntityNotFound(_0x46bed6,_0x3f7f7c){return function(_0x4d11ae){if(!_0x4d11ae){_0x46bed6[_0x06ff('0x15')](0x194);}return _0x4d11ae;};}function handleError(_0x9b1c6d,_0x1e8af1){_0x1e8af1=_0x1e8af1||0x1f4;return function(_0x498932){logger['error'](_0x498932[_0x06ff('0x24')]);if(_0x498932[_0x06ff('0x25')]){delete _0x498932['name'];}_0x9b1c6d[_0x06ff('0x16')](_0x1e8af1)[_0x06ff('0x26')](_0x498932);};}exports['index']=function(_0x19e76e,_0x2e60ec){var _0x520eee={},_0x56ee19={},_0x1dd2a8={'count':0x0,'rows':[]};var _0x375bef=_[_0x06ff('0x27')](db['JscriptySessionReport'][_0x06ff('0x28')],function(_0x421d14){return{'name':_0x421d14[_0x06ff('0x29')],'type':_0x421d14[_0x06ff('0x2a')][_0x06ff('0x2b')]};});_0x56ee19[_0x06ff('0x2c')]=_[_0x06ff('0x27')](_0x375bef,_0x06ff('0x25'));_0x56ee19[_0x06ff('0x2d')]=_[_0x06ff('0x2e')](_0x19e76e[_0x06ff('0x2d')]);_0x56ee19[_0x06ff('0x2f')]=_[_0x06ff('0x30')](_0x56ee19[_0x06ff('0x2c')],_0x56ee19[_0x06ff('0x2d')]);_0x520eee[_0x06ff('0x31')]=_[_0x06ff('0x30')](_0x56ee19[_0x06ff('0x2c')],qs[_0x06ff('0x32')](_0x19e76e['query'][_0x06ff('0x32')]));_0x520eee['attributes']=_0x520eee[_0x06ff('0x31')][_0x06ff('0x33')]?_0x520eee[_0x06ff('0x31')]:_0x56ee19['model'];if(!_0x19e76e[_0x06ff('0x2d')][_0x06ff('0x34')](_0x06ff('0x35'))){_0x520eee[_0x06ff('0x1b')]=qs['limit'](_0x19e76e[_0x06ff('0x2d')][_0x06ff('0x1b')]);_0x520eee[_0x06ff('0x19')]=qs['offset'](_0x19e76e[_0x06ff('0x2d')]['offset']);}_0x520eee[_0x06ff('0x36')]=qs[_0x06ff('0x37')](_0x19e76e['query'][_0x06ff('0x37')]);_0x520eee[_0x06ff('0x38')]=qs[_0x06ff('0x2f')](_[_0x06ff('0x39')](_0x19e76e['query'],_0x56ee19['filters']),_0x375bef);if(_0x19e76e[_0x06ff('0x2d')][_0x06ff('0x3a')]){_0x520eee[_0x06ff('0x38')]=_[_0x06ff('0x3b')](_0x520eee[_0x06ff('0x38')],{'$or':_[_0x06ff('0x27')](_0x375bef,function(_0x524c3d){if(_0x524c3d[_0x06ff('0x2a')]!=='VIRTUAL'){var _0x29c62d={};_0x29c62d[_0x524c3d[_0x06ff('0x25')]]={'$like':'%'+_0x19e76e['query'][_0x06ff('0x3a')]+'%'};return _0x29c62d;}})});}_0x520eee=_[_0x06ff('0x3b')]({},_0x520eee,_0x19e76e['options']);var _0x49cf0b={'where':_0x520eee[_0x06ff('0x38')]};return db[_0x06ff('0x3c')][_0x06ff('0x1c')](_0x49cf0b)['then'](function(_0x84544d){_0x1dd2a8['count']=_0x84544d;if(_0x19e76e[_0x06ff('0x2d')][_0x06ff('0x3d')]){_0x520eee[_0x06ff('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x06ff('0x3f')](_0x520eee);})[_0x06ff('0x22')](function(_0x360b3c){_0x1dd2a8[_0x06ff('0x40')]=_0x360b3c;return _0x1dd2a8;})[_0x06ff('0x22')](respondWithFilteredResult(_0x2e60ec,_0x520eee))[_0x06ff('0x41')](handleError(_0x2e60ec,null));};exports[_0x06ff('0x42')]=function(_0xe1ec26,_0x340712){var _0xdbcc17={'raw':!![],'where':{'id':_0xe1ec26[_0x06ff('0x43')]['id']}},_0x3b1bf2={};_0x3b1bf2[_0x06ff('0x2c')]=_[_0x06ff('0x2e')](db['JscriptySessionReport'][_0x06ff('0x28')]);_0x3b1bf2[_0x06ff('0x2d')]=_[_0x06ff('0x2e')](_0xe1ec26['query']);_0x3b1bf2[_0x06ff('0x2f')]=_[_0x06ff('0x30')](_0x3b1bf2[_0x06ff('0x2c')],_0x3b1bf2[_0x06ff('0x2d')]);_0xdbcc17[_0x06ff('0x31')]=_[_0x06ff('0x30')](_0x3b1bf2[_0x06ff('0x2c')],qs[_0x06ff('0x32')](_0xe1ec26[_0x06ff('0x2d')][_0x06ff('0x32')]));_0xdbcc17[_0x06ff('0x31')]=_0xdbcc17['attributes'][_0x06ff('0x33')]?_0xdbcc17['attributes']:_0x3b1bf2['model'];if(_0xe1ec26[_0x06ff('0x2d')][_0x06ff('0x3d')]){_0xdbcc17[_0x06ff('0x3e')]=[{'all':!![]}];}_0xdbcc17=_['merge']({},_0xdbcc17,_0xe1ec26[_0x06ff('0x44')]);return db[_0x06ff('0x3c')]['find'](_0xdbcc17)[_0x06ff('0x22')](handleEntityNotFound(_0x340712,null))[_0x06ff('0x22')](respondWithResult(_0x340712,null))[_0x06ff('0x41')](handleError(_0x340712,null));};exports['create']=function(_0x2e752f,_0x18d270){return db['JscriptySessionReport'][_0x06ff('0x45')](_0x2e752f['body'],{})['then'](respondWithResult(_0x18d270,0xc9))['catch'](handleError(_0x18d270,null));};exports[_0x06ff('0x21')]=function(_0x1b8778,_0x3cde1e){if(_0x1b8778['body']['id']){delete _0x1b8778['body']['id'];}return db[_0x06ff('0x3c')][_0x06ff('0x46')]({'where':{'id':_0x1b8778[_0x06ff('0x43')]['id']}})['then'](handleEntityNotFound(_0x3cde1e,null))[_0x06ff('0x22')](saveUpdates(_0x1b8778[_0x06ff('0x47')],null))[_0x06ff('0x22')](respondWithResult(_0x3cde1e,null))[_0x06ff('0x41')](handleError(_0x3cde1e,null));};exports[_0x06ff('0x23')]=function(_0x21f0f6,_0x3258e6){return db['JscriptySessionReport'][_0x06ff('0x46')]({'where':{'id':_0x21f0f6[_0x06ff('0x43')]['id']}})[_0x06ff('0x22')](handleEntityNotFound(_0x3258e6,null))[_0x06ff('0x22')](removeEntity(_0x3258e6,null))[_0x06ff('0x41')](handleError(_0x3258e6,null));};exports[_0x06ff('0x48')]=function(_0x10f18b,_0x41cbea){return db[_0x06ff('0x3c')][_0x06ff('0x48')]()['then'](respondWithResult(_0x41cbea,null))[_0x06ff('0x41')](handleError(_0x41cbea,null));};exports[_0x06ff('0x49')]=function(_0x4193f3,_0x2325a0,_0x3480c9){var _0x39b620={'raw':!![],'where':{}};var _0x5df530={};var _0x41fce5={'count':0x0,'rows':[]};return db[_0x06ff('0x3c')][_0x06ff('0x4a')]({'where':{'id':_0x4193f3['params']['id']}})[_0x06ff('0x22')](handleEntityNotFound(_0x2325a0,null))['then'](function(_0xc97e02){if(_0xc97e02){_0x5df530[_0x06ff('0x2c')]=_[_0x06ff('0x2e')](db['JscriptyQuestionReport'][_0x06ff('0x28')]);_0x5df530['query']=_[_0x06ff('0x2e')](_0x4193f3['query']);_0x5df530['filters']=_[_0x06ff('0x30')](_0x5df530['model'],_0x5df530[_0x06ff('0x2d')]);_0x39b620[_0x06ff('0x31')]=_[_0x06ff('0x30')](_0x5df530[_0x06ff('0x2c')],qs['fields'](_0x4193f3[_0x06ff('0x2d')][_0x06ff('0x32')]));_0x39b620[_0x06ff('0x31')]=_0x39b620[_0x06ff('0x31')][_0x06ff('0x33')]?_0x39b620[_0x06ff('0x31')]:_0x5df530[_0x06ff('0x2c')];if(!_0x4193f3['query'][_0x06ff('0x34')](_0x06ff('0x35'))){_0x39b620[_0x06ff('0x1b')]=qs['limit'](_0x4193f3['query'][_0x06ff('0x1b')]);_0x39b620[_0x06ff('0x19')]=qs[_0x06ff('0x19')](_0x4193f3[_0x06ff('0x2d')][_0x06ff('0x19')]);}_0x39b620[_0x06ff('0x36')]=qs[_0x06ff('0x37')](_0x4193f3['query'][_0x06ff('0x37')]);_0x39b620[_0x06ff('0x38')]=qs[_0x06ff('0x2f')](_[_0x06ff('0x39')](_0x4193f3['query'],_0x5df530['filters']));_0x39b620[_0x06ff('0x38')][_0x06ff('0x4b')]=_0xc97e02['id'];if(_0x4193f3['query']['filter']){_0x39b620[_0x06ff('0x38')]=_['merge'](_0x39b620[_0x06ff('0x38')],{'$or':_[_0x06ff('0x27')](_0x39b620[_0x06ff('0x31')],function(_0x1121d7){var _0x473efc={};_0x473efc[_0x1121d7]={'$like':'%'+_0x4193f3[_0x06ff('0x2d')]['filter']+'%'};return _0x473efc;})});}_0x39b620=_[_0x06ff('0x3b')]({},_0x39b620,_0x4193f3[_0x06ff('0x44')]);return db[_0x06ff('0x4c')]['count']({'where':_0x39b620[_0x06ff('0x38')]})[_0x06ff('0x22')](function(_0x47c2f7){_0x41fce5['count']=_0x47c2f7;if(_0x4193f3[_0x06ff('0x2d')]['includeAll']){_0x39b620[_0x06ff('0x3e')]=[{'all':!![]}];}return db[_0x06ff('0x4c')][_0x06ff('0x3f')](_0x39b620);})[_0x06ff('0x22')](function(_0x1dc8ab){_0x41fce5['rows']=_0x1dc8ab;return _0x41fce5;});}})[_0x06ff('0x22')](respondWithFilteredResult(_0x2325a0,_0x39b620))[_0x06ff('0x41')](handleError(_0x2325a0,null));}; \ No newline at end of file +var _0xc71c=['pick','where','VIRTUAL','merge','count','includeAll','findAll','rows','catch','params','options','find','create','body','destroy','describe','findOne','JscriptyQuestionReport','SessionId','filter','include','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','error','name','send','JscriptySessionReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x364192,_0x2ce6b4){var _0x493370=function(_0x32f21d){while(--_0x32f21d){_0x364192['push'](_0x364192['shift']());}};_0x493370(++_0x2ce6b4);}(_0xc71c,0x191));var _0xcc71=function(_0x1fcb63,_0x283fdc){_0x1fcb63=_0x1fcb63-0x0;var _0x3a5834=_0xc71c[_0x1fcb63];return _0x3a5834;};'use strict';var emlformat=require(_0xcc71('0x0'));var rimraf=require(_0xcc71('0x1'));var zipdir=require(_0xcc71('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc71('0x3'));var moment=require(_0xcc71('0x4'));var BPromise=require(_0xcc71('0x5'));var Mustache=require(_0xcc71('0x6'));var util=require(_0xcc71('0x7'));var path=require(_0xcc71('0x8'));var sox=require(_0xcc71('0x9'));var csv=require(_0xcc71('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc71('0xb'));var _=require('lodash');var squel=require(_0xcc71('0xc'));var crypto=require('crypto');var jsforce=require(_0xcc71('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcc71('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcc71('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcc71('0xf'));var hardwareService=require(_0xcc71('0x10'));var logger=require(_0xcc71('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xcc71('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc71('0x13'))['db'];function respondWithStatusCode(_0x5cfea7,_0x8abf67){_0x8abf67=_0x8abf67||0xcc;return function(_0x45a494){if(_0x45a494){return _0x5cfea7[_0xcc71('0x14')](_0x8abf67);}return _0x5cfea7[_0xcc71('0x15')](_0x8abf67)[_0xcc71('0x16')]();};}function respondWithResult(_0x4006c6,_0x58b02d){_0x58b02d=_0x58b02d||0xc8;return function(_0x138c42){if(_0x138c42){return _0x4006c6['status'](_0x58b02d)['json'](_0x138c42);}};}function respondWithFilteredResult(_0x3aa309,_0x1d35d4){return function(_0x5eff73){if(_0x5eff73){var _0x1358ca=typeof _0x1d35d4[_0xcc71('0x17')]===_0xcc71('0x18')&&typeof _0x1d35d4[_0xcc71('0x19')]===_0xcc71('0x18');var _0x54a0c6=_0x5eff73['count'];var _0x1b9140=_0x1358ca?0x0:_0x1d35d4[_0xcc71('0x17')];var _0xdce4ad=_0x1358ca?_0x5eff73['count']:_0x1d35d4[_0xcc71('0x17')]+_0x1d35d4[_0xcc71('0x19')];var _0x1c7b89;if(_0xdce4ad>=_0x54a0c6){_0xdce4ad=_0x54a0c6;_0x1c7b89=0xc8;}else{_0x1c7b89=0xce;}_0x3aa309['status'](_0x1c7b89);return _0x3aa309[_0xcc71('0x1a')](_0xcc71('0x1b'),_0x1b9140+'-'+_0xdce4ad+'/'+_0x54a0c6)[_0xcc71('0x1c')](_0x5eff73);}return null;};}function patchUpdates(_0x5318b6){return function(_0xee34c2){try{jsonpatch[_0xcc71('0x1d')](_0xee34c2,_0x5318b6,!![]);}catch(_0x50ed7c){return BPromise[_0xcc71('0x1e')](_0x50ed7c);}return _0xee34c2[_0xcc71('0x1f')]();};}function saveUpdates(_0x4e397a,_0x1d46b9){return function(_0x4dba6c){if(_0x4dba6c){return _0x4dba6c[_0xcc71('0x20')](_0x4e397a)[_0xcc71('0x21')](function(_0x3f9d04){return _0x3f9d04;});}return null;};}function removeEntity(_0x323310,_0x49f02c){return function(_0x408131){if(_0x408131){return _0x408131['destroy']()[_0xcc71('0x21')](function(){_0x323310[_0xcc71('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xae26,_0x377b47){return function(_0x2e0171){if(!_0x2e0171){_0xae26[_0xcc71('0x14')](0x194);}return _0x2e0171;};}function handleError(_0x3d1a6b,_0x31915d){_0x31915d=_0x31915d||0x1f4;return function(_0x1e2db8){logger[_0xcc71('0x22')](_0x1e2db8['stack']);if(_0x1e2db8[_0xcc71('0x23')]){delete _0x1e2db8[_0xcc71('0x23')];}_0x3d1a6b[_0xcc71('0x15')](_0x31915d)[_0xcc71('0x24')](_0x1e2db8);};}exports['index']=function(_0x50b98a,_0x51ebbb){var _0x40567d={},_0x4a3fdd={},_0x3e8886={'count':0x0,'rows':[]};var _0x429f98=_['map'](db[_0xcc71('0x25')][_0xcc71('0x26')],function(_0x49c2cb){return{'name':_0x49c2cb[_0xcc71('0x27')],'type':_0x49c2cb[_0xcc71('0x28')][_0xcc71('0x29')]};});_0x4a3fdd[_0xcc71('0x2a')]=_[_0xcc71('0x2b')](_0x429f98,'name');_0x4a3fdd[_0xcc71('0x2c')]=_[_0xcc71('0x2d')](_0x50b98a[_0xcc71('0x2c')]);_0x4a3fdd[_0xcc71('0x2e')]=_['intersection'](_0x4a3fdd[_0xcc71('0x2a')],_0x4a3fdd[_0xcc71('0x2c')]);_0x40567d[_0xcc71('0x2f')]=_[_0xcc71('0x30')](_0x4a3fdd[_0xcc71('0x2a')],qs[_0xcc71('0x31')](_0x50b98a['query']['fields']));_0x40567d[_0xcc71('0x2f')]=_0x40567d[_0xcc71('0x2f')][_0xcc71('0x32')]?_0x40567d[_0xcc71('0x2f')]:_0x4a3fdd[_0xcc71('0x2a')];if(!_0x50b98a['query'][_0xcc71('0x33')](_0xcc71('0x34'))){_0x40567d[_0xcc71('0x19')]=qs[_0xcc71('0x19')](_0x50b98a[_0xcc71('0x2c')][_0xcc71('0x19')]);_0x40567d['offset']=qs[_0xcc71('0x17')](_0x50b98a[_0xcc71('0x2c')][_0xcc71('0x17')]);}_0x40567d[_0xcc71('0x35')]=qs[_0xcc71('0x36')](_0x50b98a[_0xcc71('0x2c')][_0xcc71('0x36')]);_0x40567d['where']=qs[_0xcc71('0x2e')](_[_0xcc71('0x37')](_0x50b98a[_0xcc71('0x2c')],_0x4a3fdd[_0xcc71('0x2e')]),_0x429f98);if(_0x50b98a['query']['filter']){_0x40567d[_0xcc71('0x38')]=_['merge'](_0x40567d[_0xcc71('0x38')],{'$or':_[_0xcc71('0x2b')](_0x429f98,function(_0x553c2e){if(_0x553c2e['type']!==_0xcc71('0x39')){var _0x16acbe={};_0x16acbe[_0x553c2e['name']]={'$like':'%'+_0x50b98a[_0xcc71('0x2c')]['filter']+'%'};return _0x16acbe;}})});}_0x40567d=_[_0xcc71('0x3a')]({},_0x40567d,_0x50b98a['options']);var _0x3569f3={'where':_0x40567d[_0xcc71('0x38')]};return db[_0xcc71('0x25')][_0xcc71('0x3b')](_0x3569f3)['then'](function(_0x2cc0b5){_0x3e8886[_0xcc71('0x3b')]=_0x2cc0b5;if(_0x50b98a[_0xcc71('0x2c')][_0xcc71('0x3c')]){_0x40567d['include']=[{'all':!![]}];}return db[_0xcc71('0x25')][_0xcc71('0x3d')](_0x40567d);})[_0xcc71('0x21')](function(_0x113cf7){_0x3e8886[_0xcc71('0x3e')]=_0x113cf7;return _0x3e8886;})[_0xcc71('0x21')](respondWithFilteredResult(_0x51ebbb,_0x40567d))[_0xcc71('0x3f')](handleError(_0x51ebbb,null));};exports['show']=function(_0x52af4c,_0x291157){var _0x1cbd6f={'raw':!![],'where':{'id':_0x52af4c[_0xcc71('0x40')]['id']}},_0x3ed073={};_0x3ed073[_0xcc71('0x2a')]=_[_0xcc71('0x2d')](db[_0xcc71('0x25')][_0xcc71('0x26')]);_0x3ed073[_0xcc71('0x2c')]=_['keys'](_0x52af4c[_0xcc71('0x2c')]);_0x3ed073[_0xcc71('0x2e')]=_['intersection'](_0x3ed073['model'],_0x3ed073[_0xcc71('0x2c')]);_0x1cbd6f[_0xcc71('0x2f')]=_[_0xcc71('0x30')](_0x3ed073[_0xcc71('0x2a')],qs[_0xcc71('0x31')](_0x52af4c['query']['fields']));_0x1cbd6f[_0xcc71('0x2f')]=_0x1cbd6f['attributes'][_0xcc71('0x32')]?_0x1cbd6f[_0xcc71('0x2f')]:_0x3ed073[_0xcc71('0x2a')];if(_0x52af4c[_0xcc71('0x2c')][_0xcc71('0x3c')]){_0x1cbd6f['include']=[{'all':!![]}];}_0x1cbd6f=_['merge']({},_0x1cbd6f,_0x52af4c[_0xcc71('0x41')]);return db[_0xcc71('0x25')][_0xcc71('0x42')](_0x1cbd6f)[_0xcc71('0x21')](handleEntityNotFound(_0x291157,null))[_0xcc71('0x21')](respondWithResult(_0x291157,null))[_0xcc71('0x3f')](handleError(_0x291157,null));};exports[_0xcc71('0x43')]=function(_0xb6226f,_0x5bf5fb){return db[_0xcc71('0x25')]['create'](_0xb6226f[_0xcc71('0x44')],{})[_0xcc71('0x21')](respondWithResult(_0x5bf5fb,0xc9))[_0xcc71('0x3f')](handleError(_0x5bf5fb,null));};exports[_0xcc71('0x20')]=function(_0x421c49,_0x995471){if(_0x421c49[_0xcc71('0x44')]['id']){delete _0x421c49[_0xcc71('0x44')]['id'];}return db[_0xcc71('0x25')][_0xcc71('0x42')]({'where':{'id':_0x421c49['params']['id']}})[_0xcc71('0x21')](handleEntityNotFound(_0x995471,null))['then'](saveUpdates(_0x421c49[_0xcc71('0x44')],null))[_0xcc71('0x21')](respondWithResult(_0x995471,null))[_0xcc71('0x3f')](handleError(_0x995471,null));};exports[_0xcc71('0x45')]=function(_0x256411,_0x90e7e5){return db[_0xcc71('0x25')][_0xcc71('0x42')]({'where':{'id':_0x256411[_0xcc71('0x40')]['id']}})[_0xcc71('0x21')](handleEntityNotFound(_0x90e7e5,null))[_0xcc71('0x21')](removeEntity(_0x90e7e5,null))['catch'](handleError(_0x90e7e5,null));};exports[_0xcc71('0x46')]=function(_0x198ac4,_0x3895f9){return db[_0xcc71('0x25')]['describe']()[_0xcc71('0x21')](respondWithResult(_0x3895f9,null))[_0xcc71('0x3f')](handleError(_0x3895f9,null));};exports['getQuestions']=function(_0x96f532,_0x58fa52,_0x366d08){var _0x325fc3={'raw':!![],'where':{}};var _0x4f2728={};var _0x4a3b8f={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xcc71('0x47')]({'where':{'id':_0x96f532['params']['id']}})[_0xcc71('0x21')](handleEntityNotFound(_0x58fa52,null))[_0xcc71('0x21')](function(_0x348d01){if(_0x348d01){_0x4f2728[_0xcc71('0x2a')]=_[_0xcc71('0x2d')](db[_0xcc71('0x48')]['rawAttributes']);_0x4f2728[_0xcc71('0x2c')]=_['keys'](_0x96f532['query']);_0x4f2728[_0xcc71('0x2e')]=_[_0xcc71('0x30')](_0x4f2728[_0xcc71('0x2a')],_0x4f2728['query']);_0x325fc3[_0xcc71('0x2f')]=_[_0xcc71('0x30')](_0x4f2728[_0xcc71('0x2a')],qs['fields'](_0x96f532[_0xcc71('0x2c')]['fields']));_0x325fc3[_0xcc71('0x2f')]=_0x325fc3[_0xcc71('0x2f')][_0xcc71('0x32')]?_0x325fc3[_0xcc71('0x2f')]:_0x4f2728[_0xcc71('0x2a')];if(!_0x96f532[_0xcc71('0x2c')][_0xcc71('0x33')](_0xcc71('0x34'))){_0x325fc3['limit']=qs[_0xcc71('0x19')](_0x96f532[_0xcc71('0x2c')]['limit']);_0x325fc3[_0xcc71('0x17')]=qs[_0xcc71('0x17')](_0x96f532[_0xcc71('0x2c')]['offset']);}_0x325fc3['order']=qs[_0xcc71('0x36')](_0x96f532['query'][_0xcc71('0x36')]);_0x325fc3[_0xcc71('0x38')]=qs['filters'](_[_0xcc71('0x37')](_0x96f532['query'],_0x4f2728[_0xcc71('0x2e')]));_0x325fc3['where'][_0xcc71('0x49')]=_0x348d01['id'];if(_0x96f532[_0xcc71('0x2c')][_0xcc71('0x4a')]){_0x325fc3[_0xcc71('0x38')]=_[_0xcc71('0x3a')](_0x325fc3[_0xcc71('0x38')],{'$or':_[_0xcc71('0x2b')](_0x325fc3['attributes'],function(_0x3e219e){var _0x44b85e={};_0x44b85e[_0x3e219e]={'$like':'%'+_0x96f532[_0xcc71('0x2c')][_0xcc71('0x4a')]+'%'};return _0x44b85e;})});}_0x325fc3=_['merge']({},_0x325fc3,_0x96f532[_0xcc71('0x41')]);return db[_0xcc71('0x48')][_0xcc71('0x3b')]({'where':_0x325fc3['where']})[_0xcc71('0x21')](function(_0x45ec9f){_0x4a3b8f[_0xcc71('0x3b')]=_0x45ec9f;if(_0x96f532[_0xcc71('0x2c')][_0xcc71('0x3c')]){_0x325fc3[_0xcc71('0x4b')]=[{'all':!![]}];}return db[_0xcc71('0x48')][_0xcc71('0x3d')](_0x325fc3);})[_0xcc71('0x21')](function(_0x4b0493){_0x4a3b8f[_0xcc71('0x3e')]=_0x4b0493;return _0x4a3b8f;});}})[_0xcc71('0x21')](respondWithFilteredResult(_0x58fa52,_0x325fc3))[_0xcc71('0x3f')](handleError(_0x58fa52,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 6360db1..165b8ee 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 _0xeff8=['rimraf','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','lodash','util','api','moment','bluebird','path'];(function(_0x390bcb,_0x5c8f39){var _0x52e01f=function(_0x3ccabf){while(--_0x3ccabf){_0x390bcb['push'](_0x390bcb['shift']());}};_0x52e01f(++_0x5c8f39);}(_0xeff8,0x186));var _0x8eff=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xeff8[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84e7=['./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0x84e7,0x122));var _0x784e=function(_0x147fc0,_0x1e1ffe){_0x147fc0=_0x147fc0-0x0;var _0x5e1aa4=_0x84e7[_0x147fc0];return _0x5e1aa4;};'use strict';var _=require('lodash');var util=require(_0x784e('0x0'));var logger=require(_0x784e('0x1'))('api');var moment=require(_0x784e('0x2'));var BPromise=require(_0x784e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x784e('0x4'));var rimraf=require(_0x784e('0x5'));var config=require(_0x784e('0x6'));var attributes=require(_0x784e('0x7'));module[_0x784e('0x8')]=function(_0x133296,_0x48ed22){return _0x133296[_0x784e('0x9')]('JscriptySessionReport',attributes,{'tableName':_0x784e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 597d294..7146883 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 _0x5c3c=['JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x495df7,_0x1e5025){var _0x34e4df=function(_0x5832a6){while(--_0x5832a6){_0x495df7['push'](_0x495df7['shift']());}};_0x34e4df(++_0x1e5025);}(_0x5c3c,0x132));var _0xc5c3=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5c3c[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});} \ No newline at end of file +var _0x7a54=['info','JscriptySessionReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x210e46,_0x2cc230){_0x210e46=_0x210e46-0x0;var _0x560042=_0x7a54[_0x210e46];return _0x560042;};'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')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 336d5b6..090c309 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 _0x3881=['update','/download_log_file','isAuthenticated','downloadLogFile','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','/:id'];(function(_0xdeffe6,_0x198150){var _0x5baeb=function(_0x51e1c5){while(--_0x51e1c5){_0xdeffe6['push'](_0xdeffe6['shift']());}};_0x5baeb(++_0x198150);}(_0x3881,0x184));var _0x1388=function(_0x2a5d4b,_0x45e559){_0x2a5d4b=_0x2a5d4b-0x0;var _0x35dcbe=_0x3881[_0x2a5d4b];return _0x35dcbe;};'use strict';var multer=require('multer');var util=require(_0x1388('0x0'));var path=require(_0x1388('0x1'));var timeout=require(_0x1388('0x2'));var express=require(_0x1388('0x3'));var router=express[_0x1388('0x4')]();var fs_extra=require(_0x1388('0x5'));var auth=require(_0x1388('0x6'));var interaction=require(_0x1388('0x7'));var config=require(_0x1388('0x8'));var controller=require(_0x1388('0x9'));router[_0x1388('0xa')]('/',controller['index']);router['put'](_0x1388('0xb'),auth['isAuthenticated'](),controller[_0x1388('0xc')]);router[_0x1388('0xa')](_0x1388('0xd'),auth[_0x1388('0xe')](),controller[_0x1388('0xf')]);module['exports']=router; \ No newline at end of file +var _0x6672=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file','exports','multer','util','path'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6672,0x151));var _0x2667=function(_0x4ede04,_0x58132b){_0x4ede04=_0x4ede04-0x0;var _0x49ccfc=_0x6672[_0x4ede04];return _0x49ccfc;};'use strict';var multer=require(_0x2667('0x0'));var util=require(_0x2667('0x1'));var path=require(_0x2667('0x2'));var timeout=require(_0x2667('0x3'));var express=require('express');var router=express[_0x2667('0x4')]();var fs_extra=require(_0x2667('0x5'));var auth=require(_0x2667('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2667('0x7'));var controller=require(_0x2667('0x8'));router[_0x2667('0x9')]('/',controller[_0x2667('0xa')]);router[_0x2667('0xb')](_0x2667('0xc'),auth[_0x2667('0xd')](),controller[_0x2667('0xe')]);router[_0x2667('0x9')](_0x2667('0xf'),auth['isAuthenticated'](),controller['downloadLogFile']);module[_0x2667('0x10')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 0f0478f..ce5a037 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 _0xb046=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x1ec160,_0xc147fa){var _0x249a5d=function(_0x2cd42d){while(--_0x2cd42d){_0x1ec160['push'](_0x1ec160['shift']());}};_0x249a5d(++_0xc147fa);}(_0xb046,0x11b));var _0x6b04=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0xb046[_0x50f392];return _0x5926f2;};'use strict';var Sequelize=require(_0x6b04('0x0'));module[_0x6b04('0x1')]={'license':{'type':Sequelize[_0x6b04('0x2')]},'data1':{'type':Sequelize[_0x6b04('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x6b04('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0bbe=['TEXT','STRING','sequelize','exports'];(function(_0x56408b,_0x1fbe15){var _0x27f1de=function(_0x1285e2){while(--_0x1285e2){_0x56408b['push'](_0x56408b['shift']());}};_0x27f1de(++_0x1fbe15);}(_0x0bbe,0x6a));var _0xe0bb=function(_0x12aeae,_0x3f7e2e){_0x12aeae=_0x12aeae-0x0;var _0x57fd7f=_0x0bbe[_0x12aeae];return _0x57fd7f;};'use strict';var Sequelize=require(_0xe0bb('0x0'));module[_0xe0bb('0x1')]={'license':{'type':Sequelize[_0xe0bb('0x2')]},'data1':{'type':Sequelize[_0xe0bb('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 3847b9b..611fbe0 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 _0x7616=['status','end','offset','limit','undefined','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','model','keys','License','query','intersection','fields','attributes','length','merge','options','getLicense','catch','body','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','attachment;\x20filename=','Content-Type','text/plain','download','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x43679c,_0x2ba57f){var _0x4226ad=function(_0x56522c){while(--_0x56522c){_0x43679c['push'](_0x43679c['shift']());}};_0x4226ad(++_0x2ba57f);}(_0x7616,0x191));var _0x6761=function(_0x442566,_0x1b016d){_0x442566=_0x442566-0x0;var _0x166c46=_0x7616[_0x442566];return _0x166c46;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6761('0x0'));var zipdir=require(_0x6761('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6761('0x2'));var moment=require(_0x6761('0x3'));var BPromise=require(_0x6761('0x4'));var Mustache=require(_0x6761('0x5'));var util=require(_0x6761('0x6'));var path=require(_0x6761('0x7'));var sox=require('sox');var csv=require(_0x6761('0x8'));var ejs=require(_0x6761('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6761('0xa'));var squel=require('squel');var crypto=require(_0x6761('0xb'));var jsforce=require(_0x6761('0xc'));var deskjs=require(_0x6761('0xd'));var toCsv=require(_0x6761('0x8'));var querystring=require(_0x6761('0xe'));var Papa=require('papaparse');var Redis=require(_0x6761('0xf'));var authService=require(_0x6761('0x10'));var qs=require(_0x6761('0x11'));var as=require(_0x6761('0x12'));var hardwareService=require(_0x6761('0x13'));var logger=require(_0x6761('0x14'))(_0x6761('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6761('0x16'));var db=require(_0x6761('0x17'))['db'];function respondWithStatusCode(_0x552219,_0x20fe00){_0x20fe00=_0x20fe00||0xcc;return function(_0x2d4136){if(_0x2d4136){return _0x552219[_0x6761('0x18')](_0x20fe00);}return _0x552219[_0x6761('0x19')](_0x20fe00)[_0x6761('0x1a')]();};}function respondWithResult(_0x12be3c,_0x1cdd6c){_0x1cdd6c=_0x1cdd6c||0xc8;return function(_0x1267a8){if(_0x1267a8){return _0x12be3c[_0x6761('0x19')](_0x1cdd6c)['json'](_0x1267a8);}};}function respondWithFilteredResult(_0xa4a3c6,_0x3d38c2){return function(_0x1e878a){if(_0x1e878a){var _0x172f83=typeof _0x3d38c2[_0x6761('0x1b')]==='undefined'&&typeof _0x3d38c2[_0x6761('0x1c')]===_0x6761('0x1d');var _0x4599dd=_0x1e878a['count'];var _0x4ad22e=_0x172f83?0x0:_0x3d38c2['offset'];var _0x12a698=_0x172f83?_0x1e878a['count']:_0x3d38c2[_0x6761('0x1b')]+_0x3d38c2['limit'];var _0xa8c510;if(_0x12a698>=_0x4599dd){_0x12a698=_0x4599dd;_0xa8c510=0xc8;}else{_0xa8c510=0xce;}_0xa4a3c6[_0x6761('0x19')](_0xa8c510);return _0xa4a3c6[_0x6761('0x1e')](_0x6761('0x1f'),_0x4ad22e+'-'+_0x12a698+'/'+_0x4599dd)[_0x6761('0x20')](_0x1e878a);}return null;};}function patchUpdates(_0x5b5707){return function(_0x2b32d7){try{jsonpatch['apply'](_0x2b32d7,_0x5b5707,!![]);}catch(_0x19f6ec){return BPromise[_0x6761('0x21')](_0x19f6ec);}return _0x2b32d7[_0x6761('0x22')]();};}function saveUpdates(_0x3c49d2,_0x27953a){return function(_0x3185b5){if(_0x3185b5){return _0x3185b5[_0x6761('0x23')](_0x3c49d2)[_0x6761('0x24')](function(_0x4fa0eb){return _0x4fa0eb;});}return null;};}function removeEntity(_0x19b04e,_0x4e31ad){return function(_0x4fed64){if(_0x4fed64){return _0x4fed64[_0x6761('0x25')]()[_0x6761('0x24')](function(){_0x19b04e[_0x6761('0x19')](0xcc)[_0x6761('0x1a')]();});}};}function handleEntityNotFound(_0x360acb,_0x1e44a9){return function(_0x3c00c6){if(!_0x3c00c6){_0x360acb[_0x6761('0x18')](0x194);}return _0x3c00c6;};}function handleError(_0x198080,_0x16f52){_0x16f52=_0x16f52||0x1f4;return function(_0x235f8a){logger[_0x6761('0x26')](_0x235f8a[_0x6761('0x27')]);if(_0x235f8a['name']){delete _0x235f8a[_0x6761('0x28')];}_0x198080[_0x6761('0x19')](_0x16f52)[_0x6761('0x29')](_0x235f8a);};}var utilLicense=require('../../config/license/util');exports[_0x6761('0x2a')]=function(_0x5d3287,_0x1dc784){var _0x3ae5a0={'raw':!![],'where':{'id':0x1}},_0x543cde={};_0x543cde[_0x6761('0x2b')]=_[_0x6761('0x2c')](db[_0x6761('0x2d')]['rawAttributes']);_0x543cde['query']=_[_0x6761('0x2c')](_0x5d3287[_0x6761('0x2e')]);_0x543cde['filters']=_[_0x6761('0x2f')](_0x543cde[_0x6761('0x2b')],_0x543cde[_0x6761('0x2e')]);_0x3ae5a0['attributes']=_[_0x6761('0x2f')](_0x543cde[_0x6761('0x2b')],qs[_0x6761('0x30')](_0x5d3287[_0x6761('0x2e')][_0x6761('0x30')]));_0x3ae5a0[_0x6761('0x31')]=_0x3ae5a0['attributes'][_0x6761('0x32')]?_0x3ae5a0[_0x6761('0x31')]:_0x543cde[_0x6761('0x2b')];_0x3ae5a0=_[_0x6761('0x33')]({},_0x3ae5a0,_0x5d3287[_0x6761('0x34')]);return utilLicense[_0x6761('0x35')](_0x3ae5a0)['then'](respondWithResult(_0x1dc784,null))[_0x6761('0x36')](handleError(_0x1dc784,null));};exports['update']=function(_0x2db022,_0x40aecb){if(_0x2db022['body']['id']){delete _0x2db022[_0x6761('0x37')]['id'];}return db['License']['find']({'where':{'id':_0x2db022['params']['id']}})['then'](handleEntityNotFound(_0x40aecb,null))['then'](function(_0x443229){var _0x25c872=_0x443229[_0x6761('0x38')]({'plain':!![]});return utilLicense[_0x6761('0x39')](_0x25c872,_0x2db022[_0x6761('0x37')][_0x6761('0x3a')]);})[_0x6761('0x24')](function(_0xc16d0a){if(!_0xc16d0a[_0x6761('0x3b')]){return saveUpdates(_0x2db022[_0x6761('0x37')],null);}return _0xc16d0a;})[_0x6761('0x24')](respondWithResult(_0x40aecb,null))[_0x6761('0x36')](handleError(_0x40aecb,null));};exports[_0x6761('0x3c')]=function(_0x1b9101,_0x151d7b){var _0xd1019a=_0x6761('0x3d');var _0x44a97c=path[_0x6761('0x3e')](_0x6761('0x3f'),_0x6761('0x40'),_0x6761('0x41'),_0xd1019a);_0x151d7b[_0x6761('0x42')]('Content-disposition',_0x6761('0x43')+_0xd1019a);_0x151d7b[_0x6761('0x1e')](_0x6761('0x44'),_0x6761('0x45'));_0x151d7b[_0x6761('0x46')](_0x44a97c);}; \ No newline at end of file +var _0x1009=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','name','index','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','merge','getLicense','catch','body','License','params','get','checkLicense','demo','downloadLogFile','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','set','Content-Type','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1a7061,_0x25bc1e){var _0x3c7c7a=function(_0x537b1c){while(--_0x537b1c){_0x1a7061['push'](_0x1a7061['shift']());}};_0x3c7c7a(++_0x25bc1e);}(_0x1009,0x1a5));var _0x9100=function(_0x5e060c,_0x3ccff4){_0x5e060c=_0x5e060c-0x0;var _0x3b20fa=_0x1009[_0x5e060c];return _0x3b20fa;};'use strict';var emlformat=require(_0x9100('0x0'));var rimraf=require(_0x9100('0x1'));var zipdir=require(_0x9100('0x2'));var jsonpatch=require(_0x9100('0x3'));var rp=require(_0x9100('0x4'));var moment=require(_0x9100('0x5'));var BPromise=require(_0x9100('0x6'));var Mustache=require(_0x9100('0x7'));var util=require(_0x9100('0x8'));var path=require(_0x9100('0x9'));var sox=require(_0x9100('0xa'));var csv=require(_0x9100('0xb'));var ejs=require(_0x9100('0xc'));var fs=require('fs');var fs_extra=require(_0x9100('0xd'));var _=require(_0x9100('0xe'));var squel=require(_0x9100('0xf'));var crypto=require(_0x9100('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x9100('0x11'));var toCsv=require(_0x9100('0xb'));var querystring=require(_0x9100('0x12'));var Papa=require(_0x9100('0x13'));var Redis=require(_0x9100('0x14'));var authService=require(_0x9100('0x15'));var qs=require(_0x9100('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9100('0x17'));var logger=require(_0x9100('0x18'))(_0x9100('0x19'));var utils=require('../../config/utils');var config=require(_0x9100('0x1a'));var licenseUtil=require(_0x9100('0x1b'));var db=require(_0x9100('0x1c'))['db'];function respondWithStatusCode(_0x2924c2,_0x2f6361){_0x2f6361=_0x2f6361||0xcc;return function(_0x5b45c3){if(_0x5b45c3){return _0x2924c2[_0x9100('0x1d')](_0x2f6361);}return _0x2924c2[_0x9100('0x1e')](_0x2f6361)[_0x9100('0x1f')]();};}function respondWithResult(_0x231060,_0x23abab){_0x23abab=_0x23abab||0xc8;return function(_0x1ed15a){if(_0x1ed15a){return _0x231060[_0x9100('0x1e')](_0x23abab)[_0x9100('0x20')](_0x1ed15a);}};}function respondWithFilteredResult(_0x18d445,_0x3ee5fd){return function(_0x42393c){if(_0x42393c){var _0x1e1ea7=typeof _0x3ee5fd[_0x9100('0x21')]===_0x9100('0x22')&&typeof _0x3ee5fd[_0x9100('0x23')]==='undefined';var _0x411bb4=_0x42393c[_0x9100('0x24')];var _0xad39b6=_0x1e1ea7?0x0:_0x3ee5fd[_0x9100('0x21')];var _0x54eeeb=_0x1e1ea7?_0x42393c['count']:_0x3ee5fd[_0x9100('0x21')]+_0x3ee5fd[_0x9100('0x23')];var _0x4d6350;if(_0x54eeeb>=_0x411bb4){_0x54eeeb=_0x411bb4;_0x4d6350=0xc8;}else{_0x4d6350=0xce;}_0x18d445[_0x9100('0x1e')](_0x4d6350);return _0x18d445['set'](_0x9100('0x25'),_0xad39b6+'-'+_0x54eeeb+'/'+_0x411bb4)[_0x9100('0x20')](_0x42393c);}return null;};}function patchUpdates(_0x27bc3f){return function(_0x3ebf6b){try{jsonpatch[_0x9100('0x26')](_0x3ebf6b,_0x27bc3f,!![]);}catch(_0x4e60d4){return BPromise[_0x9100('0x27')](_0x4e60d4);}return _0x3ebf6b[_0x9100('0x28')]();};}function saveUpdates(_0x5a7842,_0x378bfa){return function(_0x14dd8d){if(_0x14dd8d){return _0x14dd8d[_0x9100('0x29')](_0x5a7842)['then'](function(_0x1762ee){return _0x1762ee;});}return null;};}function removeEntity(_0x4e3bc2,_0xdc9bf6){return function(_0x357f7b){if(_0x357f7b){return _0x357f7b[_0x9100('0x2a')]()[_0x9100('0x2b')](function(){_0x4e3bc2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x336047,_0x39e9ea){return function(_0x433ae3){if(!_0x433ae3){_0x336047[_0x9100('0x1d')](0x194);}return _0x433ae3;};}function handleError(_0x309694,_0x1c4a31){_0x1c4a31=_0x1c4a31||0x1f4;return function(_0x4128dd){logger['error'](_0x4128dd['stack']);if(_0x4128dd[_0x9100('0x2c')]){delete _0x4128dd[_0x9100('0x2c')];}_0x309694[_0x9100('0x1e')](_0x1c4a31)['send'](_0x4128dd);};}var utilLicense=require('../../config/license/util');exports[_0x9100('0x2d')]=function(_0x39396a,_0x5e4f11){var _0x18a1b9={'raw':!![],'where':{'id':0x1}},_0x208a76={};_0x208a76[_0x9100('0x2e')]=_[_0x9100('0x2f')](db['License'][_0x9100('0x30')]);_0x208a76[_0x9100('0x31')]=_[_0x9100('0x2f')](_0x39396a[_0x9100('0x31')]);_0x208a76[_0x9100('0x32')]=_[_0x9100('0x33')](_0x208a76['model'],_0x208a76[_0x9100('0x31')]);_0x18a1b9['attributes']=_[_0x9100('0x33')](_0x208a76[_0x9100('0x2e')],qs[_0x9100('0x34')](_0x39396a[_0x9100('0x31')][_0x9100('0x34')]));_0x18a1b9[_0x9100('0x35')]=_0x18a1b9[_0x9100('0x35')][_0x9100('0x36')]?_0x18a1b9['attributes']:_0x208a76[_0x9100('0x2e')];_0x18a1b9=_[_0x9100('0x37')]({},_0x18a1b9,_0x39396a['options']);return utilLicense[_0x9100('0x38')](_0x18a1b9)['then'](respondWithResult(_0x5e4f11,null))[_0x9100('0x39')](handleError(_0x5e4f11,null));};exports[_0x9100('0x29')]=function(_0x1f5cc0,_0x54a8a7){if(_0x1f5cc0['body']['id']){delete _0x1f5cc0[_0x9100('0x3a')]['id'];}return db[_0x9100('0x3b')]['find']({'where':{'id':_0x1f5cc0[_0x9100('0x3c')]['id']}})[_0x9100('0x2b')](handleEntityNotFound(_0x54a8a7,null))[_0x9100('0x2b')](function(_0x5ac51f){var _0x49c90b=_0x5ac51f[_0x9100('0x3d')]({'plain':!![]});return utilLicense[_0x9100('0x3e')](_0x49c90b,_0x1f5cc0[_0x9100('0x3a')]['key']);})[_0x9100('0x2b')](function(_0x5692aa){if(!_0x5692aa[_0x9100('0x3f')]){return saveUpdates(_0x1f5cc0[_0x9100('0x3a')],null);}return _0x5692aa;})[_0x9100('0x2b')](respondWithResult(_0x54a8a7,null))[_0x9100('0x39')](handleError(_0x54a8a7,null));};exports[_0x9100('0x40')]=function(_0x39d180,_0x1930a7){var _0x2d2565='license-info.log';var _0x3826bc=path['join']('/var',_0x9100('0x41'),_0x9100('0x42'),_0x2d2565);_0x1930a7[_0x9100('0x43')](_0x9100('0x44'),_0x9100('0x45')+_0x2d2565);_0x1930a7[_0x9100('0x46')](_0x9100('0x47'),'text/plain');_0x1930a7[_0x9100('0x48')](_0x3826bc);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index e3447d4..6b0b30c 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 _0x80c5=['./license.attributes','exports','License','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0x80c5,0x1e0));var _0x580c=function(_0x307e33,_0x59d2cf){_0x307e33=_0x307e33-0x0;var _0x444207=_0x80c5[_0x307e33];return _0x444207;};'use strict';var _=require(_0x580c('0x0'));var util=require('util');var logger=require(_0x580c('0x1'))('api');var moment=require(_0x580c('0x2'));var BPromise=require(_0x580c('0x3'));var rp=require(_0x580c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x580c('0x5'));var config=require('../../config/environment');var attributes=require(_0x580c('0x6'));module[_0x580c('0x7')]=function(_0xaee693,_0x5b6142){return _0xaee693['define'](_0x580c('0x8'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7187=['license','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./license.attributes','exports'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7187,0x10f));var _0x7718=function(_0x1aab99,_0x2af9c9){_0x1aab99=_0x1aab99-0x0;var _0x1f00ec=_0x7187[_0x1aab99];return _0x1f00ec;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7718('0x0'))(_0x7718('0x1'));var moment=require(_0x7718('0x2'));var BPromise=require('bluebird');var rp=require(_0x7718('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7718('0x4'));var config=require(_0x7718('0x5'));var attributes=require(_0x7718('0x6'));module[_0x7718('0x7')]=function(_0x3072b5,_0x2f89d1){return _0x3072b5['define']('License',attributes,{'tableName':_0x7718('0x8'),'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 a8ea76e..94618bf 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 _0xa4b7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa4b7,0x125));var _0x7a4b=function(_0x194b38,_0x1ca0b7){_0x194b38=_0x194b38-0x0;var _0xa8541=_0xa4b7[_0x194b38];return _0xa8541;};'use strict';var _=require(_0x7a4b('0x0'));var util=require(_0x7a4b('0x1'));var moment=require(_0x7a4b('0x2'));var BPromise=require(_0x7a4b('0x3'));var rs=require(_0x7a4b('0x4'));var fs=require('fs');var Redis=require(_0x7a4b('0x5'));var db=require(_0x7a4b('0x6'))['db'];var utils=require(_0x7a4b('0x7'));var logger=require(_0x7a4b('0x8'))(_0x7a4b('0x9'));var config=require(_0x7a4b('0xa'));var jayson=require(_0x7a4b('0xb'));var client=jayson[_0x7a4b('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3176ab,_0x3226c7,_0x151297){return new BPromise(function(_0x109be8,_0x26d3aa){return client[_0x7a4b('0xd')](_0x3176ab,_0x151297)[_0x7a4b('0xe')](function(_0x2de024){logger['info'](_0x7a4b('0xf'),_0x3226c7,'request\x20sent');logger[_0x7a4b('0x10')](_0x7a4b('0x11'),_0x3226c7,_0x7a4b('0x12'),JSON[_0x7a4b('0x13')](_0x2de024));if(_0x2de024[_0x7a4b('0x14')]){if(_0x2de024['error'][_0x7a4b('0x15')]===0x1f4){logger[_0x7a4b('0x14')](_0x7a4b('0xf'),_0x3226c7,_0x2de024[_0x7a4b('0x14')][_0x7a4b('0x16')]);return _0x26d3aa(_0x2de024[_0x7a4b('0x14')]['message']);}logger['error'](_0x7a4b('0xf'),_0x3226c7,_0x2de024['error'][_0x7a4b('0x16')]);return _0x109be8(_0x2de024['error'][_0x7a4b('0x16')]);}else{logger['info'](_0x7a4b('0xf'),_0x3226c7,_0x7a4b('0x12'));_0x109be8(_0x2de024['result'][_0x7a4b('0x16')]);}})['catch'](function(_0x752814){logger[_0x7a4b('0x14')](_0x7a4b('0xf'),_0x3226c7,_0x752814);_0x26d3aa(_0x752814);});});} \ No newline at end of file +var _0x24ea=['../../config/utils','../../config/environment','jayson/promise','client','request','then','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','code','message','error','License,\x20%s,\x20%s','info','result','lodash','util','moment','bluebird','ioredis'];(function(_0x8af3db,_0x2c725c){var _0x4aa2a8=function(_0x1ff15e){while(--_0x1ff15e){_0x8af3db['push'](_0x8af3db['shift']());}};_0x4aa2a8(++_0x2c725c);}(_0x24ea,0x9b));var _0xa24e=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x24ea[_0x2aea9e];return _0x430b92;};'use strict';var _=require(_0xa24e('0x0'));var util=require(_0xa24e('0x1'));var moment=require(_0xa24e('0x2'));var BPromise=require(_0xa24e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa24e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa24e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa24e('0x6'));var jayson=require(_0xa24e('0x7'));var client=jayson[_0xa24e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfda7fb,_0x3093f3,_0x2e66e9){return new BPromise(function(_0x587b2b,_0x3fee24){return client[_0xa24e('0x9')](_0xfda7fb,_0x2e66e9)[_0xa24e('0xa')](function(_0x488b8d){logger['info']('License,\x20%s,\x20%s',_0x3093f3,_0xa24e('0xb'));logger['debug'](_0xa24e('0xc'),_0x3093f3,_0xa24e('0xb'),JSON[_0xa24e('0xd')](_0x488b8d));if(_0x488b8d['error']){if(_0x488b8d['error'][_0xa24e('0xe')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x3093f3,_0x488b8d['error'][_0xa24e('0xf')]);return _0x3fee24(_0x488b8d[_0xa24e('0x10')]['message']);}logger['error'](_0xa24e('0x11'),_0x3093f3,_0x488b8d['error'][_0xa24e('0xf')]);return _0x587b2b(_0x488b8d[_0xa24e('0x10')][_0xa24e('0xf')]);}else{logger[_0xa24e('0x12')]('License,\x20%s,\x20%s',_0x3093f3,_0xa24e('0xb'));_0x587b2b(_0x488b8d[_0xa24e('0x13')]['message']);}})['catch'](function(_0x1b4688){logger['error'](_0xa24e('0x11'),_0x3093f3,_0x1b4688);_0x3fee24(_0x1b4688);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 10f18d5..c65a28b 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 _0xe7c4=['./mailAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','post','addImap','addSmtp','addInteraction','/:id/send','addAgents','put','/:id','update','removeDispositions','delete','removeImap','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0xe7c4,0xa3));var _0x4e7c=function(_0x3a69f4,_0x4b0631){_0x3a69f4=_0x3a69f4-0x0;var _0x21cf68=_0xe7c4[_0x3a69f4];return _0x21cf68;};'use strict';var multer=require(_0x4e7c('0x0'));var util=require(_0x4e7c('0x1'));var path=require(_0x4e7c('0x2'));var timeout=require(_0x4e7c('0x3'));var express=require(_0x4e7c('0x4'));var router=express[_0x4e7c('0x5')]();var fs_extra=require(_0x4e7c('0x6'));var auth=require(_0x4e7c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4e7c('0x8'));var controller=require(_0x4e7c('0x9'));router[_0x4e7c('0xa')]('/',auth[_0x4e7c('0xb')](),controller[_0x4e7c('0xc')]);router[_0x4e7c('0xa')](_0x4e7c('0xd'),auth[_0x4e7c('0xb')](),controller['describe']);router[_0x4e7c('0xa')]('/:id',auth[_0x4e7c('0xb')](),controller[_0x4e7c('0xe')]);router[_0x4e7c('0xa')](_0x4e7c('0xf'),auth[_0x4e7c('0xb')](),controller[_0x4e7c('0x10')]);router[_0x4e7c('0xa')](_0x4e7c('0x11'),auth[_0x4e7c('0xb')](),controller[_0x4e7c('0x12')]);router[_0x4e7c('0xa')](_0x4e7c('0x13'),auth[_0x4e7c('0xb')](),controller['getImap']);router[_0x4e7c('0xa')](_0x4e7c('0x14'),auth[_0x4e7c('0xb')](),controller[_0x4e7c('0x15')]);router[_0x4e7c('0xa')](_0x4e7c('0x16'),auth['isAuthenticated'](),controller[_0x4e7c('0x17')]);router[_0x4e7c('0xa')](_0x4e7c('0x18'),auth[_0x4e7c('0xb')](),controller['getApplications']);router[_0x4e7c('0xa')](_0x4e7c('0x19'),auth[_0x4e7c('0xb')](),controller[_0x4e7c('0x1a')]);router[_0x4e7c('0xa')](_0x4e7c('0x1b'),auth[_0x4e7c('0xb')](),controller[_0x4e7c('0x1c')]);router[_0x4e7c('0xa')](_0x4e7c('0x1d'),auth[_0x4e7c('0xb')](),controller['getAgents']);router[_0x4e7c('0x1e')](_0x4e7c('0xf'),auth[_0x4e7c('0xb')](),controller['addDisposition']);router[_0x4e7c('0x1e')](_0x4e7c('0x11'),auth[_0x4e7c('0xb')](),controller['addAnswer']);router[_0x4e7c('0x1e')]('/',auth[_0x4e7c('0xb')](),controller['create']);router[_0x4e7c('0x1e')](_0x4e7c('0x13'),auth['isAuthenticated'](),controller[_0x4e7c('0x1f')]);router[_0x4e7c('0x1e')](_0x4e7c('0x14'),auth[_0x4e7c('0xb')](),controller[_0x4e7c('0x20')]);router[_0x4e7c('0x1e')](_0x4e7c('0x16'),auth[_0x4e7c('0xb')](),controller[_0x4e7c('0x21')]);router['post'](_0x4e7c('0x18'),auth['isAuthenticated'](),controller['addApplications']);router[_0x4e7c('0x1e')](_0x4e7c('0x22'),auth[_0x4e7c('0xb')](),controller['send']);router[_0x4e7c('0x1e')](_0x4e7c('0x1d'),auth[_0x4e7c('0xb')](),controller[_0x4e7c('0x23')]);router[_0x4e7c('0x24')](_0x4e7c('0x25'),auth[_0x4e7c('0xb')](),controller[_0x4e7c('0x26')]);router['delete'](_0x4e7c('0xf'),auth[_0x4e7c('0xb')](),controller[_0x4e7c('0x27')]);router[_0x4e7c('0x28')](_0x4e7c('0x11'),auth[_0x4e7c('0xb')](),controller['removeAnswers']);router[_0x4e7c('0x28')]('/:id/in_servers',auth[_0x4e7c('0xb')](),controller[_0x4e7c('0x29')]);router[_0x4e7c('0x28')](_0x4e7c('0x14'),auth[_0x4e7c('0xb')](),controller['removeSmtp']);router[_0x4e7c('0x28')](_0x4e7c('0x25'),auth['isAuthenticated'](),controller[_0x4e7c('0x2a')]);router[_0x4e7c('0x28')](_0x4e7c('0x1d'),auth[_0x4e7c('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xfb8e=['getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','addDisposition','create','addImap','/:id/out_servers','addSmtp','addInteraction','send','/:id/users','addAgents','update','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications'];(function(_0x180142,_0x2a3c19){var _0x950a6f=function(_0x5b6706){while(--_0x5b6706){_0x180142['push'](_0x180142['shift']());}};_0x950a6f(++_0x2a3c19);}(_0xfb8e,0x138));var _0xefb8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfb8e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xefb8('0x0'));var util=require(_0xefb8('0x1'));var path=require(_0xefb8('0x2'));var timeout=require('connect-timeout');var express=require(_0xefb8('0x3'));var router=express[_0xefb8('0x4')]();var fs_extra=require(_0xefb8('0x5'));var auth=require(_0xefb8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xefb8('0x7'));var controller=require(_0xefb8('0x8'));router[_0xefb8('0x9')]('/',auth['isAuthenticated'](),controller[_0xefb8('0xa')]);router[_0xefb8('0x9')](_0xefb8('0xb'),auth['isAuthenticated'](),controller[_0xefb8('0xc')]);router[_0xefb8('0x9')](_0xefb8('0xd'),auth[_0xefb8('0xe')](),controller[_0xefb8('0xf')]);router['get']('/:id/dispositions',auth[_0xefb8('0xe')](),controller['getDispositions']);router[_0xefb8('0x9')](_0xefb8('0x10'),auth[_0xefb8('0xe')](),controller[_0xefb8('0x11')]);router['get'](_0xefb8('0x12'),auth[_0xefb8('0xe')](),controller[_0xefb8('0x13')]);router[_0xefb8('0x9')]('/:id/out_servers',auth[_0xefb8('0xe')](),controller[_0xefb8('0x14')]);router[_0xefb8('0x9')](_0xefb8('0x15'),auth[_0xefb8('0xe')](),controller[_0xefb8('0x16')]);router['get'](_0xefb8('0x17'),auth[_0xefb8('0xe')](),controller[_0xefb8('0x18')]);router[_0xefb8('0x9')](_0xefb8('0x19'),auth[_0xefb8('0xe')](),controller[_0xefb8('0x1a')]);router[_0xefb8('0x9')](_0xefb8('0x1b'),auth['isAuthenticated'](),controller[_0xefb8('0x1c')]);router['get']('/:id/users',auth[_0xefb8('0xe')](),controller[_0xefb8('0x1d')]);router[_0xefb8('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xefb8('0x1f')]);router[_0xefb8('0x1e')](_0xefb8('0x10'),auth[_0xefb8('0xe')](),controller['addAnswer']);router[_0xefb8('0x1e')]('/',auth['isAuthenticated'](),controller[_0xefb8('0x20')]);router[_0xefb8('0x1e')](_0xefb8('0x12'),auth[_0xefb8('0xe')](),controller[_0xefb8('0x21')]);router[_0xefb8('0x1e')](_0xefb8('0x22'),auth[_0xefb8('0xe')](),controller[_0xefb8('0x23')]);router[_0xefb8('0x1e')]('/:id/interactions',auth[_0xefb8('0xe')](),controller[_0xefb8('0x24')]);router[_0xefb8('0x1e')](_0xefb8('0x17'),auth[_0xefb8('0xe')](),controller['addApplications']);router[_0xefb8('0x1e')]('/:id/send',auth[_0xefb8('0xe')](),controller[_0xefb8('0x25')]);router[_0xefb8('0x1e')](_0xefb8('0x26'),auth[_0xefb8('0xe')](),controller[_0xefb8('0x27')]);router['put']('/:id',auth[_0xefb8('0xe')](),controller[_0xefb8('0x28')]);router[_0xefb8('0x29')]('/:id/dispositions',auth[_0xefb8('0xe')](),controller[_0xefb8('0x2a')]);router[_0xefb8('0x29')](_0xefb8('0x10'),auth[_0xefb8('0xe')](),controller['removeAnswers']);router[_0xefb8('0x29')]('/:id/in_servers',auth[_0xefb8('0xe')](),controller[_0xefb8('0x2b')]);router[_0xefb8('0x29')]('/:id/out_servers',auth[_0xefb8('0xe')](),controller[_0xefb8('0x2c')]);router[_0xefb8('0x29')]('/:id',auth[_0xefb8('0xe')](),controller[_0xefb8('0x2d')]);router[_0xefb8('0x29')](_0xefb8('0x26'),auth['isAuthenticated'](),controller[_0xefb8('0x2e')]);module[_0xefb8('0x2f')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 293fd94..b13087d 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 _0x7a50=['mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x536328,_0x402f3c){var _0x212247=function(_0xf9cefc){while(--_0xf9cefc){_0x536328['push'](_0x536328['shift']());}};_0x212247(++_0x402f3c);}(_0x7a50,0x105));var _0x07a5=function(_0x231daa,_0x3c641f){_0x231daa=_0x231daa-0x0;var _0x47f456=_0x7a50[_0x231daa];return _0x47f456;};'use strict';var Sequelize=require(_0x07a5('0x0'));module[_0x07a5('0x1')]={'description':{'type':Sequelize[_0x07a5('0x2')]},'name':{'type':Sequelize[_0x07a5('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x07a5('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x07a5('0x4')]},'markAsUnread':{'type':Sequelize[_0x07a5('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x07a5('0x2')],'allowNull':![],'defaultValue':_0x07a5('0x5')},'fontSize':{'type':Sequelize[_0x07a5('0x6')](0x2)[_0x07a5('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x07a5('0x4')],'defaultValue':function(){return _0x07a5('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x07a5('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x07a5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x07a5('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x07a5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x07a5('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x07a5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x07a5('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x07a5('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x07a5('0x3')],'defaultValue':![],'comment':_0x07a5('0xa'),'set':function(_0x391ba8){if(!_0x391ba8)this[_0x07a5('0xb')](_0x07a5('0xc'),null);this[_0x07a5('0xb')](_0x07a5('0xd'),_0x391ba8);}},'provider':{'type':Sequelize[_0x07a5('0xe')](_0x07a5('0xf'),_0x07a5('0x10'),'yahoo',_0x07a5('0x11')),'defaultValue':null,'get':function(){if(!this[_0x07a5('0x12')](_0x07a5('0x13')))return _0x07a5('0x14');return this['getDataValue'](_0x07a5('0x13'));},'set':function(_0x3e0029){if(_0x3e0029===_0x07a5('0x14'))_0x3e0029=null;return this['setDataValue'](_0x07a5('0x13'),_0x3e0029);}}}; \ No newline at end of file +var _0x6ae9=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','yahoo','outlook365','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED'];(function(_0x144a5d,_0x211423){var _0x2ea44f=function(_0x4a7b1d){while(--_0x4a7b1d){_0x144a5d['push'](_0x144a5d['shift']());}};_0x2ea44f(++_0x211423);}(_0x6ae9,0xad));var _0x96ae=function(_0x1ad838,_0x397209){_0x1ad838=_0x1ad838-0x0;var _0x47aa5e=_0x6ae9[_0x1ad838];return _0x47aa5e;};'use strict';var Sequelize=require(_0x96ae('0x0'));module[_0x96ae('0x1')]={'description':{'type':Sequelize[_0x96ae('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x96ae('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x96ae('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x96ae('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x96ae('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x96ae('0x4')]},'markAsUnread':{'type':Sequelize[_0x96ae('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x96ae('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x96ae('0x5')](0x2)[_0x96ae('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'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[_0x96ae('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x96ae('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x96ae('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x96ae('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x96ae('0x5')],'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[_0x96ae('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x96ae('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x96ae('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x49ec86){if(!_0x49ec86)this[_0x96ae('0x8')](_0x96ae('0x9'),null);this[_0x96ae('0x8')](_0x96ae('0xa'),_0x49ec86);}},'provider':{'type':Sequelize[_0x96ae('0xb')](_0x96ae('0xc'),'hotmail',_0x96ae('0xd'),_0x96ae('0xe')),'defaultValue':null,'get':function(){if(!this[_0x96ae('0xf')]('provider'))return _0x96ae('0x10');return this[_0x96ae('0xf')](_0x96ae('0x11'));},'set':function(_0x38527d){if(_0x38527d===_0x96ae('0x10'))_0x38527d=null;return this['setDataValue'](_0x96ae('0x11'),_0x38527d);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 10c3148..feeebab 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 _0xd294=['CmContact','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','subject','out','Interaction','Messages','verifySmtp','Sequelize','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','util','path','lodash','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','status','json','offset','undefined','count','limit','set','update','destroy','get','MailAccounts','stack','name','imap.gmail.com','imap.mail.yahoo.com','hotmail','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','service','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','body','custom','provider','secure','Mail\x20Account\x20not\x20found','describe','MailAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','CannedAnswer','create','removeAnswers','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','setImap','getSmtp','addSmtp','setSmtp','MailInteraction','omit','getInteractions','User','Owner','fullname','internal','Tags','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','sendStatus','send','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','List'];(function(_0x5559a9,_0x4ecf59){var _0x28317a=function(_0x4481cf){while(--_0x4481cf){_0x5559a9['push'](_0x5559a9['shift']());}};_0x28317a(++_0x4ecf59);}(_0xd294,0x190));var _0x4d29=function(_0x324d05,_0x5e2b01){_0x324d05=_0x324d05-0x0;var _0x572121=_0xd294[_0x324d05];return _0x572121;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x4d29('0x0'));var path=require(_0x4d29('0x1'));var _=require(_0x4d29('0x2'));var juice=require('juice');var Redis=require(_0x4d29('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x4d29('0x4'));var config=require(_0x4d29('0x5'));var db=require(_0x4d29('0x6'))['db'];config[_0x4d29('0x7')]=_[_0x4d29('0x8')](config[_0x4d29('0x7')],{'host':_0x4d29('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d29('0x7')]));require('./mailAccount.socket')[_0x4d29('0xa')](socket);var jayson=require(_0x4d29('0xb'));var client=jayson['client'][_0x4d29('0xc')]({'port':0x232b});function respondWithRpcPromise(_0x3a2c37,_0x5161ea,_0x27f6f1,_0x1c6e2e){return new BPromise(function(_0x10241f,_0x1e1edf){var _0x1e7df=_0x1c6e2e||client;return _0x1e7df[_0x4d29('0xd')](_0x3a2c37,_0x27f6f1)[_0x4d29('0xe')](function(_0x2d8554){logger[_0x4d29('0xf')](_0x4d29('0x10'),_0x5161ea,_0x4d29('0x11'));logger['debug'](_0x4d29('0x12'),_0x5161ea,'request\x20sent',JSON['stringify'](_0x2d8554));if(_0x2d8554[_0x4d29('0x13')]){if(_0x2d8554[_0x4d29('0x13')][_0x4d29('0x14')]===0x1f4){logger['error'](_0x4d29('0x10'),_0x5161ea,_0x2d8554[_0x4d29('0x13')][_0x4d29('0x15')]);return _0x1e1edf(_0x2d8554['error'][_0x4d29('0x15')]);}logger['error'](_0x4d29('0x10'),_0x5161ea,_0x2d8554[_0x4d29('0x13')][_0x4d29('0x15')]);return _0x10241f(_0x2d8554['error'][_0x4d29('0x15')]);}else{logger[_0x4d29('0xf')](_0x4d29('0x10'),_0x5161ea,'request\x20sent');_0x10241f(_0x2d8554[_0x4d29('0x16')][_0x4d29('0x15')]);}})[_0x4d29('0x17')](function(_0x30c5a4){logger['error'](_0x4d29('0x10'),_0x5161ea,_0x30c5a4);_0x1e1edf(_0x30c5a4);});});}function respondWithStatusCode(_0x4e15bc,_0x3c2e03){_0x3c2e03=_0x3c2e03||0xcc;return function(_0x4a8c30){if(_0x4a8c30){return _0x4e15bc['sendStatus'](_0x3c2e03);}return _0x4e15bc['status'](_0x3c2e03)[_0x4d29('0x18')]();};}function respondWithResult(_0x23f112,_0x12dd36){_0x12dd36=_0x12dd36||0xc8;return function(_0x3e0f98){if(_0x3e0f98){return _0x23f112[_0x4d29('0x19')](_0x12dd36)[_0x4d29('0x1a')](_0x3e0f98);}};}function respondWithFilteredResult(_0x14afb9,_0x2d7f82){return function(_0x1c13f1){if(_0x1c13f1){var _0x35d385=typeof _0x2d7f82[_0x4d29('0x1b')]===_0x4d29('0x1c')&&typeof _0x2d7f82['limit']===_0x4d29('0x1c');var _0x4e5b88=_0x1c13f1[_0x4d29('0x1d')];var _0x3a33e2=_0x35d385?0x0:_0x2d7f82[_0x4d29('0x1b')];var _0x2a6245=_0x35d385?_0x1c13f1[_0x4d29('0x1d')]:_0x2d7f82[_0x4d29('0x1b')]+_0x2d7f82[_0x4d29('0x1e')];var _0x334323;if(_0x2a6245>=_0x4e5b88){_0x2a6245=_0x4e5b88;_0x334323=0xc8;}else{_0x334323=0xce;}_0x14afb9[_0x4d29('0x19')](_0x334323);return _0x14afb9[_0x4d29('0x1f')]('Content-Range',_0x3a33e2+'-'+_0x2a6245+'/'+_0x4e5b88)[_0x4d29('0x1a')](_0x1c13f1);}return null;};}function saveUpdates(_0x3795dd){return function(_0x20272b){if(_0x20272b){return _0x20272b[_0x4d29('0x20')](_0x3795dd)['then'](function(_0x159142){return _0x159142;});}return null;};}function removeEntity(_0x14ed1e){return function(_0x417b8a){if(_0x417b8a){return _0x417b8a[_0x4d29('0x21')]()['then'](function(){var _0x1bcaf9=_0x417b8a[_0x4d29('0x22')]({'plain':!![]});var _0x5c43c5=_0x4d29('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x5c43c5,'resourceId':_0x1bcaf9['id']}})[_0x4d29('0xe')](function(){return _0x417b8a;});})[_0x4d29('0xe')](function(){_0x14ed1e[_0x4d29('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56814b){return function(_0x3033ae){if(!_0x3033ae){_0x56814b['sendStatus'](0x194);}return _0x3033ae;};}function handleError(_0x3426c8,_0x4409e1){_0x4409e1=_0x4409e1||0x1f4;return function(_0xe56514){logger[_0x4d29('0x13')](_0xe56514[_0x4d29('0x24')]);if(_0xe56514[_0x4d29('0x25')]){delete _0xe56514[_0x4d29('0x25')];}_0x3426c8[_0x4d29('0x19')](_0x4409e1)['send'](_0xe56514);};}function getImapHost(_0x14c369){switch(_0x14c369){case'gmail':return _0x4d29('0x26');case'yahoo':return _0x4d29('0x27');case _0x4d29('0x28'):return'imap-mail.outlook.com';case _0x4d29('0x29'):return'outlook.office365.com';}throw new Error(_0x4d29('0x2a'),_0x14c369);}function getSmtpHost(_0x3ad41f){switch(_0x3ad41f){case'gmail':return _0x4d29('0x2b');case _0x4d29('0x2c'):return _0x4d29('0x2d');case _0x4d29('0x28'):return'smtp-mail.outlook.com';case'outlook365':return'smtp.office365.com';}throw new Error(_0x4d29('0x2a'),_0x3ad41f);}function getAuthenticationOptions(_0x28b291,_0x49bdf1){var _0x46af87={};var _0x10f367={};if(_0x28b291){_0x46af87['user']=_0x10f367[_0x4d29('0x2e')]=_0x49bdf1[_0x4d29('0x2f')];_0x46af87[_0x4d29('0x30')]=_0x10f367[_0x4d29('0x31')]=_0x49bdf1[_0x4d29('0x30')];if(_0x49bdf1[_0x4d29('0x32')]){_0x46af87[_0x4d29('0x32')]=_0x10f367[_0x4d29('0x32')]=!![];_0x46af87[_0x4d29('0x33')]=_0x10f367['CloudProviderId']=_0x49bdf1[_0x4d29('0x33')];_0x46af87['password']=_0x10f367[_0x4d29('0x31')]=null;}else{_0x46af87['CloudProviderId']=_0x10f367['CloudProviderId']=null;}_0x46af87['host']=getImapHost(_0x28b291);_0x46af87[_0x4d29('0x34')]=0x3e1;_0x10f367[_0x4d29('0x35')]=getSmtpHost(_0x28b291);_0x10f367[_0x4d29('0x34')]=0x24b;_0x10f367['secure']=![];_0x46af87[_0x4d29('0x36')]=_0x10f367[_0x4d29('0x36')]=null;}else{if(_0x49bdf1['authentication']){_0x46af87[_0x4d29('0x2e')]=_0x10f367[_0x4d29('0x2e')]=_0x49bdf1['username'];_0x46af87['password']=_0x10f367[_0x4d29('0x31')]=_0x49bdf1['password'];}else{_0x46af87['authentication']=_0x10f367['authentication']=![];_0x46af87[_0x4d29('0x2e')]=_0x10f367['user']=null;_0x46af87['password']=_0x10f367[_0x4d29('0x31')]=null;}_0x46af87[_0x4d29('0x35')]=_0x49bdf1[_0x4d29('0x37')][_0x4d29('0x35')];_0x46af87[_0x4d29('0x34')]=_0x49bdf1[_0x4d29('0x37')][_0x4d29('0x34')];_0x10f367[_0x4d29('0x35')]=_0x49bdf1[_0x4d29('0x38')][_0x4d29('0x35')];_0x10f367[_0x4d29('0x34')]=_0x49bdf1[_0x4d29('0x38')]['port'];}return{'Imap':_0x46af87,'Smtp':_0x10f367};}exports['index']=function(_0x142219,_0x27d212){var _0xcc6de1={'include':[{'model':db[_0x4d29('0x39')],'as':_0x4d29('0x37')},{'model':db[_0x4d29('0x3a')],'as':_0x4d29('0x38')},{'model':db[_0x4d29('0x3b')],'as':_0x4d29('0x3c')}]},_0x339820={},_0x20e686={'count':0x0,'rows':[]};var _0x4fe052=_[_0x4d29('0x3d')](db[_0x4d29('0x3e')]['rawAttributes'],function(_0x5c7f23){return{'name':_0x5c7f23[_0x4d29('0x3f')],'type':_0x5c7f23[_0x4d29('0x40')][_0x4d29('0x41')]};});_0x339820[_0x4d29('0x42')]=_[_0x4d29('0x3d')](_0x4fe052,_0x4d29('0x25'));_0x339820['query']=_[_0x4d29('0x43')](_0x142219['query']);_0x339820[_0x4d29('0x44')]=_[_0x4d29('0x45')](_0x339820['model'],_0x339820[_0x4d29('0x46')]);_0xcc6de1[_0x4d29('0x47')]=_[_0x4d29('0x45')](_0x339820[_0x4d29('0x42')],qs[_0x4d29('0x48')](_0x142219[_0x4d29('0x46')][_0x4d29('0x48')]));_0xcc6de1[_0x4d29('0x47')]=_0xcc6de1['attributes'][_0x4d29('0x49')]?_0xcc6de1[_0x4d29('0x47')]:_0x339820[_0x4d29('0x42')];if(!_0x142219[_0x4d29('0x46')][_0x4d29('0x4a')]('nolimit')){_0xcc6de1[_0x4d29('0x1e')]=qs[_0x4d29('0x1e')](_0x142219[_0x4d29('0x46')][_0x4d29('0x1e')]);_0xcc6de1[_0x4d29('0x1b')]=qs['offset'](_0x142219[_0x4d29('0x46')][_0x4d29('0x1b')]);}_0xcc6de1[_0x4d29('0x4b')]=qs[_0x4d29('0x4c')](_0x142219[_0x4d29('0x46')][_0x4d29('0x4c')]);_0xcc6de1[_0x4d29('0x4d')]=qs[_0x4d29('0x44')](_[_0x4d29('0x4e')](_0x142219['query'],_0x339820[_0x4d29('0x44')]),_0x4fe052);if(_0x142219['query'][_0x4d29('0x4f')]){_0xcc6de1['where']=_[_0x4d29('0x50')](_0xcc6de1['where'],{'$or':_['map'](_0x4fe052,function(_0xa142cf){if(_0xa142cf['type']!=='VIRTUAL'){var _0x27f3cf={};_0x27f3cf[_0xa142cf[_0x4d29('0x25')]]={'$like':'%'+_0x142219[_0x4d29('0x46')][_0x4d29('0x4f')]+'%'};return _0x27f3cf;}})});}_0xcc6de1=_[_0x4d29('0x50')]({},_0xcc6de1,_0x142219[_0x4d29('0x51')]);var _0x328abf={'where':_0xcc6de1['where']};return db[_0x4d29('0x3e')][_0x4d29('0x1d')](_0x328abf)['then'](function(_0x3b4347){_0x20e686[_0x4d29('0x1d')]=_0x3b4347;if(_0x142219[_0x4d29('0x46')][_0x4d29('0x52')]){_0xcc6de1[_0x4d29('0x53')]=[{'all':!![]}];}return db[_0x4d29('0x3e')][_0x4d29('0x54')](_0xcc6de1);})['then'](function(_0x25d12d){_0x20e686[_0x4d29('0x55')]=_0x25d12d;return _0x20e686;})[_0x4d29('0xe')](respondWithFilteredResult(_0x27d212,_0xcc6de1))[_0x4d29('0x17')](handleError(_0x27d212,null));};exports[_0x4d29('0x56')]=function(_0x4e4c18,_0x4742f6){var _0x4bf800={'raw':![],'where':{'id':_0x4e4c18[_0x4d29('0x57')]['id']},'include':[{'model':db[_0x4d29('0x39')],'as':'Imap'},{'model':db[_0x4d29('0x3a')],'as':_0x4d29('0x38')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x492117={};_0x492117[_0x4d29('0x42')]=_[_0x4d29('0x43')](db[_0x4d29('0x3e')][_0x4d29('0x58')]);_0x492117[_0x4d29('0x46')]=_['keys'](_0x4e4c18[_0x4d29('0x46')]);_0x492117[_0x4d29('0x44')]=_['intersection'](_0x492117[_0x4d29('0x42')],_0x492117[_0x4d29('0x46')]);_0x4bf800[_0x4d29('0x47')]=_[_0x4d29('0x45')](_0x492117[_0x4d29('0x42')],qs['fields'](_0x4e4c18['query']['fields']));_0x4bf800[_0x4d29('0x47')]=_0x4bf800['attributes'][_0x4d29('0x49')]?_0x4bf800[_0x4d29('0x47')]:_0x492117[_0x4d29('0x42')];if(_0x4e4c18[_0x4d29('0x46')][_0x4d29('0x52')]){_0x4bf800[_0x4d29('0x53')]=[{'all':!![]}];}_0x4bf800=_['merge']({},_0x4bf800,_0x4e4c18[_0x4d29('0x51')]);return db[_0x4d29('0x3e')][_0x4d29('0x59')](_0x4bf800)[_0x4d29('0xe')](handleEntityNotFound(_0x4742f6,null))[_0x4d29('0xe')](respondWithResult(_0x4742f6,null))[_0x4d29('0x17')](handleError(_0x4742f6,null));};exports[_0x4d29('0x20')]=function(_0x2edd24,_0x28afeb){if(_0x2edd24[_0x4d29('0x5a')]['id']){delete _0x2edd24[_0x4d29('0x5a')]['id'];}var _0x1a82fb=_0x2edd24['body']['provider']===_0x4d29('0x5b')?null:_0x2edd24[_0x4d29('0x5a')][_0x4d29('0x5c')];var _0x16a3d9=_0x2edd24[_0x4d29('0x5a')][_0x4d29('0x37')]||{};var _0x3dfae2=_0x2edd24['body']['Smtp']||{};if(_0x1a82fb){_0x16a3d9[_0x4d29('0x35')]=getImapHost(_0x1a82fb);_0x16a3d9['port']=0x3e1;_0x3dfae2[_0x4d29('0x35')]=getSmtpHost(_0x1a82fb);_0x3dfae2[_0x4d29('0x34')]=0x24b;_0x3dfae2['secure']=![];}if(_0x3dfae2['modernAuthentication']){_0x3dfae2[_0x4d29('0x5d')]=![];}else{_0x3dfae2[_0x4d29('0x33')]=null;}if(!_0x16a3d9[_0x4d29('0x32')])_0x16a3d9[_0x4d29('0x33')]=null;_0x2edd24[_0x4d29('0x5a')]['Imap']=_0x16a3d9;_0x2edd24['body'][_0x4d29('0x38')]=_0x3dfae2;return db[_0x4d29('0x3e')]['find']({'where':{'id':_0x2edd24['params']['id']},'include':[{'model':db[_0x4d29('0x39')],'as':'Imap'},{'model':db[_0x4d29('0x3a')],'as':'Smtp'},{'model':db[_0x4d29('0x3b')],'as':_0x4d29('0x3c')}]})[_0x4d29('0xe')](handleEntityNotFound(_0x28afeb,null))[_0x4d29('0xe')](function(_0x5b2901){if(!_0x5b2901)throw new Error(_0x4d29('0x5e'));if(_0x5b2901['service'])delete _0x2edd24[_0x4d29('0x5a')][_0x4d29('0x37')];return _0x5b2901;})[_0x4d29('0xe')](saveUpdates(_0x2edd24[_0x4d29('0x5a')],null))['then'](function(_0x4350d7){if(!_0x2edd24[_0x4d29('0x5a')][_0x4d29('0x37')])return _0x4350d7;return db[_0x4d29('0x39')][_0x4d29('0x20')](_0x2edd24[_0x4d29('0x5a')][_0x4d29('0x37')],{'where':{'MailAccountId':_0x4350d7['id']}})['then'](function(){return _0x4350d7;});})[_0x4d29('0xe')](function(_0x4c56d1){if(!_0x2edd24[_0x4d29('0x5a')][_0x4d29('0x38')])return _0x4c56d1;return db[_0x4d29('0x3a')]['update'](_0x2edd24[_0x4d29('0x5a')][_0x4d29('0x38')],{'where':{'MailAccountId':_0x4c56d1['id']}})[_0x4d29('0xe')](function(){return _0x4c56d1;});})[_0x4d29('0xe')](respondWithResult(_0x28afeb,null))[_0x4d29('0x17')](handleError(_0x28afeb,null));};exports[_0x4d29('0x5f')]=function(_0x4d6d57,_0x383315){return db[_0x4d29('0x3e')][_0x4d29('0x5f')]()[_0x4d29('0xe')](respondWithResult(_0x383315,null))[_0x4d29('0x17')](handleError(_0x383315,null));};exports['addDisposition']=function(_0x488668,_0x4f7bec){if(_0x488668[_0x4d29('0x5a')]['id']){delete _0x488668['body']['id'];}return db['MailAccount'][_0x4d29('0x59')]({'where':{'id':_0x488668[_0x4d29('0x57')]['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0x4f7bec,null))[_0x4d29('0xe')](function(_0x3e24ed){if(_0x3e24ed){_0x488668[_0x4d29('0x5a')][_0x4d29('0x60')]=_0x3e24ed['id'];return db[_0x4d29('0x61')]['create'](_0x488668['body']);}})[_0x4d29('0xe')](respondWithResult(_0x4f7bec,null))[_0x4d29('0x17')](handleError(_0x4f7bec,null));};exports[_0x4d29('0x62')]=function(_0x50acad,_0x577436){var _0x29122a={'raw':![],'where':{}};var _0x4445f4={};var _0x1cbaae={'count':0x0,'rows':[]};return db[_0x4d29('0x3e')][_0x4d29('0x63')]({'where':{'id':_0x50acad['params']['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0x577436,null))[_0x4d29('0xe')](function(_0x4e74d6){if(_0x4e74d6){_0x4445f4[_0x4d29('0x42')]=_[_0x4d29('0x43')](db[_0x4d29('0x61')][_0x4d29('0x58')]);_0x4445f4['query']=_[_0x4d29('0x43')](_0x50acad['query']);_0x4445f4[_0x4d29('0x44')]=_[_0x4d29('0x45')](_0x4445f4[_0x4d29('0x42')],_0x4445f4[_0x4d29('0x46')]);_0x29122a[_0x4d29('0x47')]=_[_0x4d29('0x45')](_0x4445f4['model'],qs[_0x4d29('0x48')](_0x50acad[_0x4d29('0x46')][_0x4d29('0x48')]));_0x29122a[_0x4d29('0x47')]=_0x29122a[_0x4d29('0x47')][_0x4d29('0x49')]?_0x29122a['attributes']:_0x4445f4['model'];if(!_0x50acad[_0x4d29('0x46')][_0x4d29('0x4a')](_0x4d29('0x64'))){_0x29122a['limit']=qs[_0x4d29('0x1e')](_0x50acad[_0x4d29('0x46')][_0x4d29('0x1e')]);_0x29122a[_0x4d29('0x1b')]=qs[_0x4d29('0x1b')](_0x50acad[_0x4d29('0x46')][_0x4d29('0x1b')]);}_0x29122a[_0x4d29('0x4b')]=qs[_0x4d29('0x4c')](_0x50acad[_0x4d29('0x46')]['sort']);_0x29122a['where']=qs[_0x4d29('0x44')](_[_0x4d29('0x4e')](_0x50acad['query'],_0x4445f4[_0x4d29('0x44')]));_0x29122a[_0x4d29('0x4d')]['MailAccountId']=_0x4e74d6['id'];if(_0x50acad[_0x4d29('0x46')][_0x4d29('0x4f')]){_0x29122a[_0x4d29('0x4d')]=_['merge'](_0x29122a[_0x4d29('0x4d')],{'$or':_[_0x4d29('0x3d')](_0x29122a[_0x4d29('0x47')],function(_0x3bf1e1){var _0x1142a6={};_0x1142a6[_0x3bf1e1]={'$like':'%'+_0x50acad[_0x4d29('0x46')][_0x4d29('0x4f')]+'%'};return _0x1142a6;})});}_0x29122a=_[_0x4d29('0x50')]({},_0x29122a,_0x50acad['options']);return db[_0x4d29('0x61')][_0x4d29('0x1d')]({'where':_0x29122a[_0x4d29('0x4d')]})['then'](function(_0x324b19){_0x1cbaae[_0x4d29('0x1d')]=_0x324b19;if(_0x50acad[_0x4d29('0x46')][_0x4d29('0x52')]){_0x29122a[_0x4d29('0x53')]=[{'all':!![]}];}return db[_0x4d29('0x61')][_0x4d29('0x54')](_0x29122a);})['then'](function(_0x3f111c){_0x1cbaae[_0x4d29('0x55')]=_0x3f111c;return _0x1cbaae;});}})['then'](respondWithFilteredResult(_0x577436,_0x29122a))[_0x4d29('0x17')](handleError(_0x577436,null));};exports[_0x4d29('0x65')]=function(_0x1546a4,_0x244231){return db[_0x4d29('0x3e')][_0x4d29('0x59')]({'where':{'id':_0x1546a4['params']['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0x244231,null))[_0x4d29('0xe')](function(_0xd84666){if(_0xd84666){return _0xd84666[_0x4d29('0x65')](_0x1546a4['query'][_0x4d29('0x66')]);}})[_0x4d29('0xe')](respondWithStatusCode(_0x244231,null))[_0x4d29('0x17')](handleError(_0x244231,null));};exports['addAnswer']=function(_0x300ece,_0x389820){if(_0x300ece[_0x4d29('0x5a')]['id']){delete _0x300ece['body']['id'];}return db[_0x4d29('0x3e')][_0x4d29('0x59')]({'where':{'id':_0x300ece[_0x4d29('0x57')]['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0x389820,null))[_0x4d29('0xe')](function(_0x30f7f7){if(_0x30f7f7){_0x300ece['body']['MailAccountId']=_0x30f7f7['id'];return db[_0x4d29('0x67')][_0x4d29('0x68')](_0x300ece[_0x4d29('0x5a')]);}})[_0x4d29('0xe')](respondWithResult(_0x389820,null))[_0x4d29('0x17')](handleError(_0x389820,null));};exports['getAnswers']=function(_0x118150,_0x2b39fb){var _0x2eac31={'raw':![],'where':{}};var _0x557a08={};var _0x52e6cd={'count':0x0,'rows':[]};return db[_0x4d29('0x3e')][_0x4d29('0x63')]({'where':{'id':_0x118150[_0x4d29('0x57')]['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0x2b39fb,null))[_0x4d29('0xe')](function(_0x11f2ee){if(_0x11f2ee){_0x557a08[_0x4d29('0x42')]=_[_0x4d29('0x43')](db['CannedAnswer']['rawAttributes']);_0x557a08[_0x4d29('0x46')]=_[_0x4d29('0x43')](_0x118150[_0x4d29('0x46')]);_0x557a08[_0x4d29('0x44')]=_[_0x4d29('0x45')](_0x557a08[_0x4d29('0x42')],_0x557a08['query']);_0x2eac31[_0x4d29('0x47')]=_[_0x4d29('0x45')](_0x557a08[_0x4d29('0x42')],qs[_0x4d29('0x48')](_0x118150[_0x4d29('0x46')][_0x4d29('0x48')]));_0x2eac31['attributes']=_0x2eac31['attributes']['length']?_0x2eac31['attributes']:_0x557a08[_0x4d29('0x42')];if(!_0x118150[_0x4d29('0x46')][_0x4d29('0x4a')]('nolimit')){_0x2eac31['limit']=qs[_0x4d29('0x1e')](_0x118150[_0x4d29('0x46')][_0x4d29('0x1e')]);_0x2eac31[_0x4d29('0x1b')]=qs[_0x4d29('0x1b')](_0x118150[_0x4d29('0x46')][_0x4d29('0x1b')]);}_0x2eac31['order']=qs[_0x4d29('0x4c')](_0x118150[_0x4d29('0x46')][_0x4d29('0x4c')]);_0x2eac31[_0x4d29('0x4d')]=qs['filters'](_[_0x4d29('0x4e')](_0x118150[_0x4d29('0x46')],_0x557a08['filters']));_0x2eac31[_0x4d29('0x4d')][_0x4d29('0x60')]=_0x11f2ee['id'];if(_0x118150[_0x4d29('0x46')][_0x4d29('0x4f')]){_0x2eac31[_0x4d29('0x4d')]=_['merge'](_0x2eac31[_0x4d29('0x4d')],{'$or':_[_0x4d29('0x3d')](_0x2eac31['attributes'],function(_0x4c74f2){var _0x2e69e1={};_0x2e69e1[_0x4c74f2]={'$like':'%'+_0x118150[_0x4d29('0x46')][_0x4d29('0x4f')]+'%'};return _0x2e69e1;})});}_0x2eac31=_[_0x4d29('0x50')]({},_0x2eac31,_0x118150[_0x4d29('0x51')]);return db[_0x4d29('0x67')][_0x4d29('0x1d')]({'where':_0x2eac31[_0x4d29('0x4d')]})[_0x4d29('0xe')](function(_0x1d9db3){_0x52e6cd[_0x4d29('0x1d')]=_0x1d9db3;if(_0x118150[_0x4d29('0x46')][_0x4d29('0x52')]){_0x2eac31[_0x4d29('0x53')]=[{'all':!![]}];}return db[_0x4d29('0x67')][_0x4d29('0x54')](_0x2eac31);})['then'](function(_0x395764){_0x52e6cd[_0x4d29('0x55')]=_0x395764;return _0x52e6cd;});}})[_0x4d29('0xe')](respondWithFilteredResult(_0x2b39fb,_0x2eac31))[_0x4d29('0x17')](handleError(_0x2b39fb,null));};exports[_0x4d29('0x69')]=function(_0x21a333,_0x1c217d){return db[_0x4d29('0x3e')][_0x4d29('0x59')]({'where':{'id':_0x21a333[_0x4d29('0x57')]['id']}})['then'](handleEntityNotFound(_0x1c217d,null))['then'](function(_0x3b6f8c){if(_0x3b6f8c){return _0x3b6f8c['removeAnswers'](_0x21a333[_0x4d29('0x46')][_0x4d29('0x66')]);}})[_0x4d29('0xe')](respondWithStatusCode(_0x1c217d,null))['catch'](handleError(_0x1c217d,null));};exports['create']=function(_0x55f433,_0x5d6bab){var _0x526488={'name':_0x55f433[_0x4d29('0x5a')]['name'],'key':_0x55f433[_0x4d29('0x5a')][_0x4d29('0x41')],'provider':_0x55f433[_0x4d29('0x5a')][_0x4d29('0x5c')]===_0x4d29('0x5b')?null:_0x55f433[_0x4d29('0x5a')][_0x4d29('0x5c')],'email':_0x55f433[_0x4d29('0x5a')]['email'],'ListId':_0x55f433[_0x4d29('0x5a')]['ListId'],'active':!_[_0x4d29('0x6a')](_0x55f433[_0x4d29('0x5a')][_0x4d29('0x6b')])?_0x55f433[_0x4d29('0x5a')][_0x4d29('0x6b')]:!![],'description':_0x55f433['body'][_0x4d29('0x6c')]||null};var _0xc549d7=getAuthenticationOptions(_0x526488['provider'],_0x55f433[_0x4d29('0x5a')]);_0x526488['Imap']=_0xc549d7[_0x4d29('0x37')];_0x526488[_0x4d29('0x38')]=_0xc549d7[_0x4d29('0x38')];return db[_0x4d29('0x3e')][_0x4d29('0x68')](_0x526488,{'include':[{'model':db[_0x4d29('0x3a')],'as':_0x4d29('0x38')},{'model':db[_0x4d29('0x39')],'as':'Imap'}]})[_0x4d29('0xe')](function(_0x153129){var _0x4baf7d=_0x55f433['user'][_0x4d29('0x22')]({'plain':!![]});if(!_0x4baf7d)throw new Error(_0x4d29('0x6d'));if(_0x4baf7d[_0x4d29('0x6e')]===_0x4d29('0x2e')){var _0x39cf2e=_0x153129[_0x4d29('0x22')]({'plain':!![]});return db[_0x4d29('0x6f')][_0x4d29('0x59')]({'where':{'name':'MailAccounts','userProfileId':_0x4baf7d[_0x4d29('0x70')]},'raw':!![]})[_0x4d29('0xe')](function(_0x15ed85){if(_0x15ed85&&_0x15ed85[_0x4d29('0x71')]===0x0){return db[_0x4d29('0x72')][_0x4d29('0x68')]({'name':_0x39cf2e[_0x4d29('0x25')],'resourceId':_0x39cf2e['id'],'type':_0x15ed85[_0x4d29('0x25')],'sectionId':_0x15ed85['id']},{})[_0x4d29('0xe')](function(){return _0x153129;});}else{return _0x153129;}})['catch'](function(_0x4d625b){logger[_0x4d29('0x13')](_0x4d29('0x73'),_0x4d625b);throw _0x4d625b;});}return _0x153129;})[_0x4d29('0xe')](respondWithResult(_0x5d6bab,0xc9))[_0x4d29('0x17')](handleError(_0x5d6bab,null));};exports['getImap']=function(_0xbebcc3,_0x4f7a28){return db['MailAccount'][_0x4d29('0x63')]({'where':{'id':_0xbebcc3['params']['id']}})['then'](handleEntityNotFound(_0x4f7a28,null))[_0x4d29('0xe')](function(_0x2bf1fd){if(_0x2bf1fd){return _0x2bf1fd[_0x4d29('0x74')]();}return null;})[_0x4d29('0xe')](respondWithResult(_0x4f7a28,null))[_0x4d29('0x17')](handleError(_0x4f7a28,null));};exports['addImap']=function(_0x3f63a3,_0x8818be){if(_0x3f63a3['body']['id']){delete _0x3f63a3[_0x4d29('0x5a')]['id'];}return db[_0x4d29('0x3e')][_0x4d29('0x59')]({'where':{'id':_0x3f63a3[_0x4d29('0x57')]['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0x8818be,null))[_0x4d29('0xe')](function(_0x2fc00b){if(_0x2fc00b){_0x3f63a3['body'][_0x4d29('0x60')]=_0x2fc00b['id'];return db[_0x4d29('0x39')][_0x4d29('0x68')](_0x3f63a3['body']);}})[_0x4d29('0xe')](respondWithResult(_0x8818be,null))[_0x4d29('0x17')](handleError(_0x8818be,null));};exports['removeImap']=function(_0x2ce807,_0x4c7006){return db[_0x4d29('0x3e')][_0x4d29('0x63')]({'where':{'id':_0x2ce807['params']['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0x4c7006,null))[_0x4d29('0xe')](function(_0x4b63e0){if(_0x4b63e0){return _0x4b63e0[_0x4d29('0x75')](null);}return null;})[_0x4d29('0xe')](respondWithStatusCode(_0x4c7006,null))['catch'](handleError(_0x4c7006,null));};exports[_0x4d29('0x76')]=function(_0x160ebc,_0x4d0964){return db[_0x4d29('0x3e')][_0x4d29('0x63')]({'where':{'id':_0x160ebc[_0x4d29('0x57')]['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0x4d0964,null))['then'](function(_0x5fb34a){if(_0x5fb34a){return _0x5fb34a['getSmtp']();}return null;})['then'](respondWithResult(_0x4d0964,null))[_0x4d29('0x17')](handleError(_0x4d0964,null));};exports[_0x4d29('0x77')]=function(_0x531f67,_0xcf00c6){if(_0x531f67[_0x4d29('0x5a')]['id']){delete _0x531f67[_0x4d29('0x5a')]['id'];}return db[_0x4d29('0x3e')][_0x4d29('0x59')]({'where':{'id':_0x531f67['params']['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0xcf00c6,null))[_0x4d29('0xe')](function(_0x15dec3){if(_0x15dec3){_0x531f67[_0x4d29('0x5a')][_0x4d29('0x60')]=_0x15dec3['id'];return db[_0x4d29('0x3a')]['create'](_0x531f67[_0x4d29('0x5a')]);}})[_0x4d29('0xe')](respondWithResult(_0xcf00c6,null))[_0x4d29('0x17')](handleError(_0xcf00c6,null));};exports['removeSmtp']=function(_0x1af665,_0x51ed9b){return db['MailAccount']['findOne']({'where':{'id':_0x1af665[_0x4d29('0x57')]['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0x51ed9b,null))[_0x4d29('0xe')](function(_0x1cca7a){if(_0x1cca7a){return _0x1cca7a[_0x4d29('0x78')](null);}return null;})[_0x4d29('0xe')](respondWithStatusCode(_0x51ed9b,null))[_0x4d29('0x17')](handleError(_0x51ed9b,null));};exports['addInteraction']=function(_0x434cce,_0x1603c7){return db[_0x4d29('0x79')][_0x4d29('0x59')]({'where':{'id':_0x434cce['params']['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0x1603c7,null))[_0x4d29('0xe')](function(_0x283fa6){if(_0x283fa6){return _0x283fa6['addInteraction'](_0x434cce['body'][_0x4d29('0x66')],_[_0x4d29('0x7a')](_0x434cce['body'],[_0x4d29('0x66'),'id'])||{});}})[_0x4d29('0xe')](respondWithResult(_0x1603c7,null))[_0x4d29('0x17')](handleError(_0x1603c7,null));};exports[_0x4d29('0x7b')]=function(_0x424529,_0x153ccf){var _0x4f2e3d={'raw':![],'where':{}};var _0x45a535={};var _0xb95d9b={'count':0x0,'rows':[]};return db['MailAccount'][_0x4d29('0x63')]({'where':{'id':_0x424529[_0x4d29('0x57')]['id']}})['then'](handleEntityNotFound(_0x153ccf,null))[_0x4d29('0xe')](function(_0x1d61b6){if(_0x1d61b6){_0x45a535[_0x4d29('0x42')]=_['keys'](db[_0x4d29('0x79')][_0x4d29('0x58')]);_0x45a535[_0x4d29('0x46')]=_[_0x4d29('0x43')](_0x424529['query']);_0x45a535['filters']=_['intersection'](_0x45a535[_0x4d29('0x42')],_0x45a535['query']);_0x4f2e3d[_0x4d29('0x47')]=_['intersection'](_0x45a535[_0x4d29('0x42')],qs[_0x4d29('0x48')](_0x424529[_0x4d29('0x46')][_0x4d29('0x48')]));_0x4f2e3d[_0x4d29('0x47')]=_0x4f2e3d[_0x4d29('0x47')][_0x4d29('0x49')]?_0x4f2e3d['attributes']:_0x45a535[_0x4d29('0x42')];if(!_0x424529['query'][_0x4d29('0x4a')](_0x4d29('0x64'))){_0x4f2e3d[_0x4d29('0x1e')]=qs[_0x4d29('0x1e')](_0x424529[_0x4d29('0x46')][_0x4d29('0x1e')]);_0x4f2e3d['offset']=qs[_0x4d29('0x1b')](_0x424529[_0x4d29('0x46')]['offset']);}_0x4f2e3d['order']=qs['sort'](_0x424529[_0x4d29('0x46')][_0x4d29('0x4c')]);_0x4f2e3d[_0x4d29('0x4d')]=qs[_0x4d29('0x44')](_[_0x4d29('0x4e')](_0x424529['query'],_0x45a535[_0x4d29('0x44')]));_0x4f2e3d[_0x4d29('0x4d')]['MailAccountId']=_0x1d61b6['id'];if(_0x424529[_0x4d29('0x46')][_0x4d29('0x4f')]){_0x4f2e3d['where']=_['merge'](_0x4f2e3d[_0x4d29('0x4d')],{'$or':_[_0x4d29('0x3d')](_0x4f2e3d[_0x4d29('0x47')],function(_0x95b4cb){var _0xb03787={};_0xb03787[_0x95b4cb]={'$like':'%'+_0x424529[_0x4d29('0x46')]['filter']+'%'};return _0xb03787;})});}_0x4f2e3d=_[_0x4d29('0x50')]({},_0x4f2e3d,_0x424529['options']);return db['MailInteraction'][_0x4d29('0x1d')]({'where':_0x4f2e3d[_0x4d29('0x4d')]})[_0x4d29('0xe')](function(_0x43c049){_0xb95d9b['count']=_0x43c049;if(_0x424529[_0x4d29('0x46')][_0x4d29('0x52')]){_0x4f2e3d[_0x4d29('0x53')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x4d29('0x7c')],'as':_0x4d29('0x7d'),'attributes':[_0x4d29('0x25'),_0x4d29('0x7e'),_0x4d29('0x7f')],'required':![]},{'model':db['Tag'],'as':_0x4d29('0x80'),'attributes':['id',_0x4d29('0x25'),'color'],'where':_0x424529['query'][_0x4d29('0x81')]?{'id':_0x424529[_0x4d29('0x46')][_0x4d29('0x81')]}:undefined,'required':_0x424529[_0x4d29('0x46')][_0x4d29('0x81')]?!![]:![]}];}return db[_0x4d29('0x79')][_0x4d29('0x54')](_0x4f2e3d);})[_0x4d29('0xe')](function(_0x74cf4d){_0xb95d9b['rows']=_0x74cf4d;return _0xb95d9b;});}})[_0x4d29('0xe')](respondWithFilteredResult(_0x153ccf,_0x4f2e3d))[_0x4d29('0x17')](handleError(_0x153ccf,null));};exports['addApplications']=function addApplications(_0x35d6d1,_0x1714cb){var _0x4cbd32=_0x35d6d1[_0x4d29('0x57')]['id'];var _0x3841e1=_0x35d6d1[_0x4d29('0x5a')];var _0x2c25f0=0xc8;var _0x224122=null;return db[_0x4d29('0x82')][_0x4d29('0x83')]({'isolationLevel':db[_0x4d29('0x82')][_0x4d29('0x84')][_0x4d29('0x85')][_0x4d29('0x86')]},function(_0x17dd30){return db['MailAccount'][_0x4d29('0x63')]({'where':{'id':_0x4cbd32},'transaction':_0x17dd30})[_0x4d29('0xe')](function(_0x20d398){if(_0x20d398){return db[_0x4d29('0x87')][_0x4d29('0x21')]({'where':{'MailAccountId':_0x4cbd32},'transaction':_0x17dd30})[_0x4d29('0xe')](function(){var _0x2495fd=_['map'](_0x3841e1,function(_0x5e760d){_0x5e760d[_0x4d29('0x60')]=_0x4cbd32;return _0x5e760d;});return db[_0x4d29('0x87')][_0x4d29('0x88')](_0x2495fd,{'transaction':_0x17dd30});});}else{_0x2c25f0=0x194;_0x224122=[];}});})[_0x4d29('0xe')](function(){if(_0x2c25f0!==0x194){return db[_0x4d29('0x87')][_0x4d29('0x89')]({'where':{'MailAccountId':_0x4cbd32},'order':_0x4d29('0x8a')})[_0x4d29('0xe')](function(_0x5c5f98){_0x224122=_0x5c5f98;});}})['catch'](function(_0x511f82){_0x2c25f0=0x1f4;logger['error'](_0x511f82['stack']);if(_0x511f82[_0x4d29('0x25')]){delete _0x511f82[_0x4d29('0x25')];}_0x224122=_0x511f82;})['finally'](function(){if(_0x224122===null){_0x1714cb[_0x4d29('0x8b')](_0x2c25f0);}else{if(_0x2c25f0===0x1f4){_0x1714cb[_0x4d29('0x19')](_0x2c25f0)[_0x4d29('0x8c')](_0x224122);}else{_0x1714cb['status'](_0x2c25f0)[_0x4d29('0x1a')](_0x224122);}}});};exports[_0x4d29('0x8d')]=function(_0x17b4a0,_0x5ad065){var _0x5e2bab={};var _0x1d3235={};var _0x767c40;var _0x376892;return db[_0x4d29('0x3e')][_0x4d29('0x63')]({'where':{'id':_0x17b4a0[_0x4d29('0x57')]['id']}})['then'](handleEntityNotFound(_0x5ad065,null))[_0x4d29('0xe')](function(_0x261cc9){if(_0x261cc9){_0x767c40=_0x261cc9;_0x1d3235['model']=_[_0x4d29('0x43')](db[_0x4d29('0x87')][_0x4d29('0x58')]);_0x1d3235[_0x4d29('0x46')]=_['keys'](_0x17b4a0[_0x4d29('0x46')]);_0x1d3235[_0x4d29('0x44')]=_[_0x4d29('0x45')](_0x1d3235[_0x4d29('0x42')],_0x1d3235[_0x4d29('0x46')]);_0x5e2bab['attributes']=_[_0x4d29('0x45')](_0x1d3235['model'],qs['fields'](_0x17b4a0['query']['fields']));_0x5e2bab[_0x4d29('0x47')]=_0x5e2bab[_0x4d29('0x47')]['length']?_0x5e2bab[_0x4d29('0x47')]:_0x1d3235[_0x4d29('0x42')];_0x5e2bab[_0x4d29('0x4b')]=qs['sort'](_0x17b4a0['query'][_0x4d29('0x4c')]);_0x5e2bab[_0x4d29('0x4d')]=qs[_0x4d29('0x44')](_[_0x4d29('0x4e')](_0x17b4a0[_0x4d29('0x46')],_0x1d3235[_0x4d29('0x44')]));if(_0x17b4a0[_0x4d29('0x46')][_0x4d29('0x4f')]){_0x5e2bab['where']=_[_0x4d29('0x50')](_0x5e2bab['where'],{'$or':_[_0x4d29('0x3d')](_0x5e2bab[_0x4d29('0x47')],function(_0x1d7a16){var _0x102af2={};_0x102af2[_0x1d7a16]={'$like':'%'+_0x17b4a0[_0x4d29('0x46')][_0x4d29('0x4f')]+'%'};return _0x102af2;})});}_0x5e2bab=_[_0x4d29('0x50')]({},_0x5e2bab,_0x17b4a0[_0x4d29('0x51')]);return _0x767c40[_0x4d29('0x8d')](_0x5e2bab);}})[_0x4d29('0xe')](function(_0x509f06){if(_0x509f06){_0x376892=_0x509f06[_0x4d29('0x49')];if(!_0x17b4a0[_0x4d29('0x46')][_0x4d29('0x4a')](_0x4d29('0x64'))){_0x5e2bab[_0x4d29('0x1e')]=qs['limit'](_0x17b4a0[_0x4d29('0x46')][_0x4d29('0x1e')]);_0x5e2bab['offset']=qs[_0x4d29('0x1b')](_0x17b4a0[_0x4d29('0x46')][_0x4d29('0x1b')]);}return _0x767c40['getApplications'](_0x5e2bab);}})[_0x4d29('0xe')](function(_0x54bc86){if(_0x54bc86){return _0x54bc86?{'count':_0x376892,'rows':_0x54bc86}:null;}})['then'](respondWithResult(_0x5ad065,null))[_0x4d29('0x17')](handleError(_0x5ad065,null));};exports[_0x4d29('0x8e')]=function(_0x4fbc8d,_0x452f1f){var _0x45ff58={'raw':!![],'where':{}};var _0x2f424d={};var _0x572d9e={'count':0x0,'rows':[]};return db[_0x4d29('0x3e')][_0x4d29('0x63')]({'where':{'id':_0x4fbc8d[_0x4d29('0x57')]['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0x452f1f,null))['then'](function(_0xe58bb5){if(_0xe58bb5){_0x2f424d[_0x4d29('0x42')]=_[_0x4d29('0x43')](db['MailMessage']['rawAttributes']);_0x2f424d['query']=_[_0x4d29('0x43')](_0x4fbc8d[_0x4d29('0x46')]);_0x2f424d['filters']=_[_0x4d29('0x45')](_0x2f424d[_0x4d29('0x42')],_0x2f424d['query']);_0x45ff58['attributes']=_[_0x4d29('0x45')](_0x2f424d[_0x4d29('0x42')],qs[_0x4d29('0x48')](_0x4fbc8d[_0x4d29('0x46')][_0x4d29('0x48')]));_0x45ff58['attributes']=_0x45ff58[_0x4d29('0x47')][_0x4d29('0x49')]?_0x45ff58[_0x4d29('0x47')]:_0x2f424d[_0x4d29('0x42')];if(!_0x4fbc8d[_0x4d29('0x46')][_0x4d29('0x4a')]('nolimit')){_0x45ff58['limit']=qs[_0x4d29('0x1e')](_0x4fbc8d['query'][_0x4d29('0x1e')]);_0x45ff58[_0x4d29('0x1b')]=qs[_0x4d29('0x1b')](_0x4fbc8d['query'][_0x4d29('0x1b')]);}_0x45ff58[_0x4d29('0x4b')]=qs[_0x4d29('0x4c')](_0x4fbc8d[_0x4d29('0x46')][_0x4d29('0x4c')]);_0x45ff58[_0x4d29('0x4d')]=qs[_0x4d29('0x44')](_[_0x4d29('0x4e')](_0x4fbc8d[_0x4d29('0x46')],_0x2f424d[_0x4d29('0x44')]));_0x45ff58[_0x4d29('0x4d')][_0x4d29('0x60')]=_0xe58bb5['id'];if(_0x4fbc8d['query'][_0x4d29('0x4f')]){_0x45ff58[_0x4d29('0x4d')]=_[_0x4d29('0x50')](_0x45ff58[_0x4d29('0x4d')],{'$or':_[_0x4d29('0x3d')](_0x45ff58[_0x4d29('0x47')],function(_0x5376e3){var _0x3b27f2={};_0x3b27f2[_0x5376e3]={'$like':'%'+_0x4fbc8d['query'][_0x4d29('0x4f')]+'%'};return _0x3b27f2;})});}if(_0x4fbc8d[_0x4d29('0x46')][_0x4d29('0x8f')]){var _0x3935bf=_0x4fbc8d['query']['$gte'][_0x4d29('0x90')](',');var _0x1f5f71={};_0x1f5f71[_0x3935bf[0x0]]={'$gte':moment(_0x3935bf[0x1])[_0x4d29('0x91')](_0x4d29('0x92'))};_0x45ff58[_0x4d29('0x4d')]=_[_0x4d29('0x50')](_0x45ff58[_0x4d29('0x4d')],_0x1f5f71);}_0x45ff58=_['merge']({},_0x45ff58,_0x4fbc8d['options']);return db['MailMessage']['count']({'where':_0x45ff58[_0x4d29('0x4d')]})[_0x4d29('0xe')](function(_0x46bf95){_0x572d9e[_0x4d29('0x1d')]=_0x46bf95;if(_0x4fbc8d[_0x4d29('0x46')][_0x4d29('0x52')]){_0x45ff58[_0x4d29('0x53')]=[{'all':!![]}];}return db[_0x4d29('0x93')][_0x4d29('0x54')](_0x45ff58);})[_0x4d29('0xe')](function(_0x36994e){if(_0x4fbc8d[_0x4d29('0x46')][_0x4d29('0x94')]===_0x4d29('0x95')){for(var _0x121d0d=0x0;_0x121d0d<_0x36994e[_0x4d29('0x49')];_0x121d0d++){_0x36994e[_0x121d0d][_0x4d29('0x5a')]=juice(_0x36994e[_0x121d0d]['body']);}}_0x572d9e[_0x4d29('0x55')]=_0x36994e;return _0x572d9e;});}})['then'](respondWithFilteredResult(_0x452f1f,_0x45ff58))['catch'](handleError(_0x452f1f,null));};exports['send']=function(_0x13383b,_0x30f56d){var _0x34e25c,_0x1411e5={},_0x57f94c;if(_0x13383b[_0x4d29('0x5a')]['to']){_0x57f94c=_0x13383b[_0x4d29('0x5a')]['to'][_0x4d29('0x90')](',')[0x0];}return db[_0x4d29('0x3e')][_0x4d29('0x59')]({'where':{'id':_0x13383b[_0x4d29('0x57')]['id']},'include':[{'model':db[_0x4d29('0x96')],'as':_0x4d29('0x97'),'include':[{'model':db[_0x4d29('0x98')],'as':_0x4d29('0x99'),'where':{'email':_0x57f94c},'limit':0x1,'order':[['updatedAt',_0x4d29('0x9a')]]}]},{'model':db[_0x4d29('0x3a')],'as':_0x4d29('0x38'),'raw':!![],'include':[{'model':db[_0x4d29('0x9b')],'as':_0x4d29('0x9b'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x30f56d,null))['then'](function(_0x35685c){if(!_0x35685c)return;_0x34e25c=_0x35685c;if(!_0x35685c[_0x4d29('0x38')])throw new Error(_0x4d29('0x9c'));if(_[_0x4d29('0x6a')](_0x13383b['body'][_0x4d29('0x9d')])){_0x13383b[_0x4d29('0x5a')][_0x4d29('0x9d')]=util['format'](_0x4d29('0x9e'),_0x35685c[_0x4d29('0x25')],_0x35685c[_0x4d29('0x9f')]||_0x35685c['Smtp']['user']);}if(_0x13383b[_0x4d29('0x5a')][_0x4d29('0xa0')]&&_0x13383b[_0x4d29('0x5a')][_0x4d29('0xa0')]['length']){for(var _0x47f1d8=0x0;_0x47f1d8<_0x13383b['body']['attachments'][_0x4d29('0x49')];_0x47f1d8+=0x1){_0x13383b[_0x4d29('0x5a')][_0x4d29('0xa0')][_0x47f1d8]={'filename':_0x13383b['body'][_0x4d29('0xa0')][_0x47f1d8][_0x4d29('0x25')],'path':path[_0x4d29('0xa1')](config[_0x4d29('0xa2')],_0x4d29('0xa3'),_0x13383b[_0x4d29('0x5a')]['attachments'][_0x47f1d8][_0x4d29('0xa4')])};}}var _0x30b10a=_0x35685c[_0x4d29('0xa5')]();return respondWithRpcPromise(_0x4d29('0xa6'),_0x4d29('0xa7'),{'account':_0x30b10a,'message':_0x13383b['body']});})[_0x4d29('0xe')](function(_0x2d6d85){if(!_0x2d6d85)return;_0x1411e5=_0x2d6d85;if(!_0x34e25c[_0x4d29('0x97')])throw new Error(_0x4d29('0xa8'));if(_0x34e25c[_0x4d29('0x97')][_0x4d29('0x99')][_0x4d29('0x49')])return _0x34e25c[_0x4d29('0x97')][_0x4d29('0x99')][0x0];return db['CmContact'][_0x4d29('0x68')](_[_0x4d29('0x8')](_0x13383b[_0x4d29('0x5a')],{'firstName':_0x13383b['body']['to'],'email':_0x13383b[_0x4d29('0x5a')]['to'],'phone':_0x13383b[_0x4d29('0x5a')]['to'],'ListId':_0x34e25c['ListId']}));})[_0x4d29('0xe')](function(_0x594bf3){if(!_0x594bf3)return;var _0x3d2090={'UserId':_0x13383b[_0x4d29('0x2e')]['id'],'ContactId':_0x594bf3['id'],'MailAccountId':_0x34e25c['id'],'inReplyTo':_0x1411e5[_0x4d29('0xa9')],'to':_0x13383b[_0x4d29('0x5a')]['from'],'cc':_0x13383b['body']['cc'],'subject':_0x13383b['body'][_0x4d29('0xaa')],'attach':_0x13383b[_0x4d29('0x5a')]['attach'],'firstMsgDirection':_0x4d29('0xab'),'lastMsgAt':moment()['format'](_0x4d29('0x92')),'lastMsgDirection':'out','Messages':[_[_0x4d29('0x50')](_0x13383b['body'],{'messageId':_0x1411e5['messageId'],'sentAt':moment()[_0x4d29('0x91')](_0x4d29('0x92')),'read':!![],'MailAccountId':_0x34e25c['id'],'UserId':_0x13383b['user']['id'],'ContactId':_0x594bf3['id']})]};if(_0x13383b[_0x4d29('0x5a')]['Interaction']){_0x3d2090=_[_0x4d29('0x50')](_0x3d2090,_0x13383b[_0x4d29('0x5a')][_0x4d29('0xac')]);}return db[_0x4d29('0x79')][_0x4d29('0x68')](_0x3d2090,{'include':[{'model':db[_0x4d29('0x93')],'as':_0x4d29('0xad')}]});})[_0x4d29('0xe')](respondWithResult(_0x30f56d,null))[_0x4d29('0x17')](handleError(_0x30f56d,null));};exports[_0x4d29('0xae')]=function(_0x455e06,_0x1279c9){return db[_0x4d29('0x3e')][_0x4d29('0x59')]({'where':{'id':_0x455e06[_0x4d29('0x57')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x4d29('0x38'),'raw':!![],'include':[{'model':db[_0x4d29('0x9b')],'as':_0x4d29('0x9b'),'raw':!![]}]}]})[_0x4d29('0xe')](handleEntityNotFound(_0x1279c9,null))[_0x4d29('0xe')](function(_0x186f43){if(!_0x186f43['Smtp'])return;var _0x1e332e=_0x186f43[_0x4d29('0xa5')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x1e332e});})['then'](respondWithResult(_0x1279c9,null))[_0x4d29('0x17')](handleError(_0x1279c9,null));};exports[_0x4d29('0x21')]=function(_0x31dc74,_0x404c3f){return db[_0x4d29('0x3e')][_0x4d29('0x59')]({'where':{'id':_0x31dc74[_0x4d29('0x57')]['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0x404c3f,null))[_0x4d29('0xe')](function(_0x1e1fad){if(_0x1e1fad&&_0x1e1fad[_0x4d29('0x36')]){throw new db[(_0x4d29('0xaf'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x1e1fad;})[_0x4d29('0xe')](removeEntity(_0x404c3f,null))['catch'](handleError(_0x404c3f,null));};exports['addAgents']=function(_0x5404b8,_0x46dc8f){return db['MailAccount'][_0x4d29('0x59')]({'where':{'id':_0x5404b8[_0x4d29('0x57')]['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0x46dc8f,null))[_0x4d29('0xe')](function(_0x19df3d){if(_0x19df3d){return _0x19df3d[_0x4d29('0xb0')](_0x5404b8[_0x4d29('0x5a')]['ids'],_[_0x4d29('0x7a')](_0x5404b8[_0x4d29('0x5a')],[_0x4d29('0x66'),'id'])||{})[_0x4d29('0xb1')](function(_0xe56767){for(var _0x3d78c2=0x0;_0x3d78c2<_0x5404b8[_0x4d29('0x5a')][_0x4d29('0x66')][_0x4d29('0x49')];_0x3d78c2+=0x1){socket[_0x4d29('0xb2')](_0x4d29('0xb3'),{'UserId':Number(_0x5404b8[_0x4d29('0x5a')][_0x4d29('0x66')][_0x3d78c2]),'MailAccountId':Number(_0x5404b8[_0x4d29('0x57')]['id'])});}return _0xe56767;});}})['then'](respondWithResult(_0x46dc8f,null))[_0x4d29('0x17')](handleError(_0x46dc8f,null));};exports[_0x4d29('0xb4')]=function(_0x5e5f94,_0x5b2f8e){return db[_0x4d29('0x3e')]['find']({'where':{'id':_0x5e5f94[_0x4d29('0x57')]['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0x5b2f8e,null))[_0x4d29('0xe')](function(_0x1ca1f6){if(_0x1ca1f6){return _0x1ca1f6[_0x4d29('0xb4')](_0x5e5f94[_0x4d29('0x46')][_0x4d29('0x66')])['then'](function(){if(_[_0x4d29('0xb5')](_0x5e5f94[_0x4d29('0x46')]['ids'])){for(var _0x5af10a=0x0;_0x5af10a<_0x5e5f94[_0x4d29('0x46')]['ids'][_0x4d29('0x49')];_0x5af10a+=0x1){socket[_0x4d29('0xb2')](_0x4d29('0xb6'),{'UserId':Number(_0x5e5f94[_0x4d29('0x46')]['ids'][_0x5af10a]),'MailAccountId':Number(_0x5e5f94[_0x4d29('0x57')]['id'])});}}else{socket[_0x4d29('0xb2')](_0x4d29('0xb6'),{'UserId':Number(_0x5e5f94[_0x4d29('0x46')][_0x4d29('0x66')]),'MailAccountId':Number(_0x5e5f94[_0x4d29('0x57')]['id'])});}});}})[_0x4d29('0xe')](respondWithStatusCode(_0x5b2f8e,null))[_0x4d29('0x17')](handleError(_0x5b2f8e,null));};exports[_0x4d29('0xb7')]=function(_0x44d78d,_0xa59912){var _0x3823ca={};var _0x39f3a5={};var _0x801155;var _0x59fa83;return db[_0x4d29('0x3e')]['findOne']({'where':{'id':_0x44d78d[_0x4d29('0x57')]['id']}})[_0x4d29('0xe')](handleEntityNotFound(_0xa59912,null))[_0x4d29('0xe')](function(_0x2933cd){if(_0x2933cd){_0x801155=_0x2933cd;_0x39f3a5[_0x4d29('0x42')]=_[_0x4d29('0x43')](db[_0x4d29('0x7c')][_0x4d29('0x58')]);_0x39f3a5['query']=_[_0x4d29('0x43')](_0x44d78d[_0x4d29('0x46')]);_0x39f3a5[_0x4d29('0x44')]=_[_0x4d29('0x45')](_0x39f3a5[_0x4d29('0x42')],_0x39f3a5[_0x4d29('0x46')]);_0x3823ca['attributes']=_[_0x4d29('0x45')](_0x39f3a5[_0x4d29('0x42')],qs[_0x4d29('0x48')](_0x44d78d['query'][_0x4d29('0x48')]));_0x3823ca['attributes']=_0x3823ca[_0x4d29('0x47')][_0x4d29('0x49')]?_0x3823ca[_0x4d29('0x47')]:_0x39f3a5[_0x4d29('0x42')];_0x3823ca[_0x4d29('0x4b')]=qs[_0x4d29('0x4c')](_0x44d78d[_0x4d29('0x46')]['sort']);_0x3823ca['where']=qs[_0x4d29('0x44')](_['pick'](_0x44d78d[_0x4d29('0x46')],_0x39f3a5[_0x4d29('0x44')]));if(_0x44d78d[_0x4d29('0x46')]['filter']){_0x3823ca[_0x4d29('0x4d')]=_[_0x4d29('0x50')](_0x3823ca[_0x4d29('0x4d')],{'$or':_[_0x4d29('0x3d')](_0x3823ca[_0x4d29('0x47')],function(_0x460697){var _0x510556={};_0x510556[_0x460697]={'$like':'%'+_0x44d78d[_0x4d29('0x46')][_0x4d29('0x4f')]+'%'};return _0x510556;})});}_0x3823ca=_[_0x4d29('0x50')]({},_0x3823ca,_0x44d78d[_0x4d29('0x51')]);return _0x801155[_0x4d29('0xb7')](_0x3823ca);}})[_0x4d29('0xe')](function(_0x40af61){if(_0x40af61){_0x59fa83=_0x40af61[_0x4d29('0x49')];if(!_0x44d78d[_0x4d29('0x46')][_0x4d29('0x4a')](_0x4d29('0x64'))){_0x3823ca[_0x4d29('0x1e')]=qs[_0x4d29('0x1e')](_0x44d78d[_0x4d29('0x46')][_0x4d29('0x1e')]);_0x3823ca[_0x4d29('0x1b')]=qs[_0x4d29('0x1b')](_0x44d78d[_0x4d29('0x46')][_0x4d29('0x1b')]);}return _0x801155[_0x4d29('0xb7')](_0x3823ca);}})[_0x4d29('0xe')](function(_0x44d06f){if(_0x44d06f){return _0x44d06f?{'count':_0x59fa83,'rows':_0x44d06f}:null;}})[_0x4d29('0xe')](respondWithResult(_0xa59912,null))[_0x4d29('0x17')](handleError(_0xa59912,null));}; \ No newline at end of file +var _0xbe55=['getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','getInteractions','MailInteraction','CmContact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','$gte','split','MailMessage','inlineCss','true','CmList','List','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','SendMail','List\x20not\x20found','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','getSmtpOptions','VerifySmtp','verifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','jayson/promise','client','request','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','pass','Imap','Smtp','index','MailServerIn','MailServerOut','mandatoryDispositionPause','map','MailAccount','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','keys','rawAttributes','find','update','body','provider','Pause','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','create','getDispositions','Disposition','hasOwnProperty','ids','CannedAnswer','getAnswers','findOne','include','removeAnswers','custom','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','autoAssociation'];(function(_0x51c429,_0x1bc1fd){var _0x1bbf31=function(_0x2fe7fb){while(--_0x2fe7fb){_0x51c429['push'](_0x51c429['shift']());}};_0x1bbf31(++_0x1bc1fd);}(_0xbe55,0x1d2));var _0x5be5=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xbe55[_0x543084];return _0x306a57;};'use strict';var moment=require(_0x5be5('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var _=require(_0x5be5('0x1'));var juice=require(_0x5be5('0x2'));var Redis=require(_0x5be5('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x5be5('0x4'))(_0x5be5('0x5'));var config=require(_0x5be5('0x6'));var db=require(_0x5be5('0x7'))['db'];config[_0x5be5('0x8')]=_[_0x5be5('0x9')](config[_0x5be5('0x8')],{'host':_0x5be5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailAccount.socket')['register'](socket);var jayson=require(_0x5be5('0xb'));var client=jayson[_0x5be5('0xc')]['http']({'port':0x232b});function respondWithRpcPromise(_0x2eaba3,_0x2f2a4c,_0x68798c,_0x5011cb){return new BPromise(function(_0x57d7ba,_0x5d2492){var _0x3f0f5e=_0x5011cb||client;return _0x3f0f5e[_0x5be5('0xd')](_0x2eaba3,_0x68798c)['then'](function(_0x3bfbde){logger[_0x5be5('0xe')](_0x5be5('0xf'),_0x2f2a4c,'request\x20sent');logger[_0x5be5('0x10')](_0x5be5('0x11'),_0x2f2a4c,_0x5be5('0x12'),JSON[_0x5be5('0x13')](_0x3bfbde));if(_0x3bfbde[_0x5be5('0x14')]){if(_0x3bfbde[_0x5be5('0x14')][_0x5be5('0x15')]===0x1f4){logger[_0x5be5('0x14')]('MailAccount,\x20%s,\x20%s',_0x2f2a4c,_0x3bfbde[_0x5be5('0x14')][_0x5be5('0x16')]);return _0x5d2492(_0x3bfbde[_0x5be5('0x14')][_0x5be5('0x16')]);}logger[_0x5be5('0x14')]('MailAccount,\x20%s,\x20%s',_0x2f2a4c,_0x3bfbde[_0x5be5('0x14')][_0x5be5('0x16')]);return _0x57d7ba(_0x3bfbde['error'][_0x5be5('0x16')]);}else{logger[_0x5be5('0xe')](_0x5be5('0xf'),_0x2f2a4c,'request\x20sent');_0x57d7ba(_0x3bfbde[_0x5be5('0x17')][_0x5be5('0x16')]);}})[_0x5be5('0x18')](function(_0x37f938){logger['error'](_0x5be5('0xf'),_0x2f2a4c,_0x37f938);_0x5d2492(_0x37f938);});});}function respondWithStatusCode(_0x3e567d,_0x4fab88){_0x4fab88=_0x4fab88||0xcc;return function(_0x376e13){if(_0x376e13){return _0x3e567d['sendStatus'](_0x4fab88);}return _0x3e567d[_0x5be5('0x19')](_0x4fab88)[_0x5be5('0x1a')]();};}function respondWithResult(_0xd4d3db,_0x1ccdf6){_0x1ccdf6=_0x1ccdf6||0xc8;return function(_0xf9feeb){if(_0xf9feeb){return _0xd4d3db['status'](_0x1ccdf6)[_0x5be5('0x1b')](_0xf9feeb);}};}function respondWithFilteredResult(_0x5d1217,_0x2518e6){return function(_0x521636){if(_0x521636){var _0x449bb9=typeof _0x2518e6[_0x5be5('0x1c')]===_0x5be5('0x1d')&&typeof _0x2518e6['limit']===_0x5be5('0x1d');var _0x53c89d=_0x521636[_0x5be5('0x1e')];var _0x3299e8=_0x449bb9?0x0:_0x2518e6[_0x5be5('0x1c')];var _0x5521a2=_0x449bb9?_0x521636[_0x5be5('0x1e')]:_0x2518e6[_0x5be5('0x1c')]+_0x2518e6[_0x5be5('0x1f')];var _0x597fa0;if(_0x5521a2>=_0x53c89d){_0x5521a2=_0x53c89d;_0x597fa0=0xc8;}else{_0x597fa0=0xce;}_0x5d1217[_0x5be5('0x19')](_0x597fa0);return _0x5d1217[_0x5be5('0x20')](_0x5be5('0x21'),_0x3299e8+'-'+_0x5521a2+'/'+_0x53c89d)['json'](_0x521636);}return null;};}function saveUpdates(_0x34d49e){return function(_0x4f0a6f){if(_0x4f0a6f){return _0x4f0a6f['update'](_0x34d49e)[_0x5be5('0x22')](function(_0x1cb474){return _0x1cb474;});}return null;};}function removeEntity(_0xaea4f6){return function(_0x1a3e79){if(_0x1a3e79){return _0x1a3e79[_0x5be5('0x23')]()['then'](function(){var _0x4c60c7=_0x1a3e79[_0x5be5('0x24')]({'plain':!![]});var _0x7983ff='MailAccounts';return db[_0x5be5('0x25')][_0x5be5('0x23')]({'where':{'type':_0x7983ff,'resourceId':_0x4c60c7['id']}})[_0x5be5('0x22')](function(){return _0x1a3e79;});})[_0x5be5('0x22')](function(){_0xaea4f6[_0x5be5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xff29d2){return function(_0x5782ac){if(!_0x5782ac){_0xff29d2[_0x5be5('0x26')](0x194);}return _0x5782ac;};}function handleError(_0x1b8b0b,_0x88e407){_0x88e407=_0x88e407||0x1f4;return function(_0x2639ea){logger[_0x5be5('0x14')](_0x2639ea[_0x5be5('0x27')]);if(_0x2639ea[_0x5be5('0x28')]){delete _0x2639ea[_0x5be5('0x28')];}_0x1b8b0b['status'](_0x88e407)[_0x5be5('0x29')](_0x2639ea);};}function getImapHost(_0x1eace7){switch(_0x1eace7){case _0x5be5('0x2a'):return _0x5be5('0x2b');case _0x5be5('0x2c'):return _0x5be5('0x2d');case _0x5be5('0x2e'):return _0x5be5('0x2f');case _0x5be5('0x30'):return'outlook.office365.com';}throw new Error(_0x5be5('0x31'),_0x1eace7);}function getSmtpHost(_0x50dea1){switch(_0x50dea1){case _0x5be5('0x2a'):return _0x5be5('0x32');case'yahoo':return'smtp.mail.yahoo.com';case _0x5be5('0x2e'):return'smtp-mail.outlook.com';case _0x5be5('0x30'):return _0x5be5('0x33');}throw new Error('Unknown\x20email\x20service\x20provider',_0x50dea1);}function getAuthenticationOptions(_0x3d1833,_0xa96ea2){var _0xf999fd={};var _0x4da786={};if(_0x3d1833){_0xf999fd[_0x5be5('0x34')]=_0x4da786[_0x5be5('0x34')]=_0xa96ea2[_0x5be5('0x35')];_0xf999fd[_0x5be5('0x36')]=_0x4da786['pass']=_0xa96ea2[_0x5be5('0x36')];if(_0xa96ea2[_0x5be5('0x37')]){_0xf999fd[_0x5be5('0x37')]=_0x4da786['modernAuthentication']=!![];_0xf999fd[_0x5be5('0x38')]=_0x4da786[_0x5be5('0x38')]=_0xa96ea2['CloudProviderId'];_0xf999fd[_0x5be5('0x36')]=_0x4da786['pass']=null;}else{_0xf999fd['CloudProviderId']=_0x4da786[_0x5be5('0x38')]=null;}_0xf999fd[_0x5be5('0x39')]=getImapHost(_0x3d1833);_0xf999fd[_0x5be5('0x3a')]=0x3e1;_0x4da786[_0x5be5('0x39')]=getSmtpHost(_0x3d1833);_0x4da786[_0x5be5('0x3a')]=0x24b;_0x4da786[_0x5be5('0x3b')]=![];_0xf999fd[_0x5be5('0x3c')]=_0x4da786['service']=null;}else{if(_0xa96ea2[_0x5be5('0x3d')]){_0xf999fd[_0x5be5('0x34')]=_0x4da786['user']=_0xa96ea2[_0x5be5('0x35')];_0xf999fd['password']=_0x4da786[_0x5be5('0x3e')]=_0xa96ea2[_0x5be5('0x36')];}else{_0xf999fd[_0x5be5('0x3d')]=_0x4da786[_0x5be5('0x3d')]=![];_0xf999fd[_0x5be5('0x34')]=_0x4da786[_0x5be5('0x34')]=null;_0xf999fd[_0x5be5('0x36')]=_0x4da786[_0x5be5('0x3e')]=null;}_0xf999fd[_0x5be5('0x39')]=_0xa96ea2[_0x5be5('0x3f')][_0x5be5('0x39')];_0xf999fd[_0x5be5('0x3a')]=_0xa96ea2['Imap'][_0x5be5('0x3a')];_0x4da786['host']=_0xa96ea2[_0x5be5('0x40')]['host'];_0x4da786[_0x5be5('0x3a')]=_0xa96ea2[_0x5be5('0x40')][_0x5be5('0x3a')];}return{'Imap':_0xf999fd,'Smtp':_0x4da786};}exports[_0x5be5('0x41')]=function(_0x4f6614,_0x25cda6){var _0x4624fc={'include':[{'model':db[_0x5be5('0x42')],'as':'Imap'},{'model':db[_0x5be5('0x43')],'as':_0x5be5('0x40')},{'model':db['Pause'],'as':_0x5be5('0x44')}]},_0x93013={},_0x2a128e={'count':0x0,'rows':[]};var _0x85c57=_[_0x5be5('0x45')](db[_0x5be5('0x46')]['rawAttributes'],function(_0x3d67a5){return{'name':_0x3d67a5['fieldName'],'type':_0x3d67a5[_0x5be5('0x47')][_0x5be5('0x48')]};});_0x93013[_0x5be5('0x49')]=_[_0x5be5('0x45')](_0x85c57,'name');_0x93013[_0x5be5('0x4a')]=_['keys'](_0x4f6614[_0x5be5('0x4a')]);_0x93013[_0x5be5('0x4b')]=_[_0x5be5('0x4c')](_0x93013[_0x5be5('0x49')],_0x93013[_0x5be5('0x4a')]);_0x4624fc[_0x5be5('0x4d')]=_['intersection'](_0x93013[_0x5be5('0x49')],qs[_0x5be5('0x4e')](_0x4f6614['query']['fields']));_0x4624fc[_0x5be5('0x4d')]=_0x4624fc[_0x5be5('0x4d')][_0x5be5('0x4f')]?_0x4624fc[_0x5be5('0x4d')]:_0x93013[_0x5be5('0x49')];if(!_0x4f6614[_0x5be5('0x4a')]['hasOwnProperty'](_0x5be5('0x50'))){_0x4624fc['limit']=qs[_0x5be5('0x1f')](_0x4f6614['query']['limit']);_0x4624fc[_0x5be5('0x1c')]=qs[_0x5be5('0x1c')](_0x4f6614[_0x5be5('0x4a')]['offset']);}_0x4624fc[_0x5be5('0x51')]=qs[_0x5be5('0x52')](_0x4f6614[_0x5be5('0x4a')][_0x5be5('0x52')]);_0x4624fc[_0x5be5('0x53')]=qs[_0x5be5('0x4b')](_[_0x5be5('0x54')](_0x4f6614[_0x5be5('0x4a')],_0x93013['filters']),_0x85c57);if(_0x4f6614[_0x5be5('0x4a')][_0x5be5('0x55')]){_0x4624fc[_0x5be5('0x53')]=_[_0x5be5('0x56')](_0x4624fc[_0x5be5('0x53')],{'$or':_[_0x5be5('0x45')](_0x85c57,function(_0x4dd81f){if(_0x4dd81f[_0x5be5('0x47')]!=='VIRTUAL'){var _0x2411f8={};_0x2411f8[_0x4dd81f[_0x5be5('0x28')]]={'$like':'%'+_0x4f6614[_0x5be5('0x4a')][_0x5be5('0x55')]+'%'};return _0x2411f8;}})});}_0x4624fc=_[_0x5be5('0x56')]({},_0x4624fc,_0x4f6614[_0x5be5('0x57')]);var _0x58ebe1={'where':_0x4624fc[_0x5be5('0x53')]};return db[_0x5be5('0x46')]['count'](_0x58ebe1)[_0x5be5('0x22')](function(_0x136c4c){_0x2a128e[_0x5be5('0x1e')]=_0x136c4c;if(_0x4f6614[_0x5be5('0x4a')][_0x5be5('0x58')]){_0x4624fc['include']=[{'all':!![]}];}return db['MailAccount'][_0x5be5('0x59')](_0x4624fc);})[_0x5be5('0x22')](function(_0x245a97){_0x2a128e[_0x5be5('0x5a')]=_0x245a97;return _0x2a128e;})[_0x5be5('0x22')](respondWithFilteredResult(_0x25cda6,_0x4624fc))[_0x5be5('0x18')](handleError(_0x25cda6,null));};exports[_0x5be5('0x5b')]=function(_0x34fa42,_0x833ad0){var _0x545f49={'raw':![],'where':{'id':_0x34fa42[_0x5be5('0x5c')]['id']},'include':[{'model':db[_0x5be5('0x42')],'as':_0x5be5('0x3f')},{'model':db[_0x5be5('0x43')],'as':'Smtp'},{'model':db['Pause'],'as':_0x5be5('0x44')}]},_0x391e56={};_0x391e56[_0x5be5('0x49')]=_[_0x5be5('0x5d')](db[_0x5be5('0x46')][_0x5be5('0x5e')]);_0x391e56['query']=_[_0x5be5('0x5d')](_0x34fa42['query']);_0x391e56[_0x5be5('0x4b')]=_[_0x5be5('0x4c')](_0x391e56[_0x5be5('0x49')],_0x391e56[_0x5be5('0x4a')]);_0x545f49[_0x5be5('0x4d')]=_['intersection'](_0x391e56[_0x5be5('0x49')],qs[_0x5be5('0x4e')](_0x34fa42['query'][_0x5be5('0x4e')]));_0x545f49[_0x5be5('0x4d')]=_0x545f49[_0x5be5('0x4d')][_0x5be5('0x4f')]?_0x545f49[_0x5be5('0x4d')]:_0x391e56[_0x5be5('0x49')];if(_0x34fa42[_0x5be5('0x4a')][_0x5be5('0x58')]){_0x545f49['include']=[{'all':!![]}];}_0x545f49=_[_0x5be5('0x56')]({},_0x545f49,_0x34fa42[_0x5be5('0x57')]);return db[_0x5be5('0x46')][_0x5be5('0x5f')](_0x545f49)[_0x5be5('0x22')](handleEntityNotFound(_0x833ad0,null))['then'](respondWithResult(_0x833ad0,null))[_0x5be5('0x18')](handleError(_0x833ad0,null));};exports[_0x5be5('0x60')]=function(_0x276d2a,_0x217300){if(_0x276d2a[_0x5be5('0x61')]['id']){delete _0x276d2a[_0x5be5('0x61')]['id'];}var _0x16efee=_0x276d2a[_0x5be5('0x61')][_0x5be5('0x62')]==='custom'?null:_0x276d2a[_0x5be5('0x61')][_0x5be5('0x62')];var _0x4cb403=_0x276d2a[_0x5be5('0x61')][_0x5be5('0x3f')]||{};var _0x456923=_0x276d2a[_0x5be5('0x61')][_0x5be5('0x40')]||{};if(_0x16efee){_0x4cb403[_0x5be5('0x39')]=getImapHost(_0x16efee);_0x4cb403[_0x5be5('0x3a')]=0x3e1;_0x456923[_0x5be5('0x39')]=getSmtpHost(_0x16efee);_0x456923[_0x5be5('0x3a')]=0x24b;_0x456923[_0x5be5('0x3b')]=![];}if(_0x456923[_0x5be5('0x37')]){_0x456923[_0x5be5('0x3b')]=![];}else{_0x456923[_0x5be5('0x38')]=null;}if(!_0x4cb403[_0x5be5('0x37')])_0x4cb403[_0x5be5('0x38')]=null;_0x276d2a['body'][_0x5be5('0x3f')]=_0x4cb403;_0x276d2a[_0x5be5('0x61')][_0x5be5('0x40')]=_0x456923;return db[_0x5be5('0x46')][_0x5be5('0x5f')]({'where':{'id':_0x276d2a[_0x5be5('0x5c')]['id']},'include':[{'model':db[_0x5be5('0x42')],'as':_0x5be5('0x3f')},{'model':db[_0x5be5('0x43')],'as':'Smtp'},{'model':db[_0x5be5('0x63')],'as':_0x5be5('0x44')}]})[_0x5be5('0x22')](handleEntityNotFound(_0x217300,null))[_0x5be5('0x22')](function(_0x558475){if(!_0x558475)throw new Error(_0x5be5('0x64'));if(_0x558475[_0x5be5('0x3c')])delete _0x276d2a[_0x5be5('0x61')][_0x5be5('0x3f')];return _0x558475;})['then'](saveUpdates(_0x276d2a[_0x5be5('0x61')],null))[_0x5be5('0x22')](function(_0x43dd14){if(!_0x276d2a[_0x5be5('0x61')]['Imap'])return _0x43dd14;return db[_0x5be5('0x42')][_0x5be5('0x60')](_0x276d2a['body']['Imap'],{'where':{'MailAccountId':_0x43dd14['id']}})[_0x5be5('0x22')](function(){return _0x43dd14;});})['then'](function(_0x3f52a2){if(!_0x276d2a[_0x5be5('0x61')]['Smtp'])return _0x3f52a2;return db[_0x5be5('0x43')]['update'](_0x276d2a[_0x5be5('0x61')][_0x5be5('0x40')],{'where':{'MailAccountId':_0x3f52a2['id']}})[_0x5be5('0x22')](function(){return _0x3f52a2;});})[_0x5be5('0x22')](respondWithResult(_0x217300,null))[_0x5be5('0x18')](handleError(_0x217300,null));};exports[_0x5be5('0x65')]=function(_0x3ba46b,_0x544f45){return db[_0x5be5('0x46')][_0x5be5('0x65')]()[_0x5be5('0x22')](respondWithResult(_0x544f45,null))[_0x5be5('0x18')](handleError(_0x544f45,null));};exports[_0x5be5('0x66')]=function(_0x30aa3a,_0x46b3e0){if(_0x30aa3a['body']['id']){delete _0x30aa3a[_0x5be5('0x61')]['id'];}return db[_0x5be5('0x46')][_0x5be5('0x5f')]({'where':{'id':_0x30aa3a[_0x5be5('0x5c')]['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x46b3e0,null))[_0x5be5('0x22')](function(_0x38faab){if(_0x38faab){_0x30aa3a['body'][_0x5be5('0x67')]=_0x38faab['id'];return db['Disposition'][_0x5be5('0x68')](_0x30aa3a['body']);}})[_0x5be5('0x22')](respondWithResult(_0x46b3e0,null))[_0x5be5('0x18')](handleError(_0x46b3e0,null));};exports[_0x5be5('0x69')]=function(_0x4dd43b,_0x30edcd){var _0x5276aa={'raw':![],'where':{}};var _0x113d4f={};var _0x2b60b8={'count':0x0,'rows':[]};return db[_0x5be5('0x46')]['findOne']({'where':{'id':_0x4dd43b[_0x5be5('0x5c')]['id']}})['then'](handleEntityNotFound(_0x30edcd,null))[_0x5be5('0x22')](function(_0x14c7b8){if(_0x14c7b8){_0x113d4f[_0x5be5('0x49')]=_['keys'](db[_0x5be5('0x6a')]['rawAttributes']);_0x113d4f[_0x5be5('0x4a')]=_[_0x5be5('0x5d')](_0x4dd43b[_0x5be5('0x4a')]);_0x113d4f['filters']=_['intersection'](_0x113d4f[_0x5be5('0x49')],_0x113d4f[_0x5be5('0x4a')]);_0x5276aa[_0x5be5('0x4d')]=_[_0x5be5('0x4c')](_0x113d4f[_0x5be5('0x49')],qs[_0x5be5('0x4e')](_0x4dd43b['query']['fields']));_0x5276aa['attributes']=_0x5276aa[_0x5be5('0x4d')][_0x5be5('0x4f')]?_0x5276aa[_0x5be5('0x4d')]:_0x113d4f[_0x5be5('0x49')];if(!_0x4dd43b['query'][_0x5be5('0x6b')](_0x5be5('0x50'))){_0x5276aa[_0x5be5('0x1f')]=qs[_0x5be5('0x1f')](_0x4dd43b['query']['limit']);_0x5276aa[_0x5be5('0x1c')]=qs[_0x5be5('0x1c')](_0x4dd43b[_0x5be5('0x4a')][_0x5be5('0x1c')]);}_0x5276aa[_0x5be5('0x51')]=qs[_0x5be5('0x52')](_0x4dd43b[_0x5be5('0x4a')]['sort']);_0x5276aa[_0x5be5('0x53')]=qs['filters'](_['pick'](_0x4dd43b[_0x5be5('0x4a')],_0x113d4f[_0x5be5('0x4b')]));_0x5276aa[_0x5be5('0x53')][_0x5be5('0x67')]=_0x14c7b8['id'];if(_0x4dd43b[_0x5be5('0x4a')][_0x5be5('0x55')]){_0x5276aa['where']=_[_0x5be5('0x56')](_0x5276aa[_0x5be5('0x53')],{'$or':_[_0x5be5('0x45')](_0x5276aa[_0x5be5('0x4d')],function(_0x4b61f1){var _0x113bfc={};_0x113bfc[_0x4b61f1]={'$like':'%'+_0x4dd43b[_0x5be5('0x4a')]['filter']+'%'};return _0x113bfc;})});}_0x5276aa=_[_0x5be5('0x56')]({},_0x5276aa,_0x4dd43b['options']);return db[_0x5be5('0x6a')][_0x5be5('0x1e')]({'where':_0x5276aa[_0x5be5('0x53')]})['then'](function(_0x2f2e18){_0x2b60b8[_0x5be5('0x1e')]=_0x2f2e18;if(_0x4dd43b['query'][_0x5be5('0x58')]){_0x5276aa['include']=[{'all':!![]}];}return db[_0x5be5('0x6a')]['findAll'](_0x5276aa);})[_0x5be5('0x22')](function(_0x136378){_0x2b60b8[_0x5be5('0x5a')]=_0x136378;return _0x2b60b8;});}})['then'](respondWithFilteredResult(_0x30edcd,_0x5276aa))[_0x5be5('0x18')](handleError(_0x30edcd,null));};exports['removeDispositions']=function(_0x37d0c4,_0x340593){return db['MailAccount'][_0x5be5('0x5f')]({'where':{'id':_0x37d0c4[_0x5be5('0x5c')]['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x340593,null))[_0x5be5('0x22')](function(_0x325acc){if(_0x325acc){return _0x325acc['removeDispositions'](_0x37d0c4['query'][_0x5be5('0x6c')]);}})[_0x5be5('0x22')](respondWithStatusCode(_0x340593,null))['catch'](handleError(_0x340593,null));};exports['addAnswer']=function(_0x2033d7,_0x1b969d){if(_0x2033d7['body']['id']){delete _0x2033d7[_0x5be5('0x61')]['id'];}return db['MailAccount'][_0x5be5('0x5f')]({'where':{'id':_0x2033d7[_0x5be5('0x5c')]['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x1b969d,null))[_0x5be5('0x22')](function(_0x75bcee){if(_0x75bcee){_0x2033d7[_0x5be5('0x61')][_0x5be5('0x67')]=_0x75bcee['id'];return db[_0x5be5('0x6d')][_0x5be5('0x68')](_0x2033d7['body']);}})['then'](respondWithResult(_0x1b969d,null))[_0x5be5('0x18')](handleError(_0x1b969d,null));};exports[_0x5be5('0x6e')]=function(_0x886c28,_0x293dd7){var _0x524774={'raw':![],'where':{}};var _0x67f0c4={};var _0x30cf18={'count':0x0,'rows':[]};return db[_0x5be5('0x46')][_0x5be5('0x6f')]({'where':{'id':_0x886c28['params']['id']}})['then'](handleEntityNotFound(_0x293dd7,null))[_0x5be5('0x22')](function(_0x2b420f){if(_0x2b420f){_0x67f0c4['model']=_[_0x5be5('0x5d')](db['CannedAnswer'][_0x5be5('0x5e')]);_0x67f0c4[_0x5be5('0x4a')]=_['keys'](_0x886c28[_0x5be5('0x4a')]);_0x67f0c4[_0x5be5('0x4b')]=_['intersection'](_0x67f0c4[_0x5be5('0x49')],_0x67f0c4[_0x5be5('0x4a')]);_0x524774[_0x5be5('0x4d')]=_[_0x5be5('0x4c')](_0x67f0c4[_0x5be5('0x49')],qs[_0x5be5('0x4e')](_0x886c28[_0x5be5('0x4a')][_0x5be5('0x4e')]));_0x524774[_0x5be5('0x4d')]=_0x524774[_0x5be5('0x4d')][_0x5be5('0x4f')]?_0x524774[_0x5be5('0x4d')]:_0x67f0c4[_0x5be5('0x49')];if(!_0x886c28['query'][_0x5be5('0x6b')](_0x5be5('0x50'))){_0x524774[_0x5be5('0x1f')]=qs[_0x5be5('0x1f')](_0x886c28[_0x5be5('0x4a')][_0x5be5('0x1f')]);_0x524774[_0x5be5('0x1c')]=qs[_0x5be5('0x1c')](_0x886c28[_0x5be5('0x4a')]['offset']);}_0x524774[_0x5be5('0x51')]=qs[_0x5be5('0x52')](_0x886c28[_0x5be5('0x4a')][_0x5be5('0x52')]);_0x524774['where']=qs['filters'](_[_0x5be5('0x54')](_0x886c28['query'],_0x67f0c4[_0x5be5('0x4b')]));_0x524774['where'][_0x5be5('0x67')]=_0x2b420f['id'];if(_0x886c28[_0x5be5('0x4a')][_0x5be5('0x55')]){_0x524774[_0x5be5('0x53')]=_[_0x5be5('0x56')](_0x524774['where'],{'$or':_[_0x5be5('0x45')](_0x524774[_0x5be5('0x4d')],function(_0x1a69bb){var _0x534a61={};_0x534a61[_0x1a69bb]={'$like':'%'+_0x886c28[_0x5be5('0x4a')]['filter']+'%'};return _0x534a61;})});}_0x524774=_[_0x5be5('0x56')]({},_0x524774,_0x886c28[_0x5be5('0x57')]);return db[_0x5be5('0x6d')][_0x5be5('0x1e')]({'where':_0x524774[_0x5be5('0x53')]})[_0x5be5('0x22')](function(_0x44de4a){_0x30cf18['count']=_0x44de4a;if(_0x886c28[_0x5be5('0x4a')][_0x5be5('0x58')]){_0x524774[_0x5be5('0x70')]=[{'all':!![]}];}return db[_0x5be5('0x6d')]['findAll'](_0x524774);})[_0x5be5('0x22')](function(_0x2461b5){_0x30cf18[_0x5be5('0x5a')]=_0x2461b5;return _0x30cf18;});}})[_0x5be5('0x22')](respondWithFilteredResult(_0x293dd7,_0x524774))[_0x5be5('0x18')](handleError(_0x293dd7,null));};exports[_0x5be5('0x71')]=function(_0x2701ac,_0x5101e3){return db['MailAccount'][_0x5be5('0x5f')]({'where':{'id':_0x2701ac[_0x5be5('0x5c')]['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x5101e3,null))['then'](function(_0x212c37){if(_0x212c37){return _0x212c37[_0x5be5('0x71')](_0x2701ac['query'][_0x5be5('0x6c')]);}})[_0x5be5('0x22')](respondWithStatusCode(_0x5101e3,null))[_0x5be5('0x18')](handleError(_0x5101e3,null));};exports['create']=function(_0x141c22,_0x183d17){var _0x2245cb={'name':_0x141c22[_0x5be5('0x61')]['name'],'key':_0x141c22['body'][_0x5be5('0x48')],'provider':_0x141c22[_0x5be5('0x61')]['provider']===_0x5be5('0x72')?null:_0x141c22[_0x5be5('0x61')][_0x5be5('0x62')],'email':_0x141c22[_0x5be5('0x61')][_0x5be5('0x73')],'ListId':_0x141c22['body'][_0x5be5('0x74')],'active':!_[_0x5be5('0x75')](_0x141c22[_0x5be5('0x61')][_0x5be5('0x76')])?_0x141c22[_0x5be5('0x61')][_0x5be5('0x76')]:!![],'description':_0x141c22['body'][_0x5be5('0x77')]||null};var _0x529eae=getAuthenticationOptions(_0x2245cb[_0x5be5('0x62')],_0x141c22[_0x5be5('0x61')]);_0x2245cb[_0x5be5('0x3f')]=_0x529eae[_0x5be5('0x3f')];_0x2245cb[_0x5be5('0x40')]=_0x529eae[_0x5be5('0x40')];return db[_0x5be5('0x46')][_0x5be5('0x68')](_0x2245cb,{'include':[{'model':db[_0x5be5('0x43')],'as':_0x5be5('0x40')},{'model':db[_0x5be5('0x42')],'as':_0x5be5('0x3f')}]})[_0x5be5('0x22')](function(_0x3b404c){var _0x718b9a=_0x141c22[_0x5be5('0x34')][_0x5be5('0x24')]({'plain':!![]});if(!_0x718b9a)throw new Error(_0x5be5('0x78'));if(_0x718b9a[_0x5be5('0x79')]===_0x5be5('0x34')){var _0x343c56=_0x3b404c[_0x5be5('0x24')]({'plain':!![]});return db[_0x5be5('0x7a')][_0x5be5('0x5f')]({'where':{'name':_0x5be5('0x7b'),'userProfileId':_0x718b9a['userProfileId']},'raw':!![]})[_0x5be5('0x22')](function(_0x10d356){if(_0x10d356&&_0x10d356[_0x5be5('0x7c')]===0x0){return db[_0x5be5('0x25')][_0x5be5('0x68')]({'name':_0x343c56[_0x5be5('0x28')],'resourceId':_0x343c56['id'],'type':_0x10d356['name'],'sectionId':_0x10d356['id']},{})[_0x5be5('0x22')](function(){return _0x3b404c;});}else{return _0x3b404c;}})[_0x5be5('0x18')](function(_0x33230a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33230a);throw _0x33230a;});}return _0x3b404c;})[_0x5be5('0x22')](respondWithResult(_0x183d17,0xc9))['catch'](handleError(_0x183d17,null));};exports[_0x5be5('0x7d')]=function(_0x44af66,_0x4b5fd2){return db['MailAccount'][_0x5be5('0x6f')]({'where':{'id':_0x44af66[_0x5be5('0x5c')]['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x4b5fd2,null))['then'](function(_0xa63742){if(_0xa63742){return _0xa63742[_0x5be5('0x7d')]();}return null;})[_0x5be5('0x22')](respondWithResult(_0x4b5fd2,null))['catch'](handleError(_0x4b5fd2,null));};exports[_0x5be5('0x7e')]=function(_0x30fae8,_0x2c95e4){if(_0x30fae8['body']['id']){delete _0x30fae8['body']['id'];}return db[_0x5be5('0x46')][_0x5be5('0x5f')]({'where':{'id':_0x30fae8['params']['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x2c95e4,null))['then'](function(_0x2538f5){if(_0x2538f5){_0x30fae8[_0x5be5('0x61')]['MailAccountId']=_0x2538f5['id'];return db[_0x5be5('0x42')][_0x5be5('0x68')](_0x30fae8[_0x5be5('0x61')]);}})[_0x5be5('0x22')](respondWithResult(_0x2c95e4,null))[_0x5be5('0x18')](handleError(_0x2c95e4,null));};exports[_0x5be5('0x7f')]=function(_0x564562,_0x2c9d34){return db['MailAccount'][_0x5be5('0x6f')]({'where':{'id':_0x564562[_0x5be5('0x5c')]['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x2c9d34,null))[_0x5be5('0x22')](function(_0x5934e9){if(_0x5934e9){return _0x5934e9[_0x5be5('0x80')](null);}return null;})[_0x5be5('0x22')](respondWithStatusCode(_0x2c9d34,null))[_0x5be5('0x18')](handleError(_0x2c9d34,null));};exports[_0x5be5('0x81')]=function(_0x21e863,_0x24d4b0){return db[_0x5be5('0x46')][_0x5be5('0x6f')]({'where':{'id':_0x21e863[_0x5be5('0x5c')]['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x24d4b0,null))[_0x5be5('0x22')](function(_0x4a0ff2){if(_0x4a0ff2){return _0x4a0ff2[_0x5be5('0x81')]();}return null;})[_0x5be5('0x22')](respondWithResult(_0x24d4b0,null))[_0x5be5('0x18')](handleError(_0x24d4b0,null));};exports[_0x5be5('0x82')]=function(_0x1e7104,_0x36b373){if(_0x1e7104[_0x5be5('0x61')]['id']){delete _0x1e7104[_0x5be5('0x61')]['id'];}return db[_0x5be5('0x46')][_0x5be5('0x5f')]({'where':{'id':_0x1e7104[_0x5be5('0x5c')]['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x36b373,null))[_0x5be5('0x22')](function(_0x443b8a){if(_0x443b8a){_0x1e7104[_0x5be5('0x61')][_0x5be5('0x67')]=_0x443b8a['id'];return db[_0x5be5('0x43')][_0x5be5('0x68')](_0x1e7104['body']);}})['then'](respondWithResult(_0x36b373,null))[_0x5be5('0x18')](handleError(_0x36b373,null));};exports[_0x5be5('0x83')]=function(_0x13828f,_0x3fff88){return db[_0x5be5('0x46')][_0x5be5('0x6f')]({'where':{'id':_0x13828f[_0x5be5('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3fff88,null))[_0x5be5('0x22')](function(_0xebeb8a){if(_0xebeb8a){return _0xebeb8a[_0x5be5('0x84')](null);}return null;})[_0x5be5('0x22')](respondWithStatusCode(_0x3fff88,null))[_0x5be5('0x18')](handleError(_0x3fff88,null));};exports['addInteraction']=function(_0x5eacbb,_0x5d9dbd){return db['MailInteraction']['find']({'where':{'id':_0x5eacbb[_0x5be5('0x5c')]['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x5d9dbd,null))[_0x5be5('0x22')](function(_0x30883b){if(_0x30883b){return _0x30883b[_0x5be5('0x85')](_0x5eacbb[_0x5be5('0x61')][_0x5be5('0x6c')],_['omit'](_0x5eacbb[_0x5be5('0x61')],[_0x5be5('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x5d9dbd,null))[_0x5be5('0x18')](handleError(_0x5d9dbd,null));};exports[_0x5be5('0x86')]=function(_0x527ad5,_0x30302e){var _0x5967ef={'raw':![],'where':{}};var _0x3805af={};var _0x3f10e2={'count':0x0,'rows':[]};return db[_0x5be5('0x46')][_0x5be5('0x6f')]({'where':{'id':_0x527ad5[_0x5be5('0x5c')]['id']}})['then'](handleEntityNotFound(_0x30302e,null))[_0x5be5('0x22')](function(_0x1924e8){if(_0x1924e8){_0x3805af[_0x5be5('0x49')]=_['keys'](db[_0x5be5('0x87')][_0x5be5('0x5e')]);_0x3805af[_0x5be5('0x4a')]=_[_0x5be5('0x5d')](_0x527ad5['query']);_0x3805af['filters']=_['intersection'](_0x3805af[_0x5be5('0x49')],_0x3805af[_0x5be5('0x4a')]);_0x5967ef['attributes']=_[_0x5be5('0x4c')](_0x3805af[_0x5be5('0x49')],qs['fields'](_0x527ad5[_0x5be5('0x4a')][_0x5be5('0x4e')]));_0x5967ef[_0x5be5('0x4d')]=_0x5967ef[_0x5be5('0x4d')]['length']?_0x5967ef[_0x5be5('0x4d')]:_0x3805af[_0x5be5('0x49')];if(!_0x527ad5[_0x5be5('0x4a')]['hasOwnProperty'](_0x5be5('0x50'))){_0x5967ef[_0x5be5('0x1f')]=qs[_0x5be5('0x1f')](_0x527ad5[_0x5be5('0x4a')]['limit']);_0x5967ef[_0x5be5('0x1c')]=qs[_0x5be5('0x1c')](_0x527ad5['query'][_0x5be5('0x1c')]);}_0x5967ef[_0x5be5('0x51')]=qs[_0x5be5('0x52')](_0x527ad5['query']['sort']);_0x5967ef[_0x5be5('0x53')]=qs[_0x5be5('0x4b')](_[_0x5be5('0x54')](_0x527ad5[_0x5be5('0x4a')],_0x3805af['filters']));_0x5967ef[_0x5be5('0x53')][_0x5be5('0x67')]=_0x1924e8['id'];if(_0x527ad5[_0x5be5('0x4a')][_0x5be5('0x55')]){_0x5967ef[_0x5be5('0x53')]=_['merge'](_0x5967ef[_0x5be5('0x53')],{'$or':_[_0x5be5('0x45')](_0x5967ef[_0x5be5('0x4d')],function(_0x508ef9){var _0x2f6ded={};_0x2f6ded[_0x508ef9]={'$like':'%'+_0x527ad5['query']['filter']+'%'};return _0x2f6ded;})});}_0x5967ef=_[_0x5be5('0x56')]({},_0x5967ef,_0x527ad5[_0x5be5('0x57')]);return db[_0x5be5('0x87')][_0x5be5('0x1e')]({'where':_0x5967ef[_0x5be5('0x53')]})[_0x5be5('0x22')](function(_0x4606e9){_0x3f10e2[_0x5be5('0x1e')]=_0x4606e9;if(_0x527ad5['query'][_0x5be5('0x58')]){_0x5967ef[_0x5be5('0x70')]=[{'model':db[_0x5be5('0x88')],'as':'Contact','required':![]},{'model':db[_0x5be5('0x89')],'as':'Owner','attributes':['name',_0x5be5('0x8a'),_0x5be5('0x8b')],'required':![]},{'model':db[_0x5be5('0x8c')],'as':_0x5be5('0x8d'),'attributes':['id','name',_0x5be5('0x8e')],'where':_0x527ad5[_0x5be5('0x4a')][_0x5be5('0x8f')]?{'id':_0x527ad5[_0x5be5('0x4a')][_0x5be5('0x8f')]}:undefined,'required':_0x527ad5[_0x5be5('0x4a')][_0x5be5('0x8f')]?!![]:![]}];}return db[_0x5be5('0x87')]['findAll'](_0x5967ef);})[_0x5be5('0x22')](function(_0x10dae8){_0x3f10e2[_0x5be5('0x5a')]=_0x10dae8;return _0x3f10e2;});}})[_0x5be5('0x22')](respondWithFilteredResult(_0x30302e,_0x5967ef))['catch'](handleError(_0x30302e,null));};exports[_0x5be5('0x90')]=function addApplications(_0x55c039,_0x3f7699){var _0xcf4245=_0x55c039[_0x5be5('0x5c')]['id'];var _0x4fc7dc=_0x55c039[_0x5be5('0x61')];var _0x3b7130=0xc8;var _0x29e446=null;return db[_0x5be5('0x91')]['transaction']({'isolationLevel':db[_0x5be5('0x91')][_0x5be5('0x92')][_0x5be5('0x93')][_0x5be5('0x94')]},function(_0x5b8225){return db[_0x5be5('0x46')]['findOne']({'where':{'id':_0xcf4245},'transaction':_0x5b8225})[_0x5be5('0x22')](function(_0x539acb){if(_0x539acb){return db[_0x5be5('0x95')][_0x5be5('0x23')]({'where':{'MailAccountId':_0xcf4245},'transaction':_0x5b8225})['then'](function(){var _0x543744=_[_0x5be5('0x45')](_0x4fc7dc,function(_0x38be64){_0x38be64['MailAccountId']=_0xcf4245;return _0x38be64;});return db[_0x5be5('0x95')][_0x5be5('0x96')](_0x543744,{'transaction':_0x5b8225});});}else{_0x3b7130=0x194;_0x29e446=[];}});})[_0x5be5('0x22')](function(){if(_0x3b7130!==0x194){return db['MailApplication'][_0x5be5('0x97')]({'where':{'MailAccountId':_0xcf4245},'order':_0x5be5('0x98')})[_0x5be5('0x22')](function(_0x2a5e1d){_0x29e446=_0x2a5e1d;});}})['catch'](function(_0x4e9a41){_0x3b7130=0x1f4;logger[_0x5be5('0x14')](_0x4e9a41[_0x5be5('0x27')]);if(_0x4e9a41['name']){delete _0x4e9a41['name'];}_0x29e446=_0x4e9a41;})[_0x5be5('0x99')](function(){if(_0x29e446===null){_0x3f7699[_0x5be5('0x26')](_0x3b7130);}else{if(_0x3b7130===0x1f4){_0x3f7699[_0x5be5('0x19')](_0x3b7130)['send'](_0x29e446);}else{_0x3f7699[_0x5be5('0x19')](_0x3b7130)[_0x5be5('0x1b')](_0x29e446);}}});};exports['getApplications']=function(_0x5968aa,_0x1499fa){var _0x52cb9b={};var _0x766cb={};var _0x4b25e1;var _0x41107b;return db[_0x5be5('0x46')][_0x5be5('0x6f')]({'where':{'id':_0x5968aa[_0x5be5('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1499fa,null))['then'](function(_0x18bae0){if(_0x18bae0){_0x4b25e1=_0x18bae0;_0x766cb[_0x5be5('0x49')]=_[_0x5be5('0x5d')](db[_0x5be5('0x95')][_0x5be5('0x5e')]);_0x766cb[_0x5be5('0x4a')]=_[_0x5be5('0x5d')](_0x5968aa['query']);_0x766cb[_0x5be5('0x4b')]=_[_0x5be5('0x4c')](_0x766cb['model'],_0x766cb[_0x5be5('0x4a')]);_0x52cb9b[_0x5be5('0x4d')]=_[_0x5be5('0x4c')](_0x766cb[_0x5be5('0x49')],qs[_0x5be5('0x4e')](_0x5968aa[_0x5be5('0x4a')][_0x5be5('0x4e')]));_0x52cb9b[_0x5be5('0x4d')]=_0x52cb9b[_0x5be5('0x4d')][_0x5be5('0x4f')]?_0x52cb9b['attributes']:_0x766cb[_0x5be5('0x49')];_0x52cb9b[_0x5be5('0x51')]=qs[_0x5be5('0x52')](_0x5968aa[_0x5be5('0x4a')][_0x5be5('0x52')]);_0x52cb9b[_0x5be5('0x53')]=qs[_0x5be5('0x4b')](_[_0x5be5('0x54')](_0x5968aa[_0x5be5('0x4a')],_0x766cb['filters']));if(_0x5968aa['query'][_0x5be5('0x55')]){_0x52cb9b[_0x5be5('0x53')]=_[_0x5be5('0x56')](_0x52cb9b[_0x5be5('0x53')],{'$or':_[_0x5be5('0x45')](_0x52cb9b[_0x5be5('0x4d')],function(_0x34ea21){var _0x2c23a9={};_0x2c23a9[_0x34ea21]={'$like':'%'+_0x5968aa[_0x5be5('0x4a')]['filter']+'%'};return _0x2c23a9;})});}_0x52cb9b=_[_0x5be5('0x56')]({},_0x52cb9b,_0x5968aa[_0x5be5('0x57')]);return _0x4b25e1[_0x5be5('0x9a')](_0x52cb9b);}})['then'](function(_0x4f193f){if(_0x4f193f){_0x41107b=_0x4f193f[_0x5be5('0x4f')];if(!_0x5968aa[_0x5be5('0x4a')][_0x5be5('0x6b')]('nolimit')){_0x52cb9b[_0x5be5('0x1f')]=qs[_0x5be5('0x1f')](_0x5968aa[_0x5be5('0x4a')]['limit']);_0x52cb9b[_0x5be5('0x1c')]=qs[_0x5be5('0x1c')](_0x5968aa[_0x5be5('0x4a')][_0x5be5('0x1c')]);}return _0x4b25e1[_0x5be5('0x9a')](_0x52cb9b);}})[_0x5be5('0x22')](function(_0x450497){if(_0x450497){return _0x450497?{'count':_0x41107b,'rows':_0x450497}:null;}})[_0x5be5('0x22')](respondWithResult(_0x1499fa,null))[_0x5be5('0x18')](handleError(_0x1499fa,null));};exports[_0x5be5('0x9b')]=function(_0x44c4f6,_0x32ff68){var _0x526421={'raw':!![],'where':{}};var _0x56197e={};var _0x4be4fe={'count':0x0,'rows':[]};return db['MailAccount'][_0x5be5('0x6f')]({'where':{'id':_0x44c4f6[_0x5be5('0x5c')]['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x32ff68,null))[_0x5be5('0x22')](function(_0x311ebf){if(_0x311ebf){_0x56197e[_0x5be5('0x49')]=_[_0x5be5('0x5d')](db['MailMessage'][_0x5be5('0x5e')]);_0x56197e['query']=_[_0x5be5('0x5d')](_0x44c4f6['query']);_0x56197e[_0x5be5('0x4b')]=_[_0x5be5('0x4c')](_0x56197e['model'],_0x56197e[_0x5be5('0x4a')]);_0x526421[_0x5be5('0x4d')]=_[_0x5be5('0x4c')](_0x56197e[_0x5be5('0x49')],qs[_0x5be5('0x4e')](_0x44c4f6[_0x5be5('0x4a')][_0x5be5('0x4e')]));_0x526421[_0x5be5('0x4d')]=_0x526421[_0x5be5('0x4d')][_0x5be5('0x4f')]?_0x526421['attributes']:_0x56197e[_0x5be5('0x49')];if(!_0x44c4f6[_0x5be5('0x4a')][_0x5be5('0x6b')](_0x5be5('0x50'))){_0x526421[_0x5be5('0x1f')]=qs[_0x5be5('0x1f')](_0x44c4f6['query']['limit']);_0x526421['offset']=qs[_0x5be5('0x1c')](_0x44c4f6[_0x5be5('0x4a')]['offset']);}_0x526421[_0x5be5('0x51')]=qs['sort'](_0x44c4f6[_0x5be5('0x4a')][_0x5be5('0x52')]);_0x526421[_0x5be5('0x53')]=qs[_0x5be5('0x4b')](_[_0x5be5('0x54')](_0x44c4f6[_0x5be5('0x4a')],_0x56197e['filters']));_0x526421['where'][_0x5be5('0x67')]=_0x311ebf['id'];if(_0x44c4f6['query'][_0x5be5('0x55')]){_0x526421[_0x5be5('0x53')]=_['merge'](_0x526421[_0x5be5('0x53')],{'$or':_['map'](_0x526421[_0x5be5('0x4d')],function(_0x4d6d63){var _0x400b8e={};_0x400b8e[_0x4d6d63]={'$like':'%'+_0x44c4f6[_0x5be5('0x4a')]['filter']+'%'};return _0x400b8e;})});}if(_0x44c4f6['query'][_0x5be5('0x9c')]){var _0x426d70=_0x44c4f6[_0x5be5('0x4a')][_0x5be5('0x9c')][_0x5be5('0x9d')](',');var _0x30acb7={};_0x30acb7[_0x426d70[0x0]]={'$gte':moment(_0x426d70[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x526421[_0x5be5('0x53')]=_[_0x5be5('0x56')](_0x526421[_0x5be5('0x53')],_0x30acb7);}_0x526421=_[_0x5be5('0x56')]({},_0x526421,_0x44c4f6['options']);return db[_0x5be5('0x9e')][_0x5be5('0x1e')]({'where':_0x526421[_0x5be5('0x53')]})[_0x5be5('0x22')](function(_0xd87012){_0x4be4fe[_0x5be5('0x1e')]=_0xd87012;if(_0x44c4f6['query'][_0x5be5('0x58')]){_0x526421[_0x5be5('0x70')]=[{'all':!![]}];}return db[_0x5be5('0x9e')][_0x5be5('0x59')](_0x526421);})['then'](function(_0x1ec7e8){if(_0x44c4f6[_0x5be5('0x4a')][_0x5be5('0x9f')]===_0x5be5('0xa0')){for(var _0x39d510=0x0;_0x39d510<_0x1ec7e8[_0x5be5('0x4f')];_0x39d510++){_0x1ec7e8[_0x39d510][_0x5be5('0x61')]=juice(_0x1ec7e8[_0x39d510]['body']);}}_0x4be4fe[_0x5be5('0x5a')]=_0x1ec7e8;return _0x4be4fe;});}})[_0x5be5('0x22')](respondWithFilteredResult(_0x32ff68,_0x526421))[_0x5be5('0x18')](handleError(_0x32ff68,null));};exports[_0x5be5('0x29')]=function(_0x49ec41,_0x3ee42d){var _0x30dc48,_0x2eff60={},_0x3eca8a;if(_0x49ec41[_0x5be5('0x61')]['to']){_0x3eca8a=_0x49ec41['body']['to'][_0x5be5('0x9d')](',')[0x0];}return db[_0x5be5('0x46')][_0x5be5('0x5f')]({'where':{'id':_0x49ec41[_0x5be5('0x5c')]['id']},'include':[{'model':db[_0x5be5('0xa1')],'as':_0x5be5('0xa2'),'include':[{'model':db[_0x5be5('0x88')],'as':_0x5be5('0xa3'),'where':{'email':_0x3eca8a},'limit':0x1,'order':[['updatedAt',_0x5be5('0xa4')]]}]},{'model':db[_0x5be5('0x43')],'as':_0x5be5('0x40'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5be5('0xa5'),'raw':!![]}]}]})[_0x5be5('0x22')](handleEntityNotFound(_0x3ee42d,null))[_0x5be5('0x22')](function(_0x521662){if(!_0x521662)return;_0x30dc48=_0x521662;if(!_0x521662[_0x5be5('0x40')])throw new Error(_0x5be5('0xa6'));if(_['isNil'](_0x49ec41[_0x5be5('0x61')][_0x5be5('0xa7')])){_0x49ec41[_0x5be5('0x61')][_0x5be5('0xa7')]=util[_0x5be5('0xa8')](_0x5be5('0xa9'),_0x521662[_0x5be5('0x28')],_0x521662[_0x5be5('0x73')]||_0x521662[_0x5be5('0x40')][_0x5be5('0x34')]);}if(_0x49ec41[_0x5be5('0x61')][_0x5be5('0xaa')]&&_0x49ec41[_0x5be5('0x61')][_0x5be5('0xaa')]['length']){for(var _0x4d4893=0x0;_0x4d4893<_0x49ec41['body'][_0x5be5('0xaa')]['length'];_0x4d4893+=0x1){_0x49ec41[_0x5be5('0x61')][_0x5be5('0xaa')][_0x4d4893]={'filename':_0x49ec41['body'][_0x5be5('0xaa')][_0x4d4893][_0x5be5('0x28')],'path':path[_0x5be5('0xab')](config[_0x5be5('0xac')],_0x5be5('0xad'),_0x49ec41[_0x5be5('0x61')][_0x5be5('0xaa')][_0x4d4893][_0x5be5('0xae')])};}}var _0x31601f=_0x521662['getSmtpOptions']();return respondWithRpcPromise(_0x5be5('0xaf'),'sendMail',{'account':_0x31601f,'message':_0x49ec41['body']});})[_0x5be5('0x22')](function(_0x21f4c5){if(!_0x21f4c5)return;_0x2eff60=_0x21f4c5;if(!_0x30dc48[_0x5be5('0xa2')])throw new Error(_0x5be5('0xb0'));if(_0x30dc48[_0x5be5('0xa2')][_0x5be5('0xa3')][_0x5be5('0x4f')])return _0x30dc48['List'][_0x5be5('0xa3')][0x0];return db[_0x5be5('0x88')]['create'](_[_0x5be5('0x9')](_0x49ec41[_0x5be5('0x61')],{'firstName':_0x49ec41[_0x5be5('0x61')]['to'],'email':_0x49ec41['body']['to'],'phone':_0x49ec41[_0x5be5('0x61')]['to'],'ListId':_0x30dc48[_0x5be5('0x74')]}));})[_0x5be5('0x22')](function(_0x5cbc1a){if(!_0x5cbc1a)return;var _0x3aca0b={'UserId':_0x49ec41[_0x5be5('0x34')]['id'],'ContactId':_0x5cbc1a['id'],'MailAccountId':_0x30dc48['id'],'inReplyTo':_0x2eff60[_0x5be5('0xb1')],'to':_0x49ec41[_0x5be5('0x61')]['from'],'cc':_0x49ec41['body']['cc'],'subject':_0x49ec41[_0x5be5('0x61')][_0x5be5('0xb2')],'attach':_0x49ec41[_0x5be5('0x61')][_0x5be5('0xb3')],'firstMsgDirection':_0x5be5('0xb4'),'lastMsgAt':moment()[_0x5be5('0xa8')](_0x5be5('0xb5')),'lastMsgDirection':'out','Messages':[_['merge'](_0x49ec41[_0x5be5('0x61')],{'messageId':_0x2eff60[_0x5be5('0xb1')],'sentAt':moment()[_0x5be5('0xa8')](_0x5be5('0xb5')),'read':!![],'MailAccountId':_0x30dc48['id'],'UserId':_0x49ec41[_0x5be5('0x34')]['id'],'ContactId':_0x5cbc1a['id']})]};if(_0x49ec41['body'][_0x5be5('0xb6')]){_0x3aca0b=_[_0x5be5('0x56')](_0x3aca0b,_0x49ec41[_0x5be5('0x61')][_0x5be5('0xb6')]);}return db[_0x5be5('0x87')][_0x5be5('0x68')](_0x3aca0b,{'include':[{'model':db[_0x5be5('0x9e')],'as':_0x5be5('0xb7')}]});})['then'](respondWithResult(_0x3ee42d,null))['catch'](handleError(_0x3ee42d,null));};exports['verifySmtp']=function(_0x2d90fc,_0x238a64){return db[_0x5be5('0x46')]['find']({'where':{'id':_0x2d90fc[_0x5be5('0x5c')]['id']},'include':[{'model':db[_0x5be5('0x43')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x5be5('0xa5')],'as':_0x5be5('0xa5'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x238a64,null))[_0x5be5('0x22')](function(_0x402282){if(!_0x402282['Smtp'])return;var _0x252666=_0x402282[_0x5be5('0xb8')]();return respondWithRpcPromise(_0x5be5('0xb9'),_0x5be5('0xba'),{'account':_0x252666});})['then'](respondWithResult(_0x238a64,null))[_0x5be5('0x18')](handleError(_0x238a64,null));};exports['destroy']=function(_0x25c79f,_0x5583fe){return db[_0x5be5('0x46')]['find']({'where':{'id':_0x25c79f['params']['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x5583fe,null))[_0x5be5('0x22')](function(_0xec0c11){if(_0xec0c11&&_0xec0c11[_0x5be5('0x3c')]){throw new db['Sequelize']['ValidationError'](_0x5be5('0xbb'));}return _0xec0c11;})['then'](removeEntity(_0x5583fe,null))[_0x5be5('0x18')](handleError(_0x5583fe,null));};exports[_0x5be5('0xbc')]=function(_0x51e575,_0x43e592){return db['MailAccount'][_0x5be5('0x5f')]({'where':{'id':_0x51e575[_0x5be5('0x5c')]['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x43e592,null))[_0x5be5('0x22')](function(_0xfad01a){if(_0xfad01a){return _0xfad01a[_0x5be5('0xbc')](_0x51e575[_0x5be5('0x61')][_0x5be5('0x6c')],_[_0x5be5('0xbd')](_0x51e575[_0x5be5('0x61')],[_0x5be5('0x6c'),'id'])||{})[_0x5be5('0xbe')](function(_0x4026b8){for(var _0x39fcb6=0x0;_0x39fcb6<_0x51e575['body'][_0x5be5('0x6c')]['length'];_0x39fcb6+=0x1){socket[_0x5be5('0xbf')](_0x5be5('0xc0'),{'UserId':Number(_0x51e575[_0x5be5('0x61')][_0x5be5('0x6c')][_0x39fcb6]),'MailAccountId':Number(_0x51e575[_0x5be5('0x5c')]['id'])});}return _0x4026b8;});}})[_0x5be5('0x22')](respondWithResult(_0x43e592,null))['catch'](handleError(_0x43e592,null));};exports[_0x5be5('0xc1')]=function(_0x44a4c1,_0x18767b){return db['MailAccount'][_0x5be5('0x5f')]({'where':{'id':_0x44a4c1[_0x5be5('0x5c')]['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x18767b,null))[_0x5be5('0x22')](function(_0x520294){if(_0x520294){return _0x520294[_0x5be5('0xc1')](_0x44a4c1['query']['ids'])[_0x5be5('0x22')](function(){if(_[_0x5be5('0xc2')](_0x44a4c1['query'][_0x5be5('0x6c')])){for(var _0x18ac91=0x0;_0x18ac91<_0x44a4c1[_0x5be5('0x4a')][_0x5be5('0x6c')][_0x5be5('0x4f')];_0x18ac91+=0x1){socket[_0x5be5('0xbf')](_0x5be5('0xc3'),{'UserId':Number(_0x44a4c1[_0x5be5('0x4a')]['ids'][_0x18ac91]),'MailAccountId':Number(_0x44a4c1[_0x5be5('0x5c')]['id'])});}}else{socket['emit'](_0x5be5('0xc3'),{'UserId':Number(_0x44a4c1[_0x5be5('0x4a')]['ids']),'MailAccountId':Number(_0x44a4c1[_0x5be5('0x5c')]['id'])});}});}})[_0x5be5('0x22')](respondWithStatusCode(_0x18767b,null))[_0x5be5('0x18')](handleError(_0x18767b,null));};exports[_0x5be5('0xc4')]=function(_0x63aec4,_0x22e89e){var _0x4ca3be={};var _0x212422={};var _0x3730f8;var _0x575deb;return db[_0x5be5('0x46')][_0x5be5('0x6f')]({'where':{'id':_0x63aec4['params']['id']}})[_0x5be5('0x22')](handleEntityNotFound(_0x22e89e,null))['then'](function(_0x2e94e2){if(_0x2e94e2){_0x3730f8=_0x2e94e2;_0x212422[_0x5be5('0x49')]=_['keys'](db[_0x5be5('0x89')][_0x5be5('0x5e')]);_0x212422['query']=_[_0x5be5('0x5d')](_0x63aec4['query']);_0x212422[_0x5be5('0x4b')]=_['intersection'](_0x212422[_0x5be5('0x49')],_0x212422[_0x5be5('0x4a')]);_0x4ca3be[_0x5be5('0x4d')]=_[_0x5be5('0x4c')](_0x212422[_0x5be5('0x49')],qs['fields'](_0x63aec4[_0x5be5('0x4a')][_0x5be5('0x4e')]));_0x4ca3be[_0x5be5('0x4d')]=_0x4ca3be['attributes'][_0x5be5('0x4f')]?_0x4ca3be[_0x5be5('0x4d')]:_0x212422[_0x5be5('0x49')];_0x4ca3be[_0x5be5('0x51')]=qs[_0x5be5('0x52')](_0x63aec4[_0x5be5('0x4a')][_0x5be5('0x52')]);_0x4ca3be[_0x5be5('0x53')]=qs['filters'](_[_0x5be5('0x54')](_0x63aec4[_0x5be5('0x4a')],_0x212422['filters']));if(_0x63aec4['query'][_0x5be5('0x55')]){_0x4ca3be['where']=_['merge'](_0x4ca3be[_0x5be5('0x53')],{'$or':_[_0x5be5('0x45')](_0x4ca3be[_0x5be5('0x4d')],function(_0x3b0db1){var _0x1a7b94={};_0x1a7b94[_0x3b0db1]={'$like':'%'+_0x63aec4[_0x5be5('0x4a')]['filter']+'%'};return _0x1a7b94;})});}_0x4ca3be=_[_0x5be5('0x56')]({},_0x4ca3be,_0x63aec4['options']);return _0x3730f8[_0x5be5('0xc4')](_0x4ca3be);}})[_0x5be5('0x22')](function(_0x398440){if(_0x398440){_0x575deb=_0x398440[_0x5be5('0x4f')];if(!_0x63aec4['query']['hasOwnProperty']('nolimit')){_0x4ca3be[_0x5be5('0x1f')]=qs[_0x5be5('0x1f')](_0x63aec4[_0x5be5('0x4a')][_0x5be5('0x1f')]);_0x4ca3be['offset']=qs[_0x5be5('0x1c')](_0x63aec4[_0x5be5('0x4a')][_0x5be5('0x1c')]);}return _0x3730f8[_0x5be5('0xc4')](_0x4ca3be);}})[_0x5be5('0x22')](function(_0x58521d){if(_0x58521d){return _0x58521d?{'count':_0x575deb,'rows':_0x58521d}:null;}})[_0x5be5('0x22')](respondWithResult(_0x22e89e,null))['catch'](handleError(_0x22e89e,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 1ac5f51..504e3bb 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 _0xbd36=['hook','exports','events','../../mysqldb','MailAccount','update','remove','emit','hasOwnProperty'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0xbd36,0x65));var _0x6bd3=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xbd36[_0xdea41a];return _0x15d0d8;};'use strict';var EventEmitter=require(_0x6bd3('0x0'));var MailAccount=require(_0x6bd3('0x1'))['db'][_0x6bd3('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6bd3('0x3'),'afterDestroy':_0x6bd3('0x4')};function emitEvent(_0x513e89){return function(_0x3b2956,_0xa0380,_0x31143d){MailAccountEvents[_0x6bd3('0x5')](_0x513e89+':'+_0x3b2956['id'],_0x3b2956);MailAccountEvents['emit'](_0x513e89,_0x3b2956);_0x31143d(null);};}for(var e in events){if(events[_0x6bd3('0x6')](e)){var event=events[e];MailAccount[_0x6bd3('0x7')](e,emitEvent(event));}}module[_0x6bd3('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x804d=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x804d,0x116));var _0xd804=function(_0xe206ed,_0x179821){_0xe206ed=_0xe206ed-0x0;var _0x4423ab=_0x804d[_0xe206ed];return _0x4423ab;};'use strict';var EventEmitter=require(_0xd804('0x0'));var MailAccount=require(_0xd804('0x1'))['db'][_0xd804('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xd804('0x3')](0x0);var events={'afterCreate':_0xd804('0x4'),'afterUpdate':_0xd804('0x5'),'afterDestroy':_0xd804('0x6')};function emitEvent(_0x83c3d2){return function(_0x56835c,_0xad8724,_0x773dc4){MailAccountEvents[_0xd804('0x7')](_0x83c3d2+':'+_0x56835c['id'],_0x56835c);MailAccountEvents[_0xd804('0x7')](_0x83c3d2,_0x56835c);_0x773dc4(null);};}for(var e in events){if(events[_0xd804('0x8')](e)){var event=events[e];MailAccount[_0xd804('0x9')](e,emitEvent(event));}}module[_0xd804('0xa')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 3cdc384..7c28478 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 _0x88f5=['auth','pass','exports','define','MailAccount','mail_accounts','provider','custom','service','host','port','Smtp','secure','authentication','modernAuthentication','CloudProvider','OAuth2','user','data5'];(function(_0xcfc44,_0x179bc1){var _0x307a25=function(_0x2b64de){while(--_0x2b64de){_0xcfc44['push'](_0xcfc44['shift']());}};_0x307a25(++_0x179bc1);}(_0x88f5,0xf9));var _0x588f=function(_0x1d9365,_0x53a545){_0x1d9365=_0x1d9365-0x0;var _0x4e0fc6=_0x88f5[_0x1d9365];return _0x4e0fc6;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x588f('0x0')]=function(_0x5c0ea3){return _0x5c0ea3[_0x588f('0x1')](_0x588f('0x2'),attributes,{'tableName':_0x588f('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2232d2=this;var _0x8ecdc1={'id':_0x2232d2['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2232d2[_0x588f('0x4')]!==_0x588f('0x5')){_0x8ecdc1[_0x588f('0x6')]=_0x2232d2[_0x588f('0x4')];}else{_0x8ecdc1['host']=_0x2232d2['Smtp'][_0x588f('0x7')];_0x8ecdc1[_0x588f('0x8')]=_0x2232d2['Smtp'][_0x588f('0x8')];_0x8ecdc1['secure']=_0x2232d2[_0x588f('0x9')][_0x588f('0xa')];}if(_0x2232d2[_0x588f('0x9')][_0x588f('0xb')]){if(_0x2232d2[_0x588f('0x9')][_0x588f('0xc')]){if(!_0x2232d2['Smtp'][_0x588f('0xd')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x8ecdc1['auth']={'type':_0x588f('0xe'),'user':_0x2232d2[_0x588f('0x9')][_0x588f('0xf')],'accessToken':_0x2232d2['Smtp'][_0x588f('0xd')][_0x588f('0x10')]};}else{_0x8ecdc1[_0x588f('0x11')]={'user':_0x2232d2[_0x588f('0x9')][_0x588f('0xf')],'pass':_0x2232d2[_0x588f('0x9')][_0x588f('0x12')]};}}return _0x8ecdc1;}}});}; \ No newline at end of file +var _0xbdea=['pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','service','provider','Smtp','host','port','secure','authentication','modernAuthentication','CloudProvider','auth','OAuth2','data5','user'];(function(_0x157f05,_0x1868db){var _0x2cc23c=function(_0x17d77a){while(--_0x17d77a){_0x157f05['push'](_0x157f05['shift']());}};_0x2cc23c(++_0x1868db);}(_0xbdea,0xd2));var _0xabde=function(_0x47aded,_0xb76625){_0x47aded=_0x47aded-0x0;var _0x505e9a=_0xbdea[_0x47aded];return _0x505e9a;};'use strict';var attributes=require(_0xabde('0x0'));module[_0xabde('0x1')]=function(_0x37f03c){return _0x37f03c[_0xabde('0x2')](_0xabde('0x3'),attributes,{'tableName':_0xabde('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x1ad10b=this;var _0x403f7d={'id':_0x1ad10b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1ad10b['provider']!=='custom'){_0x403f7d[_0xabde('0x5')]=_0x1ad10b[_0xabde('0x6')];}else{_0x403f7d['host']=_0x1ad10b[_0xabde('0x7')][_0xabde('0x8')];_0x403f7d[_0xabde('0x9')]=_0x1ad10b['Smtp']['port'];_0x403f7d[_0xabde('0xa')]=_0x1ad10b['Smtp'][_0xabde('0xa')];}if(_0x1ad10b[_0xabde('0x7')][_0xabde('0xb')]){if(_0x1ad10b[_0xabde('0x7')][_0xabde('0xc')]){if(!_0x1ad10b[_0xabde('0x7')][_0xabde('0xd')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x403f7d[_0xabde('0xe')]={'type':_0xabde('0xf'),'user':_0x1ad10b[_0xabde('0x7')]['user'],'accessToken':_0x1ad10b[_0xabde('0x7')]['CloudProvider'][_0xabde('0x10')]};}else{_0x403f7d[_0xabde('0xe')]={'user':_0x1ad10b[_0xabde('0x7')][_0xabde('0x11')],'pass':_0x1ad10b[_0xabde('0x7')][_0xabde('0x12')]};}}return _0x403f7d;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index c621a5c..bb270f7 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 _0x66fa=['ShowMailAccount','smtp','getSmtpOptions','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','Applications','MailServerOut','Smtp','List','get','omit','smtpOptions','applications','list','orderBy','priority','asc','autoclose','push','close','*,*,*,*','create','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','attach','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','map','model','catch'];(function(_0x1a8532,_0x3830f5){var _0x12b61d=function(_0x3c2ddf){while(--_0x3c2ddf){_0x1a8532['push'](_0x1a8532['shift']());}};_0x12b61d(++_0x3830f5);}(_0x66fa,0x117));var _0xa66f=function(_0x251aee,_0x5866ad){_0x251aee=_0x251aee-0x0;var _0x3bed99=_0x66fa[_0x251aee];return _0x3bed99;};'use strict';var _=require(_0xa66f('0x0'));var moment=require(_0xa66f('0x1'));var BPromise=require('bluebird');var rs=require(_0xa66f('0x2'));var Redis=require(_0xa66f('0x3'));var db=require(_0xa66f('0x4'))['db'];var logger=require(_0xa66f('0x5'))(_0xa66f('0x6'));var config=require(_0xa66f('0x7'));var jayson=require(_0xa66f('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0xa66f('0x9')]=_[_0xa66f('0xa')](config[_0xa66f('0x9')],{'host':_0xa66f('0xb'),'port':0x18eb});var socket=require(_0xa66f('0xc'))(new Redis(config['redis']));require(_0xa66f('0xd'))['register'](socket);function respondWithRpcPromise(_0x46c788,_0x597c7c,_0x101e10){return new BPromise(function(_0x53ca76,_0x52d802){return client['request'](_0x46c788,_0x101e10)[_0xa66f('0xe')](function(_0x825868){logger['info'](_0xa66f('0xf'),_0x597c7c,'request\x20sent');logger[_0xa66f('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x597c7c,_0xa66f('0x11'),JSON[_0xa66f('0x12')](_0x825868));if(_0x825868[_0xa66f('0x13')]){if(_0x825868['error']['code']===0x1f4){logger[_0xa66f('0x13')]('MailAccount,\x20%s,\x20%s',_0x597c7c,_0x825868['error']['message']);return _0x52d802(_0x825868[_0xa66f('0x13')][_0xa66f('0x14')]);}logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x597c7c,_0x825868[_0xa66f('0x13')]['message']);return _0x53ca76(_0x825868['error'][_0xa66f('0x14')]);}else{logger[_0xa66f('0x15')](_0xa66f('0xf'),_0x597c7c,_0xa66f('0x11'));_0x53ca76(_0x825868['result'][_0xa66f('0x14')]);}})['catch'](function(_0x4a28d4){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x597c7c,_0x4a28d4);_0x52d802(_0x4a28d4);});});}exports[_0xa66f('0x16')]=function(_0x355ddc){var _0x2c5b76=this;return new Promise(function(_0x408bc7,_0x251f60){return db[_0xa66f('0x17')][_0xa66f('0x18')]({'raw':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1a')]===undefined?!![]:![]:!![],'where':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1b')]||null:null,'attributes':_0x355ddc['options']?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1c')]||null:null,'limit':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')]['limit']||null:null,'include':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x355ddc['options']['include'],function(_0xed98b9){return{'model':db[_0xed98b9['model']],'as':_0xed98b9['as'],'attributes':_0xed98b9[_0xa66f('0x1c')],'include':_0xed98b9[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0xed98b9['include'],function(_0x4683c7){return{'model':db[_0x4683c7[_0xa66f('0x1f')]],'as':_0x4683c7['as'],'attributes':_0x4683c7[_0xa66f('0x1c')],'include':_0x4683c7[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x4683c7[_0xa66f('0x1d')],function(_0x1eb86a){return{'model':db[_0x1eb86a[_0xa66f('0x1f')]],'as':_0x1eb86a['as'],'attributes':_0x1eb86a[_0xa66f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa66f('0xe')](function(_0x45f71c){logger[_0xa66f('0x15')](_0xa66f('0x16'),_0x355ddc);logger[_0xa66f('0x10')]('GetMailAccount',_0x355ddc,JSON['stringify'](_0x45f71c));_0x408bc7(_0x45f71c);})[_0xa66f('0x20')](function(_0x27ceae){logger['error'](_0xa66f('0x16'),_0x27ceae[_0xa66f('0x14')],_0x355ddc);_0x251f60(_0x2c5b76['error'](0x1f4,_0x27ceae[_0xa66f('0x14')]));});});};exports[_0xa66f('0x21')]=function(_0x9d78d5){var _0x2c2ace=this;return new Promise(function(_0x395623,_0x548add){return db[_0xa66f('0x17')]['find']({'raw':_0x9d78d5[_0xa66f('0x19')]?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1a')]===undefined?!![]:![]:!![],'where':_0x9d78d5['options']?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1b')]||null:null,'attributes':_0x9d78d5['options']?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1c')]||null:null,'include':_0x9d78d5[_0xa66f('0x19')]?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1d')],function(_0x35ef27){return{'model':db[_0x35ef27[_0xa66f('0x1f')]],'as':_0x35ef27['as'],'attributes':_0x35ef27['attributes'],'include':_0x35ef27[_0xa66f('0x1d')]?_['map'](_0x35ef27[_0xa66f('0x1d')],function(_0x46f6cc){return{'model':db[_0x46f6cc[_0xa66f('0x1f')]],'as':_0x46f6cc['as'],'attributes':_0x46f6cc[_0xa66f('0x1c')],'include':_0x46f6cc[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x46f6cc[_0xa66f('0x1d')],function(_0xcee582){return{'model':db[_0xcee582['model']],'as':_0xcee582['as'],'attributes':_0xcee582[_0xa66f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4477cf){if(_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x22')]===!![])_0x4477cf['setDataValue']('smtpOptions',_0x4477cf[_0xa66f('0x23')]());logger[_0xa66f('0x15')](_0xa66f('0x21'),_0x9d78d5);logger[_0xa66f('0x10')](_0xa66f('0x21'),_0x9d78d5,JSON['stringify'](_0x4477cf));_0x395623(_0x4477cf);})['catch'](function(_0x49b869){logger[_0xa66f('0x13')]('ShowMailAccount',_0x49b869['message'],_0x9d78d5);_0x548add(_0x2c2ace['error'](0x1f4,_0x49b869[_0xa66f('0x14')]));});});};exports['NotifyMailAccount']=function(_0x8965d3){var _0x17d942=this;return new Promise(function(_0x23a546,_0x1647a0){var _0xd65c5d={'body':_0x8965d3[_0xa66f('0x24')],'channel':_0xa66f('0x25')};var _0x261089=_[_0xa66f('0x26')](_[_0xa66f('0x27')](db[_0xa66f('0x28')][_0xa66f('0x29')]),[_0xa66f('0x2a'),_0xa66f('0x2b'),'CompanyId',_0xa66f('0x2c')]);var _0x25c2cb=![];if(_0x8965d3['body']['id']){delete _0x8965d3[_0xa66f('0x24')]['id'];}if(_['isNil'](_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')])){return _0x1647a0(_0x17d942['error'](0x1f4,_0xa66f('0x2e')));}if(_[_0xa66f('0x2f')](_0x8965d3[_0xa66f('0x24')]['body'])||_0x8965d3[_0xa66f('0x24')]['body']===''){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x30')));}if(_[_0xa66f('0x2f')](_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')])){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x32')+_0x261089));}if(!_['includes'](_0x261089,_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')])){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x33')+_0x261089));}var _0x374e53={};_0x374e53[_0x8965d3['body']['mapKey']]=_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')];return db[_0xa66f('0x17')][_0xa66f('0x34')]({'where':{'id':_0x8965d3[_0xa66f('0x35')]['id']},'include':[{'model':db[_0xa66f('0x36')],'as':'List','include':[{'model':db[_0xa66f('0x28')],'as':_0xa66f('0x37'),'where':_0x374e53,'limit':0x1,'order':[[_0xa66f('0x2b'),'DESC']]}]},{'model':db['MailApplication'],'as':_0xa66f('0x38')},{'model':db[_0xa66f('0x39')],'as':_0xa66f('0x3a'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})['then'](function(_0x19e7ce){if(_0x19e7ce&&_0x19e7ce[_0xa66f('0x3b')]){var _0x40d3b6=_0x19e7ce[_0xa66f('0x3c')]({'plain':!![]});_0xd65c5d[_0xa66f('0x35')]=_[_0xa66f('0x3d')](_0x40d3b6,[_0xa66f('0x38'),_0xa66f('0x3b')]);_0xd65c5d['account'][_0xa66f('0x3e')]=_0x19e7ce[_0xa66f('0x23')]();_0xd65c5d[_0xa66f('0x3f')]=_0x40d3b6[_0xa66f('0x38')];_0xd65c5d[_0xa66f('0x40')]=_0x40d3b6[_0xa66f('0x3b')];_0xd65c5d['applications']=_[_0xa66f('0x41')](_0xd65c5d[_0xa66f('0x3f')],[_0xa66f('0x42')],[_0xa66f('0x43')]);if(_0xd65c5d[_0xa66f('0x35')]&&_0xd65c5d['account'][_0xa66f('0x44')]){_0xd65c5d['applications'][_0xa66f('0x45')]({'id':0x0,'priority':_0xd65c5d['applications']['length']+0x1,'app':_0xa66f('0x46'),'appdata':_0xa66f('0x44'),'interval':_0xa66f('0x47')});}if(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x38')]){delete _0xd65c5d[_0xa66f('0x35')]['Applications'];}if(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x3b')]){delete _0xd65c5d[_0xa66f('0x35')][_0xa66f('0x3b')];}if(_0x40d3b6['List'][_0xa66f('0x37')]['length']){return _0x40d3b6[_0xa66f('0x3b')][_0xa66f('0x37')][0x0];}var _0x21482f=_[_0xa66f('0xa')](_0x8965d3[_0xa66f('0x24')],{'firstName':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')],'ListId':_0x40d3b6['ListId']});_0x21482f[_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')]]=_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')];return db[_0xa66f('0x28')][_0xa66f('0x48')](_0x21482f);}else{throw new Error(_0xa66f('0x49'));}})[_0xa66f('0xe')](function(_0x350fce){_0xd65c5d['contact']=_0x350fce;if(_0x350fce){if(!_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4a')]){_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x4a')]=rs[_0xa66f('0x4b')]()+'\x20'+_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x2d')];}var _0x11c89e={'ContactId':_0x350fce['id'],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id'],'inReplyTo':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x4a')],'to':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x2d')],'cc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['cc'],'subject':_0x8965d3['body']['message'][_0xa66f('0x4c')],'attach':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['attach'],'lastMsgAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgDirection':'in'};return db[_0xa66f('0x4f')][_0xa66f('0x34')]({'where':{'closed':![],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id']},'include':[{'model':db[_0xa66f('0x50')],'as':_0xa66f('0x51'),'attributes':[_0xa66f('0x4a')],'where':{'messageId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x52')]}}]})[_0xa66f('0xe')](function(_0x235e4f){if(_0x235e4f){return[_0x235e4f,![]];}return db[_0xa66f('0x4f')][_0xa66f('0x48')](_0x11c89e)[_0xa66f('0xe')](function(_0x41ffa7){return[_0x41ffa7,!![]];});});}else{throw new Error(_0xa66f('0x53'));}})['spread'](function(_0x52f22d,_0x46327d){if(_0x52f22d){_0x25c2cb=_0x46327d;if(!_0x46327d){return _0x52f22d[_0xa66f('0x54')]({'inReplyTo':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x4a')],'to':_0x8965d3['body'][_0xa66f('0x14')]['from'],'cc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['cc'],'subject':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['subject'],'attach':_0x52f22d[_0xa66f('0x55')]?_0x52f22d[_0xa66f('0x55')]:_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x55')],'substatus':null,'substatusAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgDirection':'in'});}else{return _0x52f22d;}}})[_0xa66f('0xe')](function(_0x290323){_0xd65c5d[_0xa66f('0x56')]=_0x290323['get']({'plain':!![]});_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x57')]=_0x25c2cb;return db[_0xa66f('0x50')][_0xa66f('0x48')]({'body':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x24')],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id'],'MailInteractionId':_0x290323['id'],'direction':'in','ContactId':_0xd65c5d[_0xa66f('0x58')]['id'],'messageId':_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4a')],'from':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x2d')],'to':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['to'],'cc':_0x8965d3[_0xa66f('0x24')]['message']['cc'],'subject':_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4c')],'attach':_0x8965d3[_0xa66f('0x24')]['message']['attach'],'Attachments':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x59')],'originTo':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5a')],'originCc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x5b')],'bcc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x5c')],'ChatWebsiteId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5d')]||null,'originChannel':_0x8965d3[_0xa66f('0x24')]['message']['originChannel']||_0xa66f('0x5e'),'ChatOfflineMessageId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':_0xa66f('0x60')}]});})['then'](function(_0x4feda0){_0xd65c5d['message']=_0x4feda0;if(_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x61')]){return db[_0xa66f('0x62')][_0xa66f('0x34')]({'attributes':['id',_0xa66f('0x63')],'where':{'id':_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x61')]}})[_0xa66f('0xe')](function(_0x1ee6e0){if(_0x1ee6e0){_0xd65c5d[_0xa66f('0x3f')][_0xa66f('0x64')]({'id':0x0,'priority':0x0,'app':_0xa66f('0x65'),'appdata':_0x1ee6e0[_0xa66f('0x63')]+','+(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x66')]||0xa),'interval':_0xa66f('0x47')});}return respondWithRpcPromise('Start',_0xa66f('0x67'),_0xd65c5d);});}return respondWithRpcPromise('Start',_0xa66f('0x67'),_0xd65c5d);})['then'](function(_0xc4b32b){_0x23a546(_0xc4b32b);})[_0xa66f('0x20')](function(_0x2bb4e5){_0x1647a0(_0x17d942['error'](0x1f4,_0x2bb4e5['message']));});});}; \ No newline at end of file +var _0x687b=['originTo','originCc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','body','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','account','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','CloudProvider','List','omit','applications','list','orderBy','asc','length','close','autoclose','*,*,*,*','ListId','List\x20not\x20found','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','spread','update','interaction','get','created','contact'];(function(_0x4da17d,_0x39fac7){var _0x2dd051=function(_0x1664bd){while(--_0x1664bd){_0x4da17d['push'](_0x4da17d['shift']());}};_0x2dd051(++_0x39fac7);}(_0x687b,0x14a));var _0xb687=function(_0x5c6c64,_0x12d4cb){_0x5c6c64=_0x5c6c64-0x0;var _0x172174=_0x687b[_0x5c6c64];return _0x172174;};'use strict';var _=require(_0xb687('0x0'));var moment=require(_0xb687('0x1'));var BPromise=require(_0xb687('0x2'));var rs=require(_0xb687('0x3'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0xb687('0x4'))(_0xb687('0x5'));var config=require(_0xb687('0x6'));var jayson=require(_0xb687('0x7'));var client=jayson[_0xb687('0x8')][_0xb687('0x9')]({'port':0x232c});config[_0xb687('0xa')]=_[_0xb687('0xb')](config[_0xb687('0xa')],{'host':_0xb687('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb687('0xa')]));require(_0xb687('0xd'))['register'](socket);function respondWithRpcPromise(_0x1a99c5,_0x21e3ab,_0x825ad){return new BPromise(function(_0x15dc9a,_0x404fdb){return client[_0xb687('0xe')](_0x1a99c5,_0x825ad)[_0xb687('0xf')](function(_0xaf4727){logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));logger[_0xb687('0x12')](_0xb687('0x13'),_0x21e3ab,_0xb687('0x11'),JSON['stringify'](_0xaf4727));if(_0xaf4727['error']){if(_0xaf4727[_0xb687('0x14')][_0xb687('0x15')]===0x1f4){logger['error'](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x404fdb(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x15dc9a(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}else{logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));_0x15dc9a(_0xaf4727[_0xb687('0x18')][_0xb687('0x17')]);}})['catch'](function(_0x48958d){logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0x48958d);_0x404fdb(_0x48958d);});});}exports[_0xb687('0x19')]=function(_0x4b593b){var _0x42cdd2=this;return new Promise(function(_0x481f1d,_0x1bd2bf){return db[_0xb687('0x1a')][_0xb687('0x1b')]({'raw':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b593b['options']?_0x4b593b[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1f')]||null:null,'limit':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x20')]||null:null,'include':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x21')]?_[_0xb687('0x22')](_0x4b593b['options'][_0xb687('0x21')],function(_0x129347){return{'model':db[_0x129347[_0xb687('0x23')]],'as':_0x129347['as'],'attributes':_0x129347[_0xb687('0x1f')],'include':_0x129347[_0xb687('0x21')]?_[_0xb687('0x22')](_0x129347[_0xb687('0x21')],function(_0x3cb2f2){return{'model':db[_0x3cb2f2[_0xb687('0x23')]],'as':_0x3cb2f2['as'],'attributes':_0x3cb2f2[_0xb687('0x1f')],'include':_0x3cb2f2['include']?_[_0xb687('0x22')](_0x3cb2f2[_0xb687('0x21')],function(_0x392721){return{'model':db[_0x392721[_0xb687('0x23')]],'as':_0x392721['as'],'attributes':_0x392721[_0xb687('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x4e9a06){logger[_0xb687('0x10')]('GetMailAccount',_0x4b593b);logger[_0xb687('0x12')](_0xb687('0x19'),_0x4b593b,JSON[_0xb687('0x24')](_0x4e9a06));_0x481f1d(_0x4e9a06);})[_0xb687('0x25')](function(_0x1ad3ef){logger[_0xb687('0x14')](_0xb687('0x19'),_0x1ad3ef['message'],_0x4b593b);_0x1bd2bf(_0x42cdd2[_0xb687('0x14')](0x1f4,_0x1ad3ef[_0xb687('0x17')]));});});};exports[_0xb687('0x26')]=function(_0x22cd1d){var _0xa18fec=this;return new Promise(function(_0x263834,_0x44be88){return db[_0xb687('0x1a')][_0xb687('0x27')]({'raw':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['attributes']||null:null,'include':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')]?_['map'](_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')],function(_0x548b83){return{'model':db[_0x548b83[_0xb687('0x23')]],'as':_0x548b83['as'],'attributes':_0x548b83['attributes'],'include':_0x548b83[_0xb687('0x21')]?_[_0xb687('0x22')](_0x548b83[_0xb687('0x21')],function(_0x3e146a){return{'model':db[_0x3e146a[_0xb687('0x23')]],'as':_0x3e146a['as'],'attributes':_0x3e146a[_0xb687('0x1f')],'include':_0x3e146a['include']?_[_0xb687('0x22')](_0x3e146a[_0xb687('0x21')],function(_0x2a73df){return{'model':db[_0x2a73df[_0xb687('0x23')]],'as':_0x2a73df['as'],'attributes':_0x2a73df['attributes']};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x100f4a){if(_0x22cd1d[_0xb687('0x1c')][_0xb687('0x28')]===!![])_0x100f4a[_0xb687('0x29')]('smtpOptions',_0x100f4a[_0xb687('0x2a')]());logger[_0xb687('0x10')](_0xb687('0x26'),_0x22cd1d);logger[_0xb687('0x12')](_0xb687('0x26'),_0x22cd1d,JSON[_0xb687('0x24')](_0x100f4a));_0x263834(_0x100f4a);})['catch'](function(_0x5ad577){logger[_0xb687('0x14')]('ShowMailAccount',_0x5ad577[_0xb687('0x17')],_0x22cd1d);_0x44be88(_0xa18fec[_0xb687('0x14')](0x1f4,_0x5ad577['message']));});});};exports[_0xb687('0x2b')]=function(_0x2ce07a){var _0x57776b=this;return new Promise(function(_0x394b56,_0x28031e){var _0x127b25={'body':_0x2ce07a['body'],'channel':_0xb687('0x2c')};var _0x9cffb2=_[_0xb687('0x2d')](_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')]),[_0xb687('0x31'),'updatedAt',_0xb687('0x32'),'ListId']);var _0x50fdb7=![];if(_0x2ce07a[_0xb687('0x33')]['id']){delete _0x2ce07a[_0xb687('0x33')]['id'];}if(_['isNil'](_0x2ce07a[_0xb687('0x33')]['from'])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x34')));}if(_['isNil'](_0x2ce07a[_0xb687('0x33')][_0xb687('0x33')])||_0x2ce07a['body'][_0xb687('0x33')]===''){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x35')));}if(_[_0xb687('0x36')](_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x38')+_0x9cffb2));}if(!_[_0xb687('0x39')](_0x9cffb2,_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9cffb2));}var _0x1ac373={};_0x1ac373[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')];return db[_0xb687('0x1a')][_0xb687('0x27')]({'where':{'id':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb687('0x2f')],'as':_0xb687('0x3c'),'where':_0x1ac373,'limit':0x1,'order':[[_0xb687('0x3d'),_0xb687('0x3e')]]}]},{'model':db['MailApplication'],'as':_0xb687('0x3f')},{'model':db[_0xb687('0x40')],'as':_0xb687('0x41'),'include':[{'model':db[_0xb687('0x42')],'as':'CloudProvider'}]}]})[_0xb687('0xf')](function(_0xfc4c5f){if(_0xfc4c5f&&_0xfc4c5f[_0xb687('0x43')]){var _0x401b99=_0xfc4c5f['get']({'plain':!![]});_0x127b25['account']=_[_0xb687('0x44')](_0x401b99,[_0xb687('0x3f'),_0xb687('0x43')]);_0x127b25['account']['smtpOptions']=_0xfc4c5f[_0xb687('0x2a')]();_0x127b25[_0xb687('0x45')]=_0x401b99[_0xb687('0x3f')];_0x127b25[_0xb687('0x46')]=_0x401b99[_0xb687('0x43')];_0x127b25[_0xb687('0x45')]=_[_0xb687('0x47')](_0x127b25[_0xb687('0x45')],['priority'],[_0xb687('0x48')]);if(_0x127b25[_0xb687('0x3b')]&&_0x127b25[_0xb687('0x3b')]['autoclose']){_0x127b25['applications']['push']({'id':0x0,'priority':_0x127b25['applications'][_0xb687('0x49')]+0x1,'app':_0xb687('0x4a'),'appdata':_0xb687('0x4b'),'interval':_0xb687('0x4c')});}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x3f')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x3f')];}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x43')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x43')];}if(_0x401b99[_0xb687('0x43')][_0xb687('0x3c')][_0xb687('0x49')]){return _0x401b99[_0xb687('0x43')][_0xb687('0x3c')][0x0];}var _0x4dca01=_['defaults'](_0x2ce07a[_0xb687('0x33')],{'firstName':_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')],'ListId':_0x401b99[_0xb687('0x4d')]});_0x4dca01[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')]['from'];return db[_0xb687('0x2f')]['create'](_0x4dca01);}else{throw new Error(_0xb687('0x4e'));}})[_0xb687('0xf')](function(_0x50fb31){_0x127b25['contact']=_0x50fb31;if(_0x50fb31){if(!_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId']){_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')]=rs['generate']()+'\x20'+_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')];}var _0x1a31f6={'ContactId':_0x50fb31['id'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId'],'to':_0x2ce07a['body'][_0xb687('0x17')]['from'],'cc':_0x2ce07a['body']['message']['cc'],'subject':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x50')],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'};return db[_0xb687('0x54')][_0xb687('0x27')]({'where':{'closed':![],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db[_0xb687('0x55')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x56')]}}]})[_0xb687('0xf')](function(_0x1c031f){if(_0x1c031f){return[_0x1c031f,![]];}return db[_0xb687('0x54')][_0xb687('0x57')](_0x1a31f6)['then'](function(_0x22da49){return[_0x22da49,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb687('0x58')](function(_0x293281,_0x18993a){if(_0x293281){_0x50fdb7=_0x18993a;if(!_0x18993a){return _0x293281[_0xb687('0x59')]({'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')],'to':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x3a')],'cc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['cc'],'subject':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x50')],'attach':_0x293281[_0xb687('0x51')]?_0x293281[_0xb687('0x51')]:_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'substatus':null,'substatusAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'});}else{return _0x293281;}}})[_0xb687('0xf')](function(_0x48838a){_0x127b25[_0xb687('0x5a')]=_0x48838a[_0xb687('0x5b')]({'plain':!![]});_0x127b25[_0xb687('0x5a')][_0xb687('0x5c')]=_0x50fdb7;return db['MailMessage'][_0xb687('0x57')]({'body':_0x2ce07a[_0xb687('0x33')]['body'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'MailInteractionId':_0x48838a['id'],'direction':'in','ContactId':_0x127b25[_0xb687('0x5d')]['id'],'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x4f')],'from':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')],'to':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['to'],'cc':_0x2ce07a[_0xb687('0x33')]['message']['cc'],'subject':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['subject'],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['attach'],'Attachments':_0x2ce07a['body'][_0xb687('0x17')]['attachments'],'originTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5e')],'originCc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5f')],'bcc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['bcc'],'ChatWebsiteId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x60')]||null,'originChannel':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x61')]||'Email','ChatOfflineMessageId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb687('0x62')],'as':_0xb687('0x63')}]});})[_0xb687('0xf')](function(_0x1227fe){_0x127b25['message']=_0x1227fe;if(_0x127b25[_0xb687('0x5a')]['UserId']){return db['User'][_0xb687('0x27')]({'attributes':['id','name'],'where':{'id':_0x127b25['interaction'][_0xb687('0x64')]}})['then'](function(_0x137631){if(_0x137631){_0x127b25[_0xb687('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb687('0x65'),'appdata':_0x137631[_0xb687('0x66')]+','+(_0x127b25['account'][_0xb687('0x67')]||0xa),'interval':_0xb687('0x4c')});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);})[_0xb687('0xf')](function(_0x2ce516){_0x394b56(_0x2ce516);})[_0xb687('0x25')](function(_0x4092a0){_0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0x4092a0['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index afa6e4a..87492dd 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 _0x27d6=['mailAccount:','./mailAccount.events','save','emit','removeListener','register','length'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x27d6,0x14a));var _0x627d=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x27d6[_0x4e9628];return _0x27bc8c;};'use strict';var MailAccountEvents=require(_0x627d('0x0'));var events=[_0x627d('0x1'),'remove','update'];function createListener(_0xe3eb8d,_0x53e052){return function(_0xe68c22){_0x53e052[_0x627d('0x2')](_0xe3eb8d,_0xe68c22);};}function removeListener(_0x18f700,_0x156ce2){return function(){MailAccountEvents[_0x627d('0x3')](_0x18f700,_0x156ce2);};}exports[_0x627d('0x4')]=function(_0x2fbe1f){for(var _0x586b91=0x0,_0x253a70=events[_0x627d('0x5')];_0x586b91<_0x253a70;_0x586b91++){var _0x15984e=events[_0x586b91];var _0x16e7af=createListener(_0x627d('0x6')+_0x15984e,_0x2fbe1f);MailAccountEvents['on'](_0x15984e,_0x16e7af);}}; \ No newline at end of file +var _0x245b=['./mailAccount.events','save','update','emit','removeListener','length','mailAccount:'];(function(_0x48168a,_0xf9dfe5){var _0x346d98=function(_0x22e41f){while(--_0x22e41f){_0x48168a['push'](_0x48168a['shift']());}};_0x346d98(++_0xf9dfe5);}(_0x245b,0xa8));var _0xb245=function(_0x42d1a0,_0x478c46){_0x42d1a0=_0x42d1a0-0x0;var _0x1cff40=_0x245b[_0x42d1a0];return _0x1cff40;};'use strict';var MailAccountEvents=require(_0xb245('0x0'));var events=[_0xb245('0x1'),'remove',_0xb245('0x2')];function createListener(_0xf472b3,_0x3baf8c){return function(_0x15aabc){_0x3baf8c[_0xb245('0x3')](_0xf472b3,_0x15aabc);};}function removeListener(_0x5b2e43,_0x3cf8a5){return function(){MailAccountEvents[_0xb245('0x4')](_0x5b2e43,_0x3cf8a5);};}exports['register']=function(_0x3ab098){for(var _0x3817ec=0x0,_0x1a84f1=events[_0xb245('0x5')];_0x3817ec<_0x1a84f1;_0x3817ec++){var _0x4b3e17=events[_0x3817ec];var _0x13c5b2=createListener(_0xb245('0x6')+_0x4b3e17,_0x3ab098);MailAccountEvents['on'](_0x4b3e17,_0x13c5b2);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 08ca414..beb2d87 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 _0x864c=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','isAuthenticated','put','/:id','delete'];(function(_0x12a3eb,_0x1e3bf5){var _0x199ee5=function(_0x829ece){while(--_0x829ece){_0x12a3eb['push'](_0x12a3eb['shift']());}};_0x199ee5(++_0x1e3bf5);}(_0x864c,0x1d4));var _0xc864=function(_0x3be56f,_0x12ceb6){_0x3be56f=_0x3be56f-0x0;var _0x591266=_0x864c[_0x3be56f];return _0x591266;};'use strict';var multer=require(_0xc864('0x0'));var util=require(_0xc864('0x1'));var path=require('path');var timeout=require(_0xc864('0x2'));var express=require(_0xc864('0x3'));var router=express['Router']();var fs_extra=require(_0xc864('0x4'));var auth=require(_0xc864('0x5'));var interaction=require(_0xc864('0x6'));var config=require('../../config/environment');var controller=require(_0xc864('0x7'));router[_0xc864('0x8')]('/:id',auth[_0xc864('0x9')](),controller['show']);router[_0xc864('0xa')](_0xc864('0xb'),auth[_0xc864('0x9')](),controller['update']);router[_0xc864('0xc')](_0xc864('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6c9f=['./mailApplication.controller','get','isAuthenticated','show','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0x6c9f,0x17e));var _0xf6c9=function(_0x59bac4,_0x3c3e60){_0x59bac4=_0x59bac4-0x0;var _0x3f78ad=_0x6c9f[_0x59bac4];return _0x3f78ad;};'use strict';var multer=require(_0xf6c9('0x0'));var util=require(_0xf6c9('0x1'));var path=require(_0xf6c9('0x2'));var timeout=require(_0xf6c9('0x3'));var express=require(_0xf6c9('0x4'));var router=express[_0xf6c9('0x5')]();var fs_extra=require(_0xf6c9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf6c9('0x7'));var config=require(_0xf6c9('0x8'));var controller=require(_0xf6c9('0x9'));router[_0xf6c9('0xa')]('/:id',auth[_0xf6c9('0xb')](),controller[_0xf6c9('0xc')]);router['put'](_0xf6c9('0xd'),auth[_0xf6c9('0xb')](),controller[_0xf6c9('0xe')]);router[_0xf6c9('0xf')](_0xf6c9('0xd'),auth[_0xf6c9('0xb')](),controller[_0xf6c9('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index f030020..15767f0 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 _0x74b4=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x1fcf36,_0x3f2539){var _0x44491f=function(_0x206816){while(--_0x206816){_0x1fcf36['push'](_0x1fcf36['shift']());}};_0x44491f(++_0x3f2539);}(_0x74b4,0x153));var _0x474b=function(_0x20300c,_0x1e9b5b){_0x20300c=_0x20300c-0x0;var _0x421e7c=_0x74b4[_0x20300c];return _0x421e7c;};'use strict';var Sequelize=require(_0x474b('0x0'));module[_0x474b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x474b('0x2')],'allowNull':![],'defaultValue':_0x474b('0x3')},'appdata':{'type':Sequelize[_0x474b('0x4')]()},'description':{'type':Sequelize[_0x474b('0x2')]},'interval':{'type':Sequelize[_0x474b('0x2')],'defaultValue':_0x474b('0x5')}}; \ No newline at end of file +var _0xd675=['exports','INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x128094,_0x3ccd4a){var _0x458cab=function(_0x7e760){while(--_0x7e760){_0x128094['push'](_0x128094['shift']());}};_0x458cab(++_0x3ccd4a);}(_0xd675,0x1c1));var _0x5d67=function(_0x479735,_0x3be5a1){_0x479735=_0x479735-0x0;var _0x143500=_0xd675[_0x479735];return _0x143500;};'use strict';var Sequelize=require(_0x5d67('0x0'));module[_0x5d67('0x1')]={'priority':{'type':Sequelize[_0x5d67('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5d67('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5d67('0x4')]()},'description':{'type':Sequelize[_0x5d67('0x3')]},'interval':{'type':Sequelize[_0x5d67('0x3')],'defaultValue':_0x5d67('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index b3bbf1b..54605c5 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 _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x1c3330,_0x5610a6){var _0x57839e=function(_0x110f0c){while(--_0x110f0c){_0x1c3330['push'](_0x1c3330['shift']());}};_0x57839e(++_0x5610a6);}(_0xac4a,0x13f));var _0xaac4=function(_0x55f049,_0x477ea4){_0x55f049=_0x55f049-0x0;var _0x5480b1=_0xac4a[_0x55f049];return _0x5480b1;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file +var _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x450ef7,_0x44205c){var _0x41a6b2=function(_0x3f3e21){while(--_0x3f3e21){_0x450ef7['push'](_0x450ef7['shift']());}};_0x41a6b2(++_0x44205c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index d2052dc..77cb904 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 _0x2efa=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x16b33b,_0x57f315){var _0x295d90=function(_0x412a7a){while(--_0x412a7a){_0x16b33b['push'](_0x16b33b['shift']());}};_0x295d90(++_0x57f315);}(_0x2efa,0x12b));var _0xa2ef=function(_0x5f3fba,_0x4f7702){_0x5f3fba=_0x5f3fba-0x0;var _0x1f2deb=_0x2efa[_0x5f3fba];return _0x1f2deb;};'use strict';var _=require(_0xa2ef('0x0'));var util=require(_0xa2ef('0x1'));var logger=require(_0xa2ef('0x2'))(_0xa2ef('0x3'));var moment=require(_0xa2ef('0x4'));var BPromise=require(_0xa2ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa2ef('0x6'));var config=require(_0xa2ef('0x7'));var attributes=require(_0xa2ef('0x8'));module[_0xa2ef('0x9')]=function(_0x27ff27,_0x39035c){return _0x27ff27[_0xa2ef('0xa')](_0xa2ef('0xb'),attributes,{'tableName':_0xa2ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa2ef('0xd'),'collate':_0xa2ef('0xe')});}; \ No newline at end of file +var _0x5888=['define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./mailApplication.attributes','exports'];(function(_0x28ddf3,_0xd2752b){var _0x13fa0e=function(_0x3c671b){while(--_0x3c671b){_0x28ddf3['push'](_0x28ddf3['shift']());}};_0x13fa0e(++_0xd2752b);}(_0x5888,0xac));var _0x8588=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0x5888[_0x1d2bbb];return _0x38082b;};'use strict';var _=require(_0x8588('0x0'));var util=require(_0x8588('0x1'));var logger=require(_0x8588('0x2'))(_0x8588('0x3'));var moment=require(_0x8588('0x4'));var BPromise=require(_0x8588('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8588('0x6'));var rimraf=require(_0x8588('0x7'));var config=require('../../config/environment');var attributes=require(_0x8588('0x8'));module[_0x8588('0x9')]=function(_0xabc594,_0x4b6b8d){return _0xabc594[_0x8588('0xa')]('MailApplication',attributes,{'tableName':_0x8588('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8588('0xc'),'collate':_0x8588('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 9be75fc..7eca81d 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 _0xd410=['MailApplication','body','options','raw','where','attributes','UpdateMailApplication','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x11d972,_0x44b588){var _0x309e92=function(_0xf4872d){while(--_0xf4872d){_0x11d972['push'](_0x11d972['shift']());}};_0x309e92(++_0x44b588);}(_0xd410,0x127));var _0x0d41=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xd410[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0d41('0x0'));var util=require('util');var moment=require(_0x0d41('0x1'));var BPromise=require(_0x0d41('0x2'));var rs=require(_0x0d41('0x3'));var fs=require('fs');var Redis=require(_0x0d41('0x4'));var db=require(_0x0d41('0x5'))['db'];var utils=require(_0x0d41('0x6'));var logger=require(_0x0d41('0x7'))('rpc');var config=require(_0x0d41('0x8'));var jayson=require(_0x0d41('0x9'));var client=jayson[_0x0d41('0xa')][_0x0d41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b446c,_0x36fc7e,_0x19b327){return new BPromise(function(_0x3268bc,_0x55b299){return client[_0x0d41('0xc')](_0x4b446c,_0x19b327)[_0x0d41('0xd')](function(_0x2bd3e7){logger[_0x0d41('0xe')](_0x0d41('0xf'),_0x36fc7e,_0x0d41('0x10'));logger[_0x0d41('0x11')](_0x0d41('0x12'),_0x36fc7e,_0x0d41('0x10'),JSON[_0x0d41('0x13')](_0x2bd3e7));if(_0x2bd3e7['error']){if(_0x2bd3e7[_0x0d41('0x14')][_0x0d41('0x15')]===0x1f4){logger[_0x0d41('0x14')]('MailApplication,\x20%s,\x20%s',_0x36fc7e,_0x2bd3e7[_0x0d41('0x14')][_0x0d41('0x16')]);return _0x55b299(_0x2bd3e7[_0x0d41('0x14')][_0x0d41('0x16')]);}logger[_0x0d41('0x14')](_0x0d41('0xf'),_0x36fc7e,_0x2bd3e7[_0x0d41('0x14')]['message']);return _0x3268bc(_0x2bd3e7['error'][_0x0d41('0x16')]);}else{logger['info'](_0x0d41('0xf'),_0x36fc7e,_0x0d41('0x10'));_0x3268bc(_0x2bd3e7[_0x0d41('0x17')]['message']);}})[_0x0d41('0x18')](function(_0x78f2c9){logger[_0x0d41('0x14')](_0x0d41('0xf'),_0x36fc7e,_0x78f2c9);_0x55b299(_0x78f2c9);});});}exports['UpdateMailApplication']=function(_0x472c34){var _0x528dbf=this;return new Promise(function(_0x354ebc,_0x44769c){return db[_0x0d41('0x19')]['update'](_0x472c34[_0x0d41('0x1a')],{'raw':_0x472c34[_0x0d41('0x1b')]?_0x472c34['options'][_0x0d41('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x472c34['options']?_0x472c34[_0x0d41('0x1b')][_0x0d41('0x1d')]||null:null,'attributes':_0x472c34[_0x0d41('0x1b')]?_0x472c34[_0x0d41('0x1b')][_0x0d41('0x1e')]||null:null,'limit':_0x472c34['options']?_0x472c34[_0x0d41('0x1b')]['limit']||null:null})[_0x0d41('0xd')](function(_0x3f481f){logger[_0x0d41('0xe')]('UpdateMailApplication',_0x472c34);logger['debug'](_0x0d41('0x1f'),_0x472c34,JSON[_0x0d41('0x13')](_0x3f481f));_0x354ebc(_0x3f481f);})[_0x0d41('0x18')](function(_0x28e42f){logger['error'](_0x0d41('0x1f'),_0x28e42f['message'],_0x472c34);_0x44769c(_0x528dbf[_0x0d41('0x14')](0x1f4,_0x28e42f[_0x0d41('0x16')]));});});}; \ No newline at end of file +var _0xa1c2=['result','catch','UpdateMailApplication','MailApplication','update','raw','options','attributes','limit','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent'];(function(_0x26dbfb,_0x507fd8){var _0x31a31e=function(_0x408ce5){while(--_0x408ce5){_0x26dbfb['push'](_0x26dbfb['shift']());}};_0x31a31e(++_0x507fd8);}(_0xa1c2,0x172));var _0x2a1c=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xa1c2[_0x9c2427];return _0x51984f;};'use strict';var _=require('lodash');var util=require(_0x2a1c('0x0'));var moment=require(_0x2a1c('0x1'));var BPromise=require(_0x2a1c('0x2'));var rs=require(_0x2a1c('0x3'));var fs=require('fs');var Redis=require(_0x2a1c('0x4'));var db=require(_0x2a1c('0x5'))['db'];var utils=require(_0x2a1c('0x6'));var logger=require(_0x2a1c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2a1c('0x8'));var client=jayson[_0x2a1c('0x9')][_0x2a1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56a8b4,_0x20d59e,_0x18ae66){return new BPromise(function(_0x220207,_0x50fcd3){return client['request'](_0x56a8b4,_0x18ae66)[_0x2a1c('0xb')](function(_0x541ae4){logger['info'](_0x2a1c('0xc'),_0x20d59e,'request\x20sent');logger[_0x2a1c('0xd')](_0x2a1c('0xe'),_0x20d59e,'request\x20sent',JSON['stringify'](_0x541ae4));if(_0x541ae4[_0x2a1c('0xf')]){if(_0x541ae4['error'][_0x2a1c('0x10')]===0x1f4){logger[_0x2a1c('0xf')](_0x2a1c('0xc'),_0x20d59e,_0x541ae4[_0x2a1c('0xf')][_0x2a1c('0x11')]);return _0x50fcd3(_0x541ae4[_0x2a1c('0xf')][_0x2a1c('0x11')]);}logger[_0x2a1c('0xf')](_0x2a1c('0xc'),_0x20d59e,_0x541ae4[_0x2a1c('0xf')][_0x2a1c('0x11')]);return _0x220207(_0x541ae4[_0x2a1c('0xf')][_0x2a1c('0x11')]);}else{logger[_0x2a1c('0x12')](_0x2a1c('0xc'),_0x20d59e,_0x2a1c('0x13'));_0x220207(_0x541ae4[_0x2a1c('0x14')][_0x2a1c('0x11')]);}})[_0x2a1c('0x15')](function(_0x3287cc){logger[_0x2a1c('0xf')](_0x2a1c('0xc'),_0x20d59e,_0x3287cc);_0x50fcd3(_0x3287cc);});});}exports[_0x2a1c('0x16')]=function(_0xd2753f){var _0x1f60c4=this;return new Promise(function(_0x3d636b,_0xa1cf91){return db[_0x2a1c('0x17')][_0x2a1c('0x18')](_0xd2753f['body'],{'raw':_0xd2753f['options']?_0xd2753f['options'][_0x2a1c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd2753f[_0x2a1c('0x1a')]?_0xd2753f[_0x2a1c('0x1a')]['where']||null:null,'attributes':_0xd2753f['options']?_0xd2753f['options'][_0x2a1c('0x1b')]||null:null,'limit':_0xd2753f[_0x2a1c('0x1a')]?_0xd2753f[_0x2a1c('0x1a')][_0x2a1c('0x1c')]||null:null})[_0x2a1c('0xb')](function(_0x48bd80){logger['info'](_0x2a1c('0x16'),_0xd2753f);logger[_0x2a1c('0xd')](_0x2a1c('0x16'),_0xd2753f,JSON[_0x2a1c('0x1d')](_0x48bd80));_0x3d636b(_0x48bd80);})[_0x2a1c('0x15')](function(_0x18d97c){logger['error']('UpdateMailApplication',_0x18d97c['message'],_0xd2753f);_0xa1cf91(_0x1f60c4[_0x2a1c('0xf')](0x1f4,_0x18d97c['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 07163a8..a64d741 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 _0x1c15=['download','post','/:id/messages','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','/:id','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','get','show','getMessages'];(function(_0x6178fe,_0x4f225c){var _0x195c92=function(_0x5df552){while(--_0x5df552){_0x6178fe['push'](_0x6178fe['shift']());}};_0x195c92(++_0x4f225c);}(_0x1c15,0x1a6));var _0x51c1=function(_0x137815,_0x78dd4b){_0x137815=_0x137815-0x0;var _0x29ded1=_0x1c15[_0x137815];return _0x29ded1;};'use strict';var express=require(_0x51c1('0x0'));var router=express[_0x51c1('0x1')]();var auth=require(_0x51c1('0x2'));var interaction=require(_0x51c1('0x3'));var controller=require('./mailInteraction.controller');router['get']('/',auth[_0x51c1('0x4')](),controller[_0x51c1('0x5')]);router['get'](_0x51c1('0x6'),auth[_0x51c1('0x4')](),controller['describe']);router[_0x51c1('0x7')]('/:id',auth[_0x51c1('0x4')](),controller[_0x51c1('0x8')]);router[_0x51c1('0x7')]('/:id/messages',auth[_0x51c1('0x4')](),controller[_0x51c1('0x9')]);router[_0x51c1('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x51c1('0xa')]);router[_0x51c1('0xb')]('/',auth[_0x51c1('0x4')](),controller['create']);router[_0x51c1('0xb')](_0x51c1('0xc'),auth[_0x51c1('0x4')](),controller['addMessage']);router[_0x51c1('0xb')](_0x51c1('0xd'),auth[_0x51c1('0x4')](),interaction[_0x51c1('0xe')](_0x51c1('0xf'),_0x51c1('0x10')),controller[_0x51c1('0x11')]);router[_0x51c1('0x12')]('/:id',auth[_0x51c1('0x4')](),interaction[_0x51c1('0xe')](_0x51c1('0xf'),_0x51c1('0x13')),controller[_0x51c1('0x14')]);router[_0x51c1('0x15')](_0x51c1('0x16'),auth[_0x51c1('0x4')](),interaction[_0x51c1('0xe')]('mail',_0x51c1('0x17')),controller[_0x51c1('0x18')]);router[_0x51c1('0x15')](_0x51c1('0xd'),auth[_0x51c1('0x4')](),controller[_0x51c1('0x19')]);module[_0x51c1('0x1a')]=router; \ No newline at end of file +var _0x2c8c=['post','/:id/messages','addMessage','mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','/:id/tags','removeTags','exports','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','describe','/:id','getMessages','create'];(function(_0x14fbae,_0x2787cd){var _0x4a068b=function(_0x4dcc8f){while(--_0x4dcc8f){_0x14fbae['push'](_0x14fbae['shift']());}};_0x4a068b(++_0x2787cd);}(_0x2c8c,0x1b8));var _0xc2c8=function(_0x225505,_0x2a79fd){_0x225505=_0x225505-0x0;var _0x331d20=_0x2c8c[_0x225505];return _0x331d20;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xc2c8('0x0'));var interaction=require(_0xc2c8('0x1'));var controller=require(_0xc2c8('0x2'));router[_0xc2c8('0x3')]('/',auth[_0xc2c8('0x4')](),controller[_0xc2c8('0x5')]);router[_0xc2c8('0x3')]('/describe',auth[_0xc2c8('0x4')](),controller[_0xc2c8('0x6')]);router['get'](_0xc2c8('0x7'),auth[_0xc2c8('0x4')](),controller['show']);router[_0xc2c8('0x3')]('/:id/messages',auth[_0xc2c8('0x4')](),controller[_0xc2c8('0x8')]);router[_0xc2c8('0x3')]('/:id/download',auth[_0xc2c8('0x4')](),controller['download']);router['post']('/',auth[_0xc2c8('0x4')](),controller[_0xc2c8('0x9')]);router[_0xc2c8('0xa')](_0xc2c8('0xb'),auth[_0xc2c8('0x4')](),controller[_0xc2c8('0xc')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0xc2c8('0xd'),_0xc2c8('0xe')),controller[_0xc2c8('0xf')]);router[_0xc2c8('0x10')](_0xc2c8('0x7'),auth[_0xc2c8('0x4')](),interaction[_0xc2c8('0x11')](_0xc2c8('0xd'),_0xc2c8('0x12')),controller[_0xc2c8('0x13')]);router[_0xc2c8('0x14')](_0xc2c8('0x7'),auth['isAuthenticated'](),interaction[_0xc2c8('0x11')](_0xc2c8('0xd'),_0xc2c8('0x15')),controller['destroy']);router[_0xc2c8('0x14')](_0xc2c8('0x16'),auth[_0xc2c8('0x4')](),controller[_0xc2c8('0x17')]);module[_0xc2c8('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index db32637..ae5eb80 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 _0x521e=['out','BOOLEAN','DATE','STRING','long','TEXT','ENUM'];(function(_0x2dfd24,_0x49900f){var _0xbfd886=function(_0x1962bc){while(--_0x1962bc){_0x2dfd24['push'](_0x2dfd24['shift']());}};_0xbfd886(++_0x49900f);}(_0x521e,0x86));var _0xe521=function(_0x5be34b,_0x3a6c7c){_0x5be34b=_0x5be34b-0x0;var _0xc8b658=_0x521e[_0x5be34b];return _0xc8b658;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0xe521('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe521('0x1')]},'disposition':{'type':Sequelize[_0xe521('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe521('0x2')]},'note':{'type':Sequelize[_0xe521('0x2')]},'inReplyTo':{'type':Sequelize[_0xe521('0x2')](0x1fe)},'to':{'type':Sequelize[_0xe521('0x2')]},'cc':{'type':Sequelize['TEXT'](_0xe521('0x3'))},'subject':{'type':Sequelize[_0xe521('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xe521('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0xe521('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe521('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xe521('0x5')]('in',_0xe521('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xe521('0x0')],'defaultValue':![]}}; \ No newline at end of file +var _0x3fc6=['long','TEXT','BOOLEAN','out','ENUM','sequelize','iconv','exports','DATE','STRING'];(function(_0x2a2f53,_0x31872c){var _0x4ac24d=function(_0x1061ff){while(--_0x1061ff){_0x2a2f53['push'](_0x2a2f53['shift']());}};_0x4ac24d(++_0x31872c);}(_0x3fc6,0x159));var _0x63fc=function(_0x512726,_0x273a2f){_0x512726=_0x512726-0x0;var _0x40689d=_0x3fc6[_0x512726];return _0x40689d;};'use strict';var Sequelize=require(_0x63fc('0x0'));var iconv=require(_0x63fc('0x1'));module[_0x63fc('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x63fc('0x3')]},'disposition':{'type':Sequelize[_0x63fc('0x4')]},'secondDisposition':{'type':Sequelize[_0x63fc('0x4')]},'thirdDisposition':{'type':Sequelize[_0x63fc('0x4')]},'note':{'type':Sequelize[_0x63fc('0x4')]},'inReplyTo':{'type':Sequelize[_0x63fc('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0x63fc('0x5'))},'subject':{'type':Sequelize[_0x63fc('0x6')]()},'attach':{'type':Sequelize[_0x63fc('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x63fc('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x63fc('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x63fc('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x63fc('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x63fc('0x9')]('in',_0x63fc('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x63fc('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 27c5078..4acfeee 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 _0x6b8f=['update','then','destroy','sendStatus','stack','name','send','map','fullname','TagIds','split','forEach','Tags','push','findOne','out','plainBody','trimStart','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','MailInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','select','field','color','from','u.id','u.fullname','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys','some','compact','isEmpty','MailAccountId','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','user','role','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','enableEmailPreview','all','show','includeAll','merge','create','body','params','describe','MailMessage','addMessage','ids','omit','getMessages','pick','format','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','inlineCss','true','rows','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','Attachments','Messages','bcc','subject','get','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','build','writeFileSync','message%d.eml','rimraf','moment','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','register','status','end','json','offset','limit','count','set'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x4003cf,_0x4a915b){_0x4003cf=_0x4003cf-0x0;var _0x1b2e0c=_0x6b8f[_0x4003cf];return _0x1b2e0c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6b8('0x0'));var zipdir=require('zip-dir');var moment=require(_0xf6b8('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xf6b8('0x2'));var fs=require('fs');var _=require(_0xf6b8('0x3'));var squel=require('squel');var juice=require(_0xf6b8('0x4'));var Redis=require(_0xf6b8('0x5'));var qs=require(_0xf6b8('0x6'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xf6b8('0x7'))(_0xf6b8('0x8'));var config=require(_0xf6b8('0x9'));var db=require(_0xf6b8('0xa'))['db'];var htmlEntities=require('html-entities');config['redis']=_[_0xf6b8('0xb')](config['redis'],{'host':_0xf6b8('0xc'),'port':0x18eb});var socket=require(_0xf6b8('0xd'))(new Redis(config[_0xf6b8('0xe')]));require(_0xf6b8('0xf'))[_0xf6b8('0x10')](socket);function respondWithStatusCode(_0x162938,_0x55dad4){_0x55dad4=_0x55dad4||0xcc;return function(_0x481679){if(_0x481679){return _0x162938['sendStatus'](_0x55dad4);}return _0x162938[_0xf6b8('0x11')](_0x55dad4)[_0xf6b8('0x12')]();};}function respondWithResult(_0x29c278,_0x1d96b9){_0x1d96b9=_0x1d96b9||0xc8;return function(_0x5a6118){if(_0x5a6118){return _0x29c278['status'](_0x1d96b9)[_0xf6b8('0x13')](_0x5a6118);}};}function respondWithFilteredResult(_0x3899a9,_0x5104d3){return function(_0xfcecc9){if(_0xfcecc9){var _0x2db10c=typeof _0x5104d3[_0xf6b8('0x14')]==='undefined'&&typeof _0x5104d3[_0xf6b8('0x15')]==='undefined';var _0x410345=_0xfcecc9[_0xf6b8('0x16')];var _0x2e1748=_0x2db10c?0x0:_0x5104d3[_0xf6b8('0x14')];var _0x12f9a8=_0x2db10c?_0xfcecc9['count']:_0x5104d3['offset']+_0x5104d3[_0xf6b8('0x15')];var _0x56508b;if(_0x12f9a8>=_0x410345){_0x12f9a8=_0x410345;_0x56508b=0xc8;}else{_0x56508b=0xce;}_0x3899a9[_0xf6b8('0x11')](_0x56508b);return _0x3899a9[_0xf6b8('0x17')]('Content-Range',_0x2e1748+'-'+_0x12f9a8+'/'+_0x410345)['json'](_0xfcecc9);}return null;};}function saveUpdates(_0x1d0ee9){return function(_0x2e2b29){if(_0x2e2b29){return _0x2e2b29[_0xf6b8('0x18')](_0x1d0ee9)[_0xf6b8('0x19')](function(_0x4df5f4){return _0x4df5f4;});}return null;};}function removeEntity(_0x59f9df){return function(_0x5a9553){if(_0x5a9553){return _0x5a9553[_0xf6b8('0x1a')]()[_0xf6b8('0x19')](function(){_0x59f9df[_0xf6b8('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x136bc6){return function(_0x193e84){if(!_0x193e84){_0x136bc6[_0xf6b8('0x1b')](0x194);}return _0x193e84;};}function handleError(_0x9c660c,_0x5dd616){_0x5dd616=_0x5dd616||0x1f4;return function(_0xd2c23e){logger['error'](_0xd2c23e[_0xf6b8('0x1c')]);if(_0xd2c23e[_0xf6b8('0x1d')]){delete _0xd2c23e[_0xf6b8('0x1d')];}_0x9c660c[_0xf6b8('0x11')](_0x5dd616)[_0xf6b8('0x1e')](_0xd2c23e);};}function getInteractionUsers(_0x55c72,_0x4edd29){return new BPromise(function(_0x1aca8a,_0x1ebfea){try{if(_0x4edd29[_0x55c72['id']]){_0x55c72['Users']=_[_0xf6b8('0x1f')](_0x4edd29[_0x55c72['id']],function(_0x378e89){return{'id':_0x378e89['id'],'fullname':_0x378e89[_0xf6b8('0x20')]};});}}catch(_0xd5ebb5){_0x1ebfea(_0xd5ebb5);}_0x1aca8a(_0x55c72);});}function getInteractionTags(_0x3365b8,_0x573ad8){return new BPromise(function(_0x5e5b1c,_0xfa77d3){try{if(_0x3365b8[_0xf6b8('0x21')]){_0x3365b8['Tags']=[];_0x3365b8[_0xf6b8('0x21')][_0xf6b8('0x22')](',')[_0xf6b8('0x23')](function(_0x5a7f55){_0x3365b8[_0xf6b8('0x24')][_0xf6b8('0x25')](_0x573ad8[_0x5a7f55]);});}delete _0x3365b8['TagIds'];}catch(_0x309f04){_0xfa77d3(_0x309f04);}_0x5e5b1c(_0x3365b8);});}function getLastMessageText(_0xfdf601){return new BPromise(function(_0x324eeb,_0x223ee7){return db['MailMessage'][_0xf6b8('0x26')]({'where':{'$and':[{'MailInteractionId':_0xfdf601['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xf6b8('0x27')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xf6b8('0x28')],'order':'-id','raw':!![]})[_0xf6b8('0x19')](function(_0x981e47){if(_0x981e47&&_0x981e47[_0xf6b8('0x28')]){_0xfdf601['lastMsgText']=_[_0xf6b8('0x29')](_0x981e47[_0xf6b8('0x28')]);}_0x324eeb(_0xfdf601);})[_0xf6b8('0x2a')](function(_0x108a9d){_0x223ee7(_0x108a9d);});});}function updateMailInteraction(_0x4be3cb,_0x1cb84d,_0x1b2725,_0x920fb1){return new BPromise(function(_0x5e0ed9,_0x583341){return getInteractionUsers(_0x4be3cb,_0x1b2725)[_0xf6b8('0x19')](function(_0x4602b1){return getInteractionTags(_0x4602b1,_0x1cb84d);})[_0xf6b8('0x19')](function(_0x44af27){return getStateInteraction(_0x44af27);})[_0xf6b8('0x19')](function(_0xcca34b){if(_0x920fb1){_0x5e0ed9(getLastMessageText(_0xcca34b));}else{_0x5e0ed9(_0xcca34b);}})[_0xf6b8('0x2a')](function(_0x7aaa3c){_0x583341(_0x7aaa3c);});});}function getStateInteraction(_0x4b80f7){return new BPromise(function(_0x3b9493){_0x4b80f7[_0xf6b8('0x2b')]=0x0;_0x4b80f7[_0xf6b8('0x2c')]=0x0;_0x4b80f7[_0xf6b8('0x2d')]=0x0;_0x4b80f7[_0xf6b8('0x2e')]=0x0;_0x4b80f7[_0xf6b8('0x2f')]=0x0;if(!_0x4b80f7[_0xf6b8('0x30')]&&!_0x4b80f7[_0xf6b8('0x31')]){_0x4b80f7[_0xf6b8('0x2b')]+=0x1;}if(!_0x4b80f7['closed']&&_0x4b80f7['UserId']){_0x4b80f7[_0xf6b8('0x2c')]+=0x1;if(_0x4b80f7[_0xf6b8('0x2b')]){_0x4b80f7[_0xf6b8('0x2b')]-=0x1;}}if(_0x4b80f7[_0xf6b8('0x30')]&&_0x4b80f7[_0xf6b8('0x31')]){_0x4b80f7[_0xf6b8('0x2d')]+=0x1;if(_0x4b80f7[_0xf6b8('0x2c')]){_0x4b80f7[_0xf6b8('0x2c')]-=0x1;}}if(_0x4b80f7[_0xf6b8('0x30')]&&!_0x4b80f7[_0xf6b8('0x31')]){_0x4b80f7[_0xf6b8('0x2e')]+=0x1;if(_0x4b80f7[_0xf6b8('0x2b')]){_0x4b80f7['waiting']-=0x1;}}_0x4b80f7[_0xf6b8('0x2f')]+=0x1;_0x3b9493(_0x4b80f7);});}exports[_0xf6b8('0x32')]=function(_0x5d26ad,_0x2348cf){var _0x2e1c69={},_0x47327f={},_0x456cb5={'count':0x0,'rows':[]};var _0x844393=_[_0xf6b8('0x1f')](db[_0xf6b8('0x33')][_0xf6b8('0x34')],function(_0x1c42fe){return{'name':_0x1c42fe[_0xf6b8('0x35')],'type':_0x1c42fe[_0xf6b8('0x36')][_0xf6b8('0x37')]};});_0x47327f[_0xf6b8('0x38')]=_[_0xf6b8('0x1f')](_0x844393,'name');_0x47327f['query']=_['keys'](_0x5d26ad[_0xf6b8('0x39')]);_0x47327f[_0xf6b8('0x3a')]=_[_0xf6b8('0x3b')](_0x47327f[_0xf6b8('0x38')],_0x47327f[_0xf6b8('0x39')]);_0x2e1c69[_0xf6b8('0x3c')]=_[_0xf6b8('0x3b')](_0x47327f['model'],qs[_0xf6b8('0x3d')](_0x5d26ad['query'][_0xf6b8('0x3d')]));_0x2e1c69[_0xf6b8('0x3c')]=_0x2e1c69[_0xf6b8('0x3c')][_0xf6b8('0x3e')]?_0x2e1c69[_0xf6b8('0x3c')]:_0x47327f['model'];if(!_0x5d26ad[_0xf6b8('0x39')][_0xf6b8('0x3f')](_0xf6b8('0x40'))){_0x2e1c69[_0xf6b8('0x15')]=qs[_0xf6b8('0x15')](_0x5d26ad['query'][_0xf6b8('0x15')]);_0x2e1c69[_0xf6b8('0x14')]=qs[_0xf6b8('0x14')](_0x5d26ad['query']['offset']);}_0x2e1c69[_0xf6b8('0x41')]=qs[_0xf6b8('0x42')](_0x5d26ad[_0xf6b8('0x39')][_0xf6b8('0x42')]);_0x2e1c69['where']=qs['filters'](_['pick'](_0x5d26ad[_0xf6b8('0x39')],_0x47327f['filters']),_0x844393);var _0x7865dc=[];var _0x1fc4e0=squel[_0xf6b8('0x43')]()[_0xf6b8('0x44')]('id')[_0xf6b8('0x44')](_0xf6b8('0x1d'))[_0xf6b8('0x44')](_0xf6b8('0x45'))[_0xf6b8('0x46')]('tools_tags');var _0x1144b3=squel['select']()[_0xf6b8('0x44')](_0xf6b8('0x47'))[_0xf6b8('0x44')](_0xf6b8('0x48'))[_0xf6b8('0x44')](_0xf6b8('0x49'))[_0xf6b8('0x46')]('user_has_mail_interactions','ui')[_0xf6b8('0x4a')](_0xf6b8('0x4b'),'u',_0xf6b8('0x4c'));var _0xa1cb8=squel['select']()[_0xf6b8('0x46')](_0xf6b8('0x4d'),'i')['left_join'](_0xf6b8('0x4e'),'c',_0xf6b8('0x4f'))[_0xf6b8('0x4a')](_0xf6b8('0x4b'),'o',_0xf6b8('0x50'))['left_join'](_0xf6b8('0x51'),'a',_0xf6b8('0x52'))['left_join']('mail_messages','me','me.MailInteractionId\x20=\x20i.id')[_0xf6b8('0x4a')](_0xf6b8('0x53'),'it',_0xf6b8('0x54'))[_0xf6b8('0x4a')]('tools_tags','t',_0xf6b8('0x55'));var _0x40c563=squel[_0xf6b8('0x56')]();var _0x20b6ba=[];var _0x7f08b8=squel[_0xf6b8('0x56')]();var _0x4075ec;if(_0x5d26ad['query']['search']){_0x4075ec=as[_0xf6b8('0x57')](_0x5d26ad[_0xf6b8('0x39')]['search']);var _0x47b230=_0x4075ec[_0xf6b8('0x58')];for(var _0xc0e082=0x0;_0xc0e082<_0x4075ec[_0xf6b8('0x59')][_0xf6b8('0x3e')];_0xc0e082++){var _0x34ca51=_0x4075ec[_0xf6b8('0x59')][_0xc0e082];var _0x4f78e0='i';var _0xbda3f9=_[_0xf6b8('0x5a')](_0x844393,[_0xf6b8('0x1d'),_0x34ca51[_0xf6b8('0x44')]]);if(!_0xbda3f9){switch(_0x34ca51['field']){case _0xf6b8('0x5b'):if(_0x34ca51[_0xf6b8('0x5c')]==0x1){_0xa1cb8['having']('`'+_0x34ca51[_0xf6b8('0x44')]+_0xf6b8('0x5d'));}else{_0xa1cb8[_0xf6b8('0x5e')]('`'+_0x34ca51['field']+_0xf6b8('0x5f'));}break;case _0xf6b8('0x60'):if(_0x34ca51[_0xf6b8('0x61')]===_0xf6b8('0x62')){if(_0x34ca51[_0xf6b8('0x5c')][_0xf6b8('0x22')]('\x20')[_0xf6b8('0x3e')]>0x1){_0x40c563[_0x47b230](_0xf6b8('0x63'),qs[_0xf6b8('0x64')](_0x34ca51[_0xf6b8('0x5c')]),null);}else{var _0x1b3559='%'+_0x34ca51[_0xf6b8('0x5c')]+'%';_0x40c563[_0x47b230]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1b3559,_0x1b3559,_0x1b3559);}}else{_0xbda3f9=_['find'](_0x844393,['name',_0xf6b8('0x65')]);_0x34ca51[_0xf6b8('0x44')]=_0xf6b8('0x65');_0x459268=as[_0xf6b8('0x66')](_0x4f78e0,_0xbda3f9['type'],_0x34ca51);_0x40c563[_0x47b230](_0x459268[_0xf6b8('0x67')],_0x459268[_0xf6b8('0x5c')][_0xf6b8('0x68')],_0x459268['value'][_0xf6b8('0x12')]);}break;case _0xf6b8('0x69'):var _0x36d0f8=_0x34ca51['value']['split'](',')[_0xf6b8('0x1f')](function(_0x3436d7){return Number(_0x3436d7);});_0x36d0f8[_0xf6b8('0x23')](function(_0xe9c06f){_0x7f08b8['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xe9c06f+',%');});_0x20b6ba=_[_0xf6b8('0x6a')](_0x20b6ba,_0x36d0f8);break;case'User':if(_0x34ca51[_0xf6b8('0x61')]===_0xf6b8('0x62')){_0x40c563[_0x47b230](_0xf6b8('0x6b'),'%'+_0x34ca51[_0xf6b8('0x5c')]+'%',null);}else{_0xbda3f9=_[_0xf6b8('0x5a')](_0x844393,['name',_0xf6b8('0x31')]);_0x34ca51[_0xf6b8('0x44')]=_0xf6b8('0x31');_0x459268=as[_0xf6b8('0x66')](_0x4f78e0,_0xbda3f9[_0xf6b8('0x36')],_0x34ca51);_0x40c563[_0x47b230](_0x459268[_0xf6b8('0x67')],_0x459268[_0xf6b8('0x5c')][_0xf6b8('0x68')],_0x459268[_0xf6b8('0x5c')][_0xf6b8('0x12')]);}break;case'plainBody':_0x459268=as[_0xf6b8('0x66')]('me',null,_0x34ca51);_0x40c563[_0x47b230](_0x459268[_0xf6b8('0x67')],_0x459268[_0xf6b8('0x5c')]['start'],_0x459268[_0xf6b8('0x5c')]['end']);break;}}else{var _0x459268=as['buildExpression'](_0x4f78e0,_0xbda3f9['type'],_0x34ca51);_0x40c563[_0x47b230](_0x459268[_0xf6b8('0x67')],_0x459268[_0xf6b8('0x5c')][_0xf6b8('0x68')],_0x459268[_0xf6b8('0x5c')][_0xf6b8('0x12')]);}}}else{var _0x5a7034=_(_0x5d26ad[_0xf6b8('0x39')])[_0xf6b8('0x6c')]()['map'](function(_0x595359){return _[_0xf6b8('0x6d')](_0x844393,[_0xf6b8('0x1d'),_0x595359])?_0x595359:undefined;})[_0xf6b8('0x6e')]()[_0xf6b8('0x5c')]();if(!_[_0xf6b8('0x6f')](_0x5a7034)){_0x5a7034['forEach'](function(_0x48aded){if(_0x48aded===_0xf6b8('0x70')){_0xa1cb8[_0xf6b8('0x71')](_0xf6b8('0x72'),[][_0xf6b8('0x73')](_0x5d26ad['query'][_0x48aded]));}else if(_0x48aded===_0xf6b8('0x74')){var _0x2e58e4=JSON[_0xf6b8('0x75')](_0x5d26ad[_0xf6b8('0x39')][_0x48aded])[_0xf6b8('0x76')];var _0x2e43a1=JSON[_0xf6b8('0x75')](_0x5d26ad['query'][_0x48aded])['$lte'];_0xa1cb8[_0xf6b8('0x71')](_0xf6b8('0x77'),_0x2e58e4,_0x2e43a1);}else{if(_0x5d26ad[_0xf6b8('0x39')][_0x48aded]===_0xf6b8('0x78')){_0xa1cb8[_0xf6b8('0x71')]('i.'+_0x48aded+_0xf6b8('0x79'));}else{_0xa1cb8[_0xf6b8('0x71')]('i.'+_0x48aded+_0xf6b8('0x7a'),_0x5d26ad['query'][_0x48aded]);}}});}if(_0x5d26ad[_0xf6b8('0x39')][_0xf6b8('0x7b')]){if(_0x5d26ad[_0xf6b8('0x39')][_0xf6b8('0x7b')]==0x1){_0xa1cb8[_0xf6b8('0x5e')]('`unreadMessages`\x20=\x200');}else{_0xa1cb8[_0xf6b8('0x5e')]('`unreadMessages`\x20>\x200');}}if(_0x5d26ad[_0xf6b8('0x39')][_0xf6b8('0x7c')]){_0x20b6ba=_[_0xf6b8('0x7d')](_0x5d26ad[_0xf6b8('0x39')][_0xf6b8('0x7c')])?_0x5d26ad[_0xf6b8('0x39')]['tag']:new Array(_0x5d26ad[_0xf6b8('0x39')][_0xf6b8('0x7c')]);_0x20b6ba[_0xf6b8('0x23')](function(_0x3d76ee){_0x7f08b8['or'](_0xf6b8('0x7e'),'%,'+_0x3d76ee+',%');});}if(_0x5d26ad[_0xf6b8('0x39')][_0xf6b8('0x7f')]){var _0x55483c=_0x5d26ad[_0xf6b8('0x39')][_0xf6b8('0x7f')]['replace']('\x5c','\x5c\x5c')[_0xf6b8('0x80')](/'/g,'\x27\x27');if(qs[_0xf6b8('0x81')](_0x55483c)){_0x40c563['or'](_0xf6b8('0x82'),_0x55483c+'%');}else if(qs[_0xf6b8('0x83')](_0x55483c)){_0x40c563['or']('c.email\x20LIKE\x20?',_0x55483c+'%');}else{_0x40c563['or'](_0xf6b8('0x84'),qs[_0xf6b8('0x64')](_0x55483c))['or'](_0xf6b8('0x85'),qs['getFullTextValue'](_0x55483c));}}}_0xa1cb8[_0xf6b8('0x71')](_0x40c563);_0xa1cb8['group']('i.id');var _0x17eca9={'type':db[_0xf6b8('0x86')][_0xf6b8('0x87')][_0xf6b8('0x88')],'raw':!![]};var _0x2d4efa=_0xa1cb8[_0xf6b8('0x89')]();_0x2d4efa[_0xf6b8('0x44')](_0xf6b8('0x8a'));_0x2d4efa[_0xf6b8('0x44')](_0xf6b8('0x8b'),_0xf6b8('0x5b'));if(_0x2e1c69[_0xf6b8('0x41')]){_0x2e1c69[_0xf6b8('0x41')][_0xf6b8('0x23')](function(_0x3954f6){var _0x489cfc=_0x3954f6[0x0]==='contactName'?_0x3954f6[0x0]:'i.'+_0x3954f6[0x0];_0xa1cb8[_0xf6b8('0x41')](_0x489cfc,_0x3954f6[0x1]===_0xf6b8('0x8c')?![]:!![]);});}if(!_['isEmpty'](_0x20b6ba)){_0xa1cb8[_0xf6b8('0x5e')](_0x7f08b8);_0x2d4efa[_0xf6b8('0x71')](_0xf6b8('0x8d'),_0x20b6ba);}BPromise[_0xf6b8('0x8e')]()['then'](function(){if(!_0x4075ec){if(_0x5d26ad[_0xf6b8('0x39')][_0xf6b8('0x70')])return;_0x2d4efa[_0xf6b8('0x71')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0xa1cb8['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x5d26ad[_0xf6b8('0x8f')][_0xf6b8('0x90')]!=='agent')return;return _0x5d26ad[_0xf6b8('0x8f')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xf6b8('0x19')](function(_0x3c661c){if(_['isEmpty'](_0x3c661c)){_0x2d4efa[_0xf6b8('0x71')](_0xf6b8('0x91'));_0xa1cb8[_0xf6b8('0x71')](_0xf6b8('0x91'));}else{_0x2d4efa['where'](_0xf6b8('0x72'),_[_0xf6b8('0x1f')](_0x3c661c,'id'));_0xa1cb8['where'](_0xf6b8('0x72'),_[_0xf6b8('0x1f')](_0x3c661c,'id'));}});})[_0xf6b8('0x19')](function(){if(_0x5d26ad['user']['role']==='agent'&&!_0x4075ec&&!_0x5d26ad[_0xf6b8('0x39')][_0xf6b8('0x70')])return[];return db[_0xf6b8('0x92')][_0xf6b8('0x39')](_0x2d4efa[_0xf6b8('0x93')](),_0x17eca9);})[_0xf6b8('0x19')](function(_0x32ec89){_0x456cb5[_0xf6b8('0x16')]=_0x32ec89['length'];if(_0x456cb5[_0xf6b8('0x16')]===0x0)return[];return db['sequelize'][_0xf6b8('0x39')](_0x1fc4e0[_0xf6b8('0x93')](),_0x17eca9)[_0xf6b8('0x19')](function(_0x5ccae2){_0x7865dc=_[_0xf6b8('0x94')](_0x5ccae2,'id');_0x17eca9=_['merge'](_0x17eca9,{'model':db[_0xf6b8('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5d26ad['query']['fields']){_0x2e1c69[_0xf6b8('0x3c')][_0xf6b8('0x23')](function(_0x360b04){_0xa1cb8[_0xf6b8('0x44')]('i.'+_0x360b04);});}else{_0xa1cb8['field'](_0xf6b8('0x8b'),_0xf6b8('0x5b'));_0xa1cb8['field'](_0xf6b8('0x95'),'Account.key');_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0x96'),'Account.mandatoryDisposition');_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0x97'),_0xf6b8('0x98'));_0xa1cb8[_0xf6b8('0x44')]('i.id');_0xa1cb8[_0xf6b8('0x44')]('i.createdAt');_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0x99'));_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0x9a'));_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0x9b'));_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0x9c'));_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0x9d'));_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0x9e'));_0xa1cb8['field'](_0xf6b8('0x9f'));_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0xa0'));_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0xa1'));_0xa1cb8['field'](_0xf6b8('0xa2'));_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0xa3'));_0xa1cb8[_0xf6b8('0x44')]('i.to');_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0xa4'));_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0xa5'));_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0xa6'));_0xa1cb8['field'](_0xf6b8('0xa7'),_0xf6b8('0xa8'));_0xa1cb8[_0xf6b8('0x44')]('c.lastName',_0xf6b8('0xa9'));_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0xaa'),_0xf6b8('0xab'));_0xa1cb8[_0xf6b8('0x44')]('c.phone',_0xf6b8('0xac'));_0xa1cb8[_0xf6b8('0x44')]('c.mobile',_0xf6b8('0xad'));_0xa1cb8['field'](_0xf6b8('0xae'),_0xf6b8('0xaf'));_0xa1cb8['field'](_0xf6b8('0xb0'),_0xf6b8('0xb1'));_0xa1cb8[_0xf6b8('0x44')](_0xf6b8('0xb2'),_0xf6b8('0xb3'));_0xa1cb8['field'](_0xf6b8('0xb4'),'TagIds');}if(_0x2e1c69[_0xf6b8('0x15')])_0xa1cb8['limit'](_0x2e1c69[_0xf6b8('0x15')]);if(_0x2e1c69['offset'])_0xa1cb8[_0xf6b8('0x14')](_0x2e1c69[_0xf6b8('0x14')]);return db[_0xf6b8('0x92')]['query'](_0xa1cb8[_0xf6b8('0x93')](),_0x17eca9);})['then'](function(_0xf907bd){if(_0xf907bd['length']>0x0)_0x1144b3[_0xf6b8('0x71')](_0xf6b8('0xb5'),_['map'](_0xf907bd,'id'));return db[_0xf6b8('0x92')][_0xf6b8('0x39')](_0x1144b3[_0xf6b8('0x93')](),_0x17eca9)[_0xf6b8('0x19')](function(_0x5e98c4){var _0x13c530=_['groupBy'](_0x5e98c4,'MailInteractionId');var _0x2d9f55=[];return db['Setting'][_0xf6b8('0x26')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xf6b8('0x19')](function(_0x3e892a){var _0x5952eb=_0x3e892a[_0xf6b8('0xb6')];_0xf907bd[_0xf6b8('0x23')](function(_0xbdcb94){_0x2d9f55[_0xf6b8('0x25')](updateMailInteraction(_0xbdcb94,_0x7865dc,_0x13c530,_0x5952eb));});return BPromise[_0xf6b8('0xb7')](_0x2d9f55);});});});})[_0xf6b8('0x19')](function(_0x5eb87d){_0x456cb5['rows']=_0x5eb87d;return _0x456cb5;})[_0xf6b8('0x19')](respondWithFilteredResult(_0x2348cf,_0x2e1c69))[_0xf6b8('0x2a')](handleError(_0x2348cf,null));};exports[_0xf6b8('0xb8')]=function(_0x5a40c3,_0x1f1fc5){var _0x5c5fb0={'raw':![],'where':{'id':_0x5a40c3['params']['id']}},_0x3e4e9f={};_0x3e4e9f[_0xf6b8('0x38')]=_[_0xf6b8('0x6c')](db[_0xf6b8('0x33')][_0xf6b8('0x34')]);_0x3e4e9f['query']=_[_0xf6b8('0x6c')](_0x5a40c3['query']);_0x3e4e9f['filters']=_[_0xf6b8('0x3b')](_0x3e4e9f[_0xf6b8('0x38')],_0x3e4e9f['query']);_0x5c5fb0[_0xf6b8('0x3c')]=_[_0xf6b8('0x3b')](_0x3e4e9f[_0xf6b8('0x38')],qs['fields'](_0x5a40c3['query']['fields']));_0x5c5fb0[_0xf6b8('0x3c')]=_0x5c5fb0[_0xf6b8('0x3c')][_0xf6b8('0x3e')]?_0x5c5fb0['attributes']:_0x3e4e9f[_0xf6b8('0x38')];if(_0x5a40c3['query'][_0xf6b8('0xb9')]){_0x5c5fb0['include']=[{'all':!![]}];}_0x5c5fb0=_[_0xf6b8('0xba')]({},_0x5c5fb0,_0x5a40c3['options']);return db[_0xf6b8('0x33')]['find'](_0x5c5fb0)[_0xf6b8('0x19')](handleEntityNotFound(_0x1f1fc5,null))['then'](respondWithResult(_0x1f1fc5,null))['catch'](handleError(_0x1f1fc5,null));};exports['create']=function(_0x52adc5,_0x5c139f){return db[_0xf6b8('0x33')][_0xf6b8('0xbb')](_0x52adc5[_0xf6b8('0xbc')],{})[_0xf6b8('0x19')](respondWithResult(_0x5c139f,0xc9))[_0xf6b8('0x2a')](handleError(_0x5c139f,null));};exports[_0xf6b8('0x18')]=function(_0xeae789,_0xd94f0c){if(_0xeae789[_0xf6b8('0xbc')]['id']){delete _0xeae789[_0xf6b8('0xbc')]['id'];}return db[_0xf6b8('0x33')][_0xf6b8('0x5a')]({'where':{'id':_0xeae789['params']['id']}})[_0xf6b8('0x19')](handleEntityNotFound(_0xd94f0c,null))['then'](saveUpdates(_0xeae789[_0xf6b8('0xbc')],null))[_0xf6b8('0x19')](respondWithResult(_0xd94f0c,null))[_0xf6b8('0x2a')](handleError(_0xd94f0c,null));};exports[_0xf6b8('0x1a')]=function(_0x53b467,_0x1f4d4c){return db[_0xf6b8('0x33')][_0xf6b8('0x5a')]({'where':{'id':_0x53b467[_0xf6b8('0xbd')]['id']}})[_0xf6b8('0x19')](handleEntityNotFound(_0x1f4d4c,null))[_0xf6b8('0x19')](removeEntity(_0x1f4d4c,null))[_0xf6b8('0x2a')](handleError(_0x1f4d4c,null));};exports[_0xf6b8('0xbe')]=function(_0x5a892a,_0xd2195){return db[_0xf6b8('0x33')][_0xf6b8('0xbe')]()['then'](respondWithResult(_0xd2195,null))[_0xf6b8('0x2a')](handleError(_0xd2195,null));};exports['addMessage']=function(_0x4f8828,_0x263339){return db[_0xf6b8('0xbf')][_0xf6b8('0x5a')]({'where':{'id':_0x4f8828[_0xf6b8('0xbd')]['id']}})['then'](handleEntityNotFound(_0x263339,null))[_0xf6b8('0x19')](function(_0x240cfb){if(_0x240cfb){return _0x240cfb[_0xf6b8('0xc0')](_0x4f8828[_0xf6b8('0xbc')][_0xf6b8('0xc1')],_[_0xf6b8('0xc2')](_0x4f8828[_0xf6b8('0xbc')],[_0xf6b8('0xc1'),'id'])||{});}})[_0xf6b8('0x19')](respondWithResult(_0x263339,null))[_0xf6b8('0x2a')](handleError(_0x263339,null));};exports[_0xf6b8('0xc3')]=function(_0x8854a1,_0x53f269){var _0x519957={'raw':![],'where':{}};var _0x12c404={};var _0xd4478={'count':0x0,'rows':[]};return db[_0xf6b8('0x33')]['findOne']({'where':{'id':_0x8854a1[_0xf6b8('0xbd')]['id']}})[_0xf6b8('0x19')](handleEntityNotFound(_0x53f269,null))[_0xf6b8('0x19')](function(_0x30d861){if(_0x30d861){_0x12c404[_0xf6b8('0x38')]=_[_0xf6b8('0x6c')](db[_0xf6b8('0xbf')]['rawAttributes']);_0x12c404[_0xf6b8('0x39')]=_[_0xf6b8('0x6c')](_0x8854a1[_0xf6b8('0x39')]);_0x12c404[_0xf6b8('0x3a')]=_[_0xf6b8('0x3b')](_0x12c404[_0xf6b8('0x38')],_0x12c404[_0xf6b8('0x39')]);_0x519957[_0xf6b8('0x3c')]=_[_0xf6b8('0x3b')](_0x12c404[_0xf6b8('0x38')],qs['fields'](_0x8854a1['query'][_0xf6b8('0x3d')]));_0x519957[_0xf6b8('0x3c')]=_0x519957[_0xf6b8('0x3c')][_0xf6b8('0x3e')]?_0x519957['attributes']:_0x12c404['model'];if(!_0x8854a1['query'][_0xf6b8('0x3f')](_0xf6b8('0x40'))){_0x519957[_0xf6b8('0x15')]=qs[_0xf6b8('0x15')](_0x8854a1[_0xf6b8('0x39')]['limit']);_0x519957[_0xf6b8('0x14')]=qs[_0xf6b8('0x14')](_0x8854a1[_0xf6b8('0x39')][_0xf6b8('0x14')]);}_0x519957[_0xf6b8('0x41')]=qs[_0xf6b8('0x42')](_0x8854a1[_0xf6b8('0x39')][_0xf6b8('0x42')]);_0x519957[_0xf6b8('0x71')]=qs[_0xf6b8('0x3a')](_[_0xf6b8('0xc4')](_0x8854a1[_0xf6b8('0x39')],_0x12c404[_0xf6b8('0x3a')]));_0x519957[_0xf6b8('0x71')]['MailInteractionId']=_0x30d861['id'];if(_0x8854a1[_0xf6b8('0x39')][_0xf6b8('0x7f')]){_0x519957[_0xf6b8('0x71')]=_['merge'](_0x519957['where'],{'$or':_[_0xf6b8('0x1f')](_0x519957[_0xf6b8('0x3c')],function(_0x575ebf){var _0x423c1d={};_0x423c1d[_0x575ebf]={'$like':'%'+_0x8854a1[_0xf6b8('0x39')]['filter']+'%'};return _0x423c1d;})});}if(_0x8854a1['query']['$gte']){var _0x586d37=_0x8854a1[_0xf6b8('0x39')][_0xf6b8('0x76')]['split'](',');var _0x5bae6b={};_0x5bae6b[_0x586d37[0x0]]={'$gte':moment(_0x586d37[0x1])[_0xf6b8('0xc5')](_0xf6b8('0xc6'))};_0x519957[_0xf6b8('0x71')]=_[_0xf6b8('0xba')](_0x519957['where'],_0x5bae6b);}_0x519957=_['merge']({},_0x519957,_0x8854a1[_0xf6b8('0xc7')]);return db['MailMessage'][_0xf6b8('0x16')]({'where':_0x519957[_0xf6b8('0x71')]})[_0xf6b8('0x19')](function(_0x406285){_0xd4478[_0xf6b8('0x16')]=_0x406285;if(_0x8854a1[_0xf6b8('0x39')]['includeAll']){_0x519957[_0xf6b8('0xc8')]=[{'all':!![]}];}return db[_0xf6b8('0xbf')][_0xf6b8('0xc9')](_0x519957);})[_0xf6b8('0x19')](function(_0x3c9c1c){if(_0x8854a1[_0xf6b8('0x39')][_0xf6b8('0xca')]===_0xf6b8('0xcb')){for(var _0x5916ea=0x0;_0x5916ea<_0x3c9c1c['length'];_0x5916ea++){_0x3c9c1c[_0x5916ea]['body']=juice(_0x3c9c1c[_0x5916ea][_0xf6b8('0xbc')]);}}_0xd4478[_0xf6b8('0xcc')]=_0x3c9c1c;return _0xd4478;});}})['then'](respondWithFilteredResult(_0x53f269,_0x519957))['catch'](handleError(_0x53f269,null));};exports[_0xf6b8('0xcd')]=function(_0x590714,_0x36a819){return db[_0xf6b8('0x33')]['find']({'where':{'id':_0x590714[_0xf6b8('0xbd')]['id']}})[_0xf6b8('0x19')](handleEntityNotFound(_0x36a819,null))[_0xf6b8('0x19')](function(_0x11651e){if(_0x11651e){return _0x11651e[_0xf6b8('0xce')](_0x590714[_0xf6b8('0xbc')]['ids'],_['omit'](_0x590714[_0xf6b8('0xbc')],[_0xf6b8('0xc1'),'id'])||{})[_0xf6b8('0xcf')](function(){return db[_0xf6b8('0x69')][_0xf6b8('0xc9')]({'attributes':['id',_0xf6b8('0x1d'),_0xf6b8('0x45')],'where':{'id':_0x590714[_0xf6b8('0xbc')]['ids']}});})[_0xf6b8('0x19')](function(_0x1aa2d7){socket[_0xf6b8('0xd0')](_0xf6b8('0xd1'),{'id':Number(_0x590714[_0xf6b8('0xbd')]['id']),'tags':_0x1aa2d7||[]});return{'id':Number(_0x590714['params']['id']),'tags':_0x1aa2d7||[]};});}})[_0xf6b8('0x19')](respondWithResult(_0x36a819,null))['catch'](handleError(_0x36a819,null));};exports[_0xf6b8('0xd2')]=function(_0x4de575,_0x35bb22){return db[_0xf6b8('0x33')][_0xf6b8('0x5a')]({'where':{'id':_0x4de575['params']['id']}})[_0xf6b8('0x19')](handleEntityNotFound(_0x35bb22,null))[_0xf6b8('0x19')](function(_0x23f4c7){if(_0x23f4c7){return _0x23f4c7[_0xf6b8('0xd2')](_0x4de575[_0xf6b8('0x39')][_0xf6b8('0xc1')]);}})[_0xf6b8('0x19')](respondWithStatusCode(_0x35bb22,null))['catch'](handleError(_0x35bb22,null));};exports[_0xf6b8('0xd3')]=function(_0x482165,_0x54be28){var _0x5c29b3=moment()['unix']()[_0xf6b8('0x93')]();var _0x33246d=path['join'](config[_0xf6b8('0xd4')],_0xf6b8('0xd5'),_0xf6b8('0xd6'),_0xf6b8('0xd7'));var _0x542397=path[_0xf6b8('0xd8')](config[_0xf6b8('0xd4')],'server',_0xf6b8('0xd6'),_0xf6b8('0xd9'));var _0x366209=path[_0xf6b8('0xd8')](_0x33246d,_0x5c29b3);var _0x23e062=util[_0xf6b8('0xc5')](_0xf6b8('0xda'),_0x482165[_0xf6b8('0xbd')]['id'],_0x5c29b3);var _0x1108f3=path['join'](_0x33246d,_0x23e062);var _0x4a14d6=[];if(_0x482165[_0xf6b8('0x39')][_0xf6b8('0xd9')]){_0x4a14d6[_0xf6b8('0x25')]({'model':db['Attachment'],'as':_0xf6b8('0xdb'),'raw':!![]});}var _0x5b7b3a=[{'model':db['MailMessage'],'as':_0xf6b8('0xdc'),'attributes':['id','body',_0xf6b8('0x46'),'to','cc',_0xf6b8('0xdd'),_0xf6b8('0xde'),'createdAt'],'where':{'secret':![]},'order':qs[_0xf6b8('0x42')]('id'),'include':_0x4a14d6}];return db[_0xf6b8('0x33')]['find']({'where':{'id':_0x482165[_0xf6b8('0xbd')]['id']},'include':_0x5b7b3a})['then'](handleEntityNotFound(_0x54be28,null))[_0xf6b8('0x19')](function(_0x1a7208){if(_0x1a7208&&_0x1a7208[_0xf6b8('0xdc')]){var _0x4c54e6=_0x1a7208[_0xf6b8('0xdf')]({'plain':!![]});fs[_0xf6b8('0xe0')](_0x366209);return BPromise['each'](_0x4c54e6['Messages'],function(_0x2f0cd2,_0x3cf389){var _0x284dc8={'from':_0x2f0cd2[_0xf6b8('0x46')],'to':_0x2f0cd2['to'],'subject':_0x2f0cd2[_0xf6b8('0xde')],'html':htmlEntities[_0xf6b8('0xe1')](_0x2f0cd2['body']),'headers':{'Date':moment(_0x2f0cd2[_0xf6b8('0x74')])[_0xf6b8('0xc5')](_0xf6b8('0xe2'))},'attachments':[]};if(_0x2f0cd2['cc']){_0x284dc8[_0xf6b8('0xe3')]['Cc']=_0x2f0cd2['cc'];}if(_0x2f0cd2[_0xf6b8('0xdd')]){_0x284dc8[_0xf6b8('0xe3')][_0xf6b8('0xe4')]=_0x2f0cd2['bcc'];}return new BPromise(function(_0x59df7d,_0x4c1076){if(_0x2f0cd2[_0xf6b8('0xdb')]){for(var _0xe51ee7=0x0;_0xe51ee7<_0x2f0cd2[_0xf6b8('0xdb')][_0xf6b8('0x3e')];_0xe51ee7++){var _0x213e33=_0x2f0cd2[_0xf6b8('0xdb')][_0xe51ee7];var _0x50d97a=path[_0xf6b8('0xd8')](_0x542397,_0x213e33[_0xf6b8('0xe5')]);if(fs[_0xf6b8('0xe6')](_0x50d97a)){_0x284dc8[_0xf6b8('0xd9')][_0xf6b8('0x25')]({'name':_0x213e33[_0xf6b8('0x1d')],'contentType':_0x213e33['type'],'data':fs['readFileSync'](_0x50d97a)});}}}emlformat[_0xf6b8('0xe7')](_0x284dc8,function(_0x112e0a,_0x503869){if(_0x112e0a)return _0x4c1076(_0x112e0a);fs[_0xf6b8('0xe8')](path['join'](_0x366209,util['format'](_0xf6b8('0xe9'),_0x3cf389)),_0x503869);return _0x59df7d(_0x503869);});});})[_0xf6b8('0x19')](function(){return new BPromise(function(_0x1d05a,_0x5bd37d){zipdir(_0x366209,{'saveTo':_0x1108f3},function(_0x4033ca,_0x30b91a){if(_0x4033ca)return _0x5bd37d(_0x4033ca);return _0x1d05a(_0x30b91a);});})[_0xf6b8('0x19')](function(){return new BPromise(function(_0x78873c,_0x1dc111){rimraf(_0x366209,function(_0x42c7ff){if(_0x42c7ff)_0x1dc111(_0x42c7ff);return _0x78873c();});});})['then'](function(){return _0x54be28[_0xf6b8('0xd3')](_0x1108f3,_0x23e062,function(_0x4b93a5){if(!_0x4b93a5)fs['unlinkSync'](_0x1108f3);});});});}else{return _0x54be28[_0xf6b8('0x1b')](0xc8);}})[_0xf6b8('0x2a')](handleError(_0x54be28,null));}; \ No newline at end of file +var _0xabce=['addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','unix','join','root','server','files','attachments','format','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','createdAt','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','lodash','squel','juice','../../components/parsers/advancedSearch','api','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','undefined','limit','count','set','Content-Range','json','then','stack','name','Users','map','fullname','TagIds','split','Tags','push','MailMessage','out','-id','plainBody','lastMsgText','trimStart','catch','waiting','answered','unmanaged','total','closed','UserId','talking','index','MailInteraction','rawAttributes','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','select','field','color','from','u.id','u.fullname','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','type','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','isEmpty','concat','parse','$gte','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','unreadMessages','contactName','DESC','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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.id','i.createdAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','findOne','enableEmailPreview','all','rows','show','includeAll','create','body','update','destroy','params','describe','addMessage','ids','omit','getMessages','MailInteractionId','merge','options','findAll','inlineCss','true'];(function(_0x49fcfb,_0x504dec){var _0x964926=function(_0x327977){while(--_0x327977){_0x49fcfb['push'](_0x49fcfb['shift']());}};_0x964926(++_0x504dec);}(_0xabce,0x103));var _0xeabc=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xabce[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var moment=require(_0xeabc('0x3'));var BPromise=require(_0xeabc('0x4'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0xeabc('0x5'));var squel=require(_0xeabc('0x6'));var juice=require(_0xeabc('0x7'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0xeabc('0x8'));var logger=require('../../config/logger')(_0xeabc('0x9'));var config=require('../../config/environment');var db=require(_0xeabc('0xa'))['db'];var htmlEntities=require(_0xeabc('0xb'));config[_0xeabc('0xc')]=_['defaults'](config[_0xeabc('0xc')],{'host':_0xeabc('0xd'),'port':0x18eb});var socket=require(_0xeabc('0xe'))(new Redis(config[_0xeabc('0xc')]));require(_0xeabc('0xf'))[_0xeabc('0x10')](socket);function respondWithStatusCode(_0x111aaf,_0x28292c){_0x28292c=_0x28292c||0xcc;return function(_0xdb5022){if(_0xdb5022){return _0x111aaf[_0xeabc('0x11')](_0x28292c);}return _0x111aaf[_0xeabc('0x12')](_0x28292c)[_0xeabc('0x13')]();};}function respondWithResult(_0x435ea7,_0x3fd0b5){_0x3fd0b5=_0x3fd0b5||0xc8;return function(_0x36a92e){if(_0x36a92e){return _0x435ea7[_0xeabc('0x12')](_0x3fd0b5)['json'](_0x36a92e);}};}function respondWithFilteredResult(_0x235c2d,_0x1319f3){return function(_0x3251c6){if(_0x3251c6){var _0x55f0de=typeof _0x1319f3['offset']===_0xeabc('0x14')&&typeof _0x1319f3[_0xeabc('0x15')]===_0xeabc('0x14');var _0x53d5cb=_0x3251c6[_0xeabc('0x16')];var _0x638976=_0x55f0de?0x0:_0x1319f3['offset'];var _0x53fe28=_0x55f0de?_0x3251c6[_0xeabc('0x16')]:_0x1319f3['offset']+_0x1319f3[_0xeabc('0x15')];var _0x1b64b9;if(_0x53fe28>=_0x53d5cb){_0x53fe28=_0x53d5cb;_0x1b64b9=0xc8;}else{_0x1b64b9=0xce;}_0x235c2d[_0xeabc('0x12')](_0x1b64b9);return _0x235c2d[_0xeabc('0x17')](_0xeabc('0x18'),_0x638976+'-'+_0x53fe28+'/'+_0x53d5cb)[_0xeabc('0x19')](_0x3251c6);}return null;};}function saveUpdates(_0x384be5){return function(_0x5e30ee){if(_0x5e30ee){return _0x5e30ee['update'](_0x384be5)[_0xeabc('0x1a')](function(_0x4d68ea){return _0x4d68ea;});}return null;};}function removeEntity(_0x31201a){return function(_0x16530c){if(_0x16530c){return _0x16530c['destroy']()[_0xeabc('0x1a')](function(){_0x31201a[_0xeabc('0x12')](0xcc)[_0xeabc('0x13')]();});}};}function handleEntityNotFound(_0x184e60){return function(_0x3c9611){if(!_0x3c9611){_0x184e60['sendStatus'](0x194);}return _0x3c9611;};}function handleError(_0xecdbf,_0x10c675){_0x10c675=_0x10c675||0x1f4;return function(_0x91ab00){logger['error'](_0x91ab00[_0xeabc('0x1b')]);if(_0x91ab00[_0xeabc('0x1c')]){delete _0x91ab00[_0xeabc('0x1c')];}_0xecdbf[_0xeabc('0x12')](_0x10c675)['send'](_0x91ab00);};}function getInteractionUsers(_0x109e1d,_0x480440){return new BPromise(function(_0x27dbaf,_0x4d4e29){try{if(_0x480440[_0x109e1d['id']]){_0x109e1d[_0xeabc('0x1d')]=_[_0xeabc('0x1e')](_0x480440[_0x109e1d['id']],function(_0x269621){return{'id':_0x269621['id'],'fullname':_0x269621[_0xeabc('0x1f')]};});}}catch(_0x3a1a04){_0x4d4e29(_0x3a1a04);}_0x27dbaf(_0x109e1d);});}function getInteractionTags(_0x137293,_0x131722){return new BPromise(function(_0x4c2693,_0x5b2934){try{if(_0x137293[_0xeabc('0x20')]){_0x137293['Tags']=[];_0x137293[_0xeabc('0x20')][_0xeabc('0x21')](',')['forEach'](function(_0x2163e6){_0x137293[_0xeabc('0x22')][_0xeabc('0x23')](_0x131722[_0x2163e6]);});}delete _0x137293[_0xeabc('0x20')];}catch(_0x149170){_0x5b2934(_0x149170);}_0x4c2693(_0x137293);});}function getLastMessageText(_0x481ee1){return new BPromise(function(_0x2c62fe,_0x38dc0a){return db[_0xeabc('0x24')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x481ee1['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xeabc('0x25')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xeabc('0x26'),'raw':!![]})[_0xeabc('0x1a')](function(_0x98b445){if(_0x98b445&&_0x98b445[_0xeabc('0x27')]){_0x481ee1[_0xeabc('0x28')]=_[_0xeabc('0x29')](_0x98b445[_0xeabc('0x27')]);}_0x2c62fe(_0x481ee1);})['catch'](function(_0x78510a){_0x38dc0a(_0x78510a);});});}function updateMailInteraction(_0x2df9e6,_0x3bc45e,_0x4918e2,_0x1e74ca){return new BPromise(function(_0x3777c1,_0x4492fd){return getInteractionUsers(_0x2df9e6,_0x4918e2)['then'](function(_0xc0a5b0){return getInteractionTags(_0xc0a5b0,_0x3bc45e);})[_0xeabc('0x1a')](function(_0x1f910d){return getStateInteraction(_0x1f910d);})['then'](function(_0xf98c7c){if(_0x1e74ca){_0x3777c1(getLastMessageText(_0xf98c7c));}else{_0x3777c1(_0xf98c7c);}})[_0xeabc('0x2a')](function(_0x5d9acf){_0x4492fd(_0x5d9acf);});});}function getStateInteraction(_0x50cca2){return new BPromise(function(_0x254568){_0x50cca2[_0xeabc('0x2b')]=0x0;_0x50cca2['talking']=0x0;_0x50cca2[_0xeabc('0x2c')]=0x0;_0x50cca2[_0xeabc('0x2d')]=0x0;_0x50cca2[_0xeabc('0x2e')]=0x0;if(!_0x50cca2[_0xeabc('0x2f')]&&!_0x50cca2[_0xeabc('0x30')]){_0x50cca2['waiting']+=0x1;}if(!_0x50cca2[_0xeabc('0x2f')]&&_0x50cca2['UserId']){_0x50cca2[_0xeabc('0x31')]+=0x1;if(_0x50cca2[_0xeabc('0x2b')]){_0x50cca2[_0xeabc('0x2b')]-=0x1;}}if(_0x50cca2['closed']&&_0x50cca2['UserId']){_0x50cca2[_0xeabc('0x2c')]+=0x1;if(_0x50cca2['talking']){_0x50cca2[_0xeabc('0x31')]-=0x1;}}if(_0x50cca2['closed']&&!_0x50cca2['UserId']){_0x50cca2['unmanaged']+=0x1;if(_0x50cca2['waiting']){_0x50cca2[_0xeabc('0x2b')]-=0x1;}}_0x50cca2['total']+=0x1;_0x254568(_0x50cca2);});}exports[_0xeabc('0x32')]=function(_0x1ebfb6,_0x5c7302){var _0xe8fa6e={},_0x4a8415={},_0x3d48f4={'count':0x0,'rows':[]};var _0x58aafe=_[_0xeabc('0x1e')](db[_0xeabc('0x33')][_0xeabc('0x34')],function(_0x5d8ae4){return{'name':_0x5d8ae4['fieldName'],'type':_0x5d8ae4['type'][_0xeabc('0x35')]};});_0x4a8415[_0xeabc('0x36')]=_[_0xeabc('0x1e')](_0x58aafe,'name');_0x4a8415['query']=_[_0xeabc('0x37')](_0x1ebfb6[_0xeabc('0x38')]);_0x4a8415['filters']=_[_0xeabc('0x39')](_0x4a8415['model'],_0x4a8415[_0xeabc('0x38')]);_0xe8fa6e['attributes']=_['intersection'](_0x4a8415['model'],qs[_0xeabc('0x3a')](_0x1ebfb6[_0xeabc('0x38')][_0xeabc('0x3a')]));_0xe8fa6e[_0xeabc('0x3b')]=_0xe8fa6e['attributes'][_0xeabc('0x3c')]?_0xe8fa6e['attributes']:_0x4a8415[_0xeabc('0x36')];if(!_0x1ebfb6[_0xeabc('0x38')][_0xeabc('0x3d')](_0xeabc('0x3e'))){_0xe8fa6e[_0xeabc('0x15')]=qs['limit'](_0x1ebfb6['query'][_0xeabc('0x15')]);_0xe8fa6e['offset']=qs[_0xeabc('0x3f')](_0x1ebfb6[_0xeabc('0x38')]['offset']);}_0xe8fa6e[_0xeabc('0x40')]=qs[_0xeabc('0x41')](_0x1ebfb6[_0xeabc('0x38')][_0xeabc('0x41')]);_0xe8fa6e[_0xeabc('0x42')]=qs[_0xeabc('0x43')](_[_0xeabc('0x44')](_0x1ebfb6['query'],_0x4a8415[_0xeabc('0x43')]),_0x58aafe);var _0x2c85f0=[];var _0x2e7a5e=squel[_0xeabc('0x45')]()[_0xeabc('0x46')]('id')[_0xeabc('0x46')](_0xeabc('0x1c'))[_0xeabc('0x46')](_0xeabc('0x47'))[_0xeabc('0x48')]('tools_tags');var _0x38356c=squel[_0xeabc('0x45')]()[_0xeabc('0x46')](_0xeabc('0x49'))[_0xeabc('0x46')](_0xeabc('0x4a'))[_0xeabc('0x46')]('ui.MailInteractionId')[_0xeabc('0x48')](_0xeabc('0x4b'),'ui')[_0xeabc('0x4c')](_0xeabc('0x4d'),'u',_0xeabc('0x4e'));var _0x58e2c1=squel[_0xeabc('0x45')]()[_0xeabc('0x48')](_0xeabc('0x4f'),'i')[_0xeabc('0x4c')]('cm_contacts','c',_0xeabc('0x50'))[_0xeabc('0x4c')]('users','o',_0xeabc('0x51'))['left_join'](_0xeabc('0x52'),'a','a.id\x20=\x20i.MailAccountId')[_0xeabc('0x4c')](_0xeabc('0x53'),'me',_0xeabc('0x54'))[_0xeabc('0x4c')](_0xeabc('0x55'),'it',_0xeabc('0x56'))[_0xeabc('0x4c')](_0xeabc('0x57'),'t',_0xeabc('0x58'));var _0x6423f3=squel['expr']();var _0x180a14=[];var _0x2537ab=squel[_0xeabc('0x59')]();var _0x2ebd58;if(_0x1ebfb6['query'][_0xeabc('0x5a')]){_0x2ebd58=as[_0xeabc('0x5b')](_0x1ebfb6[_0xeabc('0x38')][_0xeabc('0x5a')]);var _0x5f2d2f=_0x2ebd58[_0xeabc('0x5c')];for(var _0x1c7679=0x0;_0x1c7679<_0x2ebd58[_0xeabc('0x5d')][_0xeabc('0x3c')];_0x1c7679++){var _0x33f1c1=_0x2ebd58[_0xeabc('0x5d')][_0x1c7679];var _0x14c322='i';var _0x3ff38c=_[_0xeabc('0x5e')](_0x58aafe,['name',_0x33f1c1[_0xeabc('0x46')]]);if(!_0x3ff38c){switch(_0x33f1c1['field']){case'unreadMessages':if(_0x33f1c1['value']==0x1){_0x58e2c1[_0xeabc('0x5f')]('`'+_0x33f1c1[_0xeabc('0x46')]+_0xeabc('0x60'));}else{_0x58e2c1[_0xeabc('0x5f')]('`'+_0x33f1c1[_0xeabc('0x46')]+_0xeabc('0x61'));}break;case'Contact':if(_0x33f1c1[_0xeabc('0x62')]===_0xeabc('0x63')){if(_0x33f1c1[_0xeabc('0x64')][_0xeabc('0x21')]('\x20')[_0xeabc('0x3c')]>0x1){_0x6423f3[_0x5f2d2f](_0xeabc('0x65'),qs[_0xeabc('0x66')](_0x33f1c1[_0xeabc('0x64')]),null);}else{var _0x5820ca='%'+_0x33f1c1['value']+'%';_0x6423f3[_0x5f2d2f](_0xeabc('0x67'),_0x5820ca,_0x5820ca,_0x5820ca);}}else{_0x3ff38c=_[_0xeabc('0x5e')](_0x58aafe,[_0xeabc('0x1c'),'ContactId']);_0x33f1c1[_0xeabc('0x46')]='ContactId';_0x41cad5=as['buildExpression'](_0x14c322,_0x3ff38c[_0xeabc('0x68')],_0x33f1c1);_0x6423f3[_0x5f2d2f](_0x41cad5[_0xeabc('0x69')],_0x41cad5[_0xeabc('0x64')][_0xeabc('0x6a')],_0x41cad5[_0xeabc('0x64')][_0xeabc('0x13')]);}break;case'Tag':var _0x3d2c37=_0x33f1c1[_0xeabc('0x64')][_0xeabc('0x21')](',')[_0xeabc('0x1e')](function(_0x11cc1f){return Number(_0x11cc1f);});_0x3d2c37[_0xeabc('0x6b')](function(_0x5c61b4){_0x2537ab['or'](_0xeabc('0x6c'),'%,'+_0x5c61b4+',%');});_0x180a14=_[_0xeabc('0x6d')](_0x180a14,_0x3d2c37);break;case _0xeabc('0x6e'):if(_0x33f1c1[_0xeabc('0x62')]===_0xeabc('0x63')){_0x6423f3[_0x5f2d2f](_0xeabc('0x6f'),'%'+_0x33f1c1[_0xeabc('0x64')]+'%',null);}else{_0x3ff38c=_[_0xeabc('0x5e')](_0x58aafe,[_0xeabc('0x1c'),'UserId']);_0x33f1c1[_0xeabc('0x46')]='UserId';_0x41cad5=as[_0xeabc('0x70')](_0x14c322,_0x3ff38c[_0xeabc('0x68')],_0x33f1c1);_0x6423f3[_0x5f2d2f](_0x41cad5[_0xeabc('0x69')],_0x41cad5[_0xeabc('0x64')][_0xeabc('0x6a')],_0x41cad5[_0xeabc('0x64')][_0xeabc('0x13')]);}break;case _0xeabc('0x27'):_0x41cad5=as[_0xeabc('0x70')]('me',null,_0x33f1c1);_0x6423f3[_0x5f2d2f](_0x41cad5[_0xeabc('0x69')],_0x41cad5['value'][_0xeabc('0x6a')],_0x41cad5[_0xeabc('0x64')][_0xeabc('0x13')]);break;}}else{var _0x41cad5=as['buildExpression'](_0x14c322,_0x3ff38c[_0xeabc('0x68')],_0x33f1c1);_0x6423f3[_0x5f2d2f](_0x41cad5['text'],_0x41cad5['value'][_0xeabc('0x6a')],_0x41cad5[_0xeabc('0x64')][_0xeabc('0x13')]);}}}else{var _0x1c91e4=_(_0x1ebfb6['query'])['keys']()[_0xeabc('0x1e')](function(_0x4ce3f4){return _['some'](_0x58aafe,[_0xeabc('0x1c'),_0x4ce3f4])?_0x4ce3f4:undefined;})['compact']()['value']();if(!_[_0xeabc('0x71')](_0x1c91e4)){_0x1c91e4[_0xeabc('0x6b')](function(_0x5613ef){if(_0x5613ef==='MailAccountId'){_0x58e2c1[_0xeabc('0x42')]('i.MailAccountId\x20IN\x20?',[][_0xeabc('0x72')](_0x1ebfb6[_0xeabc('0x38')][_0x5613ef]));}else if(_0x5613ef==='createdAt'){var _0x5d6477=JSON[_0xeabc('0x73')](_0x1ebfb6[_0xeabc('0x38')][_0x5613ef])[_0xeabc('0x74')];var _0x471cb6=JSON[_0xeabc('0x73')](_0x1ebfb6['query'][_0x5613ef])['$lte'];_0x58e2c1[_0xeabc('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5d6477,_0x471cb6);}else{if(_0x1ebfb6[_0xeabc('0x38')][_0x5613ef]==='null'){_0x58e2c1[_0xeabc('0x42')]('i.'+_0x5613ef+'\x20IS\x20NULL');}else{_0x58e2c1[_0xeabc('0x42')]('i.'+_0x5613ef+'\x20=\x20?',_0x1ebfb6[_0xeabc('0x38')][_0x5613ef]);}}});}if(_0x1ebfb6[_0xeabc('0x38')][_0xeabc('0x75')]){if(_0x1ebfb6[_0xeabc('0x38')]['read']==0x1){_0x58e2c1[_0xeabc('0x5f')]('`unreadMessages`\x20=\x200');}else{_0x58e2c1[_0xeabc('0x5f')](_0xeabc('0x76'));}}if(_0x1ebfb6[_0xeabc('0x38')][_0xeabc('0x77')]){_0x180a14=_[_0xeabc('0x78')](_0x1ebfb6['query'][_0xeabc('0x77')])?_0x1ebfb6[_0xeabc('0x38')][_0xeabc('0x77')]:new Array(_0x1ebfb6[_0xeabc('0x38')]['tag']);_0x180a14[_0xeabc('0x6b')](function(_0x158f2a){_0x2537ab['or'](_0xeabc('0x6c'),'%,'+_0x158f2a+',%');});}if(_0x1ebfb6[_0xeabc('0x38')]['filter']){var _0xb9b460=_0x1ebfb6[_0xeabc('0x38')][_0xeabc('0x79')][_0xeabc('0x7a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0xb9b460)){_0x6423f3['or'](_0xeabc('0x7b'),_0xb9b460+'%');}else if(qs['isEmail'](_0xb9b460)){_0x6423f3['or']('c.email\x20LIKE\x20?',_0xb9b460+'%');}else{_0x6423f3['or'](_0xeabc('0x7c'),qs[_0xeabc('0x66')](_0xb9b460))['or'](_0xeabc('0x7d'),qs['getFullTextValue'](_0xb9b460));}}}_0x58e2c1[_0xeabc('0x42')](_0x6423f3);_0x58e2c1[_0xeabc('0x7e')]('i.id');var _0x3d1d12={'type':db[_0xeabc('0x7f')][_0xeabc('0x80')][_0xeabc('0x81')],'raw':!![]};var _0x2ece2c=_0x58e2c1['clone']();_0x2ece2c[_0xeabc('0x46')]('i.id');_0x2ece2c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xeabc('0x82'));if(_0xe8fa6e[_0xeabc('0x40')]){_0xe8fa6e[_0xeabc('0x40')][_0xeabc('0x6b')](function(_0x33fa74){var _0x51368f=_0x33fa74[0x0]===_0xeabc('0x83')?_0x33fa74[0x0]:'i.'+_0x33fa74[0x0];_0x58e2c1['order'](_0x51368f,_0x33fa74[0x1]===_0xeabc('0x84')?![]:!![]);});}if(!_[_0xeabc('0x71')](_0x180a14)){_0x58e2c1['having'](_0x2537ab);_0x2ece2c[_0xeabc('0x42')]('t.id\x20IN\x20?',_0x180a14);}BPromise['resolve']()[_0xeabc('0x1a')](function(){if(!_0x2ebd58){if(_0x1ebfb6[_0xeabc('0x38')][_0xeabc('0x85')])return;_0x2ece2c[_0xeabc('0x42')](_0xeabc('0x86'));_0x58e2c1['where'](_0xeabc('0x86'));return;}if(_0x1ebfb6[_0xeabc('0x87')][_0xeabc('0x88')]!==_0xeabc('0x89'))return;return _0x1ebfb6[_0xeabc('0x87')][_0xeabc('0x8a')]({'attributes':['id'],'raw':!![]})[_0xeabc('0x1a')](function(_0x419fc6){if(_[_0xeabc('0x71')](_0x419fc6)){_0x2ece2c[_0xeabc('0x42')]('i.MailAccountId\x20IS\x20NULL');_0x58e2c1[_0xeabc('0x42')](_0xeabc('0x8b'));}else{_0x2ece2c[_0xeabc('0x42')]('i.MailAccountId\x20IN\x20?',_['map'](_0x419fc6,'id'));_0x58e2c1[_0xeabc('0x42')](_0xeabc('0x8c'),_[_0xeabc('0x1e')](_0x419fc6,'id'));}});})[_0xeabc('0x1a')](function(){if(_0x1ebfb6[_0xeabc('0x87')]['role']===_0xeabc('0x89')&&!_0x2ebd58&&!_0x1ebfb6['query']['MailAccountId'])return[];return db[_0xeabc('0x8d')][_0xeabc('0x38')](_0x2ece2c['toString'](),_0x3d1d12);})[_0xeabc('0x1a')](function(_0x45c9c7){_0x3d48f4[_0xeabc('0x16')]=_0x45c9c7[_0xeabc('0x3c')];if(_0x3d48f4[_0xeabc('0x16')]===0x0)return[];return db[_0xeabc('0x8d')][_0xeabc('0x38')](_0x2e7a5e[_0xeabc('0x8e')](),_0x3d1d12)[_0xeabc('0x1a')](function(_0x1b0995){_0x2c85f0=_[_0xeabc('0x8f')](_0x1b0995,'id');_0x3d1d12=_['merge'](_0x3d1d12,{'model':db[_0xeabc('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1ebfb6['query'][_0xeabc('0x3a')]){_0xe8fa6e[_0xeabc('0x3b')][_0xeabc('0x6b')](function(_0x2d1441){_0x58e2c1[_0xeabc('0x46')]('i.'+_0x2d1441);});}else{_0x58e2c1[_0xeabc('0x46')](_0xeabc('0x90'),_0xeabc('0x82'));_0x58e2c1[_0xeabc('0x46')](_0xeabc('0x91'),_0xeabc('0x92'));_0x58e2c1['field'](_0xeabc('0x93'),_0xeabc('0x94'));_0x58e2c1[_0xeabc('0x46')](_0xeabc('0x95'),'contactName');_0x58e2c1[_0xeabc('0x46')](_0xeabc('0x96'));_0x58e2c1['field'](_0xeabc('0x97'));_0x58e2c1[_0xeabc('0x46')]('i.updatedAt');_0x58e2c1['field']('i.closed');_0x58e2c1['field'](_0xeabc('0x98'));_0x58e2c1[_0xeabc('0x46')](_0xeabc('0x99'));_0x58e2c1[_0xeabc('0x46')](_0xeabc('0x9a'));_0x58e2c1[_0xeabc('0x46')](_0xeabc('0x9b'));_0x58e2c1[_0xeabc('0x46')](_0xeabc('0x9c'));_0x58e2c1[_0xeabc('0x46')]('i.disposition');_0x58e2c1[_0xeabc('0x46')](_0xeabc('0x9d'));_0x58e2c1['field'](_0xeabc('0x9e'));_0x58e2c1[_0xeabc('0x46')](_0xeabc('0x9f'));_0x58e2c1['field'](_0xeabc('0xa0'));_0x58e2c1['field'](_0xeabc('0xa1'));_0x58e2c1[_0xeabc('0x46')](_0xeabc('0xa2'));_0x58e2c1[_0xeabc('0x46')](_0xeabc('0xa3'));_0x58e2c1['field']('c.firstName','Contact.firstName');_0x58e2c1['field'](_0xeabc('0xa4'),_0xeabc('0xa5'));_0x58e2c1[_0xeabc('0x46')]('c.email',_0xeabc('0xa6'));_0x58e2c1[_0xeabc('0x46')](_0xeabc('0xa7'),_0xeabc('0xa8'));_0x58e2c1[_0xeabc('0x46')](_0xeabc('0xa9'),_0xeabc('0xaa'));_0x58e2c1[_0xeabc('0x46')](_0xeabc('0xab'),_0xeabc('0xac'));_0x58e2c1[_0xeabc('0x46')](_0xeabc('0xad'),'Owner.fullname');_0x58e2c1['field'](_0xeabc('0xae'),'Owner.internal');_0x58e2c1[_0xeabc('0x46')](_0xeabc('0xaf'),_0xeabc('0x20'));}if(_0xe8fa6e['limit'])_0x58e2c1[_0xeabc('0x15')](_0xe8fa6e[_0xeabc('0x15')]);if(_0xe8fa6e[_0xeabc('0x3f')])_0x58e2c1['offset'](_0xe8fa6e['offset']);return db[_0xeabc('0x8d')][_0xeabc('0x38')](_0x58e2c1[_0xeabc('0x8e')](),_0x3d1d12);})[_0xeabc('0x1a')](function(_0x2cc9b3){if(_0x2cc9b3[_0xeabc('0x3c')]>0x0)_0x38356c['where']('ui.MailInteractionId\x20IN\x20?',_[_0xeabc('0x1e')](_0x2cc9b3,'id'));return db[_0xeabc('0x8d')][_0xeabc('0x38')](_0x38356c[_0xeabc('0x8e')](),_0x3d1d12)['then'](function(_0x5e97b5){var _0x4bf689=_[_0xeabc('0xb0')](_0x5e97b5,'MailInteractionId');var _0x14b2dc=[];return db['Setting'][_0xeabc('0xb1')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xeabc('0x1a')](function(_0xaea449){var _0x1fbc00=_0xaea449[_0xeabc('0xb2')];_0x2cc9b3[_0xeabc('0x6b')](function(_0x52183d){_0x14b2dc[_0xeabc('0x23')](updateMailInteraction(_0x52183d,_0x2c85f0,_0x4bf689,_0x1fbc00));});return BPromise[_0xeabc('0xb3')](_0x14b2dc);});});});})[_0xeabc('0x1a')](function(_0x52a885){_0x3d48f4[_0xeabc('0xb4')]=_0x52a885;return _0x3d48f4;})[_0xeabc('0x1a')](respondWithFilteredResult(_0x5c7302,_0xe8fa6e))[_0xeabc('0x2a')](handleError(_0x5c7302,null));};exports[_0xeabc('0xb5')]=function(_0x1aab38,_0x5168cd){var _0x1b9f6c={'raw':![],'where':{'id':_0x1aab38['params']['id']}},_0x418728={};_0x418728[_0xeabc('0x36')]=_[_0xeabc('0x37')](db['MailInteraction'][_0xeabc('0x34')]);_0x418728[_0xeabc('0x38')]=_[_0xeabc('0x37')](_0x1aab38[_0xeabc('0x38')]);_0x418728[_0xeabc('0x43')]=_[_0xeabc('0x39')](_0x418728[_0xeabc('0x36')],_0x418728[_0xeabc('0x38')]);_0x1b9f6c[_0xeabc('0x3b')]=_[_0xeabc('0x39')](_0x418728[_0xeabc('0x36')],qs[_0xeabc('0x3a')](_0x1aab38[_0xeabc('0x38')]['fields']));_0x1b9f6c['attributes']=_0x1b9f6c[_0xeabc('0x3b')][_0xeabc('0x3c')]?_0x1b9f6c[_0xeabc('0x3b')]:_0x418728[_0xeabc('0x36')];if(_0x1aab38['query'][_0xeabc('0xb6')]){_0x1b9f6c['include']=[{'all':!![]}];}_0x1b9f6c=_['merge']({},_0x1b9f6c,_0x1aab38['options']);return db['MailInteraction']['find'](_0x1b9f6c)['then'](handleEntityNotFound(_0x5168cd,null))[_0xeabc('0x1a')](respondWithResult(_0x5168cd,null))[_0xeabc('0x2a')](handleError(_0x5168cd,null));};exports[_0xeabc('0xb7')]=function(_0x3a013a,_0x1b3fc2){return db[_0xeabc('0x33')][_0xeabc('0xb7')](_0x3a013a[_0xeabc('0xb8')],{})[_0xeabc('0x1a')](respondWithResult(_0x1b3fc2,0xc9))['catch'](handleError(_0x1b3fc2,null));};exports[_0xeabc('0xb9')]=function(_0x10b35b,_0x233412){if(_0x10b35b[_0xeabc('0xb8')]['id']){delete _0x10b35b[_0xeabc('0xb8')]['id'];}return db[_0xeabc('0x33')][_0xeabc('0x5e')]({'where':{'id':_0x10b35b['params']['id']}})[_0xeabc('0x1a')](handleEntityNotFound(_0x233412,null))['then'](saveUpdates(_0x10b35b[_0xeabc('0xb8')],null))[_0xeabc('0x1a')](respondWithResult(_0x233412,null))['catch'](handleError(_0x233412,null));};exports[_0xeabc('0xba')]=function(_0x4c8bf3,_0x23529f){return db[_0xeabc('0x33')][_0xeabc('0x5e')]({'where':{'id':_0x4c8bf3[_0xeabc('0xbb')]['id']}})[_0xeabc('0x1a')](handleEntityNotFound(_0x23529f,null))[_0xeabc('0x1a')](removeEntity(_0x23529f,null))[_0xeabc('0x2a')](handleError(_0x23529f,null));};exports[_0xeabc('0xbc')]=function(_0x2316c5,_0x484c75){return db['MailInteraction'][_0xeabc('0xbc')]()[_0xeabc('0x1a')](respondWithResult(_0x484c75,null))['catch'](handleError(_0x484c75,null));};exports[_0xeabc('0xbd')]=function(_0x580f72,_0x37907a){return db[_0xeabc('0x24')][_0xeabc('0x5e')]({'where':{'id':_0x580f72[_0xeabc('0xbb')]['id']}})[_0xeabc('0x1a')](handleEntityNotFound(_0x37907a,null))[_0xeabc('0x1a')](function(_0x57db6d){if(_0x57db6d){return _0x57db6d[_0xeabc('0xbd')](_0x580f72['body'][_0xeabc('0xbe')],_[_0xeabc('0xbf')](_0x580f72[_0xeabc('0xb8')],[_0xeabc('0xbe'),'id'])||{});}})['then'](respondWithResult(_0x37907a,null))[_0xeabc('0x2a')](handleError(_0x37907a,null));};exports[_0xeabc('0xc0')]=function(_0x1823c5,_0x47b513){var _0x13601f={'raw':![],'where':{}};var _0x40f9a9={};var _0xf4ebc4={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x1823c5['params']['id']}})['then'](handleEntityNotFound(_0x47b513,null))[_0xeabc('0x1a')](function(_0x47702c){if(_0x47702c){_0x40f9a9['model']=_[_0xeabc('0x37')](db[_0xeabc('0x24')][_0xeabc('0x34')]);_0x40f9a9[_0xeabc('0x38')]=_[_0xeabc('0x37')](_0x1823c5[_0xeabc('0x38')]);_0x40f9a9[_0xeabc('0x43')]=_[_0xeabc('0x39')](_0x40f9a9[_0xeabc('0x36')],_0x40f9a9['query']);_0x13601f[_0xeabc('0x3b')]=_['intersection'](_0x40f9a9[_0xeabc('0x36')],qs[_0xeabc('0x3a')](_0x1823c5[_0xeabc('0x38')][_0xeabc('0x3a')]));_0x13601f[_0xeabc('0x3b')]=_0x13601f[_0xeabc('0x3b')][_0xeabc('0x3c')]?_0x13601f['attributes']:_0x40f9a9[_0xeabc('0x36')];if(!_0x1823c5['query'][_0xeabc('0x3d')]('nolimit')){_0x13601f[_0xeabc('0x15')]=qs[_0xeabc('0x15')](_0x1823c5[_0xeabc('0x38')][_0xeabc('0x15')]);_0x13601f[_0xeabc('0x3f')]=qs['offset'](_0x1823c5[_0xeabc('0x38')][_0xeabc('0x3f')]);}_0x13601f[_0xeabc('0x40')]=qs[_0xeabc('0x41')](_0x1823c5[_0xeabc('0x38')]['sort']);_0x13601f[_0xeabc('0x42')]=qs[_0xeabc('0x43')](_[_0xeabc('0x44')](_0x1823c5[_0xeabc('0x38')],_0x40f9a9[_0xeabc('0x43')]));_0x13601f['where'][_0xeabc('0xc1')]=_0x47702c['id'];if(_0x1823c5['query'][_0xeabc('0x79')]){_0x13601f[_0xeabc('0x42')]=_[_0xeabc('0xc2')](_0x13601f[_0xeabc('0x42')],{'$or':_[_0xeabc('0x1e')](_0x13601f[_0xeabc('0x3b')],function(_0x2a2917){var _0x3fad08={};_0x3fad08[_0x2a2917]={'$like':'%'+_0x1823c5[_0xeabc('0x38')][_0xeabc('0x79')]+'%'};return _0x3fad08;})});}if(_0x1823c5['query'][_0xeabc('0x74')]){var _0x36454c=_0x1823c5[_0xeabc('0x38')][_0xeabc('0x74')]['split'](',');var _0x2fa815={};_0x2fa815[_0x36454c[0x0]]={'$gte':moment(_0x36454c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x13601f[_0xeabc('0x42')]=_[_0xeabc('0xc2')](_0x13601f[_0xeabc('0x42')],_0x2fa815);}_0x13601f=_['merge']({},_0x13601f,_0x1823c5[_0xeabc('0xc3')]);return db[_0xeabc('0x24')][_0xeabc('0x16')]({'where':_0x13601f[_0xeabc('0x42')]})[_0xeabc('0x1a')](function(_0x5b85e9){_0xf4ebc4[_0xeabc('0x16')]=_0x5b85e9;if(_0x1823c5[_0xeabc('0x38')]['includeAll']){_0x13601f['include']=[{'all':!![]}];}return db[_0xeabc('0x24')][_0xeabc('0xc4')](_0x13601f);})[_0xeabc('0x1a')](function(_0x123050){if(_0x1823c5[_0xeabc('0x38')][_0xeabc('0xc5')]===_0xeabc('0xc6')){for(var _0x2775cf=0x0;_0x2775cf<_0x123050[_0xeabc('0x3c')];_0x2775cf++){_0x123050[_0x2775cf]['body']=juice(_0x123050[_0x2775cf][_0xeabc('0xb8')]);}}_0xf4ebc4['rows']=_0x123050;return _0xf4ebc4;});}})[_0xeabc('0x1a')](respondWithFilteredResult(_0x47b513,_0x13601f))['catch'](handleError(_0x47b513,null));};exports[_0xeabc('0xc7')]=function(_0x14a0aa,_0x18991b){return db[_0xeabc('0x33')][_0xeabc('0x5e')]({'where':{'id':_0x14a0aa[_0xeabc('0xbb')]['id']}})[_0xeabc('0x1a')](handleEntityNotFound(_0x18991b,null))[_0xeabc('0x1a')](function(_0x5be52d){if(_0x5be52d){return _0x5be52d[_0xeabc('0xc8')](_0x14a0aa['body']['ids'],_[_0xeabc('0xbf')](_0x14a0aa['body'],[_0xeabc('0xbe'),'id'])||{})[_0xeabc('0xc9')](function(){return db['Tag']['findAll']({'attributes':['id',_0xeabc('0x1c'),'color'],'where':{'id':_0x14a0aa['body'][_0xeabc('0xbe')]}});})['then'](function(_0x511bfc){socket[_0xeabc('0xca')](_0xeabc('0xcb'),{'id':Number(_0x14a0aa['params']['id']),'tags':_0x511bfc||[]});return{'id':Number(_0x14a0aa[_0xeabc('0xbb')]['id']),'tags':_0x511bfc||[]};});}})[_0xeabc('0x1a')](respondWithResult(_0x18991b,null))[_0xeabc('0x2a')](handleError(_0x18991b,null));};exports['removeTags']=function(_0x35316e,_0x265226){return db['MailInteraction'][_0xeabc('0x5e')]({'where':{'id':_0x35316e[_0xeabc('0xbb')]['id']}})[_0xeabc('0x1a')](handleEntityNotFound(_0x265226,null))[_0xeabc('0x1a')](function(_0x529f98){if(_0x529f98){return _0x529f98[_0xeabc('0xcc')](_0x35316e['query'][_0xeabc('0xbe')]);}})[_0xeabc('0x1a')](respondWithStatusCode(_0x265226,null))[_0xeabc('0x2a')](handleError(_0x265226,null));};exports['download']=function(_0x4eba8f,_0x6dff2a){var _0x23ca28=moment()[_0xeabc('0xcd')]()[_0xeabc('0x8e')]();var _0x40658b=path[_0xeabc('0xce')](config[_0xeabc('0xcf')],_0xeabc('0xd0'),'files','tmp');var _0x17f992=path['join'](config[_0xeabc('0xcf')],'server',_0xeabc('0xd1'),_0xeabc('0xd2'));var _0x406ce4=path[_0xeabc('0xce')](_0x40658b,_0x23ca28);var _0x16a837=util[_0xeabc('0xd3')](_0xeabc('0xd4'),_0x4eba8f[_0xeabc('0xbb')]['id'],_0x23ca28);var _0x4cb87b=path[_0xeabc('0xce')](_0x40658b,_0x16a837);var _0x16cbce=[];if(_0x4eba8f[_0xeabc('0x38')][_0xeabc('0xd2')]){_0x16cbce[_0xeabc('0x23')]({'model':db[_0xeabc('0xd5')],'as':_0xeabc('0xd6'),'raw':!![]});}var _0x38c445=[{'model':db[_0xeabc('0x24')],'as':_0xeabc('0xd7'),'attributes':['id',_0xeabc('0xb8'),_0xeabc('0x48'),'to','cc',_0xeabc('0xd8'),'subject',_0xeabc('0xd9')],'where':{'secret':![]},'order':qs[_0xeabc('0x41')]('id'),'include':_0x16cbce}];return db[_0xeabc('0x33')][_0xeabc('0x5e')]({'where':{'id':_0x4eba8f[_0xeabc('0xbb')]['id']},'include':_0x38c445})[_0xeabc('0x1a')](handleEntityNotFound(_0x6dff2a,null))[_0xeabc('0x1a')](function(_0x3716bf){if(_0x3716bf&&_0x3716bf[_0xeabc('0xd7')]){var _0x3283be=_0x3716bf['get']({'plain':!![]});fs[_0xeabc('0xda')](_0x406ce4);return BPromise[_0xeabc('0xdb')](_0x3283be['Messages'],function(_0x598105,_0x5fc21a){var _0x3ec519={'from':_0x598105[_0xeabc('0x48')],'to':_0x598105['to'],'subject':_0x598105['subject'],'html':htmlEntities[_0xeabc('0xdc')](_0x598105[_0xeabc('0xb8')]),'headers':{'Date':moment(_0x598105[_0xeabc('0xd9')])['format'](_0xeabc('0xdd'))},'attachments':[]};if(_0x598105['cc']){_0x3ec519[_0xeabc('0xde')]['Cc']=_0x598105['cc'];}if(_0x598105[_0xeabc('0xd8')]){_0x3ec519['headers'][_0xeabc('0xdf')]=_0x598105[_0xeabc('0xd8')];}return new BPromise(function(_0x541f18,_0x3fb41e){if(_0x598105['Attachments']){for(var _0x136dc2=0x0;_0x136dc2<_0x598105[_0xeabc('0xd6')]['length'];_0x136dc2++){var _0x576084=_0x598105['Attachments'][_0x136dc2];var _0x122f23=path[_0xeabc('0xce')](_0x17f992,_0x576084[_0xeabc('0xe0')]);if(fs['existsSync'](_0x122f23)){_0x3ec519['attachments']['push']({'name':_0x576084[_0xeabc('0x1c')],'contentType':_0x576084[_0xeabc('0x68')],'data':fs['readFileSync'](_0x122f23)});}}}emlformat[_0xeabc('0xe1')](_0x3ec519,function(_0x2671f5,_0x3b086b){if(_0x2671f5)return _0x3fb41e(_0x2671f5);fs[_0xeabc('0xe2')](path[_0xeabc('0xce')](_0x406ce4,util[_0xeabc('0xd3')](_0xeabc('0xe3'),_0x5fc21a)),_0x3b086b);return _0x541f18(_0x3b086b);});});})['then'](function(){return new BPromise(function(_0x4795ef,_0x541f12){zipdir(_0x406ce4,{'saveTo':_0x4cb87b},function(_0x1ffff2,_0x24cf0a){if(_0x1ffff2)return _0x541f12(_0x1ffff2);return _0x4795ef(_0x24cf0a);});})[_0xeabc('0x1a')](function(){return new BPromise(function(_0x2b5421,_0x460bd0){rimraf(_0x406ce4,function(_0x564ebd){if(_0x564ebd)_0x460bd0(_0x564ebd);return _0x2b5421();});});})[_0xeabc('0x1a')](function(){return _0x6dff2a['download'](_0x4cb87b,_0x16a837,function(_0x320158){if(!_0x320158)fs[_0xeabc('0xe4')](_0x4cb87b);});});});}else{return _0x6dff2a[_0xeabc('0x11')](0xc8);}})[_0xeabc('0x2a')](handleError(_0x6dff2a,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index b209b26..77c4eef 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 _0x6fe6=['then','findAll','setDataValue','emit','catch','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','getUsers'];(function(_0x17cded,_0xa51b6b){var _0x41b11f=function(_0xa647a){while(--_0xa647a){_0x17cded['push'](_0x17cded['shift']());}};_0x41b11f(++_0xa51b6b);}(_0x6fe6,0xff));var _0x66fe=function(_0xa3de92,_0x245fb8){_0xa3de92=_0xa3de92-0x0;var _0x196f83=_0x6fe6[_0xa3de92];return _0x196f83;};'use strict';var EventEmitter=require(_0x66fe('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x66fe('0x1')](0x0);var events={'afterCreate':_0x66fe('0x2'),'afterUpdate':_0x66fe('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1cbce4){return function(_0x28391e,_0x2d6868,_0xe4fc1c){_0x28391e[_0x66fe('0x4')]({'attributes':['id'],'raw':!![]})[_0x66fe('0x5')](function(_0x11f603){_0x28391e['setDataValue']('Users',_0x11f603['map'](function(_0x5c56ae){return{'id':_0x5c56ae['id']};}));return MailMessage[_0x66fe('0x6')]({'where':{'MailInteractionId':_0x28391e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x66fe('0x5')](function(_0x2e0d4e){_0x28391e[_0x66fe('0x7')]('unreadMessages',_0x2e0d4e['length']);MailInteractionEvents[_0x66fe('0x8')](_0x1cbce4+':'+_0x28391e['id'],_0x28391e);MailInteractionEvents[_0x66fe('0x8')](_0x1cbce4,_0x28391e);_0xe4fc1c(null);})[_0x66fe('0x9')](_0xe4fc1c(null));};}for(var e in events){if(events[_0x66fe('0xa')](e)){var event=events[e];MailInteraction[_0x66fe('0xb')](e,emitEvent(event));}}module[_0x66fe('0xc')]=MailInteractionEvents; \ No newline at end of file +var _0xae5e=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit'];(function(_0x35a69c,_0x567e03){var _0x4ce122=function(_0x513b4f){while(--_0x513b4f){_0x35a69c['push'](_0x35a69c['shift']());}};_0x4ce122(++_0x567e03);}(_0xae5e,0x147));var _0xeae5=function(_0x54284e,_0x51e88b){_0x54284e=_0x54284e-0x0;var _0xf33a2b=_0xae5e[_0x54284e];return _0xf33a2b;};'use strict';var EventEmitter=require(_0xeae5('0x0'));var MailInteraction=require(_0xeae5('0x1'))['db'][_0xeae5('0x2')];var MailMessage=require('../../mysqldb')['db'][_0xeae5('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeae5('0x4'),'afterUpdate':_0xeae5('0x5'),'afterDestroy':_0xeae5('0x6')};function emitEvent(_0x54ef59){return function(_0xad8d85,_0x109a29,_0x311251){_0xad8d85[_0xeae5('0x7')]({'attributes':['id'],'raw':!![]})[_0xeae5('0x8')](function(_0x1447c1){_0xad8d85[_0xeae5('0x9')](_0xeae5('0xa'),_0x1447c1['map'](function(_0x5e16b4){return{'id':_0x5e16b4['id']};}));return MailMessage[_0xeae5('0xb')]({'where':{'MailInteractionId':_0xad8d85['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeae5('0x8')](function(_0x3b1cb0){_0xad8d85[_0xeae5('0x9')](_0xeae5('0xc'),_0x3b1cb0[_0xeae5('0xd')]);MailInteractionEvents[_0xeae5('0xe')](_0x54ef59+':'+_0xad8d85['id'],_0xad8d85);MailInteractionEvents[_0xeae5('0xe')](_0x54ef59,_0xad8d85);_0x311251(null);})[_0xeae5('0xf')](_0x311251(null));};}for(var e in events){if(events[_0xeae5('0x10')](e)){var event=events[e];MailInteraction[_0xeae5('0x11')](e,emitEvent(event));}}module[_0xeae5('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 46ad113..bb05508 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 _0xc002=['utf8mb4','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','closed','get','MailMessage','update','catch'];(function(_0x3518c9,_0x1a3b29){var _0x5b3f1f=function(_0x20b6c3){while(--_0x20b6c3){_0x3518c9['push'](_0x3518c9['shift']());}};_0x5b3f1f(++_0x1a3b29);}(_0xc002,0x1bb));var _0x2c00=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xc002[_0x39096d];return _0x13da4f;};'use strict';var _=require('lodash');var util=require(_0x2c00('0x0'));var logger=require(_0x2c00('0x1'))(_0x2c00('0x2'));var moment=require(_0x2c00('0x3'));var BPromise=require(_0x2c00('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c00('0x5'));var rimraf=require(_0x2c00('0x6'));var config=require(_0x2c00('0x7'));var attributes=require(_0x2c00('0x8'));module[_0x2c00('0x9')]=function(_0x3f65fe,_0x197419){return _0x3f65fe[_0x2c00('0xa')](_0x2c00('0xb'),attributes,{'tableName':_0x2c00('0xc'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x2c00('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1410bf,_0x56cff,_0x31ab7c){if(_0x1410bf[_0x2c00('0xe')]){_0x1410bf[_0x2c00('0xf')]=moment()[_0x2c00('0x10')](_0x2c00('0x11'));}if(_0x1410bf['closed']){_0x1410bf[_0x2c00('0x12')]=moment()[_0x2c00('0x10')](_0x2c00('0x11'));}_0x31ab7c(null,_0x56cff);},'beforeUpdate':function(_0x52a71d,_0x5595fd,_0x4fa770){if(_0x52a71d[_0x2c00('0x13')]('substatus')){_0x52a71d[_0x2c00('0xf')]=_0x52a71d[_0x2c00('0xe')]?moment()[_0x2c00('0x10')](_0x2c00('0x11')):null;}if(_0x52a71d[_0x2c00('0x13')](_0x2c00('0x14'))){_0x52a71d[_0x2c00('0x12')]=moment()[_0x2c00('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x52a71d[_0x2c00('0xe')]=null;_0x52a71d[_0x2c00('0xf')]=null;}_0x4fa770(null,_0x52a71d);},'afterUpdate':function(_0x455bee,_0x241670,_0x23766c){var _0x1bcb4a=_0x3f65fe['models'];var _0x14c062=_0x455bee[_0x2c00('0x15')]({'plain':!![]});if(_0x14c062[_0x2c00('0x14')]){return _0x1bcb4a[_0x2c00('0x16')][_0x2c00('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x14c062['id']}})['then'](function(){_0x23766c();})[_0x2c00('0x18')](function(_0x2bc861){_0x23766c(_0x2bc861);});}else{_0x23766c();}}},'charset':_0x2c00('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xdee4=['then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','models','MailMessage'];(function(_0x325650,_0x504158){var _0x2165ee=function(_0x2c163b){while(--_0x2c163b){_0x325650['push'](_0x325650['shift']());}};_0x2165ee(++_0x504158);}(_0xdee4,0xb3));var _0x4dee=function(_0x299611,_0x2a97ff){_0x299611=_0x299611-0x0;var _0x443eae=_0xdee4[_0x299611];return _0x443eae;};'use strict';var _=require(_0x4dee('0x0'));var util=require(_0x4dee('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4dee('0x2'));var BPromise=require(_0x4dee('0x3'));var rp=require(_0x4dee('0x4'));var fs=require('fs');var path=require(_0x4dee('0x5'));var rimraf=require(_0x4dee('0x6'));var config=require('../../config/environment');var attributes=require(_0x4dee('0x7'));module[_0x4dee('0x8')]=function(_0x362932,_0x456d0b){return _0x362932[_0x4dee('0x9')](_0x4dee('0xa'),attributes,{'tableName':_0x4dee('0xb'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x4dee('0xc'),'to'],'type':_0x4dee('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1b488a,_0x1338a9,_0x341452){if(_0x1b488a[_0x4dee('0xe')]){_0x1b488a[_0x4dee('0xf')]=moment()[_0x4dee('0x10')](_0x4dee('0x11'));}if(_0x1b488a['closed']){_0x1b488a[_0x4dee('0x12')]=moment()[_0x4dee('0x10')](_0x4dee('0x11'));}_0x341452(null,_0x1338a9);},'beforeUpdate':function(_0x4f47b2,_0x4a5509,_0x4cabf2){if(_0x4f47b2['changed'](_0x4dee('0xe'))){_0x4f47b2[_0x4dee('0xf')]=_0x4f47b2['substatus']?moment()[_0x4dee('0x10')](_0x4dee('0x11')):null;}if(_0x4f47b2['changed']('closed')){_0x4f47b2[_0x4dee('0x12')]=moment()[_0x4dee('0x10')](_0x4dee('0x11'));_0x4f47b2[_0x4dee('0xe')]=null;_0x4f47b2[_0x4dee('0xf')]=null;}_0x4cabf2(null,_0x4f47b2);},'afterUpdate':function(_0x4d76cd,_0x3708f5,_0x5ddd29){var _0x2718e5=_0x362932[_0x4dee('0x13')];var _0x25bf8a=_0x4d76cd['get']({'plain':!![]});if(_0x25bf8a['closed']){return _0x2718e5[_0x4dee('0x14')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x25bf8a['id']}})[_0x4dee('0x15')](function(){_0x5ddd29();})[_0x4dee('0x16')](function(_0x50f9ed){_0x5ddd29(_0x50f9ed);});}else{_0x5ddd29();}}},'charset':_0x4dee('0x17'),'collate':_0x4dee('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 63345e7..3ea23f7 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 _0x7b27=['result','catch','MailInteraction','update','raw','options','attributes','limit','debug','UpdateMailInteraction','AddTagsToMailInteraction','find','where','addTags','body','ids','omit','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','then','info','request\x20sent','stringify','code','MailInteraction,\x20%s,\x20%s','message','error'];(function(_0x36d11c,_0x6dffa7){var _0xd95b50=function(_0x5ed180){while(--_0x5ed180){_0x36d11c['push'](_0x36d11c['shift']());}};_0xd95b50(++_0x6dffa7);}(_0x7b27,0x12a));var _0x77b2=function(_0x1c78c4,_0x5d55b0){_0x1c78c4=_0x1c78c4-0x0;var _0x30226c=_0x7b27[_0x1c78c4];return _0x30226c;};'use strict';var _=require(_0x77b2('0x0'));var util=require(_0x77b2('0x1'));var moment=require(_0x77b2('0x2'));var BPromise=require('bluebird');var rs=require(_0x77b2('0x3'));var fs=require('fs');var Redis=require(_0x77b2('0x4'));var db=require(_0x77b2('0x5'))['db'];var utils=require(_0x77b2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x77b2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x77b2('0x8')][_0x77b2('0x9')]({'port':0x232a});config[_0x77b2('0xa')]=_[_0x77b2('0xb')](config[_0x77b2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x77b2('0xc'))(new Redis(config['redis']));require(_0x77b2('0xd'))['register'](socket);function respondWithRpcPromise(_0xf2717c,_0x58079a,_0x18727c){return new BPromise(function(_0x3bd550,_0x73ec03){return client['request'](_0xf2717c,_0x18727c)[_0x77b2('0xe')](function(_0x530890){logger[_0x77b2('0xf')]('MailInteraction,\x20%s,\x20%s',_0x58079a,_0x77b2('0x10'));logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x58079a,_0x77b2('0x10'),JSON[_0x77b2('0x11')](_0x530890));if(_0x530890['error']){if(_0x530890['error'][_0x77b2('0x12')]===0x1f4){logger['error'](_0x77b2('0x13'),_0x58079a,_0x530890['error']['message']);return _0x73ec03(_0x530890['error'][_0x77b2('0x14')]);}logger[_0x77b2('0x15')]('MailInteraction,\x20%s,\x20%s',_0x58079a,_0x530890['error'][_0x77b2('0x14')]);return _0x3bd550(_0x530890['error']['message']);}else{logger[_0x77b2('0xf')]('MailInteraction,\x20%s,\x20%s',_0x58079a,_0x77b2('0x10'));_0x3bd550(_0x530890[_0x77b2('0x16')][_0x77b2('0x14')]);}})[_0x77b2('0x17')](function(_0xcb49d9){logger[_0x77b2('0x15')](_0x77b2('0x13'),_0x58079a,_0xcb49d9);_0x73ec03(_0xcb49d9);});});}exports['UpdateMailInteraction']=function(_0x5519a5){var _0x19140a=this;return new Promise(function(_0x1f3df8,_0x3c69d0){return db[_0x77b2('0x18')][_0x77b2('0x19')](_0x5519a5['body'],{'raw':_0x5519a5['options']?_0x5519a5['options'][_0x77b2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5519a5[_0x77b2('0x1b')]?_0x5519a5[_0x77b2('0x1b')]['where']||null:null,'attributes':_0x5519a5['options']?_0x5519a5[_0x77b2('0x1b')][_0x77b2('0x1c')]||null:null,'limit':_0x5519a5['options']?_0x5519a5[_0x77b2('0x1b')][_0x77b2('0x1d')]||null:null})['then'](function(_0x421dd0){logger['info']('UpdateMailInteraction',_0x5519a5);logger[_0x77b2('0x1e')](_0x77b2('0x1f'),_0x5519a5,JSON[_0x77b2('0x11')](_0x421dd0));_0x1f3df8(_0x421dd0);})['catch'](function(_0x21cf72){logger[_0x77b2('0x15')]('UpdateMailInteraction',_0x21cf72[_0x77b2('0x14')],_0x5519a5);_0x3c69d0(_0x19140a[_0x77b2('0x15')](0x1f4,_0x21cf72[_0x77b2('0x14')]));});});};exports[_0x77b2('0x20')]=function(_0x406636){return new Promise(function(_0x45434a,_0x5a11a0){return db[_0x77b2('0x18')][_0x77b2('0x21')]({'where':_0x406636[_0x77b2('0x1b')]?_0x406636[_0x77b2('0x1b')][_0x77b2('0x22')]||null:null})[_0x77b2('0xe')](function(_0x34c22f){if(_0x34c22f){return _0x34c22f[_0x77b2('0x23')](_0x406636[_0x77b2('0x24')][_0x77b2('0x25')],_[_0x77b2('0x26')](_0x406636[_0x77b2('0x24')],[_0x77b2('0x25'),'id'])||{});}})['spread'](function(_0x14474b){logger['info'](_0x77b2('0x27'),_0x406636);logger[_0x77b2('0x1e')](_0x77b2('0x27'),_0x406636,JSON[_0x77b2('0x11')](_0x14474b));_0x45434a(_0x14474b);})[_0x77b2('0x17')](function(_0x4c8610){logger[_0x77b2('0x15')](_0x77b2('0x27'),_0x4c8610[_0x77b2('0x14')],_0x406636);_0x5a11a0(_this[_0x77b2('0x15')](0x1f4,_0x4c8610[_0x77b2('0x14')]));});});}; \ No newline at end of file +var _0xb491=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','MailInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateMailInteraction','MailInteraction','options','raw','where','attributes','find','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird'];(function(_0x4eef73,_0x18b807){var _0x325bf0=function(_0x1d2799){while(--_0x1d2799){_0x4eef73['push'](_0x4eef73['shift']());}};_0x325bf0(++_0x18b807);}(_0xb491,0x18c));var _0x1b49=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xb491[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x1b49('0x0'));var util=require(_0x1b49('0x1'));var moment=require(_0x1b49('0x2'));var BPromise=require(_0x1b49('0x3'));var rs=require(_0x1b49('0x4'));var fs=require('fs');var Redis=require(_0x1b49('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b49('0x6'));var logger=require(_0x1b49('0x7'))('rpc');var config=require(_0x1b49('0x8'));var jayson=require(_0x1b49('0x9'));var client=jayson[_0x1b49('0xa')]['http']({'port':0x232a});config[_0x1b49('0xb')]=_['defaults'](config[_0x1b49('0xb')],{'host':_0x1b49('0xc'),'port':0x18eb});var socket=require(_0x1b49('0xd'))(new Redis(config[_0x1b49('0xb')]));require(_0x1b49('0xe'))[_0x1b49('0xf')](socket);function respondWithRpcPromise(_0x36e294,_0x3dc13d,_0x2768e1){return new BPromise(function(_0x1174c3,_0x2ca75f){return client[_0x1b49('0x10')](_0x36e294,_0x2768e1)[_0x1b49('0x11')](function(_0x13ba5c){logger['info']('MailInteraction,\x20%s,\x20%s',_0x3dc13d,_0x1b49('0x12'));logger[_0x1b49('0x13')](_0x1b49('0x14'),_0x3dc13d,_0x1b49('0x12'),JSON[_0x1b49('0x15')](_0x13ba5c));if(_0x13ba5c['error']){if(_0x13ba5c[_0x1b49('0x16')]['code']===0x1f4){logger[_0x1b49('0x16')](_0x1b49('0x17'),_0x3dc13d,_0x13ba5c[_0x1b49('0x16')][_0x1b49('0x18')]);return _0x2ca75f(_0x13ba5c['error'][_0x1b49('0x18')]);}logger[_0x1b49('0x16')](_0x1b49('0x17'),_0x3dc13d,_0x13ba5c[_0x1b49('0x16')][_0x1b49('0x18')]);return _0x1174c3(_0x13ba5c[_0x1b49('0x16')][_0x1b49('0x18')]);}else{logger[_0x1b49('0x19')]('MailInteraction,\x20%s,\x20%s',_0x3dc13d,_0x1b49('0x12'));_0x1174c3(_0x13ba5c[_0x1b49('0x1a')]['message']);}})[_0x1b49('0x1b')](function(_0x20c51f){logger[_0x1b49('0x16')](_0x1b49('0x17'),_0x3dc13d,_0x20c51f);_0x2ca75f(_0x20c51f);});});}exports[_0x1b49('0x1c')]=function(_0x1e75ee){var _0x2f7519=this;return new Promise(function(_0xf8170c,_0x2e9a18){return db[_0x1b49('0x1d')]['update'](_0x1e75ee['body'],{'raw':_0x1e75ee[_0x1b49('0x1e')]?_0x1e75ee[_0x1b49('0x1e')][_0x1b49('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e75ee[_0x1b49('0x1e')]?_0x1e75ee['options'][_0x1b49('0x20')]||null:null,'attributes':_0x1e75ee[_0x1b49('0x1e')]?_0x1e75ee['options'][_0x1b49('0x21')]||null:null,'limit':_0x1e75ee[_0x1b49('0x1e')]?_0x1e75ee[_0x1b49('0x1e')]['limit']||null:null})[_0x1b49('0x11')](function(_0xccff90){logger[_0x1b49('0x19')]('UpdateMailInteraction',_0x1e75ee);logger[_0x1b49('0x13')]('UpdateMailInteraction',_0x1e75ee,JSON[_0x1b49('0x15')](_0xccff90));_0xf8170c(_0xccff90);})['catch'](function(_0x3b8d6a){logger[_0x1b49('0x16')](_0x1b49('0x1c'),_0x3b8d6a['message'],_0x1e75ee);_0x2e9a18(_0x2f7519[_0x1b49('0x16')](0x1f4,_0x3b8d6a['message']));});});};exports['AddTagsToMailInteraction']=function(_0x4ace77){return new Promise(function(_0x2f2e71,_0x56eb42){return db[_0x1b49('0x1d')][_0x1b49('0x22')]({'where':_0x4ace77['options']?_0x4ace77[_0x1b49('0x1e')][_0x1b49('0x20')]||null:null})[_0x1b49('0x11')](function(_0x552589){if(_0x552589){return _0x552589[_0x1b49('0x23')](_0x4ace77[_0x1b49('0x24')][_0x1b49('0x25')],_['omit'](_0x4ace77[_0x1b49('0x24')],[_0x1b49('0x25'),'id'])||{});}})[_0x1b49('0x26')](function(_0x5f3022){logger['info'](_0x1b49('0x27'),_0x4ace77);logger['debug'](_0x1b49('0x27'),_0x4ace77,JSON['stringify'](_0x5f3022));_0x2f2e71(_0x5f3022);})[_0x1b49('0x1b')](function(_0x2bb89c){logger[_0x1b49('0x16')](_0x1b49('0x27'),_0x2bb89c['message'],_0x4ace77);_0x56eb42(_this[_0x1b49('0x16')](0x1f4,_0x2bb89c[_0x1b49('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 6d8161e..487a78e 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 _0x9ec7=['remove','removeListener','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x1f20c1,_0x350567){var _0x548c58=function(_0x54b7c5){while(--_0x54b7c5){_0x1f20c1['push'](_0x1f20c1['shift']());}};_0x548c58(++_0x350567);}(_0x9ec7,0x132));var _0x79ec=function(_0x21850a,_0x53bf6f){_0x21850a=_0x21850a-0x0;var _0x19bf3a=_0x9ec7[_0x21850a];return _0x19bf3a;};'use strict';var MailInteractionEvents=require(_0x79ec('0x0'));var events=[_0x79ec('0x1'),_0x79ec('0x2'),'update'];function createListener(_0x148c2d,_0x56eed6){return function(_0x56238a){_0x56eed6['emit'](_0x148c2d,_0x56238a);};}function removeListener(_0x53ef52,_0x2f1ec2){return function(){MailInteractionEvents[_0x79ec('0x3')](_0x53ef52,_0x2f1ec2);};}exports[_0x79ec('0x4')]=function(_0x28c7dc){for(var _0x273813=0x0,_0x2b7d3a=events[_0x79ec('0x5')];_0x273813<_0x2b7d3a;_0x273813++){var _0x245824=events[_0x273813];var _0x1b782b=createListener(_0x79ec('0x6')+_0x245824,_0x28c7dc);MailInteractionEvents['on'](_0x245824,_0x1b782b);}}; \ No newline at end of file +var _0xf7be=['mailInteraction:','save','update','emit','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7be,0x1d5));var _0xef7b=function(_0x3ee5b4,_0x528e1f){_0x3ee5b4=_0x3ee5b4-0x0;var _0x70ec7a=_0xf7be[_0x3ee5b4];return _0x70ec7a;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xef7b('0x0'),'remove',_0xef7b('0x1')];function createListener(_0x759ccc,_0x41c60d){return function(_0x5048d9){_0x41c60d[_0xef7b('0x2')](_0x759ccc,_0x5048d9);};}function removeListener(_0x557224,_0x123901){return function(){MailInteractionEvents['removeListener'](_0x557224,_0x123901);};}exports[_0xef7b('0x3')]=function(_0x4f9bae){for(var _0x50c5aa=0x0,_0x188bf8=events[_0xef7b('0x4')];_0x50c5aa<_0x188bf8;_0x50c5aa++){var _0x289e8c=events[_0x50c5aa];var _0x4e9440=createListener(_0xef7b('0x5')+_0x289e8c,_0x4f9bae);MailInteractionEvents['on'](_0x289e8c,_0x4e9440);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index b4d4912..6ca910b 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 _0x8149=['/:id/accept','accept','reject','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id/download','download','mail','mailmessage:create','update','put'];(function(_0x2dabd1,_0x152957){var _0x77f7aa=function(_0x2cca2e){while(--_0x2cca2e){_0x2dabd1['push'](_0x2dabd1['shift']());}};_0x77f7aa(++_0x152957);}(_0x8149,0xe6));var _0x9814=function(_0x103032,_0x160287){_0x103032=_0x103032-0x0;var _0x12dfc9=_0x8149[_0x103032];return _0x12dfc9;};'use strict';var multer=require(_0x9814('0x0'));var util=require(_0x9814('0x1'));var path=require('path');var timeout=require(_0x9814('0x2'));var express=require(_0x9814('0x3'));var router=express[_0x9814('0x4')]();var fs_extra=require(_0x9814('0x5'));var auth=require(_0x9814('0x6'));var interaction=require(_0x9814('0x7'));var config=require(_0x9814('0x8'));var controller=require('./mailMessage.controller');router['get']('/',auth[_0x9814('0x9')](),controller[_0x9814('0xa')]);router[_0x9814('0xb')](_0x9814('0xc'),auth[_0x9814('0x9')](),controller[_0x9814('0xd')]);router['get']('/:id',auth[_0x9814('0x9')](),controller['show']);router[_0x9814('0xb')](_0x9814('0xe'),auth['isAuthenticated'](),controller[_0x9814('0xf')]);router['post']('/',auth[_0x9814('0x9')](),interaction['tracked'](_0x9814('0x10'),_0x9814('0x11')),controller['create']);router['put']('/:id',auth[_0x9814('0x9')](),controller[_0x9814('0x12')]);router[_0x9814('0x13')](_0x9814('0x14'),auth[_0x9814('0x9')](),controller[_0x9814('0x15')]);router['put']('/:id/reject',auth[_0x9814('0x9')](),controller[_0x9814('0x16')]);router['delete'](_0x9814('0x17'),auth[_0x9814('0x9')](),controller['destroy']);module[_0x9814('0x18')]=router; \ No newline at end of file +var _0x6c50=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','mailmessage:create','put','/:id/accept','accept','reject','delete','destroy','multer','util','path','connect-timeout'];(function(_0x2efd04,_0x5af611){var _0x260dec=function(_0x412f0d){while(--_0x412f0d){_0x2efd04['push'](_0x2efd04['shift']());}};_0x260dec(++_0x5af611);}(_0x6c50,0xa4));var _0x06c5=function(_0x44a156,_0x3f1bfe){_0x44a156=_0x44a156-0x0;var _0x14e90a=_0x6c50[_0x44a156];return _0x14e90a;};'use strict';var multer=require(_0x06c5('0x0'));var util=require(_0x06c5('0x1'));var path=require(_0x06c5('0x2'));var timeout=require(_0x06c5('0x3'));var express=require('express');var router=express[_0x06c5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x06c5('0x5'));var interaction=require(_0x06c5('0x6'));var config=require(_0x06c5('0x7'));var controller=require(_0x06c5('0x8'));router[_0x06c5('0x9')]('/',auth[_0x06c5('0xa')](),controller[_0x06c5('0xb')]);router[_0x06c5('0x9')](_0x06c5('0xc'),auth[_0x06c5('0xa')](),controller[_0x06c5('0xd')]);router['get'](_0x06c5('0xe'),auth[_0x06c5('0xa')](),controller[_0x06c5('0xf')]);router[_0x06c5('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x06c5('0x10')]('/',auth['isAuthenticated'](),interaction['tracked']('mail',_0x06c5('0x11')),controller['create']);router[_0x06c5('0x12')](_0x06c5('0xe'),auth[_0x06c5('0xa')](),controller['update']);router[_0x06c5('0x12')](_0x06c5('0x13'),auth[_0x06c5('0xa')](),controller[_0x06c5('0x14')]);router['put']('/:id/reject',auth[_0x06c5('0xa')](),controller[_0x06c5('0x15')]);router[_0x06c5('0x16')]('/:id',auth[_0x06c5('0xa')](),controller[_0x06c5('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index e2dcb5b..97c052f 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 _0x4283=['Chat','sequelize','lodash','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE','Email'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x4283,0x85));var _0x3428=function(_0x387878,_0x7b292e){_0x387878=_0x387878-0x0;var _0xd0cdfb=_0x4283[_0x387878];return _0xd0cdfb;};'use strict';var Sequelize=require(_0x3428('0x0'));var _=require(_0x3428('0x1'));module['exports']={'body':{'type':Sequelize[_0x3428('0x2')](_0x3428('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x3428('0x2')]('medium')},'read':{'type':Sequelize[_0x3428('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3428('0x5')]('in',_0x3428('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x3428('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x3428('0x2')](_0x3428('0x3'))},'cc':{'type':Sequelize[_0x3428('0x2')](_0x3428('0x3'))},'bcc':{'type':Sequelize[_0x3428('0x2')](_0x3428('0x3'))},'subject':{'type':Sequelize[_0x3428('0x2')]},'sentAt':{'type':Sequelize[_0x3428('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x3428('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x3428('0x8')]},'originTo':{'type':Sequelize[_0x3428('0x2')](_0x3428('0x3'))},'originCc':{'type':Sequelize[_0x3428('0x2')]('long')},'originChannel':{'type':Sequelize['ENUM'](_0x3428('0x9'),_0x3428('0xa')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0xc734=['Email','Chat','sequelize','lodash','TEXT','long','medium','ENUM','out','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x5aa51b,_0x1581e6){var _0x5194a4=function(_0x27a2f5){while(--_0x27a2f5){_0x5aa51b['push'](_0x5aa51b['shift']());}};_0x5194a4(++_0x1581e6);}(_0xc734,0xec));var _0x4c73=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc734[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x4c73('0x0'));var _=require(_0x4c73('0x1'));module['exports']={'body':{'type':Sequelize[_0x4c73('0x2')](_0x4c73('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4c73('0x2')](_0x4c73('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4c73('0x5')]('in','out'),'defaultValue':_0x4c73('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4c73('0x7')](0x1fe)},'from':{'type':Sequelize[_0x4c73('0x7')]},'to':{'type':Sequelize[_0x4c73('0x2')](_0x4c73('0x3'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0x4c73('0x2')](_0x4c73('0x3'))},'subject':{'type':Sequelize[_0x4c73('0x2')]},'sentAt':{'type':Sequelize[_0x4c73('0x8')]},'attach':{'type':Sequelize[_0x4c73('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4c73('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4c73('0x8')]},'originTo':{'type':Sequelize[_0x4c73('0x2')](_0x4c73('0x3'))},'originCc':{'type':Sequelize[_0x4c73('0x2')]('long')},'originChannel':{'type':Sequelize[_0x4c73('0x5')](_0x4c73('0xb'),_0x4c73('0xc')),'defaultValue':_0x4c73('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 45eee06..ff07aee 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 _0xb046=['accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','read1stAt','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','reject','RejectMessage','rejectMessage','ContactId','download','unix','toString','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachment','Attachments','headers','Bcc','bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','moment','path','lodash','ioredis','html-to-text','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','sendStatus','name','send','MailMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','show','params','include','merge','find','body','destroy','describe','create','direction','out','secret','split','MailAccount','findOne','CmList','List','Contacts','CloudProvider','getSmtpOptions','attachments','join','root','basename','CmContact','List\x20not\x20found','SendMail','format','stringify'];(function(_0x31dd7e,_0x72d5da){var _0x2a6bfd=function(_0x34a241){while(--_0x34a241){_0x31dd7e['push'](_0x31dd7e['shift']());}};_0x2a6bfd(++_0x72d5da);}(_0xb046,0x169));var _0x6b04=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0xb046[_0x2cc0b3];return _0x1667ef;};'use strict';var emlformat=require('eml-format');var moment=require(_0x6b04('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x6b04('0x1'));var fs=require('fs');var _=require(_0x6b04('0x2'));var Redis=require(_0x6b04('0x3'));var htmlToText=require(_0x6b04('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x6b04('0x5'))('api');var interaction_log=require(_0x6b04('0x5'))(_0x6b04('0x6'));var config=require(_0x6b04('0x7'));var db=require(_0x6b04('0x8'))['db'];config[_0x6b04('0x9')]=_[_0x6b04('0xa')](config[_0x6b04('0x9')],{'host':_0x6b04('0xb'),'port':0x18eb});var socket=require(_0x6b04('0xc'))(new Redis(config[_0x6b04('0x9')]));var htmlEntities=require(_0x6b04('0xd'));require(_0x6b04('0xe'))[_0x6b04('0xf')](socket);var jayson=require(_0x6b04('0x10'));var client=jayson[_0x6b04('0x11')]['http']({'port':0x232c});var client9003=jayson[_0x6b04('0x11')][_0x6b04('0x12')]({'port':0x232b});var client9002=jayson['client'][_0x6b04('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x594b27,_0x18a753,_0x4004d0,_0x43516c){return new BPromise(function(_0x44702d,_0x339f08){var _0x3367b2=_0x43516c||client;return _0x3367b2[_0x6b04('0x13')](_0x594b27,_0x4004d0)[_0x6b04('0x14')](function(_0x3f0a92){logger[_0x6b04('0x15')](_0x6b04('0x16'),_0x18a753,_0x6b04('0x17'));logger['debug'](_0x6b04('0x18'),_0x18a753,_0x6b04('0x17'),JSON['stringify'](_0x3f0a92));if(_0x3f0a92[_0x6b04('0x19')]){if(_0x3f0a92[_0x6b04('0x19')][_0x6b04('0x1a')]===0x1f4){logger[_0x6b04('0x19')](_0x6b04('0x16'),_0x18a753,_0x3f0a92[_0x6b04('0x19')][_0x6b04('0x1b')]);return _0x339f08(_0x3f0a92['error'][_0x6b04('0x1b')]);}logger[_0x6b04('0x19')](_0x6b04('0x16'),_0x18a753,_0x3f0a92['error'][_0x6b04('0x1b')]);return _0x44702d(_0x3f0a92[_0x6b04('0x19')][_0x6b04('0x1b')]);}else{logger[_0x6b04('0x15')]('MailMessage,\x20%s,\x20%s',_0x18a753,_0x6b04('0x17'));_0x44702d(_0x3f0a92[_0x6b04('0x1c')][_0x6b04('0x1b')]);}})[_0x6b04('0x1d')](function(_0xcee83b){logger[_0x6b04('0x19')](_0x6b04('0x16'),_0x18a753,_0xcee83b);_0x339f08(_0xcee83b);});});}function respondWithResult(_0x143323,_0x1dc7cd){_0x1dc7cd=_0x1dc7cd||0xc8;return function(_0x4b27d5){if(_0x4b27d5){return _0x143323[_0x6b04('0x1e')](_0x1dc7cd)[_0x6b04('0x1f')](_0x4b27d5);}};}function respondWithFilteredResult(_0x3bda11,_0x15e2ca){return function(_0x2edf08){if(_0x2edf08){var _0x14a9e4=typeof _0x15e2ca[_0x6b04('0x20')]===_0x6b04('0x21')&&typeof _0x15e2ca[_0x6b04('0x22')]==='undefined';var _0x58464d=_0x2edf08['count'];var _0x5e02ae=_0x14a9e4?0x0:_0x15e2ca[_0x6b04('0x20')];var _0x2172c1=_0x14a9e4?_0x2edf08[_0x6b04('0x23')]:_0x15e2ca[_0x6b04('0x20')]+_0x15e2ca[_0x6b04('0x22')];var _0x9f136b;if(_0x2172c1>=_0x58464d){_0x2172c1=_0x58464d;_0x9f136b=0xc8;}else{_0x9f136b=0xce;}_0x3bda11[_0x6b04('0x1e')](_0x9f136b);return _0x3bda11[_0x6b04('0x24')](_0x6b04('0x25'),_0x5e02ae+'-'+_0x2172c1+'/'+_0x58464d)[_0x6b04('0x1f')](_0x2edf08);}return null;};}function saveUpdates(_0x5f0713){return function(_0x41e308){if(_0x41e308){return _0x41e308[_0x6b04('0x26')](_0x5f0713)[_0x6b04('0x14')](function(_0x208b13){return _0x208b13;});}return null;};}function removeEntity(_0x42499d){return function(_0x4b045a){if(_0x4b045a){return _0x4b045a['destroy']()[_0x6b04('0x14')](function(){_0x42499d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1929dd){return function(_0xd5a030){if(!_0xd5a030){_0x1929dd[_0x6b04('0x27')](0x194);}return _0xd5a030;};}function handleError(_0x1ba031,_0x4f41b3){_0x4f41b3=_0x4f41b3||0x1f4;return function(_0x58e0cf){logger[_0x6b04('0x19')](_0x58e0cf['stack']);if(_0x58e0cf[_0x6b04('0x28')]){delete _0x58e0cf[_0x6b04('0x28')];}_0x1ba031[_0x6b04('0x1e')](_0x4f41b3)[_0x6b04('0x29')](_0x58e0cf);};}exports['index']=function(_0x101b57,_0x20800d){var _0x9298d2={},_0x21bec2={},_0x563d1e={'count':0x0,'rows':[]};var _0x1e7786=_['map'](db[_0x6b04('0x2a')][_0x6b04('0x2b')],function(_0xc4b60d){return{'name':_0xc4b60d[_0x6b04('0x2c')],'type':_0xc4b60d[_0x6b04('0x2d')][_0x6b04('0x2e')]};});_0x21bec2['model']=_[_0x6b04('0x2f')](_0x1e7786,_0x6b04('0x28'));_0x21bec2[_0x6b04('0x30')]=_[_0x6b04('0x31')](_0x101b57['query']);_0x21bec2[_0x6b04('0x32')]=_[_0x6b04('0x33')](_0x21bec2[_0x6b04('0x34')],_0x21bec2['query']);_0x9298d2[_0x6b04('0x35')]=_[_0x6b04('0x33')](_0x21bec2[_0x6b04('0x34')],qs['fields'](_0x101b57[_0x6b04('0x30')][_0x6b04('0x36')]));_0x9298d2['attributes']=_0x9298d2[_0x6b04('0x35')][_0x6b04('0x37')]?_0x9298d2['attributes']:_0x21bec2[_0x6b04('0x34')];if(!_0x101b57['query'][_0x6b04('0x38')]('nolimit')){_0x9298d2[_0x6b04('0x22')]=qs[_0x6b04('0x22')](_0x101b57['query'][_0x6b04('0x22')]);_0x9298d2[_0x6b04('0x20')]=qs[_0x6b04('0x20')](_0x101b57[_0x6b04('0x30')][_0x6b04('0x20')]);}_0x9298d2[_0x6b04('0x39')]=qs[_0x6b04('0x3a')](_0x101b57[_0x6b04('0x30')][_0x6b04('0x3a')]);_0x9298d2[_0x6b04('0x3b')]=qs['filters'](_[_0x6b04('0x3c')](_0x101b57[_0x6b04('0x30')],_0x21bec2[_0x6b04('0x32')]),_0x1e7786);if(_0x101b57[_0x6b04('0x30')][_0x6b04('0x3d')]){_0x9298d2[_0x6b04('0x3b')]=_['merge'](_0x9298d2[_0x6b04('0x3b')],{'$or':_[_0x6b04('0x2f')](_0x1e7786,function(_0x1124cd){if(_0x1124cd[_0x6b04('0x2d')]!==_0x6b04('0x3e')){var _0x4a51d6={};_0x4a51d6[_0x1124cd[_0x6b04('0x28')]]={'$like':'%'+_0x101b57[_0x6b04('0x30')][_0x6b04('0x3d')]+'%'};return _0x4a51d6;}})});}_0x9298d2=_['merge']({},_0x9298d2,_0x101b57[_0x6b04('0x3f')]);var _0x36ea31={'where':_0x9298d2[_0x6b04('0x3b')]};return db[_0x6b04('0x2a')][_0x6b04('0x23')](_0x36ea31)[_0x6b04('0x14')](function(_0x1197a8){_0x563d1e[_0x6b04('0x23')]=_0x1197a8;if(_0x101b57[_0x6b04('0x30')][_0x6b04('0x40')]){_0x9298d2['include']=[{'all':!![]}];}return db[_0x6b04('0x2a')][_0x6b04('0x41')](_0x9298d2);})[_0x6b04('0x14')](function(_0x2d95a5){_0x563d1e['rows']=_0x2d95a5;return _0x563d1e;})[_0x6b04('0x14')](respondWithFilteredResult(_0x20800d,_0x9298d2))['catch'](handleError(_0x20800d,null));};exports[_0x6b04('0x42')]=function(_0x541bad,_0x2b26ba){var _0x4cc208={'raw':!![],'where':{'id':_0x541bad[_0x6b04('0x43')]['id']}},_0x105f98={};_0x105f98['model']=_['keys'](db[_0x6b04('0x2a')]['rawAttributes']);_0x105f98[_0x6b04('0x30')]=_[_0x6b04('0x31')](_0x541bad[_0x6b04('0x30')]);_0x105f98[_0x6b04('0x32')]=_[_0x6b04('0x33')](_0x105f98[_0x6b04('0x34')],_0x105f98[_0x6b04('0x30')]);_0x4cc208['attributes']=_[_0x6b04('0x33')](_0x105f98[_0x6b04('0x34')],qs['fields'](_0x541bad[_0x6b04('0x30')][_0x6b04('0x36')]));_0x4cc208['attributes']=_0x4cc208[_0x6b04('0x35')]['length']?_0x4cc208[_0x6b04('0x35')]:_0x105f98[_0x6b04('0x34')];if(_0x541bad[_0x6b04('0x30')][_0x6b04('0x40')]){_0x4cc208[_0x6b04('0x44')]=[{'all':!![]}];}_0x4cc208=_[_0x6b04('0x45')]({},_0x4cc208,_0x541bad['options']);return db['MailMessage'][_0x6b04('0x46')](_0x4cc208)[_0x6b04('0x14')](handleEntityNotFound(_0x2b26ba,null))[_0x6b04('0x14')](respondWithResult(_0x2b26ba,null))[_0x6b04('0x1d')](handleError(_0x2b26ba,null));};exports[_0x6b04('0x26')]=function(_0x21b055,_0x21255c){if(_0x21b055[_0x6b04('0x47')]['id']){delete _0x21b055[_0x6b04('0x47')]['id'];}return db[_0x6b04('0x2a')][_0x6b04('0x46')]({'where':{'id':_0x21b055[_0x6b04('0x43')]['id']}})[_0x6b04('0x14')](handleEntityNotFound(_0x21255c,null))[_0x6b04('0x14')](saveUpdates(_0x21b055['body'],null))['then'](respondWithResult(_0x21255c,null))['catch'](handleError(_0x21255c,null));};exports[_0x6b04('0x48')]=function(_0x4bc946,_0x46996c){return db['MailMessage'][_0x6b04('0x46')]({'where':{'id':_0x4bc946['params']['id']}})['then'](handleEntityNotFound(_0x46996c,null))[_0x6b04('0x14')](removeEntity(_0x46996c,null))[_0x6b04('0x1d')](handleError(_0x46996c,null));};exports[_0x6b04('0x49')]=function(_0x24f3bf,_0x192686){return db[_0x6b04('0x2a')][_0x6b04('0x49')]()[_0x6b04('0x14')](respondWithResult(_0x192686,null))[_0x6b04('0x1d')](handleError(_0x192686,null));};exports['create']=function(_0x172b40,_0xfba140){return db[_0x6b04('0x2a')][_0x6b04('0x4a')](_0x172b40[_0x6b04('0x47')])[_0x6b04('0x14')](function(_0x5ed427){if(_0x5ed427){if(_0x5ed427[_0x6b04('0x4b')]===_0x6b04('0x4c')&&!_0x5ed427[_0x6b04('0x4d')]){var _0x559fba,_0x3b17d0,_0x24c0d7;if(_0x172b40[_0x6b04('0x47')]['to']){_0x3b17d0=_0x172b40['body']['to'][_0x6b04('0x4e')](',')[0x0];}return db[_0x6b04('0x4f')][_0x6b04('0x50')]({'where':{'id':_0x5ed427['MailAccountId']},'include':[{'model':db[_0x6b04('0x51')],'as':_0x6b04('0x52'),'include':[{'model':db['CmContact'],'as':_0x6b04('0x53'),'where':{'email':_0x3b17d0},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x6b04('0x54'),'raw':!![]}]}]})[_0x6b04('0x14')](function(_0x5aa41b){_0x559fba=_0x5aa41b;if(!_0x559fba||!_0x559fba['Smtp'])return;var _0x1012a6=_0x559fba[_0x6b04('0x55')]();if(_0x172b40[_0x6b04('0x47')][_0x6b04('0x56')]&&_0x172b40['body'][_0x6b04('0x56')]['length']){for(var _0x40838d=0x0;_0x40838d<_0x172b40[_0x6b04('0x47')][_0x6b04('0x56')][_0x6b04('0x37')];_0x40838d+=0x1){_0x172b40[_0x6b04('0x47')][_0x6b04('0x56')][_0x40838d]={'filename':_0x172b40[_0x6b04('0x47')][_0x6b04('0x56')][_0x40838d][_0x6b04('0x28')],'path':path[_0x6b04('0x57')](config[_0x6b04('0x58')],'server/files/attachments',_0x172b40[_0x6b04('0x47')][_0x6b04('0x56')][_0x40838d][_0x6b04('0x59')])};}}_0x24c0d7={'account':_0x1012a6,'message':_0x172b40[_0x6b04('0x47')]};return;})[_0x6b04('0x14')](function(){if(_0x559fba[_0x6b04('0x52')]){if(_0x559fba[_0x6b04('0x52')]['Contacts'][_0x6b04('0x37')]){return _0x559fba[_0x6b04('0x52')][_0x6b04('0x53')][0x0];}else{return db[_0x6b04('0x5a')][_0x6b04('0x4a')](_[_0x6b04('0xa')](_0x172b40['body'],{'firstName':_0x172b40[_0x6b04('0x47')]['to'],'email':_0x172b40[_0x6b04('0x47')]['to'],'phone':_0x172b40[_0x6b04('0x47')]['to'],'ListId':_0x559fba['ListId']}));}}else{throw new Error(_0x6b04('0x5b'));}})['then'](function(){if(_0x24c0d7){return respondWithRpcPromise(_0x6b04('0x5c'),'sendMail',_0x24c0d7,client9003)['then'](function(_0x51497f){return _0x5ed427[_0x6b04('0x26')]({'read':!![],'messageId':_0x51497f['messageId'],'sentAt':moment()[_0x6b04('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x6b04('0x1d')](function(_0x42306a){logger[_0x6b04('0x19')]('%s',JSON[_0x6b04('0x5e')](_0x42306a));return _0x5ed427;});}return _0x5ed427;});}return _0x5ed427;}})['then'](respondWithResult(_0xfba140,0xc9))[_0x6b04('0x1d')](handleError(_0xfba140,null));};exports[_0x6b04('0x5f')]=function(_0x1858ca,_0x5975d8){var _0x3593e2={'agent':{},'channel':_0x6b04('0x60')};if(_0x1858ca['body']['id']){delete _0x1858ca['body']['id'];}_0x1858ca['body'][_0x6b04('0x61')]=!![];_0x1858ca[_0x6b04('0x47')][_0x6b04('0x62')]=moment()[_0x6b04('0x5d')](_0x6b04('0x63'));_0x1858ca[_0x6b04('0x47')]['UserId']=_0x1858ca[_0x6b04('0x47')][_0x6b04('0x64')]||_0x1858ca[_0x6b04('0x65')]['id'];_0x3593e2[_0x6b04('0x66')]['id']=_0x1858ca['body'][_0x6b04('0x64')];return db['MailMessage'][_0x6b04('0x46')]({'where':{'id':_0x1858ca[_0x6b04('0x43')]['id'],'UserId':null}})[_0x6b04('0x14')](handleEntityNotFound(_0x5975d8,null))[_0x6b04('0x14')](saveUpdates(_0x1858ca[_0x6b04('0x47')],null))[_0x6b04('0x14')](function(_0x3c9f87){if(_0x3c9f87){_0x3593e2['message']=_0x3c9f87['get']({'plain':!![]});return db['MailInteraction'][_0x6b04('0x46')]({'where':{'id':_0x3c9f87['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5975d8,null))[_0x6b04('0x14')](function(_0x1241ac){if(_0x1241ac){return _0x1241ac[_0x6b04('0x26')]({'UserId':_0x1858ca[_0x6b04('0x47')][_0x6b04('0x64')],'read1stAt':_['isNil'](_0x1241ac[_0x6b04('0x67')])?moment()[_0x6b04('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6b04('0x14')](function(_0x5d5169){if(_0x5d5169){_0x3593e2['interaction']=_0x5d5169[_0x6b04('0x68')]({'plain':!![]});interaction_log[_0x6b04('0x15')](_0x6b04('0x69'),_0x1858ca[_0x6b04('0x65')]['id'],_0x1858ca[_0x6b04('0x65')][_0x6b04('0x28')],_0x1858ca[_0x6b04('0x65')][_0x6b04('0x6a')],_0x3593e2[_0x6b04('0x6b')]['id'],_0x1858ca[_0x6b04('0x47')]?JSON[_0x6b04('0x5e')](_0x1858ca[_0x6b04('0x47')]):_0x6b04('0x6c'));return respondWithRpcPromise(_0x6b04('0x6d'),'acceptMessage',_0x3593e2);}return null;})[_0x6b04('0x14')](function(_0x29fcd3){var _0x4d0cc4=_0x6b04('0x6e')+_0x29fcd3['message']['ContactId'];return db[_0x6b04('0x6f')]['query'](_0x4d0cc4,{'type':db[_0x6b04('0x70')][_0x6b04('0x71')]['SELECT'],'raw':!![]})[_0x6b04('0x14')](function(_0x29bed2){return _0x29bed2;});})[_0x6b04('0x14')](function(_0x33447c){if(_0x33447c){_0x3593e2[_0x6b04('0x1b')][_0x6b04('0x72')]=_0x33447c[0x0];if(!_0x1858ca[_0x6b04('0x47')][_0x6b04('0x64')])return;return db[_0x6b04('0x73')][_0x6b04('0x46')]({'where':{'id':_0x1858ca[_0x6b04('0x47')][_0x6b04('0x64')],'role':_0x6b04('0x66')},'attributes':['id',_0x6b04('0x28'),_0x6b04('0x74'),_0x6b04('0x75'),_0x6b04('0x76')],'raw':!![]});}return null;})[_0x6b04('0x14')](function(_0xb646f4){if(!_0xb646f4)return null;_0x3593e2[_0x6b04('0x1b')][_0x6b04('0x66')]=_0xb646f4;return _0x3593e2;})[_0x6b04('0x14')](function(_0xb3063d){if(_0xb3063d){if(_0x1858ca[_0x6b04('0x47')][_0x6b04('0x77')]){_0x3593e2[_0x6b04('0x1b')][_0x6b04('0x78')]=util[_0x6b04('0x5d')](_0x6b04('0x79'),_0x1858ca[_0x6b04('0x65')][_0x6b04('0x28')]);_0x3593e2[_0x6b04('0x1b')][_0x6b04('0x7a')]=_0x3593e2['channel'];_0x3593e2['message'][_0x6b04('0x7b')]=_0x3593e2['channel'];_0x3593e2[_0x6b04('0x1b')][_0x6b04('0x7c')]=_0x6b04('0x5f');_0x3593e2[_0x6b04('0x1b')][_0x6b04('0x47')]=htmlToText[_0x6b04('0x7d')](_0x3593e2[_0x6b04('0x1b')][_0x6b04('0x47')]);return respondWithRpcPromise(_0x6b04('0x7e'),_0x6b04('0x7e'),{'event':'acceptmessage','message':_0x3593e2[_0x6b04('0x1b')]},client9002)[_0x6b04('0x14')](function(){return _0x3593e2;});}return _0x3593e2;}return null;})[_0x6b04('0x14')](respondWithResult(_0x5975d8,null))[_0x6b04('0x1d')](handleError(_0x5975d8,null));};exports[_0x6b04('0x7f')]=function(_0x9ed0a8,_0x3e3e4c){var _0x11a871={'agent':{},'channel':_0x6b04('0x60')};if(_0x9ed0a8[_0x6b04('0x47')]['id']){delete _0x9ed0a8['body']['id'];}_0x9ed0a8[_0x6b04('0x47')][_0x6b04('0x64')]=_0x9ed0a8['body']['UserId']||_0x9ed0a8['user']['id'];_0x11a871[_0x6b04('0x66')]['id']=_0x9ed0a8[_0x6b04('0x47')][_0x6b04('0x64')];return db[_0x6b04('0x2a')][_0x6b04('0x46')]({'where':{'id':_0x9ed0a8[_0x6b04('0x43')]['id'],'UserId':null}})[_0x6b04('0x14')](handleEntityNotFound(_0x3e3e4c,null))[_0x6b04('0x14')](function(_0x3b040b){if(_0x3b040b){_0x11a871[_0x6b04('0x1b')]=_0x3b040b[_0x6b04('0x68')]({'plain':!![]});return db['MailInteraction'][_0x6b04('0x46')]({'where':{'id':_0x3b040b['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3e3e4c,null))[_0x6b04('0x14')](function(_0x387061){if(_0x387061){_0x11a871[_0x6b04('0x6b')]=_0x387061[_0x6b04('0x68')]({'plain':!![]});interaction_log[_0x6b04('0x15')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x9ed0a8[_0x6b04('0x65')]['id'],_0x9ed0a8[_0x6b04('0x65')][_0x6b04('0x28')],_0x9ed0a8[_0x6b04('0x65')][_0x6b04('0x6a')],_0x11a871['interaction']['id'],_0x9ed0a8[_0x6b04('0x47')]?JSON[_0x6b04('0x5e')](_0x9ed0a8[_0x6b04('0x47')]):_0x6b04('0x6c'));return respondWithRpcPromise(_0x6b04('0x80'),_0x6b04('0x81'),_0x11a871);}return null;})[_0x6b04('0x14')](function(_0x91779){var _0xce9978='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x91779[_0x6b04('0x1b')][_0x6b04('0x82')];return db[_0x6b04('0x6f')][_0x6b04('0x30')](_0xce9978,{'type':db[_0x6b04('0x70')][_0x6b04('0x71')]['SELECT'],'raw':!![]})[_0x6b04('0x14')](function(_0x1d8173){return _0x1d8173;});})['then'](function(_0x2b87cd){if(_0x2b87cd){_0x11a871[_0x6b04('0x1b')][_0x6b04('0x72')]=_0x2b87cd[0x0];if(!_0x9ed0a8['body'][_0x6b04('0x64')])return;return db[_0x6b04('0x73')][_0x6b04('0x46')]({'where':{'id':_0x9ed0a8[_0x6b04('0x47')]['UserId'],'role':_0x6b04('0x66')},'attributes':['id','name',_0x6b04('0x74'),_0x6b04('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x273495){if(!_0x273495)return null;_0x11a871['message'][_0x6b04('0x66')]=_0x273495;return _0x11a871;})[_0x6b04('0x14')](function(_0x4f966a){if(_0x4f966a){_0x4f966a[_0x6b04('0x1b')]['interface']=util[_0x6b04('0x5d')](_0x6b04('0x79'),_0x9ed0a8[_0x6b04('0x65')][_0x6b04('0x28')]);_0x4f966a[_0x6b04('0x1b')]['channel']=_0x11a871['channel'];_0x4f966a[_0x6b04('0x1b')][_0x6b04('0x7b')]=_0x11a871[_0x6b04('0x7a')];_0x4f966a['message'][_0x6b04('0x7c')]=_0x6b04('0x7f');_0x4f966a[_0x6b04('0x1b')][_0x6b04('0x47')]=htmlToText[_0x6b04('0x7d')](_0x11a871[_0x6b04('0x1b')][_0x6b04('0x47')]);respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x4f966a['message']},client9002);return _0x11a871;}return null;})[_0x6b04('0x14')](respondWithResult(_0x3e3e4c,null))[_0x6b04('0x1d')](handleError(_0x3e3e4c,null));};exports[_0x6b04('0x83')]=function(_0x368ede,_0xdb061e){var _0x3219df=moment()[_0x6b04('0x84')]()[_0x6b04('0x85')]();var _0x467d6d=path[_0x6b04('0x57')](config['root'],_0x6b04('0x86'),_0x6b04('0x87'),_0x6b04('0x88'));var _0x3be27e=path[_0x6b04('0x57')](config[_0x6b04('0x58')],_0x6b04('0x86'),_0x6b04('0x87'),_0x6b04('0x56'));var _0x453dff=util[_0x6b04('0x5d')](_0x6b04('0x89'),_0x3219df);return db['MailMessage'][_0x6b04('0x46')]({'where':{'id':_0x368ede[_0x6b04('0x43')]['id']},'attributes':['id',_0x6b04('0x47'),_0x6b04('0x8a'),'to','cc','bcc',_0x6b04('0x8b'),_0x6b04('0x8c')],'include':_0x368ede[_0x6b04('0x30')]['attachments']?[{'model':db[_0x6b04('0x8d')],'as':_0x6b04('0x8e')}]:undefined})['then'](handleEntityNotFound(_0xdb061e,null))[_0x6b04('0x14')](function(_0x5057b4){if(_0x5057b4){var _0x183402=_0x5057b4;var _0x3fac85={'from':_0x183402[_0x6b04('0x8a')],'to':_0x183402['to'],'subject':_0x183402[_0x6b04('0x8b')],'html':htmlEntities['decode'](_0x183402['body']),'headers':{'Date':moment(_0x183402[_0x6b04('0x8c')])[_0x6b04('0x5d')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x5057b4['cc']){_0x3fac85[_0x6b04('0x8f')]['Cc']=_0x5057b4['cc'];}if(_0x5057b4['bcc']){_0x3fac85[_0x6b04('0x8f')][_0x6b04('0x90')]=_0x5057b4[_0x6b04('0x91')];}return new BPromise(function(_0x161586,_0x37e39d){if(_0x5057b4[_0x6b04('0x8e')]){for(var _0x1d67bc=0x0;_0x1d67bc<_0x5057b4['Attachments']['length'];_0x1d67bc++){var _0x35fb9d=_0x5057b4[_0x6b04('0x8e')][_0x1d67bc];var _0x13f2c3=path[_0x6b04('0x57')](_0x3be27e,_0x35fb9d[_0x6b04('0x59')]);if(fs[_0x6b04('0x92')](_0x13f2c3)){_0x3fac85[_0x6b04('0x56')][_0x6b04('0x93')]({'name':_0x35fb9d[_0x6b04('0x28')],'contentType':_0x35fb9d[_0x6b04('0x2d')],'data':fs[_0x6b04('0x94')](_0x13f2c3)});}}}emlformat[_0x6b04('0x95')](_0x3fac85,function(_0x27a86a,_0x242a7b){if(_0x27a86a)return _0x37e39d(_0x27a86a);fs[_0x6b04('0x96')](path[_0x6b04('0x57')](_0x467d6d,_0x453dff),_0x242a7b);return _0x161586(_0x242a7b);});});}})['then'](function(_0x5205c5){if(_0x5205c5){return _0xdb061e['download'](path[_0x6b04('0x57')](_0x467d6d,_0x453dff),_0x453dff,function(_0x403e53){if(!_0x403e53)fs[_0x6b04('0x97')](path[_0x6b04('0x57')](_0x467d6d,_0x453dff));});}})[_0x6b04('0x1d')](handleError(_0xdb061e,null));}; \ No newline at end of file +var _0xc34c=['writeFileSync','unlinkSync','eml-format','moment','bluebird','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-entities','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','json','undefined','count','offset','limit','set','then','destroy','sendStatus','stack','name','send','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','length','options','find','update','body','describe','create','direction','out','secret','MailAccountId','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','getSmtpOptions','attachments','root','server/files/attachments','ListId','List\x20not\x20found','SendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','readAt','format','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','ContactId','QueryTypes','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','User','rejectmessage','download','unix','toString','join','server','files','tmp','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','push','readFileSync','build'];(function(_0x191559,_0xb1a10f){var _0x1f6626=function(_0x61578b){while(--_0x61578b){_0x191559['push'](_0x191559['shift']());}};_0x1f6626(++_0xb1a10f);}(_0xc34c,0x138));var _0xcc34=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xc34c[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0xcc34('0x0'));var moment=require(_0xcc34('0x1'));var BPromise=require(_0xcc34('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0xcc34('0x3'));var htmlToText=require('html-to-text');var qs=require(_0xcc34('0x4'));var logger=require(_0xcc34('0x5'))(_0xcc34('0x6'));var interaction_log=require(_0xcc34('0x5'))(_0xcc34('0x7'));var config=require(_0xcc34('0x8'));var db=require('../../mysqldb')['db'];config[_0xcc34('0x9')]=_[_0xcc34('0xa')](config[_0xcc34('0x9')],{'host':_0xcc34('0xb'),'port':0x18eb});var socket=require(_0xcc34('0xc'))(new Redis(config[_0xcc34('0x9')]));var htmlEntities=require(_0xcc34('0xd'));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xcc34('0xe'));var client=jayson[_0xcc34('0xf')][_0xcc34('0x10')]({'port':0x232c});var client9003=jayson[_0xcc34('0xf')]['http']({'port':0x232b});var client9002=jayson[_0xcc34('0xf')][_0xcc34('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x6fdb5a,_0x1626b7,_0xdda2a,_0x157ab4){return new BPromise(function(_0x4c64b7,_0x390926){var _0x3ada3d=_0x157ab4||client;return _0x3ada3d[_0xcc34('0x11')](_0x6fdb5a,_0xdda2a)['then'](function(_0x55e517){logger[_0xcc34('0x12')](_0xcc34('0x13'),_0x1626b7,_0xcc34('0x14'));logger[_0xcc34('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x1626b7,_0xcc34('0x14'),JSON['stringify'](_0x55e517));if(_0x55e517[_0xcc34('0x16')]){if(_0x55e517[_0xcc34('0x16')][_0xcc34('0x17')]===0x1f4){logger[_0xcc34('0x16')]('MailMessage,\x20%s,\x20%s',_0x1626b7,_0x55e517[_0xcc34('0x16')]['message']);return _0x390926(_0x55e517[_0xcc34('0x16')][_0xcc34('0x18')]);}logger['error'](_0xcc34('0x13'),_0x1626b7,_0x55e517[_0xcc34('0x16')][_0xcc34('0x18')]);return _0x4c64b7(_0x55e517[_0xcc34('0x16')][_0xcc34('0x18')]);}else{logger['info'](_0xcc34('0x13'),_0x1626b7,_0xcc34('0x14'));_0x4c64b7(_0x55e517[_0xcc34('0x19')]['message']);}})[_0xcc34('0x1a')](function(_0x30e58a){logger['error'](_0xcc34('0x13'),_0x1626b7,_0x30e58a);_0x390926(_0x30e58a);});});}function respondWithResult(_0x4194fe,_0x39471d){_0x39471d=_0x39471d||0xc8;return function(_0x46e466){if(_0x46e466){return _0x4194fe[_0xcc34('0x1b')](_0x39471d)[_0xcc34('0x1c')](_0x46e466);}};}function respondWithFilteredResult(_0x6fedf6,_0x477378){return function(_0x2665f4){if(_0x2665f4){var _0xccea60=typeof _0x477378['offset']===_0xcc34('0x1d')&&typeof _0x477378['limit']==='undefined';var _0x3c909f=_0x2665f4[_0xcc34('0x1e')];var _0x2310ca=_0xccea60?0x0:_0x477378[_0xcc34('0x1f')];var _0x184151=_0xccea60?_0x2665f4[_0xcc34('0x1e')]:_0x477378[_0xcc34('0x1f')]+_0x477378[_0xcc34('0x20')];var _0x309739;if(_0x184151>=_0x3c909f){_0x184151=_0x3c909f;_0x309739=0xc8;}else{_0x309739=0xce;}_0x6fedf6[_0xcc34('0x1b')](_0x309739);return _0x6fedf6[_0xcc34('0x21')]('Content-Range',_0x2310ca+'-'+_0x184151+'/'+_0x3c909f)[_0xcc34('0x1c')](_0x2665f4);}return null;};}function saveUpdates(_0x2bc473){return function(_0x559ea9){if(_0x559ea9){return _0x559ea9['update'](_0x2bc473)[_0xcc34('0x22')](function(_0x371bf5){return _0x371bf5;});}return null;};}function removeEntity(_0x27288f){return function(_0x5d73d0){if(_0x5d73d0){return _0x5d73d0[_0xcc34('0x23')]()[_0xcc34('0x22')](function(){_0x27288f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38ff39){return function(_0x215326){if(!_0x215326){_0x38ff39[_0xcc34('0x24')](0x194);}return _0x215326;};}function handleError(_0x3ab753,_0x131dad){_0x131dad=_0x131dad||0x1f4;return function(_0x305420){logger[_0xcc34('0x16')](_0x305420[_0xcc34('0x25')]);if(_0x305420[_0xcc34('0x26')]){delete _0x305420[_0xcc34('0x26')];}_0x3ab753['status'](_0x131dad)[_0xcc34('0x27')](_0x305420);};}exports['index']=function(_0x47ec97,_0x56407f){var _0x3464cb={},_0x2e19c2={},_0x3a5644={'count':0x0,'rows':[]};var _0x308a4f=_[_0xcc34('0x28')](db[_0xcc34('0x29')][_0xcc34('0x2a')],function(_0x30c931){return{'name':_0x30c931[_0xcc34('0x2b')],'type':_0x30c931[_0xcc34('0x2c')][_0xcc34('0x2d')]};});_0x2e19c2[_0xcc34('0x2e')]=_[_0xcc34('0x28')](_0x308a4f,'name');_0x2e19c2[_0xcc34('0x2f')]=_[_0xcc34('0x30')](_0x47ec97['query']);_0x2e19c2[_0xcc34('0x31')]=_[_0xcc34('0x32')](_0x2e19c2[_0xcc34('0x2e')],_0x2e19c2[_0xcc34('0x2f')]);_0x3464cb[_0xcc34('0x33')]=_['intersection'](_0x2e19c2[_0xcc34('0x2e')],qs[_0xcc34('0x34')](_0x47ec97[_0xcc34('0x2f')][_0xcc34('0x34')]));_0x3464cb['attributes']=_0x3464cb[_0xcc34('0x33')]['length']?_0x3464cb[_0xcc34('0x33')]:_0x2e19c2[_0xcc34('0x2e')];if(!_0x47ec97[_0xcc34('0x2f')][_0xcc34('0x35')](_0xcc34('0x36'))){_0x3464cb[_0xcc34('0x20')]=qs[_0xcc34('0x20')](_0x47ec97[_0xcc34('0x2f')][_0xcc34('0x20')]);_0x3464cb[_0xcc34('0x1f')]=qs[_0xcc34('0x1f')](_0x47ec97[_0xcc34('0x2f')][_0xcc34('0x1f')]);}_0x3464cb[_0xcc34('0x37')]=qs[_0xcc34('0x38')](_0x47ec97[_0xcc34('0x2f')][_0xcc34('0x38')]);_0x3464cb[_0xcc34('0x39')]=qs[_0xcc34('0x31')](_[_0xcc34('0x3a')](_0x47ec97[_0xcc34('0x2f')],_0x2e19c2['filters']),_0x308a4f);if(_0x47ec97[_0xcc34('0x2f')][_0xcc34('0x3b')]){_0x3464cb[_0xcc34('0x39')]=_[_0xcc34('0x3c')](_0x3464cb[_0xcc34('0x39')],{'$or':_[_0xcc34('0x28')](_0x308a4f,function(_0x5dbe29){if(_0x5dbe29[_0xcc34('0x2c')]!=='VIRTUAL'){var _0x515bd5={};_0x515bd5[_0x5dbe29[_0xcc34('0x26')]]={'$like':'%'+_0x47ec97[_0xcc34('0x2f')][_0xcc34('0x3b')]+'%'};return _0x515bd5;}})});}_0x3464cb=_['merge']({},_0x3464cb,_0x47ec97['options']);var _0x3b29bb={'where':_0x3464cb[_0xcc34('0x39')]};return db[_0xcc34('0x29')][_0xcc34('0x1e')](_0x3b29bb)[_0xcc34('0x22')](function(_0x2a4247){_0x3a5644[_0xcc34('0x1e')]=_0x2a4247;if(_0x47ec97[_0xcc34('0x2f')][_0xcc34('0x3d')]){_0x3464cb[_0xcc34('0x3e')]=[{'all':!![]}];}return db[_0xcc34('0x29')][_0xcc34('0x3f')](_0x3464cb);})[_0xcc34('0x22')](function(_0x33fd10){_0x3a5644[_0xcc34('0x40')]=_0x33fd10;return _0x3a5644;})[_0xcc34('0x22')](respondWithFilteredResult(_0x56407f,_0x3464cb))[_0xcc34('0x1a')](handleError(_0x56407f,null));};exports[_0xcc34('0x41')]=function(_0x5e6099,_0x3b1242){var _0xfd8022={'raw':!![],'where':{'id':_0x5e6099[_0xcc34('0x42')]['id']}},_0x31ce53={};_0x31ce53['model']=_[_0xcc34('0x30')](db[_0xcc34('0x29')][_0xcc34('0x2a')]);_0x31ce53[_0xcc34('0x2f')]=_[_0xcc34('0x30')](_0x5e6099[_0xcc34('0x2f')]);_0x31ce53[_0xcc34('0x31')]=_[_0xcc34('0x32')](_0x31ce53[_0xcc34('0x2e')],_0x31ce53['query']);_0xfd8022[_0xcc34('0x33')]=_['intersection'](_0x31ce53[_0xcc34('0x2e')],qs['fields'](_0x5e6099[_0xcc34('0x2f')]['fields']));_0xfd8022['attributes']=_0xfd8022[_0xcc34('0x33')][_0xcc34('0x43')]?_0xfd8022[_0xcc34('0x33')]:_0x31ce53['model'];if(_0x5e6099[_0xcc34('0x2f')][_0xcc34('0x3d')]){_0xfd8022[_0xcc34('0x3e')]=[{'all':!![]}];}_0xfd8022=_[_0xcc34('0x3c')]({},_0xfd8022,_0x5e6099[_0xcc34('0x44')]);return db[_0xcc34('0x29')][_0xcc34('0x45')](_0xfd8022)['then'](handleEntityNotFound(_0x3b1242,null))[_0xcc34('0x22')](respondWithResult(_0x3b1242,null))['catch'](handleError(_0x3b1242,null));};exports[_0xcc34('0x46')]=function(_0x1d8e3f,_0x477dc5){if(_0x1d8e3f[_0xcc34('0x47')]['id']){delete _0x1d8e3f[_0xcc34('0x47')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x1d8e3f[_0xcc34('0x42')]['id']}})[_0xcc34('0x22')](handleEntityNotFound(_0x477dc5,null))[_0xcc34('0x22')](saveUpdates(_0x1d8e3f[_0xcc34('0x47')],null))['then'](respondWithResult(_0x477dc5,null))[_0xcc34('0x1a')](handleError(_0x477dc5,null));};exports['destroy']=function(_0x583f12,_0x2ff7ab){return db[_0xcc34('0x29')]['find']({'where':{'id':_0x583f12[_0xcc34('0x42')]['id']}})[_0xcc34('0x22')](handleEntityNotFound(_0x2ff7ab,null))[_0xcc34('0x22')](removeEntity(_0x2ff7ab,null))['catch'](handleError(_0x2ff7ab,null));};exports['describe']=function(_0x2db535,_0x334f8a){return db['MailMessage'][_0xcc34('0x48')]()['then'](respondWithResult(_0x334f8a,null))['catch'](handleError(_0x334f8a,null));};exports['create']=function(_0x2abca3,_0x5bbbb5){return db[_0xcc34('0x29')][_0xcc34('0x49')](_0x2abca3[_0xcc34('0x47')])['then'](function(_0x21637a){if(_0x21637a){if(_0x21637a[_0xcc34('0x4a')]===_0xcc34('0x4b')&&!_0x21637a[_0xcc34('0x4c')]){var _0x66c2a8,_0xd92e2a,_0x18a206;if(_0x2abca3[_0xcc34('0x47')]['to']){_0xd92e2a=_0x2abca3[_0xcc34('0x47')]['to']['split'](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x21637a[_0xcc34('0x4d')]},'include':[{'model':db['CmList'],'as':_0xcc34('0x4e'),'include':[{'model':db['CmContact'],'as':_0xcc34('0x4f'),'where':{'email':_0xd92e2a},'limit':0x1,'order':[[_0xcc34('0x50'),_0xcc34('0x51')]]}]},{'model':db[_0xcc34('0x52')],'as':_0xcc34('0x53'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0xcc34('0x22')](function(_0x404f5f){_0x66c2a8=_0x404f5f;if(!_0x66c2a8||!_0x66c2a8['Smtp'])return;var _0x16e66e=_0x66c2a8[_0xcc34('0x54')]();if(_0x2abca3[_0xcc34('0x47')][_0xcc34('0x55')]&&_0x2abca3['body'][_0xcc34('0x55')]['length']){for(var _0x138626=0x0;_0x138626<_0x2abca3[_0xcc34('0x47')][_0xcc34('0x55')][_0xcc34('0x43')];_0x138626+=0x1){_0x2abca3[_0xcc34('0x47')]['attachments'][_0x138626]={'filename':_0x2abca3['body']['attachments'][_0x138626]['name'],'path':path['join'](config[_0xcc34('0x56')],_0xcc34('0x57'),_0x2abca3[_0xcc34('0x47')][_0xcc34('0x55')][_0x138626]['basename'])};}}_0x18a206={'account':_0x16e66e,'message':_0x2abca3[_0xcc34('0x47')]};return;})[_0xcc34('0x22')](function(){if(_0x66c2a8[_0xcc34('0x4e')]){if(_0x66c2a8[_0xcc34('0x4e')][_0xcc34('0x4f')][_0xcc34('0x43')]){return _0x66c2a8[_0xcc34('0x4e')][_0xcc34('0x4f')][0x0];}else{return db['CmContact'][_0xcc34('0x49')](_[_0xcc34('0xa')](_0x2abca3[_0xcc34('0x47')],{'firstName':_0x2abca3['body']['to'],'email':_0x2abca3['body']['to'],'phone':_0x2abca3[_0xcc34('0x47')]['to'],'ListId':_0x66c2a8[_0xcc34('0x58')]}));}}else{throw new Error(_0xcc34('0x59'));}})['then'](function(){if(_0x18a206){return respondWithRpcPromise(_0xcc34('0x5a'),'sendMail',_0x18a206,client9003)[_0xcc34('0x22')](function(_0x538fdf){return _0x21637a[_0xcc34('0x46')]({'read':!![],'messageId':_0x538fdf[_0xcc34('0x5b')],'sentAt':moment()['format'](_0xcc34('0x5c'))});})['catch'](function(_0x302733){logger['error']('%s',JSON[_0xcc34('0x5d')](_0x302733));return _0x21637a;});}return _0x21637a;});}return _0x21637a;}})[_0xcc34('0x22')](respondWithResult(_0x5bbbb5,0xc9))['catch'](handleError(_0x5bbbb5,null));};exports[_0xcc34('0x5e')]=function(_0x4a5e40,_0x499732){var _0x19e7ce={'agent':{},'channel':_0xcc34('0x5f')};if(_0x4a5e40['body']['id']){delete _0x4a5e40[_0xcc34('0x47')]['id'];}_0x4a5e40[_0xcc34('0x47')]['read']=!![];_0x4a5e40[_0xcc34('0x47')][_0xcc34('0x60')]=moment()[_0xcc34('0x61')](_0xcc34('0x5c'));_0x4a5e40[_0xcc34('0x47')][_0xcc34('0x62')]=_0x4a5e40[_0xcc34('0x47')]['UserId']||_0x4a5e40[_0xcc34('0x63')]['id'];_0x19e7ce[_0xcc34('0x64')]['id']=_0x4a5e40[_0xcc34('0x47')][_0xcc34('0x62')];return db['MailMessage']['find']({'where':{'id':_0x4a5e40[_0xcc34('0x42')]['id'],'UserId':null}})[_0xcc34('0x22')](handleEntityNotFound(_0x499732,null))[_0xcc34('0x22')](saveUpdates(_0x4a5e40['body'],null))['then'](function(_0x1d1c2a){if(_0x1d1c2a){_0x19e7ce[_0xcc34('0x18')]=_0x1d1c2a[_0xcc34('0x65')]({'plain':!![]});return db[_0xcc34('0x66')][_0xcc34('0x45')]({'where':{'id':_0x1d1c2a[_0xcc34('0x67')]}});}return null;})[_0xcc34('0x22')](handleEntityNotFound(_0x499732,null))[_0xcc34('0x22')](function(_0x4f2f3b){if(_0x4f2f3b){return _0x4f2f3b[_0xcc34('0x46')]({'UserId':_0x4a5e40[_0xcc34('0x47')][_0xcc34('0x62')],'read1stAt':_[_0xcc34('0x68')](_0x4f2f3b[_0xcc34('0x69')])?moment()[_0xcc34('0x61')](_0xcc34('0x5c')):undefined});}return null;})[_0xcc34('0x22')](function(_0x27f543){if(_0x27f543){_0x19e7ce[_0xcc34('0x6a')]=_0x27f543[_0xcc34('0x65')]({'plain':!![]});interaction_log['info'](_0xcc34('0x6b'),_0x4a5e40[_0xcc34('0x63')]['id'],_0x4a5e40[_0xcc34('0x63')][_0xcc34('0x26')],_0x4a5e40[_0xcc34('0x63')][_0xcc34('0x6c')],_0x19e7ce[_0xcc34('0x6a')]['id'],_0x4a5e40['body']?JSON[_0xcc34('0x5d')](_0x4a5e40['body']):_0xcc34('0x6d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x19e7ce);}return null;})[_0xcc34('0x22')](function(_0x44db7d){var _0x567354='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x44db7d['message'][_0xcc34('0x6e')];return db['sequelize']['query'](_0x567354,{'type':db['Sequelize'][_0xcc34('0x6f')][_0xcc34('0x70')],'raw':!![]})[_0xcc34('0x22')](function(_0x41c766){return _0x41c766;});})[_0xcc34('0x22')](function(_0x31cf9c){if(_0x31cf9c){_0x19e7ce[_0xcc34('0x18')][_0xcc34('0x71')]=_0x31cf9c[0x0];if(!_0x4a5e40[_0xcc34('0x47')][_0xcc34('0x62')])return;return db['User'][_0xcc34('0x45')]({'where':{'id':_0x4a5e40[_0xcc34('0x47')][_0xcc34('0x62')],'role':_0xcc34('0x64')},'attributes':['id',_0xcc34('0x26'),_0xcc34('0x72'),_0xcc34('0x73'),_0xcc34('0x74')],'raw':!![]});}return null;})[_0xcc34('0x22')](function(_0x5f0e1a){if(!_0x5f0e1a)return null;_0x19e7ce['message'][_0xcc34('0x64')]=_0x5f0e1a;return _0x19e7ce;})[_0xcc34('0x22')](function(_0x4f714a){if(_0x4f714a){if(_0x4a5e40[_0xcc34('0x47')]['manual']){_0x19e7ce[_0xcc34('0x18')][_0xcc34('0x75')]=util[_0xcc34('0x61')](_0xcc34('0x76'),_0x4a5e40[_0xcc34('0x63')]['name']);_0x19e7ce[_0xcc34('0x18')][_0xcc34('0x77')]=_0x19e7ce[_0xcc34('0x77')];_0x19e7ce[_0xcc34('0x18')][_0xcc34('0x78')]=_0x19e7ce['channel'];_0x19e7ce[_0xcc34('0x18')][_0xcc34('0x79')]=_0xcc34('0x5e');_0x19e7ce[_0xcc34('0x18')]['body']=htmlToText[_0xcc34('0x7a')](_0x19e7ce[_0xcc34('0x18')][_0xcc34('0x47')]);return respondWithRpcPromise(_0xcc34('0x7b'),_0xcc34('0x7b'),{'event':_0xcc34('0x7c'),'message':_0x19e7ce[_0xcc34('0x18')]},client9002)[_0xcc34('0x22')](function(){return _0x19e7ce;});}return _0x19e7ce;}return null;})['then'](respondWithResult(_0x499732,null))[_0xcc34('0x1a')](handleError(_0x499732,null));};exports[_0xcc34('0x7d')]=function(_0x505a9a,_0x4b46c5){var _0x460e05={'agent':{},'channel':_0xcc34('0x5f')};if(_0x505a9a[_0xcc34('0x47')]['id']){delete _0x505a9a[_0xcc34('0x47')]['id'];}_0x505a9a[_0xcc34('0x47')][_0xcc34('0x62')]=_0x505a9a[_0xcc34('0x47')][_0xcc34('0x62')]||_0x505a9a[_0xcc34('0x63')]['id'];_0x460e05[_0xcc34('0x64')]['id']=_0x505a9a[_0xcc34('0x47')][_0xcc34('0x62')];return db[_0xcc34('0x29')][_0xcc34('0x45')]({'where':{'id':_0x505a9a[_0xcc34('0x42')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4b46c5,null))[_0xcc34('0x22')](function(_0x3d3614){if(_0x3d3614){_0x460e05[_0xcc34('0x18')]=_0x3d3614[_0xcc34('0x65')]({'plain':!![]});return db[_0xcc34('0x66')][_0xcc34('0x45')]({'where':{'id':_0x3d3614['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4b46c5,null))[_0xcc34('0x22')](function(_0xa5e070){if(_0xa5e070){_0x460e05['interaction']=_0xa5e070[_0xcc34('0x65')]({'plain':!![]});interaction_log[_0xcc34('0x12')](_0xcc34('0x7e'),_0x505a9a['user']['id'],_0x505a9a[_0xcc34('0x63')]['name'],_0x505a9a[_0xcc34('0x63')][_0xcc34('0x6c')],_0x460e05[_0xcc34('0x6a')]['id'],_0x505a9a['body']?JSON[_0xcc34('0x5d')](_0x505a9a[_0xcc34('0x47')]):_0xcc34('0x6d'));return respondWithRpcPromise(_0xcc34('0x7f'),'rejectMessage',_0x460e05);}return null;})['then'](function(_0x26fde6){var _0x47dd19=_0xcc34('0x80')+_0x26fde6[_0xcc34('0x18')][_0xcc34('0x6e')];return db[_0xcc34('0x81')][_0xcc34('0x2f')](_0x47dd19,{'type':db[_0xcc34('0x82')][_0xcc34('0x6f')][_0xcc34('0x70')],'raw':!![]})[_0xcc34('0x22')](function(_0x122ffe){return _0x122ffe;});})[_0xcc34('0x22')](function(_0x539e8c){if(_0x539e8c){_0x460e05[_0xcc34('0x18')][_0xcc34('0x71')]=_0x539e8c[0x0];if(!_0x505a9a[_0xcc34('0x47')][_0xcc34('0x62')])return;return db[_0xcc34('0x83')][_0xcc34('0x45')]({'where':{'id':_0x505a9a['body'][_0xcc34('0x62')],'role':_0xcc34('0x64')},'attributes':['id','name',_0xcc34('0x72'),_0xcc34('0x73'),_0xcc34('0x74')],'raw':!![]});}return null;})[_0xcc34('0x22')](function(_0x4009dc){if(!_0x4009dc)return null;_0x460e05[_0xcc34('0x18')][_0xcc34('0x64')]=_0x4009dc;return _0x460e05;})[_0xcc34('0x22')](function(_0x46fb60){if(_0x46fb60){_0x46fb60[_0xcc34('0x18')][_0xcc34('0x75')]=util[_0xcc34('0x61')]('SIP/%s',_0x505a9a[_0xcc34('0x63')][_0xcc34('0x26')]);_0x46fb60['message'][_0xcc34('0x77')]=_0x460e05['channel'];_0x46fb60[_0xcc34('0x18')][_0xcc34('0x78')]=_0x460e05['channel'];_0x46fb60['message'][_0xcc34('0x79')]=_0xcc34('0x7d');_0x46fb60['message']['body']=htmlToText[_0xcc34('0x7a')](_0x460e05['message']['body']);respondWithRpcPromise('EventManager',_0xcc34('0x7b'),{'event':_0xcc34('0x84'),'message':_0x46fb60[_0xcc34('0x18')]},client9002);return _0x460e05;}return null;})[_0xcc34('0x22')](respondWithResult(_0x4b46c5,null))['catch'](handleError(_0x4b46c5,null));};exports[_0xcc34('0x85')]=function(_0x2aa02c,_0x83731){var _0x43416d=moment()[_0xcc34('0x86')]()[_0xcc34('0x87')]();var _0x13b209=path[_0xcc34('0x88')](config[_0xcc34('0x56')],_0xcc34('0x89'),_0xcc34('0x8a'),_0xcc34('0x8b'));var _0x31c859=path[_0xcc34('0x88')](config[_0xcc34('0x56')],_0xcc34('0x89'),'files',_0xcc34('0x55'));var _0x15c9ec=util['format']('message-%s.eml',_0x43416d);return db['MailMessage']['find']({'where':{'id':_0x2aa02c['params']['id']},'attributes':['id',_0xcc34('0x47'),_0xcc34('0x8c'),'to','cc',_0xcc34('0x8d'),_0xcc34('0x8e'),_0xcc34('0x8f')],'include':_0x2aa02c[_0xcc34('0x2f')]['attachments']?[{'model':db[_0xcc34('0x90')],'as':_0xcc34('0x91')}]:undefined})[_0xcc34('0x22')](handleEntityNotFound(_0x83731,null))[_0xcc34('0x22')](function(_0xe3cf0a){if(_0xe3cf0a){var _0x583b84=_0xe3cf0a;var _0x59b47c={'from':_0x583b84['from'],'to':_0x583b84['to'],'subject':_0x583b84[_0xcc34('0x8e')],'html':htmlEntities[_0xcc34('0x92')](_0x583b84[_0xcc34('0x47')]),'headers':{'Date':moment(_0x583b84[_0xcc34('0x8f')])['format'](_0xcc34('0x93'))},'attachments':[]};if(_0xe3cf0a['cc']){_0x59b47c[_0xcc34('0x94')]['Cc']=_0xe3cf0a['cc'];}if(_0xe3cf0a[_0xcc34('0x8d')]){_0x59b47c[_0xcc34('0x94')]['Bcc']=_0xe3cf0a['bcc'];}return new BPromise(function(_0x53d640,_0x5c0cd1){if(_0xe3cf0a['Attachments']){for(var _0x214f4c=0x0;_0x214f4c<_0xe3cf0a[_0xcc34('0x91')][_0xcc34('0x43')];_0x214f4c++){var _0x28ab47=_0xe3cf0a[_0xcc34('0x91')][_0x214f4c];var _0x2264c6=path['join'](_0x31c859,_0x28ab47[_0xcc34('0x95')]);if(fs['existsSync'](_0x2264c6)){_0x59b47c[_0xcc34('0x55')][_0xcc34('0x96')]({'name':_0x28ab47['name'],'contentType':_0x28ab47[_0xcc34('0x2c')],'data':fs[_0xcc34('0x97')](_0x2264c6)});}}}emlformat[_0xcc34('0x98')](_0x59b47c,function(_0x3da99d,_0x42ee00){if(_0x3da99d)return _0x5c0cd1(_0x3da99d);fs[_0xcc34('0x99')](path[_0xcc34('0x88')](_0x13b209,_0x15c9ec),_0x42ee00);return _0x53d640(_0x42ee00);});});}})[_0xcc34('0x22')](function(_0x1749ff){if(_0x1749ff){return _0x83731['download'](path[_0xcc34('0x88')](_0x13b209,_0x15c9ec),_0x15c9ec,function(_0xf8d622){if(!_0xf8d622)fs[_0xcc34('0x9a')](path[_0xcc34('0x88')](_0x13b209,_0x15c9ec));});}})[_0xcc34('0x1a')](handleError(_0x83731,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index c23d288..332e045 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 _0x2f40=['MailMessage','setMaxListeners','remove','emit','hasOwnProperty','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f40,0x133));var _0x02f4=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2f40[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x02f4('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x02f4('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x02f4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x02f4('0x3')};function emitEvent(_0x36d2d3){return function(_0x5b8f11,_0x342a73,_0x43d938){MailMessageEvents[_0x02f4('0x4')](_0x36d2d3+':'+_0x5b8f11['id'],_0x5b8f11);MailMessageEvents[_0x02f4('0x4')](_0x36d2d3,_0x5b8f11);_0x43d938(null);};}for(var e in events){if(events[_0x02f4('0x5')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x02f4('0x6')]=MailMessageEvents; \ No newline at end of file +var _0xbc08=['emit','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update'];(function(_0x121224,_0x34c351){var _0x471be8=function(_0x52ba33){while(--_0x52ba33){_0x121224['push'](_0x121224['shift']());}};_0x471be8(++_0x34c351);}(_0xbc08,0x150));var _0x8bc0=function(_0x42ab91,_0x2a0179){_0x42ab91=_0x42ab91-0x0;var _0x259d35=_0xbc08[_0x42ab91];return _0x259d35;};'use strict';var EventEmitter=require(_0x8bc0('0x0'));var MailMessage=require(_0x8bc0('0x1'))['db'][_0x8bc0('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x8bc0('0x3')](0x0);var events={'afterCreate':_0x8bc0('0x4'),'afterUpdate':_0x8bc0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3f7799){return function(_0x538331,_0x41aaaf,_0x449cf2){MailMessageEvents['emit'](_0x3f7799+':'+_0x538331['id'],_0x538331);MailMessageEvents[_0x8bc0('0x6')](_0x3f7799,_0x538331);_0x449cf2(null);};}for(var e in events){if(events[_0x8bc0('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x8bc0('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 6fe1726..6d7b17c 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 _0xb56f=['then','update','createdAt','direction','toLowerCase','error','utf8mb4','lodash','util','moment','bluebird','request-promise','html-to-text','path','rimraf','exports','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','models','get','out','secret','UserId','MailInteraction','findOne','MailInteractionId'];(function(_0x5cb0c0,_0x28b676){var _0x1ab652=function(_0x4169e0){while(--_0x4169e0){_0x5cb0c0['push'](_0x5cb0c0['shift']());}};_0x1ab652(++_0x28b676);}(_0xb56f,0x147));var _0xfb56=function(_0x327daa,_0x1f6daa){_0x327daa=_0x327daa-0x0;var _0x1ecc40=_0xb56f[_0x327daa];return _0x1ecc40;};'use strict';var _=require(_0xfb56('0x0'));var util=require(_0xfb56('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfb56('0x2'));var BPromise=require(_0xfb56('0x3'));var rp=require(_0xfb56('0x4'));var htmlToText=require(_0xfb56('0x5'));var fs=require('fs');var path=require(_0xfb56('0x6'));var rimraf=require(_0xfb56('0x7'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0xfb56('0x8')]=function(_0x51d4dc,_0x1c1f0c){return _0x51d4dc['define'](_0xfb56('0x9'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xfb56('0xa'),'fields':[_0xfb56('0xa')]},{'name':_0xfb56('0xb'),'fields':[_0xfb56('0xc'),_0xfb56('0xd')],'type':_0xfb56('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5bb7fa,_0x11bd38,_0x3273e3){if(_0x5bb7fa['body']){_0x5bb7fa['plainBody']=htmlToText[_0xfb56('0xf')](_0x5bb7fa[_0xfb56('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3273e3(null,_0x11bd38);},'afterCreate':function(_0x3da111,_0x441a2a,_0x2e88d1){var _0x1bce96=_0x51d4dc[_0xfb56('0x11')];var _0x417a8a=_0x3da111[_0xfb56('0x12')]({'plain':!![]});if(_0x417a8a['direction']['toLowerCase']()==='in'||_0x417a8a['direction']['toLowerCase']()===_0xfb56('0x13')&&!_0x417a8a[_0xfb56('0x14')]&&!_['isNil'](_0x417a8a[_0xfb56('0x15')])){_0x1bce96[_0xfb56('0x16')][_0xfb56('0x17')]({'where':{'id':_0x417a8a[_0xfb56('0x18')]}})[_0xfb56('0x19')](function(_0x2e624c){if(_0x2e624c){_0x2e624c[_0xfb56('0x1a')]({'lastMsgAt':_0x417a8a[_0xfb56('0x1b')],'lastMsgDirection':_0x417a8a[_0xfb56('0x1c')][_0xfb56('0x1d')]()});}})['catch'](function(_0x705f78){console[_0xfb56('0x1e')](_0x705f78);});}_0x2e88d1();}},'charset':_0xfb56('0x1f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7357=['request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','models','get','direction','out','secret','isNil','MailInteraction','findOne','MailInteractionId','then','update','toLowerCase','error','utf8mb4','lodash','../../config/logger','api','bluebird'];(function(_0x432075,_0x308bed){var _0x575582=function(_0x1337e7){while(--_0x1337e7){_0x432075['push'](_0x432075['shift']());}};_0x575582(++_0x308bed);}(_0x7357,0xa6));var _0x7735=function(_0x34c29a,_0x603039){_0x34c29a=_0x34c29a-0x0;var _0x586287=_0x7357[_0x34c29a];return _0x586287;};'use strict';var _=require(_0x7735('0x0'));var util=require('util');var logger=require(_0x7735('0x1'))(_0x7735('0x2'));var moment=require('moment');var BPromise=require(_0x7735('0x3'));var rp=require(_0x7735('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x7735('0x5'));var rimraf=require(_0x7735('0x6'));var config=require(_0x7735('0x7'));var attributes=require(_0x7735('0x8'));module[_0x7735('0x9')]=function(_0x21fd15,_0x44cd84){return _0x21fd15[_0x7735('0xa')](_0x7735('0xb'),attributes,{'tableName':_0x7735('0xc'),'paranoid':![],'indexes':[{'name':_0x7735('0xd'),'fields':[_0x7735('0xd')]},{'name':_0x7735('0xe'),'fields':[_0x7735('0xf'),_0x7735('0x10')],'type':_0x7735('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x91f17c,_0x40ab5b,_0xb924dc){if(_0x91f17c['body']){_0x91f17c[_0x7735('0xf')]=htmlToText[_0x7735('0x12')](_0x91f17c[_0x7735('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xb924dc(null,_0x40ab5b);},'afterCreate':function(_0x47b758,_0x4929d3,_0x400e8b){var _0x3f9bb3=_0x21fd15[_0x7735('0x14')];var _0x192915=_0x47b758[_0x7735('0x15')]({'plain':!![]});if(_0x192915[_0x7735('0x16')]['toLowerCase']()==='in'||_0x192915['direction']['toLowerCase']()===_0x7735('0x17')&&!_0x192915[_0x7735('0x18')]&&!_[_0x7735('0x19')](_0x192915['UserId'])){_0x3f9bb3[_0x7735('0x1a')][_0x7735('0x1b')]({'where':{'id':_0x192915[_0x7735('0x1c')]}})[_0x7735('0x1d')](function(_0x69cf98){if(_0x69cf98){_0x69cf98[_0x7735('0x1e')]({'lastMsgAt':_0x192915['createdAt'],'lastMsgDirection':_0x192915[_0x7735('0x16')][_0x7735('0x1f')]()});}})['catch'](function(_0x589aec){console[_0x7735('0x20')](_0x589aec);});}_0x400e8b();}},'charset':_0x7735('0x21'),'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 c5d6fb4..5feb639 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 _0xcf66=['redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailMessage,\x20%s,\x20%s','info','catch','CreateMailMessage','MailMessage','body','options','raw','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults'];(function(_0x3f733e,_0x10bfe2){var _0x226133=function(_0x65e6eb){while(--_0x65e6eb){_0x3f733e['push'](_0x3f733e['shift']());}};_0x226133(++_0x10bfe2);}(_0xcf66,0x71));var _0x6cf6=function(_0x5df6c9,_0xaf5a66){_0x5df6c9=_0x5df6c9-0x0;var _0x125841=_0xcf66[_0x5df6c9];return _0x125841;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});config['redis']=_[_0x6cf6('0xa')](config[_0x6cf6('0xb')],{'host':_0x6cf6('0xc'),'port':0x18eb});var socket=require(_0x6cf6('0xd'))(new Redis(config[_0x6cf6('0xb')]));require(_0x6cf6('0xe'))['register'](socket);function respondWithRpcPromise(_0x58378c,_0x5b7f4e,_0x8e90e){return new BPromise(function(_0x504c98,_0x1fdf80){return client[_0x6cf6('0xf')](_0x58378c,_0x8e90e)[_0x6cf6('0x10')](function(_0x3f7fc1){logger['info']('MailMessage,\x20%s,\x20%s',_0x5b7f4e,'request\x20sent');logger[_0x6cf6('0x11')](_0x6cf6('0x12'),_0x5b7f4e,_0x6cf6('0x13'),JSON[_0x6cf6('0x14')](_0x3f7fc1));if(_0x3f7fc1[_0x6cf6('0x15')]){if(_0x3f7fc1[_0x6cf6('0x15')]['code']===0x1f4){logger[_0x6cf6('0x15')]('MailMessage,\x20%s,\x20%s',_0x5b7f4e,_0x3f7fc1[_0x6cf6('0x15')][_0x6cf6('0x16')]);return _0x1fdf80(_0x3f7fc1['error'][_0x6cf6('0x16')]);}logger[_0x6cf6('0x15')](_0x6cf6('0x17'),_0x5b7f4e,_0x3f7fc1[_0x6cf6('0x15')][_0x6cf6('0x16')]);return _0x504c98(_0x3f7fc1[_0x6cf6('0x15')][_0x6cf6('0x16')]);}else{logger[_0x6cf6('0x18')](_0x6cf6('0x17'),_0x5b7f4e,_0x6cf6('0x13'));_0x504c98(_0x3f7fc1['result'][_0x6cf6('0x16')]);}})[_0x6cf6('0x19')](function(_0x22ab0){logger['error'](_0x6cf6('0x17'),_0x5b7f4e,_0x22ab0);_0x1fdf80(_0x22ab0);});});}exports[_0x6cf6('0x1a')]=function(_0x101e39){var _0x2995b3=this;return new Promise(function(_0x440634,_0x21e903){return db[_0x6cf6('0x1b')]['create'](_0x101e39[_0x6cf6('0x1c')],{'raw':_0x101e39[_0x6cf6('0x1d')]?_0x101e39[_0x6cf6('0x1d')][_0x6cf6('0x1e')]===undefined?!![]:![]:!![]})[_0x6cf6('0x10')](function(_0x470ea4){logger[_0x6cf6('0x18')](_0x6cf6('0x1a'),_0x101e39);logger['debug']('CreateMailMessage',_0x101e39,JSON[_0x6cf6('0x14')](_0x470ea4));_0x440634(_0x470ea4);})['catch'](function(_0x45ce6e){logger[_0x6cf6('0x15')](_0x6cf6('0x1a'),_0x45ce6e[_0x6cf6('0x16')],_0x101e39);_0x21e903(_0x2995b3[_0x6cf6('0x15')](0x1f4,_0x45ce6e[_0x6cf6('0x16')]));});});}; \ No newline at end of file +var _0x1c7c=['then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','CreateMailMessage','MailMessage','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register'];(function(_0x2330c0,_0x4ce8ed){var _0x4463a8=function(_0x48bf39){while(--_0x48bf39){_0x2330c0['push'](_0x2330c0['shift']());}};_0x4463a8(++_0x4ce8ed);}(_0x1c7c,0x164));var _0xc1c7=function(_0x34df4e,_0x4eac3e){_0x34df4e=_0x34df4e-0x0;var _0x47008f=_0x1c7c[_0x34df4e];return _0x47008f;};'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')]('MailMessage,\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);});});}exports[_0xc1c7('0x1d')]=function(_0x4b706e){var _0x124fd8=this;return new Promise(function(_0x4d6171,_0x5e7e4a){return db[_0xc1c7('0x1e')]['create'](_0x4b706e['body'],{'raw':_0x4b706e[_0xc1c7('0x1f')]?_0x4b706e[_0xc1c7('0x1f')][_0xc1c7('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x813853){logger[_0xc1c7('0x13')](_0xc1c7('0x1d'),_0x4b706e);logger[_0xc1c7('0x15')](_0xc1c7('0x1d'),_0x4b706e,JSON[_0xc1c7('0x17')](_0x813853));_0x4d6171(_0x813853);})[_0xc1c7('0x21')](function(_0x120168){logger[_0xc1c7('0x18')](_0xc1c7('0x1d'),_0x120168[_0xc1c7('0x1b')],_0x4b706e);_0x5e7e4a(_0x124fd8[_0xc1c7('0x18')](0x1f4,_0x120168[_0xc1c7('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index c22638e..3f53a20 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 _0x63ea=['save','remove','emit','removeListener','register','./mailMessage.events'];(function(_0xb2bca6,_0x5f4359){var _0xb5d0f0=function(_0x5eaffb){while(--_0x5eaffb){_0xb2bca6['push'](_0xb2bca6['shift']());}};_0xb5d0f0(++_0x5f4359);}(_0x63ea,0x15b));var _0xa63e=function(_0x32731d,_0x563bce){_0x32731d=_0x32731d-0x0;var _0x58591a=_0x63ea[_0x32731d];return _0x58591a;};'use strict';var MailMessageEvents=require(_0xa63e('0x0'));var events=[_0xa63e('0x1'),_0xa63e('0x2'),'update'];function createListener(_0x5756c9,_0x572cff){return function(_0x103c28){_0x572cff[_0xa63e('0x3')](_0x5756c9,_0x103c28);};}function removeListener(_0x2ac8f8,_0x32f232){return function(){MailMessageEvents[_0xa63e('0x4')](_0x2ac8f8,_0x32f232);};}exports[_0xa63e('0x5')]=function(_0xb20fbe){for(var _0x5ad84f=0x0,_0x1f0294=events['length'];_0x5ad84f<_0x1f0294;_0x5ad84f++){var _0x1c509f=events[_0x5ad84f];var _0x3d91ca=createListener('mailMessage:'+_0x1c509f,_0xb20fbe);MailMessageEvents['on'](_0x1c509f,_0x3d91ca);}}; \ No newline at end of file +var _0x16a6=['register','mailMessage:','./mailMessage.events','save','remove','emit'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x16a6,0x6e));var _0x616a=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0x16a6[_0x3e3bee];return _0x3ae14c;};'use strict';var MailMessageEvents=require(_0x616a('0x0'));var events=[_0x616a('0x1'),_0x616a('0x2'),'update'];function createListener(_0x5f563e,_0x42f828){return function(_0x497e3b){_0x42f828[_0x616a('0x3')](_0x5f563e,_0x497e3b);};}function removeListener(_0x4d00b7,_0x877e29){return function(){MailMessageEvents['removeListener'](_0x4d00b7,_0x877e29);};}exports[_0x616a('0x4')]=function(_0x5a53aa){for(var _0x1af6e5=0x0,_0x7e7331=events['length'];_0x1af6e5<_0x7e7331;_0x1af6e5++){var _0x33b0e9=events[_0x1af6e5];var _0x3317de=createListener(_0x616a('0x5')+_0x33b0e9,_0x5a53aa);MailMessageEvents['on'](_0x33b0e9,_0x3317de);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index a69a027..5a79495 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 _0x2011=['../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','getTeams','post','create','/:id/teams','addAgents','destroy','delete','removeTeams','/:id/users','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x405412,_0x4219a3){var _0xd14dea=function(_0x9e451c){while(--_0x9e451c){_0x405412['push'](_0x405412['shift']());}};_0xd14dea(++_0x4219a3);}(_0x2011,0x1ce));var _0x1201=function(_0x179446,_0x50a0c5){_0x179446=_0x179446-0x0;var _0x40c374=_0x2011[_0x179446];return _0x40c374;};'use strict';var multer=require(_0x1201('0x0'));var util=require('util');var path=require(_0x1201('0x1'));var timeout=require(_0x1201('0x2'));var express=require(_0x1201('0x3'));var router=express[_0x1201('0x4')]();var fs_extra=require(_0x1201('0x5'));var auth=require(_0x1201('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1201('0x7'));var controller=require(_0x1201('0x8'));router[_0x1201('0x9')]('/',auth[_0x1201('0xa')](),controller[_0x1201('0xb')]);router[_0x1201('0x9')]('/describe',auth[_0x1201('0xa')](),controller[_0x1201('0xc')]);router[_0x1201('0x9')](_0x1201('0xd'),auth[_0x1201('0xa')](),controller[_0x1201('0xe')]);router[_0x1201('0x9')](_0x1201('0xf'),auth[_0x1201('0xa')](),controller[_0x1201('0x10')]);router[_0x1201('0x9')]('/:id/teams',auth[_0x1201('0xa')](),controller[_0x1201('0x11')]);router[_0x1201('0x9')]('/:id/users',auth[_0x1201('0xa')](),controller['getAgents']);router[_0x1201('0x12')]('/',auth[_0x1201('0xa')](),controller[_0x1201('0x13')]);router[_0x1201('0x12')](_0x1201('0x14'),auth[_0x1201('0xa')](),controller['addTeams']);router[_0x1201('0x12')]('/:id/users',auth[_0x1201('0xa')](),controller[_0x1201('0x15')]);router['put'](_0x1201('0xd'),auth[_0x1201('0xa')](),controller['update']);router['delete'](_0x1201('0xd'),auth[_0x1201('0xa')](),controller[_0x1201('0x16')]);router[_0x1201('0x17')](_0x1201('0x14'),auth[_0x1201('0xa')](),controller[_0x1201('0x18')]);router['delete'](_0x1201('0x19'),auth[_0x1201('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xd6e7=['update','destroy','delete','removeTeams','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','index','describe','/:id','isAuthenticated','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x2caa99,_0x722367){var _0xdbd3de=function(_0x1ff0c3){while(--_0x1ff0c3){_0x2caa99['push'](_0x2caa99['shift']());}};_0xdbd3de(++_0x722367);}(_0xd6e7,0x19c));var _0x7d6e=function(_0x378f96,_0x13667f){_0x378f96=_0x378f96-0x0;var _0x10a677=_0xd6e7[_0x378f96];return _0x10a677;};'use strict';var multer=require(_0x7d6e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7d6e('0x1'));var express=require('express');var router=express[_0x7d6e('0x2')]();var fs_extra=require(_0x7d6e('0x3'));var auth=require(_0x7d6e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7d6e('0x5'));var controller=require(_0x7d6e('0x6'));router[_0x7d6e('0x7')]('/',auth['isAuthenticated'](),controller[_0x7d6e('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7d6e('0x9')]);router[_0x7d6e('0x7')](_0x7d6e('0xa'),auth[_0x7d6e('0xb')](),controller[_0x7d6e('0xc')]);router[_0x7d6e('0x7')](_0x7d6e('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0x7d6e('0x7')](_0x7d6e('0xe'),auth[_0x7d6e('0xb')](),controller[_0x7d6e('0xf')]);router[_0x7d6e('0x7')](_0x7d6e('0x10'),auth['isAuthenticated'](),controller[_0x7d6e('0x11')]);router[_0x7d6e('0x12')]('/',auth[_0x7d6e('0xb')](),controller[_0x7d6e('0x13')]);router[_0x7d6e('0x12')](_0x7d6e('0xe'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x7d6e('0x10'),auth[_0x7d6e('0xb')](),controller['addAgents']);router['put'](_0x7d6e('0xa'),auth[_0x7d6e('0xb')](),controller[_0x7d6e('0x14')]);router['delete'](_0x7d6e('0xa'),auth['isAuthenticated'](),controller[_0x7d6e('0x15')]);router[_0x7d6e('0x16')](_0x7d6e('0xe'),auth[_0x7d6e('0xb')](),controller[_0x7d6e('0x17')]);router[_0x7d6e('0x16')](_0x7d6e('0x10'),auth[_0x7d6e('0xb')](),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 20d5569..e98c379 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 _0x0738=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x4030df,_0x1de717){var _0x1bd3fe=function(_0x568cf2){while(--_0x568cf2){_0x4030df['push'](_0x4030df['shift']());}};_0x1bd3fe(++_0x1de717);}(_0x0738,0x1b0));var _0x8073=function(_0x3a93b7,_0x658183){_0x3a93b7=_0x3a93b7-0x0;var _0x2ed891=_0x0738[_0x3a93b7];return _0x2ed891;};'use strict';var Sequelize=require(_0x8073('0x0'));module['exports']={'name':{'type':Sequelize[_0x8073('0x1')],'unique':_0x8073('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8073('0x1')]},'timeout':{'type':Sequelize[_0x8073('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8073('0x4')](_0x8073('0x5'),_0x8073('0x6'),_0x8073('0x7'))}}; \ No newline at end of file +var _0x08bd=['sequelize','exports','name','INTEGER','rrmemory','beepall'];(function(_0x23a079,_0xb8c9aa){var _0x53f2a5=function(_0x1b3dc5){while(--_0x1b3dc5){_0x23a079['push'](_0x23a079['shift']());}};_0x53f2a5(++_0xb8c9aa);}(_0x08bd,0x15c));var _0xd08b=function(_0x54fbc6,_0x350bc9){_0x54fbc6=_0x54fbc6-0x0;var _0x41136d=_0x08bd[_0x54fbc6];return _0x41136d;};'use strict';var Sequelize=require(_0xd08b('0x0'));module[_0xd08b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd08b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd08b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd08b('0x4'),_0xd08b('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index b6998c4..ccf3153 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 _0xb701=['mailPause','createdAt','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','userMailQueue:save','removeTeams','select','field','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','TeamId','includes','compact','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','emit','isArray','userMailQueue:remove','getAgents','rimraf','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','order','MailQueueId','User','UserId'];(function(_0x35deef,_0x95389b){var _0x3f0f58=function(_0xc586f0){while(--_0xc586f0){_0x35deef['push'](_0x35deef['shift']());}};_0x3f0f58(++_0x95389b);}(_0xb701,0x144));var _0x1b70=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xb701[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b70('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1b70('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1b70('0x2'));var Mustache=require(_0x1b70('0x3'));var util=require(_0x1b70('0x4'));var path=require(_0x1b70('0x5'));var sox=require(_0x1b70('0x6'));var csv=require(_0x1b70('0x7'));var ejs=require(_0x1b70('0x8'));var fs=require('fs');var fs_extra=require(_0x1b70('0x9'));var _=require(_0x1b70('0xa'));var squel=require(_0x1b70('0xb'));var crypto=require('crypto');var jsforce=require(_0x1b70('0xc'));var deskjs=require(_0x1b70('0xd'));var toCsv=require(_0x1b70('0x7'));var querystring=require(_0x1b70('0xe'));var Papa=require(_0x1b70('0xf'));var Redis=require(_0x1b70('0x10'));var authService=require(_0x1b70('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1b70('0x12'));var hardwareService=require(_0x1b70('0x13'));var logger=require(_0x1b70('0x14'))(_0x1b70('0x15'));var utils=require(_0x1b70('0x16'));var config=require(_0x1b70('0x17'));var licenseUtil=require(_0x1b70('0x18'));var db=require(_0x1b70('0x19'))['db'];config[_0x1b70('0x1a')]=_[_0x1b70('0x1b')](config[_0x1b70('0x1a')],{'host':_0x1b70('0x1c'),'port':0x18eb});var socket=require(_0x1b70('0x1d'))(new Redis(config['redis']));require(_0x1b70('0x1e'))[_0x1b70('0x1f')](socket);function respondWithStatusCode(_0x2bb814,_0x3c2d01){_0x3c2d01=_0x3c2d01||0xcc;return function(_0x4bf988){if(_0x4bf988){return _0x2bb814['sendStatus'](_0x3c2d01);}return _0x2bb814['status'](_0x3c2d01)[_0x1b70('0x20')]();};}function respondWithResult(_0x3e28ee,_0x26a7f1){_0x26a7f1=_0x26a7f1||0xc8;return function(_0x259381){if(_0x259381){return _0x3e28ee[_0x1b70('0x21')](_0x26a7f1)[_0x1b70('0x22')](_0x259381);}};}function respondWithFilteredResult(_0x507dc1,_0x92c001){return function(_0xf12970){if(_0xf12970){var _0x2ccfbe=typeof _0x92c001['offset']===_0x1b70('0x23')&&typeof _0x92c001[_0x1b70('0x24')]===_0x1b70('0x23');var _0x234953=_0xf12970[_0x1b70('0x25')];var _0x328c85=_0x2ccfbe?0x0:_0x92c001[_0x1b70('0x26')];var _0x3c1b43=_0x2ccfbe?_0xf12970['count']:_0x92c001[_0x1b70('0x26')]+_0x92c001[_0x1b70('0x24')];var _0x3dc143;if(_0x3c1b43>=_0x234953){_0x3c1b43=_0x234953;_0x3dc143=0xc8;}else{_0x3dc143=0xce;}_0x507dc1['status'](_0x3dc143);return _0x507dc1[_0x1b70('0x27')](_0x1b70('0x28'),_0x328c85+'-'+_0x3c1b43+'/'+_0x234953)[_0x1b70('0x22')](_0xf12970);}return null;};}function patchUpdates(_0x459928){return function(_0x5872b1){try{jsonpatch[_0x1b70('0x29')](_0x5872b1,_0x459928,!![]);}catch(_0x2a0576){return BPromise[_0x1b70('0x2a')](_0x2a0576);}return _0x5872b1[_0x1b70('0x2b')]();};}function saveUpdates(_0x10137a,_0xf259cc){return function(_0xc78df3){if(_0xc78df3){return _0xc78df3[_0x1b70('0x2c')](_0x10137a)[_0x1b70('0x2d')](function(_0x2c6423){return _0x2c6423;});}return null;};}function removeEntity(_0x1cc2ac,_0x48d10b){return function(_0x50862d){if(_0x50862d){return _0x50862d[_0x1b70('0x2e')]()[_0x1b70('0x2d')](function(){var _0x578645=_0x50862d[_0x1b70('0x2f')]({'plain':!![]});var _0x99fa44=_0x1b70('0x30');return db[_0x1b70('0x31')]['destroy']({'where':{'type':_0x99fa44,'resourceId':_0x578645['id']}})['then'](function(){return _0x50862d;});})[_0x1b70('0x2d')](function(){_0x1cc2ac[_0x1b70('0x21')](0xcc)[_0x1b70('0x20')]();});}};}function handleEntityNotFound(_0x27caa3,_0x3e680b){return function(_0x4bbe5a){if(!_0x4bbe5a){_0x27caa3[_0x1b70('0x32')](0x194);}return _0x4bbe5a;};}function handleError(_0x1e674d,_0x54b7e5){_0x54b7e5=_0x54b7e5||0x1f4;return function(_0x436850){logger[_0x1b70('0x33')](_0x436850[_0x1b70('0x34')]);if(_0x436850['name']){delete _0x436850[_0x1b70('0x35')];}_0x1e674d[_0x1b70('0x21')](_0x54b7e5)[_0x1b70('0x36')](_0x436850);};}exports[_0x1b70('0x37')]=function(_0x1dfc89,_0x433afe){var _0x4fb444={},_0x1cac6c={},_0x1f01a7={'count':0x0,'rows':[]};var _0x18b8a8=_[_0x1b70('0x38')](db[_0x1b70('0x39')][_0x1b70('0x3a')],function(_0x4f5329){return{'name':_0x4f5329[_0x1b70('0x3b')],'type':_0x4f5329['type']['key']};});_0x1cac6c[_0x1b70('0x3c')]=_[_0x1b70('0x38')](_0x18b8a8,_0x1b70('0x35'));_0x1cac6c[_0x1b70('0x3d')]=_[_0x1b70('0x3e')](_0x1dfc89[_0x1b70('0x3d')]);_0x1cac6c[_0x1b70('0x3f')]=_[_0x1b70('0x40')](_0x1cac6c[_0x1b70('0x3c')],_0x1cac6c[_0x1b70('0x3d')]);_0x4fb444[_0x1b70('0x41')]=_[_0x1b70('0x40')](_0x1cac6c[_0x1b70('0x3c')],qs[_0x1b70('0x42')](_0x1dfc89[_0x1b70('0x3d')][_0x1b70('0x42')]));_0x4fb444[_0x1b70('0x41')]=_0x4fb444['attributes']['length']?_0x4fb444[_0x1b70('0x41')]:_0x1cac6c[_0x1b70('0x3c')];if(!_0x1dfc89['query'][_0x1b70('0x43')](_0x1b70('0x44'))){_0x4fb444[_0x1b70('0x24')]=qs[_0x1b70('0x24')](_0x1dfc89[_0x1b70('0x3d')][_0x1b70('0x24')]);_0x4fb444[_0x1b70('0x26')]=qs[_0x1b70('0x26')](_0x1dfc89[_0x1b70('0x3d')][_0x1b70('0x26')]);}_0x4fb444['order']=qs[_0x1b70('0x45')](_0x1dfc89[_0x1b70('0x3d')][_0x1b70('0x45')]);_0x4fb444[_0x1b70('0x46')]=qs[_0x1b70('0x3f')](_[_0x1b70('0x47')](_0x1dfc89[_0x1b70('0x3d')],_0x1cac6c[_0x1b70('0x3f')]),_0x18b8a8);if(_0x1dfc89[_0x1b70('0x3d')][_0x1b70('0x48')]){_0x4fb444['where']=_[_0x1b70('0x49')](_0x4fb444[_0x1b70('0x46')],{'$or':_[_0x1b70('0x38')](_0x18b8a8,function(_0x5a4c83){if(_0x5a4c83[_0x1b70('0x4a')]!=='VIRTUAL'){var _0x203c70={};_0x203c70[_0x5a4c83[_0x1b70('0x35')]]={'$like':'%'+_0x1dfc89['query']['filter']+'%'};return _0x203c70;}})});}_0x4fb444=_[_0x1b70('0x49')]({},_0x4fb444,_0x1dfc89['options']);var _0x5065c9={'where':_0x4fb444[_0x1b70('0x46')]};return db[_0x1b70('0x39')]['count'](_0x5065c9)[_0x1b70('0x2d')](function(_0x38c9f9){_0x1f01a7[_0x1b70('0x25')]=_0x38c9f9;if(_0x1dfc89[_0x1b70('0x3d')][_0x1b70('0x4b')]){_0x4fb444[_0x1b70('0x4c')]=[{'all':!![]}];}return db['MailQueue'][_0x1b70('0x4d')](_0x4fb444);})['then'](function(_0x428459){_0x1f01a7[_0x1b70('0x4e')]=_0x428459;return _0x1f01a7;})[_0x1b70('0x2d')](respondWithFilteredResult(_0x433afe,_0x4fb444))[_0x1b70('0x4f')](handleError(_0x433afe,null));};exports[_0x1b70('0x50')]=function(_0x3566d8,_0x46d030){var _0x483f5b={'raw':!![],'where':{'id':_0x3566d8[_0x1b70('0x51')]['id']}},_0x14429f={};_0x14429f[_0x1b70('0x3c')]=_['keys'](db[_0x1b70('0x39')][_0x1b70('0x3a')]);_0x14429f[_0x1b70('0x3d')]=_['keys'](_0x3566d8['query']);_0x14429f['filters']=_['intersection'](_0x14429f[_0x1b70('0x3c')],_0x14429f[_0x1b70('0x3d')]);_0x483f5b[_0x1b70('0x41')]=_[_0x1b70('0x40')](_0x14429f['model'],qs[_0x1b70('0x42')](_0x3566d8['query']['fields']));_0x483f5b[_0x1b70('0x41')]=_0x483f5b[_0x1b70('0x41')][_0x1b70('0x52')]?_0x483f5b[_0x1b70('0x41')]:_0x14429f[_0x1b70('0x3c')];if(_0x3566d8[_0x1b70('0x3d')][_0x1b70('0x4b')]){_0x483f5b[_0x1b70('0x4c')]=[{'all':!![]}];}_0x483f5b=_['merge']({},_0x483f5b,_0x3566d8[_0x1b70('0x53')]);return db[_0x1b70('0x39')][_0x1b70('0x54')](_0x483f5b)['then'](handleEntityNotFound(_0x46d030,null))['then'](respondWithResult(_0x46d030,null))['catch'](handleError(_0x46d030,null));};exports['create']=function(_0x208d76,_0x1b26e3){return db['MailQueue'][_0x1b70('0x55')](_0x208d76[_0x1b70('0x56')],{})[_0x1b70('0x2d')](function(_0x1f6134){var _0x29c4f1=_0x208d76[_0x1b70('0x57')][_0x1b70('0x2f')]({'plain':!![]});if(!_0x29c4f1)throw new Error(_0x1b70('0x58'));if(_0x29c4f1['role']===_0x1b70('0x57')){var _0x31646e=_0x1f6134[_0x1b70('0x2f')]({'plain':!![]});var _0x7de4e9=_0x1b70('0x30');return db['UserProfileSection'][_0x1b70('0x54')]({'where':{'name':_0x7de4e9,'userProfileId':_0x29c4f1[_0x1b70('0x59')]},'raw':!![]})[_0x1b70('0x2d')](function(_0x3000e6){if(_0x3000e6&&_0x3000e6['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x31646e[_0x1b70('0x35')],'resourceId':_0x31646e['id'],'type':_0x3000e6[_0x1b70('0x35')],'sectionId':_0x3000e6['id']},{})[_0x1b70('0x2d')](function(){return _0x1f6134;});}else{return _0x1f6134;}})['catch'](function(_0x56f687){logger[_0x1b70('0x33')](_0x1b70('0x5a'),_0x56f687);throw _0x56f687;});}return _0x1f6134;})[_0x1b70('0x2d')](respondWithResult(_0x1b26e3,0xc9))['catch'](handleError(_0x1b26e3,null));};exports[_0x1b70('0x2c')]=function(_0x5ee778,_0x471c5d){if(_0x5ee778[_0x1b70('0x56')]['id']){delete _0x5ee778[_0x1b70('0x56')]['id'];}return db[_0x1b70('0x39')][_0x1b70('0x54')]({'where':{'id':_0x5ee778[_0x1b70('0x51')]['id']}})['then'](handleEntityNotFound(_0x471c5d,null))[_0x1b70('0x2d')](saveUpdates(_0x5ee778[_0x1b70('0x56')],null))[_0x1b70('0x2d')](respondWithResult(_0x471c5d,null))[_0x1b70('0x4f')](handleError(_0x471c5d,null));};exports[_0x1b70('0x2e')]=function(_0xa05eb8,_0x4539f3){return db['MailQueue'][_0x1b70('0x54')]({'where':{'id':_0xa05eb8[_0x1b70('0x51')]['id']}})[_0x1b70('0x2d')](handleEntityNotFound(_0x4539f3,null))[_0x1b70('0x2d')](removeEntity(_0x4539f3,null))[_0x1b70('0x4f')](handleError(_0x4539f3,null));};exports[_0x1b70('0x5b')]=function(_0x3dbfdb,_0x13e4b2){return db['MailQueue'][_0x1b70('0x5b')]()['then'](respondWithResult(_0x13e4b2,null))[_0x1b70('0x4f')](handleError(_0x13e4b2,null));};exports[_0x1b70('0x5c')]=function(_0xd9d0b9,_0x2da554,_0x3aae59){var _0x1cf0a0={'raw':!![],'where':{}},_0xf8cf73={},_0x5e64a1;return db[_0x1b70('0x39')][_0x1b70('0x5d')]({'where':{'id':_0xd9d0b9[_0x1b70('0x51')]['id']}})[_0x1b70('0x2d')](handleEntityNotFound(_0x2da554,null))[_0x1b70('0x2d')](function(_0x4732de){if(_0x4732de){_0x5e64a1=_0x4732de[_0x1b70('0x2f')]({'plain':!![]});_0xf8cf73[_0x1b70('0x3c')]=_[_0x1b70('0x3e')](db[_0x1b70('0x5e')]['rawAttributes']);_0xf8cf73[_0x1b70('0x3d')]=_[_0x1b70('0x3e')](_0xd9d0b9[_0x1b70('0x3d')]);_0xf8cf73[_0x1b70('0x3f')]=_['intersection'](_0xf8cf73['model'],_0xf8cf73['query']);_0x1cf0a0['attributes']=_[_0x1b70('0x40')](_0xf8cf73['model'],qs['fields'](_0xd9d0b9[_0x1b70('0x3d')][_0x1b70('0x42')]));_0x1cf0a0['attributes']=_0x1cf0a0[_0x1b70('0x41')]['length']?_0x1cf0a0[_0x1b70('0x41')]:_0xf8cf73[_0x1b70('0x3c')];if(!_0xd9d0b9[_0x1b70('0x3d')][_0x1b70('0x43')](_0x1b70('0x44'))){_0x1cf0a0[_0x1b70('0x24')]=qs[_0x1b70('0x24')](_0xd9d0b9[_0x1b70('0x3d')][_0x1b70('0x24')]);_0x1cf0a0['offset']=qs['offset'](_0xd9d0b9[_0x1b70('0x3d')][_0x1b70('0x26')]);}_0x1cf0a0[_0x1b70('0x5f')]=qs['sort'](_0xd9d0b9[_0x1b70('0x3d')][_0x1b70('0x45')]);_0x1cf0a0[_0x1b70('0x46')]=qs[_0x1b70('0x3f')](_['pick'](_0xd9d0b9['query'],_0xf8cf73[_0x1b70('0x3f')]));_0x1cf0a0['where'][_0x1b70('0x60')]=_0x4732de['id'];if(_0xd9d0b9['query'][_0x1b70('0x48')]){_0x1cf0a0[_0x1b70('0x46')]=_[_0x1b70('0x49')](_0x1cf0a0[_0x1b70('0x46')],{'$or':_[_0x1b70('0x38')](_0x1cf0a0[_0x1b70('0x41')],function(_0x34e090){var _0x1f3999={};_0x1f3999[_0x34e090]={'$like':'%'+_0xd9d0b9[_0x1b70('0x3d')][_0x1b70('0x48')]+'%'};return _0x1f3999;})});}_0x1cf0a0=_[_0x1b70('0x49')]({},_0x1cf0a0,_0xd9d0b9[_0x1b70('0x53')]);return db[_0x1b70('0x5e')]['findAll'](_0x1cf0a0);}})['then'](function(_0x571047){if(_0x571047){return db[_0x1b70('0x61')]['findAndCountAll']({'where':{'id':_['map'](_0x571047,_0x1b70('0x62')),'role':'agent'},'attributes':['id',_0x1b70('0x35'),_0x1b70('0x63'),'updatedAt',_0x1b70('0x64')]});}})[_0x1b70('0x2d')](function(_0x314efb){if(_0x314efb){return{'count':_0x314efb[_0x1b70('0x25')],'rows':_[_0x1b70('0x38')](_0x314efb['rows'],function(_0x48cf30){return{'membername':_0x48cf30[_0x1b70('0x35')],'UserId':_0x48cf30['id'],'queue_name':_0x5e64a1['name'],'MailQueueId':_0x5e64a1['id'],'interface':util['format']('%s/%s',_0x1b70('0x65'),_0x48cf30[_0x1b70('0x35')]),'penalty':0x0,'paused':_0x48cf30['mailPause'],'createdAt':_0x48cf30[_0x1b70('0x64')],'updatedAt':_0x48cf30['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2da554,_0x1cf0a0))[_0x1b70('0x4f')](handleError(_0x2da554,null));};exports[_0x1b70('0x66')]=function(_0x525fe3,_0x4b03f4,_0xeaee9b){var _0x420f6c={};var _0x236907={};var _0x113dc3;var _0x2ddb41;return db[_0x1b70('0x39')][_0x1b70('0x5d')]({'where':{'id':_0x525fe3['params']['id']}})['then'](handleEntityNotFound(_0x4b03f4,null))['then'](function(_0x460ce5){if(_0x460ce5){_0x113dc3=_0x460ce5;_0x236907[_0x1b70('0x3c')]=_[_0x1b70('0x3e')](db[_0x1b70('0x67')][_0x1b70('0x3a')]);_0x236907[_0x1b70('0x3d')]=_[_0x1b70('0x3e')](_0x525fe3[_0x1b70('0x3d')]);_0x236907[_0x1b70('0x3f')]=_[_0x1b70('0x40')](_0x236907[_0x1b70('0x3c')],_0x236907[_0x1b70('0x3d')]);_0x420f6c[_0x1b70('0x41')]=_['intersection'](_0x236907[_0x1b70('0x3c')],qs[_0x1b70('0x42')](_0x525fe3['query'][_0x1b70('0x42')]));_0x420f6c[_0x1b70('0x41')]=_0x420f6c[_0x1b70('0x41')][_0x1b70('0x52')]?_0x420f6c[_0x1b70('0x41')]:_0x236907[_0x1b70('0x3c')];_0x420f6c[_0x1b70('0x5f')]=qs[_0x1b70('0x45')](_0x525fe3[_0x1b70('0x3d')][_0x1b70('0x45')]);_0x420f6c['where']=qs['filters'](_[_0x1b70('0x47')](_0x525fe3[_0x1b70('0x3d')],_0x236907[_0x1b70('0x3f')]));if(_0x525fe3[_0x1b70('0x3d')][_0x1b70('0x48')]){_0x420f6c[_0x1b70('0x46')]=_[_0x1b70('0x49')](_0x420f6c[_0x1b70('0x46')],{'$or':_[_0x1b70('0x38')](_0x420f6c[_0x1b70('0x41')],function(_0x14ad9f){var _0x248bab={};_0x248bab[_0x14ad9f]={'$like':'%'+_0x525fe3[_0x1b70('0x3d')][_0x1b70('0x48')]+'%'};return _0x248bab;})});}_0x420f6c=_[_0x1b70('0x49')]({},_0x420f6c,_0x525fe3[_0x1b70('0x53')]);return _0x113dc3[_0x1b70('0x66')](_0x420f6c);}})[_0x1b70('0x2d')](function(_0x5dfde7){if(_0x5dfde7){_0x2ddb41=_0x5dfde7['length'];if(!_0x525fe3[_0x1b70('0x3d')][_0x1b70('0x43')](_0x1b70('0x44'))){_0x420f6c[_0x1b70('0x24')]=qs[_0x1b70('0x24')](_0x525fe3[_0x1b70('0x3d')][_0x1b70('0x24')]);_0x420f6c[_0x1b70('0x26')]=qs[_0x1b70('0x26')](_0x525fe3[_0x1b70('0x3d')]['offset']);}return _0x113dc3[_0x1b70('0x66')](_0x420f6c);}})[_0x1b70('0x2d')](function(_0x15442b){if(_0x15442b){return _0x15442b?{'count':_0x2ddb41,'rows':_0x15442b}:null;}})[_0x1b70('0x2d')](respondWithResult(_0x4b03f4,null))[_0x1b70('0x4f')](handleError(_0x4b03f4,null));};exports[_0x1b70('0x68')]=function(_0x2f18a6,_0xb9e3eb,_0x3b9d0d){var _0x239747=_0x2f18a6[_0x1b70('0x56')][_0x1b70('0x69')];return db[_0x1b70('0x67')]['findAll']({'where':{'id':_0x239747},'attributes':['id'],'include':[{'model':db[_0x1b70('0x61')],'as':_0x1b70('0x6a'),'attributes':['id',_0x1b70('0x35'),_0x1b70('0x6b'),_0x1b70('0x6c'),'interface'],'raw':!![]}]})['then'](function(_0x531f4f){if(_0x531f4f){var _0xfa81f8=_[_0x1b70('0x6d')](_0x531f4f,function(_0x177724){var _0x2eafde=_0x177724[_0x1b70('0x2f')]({'plain':!![]});return _0x2eafde[_0x1b70('0x6a')];});return db[_0x1b70('0x39')][_0x1b70('0x54')]({'where':{'id':_0x2f18a6[_0x1b70('0x51')]['id']}})['then'](function(_0x3d094a){return db['sequelize'][_0x1b70('0x6e')](function(_0x365e85){return _0x3d094a[_0x1b70('0x68')](_0x239747,{'transaction':_0x365e85})[_0x1b70('0x2d')](function(){return BPromise[_0x1b70('0x6f')](_0xfa81f8,function(_0xf4769){return db[_0x1b70('0x5e')][_0x1b70('0x70')]({'where':{'UserId':_0xf4769['id'],'MailQueueId':_0x2f18a6[_0x1b70('0x51')]['id']},'transaction':_0x365e85});});})[_0x1b70('0x2d')](function(){_0xfa81f8['forEach'](function(_0x11c057){socket['emit'](_0x1b70('0x71'),{'UserId':_0x11c057['id'],'MailQueueId':_0x3d094a['id']});});});});});}})['then'](respondWithStatusCode(_0xb9e3eb,null))[_0x1b70('0x4f')](handleError(_0xb9e3eb,null));};exports[_0x1b70('0x72')]=function(_0x1e9df7,_0x192526,_0x2b9958){return db['Team']['findAll']({'where':{'id':_0x1e9df7[_0x1b70('0x3d')][_0x1b70('0x69')]},'attributes':['id'],'include':[{'model':db[_0x1b70('0x61')],'as':_0x1b70('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x1b70('0x2d')](handleEntityNotFound(_0x192526,null))[_0x1b70('0x2d')](function(_0xe431d2){var _0xf0c7cc=_[_0x1b70('0x38')](_0xe431d2,'id');var _0x516cf2=[];var _0x47c810=[];var _0x3fae6f=squel[_0x1b70('0x73')]();_0x3fae6f[_0x1b70('0x74')]('tq.TeamId')['from'](_0x1b70('0x75'),'tq')[_0x1b70('0x76')]('user_has_teams','ut',_0x1b70('0x77'))[_0x1b70('0x46')](_0x1b70('0x78'),_0x1e9df7[_0x1b70('0x51')]['id']);for(var _0x152368=0x0;_0x152368<_0xe431d2[_0x1b70('0x52')];_0x152368+=0x1){let _0x2448ce=_0xe431d2[_0x152368];for(var _0x3ce2dc=0x0;_0x3ce2dc<_0x2448ce[_0x1b70('0x6a')][_0x1b70('0x52')];_0x3ce2dc+=0x1){let _0x11fd3=_0x2448ce['Agents'][_0x3ce2dc];var _0x12a149=_0x3fae6f[_0x1b70('0x79')]();_0x12a149[_0x1b70('0x46')](_0x1b70('0x7a'),_0x11fd3['id']);_0x47c810['push'](db[_0x1b70('0x7b')]['query'](_0x12a149['toString'](),{'type':db[_0x1b70('0x7b')][_0x1b70('0x7c')][_0x1b70('0x7d')]})[_0x1b70('0x2d')](function(_0x4f4f3c){if(_0x4f4f3c[_0x1b70('0x52')]===0x1){return _0x11fd3['id'];}else{var _0x45f406=_[_0x1b70('0x7e')](_[_0x1b70('0x38')](_0x4f4f3c,_0x1b70('0x7f')),function(_0x569656){return _[_0x1b70('0x80')](_0xf0c7cc,_0x569656);});if(_0x45f406){return _0x11fd3['id'];}}}));}}return BPromise['all'](_0x47c810)['then'](function(_0x321b4c){_0x516cf2=_(_0x516cf2)['union'](_0x321b4c)[_0x1b70('0x81')]()[_0x1b70('0x82')]();return db[_0x1b70('0x39')][_0x1b70('0x54')]({'where':{'id':_0x1e9df7[_0x1b70('0x51')]['id']}})[_0x1b70('0x2d')](function(_0xf1ca04){return db['sequelize'][_0x1b70('0x6e')](function(_0x2637cc){return _0xf1ca04[_0x1b70('0x72')](_0x1e9df7[_0x1b70('0x3d')][_0x1b70('0x69')],{'transaction':_0x2637cc})[_0x1b70('0x2d')](function(){if(!_[_0x1b70('0x83')](_0x516cf2)){return _0xf1ca04[_0x1b70('0x84')](_0x516cf2,{'transaction':_0x2637cc});}})[_0x1b70('0x2d')](function(){_0x516cf2[_0x1b70('0x85')](function(_0x3d8d35){socket['emit']('userMailQueue:remove',{'UserId':_0x3d8d35,'MailQueueId':_0xf1ca04['id']});});});});});});})[_0x1b70('0x2d')](respondWithStatusCode(_0x192526,null))['catch'](handleError(_0x192526,null));};exports[_0x1b70('0x86')]=function(_0x3a6761,_0x5760dd,_0xfcebca){return db[_0x1b70('0x39')][_0x1b70('0x54')]({'where':{'id':_0x3a6761[_0x1b70('0x51')]['id']}})[_0x1b70('0x2d')](handleEntityNotFound(_0x5760dd,null))[_0x1b70('0x2d')](function(_0xde3293){if(_0xde3293){return _0xde3293[_0x1b70('0x86')](_0x3a6761['body'][_0x1b70('0x69')],_[_0x1b70('0x87')](_0x3a6761[_0x1b70('0x56')],[_0x1b70('0x69'),'id'])||{})[_0x1b70('0x88')](function(_0x47b9e6){for(var _0x44c9db=0x0;_0x44c9db<_0x3a6761[_0x1b70('0x56')][_0x1b70('0x69')]['length'];_0x44c9db+=0x1){socket[_0x1b70('0x89')](_0x1b70('0x71'),{'UserId':Number(_0x3a6761[_0x1b70('0x56')][_0x1b70('0x69')][_0x44c9db]),'MailQueueId':Number(_0x3a6761[_0x1b70('0x51')]['id'])});}return _0x47b9e6;});}})[_0x1b70('0x2d')](respondWithResult(_0x5760dd,null))[_0x1b70('0x4f')](handleError(_0x5760dd,null));};exports[_0x1b70('0x84')]=function(_0x1f0380,_0x4a1a52,_0x5017ab){return db[_0x1b70('0x39')][_0x1b70('0x54')]({'where':{'id':_0x1f0380['params']['id']}})[_0x1b70('0x2d')](handleEntityNotFound(_0x4a1a52,null))['then'](function(_0x19639b){if(_0x19639b){return _0x19639b[_0x1b70('0x84')](_0x1f0380[_0x1b70('0x3d')][_0x1b70('0x69')])['then'](function(){if(_[_0x1b70('0x8a')](_0x1f0380[_0x1b70('0x3d')][_0x1b70('0x69')])){for(var _0x17ee4e=0x0;_0x17ee4e<_0x1f0380['query'][_0x1b70('0x69')][_0x1b70('0x52')];_0x17ee4e+=0x1){socket[_0x1b70('0x89')](_0x1b70('0x8b'),{'UserId':Number(_0x1f0380[_0x1b70('0x3d')][_0x1b70('0x69')][_0x17ee4e]),'MailQueueId':Number(_0x1f0380[_0x1b70('0x51')]['id'])});}}else{socket[_0x1b70('0x89')](_0x1b70('0x8b'),{'UserId':Number(_0x1f0380['query'][_0x1b70('0x69')]),'MailQueueId':Number(_0x1f0380[_0x1b70('0x51')]['id'])});}});}})[_0x1b70('0x2d')](respondWithStatusCode(_0x4a1a52,null))['catch'](handleError(_0x4a1a52,null));};exports['getAgents']=function(_0x982f87,_0x11f938,_0x589623){var _0x1cbfac={};var _0x11712c={};var _0x3cfe22;var _0x4f64cb;return db[_0x1b70('0x39')]['findOne']({'where':{'id':_0x982f87[_0x1b70('0x51')]['id']}})['then'](handleEntityNotFound(_0x11f938,null))[_0x1b70('0x2d')](function(_0x503099){if(_0x503099){_0x3cfe22=_0x503099;_0x11712c[_0x1b70('0x3c')]=_[_0x1b70('0x3e')](db['User'][_0x1b70('0x3a')]);_0x11712c[_0x1b70('0x3d')]=_[_0x1b70('0x3e')](_0x982f87[_0x1b70('0x3d')]);_0x11712c['filters']=_[_0x1b70('0x40')](_0x11712c['model'],_0x11712c[_0x1b70('0x3d')]);_0x1cbfac[_0x1b70('0x41')]=_[_0x1b70('0x40')](_0x11712c['model'],qs[_0x1b70('0x42')](_0x982f87[_0x1b70('0x3d')][_0x1b70('0x42')]));_0x1cbfac[_0x1b70('0x41')]=_0x1cbfac[_0x1b70('0x41')][_0x1b70('0x52')]?_0x1cbfac[_0x1b70('0x41')]:_0x11712c['model'];_0x1cbfac[_0x1b70('0x5f')]=qs[_0x1b70('0x45')](_0x982f87['query']['sort']);_0x1cbfac['where']=qs[_0x1b70('0x3f')](_['pick'](_0x982f87[_0x1b70('0x3d')],_0x11712c[_0x1b70('0x3f')]));if(_0x982f87['query']['filter']){_0x1cbfac['where']=_[_0x1b70('0x49')](_0x1cbfac[_0x1b70('0x46')],{'$or':_['map'](_0x1cbfac[_0x1b70('0x41')],function(_0x48ce2f){var _0x270f17={};_0x270f17[_0x48ce2f]={'$like':'%'+_0x982f87[_0x1b70('0x3d')][_0x1b70('0x48')]+'%'};return _0x270f17;})});}_0x1cbfac=_[_0x1b70('0x49')]({},_0x1cbfac,_0x982f87[_0x1b70('0x53')]);return _0x3cfe22[_0x1b70('0x8c')](_0x1cbfac);}})[_0x1b70('0x2d')](function(_0x58abc1){if(_0x58abc1){_0x4f64cb=_0x58abc1[_0x1b70('0x52')];if(!_0x982f87[_0x1b70('0x3d')]['hasOwnProperty'](_0x1b70('0x44'))){_0x1cbfac[_0x1b70('0x24')]=qs['limit'](_0x982f87['query'][_0x1b70('0x24')]);_0x1cbfac['offset']=qs[_0x1b70('0x26')](_0x982f87[_0x1b70('0x3d')][_0x1b70('0x26')]);}return _0x3cfe22[_0x1b70('0x8c')](_0x1cbfac);}})[_0x1b70('0x2d')](function(_0x4a4328){if(_0x4a4328){return _0x4a4328?{'count':_0x4f64cb,'rows':_0x4a4328}:null;}})[_0x1b70('0x2d')](respondWithResult(_0x11f938,null))[_0x1b70('0x4f')](handleError(_0x11f938,null));}; \ No newline at end of file +var _0x73bd=['../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./mailQueue.socket','register','status','end','json','undefined','offset','count','apply','reject','save','update','destroy','then','get','MailQueues','UserProfileResource','error','stack','name','index','map','MailQueue','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','pick','where','merge','includeAll','include','findAll','rows','catch','show','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','MailQueueId','filter','options','UserMailQueue','findAndCountAll','UserId','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','User','Agents','voicePause','flatMap','transaction','addTeams','findOrCreate','forEach','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_mail_queues','user_has_teams','MailQueueId\x20=\x20?','sequelize','QueryTypes','SELECT','includes','union','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','emit','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x3ba2a3,_0x34d0ba){var _0x2d0e38=function(_0x12ee87){while(--_0x12ee87){_0x3ba2a3['push'](_0x3ba2a3['shift']());}};_0x2d0e38(++_0x34d0ba);}(_0x73bd,0x6b));var _0xd73b=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x73bd[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xd73b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd73b('0x1'));var jsonpatch=require(_0xd73b('0x2'));var rp=require(_0xd73b('0x3'));var moment=require(_0xd73b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd73b('0x5'));var util=require(_0xd73b('0x6'));var path=require('path');var sox=require(_0xd73b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd73b('0x8'));var _=require(_0xd73b('0x9'));var squel=require(_0xd73b('0xa'));var crypto=require(_0xd73b('0xb'));var jsforce=require(_0xd73b('0xc'));var deskjs=require(_0xd73b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd73b('0xe'));var Papa=require(_0xd73b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd73b('0x10'));var as=require(_0xd73b('0x11'));var hardwareService=require(_0xd73b('0x12'));var logger=require(_0xd73b('0x13'))('api');var utils=require(_0xd73b('0x14'));var config=require(_0xd73b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd73b('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd73b('0x17'),'port':0x18eb});var socket=require(_0xd73b('0x18'))(new Redis(config[_0xd73b('0x19')]));require(_0xd73b('0x1a'))[_0xd73b('0x1b')](socket);function respondWithStatusCode(_0xfb6d23,_0x59ce2a){_0x59ce2a=_0x59ce2a||0xcc;return function(_0x1f9b70){if(_0x1f9b70){return _0xfb6d23['sendStatus'](_0x59ce2a);}return _0xfb6d23[_0xd73b('0x1c')](_0x59ce2a)[_0xd73b('0x1d')]();};}function respondWithResult(_0x3fefaa,_0x3ab9fa){_0x3ab9fa=_0x3ab9fa||0xc8;return function(_0x15d491){if(_0x15d491){return _0x3fefaa[_0xd73b('0x1c')](_0x3ab9fa)[_0xd73b('0x1e')](_0x15d491);}};}function respondWithFilteredResult(_0x45eb23,_0x21449c){return function(_0x413384){if(_0x413384){var _0x53a909=typeof _0x21449c['offset']==='undefined'&&typeof _0x21449c['limit']===_0xd73b('0x1f');var _0x496d0d=_0x413384['count'];var _0x42a79c=_0x53a909?0x0:_0x21449c[_0xd73b('0x20')];var _0x430a6c=_0x53a909?_0x413384[_0xd73b('0x21')]:_0x21449c[_0xd73b('0x20')]+_0x21449c['limit'];var _0x2c9667;if(_0x430a6c>=_0x496d0d){_0x430a6c=_0x496d0d;_0x2c9667=0xc8;}else{_0x2c9667=0xce;}_0x45eb23[_0xd73b('0x1c')](_0x2c9667);return _0x45eb23['set']('Content-Range',_0x42a79c+'-'+_0x430a6c+'/'+_0x496d0d)[_0xd73b('0x1e')](_0x413384);}return null;};}function patchUpdates(_0x4ee410){return function(_0xd48c9e){try{jsonpatch[_0xd73b('0x22')](_0xd48c9e,_0x4ee410,!![]);}catch(_0x38f776){return BPromise[_0xd73b('0x23')](_0x38f776);}return _0xd48c9e[_0xd73b('0x24')]();};}function saveUpdates(_0x4f6e5e,_0x5607f2){return function(_0x30ae74){if(_0x30ae74){return _0x30ae74[_0xd73b('0x25')](_0x4f6e5e)['then'](function(_0x27f071){return _0x27f071;});}return null;};}function removeEntity(_0x52ce98,_0x3561b0){return function(_0x5081c4){if(_0x5081c4){return _0x5081c4[_0xd73b('0x26')]()[_0xd73b('0x27')](function(){var _0x4e4ee7=_0x5081c4[_0xd73b('0x28')]({'plain':!![]});var _0x164c29=_0xd73b('0x29');return db[_0xd73b('0x2a')][_0xd73b('0x26')]({'where':{'type':_0x164c29,'resourceId':_0x4e4ee7['id']}})['then'](function(){return _0x5081c4;});})[_0xd73b('0x27')](function(){_0x52ce98[_0xd73b('0x1c')](0xcc)[_0xd73b('0x1d')]();});}};}function handleEntityNotFound(_0xb6a6a2,_0x2785e4){return function(_0x3fe9e4){if(!_0x3fe9e4){_0xb6a6a2['sendStatus'](0x194);}return _0x3fe9e4;};}function handleError(_0x222e08,_0xb0a73f){_0xb0a73f=_0xb0a73f||0x1f4;return function(_0x19e166){logger[_0xd73b('0x2b')](_0x19e166[_0xd73b('0x2c')]);if(_0x19e166[_0xd73b('0x2d')]){delete _0x19e166['name'];}_0x222e08['status'](_0xb0a73f)['send'](_0x19e166);};}exports[_0xd73b('0x2e')]=function(_0x3e0e8d,_0x2f9842){var _0x3de1ce={},_0x4bd1b2={},_0x534887={'count':0x0,'rows':[]};var _0x5d3f9e=_[_0xd73b('0x2f')](db[_0xd73b('0x30')][_0xd73b('0x31')],function(_0x591d09){return{'name':_0x591d09['fieldName'],'type':_0x591d09['type'][_0xd73b('0x32')]};});_0x4bd1b2[_0xd73b('0x33')]=_[_0xd73b('0x2f')](_0x5d3f9e,_0xd73b('0x2d'));_0x4bd1b2['query']=_[_0xd73b('0x34')](_0x3e0e8d[_0xd73b('0x35')]);_0x4bd1b2[_0xd73b('0x36')]=_[_0xd73b('0x37')](_0x4bd1b2[_0xd73b('0x33')],_0x4bd1b2['query']);_0x3de1ce[_0xd73b('0x38')]=_[_0xd73b('0x37')](_0x4bd1b2[_0xd73b('0x33')],qs[_0xd73b('0x39')](_0x3e0e8d[_0xd73b('0x35')][_0xd73b('0x39')]));_0x3de1ce[_0xd73b('0x38')]=_0x3de1ce[_0xd73b('0x38')]['length']?_0x3de1ce['attributes']:_0x4bd1b2['model'];if(!_0x3e0e8d[_0xd73b('0x35')]['hasOwnProperty'](_0xd73b('0x3a'))){_0x3de1ce[_0xd73b('0x3b')]=qs[_0xd73b('0x3b')](_0x3e0e8d['query'][_0xd73b('0x3b')]);_0x3de1ce['offset']=qs[_0xd73b('0x20')](_0x3e0e8d[_0xd73b('0x35')][_0xd73b('0x20')]);}_0x3de1ce[_0xd73b('0x3c')]=qs['sort'](_0x3e0e8d[_0xd73b('0x35')][_0xd73b('0x3d')]);_0x3de1ce['where']=qs['filters'](_[_0xd73b('0x3e')](_0x3e0e8d[_0xd73b('0x35')],_0x4bd1b2[_0xd73b('0x36')]),_0x5d3f9e);if(_0x3e0e8d[_0xd73b('0x35')]['filter']){_0x3de1ce[_0xd73b('0x3f')]=_[_0xd73b('0x40')](_0x3de1ce[_0xd73b('0x3f')],{'$or':_['map'](_0x5d3f9e,function(_0x529347){if(_0x529347['type']!=='VIRTUAL'){var _0x4120e2={};_0x4120e2[_0x529347[_0xd73b('0x2d')]]={'$like':'%'+_0x3e0e8d['query']['filter']+'%'};return _0x4120e2;}})});}_0x3de1ce=_[_0xd73b('0x40')]({},_0x3de1ce,_0x3e0e8d['options']);var _0x2c1194={'where':_0x3de1ce[_0xd73b('0x3f')]};return db[_0xd73b('0x30')][_0xd73b('0x21')](_0x2c1194)['then'](function(_0x4a6aa2){_0x534887[_0xd73b('0x21')]=_0x4a6aa2;if(_0x3e0e8d[_0xd73b('0x35')][_0xd73b('0x41')]){_0x3de1ce[_0xd73b('0x42')]=[{'all':!![]}];}return db[_0xd73b('0x30')][_0xd73b('0x43')](_0x3de1ce);})[_0xd73b('0x27')](function(_0x56a9ff){_0x534887[_0xd73b('0x44')]=_0x56a9ff;return _0x534887;})[_0xd73b('0x27')](respondWithFilteredResult(_0x2f9842,_0x3de1ce))[_0xd73b('0x45')](handleError(_0x2f9842,null));};exports[_0xd73b('0x46')]=function(_0x568b77,_0xeb5447){var _0x484dea={'raw':!![],'where':{'id':_0x568b77[_0xd73b('0x47')]['id']}},_0x30fb14={};_0x30fb14[_0xd73b('0x33')]=_[_0xd73b('0x34')](db[_0xd73b('0x30')][_0xd73b('0x31')]);_0x30fb14[_0xd73b('0x35')]=_[_0xd73b('0x34')](_0x568b77[_0xd73b('0x35')]);_0x30fb14[_0xd73b('0x36')]=_[_0xd73b('0x37')](_0x30fb14['model'],_0x30fb14[_0xd73b('0x35')]);_0x484dea[_0xd73b('0x38')]=_[_0xd73b('0x37')](_0x30fb14[_0xd73b('0x33')],qs['fields'](_0x568b77['query'][_0xd73b('0x39')]));_0x484dea[_0xd73b('0x38')]=_0x484dea[_0xd73b('0x38')][_0xd73b('0x48')]?_0x484dea[_0xd73b('0x38')]:_0x30fb14[_0xd73b('0x33')];if(_0x568b77['query'][_0xd73b('0x41')]){_0x484dea[_0xd73b('0x42')]=[{'all':!![]}];}_0x484dea=_[_0xd73b('0x40')]({},_0x484dea,_0x568b77['options']);return db['MailQueue'][_0xd73b('0x49')](_0x484dea)[_0xd73b('0x27')](handleEntityNotFound(_0xeb5447,null))['then'](respondWithResult(_0xeb5447,null))[_0xd73b('0x45')](handleError(_0xeb5447,null));};exports[_0xd73b('0x4a')]=function(_0x5c48c0,_0x4add6e){return db[_0xd73b('0x30')][_0xd73b('0x4a')](_0x5c48c0['body'],{})[_0xd73b('0x27')](function(_0x5350bc){var _0x5c9726=_0x5c48c0['user']['get']({'plain':!![]});if(!_0x5c9726)throw new Error(_0xd73b('0x4b'));if(_0x5c9726['role']==='user'){var _0x41091d=_0x5350bc['get']({'plain':!![]});var _0x2face='MailQueues';return db['UserProfileSection'][_0xd73b('0x49')]({'where':{'name':_0x2face,'userProfileId':_0x5c9726[_0xd73b('0x4c')]},'raw':!![]})[_0xd73b('0x27')](function(_0x2afef0){if(_0x2afef0&&_0x2afef0[_0xd73b('0x4d')]===0x0){return db[_0xd73b('0x2a')][_0xd73b('0x4a')]({'name':_0x41091d[_0xd73b('0x2d')],'resourceId':_0x41091d['id'],'type':_0x2afef0[_0xd73b('0x2d')],'sectionId':_0x2afef0['id']},{})[_0xd73b('0x27')](function(){return _0x5350bc;});}else{return _0x5350bc;}})['catch'](function(_0x5ee74f){logger[_0xd73b('0x2b')](_0xd73b('0x4e'),_0x5ee74f);throw _0x5ee74f;});}return _0x5350bc;})[_0xd73b('0x27')](respondWithResult(_0x4add6e,0xc9))[_0xd73b('0x45')](handleError(_0x4add6e,null));};exports['update']=function(_0x381f07,_0x18156b){if(_0x381f07[_0xd73b('0x4f')]['id']){delete _0x381f07[_0xd73b('0x4f')]['id'];}return db['MailQueue'][_0xd73b('0x49')]({'where':{'id':_0x381f07['params']['id']}})[_0xd73b('0x27')](handleEntityNotFound(_0x18156b,null))[_0xd73b('0x27')](saveUpdates(_0x381f07[_0xd73b('0x4f')],null))[_0xd73b('0x27')](respondWithResult(_0x18156b,null))['catch'](handleError(_0x18156b,null));};exports[_0xd73b('0x26')]=function(_0x2931c5,_0x3d2ce7){return db[_0xd73b('0x30')][_0xd73b('0x49')]({'where':{'id':_0x2931c5[_0xd73b('0x47')]['id']}})[_0xd73b('0x27')](handleEntityNotFound(_0x3d2ce7,null))['then'](removeEntity(_0x3d2ce7,null))[_0xd73b('0x45')](handleError(_0x3d2ce7,null));};exports[_0xd73b('0x50')]=function(_0x16692d,_0x5b5513){return db[_0xd73b('0x30')][_0xd73b('0x50')]()['then'](respondWithResult(_0x5b5513,null))[_0xd73b('0x45')](handleError(_0x5b5513,null));};exports['getMembers']=function(_0x26f5b7,_0x51b24c,_0x32eb29){var _0x39dd6f={'raw':!![],'where':{}},_0xb55c4a={},_0x2381c9;return db[_0xd73b('0x30')][_0xd73b('0x51')]({'where':{'id':_0x26f5b7['params']['id']}})[_0xd73b('0x27')](handleEntityNotFound(_0x51b24c,null))['then'](function(_0x275001){if(_0x275001){_0x2381c9=_0x275001['get']({'plain':!![]});_0xb55c4a[_0xd73b('0x33')]=_[_0xd73b('0x34')](db['UserMailQueue'][_0xd73b('0x31')]);_0xb55c4a['query']=_['keys'](_0x26f5b7[_0xd73b('0x35')]);_0xb55c4a[_0xd73b('0x36')]=_['intersection'](_0xb55c4a['model'],_0xb55c4a[_0xd73b('0x35')]);_0x39dd6f[_0xd73b('0x38')]=_[_0xd73b('0x37')](_0xb55c4a[_0xd73b('0x33')],qs['fields'](_0x26f5b7['query'][_0xd73b('0x39')]));_0x39dd6f[_0xd73b('0x38')]=_0x39dd6f[_0xd73b('0x38')][_0xd73b('0x48')]?_0x39dd6f['attributes']:_0xb55c4a[_0xd73b('0x33')];if(!_0x26f5b7['query']['hasOwnProperty'](_0xd73b('0x3a'))){_0x39dd6f[_0xd73b('0x3b')]=qs[_0xd73b('0x3b')](_0x26f5b7[_0xd73b('0x35')][_0xd73b('0x3b')]);_0x39dd6f[_0xd73b('0x20')]=qs[_0xd73b('0x20')](_0x26f5b7[_0xd73b('0x35')][_0xd73b('0x20')]);}_0x39dd6f[_0xd73b('0x3c')]=qs['sort'](_0x26f5b7[_0xd73b('0x35')]['sort']);_0x39dd6f[_0xd73b('0x3f')]=qs[_0xd73b('0x36')](_[_0xd73b('0x3e')](_0x26f5b7[_0xd73b('0x35')],_0xb55c4a[_0xd73b('0x36')]));_0x39dd6f['where'][_0xd73b('0x52')]=_0x275001['id'];if(_0x26f5b7[_0xd73b('0x35')][_0xd73b('0x53')]){_0x39dd6f['where']=_[_0xd73b('0x40')](_0x39dd6f[_0xd73b('0x3f')],{'$or':_[_0xd73b('0x2f')](_0x39dd6f['attributes'],function(_0x306254){var _0x2cdf0e={};_0x2cdf0e[_0x306254]={'$like':'%'+_0x26f5b7[_0xd73b('0x35')][_0xd73b('0x53')]+'%'};return _0x2cdf0e;})});}_0x39dd6f=_['merge']({},_0x39dd6f,_0x26f5b7[_0xd73b('0x54')]);return db[_0xd73b('0x55')][_0xd73b('0x43')](_0x39dd6f);}})[_0xd73b('0x27')](function(_0x3a9689){if(_0x3a9689){return db['User'][_0xd73b('0x56')]({'where':{'id':_[_0xd73b('0x2f')](_0x3a9689,_0xd73b('0x57')),'role':'agent'},'attributes':['id','name',_0xd73b('0x58'),_0xd73b('0x59'),_0xd73b('0x5a')]});}})['then'](function(_0xa1e98e){if(_0xa1e98e){return{'count':_0xa1e98e[_0xd73b('0x21')],'rows':_['map'](_0xa1e98e[_0xd73b('0x44')],function(_0x30b041){return{'membername':_0x30b041['name'],'UserId':_0x30b041['id'],'queue_name':_0x2381c9[_0xd73b('0x2d')],'MailQueueId':_0x2381c9['id'],'interface':util[_0xd73b('0x5b')](_0xd73b('0x5c'),_0xd73b('0x5d'),_0x30b041['name']),'penalty':0x0,'paused':_0x30b041[_0xd73b('0x58')],'createdAt':_0x30b041[_0xd73b('0x5a')],'updatedAt':_0x30b041['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x51b24c,_0x39dd6f))[_0xd73b('0x45')](handleError(_0x51b24c,null));};exports[_0xd73b('0x5e')]=function(_0x1a81cb,_0x35062e,_0x5230e7){var _0x3c6ae9={};var _0x45258b={};var _0x57c5bc;var _0x45cff2;return db[_0xd73b('0x30')]['findOne']({'where':{'id':_0x1a81cb[_0xd73b('0x47')]['id']}})['then'](handleEntityNotFound(_0x35062e,null))[_0xd73b('0x27')](function(_0xe06b11){if(_0xe06b11){_0x57c5bc=_0xe06b11;_0x45258b['model']=_[_0xd73b('0x34')](db[_0xd73b('0x5f')][_0xd73b('0x31')]);_0x45258b[_0xd73b('0x35')]=_['keys'](_0x1a81cb[_0xd73b('0x35')]);_0x45258b['filters']=_[_0xd73b('0x37')](_0x45258b['model'],_0x45258b[_0xd73b('0x35')]);_0x3c6ae9[_0xd73b('0x38')]=_[_0xd73b('0x37')](_0x45258b[_0xd73b('0x33')],qs['fields'](_0x1a81cb[_0xd73b('0x35')][_0xd73b('0x39')]));_0x3c6ae9[_0xd73b('0x38')]=_0x3c6ae9[_0xd73b('0x38')][_0xd73b('0x48')]?_0x3c6ae9[_0xd73b('0x38')]:_0x45258b['model'];_0x3c6ae9['order']=qs[_0xd73b('0x3d')](_0x1a81cb['query'][_0xd73b('0x3d')]);_0x3c6ae9[_0xd73b('0x3f')]=qs[_0xd73b('0x36')](_[_0xd73b('0x3e')](_0x1a81cb[_0xd73b('0x35')],_0x45258b[_0xd73b('0x36')]));if(_0x1a81cb[_0xd73b('0x35')][_0xd73b('0x53')]){_0x3c6ae9[_0xd73b('0x3f')]=_[_0xd73b('0x40')](_0x3c6ae9[_0xd73b('0x3f')],{'$or':_[_0xd73b('0x2f')](_0x3c6ae9[_0xd73b('0x38')],function(_0x23305a){var _0xe8f84={};_0xe8f84[_0x23305a]={'$like':'%'+_0x1a81cb[_0xd73b('0x35')][_0xd73b('0x53')]+'%'};return _0xe8f84;})});}_0x3c6ae9=_[_0xd73b('0x40')]({},_0x3c6ae9,_0x1a81cb[_0xd73b('0x54')]);return _0x57c5bc[_0xd73b('0x5e')](_0x3c6ae9);}})['then'](function(_0x5bcd4e){if(_0x5bcd4e){_0x45cff2=_0x5bcd4e[_0xd73b('0x48')];if(!_0x1a81cb[_0xd73b('0x35')]['hasOwnProperty'](_0xd73b('0x3a'))){_0x3c6ae9[_0xd73b('0x3b')]=qs[_0xd73b('0x3b')](_0x1a81cb[_0xd73b('0x35')][_0xd73b('0x3b')]);_0x3c6ae9[_0xd73b('0x20')]=qs['offset'](_0x1a81cb['query']['offset']);}return _0x57c5bc[_0xd73b('0x5e')](_0x3c6ae9);}})['then'](function(_0x614e6c){if(_0x614e6c){return _0x614e6c?{'count':_0x45cff2,'rows':_0x614e6c}:null;}})[_0xd73b('0x27')](respondWithResult(_0x35062e,null))[_0xd73b('0x45')](handleError(_0x35062e,null));};exports['addTeams']=function(_0x390332,_0x5c17eb,_0x488b2d){var _0x39c0e4=_0x390332[_0xd73b('0x4f')]['ids'];return db[_0xd73b('0x5f')][_0xd73b('0x43')]({'where':{'id':_0x39c0e4},'attributes':['id'],'include':[{'model':db[_0xd73b('0x60')],'as':_0xd73b('0x61'),'attributes':['id',_0xd73b('0x2d'),'online',_0xd73b('0x62'),'interface'],'raw':!![]}]})[_0xd73b('0x27')](function(_0x572064){if(_0x572064){var _0x330f61=_[_0xd73b('0x63')](_0x572064,function(_0x5a50d5){var _0x221dd5=_0x5a50d5[_0xd73b('0x28')]({'plain':!![]});return _0x221dd5[_0xd73b('0x61')];});return db[_0xd73b('0x30')][_0xd73b('0x49')]({'where':{'id':_0x390332['params']['id']}})[_0xd73b('0x27')](function(_0x189e2e){return db['sequelize'][_0xd73b('0x64')](function(_0x1c2337){return _0x189e2e[_0xd73b('0x65')](_0x39c0e4,{'transaction':_0x1c2337})[_0xd73b('0x27')](function(){return BPromise['each'](_0x330f61,function(_0xfae02b){return db['UserMailQueue'][_0xd73b('0x66')]({'where':{'UserId':_0xfae02b['id'],'MailQueueId':_0x390332[_0xd73b('0x47')]['id']},'transaction':_0x1c2337});});})['then'](function(){_0x330f61[_0xd73b('0x67')](function(_0x1f95b4){socket['emit'](_0xd73b('0x68'),{'UserId':_0x1f95b4['id'],'MailQueueId':_0x189e2e['id']});});});});});}})['then'](respondWithStatusCode(_0x5c17eb,null))[_0xd73b('0x45')](handleError(_0x5c17eb,null));};exports[_0xd73b('0x69')]=function(_0x5373e9,_0x441327,_0x2ec86b){return db['Team'][_0xd73b('0x43')]({'where':{'id':_0x5373e9[_0xd73b('0x35')][_0xd73b('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xd73b('0x60')],'as':_0xd73b('0x61'),'attributes':['id'],'raw':!![]}]})[_0xd73b('0x27')](handleEntityNotFound(_0x441327,null))[_0xd73b('0x27')](function(_0x25c791){var _0x160200=_[_0xd73b('0x2f')](_0x25c791,'id');var _0x28efd0=[];var _0x137ec8=[];var _0xd73ea4=squel[_0xd73b('0x6b')]();_0xd73ea4[_0xd73b('0x6c')](_0xd73b('0x6d'))['from'](_0xd73b('0x6e'),'tq')['join'](_0xd73b('0x6f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd73b('0x3f')](_0xd73b('0x70'),_0x5373e9[_0xd73b('0x47')]['id']);for(var _0x3cb11e=0x0;_0x3cb11e<_0x25c791[_0xd73b('0x48')];_0x3cb11e+=0x1){let _0x4fdca0=_0x25c791[_0x3cb11e];for(var _0x5b87ba=0x0;_0x5b87ba<_0x4fdca0['Agents']['length'];_0x5b87ba+=0x1){let _0x15de54=_0x4fdca0['Agents'][_0x5b87ba];var _0x4bace0=_0xd73ea4['clone']();_0x4bace0['where']('ut.UserId\x20=\x20?',_0x15de54['id']);_0x137ec8['push'](db[_0xd73b('0x71')]['query'](_0x4bace0['toString'](),{'type':db[_0xd73b('0x71')][_0xd73b('0x72')][_0xd73b('0x73')]})[_0xd73b('0x27')](function(_0x3acb34){if(_0x3acb34[_0xd73b('0x48')]===0x1){return _0x15de54['id'];}else{var _0x24272d=_['every'](_[_0xd73b('0x2f')](_0x3acb34,'TeamId'),function(_0x220643){return _[_0xd73b('0x74')](_0x160200,_0x220643);});if(_0x24272d){return _0x15de54['id'];}}}));}}return BPromise['all'](_0x137ec8)['then'](function(_0x4e62c8){_0x28efd0=_(_0x28efd0)[_0xd73b('0x75')](_0x4e62c8)['compact']()[_0xd73b('0x76')]();return db[_0xd73b('0x30')][_0xd73b('0x49')]({'where':{'id':_0x5373e9[_0xd73b('0x47')]['id']}})[_0xd73b('0x27')](function(_0x4c0d16){return db[_0xd73b('0x71')][_0xd73b('0x64')](function(_0x139da1){return _0x4c0d16[_0xd73b('0x69')](_0x5373e9[_0xd73b('0x35')][_0xd73b('0x6a')],{'transaction':_0x139da1})[_0xd73b('0x27')](function(){if(!_[_0xd73b('0x77')](_0x28efd0)){return _0x4c0d16[_0xd73b('0x78')](_0x28efd0,{'transaction':_0x139da1});}})['then'](function(){_0x28efd0[_0xd73b('0x67')](function(_0x43d544){socket['emit'](_0xd73b('0x79'),{'UserId':_0x43d544,'MailQueueId':_0x4c0d16['id']});});});});});});})[_0xd73b('0x27')](respondWithStatusCode(_0x441327,null))[_0xd73b('0x45')](handleError(_0x441327,null));};exports['addAgents']=function(_0x318dba,_0x10e289,_0x405b60){return db['MailQueue']['find']({'where':{'id':_0x318dba[_0xd73b('0x47')]['id']}})[_0xd73b('0x27')](handleEntityNotFound(_0x10e289,null))[_0xd73b('0x27')](function(_0x10eaff){if(_0x10eaff){return _0x10eaff[_0xd73b('0x7a')](_0x318dba['body'][_0xd73b('0x6a')],_[_0xd73b('0x7b')](_0x318dba[_0xd73b('0x4f')],[_0xd73b('0x6a'),'id'])||{})[_0xd73b('0x7c')](function(_0x18354f){for(var _0x349f43=0x0;_0x349f43<_0x318dba[_0xd73b('0x4f')][_0xd73b('0x6a')][_0xd73b('0x48')];_0x349f43+=0x1){socket['emit'](_0xd73b('0x68'),{'UserId':Number(_0x318dba[_0xd73b('0x4f')]['ids'][_0x349f43]),'MailQueueId':Number(_0x318dba[_0xd73b('0x47')]['id'])});}return _0x18354f;});}})['then'](respondWithResult(_0x10e289,null))[_0xd73b('0x45')](handleError(_0x10e289,null));};exports['removeAgents']=function(_0x2d3f1d,_0x4de56c,_0x2fcf0d){return db['MailQueue'][_0xd73b('0x49')]({'where':{'id':_0x2d3f1d[_0xd73b('0x47')]['id']}})[_0xd73b('0x27')](handleEntityNotFound(_0x4de56c,null))[_0xd73b('0x27')](function(_0x26b410){if(_0x26b410){return _0x26b410[_0xd73b('0x78')](_0x2d3f1d[_0xd73b('0x35')][_0xd73b('0x6a')])['then'](function(){if(_[_0xd73b('0x7d')](_0x2d3f1d['query'][_0xd73b('0x6a')])){for(var _0x5bec81=0x0;_0x5bec81<_0x2d3f1d[_0xd73b('0x35')][_0xd73b('0x6a')][_0xd73b('0x48')];_0x5bec81+=0x1){socket[_0xd73b('0x7e')](_0xd73b('0x79'),{'UserId':Number(_0x2d3f1d[_0xd73b('0x35')]['ids'][_0x5bec81]),'MailQueueId':Number(_0x2d3f1d[_0xd73b('0x47')]['id'])});}}else{socket['emit'](_0xd73b('0x79'),{'UserId':Number(_0x2d3f1d[_0xd73b('0x35')][_0xd73b('0x6a')]),'MailQueueId':Number(_0x2d3f1d[_0xd73b('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x4de56c,null))[_0xd73b('0x45')](handleError(_0x4de56c,null));};exports['getAgents']=function(_0x4f5979,_0x26ec10,_0x12fe93){var _0x5db7f6={};var _0x54f5d0={};var _0x4e9edb;var _0x25287b;return db[_0xd73b('0x30')][_0xd73b('0x51')]({'where':{'id':_0x4f5979['params']['id']}})[_0xd73b('0x27')](handleEntityNotFound(_0x26ec10,null))[_0xd73b('0x27')](function(_0x5e559b){if(_0x5e559b){_0x4e9edb=_0x5e559b;_0x54f5d0['model']=_['keys'](db[_0xd73b('0x60')][_0xd73b('0x31')]);_0x54f5d0['query']=_[_0xd73b('0x34')](_0x4f5979[_0xd73b('0x35')]);_0x54f5d0[_0xd73b('0x36')]=_['intersection'](_0x54f5d0['model'],_0x54f5d0[_0xd73b('0x35')]);_0x5db7f6['attributes']=_['intersection'](_0x54f5d0['model'],qs[_0xd73b('0x39')](_0x4f5979[_0xd73b('0x35')][_0xd73b('0x39')]));_0x5db7f6[_0xd73b('0x38')]=_0x5db7f6['attributes'][_0xd73b('0x48')]?_0x5db7f6[_0xd73b('0x38')]:_0x54f5d0[_0xd73b('0x33')];_0x5db7f6['order']=qs[_0xd73b('0x3d')](_0x4f5979['query'][_0xd73b('0x3d')]);_0x5db7f6[_0xd73b('0x3f')]=qs[_0xd73b('0x36')](_['pick'](_0x4f5979['query'],_0x54f5d0[_0xd73b('0x36')]));if(_0x4f5979[_0xd73b('0x35')][_0xd73b('0x53')]){_0x5db7f6[_0xd73b('0x3f')]=_[_0xd73b('0x40')](_0x5db7f6[_0xd73b('0x3f')],{'$or':_['map'](_0x5db7f6[_0xd73b('0x38')],function(_0x4796c7){var _0x25d6b9={};_0x25d6b9[_0x4796c7]={'$like':'%'+_0x4f5979['query'][_0xd73b('0x53')]+'%'};return _0x25d6b9;})});}_0x5db7f6=_[_0xd73b('0x40')]({},_0x5db7f6,_0x4f5979[_0xd73b('0x54')]);return _0x4e9edb[_0xd73b('0x7f')](_0x5db7f6);}})['then'](function(_0x2b6de7){if(_0x2b6de7){_0x25287b=_0x2b6de7[_0xd73b('0x48')];if(!_0x4f5979['query']['hasOwnProperty']('nolimit')){_0x5db7f6[_0xd73b('0x3b')]=qs[_0xd73b('0x3b')](_0x4f5979[_0xd73b('0x35')][_0xd73b('0x3b')]);_0x5db7f6['offset']=qs[_0xd73b('0x20')](_0x4f5979[_0xd73b('0x35')][_0xd73b('0x20')]);}return _0x4e9edb[_0xd73b('0x7f')](_0x5db7f6);}})[_0xd73b('0x27')](function(_0x5214d8){if(_0x5214d8){return _0x5214d8?{'count':_0x25287b,'rows':_0x5214d8}:null;}})[_0xd73b('0x27')](respondWithResult(_0x26ec10,null))[_0xd73b('0x45')](handleError(_0x26ec10,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 6125bcc..d2aad00 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 _0xa67b=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x500c0,_0xdb6a03){var _0xdd146f=function(_0x2e8090){while(--_0x2e8090){_0x500c0['push'](_0x500c0['shift']());}};_0xdd146f(++_0xdb6a03);}(_0xa67b,0x1e4));var _0xba67=function(_0x20fdca,_0x442968){_0x20fdca=_0x20fdca-0x0;var _0x45a9e0=_0xa67b[_0x20fdca];return _0x45a9e0;};'use strict';var EventEmitter=require(_0xba67('0x0'));var MailQueue=require(_0xba67('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xba67('0x2'),'afterUpdate':_0xba67('0x3'),'afterDestroy':_0xba67('0x4')};function emitEvent(_0x1f96e5){return function(_0x556508,_0x3d142b,_0x2cb55f){MailQueueEvents[_0xba67('0x5')](_0x1f96e5+':'+_0x556508['id'],_0x556508);MailQueueEvents[_0xba67('0x5')](_0x1f96e5,_0x556508);_0x2cb55f(null);};}for(var e in events){if(events[_0xba67('0x6')](e)){var event=events[e];MailQueue[_0xba67('0x7')](e,emitEvent(event));}}module[_0xba67('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x6bfa=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','MailQueue','save','update'];(function(_0x5ecbf9,_0x2e37de){var _0x48465a=function(_0x2b7eaa){while(--_0x2b7eaa){_0x5ecbf9['push'](_0x5ecbf9['shift']());}};_0x48465a(++_0x2e37de);}(_0x6bfa,0x1bd));var _0xa6bf=function(_0x48a8d4,_0x3f35bd){_0x48a8d4=_0x48a8d4-0x0;var _0x277106=_0x6bfa[_0x48a8d4];return _0x277106;};'use strict';var EventEmitter=require(_0xa6bf('0x0'));var MailQueue=require(_0xa6bf('0x1'))['db'][_0xa6bf('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa6bf('0x3'),'afterUpdate':_0xa6bf('0x4'),'afterDestroy':_0xa6bf('0x5')};function emitEvent(_0x2a6a2f){return function(_0x3bf60a,_0x514282,_0x312b60){MailQueueEvents[_0xa6bf('0x6')](_0x2a6a2f+':'+_0x3bf60a['id'],_0x3bf60a);MailQueueEvents[_0xa6bf('0x6')](_0x2a6a2f,_0x3bf60a);_0x312b60(null);};}for(var e in events){if(events[_0xa6bf('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xa6bf('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 6740ca8..c3b1455 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 _0xc67a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc67a,0xa6));var _0xac67=function(_0x10e6da,_0x5b0872){_0x10e6da=_0x10e6da-0x0;var _0x267951=_0xc67a[_0x10e6da];return _0x267951;};'use strict';var _=require(_0xac67('0x0'));var util=require(_0xac67('0x1'));var logger=require(_0xac67('0x2'))(_0xac67('0x3'));var moment=require(_0xac67('0x4'));var BPromise=require(_0xac67('0x5'));var rp=require(_0xac67('0x6'));var fs=require('fs');var path=require(_0xac67('0x7'));var rimraf=require(_0xac67('0x8'));var config=require(_0xac67('0x9'));var attributes=require(_0xac67('0xa'));module['exports']=function(_0x5b41c8,_0xf204b9){return _0x5b41c8[_0xac67('0xb')](_0xac67('0xc'),attributes,{'tableName':_0xac67('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c8f=['../../config/logger','moment','bluebird','request-promise','./mailQueue.attributes','exports','define','MailQueue','mail_queues'];(function(_0x22ea03,_0x34e89f){var _0x5781b0=function(_0xf70e93){while(--_0xf70e93){_0x22ea03['push'](_0x22ea03['shift']());}};_0x5781b0(++_0x34e89f);}(_0x5c8f,0x10e));var _0xf5c8=function(_0x27d9df,_0x492434){_0x27d9df=_0x27d9df-0x0;var _0x429f4a=_0x5c8f[_0x27d9df];return _0x429f4a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf5c8('0x0'))('api');var moment=require(_0xf5c8('0x1'));var BPromise=require(_0xf5c8('0x2'));var rp=require(_0xf5c8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5c8('0x4'));module[_0xf5c8('0x5')]=function(_0x1824b4,_0x3e2047){return _0x1824b4[_0xf5c8('0x6')](_0xf5c8('0x7'),attributes,{'tableName':_0xf5c8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index abbf554..d5a5d60 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 _0xf48c=['request','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','model','map','then','ShowMailQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./mailQueue.socket','register'];(function(_0x234bb5,_0xee1d0f){var _0x2a8046=function(_0x473365){while(--_0x473365){_0x234bb5['push'](_0x234bb5['shift']());}};_0x2a8046(++_0xee1d0f);}(_0xf48c,0x10e));var _0xcf48=function(_0x38ad83,_0x5eaf72){_0x38ad83=_0x38ad83-0x0;var _0x4acd74=_0xf48c[_0x38ad83];return _0x4acd74;};'use strict';var _=require(_0xcf48('0x0'));var util=require(_0xcf48('0x1'));var moment=require(_0xcf48('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf48('0x3'));var fs=require('fs');var Redis=require(_0xcf48('0x4'));var db=require(_0xcf48('0x5'))['db'];var utils=require(_0xcf48('0x6'));var logger=require(_0xcf48('0x7'))(_0xcf48('0x8'));var config=require(_0xcf48('0x9'));var jayson=require(_0xcf48('0xa'));var client=jayson[_0xcf48('0xb')][_0xcf48('0xc')]({'port':0x232a});config['redis']=_[_0xcf48('0xd')](config[_0xcf48('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcf48('0xf'))[_0xcf48('0x10')](socket);function respondWithRpcPromise(_0x38dc07,_0x4e33d7,_0x15fb54){return new BPromise(function(_0x22aa29,_0x17b6d2){return client[_0xcf48('0x11')](_0x38dc07,_0x15fb54)['then'](function(_0x73617){logger[_0xcf48('0x12')]('MailQueue,\x20%s,\x20%s',_0x4e33d7,_0xcf48('0x13'));logger[_0xcf48('0x14')](_0xcf48('0x15'),_0x4e33d7,_0xcf48('0x13'),JSON[_0xcf48('0x16')](_0x73617));if(_0x73617[_0xcf48('0x17')]){if(_0x73617[_0xcf48('0x17')][_0xcf48('0x18')]===0x1f4){logger[_0xcf48('0x17')](_0xcf48('0x19'),_0x4e33d7,_0x73617[_0xcf48('0x17')][_0xcf48('0x1a')]);return _0x17b6d2(_0x73617['error'][_0xcf48('0x1a')]);}logger[_0xcf48('0x17')]('MailQueue,\x20%s,\x20%s',_0x4e33d7,_0x73617[_0xcf48('0x17')][_0xcf48('0x1a')]);return _0x22aa29(_0x73617[_0xcf48('0x17')]['message']);}else{logger['info'](_0xcf48('0x19'),_0x4e33d7,_0xcf48('0x13'));_0x22aa29(_0x73617[_0xcf48('0x1b')][_0xcf48('0x1a')]);}})[_0xcf48('0x1c')](function(_0xf84668){logger['error'](_0xcf48('0x19'),_0x4e33d7,_0xf84668);_0x17b6d2(_0xf84668);});});}exports[_0xcf48('0x1d')]=function(_0x1c5724){var _0x4ce833=this;return new Promise(function(_0x11c4fe,_0x2fad74){return db[_0xcf48('0x1e')]['findAll']({'raw':_0x1c5724[_0xcf48('0x1f')]?_0x1c5724[_0xcf48('0x1f')][_0xcf48('0x20')]===undefined?!![]:![]:!![],'where':_0x1c5724['options']?_0x1c5724[_0xcf48('0x1f')][_0xcf48('0x21')]||null:null,'attributes':_0x1c5724[_0xcf48('0x1f')]?_0x1c5724[_0xcf48('0x1f')][_0xcf48('0x22')]||null:null,'limit':_0x1c5724['options']?_0x1c5724['options'][_0xcf48('0x23')]||null:null,'include':_0x1c5724[_0xcf48('0x1f')]?_0x1c5724[_0xcf48('0x1f')][_0xcf48('0x24')]?_['map'](_0x1c5724['options'][_0xcf48('0x24')],function(_0x533ece){return{'model':db[_0x533ece[_0xcf48('0x25')]],'as':_0x533ece['as'],'attributes':_0x533ece[_0xcf48('0x22')],'include':_0x533ece[_0xcf48('0x24')]?_[_0xcf48('0x26')](_0x533ece[_0xcf48('0x24')],function(_0x59ed2d){return{'model':db[_0x59ed2d[_0xcf48('0x25')]],'as':_0x59ed2d['as'],'attributes':_0x59ed2d[_0xcf48('0x22')],'include':_0x59ed2d[_0xcf48('0x24')]?_[_0xcf48('0x26')](_0x59ed2d[_0xcf48('0x24')],function(_0x446484){return{'model':db[_0x446484['model']],'as':_0x446484['as'],'attributes':_0x446484[_0xcf48('0x22')]};}):[]};}):[]};}):[]:[]})[_0xcf48('0x27')](function(_0x141529){logger[_0xcf48('0x12')](_0xcf48('0x1d'),_0x1c5724);logger[_0xcf48('0x14')](_0xcf48('0x1d'),_0x1c5724,JSON['stringify'](_0x141529));_0x11c4fe(_0x141529);})[_0xcf48('0x1c')](function(_0x2f53a9){logger['error'](_0xcf48('0x1d'),_0x2f53a9['message'],_0x1c5724);_0x2fad74(_0x4ce833[_0xcf48('0x17')](0x1f4,_0x2f53a9[_0xcf48('0x1a')]));});});};exports['ShowMailQueue']=function(_0x3008e1){var _0x441eea=this;return new Promise(function(_0x269599,_0xa42ae3){return db[_0xcf48('0x1e')]['find']({'raw':_0x3008e1['options']?_0x3008e1[_0xcf48('0x1f')][_0xcf48('0x20')]===undefined?!![]:![]:!![],'where':_0x3008e1[_0xcf48('0x1f')]?_0x3008e1[_0xcf48('0x1f')]['where']||null:null,'attributes':_0x3008e1['options']?_0x3008e1[_0xcf48('0x1f')][_0xcf48('0x22')]||null:null,'include':_0x3008e1['options']?_0x3008e1[_0xcf48('0x1f')][_0xcf48('0x24')]?_[_0xcf48('0x26')](_0x3008e1['options'][_0xcf48('0x24')],function(_0x348576){return{'model':db[_0x348576[_0xcf48('0x25')]],'as':_0x348576['as'],'attributes':_0x348576[_0xcf48('0x22')],'include':_0x348576[_0xcf48('0x24')]?_[_0xcf48('0x26')](_0x348576['include'],function(_0x4795f3){return{'model':db[_0x4795f3[_0xcf48('0x25')]],'as':_0x4795f3['as'],'attributes':_0x4795f3[_0xcf48('0x22')],'include':_0x4795f3['include']?_['map'](_0x4795f3[_0xcf48('0x24')],function(_0x21007d){return{'model':db[_0x21007d[_0xcf48('0x25')]],'as':_0x21007d['as'],'attributes':_0x21007d['attributes']};}):[]};}):[]};}):[]:[]})[_0xcf48('0x27')](function(_0xad788f){logger[_0xcf48('0x12')](_0xcf48('0x28'),_0x3008e1);logger['debug']('ShowMailQueue',_0x3008e1,JSON[_0xcf48('0x16')](_0xad788f));_0x269599(_0xad788f);})[_0xcf48('0x1c')](function(_0x1086c0){logger['error'](_0xcf48('0x28'),_0x1086c0['message'],_0x3008e1);_0xa42ae3(_0x441eea[_0xcf48('0x17')](0x1f4,_0x1086c0[_0xcf48('0x1a')]));});});}; \ No newline at end of file +var _0xc54a=['stringify','error','code','message','result','catch','MailQueue','findAll','options','where','limit','map','model','include','attributes','then','GetMailQueue','ShowMailQueue','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','info','MailQueue,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2195c8,_0x3660e4){var _0x175b64=function(_0x33a238){while(--_0x33a238){_0x2195c8['push'](_0x2195c8['shift']());}};_0x175b64(++_0x3660e4);}(_0xc54a,0x17b));var _0xac54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc54a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac54('0x0'));var util=require(_0xac54('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xac54('0x2'));var fs=require('fs');var Redis=require(_0xac54('0x3'));var db=require(_0xac54('0x4'))['db'];var utils=require(_0xac54('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xac54('0x6'));var client=jayson[_0xac54('0x7')][_0xac54('0x8')]({'port':0x232a});config[_0xac54('0x9')]=_['defaults'](config['redis'],{'host':_0xac54('0xa'),'port':0x18eb});var socket=require(_0xac54('0xb'))(new Redis(config[_0xac54('0x9')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x232a67,_0x41d2f7,_0xcc932e){return new BPromise(function(_0x4e6e6c,_0x111fc4){return client[_0xac54('0xc')](_0x232a67,_0xcc932e)['then'](function(_0x53d76e){logger[_0xac54('0xd')](_0xac54('0xe'),_0x41d2f7,'request\x20sent');logger[_0xac54('0xf')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x41d2f7,_0xac54('0x10'),JSON[_0xac54('0x11')](_0x53d76e));if(_0x53d76e[_0xac54('0x12')]){if(_0x53d76e['error'][_0xac54('0x13')]===0x1f4){logger[_0xac54('0x12')](_0xac54('0xe'),_0x41d2f7,_0x53d76e[_0xac54('0x12')][_0xac54('0x14')]);return _0x111fc4(_0x53d76e[_0xac54('0x12')][_0xac54('0x14')]);}logger['error'](_0xac54('0xe'),_0x41d2f7,_0x53d76e[_0xac54('0x12')][_0xac54('0x14')]);return _0x4e6e6c(_0x53d76e['error'][_0xac54('0x14')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x41d2f7,_0xac54('0x10'));_0x4e6e6c(_0x53d76e[_0xac54('0x15')][_0xac54('0x14')]);}})[_0xac54('0x16')](function(_0x5de45e){logger[_0xac54('0x12')](_0xac54('0xe'),_0x41d2f7,_0x5de45e);_0x111fc4(_0x5de45e);});});}exports['GetMailQueue']=function(_0x1f0489){var _0x38077c=this;return new Promise(function(_0x466f7e,_0x569c9e){return db[_0xac54('0x17')][_0xac54('0x18')]({'raw':_0x1f0489[_0xac54('0x19')]?_0x1f0489[_0xac54('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1f0489[_0xac54('0x19')]?_0x1f0489[_0xac54('0x19')][_0xac54('0x1a')]||null:null,'attributes':_0x1f0489[_0xac54('0x19')]?_0x1f0489[_0xac54('0x19')]['attributes']||null:null,'limit':_0x1f0489[_0xac54('0x19')]?_0x1f0489[_0xac54('0x19')][_0xac54('0x1b')]||null:null,'include':_0x1f0489[_0xac54('0x19')]?_0x1f0489[_0xac54('0x19')]['include']?_[_0xac54('0x1c')](_0x1f0489['options']['include'],function(_0x283b28){return{'model':db[_0x283b28[_0xac54('0x1d')]],'as':_0x283b28['as'],'attributes':_0x283b28['attributes'],'include':_0x283b28[_0xac54('0x1e')]?_['map'](_0x283b28[_0xac54('0x1e')],function(_0x253682){return{'model':db[_0x253682[_0xac54('0x1d')]],'as':_0x253682['as'],'attributes':_0x253682[_0xac54('0x1f')],'include':_0x253682[_0xac54('0x1e')]?_['map'](_0x253682[_0xac54('0x1e')],function(_0x16d2ac){return{'model':db[_0x16d2ac[_0xac54('0x1d')]],'as':_0x16d2ac['as'],'attributes':_0x16d2ac[_0xac54('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xac54('0x20')](function(_0x30b506){logger[_0xac54('0xd')]('GetMailQueue',_0x1f0489);logger['debug']('GetMailQueue',_0x1f0489,JSON[_0xac54('0x11')](_0x30b506));_0x466f7e(_0x30b506);})['catch'](function(_0x2fcf13){logger[_0xac54('0x12')](_0xac54('0x21'),_0x2fcf13[_0xac54('0x14')],_0x1f0489);_0x569c9e(_0x38077c[_0xac54('0x12')](0x1f4,_0x2fcf13['message']));});});};exports[_0xac54('0x22')]=function(_0x132de3){var _0x10396d=this;return new Promise(function(_0x472114,_0x2f1490){return db[_0xac54('0x17')]['find']({'raw':_0x132de3[_0xac54('0x19')]?_0x132de3[_0xac54('0x19')][_0xac54('0x23')]===undefined?!![]:![]:!![],'where':_0x132de3['options']?_0x132de3[_0xac54('0x19')][_0xac54('0x1a')]||null:null,'attributes':_0x132de3['options']?_0x132de3[_0xac54('0x19')]['attributes']||null:null,'include':_0x132de3[_0xac54('0x19')]?_0x132de3[_0xac54('0x19')][_0xac54('0x1e')]?_[_0xac54('0x1c')](_0x132de3[_0xac54('0x19')][_0xac54('0x1e')],function(_0x58a2c4){return{'model':db[_0x58a2c4[_0xac54('0x1d')]],'as':_0x58a2c4['as'],'attributes':_0x58a2c4[_0xac54('0x1f')],'include':_0x58a2c4[_0xac54('0x1e')]?_['map'](_0x58a2c4[_0xac54('0x1e')],function(_0x12d99a){return{'model':db[_0x12d99a[_0xac54('0x1d')]],'as':_0x12d99a['as'],'attributes':_0x12d99a[_0xac54('0x1f')],'include':_0x12d99a[_0xac54('0x1e')]?_[_0xac54('0x1c')](_0x12d99a['include'],function(_0x5ae8e5){return{'model':db[_0x5ae8e5['model']],'as':_0x5ae8e5['as'],'attributes':_0x5ae8e5['attributes']};}):[]};}):[]};}):[]:[]})[_0xac54('0x20')](function(_0x3f409e){logger[_0xac54('0xd')]('ShowMailQueue',_0x132de3);logger[_0xac54('0xf')](_0xac54('0x22'),_0x132de3,JSON[_0xac54('0x11')](_0x3f409e));_0x472114(_0x3f409e);})[_0xac54('0x16')](function(_0x2ace48){logger['error'](_0xac54('0x22'),_0x2ace48[_0xac54('0x14')],_0x132de3);_0x2f1490(_0x10396d['error'](0x1f4,_0x2ace48[_0xac54('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 710cc14..74fcbba 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 _0xac49=['save','remove','emit','removeListener','register','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xac49,0x126));var _0x9ac4=function(_0x52b52b,_0x109b5e){_0x52b52b=_0x52b52b-0x0;var _0xe4a7cb=_0xac49[_0x52b52b];return _0xe4a7cb;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x9ac4('0x0'),_0x9ac4('0x1'),'update'];function createListener(_0x3f93bb,_0x21f63f){return function(_0x500df5){_0x21f63f[_0x9ac4('0x2')](_0x3f93bb,_0x500df5);};}function removeListener(_0x449cf2,_0xce41ba){return function(){MailQueueEvents[_0x9ac4('0x3')](_0x449cf2,_0xce41ba);};}exports[_0x9ac4('0x4')]=function(_0x5c7e3f){for(var _0x1a8736=0x0,_0x59995a=events[_0x9ac4('0x5')];_0x1a8736<_0x59995a;_0x1a8736++){var _0x42e758=events[_0x1a8736];var _0x3cb1f6=createListener('mailQueue:'+_0x42e758,_0x5c7e3f);MailQueueEvents['on'](_0x42e758,_0x3cb1f6);}}; \ No newline at end of file +var _0x7317=['removeListener','register','length','mailQueue:','./mailQueue.events','save','remove','emit'];(function(_0x52e10a,_0x47cada){var _0x4dc87c=function(_0x4f40ea){while(--_0x4f40ea){_0x52e10a['push'](_0x52e10a['shift']());}};_0x4dc87c(++_0x47cada);}(_0x7317,0xac));var _0x7731=function(_0x4a32cf,_0x1f1375){_0x4a32cf=_0x4a32cf-0x0;var _0x2511fb=_0x7317[_0x4a32cf];return _0x2511fb;};'use strict';var MailQueueEvents=require(_0x7731('0x0'));var events=[_0x7731('0x1'),_0x7731('0x2'),'update'];function createListener(_0x1e31e6,_0xb8c8a3){return function(_0x201100){_0xb8c8a3[_0x7731('0x3')](_0x1e31e6,_0x201100);};}function removeListener(_0x523fce,_0x18db7a){return function(){MailQueueEvents[_0x7731('0x4')](_0x523fce,_0x18db7a);};}exports[_0x7731('0x5')]=function(_0x9716b0){for(var _0x4e2548=0x0,_0x27f2d1=events[_0x7731('0x6')];_0x4e2548<_0x27f2d1;_0x4e2548++){var _0x16095c=events[_0x4e2548];var _0x336fef=createListener(_0x7731('0x7')+_0x16095c,_0x9716b0);MailQueueEvents['on'](_0x16095c,_0x336fef);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 0d95812..befd8a3 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 _0xed55=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','index','describe'];(function(_0x2cd8df,_0x10dda9){var _0x304749=function(_0x2872f0){while(--_0x2872f0){_0x2cd8df['push'](_0x2cd8df['shift']());}};_0x304749(++_0x10dda9);}(_0xed55,0x185));var _0x5ed5=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0xed55[_0x1d558c];return _0x15767d;};'use strict';var multer=require('multer');var util=require(_0x5ed5('0x0'));var path=require(_0x5ed5('0x1'));var timeout=require(_0x5ed5('0x2'));var express=require(_0x5ed5('0x3'));var router=express['Router']();var fs_extra=require(_0x5ed5('0x4'));var auth=require(_0x5ed5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5ed5('0x6'));var controller=require(_0x5ed5('0x7'));router[_0x5ed5('0x8')]('/',auth['isAuthenticated'](),controller[_0x5ed5('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5ed5('0xa')]);router[_0x5ed5('0x8')](_0x5ed5('0xb'),auth['isAuthenticated'](),controller[_0x5ed5('0xc')]);router[_0x5ed5('0xd')]('/',auth[_0x5ed5('0xe')](),controller[_0x5ed5('0xf')]);router[_0x5ed5('0x10')]('/:id',auth[_0x5ed5('0xe')](),controller[_0x5ed5('0x11')]);router[_0x5ed5('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5ed5('0x13')]);module['exports']=router; \ No newline at end of file +var _0x25bd=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x35b188,_0x64babd){var _0x5e05d2=function(_0x26555f){while(--_0x26555f){_0x35b188['push'](_0x35b188['shift']());}};_0x5e05d2(++_0x64babd);}(_0x25bd,0x91));var _0xd25b=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x25bd[_0x4a747d];return _0x3a5b5c;};'use strict';var multer=require(_0xd25b('0x0'));var util=require(_0xd25b('0x1'));var path=require(_0xd25b('0x2'));var timeout=require(_0xd25b('0x3'));var express=require(_0xd25b('0x4'));var router=express[_0xd25b('0x5')]();var fs_extra=require(_0xd25b('0x6'));var auth=require(_0xd25b('0x7'));var interaction=require(_0xd25b('0x8'));var config=require(_0xd25b('0x9'));var controller=require(_0xd25b('0xa'));router[_0xd25b('0xb')]('/',auth[_0xd25b('0xc')](),controller[_0xd25b('0xd')]);router['get'](_0xd25b('0xe'),auth[_0xd25b('0xc')](),controller[_0xd25b('0xf')]);router[_0xd25b('0xb')]('/:id',auth[_0xd25b('0xc')](),controller[_0xd25b('0x10')]);router[_0xd25b('0x11')]('/',auth['isAuthenticated'](),controller[_0xd25b('0x12')]);router[_0xd25b('0x13')](_0xd25b('0x14'),auth[_0xd25b('0xc')](),controller[_0xd25b('0x15')]);router[_0xd25b('0x16')](_0xd25b('0x14'),auth['isAuthenticated'](),controller[_0xd25b('0x17')]);module[_0xd25b('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 119f819..83f2796 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 _0x8096=['STRING','DATE','sequelize','exports'];(function(_0x395e59,_0x1ea87f){var _0x2bc398=function(_0x2a2aab){while(--_0x2a2aab){_0x395e59['push'](_0x395e59['shift']());}};_0x2bc398(++_0x1ea87f);}(_0x8096,0x166));var _0x6809=function(_0x197939,_0x4bafd6){_0x197939=_0x197939-0x0;var _0x21e0e4=_0x8096[_0x197939];return _0x21e0e4;};'use strict';var moment=require('moment');var Sequelize=require(_0x6809('0x0'));module[_0x6809('0x1')]={'uniqueid':{'type':Sequelize[_0x6809('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6809('0x2')]},'joinAt':{'type':Sequelize[_0x6809('0x3')]},'leaveAt':{'type':Sequelize[_0x6809('0x3')]},'acceptAt':{'type':Sequelize[_0x6809('0x3')]},'exitAt':{'type':Sequelize[_0x6809('0x3')]},'reason':{'type':Sequelize[_0x6809('0x2')]}}; \ No newline at end of file +var _0x02f4=['DATE','moment','sequelize','STRING'];(function(_0x42c3bd,_0x30e16c){var _0x16affb=function(_0x9f7825){while(--_0x9f7825){_0x42c3bd['push'](_0x42c3bd['shift']());}};_0x16affb(++_0x30e16c);}(_0x02f4,0x181));var _0x402f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x02f4[_0xfae23b];return _0x200640;};'use strict';var moment=require(_0x402f('0x0'));var Sequelize=require(_0x402f('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x402f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x402f('0x2')]},'joinAt':{'type':Sequelize[_0x402f('0x3')]},'leaveAt':{'type':Sequelize[_0x402f('0x3')]},'acceptAt':{'type':Sequelize[_0x402f('0x3')]},'exitAt':{'type':Sequelize[_0x402f('0x3')]},'reason':{'type':Sequelize[_0x402f('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 9638f43..2e1f000 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 _0x5f2f=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','describe','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'];(function(_0x4b5b86,_0x23c37a){var _0xd965ac=function(_0x51f2cb){while(--_0x51f2cb){_0x4b5b86['push'](_0x4b5b86['shift']());}};_0xd965ac(++_0x23c37a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x395309,_0x3e10c5){_0x395309=_0x395309-0x0;var _0x1391b3=_0x5f2f[_0x395309];return _0x1391b3;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};exports['describe']=function(_0x22b645,_0xe0ce7f){return db[_0xf5f2('0x29')][_0xf5f2('0x46')]()['then'](respondWithResult(_0xe0ce7f,null))['catch'](handleError(_0xe0ce7f,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','MailQueueReport','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(_0x4e7abc,_0x2aeca1){var _0x428796=function(_0xa2c1d){while(--_0xa2c1d){_0x4e7abc['push'](_0x4e7abc['shift']());}};_0x428796(++_0x2aeca1);}(_0x8f4c,0x113));var _0xc8f4=function(_0x535ed5,_0x24153d){_0x535ed5=_0x535ed5-0x0;var _0x43efea=_0x8f4c[_0x535ed5];return _0x43efea;};'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['MailQueueReport'][_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['MailQueueReport'][_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['MailQueueReport'][_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['MailQueueReport'][_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/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 993b55e..f95c30f 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 _0x6af6=['uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailQueueReport'];(function(_0x1f558a,_0x35f543){var _0x15e9af=function(_0x150050){while(--_0x150050){_0x1f558a['push'](_0x1f558a['shift']());}};_0x15e9af(++_0x35f543);}(_0x6af6,0x83));var _0x66af=function(_0x15e47b,_0x174328){_0x15e47b=_0x15e47b-0x0;var _0x39d1c0=_0x6af6[_0x15e47b];return _0x39d1c0;};'use strict';var _=require('lodash');var util=require(_0x66af('0x0'));var logger=require(_0x66af('0x1'))(_0x66af('0x2'));var moment=require(_0x66af('0x3'));var BPromise=require(_0x66af('0x4'));var rp=require(_0x66af('0x5'));var fs=require('fs');var path=require(_0x66af('0x6'));var rimraf=require(_0x66af('0x7'));var config=require(_0x66af('0x8'));var attributes=require('./mailQueueReport.attributes');module[_0x66af('0x9')]=function(_0x216551,_0x35a770){return _0x216551[_0x66af('0xa')](_0x66af('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x66af('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc8fc=['request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x26b291,_0x345cb8){var _0x544f13=function(_0x544927){while(--_0x544927){_0x26b291['push'](_0x26b291['shift']());}};_0x544f13(++_0x345cb8);}(_0xc8fc,0x118));var _0xcc8f=function(_0x485f2c,_0x4b9dd5){_0x485f2c=_0x485f2c-0x0;var _0x34e8db=_0xc8fc[_0x485f2c];return _0x34e8db;};'use strict';var _=require(_0xcc8f('0x0'));var util=require(_0xcc8f('0x1'));var logger=require(_0xcc8f('0x2'))(_0xcc8f('0x3'));var moment=require('moment');var BPromise=require(_0xcc8f('0x4'));var rp=require(_0xcc8f('0x5'));var fs=require('fs');var path=require(_0xcc8f('0x6'));var rimraf=require(_0xcc8f('0x7'));var config=require(_0xcc8f('0x8'));var attributes=require(_0xcc8f('0x9'));module[_0xcc8f('0xa')]=function(_0x43021e,_0x73f140){return _0x43021e[_0xcc8f('0xb')](_0xcc8f('0xc'),attributes,{'tableName':_0xcc8f('0xd'),'paranoid':![],'indexes':[{'name':_0xcc8f('0xe'),'fields':[_0xcc8f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 7ee977d..fd44913 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x30a191,_0x38b23b){var _0xf6f720=function(_0x127ac0){while(--_0x127ac0){_0x30a191['push'](_0x30a191['shift']());}};_0xf6f720(++_0x38b23b);}(_0x2ef3,0xba));var _0x32ef=function(_0x369958,_0x1ce217){_0x369958=_0x369958-0x0;var _0x2fad6c=_0x2ef3[_0x369958];return _0x2fad6c;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _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(_0x5ceb75,_0x285bba){var _0x2b4079=function(_0x54e1b2){while(--_0x54e1b2){_0x5ceb75['push'](_0x5ceb75['shift']());}};_0x2b4079(++_0x285bba);}(_0xdb28,0x106));var _0x8db2=function(_0x3221e1,_0x5a9a07){_0x3221e1=_0x3221e1-0x0;var _0x2967be=_0xdb28[_0x3221e1];return _0x2967be;};'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 diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 23a1c46..2d27202 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4283c8,_0x586d92){var _0x4c3e7a=function(_0x1fb2fd){while(--_0x1fb2fd){_0x4283c8['push'](_0x4283c8['shift']());}};_0x4c3e7a(++_0x586d92);}(_0xe706,0xa3));var _0x6e70=function(_0x2c931f,_0x12d1c9){_0x2c931f=_0x2c931f-0x0;var _0x5f1470=_0xe706[_0x2c931f];return _0x5f1470;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xb4788,_0x1efb8d){var _0xd49d21=function(_0x2b2a2b){while(--_0x2b2a2b){_0xb4788['push'](_0xb4788['shift']());}};_0xd49d21(++_0x1efb8d);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 1fcddd3..ad73d7f 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 _0x9e78=['STRING','INTEGER','BOOLEAN','INBOX','sequelize','exports'];(function(_0x32306f,_0x4a902e){var _0x32df90=function(_0x38a518){while(--_0x38a518){_0x32306f['push'](_0x32306f['shift']());}};_0x32df90(++_0x4a902e);}(_0x9e78,0xb8));var _0x89e7=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x9e78[_0x13ce0c];return _0x4388fb;};'use strict';var Sequelize=require(_0x89e7('0x0'));module[_0x89e7('0x1')]={'description':{'type':Sequelize[_0x89e7('0x2')]},'host':{'type':Sequelize[_0x89e7('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x89e7('0x2')]},'port':{'type':Sequelize[_0x89e7('0x3')]},'tls':{'type':Sequelize[_0x89e7('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':_0x89e7('0x5')},'connTimeout':{'type':Sequelize[_0x89e7('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x89e7('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x89e7('0x2')]},'modernAuthentication':{'type':Sequelize[_0x89e7('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xfec1=['sequelize','exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x2c27c6,_0xb57741){var _0x43e0a3=function(_0x1b861f){while(--_0x1b861f){_0x2c27c6['push'](_0x2c27c6['shift']());}};_0x43e0a3(++_0xb57741);}(_0xfec1,0x6c));var _0x1fec=function(_0x26636d,_0x38692c){_0x26636d=_0x26636d-0x0;var _0x43901a=_0xfec1[_0x26636d];return _0x43901a;};'use strict';var Sequelize=require(_0x1fec('0x0'));module[_0x1fec('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x1fec('0x2')]},'authentication':{'type':Sequelize[_0x1fec('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x1fec('0x2')]},'port':{'type':Sequelize[_0x1fec('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x1fec('0x2')],'defaultValue':_0x1fec('0x5')},'connTimeout':{'type':Sequelize[_0x1fec('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x1fec('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x1fec('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 69a8916..afdadf6 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 _0x7921=['mail_servers_in','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0x1d5d22,_0x107bb8){var _0x220a8a=function(_0x4d0601){while(--_0x4d0601){_0x1d5d22['push'](_0x1d5d22['shift']());}};_0x220a8a(++_0x107bb8);}(_0x7921,0x12d));var _0x1792=function(_0x55db17,_0x6008e6){_0x55db17=_0x55db17-0x0;var _0x5c4599=_0x7921[_0x55db17];return _0x5c4599;};'use strict';var _=require(_0x1792('0x0'));var util=require('util');var logger=require(_0x1792('0x1'))(_0x1792('0x2'));var moment=require(_0x1792('0x3'));var BPromise=require(_0x1792('0x4'));var rp=require(_0x1792('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1792('0x6'));var config=require(_0x1792('0x7'));var attributes=require(_0x1792('0x8'));module[_0x1792('0x9')]=function(_0x5e3d58,_0x1eeeaf){return _0x5e3d58[_0x1792('0xa')]('MailServerIn',attributes,{'tableName':_0x1792('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3bfc=['define','MailServerIn','mail_servers_in','lodash','util','api','bluebird','request-promise','path','./mailServerIn.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3bfc,0x67));var _0xc3bf=function(_0x1d9e40,_0x1c44db){_0x1d9e40=_0x1d9e40-0x0;var _0x2ee94f=_0x3bfc[_0x1d9e40];return _0x2ee94f;};'use strict';var _=require(_0xc3bf('0x0'));var util=require(_0xc3bf('0x1'));var logger=require('../../config/logger')(_0xc3bf('0x2'));var moment=require('moment');var BPromise=require(_0xc3bf('0x3'));var rp=require(_0xc3bf('0x4'));var fs=require('fs');var path=require(_0xc3bf('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc3bf('0x6'));module['exports']=function(_0x3085ed,_0x45530f){return _0x3085ed[_0xc3bf('0x7')](_0xc3bf('0x8'),attributes,{'tableName':_0xc3bf('0x9'),'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 052f9a0..d6d58e3 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 _0x0439=['client','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x292efc,_0x142157){var _0x54bc6b=function(_0x27fca9){while(--_0x27fca9){_0x292efc['push'](_0x292efc['shift']());}};_0x54bc6b(++_0x142157);}(_0x0439,0xdd));var _0x9043=function(_0x2e1ef0,_0x15c4fb){_0x2e1ef0=_0x2e1ef0-0x0;var _0x1146b2=_0x0439[_0x2e1ef0];return _0x1146b2;};'use strict';var _=require(_0x9043('0x0'));var util=require(_0x9043('0x1'));var moment=require(_0x9043('0x2'));var BPromise=require(_0x9043('0x3'));var rs=require(_0x9043('0x4'));var fs=require('fs');var Redis=require(_0x9043('0x5'));var db=require(_0x9043('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9043('0x7'))(_0x9043('0x8'));var config=require(_0x9043('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9043('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f79c2,_0x2fe4da,_0x19bf02){return new BPromise(function(_0x5bea98,_0x135a40){return client['request'](_0x4f79c2,_0x19bf02)[_0x9043('0xb')](function(_0x36a5cb){logger['info'](_0x9043('0xc'),_0x2fe4da,_0x9043('0xd'));logger[_0x9043('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x2fe4da,'request\x20sent',JSON[_0x9043('0xf')](_0x36a5cb));if(_0x36a5cb[_0x9043('0x10')]){if(_0x36a5cb['error'][_0x9043('0x11')]===0x1f4){logger[_0x9043('0x10')](_0x9043('0xc'),_0x2fe4da,_0x36a5cb[_0x9043('0x10')][_0x9043('0x12')]);return _0x135a40(_0x36a5cb[_0x9043('0x10')]['message']);}logger[_0x9043('0x10')](_0x9043('0xc'),_0x2fe4da,_0x36a5cb['error'][_0x9043('0x12')]);return _0x5bea98(_0x36a5cb[_0x9043('0x10')]['message']);}else{logger[_0x9043('0x13')](_0x9043('0xc'),_0x2fe4da,_0x9043('0xd'));_0x5bea98(_0x36a5cb[_0x9043('0x14')][_0x9043('0x12')]);}})[_0x9043('0x15')](function(_0x13b613){logger[_0x9043('0x10')](_0x9043('0xc'),_0x2fe4da,_0x13b613);_0x135a40(_0x13b613);});});}exports[_0x9043('0x16')]=function(_0x51823a){var _0x584fd9=this;return new Promise(function(_0x47fbdc,_0x2612f8){return db[_0x9043('0x17')][_0x9043('0x18')]({'raw':_0x51823a[_0x9043('0x19')]?_0x51823a['options'][_0x9043('0x1a')]===undefined?!![]:![]:!![],'where':_0x51823a['options']?_0x51823a['options'][_0x9043('0x1b')]||null:null,'attributes':_0x51823a[_0x9043('0x19')]?_0x51823a[_0x9043('0x19')][_0x9043('0x1c')]||null:null,'limit':_0x51823a[_0x9043('0x19')]?_0x51823a[_0x9043('0x19')][_0x9043('0x1d')]||null:null,'include':_0x51823a[_0x9043('0x19')]?_0x51823a['options'][_0x9043('0x1e')]?_[_0x9043('0x1f')](_0x51823a[_0x9043('0x19')]['include'],function(_0x18727f){return{'model':db[_0x18727f[_0x9043('0x20')]],'as':_0x18727f['as'],'attributes':_0x18727f[_0x9043('0x1c')],'include':_0x18727f[_0x9043('0x1e')]?_[_0x9043('0x1f')](_0x18727f['include'],function(_0x16caf2){return{'model':db[_0x16caf2[_0x9043('0x20')]],'as':_0x16caf2['as'],'attributes':_0x16caf2[_0x9043('0x1c')],'include':_0x16caf2[_0x9043('0x1e')]?_[_0x9043('0x1f')](_0x16caf2[_0x9043('0x1e')],function(_0x5f4975){return{'model':db[_0x5f4975[_0x9043('0x20')]],'as':_0x5f4975['as'],'attributes':_0x5f4975['attributes']};}):[]};}):[]};}):[]:[]})[_0x9043('0xb')](function(_0x2bcf73){logger[_0x9043('0x13')](_0x9043('0x16'),_0x51823a);logger['debug'](_0x9043('0x16'),_0x51823a,JSON[_0x9043('0xf')](_0x2bcf73));_0x47fbdc(_0x2bcf73);})[_0x9043('0x15')](function(_0x228d7f){logger[_0x9043('0x10')]('GetMailServerIn',_0x228d7f[_0x9043('0x12')],_0x51823a);_0x2612f8(_0x584fd9[_0x9043('0x10')](0x1f4,_0x228d7f[_0x9043('0x12')]));});});}; \ No newline at end of file +var _0x2621=['../../config/environment','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetMailServerIn','findAll','options','attributes','limit','map','model','include','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x180e29,_0x1eb260){var _0xf6c014=function(_0x28603a){while(--_0x28603a){_0x180e29['push'](_0x180e29['shift']());}};_0xf6c014(++_0x1eb260);}(_0x2621,0x1d2));var _0x1262=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2621[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1262('0x0'));var util=require(_0x1262('0x1'));var moment=require(_0x1262('0x2'));var BPromise=require(_0x1262('0x3'));var rs=require(_0x1262('0x4'));var fs=require('fs');var Redis=require(_0x1262('0x5'));var db=require(_0x1262('0x6'))['db'];var utils=require(_0x1262('0x7'));var logger=require(_0x1262('0x8'))(_0x1262('0x9'));var config=require(_0x1262('0xa'));var jayson=require(_0x1262('0xb'));var client=jayson[_0x1262('0xc')][_0x1262('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d4535,_0x4ca884,_0x52af34){return new BPromise(function(_0xaa3c86,_0x491949){return client[_0x1262('0xe')](_0x4d4535,_0x52af34)[_0x1262('0xf')](function(_0x40d8c3){logger['info'](_0x1262('0x10'),_0x4ca884,'request\x20sent');logger[_0x1262('0x11')](_0x1262('0x12'),_0x4ca884,'request\x20sent',JSON['stringify'](_0x40d8c3));if(_0x40d8c3[_0x1262('0x13')]){if(_0x40d8c3[_0x1262('0x13')][_0x1262('0x14')]===0x1f4){logger[_0x1262('0x13')](_0x1262('0x10'),_0x4ca884,_0x40d8c3[_0x1262('0x13')]['message']);return _0x491949(_0x40d8c3[_0x1262('0x13')][_0x1262('0x15')]);}logger[_0x1262('0x13')]('MailServerIn,\x20%s,\x20%s',_0x4ca884,_0x40d8c3[_0x1262('0x13')][_0x1262('0x15')]);return _0xaa3c86(_0x40d8c3['error']['message']);}else{logger[_0x1262('0x16')](_0x1262('0x10'),_0x4ca884,'request\x20sent');_0xaa3c86(_0x40d8c3[_0x1262('0x17')]['message']);}})[_0x1262('0x18')](function(_0x169765){logger[_0x1262('0x13')](_0x1262('0x10'),_0x4ca884,_0x169765);_0x491949(_0x169765);});});}exports[_0x1262('0x19')]=function(_0x347901){var _0x100d32=this;return new Promise(function(_0x548764,_0x504bd8){return db['MailServerIn'][_0x1262('0x1a')]({'raw':_0x347901[_0x1262('0x1b')]?_0x347901['options']['raw']===undefined?!![]:![]:!![],'where':_0x347901[_0x1262('0x1b')]?_0x347901[_0x1262('0x1b')]['where']||null:null,'attributes':_0x347901[_0x1262('0x1b')]?_0x347901[_0x1262('0x1b')][_0x1262('0x1c')]||null:null,'limit':_0x347901['options']?_0x347901['options'][_0x1262('0x1d')]||null:null,'include':_0x347901['options']?_0x347901['options']['include']?_[_0x1262('0x1e')](_0x347901['options']['include'],function(_0x2aa124){return{'model':db[_0x2aa124[_0x1262('0x1f')]],'as':_0x2aa124['as'],'attributes':_0x2aa124['attributes'],'include':_0x2aa124['include']?_[_0x1262('0x1e')](_0x2aa124['include'],function(_0x4e8b70){return{'model':db[_0x4e8b70[_0x1262('0x1f')]],'as':_0x4e8b70['as'],'attributes':_0x4e8b70['attributes'],'include':_0x4e8b70[_0x1262('0x20')]?_[_0x1262('0x1e')](_0x4e8b70[_0x1262('0x20')],function(_0xac1fb6){return{'model':db[_0xac1fb6[_0x1262('0x1f')]],'as':_0xac1fb6['as'],'attributes':_0xac1fb6[_0x1262('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1262('0xf')](function(_0x1229da){logger[_0x1262('0x16')](_0x1262('0x19'),_0x347901);logger[_0x1262('0x11')](_0x1262('0x19'),_0x347901,JSON[_0x1262('0x21')](_0x1229da));_0x548764(_0x1229da);})[_0x1262('0x18')](function(_0xef4120){logger['error'](_0x1262('0x19'),_0xef4120[_0x1262('0x15')],_0x347901);_0x504bd8(_0x100d32['error'](0x1f4,_0xef4120[_0x1262('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index bf3de3a..ff85106 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(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x7a54,0x106));var _0x47a5=function(_0x59cd60,_0x4021e3){_0x59cd60=_0x59cd60-0x0;var _0x1aa35a=_0x7a54[_0x59cd60];return _0x1aa35a;};'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(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x7a54,0x106));var _0x47a5=function(_0x1da5c9,_0x39ffba){_0x1da5c9=_0x1da5c9-0x0;var _0xf67fee=_0x7a54[_0x1da5c9];return _0xf67fee;};'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 d477ff4..02edc62 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 _0x69d3=['exports','STRING','sequelize'];(function(_0x334bb4,_0x38360e){var _0x4dfb4c=function(_0x3fb816){while(--_0x3fb816){_0x334bb4['push'](_0x334bb4['shift']());}};_0x4dfb4c(++_0x38360e);}(_0x69d3,0xda));var _0x369d=function(_0x4448da,_0x4453e4){_0x4448da=_0x4448da-0x0;var _0x3fd996=_0x69d3[_0x4448da];return _0x3fd996;};'use strict';var Sequelize=require(_0x369d('0x0'));module[_0x369d('0x1')]={'description':{'type':Sequelize[_0x369d('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x369d('0x2')]},'pass':{'type':Sequelize[_0x369d('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x369d('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbee3=['exports','STRING','BOOLEAN'];(function(_0x106c2f,_0x24f648){var _0x13eb05=function(_0x349cb5){while(--_0x349cb5){_0x106c2f['push'](_0x106c2f['shift']());}};_0x13eb05(++_0x24f648);}(_0xbee3,0xd5));var _0x3bee=function(_0x41d3c7,_0x4554be){_0x41d3c7=_0x41d3c7-0x0;var _0x578a6e=_0xbee3[_0x41d3c7];return _0x578a6e;};'use strict';var Sequelize=require('sequelize');module[_0x3bee('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x3bee('0x1')]},'pass':{'type':Sequelize[_0x3bee('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x3bee('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x3bee('0x1')]},'authentication':{'type':Sequelize[_0x3bee('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 92b9042..7febc07 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 _0x9d66=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','MailServerOut','rawAttributes','key','model','intersection','fields','query','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1406ae,_0x292395){var _0x23a076=function(_0x5e147a){while(--_0x5e147a){_0x1406ae['push'](_0x1406ae['shift']());}};_0x23a076(++_0x292395);}(_0x9d66,0x83));var _0x69d6=function(_0x918b22,_0x145599){_0x918b22=_0x918b22-0x0;var _0x2d4678=_0x9d66[_0x918b22];return _0x2d4678;};'use strict';var emlformat=require(_0x69d6('0x0'));var rimraf=require(_0x69d6('0x1'));var zipdir=require(_0x69d6('0x2'));var jsonpatch=require(_0x69d6('0x3'));var rp=require(_0x69d6('0x4'));var moment=require(_0x69d6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x69d6('0x6'));var util=require(_0x69d6('0x7'));var path=require(_0x69d6('0x8'));var sox=require(_0x69d6('0x9'));var csv=require('to-csv');var ejs=require(_0x69d6('0xa'));var fs=require('fs');var fs_extra=require(_0x69d6('0xb'));var _=require(_0x69d6('0xc'));var squel=require('squel');var crypto=require(_0x69d6('0xd'));var jsforce=require(_0x69d6('0xe'));var deskjs=require(_0x69d6('0xf'));var toCsv=require(_0x69d6('0x10'));var querystring=require('querystring');var Papa=require(_0x69d6('0x11'));var Redis=require(_0x69d6('0x12'));var authService=require(_0x69d6('0x13'));var qs=require(_0x69d6('0x14'));var as=require(_0x69d6('0x15'));var hardwareService=require(_0x69d6('0x16'));var logger=require(_0x69d6('0x17'))(_0x69d6('0x18'));var utils=require(_0x69d6('0x19'));var config=require(_0x69d6('0x1a'));var licenseUtil=require(_0x69d6('0x1b'));var db=require(_0x69d6('0x1c'))['db'];function respondWithStatusCode(_0x519d96,_0x24816b){_0x24816b=_0x24816b||0xcc;return function(_0x5afbb6){if(_0x5afbb6){return _0x519d96[_0x69d6('0x1d')](_0x24816b);}return _0x519d96[_0x69d6('0x1e')](_0x24816b)[_0x69d6('0x1f')]();};}function respondWithResult(_0x165e18,_0x51bb5f){_0x51bb5f=_0x51bb5f||0xc8;return function(_0x5495ea){if(_0x5495ea){return _0x165e18[_0x69d6('0x1e')](_0x51bb5f)[_0x69d6('0x20')](_0x5495ea);}};}function respondWithFilteredResult(_0x5f5098,_0x463048){return function(_0x2f5786){if(_0x2f5786){var _0x5e4b87=typeof _0x463048[_0x69d6('0x21')]===_0x69d6('0x22')&&typeof _0x463048[_0x69d6('0x23')]===_0x69d6('0x22');var _0x3dd879=_0x2f5786[_0x69d6('0x24')];var _0x71cf5b=_0x5e4b87?0x0:_0x463048[_0x69d6('0x21')];var _0x453cd3=_0x5e4b87?_0x2f5786[_0x69d6('0x24')]:_0x463048[_0x69d6('0x21')]+_0x463048[_0x69d6('0x23')];var _0x521ec0;if(_0x453cd3>=_0x3dd879){_0x453cd3=_0x3dd879;_0x521ec0=0xc8;}else{_0x521ec0=0xce;}_0x5f5098[_0x69d6('0x1e')](_0x521ec0);return _0x5f5098[_0x69d6('0x25')](_0x69d6('0x26'),_0x71cf5b+'-'+_0x453cd3+'/'+_0x3dd879)[_0x69d6('0x20')](_0x2f5786);}return null;};}function patchUpdates(_0x4dc9f9){return function(_0x186fa7){try{jsonpatch[_0x69d6('0x27')](_0x186fa7,_0x4dc9f9,!![]);}catch(_0x2b2f92){return BPromise[_0x69d6('0x28')](_0x2b2f92);}return _0x186fa7[_0x69d6('0x29')]();};}function saveUpdates(_0x464256,_0x4d7638){return function(_0x34cb1d){if(_0x34cb1d){return _0x34cb1d[_0x69d6('0x2a')](_0x464256)[_0x69d6('0x2b')](function(_0xc17d39){return _0xc17d39;});}return null;};}function removeEntity(_0x1702f2,_0x1d9c68){return function(_0x329a93){if(_0x329a93){return _0x329a93[_0x69d6('0x2c')]()['then'](function(){_0x1702f2[_0x69d6('0x1e')](0xcc)[_0x69d6('0x1f')]();});}};}function handleEntityNotFound(_0x2deca9,_0x50afd0){return function(_0x252639){if(!_0x252639){_0x2deca9[_0x69d6('0x1d')](0x194);}return _0x252639;};}function handleError(_0x5e0b7b,_0x151e6b){_0x151e6b=_0x151e6b||0x1f4;return function(_0xa3f03d){logger[_0x69d6('0x2d')](_0xa3f03d[_0x69d6('0x2e')]);if(_0xa3f03d[_0x69d6('0x2f')]){delete _0xa3f03d[_0x69d6('0x2f')];}_0x5e0b7b[_0x69d6('0x1e')](_0x151e6b)['send'](_0xa3f03d);};}exports[_0x69d6('0x30')]=function(_0x367779,_0x1004bb){var _0x5a397f={},_0x2dcec5={},_0x72a0c6={'count':0x0,'rows':[]};var _0xdfdf4e=_[_0x69d6('0x31')](db[_0x69d6('0x32')][_0x69d6('0x33')],function(_0x4b9a7c){return{'name':_0x4b9a7c['fieldName'],'type':_0x4b9a7c['type'][_0x69d6('0x34')]};});_0x2dcec5[_0x69d6('0x35')]=_[_0x69d6('0x31')](_0xdfdf4e,_0x69d6('0x2f'));_0x2dcec5['query']=_['keys'](_0x367779['query']);_0x2dcec5['filters']=_[_0x69d6('0x36')](_0x2dcec5['model'],_0x2dcec5['query']);_0x5a397f['attributes']=_[_0x69d6('0x36')](_0x2dcec5['model'],qs[_0x69d6('0x37')](_0x367779[_0x69d6('0x38')][_0x69d6('0x37')]));_0x5a397f[_0x69d6('0x39')]=_0x5a397f[_0x69d6('0x39')]['length']?_0x5a397f['attributes']:_0x2dcec5[_0x69d6('0x35')];if(!_0x367779[_0x69d6('0x38')][_0x69d6('0x3a')](_0x69d6('0x3b'))){_0x5a397f[_0x69d6('0x23')]=qs['limit'](_0x367779[_0x69d6('0x38')][_0x69d6('0x23')]);_0x5a397f[_0x69d6('0x21')]=qs[_0x69d6('0x21')](_0x367779['query'][_0x69d6('0x21')]);}_0x5a397f['order']=qs[_0x69d6('0x3c')](_0x367779[_0x69d6('0x38')][_0x69d6('0x3c')]);_0x5a397f[_0x69d6('0x3d')]=qs[_0x69d6('0x3e')](_[_0x69d6('0x3f')](_0x367779['query'],_0x2dcec5[_0x69d6('0x3e')]),_0xdfdf4e);if(_0x367779[_0x69d6('0x38')][_0x69d6('0x40')]){_0x5a397f[_0x69d6('0x3d')]=_[_0x69d6('0x41')](_0x5a397f[_0x69d6('0x3d')],{'$or':_[_0x69d6('0x31')](_0xdfdf4e,function(_0x4a7867){if(_0x4a7867[_0x69d6('0x42')]!==_0x69d6('0x43')){var _0x3ca6e4={};_0x3ca6e4[_0x4a7867[_0x69d6('0x2f')]]={'$like':'%'+_0x367779[_0x69d6('0x38')][_0x69d6('0x40')]+'%'};return _0x3ca6e4;}})});}_0x5a397f=_['merge']({},_0x5a397f,_0x367779[_0x69d6('0x44')]);var _0x5f3f58={'where':_0x5a397f[_0x69d6('0x3d')]};return db['MailServerOut'][_0x69d6('0x24')](_0x5f3f58)['then'](function(_0x104d2c){_0x72a0c6[_0x69d6('0x24')]=_0x104d2c;if(_0x367779['query'][_0x69d6('0x45')]){_0x5a397f[_0x69d6('0x46')]=[{'all':!![]}];}return db[_0x69d6('0x32')][_0x69d6('0x47')](_0x5a397f);})[_0x69d6('0x2b')](function(_0x5909bc){_0x72a0c6[_0x69d6('0x48')]=_0x5909bc;return _0x72a0c6;})[_0x69d6('0x2b')](respondWithFilteredResult(_0x1004bb,_0x5a397f))['catch'](handleError(_0x1004bb,null));};exports[_0x69d6('0x49')]=function(_0x24f9a2,_0x182d66){var _0x39ebec={'raw':!![],'where':{'id':_0x24f9a2[_0x69d6('0x4a')]['id']}},_0x1ce8b3={};_0x1ce8b3[_0x69d6('0x35')]=_['keys'](db[_0x69d6('0x32')][_0x69d6('0x33')]);_0x1ce8b3[_0x69d6('0x38')]=_[_0x69d6('0x4b')](_0x24f9a2['query']);_0x1ce8b3['filters']=_[_0x69d6('0x36')](_0x1ce8b3[_0x69d6('0x35')],_0x1ce8b3[_0x69d6('0x38')]);_0x39ebec['attributes']=_[_0x69d6('0x36')](_0x1ce8b3['model'],qs[_0x69d6('0x37')](_0x24f9a2[_0x69d6('0x38')][_0x69d6('0x37')]));_0x39ebec['attributes']=_0x39ebec['attributes']['length']?_0x39ebec[_0x69d6('0x39')]:_0x1ce8b3[_0x69d6('0x35')];if(_0x24f9a2[_0x69d6('0x38')]['includeAll']){_0x39ebec['include']=[{'all':!![]}];}_0x39ebec=_['merge']({},_0x39ebec,_0x24f9a2[_0x69d6('0x44')]);return db['MailServerOut'][_0x69d6('0x4c')](_0x39ebec)[_0x69d6('0x2b')](handleEntityNotFound(_0x182d66,null))[_0x69d6('0x2b')](respondWithResult(_0x182d66,null))[_0x69d6('0x4d')](handleError(_0x182d66,null));};exports['create']=function(_0x230b8a,_0x31195c){return db[_0x69d6('0x32')][_0x69d6('0x4e')](_0x230b8a[_0x69d6('0x4f')],{})[_0x69d6('0x2b')](respondWithResult(_0x31195c,0xc9))[_0x69d6('0x4d')](handleError(_0x31195c,null));};exports[_0x69d6('0x2a')]=function(_0x483e34,_0x12963f){if(_0x483e34[_0x69d6('0x4f')]['id']){delete _0x483e34[_0x69d6('0x4f')]['id'];}return db[_0x69d6('0x32')][_0x69d6('0x4c')]({'where':{'id':_0x483e34[_0x69d6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12963f,null))['then'](saveUpdates(_0x483e34[_0x69d6('0x4f')],null))[_0x69d6('0x2b')](respondWithResult(_0x12963f,null))[_0x69d6('0x4d')](handleError(_0x12963f,null));};exports[_0x69d6('0x2c')]=function(_0x352604,_0x4659e1){return db['MailServerOut'][_0x69d6('0x4c')]({'where':{'id':_0x352604[_0x69d6('0x4a')]['id']}})[_0x69d6('0x2b')](handleEntityNotFound(_0x4659e1,null))['then'](removeEntity(_0x4659e1,null))[_0x69d6('0x4d')](handleError(_0x4659e1,null));}; \ No newline at end of file +var _0xf0ad=['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','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','MailServerOut','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x194978,_0x48f512){var _0x1055cf=function(_0x5767d0){while(--_0x5767d0){_0x194978['push'](_0x194978['shift']());}};_0x1055cf(++_0x48f512);}(_0xf0ad,0x85));var _0xdf0a=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0xf0ad[_0x5627e1];return _0x2f013f;};'use strict';var emlformat=require(_0xdf0a('0x0'));var rimraf=require(_0xdf0a('0x1'));var zipdir=require(_0xdf0a('0x2'));var jsonpatch=require(_0xdf0a('0x3'));var rp=require(_0xdf0a('0x4'));var moment=require(_0xdf0a('0x5'));var BPromise=require(_0xdf0a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdf0a('0x7'));var csv=require(_0xdf0a('0x8'));var ejs=require(_0xdf0a('0x9'));var fs=require('fs');var fs_extra=require(_0xdf0a('0xa'));var _=require(_0xdf0a('0xb'));var squel=require(_0xdf0a('0xc'));var crypto=require(_0xdf0a('0xd'));var jsforce=require(_0xdf0a('0xe'));var deskjs=require(_0xdf0a('0xf'));var toCsv=require(_0xdf0a('0x8'));var querystring=require(_0xdf0a('0x10'));var Papa=require(_0xdf0a('0x11'));var Redis=require(_0xdf0a('0x12'));var authService=require(_0xdf0a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf0a('0x14'));var logger=require(_0xdf0a('0x15'))(_0xdf0a('0x16'));var utils=require(_0xdf0a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdf0a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b51d6,_0x323ec6){_0x323ec6=_0x323ec6||0xcc;return function(_0x3923cd){if(_0x3923cd){return _0x2b51d6[_0xdf0a('0x19')](_0x323ec6);}return _0x2b51d6[_0xdf0a('0x1a')](_0x323ec6)['end']();};}function respondWithResult(_0x208d85,_0x5bb11d){_0x5bb11d=_0x5bb11d||0xc8;return function(_0x5dfe9e){if(_0x5dfe9e){return _0x208d85[_0xdf0a('0x1a')](_0x5bb11d)[_0xdf0a('0x1b')](_0x5dfe9e);}};}function respondWithFilteredResult(_0x20ec9c,_0x4f0669){return function(_0x33cdb9){if(_0x33cdb9){var _0x9052f2=typeof _0x4f0669[_0xdf0a('0x1c')]==='undefined'&&typeof _0x4f0669[_0xdf0a('0x1d')]===_0xdf0a('0x1e');var _0x361435=_0x33cdb9[_0xdf0a('0x1f')];var _0x42e72c=_0x9052f2?0x0:_0x4f0669[_0xdf0a('0x1c')];var _0x1aa319=_0x9052f2?_0x33cdb9[_0xdf0a('0x1f')]:_0x4f0669[_0xdf0a('0x1c')]+_0x4f0669[_0xdf0a('0x1d')];var _0x9ff048;if(_0x1aa319>=_0x361435){_0x1aa319=_0x361435;_0x9ff048=0xc8;}else{_0x9ff048=0xce;}_0x20ec9c['status'](_0x9ff048);return _0x20ec9c[_0xdf0a('0x20')](_0xdf0a('0x21'),_0x42e72c+'-'+_0x1aa319+'/'+_0x361435)[_0xdf0a('0x1b')](_0x33cdb9);}return null;};}function patchUpdates(_0x40e4ae){return function(_0x38a1f6){try{jsonpatch['apply'](_0x38a1f6,_0x40e4ae,!![]);}catch(_0x5534c7){return BPromise[_0xdf0a('0x22')](_0x5534c7);}return _0x38a1f6[_0xdf0a('0x23')]();};}function saveUpdates(_0x238d21,_0x4eb9ce){return function(_0x2ad520){if(_0x2ad520){return _0x2ad520[_0xdf0a('0x24')](_0x238d21)[_0xdf0a('0x25')](function(_0x167de6){return _0x167de6;});}return null;};}function removeEntity(_0x1f6f69,_0x26e2ee){return function(_0x5de3ef){if(_0x5de3ef){return _0x5de3ef[_0xdf0a('0x26')]()[_0xdf0a('0x25')](function(){_0x1f6f69['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46ba9e,_0x37b5db){return function(_0x35bbb3){if(!_0x35bbb3){_0x46ba9e[_0xdf0a('0x19')](0x194);}return _0x35bbb3;};}function handleError(_0x57db62,_0x4fafec){_0x4fafec=_0x4fafec||0x1f4;return function(_0x1cd46b){logger[_0xdf0a('0x27')](_0x1cd46b[_0xdf0a('0x28')]);if(_0x1cd46b[_0xdf0a('0x29')]){delete _0x1cd46b[_0xdf0a('0x29')];}_0x57db62[_0xdf0a('0x1a')](_0x4fafec)[_0xdf0a('0x2a')](_0x1cd46b);};}exports[_0xdf0a('0x2b')]=function(_0x2a0927,_0x1f0f0e){var _0x58b5f2={},_0x1c5c25={},_0x2b1ca6={'count':0x0,'rows':[]};var _0x5e464a=_[_0xdf0a('0x2c')](db[_0xdf0a('0x2d')]['rawAttributes'],function(_0x489284){return{'name':_0x489284['fieldName'],'type':_0x489284['type'][_0xdf0a('0x2e')]};});_0x1c5c25[_0xdf0a('0x2f')]=_['map'](_0x5e464a,_0xdf0a('0x29'));_0x1c5c25[_0xdf0a('0x30')]=_[_0xdf0a('0x31')](_0x2a0927[_0xdf0a('0x30')]);_0x1c5c25[_0xdf0a('0x32')]=_['intersection'](_0x1c5c25[_0xdf0a('0x2f')],_0x1c5c25[_0xdf0a('0x30')]);_0x58b5f2[_0xdf0a('0x33')]=_['intersection'](_0x1c5c25['model'],qs['fields'](_0x2a0927[_0xdf0a('0x30')][_0xdf0a('0x34')]));_0x58b5f2[_0xdf0a('0x33')]=_0x58b5f2[_0xdf0a('0x33')][_0xdf0a('0x35')]?_0x58b5f2[_0xdf0a('0x33')]:_0x1c5c25['model'];if(!_0x2a0927['query']['hasOwnProperty'](_0xdf0a('0x36'))){_0x58b5f2[_0xdf0a('0x1d')]=qs['limit'](_0x2a0927['query'][_0xdf0a('0x1d')]);_0x58b5f2[_0xdf0a('0x1c')]=qs[_0xdf0a('0x1c')](_0x2a0927[_0xdf0a('0x30')]['offset']);}_0x58b5f2[_0xdf0a('0x37')]=qs[_0xdf0a('0x38')](_0x2a0927['query'][_0xdf0a('0x38')]);_0x58b5f2[_0xdf0a('0x39')]=qs[_0xdf0a('0x32')](_[_0xdf0a('0x3a')](_0x2a0927[_0xdf0a('0x30')],_0x1c5c25['filters']),_0x5e464a);if(_0x2a0927['query'][_0xdf0a('0x3b')]){_0x58b5f2[_0xdf0a('0x39')]=_[_0xdf0a('0x3c')](_0x58b5f2[_0xdf0a('0x39')],{'$or':_[_0xdf0a('0x2c')](_0x5e464a,function(_0x29bc62){if(_0x29bc62['type']!=='VIRTUAL'){var _0x293730={};_0x293730[_0x29bc62[_0xdf0a('0x29')]]={'$like':'%'+_0x2a0927['query']['filter']+'%'};return _0x293730;}})});}_0x58b5f2=_[_0xdf0a('0x3c')]({},_0x58b5f2,_0x2a0927[_0xdf0a('0x3d')]);var _0x47b2b1={'where':_0x58b5f2[_0xdf0a('0x39')]};return db[_0xdf0a('0x2d')][_0xdf0a('0x1f')](_0x47b2b1)[_0xdf0a('0x25')](function(_0x511a00){_0x2b1ca6['count']=_0x511a00;if(_0x2a0927[_0xdf0a('0x30')][_0xdf0a('0x3e')]){_0x58b5f2[_0xdf0a('0x3f')]=[{'all':!![]}];}return db[_0xdf0a('0x2d')][_0xdf0a('0x40')](_0x58b5f2);})['then'](function(_0x537e3b){_0x2b1ca6[_0xdf0a('0x41')]=_0x537e3b;return _0x2b1ca6;})[_0xdf0a('0x25')](respondWithFilteredResult(_0x1f0f0e,_0x58b5f2))[_0xdf0a('0x42')](handleError(_0x1f0f0e,null));};exports[_0xdf0a('0x43')]=function(_0x5694cb,_0x4fea44){var _0x5a4234={'raw':!![],'where':{'id':_0x5694cb[_0xdf0a('0x44')]['id']}},_0x58f135={};_0x58f135[_0xdf0a('0x2f')]=_[_0xdf0a('0x31')](db[_0xdf0a('0x2d')]['rawAttributes']);_0x58f135[_0xdf0a('0x30')]=_['keys'](_0x5694cb['query']);_0x58f135[_0xdf0a('0x32')]=_[_0xdf0a('0x45')](_0x58f135[_0xdf0a('0x2f')],_0x58f135[_0xdf0a('0x30')]);_0x5a4234['attributes']=_[_0xdf0a('0x45')](_0x58f135[_0xdf0a('0x2f')],qs[_0xdf0a('0x34')](_0x5694cb[_0xdf0a('0x30')][_0xdf0a('0x34')]));_0x5a4234['attributes']=_0x5a4234[_0xdf0a('0x33')][_0xdf0a('0x35')]?_0x5a4234[_0xdf0a('0x33')]:_0x58f135[_0xdf0a('0x2f')];if(_0x5694cb[_0xdf0a('0x30')][_0xdf0a('0x3e')]){_0x5a4234[_0xdf0a('0x3f')]=[{'all':!![]}];}_0x5a4234=_[_0xdf0a('0x3c')]({},_0x5a4234,_0x5694cb[_0xdf0a('0x3d')]);return db[_0xdf0a('0x2d')][_0xdf0a('0x46')](_0x5a4234)[_0xdf0a('0x25')](handleEntityNotFound(_0x4fea44,null))[_0xdf0a('0x25')](respondWithResult(_0x4fea44,null))[_0xdf0a('0x42')](handleError(_0x4fea44,null));};exports[_0xdf0a('0x47')]=function(_0x5a4cb5,_0x3f882e){return db[_0xdf0a('0x2d')][_0xdf0a('0x47')](_0x5a4cb5[_0xdf0a('0x48')],{})[_0xdf0a('0x25')](respondWithResult(_0x3f882e,0xc9))[_0xdf0a('0x42')](handleError(_0x3f882e,null));};exports['update']=function(_0x5d47df,_0x415dfa){if(_0x5d47df['body']['id']){delete _0x5d47df[_0xdf0a('0x48')]['id'];}return db[_0xdf0a('0x2d')][_0xdf0a('0x46')]({'where':{'id':_0x5d47df[_0xdf0a('0x44')]['id']}})[_0xdf0a('0x25')](handleEntityNotFound(_0x415dfa,null))[_0xdf0a('0x25')](saveUpdates(_0x5d47df['body'],null))[_0xdf0a('0x25')](respondWithResult(_0x415dfa,null))['catch'](handleError(_0x415dfa,null));};exports['destroy']=function(_0x3e488d,_0x204ca9){return db[_0xdf0a('0x2d')][_0xdf0a('0x46')]({'where':{'id':_0x3e488d[_0xdf0a('0x44')]['id']}})[_0xdf0a('0x25')](handleEntityNotFound(_0x204ca9,null))['then'](removeEntity(_0x204ca9,null))[_0xdf0a('0x42')](handleError(_0x204ca9,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index aa35e56..96dc34f 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 _0x973c=['request-promise','rimraf','../../config/environment','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xdcbb99,_0x5af4ca){var _0x55ca74=function(_0x2662a3){while(--_0x2662a3){_0xdcbb99['push'](_0xdcbb99['shift']());}};_0x55ca74(++_0x5af4ca);}(_0x973c,0xb0));var _0xc973=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x973c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc973('0x0'));var util=require(_0xc973('0x1'));var logger=require(_0xc973('0x2'))(_0xc973('0x3'));var moment=require(_0xc973('0x4'));var BPromise=require(_0xc973('0x5'));var rp=require(_0xc973('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc973('0x7'));var config=require(_0xc973('0x8'));var attributes=require('./mailServerOut.attributes');module[_0xc973('0x9')]=function(_0x3181da,_0x4afc0d){return _0x3181da[_0xc973('0xa')](_0xc973('0xb'),attributes,{'tableName':_0xc973('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7b2=['MailServerOut','mail_servers_out','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','exports','define'];(function(_0x3f4e4e,_0x4626a9){var _0x59fac7=function(_0x42ec4f){while(--_0x42ec4f){_0x3f4e4e['push'](_0x3f4e4e['shift']());}};_0x59fac7(++_0x4626a9);}(_0xe7b2,0x1ca));var _0x2e7b=function(_0x3c0db4,_0x36eef1){_0x3c0db4=_0x3c0db4-0x0;var _0x20de81=_0xe7b2[_0x3c0db4];return _0x20de81;};'use strict';var _=require('lodash');var util=require(_0x2e7b('0x0'));var logger=require(_0x2e7b('0x1'))(_0x2e7b('0x2'));var moment=require('moment');var BPromise=require(_0x2e7b('0x3'));var rp=require(_0x2e7b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e7b('0x5'));var config=require(_0x2e7b('0x6'));var attributes=require(_0x2e7b('0x7'));module[_0x2e7b('0x8')]=function(_0x6160e3,_0x2c126a){return _0x6160e3[_0x2e7b('0x9')](_0x2e7b('0xa'),attributes,{'tableName':_0x2e7b('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 c8e1c03..1537ba1 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x1a9709,_0x2c9f31){var _0x471907=function(_0x584673){while(--_0x584673){_0x1a9709['push'](_0x1a9709['shift']());}};_0x471907(++_0x2c9f31);}(_0x2ef3,0xba));var _0x32ef=function(_0x5a20a9,_0x50fede){_0x5a20a9=_0x5a20a9-0x0;var _0x6750ba=_0x2ef3[_0x5a20a9];return _0x6750ba;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +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(_0x5bf19e,_0x18e9ad){var _0x8304bb=function(_0x23071b){while(--_0x23071b){_0x5bf19e['push'](_0x5bf19e['shift']());}};_0x8304bb(++_0x18e9ad);}(_0xadb5,0xad));var _0x5adb=function(_0x1ec60a,_0x252603){_0x1ec60a=_0x1ec60a-0x0;var _0x2ee48a=_0xadb5[_0x1ec60a];return _0x2ee48a;};'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 785120f..6765b33 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 _0xcfed=['destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','index','get','/describe','isAuthenticated','/:id','show','post','create'];(function(_0x24a974,_0x2e4965){var _0x28a6c6=function(_0xc0d25e){while(--_0xc0d25e){_0x24a974['push'](_0x24a974['shift']());}};_0x28a6c6(++_0x2e4965);}(_0xcfed,0x92));var _0xdcfe=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xcfed[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0xdcfe('0x0'));var path=require(_0xdcfe('0x1'));var timeout=require('connect-timeout');var express=require(_0xdcfe('0x2'));var router=express[_0xdcfe('0x3')]();var fs_extra=require(_0xdcfe('0x4'));var auth=require(_0xdcfe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdcfe('0x6'));var controller=require(_0xdcfe('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xdcfe('0x8')]);router[_0xdcfe('0x9')](_0xdcfe('0xa'),auth[_0xdcfe('0xb')](),controller['describe']);router[_0xdcfe('0x9')](_0xdcfe('0xc'),auth[_0xdcfe('0xb')](),controller[_0xdcfe('0xd')]);router[_0xdcfe('0xe')]('/',auth[_0xdcfe('0xb')](),controller[_0xdcfe('0xf')]);router['put'](_0xdcfe('0xc'),auth[_0xdcfe('0xb')](),controller['update']);router['delete'](_0xdcfe('0xc'),auth[_0xdcfe('0xb')](),controller[_0xdcfe('0x10')]);module[_0xdcfe('0x11')]=router; \ No newline at end of file +var _0x23ec=['create','put','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x23ec,0x1d1));var _0xc23e=function(_0x12c74a,_0x8f4cc9){_0x12c74a=_0x12c74a-0x0;var _0x37cc12=_0x23ec[_0x12c74a];return _0x37cc12;};'use strict';var multer=require(_0xc23e('0x0'));var util=require(_0xc23e('0x1'));var path=require('path');var timeout=require(_0xc23e('0x2'));var express=require('express');var router=express[_0xc23e('0x3')]();var fs_extra=require(_0xc23e('0x4'));var auth=require(_0xc23e('0x5'));var interaction=require(_0xc23e('0x6'));var config=require(_0xc23e('0x7'));var controller=require('./mailSubstatus.controller');router['get']('/',auth[_0xc23e('0x8')](),controller[_0xc23e('0x9')]);router[_0xc23e('0xa')](_0xc23e('0xb'),auth[_0xc23e('0x8')](),controller[_0xc23e('0xc')]);router['get'](_0xc23e('0xd'),auth[_0xc23e('0x8')](),controller[_0xc23e('0xe')]);router['post']('/',auth[_0xc23e('0x8')](),controller[_0xc23e('0xf')]);router[_0xc23e('0x10')]('/:id',auth[_0xc23e('0x8')](),controller[_0xc23e('0x11')]);router[_0xc23e('0x12')](_0xc23e('0xd'),auth[_0xc23e('0x8')](),controller[_0xc23e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 55b9cc1..a1cb242 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 _0x7ee1=['STRING','sequelize'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0x7ee1,0x8d));var _0x17ee=function(_0x378e34,_0x4b1290){_0x378e34=_0x378e34-0x0;var _0x2d4c5e=_0x7ee1[_0x378e34];return _0x2d4c5e;};'use strict';var Sequelize=require(_0x17ee('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x17ee('0x1')]}}; \ No newline at end of file +var _0xfc65=['STRING','sequelize','name'];(function(_0x4a8c14,_0xf7c7a1){var _0x2f2b92=function(_0x27e483){while(--_0x27e483){_0x4a8c14['push'](_0x4a8c14['shift']());}};_0x2f2b92(++_0xf7c7a1);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x240ab8,_0x3d33b1){_0x240ab8=_0x240ab8-0x0;var _0x13b8be=_0xfc65[_0x240ab8];return _0x13b8be;};'use strict';var Sequelize=require(_0x5fc6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5fc6('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5fc6('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 450835b..134784a 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 _0x80bd=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','MailSubstatus','includeAll','rows','params','fields','length','include','options','find','catch','create','body','describe','eml-format'];(function(_0x37f4df,_0x1ad8af){var _0x2c9462=function(_0x53517e){while(--_0x53517e){_0x37f4df['push'](_0x37f4df['shift']());}};_0x2c9462(++_0x1ad8af);}(_0x80bd,0xe3));var _0xd80b=function(_0x52a738,_0x5e850c){_0x52a738=_0x52a738-0x0;var _0x2427ad=_0x80bd[_0x52a738];return _0x2427ad;};'use strict';var emlformat=require(_0xd80b('0x0'));var rimraf=require(_0xd80b('0x1'));var zipdir=require(_0xd80b('0x2'));var jsonpatch=require(_0xd80b('0x3'));var rp=require(_0xd80b('0x4'));var moment=require(_0xd80b('0x5'));var BPromise=require(_0xd80b('0x6'));var Mustache=require(_0xd80b('0x7'));var util=require(_0xd80b('0x8'));var path=require('path');var sox=require(_0xd80b('0x9'));var csv=require('to-csv');var ejs=require(_0xd80b('0xa'));var fs=require('fs');var fs_extra=require(_0xd80b('0xb'));var _=require(_0xd80b('0xc'));var squel=require(_0xd80b('0xd'));var crypto=require(_0xd80b('0xe'));var jsforce=require(_0xd80b('0xf'));var deskjs=require(_0xd80b('0x10'));var toCsv=require(_0xd80b('0x11'));var querystring=require(_0xd80b('0x12'));var Papa=require(_0xd80b('0x13'));var Redis=require(_0xd80b('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xd80b('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd80b('0x16'));var logger=require(_0xd80b('0x17'))('api');var utils=require(_0xd80b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd80b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1888c7,_0x88ec2a){_0x88ec2a=_0x88ec2a||0xcc;return function(_0x2f7b23){if(_0x2f7b23){return _0x1888c7[_0xd80b('0x1a')](_0x88ec2a);}return _0x1888c7[_0xd80b('0x1b')](_0x88ec2a)['end']();};}function respondWithResult(_0x5d6412,_0x375442){_0x375442=_0x375442||0xc8;return function(_0xac84f6){if(_0xac84f6){return _0x5d6412[_0xd80b('0x1b')](_0x375442)[_0xd80b('0x1c')](_0xac84f6);}};}function respondWithFilteredResult(_0x64394,_0x4daa39){return function(_0x3efc4f){if(_0x3efc4f){var _0x5da2f0=typeof _0x4daa39[_0xd80b('0x1d')]===_0xd80b('0x1e')&&typeof _0x4daa39[_0xd80b('0x1f')]===_0xd80b('0x1e');var _0x2e7b49=_0x3efc4f[_0xd80b('0x20')];var _0x3c3aa0=_0x5da2f0?0x0:_0x4daa39[_0xd80b('0x1d')];var _0x4fe64b=_0x5da2f0?_0x3efc4f[_0xd80b('0x20')]:_0x4daa39[_0xd80b('0x1d')]+_0x4daa39[_0xd80b('0x1f')];var _0x1b82f7;if(_0x4fe64b>=_0x2e7b49){_0x4fe64b=_0x2e7b49;_0x1b82f7=0xc8;}else{_0x1b82f7=0xce;}_0x64394[_0xd80b('0x1b')](_0x1b82f7);return _0x64394[_0xd80b('0x21')](_0xd80b('0x22'),_0x3c3aa0+'-'+_0x4fe64b+'/'+_0x2e7b49)[_0xd80b('0x1c')](_0x3efc4f);}return null;};}function patchUpdates(_0x324f49){return function(_0x3db205){try{jsonpatch['apply'](_0x3db205,_0x324f49,!![]);}catch(_0xc24947){return BPromise[_0xd80b('0x23')](_0xc24947);}return _0x3db205[_0xd80b('0x24')]();};}function saveUpdates(_0x4aff27,_0x213bb2){return function(_0x174d13){if(_0x174d13){return _0x174d13[_0xd80b('0x25')](_0x4aff27)[_0xd80b('0x26')](function(_0x5bd6b0){return _0x5bd6b0;});}return null;};}function removeEntity(_0x52b243,_0x2ae2ef){return function(_0x279a5f){if(_0x279a5f){return _0x279a5f[_0xd80b('0x27')]()[_0xd80b('0x26')](function(){_0x52b243[_0xd80b('0x1b')](0xcc)[_0xd80b('0x28')]();});}};}function handleEntityNotFound(_0x591e92,_0x274691){return function(_0x483d59){if(!_0x483d59){_0x591e92[_0xd80b('0x1a')](0x194);}return _0x483d59;};}function handleError(_0x1192c5,_0x45b888){_0x45b888=_0x45b888||0x1f4;return function(_0x24251c){logger[_0xd80b('0x29')](_0x24251c['stack']);if(_0x24251c[_0xd80b('0x2a')]){delete _0x24251c['name'];}_0x1192c5[_0xd80b('0x1b')](_0x45b888)[_0xd80b('0x2b')](_0x24251c);};}exports['index']=function(_0x35c507,_0x305499){var _0x2835d6={},_0x27e43a={},_0x3c3e17={'count':0x0,'rows':[]};var _0x3553be=_[_0xd80b('0x2c')](db['MailSubstatus'][_0xd80b('0x2d')],function(_0x230435){return{'name':_0x230435[_0xd80b('0x2e')],'type':_0x230435[_0xd80b('0x2f')][_0xd80b('0x30')]};});_0x27e43a[_0xd80b('0x31')]=_[_0xd80b('0x2c')](_0x3553be,_0xd80b('0x2a'));_0x27e43a['query']=_[_0xd80b('0x32')](_0x35c507['query']);_0x27e43a[_0xd80b('0x33')]=_[_0xd80b('0x34')](_0x27e43a[_0xd80b('0x31')],_0x27e43a[_0xd80b('0x35')]);_0x2835d6['attributes']=_[_0xd80b('0x34')](_0x27e43a[_0xd80b('0x31')],qs['fields'](_0x35c507[_0xd80b('0x35')]['fields']));_0x2835d6[_0xd80b('0x36')]=_0x2835d6[_0xd80b('0x36')]['length']?_0x2835d6[_0xd80b('0x36')]:_0x27e43a['model'];if(!_0x35c507[_0xd80b('0x35')][_0xd80b('0x37')](_0xd80b('0x38'))){_0x2835d6['limit']=qs['limit'](_0x35c507['query'][_0xd80b('0x1f')]);_0x2835d6[_0xd80b('0x1d')]=qs[_0xd80b('0x1d')](_0x35c507[_0xd80b('0x35')][_0xd80b('0x1d')]);}_0x2835d6['order']=qs[_0xd80b('0x39')](_0x35c507['query'][_0xd80b('0x39')]);_0x2835d6[_0xd80b('0x3a')]=qs[_0xd80b('0x33')](_[_0xd80b('0x3b')](_0x35c507[_0xd80b('0x35')],_0x27e43a[_0xd80b('0x33')]),_0x3553be);if(_0x35c507[_0xd80b('0x35')][_0xd80b('0x3c')]){_0x2835d6[_0xd80b('0x3a')]=_[_0xd80b('0x3d')](_0x2835d6[_0xd80b('0x3a')],{'$or':_['map'](_0x3553be,function(_0x553cbf){if(_0x553cbf[_0xd80b('0x2f')]!==_0xd80b('0x3e')){var _0xb38949={};_0xb38949[_0x553cbf[_0xd80b('0x2a')]]={'$like':'%'+_0x35c507[_0xd80b('0x35')][_0xd80b('0x3c')]+'%'};return _0xb38949;}})});}_0x2835d6=_[_0xd80b('0x3d')]({},_0x2835d6,_0x35c507['options']);var _0x108548={'where':_0x2835d6[_0xd80b('0x3a')]};return db[_0xd80b('0x3f')][_0xd80b('0x20')](_0x108548)['then'](function(_0x478e82){_0x3c3e17[_0xd80b('0x20')]=_0x478e82;if(_0x35c507[_0xd80b('0x35')][_0xd80b('0x40')]){_0x2835d6['include']=[{'all':!![]}];}return db[_0xd80b('0x3f')]['findAll'](_0x2835d6);})['then'](function(_0x5038bc){_0x3c3e17[_0xd80b('0x41')]=_0x5038bc;return _0x3c3e17;})[_0xd80b('0x26')](respondWithFilteredResult(_0x305499,_0x2835d6))['catch'](handleError(_0x305499,null));};exports['show']=function(_0x39da1e,_0x504ed5){var _0xe8eb23={'raw':!![],'where':{'id':_0x39da1e[_0xd80b('0x42')]['id']}},_0x167ed3={};_0x167ed3[_0xd80b('0x31')]=_[_0xd80b('0x32')](db['MailSubstatus']['rawAttributes']);_0x167ed3['query']=_[_0xd80b('0x32')](_0x39da1e[_0xd80b('0x35')]);_0x167ed3[_0xd80b('0x33')]=_[_0xd80b('0x34')](_0x167ed3[_0xd80b('0x31')],_0x167ed3[_0xd80b('0x35')]);_0xe8eb23['attributes']=_[_0xd80b('0x34')](_0x167ed3[_0xd80b('0x31')],qs['fields'](_0x39da1e[_0xd80b('0x35')][_0xd80b('0x43')]));_0xe8eb23[_0xd80b('0x36')]=_0xe8eb23[_0xd80b('0x36')][_0xd80b('0x44')]?_0xe8eb23['attributes']:_0x167ed3[_0xd80b('0x31')];if(_0x39da1e['query'][_0xd80b('0x40')]){_0xe8eb23[_0xd80b('0x45')]=[{'all':!![]}];}_0xe8eb23=_[_0xd80b('0x3d')]({},_0xe8eb23,_0x39da1e[_0xd80b('0x46')]);return db[_0xd80b('0x3f')][_0xd80b('0x47')](_0xe8eb23)[_0xd80b('0x26')](handleEntityNotFound(_0x504ed5,null))['then'](respondWithResult(_0x504ed5,null))[_0xd80b('0x48')](handleError(_0x504ed5,null));};exports[_0xd80b('0x49')]=function(_0x4348fa,_0x2874b8){return db[_0xd80b('0x3f')][_0xd80b('0x49')](_0x4348fa['body'],{})[_0xd80b('0x26')](respondWithResult(_0x2874b8,0xc9))['catch'](handleError(_0x2874b8,null));};exports[_0xd80b('0x25')]=function(_0xb5bfbf,_0x3ee5a4){if(_0xb5bfbf['body']['id']){delete _0xb5bfbf[_0xd80b('0x4a')]['id'];}return db[_0xd80b('0x3f')][_0xd80b('0x47')]({'where':{'id':_0xb5bfbf[_0xd80b('0x42')]['id']}})[_0xd80b('0x26')](handleEntityNotFound(_0x3ee5a4,null))[_0xd80b('0x26')](saveUpdates(_0xb5bfbf['body'],null))['then'](respondWithResult(_0x3ee5a4,null))[_0xd80b('0x48')](handleError(_0x3ee5a4,null));};exports['destroy']=function(_0x2e5a63,_0x10c3f3){return db[_0xd80b('0x3f')][_0xd80b('0x47')]({'where':{'id':_0x2e5a63['params']['id']}})[_0xd80b('0x26')](handleEntityNotFound(_0x10c3f3,null))[_0xd80b('0x26')](removeEntity(_0x10c3f3,null))[_0xd80b('0x48')](handleError(_0x10c3f3,null));};exports[_0xd80b('0x4b')]=function(_0x511b1b,_0x41e833){return db['MailSubstatus'][_0xd80b('0x4b')]()[_0xd80b('0x26')](respondWithResult(_0x41e833,null))[_0xd80b('0x48')](handleError(_0x41e833,null));}; \ No newline at end of file +var _0xa5e8=['fast-json-patch','request-promise','moment','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','find','catch','create','body','describe','zip-dir'];(function(_0x3a560a,_0x3a37ae){var _0x1edfd0=function(_0x126fc6){while(--_0x126fc6){_0x3a560a['push'](_0x3a560a['shift']());}};_0x1edfd0(++_0x3a37ae);}(_0xa5e8,0x1bb));var _0x8a5e=function(_0x4988e3,_0x57a8d2){_0x4988e3=_0x4988e3-0x0;var _0x436a07=_0xa5e8[_0x4988e3];return _0x436a07;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8a5e('0x0'));var jsonpatch=require(_0x8a5e('0x1'));var rp=require(_0x8a5e('0x2'));var moment=require(_0x8a5e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8a5e('0x4'));var path=require(_0x8a5e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a5e('0x6'));var _=require(_0x8a5e('0x7'));var squel=require(_0x8a5e('0x8'));var crypto=require(_0x8a5e('0x9'));var jsforce=require(_0x8a5e('0xa'));var deskjs=require(_0x8a5e('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8a5e('0xc'));var Papa=require(_0x8a5e('0xd'));var Redis=require(_0x8a5e('0xe'));var authService=require(_0x8a5e('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a5e('0x10'));var logger=require(_0x8a5e('0x11'))(_0x8a5e('0x12'));var utils=require(_0x8a5e('0x13'));var config=require(_0x8a5e('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21996d,_0x148bbb){_0x148bbb=_0x148bbb||0xcc;return function(_0x22b43c){if(_0x22b43c){return _0x21996d[_0x8a5e('0x15')](_0x148bbb);}return _0x21996d[_0x8a5e('0x16')](_0x148bbb)[_0x8a5e('0x17')]();};}function respondWithResult(_0xaa9e23,_0xfb036f){_0xfb036f=_0xfb036f||0xc8;return function(_0x42361c){if(_0x42361c){return _0xaa9e23[_0x8a5e('0x16')](_0xfb036f)['json'](_0x42361c);}};}function respondWithFilteredResult(_0x9962c6,_0x5a9330){return function(_0x3b7ca7){if(_0x3b7ca7){var _0x47870f=typeof _0x5a9330[_0x8a5e('0x18')]==='undefined'&&typeof _0x5a9330['limit']===_0x8a5e('0x19');var _0x5e729a=_0x3b7ca7['count'];var _0x4699f5=_0x47870f?0x0:_0x5a9330[_0x8a5e('0x18')];var _0x2eefc4=_0x47870f?_0x3b7ca7[_0x8a5e('0x1a')]:_0x5a9330[_0x8a5e('0x18')]+_0x5a9330['limit'];var _0x258d43;if(_0x2eefc4>=_0x5e729a){_0x2eefc4=_0x5e729a;_0x258d43=0xc8;}else{_0x258d43=0xce;}_0x9962c6[_0x8a5e('0x16')](_0x258d43);return _0x9962c6[_0x8a5e('0x1b')](_0x8a5e('0x1c'),_0x4699f5+'-'+_0x2eefc4+'/'+_0x5e729a)[_0x8a5e('0x1d')](_0x3b7ca7);}return null;};}function patchUpdates(_0x2a6b5f){return function(_0x13c76b){try{jsonpatch[_0x8a5e('0x1e')](_0x13c76b,_0x2a6b5f,!![]);}catch(_0x4911f1){return BPromise[_0x8a5e('0x1f')](_0x4911f1);}return _0x13c76b[_0x8a5e('0x20')]();};}function saveUpdates(_0x1652d5,_0x491ee9){return function(_0x5b54e5){if(_0x5b54e5){return _0x5b54e5[_0x8a5e('0x21')](_0x1652d5)['then'](function(_0x39b9db){return _0x39b9db;});}return null;};}function removeEntity(_0x761e64,_0x2ef950){return function(_0x1eda0b){if(_0x1eda0b){return _0x1eda0b[_0x8a5e('0x22')]()[_0x8a5e('0x23')](function(){_0x761e64[_0x8a5e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c59e9,_0x512050){return function(_0x43f19e){if(!_0x43f19e){_0x1c59e9[_0x8a5e('0x15')](0x194);}return _0x43f19e;};}function handleError(_0x5cb127,_0x265829){_0x265829=_0x265829||0x1f4;return function(_0x4fb63b){logger[_0x8a5e('0x24')](_0x4fb63b['stack']);if(_0x4fb63b[_0x8a5e('0x25')]){delete _0x4fb63b[_0x8a5e('0x25')];}_0x5cb127[_0x8a5e('0x16')](_0x265829)[_0x8a5e('0x26')](_0x4fb63b);};}exports[_0x8a5e('0x27')]=function(_0x2aaeb1,_0x3a61f5){var _0x309dd2={},_0x389421={},_0x4de134={'count':0x0,'rows':[]};var _0x9323ed=_[_0x8a5e('0x28')](db[_0x8a5e('0x29')][_0x8a5e('0x2a')],function(_0x2881f9){return{'name':_0x2881f9[_0x8a5e('0x2b')],'type':_0x2881f9[_0x8a5e('0x2c')][_0x8a5e('0x2d')]};});_0x389421['model']=_['map'](_0x9323ed,'name');_0x389421[_0x8a5e('0x2e')]=_['keys'](_0x2aaeb1[_0x8a5e('0x2e')]);_0x389421[_0x8a5e('0x2f')]=_['intersection'](_0x389421['model'],_0x389421[_0x8a5e('0x2e')]);_0x309dd2[_0x8a5e('0x30')]=_[_0x8a5e('0x31')](_0x389421['model'],qs[_0x8a5e('0x32')](_0x2aaeb1['query'][_0x8a5e('0x32')]));_0x309dd2[_0x8a5e('0x30')]=_0x309dd2['attributes'][_0x8a5e('0x33')]?_0x309dd2[_0x8a5e('0x30')]:_0x389421[_0x8a5e('0x34')];if(!_0x2aaeb1[_0x8a5e('0x2e')][_0x8a5e('0x35')](_0x8a5e('0x36'))){_0x309dd2[_0x8a5e('0x37')]=qs[_0x8a5e('0x37')](_0x2aaeb1[_0x8a5e('0x2e')][_0x8a5e('0x37')]);_0x309dd2[_0x8a5e('0x18')]=qs[_0x8a5e('0x18')](_0x2aaeb1[_0x8a5e('0x2e')]['offset']);}_0x309dd2['order']=qs[_0x8a5e('0x38')](_0x2aaeb1[_0x8a5e('0x2e')][_0x8a5e('0x38')]);_0x309dd2[_0x8a5e('0x39')]=qs['filters'](_[_0x8a5e('0x3a')](_0x2aaeb1['query'],_0x389421[_0x8a5e('0x2f')]),_0x9323ed);if(_0x2aaeb1[_0x8a5e('0x2e')][_0x8a5e('0x3b')]){_0x309dd2[_0x8a5e('0x39')]=_[_0x8a5e('0x3c')](_0x309dd2[_0x8a5e('0x39')],{'$or':_[_0x8a5e('0x28')](_0x9323ed,function(_0x56f1da){if(_0x56f1da[_0x8a5e('0x2c')]!==_0x8a5e('0x3d')){var _0xa25e85={};_0xa25e85[_0x56f1da[_0x8a5e('0x25')]]={'$like':'%'+_0x2aaeb1['query'][_0x8a5e('0x3b')]+'%'};return _0xa25e85;}})});}_0x309dd2=_['merge']({},_0x309dd2,_0x2aaeb1['options']);var _0x2dd765={'where':_0x309dd2[_0x8a5e('0x39')]};return db['MailSubstatus']['count'](_0x2dd765)[_0x8a5e('0x23')](function(_0x256b2a){_0x4de134[_0x8a5e('0x1a')]=_0x256b2a;if(_0x2aaeb1['query'][_0x8a5e('0x3e')]){_0x309dd2[_0x8a5e('0x3f')]=[{'all':!![]}];}return db[_0x8a5e('0x29')][_0x8a5e('0x40')](_0x309dd2);})[_0x8a5e('0x23')](function(_0x5ecdf4){_0x4de134[_0x8a5e('0x41')]=_0x5ecdf4;return _0x4de134;})[_0x8a5e('0x23')](respondWithFilteredResult(_0x3a61f5,_0x309dd2))['catch'](handleError(_0x3a61f5,null));};exports['show']=function(_0x5dd46f,_0x511e0c){var _0x2d738e={'raw':!![],'where':{'id':_0x5dd46f[_0x8a5e('0x42')]['id']}},_0x372716={};_0x372716[_0x8a5e('0x34')]=_[_0x8a5e('0x43')](db[_0x8a5e('0x29')][_0x8a5e('0x2a')]);_0x372716[_0x8a5e('0x2e')]=_['keys'](_0x5dd46f[_0x8a5e('0x2e')]);_0x372716[_0x8a5e('0x2f')]=_[_0x8a5e('0x31')](_0x372716[_0x8a5e('0x34')],_0x372716[_0x8a5e('0x2e')]);_0x2d738e[_0x8a5e('0x30')]=_[_0x8a5e('0x31')](_0x372716[_0x8a5e('0x34')],qs[_0x8a5e('0x32')](_0x5dd46f[_0x8a5e('0x2e')][_0x8a5e('0x32')]));_0x2d738e[_0x8a5e('0x30')]=_0x2d738e['attributes']['length']?_0x2d738e[_0x8a5e('0x30')]:_0x372716[_0x8a5e('0x34')];if(_0x5dd46f[_0x8a5e('0x2e')][_0x8a5e('0x3e')]){_0x2d738e[_0x8a5e('0x3f')]=[{'all':!![]}];}_0x2d738e=_[_0x8a5e('0x3c')]({},_0x2d738e,_0x5dd46f[_0x8a5e('0x44')]);return db[_0x8a5e('0x29')][_0x8a5e('0x45')](_0x2d738e)['then'](handleEntityNotFound(_0x511e0c,null))[_0x8a5e('0x23')](respondWithResult(_0x511e0c,null))[_0x8a5e('0x46')](handleError(_0x511e0c,null));};exports[_0x8a5e('0x47')]=function(_0x203ab8,_0xebfc23){return db['MailSubstatus']['create'](_0x203ab8[_0x8a5e('0x48')],{})[_0x8a5e('0x23')](respondWithResult(_0xebfc23,0xc9))[_0x8a5e('0x46')](handleError(_0xebfc23,null));};exports[_0x8a5e('0x21')]=function(_0x53e453,_0x435b16){if(_0x53e453[_0x8a5e('0x48')]['id']){delete _0x53e453[_0x8a5e('0x48')]['id'];}return db[_0x8a5e('0x29')]['find']({'where':{'id':_0x53e453[_0x8a5e('0x42')]['id']}})[_0x8a5e('0x23')](handleEntityNotFound(_0x435b16,null))[_0x8a5e('0x23')](saveUpdates(_0x53e453[_0x8a5e('0x48')],null))['then'](respondWithResult(_0x435b16,null))[_0x8a5e('0x46')](handleError(_0x435b16,null));};exports[_0x8a5e('0x22')]=function(_0x490458,_0x5452d0){return db[_0x8a5e('0x29')][_0x8a5e('0x45')]({'where':{'id':_0x490458['params']['id']}})['then'](handleEntityNotFound(_0x5452d0,null))[_0x8a5e('0x23')](removeEntity(_0x5452d0,null))['catch'](handleError(_0x5452d0,null));};exports['describe']=function(_0x5dc6f5,_0x3182d0){return db[_0x8a5e('0x29')][_0x8a5e('0x49')]()[_0x8a5e('0x23')](respondWithResult(_0x3182d0,null))['catch'](handleError(_0x3182d0,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 2d88f94..69e8757 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84e9=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x1f3de1,_0x12f354){var _0x22755d=function(_0x758fde){while(--_0x758fde){_0x1f3de1['push'](_0x1f3de1['shift']());}};_0x22755d(++_0x12f354);}(_0x84e9,0x195));var _0x984e=function(_0x47c932,_0x11bc24){_0x47c932=_0x47c932-0x0;var _0x2d5891=_0x84e9[_0x47c932];return _0x2d5891;};'use strict';var EventEmitter=require(_0x984e('0x0'));var MailSubstatus=require(_0x984e('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x984e('0x2')](0x0);var events={'afterUpdate':_0x984e('0x3')};function emitEvent(_0x497e69){return function(_0x107c4f,_0x21363c,_0x4fb8e4){MailSubstatusEvents[_0x984e('0x4')](_0x497e69+':'+_0x107c4f['id'],_0x107c4f);MailSubstatusEvents[_0x984e('0x4')](_0x497e69,_0x107c4f);_0x4fb8e4(null);};}for(var e in events){if(events[_0x984e('0x5')](e)){var event=events[e];MailSubstatus[_0x984e('0x6')](e,emitEvent(event));}}module[_0x984e('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0xc159=['hook','exports','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x1624aa,_0x42656c){var _0x53060b=function(_0x486f5f){while(--_0x486f5f){_0x1624aa['push'](_0x1624aa['shift']());}};_0x53060b(++_0x42656c);}(_0xc159,0x1f2));var _0x9c15=function(_0x1ca4cc,_0x402c23){_0x1ca4cc=_0x1ca4cc-0x0;var _0x108010=_0xc159[_0x1ca4cc];return _0x108010;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x9c15('0x0'))['db'][_0x9c15('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x9c15('0x2')](0x0);var events={'afterUpdate':_0x9c15('0x3')};function emitEvent(_0x1053a8){return function(_0x209add,_0x313b2e,_0x930e66){MailSubstatusEvents[_0x9c15('0x4')](_0x1053a8+':'+_0x209add['id'],_0x209add);MailSubstatusEvents['emit'](_0x1053a8,_0x209add);_0x930e66(null);};}for(var e in events){if(events[_0x9c15('0x5')](e)){var event=events[e];MailSubstatus[_0x9c15('0x6')](e,emitEvent(event));}}module[_0x9c15('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index c177405..bde54d2 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 _0x0ec4=['then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','name','mailSubstatus','_previousDataValues'];(function(_0x39d71d,_0x451a63){var _0x5b4c78=function(_0x366530){while(--_0x366530){_0x39d71d['push'](_0x39d71d['shift']());}};_0x5b4c78(++_0x451a63);}(_0x0ec4,0xe9));var _0x40ec=function(_0x13eed7,_0x50922b){_0x13eed7=_0x13eed7-0x0;var _0x1648bd=_0x0ec4[_0x13eed7];return _0x1648bd;};'use strict';var attributes=require(_0x40ec('0x0'));module[_0x40ec('0x1')]=function(_0x3a9ceb){var _0x3b4571=_0x3a9ceb[_0x40ec('0x2')];return _0x3a9ceb[_0x40ec('0x3')](_0x40ec('0x4'),attributes,{'tableName':_0x40ec('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1f3c04,_0x1317c2,_0x40ab02){return _0x3b4571['Condition']['update']({'value':_0x1f3c04[_0x40ec('0x6')]},{'where':{'field':_0x40ec('0x7'),'value':_0x1f3c04[_0x40ec('0x8')][_0x40ec('0x6')]}})[_0x40ec('0x9')](function(){_0x40ab02();})[_0x40ec('0xa')](function(_0x1caa15){_0x40ab02(_0x1caa15);});}}});}; \ No newline at end of file +var _0xd9e3=['name','then','catch','MailSubstatus','Condition','update','mailSubstatus','_previousDataValues'];(function(_0x1c2203,_0x2a3d6b){var _0x5897d9=function(_0x2c18de){while(--_0x2c18de){_0x1c2203['push'](_0x1c2203['shift']());}};_0x5897d9(++_0x2a3d6b);}(_0xd9e3,0x7b));var _0x3d9e=function(_0x178758,_0x444653){_0x178758=_0x178758-0x0;var _0x546246=_0xd9e3[_0x178758];return _0x546246;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x38a396){var _0x662b26=_0x38a396['models'];return _0x38a396['define'](_0x3d9e('0x0'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x33f2a6,_0x402d57,_0x11d47d){return _0x662b26[_0x3d9e('0x1')][_0x3d9e('0x2')]({'value':_0x33f2a6['name']},{'where':{'field':_0x3d9e('0x3'),'value':_0x33f2a6[_0x3d9e('0x4')][_0x3d9e('0x5')]}})[_0x3d9e('0x6')](function(){_0x11d47d();})[_0x3d9e('0x7')](function(_0x4ba081){_0x11d47d(_0x4ba081);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 1671fc2..518cbe5 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 _0x737e=['../../config/utils','../../config/logger','rpc','client','request','then','info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis'];(function(_0x12617a,_0x44bcd3){var _0x4c0537=function(_0xcbdbac){while(--_0xcbdbac){_0x12617a['push'](_0x12617a['shift']());}};_0x4c0537(++_0x44bcd3);}(_0x737e,0xb9));var _0xe737=function(_0x347141,_0x1c0a86){_0x347141=_0x347141-0x0;var _0xde8647=_0x737e[_0x347141];return _0xde8647;};'use strict';var _=require('lodash');var util=require(_0xe737('0x0'));var moment=require(_0xe737('0x1'));var BPromise=require(_0xe737('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe737('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe737('0x4'));var logger=require(_0xe737('0x5'))(_0xe737('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe737('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4919b1,_0x279809,_0xbcd25a){return new BPromise(function(_0x4552f3,_0x1cc8ca){return client[_0xe737('0x8')](_0x4919b1,_0xbcd25a)[_0xe737('0x9')](function(_0x448a70){logger[_0xe737('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x279809,'request\x20sent');logger[_0xe737('0xb')](_0xe737('0xc'),_0x279809,_0xe737('0xd'),JSON[_0xe737('0xe')](_0x448a70));if(_0x448a70[_0xe737('0xf')]){if(_0x448a70[_0xe737('0xf')][_0xe737('0x10')]===0x1f4){logger[_0xe737('0xf')](_0xe737('0x11'),_0x279809,_0x448a70['error'][_0xe737('0x12')]);return _0x1cc8ca(_0x448a70[_0xe737('0xf')][_0xe737('0x12')]);}logger[_0xe737('0xf')](_0xe737('0x11'),_0x279809,_0x448a70[_0xe737('0xf')][_0xe737('0x12')]);return _0x4552f3(_0x448a70[_0xe737('0xf')]['message']);}else{logger[_0xe737('0xa')](_0xe737('0x11'),_0x279809,_0xe737('0xd'));_0x4552f3(_0x448a70[_0xe737('0x13')][_0xe737('0x12')]);}})[_0xe737('0x14')](function(_0x23e84e){logger[_0xe737('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x279809,_0x23e84e);_0x1cc8ca(_0x23e84e);});});} \ No newline at end of file +var _0xe771=['message','request\x20sent','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xe771,0xd3));var _0x1e77=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xe771[_0x243b59];return _0x3e1676;};'use strict';var _=require('lodash');var util=require(_0x1e77('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1e77('0x1'));var fs=require('fs');var Redis=require(_0x1e77('0x2'));var db=require(_0x1e77('0x3'))['db'];var utils=require(_0x1e77('0x4'));var logger=require(_0x1e77('0x5'))(_0x1e77('0x6'));var config=require(_0x1e77('0x7'));var jayson=require(_0x1e77('0x8'));var client=jayson[_0x1e77('0x9')][_0x1e77('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3db86d,_0x3e59a1,_0x535c4d){return new BPromise(function(_0x228957,_0x254933){return client[_0x1e77('0xb')](_0x3db86d,_0x535c4d)[_0x1e77('0xc')](function(_0x56b96a){logger[_0x1e77('0xd')](_0x1e77('0xe'),_0x3e59a1,'request\x20sent');logger[_0x1e77('0xf')](_0x1e77('0x10'),_0x3e59a1,'request\x20sent',JSON['stringify'](_0x56b96a));if(_0x56b96a['error']){if(_0x56b96a['error'][_0x1e77('0x11')]===0x1f4){logger[_0x1e77('0x12')](_0x1e77('0xe'),_0x3e59a1,_0x56b96a['error']['message']);return _0x254933(_0x56b96a[_0x1e77('0x12')][_0x1e77('0x13')]);}logger[_0x1e77('0x12')](_0x1e77('0xe'),_0x3e59a1,_0x56b96a[_0x1e77('0x12')][_0x1e77('0x13')]);return _0x228957(_0x56b96a[_0x1e77('0x12')][_0x1e77('0x13')]);}else{logger[_0x1e77('0xd')](_0x1e77('0xe'),_0x3e59a1,_0x1e77('0x14'));_0x228957(_0x56b96a[_0x1e77('0x15')][_0x1e77('0x13')]);}})[_0x1e77('0x16')](function(_0x334b24){logger[_0x1e77('0x12')](_0x1e77('0xe'),_0x3e59a1,_0x334b24);_0x254933(_0x334b24);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index e7a10db..80a5258 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 _0x713b=['../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','get','/describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3f074e,_0x11bf75){var _0x5bb57c=function(_0x5e32b9){while(--_0x5e32b9){_0x3f074e['push'](_0x3f074e['shift']());}};_0x5bb57c(++_0x11bf75);}(_0x713b,0x8d));var _0xb713=function(_0x291aaf,_0x4c6d8d){_0x291aaf=_0x291aaf-0x0;var _0x5571e6=_0x713b[_0x291aaf];return _0x5571e6;};'use strict';var multer=require('multer');var util=require(_0xb713('0x0'));var path=require(_0xb713('0x1'));var timeout=require(_0xb713('0x2'));var express=require(_0xb713('0x3'));var router=express[_0xb713('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb713('0x5'));var interaction=require(_0xb713('0x6'));var config=require(_0xb713('0x7'));var controller=require(_0xb713('0x8'));router['get']('/',auth[_0xb713('0x9')](),controller['index']);router[_0xb713('0xa')](_0xb713('0xb'),auth[_0xb713('0x9')](),controller['describe']);router[_0xb713('0xa')](_0xb713('0xc'),auth[_0xb713('0x9')](),controller[_0xb713('0xd')]);router[_0xb713('0xe')]('/',auth[_0xb713('0x9')](),controller[_0xb713('0xf')]);router[_0xb713('0x10')](_0xb713('0xc'),auth[_0xb713('0x9')](),controller[_0xb713('0x11')]);router[_0xb713('0x12')](_0xb713('0xc'),auth['isAuthenticated'](),controller[_0xb713('0x13')]);module[_0xb713('0x14')]=router; \ No newline at end of file +var _0x05e6=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','put','update','delete'];(function(_0x5bc520,_0x3e23c5){var _0x3ce455=function(_0x366ffc){while(--_0x366ffc){_0x5bc520['push'](_0x5bc520['shift']());}};_0x3ce455(++_0x3e23c5);}(_0x05e6,0x7a));var _0x605e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x05e6[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x605e('0x0'));var util=require(_0x605e('0x1'));var path=require('path');var timeout=require(_0x605e('0x2'));var express=require(_0x605e('0x3'));var router=express[_0x605e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x605e('0x5'));var config=require(_0x605e('0x6'));var controller=require(_0x605e('0x7'));router[_0x605e('0x8')]('/',auth['isAuthenticated'](),controller[_0x605e('0x9')]);router[_0x605e('0x8')](_0x605e('0xa'),auth[_0x605e('0xb')](),controller['describe']);router[_0x605e('0x8')](_0x605e('0xc'),auth[_0x605e('0xb')](),controller[_0x605e('0xd')]);router[_0x605e('0xe')]('/',auth[_0x605e('0xb')](),controller['create']);router[_0x605e('0xf')](_0x605e('0xc'),auth[_0x605e('0xb')](),controller[_0x605e('0x10')]);router[_0x605e('0x11')]('/:id',auth[_0x605e('0xb')](),controller[_0x605e('0x12')]);module[_0x605e('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 91e461a..68ad94b 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(_0x2aff95,_0x35ba3d){var _0x255769=function(_0x58c4f6){while(--_0x58c4f6){_0x2aff95['push'](_0x2aff95['shift']());}};_0x255769(++_0x35ba3d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0xcb91[_0x34d275];return _0x1379cc;};'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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x1dc927,_0x4517ca){var _0x3433fb=function(_0x3768c6){while(--_0x3768c6){_0x1dc927['push'](_0x1dc927['shift']());}};_0x3433fb(++_0x4517ca);}(_0xedd9,0xfc));var _0x9edd=function(_0x4b3c60,_0x116784){_0x4b3c60=_0x4b3c60-0x0;var _0x2b7eda=_0xedd9[_0x4b3c60];return _0x2b7eda;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 7389357..3f6d4ca 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 _0xffcc=['type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','include','create','body','catch','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','MailTransferReport','rawAttributes','fieldName'];(function(_0x2b9c5b,_0x58ce75){var _0x360ede=function(_0x5b0196){while(--_0x5b0196){_0x2b9c5b['push'](_0x2b9c5b['shift']());}};_0x360ede(++_0x58ce75);}(_0xffcc,0x10b));var _0xcffc=function(_0x457343,_0x2d96f1){_0x457343=_0x457343-0x0;var _0x3feddb=_0xffcc[_0x457343];return _0x3feddb;};'use strict';var emlformat=require(_0xcffc('0x0'));var rimraf=require(_0xcffc('0x1'));var zipdir=require(_0xcffc('0x2'));var jsonpatch=require(_0xcffc('0x3'));var rp=require('request-promise');var moment=require(_0xcffc('0x4'));var BPromise=require(_0xcffc('0x5'));var Mustache=require(_0xcffc('0x6'));var util=require(_0xcffc('0x7'));var path=require(_0xcffc('0x8'));var sox=require(_0xcffc('0x9'));var csv=require(_0xcffc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcffc('0xb'));var _=require(_0xcffc('0xc'));var squel=require('squel');var crypto=require(_0xcffc('0xd'));var jsforce=require(_0xcffc('0xe'));var deskjs=require(_0xcffc('0xf'));var toCsv=require(_0xcffc('0xa'));var querystring=require(_0xcffc('0x10'));var Papa=require('papaparse');var Redis=require(_0xcffc('0x11'));var authService=require(_0xcffc('0x12'));var qs=require(_0xcffc('0x13'));var as=require(_0xcffc('0x14'));var hardwareService=require(_0xcffc('0x15'));var logger=require(_0xcffc('0x16'))(_0xcffc('0x17'));var utils=require(_0xcffc('0x18'));var config=require(_0xcffc('0x19'));var licenseUtil=require(_0xcffc('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cd7cd,_0x1bd9b4){_0x1bd9b4=_0x1bd9b4||0xcc;return function(_0xb9e969){if(_0xb9e969){return _0x5cd7cd[_0xcffc('0x1b')](_0x1bd9b4);}return _0x5cd7cd[_0xcffc('0x1c')](_0x1bd9b4)[_0xcffc('0x1d')]();};}function respondWithResult(_0x35310f,_0x434217){_0x434217=_0x434217||0xc8;return function(_0xac378){if(_0xac378){return _0x35310f['status'](_0x434217)[_0xcffc('0x1e')](_0xac378);}};}function respondWithFilteredResult(_0x1cc458,_0x1bda75){return function(_0x3ce92e){if(_0x3ce92e){var _0x5bce92=typeof _0x1bda75['offset']===_0xcffc('0x1f')&&typeof _0x1bda75[_0xcffc('0x20')]===_0xcffc('0x1f');var _0x23dc5b=_0x3ce92e[_0xcffc('0x21')];var _0x1082ed=_0x5bce92?0x0:_0x1bda75[_0xcffc('0x22')];var _0x55dedb=_0x5bce92?_0x3ce92e[_0xcffc('0x21')]:_0x1bda75[_0xcffc('0x22')]+_0x1bda75[_0xcffc('0x20')];var _0x216c5a;if(_0x55dedb>=_0x23dc5b){_0x55dedb=_0x23dc5b;_0x216c5a=0xc8;}else{_0x216c5a=0xce;}_0x1cc458['status'](_0x216c5a);return _0x1cc458['set'](_0xcffc('0x23'),_0x1082ed+'-'+_0x55dedb+'/'+_0x23dc5b)[_0xcffc('0x1e')](_0x3ce92e);}return null;};}function patchUpdates(_0x9da3f0){return function(_0x1606d6){try{jsonpatch[_0xcffc('0x24')](_0x1606d6,_0x9da3f0,!![]);}catch(_0x507032){return BPromise[_0xcffc('0x25')](_0x507032);}return _0x1606d6[_0xcffc('0x26')]();};}function saveUpdates(_0x18583,_0x1c8dfe){return function(_0x4841a5){if(_0x4841a5){return _0x4841a5[_0xcffc('0x27')](_0x18583)[_0xcffc('0x28')](function(_0x552c09){return _0x552c09;});}return null;};}function removeEntity(_0x2778db,_0x45688f){return function(_0x88410a){if(_0x88410a){return _0x88410a['destroy']()[_0xcffc('0x28')](function(){_0x2778db[_0xcffc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17308f,_0x856e2a){return function(_0x2751a5){if(!_0x2751a5){_0x17308f[_0xcffc('0x1b')](0x194);}return _0x2751a5;};}function handleError(_0x398045,_0x2590d7){_0x2590d7=_0x2590d7||0x1f4;return function(_0xfdc73a){logger[_0xcffc('0x29')](_0xfdc73a[_0xcffc('0x2a')]);if(_0xfdc73a[_0xcffc('0x2b')]){delete _0xfdc73a[_0xcffc('0x2b')];}_0x398045['status'](_0x2590d7)['send'](_0xfdc73a);};}exports[_0xcffc('0x2c')]=function(_0x1c77a3,_0x249d39){var _0x269c83={},_0x56844e={},_0x4b2189={'count':0x0,'rows':[]};var _0xda87ca=_[_0xcffc('0x2d')](db[_0xcffc('0x2e')][_0xcffc('0x2f')],function(_0x5cc647){return{'name':_0x5cc647[_0xcffc('0x30')],'type':_0x5cc647[_0xcffc('0x31')]['key']};});_0x56844e[_0xcffc('0x32')]=_['map'](_0xda87ca,_0xcffc('0x2b'));_0x56844e[_0xcffc('0x33')]=_[_0xcffc('0x34')](_0x1c77a3['query']);_0x56844e[_0xcffc('0x35')]=_[_0xcffc('0x36')](_0x56844e[_0xcffc('0x32')],_0x56844e[_0xcffc('0x33')]);_0x269c83[_0xcffc('0x37')]=_[_0xcffc('0x36')](_0x56844e[_0xcffc('0x32')],qs[_0xcffc('0x38')](_0x1c77a3['query'][_0xcffc('0x38')]));_0x269c83['attributes']=_0x269c83[_0xcffc('0x37')][_0xcffc('0x39')]?_0x269c83[_0xcffc('0x37')]:_0x56844e[_0xcffc('0x32')];if(!_0x1c77a3[_0xcffc('0x33')][_0xcffc('0x3a')]('nolimit')){_0x269c83[_0xcffc('0x20')]=qs['limit'](_0x1c77a3['query']['limit']);_0x269c83[_0xcffc('0x22')]=qs[_0xcffc('0x22')](_0x1c77a3['query'][_0xcffc('0x22')]);}_0x269c83[_0xcffc('0x3b')]=qs[_0xcffc('0x3c')](_0x1c77a3[_0xcffc('0x33')][_0xcffc('0x3c')]);_0x269c83[_0xcffc('0x3d')]=qs[_0xcffc('0x35')](_[_0xcffc('0x3e')](_0x1c77a3[_0xcffc('0x33')],_0x56844e[_0xcffc('0x35')]),_0xda87ca);if(_0x1c77a3[_0xcffc('0x33')]['filter']){_0x269c83[_0xcffc('0x3d')]=_['merge'](_0x269c83[_0xcffc('0x3d')],{'$or':_[_0xcffc('0x2d')](_0xda87ca,function(_0x4aa0be){if(_0x4aa0be[_0xcffc('0x31')]!==_0xcffc('0x3f')){var _0x37073e={};_0x37073e[_0x4aa0be['name']]={'$like':'%'+_0x1c77a3['query'][_0xcffc('0x40')]+'%'};return _0x37073e;}})});}_0x269c83=_[_0xcffc('0x41')]({},_0x269c83,_0x1c77a3[_0xcffc('0x42')]);var _0x45efba={'where':_0x269c83[_0xcffc('0x3d')]};return db[_0xcffc('0x2e')]['count'](_0x45efba)['then'](function(_0x375ae1){_0x4b2189[_0xcffc('0x21')]=_0x375ae1;if(_0x1c77a3['query'][_0xcffc('0x43')]){_0x269c83['include']=[{'all':!![]}];}return db[_0xcffc('0x2e')][_0xcffc('0x44')](_0x269c83);})[_0xcffc('0x28')](function(_0x4b2bea){_0x4b2189[_0xcffc('0x45')]=_0x4b2bea;return _0x4b2189;})['then'](respondWithFilteredResult(_0x249d39,_0x269c83))['catch'](handleError(_0x249d39,null));};exports[_0xcffc('0x46')]=function(_0x48f356,_0x206192){var _0x397689={'raw':!![],'where':{'id':_0x48f356[_0xcffc('0x47')]['id']}},_0x1b4822={};_0x1b4822[_0xcffc('0x32')]=_[_0xcffc('0x34')](db[_0xcffc('0x2e')]['rawAttributes']);_0x1b4822[_0xcffc('0x33')]=_['keys'](_0x48f356[_0xcffc('0x33')]);_0x1b4822[_0xcffc('0x35')]=_[_0xcffc('0x36')](_0x1b4822[_0xcffc('0x32')],_0x1b4822[_0xcffc('0x33')]);_0x397689[_0xcffc('0x37')]=_[_0xcffc('0x36')](_0x1b4822[_0xcffc('0x32')],qs[_0xcffc('0x38')](_0x48f356[_0xcffc('0x33')]['fields']));_0x397689[_0xcffc('0x37')]=_0x397689['attributes'][_0xcffc('0x39')]?_0x397689[_0xcffc('0x37')]:_0x1b4822[_0xcffc('0x32')];if(_0x48f356[_0xcffc('0x33')][_0xcffc('0x43')]){_0x397689[_0xcffc('0x48')]=[{'all':!![]}];}_0x397689=_['merge']({},_0x397689,_0x48f356[_0xcffc('0x42')]);return db['MailTransferReport']['find'](_0x397689)[_0xcffc('0x28')](handleEntityNotFound(_0x206192,null))[_0xcffc('0x28')](respondWithResult(_0x206192,null))['catch'](handleError(_0x206192,null));};exports[_0xcffc('0x49')]=function(_0x2e9071,_0x540076){return db[_0xcffc('0x2e')][_0xcffc('0x49')](_0x2e9071[_0xcffc('0x4a')],{})[_0xcffc('0x28')](respondWithResult(_0x540076,0xc9))[_0xcffc('0x4b')](handleError(_0x540076,null));};exports['update']=function(_0x45d736,_0x2d3503){if(_0x45d736[_0xcffc('0x4a')]['id']){delete _0x45d736[_0xcffc('0x4a')]['id'];}return db[_0xcffc('0x2e')][_0xcffc('0x4c')]({'where':{'id':_0x45d736[_0xcffc('0x47')]['id']}})[_0xcffc('0x28')](handleEntityNotFound(_0x2d3503,null))[_0xcffc('0x28')](saveUpdates(_0x45d736[_0xcffc('0x4a')],null))[_0xcffc('0x28')](respondWithResult(_0x2d3503,null))[_0xcffc('0x4b')](handleError(_0x2d3503,null));};exports[_0xcffc('0x4d')]=function(_0x5a99da,_0x73513e){return db[_0xcffc('0x2e')][_0xcffc('0x4c')]({'where':{'id':_0x5a99da[_0xcffc('0x47')]['id']}})['then'](handleEntityNotFound(_0x73513e,null))[_0xcffc('0x28')](removeEntity(_0x73513e,null))[_0xcffc('0x4b')](handleError(_0x73513e,null));};exports[_0xcffc('0x4e')]=function(_0x46c178,_0x5e7191){return db['MailTransferReport'][_0xcffc('0x4e')]()['then'](respondWithResult(_0x5e7191,null))[_0xcffc('0x4b')](handleError(_0x5e7191,null));}; \ No newline at end of file +var _0x1c63=['includeAll','include','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../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','save','update','then','error','name','status','send','index','map','MailTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','VIRTUAL','merge','options','findAll','catch','show','params','rawAttributes'];(function(_0x2077a3,_0x276483){var _0x29e4ad=function(_0x5e2ffd){while(--_0x5e2ffd){_0x2077a3['push'](_0x2077a3['shift']());}};_0x29e4ad(++_0x276483);}(_0x1c63,0x14b));var _0x31c6=function(_0x2a87fc,_0x30a039){_0x2a87fc=_0x2a87fc-0x0;var _0x32d9f5=_0x1c63[_0x2a87fc];return _0x32d9f5;};'use strict';var emlformat=require(_0x31c6('0x0'));var rimraf=require(_0x31c6('0x1'));var zipdir=require(_0x31c6('0x2'));var jsonpatch=require(_0x31c6('0x3'));var rp=require(_0x31c6('0x4'));var moment=require(_0x31c6('0x5'));var BPromise=require(_0x31c6('0x6'));var Mustache=require(_0x31c6('0x7'));var util=require(_0x31c6('0x8'));var path=require(_0x31c6('0x9'));var sox=require('sox');var csv=require(_0x31c6('0xa'));var ejs=require(_0x31c6('0xb'));var fs=require('fs');var fs_extra=require(_0x31c6('0xc'));var _=require(_0x31c6('0xd'));var squel=require(_0x31c6('0xe'));var crypto=require(_0x31c6('0xf'));var jsforce=require(_0x31c6('0x10'));var deskjs=require(_0x31c6('0x11'));var toCsv=require('to-csv');var querystring=require(_0x31c6('0x12'));var Papa=require(_0x31c6('0x13'));var Redis=require(_0x31c6('0x14'));var authService=require(_0x31c6('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x31c6('0x16'));var hardwareService=require(_0x31c6('0x17'));var logger=require(_0x31c6('0x18'))(_0x31c6('0x19'));var utils=require(_0x31c6('0x1a'));var config=require(_0x31c6('0x1b'));var licenseUtil=require(_0x31c6('0x1c'));var db=require(_0x31c6('0x1d'))['db'];function respondWithStatusCode(_0x3dc712,_0x497a54){_0x497a54=_0x497a54||0xcc;return function(_0x14ee4b){if(_0x14ee4b){return _0x3dc712[_0x31c6('0x1e')](_0x497a54);}return _0x3dc712['status'](_0x497a54)[_0x31c6('0x1f')]();};}function respondWithResult(_0x59bbb1,_0x3d4a1b){_0x3d4a1b=_0x3d4a1b||0xc8;return function(_0x4f9c19){if(_0x4f9c19){return _0x59bbb1['status'](_0x3d4a1b)[_0x31c6('0x20')](_0x4f9c19);}};}function respondWithFilteredResult(_0x366996,_0x5dc809){return function(_0x2c0778){if(_0x2c0778){var _0x397e28=typeof _0x5dc809[_0x31c6('0x21')]===_0x31c6('0x22')&&typeof _0x5dc809['limit']==='undefined';var _0x55bdeb=_0x2c0778[_0x31c6('0x23')];var _0x54e9c1=_0x397e28?0x0:_0x5dc809[_0x31c6('0x21')];var _0x42bce7=_0x397e28?_0x2c0778['count']:_0x5dc809[_0x31c6('0x21')]+_0x5dc809[_0x31c6('0x24')];var _0xde30fa;if(_0x42bce7>=_0x55bdeb){_0x42bce7=_0x55bdeb;_0xde30fa=0xc8;}else{_0xde30fa=0xce;}_0x366996['status'](_0xde30fa);return _0x366996[_0x31c6('0x25')](_0x31c6('0x26'),_0x54e9c1+'-'+_0x42bce7+'/'+_0x55bdeb)['json'](_0x2c0778);}return null;};}function patchUpdates(_0x583bf9){return function(_0x3d9070){try{jsonpatch[_0x31c6('0x27')](_0x3d9070,_0x583bf9,!![]);}catch(_0x86a511){return BPromise['reject'](_0x86a511);}return _0x3d9070[_0x31c6('0x28')]();};}function saveUpdates(_0x247834,_0x228328){return function(_0x171621){if(_0x171621){return _0x171621[_0x31c6('0x29')](_0x247834)[_0x31c6('0x2a')](function(_0x45227d){return _0x45227d;});}return null;};}function removeEntity(_0x38acb4,_0xf1e90b){return function(_0x2a2104){if(_0x2a2104){return _0x2a2104['destroy']()[_0x31c6('0x2a')](function(){_0x38acb4['status'](0xcc)[_0x31c6('0x1f')]();});}};}function handleEntityNotFound(_0x338f8f,_0x24760b){return function(_0xd9bacb){if(!_0xd9bacb){_0x338f8f[_0x31c6('0x1e')](0x194);}return _0xd9bacb;};}function handleError(_0xb17634,_0x462eb2){_0x462eb2=_0x462eb2||0x1f4;return function(_0x2046cd){logger[_0x31c6('0x2b')](_0x2046cd['stack']);if(_0x2046cd[_0x31c6('0x2c')]){delete _0x2046cd[_0x31c6('0x2c')];}_0xb17634[_0x31c6('0x2d')](_0x462eb2)[_0x31c6('0x2e')](_0x2046cd);};}exports[_0x31c6('0x2f')]=function(_0x1e6295,_0xcc7c4a){var _0x28d6ce={},_0xf2ac9a={},_0x2d44cb={'count':0x0,'rows':[]};var _0x147472=_[_0x31c6('0x30')](db[_0x31c6('0x31')]['rawAttributes'],function(_0x43a59d){return{'name':_0x43a59d[_0x31c6('0x32')],'type':_0x43a59d[_0x31c6('0x33')][_0x31c6('0x34')]};});_0xf2ac9a[_0x31c6('0x35')]=_['map'](_0x147472,_0x31c6('0x2c'));_0xf2ac9a[_0x31c6('0x36')]=_[_0x31c6('0x37')](_0x1e6295[_0x31c6('0x36')]);_0xf2ac9a[_0x31c6('0x38')]=_[_0x31c6('0x39')](_0xf2ac9a[_0x31c6('0x35')],_0xf2ac9a[_0x31c6('0x36')]);_0x28d6ce[_0x31c6('0x3a')]=_[_0x31c6('0x39')](_0xf2ac9a['model'],qs[_0x31c6('0x3b')](_0x1e6295[_0x31c6('0x36')][_0x31c6('0x3b')]));_0x28d6ce[_0x31c6('0x3a')]=_0x28d6ce[_0x31c6('0x3a')][_0x31c6('0x3c')]?_0x28d6ce['attributes']:_0xf2ac9a['model'];if(!_0x1e6295['query'][_0x31c6('0x3d')](_0x31c6('0x3e'))){_0x28d6ce[_0x31c6('0x24')]=qs['limit'](_0x1e6295['query'][_0x31c6('0x24')]);_0x28d6ce[_0x31c6('0x21')]=qs['offset'](_0x1e6295[_0x31c6('0x36')][_0x31c6('0x21')]);}_0x28d6ce['order']=qs['sort'](_0x1e6295[_0x31c6('0x36')]['sort']);_0x28d6ce[_0x31c6('0x3f')]=qs[_0x31c6('0x38')](_[_0x31c6('0x40')](_0x1e6295[_0x31c6('0x36')],_0xf2ac9a['filters']),_0x147472);if(_0x1e6295[_0x31c6('0x36')][_0x31c6('0x41')]){_0x28d6ce[_0x31c6('0x3f')]=_['merge'](_0x28d6ce['where'],{'$or':_[_0x31c6('0x30')](_0x147472,function(_0x1757df){if(_0x1757df[_0x31c6('0x33')]!==_0x31c6('0x42')){var _0x373ea2={};_0x373ea2[_0x1757df[_0x31c6('0x2c')]]={'$like':'%'+_0x1e6295['query'][_0x31c6('0x41')]+'%'};return _0x373ea2;}})});}_0x28d6ce=_[_0x31c6('0x43')]({},_0x28d6ce,_0x1e6295[_0x31c6('0x44')]);var _0x1dfb3d={'where':_0x28d6ce[_0x31c6('0x3f')]};return db[_0x31c6('0x31')][_0x31c6('0x23')](_0x1dfb3d)[_0x31c6('0x2a')](function(_0x2576fa){_0x2d44cb[_0x31c6('0x23')]=_0x2576fa;if(_0x1e6295[_0x31c6('0x36')]['includeAll']){_0x28d6ce['include']=[{'all':!![]}];}return db[_0x31c6('0x31')][_0x31c6('0x45')](_0x28d6ce);})['then'](function(_0x4107e6){_0x2d44cb['rows']=_0x4107e6;return _0x2d44cb;})[_0x31c6('0x2a')](respondWithFilteredResult(_0xcc7c4a,_0x28d6ce))[_0x31c6('0x46')](handleError(_0xcc7c4a,null));};exports[_0x31c6('0x47')]=function(_0x1fd436,_0x39a6ac){var _0x2d092d={'raw':!![],'where':{'id':_0x1fd436[_0x31c6('0x48')]['id']}},_0x541bf5={};_0x541bf5['model']=_[_0x31c6('0x37')](db[_0x31c6('0x31')][_0x31c6('0x49')]);_0x541bf5['query']=_[_0x31c6('0x37')](_0x1fd436[_0x31c6('0x36')]);_0x541bf5[_0x31c6('0x38')]=_[_0x31c6('0x39')](_0x541bf5[_0x31c6('0x35')],_0x541bf5['query']);_0x2d092d[_0x31c6('0x3a')]=_[_0x31c6('0x39')](_0x541bf5['model'],qs[_0x31c6('0x3b')](_0x1fd436[_0x31c6('0x36')][_0x31c6('0x3b')]));_0x2d092d[_0x31c6('0x3a')]=_0x2d092d[_0x31c6('0x3a')][_0x31c6('0x3c')]?_0x2d092d['attributes']:_0x541bf5['model'];if(_0x1fd436['query'][_0x31c6('0x4a')]){_0x2d092d[_0x31c6('0x4b')]=[{'all':!![]}];}_0x2d092d=_['merge']({},_0x2d092d,_0x1fd436[_0x31c6('0x44')]);return db[_0x31c6('0x31')]['find'](_0x2d092d)['then'](handleEntityNotFound(_0x39a6ac,null))[_0x31c6('0x2a')](respondWithResult(_0x39a6ac,null))[_0x31c6('0x46')](handleError(_0x39a6ac,null));};exports[_0x31c6('0x4c')]=function(_0x3e061b,_0x1e274f){return db['MailTransferReport']['create'](_0x3e061b['body'],{})[_0x31c6('0x2a')](respondWithResult(_0x1e274f,0xc9))[_0x31c6('0x46')](handleError(_0x1e274f,null));};exports[_0x31c6('0x29')]=function(_0x2bba8f,_0x163989){if(_0x2bba8f[_0x31c6('0x4d')]['id']){delete _0x2bba8f[_0x31c6('0x4d')]['id'];}return db[_0x31c6('0x31')][_0x31c6('0x4e')]({'where':{'id':_0x2bba8f[_0x31c6('0x48')]['id']}})['then'](handleEntityNotFound(_0x163989,null))[_0x31c6('0x2a')](saveUpdates(_0x2bba8f[_0x31c6('0x4d')],null))['then'](respondWithResult(_0x163989,null))[_0x31c6('0x46')](handleError(_0x163989,null));};exports[_0x31c6('0x4f')]=function(_0x3e4e7c,_0x2563b5){return db[_0x31c6('0x31')]['find']({'where':{'id':_0x3e4e7c[_0x31c6('0x48')]['id']}})[_0x31c6('0x2a')](handleEntityNotFound(_0x2563b5,null))[_0x31c6('0x2a')](removeEntity(_0x2563b5,null))[_0x31c6('0x46')](handleError(_0x2563b5,null));};exports[_0x31c6('0x50')]=function(_0x360dfb,_0x700e5f){return db[_0x31c6('0x31')][_0x31c6('0x50')]()[_0x31c6('0x2a')](respondWithResult(_0x700e5f,null))['catch'](handleError(_0x700e5f,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index fd89d90..93db4e5 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 _0xe009=['bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xe009,0x122));var _0x9e00=function(_0x21f352,_0x2b439f){_0x21f352=_0x21f352-0x0;var _0x4a6c82=_0xe009[_0x21f352];return _0x4a6c82;};'use strict';var _=require(_0x9e00('0x0'));var util=require(_0x9e00('0x1'));var logger=require(_0x9e00('0x2'))(_0x9e00('0x3'));var moment=require('moment');var BPromise=require(_0x9e00('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e00('0x5'));var rimraf=require(_0x9e00('0x6'));var config=require(_0x9e00('0x7'));var attributes=require(_0x9e00('0x8'));module[_0x9e00('0x9')]=function(_0x467e35,_0x32b4ee){return _0x467e35[_0x9e00('0xa')](_0x9e00('0xb'),attributes,{'tableName':_0x9e00('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9e00('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3d1=['rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','uniqueid','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x27b9de,_0x15aa43){var _0x2cdfdc=function(_0x58cae0){while(--_0x58cae0){_0x27b9de['push'](_0x27b9de['shift']());}};_0x2cdfdc(++_0x15aa43);}(_0xa3d1,0x126));var _0x1a3d=function(_0x17b287,_0x4bed1c){_0x17b287=_0x17b287-0x0;var _0x177054=_0xa3d1[_0x17b287];return _0x177054;};'use strict';var _=require(_0x1a3d('0x0'));var util=require(_0x1a3d('0x1'));var logger=require(_0x1a3d('0x2'))('api');var moment=require(_0x1a3d('0x3'));var BPromise=require('bluebird');var rp=require(_0x1a3d('0x4'));var fs=require('fs');var path=require(_0x1a3d('0x5'));var rimraf=require(_0x1a3d('0x6'));var config=require(_0x1a3d('0x7'));var attributes=require(_0x1a3d('0x8'));module[_0x1a3d('0x9')]=function(_0x3a4a57,_0x144a93){return _0x3a4a57['define'](_0x1a3d('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x1a3d('0xb'),'fields':[_0x1a3d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index f6924b3..7f530f9 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 _0x794e=['request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s'];(function(_0x357305,_0x110e9f){var _0x25a84e=function(_0x5974f8){while(--_0x5974f8){_0x357305['push'](_0x357305['shift']());}};_0x25a84e(++_0x110e9f);}(_0x794e,0x1d4));var _0xe794=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x794e[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0xe794('0x0'));var util=require('util');var moment=require(_0xe794('0x1'));var BPromise=require(_0xe794('0x2'));var rs=require(_0xe794('0x3'));var fs=require('fs');var Redis=require(_0xe794('0x4'));var db=require(_0xe794('0x5'))['db'];var utils=require(_0xe794('0x6'));var logger=require('../../config/logger')(_0xe794('0x7'));var config=require(_0xe794('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe794('0x9')][_0xe794('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e725d,_0x3a2ba5,_0x1523de){return new BPromise(function(_0x523ef5,_0x57d0fa){return client[_0xe794('0xb')](_0x4e725d,_0x1523de)[_0xe794('0xc')](function(_0x2722ff){logger[_0xe794('0xd')](_0xe794('0xe'),_0x3a2ba5,_0xe794('0xf'));logger[_0xe794('0x10')](_0xe794('0x11'),_0x3a2ba5,'request\x20sent',JSON[_0xe794('0x12')](_0x2722ff));if(_0x2722ff[_0xe794('0x13')]){if(_0x2722ff[_0xe794('0x13')][_0xe794('0x14')]===0x1f4){logger[_0xe794('0x13')](_0xe794('0xe'),_0x3a2ba5,_0x2722ff[_0xe794('0x13')]['message']);return _0x57d0fa(_0x2722ff[_0xe794('0x13')][_0xe794('0x15')]);}logger[_0xe794('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x3a2ba5,_0x2722ff[_0xe794('0x13')][_0xe794('0x15')]);return _0x523ef5(_0x2722ff[_0xe794('0x13')][_0xe794('0x15')]);}else{logger[_0xe794('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x3a2ba5,_0xe794('0xf'));_0x523ef5(_0x2722ff[_0xe794('0x16')][_0xe794('0x15')]);}})['catch'](function(_0x45aeec){logger[_0xe794('0x13')](_0xe794('0xe'),_0x3a2ba5,_0x45aeec);_0x57d0fa(_0x45aeec);});});} \ No newline at end of file +var _0x4c21=['client','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x112fcf,_0x32d733){var _0x439cdc=function(_0x2c67ce){while(--_0x2c67ce){_0x112fcf['push'](_0x112fcf['shift']());}};_0x439cdc(++_0x32d733);}(_0x4c21,0x197));var _0x14c2=function(_0x3a3c17,_0x5b7b7e){_0x3a3c17=_0x3a3c17-0x0;var _0xd07f21=_0x4c21[_0x3a3c17];return _0xd07f21;};'use strict';var _=require(_0x14c2('0x0'));var util=require(_0x14c2('0x1'));var moment=require(_0x14c2('0x2'));var BPromise=require(_0x14c2('0x3'));var rs=require(_0x14c2('0x4'));var fs=require('fs');var Redis=require(_0x14c2('0x5'));var db=require(_0x14c2('0x6'))['db'];var utils=require(_0x14c2('0x7'));var logger=require('../../config/logger')(_0x14c2('0x8'));var config=require(_0x14c2('0x9'));var jayson=require(_0x14c2('0xa'));var client=jayson[_0x14c2('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d1a54,_0x703f3c,_0x454e82){return new BPromise(function(_0x4325d4,_0x3ddf02){return client['request'](_0x5d1a54,_0x454e82)[_0x14c2('0xc')](function(_0x2c08fe){logger[_0x14c2('0xd')](_0x14c2('0xe'),_0x703f3c,_0x14c2('0xf'));logger[_0x14c2('0x10')](_0x14c2('0x11'),_0x703f3c,'request\x20sent',JSON[_0x14c2('0x12')](_0x2c08fe));if(_0x2c08fe[_0x14c2('0x13')]){if(_0x2c08fe[_0x14c2('0x13')]['code']===0x1f4){logger[_0x14c2('0x13')](_0x14c2('0xe'),_0x703f3c,_0x2c08fe['error'][_0x14c2('0x14')]);return _0x3ddf02(_0x2c08fe[_0x14c2('0x13')][_0x14c2('0x14')]);}logger[_0x14c2('0x13')](_0x14c2('0xe'),_0x703f3c,_0x2c08fe[_0x14c2('0x13')][_0x14c2('0x14')]);return _0x4325d4(_0x2c08fe['error'][_0x14c2('0x14')]);}else{logger['info'](_0x14c2('0xe'),_0x703f3c,_0x14c2('0xf'));_0x4325d4(_0x2c08fe[_0x14c2('0x15')][_0x14c2('0x14')]);}})['catch'](function(_0x4242a1){logger[_0x14c2('0x13')](_0x14c2('0xe'),_0x703f3c,_0x4242a1);_0x3ddf02(_0x4242a1);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 1a6624d..1773e76 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 _0x1b2a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x25ef3f,_0x1ab9f8){var _0x7f056e=function(_0xd9a16f){while(--_0xd9a16f){_0x25ef3f['push'](_0x25ef3f['shift']());}};_0x7f056e(++_0x1ab9f8);}(_0x1b2a,0x184));var _0xa1b2=function(_0xce5b5f,_0x512bdb){_0xce5b5f=_0xce5b5f-0x0;var _0x41669c=_0x1b2a[_0xce5b5f];return _0x41669c;};'use strict';var multer=require(_0xa1b2('0x0'));var util=require(_0xa1b2('0x1'));var path=require(_0xa1b2('0x2'));var timeout=require(_0xa1b2('0x3'));var express=require(_0xa1b2('0x4'));var router=express[_0xa1b2('0x5')]();var fs_extra=require(_0xa1b2('0x6'));var auth=require(_0xa1b2('0x7'));var interaction=require(_0xa1b2('0x8'));var config=require(_0xa1b2('0x9'));var controller=require(_0xa1b2('0xa'));router[_0xa1b2('0xb')]('/',auth['isAuthenticated'](),controller[_0xa1b2('0xc')]);router[_0xa1b2('0xb')]('/describe',auth[_0xa1b2('0xd')](),controller[_0xa1b2('0xe')]);router[_0xa1b2('0xb')](_0xa1b2('0xf'),auth[_0xa1b2('0xd')](),controller[_0xa1b2('0x10')]);router['post']('/',auth[_0xa1b2('0xd')](),controller[_0xa1b2('0x11')]);router[_0xa1b2('0x12')](_0xa1b2('0xf'),auth[_0xa1b2('0xd')](),controller[_0xa1b2('0x13')]);router[_0xa1b2('0x14')]('/:id',auth[_0xa1b2('0xd')](),controller[_0xa1b2('0x15')]);module[_0xa1b2('0x16')]=router; \ No newline at end of file +var _0xb53b=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','isAuthenticated','get','show','post','create','put','/:id','delete'];(function(_0x3879c9,_0x43881c){var _0x11a8bd=function(_0x22f07a){while(--_0x22f07a){_0x3879c9['push'](_0x3879c9['shift']());}};_0x11a8bd(++_0x43881c);}(_0xb53b,0x1ef));var _0xbb53=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0xb53b[_0x56f7e2];return _0x36240b;};'use strict';var multer=require(_0xbb53('0x0'));var util=require(_0xbb53('0x1'));var path=require(_0xbb53('0x2'));var timeout=require(_0xbb53('0x3'));var express=require(_0xbb53('0x4'));var router=express[_0xbb53('0x5')]();var fs_extra=require(_0xbb53('0x6'));var auth=require(_0xbb53('0x7'));var interaction=require(_0xbb53('0x8'));var config=require('../../config/environment');var controller=require(_0xbb53('0x9'));router['get']('/',auth[_0xbb53('0xa')](),controller['index']);router[_0xbb53('0xb')]('/describe',auth[_0xbb53('0xa')](),controller['describe']);router['get']('/:id',auth[_0xbb53('0xa')](),controller[_0xbb53('0xc')]);router[_0xbb53('0xd')]('/',auth[_0xbb53('0xa')](),controller[_0xbb53('0xe')]);router[_0xbb53('0xf')](_0xbb53('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xbb53('0x11')](_0xbb53('0x10'),auth[_0xbb53('0xa')](),controller['destroy']);module[_0xbb53('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index d9b8ec1..ce3b1f9 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 _0xdc65=['DEFAULT\x20PAUSE','DATE','getDataValue','enterAt','diff','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','exports','STRING'];(function(_0x6f4107,_0x3ce68d){var _0x17dfd2=function(_0x169ac2){while(--_0x169ac2){_0x6f4107['push'](_0x6f4107['shift']());}};_0x17dfd2(++_0x3ce68d);}(_0xdc65,0x15c));var _0x5dc6=function(_0x34d7ce,_0x51951a){_0x34d7ce=_0x34d7ce-0x0;var _0x56acc8=_0xdc65[_0x34d7ce];return _0x56acc8;};'use strict';var Sequelize=require(_0x5dc6('0x0'));var moment=require(_0x5dc6('0x1'));module[_0x5dc6('0x2')]={'channel':{'type':Sequelize[_0x5dc6('0x3')]},'membername':{'type':Sequelize[_0x5dc6('0x3')]},'interface':{'type':Sequelize[_0x5dc6('0x3')]},'type':{'type':Sequelize[_0x5dc6('0x3')],'defaultValue':_0x5dc6('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x5dc6('0x5')],'set':function(_0x145f87){var _0x22ae78=moment(_0x145f87);var _0x5c4575=moment(this[_0x5dc6('0x6')](_0x5dc6('0x7')));var _0x4101b6=_0x22ae78[_0x5dc6('0x8')](_0x5c4575,'seconds');this['setDataValue'](_0x5dc6('0x9'),_0x145f87);this[_0x5dc6('0xa')](_0x5dc6('0xb'),_0x4101b6>=0x0?_0x4101b6:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x5dc6('0xc')},'data2':{'type':Sequelize[_0x5dc6('0x3')],'comment':_0x5dc6('0xd')},'data3':{'type':Sequelize[_0x5dc6('0x3')],'comment':_0x5dc6('0xe')},'data4':{'type':Sequelize[_0x5dc6('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x5dc6('0x3')],'comment':_0x5dc6('0xf')},'role':{'type':Sequelize[_0x5dc6('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x5dc6('0x3')]}}; \ No newline at end of file +var _0x843a=['talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[dial\x20string]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x843a,0x1cf));var _0xa843=function(_0x595c04,_0x1bb921){_0x595c04=_0x595c04-0x0;var _0x9d2450=_0x843a[_0x595c04];return _0x9d2450;};'use strict';var Sequelize=require(_0xa843('0x0'));var moment=require(_0xa843('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xa843('0x2')]},'interface':{'type':Sequelize[_0xa843('0x2')]},'type':{'type':Sequelize[_0xa843('0x2')],'defaultValue':_0xa843('0x3'),'comment':_0xa843('0x4')},'duration':{'type':Sequelize[_0xa843('0x5')]},'enterAt':{'type':Sequelize[_0xa843('0x6')]},'exitAt':{'type':Sequelize[_0xa843('0x6')],'set':function(_0x57f0d2){var _0x9c9844=moment(_0x57f0d2);var _0x1c104f=moment(this['getDataValue']('enterAt'));var _0x53749c=_0x9c9844['diff'](_0x1c104f,_0xa843('0x7'));this['setDataValue'](_0xa843('0x8'),_0x57f0d2);this[_0xa843('0x9')](_0xa843('0xa'),_0x53749c>=0x0?_0x53749c:null);}},'data1':{'type':Sequelize[_0xa843('0x2')],'comment':_0xa843('0xb')},'data2':{'type':Sequelize[_0xa843('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xa843('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xa843('0x2')],'comment':_0xa843('0xc')},'data5':{'type':Sequelize[_0xa843('0x2')],'comment':_0xa843('0xd')},'role':{'type':Sequelize[_0xa843('0x2')]},'internal':{'type':Sequelize[_0xa843('0x5')]},'uniqueid':{'type':Sequelize[_0xa843('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 988a0fa..921d46d 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x5d283b,_0x14d1de){var _0x3a7d42=function(_0x31ace6){while(--_0x31ace6){_0x5d283b['push'](_0x5d283b['shift']());}};_0x3a7d42(++_0x14d1de);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file +var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x18fdaf,_0x457de2){var _0x557a9b=function(_0x4a6b5a){while(--_0x4a6b5a){_0x18fdaf['push'](_0x18fdaf['shift']());}};_0x557a9b(++_0x457de2);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['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 c5747ed..efd2ba7 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 _0x47a1=['exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','api','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x545f54,_0x4209b9){var _0x5c70ad=function(_0x186e96){while(--_0x186e96){_0x545f54['push'](_0x545f54['shift']());}};_0x5c70ad(++_0x4209b9);}(_0x47a1,0xbd));var _0x147a=function(_0x26b31e,_0x36b221){_0x26b31e=_0x26b31e-0x0;var _0x32f9b2=_0x47a1[_0x26b31e];return _0x32f9b2;};'use strict';var _=require(_0x147a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x147a('0x1'));var moment=require('moment');var BPromise=require(_0x147a('0x2'));var rp=require(_0x147a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x147a('0x4'));var config=require(_0x147a('0x5'));var attributes=require(_0x147a('0x6'));module[_0x147a('0x7')]=function(_0x31373d,_0x57e7a2){return _0x31373d[_0x147a('0x8')](_0x147a('0x9'),attributes,{'tableName':_0x147a('0xa'),'paranoid':![],'indexes':[{'name':_0x147a('0xb'),'fields':[_0x147a('0xc'),_0x147a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeac9=['./memberReport.attributes','exports','MemberReport','membername_interface','interface','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x53101f,_0x55547f){var _0x55aed8=function(_0x3bab5b){while(--_0x3bab5b){_0x53101f['push'](_0x53101f['shift']());}};_0x55aed8(++_0x55547f);}(_0xeac9,0xae));var _0x9eac=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xeac9[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0x9eac('0x0'));var util=require(_0x9eac('0x1'));var logger=require(_0x9eac('0x2'))(_0x9eac('0x3'));var moment=require(_0x9eac('0x4'));var BPromise=require(_0x9eac('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9eac('0x6'));var rimraf=require('rimraf');var config=require(_0x9eac('0x7'));var attributes=require(_0x9eac('0x8'));module[_0x9eac('0x9')]=function(_0x55f912,_0x1397bc){return _0x55f912['define'](_0x9eac('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x9eac('0xb'),'fields':['membername',_0x9eac('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 7a23863..d2d81da 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 _0x63f2=['where','attributes','limit','include','map','model','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw'];(function(_0x58d83,_0x556fee){var _0xfdca75=function(_0x36d7ac){while(--_0x36d7ac){_0x58d83['push'](_0x58d83['shift']());}};_0xfdca75(++_0x556fee);}(_0x63f2,0x19b));var _0x263f=function(_0xb021e4,_0x5bc622){_0xb021e4=_0xb021e4-0x0;var _0xfe1dc4=_0x63f2[_0xb021e4];return _0xfe1dc4;};'use strict';var _=require(_0x263f('0x0'));var util=require(_0x263f('0x1'));var moment=require(_0x263f('0x2'));var BPromise=require(_0x263f('0x3'));var rs=require(_0x263f('0x4'));var fs=require('fs');var Redis=require(_0x263f('0x5'));var db=require(_0x263f('0x6'))['db'];var utils=require(_0x263f('0x7'));var logger=require(_0x263f('0x8'))('rpc');var config=require(_0x263f('0x9'));var jayson=require(_0x263f('0xa'));var client=jayson['client'][_0x263f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2efa76,_0x67e2d7,_0x48ddcc){return new BPromise(function(_0x2d8236,_0x2a49a5){return client[_0x263f('0xc')](_0x2efa76,_0x48ddcc)[_0x263f('0xd')](function(_0x20fdcc){logger[_0x263f('0xe')]('MemberReport,\x20%s,\x20%s',_0x67e2d7,_0x263f('0xf'));logger[_0x263f('0x10')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x67e2d7,_0x263f('0xf'),JSON[_0x263f('0x11')](_0x20fdcc));if(_0x20fdcc[_0x263f('0x12')]){if(_0x20fdcc[_0x263f('0x12')][_0x263f('0x13')]===0x1f4){logger[_0x263f('0x12')](_0x263f('0x14'),_0x67e2d7,_0x20fdcc[_0x263f('0x12')][_0x263f('0x15')]);return _0x2a49a5(_0x20fdcc['error'][_0x263f('0x15')]);}logger[_0x263f('0x12')](_0x263f('0x14'),_0x67e2d7,_0x20fdcc[_0x263f('0x12')]['message']);return _0x2d8236(_0x20fdcc['error']['message']);}else{logger[_0x263f('0xe')](_0x263f('0x14'),_0x67e2d7,'request\x20sent');_0x2d8236(_0x20fdcc[_0x263f('0x16')][_0x263f('0x15')]);}})[_0x263f('0x17')](function(_0x2a0ff1){logger['error'](_0x263f('0x14'),_0x67e2d7,_0x2a0ff1);_0x2a49a5(_0x2a0ff1);});});}exports[_0x263f('0x18')]=function(_0x143dcd){var _0x408bf8=this;return new Promise(function(_0x5a68cf,_0x34fea3){return db[_0x263f('0x19')][_0x263f('0x1a')]({'raw':_0x143dcd[_0x263f('0x1b')]?_0x143dcd[_0x263f('0x1b')][_0x263f('0x1c')]===undefined?!![]:![]:!![],'where':_0x143dcd[_0x263f('0x1b')]?_0x143dcd[_0x263f('0x1b')][_0x263f('0x1d')]||null:null,'attributes':_0x143dcd[_0x263f('0x1b')]?_0x143dcd['options'][_0x263f('0x1e')]||null:null,'limit':_0x143dcd[_0x263f('0x1b')]?_0x143dcd[_0x263f('0x1b')][_0x263f('0x1f')]||null:null,'include':_0x143dcd[_0x263f('0x1b')]?_0x143dcd[_0x263f('0x1b')][_0x263f('0x20')]?_[_0x263f('0x21')](_0x143dcd[_0x263f('0x1b')][_0x263f('0x20')],function(_0x57ee4f){return{'model':db[_0x57ee4f[_0x263f('0x22')]],'as':_0x57ee4f['as'],'attributes':_0x57ee4f['attributes'],'include':_0x57ee4f[_0x263f('0x20')]?_['map'](_0x57ee4f['include'],function(_0x501d66){return{'model':db[_0x501d66[_0x263f('0x22')]],'as':_0x501d66['as'],'attributes':_0x501d66['attributes'],'include':_0x501d66['include']?_[_0x263f('0x21')](_0x501d66[_0x263f('0x20')],function(_0x4f912d){return{'model':db[_0x4f912d[_0x263f('0x22')]],'as':_0x4f912d['as'],'attributes':_0x4f912d[_0x263f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x263f('0xd')](function(_0x35e358){logger[_0x263f('0xe')](_0x263f('0x18'),_0x143dcd);logger[_0x263f('0x10')](_0x263f('0x18'),_0x143dcd,JSON['stringify'](_0x35e358));_0x5a68cf(_0x35e358);})[_0x263f('0x17')](function(_0x480baa){logger[_0x263f('0x12')](_0x263f('0x18'),_0x480baa[_0x263f('0x15')],_0x143dcd);_0x34fea3(_0x408bf8[_0x263f('0x12')](0x1f4,_0x480baa['message']));});});};exports[_0x263f('0x23')]=function(_0x1d4404){var _0x25fe4a=this;return new Promise(function(_0x645ddb,_0x1a8f6a){return db[_0x263f('0x19')][_0x263f('0x24')](_0x1d4404[_0x263f('0x25')],{'raw':_0x1d4404['options']?_0x1d4404[_0x263f('0x1b')][_0x263f('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5f3cbc){logger[_0x263f('0xe')](_0x263f('0x23'),_0x1d4404);logger[_0x263f('0x10')](_0x263f('0x23'),_0x1d4404,JSON[_0x263f('0x11')](_0x5f3cbc));_0x645ddb(_0x5f3cbc);})[_0x263f('0x17')](function(_0x416ff7){logger[_0x263f('0x12')](_0x263f('0x23'),_0x416ff7['message'],_0x1d4404);_0x1a8f6a(_0x25fe4a[_0x263f('0x12')](0x1f4,_0x416ff7['message']));});});};exports[_0x263f('0x26')]=function(_0x42e480){var _0x2aac31=this;return new Promise(function(_0x3577d7,_0x20b84a){return db['MemberReport'][_0x263f('0x27')](_0x42e480['body'],{'raw':_0x42e480[_0x263f('0x1b')]?_0x42e480[_0x263f('0x1b')][_0x263f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42e480[_0x263f('0x1b')]?_0x42e480[_0x263f('0x1b')][_0x263f('0x1d')]||null:null,'attributes':_0x42e480[_0x263f('0x1b')]?_0x42e480['options']['attributes']||null:null,'limit':_0x42e480[_0x263f('0x1b')]?_0x42e480['options']['limit']||null:null})[_0x263f('0xd')](function(_0x477d1a){logger[_0x263f('0xe')](_0x263f('0x26'),_0x42e480);logger[_0x263f('0x10')](_0x263f('0x26'),_0x42e480,JSON[_0x263f('0x11')](_0x477d1a));_0x3577d7(_0x477d1a);})[_0x263f('0x17')](function(_0xe77a93){logger[_0x263f('0x12')](_0x263f('0x26'),_0xe77a93[_0x263f('0x15')],_0x42e480);_0x20b84a(_0x2aac31[_0x263f('0x12')](0x1f4,_0xe77a93[_0x263f('0x15')]));});});}; \ No newline at end of file +var _0xb491=['request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MemberReport','findAll','options','raw','where','limit','include','map','model','GetMemberReport','CreateMemberReport','update','attributes','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x59f5a6,_0x22e5fe){var _0x824ffa=function(_0x283d79){while(--_0x283d79){_0x59f5a6['push'](_0x59f5a6['shift']());}};_0x824ffa(++_0x22e5fe);}(_0xb491,0x18c));var _0x1b49=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0xb491[_0x52e363];return _0x3fc2b5;};'use strict';var _=require(_0x1b49('0x0'));var util=require(_0x1b49('0x1'));var moment=require(_0x1b49('0x2'));var BPromise=require(_0x1b49('0x3'));var rs=require(_0x1b49('0x4'));var fs=require('fs');var Redis=require(_0x1b49('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b49('0x6'));var logger=require(_0x1b49('0x7'))('rpc');var config=require(_0x1b49('0x8'));var jayson=require(_0x1b49('0x9'));var client=jayson[_0x1b49('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x212aee,_0x537b53,_0x4636f4){return new BPromise(function(_0x3d5da7,_0x218fac){return client[_0x1b49('0xb')](_0x212aee,_0x4636f4)[_0x1b49('0xc')](function(_0x153ffc){logger[_0x1b49('0xd')](_0x1b49('0xe'),_0x537b53,_0x1b49('0xf'));logger[_0x1b49('0x10')](_0x1b49('0x11'),_0x537b53,_0x1b49('0xf'),JSON[_0x1b49('0x12')](_0x153ffc));if(_0x153ffc[_0x1b49('0x13')]){if(_0x153ffc['error']['code']===0x1f4){logger[_0x1b49('0x13')](_0x1b49('0xe'),_0x537b53,_0x153ffc[_0x1b49('0x13')][_0x1b49('0x14')]);return _0x218fac(_0x153ffc[_0x1b49('0x13')]['message']);}logger[_0x1b49('0x13')]('MemberReport,\x20%s,\x20%s',_0x537b53,_0x153ffc[_0x1b49('0x13')][_0x1b49('0x14')]);return _0x3d5da7(_0x153ffc[_0x1b49('0x13')][_0x1b49('0x14')]);}else{logger['info'](_0x1b49('0xe'),_0x537b53,_0x1b49('0xf'));_0x3d5da7(_0x153ffc[_0x1b49('0x15')][_0x1b49('0x14')]);}})[_0x1b49('0x16')](function(_0x308e8e){logger[_0x1b49('0x13')](_0x1b49('0xe'),_0x537b53,_0x308e8e);_0x218fac(_0x308e8e);});});}exports['GetMemberReport']=function(_0x363678){var _0xe47400=this;return new Promise(function(_0x4b9dcd,_0x34282e){return db[_0x1b49('0x17')][_0x1b49('0x18')]({'raw':_0x363678[_0x1b49('0x19')]?_0x363678[_0x1b49('0x19')][_0x1b49('0x1a')]===undefined?!![]:![]:!![],'where':_0x363678[_0x1b49('0x19')]?_0x363678[_0x1b49('0x19')][_0x1b49('0x1b')]||null:null,'attributes':_0x363678[_0x1b49('0x19')]?_0x363678['options']['attributes']||null:null,'limit':_0x363678[_0x1b49('0x19')]?_0x363678[_0x1b49('0x19')][_0x1b49('0x1c')]||null:null,'include':_0x363678[_0x1b49('0x19')]?_0x363678['options'][_0x1b49('0x1d')]?_[_0x1b49('0x1e')](_0x363678['options'][_0x1b49('0x1d')],function(_0x187295){return{'model':db[_0x187295[_0x1b49('0x1f')]],'as':_0x187295['as'],'attributes':_0x187295['attributes'],'include':_0x187295[_0x1b49('0x1d')]?_[_0x1b49('0x1e')](_0x187295[_0x1b49('0x1d')],function(_0x4ab79e){return{'model':db[_0x4ab79e[_0x1b49('0x1f')]],'as':_0x4ab79e['as'],'attributes':_0x4ab79e['attributes'],'include':_0x4ab79e[_0x1b49('0x1d')]?_['map'](_0x4ab79e[_0x1b49('0x1d')],function(_0x469ab0){return{'model':db[_0x469ab0[_0x1b49('0x1f')]],'as':_0x469ab0['as'],'attributes':_0x469ab0['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b49('0xc')](function(_0x4953be){logger['info']('GetMemberReport',_0x363678);logger[_0x1b49('0x10')]('GetMemberReport',_0x363678,JSON[_0x1b49('0x12')](_0x4953be));_0x4b9dcd(_0x4953be);})[_0x1b49('0x16')](function(_0x512d61){logger[_0x1b49('0x13')](_0x1b49('0x20'),_0x512d61[_0x1b49('0x14')],_0x363678);_0x34282e(_0xe47400[_0x1b49('0x13')](0x1f4,_0x512d61[_0x1b49('0x14')]));});});};exports[_0x1b49('0x21')]=function(_0x2e87dc){var _0x59a859=this;return new Promise(function(_0x42f687,_0xdf5b8f){return db[_0x1b49('0x17')]['create'](_0x2e87dc['body'],{'raw':_0x2e87dc[_0x1b49('0x19')]?_0x2e87dc['options'][_0x1b49('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1d1f72){logger[_0x1b49('0xd')](_0x1b49('0x21'),_0x2e87dc);logger[_0x1b49('0x10')]('CreateMemberReport',_0x2e87dc,JSON[_0x1b49('0x12')](_0x1d1f72));_0x42f687(_0x1d1f72);})[_0x1b49('0x16')](function(_0x1ef383){logger[_0x1b49('0x13')](_0x1b49('0x21'),_0x1ef383[_0x1b49('0x14')],_0x2e87dc);_0xdf5b8f(_0x59a859[_0x1b49('0x13')](0x1f4,_0x1ef383[_0x1b49('0x14')]));});});};exports['UpdateMemberReport']=function(_0x40ca8a){var _0x4c9de5=this;return new Promise(function(_0xfd8a03,_0x35e375){return db[_0x1b49('0x17')][_0x1b49('0x22')](_0x40ca8a['body'],{'raw':_0x40ca8a['options']?_0x40ca8a['options'][_0x1b49('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40ca8a[_0x1b49('0x19')]?_0x40ca8a['options'][_0x1b49('0x1b')]||null:null,'attributes':_0x40ca8a[_0x1b49('0x19')]?_0x40ca8a[_0x1b49('0x19')][_0x1b49('0x23')]||null:null,'limit':_0x40ca8a[_0x1b49('0x19')]?_0x40ca8a['options'][_0x1b49('0x1c')]||null:null})['then'](function(_0x18055d){logger['info'](_0x1b49('0x24'),_0x40ca8a);logger['debug'](_0x1b49('0x24'),_0x40ca8a,JSON['stringify'](_0x18055d));_0xfd8a03(_0x18055d);})[_0x1b49('0x16')](function(_0x3aaafb){logger[_0x1b49('0x13')]('UpdateMemberReport',_0x3aaafb[_0x1b49('0x14')],_0x40ca8a);_0x35e375(_0x4c9de5[_0x1b49('0x13')](0x1f4,_0x3aaafb[_0x1b49('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index b282157..d505740 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 _0x75e9=['connect-timeout','express','fs-extra','../../config/environment','./migration.controller','get','index','exports','multer','util','path'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x75e9,0x152));var _0x975e=function(_0x216134,_0x321cfa){_0x216134=_0x216134-0x0;var _0x4652cb=_0x75e9[_0x216134];return _0x4652cb;};'use strict';var multer=require(_0x975e('0x0'));var util=require(_0x975e('0x1'));var path=require(_0x975e('0x2'));var timeout=require(_0x975e('0x3'));var express=require(_0x975e('0x4'));var router=express['Router']();var fs_extra=require(_0x975e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x975e('0x6'));var controller=require(_0x975e('0x7'));router[_0x975e('0x8')]('/',controller[_0x975e('0x9')]);module[_0x975e('0xa')]=router; \ No newline at end of file +var _0xa48b=['path','Router','../../components/interaction/service','../../config/environment','./migration.controller','index','exports','multer','util'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa48b,0xc4));var _0xba48=function(_0x6981cc,_0xcfed1a){_0x6981cc=_0x6981cc-0x0;var _0xa6eefc=_0xa48b[_0x6981cc];return _0xa6eefc;};'use strict';var multer=require(_0xba48('0x0'));var util=require(_0xba48('0x1'));var path=require(_0xba48('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xba48('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xba48('0x4'));var config=require(_0xba48('0x5'));var controller=require(_0xba48('0x6'));router['get']('/',controller[_0xba48('0x7')]);module[_0xba48('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index c6857f6..1808c70 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 _0x5038=['exports','STRING','version','sequelize'];(function(_0x1d30a3,_0x5f428c){var _0x32bba1=function(_0x5a60cc){while(--_0x5a60cc){_0x1d30a3['push'](_0x1d30a3['shift']());}};_0x32bba1(++_0x5f428c);}(_0x5038,0x15f));var _0x8503=function(_0x1ebb1a,_0x197e31){_0x1ebb1a=_0x1ebb1a-0x0;var _0x158b20=_0x5038[_0x1ebb1a];return _0x158b20;};'use strict';var Sequelize=require(_0x8503('0x0'));module[_0x8503('0x1')]={'version':{'type':Sequelize[_0x8503('0x2')],'unique':_0x8503('0x3')}}; \ No newline at end of file +var _0x94ed=['exports','STRING','version'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x94ed,0x78));var _0xd94e=function(_0x178f27,_0x26e5b0){_0x178f27=_0x178f27-0x0;var _0x1bef17=_0x94ed[_0x178f27];return _0x1bef17;};'use strict';var Sequelize=require('sequelize');module[_0xd94e('0x0')]={'version':{'type':Sequelize[_0xd94e('0x1')],'unique':_0xd94e('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 883061f..540b721 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 _0xe63f=['eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','fields','attributes','length','query','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows'];(function(_0x49bdc4,_0x1e2507){var _0x1f7437=function(_0x25a9f9){while(--_0x25a9f9){_0x49bdc4['push'](_0x49bdc4['shift']());}};_0x1f7437(++_0x1e2507);}(_0xe63f,0x163));var _0xfe63=function(_0x3ea824,_0x440ba6){_0x3ea824=_0x3ea824-0x0;var _0x214c64=_0xe63f[_0x3ea824];return _0x214c64;};'use strict';var emlformat=require(_0xfe63('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe63('0x1'));var jsonpatch=require(_0xfe63('0x2'));var rp=require(_0xfe63('0x3'));var moment=require(_0xfe63('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfe63('0x5'));var util=require(_0xfe63('0x6'));var path=require('path');var sox=require(_0xfe63('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe63('0x8'));var squel=require('squel');var crypto=require(_0xfe63('0x9'));var jsforce=require(_0xfe63('0xa'));var deskjs=require(_0xfe63('0xb'));var toCsv=require(_0xfe63('0xc'));var querystring=require('querystring');var Papa=require(_0xfe63('0xd'));var Redis=require(_0xfe63('0xe'));var authService=require(_0xfe63('0xf'));var qs=require(_0xfe63('0x10'));var as=require(_0xfe63('0x11'));var hardwareService=require(_0xfe63('0x12'));var logger=require(_0xfe63('0x13'))(_0xfe63('0x14'));var utils=require(_0xfe63('0x15'));var config=require(_0xfe63('0x16'));var licenseUtil=require(_0xfe63('0x17'));var db=require(_0xfe63('0x18'))['db'];function respondWithStatusCode(_0x16f0cb,_0x69f6cf){_0x69f6cf=_0x69f6cf||0xcc;return function(_0x2eb36a){if(_0x2eb36a){return _0x16f0cb['sendStatus'](_0x69f6cf);}return _0x16f0cb[_0xfe63('0x19')](_0x69f6cf)[_0xfe63('0x1a')]();};}function respondWithResult(_0x3fbb35,_0xa99411){_0xa99411=_0xa99411||0xc8;return function(_0x87ee19){if(_0x87ee19){return _0x3fbb35[_0xfe63('0x19')](_0xa99411)[_0xfe63('0x1b')](_0x87ee19);}};}function respondWithFilteredResult(_0x4fd7aa,_0x2ffdb9){return function(_0x58e971){if(_0x58e971){var _0x1d2fe6=typeof _0x2ffdb9[_0xfe63('0x1c')]===_0xfe63('0x1d')&&typeof _0x2ffdb9[_0xfe63('0x1e')]===_0xfe63('0x1d');var _0x3f4073=_0x58e971[_0xfe63('0x1f')];var _0x3b2bb9=_0x1d2fe6?0x0:_0x2ffdb9['offset'];var _0x5da5b0=_0x1d2fe6?_0x58e971['count']:_0x2ffdb9[_0xfe63('0x1c')]+_0x2ffdb9[_0xfe63('0x1e')];var _0x21c1ca;if(_0x5da5b0>=_0x3f4073){_0x5da5b0=_0x3f4073;_0x21c1ca=0xc8;}else{_0x21c1ca=0xce;}_0x4fd7aa['status'](_0x21c1ca);return _0x4fd7aa[_0xfe63('0x20')](_0xfe63('0x21'),_0x3b2bb9+'-'+_0x5da5b0+'/'+_0x3f4073)[_0xfe63('0x1b')](_0x58e971);}return null;};}function patchUpdates(_0x4932f2){return function(_0x2ce39f){try{jsonpatch['apply'](_0x2ce39f,_0x4932f2,!![]);}catch(_0x50342e){return BPromise[_0xfe63('0x22')](_0x50342e);}return _0x2ce39f['save']();};}function saveUpdates(_0x505e8d,_0x3298af){return function(_0x5c9f0f){if(_0x5c9f0f){return _0x5c9f0f[_0xfe63('0x23')](_0x505e8d)[_0xfe63('0x24')](function(_0x415c18){return _0x415c18;});}return null;};}function removeEntity(_0x23159e,_0x45b79f){return function(_0x52ef03){if(_0x52ef03){return _0x52ef03[_0xfe63('0x25')]()[_0xfe63('0x24')](function(){_0x23159e[_0xfe63('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d8756,_0x199a2c){return function(_0x2a6d25){if(!_0x2a6d25){_0x2d8756[_0xfe63('0x26')](0x194);}return _0x2a6d25;};}function handleError(_0x26b832,_0x1a78a6){_0x1a78a6=_0x1a78a6||0x1f4;return function(_0x17252a){logger[_0xfe63('0x27')](_0x17252a[_0xfe63('0x28')]);if(_0x17252a[_0xfe63('0x29')]){delete _0x17252a[_0xfe63('0x29')];}_0x26b832[_0xfe63('0x19')](_0x1a78a6)[_0xfe63('0x2a')](_0x17252a);};}exports[_0xfe63('0x2b')]=function(_0x21e784,_0x5b5017){var _0x22b955={},_0x2ad715={},_0x521d99={'count':0x0,'rows':[]};var _0x549a9b=_[_0xfe63('0x2c')](db[_0xfe63('0x2d')][_0xfe63('0x2e')],function(_0x2e6497){return{'name':_0x2e6497[_0xfe63('0x2f')],'type':_0x2e6497[_0xfe63('0x30')][_0xfe63('0x31')]};});_0x2ad715[_0xfe63('0x32')]=_[_0xfe63('0x2c')](_0x549a9b,_0xfe63('0x29'));_0x2ad715['query']=_[_0xfe63('0x33')](_0x21e784['query']);_0x2ad715[_0xfe63('0x34')]=_['intersection'](_0x2ad715[_0xfe63('0x32')],_0x2ad715['query']);_0x22b955['attributes']=_[_0xfe63('0x35')](_0x2ad715[_0xfe63('0x32')],qs[_0xfe63('0x36')](_0x21e784['query'][_0xfe63('0x36')]));_0x22b955['attributes']=_0x22b955[_0xfe63('0x37')][_0xfe63('0x38')]?_0x22b955['attributes']:_0x2ad715[_0xfe63('0x32')];if(!_0x21e784[_0xfe63('0x39')][_0xfe63('0x3a')](_0xfe63('0x3b'))){_0x22b955[_0xfe63('0x1e')]=qs[_0xfe63('0x1e')](_0x21e784[_0xfe63('0x39')][_0xfe63('0x1e')]);_0x22b955['offset']=qs[_0xfe63('0x1c')](_0x21e784[_0xfe63('0x39')][_0xfe63('0x1c')]);}_0x22b955[_0xfe63('0x3c')]=qs[_0xfe63('0x3d')](_0x21e784['query'][_0xfe63('0x3d')]);_0x22b955['where']=qs[_0xfe63('0x34')](_[_0xfe63('0x3e')](_0x21e784['query'],_0x2ad715[_0xfe63('0x34')]),_0x549a9b);if(_0x21e784['query'][_0xfe63('0x3f')]){_0x22b955[_0xfe63('0x40')]=_['merge'](_0x22b955['where'],{'$or':_[_0xfe63('0x2c')](_0x549a9b,function(_0x3cf064){if(_0x3cf064[_0xfe63('0x30')]!==_0xfe63('0x41')){var _0x51e718={};_0x51e718[_0x3cf064[_0xfe63('0x29')]]={'$like':'%'+_0x21e784[_0xfe63('0x39')][_0xfe63('0x3f')]+'%'};return _0x51e718;}})});}_0x22b955=_[_0xfe63('0x42')]({},_0x22b955,_0x21e784[_0xfe63('0x43')]);var _0x507365={'where':_0x22b955[_0xfe63('0x40')]};return db[_0xfe63('0x2d')]['count'](_0x507365)['then'](function(_0x28f404){_0x521d99[_0xfe63('0x1f')]=_0x28f404;if(_0x21e784[_0xfe63('0x39')]['includeAll']){_0x22b955[_0xfe63('0x44')]=[{'all':!![]}];}return db[_0xfe63('0x2d')][_0xfe63('0x45')](_0x22b955);})[_0xfe63('0x24')](function(_0x2fbaf2){_0x521d99[_0xfe63('0x46')]=_0x2fbaf2;return _0x521d99;})['then'](respondWithFilteredResult(_0x5b5017,_0x22b955))['catch'](handleError(_0x5b5017,null));}; \ No newline at end of file +var _0x170e=['then','destroy','error','name','send','index','map','Migration','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update'];(function(_0x1403ba,_0x21ae03){var _0xa9a873=function(_0x44823f){while(--_0x44823f){_0x1403ba['push'](_0x1403ba['shift']());}};_0xa9a873(++_0x21ae03);}(_0x170e,0x123));var _0xe170=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x170e[_0x45d3f0];return _0x314b79;};'use strict';var emlformat=require(_0xe170('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe170('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe170('0x2'));var moment=require(_0xe170('0x3'));var BPromise=require(_0xe170('0x4'));var Mustache=require(_0xe170('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe170('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe170('0x7'));var _=require(_0xe170('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe170('0x9'));var deskjs=require(_0xe170('0xa'));var toCsv=require(_0xe170('0x6'));var querystring=require(_0xe170('0xb'));var Papa=require(_0xe170('0xc'));var Redis=require('ioredis');var authService=require(_0xe170('0xd'));var qs=require(_0xe170('0xe'));var as=require(_0xe170('0xf'));var hardwareService=require(_0xe170('0x10'));var logger=require(_0xe170('0x11'))('api');var utils=require(_0xe170('0x12'));var config=require(_0xe170('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe170('0x14'))['db'];function respondWithStatusCode(_0x335d7c,_0x502c3c){_0x502c3c=_0x502c3c||0xcc;return function(_0x175e2b){if(_0x175e2b){return _0x335d7c[_0xe170('0x15')](_0x502c3c);}return _0x335d7c[_0xe170('0x16')](_0x502c3c)[_0xe170('0x17')]();};}function respondWithResult(_0xe5efe1,_0x51dd1d){_0x51dd1d=_0x51dd1d||0xc8;return function(_0x8676f8){if(_0x8676f8){return _0xe5efe1[_0xe170('0x16')](_0x51dd1d)[_0xe170('0x18')](_0x8676f8);}};}function respondWithFilteredResult(_0x37374a,_0x1aa301){return function(_0x597deb){if(_0x597deb){var _0x411bbf=typeof _0x1aa301['offset']===_0xe170('0x19')&&typeof _0x1aa301['limit']==='undefined';var _0x176879=_0x597deb[_0xe170('0x1a')];var _0x1517c0=_0x411bbf?0x0:_0x1aa301[_0xe170('0x1b')];var _0x2c3f59=_0x411bbf?_0x597deb[_0xe170('0x1a')]:_0x1aa301['offset']+_0x1aa301[_0xe170('0x1c')];var _0x4eda40;if(_0x2c3f59>=_0x176879){_0x2c3f59=_0x176879;_0x4eda40=0xc8;}else{_0x4eda40=0xce;}_0x37374a[_0xe170('0x16')](_0x4eda40);return _0x37374a[_0xe170('0x1d')]('Content-Range',_0x1517c0+'-'+_0x2c3f59+'/'+_0x176879)['json'](_0x597deb);}return null;};}function patchUpdates(_0x30a3d0){return function(_0x1e325a){try{jsonpatch[_0xe170('0x1e')](_0x1e325a,_0x30a3d0,!![]);}catch(_0x278654){return BPromise[_0xe170('0x1f')](_0x278654);}return _0x1e325a[_0xe170('0x20')]();};}function saveUpdates(_0x46a328,_0x4ca36a){return function(_0x19efe4){if(_0x19efe4){return _0x19efe4[_0xe170('0x21')](_0x46a328)[_0xe170('0x22')](function(_0x5bb770){return _0x5bb770;});}return null;};}function removeEntity(_0x298c99,_0x376c09){return function(_0x363ff2){if(_0x363ff2){return _0x363ff2[_0xe170('0x23')]()[_0xe170('0x22')](function(){_0x298c99['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21936d,_0x4bfb94){return function(_0x5c3aad){if(!_0x5c3aad){_0x21936d['sendStatus'](0x194);}return _0x5c3aad;};}function handleError(_0xa6e370,_0x59ac1d){_0x59ac1d=_0x59ac1d||0x1f4;return function(_0x352ec9){logger[_0xe170('0x24')](_0x352ec9['stack']);if(_0x352ec9[_0xe170('0x25')]){delete _0x352ec9[_0xe170('0x25')];}_0xa6e370['status'](_0x59ac1d)[_0xe170('0x26')](_0x352ec9);};}exports[_0xe170('0x27')]=function(_0x18f205,_0x18a33d){var _0x28d3f7={},_0x4411b8={},_0x5bf3d0={'count':0x0,'rows':[]};var _0x49fb03=_[_0xe170('0x28')](db[_0xe170('0x29')][_0xe170('0x2a')],function(_0x5a1891){return{'name':_0x5a1891['fieldName'],'type':_0x5a1891['type'][_0xe170('0x2b')]};});_0x4411b8['model']=_[_0xe170('0x28')](_0x49fb03,'name');_0x4411b8[_0xe170('0x2c')]=_['keys'](_0x18f205[_0xe170('0x2c')]);_0x4411b8[_0xe170('0x2d')]=_[_0xe170('0x2e')](_0x4411b8[_0xe170('0x2f')],_0x4411b8[_0xe170('0x2c')]);_0x28d3f7[_0xe170('0x30')]=_['intersection'](_0x4411b8['model'],qs[_0xe170('0x31')](_0x18f205[_0xe170('0x2c')]['fields']));_0x28d3f7[_0xe170('0x30')]=_0x28d3f7[_0xe170('0x30')][_0xe170('0x32')]?_0x28d3f7[_0xe170('0x30')]:_0x4411b8[_0xe170('0x2f')];if(!_0x18f205[_0xe170('0x2c')]['hasOwnProperty'](_0xe170('0x33'))){_0x28d3f7['limit']=qs[_0xe170('0x1c')](_0x18f205[_0xe170('0x2c')][_0xe170('0x1c')]);_0x28d3f7['offset']=qs['offset'](_0x18f205[_0xe170('0x2c')][_0xe170('0x1b')]);}_0x28d3f7[_0xe170('0x34')]=qs['sort'](_0x18f205[_0xe170('0x2c')][_0xe170('0x35')]);_0x28d3f7[_0xe170('0x36')]=qs[_0xe170('0x2d')](_[_0xe170('0x37')](_0x18f205[_0xe170('0x2c')],_0x4411b8[_0xe170('0x2d')]),_0x49fb03);if(_0x18f205[_0xe170('0x2c')][_0xe170('0x38')]){_0x28d3f7['where']=_['merge'](_0x28d3f7['where'],{'$or':_['map'](_0x49fb03,function(_0x5be3db){if(_0x5be3db[_0xe170('0x39')]!==_0xe170('0x3a')){var _0x581a2c={};_0x581a2c[_0x5be3db['name']]={'$like':'%'+_0x18f205['query']['filter']+'%'};return _0x581a2c;}})});}_0x28d3f7=_[_0xe170('0x3b')]({},_0x28d3f7,_0x18f205[_0xe170('0x3c')]);var _0x4e5f43={'where':_0x28d3f7['where']};return db[_0xe170('0x29')]['count'](_0x4e5f43)[_0xe170('0x22')](function(_0x4eb2c6){_0x5bf3d0['count']=_0x4eb2c6;if(_0x18f205['query'][_0xe170('0x3d')]){_0x28d3f7[_0xe170('0x3e')]=[{'all':!![]}];}return db[_0xe170('0x29')][_0xe170('0x3f')](_0x28d3f7);})[_0xe170('0x22')](function(_0x2e96c9){_0x5bf3d0['rows']=_0x2e96c9;return _0x5bf3d0;})[_0xe170('0x22')](respondWithFilteredResult(_0x18a33d,_0x28d3f7))[_0xe170('0x40')](handleError(_0x18a33d,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 9edef27..b461f96 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 _0x94f9=['path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20bf53,_0x6e1ea7){var _0x51468c=function(_0x59e7a6){while(--_0x59e7a6){_0x20bf53['push'](_0x20bf53['shift']());}};_0x51468c(++_0x6e1ea7);}(_0x94f9,0x116));var _0x994f=function(_0xbb5075,_0x50d7f5){_0xbb5075=_0xbb5075-0x0;var _0x902d8=_0x94f9[_0xbb5075];return _0x902d8;};'use strict';var _=require(_0x994f('0x0'));var util=require(_0x994f('0x1'));var logger=require(_0x994f('0x2'))(_0x994f('0x3'));var moment=require(_0x994f('0x4'));var BPromise=require(_0x994f('0x5'));var rp=require(_0x994f('0x6'));var fs=require('fs');var path=require(_0x994f('0x7'));var rimraf=require(_0x994f('0x8'));var config=require(_0x994f('0x9'));var attributes=require(_0x994f('0xa'));module[_0x994f('0xb')]=function(_0x4c0281,_0x1553d3){return _0x4c0281[_0x994f('0xc')](_0x994f('0xd'),attributes,{'tableName':_0x994f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0af5=['moment','bluebird','rimraf','./migration.attributes','Migration','migrations','api'];(function(_0x1048c4,_0x38ef8a){var _0x427b45=function(_0x4274ca){while(--_0x4274ca){_0x1048c4['push'](_0x1048c4['shift']());}};_0x427b45(++_0x38ef8a);}(_0x0af5,0xae));var _0x50af=function(_0x17a18c,_0x5258ff){_0x17a18c=_0x17a18c-0x0;var _0x10aaa4=_0x0af5[_0x17a18c];return _0x10aaa4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x50af('0x0'));var moment=require(_0x50af('0x1'));var BPromise=require(_0x50af('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x50af('0x3'));var config=require('../../config/environment');var attributes=require(_0x50af('0x4'));module['exports']=function(_0x2fab62,_0x3e5694){return _0x2fab62['define'](_0x50af('0x5'),attributes,{'tableName':_0x50af('0x6'),'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 1f5f8fb..847636a 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 _0x84e1=['Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x278d05,_0x55780f){var _0x2464a1=function(_0x27d2ea){while(--_0x27d2ea){_0x278d05['push'](_0x278d05['shift']());}};_0x2464a1(++_0x55780f);}(_0x84e1,0x1dc));var _0x184e=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x84e1[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x184e('0x0'));var util=require(_0x184e('0x1'));var moment=require(_0x184e('0x2'));var BPromise=require(_0x184e('0x3'));var rs=require(_0x184e('0x4'));var fs=require('fs');var Redis=require(_0x184e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x184e('0x6'));var logger=require(_0x184e('0x7'))(_0x184e('0x8'));var config=require(_0x184e('0x9'));var jayson=require(_0x184e('0xa'));var client=jayson[_0x184e('0xb')][_0x184e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ad2c3,_0x3f24d3,_0xa32654){return new BPromise(function(_0x1e79b2,_0x4b6204){return client[_0x184e('0xd')](_0x4ad2c3,_0xa32654)[_0x184e('0xe')](function(_0x22af83){logger[_0x184e('0xf')]('Migration,\x20%s,\x20%s',_0x3f24d3,_0x184e('0x10'));logger[_0x184e('0x11')](_0x184e('0x12'),_0x3f24d3,_0x184e('0x10'),JSON[_0x184e('0x13')](_0x22af83));if(_0x22af83[_0x184e('0x14')]){if(_0x22af83[_0x184e('0x14')][_0x184e('0x15')]===0x1f4){logger[_0x184e('0x14')](_0x184e('0x16'),_0x3f24d3,_0x22af83[_0x184e('0x14')][_0x184e('0x17')]);return _0x4b6204(_0x22af83['error'][_0x184e('0x17')]);}logger['error'](_0x184e('0x16'),_0x3f24d3,_0x22af83[_0x184e('0x14')][_0x184e('0x17')]);return _0x1e79b2(_0x22af83[_0x184e('0x14')][_0x184e('0x17')]);}else{logger[_0x184e('0xf')](_0x184e('0x16'),_0x3f24d3,_0x184e('0x10'));_0x1e79b2(_0x22af83[_0x184e('0x18')]['message']);}})[_0x184e('0x19')](function(_0x5d3a36){logger[_0x184e('0x14')]('Migration,\x20%s,\x20%s',_0x3f24d3,_0x5d3a36);_0x4b6204(_0x5d3a36);});});} \ No newline at end of file +var _0xe43c=['message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','Migration,\x20%s,\x20%s,\x20%s','stringify','error','Migration,\x20%s,\x20%s'];(function(_0x35512d,_0x51cc60){var _0x1eb825=function(_0x57f265){while(--_0x57f265){_0x35512d['push'](_0x35512d['shift']());}};_0x1eb825(++_0x51cc60);}(_0xe43c,0x180));var _0xce43=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xe43c[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xce43('0x0'));var util=require(_0xce43('0x1'));var moment=require(_0xce43('0x2'));var BPromise=require(_0xce43('0x3'));var rs=require(_0xce43('0x4'));var fs=require('fs');var Redis=require(_0xce43('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xce43('0x6'));var logger=require('../../config/logger')(_0xce43('0x7'));var config=require(_0xce43('0x8'));var jayson=require(_0xce43('0x9'));var client=jayson[_0xce43('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20bd99,_0x5ddbba,_0x1cbd0b){return new BPromise(function(_0x5c4af2,_0x3affb9){return client['request'](_0x20bd99,_0x1cbd0b)['then'](function(_0x9efc57){logger[_0xce43('0xb')]('Migration,\x20%s,\x20%s',_0x5ddbba,'request\x20sent');logger['debug'](_0xce43('0xc'),_0x5ddbba,'request\x20sent',JSON[_0xce43('0xd')](_0x9efc57));if(_0x9efc57['error']){if(_0x9efc57[_0xce43('0xe')]['code']===0x1f4){logger[_0xce43('0xe')](_0xce43('0xf'),_0x5ddbba,_0x9efc57[_0xce43('0xe')][_0xce43('0x10')]);return _0x3affb9(_0x9efc57[_0xce43('0xe')][_0xce43('0x10')]);}logger[_0xce43('0xe')]('Migration,\x20%s,\x20%s',_0x5ddbba,_0x9efc57[_0xce43('0xe')][_0xce43('0x10')]);return _0x5c4af2(_0x9efc57[_0xce43('0xe')][_0xce43('0x10')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x5ddbba,_0xce43('0x11'));_0x5c4af2(_0x9efc57[_0xce43('0x12')][_0xce43('0x10')]);}})[_0xce43('0x13')](function(_0xd5282){logger[_0xce43('0xe')]('Migration,\x20%s,\x20%s',_0x5ddbba,_0xd5282);_0x3affb9(_0xd5282);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 6d61391..04c8703 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 _0x8ace=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','put'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x2f5dad,_0x4313ad){_0x2f5dad=_0x2f5dad-0x0;var _0x38e02d=_0x8ace[_0x2f5dad];return _0x38e02d;};'use strict';var multer=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var path=require(_0xe8ac('0x2'));var timeout=require(_0xe8ac('0x3'));var express=require(_0xe8ac('0x4'));var router=express[_0xe8ac('0x5')]();var fs_extra=require(_0xe8ac('0x6'));var auth=require(_0xe8ac('0x7'));var interaction=require(_0xe8ac('0x8'));var config=require(_0xe8ac('0x9'));var controller=require(_0xe8ac('0xa'));router[_0xe8ac('0xb')]('/',auth[_0xe8ac('0xc')](),controller[_0xe8ac('0xd')]);router['get'](_0xe8ac('0xe'),auth[_0xe8ac('0xc')](),controller['show']);router['post']('/',auth[_0xe8ac('0xc')](),controller['create']);router[_0xe8ac('0xf')](_0xe8ac('0xe'),auth[_0xe8ac('0xc')](),controller[_0xe8ac('0x10')]);router[_0xe8ac('0x11')](_0xe8ac('0xe'),auth['isAuthenticated'](),controller[_0xe8ac('0x12')]);module[_0xe8ac('0x13')]=router; \ No newline at end of file +var _0x0170=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get'];(function(_0x35d5a3,_0x4f795b){var _0x3416f5=function(_0x2ee370){while(--_0x2ee370){_0x35d5a3['push'](_0x35d5a3['shift']());}};_0x3416f5(++_0x4f795b);}(_0x0170,0x1d6));var _0x0017=function(_0x3c6921,_0x5ee282){_0x3c6921=_0x3c6921-0x0;var _0x11748d=_0x0170[_0x3c6921];return _0x11748d;};'use strict';var multer=require(_0x0017('0x0'));var util=require(_0x0017('0x1'));var path=require('path');var timeout=require(_0x0017('0x2'));var express=require(_0x0017('0x3'));var router=express[_0x0017('0x4')]();var fs_extra=require(_0x0017('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0017('0x6'));var config=require(_0x0017('0x7'));var controller=require(_0x0017('0x8'));router[_0x0017('0x9')]('/',auth[_0x0017('0xa')](),controller[_0x0017('0xb')]);router[_0x0017('0x9')](_0x0017('0xc'),auth[_0x0017('0xa')](),controller[_0x0017('0xd')]);router[_0x0017('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0017('0xf')](_0x0017('0xc'),auth[_0x0017('0xa')](),controller[_0x0017('0x10')]);router[_0x0017('0x11')](_0x0017('0xc'),auth[_0x0017('0xa')](),controller[_0x0017('0x12')]);module[_0x0017('0x13')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index d7ce9f6..ed585e4 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 _0x9d0e=['STRING','sequelize','exports','ENUM','localnet','externip','stun','turn'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9d0e,0x151));var _0xe9d0=function(_0x2e44d9,_0x2cb1fe){_0x2e44d9=_0x2e44d9-0x0;var _0x377fe5=_0x9d0e[_0x2e44d9];return _0x377fe5;};'use strict';var Sequelize=require(_0xe9d0('0x0'));module[_0xe9d0('0x1')]={'type':{'type':Sequelize[_0xe9d0('0x2')](_0xe9d0('0x3'),_0xe9d0('0x4'),_0xe9d0('0x5'),_0xe9d0('0x6'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe9d0('0x7')]},'password':{'type':Sequelize[_0xe9d0('0x7')]}}; \ No newline at end of file +var _0x31c9=['turn','STRING','sequelize','exports','externip','stun'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x31c9,0x19a));var _0x931c=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x31c9[_0x4fbfd9];return _0x31dc94;};'use strict';var Sequelize=require(_0x931c('0x0'));module[_0x931c('0x1')]={'type':{'type':Sequelize['ENUM']('localnet',_0x931c('0x2'),_0x931c('0x3'),_0x931c('0x4'))},'value':{'type':Sequelize[_0x931c('0x5')]},'username':{'type':Sequelize[_0x931c('0x5')]},'password':{'type':Sequelize[_0x931c('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index d4d70c8..1997504 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 _0xabcb=['transaction','create','body','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','toUpperCase','TURN','root','server/files/templates/turn_multiple.ejs','utf8','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','find','/etc/asterisk/turn_xcally.conf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','message','Network,\x20%s,\x20%s','result','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','sendStatus','stack','name','send','index','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','Network','includeAll','findAll','rows','catch','show','params','keys','include'];(function(_0x3460a4,_0x80faf){var _0x26fcc3=function(_0x48c8c4){while(--_0x48c8c4){_0x3460a4['push'](_0x3460a4['shift']());}};_0x26fcc3(++_0x80faf);}(_0xabcb,0xf9));var _0xbabc=function(_0x7afaa8,_0x31702b){_0x7afaa8=_0x7afaa8-0x0;var _0x5099be=_0xabcb[_0x7afaa8];return _0x5099be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbabc('0x0'));var zipdir=require(_0xbabc('0x1'));var jsonpatch=require(_0xbabc('0x2'));var rp=require(_0xbabc('0x3'));var moment=require(_0xbabc('0x4'));var BPromise=require(_0xbabc('0x5'));var Mustache=require(_0xbabc('0x6'));var util=require(_0xbabc('0x7'));var path=require(_0xbabc('0x8'));var sox=require(_0xbabc('0x9'));var csv=require(_0xbabc('0xa'));var ejs=require(_0xbabc('0xb'));var fs=require('fs');var fs_extra=require(_0xbabc('0xc'));var _=require(_0xbabc('0xd'));var squel=require(_0xbabc('0xe'));var crypto=require(_0xbabc('0xf'));var jsforce=require(_0xbabc('0x10'));var deskjs=require(_0xbabc('0x11'));var toCsv=require(_0xbabc('0xa'));var querystring=require(_0xbabc('0x12'));var Papa=require('papaparse');var Redis=require(_0xbabc('0x13'));var authService=require(_0xbabc('0x14'));var qs=require(_0xbabc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbabc('0x16'));var logger=require(_0xbabc('0x17'))(_0xbabc('0x18'));var utils=require(_0xbabc('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xbabc('0x1a'));var db=require(_0xbabc('0x1b'))['db'];var jayson=require(_0xbabc('0x1c'));var client=jayson[_0xbabc('0x1d')][_0xbabc('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2cf382,_0x1ec2ce,_0x4807c1,_0x29ee85){return new BPromise(function(_0x410d78,_0x45294c){var _0x52bea9=_0x29ee85||client;return _0x52bea9[_0xbabc('0x1f')](_0x2cf382,_0x4807c1)[_0xbabc('0x20')](function(_0x13066c){logger[_0xbabc('0x21')]('Network,\x20%s,\x20%s',_0x1ec2ce,_0xbabc('0x22'));logger['debug'](_0xbabc('0x23'),_0x1ec2ce,_0xbabc('0x22'),JSON['stringify'](_0x13066c));if(_0x13066c[_0xbabc('0x24')]){if(_0x13066c['error'][_0xbabc('0x25')]===0x1f4){logger[_0xbabc('0x24')]('Network,\x20%s,\x20%s',_0x1ec2ce,_0x13066c[_0xbabc('0x24')]['message']);return _0x45294c(_0x13066c[_0xbabc('0x24')][_0xbabc('0x26')]);}logger[_0xbabc('0x24')](_0xbabc('0x27'),_0x1ec2ce,_0x13066c[_0xbabc('0x24')][_0xbabc('0x26')]);return _0x410d78(_0x13066c['error']['message']);}else{logger[_0xbabc('0x21')](_0xbabc('0x27'),_0x1ec2ce,_0xbabc('0x22'));_0x410d78(_0x13066c[_0xbabc('0x28')]['message']);}})['catch'](function(_0x2442c5){logger['error'](_0xbabc('0x27'),_0x1ec2ce,_0x2442c5);_0x45294c(_0x2442c5);});});}function respondWithStatusCode(_0x1c1765,_0x52f970){_0x52f970=_0x52f970||0xcc;return function(_0x547e19){if(_0x547e19){return _0x1c1765['sendStatus'](_0x52f970);}return _0x1c1765['status'](_0x52f970)[_0xbabc('0x29')]();};}function respondWithResult(_0x2db8f7,_0x369eee){_0x369eee=_0x369eee||0xc8;return function(_0x3f5686){if(_0x3f5686){return _0x2db8f7[_0xbabc('0x2a')](_0x369eee)[_0xbabc('0x2b')](_0x3f5686);}};}function respondWithFilteredResult(_0x2b8e1c,_0x5163df){return function(_0x582b55){if(_0x582b55){var _0x7f1624=typeof _0x5163df[_0xbabc('0x2c')]==='undefined'&&typeof _0x5163df['limit']===_0xbabc('0x2d');var _0x3faee8=_0x582b55[_0xbabc('0x2e')];var _0x580f2c=_0x7f1624?0x0:_0x5163df['offset'];var _0x45d796=_0x7f1624?_0x582b55['count']:_0x5163df[_0xbabc('0x2c')]+_0x5163df[_0xbabc('0x2f')];var _0x1e58de;if(_0x45d796>=_0x3faee8){_0x45d796=_0x3faee8;_0x1e58de=0xc8;}else{_0x1e58de=0xce;}_0x2b8e1c[_0xbabc('0x2a')](_0x1e58de);return _0x2b8e1c[_0xbabc('0x30')](_0xbabc('0x31'),_0x580f2c+'-'+_0x45d796+'/'+_0x3faee8)[_0xbabc('0x2b')](_0x582b55);}return null;};}function patchUpdates(_0x47d9e4){return function(_0x39e123){try{jsonpatch['apply'](_0x39e123,_0x47d9e4,!![]);}catch(_0x747993){return BPromise[_0xbabc('0x32')](_0x747993);}return _0x39e123['save']();};}function saveUpdates(_0x8c4ab1,_0x375dc6){return function(_0x4dd3a7){if(_0x4dd3a7){return _0x4dd3a7[_0xbabc('0x33')](_0x8c4ab1)[_0xbabc('0x20')](function(_0x54d652){return _0x54d652;});}return null;};}function removeEntity(_0x298f32,_0x18977b){return function(_0x434103){if(_0x434103){return _0x434103[_0xbabc('0x34')]()[_0xbabc('0x20')](function(){_0x298f32['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c96cd,_0x1da4fa){return function(_0x5bd579){if(!_0x5bd579){_0x3c96cd[_0xbabc('0x35')](0x194);}return _0x5bd579;};}function handleError(_0x35571e,_0x4f2e21){_0x4f2e21=_0x4f2e21||0x1f4;return function(_0x33c140){logger['error'](_0x33c140[_0xbabc('0x36')]);if(_0x33c140[_0xbabc('0x37')]){delete _0x33c140['name'];}_0x35571e[_0xbabc('0x2a')](_0x4f2e21)[_0xbabc('0x38')](_0x33c140);};}exports[_0xbabc('0x39')]=function(_0x2fb550,_0x15ba3e){var _0x79f8fe={},_0x50dc72={},_0x147482={'count':0x0,'rows':[]};var _0x3334c9=_['map'](db['Network']['rawAttributes'],function(_0xd8be9d){return{'name':_0xd8be9d[_0xbabc('0x3a')],'type':_0xd8be9d[_0xbabc('0x3b')][_0xbabc('0x3c')]};});_0x50dc72[_0xbabc('0x3d')]=_[_0xbabc('0x3e')](_0x3334c9,'name');_0x50dc72['query']=_['keys'](_0x2fb550['query']);_0x50dc72['filters']=_['intersection'](_0x50dc72[_0xbabc('0x3d')],_0x50dc72[_0xbabc('0x3f')]);_0x79f8fe['attributes']=_[_0xbabc('0x40')](_0x50dc72[_0xbabc('0x3d')],qs[_0xbabc('0x41')](_0x2fb550[_0xbabc('0x3f')][_0xbabc('0x41')]));_0x79f8fe[_0xbabc('0x42')]=_0x79f8fe[_0xbabc('0x42')][_0xbabc('0x43')]?_0x79f8fe['attributes']:_0x50dc72[_0xbabc('0x3d')];if(!_0x2fb550[_0xbabc('0x3f')][_0xbabc('0x44')](_0xbabc('0x45'))){_0x79f8fe['limit']=qs['limit'](_0x2fb550['query'][_0xbabc('0x2f')]);_0x79f8fe[_0xbabc('0x2c')]=qs[_0xbabc('0x2c')](_0x2fb550['query'][_0xbabc('0x2c')]);}_0x79f8fe[_0xbabc('0x46')]=qs[_0xbabc('0x47')](_0x2fb550['query'][_0xbabc('0x47')]);_0x79f8fe[_0xbabc('0x48')]=qs[_0xbabc('0x49')](_[_0xbabc('0x4a')](_0x2fb550[_0xbabc('0x3f')],_0x50dc72[_0xbabc('0x49')]),_0x3334c9);if(_0x2fb550[_0xbabc('0x3f')]['filter']){_0x79f8fe['where']=_[_0xbabc('0x4b')](_0x79f8fe[_0xbabc('0x48')],{'$or':_[_0xbabc('0x3e')](_0x3334c9,function(_0x24ca66){if(_0x24ca66['type']!==_0xbabc('0x4c')){var _0x215fe7={};_0x215fe7[_0x24ca66[_0xbabc('0x37')]]={'$like':'%'+_0x2fb550['query'][_0xbabc('0x4d')]+'%'};return _0x215fe7;}})});}_0x79f8fe=_[_0xbabc('0x4b')]({},_0x79f8fe,_0x2fb550['options']);var _0x58f03={'where':_0x79f8fe[_0xbabc('0x48')]};return db[_0xbabc('0x4e')][_0xbabc('0x2e')](_0x58f03)[_0xbabc('0x20')](function(_0x30f04a){_0x147482[_0xbabc('0x2e')]=_0x30f04a;if(_0x2fb550[_0xbabc('0x3f')][_0xbabc('0x4f')]){_0x79f8fe['include']=[{'all':!![]}];}return db[_0xbabc('0x4e')][_0xbabc('0x50')](_0x79f8fe);})[_0xbabc('0x20')](function(_0xf049f1){_0x147482[_0xbabc('0x51')]=_0xf049f1;return _0x147482;})[_0xbabc('0x20')](respondWithFilteredResult(_0x15ba3e,_0x79f8fe))[_0xbabc('0x52')](handleError(_0x15ba3e,null));};exports[_0xbabc('0x53')]=function(_0x1e0ebc,_0x5bed35){var _0x5efcc3={'raw':!![],'where':{'id':_0x1e0ebc[_0xbabc('0x54')]['id']}},_0x29b589={};_0x29b589['model']=_[_0xbabc('0x55')](db['Network']['rawAttributes']);_0x29b589[_0xbabc('0x3f')]=_['keys'](_0x1e0ebc[_0xbabc('0x3f')]);_0x29b589['filters']=_[_0xbabc('0x40')](_0x29b589['model'],_0x29b589[_0xbabc('0x3f')]);_0x5efcc3['attributes']=_[_0xbabc('0x40')](_0x29b589[_0xbabc('0x3d')],qs['fields'](_0x1e0ebc['query']['fields']));_0x5efcc3[_0xbabc('0x42')]=_0x5efcc3[_0xbabc('0x42')][_0xbabc('0x43')]?_0x5efcc3[_0xbabc('0x42')]:_0x29b589['model'];if(_0x1e0ebc[_0xbabc('0x3f')][_0xbabc('0x4f')]){_0x5efcc3[_0xbabc('0x56')]=[{'all':!![]}];}_0x5efcc3=_[_0xbabc('0x4b')]({},_0x5efcc3,_0x1e0ebc['options']);return db[_0xbabc('0x4e')]['find'](_0x5efcc3)[_0xbabc('0x20')](handleEntityNotFound(_0x5bed35,null))[_0xbabc('0x20')](respondWithResult(_0x5bed35,null))[_0xbabc('0x52')](handleError(_0x5bed35,null));};exports['create']=function(_0x419a19,_0x2aebf0,_0x2c3ed6){var _0x32bc61;return db['sequelize'][_0xbabc('0x57')](function(_0x5c7314){return db[_0xbabc('0x4e')][_0xbabc('0x58')](_0x419a19[_0xbabc('0x59')],{'raw':!![]})['then'](function(_0x337f24){_0x32bc61=_0x337f24;return db[_0xbabc('0x4e')][_0xbabc('0x50')]({'where':{'type':_0x419a19[_0xbabc('0x59')][_0xbabc('0x3b')]},'raw':!![]});})['then'](function(_0x3c722d){if(_0x32bc61[_0xbabc('0x3b')]['toUpperCase']()==_0xbabc('0x5a')){var _0x1609e7=fs[_0xbabc('0x5b')](path[_0xbabc('0x5c')](config['root'],_0xbabc('0x5d')),'utf8');var _0x242276=ejs[_0xbabc('0x5e')](_0x1609e7,{'networks':_0x3c722d||[]});fs[_0xbabc('0x5f')](_0xbabc('0x60'),_0x242276);return respondWithRpcPromise(_0xbabc('0x61'),_0xbabc('0x58'),{'module':'res_stun_monitor.so'});}else if(_0x32bc61[_0xbabc('0x3b')][_0xbabc('0x62')]()==_0xbabc('0x63')){var _0x2751be=fs[_0xbabc('0x5b')](path[_0xbabc('0x5c')](config[_0xbabc('0x64')],_0xbabc('0x65')),_0xbabc('0x66'));var _0x2660df=ejs['render'](_0x2751be,{'networks':_0x3c722d||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x2660df);return respondWithRpcPromise('Reload',_0xbabc('0x58'),{'module':_0xbabc('0x67')});}else{var _0xdf1e5c=fs['readFileSync'](path[_0xbabc('0x5c')](config[_0xbabc('0x64')],_0xbabc('0x68')),_0xbabc('0x66'));var _0x5c1420=ejs['render'](_0xdf1e5c,{'networks':_0x3c722d||[]});fs[_0xbabc('0x5f')](util[_0xbabc('0x69')](_0xbabc('0x6a'),_0x419a19[_0xbabc('0x59')]['type'][_0xbabc('0x6b')]()),_0x5c1420);return respondWithRpcPromise('Reload',_0xbabc('0x58'),{'module':_0xbabc('0x6c')});}return null;})[_0xbabc('0x20')](function(){return _0x32bc61;});})[_0xbabc('0x20')](respondWithResult(_0x2aebf0,0xc9))[_0xbabc('0x52')](handleError(_0x2aebf0,null));};exports[_0xbabc('0x33')]=function(_0x6912d9,_0x103e82,_0x3852e3){var _0x1cf189;return db[_0xbabc('0x6d')][_0xbabc('0x57')](function(_0x4e3946){return db[_0xbabc('0x4e')][_0xbabc('0x6e')]({'where':{'id':_0x6912d9[_0xbabc('0x54')]['id']}})['then'](handleEntityNotFound(_0x103e82,null))[_0xbabc('0x20')](saveUpdates(_0x6912d9[_0xbabc('0x59')],null))[_0xbabc('0x20')](function(_0x7383db){if(_0x7383db){_0x1cf189=_0x7383db;return db[_0xbabc('0x4e')][_0xbabc('0x50')]({'where':{'type':_0x1cf189[_0xbabc('0x3b')]},'raw':!![]});}return null;})[_0xbabc('0x20')](function(_0x4a4267){if(_0x1cf189[_0xbabc('0x3b')][_0xbabc('0x62')]()==_0xbabc('0x5a')){var _0x49f283=fs['readFileSync'](path[_0xbabc('0x5c')](config[_0xbabc('0x64')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x5ea8c9=ejs[_0xbabc('0x5e')](_0x49f283,{'networks':_0x4a4267||[]});fs[_0xbabc('0x5f')](_0xbabc('0x60'),_0x5ea8c9);return respondWithRpcPromise(_0xbabc('0x61'),_0xbabc('0x33'),{'module':'res_stun_monitor.so'});}else if(_0x1cf189['type'][_0xbabc('0x62')]()=='TURN'){var _0xeffe1b=fs['readFileSync'](path[_0xbabc('0x5c')](config[_0xbabc('0x64')],_0xbabc('0x65')),_0xbabc('0x66'));var _0x16737d=ejs[_0xbabc('0x5e')](_0xeffe1b,{'networks':_0x4a4267||[]});fs['writeFileSync'](_0xbabc('0x6f'),_0x16737d);return respondWithRpcPromise(_0xbabc('0x61'),_0xbabc('0x33'),{'module':_0xbabc('0x67')});}else{var _0x4786f6=fs['readFileSync'](path['join'](config['root'],_0xbabc('0x68')),_0xbabc('0x66'));var _0x1b777d=ejs[_0xbabc('0x5e')](_0x4786f6,{'networks':_0x4a4267||[]});fs[_0xbabc('0x5f')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x6912d9[_0xbabc('0x59')][_0xbabc('0x3b')]['toLowerCase']()),_0x1b777d);return respondWithRpcPromise(_0xbabc('0x61'),_0xbabc('0x33'),{'module':_0xbabc('0x6c')});}return null;})['then'](function(_0x2c42cd){if(_0x2c42cd){return _0x1cf189;}return null;});})['then'](respondWithResult(_0x103e82,null))[_0xbabc('0x52')](handleError(_0x103e82,null));};exports['destroy']=function(_0x2be2f5,_0xfe05de,_0x3d4630){var _0x518f75;return db[_0xbabc('0x4e')][_0xbabc('0x6e')]({'where':{'id':_0x2be2f5[_0xbabc('0x54')]['id']}})[_0xbabc('0x20')](function(_0x4b75a8){_0x518f75=_0x4b75a8;return _0x4b75a8;})[_0xbabc('0x20')](handleEntityNotFound(_0xfe05de,null))[_0xbabc('0x20')](removeEntity(_0xfe05de,null))['then'](function(){if(_0x518f75){return db['Network'][_0xbabc('0x50')]({'where':{'type':_0x518f75[_0xbabc('0x3b')]},'raw':!![]});}})[_0xbabc('0x20')](function(_0x34e12f){if(_0x518f75[_0xbabc('0x3b')][_0xbabc('0x62')]()==_0xbabc('0x5a')){var _0x4bb811=fs[_0xbabc('0x5b')](path[_0xbabc('0x5c')](config[_0xbabc('0x64')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x2ab08c=ejs[_0xbabc('0x5e')](_0x4bb811,{'networks':_0x34e12f||[]});fs[_0xbabc('0x5f')]('/etc/asterisk/stun_xcally.conf',_0x2ab08c);return respondWithRpcPromise('Reload',_0xbabc('0x34'),{'module':'res_stun_monitor.so'});}else if(_0x518f75['type'][_0xbabc('0x62')]()==_0xbabc('0x63')){var _0x1509c2=fs['readFileSync'](path[_0xbabc('0x5c')](config['root'],_0xbabc('0x65')),_0xbabc('0x66'));var _0x5ee396=ejs[_0xbabc('0x5e')](_0x1509c2,{'networks':_0x34e12f||[]});fs['writeFileSync'](_0xbabc('0x6f'),_0x5ee396);return respondWithRpcPromise(_0xbabc('0x61'),'destroy',{'module':_0xbabc('0x67')});}else{var _0x497f89=fs[_0xbabc('0x5b')](path['join'](config['root'],_0xbabc('0x68')),_0xbabc('0x66'));var _0x4db446=ejs[_0xbabc('0x5e')](_0x497f89,{'networks':_0x34e12f||[]});fs['writeFileSync'](util['format'](_0xbabc('0x6a'),_0x2be2f5['body']['type']['toLowerCase']()),_0x4db446);return respondWithRpcPromise(_0xbabc('0x61'),_0xbabc('0x34'),{'module':'chan_sip.so'});}return null;})[_0xbabc('0x52')](handleError(_0xfe05de,null));}; \ No newline at end of file +var _0x6ede=['writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','Network','fieldName','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','findAll','params','rawAttributes','length','includeAll','options','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','create','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs'];(function(_0x1c5ce3,_0xc474ba){var _0x1eb89c=function(_0x2e3cb7){while(--_0x2e3cb7){_0x1c5ce3['push'](_0x1c5ce3['shift']());}};_0x1eb89c(++_0xc474ba);}(_0x6ede,0x140));var _0xe6ed=function(_0x4a367f,_0x4e05f2){_0x4a367f=_0x4a367f-0x0;var _0x2bedd5=_0x6ede[_0x4a367f];return _0x2bedd5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6ed('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6ed('0x1'));var rp=require(_0xe6ed('0x2'));var moment=require(_0xe6ed('0x3'));var BPromise=require(_0xe6ed('0x4'));var Mustache=require(_0xe6ed('0x5'));var util=require(_0xe6ed('0x6'));var path=require(_0xe6ed('0x7'));var sox=require('sox');var csv=require(_0xe6ed('0x8'));var ejs=require(_0xe6ed('0x9'));var fs=require('fs');var fs_extra=require(_0xe6ed('0xa'));var _=require(_0xe6ed('0xb'));var squel=require(_0xe6ed('0xc'));var crypto=require(_0xe6ed('0xd'));var jsforce=require(_0xe6ed('0xe'));var deskjs=require(_0xe6ed('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe6ed('0x10'));var authService=require(_0xe6ed('0x11'));var qs=require(_0xe6ed('0x12'));var as=require(_0xe6ed('0x13'));var hardwareService=require(_0xe6ed('0x14'));var logger=require(_0xe6ed('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xe6ed('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe6ed('0x17'))['db'];var jayson=require(_0xe6ed('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4f74ed,_0x438894,_0x5a143a,_0x47cbc8){return new BPromise(function(_0x3022e7,_0x2c82db){var _0x778106=_0x47cbc8||client;return _0x778106[_0xe6ed('0x19')](_0x4f74ed,_0x5a143a)[_0xe6ed('0x1a')](function(_0x1ef166){logger[_0xe6ed('0x1b')](_0xe6ed('0x1c'),_0x438894,_0xe6ed('0x1d'));logger[_0xe6ed('0x1e')](_0xe6ed('0x1f'),_0x438894,_0xe6ed('0x1d'),JSON[_0xe6ed('0x20')](_0x1ef166));if(_0x1ef166['error']){if(_0x1ef166[_0xe6ed('0x21')]['code']===0x1f4){logger[_0xe6ed('0x21')]('Network,\x20%s,\x20%s',_0x438894,_0x1ef166['error'][_0xe6ed('0x22')]);return _0x2c82db(_0x1ef166[_0xe6ed('0x21')][_0xe6ed('0x22')]);}logger[_0xe6ed('0x21')]('Network,\x20%s,\x20%s',_0x438894,_0x1ef166[_0xe6ed('0x21')]['message']);return _0x3022e7(_0x1ef166[_0xe6ed('0x21')]['message']);}else{logger[_0xe6ed('0x1b')]('Network,\x20%s,\x20%s',_0x438894,'request\x20sent');_0x3022e7(_0x1ef166[_0xe6ed('0x23')][_0xe6ed('0x22')]);}})[_0xe6ed('0x24')](function(_0x1344dc){logger['error'](_0xe6ed('0x1c'),_0x438894,_0x1344dc);_0x2c82db(_0x1344dc);});});}function respondWithStatusCode(_0x24a019,_0x5cb139){_0x5cb139=_0x5cb139||0xcc;return function(_0x11546f){if(_0x11546f){return _0x24a019[_0xe6ed('0x25')](_0x5cb139);}return _0x24a019['status'](_0x5cb139)['end']();};}function respondWithResult(_0x1315ea,_0x1c9ac4){_0x1c9ac4=_0x1c9ac4||0xc8;return function(_0x3f4bfd){if(_0x3f4bfd){return _0x1315ea[_0xe6ed('0x26')](_0x1c9ac4)[_0xe6ed('0x27')](_0x3f4bfd);}};}function respondWithFilteredResult(_0x43c547,_0x19064c){return function(_0x136068){if(_0x136068){var _0x13dbe8=typeof _0x19064c[_0xe6ed('0x28')]===_0xe6ed('0x29')&&typeof _0x19064c['limit']===_0xe6ed('0x29');var _0x144257=_0x136068[_0xe6ed('0x2a')];var _0x58238e=_0x13dbe8?0x0:_0x19064c[_0xe6ed('0x28')];var _0x339795=_0x13dbe8?_0x136068[_0xe6ed('0x2a')]:_0x19064c[_0xe6ed('0x28')]+_0x19064c[_0xe6ed('0x2b')];var _0x1c881d;if(_0x339795>=_0x144257){_0x339795=_0x144257;_0x1c881d=0xc8;}else{_0x1c881d=0xce;}_0x43c547[_0xe6ed('0x26')](_0x1c881d);return _0x43c547[_0xe6ed('0x2c')](_0xe6ed('0x2d'),_0x58238e+'-'+_0x339795+'/'+_0x144257)['json'](_0x136068);}return null;};}function patchUpdates(_0x185b6e){return function(_0x524ded){try{jsonpatch[_0xe6ed('0x2e')](_0x524ded,_0x185b6e,!![]);}catch(_0x5445fe){return BPromise['reject'](_0x5445fe);}return _0x524ded[_0xe6ed('0x2f')]();};}function saveUpdates(_0x2314b0,_0x332fb5){return function(_0x77e8c5){if(_0x77e8c5){return _0x77e8c5[_0xe6ed('0x30')](_0x2314b0)[_0xe6ed('0x1a')](function(_0x34ed72){return _0x34ed72;});}return null;};}function removeEntity(_0x430318,_0x1a3abe){return function(_0x71c99c){if(_0x71c99c){return _0x71c99c[_0xe6ed('0x31')]()[_0xe6ed('0x1a')](function(){_0x430318[_0xe6ed('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d7c36,_0x23015a){return function(_0x32f1ae){if(!_0x32f1ae){_0x3d7c36[_0xe6ed('0x25')](0x194);}return _0x32f1ae;};}function handleError(_0x230fca,_0x47dd68){_0x47dd68=_0x47dd68||0x1f4;return function(_0x3d93fe){logger[_0xe6ed('0x21')](_0x3d93fe[_0xe6ed('0x32')]);if(_0x3d93fe[_0xe6ed('0x33')]){delete _0x3d93fe[_0xe6ed('0x33')];}_0x230fca['status'](_0x47dd68)[_0xe6ed('0x34')](_0x3d93fe);};}exports[_0xe6ed('0x35')]=function(_0x50df4b,_0x111853){var _0x5fddef={},_0x411c8b={},_0x3d4a9b={'count':0x0,'rows':[]};var _0x8386e4=_[_0xe6ed('0x36')](db[_0xe6ed('0x37')]['rawAttributes'],function(_0x317a1d){return{'name':_0x317a1d[_0xe6ed('0x38')],'type':_0x317a1d['type']['key']};});_0x411c8b['model']=_[_0xe6ed('0x36')](_0x8386e4,_0xe6ed('0x33'));_0x411c8b['query']=_[_0xe6ed('0x39')](_0x50df4b[_0xe6ed('0x3a')]);_0x411c8b[_0xe6ed('0x3b')]=_[_0xe6ed('0x3c')](_0x411c8b[_0xe6ed('0x3d')],_0x411c8b['query']);_0x5fddef[_0xe6ed('0x3e')]=_[_0xe6ed('0x3c')](_0x411c8b[_0xe6ed('0x3d')],qs[_0xe6ed('0x3f')](_0x50df4b[_0xe6ed('0x3a')]['fields']));_0x5fddef['attributes']=_0x5fddef[_0xe6ed('0x3e')]['length']?_0x5fddef[_0xe6ed('0x3e')]:_0x411c8b[_0xe6ed('0x3d')];if(!_0x50df4b[_0xe6ed('0x3a')][_0xe6ed('0x40')](_0xe6ed('0x41'))){_0x5fddef['limit']=qs[_0xe6ed('0x2b')](_0x50df4b[_0xe6ed('0x3a')][_0xe6ed('0x2b')]);_0x5fddef[_0xe6ed('0x28')]=qs[_0xe6ed('0x28')](_0x50df4b['query'][_0xe6ed('0x28')]);}_0x5fddef['order']=qs[_0xe6ed('0x42')](_0x50df4b['query']['sort']);_0x5fddef[_0xe6ed('0x43')]=qs[_0xe6ed('0x3b')](_[_0xe6ed('0x44')](_0x50df4b[_0xe6ed('0x3a')],_0x411c8b['filters']),_0x8386e4);if(_0x50df4b['query'][_0xe6ed('0x45')]){_0x5fddef['where']=_[_0xe6ed('0x46')](_0x5fddef['where'],{'$or':_[_0xe6ed('0x36')](_0x8386e4,function(_0x53ce95){if(_0x53ce95[_0xe6ed('0x47')]!==_0xe6ed('0x48')){var _0x5d5529={};_0x5d5529[_0x53ce95[_0xe6ed('0x33')]]={'$like':'%'+_0x50df4b[_0xe6ed('0x3a')][_0xe6ed('0x45')]+'%'};return _0x5d5529;}})});}_0x5fddef=_[_0xe6ed('0x46')]({},_0x5fddef,_0x50df4b['options']);var _0x5a417d={'where':_0x5fddef[_0xe6ed('0x43')]};return db[_0xe6ed('0x37')]['count'](_0x5a417d)[_0xe6ed('0x1a')](function(_0x44583e){_0x3d4a9b['count']=_0x44583e;if(_0x50df4b[_0xe6ed('0x3a')]['includeAll']){_0x5fddef['include']=[{'all':!![]}];}return db['Network'][_0xe6ed('0x49')](_0x5fddef);})[_0xe6ed('0x1a')](function(_0x39e1ea){_0x3d4a9b['rows']=_0x39e1ea;return _0x3d4a9b;})[_0xe6ed('0x1a')](respondWithFilteredResult(_0x111853,_0x5fddef))[_0xe6ed('0x24')](handleError(_0x111853,null));};exports['show']=function(_0xc0844e,_0x18122b){var _0x3ac16c={'raw':!![],'where':{'id':_0xc0844e[_0xe6ed('0x4a')]['id']}},_0x5624d2={};_0x5624d2[_0xe6ed('0x3d')]=_[_0xe6ed('0x39')](db[_0xe6ed('0x37')][_0xe6ed('0x4b')]);_0x5624d2['query']=_[_0xe6ed('0x39')](_0xc0844e[_0xe6ed('0x3a')]);_0x5624d2[_0xe6ed('0x3b')]=_['intersection'](_0x5624d2['model'],_0x5624d2[_0xe6ed('0x3a')]);_0x3ac16c[_0xe6ed('0x3e')]=_[_0xe6ed('0x3c')](_0x5624d2[_0xe6ed('0x3d')],qs['fields'](_0xc0844e[_0xe6ed('0x3a')][_0xe6ed('0x3f')]));_0x3ac16c[_0xe6ed('0x3e')]=_0x3ac16c[_0xe6ed('0x3e')][_0xe6ed('0x4c')]?_0x3ac16c['attributes']:_0x5624d2[_0xe6ed('0x3d')];if(_0xc0844e['query'][_0xe6ed('0x4d')]){_0x3ac16c['include']=[{'all':!![]}];}_0x3ac16c=_[_0xe6ed('0x46')]({},_0x3ac16c,_0xc0844e[_0xe6ed('0x4e')]);return db[_0xe6ed('0x37')]['find'](_0x3ac16c)['then'](handleEntityNotFound(_0x18122b,null))[_0xe6ed('0x1a')](respondWithResult(_0x18122b,null))[_0xe6ed('0x24')](handleError(_0x18122b,null));};exports['create']=function(_0x4e1384,_0x4ff932,_0x40764d){var _0x291bb1;return db[_0xe6ed('0x4f')][_0xe6ed('0x50')](function(_0x345228){return db['Network']['create'](_0x4e1384[_0xe6ed('0x51')],{'raw':!![]})['then'](function(_0x3f6bbb){_0x291bb1=_0x3f6bbb;return db[_0xe6ed('0x37')][_0xe6ed('0x49')]({'where':{'type':_0x4e1384[_0xe6ed('0x51')][_0xe6ed('0x47')]},'raw':!![]});})[_0xe6ed('0x1a')](function(_0x1b3fd1){if(_0x291bb1['type'][_0xe6ed('0x52')]()==_0xe6ed('0x53')){var _0x29b53a=fs[_0xe6ed('0x54')](path[_0xe6ed('0x55')](config[_0xe6ed('0x56')],_0xe6ed('0x57')),_0xe6ed('0x58'));var _0x1d6ec0=ejs[_0xe6ed('0x59')](_0x29b53a,{'networks':_0x1b3fd1||[]});fs['writeFileSync'](_0xe6ed('0x5a'),_0x1d6ec0);return respondWithRpcPromise(_0xe6ed('0x5b'),_0xe6ed('0x5c'),{'module':_0xe6ed('0x5d')});}else if(_0x291bb1[_0xe6ed('0x47')]['toUpperCase']()==_0xe6ed('0x5e')){var _0x1ff80e=fs[_0xe6ed('0x54')](path[_0xe6ed('0x55')](config[_0xe6ed('0x56')],_0xe6ed('0x5f')),_0xe6ed('0x58'));var _0x2d0eaf=ejs[_0xe6ed('0x59')](_0x1ff80e,{'networks':_0x1b3fd1||[]});fs[_0xe6ed('0x60')](_0xe6ed('0x61'),_0x2d0eaf);return respondWithRpcPromise(_0xe6ed('0x5b'),'create',{'module':_0xe6ed('0x5d')});}else{var _0x4e6b4a=fs[_0xe6ed('0x54')](path[_0xe6ed('0x55')](config[_0xe6ed('0x56')],_0xe6ed('0x62')),'utf8');var _0x1ddbb9=ejs['render'](_0x4e6b4a,{'networks':_0x1b3fd1||[]});fs[_0xe6ed('0x60')](util[_0xe6ed('0x63')](_0xe6ed('0x64'),_0x4e1384[_0xe6ed('0x51')][_0xe6ed('0x47')][_0xe6ed('0x65')]()),_0x1ddbb9);return respondWithRpcPromise(_0xe6ed('0x5b'),_0xe6ed('0x5c'),{'module':_0xe6ed('0x66')});}return null;})[_0xe6ed('0x1a')](function(){return _0x291bb1;});})[_0xe6ed('0x1a')](respondWithResult(_0x4ff932,0xc9))[_0xe6ed('0x24')](handleError(_0x4ff932,null));};exports[_0xe6ed('0x30')]=function(_0xd56ca0,_0x1102f3,_0x55d423){var _0x3202d6;return db['sequelize'][_0xe6ed('0x50')](function(_0x40c26d){return db[_0xe6ed('0x37')][_0xe6ed('0x67')]({'where':{'id':_0xd56ca0[_0xe6ed('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1102f3,null))[_0xe6ed('0x1a')](saveUpdates(_0xd56ca0[_0xe6ed('0x51')],null))[_0xe6ed('0x1a')](function(_0x240a84){if(_0x240a84){_0x3202d6=_0x240a84;return db[_0xe6ed('0x37')][_0xe6ed('0x49')]({'where':{'type':_0x3202d6[_0xe6ed('0x47')]},'raw':!![]});}return null;})[_0xe6ed('0x1a')](function(_0x335451){if(_0x3202d6[_0xe6ed('0x47')][_0xe6ed('0x52')]()==_0xe6ed('0x53')){var _0x5b181a=fs[_0xe6ed('0x54')](path[_0xe6ed('0x55')](config[_0xe6ed('0x56')],_0xe6ed('0x57')),'utf8');var _0x4504e4=ejs[_0xe6ed('0x59')](_0x5b181a,{'networks':_0x335451||[]});fs[_0xe6ed('0x60')](_0xe6ed('0x5a'),_0x4504e4);return respondWithRpcPromise('Reload','update',{'module':_0xe6ed('0x5d')});}else if(_0x3202d6['type'][_0xe6ed('0x52')]()==_0xe6ed('0x5e')){var _0x26c593=fs[_0xe6ed('0x54')](path[_0xe6ed('0x55')](config[_0xe6ed('0x56')],_0xe6ed('0x5f')),_0xe6ed('0x58'));var _0x2b4fdb=ejs[_0xe6ed('0x59')](_0x26c593,{'networks':_0x335451||[]});fs['writeFileSync'](_0xe6ed('0x61'),_0x2b4fdb);return respondWithRpcPromise(_0xe6ed('0x5b'),_0xe6ed('0x30'),{'module':'res_stun_monitor.so'});}else{var _0x5eddce=fs[_0xe6ed('0x54')](path[_0xe6ed('0x55')](config[_0xe6ed('0x56')],_0xe6ed('0x62')),_0xe6ed('0x58'));var _0x202be4=ejs['render'](_0x5eddce,{'networks':_0x335451||[]});fs['writeFileSync'](util[_0xe6ed('0x63')](_0xe6ed('0x64'),_0xd56ca0[_0xe6ed('0x51')]['type'][_0xe6ed('0x65')]()),_0x202be4);return respondWithRpcPromise('Reload',_0xe6ed('0x30'),{'module':_0xe6ed('0x66')});}return null;})[_0xe6ed('0x1a')](function(_0x5cf91d){if(_0x5cf91d){return _0x3202d6;}return null;});})[_0xe6ed('0x1a')](respondWithResult(_0x1102f3,null))[_0xe6ed('0x24')](handleError(_0x1102f3,null));};exports['destroy']=function(_0x1fa4ee,_0x2c1d74,_0x3a02d9){var _0x2724bc;return db[_0xe6ed('0x37')][_0xe6ed('0x67')]({'where':{'id':_0x1fa4ee['params']['id']}})[_0xe6ed('0x1a')](function(_0x43b955){_0x2724bc=_0x43b955;return _0x43b955;})['then'](handleEntityNotFound(_0x2c1d74,null))[_0xe6ed('0x1a')](removeEntity(_0x2c1d74,null))[_0xe6ed('0x1a')](function(){if(_0x2724bc){return db[_0xe6ed('0x37')][_0xe6ed('0x49')]({'where':{'type':_0x2724bc[_0xe6ed('0x47')]},'raw':!![]});}})[_0xe6ed('0x1a')](function(_0x2d0426){if(_0x2724bc['type'][_0xe6ed('0x52')]()=='STUN'){var _0x5a93fa=fs[_0xe6ed('0x54')](path[_0xe6ed('0x55')](config[_0xe6ed('0x56')],'server/files/templates/stun_multiple.ejs'),_0xe6ed('0x58'));var _0x224353=ejs['render'](_0x5a93fa,{'networks':_0x2d0426||[]});fs[_0xe6ed('0x60')](_0xe6ed('0x5a'),_0x224353);return respondWithRpcPromise(_0xe6ed('0x5b'),_0xe6ed('0x31'),{'module':'res_stun_monitor.so'});}else if(_0x2724bc[_0xe6ed('0x47')]['toUpperCase']()==_0xe6ed('0x5e')){var _0x2320b0=fs[_0xe6ed('0x54')](path[_0xe6ed('0x55')](config[_0xe6ed('0x56')],_0xe6ed('0x5f')),'utf8');var _0x10e64e=ejs['render'](_0x2320b0,{'networks':_0x2d0426||[]});fs[_0xe6ed('0x60')]('/etc/asterisk/turn_xcally.conf',_0x10e64e);return respondWithRpcPromise(_0xe6ed('0x5b'),'destroy',{'module':'res_stun_monitor.so'});}else{var _0x49740a=fs[_0xe6ed('0x54')](path['join'](config[_0xe6ed('0x56')],'server/files/templates/network.ejs'),_0xe6ed('0x58'));var _0x54f5e3=ejs[_0xe6ed('0x59')](_0x49740a,{'networks':_0x2d0426||[]});fs[_0xe6ed('0x60')](util[_0xe6ed('0x63')](_0xe6ed('0x64'),_0x1fa4ee['body'][_0xe6ed('0x47')][_0xe6ed('0x65')]()),_0x54f5e3);return respondWithRpcPromise(_0xe6ed('0x5b'),_0xe6ed('0x31'),{'module':_0xe6ed('0x66')});}return null;})['catch'](handleError(_0x2c1d74,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index d7e52b1..2b5fe52 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 _0xac55=['path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x21ac31,_0x3dd9b7){var _0x3770d6=function(_0xbe82c8){while(--_0xbe82c8){_0x21ac31['push'](_0x21ac31['shift']());}};_0x3770d6(++_0x3dd9b7);}(_0xac55,0x1c8));var _0x5ac5=function(_0x1b09a5,_0x16710a){_0x1b09a5=_0x1b09a5-0x0;var _0x54bdec=_0xac55[_0x1b09a5];return _0x54bdec;};'use strict';var _=require(_0x5ac5('0x0'));var util=require(_0x5ac5('0x1'));var logger=require(_0x5ac5('0x2'))(_0x5ac5('0x3'));var moment=require('moment');var BPromise=require(_0x5ac5('0x4'));var rp=require(_0x5ac5('0x5'));var fs=require('fs');var path=require(_0x5ac5('0x6'));var rimraf=require(_0x5ac5('0x7'));var config=require(_0x5ac5('0x8'));var attributes=require(_0x5ac5('0x9'));module[_0x5ac5('0xa')]=function(_0x52e117,_0x57f615){return _0x52e117[_0x5ac5('0xb')](_0x5ac5('0xc'),attributes,{'tableName':_0x5ac5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c76=['define','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x5c3f6e,_0x3ef9a9){var _0x3a196f=function(_0x1129ad){while(--_0x1129ad){_0x5c3f6e['push'](_0x5c3f6e['shift']());}};_0x3a196f(++_0x3ef9a9);}(_0x6c76,0x184));var _0x66c7=function(_0x5109f0,_0x4688ac){_0x5109f0=_0x5109f0-0x0;var _0x4a44aa=_0x6c76[_0x5109f0];return _0x4a44aa;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var logger=require(_0x66c7('0x2'))('api');var moment=require(_0x66c7('0x3'));var BPromise=require(_0x66c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var attributes=require('./network.attributes');module[_0x66c7('0x7')]=function(_0x45b0a5,_0x52f71b){return _0x45b0a5[_0x66c7('0x8')]('Network',attributes,{'tableName':'network','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 6fd9349..b3b6677 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x200241,_0x30b251){var _0x41f90b=function(_0x5bbf2a){while(--_0x5bbf2a){_0x200241['push'](_0x200241['shift']());}};_0x41f90b(++_0x30b251);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x31305e,_0x5d7f8d){_0x31305e=_0x31305e-0x0;var _0x1a916b=_0x7a54[_0x31305e];return _0x1a916b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 4942d27..6c10556 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 _0xad18=['removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','post','create','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions'];(function(_0x27b2b5,_0x4cca82){var _0xd729c5=function(_0x402f7f){while(--_0x402f7f){_0x27b2b5['push'](_0x27b2b5['shift']());}};_0xd729c5(++_0x4cca82);}(_0xad18,0x11b));var _0x8ad1=function(_0x1a3984,_0x492a1d){_0x1a3984=_0x1a3984-0x0;var _0x386311=_0xad18[_0x1a3984];return _0x386311;};'use strict';var multer=require(_0x8ad1('0x0'));var util=require(_0x8ad1('0x1'));var path=require(_0x8ad1('0x2'));var timeout=require(_0x8ad1('0x3'));var express=require(_0x8ad1('0x4'));var router=express[_0x8ad1('0x5')]();var fs_extra=require(_0x8ad1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8ad1('0x7'));var config=require(_0x8ad1('0x8'));var controller=require(_0x8ad1('0x9'));router[_0x8ad1('0xa')]('/',auth[_0x8ad1('0xb')](),controller['index']);router[_0x8ad1('0xa')](_0x8ad1('0xc'),auth[_0x8ad1('0xb')](),controller[_0x8ad1('0xd')]);router['get'](_0x8ad1('0xe'),auth[_0x8ad1('0xb')](),controller[_0x8ad1('0xf')]);router[_0x8ad1('0xa')](_0x8ad1('0x10'),auth[_0x8ad1('0xb')](),controller[_0x8ad1('0x11')]);router['get'](_0x8ad1('0x12'),auth[_0x8ad1('0xb')](),controller['getAnswers']);router[_0x8ad1('0xa')](_0x8ad1('0x13'),auth[_0x8ad1('0xb')](),controller[_0x8ad1('0x14')]);router[_0x8ad1('0xa')](_0x8ad1('0x15'),auth[_0x8ad1('0xb')](),controller['getInteractions']);router[_0x8ad1('0xa')]('/:id/users',auth[_0x8ad1('0xb')](),controller['getAgents']);router[_0x8ad1('0x16')]('/',auth['isAuthenticated'](),controller[_0x8ad1('0x17')]);router[_0x8ad1('0x16')](_0x8ad1('0x10'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x8ad1('0x16')](_0x8ad1('0x12'),auth[_0x8ad1('0xb')](),controller[_0x8ad1('0x18')]);router[_0x8ad1('0x16')](_0x8ad1('0x19'),controller[_0x8ad1('0x1a')]);router[_0x8ad1('0x16')](_0x8ad1('0x13'),auth[_0x8ad1('0xb')](),controller[_0x8ad1('0x1b')]);router['post'](_0x8ad1('0x1c'),auth[_0x8ad1('0xb')](),controller[_0x8ad1('0x1d')]);router[_0x8ad1('0x16')](_0x8ad1('0x1e'),auth[_0x8ad1('0xb')](),controller[_0x8ad1('0x1f')]);router[_0x8ad1('0x20')](_0x8ad1('0xe'),auth[_0x8ad1('0xb')](),controller[_0x8ad1('0x21')]);router[_0x8ad1('0x22')](_0x8ad1('0xe'),auth['isAuthenticated'](),controller[_0x8ad1('0x23')]);router[_0x8ad1('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8ad1('0x24')]);router[_0x8ad1('0x22')]('/:id/canned_answers',auth[_0x8ad1('0xb')](),controller[_0x8ad1('0x25')]);router[_0x8ad1('0x22')]('/:id/users',auth[_0x8ad1('0xb')](),controller[_0x8ad1('0x26')]);module[_0x8ad1('0x27')]=router; \ No newline at end of file +var _0x0cfe=['post','create','addDisposition','/:id/notify','addApplications','addAgents','/:id/send','send','put','/:id','destroy','delete','removeDispositions','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0cfe,0x14f));var _0xe0cf=function(_0x4ca1b4,_0x2dfaa7){_0x4ca1b4=_0x4ca1b4-0x0;var _0x33ed40=_0x0cfe[_0x4ca1b4];return _0x33ed40;};'use strict';var multer=require(_0xe0cf('0x0'));var util=require(_0xe0cf('0x1'));var path=require(_0xe0cf('0x2'));var timeout=require('connect-timeout');var express=require(_0xe0cf('0x3'));var router=express[_0xe0cf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe0cf('0x5'));var interaction=require(_0xe0cf('0x6'));var config=require(_0xe0cf('0x7'));var controller=require(_0xe0cf('0x8'));router[_0xe0cf('0x9')]('/',auth[_0xe0cf('0xa')](),controller[_0xe0cf('0xb')]);router[_0xe0cf('0x9')](_0xe0cf('0xc'),auth[_0xe0cf('0xa')](),controller[_0xe0cf('0xd')]);router[_0xe0cf('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0cf('0xe')]);router[_0xe0cf('0x9')](_0xe0cf('0xf'),auth['isAuthenticated'](),controller[_0xe0cf('0x10')]);router['get'](_0xe0cf('0x11'),auth['isAuthenticated'](),controller[_0xe0cf('0x12')]);router[_0xe0cf('0x9')](_0xe0cf('0x13'),auth['isAuthenticated'](),controller[_0xe0cf('0x14')]);router[_0xe0cf('0x9')](_0xe0cf('0x15'),auth[_0xe0cf('0xa')](),controller[_0xe0cf('0x16')]);router[_0xe0cf('0x9')](_0xe0cf('0x17'),auth[_0xe0cf('0xa')](),controller[_0xe0cf('0x18')]);router[_0xe0cf('0x19')]('/',auth[_0xe0cf('0xa')](),controller[_0xe0cf('0x1a')]);router[_0xe0cf('0x19')](_0xe0cf('0xf'),auth[_0xe0cf('0xa')](),controller[_0xe0cf('0x1b')]);router['post'](_0xe0cf('0x11'),auth[_0xe0cf('0xa')](),controller['addAnswer']);router[_0xe0cf('0x19')](_0xe0cf('0x1c'),controller['notify']);router[_0xe0cf('0x19')](_0xe0cf('0x13'),auth[_0xe0cf('0xa')](),controller[_0xe0cf('0x1d')]);router[_0xe0cf('0x19')](_0xe0cf('0x17'),auth[_0xe0cf('0xa')](),controller[_0xe0cf('0x1e')]);router[_0xe0cf('0x19')](_0xe0cf('0x1f'),auth[_0xe0cf('0xa')](),controller[_0xe0cf('0x20')]);router[_0xe0cf('0x21')](_0xe0cf('0x22'),auth[_0xe0cf('0xa')](),controller['update']);router['delete'](_0xe0cf('0x22'),auth[_0xe0cf('0xa')](),controller[_0xe0cf('0x23')]);router[_0xe0cf('0x24')](_0xe0cf('0xf'),auth[_0xe0cf('0xa')](),controller[_0xe0cf('0x25')]);router[_0xe0cf('0x24')](_0xe0cf('0x11'),auth[_0xe0cf('0xa')](),controller['removeAnswers']);router['delete'](_0xe0cf('0x17'),auth[_0xe0cf('0xa')](),controller[_0xe0cf('0x26')]);module[_0xe0cf('0x27')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 54bc502..36ad347 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 _0x55b2=['setDataValue','mandatoryDisposition','STRING','name','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x55b2,0x1b2));var _0x255b=function(_0x19e55c,_0x2372f8){_0x19e55c=_0x19e55c-0x0;var _0x4c81d4=_0x55b2[_0x19e55c];return _0x4c81d4;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x255b('0x0')],'unique':_0x255b('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x255b('0x0')]},'token':{'type':Sequelize[_0x255b('0x0')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x255b('0x2')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x255b('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x255b('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x255b('0x0')]},'queueTransfer':{'type':Sequelize[_0x255b('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x255b('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x255b('0x4')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x255b('0x3')],'defaultValue':![],'comment':_0x255b('0x5'),'set':function(_0x49b336){if(!_0x49b336)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x255b('0x6')](_0x255b('0x7'),_0x49b336);}}}; \ No newline at end of file +var _0x78bb=['setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','generate','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x78bb,0x199));var _0xb78b=function(_0x11dfbb,_0x1f4c8a){_0x11dfbb=_0x11dfbb-0x0;var _0x22d016=_0x78bb[_0x11dfbb];return _0x22d016;};'use strict';var Sequelize=require(_0xb78b('0x0'));var rs=require(_0xb78b('0x1'));module['exports']={'name':{'type':Sequelize[_0xb78b('0x2')],'unique':_0xb78b('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xb78b('0x2')]},'token':{'type':Sequelize[_0xb78b('0x2')],'defaultValue':function(){return rs[_0xb78b('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb78b('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb78b('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb78b('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb78b('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb78b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xb78b('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb78b('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb78b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb78b('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb78b('0x6')],'defaultValue':![],'comment':_0xb78b('0x8'),'set':function(_0x5cf3b0){if(!_0x5cf3b0)this[_0xb78b('0x9')](_0xb78b('0xa'),null);this[_0xb78b('0x9')]('mandatoryDisposition',_0x5cf3b0);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 863c112..3adafff 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 _0xbe04=['spread','messageId','interaction','created','autoclose','push','close','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','notify','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','send','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','defaults','out','OpenchannelMessage','Messages','dataValues','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','OpenchannelAccounts','end','sendStatus','name','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','Pause','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','findAll','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','DESC','OpenchannelApplication','Applications','List','account','applications','orderBy','priority','asc','Contacts','ListId','contact','lastName','threadId','externalUrl','OpenchannelInteraction'];(function(_0x584397,_0x382060){var _0x4fc24d=function(_0x21dc21){while(--_0x21dc21){_0x584397['push'](_0x584397['shift']());}};_0x4fc24d(++_0x382060);}(_0xbe04,0xf6));var _0x4be0=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0xbe04[_0x39bc44];return _0x2916d8;};'use strict';var emlformat=require(_0x4be0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4be0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4be0('0x2'));var moment=require(_0x4be0('0x3'));var BPromise=require(_0x4be0('0x4'));var Mustache=require(_0x4be0('0x5'));var util=require(_0x4be0('0x6'));var path=require(_0x4be0('0x7'));var sox=require('sox');var csv=require(_0x4be0('0x8'));var ejs=require(_0x4be0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4be0('0xa'));var squel=require(_0x4be0('0xb'));var crypto=require(_0x4be0('0xc'));var jsforce=require(_0x4be0('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4be0('0xe'));var Redis=require(_0x4be0('0xf'));var authService=require(_0x4be0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4be0('0x11'));var logger=require(_0x4be0('0x12'))(_0x4be0('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4be0('0x14'));var db=require(_0x4be0('0x15'))['db'];config[_0x4be0('0x16')]=_['defaults'](config[_0x4be0('0x16')],{'host':_0x4be0('0x17'),'port':0x18eb});var socket=require(_0x4be0('0x18'))(new Redis(config[_0x4be0('0x16')]));require(_0x4be0('0x19'))[_0x4be0('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4be0('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x4be0('0x1b')][_0x4be0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x562f89,_0x150c4f,_0x521411,_0x477fb6){return new BPromise(function(_0x5d03b7,_0x3b172a){var _0x2abac1=_0x477fb6||client;return _0x2abac1[_0x4be0('0x1d')](_0x562f89,_0x521411)[_0x4be0('0x1e')](function(_0x33d130){logger[_0x4be0('0x1f')](_0x4be0('0x20'),_0x150c4f,_0x4be0('0x21'));logger['debug'](_0x4be0('0x22'),_0x150c4f,_0x4be0('0x21'),JSON[_0x4be0('0x23')](_0x33d130));if(_0x33d130['error']){if(_0x33d130['error']['code']===0x1f4){logger['error'](_0x4be0('0x20'),_0x150c4f,_0x33d130[_0x4be0('0x24')][_0x4be0('0x25')]);return _0x3b172a(_0x33d130['error'][_0x4be0('0x25')]);}logger['error'](_0x4be0('0x20'),_0x150c4f,_0x33d130[_0x4be0('0x24')][_0x4be0('0x25')]);return _0x5d03b7(_0x33d130[_0x4be0('0x24')][_0x4be0('0x25')]);}else{logger['info'](_0x4be0('0x20'),_0x150c4f,_0x4be0('0x21'));_0x5d03b7(_0x33d130['result']['message']);}})[_0x4be0('0x26')](function(_0x13b971){logger[_0x4be0('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x150c4f,_0x13b971);_0x3b172a(_0x13b971);});});}function respondWithStatusCode(_0x51c911,_0x411434){_0x411434=_0x411434||0xcc;return function(_0x529d91){if(_0x529d91){return _0x51c911['sendStatus'](_0x411434);}return _0x51c911[_0x4be0('0x27')](_0x411434)['end']();};}function respondWithResult(_0x1f8af3,_0x3dccaa){_0x3dccaa=_0x3dccaa||0xc8;return function(_0x5e4535){if(_0x5e4535){return _0x1f8af3[_0x4be0('0x27')](_0x3dccaa)[_0x4be0('0x28')](_0x5e4535);}};}function respondWithFilteredResult(_0xd900c0,_0x5cb68e){return function(_0x2d1ddc){if(_0x2d1ddc){var _0xf03e9a=typeof _0x5cb68e[_0x4be0('0x29')]===_0x4be0('0x2a')&&typeof _0x5cb68e[_0x4be0('0x2b')]===_0x4be0('0x2a');var _0x57a799=_0x2d1ddc[_0x4be0('0x2c')];var _0x1278fa=_0xf03e9a?0x0:_0x5cb68e[_0x4be0('0x29')];var _0x266f94=_0xf03e9a?_0x2d1ddc['count']:_0x5cb68e[_0x4be0('0x29')]+_0x5cb68e[_0x4be0('0x2b')];var _0x54529a;if(_0x266f94>=_0x57a799){_0x266f94=_0x57a799;_0x54529a=0xc8;}else{_0x54529a=0xce;}_0xd900c0[_0x4be0('0x27')](_0x54529a);return _0xd900c0[_0x4be0('0x2d')](_0x4be0('0x2e'),_0x1278fa+'-'+_0x266f94+'/'+_0x57a799)[_0x4be0('0x28')](_0x2d1ddc);}return null;};}function patchUpdates(_0x3a2175){return function(_0x2bef20){try{jsonpatch[_0x4be0('0x2f')](_0x2bef20,_0x3a2175,!![]);}catch(_0x532137){return BPromise[_0x4be0('0x30')](_0x532137);}return _0x2bef20[_0x4be0('0x31')]();};}function saveUpdates(_0x3db9f3,_0x1474e9){return function(_0x2e52b5){if(_0x2e52b5){return _0x2e52b5[_0x4be0('0x32')](_0x3db9f3)[_0x4be0('0x1e')](function(_0x436555){return _0x436555;});}return null;};}function removeEntity(_0x5dd29b,_0x6fd814){return function(_0x2f4347){if(_0x2f4347){return _0x2f4347[_0x4be0('0x33')]()[_0x4be0('0x1e')](function(){var _0x13504a=_0x2f4347['get']({'plain':!![]});var _0x1c04d5=_0x4be0('0x34');return db['UserProfileResource'][_0x4be0('0x33')]({'where':{'type':_0x1c04d5,'resourceId':_0x13504a['id']}})[_0x4be0('0x1e')](function(){return _0x2f4347;});})[_0x4be0('0x1e')](function(){_0x5dd29b[_0x4be0('0x27')](0xcc)[_0x4be0('0x35')]();});}};}function handleEntityNotFound(_0x2dfb1e,_0x15c4fd){return function(_0x57774b){if(!_0x57774b){_0x2dfb1e[_0x4be0('0x36')](0x194);}return _0x57774b;};}function handleError(_0x505e03,_0x302f50){_0x302f50=_0x302f50||0x1f4;return function(_0x3022c5){logger['error'](_0x3022c5['stack']);if(_0x3022c5[_0x4be0('0x37')]){delete _0x3022c5['name'];}_0x505e03[_0x4be0('0x27')](_0x302f50)['send'](_0x3022c5);};}exports[_0x4be0('0x38')]=function(_0x4ccfe7,_0x17f665){var _0x58fe34={'include':[{'model':db['Pause'],'as':_0x4be0('0x39')}]},_0x766a36={},_0x11a5c2={'count':0x0,'rows':[]};var _0x4818ad=_[_0x4be0('0x3a')](db[_0x4be0('0x3b')][_0x4be0('0x3c')],function(_0xc6ce67){return{'name':_0xc6ce67[_0x4be0('0x3d')],'type':_0xc6ce67[_0x4be0('0x3e')][_0x4be0('0x3f')]};});_0x766a36[_0x4be0('0x40')]=_[_0x4be0('0x3a')](_0x4818ad,_0x4be0('0x37'));_0x766a36[_0x4be0('0x41')]=_[_0x4be0('0x42')](_0x4ccfe7['query']);_0x766a36['filters']=_[_0x4be0('0x43')](_0x766a36['model'],_0x766a36[_0x4be0('0x41')]);_0x58fe34['attributes']=_[_0x4be0('0x43')](_0x766a36[_0x4be0('0x40')],qs[_0x4be0('0x44')](_0x4ccfe7[_0x4be0('0x41')][_0x4be0('0x44')]));_0x58fe34[_0x4be0('0x45')]=_0x58fe34[_0x4be0('0x45')][_0x4be0('0x46')]?_0x58fe34['attributes']:_0x766a36['model'];if(!_0x4ccfe7[_0x4be0('0x41')][_0x4be0('0x47')]('nolimit')){_0x58fe34[_0x4be0('0x2b')]=qs[_0x4be0('0x2b')](_0x4ccfe7[_0x4be0('0x41')]['limit']);_0x58fe34[_0x4be0('0x29')]=qs[_0x4be0('0x29')](_0x4ccfe7['query']['offset']);}_0x58fe34[_0x4be0('0x48')]=qs[_0x4be0('0x49')](_0x4ccfe7[_0x4be0('0x41')][_0x4be0('0x49')]);_0x58fe34[_0x4be0('0x4a')]=qs['filters'](_[_0x4be0('0x4b')](_0x4ccfe7[_0x4be0('0x41')],_0x766a36[_0x4be0('0x4c')]),_0x4818ad);if(_0x4ccfe7[_0x4be0('0x41')][_0x4be0('0x4d')]){_0x58fe34['where']=_['merge'](_0x58fe34[_0x4be0('0x4a')],{'$or':_[_0x4be0('0x3a')](_0x4818ad,function(_0x2fd73f){if(_0x2fd73f[_0x4be0('0x3e')]!==_0x4be0('0x4e')){var _0x4a15b9={};_0x4a15b9[_0x2fd73f[_0x4be0('0x37')]]={'$like':'%'+_0x4ccfe7[_0x4be0('0x41')][_0x4be0('0x4d')]+'%'};return _0x4a15b9;}})});}_0x58fe34=_[_0x4be0('0x4f')]({},_0x58fe34,_0x4ccfe7[_0x4be0('0x50')]);var _0x18e70e={'where':_0x58fe34[_0x4be0('0x4a')]};return db[_0x4be0('0x3b')][_0x4be0('0x2c')](_0x18e70e)[_0x4be0('0x1e')](function(_0x42dcda){_0x11a5c2[_0x4be0('0x2c')]=_0x42dcda;if(_0x4ccfe7[_0x4be0('0x41')][_0x4be0('0x51')]){_0x58fe34[_0x4be0('0x52')]=[{'all':!![]}];}return db[_0x4be0('0x3b')]['findAll'](_0x58fe34);})[_0x4be0('0x1e')](function(_0xc7d55){_0x11a5c2[_0x4be0('0x53')]=_0xc7d55;return _0x11a5c2;})['then'](respondWithFilteredResult(_0x17f665,_0x58fe34))[_0x4be0('0x26')](handleError(_0x17f665,null));};exports[_0x4be0('0x54')]=function(_0x667583,_0x2a5896){var _0x427929={'raw':![],'where':{'id':_0x667583[_0x4be0('0x55')]['id']},'include':[{'model':db[_0x4be0('0x56')],'as':_0x4be0('0x39')}]},_0xd08fb7={};_0xd08fb7[_0x4be0('0x40')]=_['keys'](db[_0x4be0('0x3b')]['rawAttributes']);_0xd08fb7[_0x4be0('0x41')]=_[_0x4be0('0x42')](_0x667583[_0x4be0('0x41')]);_0xd08fb7['filters']=_[_0x4be0('0x43')](_0xd08fb7['model'],_0xd08fb7[_0x4be0('0x41')]);_0x427929[_0x4be0('0x45')]=_[_0x4be0('0x43')](_0xd08fb7[_0x4be0('0x40')],qs[_0x4be0('0x44')](_0x667583[_0x4be0('0x41')][_0x4be0('0x44')]));_0x427929['attributes']=_0x427929[_0x4be0('0x45')][_0x4be0('0x46')]?_0x427929[_0x4be0('0x45')]:_0xd08fb7[_0x4be0('0x40')];if(_0x667583[_0x4be0('0x41')][_0x4be0('0x51')]){_0x427929[_0x4be0('0x52')]=[{'all':!![]}];}_0x427929=_['merge']({},_0x427929,_0x667583[_0x4be0('0x50')]);return db[_0x4be0('0x3b')]['find'](_0x427929)[_0x4be0('0x1e')](handleEntityNotFound(_0x2a5896,null))[_0x4be0('0x1e')](respondWithResult(_0x2a5896,null))['catch'](handleError(_0x2a5896,null));};exports[_0x4be0('0x57')]=function(_0x333440,_0x394b32){return db[_0x4be0('0x3b')][_0x4be0('0x57')](_0x333440[_0x4be0('0x58')],{})['then'](function(_0x100c6f){var _0x3a9406=_0x333440[_0x4be0('0x59')][_0x4be0('0x5a')]({'plain':!![]});if(!_0x3a9406)throw new Error(_0x4be0('0x5b'));if(_0x3a9406[_0x4be0('0x5c')]===_0x4be0('0x59')){var _0x481890=_0x100c6f[_0x4be0('0x5a')]({'plain':!![]});var _0x3b8869='OpenchannelAccounts';return db[_0x4be0('0x5d')][_0x4be0('0x5e')]({'where':{'name':_0x3b8869,'userProfileId':_0x3a9406[_0x4be0('0x5f')]},'raw':!![]})['then'](function(_0x33cd7e){if(_0x33cd7e&&_0x33cd7e[_0x4be0('0x60')]===0x0){return db['UserProfileResource'][_0x4be0('0x57')]({'name':_0x481890['name'],'resourceId':_0x481890['id'],'type':_0x33cd7e[_0x4be0('0x37')],'sectionId':_0x33cd7e['id']},{})['then'](function(){return _0x100c6f;});}else{return _0x100c6f;}})[_0x4be0('0x26')](function(_0x422c10){logger[_0x4be0('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x422c10);throw _0x422c10;});}return _0x100c6f;})[_0x4be0('0x1e')](respondWithResult(_0x394b32,0xc9))['catch'](handleError(_0x394b32,null));};exports['update']=function(_0x4523f3,_0x580027){if(_0x4523f3['body']['id']){delete _0x4523f3[_0x4be0('0x58')]['id'];}return db['OpenchannelAccount'][_0x4be0('0x5e')]({'where':{'id':_0x4523f3[_0x4be0('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x4be0('0x39')}]})[_0x4be0('0x1e')](handleEntityNotFound(_0x580027,null))[_0x4be0('0x1e')](saveUpdates(_0x4523f3[_0x4be0('0x58')],null))['then'](respondWithResult(_0x580027,null))['catch'](handleError(_0x580027,null));};exports[_0x4be0('0x33')]=function(_0x18f2ea,_0x5d1873){return db['OpenchannelAccount'][_0x4be0('0x5e')]({'where':{'id':_0x18f2ea['params']['id']}})[_0x4be0('0x1e')](handleEntityNotFound(_0x5d1873,null))[_0x4be0('0x1e')](removeEntity(_0x5d1873,null))[_0x4be0('0x26')](handleError(_0x5d1873,null));};exports[_0x4be0('0x61')]=function(_0x2f26bc,_0x572788){return db[_0x4be0('0x3b')][_0x4be0('0x61')]()['then'](respondWithResult(_0x572788,null))[_0x4be0('0x26')](handleError(_0x572788,null));};exports['addDisposition']=function(_0x3d84ae,_0x20db28,_0x182a9e){if(_0x3d84ae[_0x4be0('0x58')]['id']){delete _0x3d84ae[_0x4be0('0x58')]['id'];}return db['OpenchannelAccount'][_0x4be0('0x5e')]({'where':{'id':_0x3d84ae[_0x4be0('0x55')]['id']}})[_0x4be0('0x1e')](handleEntityNotFound(_0x20db28,null))[_0x4be0('0x1e')](function(_0x4e837a){if(_0x4e837a){_0x3d84ae[_0x4be0('0x58')]['OpenchannelAccountId']=_0x4e837a['id'];return db[_0x4be0('0x62')][_0x4be0('0x57')](_0x3d84ae['body']);}})[_0x4be0('0x1e')](respondWithResult(_0x20db28,null))[_0x4be0('0x26')](handleError(_0x20db28,null));};exports[_0x4be0('0x63')]=function(_0x431547,_0x182e7a,_0x423bd9){var _0xd5c900={'raw':![],'where':{}};var _0x527c1e={};var _0x4092e6={'count':0x0,'rows':[]};return db[_0x4be0('0x3b')][_0x4be0('0x64')]({'where':{'id':_0x431547[_0x4be0('0x55')]['id']}})[_0x4be0('0x1e')](handleEntityNotFound(_0x182e7a,null))[_0x4be0('0x1e')](function(_0x134bba){if(_0x134bba){_0x527c1e['model']=_[_0x4be0('0x42')](db[_0x4be0('0x62')][_0x4be0('0x3c')]);_0x527c1e[_0x4be0('0x41')]=_[_0x4be0('0x42')](_0x431547[_0x4be0('0x41')]);_0x527c1e[_0x4be0('0x4c')]=_[_0x4be0('0x43')](_0x527c1e['model'],_0x527c1e[_0x4be0('0x41')]);_0xd5c900[_0x4be0('0x45')]=_['intersection'](_0x527c1e[_0x4be0('0x40')],qs[_0x4be0('0x44')](_0x431547[_0x4be0('0x41')][_0x4be0('0x44')]));_0xd5c900['attributes']=_0xd5c900[_0x4be0('0x45')]['length']?_0xd5c900[_0x4be0('0x45')]:_0x527c1e[_0x4be0('0x40')];if(!_0x431547[_0x4be0('0x41')][_0x4be0('0x47')](_0x4be0('0x65'))){_0xd5c900[_0x4be0('0x2b')]=qs[_0x4be0('0x2b')](_0x431547[_0x4be0('0x41')][_0x4be0('0x2b')]);_0xd5c900['offset']=qs[_0x4be0('0x29')](_0x431547[_0x4be0('0x41')]['offset']);}_0xd5c900['order']=qs[_0x4be0('0x49')](_0x431547['query'][_0x4be0('0x49')]);_0xd5c900[_0x4be0('0x4a')]=qs[_0x4be0('0x4c')](_['pick'](_0x431547[_0x4be0('0x41')],_0x527c1e[_0x4be0('0x4c')]));_0xd5c900['where']['OpenchannelAccountId']=_0x134bba['id'];if(_0x431547[_0x4be0('0x41')][_0x4be0('0x4d')]){_0xd5c900['where']=_[_0x4be0('0x4f')](_0xd5c900[_0x4be0('0x4a')],{'$or':_[_0x4be0('0x3a')](_0xd5c900[_0x4be0('0x45')],function(_0x41c19e){var _0x3dd6ac={};_0x3dd6ac[_0x41c19e]={'$like':'%'+_0x431547[_0x4be0('0x41')][_0x4be0('0x4d')]+'%'};return _0x3dd6ac;})});}_0xd5c900=_[_0x4be0('0x4f')]({},_0xd5c900,_0x431547[_0x4be0('0x50')]);return db['Disposition'][_0x4be0('0x2c')]({'where':_0xd5c900[_0x4be0('0x4a')]})[_0x4be0('0x1e')](function(_0x2dd78b){_0x4092e6[_0x4be0('0x2c')]=_0x2dd78b;if(_0x431547['query'][_0x4be0('0x51')]){_0xd5c900['include']=[{'all':!![]}];}return db[_0x4be0('0x62')]['findAll'](_0xd5c900);})[_0x4be0('0x1e')](function(_0x51b916){_0x4092e6[_0x4be0('0x53')]=_0x51b916;return _0x4092e6;});}})[_0x4be0('0x1e')](respondWithFilteredResult(_0x182e7a,_0xd5c900))[_0x4be0('0x26')](handleError(_0x182e7a,null));};exports[_0x4be0('0x66')]=function(_0x4a1e84,_0x3605fe,_0x2368a4){return db[_0x4be0('0x3b')][_0x4be0('0x5e')]({'where':{'id':_0x4a1e84[_0x4be0('0x55')]['id']}})[_0x4be0('0x1e')](handleEntityNotFound(_0x3605fe,null))[_0x4be0('0x1e')](function(_0x507646){if(_0x507646){return _0x507646['removeDispositions'](_0x4a1e84[_0x4be0('0x41')][_0x4be0('0x67')]);}})[_0x4be0('0x1e')](respondWithStatusCode(_0x3605fe,null))['catch'](handleError(_0x3605fe,null));};exports[_0x4be0('0x68')]=function(_0x4f3473,_0x59fc5c,_0x4050c6){if(_0x4f3473[_0x4be0('0x58')]['id']){delete _0x4f3473['body']['id'];}return db[_0x4be0('0x3b')]['find']({'where':{'id':_0x4f3473[_0x4be0('0x55')]['id']}})['then'](handleEntityNotFound(_0x59fc5c,null))[_0x4be0('0x1e')](function(_0x3ee3c5){if(_0x3ee3c5){_0x4f3473[_0x4be0('0x58')][_0x4be0('0x69')]=_0x3ee3c5['id'];return db[_0x4be0('0x6a')]['create'](_0x4f3473[_0x4be0('0x58')]);}})[_0x4be0('0x1e')](respondWithResult(_0x59fc5c,null))['catch'](handleError(_0x59fc5c,null));};exports[_0x4be0('0x6b')]=function(_0x118eb2,_0x3236ba,_0x1853a2){var _0x8effdd={'raw':![],'where':{}};var _0x474536={};var _0x2ad20d={'count':0x0,'rows':[]};return db[_0x4be0('0x3b')]['findOne']({'where':{'id':_0x118eb2['params']['id']}})[_0x4be0('0x1e')](handleEntityNotFound(_0x3236ba,null))[_0x4be0('0x1e')](function(_0x37f6fb){if(_0x37f6fb){_0x474536[_0x4be0('0x40')]=_[_0x4be0('0x42')](db[_0x4be0('0x6a')][_0x4be0('0x3c')]);_0x474536[_0x4be0('0x41')]=_[_0x4be0('0x42')](_0x118eb2[_0x4be0('0x41')]);_0x474536['filters']=_[_0x4be0('0x43')](_0x474536['model'],_0x474536[_0x4be0('0x41')]);_0x8effdd[_0x4be0('0x45')]=_[_0x4be0('0x43')](_0x474536['model'],qs[_0x4be0('0x44')](_0x118eb2[_0x4be0('0x41')]['fields']));_0x8effdd[_0x4be0('0x45')]=_0x8effdd[_0x4be0('0x45')][_0x4be0('0x46')]?_0x8effdd['attributes']:_0x474536[_0x4be0('0x40')];if(!_0x118eb2[_0x4be0('0x41')]['hasOwnProperty'](_0x4be0('0x65'))){_0x8effdd['limit']=qs[_0x4be0('0x2b')](_0x118eb2['query']['limit']);_0x8effdd['offset']=qs['offset'](_0x118eb2[_0x4be0('0x41')][_0x4be0('0x29')]);}_0x8effdd[_0x4be0('0x48')]=qs[_0x4be0('0x49')](_0x118eb2[_0x4be0('0x41')][_0x4be0('0x49')]);_0x8effdd[_0x4be0('0x4a')]=qs[_0x4be0('0x4c')](_[_0x4be0('0x4b')](_0x118eb2['query'],_0x474536[_0x4be0('0x4c')]));_0x8effdd['where'][_0x4be0('0x69')]=_0x37f6fb['id'];if(_0x118eb2[_0x4be0('0x41')][_0x4be0('0x4d')]){_0x8effdd[_0x4be0('0x4a')]=_[_0x4be0('0x4f')](_0x8effdd[_0x4be0('0x4a')],{'$or':_[_0x4be0('0x3a')](_0x8effdd['attributes'],function(_0x2cae38){var _0x30146f={};_0x30146f[_0x2cae38]={'$like':'%'+_0x118eb2['query']['filter']+'%'};return _0x30146f;})});}_0x8effdd=_[_0x4be0('0x4f')]({},_0x8effdd,_0x118eb2[_0x4be0('0x50')]);return db[_0x4be0('0x6a')]['count']({'where':_0x8effdd[_0x4be0('0x4a')]})[_0x4be0('0x1e')](function(_0x304ea7){_0x2ad20d['count']=_0x304ea7;if(_0x118eb2[_0x4be0('0x41')]['includeAll']){_0x8effdd[_0x4be0('0x52')]=[{'all':!![]}];}return db[_0x4be0('0x6a')][_0x4be0('0x6c')](_0x8effdd);})['then'](function(_0x392b88){_0x2ad20d[_0x4be0('0x53')]=_0x392b88;return _0x2ad20d;});}})['then'](respondWithFilteredResult(_0x3236ba,_0x8effdd))[_0x4be0('0x26')](handleError(_0x3236ba,null));};exports[_0x4be0('0x6d')]=function(_0x2a5d9b,_0x173390,_0x4adcfb){return db[_0x4be0('0x3b')]['find']({'where':{'id':_0x2a5d9b[_0x4be0('0x55')]['id']}})['then'](handleEntityNotFound(_0x173390,null))[_0x4be0('0x1e')](function(_0x4c6de0){if(_0x4c6de0){return _0x4c6de0[_0x4be0('0x6d')](_0x2a5d9b[_0x4be0('0x41')][_0x4be0('0x67')]);}})['then'](respondWithStatusCode(_0x173390,null))['catch'](handleError(_0x173390,null));};exports['notify']=function(_0x310a54,_0x342a55,_0x30ff43){var _0x42b92d={'body':_0x310a54[_0x4be0('0x58')],'channel':_0x4be0('0x6e')};var _0x27c1ac=[];var _0x2717ca=[];var _0x1b7bd8={};var _0x817049=![];return db[_0x4be0('0x6f')]['describe']()['then'](function(_0x4edb0a){if(!_0x4edb0a){throw new db[(_0x4be0('0x70'))][(_0x4be0('0x71'))](_0x4be0('0x72'));}_0x27c1ac=_[_0x4be0('0x73')](_[_0x4be0('0x42')](_0x4edb0a),[_0x4be0('0x74'),'updatedAt']);_0x2717ca=_[_0x4be0('0x73')](_['keys'](_0x4edb0a),[_0x4be0('0x74'),_0x4be0('0x75'),_0x4be0('0x76'),'ListId']);if(_0x310a54[_0x4be0('0x58')]['id']){delete _0x310a54[_0x4be0('0x58')]['id'];}if(_['isNil'](_0x310a54['body']['from'])){throw new db[(_0x4be0('0x70'))][(_0x4be0('0x71'))](_0x4be0('0x77'));}if(_[_0x4be0('0x78')](_0x310a54['body'][_0x4be0('0x58')])||_0x310a54[_0x4be0('0x58')][_0x4be0('0x58')]===''){throw new db[(_0x4be0('0x70'))][(_0x4be0('0x71'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4be0('0x78')](_0x310a54[_0x4be0('0x58')][_0x4be0('0x79')])){throw new db['Sequelize'][(_0x4be0('0x71'))](_0x4be0('0x7a')+_0x2717ca);}if(!_[_0x4be0('0x7b')](_0x2717ca,_0x310a54[_0x4be0('0x58')]['mapKey'])){throw new db[(_0x4be0('0x70'))][(_0x4be0('0x71'))](_0x4be0('0x7c')+_0x2717ca);}_0x1b7bd8[_0x310a54['body'][_0x4be0('0x79')]]=_0x310a54[_0x4be0('0x58')][_0x4be0('0x7d')];})['then'](function(){return db[_0x4be0('0x3b')][_0x4be0('0x5e')]({'where':{'id':_0x310a54['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x4be0('0x6f')],'as':'Contacts','where':_0x1b7bd8,'limit':0x1,'order':[[_0x4be0('0x75'),_0x4be0('0x7e')]]}]},{'model':db[_0x4be0('0x7f')],'as':_0x4be0('0x80')}]});})[_0x4be0('0x1e')](handleEntityNotFound(_0x342a55,null))[_0x4be0('0x1e')](function(_0x216ccc){if(_0x216ccc&&_0x216ccc[_0x4be0('0x81')]){_0x42b92d[_0x4be0('0x82')]=_0x216ccc;_0x42b92d[_0x4be0('0x83')]=_0x216ccc['Applications'];_0x42b92d['list']=_0x216ccc[_0x4be0('0x81')];_0x42b92d['applications']=_[_0x4be0('0x84')](_0x42b92d[_0x4be0('0x83')],[_0x4be0('0x85')],[_0x4be0('0x86')]);if(_0x42b92d[_0x4be0('0x82')]['Applications']){delete _0x42b92d['account'][_0x4be0('0x80')];}if(_0x42b92d[_0x4be0('0x82')][_0x4be0('0x81')]&&_0x42b92d[_0x4be0('0x82')]['List']['Contacts'][_0x4be0('0x46')]){return _0x42b92d[_0x4be0('0x82')][_0x4be0('0x81')][_0x4be0('0x87')][0x0];}var _0x4b20b6=_['defaults'](_0x310a54['body'],{'firstName':_0x310a54[_0x4be0('0x58')][_0x4be0('0x7d')],'ListId':_0x216ccc[_0x4be0('0x88')]});_0x4b20b6[_0x310a54[_0x4be0('0x58')]['mapKey']]=_0x310a54[_0x4be0('0x58')][_0x4be0('0x7d')];return db['CmContact']['create'](_0x4b20b6,{'fields':_0x27c1ac,'raw':!![]});}})[_0x4be0('0x1e')](handleEntityNotFound(_0x342a55,null))[_0x4be0('0x1e')](function(_0x3ac178){_0x42b92d[_0x4be0('0x89')]=_0x3ac178;if(_0x3ac178){var _0x324d57={'ContactId':_0x3ac178['id'],'OpenchannelAccountId':_0x310a54[_0x4be0('0x55')]['id'],'from':(_0x3ac178['firstName']||'')+'\x20'+(_0x3ac178[_0x4be0('0x8a')]||'')};var _0x5cf057={'OpenchannelAccountId':_0x310a54[_0x4be0('0x55')]['id'],'closed':![]};if(_0x310a54[_0x4be0('0x58')]['threadId']){_0x5cf057[_0x4be0('0x8b')]=_0x310a54[_0x4be0('0x58')][_0x4be0('0x8b')];return db['OpenchannelInteraction'][_0x4be0('0x5e')]({'where':_0x5cf057})[_0x4be0('0x1e')](function(_0x397e5d){if(_0x397e5d){return[_0x397e5d,![]];}_0x324d57[_0x4be0('0x8b')]=_0x310a54['body'][_0x4be0('0x8b')];_0x324d57[_0x4be0('0x8c')]=_0x310a54[_0x4be0('0x58')][_0x4be0('0x8c')];return db[_0x4be0('0x8d')]['create'](_0x324d57)[_0x4be0('0x1e')](function(_0x1ecafa){return[_0x1ecafa,!![]];});});}else{_0x5cf057[_0x4be0('0x8b')]=null;}_0x5cf057['ContactId']=_0x3ac178['id'];return db['OpenchannelInteraction']['find']({'where':_0x5cf057})['then'](function(_0x4a85bb){if(_0x4a85bb){return[_0x4a85bb,![]];}return db[_0x4be0('0x8d')]['create'](_0x324d57)[_0x4be0('0x1e')](function(_0x4abd43){return[_0x4abd43,!![]];});});}})[_0x4be0('0x8e')](function(_0x4fb68,_0x258220){if(_0x4fb68){_0x817049=_0x258220;if(!_0x258220){var _0x43f38d={'from':(_0x42b92d[_0x4be0('0x89')]['firstName']||'')+'\x20'+(_0x42b92d[_0x4be0('0x89')][_0x4be0('0x8a')]||'')};if(_0x310a54[_0x4be0('0x58')][_0x4be0('0x8b')]&&_0x310a54[_0x4be0('0x58')][_0x4be0('0x8f')]&&_0x310a54[_0x4be0('0x58')][_0x4be0('0x8b')]!=_0x310a54[_0x4be0('0x58')][_0x4be0('0x8f')]){_0x43f38d[_0x4be0('0x8b')]=_0x310a54[_0x4be0('0x58')]['messageId'];}return _0x4fb68['update'](_0x43f38d);}else{return _0x4fb68;}}})['then'](function(_0x25b289){_0x42b92d[_0x4be0('0x90')]=_0x25b289[_0x4be0('0x5a')]({'plain':!![]});_0x42b92d[_0x4be0('0x90')][_0x4be0('0x91')]=_0x817049;if(_0x42b92d['interaction'][_0x4be0('0x91')]){if(_0x42b92d[_0x4be0('0x82')][_0x4be0('0x92')]){_0x42b92d['applications'][_0x4be0('0x93')]({'id':0x0,'priority':_0x42b92d['applications'][_0x4be0('0x46')]+0x1,'app':_0x4be0('0x94'),'appdata':'unmanaged','interval':_0x4be0('0x95')});}}return db['OpenchannelMessage'][_0x4be0('0x57')]({'body':_0x310a54[_0x4be0('0x58')][_0x4be0('0x58')],'OpenchannelAccountId':_0x310a54['params']['id'],'OpenchannelInteractionId':_0x25b289['id'],'direction':'in','ContactId':_0x42b92d[_0x4be0('0x89')]['id'],'AttachmentId':_0x310a54[_0x4be0('0x58')][_0x4be0('0x96')]});})['then'](function(_0x34a4df){_0x42b92d[_0x4be0('0x25')]=_0x34a4df;if(_0x42b92d['interaction'][_0x4be0('0x97')]){return db[_0x4be0('0x98')][_0x4be0('0x5e')]({'attributes':['id',_0x4be0('0x37')],'where':{'id':_0x42b92d['interaction'][_0x4be0('0x97')]}})[_0x4be0('0x1e')](function(_0x7c2894){if(_0x7c2894){_0x42b92d[_0x4be0('0x83')][_0x4be0('0x99')]({'id':0x0,'priority':0x0,'app':_0x4be0('0x9a'),'appdata':_0x7c2894[_0x4be0('0x37')]+','+(_0x42b92d[_0x4be0('0x82')][_0x4be0('0x9b')]||0xa),'interval':_0x4be0('0x95')});_0x42b92d[_0x4be0('0x9c')]=![];}return respondWithRpcPromise('Start','startRouting',_0x42b92d);});}return respondWithRpcPromise(_0x4be0('0x9d'),'startRouting',_0x42b92d);})['then'](function(_0x2aa015){respondWithRpcPromise('EventManager',_0x4be0('0x9e'),{'event':_0x4be0('0x9f'),'message':_0x2aa015},client9002);return _0x2aa015;})[_0x4be0('0x1e')](respondWithResult(_0x342a55,null))['catch'](handleError(_0x342a55,null));};exports[_0x4be0('0xa0')]=function(_0x214311,_0x2e8734){var _0xab10ae=_0x214311['params']['id'];var _0x156516=_0x214311[_0x4be0('0x58')];var _0x3e3117=0xc8;var _0x514618=null;return db[_0x4be0('0xa1')][_0x4be0('0xa2')]({'isolationLevel':db[_0x4be0('0xa1')][_0x4be0('0xa3')][_0x4be0('0xa4')][_0x4be0('0xa5')]},function(_0x538632){return db[_0x4be0('0x3b')][_0x4be0('0x64')]({'where':{'id':_0xab10ae},'transaction':_0x538632})['then'](function(_0x452cef){if(_0x452cef){return db[_0x4be0('0x7f')]['destroy']({'where':{'OpenchannelAccountId':_0xab10ae},'transaction':_0x538632})[_0x4be0('0x1e')](function(){var _0x24a635=_[_0x4be0('0x3a')](_0x156516,function(_0x41d93e){_0x41d93e[_0x4be0('0x69')]=_0xab10ae;return _0x41d93e;});return db['OpenchannelApplication']['bulkCreate'](_0x24a635,{'transaction':_0x538632});});}else{_0x3e3117=0x194;_0x514618=[];}});})[_0x4be0('0x1e')](function(){if(_0x3e3117!==0x194){return db['OpenchannelApplication'][_0x4be0('0xa6')]({'where':{'OpenchannelAccountId':_0xab10ae},'order':'priority'})[_0x4be0('0x1e')](function(_0x203c57){_0x514618=_0x203c57;});}})['catch'](function(_0x40e972){_0x3e3117=0x1f4;logger['error'](_0x40e972[_0x4be0('0xa7')]);if(_0x40e972[_0x4be0('0x37')]){delete _0x40e972['name'];}_0x514618=_0x40e972;})[_0x4be0('0xa8')](function(){if(_0x514618===null){_0x2e8734[_0x4be0('0x36')](_0x3e3117);}else{if(_0x3e3117===0x1f4){_0x2e8734['status'](_0x3e3117)[_0x4be0('0xa9')](_0x514618);}else{_0x2e8734[_0x4be0('0x27')](_0x3e3117)['json'](_0x514618);}}});};exports[_0x4be0('0xaa')]=function(_0x448793,_0x5a9613,_0x1213f2){var _0x1d63cf={};var _0x1dc76b={};var _0x5e1971;var _0x10961e;return db['OpenchannelAccount'][_0x4be0('0x64')]({'where':{'id':_0x448793[_0x4be0('0x55')]['id']}})[_0x4be0('0x1e')](handleEntityNotFound(_0x5a9613,null))[_0x4be0('0x1e')](function(_0x1ce904){if(_0x1ce904){_0x5e1971=_0x1ce904;_0x1dc76b[_0x4be0('0x40')]=_['keys'](db[_0x4be0('0x7f')]['rawAttributes']);_0x1dc76b[_0x4be0('0x41')]=_[_0x4be0('0x42')](_0x448793[_0x4be0('0x41')]);_0x1dc76b[_0x4be0('0x4c')]=_[_0x4be0('0x43')](_0x1dc76b[_0x4be0('0x40')],_0x1dc76b[_0x4be0('0x41')]);_0x1d63cf['attributes']=_['intersection'](_0x1dc76b[_0x4be0('0x40')],qs['fields'](_0x448793['query'][_0x4be0('0x44')]));_0x1d63cf[_0x4be0('0x45')]=_0x1d63cf[_0x4be0('0x45')][_0x4be0('0x46')]?_0x1d63cf[_0x4be0('0x45')]:_0x1dc76b[_0x4be0('0x40')];_0x1d63cf[_0x4be0('0x48')]=qs['sort'](_0x448793[_0x4be0('0x41')][_0x4be0('0x49')]);_0x1d63cf[_0x4be0('0x4a')]=qs[_0x4be0('0x4c')](_[_0x4be0('0x4b')](_0x448793['query'],_0x1dc76b[_0x4be0('0x4c')]));if(_0x448793['query'][_0x4be0('0x4d')]){_0x1d63cf[_0x4be0('0x4a')]=_['merge'](_0x1d63cf['where'],{'$or':_[_0x4be0('0x3a')](_0x1d63cf[_0x4be0('0x45')],function(_0x4ce017){var _0x3570cb={};_0x3570cb[_0x4ce017]={'$like':'%'+_0x448793[_0x4be0('0x41')][_0x4be0('0x4d')]+'%'};return _0x3570cb;})});}_0x1d63cf=_['merge']({},_0x1d63cf,_0x448793[_0x4be0('0x50')]);return _0x5e1971[_0x4be0('0xaa')](_0x1d63cf);}})[_0x4be0('0x1e')](function(_0x1b027f){if(_0x1b027f){_0x10961e=_0x1b027f[_0x4be0('0x46')];if(!_0x448793[_0x4be0('0x41')][_0x4be0('0x47')](_0x4be0('0x65'))){_0x1d63cf['limit']=qs['limit'](_0x448793[_0x4be0('0x41')][_0x4be0('0x2b')]);_0x1d63cf[_0x4be0('0x29')]=qs[_0x4be0('0x29')](_0x448793['query'][_0x4be0('0x29')]);}return _0x5e1971[_0x4be0('0xaa')](_0x1d63cf);}})[_0x4be0('0x1e')](function(_0x58ab87){if(_0x58ab87){return _0x58ab87?{'count':_0x10961e,'rows':_0x58ab87}:null;}})[_0x4be0('0x1e')](respondWithResult(_0x5a9613,null))[_0x4be0('0x26')](handleError(_0x5a9613,null));};exports[_0x4be0('0xab')]=function(_0x3a7a95,_0x498412,_0x267e8b){var _0x542104={'raw':![],'where':{}};var _0x5a9066={};var _0x280398={'count':0x0,'rows':[]};return db[_0x4be0('0x3b')]['findOne']({'where':{'id':_0x3a7a95[_0x4be0('0x55')]['id']}})[_0x4be0('0x1e')](handleEntityNotFound(_0x498412,null))[_0x4be0('0x1e')](function(_0x5a16a6){if(_0x5a16a6){_0x5a9066['model']=_[_0x4be0('0x42')](db[_0x4be0('0x8d')]['rawAttributes']);_0x5a9066[_0x4be0('0x41')]=_[_0x4be0('0x42')](_0x3a7a95[_0x4be0('0x41')]);_0x5a9066['filters']=_[_0x4be0('0x43')](_0x5a9066[_0x4be0('0x40')],_0x5a9066[_0x4be0('0x41')]);_0x542104[_0x4be0('0x45')]=_[_0x4be0('0x43')](_0x5a9066[_0x4be0('0x40')],qs['fields'](_0x3a7a95[_0x4be0('0x41')][_0x4be0('0x44')]));_0x542104[_0x4be0('0x45')]=_0x542104[_0x4be0('0x45')][_0x4be0('0x46')]?_0x542104[_0x4be0('0x45')]:_0x5a9066['model'];if(!_0x3a7a95[_0x4be0('0x41')][_0x4be0('0x47')](_0x4be0('0x65'))){_0x542104[_0x4be0('0x2b')]=qs[_0x4be0('0x2b')](_0x3a7a95[_0x4be0('0x41')][_0x4be0('0x2b')]);_0x542104[_0x4be0('0x29')]=qs[_0x4be0('0x29')](_0x3a7a95[_0x4be0('0x41')]['offset']);}_0x542104[_0x4be0('0x48')]=qs['sort'](_0x3a7a95[_0x4be0('0x41')][_0x4be0('0x49')]);_0x542104['where']=qs['filters'](_[_0x4be0('0x4b')](_0x3a7a95[_0x4be0('0x41')],_0x5a9066[_0x4be0('0x4c')]));_0x542104[_0x4be0('0x4a')][_0x4be0('0x69')]=_0x5a16a6['id'];if(_0x3a7a95['query']['filter']){_0x542104[_0x4be0('0x4a')]=_[_0x4be0('0x4f')](_0x542104[_0x4be0('0x4a')],{'$or':_[_0x4be0('0x3a')](_0x542104[_0x4be0('0x45')],function(_0x4e21b7){var _0x564847={};_0x564847[_0x4e21b7]={'$like':'%'+_0x3a7a95[_0x4be0('0x41')]['filter']+'%'};return _0x564847;})});}_0x542104=_[_0x4be0('0x4f')]({},_0x542104,_0x3a7a95[_0x4be0('0x50')]);return db[_0x4be0('0x8d')][_0x4be0('0x2c')]({'where':_0x542104[_0x4be0('0x4a')]})['then'](function(_0x2ac1b4){_0x280398['count']=_0x2ac1b4;if(_0x3a7a95[_0x4be0('0x41')]['includeAll']){_0x542104['include']=[{'model':db['CmContact'],'as':_0x4be0('0xac'),'required':![]},{'model':db[_0x4be0('0x98')],'as':_0x4be0('0xad'),'attributes':[_0x4be0('0x37'),_0x4be0('0xae'),_0x4be0('0xaf')],'required':![]},{'model':db[_0x4be0('0xb0')],'as':_0x4be0('0xb1'),'attributes':['id',_0x4be0('0x37'),_0x4be0('0xb2')],'where':_0x3a7a95['query']['tag']?{'id':_0x3a7a95[_0x4be0('0x41')][_0x4be0('0xb3')]}:undefined,'required':_0x3a7a95[_0x4be0('0x41')][_0x4be0('0xb3')]?!![]:![]}];}return db[_0x4be0('0x8d')]['findAll'](_0x542104);})[_0x4be0('0x1e')](function(_0x3f7550){_0x280398[_0x4be0('0x53')]=_0x3f7550;return _0x280398;});}})[_0x4be0('0x1e')](respondWithFilteredResult(_0x498412,_0x542104))['catch'](handleError(_0x498412,null));};exports[_0x4be0('0xb4')]=function(_0xc51f2c,_0x29e1a4,_0x2413c0){return db[_0x4be0('0x3b')][_0x4be0('0x5e')]({'where':{'id':_0xc51f2c[_0x4be0('0x55')]['id']}})[_0x4be0('0x1e')](handleEntityNotFound(_0x29e1a4,null))[_0x4be0('0x1e')](function(_0x1d7f32){if(_0x1d7f32){return _0x1d7f32[_0x4be0('0xb4')](_0xc51f2c[_0x4be0('0x58')][_0x4be0('0x67')],_[_0x4be0('0xb5')](_0xc51f2c[_0x4be0('0x58')],[_0x4be0('0x67'),'id'])||{})[_0x4be0('0x8e')](function(_0x53f729){for(var _0x162e6f=0x0;_0x162e6f<_0xc51f2c[_0x4be0('0x58')][_0x4be0('0x67')]['length'];_0x162e6f+=0x1){socket[_0x4be0('0xb6')](_0x4be0('0xb7'),{'UserId':Number(_0xc51f2c['body']['ids'][_0x162e6f]),'OpenchannelAccountId':Number(_0xc51f2c[_0x4be0('0x55')]['id'])});}return _0x53f729;});}})[_0x4be0('0x1e')](respondWithResult(_0x29e1a4,null))[_0x4be0('0x26')](handleError(_0x29e1a4,null));};exports[_0x4be0('0xb8')]=function(_0x10a5cc,_0x5a518d,_0x51be44){return db[_0x4be0('0x3b')][_0x4be0('0x5e')]({'where':{'id':_0x10a5cc[_0x4be0('0x55')]['id']}})[_0x4be0('0x1e')](handleEntityNotFound(_0x5a518d,null))[_0x4be0('0x1e')](function(_0x4f182c){if(_0x4f182c){return _0x4f182c[_0x4be0('0xb8')](_0x10a5cc[_0x4be0('0x41')][_0x4be0('0x67')])['then'](function(){if(_['isArray'](_0x10a5cc[_0x4be0('0x41')]['ids'])){for(var _0x59e6f0=0x0;_0x59e6f0<_0x10a5cc[_0x4be0('0x41')][_0x4be0('0x67')][_0x4be0('0x46')];_0x59e6f0+=0x1){socket[_0x4be0('0xb6')](_0x4be0('0xb9'),{'UserId':Number(_0x10a5cc[_0x4be0('0x41')]['ids'][_0x59e6f0]),'OpenchannelAccountId':Number(_0x10a5cc[_0x4be0('0x55')]['id'])});}}else{socket[_0x4be0('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0x10a5cc[_0x4be0('0x41')][_0x4be0('0x67')]),'OpenchannelAccountId':Number(_0x10a5cc[_0x4be0('0x55')]['id'])});}});}})[_0x4be0('0x1e')](respondWithStatusCode(_0x5a518d,null))[_0x4be0('0x26')](handleError(_0x5a518d,null));};exports[_0x4be0('0xba')]=function(_0x8b309b,_0x34cc4b,_0x29f928){var _0x32e5b0={};var _0x14f84d={};var _0x71e5e1;var _0x150e68;return db[_0x4be0('0x3b')][_0x4be0('0x64')]({'where':{'id':_0x8b309b[_0x4be0('0x55')]['id']}})[_0x4be0('0x1e')](handleEntityNotFound(_0x34cc4b,null))['then'](function(_0x52ffa9){if(_0x52ffa9){_0x71e5e1=_0x52ffa9;_0x14f84d[_0x4be0('0x40')]=_['keys'](db[_0x4be0('0x98')][_0x4be0('0x3c')]);_0x14f84d[_0x4be0('0x41')]=_['keys'](_0x8b309b[_0x4be0('0x41')]);_0x14f84d[_0x4be0('0x4c')]=_[_0x4be0('0x43')](_0x14f84d[_0x4be0('0x40')],_0x14f84d['query']);_0x32e5b0[_0x4be0('0x45')]=_['intersection'](_0x14f84d[_0x4be0('0x40')],qs[_0x4be0('0x44')](_0x8b309b[_0x4be0('0x41')][_0x4be0('0x44')]));_0x32e5b0[_0x4be0('0x45')]=_0x32e5b0[_0x4be0('0x45')][_0x4be0('0x46')]?_0x32e5b0[_0x4be0('0x45')]:_0x14f84d[_0x4be0('0x40')];_0x32e5b0[_0x4be0('0x48')]=qs['sort'](_0x8b309b[_0x4be0('0x41')][_0x4be0('0x49')]);_0x32e5b0[_0x4be0('0x4a')]=qs[_0x4be0('0x4c')](_[_0x4be0('0x4b')](_0x8b309b[_0x4be0('0x41')],_0x14f84d[_0x4be0('0x4c')]));if(_0x8b309b[_0x4be0('0x41')][_0x4be0('0x4d')]){_0x32e5b0[_0x4be0('0x4a')]=_['merge'](_0x32e5b0[_0x4be0('0x4a')],{'$or':_['map'](_0x32e5b0[_0x4be0('0x45')],function(_0x2dc409){var _0x25e882={};_0x25e882[_0x2dc409]={'$like':'%'+_0x8b309b[_0x4be0('0x41')][_0x4be0('0x4d')]+'%'};return _0x25e882;})});}_0x32e5b0=_['merge']({},_0x32e5b0,_0x8b309b['options']);return _0x71e5e1[_0x4be0('0xba')](_0x32e5b0);}})[_0x4be0('0x1e')](function(_0x4a8cfe){if(_0x4a8cfe){_0x150e68=_0x4a8cfe[_0x4be0('0x46')];if(!_0x8b309b[_0x4be0('0x41')][_0x4be0('0x47')](_0x4be0('0x65'))){_0x32e5b0[_0x4be0('0x2b')]=qs[_0x4be0('0x2b')](_0x8b309b['query']['limit']);_0x32e5b0[_0x4be0('0x29')]=qs[_0x4be0('0x29')](_0x8b309b[_0x4be0('0x41')][_0x4be0('0x29')]);}return _0x71e5e1[_0x4be0('0xba')](_0x32e5b0);}})[_0x4be0('0x1e')](function(_0x238577){if(_0x238577){return _0x238577?{'count':_0x150e68,'rows':_0x238577}:null;}})['then'](respondWithResult(_0x34cc4b,null))['catch'](handleError(_0x34cc4b,null));};exports[_0x4be0('0xa9')]=function(_0x54bf9c,_0x144457,_0x17473f){var _0x57bb37,_0x595f8b,_0x129d30;if(_[_0x4be0('0x78')](_0x54bf9c[_0x4be0('0x58')][_0x4be0('0x58')])||_0x54bf9c[_0x4be0('0x58')][_0x4be0('0x58')]===''){throw new db[(_0x4be0('0x70'))][(_0x4be0('0x71'))](_0x4be0('0xbb'));}if(_[_0x4be0('0x78')](_0x54bf9c[_0x4be0('0x58')]['to'])){}_0x57bb37=_0x54bf9c[_0x4be0('0x58')]['to'];return db['OpenchannelAccount'][_0x4be0('0x64')]({'where':{'id':_0x54bf9c[_0x4be0('0x55')]['id']}})['then'](handleEntityNotFound(_0x144457,null))[_0x4be0('0x1e')](function(_0x3c0b3d){if(_0x3c0b3d){return db[_0x4be0('0x3b')]['find']({'where':{'id':_0x3c0b3d['id']},'include':[{'model':db[_0x4be0('0xbc')],'as':_0x4be0('0x81'),'include':[{'model':db[_0x4be0('0x6f')],'as':_0x4be0('0x87'),'where':{[_0x3c0b3d[_0x4be0('0x79')]]:_0x57bb37},'limit':0x1,'order':[[_0x4be0('0x75'),'DESC']]}]}]})[_0x4be0('0x1e')](handleEntityNotFound(_0x144457,null))[_0x4be0('0x1e')](function(_0x12286f){if(_0x12286f&&_0x12286f[_0x4be0('0x81')]){_0x595f8b=_0x12286f[_0x4be0('0x5a')]({'plain':!![]});if(_0x595f8b[_0x4be0('0x81')]&&_0x595f8b['List'][_0x4be0('0x87')]['length']){return _0x595f8b[_0x4be0('0x81')][_0x4be0('0x87')][0x0];}return db['CmContact'][_0x4be0('0x57')](_[_0x4be0('0xbd')](_0x54bf9c['body'],{'firstName':_0x57bb37,[_0x12286f[_0x4be0('0x79')]]:_0x57bb37,'phone':_0x57bb37,'ListId':_0x595f8b[_0x4be0('0x88')]}));}})[_0x4be0('0x1e')](handleEntityNotFound(_0x144457,null))['then'](function(_0x2d2693){if(_0x2d2693){_0x129d30=_0x2d2693;return db['OpenchannelInteraction'][_0x4be0('0x5e')]({'where':{'ContactId':_0x129d30['id'],'closed':![],'OpenchannelAccountId':_0x595f8b['id']}})[_0x4be0('0x1e')](function(_0x5529d2){if(_0x5529d2){return[_0x5529d2,![]];}return db[_0x4be0('0x8d')][_0x4be0('0x57')]({'UserId':_0x54bf9c[_0x4be0('0x59')]['id'],'ContactId':_0x129d30['id'],'OpenchannelAccountId':_0x595f8b['id'],'lastMsgDirection':_0x4be0('0xbe'),'Messages':[_[_0x4be0('0x4f')](_0x54bf9c['body'],{'read':![],'body':_0x54bf9c[_0x4be0('0x58')][_0x4be0('0x58')],'OpenchannelAccountId':_0x595f8b['id'],'UserId':_0x54bf9c[_0x4be0('0x59')]['id'],'ContactId':_0x129d30['id']})]},{'include':[{'model':db[_0x4be0('0xbf')],'as':_0x4be0('0xc0')}]})[_0x4be0('0x1e')](function(_0x36e12d){return[_0x36e12d,!![]];});});}})[_0x4be0('0x8e')](function(_0xe304fe,_0x542e22){if(_0x542e22){return _0xe304fe;}return db[_0x4be0('0xbf')][_0x4be0('0x57')](_[_0x4be0('0x4f')](_0x54bf9c[_0x4be0('0x58')],{'read':![],'body':_0x54bf9c[_0x4be0('0x58')][_0x4be0('0x58')],'OpenchannelAccountId':_0x595f8b['id'],'OpenchannelInteractionId':_0xe304fe['id'],'UserId':_0x54bf9c[_0x4be0('0x59')]['id'],'ContactId':_0x129d30['id']}))[_0x4be0('0x1e')](function(_0x2666d8){_0xe304fe[_0x4be0('0xc1')]['Messages']=[];_0xe304fe[_0x4be0('0xc1')][_0x4be0('0xc0')][_0x4be0('0x93')](_0x2666d8[_0x4be0('0xc1')]);return _0xe304fe;});});}})[_0x4be0('0x1e')](respondWithResult(_0x144457,null))[_0x4be0('0x26')](handleError(_0x144457,null));}; \ No newline at end of file +var _0x139f=['messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS','OpenchannelApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','Contact','Owner','fullname','internal','Tag','tag','addAgents','omit','emit','userOpenchannelAccount:save','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','length','includeAll','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','ids','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','CmContact','Contacts','Applications','applications','orderBy','asc','account','firstName','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','contact','lastName'];(function(_0x16bbc4,_0x34df21){var _0x1202bb=function(_0xd45275){while(--_0xd45275){_0x16bbc4['push'](_0x16bbc4['shift']());}};_0x1202bb(++_0x34df21);}(_0x139f,0xec));var _0xf139=function(_0xf7f0b,_0x16639b){_0xf7f0b=_0xf7f0b-0x0;var _0x1cdd6c=_0x139f[_0xf7f0b];return _0x1cdd6c;};'use strict';var emlformat=require(_0xf139('0x0'));var rimraf=require(_0xf139('0x1'));var zipdir=require(_0xf139('0x2'));var jsonpatch=require(_0xf139('0x3'));var rp=require('request-promise');var moment=require(_0xf139('0x4'));var BPromise=require(_0xf139('0x5'));var Mustache=require(_0xf139('0x6'));var util=require(_0xf139('0x7'));var path=require(_0xf139('0x8'));var sox=require(_0xf139('0x9'));var csv=require('to-csv');var ejs=require(_0xf139('0xa'));var fs=require('fs');var fs_extra=require(_0xf139('0xb'));var _=require('lodash');var squel=require(_0xf139('0xc'));var crypto=require(_0xf139('0xd'));var jsforce=require(_0xf139('0xe'));var deskjs=require(_0xf139('0xf'));var toCsv=require(_0xf139('0x10'));var querystring=require('querystring');var Papa=require(_0xf139('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf139('0x12'));var as=require(_0xf139('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf139('0x14'))(_0xf139('0x15'));var utils=require(_0xf139('0x16'));var config=require(_0xf139('0x17'));var licenseUtil=require(_0xf139('0x18'));var db=require(_0xf139('0x19'))['db'];config[_0xf139('0x1a')]=_[_0xf139('0x1b')](config[_0xf139('0x1a')],{'host':_0xf139('0x1c'),'port':0x18eb});var socket=require(_0xf139('0x1d'))(new Redis(config['redis']));require(_0xf139('0x1e'))[_0xf139('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf139('0x20')]['http']({'port':0x232c});var client9002=jayson[_0xf139('0x20')][_0xf139('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5c29e3,_0x12b97e,_0x1fd139,_0x206f2b){return new BPromise(function(_0x3f40ef,_0x20eca7){var _0x9aa851=_0x206f2b||client;return _0x9aa851[_0xf139('0x22')](_0x5c29e3,_0x1fd139)['then'](function(_0x557c8e){logger['info'](_0xf139('0x23'),_0x12b97e,_0xf139('0x24'));logger[_0xf139('0x25')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x12b97e,_0xf139('0x24'),JSON['stringify'](_0x557c8e));if(_0x557c8e[_0xf139('0x26')]){if(_0x557c8e[_0xf139('0x26')][_0xf139('0x27')]===0x1f4){logger[_0xf139('0x26')](_0xf139('0x23'),_0x12b97e,_0x557c8e[_0xf139('0x26')]['message']);return _0x20eca7(_0x557c8e[_0xf139('0x26')][_0xf139('0x28')]);}logger['error'](_0xf139('0x23'),_0x12b97e,_0x557c8e['error'][_0xf139('0x28')]);return _0x3f40ef(_0x557c8e['error'][_0xf139('0x28')]);}else{logger[_0xf139('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x12b97e,_0xf139('0x24'));_0x3f40ef(_0x557c8e[_0xf139('0x2a')][_0xf139('0x28')]);}})[_0xf139('0x2b')](function(_0x168bd6){logger[_0xf139('0x26')](_0xf139('0x23'),_0x12b97e,_0x168bd6);_0x20eca7(_0x168bd6);});});}function respondWithStatusCode(_0x316cce,_0x184ad6){_0x184ad6=_0x184ad6||0xcc;return function(_0x1fee49){if(_0x1fee49){return _0x316cce[_0xf139('0x2c')](_0x184ad6);}return _0x316cce[_0xf139('0x2d')](_0x184ad6)[_0xf139('0x2e')]();};}function respondWithResult(_0x42ba5a,_0x5edb9b){_0x5edb9b=_0x5edb9b||0xc8;return function(_0x1f0477){if(_0x1f0477){return _0x42ba5a[_0xf139('0x2d')](_0x5edb9b)[_0xf139('0x2f')](_0x1f0477);}};}function respondWithFilteredResult(_0x2fb45a,_0x1ed4e0){return function(_0x393215){if(_0x393215){var _0x17a886=typeof _0x1ed4e0['offset']===_0xf139('0x30')&&typeof _0x1ed4e0[_0xf139('0x31')]===_0xf139('0x30');var _0x4bad7c=_0x393215[_0xf139('0x32')];var _0x4601e3=_0x17a886?0x0:_0x1ed4e0['offset'];var _0x225aa6=_0x17a886?_0x393215['count']:_0x1ed4e0[_0xf139('0x33')]+_0x1ed4e0['limit'];var _0x954848;if(_0x225aa6>=_0x4bad7c){_0x225aa6=_0x4bad7c;_0x954848=0xc8;}else{_0x954848=0xce;}_0x2fb45a[_0xf139('0x2d')](_0x954848);return _0x2fb45a[_0xf139('0x34')]('Content-Range',_0x4601e3+'-'+_0x225aa6+'/'+_0x4bad7c)[_0xf139('0x2f')](_0x393215);}return null;};}function patchUpdates(_0x332875){return function(_0x36b228){try{jsonpatch[_0xf139('0x35')](_0x36b228,_0x332875,!![]);}catch(_0x254449){return BPromise[_0xf139('0x36')](_0x254449);}return _0x36b228[_0xf139('0x37')]();};}function saveUpdates(_0x5e5505,_0x1356f5){return function(_0x5360fe){if(_0x5360fe){return _0x5360fe[_0xf139('0x38')](_0x5e5505)[_0xf139('0x39')](function(_0xc6f362){return _0xc6f362;});}return null;};}function removeEntity(_0x186da4,_0xf5aab0){return function(_0x11e179){if(_0x11e179){return _0x11e179[_0xf139('0x3a')]()[_0xf139('0x39')](function(){var _0x3403cf=_0x11e179[_0xf139('0x3b')]({'plain':!![]});var _0x3c6de9=_0xf139('0x3c');return db[_0xf139('0x3d')][_0xf139('0x3a')]({'where':{'type':_0x3c6de9,'resourceId':_0x3403cf['id']}})['then'](function(){return _0x11e179;});})[_0xf139('0x39')](function(){_0x186da4['status'](0xcc)[_0xf139('0x2e')]();});}};}function handleEntityNotFound(_0x1f34be,_0x3b0793){return function(_0x13308d){if(!_0x13308d){_0x1f34be[_0xf139('0x2c')](0x194);}return _0x13308d;};}function handleError(_0x13b66d,_0x585164){_0x585164=_0x585164||0x1f4;return function(_0x25e1fc){logger['error'](_0x25e1fc[_0xf139('0x3e')]);if(_0x25e1fc['name']){delete _0x25e1fc[_0xf139('0x3f')];}_0x13b66d[_0xf139('0x2d')](_0x585164)[_0xf139('0x40')](_0x25e1fc);};}exports[_0xf139('0x41')]=function(_0x4a0e06,_0x2bdc5c){var _0xc9f4fa={'include':[{'model':db[_0xf139('0x42')],'as':_0xf139('0x43')}]},_0x2c96a6={},_0x1f7d35={'count':0x0,'rows':[]};var _0x1357ca=_[_0xf139('0x44')](db[_0xf139('0x45')][_0xf139('0x46')],function(_0x16f91a){return{'name':_0x16f91a[_0xf139('0x47')],'type':_0x16f91a[_0xf139('0x48')][_0xf139('0x49')]};});_0x2c96a6[_0xf139('0x4a')]=_[_0xf139('0x44')](_0x1357ca,_0xf139('0x3f'));_0x2c96a6['query']=_[_0xf139('0x4b')](_0x4a0e06['query']);_0x2c96a6[_0xf139('0x4c')]=_[_0xf139('0x4d')](_0x2c96a6['model'],_0x2c96a6[_0xf139('0x4e')]);_0xc9f4fa[_0xf139('0x4f')]=_[_0xf139('0x4d')](_0x2c96a6['model'],qs[_0xf139('0x50')](_0x4a0e06[_0xf139('0x4e')][_0xf139('0x50')]));_0xc9f4fa[_0xf139('0x4f')]=_0xc9f4fa[_0xf139('0x4f')]['length']?_0xc9f4fa[_0xf139('0x4f')]:_0x2c96a6[_0xf139('0x4a')];if(!_0x4a0e06[_0xf139('0x4e')][_0xf139('0x51')](_0xf139('0x52'))){_0xc9f4fa[_0xf139('0x31')]=qs[_0xf139('0x31')](_0x4a0e06['query'][_0xf139('0x31')]);_0xc9f4fa[_0xf139('0x33')]=qs[_0xf139('0x33')](_0x4a0e06[_0xf139('0x4e')]['offset']);}_0xc9f4fa[_0xf139('0x53')]=qs['sort'](_0x4a0e06[_0xf139('0x4e')][_0xf139('0x54')]);_0xc9f4fa[_0xf139('0x55')]=qs['filters'](_[_0xf139('0x56')](_0x4a0e06[_0xf139('0x4e')],_0x2c96a6['filters']),_0x1357ca);if(_0x4a0e06[_0xf139('0x4e')][_0xf139('0x57')]){_0xc9f4fa[_0xf139('0x55')]=_[_0xf139('0x58')](_0xc9f4fa['where'],{'$or':_[_0xf139('0x44')](_0x1357ca,function(_0x1161c3){if(_0x1161c3[_0xf139('0x48')]!==_0xf139('0x59')){var _0x2a57b6={};_0x2a57b6[_0x1161c3[_0xf139('0x3f')]]={'$like':'%'+_0x4a0e06['query'][_0xf139('0x57')]+'%'};return _0x2a57b6;}})});}_0xc9f4fa=_[_0xf139('0x58')]({},_0xc9f4fa,_0x4a0e06['options']);var _0x2c6c89={'where':_0xc9f4fa[_0xf139('0x55')]};return db['OpenchannelAccount'][_0xf139('0x32')](_0x2c6c89)[_0xf139('0x39')](function(_0x545f36){_0x1f7d35[_0xf139('0x32')]=_0x545f36;if(_0x4a0e06['query']['includeAll']){_0xc9f4fa[_0xf139('0x5a')]=[{'all':!![]}];}return db[_0xf139('0x45')][_0xf139('0x5b')](_0xc9f4fa);})[_0xf139('0x39')](function(_0x16c11a){_0x1f7d35[_0xf139('0x5c')]=_0x16c11a;return _0x1f7d35;})['then'](respondWithFilteredResult(_0x2bdc5c,_0xc9f4fa))[_0xf139('0x2b')](handleError(_0x2bdc5c,null));};exports[_0xf139('0x5d')]=function(_0x3a4c20,_0x4d5a15){var _0x2eee2a={'raw':![],'where':{'id':_0x3a4c20[_0xf139('0x5e')]['id']},'include':[{'model':db[_0xf139('0x42')],'as':_0xf139('0x43')}]},_0x258eaa={};_0x258eaa[_0xf139('0x4a')]=_[_0xf139('0x4b')](db[_0xf139('0x45')][_0xf139('0x46')]);_0x258eaa[_0xf139('0x4e')]=_['keys'](_0x3a4c20[_0xf139('0x4e')]);_0x258eaa[_0xf139('0x4c')]=_[_0xf139('0x4d')](_0x258eaa[_0xf139('0x4a')],_0x258eaa['query']);_0x2eee2a['attributes']=_[_0xf139('0x4d')](_0x258eaa['model'],qs['fields'](_0x3a4c20['query']['fields']));_0x2eee2a[_0xf139('0x4f')]=_0x2eee2a[_0xf139('0x4f')][_0xf139('0x5f')]?_0x2eee2a[_0xf139('0x4f')]:_0x258eaa[_0xf139('0x4a')];if(_0x3a4c20[_0xf139('0x4e')][_0xf139('0x60')]){_0x2eee2a['include']=[{'all':!![]}];}_0x2eee2a=_[_0xf139('0x58')]({},_0x2eee2a,_0x3a4c20[_0xf139('0x61')]);return db[_0xf139('0x45')][_0xf139('0x62')](_0x2eee2a)[_0xf139('0x39')](handleEntityNotFound(_0x4d5a15,null))[_0xf139('0x39')](respondWithResult(_0x4d5a15,null))[_0xf139('0x2b')](handleError(_0x4d5a15,null));};exports[_0xf139('0x63')]=function(_0x80c03d,_0x20b3f8){return db['OpenchannelAccount'][_0xf139('0x63')](_0x80c03d['body'],{})[_0xf139('0x39')](function(_0x3262e7){var _0x39974d=_0x80c03d['user'][_0xf139('0x3b')]({'plain':!![]});if(!_0x39974d)throw new Error(_0xf139('0x64'));if(_0x39974d[_0xf139('0x65')]===_0xf139('0x66')){var _0x369b40=_0x3262e7[_0xf139('0x3b')]({'plain':!![]});var _0x20c8be=_0xf139('0x3c');return db[_0xf139('0x67')][_0xf139('0x62')]({'where':{'name':_0x20c8be,'userProfileId':_0x39974d['userProfileId']},'raw':!![]})[_0xf139('0x39')](function(_0x217be6){if(_0x217be6&&_0x217be6[_0xf139('0x68')]===0x0){return db['UserProfileResource'][_0xf139('0x63')]({'name':_0x369b40['name'],'resourceId':_0x369b40['id'],'type':_0x217be6[_0xf139('0x3f')],'sectionId':_0x217be6['id']},{})[_0xf139('0x39')](function(){return _0x3262e7;});}else{return _0x3262e7;}})[_0xf139('0x2b')](function(_0x568728){logger[_0xf139('0x26')](_0xf139('0x69'),_0x568728);throw _0x568728;});}return _0x3262e7;})[_0xf139('0x39')](respondWithResult(_0x20b3f8,0xc9))[_0xf139('0x2b')](handleError(_0x20b3f8,null));};exports[_0xf139('0x38')]=function(_0x1e50d8,_0x3f4043){if(_0x1e50d8[_0xf139('0x6a')]['id']){delete _0x1e50d8[_0xf139('0x6a')]['id'];}return db['OpenchannelAccount'][_0xf139('0x62')]({'where':{'id':_0x1e50d8['params']['id']},'include':[{'model':db[_0xf139('0x42')],'as':_0xf139('0x43')}]})[_0xf139('0x39')](handleEntityNotFound(_0x3f4043,null))[_0xf139('0x39')](saveUpdates(_0x1e50d8[_0xf139('0x6a')],null))['then'](respondWithResult(_0x3f4043,null))[_0xf139('0x2b')](handleError(_0x3f4043,null));};exports[_0xf139('0x3a')]=function(_0x48d9c9,_0x39a9f0){return db[_0xf139('0x45')]['find']({'where':{'id':_0x48d9c9[_0xf139('0x5e')]['id']}})[_0xf139('0x39')](handleEntityNotFound(_0x39a9f0,null))[_0xf139('0x39')](removeEntity(_0x39a9f0,null))['catch'](handleError(_0x39a9f0,null));};exports['describe']=function(_0xc06350,_0x16e04a){return db[_0xf139('0x45')][_0xf139('0x6b')]()[_0xf139('0x39')](respondWithResult(_0x16e04a,null))['catch'](handleError(_0x16e04a,null));};exports[_0xf139('0x6c')]=function(_0x55b78a,_0x4ea787,_0x52440d){if(_0x55b78a[_0xf139('0x6a')]['id']){delete _0x55b78a[_0xf139('0x6a')]['id'];}return db[_0xf139('0x45')]['find']({'where':{'id':_0x55b78a[_0xf139('0x5e')]['id']}})[_0xf139('0x39')](handleEntityNotFound(_0x4ea787,null))[_0xf139('0x39')](function(_0x271097){if(_0x271097){_0x55b78a[_0xf139('0x6a')][_0xf139('0x6d')]=_0x271097['id'];return db[_0xf139('0x6e')][_0xf139('0x63')](_0x55b78a[_0xf139('0x6a')]);}})[_0xf139('0x39')](respondWithResult(_0x4ea787,null))[_0xf139('0x2b')](handleError(_0x4ea787,null));};exports[_0xf139('0x6f')]=function(_0x12e4cd,_0x14c8de,_0x444ee8){var _0x33e44d={'raw':![],'where':{}};var _0x406ca4={};var _0xa15351={'count':0x0,'rows':[]};return db[_0xf139('0x45')][_0xf139('0x70')]({'where':{'id':_0x12e4cd[_0xf139('0x5e')]['id']}})['then'](handleEntityNotFound(_0x14c8de,null))[_0xf139('0x39')](function(_0x2fd8ab){if(_0x2fd8ab){_0x406ca4['model']=_[_0xf139('0x4b')](db[_0xf139('0x6e')][_0xf139('0x46')]);_0x406ca4['query']=_[_0xf139('0x4b')](_0x12e4cd[_0xf139('0x4e')]);_0x406ca4[_0xf139('0x4c')]=_[_0xf139('0x4d')](_0x406ca4[_0xf139('0x4a')],_0x406ca4[_0xf139('0x4e')]);_0x33e44d['attributes']=_[_0xf139('0x4d')](_0x406ca4[_0xf139('0x4a')],qs[_0xf139('0x50')](_0x12e4cd[_0xf139('0x4e')][_0xf139('0x50')]));_0x33e44d[_0xf139('0x4f')]=_0x33e44d[_0xf139('0x4f')][_0xf139('0x5f')]?_0x33e44d['attributes']:_0x406ca4[_0xf139('0x4a')];if(!_0x12e4cd[_0xf139('0x4e')][_0xf139('0x51')](_0xf139('0x52'))){_0x33e44d[_0xf139('0x31')]=qs['limit'](_0x12e4cd['query']['limit']);_0x33e44d[_0xf139('0x33')]=qs[_0xf139('0x33')](_0x12e4cd['query']['offset']);}_0x33e44d['order']=qs[_0xf139('0x54')](_0x12e4cd['query'][_0xf139('0x54')]);_0x33e44d['where']=qs[_0xf139('0x4c')](_['pick'](_0x12e4cd[_0xf139('0x4e')],_0x406ca4[_0xf139('0x4c')]));_0x33e44d[_0xf139('0x55')][_0xf139('0x6d')]=_0x2fd8ab['id'];if(_0x12e4cd[_0xf139('0x4e')]['filter']){_0x33e44d[_0xf139('0x55')]=_[_0xf139('0x58')](_0x33e44d[_0xf139('0x55')],{'$or':_[_0xf139('0x44')](_0x33e44d[_0xf139('0x4f')],function(_0x1b9b10){var _0x37f6e2={};_0x37f6e2[_0x1b9b10]={'$like':'%'+_0x12e4cd[_0xf139('0x4e')][_0xf139('0x57')]+'%'};return _0x37f6e2;})});}_0x33e44d=_['merge']({},_0x33e44d,_0x12e4cd[_0xf139('0x61')]);return db[_0xf139('0x6e')][_0xf139('0x32')]({'where':_0x33e44d[_0xf139('0x55')]})[_0xf139('0x39')](function(_0x21cca4){_0xa15351['count']=_0x21cca4;if(_0x12e4cd[_0xf139('0x4e')]['includeAll']){_0x33e44d[_0xf139('0x5a')]=[{'all':!![]}];}return db[_0xf139('0x6e')][_0xf139('0x5b')](_0x33e44d);})['then'](function(_0x55d90c){_0xa15351[_0xf139('0x5c')]=_0x55d90c;return _0xa15351;});}})[_0xf139('0x39')](respondWithFilteredResult(_0x14c8de,_0x33e44d))[_0xf139('0x2b')](handleError(_0x14c8de,null));};exports['removeDispositions']=function(_0xc8b720,_0x5e02a6,_0x25ed85){return db[_0xf139('0x45')]['find']({'where':{'id':_0xc8b720[_0xf139('0x5e')]['id']}})[_0xf139('0x39')](handleEntityNotFound(_0x5e02a6,null))[_0xf139('0x39')](function(_0x278c46){if(_0x278c46){return _0x278c46['removeDispositions'](_0xc8b720['query'][_0xf139('0x71')]);}})[_0xf139('0x39')](respondWithStatusCode(_0x5e02a6,null))[_0xf139('0x2b')](handleError(_0x5e02a6,null));};exports['addAnswer']=function(_0x242772,_0x5e9ba2,_0x3f56e7){if(_0x242772[_0xf139('0x6a')]['id']){delete _0x242772[_0xf139('0x6a')]['id'];}return db[_0xf139('0x45')][_0xf139('0x62')]({'where':{'id':_0x242772['params']['id']}})[_0xf139('0x39')](handleEntityNotFound(_0x5e9ba2,null))['then'](function(_0x37e310){if(_0x37e310){_0x242772['body']['OpenchannelAccountId']=_0x37e310['id'];return db['CannedAnswer'][_0xf139('0x63')](_0x242772[_0xf139('0x6a')]);}})[_0xf139('0x39')](respondWithResult(_0x5e9ba2,null))['catch'](handleError(_0x5e9ba2,null));};exports[_0xf139('0x72')]=function(_0x817dac,_0x2f0ee2,_0x2d3de5){var _0x527821={'raw':![],'where':{}};var _0x5cb695={};var _0x292c63={'count':0x0,'rows':[]};return db[_0xf139('0x45')]['findOne']({'where':{'id':_0x817dac[_0xf139('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2f0ee2,null))[_0xf139('0x39')](function(_0x333fe1){if(_0x333fe1){_0x5cb695[_0xf139('0x4a')]=_[_0xf139('0x4b')](db[_0xf139('0x73')][_0xf139('0x46')]);_0x5cb695['query']=_[_0xf139('0x4b')](_0x817dac[_0xf139('0x4e')]);_0x5cb695['filters']=_[_0xf139('0x4d')](_0x5cb695[_0xf139('0x4a')],_0x5cb695[_0xf139('0x4e')]);_0x527821['attributes']=_[_0xf139('0x4d')](_0x5cb695[_0xf139('0x4a')],qs[_0xf139('0x50')](_0x817dac[_0xf139('0x4e')]['fields']));_0x527821[_0xf139('0x4f')]=_0x527821['attributes'][_0xf139('0x5f')]?_0x527821[_0xf139('0x4f')]:_0x5cb695['model'];if(!_0x817dac[_0xf139('0x4e')]['hasOwnProperty'](_0xf139('0x52'))){_0x527821[_0xf139('0x31')]=qs[_0xf139('0x31')](_0x817dac['query']['limit']);_0x527821['offset']=qs[_0xf139('0x33')](_0x817dac[_0xf139('0x4e')][_0xf139('0x33')]);}_0x527821[_0xf139('0x53')]=qs[_0xf139('0x54')](_0x817dac[_0xf139('0x4e')]['sort']);_0x527821[_0xf139('0x55')]=qs[_0xf139('0x4c')](_[_0xf139('0x56')](_0x817dac[_0xf139('0x4e')],_0x5cb695[_0xf139('0x4c')]));_0x527821[_0xf139('0x55')][_0xf139('0x6d')]=_0x333fe1['id'];if(_0x817dac[_0xf139('0x4e')][_0xf139('0x57')]){_0x527821[_0xf139('0x55')]=_['merge'](_0x527821[_0xf139('0x55')],{'$or':_[_0xf139('0x44')](_0x527821[_0xf139('0x4f')],function(_0x4dbd5f){var _0x4dea14={};_0x4dea14[_0x4dbd5f]={'$like':'%'+_0x817dac[_0xf139('0x4e')][_0xf139('0x57')]+'%'};return _0x4dea14;})});}_0x527821=_[_0xf139('0x58')]({},_0x527821,_0x817dac[_0xf139('0x61')]);return db['CannedAnswer'][_0xf139('0x32')]({'where':_0x527821[_0xf139('0x55')]})[_0xf139('0x39')](function(_0x52a77c){_0x292c63[_0xf139('0x32')]=_0x52a77c;if(_0x817dac[_0xf139('0x4e')][_0xf139('0x60')]){_0x527821['include']=[{'all':!![]}];}return db[_0xf139('0x73')][_0xf139('0x5b')](_0x527821);})[_0xf139('0x39')](function(_0x4f1d1f){_0x292c63[_0xf139('0x5c')]=_0x4f1d1f;return _0x292c63;});}})[_0xf139('0x39')](respondWithFilteredResult(_0x2f0ee2,_0x527821))[_0xf139('0x2b')](handleError(_0x2f0ee2,null));};exports['removeAnswers']=function(_0x1019a6,_0x4039cd,_0x5c5fae){return db[_0xf139('0x45')]['find']({'where':{'id':_0x1019a6['params']['id']}})[_0xf139('0x39')](handleEntityNotFound(_0x4039cd,null))['then'](function(_0x5f32b8){if(_0x5f32b8){return _0x5f32b8[_0xf139('0x74')](_0x1019a6[_0xf139('0x4e')]['ids']);}})[_0xf139('0x39')](respondWithStatusCode(_0x4039cd,null))['catch'](handleError(_0x4039cd,null));};exports[_0xf139('0x75')]=function(_0xb4eaf8,_0x229d74,_0x55fdcb){var _0x2c8b58={'body':_0xb4eaf8[_0xf139('0x6a')],'channel':_0xf139('0x76')};var _0x26dfe1=[];var _0x2dde4d=[];var _0x4bda75={};var _0x177e38=![];return db['CmContact'][_0xf139('0x6b')]()[_0xf139('0x39')](function(_0x181101){if(!_0x181101){throw new db['Sequelize'][(_0xf139('0x77'))](_0xf139('0x78'));}_0x26dfe1=_[_0xf139('0x79')](_['keys'](_0x181101),['createdAt',_0xf139('0x7a')]);_0x2dde4d=_['difference'](_['keys'](_0x181101),['createdAt',_0xf139('0x7a'),_0xf139('0x7b'),_0xf139('0x7c')]);if(_0xb4eaf8[_0xf139('0x6a')]['id']){delete _0xb4eaf8[_0xf139('0x6a')]['id'];}if(_[_0xf139('0x7d')](_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x7e')])){throw new db['Sequelize'][(_0xf139('0x77'))](_0xf139('0x7f'));}if(_[_0xf139('0x7d')](_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x6a')])||_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x6a')]===''){throw new db['Sequelize']['ValidationError'](_0xf139('0x80'));}if(_[_0xf139('0x7d')](_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x81')])){throw new db[(_0xf139('0x82'))][(_0xf139('0x77'))](_0xf139('0x83')+_0x2dde4d);}if(!_[_0xf139('0x84')](_0x2dde4d,_0xb4eaf8['body'][_0xf139('0x81')])){throw new db[(_0xf139('0x82'))][(_0xf139('0x77'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2dde4d);}_0x4bda75[_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x81')]]=_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x7e')];})['then'](function(){return db[_0xf139('0x45')][_0xf139('0x62')]({'where':{'id':_0xb4eaf8[_0xf139('0x5e')]['id']},'include':[{'model':db[_0xf139('0x85')],'as':_0xf139('0x86'),'include':[{'model':db[_0xf139('0x87')],'as':_0xf139('0x88'),'where':_0x4bda75,'limit':0x1,'order':[[_0xf139('0x7a'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0xf139('0x89')}]});})[_0xf139('0x39')](handleEntityNotFound(_0x229d74,null))[_0xf139('0x39')](function(_0x2769c4){if(_0x2769c4&&_0x2769c4[_0xf139('0x86')]){_0x2c8b58['account']=_0x2769c4;_0x2c8b58[_0xf139('0x8a')]=_0x2769c4['Applications'];_0x2c8b58['list']=_0x2769c4[_0xf139('0x86')];_0x2c8b58[_0xf139('0x8a')]=_[_0xf139('0x8b')](_0x2c8b58[_0xf139('0x8a')],['priority'],[_0xf139('0x8c')]);if(_0x2c8b58[_0xf139('0x8d')]['Applications']){delete _0x2c8b58[_0xf139('0x8d')][_0xf139('0x89')];}if(_0x2c8b58[_0xf139('0x8d')]['List']&&_0x2c8b58[_0xf139('0x8d')][_0xf139('0x86')][_0xf139('0x88')][_0xf139('0x5f')]){return _0x2c8b58[_0xf139('0x8d')][_0xf139('0x86')][_0xf139('0x88')][0x0];}var _0x3e5e6a=_[_0xf139('0x1b')](_0xb4eaf8[_0xf139('0x6a')],{'firstName':_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x7e')],'ListId':_0x2769c4[_0xf139('0x7c')]});_0x3e5e6a[_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x81')]]=_0xb4eaf8[_0xf139('0x6a')]['from'];return db[_0xf139('0x87')]['create'](_0x3e5e6a,{'fields':_0x26dfe1,'raw':!![]});}})[_0xf139('0x39')](handleEntityNotFound(_0x229d74,null))[_0xf139('0x39')](function(_0x150034){_0x2c8b58['contact']=_0x150034;if(_0x150034){var _0x331533={'ContactId':_0x150034['id'],'OpenchannelAccountId':_0xb4eaf8[_0xf139('0x5e')]['id'],'from':(_0x150034[_0xf139('0x8e')]||'')+'\x20'+(_0x150034['lastName']||'')};var _0xfe7a31={'OpenchannelAccountId':_0xb4eaf8['params']['id'],'closed':![]};if(_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x8f')]){_0xfe7a31[_0xf139('0x8f')]=_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x8f')];return db['OpenchannelInteraction']['find']({'where':_0xfe7a31})[_0xf139('0x39')](function(_0x8eb890){if(_0x8eb890){return[_0x8eb890,![]];}_0x331533['threadId']=_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x8f')];_0x331533[_0xf139('0x90')]=_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x90')];return db['OpenchannelInteraction'][_0xf139('0x63')](_0x331533)[_0xf139('0x39')](function(_0x313e2d){return[_0x313e2d,!![]];});});}else{_0xfe7a31[_0xf139('0x8f')]=null;}_0xfe7a31[_0xf139('0x91')]=_0x150034['id'];return db[_0xf139('0x92')][_0xf139('0x62')]({'where':_0xfe7a31})['then'](function(_0x4d2c84){if(_0x4d2c84){return[_0x4d2c84,![]];}return db[_0xf139('0x92')][_0xf139('0x63')](_0x331533)[_0xf139('0x39')](function(_0x5f5875){return[_0x5f5875,!![]];});});}})[_0xf139('0x93')](function(_0x23f3d7,_0x1403cd){if(_0x23f3d7){_0x177e38=_0x1403cd;if(!_0x1403cd){var _0x210878={'from':(_0x2c8b58[_0xf139('0x94')][_0xf139('0x8e')]||'')+'\x20'+(_0x2c8b58[_0xf139('0x94')][_0xf139('0x95')]||'')};if(_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x8f')]&&_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x96')]&&_0xb4eaf8[_0xf139('0x6a')]['threadId']!=_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x96')]){_0x210878['threadId']=_0xb4eaf8[_0xf139('0x6a')][_0xf139('0x96')];}return _0x23f3d7['update'](_0x210878);}else{return _0x23f3d7;}}})[_0xf139('0x39')](function(_0x24505b){_0x2c8b58[_0xf139('0x97')]=_0x24505b[_0xf139('0x3b')]({'plain':!![]});_0x2c8b58[_0xf139('0x97')][_0xf139('0x98')]=_0x177e38;if(_0x2c8b58[_0xf139('0x97')][_0xf139('0x98')]){if(_0x2c8b58[_0xf139('0x8d')][_0xf139('0x99')]){_0x2c8b58[_0xf139('0x8a')][_0xf139('0x9a')]({'id':0x0,'priority':_0x2c8b58[_0xf139('0x8a')][_0xf139('0x5f')]+0x1,'app':'close','appdata':_0xf139('0x9b'),'interval':_0xf139('0x9c')});}}return db['OpenchannelMessage']['create']({'body':_0xb4eaf8[_0xf139('0x6a')]['body'],'OpenchannelAccountId':_0xb4eaf8[_0xf139('0x5e')]['id'],'OpenchannelInteractionId':_0x24505b['id'],'direction':'in','ContactId':_0x2c8b58[_0xf139('0x94')]['id'],'AttachmentId':_0xb4eaf8['body']['AttachmentId']});})[_0xf139('0x39')](function(_0x5b9927){_0x2c8b58[_0xf139('0x28')]=_0x5b9927;if(_0x2c8b58[_0xf139('0x97')][_0xf139('0x9d')]){return db[_0xf139('0x9e')][_0xf139('0x62')]({'attributes':['id',_0xf139('0x3f')],'where':{'id':_0x2c8b58[_0xf139('0x97')]['UserId']}})[_0xf139('0x39')](function(_0xfd259){if(_0xfd259){_0x2c8b58[_0xf139('0x8a')][_0xf139('0x9f')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xfd259[_0xf139('0x3f')]+','+(_0x2c8b58[_0xf139('0x8d')][_0xf139('0xa0')]||0xa),'interval':_0xf139('0x9c')});_0x2c8b58[_0xf139('0xa1')]=![];}return respondWithRpcPromise(_0xf139('0xa2'),_0xf139('0xa3'),_0x2c8b58);});}return respondWithRpcPromise(_0xf139('0xa2'),'startRouting',_0x2c8b58);})[_0xf139('0x39')](function(_0x1bad04){respondWithRpcPromise('EventManager',_0xf139('0xa4'),{'event':_0xf139('0x75'),'message':_0x1bad04},client9002);return _0x1bad04;})[_0xf139('0x39')](respondWithResult(_0x229d74,null))[_0xf139('0x2b')](handleError(_0x229d74,null));};exports[_0xf139('0xa5')]=function(_0x4d9363,_0x3d1de7){var _0x32ab76=_0x4d9363[_0xf139('0x5e')]['id'];var _0x1f9c65=_0x4d9363[_0xf139('0x6a')];var _0x18e174=0xc8;var _0x36b2b1=null;return db[_0xf139('0xa6')][_0xf139('0xa7')]({'isolationLevel':db['sequelize']['Transaction'][_0xf139('0xa8')]['READ_COMMITTED']},function(_0x3838f8){return db['OpenchannelAccount'][_0xf139('0x70')]({'where':{'id':_0x32ab76},'transaction':_0x3838f8})[_0xf139('0x39')](function(_0x3112b3){if(_0x3112b3){return db[_0xf139('0xa9')][_0xf139('0x3a')]({'where':{'OpenchannelAccountId':_0x32ab76},'transaction':_0x3838f8})[_0xf139('0x39')](function(){var _0x5b28bb=_[_0xf139('0x44')](_0x1f9c65,function(_0x12ad64){_0x12ad64[_0xf139('0x6d')]=_0x32ab76;return _0x12ad64;});return db[_0xf139('0xa9')][_0xf139('0xaa')](_0x5b28bb,{'transaction':_0x3838f8});});}else{_0x18e174=0x194;_0x36b2b1=[];}});})['then'](function(){if(_0x18e174!==0x194){return db[_0xf139('0xa9')][_0xf139('0xab')]({'where':{'OpenchannelAccountId':_0x32ab76},'order':_0xf139('0xac')})[_0xf139('0x39')](function(_0x1b9fcf){_0x36b2b1=_0x1b9fcf;});}})[_0xf139('0x2b')](function(_0x343236){_0x18e174=0x1f4;logger[_0xf139('0x26')](_0x343236['stack']);if(_0x343236['name']){delete _0x343236[_0xf139('0x3f')];}_0x36b2b1=_0x343236;})[_0xf139('0xad')](function(){if(_0x36b2b1===null){_0x3d1de7[_0xf139('0x2c')](_0x18e174);}else{if(_0x18e174===0x1f4){_0x3d1de7['status'](_0x18e174)['send'](_0x36b2b1);}else{_0x3d1de7[_0xf139('0x2d')](_0x18e174)[_0xf139('0x2f')](_0x36b2b1);}}});};exports[_0xf139('0xae')]=function(_0x147f77,_0x12dbfb,_0x39352b){var _0x39d724={};var _0x3e92f1={};var _0x2b41b7;var _0x5e98af;return db[_0xf139('0x45')][_0xf139('0x70')]({'where':{'id':_0x147f77[_0xf139('0x5e')]['id']}})['then'](handleEntityNotFound(_0x12dbfb,null))[_0xf139('0x39')](function(_0x47ae20){if(_0x47ae20){_0x2b41b7=_0x47ae20;_0x3e92f1[_0xf139('0x4a')]=_[_0xf139('0x4b')](db[_0xf139('0xa9')]['rawAttributes']);_0x3e92f1[_0xf139('0x4e')]=_['keys'](_0x147f77['query']);_0x3e92f1['filters']=_[_0xf139('0x4d')](_0x3e92f1[_0xf139('0x4a')],_0x3e92f1[_0xf139('0x4e')]);_0x39d724[_0xf139('0x4f')]=_['intersection'](_0x3e92f1['model'],qs['fields'](_0x147f77['query'][_0xf139('0x50')]));_0x39d724[_0xf139('0x4f')]=_0x39d724[_0xf139('0x4f')][_0xf139('0x5f')]?_0x39d724[_0xf139('0x4f')]:_0x3e92f1['model'];_0x39d724['order']=qs[_0xf139('0x54')](_0x147f77[_0xf139('0x4e')][_0xf139('0x54')]);_0x39d724[_0xf139('0x55')]=qs[_0xf139('0x4c')](_['pick'](_0x147f77['query'],_0x3e92f1[_0xf139('0x4c')]));if(_0x147f77[_0xf139('0x4e')]['filter']){_0x39d724['where']=_[_0xf139('0x58')](_0x39d724[_0xf139('0x55')],{'$or':_[_0xf139('0x44')](_0x39d724[_0xf139('0x4f')],function(_0x169a8f){var _0x157bce={};_0x157bce[_0x169a8f]={'$like':'%'+_0x147f77[_0xf139('0x4e')][_0xf139('0x57')]+'%'};return _0x157bce;})});}_0x39d724=_[_0xf139('0x58')]({},_0x39d724,_0x147f77[_0xf139('0x61')]);return _0x2b41b7['getApplications'](_0x39d724);}})[_0xf139('0x39')](function(_0x23ab4a){if(_0x23ab4a){_0x5e98af=_0x23ab4a[_0xf139('0x5f')];if(!_0x147f77[_0xf139('0x4e')]['hasOwnProperty'](_0xf139('0x52'))){_0x39d724['limit']=qs[_0xf139('0x31')](_0x147f77['query']['limit']);_0x39d724['offset']=qs[_0xf139('0x33')](_0x147f77[_0xf139('0x4e')][_0xf139('0x33')]);}return _0x2b41b7['getApplications'](_0x39d724);}})['then'](function(_0x177824){if(_0x177824){return _0x177824?{'count':_0x5e98af,'rows':_0x177824}:null;}})[_0xf139('0x39')](respondWithResult(_0x12dbfb,null))[_0xf139('0x2b')](handleError(_0x12dbfb,null));};exports['getInteractions']=function(_0x11136b,_0x51d00c,_0x64631c){var _0x24b871={'raw':![],'where':{}};var _0x4de929={};var _0x274924={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x11136b[_0xf139('0x5e')]['id']}})[_0xf139('0x39')](handleEntityNotFound(_0x51d00c,null))[_0xf139('0x39')](function(_0x57abfb){if(_0x57abfb){_0x4de929[_0xf139('0x4a')]=_[_0xf139('0x4b')](db[_0xf139('0x92')][_0xf139('0x46')]);_0x4de929[_0xf139('0x4e')]=_[_0xf139('0x4b')](_0x11136b[_0xf139('0x4e')]);_0x4de929[_0xf139('0x4c')]=_[_0xf139('0x4d')](_0x4de929[_0xf139('0x4a')],_0x4de929[_0xf139('0x4e')]);_0x24b871['attributes']=_[_0xf139('0x4d')](_0x4de929[_0xf139('0x4a')],qs[_0xf139('0x50')](_0x11136b[_0xf139('0x4e')][_0xf139('0x50')]));_0x24b871[_0xf139('0x4f')]=_0x24b871[_0xf139('0x4f')][_0xf139('0x5f')]?_0x24b871['attributes']:_0x4de929['model'];if(!_0x11136b[_0xf139('0x4e')][_0xf139('0x51')](_0xf139('0x52'))){_0x24b871[_0xf139('0x31')]=qs['limit'](_0x11136b[_0xf139('0x4e')][_0xf139('0x31')]);_0x24b871[_0xf139('0x33')]=qs[_0xf139('0x33')](_0x11136b[_0xf139('0x4e')][_0xf139('0x33')]);}_0x24b871[_0xf139('0x53')]=qs[_0xf139('0x54')](_0x11136b[_0xf139('0x4e')][_0xf139('0x54')]);_0x24b871['where']=qs[_0xf139('0x4c')](_[_0xf139('0x56')](_0x11136b['query'],_0x4de929[_0xf139('0x4c')]));_0x24b871[_0xf139('0x55')][_0xf139('0x6d')]=_0x57abfb['id'];if(_0x11136b[_0xf139('0x4e')]['filter']){_0x24b871[_0xf139('0x55')]=_[_0xf139('0x58')](_0x24b871['where'],{'$or':_[_0xf139('0x44')](_0x24b871['attributes'],function(_0x533607){var _0x5274c7={};_0x5274c7[_0x533607]={'$like':'%'+_0x11136b[_0xf139('0x4e')][_0xf139('0x57')]+'%'};return _0x5274c7;})});}_0x24b871=_[_0xf139('0x58')]({},_0x24b871,_0x11136b[_0xf139('0x61')]);return db[_0xf139('0x92')][_0xf139('0x32')]({'where':_0x24b871[_0xf139('0x55')]})['then'](function(_0x23f8dd){_0x274924[_0xf139('0x32')]=_0x23f8dd;if(_0x11136b[_0xf139('0x4e')][_0xf139('0x60')]){_0x24b871[_0xf139('0x5a')]=[{'model':db[_0xf139('0x87')],'as':_0xf139('0xaf'),'required':![]},{'model':db['User'],'as':_0xf139('0xb0'),'attributes':[_0xf139('0x3f'),_0xf139('0xb1'),_0xf139('0xb2')],'required':![]},{'model':db[_0xf139('0xb3')],'as':'Tags','attributes':['id',_0xf139('0x3f'),'color'],'where':_0x11136b['query'][_0xf139('0xb4')]?{'id':_0x11136b['query'][_0xf139('0xb4')]}:undefined,'required':_0x11136b[_0xf139('0x4e')][_0xf139('0xb4')]?!![]:![]}];}return db[_0xf139('0x92')]['findAll'](_0x24b871);})[_0xf139('0x39')](function(_0x10cd86){_0x274924[_0xf139('0x5c')]=_0x10cd86;return _0x274924;});}})[_0xf139('0x39')](respondWithFilteredResult(_0x51d00c,_0x24b871))[_0xf139('0x2b')](handleError(_0x51d00c,null));};exports['addAgents']=function(_0x529c80,_0x2d82f3,_0x449ef9){return db[_0xf139('0x45')]['find']({'where':{'id':_0x529c80[_0xf139('0x5e')]['id']}})[_0xf139('0x39')](handleEntityNotFound(_0x2d82f3,null))['then'](function(_0x3ca49d){if(_0x3ca49d){return _0x3ca49d[_0xf139('0xb5')](_0x529c80[_0xf139('0x6a')][_0xf139('0x71')],_[_0xf139('0xb6')](_0x529c80[_0xf139('0x6a')],[_0xf139('0x71'),'id'])||{})['spread'](function(_0x47cf8f){for(var _0x511681=0x0;_0x511681<_0x529c80[_0xf139('0x6a')]['ids'][_0xf139('0x5f')];_0x511681+=0x1){socket[_0xf139('0xb7')](_0xf139('0xb8'),{'UserId':Number(_0x529c80['body']['ids'][_0x511681]),'OpenchannelAccountId':Number(_0x529c80[_0xf139('0x5e')]['id'])});}return _0x47cf8f;});}})[_0xf139('0x39')](respondWithResult(_0x2d82f3,null))['catch'](handleError(_0x2d82f3,null));};exports['removeAgents']=function(_0x4ca35c,_0x8ad93d,_0x46d890){return db[_0xf139('0x45')][_0xf139('0x62')]({'where':{'id':_0x4ca35c[_0xf139('0x5e')]['id']}})[_0xf139('0x39')](handleEntityNotFound(_0x8ad93d,null))[_0xf139('0x39')](function(_0x5e234e){if(_0x5e234e){return _0x5e234e['removeAgents'](_0x4ca35c[_0xf139('0x4e')]['ids'])[_0xf139('0x39')](function(){if(_[_0xf139('0xb9')](_0x4ca35c[_0xf139('0x4e')][_0xf139('0x71')])){for(var _0x293347=0x0;_0x293347<_0x4ca35c[_0xf139('0x4e')][_0xf139('0x71')][_0xf139('0x5f')];_0x293347+=0x1){socket[_0xf139('0xb7')]('userOpenchannelAccount:remove',{'UserId':Number(_0x4ca35c[_0xf139('0x4e')][_0xf139('0x71')][_0x293347]),'OpenchannelAccountId':Number(_0x4ca35c[_0xf139('0x5e')]['id'])});}}else{socket['emit'](_0xf139('0xba'),{'UserId':Number(_0x4ca35c[_0xf139('0x4e')][_0xf139('0x71')]),'OpenchannelAccountId':Number(_0x4ca35c['params']['id'])});}});}})[_0xf139('0x39')](respondWithStatusCode(_0x8ad93d,null))[_0xf139('0x2b')](handleError(_0x8ad93d,null));};exports[_0xf139('0xbb')]=function(_0x5dbf14,_0x642130,_0x3d8531){var _0x563ef8={};var _0x405567={};var _0x4f834c;var _0x4b527f;return db[_0xf139('0x45')][_0xf139('0x70')]({'where':{'id':_0x5dbf14[_0xf139('0x5e')]['id']}})[_0xf139('0x39')](handleEntityNotFound(_0x642130,null))['then'](function(_0x449615){if(_0x449615){_0x4f834c=_0x449615;_0x405567[_0xf139('0x4a')]=_[_0xf139('0x4b')](db[_0xf139('0x9e')][_0xf139('0x46')]);_0x405567[_0xf139('0x4e')]=_[_0xf139('0x4b')](_0x5dbf14[_0xf139('0x4e')]);_0x405567[_0xf139('0x4c')]=_[_0xf139('0x4d')](_0x405567[_0xf139('0x4a')],_0x405567[_0xf139('0x4e')]);_0x563ef8[_0xf139('0x4f')]=_[_0xf139('0x4d')](_0x405567[_0xf139('0x4a')],qs['fields'](_0x5dbf14[_0xf139('0x4e')][_0xf139('0x50')]));_0x563ef8[_0xf139('0x4f')]=_0x563ef8[_0xf139('0x4f')]['length']?_0x563ef8['attributes']:_0x405567[_0xf139('0x4a')];_0x563ef8[_0xf139('0x53')]=qs['sort'](_0x5dbf14[_0xf139('0x4e')][_0xf139('0x54')]);_0x563ef8[_0xf139('0x55')]=qs[_0xf139('0x4c')](_['pick'](_0x5dbf14[_0xf139('0x4e')],_0x405567[_0xf139('0x4c')]));if(_0x5dbf14['query'][_0xf139('0x57')]){_0x563ef8[_0xf139('0x55')]=_['merge'](_0x563ef8[_0xf139('0x55')],{'$or':_['map'](_0x563ef8[_0xf139('0x4f')],function(_0x910f8){var _0xab1c25={};_0xab1c25[_0x910f8]={'$like':'%'+_0x5dbf14[_0xf139('0x4e')][_0xf139('0x57')]+'%'};return _0xab1c25;})});}_0x563ef8=_[_0xf139('0x58')]({},_0x563ef8,_0x5dbf14['options']);return _0x4f834c[_0xf139('0xbb')](_0x563ef8);}})[_0xf139('0x39')](function(_0x14c715){if(_0x14c715){_0x4b527f=_0x14c715[_0xf139('0x5f')];if(!_0x5dbf14[_0xf139('0x4e')][_0xf139('0x51')](_0xf139('0x52'))){_0x563ef8[_0xf139('0x31')]=qs[_0xf139('0x31')](_0x5dbf14[_0xf139('0x4e')]['limit']);_0x563ef8['offset']=qs[_0xf139('0x33')](_0x5dbf14[_0xf139('0x4e')][_0xf139('0x33')]);}return _0x4f834c[_0xf139('0xbb')](_0x563ef8);}})[_0xf139('0x39')](function(_0xd4a46e){if(_0xd4a46e){return _0xd4a46e?{'count':_0x4b527f,'rows':_0xd4a46e}:null;}})['then'](respondWithResult(_0x642130,null))[_0xf139('0x2b')](handleError(_0x642130,null));};exports[_0xf139('0x40')]=function(_0x5a0362,_0x1540cd,_0x43db83){var _0x5ea09c,_0x356bb8,_0x46eddb;if(_[_0xf139('0x7d')](_0x5a0362['body'][_0xf139('0x6a')])||_0x5a0362[_0xf139('0x6a')][_0xf139('0x6a')]===''){throw new db[(_0xf139('0x82'))]['ValidationError'](_0xf139('0x80'));}if(_['isNil'](_0x5a0362['body']['to'])){}_0x5ea09c=_0x5a0362[_0xf139('0x6a')]['to'];return db[_0xf139('0x45')][_0xf139('0x70')]({'where':{'id':_0x5a0362['params']['id']}})[_0xf139('0x39')](handleEntityNotFound(_0x1540cd,null))[_0xf139('0x39')](function(_0x3eef5b){if(_0x3eef5b){return db[_0xf139('0x45')][_0xf139('0x62')]({'where':{'id':_0x3eef5b['id']},'include':[{'model':db[_0xf139('0x85')],'as':'List','include':[{'model':db[_0xf139('0x87')],'as':_0xf139('0x88'),'where':{[_0x3eef5b[_0xf139('0x81')]]:_0x5ea09c},'limit':0x1,'order':[[_0xf139('0x7a'),_0xf139('0xbc')]]}]}]})[_0xf139('0x39')](handleEntityNotFound(_0x1540cd,null))[_0xf139('0x39')](function(_0x176520){if(_0x176520&&_0x176520['List']){_0x356bb8=_0x176520[_0xf139('0x3b')]({'plain':!![]});if(_0x356bb8['List']&&_0x356bb8[_0xf139('0x86')][_0xf139('0x88')]['length']){return _0x356bb8['List'][_0xf139('0x88')][0x0];}return db[_0xf139('0x87')][_0xf139('0x63')](_[_0xf139('0x1b')](_0x5a0362[_0xf139('0x6a')],{'firstName':_0x5ea09c,[_0x176520[_0xf139('0x81')]]:_0x5ea09c,'phone':_0x5ea09c,'ListId':_0x356bb8[_0xf139('0x7c')]}));}})[_0xf139('0x39')](handleEntityNotFound(_0x1540cd,null))[_0xf139('0x39')](function(_0x6f411d){if(_0x6f411d){_0x46eddb=_0x6f411d;return db[_0xf139('0x92')][_0xf139('0x62')]({'where':{'ContactId':_0x46eddb['id'],'closed':![],'OpenchannelAccountId':_0x356bb8['id']}})['then'](function(_0x5a3d62){if(_0x5a3d62){return[_0x5a3d62,![]];}return db[_0xf139('0x92')][_0xf139('0x63')]({'UserId':_0x5a0362['user']['id'],'ContactId':_0x46eddb['id'],'OpenchannelAccountId':_0x356bb8['id'],'lastMsgDirection':_0xf139('0xbd'),'Messages':[_[_0xf139('0x58')](_0x5a0362[_0xf139('0x6a')],{'read':![],'body':_0x5a0362[_0xf139('0x6a')][_0xf139('0x6a')],'OpenchannelAccountId':_0x356bb8['id'],'UserId':_0x5a0362[_0xf139('0x66')]['id'],'ContactId':_0x46eddb['id']})]},{'include':[{'model':db[_0xf139('0xbe')],'as':_0xf139('0xbf')}]})[_0xf139('0x39')](function(_0x274c89){return[_0x274c89,!![]];});});}})[_0xf139('0x93')](function(_0xd56c87,_0x60b3da){if(_0x60b3da){return _0xd56c87;}return db[_0xf139('0xbe')][_0xf139('0x63')](_['merge'](_0x5a0362[_0xf139('0x6a')],{'read':![],'body':_0x5a0362[_0xf139('0x6a')]['body'],'OpenchannelAccountId':_0x356bb8['id'],'OpenchannelInteractionId':_0xd56c87['id'],'UserId':_0x5a0362['user']['id'],'ContactId':_0x46eddb['id']}))[_0xf139('0x39')](function(_0x156b70){_0xd56c87['dataValues'][_0xf139('0xbf')]=[];_0xd56c87[_0xf139('0xc0')][_0xf139('0xbf')][_0xf139('0x9a')](_0x156b70[_0xf139('0xc0')]);return _0xd56c87;});});}})['then'](respondWithResult(_0x1540cd,null))[_0xf139('0x2b')](handleError(_0x1540cd,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index e56fceb..4c69154 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 _0xb58b=['exports','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit','hook'];(function(_0x399fb4,_0x3b9673){var _0x599673=function(_0x5f16a1){while(--_0x5f16a1){_0x399fb4['push'](_0x399fb4['shift']());}};_0x599673(++_0x3b9673);}(_0xb58b,0x1f1));var _0xbb58=function(_0x272faf,_0x301a5e){_0x272faf=_0x272faf-0x0;var _0x4a1326=_0xb58b[_0x272faf];return _0x4a1326;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xbb58('0x0'))['db'][_0xbb58('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbb58('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbb58('0x3'),'afterDestroy':_0xbb58('0x4')};function emitEvent(_0x5c9ec5){return function(_0x226363,_0x546510,_0x2edb10){OpenchannelAccountEvents[_0xbb58('0x5')](_0x5c9ec5+':'+_0x226363['id'],_0x226363);OpenchannelAccountEvents[_0xbb58('0x5')](_0x5c9ec5,_0x226363);_0x2edb10(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xbb58('0x6')](e,emitEvent(event));}}module[_0xbb58('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x6f7a=['events','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x24ab29,_0x5a2687){_0x24ab29=_0x24ab29-0x0;var _0x482627=_0x6f7a[_0x24ab29];return _0x482627;};'use strict';var EventEmitter=require(_0xa6f7('0x0'));var OpenchannelAccount=require(_0xa6f7('0x1'))['db'][_0xa6f7('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xa6f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa6f7('0x4'),'afterDestroy':_0xa6f7('0x5')};function emitEvent(_0x12ecb8){return function(_0x1da6dc,_0x22e529,_0x1f5922){OpenchannelAccountEvents[_0xa6f7('0x6')](_0x12ecb8+':'+_0x1da6dc['id'],_0x1da6dc);OpenchannelAccountEvents[_0xa6f7('0x6')](_0x12ecb8,_0x1da6dc);_0x1f5922(null);};}for(var e in events){if(events[_0xa6f7('0x7')](e)){var event=events[e];OpenchannelAccount[_0xa6f7('0x8')](e,emitEvent(event));}}module[_0xa6f7('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index b03929b..f55cd50 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(_0x348c56,_0x502bfa){var _0x53dcb2=function(_0x3b3552){while(--_0x3b3552){_0x348c56['push'](_0x348c56['shift']());}};_0x53dcb2(++_0x502bfa);}(_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 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(_0x3888e2,_0x552ab7){var _0x1a1b9a=function(_0x17447f){while(--_0x17447f){_0x3888e2['push'](_0x3888e2['shift']());}};_0x1a1b9a(++_0x552ab7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 8119d5d..0db5a28 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 _0xf403=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash'];(function(_0x2081a0,_0x71ae16){var _0x3b508b=function(_0x22520d){while(--_0x22520d){_0x2081a0['push'](_0x2081a0['shift']());}};_0x3b508b(++_0x71ae16);}(_0xf403,0x1d3));var _0x3f40=function(_0x9d57c3,_0x1be523){_0x9d57c3=_0x9d57c3-0x0;var _0x40dcdb=_0xf403[_0x9d57c3];return _0x40dcdb;};'use strict';var _=require(_0x3f40('0x0'));var util=require('util');var moment=require(_0x3f40('0x1'));var BPromise=require(_0x3f40('0x2'));var rs=require(_0x3f40('0x3'));var fs=require('fs');var Redis=require(_0x3f40('0x4'));var db=require(_0x3f40('0x5'))['db'];var utils=require(_0x3f40('0x6'));var logger=require(_0x3f40('0x7'))(_0x3f40('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f40('0x9')][_0x3f40('0xa')]({'port':0x232a});config[_0x3f40('0xb')]=_[_0x3f40('0xc')](config['redis'],{'host':_0x3f40('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3f40('0xe'))[_0x3f40('0xf')](socket);function respondWithRpcPromise(_0x40d198,_0x5bf41d,_0x48c244){return new BPromise(function(_0x297a4e,_0x360e2c){return client[_0x3f40('0x10')](_0x40d198,_0x48c244)['then'](function(_0x378a3d){logger[_0x3f40('0x11')](_0x3f40('0x12'),_0x5bf41d,'request\x20sent');logger[_0x3f40('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5bf41d,_0x3f40('0x14'),JSON[_0x3f40('0x15')](_0x378a3d));if(_0x378a3d[_0x3f40('0x16')]){if(_0x378a3d[_0x3f40('0x16')]['code']===0x1f4){logger[_0x3f40('0x16')](_0x3f40('0x12'),_0x5bf41d,_0x378a3d[_0x3f40('0x16')][_0x3f40('0x17')]);return _0x360e2c(_0x378a3d[_0x3f40('0x16')]['message']);}logger[_0x3f40('0x16')](_0x3f40('0x12'),_0x5bf41d,_0x378a3d['error']['message']);return _0x297a4e(_0x378a3d['error'][_0x3f40('0x17')]);}else{logger[_0x3f40('0x11')](_0x3f40('0x12'),_0x5bf41d,_0x3f40('0x14'));_0x297a4e(_0x378a3d[_0x3f40('0x18')]['message']);}})[_0x3f40('0x19')](function(_0xaab367){logger[_0x3f40('0x16')](_0x3f40('0x12'),_0x5bf41d,_0xaab367);_0x360e2c(_0xaab367);});});} \ No newline at end of file +var _0x69d3=['socket.io-emitter','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x1c7b28,_0x11faab){var _0x37dd80=function(_0x2aada7){while(--_0x2aada7){_0x1c7b28['push'](_0x1c7b28['shift']());}};_0x37dd80(++_0x11faab);}(_0x69d3,0xda));var _0x369d=function(_0x3d87bf,_0x5ace25){_0x3d87bf=_0x3d87bf-0x0;var _0x1afd0d=_0x69d3[_0x3d87bf];return _0x1afd0d;};'use strict';var _=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var moment=require(_0x369d('0x2'));var BPromise=require('bluebird');var rs=require(_0x369d('0x3'));var fs=require('fs');var Redis=require(_0x369d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x369d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x369d('0x6'));var client=jayson[_0x369d('0x7')][_0x369d('0x8')]({'port':0x232a});config[_0x369d('0x9')]=_[_0x369d('0xa')](config[_0x369d('0x9')],{'host':_0x369d('0xb'),'port':0x18eb});var socket=require(_0x369d('0xc'))(new Redis(config[_0x369d('0x9')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x28bf6e,_0x222f5f,_0xe864f0){return new BPromise(function(_0x1cf530,_0x4c7850){return client['request'](_0x28bf6e,_0xe864f0)[_0x369d('0xd')](function(_0x40c00f){logger[_0x369d('0xe')](_0x369d('0xf'),_0x222f5f,_0x369d('0x10'));logger[_0x369d('0x11')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x222f5f,_0x369d('0x10'),JSON[_0x369d('0x12')](_0x40c00f));if(_0x40c00f[_0x369d('0x13')]){if(_0x40c00f[_0x369d('0x13')][_0x369d('0x14')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x222f5f,_0x40c00f['error'][_0x369d('0x15')]);return _0x4c7850(_0x40c00f[_0x369d('0x13')][_0x369d('0x15')]);}logger['error'](_0x369d('0xf'),_0x222f5f,_0x40c00f[_0x369d('0x13')][_0x369d('0x15')]);return _0x1cf530(_0x40c00f['error'][_0x369d('0x15')]);}else{logger[_0x369d('0xe')]('OpenchannelAccount,\x20%s,\x20%s',_0x222f5f,'request\x20sent');_0x1cf530(_0x40c00f['result'][_0x369d('0x15')]);}})[_0x369d('0x16')](function(_0x247a3b){logger['error'](_0x369d('0xf'),_0x222f5f,_0x247a3b);_0x4c7850(_0x247a3b);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 4ed2341..80f7c8d 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 _0xb28a=['removeListener','register','length','openchannelAccount:','save','remove'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb28a,0x166));var _0xab28=function(_0xc0167f,_0x8588f9){_0xc0167f=_0xc0167f-0x0;var _0x242195=_0xb28a[_0xc0167f];return _0x242195;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xab28('0x0'),_0xab28('0x1'),'update'];function createListener(_0x45d26d,_0x4cb73b){return function(_0x5ae2aa){_0x4cb73b['emit'](_0x45d26d,_0x5ae2aa);};}function removeListener(_0x451fc9,_0x1cdc41){return function(){OpenchannelAccountEvents[_0xab28('0x2')](_0x451fc9,_0x1cdc41);};}exports[_0xab28('0x3')]=function(_0x133169){for(var _0x128a13=0x0,_0x450e5b=events[_0xab28('0x4')];_0x128a13<_0x450e5b;_0x128a13++){var _0x48949b=events[_0x128a13];var _0x479267=createListener(_0xab28('0x5')+_0x48949b,_0x133169);OpenchannelAccountEvents['on'](_0x48949b,_0x479267);}}; \ No newline at end of file +var _0xf109=['remove','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf109,0xce));var _0x9f10=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xf109[_0x20ef64];return _0x3707d8;};'use strict';var OpenchannelAccountEvents=require(_0x9f10('0x0'));var events=[_0x9f10('0x1'),_0x9f10('0x2'),'update'];function createListener(_0x5b381d,_0x4cbc7a){return function(_0x3659ce){_0x4cbc7a[_0x9f10('0x3')](_0x5b381d,_0x3659ce);};}function removeListener(_0x74d0ee,_0x26f01c){return function(){OpenchannelAccountEvents[_0x9f10('0x4')](_0x74d0ee,_0x26f01c);};}exports[_0x9f10('0x5')]=function(_0x408fe8){for(var _0xd3137b=0x0,_0x227a29=events[_0x9f10('0x6')];_0xd3137b<_0x227a29;_0xd3137b++){var _0x3fd82f=events[_0xd3137b];var _0x5c8719=createListener(_0x9f10('0x7')+_0x3fd82f,_0x408fe8);OpenchannelAccountEvents['on'](_0x3fd82f,_0x5c8719);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 7c69f72..7622294 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 _0xffea=['put','/:id','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','post','create'];(function(_0x4c9460,_0xe846da){var _0x1332f4=function(_0x491651){while(--_0x491651){_0x4c9460['push'](_0x4c9460['shift']());}};_0x1332f4(++_0xe846da);}(_0xffea,0x1f3));var _0xaffe=function(_0xc2acb5,_0x48af8){_0xc2acb5=_0xc2acb5-0x0;var _0x4a06a5=_0xffea[_0xc2acb5];return _0x4a06a5;};'use strict';var multer=require(_0xaffe('0x0'));var util=require('util');var path=require(_0xaffe('0x1'));var timeout=require(_0xaffe('0x2'));var express=require(_0xaffe('0x3'));var router=express['Router']();var fs_extra=require(_0xaffe('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xaffe('0x5'));var config=require(_0xaffe('0x6'));var controller=require(_0xaffe('0x7'));router[_0xaffe('0x8')]('/',auth[_0xaffe('0x9')](),controller[_0xaffe('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xaffe('0xb')]);router[_0xaffe('0xc')]('/',auth[_0xaffe('0x9')](),controller[_0xaffe('0xd')]);router[_0xaffe('0xe')](_0xaffe('0xf'),auth[_0xaffe('0x9')](),controller[_0xaffe('0x10')]);router[_0xaffe('0x11')](_0xaffe('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xaffe('0x12')]=router; \ No newline at end of file +var _0x1e0e=['Router','fs-extra','../../config/environment','./openchannelApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','destroy','exports','util','connect-timeout','express'];(function(_0x38471b,_0x28df5b){var _0x347948=function(_0x3724cc){while(--_0x3724cc){_0x38471b['push'](_0x38471b['shift']());}};_0x347948(++_0x28df5b);}(_0x1e0e,0x12f));var _0xe1e0=function(_0x42632c,_0x20e2b1){_0x42632c=_0x42632c-0x0;var _0x3f92c9=_0x1e0e[_0x42632c];return _0x3f92c9;};'use strict';var multer=require('multer');var util=require(_0xe1e0('0x0'));var path=require('path');var timeout=require(_0xe1e0('0x1'));var express=require(_0xe1e0('0x2'));var router=express[_0xe1e0('0x3')]();var fs_extra=require(_0xe1e0('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe1e0('0x5'));var controller=require(_0xe1e0('0x6'));router[_0xe1e0('0x7')]('/',auth['isAuthenticated'](),controller[_0xe1e0('0x8')]);router[_0xe1e0('0x7')](_0xe1e0('0x9'),auth[_0xe1e0('0xa')](),controller[_0xe1e0('0xb')]);router[_0xe1e0('0xc')]('/',auth[_0xe1e0('0xa')](),controller[_0xe1e0('0xd')]);router[_0xe1e0('0xe')](_0xe1e0('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe1e0('0x9'),auth[_0xe1e0('0xa')](),controller[_0xe1e0('0xf')]);module[_0xe1e0('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index b87c7c8..b9da939 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 _0x5742=['*,*,*,*','INTEGER','STRING','noop'];(function(_0x36390c,_0x66b805){var _0x4c7b38=function(_0x5197c8){while(--_0x5197c8){_0x36390c['push'](_0x36390c['shift']());}};_0x4c7b38(++_0x66b805);}(_0x5742,0x1a5));var _0x2574=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x5742[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x2574('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x2574('0x1')],'allowNull':![],'defaultValue':_0x2574('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2574('0x1')]},'interval':{'type':Sequelize[_0x2574('0x1')],'defaultValue':_0x2574('0x3')}}; \ No newline at end of file +var _0x1747=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x4a09c6,_0x54ce5e){var _0x25d834=function(_0x272ccc){while(--_0x272ccc){_0x4a09c6['push'](_0x4a09c6['shift']());}};_0x25d834(++_0x54ce5e);}(_0x1747,0x117));var _0x7174=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x1747[_0xc0a3d3];return _0x3386e8;};'use strict';var Sequelize=require(_0x7174('0x0'));module[_0x7174('0x1')]={'priority':{'type':Sequelize[_0x7174('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7174('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7174('0x4')]()},'description':{'type':Sequelize[_0x7174('0x3')]},'interval':{'type':Sequelize[_0x7174('0x3')],'defaultValue':_0x7174('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 9bcd8e4..08f0c33 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 _0x2eda=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','options','OpenchannelApplication','includeAll','findAll','rows','catch','show','params','length','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send'];(function(_0x5d2f12,_0x2d8eed){var _0x5ab1fd=function(_0x3f49b1){while(--_0x3f49b1){_0x5d2f12['push'](_0x5d2f12['shift']());}};_0x5ab1fd(++_0x2d8eed);}(_0x2eda,0x156));var _0xa2ed=function(_0x26bcd0,_0x4bc5c9){_0x26bcd0=_0x26bcd0-0x0;var _0x1f60fe=_0x2eda[_0x26bcd0];return _0x1f60fe;};'use strict';var emlformat=require(_0xa2ed('0x0'));var rimraf=require(_0xa2ed('0x1'));var zipdir=require(_0xa2ed('0x2'));var jsonpatch=require(_0xa2ed('0x3'));var rp=require(_0xa2ed('0x4'));var moment=require(_0xa2ed('0x5'));var BPromise=require(_0xa2ed('0x6'));var Mustache=require(_0xa2ed('0x7'));var util=require(_0xa2ed('0x8'));var path=require(_0xa2ed('0x9'));var sox=require('sox');var csv=require(_0xa2ed('0xa'));var ejs=require(_0xa2ed('0xb'));var fs=require('fs');var fs_extra=require(_0xa2ed('0xc'));var _=require(_0xa2ed('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa2ed('0xe'));var deskjs=require(_0xa2ed('0xf'));var toCsv=require(_0xa2ed('0xa'));var querystring=require(_0xa2ed('0x10'));var Papa=require(_0xa2ed('0x11'));var Redis=require(_0xa2ed('0x12'));var authService=require(_0xa2ed('0x13'));var qs=require(_0xa2ed('0x14'));var as=require(_0xa2ed('0x15'));var hardwareService=require(_0xa2ed('0x16'));var logger=require(_0xa2ed('0x17'))(_0xa2ed('0x18'));var utils=require(_0xa2ed('0x19'));var config=require(_0xa2ed('0x1a'));var licenseUtil=require(_0xa2ed('0x1b'));var db=require(_0xa2ed('0x1c'))['db'];function respondWithStatusCode(_0x28b408,_0x118a34){_0x118a34=_0x118a34||0xcc;return function(_0x28a105){if(_0x28a105){return _0x28b408[_0xa2ed('0x1d')](_0x118a34);}return _0x28b408[_0xa2ed('0x1e')](_0x118a34)[_0xa2ed('0x1f')]();};}function respondWithResult(_0x350e58,_0x547e52){_0x547e52=_0x547e52||0xc8;return function(_0x3c3317){if(_0x3c3317){return _0x350e58[_0xa2ed('0x1e')](_0x547e52)[_0xa2ed('0x20')](_0x3c3317);}};}function respondWithFilteredResult(_0x460c13,_0x2de1e9){return function(_0x3baeaf){if(_0x3baeaf){var _0x2f0d72=typeof _0x2de1e9[_0xa2ed('0x21')]===_0xa2ed('0x22')&&typeof _0x2de1e9[_0xa2ed('0x23')]===_0xa2ed('0x22');var _0x5a3c69=_0x3baeaf[_0xa2ed('0x24')];var _0x1dfd58=_0x2f0d72?0x0:_0x2de1e9[_0xa2ed('0x21')];var _0x4a0584=_0x2f0d72?_0x3baeaf[_0xa2ed('0x24')]:_0x2de1e9['offset']+_0x2de1e9['limit'];var _0x7f1538;if(_0x4a0584>=_0x5a3c69){_0x4a0584=_0x5a3c69;_0x7f1538=0xc8;}else{_0x7f1538=0xce;}_0x460c13[_0xa2ed('0x1e')](_0x7f1538);return _0x460c13[_0xa2ed('0x25')](_0xa2ed('0x26'),_0x1dfd58+'-'+_0x4a0584+'/'+_0x5a3c69)[_0xa2ed('0x20')](_0x3baeaf);}return null;};}function patchUpdates(_0xbe6c38){return function(_0x5e81fb){try{jsonpatch[_0xa2ed('0x27')](_0x5e81fb,_0xbe6c38,!![]);}catch(_0x386207){return BPromise['reject'](_0x386207);}return _0x5e81fb[_0xa2ed('0x28')]();};}function saveUpdates(_0x44ef5b,_0x1e0fb4){return function(_0x4433a8){if(_0x4433a8){return _0x4433a8[_0xa2ed('0x29')](_0x44ef5b)[_0xa2ed('0x2a')](function(_0x69e355){return _0x69e355;});}return null;};}function removeEntity(_0x2e82cc,_0xab5891){return function(_0x2aab51){if(_0x2aab51){return _0x2aab51[_0xa2ed('0x2b')]()[_0xa2ed('0x2a')](function(){_0x2e82cc[_0xa2ed('0x1e')](0xcc)[_0xa2ed('0x1f')]();});}};}function handleEntityNotFound(_0x5abccd,_0x5a4c22){return function(_0x1610a2){if(!_0x1610a2){_0x5abccd[_0xa2ed('0x1d')](0x194);}return _0x1610a2;};}function handleError(_0x333d1b,_0x569cf8){_0x569cf8=_0x569cf8||0x1f4;return function(_0xac26be){logger[_0xa2ed('0x2c')](_0xac26be[_0xa2ed('0x2d')]);if(_0xac26be[_0xa2ed('0x2e')]){delete _0xac26be[_0xa2ed('0x2e')];}_0x333d1b[_0xa2ed('0x1e')](_0x569cf8)[_0xa2ed('0x2f')](_0xac26be);};}exports['index']=function(_0x23dcad,_0x2007ae){var _0x3ba6c1={},_0x31c081={},_0x207f50={'count':0x0,'rows':[]};var _0x3a97c4=_['map'](db['OpenchannelApplication'][_0xa2ed('0x30')],function(_0x21eb96){return{'name':_0x21eb96[_0xa2ed('0x31')],'type':_0x21eb96[_0xa2ed('0x32')][_0xa2ed('0x33')]};});_0x31c081[_0xa2ed('0x34')]=_['map'](_0x3a97c4,'name');_0x31c081[_0xa2ed('0x35')]=_[_0xa2ed('0x36')](_0x23dcad[_0xa2ed('0x35')]);_0x31c081[_0xa2ed('0x37')]=_[_0xa2ed('0x38')](_0x31c081[_0xa2ed('0x34')],_0x31c081[_0xa2ed('0x35')]);_0x3ba6c1[_0xa2ed('0x39')]=_['intersection'](_0x31c081[_0xa2ed('0x34')],qs[_0xa2ed('0x3a')](_0x23dcad[_0xa2ed('0x35')][_0xa2ed('0x3a')]));_0x3ba6c1[_0xa2ed('0x39')]=_0x3ba6c1[_0xa2ed('0x39')]['length']?_0x3ba6c1[_0xa2ed('0x39')]:_0x31c081[_0xa2ed('0x34')];if(!_0x23dcad['query']['hasOwnProperty'](_0xa2ed('0x3b'))){_0x3ba6c1[_0xa2ed('0x23')]=qs[_0xa2ed('0x23')](_0x23dcad[_0xa2ed('0x35')][_0xa2ed('0x23')]);_0x3ba6c1[_0xa2ed('0x21')]=qs[_0xa2ed('0x21')](_0x23dcad[_0xa2ed('0x35')]['offset']);}_0x3ba6c1[_0xa2ed('0x3c')]=qs[_0xa2ed('0x3d')](_0x23dcad[_0xa2ed('0x35')][_0xa2ed('0x3d')]);_0x3ba6c1[_0xa2ed('0x3e')]=qs[_0xa2ed('0x37')](_[_0xa2ed('0x3f')](_0x23dcad[_0xa2ed('0x35')],_0x31c081[_0xa2ed('0x37')]),_0x3a97c4);if(_0x23dcad['query'][_0xa2ed('0x40')]){_0x3ba6c1[_0xa2ed('0x3e')]=_[_0xa2ed('0x41')](_0x3ba6c1[_0xa2ed('0x3e')],{'$or':_[_0xa2ed('0x42')](_0x3a97c4,function(_0x345851){if(_0x345851['type']!=='VIRTUAL'){var _0x63a6e4={};_0x63a6e4[_0x345851[_0xa2ed('0x2e')]]={'$like':'%'+_0x23dcad[_0xa2ed('0x35')]['filter']+'%'};return _0x63a6e4;}})});}_0x3ba6c1=_[_0xa2ed('0x41')]({},_0x3ba6c1,_0x23dcad[_0xa2ed('0x43')]);var _0x3ca18e={'where':_0x3ba6c1['where']};return db[_0xa2ed('0x44')][_0xa2ed('0x24')](_0x3ca18e)[_0xa2ed('0x2a')](function(_0x23aede){_0x207f50[_0xa2ed('0x24')]=_0x23aede;if(_0x23dcad['query'][_0xa2ed('0x45')]){_0x3ba6c1['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0xa2ed('0x46')](_0x3ba6c1);})['then'](function(_0xa41c4e){_0x207f50[_0xa2ed('0x47')]=_0xa41c4e;return _0x207f50;})[_0xa2ed('0x2a')](respondWithFilteredResult(_0x2007ae,_0x3ba6c1))[_0xa2ed('0x48')](handleError(_0x2007ae,null));};exports[_0xa2ed('0x49')]=function(_0x556988,_0x413687){var _0x1468f3={'raw':!![],'where':{'id':_0x556988[_0xa2ed('0x4a')]['id']}},_0x223675={};_0x223675[_0xa2ed('0x34')]=_[_0xa2ed('0x36')](db[_0xa2ed('0x44')][_0xa2ed('0x30')]);_0x223675['query']=_[_0xa2ed('0x36')](_0x556988[_0xa2ed('0x35')]);_0x223675[_0xa2ed('0x37')]=_['intersection'](_0x223675[_0xa2ed('0x34')],_0x223675['query']);_0x1468f3['attributes']=_['intersection'](_0x223675[_0xa2ed('0x34')],qs['fields'](_0x556988[_0xa2ed('0x35')][_0xa2ed('0x3a')]));_0x1468f3['attributes']=_0x1468f3['attributes'][_0xa2ed('0x4b')]?_0x1468f3[_0xa2ed('0x39')]:_0x223675[_0xa2ed('0x34')];if(_0x556988['query'][_0xa2ed('0x45')]){_0x1468f3['include']=[{'all':!![]}];}_0x1468f3=_[_0xa2ed('0x41')]({},_0x1468f3,_0x556988[_0xa2ed('0x43')]);return db[_0xa2ed('0x44')]['find'](_0x1468f3)[_0xa2ed('0x2a')](handleEntityNotFound(_0x413687,null))['then'](respondWithResult(_0x413687,null))['catch'](handleError(_0x413687,null));};exports['create']=function(_0x597bbe,_0x6cdf68){return db[_0xa2ed('0x44')]['create'](_0x597bbe[_0xa2ed('0x4c')],{})[_0xa2ed('0x2a')](respondWithResult(_0x6cdf68,0xc9))[_0xa2ed('0x48')](handleError(_0x6cdf68,null));};exports[_0xa2ed('0x29')]=function(_0x216479,_0x191c5c){if(_0x216479[_0xa2ed('0x4c')]['id']){delete _0x216479[_0xa2ed('0x4c')]['id'];}return db[_0xa2ed('0x44')]['find']({'where':{'id':_0x216479[_0xa2ed('0x4a')]['id']}})[_0xa2ed('0x2a')](handleEntityNotFound(_0x191c5c,null))['then'](saveUpdates(_0x216479[_0xa2ed('0x4c')],null))['then'](respondWithResult(_0x191c5c,null))[_0xa2ed('0x48')](handleError(_0x191c5c,null));};exports[_0xa2ed('0x2b')]=function(_0x4516ca,_0x180484){return db[_0xa2ed('0x44')][_0xa2ed('0x4d')]({'where':{'id':_0x4516ca[_0xa2ed('0x4a')]['id']}})[_0xa2ed('0x2a')](handleEntityNotFound(_0x180484,null))['then'](removeEntity(_0x180484,null))[_0xa2ed('0x48')](handleError(_0x180484,null));}; \ No newline at end of file +var _0x6db0=['hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','create','find','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','stack','send','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','fields','length'];(function(_0x2e58cf,_0x49bce3){var _0x2960f5=function(_0x2ce10f){while(--_0x2ce10f){_0x2e58cf['push'](_0x2e58cf['shift']());}};_0x2960f5(++_0x49bce3);}(_0x6db0,0xf9));var _0x06db=function(_0x502226,_0x3e9bb2){_0x502226=_0x502226-0x0;var _0x243899=_0x6db0[_0x502226];return _0x243899;};'use strict';var emlformat=require(_0x06db('0x0'));var rimraf=require(_0x06db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06db('0x2'));var rp=require(_0x06db('0x3'));var moment=require(_0x06db('0x4'));var BPromise=require(_0x06db('0x5'));var Mustache=require(_0x06db('0x6'));var util=require('util');var path=require(_0x06db('0x7'));var sox=require(_0x06db('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06db('0x9'));var _=require(_0x06db('0xa'));var squel=require('squel');var crypto=require(_0x06db('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x06db('0xc'));var toCsv=require(_0x06db('0xd'));var querystring=require(_0x06db('0xe'));var Papa=require(_0x06db('0xf'));var Redis=require(_0x06db('0x10'));var authService=require(_0x06db('0x11'));var qs=require(_0x06db('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06db('0x13'));var logger=require(_0x06db('0x14'))(_0x06db('0x15'));var utils=require(_0x06db('0x16'));var config=require(_0x06db('0x17'));var licenseUtil=require(_0x06db('0x18'));var db=require(_0x06db('0x19'))['db'];function respondWithStatusCode(_0x2ce846,_0x260a74){_0x260a74=_0x260a74||0xcc;return function(_0x23672f){if(_0x23672f){return _0x2ce846[_0x06db('0x1a')](_0x260a74);}return _0x2ce846[_0x06db('0x1b')](_0x260a74)[_0x06db('0x1c')]();};}function respondWithResult(_0x1470c3,_0x1e8525){_0x1e8525=_0x1e8525||0xc8;return function(_0xdbd90b){if(_0xdbd90b){return _0x1470c3[_0x06db('0x1b')](_0x1e8525)[_0x06db('0x1d')](_0xdbd90b);}};}function respondWithFilteredResult(_0x2b0d76,_0x49a5b5){return function(_0x466887){if(_0x466887){var _0x54c2a4=typeof _0x49a5b5[_0x06db('0x1e')]==='undefined'&&typeof _0x49a5b5[_0x06db('0x1f')]===_0x06db('0x20');var _0x169461=_0x466887[_0x06db('0x21')];var _0xdb3776=_0x54c2a4?0x0:_0x49a5b5[_0x06db('0x1e')];var _0x1a2541=_0x54c2a4?_0x466887[_0x06db('0x21')]:_0x49a5b5[_0x06db('0x1e')]+_0x49a5b5[_0x06db('0x1f')];var _0x57a714;if(_0x1a2541>=_0x169461){_0x1a2541=_0x169461;_0x57a714=0xc8;}else{_0x57a714=0xce;}_0x2b0d76['status'](_0x57a714);return _0x2b0d76['set']('Content-Range',_0xdb3776+'-'+_0x1a2541+'/'+_0x169461)['json'](_0x466887);}return null;};}function patchUpdates(_0x199b95){return function(_0x2066e5){try{jsonpatch[_0x06db('0x22')](_0x2066e5,_0x199b95,!![]);}catch(_0xe0eef){return BPromise[_0x06db('0x23')](_0xe0eef);}return _0x2066e5[_0x06db('0x24')]();};}function saveUpdates(_0xc3a7ee,_0x276d15){return function(_0xd5c35b){if(_0xd5c35b){return _0xd5c35b[_0x06db('0x25')](_0xc3a7ee)[_0x06db('0x26')](function(_0x4b567c){return _0x4b567c;});}return null;};}function removeEntity(_0x4c9377,_0xe12c07){return function(_0x2dd8e7){if(_0x2dd8e7){return _0x2dd8e7[_0x06db('0x27')]()['then'](function(){_0x4c9377[_0x06db('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x371a81,_0x33ab2a){return function(_0x555265){if(!_0x555265){_0x371a81[_0x06db('0x1a')](0x194);}return _0x555265;};}function handleError(_0x57d974,_0x2e65c4){_0x2e65c4=_0x2e65c4||0x1f4;return function(_0x66fbde){logger['error'](_0x66fbde[_0x06db('0x28')]);if(_0x66fbde['name']){delete _0x66fbde['name'];}_0x57d974[_0x06db('0x1b')](_0x2e65c4)[_0x06db('0x29')](_0x66fbde);};}exports['index']=function(_0x4ba6c6,_0x5cf09b){var _0x2abe5e={},_0x528c79={},_0x79ab56={'count':0x0,'rows':[]};var _0x434a09=_[_0x06db('0x2a')](db[_0x06db('0x2b')][_0x06db('0x2c')],function(_0x2932d5){return{'name':_0x2932d5[_0x06db('0x2d')],'type':_0x2932d5[_0x06db('0x2e')][_0x06db('0x2f')]};});_0x528c79[_0x06db('0x30')]=_[_0x06db('0x2a')](_0x434a09,_0x06db('0x31'));_0x528c79[_0x06db('0x32')]=_['keys'](_0x4ba6c6['query']);_0x528c79['filters']=_[_0x06db('0x33')](_0x528c79[_0x06db('0x30')],_0x528c79[_0x06db('0x32')]);_0x2abe5e[_0x06db('0x34')]=_['intersection'](_0x528c79[_0x06db('0x30')],qs[_0x06db('0x35')](_0x4ba6c6[_0x06db('0x32')][_0x06db('0x35')]));_0x2abe5e[_0x06db('0x34')]=_0x2abe5e[_0x06db('0x34')][_0x06db('0x36')]?_0x2abe5e[_0x06db('0x34')]:_0x528c79[_0x06db('0x30')];if(!_0x4ba6c6[_0x06db('0x32')][_0x06db('0x37')](_0x06db('0x38'))){_0x2abe5e[_0x06db('0x1f')]=qs['limit'](_0x4ba6c6[_0x06db('0x32')][_0x06db('0x1f')]);_0x2abe5e['offset']=qs[_0x06db('0x1e')](_0x4ba6c6['query'][_0x06db('0x1e')]);}_0x2abe5e[_0x06db('0x39')]=qs[_0x06db('0x3a')](_0x4ba6c6[_0x06db('0x32')]['sort']);_0x2abe5e[_0x06db('0x3b')]=qs[_0x06db('0x3c')](_[_0x06db('0x3d')](_0x4ba6c6['query'],_0x528c79['filters']),_0x434a09);if(_0x4ba6c6[_0x06db('0x32')][_0x06db('0x3e')]){_0x2abe5e[_0x06db('0x3b')]=_[_0x06db('0x3f')](_0x2abe5e['where'],{'$or':_[_0x06db('0x2a')](_0x434a09,function(_0x53ae9c){if(_0x53ae9c[_0x06db('0x2e')]!==_0x06db('0x40')){var _0x627cf0={};_0x627cf0[_0x53ae9c[_0x06db('0x31')]]={'$like':'%'+_0x4ba6c6[_0x06db('0x32')]['filter']+'%'};return _0x627cf0;}})});}_0x2abe5e=_[_0x06db('0x3f')]({},_0x2abe5e,_0x4ba6c6[_0x06db('0x41')]);var _0x10a974={'where':_0x2abe5e[_0x06db('0x3b')]};return db[_0x06db('0x2b')][_0x06db('0x21')](_0x10a974)['then'](function(_0x5cbe9f){_0x79ab56['count']=_0x5cbe9f;if(_0x4ba6c6[_0x06db('0x32')]['includeAll']){_0x2abe5e[_0x06db('0x42')]=[{'all':!![]}];}return db[_0x06db('0x2b')][_0x06db('0x43')](_0x2abe5e);})[_0x06db('0x26')](function(_0x5742d1){_0x79ab56[_0x06db('0x44')]=_0x5742d1;return _0x79ab56;})['then'](respondWithFilteredResult(_0x5cf09b,_0x2abe5e))[_0x06db('0x45')](handleError(_0x5cf09b,null));};exports[_0x06db('0x46')]=function(_0x3756d9,_0x45384f){var _0x38734b={'raw':!![],'where':{'id':_0x3756d9[_0x06db('0x47')]['id']}},_0x275891={};_0x275891['model']=_[_0x06db('0x48')](db[_0x06db('0x2b')][_0x06db('0x2c')]);_0x275891[_0x06db('0x32')]=_[_0x06db('0x48')](_0x3756d9['query']);_0x275891[_0x06db('0x3c')]=_['intersection'](_0x275891['model'],_0x275891[_0x06db('0x32')]);_0x38734b[_0x06db('0x34')]=_[_0x06db('0x33')](_0x275891['model'],qs[_0x06db('0x35')](_0x3756d9[_0x06db('0x32')][_0x06db('0x35')]));_0x38734b['attributes']=_0x38734b['attributes']['length']?_0x38734b['attributes']:_0x275891[_0x06db('0x30')];if(_0x3756d9['query']['includeAll']){_0x38734b['include']=[{'all':!![]}];}_0x38734b=_[_0x06db('0x3f')]({},_0x38734b,_0x3756d9[_0x06db('0x41')]);return db[_0x06db('0x2b')]['find'](_0x38734b)[_0x06db('0x26')](handleEntityNotFound(_0x45384f,null))[_0x06db('0x26')](respondWithResult(_0x45384f,null))[_0x06db('0x45')](handleError(_0x45384f,null));};exports[_0x06db('0x49')]=function(_0x550429,_0x3f735c){return db[_0x06db('0x2b')][_0x06db('0x49')](_0x550429['body'],{})[_0x06db('0x26')](respondWithResult(_0x3f735c,0xc9))[_0x06db('0x45')](handleError(_0x3f735c,null));};exports[_0x06db('0x25')]=function(_0x3a4c80,_0x4faab5){if(_0x3a4c80['body']['id']){delete _0x3a4c80['body']['id'];}return db[_0x06db('0x2b')][_0x06db('0x4a')]({'where':{'id':_0x3a4c80['params']['id']}})[_0x06db('0x26')](handleEntityNotFound(_0x4faab5,null))['then'](saveUpdates(_0x3a4c80[_0x06db('0x4b')],null))[_0x06db('0x26')](respondWithResult(_0x4faab5,null))[_0x06db('0x45')](handleError(_0x4faab5,null));};exports[_0x06db('0x27')]=function(_0x598149,_0x31405f){return db['OpenchannelApplication']['find']({'where':{'id':_0x598149[_0x06db('0x47')]['id']}})[_0x06db('0x26')](handleEntityNotFound(_0x31405f,null))['then'](removeEntity(_0x31405f,null))[_0x06db('0x45')](handleError(_0x31405f,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 330e1a7..a20d0ea 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 _0xf428=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications','utf8mb4_unicode_ci','lodash'];(function(_0x2c090d,_0x158e2c){var _0x3d5ec2=function(_0x36f7b7){while(--_0x36f7b7){_0x2c090d['push'](_0x2c090d['shift']());}};_0x3d5ec2(++_0x158e2c);}(_0xf428,0xcf));var _0x8f42=function(_0x591af5,_0x1e1b5f){_0x591af5=_0x591af5-0x0;var _0x2487d5=_0xf428[_0x591af5];return _0x2487d5;};'use strict';var _=require(_0x8f42('0x0'));var util=require(_0x8f42('0x1'));var logger=require(_0x8f42('0x2'))(_0x8f42('0x3'));var moment=require(_0x8f42('0x4'));var BPromise=require(_0x8f42('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8f42('0x6'));var config=require(_0x8f42('0x7'));var attributes=require(_0x8f42('0x8'));module[_0x8f42('0x9')]=function(_0x4475ec,_0x389993){return _0x4475ec[_0x8f42('0xa')]('OpenchannelApplication',attributes,{'tableName':_0x8f42('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8f42('0xc')});}; \ No newline at end of file +var _0x6acb=['./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','path','../../config/environment'];(function(_0x2ef202,_0x594843){var _0x44b15c=function(_0x394824){while(--_0x394824){_0x2ef202['push'](_0x2ef202['shift']());}};_0x44b15c(++_0x594843);}(_0x6acb,0x19f));var _0xb6ac=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0x6acb[_0x291d3f];return _0x242080;};'use strict';var _=require(_0xb6ac('0x0'));var util=require('util');var logger=require(_0xb6ac('0x1'))(_0xb6ac('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6ac('0x3'));var rimraf=require('rimraf');var config=require(_0xb6ac('0x4'));var attributes=require(_0xb6ac('0x5'));module[_0xb6ac('0x6')]=function(_0x488331,_0x585061){return _0x488331[_0xb6ac('0x7')](_0xb6ac('0x8'),attributes,{'tableName':_0xb6ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb6ac('0xa'),'collate':_0xb6ac('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index a86de9c..bf30170 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 _0xda4f=['where','attributes','limit','UpdateOpenchannelApplication','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','update','body','options','raw'];(function(_0x412c8f,_0x11ec94){var _0x27c005=function(_0x127059){while(--_0x127059){_0x412c8f['push'](_0x412c8f['shift']());}};_0x27c005(++_0x11ec94);}(_0xda4f,0x1c7));var _0xfda4=function(_0x16d7e8,_0x4a1e67){_0x16d7e8=_0x16d7e8-0x0;var _0x153e55=_0xda4f[_0x16d7e8];return _0x153e55;};'use strict';var _=require('lodash');var util=require(_0xfda4('0x0'));var moment=require(_0xfda4('0x1'));var BPromise=require(_0xfda4('0x2'));var rs=require(_0xfda4('0x3'));var fs=require('fs');var Redis=require(_0xfda4('0x4'));var db=require(_0xfda4('0x5'))['db'];var utils=require(_0xfda4('0x6'));var logger=require(_0xfda4('0x7'))(_0xfda4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xfda4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c8255,_0x5df5b6,_0x11ad37){return new BPromise(function(_0x46b38b,_0x54da30){return client[_0xfda4('0xa')](_0x3c8255,_0x11ad37)[_0xfda4('0xb')](function(_0x534381){logger[_0xfda4('0xc')](_0xfda4('0xd'),_0x5df5b6,_0xfda4('0xe'));logger['debug'](_0xfda4('0xf'),_0x5df5b6,_0xfda4('0xe'),JSON[_0xfda4('0x10')](_0x534381));if(_0x534381[_0xfda4('0x11')]){if(_0x534381['error'][_0xfda4('0x12')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x5df5b6,_0x534381[_0xfda4('0x11')][_0xfda4('0x13')]);return _0x54da30(_0x534381[_0xfda4('0x11')][_0xfda4('0x13')]);}logger[_0xfda4('0x11')](_0xfda4('0xd'),_0x5df5b6,_0x534381['error'][_0xfda4('0x13')]);return _0x46b38b(_0x534381[_0xfda4('0x11')][_0xfda4('0x13')]);}else{logger['info'](_0xfda4('0xd'),_0x5df5b6,_0xfda4('0xe'));_0x46b38b(_0x534381['result']['message']);}})[_0xfda4('0x14')](function(_0x2658b1){logger[_0xfda4('0x11')](_0xfda4('0xd'),_0x5df5b6,_0x2658b1);_0x54da30(_0x2658b1);});});}exports['UpdateOpenchannelApplication']=function(_0x3fccb4){var _0x50653e=this;return new Promise(function(_0x474866,_0xed766d){return db['OpenchannelApplication'][_0xfda4('0x15')](_0x3fccb4[_0xfda4('0x16')],{'raw':_0x3fccb4[_0xfda4('0x17')]?_0x3fccb4['options'][_0xfda4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fccb4['options']?_0x3fccb4[_0xfda4('0x17')][_0xfda4('0x19')]||null:null,'attributes':_0x3fccb4[_0xfda4('0x17')]?_0x3fccb4[_0xfda4('0x17')][_0xfda4('0x1a')]||null:null,'limit':_0x3fccb4[_0xfda4('0x17')]?_0x3fccb4[_0xfda4('0x17')][_0xfda4('0x1b')]||null:null})[_0xfda4('0xb')](function(_0x1941b5){logger[_0xfda4('0xc')](_0xfda4('0x1c'),_0x3fccb4);logger[_0xfda4('0x1d')](_0xfda4('0x1c'),_0x3fccb4,JSON[_0xfda4('0x10')](_0x1941b5));_0x474866(_0x1941b5);})[_0xfda4('0x14')](function(_0x4fb43f){logger['error'](_0xfda4('0x1c'),_0x4fb43f['message'],_0x3fccb4);_0xed766d(_0x50653e['error'](0x1f4,_0x4fb43f[_0xfda4('0x13')]));});});}; \ No newline at end of file +var _0xa707=['../../config/logger','../../config/environment','jayson/promise','client','then','info','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','stringify','util','randomstring','../../config/utils'];(function(_0x4dea57,_0x3a7cf2){var _0x3bcbad=function(_0x54b667){while(--_0x54b667){_0x4dea57['push'](_0x4dea57['shift']());}};_0x3bcbad(++_0x3a7cf2);}(_0xa707,0x1bd));var _0x7a70=function(_0x3cd3ad,_0x5cd504){_0x3cd3ad=_0x3cd3ad-0x0;var _0x3f862e=_0xa707[_0x3cd3ad];return _0x3f862e;};'use strict';var _=require('lodash');var util=require(_0x7a70('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7a70('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7a70('0x2'));var logger=require(_0x7a70('0x3'))('rpc');var config=require(_0x7a70('0x4'));var jayson=require(_0x7a70('0x5'));var client=jayson[_0x7a70('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdaf9f8,_0x2a9630,_0x366c78){return new BPromise(function(_0xc74f98,_0x4a0568){return client['request'](_0xdaf9f8,_0x366c78)[_0x7a70('0x7')](function(_0x37be32){logger[_0x7a70('0x8')]('OpenchannelApplication,\x20%s,\x20%s',_0x2a9630,'request\x20sent');logger[_0x7a70('0x9')](_0x7a70('0xa'),_0x2a9630,_0x7a70('0xb'),JSON['stringify'](_0x37be32));if(_0x37be32['error']){if(_0x37be32[_0x7a70('0xc')][_0x7a70('0xd')]===0x1f4){logger[_0x7a70('0xc')](_0x7a70('0xe'),_0x2a9630,_0x37be32[_0x7a70('0xc')]['message']);return _0x4a0568(_0x37be32[_0x7a70('0xc')][_0x7a70('0xf')]);}logger['error'](_0x7a70('0xe'),_0x2a9630,_0x37be32[_0x7a70('0xc')][_0x7a70('0xf')]);return _0xc74f98(_0x37be32['error'][_0x7a70('0xf')]);}else{logger[_0x7a70('0x8')](_0x7a70('0xe'),_0x2a9630,'request\x20sent');_0xc74f98(_0x37be32[_0x7a70('0x10')][_0x7a70('0xf')]);}})[_0x7a70('0x11')](function(_0x22c72e){logger[_0x7a70('0xc')](_0x7a70('0xe'),_0x2a9630,_0x22c72e);_0x4a0568(_0x22c72e);});});}exports[_0x7a70('0x12')]=function(_0x306876){var _0x66b477=this;return new Promise(function(_0x3644db,_0x5184db){return db[_0x7a70('0x13')][_0x7a70('0x14')](_0x306876[_0x7a70('0x15')],{'raw':_0x306876['options']?_0x306876[_0x7a70('0x16')][_0x7a70('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x306876[_0x7a70('0x16')]?_0x306876[_0x7a70('0x16')][_0x7a70('0x18')]||null:null,'attributes':_0x306876[_0x7a70('0x16')]?_0x306876['options'][_0x7a70('0x19')]||null:null,'limit':_0x306876[_0x7a70('0x16')]?_0x306876['options'][_0x7a70('0x1a')]||null:null})[_0x7a70('0x7')](function(_0x1b4192){logger[_0x7a70('0x8')]('UpdateOpenchannelApplication',_0x306876);logger[_0x7a70('0x9')]('UpdateOpenchannelApplication',_0x306876,JSON[_0x7a70('0x1b')](_0x1b4192));_0x3644db(_0x1b4192);})['catch'](function(_0x466526){logger[_0x7a70('0xc')](_0x7a70('0x12'),_0x466526[_0x7a70('0xf')],_0x306876);_0x5184db(_0x66b477[_0x7a70('0xc')](0x1f4,_0x466526[_0x7a70('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 3ddcac5..16562f2 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 _0xab16=['post','/:id/tags','tracked','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','update','openchannel','openchannelinteraction:destroy','delete','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','describe','show','/:id/messages','getMessages','create'];(function(_0x32729c,_0xf5afd8){var _0x482cfd=function(_0x231471){while(--_0x231471){_0x32729c['push'](_0x32729c['shift']());}};_0x482cfd(++_0xf5afd8);}(_0xab16,0xb5));var _0x6ab1=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xab16[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x6ab1('0x0'));var util=require(_0x6ab1('0x1'));var path=require('path');var timeout=require(_0x6ab1('0x2'));var express=require(_0x6ab1('0x3'));var router=express[_0x6ab1('0x4')]();var fs_extra=require(_0x6ab1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6ab1('0x6'));var controller=require(_0x6ab1('0x7'));router[_0x6ab1('0x8')]('/',auth[_0x6ab1('0x9')](),controller['index']);router[_0x6ab1('0x8')]('/describe',auth[_0x6ab1('0x9')](),controller[_0x6ab1('0xa')]);router[_0x6ab1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6ab1('0xb')]);router[_0x6ab1('0x8')](_0x6ab1('0xc'),auth[_0x6ab1('0x9')](),controller[_0x6ab1('0xd')]);router[_0x6ab1('0x8')]('/:id/download',auth[_0x6ab1('0x9')](),controller['download']);router['post']('/',auth[_0x6ab1('0x9')](),controller[_0x6ab1('0xe')]);router[_0x6ab1('0xf')]('/:id/messages',auth[_0x6ab1('0x9')](),controller['addMessage']);router[_0x6ab1('0xf')](_0x6ab1('0x10'),auth[_0x6ab1('0x9')](),interaction[_0x6ab1('0x11')]('openchannel',_0x6ab1('0x12')),controller[_0x6ab1('0x13')]);router['put'](_0x6ab1('0x14'),auth['isAuthenticated'](),interaction[_0x6ab1('0x11')]('openchannel',_0x6ab1('0x15')),controller[_0x6ab1('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x6ab1('0x11')](_0x6ab1('0x17'),_0x6ab1('0x18')),controller['destroy']);router[_0x6ab1('0x19')]('/:id/tags',auth[_0x6ab1('0x9')](),controller[_0x6ab1('0x1a')]);module[_0x6ab1('0x1b')]=router; \ No newline at end of file +var _0x0bc9=['post','create','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','put','/:id','openchannel','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','show','/:id/messages'];(function(_0x48f58f,_0x3a9b8c){var _0x307523=function(_0x39b455){while(--_0x39b455){_0x48f58f['push'](_0x48f58f['shift']());}};_0x307523(++_0x3a9b8c);}(_0x0bc9,0x1ef));var _0x90bc=function(_0x65cf53,_0x50ee34){_0x65cf53=_0x65cf53-0x0;var _0x22ad45=_0x0bc9[_0x65cf53];return _0x22ad45;};'use strict';var multer=require(_0x90bc('0x0'));var util=require('util');var path=require(_0x90bc('0x1'));var timeout=require(_0x90bc('0x2'));var express=require(_0x90bc('0x3'));var router=express[_0x90bc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x90bc('0x5'));var interaction=require(_0x90bc('0x6'));var config=require(_0x90bc('0x7'));var controller=require(_0x90bc('0x8'));router[_0x90bc('0x9')]('/',auth[_0x90bc('0xa')](),controller['index']);router['get'](_0x90bc('0xb'),auth[_0x90bc('0xa')](),controller[_0x90bc('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x90bc('0xd')]);router['get'](_0x90bc('0xe'),auth[_0x90bc('0xa')](),controller['getMessages']);router[_0x90bc('0x9')]('/:id/download',auth[_0x90bc('0xa')](),controller['download']);router[_0x90bc('0xf')]('/',auth[_0x90bc('0xa')](),controller[_0x90bc('0x10')]);router[_0x90bc('0xf')](_0x90bc('0xe'),auth['isAuthenticated'](),controller[_0x90bc('0x11')]);router['post'](_0x90bc('0x12'),auth[_0x90bc('0xa')](),interaction[_0x90bc('0x13')]('openchannel',_0x90bc('0x14')),controller['addTags']);router[_0x90bc('0x15')](_0x90bc('0x16'),auth[_0x90bc('0xa')](),interaction[_0x90bc('0x13')](_0x90bc('0x17'),_0x90bc('0x18')),controller['update']);router[_0x90bc('0x19')](_0x90bc('0x16'),auth[_0x90bc('0xa')](),interaction['tracked'](_0x90bc('0x17'),_0x90bc('0x1a')),controller[_0x90bc('0x1b')]);router['delete'](_0x90bc('0x12'),auth['isAuthenticated'](),controller[_0x90bc('0x1c')]);module[_0x90bc('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 0854c20..0173e1d 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 _0x7579=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x3e364b,_0x408528){var _0x143875=function(_0x5b9c0b){while(--_0x5b9c0b){_0x3e364b['push'](_0x3e364b['shift']());}};_0x143875(++_0x408528);}(_0x7579,0x1e2));var _0x9757=function(_0x54c902,_0x16cc09){_0x54c902=_0x54c902-0x0;var _0x400037=_0x7579[_0x54c902];return _0x400037;};'use strict';var Sequelize=require(_0x9757('0x0'));module[_0x9757('0x1')]={'closed':{'type':Sequelize[_0x9757('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9757('0x3')]},'disposition':{'type':Sequelize[_0x9757('0x4')]},'secondDisposition':{'type':Sequelize[_0x9757('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9757('0x4')]},'read1stAt':{'type':Sequelize[_0x9757('0x3')]},'threadId':{'type':Sequelize[_0x9757('0x4')]},'externalUrl':{'type':Sequelize[_0x9757('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9757('0x5')]('in',_0x9757('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x9757('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x68f5=['ENUM','out','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x68f5,0x11a));var _0x568f=function(_0x455aa2,_0x5934f5){_0x455aa2=_0x455aa2-0x0;var _0x5b8d8d=_0x68f5[_0x455aa2];return _0x5b8d8d;};'use strict';var Sequelize=require(_0x568f('0x0'));module[_0x568f('0x1')]={'closed':{'type':Sequelize[_0x568f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x568f('0x3')]},'secondDisposition':{'type':Sequelize[_0x568f('0x3')]},'thirdDisposition':{'type':Sequelize[_0x568f('0x3')]},'note':{'type':Sequelize[_0x568f('0x3')]},'read1stAt':{'type':Sequelize[_0x568f('0x4')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x568f('0x3')]},'lastMsgAt':{'type':Sequelize[_0x568f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x568f('0x5')]('in',_0x568f('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index a3e2936..faac845 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 _0x25bf=['rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','catch','waiting','total','closed','UserId','talking','unmanaged','index','OpenchannelInteraction','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','from','tools_tags','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','having','`\x20=\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','text','start','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$lte','\x20IS\x20NULL','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','clone','DESC','isEmpty','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','options','body','describe','ids','findOne','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','include','findAll','setTags','omit','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','files','tmp','attachments','format','transcript-%d-%s.zip','User','firstName','lastName','Attachment','direction','OpenchannelAccount','mkdirSync','Openchannel','Account','Owner','N.A.','disposition','Public','Messages','existsSync','createReadStream','pipe','createWriteStream','basename','out','secret','renderFile','server','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x25bf,0x1d4));var _0xf25b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x25bf[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf25b('0x0'));var zipdir=require(_0xf25b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf25b('0x2'));var Mustache=require(_0xf25b('0x3'));var util=require(_0xf25b('0x4'));var path=require('path');var sox=require(_0xf25b('0x5'));var csv=require(_0xf25b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf25b('0x7'));var crypto=require(_0xf25b('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xf25b('0x9'));var toCsv=require(_0xf25b('0x6'));var querystring=require(_0xf25b('0xa'));var Papa=require(_0xf25b('0xb'));var Redis=require(_0xf25b('0xc'));var authService=require(_0xf25b('0xd'));var qs=require(_0xf25b('0xe'));var as=require(_0xf25b('0xf'));var pdf=require(_0xf25b('0x10'));var hardwareService=require(_0xf25b('0x11'));var logger=require(_0xf25b('0x12'))(_0xf25b('0x13'));var utils=require(_0xf25b('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf25b('0x15'))['db'];config[_0xf25b('0x16')]=_[_0xf25b('0x17')](config['redis'],{'host':_0xf25b('0x18'),'port':0x18eb});var socket=require(_0xf25b('0x19'))(new Redis(config[_0xf25b('0x16')]));require(_0xf25b('0x1a'))[_0xf25b('0x1b')](socket);function respondWithStatusCode(_0xe61c28,_0x37c3ec){_0x37c3ec=_0x37c3ec||0xcc;return function(_0x16b0b7){if(_0x16b0b7){return _0xe61c28[_0xf25b('0x1c')](_0x37c3ec);}return _0xe61c28[_0xf25b('0x1d')](_0x37c3ec)[_0xf25b('0x1e')]();};}function respondWithResult(_0x519ce3,_0x4b9ea5){_0x4b9ea5=_0x4b9ea5||0xc8;return function(_0x525451){if(_0x525451){return _0x519ce3[_0xf25b('0x1d')](_0x4b9ea5)[_0xf25b('0x1f')](_0x525451);}};}function respondWithFilteredResult(_0x307b2a,_0x2aa6d1){return function(_0x2610db){if(_0x2610db){var _0x2edc83=typeof _0x2aa6d1[_0xf25b('0x20')]===_0xf25b('0x21')&&typeof _0x2aa6d1[_0xf25b('0x22')]===_0xf25b('0x21');var _0x31a48d=_0x2610db[_0xf25b('0x23')];var _0xa2f02=_0x2edc83?0x0:_0x2aa6d1['offset'];var _0x8c2f73=_0x2edc83?_0x2610db[_0xf25b('0x23')]:_0x2aa6d1[_0xf25b('0x20')]+_0x2aa6d1['limit'];var _0x8029b6;if(_0x8c2f73>=_0x31a48d){_0x8c2f73=_0x31a48d;_0x8029b6=0xc8;}else{_0x8029b6=0xce;}_0x307b2a['status'](_0x8029b6);return _0x307b2a[_0xf25b('0x24')](_0xf25b('0x25'),_0xa2f02+'-'+_0x8c2f73+'/'+_0x31a48d)[_0xf25b('0x1f')](_0x2610db);}return null;};}function patchUpdates(_0x58ef3f){return function(_0x1dfac8){try{jsonpatch[_0xf25b('0x26')](_0x1dfac8,_0x58ef3f,!![]);}catch(_0x21807a){return BPromise[_0xf25b('0x27')](_0x21807a);}return _0x1dfac8[_0xf25b('0x28')]();};}function saveUpdates(_0x278240,_0x44d821){return function(_0x5c1c9f){if(_0x5c1c9f){return _0x5c1c9f[_0xf25b('0x29')](_0x278240)[_0xf25b('0x2a')](function(_0xf124d0){return _0xf124d0;});}return null;};}function removeEntity(_0x5933d9,_0x2848e9){return function(_0x2868ed){if(_0x2868ed){return _0x2868ed[_0xf25b('0x2b')]()[_0xf25b('0x2a')](function(){_0x5933d9[_0xf25b('0x1d')](0xcc)[_0xf25b('0x1e')]();});}};}function handleEntityNotFound(_0x155fe9,_0x5f0066){return function(_0x1c9368){if(!_0x1c9368){_0x155fe9[_0xf25b('0x1c')](0x194);}return _0x1c9368;};}function handleError(_0x24a855,_0x1d56ac){_0x1d56ac=_0x1d56ac||0x1f4;return function(_0x2aba7d){logger[_0xf25b('0x2c')](_0x2aba7d[_0xf25b('0x2d')]);if(_0x2aba7d[_0xf25b('0x2e')]){delete _0x2aba7d[_0xf25b('0x2e')];}_0x24a855[_0xf25b('0x1d')](_0x1d56ac)[_0xf25b('0x2f')](_0x2aba7d);};}function getInteractionUsers(_0xb8dc5b,_0x3c53b1){return new BPromise(function(_0xe7387e,_0x58ad73){try{if(_0x3c53b1[_0xb8dc5b['id']]){_0xb8dc5b[_0xf25b('0x30')]=_[_0xf25b('0x31')](_0x3c53b1[_0xb8dc5b['id']],function(_0x3384b9){return{'id':_0x3384b9['id'],'fullname':_0x3384b9[_0xf25b('0x32')]};});}}catch(_0x58ab4c){_0x58ad73(_0x58ab4c);}_0xe7387e(_0xb8dc5b);});}function getInteractionTags(_0x5355a5,_0x39b7b4){return new BPromise(function(_0x1a3443,_0x577054){try{if(_0x5355a5[_0xf25b('0x33')]){_0x5355a5['Tags']=[];_0x5355a5['TagIds'][_0xf25b('0x34')](',')[_0xf25b('0x35')](function(_0x47bc03){_0x5355a5[_0xf25b('0x36')][_0xf25b('0x37')](_0x39b7b4[_0x47bc03]);});}delete _0x5355a5['TagIds'];}catch(_0x153fb7){_0x577054(_0x153fb7);}_0x1a3443(_0x5355a5);});}function updateOpenchannelInteraction(_0x2db930,_0x2188d3,_0x3487ba){return new BPromise(function(_0x45fd03,_0xf0e389){return getInteractionUsers(_0x2db930,_0x3487ba)['then'](function(_0x246d54){return getInteractionTags(_0x246d54,_0x2188d3);})['then'](function(_0x575b0e){return getStateInteraction(_0x575b0e);})['then'](function(_0x356379){_0x45fd03(_0x356379);})[_0xf25b('0x38')](function(_0x1ea0d6){_0xf0e389(_0x1ea0d6);});});}function getStateInteraction(_0x181618){return new BPromise(function(_0x52d109){_0x181618[_0xf25b('0x39')]=0x0;_0x181618['talking']=0x0;_0x181618['answered']=0x0;_0x181618['unmanaged']=0x0;_0x181618[_0xf25b('0x3a')]=0x0;if(!_0x181618[_0xf25b('0x3b')]&&!_0x181618[_0xf25b('0x3c')]){_0x181618[_0xf25b('0x39')]+=0x1;}if(!_0x181618['closed']&&_0x181618[_0xf25b('0x3c')]){_0x181618['talking']+=0x1;if(_0x181618['waiting']){_0x181618[_0xf25b('0x39')]-=0x1;}}if(_0x181618['closed']&&_0x181618['UserId']){_0x181618['answered']+=0x1;if(_0x181618['talking']){_0x181618[_0xf25b('0x3d')]-=0x1;}}if(_0x181618[_0xf25b('0x3b')]&&!_0x181618[_0xf25b('0x3c')]){_0x181618[_0xf25b('0x3e')]+=0x1;if(_0x181618[_0xf25b('0x39')]){_0x181618['waiting']-=0x1;}}_0x181618[_0xf25b('0x3a')]+=0x1;_0x52d109(_0x181618);});}exports[_0xf25b('0x3f')]=function(_0x2295e4,_0x19fb36){var _0x49d1ae={},_0x1c0c07={},_0x40cf96={'count':0x0,'rows':[]};var _0x522ba5=_[_0xf25b('0x31')](db[_0xf25b('0x40')][_0xf25b('0x41')],function(_0x21e8a7){return{'name':_0x21e8a7[_0xf25b('0x42')],'type':_0x21e8a7[_0xf25b('0x43')]['key']};});_0x1c0c07['model']=_['map'](_0x522ba5,_0xf25b('0x2e'));_0x1c0c07['query']=_[_0xf25b('0x44')](_0x2295e4[_0xf25b('0x45')]);_0x1c0c07[_0xf25b('0x46')]=_[_0xf25b('0x47')](_0x1c0c07[_0xf25b('0x48')],_0x1c0c07['query']);_0x49d1ae[_0xf25b('0x49')]=_[_0xf25b('0x47')](_0x1c0c07[_0xf25b('0x48')],qs[_0xf25b('0x4a')](_0x2295e4[_0xf25b('0x45')][_0xf25b('0x4a')]));_0x49d1ae['attributes']=_0x49d1ae[_0xf25b('0x49')][_0xf25b('0x4b')]?_0x49d1ae[_0xf25b('0x49')]:_0x1c0c07[_0xf25b('0x48')];if(!_0x2295e4[_0xf25b('0x45')][_0xf25b('0x4c')](_0xf25b('0x4d'))){_0x49d1ae[_0xf25b('0x22')]=qs[_0xf25b('0x22')](_0x2295e4[_0xf25b('0x45')][_0xf25b('0x22')]);_0x49d1ae[_0xf25b('0x20')]=qs[_0xf25b('0x20')](_0x2295e4['query'][_0xf25b('0x20')]);}_0x49d1ae[_0xf25b('0x4e')]=qs[_0xf25b('0x4f')](_0x2295e4['query'][_0xf25b('0x4f')]);_0x49d1ae[_0xf25b('0x50')]=qs['filters'](_['pick'](_0x2295e4[_0xf25b('0x45')],_0x1c0c07[_0xf25b('0x46')]),_0x522ba5);var _0x41311c=[];var _0x629447=squel[_0xf25b('0x51')]()[_0xf25b('0x52')]('id')[_0xf25b('0x52')](_0xf25b('0x2e'))[_0xf25b('0x52')]('color')[_0xf25b('0x53')](_0xf25b('0x54'));var _0x12d3a3=squel[_0xf25b('0x51')]()['field'](_0xf25b('0x55'))[_0xf25b('0x52')](_0xf25b('0x56'))[_0xf25b('0x52')]('ui.OpenchannelInteractionId')[_0xf25b('0x53')]('user_has_openchannel_interactions','ui')['left_join'](_0xf25b('0x57'),'u',_0xf25b('0x58'));var _0x44dc10=squel['select']()[_0xf25b('0x53')]('openchannel_interactions','i')[_0xf25b('0x59')]('cm_contacts','c',_0xf25b('0x5a'))[_0xf25b('0x59')](_0xf25b('0x57'),'o',_0xf25b('0x5b'))[_0xf25b('0x59')]('openchannel_accounts','a',_0xf25b('0x5c'))[_0xf25b('0x59')](_0xf25b('0x5d'),'me',_0xf25b('0x5e'))[_0xf25b('0x59')](_0xf25b('0x5f'),'it',_0xf25b('0x60'))[_0xf25b('0x59')]('tools_tags','t',_0xf25b('0x61'));var _0x545bff=squel[_0xf25b('0x62')]();var _0x453cd8=[];var _0x522df1=squel[_0xf25b('0x62')]();var _0x391172;if(_0x2295e4[_0xf25b('0x45')][_0xf25b('0x63')]){_0x391172=as['parseSearch'](_0x2295e4['query'][_0xf25b('0x63')]);var _0x3d6ca8=_0x391172['sqlOperator'];for(var _0x14d942=0x0;_0x14d942<_0x391172['conditions'][_0xf25b('0x4b')];_0x14d942++){var _0x203edb=_0x391172[_0xf25b('0x64')][_0x14d942];var _0x28048e='i';var _0x51c3bd=_[_0xf25b('0x65')](_0x522ba5,[_0xf25b('0x2e'),_0x203edb[_0xf25b('0x52')]]);if(!_0x51c3bd){switch(_0x203edb[_0xf25b('0x52')]){case _0xf25b('0x66'):if(_0x203edb['value']==0x1){_0x44dc10[_0xf25b('0x67')]('`'+_0x203edb[_0xf25b('0x52')]+_0xf25b('0x68'));}else{_0x44dc10[_0xf25b('0x67')]('`'+_0x203edb[_0xf25b('0x52')]+'`\x20>\x200');}break;case _0xf25b('0x69'):if(_0x203edb['operator']===_0xf25b('0x6a')){if(_0x203edb[_0xf25b('0x6b')][_0xf25b('0x34')]('\x20')['length']>0x1){_0x545bff[_0x3d6ca8](_0xf25b('0x6c'),qs[_0xf25b('0x6d')](_0x203edb[_0xf25b('0x6b')]),null);}else{var _0x252068='%'+_0x203edb[_0xf25b('0x6b')]+'%';_0x545bff[_0x3d6ca8](_0xf25b('0x6e'),_0x252068,_0x252068,_0x252068);}}else{_0x51c3bd=_[_0xf25b('0x65')](_0x522ba5,[_0xf25b('0x2e'),_0xf25b('0x6f')]);_0x203edb['field']=_0xf25b('0x6f');_0x4774e1=as['buildExpression'](_0x28048e,_0x51c3bd['type'],_0x203edb);_0x545bff[_0x3d6ca8](_0x4774e1['text'],_0x4774e1['value']['start'],_0x4774e1[_0xf25b('0x6b')][_0xf25b('0x1e')]);}break;case'Tag':var _0x275bdb=_0x203edb[_0xf25b('0x6b')][_0xf25b('0x34')](',')['map'](function(_0x4d841f){return Number(_0x4d841f);});_0x275bdb[_0xf25b('0x35')](function(_0x4ce466){_0x522df1['or'](_0xf25b('0x70'),'%,'+_0x4ce466+',%');});_0x453cd8=_['union'](_0x453cd8,_0x275bdb);break;case'User':if(_0x203edb[_0xf25b('0x71')]===_0xf25b('0x6a')){_0x545bff[_0x3d6ca8](_0xf25b('0x72'),'%'+_0x203edb['value']+'%',null);}else{_0x51c3bd=_[_0xf25b('0x65')](_0x522ba5,[_0xf25b('0x2e'),'UserId']);_0x203edb[_0xf25b('0x52')]='UserId';_0x4774e1=as[_0xf25b('0x73')](_0x28048e,_0x51c3bd[_0xf25b('0x43')],_0x203edb);_0x545bff[_0x3d6ca8](_0x4774e1[_0xf25b('0x74')],_0x4774e1[_0xf25b('0x6b')][_0xf25b('0x75')],_0x4774e1[_0xf25b('0x6b')]['end']);}break;case'body':_0x4774e1=as['buildExpression']('me',null,_0x203edb);_0x545bff[_0x3d6ca8](_0x4774e1['text'],_0x4774e1[_0xf25b('0x6b')]['start'],_0x4774e1[_0xf25b('0x6b')]['end']);break;}}else{var _0x4774e1=as[_0xf25b('0x73')](_0x28048e,_0x51c3bd[_0xf25b('0x43')],_0x203edb);_0x545bff[_0x3d6ca8](_0x4774e1['text'],_0x4774e1[_0xf25b('0x6b')][_0xf25b('0x75')],_0x4774e1[_0xf25b('0x6b')][_0xf25b('0x1e')]);}}}else{var _0x55973e=_(_0x2295e4['query'])['keys']()['map'](function(_0x5ac2a1){return _[_0xf25b('0x76')](_0x522ba5,[_0xf25b('0x2e'),_0x5ac2a1])?_0x5ac2a1:undefined;})[_0xf25b('0x77')]()[_0xf25b('0x6b')]();if(!_['isEmpty'](_0x55973e)){_0x55973e[_0xf25b('0x35')](function(_0x4e12a7){if(_0x4e12a7===_0xf25b('0x78')){_0x44dc10[_0xf25b('0x50')](_0xf25b('0x79'),[][_0xf25b('0x7a')](_0x2295e4['query'][_0x4e12a7]));}else if(_0x4e12a7===_0xf25b('0x7b')){var _0x3eb376=JSON[_0xf25b('0x7c')](_0x2295e4[_0xf25b('0x45')][_0x4e12a7])['$gte'];var _0x1878b0=JSON['parse'](_0x2295e4['query'][_0x4e12a7])[_0xf25b('0x7d')];_0x44dc10['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3eb376,_0x1878b0);}else{if(_0x2295e4[_0xf25b('0x45')][_0x4e12a7]==='null'){_0x44dc10['where']('i.'+_0x4e12a7+_0xf25b('0x7e'));}else{_0x44dc10[_0xf25b('0x50')]('i.'+_0x4e12a7+'\x20=\x20?',_0x2295e4['query'][_0x4e12a7]);}}});}if(_0x2295e4['query'][_0xf25b('0x7f')]){if(_0x2295e4[_0xf25b('0x45')][_0xf25b('0x7f')]==0x1){_0x44dc10[_0xf25b('0x67')]('`unreadMessages`\x20=\x200');}else{_0x44dc10['having']('`unreadMessages`\x20>\x200');}}if(_0x2295e4[_0xf25b('0x45')][_0xf25b('0x80')]){_0x453cd8=_[_0xf25b('0x81')](_0x2295e4[_0xf25b('0x45')][_0xf25b('0x80')])?_0x2295e4[_0xf25b('0x45')][_0xf25b('0x80')]:new Array(_0x2295e4[_0xf25b('0x45')][_0xf25b('0x80')]);_0x453cd8[_0xf25b('0x35')](function(_0x311d35){_0x522df1['or'](_0xf25b('0x70'),'%,'+_0x311d35+',%');});}if(_0x2295e4['query'][_0xf25b('0x82')]){var _0x2f969c=_0x2295e4[_0xf25b('0x45')][_0xf25b('0x82')][_0xf25b('0x83')]('\x5c','\x5c\x5c')[_0xf25b('0x83')](/'/g,'\x27\x27');if(qs[_0xf25b('0x84')](_0x2f969c)){_0x545bff['or'](_0xf25b('0x85'),_0x2f969c+'%');}else{_0x545bff['or'](_0xf25b('0x86'),qs[_0xf25b('0x6d')](_0x2f969c))['or']('i.from\x20LIKE\x20?',_0x2f969c+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2f969c+'%');}}}_0x44dc10[_0xf25b('0x50')](_0x545bff);_0x44dc10['group'](_0xf25b('0x87'));var _0x5508d7={'type':db[_0xf25b('0x88')]['QueryTypes']['SELECT'],'raw':!![]};var _0x209a65=_0x44dc10[_0xf25b('0x89')]();_0x209a65['field']('i.id');_0x209a65['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf25b('0x66'));if(_0x49d1ae[_0xf25b('0x4e')]){_0x49d1ae[_0xf25b('0x4e')][_0xf25b('0x35')](function(_0x1bfe08){var _0x9c55d1=_0x1bfe08[0x0]==='contactName'?_0x1bfe08[0x0]:'i.'+_0x1bfe08[0x0];_0x44dc10[_0xf25b('0x4e')](_0x9c55d1,_0x1bfe08[0x1]===_0xf25b('0x8a')?![]:!![]);});}if(!_[_0xf25b('0x8b')](_0x453cd8)){_0x44dc10[_0xf25b('0x67')](_0x522df1);_0x209a65['where']('t.id\x20IN\x20?',_0x453cd8);}BPromise[_0xf25b('0x8c')]()[_0xf25b('0x2a')](function(){if(!_0x391172){if(_0x2295e4['query'][_0xf25b('0x78')])return;_0x209a65[_0xf25b('0x50')](_0xf25b('0x8d'));_0x44dc10[_0xf25b('0x50')](_0xf25b('0x8d'));return;}if(_0x2295e4['user'][_0xf25b('0x8e')]!==_0xf25b('0x8f'))return;return _0x2295e4[_0xf25b('0x90')][_0xf25b('0x91')]({'attributes':['id'],'raw':!![]})[_0xf25b('0x2a')](function(_0xf30e27){if(_[_0xf25b('0x8b')](_0xf30e27)){_0x209a65[_0xf25b('0x50')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x44dc10[_0xf25b('0x50')](_0xf25b('0x92'));}else{_0x209a65['where'](_0xf25b('0x79'),_[_0xf25b('0x31')](_0xf30e27,'id'));_0x44dc10['where'](_0xf25b('0x79'),_[_0xf25b('0x31')](_0xf30e27,'id'));}});})['then'](function(){if(_0x2295e4['user'][_0xf25b('0x8e')]==='agent'&&!_0x391172&&!_0x2295e4[_0xf25b('0x45')][_0xf25b('0x78')])return[];return db['sequelize']['query'](_0x209a65[_0xf25b('0x93')](),_0x5508d7);})[_0xf25b('0x2a')](function(_0x5a2944){_0x40cf96[_0xf25b('0x23')]=_0x5a2944[_0xf25b('0x4b')];if(_0x40cf96[_0xf25b('0x23')]===0x0)return[];return db[_0xf25b('0x94')][_0xf25b('0x45')](_0x629447[_0xf25b('0x93')](),_0x5508d7)[_0xf25b('0x2a')](function(_0x302563){_0x41311c=_[_0xf25b('0x95')](_0x302563,'id');_0x5508d7=_[_0xf25b('0x96')](_0x5508d7,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2295e4['query']['fields']){_0x49d1ae['attributes']['forEach'](function(_0xf065d7){_0x44dc10[_0xf25b('0x52')]('i.'+_0xf065d7);});}else{_0x44dc10[_0xf25b('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x44dc10[_0xf25b('0x52')](_0xf25b('0x97'),'Account.key');_0x44dc10[_0xf25b('0x52')](_0xf25b('0x98'),_0xf25b('0x99'));_0x44dc10[_0xf25b('0x52')](_0xf25b('0x9a'),'contactName');_0x44dc10[_0xf25b('0x52')](_0xf25b('0x9b'));_0x44dc10[_0xf25b('0x52')](_0xf25b('0x9c'),_0xf25b('0x9d'));_0x44dc10[_0xf25b('0x52')]('c.lastName',_0xf25b('0x9e'));_0x44dc10[_0xf25b('0x52')](_0xf25b('0x9f'),_0xf25b('0xa0'));_0x44dc10[_0xf25b('0x52')](_0xf25b('0xa1'),_0xf25b('0xa2'));_0x44dc10[_0xf25b('0x52')](_0xf25b('0xa3'),_0xf25b('0xa4'));_0x44dc10[_0xf25b('0x52')](_0xf25b('0xa5'),_0xf25b('0xa6'));_0x44dc10[_0xf25b('0x52')](_0xf25b('0xa7'),_0xf25b('0xa8'));_0x44dc10['field'](_0xf25b('0xa9'),'Owner.internal');_0x44dc10[_0xf25b('0x52')](_0xf25b('0xaa'),_0xf25b('0x33'));}if(_0x49d1ae[_0xf25b('0x22')])_0x44dc10['limit'](_0x49d1ae[_0xf25b('0x22')]);if(_0x49d1ae['offset'])_0x44dc10[_0xf25b('0x20')](_0x49d1ae[_0xf25b('0x20')]);return db[_0xf25b('0x94')][_0xf25b('0x45')](_0x44dc10[_0xf25b('0x93')](),_0x5508d7);})[_0xf25b('0x2a')](function(_0x2060bb){if(_0x2060bb['length']>0x0)_0x12d3a3['where'](_0xf25b('0xab'),_[_0xf25b('0x31')](_0x2060bb,'id'));return db[_0xf25b('0x94')][_0xf25b('0x45')](_0x12d3a3['toString'](),_0x5508d7)[_0xf25b('0x2a')](function(_0x28e2e1){var _0x5f2340=_[_0xf25b('0xac')](_0x28e2e1,_0xf25b('0xad'));var _0xf6c41b=[];_0x2060bb[_0xf25b('0x35')](function(_0x522d61){_0xf6c41b[_0xf25b('0x37')](updateOpenchannelInteraction(_0x522d61,_0x41311c,_0x5f2340));});return BPromise[_0xf25b('0xae')](_0xf6c41b);});});})[_0xf25b('0x2a')](function(_0x67d32e){_0x40cf96[_0xf25b('0xaf')]=_0x67d32e;return _0x40cf96;})[_0xf25b('0x2a')](respondWithFilteredResult(_0x19fb36,_0x49d1ae))[_0xf25b('0x38')](handleError(_0x19fb36,null));};exports[_0xf25b('0xb0')]=function(_0x565cb2,_0x5ac94a){var _0x183b4b={};if(_0x565cb2[_0xf25b('0x45')][_0xf25b('0x43')]&&_0x565cb2[_0xf25b('0x45')]['type']===_0xf25b('0x53')){_0x183b4b[_0xf25b('0x53')]=_0x565cb2[_0xf25b('0xb1')]['id'];}else{_0x183b4b['id']=_0x565cb2[_0xf25b('0xb1')]['id'];}var _0x315dda={'raw':![],'where':_0x183b4b},_0x215303={};_0x215303[_0xf25b('0x48')]=_[_0xf25b('0x44')](db['OpenchannelInteraction']['rawAttributes']);_0x215303[_0xf25b('0x45')]=_[_0xf25b('0x44')](_0x565cb2[_0xf25b('0x45')]);_0x215303[_0xf25b('0x46')]=_['intersection'](_0x215303[_0xf25b('0x48')],_0x215303[_0xf25b('0x45')]);_0x315dda['attributes']=_['intersection'](_0x215303[_0xf25b('0x48')],qs[_0xf25b('0x4a')](_0x565cb2[_0xf25b('0x45')][_0xf25b('0x4a')]));_0x315dda[_0xf25b('0x49')]=_0x315dda[_0xf25b('0x49')][_0xf25b('0x4b')]?_0x315dda['attributes']:_0x215303[_0xf25b('0x48')];if(_0x565cb2[_0xf25b('0x45')][_0xf25b('0xb2')]){_0x315dda['include']=[{'all':!![]}];}_0x315dda=_['merge']({},_0x315dda,_0x565cb2[_0xf25b('0xb3')]);return db[_0xf25b('0x40')][_0xf25b('0x65')](_0x315dda)[_0xf25b('0x2a')](handleEntityNotFound(_0x5ac94a,null))[_0xf25b('0x2a')](respondWithResult(_0x5ac94a,null))[_0xf25b('0x38')](handleError(_0x5ac94a,null));};exports['create']=function(_0x2852b1,_0x56db24){return db[_0xf25b('0x40')]['create'](_0x2852b1['body'],{})[_0xf25b('0x2a')](respondWithResult(_0x56db24,0xc9))[_0xf25b('0x38')](handleError(_0x56db24,null));};exports[_0xf25b('0x29')]=function(_0xc83c14,_0x47902c){if(_0xc83c14[_0xf25b('0xb4')]['id']){delete _0xc83c14['body']['id'];}return db[_0xf25b('0x40')][_0xf25b('0x65')]({'where':{'id':_0xc83c14[_0xf25b('0xb1')]['id']}})[_0xf25b('0x2a')](handleEntityNotFound(_0x47902c,null))[_0xf25b('0x2a')](saveUpdates(_0xc83c14[_0xf25b('0xb4')],null))['then'](respondWithResult(_0x47902c,null))[_0xf25b('0x38')](handleError(_0x47902c,null));};exports[_0xf25b('0x2b')]=function(_0x3f12fc,_0x250145){return db[_0xf25b('0x40')][_0xf25b('0x65')]({'where':{'id':_0x3f12fc[_0xf25b('0xb1')]['id']}})[_0xf25b('0x2a')](handleEntityNotFound(_0x250145,null))['then'](removeEntity(_0x250145,null))[_0xf25b('0x38')](handleError(_0x250145,null));};exports[_0xf25b('0xb5')]=function(_0x2fcd42,_0x27ee43){return db['OpenchannelInteraction']['describe']()[_0xf25b('0x2a')](respondWithResult(_0x27ee43,null))[_0xf25b('0x38')](handleError(_0x27ee43,null));};exports['addMessage']=function(_0x4f7df4,_0x498bf0,_0x331cf9){return db['OpenchannelMessage'][_0xf25b('0x65')]({'where':{'id':_0x4f7df4['params']['id']}})['then'](handleEntityNotFound(_0x498bf0,null))[_0xf25b('0x2a')](function(_0x2ce7d1){if(_0x2ce7d1){return _0x2ce7d1['addMessage'](_0x4f7df4['body'][_0xf25b('0xb6')],_['omit'](_0x4f7df4[_0xf25b('0xb4')],[_0xf25b('0xb6'),'id'])||{});}})[_0xf25b('0x2a')](respondWithResult(_0x498bf0,null))[_0xf25b('0x38')](handleError(_0x498bf0,null));};exports['getMessages']=function(_0x3fd70b,_0x11c725,_0x39b705){var _0x4c20f7={'raw':![],'where':{}};var _0x2ac733={};var _0x3bdb58={'count':0x0,'rows':[]};return db[_0xf25b('0x40')][_0xf25b('0xb7')]({'where':{'id':_0x3fd70b[_0xf25b('0xb1')]['id']}})['then'](handleEntityNotFound(_0x11c725,null))[_0xf25b('0x2a')](function(_0x2d8b85){if(_0x2d8b85){_0x2ac733['model']=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x2ac733[_0xf25b('0x45')]=_[_0xf25b('0x44')](_0x3fd70b[_0xf25b('0x45')]);_0x2ac733[_0xf25b('0x46')]=_[_0xf25b('0x47')](_0x2ac733[_0xf25b('0x48')],_0x2ac733[_0xf25b('0x45')]);_0x4c20f7['attributes']=_['intersection'](_0x2ac733[_0xf25b('0x48')],qs['fields'](_0x3fd70b['query'][_0xf25b('0x4a')]));_0x4c20f7[_0xf25b('0x49')]=_0x4c20f7['attributes'][_0xf25b('0x4b')]?_0x4c20f7[_0xf25b('0x49')]:_0x2ac733['model'];if(!_0x3fd70b[_0xf25b('0x45')][_0xf25b('0x4c')](_0xf25b('0x4d'))){_0x4c20f7[_0xf25b('0x22')]=qs[_0xf25b('0x22')](_0x3fd70b[_0xf25b('0x45')][_0xf25b('0x22')]);_0x4c20f7[_0xf25b('0x20')]=qs['offset'](_0x3fd70b[_0xf25b('0x45')][_0xf25b('0x20')]);}_0x4c20f7['order']=qs[_0xf25b('0x4f')](_0x3fd70b[_0xf25b('0x45')][_0xf25b('0x4f')]);_0x4c20f7['where']=qs[_0xf25b('0x46')](_[_0xf25b('0xb8')](_0x3fd70b[_0xf25b('0x45')],_0x2ac733[_0xf25b('0x46')]));_0x4c20f7['where'][_0xf25b('0xad')]=_0x2d8b85['id'];if(_0x3fd70b[_0xf25b('0x45')][_0xf25b('0x82')]){_0x4c20f7[_0xf25b('0x50')]=_[_0xf25b('0x96')](_0x4c20f7[_0xf25b('0x50')],{'$or':_['map'](_0x4c20f7[_0xf25b('0x49')],function(_0x1c977b){var _0x575348={};_0x575348[_0x1c977b]={'$like':'%'+_0x3fd70b[_0xf25b('0x45')][_0xf25b('0x82')]+'%'};return _0x575348;})});}if(_0x3fd70b[_0xf25b('0x45')][_0xf25b('0xb9')]){var _0x5382dd=_0x3fd70b[_0xf25b('0x45')][_0xf25b('0xb9')][_0xf25b('0x34')](',');var _0x5abcdc={};_0x5abcdc[_0x5382dd[0x0]]={'$gte':moment(_0x5382dd[0x1])['format'](_0xf25b('0xba'))};_0x4c20f7['where']=_[_0xf25b('0x96')](_0x4c20f7[_0xf25b('0x50')],_0x5abcdc);}_0x4c20f7=_[_0xf25b('0x96')]({},_0x4c20f7,_0x3fd70b[_0xf25b('0xb3')]);return db[_0xf25b('0xbb')][_0xf25b('0x23')]({'where':_0x4c20f7[_0xf25b('0x50')]})[_0xf25b('0x2a')](function(_0x5b2bba){_0x3bdb58['count']=_0x5b2bba;if(_0x3fd70b[_0xf25b('0x45')][_0xf25b('0xb2')]){_0x4c20f7[_0xf25b('0xbc')]=[{'all':!![]}];}return db[_0xf25b('0xbb')][_0xf25b('0xbd')](_0x4c20f7);})[_0xf25b('0x2a')](function(_0x1f226f){_0x3bdb58['rows']=_0x1f226f;return _0x3bdb58;});}})[_0xf25b('0x2a')](respondWithFilteredResult(_0x11c725,_0x4c20f7))[_0xf25b('0x38')](handleError(_0x11c725,null));};exports['addTags']=function(_0xfe8e9d,_0xcb975d,_0x238e68){return db[_0xf25b('0x40')][_0xf25b('0x65')]({'where':{'id':_0xfe8e9d['params']['id']}})['then'](handleEntityNotFound(_0xcb975d,null))[_0xf25b('0x2a')](function(_0x5cdb2f){if(_0x5cdb2f){return _0x5cdb2f[_0xf25b('0xbe')](_0xfe8e9d[_0xf25b('0xb4')][_0xf25b('0xb6')],_[_0xf25b('0xbf')](_0xfe8e9d[_0xf25b('0xb4')],[_0xf25b('0xb6'),'id'])||{})[_0xf25b('0xc0')](function(){return db['Tag'][_0xf25b('0xbd')]({'attributes':['id','name','color'],'where':{'id':_0xfe8e9d['body'][_0xf25b('0xb6')]}});})[_0xf25b('0x2a')](function(_0x1416d7){socket[_0xf25b('0xc1')](_0xf25b('0xc2'),{'id':Number(_0xfe8e9d[_0xf25b('0xb1')]['id']),'tags':_0x1416d7||[]});return{'id':Number(_0xfe8e9d['params']['id']),'tags':_0x1416d7||[]};});}})['then'](respondWithResult(_0xcb975d,null))[_0xf25b('0x38')](handleError(_0xcb975d,null));};exports[_0xf25b('0xc3')]=function(_0x39a122,_0x307c19,_0x519963){return db[_0xf25b('0x40')][_0xf25b('0x65')]({'where':{'id':_0x39a122['params']['id']}})[_0xf25b('0x2a')](handleEntityNotFound(_0x307c19,null))['then'](function(_0x251c5d){if(_0x251c5d){return _0x251c5d['removeTags'](_0x39a122[_0xf25b('0x45')][_0xf25b('0xb6')]);}})[_0xf25b('0x2a')](respondWithStatusCode(_0x307c19,null))[_0xf25b('0x38')](handleError(_0x307c19,null));};exports[_0xf25b('0xc4')]=function(_0x16afaa,_0x1b57e9){var _0x25e25e=moment()[_0xf25b('0xc5')]()[_0xf25b('0x93')]();var _0x1aa278=path[_0xf25b('0xc6')](config[_0xf25b('0xc7')],'server',_0xf25b('0xc8'),_0xf25b('0xc9'));var _0x1bebb6=path[_0xf25b('0xc6')](config[_0xf25b('0xc7')],'server',_0xf25b('0xc8'),_0xf25b('0xca'));var _0x32d49a=path['join'](_0x1aa278,_0x25e25e);var _0x155ed4=util[_0xf25b('0xcb')](_0xf25b('0xcc'),_0x16afaa[_0xf25b('0xb1')]['id'],_0x25e25e);var _0x56f465=path[_0xf25b('0xc6')](_0x1aa278,_0x155ed4);var _0x5313de=[];_0x5313de['push']({'model':db['User'],'as':_0xf25b('0xcd'),'attributes':['id',_0xf25b('0x32')],'raw':!![]});_0x5313de['push']({'model':db['CmContact'],'as':_0xf25b('0x69'),'attributes':['id',_0xf25b('0xce'),_0xf25b('0xcf')],'raw':!![]});if(_0x16afaa[_0xf25b('0x45')]['attachments']){_0x5313de[_0xf25b('0x37')]({'model':db[_0xf25b('0xd0')],'as':_0xf25b('0xd0'),'raw':!![]});}var _0x53af26=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0xf25b('0xb4'),_0xf25b('0x7b'),_0xf25b('0xd1'),'secret','read'],'include':_0x5313de}];_0x53af26[_0xf25b('0x37')]({'model':db[_0xf25b('0xd2')],'as':'Account','attributes':['id',_0xf25b('0x2e')]});_0x53af26[_0xf25b('0x37')]({'model':db[_0xf25b('0xcd')],'as':'Owner','attributes':['id',_0xf25b('0x32')]});return db[_0xf25b('0x40')][_0xf25b('0x65')]({'where':{'id':_0x16afaa[_0xf25b('0xb1')]['id']},'include':_0x53af26})[_0xf25b('0x2a')](handleEntityNotFound(_0x1b57e9,null))[_0xf25b('0x2a')](function(_0x4fdf00){if(_0x4fdf00){var _0x22e4af=_0x4fdf00['get']({'plain':!![]});fs[_0xf25b('0xd3')](_0x32d49a);var _0x3b7904={'channel':_0xf25b('0xd4'),'account':_0x22e4af[_0xf25b('0xd5')]['name'],'agent':_0x22e4af['Owner']?_0x22e4af[_0xf25b('0xd6')][_0xf25b('0x32')]:_0xf25b('0xd7'),'createdAt':moment(_0x22e4af[_0xf25b('0x7b')])[_0xf25b('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf25b('0x93')](),'closedAt':_0x22e4af['closed']?moment(_0x22e4af['closedAt'])[_0xf25b('0xcb')](_0xf25b('0xba'))[_0xf25b('0x93')]():'','disposition':_0x22e4af[_0xf25b('0xd8')],'visibility':_0x22e4af['threadId']?_0xf25b('0xd9'):'Private','messages':_(_0x22e4af[_0xf25b('0xda')])['filter']({'secret':![]})[_0xf25b('0x31')](function(_0x4a44f0){if(_0x4a44f0[_0xf25b('0xd0')]){var _0x3ab29e=path[_0xf25b('0xc6')](_0x1bebb6,_0x4a44f0[_0xf25b('0xd0')]['basename']);if(fs[_0xf25b('0xdb')](_0x3ab29e)){fs[_0xf25b('0xdc')](_0x3ab29e)[_0xf25b('0xdd')](fs[_0xf25b('0xde')](path[_0xf25b('0xc6')](_0x32d49a,_0x4a44f0[_0xf25b('0xd0')][_0xf25b('0xdf')])));}}return{'date':moment(_0x4a44f0[_0xf25b('0x7b')])['format'](_0xf25b('0xba'))[_0xf25b('0x93')](),'sender':_0x4a44f0['direction']===_0xf25b('0xe0')?_0x4a44f0[_0xf25b('0xcd')]?_0x4a44f0[_0xf25b('0xcd')][_0xf25b('0x32')]:'System':_0x4a44f0['Contact'][_0xf25b('0xce')]+(_0x4a44f0[_0xf25b('0x69')][_0xf25b('0xcf')]?'\x20'+_0x4a44f0['Contact'][_0xf25b('0xcf')]:''),'body':_0x4a44f0['Attachment']?_0x4a44f0['Attachment'][_0xf25b('0xdf')]:_0x4a44f0[_0xf25b('0xb4')],'direction':_0x4a44f0[_0xf25b('0xd1')]==='out'?'A':'C','secret':_0x4a44f0[_0xf25b('0xe1')],'read':_0x4a44f0[_0xf25b('0x7f')],'attachment':_0x4a44f0[_0xf25b('0xd0')]};})[_0xf25b('0x6b')]()};return ejs[_0xf25b('0xe2')](path[_0xf25b('0xc6')](config['root'],_0xf25b('0xe3'),_0xf25b('0xe4'),'downloadInteraction.ejs'),{'interaction':_0x3b7904})[_0xf25b('0x2a')](function(_0x107b61){var _0x199a08=path[_0xf25b('0xc6')](_0x32d49a,_0xf25b('0xe5')+_0x22e4af['id']+'-'+_0x25e25e+_0xf25b('0xe6'));var _0x1f55e1={'path':_0x199a08,'channel':_0xf25b('0xd4'),'interactionId':_0x22e4af['id']};return pdf[_0xf25b('0xe7')](_0x107b61,_0x1f55e1);})[_0xf25b('0x2a')](function(){return new BPromise(function(_0x1eaa41,_0x3b5228){zipdir(_0x32d49a,{'saveTo':_0x56f465},function(_0x216866,_0xca7c65){if(_0x216866)return _0x3b5228(_0x216866);return _0x1eaa41(_0xca7c65);});})[_0xf25b('0x2a')](function(){return new BPromise(function(_0x441301,_0x17c753){rimraf(_0x32d49a,function(_0x3d3ef0){if(_0x3d3ef0)_0x17c753(_0x3d3ef0);return _0x441301();});});})[_0xf25b('0x2a')](function(){return _0x1b57e9[_0xf25b('0xc4')](_0x56f465,_0x155ed4,function(_0x2d582f){if(_0x2d582f){console['log'](_0xf25b('0xe8'),_0x2d582f);}else{fs[_0xf25b('0xe9')](_0x56f465);}});});});}else{return _0x1b57e9[_0xf25b('0x1c')](0xc8);}})[_0xf25b('0x38')](handleError(_0x1b57e9,null));}; \ No newline at end of file +var _0x7c58=['ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','contactName','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','rows','show','params','rawAttributes','intersection','include','options','OpenchannelInteraction','create','describe','addMessage','ids','omit','getMessages','OpenchannelMessage','hasOwnProperty','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','Tag','color','openchannelInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','format','transcript-%d-%s.zip','CmContact','firstName','Attachment','Messages','createdAt','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','threadId','Public','existsSync','createReadStream','pipe','createWriteStream','lastName','basename','out','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','name','send','Users','map','fullname','TagIds','Tags','split','forEach','catch','waiting','unmanaged','total','closed','UserId','talking','answered','index','fieldName','type','key','query','keys','filters','fields','attributes','length','model','nolimit','order','sort','select','field','from','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','left_join','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?'];(function(_0xbb2483,_0x5380e6){var _0x1427bc=function(_0x45a3fc){while(--_0x45a3fc){_0xbb2483['push'](_0xbb2483['shift']());}};_0x1427bc(++_0x5380e6);}(_0x7c58,0x88));var _0x87c5=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7c58[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0x87c5('0x0'));var rimraf=require(_0x87c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x87c5('0x2'));var rp=require(_0x87c5('0x3'));var moment=require(_0x87c5('0x4'));var BPromise=require(_0x87c5('0x5'));var Mustache=require(_0x87c5('0x6'));var util=require(_0x87c5('0x7'));var path=require(_0x87c5('0x8'));var sox=require(_0x87c5('0x9'));var csv=require(_0x87c5('0xa'));var ejs=require(_0x87c5('0xb'));var fs=require('fs');var fs_extra=require(_0x87c5('0xc'));var _=require(_0x87c5('0xd'));var squel=require('squel');var crypto=require(_0x87c5('0xe'));var jsforce=require(_0x87c5('0xf'));var deskjs=require(_0x87c5('0x10'));var toCsv=require('to-csv');var querystring=require(_0x87c5('0x11'));var Papa=require('papaparse');var Redis=require(_0x87c5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x87c5('0x13'));var as=require(_0x87c5('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x87c5('0x15'))(_0x87c5('0x16'));var utils=require(_0x87c5('0x17'));var config=require(_0x87c5('0x18'));var licenseUtil=require(_0x87c5('0x19'));var db=require(_0x87c5('0x1a'))['db'];config[_0x87c5('0x1b')]=_[_0x87c5('0x1c')](config[_0x87c5('0x1b')],{'host':_0x87c5('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x87c5('0x1b')]));require(_0x87c5('0x1e'))['register'](socket);function respondWithStatusCode(_0xee0e2d,_0x2ea21e){_0x2ea21e=_0x2ea21e||0xcc;return function(_0x12b2ef){if(_0x12b2ef){return _0xee0e2d[_0x87c5('0x1f')](_0x2ea21e);}return _0xee0e2d[_0x87c5('0x20')](_0x2ea21e)[_0x87c5('0x21')]();};}function respondWithResult(_0x448446,_0x2d8f53){_0x2d8f53=_0x2d8f53||0xc8;return function(_0x5ec712){if(_0x5ec712){return _0x448446['status'](_0x2d8f53)[_0x87c5('0x22')](_0x5ec712);}};}function respondWithFilteredResult(_0x742dad,_0x2a45b6){return function(_0x4bc39b){if(_0x4bc39b){var _0x507984=typeof _0x2a45b6[_0x87c5('0x23')]===_0x87c5('0x24')&&typeof _0x2a45b6[_0x87c5('0x25')]===_0x87c5('0x24');var _0x557f2a=_0x4bc39b[_0x87c5('0x26')];var _0x51d7ac=_0x507984?0x0:_0x2a45b6['offset'];var _0x5de5ae=_0x507984?_0x4bc39b['count']:_0x2a45b6[_0x87c5('0x23')]+_0x2a45b6[_0x87c5('0x25')];var _0x144a22;if(_0x5de5ae>=_0x557f2a){_0x5de5ae=_0x557f2a;_0x144a22=0xc8;}else{_0x144a22=0xce;}_0x742dad[_0x87c5('0x20')](_0x144a22);return _0x742dad['set'](_0x87c5('0x27'),_0x51d7ac+'-'+_0x5de5ae+'/'+_0x557f2a)[_0x87c5('0x22')](_0x4bc39b);}return null;};}function patchUpdates(_0x540ff6){return function(_0x27f59b){try{jsonpatch['apply'](_0x27f59b,_0x540ff6,!![]);}catch(_0x5c43e5){return BPromise[_0x87c5('0x28')](_0x5c43e5);}return _0x27f59b[_0x87c5('0x29')]();};}function saveUpdates(_0x4de2c3,_0x38291f){return function(_0x5825fa){if(_0x5825fa){return _0x5825fa[_0x87c5('0x2a')](_0x4de2c3)[_0x87c5('0x2b')](function(_0x1c2be7){return _0x1c2be7;});}return null;};}function removeEntity(_0x3f5b8a,_0x4de3d0){return function(_0x12469e){if(_0x12469e){return _0x12469e[_0x87c5('0x2c')]()[_0x87c5('0x2b')](function(){_0x3f5b8a[_0x87c5('0x20')](0xcc)[_0x87c5('0x21')]();});}};}function handleEntityNotFound(_0x29570e,_0x5ba6f9){return function(_0x5570a9){if(!_0x5570a9){_0x29570e[_0x87c5('0x1f')](0x194);}return _0x5570a9;};}function handleError(_0x44b951,_0x5625a6){_0x5625a6=_0x5625a6||0x1f4;return function(_0x9e29de){logger[_0x87c5('0x2d')](_0x9e29de['stack']);if(_0x9e29de['name']){delete _0x9e29de[_0x87c5('0x2e')];}_0x44b951[_0x87c5('0x20')](_0x5625a6)[_0x87c5('0x2f')](_0x9e29de);};}function getInteractionUsers(_0x975846,_0x461553){return new BPromise(function(_0x2f0c72,_0x5cff43){try{if(_0x461553[_0x975846['id']]){_0x975846[_0x87c5('0x30')]=_[_0x87c5('0x31')](_0x461553[_0x975846['id']],function(_0x5891af){return{'id':_0x5891af['id'],'fullname':_0x5891af[_0x87c5('0x32')]};});}}catch(_0x50f910){_0x5cff43(_0x50f910);}_0x2f0c72(_0x975846);});}function getInteractionTags(_0x36d7f7,_0x3e1a77){return new BPromise(function(_0x1a60e4,_0x556f6d){try{if(_0x36d7f7[_0x87c5('0x33')]){_0x36d7f7[_0x87c5('0x34')]=[];_0x36d7f7[_0x87c5('0x33')][_0x87c5('0x35')](',')[_0x87c5('0x36')](function(_0x154cb2){_0x36d7f7[_0x87c5('0x34')]['push'](_0x3e1a77[_0x154cb2]);});}delete _0x36d7f7['TagIds'];}catch(_0x305263){_0x556f6d(_0x305263);}_0x1a60e4(_0x36d7f7);});}function updateOpenchannelInteraction(_0x33f6b5,_0x17fb75,_0x3ec95d){return new BPromise(function(_0x212337,_0xe33c3d){return getInteractionUsers(_0x33f6b5,_0x3ec95d)[_0x87c5('0x2b')](function(_0x57cf32){return getInteractionTags(_0x57cf32,_0x17fb75);})[_0x87c5('0x2b')](function(_0x4657f0){return getStateInteraction(_0x4657f0);})[_0x87c5('0x2b')](function(_0x2c43d3){_0x212337(_0x2c43d3);})[_0x87c5('0x37')](function(_0x3f8eb9){_0xe33c3d(_0x3f8eb9);});});}function getStateInteraction(_0x44f90e){return new BPromise(function(_0x3dfda4){_0x44f90e[_0x87c5('0x38')]=0x0;_0x44f90e['talking']=0x0;_0x44f90e['answered']=0x0;_0x44f90e[_0x87c5('0x39')]=0x0;_0x44f90e[_0x87c5('0x3a')]=0x0;if(!_0x44f90e[_0x87c5('0x3b')]&&!_0x44f90e[_0x87c5('0x3c')]){_0x44f90e['waiting']+=0x1;}if(!_0x44f90e[_0x87c5('0x3b')]&&_0x44f90e['UserId']){_0x44f90e[_0x87c5('0x3d')]+=0x1;if(_0x44f90e[_0x87c5('0x38')]){_0x44f90e['waiting']-=0x1;}}if(_0x44f90e['closed']&&_0x44f90e['UserId']){_0x44f90e[_0x87c5('0x3e')]+=0x1;if(_0x44f90e[_0x87c5('0x3d')]){_0x44f90e[_0x87c5('0x3d')]-=0x1;}}if(_0x44f90e[_0x87c5('0x3b')]&&!_0x44f90e[_0x87c5('0x3c')]){_0x44f90e[_0x87c5('0x39')]+=0x1;if(_0x44f90e[_0x87c5('0x38')]){_0x44f90e[_0x87c5('0x38')]-=0x1;}}_0x44f90e[_0x87c5('0x3a')]+=0x1;_0x3dfda4(_0x44f90e);});}exports[_0x87c5('0x3f')]=function(_0x5274c0,_0x1fce17){var _0x45a5fa={},_0x2baa19={},_0x2bccc8={'count':0x0,'rows':[]};var _0x1da94b=_[_0x87c5('0x31')](db['OpenchannelInteraction']['rawAttributes'],function(_0x2d3a6d){return{'name':_0x2d3a6d[_0x87c5('0x40')],'type':_0x2d3a6d[_0x87c5('0x41')][_0x87c5('0x42')]};});_0x2baa19['model']=_['map'](_0x1da94b,'name');_0x2baa19[_0x87c5('0x43')]=_[_0x87c5('0x44')](_0x5274c0[_0x87c5('0x43')]);_0x2baa19[_0x87c5('0x45')]=_['intersection'](_0x2baa19['model'],_0x2baa19[_0x87c5('0x43')]);_0x45a5fa['attributes']=_['intersection'](_0x2baa19['model'],qs[_0x87c5('0x46')](_0x5274c0['query'][_0x87c5('0x46')]));_0x45a5fa[_0x87c5('0x47')]=_0x45a5fa[_0x87c5('0x47')][_0x87c5('0x48')]?_0x45a5fa[_0x87c5('0x47')]:_0x2baa19[_0x87c5('0x49')];if(!_0x5274c0[_0x87c5('0x43')]['hasOwnProperty'](_0x87c5('0x4a'))){_0x45a5fa['limit']=qs[_0x87c5('0x25')](_0x5274c0[_0x87c5('0x43')]['limit']);_0x45a5fa['offset']=qs[_0x87c5('0x23')](_0x5274c0[_0x87c5('0x43')][_0x87c5('0x23')]);}_0x45a5fa[_0x87c5('0x4b')]=qs['sort'](_0x5274c0['query'][_0x87c5('0x4c')]);_0x45a5fa['where']=qs['filters'](_['pick'](_0x5274c0[_0x87c5('0x43')],_0x2baa19[_0x87c5('0x45')]),_0x1da94b);var _0x538d82=[];var _0x21c598=squel[_0x87c5('0x4d')]()['field']('id')[_0x87c5('0x4e')](_0x87c5('0x2e'))[_0x87c5('0x4e')]('color')[_0x87c5('0x4f')]('tools_tags');var _0x175327=squel[_0x87c5('0x4d')]()[_0x87c5('0x4e')](_0x87c5('0x50'))[_0x87c5('0x4e')]('u.fullname')[_0x87c5('0x4e')](_0x87c5('0x51'))[_0x87c5('0x4f')](_0x87c5('0x52'),'ui')['left_join'](_0x87c5('0x53'),'u',_0x87c5('0x54'));var _0x343938=squel[_0x87c5('0x4d')]()[_0x87c5('0x4f')]('openchannel_interactions','i')['left_join']('cm_contacts','c',_0x87c5('0x55'))['left_join']('users','o',_0x87c5('0x56'))['left_join'](_0x87c5('0x57'),'a',_0x87c5('0x58'))[_0x87c5('0x59')](_0x87c5('0x5a'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x87c5('0x59')](_0x87c5('0x5b'),'it',_0x87c5('0x5c'))[_0x87c5('0x59')](_0x87c5('0x5d'),'t',_0x87c5('0x5e'));var _0x22170c=squel[_0x87c5('0x5f')]();var _0x316ca9=[];var _0x459f66=squel[_0x87c5('0x5f')]();var _0x68deaf;if(_0x5274c0[_0x87c5('0x43')][_0x87c5('0x60')]){_0x68deaf=as[_0x87c5('0x61')](_0x5274c0[_0x87c5('0x43')][_0x87c5('0x60')]);var _0x59d0c=_0x68deaf[_0x87c5('0x62')];for(var _0x5cc1e6=0x0;_0x5cc1e6<_0x68deaf[_0x87c5('0x63')][_0x87c5('0x48')];_0x5cc1e6++){var _0x2ae8df=_0x68deaf[_0x87c5('0x63')][_0x5cc1e6];var _0x1c615c='i';var _0x5b3793=_[_0x87c5('0x64')](_0x1da94b,['name',_0x2ae8df[_0x87c5('0x4e')]]);if(!_0x5b3793){switch(_0x2ae8df[_0x87c5('0x4e')]){case _0x87c5('0x65'):if(_0x2ae8df[_0x87c5('0x66')]==0x1){_0x343938[_0x87c5('0x67')]('`'+_0x2ae8df[_0x87c5('0x4e')]+'`\x20=\x200');}else{_0x343938[_0x87c5('0x67')]('`'+_0x2ae8df['field']+_0x87c5('0x68'));}break;case _0x87c5('0x69'):if(_0x2ae8df[_0x87c5('0x6a')]===_0x87c5('0x6b')){if(_0x2ae8df['value'][_0x87c5('0x35')]('\x20')[_0x87c5('0x48')]>0x1){_0x22170c[_0x59d0c]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x87c5('0x6c')](_0x2ae8df[_0x87c5('0x66')]),null);}else{var _0x5af8a1='%'+_0x2ae8df[_0x87c5('0x66')]+'%';_0x22170c[_0x59d0c](_0x87c5('0x6d'),_0x5af8a1,_0x5af8a1,_0x5af8a1);}}else{_0x5b3793=_[_0x87c5('0x64')](_0x1da94b,['name',_0x87c5('0x6e')]);_0x2ae8df[_0x87c5('0x4e')]=_0x87c5('0x6e');_0x31ca5b=as[_0x87c5('0x6f')](_0x1c615c,_0x5b3793[_0x87c5('0x41')],_0x2ae8df);_0x22170c[_0x59d0c](_0x31ca5b[_0x87c5('0x70')],_0x31ca5b['value'][_0x87c5('0x71')],_0x31ca5b[_0x87c5('0x66')][_0x87c5('0x21')]);}break;case'Tag':var _0x3bf396=_0x2ae8df[_0x87c5('0x66')][_0x87c5('0x35')](',')['map'](function(_0x2c87ef){return Number(_0x2c87ef);});_0x3bf396['forEach'](function(_0x4ae782){_0x459f66['or'](_0x87c5('0x72'),'%,'+_0x4ae782+',%');});_0x316ca9=_[_0x87c5('0x73')](_0x316ca9,_0x3bf396);break;case _0x87c5('0x74'):if(_0x2ae8df[_0x87c5('0x6a')]===_0x87c5('0x6b')){_0x22170c[_0x59d0c](_0x87c5('0x75'),'%'+_0x2ae8df[_0x87c5('0x66')]+'%',null);}else{_0x5b3793=_[_0x87c5('0x64')](_0x1da94b,[_0x87c5('0x2e'),'UserId']);_0x2ae8df[_0x87c5('0x4e')]='UserId';_0x31ca5b=as['buildExpression'](_0x1c615c,_0x5b3793[_0x87c5('0x41')],_0x2ae8df);_0x22170c[_0x59d0c](_0x31ca5b['text'],_0x31ca5b[_0x87c5('0x66')]['start'],_0x31ca5b[_0x87c5('0x66')][_0x87c5('0x21')]);}break;case _0x87c5('0x76'):_0x31ca5b=as['buildExpression']('me',null,_0x2ae8df);_0x22170c[_0x59d0c](_0x31ca5b[_0x87c5('0x70')],_0x31ca5b[_0x87c5('0x66')][_0x87c5('0x71')],_0x31ca5b[_0x87c5('0x66')][_0x87c5('0x21')]);break;}}else{var _0x31ca5b=as[_0x87c5('0x6f')](_0x1c615c,_0x5b3793[_0x87c5('0x41')],_0x2ae8df);_0x22170c[_0x59d0c](_0x31ca5b[_0x87c5('0x70')],_0x31ca5b[_0x87c5('0x66')][_0x87c5('0x71')],_0x31ca5b[_0x87c5('0x66')][_0x87c5('0x21')]);}}}else{var _0x562c1a=_(_0x5274c0[_0x87c5('0x43')])[_0x87c5('0x44')]()[_0x87c5('0x31')](function(_0x989661){return _[_0x87c5('0x77')](_0x1da94b,[_0x87c5('0x2e'),_0x989661])?_0x989661:undefined;})[_0x87c5('0x78')]()[_0x87c5('0x66')]();if(!_[_0x87c5('0x79')](_0x562c1a)){_0x562c1a['forEach'](function(_0x5dc594){if(_0x5dc594===_0x87c5('0x7a')){_0x343938[_0x87c5('0x7b')](_0x87c5('0x7c'),[][_0x87c5('0x7d')](_0x5274c0[_0x87c5('0x43')][_0x5dc594]));}else if(_0x5dc594==='createdAt'){var _0x3a8d8e=JSON['parse'](_0x5274c0['query'][_0x5dc594])[_0x87c5('0x7e')];var _0x60254a=JSON[_0x87c5('0x7f')](_0x5274c0[_0x87c5('0x43')][_0x5dc594])[_0x87c5('0x80')];_0x343938[_0x87c5('0x7b')](_0x87c5('0x81'),_0x3a8d8e,_0x60254a);}else{if(_0x5274c0[_0x87c5('0x43')][_0x5dc594]===_0x87c5('0x82')){_0x343938[_0x87c5('0x7b')]('i.'+_0x5dc594+'\x20IS\x20NULL');}else{_0x343938[_0x87c5('0x7b')]('i.'+_0x5dc594+_0x87c5('0x83'),_0x5274c0[_0x87c5('0x43')][_0x5dc594]);}}});}if(_0x5274c0[_0x87c5('0x43')][_0x87c5('0x84')]){if(_0x5274c0[_0x87c5('0x43')][_0x87c5('0x84')]==0x1){_0x343938[_0x87c5('0x67')](_0x87c5('0x85'));}else{_0x343938['having'](_0x87c5('0x86'));}}if(_0x5274c0['query'][_0x87c5('0x87')]){_0x316ca9=_[_0x87c5('0x88')](_0x5274c0['query'][_0x87c5('0x87')])?_0x5274c0[_0x87c5('0x43')][_0x87c5('0x87')]:new Array(_0x5274c0[_0x87c5('0x43')][_0x87c5('0x87')]);_0x316ca9[_0x87c5('0x36')](function(_0x58a090){_0x459f66['or'](_0x87c5('0x72'),'%,'+_0x58a090+',%');});}if(_0x5274c0[_0x87c5('0x43')][_0x87c5('0x89')]){var _0x2a6020=_0x5274c0[_0x87c5('0x43')][_0x87c5('0x89')][_0x87c5('0x8a')]('\x5c','\x5c\x5c')[_0x87c5('0x8a')](/'/g,'\x27\x27');if(qs[_0x87c5('0x8b')](_0x2a6020)){_0x22170c['or'](_0x87c5('0x8c'),_0x2a6020+'%');}else{_0x22170c['or'](_0x87c5('0x8d'),qs[_0x87c5('0x6c')](_0x2a6020))['or'](_0x87c5('0x8e'),_0x2a6020+'%')['or'](_0x87c5('0x8f'),_0x2a6020+'%');}}}_0x343938['where'](_0x22170c);_0x343938[_0x87c5('0x90')](_0x87c5('0x91'));var _0x1ac845={'type':db['Sequelize'][_0x87c5('0x92')][_0x87c5('0x93')],'raw':!![]};var _0x2eec40=_0x343938[_0x87c5('0x94')]();_0x2eec40[_0x87c5('0x4e')]('i.id');_0x2eec40['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x87c5('0x65'));if(_0x45a5fa[_0x87c5('0x4b')]){_0x45a5fa[_0x87c5('0x4b')][_0x87c5('0x36')](function(_0x58e914){var _0x19e0e8=_0x58e914[0x0]===_0x87c5('0x95')?_0x58e914[0x0]:'i.'+_0x58e914[0x0];_0x343938[_0x87c5('0x4b')](_0x19e0e8,_0x58e914[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x316ca9)){_0x343938[_0x87c5('0x67')](_0x459f66);_0x2eec40[_0x87c5('0x7b')](_0x87c5('0x96'),_0x316ca9);}BPromise['resolve']()[_0x87c5('0x2b')](function(){if(!_0x68deaf){if(_0x5274c0[_0x87c5('0x43')][_0x87c5('0x7a')])return;_0x2eec40[_0x87c5('0x7b')](_0x87c5('0x97'));_0x343938['where'](_0x87c5('0x97'));return;}if(_0x5274c0[_0x87c5('0x98')][_0x87c5('0x99')]!==_0x87c5('0x9a'))return;return _0x5274c0['user'][_0x87c5('0x9b')]({'attributes':['id'],'raw':!![]})[_0x87c5('0x2b')](function(_0x5b15ab){if(_[_0x87c5('0x79')](_0x5b15ab)){_0x2eec40[_0x87c5('0x7b')](_0x87c5('0x9c'));_0x343938[_0x87c5('0x7b')](_0x87c5('0x9c'));}else{_0x2eec40[_0x87c5('0x7b')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x5b15ab,'id'));_0x343938[_0x87c5('0x7b')](_0x87c5('0x7c'),_[_0x87c5('0x31')](_0x5b15ab,'id'));}});})['then'](function(){if(_0x5274c0['user']['role']===_0x87c5('0x9a')&&!_0x68deaf&&!_0x5274c0['query'][_0x87c5('0x7a')])return[];return db['sequelize'][_0x87c5('0x43')](_0x2eec40['toString'](),_0x1ac845);})[_0x87c5('0x2b')](function(_0x251bf2){_0x2bccc8[_0x87c5('0x26')]=_0x251bf2[_0x87c5('0x48')];if(_0x2bccc8[_0x87c5('0x26')]===0x0)return[];return db[_0x87c5('0x9d')][_0x87c5('0x43')](_0x21c598['toString'](),_0x1ac845)['then'](function(_0x582281){_0x538d82=_[_0x87c5('0x9e')](_0x582281,'id');_0x1ac845=_[_0x87c5('0x9f')](_0x1ac845,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5274c0[_0x87c5('0x43')]['fields']){_0x45a5fa[_0x87c5('0x47')]['forEach'](function(_0x1477e3){_0x343938['field']('i.'+_0x1477e3);});}else{_0x343938['field'](_0x87c5('0xa0'),_0x87c5('0x65'));_0x343938['field']('a.key','Account.key');_0x343938[_0x87c5('0x4e')]('a.mandatoryDisposition',_0x87c5('0xa1'));_0x343938[_0x87c5('0x4e')]('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',_0x87c5('0x95'));_0x343938[_0x87c5('0x4e')]('i.*');_0x343938[_0x87c5('0x4e')](_0x87c5('0xa2'),_0x87c5('0xa3'));_0x343938[_0x87c5('0x4e')]('c.lastName','Contact.lastName');_0x343938['field'](_0x87c5('0xa4'),'Contact.email');_0x343938[_0x87c5('0x4e')](_0x87c5('0xa5'),_0x87c5('0xa6'));_0x343938[_0x87c5('0x4e')](_0x87c5('0xa7'),_0x87c5('0xa8'));_0x343938[_0x87c5('0x4e')]('c.fax',_0x87c5('0xa9'));_0x343938[_0x87c5('0x4e')](_0x87c5('0xaa'),_0x87c5('0xab'));_0x343938[_0x87c5('0x4e')](_0x87c5('0xac'),_0x87c5('0xad'));_0x343938[_0x87c5('0x4e')](_0x87c5('0xae'),_0x87c5('0x33'));}if(_0x45a5fa[_0x87c5('0x25')])_0x343938['limit'](_0x45a5fa[_0x87c5('0x25')]);if(_0x45a5fa[_0x87c5('0x23')])_0x343938[_0x87c5('0x23')](_0x45a5fa[_0x87c5('0x23')]);return db[_0x87c5('0x9d')]['query'](_0x343938[_0x87c5('0xaf')](),_0x1ac845);})[_0x87c5('0x2b')](function(_0x3b28b4){if(_0x3b28b4['length']>0x0)_0x175327['where'](_0x87c5('0xb0'),_[_0x87c5('0x31')](_0x3b28b4,'id'));return db[_0x87c5('0x9d')][_0x87c5('0x43')](_0x175327['toString'](),_0x1ac845)['then'](function(_0xbd95cc){var _0x15de68=_[_0x87c5('0xb1')](_0xbd95cc,_0x87c5('0xb2'));var _0x5af9fb=[];_0x3b28b4[_0x87c5('0x36')](function(_0x2c5de0){_0x5af9fb[_0x87c5('0xb3')](updateOpenchannelInteraction(_0x2c5de0,_0x538d82,_0x15de68));});return BPromise[_0x87c5('0xb4')](_0x5af9fb);});});})[_0x87c5('0x2b')](function(_0x360e96){_0x2bccc8[_0x87c5('0xb5')]=_0x360e96;return _0x2bccc8;})[_0x87c5('0x2b')](respondWithFilteredResult(_0x1fce17,_0x45a5fa))['catch'](handleError(_0x1fce17,null));};exports[_0x87c5('0xb6')]=function(_0x47c948,_0x520839){var _0x23ac1a={};if(_0x47c948['query']['type']&&_0x47c948['query'][_0x87c5('0x41')]==='from'){_0x23ac1a[_0x87c5('0x4f')]=_0x47c948[_0x87c5('0xb7')]['id'];}else{_0x23ac1a['id']=_0x47c948[_0x87c5('0xb7')]['id'];}var _0x36ff72={'raw':![],'where':_0x23ac1a},_0x44e5be={};_0x44e5be[_0x87c5('0x49')]=_[_0x87c5('0x44')](db['OpenchannelInteraction'][_0x87c5('0xb8')]);_0x44e5be[_0x87c5('0x43')]=_[_0x87c5('0x44')](_0x47c948[_0x87c5('0x43')]);_0x44e5be[_0x87c5('0x45')]=_[_0x87c5('0xb9')](_0x44e5be['model'],_0x44e5be[_0x87c5('0x43')]);_0x36ff72[_0x87c5('0x47')]=_['intersection'](_0x44e5be[_0x87c5('0x49')],qs[_0x87c5('0x46')](_0x47c948[_0x87c5('0x43')][_0x87c5('0x46')]));_0x36ff72[_0x87c5('0x47')]=_0x36ff72['attributes'][_0x87c5('0x48')]?_0x36ff72[_0x87c5('0x47')]:_0x44e5be[_0x87c5('0x49')];if(_0x47c948['query']['includeAll']){_0x36ff72[_0x87c5('0xba')]=[{'all':!![]}];}_0x36ff72=_[_0x87c5('0x9f')]({},_0x36ff72,_0x47c948[_0x87c5('0xbb')]);return db[_0x87c5('0xbc')]['find'](_0x36ff72)[_0x87c5('0x2b')](handleEntityNotFound(_0x520839,null))[_0x87c5('0x2b')](respondWithResult(_0x520839,null))[_0x87c5('0x37')](handleError(_0x520839,null));};exports[_0x87c5('0xbd')]=function(_0x1b6bb5,_0x5c5f99){return db[_0x87c5('0xbc')][_0x87c5('0xbd')](_0x1b6bb5[_0x87c5('0x76')],{})['then'](respondWithResult(_0x5c5f99,0xc9))[_0x87c5('0x37')](handleError(_0x5c5f99,null));};exports[_0x87c5('0x2a')]=function(_0x28ae1f,_0x2e6d4d){if(_0x28ae1f[_0x87c5('0x76')]['id']){delete _0x28ae1f['body']['id'];}return db[_0x87c5('0xbc')][_0x87c5('0x64')]({'where':{'id':_0x28ae1f[_0x87c5('0xb7')]['id']}})[_0x87c5('0x2b')](handleEntityNotFound(_0x2e6d4d,null))['then'](saveUpdates(_0x28ae1f['body'],null))[_0x87c5('0x2b')](respondWithResult(_0x2e6d4d,null))['catch'](handleError(_0x2e6d4d,null));};exports['destroy']=function(_0x2c3826,_0x1b342f){return db[_0x87c5('0xbc')]['find']({'where':{'id':_0x2c3826[_0x87c5('0xb7')]['id']}})['then'](handleEntityNotFound(_0x1b342f,null))['then'](removeEntity(_0x1b342f,null))['catch'](handleError(_0x1b342f,null));};exports['describe']=function(_0x48b67a,_0xa4599f){return db['OpenchannelInteraction'][_0x87c5('0xbe')]()[_0x87c5('0x2b')](respondWithResult(_0xa4599f,null))['catch'](handleError(_0xa4599f,null));};exports[_0x87c5('0xbf')]=function(_0x525409,_0x22d704,_0x5615ba){return db['OpenchannelMessage']['find']({'where':{'id':_0x525409[_0x87c5('0xb7')]['id']}})[_0x87c5('0x2b')](handleEntityNotFound(_0x22d704,null))['then'](function(_0x54eb3f){if(_0x54eb3f){return _0x54eb3f[_0x87c5('0xbf')](_0x525409[_0x87c5('0x76')][_0x87c5('0xc0')],_[_0x87c5('0xc1')](_0x525409[_0x87c5('0x76')],[_0x87c5('0xc0'),'id'])||{});}})[_0x87c5('0x2b')](respondWithResult(_0x22d704,null))['catch'](handleError(_0x22d704,null));};exports[_0x87c5('0xc2')]=function(_0x128171,_0x128e28,_0x27bdff){var _0x6b9e17={'raw':![],'where':{}};var _0x54961e={};var _0x536d7a={'count':0x0,'rows':[]};return db[_0x87c5('0xbc')]['findOne']({'where':{'id':_0x128171[_0x87c5('0xb7')]['id']}})[_0x87c5('0x2b')](handleEntityNotFound(_0x128e28,null))[_0x87c5('0x2b')](function(_0x366ba8){if(_0x366ba8){_0x54961e[_0x87c5('0x49')]=_[_0x87c5('0x44')](db[_0x87c5('0xc3')]['rawAttributes']);_0x54961e[_0x87c5('0x43')]=_['keys'](_0x128171[_0x87c5('0x43')]);_0x54961e['filters']=_[_0x87c5('0xb9')](_0x54961e[_0x87c5('0x49')],_0x54961e[_0x87c5('0x43')]);_0x6b9e17[_0x87c5('0x47')]=_['intersection'](_0x54961e['model'],qs[_0x87c5('0x46')](_0x128171[_0x87c5('0x43')][_0x87c5('0x46')]));_0x6b9e17[_0x87c5('0x47')]=_0x6b9e17[_0x87c5('0x47')][_0x87c5('0x48')]?_0x6b9e17['attributes']:_0x54961e[_0x87c5('0x49')];if(!_0x128171[_0x87c5('0x43')][_0x87c5('0xc4')]('nolimit')){_0x6b9e17[_0x87c5('0x25')]=qs['limit'](_0x128171['query'][_0x87c5('0x25')]);_0x6b9e17[_0x87c5('0x23')]=qs[_0x87c5('0x23')](_0x128171[_0x87c5('0x43')][_0x87c5('0x23')]);}_0x6b9e17['order']=qs[_0x87c5('0x4c')](_0x128171[_0x87c5('0x43')][_0x87c5('0x4c')]);_0x6b9e17[_0x87c5('0x7b')]=qs[_0x87c5('0x45')](_[_0x87c5('0xc5')](_0x128171[_0x87c5('0x43')],_0x54961e[_0x87c5('0x45')]));_0x6b9e17[_0x87c5('0x7b')][_0x87c5('0xb2')]=_0x366ba8['id'];if(_0x128171[_0x87c5('0x43')][_0x87c5('0x89')]){_0x6b9e17[_0x87c5('0x7b')]=_['merge'](_0x6b9e17[_0x87c5('0x7b')],{'$or':_[_0x87c5('0x31')](_0x6b9e17['attributes'],function(_0x3f0508){var _0x383885={};_0x383885[_0x3f0508]={'$like':'%'+_0x128171[_0x87c5('0x43')][_0x87c5('0x89')]+'%'};return _0x383885;})});}if(_0x128171[_0x87c5('0x43')][_0x87c5('0x7e')]){var _0x2896c1=_0x128171[_0x87c5('0x43')][_0x87c5('0x7e')][_0x87c5('0x35')](',');var _0x1d8a02={};_0x1d8a02[_0x2896c1[0x0]]={'$gte':moment(_0x2896c1[0x1])['format'](_0x87c5('0xc6'))};_0x6b9e17[_0x87c5('0x7b')]=_[_0x87c5('0x9f')](_0x6b9e17[_0x87c5('0x7b')],_0x1d8a02);}_0x6b9e17=_[_0x87c5('0x9f')]({},_0x6b9e17,_0x128171[_0x87c5('0xbb')]);return db['OpenchannelMessage'][_0x87c5('0x26')]({'where':_0x6b9e17['where']})[_0x87c5('0x2b')](function(_0x4a022c){_0x536d7a[_0x87c5('0x26')]=_0x4a022c;if(_0x128171[_0x87c5('0x43')]['includeAll']){_0x6b9e17['include']=[{'all':!![]}];}return db[_0x87c5('0xc3')][_0x87c5('0xc7')](_0x6b9e17);})[_0x87c5('0x2b')](function(_0x42f59a){_0x536d7a[_0x87c5('0xb5')]=_0x42f59a;return _0x536d7a;});}})[_0x87c5('0x2b')](respondWithFilteredResult(_0x128e28,_0x6b9e17))[_0x87c5('0x37')](handleError(_0x128e28,null));};exports[_0x87c5('0xc8')]=function(_0x494cb1,_0x16d3d,_0x2bd671){return db[_0x87c5('0xbc')][_0x87c5('0x64')]({'where':{'id':_0x494cb1['params']['id']}})[_0x87c5('0x2b')](handleEntityNotFound(_0x16d3d,null))[_0x87c5('0x2b')](function(_0x29bf44){if(_0x29bf44){return _0x29bf44[_0x87c5('0xc9')](_0x494cb1[_0x87c5('0x76')][_0x87c5('0xc0')],_['omit'](_0x494cb1[_0x87c5('0x76')],[_0x87c5('0xc0'),'id'])||{})['spread'](function(){return db[_0x87c5('0xca')][_0x87c5('0xc7')]({'attributes':['id',_0x87c5('0x2e'),_0x87c5('0xcb')],'where':{'id':_0x494cb1['body'][_0x87c5('0xc0')]}});})[_0x87c5('0x2b')](function(_0x2d9cbf){socket['emit'](_0x87c5('0xcc'),{'id':Number(_0x494cb1[_0x87c5('0xb7')]['id']),'tags':_0x2d9cbf||[]});return{'id':Number(_0x494cb1[_0x87c5('0xb7')]['id']),'tags':_0x2d9cbf||[]};});}})[_0x87c5('0x2b')](respondWithResult(_0x16d3d,null))[_0x87c5('0x37')](handleError(_0x16d3d,null));};exports[_0x87c5('0xcd')]=function(_0x581142,_0x744186,_0x432862){return db[_0x87c5('0xbc')]['find']({'where':{'id':_0x581142[_0x87c5('0xb7')]['id']}})[_0x87c5('0x2b')](handleEntityNotFound(_0x744186,null))[_0x87c5('0x2b')](function(_0x4131f3){if(_0x4131f3){return _0x4131f3[_0x87c5('0xcd')](_0x581142['query'][_0x87c5('0xc0')]);}})['then'](respondWithStatusCode(_0x744186,null))[_0x87c5('0x37')](handleError(_0x744186,null));};exports[_0x87c5('0xce')]=function(_0x221ef2,_0x5b17d0){var _0x705234=moment()[_0x87c5('0xcf')]()[_0x87c5('0xaf')]();var _0x53cfc6=path[_0x87c5('0xd0')](config[_0x87c5('0xd1')],'server',_0x87c5('0xd2'),_0x87c5('0xd3'));var _0x44732a=path[_0x87c5('0xd0')](config[_0x87c5('0xd1')],_0x87c5('0xd4'),_0x87c5('0xd2'),_0x87c5('0xd5'));var _0x4c65b4=path[_0x87c5('0xd0')](_0x53cfc6,_0x705234);var _0x29c3cf=util[_0x87c5('0xd6')](_0x87c5('0xd7'),_0x221ef2['params']['id'],_0x705234);var _0x5b4b9e=path[_0x87c5('0xd0')](_0x53cfc6,_0x29c3cf);var _0x38e315=[];_0x38e315[_0x87c5('0xb3')]({'model':db[_0x87c5('0x74')],'as':_0x87c5('0x74'),'attributes':['id',_0x87c5('0x32')],'raw':!![]});_0x38e315['push']({'model':db[_0x87c5('0xd8')],'as':_0x87c5('0x69'),'attributes':['id',_0x87c5('0xd9'),'lastName'],'raw':!![]});if(_0x221ef2[_0x87c5('0x43')][_0x87c5('0xd5')]){_0x38e315[_0x87c5('0xb3')]({'model':db['Attachment'],'as':_0x87c5('0xda'),'raw':!![]});}var _0x8e2962=[{'model':db[_0x87c5('0xc3')],'as':_0x87c5('0xdb'),'attributes':['id',_0x87c5('0x76'),_0x87c5('0xdc'),_0x87c5('0xdd'),_0x87c5('0xde'),_0x87c5('0x84')],'include':_0x38e315}];_0x8e2962[_0x87c5('0xb3')]({'model':db[_0x87c5('0xdf')],'as':_0x87c5('0xe0'),'attributes':['id',_0x87c5('0x2e')]});_0x8e2962['push']({'model':db[_0x87c5('0x74')],'as':_0x87c5('0xe1'),'attributes':['id',_0x87c5('0x32')]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x221ef2[_0x87c5('0xb7')]['id']},'include':_0x8e2962})[_0x87c5('0x2b')](handleEntityNotFound(_0x5b17d0,null))[_0x87c5('0x2b')](function(_0x3865fc){if(_0x3865fc){var _0x29de2f=_0x3865fc[_0x87c5('0xe2')]({'plain':!![]});fs[_0x87c5('0xe3')](_0x4c65b4);var _0x419e3d={'channel':_0x87c5('0xe4'),'account':_0x29de2f[_0x87c5('0xe0')][_0x87c5('0x2e')],'agent':_0x29de2f[_0x87c5('0xe1')]?_0x29de2f['Owner'][_0x87c5('0x32')]:'N.A.','createdAt':moment(_0x29de2f[_0x87c5('0xdc')])['format'](_0x87c5('0xc6'))[_0x87c5('0xaf')](),'closedAt':_0x29de2f[_0x87c5('0x3b')]?moment(_0x29de2f['closedAt'])[_0x87c5('0xd6')](_0x87c5('0xc6'))[_0x87c5('0xaf')]():'','disposition':_0x29de2f['disposition'],'visibility':_0x29de2f[_0x87c5('0xe5')]?_0x87c5('0xe6'):'Private','messages':_(_0x29de2f[_0x87c5('0xdb')])['filter']({'secret':![]})['map'](function(_0x499bd7){if(_0x499bd7[_0x87c5('0xda')]){var _0x324faa=path['join'](_0x44732a,_0x499bd7[_0x87c5('0xda')]['basename']);if(fs[_0x87c5('0xe7')](_0x324faa)){fs[_0x87c5('0xe8')](_0x324faa)[_0x87c5('0xe9')](fs[_0x87c5('0xea')](path['join'](_0x4c65b4,_0x499bd7['Attachment']['basename'])));}}return{'date':moment(_0x499bd7[_0x87c5('0xdc')])['format'](_0x87c5('0xc6'))['toString'](),'sender':_0x499bd7['direction']==='out'?_0x499bd7[_0x87c5('0x74')]?_0x499bd7['User'][_0x87c5('0x32')]:'System':_0x499bd7[_0x87c5('0x69')][_0x87c5('0xd9')]+(_0x499bd7[_0x87c5('0x69')][_0x87c5('0xeb')]?'\x20'+_0x499bd7[_0x87c5('0x69')]['lastName']:''),'body':_0x499bd7['Attachment']?_0x499bd7[_0x87c5('0xda')][_0x87c5('0xec')]:_0x499bd7[_0x87c5('0x76')],'direction':_0x499bd7[_0x87c5('0xdd')]===_0x87c5('0xed')?'A':'C','secret':_0x499bd7[_0x87c5('0xde')],'read':_0x499bd7[_0x87c5('0x84')],'attachment':_0x499bd7[_0x87c5('0xda')]};})[_0x87c5('0x66')]()};return ejs['renderFile'](path[_0x87c5('0xd0')](config[_0x87c5('0xd1')],_0x87c5('0xd4'),_0x87c5('0xee'),_0x87c5('0xef')),{'interaction':_0x419e3d})[_0x87c5('0x2b')](function(_0x16fb9d){var _0x261c16=path[_0x87c5('0xd0')](_0x4c65b4,_0x87c5('0xf0')+_0x29de2f['id']+'-'+_0x705234+_0x87c5('0xf1'));var _0x2d9703={'path':_0x261c16,'channel':_0x87c5('0xe4'),'interactionId':_0x29de2f['id']};return pdf[_0x87c5('0xf2')](_0x16fb9d,_0x2d9703);})['then'](function(){return new BPromise(function(_0x123671,_0x372f74){zipdir(_0x4c65b4,{'saveTo':_0x5b4b9e},function(_0x30a38b,_0x53bda0){if(_0x30a38b)return _0x372f74(_0x30a38b);return _0x123671(_0x53bda0);});})['then'](function(){return new BPromise(function(_0x36c9dc,_0x33d3b3){rimraf(_0x4c65b4,function(_0x3e70bf){if(_0x3e70bf)_0x33d3b3(_0x3e70bf);return _0x36c9dc();});});})[_0x87c5('0x2b')](function(){return _0x5b17d0['download'](_0x5b4b9e,_0x29c3cf,function(_0x38f32e){if(_0x38f32e){console[_0x87c5('0xf3')](_0x87c5('0xf4'),_0x38f32e);}else{fs[_0x87c5('0xf5')](_0x5b4b9e);}});});});}else{return _0x5b17d0['sendStatus'](0xc8);}})[_0x87c5('0x37')](handleError(_0x5b17d0,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 4b027ca..eb92309 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 _0x3523=['hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','hasOwnProperty'];(function(_0x416928,_0x1078dc){var _0x21f8d6=function(_0x5125eb){while(--_0x5125eb){_0x416928['push'](_0x416928['shift']());}};_0x21f8d6(++_0x1078dc);}(_0x3523,0xe6));var _0x3352=function(_0x48eaac,_0x5c6dbf){_0x48eaac=_0x48eaac-0x0;var _0x51fa54=_0x3523[_0x48eaac];return _0x51fa54;};'use strict';var EventEmitter=require(_0x3352('0x0'));var OpenchannelInteraction=require(_0x3352('0x1'))['db'][_0x3352('0x2')];var OpenchannelMessage=require(_0x3352('0x1'))['db'][_0x3352('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3352('0x4')](0x0);var events={'afterCreate':_0x3352('0x5'),'afterUpdate':_0x3352('0x6'),'afterDestroy':_0x3352('0x7')};function emitEvent(_0x2cc536){return function(_0x4c8a44,_0x26c18f,_0x79ba6d){_0x4c8a44[_0x3352('0x8')]({'attributes':['id'],'raw':!![]})[_0x3352('0x9')](function(_0x385c20){_0x4c8a44[_0x3352('0xa')]('Users',_0x385c20[_0x3352('0xb')](function(_0x272e3d){return{'id':_0x272e3d['id']};}));return OpenchannelMessage[_0x3352('0xc')]({'where':{'OpenchannelInteractionId':_0x4c8a44['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3352('0x9')](function(_0x423b1e){_0x4c8a44[_0x3352('0xa')](_0x3352('0xd'),_0x423b1e[_0x3352('0xe')]);OpenchannelInteractionEvents[_0x3352('0xf')](_0x2cc536+':'+_0x4c8a44['id'],_0x4c8a44);OpenchannelInteractionEvents['emit'](_0x2cc536,_0x4c8a44);_0x79ba6d(null);})['catch'](_0x79ba6d(null));};}for(var e in events){if(events[_0x3352('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x3352('0x11')](e,emitEvent(event));}}module[_0x3352('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xccc6=['../../mysqldb','save','remove','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x151334,_0x1e11ac){var _0x3d03da=function(_0x2099cf){while(--_0x2099cf){_0x151334['push'](_0x151334['shift']());}};_0x3d03da(++_0x1e11ac);}(_0xccc6,0xcf));var _0x6ccc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xccc6[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x6ccc('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x6ccc('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6ccc('0x2'),'afterUpdate':'update','afterDestroy':_0x6ccc('0x3')};function emitEvent(_0x292245){return function(_0x4a5f42,_0x3958fc,_0x2bb628){_0x4a5f42['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1382e5){_0x4a5f42[_0x6ccc('0x4')](_0x6ccc('0x5'),_0x1382e5['map'](function(_0x324007){return{'id':_0x324007['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x4a5f42['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4cad85){_0x4a5f42['setDataValue'](_0x6ccc('0x6'),_0x4cad85[_0x6ccc('0x7')]);OpenchannelInteractionEvents[_0x6ccc('0x8')](_0x292245+':'+_0x4a5f42['id'],_0x4a5f42);OpenchannelInteractionEvents[_0x6ccc('0x8')](_0x292245,_0x4a5f42);_0x2bb628(null);})[_0x6ccc('0x9')](_0x2bb628(null));};}for(var e in events){if(events[_0x6ccc('0xa')](e)){var event=events[e];OpenchannelInteraction[_0x6ccc('0xb')](e,emitEvent(event));}}module[_0x6ccc('0xc')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 775a8bc..aa1ae03 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 _0x993f=['../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0x993f,0x129));var _0xf993=function(_0x31b2e7,_0x4419a9){_0x31b2e7=_0x31b2e7-0x0;var _0x9d00bf=_0x993f[_0x31b2e7];return _0x9d00bf;};'use strict';var _=require(_0xf993('0x0'));var util=require(_0xf993('0x1'));var logger=require(_0xf993('0x2'))(_0xf993('0x3'));var moment=require('moment');var BPromise=require(_0xf993('0x4'));var rp=require(_0xf993('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf993('0x6'));var config=require(_0xf993('0x7'));var attributes=require(_0xf993('0x8'));module[_0xf993('0x9')]=function(_0x14b05b,_0x4429eb){return _0x14b05b[_0xf993('0xa')](_0xf993('0xb'),attributes,{'tableName':_0xf993('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf993('0xd'),'collate':_0xf993('0xe'),'hooks':{'beforeUpdate':function(_0x142201,_0x531e2d,_0x2d60cb){if(_0x142201[_0xf993('0xf')]('closed')){_0x142201[_0xf993('0x10')]=moment()[_0xf993('0x11')](_0xf993('0x12'));}_0x2d60cb(null,_0x142201);}}});}; \ No newline at end of file +var _0x2224=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','utf8mb4','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4e33ff,_0x1b56ff){var _0x512e42=function(_0x542826){while(--_0x542826){_0x4e33ff['push'](_0x4e33ff['shift']());}};_0x512e42(++_0x1b56ff);}(_0x2224,0x100));var _0x4222=function(_0x574617,_0x42eccc){_0x574617=_0x574617-0x0;var _0x29de90=_0x2224[_0x574617];return _0x29de90;};'use strict';var _=require(_0x4222('0x0'));var util=require(_0x4222('0x1'));var logger=require(_0x4222('0x2'))(_0x4222('0x3'));var moment=require(_0x4222('0x4'));var BPromise=require(_0x4222('0x5'));var rp=require(_0x4222('0x6'));var fs=require('fs');var path=require(_0x4222('0x7'));var rimraf=require(_0x4222('0x8'));var config=require(_0x4222('0x9'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x52a19b,_0x3823ba){return _0x52a19b[_0x4222('0xa')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4222('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x5cadcd,_0x5e2798,_0x4ac95f){if(_0x5cadcd['changed'](_0x4222('0xc'))){_0x5cadcd[_0x4222('0xd')]=moment()[_0x4222('0xe')](_0x4222('0xf'));}_0x4ac95f(null,_0x5cadcd);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index b67ed84..e00acd0 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 _0xece3=['spread','AddTags','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','defaults','redis','localhost','./openchannelInteraction.socket','register','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','stringify','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit'];(function(_0x3394b5,_0x50b3cd){var _0x7759c4=function(_0x1f89b7){while(--_0x1f89b7){_0x3394b5['push'](_0x3394b5['shift']());}};_0x7759c4(++_0x50b3cd);}(_0xece3,0x173));var _0x3ece=function(_0x2e1095,_0x3a7d94){_0x2e1095=_0x2e1095-0x0;var _0x3b2455=_0xece3[_0x2e1095];return _0x3b2455;};'use strict';var _=require(_0x3ece('0x0'));var util=require(_0x3ece('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ece('0x2'));var db=require(_0x3ece('0x3'))['db'];var utils=require(_0x3ece('0x4'));var logger=require(_0x3ece('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3ece('0x6'));var client=jayson['client'][_0x3ece('0x7')]({'port':0x232a});config['redis']=_[_0x3ece('0x8')](config[_0x3ece('0x9')],{'host':_0x3ece('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3ece('0xb'))[_0x3ece('0xc')](socket);function respondWithRpcPromise(_0xd62850,_0x4c0506,_0x300bd8){return new BPromise(function(_0x574272,_0x1e098b){return client['request'](_0xd62850,_0x300bd8)['then'](function(_0x171876){logger['info'](_0x3ece('0xd'),_0x4c0506,_0x3ece('0xe'));logger[_0x3ece('0xf')](_0x3ece('0x10'),_0x4c0506,_0x3ece('0xe'),JSON['stringify'](_0x171876));if(_0x171876[_0x3ece('0x11')]){if(_0x171876[_0x3ece('0x11')][_0x3ece('0x12')]===0x1f4){logger[_0x3ece('0x11')](_0x3ece('0xd'),_0x4c0506,_0x171876[_0x3ece('0x11')][_0x3ece('0x13')]);return _0x1e098b(_0x171876[_0x3ece('0x11')][_0x3ece('0x13')]);}logger[_0x3ece('0x11')](_0x3ece('0xd'),_0x4c0506,_0x171876[_0x3ece('0x11')][_0x3ece('0x13')]);return _0x574272(_0x171876[_0x3ece('0x11')][_0x3ece('0x13')]);}else{logger[_0x3ece('0x14')](_0x3ece('0xd'),_0x4c0506,_0x3ece('0xe'));_0x574272(_0x171876[_0x3ece('0x15')]['message']);}})[_0x3ece('0x16')](function(_0x47831b){logger[_0x3ece('0x11')](_0x3ece('0xd'),_0x4c0506,_0x47831b);_0x1e098b(_0x47831b);});});}exports[_0x3ece('0x17')]=function(_0x713199){var _0x5e0313=this;return new Promise(function(_0x2d1714,_0x594ce2){return db['OpenchannelInteraction'][_0x3ece('0x18')](_0x713199[_0x3ece('0x19')],{'raw':_0x713199[_0x3ece('0x1a')]?_0x713199[_0x3ece('0x1a')][_0x3ece('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x713199[_0x3ece('0x1a')]?_0x713199[_0x3ece('0x1a')][_0x3ece('0x1c')]||null:null,'attributes':_0x713199[_0x3ece('0x1a')]?_0x713199[_0x3ece('0x1a')][_0x3ece('0x1d')]||null:null,'limit':_0x713199['options']?_0x713199[_0x3ece('0x1a')][_0x3ece('0x1e')]||null:null})[_0x3ece('0x1f')](function(_0x2bc050){logger['info']('UpdateOpenchannelInteraction',_0x713199);logger[_0x3ece('0xf')](_0x3ece('0x17'),_0x713199,JSON[_0x3ece('0x20')](_0x2bc050));_0x2d1714(_0x2bc050);})[_0x3ece('0x16')](function(_0x3c17ef){logger[_0x3ece('0x11')](_0x3ece('0x17'),_0x3c17ef[_0x3ece('0x13')],_0x713199);_0x594ce2(_0x5e0313['error'](0x1f4,_0x3c17ef[_0x3ece('0x13')]));});});};exports[_0x3ece('0x21')]=function(_0xc17960){return new Promise(function(_0x488cd1,_0x37a8cf){return db[_0x3ece('0x22')][_0x3ece('0x23')]({'where':_0xc17960[_0x3ece('0x1a')]?_0xc17960[_0x3ece('0x1a')][_0x3ece('0x1c')]||null:null})['then'](function(_0xb0901e){if(_0xb0901e){return _0xb0901e[_0x3ece('0x24')](_0xc17960['body'][_0x3ece('0x25')],_[_0x3ece('0x26')](_0xc17960[_0x3ece('0x19')],[_0x3ece('0x25'),'id'])||{});}})[_0x3ece('0x27')](function(_0x5b3571){logger[_0x3ece('0x14')](_0x3ece('0x28'),_0xc17960);logger[_0x3ece('0xf')]('AddTags',_0xc17960,JSON[_0x3ece('0x20')](_0x5b3571));_0x488cd1(_0x5b3571);})[_0x3ece('0x16')](function(_0x5e4c79){logger[_0x3ece('0x11')](_0x3ece('0x28'),_0x5e4c79[_0x3ece('0x13')],_0xc17960);_0x37a8cf(_this[_0x3ece('0x11')](0x1f4,_0x5e4c79[_0x3ece('0x13')]));});});}; \ No newline at end of file +var _0xf94b=['OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','attributes','limit','debug','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','where','then','addTags','ids','omit','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','request\x20sent'];(function(_0x4ac85c,_0x4eb9d){var _0x5299c5=function(_0x28e571){while(--_0x28e571){_0x4ac85c['push'](_0x4ac85c['shift']());}};_0x5299c5(++_0x4eb9d);}(_0xf94b,0x168));var _0xbf94=function(_0x416a62,_0x2104bc){_0x416a62=_0x416a62-0x0;var _0xaeb270=_0xf94b[_0x416a62];return _0xaeb270;};'use strict';var _=require(_0xbf94('0x0'));var util=require(_0xbf94('0x1'));var moment=require('moment');var BPromise=require(_0xbf94('0x2'));var rs=require(_0xbf94('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf94('0x4'))['db'];var utils=require(_0xbf94('0x5'));var logger=require(_0xbf94('0x6'))(_0xbf94('0x7'));var config=require('../../config/environment');var jayson=require(_0xbf94('0x8'));var client=jayson['client'][_0xbf94('0x9')]({'port':0x232a});config[_0xbf94('0xa')]=_['defaults'](config[_0xbf94('0xa')],{'host':_0xbf94('0xb'),'port':0x18eb});var socket=require(_0xbf94('0xc'))(new Redis(config[_0xbf94('0xa')]));require(_0xbf94('0xd'))[_0xbf94('0xe')](socket);function respondWithRpcPromise(_0x365e83,_0x59e57d,_0x1ac27c){return new BPromise(function(_0x16c05f,_0x3051b2){return client[_0xbf94('0xf')](_0x365e83,_0x1ac27c)['then'](function(_0x260a83){logger[_0xbf94('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x59e57d,_0xbf94('0x11'));logger['debug'](_0xbf94('0x12'),_0x59e57d,_0xbf94('0x11'),JSON[_0xbf94('0x13')](_0x260a83));if(_0x260a83['error']){if(_0x260a83[_0xbf94('0x14')]['code']===0x1f4){logger[_0xbf94('0x14')](_0xbf94('0x15'),_0x59e57d,_0x260a83[_0xbf94('0x14')][_0xbf94('0x16')]);return _0x3051b2(_0x260a83[_0xbf94('0x14')]['message']);}logger[_0xbf94('0x14')](_0xbf94('0x15'),_0x59e57d,_0x260a83[_0xbf94('0x14')][_0xbf94('0x16')]);return _0x16c05f(_0x260a83[_0xbf94('0x14')][_0xbf94('0x16')]);}else{logger[_0xbf94('0x10')](_0xbf94('0x15'),_0x59e57d,'request\x20sent');_0x16c05f(_0x260a83[_0xbf94('0x17')]['message']);}})[_0xbf94('0x18')](function(_0xf48fef){logger[_0xbf94('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x59e57d,_0xf48fef);_0x3051b2(_0xf48fef);});});}exports[_0xbf94('0x19')]=function(_0x24b4d0){var _0xcb1a16=this;return new Promise(function(_0x98c184,_0x5ae576){return db['OpenchannelInteraction'][_0xbf94('0x1a')](_0x24b4d0[_0xbf94('0x1b')],{'raw':_0x24b4d0[_0xbf94('0x1c')]?_0x24b4d0[_0xbf94('0x1c')][_0xbf94('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24b4d0['options']?_0x24b4d0[_0xbf94('0x1c')]['where']||null:null,'attributes':_0x24b4d0[_0xbf94('0x1c')]?_0x24b4d0[_0xbf94('0x1c')][_0xbf94('0x1e')]||null:null,'limit':_0x24b4d0[_0xbf94('0x1c')]?_0x24b4d0[_0xbf94('0x1c')][_0xbf94('0x1f')]||null:null})['then'](function(_0x491348){logger['info'](_0xbf94('0x19'),_0x24b4d0);logger[_0xbf94('0x20')](_0xbf94('0x19'),_0x24b4d0,JSON[_0xbf94('0x13')](_0x491348));_0x98c184(_0x491348);})[_0xbf94('0x18')](function(_0x21230e){logger['error']('UpdateOpenchannelInteraction',_0x21230e[_0xbf94('0x16')],_0x24b4d0);_0x5ae576(_0xcb1a16[_0xbf94('0x14')](0x1f4,_0x21230e['message']));});});};exports[_0xbf94('0x21')]=function(_0x1ba82b){return new Promise(function(_0x4421fd,_0x118211){return db[_0xbf94('0x22')][_0xbf94('0x23')]({'where':_0x1ba82b[_0xbf94('0x1c')]?_0x1ba82b['options'][_0xbf94('0x24')]||null:null})[_0xbf94('0x25')](function(_0x2e86ae){if(_0x2e86ae){return _0x2e86ae[_0xbf94('0x26')](_0x1ba82b[_0xbf94('0x1b')][_0xbf94('0x27')],_[_0xbf94('0x28')](_0x1ba82b[_0xbf94('0x1b')],[_0xbf94('0x27'),'id'])||{});}})['spread'](function(_0x591c98){logger[_0xbf94('0x10')](_0xbf94('0x29'),_0x1ba82b);logger[_0xbf94('0x20')](_0xbf94('0x29'),_0x1ba82b,JSON['stringify'](_0x591c98));_0x4421fd(_0x591c98);})['catch'](function(_0xdf261f){logger[_0xbf94('0x14')](_0xbf94('0x29'),_0xdf261f[_0xbf94('0x16')],_0x1ba82b);_0x118211(_this[_0xbf94('0x14')](0x1f4,_0xdf261f[_0xbf94('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index abd9b18..5c3bd3c 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 _0x0538=['register','length','openchannelInteraction:','save','remove','update','emit'];(function(_0x1a56f5,_0x1682b9){var _0x454f16=function(_0x4398c4){while(--_0x4398c4){_0x1a56f5['push'](_0x1a56f5['shift']());}};_0x454f16(++_0x1682b9);}(_0x0538,0x1e6));var _0x8053=function(_0x43dc7e,_0x49a390){_0x43dc7e=_0x43dc7e-0x0;var _0x21e12d=_0x0538[_0x43dc7e];return _0x21e12d;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x8053('0x0'),_0x8053('0x1'),_0x8053('0x2')];function createListener(_0x2d63f4,_0xa26185){return function(_0x247bc1){_0xa26185[_0x8053('0x3')](_0x2d63f4,_0x247bc1);};}function removeListener(_0x2c4d3e,_0x207506){return function(){OpenchannelInteractionEvents['removeListener'](_0x2c4d3e,_0x207506);};}exports[_0x8053('0x4')]=function(_0x1d455f){for(var _0x1648de=0x0,_0x4fa9c2=events[_0x8053('0x5')];_0x1648de<_0x4fa9c2;_0x1648de++){var _0x136e96=events[_0x1648de];var _0x29fdb6=createListener(_0x8053('0x6')+_0x136e96,_0x1d455f);OpenchannelInteractionEvents['on'](_0x136e96,_0x29fdb6);}}; \ No newline at end of file +var _0x0cfc=['removeListener','length','openchannelInteraction:','./openchannelInteraction.events','save','update','emit'];(function(_0x57ed2e,_0x1da4d0){var _0x168514=function(_0x32dd4e){while(--_0x32dd4e){_0x57ed2e['push'](_0x57ed2e['shift']());}};_0x168514(++_0x1da4d0);}(_0x0cfc,0xab));var _0xc0cf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0cfc[_0x321bb2];return _0x9c12ed;};'use strict';var OpenchannelInteractionEvents=require(_0xc0cf('0x0'));var events=[_0xc0cf('0x1'),'remove',_0xc0cf('0x2')];function createListener(_0x55a0ba,_0x55f672){return function(_0x42a514){_0x55f672[_0xc0cf('0x3')](_0x55a0ba,_0x42a514);};}function removeListener(_0x2e99b2,_0x234363){return function(){OpenchannelInteractionEvents[_0xc0cf('0x4')](_0x2e99b2,_0x234363);};}exports['register']=function(_0x3085c2){for(var _0x38240f=0x0,_0x1fcfeb=events[_0xc0cf('0x5')];_0x38240f<_0x1fcfeb;_0x38240f++){var _0x184e23=events[_0x38240f];var _0x33d842=createListener(_0xc0cf('0x6')+_0x184e23,_0x3085c2);OpenchannelInteractionEvents['on'](_0x184e23,_0x33d842);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 46f5e99..abe85fe 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 _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x5e12d1,_0x514e0e){_0x5e12d1=_0x5e12d1-0x0;var _0x433665=_0x70e0[_0x5e12d1];return _0x433665;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x538afd,_0x8a95f1){var _0x5c1a7f=function(_0x2b5103){while(--_0x2b5103){_0x538afd['push'](_0x538afd['shift']());}};_0x5c1a7f(++_0x8a95f1);}(_0x9c44,0x178));var _0x49c4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c44[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index b4b690f..837ced7 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 _0xa8b1=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa8b1,0x182));var _0x1a8b=function(_0x5cc18f,_0x5638b9){_0x5cc18f=_0x5cc18f-0x0;var _0x230157=_0xa8b1[_0x5cc18f];return _0x230157;};'use strict';var Sequelize=require(_0x1a8b('0x0'));module[_0x1a8b('0x1')]={'body':{'type':Sequelize[_0x1a8b('0x2')](_0x1a8b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1a8b('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x1a8b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1a8b('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x1a8b('0x6')]},'providerName':{'type':Sequelize[_0x1a8b('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x4a1d=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x21c53f,_0x329703){var _0x407ddd=function(_0x3679ea){while(--_0x3679ea){_0x21c53f['push'](_0x21c53f['shift']());}};_0x407ddd(++_0x329703);}(_0x4a1d,0x77));var _0xd4a1=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x4a1d[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0xd4a1('0x0'));module[_0xd4a1('0x1')]={'body':{'type':Sequelize[_0xd4a1('0x2')](_0xd4a1('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd4a1('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd4a1('0x5')]('in',_0xd4a1('0x6')),'defaultValue':_0xd4a1('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd4a1('0x7')]},'providerName':{'type':Sequelize[_0xd4a1('0x8')]},'providerResponse':{'type':Sequelize[_0xd4a1('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index c941245..712a8de 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 _0x3784=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','OpenchannelMessage','includeAll','include','rows','show','params','intersection','options','find','catch','create','body','openchannel','read','readAt','format','user','agent','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','../../config/logger','openchannel-interactions','null','RejectMessage','rejectMessage','ContactId','sequelize','Sequelize','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0xc610e3,_0x533de2){var _0x18bee3=function(_0x1caf67){while(--_0x1caf67){_0xc610e3['push'](_0xc610e3['shift']());}};_0x18bee3(++_0x533de2);}(_0x3784,0x16f));var _0x4378=function(_0x361b31,_0x2f469a){_0x361b31=_0x361b31-0x0;var _0x7a1d19=_0x3784[_0x361b31];return _0x7a1d19;};'use strict';var emlformat=require(_0x4378('0x0'));var rimraf=require(_0x4378('0x1'));var zipdir=require(_0x4378('0x2'));var jsonpatch=require(_0x4378('0x3'));var rp=require(_0x4378('0x4'));var moment=require('moment');var BPromise=require(_0x4378('0x5'));var Mustache=require(_0x4378('0x6'));var util=require(_0x4378('0x7'));var path=require(_0x4378('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4378('0x9'));var _=require('lodash');var squel=require(_0x4378('0xa'));var crypto=require(_0x4378('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4378('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4378('0xd'));var Papa=require(_0x4378('0xe'));var Redis=require('ioredis');var authService=require(_0x4378('0xf'));var qs=require(_0x4378('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4378('0x11'));var utils=require(_0x4378('0x12'));var config=require(_0x4378('0x13'));var licenseUtil=require(_0x4378('0x14'));var db=require(_0x4378('0x15'))['db'];config[_0x4378('0x16')]=_[_0x4378('0x17')](config[_0x4378('0x16')],{'host':_0x4378('0x18'),'port':0x18eb});var socket=require(_0x4378('0x19'))(new Redis(config['redis']));require(_0x4378('0x1a'))[_0x4378('0x1b')](socket);var jayson=require(_0x4378('0x1c'));var client=jayson[_0x4378('0x1d')][_0x4378('0x1e')]({'port':0x232c});var client9002=jayson[_0x4378('0x1d')][_0x4378('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5d162c,_0x51fefa,_0x53cf9c,_0xedcf8e){return new BPromise(function(_0x4e95f9,_0x26e475){var _0x188ab1=_0xedcf8e||client;return _0x188ab1[_0x4378('0x1f')](_0x5d162c,_0x53cf9c)['then'](function(_0x2c6384){logger[_0x4378('0x20')](_0x4378('0x21'),_0x51fefa,'request\x20sent');logger[_0x4378('0x22')](_0x4378('0x23'),_0x51fefa,_0x4378('0x24'),JSON[_0x4378('0x25')](_0x2c6384));if(_0x2c6384['error']){if(_0x2c6384[_0x4378('0x26')][_0x4378('0x27')]===0x1f4){logger[_0x4378('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x51fefa,_0x2c6384['error'][_0x4378('0x28')]);return _0x26e475(_0x2c6384[_0x4378('0x26')][_0x4378('0x28')]);}logger['error'](_0x4378('0x21'),_0x51fefa,_0x2c6384['error'][_0x4378('0x28')]);return _0x4e95f9(_0x2c6384['error']['message']);}else{logger[_0x4378('0x20')](_0x4378('0x21'),_0x51fefa,_0x4378('0x24'));_0x4e95f9(_0x2c6384[_0x4378('0x29')]['message']);}})['catch'](function(_0x165507){logger[_0x4378('0x26')](_0x4378('0x21'),_0x51fefa,_0x165507);_0x26e475(_0x165507);});});}function respondWithStatusCode(_0x471792,_0x57e421){_0x57e421=_0x57e421||0xcc;return function(_0x5eaa9b){if(_0x5eaa9b){return _0x471792[_0x4378('0x2a')](_0x57e421);}return _0x471792[_0x4378('0x2b')](_0x57e421)[_0x4378('0x2c')]();};}function respondWithResult(_0x11e801,_0x7815c1){_0x7815c1=_0x7815c1||0xc8;return function(_0x38ba78){if(_0x38ba78){return _0x11e801[_0x4378('0x2b')](_0x7815c1)[_0x4378('0x2d')](_0x38ba78);}};}function respondWithFilteredResult(_0x183be7,_0x5a908a){return function(_0x38220e){if(_0x38220e){var _0x3e903d=typeof _0x5a908a[_0x4378('0x2e')]==='undefined'&&typeof _0x5a908a[_0x4378('0x2f')]===_0x4378('0x30');var _0xf16e85=_0x38220e[_0x4378('0x31')];var _0x16a183=_0x3e903d?0x0:_0x5a908a[_0x4378('0x2e')];var _0x2311e7=_0x3e903d?_0x38220e[_0x4378('0x31')]:_0x5a908a[_0x4378('0x2e')]+_0x5a908a[_0x4378('0x2f')];var _0x127b7e;if(_0x2311e7>=_0xf16e85){_0x2311e7=_0xf16e85;_0x127b7e=0xc8;}else{_0x127b7e=0xce;}_0x183be7[_0x4378('0x2b')](_0x127b7e);return _0x183be7['set']('Content-Range',_0x16a183+'-'+_0x2311e7+'/'+_0xf16e85)['json'](_0x38220e);}return null;};}function patchUpdates(_0x2d8509){return function(_0x1bc49a){try{jsonpatch[_0x4378('0x32')](_0x1bc49a,_0x2d8509,!![]);}catch(_0x3330e7){return BPromise[_0x4378('0x33')](_0x3330e7);}return _0x1bc49a[_0x4378('0x34')]();};}function saveUpdates(_0x172fbf,_0x1f73aa){return function(_0x1d001f){if(_0x1d001f){return _0x1d001f[_0x4378('0x35')](_0x172fbf)[_0x4378('0x36')](function(_0x3ed088){return _0x3ed088;});}return null;};}function removeEntity(_0xc294b4,_0xb507d2){return function(_0x4e9d03){if(_0x4e9d03){return _0x4e9d03[_0x4378('0x37')]()[_0x4378('0x36')](function(){_0xc294b4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59d4e0,_0x3837ea){return function(_0x3fdc80){if(!_0x3fdc80){_0x59d4e0[_0x4378('0x2a')](0x194);}return _0x3fdc80;};}function handleError(_0x3c41b1,_0x2f3567){_0x2f3567=_0x2f3567||0x1f4;return function(_0x13ca54){logger[_0x4378('0x26')](_0x13ca54[_0x4378('0x38')]);if(_0x13ca54[_0x4378('0x39')]){delete _0x13ca54[_0x4378('0x39')];}_0x3c41b1[_0x4378('0x2b')](_0x2f3567)[_0x4378('0x3a')](_0x13ca54);};}exports['index']=function(_0x5a0ba5,_0x27df7d){var _0x355009={},_0x367591={},_0x2759eb={'count':0x0,'rows':[]};var _0x2d6445=_[_0x4378('0x3b')](db['OpenchannelMessage'][_0x4378('0x3c')],function(_0x17f605){return{'name':_0x17f605[_0x4378('0x3d')],'type':_0x17f605[_0x4378('0x3e')][_0x4378('0x3f')]};});_0x367591['model']=_['map'](_0x2d6445,_0x4378('0x39'));_0x367591[_0x4378('0x40')]=_[_0x4378('0x41')](_0x5a0ba5['query']);_0x367591['filters']=_['intersection'](_0x367591[_0x4378('0x42')],_0x367591[_0x4378('0x40')]);_0x355009[_0x4378('0x43')]=_['intersection'](_0x367591['model'],qs[_0x4378('0x44')](_0x5a0ba5[_0x4378('0x40')][_0x4378('0x44')]));_0x355009[_0x4378('0x43')]=_0x355009[_0x4378('0x43')]['length']?_0x355009[_0x4378('0x43')]:_0x367591['model'];if(!_0x5a0ba5[_0x4378('0x40')][_0x4378('0x45')](_0x4378('0x46'))){_0x355009[_0x4378('0x2f')]=qs[_0x4378('0x2f')](_0x5a0ba5[_0x4378('0x40')][_0x4378('0x2f')]);_0x355009[_0x4378('0x2e')]=qs[_0x4378('0x2e')](_0x5a0ba5[_0x4378('0x40')][_0x4378('0x2e')]);}_0x355009[_0x4378('0x47')]=qs[_0x4378('0x48')](_0x5a0ba5[_0x4378('0x40')][_0x4378('0x48')]);_0x355009[_0x4378('0x49')]=qs['filters'](_['pick'](_0x5a0ba5[_0x4378('0x40')],_0x367591[_0x4378('0x4a')]),_0x2d6445);if(_0x5a0ba5[_0x4378('0x40')]['filter']){_0x355009[_0x4378('0x49')]=_[_0x4378('0x4b')](_0x355009[_0x4378('0x49')],{'$or':_[_0x4378('0x3b')](_0x2d6445,function(_0x8044f6){if(_0x8044f6[_0x4378('0x3e')]!=='VIRTUAL'){var _0x3f9435={};_0x3f9435[_0x8044f6[_0x4378('0x39')]]={'$like':'%'+_0x5a0ba5[_0x4378('0x40')][_0x4378('0x4c')]+'%'};return _0x3f9435;}})});}_0x355009=_[_0x4378('0x4b')]({},_0x355009,_0x5a0ba5['options']);var _0x3b009={'where':_0x355009[_0x4378('0x49')]};return db[_0x4378('0x4d')]['count'](_0x3b009)[_0x4378('0x36')](function(_0x1420c5){_0x2759eb['count']=_0x1420c5;if(_0x5a0ba5['query'][_0x4378('0x4e')]){_0x355009[_0x4378('0x4f')]=[{'all':!![]}];}return db[_0x4378('0x4d')]['findAll'](_0x355009);})[_0x4378('0x36')](function(_0x6c74fc){_0x2759eb[_0x4378('0x50')]=_0x6c74fc;return _0x2759eb;})['then'](respondWithFilteredResult(_0x27df7d,_0x355009))['catch'](handleError(_0x27df7d,null));};exports[_0x4378('0x51')]=function(_0x4672b9,_0x18b7f8){var _0x7a322c={'raw':!![],'where':{'id':_0x4672b9[_0x4378('0x52')]['id']}},_0x1b8433={};_0x1b8433['model']=_['keys'](db[_0x4378('0x4d')][_0x4378('0x3c')]);_0x1b8433[_0x4378('0x40')]=_['keys'](_0x4672b9[_0x4378('0x40')]);_0x1b8433[_0x4378('0x4a')]=_[_0x4378('0x53')](_0x1b8433[_0x4378('0x42')],_0x1b8433[_0x4378('0x40')]);_0x7a322c['attributes']=_[_0x4378('0x53')](_0x1b8433[_0x4378('0x42')],qs[_0x4378('0x44')](_0x4672b9[_0x4378('0x40')][_0x4378('0x44')]));_0x7a322c[_0x4378('0x43')]=_0x7a322c[_0x4378('0x43')]['length']?_0x7a322c['attributes']:_0x1b8433['model'];if(_0x4672b9[_0x4378('0x40')]['includeAll']){_0x7a322c[_0x4378('0x4f')]=[{'all':!![]}];}_0x7a322c=_[_0x4378('0x4b')]({},_0x7a322c,_0x4672b9[_0x4378('0x54')]);return db[_0x4378('0x4d')][_0x4378('0x55')](_0x7a322c)[_0x4378('0x36')](handleEntityNotFound(_0x18b7f8,null))[_0x4378('0x36')](respondWithResult(_0x18b7f8,null))[_0x4378('0x56')](handleError(_0x18b7f8,null));};exports[_0x4378('0x57')]=function(_0x32d253,_0x3aa9aa){return db[_0x4378('0x4d')][_0x4378('0x57')](_0x32d253['body'],{})['then'](respondWithResult(_0x3aa9aa,0xc9))[_0x4378('0x56')](handleError(_0x3aa9aa,null));};exports[_0x4378('0x35')]=function(_0xdb2dcc,_0x38f4ce){if(_0xdb2dcc['body']['id']){delete _0xdb2dcc[_0x4378('0x58')]['id'];}return db['OpenchannelMessage'][_0x4378('0x55')]({'where':{'id':_0xdb2dcc[_0x4378('0x52')]['id']}})[_0x4378('0x36')](handleEntityNotFound(_0x38f4ce,null))[_0x4378('0x36')](saveUpdates(_0xdb2dcc[_0x4378('0x58')],null))['then'](respondWithResult(_0x38f4ce,null))[_0x4378('0x56')](handleError(_0x38f4ce,null));};exports[_0x4378('0x37')]=function(_0x177e9e,_0x26c187){return db[_0x4378('0x4d')][_0x4378('0x55')]({'where':{'id':_0x177e9e[_0x4378('0x52')]['id']}})['then'](handleEntityNotFound(_0x26c187,null))[_0x4378('0x36')](removeEntity(_0x26c187,null))[_0x4378('0x56')](handleError(_0x26c187,null));};exports['describe']=function(_0x143e79,_0x2e7f1a){return db[_0x4378('0x4d')]['describe']()[_0x4378('0x36')](respondWithResult(_0x2e7f1a,null))[_0x4378('0x56')](handleError(_0x2e7f1a,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports['accept']=function(_0x4cb9ab,_0x3193a7,_0x28f370){var _0x13a0bd={'agent':{},'channel':_0x4378('0x59')};if(_0x4cb9ab['body']['id']){delete _0x4cb9ab[_0x4378('0x58')]['id'];}_0x4cb9ab[_0x4378('0x58')][_0x4378('0x5a')]=!![];_0x4cb9ab[_0x4378('0x58')][_0x4378('0x5b')]=moment()[_0x4378('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x4cb9ab[_0x4378('0x58')]['UserId']=_0x4cb9ab[_0x4378('0x58')]['UserId']||_0x4cb9ab[_0x4378('0x5d')]['id'];_0x13a0bd[_0x4378('0x5e')]['id']=_0x4cb9ab[_0x4378('0x58')][_0x4378('0x5f')];return db[_0x4378('0x4d')][_0x4378('0x55')]({'where':{'id':_0x4cb9ab[_0x4378('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3193a7,null))[_0x4378('0x36')](saveUpdates(_0x4cb9ab[_0x4378('0x58')],null))[_0x4378('0x36')](function(_0x5460ba){if(_0x5460ba){_0x13a0bd['message']=_0x5460ba[_0x4378('0x60')]({'plain':!![]});return db[_0x4378('0x61')][_0x4378('0x55')]({'where':{'id':_0x5460ba[_0x4378('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x3193a7,null))[_0x4378('0x36')](function(_0x2278ae){if(_0x2278ae){return _0x2278ae[_0x4378('0x35')]({'UserId':_0x4cb9ab[_0x4378('0x58')][_0x4378('0x5f')],'read1stAt':_[_0x4378('0x63')](_0x2278ae[_0x4378('0x64')])?moment()[_0x4378('0x5c')](_0x4378('0x65')):undefined});}return null;})[_0x4378('0x36')](function(_0x662ff0){if(_0x662ff0){_0x13a0bd[_0x4378('0x66')]=_0x662ff0[_0x4378('0x60')]({'plain':!![]});interaction_log[_0x4378('0x20')](_0x4378('0x67'),_0x4cb9ab['user']['id'],_0x4cb9ab['user'][_0x4378('0x39')],_0x4cb9ab['user'][_0x4378('0x68')],_0x13a0bd[_0x4378('0x66')]['id'],_0x4cb9ab[_0x4378('0x58')]?JSON[_0x4378('0x25')](_0x4cb9ab['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x4378('0x69'),_0x13a0bd);}return null;})[_0x4378('0x36')](function(_0x34ae30){var _0x5746da=_0x4378('0x6a')+_0x34ae30[_0x4378('0x28')]['ContactId'];return db['sequelize']['query'](_0x5746da,{'type':db['Sequelize']['QueryTypes'][_0x4378('0x6b')],'raw':!![]})['then'](function(_0x311be3){return _0x311be3;});})[_0x4378('0x36')](function(_0x4d50c8){if(_0x4d50c8){_0x13a0bd[_0x4378('0x28')]['contact']=_0x4d50c8[0x0];if(!_0x4cb9ab['body']['UserId'])return;return db['User'][_0x4378('0x55')]({'where':{'id':_0x4cb9ab['body'][_0x4378('0x5f')],'role':_0x4378('0x5e')},'attributes':['id',_0x4378('0x39'),_0x4378('0x6c'),_0x4378('0x6d'),_0x4378('0x6e')],'raw':!![]});}return null;})[_0x4378('0x36')](function(_0x488bb3){if(!_0x488bb3)return null;_0x13a0bd[_0x4378('0x28')][_0x4378('0x5e')]=_0x488bb3;return _0x13a0bd;})['then'](function(_0x1e0afe){if(_0x1e0afe){if(_0x4cb9ab[_0x4378('0x58')][_0x4378('0x6f')]){_0x13a0bd[_0x4378('0x28')][_0x4378('0x70')]=util[_0x4378('0x5c')](_0x4378('0x71'),_0x4cb9ab['user'][_0x4378('0x39')]);_0x13a0bd[_0x4378('0x28')][_0x4378('0x72')]=_0x13a0bd['channel'];_0x13a0bd['message'][_0x4378('0x73')]=_0x13a0bd['channel'];_0x13a0bd['message'][_0x4378('0x74')]=_0x4378('0x75');return respondWithRpcPromise(_0x4378('0x76'),_0x4378('0x76'),{'event':'acceptmessage','message':_0x13a0bd['message']},client9002)[_0x4378('0x36')](function(){return _0x13a0bd;});}return _0x13a0bd;}return null;})[_0x4378('0x36')](respondWithResult(_0x3193a7,null))[_0x4378('0x56')](handleError(_0x3193a7,null));};var interaction_log=require(_0x4378('0x77'))(_0x4378('0x78'));exports[_0x4378('0x33')]=function(_0x4aecef,_0x406a84,_0x2e112f){var _0x3aa4ef={'agent':{},'channel':_0x4378('0x59')};if(_0x4aecef['body']['id']){delete _0x4aecef[_0x4378('0x58')]['id'];}_0x4aecef['body'][_0x4378('0x5f')]=_0x4aecef[_0x4378('0x58')][_0x4378('0x5f')]||_0x4aecef['user']['id'];_0x3aa4ef[_0x4378('0x5e')]['id']=_0x4aecef[_0x4378('0x58')][_0x4378('0x5f')];return db[_0x4378('0x4d')][_0x4378('0x55')]({'where':{'id':_0x4aecef['params']['id'],'UserId':null}})[_0x4378('0x36')](handleEntityNotFound(_0x406a84,null))[_0x4378('0x36')](function(_0x598851){if(_0x598851){_0x3aa4ef[_0x4378('0x28')]=_0x598851['get']({'plain':!![]});return db[_0x4378('0x61')][_0x4378('0x55')]({'where':{'id':_0x598851[_0x4378('0x62')]}});}return null;})[_0x4378('0x36')](handleEntityNotFound(_0x406a84,null))[_0x4378('0x36')](function(_0x11ea77){if(_0x11ea77){_0x3aa4ef[_0x4378('0x66')]=_0x11ea77[_0x4378('0x60')]({'plain':!![]});interaction_log[_0x4378('0x20')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4aecef['user']['id'],_0x4aecef[_0x4378('0x5d')][_0x4378('0x39')],_0x4aecef[_0x4378('0x5d')][_0x4378('0x68')],_0x3aa4ef[_0x4378('0x66')]['id'],_0x4aecef[_0x4378('0x58')]?JSON[_0x4378('0x25')](_0x4aecef['body']):_0x4378('0x79'));return respondWithRpcPromise(_0x4378('0x7a'),_0x4378('0x7b'),_0x3aa4ef);}return null;})[_0x4378('0x36')](function(_0x2a5faf){var _0x127059=_0x4378('0x6a')+_0x2a5faf[_0x4378('0x28')][_0x4378('0x7c')];return db[_0x4378('0x7d')][_0x4378('0x40')](_0x127059,{'type':db[_0x4378('0x7e')]['QueryTypes'][_0x4378('0x6b')],'raw':!![]})[_0x4378('0x36')](function(_0x25731f){return _0x25731f;});})[_0x4378('0x36')](function(_0x4a6688){if(_0x4a6688){_0x3aa4ef[_0x4378('0x28')]['contact']=_0x4a6688[0x0];if(!_0x4aecef[_0x4378('0x58')][_0x4378('0x5f')])return;return db[_0x4378('0x7f')][_0x4378('0x55')]({'where':{'id':_0x4aecef[_0x4378('0x58')][_0x4378('0x5f')],'role':_0x4378('0x5e')},'attributes':['id',_0x4378('0x39'),_0x4378('0x6c'),_0x4378('0x6d'),_0x4378('0x6e')],'raw':!![]});}return null;})[_0x4378('0x36')](function(_0x4f7658){if(!_0x4f7658)return null;_0x3aa4ef[_0x4378('0x28')][_0x4378('0x5e')]=_0x4f7658;return _0x3aa4ef;})[_0x4378('0x36')](function(_0x3a72e8){if(_0x3a72e8){_0x3a72e8[_0x4378('0x28')][_0x4378('0x70')]=util[_0x4378('0x5c')](_0x4378('0x71'),_0x4aecef['user'][_0x4378('0x39')]);_0x3a72e8[_0x4378('0x28')][_0x4378('0x72')]=_0x3aa4ef[_0x4378('0x72')];_0x3a72e8[_0x4378('0x28')][_0x4378('0x73')]=_0x3aa4ef[_0x4378('0x72')];_0x3a72e8[_0x4378('0x28')][_0x4378('0x74')]=_0x4378('0x33');respondWithRpcPromise(_0x4378('0x76'),'EventManager',{'event':'rejectmessage','message':_0x3a72e8[_0x4378('0x28')]},client9002);return _0x3aa4ef;}return null;})['then'](respondWithResult(_0x406a84,null))[_0x4378('0x56')](handleError(_0x406a84,null));}; \ No newline at end of file +var _0x6408=['register','jayson/promise','client','http','request','then','info','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelMessage,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','end','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','where','filter','merge','options','includeAll','include','rows','show','params','intersection','find','create','body','destroy','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','agent','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','SELECT','contact','fullname','interface','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./openchannelMessage.socket'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x6408,0x174));var _0x8640=function(_0x2896db,_0x59e6ce){_0x2896db=_0x2896db-0x0;var _0x1cab48=_0x6408[_0x2896db];return _0x1cab48;};'use strict';var emlformat=require(_0x8640('0x0'));var rimraf=require(_0x8640('0x1'));var zipdir=require(_0x8640('0x2'));var jsonpatch=require(_0x8640('0x3'));var rp=require(_0x8640('0x4'));var moment=require(_0x8640('0x5'));var BPromise=require(_0x8640('0x6'));var Mustache=require(_0x8640('0x7'));var util=require(_0x8640('0x8'));var path=require(_0x8640('0x9'));var sox=require(_0x8640('0xa'));var csv=require('to-csv');var ejs=require(_0x8640('0xb'));var fs=require('fs');var fs_extra=require(_0x8640('0xc'));var _=require(_0x8640('0xd'));var squel=require('squel');var crypto=require(_0x8640('0xe'));var jsforce=require(_0x8640('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8640('0x10'));var querystring=require('querystring');var Papa=require(_0x8640('0x11'));var Redis=require(_0x8640('0x12'));var authService=require(_0x8640('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8640('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8640('0x15'))(_0x8640('0x16'));var utils=require('../../config/utils');var config=require(_0x8640('0x17'));var licenseUtil=require(_0x8640('0x18'));var db=require(_0x8640('0x19'))['db'];config['redis']=_[_0x8640('0x1a')](config[_0x8640('0x1b')],{'host':_0x8640('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8640('0x1b')]));require(_0x8640('0x1d'))[_0x8640('0x1e')](socket);var jayson=require(_0x8640('0x1f'));var client=jayson[_0x8640('0x20')][_0x8640('0x21')]({'port':0x232c});var client9002=jayson[_0x8640('0x20')][_0x8640('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x20f2f1,_0x4acad3,_0x24f976,_0x54815d){return new BPromise(function(_0x1a81e9,_0x5d499b){var _0x5b0a02=_0x54815d||client;return _0x5b0a02[_0x8640('0x22')](_0x20f2f1,_0x24f976)[_0x8640('0x23')](function(_0x469f98){logger[_0x8640('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x4acad3,_0x8640('0x25'));logger['debug'](_0x8640('0x26'),_0x4acad3,'request\x20sent',JSON['stringify'](_0x469f98));if(_0x469f98['error']){if(_0x469f98[_0x8640('0x27')][_0x8640('0x28')]===0x1f4){logger[_0x8640('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x4acad3,_0x469f98[_0x8640('0x27')][_0x8640('0x29')]);return _0x5d499b(_0x469f98[_0x8640('0x27')][_0x8640('0x29')]);}logger[_0x8640('0x27')](_0x8640('0x2a'),_0x4acad3,_0x469f98['error'][_0x8640('0x29')]);return _0x1a81e9(_0x469f98[_0x8640('0x27')][_0x8640('0x29')]);}else{logger[_0x8640('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x4acad3,'request\x20sent');_0x1a81e9(_0x469f98[_0x8640('0x2b')][_0x8640('0x29')]);}})[_0x8640('0x2c')](function(_0x1cb023){logger[_0x8640('0x27')](_0x8640('0x2a'),_0x4acad3,_0x1cb023);_0x5d499b(_0x1cb023);});});}function respondWithStatusCode(_0x2244c1,_0x43481c){_0x43481c=_0x43481c||0xcc;return function(_0x160401){if(_0x160401){return _0x2244c1[_0x8640('0x2d')](_0x43481c);}return _0x2244c1['status'](_0x43481c)['end']();};}function respondWithResult(_0x564367,_0x6dc7e8){_0x6dc7e8=_0x6dc7e8||0xc8;return function(_0xf1c500){if(_0xf1c500){return _0x564367[_0x8640('0x2e')](_0x6dc7e8)[_0x8640('0x2f')](_0xf1c500);}};}function respondWithFilteredResult(_0x15a0bf,_0x41c625){return function(_0x49e79d){if(_0x49e79d){var _0x78e388=typeof _0x41c625[_0x8640('0x30')]===_0x8640('0x31')&&typeof _0x41c625[_0x8640('0x32')]==='undefined';var _0x5e5d40=_0x49e79d['count'];var _0x47d92e=_0x78e388?0x0:_0x41c625['offset'];var _0x233fba=_0x78e388?_0x49e79d[_0x8640('0x33')]:_0x41c625[_0x8640('0x30')]+_0x41c625['limit'];var _0x48e16c;if(_0x233fba>=_0x5e5d40){_0x233fba=_0x5e5d40;_0x48e16c=0xc8;}else{_0x48e16c=0xce;}_0x15a0bf['status'](_0x48e16c);return _0x15a0bf['set'](_0x8640('0x34'),_0x47d92e+'-'+_0x233fba+'/'+_0x5e5d40)['json'](_0x49e79d);}return null;};}function patchUpdates(_0x49ccaa){return function(_0x5f0f60){try{jsonpatch[_0x8640('0x35')](_0x5f0f60,_0x49ccaa,!![]);}catch(_0x4d5c19){return BPromise[_0x8640('0x36')](_0x4d5c19);}return _0x5f0f60[_0x8640('0x37')]();};}function saveUpdates(_0x1c6add,_0x3a89f5){return function(_0x9cf872){if(_0x9cf872){return _0x9cf872[_0x8640('0x38')](_0x1c6add)[_0x8640('0x23')](function(_0x2750ae){return _0x2750ae;});}return null;};}function removeEntity(_0x501eae,_0x27db40){return function(_0x46d092){if(_0x46d092){return _0x46d092['destroy']()[_0x8640('0x23')](function(){_0x501eae['status'](0xcc)[_0x8640('0x39')]();});}};}function handleEntityNotFound(_0x1fecc8,_0x2eca5f){return function(_0x220063){if(!_0x220063){_0x1fecc8[_0x8640('0x2d')](0x194);}return _0x220063;};}function handleError(_0x29772b,_0x5351ee){_0x5351ee=_0x5351ee||0x1f4;return function(_0x558e83){logger[_0x8640('0x27')](_0x558e83[_0x8640('0x3a')]);if(_0x558e83[_0x8640('0x3b')]){delete _0x558e83[_0x8640('0x3b')];}_0x29772b[_0x8640('0x2e')](_0x5351ee)['send'](_0x558e83);};}exports[_0x8640('0x3c')]=function(_0x100634,_0x2b8098){var _0x4f0b1e={},_0x2c2b8e={},_0x5808de={'count':0x0,'rows':[]};var _0x50c2de=_[_0x8640('0x3d')](db[_0x8640('0x3e')][_0x8640('0x3f')],function(_0x5df912){return{'name':_0x5df912[_0x8640('0x40')],'type':_0x5df912[_0x8640('0x41')][_0x8640('0x42')]};});_0x2c2b8e[_0x8640('0x43')]=_[_0x8640('0x3d')](_0x50c2de,_0x8640('0x3b'));_0x2c2b8e[_0x8640('0x44')]=_[_0x8640('0x45')](_0x100634[_0x8640('0x44')]);_0x2c2b8e[_0x8640('0x46')]=_['intersection'](_0x2c2b8e['model'],_0x2c2b8e[_0x8640('0x44')]);_0x4f0b1e[_0x8640('0x47')]=_['intersection'](_0x2c2b8e[_0x8640('0x43')],qs[_0x8640('0x48')](_0x100634[_0x8640('0x44')][_0x8640('0x48')]));_0x4f0b1e[_0x8640('0x47')]=_0x4f0b1e['attributes'][_0x8640('0x49')]?_0x4f0b1e['attributes']:_0x2c2b8e[_0x8640('0x43')];if(!_0x100634['query'][_0x8640('0x4a')]('nolimit')){_0x4f0b1e[_0x8640('0x32')]=qs[_0x8640('0x32')](_0x100634[_0x8640('0x44')][_0x8640('0x32')]);_0x4f0b1e[_0x8640('0x30')]=qs[_0x8640('0x30')](_0x100634[_0x8640('0x44')][_0x8640('0x30')]);}_0x4f0b1e[_0x8640('0x4b')]=qs['sort'](_0x100634[_0x8640('0x44')]['sort']);_0x4f0b1e[_0x8640('0x4c')]=qs[_0x8640('0x46')](_['pick'](_0x100634[_0x8640('0x44')],_0x2c2b8e[_0x8640('0x46')]),_0x50c2de);if(_0x100634['query'][_0x8640('0x4d')]){_0x4f0b1e['where']=_[_0x8640('0x4e')](_0x4f0b1e[_0x8640('0x4c')],{'$or':_[_0x8640('0x3d')](_0x50c2de,function(_0xcc0250){if(_0xcc0250['type']!=='VIRTUAL'){var _0x328498={};_0x328498[_0xcc0250[_0x8640('0x3b')]]={'$like':'%'+_0x100634[_0x8640('0x44')][_0x8640('0x4d')]+'%'};return _0x328498;}})});}_0x4f0b1e=_['merge']({},_0x4f0b1e,_0x100634[_0x8640('0x4f')]);var _0x395201={'where':_0x4f0b1e['where']};return db[_0x8640('0x3e')][_0x8640('0x33')](_0x395201)[_0x8640('0x23')](function(_0x36f17b){_0x5808de[_0x8640('0x33')]=_0x36f17b;if(_0x100634['query'][_0x8640('0x50')]){_0x4f0b1e[_0x8640('0x51')]=[{'all':!![]}];}return db[_0x8640('0x3e')]['findAll'](_0x4f0b1e);})['then'](function(_0x1e4704){_0x5808de[_0x8640('0x52')]=_0x1e4704;return _0x5808de;})[_0x8640('0x23')](respondWithFilteredResult(_0x2b8098,_0x4f0b1e))['catch'](handleError(_0x2b8098,null));};exports[_0x8640('0x53')]=function(_0x1c6151,_0x548bea){var _0x14bafd={'raw':!![],'where':{'id':_0x1c6151[_0x8640('0x54')]['id']}},_0x531b03={};_0x531b03['model']=_[_0x8640('0x45')](db['OpenchannelMessage'][_0x8640('0x3f')]);_0x531b03[_0x8640('0x44')]=_[_0x8640('0x45')](_0x1c6151[_0x8640('0x44')]);_0x531b03['filters']=_[_0x8640('0x55')](_0x531b03['model'],_0x531b03[_0x8640('0x44')]);_0x14bafd[_0x8640('0x47')]=_[_0x8640('0x55')](_0x531b03[_0x8640('0x43')],qs[_0x8640('0x48')](_0x1c6151[_0x8640('0x44')][_0x8640('0x48')]));_0x14bafd[_0x8640('0x47')]=_0x14bafd['attributes'][_0x8640('0x49')]?_0x14bafd[_0x8640('0x47')]:_0x531b03[_0x8640('0x43')];if(_0x1c6151[_0x8640('0x44')][_0x8640('0x50')]){_0x14bafd[_0x8640('0x51')]=[{'all':!![]}];}_0x14bafd=_['merge']({},_0x14bafd,_0x1c6151['options']);return db[_0x8640('0x3e')][_0x8640('0x56')](_0x14bafd)['then'](handleEntityNotFound(_0x548bea,null))[_0x8640('0x23')](respondWithResult(_0x548bea,null))[_0x8640('0x2c')](handleError(_0x548bea,null));};exports[_0x8640('0x57')]=function(_0x4dc141,_0x4b51cd){return db['OpenchannelMessage'][_0x8640('0x57')](_0x4dc141[_0x8640('0x58')],{})[_0x8640('0x23')](respondWithResult(_0x4b51cd,0xc9))[_0x8640('0x2c')](handleError(_0x4b51cd,null));};exports[_0x8640('0x38')]=function(_0x1fa3ae,_0x2a11a8){if(_0x1fa3ae[_0x8640('0x58')]['id']){delete _0x1fa3ae[_0x8640('0x58')]['id'];}return db[_0x8640('0x3e')]['find']({'where':{'id':_0x1fa3ae[_0x8640('0x54')]['id']}})[_0x8640('0x23')](handleEntityNotFound(_0x2a11a8,null))['then'](saveUpdates(_0x1fa3ae[_0x8640('0x58')],null))[_0x8640('0x23')](respondWithResult(_0x2a11a8,null))[_0x8640('0x2c')](handleError(_0x2a11a8,null));};exports[_0x8640('0x59')]=function(_0x2bedab,_0x4e21a5){return db['OpenchannelMessage'][_0x8640('0x56')]({'where':{'id':_0x2bedab['params']['id']}})[_0x8640('0x23')](handleEntityNotFound(_0x4e21a5,null))[_0x8640('0x23')](removeEntity(_0x4e21a5,null))[_0x8640('0x2c')](handleError(_0x4e21a5,null));};exports['describe']=function(_0x104b38,_0x1dc501){return db[_0x8640('0x3e')][_0x8640('0x5a')]()[_0x8640('0x23')](respondWithResult(_0x1dc501,null))['catch'](handleError(_0x1dc501,null));};var interaction_log=require(_0x8640('0x15'))(_0x8640('0x5b'));exports[_0x8640('0x5c')]=function(_0x4db164,_0x2873a3,_0x3bac83){var _0xa5a25={'agent':{},'channel':_0x8640('0x5d')};if(_0x4db164[_0x8640('0x58')]['id']){delete _0x4db164[_0x8640('0x58')]['id'];}_0x4db164[_0x8640('0x58')][_0x8640('0x5e')]=!![];_0x4db164[_0x8640('0x58')][_0x8640('0x5f')]=moment()[_0x8640('0x60')](_0x8640('0x61'));_0x4db164[_0x8640('0x58')][_0x8640('0x62')]=_0x4db164[_0x8640('0x58')]['UserId']||_0x4db164[_0x8640('0x63')]['id'];_0xa5a25['agent']['id']=_0x4db164[_0x8640('0x58')][_0x8640('0x62')];return db[_0x8640('0x3e')][_0x8640('0x56')]({'where':{'id':_0x4db164[_0x8640('0x54')]['id'],'UserId':null}})[_0x8640('0x23')](handleEntityNotFound(_0x2873a3,null))[_0x8640('0x23')](saveUpdates(_0x4db164[_0x8640('0x58')],null))[_0x8640('0x23')](function(_0x3fd43f){if(_0x3fd43f){_0xa5a25[_0x8640('0x29')]=_0x3fd43f[_0x8640('0x64')]({'plain':!![]});return db[_0x8640('0x65')][_0x8640('0x56')]({'where':{'id':_0x3fd43f[_0x8640('0x66')]}});}return null;})[_0x8640('0x23')](handleEntityNotFound(_0x2873a3,null))[_0x8640('0x23')](function(_0x273f65){if(_0x273f65){return _0x273f65[_0x8640('0x38')]({'UserId':_0x4db164[_0x8640('0x58')][_0x8640('0x62')],'read1stAt':_[_0x8640('0x67')](_0x273f65[_0x8640('0x68')])?moment()[_0x8640('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x8640('0x23')](function(_0x33acef){if(_0x33acef){_0xa5a25['interaction']=_0x33acef['get']({'plain':!![]});interaction_log[_0x8640('0x24')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4db164[_0x8640('0x63')]['id'],_0x4db164['user']['name'],_0x4db164['user']['role'],_0xa5a25[_0x8640('0x69')]['id'],_0x4db164[_0x8640('0x58')]?JSON[_0x8640('0x6a')](_0x4db164[_0x8640('0x58')]):'null');return respondWithRpcPromise(_0x8640('0x6b'),_0x8640('0x6c'),_0xa5a25);}return null;})[_0x8640('0x23')](function(_0x103672){var _0xeb1550=_0x8640('0x6d')+_0x103672[_0x8640('0x29')][_0x8640('0x6e')];return db[_0x8640('0x6f')]['query'](_0xeb1550,{'type':db[_0x8640('0x70')][_0x8640('0x71')]['SELECT'],'raw':!![]})[_0x8640('0x23')](function(_0x41e8a4){return _0x41e8a4;});})[_0x8640('0x23')](function(_0x572cfd){if(_0x572cfd){_0xa5a25[_0x8640('0x29')]['contact']=_0x572cfd[0x0];if(!_0x4db164[_0x8640('0x58')]['UserId'])return;return db[_0x8640('0x72')][_0x8640('0x56')]({'where':{'id':_0x4db164[_0x8640('0x58')][_0x8640('0x62')],'role':_0x8640('0x73')},'attributes':['id',_0x8640('0x3b'),'fullname',_0x8640('0x74'),_0x8640('0x75')],'raw':!![]});}return null;})[_0x8640('0x23')](function(_0x3a5385){if(!_0x3a5385)return null;_0xa5a25[_0x8640('0x29')][_0x8640('0x73')]=_0x3a5385;return _0xa5a25;})[_0x8640('0x23')](function(_0x14d6b4){if(_0x14d6b4){if(_0x4db164[_0x8640('0x58')][_0x8640('0x76')]){_0xa5a25['message']['interface']=util[_0x8640('0x60')](_0x8640('0x77'),_0x4db164[_0x8640('0x63')][_0x8640('0x3b')]);_0xa5a25[_0x8640('0x29')][_0x8640('0x78')]=_0xa5a25['channel'];_0xa5a25[_0x8640('0x29')][_0x8640('0x79')]=_0xa5a25['channel'];_0xa5a25['message'][_0x8640('0x7a')]=_0x8640('0x5c');return respondWithRpcPromise(_0x8640('0x7b'),_0x8640('0x7b'),{'event':_0x8640('0x7c'),'message':_0xa5a25[_0x8640('0x29')]},client9002)[_0x8640('0x23')](function(){return _0xa5a25;});}return _0xa5a25;}return null;})[_0x8640('0x23')](respondWithResult(_0x2873a3,null))[_0x8640('0x2c')](handleError(_0x2873a3,null));};var interaction_log=require('../../config/logger')(_0x8640('0x5b'));exports[_0x8640('0x36')]=function(_0x8ca91a,_0x5ba050,_0x5b800d){var _0x4c942a={'agent':{},'channel':_0x8640('0x5d')};if(_0x8ca91a[_0x8640('0x58')]['id']){delete _0x8ca91a[_0x8640('0x58')]['id'];}_0x8ca91a[_0x8640('0x58')][_0x8640('0x62')]=_0x8ca91a[_0x8640('0x58')][_0x8640('0x62')]||_0x8ca91a['user']['id'];_0x4c942a[_0x8640('0x73')]['id']=_0x8ca91a['body'][_0x8640('0x62')];return db['OpenchannelMessage'][_0x8640('0x56')]({'where':{'id':_0x8ca91a[_0x8640('0x54')]['id'],'UserId':null}})[_0x8640('0x23')](handleEntityNotFound(_0x5ba050,null))[_0x8640('0x23')](function(_0x281030){if(_0x281030){_0x4c942a['message']=_0x281030[_0x8640('0x64')]({'plain':!![]});return db[_0x8640('0x65')][_0x8640('0x56')]({'where':{'id':_0x281030[_0x8640('0x66')]}});}return null;})[_0x8640('0x23')](handleEntityNotFound(_0x5ba050,null))[_0x8640('0x23')](function(_0x13906e){if(_0x13906e){_0x4c942a[_0x8640('0x69')]=_0x13906e[_0x8640('0x64')]({'plain':!![]});interaction_log['info'](_0x8640('0x7d'),_0x8ca91a[_0x8640('0x63')]['id'],_0x8ca91a[_0x8640('0x63')][_0x8640('0x3b')],_0x8ca91a[_0x8640('0x63')][_0x8640('0x7e')],_0x4c942a[_0x8640('0x69')]['id'],_0x8ca91a[_0x8640('0x58')]?JSON[_0x8640('0x6a')](_0x8ca91a[_0x8640('0x58')]):_0x8640('0x7f'));return respondWithRpcPromise(_0x8640('0x80'),_0x8640('0x81'),_0x4c942a);}return null;})[_0x8640('0x23')](function(_0x477412){var _0x290b67=_0x8640('0x6d')+_0x477412[_0x8640('0x29')][_0x8640('0x6e')];return db[_0x8640('0x6f')][_0x8640('0x44')](_0x290b67,{'type':db[_0x8640('0x70')][_0x8640('0x71')][_0x8640('0x82')],'raw':!![]})['then'](function(_0x1a14b8){return _0x1a14b8;});})[_0x8640('0x23')](function(_0x1fecba){if(_0x1fecba){_0x4c942a[_0x8640('0x29')][_0x8640('0x83')]=_0x1fecba[0x0];if(!_0x8ca91a[_0x8640('0x58')][_0x8640('0x62')])return;return db['User']['find']({'where':{'id':_0x8ca91a[_0x8640('0x58')]['UserId'],'role':_0x8640('0x73')},'attributes':['id',_0x8640('0x3b'),_0x8640('0x84'),_0x8640('0x74'),_0x8640('0x75')],'raw':!![]});}return null;})[_0x8640('0x23')](function(_0x1548f1){if(!_0x1548f1)return null;_0x4c942a[_0x8640('0x29')][_0x8640('0x73')]=_0x1548f1;return _0x4c942a;})[_0x8640('0x23')](function(_0x35d846){if(_0x35d846){_0x35d846[_0x8640('0x29')][_0x8640('0x85')]=util[_0x8640('0x60')](_0x8640('0x77'),_0x8ca91a[_0x8640('0x63')][_0x8640('0x3b')]);_0x35d846[_0x8640('0x29')][_0x8640('0x78')]=_0x4c942a[_0x8640('0x78')];_0x35d846[_0x8640('0x29')]['motionChannel']=_0x4c942a[_0x8640('0x78')];_0x35d846['message'][_0x8640('0x7a')]='reject';respondWithRpcPromise(_0x8640('0x7b'),_0x8640('0x7b'),{'event':'rejectmessage','message':_0x35d846[_0x8640('0x29')]},client9002);return _0x4c942a;}return null;})[_0x8640('0x23')](respondWithResult(_0x5ba050,null))[_0x8640('0x2c')](handleError(_0x5ba050,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 6ede9f1..d89e291 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 _0xcf93=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','save'];(function(_0x2c0ded,_0x3de22c){var _0x4473e5=function(_0x3705bc){while(--_0x3705bc){_0x2c0ded['push'](_0x2c0ded['shift']());}};_0x4473e5(++_0x3de22c);}(_0xcf93,0x13c));var _0x3cf9=function(_0x2674c4,_0x857d7a){_0x2674c4=_0x2674c4-0x0;var _0xaea53d=_0xcf93[_0x2674c4];return _0xaea53d;};'use strict';var EventEmitter=require(_0x3cf9('0x0'));var OpenchannelMessage=require(_0x3cf9('0x1'))['db'][_0x3cf9('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3cf9('0x3'),'afterUpdate':'update','afterDestroy':_0x3cf9('0x4')};function emitEvent(_0x3490b2){return function(_0x368a4c,_0x5e058d,_0x3020cd){OpenchannelMessageEvents['emit'](_0x3490b2+':'+_0x368a4c['id'],_0x368a4c);OpenchannelMessageEvents[_0x3cf9('0x5')](_0x3490b2,_0x368a4c);_0x3020cd(null);};}for(var e in events){if(events[_0x3cf9('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x3cf9('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xd815=['emit','hasOwnProperty','exports','events','../../mysqldb','save','update','remove'];(function(_0x4b9f35,_0x287585){var _0x200ea1=function(_0x9bf668){while(--_0x9bf668){_0x4b9f35['push'](_0x4b9f35['shift']());}};_0x200ea1(++_0x287585);}(_0xd815,0x19b));var _0x5d81=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd815[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x5d81('0x0'));var OpenchannelMessage=require(_0x5d81('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5d81('0x2'),'afterUpdate':_0x5d81('0x3'),'afterDestroy':_0x5d81('0x4')};function emitEvent(_0x1156f1){return function(_0x5802c7,_0x28f028,_0x27c71c){OpenchannelMessageEvents['emit'](_0x1156f1+':'+_0x5802c7['id'],_0x5802c7);OpenchannelMessageEvents[_0x5d81('0x5')](_0x1156f1,_0x5802c7);_0x27c71c(null);};}for(var e in events){if(events[_0x5d81('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x5d81('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 791fd50..4f7dbce 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 _0xed3c=['OpenchannelInteractionId','createdAt','catch','error','CmContact','describe','find','OpenchannelAccountId','Interactions','Contact','keys','then','get','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','omit','replyUri','GET','POST','body','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','OpenchannelMessage,\x20%s,\x20%s','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','./openchannelMessage.attributes','exports','fti_openchannel_messages','models','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne'];(function(_0x26bf51,_0x5e261a){var _0x503415=function(_0x92b028){while(--_0x92b028){_0x26bf51['push'](_0x26bf51['shift']());}};_0x503415(++_0x5e261a);}(_0xed3c,0x1a6));var _0xced3=function(_0x19eddf,_0x3b50cf){_0x19eddf=_0x19eddf-0x0;var _0x1c10f6=_0xed3c[_0x19eddf];return _0x1c10f6;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var logger=require(_0xced3('0x2'))(_0xced3('0x3'));var moment=require('moment');var BPromise=require(_0xced3('0x4'));var rp=require(_0xced3('0x5'));var fs=require('fs');var path=require(_0xced3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xced3('0x7'));module[_0xced3('0x8')]=function(_0x2f92f8,_0x1cd694){return _0x2f92f8['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xced3('0x9'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4be020,_0x19a727,_0x321c42){var _0x3e5a04=_0x2f92f8[_0xced3('0xa')];var _0x1cb639=_0x4be020['get']({'plain':!![]});if(_0x1cb639[_0xced3('0xb')][_0xced3('0xc')]()==='in'||_0x1cb639[_0xced3('0xb')]['toLowerCase']()===_0xced3('0xd')&&!_0x1cb639[_0xced3('0xe')]&&!_[_0xced3('0xf')](_0x1cb639[_0xced3('0x10')])){_0x3e5a04[_0xced3('0x11')][_0xced3('0x12')]({'where':{'id':_0x1cb639[_0xced3('0x13')]}})['then'](function(_0x65bb58){if(_0x65bb58){_0x65bb58['update']({'lastMsgAt':_0x1cb639[_0xced3('0x14')],'lastMsgDirection':_0x1cb639[_0xced3('0xb')][_0xced3('0xc')]()});}})[_0xced3('0x15')](function(_0x4dd4c3){console[_0xced3('0x16')](_0x4dd4c3);});}if(_0x1cb639[_0xced3('0xb')]==='out'&&!_0x1cb639[_0xced3('0xe')]){var _0x37e2d5;_0x3e5a04[_0xced3('0x17')][_0xced3('0x18')]()['then'](function(_0x4569af){return _0x3e5a04['OpenchannelAccount'][_0xced3('0x19')]({'where':{'id':_0x1cb639[_0xced3('0x1a')]},'include':[{'model':_0x3e5a04[_0xced3('0x11')],'as':_0xced3('0x1b'),'where':{'id':_0x1cb639[_0xced3('0x13')]},'limit':0x1,'include':[{'model':_0x3e5a04[_0xced3('0x17')],'as':_0xced3('0x1c'),'attributes':_[_0xced3('0x1d')](_0x4569af)}]}]});})[_0xced3('0x1e')](function(_0x17c011){_0x37e2d5=_0x17c011[_0xced3('0x1f')]({'plain':!![]});if(_0x37e2d5&&_0x37e2d5['replyUri']){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xced3('0x20'),util[_0xced3('0x21')](_0xced3('0x22'),_0x1cb639['id'],_0x37e2d5['replyUri']));if(_0x37e2d5[_0xced3('0x1b')]&&_0x37e2d5[_0xced3('0x1b')]['length']){_0x1cb639['Interaction']=_[_0xced3('0x23')](_0x37e2d5[_0xced3('0x1b')][0x0],_0xced3('0x1c'));_0x1cb639[_0xced3('0x1c')]=_0x37e2d5['Interactions'][0x0][_0xced3('0x1c')];}var _0x19a727={'method':'POST','uri':encodeURI(_0x37e2d5[_0xced3('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x19a727['method']){case _0xced3('0x25'):_0x19a727['qs']=_0x1cb639;break;case _0xced3('0x26'):_0x19a727[_0xced3('0x27')]=_0x1cb639;break;}return rp(_0x19a727)[_0xced3('0x1e')](function(_0x2ec2c4){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xced3('0x20'),util['format'](_0xced3('0x28'),_0x1cb639['id'],_0x37e2d5[_0xced3('0x24')]));if(_0x2ec2c4['body'][_0xced3('0x29')]&&_0x2ec2c4[_0xced3('0x27')][_0xced3('0x29')]!=_0x1cb639[_0xced3('0x2a')][_0xced3('0x29')]){return _0x3e5a04[_0xced3('0x11')][_0xced3('0x2b')]({'threadId':_0x2ec2c4[_0xced3('0x27')][_0xced3('0x29')]},{'logging':!![],'where':{'id':_0x1cb639['Interaction']['id']}});}else{return;}})[_0xced3('0x1e')](function(){return _0x4be020[_0xced3('0x2b')]({'read':!![]});})[_0xced3('0x15')](function(_0x5867af){logger[_0xced3('0x16')](_0xced3('0x2c'),_0xced3('0x20'),util[_0xced3('0x2d')](_0x5867af,{'showHidden':![],'depth':null}));_0x321c42();});}else{_0x321c42();}})[_0xced3('0x2e')](function(){_0x321c42();});}else{_0x321c42();}}},'charset':_0xced3('0x2f'),'collate':_0xced3('0x30')});}; \ No newline at end of file +var _0xda2d=['OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','catch','error','out','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','replyUri','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','util','../../config/logger','api','moment','bluebird','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','direction','toLowerCase','UserId'];(function(_0x1ebf33,_0x4ed89a){var _0x2ddd2d=function(_0x2a715d){while(--_0x2a715d){_0x1ebf33['push'](_0x1ebf33['shift']());}};_0x2ddd2d(++_0x4ed89a);}(_0xda2d,0x102));var _0xdda2=function(_0x402829,_0x38f9eb){_0x402829=_0x402829-0x0;var _0x3d36f8=_0xda2d[_0x402829];return _0x3d36f8;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var logger=require(_0xdda2('0x1'))(_0xdda2('0x2'));var moment=require(_0xdda2('0x3'));var BPromise=require(_0xdda2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdda2('0x5'));var attributes=require(_0xdda2('0x6'));module[_0xdda2('0x7')]=function(_0x39f6c9,_0xc256bc){return _0x39f6c9[_0xdda2('0x8')](_0xdda2('0x9'),attributes,{'tableName':_0xdda2('0xa'),'paranoid':![],'indexes':[{'name':_0xdda2('0xb'),'fields':[_0xdda2('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a774e,_0x22c6e5,_0x4df6b8){var _0x1c11b2=_0x39f6c9[_0xdda2('0xd')];var _0x42d990=_0x1a774e[_0xdda2('0xe')]({'plain':!![]});if(_0x42d990[_0xdda2('0xf')][_0xdda2('0x10')]()==='in'||_0x42d990[_0xdda2('0xf')][_0xdda2('0x10')]()==='out'&&!_0x42d990['secret']&&!_['isNil'](_0x42d990[_0xdda2('0x11')])){_0x1c11b2[_0xdda2('0x12')][_0xdda2('0x13')]({'where':{'id':_0x42d990[_0xdda2('0x14')]}})[_0xdda2('0x15')](function(_0x475222){if(_0x475222){_0x475222[_0xdda2('0x16')]({'lastMsgAt':_0x42d990['createdAt'],'lastMsgDirection':_0x42d990[_0xdda2('0xf')]['toLowerCase']()});}})[_0xdda2('0x17')](function(_0xb6b01e){console[_0xdda2('0x18')](_0xb6b01e);});}if(_0x42d990[_0xdda2('0xf')]===_0xdda2('0x19')&&!_0x42d990['secret']){var _0x55d674;_0x1c11b2[_0xdda2('0x1a')]['describe']()[_0xdda2('0x15')](function(_0x1a3b35){return _0x1c11b2[_0xdda2('0x1b')][_0xdda2('0x1c')]({'where':{'id':_0x42d990[_0xdda2('0x1d')]},'include':[{'model':_0x1c11b2[_0xdda2('0x12')],'as':_0xdda2('0x1e'),'where':{'id':_0x42d990[_0xdda2('0x14')]},'limit':0x1,'include':[{'model':_0x1c11b2[_0xdda2('0x1a')],'as':_0xdda2('0x1f'),'attributes':_[_0xdda2('0x20')](_0x1a3b35)}]}]});})[_0xdda2('0x15')](function(_0x4eed30){_0x55d674=_0x4eed30[_0xdda2('0xe')]({'plain':!![]});if(_0x55d674&&_0x55d674['replyUri']){logger[_0xdda2('0x21')](_0xdda2('0x22'),_0xdda2('0x23'),util['format'](_0xdda2('0x24'),_0x42d990['id'],_0x55d674['replyUri']));if(_0x55d674[_0xdda2('0x1e')]&&_0x55d674[_0xdda2('0x1e')]['length']){_0x42d990[_0xdda2('0x25')]=_[_0xdda2('0x26')](_0x55d674[_0xdda2('0x1e')][0x0],_0xdda2('0x1f'));_0x42d990[_0xdda2('0x1f')]=_0x55d674['Interactions'][0x0][_0xdda2('0x1f')];}var _0x22c6e5={'method':_0xdda2('0x27'),'uri':encodeURI(_0x55d674[_0xdda2('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x22c6e5['method']){case'GET':_0x22c6e5['qs']=_0x42d990;break;case _0xdda2('0x27'):_0x22c6e5[_0xdda2('0xc')]=_0x42d990;break;}return rp(_0x22c6e5)[_0xdda2('0x15')](function(_0x5e9e74){logger[_0xdda2('0x21')](_0xdda2('0x22'),_0xdda2('0x23'),util[_0xdda2('0x29')](_0xdda2('0x2a'),_0x42d990['id'],_0x55d674[_0xdda2('0x28')]));if(_0x5e9e74['body'][_0xdda2('0x2b')]&&_0x5e9e74[_0xdda2('0xc')]['threadId']!=_0x42d990[_0xdda2('0x25')][_0xdda2('0x2b')]){return _0x1c11b2[_0xdda2('0x12')][_0xdda2('0x16')]({'threadId':_0x5e9e74['body'][_0xdda2('0x2b')]},{'logging':!![],'where':{'id':_0x42d990[_0xdda2('0x25')]['id']}});}else{return;}})['then'](function(){return _0x1a774e[_0xdda2('0x16')]({'read':!![]});})['catch'](function(_0x2b8cd6){logger['error']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xdda2('0x2c')](_0x2b8cd6,{'showHidden':![],'depth':null}));_0x4df6b8();});}else{_0x4df6b8();}})['finally'](function(){_0x4df6b8();});}else{_0x4df6b8();}}},'charset':_0xdda2('0x2d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index d70de20..c0f8b6b 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 _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x22eb5c,_0x1251f6){var _0x105bf6=function(_0x4865b6){while(--_0x4865b6){_0x22eb5c['push'](_0x22eb5c['shift']());}};_0x105bf6(++_0x1251f6);}(_0x7a54,0x106));var _0x47a5=function(_0x515cdd,_0x44c49e){_0x515cdd=_0x515cdd-0x0;var _0x3514e8=_0x7a54[_0x515cdd];return _0x3514e8;};'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});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file +var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x56c13e,_0x24c214){var _0x2daba3=function(_0x3fa30e){while(--_0x3fa30e){_0x56c13e['push'](_0x56c13e['shift']());}};_0x2daba3(++_0x24c214);}(_0x5f2f,0x73));var _0xf5f2=function(_0x92ba74,_0x5798db){_0x92ba74=_0x92ba74-0x0;var _0x9fa6ea=_0x5f2f[_0x92ba74];return _0x9fa6ea;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index ff4cd52..9332650 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 _0xaf61=['remove','emit','removeListener','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xaf61,0xad));var _0x1af6=function(_0x28a8b,_0x193160){_0x28a8b=_0x28a8b-0x0;var _0x25bc88=_0xaf61[_0x28a8b];return _0x25bc88;};'use strict';var OpenchannelMessageEvents=require(_0x1af6('0x0'));var events=['save',_0x1af6('0x1'),'update'];function createListener(_0x2ef3ac,_0x4a4c8e){return function(_0x3e3fb0){_0x4a4c8e[_0x1af6('0x2')](_0x2ef3ac,_0x3e3fb0);};}function removeListener(_0xdd22db,_0x10abf1){return function(){OpenchannelMessageEvents[_0x1af6('0x3')](_0xdd22db,_0x10abf1);};}exports['register']=function(_0x1042a4){for(var _0x1ef6bb=0x0,_0x2af470=events[_0x1af6('0x4')];_0x1ef6bb<_0x2af470;_0x1ef6bb++){var _0x7e8953=events[_0x1ef6bb];var _0x5a5e58=createListener(_0x1af6('0x5')+_0x7e8953,_0x1042a4);OpenchannelMessageEvents['on'](_0x7e8953,_0x5a5e58);}}; \ No newline at end of file +var _0x7ee1=['openchannelMessage:','./openchannelMessage.events','removeListener','register'];(function(_0x3600b9,_0xb6d400){var _0x32cb41=function(_0x203d82){while(--_0x203d82){_0x3600b9['push'](_0x3600b9['shift']());}};_0x32cb41(++_0xb6d400);}(_0x7ee1,0x8d));var _0x17ee=function(_0x3fcb52,_0x42cb33){_0x3fcb52=_0x3fcb52-0x0;var _0x37ec33=_0x7ee1[_0x3fcb52];return _0x37ec33;};'use strict';var OpenchannelMessageEvents=require(_0x17ee('0x0'));var events=['save','remove','update'];function createListener(_0x3c8a14,_0x31a2fe){return function(_0x1790ff){_0x31a2fe['emit'](_0x3c8a14,_0x1790ff);};}function removeListener(_0x1602fd,_0x1811e4){return function(){OpenchannelMessageEvents[_0x17ee('0x1')](_0x1602fd,_0x1811e4);};}exports[_0x17ee('0x2')]=function(_0x5c0617){for(var _0x52b1db=0x0,_0x29b9eb=events['length'];_0x52b1db<_0x29b9eb;_0x52b1db++){var _0x3f61af=events[_0x52b1db];var _0x57e1d1=createListener(_0x17ee('0x3')+_0x3f61af,_0x5c0617);OpenchannelMessageEvents['on'](_0x3f61af,_0x57e1d1);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 78b031c..04c5b4b 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 _0x4dc2=['/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x9f897b,_0x2bc0f7){var _0x595177=function(_0x45f07f){while(--_0x45f07f){_0x9f897b['push'](_0x9f897b['shift']());}};_0x595177(++_0x2bc0f7);}(_0x4dc2,0xa0));var _0x24dc=function(_0x30d6fe,_0xd10c60){_0x30d6fe=_0x30d6fe-0x0;var _0x1c1aa6=_0x4dc2[_0x30d6fe];return _0x1c1aa6;};'use strict';var multer=require(_0x24dc('0x0'));var util=require(_0x24dc('0x1'));var path=require(_0x24dc('0x2'));var timeout=require(_0x24dc('0x3'));var express=require(_0x24dc('0x4'));var router=express[_0x24dc('0x5')]();var fs_extra=require(_0x24dc('0x6'));var auth=require(_0x24dc('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x24dc('0x8'));var controller=require('./openchannelQueue.controller');router[_0x24dc('0x9')]('/',auth[_0x24dc('0xa')](),controller[_0x24dc('0xb')]);router[_0x24dc('0x9')](_0x24dc('0xc'),auth['isAuthenticated'](),controller[_0x24dc('0xd')]);router[_0x24dc('0x9')](_0x24dc('0xe'),auth[_0x24dc('0xa')](),controller['show']);router['get'](_0x24dc('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0x24dc('0x9')](_0x24dc('0x10'),auth['isAuthenticated'](),controller[_0x24dc('0x11')]);router[_0x24dc('0x9')](_0x24dc('0x12'),auth[_0x24dc('0xa')](),controller[_0x24dc('0x13')]);router[_0x24dc('0x14')]('/',auth[_0x24dc('0xa')](),controller[_0x24dc('0x15')]);router[_0x24dc('0x14')](_0x24dc('0x10'),auth[_0x24dc('0xa')](),controller['addTeams']);router[_0x24dc('0x14')](_0x24dc('0x12'),auth[_0x24dc('0xa')](),controller[_0x24dc('0x16')]);router['put'](_0x24dc('0xe'),auth[_0x24dc('0xa')](),controller[_0x24dc('0x17')]);router['delete'](_0x24dc('0xe'),auth['isAuthenticated'](),controller[_0x24dc('0x18')]);router[_0x24dc('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x24dc('0x1a')]);router[_0x24dc('0x19')](_0x24dc('0x12'),auth['isAuthenticated'](),controller[_0x24dc('0x1b')]);module[_0x24dc('0x1c')]=router; \ No newline at end of file +var _0x9e02=['create','addTeams','/:id/users','addAgents','put','update','delete','destroy','/:id/teams','removeAgents','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','describe','/:id','show','/:id/members','getMembers','isAuthenticated','getTeams','getAgents','post'];(function(_0x16c1ff,_0x19d24d){var _0x2dc954=function(_0x3f0f1b){while(--_0x3f0f1b){_0x16c1ff['push'](_0x16c1ff['shift']());}};_0x2dc954(++_0x19d24d);}(_0x9e02,0x1ae));var _0x29e0=function(_0x15fb0e,_0x1cbed){_0x15fb0e=_0x15fb0e-0x0;var _0x446948=_0x9e02[_0x15fb0e];return _0x446948;};'use strict';var multer=require(_0x29e0('0x0'));var util=require('util');var path=require(_0x29e0('0x1'));var timeout=require(_0x29e0('0x2'));var express=require(_0x29e0('0x3'));var router=express['Router']();var fs_extra=require(_0x29e0('0x4'));var auth=require(_0x29e0('0x5'));var interaction=require(_0x29e0('0x6'));var config=require('../../config/environment');var controller=require(_0x29e0('0x7'));router[_0x29e0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x29e0('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x29e0('0x9')]);router[_0x29e0('0x8')](_0x29e0('0xa'),auth['isAuthenticated'](),controller[_0x29e0('0xb')]);router[_0x29e0('0x8')](_0x29e0('0xc'),auth['isAuthenticated'](),controller[_0x29e0('0xd')]);router[_0x29e0('0x8')]('/:id/teams',auth[_0x29e0('0xe')](),controller[_0x29e0('0xf')]);router[_0x29e0('0x8')]('/:id/users',auth[_0x29e0('0xe')](),controller[_0x29e0('0x10')]);router[_0x29e0('0x11')]('/',auth[_0x29e0('0xe')](),controller[_0x29e0('0x12')]);router[_0x29e0('0x11')]('/:id/teams',auth[_0x29e0('0xe')](),controller[_0x29e0('0x13')]);router['post'](_0x29e0('0x14'),auth[_0x29e0('0xe')](),controller[_0x29e0('0x15')]);router[_0x29e0('0x16')](_0x29e0('0xa'),auth[_0x29e0('0xe')](),controller[_0x29e0('0x17')]);router[_0x29e0('0x18')](_0x29e0('0xa'),auth[_0x29e0('0xe')](),controller[_0x29e0('0x19')]);router[_0x29e0('0x18')](_0x29e0('0x1a'),auth[_0x29e0('0xe')](),controller['removeTeams']);router[_0x29e0('0x18')](_0x29e0('0x14'),auth[_0x29e0('0xe')](),controller[_0x29e0('0x1b')]);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 2de2f47..16bd343 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 _0xd814=['sequelize','exports','STRING','name','rrmemory','beepall','roundrobin'];(function(_0x53eaba,_0x597381){var _0x219ee3=function(_0x90a86b){while(--_0x90a86b){_0x53eaba['push'](_0x53eaba['shift']());}};_0x219ee3(++_0x597381);}(_0xd814,0x111));var _0x4d81=function(_0x4902f7,_0x252ae9){_0x4902f7=_0x4902f7-0x0;var _0x4df48c=_0xd814[_0x4902f7];return _0x4df48c;};'use strict';var Sequelize=require(_0x4d81('0x0'));module[_0x4d81('0x1')]={'name':{'type':Sequelize[_0x4d81('0x2')],'unique':_0x4d81('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4d81('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x4d81('0x4'),_0x4d81('0x5'),_0x4d81('0x6'))}}; \ No newline at end of file +var _0xa4df=['sequelize','name','STRING','ENUM','rrmemory','roundrobin'];(function(_0x25e995,_0x143cdc){var _0x446a58=function(_0x545ebc){while(--_0x545ebc){_0x25e995['push'](_0x25e995['shift']());}};_0x446a58(++_0x143cdc);}(_0xa4df,0x14a));var _0xfa4d=function(_0x3c9182,_0x54467f){_0x3c9182=_0x3c9182-0x0;var _0x54f41c=_0xa4df[_0x3c9182];return _0x54f41c;};'use strict';var Sequelize=require(_0xfa4d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xfa4d('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfa4d('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfa4d('0x3')](_0xfa4d('0x4'),'beepall',_0xfa4d('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 6d6d9cf..2cc0dc2 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 _0xc6da=['transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','User','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','then','destroy','get','OpenchannelQueues','UserProfileResource','end','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','length','attributes','nolimit','limit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','hasOwnProperty','OpenchannelQueueId','UserOpenchannelQueue','UserId','agent','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','Agents','voicePause','flatMap','sequelize'];(function(_0x4175d7,_0x1850ff){var _0x9afa4=function(_0x492e81){while(--_0x492e81){_0x4175d7['push'](_0x4175d7['shift']());}};_0x9afa4(++_0x1850ff);}(_0xc6da,0x13d));var _0xac6d=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xc6da[_0x3c2a69];return _0x596bc8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xac6d('0x0'));var jsonpatch=require(_0xac6d('0x1'));var rp=require(_0xac6d('0x2'));var moment=require(_0xac6d('0x3'));var BPromise=require(_0xac6d('0x4'));var Mustache=require(_0xac6d('0x5'));var util=require('util');var path=require(_0xac6d('0x6'));var sox=require(_0xac6d('0x7'));var csv=require(_0xac6d('0x8'));var ejs=require(_0xac6d('0x9'));var fs=require('fs');var fs_extra=require(_0xac6d('0xa'));var _=require(_0xac6d('0xb'));var squel=require('squel');var crypto=require(_0xac6d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xac6d('0xd'));var toCsv=require(_0xac6d('0x8'));var querystring=require(_0xac6d('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xac6d('0xf'));var qs=require(_0xac6d('0x10'));var as=require(_0xac6d('0x11'));var hardwareService=require(_0xac6d('0x12'));var logger=require('../../config/logger')(_0xac6d('0x13'));var utils=require(_0xac6d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac6d('0x15'));var db=require(_0xac6d('0x16'))['db'];config[_0xac6d('0x17')]=_['defaults'](config[_0xac6d('0x17')],{'host':_0xac6d('0x18'),'port':0x18eb});var socket=require(_0xac6d('0x19'))(new Redis(config['redis']));require(_0xac6d('0x1a'))[_0xac6d('0x1b')](socket);function respondWithStatusCode(_0x698937,_0x385f4f){_0x385f4f=_0x385f4f||0xcc;return function(_0x162fbc){if(_0x162fbc){return _0x698937[_0xac6d('0x1c')](_0x385f4f);}return _0x698937['status'](_0x385f4f)['end']();};}function respondWithResult(_0x3370ae,_0x566edc){_0x566edc=_0x566edc||0xc8;return function(_0x240a1d){if(_0x240a1d){return _0x3370ae['status'](_0x566edc)[_0xac6d('0x1d')](_0x240a1d);}};}function respondWithFilteredResult(_0x27423c,_0xdfe4c){return function(_0x3d38d1){if(_0x3d38d1){var _0x2534b4=typeof _0xdfe4c[_0xac6d('0x1e')]===_0xac6d('0x1f')&&typeof _0xdfe4c['limit']===_0xac6d('0x1f');var _0x53fc62=_0x3d38d1[_0xac6d('0x20')];var _0x58750c=_0x2534b4?0x0:_0xdfe4c[_0xac6d('0x1e')];var _0x5af045=_0x2534b4?_0x3d38d1['count']:_0xdfe4c[_0xac6d('0x1e')]+_0xdfe4c['limit'];var _0x1ae24c;if(_0x5af045>=_0x53fc62){_0x5af045=_0x53fc62;_0x1ae24c=0xc8;}else{_0x1ae24c=0xce;}_0x27423c[_0xac6d('0x21')](_0x1ae24c);return _0x27423c[_0xac6d('0x22')](_0xac6d('0x23'),_0x58750c+'-'+_0x5af045+'/'+_0x53fc62)[_0xac6d('0x1d')](_0x3d38d1);}return null;};}function patchUpdates(_0x51db91){return function(_0x5167e4){try{jsonpatch[_0xac6d('0x24')](_0x5167e4,_0x51db91,!![]);}catch(_0x1f4fd1){return BPromise[_0xac6d('0x25')](_0x1f4fd1);}return _0x5167e4[_0xac6d('0x26')]();};}function saveUpdates(_0x4433bc,_0x416963){return function(_0x5028f9){if(_0x5028f9){return _0x5028f9['update'](_0x4433bc)[_0xac6d('0x27')](function(_0x1045b8){return _0x1045b8;});}return null;};}function removeEntity(_0x38f97c,_0x5aea59){return function(_0x4ab288){if(_0x4ab288){return _0x4ab288[_0xac6d('0x28')]()[_0xac6d('0x27')](function(){var _0x23b672=_0x4ab288[_0xac6d('0x29')]({'plain':!![]});var _0x58165c=_0xac6d('0x2a');return db[_0xac6d('0x2b')]['destroy']({'where':{'type':_0x58165c,'resourceId':_0x23b672['id']}})[_0xac6d('0x27')](function(){return _0x4ab288;});})[_0xac6d('0x27')](function(){_0x38f97c['status'](0xcc)[_0xac6d('0x2c')]();});}};}function handleEntityNotFound(_0x28e51c,_0x581810){return function(_0x24e943){if(!_0x24e943){_0x28e51c['sendStatus'](0x194);}return _0x24e943;};}function handleError(_0x2adb60,_0x106574){_0x106574=_0x106574||0x1f4;return function(_0x3c6552){logger[_0xac6d('0x2d')](_0x3c6552[_0xac6d('0x2e')]);if(_0x3c6552[_0xac6d('0x2f')]){delete _0x3c6552['name'];}_0x2adb60[_0xac6d('0x21')](_0x106574)[_0xac6d('0x30')](_0x3c6552);};}exports[_0xac6d('0x31')]=function(_0xfe8534,_0x82f1e3){var _0x5f223f={},_0xfb297c={},_0x1a4b42={'count':0x0,'rows':[]};var _0x4f6d14=_[_0xac6d('0x32')](db[_0xac6d('0x33')][_0xac6d('0x34')],function(_0x397f7a){return{'name':_0x397f7a[_0xac6d('0x35')],'type':_0x397f7a[_0xac6d('0x36')][_0xac6d('0x37')]};});_0xfb297c[_0xac6d('0x38')]=_[_0xac6d('0x32')](_0x4f6d14,'name');_0xfb297c['query']=_[_0xac6d('0x39')](_0xfe8534['query']);_0xfb297c[_0xac6d('0x3a')]=_[_0xac6d('0x3b')](_0xfb297c[_0xac6d('0x38')],_0xfb297c[_0xac6d('0x3c')]);_0x5f223f['attributes']=_['intersection'](_0xfb297c[_0xac6d('0x38')],qs['fields'](_0xfe8534[_0xac6d('0x3c')][_0xac6d('0x3d')]));_0x5f223f['attributes']=_0x5f223f['attributes'][_0xac6d('0x3e')]?_0x5f223f[_0xac6d('0x3f')]:_0xfb297c['model'];if(!_0xfe8534['query']['hasOwnProperty'](_0xac6d('0x40'))){_0x5f223f[_0xac6d('0x41')]=qs[_0xac6d('0x41')](_0xfe8534[_0xac6d('0x3c')][_0xac6d('0x41')]);_0x5f223f[_0xac6d('0x1e')]=qs[_0xac6d('0x1e')](_0xfe8534[_0xac6d('0x3c')]['offset']);}_0x5f223f[_0xac6d('0x42')]=qs[_0xac6d('0x43')](_0xfe8534[_0xac6d('0x3c')][_0xac6d('0x43')]);_0x5f223f[_0xac6d('0x44')]=qs[_0xac6d('0x3a')](_[_0xac6d('0x45')](_0xfe8534[_0xac6d('0x3c')],_0xfb297c[_0xac6d('0x3a')]),_0x4f6d14);if(_0xfe8534[_0xac6d('0x3c')][_0xac6d('0x46')]){_0x5f223f['where']=_[_0xac6d('0x47')](_0x5f223f[_0xac6d('0x44')],{'$or':_[_0xac6d('0x32')](_0x4f6d14,function(_0x5c2739){if(_0x5c2739[_0xac6d('0x36')]!=='VIRTUAL'){var _0x42188a={};_0x42188a[_0x5c2739[_0xac6d('0x2f')]]={'$like':'%'+_0xfe8534[_0xac6d('0x3c')]['filter']+'%'};return _0x42188a;}})});}_0x5f223f=_[_0xac6d('0x47')]({},_0x5f223f,_0xfe8534[_0xac6d('0x48')]);var _0x90a4bd={'where':_0x5f223f['where']};return db[_0xac6d('0x33')]['count'](_0x90a4bd)['then'](function(_0x31fac8){_0x1a4b42[_0xac6d('0x20')]=_0x31fac8;if(_0xfe8534[_0xac6d('0x3c')]['includeAll']){_0x5f223f[_0xac6d('0x49')]=[{'all':!![]}];}return db[_0xac6d('0x33')][_0xac6d('0x4a')](_0x5f223f);})[_0xac6d('0x27')](function(_0x17857c){_0x1a4b42[_0xac6d('0x4b')]=_0x17857c;return _0x1a4b42;})[_0xac6d('0x27')](respondWithFilteredResult(_0x82f1e3,_0x5f223f))[_0xac6d('0x4c')](handleError(_0x82f1e3,null));};exports['show']=function(_0x6589b9,_0x4e1307){var _0x532628={'raw':!![],'where':{'id':_0x6589b9['params']['id']}},_0x143d20={};_0x143d20['model']=_['keys'](db[_0xac6d('0x33')][_0xac6d('0x34')]);_0x143d20[_0xac6d('0x3c')]=_[_0xac6d('0x39')](_0x6589b9['query']);_0x143d20['filters']=_[_0xac6d('0x3b')](_0x143d20[_0xac6d('0x38')],_0x143d20['query']);_0x532628[_0xac6d('0x3f')]=_[_0xac6d('0x3b')](_0x143d20[_0xac6d('0x38')],qs['fields'](_0x6589b9[_0xac6d('0x3c')][_0xac6d('0x3d')]));_0x532628[_0xac6d('0x3f')]=_0x532628[_0xac6d('0x3f')][_0xac6d('0x3e')]?_0x532628[_0xac6d('0x3f')]:_0x143d20[_0xac6d('0x38')];if(_0x6589b9['query'][_0xac6d('0x4d')]){_0x532628[_0xac6d('0x49')]=[{'all':!![]}];}_0x532628=_[_0xac6d('0x47')]({},_0x532628,_0x6589b9[_0xac6d('0x48')]);return db[_0xac6d('0x33')]['find'](_0x532628)[_0xac6d('0x27')](handleEntityNotFound(_0x4e1307,null))[_0xac6d('0x27')](respondWithResult(_0x4e1307,null))[_0xac6d('0x4c')](handleError(_0x4e1307,null));};exports[_0xac6d('0x4e')]=function(_0x5e4e1f,_0x364a71){return db[_0xac6d('0x33')][_0xac6d('0x4e')](_0x5e4e1f[_0xac6d('0x4f')],{})[_0xac6d('0x27')](function(_0x4acfd7){var _0x3eeff7=_0x5e4e1f[_0xac6d('0x50')]['get']({'plain':!![]});if(!_0x3eeff7)throw new Error(_0xac6d('0x51'));if(_0x3eeff7['role']==='user'){var _0x20438e=_0x4acfd7[_0xac6d('0x29')]({'plain':!![]});var _0x486cf4=_0xac6d('0x2a');return db[_0xac6d('0x52')][_0xac6d('0x53')]({'where':{'name':_0x486cf4,'userProfileId':_0x3eeff7['userProfileId']},'raw':!![]})[_0xac6d('0x27')](function(_0x4ffb3d){if(_0x4ffb3d&&_0x4ffb3d['autoAssociation']===0x0){return db['UserProfileResource'][_0xac6d('0x4e')]({'name':_0x20438e[_0xac6d('0x2f')],'resourceId':_0x20438e['id'],'type':_0x4ffb3d[_0xac6d('0x2f')],'sectionId':_0x4ffb3d['id']},{})[_0xac6d('0x27')](function(){return _0x4acfd7;});}else{return _0x4acfd7;}})[_0xac6d('0x4c')](function(_0x4e5c41){logger[_0xac6d('0x2d')](_0xac6d('0x54'),_0x4e5c41);throw _0x4e5c41;});}return _0x4acfd7;})['then'](respondWithResult(_0x364a71,0xc9))[_0xac6d('0x4c')](handleError(_0x364a71,null));};exports[_0xac6d('0x55')]=function(_0x4c2dd6,_0xed3d99){if(_0x4c2dd6[_0xac6d('0x4f')]['id']){delete _0x4c2dd6[_0xac6d('0x4f')]['id'];}return db[_0xac6d('0x33')][_0xac6d('0x53')]({'where':{'id':_0x4c2dd6[_0xac6d('0x56')]['id']}})[_0xac6d('0x27')](handleEntityNotFound(_0xed3d99,null))[_0xac6d('0x27')](saveUpdates(_0x4c2dd6[_0xac6d('0x4f')],null))[_0xac6d('0x27')](respondWithResult(_0xed3d99,null))[_0xac6d('0x4c')](handleError(_0xed3d99,null));};exports[_0xac6d('0x28')]=function(_0x444de9,_0x37e009){return db[_0xac6d('0x33')][_0xac6d('0x53')]({'where':{'id':_0x444de9[_0xac6d('0x56')]['id']}})[_0xac6d('0x27')](handleEntityNotFound(_0x37e009,null))[_0xac6d('0x27')](removeEntity(_0x37e009,null))['catch'](handleError(_0x37e009,null));};exports[_0xac6d('0x57')]=function(_0x1b3dcb,_0x1b77ee){return db['OpenchannelQueue']['describe']()[_0xac6d('0x27')](respondWithResult(_0x1b77ee,null))[_0xac6d('0x4c')](handleError(_0x1b77ee,null));};exports[_0xac6d('0x58')]=function(_0x310f1e,_0x404623,_0x540b0d){var _0x54e858={'raw':!![],'where':{}},_0x36e3c9={},_0x4f2ad7;return db[_0xac6d('0x33')][_0xac6d('0x59')]({'where':{'id':_0x310f1e[_0xac6d('0x56')]['id']}})[_0xac6d('0x27')](handleEntityNotFound(_0x404623,null))[_0xac6d('0x27')](function(_0x4b0f58){if(_0x4b0f58){_0x4f2ad7=_0x4b0f58[_0xac6d('0x29')]({'plain':!![]});_0x36e3c9[_0xac6d('0x38')]=_[_0xac6d('0x39')](db['UserOpenchannelQueue'][_0xac6d('0x34')]);_0x36e3c9[_0xac6d('0x3c')]=_[_0xac6d('0x39')](_0x310f1e[_0xac6d('0x3c')]);_0x36e3c9[_0xac6d('0x3a')]=_['intersection'](_0x36e3c9[_0xac6d('0x38')],_0x36e3c9[_0xac6d('0x3c')]);_0x54e858[_0xac6d('0x3f')]=_[_0xac6d('0x3b')](_0x36e3c9['model'],qs[_0xac6d('0x3d')](_0x310f1e[_0xac6d('0x3c')][_0xac6d('0x3d')]));_0x54e858[_0xac6d('0x3f')]=_0x54e858['attributes'][_0xac6d('0x3e')]?_0x54e858['attributes']:_0x36e3c9[_0xac6d('0x38')];if(!_0x310f1e[_0xac6d('0x3c')][_0xac6d('0x5a')](_0xac6d('0x40'))){_0x54e858[_0xac6d('0x41')]=qs[_0xac6d('0x41')](_0x310f1e[_0xac6d('0x3c')]['limit']);_0x54e858[_0xac6d('0x1e')]=qs[_0xac6d('0x1e')](_0x310f1e[_0xac6d('0x3c')][_0xac6d('0x1e')]);}_0x54e858[_0xac6d('0x42')]=qs[_0xac6d('0x43')](_0x310f1e[_0xac6d('0x3c')]['sort']);_0x54e858[_0xac6d('0x44')]=qs[_0xac6d('0x3a')](_['pick'](_0x310f1e[_0xac6d('0x3c')],_0x36e3c9[_0xac6d('0x3a')]));_0x54e858['where'][_0xac6d('0x5b')]=_0x4b0f58['id'];if(_0x310f1e['query'][_0xac6d('0x46')]){_0x54e858[_0xac6d('0x44')]=_[_0xac6d('0x47')](_0x54e858[_0xac6d('0x44')],{'$or':_[_0xac6d('0x32')](_0x54e858['attributes'],function(_0x19e00e){var _0x587b2a={};_0x587b2a[_0x19e00e]={'$like':'%'+_0x310f1e[_0xac6d('0x3c')]['filter']+'%'};return _0x587b2a;})});}_0x54e858=_[_0xac6d('0x47')]({},_0x54e858,_0x310f1e[_0xac6d('0x48')]);return db[_0xac6d('0x5c')]['findAll'](_0x54e858);}})['then'](function(_0x2d65f2){if(_0x2d65f2){return db['User']['findAndCountAll']({'where':{'id':_[_0xac6d('0x32')](_0x2d65f2,_0xac6d('0x5d')),'role':_0xac6d('0x5e')},'attributes':['id',_0xac6d('0x2f'),'openchannelPause',_0xac6d('0x5f'),_0xac6d('0x60')]});}})['then'](function(_0xec788d){if(_0xec788d){return{'count':_0xec788d[_0xac6d('0x20')],'rows':_[_0xac6d('0x32')](_0xec788d[_0xac6d('0x4b')],function(_0x4c8671){return{'membername':_0x4c8671[_0xac6d('0x2f')],'UserId':_0x4c8671['id'],'queue_name':_0x4f2ad7[_0xac6d('0x2f')],'OpenchannelQueueId':_0x4f2ad7['id'],'interface':util[_0xac6d('0x61')]('%s/%s',_0xac6d('0x62'),_0x4c8671[_0xac6d('0x2f')]),'penalty':0x0,'paused':_0x4c8671['openchannelPause'],'createdAt':_0x4c8671[_0xac6d('0x60')],'updatedAt':_0x4c8671['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xac6d('0x27')](respondWithFilteredResult(_0x404623,_0x54e858))[_0xac6d('0x4c')](handleError(_0x404623,null));};exports[_0xac6d('0x63')]=function(_0x3ddd9d,_0x3e1fbe,_0xc71618){var _0x48f04e={};var _0x4087b1={};var _0x86a84c;var _0x283814;return db[_0xac6d('0x33')]['findOne']({'where':{'id':_0x3ddd9d['params']['id']}})[_0xac6d('0x27')](handleEntityNotFound(_0x3e1fbe,null))[_0xac6d('0x27')](function(_0x2a20c1){if(_0x2a20c1){_0x86a84c=_0x2a20c1;_0x4087b1[_0xac6d('0x38')]=_['keys'](db[_0xac6d('0x64')][_0xac6d('0x34')]);_0x4087b1[_0xac6d('0x3c')]=_['keys'](_0x3ddd9d['query']);_0x4087b1[_0xac6d('0x3a')]=_[_0xac6d('0x3b')](_0x4087b1[_0xac6d('0x38')],_0x4087b1['query']);_0x48f04e[_0xac6d('0x3f')]=_[_0xac6d('0x3b')](_0x4087b1[_0xac6d('0x38')],qs[_0xac6d('0x3d')](_0x3ddd9d[_0xac6d('0x3c')][_0xac6d('0x3d')]));_0x48f04e['attributes']=_0x48f04e['attributes']['length']?_0x48f04e['attributes']:_0x4087b1[_0xac6d('0x38')];_0x48f04e['order']=qs[_0xac6d('0x43')](_0x3ddd9d[_0xac6d('0x3c')][_0xac6d('0x43')]);_0x48f04e[_0xac6d('0x44')]=qs[_0xac6d('0x3a')](_[_0xac6d('0x45')](_0x3ddd9d['query'],_0x4087b1[_0xac6d('0x3a')]));if(_0x3ddd9d[_0xac6d('0x3c')][_0xac6d('0x46')]){_0x48f04e['where']=_[_0xac6d('0x47')](_0x48f04e[_0xac6d('0x44')],{'$or':_['map'](_0x48f04e[_0xac6d('0x3f')],function(_0x11e75e){var _0x4ec4bf={};_0x4ec4bf[_0x11e75e]={'$like':'%'+_0x3ddd9d[_0xac6d('0x3c')][_0xac6d('0x46')]+'%'};return _0x4ec4bf;})});}_0x48f04e=_[_0xac6d('0x47')]({},_0x48f04e,_0x3ddd9d[_0xac6d('0x48')]);return _0x86a84c[_0xac6d('0x63')](_0x48f04e);}})['then'](function(_0x544011){if(_0x544011){_0x283814=_0x544011[_0xac6d('0x3e')];if(!_0x3ddd9d[_0xac6d('0x3c')][_0xac6d('0x5a')](_0xac6d('0x40'))){_0x48f04e[_0xac6d('0x41')]=qs[_0xac6d('0x41')](_0x3ddd9d[_0xac6d('0x3c')][_0xac6d('0x41')]);_0x48f04e[_0xac6d('0x1e')]=qs[_0xac6d('0x1e')](_0x3ddd9d[_0xac6d('0x3c')][_0xac6d('0x1e')]);}return _0x86a84c[_0xac6d('0x63')](_0x48f04e);}})[_0xac6d('0x27')](function(_0x587fbc){if(_0x587fbc){return _0x587fbc?{'count':_0x283814,'rows':_0x587fbc}:null;}})[_0xac6d('0x27')](respondWithResult(_0x3e1fbe,null))[_0xac6d('0x4c')](handleError(_0x3e1fbe,null));};exports[_0xac6d('0x65')]=function(_0x35deff,_0x691ea,_0x52baac){var _0x34a0d5=_0x35deff[_0xac6d('0x4f')]['ids'];return db[_0xac6d('0x64')][_0xac6d('0x4a')]({'where':{'id':_0x34a0d5},'attributes':['id'],'include':[{'model':db['User'],'as':_0xac6d('0x66'),'attributes':['id',_0xac6d('0x2f'),'online',_0xac6d('0x67'),'interface'],'raw':!![]}]})[_0xac6d('0x27')](function(_0x5a0047){if(_0x5a0047){var _0x224cf4=_[_0xac6d('0x68')](_0x5a0047,function(_0x209978){var _0x505635=_0x209978[_0xac6d('0x29')]({'plain':!![]});return _0x505635[_0xac6d('0x66')];});return db[_0xac6d('0x33')][_0xac6d('0x53')]({'where':{'id':_0x35deff[_0xac6d('0x56')]['id']}})[_0xac6d('0x27')](function(_0x591b10){return db[_0xac6d('0x69')][_0xac6d('0x6a')](function(_0x1f1aaa){return _0x591b10['addTeams'](_0x34a0d5,{'transaction':_0x1f1aaa})[_0xac6d('0x27')](function(){return BPromise[_0xac6d('0x6b')](_0x224cf4,function(_0x4bf9e8){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x4bf9e8['id'],'OpenchannelQueueId':_0x35deff['params']['id']},'transaction':_0x1f1aaa});});})[_0xac6d('0x27')](function(){_0x224cf4[_0xac6d('0x6c')](function(_0x8eafe2){socket[_0xac6d('0x6d')](_0xac6d('0x6e'),{'UserId':_0x8eafe2['id'],'OpenchannelQueueId':_0x591b10['id']});});});});});}})[_0xac6d('0x27')](respondWithStatusCode(_0x691ea,null))['catch'](handleError(_0x691ea,null));};exports[_0xac6d('0x6f')]=function(_0x3c654e,_0x422ee6,_0x3c23f7){return db[_0xac6d('0x64')]['findAll']({'where':{'id':_0x3c654e[_0xac6d('0x3c')][_0xac6d('0x70')]},'attributes':['id'],'include':[{'model':db[_0xac6d('0x71')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x422ee6,null))['then'](function(_0x105818){var _0x377d59=_[_0xac6d('0x32')](_0x105818,'id');var _0x320586=[];var _0x122d47=[];var _0x1ecd62=squel[_0xac6d('0x72')]();_0x1ecd62[_0xac6d('0x73')](_0xac6d('0x74'))[_0xac6d('0x75')]('team_has_openchannel_queues','tq')[_0xac6d('0x76')](_0xac6d('0x77'),'ut',_0xac6d('0x78'))[_0xac6d('0x44')](_0xac6d('0x79'),_0x3c654e[_0xac6d('0x56')]['id']);for(var _0x3ddd72=0x0;_0x3ddd72<_0x105818[_0xac6d('0x3e')];_0x3ddd72+=0x1){let _0x200d1d=_0x105818[_0x3ddd72];for(var _0x5156bc=0x0;_0x5156bc<_0x200d1d[_0xac6d('0x66')][_0xac6d('0x3e')];_0x5156bc+=0x1){let _0x3d2483=_0x200d1d[_0xac6d('0x66')][_0x5156bc];var _0x28592c=_0x1ecd62[_0xac6d('0x7a')]();_0x28592c[_0xac6d('0x44')](_0xac6d('0x7b'),_0x3d2483['id']);_0x122d47['push'](db[_0xac6d('0x69')][_0xac6d('0x3c')](_0x28592c[_0xac6d('0x7c')](),{'type':db[_0xac6d('0x69')]['QueryTypes'][_0xac6d('0x7d')]})['then'](function(_0x28d4e2){if(_0x28d4e2[_0xac6d('0x3e')]===0x1){return _0x3d2483['id'];}else{var _0x5559b4=_[_0xac6d('0x7e')](_[_0xac6d('0x32')](_0x28d4e2,_0xac6d('0x7f')),function(_0x59b228){return _[_0xac6d('0x80')](_0x377d59,_0x59b228);});if(_0x5559b4){return _0x3d2483['id'];}}}));}}return BPromise[_0xac6d('0x81')](_0x122d47)[_0xac6d('0x27')](function(_0x7ad51d){_0x320586=_(_0x320586)[_0xac6d('0x82')](_0x7ad51d)[_0xac6d('0x83')]()[_0xac6d('0x84')]();return db[_0xac6d('0x33')][_0xac6d('0x53')]({'where':{'id':_0x3c654e[_0xac6d('0x56')]['id']}})['then'](function(_0x503d3d){return db[_0xac6d('0x69')][_0xac6d('0x6a')](function(_0xcb7470){return _0x503d3d['removeTeams'](_0x3c654e['query'][_0xac6d('0x70')],{'transaction':_0xcb7470})[_0xac6d('0x27')](function(){if(!_[_0xac6d('0x85')](_0x320586)){return _0x503d3d[_0xac6d('0x86')](_0x320586,{'transaction':_0xcb7470});}})[_0xac6d('0x27')](function(){_0x320586[_0xac6d('0x6c')](function(_0x20c2ff){socket[_0xac6d('0x6d')]('userOpenchannelQueue:remove',{'UserId':_0x20c2ff,'OpenchannelQueueId':_0x503d3d['id']});});});});});});})['then'](respondWithStatusCode(_0x422ee6,null))[_0xac6d('0x4c')](handleError(_0x422ee6,null));};exports['addAgents']=function(_0x311806,_0x52c0bc,_0x4b3ab5){return db[_0xac6d('0x33')][_0xac6d('0x53')]({'where':{'id':_0x311806['params']['id']}})[_0xac6d('0x27')](handleEntityNotFound(_0x52c0bc,null))[_0xac6d('0x27')](function(_0x28ea4b){if(_0x28ea4b){return _0x28ea4b[_0xac6d('0x87')](_0x311806['body'][_0xac6d('0x70')],_[_0xac6d('0x88')](_0x311806['body'],['ids','id'])||{})[_0xac6d('0x89')](function(_0x26f7e6){for(var _0x18144e=0x0;_0x18144e<_0x311806[_0xac6d('0x4f')][_0xac6d('0x70')][_0xac6d('0x3e')];_0x18144e+=0x1){socket[_0xac6d('0x6d')](_0xac6d('0x6e'),{'UserId':Number(_0x311806[_0xac6d('0x4f')][_0xac6d('0x70')][_0x18144e]),'OpenchannelQueueId':Number(_0x311806['params']['id'])});}return _0x26f7e6;});}})[_0xac6d('0x27')](respondWithResult(_0x52c0bc,null))['catch'](handleError(_0x52c0bc,null));};exports[_0xac6d('0x86')]=function(_0x51225c,_0x45217d,_0x5e3908){return db[_0xac6d('0x33')]['find']({'where':{'id':_0x51225c['params']['id']}})['then'](handleEntityNotFound(_0x45217d,null))[_0xac6d('0x27')](function(_0x488eee){if(_0x488eee){return _0x488eee[_0xac6d('0x86')](_0x51225c[_0xac6d('0x3c')][_0xac6d('0x70')])[_0xac6d('0x27')](function(){if(_[_0xac6d('0x8a')](_0x51225c[_0xac6d('0x3c')][_0xac6d('0x70')])){for(var _0x4d7211=0x0;_0x4d7211<_0x51225c[_0xac6d('0x3c')][_0xac6d('0x70')]['length'];_0x4d7211+=0x1){socket['emit'](_0xac6d('0x8b'),{'UserId':Number(_0x51225c[_0xac6d('0x3c')][_0xac6d('0x70')][_0x4d7211]),'OpenchannelQueueId':Number(_0x51225c[_0xac6d('0x56')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x51225c[_0xac6d('0x3c')][_0xac6d('0x70')]),'OpenchannelQueueId':Number(_0x51225c['params']['id'])});}});}})[_0xac6d('0x27')](respondWithStatusCode(_0x45217d,null))[_0xac6d('0x4c')](handleError(_0x45217d,null));};exports[_0xac6d('0x8c')]=function(_0x14ce0f,_0x4eb294,_0x2e2d79){var _0x36640e={};var _0xe59ca5={};var _0x877db7;var _0x5ba08e;return db[_0xac6d('0x33')][_0xac6d('0x59')]({'where':{'id':_0x14ce0f['params']['id']}})['then'](handleEntityNotFound(_0x4eb294,null))[_0xac6d('0x27')](function(_0x18dc71){if(_0x18dc71){_0x877db7=_0x18dc71;_0xe59ca5[_0xac6d('0x38')]=_['keys'](db[_0xac6d('0x71')][_0xac6d('0x34')]);_0xe59ca5[_0xac6d('0x3c')]=_[_0xac6d('0x39')](_0x14ce0f['query']);_0xe59ca5[_0xac6d('0x3a')]=_[_0xac6d('0x3b')](_0xe59ca5[_0xac6d('0x38')],_0xe59ca5['query']);_0x36640e['attributes']=_[_0xac6d('0x3b')](_0xe59ca5[_0xac6d('0x38')],qs[_0xac6d('0x3d')](_0x14ce0f['query']['fields']));_0x36640e[_0xac6d('0x3f')]=_0x36640e[_0xac6d('0x3f')][_0xac6d('0x3e')]?_0x36640e['attributes']:_0xe59ca5[_0xac6d('0x38')];_0x36640e[_0xac6d('0x42')]=qs[_0xac6d('0x43')](_0x14ce0f[_0xac6d('0x3c')][_0xac6d('0x43')]);_0x36640e[_0xac6d('0x44')]=qs[_0xac6d('0x3a')](_['pick'](_0x14ce0f[_0xac6d('0x3c')],_0xe59ca5[_0xac6d('0x3a')]));if(_0x14ce0f[_0xac6d('0x3c')][_0xac6d('0x46')]){_0x36640e['where']=_['merge'](_0x36640e['where'],{'$or':_[_0xac6d('0x32')](_0x36640e[_0xac6d('0x3f')],function(_0xd95a65){var _0x21333e={};_0x21333e[_0xd95a65]={'$like':'%'+_0x14ce0f['query'][_0xac6d('0x46')]+'%'};return _0x21333e;})});}_0x36640e=_['merge']({},_0x36640e,_0x14ce0f[_0xac6d('0x48')]);return _0x877db7['getAgents'](_0x36640e);}})[_0xac6d('0x27')](function(_0x1bbf37){if(_0x1bbf37){_0x5ba08e=_0x1bbf37[_0xac6d('0x3e')];if(!_0x14ce0f['query'][_0xac6d('0x5a')](_0xac6d('0x40'))){_0x36640e[_0xac6d('0x41')]=qs[_0xac6d('0x41')](_0x14ce0f[_0xac6d('0x3c')][_0xac6d('0x41')]);_0x36640e[_0xac6d('0x1e')]=qs[_0xac6d('0x1e')](_0x14ce0f[_0xac6d('0x3c')][_0xac6d('0x1e')]);}return _0x877db7['getAgents'](_0x36640e);}})[_0xac6d('0x27')](function(_0x2ae274){if(_0x2ae274){return _0x2ae274?{'count':_0x5ba08e,'rows':_0x2ae274}:null;}})[_0xac6d('0x27')](respondWithResult(_0x4eb294,null))[_0xac6d('0x4c')](handleError(_0x4eb294,null));}; \ No newline at end of file +var _0x494f=['where','pick','filter','merge','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','findOne','hasOwnProperty','options','UserOpenchannelQueue','User','findAndCountAll','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','order','ids','Agents','online','voicePause','interface','params','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort'];(function(_0x50c6dc,_0x5abf7d){var _0x544770=function(_0x1f96b3){while(--_0x1f96b3){_0x50c6dc['push'](_0x50c6dc['shift']());}};_0x544770(++_0x5abf7d);}(_0x494f,0xd2));var _0xf494=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x494f[_0x292f93];return _0x5a94b1;};'use strict';var emlformat=require(_0xf494('0x0'));var rimraf=require(_0xf494('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf494('0x2'));var rp=require('request-promise');var moment=require(_0xf494('0x3'));var BPromise=require(_0xf494('0x4'));var Mustache=require(_0xf494('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf494('0x6'));var csv=require(_0xf494('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf494('0x8'));var _=require(_0xf494('0x9'));var squel=require(_0xf494('0xa'));var crypto=require(_0xf494('0xb'));var jsforce=require(_0xf494('0xc'));var deskjs=require(_0xf494('0xd'));var toCsv=require(_0xf494('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf494('0xe'));var qs=require(_0xf494('0xf'));var as=require(_0xf494('0x10'));var hardwareService=require(_0xf494('0x11'));var logger=require(_0xf494('0x12'))(_0xf494('0x13'));var utils=require(_0xf494('0x14'));var config=require(_0xf494('0x15'));var licenseUtil=require(_0xf494('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf494('0x17')](config[_0xf494('0x18')],{'host':_0xf494('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf494('0x18')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x53ce22,_0x2a5e06){_0x2a5e06=_0x2a5e06||0xcc;return function(_0x1d6395){if(_0x1d6395){return _0x53ce22[_0xf494('0x1a')](_0x2a5e06);}return _0x53ce22['status'](_0x2a5e06)[_0xf494('0x1b')]();};}function respondWithResult(_0x3d9bbe,_0x115619){_0x115619=_0x115619||0xc8;return function(_0x452f11){if(_0x452f11){return _0x3d9bbe[_0xf494('0x1c')](_0x115619)['json'](_0x452f11);}};}function respondWithFilteredResult(_0x5ad0f4,_0x48cece){return function(_0x273b67){if(_0x273b67){var _0x244aa5=typeof _0x48cece[_0xf494('0x1d')]===_0xf494('0x1e')&&typeof _0x48cece[_0xf494('0x1f')]===_0xf494('0x1e');var _0x314746=_0x273b67[_0xf494('0x20')];var _0x16142e=_0x244aa5?0x0:_0x48cece[_0xf494('0x1d')];var _0xd682a9=_0x244aa5?_0x273b67[_0xf494('0x20')]:_0x48cece[_0xf494('0x1d')]+_0x48cece[_0xf494('0x1f')];var _0x4c3c97;if(_0xd682a9>=_0x314746){_0xd682a9=_0x314746;_0x4c3c97=0xc8;}else{_0x4c3c97=0xce;}_0x5ad0f4[_0xf494('0x1c')](_0x4c3c97);return _0x5ad0f4[_0xf494('0x21')](_0xf494('0x22'),_0x16142e+'-'+_0xd682a9+'/'+_0x314746)[_0xf494('0x23')](_0x273b67);}return null;};}function patchUpdates(_0x350ed5){return function(_0xf0985a){try{jsonpatch[_0xf494('0x24')](_0xf0985a,_0x350ed5,!![]);}catch(_0x40ea47){return BPromise[_0xf494('0x25')](_0x40ea47);}return _0xf0985a['save']();};}function saveUpdates(_0x5dab7,_0x5e882c){return function(_0x344a22){if(_0x344a22){return _0x344a22[_0xf494('0x26')](_0x5dab7)[_0xf494('0x27')](function(_0x20506d){return _0x20506d;});}return null;};}function removeEntity(_0x5f5d5e,_0x1aee5b){return function(_0x5a7433){if(_0x5a7433){return _0x5a7433[_0xf494('0x28')]()[_0xf494('0x27')](function(){var _0x2f3bee=_0x5a7433[_0xf494('0x29')]({'plain':!![]});var _0x39bbcc=_0xf494('0x2a');return db[_0xf494('0x2b')]['destroy']({'where':{'type':_0x39bbcc,'resourceId':_0x2f3bee['id']}})[_0xf494('0x27')](function(){return _0x5a7433;});})[_0xf494('0x27')](function(){_0x5f5d5e[_0xf494('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54ffdc,_0x28fcdd){return function(_0x3b7580){if(!_0x3b7580){_0x54ffdc[_0xf494('0x1a')](0x194);}return _0x3b7580;};}function handleError(_0x505204,_0x59dfd8){_0x59dfd8=_0x59dfd8||0x1f4;return function(_0x4ed2de){logger[_0xf494('0x2c')](_0x4ed2de['stack']);if(_0x4ed2de[_0xf494('0x2d')]){delete _0x4ed2de[_0xf494('0x2d')];}_0x505204[_0xf494('0x1c')](_0x59dfd8)[_0xf494('0x2e')](_0x4ed2de);};}exports['index']=function(_0x291414,_0x1fc067){var _0x13b40e={},_0x52b978={},_0x235df2={'count':0x0,'rows':[]};var _0x53083f=_[_0xf494('0x2f')](db['OpenchannelQueue'][_0xf494('0x30')],function(_0x908b06){return{'name':_0x908b06['fieldName'],'type':_0x908b06[_0xf494('0x31')][_0xf494('0x32')]};});_0x52b978[_0xf494('0x33')]=_['map'](_0x53083f,_0xf494('0x2d'));_0x52b978[_0xf494('0x34')]=_[_0xf494('0x35')](_0x291414['query']);_0x52b978[_0xf494('0x36')]=_[_0xf494('0x37')](_0x52b978[_0xf494('0x33')],_0x52b978[_0xf494('0x34')]);_0x13b40e[_0xf494('0x38')]=_['intersection'](_0x52b978[_0xf494('0x33')],qs['fields'](_0x291414[_0xf494('0x34')][_0xf494('0x39')]));_0x13b40e[_0xf494('0x38')]=_0x13b40e[_0xf494('0x38')]['length']?_0x13b40e['attributes']:_0x52b978['model'];if(!_0x291414[_0xf494('0x34')]['hasOwnProperty'](_0xf494('0x3a'))){_0x13b40e[_0xf494('0x1f')]=qs['limit'](_0x291414[_0xf494('0x34')][_0xf494('0x1f')]);_0x13b40e[_0xf494('0x1d')]=qs[_0xf494('0x1d')](_0x291414[_0xf494('0x34')][_0xf494('0x1d')]);}_0x13b40e['order']=qs[_0xf494('0x3b')](_0x291414[_0xf494('0x34')][_0xf494('0x3b')]);_0x13b40e[_0xf494('0x3c')]=qs[_0xf494('0x36')](_[_0xf494('0x3d')](_0x291414['query'],_0x52b978[_0xf494('0x36')]),_0x53083f);if(_0x291414[_0xf494('0x34')][_0xf494('0x3e')]){_0x13b40e[_0xf494('0x3c')]=_['merge'](_0x13b40e[_0xf494('0x3c')],{'$or':_['map'](_0x53083f,function(_0x1e271d){if(_0x1e271d[_0xf494('0x31')]!=='VIRTUAL'){var _0xf59011={};_0xf59011[_0x1e271d['name']]={'$like':'%'+_0x291414['query'][_0xf494('0x3e')]+'%'};return _0xf59011;}})});}_0x13b40e=_[_0xf494('0x3f')]({},_0x13b40e,_0x291414['options']);var _0x4d8d95={'where':_0x13b40e[_0xf494('0x3c')]};return db[_0xf494('0x40')][_0xf494('0x20')](_0x4d8d95)[_0xf494('0x27')](function(_0x37c892){_0x235df2[_0xf494('0x20')]=_0x37c892;if(_0x291414[_0xf494('0x34')][_0xf494('0x41')]){_0x13b40e[_0xf494('0x42')]=[{'all':!![]}];}return db[_0xf494('0x40')][_0xf494('0x43')](_0x13b40e);})['then'](function(_0x2069ae){_0x235df2[_0xf494('0x44')]=_0x2069ae;return _0x235df2;})[_0xf494('0x27')](respondWithFilteredResult(_0x1fc067,_0x13b40e))[_0xf494('0x45')](handleError(_0x1fc067,null));};exports[_0xf494('0x46')]=function(_0x13afb6,_0x108d3e){var _0x4b4dce={'raw':!![],'where':{'id':_0x13afb6['params']['id']}},_0x5e4ebd={};_0x5e4ebd[_0xf494('0x33')]=_[_0xf494('0x35')](db['OpenchannelQueue'][_0xf494('0x30')]);_0x5e4ebd[_0xf494('0x34')]=_['keys'](_0x13afb6[_0xf494('0x34')]);_0x5e4ebd[_0xf494('0x36')]=_[_0xf494('0x37')](_0x5e4ebd[_0xf494('0x33')],_0x5e4ebd[_0xf494('0x34')]);_0x4b4dce['attributes']=_[_0xf494('0x37')](_0x5e4ebd[_0xf494('0x33')],qs[_0xf494('0x39')](_0x13afb6[_0xf494('0x34')]['fields']));_0x4b4dce[_0xf494('0x38')]=_0x4b4dce[_0xf494('0x38')][_0xf494('0x47')]?_0x4b4dce[_0xf494('0x38')]:_0x5e4ebd[_0xf494('0x33')];if(_0x13afb6[_0xf494('0x34')][_0xf494('0x41')]){_0x4b4dce['include']=[{'all':!![]}];}_0x4b4dce=_[_0xf494('0x3f')]({},_0x4b4dce,_0x13afb6['options']);return db[_0xf494('0x40')]['find'](_0x4b4dce)[_0xf494('0x27')](handleEntityNotFound(_0x108d3e,null))[_0xf494('0x27')](respondWithResult(_0x108d3e,null))[_0xf494('0x45')](handleError(_0x108d3e,null));};exports[_0xf494('0x48')]=function(_0x5d00df,_0x40bc11){return db[_0xf494('0x40')][_0xf494('0x48')](_0x5d00df[_0xf494('0x49')],{})[_0xf494('0x27')](function(_0x58dfc8){var _0x4476e9=_0x5d00df[_0xf494('0x4a')][_0xf494('0x29')]({'plain':!![]});if(!_0x4476e9)throw new Error(_0xf494('0x4b'));if(_0x4476e9['role']===_0xf494('0x4a')){var _0x5efdbc=_0x58dfc8[_0xf494('0x29')]({'plain':!![]});var _0x463519='OpenchannelQueues';return db[_0xf494('0x4c')]['find']({'where':{'name':_0x463519,'userProfileId':_0x4476e9[_0xf494('0x4d')]},'raw':!![]})[_0xf494('0x27')](function(_0x5b940b){if(_0x5b940b&&_0x5b940b[_0xf494('0x4e')]===0x0){return db[_0xf494('0x2b')]['create']({'name':_0x5efdbc[_0xf494('0x2d')],'resourceId':_0x5efdbc['id'],'type':_0x5b940b[_0xf494('0x2d')],'sectionId':_0x5b940b['id']},{})[_0xf494('0x27')](function(){return _0x58dfc8;});}else{return _0x58dfc8;}})['catch'](function(_0x251b30){logger[_0xf494('0x2c')](_0xf494('0x4f'),_0x251b30);throw _0x251b30;});}return _0x58dfc8;})['then'](respondWithResult(_0x40bc11,0xc9))['catch'](handleError(_0x40bc11,null));};exports[_0xf494('0x26')]=function(_0x6f337d,_0xfa9e33){if(_0x6f337d['body']['id']){delete _0x6f337d[_0xf494('0x49')]['id'];}return db[_0xf494('0x40')][_0xf494('0x50')]({'where':{'id':_0x6f337d['params']['id']}})[_0xf494('0x27')](handleEntityNotFound(_0xfa9e33,null))['then'](saveUpdates(_0x6f337d[_0xf494('0x49')],null))['then'](respondWithResult(_0xfa9e33,null))[_0xf494('0x45')](handleError(_0xfa9e33,null));};exports[_0xf494('0x28')]=function(_0x591ca8,_0x2dbda6){return db[_0xf494('0x40')][_0xf494('0x50')]({'where':{'id':_0x591ca8['params']['id']}})[_0xf494('0x27')](handleEntityNotFound(_0x2dbda6,null))[_0xf494('0x27')](removeEntity(_0x2dbda6,null))[_0xf494('0x45')](handleError(_0x2dbda6,null));};exports['describe']=function(_0x1ef4a2,_0x19739e){return db[_0xf494('0x40')]['describe']()[_0xf494('0x27')](respondWithResult(_0x19739e,null))[_0xf494('0x45')](handleError(_0x19739e,null));};exports['getMembers']=function(_0x172b4a,_0x23297e,_0x4da959){var _0x50c80a={'raw':!![],'where':{}},_0x4a2855={},_0x45091;return db['OpenchannelQueue'][_0xf494('0x51')]({'where':{'id':_0x172b4a['params']['id']}})[_0xf494('0x27')](handleEntityNotFound(_0x23297e,null))[_0xf494('0x27')](function(_0x3b00fa){if(_0x3b00fa){_0x45091=_0x3b00fa[_0xf494('0x29')]({'plain':!![]});_0x4a2855[_0xf494('0x33')]=_['keys'](db['UserOpenchannelQueue'][_0xf494('0x30')]);_0x4a2855[_0xf494('0x34')]=_['keys'](_0x172b4a['query']);_0x4a2855[_0xf494('0x36')]=_[_0xf494('0x37')](_0x4a2855[_0xf494('0x33')],_0x4a2855[_0xf494('0x34')]);_0x50c80a[_0xf494('0x38')]=_['intersection'](_0x4a2855[_0xf494('0x33')],qs[_0xf494('0x39')](_0x172b4a[_0xf494('0x34')][_0xf494('0x39')]));_0x50c80a[_0xf494('0x38')]=_0x50c80a['attributes']['length']?_0x50c80a['attributes']:_0x4a2855[_0xf494('0x33')];if(!_0x172b4a['query'][_0xf494('0x52')]('nolimit')){_0x50c80a[_0xf494('0x1f')]=qs[_0xf494('0x1f')](_0x172b4a[_0xf494('0x34')][_0xf494('0x1f')]);_0x50c80a[_0xf494('0x1d')]=qs[_0xf494('0x1d')](_0x172b4a[_0xf494('0x34')][_0xf494('0x1d')]);}_0x50c80a['order']=qs[_0xf494('0x3b')](_0x172b4a[_0xf494('0x34')][_0xf494('0x3b')]);_0x50c80a[_0xf494('0x3c')]=qs[_0xf494('0x36')](_[_0xf494('0x3d')](_0x172b4a['query'],_0x4a2855[_0xf494('0x36')]));_0x50c80a[_0xf494('0x3c')]['OpenchannelQueueId']=_0x3b00fa['id'];if(_0x172b4a[_0xf494('0x34')]['filter']){_0x50c80a[_0xf494('0x3c')]=_['merge'](_0x50c80a['where'],{'$or':_[_0xf494('0x2f')](_0x50c80a['attributes'],function(_0x2921bc){var _0x10bd99={};_0x10bd99[_0x2921bc]={'$like':'%'+_0x172b4a['query'][_0xf494('0x3e')]+'%'};return _0x10bd99;})});}_0x50c80a=_[_0xf494('0x3f')]({},_0x50c80a,_0x172b4a[_0xf494('0x53')]);return db[_0xf494('0x54')][_0xf494('0x43')](_0x50c80a);}})[_0xf494('0x27')](function(_0x1ef3a2){if(_0x1ef3a2){return db[_0xf494('0x55')][_0xf494('0x56')]({'where':{'id':_[_0xf494('0x2f')](_0x1ef3a2,'UserId'),'role':'agent'},'attributes':['id','name',_0xf494('0x57'),_0xf494('0x58'),_0xf494('0x59')]});}})[_0xf494('0x27')](function(_0x23371a){if(_0x23371a){return{'count':_0x23371a[_0xf494('0x20')],'rows':_[_0xf494('0x2f')](_0x23371a[_0xf494('0x44')],function(_0x8f0367){return{'membername':_0x8f0367[_0xf494('0x2d')],'UserId':_0x8f0367['id'],'queue_name':_0x45091[_0xf494('0x2d')],'OpenchannelQueueId':_0x45091['id'],'interface':util[_0xf494('0x5a')](_0xf494('0x5b'),_0xf494('0x5c'),_0x8f0367['name']),'penalty':0x0,'paused':_0x8f0367[_0xf494('0x57')],'createdAt':_0x8f0367[_0xf494('0x59')],'updatedAt':_0x8f0367[_0xf494('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x23297e,_0x50c80a))['catch'](handleError(_0x23297e,null));};exports['getTeams']=function(_0x568fa4,_0x1c7fe4,_0x11e309){var _0x2d5d45={};var _0x53656c={};var _0x54ea8e;var _0x3b418f;return db[_0xf494('0x40')][_0xf494('0x51')]({'where':{'id':_0x568fa4['params']['id']}})[_0xf494('0x27')](handleEntityNotFound(_0x1c7fe4,null))[_0xf494('0x27')](function(_0x16981a){if(_0x16981a){_0x54ea8e=_0x16981a;_0x53656c[_0xf494('0x33')]=_['keys'](db[_0xf494('0x5d')][_0xf494('0x30')]);_0x53656c[_0xf494('0x34')]=_[_0xf494('0x35')](_0x568fa4['query']);_0x53656c[_0xf494('0x36')]=_['intersection'](_0x53656c[_0xf494('0x33')],_0x53656c[_0xf494('0x34')]);_0x2d5d45['attributes']=_['intersection'](_0x53656c['model'],qs[_0xf494('0x39')](_0x568fa4['query'][_0xf494('0x39')]));_0x2d5d45['attributes']=_0x2d5d45[_0xf494('0x38')][_0xf494('0x47')]?_0x2d5d45[_0xf494('0x38')]:_0x53656c[_0xf494('0x33')];_0x2d5d45[_0xf494('0x5e')]=qs['sort'](_0x568fa4['query'][_0xf494('0x3b')]);_0x2d5d45[_0xf494('0x3c')]=qs[_0xf494('0x36')](_[_0xf494('0x3d')](_0x568fa4[_0xf494('0x34')],_0x53656c[_0xf494('0x36')]));if(_0x568fa4[_0xf494('0x34')][_0xf494('0x3e')]){_0x2d5d45['where']=_[_0xf494('0x3f')](_0x2d5d45['where'],{'$or':_['map'](_0x2d5d45[_0xf494('0x38')],function(_0x70924c){var _0x549eaf={};_0x549eaf[_0x70924c]={'$like':'%'+_0x568fa4[_0xf494('0x34')][_0xf494('0x3e')]+'%'};return _0x549eaf;})});}_0x2d5d45=_['merge']({},_0x2d5d45,_0x568fa4[_0xf494('0x53')]);return _0x54ea8e['getTeams'](_0x2d5d45);}})[_0xf494('0x27')](function(_0xaa0abd){if(_0xaa0abd){_0x3b418f=_0xaa0abd['length'];if(!_0x568fa4[_0xf494('0x34')][_0xf494('0x52')](_0xf494('0x3a'))){_0x2d5d45[_0xf494('0x1f')]=qs['limit'](_0x568fa4[_0xf494('0x34')][_0xf494('0x1f')]);_0x2d5d45[_0xf494('0x1d')]=qs[_0xf494('0x1d')](_0x568fa4[_0xf494('0x34')]['offset']);}return _0x54ea8e['getTeams'](_0x2d5d45);}})[_0xf494('0x27')](function(_0x506c13){if(_0x506c13){return _0x506c13?{'count':_0x3b418f,'rows':_0x506c13}:null;}})['then'](respondWithResult(_0x1c7fe4,null))['catch'](handleError(_0x1c7fe4,null));};exports['addTeams']=function(_0x2a3591,_0x129eed,_0x5cd1d7){var _0x491782=_0x2a3591[_0xf494('0x49')][_0xf494('0x5f')];return db[_0xf494('0x5d')][_0xf494('0x43')]({'where':{'id':_0x491782},'attributes':['id'],'include':[{'model':db[_0xf494('0x55')],'as':_0xf494('0x60'),'attributes':['id',_0xf494('0x2d'),_0xf494('0x61'),_0xf494('0x62'),_0xf494('0x63')],'raw':!![]}]})[_0xf494('0x27')](function(_0x17d45e){if(_0x17d45e){var _0x22f878=_['flatMap'](_0x17d45e,function(_0x59ac77){var _0x5b855d=_0x59ac77[_0xf494('0x29')]({'plain':!![]});return _0x5b855d['Agents'];});return db[_0xf494('0x40')]['find']({'where':{'id':_0x2a3591[_0xf494('0x64')]['id']}})[_0xf494('0x27')](function(_0x1c851e){return db[_0xf494('0x65')][_0xf494('0x66')](function(_0x7b8afc){return _0x1c851e[_0xf494('0x67')](_0x491782,{'transaction':_0x7b8afc})[_0xf494('0x27')](function(){return BPromise[_0xf494('0x68')](_0x22f878,function(_0x289918){return db['UserOpenchannelQueue'][_0xf494('0x69')]({'where':{'UserId':_0x289918['id'],'OpenchannelQueueId':_0x2a3591[_0xf494('0x64')]['id']},'transaction':_0x7b8afc});});})[_0xf494('0x27')](function(){_0x22f878[_0xf494('0x6a')](function(_0x3ec296){socket[_0xf494('0x6b')](_0xf494('0x6c'),{'UserId':_0x3ec296['id'],'OpenchannelQueueId':_0x1c851e['id']});});});});});}})[_0xf494('0x27')](respondWithStatusCode(_0x129eed,null))[_0xf494('0x45')](handleError(_0x129eed,null));};exports[_0xf494('0x6d')]=function(_0x35e11d,_0x488252,_0x4ac4a4){return db[_0xf494('0x5d')][_0xf494('0x43')]({'where':{'id':_0x35e11d[_0xf494('0x34')][_0xf494('0x5f')]},'attributes':['id'],'include':[{'model':db[_0xf494('0x55')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf494('0x27')](handleEntityNotFound(_0x488252,null))[_0xf494('0x27')](function(_0x549502){var _0x5a7041=_['map'](_0x549502,'id');var _0xaf0559=[];var _0xcd88a3=[];var _0x8ea12e=squel['select']();_0x8ea12e[_0xf494('0x6e')](_0xf494('0x6f'))[_0xf494('0x70')](_0xf494('0x71'),'tq')['join'](_0xf494('0x72'),'ut',_0xf494('0x73'))[_0xf494('0x3c')](_0xf494('0x74'),_0x35e11d['params']['id']);for(var _0x43be48=0x0;_0x43be48<_0x549502[_0xf494('0x47')];_0x43be48+=0x1){let _0x20409=_0x549502[_0x43be48];for(var _0x1a17c1=0x0;_0x1a17c1<_0x20409['Agents']['length'];_0x1a17c1+=0x1){let _0x118baf=_0x20409['Agents'][_0x1a17c1];var _0x20b165=_0x8ea12e[_0xf494('0x75')]();_0x20b165[_0xf494('0x3c')](_0xf494('0x76'),_0x118baf['id']);_0xcd88a3[_0xf494('0x77')](db[_0xf494('0x65')][_0xf494('0x34')](_0x20b165[_0xf494('0x78')](),{'type':db['sequelize'][_0xf494('0x79')][_0xf494('0x7a')]})['then'](function(_0x1abe22){if(_0x1abe22[_0xf494('0x47')]===0x1){return _0x118baf['id'];}else{var _0x536333=_[_0xf494('0x7b')](_[_0xf494('0x2f')](_0x1abe22,'TeamId'),function(_0x13a056){return _[_0xf494('0x7c')](_0x5a7041,_0x13a056);});if(_0x536333){return _0x118baf['id'];}}}));}}return BPromise[_0xf494('0x7d')](_0xcd88a3)['then'](function(_0x26bd25){_0xaf0559=_(_0xaf0559)['union'](_0x26bd25)[_0xf494('0x7e')]()[_0xf494('0x7f')]();return db[_0xf494('0x40')][_0xf494('0x50')]({'where':{'id':_0x35e11d['params']['id']}})[_0xf494('0x27')](function(_0x46d7e2){return db[_0xf494('0x65')][_0xf494('0x66')](function(_0xc6aff4){return _0x46d7e2[_0xf494('0x6d')](_0x35e11d[_0xf494('0x34')][_0xf494('0x5f')],{'transaction':_0xc6aff4})['then'](function(){if(!_[_0xf494('0x80')](_0xaf0559)){return _0x46d7e2['removeAgents'](_0xaf0559,{'transaction':_0xc6aff4});}})['then'](function(){_0xaf0559[_0xf494('0x6a')](function(_0xfba93b){socket[_0xf494('0x6b')](_0xf494('0x81'),{'UserId':_0xfba93b,'OpenchannelQueueId':_0x46d7e2['id']});});});});});});})[_0xf494('0x27')](respondWithStatusCode(_0x488252,null))[_0xf494('0x45')](handleError(_0x488252,null));};exports[_0xf494('0x82')]=function(_0x165935,_0x450ea7,_0x1c51a6){return db[_0xf494('0x40')][_0xf494('0x50')]({'where':{'id':_0x165935[_0xf494('0x64')]['id']}})[_0xf494('0x27')](handleEntityNotFound(_0x450ea7,null))[_0xf494('0x27')](function(_0x152a8a){if(_0x152a8a){return _0x152a8a[_0xf494('0x82')](_0x165935['body'][_0xf494('0x5f')],_[_0xf494('0x83')](_0x165935['body'],[_0xf494('0x5f'),'id'])||{})[_0xf494('0x84')](function(_0x188681){for(var _0x1c83bb=0x0;_0x1c83bb<_0x165935[_0xf494('0x49')][_0xf494('0x5f')][_0xf494('0x47')];_0x1c83bb+=0x1){socket[_0xf494('0x6b')](_0xf494('0x6c'),{'UserId':Number(_0x165935[_0xf494('0x49')]['ids'][_0x1c83bb]),'OpenchannelQueueId':Number(_0x165935[_0xf494('0x64')]['id'])});}return _0x188681;});}})[_0xf494('0x27')](respondWithResult(_0x450ea7,null))[_0xf494('0x45')](handleError(_0x450ea7,null));};exports[_0xf494('0x85')]=function(_0x134ef5,_0x3af43a,_0x712bbb){return db[_0xf494('0x40')][_0xf494('0x50')]({'where':{'id':_0x134ef5[_0xf494('0x64')]['id']}})[_0xf494('0x27')](handleEntityNotFound(_0x3af43a,null))[_0xf494('0x27')](function(_0x14fe0e){if(_0x14fe0e){return _0x14fe0e[_0xf494('0x85')](_0x134ef5[_0xf494('0x34')][_0xf494('0x5f')])[_0xf494('0x27')](function(){if(_['isArray'](_0x134ef5[_0xf494('0x34')][_0xf494('0x5f')])){for(var _0x4511c9=0x0;_0x4511c9<_0x134ef5['query']['ids'][_0xf494('0x47')];_0x4511c9+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x134ef5[_0xf494('0x34')][_0xf494('0x5f')][_0x4511c9]),'OpenchannelQueueId':Number(_0x134ef5[_0xf494('0x64')]['id'])});}}else{socket[_0xf494('0x6b')](_0xf494('0x81'),{'UserId':Number(_0x134ef5[_0xf494('0x34')][_0xf494('0x5f')]),'OpenchannelQueueId':Number(_0x134ef5[_0xf494('0x64')]['id'])});}});}})['then'](respondWithStatusCode(_0x3af43a,null))[_0xf494('0x45')](handleError(_0x3af43a,null));};exports['getAgents']=function(_0x3355b1,_0x161c9e,_0x5b0bd1){var _0x49b29d={};var _0x1e15c4={};var _0x1815f8;var _0x459886;return db[_0xf494('0x40')]['findOne']({'where':{'id':_0x3355b1[_0xf494('0x64')]['id']}})['then'](handleEntityNotFound(_0x161c9e,null))[_0xf494('0x27')](function(_0x3b269b){if(_0x3b269b){_0x1815f8=_0x3b269b;_0x1e15c4[_0xf494('0x33')]=_['keys'](db[_0xf494('0x55')][_0xf494('0x30')]);_0x1e15c4['query']=_[_0xf494('0x35')](_0x3355b1[_0xf494('0x34')]);_0x1e15c4[_0xf494('0x36')]=_[_0xf494('0x37')](_0x1e15c4[_0xf494('0x33')],_0x1e15c4['query']);_0x49b29d[_0xf494('0x38')]=_['intersection'](_0x1e15c4[_0xf494('0x33')],qs[_0xf494('0x39')](_0x3355b1[_0xf494('0x34')][_0xf494('0x39')]));_0x49b29d[_0xf494('0x38')]=_0x49b29d[_0xf494('0x38')]['length']?_0x49b29d[_0xf494('0x38')]:_0x1e15c4[_0xf494('0x33')];_0x49b29d[_0xf494('0x5e')]=qs[_0xf494('0x3b')](_0x3355b1[_0xf494('0x34')][_0xf494('0x3b')]);_0x49b29d[_0xf494('0x3c')]=qs[_0xf494('0x36')](_['pick'](_0x3355b1[_0xf494('0x34')],_0x1e15c4[_0xf494('0x36')]));if(_0x3355b1[_0xf494('0x34')][_0xf494('0x3e')]){_0x49b29d[_0xf494('0x3c')]=_['merge'](_0x49b29d[_0xf494('0x3c')],{'$or':_[_0xf494('0x2f')](_0x49b29d[_0xf494('0x38')],function(_0xc9e7b5){var _0x5d1134={};_0x5d1134[_0xc9e7b5]={'$like':'%'+_0x3355b1[_0xf494('0x34')]['filter']+'%'};return _0x5d1134;})});}_0x49b29d=_[_0xf494('0x3f')]({},_0x49b29d,_0x3355b1[_0xf494('0x53')]);return _0x1815f8['getAgents'](_0x49b29d);}})[_0xf494('0x27')](function(_0x212348){if(_0x212348){_0x459886=_0x212348[_0xf494('0x47')];if(!_0x3355b1[_0xf494('0x34')][_0xf494('0x52')](_0xf494('0x3a'))){_0x49b29d['limit']=qs[_0xf494('0x1f')](_0x3355b1[_0xf494('0x34')][_0xf494('0x1f')]);_0x49b29d[_0xf494('0x1d')]=qs[_0xf494('0x1d')](_0x3355b1[_0xf494('0x34')][_0xf494('0x1d')]);}return _0x1815f8[_0xf494('0x86')](_0x49b29d);}})[_0xf494('0x27')](function(_0x975b45){if(_0x975b45){return _0x975b45?{'count':_0x459886,'rows':_0x975b45}:null;}})[_0xf494('0x27')](respondWithResult(_0x161c9e,null))[_0xf494('0x45')](handleError(_0x161c9e,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 1644d3a..6f51aa0 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 _0xf36f=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x466c9d,_0x34e07f){var _0xbb57ce=function(_0x1be0ea){while(--_0x1be0ea){_0x466c9d['push'](_0x466c9d['shift']());}};_0xbb57ce(++_0x34e07f);}(_0xf36f,0x13c));var _0xff36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf36f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xff36('0x0'));var OpenchannelQueue=require(_0xff36('0x1'))['db'][_0xff36('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xff36('0x3')](0x0);var events={'afterCreate':_0xff36('0x4'),'afterUpdate':_0xff36('0x5'),'afterDestroy':_0xff36('0x6')};function emitEvent(_0x2571b8){return function(_0x476ca0,_0x123e32,_0x35a7bb){OpenchannelQueueEvents[_0xff36('0x7')](_0x2571b8+':'+_0x476ca0['id'],_0x476ca0);OpenchannelQueueEvents[_0xff36('0x7')](_0x2571b8,_0x476ca0);_0x35a7bb(null);};}for(var e in events){if(events[_0xff36('0x8')](e)){var event=events[e];OpenchannelQueue[_0xff36('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xc093=['../../mysqldb','OpenchannelQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2f6541,_0x363cba){var _0x4d76d8=function(_0x86404){while(--_0x86404){_0x2f6541['push'](_0x2f6541['shift']());}};_0x4d76d8(++_0x363cba);}(_0xc093,0x13f));var _0x3c09=function(_0x5e4b85,_0x6cf965){_0x5e4b85=_0x5e4b85-0x0;var _0x5cd3cb=_0xc093[_0x5e4b85];return _0x5cd3cb;};'use strict';var EventEmitter=require(_0x3c09('0x0'));var OpenchannelQueue=require(_0x3c09('0x1'))['db'][_0x3c09('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3c09('0x3'),'afterUpdate':_0x3c09('0x4'),'afterDestroy':_0x3c09('0x5')};function emitEvent(_0x106406){return function(_0x53292a,_0x4a4e62,_0x273af6){OpenchannelQueueEvents[_0x3c09('0x6')](_0x106406+':'+_0x53292a['id'],_0x53292a);OpenchannelQueueEvents[_0x3c09('0x6')](_0x106406,_0x53292a);_0x273af6(null);};}for(var e in events){if(events[_0x3c09('0x7')](e)){var event=events[e];OpenchannelQueue[_0x3c09('0x8')](e,emitEvent(event));}}module[_0x3c09('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index e3210bf..5d4a10d 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 _0x9739=['define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports'];(function(_0x248525,_0x5a1b75){var _0xacf65a=function(_0x3c0aa3){while(--_0x3c0aa3){_0x248525['push'](_0x248525['shift']());}};_0xacf65a(++_0x5a1b75);}(_0x9739,0x153));var _0x9973=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x9739[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x9973('0x0'));var util=require(_0x9973('0x1'));var logger=require(_0x9973('0x2'))(_0x9973('0x3'));var moment=require('moment');var BPromise=require(_0x9973('0x4'));var rp=require(_0x9973('0x5'));var fs=require('fs');var path=require(_0x9973('0x6'));var rimraf=require(_0x9973('0x7'));var config=require(_0x9973('0x8'));var attributes=require(_0x9973('0x9'));module[_0x9973('0xa')]=function(_0x4e49f3,_0x445f8c){return _0x4e49f3[_0x9973('0xb')](_0x9973('0xc'),attributes,{'tableName':_0x9973('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e97=['bluebird','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','api','moment'];(function(_0x208ae4,_0x90d245){var _0x56f433=function(_0x4c8e39){while(--_0x4c8e39){_0x208ae4['push'](_0x208ae4['shift']());}};_0x56f433(++_0x90d245);}(_0x7e97,0x1ca));var _0x77e9=function(_0x1f9bf7,_0x3c469e){_0x1f9bf7=_0x1f9bf7-0x0;var _0x7e0deb=_0x7e97[_0x1f9bf7];return _0x7e0deb;};'use strict';var _=require(_0x77e9('0x0'));var util=require(_0x77e9('0x1'));var logger=require('../../config/logger')(_0x77e9('0x2'));var moment=require(_0x77e9('0x3'));var BPromise=require(_0x77e9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x77e9('0x5'));var attributes=require(_0x77e9('0x6'));module[_0x77e9('0x7')]=function(_0x9ea6ff,_0x17e7f2){return _0x9ea6ff[_0x77e9('0x8')](_0x77e9('0x9'),attributes,{'tableName':_0x77e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index d07a0df..3a9c33e 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 _0x817d=['message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','limit','include','map','model','attributes','then','ShowOpenchannelQueue','find','where','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','./openchannelQueue.socket','request','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x3a6922,_0xc728be){var _0x9c1b44=function(_0x4ffb5e){while(--_0x4ffb5e){_0x3a6922['push'](_0x3a6922['shift']());}};_0x9c1b44(++_0xc728be);}(_0x817d,0x113));var _0xd817=function(_0x5325cd,_0x2bfba8){_0x5325cd=_0x5325cd-0x0;var _0x5e6342=_0x817d[_0x5325cd];return _0x5e6342;};'use strict';var _=require(_0xd817('0x0'));var util=require(_0xd817('0x1'));var moment=require(_0xd817('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd817('0x3'));var db=require(_0xd817('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd817('0x5'))(_0xd817('0x6'));var config=require(_0xd817('0x7'));var jayson=require(_0xd817('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xd817('0x9')]=_['defaults'](config[_0xd817('0x9')],{'host':_0xd817('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd817('0x9')]));require(_0xd817('0xb'))['register'](socket);function respondWithRpcPromise(_0x330f88,_0x3df9fa,_0x58bc66){return new BPromise(function(_0x2b5e60,_0x5786c0){return client[_0xd817('0xc')](_0x330f88,_0x58bc66)['then'](function(_0x48e550){logger[_0xd817('0xd')]('OpenchannelQueue,\x20%s,\x20%s',_0x3df9fa,_0xd817('0xe'));logger[_0xd817('0xf')](_0xd817('0x10'),_0x3df9fa,'request\x20sent',JSON[_0xd817('0x11')](_0x48e550));if(_0x48e550[_0xd817('0x12')]){if(_0x48e550[_0xd817('0x12')][_0xd817('0x13')]===0x1f4){logger[_0xd817('0x12')](_0xd817('0x14'),_0x3df9fa,_0x48e550[_0xd817('0x12')][_0xd817('0x15')]);return _0x5786c0(_0x48e550['error']['message']);}logger['error'](_0xd817('0x14'),_0x3df9fa,_0x48e550['error'][_0xd817('0x15')]);return _0x2b5e60(_0x48e550[_0xd817('0x12')]['message']);}else{logger[_0xd817('0xd')]('OpenchannelQueue,\x20%s,\x20%s',_0x3df9fa,_0xd817('0xe'));_0x2b5e60(_0x48e550['result']['message']);}})[_0xd817('0x16')](function(_0x490b13){logger[_0xd817('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x3df9fa,_0x490b13);_0x5786c0(_0x490b13);});});}exports[_0xd817('0x17')]=function(_0x6b3f1a){var _0x79f6c3=this;return new Promise(function(_0x59715a,_0x4f87a1){return db[_0xd817('0x18')][_0xd817('0x19')]({'raw':_0x6b3f1a[_0xd817('0x1a')]?_0x6b3f1a['options'][_0xd817('0x1b')]===undefined?!![]:![]:!![],'where':_0x6b3f1a[_0xd817('0x1a')]?_0x6b3f1a[_0xd817('0x1a')]['where']||null:null,'attributes':_0x6b3f1a['options']?_0x6b3f1a[_0xd817('0x1a')]['attributes']||null:null,'limit':_0x6b3f1a[_0xd817('0x1a')]?_0x6b3f1a[_0xd817('0x1a')][_0xd817('0x1c')]||null:null,'include':_0x6b3f1a[_0xd817('0x1a')]?_0x6b3f1a[_0xd817('0x1a')][_0xd817('0x1d')]?_[_0xd817('0x1e')](_0x6b3f1a[_0xd817('0x1a')][_0xd817('0x1d')],function(_0x22a83f){return{'model':db[_0x22a83f[_0xd817('0x1f')]],'as':_0x22a83f['as'],'attributes':_0x22a83f[_0xd817('0x20')],'include':_0x22a83f[_0xd817('0x1d')]?_[_0xd817('0x1e')](_0x22a83f[_0xd817('0x1d')],function(_0x5327a4){return{'model':db[_0x5327a4[_0xd817('0x1f')]],'as':_0x5327a4['as'],'attributes':_0x5327a4[_0xd817('0x20')],'include':_0x5327a4[_0xd817('0x1d')]?_['map'](_0x5327a4[_0xd817('0x1d')],function(_0x3abf80){return{'model':db[_0x3abf80[_0xd817('0x1f')]],'as':_0x3abf80['as'],'attributes':_0x3abf80[_0xd817('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd817('0x21')](function(_0x48241f){logger[_0xd817('0xd')](_0xd817('0x17'),_0x6b3f1a);logger[_0xd817('0xf')](_0xd817('0x17'),_0x6b3f1a,JSON[_0xd817('0x11')](_0x48241f));_0x59715a(_0x48241f);})['catch'](function(_0xe723a3){logger[_0xd817('0x12')](_0xd817('0x17'),_0xe723a3[_0xd817('0x15')],_0x6b3f1a);_0x4f87a1(_0x79f6c3['error'](0x1f4,_0xe723a3[_0xd817('0x15')]));});});};exports[_0xd817('0x22')]=function(_0x54bd7e){var _0x16c26c=this;return new Promise(function(_0x20aee8,_0x194321){return db[_0xd817('0x18')][_0xd817('0x23')]({'raw':_0x54bd7e['options']?_0x54bd7e[_0xd817('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x54bd7e[_0xd817('0x1a')]?_0x54bd7e[_0xd817('0x1a')][_0xd817('0x24')]||null:null,'attributes':_0x54bd7e['options']?_0x54bd7e[_0xd817('0x1a')][_0xd817('0x20')]||null:null,'include':_0x54bd7e['options']?_0x54bd7e['options']['include']?_[_0xd817('0x1e')](_0x54bd7e[_0xd817('0x1a')][_0xd817('0x1d')],function(_0x25be17){return{'model':db[_0x25be17['model']],'as':_0x25be17['as'],'attributes':_0x25be17[_0xd817('0x20')],'include':_0x25be17[_0xd817('0x1d')]?_[_0xd817('0x1e')](_0x25be17['include'],function(_0x4bf74d){return{'model':db[_0x4bf74d[_0xd817('0x1f')]],'as':_0x4bf74d['as'],'attributes':_0x4bf74d[_0xd817('0x20')],'include':_0x4bf74d[_0xd817('0x1d')]?_[_0xd817('0x1e')](_0x4bf74d[_0xd817('0x1d')],function(_0x376d86){return{'model':db[_0x376d86['model']],'as':_0x376d86['as'],'attributes':_0x376d86[_0xd817('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd817('0x21')](function(_0x31cebc){logger['info']('ShowOpenchannelQueue',_0x54bd7e);logger['debug'](_0xd817('0x22'),_0x54bd7e,JSON[_0xd817('0x11')](_0x31cebc));_0x20aee8(_0x31cebc);})[_0xd817('0x16')](function(_0x20deb5){logger[_0xd817('0x12')](_0xd817('0x22'),_0x20deb5[_0xd817('0x15')],_0x54bd7e);_0x194321(_0x16c26c[_0xd817('0x12')](0x1f4,_0x20deb5[_0xd817('0x15')]));});});}; \ No newline at end of file +var _0xe0fb=['ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe0fb,0x161));var _0xbe0f=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xe0fb[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xbe0f('0x0'));var util=require(_0xbe0f('0x1'));var moment=require(_0xbe0f('0x2'));var BPromise=require(_0xbe0f('0x3'));var rs=require(_0xbe0f('0x4'));var fs=require('fs');var Redis=require(_0xbe0f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe0f('0x6'));var logger=require(_0xbe0f('0x7'))(_0xbe0f('0x8'));var config=require(_0xbe0f('0x9'));var jayson=require(_0xbe0f('0xa'));var client=jayson[_0xbe0f('0xb')][_0xbe0f('0xc')]({'port':0x232a});config[_0xbe0f('0xd')]=_[_0xbe0f('0xe')](config['redis'],{'host':_0xbe0f('0xf'),'port':0x18eb});var socket=require(_0xbe0f('0x10'))(new Redis(config[_0xbe0f('0xd')]));require(_0xbe0f('0x11'))[_0xbe0f('0x12')](socket);function respondWithRpcPromise(_0x272833,_0x31a532,_0x5eb986){return new BPromise(function(_0x4d580d,_0x1ff9d2){return client[_0xbe0f('0x13')](_0x272833,_0x5eb986)[_0xbe0f('0x14')](function(_0x500f0f){logger['info'](_0xbe0f('0x15'),_0x31a532,'request\x20sent');logger[_0xbe0f('0x16')](_0xbe0f('0x17'),_0x31a532,_0xbe0f('0x18'),JSON[_0xbe0f('0x19')](_0x500f0f));if(_0x500f0f[_0xbe0f('0x1a')]){if(_0x500f0f['error'][_0xbe0f('0x1b')]===0x1f4){logger[_0xbe0f('0x1a')](_0xbe0f('0x15'),_0x31a532,_0x500f0f['error']['message']);return _0x1ff9d2(_0x500f0f[_0xbe0f('0x1a')][_0xbe0f('0x1c')]);}logger[_0xbe0f('0x1a')](_0xbe0f('0x15'),_0x31a532,_0x500f0f[_0xbe0f('0x1a')][_0xbe0f('0x1c')]);return _0x4d580d(_0x500f0f[_0xbe0f('0x1a')][_0xbe0f('0x1c')]);}else{logger[_0xbe0f('0x1d')](_0xbe0f('0x15'),_0x31a532,_0xbe0f('0x18'));_0x4d580d(_0x500f0f[_0xbe0f('0x1e')][_0xbe0f('0x1c')]);}})[_0xbe0f('0x1f')](function(_0xdcc471){logger[_0xbe0f('0x1a')]('OpenchannelQueue,\x20%s,\x20%s',_0x31a532,_0xdcc471);_0x1ff9d2(_0xdcc471);});});}exports['GetOpenchannelQueue']=function(_0x4c7b85){var _0x58d995=this;return new Promise(function(_0x1e8ab6,_0x119966){return db[_0xbe0f('0x20')][_0xbe0f('0x21')]({'raw':_0x4c7b85['options']?_0x4c7b85[_0xbe0f('0x22')][_0xbe0f('0x23')]===undefined?!![]:![]:!![],'where':_0x4c7b85[_0xbe0f('0x22')]?_0x4c7b85[_0xbe0f('0x22')][_0xbe0f('0x24')]||null:null,'attributes':_0x4c7b85[_0xbe0f('0x22')]?_0x4c7b85['options'][_0xbe0f('0x25')]||null:null,'limit':_0x4c7b85['options']?_0x4c7b85[_0xbe0f('0x22')][_0xbe0f('0x26')]||null:null,'include':_0x4c7b85[_0xbe0f('0x22')]?_0x4c7b85[_0xbe0f('0x22')][_0xbe0f('0x27')]?_[_0xbe0f('0x28')](_0x4c7b85[_0xbe0f('0x22')][_0xbe0f('0x27')],function(_0x14b050){return{'model':db[_0x14b050['model']],'as':_0x14b050['as'],'attributes':_0x14b050[_0xbe0f('0x25')],'include':_0x14b050['include']?_[_0xbe0f('0x28')](_0x14b050['include'],function(_0x342083){return{'model':db[_0x342083[_0xbe0f('0x29')]],'as':_0x342083['as'],'attributes':_0x342083['attributes'],'include':_0x342083[_0xbe0f('0x27')]?_['map'](_0x342083[_0xbe0f('0x27')],function(_0x3968fd){return{'model':db[_0x3968fd['model']],'as':_0x3968fd['as'],'attributes':_0x3968fd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5200cb){logger[_0xbe0f('0x1d')](_0xbe0f('0x2a'),_0x4c7b85);logger['debug'](_0xbe0f('0x2a'),_0x4c7b85,JSON[_0xbe0f('0x19')](_0x5200cb));_0x1e8ab6(_0x5200cb);})[_0xbe0f('0x1f')](function(_0x5dfa2f){logger[_0xbe0f('0x1a')](_0xbe0f('0x2a'),_0x5dfa2f[_0xbe0f('0x1c')],_0x4c7b85);_0x119966(_0x58d995[_0xbe0f('0x1a')](0x1f4,_0x5dfa2f[_0xbe0f('0x1c')]));});});};exports[_0xbe0f('0x2b')]=function(_0x129009){var _0x4e892c=this;return new Promise(function(_0xb4d5f3,_0x14138e){return db[_0xbe0f('0x20')]['find']({'raw':_0x129009[_0xbe0f('0x22')]?_0x129009['options'][_0xbe0f('0x23')]===undefined?!![]:![]:!![],'where':_0x129009[_0xbe0f('0x22')]?_0x129009['options'][_0xbe0f('0x24')]||null:null,'attributes':_0x129009[_0xbe0f('0x22')]?_0x129009[_0xbe0f('0x22')][_0xbe0f('0x25')]||null:null,'include':_0x129009['options']?_0x129009[_0xbe0f('0x22')][_0xbe0f('0x27')]?_['map'](_0x129009[_0xbe0f('0x22')][_0xbe0f('0x27')],function(_0x15a2dc){return{'model':db[_0x15a2dc[_0xbe0f('0x29')]],'as':_0x15a2dc['as'],'attributes':_0x15a2dc[_0xbe0f('0x25')],'include':_0x15a2dc['include']?_[_0xbe0f('0x28')](_0x15a2dc['include'],function(_0x556455){return{'model':db[_0x556455[_0xbe0f('0x29')]],'as':_0x556455['as'],'attributes':_0x556455[_0xbe0f('0x25')],'include':_0x556455[_0xbe0f('0x27')]?_[_0xbe0f('0x28')](_0x556455[_0xbe0f('0x27')],function(_0x105c2b){return{'model':db[_0x105c2b['model']],'as':_0x105c2b['as'],'attributes':_0x105c2b[_0xbe0f('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1af93b){logger['info'](_0xbe0f('0x2b'),_0x129009);logger[_0xbe0f('0x16')](_0xbe0f('0x2b'),_0x129009,JSON[_0xbe0f('0x19')](_0x1af93b));_0xb4d5f3(_0x1af93b);})[_0xbe0f('0x1f')](function(_0x35a052){logger[_0xbe0f('0x1a')](_0xbe0f('0x2b'),_0x35a052['message'],_0x129009);_0x14138e(_0x4e892c[_0xbe0f('0x1a')](0x1f4,_0x35a052['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 1e16b61..a1c44aa 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 _0x139d=['length','./openchannelQueue.events','save','remove','update','register'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x139d,0x1ed));var _0xd139=function(_0x499e56,_0xfa7df9){_0x499e56=_0x499e56-0x0;var _0x45861d=_0x139d[_0x499e56];return _0x45861d;};'use strict';var OpenchannelQueueEvents=require(_0xd139('0x0'));var events=[_0xd139('0x1'),_0xd139('0x2'),_0xd139('0x3')];function createListener(_0x326dd6,_0x36bd60){return function(_0x352964){_0x36bd60['emit'](_0x326dd6,_0x352964);};}function removeListener(_0x37a57e,_0x40b69c){return function(){OpenchannelQueueEvents['removeListener'](_0x37a57e,_0x40b69c);};}exports[_0xd139('0x4')]=function(_0x2dcc90){for(var _0x3e31db=0x0,_0x15cc67=events[_0xd139('0x5')];_0x3e31db<_0x15cc67;_0x3e31db++){var _0x1b4732=events[_0x3e31db];var _0x48eccc=createListener('openchannelQueue:'+_0x1b4732,_0x2dcc90);OpenchannelQueueEvents['on'](_0x1b4732,_0x48eccc);}}; \ No newline at end of file +var _0x5c66=['openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3c4472,_0x14cce8){var _0x384cb7=function(_0x38bd76){while(--_0x38bd76){_0x3c4472['push'](_0x3c4472['shift']());}};_0x384cb7(++_0x14cce8);}(_0x5c66,0x76));var _0x65c6=function(_0x21e30c,_0x58af94){_0x21e30c=_0x21e30c-0x0;var _0x551b84=_0x5c66[_0x21e30c];return _0x551b84;};'use strict';var OpenchannelQueueEvents=require(_0x65c6('0x0'));var events=[_0x65c6('0x1'),_0x65c6('0x2'),_0x65c6('0x3')];function createListener(_0x13bc5d,_0x3091e2){return function(_0x389d4d){_0x3091e2[_0x65c6('0x4')](_0x13bc5d,_0x389d4d);};}function removeListener(_0x1cf275,_0x3ab01d){return function(){OpenchannelQueueEvents[_0x65c6('0x5')](_0x1cf275,_0x3ab01d);};}exports[_0x65c6('0x6')]=function(_0x167992){for(var _0x5e39cc=0x0,_0x5109c5=events[_0x65c6('0x7')];_0x5e39cc<_0x5109c5;_0x5e39cc++){var _0x4c70f9=events[_0x5e39cc];var _0x28fc40=createListener(_0x65c6('0x8')+_0x4c70f9,_0x167992);OpenchannelQueueEvents['on'](_0x4c70f9,_0x28fc40);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index de558e1..52a077a 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 _0x6cf2=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','destroy','exports','multer','path'];(function(_0x10a68c,_0x576de9){var _0x28fa99=function(_0x38af15){while(--_0x38af15){_0x10a68c['push'](_0x10a68c['shift']());}};_0x28fa99(++_0x576de9);}(_0x6cf2,0x70));var _0x26cf=function(_0x41aac9,_0x211766){_0x41aac9=_0x41aac9-0x0;var _0x24f0c4=_0x6cf2[_0x41aac9];return _0x24f0c4;};'use strict';var multer=require(_0x26cf('0x0'));var util=require('util');var path=require(_0x26cf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x26cf('0x2')]();var fs_extra=require(_0x26cf('0x3'));var auth=require(_0x26cf('0x4'));var interaction=require(_0x26cf('0x5'));var config=require(_0x26cf('0x6'));var controller=require(_0x26cf('0x7'));router[_0x26cf('0x8')]('/',auth[_0x26cf('0x9')](),controller['index']);router[_0x26cf('0x8')](_0x26cf('0xa'),auth[_0x26cf('0x9')](),controller[_0x26cf('0xb')]);router['get'](_0x26cf('0xc'),auth[_0x26cf('0x9')](),controller[_0x26cf('0xd')]);router[_0x26cf('0xe')]('/',auth[_0x26cf('0x9')](),controller[_0x26cf('0xf')]);router[_0x26cf('0x10')](_0x26cf('0xc'),auth[_0x26cf('0x9')](),controller['update']);router['delete'](_0x26cf('0xc'),auth[_0x26cf('0x9')](),controller[_0x26cf('0x11')]);module[_0x26cf('0x12')]=router; \ No newline at end of file +var _0x0bb8=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','show','post','create','/:id','delete','exports','multer','path','express','fs-extra'];(function(_0x438eaf,_0x463d0b){var _0x3382a2=function(_0x1c8b17){while(--_0x1c8b17){_0x438eaf['push'](_0x438eaf['shift']());}};_0x3382a2(++_0x463d0b);}(_0x0bb8,0x1a5));var _0x80bb=function(_0x5a4d0d,_0x819bc8){_0x5a4d0d=_0x5a4d0d-0x0;var _0x66f5ea=_0x0bb8[_0x5a4d0d];return _0x66f5ea;};'use strict';var multer=require(_0x80bb('0x0'));var util=require('util');var path=require(_0x80bb('0x1'));var timeout=require('connect-timeout');var express=require(_0x80bb('0x2'));var router=express['Router']();var fs_extra=require(_0x80bb('0x3'));var auth=require(_0x80bb('0x4'));var interaction=require(_0x80bb('0x5'));var config=require(_0x80bb('0x6'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x80bb('0x7')]);router[_0x80bb('0x8')]('/describe',auth[_0x80bb('0x9')](),controller[_0x80bb('0xa')]);router['get']('/:id',auth[_0x80bb('0x9')](),controller[_0x80bb('0xb')]);router[_0x80bb('0xc')]('/',auth[_0x80bb('0x9')](),controller[_0x80bb('0xd')]);router['put'](_0x80bb('0xe'),auth[_0x80bb('0x9')](),controller['update']);router[_0x80bb('0xf')]('/:id',auth[_0x80bb('0x9')](),controller['destroy']);module[_0x80bb('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 5289ceb..e857c3a 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 _0xb3f0=['STRING','DATE','sequelize','exports'];(function(_0x341b4d,_0x491277){var _0x462d23=function(_0x520672){while(--_0x520672){_0x341b4d['push'](_0x341b4d['shift']());}};_0x462d23(++_0x491277);}(_0xb3f0,0x96));var _0x0b3f=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xb3f0[_0x30ae5e];return _0x1f2e93;};'use strict';var moment=require('moment');var Sequelize=require(_0x0b3f('0x0'));module[_0x0b3f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0b3f('0x2')]},'joinAt':{'type':Sequelize[_0x0b3f('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x0b3f('0x3')]},'exitAt':{'type':Sequelize[_0x0b3f('0x3')]},'reason':{'type':Sequelize[_0x0b3f('0x2')]}}; \ No newline at end of file +var _0x9ee5=['DATE','moment','sequelize','exports','STRING'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x9ee5,0x123));var _0x59ee=function(_0x53dab5,_0x4682ae){_0x53dab5=_0x53dab5-0x0;var _0x3a285d=_0x9ee5[_0x53dab5];return _0x3a285d;};'use strict';var moment=require(_0x59ee('0x0'));var Sequelize=require(_0x59ee('0x1'));module[_0x59ee('0x2')]={'uniqueid':{'type':Sequelize[_0x59ee('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x59ee('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x59ee('0x4')]},'reason':{'type':Sequelize[_0x59ee('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index e1cbcd1..ad9bc61 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 _0xe085=['options','include','OpenchannelQueueReport','findAll','rows','catch','show','keys','includeAll','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xe085,0x199));var _0x5e08=function(_0x5cccd5,_0x2c33d2){_0x5cccd5=_0x5cccd5-0x0;var _0x24874d=_0xe085[_0x5cccd5];return _0x24874d;};'use strict';var emlformat=require(_0x5e08('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e08('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e08('0x2'));var moment=require(_0x5e08('0x3'));var BPromise=require(_0x5e08('0x4'));var Mustache=require(_0x5e08('0x5'));var util=require('util');var path=require(_0x5e08('0x6'));var sox=require(_0x5e08('0x7'));var csv=require(_0x5e08('0x8'));var ejs=require(_0x5e08('0x9'));var fs=require('fs');var fs_extra=require(_0x5e08('0xa'));var _=require(_0x5e08('0xb'));var squel=require(_0x5e08('0xc'));var crypto=require(_0x5e08('0xd'));var jsforce=require(_0x5e08('0xe'));var deskjs=require(_0x5e08('0xf'));var toCsv=require(_0x5e08('0x8'));var querystring=require(_0x5e08('0x10'));var Papa=require(_0x5e08('0x11'));var Redis=require(_0x5e08('0x12'));var authService=require(_0x5e08('0x13'));var qs=require(_0x5e08('0x14'));var as=require(_0x5e08('0x15'));var hardwareService=require(_0x5e08('0x16'));var logger=require(_0x5e08('0x17'))(_0x5e08('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5e08('0x19'));var db=require(_0x5e08('0x1a'))['db'];function respondWithStatusCode(_0x6824a1,_0x45220e){_0x45220e=_0x45220e||0xcc;return function(_0x367b9b){if(_0x367b9b){return _0x6824a1[_0x5e08('0x1b')](_0x45220e);}return _0x6824a1['status'](_0x45220e)[_0x5e08('0x1c')]();};}function respondWithResult(_0x39568e,_0x5070d6){_0x5070d6=_0x5070d6||0xc8;return function(_0x9b58f0){if(_0x9b58f0){return _0x39568e[_0x5e08('0x1d')](_0x5070d6)[_0x5e08('0x1e')](_0x9b58f0);}};}function respondWithFilteredResult(_0x2c70fa,_0x4cf7a3){return function(_0x4e4261){if(_0x4e4261){var _0x3612a8=typeof _0x4cf7a3[_0x5e08('0x1f')]===_0x5e08('0x20')&&typeof _0x4cf7a3[_0x5e08('0x21')]===_0x5e08('0x20');var _0x13d83f=_0x4e4261[_0x5e08('0x22')];var _0x32fa78=_0x3612a8?0x0:_0x4cf7a3[_0x5e08('0x1f')];var _0x38ff72=_0x3612a8?_0x4e4261[_0x5e08('0x22')]:_0x4cf7a3[_0x5e08('0x1f')]+_0x4cf7a3[_0x5e08('0x21')];var _0x1048b2;if(_0x38ff72>=_0x13d83f){_0x38ff72=_0x13d83f;_0x1048b2=0xc8;}else{_0x1048b2=0xce;}_0x2c70fa[_0x5e08('0x1d')](_0x1048b2);return _0x2c70fa['set'](_0x5e08('0x23'),_0x32fa78+'-'+_0x38ff72+'/'+_0x13d83f)[_0x5e08('0x1e')](_0x4e4261);}return null;};}function patchUpdates(_0x34951d){return function(_0x19903e){try{jsonpatch[_0x5e08('0x24')](_0x19903e,_0x34951d,!![]);}catch(_0x5877c5){return BPromise[_0x5e08('0x25')](_0x5877c5);}return _0x19903e[_0x5e08('0x26')]();};}function saveUpdates(_0x26e207,_0x1d833a){return function(_0x2891dc){if(_0x2891dc){return _0x2891dc[_0x5e08('0x27')](_0x26e207)['then'](function(_0x3d69b9){return _0x3d69b9;});}return null;};}function removeEntity(_0x4ad624,_0xb350c4){return function(_0x39628e){if(_0x39628e){return _0x39628e[_0x5e08('0x28')]()[_0x5e08('0x29')](function(){_0x4ad624[_0x5e08('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58ebd5,_0x3dd96d){return function(_0x4a5302){if(!_0x4a5302){_0x58ebd5[_0x5e08('0x1b')](0x194);}return _0x4a5302;};}function handleError(_0xf8acc1,_0x1e49ca){_0x1e49ca=_0x1e49ca||0x1f4;return function(_0x30fe63){logger[_0x5e08('0x2a')](_0x30fe63[_0x5e08('0x2b')]);if(_0x30fe63[_0x5e08('0x2c')]){delete _0x30fe63[_0x5e08('0x2c')];}_0xf8acc1[_0x5e08('0x1d')](_0x1e49ca)[_0x5e08('0x2d')](_0x30fe63);};}exports[_0x5e08('0x2e')]=function(_0x492130,_0x1eecb0){var _0x467efc={},_0x3a386d={},_0x1416c6={'count':0x0,'rows':[]};var _0x5b16e4=_['map'](db['OpenchannelQueueReport'][_0x5e08('0x2f')],function(_0x74684d){return{'name':_0x74684d['fieldName'],'type':_0x74684d[_0x5e08('0x30')][_0x5e08('0x31')]};});_0x3a386d[_0x5e08('0x32')]=_[_0x5e08('0x33')](_0x5b16e4,_0x5e08('0x2c'));_0x3a386d[_0x5e08('0x34')]=_['keys'](_0x492130[_0x5e08('0x34')]);_0x3a386d[_0x5e08('0x35')]=_['intersection'](_0x3a386d[_0x5e08('0x32')],_0x3a386d[_0x5e08('0x34')]);_0x467efc['attributes']=_[_0x5e08('0x36')](_0x3a386d[_0x5e08('0x32')],qs['fields'](_0x492130[_0x5e08('0x34')][_0x5e08('0x37')]));_0x467efc['attributes']=_0x467efc['attributes'][_0x5e08('0x38')]?_0x467efc[_0x5e08('0x39')]:_0x3a386d[_0x5e08('0x32')];if(!_0x492130[_0x5e08('0x34')]['hasOwnProperty'](_0x5e08('0x3a'))){_0x467efc[_0x5e08('0x21')]=qs['limit'](_0x492130['query'][_0x5e08('0x21')]);_0x467efc['offset']=qs[_0x5e08('0x1f')](_0x492130[_0x5e08('0x34')][_0x5e08('0x1f')]);}_0x467efc[_0x5e08('0x3b')]=qs[_0x5e08('0x3c')](_0x492130[_0x5e08('0x34')]['sort']);_0x467efc[_0x5e08('0x3d')]=qs[_0x5e08('0x35')](_[_0x5e08('0x3e')](_0x492130[_0x5e08('0x34')],_0x3a386d[_0x5e08('0x35')]),_0x5b16e4);if(_0x492130['query'][_0x5e08('0x3f')]){_0x467efc[_0x5e08('0x3d')]=_[_0x5e08('0x40')](_0x467efc[_0x5e08('0x3d')],{'$or':_[_0x5e08('0x33')](_0x5b16e4,function(_0x1f2943){if(_0x1f2943[_0x5e08('0x30')]!=='VIRTUAL'){var _0x15a96c={};_0x15a96c[_0x1f2943[_0x5e08('0x2c')]]={'$like':'%'+_0x492130[_0x5e08('0x34')]['filter']+'%'};return _0x15a96c;}})});}_0x467efc=_[_0x5e08('0x40')]({},_0x467efc,_0x492130[_0x5e08('0x41')]);var _0x299b86={'where':_0x467efc[_0x5e08('0x3d')]};return db['OpenchannelQueueReport'][_0x5e08('0x22')](_0x299b86)['then'](function(_0x1d6a4b){_0x1416c6['count']=_0x1d6a4b;if(_0x492130[_0x5e08('0x34')]['includeAll']){_0x467efc[_0x5e08('0x42')]=[{'all':!![]}];}return db[_0x5e08('0x43')][_0x5e08('0x44')](_0x467efc);})[_0x5e08('0x29')](function(_0x32dea3){_0x1416c6[_0x5e08('0x45')]=_0x32dea3;return _0x1416c6;})['then'](respondWithFilteredResult(_0x1eecb0,_0x467efc))[_0x5e08('0x46')](handleError(_0x1eecb0,null));};exports[_0x5e08('0x47')]=function(_0x3fa7af,_0x4a8e96){var _0x484d80={'raw':!![],'where':{'id':_0x3fa7af['params']['id']}},_0x44cf79={};_0x44cf79['model']=_[_0x5e08('0x48')](db[_0x5e08('0x43')]['rawAttributes']);_0x44cf79[_0x5e08('0x34')]=_[_0x5e08('0x48')](_0x3fa7af[_0x5e08('0x34')]);_0x44cf79['filters']=_[_0x5e08('0x36')](_0x44cf79[_0x5e08('0x32')],_0x44cf79[_0x5e08('0x34')]);_0x484d80[_0x5e08('0x39')]=_[_0x5e08('0x36')](_0x44cf79['model'],qs[_0x5e08('0x37')](_0x3fa7af[_0x5e08('0x34')][_0x5e08('0x37')]));_0x484d80[_0x5e08('0x39')]=_0x484d80[_0x5e08('0x39')][_0x5e08('0x38')]?_0x484d80[_0x5e08('0x39')]:_0x44cf79[_0x5e08('0x32')];if(_0x3fa7af[_0x5e08('0x34')][_0x5e08('0x49')]){_0x484d80['include']=[{'all':!![]}];}_0x484d80=_[_0x5e08('0x40')]({},_0x484d80,_0x3fa7af[_0x5e08('0x41')]);return db[_0x5e08('0x43')][_0x5e08('0x4a')](_0x484d80)[_0x5e08('0x29')](handleEntityNotFound(_0x4a8e96,null))[_0x5e08('0x29')](respondWithResult(_0x4a8e96,null))[_0x5e08('0x46')](handleError(_0x4a8e96,null));};exports[_0x5e08('0x4b')]=function(_0x37c465,_0x35bdd0){return db[_0x5e08('0x43')][_0x5e08('0x4b')](_0x37c465['body'],{})['then'](respondWithResult(_0x35bdd0,0xc9))[_0x5e08('0x46')](handleError(_0x35bdd0,null));};exports[_0x5e08('0x27')]=function(_0x341ce9,_0x5a3964){if(_0x341ce9[_0x5e08('0x4c')]['id']){delete _0x341ce9[_0x5e08('0x4c')]['id'];}return db[_0x5e08('0x43')][_0x5e08('0x4a')]({'where':{'id':_0x341ce9[_0x5e08('0x4d')]['id']}})[_0x5e08('0x29')](handleEntityNotFound(_0x5a3964,null))['then'](saveUpdates(_0x341ce9['body'],null))['then'](respondWithResult(_0x5a3964,null))[_0x5e08('0x46')](handleError(_0x5a3964,null));};exports[_0x5e08('0x28')]=function(_0x25bcc6,_0x24b2cc){return db['OpenchannelQueueReport'][_0x5e08('0x4a')]({'where':{'id':_0x25bcc6['params']['id']}})[_0x5e08('0x29')](handleEntityNotFound(_0x24b2cc,null))[_0x5e08('0x29')](removeEntity(_0x24b2cc,null))[_0x5e08('0x46')](handleError(_0x24b2cc,null));};exports[_0x5e08('0x4e')]=function(_0xdc8b1b,_0x4ab788){return db[_0x5e08('0x43')][_0x5e08('0x4e')]()[_0x5e08('0x29')](respondWithResult(_0x4ab788,null))['catch'](handleError(_0x4ab788,null));}; \ No newline at end of file +var _0x2534=['fs-extra','lodash','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','OpenchannelQueueReport','fieldName','type','key','model','map','query','keys','filters','intersection','fields','length','attributes','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv'];(function(_0x188a5f,_0x2d890f){var _0x5f7f13=function(_0x3aedfa){while(--_0x3aedfa){_0x188a5f['push'](_0x188a5f['shift']());}};_0x5f7f13(++_0x2d890f);}(_0x2534,0x194));var _0x4253=function(_0x3c4a8e,_0x2255d6){_0x3c4a8e=_0x3c4a8e-0x0;var _0x22ea98=_0x2534[_0x3c4a8e];return _0x22ea98;};'use strict';var emlformat=require(_0x4253('0x0'));var rimraf=require(_0x4253('0x1'));var zipdir=require(_0x4253('0x2'));var jsonpatch=require(_0x4253('0x3'));var rp=require(_0x4253('0x4'));var moment=require(_0x4253('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4253('0x6'));var path=require(_0x4253('0x7'));var sox=require(_0x4253('0x8'));var csv=require(_0x4253('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4253('0xa'));var _=require(_0x4253('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4253('0xc'));var toCsv=require(_0x4253('0x9'));var querystring=require('querystring');var Papa=require(_0x4253('0xd'));var Redis=require(_0x4253('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4253('0xf'));var as=require(_0x4253('0x10'));var hardwareService=require(_0x4253('0x11'));var logger=require('../../config/logger')(_0x4253('0x12'));var utils=require(_0x4253('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4253('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2aad15,_0x1935fa){_0x1935fa=_0x1935fa||0xcc;return function(_0x26fd4d){if(_0x26fd4d){return _0x2aad15['sendStatus'](_0x1935fa);}return _0x2aad15[_0x4253('0x15')](_0x1935fa)['end']();};}function respondWithResult(_0x397b70,_0x387a5b){_0x387a5b=_0x387a5b||0xc8;return function(_0x3a23af){if(_0x3a23af){return _0x397b70[_0x4253('0x15')](_0x387a5b)[_0x4253('0x16')](_0x3a23af);}};}function respondWithFilteredResult(_0x1089d7,_0x50e96b){return function(_0x1434ae){if(_0x1434ae){var _0x803c54=typeof _0x50e96b[_0x4253('0x17')]===_0x4253('0x18')&&typeof _0x50e96b[_0x4253('0x19')]===_0x4253('0x18');var _0x3f7cef=_0x1434ae[_0x4253('0x1a')];var _0x307663=_0x803c54?0x0:_0x50e96b[_0x4253('0x17')];var _0x3d6cbc=_0x803c54?_0x1434ae[_0x4253('0x1a')]:_0x50e96b[_0x4253('0x17')]+_0x50e96b[_0x4253('0x19')];var _0x5b2cd9;if(_0x3d6cbc>=_0x3f7cef){_0x3d6cbc=_0x3f7cef;_0x5b2cd9=0xc8;}else{_0x5b2cd9=0xce;}_0x1089d7[_0x4253('0x15')](_0x5b2cd9);return _0x1089d7[_0x4253('0x1b')]('Content-Range',_0x307663+'-'+_0x3d6cbc+'/'+_0x3f7cef)[_0x4253('0x16')](_0x1434ae);}return null;};}function patchUpdates(_0x3c16fb){return function(_0x6a30a5){try{jsonpatch[_0x4253('0x1c')](_0x6a30a5,_0x3c16fb,!![]);}catch(_0x4cb2c5){return BPromise[_0x4253('0x1d')](_0x4cb2c5);}return _0x6a30a5[_0x4253('0x1e')]();};}function saveUpdates(_0x2c480f,_0x3152a3){return function(_0x4612df){if(_0x4612df){return _0x4612df[_0x4253('0x1f')](_0x2c480f)[_0x4253('0x20')](function(_0x8434b4){return _0x8434b4;});}return null;};}function removeEntity(_0x4f33e1,_0x3dc8b8){return function(_0x437f47){if(_0x437f47){return _0x437f47[_0x4253('0x21')]()[_0x4253('0x20')](function(){_0x4f33e1[_0x4253('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c089c,_0x346d34){return function(_0xda0729){if(!_0xda0729){_0x5c089c[_0x4253('0x22')](0x194);}return _0xda0729;};}function handleError(_0x116211,_0x44e0aa){_0x44e0aa=_0x44e0aa||0x1f4;return function(_0x225048){logger[_0x4253('0x23')](_0x225048['stack']);if(_0x225048[_0x4253('0x24')]){delete _0x225048[_0x4253('0x24')];}_0x116211[_0x4253('0x15')](_0x44e0aa)[_0x4253('0x25')](_0x225048);};}exports[_0x4253('0x26')]=function(_0x36fde1,_0x47cff4){var _0x3269af={},_0x4371c5={},_0x2e8d57={'count':0x0,'rows':[]};var _0xd3cb10=_['map'](db[_0x4253('0x27')]['rawAttributes'],function(_0x4ddd15){return{'name':_0x4ddd15[_0x4253('0x28')],'type':_0x4ddd15[_0x4253('0x29')][_0x4253('0x2a')]};});_0x4371c5[_0x4253('0x2b')]=_[_0x4253('0x2c')](_0xd3cb10,'name');_0x4371c5[_0x4253('0x2d')]=_[_0x4253('0x2e')](_0x36fde1['query']);_0x4371c5[_0x4253('0x2f')]=_[_0x4253('0x30')](_0x4371c5[_0x4253('0x2b')],_0x4371c5['query']);_0x3269af['attributes']=_['intersection'](_0x4371c5[_0x4253('0x2b')],qs[_0x4253('0x31')](_0x36fde1[_0x4253('0x2d')]['fields']));_0x3269af['attributes']=_0x3269af['attributes'][_0x4253('0x32')]?_0x3269af[_0x4253('0x33')]:_0x4371c5['model'];if(!_0x36fde1[_0x4253('0x2d')]['hasOwnProperty']('nolimit')){_0x3269af['limit']=qs[_0x4253('0x19')](_0x36fde1['query'][_0x4253('0x19')]);_0x3269af['offset']=qs[_0x4253('0x17')](_0x36fde1['query'][_0x4253('0x17')]);}_0x3269af['order']=qs['sort'](_0x36fde1[_0x4253('0x2d')]['sort']);_0x3269af[_0x4253('0x34')]=qs['filters'](_['pick'](_0x36fde1[_0x4253('0x2d')],_0x4371c5[_0x4253('0x2f')]),_0xd3cb10);if(_0x36fde1['query'][_0x4253('0x35')]){_0x3269af[_0x4253('0x34')]=_['merge'](_0x3269af[_0x4253('0x34')],{'$or':_['map'](_0xd3cb10,function(_0x2b8865){if(_0x2b8865['type']!==_0x4253('0x36')){var _0x3fe966={};_0x3fe966[_0x2b8865[_0x4253('0x24')]]={'$like':'%'+_0x36fde1[_0x4253('0x2d')]['filter']+'%'};return _0x3fe966;}})});}_0x3269af=_['merge']({},_0x3269af,_0x36fde1[_0x4253('0x37')]);var _0x1d8158={'where':_0x3269af['where']};return db[_0x4253('0x27')]['count'](_0x1d8158)[_0x4253('0x20')](function(_0x50bdbb){_0x2e8d57[_0x4253('0x1a')]=_0x50bdbb;if(_0x36fde1[_0x4253('0x2d')][_0x4253('0x38')]){_0x3269af[_0x4253('0x39')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x4253('0x3a')](_0x3269af);})[_0x4253('0x20')](function(_0x43f32d){_0x2e8d57[_0x4253('0x3b')]=_0x43f32d;return _0x2e8d57;})['then'](respondWithFilteredResult(_0x47cff4,_0x3269af))[_0x4253('0x3c')](handleError(_0x47cff4,null));};exports[_0x4253('0x3d')]=function(_0x4c18e8,_0xad1ae1){var _0x21b393={'raw':!![],'where':{'id':_0x4c18e8[_0x4253('0x3e')]['id']}},_0x50db79={};_0x50db79[_0x4253('0x2b')]=_[_0x4253('0x2e')](db[_0x4253('0x27')][_0x4253('0x3f')]);_0x50db79['query']=_[_0x4253('0x2e')](_0x4c18e8[_0x4253('0x2d')]);_0x50db79[_0x4253('0x2f')]=_['intersection'](_0x50db79['model'],_0x50db79[_0x4253('0x2d')]);_0x21b393[_0x4253('0x33')]=_['intersection'](_0x50db79[_0x4253('0x2b')],qs['fields'](_0x4c18e8[_0x4253('0x2d')][_0x4253('0x31')]));_0x21b393['attributes']=_0x21b393[_0x4253('0x33')][_0x4253('0x32')]?_0x21b393[_0x4253('0x33')]:_0x50db79[_0x4253('0x2b')];if(_0x4c18e8[_0x4253('0x2d')]['includeAll']){_0x21b393[_0x4253('0x39')]=[{'all':!![]}];}_0x21b393=_[_0x4253('0x40')]({},_0x21b393,_0x4c18e8[_0x4253('0x37')]);return db[_0x4253('0x27')][_0x4253('0x41')](_0x21b393)[_0x4253('0x20')](handleEntityNotFound(_0xad1ae1,null))[_0x4253('0x20')](respondWithResult(_0xad1ae1,null))[_0x4253('0x3c')](handleError(_0xad1ae1,null));};exports[_0x4253('0x42')]=function(_0x322247,_0x283918){return db['OpenchannelQueueReport'][_0x4253('0x42')](_0x322247['body'],{})[_0x4253('0x20')](respondWithResult(_0x283918,0xc9))[_0x4253('0x3c')](handleError(_0x283918,null));};exports['update']=function(_0x1183c8,_0x28aa04){if(_0x1183c8[_0x4253('0x43')]['id']){delete _0x1183c8[_0x4253('0x43')]['id'];}return db[_0x4253('0x27')][_0x4253('0x41')]({'where':{'id':_0x1183c8['params']['id']}})[_0x4253('0x20')](handleEntityNotFound(_0x28aa04,null))[_0x4253('0x20')](saveUpdates(_0x1183c8[_0x4253('0x43')],null))['then'](respondWithResult(_0x28aa04,null))['catch'](handleError(_0x28aa04,null));};exports[_0x4253('0x21')]=function(_0x44ca5c,_0x283333){return db[_0x4253('0x27')][_0x4253('0x41')]({'where':{'id':_0x44ca5c[_0x4253('0x3e')]['id']}})[_0x4253('0x20')](handleEntityNotFound(_0x283333,null))[_0x4253('0x20')](removeEntity(_0x283333,null))[_0x4253('0x3c')](handleError(_0x283333,null));};exports[_0x4253('0x44')]=function(_0x62969e,_0x1da0be){return db['OpenchannelQueueReport'][_0x4253('0x44')]()[_0x4253('0x20')](respondWithResult(_0x1da0be,null))[_0x4253('0x3c')](handleError(_0x1da0be,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 6630d51..c259a7b 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x34461e,_0x321312){var _0x47d570=function(_0x2174f1){while(--_0x2174f1){_0x34461e['push'](_0x34461e['shift']());}};_0x47d570(++_0x321312);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3725ee,_0x543bd9){_0x3725ee=_0x3725ee-0x0;var _0x399c71=_0x5fc3[_0x3725ee];return _0x399c71;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x1a33fe,_0x2e5011){var _0x4f35f7=function(_0x32af10){while(--_0x32af10){_0x1a33fe['push'](_0x1a33fe['shift']());}};_0x4f35f7(++_0x2e5011);}(_0x326f,0xd1));var _0xf326=function(_0x123c3c,_0x3d8711){_0x123c3c=_0x123c3c-0x0;var _0x4b6c04=_0x326f[_0x123c3c];return _0x4b6c04;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index d8401da..a14d19a 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 _0xd4a2=['CreateOpenchannelQueueReport','create','body','options','raw','stringify','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','where','attributes','lodash','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x361078,_0x283dcb){var _0x22d9e8=function(_0x140b4b){while(--_0x140b4b){_0x361078['push'](_0x361078['shift']());}};_0x22d9e8(++_0x283dcb);}(_0xd4a2,0x173));var _0x2d4a=function(_0x29c5aa,_0x2b358c){_0x29c5aa=_0x29c5aa-0x0;var _0x53533d=_0xd4a2[_0x29c5aa];return _0x53533d;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2d4a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d4a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d4a('0x3'));var logger=require('../../config/logger')(_0x2d4a('0x4'));var config=require(_0x2d4a('0x5'));var jayson=require(_0x2d4a('0x6'));var client=jayson[_0x2d4a('0x7')][_0x2d4a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57058f,_0x45fefb,_0x41b161){return new BPromise(function(_0x1f237e,_0x29597e){return client[_0x2d4a('0x9')](_0x57058f,_0x41b161)[_0x2d4a('0xa')](function(_0xb9f016){logger[_0x2d4a('0xb')](_0x2d4a('0xc'),_0x45fefb,_0x2d4a('0xd'));logger[_0x2d4a('0xe')](_0x2d4a('0xf'),_0x45fefb,'request\x20sent',JSON['stringify'](_0xb9f016));if(_0xb9f016[_0x2d4a('0x10')]){if(_0xb9f016['error'][_0x2d4a('0x11')]===0x1f4){logger[_0x2d4a('0x10')](_0x2d4a('0xc'),_0x45fefb,_0xb9f016[_0x2d4a('0x10')][_0x2d4a('0x12')]);return _0x29597e(_0xb9f016[_0x2d4a('0x10')][_0x2d4a('0x12')]);}logger[_0x2d4a('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x45fefb,_0xb9f016['error'][_0x2d4a('0x12')]);return _0x1f237e(_0xb9f016['error'][_0x2d4a('0x12')]);}else{logger[_0x2d4a('0xb')](_0x2d4a('0xc'),_0x45fefb,_0x2d4a('0xd'));_0x1f237e(_0xb9f016['result'][_0x2d4a('0x12')]);}})['catch'](function(_0x2838fa){logger['error'](_0x2d4a('0xc'),_0x45fefb,_0x2838fa);_0x29597e(_0x2838fa);});});}exports[_0x2d4a('0x13')]=function(_0x2188b2){var _0x388371=this;return new Promise(function(_0x498956,_0x4fd169){return db['OpenchannelQueueReport'][_0x2d4a('0x14')](_0x2188b2[_0x2d4a('0x15')],{'raw':_0x2188b2[_0x2d4a('0x16')]?_0x2188b2[_0x2d4a('0x16')][_0x2d4a('0x17')]===undefined?!![]:![]:!![]})[_0x2d4a('0xa')](function(_0x56445a){logger['info'](_0x2d4a('0x13'),_0x2188b2);logger[_0x2d4a('0xe')](_0x2d4a('0x13'),_0x2188b2,JSON[_0x2d4a('0x18')](_0x56445a));_0x498956(_0x56445a);})[_0x2d4a('0x19')](function(_0x2e7736){logger[_0x2d4a('0x10')](_0x2d4a('0x13'),_0x2e7736['message'],_0x2188b2);_0x4fd169(_0x388371[_0x2d4a('0x10')](0x1f4,_0x2e7736[_0x2d4a('0x12')]));});});};exports[_0x2d4a('0x1a')]=function(_0x42d813){var _0x2c845c=this;return new Promise(function(_0xed2822,_0x456d38){return db[_0x2d4a('0x1b')]['update'](_0x42d813['body'],{'raw':_0x42d813['options']?_0x42d813[_0x2d4a('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42d813[_0x2d4a('0x16')]?_0x42d813[_0x2d4a('0x16')][_0x2d4a('0x1c')]||null:null,'attributes':_0x42d813[_0x2d4a('0x16')]?_0x42d813[_0x2d4a('0x16')][_0x2d4a('0x1d')]||null:null,'limit':_0x42d813[_0x2d4a('0x16')]?_0x42d813[_0x2d4a('0x16')]['limit']||null:null})[_0x2d4a('0xa')](function(_0x5ce262){logger[_0x2d4a('0xb')](_0x2d4a('0x1a'),_0x42d813);logger[_0x2d4a('0xe')](_0x2d4a('0x1a'),_0x42d813,JSON[_0x2d4a('0x18')](_0x5ce262));_0xed2822(_0x5ce262);})[_0x2d4a('0x19')](function(_0x25ac5c){logger[_0x2d4a('0x10')]('UpdateOpenchannelQueueReport',_0x25ac5c[_0x2d4a('0x12')],_0x42d813);_0x456d38(_0x2c845c[_0x2d4a('0x10')](0x1f4,_0x25ac5c[_0x2d4a('0x12')]));});});}; \ No newline at end of file +var _0xe493=['where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelQueueReport','create','options','raw','OpenchannelQueueReport','update','body'];(function(_0x235e2e,_0x8399b6){var _0x193589=function(_0x57c4a4){while(--_0x57c4a4){_0x235e2e['push'](_0x235e2e['shift']());}};_0x193589(++_0x8399b6);}(_0xe493,0x7e));var _0x3e49=function(_0x5ebdd2,_0x30c578){_0x5ebdd2=_0x5ebdd2-0x0;var _0x2668f9=_0xe493[_0x5ebdd2];return _0x2668f9;};'use strict';var _=require(_0x3e49('0x0'));var util=require(_0x3e49('0x1'));var moment=require(_0x3e49('0x2'));var BPromise=require(_0x3e49('0x3'));var rs=require(_0x3e49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e49('0x5'))['db'];var utils=require(_0x3e49('0x6'));var logger=require('../../config/logger')(_0x3e49('0x7'));var config=require('../../config/environment');var jayson=require(_0x3e49('0x8'));var client=jayson[_0x3e49('0x9')][_0x3e49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f7821,_0x12dd84,_0x3626b6){return new BPromise(function(_0x4e96ac,_0x56b767){return client['request'](_0x3f7821,_0x3626b6)[_0x3e49('0xb')](function(_0x8b8c0e){logger[_0x3e49('0xc')](_0x3e49('0xd'),_0x12dd84,_0x3e49('0xe'));logger[_0x3e49('0xf')](_0x3e49('0x10'),_0x12dd84,_0x3e49('0xe'),JSON[_0x3e49('0x11')](_0x8b8c0e));if(_0x8b8c0e[_0x3e49('0x12')]){if(_0x8b8c0e[_0x3e49('0x12')]['code']===0x1f4){logger[_0x3e49('0x12')](_0x3e49('0xd'),_0x12dd84,_0x8b8c0e['error'][_0x3e49('0x13')]);return _0x56b767(_0x8b8c0e[_0x3e49('0x12')]['message']);}logger[_0x3e49('0x12')](_0x3e49('0xd'),_0x12dd84,_0x8b8c0e['error'][_0x3e49('0x13')]);return _0x4e96ac(_0x8b8c0e[_0x3e49('0x12')][_0x3e49('0x13')]);}else{logger[_0x3e49('0xc')](_0x3e49('0xd'),_0x12dd84,_0x3e49('0xe'));_0x4e96ac(_0x8b8c0e[_0x3e49('0x14')][_0x3e49('0x13')]);}})[_0x3e49('0x15')](function(_0x1d9cce){logger[_0x3e49('0x12')](_0x3e49('0xd'),_0x12dd84,_0x1d9cce);_0x56b767(_0x1d9cce);});});}exports[_0x3e49('0x16')]=function(_0x3ae5f4){var _0x448c36=this;return new Promise(function(_0x4e1cdf,_0xf33205){return db['OpenchannelQueueReport'][_0x3e49('0x17')](_0x3ae5f4['body'],{'raw':_0x3ae5f4[_0x3e49('0x18')]?_0x3ae5f4['options'][_0x3e49('0x19')]===undefined?!![]:![]:!![]})[_0x3e49('0xb')](function(_0x420d7b){logger['info'](_0x3e49('0x16'),_0x3ae5f4);logger['debug'](_0x3e49('0x16'),_0x3ae5f4,JSON[_0x3e49('0x11')](_0x420d7b));_0x4e1cdf(_0x420d7b);})[_0x3e49('0x15')](function(_0x5e0f1d){logger['error'](_0x3e49('0x16'),_0x5e0f1d['message'],_0x3ae5f4);_0xf33205(_0x448c36[_0x3e49('0x12')](0x1f4,_0x5e0f1d[_0x3e49('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x5b85df){var _0xdfb7b7=this;return new Promise(function(_0x57706b,_0x285237){return db[_0x3e49('0x1a')][_0x3e49('0x1b')](_0x5b85df[_0x3e49('0x1c')],{'raw':_0x5b85df['options']?_0x5b85df[_0x3e49('0x18')][_0x3e49('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b85df[_0x3e49('0x18')]?_0x5b85df[_0x3e49('0x18')][_0x3e49('0x1d')]||null:null,'attributes':_0x5b85df[_0x3e49('0x18')]?_0x5b85df[_0x3e49('0x18')][_0x3e49('0x1e')]||null:null,'limit':_0x5b85df[_0x3e49('0x18')]?_0x5b85df['options']['limit']||null:null})['then'](function(_0x1d6680){logger[_0x3e49('0xc')]('UpdateOpenchannelQueueReport',_0x5b85df);logger[_0x3e49('0xf')]('UpdateOpenchannelQueueReport',_0x5b85df,JSON[_0x3e49('0x11')](_0x1d6680));_0x57706b(_0x1d6680);})[_0x3e49('0x15')](function(_0x1f635a){logger[_0x3e49('0x12')]('UpdateOpenchannelQueueReport',_0x1f635a[_0x3e49('0x13')],_0x5b85df);_0x285237(_0xdfb7b7['error'](0x1f4,_0x1f635a['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 16138e0..4f8183c 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 _0xcf43=['../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xcf43,0x169));var _0x3cf4=function(_0x393563,_0x512cd6){_0x393563=_0x393563-0x0;var _0x4e6005=_0xcf43[_0x393563];return _0x4e6005;};'use strict';var multer=require(_0x3cf4('0x0'));var util=require(_0x3cf4('0x1'));var path=require(_0x3cf4('0x2'));var timeout=require(_0x3cf4('0x3'));var express=require(_0x3cf4('0x4'));var router=express[_0x3cf4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3cf4('0x6'));var interaction=require(_0x3cf4('0x7'));var config=require(_0x3cf4('0x8'));var controller=require(_0x3cf4('0x9'));router[_0x3cf4('0xa')]('/',auth[_0x3cf4('0xb')](),controller['index']);router['get'](_0x3cf4('0xc'),auth[_0x3cf4('0xb')](),controller[_0x3cf4('0xd')]);router['get'](_0x3cf4('0xe'),auth[_0x3cf4('0xb')](),controller[_0x3cf4('0xf')]);router[_0x3cf4('0x10')]('/',auth[_0x3cf4('0xb')](),controller[_0x3cf4('0x11')]);router[_0x3cf4('0x12')]('/:id',auth[_0x3cf4('0xb')](),controller[_0x3cf4('0x13')]);router[_0x3cf4('0x14')](_0x3cf4('0xe'),auth[_0x3cf4('0xb')](),controller[_0x3cf4('0x15')]);module[_0x3cf4('0x16')]=router; \ No newline at end of file +var _0x1016=['./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2ec36f,_0x451fe8){var _0x1e6fbe=function(_0x38d7c7){while(--_0x38d7c7){_0x2ec36f['push'](_0x2ec36f['shift']());}};_0x1e6fbe(++_0x451fe8);}(_0x1016,0x1d9));var _0x6101=function(_0x2135fc,_0xd0f39e){_0x2135fc=_0x2135fc-0x0;var _0x5affe4=_0x1016[_0x2135fc];return _0x5affe4;};'use strict';var multer=require(_0x6101('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6101('0x1'));var router=express[_0x6101('0x2')]();var fs_extra=require(_0x6101('0x3'));var auth=require(_0x6101('0x4'));var interaction=require(_0x6101('0x5'));var config=require(_0x6101('0x6'));var controller=require(_0x6101('0x7'));router[_0x6101('0x8')]('/',auth[_0x6101('0x9')](),controller[_0x6101('0xa')]);router[_0x6101('0x8')](_0x6101('0xb'),auth['isAuthenticated'](),controller[_0x6101('0xc')]);router['get'](_0x6101('0xd'),auth[_0x6101('0x9')](),controller['show']);router[_0x6101('0xe')]('/',auth[_0x6101('0x9')](),controller[_0x6101('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6101('0x10')]);router[_0x6101('0x11')]('/:id',auth[_0x6101('0x9')](),controller[_0x6101('0x12')]);module[_0x6101('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 8aeed0d..6b5867c 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x3db183,_0x2ed918){var _0x1e4b96=function(_0x3b55d3){while(--_0x3b55d3){_0x3db183['push'](_0x3db183['shift']());}};_0x1e4b96(++_0x2ed918);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x196dc5,_0x50be9d){_0x196dc5=_0x196dc5-0x0;var _0x56458e=_0xf3cd[_0x196dc5];return _0x56458e;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x315fbf,_0x1cfec5){var _0x189bdd=function(_0x311ef0){while(--_0x311ef0){_0x315fbf['push'](_0x315fbf['shift']());}};_0x189bdd(++_0x1cfec5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xcb91[_0x403c20];return _0x2b271a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index f35a373..7094cd5 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 _0xdc6c=['fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','fields','include','create','update','body','find','describe','eml-format','zip-dir'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0xdc6c,0xdc));var _0xcdc6=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xdc6c[_0x36ed3c];return _0x52a2e0;};'use strict';var emlformat=require(_0xcdc6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcdc6('0x1'));var jsonpatch=require(_0xcdc6('0x2'));var rp=require(_0xcdc6('0x3'));var moment=require(_0xcdc6('0x4'));var BPromise=require(_0xcdc6('0x5'));var Mustache=require('mustache');var util=require(_0xcdc6('0x6'));var path=require(_0xcdc6('0x7'));var sox=require(_0xcdc6('0x8'));var csv=require('to-csv');var ejs=require(_0xcdc6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcdc6('0xa'));var crypto=require(_0xcdc6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcdc6('0xc'));var toCsv=require(_0xcdc6('0xd'));var querystring=require('querystring');var Papa=require(_0xcdc6('0xe'));var Redis=require(_0xcdc6('0xf'));var authService=require(_0xcdc6('0x10'));var qs=require(_0xcdc6('0x11'));var as=require(_0xcdc6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcdc6('0x13'));var utils=require('../../config/utils');var config=require(_0xcdc6('0x14'));var licenseUtil=require(_0xcdc6('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ee490,_0x4401ce){_0x4401ce=_0x4401ce||0xcc;return function(_0x46b551){if(_0x46b551){return _0x4ee490['sendStatus'](_0x4401ce);}return _0x4ee490[_0xcdc6('0x16')](_0x4401ce)[_0xcdc6('0x17')]();};}function respondWithResult(_0x1ad5e8,_0x41453e){_0x41453e=_0x41453e||0xc8;return function(_0xf74e43){if(_0xf74e43){return _0x1ad5e8[_0xcdc6('0x16')](_0x41453e)[_0xcdc6('0x18')](_0xf74e43);}};}function respondWithFilteredResult(_0x18008e,_0x1a5c24){return function(_0x2acb3f){if(_0x2acb3f){var _0x2bfed5=typeof _0x1a5c24[_0xcdc6('0x19')]==='undefined'&&typeof _0x1a5c24[_0xcdc6('0x1a')]===_0xcdc6('0x1b');var _0x5cf9b4=_0x2acb3f[_0xcdc6('0x1c')];var _0x1fd3f8=_0x2bfed5?0x0:_0x1a5c24['offset'];var _0x22bd5a=_0x2bfed5?_0x2acb3f[_0xcdc6('0x1c')]:_0x1a5c24[_0xcdc6('0x19')]+_0x1a5c24['limit'];var _0x1c8ab2;if(_0x22bd5a>=_0x5cf9b4){_0x22bd5a=_0x5cf9b4;_0x1c8ab2=0xc8;}else{_0x1c8ab2=0xce;}_0x18008e['status'](_0x1c8ab2);return _0x18008e[_0xcdc6('0x1d')]('Content-Range',_0x1fd3f8+'-'+_0x22bd5a+'/'+_0x5cf9b4)[_0xcdc6('0x18')](_0x2acb3f);}return null;};}function patchUpdates(_0x2772f9){return function(_0x5b13c9){try{jsonpatch[_0xcdc6('0x1e')](_0x5b13c9,_0x2772f9,!![]);}catch(_0x59c036){return BPromise[_0xcdc6('0x1f')](_0x59c036);}return _0x5b13c9['save']();};}function saveUpdates(_0x4cad08,_0x53ff73){return function(_0x29ca32){if(_0x29ca32){return _0x29ca32['update'](_0x4cad08)[_0xcdc6('0x20')](function(_0x324216){return _0x324216;});}return null;};}function removeEntity(_0x2dd85d,_0x27a2ab){return function(_0x307038){if(_0x307038){return _0x307038[_0xcdc6('0x21')]()[_0xcdc6('0x20')](function(){_0x2dd85d[_0xcdc6('0x16')](0xcc)[_0xcdc6('0x17')]();});}};}function handleEntityNotFound(_0x1660d8,_0x789819){return function(_0x44a810){if(!_0x44a810){_0x1660d8[_0xcdc6('0x22')](0x194);}return _0x44a810;};}function handleError(_0x2dbf80,_0x13995f){_0x13995f=_0x13995f||0x1f4;return function(_0x565466){logger[_0xcdc6('0x23')](_0x565466[_0xcdc6('0x24')]);if(_0x565466[_0xcdc6('0x25')]){delete _0x565466[_0xcdc6('0x25')];}_0x2dbf80[_0xcdc6('0x16')](_0x13995f)[_0xcdc6('0x26')](_0x565466);};}exports[_0xcdc6('0x27')]=function(_0x20207c,_0xd43b8d){var _0x12c6d6={},_0x9256fe={},_0x4a41ad={'count':0x0,'rows':[]};var _0x3445d7=_[_0xcdc6('0x28')](db[_0xcdc6('0x29')][_0xcdc6('0x2a')],function(_0x5226ca){return{'name':_0x5226ca[_0xcdc6('0x2b')],'type':_0x5226ca[_0xcdc6('0x2c')][_0xcdc6('0x2d')]};});_0x9256fe[_0xcdc6('0x2e')]=_[_0xcdc6('0x28')](_0x3445d7,_0xcdc6('0x25'));_0x9256fe[_0xcdc6('0x2f')]=_[_0xcdc6('0x30')](_0x20207c[_0xcdc6('0x2f')]);_0x9256fe['filters']=_[_0xcdc6('0x31')](_0x9256fe['model'],_0x9256fe[_0xcdc6('0x2f')]);_0x12c6d6['attributes']=_[_0xcdc6('0x31')](_0x9256fe[_0xcdc6('0x2e')],qs['fields'](_0x20207c['query']['fields']));_0x12c6d6[_0xcdc6('0x32')]=_0x12c6d6[_0xcdc6('0x32')][_0xcdc6('0x33')]?_0x12c6d6['attributes']:_0x9256fe[_0xcdc6('0x2e')];if(!_0x20207c[_0xcdc6('0x2f')][_0xcdc6('0x34')](_0xcdc6('0x35'))){_0x12c6d6['limit']=qs[_0xcdc6('0x1a')](_0x20207c[_0xcdc6('0x2f')][_0xcdc6('0x1a')]);_0x12c6d6[_0xcdc6('0x19')]=qs[_0xcdc6('0x19')](_0x20207c[_0xcdc6('0x2f')][_0xcdc6('0x19')]);}_0x12c6d6[_0xcdc6('0x36')]=qs['sort'](_0x20207c[_0xcdc6('0x2f')][_0xcdc6('0x37')]);_0x12c6d6[_0xcdc6('0x38')]=qs[_0xcdc6('0x39')](_['pick'](_0x20207c['query'],_0x9256fe[_0xcdc6('0x39')]),_0x3445d7);if(_0x20207c[_0xcdc6('0x2f')]['filter']){_0x12c6d6[_0xcdc6('0x38')]=_[_0xcdc6('0x3a')](_0x12c6d6[_0xcdc6('0x38')],{'$or':_['map'](_0x3445d7,function(_0x321e2d){if(_0x321e2d[_0xcdc6('0x2c')]!==_0xcdc6('0x3b')){var _0x442201={};_0x442201[_0x321e2d[_0xcdc6('0x25')]]={'$like':'%'+_0x20207c[_0xcdc6('0x2f')][_0xcdc6('0x3c')]+'%'};return _0x442201;}})});}_0x12c6d6=_[_0xcdc6('0x3a')]({},_0x12c6d6,_0x20207c['options']);var _0x30087e={'where':_0x12c6d6['where']};return db[_0xcdc6('0x29')][_0xcdc6('0x1c')](_0x30087e)[_0xcdc6('0x20')](function(_0x386e7c){_0x4a41ad['count']=_0x386e7c;if(_0x20207c['query'][_0xcdc6('0x3d')]){_0x12c6d6['include']=[{'all':!![]}];}return db[_0xcdc6('0x29')][_0xcdc6('0x3e')](_0x12c6d6);})['then'](function(_0x85bce0){_0x4a41ad[_0xcdc6('0x3f')]=_0x85bce0;return _0x4a41ad;})[_0xcdc6('0x20')](respondWithFilteredResult(_0xd43b8d,_0x12c6d6))[_0xcdc6('0x40')](handleError(_0xd43b8d,null));};exports[_0xcdc6('0x41')]=function(_0x3a6f1e,_0x3b1ced){var _0x98c281={'raw':!![],'where':{'id':_0x3a6f1e[_0xcdc6('0x42')]['id']}},_0x476238={};_0x476238[_0xcdc6('0x2e')]=_[_0xcdc6('0x30')](db[_0xcdc6('0x29')]['rawAttributes']);_0x476238[_0xcdc6('0x2f')]=_[_0xcdc6('0x30')](_0x3a6f1e['query']);_0x476238[_0xcdc6('0x39')]=_[_0xcdc6('0x31')](_0x476238[_0xcdc6('0x2e')],_0x476238[_0xcdc6('0x2f')]);_0x98c281[_0xcdc6('0x32')]=_[_0xcdc6('0x31')](_0x476238[_0xcdc6('0x2e')],qs[_0xcdc6('0x43')](_0x3a6f1e[_0xcdc6('0x2f')][_0xcdc6('0x43')]));_0x98c281[_0xcdc6('0x32')]=_0x98c281[_0xcdc6('0x32')]['length']?_0x98c281[_0xcdc6('0x32')]:_0x476238[_0xcdc6('0x2e')];if(_0x3a6f1e['query'][_0xcdc6('0x3d')]){_0x98c281[_0xcdc6('0x44')]=[{'all':!![]}];}_0x98c281=_[_0xcdc6('0x3a')]({},_0x98c281,_0x3a6f1e['options']);return db[_0xcdc6('0x29')]['find'](_0x98c281)[_0xcdc6('0x20')](handleEntityNotFound(_0x3b1ced,null))['then'](respondWithResult(_0x3b1ced,null))[_0xcdc6('0x40')](handleError(_0x3b1ced,null));};exports[_0xcdc6('0x45')]=function(_0x1cf123,_0x54ea53){return db[_0xcdc6('0x29')]['create'](_0x1cf123['body'],{})[_0xcdc6('0x20')](respondWithResult(_0x54ea53,0xc9))['catch'](handleError(_0x54ea53,null));};exports[_0xcdc6('0x46')]=function(_0x4a89f5,_0x30c4db){if(_0x4a89f5[_0xcdc6('0x47')]['id']){delete _0x4a89f5['body']['id'];}return db[_0xcdc6('0x29')]['find']({'where':{'id':_0x4a89f5[_0xcdc6('0x42')]['id']}})[_0xcdc6('0x20')](handleEntityNotFound(_0x30c4db,null))[_0xcdc6('0x20')](saveUpdates(_0x4a89f5[_0xcdc6('0x47')],null))[_0xcdc6('0x20')](respondWithResult(_0x30c4db,null))[_0xcdc6('0x40')](handleError(_0x30c4db,null));};exports['destroy']=function(_0x50d145,_0x27f139){return db[_0xcdc6('0x29')][_0xcdc6('0x48')]({'where':{'id':_0x50d145['params']['id']}})['then'](handleEntityNotFound(_0x27f139,null))[_0xcdc6('0x20')](removeEntity(_0x27f139,null))[_0xcdc6('0x40')](handleError(_0x27f139,null));};exports[_0xcdc6('0x49')]=function(_0x2bff0e,_0x57e8a5){return db['OpenchannelTransferReport'][_0xcdc6('0x49')]()[_0xcdc6('0x20')](respondWithResult(_0x57e8a5,null))[_0xcdc6('0x40')](handleError(_0x57e8a5,null));}; \ No newline at end of file +var _0x9f07=['includeAll','include','findAll','rows','show','params','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','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/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options'];(function(_0x2b9825,_0x2548db){var _0x5bb660=function(_0x1438ff){while(--_0x1438ff){_0x2b9825['push'](_0x2b9825['shift']());}};_0x5bb660(++_0x2548db);}(_0x9f07,0x140));var _0x79f0=function(_0x3fb687,_0x15e404){_0x3fb687=_0x3fb687-0x0;var _0x3c8328=_0x9f07[_0x3fb687];return _0x3c8328;};'use strict';var emlformat=require(_0x79f0('0x0'));var rimraf=require(_0x79f0('0x1'));var zipdir=require(_0x79f0('0x2'));var jsonpatch=require(_0x79f0('0x3'));var rp=require(_0x79f0('0x4'));var moment=require(_0x79f0('0x5'));var BPromise=require(_0x79f0('0x6'));var Mustache=require('mustache');var util=require(_0x79f0('0x7'));var path=require(_0x79f0('0x8'));var sox=require(_0x79f0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79f0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x79f0('0xb'));var deskjs=require(_0x79f0('0xc'));var toCsv=require(_0x79f0('0xd'));var querystring=require(_0x79f0('0xe'));var Papa=require(_0x79f0('0xf'));var Redis=require(_0x79f0('0x10'));var authService=require(_0x79f0('0x11'));var qs=require(_0x79f0('0x12'));var as=require(_0x79f0('0x13'));var hardwareService=require(_0x79f0('0x14'));var logger=require(_0x79f0('0x15'))(_0x79f0('0x16'));var utils=require(_0x79f0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x79f0('0x18'));var db=require(_0x79f0('0x19'))['db'];function respondWithStatusCode(_0x2d340b,_0x59836d){_0x59836d=_0x59836d||0xcc;return function(_0x202226){if(_0x202226){return _0x2d340b['sendStatus'](_0x59836d);}return _0x2d340b[_0x79f0('0x1a')](_0x59836d)[_0x79f0('0x1b')]();};}function respondWithResult(_0x33a4b8,_0x1595b8){_0x1595b8=_0x1595b8||0xc8;return function(_0x4307e3){if(_0x4307e3){return _0x33a4b8[_0x79f0('0x1a')](_0x1595b8)[_0x79f0('0x1c')](_0x4307e3);}};}function respondWithFilteredResult(_0x146ee9,_0x66007e){return function(_0x1406e7){if(_0x1406e7){var _0x362d5d=typeof _0x66007e[_0x79f0('0x1d')]===_0x79f0('0x1e')&&typeof _0x66007e[_0x79f0('0x1f')]===_0x79f0('0x1e');var _0x34a1da=_0x1406e7[_0x79f0('0x20')];var _0x3a255f=_0x362d5d?0x0:_0x66007e[_0x79f0('0x1d')];var _0x152b85=_0x362d5d?_0x1406e7[_0x79f0('0x20')]:_0x66007e['offset']+_0x66007e[_0x79f0('0x1f')];var _0x1f0fc3;if(_0x152b85>=_0x34a1da){_0x152b85=_0x34a1da;_0x1f0fc3=0xc8;}else{_0x1f0fc3=0xce;}_0x146ee9[_0x79f0('0x1a')](_0x1f0fc3);return _0x146ee9[_0x79f0('0x21')](_0x79f0('0x22'),_0x3a255f+'-'+_0x152b85+'/'+_0x34a1da)[_0x79f0('0x1c')](_0x1406e7);}return null;};}function patchUpdates(_0x119801){return function(_0x42a982){try{jsonpatch['apply'](_0x42a982,_0x119801,!![]);}catch(_0x219ecb){return BPromise[_0x79f0('0x23')](_0x219ecb);}return _0x42a982[_0x79f0('0x24')]();};}function saveUpdates(_0x4992e6,_0x196e32){return function(_0x36a51c){if(_0x36a51c){return _0x36a51c[_0x79f0('0x25')](_0x4992e6)['then'](function(_0x148910){return _0x148910;});}return null;};}function removeEntity(_0x4e8e2a,_0x1a1d73){return function(_0x18f7a9){if(_0x18f7a9){return _0x18f7a9[_0x79f0('0x26')]()[_0x79f0('0x27')](function(){_0x4e8e2a[_0x79f0('0x1a')](0xcc)[_0x79f0('0x1b')]();});}};}function handleEntityNotFound(_0x1716d9,_0x485a44){return function(_0x564fdb){if(!_0x564fdb){_0x1716d9['sendStatus'](0x194);}return _0x564fdb;};}function handleError(_0x738a4,_0x34a4a8){_0x34a4a8=_0x34a4a8||0x1f4;return function(_0x1399bc){logger[_0x79f0('0x28')](_0x1399bc[_0x79f0('0x29')]);if(_0x1399bc[_0x79f0('0x2a')]){delete _0x1399bc[_0x79f0('0x2a')];}_0x738a4[_0x79f0('0x1a')](_0x34a4a8)[_0x79f0('0x2b')](_0x1399bc);};}exports['index']=function(_0x45edf3,_0x2a094b){var _0x409f07={},_0x1715db={},_0x4baf4e={'count':0x0,'rows':[]};var _0x4bba66=_[_0x79f0('0x2c')](db[_0x79f0('0x2d')][_0x79f0('0x2e')],function(_0x67af8c){return{'name':_0x67af8c['fieldName'],'type':_0x67af8c[_0x79f0('0x2f')][_0x79f0('0x30')]};});_0x1715db[_0x79f0('0x31')]=_[_0x79f0('0x2c')](_0x4bba66,'name');_0x1715db[_0x79f0('0x32')]=_[_0x79f0('0x33')](_0x45edf3['query']);_0x1715db[_0x79f0('0x34')]=_[_0x79f0('0x35')](_0x1715db['model'],_0x1715db[_0x79f0('0x32')]);_0x409f07[_0x79f0('0x36')]=_[_0x79f0('0x35')](_0x1715db['model'],qs[_0x79f0('0x37')](_0x45edf3[_0x79f0('0x32')][_0x79f0('0x37')]));_0x409f07[_0x79f0('0x36')]=_0x409f07[_0x79f0('0x36')]['length']?_0x409f07[_0x79f0('0x36')]:_0x1715db[_0x79f0('0x31')];if(!_0x45edf3[_0x79f0('0x32')][_0x79f0('0x38')](_0x79f0('0x39'))){_0x409f07[_0x79f0('0x1f')]=qs[_0x79f0('0x1f')](_0x45edf3[_0x79f0('0x32')][_0x79f0('0x1f')]);_0x409f07['offset']=qs[_0x79f0('0x1d')](_0x45edf3[_0x79f0('0x32')][_0x79f0('0x1d')]);}_0x409f07[_0x79f0('0x3a')]=qs['sort'](_0x45edf3[_0x79f0('0x32')][_0x79f0('0x3b')]);_0x409f07[_0x79f0('0x3c')]=qs[_0x79f0('0x34')](_['pick'](_0x45edf3['query'],_0x1715db[_0x79f0('0x34')]),_0x4bba66);if(_0x45edf3[_0x79f0('0x32')][_0x79f0('0x3d')]){_0x409f07['where']=_['merge'](_0x409f07['where'],{'$or':_['map'](_0x4bba66,function(_0x132a95){if(_0x132a95[_0x79f0('0x2f')]!==_0x79f0('0x3e')){var _0x20edec={};_0x20edec[_0x132a95[_0x79f0('0x2a')]]={'$like':'%'+_0x45edf3[_0x79f0('0x32')][_0x79f0('0x3d')]+'%'};return _0x20edec;}})});}_0x409f07=_[_0x79f0('0x3f')]({},_0x409f07,_0x45edf3[_0x79f0('0x40')]);var _0x5f7444={'where':_0x409f07['where']};return db['OpenchannelTransferReport']['count'](_0x5f7444)['then'](function(_0x5db568){_0x4baf4e['count']=_0x5db568;if(_0x45edf3[_0x79f0('0x32')][_0x79f0('0x41')]){_0x409f07[_0x79f0('0x42')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x79f0('0x43')](_0x409f07);})[_0x79f0('0x27')](function(_0xa609e4){_0x4baf4e[_0x79f0('0x44')]=_0xa609e4;return _0x4baf4e;})[_0x79f0('0x27')](respondWithFilteredResult(_0x2a094b,_0x409f07))['catch'](handleError(_0x2a094b,null));};exports[_0x79f0('0x45')]=function(_0x3da7ce,_0x52b6b3){var _0x5caa25={'raw':!![],'where':{'id':_0x3da7ce[_0x79f0('0x46')]['id']}},_0x50760d={};_0x50760d[_0x79f0('0x31')]=_[_0x79f0('0x33')](db[_0x79f0('0x2d')][_0x79f0('0x2e')]);_0x50760d[_0x79f0('0x32')]=_[_0x79f0('0x33')](_0x3da7ce[_0x79f0('0x32')]);_0x50760d['filters']=_['intersection'](_0x50760d['model'],_0x50760d[_0x79f0('0x32')]);_0x5caa25[_0x79f0('0x36')]=_['intersection'](_0x50760d[_0x79f0('0x31')],qs[_0x79f0('0x37')](_0x3da7ce[_0x79f0('0x32')]['fields']));_0x5caa25['attributes']=_0x5caa25[_0x79f0('0x36')][_0x79f0('0x47')]?_0x5caa25[_0x79f0('0x36')]:_0x50760d[_0x79f0('0x31')];if(_0x3da7ce[_0x79f0('0x32')][_0x79f0('0x41')]){_0x5caa25['include']=[{'all':!![]}];}_0x5caa25=_['merge']({},_0x5caa25,_0x3da7ce[_0x79f0('0x40')]);return db[_0x79f0('0x2d')][_0x79f0('0x48')](_0x5caa25)[_0x79f0('0x27')](handleEntityNotFound(_0x52b6b3,null))[_0x79f0('0x27')](respondWithResult(_0x52b6b3,null))[_0x79f0('0x49')](handleError(_0x52b6b3,null));};exports[_0x79f0('0x4a')]=function(_0x49323c,_0x31154d){return db[_0x79f0('0x2d')][_0x79f0('0x4a')](_0x49323c[_0x79f0('0x4b')],{})[_0x79f0('0x27')](respondWithResult(_0x31154d,0xc9))[_0x79f0('0x49')](handleError(_0x31154d,null));};exports[_0x79f0('0x25')]=function(_0x4960e2,_0x232cc1){if(_0x4960e2[_0x79f0('0x4b')]['id']){delete _0x4960e2[_0x79f0('0x4b')]['id'];}return db['OpenchannelTransferReport'][_0x79f0('0x48')]({'where':{'id':_0x4960e2[_0x79f0('0x46')]['id']}})[_0x79f0('0x27')](handleEntityNotFound(_0x232cc1,null))[_0x79f0('0x27')](saveUpdates(_0x4960e2[_0x79f0('0x4b')],null))[_0x79f0('0x27')](respondWithResult(_0x232cc1,null))[_0x79f0('0x49')](handleError(_0x232cc1,null));};exports[_0x79f0('0x26')]=function(_0x10dae1,_0x472a9d){return db['OpenchannelTransferReport'][_0x79f0('0x48')]({'where':{'id':_0x10dae1[_0x79f0('0x46')]['id']}})['then'](handleEntityNotFound(_0x472a9d,null))[_0x79f0('0x27')](removeEntity(_0x472a9d,null))['catch'](handleError(_0x472a9d,null));};exports['describe']=function(_0x3d4d1c,_0x405f60){return db[_0x79f0('0x2d')][_0x79f0('0x4c')]()[_0x79f0('0x27')](respondWithResult(_0x405f60,null))[_0x79f0('0x49')](handleError(_0x405f60,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 5c59c38..9da21ae 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 _0x6470=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6470,0x79));var _0x0647=function(_0x217daa,_0x3af5b6){_0x217daa=_0x217daa-0x0;var _0x5879d2=_0x6470[_0x217daa];return _0x5879d2;};'use strict';var _=require(_0x0647('0x0'));var util=require(_0x0647('0x1'));var logger=require(_0x0647('0x2'))(_0x0647('0x3'));var moment=require(_0x0647('0x4'));var BPromise=require(_0x0647('0x5'));var rp=require(_0x0647('0x6'));var fs=require('fs');var path=require(_0x0647('0x7'));var rimraf=require(_0x0647('0x8'));var config=require(_0x0647('0x9'));var attributes=require(_0x0647('0xa'));module[_0x0647('0xb')]=function(_0x3e32ee,_0x3ed6f1){return _0x3e32ee[_0x0647('0xc')](_0x0647('0xd'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x0647('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1ec3=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','uniqueid','util','../../config/logger','api'];(function(_0xf919a8,_0x451705){var _0x1241ee=function(_0x2093da){while(--_0x2093da){_0xf919a8['push'](_0xf919a8['shift']());}};_0x1241ee(++_0x451705);}(_0x1ec3,0x1c5));var _0x31ec=function(_0x371cda,_0x57bd53){_0x371cda=_0x371cda-0x0;var _0xc1366c=_0x1ec3[_0x371cda];return _0xc1366c;};'use strict';var _=require('lodash');var util=require(_0x31ec('0x0'));var logger=require(_0x31ec('0x1'))(_0x31ec('0x2'));var moment=require('moment');var BPromise=require(_0x31ec('0x3'));var rp=require(_0x31ec('0x4'));var fs=require('fs');var path=require(_0x31ec('0x5'));var rimraf=require(_0x31ec('0x6'));var config=require(_0x31ec('0x7'));var attributes=require(_0x31ec('0x8'));module[_0x31ec('0x9')]=function(_0x355b37,_0x4a35e3){return _0x355b37[_0x31ec('0xa')]('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x31ec('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index c2cd523..44eb4de 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 _0x6108=['OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0xf9b7a3,_0x2a66f4){var _0x25f0a2=function(_0x3d3364){while(--_0x3d3364){_0xf9b7a3['push'](_0xf9b7a3['shift']());}};_0x25f0a2(++_0x2a66f4);}(_0x6108,0xbc));var _0x8610=function(_0x19308a,_0x5db3b8){_0x19308a=_0x19308a-0x0;var _0x5d2ebd=_0x6108[_0x19308a];return _0x5d2ebd;};'use strict';var _=require(_0x8610('0x0'));var util=require('util');var moment=require(_0x8610('0x1'));var BPromise=require(_0x8610('0x2'));var rs=require(_0x8610('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8610('0x4'));var logger=require(_0x8610('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8610('0x6'));var client=jayson[_0x8610('0x7')][_0x8610('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26dab3,_0x4e0fe4,_0x174f41){return new BPromise(function(_0x49e0a2,_0x6ee380){return client[_0x8610('0x9')](_0x26dab3,_0x174f41)[_0x8610('0xa')](function(_0x48d693){logger[_0x8610('0xb')](_0x8610('0xc'),_0x4e0fe4,_0x8610('0xd'));logger[_0x8610('0xe')](_0x8610('0xf'),_0x4e0fe4,_0x8610('0xd'),JSON['stringify'](_0x48d693));if(_0x48d693[_0x8610('0x10')]){if(_0x48d693[_0x8610('0x10')][_0x8610('0x11')]===0x1f4){logger['error'](_0x8610('0xc'),_0x4e0fe4,_0x48d693['error'][_0x8610('0x12')]);return _0x6ee380(_0x48d693[_0x8610('0x10')][_0x8610('0x12')]);}logger[_0x8610('0x10')](_0x8610('0xc'),_0x4e0fe4,_0x48d693['error']['message']);return _0x49e0a2(_0x48d693[_0x8610('0x10')][_0x8610('0x12')]);}else{logger[_0x8610('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4e0fe4,'request\x20sent');_0x49e0a2(_0x48d693['result'][_0x8610('0x12')]);}})[_0x8610('0x13')](function(_0x56ec75){logger[_0x8610('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4e0fe4,_0x56ec75);_0x6ee380(_0x56ec75);});});} \ No newline at end of file +var _0x56e6=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0xb99421,_0xaab133){var _0x4b3ec7=function(_0x591d1a){while(--_0x591d1a){_0xb99421['push'](_0xb99421['shift']());}};_0x4b3ec7(++_0xaab133);}(_0x56e6,0x6b));var _0x656e=function(_0x337dd9,_0x54e3f3){_0x337dd9=_0x337dd9-0x0;var _0x20f4fc=_0x56e6[_0x337dd9];return _0x20f4fc;};'use strict';var _=require(_0x656e('0x0'));var util=require(_0x656e('0x1'));var moment=require(_0x656e('0x2'));var BPromise=require(_0x656e('0x3'));var rs=require(_0x656e('0x4'));var fs=require('fs');var Redis=require(_0x656e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x656e('0x6'));var logger=require(_0x656e('0x7'))(_0x656e('0x8'));var config=require(_0x656e('0x9'));var jayson=require(_0x656e('0xa'));var client=jayson[_0x656e('0xb')][_0x656e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54eddb,_0x35d629,_0x1538a5){return new BPromise(function(_0x1dad4e,_0x2fc011){return client[_0x656e('0xd')](_0x54eddb,_0x1538a5)[_0x656e('0xe')](function(_0x30d78c){logger[_0x656e('0xf')](_0x656e('0x10'),_0x35d629,_0x656e('0x11'));logger[_0x656e('0x12')](_0x656e('0x13'),_0x35d629,_0x656e('0x11'),JSON[_0x656e('0x14')](_0x30d78c));if(_0x30d78c['error']){if(_0x30d78c['error'][_0x656e('0x15')]===0x1f4){logger[_0x656e('0x16')](_0x656e('0x10'),_0x35d629,_0x30d78c[_0x656e('0x16')]['message']);return _0x2fc011(_0x30d78c['error'][_0x656e('0x17')]);}logger[_0x656e('0x16')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x35d629,_0x30d78c[_0x656e('0x16')]['message']);return _0x1dad4e(_0x30d78c[_0x656e('0x16')][_0x656e('0x17')]);}else{logger[_0x656e('0xf')](_0x656e('0x10'),_0x35d629,'request\x20sent');_0x1dad4e(_0x30d78c[_0x656e('0x18')][_0x656e('0x17')]);}})[_0x656e('0x19')](function(_0x3a6cf8){logger[_0x656e('0x16')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x35d629,_0x3a6cf8);_0x2fc011(_0x3a6cf8);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 45c2db7..e9bfd65 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 _0xdcb1=['show','post','put','update','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','/:id','isAuthenticated'];(function(_0x2cce08,_0x17979a){var _0x496cb2=function(_0x2b4452){while(--_0x2b4452){_0x2cce08['push'](_0x2cce08['shift']());}};_0x496cb2(++_0x17979a);}(_0xdcb1,0x106));var _0x1dcb=function(_0x64c94b,_0x109150){_0x64c94b=_0x64c94b-0x0;var _0x4bb180=_0xdcb1[_0x64c94b];return _0x4bb180;};'use strict';var multer=require(_0x1dcb('0x0'));var util=require(_0x1dcb('0x1'));var path=require(_0x1dcb('0x2'));var timeout=require('connect-timeout');var express=require(_0x1dcb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1dcb('0x4'));var interaction=require(_0x1dcb('0x5'));var config=require(_0x1dcb('0x6'));var controller=require(_0x1dcb('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1dcb('0x8'),auth[_0x1dcb('0x9')](),controller[_0x1dcb('0xa')]);router[_0x1dcb('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1dcb('0xc')](_0x1dcb('0x8'),auth[_0x1dcb('0x9')](),controller[_0x1dcb('0xd')]);router['delete']('/:id',auth[_0x1dcb('0x9')](),controller[_0x1dcb('0xe')]);module[_0x1dcb('0xf')]=router; \ No newline at end of file +var _0x3fc4=['delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post'];(function(_0x1f244d,_0x19e830){var _0x16003a=function(_0x1ee3f3){while(--_0x1ee3f3){_0x1f244d['push'](_0x1f244d['shift']());}};_0x16003a(++_0x19e830);}(_0x3fc4,0x1c2));var _0x43fc=function(_0xce8e9d,_0xd16a52){_0xce8e9d=_0xce8e9d-0x0;var _0x53c3b0=_0x3fc4[_0xce8e9d];return _0x53c3b0;};'use strict';var multer=require(_0x43fc('0x0'));var util=require(_0x43fc('0x1'));var path=require(_0x43fc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x43fc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x43fc('0x4'));var interaction=require(_0x43fc('0x5'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0x43fc('0x6')]('/',auth['isAuthenticated'](),controller[_0x43fc('0x7')]);router['get'](_0x43fc('0x8'),auth[_0x43fc('0x9')](),controller[_0x43fc('0xa')]);router[_0x43fc('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x43fc('0x8'),auth[_0x43fc('0x9')](),controller['update']);router[_0x43fc('0xc')](_0x43fc('0x8'),auth[_0x43fc('0x9')](),controller[_0x43fc('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 6f6ef7e..e1d1a87 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 _0x99a2=['sequelize','exports','STRING','name'];(function(_0x37b3e5,_0x33b516){var _0x207f20=function(_0x5237fa){while(--_0x5237fa){_0x37b3e5['push'](_0x37b3e5['shift']());}};_0x207f20(++_0x33b516);}(_0x99a2,0x1a8));var _0x299a=function(_0x4a565f,_0x59bd1a){_0x4a565f=_0x4a565f-0x0;var _0x24f54f=_0x99a2[_0x4a565f];return _0x24f54f;};'use strict';var Sequelize=require(_0x299a('0x0'));module[_0x299a('0x1')]={'name':{'type':Sequelize[_0x299a('0x2')],'unique':_0x299a('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x299a('0x2')]}}; \ No newline at end of file +var _0x6259=['exports','STRING','sequelize'];(function(_0x30fe45,_0x3e20c8){var _0x1f7420=function(_0x406220){while(--_0x406220){_0x30fe45['push'](_0x30fe45['shift']());}};_0x1f7420(++_0x3e20c8);}(_0x6259,0x131));var _0x9625=function(_0x1ee817,_0x2ed570){_0x1ee817=_0x1ee817-0x0;var _0x5afab3=_0x6259[_0x1ee817];return _0x5afab3;};'use strict';var Sequelize=require(_0x9625('0x0'));module[_0x9625('0x1')]={'name':{'type':Sequelize[_0x9625('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index dfaf3d5..ef5486c 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 _0xfe11=['ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','get','Pauses','UserProfileResource','then','error','stack','name','send','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','Pause','count','includeAll','findAll','rows','catch','show','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','find','params','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x356e27,_0x55f3a5){var _0x9afd20=function(_0xb39b06){while(--_0xb39b06){_0x356e27['push'](_0x356e27['shift']());}};_0x9afd20(++_0x55f3a5);}(_0xfe11,0x173));var _0x1fe1=function(_0x3312ee,_0x686154){_0x3312ee=_0x3312ee-0x0;var _0x5e5fbf=_0xfe11[_0x3312ee];return _0x5e5fbf;};'use strict';var emlformat=require(_0x1fe1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1fe1('0x1'));var rp=require(_0x1fe1('0x2'));var moment=require('moment');var BPromise=require(_0x1fe1('0x3'));var Mustache=require(_0x1fe1('0x4'));var util=require('util');var path=require(_0x1fe1('0x5'));var sox=require(_0x1fe1('0x6'));var csv=require(_0x1fe1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1fe1('0x8'));var _=require('lodash');var squel=require(_0x1fe1('0x9'));var crypto=require(_0x1fe1('0xa'));var jsforce=require(_0x1fe1('0xb'));var deskjs=require(_0x1fe1('0xc'));var toCsv=require(_0x1fe1('0x7'));var querystring=require(_0x1fe1('0xd'));var Papa=require('papaparse');var Redis=require(_0x1fe1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1fe1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1fe1('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x1fe1('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x1fe1('0x12'))['db'];function respondWithStatusCode(_0x18f68d,_0x86eed8){_0x86eed8=_0x86eed8||0xcc;return function(_0x5708e6){if(_0x5708e6){return _0x18f68d[_0x1fe1('0x13')](_0x86eed8);}return _0x18f68d['status'](_0x86eed8)[_0x1fe1('0x14')]();};}function respondWithResult(_0x3c9d2e,_0x4e7cab){_0x4e7cab=_0x4e7cab||0xc8;return function(_0x1d77cf){if(_0x1d77cf){return _0x3c9d2e[_0x1fe1('0x15')](_0x4e7cab)[_0x1fe1('0x16')](_0x1d77cf);}};}function respondWithFilteredResult(_0x563079,_0x49b7ea){return function(_0x57a6e7){if(_0x57a6e7){var _0x2b82aa=typeof _0x49b7ea[_0x1fe1('0x17')]===_0x1fe1('0x18')&&typeof _0x49b7ea[_0x1fe1('0x19')]===_0x1fe1('0x18');var _0x38b5ee=_0x57a6e7['count'];var _0x1a2bc8=_0x2b82aa?0x0:_0x49b7ea[_0x1fe1('0x17')];var _0x224a82=_0x2b82aa?_0x57a6e7['count']:_0x49b7ea[_0x1fe1('0x17')]+_0x49b7ea[_0x1fe1('0x19')];var _0x2776b5;if(_0x224a82>=_0x38b5ee){_0x224a82=_0x38b5ee;_0x2776b5=0xc8;}else{_0x2776b5=0xce;}_0x563079[_0x1fe1('0x15')](_0x2776b5);return _0x563079[_0x1fe1('0x1a')](_0x1fe1('0x1b'),_0x1a2bc8+'-'+_0x224a82+'/'+_0x38b5ee)[_0x1fe1('0x16')](_0x57a6e7);}return null;};}function patchUpdates(_0x43d72c){return function(_0xf3214c){try{jsonpatch[_0x1fe1('0x1c')](_0xf3214c,_0x43d72c,!![]);}catch(_0x471cfa){return BPromise[_0x1fe1('0x1d')](_0x471cfa);}return _0xf3214c[_0x1fe1('0x1e')]();};}function saveUpdates(_0x21c5d4,_0x1acb40){return function(_0x3eb0ba){if(_0x3eb0ba){return _0x3eb0ba['update'](_0x21c5d4)['then'](function(_0x5a213b){return _0x5a213b;});}return null;};}function removeEntity(_0x4af9fd,_0x7c7fe1){return function(_0x450d15){if(_0x450d15){return _0x450d15[_0x1fe1('0x1f')]()['then'](function(){var _0x4218b5=_0x450d15[_0x1fe1('0x20')]({'plain':!![]});var _0x223307=_0x1fe1('0x21');return db[_0x1fe1('0x22')][_0x1fe1('0x1f')]({'where':{'type':_0x223307,'resourceId':_0x4218b5['id']}})[_0x1fe1('0x23')](function(){return _0x450d15;});})[_0x1fe1('0x23')](function(){_0x4af9fd[_0x1fe1('0x15')](0xcc)[_0x1fe1('0x14')]();});}};}function handleEntityNotFound(_0x28d417,_0x3451bd){return function(_0x2dc9df){if(!_0x2dc9df){_0x28d417[_0x1fe1('0x13')](0x194);}return _0x2dc9df;};}function handleError(_0x6091d0,_0x38bf52){_0x38bf52=_0x38bf52||0x1f4;return function(_0x35e2be){logger[_0x1fe1('0x24')](_0x35e2be[_0x1fe1('0x25')]);if(_0x35e2be[_0x1fe1('0x26')]){delete _0x35e2be[_0x1fe1('0x26')];}_0x6091d0['status'](_0x38bf52)[_0x1fe1('0x27')](_0x35e2be);};}exports['index']=function(_0x47e5e1,_0x284320){var _0x12b1cc={},_0x29ba08={},_0x5b4d85={'count':0x0,'rows':[]};var _0x5cd994=_[_0x1fe1('0x28')](db['Pause'][_0x1fe1('0x29')],function(_0x51d5c0){return{'name':_0x51d5c0[_0x1fe1('0x2a')],'type':_0x51d5c0['type']['key']};});_0x29ba08[_0x1fe1('0x2b')]=_['map'](_0x5cd994,_0x1fe1('0x26'));_0x29ba08[_0x1fe1('0x2c')]=_[_0x1fe1('0x2d')](_0x47e5e1[_0x1fe1('0x2c')]);_0x29ba08['filters']=_[_0x1fe1('0x2e')](_0x29ba08[_0x1fe1('0x2b')],_0x29ba08['query']);_0x12b1cc[_0x1fe1('0x2f')]=_[_0x1fe1('0x2e')](_0x29ba08[_0x1fe1('0x2b')],qs['fields'](_0x47e5e1['query'][_0x1fe1('0x30')]));_0x12b1cc[_0x1fe1('0x2f')]=_0x12b1cc['attributes']['length']?_0x12b1cc[_0x1fe1('0x2f')]:_0x29ba08[_0x1fe1('0x2b')];if(!_0x47e5e1[_0x1fe1('0x2c')][_0x1fe1('0x31')](_0x1fe1('0x32'))){_0x12b1cc['limit']=qs[_0x1fe1('0x19')](_0x47e5e1[_0x1fe1('0x2c')][_0x1fe1('0x19')]);_0x12b1cc[_0x1fe1('0x17')]=qs[_0x1fe1('0x17')](_0x47e5e1[_0x1fe1('0x2c')][_0x1fe1('0x17')]);}_0x12b1cc[_0x1fe1('0x33')]=qs[_0x1fe1('0x34')](_0x47e5e1[_0x1fe1('0x2c')][_0x1fe1('0x34')]);_0x12b1cc[_0x1fe1('0x35')]=qs[_0x1fe1('0x36')](_[_0x1fe1('0x37')](_0x47e5e1['query'],_0x29ba08['filters']),_0x5cd994);if(_0x47e5e1[_0x1fe1('0x2c')][_0x1fe1('0x38')]){_0x12b1cc[_0x1fe1('0x35')]=_[_0x1fe1('0x39')](_0x12b1cc['where'],{'$or':_[_0x1fe1('0x28')](_0x5cd994,function(_0x16e103){if(_0x16e103[_0x1fe1('0x3a')]!=='VIRTUAL'){var _0x16b3b3={};_0x16b3b3[_0x16e103[_0x1fe1('0x26')]]={'$like':'%'+_0x47e5e1[_0x1fe1('0x2c')]['filter']+'%'};return _0x16b3b3;}})});}_0x12b1cc=_['merge']({},_0x12b1cc,_0x47e5e1[_0x1fe1('0x3b')]);var _0x156326={'where':_0x12b1cc[_0x1fe1('0x35')]};return db[_0x1fe1('0x3c')][_0x1fe1('0x3d')](_0x156326)[_0x1fe1('0x23')](function(_0x25e054){_0x5b4d85[_0x1fe1('0x3d')]=_0x25e054;if(_0x47e5e1[_0x1fe1('0x2c')][_0x1fe1('0x3e')]){_0x12b1cc['include']=[{'all':!![]}];}return db[_0x1fe1('0x3c')][_0x1fe1('0x3f')](_0x12b1cc);})[_0x1fe1('0x23')](function(_0x2becf4){_0x5b4d85[_0x1fe1('0x40')]=_0x2becf4;return _0x5b4d85;})[_0x1fe1('0x23')](respondWithFilteredResult(_0x284320,_0x12b1cc))[_0x1fe1('0x41')](handleError(_0x284320,null));};exports[_0x1fe1('0x42')]=function(_0x1e929c,_0x1dad8e){var _0x162660={'raw':!![],'where':{'id':_0x1e929c['params']['id']}},_0x3ae720={};_0x3ae720[_0x1fe1('0x2b')]=_['keys'](db[_0x1fe1('0x3c')][_0x1fe1('0x29')]);_0x3ae720['query']=_['keys'](_0x1e929c[_0x1fe1('0x2c')]);_0x3ae720[_0x1fe1('0x36')]=_[_0x1fe1('0x2e')](_0x3ae720[_0x1fe1('0x2b')],_0x3ae720['query']);_0x162660['attributes']=_[_0x1fe1('0x2e')](_0x3ae720[_0x1fe1('0x2b')],qs[_0x1fe1('0x30')](_0x1e929c[_0x1fe1('0x2c')][_0x1fe1('0x30')]));_0x162660['attributes']=_0x162660[_0x1fe1('0x2f')][_0x1fe1('0x43')]?_0x162660[_0x1fe1('0x2f')]:_0x3ae720[_0x1fe1('0x2b')];if(_0x1e929c[_0x1fe1('0x2c')]['includeAll']){_0x162660[_0x1fe1('0x44')]=[{'all':!![]}];}_0x162660=_[_0x1fe1('0x39')]({},_0x162660,_0x1e929c['options']);return db[_0x1fe1('0x3c')]['find'](_0x162660)[_0x1fe1('0x23')](handleEntityNotFound(_0x1dad8e,null))[_0x1fe1('0x23')](respondWithResult(_0x1dad8e,null))['catch'](handleError(_0x1dad8e,null));};exports[_0x1fe1('0x45')]=function(_0x395372,_0x179136){return db['Pause'][_0x1fe1('0x45')](_0x395372[_0x1fe1('0x46')],{})[_0x1fe1('0x23')](function(_0x1c8765){var _0x5b5168=_0x395372[_0x1fe1('0x47')][_0x1fe1('0x20')]({'plain':!![]});if(!_0x5b5168)throw new Error(_0x1fe1('0x48'));if(_0x5b5168[_0x1fe1('0x49')]===_0x1fe1('0x47')){var _0x8382cd=_0x1c8765[_0x1fe1('0x20')]({'plain':!![]});var _0x3630c7=_0x1fe1('0x21');return db['UserProfileSection']['find']({'where':{'name':_0x3630c7,'userProfileId':_0x5b5168[_0x1fe1('0x4a')]},'raw':!![]})['then'](function(_0x9cff07){if(_0x9cff07&&_0x9cff07['autoAssociation']===0x0){return db[_0x1fe1('0x22')][_0x1fe1('0x45')]({'name':_0x8382cd[_0x1fe1('0x26')],'resourceId':_0x8382cd['id'],'type':_0x9cff07[_0x1fe1('0x26')],'sectionId':_0x9cff07['id']},{})[_0x1fe1('0x23')](function(){return _0x1c8765;});}else{return _0x1c8765;}})['catch'](function(_0x59bb6e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59bb6e);throw _0x59bb6e;});}return _0x1c8765;})[_0x1fe1('0x23')](respondWithResult(_0x179136,0xc9))[_0x1fe1('0x41')](handleError(_0x179136,null));};exports['update']=function(_0x27a044,_0x40ddc2){if(_0x27a044['body']['id']){delete _0x27a044[_0x1fe1('0x46')]['id'];}return db[_0x1fe1('0x3c')][_0x1fe1('0x4b')]({'where':{'id':_0x27a044[_0x1fe1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x40ddc2,null))[_0x1fe1('0x23')](saveUpdates(_0x27a044['body'],null))[_0x1fe1('0x23')](respondWithResult(_0x40ddc2,null))[_0x1fe1('0x41')](handleError(_0x40ddc2,null));};exports[_0x1fe1('0x1f')]=function(_0x240a20,_0x501b4d){return db[_0x1fe1('0x3c')]['find']({'where':{'id':_0x240a20['params']['id']}})['then'](handleEntityNotFound(_0x501b4d,null))[_0x1fe1('0x23')](removeEntity(_0x501b4d,null))[_0x1fe1('0x41')](handleError(_0x501b4d,null));}; \ No newline at end of file +var _0xfe1a=['get','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','Pauses','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user'];(function(_0x53b638,_0x4d7fcf){var _0x4ec5cb=function(_0x25f677){while(--_0x25f677){_0x53b638['push'](_0x53b638['shift']());}};_0x4ec5cb(++_0x4d7fcf);}(_0xfe1a,0x156));var _0xafe1=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xfe1a[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require(_0xafe1('0x0'));var rimraf=require(_0xafe1('0x1'));var zipdir=require(_0xafe1('0x2'));var jsonpatch=require(_0xafe1('0x3'));var rp=require('request-promise');var moment=require(_0xafe1('0x4'));var BPromise=require(_0xafe1('0x5'));var Mustache=require(_0xafe1('0x6'));var util=require(_0xafe1('0x7'));var path=require('path');var sox=require(_0xafe1('0x8'));var csv=require('to-csv');var ejs=require(_0xafe1('0x9'));var fs=require('fs');var fs_extra=require(_0xafe1('0xa'));var _=require(_0xafe1('0xb'));var squel=require('squel');var crypto=require(_0xafe1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xafe1('0xd'));var Papa=require(_0xafe1('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xafe1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xafe1('0x10'));var logger=require(_0xafe1('0x11'))(_0xafe1('0x12'));var utils=require(_0xafe1('0x13'));var config=require(_0xafe1('0x14'));var licenseUtil=require(_0xafe1('0x15'));var db=require(_0xafe1('0x16'))['db'];function respondWithStatusCode(_0x39d46d,_0x2d2128){_0x2d2128=_0x2d2128||0xcc;return function(_0x14a8cf){if(_0x14a8cf){return _0x39d46d[_0xafe1('0x17')](_0x2d2128);}return _0x39d46d[_0xafe1('0x18')](_0x2d2128)[_0xafe1('0x19')]();};}function respondWithResult(_0x137fa6,_0x1f6956){_0x1f6956=_0x1f6956||0xc8;return function(_0x20f7c4){if(_0x20f7c4){return _0x137fa6[_0xafe1('0x18')](_0x1f6956)[_0xafe1('0x1a')](_0x20f7c4);}};}function respondWithFilteredResult(_0x149662,_0x4fbd44){return function(_0x28622b){if(_0x28622b){var _0x3abdcc=typeof _0x4fbd44[_0xafe1('0x1b')]===_0xafe1('0x1c')&&typeof _0x4fbd44[_0xafe1('0x1d')]==='undefined';var _0x14c704=_0x28622b[_0xafe1('0x1e')];var _0x52c78a=_0x3abdcc?0x0:_0x4fbd44[_0xafe1('0x1b')];var _0x4bbdbb=_0x3abdcc?_0x28622b[_0xafe1('0x1e')]:_0x4fbd44[_0xafe1('0x1b')]+_0x4fbd44[_0xafe1('0x1d')];var _0x3848d8;if(_0x4bbdbb>=_0x14c704){_0x4bbdbb=_0x14c704;_0x3848d8=0xc8;}else{_0x3848d8=0xce;}_0x149662['status'](_0x3848d8);return _0x149662[_0xafe1('0x1f')](_0xafe1('0x20'),_0x52c78a+'-'+_0x4bbdbb+'/'+_0x14c704)[_0xafe1('0x1a')](_0x28622b);}return null;};}function patchUpdates(_0x167bfb){return function(_0x35a30b){try{jsonpatch[_0xafe1('0x21')](_0x35a30b,_0x167bfb,!![]);}catch(_0x26d8f4){return BPromise[_0xafe1('0x22')](_0x26d8f4);}return _0x35a30b['save']();};}function saveUpdates(_0x5b4416,_0x165741){return function(_0x2de4d6){if(_0x2de4d6){return _0x2de4d6[_0xafe1('0x23')](_0x5b4416)[_0xafe1('0x24')](function(_0x30e52c){return _0x30e52c;});}return null;};}function removeEntity(_0xae7aca,_0x418bf0){return function(_0x7c2839){if(_0x7c2839){return _0x7c2839[_0xafe1('0x25')]()['then'](function(){var _0x469237=_0x7c2839['get']({'plain':!![]});var _0x2257d0=_0xafe1('0x26');return db['UserProfileResource'][_0xafe1('0x25')]({'where':{'type':_0x2257d0,'resourceId':_0x469237['id']}})[_0xafe1('0x24')](function(){return _0x7c2839;});})[_0xafe1('0x24')](function(){_0xae7aca[_0xafe1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x501d06,_0x379d2e){return function(_0x41c742){if(!_0x41c742){_0x501d06[_0xafe1('0x17')](0x194);}return _0x41c742;};}function handleError(_0x445a94,_0xc6c5ab){_0xc6c5ab=_0xc6c5ab||0x1f4;return function(_0x268721){logger[_0xafe1('0x27')](_0x268721[_0xafe1('0x28')]);if(_0x268721['name']){delete _0x268721[_0xafe1('0x29')];}_0x445a94[_0xafe1('0x18')](_0xc6c5ab)[_0xafe1('0x2a')](_0x268721);};}exports[_0xafe1('0x2b')]=function(_0xe8a6e0,_0x1da52f){var _0x55adfa={},_0x4b9412={},_0x3d0359={'count':0x0,'rows':[]};var _0x4b7d4d=_[_0xafe1('0x2c')](db[_0xafe1('0x2d')][_0xafe1('0x2e')],function(_0x2ce97c){return{'name':_0x2ce97c[_0xafe1('0x2f')],'type':_0x2ce97c[_0xafe1('0x30')][_0xafe1('0x31')]};});_0x4b9412['model']=_[_0xafe1('0x2c')](_0x4b7d4d,'name');_0x4b9412['query']=_['keys'](_0xe8a6e0['query']);_0x4b9412[_0xafe1('0x32')]=_['intersection'](_0x4b9412[_0xafe1('0x33')],_0x4b9412[_0xafe1('0x34')]);_0x55adfa[_0xafe1('0x35')]=_[_0xafe1('0x36')](_0x4b9412[_0xafe1('0x33')],qs[_0xafe1('0x37')](_0xe8a6e0[_0xafe1('0x34')][_0xafe1('0x37')]));_0x55adfa[_0xafe1('0x35')]=_0x55adfa[_0xafe1('0x35')][_0xafe1('0x38')]?_0x55adfa[_0xafe1('0x35')]:_0x4b9412[_0xafe1('0x33')];if(!_0xe8a6e0[_0xafe1('0x34')][_0xafe1('0x39')](_0xafe1('0x3a'))){_0x55adfa['limit']=qs[_0xafe1('0x1d')](_0xe8a6e0[_0xafe1('0x34')]['limit']);_0x55adfa[_0xafe1('0x1b')]=qs[_0xafe1('0x1b')](_0xe8a6e0[_0xafe1('0x34')]['offset']);}_0x55adfa[_0xafe1('0x3b')]=qs[_0xafe1('0x3c')](_0xe8a6e0[_0xafe1('0x34')][_0xafe1('0x3c')]);_0x55adfa[_0xafe1('0x3d')]=qs[_0xafe1('0x32')](_[_0xafe1('0x3e')](_0xe8a6e0[_0xafe1('0x34')],_0x4b9412[_0xafe1('0x32')]),_0x4b7d4d);if(_0xe8a6e0[_0xafe1('0x34')][_0xafe1('0x3f')]){_0x55adfa[_0xafe1('0x3d')]=_[_0xafe1('0x40')](_0x55adfa[_0xafe1('0x3d')],{'$or':_[_0xafe1('0x2c')](_0x4b7d4d,function(_0x2d71dd){if(_0x2d71dd['type']!=='VIRTUAL'){var _0xa958bd={};_0xa958bd[_0x2d71dd[_0xafe1('0x29')]]={'$like':'%'+_0xe8a6e0[_0xafe1('0x34')][_0xafe1('0x3f')]+'%'};return _0xa958bd;}})});}_0x55adfa=_[_0xafe1('0x40')]({},_0x55adfa,_0xe8a6e0[_0xafe1('0x41')]);var _0x32d3c2={'where':_0x55adfa[_0xafe1('0x3d')]};return db[_0xafe1('0x2d')][_0xafe1('0x1e')](_0x32d3c2)['then'](function(_0x4b1af8){_0x3d0359[_0xafe1('0x1e')]=_0x4b1af8;if(_0xe8a6e0[_0xafe1('0x34')]['includeAll']){_0x55adfa[_0xafe1('0x42')]=[{'all':!![]}];}return db[_0xafe1('0x2d')][_0xafe1('0x43')](_0x55adfa);})[_0xafe1('0x24')](function(_0x1bb060){_0x3d0359[_0xafe1('0x44')]=_0x1bb060;return _0x3d0359;})[_0xafe1('0x24')](respondWithFilteredResult(_0x1da52f,_0x55adfa))[_0xafe1('0x45')](handleError(_0x1da52f,null));};exports[_0xafe1('0x46')]=function(_0x2eea3a,_0x5cc645){var _0x2f0a3f={'raw':!![],'where':{'id':_0x2eea3a[_0xafe1('0x47')]['id']}},_0x2069dd={};_0x2069dd[_0xafe1('0x33')]=_[_0xafe1('0x48')](db[_0xafe1('0x2d')][_0xafe1('0x2e')]);_0x2069dd[_0xafe1('0x34')]=_[_0xafe1('0x48')](_0x2eea3a[_0xafe1('0x34')]);_0x2069dd[_0xafe1('0x32')]=_['intersection'](_0x2069dd[_0xafe1('0x33')],_0x2069dd[_0xafe1('0x34')]);_0x2f0a3f[_0xafe1('0x35')]=_[_0xafe1('0x36')](_0x2069dd[_0xafe1('0x33')],qs['fields'](_0x2eea3a[_0xafe1('0x34')]['fields']));_0x2f0a3f[_0xafe1('0x35')]=_0x2f0a3f[_0xafe1('0x35')][_0xafe1('0x38')]?_0x2f0a3f[_0xafe1('0x35')]:_0x2069dd[_0xafe1('0x33')];if(_0x2eea3a[_0xafe1('0x34')][_0xafe1('0x49')]){_0x2f0a3f[_0xafe1('0x42')]=[{'all':!![]}];}_0x2f0a3f=_['merge']({},_0x2f0a3f,_0x2eea3a[_0xafe1('0x41')]);return db['Pause'][_0xafe1('0x4a')](_0x2f0a3f)['then'](handleEntityNotFound(_0x5cc645,null))[_0xafe1('0x24')](respondWithResult(_0x5cc645,null))[_0xafe1('0x45')](handleError(_0x5cc645,null));};exports[_0xafe1('0x4b')]=function(_0x231594,_0x36db55){return db[_0xafe1('0x2d')]['create'](_0x231594[_0xafe1('0x4c')],{})[_0xafe1('0x24')](function(_0x1d625d){var _0x545fa0=_0x231594[_0xafe1('0x4d')][_0xafe1('0x4e')]({'plain':!![]});if(!_0x545fa0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x545fa0[_0xafe1('0x4f')]===_0xafe1('0x4d')){var _0x2bad14=_0x1d625d[_0xafe1('0x4e')]({'plain':!![]});var _0x2f6bfc=_0xafe1('0x26');return db['UserProfileSection'][_0xafe1('0x4a')]({'where':{'name':_0x2f6bfc,'userProfileId':_0x545fa0[_0xafe1('0x50')]},'raw':!![]})[_0xafe1('0x24')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0xafe1('0x51')]===0x0){return db[_0xafe1('0x52')][_0xafe1('0x4b')]({'name':_0x2bad14['name'],'resourceId':_0x2bad14['id'],'type':_0x163bb7[_0xafe1('0x29')],'sectionId':_0x163bb7['id']},{})[_0xafe1('0x24')](function(){return _0x1d625d;});}else{return _0x1d625d;}})[_0xafe1('0x45')](function(_0x4af69d){logger[_0xafe1('0x27')](_0xafe1('0x53'),_0x4af69d);throw _0x4af69d;});}return _0x1d625d;})[_0xafe1('0x24')](respondWithResult(_0x36db55,0xc9))[_0xafe1('0x45')](handleError(_0x36db55,null));};exports[_0xafe1('0x23')]=function(_0x21ed61,_0xa218ba){if(_0x21ed61[_0xafe1('0x4c')]['id']){delete _0x21ed61['body']['id'];}return db[_0xafe1('0x2d')]['find']({'where':{'id':_0x21ed61[_0xafe1('0x47')]['id']}})[_0xafe1('0x24')](handleEntityNotFound(_0xa218ba,null))[_0xafe1('0x24')](saveUpdates(_0x21ed61[_0xafe1('0x4c')],null))[_0xafe1('0x24')](respondWithResult(_0xa218ba,null))[_0xafe1('0x45')](handleError(_0xa218ba,null));};exports[_0xafe1('0x25')]=function(_0x395ae0,_0x4ec33f){return db[_0xafe1('0x2d')]['find']({'where':{'id':_0x395ae0['params']['id']}})[_0xafe1('0x24')](handleEntityNotFound(_0x4ec33f,null))[_0xafe1('0x24')](removeEntity(_0x4ec33f,null))[_0xafe1('0x45')](handleError(_0x4ec33f,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 5a39a07..420e9d1 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0xaef61d,_0x261de5){var _0x117baf=function(_0xb06055){while(--_0xb06055){_0xaef61d['push'](_0xaef61d['shift']());}};_0x117baf(++_0x261de5);}(_0xf494,0x1c6));var _0x4f49=function(_0x89943a,_0xcd9e4f){_0x89943a=_0x89943a-0x0;var _0x4cad76=_0xf494[_0x89943a];return _0x4cad76;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x289167,_0x32284c){var _0x29a729=function(_0xb42e91){while(--_0xb42e91){_0x289167['push'](_0x289167['shift']());}};_0x29a729(++_0x32284c);}(_0x53ec,0x192));var _0xc53e=function(_0x563db8,_0xd567f9){_0x563db8=_0x563db8-0x0;var _0x5b79ec=_0x53ec[_0x563db8];return _0x5b79ec;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 334a661..db449be 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x193c4e,_0x28ddff){var _0x95e9a1=function(_0x36c44d){while(--_0x36c44d){_0x193c4e['push'](_0x193c4e['shift']());}};_0x95e9a1(++_0x28ddff);}(_0xb10b,0x12a));var _0xbb10=function(_0x592cbc,_0x5ec030){_0x592cbc=_0x592cbc-0x0;var _0x39b8d9=_0xb10b[_0x592cbc];return _0x39b8d9;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x4cdd99,_0xec3046){var _0x2dd823=function(_0xb05a43){while(--_0xb05a43){_0x4cdd99['push'](_0x4cdd99['shift']());}};_0x2dd823(++_0xec3046);}(_0xb10b,0x12a));var _0xbb10=function(_0x709665,_0x2596cb){_0x709665=_0x709665-0x0;var _0x31ef83=_0xb10b[_0x709665];return _0x31ef83;};'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 b753513..c5745c7 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 _0x7bae=['../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','extname','now','upload','update','delete','exports','path','connect-timeout','Router','../../components/auth/service'];(function(_0x47d493,_0x3bedfb){var _0x50242a=function(_0x473bd6){while(--_0x473bd6){_0x47d493['push'](_0x47d493['shift']());}};_0x50242a(++_0x3bedfb);}(_0x7bae,0x13b));var _0xe7ba=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x7bae[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7ba('0x0'));var timeout=require(_0xe7ba('0x1'));var express=require('express');var router=express[_0xe7ba('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe7ba('0x3'));var interaction=require(_0xe7ba('0x4'));var config=require(_0xe7ba('0x5'));var controller=require(_0xe7ba('0x6'));router[_0xe7ba('0x7')]('/',auth[_0xe7ba('0x8')](),controller[_0xe7ba('0x9')]);router[_0xe7ba('0x7')](_0xe7ba('0xa'),controller[_0xe7ba('0xb')]);router[_0xe7ba('0x7')](_0xe7ba('0xc'),auth[_0xe7ba('0x8')](),controller[_0xe7ba('0xd')]);router['get'](_0xe7ba('0xe'),auth[_0xe7ba('0x8')](),controller[_0xe7ba('0xf')]);var upload=multer({'storage':multer[_0xe7ba('0x10')]({'destination':function(_0x15083a,_0x1672f0,_0x99a86f){_0x99a86f(null,path[_0xe7ba('0x11')](config[_0xe7ba('0x12')],'server/files/plugins'));},'filename':function(_0xf4fcb0,_0x588c8b,_0x602b1){_0x588c8b[_0xe7ba('0x13')]=_0x588c8b[_0xe7ba('0x13')][_0xe7ba('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x602b1(null,util[_0xe7ba('0x15')](_0xe7ba('0x16'),path['basename'](_0x588c8b['originalname'],path[_0xe7ba('0x17')](_0x588c8b[_0xe7ba('0x13')])),Date[_0xe7ba('0x18')](),path['extname'](_0x588c8b[_0xe7ba('0x13')])));}})});router['post']('/',upload['single']('file'),controller[_0xe7ba('0x19')]);router['post'](_0xe7ba('0xa'),controller['webhookPost']);router['put']('/:id',auth[_0xe7ba('0x8')](),controller[_0xe7ba('0x1a')]);router[_0xe7ba('0x1b')](_0xe7ba('0xc'),auth[_0xe7ba('0x8')](),controller['delete']);module[_0xe7ba('0x1c')]=router; \ No newline at end of file +var _0xdb94=['upload','webhookPost','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','index','get','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','single','file'];(function(_0x32bbdb,_0x4634db){var _0xe6a74b=function(_0x8cc3a0){while(--_0x8cc3a0){_0x32bbdb['push'](_0x32bbdb['shift']());}};_0xe6a74b(++_0x4634db);}(_0xdb94,0xe5));var _0x4db9=function(_0x2158d7,_0x32bff6){_0x2158d7=_0x2158d7-0x0;var _0x10f494=_0xdb94[_0x2158d7];return _0x10f494;};'use strict';var multer=require('multer');var util=require(_0x4db9('0x0'));var path=require(_0x4db9('0x1'));var timeout=require('connect-timeout');var express=require(_0x4db9('0x2'));var router=express[_0x4db9('0x3')]();var fs_extra=require(_0x4db9('0x4'));var auth=require(_0x4db9('0x5'));var interaction=require(_0x4db9('0x6'));var config=require('../../config/environment');var controller=require(_0x4db9('0x7'));router['get']('/',auth[_0x4db9('0x8')](),controller[_0x4db9('0x9')]);router[_0x4db9('0xa')](_0x4db9('0xb'),controller[_0x4db9('0xc')]);router['get'](_0x4db9('0xd'),auth[_0x4db9('0x8')](),controller[_0x4db9('0xe')]);router[_0x4db9('0xa')](_0x4db9('0xf'),auth['isAuthenticated'](),controller[_0x4db9('0x10')]);var upload=multer({'storage':multer[_0x4db9('0x11')]({'destination':function(_0x31f02d,_0xe6de11,_0x34147f){_0x34147f(null,path[_0x4db9('0x12')](config['root'],_0x4db9('0x13')));},'filename':function(_0x4397fc,_0x59f01c,_0x549c92){_0x59f01c[_0x4db9('0x14')]=_0x59f01c[_0x4db9('0x14')][_0x4db9('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x549c92(null,util['format'](_0x4db9('0x16'),path[_0x4db9('0x17')](_0x59f01c[_0x4db9('0x14')],path[_0x4db9('0x18')](_0x59f01c[_0x4db9('0x14')])),Date['now'](),path[_0x4db9('0x18')](_0x59f01c[_0x4db9('0x14')])));}})});router['post']('/',upload[_0x4db9('0x19')](_0x4db9('0x1a')),controller[_0x4db9('0x1b')]);router['post'](_0x4db9('0xb'),controller[_0x4db9('0x1c')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4db9('0x1d')]);router[_0x4db9('0x1e')]('/:id',auth[_0x4db9('0x8')](),controller[_0x4db9('0x1e')]);module[_0x4db9('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 91ba4c3..748fef8 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 _0xf3de=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','html','script','TEXT'];(function(_0x2cbb74,_0x241c10){var _0xa6d18=function(_0x5a2940){while(--_0x5a2940){_0x2cbb74['push'](_0x2cbb74['shift']());}};_0xa6d18(++_0x241c10);}(_0xf3de,0x16e));var _0xef3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3de[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xef3d('0x0')]={'name':{'type':Sequelize[_0xef3d('0x1')]},'type':{'type':Sequelize[_0xef3d('0x2')](_0xef3d('0x3'),_0xef3d('0x4'))},'description':{'type':Sequelize[_0xef3d('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xef3d('0x1')],'comment':_0xef3d('0x6')},'active':{'type':Sequelize[_0xef3d('0x7')],'defaultValue':0x0,'comment':_0xef3d('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0xef3d('0x9'),'agentOnly','always','never'),'defaultValue':_0xef3d('0xa'),'comment':_0xef3d('0xb')},'icon':{'type':Sequelize[_0xef3d('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xef3d('0x1')]}}; \ No newline at end of file +var _0x5736=['script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5736,0x95));var _0x6573=function(_0x5c101a,_0x5a08f4){_0x5c101a=_0x5c101a-0x0;var _0x538079=_0x5736[_0x5c101a];return _0x538079;};'use strict';var Sequelize=require(_0x6573('0x0'));module[_0x6573('0x1')]={'name':{'type':Sequelize[_0x6573('0x2')]},'type':{'type':Sequelize[_0x6573('0x3')](_0x6573('0x4'),_0x6573('0x5'))},'description':{'type':Sequelize[_0x6573('0x6')]},'version':{'type':Sequelize[_0x6573('0x6')]},'path':{'type':Sequelize[_0x6573('0x2')],'comment':_0x6573('0x7')},'active':{'type':Sequelize[_0x6573('0x8')],'defaultValue':0x0,'comment':_0x6573('0x9')},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0x6573('0xa'),_0x6573('0xb'),_0x6573('0xc')),'defaultValue':_0x6573('0xb'),'comment':_0x6573('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x6573('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 768ca73..3787a51 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 _0xd206=['basename','createWriteStream','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','node_modules/**/*','attachments/**/*','finalize','close','existsSync','download','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','file','chmodSync','0777','Invalid\x20plugin\x20structure','isFile','readdirSync','length','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','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','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','always','icon','plugins','test','Warning:\x20agent\x20view\x20not\x20specified','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','resolve','method','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','sort','where','pick','filter','merge','options','Plugin','includeAll','catch','show','params','include','find','path','join','root','server/files/plugins','format'];(function(_0x4bbb2f,_0x1d2540){var _0xd473a4=function(_0x3c6beb){while(--_0x3c6beb){_0x4bbb2f['push'](_0x4bbb2f['shift']());}};_0xd473a4(++_0x1d2540);}(_0xd206,0xfc));var _0x6d20=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xd206[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require(_0x6d20('0x0'));var rimraf=require(_0x6d20('0x1'));var zipdir=require(_0x6d20('0x2'));var jsonpatch=require(_0x6d20('0x3'));var rp=require(_0x6d20('0x4'));var moment=require(_0x6d20('0x5'));var BPromise=require(_0x6d20('0x6'));var Mustache=require('mustache');var util=require(_0x6d20('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6d20('0x8'));var ejs=require(_0x6d20('0x9'));var fs=require('fs');var fs_extra=require(_0x6d20('0xa'));var _=require(_0x6d20('0xb'));var squel=require(_0x6d20('0xc'));var crypto=require(_0x6d20('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6d20('0xe'));var toCsv=require(_0x6d20('0x8'));var querystring=require(_0x6d20('0xf'));var Papa=require(_0x6d20('0x10'));var extract=require(_0x6d20('0x11'));var rimraf=require(_0x6d20('0x1'));var archiver=require(_0x6d20('0x12'));var Redis=require(_0x6d20('0x13'));var authService=require(_0x6d20('0x14'));var qs=require(_0x6d20('0x15'));var as=require(_0x6d20('0x16'));var hardwareService=require(_0x6d20('0x17'));var logger=require('../../config/logger')(_0x6d20('0x18'));var utils=require(_0x6d20('0x19'));var config=require(_0x6d20('0x1a'));var licenseUtil=require(_0x6d20('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x6d20('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d20('0x1d'))(new Redis(config[_0x6d20('0x1c')]));require(_0x6d20('0x1e'))[_0x6d20('0x1f')](socket);function respondWithStatusCode(_0x1d41a9,_0x507c2b){_0x507c2b=_0x507c2b||0xcc;return function(_0x430ded){if(_0x430ded){return _0x1d41a9[_0x6d20('0x20')](_0x507c2b);}return _0x1d41a9[_0x6d20('0x21')](_0x507c2b)[_0x6d20('0x22')]();};}function respondWithResult(_0xbef24f,_0x50fbb0){_0x50fbb0=_0x50fbb0||0xc8;return function(_0x2bd765){if(_0x2bd765){return _0xbef24f[_0x6d20('0x21')](_0x50fbb0)[_0x6d20('0x23')](_0x2bd765);}};}function respondWithFilteredResult(_0x2d99f9,_0x36dd22){return function(_0xbf85c1){if(_0xbf85c1){var _0x3cd174=typeof _0x36dd22[_0x6d20('0x24')]===_0x6d20('0x25')&&typeof _0x36dd22[_0x6d20('0x26')]===_0x6d20('0x25');var _0x443cc5=_0xbf85c1[_0x6d20('0x27')];var _0x667f16=_0x3cd174?0x0:_0x36dd22[_0x6d20('0x24')];var _0x481e5f=_0x3cd174?_0xbf85c1[_0x6d20('0x27')]:_0x36dd22[_0x6d20('0x24')]+_0x36dd22[_0x6d20('0x26')];var _0x253489;if(_0x481e5f>=_0x443cc5){_0x481e5f=_0x443cc5;_0x253489=0xc8;}else{_0x253489=0xce;}_0x2d99f9[_0x6d20('0x21')](_0x253489);return _0x2d99f9[_0x6d20('0x28')]('Content-Range',_0x667f16+'-'+_0x481e5f+'/'+_0x443cc5)['json'](_0xbf85c1);}return null;};}function patchUpdates(_0x2ec315){return function(_0x485b9a){try{jsonpatch[_0x6d20('0x29')](_0x485b9a,_0x2ec315,!![]);}catch(_0x3feecc){return BPromise[_0x6d20('0x2a')](_0x3feecc);}return _0x485b9a[_0x6d20('0x2b')]();};}function saveUpdates(_0x2499b7,_0x17f4ae){return function(_0x4673e4){if(_0x4673e4){return _0x4673e4[_0x6d20('0x2c')](_0x2499b7)[_0x6d20('0x2d')](function(_0x5a4f64){return _0x5a4f64;});}return null;};}function removeEntity(_0x5d2005,_0x54f4b0){return function(_0x1bc2da){if(_0x1bc2da){return _0x1bc2da[_0x6d20('0x2e')]()[_0x6d20('0x2d')](function(){var _0x453771=_0x1bc2da[_0x6d20('0x2f')]({'plain':!![]});var _0x5eb079='Plugins';return db['UserProfileResource']['destroy']({'where':{'type':_0x5eb079,'resourceId':_0x453771['id']}})[_0x6d20('0x2d')](function(){return _0x1bc2da;});})[_0x6d20('0x2d')](function(){_0x5d2005[_0x6d20('0x21')](0xcc)[_0x6d20('0x22')]();});}};}function handleEntityNotFound(_0x3bb2bc,_0x1cbfa4){return function(_0x16d403){if(!_0x16d403){_0x3bb2bc[_0x6d20('0x20')](0x194);}return _0x16d403;};}function handleError(_0x2012a1,_0x191c6a){_0x191c6a=_0x191c6a||0x1f4;return function(_0x197636){logger[_0x6d20('0x30')](_0x197636[_0x6d20('0x31')]);if(_0x197636['name']){delete _0x197636[_0x6d20('0x32')];}_0x2012a1[_0x6d20('0x21')](_0x191c6a)[_0x6d20('0x33')](_0x197636);};}exports[_0x6d20('0x34')]=function(_0x52bb6a,_0x32c4b8){var _0x27c836={},_0x122a2d={},_0x110371={'count':0x0,'rows':[]};var _0x1352e3=_[_0x6d20('0x35')](db['Plugin'][_0x6d20('0x36')],function(_0xcfaa5c){return{'name':_0xcfaa5c['fieldName'],'type':_0xcfaa5c[_0x6d20('0x37')][_0x6d20('0x38')]};});_0x122a2d[_0x6d20('0x39')]=_['map'](_0x1352e3,_0x6d20('0x32'));_0x122a2d[_0x6d20('0x3a')]=_[_0x6d20('0x3b')](_0x52bb6a[_0x6d20('0x3a')]);_0x122a2d[_0x6d20('0x3c')]=_[_0x6d20('0x3d')](_0x122a2d[_0x6d20('0x39')],_0x122a2d[_0x6d20('0x3a')]);_0x27c836[_0x6d20('0x3e')]=_[_0x6d20('0x3d')](_0x122a2d[_0x6d20('0x39')],qs[_0x6d20('0x3f')](_0x52bb6a[_0x6d20('0x3a')][_0x6d20('0x3f')]));_0x27c836[_0x6d20('0x3e')]=_0x27c836['attributes']['length']?_0x27c836[_0x6d20('0x3e')]:_0x122a2d['model'];if(!_0x52bb6a[_0x6d20('0x3a')]['hasOwnProperty']('nolimit')){_0x27c836[_0x6d20('0x26')]=qs[_0x6d20('0x26')](_0x52bb6a['query'][_0x6d20('0x26')]);_0x27c836[_0x6d20('0x24')]=qs[_0x6d20('0x24')](_0x52bb6a['query'][_0x6d20('0x24')]);}_0x27c836['order']=qs['sort'](_0x52bb6a[_0x6d20('0x3a')][_0x6d20('0x40')]);_0x27c836[_0x6d20('0x41')]=qs['filters'](_[_0x6d20('0x42')](_0x52bb6a['query'],_0x122a2d[_0x6d20('0x3c')]),_0x1352e3);if(_0x52bb6a[_0x6d20('0x3a')][_0x6d20('0x43')]){_0x27c836[_0x6d20('0x41')]=_[_0x6d20('0x44')](_0x27c836[_0x6d20('0x41')],{'$or':_[_0x6d20('0x35')](_0x1352e3,function(_0x4a26df){if(_0x4a26df[_0x6d20('0x37')]!=='VIRTUAL'){var _0x16865c={};_0x16865c[_0x4a26df['name']]={'$like':'%'+_0x52bb6a['query']['filter']+'%'};return _0x16865c;}})});}_0x27c836=_[_0x6d20('0x44')]({},_0x27c836,_0x52bb6a[_0x6d20('0x45')]);var _0x2e6ecf={'where':_0x27c836[_0x6d20('0x41')]};return db[_0x6d20('0x46')][_0x6d20('0x27')](_0x2e6ecf)['then'](function(_0x4c0442){_0x110371[_0x6d20('0x27')]=_0x4c0442;if(_0x52bb6a[_0x6d20('0x3a')][_0x6d20('0x47')]){_0x27c836['include']=[{'all':!![]}];}return db['Plugin']['findAll'](_0x27c836);})[_0x6d20('0x2d')](function(_0x434f8e){_0x110371['rows']=_0x434f8e;return _0x110371;})['then'](respondWithFilteredResult(_0x32c4b8,_0x27c836))[_0x6d20('0x48')](handleError(_0x32c4b8,null));};exports[_0x6d20('0x49')]=function(_0x3efde1,_0x4eb3e6){var _0x51b5a4={'raw':!![],'where':{'id':_0x3efde1[_0x6d20('0x4a')]['id']}},_0x593fdf={};_0x593fdf[_0x6d20('0x39')]=_['keys'](db['Plugin'][_0x6d20('0x36')]);_0x593fdf[_0x6d20('0x3a')]=_['keys'](_0x3efde1['query']);_0x593fdf[_0x6d20('0x3c')]=_[_0x6d20('0x3d')](_0x593fdf[_0x6d20('0x39')],_0x593fdf[_0x6d20('0x3a')]);_0x51b5a4['attributes']=_['intersection'](_0x593fdf[_0x6d20('0x39')],qs[_0x6d20('0x3f')](_0x3efde1[_0x6d20('0x3a')][_0x6d20('0x3f')]));_0x51b5a4[_0x6d20('0x3e')]=_0x51b5a4[_0x6d20('0x3e')]['length']?_0x51b5a4[_0x6d20('0x3e')]:_0x593fdf[_0x6d20('0x39')];if(_0x3efde1['query']['includeAll']){_0x51b5a4[_0x6d20('0x4b')]=[{'all':!![]}];}_0x51b5a4=_[_0x6d20('0x44')]({},_0x51b5a4,_0x3efde1[_0x6d20('0x45')]);return db[_0x6d20('0x46')][_0x6d20('0x4c')](_0x51b5a4)[_0x6d20('0x2d')](handleEntityNotFound(_0x4eb3e6,null))[_0x6d20('0x2d')](respondWithResult(_0x4eb3e6,null))[_0x6d20('0x48')](handleError(_0x4eb3e6,null));};exports['download']=function(_0x4619e1,_0x353bca,_0x10235d){return db[_0x6d20('0x46')][_0x6d20('0x4c')]({'where':{'id':_0x4619e1['params']['id']},'attributes':[_0x6d20('0x32'),_0x6d20('0x4d')],'raw':!![]})[_0x6d20('0x2d')](handleEntityNotFound(_0x353bca,null))[_0x6d20('0x2d')](function(_0x1e31da){if(_0x1e31da){var _0x11864c=path[_0x6d20('0x4e')](config[_0x6d20('0x4f')],_0x6d20('0x50'),util[_0x6d20('0x51')]('%s.zip',path[_0x6d20('0x52')](_0x1e31da[_0x6d20('0x4d')])));var _0x2bf37b=fs[_0x6d20('0x53')](_0x11864c);var _0x314099=archiver('zip',{'zlib':{'level':0x9}});_0x314099['on']('warning',function(_0x1f251d){if(_0x1f251d[_0x6d20('0x54')]===_0x6d20('0x55')){logger[_0x6d20('0x30')](_0x1f251d);}else{throw new db[(_0x6d20('0x56'))]['Error'](_0x6d20('0x57'));}});_0x314099['on'](_0x6d20('0x30'),function(_0x2a5264){throw new db[(_0x6d20('0x56'))]['Error'](_0x6d20('0x57'));});_0x314099['pipe'](_0x2bf37b);_0x314099['glob'](_0x6d20('0x58'),{'cwd':path[_0x6d20('0x4e')](config[_0x6d20('0x4f')],_0x6d20('0x50'),path['dirname'](_0x1e31da[_0x6d20('0x4d')])),'ignore':[path['join'](path[_0x6d20('0x52')](_0x1e31da[_0x6d20('0x4d')]),_0x6d20('0x59')),path[_0x6d20('0x4e')](path[_0x6d20('0x52')](_0x1e31da[_0x6d20('0x4d')]),_0x6d20('0x5a'))],'nodir':!![]})[_0x6d20('0x5b')]();_0x2bf37b['on'](_0x6d20('0x5c'),function(){if(!fs[_0x6d20('0x5d')](_0x11864c)){throw new db[(_0x6d20('0x56'))]['Error']('Plugin\x20not\x20found');}return _0x353bca[_0x6d20('0x5e')](_0x11864c,util[_0x6d20('0x51')](_0x6d20('0x5f'),path[_0x6d20('0x52')](_0x1e31da[_0x6d20('0x4d')])),function(_0xbb55b6){if(_0xbb55b6){throw new db[(_0x6d20('0x56'))]['Error'](_0x6d20('0x60'));}fs[_0x6d20('0x61')](_0x11864c);logger[_0x6d20('0x62')](_0x6d20('0x63'));logger[_0x6d20('0x62')](_0x6d20('0x64'));});});}return null;})[_0x6d20('0x48')](handleError(_0x353bca,null));};exports[_0x6d20('0x65')]=function(_0x47ec44,_0x31aade,_0x206f60){var _0x136dae=path[_0x6d20('0x52')](_0x47ec44['file'][_0x6d20('0x66')],path['extname'](_0x47ec44[_0x6d20('0x67')][_0x6d20('0x66')]));var _0x30d9fc=path['join'](config[_0x6d20('0x4f')],'server/files/plugins',_0x47ec44[_0x6d20('0x67')][_0x6d20('0x66')]);var _0x4460d4=path[_0x6d20('0x4e')](config[_0x6d20('0x4f')],_0x6d20('0x50'),_0x136dae);logger[_0x6d20('0x62')]('Plugin\x20upload\x20filepath:\x20%s',_0x30d9fc);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0x4460d4);try{fs[_0x6d20('0x68')](_0x30d9fc,parseInt(_0x6d20('0x69'),0x8));extract(_0x30d9fc,{'dir':_0x4460d4},function(_0x2b69c5){if(_0x2b69c5){logger[_0x6d20('0x30')](_0x2b69c5);handleError(_0x2b69c5,!![]);};var _0xd5d43e=fs['readdirSync'](_0x4460d4);if(_0xd5d43e['length']>0x1){removeReferences(_0x30d9fc,_0x4460d4);logger[_0x6d20('0x30')](_0x6d20('0x6a'));return _0x206f60(new Error(_0x6d20('0x6a')));}var _0x485090=fs['lstatSync'](path[_0x6d20('0x4e')](_0x4460d4,_0xd5d43e[0x0]));if(_0x485090[_0x6d20('0x6b')]()){removeReferences(_0x30d9fc,_0x4460d4);logger[_0x6d20('0x30')](_0x6d20('0x6a'));return _0x206f60(new Error(_0x6d20('0x6a')));}if(_0x485090['isDirectory']()){var _0x4f3a1e=fs[_0x6d20('0x6c')](path[_0x6d20('0x4e')](_0x4460d4,_0xd5d43e[0x0]));if(_0x4f3a1e[_0x6d20('0x6d')]===0x0){removeReferences(_0x30d9fc,_0x4460d4);logger[_0x6d20('0x30')](_0x6d20('0x6a'));return _0x206f60(new Error(_0x6d20('0x6a')));}var _0x59f0a1=_0x4f3a1e[_0x6d20('0x6e')](function(_0x36cdfe){return _0x36cdfe===_0x6d20('0x6f');});if(!_0x59f0a1){return _0x206f60(new Error(_0x6d20('0x70')));}var _0x1655e2=fs[_0x6d20('0x71')](path[_0x6d20('0x4e')](_0x4460d4,_0xd5d43e[0x0],_0x6d20('0x6f')));var _0x4e35fa=JSON[_0x6d20('0x72')](_0x1655e2);if(_0x6d20('0x25')==typeof _0x4e35fa[_0x6d20('0x32')]){return _0x206f60(new Error(_0x6d20('0x73')));}if(_0x6d20('0x25')==typeof _0x4e35fa['type']){return _0x206f60(new Error(_0x6d20('0x74')));}if(_0x6d20('0x25')==typeof _0x4e35fa[_0x6d20('0x75')]){return _0x206f60(new Error(_0x6d20('0x76')));}if(_0x6d20('0x25')==typeof _0x4e35fa[_0x6d20('0x77')]){return _0x206f60(new Error(_0x6d20('0x78')));}if(_0x4e35fa[_0x6d20('0x37')]===_0x6d20('0x79')){if(_0x6d20('0x25')==typeof _0x4e35fa[_0x6d20('0x77')][_0x6d20('0x7a')]){return _0x206f60(new Error(_0x6d20('0x7b')));}if(_0x6d20('0x25')==typeof _0x4e35fa[_0x6d20('0x77')][_0x6d20('0x7a')][_0x6d20('0x7c')]&&_0x6d20('0x25')==typeof _0x4e35fa[_0x6d20('0x77')][_0x6d20('0x7a')][_0x6d20('0x7d')]){return _0x206f60(new Error(_0x6d20('0x7e')));}}else if(_0x4e35fa[_0x6d20('0x37')]===_0x6d20('0x7f')){if('undefined'==typeof _0x4e35fa[_0x6d20('0x77')][_0x6d20('0x80')]){return _0x206f60(new Error(_0x6d20('0x81')));}if(_0x6d20('0x25')==typeof _0x4e35fa['parameters'][_0x6d20('0x82')]){return _0x206f60(new Error(_0x6d20('0x83')));}}else{return _0x206f60(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x58462e=_0x4e35fa[_0x6d20('0x32')];var _0x73576f=_0x4e35fa['description'];var _0x10c09d=_0x4e35fa[_0x6d20('0x37')];var _0x4f2899=_0x4e35fa['sidebar']?_0x4e35fa[_0x6d20('0x84')]:_0x6d20('0x85');var _0x3e869f=_0x4e35fa[_0x6d20('0x86')]?_0x4e35fa[_0x6d20('0x86')]:'icon-apps';var _0x56d5c0='';var _0x1289db='';var _0x5158a7='';var _0x5aced3='';var _0x339e43=_0x4e35fa[_0x6d20('0x75')];if(_0x10c09d===_0x6d20('0x79')){if('undefined'!=typeof _0x4e35fa[_0x6d20('0x77')]['views'][_0x6d20('0x7c')]){var _0x2fc5ed=_0x4e35fa[_0x6d20('0x77')][_0x6d20('0x7a')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x2fc5ed)){_0x56d5c0=path[_0x6d20('0x4e')](_0x6d20('0x87'),_0x136dae,_0xd5d43e[0x0],_0x2fc5ed);}else{_0x56d5c0=_0x2fc5ed;}}else{logger[_0x6d20('0x62')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x4e35fa[_0x6d20('0x77')][_0x6d20('0x7a')][_0x6d20('0x7d')]){var _0x497866=_0x4e35fa[_0x6d20('0x77')][_0x6d20('0x7a')][_0x6d20('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x6d20('0x88')](_0x497866)){_0x1289db=path[_0x6d20('0x4e')](_0x6d20('0x87'),_0x136dae,_0xd5d43e[0x0],_0x497866);}else{_0x1289db=_0x497866;}}else{logger['info'](_0x6d20('0x89'));}}else if(_0x10c09d===_0x6d20('0x7f')){_0x5158a7=_0x4e35fa[_0x6d20('0x77')][_0x6d20('0x80')];_0x5aced3=_0x4e35fa[_0x6d20('0x77')][_0x6d20('0x82')];if('undefined'!=typeof _0x4e35fa['parameters'][_0x6d20('0x7a')]){if(_0x6d20('0x25')!=typeof _0x4e35fa[_0x6d20('0x77')][_0x6d20('0x7a')]['admin']){var _0x2fc5ed=_0x4e35fa['parameters']['views'][_0x6d20('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2fc5ed)){_0x56d5c0=path[_0x6d20('0x4e')](_0x6d20('0x87'),_0x136dae,_0xd5d43e[0x0],_0x2fc5ed);}else{_0x56d5c0=_0x2fc5ed;}}if('undefined'!=typeof _0x4e35fa[_0x6d20('0x77')]['views'][_0x6d20('0x7d')]){var _0x497866=_0x4e35fa['parameters']['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x6d20('0x88')](_0x497866)){_0x1289db=path[_0x6d20('0x4e')](_0x6d20('0x87'),_0x136dae,_0xd5d43e[0x0],_0x497866);}else{_0x1289db=_0x497866;}}}}var _0x184dba={'name':_0x58462e,'description':_0x73576f,'path':path[_0x6d20('0x4e')](_0x136dae,_0xd5d43e[0x0]),'type':_0x10c09d,'sidebar':_0x4f2899,'icon':_0x3e869f,'adminUrl':_0x56d5c0,'agentUrl':_0x1289db,'scriptName':_0x5158a7,'scriptPath':_0x5aced3,'version':_0x339e43};removeReferences(_0x30d9fc,null);return db['Plugin']['create'](_0x184dba)[_0x6d20('0x2d')](function(_0x3c2578){var _0xa589d7={'role':_0x47ec44['body'][_0x6d20('0x8a')],'userProfileId':_0x47ec44[_0x6d20('0x8b')][_0x6d20('0x8c')]};if(!_0xa589d7)throw new Error(_0x6d20('0x8d'));if(_0xa589d7[_0x6d20('0x8a')]===_0x6d20('0x8e')){var _0x5c2ea1=_0x3c2578[_0x6d20('0x2f')]({'plain':!![]});return db[_0x6d20('0x8f')]['find']({'where':{'name':_0x6d20('0x90'),'userProfileId':_0xa589d7[_0x6d20('0x8c')]},'raw':!![]})[_0x6d20('0x2d')](function(_0x2ce8b7){if(_0x2ce8b7&&_0x2ce8b7[_0x6d20('0x91')]===0x0){return db['UserProfileResource'][_0x6d20('0x92')]({'name':_0x5c2ea1[_0x6d20('0x32')],'resourceId':_0x5c2ea1['id'],'type':_0x2ce8b7[_0x6d20('0x32')],'sectionId':_0x2ce8b7['id']},{})['then'](function(){return _0x3c2578;});}else{return _0x3c2578;}})['catch'](function(_0x4fd525){logger['error'](_0x6d20('0x93'),_0x4fd525);throw _0x4fd525;});}return _0x3c2578;})[_0x6d20('0x2d')](respondWithResult(_0x31aade,null))[_0x6d20('0x48')](handleError(_0x31aade,null));}});}catch(_0xcc948c){_0x31aade[_0x6d20('0x21')](0x1f4)['send'](_0xcc948c);}};function removeReferences(_0x34e9c4,_0x1cb1ec){try{if(_0x34e9c4){fs[_0x6d20('0x61')](_0x34e9c4);logger[_0x6d20('0x62')](_0x6d20('0x94'));}if(_0x1cb1ec){rimraf(_0x1cb1ec,function(){});logger['info'](_0x6d20('0x95'));}}catch(_0x2022f3){logger[_0x6d20('0x30')](_0x2022f3);}}exports['update']=function(_0x559956,_0x2efd2b,_0x3865f5){return db['Plugin'][_0x6d20('0x4c')]({'where':{'id':_0x559956['params']['id']}})[_0x6d20('0x2d')](handleEntityNotFound(_0x2efd2b,null))[_0x6d20('0x2d')](saveUpdates(_0x559956[_0x6d20('0x8b')],null))['then'](respondWithResult(_0x2efd2b,null))[_0x6d20('0x48')](handleError(_0x2efd2b,null));};exports[_0x6d20('0x96')]=function(_0x31554e,_0x1c5f93,_0x4dbcc4){return db['Plugin']['find']({'where':{'id':_0x31554e[_0x6d20('0x4a')]['id']}})['then'](function(_0x4939f9){if(_0x4939f9){return _0x4939f9[_0x6d20('0x2e')]();}})[_0x6d20('0x2d')](function(_0xb6493a){rimraf(path['join'](config[_0x6d20('0x4f')],_0x6d20('0x50'),path[_0x6d20('0x97')](_0xb6493a[_0x6d20('0x4d')])),function(){});return _0xb6493a;})[_0x6d20('0x2d')](handleEntityNotFound(_0x1c5f93,null))['then'](respondWithStatusCode(_0x1c5f93,null))['catch'](handleError(_0x1c5f93,null));};exports[_0x6d20('0x98')]=function(_0x2f414b,_0x2bd897,_0x4a5321){return BPromise['resolve']()[_0x6d20('0x2d')](function(){if(!_0x2f414b[_0x6d20('0x3a')][_0x6d20('0x4d')]){throw new Error(_0x6d20('0x99'));}if(!_0x2f414b['query']['port']){throw new Error(_0x6d20('0x9a'));}var _0x338d1d=_0x2f414b[_0x6d20('0x3a')][_0x6d20('0x9b')]?_0x2f414b['query'][_0x6d20('0x9b')]+':'+_0x2f414b[_0x6d20('0x3a')][_0x6d20('0x9c')]:_0x6d20('0x9d')+_0x2f414b[_0x6d20('0x3a')][_0x6d20('0x9c')];var _0x1a222c=_0x2f414b[_0x6d20('0x3a')][_0x6d20('0x23')]?_0x2f414b[_0x6d20('0x3a')][_0x6d20('0x23')]:!![];var _0x47a7aa=_0x2f414b[_0x6d20('0x3a')][_0x6d20('0x9e')]?_0x2f414b['query'][_0x6d20('0x9e')]:null;var _0x393451={'method':_0x2f414b['method'],'uri':util['format'](_0x6d20('0x9f'),_0x338d1d,_0x2f414b['query'][_0x6d20('0x4d')]),'json':_0x1a222c,'resolveWithFullResponse':!![],'encoding':_0x47a7aa,'qs':_0x2f414b[_0x6d20('0x3a')]};if(_0x2f414b['headers']){_0x393451[_0x6d20('0xa0')]=_0x2f414b[_0x6d20('0xa0')];if(_0x393451[_0x6d20('0xa0')][_0x6d20('0xa1')]){delete _0x393451[_0x6d20('0xa0')]['content-length'];}}if(_0x393451[_0x6d20('0xa0')]['content-type']){delete _0x393451[_0x6d20('0xa0')][_0x6d20('0xa2')];}return rp(_0x393451);})[_0x6d20('0x2d')](function(_0xb3b8f3){if(_0xb3b8f3){_0x2bd897[_0x6d20('0x28')](_0xb3b8f3[_0x6d20('0xa0')]);logger[_0x6d20('0x62')](_0xb3b8f3[_0x6d20('0x8b')]);if(_[_0x6d20('0xa3')](_0x2f414b[_0x6d20('0x3a')][_0x6d20('0x4d')],_0x6d20('0x5e'))&&_0xb3b8f3[_0x6d20('0xa4')]==0x1f4){return _0x2bd897[_0x6d20('0x20')](_0xb3b8f3[_0x6d20('0xa4')]);}else{return _0x2bd897['status'](_0xb3b8f3[_0x6d20('0xa4')])[_0x6d20('0x33')](_0xb3b8f3[_0x6d20('0x8b')]);}}else{return _0x2bd897[_0x6d20('0x20')](0xc8);}})['catch'](handleError(_0x2bd897,null));};exports['webhookPost']=function(_0x1c17c4,_0xf4d766,_0xe9cc68){return BPromise[_0x6d20('0xa5')]()[_0x6d20('0x2d')](function(){if(!_0x1c17c4['query']['path']){throw new Error(_0x6d20('0x99'));}if(!_0x1c17c4[_0x6d20('0x3a')][_0x6d20('0x9c')]){throw new Error(_0x6d20('0x9a'));}var _0x166ab5=_0x1c17c4[_0x6d20('0x3a')]['hostname']?_0x1c17c4[_0x6d20('0x3a')]['hostname']+':'+_0x1c17c4['query'][_0x6d20('0x9c')]:'http://localhost:'+_0x1c17c4[_0x6d20('0x3a')][_0x6d20('0x9c')];var _0x43ee7a=_0x1c17c4[_0x6d20('0x3a')][_0x6d20('0x23')]?_0x1c17c4[_0x6d20('0x3a')][_0x6d20('0x23')]:!![];var _0x8b6759=_0x1c17c4[_0x6d20('0x3a')][_0x6d20('0x9e')]?_0x1c17c4[_0x6d20('0x3a')]['encoding']:null;var _0x5d0e37={'method':_0x1c17c4[_0x6d20('0xa6')],'uri':util[_0x6d20('0x51')]('%s%s',_0x166ab5,_0x1c17c4[_0x6d20('0x3a')][_0x6d20('0x4d')]),'json':_0x43ee7a,'resolveWithFullResponse':!![],'encoding':_0x8b6759,'body':_0x1c17c4['body']};if(_0x1c17c4[_0x6d20('0xa0')]){_0x5d0e37['headers']=_0x1c17c4[_0x6d20('0xa0')];if(_0x5d0e37[_0x6d20('0xa0')]['content-length']){delete _0x5d0e37[_0x6d20('0xa0')][_0x6d20('0xa1')];}}if(_0x5d0e37[_0x6d20('0xa0')][_0x6d20('0xa2')]){delete _0x5d0e37['headers'][_0x6d20('0xa2')];}return rp(_0x5d0e37);})[_0x6d20('0x2d')](function(_0x24abb5){if(_0x24abb5){_0xf4d766[_0x6d20('0x28')](_0x24abb5['headers']);logger['info'](_0x24abb5[_0x6d20('0x8b')]);return _0xf4d766['status'](_0x24abb5[_0x6d20('0xa4')])[_0x6d20('0x33')](_0x24abb5[_0x6d20('0x8b')]);}else{return _0xf4d766[_0x6d20('0x20')](0xc8);}})[_0x6d20('0x48')](handleError(_0xf4d766,null));}; \ No newline at end of file +var _0x37ab=['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','papaparse','extract-zip','archiver','../../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','register','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','get','Plugins','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','Plugin','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','join','root','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','server/files/plugins','dirname','attachments/**/*','finalize','close','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','error','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','Warning:\x20agent\x20view\x20not\x20specified','script','scriptPath','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','hostname','http://localhost:','port','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified'];(function(_0x2f370e,_0x5d76bc){var _0x48ff7c=function(_0x40c778){while(--_0x40c778){_0x2f370e['push'](_0x2f370e['shift']());}};_0x48ff7c(++_0x5d76bc);}(_0x37ab,0xb0));var _0xb37a=function(_0x40e41e,_0x3d30e7){_0x40e41e=_0x40e41e-0x0;var _0x18b70c=_0x37ab[_0x40e41e];return _0x18b70c;};'use strict';var emlformat=require(_0xb37a('0x0'));var rimraf=require(_0xb37a('0x1'));var zipdir=require(_0xb37a('0x2'));var jsonpatch=require(_0xb37a('0x3'));var rp=require(_0xb37a('0x4'));var moment=require(_0xb37a('0x5'));var BPromise=require(_0xb37a('0x6'));var Mustache=require('mustache');var util=require(_0xb37a('0x7'));var path=require(_0xb37a('0x8'));var sox=require('sox');var csv=require(_0xb37a('0x9'));var ejs=require(_0xb37a('0xa'));var fs=require('fs');var fs_extra=require(_0xb37a('0xb'));var _=require(_0xb37a('0xc'));var squel=require(_0xb37a('0xd'));var crypto=require(_0xb37a('0xe'));var jsforce=require(_0xb37a('0xf'));var deskjs=require(_0xb37a('0x10'));var toCsv=require(_0xb37a('0x9'));var querystring=require('querystring');var Papa=require(_0xb37a('0x11'));var extract=require(_0xb37a('0x12'));var rimraf=require('rimraf');var archiver=require(_0xb37a('0x13'));var Redis=require('ioredis');var authService=require(_0xb37a('0x14'));var qs=require(_0xb37a('0x15'));var as=require(_0xb37a('0x16'));var hardwareService=require(_0xb37a('0x17'));var logger=require(_0xb37a('0x18'))(_0xb37a('0x19'));var utils=require(_0xb37a('0x1a'));var config=require(_0xb37a('0x1b'));var licenseUtil=require(_0xb37a('0x1c'));var db=require(_0xb37a('0x1d'))['db'];config[_0xb37a('0x1e')]=_[_0xb37a('0x1f')](config[_0xb37a('0x1e')],{'host':_0xb37a('0x20'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')[_0xb37a('0x21')](socket);function respondWithStatusCode(_0xaff507,_0x20d595){_0x20d595=_0x20d595||0xcc;return function(_0x5a6139){if(_0x5a6139){return _0xaff507['sendStatus'](_0x20d595);}return _0xaff507[_0xb37a('0x22')](_0x20d595)['end']();};}function respondWithResult(_0x1fce54,_0x5f5b11){_0x5f5b11=_0x5f5b11||0xc8;return function(_0x3da97c){if(_0x3da97c){return _0x1fce54['status'](_0x5f5b11)[_0xb37a('0x23')](_0x3da97c);}};}function respondWithFilteredResult(_0x16bda4,_0x4b1f52){return function(_0x41911d){if(_0x41911d){var _0x3a5638=typeof _0x4b1f52[_0xb37a('0x24')]===_0xb37a('0x25')&&typeof _0x4b1f52[_0xb37a('0x26')]===_0xb37a('0x25');var _0x2701ee=_0x41911d['count'];var _0xc7242d=_0x3a5638?0x0:_0x4b1f52['offset'];var _0x42451b=_0x3a5638?_0x41911d['count']:_0x4b1f52[_0xb37a('0x24')]+_0x4b1f52['limit'];var _0x1d61a8;if(_0x42451b>=_0x2701ee){_0x42451b=_0x2701ee;_0x1d61a8=0xc8;}else{_0x1d61a8=0xce;}_0x16bda4[_0xb37a('0x22')](_0x1d61a8);return _0x16bda4[_0xb37a('0x27')](_0xb37a('0x28'),_0xc7242d+'-'+_0x42451b+'/'+_0x2701ee)['json'](_0x41911d);}return null;};}function patchUpdates(_0x2be61c){return function(_0x21aaf1){try{jsonpatch[_0xb37a('0x29')](_0x21aaf1,_0x2be61c,!![]);}catch(_0xaf0139){return BPromise['reject'](_0xaf0139);}return _0x21aaf1[_0xb37a('0x2a')]();};}function saveUpdates(_0x1b0c88,_0xca6d03){return function(_0x12f299){if(_0x12f299){return _0x12f299[_0xb37a('0x2b')](_0x1b0c88)[_0xb37a('0x2c')](function(_0x335966){return _0x335966;});}return null;};}function removeEntity(_0x2186b9,_0x37c55d){return function(_0x5aba25){if(_0x5aba25){return _0x5aba25['destroy']()['then'](function(){var _0x40820d=_0x5aba25[_0xb37a('0x2d')]({'plain':!![]});var _0x2e1d01=_0xb37a('0x2e');return db[_0xb37a('0x2f')][_0xb37a('0x30')]({'where':{'type':_0x2e1d01,'resourceId':_0x40820d['id']}})['then'](function(){return _0x5aba25;});})[_0xb37a('0x2c')](function(){_0x2186b9['status'](0xcc)[_0xb37a('0x31')]();});}};}function handleEntityNotFound(_0x413ae3,_0x5370dc){return function(_0x3f4e37){if(!_0x3f4e37){_0x413ae3[_0xb37a('0x32')](0x194);}return _0x3f4e37;};}function handleError(_0xc1523c,_0x1bc573){_0x1bc573=_0x1bc573||0x1f4;return function(_0x50037b){logger['error'](_0x50037b[_0xb37a('0x33')]);if(_0x50037b[_0xb37a('0x34')]){delete _0x50037b['name'];}_0xc1523c[_0xb37a('0x22')](_0x1bc573)[_0xb37a('0x35')](_0x50037b);};}exports[_0xb37a('0x36')]=function(_0x16abe1,_0x10e8b9){var _0x5b1ee2={},_0x597a11={},_0x1780f1={'count':0x0,'rows':[]};var _0x337d07=_[_0xb37a('0x37')](db[_0xb37a('0x38')]['rawAttributes'],function(_0x4ad077){return{'name':_0x4ad077['fieldName'],'type':_0x4ad077[_0xb37a('0x39')][_0xb37a('0x3a')]};});_0x597a11[_0xb37a('0x3b')]=_[_0xb37a('0x37')](_0x337d07,_0xb37a('0x34'));_0x597a11[_0xb37a('0x3c')]=_[_0xb37a('0x3d')](_0x16abe1['query']);_0x597a11[_0xb37a('0x3e')]=_['intersection'](_0x597a11[_0xb37a('0x3b')],_0x597a11['query']);_0x5b1ee2['attributes']=_[_0xb37a('0x3f')](_0x597a11[_0xb37a('0x3b')],qs['fields'](_0x16abe1['query'][_0xb37a('0x40')]));_0x5b1ee2[_0xb37a('0x41')]=_0x5b1ee2['attributes'][_0xb37a('0x42')]?_0x5b1ee2['attributes']:_0x597a11['model'];if(!_0x16abe1[_0xb37a('0x3c')]['hasOwnProperty']('nolimit')){_0x5b1ee2[_0xb37a('0x26')]=qs[_0xb37a('0x26')](_0x16abe1[_0xb37a('0x3c')]['limit']);_0x5b1ee2[_0xb37a('0x24')]=qs[_0xb37a('0x24')](_0x16abe1[_0xb37a('0x3c')]['offset']);}_0x5b1ee2[_0xb37a('0x43')]=qs[_0xb37a('0x44')](_0x16abe1[_0xb37a('0x3c')][_0xb37a('0x44')]);_0x5b1ee2[_0xb37a('0x45')]=qs[_0xb37a('0x3e')](_[_0xb37a('0x46')](_0x16abe1[_0xb37a('0x3c')],_0x597a11[_0xb37a('0x3e')]),_0x337d07);if(_0x16abe1[_0xb37a('0x3c')]['filter']){_0x5b1ee2[_0xb37a('0x45')]=_[_0xb37a('0x47')](_0x5b1ee2['where'],{'$or':_[_0xb37a('0x37')](_0x337d07,function(_0x5af78e){if(_0x5af78e[_0xb37a('0x39')]!==_0xb37a('0x48')){var _0x124633={};_0x124633[_0x5af78e[_0xb37a('0x34')]]={'$like':'%'+_0x16abe1[_0xb37a('0x3c')][_0xb37a('0x49')]+'%'};return _0x124633;}})});}_0x5b1ee2=_['merge']({},_0x5b1ee2,_0x16abe1[_0xb37a('0x4a')]);var _0x478ef7={'where':_0x5b1ee2[_0xb37a('0x45')]};return db[_0xb37a('0x38')][_0xb37a('0x4b')](_0x478ef7)[_0xb37a('0x2c')](function(_0x3a3a3c){_0x1780f1['count']=_0x3a3a3c;if(_0x16abe1[_0xb37a('0x3c')][_0xb37a('0x4c')]){_0x5b1ee2[_0xb37a('0x4d')]=[{'all':!![]}];}return db['Plugin'][_0xb37a('0x4e')](_0x5b1ee2);})[_0xb37a('0x2c')](function(_0x578f2b){_0x1780f1[_0xb37a('0x4f')]=_0x578f2b;return _0x1780f1;})[_0xb37a('0x2c')](respondWithFilteredResult(_0x10e8b9,_0x5b1ee2))[_0xb37a('0x50')](handleError(_0x10e8b9,null));};exports[_0xb37a('0x51')]=function(_0x42ddfd,_0x27bae5){var _0x3a6d09={'raw':!![],'where':{'id':_0x42ddfd[_0xb37a('0x52')]['id']}},_0x27db7={};_0x27db7[_0xb37a('0x3b')]=_[_0xb37a('0x3d')](db[_0xb37a('0x38')][_0xb37a('0x53')]);_0x27db7[_0xb37a('0x3c')]=_[_0xb37a('0x3d')](_0x42ddfd[_0xb37a('0x3c')]);_0x27db7[_0xb37a('0x3e')]=_[_0xb37a('0x3f')](_0x27db7['model'],_0x27db7['query']);_0x3a6d09[_0xb37a('0x41')]=_[_0xb37a('0x3f')](_0x27db7[_0xb37a('0x3b')],qs['fields'](_0x42ddfd[_0xb37a('0x3c')][_0xb37a('0x40')]));_0x3a6d09[_0xb37a('0x41')]=_0x3a6d09[_0xb37a('0x41')][_0xb37a('0x42')]?_0x3a6d09[_0xb37a('0x41')]:_0x27db7['model'];if(_0x42ddfd[_0xb37a('0x3c')][_0xb37a('0x4c')]){_0x3a6d09[_0xb37a('0x4d')]=[{'all':!![]}];}_0x3a6d09=_[_0xb37a('0x47')]({},_0x3a6d09,_0x42ddfd[_0xb37a('0x4a')]);return db[_0xb37a('0x38')][_0xb37a('0x54')](_0x3a6d09)[_0xb37a('0x2c')](handleEntityNotFound(_0x27bae5,null))['then'](respondWithResult(_0x27bae5,null))[_0xb37a('0x50')](handleError(_0x27bae5,null));};exports['download']=function(_0x18daf1,_0x114338,_0x3df573){return db[_0xb37a('0x38')][_0xb37a('0x54')]({'where':{'id':_0x18daf1[_0xb37a('0x52')]['id']},'attributes':[_0xb37a('0x34'),_0xb37a('0x8')],'raw':!![]})['then'](handleEntityNotFound(_0x114338,null))[_0xb37a('0x2c')](function(_0x550aec){if(_0x550aec){var _0x52d1cd=path[_0xb37a('0x55')](config[_0xb37a('0x56')],'server/files/plugins',util[_0xb37a('0x57')](_0xb37a('0x58'),path[_0xb37a('0x59')](_0x550aec[_0xb37a('0x8')])));var _0x131045=fs[_0xb37a('0x5a')](_0x52d1cd);var _0x12040b=archiver(_0xb37a('0x5b'),{'zlib':{'level':0x9}});_0x12040b['on'](_0xb37a('0x5c'),function(_0x1c3f1b){if(_0x1c3f1b[_0xb37a('0x5d')]===_0xb37a('0x5e')){logger['error'](_0x1c3f1b);}else{throw new db[(_0xb37a('0x5f'))][(_0xb37a('0x60'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x12040b['on']('error',function(_0xb53403){throw new db[(_0xb37a('0x5f'))][(_0xb37a('0x60'))](_0xb37a('0x61'));});_0x12040b['pipe'](_0x131045);_0x12040b[_0xb37a('0x62')](_0xb37a('0x63'),{'cwd':path[_0xb37a('0x55')](config[_0xb37a('0x56')],_0xb37a('0x64'),path[_0xb37a('0x65')](_0x550aec[_0xb37a('0x8')])),'ignore':[path[_0xb37a('0x55')](path[_0xb37a('0x59')](_0x550aec[_0xb37a('0x8')]),'node_modules/**/*'),path[_0xb37a('0x55')](path[_0xb37a('0x59')](_0x550aec[_0xb37a('0x8')]),_0xb37a('0x66'))],'nodir':!![]})[_0xb37a('0x67')]();_0x131045['on'](_0xb37a('0x68'),function(){if(!fs['existsSync'](_0x52d1cd)){throw new db['Sequelize'][(_0xb37a('0x60'))](_0xb37a('0x69'));}return _0x114338[_0xb37a('0x6a')](_0x52d1cd,util[_0xb37a('0x57')]('%s.zip',path[_0xb37a('0x59')](_0x550aec[_0xb37a('0x8')])),function(_0x37c436){if(_0x37c436){throw new db['Sequelize'][(_0xb37a('0x60'))](_0xb37a('0x6b'));}fs[_0xb37a('0x6c')](_0x52d1cd);logger[_0xb37a('0x6d')](_0xb37a('0x6e'));logger[_0xb37a('0x6d')]('Temporary\x20file\x20removed');});});}return null;})[_0xb37a('0x50')](handleError(_0x114338,null));};exports[_0xb37a('0x6f')]=function(_0x2dd1ed,_0x4b0699,_0x1c2fb2){var _0x1a7f29=path['basename'](_0x2dd1ed[_0xb37a('0x70')][_0xb37a('0x71')],path['extname'](_0x2dd1ed[_0xb37a('0x70')]['filename']));var _0xae5ae2=path[_0xb37a('0x55')](config[_0xb37a('0x56')],_0xb37a('0x64'),_0x2dd1ed[_0xb37a('0x70')][_0xb37a('0x71')]);var _0x12c3d7=path[_0xb37a('0x55')](config['root'],_0xb37a('0x64'),_0x1a7f29);logger[_0xb37a('0x6d')]('Plugin\x20upload\x20filepath:\x20%s',_0xae5ae2);logger['info'](_0xb37a('0x72'),_0x12c3d7);try{fs[_0xb37a('0x73')](_0xae5ae2,parseInt(_0xb37a('0x74'),0x8));extract(_0xae5ae2,{'dir':_0x12c3d7},function(_0x4c13b6){if(_0x4c13b6){logger[_0xb37a('0x75')](_0x4c13b6);handleError(_0x4c13b6,!![]);};var _0x43aad3=fs[_0xb37a('0x76')](_0x12c3d7);if(_0x43aad3['length']>0x1){removeReferences(_0xae5ae2,_0x12c3d7);logger[_0xb37a('0x75')](_0xb37a('0x77'));return _0x1c2fb2(new Error('Invalid\x20plugin\x20structure'));}var _0x2c27f5=fs[_0xb37a('0x78')](path['join'](_0x12c3d7,_0x43aad3[0x0]));if(_0x2c27f5['isFile']()){removeReferences(_0xae5ae2,_0x12c3d7);logger[_0xb37a('0x75')](_0xb37a('0x77'));return _0x1c2fb2(new Error(_0xb37a('0x77')));}if(_0x2c27f5[_0xb37a('0x79')]()){var _0x32679c=fs[_0xb37a('0x76')](path[_0xb37a('0x55')](_0x12c3d7,_0x43aad3[0x0]));if(_0x32679c[_0xb37a('0x42')]===0x0){removeReferences(_0xae5ae2,_0x12c3d7);logger[_0xb37a('0x75')](_0xb37a('0x77'));return _0x1c2fb2(new Error('Invalid\x20plugin\x20structure'));}var _0x19a587=_0x32679c['some'](function(_0x3a3616){return _0x3a3616==='manifest.json';});if(!_0x19a587){return _0x1c2fb2(new Error(_0xb37a('0x7a')));}var _0x21db4a=fs['readFileSync'](path[_0xb37a('0x55')](_0x12c3d7,_0x43aad3[0x0],'manifest.json'));var _0x471eb0=JSON[_0xb37a('0x7b')](_0x21db4a);if(_0xb37a('0x25')==typeof _0x471eb0['name']){return _0x1c2fb2(new Error(_0xb37a('0x7c')));}if(_0xb37a('0x25')==typeof _0x471eb0[_0xb37a('0x39')]){return _0x1c2fb2(new Error(_0xb37a('0x7d')));}if(_0xb37a('0x25')==typeof _0x471eb0[_0xb37a('0x7e')]){return _0x1c2fb2(new Error(_0xb37a('0x7f')));}if(_0xb37a('0x25')==typeof _0x471eb0[_0xb37a('0x80')]){return _0x1c2fb2(new Error(_0xb37a('0x81')));}if(_0x471eb0[_0xb37a('0x39')]===_0xb37a('0x82')){if('undefined'==typeof _0x471eb0[_0xb37a('0x80')][_0xb37a('0x83')]){return _0x1c2fb2(new Error(_0xb37a('0x84')));}if('undefined'==typeof _0x471eb0[_0xb37a('0x80')][_0xb37a('0x83')][_0xb37a('0x85')]&&'undefined'==typeof _0x471eb0[_0xb37a('0x80')]['views']['agent']){return _0x1c2fb2(new Error(_0xb37a('0x86')));}}else if(_0x471eb0[_0xb37a('0x39')]==='script'){if(_0xb37a('0x25')==typeof _0x471eb0[_0xb37a('0x80')][_0xb37a('0x87')]){return _0x1c2fb2(new Error(_0xb37a('0x88')));}if(_0xb37a('0x25')==typeof _0x471eb0[_0xb37a('0x80')]['scriptPath']){return _0x1c2fb2(new Error(_0xb37a('0x89')));}}else{return _0x1c2fb2(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x508f14=_0x471eb0[_0xb37a('0x34')];var _0x46fb36=_0x471eb0[_0xb37a('0x8a')];var _0x478256=_0x471eb0[_0xb37a('0x39')];var _0x5539a7=_0x471eb0['sidebar']?_0x471eb0[_0xb37a('0x8b')]:_0xb37a('0x8c');var _0x2d6f31=_0x471eb0[_0xb37a('0x8d')]?_0x471eb0['icon']:_0xb37a('0x8e');var _0x26db7e='';var _0x54e49a='';var _0x511fb4='';var _0x2bcc96='';var _0x3191be=_0x471eb0[_0xb37a('0x7e')];if(_0x478256===_0xb37a('0x82')){if(_0xb37a('0x25')!=typeof _0x471eb0[_0xb37a('0x80')][_0xb37a('0x83')][_0xb37a('0x85')]){var _0x4808d4=_0x471eb0[_0xb37a('0x80')]['views'][_0xb37a('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4808d4)){_0x26db7e=path['join'](_0xb37a('0x8f'),_0x1a7f29,_0x43aad3[0x0],_0x4808d4);}else{_0x26db7e=_0x4808d4;}}else{logger[_0xb37a('0x6d')](_0xb37a('0x90'));}if('undefined'!=typeof _0x471eb0[_0xb37a('0x80')]['views']['agent']){var _0x54deb5=_0x471eb0['parameters'][_0xb37a('0x83')][_0xb37a('0x91')];if(!/^(f|ht)tps?:\/\//i[_0xb37a('0x92')](_0x54deb5)){_0x54e49a=path['join'](_0xb37a('0x8f'),_0x1a7f29,_0x43aad3[0x0],_0x54deb5);}else{_0x54e49a=_0x54deb5;}}else{logger['info'](_0xb37a('0x93'));}}else if(_0x478256===_0xb37a('0x94')){_0x511fb4=_0x471eb0[_0xb37a('0x80')][_0xb37a('0x87')];_0x2bcc96=_0x471eb0[_0xb37a('0x80')][_0xb37a('0x95')];if(_0xb37a('0x25')!=typeof _0x471eb0['parameters']['views']){if(_0xb37a('0x25')!=typeof _0x471eb0['parameters'][_0xb37a('0x83')][_0xb37a('0x85')]){var _0x4808d4=_0x471eb0['parameters'][_0xb37a('0x83')][_0xb37a('0x85')];if(!/^(f|ht)tps?:\/\//i[_0xb37a('0x92')](_0x4808d4)){_0x26db7e=path[_0xb37a('0x55')](_0xb37a('0x8f'),_0x1a7f29,_0x43aad3[0x0],_0x4808d4);}else{_0x26db7e=_0x4808d4;}}if(_0xb37a('0x25')!=typeof _0x471eb0[_0xb37a('0x80')][_0xb37a('0x83')][_0xb37a('0x91')]){var _0x54deb5=_0x471eb0[_0xb37a('0x80')][_0xb37a('0x83')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xb37a('0x92')](_0x54deb5)){_0x54e49a=path[_0xb37a('0x55')](_0xb37a('0x8f'),_0x1a7f29,_0x43aad3[0x0],_0x54deb5);}else{_0x54e49a=_0x54deb5;}}}}var _0x1fe7a1={'name':_0x508f14,'description':_0x46fb36,'path':path['join'](_0x1a7f29,_0x43aad3[0x0]),'type':_0x478256,'sidebar':_0x5539a7,'icon':_0x2d6f31,'adminUrl':_0x26db7e,'agentUrl':_0x54e49a,'scriptName':_0x511fb4,'scriptPath':_0x2bcc96,'version':_0x3191be};removeReferences(_0xae5ae2,null);return db[_0xb37a('0x38')][_0xb37a('0x96')](_0x1fe7a1)[_0xb37a('0x2c')](function(_0x118935){var _0x492aa4={'role':_0x2dd1ed[_0xb37a('0x97')][_0xb37a('0x98')],'userProfileId':_0x2dd1ed[_0xb37a('0x97')][_0xb37a('0x99')]};if(!_0x492aa4)throw new Error(_0xb37a('0x9a'));if(_0x492aa4['role']===_0xb37a('0x9b')){var _0x24bacf=_0x118935[_0xb37a('0x2d')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xb37a('0x2e'),'userProfileId':_0x492aa4['userProfileId']},'raw':!![]})[_0xb37a('0x2c')](function(_0x1245a4){if(_0x1245a4&&_0x1245a4[_0xb37a('0x9c')]===0x0){return db['UserProfileResource'][_0xb37a('0x96')]({'name':_0x24bacf[_0xb37a('0x34')],'resourceId':_0x24bacf['id'],'type':_0x1245a4[_0xb37a('0x34')],'sectionId':_0x1245a4['id']},{})['then'](function(){return _0x118935;});}else{return _0x118935;}})[_0xb37a('0x50')](function(_0x1b8c91){logger[_0xb37a('0x75')](_0xb37a('0x9d'),_0x1b8c91);throw _0x1b8c91;});}return _0x118935;})['then'](respondWithResult(_0x4b0699,null))[_0xb37a('0x50')](handleError(_0x4b0699,null));}});}catch(_0x1bb266){_0x4b0699[_0xb37a('0x22')](0x1f4)[_0xb37a('0x35')](_0x1bb266);}};function removeReferences(_0x11e1f9,_0x108844){try{if(_0x11e1f9){fs[_0xb37a('0x6c')](_0x11e1f9);logger[_0xb37a('0x6d')](_0xb37a('0x9e'));}if(_0x108844){rimraf(_0x108844,function(){});logger['info'](_0xb37a('0x9f'));}}catch(_0x5f37ec){logger[_0xb37a('0x75')](_0x5f37ec);}}exports[_0xb37a('0x2b')]=function(_0x1eb7e3,_0x25d280,_0xc8f155){return db['Plugin'][_0xb37a('0x54')]({'where':{'id':_0x1eb7e3[_0xb37a('0x52')]['id']}})[_0xb37a('0x2c')](handleEntityNotFound(_0x25d280,null))[_0xb37a('0x2c')](saveUpdates(_0x1eb7e3[_0xb37a('0x97')],null))[_0xb37a('0x2c')](respondWithResult(_0x25d280,null))[_0xb37a('0x50')](handleError(_0x25d280,null));};exports[_0xb37a('0xa0')]=function(_0xe70d76,_0x1bc735,_0x5dc79e){return db[_0xb37a('0x38')][_0xb37a('0x54')]({'where':{'id':_0xe70d76[_0xb37a('0x52')]['id']}})[_0xb37a('0x2c')](function(_0x38280c){if(_0x38280c){return _0x38280c[_0xb37a('0x30')]();}})[_0xb37a('0x2c')](function(_0x9ecad8){rimraf(path[_0xb37a('0x55')](config[_0xb37a('0x56')],_0xb37a('0x64'),path[_0xb37a('0x65')](_0x9ecad8[_0xb37a('0x8')])),function(){});return _0x9ecad8;})['then'](handleEntityNotFound(_0x1bc735,null))[_0xb37a('0x2c')](respondWithStatusCode(_0x1bc735,null))[_0xb37a('0x50')](handleError(_0x1bc735,null));};exports[_0xb37a('0xa1')]=function(_0x31c943,_0x4c886c,_0x65a7e2){return BPromise[_0xb37a('0xa2')]()['then'](function(){if(!_0x31c943[_0xb37a('0x3c')][_0xb37a('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x31c943[_0xb37a('0x3c')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x46fe0f=_0x31c943[_0xb37a('0x3c')][_0xb37a('0xa3')]?_0x31c943['query'][_0xb37a('0xa3')]+':'+_0x31c943[_0xb37a('0x3c')]['port']:_0xb37a('0xa4')+_0x31c943[_0xb37a('0x3c')][_0xb37a('0xa5')];var _0x1583a2=_0x31c943[_0xb37a('0x3c')][_0xb37a('0x23')]?_0x31c943['query'][_0xb37a('0x23')]:!![];var _0x10c3da=_0x31c943[_0xb37a('0x3c')][_0xb37a('0xa6')]?_0x31c943[_0xb37a('0x3c')][_0xb37a('0xa6')]:null;var _0x124351={'method':_0x31c943[_0xb37a('0xa7')],'uri':util['format'](_0xb37a('0xa8'),_0x46fe0f,_0x31c943[_0xb37a('0x3c')][_0xb37a('0x8')]),'json':_0x1583a2,'resolveWithFullResponse':!![],'encoding':_0x10c3da,'qs':_0x31c943['query']};if(_0x31c943[_0xb37a('0xa9')]){_0x124351['headers']=_0x31c943['headers'];if(_0x124351[_0xb37a('0xa9')][_0xb37a('0xaa')]){delete _0x124351[_0xb37a('0xa9')]['content-length'];}}if(_0x124351[_0xb37a('0xa9')][_0xb37a('0xab')]){delete _0x124351[_0xb37a('0xa9')]['content-type'];}return rp(_0x124351);})[_0xb37a('0x2c')](function(_0x17d0ac){if(_0x17d0ac){_0x4c886c[_0xb37a('0x27')](_0x17d0ac[_0xb37a('0xa9')]);logger[_0xb37a('0x6d')](_0x17d0ac[_0xb37a('0x97')]);if(_[_0xb37a('0xac')](_0x31c943[_0xb37a('0x3c')][_0xb37a('0x8')],_0xb37a('0x6a'))&&_0x17d0ac['statusCode']==0x1f4){return _0x4c886c[_0xb37a('0x32')](_0x17d0ac['statusCode']);}else{return _0x4c886c['status'](_0x17d0ac[_0xb37a('0xad')])[_0xb37a('0x35')](_0x17d0ac[_0xb37a('0x97')]);}}else{return _0x4c886c[_0xb37a('0x32')](0xc8);}})[_0xb37a('0x50')](handleError(_0x4c886c,null));};exports[_0xb37a('0xae')]=function(_0x4f831e,_0x3a35b8,_0x4937d4){return BPromise[_0xb37a('0xa2')]()[_0xb37a('0x2c')](function(){if(!_0x4f831e['query'][_0xb37a('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x4f831e[_0xb37a('0x3c')][_0xb37a('0xa5')]){throw new Error(_0xb37a('0xaf'));}var _0xf62da2=_0x4f831e['query']['hostname']?_0x4f831e['query'][_0xb37a('0xa3')]+':'+_0x4f831e['query'][_0xb37a('0xa5')]:'http://localhost:'+_0x4f831e[_0xb37a('0x3c')][_0xb37a('0xa5')];var _0x4f31b0=_0x4f831e[_0xb37a('0x3c')][_0xb37a('0x23')]?_0x4f831e['query'][_0xb37a('0x23')]:!![];var _0xebb09c=_0x4f831e[_0xb37a('0x3c')][_0xb37a('0xa6')]?_0x4f831e[_0xb37a('0x3c')][_0xb37a('0xa6')]:null;var _0x587122={'method':_0x4f831e[_0xb37a('0xa7')],'uri':util['format'](_0xb37a('0xa8'),_0xf62da2,_0x4f831e['query'][_0xb37a('0x8')]),'json':_0x4f31b0,'resolveWithFullResponse':!![],'encoding':_0xebb09c,'body':_0x4f831e[_0xb37a('0x97')]};if(_0x4f831e[_0xb37a('0xa9')]){_0x587122[_0xb37a('0xa9')]=_0x4f831e['headers'];if(_0x587122[_0xb37a('0xa9')]['content-length']){delete _0x587122[_0xb37a('0xa9')][_0xb37a('0xaa')];}}if(_0x587122[_0xb37a('0xa9')][_0xb37a('0xab')]){delete _0x587122['headers'][_0xb37a('0xab')];}return rp(_0x587122);})['then'](function(_0x771fc7){if(_0x771fc7){_0x3a35b8['set'](_0x771fc7['headers']);logger[_0xb37a('0x6d')](_0x771fc7[_0xb37a('0x97')]);return _0x3a35b8[_0xb37a('0x22')](_0x771fc7[_0xb37a('0xad')])[_0xb37a('0x35')](_0x771fc7[_0xb37a('0x97')]);}else{return _0x3a35b8[_0xb37a('0x32')](0xc8);}})[_0xb37a('0x50')](handleError(_0x3a35b8,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index ffe2a96..eccbbc1 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 _0xb0df=['save','update','remove','emit','exports','../../mysqldb','Plugin','setMaxListeners'];(function(_0xea343d,_0x311197){var _0x2c6e9c=function(_0x454bd6){while(--_0x454bd6){_0xea343d['push'](_0xea343d['shift']());}};_0x2c6e9c(++_0x311197);}(_0xb0df,0x85));var _0xfb0d=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0xb0df[_0x25bca6];return _0x3f8d02;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xfb0d('0x0'))['db'][_0xfb0d('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xfb0d('0x2')](0x0);var events={'afterCreate':_0xfb0d('0x3'),'afterUpdate':_0xfb0d('0x4'),'afterDestroy':_0xfb0d('0x5')};function emitEvent(_0x215177){return function(_0x823ea6,_0x3348e0,_0x4ff814){PluginEvents[_0xfb0d('0x6')](_0x215177+':'+_0x823ea6['id'],_0x823ea6);PluginEvents[_0xfb0d('0x6')](_0x215177,_0x823ea6);_0x4ff814(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xfb0d('0x7')]=PluginEvents; \ No newline at end of file +var _0xd206=['save','update','emit','exports','events','../../mysqldb','setMaxListeners'];(function(_0xcd2f6e,_0x450a32){var _0x4cc977=function(_0x3ece73){while(--_0x3ece73){_0xcd2f6e['push'](_0xcd2f6e['shift']());}};_0x4cc977(++_0x450a32);}(_0xd206,0x107));var _0x6d20=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xd206[_0x39e84d];return _0x1991bc;};'use strict';var EventEmitter=require(_0x6d20('0x0'));var Plugin=require(_0x6d20('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x6d20('0x2')](0x0);var events={'afterCreate':_0x6d20('0x3'),'afterUpdate':_0x6d20('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c6c6a){return function(_0x28bc49,_0x243da3,_0x3acacb){PluginEvents['emit'](_0x5c6c6a+':'+_0x28bc49['id'],_0x28bc49);PluginEvents[_0x6d20('0x5')](_0x5c6c6a,_0x28bc49);_0x3acacb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x6d20('0x6')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 8321e65..959c89c 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 _0x39b1=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./plugin.attributes','exports','Plugin'];(function(_0x527a4a,_0xb42b0c){var _0x4b60bd=function(_0x108a99){while(--_0x108a99){_0x527a4a['push'](_0x527a4a['shift']());}};_0x4b60bd(++_0xb42b0c);}(_0x39b1,0x1a2));var _0x139b=function(_0x2a3fc2,_0x1a9c65){_0x2a3fc2=_0x2a3fc2-0x0;var _0x311b0a=_0x39b1[_0x2a3fc2];return _0x311b0a;};'use strict';var _=require(_0x139b('0x0'));var util=require('util');var logger=require(_0x139b('0x1'))(_0x139b('0x2'));var moment=require(_0x139b('0x3'));var BPromise=require(_0x139b('0x4'));var rp=require(_0x139b('0x5'));var fs=require('fs');var path=require(_0x139b('0x6'));var rimraf=require('rimraf');var config=require(_0x139b('0x7'));var attributes=require(_0x139b('0x8'));module[_0x139b('0x9')]=function(_0x37183e,_0x2cf118){return _0x37183e['define'](_0x139b('0xa'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfebc=['Plugin','plugins','lodash','moment','bluebird','request-promise','path','../../config/environment','./plugin.attributes','exports','define'];(function(_0x16a903,_0x512805){var _0x4d58f2=function(_0x260027){while(--_0x260027){_0x16a903['push'](_0x16a903['shift']());}};_0x4d58f2(++_0x512805);}(_0xfebc,0x16d));var _0xcfeb=function(_0x513eca,_0x593007){_0x513eca=_0x513eca-0x0;var _0x2c4e0b=_0xfebc[_0x513eca];return _0x2c4e0b;};'use strict';var _=require(_0xcfeb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcfeb('0x1'));var BPromise=require(_0xcfeb('0x2'));var rp=require(_0xcfeb('0x3'));var fs=require('fs');var path=require(_0xcfeb('0x4'));var rimraf=require('rimraf');var config=require(_0xcfeb('0x5'));var attributes=require(_0xcfeb('0x6'));module[_0xcfeb('0x7')]=function(_0x2ca787,_0x1d8158){return _0x2ca787[_0xcfeb('0x8')](_0xcfeb('0x9'),attributes,{'tableName':_0xcfeb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 0b3056d..f2919ed 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 _0xe597=['stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','then','info','request\x20sent','error','code','message','Plugin,\x20%s,\x20%s','catch','CreatePlugin','create','options','debug'];(function(_0x13fdb1,_0x1c6fba){var _0x55f710=function(_0x3b0f2b){while(--_0x3b0f2b){_0x13fdb1['push'](_0x13fdb1['shift']());}};_0x55f710(++_0x1c6fba);}(_0xe597,0x1e1));var _0x7e59=function(_0x29b9e7,_0x358c95){_0x29b9e7=_0x29b9e7-0x0;var _0xc99127=_0xe597[_0x29b9e7];return _0xc99127;};'use strict';var _=require(_0x7e59('0x0'));var util=require(_0x7e59('0x1'));var moment=require(_0x7e59('0x2'));var BPromise=require(_0x7e59('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e59('0x4'));var db=require(_0x7e59('0x5'))['db'];var utils=require(_0x7e59('0x6'));var logger=require(_0x7e59('0x7'))(_0x7e59('0x8'));var config=require(_0x7e59('0x9'));var jayson=require(_0x7e59('0xa'));var client=jayson[_0x7e59('0xb')][_0x7e59('0xc')]({'port':0x232a});config[_0x7e59('0xd')]=_[_0x7e59('0xe')](config['redis'],{'host':_0x7e59('0xf'),'port':0x18eb});var socket=require(_0x7e59('0x10'))(new Redis(config[_0x7e59('0xd')]));require(_0x7e59('0x11'))[_0x7e59('0x12')](socket);function respondWithRpcPromise(_0x4a447e,_0x57a340,_0x3e5df1){return new BPromise(function(_0x514a1a,_0x41f73e){return client['request'](_0x4a447e,_0x3e5df1)[_0x7e59('0x13')](function(_0xb66c7c){logger[_0x7e59('0x14')]('Plugin,\x20%s,\x20%s',_0x57a340,_0x7e59('0x15'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x57a340,_0x7e59('0x15'),JSON['stringify'](_0xb66c7c));if(_0xb66c7c[_0x7e59('0x16')]){if(_0xb66c7c[_0x7e59('0x16')][_0x7e59('0x17')]===0x1f4){logger[_0x7e59('0x16')]('Plugin,\x20%s,\x20%s',_0x57a340,_0xb66c7c[_0x7e59('0x16')][_0x7e59('0x18')]);return _0x41f73e(_0xb66c7c['error'][_0x7e59('0x18')]);}logger[_0x7e59('0x16')]('Plugin,\x20%s,\x20%s',_0x57a340,_0xb66c7c[_0x7e59('0x16')][_0x7e59('0x18')]);return _0x514a1a(_0xb66c7c['error']['message']);}else{logger[_0x7e59('0x14')](_0x7e59('0x19'),_0x57a340,'request\x20sent');_0x514a1a(_0xb66c7c['result']['message']);}})[_0x7e59('0x1a')](function(_0xe2d3e9){logger[_0x7e59('0x16')](_0x7e59('0x19'),_0x57a340,_0xe2d3e9);_0x41f73e(_0xe2d3e9);});});}exports[_0x7e59('0x1b')]=function(_0x4a0ced){var _0x4afb2f=this;return new Promise(function(_0x2b0401,_0x1d8bfd){return db['Plugin'][_0x7e59('0x1c')](_0x4a0ced['body'],{'raw':_0x4a0ced['options']?_0x4a0ced[_0x7e59('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x7e59('0x13')](function(_0x48747f){logger[_0x7e59('0x14')]('CreatePlugin',_0x4a0ced);logger[_0x7e59('0x1e')](_0x7e59('0x1b'),_0x4a0ced,JSON[_0x7e59('0x1f')](_0x48747f));_0x2b0401(_0x48747f);})['catch'](function(_0x455154){logger[_0x7e59('0x16')](_0x7e59('0x1b'),_0x455154[_0x7e59('0x18')],_0x4a0ced);_0x1d8bfd(_0x4afb2f['error'](0x1f4,_0x455154[_0x7e59('0x18')]));});});}; \ No newline at end of file +var _0xf7b9=['stringify','error','code','message','result','catch','CreatePlugin','Plugin','body','options','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s'];(function(_0x1aa617,_0x23271a){var _0x38653c=function(_0x1f17be){while(--_0x1f17be){_0x1aa617['push'](_0x1aa617['shift']());}};_0x38653c(++_0x23271a);}(_0xf7b9,0x74));var _0x9f7b=function(_0x470a8f,_0x51112b){_0x470a8f=_0x470a8f-0x0;var _0x38343c=_0xf7b9[_0x470a8f];return _0x38343c;};'use strict';var _=require(_0x9f7b('0x0'));var util=require('util');var moment=require(_0x9f7b('0x1'));var BPromise=require(_0x9f7b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f7b('0x3'));var db=require(_0x9f7b('0x4'))['db'];var utils=require(_0x9f7b('0x5'));var logger=require(_0x9f7b('0x6'))(_0x9f7b('0x7'));var config=require(_0x9f7b('0x8'));var jayson=require(_0x9f7b('0x9'));var client=jayson[_0x9f7b('0xa')][_0x9f7b('0xb')]({'port':0x232a});config[_0x9f7b('0xc')]=_['defaults'](config[_0x9f7b('0xc')],{'host':_0x9f7b('0xd'),'port':0x18eb});var socket=require(_0x9f7b('0xe'))(new Redis(config[_0x9f7b('0xc')]));require(_0x9f7b('0xf'))[_0x9f7b('0x10')](socket);function respondWithRpcPromise(_0x3c04c9,_0xc91850,_0x444d34){return new BPromise(function(_0x4757b8,_0xb53df0){return client[_0x9f7b('0x11')](_0x3c04c9,_0x444d34)[_0x9f7b('0x12')](function(_0x386767){logger[_0x9f7b('0x13')](_0x9f7b('0x14'),_0xc91850,_0x9f7b('0x15'));logger[_0x9f7b('0x16')](_0x9f7b('0x17'),_0xc91850,_0x9f7b('0x15'),JSON[_0x9f7b('0x18')](_0x386767));if(_0x386767[_0x9f7b('0x19')]){if(_0x386767[_0x9f7b('0x19')][_0x9f7b('0x1a')]===0x1f4){logger[_0x9f7b('0x19')]('Plugin,\x20%s,\x20%s',_0xc91850,_0x386767[_0x9f7b('0x19')]['message']);return _0xb53df0(_0x386767[_0x9f7b('0x19')][_0x9f7b('0x1b')]);}logger['error'](_0x9f7b('0x14'),_0xc91850,_0x386767['error'][_0x9f7b('0x1b')]);return _0x4757b8(_0x386767[_0x9f7b('0x19')][_0x9f7b('0x1b')]);}else{logger[_0x9f7b('0x13')](_0x9f7b('0x14'),_0xc91850,'request\x20sent');_0x4757b8(_0x386767[_0x9f7b('0x1c')][_0x9f7b('0x1b')]);}})[_0x9f7b('0x1d')](function(_0x245dc5){logger[_0x9f7b('0x19')]('Plugin,\x20%s,\x20%s',_0xc91850,_0x245dc5);_0xb53df0(_0x245dc5);});});}exports[_0x9f7b('0x1e')]=function(_0x47a449){var _0x125f24=this;return new Promise(function(_0x366b6c,_0x780e96){return db[_0x9f7b('0x1f')]['create'](_0x47a449[_0x9f7b('0x20')],{'raw':_0x47a449[_0x9f7b('0x21')]?_0x47a449['options'][_0x9f7b('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0xe6d0dd){logger['info']('CreatePlugin',_0x47a449);logger['debug']('CreatePlugin',_0x47a449,JSON[_0x9f7b('0x18')](_0xe6d0dd));_0x366b6c(_0xe6d0dd);})[_0x9f7b('0x1d')](function(_0x1158d0){logger[_0x9f7b('0x19')]('CreatePlugin',_0x1158d0['message'],_0x47a449);_0x780e96(_0x125f24[_0x9f7b('0x19')](0x1f4,_0x1158d0[_0x9f7b('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index e5d190a..4c4a7f9 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 _0x2dbb=['removeListener','register','length','./plugin.events','save','remove','emit'];(function(_0x235e21,_0x1208ed){var _0x1778d3=function(_0x583712){while(--_0x583712){_0x235e21['push'](_0x235e21['shift']());}};_0x1778d3(++_0x1208ed);}(_0x2dbb,0x6c));var _0xb2db=function(_0x14128f,_0x748b65){_0x14128f=_0x14128f-0x0;var _0x145fad=_0x2dbb[_0x14128f];return _0x145fad;};'use strict';var PluginEvents=require(_0xb2db('0x0'));var events=[_0xb2db('0x1'),_0xb2db('0x2'),'update'];function createListener(_0x3c704f,_0x3e6554){return function(_0x320825){_0x3e6554[_0xb2db('0x3')](_0x3c704f,_0x320825);};}function removeListener(_0x32d04a,_0x75ab81){return function(){PluginEvents[_0xb2db('0x4')](_0x32d04a,_0x75ab81);};}exports[_0xb2db('0x5')]=function(_0x3336f8){for(var _0x366b6e=0x0,_0xe6b9ee=events[_0xb2db('0x6')];_0x366b6e<_0xe6b9ee;_0x366b6e++){var _0x4e2c06=events[_0x366b6e];var _0x5b0fe8=createListener('plugin:'+_0x4e2c06,_0x3336f8);PluginEvents['on'](_0x4e2c06,_0x5b0fe8);}}; \ No newline at end of file +var _0x5d47=['register','save','remove','emit','removeListener'];(function(_0x20c993,_0xca841c){var _0x3fc1e2=function(_0x1e134f){while(--_0x1e134f){_0x20c993['push'](_0x20c993['shift']());}};_0x3fc1e2(++_0xca841c);}(_0x5d47,0x11e));var _0x75d4=function(_0x41987b,_0x1cae47){_0x41987b=_0x41987b-0x0;var _0x3e7b1f=_0x5d47[_0x41987b];return _0x3e7b1f;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x75d4('0x0'),_0x75d4('0x1'),'update'];function createListener(_0x36d0bc,_0x3f5ab2){return function(_0x31b1c1){_0x3f5ab2[_0x75d4('0x2')](_0x36d0bc,_0x31b1c1);};}function removeListener(_0x2a74a6,_0x10a4d7){return function(){PluginEvents[_0x75d4('0x3')](_0x2a74a6,_0x10a4d7);};}exports[_0x75d4('0x4')]=function(_0x422697){for(var _0x3fcfa0=0x0,_0x50aaa8=events['length'];_0x3fcfa0<_0x50aaa8;_0x3fcfa0++){var _0x1b0319=events[_0x3fcfa0];var _0x55b1e4=createListener('plugin:'+_0x1b0319,_0x422697);PluginEvents['on'](_0x1b0319,_0x55b1e4);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 2825c9b..488b3f9 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(_0x51cbcd,_0xf7881d){var _0x49bb5c=function(_0x1bd368){while(--_0x1bd368){_0x51cbcd['push'](_0x51cbcd['shift']());}};_0x49bb5c(++_0xf7881d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x5429cf,_0x6d309b){var _0x33e546=function(_0x53941a){while(--_0x53941a){_0x5429cf['push'](_0x5429cf['shift']());}};_0x33e546(++_0x6d309b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 1ec2ccc..979a05f 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 _0xd3d1=['Unknown\x20id','lodash','../../config/pm2','path','child_process','exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','describe','create','join','../../files/plugins','body','script','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','params','destroy','delete'];(function(_0x2cd03a,_0x1224da){var _0x11d8a7=function(_0x2f44a0){while(--_0x2f44a0){_0x2cd03a['push'](_0x2cd03a['shift']());}};_0x11d8a7(++_0x1224da);}(_0xd3d1,0x172));var _0x1d3d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xd3d1[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x1d3d('0x0'));var pm2=require(_0x1d3d('0x1'));var logger=require('../../config/logger')('api');var path=require(_0x1d3d('0x2'));var exec=require(_0x1d3d('0x3'))[_0x1d3d('0x4')];var BPromise=require(_0x1d3d('0x5'));function handleEntityNotFound(_0x41a806,_0x328a4e){return function(_0x2445e8){if(!_0x2445e8){_0x41a806[_0x1d3d('0x6')](0x194);;}return _0x2445e8;};}function respondWithResult(_0x1cbe06,_0x449475){_0x449475=_0x449475||0xc8;return function(_0x3831ce){if(_0x3831ce){return _0x1cbe06[_0x1d3d('0x7')](_0x449475)[_0x1d3d('0x8')](_0x3831ce);}return null;};}function handleError(_0x2c377c,_0xbea61e){_0xbea61e=_0xbea61e||0x1f4;return function(_0x2ba122){logger[_0x1d3d('0x9')](_0x2ba122['stack']);if(_0x2ba122[_0x1d3d('0xa')]){delete _0x2ba122[_0x1d3d('0xa')];}_0x2c377c[_0x1d3d('0x7')](_0xbea61e)[_0x1d3d('0xb')](_0x2ba122);};}function execChildProcess(){return new BPromise(function(_0x27d914,_0x372ff2){exec(_0x1d3d('0xc'),function(_0x2fa11e,_0x3b3913,_0x3cffa5){logger[_0x1d3d('0xd')](_0x3b3913);logger['info'](_0x3cffa5);if(_0x2fa11e){logger[_0x1d3d('0x9')](_0x2fa11e);return _0x372ff2(_0x2fa11e);}return _0x27d914(_0x3b3913);});});}exports[_0x1d3d('0xe')]=function(_0x494b82,_0x4dd753){return pm2[_0x1d3d('0xf')]()[_0x1d3d('0x10')](function(_0x1a8035){if(_0x1a8035){var _0x59b907=_[_0x1d3d('0x11')](_0x1a8035,function(_0x4dcc22){return _0x4dcc22[_0x1d3d('0xa')]===_0x1d3d('0x12')||_0x4dcc22[_0x1d3d('0xa')]===_0x1d3d('0x13');});return{'rows':_0x59b907,'count':_0x59b907[_0x1d3d('0x14')]};}return null;})[_0x1d3d('0x10')](respondWithResult(_0x4dd753,null))[_0x1d3d('0x15')](handleError(_0x4dd753,null));};exports['show']=function(_0x5d3ac9,_0x316ab4){return pm2[_0x1d3d('0x16')](_0x5d3ac9['params']['id'])[_0x1d3d('0x10')](respondWithResult(_0x316ab4,null))['then'](handleEntityNotFound(_0x316ab4,null))[_0x1d3d('0x15')](handleError(_0x316ab4,null));};exports[_0x1d3d('0x17')]=function(_0x2cd430,_0x2d6dfb){if(_0x2cd430['body'][_0x1d3d('0xa')]&&_0x2cd430['body']['script']){var _0x108005=path[_0x1d3d('0x18')](__dirname,_0x1d3d('0x19'),_0x2cd430[_0x1d3d('0x1a')][_0x1d3d('0x1b')]);var _0xe4afa2=process[_0x1d3d('0x1c')]();process[_0x1d3d('0x1d')](path[_0x1d3d('0x1e')](_0x108005));return execChildProcess()[_0x1d3d('0x10')](function(_0x1610a6){process['chdir'](_0xe4afa2);return pm2[_0x1d3d('0x1f')]({'name':_0x2cd430[_0x1d3d('0x1a')]['name'],'script':_0x108005});})[_0x1d3d('0x10')](function(_0x5c52da){pm2[_0x1d3d('0x20')]();return _0x5c52da[0x0];})[_0x1d3d('0x10')](respondWithResult(_0x2d6dfb,0xc9))[_0x1d3d('0x15')](handleError(_0x2d6dfb,null));}else{return _0x2d6dfb[_0x1d3d('0x7')](0x1f4)[_0x1d3d('0xb')]({'message':_0x1d3d('0x21')});}};exports[_0x1d3d('0x22')]=function(_0x298fd3,_0x2294ee){if(_0x298fd3[_0x1d3d('0x1a')]['id']){delete _0x298fd3[_0x1d3d('0x1a')]['id'];}var _0x4f0aa7={'online':_0x1d3d('0x23'),'stopped':'stop'};if(_0x4f0aa7[_0x1d3d('0x24')](_0x298fd3[_0x1d3d('0x1a')]['status'])){return pm2[_0x4f0aa7[_0x298fd3[_0x1d3d('0x1a')][_0x1d3d('0x7')]]](_0x298fd3[_0x1d3d('0x25')]['id'])[_0x1d3d('0x10')](respondWithResult(_0x2294ee,0xc8))['catch'](handleError(_0x2294ee,null));}else{return _0x2294ee[_0x1d3d('0x7')](0x1f4)[_0x1d3d('0xb')]({'message':'Unknown\x20status'});}};exports[_0x1d3d('0x26')]=function(_0x4845b7,_0x4c04a8){if(_0x4845b7[_0x1d3d('0x1a')]['id']){delete _0x4845b7['body']['id'];}if(_0x4845b7[_0x1d3d('0x25')]['id']){return pm2[_0x1d3d('0x27')](_0x4845b7[_0x1d3d('0x25')]['id'])[_0x1d3d('0x10')](function(_0x3a4c01){pm2[_0x1d3d('0x20')]();return _0x3a4c01[0x0];})[_0x1d3d('0x10')](respondWithResult(_0x4c04a8,null))[_0x1d3d('0x15')](handleError(_0x4c04a8,null));}else{return _0x4c04a8[_0x1d3d('0x7')](0x1f4)['send']({'message':_0x1d3d('0x28')});}}; \ No newline at end of file +var _0x1d2d=['reject','express','motion2','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','exec','sendStatus','json','error','stack','name','status','send','npm\x20install','info','index','list','then'];(function(_0xf63a3f,_0x35aff2){var _0x54f9e0=function(_0x231184){while(--_0x231184){_0xf63a3f['push'](_0xf63a3f['shift']());}};_0x54f9e0(++_0x35aff2);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x49f6d8,_0xb9c4ae){_0x49f6d8=_0x49f6d8-0x0;var _0x15e391=_0x1d2d[_0x49f6d8];return _0x15e391;};'use strict';var _=require(_0xd1d2('0x0'));var pm2=require(_0xd1d2('0x1'));var logger=require(_0xd1d2('0x2'))(_0xd1d2('0x3'));var path=require(_0xd1d2('0x4'));var exec=require('child_process')[_0xd1d2('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x5d3fac,_0x3caa72){return function(_0x2bfabc){if(!_0x2bfabc){_0x5d3fac[_0xd1d2('0x6')](0x194);;}return _0x2bfabc;};}function respondWithResult(_0x269613,_0x2f930d){_0x2f930d=_0x2f930d||0xc8;return function(_0x353dbd){if(_0x353dbd){return _0x269613['status'](_0x2f930d)[_0xd1d2('0x7')](_0x353dbd);}return null;};}function handleError(_0x21bc28,_0x35735f){_0x35735f=_0x35735f||0x1f4;return function(_0x37ff2a){logger[_0xd1d2('0x8')](_0x37ff2a[_0xd1d2('0x9')]);if(_0x37ff2a[_0xd1d2('0xa')]){delete _0x37ff2a[_0xd1d2('0xa')];}_0x21bc28[_0xd1d2('0xb')](_0x35735f)[_0xd1d2('0xc')](_0x37ff2a);};}function execChildProcess(){return new BPromise(function(_0x900ec,_0x227d7f){exec(_0xd1d2('0xd'),function(_0x5b21f4,_0x41fcb5,_0x1f49ed){logger[_0xd1d2('0xe')](_0x41fcb5);logger[_0xd1d2('0xe')](_0x1f49ed);if(_0x5b21f4){logger[_0xd1d2('0x8')](_0x5b21f4);return _0x227d7f(_0x5b21f4);}return _0x900ec(_0x41fcb5);});});}exports[_0xd1d2('0xf')]=function(_0x2df8a5,_0x31dc84){return pm2[_0xd1d2('0x10')]()[_0xd1d2('0x11')](function(_0x4cf702){if(_0x4cf702){var _0x2e7fec=_[_0xd1d2('0x12')](_0x4cf702,function(_0x3476f8){return _0x3476f8['name']===_0xd1d2('0x13')||_0x3476f8[_0xd1d2('0xa')]===_0xd1d2('0x14');});return{'rows':_0x2e7fec,'count':_0x2e7fec[_0xd1d2('0x15')]};}return null;})[_0xd1d2('0x11')](respondWithResult(_0x31dc84,null))[_0xd1d2('0x16')](handleError(_0x31dc84,null));};exports[_0xd1d2('0x17')]=function(_0x57f2f9,_0x539d5a){return pm2[_0xd1d2('0x18')](_0x57f2f9['params']['id'])[_0xd1d2('0x11')](respondWithResult(_0x539d5a,null))[_0xd1d2('0x11')](handleEntityNotFound(_0x539d5a,null))[_0xd1d2('0x16')](handleError(_0x539d5a,null));};exports[_0xd1d2('0x19')]=function(_0x4ab386,_0x4f1201){if(_0x4ab386[_0xd1d2('0x1a')]['name']&&_0x4ab386['body'][_0xd1d2('0x1b')]){var _0x27e26b=path[_0xd1d2('0x1c')](__dirname,_0xd1d2('0x1d'),_0x4ab386['body'][_0xd1d2('0x1b')]);var _0xbb4d27=process[_0xd1d2('0x1e')]();process['chdir'](path['dirname'](_0x27e26b));return execChildProcess()[_0xd1d2('0x11')](function(_0x3a1078){process[_0xd1d2('0x1f')](_0xbb4d27);return pm2[_0xd1d2('0x20')]({'name':_0x4ab386[_0xd1d2('0x1a')][_0xd1d2('0xa')],'script':_0x27e26b});})[_0xd1d2('0x11')](function(_0x5df4af){pm2[_0xd1d2('0x21')]();return _0x5df4af[0x0];})[_0xd1d2('0x11')](respondWithResult(_0x4f1201,0xc9))[_0xd1d2('0x16')](handleError(_0x4f1201,null));}else{return _0x4f1201[_0xd1d2('0xb')](0x1f4)[_0xd1d2('0xc')]({'message':_0xd1d2('0x22')});}};exports[_0xd1d2('0x23')]=function(_0x34faf7,_0xe6ef3c){if(_0x34faf7[_0xd1d2('0x1a')]['id']){delete _0x34faf7[_0xd1d2('0x1a')]['id'];}var _0x4e1bc2={'online':'restart','stopped':_0xd1d2('0x24')};if(_0x4e1bc2[_0xd1d2('0x25')](_0x34faf7[_0xd1d2('0x1a')][_0xd1d2('0xb')])){return pm2[_0x4e1bc2[_0x34faf7[_0xd1d2('0x1a')]['status']]](_0x34faf7[_0xd1d2('0x26')]['id'])[_0xd1d2('0x11')](respondWithResult(_0xe6ef3c,0xc8))[_0xd1d2('0x16')](handleError(_0xe6ef3c,null));}else{return _0xe6ef3c['status'](0x1f4)[_0xd1d2('0xc')]({'message':_0xd1d2('0x27')});}};exports[_0xd1d2('0x28')]=function(_0x56557d,_0x419db7){if(_0x56557d[_0xd1d2('0x1a')]['id']){delete _0x56557d[_0xd1d2('0x1a')]['id'];}if(_0x56557d[_0xd1d2('0x26')]['id']){return pm2[_0xd1d2('0x29')](_0x56557d[_0xd1d2('0x26')]['id'])[_0xd1d2('0x11')](function(_0x322f50){pm2[_0xd1d2('0x21')]();return _0x322f50[0x0];})[_0xd1d2('0x11')](respondWithResult(_0x419db7,null))[_0xd1d2('0x16')](handleError(_0x419db7,null));}else{return _0x419db7[_0xd1d2('0xb')](0x1f4)[_0xd1d2('0xc')]({'message':_0xd1d2('0x2a')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 78fc939..28f92f7 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 _0xf0bc=['../../components/auth/service','./realtime.controller','get','isAuthenticated','getAgents','/queues','exports','express','Router'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf0bc,0x18a));var _0xcf0b=function(_0x2d40f1,_0x105608){_0x2d40f1=_0x2d40f1-0x0;var _0x2a9e19=_0xf0bc[_0x2d40f1];return _0x2a9e19;};'use strict';var express=require(_0xcf0b('0x0'));var router=express[_0xcf0b('0x1')]();var auth=require(_0xcf0b('0x2'));var controller=require(_0xcf0b('0x3'));router[_0xcf0b('0x4')]('/agents',auth[_0xcf0b('0x5')](),controller[_0xcf0b('0x6')]);router[_0xcf0b('0x4')](_0xcf0b('0x7'),auth[_0xcf0b('0x5')](),controller['getQueues']);module[_0xcf0b('0x8')]=router; \ No newline at end of file +var _0x2055=['get','/agents','isAuthenticated','getAgents','exports','express','../../components/auth/service','./realtime.controller'];(function(_0x557343,_0x559c0e){var _0x5e4106=function(_0xcde36){while(--_0xcde36){_0x557343['push'](_0x557343['shift']());}};_0x5e4106(++_0x559c0e);}(_0x2055,0x1ed));var _0x5205=function(_0x2e17a1,_0x4065cf){_0x2e17a1=_0x2e17a1-0x0;var _0x3be6cf=_0x2055[_0x2e17a1];return _0x3be6cf;};'use strict';var express=require(_0x5205('0x0'));var router=express['Router']();var auth=require(_0x5205('0x1'));var controller=require(_0x5205('0x2'));router[_0x5205('0x3')](_0x5205('0x4'),auth[_0x5205('0x5')](),controller[_0x5205('0x6')]);router[_0x5205('0x3')]('/queues',auth[_0x5205('0x5')](),controller['getQueues']);module[_0x5205('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 705a3e0..69da86d 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 _0x7a54=['loggedIn','available','waiting','talking','paused','voice','outbound','push','pTalking','message','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','pick','filter','queue','busy','some','internal','toString','length','find','UserId','accountcode','online','voiceStatus','loggedInDb','User','Queue','agents','idle','unknown','isNil','mailPause','smsPause','voicePause','whatsappPause','every','pause','faxStatus','mailStatus','openchannelStatus','split','fields','includes','globalStatus','order','startsWith','DESC','sort','pauseType','getAgents','lastLoginAt','lastPauseAt','address','chatPause','openchannelPause','faxPause','smsCapacity','whatsappCapacity','faxCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','query','join','type','role','agent','raw','user','userProfileId','nolimit','UserProfile','getResources','findAndCountAll','count','rows','map','omit','globalStatusFilter','pauseTypeFilter','getQueues','mail','chat','openchannel','channel','toLowerCase','rawAttributes','fieldName','key','QueueCampaigns','util','lodash','jayson/promise','../../config/logger','api','client','http','offset','undefined','status','set','Content-Range','json','stack','name','send','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels'];(function(_0x64ba51,_0x2f0863){var _0x17d7e8=function(_0x526317){while(--_0x526317){_0x64ba51['push'](_0x64ba51['shift']());}};_0x17d7e8(++_0x2f0863);}(_0x7a54,0x106));var _0x47a5=function(_0x102e38,_0x4df8c5){_0x102e38=_0x102e38-0x0;var _0x5da90b=_0x7a54[_0x102e38];return _0x5da90b;};'use strict';var util=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x47a5('0x5')][_0x47a5('0x6')]({'port':0x232a});var routingClient=jayson[_0x47a5('0x5')][_0x47a5('0x6')]({'port':0x232c});function respondWithFilteredResult(_0xfdf934,_0x545a97){return function(_0x3d5629){if(_0x3d5629){var _0x59199c=typeof _0x545a97[_0x47a5('0x7')]===_0x47a5('0x8')&&typeof _0x545a97['limit']===_0x47a5('0x8');var _0x5077f3=_0x3d5629['count'];var _0x582352=_0x59199c?0x0:_0x545a97[_0x47a5('0x7')];var _0x2baee7=_0x59199c?_0x3d5629['count']:_0x545a97[_0x47a5('0x7')]+_0x545a97['limit'];var _0x5de6d7;if(_0x2baee7>=_0x5077f3){_0x2baee7=_0x5077f3;_0x5de6d7=0xc8;}else{_0x5de6d7=0xce;}_0xfdf934[_0x47a5('0x9')](_0x5de6d7);return _0xfdf934[_0x47a5('0xa')](_0x47a5('0xb'),_0x582352+'-'+_0x2baee7+'/'+_0x5077f3)[_0x47a5('0xc')](_0x3d5629);}return null;};}function handleError(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0x1f4;return function(_0x1eae59){logger['error'](_0x1eae59[_0x47a5('0xd')]);if(_0x1eae59[_0x47a5('0xe')]){delete _0x1eae59[_0x47a5('0xe')];}_0xd612dd[_0x47a5('0x9')](_0xd308b8)[_0x47a5('0xf')](_0x1eae59);};}function getRealtimeAgents(){return new Promise(function(_0x620ee9,_0x3c6c46){return amiClient[_0x47a5('0x10')]('Agents',{})[_0x47a5('0x11')](function(_0x11faf5){if(_0x11faf5[_0x47a5('0x12')])throw new Error(_0x47a5('0x13'));var _0x1ef44c=_0x11faf5['result'];return routingClient['request'](_0x47a5('0x14'),{})['then'](function(_0x5247fd){if(_0x5247fd[_0x47a5('0x12')])throw new Error(_0x47a5('0x15'));var _0x2ce454=_0x5247fd[_0x47a5('0x16')];return _0x620ee9(_[_0x47a5('0x17')]({},_0x1ef44c,_0x2ce454));});})[_0x47a5('0x18')](function(_0x2763d6){_0x3c6c46(_0x2763d6);});});}function getRealtimeQueues(_0xe3c618,_0x3aed38){return new Promise(function(_0x4a9fcb,_0x1570bc){var _0xf160ba=_0x3aed38==='voice'?amiClient:routingClient;return _0xf160ba[_0x47a5('0x10')](_[_0x47a5('0x19')](_0x3aed38)+_0x47a5('0x1a'),_0xe3c618)['then'](function(_0xb8ae6c){if(_0xb8ae6c[_0x47a5('0x12')])throw new Error(util[_0x47a5('0x1b')](_0x47a5('0x1c'),_0x3aed38));return _0x4a9fcb(_0xb8ae6c['result']);})[_0x47a5('0x18')](function(_0x385687){_0x1570bc(_0x385687);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x513981,_0x28747d){return amiClient[_0x47a5('0x10')](_0x47a5('0x1d'),{})[_0x47a5('0x11')](function(_0x3abd6a){if(_0x3abd6a['error'])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x513981(_0x3abd6a[_0x47a5('0x16')]);})['catch'](function(_0x1ea9c8){_0x28747d(_0x1ea9c8);});});}function initializeQueues(_0x5b6c4e,_0x23cb77,_0x378208,_0x36ad34){var _0x1dac65=[_0x47a5('0x1e'),_0x47a5('0x1f'),_0x47a5('0x20'),_0x47a5('0x21'),_0x47a5('0x22')];if(_0x378208===_0x47a5('0x23')&&_0x36ad34===_0x47a5('0x24')){_0x1dac65[_0x47a5('0x25')](_0x47a5('0x26'),'originated',_0x47a5('0x27'),'dialActive',_0x47a5('0x28'),_0x47a5('0x29'),_0x47a5('0x2a'),'startProgressive',_0x47a5('0x2b'),_0x47a5('0x2c'),_0x47a5('0x2d'),_0x47a5('0x2e'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x47a5('0x2f'),_0x47a5('0x30'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0x47a5('0x31'),_0x47a5('0x32'),'predictiveIntervalAvgHoldtime',_0x47a5('0x33'));}return _0x5b6c4e['map'](function(_0x122ed6){var _0xd972c=_0x122ed6['get']({'plain':!![]});_0xd972c['agents']=[];_0xd972c[_0x47a5('0x22')]=0x0;_0xd972c['loggedInDb']=0x0;_0xd972c[_0x47a5('0x1e')]=0x0;_0xd972c[_0x47a5('0x1f')]=0x0;_0xd972c[_0x47a5('0x20')]=0x0;if(_0x378208==='voice'){_0xd972c[_0x47a5('0x21')]=0x0;_0xd972c['busy']=0x0;if(_0x36ad34==='outbound'){_0xd972c[_0x47a5('0x26')]=0x0;_0xd972c['originated']=0x0;}}var _0x25cce0=_['find'](_0x23cb77,['id',_0xd972c['id']]);if(_0x25cce0)_[_0x47a5('0x17')](_0xd972c,_[_0x47a5('0x34')](_0x25cce0,_0x1dac65));return _0xd972c;});}function updateAgentVoiceStatus(_0x38c8d4,_0x199698,_0x36add5){var _0xed6320=_[_0x47a5('0x35')](_0x36add5,[_0x47a5('0x36'),_0x199698[_0x47a5('0xe')]]);if(_0xed6320['length']===0x0)return _0x38c8d4[_0x47a5('0x37')]=!![];if(_[_0x47a5('0x38')](_0xed6320,['connectedlinenum',_0x38c8d4[_0x47a5('0x39')][_0x47a5('0x3a')]()]))return _0x38c8d4[_0x47a5('0x21')]=!![];if(!_0x38c8d4['talking'])return _0x38c8d4[_0x47a5('0x37')]=!![];}function getVoiceQueueAgents(_0x10f660,_0x596097,_0x2ebba0,_0x19218a){var _0x54ae35=_['find'](_0x596097,['id',_0x10f660['id']]);if(!_0x54ae35)return _0x10f660;return _0x54ae35['getMembers']({'raw':!![]})[_0x47a5('0x11')](function(_0x5c569e){for(var _0x9b5eaf=0x0;_0x9b5eaf<_0x5c569e[_0x47a5('0x3b')];_0x9b5eaf++){var _0x301a85=_[_0x47a5('0x3c')](_0x2ebba0,['id',_0x5c569e[_0x9b5eaf][_0x47a5('0x3d')]]);if(!_0x301a85){_0x301a85={'id':_0x5c569e[_0x9b5eaf][_0x47a5('0x3d')],'name':_0x5c569e[_0x9b5eaf][_0x47a5('0x3d')],'accountcode':'','online':![]};}var _0x1f3d01={'id':_0x301a85['id'],'name':_0x301a85[_0x47a5('0xe')],'internal':_0x301a85[_0x47a5('0x3e')],'online':Boolean(_0x301a85[_0x47a5('0x3f')]),'paused':Boolean(_0x5c569e[_0x9b5eaf][_0x47a5('0x22')])};if(_0x301a85[_0x47a5('0x40')]==='talking')updateAgentVoiceStatus(_0x1f3d01,_0x10f660,_0x19218a);if(_0x1f3d01[_0x47a5('0x3f')])_0x10f660[_0x47a5('0x41')]++;if(_0x1f3d01[_0x47a5('0x37')])_0x10f660[_0x47a5('0x37')]++;if(_0x1f3d01['paused']&&!_0x1f3d01[_0x47a5('0x37')]&&!_0x1f3d01['talking'])_0x10f660['paused']++;_0x10f660['agents']['push'](_0x1f3d01);}return _0x10f660;});}function getQueueAgents(_0x27dd5d,_0x5ec4e5,_0x2bb502){var _0x3a740b=_0x47a5('0x42')+_['startCase'](_0x2bb502)+_0x47a5('0x43');var _0x20c5bc=_0x2bb502+'Pause';return db[_0x3a740b]['findAll']({'where':{[_[_0x47a5('0x19')](_0x2bb502)+'QueueId']:_0x27dd5d['id']},'raw':!![]})[_0x47a5('0x11')](function(_0x4703b2){for(var _0x188614=0x0;_0x188614<_0x4703b2[_0x47a5('0x3b')];_0x188614++){var _0x34a9ae=_[_0x47a5('0x3c')](_0x5ec4e5,['id',_0x4703b2[_0x188614][_0x47a5('0x3d')]]);if(!_0x34a9ae){_0x34a9ae={'id':_0x4703b2[_0x188614][_0x47a5('0x3d')],'name':_0x4703b2[_0x188614][_0x47a5('0x3d')],'online':![],['pauseField']:![]};}var _0x162fa0={'id':_0x34a9ae['id'],'name':_0x34a9ae[_0x47a5('0xe')],'online':Boolean(_0x34a9ae[_0x47a5('0x3f')]),'paused':Boolean(_0x34a9ae[_0x20c5bc])};if(_0x162fa0[_0x47a5('0x3f')])_0x27dd5d[_0x47a5('0x41')]++;_0x27dd5d[_0x47a5('0x44')][_0x47a5('0x25')](_0x162fa0);}return _0x27dd5d;});}function isIdle(_0x512e65){return _0x512e65===_0x47a5('0x45')||_0x512e65===_0x47a5('0x46')||_0x512e65==='unavailable'||_0x512e65==='ringing'||_[_0x47a5('0x47')](_0x512e65);}function isAgentPaused(_0x560e4e,_0x13750d){var _0xd93e37=[_0x560e4e['chatPause'],_0x560e4e['faxPause'],_0x560e4e[_0x47a5('0x48')],_0x560e4e['openchannelPause'],_0x560e4e[_0x47a5('0x49')],_0x560e4e[_0x47a5('0x4a')],_0x560e4e[_0x47a5('0x4b')]];if(!_0x13750d)return _[_0x47a5('0x4c')](_0xd93e37);var _0x44fe8a=_[_0x47a5('0x35')](_0xd93e37);return _0x44fe8a[_0x47a5('0x3b')]>0x0&&_0x44fe8a['length']<_0xd93e37['length']?!![]:![];}function isAgentIdle(_0x2dd1db){if(_0x2dd1db[_0x47a5('0x40')]!==_0x47a5('0x45')&&_0x2dd1db[_0x47a5('0x4a')]){_0x2dd1db[_0x47a5('0x40')]=_0x47a5('0x4d');return![];}return _[_0x47a5('0x4c')]([_0x2dd1db['chatStatus'],_0x2dd1db[_0x47a5('0x4e')],_0x2dd1db[_0x47a5('0x4f')],_0x2dd1db[_0x47a5('0x50')],_0x2dd1db['smsStatus'],_0x2dd1db[_0x47a5('0x40')],_0x2dd1db['whatsappStatus']],isIdle);}function getAgentStatus(_0x2bf302){var _0xe31817=_0x47a5('0x46');if(isAgentPaused(_0x2bf302))_0xe31817=_0x47a5('0x4d');else if(isAgentPaused(_0x2bf302,!![]))_0xe31817='*pause';else if(isAgentIdle(_0x2bf302))_0xe31817=_0x47a5('0x45');else _0xe31817=_0x47a5('0x37');return _0xe31817;}function getUpdatedSortOptions(_0x2f66e9){var _0x3a2de4={'fields':[],'order':null};var _0x1b2335=_0x2f66e9[_0x47a5('0x51')](',');_0x3a2de4[_0x47a5('0x52')]=_['filter'](_0x1b2335,function(_0x2a0aa2){if(!_0x2a0aa2[_0x47a5('0x53')](_0x47a5('0x54')))return!![];_0x3a2de4[_0x47a5('0x55')]=_[_0x47a5('0x56')](_0x2a0aa2,'-')?_0x47a5('0x57'):'ASC';return![];});return _0x3a2de4;}function orderAgentsByStatus(_0x1ad6a9,_0x245a15){return _0x1ad6a9[_0x47a5('0x58')](function(_0x53871e,_0x4c5ed){if(_0x53871e[_0x47a5('0x54')]===_0x4c5ed[_0x47a5('0x54')]&&_0x53871e['globalStatus']==='pause'){if(_0x245a15===_0x47a5('0x57'))return(_0x53871e[_0x47a5('0x59')]||'')<(_0x4c5ed['pauseType']||'')?0x1:-0x1;return _0x53871e['pauseType']<_0x4c5ed[_0x47a5('0x59')]?-0x1:0x1;}else{if(_0x245a15==='DESC')return _0x53871e[_0x47a5('0x54')]<_0x4c5ed['globalStatus']?0x1:-0x1;return _0x53871e['globalStatus']<_0x4c5ed[_0x47a5('0x54')]?-0x1:0x1;}});}exports[_0x47a5('0x5a')]=function(_0x53eedf,_0x1b958b){var _0x72fe={'count':0x0,'rows':[]},_0x4b706a={},_0x5b6127,_0x16b4fd,_0x30d482,_0x867da0=['userpic',_0x47a5('0x3f'),_0x47a5('0x5b'),_0x47a5('0x5c'),'pauseType',_0x47a5('0x5c'),'internal',_0x47a5('0x5d'),_0x47a5('0x5e'),_0x47a5('0x5f'),_0x47a5('0x48'),_0x47a5('0x49'),'whatsappPause',_0x47a5('0x60'),'voicePause','chatCapacity','openchannelCapacity','mailCapacity',_0x47a5('0x61'),_0x47a5('0x62'),_0x47a5('0x63'),'chatCurrentCapacity','openchannelCurrentCapacity',_0x47a5('0x64'),_0x47a5('0x65'),_0x47a5('0x66'),_0x47a5('0x67'),_0x47a5('0x68'),'openchannelStatus',_0x47a5('0x4f'),'smsStatus',_0x47a5('0x69'),_0x47a5('0x4e'),'voiceStatus',_0x47a5('0x6a'),_0x47a5('0x6b'),_0x47a5('0x6c'),_0x47a5('0x6d'),_0x47a5('0x6e'),_0x47a5('0x6f'),_0x47a5('0x70'),_0x47a5('0x36'),'destconnectedlinenum',_0x47a5('0x71'),_0x47a5('0x72'),_0x47a5('0x73'),_0x47a5('0x74')],_0x2931e4=[_0x47a5('0x5e'),'openchannelPause',_0x47a5('0x48'),_0x47a5('0x49'),_0x47a5('0x4b'),_0x47a5('0x60'),_0x47a5('0x4a'),_0x47a5('0x3f')];Promise[_0x47a5('0x75')]()[_0x47a5('0x11')](function(){if(!_0x53eedf[_0x47a5('0x76')][_0x47a5('0x58')]||!_0x53eedf[_0x47a5('0x76')][_0x47a5('0x58')][_0x47a5('0x53')](_0x47a5('0x54')))return;var _0x3edd17=getUpdatedSortOptions(_0x53eedf['query'][_0x47a5('0x58')]);_0x53eedf[_0x47a5('0x76')][_0x47a5('0x58')]=_0x3edd17['fields'][_0x47a5('0x77')](',');_0x5b6127=_0x3edd17[_0x47a5('0x55')];})[_0x47a5('0x11')](function(){var _0x26f1ac=_['map'](db[_0x47a5('0x42')]['rawAttributes'],function(_0x2d5ee6){return{'name':_0x2d5ee6['fieldName'],'type':_0x2d5ee6[_0x47a5('0x78')]['key']};});_0x53eedf[_0x47a5('0x76')][_0x47a5('0x79')]=_0x47a5('0x7a');_0x53eedf['query']['online']=!![];_0x4b706a=qs['getOptions'](_0x26f1ac,_0x53eedf);_0x4b706a[_0x47a5('0x7b')]=!![];if(_0x53eedf[_0x47a5('0x7c')][_0x47a5('0x79')]===_0x47a5('0x7c')){var _0x525055={'params':{'id':_0x53eedf[_0x47a5('0x7c')][_0x47a5('0x7d')]},'query':{'section':_0x47a5('0x14'),'role':_0x47a5('0x7a'),'online':!![],'nolimit':_0x53eedf[_0x47a5('0x76')][_0x47a5('0x7e')],'sort':_0x53eedf[_0x47a5('0x76')][_0x47a5('0x58')],'filter':_0x53eedf[_0x47a5('0x76')][_0x47a5('0x35')],'raw':!![]}};return db[_0x47a5('0x7f')][_0x47a5('0x80')](_0x525055);}return db['User'][_0x47a5('0x81')](_0x4b706a);})['then'](function(_0x2ad00a){_0x72fe[_0x47a5('0x82')]=_0x2ad00a[_0x47a5('0x82')];_0x16b4fd=_0x2ad00a[_0x47a5('0x83')];return getRealtimeAgents();})[_0x47a5('0x11')](function(_0xa9c853){_0x30d482=_0xa9c853[_0x47a5('0x83')];return _0x16b4fd[_0x47a5('0x84')](function(_0x11c1db){var _0x254049=_[_0x47a5('0x3c')](_0x30d482,['id',_0x11c1db['id']]);if(_0x254049)_[_0x47a5('0x17')](_0x11c1db,_[_0x47a5('0x34')](_[_0x47a5('0x85')](_0x254049,_0x2931e4),_0x867da0));_0x11c1db[_0x47a5('0x54')]=getAgentStatus(_0x11c1db);return _0x11c1db;});})['then'](function(_0x48eb77){var _0x5ccc89;if(_0x53eedf['query'][_0x47a5('0x86')]){_0x5ccc89=_[_0x47a5('0x35')](_0x48eb77,['globalStatus',_0x53eedf[_0x47a5('0x76')][_0x47a5('0x86')]]);if(_0x53eedf[_0x47a5('0x76')][_0x47a5('0x87')]){_0x5ccc89=_[_0x47a5('0x35')](_0x5ccc89,[_0x47a5('0x59'),_0x53eedf[_0x47a5('0x76')][_0x47a5('0x87')]]);}}if(_0x5ccc89)_0x48eb77=_0x5ccc89;if(!_0x5b6127)return _0x48eb77;return orderAgentsByStatus(_0x48eb77,_0x5b6127);})[_0x47a5('0x11')](function(_0x1ffe3c){_0x72fe[_0x47a5('0x83')]=_0x1ffe3c;return _0x72fe;})['then'](respondWithFilteredResult(_0x1b958b,_0x4b706a))[_0x47a5('0x18')](handleError(_0x1b958b,null));};exports[_0x47a5('0x88')]=function(_0x420671,_0x4f35ff){var _0x340846=[_0x47a5('0x89'),_0x47a5('0x8a'),'sms',_0x47a5('0x8b'),'fax','whatsapp',_0x47a5('0x23')];var _0x292d9c={'count':0x0,'rows':[]},_0x277486={},_0x27333e,_0x164d42,_0xea50f3,_0x479a82,_0x592322;Promise[_0x47a5('0x75')]()['then'](function(){if(_0x420671[_0x47a5('0x76')][_0x47a5('0x8c')]){if(!_[_0x47a5('0x53')](_0x340846,_0x420671[_0x47a5('0x76')]['channel'][_0x47a5('0x8d')]()))throw new Error('Invalid\x20channel');_0x27333e=_0x420671['query'][_0x47a5('0x8c')][_0x47a5('0x8d')]();}var _0x5b91f7=_[_0x47a5('0x19')](_0x27333e)+_0x47a5('0x43');var _0x24a98b=_['map'](db[_0x5b91f7][_0x47a5('0x8e')],function(_0x578e27){return{'name':_0x578e27[_0x47a5('0x8f')],'type':_0x578e27[_0x47a5('0x78')][_0x47a5('0x90')]};});_0x277486=qs['getOptions'](_0x24a98b,_0x420671);if(_0x420671[_0x47a5('0x7c')][_0x47a5('0x79')]===_0x47a5('0x7c')){var _0x4b3fef={'params':{'id':_0x420671[_0x47a5('0x7c')]['userProfileId']},'query':{'section':_0x27333e===_0x47a5('0x23')&&_0x420671['query'][_0x47a5('0x78')]===_0x47a5('0x24')?_0x47a5('0x91'):_[_0x47a5('0x19')](_0x27333e)+'Queues','type':_0x420671[_0x47a5('0x76')][_0x47a5('0x78')],'nolimit':!![],'sort':_0x47a5('0xe'),'filter':_0x420671[_0x47a5('0x76')][_0x47a5('0x35')]}};return db['UserProfile']['getResources'](_0x4b3fef);}return db[_0x5b91f7][_0x47a5('0x81')](_0x277486);})['then'](function(_0xd6c211){_0x292d9c[_0x47a5('0x82')]=_0xd6c211[_0x47a5('0x82')];_0x164d42=_0xd6c211['rows'];return getRealtimeQueues(_0x420671,_0x27333e);})[_0x47a5('0x11')](function(_0x18f833){_0x479a82=_0x18f833['rows'];return getRealtimeAgents();})[_0x47a5('0x11')](function(_0x8a9dea){_0xea50f3=_0x8a9dea[_0x47a5('0x83')];if(_0x27333e!=_0x47a5('0x23'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x4b5353){_0x592322=_0x4b5353?_0x4b5353[_0x47a5('0x83')]:[];return initializeQueues(_0x164d42,_0x479a82,_0x27333e,_0x420671[_0x47a5('0x76')]['type']);})[_0x47a5('0x11')](function(_0x23f055){var _0x5a0901=_0x23f055[_0x47a5('0x84')](function(_0x2a02cd){if(_0x27333e===_0x47a5('0x23'))return getVoiceQueueAgents(_0x2a02cd,_0x164d42,_0xea50f3,_0x592322);else return getQueueAgents(_0x2a02cd,_0xea50f3,_0x27333e);});return Promise['all'](_0x5a0901);})[_0x47a5('0x11')](function(_0x59b4a5){_0x292d9c[_0x47a5('0x83')]=_0x59b4a5;return _0x292d9c;})['then'](respondWithFilteredResult(_0x4f35ff,_0x277486))[_0x47a5('0x18')](handleError(_0x4f35ff,null));}; \ No newline at end of file +var _0x9957=['client','http','offset','limit','undefined','count','status','set','json','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','startCase','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','paused','outbound','push','pTalking','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','agents','loggedInDb','voice','find','pick','queue','length','busy','connectedlinenum','internal','toString','talking','getMembers','UserId','online','User','Queue','idle','unknown','unavailable','ringing','chatPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','voiceStatus','chatStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','fields','filter','includes','globalStatus','order','startsWith','DESC','ASC','sort','pause','pauseType','getAgents','userpic','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','routealias','resolve','query','join','map','rawAttributes','fieldName','type','key','agent','getOptions','user','role','userProfileId','nolimit','getResources','findAndCountAll','rows','omit','globalStatusFilter','pauseTypeFilter','mail','chat','sms','openchannel','fax','channel','Invalid\x20channel','toLowerCase','UserProfile','all','util','lodash','jayson/promise','../../components/parsers/qs','api','../../mysqldb'];(function(_0x10ee08,_0x282946){var _0x286f3c=function(_0x4087bb){while(--_0x4087bb){_0x10ee08['push'](_0x10ee08['shift']());}};_0x286f3c(++_0x282946);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var jayson=require(_0x7995('0x2'));var qs=require(_0x7995('0x3'));var logger=require('../../config/logger')(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var amiClient=jayson[_0x7995('0x6')][_0x7995('0x7')]({'port':0x232a});var routingClient=jayson['client'][_0x7995('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x1a36d8,_0x137b6b){return function(_0x219534){if(_0x219534){var _0xbda126=typeof _0x137b6b[_0x7995('0x8')]==='undefined'&&typeof _0x137b6b[_0x7995('0x9')]===_0x7995('0xa');var _0x4a64f7=_0x219534[_0x7995('0xb')];var _0x3116fb=_0xbda126?0x0:_0x137b6b[_0x7995('0x8')];var _0x35b5fe=_0xbda126?_0x219534[_0x7995('0xb')]:_0x137b6b[_0x7995('0x8')]+_0x137b6b[_0x7995('0x9')];var _0x524f7b;if(_0x35b5fe>=_0x4a64f7){_0x35b5fe=_0x4a64f7;_0x524f7b=0xc8;}else{_0x524f7b=0xce;}_0x1a36d8[_0x7995('0xc')](_0x524f7b);return _0x1a36d8[_0x7995('0xd')]('Content-Range',_0x3116fb+'-'+_0x35b5fe+'/'+_0x4a64f7)[_0x7995('0xe')](_0x219534);}return null;};}function handleError(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0x1f4;return function(_0x385f00){logger[_0x7995('0xf')](_0x385f00[_0x7995('0x10')]);if(_0x385f00[_0x7995('0x11')]){delete _0x385f00['name'];}_0x2cb37a['status'](_0x19a27e)[_0x7995('0x12')](_0x385f00);};}function getRealtimeAgents(){return new Promise(function(_0x2233dd,_0x24b5bb){return amiClient[_0x7995('0x13')](_0x7995('0x14'),{})[_0x7995('0x15')](function(_0x2202ce){if(_0x2202ce[_0x7995('0xf')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x2eeacc=_0x2202ce['result'];return routingClient[_0x7995('0x13')](_0x7995('0x14'),{})[_0x7995('0x15')](function(_0x291317){if(_0x291317[_0x7995('0xf')])throw new Error(_0x7995('0x16'));var _0x4faa60=_0x291317['result'];return _0x2233dd(_[_0x7995('0x17')]({},_0x2eeacc,_0x4faa60));});})['catch'](function(_0x555f74){_0x24b5bb(_0x555f74);});});}function getRealtimeQueues(_0x3ec178,_0x3d463e){return new Promise(function(_0x4cbe10,_0x3a9b54){var _0x51f276=_0x3d463e==='voice'?amiClient:routingClient;return _0x51f276[_0x7995('0x13')](_[_0x7995('0x18')](_0x3d463e)+_0x7995('0x19'),_0x3ec178)[_0x7995('0x15')](function(_0x460924){if(_0x460924[_0x7995('0xf')])throw new Error(util['format'](_0x7995('0x1a'),_0x3d463e));return _0x4cbe10(_0x460924[_0x7995('0x1b')]);})[_0x7995('0x1c')](function(_0x285437){_0x3a9b54(_0x285437);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x563799,_0x13bc35){return amiClient[_0x7995('0x13')](_0x7995('0x1d'),{})['then'](function(_0x39df42){if(_0x39df42[_0x7995('0xf')])throw new Error(_0x7995('0x1e'));return _0x563799(_0x39df42[_0x7995('0x1b')]);})[_0x7995('0x1c')](function(_0x2a307e){_0x13bc35(_0x2a307e);});});}function initializeQueues(_0x56691a,_0x47625f,_0x5911c3,_0x229742){var _0x49bc7e=[_0x7995('0x1f'),_0x7995('0x20'),_0x7995('0x21'),'talking',_0x7995('0x22')];if(_0x5911c3==='voice'&&_0x229742===_0x7995('0x23')){_0x49bc7e[_0x7995('0x24')](_0x7995('0x25'),'originated','message','dialActive',_0x7995('0x26'),_0x7995('0x27'),_0x7995('0x28'),_0x7995('0x29'),_0x7995('0x2a'),_0x7995('0x2b'),'erlangAbandonmentRate','erlangBusyFactor',_0x7995('0x2c'),'dialPredictiveIntervalMaxThreshold',_0x7995('0x2d'),_0x7995('0x2e'),_0x7995('0x2f'),_0x7995('0x30'),_0x7995('0x31'),'predictiveIntervalDroppedCallsCallersExit',_0x7995('0x32'),_0x7995('0x33'));}return _0x56691a['map'](function(_0x48db25){var _0x577412=_0x48db25[_0x7995('0x34')]({'plain':!![]});_0x577412[_0x7995('0x35')]=[];_0x577412['paused']=0x0;_0x577412[_0x7995('0x36')]=0x0;_0x577412['loggedIn']=0x0;_0x577412[_0x7995('0x20')]=0x0;_0x577412[_0x7995('0x21')]=0x0;if(_0x5911c3===_0x7995('0x37')){_0x577412['talking']=0x0;_0x577412['busy']=0x0;if(_0x229742===_0x7995('0x23')){_0x577412['pTalking']=0x0;_0x577412['originated']=0x0;}}var _0x3e99cd=_[_0x7995('0x38')](_0x47625f,['id',_0x577412['id']]);if(_0x3e99cd)_['merge'](_0x577412,_[_0x7995('0x39')](_0x3e99cd,_0x49bc7e));return _0x577412;});}function updateAgentVoiceStatus(_0x1922b4,_0x2b772f,_0x18667c){var _0x1e3dbf=_['filter'](_0x18667c,[_0x7995('0x3a'),_0x2b772f[_0x7995('0x11')]]);if(_0x1e3dbf[_0x7995('0x3b')]===0x0)return _0x1922b4[_0x7995('0x3c')]=!![];if(_['some'](_0x1e3dbf,[_0x7995('0x3d'),_0x1922b4[_0x7995('0x3e')][_0x7995('0x3f')]()]))return _0x1922b4[_0x7995('0x40')]=!![];if(!_0x1922b4[_0x7995('0x40')])return _0x1922b4[_0x7995('0x3c')]=!![];}function getVoiceQueueAgents(_0x5688a1,_0x183a68,_0x3be298,_0x8a1be0){var _0x2ea47f=_[_0x7995('0x38')](_0x183a68,['id',_0x5688a1['id']]);if(!_0x2ea47f)return _0x5688a1;return _0x2ea47f[_0x7995('0x41')]({'raw':!![]})[_0x7995('0x15')](function(_0x270c0e){for(var _0x1234e1=0x0;_0x1234e1<_0x270c0e[_0x7995('0x3b')];_0x1234e1++){var _0x6fe77b=_[_0x7995('0x38')](_0x3be298,['id',_0x270c0e[_0x1234e1][_0x7995('0x42')]]);if(!_0x6fe77b){_0x6fe77b={'id':_0x270c0e[_0x1234e1]['UserId'],'name':_0x270c0e[_0x1234e1]['UserId'],'accountcode':'','online':![]};}var _0x334dff={'id':_0x6fe77b['id'],'name':_0x6fe77b[_0x7995('0x11')],'internal':_0x6fe77b['accountcode'],'online':Boolean(_0x6fe77b['online']),'paused':Boolean(_0x270c0e[_0x1234e1][_0x7995('0x22')])};if(_0x6fe77b['voiceStatus']==='talking')updateAgentVoiceStatus(_0x334dff,_0x5688a1,_0x8a1be0);if(_0x334dff[_0x7995('0x43')])_0x5688a1[_0x7995('0x36')]++;if(_0x334dff[_0x7995('0x3c')])_0x5688a1['busy']++;if(_0x334dff[_0x7995('0x22')]&&!_0x334dff['busy']&&!_0x334dff[_0x7995('0x40')])_0x5688a1['paused']++;_0x5688a1['agents'][_0x7995('0x24')](_0x334dff);}return _0x5688a1;});}function getQueueAgents(_0x403f54,_0xc04e5,_0x3f1c35){var _0x599ecb=_0x7995('0x44')+_[_0x7995('0x18')](_0x3f1c35)+_0x7995('0x45');var _0x6c7bec=_0x3f1c35+'Pause';return db[_0x599ecb]['findAll']({'where':{[_[_0x7995('0x18')](_0x3f1c35)+'QueueId']:_0x403f54['id']},'raw':!![]})[_0x7995('0x15')](function(_0x59c153){for(var _0x2f435e=0x0;_0x2f435e<_0x59c153['length'];_0x2f435e++){var _0x1e795e=_[_0x7995('0x38')](_0xc04e5,['id',_0x59c153[_0x2f435e]['UserId']]);if(!_0x1e795e){_0x1e795e={'id':_0x59c153[_0x2f435e][_0x7995('0x42')],'name':_0x59c153[_0x2f435e][_0x7995('0x42')],'online':![],['pauseField']:![]};}var _0x314145={'id':_0x1e795e['id'],'name':_0x1e795e[_0x7995('0x11')],'online':Boolean(_0x1e795e['online']),'paused':Boolean(_0x1e795e[_0x6c7bec])};if(_0x314145[_0x7995('0x43')])_0x403f54[_0x7995('0x36')]++;_0x403f54[_0x7995('0x35')]['push'](_0x314145);}return _0x403f54;});}function isIdle(_0xe228a5){return _0xe228a5===_0x7995('0x46')||_0xe228a5===_0x7995('0x47')||_0xe228a5===_0x7995('0x48')||_0xe228a5===_0x7995('0x49')||_['isNil'](_0xe228a5);}function isAgentPaused(_0x1a5cec,_0xfb72b2){var _0x5921b9=[_0x1a5cec[_0x7995('0x4a')],_0x1a5cec['faxPause'],_0x1a5cec[_0x7995('0x4b')],_0x1a5cec[_0x7995('0x4c')],_0x1a5cec[_0x7995('0x4d')],_0x1a5cec[_0x7995('0x4e')],_0x1a5cec[_0x7995('0x4f')]];if(!_0xfb72b2)return _[_0x7995('0x50')](_0x5921b9);var _0x1579b9=_['filter'](_0x5921b9);return _0x1579b9[_0x7995('0x3b')]>0x0&&_0x1579b9[_0x7995('0x3b')]<_0x5921b9[_0x7995('0x3b')]?!![]:![];}function isAgentIdle(_0x4ffc8a){if(_0x4ffc8a[_0x7995('0x51')]!==_0x7995('0x46')&&_0x4ffc8a[_0x7995('0x4e')]){_0x4ffc8a['voiceStatus']='pause';return![];}return _['every']([_0x4ffc8a[_0x7995('0x52')],_0x4ffc8a[_0x7995('0x53')],_0x4ffc8a['mailStatus'],_0x4ffc8a[_0x7995('0x54')],_0x4ffc8a[_0x7995('0x55')],_0x4ffc8a[_0x7995('0x51')],_0x4ffc8a[_0x7995('0x56')]],isIdle);}function getAgentStatus(_0xc04004){var _0x528c8e=_0x7995('0x47');if(isAgentPaused(_0xc04004))_0x528c8e='pause';else if(isAgentPaused(_0xc04004,!![]))_0x528c8e=_0x7995('0x57');else if(isAgentIdle(_0xc04004))_0x528c8e=_0x7995('0x46');else _0x528c8e=_0x7995('0x3c');return _0x528c8e;}function getUpdatedSortOptions(_0x50c7b5){var _0x5e1f34={'fields':[],'order':null};var _0x54e2b1=_0x50c7b5['split'](',');_0x5e1f34[_0x7995('0x58')]=_[_0x7995('0x59')](_0x54e2b1,function(_0x1a861c){if(!_0x1a861c[_0x7995('0x5a')](_0x7995('0x5b')))return!![];_0x5e1f34[_0x7995('0x5c')]=_[_0x7995('0x5d')](_0x1a861c,'-')?_0x7995('0x5e'):_0x7995('0x5f');return![];});return _0x5e1f34;}function orderAgentsByStatus(_0x17ecd3,_0xa7af8c){return _0x17ecd3[_0x7995('0x60')](function(_0x3da72b,_0x35bea3){if(_0x3da72b[_0x7995('0x5b')]===_0x35bea3[_0x7995('0x5b')]&&_0x3da72b[_0x7995('0x5b')]===_0x7995('0x61')){if(_0xa7af8c===_0x7995('0x5e'))return(_0x3da72b['pauseType']||'')<(_0x35bea3[_0x7995('0x62')]||'')?0x1:-0x1;return _0x3da72b[_0x7995('0x62')]<_0x35bea3[_0x7995('0x62')]?-0x1:0x1;}else{if(_0xa7af8c===_0x7995('0x5e'))return _0x3da72b['globalStatus']<_0x35bea3['globalStatus']?0x1:-0x1;return _0x3da72b[_0x7995('0x5b')]<_0x35bea3[_0x7995('0x5b')]?-0x1:0x1;}});}exports[_0x7995('0x63')]=function(_0x332a85,_0x51c50b){var _0x13cd7b={'count':0x0,'rows':[]},_0x74ff38={},_0xef5044,_0x33c49c,_0x502d43,_0x5e2d97=[_0x7995('0x64'),_0x7995('0x43'),_0x7995('0x65'),_0x7995('0x66'),_0x7995('0x62'),_0x7995('0x66'),_0x7995('0x3e'),_0x7995('0x67'),'chatPause',_0x7995('0x4c'),_0x7995('0x4b'),_0x7995('0x4d'),_0x7995('0x4f'),'faxPause','voicePause',_0x7995('0x68'),_0x7995('0x69'),'mailCapacity',_0x7995('0x6a'),_0x7995('0x6b'),_0x7995('0x6c'),_0x7995('0x6d'),_0x7995('0x6e'),'mailCurrentCapacity',_0x7995('0x6f'),'whatsappCurrentCapacity',_0x7995('0x70'),_0x7995('0x52'),_0x7995('0x54'),_0x7995('0x71'),_0x7995('0x55'),_0x7995('0x56'),_0x7995('0x53'),_0x7995('0x51'),_0x7995('0x72'),_0x7995('0x73'),_0x7995('0x74'),_0x7995('0x75'),'whatsappStatusTime',_0x7995('0x76'),_0x7995('0x77'),_0x7995('0x3a'),_0x7995('0x78'),_0x7995('0x79'),'phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording',_0x7995('0x7a')],_0x40e5fc=[_0x7995('0x4a'),_0x7995('0x4c'),_0x7995('0x4b'),'smsPause',_0x7995('0x4f'),'faxPause','voicePause',_0x7995('0x43')];Promise[_0x7995('0x7b')]()[_0x7995('0x15')](function(){if(!_0x332a85[_0x7995('0x7c')][_0x7995('0x60')]||!_0x332a85[_0x7995('0x7c')][_0x7995('0x60')][_0x7995('0x5a')](_0x7995('0x5b')))return;var _0x2466df=getUpdatedSortOptions(_0x332a85['query'][_0x7995('0x60')]);_0x332a85[_0x7995('0x7c')][_0x7995('0x60')]=_0x2466df['fields'][_0x7995('0x7d')](',');_0xef5044=_0x2466df[_0x7995('0x5c')];})[_0x7995('0x15')](function(){var _0x3a7d9d=_[_0x7995('0x7e')](db[_0x7995('0x44')][_0x7995('0x7f')],function(_0x3adfd2){return{'name':_0x3adfd2[_0x7995('0x80')],'type':_0x3adfd2[_0x7995('0x81')][_0x7995('0x82')]};});_0x332a85['query']['role']=_0x7995('0x83');_0x332a85[_0x7995('0x7c')][_0x7995('0x43')]=!![];_0x74ff38=qs[_0x7995('0x84')](_0x3a7d9d,_0x332a85);_0x74ff38['raw']=!![];if(_0x332a85[_0x7995('0x85')][_0x7995('0x86')]==='user'){var _0x480fdb={'params':{'id':_0x332a85[_0x7995('0x85')][_0x7995('0x87')]},'query':{'section':'Agents','role':_0x7995('0x83'),'online':!![],'nolimit':_0x332a85['query'][_0x7995('0x88')],'sort':_0x332a85[_0x7995('0x7c')]['sort'],'filter':_0x332a85['query'][_0x7995('0x59')],'raw':!![]}};return db['UserProfile'][_0x7995('0x89')](_0x480fdb);}return db[_0x7995('0x44')][_0x7995('0x8a')](_0x74ff38);})[_0x7995('0x15')](function(_0x1a1873){_0x13cd7b[_0x7995('0xb')]=_0x1a1873[_0x7995('0xb')];_0x33c49c=_0x1a1873[_0x7995('0x8b')];return getRealtimeAgents();})[_0x7995('0x15')](function(_0x117317){_0x502d43=_0x117317[_0x7995('0x8b')];return _0x33c49c[_0x7995('0x7e')](function(_0x10a2f5){var _0x1ff436=_[_0x7995('0x38')](_0x502d43,['id',_0x10a2f5['id']]);if(_0x1ff436)_[_0x7995('0x17')](_0x10a2f5,_[_0x7995('0x39')](_[_0x7995('0x8c')](_0x1ff436,_0x40e5fc),_0x5e2d97));_0x10a2f5[_0x7995('0x5b')]=getAgentStatus(_0x10a2f5);return _0x10a2f5;});})[_0x7995('0x15')](function(_0x306fa9){var _0x1e8dad;if(_0x332a85[_0x7995('0x7c')][_0x7995('0x8d')]){_0x1e8dad=_[_0x7995('0x59')](_0x306fa9,[_0x7995('0x5b'),_0x332a85[_0x7995('0x7c')][_0x7995('0x8d')]]);if(_0x332a85['query'][_0x7995('0x8e')]){_0x1e8dad=_[_0x7995('0x59')](_0x1e8dad,['pauseType',_0x332a85['query'][_0x7995('0x8e')]]);}}if(_0x1e8dad)_0x306fa9=_0x1e8dad;if(!_0xef5044)return _0x306fa9;return orderAgentsByStatus(_0x306fa9,_0xef5044);})[_0x7995('0x15')](function(_0x2d45d5){_0x13cd7b[_0x7995('0x8b')]=_0x2d45d5;return _0x13cd7b;})[_0x7995('0x15')](respondWithFilteredResult(_0x51c50b,_0x74ff38))[_0x7995('0x1c')](handleError(_0x51c50b,null));};exports['getQueues']=function(_0x2f8a2d,_0xb68962){var _0x3fea6a=[_0x7995('0x8f'),_0x7995('0x90'),_0x7995('0x91'),_0x7995('0x92'),_0x7995('0x93'),'whatsapp',_0x7995('0x37')];var _0x2b8217={'count':0x0,'rows':[]},_0x5c04c9={},_0x479271,_0xd24c64,_0xf8c2ed,_0x18e1a2,_0x3db7a9;Promise[_0x7995('0x7b')]()['then'](function(){if(_0x2f8a2d[_0x7995('0x7c')][_0x7995('0x94')]){if(!_['includes'](_0x3fea6a,_0x2f8a2d[_0x7995('0x7c')][_0x7995('0x94')]['toLowerCase']()))throw new Error(_0x7995('0x95'));_0x479271=_0x2f8a2d['query'][_0x7995('0x94')][_0x7995('0x96')]();}var _0x3ab421=_[_0x7995('0x18')](_0x479271)+_0x7995('0x45');var _0x5d16da=_[_0x7995('0x7e')](db[_0x3ab421][_0x7995('0x7f')],function(_0x38b37f){return{'name':_0x38b37f['fieldName'],'type':_0x38b37f[_0x7995('0x81')][_0x7995('0x82')]};});_0x5c04c9=qs[_0x7995('0x84')](_0x5d16da,_0x2f8a2d);if(_0x2f8a2d[_0x7995('0x85')]['role']===_0x7995('0x85')){var _0xf59a39={'params':{'id':_0x2f8a2d[_0x7995('0x85')]['userProfileId']},'query':{'section':_0x479271==='voice'&&_0x2f8a2d[_0x7995('0x7c')][_0x7995('0x81')]==='outbound'?'QueueCampaigns':_[_0x7995('0x18')](_0x479271)+_0x7995('0x19'),'type':_0x2f8a2d[_0x7995('0x7c')][_0x7995('0x81')],'nolimit':!![],'sort':_0x7995('0x11'),'filter':_0x2f8a2d['query']['filter']}};return db[_0x7995('0x97')]['getResources'](_0xf59a39);}return db[_0x3ab421]['findAndCountAll'](_0x5c04c9);})[_0x7995('0x15')](function(_0x3b731e){_0x2b8217[_0x7995('0xb')]=_0x3b731e['count'];_0xd24c64=_0x3b731e[_0x7995('0x8b')];return getRealtimeQueues(_0x2f8a2d,_0x479271);})[_0x7995('0x15')](function(_0x2b0b79){_0x18e1a2=_0x2b0b79[_0x7995('0x8b')];return getRealtimeAgents();})[_0x7995('0x15')](function(_0x5799d1){_0xf8c2ed=_0x5799d1[_0x7995('0x8b')];if(_0x479271!=_0x7995('0x37'))return;return getRealtimeVoiceQueueChannels();})[_0x7995('0x15')](function(_0x14b942){_0x3db7a9=_0x14b942?_0x14b942['rows']:[];return initializeQueues(_0xd24c64,_0x18e1a2,_0x479271,_0x2f8a2d[_0x7995('0x7c')][_0x7995('0x81')]);})['then'](function(_0x310272){var _0x20683e=_0x310272['map'](function(_0x135f7a){if(_0x479271==='voice')return getVoiceQueueAgents(_0x135f7a,_0xd24c64,_0xf8c2ed,_0x3db7a9);else return getQueueAgents(_0x135f7a,_0xf8c2ed,_0x479271);});return Promise[_0x7995('0x98')](_0x20683e);})['then'](function(_0x21f496){_0x2b8217['rows']=_0x21f496;return _0x2b8217;})[_0x7995('0x15')](respondWithFilteredResult(_0xb68962,_0x5c04c9))[_0x7995('0x1c')](handleError(_0xb68962,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 81bab24..69fd990 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x314b22,_0x4836ed){var _0x1fbf29=function(_0x2b6c96){while(--_0x2b6c96){_0x314b22['push'](_0x314b22['shift']());}};_0x1fbf29(++_0x4836ed);}(_0xedd9,0xfc));var _0x9edd=function(_0x27abdc,_0x520243){_0x27abdc=_0x27abdc-0x0;var _0xaf7495=_0xedd9[_0x27abdc];return _0xaf7495;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5cf8b0,_0x29a9bd){var _0x3d63ab=function(_0x4c4146){while(--_0x4c4146){_0x5cf8b0['push'](_0x5cf8b0['shift']());}};_0x3d63ab(++_0x29a9bd);}(_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 diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 48fe270..9effd6c 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 _0xf360=['INTEGER','DATE','STRING','sequelize','exports'];(function(_0x236bd8,_0x2c70a7){var _0x2aebe4=function(_0x1a3020){while(--_0x1a3020){_0x236bd8['push'](_0x236bd8['shift']());}};_0x2aebe4(++_0x2c70a7);}(_0xf360,0x9e));var _0x0f36=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xf360[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x0f36('0x0'));module[_0x0f36('0x1')]={'state':{'type':Sequelize[_0x0f36('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x0f36('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x0f36('0x3')]},'responsetime':{'type':Sequelize[_0x0f36('0x3')]},'ringtime':{'type':Sequelize[_0x0f36('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x0f36('0x4')]},'membername':{'type':Sequelize[_0x0f36('0x4')]}}; \ No newline at end of file +var _0x4af9=['sequelize','exports','DATE','STRING','INTEGER'];(function(_0x32692c,_0x60ebae){var _0xd53b11=function(_0xb66655){while(--_0xb66655){_0x32692c['push'](_0x32692c['shift']());}};_0xd53b11(++_0x60ebae);}(_0x4af9,0x12c));var _0x94af=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4af9[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x94af('0x0'));module[_0x94af('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x94af('0x2')]},'uniqueid':{'type':Sequelize[_0x94af('0x3')]},'starttime':{'type':Sequelize[_0x94af('0x2')]},'responsetime':{'type':Sequelize[_0x94af('0x2')]},'ringtime':{'type':Sequelize[_0x94af('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x94af('0x3')]},'campaigntype':{'type':Sequelize[_0x94af('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 8f7eca0..cf14369 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 _0x86ae=['request-promise','rimraf','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','util','../../config/logger','moment','bluebird'];(function(_0x114cd6,_0x242848){var _0x5c8e65=function(_0x566fd3){while(--_0x566fd3){_0x114cd6['push'](_0x114cd6['shift']());}};_0x5c8e65(++_0x242848);}(_0x86ae,0x11a));var _0xe86a=function(_0x35e70d,_0x56cc50){_0x35e70d=_0x35e70d-0x0;var _0x2accea=_0x86ae[_0x35e70d];return _0x2accea;};'use strict';var _=require('lodash');var util=require(_0xe86a('0x0'));var logger=require(_0xe86a('0x1'))('api');var moment=require(_0xe86a('0x2'));var BPromise=require(_0xe86a('0x3'));var rp=require(_0xe86a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe86a('0x5'));var config=require('../../config/environment');var attributes=require(_0xe86a('0x6'));module[_0xe86a('0x7')]=function(_0xec9aa3,_0x8a7f49){return _0xec9aa3[_0xe86a('0x8')](_0xe86a('0x9'),attributes,{'tableName':_0xe86a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95d4=['rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x9d132f,_0x309e9e){var _0x169ea2=function(_0x5208d0){while(--_0x5208d0){_0x9d132f['push'](_0x9d132f['shift']());}};_0x169ea2(++_0x309e9e);}(_0x95d4,0x8a));var _0x495d=function(_0x4d8789,_0x3fdff1){_0x4d8789=_0x4d8789-0x0;var _0x404e41=_0x95d4[_0x4d8789];return _0x404e41;};'use strict';var _=require(_0x495d('0x0'));var util=require('util');var logger=require(_0x495d('0x1'))(_0x495d('0x2'));var moment=require(_0x495d('0x3'));var BPromise=require(_0x495d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x495d('0x5'));var rimraf=require(_0x495d('0x6'));var config=require(_0x495d('0x7'));var attributes=require(_0x495d('0x8'));module[_0x495d('0x9')]=function(_0x37e81a,_0x440bae){return _0x37e81a[_0x495d('0xa')]('ReportAgentPreview',attributes,{'tableName':_0x495d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index ee3366f..94b8afb 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 _0x3c59=['message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','debug','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x3c59,0xb8));var _0x93c5=function(_0x351509,_0x54725c){_0x351509=_0x351509-0x0;var _0x4e9861=_0x3c59[_0x351509];return _0x4e9861;};'use strict';var _=require(_0x93c5('0x0'));var util=require('util');var moment=require(_0x93c5('0x1'));var BPromise=require(_0x93c5('0x2'));var rs=require(_0x93c5('0x3'));var fs=require('fs');var Redis=require(_0x93c5('0x4'));var db=require(_0x93c5('0x5'))['db'];var utils=require(_0x93c5('0x6'));var logger=require(_0x93c5('0x7'))(_0x93c5('0x8'));var config=require(_0x93c5('0x9'));var jayson=require(_0x93c5('0xa'));var client=jayson['client'][_0x93c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58101f,_0x32968a,_0x8ad931){return new BPromise(function(_0x5dd0ff,_0x98530f){return client['request'](_0x58101f,_0x8ad931)[_0x93c5('0xc')](function(_0x3a8597){logger[_0x93c5('0xd')](_0x93c5('0xe'),_0x32968a,'request\x20sent');logger['debug'](_0x93c5('0xf'),_0x32968a,_0x93c5('0x10'),JSON['stringify'](_0x3a8597));if(_0x3a8597[_0x93c5('0x11')]){if(_0x3a8597[_0x93c5('0x11')][_0x93c5('0x12')]===0x1f4){logger['error'](_0x93c5('0xe'),_0x32968a,_0x3a8597[_0x93c5('0x11')][_0x93c5('0x13')]);return _0x98530f(_0x3a8597['error'][_0x93c5('0x13')]);}logger[_0x93c5('0x11')](_0x93c5('0xe'),_0x32968a,_0x3a8597[_0x93c5('0x11')][_0x93c5('0x13')]);return _0x5dd0ff(_0x3a8597['error'][_0x93c5('0x13')]);}else{logger[_0x93c5('0xd')](_0x93c5('0xe'),_0x32968a,_0x93c5('0x10'));_0x5dd0ff(_0x3a8597[_0x93c5('0x14')][_0x93c5('0x13')]);}})[_0x93c5('0x15')](function(_0x187146){logger['error'](_0x93c5('0xe'),_0x32968a,_0x187146);_0x98530f(_0x187146);});});}exports[_0x93c5('0x16')]=function(_0x4c1ccd){var _0xb63cca=this;return new Promise(function(_0x3c563c,_0x54a8e7){return db[_0x93c5('0x17')][_0x93c5('0x18')](_0x4c1ccd[_0x93c5('0x19')],{'raw':_0x4c1ccd[_0x93c5('0x1a')]?_0x4c1ccd[_0x93c5('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x12055c){logger[_0x93c5('0xd')](_0x93c5('0x16'),_0x4c1ccd);logger[_0x93c5('0x1b')](_0x93c5('0x16'),_0x4c1ccd,JSON[_0x93c5('0x1c')](_0x12055c));_0x3c563c(_0x12055c);})[_0x93c5('0x15')](function(_0x3ff5e6){logger[_0x93c5('0x11')]('CreateReportAgentPreview',_0x3ff5e6[_0x93c5('0x13')],_0x4c1ccd);_0x54a8e7(_0xb63cca[_0x93c5('0x11')](0x1f4,_0x3ff5e6['message']));});});}; \ No newline at end of file +var _0x5746=['ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x19bdf5,_0x3a6395){var _0x140930=function(_0x1b1a19){while(--_0x1b1a19){_0x19bdf5['push'](_0x19bdf5['shift']());}};_0x140930(++_0x3a6395);}(_0x5746,0x1d0));var _0x6574=function(_0x18a71c,_0x33521d){_0x18a71c=_0x18a71c-0x0;var _0xcf2b21=_0x5746[_0x18a71c];return _0xcf2b21;};'use strict';var _=require(_0x6574('0x0'));var util=require(_0x6574('0x1'));var moment=require(_0x6574('0x2'));var BPromise=require(_0x6574('0x3'));var rs=require(_0x6574('0x4'));var fs=require('fs');var Redis=require(_0x6574('0x5'));var db=require(_0x6574('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6574('0x7'))(_0x6574('0x8'));var config=require(_0x6574('0x9'));var jayson=require(_0x6574('0xa'));var client=jayson[_0x6574('0xb')][_0x6574('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xfe5f1,_0x4ab45a,_0x3a1bf2){return new BPromise(function(_0x7e509f,_0x16b59b){return client[_0x6574('0xd')](_0xfe5f1,_0x3a1bf2)[_0x6574('0xe')](function(_0x2d9da2){logger[_0x6574('0xf')](_0x6574('0x10'),_0x4ab45a,_0x6574('0x11'));logger[_0x6574('0x12')](_0x6574('0x13'),_0x4ab45a,_0x6574('0x11'),JSON[_0x6574('0x14')](_0x2d9da2));if(_0x2d9da2[_0x6574('0x15')]){if(_0x2d9da2['error'][_0x6574('0x16')]===0x1f4){logger['error'](_0x6574('0x10'),_0x4ab45a,_0x2d9da2[_0x6574('0x15')][_0x6574('0x17')]);return _0x16b59b(_0x2d9da2[_0x6574('0x15')][_0x6574('0x17')]);}logger[_0x6574('0x15')](_0x6574('0x10'),_0x4ab45a,_0x2d9da2[_0x6574('0x15')]['message']);return _0x7e509f(_0x2d9da2[_0x6574('0x15')]['message']);}else{logger[_0x6574('0xf')](_0x6574('0x10'),_0x4ab45a,_0x6574('0x11'));_0x7e509f(_0x2d9da2[_0x6574('0x18')][_0x6574('0x17')]);}})[_0x6574('0x19')](function(_0x144503){logger[_0x6574('0x15')](_0x6574('0x10'),_0x4ab45a,_0x144503);_0x16b59b(_0x144503);});});}exports[_0x6574('0x1a')]=function(_0x200f31){var _0x247564=this;return new Promise(function(_0x2b8aee,_0x1694d2){return db[_0x6574('0x1b')][_0x6574('0x1c')](_0x200f31['body'],{'raw':_0x200f31['options']?_0x200f31['options'][_0x6574('0x1d')]===undefined?!![]:![]:!![]})[_0x6574('0xe')](function(_0x53ab7f){logger[_0x6574('0xf')](_0x6574('0x1a'),_0x200f31);logger[_0x6574('0x12')](_0x6574('0x1a'),_0x200f31,JSON['stringify'](_0x53ab7f));_0x2b8aee(_0x53ab7f);})[_0x6574('0x19')](function(_0x4a6103){logger[_0x6574('0x15')](_0x6574('0x1a'),_0x4a6103[_0x6574('0x17')],_0x200f31);_0x1694d2(_0x247564['error'](0x1f4,_0x4a6103[_0x6574('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 3910733..7e9ef50 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 _0xc6e4=['/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','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','/agents/:id/notify','exports','multer','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','mailQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions'];(function(_0x25f972,_0x3a27d8){var _0x197722=function(_0x3af964){while(--_0x3af964){_0x25f972['push'](_0x25f972['shift']());}};_0x197722(++_0x3a27d8);}(_0xc6e4,0x1a5));var _0x4c6e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc6e4[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4c6e('0x0'));var util=require('util');var path=require(_0x4c6e('0x1'));var express=require(_0x4c6e('0x2'));var router=express[_0x4c6e('0x3')]();var auth=require(_0x4c6e('0x4'));var controller=require(_0x4c6e('0x5'));router[_0x4c6e('0x6')](_0x4c6e('0x7'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x9')]);router[_0x4c6e('0x6')](_0x4c6e('0xa'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x4c6e('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x4c6e('0xb')]);router[_0x4c6e('0x6')](_0x4c6e('0xc'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0xd')]);router[_0x4c6e('0x6')](_0x4c6e('0xe'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0xf')]);router[_0x4c6e('0x6')]('/mail/queues',auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x10')]);router[_0x4c6e('0x6')]('/mail/accounts',auth['isAuthenticated'](),controller['mailAccounts']);router['get'](_0x4c6e('0x11'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x12')]);router[_0x4c6e('0x6')](_0x4c6e('0x13'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x14')]);router[_0x4c6e('0x6')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0x4c6e('0x15')]);router[_0x4c6e('0x6')](_0x4c6e('0x16'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x17')]);router[_0x4c6e('0x6')](_0x4c6e('0x18'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x19')]);router[_0x4c6e('0x6')](_0x4c6e('0x1a'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x1b')]);router['get'](_0x4c6e('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x4c6e('0x6')](_0x4c6e('0x1d'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x1e')]);router[_0x4c6e('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x1f')]);router[_0x4c6e('0x6')](_0x4c6e('0x20'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x21')]);router[_0x4c6e('0x22')](_0x4c6e('0x20'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x23')]);router[_0x4c6e('0x6')](_0x4c6e('0x24'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x25')]);router[_0x4c6e('0x6')](_0x4c6e('0x26'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x27')]);router[_0x4c6e('0x6')]('/agents',auth[_0x4c6e('0x8')](),controller['agents']);router[_0x4c6e('0x22')]('/agents/:id/capacity',auth[_0x4c6e('0x8')](),controller['agentCapacity']);router[_0x4c6e('0x6')](_0x4c6e('0x28'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x29')]);router[_0x4c6e('0x6')](_0x4c6e('0x2a'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x2b')]);router['get'](_0x4c6e('0x2c'),auth['isAuthenticated'](),controller[_0x4c6e('0x2d')]);router[_0x4c6e('0x6')](_0x4c6e('0x2e'),auth['isAuthenticated'](),controller[_0x4c6e('0x2f')]);router[_0x4c6e('0x6')]('/chat/queues/waitinginteractions',auth[_0x4c6e('0x8')](),controller['chatQueuesWaitingInteractions']);router['get']('/mail/queues/waitinginteractions',auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x30')]);router[_0x4c6e('0x6')]('/openchannel/queues/waitinginteractions',auth[_0x4c6e('0x8')](),controller['openchannelQueuesWaitingInteractions']);router[_0x4c6e('0x6')](_0x4c6e('0x31'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x32')]);router[_0x4c6e('0x6')](_0x4c6e('0x33'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x34')]);router['get'](_0x4c6e('0x35'),auth[_0x4c6e('0x8')](),controller['whatsappQueuesWaitingInteractions']);router[_0x4c6e('0x6')](_0x4c6e('0x36'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x37')]);router[_0x4c6e('0x38')]('/mail/queues/:id/notify',auth[_0x4c6e('0x8')](),controller['queueNotify'](_0x4c6e('0x39')));router[_0x4c6e('0x6')](_0x4c6e('0x3a'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x3b')]);router[_0x4c6e('0x38')](_0x4c6e('0x3c'),auth['isAuthenticated'](),controller[_0x4c6e('0x3d')](_0x4c6e('0x3e')));router['get'](_0x4c6e('0x3f'),auth[_0x4c6e('0x8')](),controller['showChatQueues']);router[_0x4c6e('0x38')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0x4c6e('0x3d')](_0x4c6e('0x40')));router[_0x4c6e('0x6')](_0x4c6e('0x41'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x42')]);router[_0x4c6e('0x38')](_0x4c6e('0x43'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x3d')](_0x4c6e('0x44')));router[_0x4c6e('0x6')](_0x4c6e('0x45'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x46')]);router[_0x4c6e('0x38')](_0x4c6e('0x47'),auth[_0x4c6e('0x8')](),controller[_0x4c6e('0x3d')](_0x4c6e('0x48')));router[_0x4c6e('0x38')](_0x4c6e('0x49'),auth['isAuthenticated'](),controller['queueNotify'](_0x4c6e('0x4a')));router[_0x4c6e('0x6')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x4c6e('0x4b')]);router['get'](_0x4c6e('0x4c'),auth[_0x4c6e('0x8')](),controller['showWhatsappQueues']);router['post'](_0x4c6e('0x4d'),auth[_0x4c6e('0x8')](),controller['agentNotify']);module[_0x4c6e('0x4e')]=router; \ No newline at end of file +var _0x7fe7=['/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','/voice/queues/preview/:id','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','trunks','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions'];(function(_0x427f50,_0x5d87c4){var _0x4aefaa=function(_0x2af9ec){while(--_0x2af9ec){_0x427f50['push'](_0x427f50['shift']());}};_0x4aefaa(++_0x5d87c4);}(_0x7fe7,0x104));var _0x77fe=function(_0x416f4e,_0x46a4b1){_0x416f4e=_0x416f4e-0x0;var _0x230028=_0x7fe7[_0x416f4e];return _0x230028;};'use strict';var multer=require(_0x77fe('0x0'));var util=require(_0x77fe('0x1'));var path=require('path');var express=require(_0x77fe('0x2'));var router=express[_0x77fe('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x77fe('0x4'));router[_0x77fe('0x5')](_0x77fe('0x6'),auth[_0x77fe('0x7')](),controller['voiceChannels']);router[_0x77fe('0x5')](_0x77fe('0x8'),auth['isAuthenticated'](),controller[_0x77fe('0x9')]);router[_0x77fe('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x77fe('0x7')](),controller[_0x77fe('0xa')]);router[_0x77fe('0x5')](_0x77fe('0xb'),auth['isAuthenticated'](),controller[_0x77fe('0xc')]);router[_0x77fe('0x5')](_0x77fe('0xd'),auth[_0x77fe('0x7')](),controller['chatQueues']);router['get'](_0x77fe('0xe'),auth['isAuthenticated'](),controller[_0x77fe('0xf')]);router[_0x77fe('0x5')](_0x77fe('0x10'),auth[_0x77fe('0x7')](),controller[_0x77fe('0x11')]);router[_0x77fe('0x5')](_0x77fe('0x12'),auth[_0x77fe('0x7')](),controller['openchannelQueues']);router[_0x77fe('0x5')](_0x77fe('0x13'),auth['isAuthenticated'](),controller[_0x77fe('0x14')]);router[_0x77fe('0x5')](_0x77fe('0x15'),auth['isAuthenticated'](),controller['whatsappQueues']);router[_0x77fe('0x5')](_0x77fe('0x16'),auth['isAuthenticated'](),controller['faxQueues']);router[_0x77fe('0x5')](_0x77fe('0x17'),auth[_0x77fe('0x7')](),controller['voiceQueuesPreview']);router[_0x77fe('0x5')]('/voice/queues/channels',auth[_0x77fe('0x7')](),controller['voiceQueuesChannels']);router[_0x77fe('0x5')](_0x77fe('0x18'),auth[_0x77fe('0x7')](),controller['voiceQueuesChannel']);router[_0x77fe('0x5')](_0x77fe('0x19'),auth['isAuthenticated'](),controller[_0x77fe('0x1a')]);router[_0x77fe('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x77fe('0x7')](),controller[_0x77fe('0x1b')]);router['get'](_0x77fe('0x1c'),auth[_0x77fe('0x7')](),controller['showVoiceQueues']);router[_0x77fe('0x1d')]('/voice/queues/:id',auth[_0x77fe('0x7')](),controller[_0x77fe('0x1e')]);router[_0x77fe('0x5')](_0x77fe('0x1f'),auth[_0x77fe('0x7')](),controller[_0x77fe('0x20')]);router['get']('/outbound/channels',auth[_0x77fe('0x7')](),controller[_0x77fe('0x21')]);router[_0x77fe('0x5')](_0x77fe('0x22'),auth['isAuthenticated'](),controller[_0x77fe('0x23')]);router[_0x77fe('0x1d')](_0x77fe('0x24'),auth[_0x77fe('0x7')](),controller[_0x77fe('0x25')]);router[_0x77fe('0x5')]('/telephones',auth[_0x77fe('0x7')](),controller['telephones']);router[_0x77fe('0x5')]('/trunks',auth['isAuthenticated'](),controller[_0x77fe('0x26')]);router[_0x77fe('0x5')]('/campaigns',auth[_0x77fe('0x7')](),controller[_0x77fe('0x27')]);router[_0x77fe('0x5')](_0x77fe('0x28'),auth[_0x77fe('0x7')](),controller['faxAccounts']);router[_0x77fe('0x5')](_0x77fe('0x29'),auth[_0x77fe('0x7')](),controller[_0x77fe('0x2a')]);router[_0x77fe('0x5')]('/mail/queues/waitinginteractions',auth[_0x77fe('0x7')](),controller[_0x77fe('0x2b')]);router[_0x77fe('0x5')](_0x77fe('0x2c'),auth['isAuthenticated'](),controller[_0x77fe('0x2d')]);router[_0x77fe('0x5')](_0x77fe('0x2e'),auth[_0x77fe('0x7')](),controller[_0x77fe('0x2f')]);router['get'](_0x77fe('0x30'),auth[_0x77fe('0x7')](),controller['smsQueuesWaitingInteractions']);router[_0x77fe('0x5')](_0x77fe('0x31'),auth[_0x77fe('0x7')](),controller[_0x77fe('0x32')]);router['get'](_0x77fe('0x33'),auth['isAuthenticated'](),controller[_0x77fe('0x34')]);router[_0x77fe('0x35')](_0x77fe('0x36'),auth[_0x77fe('0x7')](),controller[_0x77fe('0x37')]('mail'));router[_0x77fe('0x5')](_0x77fe('0x38'),auth[_0x77fe('0x7')](),controller[_0x77fe('0x39')]);router[_0x77fe('0x35')](_0x77fe('0x3a'),auth[_0x77fe('0x7')](),controller['queueNotify'](_0x77fe('0x3b')));router['get'](_0x77fe('0x3c'),auth[_0x77fe('0x7')](),controller['showChatQueues']);router[_0x77fe('0x35')](_0x77fe('0x3d'),auth[_0x77fe('0x7')](),controller[_0x77fe('0x37')](_0x77fe('0x3e')));router['get'](_0x77fe('0x3f'),auth[_0x77fe('0x7')](),controller[_0x77fe('0x40')]);router[_0x77fe('0x35')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x77fe('0x41')));router[_0x77fe('0x5')](_0x77fe('0x42'),auth[_0x77fe('0x7')](),controller['showOpenchannelQueues']);router[_0x77fe('0x35')](_0x77fe('0x43'),auth[_0x77fe('0x7')](),controller[_0x77fe('0x37')]('sms'));router['post'](_0x77fe('0x44'),auth[_0x77fe('0x7')](),controller['queueNotify'](_0x77fe('0x45')));router[_0x77fe('0x5')](_0x77fe('0x46'),auth[_0x77fe('0x7')](),controller['showSmsQueues']);router[_0x77fe('0x5')](_0x77fe('0x47'),auth[_0x77fe('0x7')](),controller[_0x77fe('0x48')]);router['post'](_0x77fe('0x49'),auth[_0x77fe('0x7')](),controller[_0x77fe('0x4a')]);module[_0x77fe('0x4b')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index bd96238..f4e9c53 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 _0x33c5=['VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','merge','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','INTERACTION','length','format','updateAttributes','findOrCreate','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','Account','findOne','Message','messageId','Interaction','update','queue','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','Agent\x20not\x20found','\x20Message\x20not\x20found','TransferReport','create','agentTransferTimeout','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x33c5,0xe6));var _0x533c=function(_0x2c69a1,_0x201903){_0x2c69a1=_0x2c69a1-0x0;var _0x24bb91=_0x33c5[_0x2c69a1];return _0x24bb91;};'use strict';var BPromise=require('bluebird');var moment=require(_0x533c('0x0'));var _=require(_0x533c('0x1'));var util=require('util');var db=require(_0x533c('0x2'))['db'];var logger=require(_0x533c('0x3'))(_0x533c('0x4'));var jayson=require(_0x533c('0x5'));var amiClient=jayson[_0x533c('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0x533c('0x6')][_0x533c('0x7')]({'port':0x232b});var routingClient=jayson[_0x533c('0x6')][_0x533c('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x34ca89,_0x1699d5,_0x3a009b){return new BPromise(function(_0x36d74e,_0x2c297c){var _0x1b929b=_0x3a009b?_0x3a009b:amiClient;return _0x1b929b[_0x533c('0x8')](_0x34ca89,_0x1699d5)[_0x533c('0x9')](function(_0x2c0214){if(_0x2c0214[_0x533c('0xa')]){if(_0x2c0214[_0x533c('0xa')][_0x533c('0xb')]===0x1f4){return _0x2c297c(_0x2c0214['error'][_0x533c('0xc')]);}return _0x36d74e(_0x2c0214[_0x533c('0xa')][_0x533c('0xc')]);}else{_0x36d74e(_0x2c0214[_0x533c('0xd')]);}})[_0x533c('0xe')](function(_0x346e0f){_0x2c297c(_0x346e0f);});});}function respondWithResult(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xc8;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0xf')](_0x5c9462)[_0x533c('0x10')](_0xf93007);}return _0x530e10[_0x533c('0x11')](0x194);};}function handleError(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0x1f4;return function(_0xa616ca){logger['error'](_0xa616ca[_0x533c('0x12')]);if(_0xa616ca[_0x533c('0x13')]){delete _0xa616ca[_0x533c('0x13')];}_0x1a2a83[_0x533c('0xf')](_0x8d7c66)['send'](_0xa616ca);};}function findById(_0x1031e7){return function(_0x1ed6ba){if(!_[_0x533c('0x14')](_0x1031e7)&&!_[_0x533c('0x14')](_0x1ed6ba)&&!_[_0x533c('0x14')](_0x1ed6ba[_0x533c('0x15')])){return _[_0x533c('0x16')](_0x1ed6ba[_0x533c('0x15')],function(_0x1f9f85){return _0x1f9f85['id']==_0x1031e7;});}return null;};}exports[_0x533c('0x17')]=function(_0x287b9e,_0x2c41e9){return respondWithRpcPromise(_0x533c('0x18'),_0x287b9e[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x2c41e9,null))[_0x533c('0xe')](handleError(_0x2c41e9,null));};exports[_0x533c('0x1a')]=function(_0x2bc58f,_0x4ba0bd){return respondWithRpcPromise(_0x533c('0x1b'),_['merge'](_0x2bc58f['query'],_0x2bc58f[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x4ba0bd,null))['catch'](handleError(_0x4ba0bd,null));};exports[_0x533c('0x1d')]=function(_0x37651e,_0x3839fe){return respondWithRpcPromise(_0x533c('0x1e'),_['merge'](_0x37651e[_0x533c('0x19')],_0x37651e[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x3839fe,null))[_0x533c('0xe')](handleError(_0x3839fe,null));};exports[_0x533c('0x1f')]=function(_0x140269,_0xb51a5){return respondWithRpcPromise(_0x533c('0x20'),_0x140269[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0xb51a5,null))['catch'](handleError(_0xb51a5,null));};exports[_0x533c('0x21')]=function(_0xfab4da,_0x503c2e){return respondWithRpcPromise(_0x533c('0x20'),_0xfab4da['query'])[_0x533c('0x9')](findById(_0xfab4da[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x503c2e,null))[_0x533c('0xe')](handleError(_0x503c2e,null));};exports[_0x533c('0x22')]=function(_0x146a8e,_0x212d1b){return respondWithRpcPromise(_0x533c('0x23'),_[_0x533c('0x24')](_0x146a8e[_0x533c('0x25')],_0x146a8e[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x212d1b,null))['catch'](handleError(_0x212d1b,null));};exports[_0x533c('0x26')]=function(_0x591499,_0x3290de){return respondWithRpcPromise(_0x533c('0x27'),_[_0x533c('0x24')](_0x591499[_0x533c('0x19')],_0x591499[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x3290de,null))[_0x533c('0xe')](handleError(_0x3290de,null));};exports[_0x533c('0x28')]=function(_0x287ee5,_0x47831f){return respondWithRpcPromise(_0x533c('0x29'),_0x287ee5[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x47831f,null))[_0x533c('0xe')](handleError(_0x47831f,null));};exports[_0x533c('0x2a')]=function(_0x5ac6b4,_0x2b801e){return respondWithRpcPromise(_0x533c('0x2b'),_[_0x533c('0x24')](_0x5ac6b4[_0x533c('0x19')],_0x5ac6b4['params']))[_0x533c('0x9')](respondWithResult(_0x2b801e,null))[_0x533c('0xe')](handleError(_0x2b801e,null));};exports[_0x533c('0x2c')]=function(_0x40f077,_0x1255b1){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x40f077['query'],_0x40f077['params']))['then'](respondWithResult(_0x1255b1,null))[_0x533c('0xe')](handleError(_0x1255b1,null));};exports['voiceQueuesChannelRedirect']=function(_0x42994d,_0x55726a){return respondWithRpcPromise(_0x533c('0x2d'),_[_0x533c('0x24')](_0x42994d[_0x533c('0x19')],_0x42994d['params']))[_0x533c('0x9')](respondWithResult(_0x55726a,null))[_0x533c('0xe')](handleError(_0x55726a,null));};exports[_0x533c('0x2e')]=function(_0x55b010,_0x160d4b){return respondWithRpcPromise(_0x533c('0x2f'),_0x55b010[_0x533c('0x19')])['then'](respondWithResult(_0x160d4b,null))[_0x533c('0xe')](handleError(_0x160d4b,null));};exports[_0x533c('0x30')]=function(_0x2cd02f,_0x3f2b53){return respondWithRpcPromise(_0x533c('0x31'),_0x2cd02f[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x3f2b53,null))[_0x533c('0xe')](handleError(_0x3f2b53,null));};exports[_0x533c('0x32')]=function(_0x2c03fa,_0x298cea){var _0x55af6e;return respondWithRpcPromise(_0x533c('0x33'),_0x2c03fa[_0x533c('0x19')])[_0x533c('0x9')](function(_0x3562b8){_0x55af6e=_0x3562b8;return respondWithRpcPromise(_0x533c('0x33'),_0x2c03fa[_0x533c('0x19')],routingClient);})['then'](function(_0x88ea5d){return _[_0x533c('0x24')]({},_0x88ea5d,_0x55af6e);})[_0x533c('0x9')](respondWithResult(_0x298cea,null))['catch'](handleError(_0x298cea,null));};exports[_0x533c('0x34')]=function(_0x4170e4,_0x315e67){if(_0x4170e4[_0x533c('0x25')]&&_0x4170e4['body'][_0x533c('0x35')]&&_0x4170e4['user']&&_0x4170e4[_0x533c('0x36')][_0x533c('0x13')]){for(var _0x55a372 in _0x4170e4[_0x533c('0x25')][_0x533c('0x35')]){if(_0x4170e4[_0x533c('0x25')]['interaction']['hasOwnProperty'](_0x55a372)){db['MemberReport']['findAll']({'where':{'channel':_0x55a372,'membername':_0x4170e4[_0x533c('0x36')]['name'],'type':_0x533c('0x37'),'exitAt':null,'uniqueid':_0x4170e4['body'][_0x533c('0x35')][_0x55a372]&&_0x4170e4['body'][_0x533c('0x35')][_0x55a372][_0x533c('0x38')]?{'$notIn':_0x4170e4['body'][_0x533c('0x35')][_0x55a372]}:{'$ne':null}}})[_0x533c('0x9')](function(_0x27ac8e){var _0x10e374=moment()[_0x533c('0x39')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x47cca7=0x0,_0x22dc87=_0x27ac8e[_0x533c('0x38')];_0x47cca7<_0x22dc87;_0x47cca7+=0x1){_0x27ac8e[_0x47cca7][_0x533c('0x3a')]({'exitAt':_0x10e374});}});for(var _0x4fcdc5=0x0;_0x4fcdc5<_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372]['length'];_0x4fcdc5+=0x1){db['MemberReport'][_0x533c('0x3b')]({'where':{'channel':_0x55a372,'membername':_0x4170e4['user'][_0x533c('0x13')],'type':_0x533c('0x37'),'uniqueid':_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372][_0x4fcdc5],'exitAt':null},'defaults':{'channel':_0x55a372,'membername':_0x4170e4[_0x533c('0x36')][_0x533c('0x13')],'interface':_[_0x533c('0x14')](_0x4170e4[_0x533c('0x36')]['interface'])?util[_0x533c('0x39')](_0x533c('0x3c'),_0x4170e4[_0x533c('0x36')]['name']):_0x4170e4[_0x533c('0x36')][_0x533c('0x3d')],'type':'INTERACTION','enterAt':moment()[_0x533c('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x533c('0x3e'),'internal':_0x4170e4[_0x533c('0x36')][_0x533c('0x3f')],'uniqueid':_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372][_0x4fcdc5]}});}}}}return respondWithRpcPromise(_0x533c('0x40'),{'id':_0x4170e4[_0x533c('0x1c')]['id'],'capacity':_0x4170e4['body'][_0x533c('0x41')]},routingClient)[_0x533c('0x9')](respondWithResult(_0x315e67,null))[_0x533c('0xe')](handleError(_0x315e67,null));};exports[_0x533c('0x42')]=function(_0x24ca50,_0x1558ef){return respondWithRpcPromise(_0x533c('0x43'),_0x24ca50['query'])['then'](respondWithResult(_0x1558ef,null))['catch'](handleError(_0x1558ef,null));};exports['trunks']=function(_0xc99f96,_0x4434a1){return respondWithRpcPromise('Trunks',_0xc99f96[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x4434a1,null))[_0x533c('0xe')](handleError(_0x4434a1,null));};exports['campaigns']=function(_0x1de19e,_0x564a31){return respondWithRpcPromise('Campaigns',_0x1de19e[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x564a31,null))[_0x533c('0xe')](handleError(_0x564a31,null));};exports[_0x533c('0x44')]=function(_0x381544,_0x3bb176){return respondWithRpcPromise(_0x533c('0x45'),_0x381544['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x3bb176,null))['catch'](handleError(_0x3bb176,null));};exports[_0x533c('0x46')]=function(_0x26645d,_0x274686){return respondWithRpcPromise(_0x533c('0x45'),_0x26645d[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x26645d[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x274686,null))['catch'](handleError(_0x274686,null));};exports[_0x533c('0x47')]=function(_0x43a333,_0x163563){return respondWithRpcPromise(_0x533c('0x48'),_0x43a333[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x163563,null))['catch'](handleError(_0x163563,null));};exports[_0x533c('0x49')]=function(_0x554a9f,_0x43383e){return respondWithRpcPromise(_0x533c('0x48'),_0x554a9f[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x554a9f[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x43383e,null))['catch'](handleError(_0x43383e,null));};exports['mailAccounts']=function(_0x1005a6,_0x376619){return respondWithRpcPromise(_0x533c('0x4a'),_0x1005a6[_0x533c('0x19')],mailClient)['then'](respondWithResult(_0x376619,null))[_0x533c('0xe')](handleError(_0x376619,null));};exports[_0x533c('0x4b')]=function(_0x8e04c7,_0x352e07){return respondWithRpcPromise(_0x533c('0x4c'),_0x8e04c7[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x352e07,null))[_0x533c('0xe')](handleError(_0x352e07,null));};exports[_0x533c('0x4d')]=function(_0x3aba19,_0x404a93){return respondWithRpcPromise(_0x533c('0x4c'),_0x3aba19[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x3aba19[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x404a93,null))[_0x533c('0xe')](handleError(_0x404a93,null));};exports['smsQueues']=function(_0x31bba1,_0x5206ad){return respondWithRpcPromise('SmsQueues',_0x31bba1[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x5206ad,null))[_0x533c('0xe')](handleError(_0x5206ad,null));};exports[_0x533c('0x4e')]=function(_0x417158,_0x1eaf34){return respondWithRpcPromise(_0x533c('0x4f'),_0x417158['query'],routingClient)[_0x533c('0x9')](findById(_0x417158[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x1eaf34,null))[_0x533c('0xe')](handleError(_0x1eaf34,null));};exports[_0x533c('0x50')]=function(_0x8174d0,_0x3e3b25){return respondWithRpcPromise('WhatsappQueues',_0x8174d0[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x3e3b25,null))['catch'](handleError(_0x3e3b25,null));};exports[_0x533c('0x51')]=function(_0x3e8d57,_0x5f2b8b){return respondWithRpcPromise(_0x533c('0x52'),_0x3e8d57[_0x533c('0x19')],routingClient)['then'](findById(_0x3e8d57[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x5f2b8b,null))['catch'](handleError(_0x5f2b8b,null));};exports[_0x533c('0x53')]=function(_0x28239c,_0x451def){return respondWithRpcPromise(_0x533c('0x54'),_0x28239c['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x451def,null))[_0x533c('0xe')](handleError(_0x451def,null));};exports[_0x533c('0x55')]=function(_0x245792,_0x20d344){return respondWithRpcPromise('FaxQueues',_0x245792[_0x533c('0x19')],routingClient)['then'](findById(_0x245792[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x20d344,null))[_0x533c('0xe')](handleError(_0x20d344,null));};exports['faxAccounts']=function(_0x4bd014,_0x511f74){return respondWithRpcPromise(_0x533c('0x56'),_0x4bd014[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x511f74,null))['catch'](handleError(_0x511f74,null));};exports[_0x533c('0x57')]=function(_0x24a00c,_0x3fbb08){return respondWithRpcPromise(_0x533c('0x58'),_0x24a00c[_0x533c('0x19')],routingClient)['then'](respondWithResult(_0x3fbb08,null))['catch'](handleError(_0x3fbb08,null));};exports[_0x533c('0x59')]=function(_0x313fa5,_0x2c0f59){return respondWithRpcPromise(_0x533c('0x5a'),_0x313fa5[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x2c0f59,null))[_0x533c('0xe')](handleError(_0x2c0f59,null));};exports[_0x533c('0x5b')]=function(_0x45c4ca,_0x4f0961){return respondWithRpcPromise(_0x533c('0x5c'),_0x45c4ca[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x4f0961,null))[_0x533c('0xe')](handleError(_0x4f0961,null));};exports[_0x533c('0x5d')]=function(_0x18102b,_0x1b9816){return respondWithRpcPromise(_0x533c('0x5c'),_0x18102b[_0x533c('0x19')],routingClient)[_0x533c('0x9')](function(_0xfd598d){if(_0x18102b[_0x533c('0x19')][_0x533c('0x5e')]!==undefined){var _0x452915=_(_0xfd598d[_0x533c('0x15')])[_0x533c('0x5f')]([_0x18102b[_0x533c('0x19')]['type'],_0x18102b[_0x533c('0x1c')]['id']])[_0x533c('0x60')]('queue_id')['uniq']()[_0x533c('0x61')]();return _0xfd598d['rows'][_0x533c('0x5f')](function(_0x307fe5){return _0x452915[_0x533c('0x62')](_0x307fe5[_0x533c('0x63')])>-0x1;});}else{return _0xfd598d[_0x533c('0x15')]['filter'](function(_0x275db2){return _0x275db2[_0x533c('0x63')]===parseInt(_0x18102b[_0x533c('0x1c')]['id']);});}})[_0x533c('0x9')](respondWithResult(_0x1b9816,null))[_0x533c('0xe')](handleError(_0x1b9816,null));};exports[_0x533c('0x64')]=function(_0x1aa938,_0x248ede){return respondWithRpcPromise(_0x533c('0x65'),_0x1aa938[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x248ede,null))[_0x533c('0xe')](handleError(_0x248ede,null));};exports[_0x533c('0x66')]=function(_0x452759,_0x9c8d2){return respondWithRpcPromise(_0x533c('0x67'),_0x452759[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x9c8d2,null))['catch'](handleError(_0x9c8d2,null));};exports[_0x533c('0x68')]=function(_0x15d09a,_0x247915){return respondWithRpcPromise(_0x533c('0x69'),_0x15d09a['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x247915,null))[_0x533c('0xe')](handleError(_0x247915,null));};exports['queueNotify']=function(_0x411f86){return function(_0x5b8ead,_0x291be3){var _0x4be94e,_0x11654c;var _0x33a661=_[_0x533c('0x6a')](_0x411f86);var _0x5c938c=_0x411f86==='chat'?'Website':_0x533c('0x6b');return db[_0x33a661+'Queue'][_0x533c('0x6c')]({'raw':!![],'where':{'id':_0x5b8ead[_0x533c('0x1c')]['id']}})[_0x533c('0x9')](function(_0x450152){if(_['isNil'](_0x450152)){throw new Error(_0x33a661+'\x20Queue\x20not\x20found');}_0x4be94e=_0x450152;return db[_0x33a661+_0x533c('0x6d')]['findOne']({'where':{'id':_0x5b8ead[_0x533c('0x25')][_0x533c('0x6e')]},'include':[{'model':db[_0x33a661+_0x533c('0x6f')],'as':'Interaction'},{'model':db[_0x33a661+_0x5c938c],'as':_0x533c('0x6b')}]});})['then'](function(_0x6e0d38){if(_[_0x533c('0x14')](_0x6e0d38)){throw new Error(_0x33a661+'\x20Message\x20not\x20found');}_0x11654c=_0x6e0d38;return _0x6e0d38[_0x533c('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x533c('0x9')](function(){var _0x1c9381={'uniqueid':_0x411f86+'.'+_0x11654c['id']+'.'+_0x11654c[_0x533c('0x6f')]['id'],'FromUserId':_0x5b8ead[_0x533c('0x36')]['id'],'type':_0x533c('0x71')};_0x1c9381[_0x33a661+'MessageId']=_0x11654c['id'];_0x1c9381[_0x33a661+_0x533c('0x72')]=_0x11654c[_0x533c('0x6f')]['id'];_0x1c9381[_0x533c('0x73')+_0x33a661+_0x5c938c+'Id']=_0x11654c['Account']['id'];_0x1c9381['To'+_0x33a661+_0x533c('0x74')]=_0x4be94e['id'];return db[_0x33a661+'TransferReport']['create'](_0x1c9381);})[_0x533c('0x9')](function(){return respondWithRpcPromise(_0x533c('0x75'),{'channel':_0x411f86,'interaction':_0x11654c['Interaction'],'message':_0x11654c,'account':_0x11654c[_0x533c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x533c('0x71'),'appdata':_0x4be94e[_0x533c('0x13')]+','+(_0x11654c[_0x533c('0x6b')][_0x533c('0x76')]||0x12c),'interval':_0x533c('0x77')}]},routingClient);})[_0x533c('0x9')](respondWithResult(_0x291be3,null))[_0x533c('0xe')](handleError(_0x291be3,null));};};exports[_0x533c('0x78')]=function(_0x299f43,_0x14db14){var _0x243d1a,_0x368552;if(_['isNil'](_0x299f43[_0x533c('0x25')][_0x533c('0x79')])){throw new Error(_0x533c('0x7a'));}var _0x4c3f6d=_0x299f43[_0x533c('0x25')]['channel'];var _0x2c7faf=_[_0x533c('0x6a')](_0x4c3f6d);var _0x2377a3=_0x4c3f6d==='chat'?_0x533c('0x7b'):_0x533c('0x6b');return db[_0x533c('0x7c')]['findOne']({'raw':!![],'where':{'id':_0x299f43['params']['id'],'role':_0x533c('0x3e')}})['then'](function(_0x392968){if(_['isNil'](_0x392968)){throw new Error(_0x533c('0x7d'));}_0x243d1a=_0x392968;return db[_0x2c7faf+_0x533c('0x6d')][_0x533c('0x6c')]({'where':{'id':_0x299f43['body']['messageId']},'include':[{'model':db[_0x2c7faf+_0x533c('0x6f')],'as':_0x533c('0x6f')},{'model':db[_0x2c7faf+_0x2377a3],'as':_0x533c('0x6b')}]});})[_0x533c('0x9')](function(_0x313916){if(_[_0x533c('0x14')](_0x313916)){throw new Error(_0x2c7faf+_0x533c('0x7e'));}_0x368552=_0x313916;return _0x313916[_0x533c('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x533c('0x9')](function(){var _0x5307b3={'uniqueid':_0x4c3f6d+'.'+_0x368552['id']+'.'+_0x368552[_0x533c('0x6f')]['id'],'FromUserId':_0x299f43[_0x533c('0x36')]['id'],'type':_0x533c('0x71'),'ToUserId':_0x243d1a['id']};_0x5307b3[_0x2c7faf+'MessageId']=_0x368552['id'];_0x5307b3[_0x2c7faf+_0x533c('0x72')]=_0x368552[_0x533c('0x6f')]['id'];_0x5307b3[_0x533c('0x73')+_0x2c7faf+_0x2377a3+'Id']=_0x368552[_0x533c('0x6b')]['id'];return db[_0x2c7faf+_0x533c('0x7f')][_0x533c('0x80')](_0x5307b3);})[_0x533c('0x9')](function(){return respondWithRpcPromise(_0x533c('0x75'),{'channel':_0x4c3f6d,'interaction':_0x368552[_0x533c('0x6f')],'message':_0x368552,'account':_0x368552[_0x533c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x533c('0x3e'),'appdata':_0x243d1a[_0x533c('0x13')]+','+(_0x368552['Account'][_0x533c('0x81')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x533c('0x9')](respondWithResult(_0x14db14,null))[_0x533c('0xe')](handleError(_0x14db14,null));}; \ No newline at end of file +var _0x7fbe=['VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','SIP/%s','user','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','rows','filter','map','queue_id','uniq','value','indexOf','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','QueueId','create','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','Website','User','Agent\x20not\x20found','From','TransferReport','Start','agentTransferTimeout','*,*,*,*','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','code','message','result','catch','status','json','stack','name','send','isNil','find','voiceChannels','query','VoiceChannelMixMonitor','merge','params','then','voiceQueues','showVoiceQueues','VoiceQueues','UpdateVoiceQueue','body'];(function(_0x40042d,_0x3ce810){var _0x3889a1=function(_0x2fdcbb){while(--_0x2fdcbb){_0x40042d['push'](_0x40042d['shift']());}};_0x3889a1(++_0x3ce810);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x393db8,_0x3e1157){_0x393db8=_0x393db8-0x0;var _0x4295cc=_0x7fbe[_0x393db8];return _0x4295cc;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xe7fb('0x0'));var util=require(_0xe7fb('0x1'));var db=require(_0xe7fb('0x2'))['db'];var logger=require(_0xe7fb('0x3'))(_0xe7fb('0x4'));var jayson=require(_0xe7fb('0x5'));var amiClient=jayson[_0xe7fb('0x6')][_0xe7fb('0x7')]({'port':0x232a});var mailClient=jayson[_0xe7fb('0x6')][_0xe7fb('0x7')]({'port':0x232b});var routingClient=jayson[_0xe7fb('0x6')][_0xe7fb('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){var _0x1d0741=_0x5ad75b?_0x5ad75b:amiClient;return _0x1d0741[_0xe7fb('0x8')](_0x24cd67,_0x1f943f)['then'](function(_0x558857){if(_0x558857[_0xe7fb('0x9')]){if(_0x558857[_0xe7fb('0x9')][_0xe7fb('0xa')]===0x1f4){return _0x228f6b(_0x558857[_0xe7fb('0x9')][_0xe7fb('0xb')]);}return _0x213ebc(_0x558857[_0xe7fb('0x9')][_0xe7fb('0xb')]);}else{_0x213ebc(_0x558857[_0xe7fb('0xc')]);}})[_0xe7fb('0xd')](function(_0x2fe8ab){_0x228f6b(_0x2fe8ab);});});}function respondWithResult(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xc8;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0xe')](_0x188e1d)[_0xe7fb('0xf')](_0xdf9760);}return _0x2437d4['sendStatus'](0x194);};}function handleError(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0x1f4;return function(_0x5573ab){logger[_0xe7fb('0x9')](_0x5573ab[_0xe7fb('0x10')]);if(_0x5573ab['name']){delete _0x5573ab[_0xe7fb('0x11')];}_0x278b75['status'](_0x2225e5)[_0xe7fb('0x12')](_0x5573ab);};}function findById(_0x18d23c){return function(_0x12603d){if(!_[_0xe7fb('0x13')](_0x18d23c)&&!_['isNil'](_0x12603d)&&!_[_0xe7fb('0x13')](_0x12603d['rows'])){return _[_0xe7fb('0x14')](_0x12603d['rows'],function(_0x1e77fd){return _0x1e77fd['id']==_0x18d23c;});}return null;};}exports[_0xe7fb('0x15')]=function(_0x3f96a7,_0x182269){return respondWithRpcPromise('VoiceChannels',_0x3f96a7[_0xe7fb('0x16')])['then'](respondWithResult(_0x182269,null))[_0xe7fb('0xd')](handleError(_0x182269,null));};exports['voiceChannelMixMonitor']=function(_0x15f7a4,_0x4ea664){return respondWithRpcPromise(_0xe7fb('0x17'),_[_0xe7fb('0x18')](_0x15f7a4['query'],_0x15f7a4[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x4ea664,null))[_0xe7fb('0xd')](handleError(_0x4ea664,null));};exports['voiceChannelStopMixMonitor']=function(_0x469d50,_0x469ead){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x469d50['query'],_0x469d50[_0xe7fb('0x19')]))['then'](respondWithResult(_0x469ead,null))['catch'](handleError(_0x469ead,null));};exports[_0xe7fb('0x1b')]=function(_0x32e8b2,_0x2996ae){return respondWithRpcPromise('VoiceQueues',_0x32e8b2[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x2996ae,null))[_0xe7fb('0xd')](handleError(_0x2996ae,null));};exports[_0xe7fb('0x1c')]=function(_0x392d75,_0x16237a){return respondWithRpcPromise(_0xe7fb('0x1d'),_0x392d75['query'])['then'](findById(_0x392d75[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x16237a,null))[_0xe7fb('0xd')](handleError(_0x16237a,null));};exports['updateVoiceQueue']=function(_0xb1f2f4,_0x251807){return respondWithRpcPromise(_0xe7fb('0x1e'),_[_0xe7fb('0x18')](_0xb1f2f4[_0xe7fb('0x1f')],_0xb1f2f4[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x251807,null))[_0xe7fb('0xd')](handleError(_0x251807,null));};exports['voiceQueuesPreview']=function(_0x3d1fb5,_0x1742f3){return respondWithRpcPromise(_0xe7fb('0x20'),_['merge'](_0x3d1fb5['query'],_0x3d1fb5[_0xe7fb('0x19')]))['then'](respondWithResult(_0x1742f3,null))[_0xe7fb('0xd')](handleError(_0x1742f3,null));};exports[_0xe7fb('0x21')]=function(_0xe49053,_0x2a4745){return respondWithRpcPromise('VoiceQueuesChannels',_0xe49053[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x2a4745,null))[_0xe7fb('0xd')](handleError(_0x2a4745,null));};exports[_0xe7fb('0x22')]=function(_0x2d650d,_0x480819){return respondWithRpcPromise(_0xe7fb('0x23'),_[_0xe7fb('0x18')](_0x2d650d[_0xe7fb('0x16')],_0x2d650d[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x480819,null))[_0xe7fb('0xd')](handleError(_0x480819,null));};exports[_0xe7fb('0x24')]=function(_0x147eb1,_0x389903){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xe7fb('0x18')](_0x147eb1[_0xe7fb('0x16')],_0x147eb1[_0xe7fb('0x19')]))['then'](respondWithResult(_0x389903,null))[_0xe7fb('0xd')](handleError(_0x389903,null));};exports[_0xe7fb('0x25')]=function(_0x4218bc,_0x1530b1){return respondWithRpcPromise(_0xe7fb('0x26'),_[_0xe7fb('0x18')](_0x4218bc[_0xe7fb('0x16')],_0x4218bc[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x1530b1,null))[_0xe7fb('0xd')](handleError(_0x1530b1,null));};exports[_0xe7fb('0x27')]=function(_0x3c4f4b,_0x1544f2){return respondWithRpcPromise(_0xe7fb('0x28'),_0x3c4f4b[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x1544f2,null))[_0xe7fb('0xd')](handleError(_0x1544f2,null));};exports[_0xe7fb('0x29')]=function(_0x21e35c,_0x4d6fe6){return respondWithRpcPromise(_0xe7fb('0x2a'),_0x21e35c[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x4d6fe6,null))[_0xe7fb('0xd')](handleError(_0x4d6fe6,null));};exports['agents']=function(_0x3426a9,_0x186418){var _0xd472d;return respondWithRpcPromise(_0xe7fb('0x2b'),_0x3426a9['query'])[_0xe7fb('0x1a')](function(_0x451a6c){_0xd472d=_0x451a6c;return respondWithRpcPromise(_0xe7fb('0x2b'),_0x3426a9[_0xe7fb('0x16')],routingClient);})[_0xe7fb('0x1a')](function(_0xb729fc){return _['merge']({},_0xb729fc,_0xd472d);})[_0xe7fb('0x1a')](respondWithResult(_0x186418,null))[_0xe7fb('0xd')](handleError(_0x186418,null));};exports[_0xe7fb('0x2c')]=function(_0x4b263d,_0x36a341){if(_0x4b263d[_0xe7fb('0x1f')]&&_0x4b263d['body']['interaction']&&_0x4b263d['user']&&_0x4b263d['user']['name']){for(var _0x900d67 in _0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')]){if(_0x4b263d['body'][_0xe7fb('0x2d')]['hasOwnProperty'](_0x900d67)){db[_0xe7fb('0x2e')][_0xe7fb('0x2f')]({'where':{'channel':_0x900d67,'membername':_0x4b263d['user'][_0xe7fb('0x11')],'type':_0xe7fb('0x30'),'exitAt':null,'uniqueid':_0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')][_0x900d67]&&_0x4b263d['body'][_0xe7fb('0x2d')][_0x900d67][_0xe7fb('0x31')]?{'$notIn':_0x4b263d[_0xe7fb('0x1f')]['interaction'][_0x900d67]}:{'$ne':null}}})[_0xe7fb('0x1a')](function(_0x6eb1ab){var _0x13b17f=moment()[_0xe7fb('0x32')](_0xe7fb('0x33'));for(var _0x5a1ce1=0x0,_0x2eb999=_0x6eb1ab['length'];_0x5a1ce1<_0x2eb999;_0x5a1ce1+=0x1){_0x6eb1ab[_0x5a1ce1][_0xe7fb('0x34')]({'exitAt':_0x13b17f});}});for(var _0x468c62=0x0;_0x468c62<_0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')][_0x900d67][_0xe7fb('0x31')];_0x468c62+=0x1){db['MemberReport'][_0xe7fb('0x35')]({'where':{'channel':_0x900d67,'membername':_0x4b263d['user']['name'],'type':_0xe7fb('0x30'),'uniqueid':_0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')][_0x900d67][_0x468c62],'exitAt':null},'defaults':{'channel':_0x900d67,'membername':_0x4b263d['user'][_0xe7fb('0x11')],'interface':_[_0xe7fb('0x13')](_0x4b263d['user']['interface'])?util[_0xe7fb('0x32')](_0xe7fb('0x36'),_0x4b263d[_0xe7fb('0x37')][_0xe7fb('0x11')]):_0x4b263d[_0xe7fb('0x37')][_0xe7fb('0x38')],'type':_0xe7fb('0x30'),'enterAt':moment()[_0xe7fb('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xe7fb('0x39'),'internal':_0x4b263d['user'][_0xe7fb('0x3a')],'uniqueid':_0x4b263d[_0xe7fb('0x1f')]['interaction'][_0x900d67][_0x468c62]}});}}}}return respondWithRpcPromise(_0xe7fb('0x3b'),{'id':_0x4b263d['params']['id'],'capacity':_0x4b263d[_0xe7fb('0x1f')]['capacity']},routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x36a341,null))['catch'](handleError(_0x36a341,null));};exports[_0xe7fb('0x3c')]=function(_0x59158c,_0x1fff6c){return respondWithRpcPromise(_0xe7fb('0x3d'),_0x59158c[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x1fff6c,null))[_0xe7fb('0xd')](handleError(_0x1fff6c,null));};exports[_0xe7fb('0x3e')]=function(_0x2f4760,_0x582a4a){return respondWithRpcPromise('Trunks',_0x2f4760[_0xe7fb('0x16')])['then'](respondWithResult(_0x582a4a,null))['catch'](handleError(_0x582a4a,null));};exports['campaigns']=function(_0x50b8df,_0x539252){return respondWithRpcPromise(_0xe7fb('0x3f'),_0x50b8df[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x539252,null))[_0xe7fb('0xd')](handleError(_0x539252,null));};exports['chatQueues']=function(_0x37af37,_0x236b35){return respondWithRpcPromise(_0xe7fb('0x40'),_0x37af37['query'],routingClient)['then'](respondWithResult(_0x236b35,null))[_0xe7fb('0xd')](handleError(_0x236b35,null));};exports[_0xe7fb('0x41')]=function(_0x300b8e,_0x4f4ba3){return respondWithRpcPromise(_0xe7fb('0x40'),_0x300b8e[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x300b8e[_0xe7fb('0x19')]['id']))['then'](respondWithResult(_0x4f4ba3,null))['catch'](handleError(_0x4f4ba3,null));};exports[_0xe7fb('0x42')]=function(_0x3104c2,_0x1f16b2){return respondWithRpcPromise(_0xe7fb('0x43'),_0x3104c2[_0xe7fb('0x16')],routingClient)['then'](respondWithResult(_0x1f16b2,null))[_0xe7fb('0xd')](handleError(_0x1f16b2,null));};exports[_0xe7fb('0x44')]=function(_0x23755b,_0x590d7a){return respondWithRpcPromise('MailQueues',_0x23755b[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x23755b[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x590d7a,null))[_0xe7fb('0xd')](handleError(_0x590d7a,null));};exports[_0xe7fb('0x45')]=function(_0x585b7c,_0x1e21e4){return respondWithRpcPromise(_0xe7fb('0x46'),_0x585b7c[_0xe7fb('0x16')],mailClient)[_0xe7fb('0x1a')](respondWithResult(_0x1e21e4,null))[_0xe7fb('0xd')](handleError(_0x1e21e4,null));};exports[_0xe7fb('0x47')]=function(_0x554092,_0x2e457c){return respondWithRpcPromise('OpenchannelQueues',_0x554092[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x2e457c,null))[_0xe7fb('0xd')](handleError(_0x2e457c,null));};exports[_0xe7fb('0x48')]=function(_0x5925e6,_0x47ac92){return respondWithRpcPromise(_0xe7fb('0x49'),_0x5925e6[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x5925e6[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x47ac92,null))['catch'](handleError(_0x47ac92,null));};exports[_0xe7fb('0x4a')]=function(_0x58d4ec,_0x127b0e){return respondWithRpcPromise('SmsQueues',_0x58d4ec['query'],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x127b0e,null))[_0xe7fb('0xd')](handleError(_0x127b0e,null));};exports[_0xe7fb('0x4b')]=function(_0x5da884,_0x475716){return respondWithRpcPromise(_0xe7fb('0x4c'),_0x5da884[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x5da884[_0xe7fb('0x19')]['id']))['then'](respondWithResult(_0x475716,null))[_0xe7fb('0xd')](handleError(_0x475716,null));};exports[_0xe7fb('0x4d')]=function(_0x5151ec,_0x4136ae){return respondWithRpcPromise(_0xe7fb('0x4e'),_0x5151ec['query'],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x4136ae,null))['catch'](handleError(_0x4136ae,null));};exports[_0xe7fb('0x4f')]=function(_0x1dc9c1,_0xa93f35){return respondWithRpcPromise('WhatsappQueues',_0x1dc9c1[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x1dc9c1[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0xa93f35,null))[_0xe7fb('0xd')](handleError(_0xa93f35,null));};exports[_0xe7fb('0x50')]=function(_0xcdc72e,_0x187040){return respondWithRpcPromise('FaxQueues',_0xcdc72e['query'],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x187040,null))[_0xe7fb('0xd')](handleError(_0x187040,null));};exports[_0xe7fb('0x51')]=function(_0x50c705,_0x519c5f){return respondWithRpcPromise(_0xe7fb('0x52'),_0x50c705[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x50c705[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x519c5f,null))[_0xe7fb('0xd')](handleError(_0x519c5f,null));};exports[_0xe7fb('0x53')]=function(_0x3f11f1,_0xb06693){return respondWithRpcPromise(_0xe7fb('0x54'),_0x3f11f1[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0xb06693,null))[_0xe7fb('0xd')](handleError(_0xb06693,null));};exports['chatQueuesWaitingInteractions']=function(_0x4fa142,_0x125427){return respondWithRpcPromise(_0xe7fb('0x55'),_0x4fa142[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x125427,null))[_0xe7fb('0xd')](handleError(_0x125427,null));};exports['mailQueuesWaitingInteractions']=function(_0x43f14b,_0x1beb13){return respondWithRpcPromise(_0xe7fb('0x56'),_0x43f14b[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x1beb13,null))[_0xe7fb('0xd')](handleError(_0x1beb13,null));};exports[_0xe7fb('0x57')]=function(_0x1e6256,_0xa7fa61){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1e6256[_0xe7fb('0x16')],routingClient)['then'](respondWithResult(_0xa7fa61,null))[_0xe7fb('0xd')](handleError(_0xa7fa61,null));};exports[_0xe7fb('0x58')]=function(_0x2a2079,_0x31c159){return respondWithRpcPromise(_0xe7fb('0x59'),_0x2a2079['query'],routingClient)[_0xe7fb('0x1a')](function(_0x38e66a){if(_0x2a2079[_0xe7fb('0x16')][_0xe7fb('0x5a')]!==undefined){var _0x15d881=_(_0x38e66a[_0xe7fb('0x5b')])[_0xe7fb('0x5c')]([_0x2a2079[_0xe7fb('0x16')][_0xe7fb('0x5a')],_0x2a2079[_0xe7fb('0x19')]['id']])[_0xe7fb('0x5d')](_0xe7fb('0x5e'))[_0xe7fb('0x5f')]()[_0xe7fb('0x60')]();return _0x38e66a['rows']['filter'](function(_0x48a015){return _0x15d881[_0xe7fb('0x61')](_0x48a015[_0xe7fb('0x5e')])>-0x1;});}else{return _0x38e66a[_0xe7fb('0x5b')][_0xe7fb('0x5c')](function(_0x535e8b){return _0x535e8b[_0xe7fb('0x5e')]===parseInt(_0x2a2079[_0xe7fb('0x19')]['id']);});}})[_0xe7fb('0x1a')](respondWithResult(_0x31c159,null))[_0xe7fb('0xd')](handleError(_0x31c159,null));};exports['smsQueuesWaitingInteractions']=function(_0x2f7fa6,_0x5650c6){return respondWithRpcPromise(_0xe7fb('0x62'),_0x2f7fa6[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x5650c6,null))[_0xe7fb('0xd')](handleError(_0x5650c6,null));};exports[_0xe7fb('0x63')]=function(_0x4ab541,_0x3ffd6c){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x4ab541[_0xe7fb('0x16')],routingClient)['then'](respondWithResult(_0x3ffd6c,null))[_0xe7fb('0xd')](handleError(_0x3ffd6c,null));};exports[_0xe7fb('0x64')]=function(_0x4c37cd,_0x2b6d69){return respondWithRpcPromise(_0xe7fb('0x65'),_0x4c37cd[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x2b6d69,null))['catch'](handleError(_0x2b6d69,null));};exports[_0xe7fb('0x66')]=function(_0x277335){return function(_0x1412e2,_0x4d0eed){var _0x11d5b6,_0x4b2cc4;var _0x5b1e28=_['capitalize'](_0x277335);var _0x3c99e7=_0x277335===_0xe7fb('0x67')?'Website':_0xe7fb('0x68');return db[_0x5b1e28+_0xe7fb('0x69')][_0xe7fb('0x6a')]({'raw':!![],'where':{'id':_0x1412e2[_0xe7fb('0x19')]['id']}})[_0xe7fb('0x1a')](function(_0x1cc21d){if(_[_0xe7fb('0x13')](_0x1cc21d)){throw new Error(_0x5b1e28+_0xe7fb('0x6b'));}_0x11d5b6=_0x1cc21d;return db[_0x5b1e28+_0xe7fb('0x6c')][_0xe7fb('0x6a')]({'where':{'id':_0x1412e2[_0xe7fb('0x1f')][_0xe7fb('0x6d')]},'include':[{'model':db[_0x5b1e28+_0xe7fb('0x6e')],'as':_0xe7fb('0x6e')},{'model':db[_0x5b1e28+_0x3c99e7],'as':_0xe7fb('0x68')}]});})[_0xe7fb('0x1a')](function(_0x3c5bd9){if(_[_0xe7fb('0x13')](_0x3c5bd9)){throw new Error(_0x5b1e28+_0xe7fb('0x6f'));}_0x4b2cc4=_0x3c5bd9;return _0x3c5bd9[_0xe7fb('0x70')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x47568c={'uniqueid':_0x277335+'.'+_0x4b2cc4['id']+'.'+_0x4b2cc4[_0xe7fb('0x6e')]['id'],'FromUserId':_0x1412e2[_0xe7fb('0x37')]['id'],'type':_0xe7fb('0x71')};_0x47568c[_0x5b1e28+_0xe7fb('0x72')]=_0x4b2cc4['id'];_0x47568c[_0x5b1e28+_0xe7fb('0x73')]=_0x4b2cc4[_0xe7fb('0x6e')]['id'];_0x47568c['From'+_0x5b1e28+_0x3c99e7+'Id']=_0x4b2cc4['Account']['id'];_0x47568c['To'+_0x5b1e28+_0xe7fb('0x74')]=_0x11d5b6['id'];return db[_0x5b1e28+'TransferReport'][_0xe7fb('0x75')](_0x47568c);})[_0xe7fb('0x1a')](function(){return respondWithRpcPromise('Start',{'channel':_0x277335,'interaction':_0x4b2cc4[_0xe7fb('0x6e')],'message':_0x4b2cc4,'account':_0x4b2cc4[_0xe7fb('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe7fb('0x71'),'appdata':_0x11d5b6[_0xe7fb('0x11')]+','+(_0x4b2cc4[_0xe7fb('0x68')][_0xe7fb('0x76')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe7fb('0x1a')](respondWithResult(_0x4d0eed,null))[_0xe7fb('0xd')](handleError(_0x4d0eed,null));};};exports[_0xe7fb('0x77')]=function(_0xae9441,_0x276c28){var _0xd5a417,_0x48de0c;if(_['isNil'](_0xae9441['body'][_0xe7fb('0x78')])){throw new Error(_0xe7fb('0x79'));}var _0x2b0600=_0xae9441['body'][_0xe7fb('0x78')];var _0x57ee3b=_[_0xe7fb('0x7a')](_0x2b0600);var _0x278a6c=_0x2b0600===_0xe7fb('0x67')?_0xe7fb('0x7b'):'Account';return db[_0xe7fb('0x7c')][_0xe7fb('0x6a')]({'raw':!![],'where':{'id':_0xae9441[_0xe7fb('0x19')]['id'],'role':_0xe7fb('0x39')}})[_0xe7fb('0x1a')](function(_0x33262f){if(_[_0xe7fb('0x13')](_0x33262f)){throw new Error(_0xe7fb('0x7d'));}_0xd5a417=_0x33262f;return db[_0x57ee3b+'Message']['findOne']({'where':{'id':_0xae9441[_0xe7fb('0x1f')]['messageId']},'include':[{'model':db[_0x57ee3b+_0xe7fb('0x6e')],'as':_0xe7fb('0x6e')},{'model':db[_0x57ee3b+_0x278a6c],'as':_0xe7fb('0x68')}]});})[_0xe7fb('0x1a')](function(_0x58352d){if(_['isNil'](_0x58352d)){throw new Error(_0x57ee3b+_0xe7fb('0x6f'));}_0x48de0c=_0x58352d;return _0x58352d[_0xe7fb('0x70')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x21cb12={'uniqueid':_0x2b0600+'.'+_0x48de0c['id']+'.'+_0x48de0c[_0xe7fb('0x6e')]['id'],'FromUserId':_0xae9441[_0xe7fb('0x37')]['id'],'type':_0xe7fb('0x71'),'ToUserId':_0xd5a417['id']};_0x21cb12[_0x57ee3b+_0xe7fb('0x72')]=_0x48de0c['id'];_0x21cb12[_0x57ee3b+_0xe7fb('0x73')]=_0x48de0c['Interaction']['id'];_0x21cb12[_0xe7fb('0x7e')+_0x57ee3b+_0x278a6c+'Id']=_0x48de0c[_0xe7fb('0x68')]['id'];return db[_0x57ee3b+_0xe7fb('0x7f')][_0xe7fb('0x75')](_0x21cb12);})[_0xe7fb('0x1a')](function(){return respondWithRpcPromise(_0xe7fb('0x80'),{'channel':_0x2b0600,'interaction':_0x48de0c[_0xe7fb('0x6e')],'message':_0x48de0c,'account':_0x48de0c[_0xe7fb('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe7fb('0x39'),'appdata':_0xd5a417[_0xe7fb('0x11')]+','+(_0x48de0c[_0xe7fb('0x68')][_0xe7fb('0x81')]||0x12c),'interval':_0xe7fb('0x82')}]},routingClient);})[_0xe7fb('0x1a')](respondWithResult(_0x276c28,null))[_0xe7fb('0xd')](handleError(_0x276c28,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index f669bb1..a2bfa7d 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 _0x41ea=['fs-extra','../../components/auth/service','../../components/interaction/service','get','index','show','/:id/run','isAuthenticated','run','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x41ea,0xed));var _0xa41e=function(_0x315931,_0x5ee8a1){_0x315931=_0x315931-0x0;var _0x52a907=_0x41ea[_0x315931];return _0x52a907;};'use strict';var multer=require('multer');var util=require(_0xa41e('0x0'));var path=require(_0xa41e('0x1'));var timeout=require(_0xa41e('0x2'));var express=require(_0xa41e('0x3'));var router=express[_0xa41e('0x4')]();var fs_extra=require(_0xa41e('0x5'));var auth=require(_0xa41e('0x6'));var interaction=require(_0xa41e('0x7'));var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0xa41e('0x8')]('/',auth['isAuthenticated'](),controller[_0xa41e('0x9')]);router[_0xa41e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xa41e('0xa')]);router[_0xa41e('0x8')](_0xa41e('0xb'),auth[_0xa41e('0xc')](),controller[_0xa41e('0xd')]);router[_0xa41e('0xe')]('/',auth['isAuthenticated'](),controller[_0xa41e('0xf')]);router[_0xa41e('0x10')](_0xa41e('0x11'),auth[_0xa41e('0xc')](),controller[_0xa41e('0x12')]);router[_0xa41e('0x13')]('/:id',auth[_0xa41e('0xc')](),controller[_0xa41e('0x14')]);module[_0xa41e('0x15')]=router; \ No newline at end of file +var _0xafa9=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./schedule.controller','get','/:id','show','run','isAuthenticated','put','update','delete','destroy','multer','util','path'];(function(_0x3aa1b1,_0x7f8d7e){var _0x46d63d=function(_0x5533e4){while(--_0x5533e4){_0x3aa1b1['push'](_0x3aa1b1['shift']());}};_0x46d63d(++_0x7f8d7e);}(_0xafa9,0x166));var _0x9afa=function(_0x17e4f9,_0x4318be){_0x17e4f9=_0x17e4f9-0x0;var _0xf6cb46=_0xafa9[_0x17e4f9];return _0xf6cb46;};'use strict';var multer=require(_0x9afa('0x0'));var util=require(_0x9afa('0x1'));var path=require(_0x9afa('0x2'));var timeout=require(_0x9afa('0x3'));var express=require(_0x9afa('0x4'));var router=express[_0x9afa('0x5')]();var fs_extra=require(_0x9afa('0x6'));var auth=require(_0x9afa('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9afa('0x8'));var controller=require(_0x9afa('0x9'));router[_0x9afa('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9afa('0xa')](_0x9afa('0xb'),auth['isAuthenticated'](),controller[_0x9afa('0xc')]);router[_0x9afa('0xa')]('/:id/run',auth['isAuthenticated'](),controller[_0x9afa('0xd')]);router['post']('/',auth[_0x9afa('0xe')](),controller['create']);router[_0x9afa('0xf')]('/:id',auth[_0x9afa('0xe')](),controller[_0x9afa('0x10')]);router[_0x9afa('0x11')](_0x9afa('0xb'),auth[_0x9afa('0xe')](),controller[_0x9afa('0x12')]);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 1e1c5d7..d0ef5db 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 _0x4fbe=['pdf','custom','default','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','weeks','days','hours','minutes','csv'];(function(_0x1866ea,_0x547489){var _0x34f90a=function(_0x2b9a5c){while(--_0x2b9a5c){_0x1866ea['push'](_0x1866ea['shift']());}};_0x34f90a(++_0x547489);}(_0x4fbe,0x8c));var _0xe4fb=function(_0x4158ac,_0x5ece2f){_0x4158ac=_0x4158ac-0x0;var _0x500332=_0x4fbe[_0x4158ac];return _0x500332;};'use strict';var Sequelize=require(_0xe4fb('0x0'));module['exports']={'name':{'type':Sequelize[_0xe4fb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe4fb('0x1')]},'active':{'type':Sequelize[_0xe4fb('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe4fb('0x1')],'allowNull':![],'defaultValue':_0xe4fb('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xe4fb('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xe4fb('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xe4fb('0x6')]('years',_0xe4fb('0x7'),'months',_0xe4fb('0x8'),_0xe4fb('0x9'),_0xe4fb('0xa'),_0xe4fb('0xb')),'allowNull':![],'defaultValue':_0xe4fb('0x9')},'output':{'type':Sequelize[_0xe4fb('0x6')](_0xe4fb('0xc'),_0xe4fb('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0xe4fb('0xc')},'type':{'type':Sequelize['ENUM'](_0xe4fb('0xe'),_0xe4fb('0xf')),'allowNull':![],'defaultValue':_0xe4fb('0xe')},'sendMail':{'type':Sequelize[_0xe4fb('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xe4fb('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xe4fb('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xe4fb('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xdd5f=['quarters','months','weeks','days','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM'];(function(_0x1b4abf,_0x17d4cd){var _0x363cff=function(_0x38db71){while(--_0x38db71){_0x1b4abf['push'](_0x1b4abf['shift']());}};_0x363cff(++_0x17d4cd);}(_0xdd5f,0x16f));var _0xfdd5=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xdd5f[_0x576170];return _0x397c70;};'use strict';var Sequelize=require(_0xfdd5('0x0'));module[_0xfdd5('0x1')]={'name':{'type':Sequelize[_0xfdd5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfdd5('0x2')]},'active':{'type':Sequelize[_0xfdd5('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfdd5('0x4')},'startAt':{'type':Sequelize[_0xfdd5('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xfdd5('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xfdd5('0x6')]('years',_0xfdd5('0x7'),_0xfdd5('0x8'),_0xfdd5('0x9'),_0xfdd5('0xa'),'hours','minutes'),'allowNull':![],'defaultValue':_0xfdd5('0xa')},'output':{'type':Sequelize['ENUM'](_0xfdd5('0xb'),_0xfdd5('0xc'),_0xfdd5('0xd')),'allowNull':![],'defaultValue':_0xfdd5('0xb')},'type':{'type':Sequelize[_0xfdd5('0x6')](_0xfdd5('0xe'),_0xfdd5('0xf')),'allowNull':![],'defaultValue':_0xfdd5('0xe')},'sendMail':{'type':Sequelize[_0xfdd5('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xfdd5('0x2')]},'cc':{'type':Sequelize[_0xfdd5('0x10')]},'bcc':{'type':Sequelize[_0xfdd5('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xfdd5('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index e608274..15d2ca3 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 _0xba2e=['../../config/schedule','run','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','name','send','Schedule','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba2e,0x192));var _0xeba2=function(_0x4e1355,_0x5832d1){_0x4e1355=_0x4e1355-0x0;var _0x42650e=_0xba2e[_0x4e1355];return _0x42650e;};'use strict';var emlformat=require(_0xeba2('0x0'));var rimraf=require(_0xeba2('0x1'));var zipdir=require(_0xeba2('0x2'));var jsonpatch=require(_0xeba2('0x3'));var rp=require('request-promise');var moment=require(_0xeba2('0x4'));var BPromise=require(_0xeba2('0x5'));var Mustache=require('mustache');var util=require(_0xeba2('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('fs-extra');var _=require(_0xeba2('0x7'));var squel=require(_0xeba2('0x8'));var crypto=require(_0xeba2('0x9'));var jsforce=require(_0xeba2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xeba2('0xb'));var querystring=require(_0xeba2('0xc'));var Papa=require(_0xeba2('0xd'));var Redis=require(_0xeba2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xeba2('0xf'));var as=require(_0xeba2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeba2('0x11'))(_0xeba2('0x12'));var utils=require(_0xeba2('0x13'));var config=require(_0xeba2('0x14'));var licenseUtil=require(_0xeba2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d0b40,_0x52268e){_0x52268e=_0x52268e||0xcc;return function(_0x521587){if(_0x521587){return _0x2d0b40[_0xeba2('0x16')](_0x52268e);}return _0x2d0b40[_0xeba2('0x17')](_0x52268e)[_0xeba2('0x18')]();};}function respondWithResult(_0x245f88,_0x9a396){_0x9a396=_0x9a396||0xc8;return function(_0xa9fb35){if(_0xa9fb35){return _0x245f88[_0xeba2('0x17')](_0x9a396)[_0xeba2('0x19')](_0xa9fb35);}};}function respondWithFilteredResult(_0x42066f,_0x23a1f7){return function(_0x3e64ce){if(_0x3e64ce){var _0x5ccb4f=typeof _0x23a1f7[_0xeba2('0x1a')]===_0xeba2('0x1b')&&typeof _0x23a1f7[_0xeba2('0x1c')]===_0xeba2('0x1b');var _0x37271a=_0x3e64ce[_0xeba2('0x1d')];var _0x1ac2c6=_0x5ccb4f?0x0:_0x23a1f7[_0xeba2('0x1a')];var _0x57ccb0=_0x5ccb4f?_0x3e64ce['count']:_0x23a1f7[_0xeba2('0x1a')]+_0x23a1f7[_0xeba2('0x1c')];var _0x582e16;if(_0x57ccb0>=_0x37271a){_0x57ccb0=_0x37271a;_0x582e16=0xc8;}else{_0x582e16=0xce;}_0x42066f[_0xeba2('0x17')](_0x582e16);return _0x42066f[_0xeba2('0x1e')](_0xeba2('0x1f'),_0x1ac2c6+'-'+_0x57ccb0+'/'+_0x37271a)[_0xeba2('0x19')](_0x3e64ce);}return null;};}function patchUpdates(_0x57e65a){return function(_0x1739ef){try{jsonpatch[_0xeba2('0x20')](_0x1739ef,_0x57e65a,!![]);}catch(_0x5171d8){return BPromise[_0xeba2('0x21')](_0x5171d8);}return _0x1739ef[_0xeba2('0x22')]();};}function saveUpdates(_0x3072f5,_0x17cc6b){return function(_0x3f576a){if(_0x3f576a){return _0x3f576a[_0xeba2('0x23')](_0x3072f5)['then'](function(_0x3afa0b){return _0x3afa0b;});}return null;};}function removeEntity(_0x2fd2a8,_0x36ac14){return function(_0x1a9ca2){if(_0x1a9ca2){return _0x1a9ca2[_0xeba2('0x24')]()[_0xeba2('0x25')](function(){var _0x9dd0e4=_0x1a9ca2[_0xeba2('0x26')]({'plain':!![]});var _0x189cd4='Scheduler';return db['UserProfileResource'][_0xeba2('0x24')]({'where':{'type':_0x189cd4,'resourceId':_0x9dd0e4['id']}})[_0xeba2('0x25')](function(){return _0x1a9ca2;});})[_0xeba2('0x25')](function(){_0x2fd2a8[_0xeba2('0x17')](0xcc)[_0xeba2('0x18')]();});}};}function handleEntityNotFound(_0x4f1514,_0x4c5540){return function(_0x1fd1a9){if(!_0x1fd1a9){_0x4f1514[_0xeba2('0x16')](0x194);}return _0x1fd1a9;};}function handleError(_0x3f9d25,_0x5c62e5){_0x5c62e5=_0x5c62e5||0x1f4;return function(_0x5dbcfd){logger['error'](_0x5dbcfd['stack']);if(_0x5dbcfd[_0xeba2('0x27')]){delete _0x5dbcfd['name'];}_0x3f9d25[_0xeba2('0x17')](_0x5c62e5)[_0xeba2('0x28')](_0x5dbcfd);};}exports['index']=function(_0x3e452e,_0x4b2905){var _0x5acbfe={},_0x5369ac={},_0x2e1f0a={'count':0x0,'rows':[]};var _0x4474a5=_['map'](db[_0xeba2('0x29')][_0xeba2('0x2a')],function(_0x2f594c){return{'name':_0x2f594c[_0xeba2('0x2b')],'type':_0x2f594c[_0xeba2('0x2c')]['key']};});_0x5369ac[_0xeba2('0x2d')]=_['map'](_0x4474a5,_0xeba2('0x27'));_0x5369ac[_0xeba2('0x2e')]=_[_0xeba2('0x2f')](_0x3e452e[_0xeba2('0x2e')]);_0x5369ac[_0xeba2('0x30')]=_['intersection'](_0x5369ac['model'],_0x5369ac[_0xeba2('0x2e')]);_0x5acbfe[_0xeba2('0x31')]=_[_0xeba2('0x32')](_0x5369ac[_0xeba2('0x2d')],qs[_0xeba2('0x33')](_0x3e452e[_0xeba2('0x2e')][_0xeba2('0x33')]));_0x5acbfe[_0xeba2('0x31')]=_0x5acbfe['attributes'][_0xeba2('0x34')]?_0x5acbfe[_0xeba2('0x31')]:_0x5369ac[_0xeba2('0x2d')];if(!_0x3e452e['query'][_0xeba2('0x35')]('nolimit')){_0x5acbfe[_0xeba2('0x1c')]=qs[_0xeba2('0x1c')](_0x3e452e['query'][_0xeba2('0x1c')]);_0x5acbfe['offset']=qs[_0xeba2('0x1a')](_0x3e452e['query'][_0xeba2('0x1a')]);}_0x5acbfe['order']=qs[_0xeba2('0x36')](_0x3e452e['query']['sort']);_0x5acbfe[_0xeba2('0x37')]=qs[_0xeba2('0x30')](_[_0xeba2('0x38')](_0x3e452e[_0xeba2('0x2e')],_0x5369ac[_0xeba2('0x30')]),_0x4474a5);if(_0x3e452e[_0xeba2('0x2e')]['filter']){_0x5acbfe['where']=_[_0xeba2('0x39')](_0x5acbfe[_0xeba2('0x37')],{'$or':_['map'](_0x4474a5,function(_0x1c89e2){if(_0x1c89e2[_0xeba2('0x2c')]!==_0xeba2('0x3a')){var _0x5bf2f9={};_0x5bf2f9[_0x1c89e2[_0xeba2('0x27')]]={'$like':'%'+_0x3e452e[_0xeba2('0x2e')][_0xeba2('0x3b')]+'%'};return _0x5bf2f9;}})});}_0x5acbfe=_[_0xeba2('0x39')]({},_0x5acbfe,_0x3e452e[_0xeba2('0x3c')]);var _0x47a648={'where':_0x5acbfe[_0xeba2('0x37')]};return db[_0xeba2('0x29')][_0xeba2('0x1d')](_0x47a648)[_0xeba2('0x25')](function(_0x432ef1){_0x2e1f0a['count']=_0x432ef1;if(_0x3e452e['query'][_0xeba2('0x3d')]){_0x5acbfe['include']=[{'all':!![]}];}return db['Schedule'][_0xeba2('0x3e')](_0x5acbfe);})[_0xeba2('0x25')](function(_0x398956){_0x2e1f0a[_0xeba2('0x3f')]=_0x398956;return _0x2e1f0a;})[_0xeba2('0x25')](respondWithFilteredResult(_0x4b2905,_0x5acbfe))[_0xeba2('0x40')](handleError(_0x4b2905,null));};exports[_0xeba2('0x41')]=function(_0x2e08e2,_0x59e618){var _0x32755b={'raw':![],'where':{'id':_0x2e08e2[_0xeba2('0x42')]['id']}},_0xf1f81={};_0xf1f81['model']=_['keys'](db[_0xeba2('0x29')][_0xeba2('0x2a')]);_0xf1f81['query']=_[_0xeba2('0x2f')](_0x2e08e2['query']);_0xf1f81['filters']=_[_0xeba2('0x32')](_0xf1f81[_0xeba2('0x2d')],_0xf1f81[_0xeba2('0x2e')]);_0x32755b[_0xeba2('0x31')]=_['intersection'](_0xf1f81['model'],qs[_0xeba2('0x33')](_0x2e08e2['query'][_0xeba2('0x33')]));_0x32755b[_0xeba2('0x31')]=_0x32755b[_0xeba2('0x31')]['length']?_0x32755b[_0xeba2('0x31')]:_0xf1f81[_0xeba2('0x2d')];if(_0x2e08e2['query']['includeAll']){_0x32755b[_0xeba2('0x43')]=[{'all':!![]}];}_0x32755b=_[_0xeba2('0x39')]({},_0x32755b,_0x2e08e2[_0xeba2('0x3c')]);return db['Schedule'][_0xeba2('0x44')](_0x32755b)[_0xeba2('0x25')](handleEntityNotFound(_0x59e618,null))[_0xeba2('0x25')](respondWithResult(_0x59e618,null))[_0xeba2('0x40')](handleError(_0x59e618,null));};exports[_0xeba2('0x45')]=function(_0x44beae,_0x27c711){return db[_0xeba2('0x29')][_0xeba2('0x45')](_0x44beae[_0xeba2('0x46')],{})['then'](function(_0x19874f){var _0x20c614=_0x44beae[_0xeba2('0x47')][_0xeba2('0x26')]({'plain':!![]});if(!_0x20c614)throw new Error(_0xeba2('0x48'));if(_0x20c614['role']===_0xeba2('0x47')){var _0x4165c8=_0x19874f[_0xeba2('0x26')]({'plain':!![]});var _0x59d30c='Scheduler';return db['UserProfileSection']['find']({'where':{'name':_0x59d30c,'userProfileId':_0x20c614[_0xeba2('0x49')]},'raw':!![]})['then'](function(_0x52a200){if(_0x52a200&&_0x52a200[_0xeba2('0x4a')]===0x0){return db[_0xeba2('0x4b')][_0xeba2('0x45')]({'name':_0x4165c8[_0xeba2('0x27')],'resourceId':_0x4165c8['id'],'type':_0x52a200[_0xeba2('0x27')],'sectionId':_0x52a200['id']},{})['then'](function(){return _0x19874f;});}else{return _0x19874f;}})[_0xeba2('0x40')](function(_0x4da72c){logger[_0xeba2('0x4c')](_0xeba2('0x4d'),_0x4da72c);throw _0x4da72c;});}return _0x19874f;})[_0xeba2('0x25')](respondWithResult(_0x27c711,0xc9))[_0xeba2('0x40')](handleError(_0x27c711,null));};exports[_0xeba2('0x23')]=function(_0x1bbcee,_0x4dd2f9){if(_0x1bbcee[_0xeba2('0x46')]['id']){delete _0x1bbcee[_0xeba2('0x46')]['id'];}return db['Schedule'][_0xeba2('0x44')]({'where':{'id':_0x1bbcee[_0xeba2('0x42')]['id']}})['then'](handleEntityNotFound(_0x4dd2f9,null))['then'](saveUpdates(_0x1bbcee[_0xeba2('0x46')],null))[_0xeba2('0x25')](respondWithResult(_0x4dd2f9,null))[_0xeba2('0x40')](handleError(_0x4dd2f9,null));};exports[_0xeba2('0x24')]=function(_0x5a731d,_0x31c7f7){return db[_0xeba2('0x29')][_0xeba2('0x44')]({'where':{'id':_0x5a731d[_0xeba2('0x42')]['id']}})[_0xeba2('0x25')](handleEntityNotFound(_0x31c7f7,null))[_0xeba2('0x25')](removeEntity(_0x31c7f7,null))[_0xeba2('0x40')](handleError(_0x31c7f7,null));};exports['run']=function(_0x1614d0,_0x292310,_0x506726){var _0x1e2b9e=require(_0xeba2('0x4e'));return db[_0xeba2('0x29')][_0xeba2('0x44')]({'where':{'id':_0x1614d0[_0xeba2('0x42')]['id']},'raw':!![]})[_0xeba2('0x25')](handleEntityNotFound(_0x292310,null))[_0xeba2('0x25')](function(){_0x1e2b9e[_0xeba2('0x4f')](_0x1614d0[_0xeba2('0x42')]['id']);})[_0xeba2('0x25')](respondWithStatusCode(_0x292310,null))[_0xeba2('0x40')](handleError(_0x292310,null));}; \ No newline at end of file +var _0xd3d8=['filter','VIRTUAL','merge','options','Schedule','includeAll','include','findAll','catch','show','params','create','user','find','userProfileId','error','body','run','../../config/schedule','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','UserProfileResource','destroy','stack','name','index','map','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x496905,_0x36a733){var _0x2e0e19=function(_0x12df4b){while(--_0x12df4b){_0x496905['push'](_0x496905['shift']());}};_0x2e0e19(++_0x36a733);}(_0xd3d8,0x14b));var _0x8d3d=function(_0x230388,_0x58cfca){_0x230388=_0x230388-0x0;var _0x115c7b=_0xd3d8[_0x230388];return _0x115c7b;};'use strict';var emlformat=require(_0x8d3d('0x0'));var rimraf=require(_0x8d3d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8d3d('0x2'));var moment=require(_0x8d3d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8d3d('0x4'));var util=require(_0x8d3d('0x5'));var path=require(_0x8d3d('0x6'));var sox=require('sox');var csv=require(_0x8d3d('0x7'));var ejs=require(_0x8d3d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d3d('0x9'));var squel=require(_0x8d3d('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8d3d('0xb'));var toCsv=require(_0x8d3d('0x7'));var querystring=require(_0x8d3d('0xc'));var Papa=require(_0x8d3d('0xd'));var Redis=require(_0x8d3d('0xe'));var authService=require(_0x8d3d('0xf'));var qs=require(_0x8d3d('0x10'));var as=require(_0x8d3d('0x11'));var hardwareService=require(_0x8d3d('0x12'));var logger=require('../../config/logger')(_0x8d3d('0x13'));var utils=require('../../config/utils');var config=require(_0x8d3d('0x14'));var licenseUtil=require(_0x8d3d('0x15'));var db=require(_0x8d3d('0x16'))['db'];function respondWithStatusCode(_0x4299b1,_0x2a78dc){_0x2a78dc=_0x2a78dc||0xcc;return function(_0x852ad7){if(_0x852ad7){return _0x4299b1[_0x8d3d('0x17')](_0x2a78dc);}return _0x4299b1[_0x8d3d('0x18')](_0x2a78dc)[_0x8d3d('0x19')]();};}function respondWithResult(_0x4f0c4f,_0x19f13c){_0x19f13c=_0x19f13c||0xc8;return function(_0xde32e9){if(_0xde32e9){return _0x4f0c4f[_0x8d3d('0x18')](_0x19f13c)['json'](_0xde32e9);}};}function respondWithFilteredResult(_0x565b24,_0x373e5e){return function(_0x2d1d0a){if(_0x2d1d0a){var _0x1ec18f=typeof _0x373e5e['offset']===_0x8d3d('0x1a')&&typeof _0x373e5e[_0x8d3d('0x1b')]===_0x8d3d('0x1a');var _0x56df31=_0x2d1d0a['count'];var _0x45770d=_0x1ec18f?0x0:_0x373e5e['offset'];var _0x15dd62=_0x1ec18f?_0x2d1d0a[_0x8d3d('0x1c')]:_0x373e5e[_0x8d3d('0x1d')]+_0x373e5e[_0x8d3d('0x1b')];var _0x1b8541;if(_0x15dd62>=_0x56df31){_0x15dd62=_0x56df31;_0x1b8541=0xc8;}else{_0x1b8541=0xce;}_0x565b24[_0x8d3d('0x18')](_0x1b8541);return _0x565b24[_0x8d3d('0x1e')]('Content-Range',_0x45770d+'-'+_0x15dd62+'/'+_0x56df31)[_0x8d3d('0x1f')](_0x2d1d0a);}return null;};}function patchUpdates(_0x19d71e){return function(_0x3f02af){try{jsonpatch[_0x8d3d('0x20')](_0x3f02af,_0x19d71e,!![]);}catch(_0x172fcc){return BPromise['reject'](_0x172fcc);}return _0x3f02af[_0x8d3d('0x21')]();};}function saveUpdates(_0x44e05a,_0x976164){return function(_0x466bc4){if(_0x466bc4){return _0x466bc4[_0x8d3d('0x22')](_0x44e05a)[_0x8d3d('0x23')](function(_0x2afa46){return _0x2afa46;});}return null;};}function removeEntity(_0x3ac76b,_0x54e34b){return function(_0x41d63c){if(_0x41d63c){return _0x41d63c['destroy']()[_0x8d3d('0x23')](function(){var _0x19fd30=_0x41d63c[_0x8d3d('0x24')]({'plain':!![]});var _0x2a9369='Scheduler';return db[_0x8d3d('0x25')][_0x8d3d('0x26')]({'where':{'type':_0x2a9369,'resourceId':_0x19fd30['id']}})['then'](function(){return _0x41d63c;});})[_0x8d3d('0x23')](function(){_0x3ac76b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36aa74,_0x2a8d47){return function(_0x267329){if(!_0x267329){_0x36aa74[_0x8d3d('0x17')](0x194);}return _0x267329;};}function handleError(_0x3d25eb,_0x5cc16b){_0x5cc16b=_0x5cc16b||0x1f4;return function(_0x26f8c7){logger['error'](_0x26f8c7[_0x8d3d('0x27')]);if(_0x26f8c7[_0x8d3d('0x28')]){delete _0x26f8c7['name'];}_0x3d25eb['status'](_0x5cc16b)['send'](_0x26f8c7);};}exports[_0x8d3d('0x29')]=function(_0x1a7e28,_0x4ba02a){var _0x97ea92={},_0x241ff2={},_0x2e59c0={'count':0x0,'rows':[]};var _0x228a21=_[_0x8d3d('0x2a')](db['Schedule'][_0x8d3d('0x2b')],function(_0x5be40e){return{'name':_0x5be40e['fieldName'],'type':_0x5be40e[_0x8d3d('0x2c')][_0x8d3d('0x2d')]};});_0x241ff2[_0x8d3d('0x2e')]=_['map'](_0x228a21,_0x8d3d('0x28'));_0x241ff2[_0x8d3d('0x2f')]=_['keys'](_0x1a7e28['query']);_0x241ff2[_0x8d3d('0x30')]=_['intersection'](_0x241ff2['model'],_0x241ff2[_0x8d3d('0x2f')]);_0x97ea92[_0x8d3d('0x31')]=_[_0x8d3d('0x32')](_0x241ff2[_0x8d3d('0x2e')],qs['fields'](_0x1a7e28[_0x8d3d('0x2f')][_0x8d3d('0x33')]));_0x97ea92[_0x8d3d('0x31')]=_0x97ea92[_0x8d3d('0x31')][_0x8d3d('0x34')]?_0x97ea92[_0x8d3d('0x31')]:_0x241ff2[_0x8d3d('0x2e')];if(!_0x1a7e28['query'][_0x8d3d('0x35')](_0x8d3d('0x36'))){_0x97ea92[_0x8d3d('0x1b')]=qs[_0x8d3d('0x1b')](_0x1a7e28['query']['limit']);_0x97ea92[_0x8d3d('0x1d')]=qs['offset'](_0x1a7e28['query']['offset']);}_0x97ea92[_0x8d3d('0x37')]=qs['sort'](_0x1a7e28[_0x8d3d('0x2f')][_0x8d3d('0x38')]);_0x97ea92[_0x8d3d('0x39')]=qs[_0x8d3d('0x30')](_[_0x8d3d('0x3a')](_0x1a7e28[_0x8d3d('0x2f')],_0x241ff2['filters']),_0x228a21);if(_0x1a7e28[_0x8d3d('0x2f')][_0x8d3d('0x3b')]){_0x97ea92[_0x8d3d('0x39')]=_['merge'](_0x97ea92[_0x8d3d('0x39')],{'$or':_[_0x8d3d('0x2a')](_0x228a21,function(_0x5a23bc){if(_0x5a23bc['type']!==_0x8d3d('0x3c')){var _0x26a351={};_0x26a351[_0x5a23bc[_0x8d3d('0x28')]]={'$like':'%'+_0x1a7e28['query']['filter']+'%'};return _0x26a351;}})});}_0x97ea92=_[_0x8d3d('0x3d')]({},_0x97ea92,_0x1a7e28[_0x8d3d('0x3e')]);var _0xa1465a={'where':_0x97ea92[_0x8d3d('0x39')]};return db[_0x8d3d('0x3f')][_0x8d3d('0x1c')](_0xa1465a)[_0x8d3d('0x23')](function(_0x2248bb){_0x2e59c0['count']=_0x2248bb;if(_0x1a7e28[_0x8d3d('0x2f')][_0x8d3d('0x40')]){_0x97ea92[_0x8d3d('0x41')]=[{'all':!![]}];}return db['Schedule'][_0x8d3d('0x42')](_0x97ea92);})[_0x8d3d('0x23')](function(_0x1650db){_0x2e59c0['rows']=_0x1650db;return _0x2e59c0;})[_0x8d3d('0x23')](respondWithFilteredResult(_0x4ba02a,_0x97ea92))[_0x8d3d('0x43')](handleError(_0x4ba02a,null));};exports[_0x8d3d('0x44')]=function(_0x55dde8,_0x2aa93c){var _0x2ebf10={'raw':![],'where':{'id':_0x55dde8[_0x8d3d('0x45')]['id']}},_0x311ff0={};_0x311ff0['model']=_['keys'](db['Schedule']['rawAttributes']);_0x311ff0[_0x8d3d('0x2f')]=_['keys'](_0x55dde8[_0x8d3d('0x2f')]);_0x311ff0['filters']=_['intersection'](_0x311ff0[_0x8d3d('0x2e')],_0x311ff0[_0x8d3d('0x2f')]);_0x2ebf10['attributes']=_['intersection'](_0x311ff0[_0x8d3d('0x2e')],qs[_0x8d3d('0x33')](_0x55dde8[_0x8d3d('0x2f')]['fields']));_0x2ebf10[_0x8d3d('0x31')]=_0x2ebf10[_0x8d3d('0x31')][_0x8d3d('0x34')]?_0x2ebf10[_0x8d3d('0x31')]:_0x311ff0[_0x8d3d('0x2e')];if(_0x55dde8[_0x8d3d('0x2f')][_0x8d3d('0x40')]){_0x2ebf10[_0x8d3d('0x41')]=[{'all':!![]}];}_0x2ebf10=_[_0x8d3d('0x3d')]({},_0x2ebf10,_0x55dde8[_0x8d3d('0x3e')]);return db['Schedule']['find'](_0x2ebf10)['then'](handleEntityNotFound(_0x2aa93c,null))['then'](respondWithResult(_0x2aa93c,null))[_0x8d3d('0x43')](handleError(_0x2aa93c,null));};exports[_0x8d3d('0x46')]=function(_0x556a40,_0x4a526f){return db['Schedule']['create'](_0x556a40['body'],{})[_0x8d3d('0x23')](function(_0x437bae){var _0xd502ed=_0x556a40[_0x8d3d('0x47')][_0x8d3d('0x24')]({'plain':!![]});if(!_0xd502ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd502ed['role']===_0x8d3d('0x47')){var _0x3b7fb5=_0x437bae[_0x8d3d('0x24')]({'plain':!![]});var _0x302cc0='Scheduler';return db['UserProfileSection'][_0x8d3d('0x48')]({'where':{'name':_0x302cc0,'userProfileId':_0xd502ed[_0x8d3d('0x49')]},'raw':!![]})['then'](function(_0x347f1e){if(_0x347f1e&&_0x347f1e['autoAssociation']===0x0){return db['UserProfileResource'][_0x8d3d('0x46')]({'name':_0x3b7fb5[_0x8d3d('0x28')],'resourceId':_0x3b7fb5['id'],'type':_0x347f1e[_0x8d3d('0x28')],'sectionId':_0x347f1e['id']},{})['then'](function(){return _0x437bae;});}else{return _0x437bae;}})[_0x8d3d('0x43')](function(_0x532f63){logger[_0x8d3d('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x532f63);throw _0x532f63;});}return _0x437bae;})['then'](respondWithResult(_0x4a526f,0xc9))[_0x8d3d('0x43')](handleError(_0x4a526f,null));};exports['update']=function(_0x1b72e9,_0x2f1481){if(_0x1b72e9[_0x8d3d('0x4b')]['id']){delete _0x1b72e9[_0x8d3d('0x4b')]['id'];}return db[_0x8d3d('0x3f')][_0x8d3d('0x48')]({'where':{'id':_0x1b72e9[_0x8d3d('0x45')]['id']}})[_0x8d3d('0x23')](handleEntityNotFound(_0x2f1481,null))['then'](saveUpdates(_0x1b72e9[_0x8d3d('0x4b')],null))['then'](respondWithResult(_0x2f1481,null))[_0x8d3d('0x43')](handleError(_0x2f1481,null));};exports['destroy']=function(_0x548db5,_0x4318e2){return db[_0x8d3d('0x3f')][_0x8d3d('0x48')]({'where':{'id':_0x548db5[_0x8d3d('0x45')]['id']}})[_0x8d3d('0x23')](handleEntityNotFound(_0x4318e2,null))[_0x8d3d('0x23')](removeEntity(_0x4318e2,null))[_0x8d3d('0x43')](handleError(_0x4318e2,null));};exports[_0x8d3d('0x4c')]=function(_0x406fd8,_0x593bd1,_0x13d3bb){var _0x35a167=require(_0x8d3d('0x4d'));return db[_0x8d3d('0x3f')][_0x8d3d('0x48')]({'where':{'id':_0x406fd8[_0x8d3d('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x593bd1,null))[_0x8d3d('0x23')](function(){_0x35a167[_0x8d3d('0x4c')](_0x406fd8[_0x8d3d('0x45')]['id']);})[_0x8d3d('0x23')](respondWithStatusCode(_0x593bd1,null))[_0x8d3d('0x43')](handleError(_0x593bd1,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index b2231b3..c8aaf2c 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 _0x8886=['exports','define','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8886,0x15f));var _0x6888=function(_0x494122,_0x224fbd){_0x494122=_0x494122-0x0;var _0x4a4e24=_0x8886[_0x494122];return _0x4a4e24;};'use strict';var _=require(_0x6888('0x0'));var util=require(_0x6888('0x1'));var logger=require(_0x6888('0x2'))(_0x6888('0x3'));var moment=require(_0x6888('0x4'));var BPromise=require(_0x6888('0x5'));var rp=require(_0x6888('0x6'));var fs=require('fs');var path=require(_0x6888('0x7'));var rimraf=require(_0x6888('0x8'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0x6888('0x9')]=function(_0x3a0bc2,_0x388728){return _0x3a0bc2[_0x6888('0xa')]('Schedule',attributes,{'tableName':_0x6888('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1489=['../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','rimraf'];(function(_0x273275,_0x12bcf9){var _0x3088bf=function(_0x378856){while(--_0x378856){_0x273275['push'](_0x273275['shift']());}};_0x3088bf(++_0x12bcf9);}(_0x1489,0x1b3));var _0x9148=function(_0x26bceb,_0x124ed3){_0x26bceb=_0x26bceb-0x0;var _0xcb6fef=_0x1489[_0x26bceb];return _0xcb6fef;};'use strict';var _=require(_0x9148('0x0'));var util=require(_0x9148('0x1'));var logger=require(_0x9148('0x2'))(_0x9148('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9148('0x4'));var config=require(_0x9148('0x5'));var attributes=require(_0x9148('0x6'));module[_0x9148('0x7')]=function(_0x58dc35,_0x590c78){return _0x58dc35[_0x9148('0x8')](_0x9148('0x9'),attributes,{'tableName':_0x9148('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 4223d8d..3943452 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 _0x84d3=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','Schedule,\x20%s,\x20%s','catch'];(function(_0x1744d8,_0x3c2cf0){var _0x2f90fc=function(_0x390c42){while(--_0x390c42){_0x1744d8['push'](_0x1744d8['shift']());}};_0x2f90fc(++_0x3c2cf0);}(_0x84d3,0x14a));var _0x384d=function(_0x27c853,_0x24db36){_0x27c853=_0x27c853-0x0;var _0x24384e=_0x84d3[_0x27c853];return _0x24384e;};'use strict';var _=require(_0x384d('0x0'));var util=require(_0x384d('0x1'));var moment=require(_0x384d('0x2'));var BPromise=require(_0x384d('0x3'));var rs=require(_0x384d('0x4'));var fs=require('fs');var Redis=require(_0x384d('0x5'));var db=require(_0x384d('0x6'))['db'];var utils=require(_0x384d('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x384d('0x8'));var jayson=require(_0x384d('0x9'));var client=jayson[_0x384d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2542e5,_0x16b1b6,_0x1ad0c4){return new BPromise(function(_0x320f6b,_0x28bca8){return client[_0x384d('0xb')](_0x2542e5,_0x1ad0c4)[_0x384d('0xc')](function(_0x25b373){logger[_0x384d('0xd')]('Schedule,\x20%s,\x20%s',_0x16b1b6,_0x384d('0xe'));logger[_0x384d('0xf')](_0x384d('0x10'),_0x16b1b6,_0x384d('0xe'),JSON['stringify'](_0x25b373));if(_0x25b373[_0x384d('0x11')]){if(_0x25b373[_0x384d('0x11')][_0x384d('0x12')]===0x1f4){logger[_0x384d('0x11')]('Schedule,\x20%s,\x20%s',_0x16b1b6,_0x25b373[_0x384d('0x11')][_0x384d('0x13')]);return _0x28bca8(_0x25b373[_0x384d('0x11')]['message']);}logger['error'](_0x384d('0x14'),_0x16b1b6,_0x25b373['error'][_0x384d('0x13')]);return _0x320f6b(_0x25b373[_0x384d('0x11')][_0x384d('0x13')]);}else{logger[_0x384d('0xd')](_0x384d('0x14'),_0x16b1b6,_0x384d('0xe'));_0x320f6b(_0x25b373['result'][_0x384d('0x13')]);}})[_0x384d('0x15')](function(_0x53c0c6){logger[_0x384d('0x11')]('Schedule,\x20%s,\x20%s',_0x16b1b6,_0x53c0c6);_0x28bca8(_0x53c0c6);});});} \ No newline at end of file +var _0x17bf=['debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0x11d6f9,_0x572736){var _0x4de675=function(_0x1e26fd){while(--_0x1e26fd){_0x11d6f9['push'](_0x11d6f9['shift']());}};_0x4de675(++_0x572736);}(_0x17bf,0x1dc));var _0xf17b=function(_0x2cde21,_0x31c512){_0x2cde21=_0x2cde21-0x0;var _0x2cff37=_0x17bf[_0x2cde21];return _0x2cff37;};'use strict';var _=require(_0xf17b('0x0'));var util=require(_0xf17b('0x1'));var moment=require(_0xf17b('0x2'));var BPromise=require(_0xf17b('0x3'));var rs=require(_0xf17b('0x4'));var fs=require('fs');var Redis=require(_0xf17b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf17b('0x6'));var logger=require(_0xf17b('0x7'))(_0xf17b('0x8'));var config=require(_0xf17b('0x9'));var jayson=require(_0xf17b('0xa'));var client=jayson[_0xf17b('0xb')][_0xf17b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x300cb9,_0x4f1085,_0x48dad5){return new BPromise(function(_0x2a02e0,_0x15cf46){return client[_0xf17b('0xd')](_0x300cb9,_0x48dad5)[_0xf17b('0xe')](function(_0x4ef27f){logger[_0xf17b('0xf')](_0xf17b('0x10'),_0x4f1085,_0xf17b('0x11'));logger[_0xf17b('0x12')](_0xf17b('0x13'),_0x4f1085,_0xf17b('0x11'),JSON[_0xf17b('0x14')](_0x4ef27f));if(_0x4ef27f['error']){if(_0x4ef27f[_0xf17b('0x15')][_0xf17b('0x16')]===0x1f4){logger[_0xf17b('0x15')](_0xf17b('0x10'),_0x4f1085,_0x4ef27f['error'][_0xf17b('0x17')]);return _0x15cf46(_0x4ef27f[_0xf17b('0x15')]['message']);}logger['error'](_0xf17b('0x10'),_0x4f1085,_0x4ef27f['error'][_0xf17b('0x17')]);return _0x2a02e0(_0x4ef27f[_0xf17b('0x15')][_0xf17b('0x17')]);}else{logger['info'](_0xf17b('0x10'),_0x4f1085,'request\x20sent');_0x2a02e0(_0x4ef27f[_0xf17b('0x18')][_0xf17b('0x17')]);}})[_0xf17b('0x19')](function(_0x10fa0e){logger[_0xf17b('0x15')](_0xf17b('0x10'),_0x4f1085,_0x10fa0e);_0x15cf46(_0x10fa0e);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 14ce58f..258dc76 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 _0xf394=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','post','create','update','delete'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xf394,0xa9));var _0x4f39=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xf394[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x4f39('0x0'));var util=require(_0x4f39('0x1'));var path=require(_0x4f39('0x2'));var timeout=require(_0x4f39('0x3'));var express=require(_0x4f39('0x4'));var router=express[_0x4f39('0x5')]();var fs_extra=require(_0x4f39('0x6'));var auth=require(_0x4f39('0x7'));var interaction=require(_0x4f39('0x8'));var config=require(_0x4f39('0x9'));var controller=require(_0x4f39('0xa'));router[_0x4f39('0xb')]('/',auth['isAuthenticated'](),controller[_0x4f39('0xc')]);router[_0x4f39('0xb')](_0x4f39('0xd'),auth['isAuthenticated'](),controller[_0x4f39('0xe')]);router[_0x4f39('0xb')](_0x4f39('0xf'),auth[_0x4f39('0x10')](),controller[_0x4f39('0x11')]);router['get'](_0x4f39('0x12'),auth[_0x4f39('0x10')](),controller['download']);router[_0x4f39('0x13')]('/',auth[_0x4f39('0x10')](),controller[_0x4f39('0x14')]);router['put'](_0x4f39('0xf'),auth[_0x4f39('0x10')](),controller[_0x4f39('0x15')]);router[_0x4f39('0x16')]('/:id',auth[_0x4f39('0x10')](),controller['destroy']);module[_0x4f39('0x17')]=router; \ No newline at end of file +var _0x593a=['/:id','show','download','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe'];(function(_0xe896bf,_0x4f8e5e){var _0x4c7a8a=function(_0x410ff2){while(--_0x410ff2){_0xe896bf['push'](_0xe896bf['shift']());}};_0x4c7a8a(++_0x4f8e5e);}(_0x593a,0x1e0));var _0xa593=function(_0x2ba91c,_0x14f286){_0x2ba91c=_0x2ba91c-0x0;var _0x5a9f2e=_0x593a[_0x2ba91c];return _0x5a9f2e;};'use strict';var multer=require(_0xa593('0x0'));var util=require(_0xa593('0x1'));var path=require(_0xa593('0x2'));var timeout=require(_0xa593('0x3'));var express=require(_0xa593('0x4'));var router=express[_0xa593('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa593('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa593('0x7'));var controller=require('./screenRecording.controller');router['get']('/',auth[_0xa593('0x8')](),controller[_0xa593('0x9')]);router[_0xa593('0xa')](_0xa593('0xb'),auth[_0xa593('0x8')](),controller[_0xa593('0xc')]);router[_0xa593('0xa')](_0xa593('0xd'),auth[_0xa593('0x8')](),controller[_0xa593('0xe')]);router[_0xa593('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xa593('0xf')]);router['post']('/',auth[_0xa593('0x8')](),controller['create']);router['put'](_0xa593('0xd'),auth[_0xa593('0x8')](),controller['update']);router[_0xa593('0x10')](_0xa593('0xd'),auth[_0xa593('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 56bbaed..485c4bc 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 _0xbbbc=['format','toString','closedAt','createdAt','updatedAt','MM-DD-YYYY\x20HH:mm','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER','DATE'];(function(_0x1b745b,_0x3e2d40){var _0x120a9d=function(_0x882a6c){while(--_0x882a6c){_0x1b745b['push'](_0x1b745b['shift']());}};_0x120a9d(++_0x3e2d40);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x2f015c,_0x2eb4b2){_0x2f015c=_0x2f015c-0x0;var _0x11b98a=_0xbbbc[_0x2f015c];return _0x11b98a;};'use strict';var Sequelize=require(_0xcbbb('0x0'));var moment=require(_0xcbbb('0x1'));var path=require(_0xcbbb('0x2'));var config=require(_0xcbbb('0x3'));module[_0xcbbb('0x4')]={'format':{'type':Sequelize[_0xcbbb('0x5')],'get':function(){return this[_0xcbbb('0x6')]('value')?path[_0xcbbb('0x7')](this[_0xcbbb('0x6')](_0xcbbb('0x8'))):undefined;}},'interactionid':{'type':Sequelize[_0xcbbb('0x9')]},'channel':{'type':Sequelize[_0xcbbb('0x9')]},'value':{'type':Sequelize['STRING'],'set':function(_0x388197){var _0x1796b4=_0x388197[_0xcbbb('0xa')](/\\/g,'/');this[_0xcbbb('0xb')](_0xcbbb('0x8'),_0x1796b4);}},'rating':{'type':Sequelize[_0xcbbb('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xcbbb('0xc')],'set':function(_0x4ec90a){this[_0xcbbb('0xb')]('startedAt',moment()['subtract'](_0x4ec90a,'ms'));this[_0xcbbb('0xb')]('closedAt',moment());this[_0xcbbb('0xb')]('duration',_0x4ec90a);}},'startedAt':{'type':Sequelize[_0xcbbb('0xd')],'get':function(){return moment(this[_0xcbbb('0x6')]('startedAt'))[_0xcbbb('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xcbbb('0xf')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xcbbb('0x6')](_0xcbbb('0x10')))[_0xcbbb('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xcbbb('0xf')]();}},'createdAt':{'type':Sequelize[_0xcbbb('0xd')],'get':function(){return moment(this[_0xcbbb('0x6')](_0xcbbb('0x11')))['format']('MM-DD-YYYY\x20HH:mm')[_0xcbbb('0xf')]();}},'updatedAt':{'type':Sequelize[_0xcbbb('0xd')],'get':function(){return moment(this[_0xcbbb('0x6')](_0xcbbb('0x12')))['format'](_0xcbbb('0x13'))['toString']();}}}; \ No newline at end of file +var _0xa3e8=['updatedAt','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE'];(function(_0x64a671,_0xf25126){var _0x19c10c=function(_0x21a90c){while(--_0x21a90c){_0x64a671['push'](_0x64a671['shift']());}};_0x19c10c(++_0xf25126);}(_0xa3e8,0x127));var _0x8a3e=function(_0x20f6e5,_0x1b035c){_0x20f6e5=_0x20f6e5-0x0;var _0xe99cc2=_0xa3e8[_0x20f6e5];return _0xe99cc2;};'use strict';var Sequelize=require(_0x8a3e('0x0'));var moment=require(_0x8a3e('0x1'));var path=require(_0x8a3e('0x2'));var config=require('../../config/environment');module[_0x8a3e('0x3')]={'format':{'type':Sequelize[_0x8a3e('0x4')],'get':function(){return this[_0x8a3e('0x5')](_0x8a3e('0x6'))?path[_0x8a3e('0x7')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8a3e('0x8')]},'value':{'type':Sequelize[_0x8a3e('0x8')],'set':function(_0x2052a8){var _0x5a2a25=_0x2052a8[_0x8a3e('0x9')](/\\/g,'/');this[_0x8a3e('0xa')](_0x8a3e('0x6'),_0x5a2a25);}},'rating':{'type':Sequelize[_0x8a3e('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x8a3e('0xb')],'set':function(_0x402a96){this[_0x8a3e('0xa')](_0x8a3e('0xc'),moment()[_0x8a3e('0xd')](_0x402a96,'ms'));this['setDataValue'](_0x8a3e('0xe'),moment());this[_0x8a3e('0xa')](_0x8a3e('0xf'),_0x402a96);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x8a3e('0x5')](_0x8a3e('0xc')))[_0x8a3e('0x10')](_0x8a3e('0x11'))[_0x8a3e('0x12')]();}},'closedAt':{'type':Sequelize[_0x8a3e('0x13')],'get':function(){return moment(this[_0x8a3e('0x5')](_0x8a3e('0xe')))[_0x8a3e('0x10')](_0x8a3e('0x11'))[_0x8a3e('0x12')]();}},'createdAt':{'type':Sequelize[_0x8a3e('0x13')],'get':function(){return moment(this[_0x8a3e('0x5')]('createdAt'))[_0x8a3e('0x10')](_0x8a3e('0x11'))[_0x8a3e('0x12')]();}},'updatedAt':{'type':Sequelize[_0x8a3e('0x13')],'get':function(){return moment(this[_0x8a3e('0x5')](_0x8a3e('0x14')))['format'](_0x8a3e('0x11'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 5f26901..b09c718 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 _0x9a19=['limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','type','key','model','differenceBy','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','duration','value','find','describe','download','../../components/encryptor','uniqueid','join','root','format','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x319784,_0x47e6d4){var _0x1917da=function(_0x2cb921){while(--_0x2cb921){_0x319784['push'](_0x319784['shift']());}};_0x1917da(++_0x47e6d4);}(_0x9a19,0x114));var _0x99a1=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x9a19[_0x3b3cc6];return _0x1161e4;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0x3c813,_0x491341){return function(_0x4fe7f7){if(!_0x4fe7f7){_0x3c813[_0x99a1('0x19')](0x194);}return _0x4fe7f7;};}function handleError(_0x5dabd9,_0x5dc733){_0x5dc733=_0x5dc733||0x1f4;return function(_0xafea84){logger[_0x99a1('0x25')](_0xafea84[_0x99a1('0x26')]);if(_0xafea84[_0x99a1('0x27')]){delete _0xafea84[_0x99a1('0x27')];}_0x5dabd9[_0x99a1('0x1a')](_0x5dc733)[_0x99a1('0x28')](_0xafea84);};}exports['index']=function(_0xf41b0d,_0x499eef){var _0x255197={},_0x1137f2={},_0x26fbae={'count':0x0,'rows':[]};var _0x523668=_[_0x99a1('0x29')](db[_0x99a1('0x2a')]['rawAttributes'],function(_0x37514e){return{'name':_0x37514e[_0x99a1('0x2b')],'type':_0x37514e[_0x99a1('0x2c')][_0x99a1('0x2d')]};});_0x1137f2[_0x99a1('0x2e')]=_[_0x99a1('0x2f')](_[_0x99a1('0x29')](_0x523668,_0x99a1('0x27')),['format']);_0x1137f2['query']=_[_0x99a1('0x30')](_0xf41b0d['query']);_0x1137f2[_0x99a1('0x31')]=_[_0x99a1('0x32')](_0x1137f2['model'],_0x1137f2[_0x99a1('0x33')]);_0x255197[_0x99a1('0x34')]=_[_0x99a1('0x32')](_0x1137f2[_0x99a1('0x2e')],qs[_0x99a1('0x35')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x35')]));_0x255197[_0x99a1('0x34')]=_0x255197[_0x99a1('0x34')][_0x99a1('0x36')]?_0x255197[_0x99a1('0x34')]:_0x1137f2[_0x99a1('0x2e')];if(!_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x37')]('nolimit')){_0x255197['limit']=qs[_0x99a1('0x1e')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x1e')]);_0x255197[_0x99a1('0x1c')]=qs[_0x99a1('0x1c')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x1c')]);}_0x255197['order']=qs[_0x99a1('0x38')](_0xf41b0d[_0x99a1('0x33')]['sort']);_0x255197[_0x99a1('0x39')]=qs[_0x99a1('0x31')](_[_0x99a1('0x3a')](_0xf41b0d[_0x99a1('0x33')],_0x1137f2[_0x99a1('0x31')]),_0x523668);if(_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3b')]){_0x255197[_0x99a1('0x39')]=_[_0x99a1('0x3c')](_0x255197[_0x99a1('0x39')],{'$or':_[_0x99a1('0x29')](_0x523668,function(_0x152969){if(_0x152969[_0x99a1('0x2c')]!=='VIRTUAL'){var _0x5553e4={};_0x5553e4[_0x152969['name']]={'$like':'%'+_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3b')]+'%'};return _0x5553e4;}})});}_0x255197=_[_0x99a1('0x3c')]({},_0x255197,_0xf41b0d[_0x99a1('0x3d')]);var _0x40613a={'where':_0x255197['where']};return db[_0x99a1('0x2a')][_0x99a1('0x1f')](_0x40613a)[_0x99a1('0x23')](function(_0x51efe5){_0x26fbae['count']=_0x51efe5;if(_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3e')]){_0x255197[_0x99a1('0x3f')]=[{'all':!![]}];}return db['ScreenRecording'][_0x99a1('0x40')](_0x255197);})[_0x99a1('0x23')](function(_0x1b5d2d){_0x26fbae[_0x99a1('0x41')]=_0x1b5d2d;return _0x26fbae;})[_0x99a1('0x23')](respondWithFilteredResult(_0x499eef,_0x255197))[_0x99a1('0x42')](handleError(_0x499eef,null));};exports[_0x99a1('0x43')]=function(_0x29d0a0,_0x1c4ce4){var _0x2be9e3={'raw':![],'where':{'id':_0x29d0a0[_0x99a1('0x44')]['id']}},_0x4b40e1={};_0x4b40e1[_0x99a1('0x2e')]=_[_0x99a1('0x30')](db['ScreenRecording'][_0x99a1('0x45')]);_0x4b40e1['query']=_[_0x99a1('0x30')](_0x29d0a0[_0x99a1('0x33')]);_0x4b40e1[_0x99a1('0x31')]=_[_0x99a1('0x32')](_0x4b40e1[_0x99a1('0x2e')],_0x4b40e1[_0x99a1('0x33')]);_0x2be9e3['attributes']=_[_0x99a1('0x32')](_0x4b40e1['model'],qs[_0x99a1('0x35')](_0x29d0a0[_0x99a1('0x33')][_0x99a1('0x35')]));_0x2be9e3[_0x99a1('0x34')]=_0x2be9e3[_0x99a1('0x34')][_0x99a1('0x36')]?_0x2be9e3[_0x99a1('0x34')]:_0x4b40e1[_0x99a1('0x2e')];if(_0x29d0a0[_0x99a1('0x33')][_0x99a1('0x3e')]){_0x2be9e3[_0x99a1('0x3f')]=[{'all':!![]}];}_0x2be9e3=_['merge']({},_0x2be9e3,_0x29d0a0[_0x99a1('0x3d')]);return db[_0x99a1('0x2a')]['find'](_0x2be9e3)[_0x99a1('0x23')](handleEntityNotFound(_0x1c4ce4,null))[_0x99a1('0x23')](respondWithResult(_0x1c4ce4,null))[_0x99a1('0x42')](handleError(_0x1c4ce4,null));};exports[_0x99a1('0x46')]=function(_0x113dd9,_0x254c41){return db[_0x99a1('0x2a')]['create'](_0x113dd9[_0x99a1('0x47')],{})['then'](respondWithResult(_0x254c41,0xc9))[_0x99a1('0x42')](handleError(_0x254c41,null));};exports[_0x99a1('0x48')]=function(_0x566442,_0x5433f2){if(_0x566442[_0x99a1('0x47')]['id']){delete _0x566442[_0x99a1('0x47')]['id'];}delete _0x566442[_0x99a1('0x47')][_0x99a1('0x49')];delete _0x566442[_0x99a1('0x47')]['createdAt'];delete _0x566442['body']['closedAt'];delete _0x566442[_0x99a1('0x47')][_0x99a1('0x4a')];return db[_0x99a1('0x2a')][_0x99a1('0x4b')]({'where':{'id':_0x566442[_0x99a1('0x44')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x5433f2,null))[_0x99a1('0x23')](saveUpdates(_0x566442['body'],null))[_0x99a1('0x23')](respondWithResult(_0x5433f2,null))[_0x99a1('0x42')](handleError(_0x5433f2,null));};exports[_0x99a1('0x4c')]=function(_0x5e877f,_0x81e218){return db['ScreenRecording']['describe']()[_0x99a1('0x23')](respondWithResult(_0x81e218,null))[_0x99a1('0x42')](handleError(_0x81e218,null));};exports[_0x99a1('0x4d')]=function(_0x175f6d,_0x11632d,_0xf8208a){var _0x240d2e=require(_0x99a1('0x4e'));var _0x16641e=![];var _0x53e9eb={};if(_0x175f6d[_0x99a1('0x33')]['type']&&_0x175f6d[_0x99a1('0x33')][_0x99a1('0x2c')]==='uniqueid'){_0x53e9eb[_0x99a1('0x4f')]=_0x175f6d[_0x99a1('0x44')]['id'];}else{_0x53e9eb['id']=_0x175f6d[_0x99a1('0x44')]['id'];}return db[_0x99a1('0x2a')][_0x99a1('0x4b')]({'where':_0x53e9eb,'attributes':['id',_0x99a1('0x4a')],'raw':!![]})[_0x99a1('0x23')](handleEntityNotFound(_0x11632d,null))[_0x99a1('0x23')](function(_0x28ba8f){if(_0x28ba8f){var _0x1c2926=path[_0x99a1('0x50')](config[_0x99a1('0x51')],'server/files/screen_recordings',_0x28ba8f['value']);var _0x2e3e08=util[_0x99a1('0x52')](_0x99a1('0x53'),_0x1c2926);if(fs[_0x99a1('0x54')](_0x2e3e08)){_0x16641e=!![];return _0x240d2e[_0x99a1('0x55')](_0x2e3e08,_0x1c2926,config['secrets'][_0x99a1('0x56')])[_0x99a1('0x23')](function(){return _0x28ba8f;});}return _0x28ba8f;}})['then'](function(_0x6107cd){if(_0x6107cd){var _0x95f20a=path[_0x99a1('0x50')](config[_0x99a1('0x51')],_0x99a1('0x57'),_0x6107cd['value']);if(!fs[_0x99a1('0x54')](_0x95f20a)){throw new db[(_0x99a1('0x58'))][(_0x99a1('0x59'))](_0x99a1('0x5a'));}if(_0x6107cd[_0x99a1('0x5b')]){return _0x11632d[_0x99a1('0x4d')](_0x95f20a,_0x6107cd['filename']+path[_0x99a1('0x5c')](_0x95f20a),function(){if(_0x16641e){fs[_0x99a1('0x5d')](_0x95f20a);}});}else{return _0x11632d['download'](_0x95f20a,function(_0x33feb9){if(_0x16641e){fs[_0x99a1('0x5d')](_0x95f20a);}});}}})[_0x99a1('0x42')](function(_0xb126dd){if(_0xb126dd[_0x99a1('0x5e')]==='ScreenRecording\x20not\x20found'){_0x11632d[_0x99a1('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x11632d,null);}});};exports['destroy']=function(_0x38ce3c,_0x3f7c16){return db['ScreenRecording']['find']({'where':{'id':_0x38ce3c[_0x99a1('0x44')]['id']}})['then'](function(_0x21a5f6){if(_[_0x99a1('0x5f')](_0x21a5f6)){throw new ReferenceError(_0x99a1('0x60'));}return _0x21a5f6;})[_0x99a1('0x23')](function(_0x56d6cf){var _0x18f74b=path[_0x99a1('0x50')](config[_0x99a1('0x51')],'server/files/screen_recordings',_0x56d6cf[_0x99a1('0x4a')]);logger['info'](_0x99a1('0x61'),_0x18f74b);if(!_[_0x99a1('0x5f')](_0x56d6cf[_0x99a1('0x4a')])&&fs[_0x99a1('0x54')](_0x18f74b)){logger[_0x99a1('0x62')]('File:\x20\x22'+_0x18f74b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x18f74b);}_0x18f74b=_0x18f74b+_0x99a1('0x63');if(!_[_0x99a1('0x5f')](_0x56d6cf['value'])&&fs['existsSync'](_0x18f74b)){logger[_0x99a1('0x62')](_0x99a1('0x64')+_0x18f74b+_0x99a1('0x65'));fs['unlinkSync'](_0x18f74b);}return _0x56d6cf;})['then'](function(_0x2b8df8){if(!_0x2b8df8)throw new InternalError();return _0x2b8df8['destroy']();})[_0x99a1('0x23')](function(){_0x3f7c16[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();})['catch'](handleError(_0x3f7c16,null));}; \ No newline at end of file +var _0x5fd1=['body','duration','createdAt','closedAt','describe','../../components/encryptor','uniqueid','join','value','format','%s.cypher','decryptFile','secrets','recording','root','server/files/screen_recordings','existsSync','Sequelize','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','ScreenRecording','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create'];(function(_0x2e81a2,_0x4477fc){var _0x27b108=function(_0xcee602){while(--_0xcee602){_0x2e81a2['push'](_0x2e81a2['shift']());}};_0x27b108(++_0x4477fc);}(_0x5fd1,0x155));var _0x15fd=function(_0x39f36f,_0x2db91e){_0x39f36f=_0x39f36f-0x0;var _0x21781f=_0x5fd1[_0x39f36f];return _0x21781f;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={},_0x218034={},_0xe650a3={'count':0x0,'rows':[]};var _0x4590a1=_[_0x15fd('0x26')](db[_0x15fd('0x27')]['rawAttributes'],function(_0x47c22c){return{'name':_0x47c22c[_0x15fd('0x28')],'type':_0x47c22c['type'][_0x15fd('0x29')]};});_0x218034[_0x15fd('0x2a')]=_['differenceBy'](_[_0x15fd('0x26')](_0x4590a1,_0x15fd('0x23')),['format']);_0x218034[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x27d2c4[_0x15fd('0x2b')]);_0x218034[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],_0x218034['query']);_0x6c213b[_0x15fd('0x2f')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],qs[_0x15fd('0x30')](_0x27d2c4['query'][_0x15fd('0x30')]));_0x6c213b[_0x15fd('0x2f')]=_0x6c213b[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x6c213b[_0x15fd('0x2f')]:_0x218034[_0x15fd('0x2a')];if(!_0x27d2c4['query'][_0x15fd('0x32')](_0x15fd('0x33'))){_0x6c213b['limit']=qs[_0x15fd('0x19')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x19')]);_0x6c213b['offset']=qs[_0x15fd('0x1a')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x1a')]);}_0x6c213b[_0x15fd('0x34')]=qs[_0x15fd('0x35')](_0x27d2c4[_0x15fd('0x2b')]['sort']);_0x6c213b['where']=qs['filters'](_[_0x15fd('0x36')](_0x27d2c4[_0x15fd('0x2b')],_0x218034[_0x15fd('0x2d')]),_0x4590a1);if(_0x27d2c4['query']['filter']){_0x6c213b[_0x15fd('0x37')]=_['merge'](_0x6c213b['where'],{'$or':_['map'](_0x4590a1,function(_0x2edb0d){if(_0x2edb0d[_0x15fd('0x38')]!==_0x15fd('0x39')){var _0x59d0d7={};_0x59d0d7[_0x2edb0d[_0x15fd('0x23')]]={'$like':'%'+_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x3a')]+'%'};return _0x59d0d7;}})});}_0x6c213b=_['merge']({},_0x6c213b,_0x27d2c4[_0x15fd('0x3b')]);var _0x1c4d40={'where':_0x6c213b[_0x15fd('0x37')]};return db[_0x15fd('0x27')][_0x15fd('0x3c')](_0x1c4d40)[_0x15fd('0x1f')](function(_0x19a29f){_0xe650a3[_0x15fd('0x3c')]=_0x19a29f;if(_0x27d2c4[_0x15fd('0x2b')]['includeAll']){_0x6c213b[_0x15fd('0x3d')]=[{'all':!![]}];}return db[_0x15fd('0x27')][_0x15fd('0x3e')](_0x6c213b);})[_0x15fd('0x1f')](function(_0x2d2b6f){_0xe650a3[_0x15fd('0x3f')]=_0x2d2b6f;return _0xe650a3;})[_0x15fd('0x1f')](respondWithFilteredResult(_0x233ed3,_0x6c213b))[_0x15fd('0x40')](handleError(_0x233ed3,null));};exports[_0x15fd('0x41')]=function(_0x104eef,_0x2eb6b6){var _0x145eab={'raw':![],'where':{'id':_0x104eef[_0x15fd('0x42')]['id']}},_0x269aae={};_0x269aae[_0x15fd('0x2a')]=_['keys'](db[_0x15fd('0x27')][_0x15fd('0x43')]);_0x269aae[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x104eef[_0x15fd('0x2b')]);_0x269aae[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x269aae[_0x15fd('0x2a')],_0x269aae['query']);_0x145eab['attributes']=_[_0x15fd('0x2e')](_0x269aae['model'],qs[_0x15fd('0x30')](_0x104eef[_0x15fd('0x2b')]['fields']));_0x145eab[_0x15fd('0x2f')]=_0x145eab[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x145eab[_0x15fd('0x2f')]:_0x269aae[_0x15fd('0x2a')];if(_0x104eef[_0x15fd('0x2b')]['includeAll']){_0x145eab[_0x15fd('0x3d')]=[{'all':!![]}];}_0x145eab=_[_0x15fd('0x44')]({},_0x145eab,_0x104eef[_0x15fd('0x3b')]);return db[_0x15fd('0x27')][_0x15fd('0x45')](_0x145eab)[_0x15fd('0x1f')](handleEntityNotFound(_0x2eb6b6,null))[_0x15fd('0x1f')](respondWithResult(_0x2eb6b6,null))[_0x15fd('0x40')](handleError(_0x2eb6b6,null));};exports[_0x15fd('0x46')]=function(_0x1d3beb,_0x16b4f5){return db[_0x15fd('0x27')]['create'](_0x1d3beb[_0x15fd('0x47')],{})['then'](respondWithResult(_0x16b4f5,0xc9))[_0x15fd('0x40')](handleError(_0x16b4f5,null));};exports[_0x15fd('0x1e')]=function(_0xeb1e06,_0x5a1f32){if(_0xeb1e06[_0x15fd('0x47')]['id']){delete _0xeb1e06[_0x15fd('0x47')]['id'];}delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x48')];delete _0xeb1e06['body'][_0x15fd('0x49')];delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x4a')];delete _0xeb1e06[_0x15fd('0x47')]['value'];return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xeb1e06['params']['id']}})['then'](handleEntityNotFound(_0x5a1f32,null))['then'](saveUpdates(_0xeb1e06[_0x15fd('0x47')],null))[_0x15fd('0x1f')](respondWithResult(_0x5a1f32,null))[_0x15fd('0x40')](handleError(_0x5a1f32,null));};exports[_0x15fd('0x4b')]=function(_0x292174,_0x33a128){return db['ScreenRecording'][_0x15fd('0x4b')]()[_0x15fd('0x1f')](respondWithResult(_0x33a128,null))[_0x15fd('0x40')](handleError(_0x33a128,null));};exports['download']=function(_0x30c4e3,_0x4dd1d5,_0x3a48e7){var _0x2886e3=require(_0x15fd('0x4c'));var _0x42d4de=![];var _0x332df7={};if(_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]&&_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]===_0x15fd('0x4d')){_0x332df7[_0x15fd('0x4d')]=_0x30c4e3[_0x15fd('0x42')]['id'];}else{_0x332df7['id']=_0x30c4e3[_0x15fd('0x42')]['id'];}return db['ScreenRecording'][_0x15fd('0x45')]({'where':_0x332df7,'attributes':['id','value'],'raw':!![]})[_0x15fd('0x1f')](handleEntityNotFound(_0x4dd1d5,null))['then'](function(_0x25bdea){if(_0x25bdea){var _0x1fac7f=path[_0x15fd('0x4e')](config['root'],'server/files/screen_recordings',_0x25bdea[_0x15fd('0x4f')]);var _0xc9c5ef=util[_0x15fd('0x50')](_0x15fd('0x51'),_0x1fac7f);if(fs['existsSync'](_0xc9c5ef)){_0x42d4de=!![];return _0x2886e3[_0x15fd('0x52')](_0xc9c5ef,_0x1fac7f,config[_0x15fd('0x53')][_0x15fd('0x54')])[_0x15fd('0x1f')](function(){return _0x25bdea;});}return _0x25bdea;}})[_0x15fd('0x1f')](function(_0x321fe7){if(_0x321fe7){var _0x59b3b4=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x321fe7[_0x15fd('0x4f')]);if(!fs[_0x15fd('0x57')](_0x59b3b4)){throw new db[(_0x15fd('0x58'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x321fe7[_0x15fd('0x59')]){return _0x4dd1d5[_0x15fd('0x5a')](_0x59b3b4,_0x321fe7['filename']+path[_0x15fd('0x5b')](_0x59b3b4),function(){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}else{return _0x4dd1d5['download'](_0x59b3b4,function(_0x285fd5){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}}})[_0x15fd('0x40')](function(_0x53bfd7){if(_0x53bfd7[_0x15fd('0x5d')]===_0x15fd('0x5e')){_0x4dd1d5[_0x15fd('0x17')](0x194)[_0x15fd('0x24')](_0x15fd('0x5f'));}else{return handleError(_0x4dd1d5,null);}});};exports[_0x15fd('0x20')]=function(_0xa1bb5c,_0x290497){return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xa1bb5c['params']['id']}})[_0x15fd('0x1f')](function(_0x3a26c8){if(_['isNil'](_0x3a26c8)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3a26c8;})[_0x15fd('0x1f')](function(_0x39e6ee){var _0x2bd6ef=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x39e6ee['value']);logger[_0x15fd('0x60')](_0x15fd('0x61'),_0x2bd6ef);if(!_[_0x15fd('0x62')](_0x39e6ee[_0x15fd('0x4f')])&&fs[_0x15fd('0x57')](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}_0x2bd6ef=_0x2bd6ef+_0x15fd('0x66');if(!_[_0x15fd('0x62')](_0x39e6ee['value'])&&fs['existsSync'](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}return _0x39e6ee;})[_0x15fd('0x1f')](function(_0xfa3aa1){if(!_0xfa3aa1)throw new InternalError();return _0xfa3aa1[_0x15fd('0x20')]();})['then'](function(){_0x290497[_0x15fd('0x17')](0xcc)['end']();})[_0x15fd('0x40')](handleError(_0x290497,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 72c2b77..fa0b7c4 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 _0x7146=['screen_recordings','interactionid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./screenRecording.attributes','exports','define','ScreenRecording'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x7146,0xd2));var _0x6714=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x7146[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0x6714('0x0'));var util=require('util');var logger=require(_0x6714('0x1'))(_0x6714('0x2'));var moment=require(_0x6714('0x3'));var BPromise=require(_0x6714('0x4'));var rp=require(_0x6714('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6714('0x6'));var config=require('../../config/environment');var attributes=require(_0x6714('0x7'));module[_0x6714('0x8')]=function(_0x477ba6,_0x325eea){return _0x477ba6[_0x6714('0x9')](_0x6714('0xa'),attributes,{'tableName':_0x6714('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x6714('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x102b=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x102b,0x12b));var _0xb102=function(_0x4ed1bb,_0x53ec8e){_0x4ed1bb=_0x4ed1bb-0x0;var _0x222add=_0x102b[_0x4ed1bb];return _0x222add;};'use strict';var _=require(_0xb102('0x0'));var util=require(_0xb102('0x1'));var logger=require(_0xb102('0x2'))(_0xb102('0x3'));var moment=require('moment');var BPromise=require(_0xb102('0x4'));var rp=require(_0xb102('0x5'));var fs=require('fs');var path=require(_0xb102('0x6'));var rimraf=require(_0xb102('0x7'));var config=require(_0xb102('0x8'));var attributes=require(_0xb102('0x9'));module[_0xb102('0xa')]=function(_0x483c90,_0x4ac082){return _0x483c90[_0xb102('0xb')](_0xb102('0xc'),attributes,{'tableName':_0xb102('0xd'),'paranoid':![],'indexes':[{'name':_0xb102('0xe'),'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 c59d4cb..c5fcb80 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 _0x0a01=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x9507f,_0x35d056){var _0x3bf6fa=function(_0x472144){while(--_0x472144){_0x9507f['push'](_0x9507f['shift']());}};_0x3bf6fa(++_0x35d056);}(_0x0a01,0x1c6));var _0x10a0=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x0a01[_0x36ed3c];return _0x52a2e0;};'use strict';var _=require(_0x10a0('0x0'));var util=require('util');var moment=require(_0x10a0('0x1'));var BPromise=require(_0x10a0('0x2'));var rs=require(_0x10a0('0x3'));var fs=require('fs');var Redis=require(_0x10a0('0x4'));var db=require(_0x10a0('0x5'))['db'];var utils=require(_0x10a0('0x6'));var logger=require(_0x10a0('0x7'))(_0x10a0('0x8'));var config=require(_0x10a0('0x9'));var jayson=require(_0x10a0('0xa'));var client=jayson[_0x10a0('0xb')][_0x10a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5217ca,_0x59644d,_0x1ccf05){return new BPromise(function(_0x1a3fa7,_0x31e006){return client['request'](_0x5217ca,_0x1ccf05)[_0x10a0('0xd')](function(_0x37873f){logger['info'](_0x10a0('0xe'),_0x59644d,_0x10a0('0xf'));logger['debug'](_0x10a0('0x10'),_0x59644d,'request\x20sent',JSON[_0x10a0('0x11')](_0x37873f));if(_0x37873f[_0x10a0('0x12')]){if(_0x37873f[_0x10a0('0x12')]['code']===0x1f4){logger[_0x10a0('0x12')](_0x10a0('0xe'),_0x59644d,_0x37873f['error']['message']);return _0x31e006(_0x37873f['error']['message']);}logger[_0x10a0('0x12')](_0x10a0('0xe'),_0x59644d,_0x37873f[_0x10a0('0x12')]['message']);return _0x1a3fa7(_0x37873f[_0x10a0('0x12')][_0x10a0('0x13')]);}else{logger[_0x10a0('0x14')](_0x10a0('0xe'),_0x59644d,_0x10a0('0xf'));_0x1a3fa7(_0x37873f[_0x10a0('0x15')][_0x10a0('0x13')]);}})[_0x10a0('0x16')](function(_0x5186f2){logger['error'](_0x10a0('0xe'),_0x59644d,_0x5186f2);_0x31e006(_0x5186f2);});});} \ No newline at end of file +var _0x9653=['debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x181fa2,_0x36988c){var _0x16b7c9=function(_0x4f672c){while(--_0x4f672c){_0x181fa2['push'](_0x181fa2['shift']());}};_0x16b7c9(++_0x36988c);}(_0x9653,0xc8));var _0x3965=function(_0x39e4c6,_0x2e9428){_0x39e4c6=_0x39e4c6-0x0;var _0x122b46=_0x9653[_0x39e4c6];return _0x122b46;};'use strict';var _=require(_0x3965('0x0'));var util=require(_0x3965('0x1'));var moment=require(_0x3965('0x2'));var BPromise=require(_0x3965('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3965('0x4'));var db=require(_0x3965('0x5'))['db'];var utils=require(_0x3965('0x6'));var logger=require('../../config/logger')(_0x3965('0x7'));var config=require(_0x3965('0x8'));var jayson=require(_0x3965('0x9'));var client=jayson[_0x3965('0xa')][_0x3965('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58b5a8,_0x2d61ea,_0x242f90){return new BPromise(function(_0x122e92,_0x2b5f95){return client[_0x3965('0xc')](_0x58b5a8,_0x242f90)[_0x3965('0xd')](function(_0x408593){logger['info'](_0x3965('0xe'),_0x2d61ea,_0x3965('0xf'));logger[_0x3965('0x10')](_0x3965('0x11'),_0x2d61ea,_0x3965('0xf'),JSON[_0x3965('0x12')](_0x408593));if(_0x408593[_0x3965('0x13')]){if(_0x408593[_0x3965('0x13')]['code']===0x1f4){logger[_0x3965('0x13')](_0x3965('0xe'),_0x2d61ea,_0x408593[_0x3965('0x13')]['message']);return _0x2b5f95(_0x408593[_0x3965('0x13')][_0x3965('0x14')]);}logger[_0x3965('0x13')](_0x3965('0xe'),_0x2d61ea,_0x408593[_0x3965('0x13')][_0x3965('0x14')]);return _0x122e92(_0x408593['error'][_0x3965('0x14')]);}else{logger[_0x3965('0x15')]('ScreenRecording,\x20%s,\x20%s',_0x2d61ea,_0x3965('0xf'));_0x122e92(_0x408593[_0x3965('0x16')][_0x3965('0x14')]);}})[_0x3965('0x17')](function(_0x4fd6ec){logger['error'](_0x3965('0xe'),_0x2d61ea,_0x4fd6ec);_0x2b5f95(_0x4fd6ec);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 9537665..e0462e8 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 _0x3450=['./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','single','file','addLogo','join','logologin','originalname','post','addLogoLogin','/:id/preferred','addPreferred','/:id/favicon','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3450,0x1dc));var _0x0345=function(_0x205e56,_0x366e77){_0x205e56=_0x205e56-0x0;var _0x489d5d=_0x3450[_0x205e56];return _0x489d5d;};'use strict';var multer=require(_0x0345('0x0'));var util=require(_0x0345('0x1'));var path=require(_0x0345('0x2'));var timeout=require(_0x0345('0x3'));var express=require(_0x0345('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0345('0x5'));var interaction=require(_0x0345('0x6'));var config=require(_0x0345('0x7'));var controller=require(_0x0345('0x8'));router['get']('/',auth[_0x0345('0x9')](),controller[_0x0345('0xa')]);router[_0x0345('0xb')](_0x0345('0xc'),controller[_0x0345('0xd')]);router['get'](_0x0345('0xe'),controller[_0x0345('0xf')]);router[_0x0345('0xb')](_0x0345('0x10'),controller[_0x0345('0x11')]);router[_0x0345('0xb')](_0x0345('0x12'),controller[_0x0345('0x13')]);router[_0x0345('0xb')](_0x0345('0x14'),controller['gdpr']);router['get']('/:id/preferred',controller[_0x0345('0x15')]);router[_0x0345('0xb')]('/:id/favicon',controller[_0x0345('0x16')]);var upload=multer({'storage':multer[_0x0345('0x17')]({'destination':function(_0x59e3bf,_0x58b672,_0x1a9152){_0x1a9152(null,path['join'](config[_0x0345('0x18')],_0x0345('0x19')));},'filename':function(_0x638b35,_0x22470a,_0x5d32a0){_0x5d32a0(null,util[_0x0345('0x1a')](_0x0345('0x1b'),_0x0345('0x1c'),path[_0x0345('0x1d')](_0x22470a['originalname'])));}})});router['post'](_0x0345('0x10'),upload[_0x0345('0x1e')](_0x0345('0x1f')),controller[_0x0345('0x20')]);var upload=multer({'storage':multer[_0x0345('0x17')]({'destination':function(_0x3fb7dc,_0x44972e,_0x4bb1da){_0x4bb1da(null,path[_0x0345('0x21')](config['root'],_0x0345('0x19')));},'filename':function(_0x2befa1,_0x2901fc,_0x27625c){_0x27625c(null,util[_0x0345('0x1a')]('%s%s',_0x0345('0x22'),path['extname'](_0x2901fc[_0x0345('0x23')])));}})});router[_0x0345('0x24')]('/:id/logo_login',upload['single']('file'),controller[_0x0345('0x25')]);var upload=multer({'storage':multer[_0x0345('0x17')]({'destination':function(_0x3a0e2d,_0x422931,_0x4d3134){_0x4d3134(null,path['join'](config[_0x0345('0x18')],_0x0345('0x19')));},'filename':function(_0x55a61a,_0xe9a02f,_0x5a1c26){_0x5a1c26(null,util[_0x0345('0x1a')](_0x0345('0x1b'),'preferred',path['extname'](_0xe9a02f[_0x0345('0x23')])));}})});router[_0x0345('0x24')](_0x0345('0x26'),upload[_0x0345('0x1e')](_0x0345('0x1f')),controller[_0x0345('0x27')]);var upload=multer({'storage':multer[_0x0345('0x17')]({'destination':function(_0x12d41a,_0x29e678,_0x5874ac){_0x5874ac(null,path[_0x0345('0x21')](config[_0x0345('0x18')],_0x0345('0x19')));},'filename':function(_0x1302c7,_0x18b685,_0x3171d6){_0x3171d6(null,util['format'](_0x0345('0x1b'),'favicon',path[_0x0345('0x1d')](_0x18b685[_0x0345('0x23')])));}})});router[_0x0345('0x24')](_0x0345('0x28'),upload[_0x0345('0x1e')](_0x0345('0x1f')),controller['addFavicon']);router[_0x0345('0x29')](_0x0345('0xe'),auth['isAuthenticated'](),controller[_0x0345('0x2a')]);module[_0x0345('0x2b')]=router; \ No newline at end of file +var _0xc4d3=['getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','format','logo','extname','originalname','post','single','addLogo','root','%s%s','file','preferred','addFavicon','put','update','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','./setting.controller','isAuthenticated','/now','getDate','/:id','show','get','/:id/logo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred'];(function(_0x45e520,_0x2d11df){var _0x209a05=function(_0x378cb7){while(--_0x378cb7){_0x45e520['push'](_0x45e520['shift']());}};_0x209a05(++_0x2d11df);}(_0xc4d3,0x16b));var _0x3c4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4d3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3c4d('0x0'));var timeout=require(_0x3c4d('0x1'));var express=require(_0x3c4d('0x2'));var router=express['Router']();var fs_extra=require(_0x3c4d('0x3'));var auth=require(_0x3c4d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3c4d('0x5'));router['get']('/',auth[_0x3c4d('0x6')](),controller['index']);router['get'](_0x3c4d('0x7'),controller[_0x3c4d('0x8')]);router['get'](_0x3c4d('0x9'),controller[_0x3c4d('0xa')]);router[_0x3c4d('0xb')](_0x3c4d('0xc'),controller['getLogo']);router[_0x3c4d('0xb')](_0x3c4d('0xd'),controller['getLogoLogin']);router['get'](_0x3c4d('0xe'),controller[_0x3c4d('0xf')]);router['get'](_0x3c4d('0x10'),controller[_0x3c4d('0x11')]);router['get'](_0x3c4d('0x12'),controller[_0x3c4d('0x13')]);var upload=multer({'storage':multer[_0x3c4d('0x14')]({'destination':function(_0x175738,_0x103888,_0x3c5e34){_0x3c5e34(null,path[_0x3c4d('0x15')](config['root'],_0x3c4d('0x16')));},'filename':function(_0x15da7b,_0x86a2f6,_0x375691){_0x375691(null,util[_0x3c4d('0x17')]('%s%s',_0x3c4d('0x18'),path[_0x3c4d('0x19')](_0x86a2f6[_0x3c4d('0x1a')])));}})});router[_0x3c4d('0x1b')]('/:id/logo',upload[_0x3c4d('0x1c')]('file'),controller[_0x3c4d('0x1d')]);var upload=multer({'storage':multer[_0x3c4d('0x14')]({'destination':function(_0x3f36f5,_0x5a10ca,_0x343046){_0x343046(null,path[_0x3c4d('0x15')](config[_0x3c4d('0x1e')],_0x3c4d('0x16')));},'filename':function(_0xc7bb80,_0x338364,_0x6c07ec){_0x6c07ec(null,util[_0x3c4d('0x17')](_0x3c4d('0x1f'),'logologin',path['extname'](_0x338364[_0x3c4d('0x1a')])));}})});router['post'](_0x3c4d('0xd'),upload[_0x3c4d('0x1c')](_0x3c4d('0x20')),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2ea045,_0x40ba15,_0x2eb738){_0x2eb738(null,path[_0x3c4d('0x15')](config[_0x3c4d('0x1e')],_0x3c4d('0x16')));},'filename':function(_0x452a69,_0x151467,_0x16ad69){_0x16ad69(null,util[_0x3c4d('0x17')](_0x3c4d('0x1f'),_0x3c4d('0x21'),path[_0x3c4d('0x19')](_0x151467[_0x3c4d('0x1a')])));}})});router[_0x3c4d('0x1b')](_0x3c4d('0x10'),upload[_0x3c4d('0x1c')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x3c4d('0x14')]({'destination':function(_0x75eee4,_0x18dfe1,_0x689ef2){_0x689ef2(null,path[_0x3c4d('0x15')](config['root'],_0x3c4d('0x16')));},'filename':function(_0x46bb3c,_0x14fd7a,_0x1332d0){_0x1332d0(null,util[_0x3c4d('0x17')](_0x3c4d('0x1f'),'favicon',path[_0x3c4d('0x19')](_0x14fd7a[_0x3c4d('0x1a')])));}})});router[_0x3c4d('0x1b')](_0x3c4d('0x12'),upload[_0x3c4d('0x1c')](_0x3c4d('0x20')),controller[_0x3c4d('0x22')]);router[_0x3c4d('0x23')]('/:id',auth['isAuthenticated'](),controller[_0x3c4d('0x24')]);module[_0x3c4d('0x25')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 6d8304f..1107e45 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 _0xc6a2=['STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED','sequelize','exports','min_internal','INTEGER','min_mailbox'];(function(_0x11d234,_0x57134b){var _0x5a165a=function(_0x155777){while(--_0x155777){_0x11d234['push'](_0x11d234['shift']());}};_0x5a165a(++_0x57134b);}(_0xc6a2,0x69));var _0x2c6a=function(_0x301b85,_0x1285a){_0x301b85=_0x301b85-0x0;var _0x556444=_0xc6a2[_0x301b85];return _0x556444;};'use strict';var Sequelize=require(_0x2c6a('0x0'));module[_0x2c6a('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x2c6a('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x2c6a('0x3')](0xb),'unique':_0x2c6a('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x2c6a('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x2c6a('0x5')],'defaultValue':_0x2c6a('0x6')},'logo':{'type':Sequelize[_0x2c6a('0x5')]},'defaultLogo':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x2c6a('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x2c6a('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x2c6a('0x5')]},'turnusername':{'type':Sequelize[_0x2c6a('0x5')]},'turnpassword':{'type':Sequelize[_0x2c6a('0x5')]},'pageTitle':{'type':Sequelize[_0x2c6a('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x2c6a('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x2c6a('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x2c6a('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x2c6a('0x8')},'chatTimeout':{'type':Sequelize[_0x2c6a('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x2c6a('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x2c6a('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x2c6a('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x2c6a('0x5')]},'defaultFavicon':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x2c6a('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x2c6a('0x3')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x2c6a('0x5')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x2c6a('0x3')](0x2)[_0x2c6a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x2c6a('0x3')](0x2)[_0x2c6a('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x2c6a('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x2c6a('0x3')](0x2)[_0x2c6a('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x2c6a('0x3')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x2c6a('0x3')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x2c6a('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x2c6a('0x7')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x2c6a('0x3')],'defaultValue':0x14}}; \ No newline at end of file +var _0x9e63=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x2126d9,_0x3d5e60){var _0x4a21a3=function(_0x667cc2){while(--_0x667cc2){_0x2126d9['push'](_0x2126d9['shift']());}};_0x4a21a3(++_0x3d5e60);}(_0x9e63,0x65));var _0x39e6=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x9e63[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x39e6('0x0'));module[_0x39e6('0x1')]={'min_internal':{'type':Sequelize[_0x39e6('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x39e6('0x2')](0xb),'unique':_0x39e6('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x39e6('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x39e6('0x4')],'defaultValue':_0x39e6('0x5')},'logo':{'type':Sequelize[_0x39e6('0x4')]},'defaultLogo':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x39e6('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x39e6('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x39e6('0x4')]},'turnaddr':{'type':Sequelize[_0x39e6('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x39e6('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x39e6('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x39e6('0x4')],'defaultValue':_0x39e6('0x7')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x39e6('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x39e6('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x39e6('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x39e6('0x4')],'defaultValue':_0x39e6('0x8')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x39e6('0x4')]},'defaultPreferred':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x39e6('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x39e6('0x4')]},'defaultFavicon':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x39e6('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x39e6('0x2')]},'transcribeRegion':{'type':Sequelize[_0x39e6('0x4')]},'sentiment':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x39e6('0x2')]},'sentimentRegion':{'type':Sequelize[_0x39e6('0x4')]},'language':{'type':Sequelize[_0x39e6('0x4')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x39e6('0x2')](0x2)[_0x39e6('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x39e6('0x2')](0x2)[_0x39e6('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x39e6('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x39e6('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x39e6('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x39e6('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x39e6('0x2')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x39e6('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x39e6('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index e4c40f3..c7c85b4 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 _0x6a1d=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','then','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','end','sendStatus','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','filters','find','body','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','toLower','root','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','preferred','default_loginLogo.svg','gdpr','addPreferred','getPreferred','defaultFavicon','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6a1d,0xe1));var _0xd6a1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6a1d[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xd6a1('0x0'));var rimraf=require(_0xd6a1('0x1'));var zipdir=require(_0xd6a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd6a1('0x3'));var moment=require(_0xd6a1('0x4'));var BPromise=require(_0xd6a1('0x5'));var Mustache=require(_0xd6a1('0x6'));var util=require('util');var path=require(_0xd6a1('0x7'));var sox=require(_0xd6a1('0x8'));var csv=require(_0xd6a1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd6a1('0xa'));var _=require(_0xd6a1('0xb'));var squel=require(_0xd6a1('0xc'));var crypto=require('crypto');var jsforce=require(_0xd6a1('0xd'));var deskjs=require(_0xd6a1('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd6a1('0xf'));var Papa=require(_0xd6a1('0x10'));var Redis=require(_0xd6a1('0x11'));var authService=require(_0xd6a1('0x12'));var qs=require(_0xd6a1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6a1('0x14'));var logger=require('../../config/logger')(_0xd6a1('0x15'));var utils=require(_0xd6a1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd6a1('0x17'));var db=require(_0xd6a1('0x18'))['db'];var jayson=require(_0xd6a1('0x19'));var client=jayson['client'][_0xd6a1('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1bd724,_0x2e03f1,_0x17f944,_0x4bb660){return new BPromise(function(_0xa2d536,_0x118379){var _0x5110a3=_0x4bb660||client;return _0x5110a3['request'](_0x1bd724,_0x17f944)[_0xd6a1('0x1b')](function(_0x53c86c){logger['info'](_0xd6a1('0x1c'),_0x2e03f1,_0xd6a1('0x1d'));logger['debug'](_0xd6a1('0x1e'),_0x2e03f1,_0xd6a1('0x1d'),JSON[_0xd6a1('0x1f')](_0x53c86c));if(_0x53c86c[_0xd6a1('0x20')]){if(_0x53c86c['error'][_0xd6a1('0x21')]===0x1f4){logger[_0xd6a1('0x20')](_0xd6a1('0x1c'),_0x2e03f1,_0x53c86c['error'][_0xd6a1('0x22')]);return _0x118379(_0x53c86c[_0xd6a1('0x20')]['message']);}logger[_0xd6a1('0x20')](_0xd6a1('0x1c'),_0x2e03f1,_0x53c86c[_0xd6a1('0x20')][_0xd6a1('0x22')]);return _0xa2d536(_0x53c86c['error'][_0xd6a1('0x22')]);}else{logger[_0xd6a1('0x23')](_0xd6a1('0x1c'),_0x2e03f1,_0xd6a1('0x1d'));_0xa2d536(_0x53c86c[_0xd6a1('0x24')][_0xd6a1('0x22')]);}})[_0xd6a1('0x25')](function(_0x50f55f){logger[_0xd6a1('0x20')](_0xd6a1('0x1c'),_0x2e03f1,_0x50f55f);_0x118379(_0x50f55f);});});}function respondWithStatusCode(_0x2ff8bb,_0x383fa6){_0x383fa6=_0x383fa6||0xcc;return function(_0xc3af03){if(_0xc3af03){return _0x2ff8bb['sendStatus'](_0x383fa6);}return _0x2ff8bb[_0xd6a1('0x26')](_0x383fa6)['end']();};}function respondWithResult(_0x539a79,_0x517b1c){_0x517b1c=_0x517b1c||0xc8;return function(_0x3b78d5){if(_0x3b78d5){return _0x539a79['status'](_0x517b1c)[_0xd6a1('0x27')](_0x3b78d5);}};}function respondWithFilteredResult(_0x1bc340,_0x1d0f3e){return function(_0x3fd27a){if(_0x3fd27a){var _0x2601a0=typeof _0x1d0f3e[_0xd6a1('0x28')]===_0xd6a1('0x29')&&typeof _0x1d0f3e[_0xd6a1('0x2a')]===_0xd6a1('0x29');var _0x4a00ff=_0x3fd27a[_0xd6a1('0x2b')];var _0x556181=_0x2601a0?0x0:_0x1d0f3e[_0xd6a1('0x28')];var _0x57c0ed=_0x2601a0?_0x3fd27a[_0xd6a1('0x2b')]:_0x1d0f3e[_0xd6a1('0x28')]+_0x1d0f3e['limit'];var _0xe3f368;if(_0x57c0ed>=_0x4a00ff){_0x57c0ed=_0x4a00ff;_0xe3f368=0xc8;}else{_0xe3f368=0xce;}_0x1bc340[_0xd6a1('0x26')](_0xe3f368);return _0x1bc340[_0xd6a1('0x2c')]('Content-Range',_0x556181+'-'+_0x57c0ed+'/'+_0x4a00ff)[_0xd6a1('0x27')](_0x3fd27a);}return null;};}function patchUpdates(_0x5d1895){return function(_0x2d2d6d){try{jsonpatch[_0xd6a1('0x2d')](_0x2d2d6d,_0x5d1895,!![]);}catch(_0x59236a){return BPromise[_0xd6a1('0x2e')](_0x59236a);}return _0x2d2d6d['save']();};}function saveUpdates(_0x42f3e2,_0x133896){return function(_0x4fcf3f){if(_0x4fcf3f){return _0x4fcf3f[_0xd6a1('0x2f')](_0x42f3e2)[_0xd6a1('0x1b')](function(_0xe862a5){return _0xe862a5;});}return null;};}function removeEntity(_0xfe411c,_0x2fc061){return function(_0xacda9c){if(_0xacda9c){return _0xacda9c[_0xd6a1('0x30')]()[_0xd6a1('0x1b')](function(){_0xfe411c[_0xd6a1('0x26')](0xcc)[_0xd6a1('0x31')]();});}};}function handleEntityNotFound(_0x5e1d88,_0x3823e7){return function(_0xe0ccee){if(!_0xe0ccee){_0x5e1d88[_0xd6a1('0x32')](0x194);}return _0xe0ccee;};}function handleError(_0x52afcd,_0x373524){_0x373524=_0x373524||0x1f4;return function(_0x5c2617){logger[_0xd6a1('0x20')](_0x5c2617[_0xd6a1('0x33')]);if(_0x5c2617[_0xd6a1('0x34')]){delete _0x5c2617['name'];}_0x52afcd[_0xd6a1('0x26')](_0x373524)[_0xd6a1('0x35')](_0x5c2617);};}exports[_0xd6a1('0x36')]=function(_0x4bf91e,_0x3e4e2d){var _0x58b171={},_0x4cada4={},_0x2d13c3={'count':0x0,'rows':[]};var _0x524052=_[_0xd6a1('0x37')](db[_0xd6a1('0x38')][_0xd6a1('0x39')],function(_0x10bf2c){return{'name':_0x10bf2c[_0xd6a1('0x3a')],'type':_0x10bf2c[_0xd6a1('0x3b')]['key']};});_0x4cada4[_0xd6a1('0x3c')]=_['map'](_0x524052,_0xd6a1('0x34'));_0x4cada4[_0xd6a1('0x3d')]=_[_0xd6a1('0x3e')](_0x4bf91e[_0xd6a1('0x3d')]);_0x4cada4['filters']=_['intersection'](_0x4cada4['model'],_0x4cada4[_0xd6a1('0x3d')]);_0x58b171[_0xd6a1('0x3f')]=_[_0xd6a1('0x40')](_0x4cada4[_0xd6a1('0x3c')],qs[_0xd6a1('0x41')](_0x4bf91e[_0xd6a1('0x3d')]['fields']));_0x58b171[_0xd6a1('0x3f')]=_0x58b171['attributes'][_0xd6a1('0x42')]?_0x58b171['attributes']:_0x4cada4[_0xd6a1('0x3c')];if(!_0x4bf91e['query']['hasOwnProperty'](_0xd6a1('0x43'))){_0x58b171[_0xd6a1('0x2a')]=qs[_0xd6a1('0x2a')](_0x4bf91e['query'][_0xd6a1('0x2a')]);_0x58b171[_0xd6a1('0x28')]=qs['offset'](_0x4bf91e[_0xd6a1('0x3d')][_0xd6a1('0x28')]);}_0x58b171[_0xd6a1('0x44')]=qs['sort'](_0x4bf91e[_0xd6a1('0x3d')][_0xd6a1('0x45')]);_0x58b171[_0xd6a1('0x46')]=qs['filters'](_[_0xd6a1('0x47')](_0x4bf91e[_0xd6a1('0x3d')],_0x4cada4['filters']),_0x524052);if(_0x4bf91e[_0xd6a1('0x3d')][_0xd6a1('0x48')]){_0x58b171[_0xd6a1('0x46')]=_[_0xd6a1('0x49')](_0x58b171[_0xd6a1('0x46')],{'$or':_[_0xd6a1('0x37')](_0x524052,function(_0x5e8cc3){if(_0x5e8cc3[_0xd6a1('0x3b')]!=='VIRTUAL'){var _0x190226={};_0x190226[_0x5e8cc3[_0xd6a1('0x34')]]={'$like':'%'+_0x4bf91e['query'][_0xd6a1('0x48')]+'%'};return _0x190226;}})});}_0x58b171=_[_0xd6a1('0x49')]({},_0x58b171,_0x4bf91e[_0xd6a1('0x4a')]);var _0x42769c={'where':_0x58b171['where']};return db[_0xd6a1('0x38')][_0xd6a1('0x2b')](_0x42769c)[_0xd6a1('0x1b')](function(_0x46d544){_0x2d13c3[_0xd6a1('0x2b')]=_0x46d544;if(_0x4bf91e[_0xd6a1('0x3d')][_0xd6a1('0x4b')]){_0x58b171[_0xd6a1('0x4c')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x58b171);})[_0xd6a1('0x1b')](function(_0x45053d){_0x2d13c3[_0xd6a1('0x4d')]=_0x45053d;return _0x2d13c3;})[_0xd6a1('0x1b')](respondWithFilteredResult(_0x3e4e2d,_0x58b171))[_0xd6a1('0x25')](handleError(_0x3e4e2d,null));};exports[_0xd6a1('0x4e')]=function(_0x40bd37,_0x129f63){var _0x357bdf={'raw':![],'where':{'id':_0x40bd37['params']['id']}},_0x370b98={};_0x370b98[_0xd6a1('0x3c')]=_[_0xd6a1('0x3e')](db[_0xd6a1('0x38')][_0xd6a1('0x39')]);_0x370b98[_0xd6a1('0x3d')]=_[_0xd6a1('0x3e')](_0x40bd37[_0xd6a1('0x3d')]);_0x370b98[_0xd6a1('0x4f')]=_['intersection'](_0x370b98[_0xd6a1('0x3c')],_0x370b98[_0xd6a1('0x3d')]);_0x357bdf[_0xd6a1('0x3f')]=_[_0xd6a1('0x40')](_0x370b98['model'],qs[_0xd6a1('0x41')](_0x40bd37[_0xd6a1('0x3d')][_0xd6a1('0x41')]));_0x357bdf[_0xd6a1('0x3f')]=_0x357bdf[_0xd6a1('0x3f')][_0xd6a1('0x42')]?_0x357bdf['attributes']:_0x370b98[_0xd6a1('0x3c')];if(_0x40bd37['query']['includeAll']){_0x357bdf[_0xd6a1('0x4c')]=[{'all':!![]}];}_0x357bdf=_['merge']({},_0x357bdf,_0x40bd37[_0xd6a1('0x4a')]);return db[_0xd6a1('0x38')][_0xd6a1('0x50')](_0x357bdf)[_0xd6a1('0x1b')](handleEntityNotFound(_0x129f63,null))['then'](respondWithResult(_0x129f63,null))[_0xd6a1('0x25')](handleError(_0x129f63,null));};exports[_0xd6a1('0x2f')]=function(_0x4e34a5,_0x25ffd6){if(_0x4e34a5['body']['id']){delete _0x4e34a5[_0xd6a1('0x51')]['id'];}return db[_0xd6a1('0x38')]['find']({'where':{'id':_0x4e34a5[_0xd6a1('0x52')]['id']}})[_0xd6a1('0x1b')](handleEntityNotFound(_0x25ffd6,null))[_0xd6a1('0x1b')](saveUpdates(_0x4e34a5['body'],null))[_0xd6a1('0x1b')](respondWithResult(_0x25ffd6,null))['catch'](handleError(_0x25ffd6,null));};exports[_0xd6a1('0x53')]=function(_0xaa5d4b,_0x47f0f6,_0x33398a){if(_0xaa5d4b[_0xd6a1('0x54')]&&_0xaa5d4b[_0xd6a1('0x54')][_0xd6a1('0x55')]){_0xaa5d4b[_0xd6a1('0x51')][_0xd6a1('0x56')]=_0xaa5d4b[_0xd6a1('0x54')][_0xd6a1('0x55')];}return db[_0xd6a1('0x38')][_0xd6a1('0x50')]({'where':{'id':_0xaa5d4b[_0xd6a1('0x52')]['id']}})[_0xd6a1('0x1b')](handleEntityNotFound(_0x47f0f6,null))[_0xd6a1('0x1b')](saveUpdates(_0xaa5d4b[_0xd6a1('0x51')],null))[_0xd6a1('0x1b')](respondWithResult(_0x47f0f6,null))[_0xd6a1('0x25')](handleError(_0x47f0f6,null));};exports[_0xd6a1('0x57')]=function(_0x228ce7,_0x4b2468,_0x51f09c){if(_0x228ce7[_0xd6a1('0x54')]&&_0x228ce7[_0xd6a1('0x54')][_0xd6a1('0x55')]){_0x228ce7['body'][_0xd6a1('0x58')]=_0x228ce7['file'][_0xd6a1('0x55')];}return db[_0xd6a1('0x38')][_0xd6a1('0x50')]({'where':{'id':_0x228ce7[_0xd6a1('0x52')]['id']}})[_0xd6a1('0x1b')](handleEntityNotFound(_0x4b2468,null))['then'](saveUpdates(_0x228ce7[_0xd6a1('0x51')],null))['then'](respondWithResult(_0x4b2468,null))[_0xd6a1('0x25')](handleError(_0x4b2468,null));};var utilLicense=require(_0xd6a1('0x17'));exports['getLogo']=function(_0xf6b1e9,_0x4cd318,_0x1ee708){var _0x1b29bf=_0xd6a1('0x59');var _0x24f930={'custom':![]};return utilLicense[_0xd6a1('0x5a')]()[_0xd6a1('0x1b')](function(_0x209c60){if(_0x209c60){_0x24f930=_0x209c60;}return db[_0xd6a1('0x38')]['find']({'where':{'id':_0xf6b1e9[_0xd6a1('0x52')]['id']},'attributes':['logo',_0xd6a1('0x58'),'preferred',_0xd6a1('0x5b'),_0xd6a1('0x5c'),_0xd6a1('0x5d'),_0xd6a1('0x5e'),'defaultFavicon'],'raw':!![]});})[_0xd6a1('0x1b')](handleEntityNotFound(_0x4cd318,null))[_0xd6a1('0x1b')](function(_0x1096fb){if(_0x1096fb){var _0x2234b6=_0x1096fb[_0xd6a1('0x56')]&&fs[_0xd6a1('0x5f')](path[_0xd6a1('0x60')](config['root'],_0x1b29bf,_[_0xd6a1('0x61')](_0x1096fb[_0xd6a1('0x56')])))?path[_0xd6a1('0x60')](config[_0xd6a1('0x62')],_0x1b29bf,_[_0xd6a1('0x61')](_0x1096fb[_0xd6a1('0x56')])):path[_0xd6a1('0x60')](config[_0xd6a1('0x62')],_0x1b29bf,_['toLower'](_0xd6a1('0x63')));var _0x25c474=_0xd6a1('0x64')+_['upperFirst'](_0xd6a1('0x56'));if(_0x1096fb[_0x25c474]||!_0x24f930[_0xd6a1('0x65')]){_0x2234b6=path[_0xd6a1('0x60')](config[_0xd6a1('0x62')],_0x1b29bf,_[_0xd6a1('0x61')](_0xd6a1('0x63')));}if(!fs['existsSync'](_0x2234b6)){throw new db[(_0xd6a1('0x66'))][(_0xd6a1('0x67'))](_[_0xd6a1('0x68')](_0xd6a1('0x56'))+_0xd6a1('0x69'));}return _0x4cd318[_0xd6a1('0x6a')](_0x2234b6);}})[_0xd6a1('0x25')](handleError(_0x4cd318,null));};var utilLicense=require(_0xd6a1('0x17'));exports[_0xd6a1('0x6b')]=function(_0x5b1e6a,_0x3eed8b,_0xd5d507){var _0x29479d=_0xd6a1('0x59');var _0x559f92={'custom':![]};return utilLicense[_0xd6a1('0x5a')]()['then'](function(_0x778653){if(_0x778653){_0x559f92=_0x778653;}return db[_0xd6a1('0x38')]['find']({'where':{'id':_0x5b1e6a[_0xd6a1('0x52')]['id']},'attributes':[_0xd6a1('0x56'),_0xd6a1('0x58'),_0xd6a1('0x6c'),_0xd6a1('0x5b'),_0xd6a1('0x5c'),_0xd6a1('0x5d'),_0xd6a1('0x5e'),'defaultFavicon'],'raw':!![]});})[_0xd6a1('0x1b')](handleEntityNotFound(_0x3eed8b,null))['then'](function(_0x2f77db){if(_0x2f77db){var _0x52bbda=_0x2f77db['loginLogo']&&fs['existsSync'](path[_0xd6a1('0x60')](config[_0xd6a1('0x62')],_0x29479d,_['toLower'](_0x2f77db[_0xd6a1('0x58')])))?path['join'](config['root'],_0x29479d,_['toLower'](_0x2f77db[_0xd6a1('0x58')])):path[_0xd6a1('0x60')](config[_0xd6a1('0x62')],_0x29479d,_[_0xd6a1('0x61')](_0xd6a1('0x6d')));var _0x43fae9=_0xd6a1('0x64')+_['upperFirst'](_0xd6a1('0x58'));if(_0x2f77db[_0x43fae9]||!_0x559f92[_0xd6a1('0x65')]){_0x52bbda=path[_0xd6a1('0x60')](config['root'],_0x29479d,_[_0xd6a1('0x61')](_0xd6a1('0x6d')));}if(!fs[_0xd6a1('0x5f')](_0x52bbda)){throw new db[(_0xd6a1('0x66'))][(_0xd6a1('0x67'))](_[_0xd6a1('0x68')]('loginLogo')+'\x20not\x20found');}return _0x3eed8b[_0xd6a1('0x6a')](_0x52bbda);}})[_0xd6a1('0x25')](handleError(_0x3eed8b,null));};exports[_0xd6a1('0x6e')]=function(_0x205a4f,_0x5a0c2b){return db[_0xd6a1('0x38')][_0xd6a1('0x50')]({'where':{'id':_0x205a4f[_0xd6a1('0x52')]['id']},'attributes':['securePassword']})[_0xd6a1('0x1b')](respondWithResult(_0x5a0c2b,null))[_0xd6a1('0x25')](handleError(_0x5a0c2b,null));};exports[_0xd6a1('0x6f')]=function(_0xcd3d3d,_0x5a9220,_0x2a3546){if(_0xcd3d3d[_0xd6a1('0x54')]&&_0xcd3d3d[_0xd6a1('0x54')][_0xd6a1('0x55')]){_0xcd3d3d[_0xd6a1('0x51')][_0xd6a1('0x6c')]=_0xcd3d3d[_0xd6a1('0x54')][_0xd6a1('0x55')];}return db[_0xd6a1('0x38')][_0xd6a1('0x50')]({'where':{'id':_0xcd3d3d[_0xd6a1('0x52')]['id']}})[_0xd6a1('0x1b')](handleEntityNotFound(_0x5a9220,null))[_0xd6a1('0x1b')](saveUpdates(_0xcd3d3d[_0xd6a1('0x51')],null))['then'](respondWithResult(_0x5a9220,null))['catch'](handleError(_0x5a9220,null));};var utilLicense=require(_0xd6a1('0x17'));exports[_0xd6a1('0x70')]=function(_0x34eb11,_0x5ca573,_0x50fccf){var _0xc8847a=_0xd6a1('0x59');var _0x2f2584={'custom':![]};return utilLicense['getLicense']()[_0xd6a1('0x1b')](function(_0x2cc82a){if(_0x2cc82a){_0x2f2584=_0x2cc82a;}return db['Setting'][_0xd6a1('0x50')]({'where':{'id':_0x34eb11[_0xd6a1('0x52')]['id']},'attributes':[_0xd6a1('0x56'),_0xd6a1('0x58'),_0xd6a1('0x6c'),_0xd6a1('0x5b'),_0xd6a1('0x5c'),_0xd6a1('0x5d'),_0xd6a1('0x5e'),_0xd6a1('0x71')],'raw':!![]});})[_0xd6a1('0x1b')](handleEntityNotFound(_0x5ca573,null))['then'](function(_0x545424){if(_0x545424){var _0x2e1138=_0x545424[_0xd6a1('0x6c')]&&fs[_0xd6a1('0x5f')](path[_0xd6a1('0x60')](config['root'],_0xc8847a,_[_0xd6a1('0x61')](_0x545424[_0xd6a1('0x6c')])))?path[_0xd6a1('0x60')](config[_0xd6a1('0x62')],_0xc8847a,_[_0xd6a1('0x61')](_0x545424[_0xd6a1('0x6c')])):path[_0xd6a1('0x60')](config[_0xd6a1('0x62')],_0xc8847a,_[_0xd6a1('0x61')](_0xd6a1('0x72')));var _0x51b714='default'+_[_0xd6a1('0x68')](_0xd6a1('0x6c'));if(_0x545424[_0x51b714]||!_0x2f2584[_0xd6a1('0x65')]||!_0x2f2584[_0xd6a1('0x6c')]){_0x2e1138=path[_0xd6a1('0x60')](config[_0xd6a1('0x62')],_0xc8847a,_[_0xd6a1('0x61')](_0xd6a1('0x72')));}if(!fs['existsSync'](_0x2e1138)){throw new db[(_0xd6a1('0x66'))][(_0xd6a1('0x67'))](_[_0xd6a1('0x68')](_0xd6a1('0x6c'))+_0xd6a1('0x69'));}return _0x5ca573[_0xd6a1('0x6a')](_0x2e1138);}})[_0xd6a1('0x25')](handleError(_0x5ca573,null));};exports['addFavicon']=function(_0x1316ed,_0x57b4b2,_0x296785){if(_0x1316ed['file']&&_0x1316ed[_0xd6a1('0x54')][_0xd6a1('0x55')]){_0x1316ed[_0xd6a1('0x51')][_0xd6a1('0x5b')]=_0x1316ed[_0xd6a1('0x54')]['filename'];}return db[_0xd6a1('0x38')][_0xd6a1('0x50')]({'where':{'id':_0x1316ed[_0xd6a1('0x52')]['id']}})[_0xd6a1('0x1b')](handleEntityNotFound(_0x57b4b2,null))['then'](saveUpdates(_0x1316ed[_0xd6a1('0x51')],null))[_0xd6a1('0x1b')](respondWithResult(_0x57b4b2,null))['catch'](handleError(_0x57b4b2,null));};var utilLicense=require(_0xd6a1('0x17'));exports[_0xd6a1('0x73')]=function(_0x4c936d,_0x44ed31,_0x26865d){var _0x46d688=_0xd6a1('0x59');var _0x12a6a0={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x27fd3b){if(_0x27fd3b){_0x12a6a0=_0x27fd3b;}return db[_0xd6a1('0x38')][_0xd6a1('0x50')]({'where':{'id':_0x4c936d['params']['id']},'attributes':[_0xd6a1('0x56'),_0xd6a1('0x58'),_0xd6a1('0x6c'),_0xd6a1('0x5b'),_0xd6a1('0x5c'),_0xd6a1('0x5d'),_0xd6a1('0x5e'),_0xd6a1('0x71')],'raw':!![]});})[_0xd6a1('0x1b')](handleEntityNotFound(_0x44ed31,null))[_0xd6a1('0x1b')](function(_0x36c106){if(_0x36c106){var _0x32e864=_0x36c106['favicon']&&fs[_0xd6a1('0x5f')](path[_0xd6a1('0x60')](config['root'],_0x46d688,_[_0xd6a1('0x61')](_0x36c106[_0xd6a1('0x5b')])))?path[_0xd6a1('0x60')](config[_0xd6a1('0x62')],_0x46d688,_[_0xd6a1('0x61')](_0x36c106[_0xd6a1('0x5b')])):path[_0xd6a1('0x60')](config[_0xd6a1('0x62')],_0x46d688,_[_0xd6a1('0x61')](_0xd6a1('0x74')));var _0x1716bf='default'+_[_0xd6a1('0x68')](_0xd6a1('0x5b'));if(_0x36c106[_0x1716bf]||!_0x12a6a0[_0xd6a1('0x65')]){_0x32e864=path['join'](config[_0xd6a1('0x62')],_0x46d688,_[_0xd6a1('0x61')](_0xd6a1('0x74')));}if(!fs['existsSync'](_0x32e864)){throw new db['Sequelize'][(_0xd6a1('0x67'))](_[_0xd6a1('0x68')](_0xd6a1('0x5b'))+_0xd6a1('0x69'));}return _0x44ed31[_0xd6a1('0x6a')](_0x32e864);}})[_0xd6a1('0x25')](handleError(_0x44ed31,null));};exports[_0xd6a1('0x75')]=function(_0x40954a,_0x17271d){var _0x1946b4={'offset':moment()[_0xd6a1('0x76')]()};_0x1946b4['now']=moment()[_0xd6a1('0x76')](_0x1946b4[_0xd6a1('0x28')])[_0xd6a1('0x77')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x17271d[_0xd6a1('0x26')](0xc8)[_0xd6a1('0x35')](_0x1946b4);}; \ No newline at end of file +var _0x4d86=['addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','default_logo.svg','Sequelize','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','custom','ValidationError','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','includeAll','findAll','rows','catch','show','params','length','options','find','body'];(function(_0x39ea42,_0x3c1f50){var _0x33f5b7=function(_0x5d8e73){while(--_0x5d8e73){_0x39ea42['push'](_0x39ea42['shift']());}};_0x33f5b7(++_0x3c1f50);}(_0x4d86,0x128));var _0x64d8=function(_0x233c78,_0x52e055){_0x233c78=_0x233c78-0x0;var _0x3ab55f=_0x4d86[_0x233c78];return _0x3ab55f;};'use strict';var emlformat=require(_0x64d8('0x0'));var rimraf=require(_0x64d8('0x1'));var zipdir=require(_0x64d8('0x2'));var jsonpatch=require(_0x64d8('0x3'));var rp=require(_0x64d8('0x4'));var moment=require(_0x64d8('0x5'));var BPromise=require(_0x64d8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x64d8('0x7'));var sox=require(_0x64d8('0x8'));var csv=require(_0x64d8('0x9'));var ejs=require(_0x64d8('0xa'));var fs=require('fs');var fs_extra=require(_0x64d8('0xb'));var _=require(_0x64d8('0xc'));var squel=require(_0x64d8('0xd'));var crypto=require(_0x64d8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x64d8('0xf'));var toCsv=require(_0x64d8('0x9'));var querystring=require(_0x64d8('0x10'));var Papa=require(_0x64d8('0x11'));var Redis=require(_0x64d8('0x12'));var authService=require(_0x64d8('0x13'));var qs=require(_0x64d8('0x14'));var as=require(_0x64d8('0x15'));var hardwareService=require(_0x64d8('0x16'));var logger=require(_0x64d8('0x17'))(_0x64d8('0x18'));var utils=require(_0x64d8('0x19'));var config=require(_0x64d8('0x1a'));var licenseUtil=require(_0x64d8('0x1b'));var db=require('../../mysqldb')['db'];var jayson=require(_0x64d8('0x1c'));var client=jayson[_0x64d8('0x1d')][_0x64d8('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x14c30c,_0x194069,_0x340baa,_0x2d4891){return new BPromise(function(_0x169112,_0x22ed1f){var _0x3e6ccf=_0x2d4891||client;return _0x3e6ccf[_0x64d8('0x1f')](_0x14c30c,_0x340baa)[_0x64d8('0x20')](function(_0x512f0a){logger['info'](_0x64d8('0x21'),_0x194069,_0x64d8('0x22'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x194069,'request\x20sent',JSON['stringify'](_0x512f0a));if(_0x512f0a[_0x64d8('0x23')]){if(_0x512f0a[_0x64d8('0x23')][_0x64d8('0x24')]===0x1f4){logger[_0x64d8('0x23')](_0x64d8('0x21'),_0x194069,_0x512f0a[_0x64d8('0x23')][_0x64d8('0x25')]);return _0x22ed1f(_0x512f0a[_0x64d8('0x23')][_0x64d8('0x25')]);}logger[_0x64d8('0x23')](_0x64d8('0x21'),_0x194069,_0x512f0a[_0x64d8('0x23')][_0x64d8('0x25')]);return _0x169112(_0x512f0a['error'][_0x64d8('0x25')]);}else{logger[_0x64d8('0x26')](_0x64d8('0x21'),_0x194069,_0x64d8('0x22'));_0x169112(_0x512f0a[_0x64d8('0x27')][_0x64d8('0x25')]);}})['catch'](function(_0x10e68f){logger['error'](_0x64d8('0x21'),_0x194069,_0x10e68f);_0x22ed1f(_0x10e68f);});});}function respondWithStatusCode(_0x6f995d,_0x2016a2){_0x2016a2=_0x2016a2||0xcc;return function(_0x4c2183){if(_0x4c2183){return _0x6f995d[_0x64d8('0x28')](_0x2016a2);}return _0x6f995d['status'](_0x2016a2)[_0x64d8('0x29')]();};}function respondWithResult(_0x4d9754,_0x27b72d){_0x27b72d=_0x27b72d||0xc8;return function(_0x1ae277){if(_0x1ae277){return _0x4d9754['status'](_0x27b72d)[_0x64d8('0x2a')](_0x1ae277);}};}function respondWithFilteredResult(_0x43d430,_0x30a8fb){return function(_0x168a48){if(_0x168a48){var _0x4eee99=typeof _0x30a8fb[_0x64d8('0x2b')]===_0x64d8('0x2c')&&typeof _0x30a8fb['limit']==='undefined';var _0x2f8ced=_0x168a48[_0x64d8('0x2d')];var _0x20c182=_0x4eee99?0x0:_0x30a8fb[_0x64d8('0x2b')];var _0x2af962=_0x4eee99?_0x168a48[_0x64d8('0x2d')]:_0x30a8fb[_0x64d8('0x2b')]+_0x30a8fb[_0x64d8('0x2e')];var _0x409d18;if(_0x2af962>=_0x2f8ced){_0x2af962=_0x2f8ced;_0x409d18=0xc8;}else{_0x409d18=0xce;}_0x43d430[_0x64d8('0x2f')](_0x409d18);return _0x43d430[_0x64d8('0x30')](_0x64d8('0x31'),_0x20c182+'-'+_0x2af962+'/'+_0x2f8ced)[_0x64d8('0x2a')](_0x168a48);}return null;};}function patchUpdates(_0x34f7aa){return function(_0x492fee){try{jsonpatch[_0x64d8('0x32')](_0x492fee,_0x34f7aa,!![]);}catch(_0x3b21e4){return BPromise[_0x64d8('0x33')](_0x3b21e4);}return _0x492fee[_0x64d8('0x34')]();};}function saveUpdates(_0x31642,_0x3b177f){return function(_0x41949c){if(_0x41949c){return _0x41949c[_0x64d8('0x35')](_0x31642)['then'](function(_0x40afc8){return _0x40afc8;});}return null;};}function removeEntity(_0x58b069,_0x56d861){return function(_0x13c3ae){if(_0x13c3ae){return _0x13c3ae[_0x64d8('0x36')]()[_0x64d8('0x20')](function(){_0x58b069[_0x64d8('0x2f')](0xcc)[_0x64d8('0x29')]();});}};}function handleEntityNotFound(_0x46e217,_0x4228b9){return function(_0x5e2147){if(!_0x5e2147){_0x46e217[_0x64d8('0x28')](0x194);}return _0x5e2147;};}function handleError(_0x1a6524,_0x2f9eb5){_0x2f9eb5=_0x2f9eb5||0x1f4;return function(_0x30abdd){logger[_0x64d8('0x23')](_0x30abdd[_0x64d8('0x37')]);if(_0x30abdd[_0x64d8('0x38')]){delete _0x30abdd[_0x64d8('0x38')];}_0x1a6524[_0x64d8('0x2f')](_0x2f9eb5)[_0x64d8('0x39')](_0x30abdd);};}exports[_0x64d8('0x3a')]=function(_0x1dcc7e,_0x468eaa){var _0x2707c9={},_0x46df7d={},_0x22a85d={'count':0x0,'rows':[]};var _0x4d5e52=_[_0x64d8('0x3b')](db[_0x64d8('0x3c')][_0x64d8('0x3d')],function(_0x28b3de){return{'name':_0x28b3de[_0x64d8('0x3e')],'type':_0x28b3de[_0x64d8('0x3f')][_0x64d8('0x40')]};});_0x46df7d['model']=_[_0x64d8('0x3b')](_0x4d5e52,_0x64d8('0x38'));_0x46df7d[_0x64d8('0x41')]=_[_0x64d8('0x42')](_0x1dcc7e[_0x64d8('0x41')]);_0x46df7d[_0x64d8('0x43')]=_[_0x64d8('0x44')](_0x46df7d['model'],_0x46df7d[_0x64d8('0x41')]);_0x2707c9['attributes']=_['intersection'](_0x46df7d[_0x64d8('0x45')],qs[_0x64d8('0x46')](_0x1dcc7e[_0x64d8('0x41')][_0x64d8('0x46')]));_0x2707c9[_0x64d8('0x47')]=_0x2707c9[_0x64d8('0x47')]['length']?_0x2707c9[_0x64d8('0x47')]:_0x46df7d[_0x64d8('0x45')];if(!_0x1dcc7e[_0x64d8('0x41')][_0x64d8('0x48')]('nolimit')){_0x2707c9[_0x64d8('0x2e')]=qs[_0x64d8('0x2e')](_0x1dcc7e[_0x64d8('0x41')]['limit']);_0x2707c9[_0x64d8('0x2b')]=qs['offset'](_0x1dcc7e[_0x64d8('0x41')][_0x64d8('0x2b')]);}_0x2707c9[_0x64d8('0x49')]=qs['sort'](_0x1dcc7e[_0x64d8('0x41')][_0x64d8('0x4a')]);_0x2707c9[_0x64d8('0x4b')]=qs[_0x64d8('0x43')](_['pick'](_0x1dcc7e[_0x64d8('0x41')],_0x46df7d[_0x64d8('0x43')]),_0x4d5e52);if(_0x1dcc7e[_0x64d8('0x41')][_0x64d8('0x4c')]){_0x2707c9[_0x64d8('0x4b')]=_[_0x64d8('0x4d')](_0x2707c9['where'],{'$or':_['map'](_0x4d5e52,function(_0x3feb0c){if(_0x3feb0c[_0x64d8('0x3f')]!=='VIRTUAL'){var _0x387139={};_0x387139[_0x3feb0c[_0x64d8('0x38')]]={'$like':'%'+_0x1dcc7e[_0x64d8('0x41')][_0x64d8('0x4c')]+'%'};return _0x387139;}})});}_0x2707c9=_[_0x64d8('0x4d')]({},_0x2707c9,_0x1dcc7e['options']);var _0x232d0c={'where':_0x2707c9[_0x64d8('0x4b')]};return db[_0x64d8('0x3c')][_0x64d8('0x2d')](_0x232d0c)[_0x64d8('0x20')](function(_0xd51de2){_0x22a85d[_0x64d8('0x2d')]=_0xd51de2;if(_0x1dcc7e[_0x64d8('0x41')][_0x64d8('0x4e')]){_0x2707c9['include']=[{'all':!![]}];}return db[_0x64d8('0x3c')][_0x64d8('0x4f')](_0x2707c9);})['then'](function(_0x5dcee9){_0x22a85d[_0x64d8('0x50')]=_0x5dcee9;return _0x22a85d;})[_0x64d8('0x20')](respondWithFilteredResult(_0x468eaa,_0x2707c9))[_0x64d8('0x51')](handleError(_0x468eaa,null));};exports[_0x64d8('0x52')]=function(_0x598386,_0x4c406a){var _0xeb064d={'raw':![],'where':{'id':_0x598386[_0x64d8('0x53')]['id']}},_0x5c8f5d={};_0x5c8f5d[_0x64d8('0x45')]=_[_0x64d8('0x42')](db[_0x64d8('0x3c')][_0x64d8('0x3d')]);_0x5c8f5d[_0x64d8('0x41')]=_[_0x64d8('0x42')](_0x598386['query']);_0x5c8f5d[_0x64d8('0x43')]=_['intersection'](_0x5c8f5d[_0x64d8('0x45')],_0x5c8f5d['query']);_0xeb064d[_0x64d8('0x47')]=_[_0x64d8('0x44')](_0x5c8f5d[_0x64d8('0x45')],qs['fields'](_0x598386[_0x64d8('0x41')][_0x64d8('0x46')]));_0xeb064d[_0x64d8('0x47')]=_0xeb064d[_0x64d8('0x47')][_0x64d8('0x54')]?_0xeb064d[_0x64d8('0x47')]:_0x5c8f5d[_0x64d8('0x45')];if(_0x598386[_0x64d8('0x41')][_0x64d8('0x4e')]){_0xeb064d['include']=[{'all':!![]}];}_0xeb064d=_['merge']({},_0xeb064d,_0x598386[_0x64d8('0x55')]);return db['Setting'][_0x64d8('0x56')](_0xeb064d)['then'](handleEntityNotFound(_0x4c406a,null))['then'](respondWithResult(_0x4c406a,null))[_0x64d8('0x51')](handleError(_0x4c406a,null));};exports[_0x64d8('0x35')]=function(_0x3d2138,_0x5d4227){if(_0x3d2138[_0x64d8('0x57')]['id']){delete _0x3d2138[_0x64d8('0x57')]['id'];}return db[_0x64d8('0x3c')]['find']({'where':{'id':_0x3d2138[_0x64d8('0x53')]['id']}})[_0x64d8('0x20')](handleEntityNotFound(_0x5d4227,null))[_0x64d8('0x20')](saveUpdates(_0x3d2138['body'],null))[_0x64d8('0x20')](respondWithResult(_0x5d4227,null))[_0x64d8('0x51')](handleError(_0x5d4227,null));};exports[_0x64d8('0x58')]=function(_0x1ce1e9,_0x57e00a,_0x23f522){if(_0x1ce1e9['file']&&_0x1ce1e9[_0x64d8('0x59')][_0x64d8('0x5a')]){_0x1ce1e9[_0x64d8('0x57')]['logo']=_0x1ce1e9[_0x64d8('0x59')][_0x64d8('0x5a')];}return db['Setting'][_0x64d8('0x56')]({'where':{'id':_0x1ce1e9['params']['id']}})[_0x64d8('0x20')](handleEntityNotFound(_0x57e00a,null))[_0x64d8('0x20')](saveUpdates(_0x1ce1e9[_0x64d8('0x57')],null))[_0x64d8('0x20')](respondWithResult(_0x57e00a,null))['catch'](handleError(_0x57e00a,null));};exports[_0x64d8('0x5b')]=function(_0x399eac,_0x20716d,_0x58ecef){if(_0x399eac[_0x64d8('0x59')]&&_0x399eac['file']['filename']){_0x399eac[_0x64d8('0x57')][_0x64d8('0x5c')]=_0x399eac[_0x64d8('0x59')]['filename'];}return db[_0x64d8('0x3c')]['find']({'where':{'id':_0x399eac[_0x64d8('0x53')]['id']}})[_0x64d8('0x20')](handleEntityNotFound(_0x20716d,null))[_0x64d8('0x20')](saveUpdates(_0x399eac[_0x64d8('0x57')],null))[_0x64d8('0x20')](respondWithResult(_0x20716d,null))['catch'](handleError(_0x20716d,null));};var utilLicense=require(_0x64d8('0x1b'));exports[_0x64d8('0x5d')]=function(_0xd61137,_0x26aab0,_0x563818){var _0x10a7ba=_0x64d8('0x5e');var _0x2ed194={'custom':![]};return utilLicense[_0x64d8('0x5f')]()[_0x64d8('0x20')](function(_0x31f7f3){if(_0x31f7f3){_0x2ed194=_0x31f7f3;}return db[_0x64d8('0x3c')][_0x64d8('0x56')]({'where':{'id':_0xd61137['params']['id']},'attributes':[_0x64d8('0x60'),_0x64d8('0x5c'),_0x64d8('0x61'),_0x64d8('0x62'),_0x64d8('0x63'),_0x64d8('0x64'),_0x64d8('0x65'),_0x64d8('0x66')],'raw':!![]});})[_0x64d8('0x20')](handleEntityNotFound(_0x26aab0,null))[_0x64d8('0x20')](function(_0x8d47f8){if(_0x8d47f8){var _0x2b3419=_0x8d47f8[_0x64d8('0x60')]&&fs[_0x64d8('0x67')](path[_0x64d8('0x68')](config[_0x64d8('0x69')],_0x10a7ba,_[_0x64d8('0x6a')](_0x8d47f8[_0x64d8('0x60')])))?path[_0x64d8('0x68')](config[_0x64d8('0x69')],_0x10a7ba,_[_0x64d8('0x6a')](_0x8d47f8[_0x64d8('0x60')])):path[_0x64d8('0x68')](config[_0x64d8('0x69')],_0x10a7ba,_['toLower']('default_logo.svg'));var _0x3050b2=_0x64d8('0x6b')+_[_0x64d8('0x6c')](_0x64d8('0x60'));if(_0x8d47f8[_0x3050b2]||!_0x2ed194['custom']){_0x2b3419=path[_0x64d8('0x68')](config[_0x64d8('0x69')],_0x10a7ba,_[_0x64d8('0x6a')](_0x64d8('0x6d')));}if(!fs[_0x64d8('0x67')](_0x2b3419)){throw new db[(_0x64d8('0x6e'))]['ValidationError'](_['upperFirst'](_0x64d8('0x60'))+_0x64d8('0x6f'));}return _0x26aab0[_0x64d8('0x70')](_0x2b3419);}})[_0x64d8('0x51')](handleError(_0x26aab0,null));};var utilLicense=require('../../config/license/util');exports[_0x64d8('0x71')]=function(_0x5526f2,_0x474285,_0x1b6724){var _0x5d9da3=_0x64d8('0x5e');var _0x167192={'custom':![]};return utilLicense['getLicense']()[_0x64d8('0x20')](function(_0x3a917a){if(_0x3a917a){_0x167192=_0x3a917a;}return db[_0x64d8('0x3c')]['find']({'where':{'id':_0x5526f2[_0x64d8('0x53')]['id']},'attributes':['logo','loginLogo',_0x64d8('0x61'),'favicon','defaultLogo',_0x64d8('0x64'),'defaultPreferred',_0x64d8('0x66')],'raw':!![]});})[_0x64d8('0x20')](handleEntityNotFound(_0x474285,null))['then'](function(_0x488c1f){if(_0x488c1f){var _0x405be6=_0x488c1f[_0x64d8('0x5c')]&&fs['existsSync'](path[_0x64d8('0x68')](config[_0x64d8('0x69')],_0x5d9da3,_[_0x64d8('0x6a')](_0x488c1f['loginLogo'])))?path[_0x64d8('0x68')](config[_0x64d8('0x69')],_0x5d9da3,_[_0x64d8('0x6a')](_0x488c1f[_0x64d8('0x5c')])):path[_0x64d8('0x68')](config['root'],_0x5d9da3,_[_0x64d8('0x6a')](_0x64d8('0x72')));var _0x2e4fe7=_0x64d8('0x6b')+_[_0x64d8('0x6c')]('loginLogo');if(_0x488c1f[_0x2e4fe7]||!_0x167192[_0x64d8('0x73')]){_0x405be6=path[_0x64d8('0x68')](config[_0x64d8('0x69')],_0x5d9da3,_[_0x64d8('0x6a')]('default_loginLogo.svg'));}if(!fs[_0x64d8('0x67')](_0x405be6)){throw new db['Sequelize'][(_0x64d8('0x74'))](_['upperFirst'](_0x64d8('0x5c'))+_0x64d8('0x6f'));}return _0x474285[_0x64d8('0x70')](_0x405be6);}})[_0x64d8('0x51')](handleError(_0x474285,null));};exports['gdpr']=function(_0x54a3f3,_0x356ac7){return db[_0x64d8('0x3c')][_0x64d8('0x56')]({'where':{'id':_0x54a3f3[_0x64d8('0x53')]['id']},'attributes':[_0x64d8('0x75')]})[_0x64d8('0x20')](respondWithResult(_0x356ac7,null))['catch'](handleError(_0x356ac7,null));};exports[_0x64d8('0x76')]=function(_0x4240ee,_0x91ac7e,_0xbda1a2){if(_0x4240ee[_0x64d8('0x59')]&&_0x4240ee[_0x64d8('0x59')][_0x64d8('0x5a')]){_0x4240ee[_0x64d8('0x57')][_0x64d8('0x61')]=_0x4240ee['file'][_0x64d8('0x5a')];}return db[_0x64d8('0x3c')][_0x64d8('0x56')]({'where':{'id':_0x4240ee['params']['id']}})[_0x64d8('0x20')](handleEntityNotFound(_0x91ac7e,null))['then'](saveUpdates(_0x4240ee[_0x64d8('0x57')],null))[_0x64d8('0x20')](respondWithResult(_0x91ac7e,null))[_0x64d8('0x51')](handleError(_0x91ac7e,null));};var utilLicense=require(_0x64d8('0x1b'));exports[_0x64d8('0x77')]=function(_0x1bb040,_0x40c4aa,_0x2fc90c){var _0x228dd1=_0x64d8('0x5e');var _0x1761d8={'custom':![]};return utilLicense[_0x64d8('0x5f')]()[_0x64d8('0x20')](function(_0x389f34){if(_0x389f34){_0x1761d8=_0x389f34;}return db[_0x64d8('0x3c')][_0x64d8('0x56')]({'where':{'id':_0x1bb040[_0x64d8('0x53')]['id']},'attributes':[_0x64d8('0x60'),_0x64d8('0x5c'),_0x64d8('0x61'),_0x64d8('0x62'),_0x64d8('0x63'),_0x64d8('0x64'),'defaultPreferred',_0x64d8('0x66')],'raw':!![]});})[_0x64d8('0x20')](handleEntityNotFound(_0x40c4aa,null))[_0x64d8('0x20')](function(_0x4e0b0f){if(_0x4e0b0f){var _0x3e7f29=_0x4e0b0f[_0x64d8('0x61')]&&fs[_0x64d8('0x67')](path[_0x64d8('0x68')](config[_0x64d8('0x69')],_0x228dd1,_[_0x64d8('0x6a')](_0x4e0b0f[_0x64d8('0x61')])))?path[_0x64d8('0x68')](config['root'],_0x228dd1,_[_0x64d8('0x6a')](_0x4e0b0f[_0x64d8('0x61')])):path[_0x64d8('0x68')](config[_0x64d8('0x69')],_0x228dd1,_[_0x64d8('0x6a')](_0x64d8('0x78')));var _0x5b09f5=_0x64d8('0x6b')+_[_0x64d8('0x6c')](_0x64d8('0x61'));if(_0x4e0b0f[_0x5b09f5]||!_0x1761d8[_0x64d8('0x73')]||!_0x1761d8[_0x64d8('0x61')]){_0x3e7f29=path[_0x64d8('0x68')](config[_0x64d8('0x69')],_0x228dd1,_[_0x64d8('0x6a')](_0x64d8('0x78')));}if(!fs[_0x64d8('0x67')](_0x3e7f29)){throw new db[(_0x64d8('0x6e'))]['ValidationError'](_[_0x64d8('0x6c')](_0x64d8('0x61'))+'\x20not\x20found');}return _0x40c4aa[_0x64d8('0x70')](_0x3e7f29);}})[_0x64d8('0x51')](handleError(_0x40c4aa,null));};exports[_0x64d8('0x79')]=function(_0x456495,_0x11dd15,_0x4d17ad){if(_0x456495[_0x64d8('0x59')]&&_0x456495[_0x64d8('0x59')][_0x64d8('0x5a')]){_0x456495['body'][_0x64d8('0x62')]=_0x456495[_0x64d8('0x59')][_0x64d8('0x5a')];}return db[_0x64d8('0x3c')]['find']({'where':{'id':_0x456495[_0x64d8('0x53')]['id']}})[_0x64d8('0x20')](handleEntityNotFound(_0x11dd15,null))[_0x64d8('0x20')](saveUpdates(_0x456495[_0x64d8('0x57')],null))[_0x64d8('0x20')](respondWithResult(_0x11dd15,null))[_0x64d8('0x51')](handleError(_0x11dd15,null));};var utilLicense=require('../../config/license/util');exports[_0x64d8('0x7a')]=function(_0x743c96,_0x29a1f1,_0x3269b0){var _0x3fa922=_0x64d8('0x5e');var _0x5bf3cd={'custom':![]};return utilLicense[_0x64d8('0x5f')]()['then'](function(_0x4a7f9c){if(_0x4a7f9c){_0x5bf3cd=_0x4a7f9c;}return db[_0x64d8('0x3c')]['find']({'where':{'id':_0x743c96['params']['id']},'attributes':['logo',_0x64d8('0x5c'),_0x64d8('0x61'),'favicon',_0x64d8('0x63'),_0x64d8('0x64'),_0x64d8('0x65'),_0x64d8('0x66')],'raw':!![]});})[_0x64d8('0x20')](handleEntityNotFound(_0x29a1f1,null))[_0x64d8('0x20')](function(_0x44e1f8){if(_0x44e1f8){var _0x62c087=_0x44e1f8[_0x64d8('0x62')]&&fs[_0x64d8('0x67')](path[_0x64d8('0x68')](config[_0x64d8('0x69')],_0x3fa922,_['toLower'](_0x44e1f8[_0x64d8('0x62')])))?path[_0x64d8('0x68')](config[_0x64d8('0x69')],_0x3fa922,_[_0x64d8('0x6a')](_0x44e1f8[_0x64d8('0x62')])):path[_0x64d8('0x68')](config['root'],_0x3fa922,_[_0x64d8('0x6a')](_0x64d8('0x7b')));var _0x24f92c=_0x64d8('0x6b')+_[_0x64d8('0x6c')](_0x64d8('0x62'));if(_0x44e1f8[_0x24f92c]||!_0x5bf3cd[_0x64d8('0x73')]){_0x62c087=path[_0x64d8('0x68')](config[_0x64d8('0x69')],_0x3fa922,_[_0x64d8('0x6a')](_0x64d8('0x7b')));}if(!fs[_0x64d8('0x67')](_0x62c087)){throw new db['Sequelize'][(_0x64d8('0x74'))](_['upperFirst'](_0x64d8('0x62'))+'\x20not\x20found');}return _0x29a1f1['download'](_0x62c087);}})['catch'](handleError(_0x29a1f1,null));};exports[_0x64d8('0x7c')]=function(_0x57d1ba,_0x58d4a1){var _0x1daf17={'offset':moment()[_0x64d8('0x7d')]()};_0x1daf17['now']=moment()[_0x64d8('0x7d')](_0x1daf17[_0x64d8('0x2b')])[_0x64d8('0x7e')](_0x64d8('0x7f'));return _0x58d4a1[_0x64d8('0x2f')](0xc8)[_0x64d8('0x39')](_0x1daf17);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 30e8003..6018973 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 _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7217,0x19e));var _0x7721=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x7217[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x240af3,_0x1731ff){var _0x8ce5fe=function(_0x4e8126){while(--_0x4e8126){_0x240af3['push'](_0x240af3['shift']());}};_0x8ce5fe(++_0x1731ff);}(_0xedd9,0xfc));var _0x9edd=function(_0x2f15ee,_0x3b0aaa){_0x2f15ee=_0x2f15ee-0x0;var _0x35fcde=_0xedd9[_0x2f15ee];return _0x35fcde;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index dfae3d6..e54cbe4 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 _0x9883=['jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSetting','Setting','options','raw','attributes','include','model','map','stringify','lodash','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0x5cf9d9,_0x394c71){var _0x1564b9=function(_0x1e650d){while(--_0x1e650d){_0x5cf9d9['push'](_0x5cf9d9['shift']());}};_0x1564b9(++_0x394c71);}(_0x9883,0x6f));var _0x3988=function(_0x434d27,_0xec727a){_0x434d27=_0x434d27-0x0;var _0x341fa2=_0x9883[_0x434d27];return _0x341fa2;};'use strict';var _=require(_0x3988('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3988('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3988('0x2'))(_0x3988('0x3'));var config=require(_0x3988('0x4'));var jayson=require(_0x3988('0x5'));var client=jayson[_0x3988('0x6')][_0x3988('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e021b,_0x1dc1a7,_0x2c2587){return new BPromise(function(_0x2397d9,_0x25e6f7){return client[_0x3988('0x8')](_0x4e021b,_0x2c2587)[_0x3988('0x9')](function(_0xdfd662){logger[_0x3988('0xa')](_0x3988('0xb'),_0x1dc1a7,_0x3988('0xc'));logger[_0x3988('0xd')](_0x3988('0xe'),_0x1dc1a7,_0x3988('0xc'),JSON['stringify'](_0xdfd662));if(_0xdfd662[_0x3988('0xf')]){if(_0xdfd662[_0x3988('0xf')][_0x3988('0x10')]===0x1f4){logger[_0x3988('0xf')](_0x3988('0xb'),_0x1dc1a7,_0xdfd662[_0x3988('0xf')]['message']);return _0x25e6f7(_0xdfd662['error']['message']);}logger[_0x3988('0xf')](_0x3988('0xb'),_0x1dc1a7,_0xdfd662[_0x3988('0xf')][_0x3988('0x11')]);return _0x2397d9(_0xdfd662['error'][_0x3988('0x11')]);}else{logger[_0x3988('0xa')](_0x3988('0xb'),_0x1dc1a7,_0x3988('0xc'));_0x2397d9(_0xdfd662[_0x3988('0x12')]['message']);}})[_0x3988('0x13')](function(_0x44c3a1){logger[_0x3988('0xf')](_0x3988('0xb'),_0x1dc1a7,_0x44c3a1);_0x25e6f7(_0x44c3a1);});});}exports[_0x3988('0x14')]=function(_0x2fea4d){var _0x2ad67d=this;return new Promise(function(_0x107efd,_0x186463){return db[_0x3988('0x15')]['find']({'raw':_0x2fea4d['options']?_0x2fea4d[_0x3988('0x16')][_0x3988('0x17')]===undefined?!![]:![]:!![],'where':_0x2fea4d['options']?_0x2fea4d[_0x3988('0x16')]['where']||null:null,'attributes':_0x2fea4d[_0x3988('0x16')]?_0x2fea4d[_0x3988('0x16')][_0x3988('0x18')]||null:null,'include':_0x2fea4d[_0x3988('0x16')]?_0x2fea4d[_0x3988('0x16')][_0x3988('0x19')]?_['map'](_0x2fea4d[_0x3988('0x16')][_0x3988('0x19')],function(_0x235e0e){return{'model':db[_0x235e0e[_0x3988('0x1a')]],'as':_0x235e0e['as'],'attributes':_0x235e0e[_0x3988('0x18')],'include':_0x235e0e[_0x3988('0x19')]?_[_0x3988('0x1b')](_0x235e0e['include'],function(_0x5e7f8c){return{'model':db[_0x5e7f8c[_0x3988('0x1a')]],'as':_0x5e7f8c['as'],'attributes':_0x5e7f8c[_0x3988('0x18')],'include':_0x5e7f8c[_0x3988('0x19')]?_[_0x3988('0x1b')](_0x5e7f8c[_0x3988('0x19')],function(_0x3e19c3){return{'model':db[_0x3e19c3[_0x3988('0x1a')]],'as':_0x3e19c3['as'],'attributes':_0x3e19c3[_0x3988('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3988('0x9')](function(_0x30510e){logger[_0x3988('0xa')](_0x3988('0x14'),_0x2fea4d);logger['debug'](_0x3988('0x14'),_0x2fea4d,JSON[_0x3988('0x1c')](_0x30510e));_0x107efd(_0x30510e);})[_0x3988('0x13')](function(_0x1d41b7){logger[_0x3988('0xf')](_0x3988('0x14'),_0x1d41b7[_0x3988('0x11')],_0x2fea4d);_0x186463(_0x2ad67d['error'](0x1f4,_0x1d41b7[_0x3988('0x11')]));});});}; \ No newline at end of file +var _0xa559=['randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','request','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','then','lodash','moment','bluebird'];(function(_0x36a2c8,_0x5e7be8){var _0x47e72d=function(_0x48a317){while(--_0x48a317){_0x36a2c8['push'](_0x36a2c8['shift']());}};_0x47e72d(++_0x5e7be8);}(_0xa559,0x133));var _0x9a55=function(_0x552658,_0x343746){_0x552658=_0x552658-0x0;var _0xf9e523=_0xa559[_0x552658];return _0xf9e523;};'use strict';var _=require(_0x9a55('0x0'));var util=require('util');var moment=require(_0x9a55('0x1'));var BPromise=require(_0x9a55('0x2'));var rs=require(_0x9a55('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a55('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a55('0x5'))(_0x9a55('0x6'));var config=require('../../config/environment');var jayson=require(_0x9a55('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45d910,_0xfe12f5,_0x418a70){return new BPromise(function(_0x1b9d0e,_0x3fedb5){return client[_0x9a55('0x8')](_0x45d910,_0x418a70)['then'](function(_0x6cb153){logger[_0x9a55('0x9')](_0x9a55('0xa'),_0xfe12f5,'request\x20sent');logger[_0x9a55('0xb')](_0x9a55('0xc'),_0xfe12f5,_0x9a55('0xd'),JSON[_0x9a55('0xe')](_0x6cb153));if(_0x6cb153[_0x9a55('0xf')]){if(_0x6cb153[_0x9a55('0xf')][_0x9a55('0x10')]===0x1f4){logger[_0x9a55('0xf')]('Setting,\x20%s,\x20%s',_0xfe12f5,_0x6cb153['error'][_0x9a55('0x11')]);return _0x3fedb5(_0x6cb153['error'][_0x9a55('0x11')]);}logger[_0x9a55('0xf')](_0x9a55('0xa'),_0xfe12f5,_0x6cb153[_0x9a55('0xf')]['message']);return _0x1b9d0e(_0x6cb153[_0x9a55('0xf')]['message']);}else{logger[_0x9a55('0x9')](_0x9a55('0xa'),_0xfe12f5,_0x9a55('0xd'));_0x1b9d0e(_0x6cb153[_0x9a55('0x12')][_0x9a55('0x11')]);}})[_0x9a55('0x13')](function(_0x28d52d){logger[_0x9a55('0xf')]('Setting,\x20%s,\x20%s',_0xfe12f5,_0x28d52d);_0x3fedb5(_0x28d52d);});});}exports[_0x9a55('0x14')]=function(_0x482f34){var _0x4baa8c=this;return new Promise(function(_0x5d5028,_0x5f1ff0){return db[_0x9a55('0x15')][_0x9a55('0x16')]({'raw':_0x482f34[_0x9a55('0x17')]?_0x482f34[_0x9a55('0x17')][_0x9a55('0x18')]===undefined?!![]:![]:!![],'where':_0x482f34[_0x9a55('0x17')]?_0x482f34[_0x9a55('0x17')][_0x9a55('0x19')]||null:null,'attributes':_0x482f34[_0x9a55('0x17')]?_0x482f34[_0x9a55('0x17')][_0x9a55('0x1a')]||null:null,'include':_0x482f34[_0x9a55('0x17')]?_0x482f34[_0x9a55('0x17')][_0x9a55('0x1b')]?_['map'](_0x482f34[_0x9a55('0x17')][_0x9a55('0x1b')],function(_0x44aad2){return{'model':db[_0x44aad2['model']],'as':_0x44aad2['as'],'attributes':_0x44aad2['attributes'],'include':_0x44aad2['include']?_[_0x9a55('0x1c')](_0x44aad2['include'],function(_0x1a4d93){return{'model':db[_0x1a4d93['model']],'as':_0x1a4d93['as'],'attributes':_0x1a4d93[_0x9a55('0x1a')],'include':_0x1a4d93[_0x9a55('0x1b')]?_['map'](_0x1a4d93[_0x9a55('0x1b')],function(_0x4278d6){return{'model':db[_0x4278d6[_0x9a55('0x1d')]],'as':_0x4278d6['as'],'attributes':_0x4278d6[_0x9a55('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9a55('0x1e')](function(_0x5b5cd8){logger[_0x9a55('0x9')](_0x9a55('0x14'),_0x482f34);logger['debug']('ShowSetting',_0x482f34,JSON[_0x9a55('0xe')](_0x5b5cd8));_0x5d5028(_0x5b5cd8);})[_0x9a55('0x13')](function(_0x4b8589){logger['error']('ShowSetting',_0x4b8589[_0x9a55('0x11')],_0x482f34);_0x5f1ff0(_0x4baa8c[_0x9a55('0xf')](0x1f4,_0x4b8589['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index c2c1e6a..863b558 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x10a8fd,_0x5fdb4c){var _0x50597b=function(_0x36ab10){while(--_0x36ab10){_0x10a8fd['push'](_0x10a8fd['shift']());}};_0x50597b(++_0x5fdb4c);}(_0x6aa7,0x178));var _0x76aa=function(_0x16cea0,_0x2a4817){_0x16cea0=_0x16cea0-0x0;var _0xeb09=_0x6aa7[_0x16cea0];return _0xeb09;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router; \ No newline at end of file +var _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0x3ef2c7,_0x2d6a7c){var _0x579aca=function(_0x32dc8c){while(--_0x32dc8c){_0x3ef2c7['push'](_0x3ef2c7['shift']());}};_0x579aca(++_0x2d6a7c);}(_0x53ec,0x192));var _0xc53e=function(_0x4503f6,_0x3babaf){_0x4503f6=_0x4503f6-0x0;var _0x2277d1=_0x53ec[_0x4503f6];return _0x2277d1;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index c1a7b0a..ba81dce 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 _0x7cf0=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','twilio','connectel','clicksend','plivo','clickatell','infobip','intelepeer','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x529f4b,_0x33f7b7){var _0x4365f6=function(_0x5cba4b){while(--_0x5cba4b){_0x529f4b['push'](_0x529f4b['shift']());}};_0x4365f6(++_0x33f7b7);}(_0x7cf0,0x1ba));var _0x07cf=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7cf0[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x07cf('0x0'));module[_0x07cf('0x1')]={'name':{'type':Sequelize[_0x07cf('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x07cf('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x07cf('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x07cf('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x07cf('0x2')]},'type':{'type':Sequelize['ENUM'](_0x07cf('0x3'),'skebby',_0x07cf('0x4'),_0x07cf('0x5'),_0x07cf('0x6'),_0x07cf('0x7'),'bandwidth','csc',_0x07cf('0x8'),_0x07cf('0x9'))},'accountSid':{'type':Sequelize[_0x07cf('0x2')]},'authId':{'type':Sequelize[_0x07cf('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x07cf('0xa')]('SI','TI','GP')},'username':{'type':Sequelize[_0x07cf('0x2')]},'password':{'type':Sequelize[_0x07cf('0x2')]},'apiKey':{'type':Sequelize[_0x07cf('0x2')]},'applicationId':{'type':Sequelize[_0x07cf('0x2')]},'accountId':{'type':Sequelize[_0x07cf('0x2')]},'senderString':{'type':Sequelize[_0x07cf('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x07cf('0xb')],'defaultValue':function(){return _0x07cf('0xc');}},'notificationSound':{'type':Sequelize[_0x07cf('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x07cf('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x07cf('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x07cf('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x07cf('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x07cf('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x07cf('0xe')],'comment':_0x07cf('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3959a4){if(!_0x3959a4)this[_0x07cf('0x10')](_0x07cf('0x11'),null);this[_0x07cf('0x10')](_0x07cf('0x12'),_0x3959a4);}}}; \ No newline at end of file +var _0x469d=['bandwidth','intelepeer','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell'];(function(_0x2b5cbe,_0x41c83e){var _0x462fec=function(_0x3f7cb3){while(--_0x3f7cb3){_0x2b5cbe['push'](_0x2b5cbe['shift']());}};_0x462fec(++_0x41c83e);}(_0x469d,0xc6));var _0xd469=function(_0x46a78c,_0x1fd10f){_0x46a78c=_0x46a78c-0x0;var _0x2b18a1=_0x469d[_0x46a78c];return _0x2b18a1;};'use strict';var Sequelize=require(_0xd469('0x0'));var rs=require('randomstring');module[_0xd469('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd469('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xd469('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd469('0x4')]();}},'phone':{'type':Sequelize[_0xd469('0x3')]},'type':{'type':Sequelize[_0xd469('0x5')](_0xd469('0x6'),_0xd469('0x7'),_0xd469('0x8'),_0xd469('0x9'),_0xd469('0xa'),_0xd469('0xb'),_0xd469('0xc'),'csc','infobip',_0xd469('0xd'))},'accountSid':{'type':Sequelize[_0xd469('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xd469('0x3')]},'smsMethod':{'type':Sequelize[_0xd469('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xd469('0x3')]},'apiKey':{'type':Sequelize[_0xd469('0x3')]},'applicationId':{'type':Sequelize[_0xd469('0x3')]},'accountId':{'type':Sequelize[_0xd469('0x3')]},'senderString':{'type':Sequelize[_0xd469('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xd469('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd469('0xe');}},'notificationSound':{'type':Sequelize[_0xd469('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd469('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd469('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd469('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd469('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd469('0xf')],'defaultValue':![],'comment':_0xd469('0x11'),'set':function(_0x1db9bb){if(!_0x1db9bb)this[_0xd469('0x12')](_0xd469('0x13'),null);this[_0xd469('0x12')](_0xd469('0x14'),_0x1db9bb);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 30bf2ad..8d93518 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 _0x0d34=['defaults','redis','localhost','./smsAccount.socket','register','jayson/promise','client','http','request','then','SmsAccount,\x20%s,\x20%s','error','message','info','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','Pause','SmsAccount','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','type','merge','includeAll','include','findAll','rows','mandatoryDispositionPause','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','params','SmsAccountId','getDispositions','findOne','Disposition','rawAttributes','where','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','applications','orderBy','asc','account','Applications','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','messageId','skebby','sender','text','clicksend','plivo','From','results','originatingAddress','clickatell','replyMessageId','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','SmsApplication','priority','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','List','out','dataValues','Messages','debug','received\x20delivery\x20report\x20from','skebby_dispatch_id','connectel','statusInt','requestid','message_id','status_code','groupName','DELIVERED','bandwidth','redif','inspect','error_code','infobip','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','csc','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x16e05e,_0x3b8a16){var _0xdca308=function(_0x38fd73){while(--_0x38fd73){_0x16e05e['push'](_0x16e05e['shift']());}};_0xdca308(++_0x3b8a16);}(_0x0d34,0xcd));var _0x40d3=function(_0x9a225e,_0x2dde77){_0x9a225e=_0x9a225e-0x0;var _0x102e8a=_0x0d34[_0x9a225e];return _0x102e8a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x40d3('0x0'));var zipdir=require(_0x40d3('0x1'));var jsonpatch=require(_0x40d3('0x2'));var rp=require(_0x40d3('0x3'));var moment=require(_0x40d3('0x4'));var BPromise=require(_0x40d3('0x5'));var Mustache=require(_0x40d3('0x6'));var util=require(_0x40d3('0x7'));var path=require(_0x40d3('0x8'));var sox=require(_0x40d3('0x9'));var csv=require(_0x40d3('0xa'));var ejs=require(_0x40d3('0xb'));var fs=require('fs');var fs_extra=require(_0x40d3('0xc'));var _=require(_0x40d3('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x40d3('0xe'));var deskjs=require(_0x40d3('0xf'));var toCsv=require(_0x40d3('0xa'));var querystring=require(_0x40d3('0x10'));var Papa=require(_0x40d3('0x11'));var Redis=require(_0x40d3('0x12'));var authService=require(_0x40d3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x40d3('0x14'));var hardwareService=require(_0x40d3('0x15'));var logger=require(_0x40d3('0x16'))('api');var utils=require(_0x40d3('0x17'));var config=require(_0x40d3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x40d3('0x19'))['db'];config['redis']=_[_0x40d3('0x1a')](config[_0x40d3('0x1b')],{'host':_0x40d3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x40d3('0x1b')]));require(_0x40d3('0x1d'))[_0x40d3('0x1e')](socket);var jayson=require(_0x40d3('0x1f'));var client=jayson[_0x40d3('0x20')][_0x40d3('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x174782,_0x443c92,_0x520f87,_0x4a1e1c){return new BPromise(function(_0xd2c3c3,_0x291824){var _0x484a23=_0x4a1e1c||client;return _0x484a23[_0x40d3('0x22')](_0x174782,_0x520f87)[_0x40d3('0x23')](function(_0x4a6162){logger['info'](_0x40d3('0x24'),_0x443c92,'request\x20sent');logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x443c92,'request\x20sent',JSON['stringify'](_0x4a6162));if(_0x4a6162['error']){if(_0x4a6162[_0x40d3('0x25')]['code']===0x1f4){logger[_0x40d3('0x25')](_0x40d3('0x24'),_0x443c92,_0x4a6162[_0x40d3('0x25')][_0x40d3('0x26')]);return _0x291824(_0x4a6162[_0x40d3('0x25')]['message']);}logger[_0x40d3('0x25')](_0x40d3('0x24'),_0x443c92,_0x4a6162['error']['message']);return _0xd2c3c3(_0x4a6162[_0x40d3('0x25')]['message']);}else{logger[_0x40d3('0x27')](_0x40d3('0x24'),_0x443c92,_0x40d3('0x28'));_0xd2c3c3(_0x4a6162[_0x40d3('0x29')][_0x40d3('0x26')]);}})[_0x40d3('0x2a')](function(_0xf049f9){logger[_0x40d3('0x25')](_0x40d3('0x24'),_0x443c92,_0xf049f9);_0x291824(_0xf049f9);});});}function respondWithStatusCode(_0x1dfb30,_0x24bacd){_0x24bacd=_0x24bacd||0xcc;return function(_0x599e64){if(_0x599e64){return _0x1dfb30[_0x40d3('0x2b')](_0x24bacd);}return _0x1dfb30[_0x40d3('0x2c')](_0x24bacd)[_0x40d3('0x2d')]();};}function respondWithResult(_0x11a7cd,_0x5611ed){_0x5611ed=_0x5611ed||0xc8;return function(_0x2ffd88){if(_0x2ffd88){return _0x11a7cd['status'](_0x5611ed)[_0x40d3('0x2e')](_0x2ffd88);}};}function respondWithFilteredResult(_0x423e0c,_0x57cf60){return function(_0x3ebecf){if(_0x3ebecf){var _0x18a139=typeof _0x57cf60[_0x40d3('0x2f')]===_0x40d3('0x30')&&typeof _0x57cf60[_0x40d3('0x31')]===_0x40d3('0x30');var _0x76202a=_0x3ebecf[_0x40d3('0x32')];var _0x4a8fea=_0x18a139?0x0:_0x57cf60[_0x40d3('0x2f')];var _0x4ea7a3=_0x18a139?_0x3ebecf[_0x40d3('0x32')]:_0x57cf60['offset']+_0x57cf60[_0x40d3('0x31')];var _0x1f01f6;if(_0x4ea7a3>=_0x76202a){_0x4ea7a3=_0x76202a;_0x1f01f6=0xc8;}else{_0x1f01f6=0xce;}_0x423e0c[_0x40d3('0x2c')](_0x1f01f6);return _0x423e0c[_0x40d3('0x33')](_0x40d3('0x34'),_0x4a8fea+'-'+_0x4ea7a3+'/'+_0x76202a)[_0x40d3('0x2e')](_0x3ebecf);}return null;};}function patchUpdates(_0x40b983){return function(_0x4d353b){try{jsonpatch[_0x40d3('0x35')](_0x4d353b,_0x40b983,!![]);}catch(_0x34a515){return BPromise[_0x40d3('0x36')](_0x34a515);}return _0x4d353b[_0x40d3('0x37')]();};}function saveUpdates(_0x13099f,_0x55eaeb){return function(_0xd40b0f){if(_0xd40b0f){return _0xd40b0f[_0x40d3('0x38')](_0x13099f)[_0x40d3('0x23')](function(_0x5f86e4){return _0x5f86e4;});}return null;};}function removeEntity(_0x2a8116,_0x8e1666){return function(_0x25ac51){if(_0x25ac51){return _0x25ac51[_0x40d3('0x39')]()['then'](function(){var _0x688f2e=_0x25ac51[_0x40d3('0x3a')]({'plain':!![]});var _0x4ffc4c=_0x40d3('0x3b');return db[_0x40d3('0x3c')][_0x40d3('0x39')]({'where':{'type':_0x4ffc4c,'resourceId':_0x688f2e['id']}})['then'](function(){return _0x25ac51;});})[_0x40d3('0x23')](function(){_0x2a8116[_0x40d3('0x2c')](0xcc)[_0x40d3('0x2d')]();});}};}function handleEntityNotFound(_0x5e403b,_0x247327){return function(_0x2c1546){if(!_0x2c1546){_0x5e403b[_0x40d3('0x2b')](0x194);}return _0x2c1546;};}function handleError(_0xfa75bb,_0x7c3208){_0x7c3208=_0x7c3208||0x1f4;return function(_0x14b1ef){logger[_0x40d3('0x25')](_0x14b1ef[_0x40d3('0x3d')]);if(_0x14b1ef[_0x40d3('0x3e')]){delete _0x14b1ef[_0x40d3('0x3e')];}_0xfa75bb[_0x40d3('0x2c')](_0x7c3208)[_0x40d3('0x3f')](_0x14b1ef);};}exports['index']=function(_0x56427a,_0x2d3ea4){var _0x53e08f={'include':[{'model':db[_0x40d3('0x40')],'as':'mandatoryDispositionPause'}]},_0x1f9dab={},_0x7f302a={'count':0x0,'rows':[]};var _0x581df3=_['map'](db[_0x40d3('0x41')]['rawAttributes'],function(_0x12bfbe){return{'name':_0x12bfbe[_0x40d3('0x42')],'type':_0x12bfbe['type'][_0x40d3('0x43')]};});_0x1f9dab[_0x40d3('0x44')]=_[_0x40d3('0x45')](_0x581df3,_0x40d3('0x3e'));_0x1f9dab[_0x40d3('0x46')]=_[_0x40d3('0x47')](_0x56427a[_0x40d3('0x46')]);_0x1f9dab[_0x40d3('0x48')]=_[_0x40d3('0x49')](_0x1f9dab[_0x40d3('0x44')],_0x1f9dab[_0x40d3('0x46')]);_0x53e08f[_0x40d3('0x4a')]=_['intersection'](_0x1f9dab[_0x40d3('0x44')],qs[_0x40d3('0x4b')](_0x56427a['query'][_0x40d3('0x4b')]));_0x53e08f[_0x40d3('0x4a')]=_0x53e08f[_0x40d3('0x4a')][_0x40d3('0x4c')]?_0x53e08f[_0x40d3('0x4a')]:_0x1f9dab[_0x40d3('0x44')];if(!_0x56427a['query'][_0x40d3('0x4d')](_0x40d3('0x4e'))){_0x53e08f['limit']=qs[_0x40d3('0x31')](_0x56427a['query'][_0x40d3('0x31')]);_0x53e08f[_0x40d3('0x2f')]=qs[_0x40d3('0x2f')](_0x56427a[_0x40d3('0x46')][_0x40d3('0x2f')]);}_0x53e08f[_0x40d3('0x4f')]=qs[_0x40d3('0x50')](_0x56427a['query'][_0x40d3('0x50')]);_0x53e08f['where']=qs[_0x40d3('0x48')](_[_0x40d3('0x51')](_0x56427a[_0x40d3('0x46')],_0x1f9dab[_0x40d3('0x48')]),_0x581df3);if(_0x56427a[_0x40d3('0x46')][_0x40d3('0x52')]){_0x53e08f['where']=_['merge'](_0x53e08f['where'],{'$or':_['map'](_0x581df3,function(_0xd47054){if(_0xd47054[_0x40d3('0x53')]!=='VIRTUAL'){var _0x51c572={};_0x51c572[_0xd47054[_0x40d3('0x3e')]]={'$like':'%'+_0x56427a[_0x40d3('0x46')][_0x40d3('0x52')]+'%'};return _0x51c572;}})});}_0x53e08f=_[_0x40d3('0x54')]({},_0x53e08f,_0x56427a['options']);var _0x44f3b4={'where':_0x53e08f['where']};return db[_0x40d3('0x41')][_0x40d3('0x32')](_0x44f3b4)[_0x40d3('0x23')](function(_0xb5eb25){_0x7f302a[_0x40d3('0x32')]=_0xb5eb25;if(_0x56427a[_0x40d3('0x46')][_0x40d3('0x55')]){_0x53e08f[_0x40d3('0x56')]=[{'all':!![]}];}return db[_0x40d3('0x41')][_0x40d3('0x57')](_0x53e08f);})[_0x40d3('0x23')](function(_0x4d4718){_0x7f302a[_0x40d3('0x58')]=_0x4d4718;return _0x7f302a;})[_0x40d3('0x23')](respondWithFilteredResult(_0x2d3ea4,_0x53e08f))[_0x40d3('0x2a')](handleError(_0x2d3ea4,null));};exports['show']=function(_0x24490e,_0x1440ca){var _0x4baacf={'raw':![],'where':{'id':_0x24490e['params']['id']},'include':[{'model':db[_0x40d3('0x40')],'as':_0x40d3('0x59')}]},_0x33855a={};_0x33855a['model']=_[_0x40d3('0x47')](db[_0x40d3('0x41')]['rawAttributes']);_0x33855a['query']=_['keys'](_0x24490e['query']);_0x33855a[_0x40d3('0x48')]=_[_0x40d3('0x49')](_0x33855a[_0x40d3('0x44')],_0x33855a['query']);_0x4baacf[_0x40d3('0x4a')]=_[_0x40d3('0x49')](_0x33855a[_0x40d3('0x44')],qs['fields'](_0x24490e[_0x40d3('0x46')][_0x40d3('0x4b')]));_0x4baacf[_0x40d3('0x4a')]=_0x4baacf[_0x40d3('0x4a')][_0x40d3('0x4c')]?_0x4baacf[_0x40d3('0x4a')]:_0x33855a[_0x40d3('0x44')];if(_0x24490e[_0x40d3('0x46')][_0x40d3('0x55')]){_0x4baacf['include']=[{'all':!![]}];}_0x4baacf=_[_0x40d3('0x54')]({},_0x4baacf,_0x24490e[_0x40d3('0x5a')]);return db[_0x40d3('0x41')][_0x40d3('0x5b')](_0x4baacf)['then'](handleEntityNotFound(_0x1440ca,null))[_0x40d3('0x23')](respondWithResult(_0x1440ca,null))[_0x40d3('0x2a')](handleError(_0x1440ca,null));};exports['create']=function(_0x3e8148,_0x37a755){return db['SmsAccount']['create'](_0x3e8148[_0x40d3('0x5c')],{})['then'](function(_0x133cb8){var _0x2bcaaf=_0x3e8148[_0x40d3('0x5d')]['get']({'plain':!![]});if(!_0x2bcaaf)throw new Error(_0x40d3('0x5e'));if(_0x2bcaaf[_0x40d3('0x5f')]==='user'){var _0x5fd44a=_0x133cb8[_0x40d3('0x3a')]({'plain':!![]});var _0x17e73f='SmsAccounts';return db[_0x40d3('0x60')]['find']({'where':{'name':_0x17e73f,'userProfileId':_0x2bcaaf[_0x40d3('0x61')]},'raw':!![]})[_0x40d3('0x23')](function(_0x19ebd3){if(_0x19ebd3&&_0x19ebd3[_0x40d3('0x62')]===0x0){return db['UserProfileResource'][_0x40d3('0x63')]({'name':_0x5fd44a[_0x40d3('0x3e')],'resourceId':_0x5fd44a['id'],'type':_0x19ebd3['name'],'sectionId':_0x19ebd3['id']},{})[_0x40d3('0x23')](function(){return _0x133cb8;});}else{return _0x133cb8;}})['catch'](function(_0x5ee4c6){logger['error'](_0x40d3('0x64'),_0x5ee4c6);throw _0x5ee4c6;});}return _0x133cb8;})[_0x40d3('0x23')](respondWithResult(_0x37a755,0xc9))[_0x40d3('0x2a')](handleError(_0x37a755,null));};exports['update']=function(_0x40d5bd,_0x26c94d){if(_0x40d5bd[_0x40d3('0x5c')]['id']){delete _0x40d5bd['body']['id'];}return db[_0x40d3('0x41')]['find']({'where':{'id':_0x40d5bd['params']['id']},'include':[{'model':db['Pause'],'as':_0x40d3('0x59')}]})[_0x40d3('0x23')](handleEntityNotFound(_0x26c94d,null))[_0x40d3('0x23')](saveUpdates(_0x40d5bd[_0x40d3('0x5c')],null))[_0x40d3('0x23')](respondWithResult(_0x26c94d,null))[_0x40d3('0x2a')](handleError(_0x26c94d,null));};exports[_0x40d3('0x39')]=function(_0x3d1b86,_0x52a657){return db['SmsAccount'][_0x40d3('0x5b')]({'where':{'id':_0x3d1b86['params']['id']}})[_0x40d3('0x23')](handleEntityNotFound(_0x52a657,null))[_0x40d3('0x23')](removeEntity(_0x52a657,null))['catch'](handleError(_0x52a657,null));};exports[_0x40d3('0x65')]=function(_0x2fadf3,_0x30c6f7){return db[_0x40d3('0x41')][_0x40d3('0x65')]()['then'](respondWithResult(_0x30c6f7,null))[_0x40d3('0x2a')](handleError(_0x30c6f7,null));};exports[_0x40d3('0x66')]=function(_0x15eae5,_0x5d5ebe,_0x4ae97e){if(_0x15eae5[_0x40d3('0x5c')]['id']){delete _0x15eae5['body']['id'];}return db['SmsAccount'][_0x40d3('0x5b')]({'where':{'id':_0x15eae5[_0x40d3('0x67')]['id']}})[_0x40d3('0x23')](handleEntityNotFound(_0x5d5ebe,null))[_0x40d3('0x23')](function(_0x3eb081){if(_0x3eb081){_0x15eae5[_0x40d3('0x5c')][_0x40d3('0x68')]=_0x3eb081['id'];return db['Disposition'][_0x40d3('0x63')](_0x15eae5[_0x40d3('0x5c')]);}})[_0x40d3('0x23')](respondWithResult(_0x5d5ebe,null))[_0x40d3('0x2a')](handleError(_0x5d5ebe,null));};exports[_0x40d3('0x69')]=function(_0x34fca5,_0x4388c4,_0x93b066){var _0x41a675={'raw':![],'where':{}};var _0x299195={};var _0x97f302={'count':0x0,'rows':[]};return db['SmsAccount'][_0x40d3('0x6a')]({'where':{'id':_0x34fca5[_0x40d3('0x67')]['id']}})['then'](handleEntityNotFound(_0x4388c4,null))[_0x40d3('0x23')](function(_0x52d97a){if(_0x52d97a){_0x299195['model']=_[_0x40d3('0x47')](db[_0x40d3('0x6b')][_0x40d3('0x6c')]);_0x299195[_0x40d3('0x46')]=_[_0x40d3('0x47')](_0x34fca5[_0x40d3('0x46')]);_0x299195[_0x40d3('0x48')]=_[_0x40d3('0x49')](_0x299195[_0x40d3('0x44')],_0x299195[_0x40d3('0x46')]);_0x41a675[_0x40d3('0x4a')]=_[_0x40d3('0x49')](_0x299195[_0x40d3('0x44')],qs[_0x40d3('0x4b')](_0x34fca5[_0x40d3('0x46')][_0x40d3('0x4b')]));_0x41a675[_0x40d3('0x4a')]=_0x41a675[_0x40d3('0x4a')]['length']?_0x41a675['attributes']:_0x299195['model'];if(!_0x34fca5[_0x40d3('0x46')][_0x40d3('0x4d')](_0x40d3('0x4e'))){_0x41a675[_0x40d3('0x31')]=qs[_0x40d3('0x31')](_0x34fca5['query'][_0x40d3('0x31')]);_0x41a675[_0x40d3('0x2f')]=qs[_0x40d3('0x2f')](_0x34fca5['query'][_0x40d3('0x2f')]);}_0x41a675[_0x40d3('0x4f')]=qs[_0x40d3('0x50')](_0x34fca5['query'][_0x40d3('0x50')]);_0x41a675['where']=qs['filters'](_[_0x40d3('0x51')](_0x34fca5['query'],_0x299195['filters']));_0x41a675[_0x40d3('0x6d')]['SmsAccountId']=_0x52d97a['id'];if(_0x34fca5[_0x40d3('0x46')][_0x40d3('0x52')]){_0x41a675[_0x40d3('0x6d')]=_[_0x40d3('0x54')](_0x41a675[_0x40d3('0x6d')],{'$or':_['map'](_0x41a675[_0x40d3('0x4a')],function(_0x4960df){var _0x462238={};_0x462238[_0x4960df]={'$like':'%'+_0x34fca5['query'][_0x40d3('0x52')]+'%'};return _0x462238;})});}_0x41a675=_[_0x40d3('0x54')]({},_0x41a675,_0x34fca5[_0x40d3('0x5a')]);return db[_0x40d3('0x6b')]['count']({'where':_0x41a675[_0x40d3('0x6d')]})[_0x40d3('0x23')](function(_0xe1fdbf){_0x97f302[_0x40d3('0x32')]=_0xe1fdbf;if(_0x34fca5[_0x40d3('0x46')][_0x40d3('0x55')]){_0x41a675[_0x40d3('0x56')]=[{'all':!![]}];}return db['Disposition'][_0x40d3('0x57')](_0x41a675);})['then'](function(_0xd2dbf7){_0x97f302[_0x40d3('0x58')]=_0xd2dbf7;return _0x97f302;});}})[_0x40d3('0x23')](respondWithFilteredResult(_0x4388c4,_0x41a675))[_0x40d3('0x2a')](handleError(_0x4388c4,null));};exports['removeDispositions']=function(_0x5290ef,_0x1765e1,_0xc7ca36){return db[_0x40d3('0x41')][_0x40d3('0x5b')]({'where':{'id':_0x5290ef[_0x40d3('0x67')]['id']}})[_0x40d3('0x23')](handleEntityNotFound(_0x1765e1,null))['then'](function(_0x3f7f73){if(_0x3f7f73){return _0x3f7f73[_0x40d3('0x6e')](_0x5290ef[_0x40d3('0x46')][_0x40d3('0x6f')]);}})[_0x40d3('0x23')](respondWithStatusCode(_0x1765e1,null))[_0x40d3('0x2a')](handleError(_0x1765e1,null));};exports[_0x40d3('0x70')]=function(_0x4441ec,_0x152e99,_0x53e6d1){if(_0x4441ec['body']['id']){delete _0x4441ec[_0x40d3('0x5c')]['id'];}return db[_0x40d3('0x41')][_0x40d3('0x5b')]({'where':{'id':_0x4441ec[_0x40d3('0x67')]['id']}})['then'](handleEntityNotFound(_0x152e99,null))[_0x40d3('0x23')](function(_0x42cdc8){if(_0x42cdc8){_0x4441ec['body'][_0x40d3('0x68')]=_0x42cdc8['id'];return db[_0x40d3('0x71')][_0x40d3('0x63')](_0x4441ec['body']);}})[_0x40d3('0x23')](respondWithResult(_0x152e99,null))['catch'](handleError(_0x152e99,null));};exports[_0x40d3('0x72')]=function(_0x5ca15b,_0x13a704,_0x4747a7){var _0x49e16a={'raw':![],'where':{}};var _0x52593a={};var _0xa7ed3a={'count':0x0,'rows':[]};return db[_0x40d3('0x41')][_0x40d3('0x6a')]({'where':{'id':_0x5ca15b[_0x40d3('0x67')]['id']}})['then'](handleEntityNotFound(_0x13a704,null))[_0x40d3('0x23')](function(_0x56c1a2){if(_0x56c1a2){_0x52593a['model']=_['keys'](db[_0x40d3('0x71')][_0x40d3('0x6c')]);_0x52593a['query']=_[_0x40d3('0x47')](_0x5ca15b[_0x40d3('0x46')]);_0x52593a[_0x40d3('0x48')]=_[_0x40d3('0x49')](_0x52593a[_0x40d3('0x44')],_0x52593a['query']);_0x49e16a['attributes']=_[_0x40d3('0x49')](_0x52593a[_0x40d3('0x44')],qs[_0x40d3('0x4b')](_0x5ca15b[_0x40d3('0x46')]['fields']));_0x49e16a['attributes']=_0x49e16a['attributes'][_0x40d3('0x4c')]?_0x49e16a[_0x40d3('0x4a')]:_0x52593a[_0x40d3('0x44')];if(!_0x5ca15b[_0x40d3('0x46')][_0x40d3('0x4d')]('nolimit')){_0x49e16a[_0x40d3('0x31')]=qs[_0x40d3('0x31')](_0x5ca15b[_0x40d3('0x46')][_0x40d3('0x31')]);_0x49e16a[_0x40d3('0x2f')]=qs['offset'](_0x5ca15b[_0x40d3('0x46')][_0x40d3('0x2f')]);}_0x49e16a[_0x40d3('0x4f')]=qs[_0x40d3('0x50')](_0x5ca15b[_0x40d3('0x46')][_0x40d3('0x50')]);_0x49e16a['where']=qs[_0x40d3('0x48')](_[_0x40d3('0x51')](_0x5ca15b[_0x40d3('0x46')],_0x52593a[_0x40d3('0x48')]));_0x49e16a[_0x40d3('0x6d')][_0x40d3('0x68')]=_0x56c1a2['id'];if(_0x5ca15b['query'][_0x40d3('0x52')]){_0x49e16a['where']=_[_0x40d3('0x54')](_0x49e16a[_0x40d3('0x6d')],{'$or':_[_0x40d3('0x45')](_0x49e16a[_0x40d3('0x4a')],function(_0x53d9fd){var _0x245b49={};_0x245b49[_0x53d9fd]={'$like':'%'+_0x5ca15b[_0x40d3('0x46')][_0x40d3('0x52')]+'%'};return _0x245b49;})});}_0x49e16a=_[_0x40d3('0x54')]({},_0x49e16a,_0x5ca15b['options']);return db[_0x40d3('0x71')][_0x40d3('0x32')]({'where':_0x49e16a[_0x40d3('0x6d')]})['then'](function(_0x3de811){_0xa7ed3a[_0x40d3('0x32')]=_0x3de811;if(_0x5ca15b[_0x40d3('0x46')]['includeAll']){_0x49e16a['include']=[{'all':!![]}];}return db[_0x40d3('0x71')][_0x40d3('0x57')](_0x49e16a);})['then'](function(_0x191b74){_0xa7ed3a['rows']=_0x191b74;return _0xa7ed3a;});}})[_0x40d3('0x23')](respondWithFilteredResult(_0x13a704,_0x49e16a))['catch'](handleError(_0x13a704,null));};exports[_0x40d3('0x73')]=function(_0x20cf59,_0x25fc1c,_0x53eca5){return db['SmsAccount']['find']({'where':{'id':_0x20cf59[_0x40d3('0x67')]['id']}})[_0x40d3('0x23')](handleEntityNotFound(_0x25fc1c,null))[_0x40d3('0x23')](function(_0x1c2652){if(_0x1c2652){return _0x1c2652[_0x40d3('0x73')](_0x20cf59[_0x40d3('0x46')][_0x40d3('0x6f')]);}})[_0x40d3('0x23')](respondWithStatusCode(_0x25fc1c,null))[_0x40d3('0x2a')](handleError(_0x25fc1c,null));};exports[_0x40d3('0x74')]=function(_0x3cb7e7,_0x24d36c,_0xb67b22){var _0x1565d8={'channel':'sms'};var _0x4b412d=[];var _0x11955c=[];var _0x4cb8d5={};return db[_0x40d3('0x41')][_0x40d3('0x5b')]({'where':{'id':_0x3cb7e7[_0x40d3('0x67')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0x40d3('0x23')](handleEntityNotFound(_0x24d36c,null))[_0x40d3('0x23')](function(_0x455397){_0x1565d8['account']=_0x455397;_0x1565d8[_0x40d3('0x75')]=_[_0x40d3('0x76')](_0x455397['Applications'],['priority'],[_0x40d3('0x77')]);if(_0x1565d8[_0x40d3('0x78')]['Applications']){delete _0x1565d8[_0x40d3('0x78')][_0x40d3('0x79')];}return db[_0x40d3('0x7a')][_0x40d3('0x65')]();})[_0x40d3('0x23')](function(_0x1ab022){if(!_0x1ab022){throw new db[(_0x40d3('0x7b'))]['ValidationError']('no\x20available\x20attributes');}_0x4b412d=_[_0x40d3('0x7c')](_[_0x40d3('0x47')](_0x1ab022),[_0x40d3('0x7d'),_0x40d3('0x7e')]);_0x11955c=_['difference'](_['keys'](_0x1ab022),[_0x40d3('0x7d'),_0x40d3('0x7e'),_0x40d3('0x7f'),_0x40d3('0x80')]);_0x1565d8['body']={'mapKey':_0x40d3('0x81')};if(_0x1565d8[_0x40d3('0x78')]['type']){switch(_0x1565d8['account'][_0x40d3('0x53')]){case _0x40d3('0x82'):_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x83')]=_0x3cb7e7[_0x40d3('0x5c')]['From'];_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x5c')]=_0x3cb7e7[_0x40d3('0x5c')]['Body'];_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x84')]=_0x3cb7e7[_0x40d3('0x5c')]['MessageSid'];break;case _0x40d3('0x85'):_0x1565d8['body'][_0x40d3('0x83')]='+'+_0x3cb7e7['body'][_0x40d3('0x86')];_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x5c')]=_0x3cb7e7['body'][_0x40d3('0x87')];break;case'connectel':_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x83')]=_0x3cb7e7[_0x40d3('0x5c')]['from'];_0x1565d8['body'][_0x40d3('0x5c')]=_0x3cb7e7[_0x40d3('0x5c')][_0x40d3('0x26')];break;case _0x40d3('0x88'):_0x1565d8['body']['from']=_0x3cb7e7[_0x40d3('0x5c')][_0x40d3('0x83')];_0x1565d8[_0x40d3('0x5c')]['body']=_0x3cb7e7[_0x40d3('0x5c')][_0x40d3('0x5c')];_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x84')]=_0x3cb7e7[_0x40d3('0x5c')]['message_id'];break;case _0x40d3('0x89'):_0x1565d8['body'][_0x40d3('0x83')]=_0x3cb7e7[_0x40d3('0x5c')][_0x40d3('0x8a')];_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x5c')]=_0x3cb7e7[_0x40d3('0x5c')]['Text'];_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x84')]=_0x3cb7e7[_0x40d3('0x5c')]['MessageUUID'];break;case'infobip':_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x83')]='+'+_0x3cb7e7[_0x40d3('0x5c')][_0x40d3('0x8b')][0x0][_0x40d3('0x83')];_0x1565d8['body']['body']=_0x3cb7e7[_0x40d3('0x5c')][_0x40d3('0x8b')][0x0][_0x40d3('0x87')];_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x84')]=_0x3cb7e7['body'][_0x40d3('0x8b')][0x0][_0x40d3('0x84')];break;case'csc':_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x83')]=_0x3cb7e7[_0x40d3('0x5c')][_0x40d3('0x8c')];_0x1565d8['body']['body']=_0x3cb7e7[_0x40d3('0x5c')]['segmentedMessage'][_0x40d3('0x26')];break;case _0x40d3('0x8d'):_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x83')]=_0x3cb7e7[_0x40d3('0x5c')]['fromNumber'];_0x1565d8[_0x40d3('0x5c')]['body']=_0x3cb7e7[_0x40d3('0x5c')]['text'];_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x84')]=_0x3cb7e7['body'][_0x40d3('0x8e')];break;case'bandwidth':_0x1565d8['body'][_0x40d3('0x84')]=_0x3cb7e7[_0x40d3('0x5c')][0x0][_0x40d3('0x26')]['id'];_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x83')]=_0x3cb7e7[_0x40d3('0x5c')][0x0][_0x40d3('0x26')][_0x40d3('0x83')];_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x5c')]=_0x3cb7e7[_0x40d3('0x5c')][0x0][_0x40d3('0x26')][_0x40d3('0x87')];break;case _0x40d3('0x8f'):_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x83')]=_0x3cb7e7['body'][_0x40d3('0x83')];_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x5c')]=_0x3cb7e7['body']['message'];_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x84')]=_0x3cb7e7[_0x40d3('0x5c')][_0x40d3('0x90')];break;}}if(_0x1565d8['body']['id']){delete _0x1565d8[_0x40d3('0x5c')]['id'];}if(_[_0x40d3('0x91')](_0x1565d8['body'][_0x40d3('0x83')])){throw new db[(_0x40d3('0x7b'))][(_0x40d3('0x92'))](_0x40d3('0x93'));}if(_['isNil'](_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x5c')])||_0x1565d8['body'][_0x40d3('0x5c')]===''){throw new db['Sequelize'][(_0x40d3('0x92'))](_0x40d3('0x94'));}if(_[_0x40d3('0x91')](_0x1565d8['body'][_0x40d3('0x95')])){throw new db[(_0x40d3('0x7b'))][(_0x40d3('0x92'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x11955c);}if(!_['includes'](_0x11955c,_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x95')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x11955c);}_0x4cb8d5[_0x1565d8['body'][_0x40d3('0x95')]]=_0x1565d8['body'][_0x40d3('0x83')];return db['CmList']['find']({'where':{'id':_0x1565d8['account']['ListId']},'include':[{'model':db[_0x40d3('0x7a')],'as':_0x40d3('0x96'),'where':_0x4cb8d5,'limit':0x1,'order':[[_0x40d3('0x7e'),_0x40d3('0x97')]]}]});})[_0x40d3('0x23')](handleEntityNotFound(_0x24d36c,null))[_0x40d3('0x23')](function(_0x56121e){if(_0x56121e){_0x1565d8[_0x40d3('0x98')]=_[_0x40d3('0x99')](_0x56121e,['Contacts']);if(_0x56121e['Contacts'][_0x40d3('0x4c')]){return _0x56121e[_0x40d3('0x96')][0x0];}var _0x33f0cc=_[_0x40d3('0x1a')](_0x1565d8['body'],{'firstName':_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x83')],'ListId':_0x56121e['id']});_0x33f0cc[_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x95')]]=_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x83')];return db[_0x40d3('0x7a')][_0x40d3('0x63')](_0x33f0cc,{'fields':_0x4b412d,'raw':!![]});}})[_0x40d3('0x23')](handleEntityNotFound(_0x24d36c,null))[_0x40d3('0x23')](function(_0x556746){if(_0x556746){_0x1565d8[_0x40d3('0x9a')]=_0x556746;var _0x49ae88={'ContactId':_0x556746['id'],'phone':_0x1565d8[_0x40d3('0x5c')][_0x40d3('0x83')],'SmsAccountId':_0x3cb7e7[_0x40d3('0x67')]['id']};var _0x48c04a={'ContactId':_0x556746['id'],'SmsAccountId':_0x3cb7e7[_0x40d3('0x67')]['id'],'closed':![]};return db[_0x40d3('0x9b')]['find']({'where':_0x48c04a})[_0x40d3('0x23')](function(_0x130245){if(_0x130245){return[_0x130245,![]];}return db[_0x40d3('0x9b')][_0x40d3('0x63')](_0x49ae88)[_0x40d3('0x23')](function(_0x5eb4a0){return[_0x5eb4a0,!![]];});});}})[_0x40d3('0x9c')](function(_0xcb0cae,_0x2d8874){_0x1565d8[_0x40d3('0x9d')]=_0xcb0cae['get']({'plain':!![]});_0x1565d8[_0x40d3('0x9d')][_0x40d3('0x9e')]=![];if(_0x2d8874){if(_0x1565d8[_0x40d3('0x78')][_0x40d3('0x9f')]){_0x1565d8['applications'][_0x40d3('0xa0')]({'id':0x0,'priority':_0x1565d8[_0x40d3('0x75')]['length']+0x1,'app':_0x40d3('0xa1'),'appdata':_0x40d3('0xa2'),'interval':_0x40d3('0xa3')});}_0x1565d8['interaction']['created']=!![];}return db[_0x40d3('0xa4')][_0x40d3('0x63')]({'phone':_0x1565d8[_0x40d3('0x5c')]['from'],'messageId':_0x1565d8['body']['messageId'],'body':_0x1565d8[_0x40d3('0x5c')]['body'],'SmsAccountId':_0x3cb7e7['params']['id'],'SmsInteractionId':_0xcb0cae['id'],'direction':'in','ContactId':_0xcb0cae[_0x40d3('0xa5')],'AttachmentId':_0x1565d8['body']['AttachmentId']});})[_0x40d3('0x23')](function(_0x28e6c7){_0x1565d8['message']=_0x28e6c7;if(_0x1565d8[_0x40d3('0x9d')][_0x40d3('0xa6')]){return db[_0x40d3('0xa7')][_0x40d3('0x5b')]({'attributes':['id','name'],'where':{'id':_0x1565d8[_0x40d3('0x9d')][_0x40d3('0xa6')]}})[_0x40d3('0x23')](function(_0x1963fd){if(_0x1963fd){_0x1565d8[_0x40d3('0x75')][_0x40d3('0xa8')]({'id':0x0,'priority':0x0,'app':_0x40d3('0xa9'),'appdata':_0x1963fd[_0x40d3('0x3e')]+','+(_0x1565d8[_0x40d3('0x78')][_0x40d3('0xaa')]||0xa),'interval':_0x40d3('0xa3')});}return respondWithRpcPromise(_0x40d3('0xab'),_0x40d3('0xac'),_0x1565d8);});}return respondWithRpcPromise(_0x40d3('0xab'),_0x40d3('0xac'),_0x1565d8);})[_0x40d3('0x23')](function(_0x42d4e7){if(_0x42d4e7){var _0x3938dd=0xc8;var _0x5e1583=_0x40d3('0xad');logger[_0x40d3('0x27')](_0x40d3('0xae'),_0x5e1583,_0x3938dd,_0x40d3('0xaf'));logger['debug'](_0x40d3('0xb0'),_0x5e1583,_0x3938dd,'entity\x20found',JSON[_0x40d3('0xb1')](_0x42d4e7));if(_0x1565d8['account']['type']===_0x40d3('0x82')){return _0x24d36c['status'](_0x3938dd)[_0x40d3('0x33')]('Content-Type',_0x40d3('0xb2'))[_0x40d3('0x3f')](_0x40d3('0xb3'));}else{return _0x24d36c[_0x40d3('0x2c')](_0x3938dd)[_0x40d3('0x2e')](_0x42d4e7);}}})[_0x40d3('0x2a')](handleError(_0x24d36c,null));};exports[_0x40d3('0xb4')]=function(_0x5a2060,_0x5e1b64){var _0x3b7dd2=_0x5a2060[_0x40d3('0x67')]['id'];var _0x38c1f5=_0x5a2060['body'];var _0x1d2bae=0xc8;var _0x1b7575=null;return db[_0x40d3('0xb5')][_0x40d3('0xb6')]({'isolationLevel':db[_0x40d3('0xb5')][_0x40d3('0xb7')]['ISOLATION_LEVELS'][_0x40d3('0xb8')]},function(_0x5bd1d4){return db[_0x40d3('0x41')][_0x40d3('0x6a')]({'where':{'id':_0x3b7dd2},'transaction':_0x5bd1d4})[_0x40d3('0x23')](function(_0x2e635d){if(_0x2e635d){return db['SmsApplication'][_0x40d3('0x39')]({'where':{'SmsAccountId':_0x3b7dd2},'transaction':_0x5bd1d4})['then'](function(){var _0x8fb24f=_[_0x40d3('0x45')](_0x38c1f5,function(_0x417096){_0x417096[_0x40d3('0x68')]=_0x3b7dd2;return _0x417096;});return db['SmsApplication'][_0x40d3('0xb9')](_0x8fb24f,{'transaction':_0x5bd1d4});});}else{_0x1d2bae=0x194;_0x1b7575=[];}});})[_0x40d3('0x23')](function(){if(_0x1d2bae!==0x194){return db[_0x40d3('0xba')]['findAndCountAll']({'where':{'SmsAccountId':_0x3b7dd2},'order':_0x40d3('0xbb')})[_0x40d3('0x23')](function(_0x533547){_0x1b7575=_0x533547;});}})[_0x40d3('0x2a')](function(_0x558d17){_0x1d2bae=0x1f4;logger[_0x40d3('0x25')](_0x558d17[_0x40d3('0x3d')]);if(_0x558d17[_0x40d3('0x3e')]){delete _0x558d17[_0x40d3('0x3e')];}_0x1b7575=_0x558d17;})[_0x40d3('0xbc')](function(){if(_0x1b7575===null){_0x5e1b64[_0x40d3('0x2b')](_0x1d2bae);}else{if(_0x1d2bae===0x1f4){_0x5e1b64[_0x40d3('0x2c')](_0x1d2bae)[_0x40d3('0x3f')](_0x1b7575);}else{_0x5e1b64[_0x40d3('0x2c')](_0x1d2bae)['json'](_0x1b7575);}}});};exports[_0x40d3('0xbd')]=function(_0x495481,_0x3c3478,_0x5ad668){var _0x3a509c={};var _0x892a59={};var _0x9b22a3;var _0x3a7d12;return db[_0x40d3('0x41')][_0x40d3('0x6a')]({'where':{'id':_0x495481[_0x40d3('0x67')]['id']}})[_0x40d3('0x23')](handleEntityNotFound(_0x3c3478,null))['then'](function(_0x1e83ae){if(_0x1e83ae){_0x9b22a3=_0x1e83ae;_0x892a59['model']=_[_0x40d3('0x47')](db[_0x40d3('0xba')][_0x40d3('0x6c')]);_0x892a59[_0x40d3('0x46')]=_['keys'](_0x495481[_0x40d3('0x46')]);_0x892a59[_0x40d3('0x48')]=_[_0x40d3('0x49')](_0x892a59['model'],_0x892a59[_0x40d3('0x46')]);_0x3a509c['attributes']=_[_0x40d3('0x49')](_0x892a59[_0x40d3('0x44')],qs[_0x40d3('0x4b')](_0x495481[_0x40d3('0x46')][_0x40d3('0x4b')]));_0x3a509c[_0x40d3('0x4a')]=_0x3a509c['attributes'][_0x40d3('0x4c')]?_0x3a509c[_0x40d3('0x4a')]:_0x892a59[_0x40d3('0x44')];_0x3a509c[_0x40d3('0x4f')]=qs[_0x40d3('0x50')](_0x495481[_0x40d3('0x46')][_0x40d3('0x50')]);_0x3a509c[_0x40d3('0x6d')]=qs['filters'](_[_0x40d3('0x51')](_0x495481[_0x40d3('0x46')],_0x892a59['filters']));if(_0x495481['query']['filter']){_0x3a509c[_0x40d3('0x6d')]=_[_0x40d3('0x54')](_0x3a509c[_0x40d3('0x6d')],{'$or':_[_0x40d3('0x45')](_0x3a509c['attributes'],function(_0x45ead2){var _0x5259fc={};_0x5259fc[_0x45ead2]={'$like':'%'+_0x495481[_0x40d3('0x46')][_0x40d3('0x52')]+'%'};return _0x5259fc;})});}_0x3a509c=_['merge']({},_0x3a509c,_0x495481[_0x40d3('0x5a')]);return _0x9b22a3[_0x40d3('0xbd')](_0x3a509c);}})[_0x40d3('0x23')](function(_0x41fd43){if(_0x41fd43){_0x3a7d12=_0x41fd43[_0x40d3('0x4c')];if(!_0x495481[_0x40d3('0x46')][_0x40d3('0x4d')](_0x40d3('0x4e'))){_0x3a509c[_0x40d3('0x31')]=qs['limit'](_0x495481[_0x40d3('0x46')][_0x40d3('0x31')]);_0x3a509c[_0x40d3('0x2f')]=qs[_0x40d3('0x2f')](_0x495481['query'][_0x40d3('0x2f')]);}return _0x9b22a3[_0x40d3('0xbd')](_0x3a509c);}})[_0x40d3('0x23')](function(_0x5d29f3){if(_0x5d29f3){return _0x5d29f3?{'count':_0x3a7d12,'rows':_0x5d29f3}:null;}})[_0x40d3('0x23')](respondWithResult(_0x3c3478,null))[_0x40d3('0x2a')](handleError(_0x3c3478,null));};exports[_0x40d3('0xbe')]=function(_0x1bec9d,_0x39976a,_0x3e5985){var _0x2b1449={'raw':![],'where':{}};var _0x3b6983={};var _0x201bc5={'count':0x0,'rows':[]};return db[_0x40d3('0x41')][_0x40d3('0x6a')]({'where':{'id':_0x1bec9d['params']['id']}})[_0x40d3('0x23')](handleEntityNotFound(_0x39976a,null))[_0x40d3('0x23')](function(_0x475d1b){if(_0x475d1b){_0x3b6983['model']=_['keys'](db[_0x40d3('0x9b')][_0x40d3('0x6c')]);_0x3b6983['query']=_['keys'](_0x1bec9d[_0x40d3('0x46')]);_0x3b6983[_0x40d3('0x48')]=_[_0x40d3('0x49')](_0x3b6983['model'],_0x3b6983[_0x40d3('0x46')]);_0x2b1449[_0x40d3('0x4a')]=_[_0x40d3('0x49')](_0x3b6983[_0x40d3('0x44')],qs['fields'](_0x1bec9d[_0x40d3('0x46')][_0x40d3('0x4b')]));_0x2b1449[_0x40d3('0x4a')]=_0x2b1449['attributes'][_0x40d3('0x4c')]?_0x2b1449[_0x40d3('0x4a')]:_0x3b6983[_0x40d3('0x44')];if(!_0x1bec9d[_0x40d3('0x46')][_0x40d3('0x4d')](_0x40d3('0x4e'))){_0x2b1449[_0x40d3('0x31')]=qs['limit'](_0x1bec9d[_0x40d3('0x46')][_0x40d3('0x31')]);_0x2b1449['offset']=qs[_0x40d3('0x2f')](_0x1bec9d['query'][_0x40d3('0x2f')]);}_0x2b1449[_0x40d3('0x4f')]=qs[_0x40d3('0x50')](_0x1bec9d[_0x40d3('0x46')][_0x40d3('0x50')]);_0x2b1449['where']=qs['filters'](_[_0x40d3('0x51')](_0x1bec9d[_0x40d3('0x46')],_0x3b6983[_0x40d3('0x48')]));_0x2b1449['where'][_0x40d3('0x68')]=_0x475d1b['id'];if(_0x1bec9d[_0x40d3('0x46')]['filter']){_0x2b1449[_0x40d3('0x6d')]=_[_0x40d3('0x54')](_0x2b1449[_0x40d3('0x6d')],{'$or':_[_0x40d3('0x45')](_0x2b1449[_0x40d3('0x4a')],function(_0x41c1e6){var _0x469b00={};_0x469b00[_0x41c1e6]={'$like':'%'+_0x1bec9d[_0x40d3('0x46')]['filter']+'%'};return _0x469b00;})});}_0x2b1449=_[_0x40d3('0x54')]({},_0x2b1449,_0x1bec9d['options']);return db[_0x40d3('0x9b')]['count']({'where':_0x2b1449[_0x40d3('0x6d')]})['then'](function(_0x22f592){_0x201bc5[_0x40d3('0x32')]=_0x22f592;if(_0x1bec9d[_0x40d3('0x46')][_0x40d3('0x55')]){_0x2b1449['include']=[{'model':db[_0x40d3('0x7a')],'as':_0x40d3('0xbf'),'required':![]},{'model':db['User'],'as':_0x40d3('0xc0'),'attributes':[_0x40d3('0x3e'),_0x40d3('0xc1'),_0x40d3('0xc2')],'required':![]},{'model':db[_0x40d3('0xc3')],'as':'Tags','attributes':['id','name',_0x40d3('0xc4')],'where':_0x1bec9d[_0x40d3('0x46')][_0x40d3('0xc5')]?{'id':_0x1bec9d[_0x40d3('0x46')][_0x40d3('0xc5')]}:undefined,'required':_0x1bec9d[_0x40d3('0x46')][_0x40d3('0xc5')]?!![]:![]}];}return db[_0x40d3('0x9b')]['findAll'](_0x2b1449);})[_0x40d3('0x23')](function(_0x484144){_0x201bc5[_0x40d3('0x58')]=_0x484144;return _0x201bc5;});}})[_0x40d3('0x23')](respondWithFilteredResult(_0x39976a,_0x2b1449))[_0x40d3('0x2a')](handleError(_0x39976a,null));};exports[_0x40d3('0x3f')]=function(_0xdce49c,_0x3e0563,_0x172bf5){var _0x12850f,_0x3fbe9f,_0x45038c;if(_[_0x40d3('0x91')](_0xdce49c[_0x40d3('0x5c')][_0x40d3('0x5c')])||_0xdce49c[_0x40d3('0x5c')][_0x40d3('0x5c')]===''){throw new db[(_0x40d3('0x7b'))][(_0x40d3('0x92'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x40d3('0x91')](_0xdce49c[_0x40d3('0x5c')]['to'])){throw new db[(_0x40d3('0x7b'))][(_0x40d3('0x92'))](_0x40d3('0xc6'));}_0x12850f=_0xdce49c['body']['to'];return db[_0x40d3('0x41')]['find']({'where':{'id':_0xdce49c[_0x40d3('0x67')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x40d3('0x7a')],'as':'Contacts','where':{'mobile':_0x12850f},'limit':0x1,'order':[[_0x40d3('0x7e'),_0x40d3('0x97')]]}]}]})[_0x40d3('0x23')](handleEntityNotFound(_0x3e0563,null))[_0x40d3('0x23')](function(_0x5477bb){if(_0x5477bb&&_0x5477bb[_0x40d3('0xc7')]){_0x3fbe9f=_0x5477bb[_0x40d3('0x3a')]({'plain':!![]});if(_0x3fbe9f[_0x40d3('0xc7')]&&_0x3fbe9f[_0x40d3('0xc7')][_0x40d3('0x96')]['length']){return _0x3fbe9f['List'][_0x40d3('0x96')][0x0];}return db[_0x40d3('0x7a')][_0x40d3('0x63')](_[_0x40d3('0x1a')](_0xdce49c[_0x40d3('0x5c')],{'firstName':_0x12850f,'mobile':_0x12850f,'phone':_0x12850f,'ListId':_0x3fbe9f[_0x40d3('0x80')]}));}})['then'](handleEntityNotFound(_0x3e0563,null))[_0x40d3('0x23')](function(_0x1561f9){if(_0x1561f9){_0x45038c=_0x1561f9;return db[_0x40d3('0x9b')]['find']({'where':{'ContactId':_0x45038c['id'],'closed':![],'SmsAccountId':_0x3fbe9f['id']}})[_0x40d3('0x23')](function(_0xb3616a){if(_0xb3616a){return[_0xb3616a,![]];}return db[_0x40d3('0x9b')]['create']({'UserId':_0xdce49c[_0x40d3('0x5d')]['id'],'ContactId':_0x45038c['id'],'SmsAccountId':_0x3fbe9f['id'],'phone':_0x12850f,'firstMsgDirection':_0x40d3('0xc8'),'Messages':[_[_0x40d3('0x54')](_0xdce49c[_0x40d3('0x5c')],{'read':![],'body':_0xdce49c[_0x40d3('0x5c')]['body'],'phone':_0x12850f,'SmsAccountId':_0x3fbe9f['id'],'UserId':_0xdce49c[_0x40d3('0x5d')]['id'],'ContactId':_0x45038c['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x40d3('0x23')](function(_0x4f3b7f){return[_0x4f3b7f,!![]];});});}})[_0x40d3('0x9c')](function(_0x43f6eb,_0x2e0938){if(_0x2e0938){return _0x43f6eb;}return db[_0x40d3('0xa4')][_0x40d3('0x63')](_[_0x40d3('0x54')](_0xdce49c[_0x40d3('0x5c')],{'read':![],'body':_0xdce49c[_0x40d3('0x5c')]['body'],'phone':_0x12850f,'SmsAccountId':_0x3fbe9f['id'],'SmsInteractionId':_0x43f6eb['id'],'UserId':_0xdce49c[_0x40d3('0x5d')]['id'],'ContactId':_0x45038c['id']}))[_0x40d3('0x23')](function(_0x880852){_0x43f6eb[_0x40d3('0xc9')][_0x40d3('0xca')]=[];_0x43f6eb[_0x40d3('0xc9')][_0x40d3('0xca')][_0x40d3('0xa0')](_0x880852[_0x40d3('0xc9')]);return _0x43f6eb;});})['then'](respondWithResult(_0x3e0563,null))[_0x40d3('0x2a')](handleError(_0x3e0563,null));};exports[_0x40d3('0x2c')]=function(_0x52467a,_0x28e8b1,_0x2da080){if(_0x52467a[_0x40d3('0x5c')]['id']){delete _0x52467a[_0x40d3('0x5c')]['id'];}var _0x55ce47,_0x1d70fe,_0x2107bf;return db[_0x40d3('0x41')][_0x40d3('0x5b')]({'where':{'id':_0x52467a[_0x40d3('0x67')]['id']}})[_0x40d3('0x23')](handleEntityNotFound(_0x28e8b1,null))[_0x40d3('0x23')](function(_0x64902c){if(_0x64902c){_0x2107bf=_0x64902c;logger[_0x40d3('0xcb')](_0x40d3('0xae'),_0x40d3('0x2c'),_0x40d3('0xcc'),_0x64902c['type'],util['inspect'](_0x52467a[_0x40d3('0x5c')],{'showHidden':![],'depth':null}));switch(_0x64902c[_0x40d3('0x53')]){case _0x40d3('0x85'):if(_0x52467a[_0x40d3('0x5c')]['skebby_dispatch_id']&&_0x52467a[_0x40d3('0x5c')][_0x40d3('0x2c')]){_0x1d70fe=_0x52467a[_0x40d3('0x5c')]['status'];return db[_0x40d3('0xa4')][_0x40d3('0x5b')]({'where':{'messageId':_0x52467a[_0x40d3('0x5c')][_0x40d3('0xcd')]}});}break;case _0x40d3('0xce'):if(_0x52467a['body']['requestid']&&_0x52467a[_0x40d3('0x5c')][_0x40d3('0xcf')]){_0x1d70fe=_0x52467a[_0x40d3('0x5c')][_0x40d3('0xcf')];return db[_0x40d3('0xa4')][_0x40d3('0x5b')]({'where':{'messageId':_0x52467a[_0x40d3('0x5c')][_0x40d3('0xd0')]}});}break;case _0x40d3('0x88'):if(_0x52467a[_0x40d3('0x5c')][_0x40d3('0xd1')]&&_0x52467a[_0x40d3('0x5c')][_0x40d3('0xd2')]){_0x1d70fe=_0x52467a['body'][_0x40d3('0xd2')];return db['SmsMessage'][_0x40d3('0x5b')]({'where':{'messageId':_0x52467a[_0x40d3('0x5c')][_0x40d3('0xd1')]}});}break;case'infobip':var _0x467700=_0x52467a[_0x40d3('0x5c')]['results'][0x0];if(_0x467700[_0x40d3('0x84')]&&_0x467700[_0x40d3('0x2c')][_0x40d3('0xd3')]===_0x40d3('0xd4')){_0x1d70fe=_0x467700[_0x40d3('0x2c')][_0x40d3('0xd3')];return db[_0x40d3('0xa4')]['find']({'where':{'messageId':_0x467700[_0x40d3('0x84')]}});}break;case _0x40d3('0x8d'):if(_0x52467a[_0x40d3('0x5c')][_0x40d3('0x84')]&&_0x52467a['body']['status']){_0x1d70fe=_0x52467a[_0x40d3('0x5c')][_0x40d3('0x2c')];return db['SmsMessage'][_0x40d3('0x5b')]({'where':{'messageId':_0x52467a['body'][_0x40d3('0x84')]}});}break;case _0x40d3('0xd5'):if(_0x52467a['body'][0x0][_0x40d3('0x26')]['id']){_0x1d70fe=_0x52467a[_0x40d3('0x5c')][0x0][_0x40d3('0x53')];return db[_0x40d3('0xa4')][_0x40d3('0x5b')]({'where':{'messageId':_0x52467a['body'][0x0][_0x40d3('0x26')]['id']}});}break;case _0x40d3('0x8f'):if(_0x52467a[_0x40d3('0x5c')][_0x40d3('0xd6')]&&_0x52467a['body'][_0x40d3('0x2c')]){_0x1d70fe=_0x52467a[_0x40d3('0x5c')][_0x40d3('0x2c')];return db[_0x40d3('0xa4')][_0x40d3('0x5b')]({'where':{'messageId':_0x52467a['body'][_0x40d3('0xd6')]}});}break;}}})['then'](handleEntityNotFound(_0x28e8b1,null))[_0x40d3('0x23')](function(_0x4f514f){if(_0x4f514f){_0x55ce47=_0x4f514f;switch(_0x2107bf[_0x40d3('0x53')]){case'skebby':if(_0x1d70fe===_0x40d3('0xd4')){return _0x55ce47['update']({'read':!![]});}else{logger[_0x40d3('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x40d3('0x2c'),_0x40d3('0x85'),util[_0x40d3('0xd7')](_0x52467a[_0x40d3('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x40d3('0xce'):if(_0x1d70fe==='1'){return _0x55ce47[_0x40d3('0x38')]({'read':!![]});}else{logger[_0x40d3('0x25')](_0x40d3('0xae'),_0x40d3('0x2c'),'skebby',util[_0x40d3('0xd7')](_0x52467a[_0x40d3('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x40d3('0x88'):if(!_0x52467a['body'][_0x40d3('0xd8')]&&_0x1d70fe>=0xc8&&_0x1d70fe<=0xce){return _0x55ce47['update']({'read':!![]});}else{logger[_0x40d3('0x25')](_0x40d3('0xae'),_0x40d3('0x2c'),'clicksend',util['inspect'](_0x52467a[_0x40d3('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x40d3('0xd9'):var _0x81bcec=_0x52467a[_0x40d3('0x5c')][_0x40d3('0x8b')][0x0];if(_0x81bcec['status'][_0x40d3('0xd3')]==='DELIVERED'){return _0x55ce47['update']({'read':!![]});}else{logger[_0x40d3('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0x40d3('0xd7')](_0x52467a[_0x40d3('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x40d3('0x8d'):if(_0x1d70fe==_0x40d3('0xda')||_0x1d70fe==_0x40d3('0xdb')){return _0x55ce47[_0x40d3('0x38')]({'read':!![]});}else{logger[_0x40d3('0x25')](_0x40d3('0xae'),_0x40d3('0x2c'),'clickatell',util[_0x40d3('0xd7')](_0x52467a['body'],{'showHidden':![],'depth':null}));}break;case _0x40d3('0xd5'):if(_0x1d70fe==_0x40d3('0xdc')){return _0x55ce47[_0x40d3('0x38')]({'read':!![]});}else{logger[_0x40d3('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x40d3('0x2c'),_0x40d3('0xd5'),util[_0x40d3('0xd7')](_0x52467a[_0x40d3('0x5c')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x1d70fe==='DELIVRD'||_0x1d70fe===_0x40d3('0xdd')){return _0x55ce47[_0x40d3('0x38')]({'read':!![]});}else{logger[_0x40d3('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x40d3('0x2c'),_0x40d3('0x8f'),util[_0x40d3('0xd7')](_0x52467a['body'],{'showHidden':![],'depth':null}));}break;}return _0x55ce47;}})['then'](respondWithResult(_0x28e8b1,null))[_0x40d3('0x2a')](handleError(_0x28e8b1,null));};exports[_0x40d3('0xde')]=function(_0x342f97,_0x3302d1,_0x49cc1d){var _0x4e9826,_0x340725,_0x201637;return db['SmsAccount'][_0x40d3('0x5b')]({'where':{'id':_0x342f97[_0x40d3('0x67')]['id']}})[_0x40d3('0x23')](handleEntityNotFound(_0x3302d1,null))[_0x40d3('0x23')](function(_0x7f6b87){if(_0x7f6b87){_0x201637=_0x7f6b87;logger[_0x40d3('0xcb')](_0x40d3('0xae'),'status',_0x40d3('0xcc'),_0x7f6b87['type'],util['inspect'](_0x342f97[_0x40d3('0x46')],{'showHidden':![],'depth':null}));switch(_0x7f6b87[_0x40d3('0x53')]){case _0x40d3('0xdf'):if(_0x342f97[_0x40d3('0x46')][_0x40d3('0xe0')]&&_0x342f97['query']['state']){_0x340725=_0x342f97[_0x40d3('0x46')][_0x40d3('0xe1')];return db[_0x40d3('0xa4')][_0x40d3('0x5b')]({'where':{'messageId':_0x342f97[_0x40d3('0x46')][_0x40d3('0xe0')]}});}break;}}})[_0x40d3('0x23')](handleEntityNotFound(_0x3302d1,null))['then'](function(_0x3069b6){if(_0x3069b6){_0x4e9826=_0x3069b6;switch(_0x201637['type']){case _0x40d3('0xdf'):if(_0x340725==='2'||_0x340725==='6'){return _0x4e9826[_0x40d3('0x38')]({'read':!![]});}else{logger[_0x40d3('0x25')](_0x40d3('0xae'),'status','csc',util[_0x40d3('0xd7')](_0x342f97['query'],{'showHidden':![],'depth':null}));};break;}return _0x4e9826;}})[_0x40d3('0x23')](respondWithResult(_0x3302d1,null))[_0x40d3('0x2a')](handleError(_0x3302d1,null));};exports[_0x40d3('0xe2')]=function(_0x260aed,_0x44c1df,_0xaa6b6){return db['SmsAccount'][_0x40d3('0x5b')]({'where':{'id':_0x260aed[_0x40d3('0x67')]['id']}})[_0x40d3('0x23')](handleEntityNotFound(_0x44c1df,null))[_0x40d3('0x23')](function(_0x35bd44){if(_0x35bd44){return _0x35bd44[_0x40d3('0xe2')](_0x260aed[_0x40d3('0x5c')][_0x40d3('0x6f')],_[_0x40d3('0x99')](_0x260aed['body'],['ids','id'])||{})['spread'](function(_0x4d0a4f){for(var _0x21c2fe=0x0;_0x21c2fe<_0x260aed['body'][_0x40d3('0x6f')][_0x40d3('0x4c')];_0x21c2fe+=0x1){socket[_0x40d3('0xe3')]('userSmsAccount:save',{'UserId':Number(_0x260aed['body'][_0x40d3('0x6f')][_0x21c2fe]),'SmsAccountId':Number(_0x260aed[_0x40d3('0x67')]['id'])});}return _0x4d0a4f;});}})[_0x40d3('0x23')](respondWithResult(_0x44c1df,null))[_0x40d3('0x2a')](handleError(_0x44c1df,null));};exports['removeAgents']=function(_0x2d9b8b,_0x1a32bd,_0x510cde){return db[_0x40d3('0x41')][_0x40d3('0x5b')]({'where':{'id':_0x2d9b8b['params']['id']}})['then'](handleEntityNotFound(_0x1a32bd,null))[_0x40d3('0x23')](function(_0x43116e){if(_0x43116e){return _0x43116e[_0x40d3('0xe4')](_0x2d9b8b[_0x40d3('0x46')]['ids'])[_0x40d3('0x23')](function(){if(_['isArray'](_0x2d9b8b[_0x40d3('0x46')][_0x40d3('0x6f')])){for(var _0x2f0d6=0x0;_0x2f0d6<_0x2d9b8b[_0x40d3('0x46')][_0x40d3('0x6f')]['length'];_0x2f0d6+=0x1){socket[_0x40d3('0xe3')](_0x40d3('0xe5'),{'UserId':Number(_0x2d9b8b[_0x40d3('0x46')]['ids'][_0x2f0d6]),'SmsAccountId':Number(_0x2d9b8b['params']['id'])});}}else{socket[_0x40d3('0xe3')](_0x40d3('0xe5'),{'UserId':Number(_0x2d9b8b[_0x40d3('0x46')][_0x40d3('0x6f')]),'SmsAccountId':Number(_0x2d9b8b[_0x40d3('0x67')]['id'])});}});}})[_0x40d3('0x23')](respondWithStatusCode(_0x1a32bd,null))[_0x40d3('0x2a')](handleError(_0x1a32bd,null));};exports[_0x40d3('0xe6')]=function(_0x13bb1a,_0x5701c9,_0x3f3d96){var _0x2da587={};var _0x3822c4={};var _0x37749c;var _0x572b44;return db['SmsAccount'][_0x40d3('0x6a')]({'where':{'id':_0x13bb1a[_0x40d3('0x67')]['id']}})[_0x40d3('0x23')](handleEntityNotFound(_0x5701c9,null))[_0x40d3('0x23')](function(_0x10cff9){if(_0x10cff9){_0x37749c=_0x10cff9;_0x3822c4[_0x40d3('0x44')]=_['keys'](db[_0x40d3('0xa7')]['rawAttributes']);_0x3822c4[_0x40d3('0x46')]=_['keys'](_0x13bb1a['query']);_0x3822c4[_0x40d3('0x48')]=_[_0x40d3('0x49')](_0x3822c4['model'],_0x3822c4[_0x40d3('0x46')]);_0x2da587[_0x40d3('0x4a')]=_['intersection'](_0x3822c4[_0x40d3('0x44')],qs[_0x40d3('0x4b')](_0x13bb1a['query'][_0x40d3('0x4b')]));_0x2da587[_0x40d3('0x4a')]=_0x2da587[_0x40d3('0x4a')][_0x40d3('0x4c')]?_0x2da587[_0x40d3('0x4a')]:_0x3822c4[_0x40d3('0x44')];_0x2da587['order']=qs[_0x40d3('0x50')](_0x13bb1a['query'][_0x40d3('0x50')]);_0x2da587[_0x40d3('0x6d')]=qs[_0x40d3('0x48')](_[_0x40d3('0x51')](_0x13bb1a['query'],_0x3822c4[_0x40d3('0x48')]));if(_0x13bb1a[_0x40d3('0x46')][_0x40d3('0x52')]){_0x2da587[_0x40d3('0x6d')]=_[_0x40d3('0x54')](_0x2da587['where'],{'$or':_[_0x40d3('0x45')](_0x2da587['attributes'],function(_0x2d11d8){var _0x3ca02a={};_0x3ca02a[_0x2d11d8]={'$like':'%'+_0x13bb1a[_0x40d3('0x46')][_0x40d3('0x52')]+'%'};return _0x3ca02a;})});}_0x2da587=_[_0x40d3('0x54')]({},_0x2da587,_0x13bb1a[_0x40d3('0x5a')]);return _0x37749c[_0x40d3('0xe6')](_0x2da587);}})[_0x40d3('0x23')](function(_0x767602){if(_0x767602){_0x572b44=_0x767602[_0x40d3('0x4c')];if(!_0x13bb1a[_0x40d3('0x46')][_0x40d3('0x4d')](_0x40d3('0x4e'))){_0x2da587['limit']=qs[_0x40d3('0x31')](_0x13bb1a[_0x40d3('0x46')][_0x40d3('0x31')]);_0x2da587[_0x40d3('0x2f')]=qs[_0x40d3('0x2f')](_0x13bb1a['query'][_0x40d3('0x2f')]);}return _0x37749c[_0x40d3('0xe6')](_0x2da587);}})[_0x40d3('0x23')](function(_0x403100){if(_0x403100){return _0x403100?{'count':_0x572b44,'rows':_0x403100}:null;}})[_0x40d3('0x23')](respondWithResult(_0x5701c9,null))[_0x40d3('0x2a')](handleError(_0x5701c9,null));}; \ No newline at end of file +var _0x1b6a=['mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','findOne','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','account','applications','priority','asc','Applications','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','From','messageId','MessageSid','skebby','sender','text','connectel','from','clicksend','message_id','plivo','Text','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','bandwidth','intelepeer','refid','Sequelize','isNil','mapKey','includes','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','close','unmanaged','SmsMessage','AttachmentId','UserId','User','unshift','agent','*,*,*,*','Start','startRouting','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','finally','sendStatus','send','getApplications','getInteractions','Contact','internal','Tag','Tags','tag','List','Messages','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','update','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause'];(function(_0x34fb9a,_0x44fa4d){var _0x33932a=function(_0x58b5bb){while(--_0x58b5bb){_0x34fb9a['push'](_0x34fb9a['shift']());}};_0x33932a(++_0x44fa4d);}(_0x1b6a,0x184));var _0xa1b6=function(_0x183fc7,_0x4cc983){_0x183fc7=_0x183fc7-0x0;var _0x3930ec=_0x1b6a[_0x183fc7];return _0x3930ec;};'use strict';var emlformat=require(_0xa1b6('0x0'));var rimraf=require(_0xa1b6('0x1'));var zipdir=require(_0xa1b6('0x2'));var jsonpatch=require(_0xa1b6('0x3'));var rp=require('request-promise');var moment=require(_0xa1b6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa1b6('0x5'));var util=require(_0xa1b6('0x6'));var path=require(_0xa1b6('0x7'));var sox=require(_0xa1b6('0x8'));var csv=require(_0xa1b6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1b6('0xa'));var _=require(_0xa1b6('0xb'));var squel=require(_0xa1b6('0xc'));var crypto=require(_0xa1b6('0xd'));var jsforce=require(_0xa1b6('0xe'));var deskjs=require(_0xa1b6('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa1b6('0x10'));var Papa=require(_0xa1b6('0x11'));var Redis=require(_0xa1b6('0x12'));var authService=require(_0xa1b6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa1b6('0x14'));var hardwareService=require(_0xa1b6('0x15'));var logger=require(_0xa1b6('0x16'))('api');var utils=require(_0xa1b6('0x17'));var config=require(_0xa1b6('0x18'));var licenseUtil=require(_0xa1b6('0x19'));var db=require(_0xa1b6('0x1a'))['db'];config['redis']=_[_0xa1b6('0x1b')](config[_0xa1b6('0x1c')],{'host':_0xa1b6('0x1d'),'port':0x18eb});var socket=require(_0xa1b6('0x1e'))(new Redis(config[_0xa1b6('0x1c')]));require(_0xa1b6('0x1f'))['register'](socket);var jayson=require(_0xa1b6('0x20'));var client=jayson[_0xa1b6('0x21')][_0xa1b6('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x4cef19,_0x14327a,_0x220a7b,_0x29e1a7){return new BPromise(function(_0x1638da,_0x3769f0){var _0xb3bf1e=_0x29e1a7||client;return _0xb3bf1e[_0xa1b6('0x23')](_0x4cef19,_0x220a7b)[_0xa1b6('0x24')](function(_0x16a63e){logger[_0xa1b6('0x25')](_0xa1b6('0x26'),_0x14327a,'request\x20sent');logger['debug'](_0xa1b6('0x27'),_0x14327a,'request\x20sent',JSON[_0xa1b6('0x28')](_0x16a63e));if(_0x16a63e['error']){if(_0x16a63e[_0xa1b6('0x29')][_0xa1b6('0x2a')]===0x1f4){logger[_0xa1b6('0x29')]('SmsAccount,\x20%s,\x20%s',_0x14327a,_0x16a63e[_0xa1b6('0x29')][_0xa1b6('0x2b')]);return _0x3769f0(_0x16a63e[_0xa1b6('0x29')]['message']);}logger[_0xa1b6('0x29')](_0xa1b6('0x26'),_0x14327a,_0x16a63e[_0xa1b6('0x29')][_0xa1b6('0x2b')]);return _0x1638da(_0x16a63e['error'][_0xa1b6('0x2b')]);}else{logger[_0xa1b6('0x25')](_0xa1b6('0x26'),_0x14327a,_0xa1b6('0x2c'));_0x1638da(_0x16a63e[_0xa1b6('0x2d')][_0xa1b6('0x2b')]);}})[_0xa1b6('0x2e')](function(_0x31e47f){logger[_0xa1b6('0x29')]('SmsAccount,\x20%s,\x20%s',_0x14327a,_0x31e47f);_0x3769f0(_0x31e47f);});});}function respondWithStatusCode(_0x6ba51,_0x2af88e){_0x2af88e=_0x2af88e||0xcc;return function(_0x232136){if(_0x232136){return _0x6ba51['sendStatus'](_0x2af88e);}return _0x6ba51[_0xa1b6('0x2f')](_0x2af88e)[_0xa1b6('0x30')]();};}function respondWithResult(_0x3e8207,_0x47c5d2){_0x47c5d2=_0x47c5d2||0xc8;return function(_0x4b0af3){if(_0x4b0af3){return _0x3e8207['status'](_0x47c5d2)['json'](_0x4b0af3);}};}function respondWithFilteredResult(_0x2985cb,_0x589333){return function(_0x37a2e4){if(_0x37a2e4){var _0x40fc65=typeof _0x589333[_0xa1b6('0x31')]===_0xa1b6('0x32')&&typeof _0x589333[_0xa1b6('0x33')]===_0xa1b6('0x32');var _0x274e97=_0x37a2e4[_0xa1b6('0x34')];var _0xbfe5bd=_0x40fc65?0x0:_0x589333[_0xa1b6('0x31')];var _0x3506f1=_0x40fc65?_0x37a2e4[_0xa1b6('0x34')]:_0x589333['offset']+_0x589333['limit'];var _0xee0e2f;if(_0x3506f1>=_0x274e97){_0x3506f1=_0x274e97;_0xee0e2f=0xc8;}else{_0xee0e2f=0xce;}_0x2985cb['status'](_0xee0e2f);return _0x2985cb['set'](_0xa1b6('0x35'),_0xbfe5bd+'-'+_0x3506f1+'/'+_0x274e97)[_0xa1b6('0x36')](_0x37a2e4);}return null;};}function patchUpdates(_0x2e60b8){return function(_0x1d85eb){try{jsonpatch[_0xa1b6('0x37')](_0x1d85eb,_0x2e60b8,!![]);}catch(_0x1a1c7d){return BPromise[_0xa1b6('0x38')](_0x1a1c7d);}return _0x1d85eb[_0xa1b6('0x39')]();};}function saveUpdates(_0x5244fa,_0x1ac957){return function(_0x56c3cf){if(_0x56c3cf){return _0x56c3cf['update'](_0x5244fa)['then'](function(_0x3a5075){return _0x3a5075;});}return null;};}function removeEntity(_0x5a8974,_0x2e3181){return function(_0x4076bf){if(_0x4076bf){return _0x4076bf[_0xa1b6('0x3a')]()['then'](function(){var _0x140239=_0x4076bf[_0xa1b6('0x3b')]({'plain':!![]});var _0x44de9a=_0xa1b6('0x3c');return db[_0xa1b6('0x3d')][_0xa1b6('0x3a')]({'where':{'type':_0x44de9a,'resourceId':_0x140239['id']}})[_0xa1b6('0x24')](function(){return _0x4076bf;});})[_0xa1b6('0x24')](function(){_0x5a8974[_0xa1b6('0x2f')](0xcc)[_0xa1b6('0x30')]();});}};}function handleEntityNotFound(_0x291a6c,_0x5dc648){return function(_0x3d1315){if(!_0x3d1315){_0x291a6c['sendStatus'](0x194);}return _0x3d1315;};}function handleError(_0x40f6f3,_0x405c54){_0x405c54=_0x405c54||0x1f4;return function(_0x18bd58){logger['error'](_0x18bd58[_0xa1b6('0x3e')]);if(_0x18bd58[_0xa1b6('0x3f')]){delete _0x18bd58[_0xa1b6('0x3f')];}_0x40f6f3['status'](_0x405c54)['send'](_0x18bd58);};}exports[_0xa1b6('0x40')]=function(_0x2dadf3,_0x3dc0df){var _0x2ea083={'include':[{'model':db[_0xa1b6('0x41')],'as':_0xa1b6('0x42')}]},_0x1cec7d={},_0xb9cfde={'count':0x0,'rows':[]};var _0x1d17e3=_[_0xa1b6('0x43')](db[_0xa1b6('0x44')][_0xa1b6('0x45')],function(_0x3663b4){return{'name':_0x3663b4['fieldName'],'type':_0x3663b4[_0xa1b6('0x46')]['key']};});_0x1cec7d[_0xa1b6('0x47')]=_['map'](_0x1d17e3,_0xa1b6('0x3f'));_0x1cec7d[_0xa1b6('0x48')]=_[_0xa1b6('0x49')](_0x2dadf3[_0xa1b6('0x48')]);_0x1cec7d[_0xa1b6('0x4a')]=_[_0xa1b6('0x4b')](_0x1cec7d[_0xa1b6('0x47')],_0x1cec7d[_0xa1b6('0x48')]);_0x2ea083[_0xa1b6('0x4c')]=_[_0xa1b6('0x4b')](_0x1cec7d['model'],qs[_0xa1b6('0x4d')](_0x2dadf3[_0xa1b6('0x48')][_0xa1b6('0x4d')]));_0x2ea083['attributes']=_0x2ea083['attributes'][_0xa1b6('0x4e')]?_0x2ea083['attributes']:_0x1cec7d[_0xa1b6('0x47')];if(!_0x2dadf3[_0xa1b6('0x48')][_0xa1b6('0x4f')](_0xa1b6('0x50'))){_0x2ea083[_0xa1b6('0x33')]=qs[_0xa1b6('0x33')](_0x2dadf3[_0xa1b6('0x48')]['limit']);_0x2ea083['offset']=qs[_0xa1b6('0x31')](_0x2dadf3[_0xa1b6('0x48')]['offset']);}_0x2ea083['order']=qs[_0xa1b6('0x51')](_0x2dadf3['query'][_0xa1b6('0x51')]);_0x2ea083[_0xa1b6('0x52')]=qs[_0xa1b6('0x4a')](_['pick'](_0x2dadf3[_0xa1b6('0x48')],_0x1cec7d[_0xa1b6('0x4a')]),_0x1d17e3);if(_0x2dadf3[_0xa1b6('0x48')]['filter']){_0x2ea083['where']=_[_0xa1b6('0x53')](_0x2ea083[_0xa1b6('0x52')],{'$or':_[_0xa1b6('0x43')](_0x1d17e3,function(_0x3b7083){if(_0x3b7083[_0xa1b6('0x46')]!==_0xa1b6('0x54')){var _0x4c6f81={};_0x4c6f81[_0x3b7083[_0xa1b6('0x3f')]]={'$like':'%'+_0x2dadf3[_0xa1b6('0x48')][_0xa1b6('0x55')]+'%'};return _0x4c6f81;}})});}_0x2ea083=_['merge']({},_0x2ea083,_0x2dadf3[_0xa1b6('0x56')]);var _0x178c06={'where':_0x2ea083['where']};return db[_0xa1b6('0x44')][_0xa1b6('0x34')](_0x178c06)['then'](function(_0x51dab6){_0xb9cfde[_0xa1b6('0x34')]=_0x51dab6;if(_0x2dadf3[_0xa1b6('0x48')][_0xa1b6('0x57')]){_0x2ea083[_0xa1b6('0x58')]=[{'all':!![]}];}return db[_0xa1b6('0x44')][_0xa1b6('0x59')](_0x2ea083);})[_0xa1b6('0x24')](function(_0x35242d){_0xb9cfde[_0xa1b6('0x5a')]=_0x35242d;return _0xb9cfde;})[_0xa1b6('0x24')](respondWithFilteredResult(_0x3dc0df,_0x2ea083))[_0xa1b6('0x2e')](handleError(_0x3dc0df,null));};exports[_0xa1b6('0x5b')]=function(_0xa6a3ef,_0x156305){var _0xf7e290={'raw':![],'where':{'id':_0xa6a3ef[_0xa1b6('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xa1b6('0x42')}]},_0x16e163={};_0x16e163[_0xa1b6('0x47')]=_['keys'](db['SmsAccount'][_0xa1b6('0x45')]);_0x16e163[_0xa1b6('0x48')]=_[_0xa1b6('0x49')](_0xa6a3ef['query']);_0x16e163[_0xa1b6('0x4a')]=_[_0xa1b6('0x4b')](_0x16e163[_0xa1b6('0x47')],_0x16e163[_0xa1b6('0x48')]);_0xf7e290[_0xa1b6('0x4c')]=_[_0xa1b6('0x4b')](_0x16e163[_0xa1b6('0x47')],qs['fields'](_0xa6a3ef[_0xa1b6('0x48')]['fields']));_0xf7e290[_0xa1b6('0x4c')]=_0xf7e290['attributes'][_0xa1b6('0x4e')]?_0xf7e290[_0xa1b6('0x4c')]:_0x16e163['model'];if(_0xa6a3ef[_0xa1b6('0x48')][_0xa1b6('0x57')]){_0xf7e290[_0xa1b6('0x58')]=[{'all':!![]}];}_0xf7e290=_['merge']({},_0xf7e290,_0xa6a3ef[_0xa1b6('0x56')]);return db[_0xa1b6('0x44')][_0xa1b6('0x5d')](_0xf7e290)[_0xa1b6('0x24')](handleEntityNotFound(_0x156305,null))[_0xa1b6('0x24')](respondWithResult(_0x156305,null))[_0xa1b6('0x2e')](handleError(_0x156305,null));};exports['create']=function(_0x1a674f,_0x5d80bf){return db[_0xa1b6('0x44')][_0xa1b6('0x5e')](_0x1a674f[_0xa1b6('0x5f')],{})[_0xa1b6('0x24')](function(_0x3c8b53){var _0x32e80c=_0x1a674f[_0xa1b6('0x60')][_0xa1b6('0x3b')]({'plain':!![]});if(!_0x32e80c)throw new Error(_0xa1b6('0x61'));if(_0x32e80c['role']==='user'){var _0x2bb511=_0x3c8b53[_0xa1b6('0x3b')]({'plain':!![]});var _0x20cd47=_0xa1b6('0x3c');return db['UserProfileSection'][_0xa1b6('0x5d')]({'where':{'name':_0x20cd47,'userProfileId':_0x32e80c[_0xa1b6('0x62')]},'raw':!![]})['then'](function(_0x523380){if(_0x523380&&_0x523380['autoAssociation']===0x0){return db[_0xa1b6('0x3d')][_0xa1b6('0x5e')]({'name':_0x2bb511[_0xa1b6('0x3f')],'resourceId':_0x2bb511['id'],'type':_0x523380['name'],'sectionId':_0x523380['id']},{})[_0xa1b6('0x24')](function(){return _0x3c8b53;});}else{return _0x3c8b53;}})[_0xa1b6('0x2e')](function(_0x412318){logger[_0xa1b6('0x29')](_0xa1b6('0x63'),_0x412318);throw _0x412318;});}return _0x3c8b53;})[_0xa1b6('0x24')](respondWithResult(_0x5d80bf,0xc9))['catch'](handleError(_0x5d80bf,null));};exports['update']=function(_0x306a1d,_0x4c2bc1){if(_0x306a1d[_0xa1b6('0x5f')]['id']){delete _0x306a1d[_0xa1b6('0x5f')]['id'];}return db[_0xa1b6('0x44')][_0xa1b6('0x5d')]({'where':{'id':_0x306a1d[_0xa1b6('0x5c')]['id']},'include':[{'model':db[_0xa1b6('0x41')],'as':_0xa1b6('0x42')}]})[_0xa1b6('0x24')](handleEntityNotFound(_0x4c2bc1,null))[_0xa1b6('0x24')](saveUpdates(_0x306a1d[_0xa1b6('0x5f')],null))[_0xa1b6('0x24')](respondWithResult(_0x4c2bc1,null))[_0xa1b6('0x2e')](handleError(_0x4c2bc1,null));};exports[_0xa1b6('0x3a')]=function(_0x1e0ec7,_0x316cf2){return db['SmsAccount'][_0xa1b6('0x5d')]({'where':{'id':_0x1e0ec7[_0xa1b6('0x5c')]['id']}})[_0xa1b6('0x24')](handleEntityNotFound(_0x316cf2,null))['then'](removeEntity(_0x316cf2,null))[_0xa1b6('0x2e')](handleError(_0x316cf2,null));};exports[_0xa1b6('0x64')]=function(_0x2b7502,_0x4b845c){return db['SmsAccount'][_0xa1b6('0x64')]()[_0xa1b6('0x24')](respondWithResult(_0x4b845c,null))[_0xa1b6('0x2e')](handleError(_0x4b845c,null));};exports[_0xa1b6('0x65')]=function(_0x4a44a7,_0x2a34fd,_0x420b85){if(_0x4a44a7[_0xa1b6('0x5f')]['id']){delete _0x4a44a7[_0xa1b6('0x5f')]['id'];}return db[_0xa1b6('0x44')][_0xa1b6('0x5d')]({'where':{'id':_0x4a44a7[_0xa1b6('0x5c')]['id']}})[_0xa1b6('0x24')](handleEntityNotFound(_0x2a34fd,null))[_0xa1b6('0x24')](function(_0x3bdeb4){if(_0x3bdeb4){_0x4a44a7['body'][_0xa1b6('0x66')]=_0x3bdeb4['id'];return db[_0xa1b6('0x67')][_0xa1b6('0x5e')](_0x4a44a7[_0xa1b6('0x5f')]);}})[_0xa1b6('0x24')](respondWithResult(_0x2a34fd,null))['catch'](handleError(_0x2a34fd,null));};exports['getDispositions']=function(_0x213a4a,_0x5be5ff,_0x24a97e){var _0x1586ee={'raw':![],'where':{}};var _0x41c9ae={};var _0x5b75d2={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa1b6('0x68')]({'where':{'id':_0x213a4a[_0xa1b6('0x5c')]['id']}})[_0xa1b6('0x24')](handleEntityNotFound(_0x5be5ff,null))[_0xa1b6('0x24')](function(_0x129e39){if(_0x129e39){_0x41c9ae['model']=_[_0xa1b6('0x49')](db['Disposition'][_0xa1b6('0x45')]);_0x41c9ae[_0xa1b6('0x48')]=_[_0xa1b6('0x49')](_0x213a4a[_0xa1b6('0x48')]);_0x41c9ae['filters']=_[_0xa1b6('0x4b')](_0x41c9ae[_0xa1b6('0x47')],_0x41c9ae['query']);_0x1586ee[_0xa1b6('0x4c')]=_['intersection'](_0x41c9ae['model'],qs[_0xa1b6('0x4d')](_0x213a4a[_0xa1b6('0x48')][_0xa1b6('0x4d')]));_0x1586ee['attributes']=_0x1586ee[_0xa1b6('0x4c')]['length']?_0x1586ee[_0xa1b6('0x4c')]:_0x41c9ae['model'];if(!_0x213a4a[_0xa1b6('0x48')][_0xa1b6('0x4f')](_0xa1b6('0x50'))){_0x1586ee[_0xa1b6('0x33')]=qs[_0xa1b6('0x33')](_0x213a4a[_0xa1b6('0x48')]['limit']);_0x1586ee[_0xa1b6('0x31')]=qs['offset'](_0x213a4a[_0xa1b6('0x48')][_0xa1b6('0x31')]);}_0x1586ee[_0xa1b6('0x69')]=qs[_0xa1b6('0x51')](_0x213a4a[_0xa1b6('0x48')][_0xa1b6('0x51')]);_0x1586ee[_0xa1b6('0x52')]=qs[_0xa1b6('0x4a')](_[_0xa1b6('0x6a')](_0x213a4a[_0xa1b6('0x48')],_0x41c9ae['filters']));_0x1586ee[_0xa1b6('0x52')][_0xa1b6('0x66')]=_0x129e39['id'];if(_0x213a4a[_0xa1b6('0x48')][_0xa1b6('0x55')]){_0x1586ee[_0xa1b6('0x52')]=_[_0xa1b6('0x53')](_0x1586ee[_0xa1b6('0x52')],{'$or':_[_0xa1b6('0x43')](_0x1586ee['attributes'],function(_0xdab9da){var _0x43fdc4={};_0x43fdc4[_0xdab9da]={'$like':'%'+_0x213a4a['query'][_0xa1b6('0x55')]+'%'};return _0x43fdc4;})});}_0x1586ee=_[_0xa1b6('0x53')]({},_0x1586ee,_0x213a4a['options']);return db['Disposition'][_0xa1b6('0x34')]({'where':_0x1586ee[_0xa1b6('0x52')]})[_0xa1b6('0x24')](function(_0x33f8c8){_0x5b75d2['count']=_0x33f8c8;if(_0x213a4a[_0xa1b6('0x48')]['includeAll']){_0x1586ee[_0xa1b6('0x58')]=[{'all':!![]}];}return db[_0xa1b6('0x67')]['findAll'](_0x1586ee);})[_0xa1b6('0x24')](function(_0x3696d1){_0x5b75d2[_0xa1b6('0x5a')]=_0x3696d1;return _0x5b75d2;});}})['then'](respondWithFilteredResult(_0x5be5ff,_0x1586ee))[_0xa1b6('0x2e')](handleError(_0x5be5ff,null));};exports[_0xa1b6('0x6b')]=function(_0x20ffd7,_0x1c8b9f,_0x313d45){return db['SmsAccount']['find']({'where':{'id':_0x20ffd7['params']['id']}})[_0xa1b6('0x24')](handleEntityNotFound(_0x1c8b9f,null))[_0xa1b6('0x24')](function(_0x12f41e){if(_0x12f41e){return _0x12f41e[_0xa1b6('0x6b')](_0x20ffd7[_0xa1b6('0x48')][_0xa1b6('0x6c')]);}})['then'](respondWithStatusCode(_0x1c8b9f,null))[_0xa1b6('0x2e')](handleError(_0x1c8b9f,null));};exports[_0xa1b6('0x6d')]=function(_0x3df8ae,_0x477231,_0x2dc030){if(_0x3df8ae[_0xa1b6('0x5f')]['id']){delete _0x3df8ae[_0xa1b6('0x5f')]['id'];}return db[_0xa1b6('0x44')][_0xa1b6('0x5d')]({'where':{'id':_0x3df8ae[_0xa1b6('0x5c')]['id']}})[_0xa1b6('0x24')](handleEntityNotFound(_0x477231,null))[_0xa1b6('0x24')](function(_0x2db318){if(_0x2db318){_0x3df8ae['body']['SmsAccountId']=_0x2db318['id'];return db[_0xa1b6('0x6e')][_0xa1b6('0x5e')](_0x3df8ae[_0xa1b6('0x5f')]);}})[_0xa1b6('0x24')](respondWithResult(_0x477231,null))['catch'](handleError(_0x477231,null));};exports[_0xa1b6('0x6f')]=function(_0x19ba05,_0x2d5481,_0x1a4189){var _0x41b7bf={'raw':![],'where':{}};var _0x20ccc2={};var _0x5bc21c={'count':0x0,'rows':[]};return db[_0xa1b6('0x44')][_0xa1b6('0x68')]({'where':{'id':_0x19ba05[_0xa1b6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2d5481,null))['then'](function(_0x4220e4){if(_0x4220e4){_0x20ccc2[_0xa1b6('0x47')]=_[_0xa1b6('0x49')](db[_0xa1b6('0x6e')][_0xa1b6('0x45')]);_0x20ccc2[_0xa1b6('0x48')]=_[_0xa1b6('0x49')](_0x19ba05[_0xa1b6('0x48')]);_0x20ccc2['filters']=_[_0xa1b6('0x4b')](_0x20ccc2['model'],_0x20ccc2[_0xa1b6('0x48')]);_0x41b7bf['attributes']=_[_0xa1b6('0x4b')](_0x20ccc2[_0xa1b6('0x47')],qs[_0xa1b6('0x4d')](_0x19ba05['query']['fields']));_0x41b7bf[_0xa1b6('0x4c')]=_0x41b7bf[_0xa1b6('0x4c')][_0xa1b6('0x4e')]?_0x41b7bf[_0xa1b6('0x4c')]:_0x20ccc2[_0xa1b6('0x47')];if(!_0x19ba05['query'][_0xa1b6('0x4f')](_0xa1b6('0x50'))){_0x41b7bf[_0xa1b6('0x33')]=qs['limit'](_0x19ba05[_0xa1b6('0x48')][_0xa1b6('0x33')]);_0x41b7bf[_0xa1b6('0x31')]=qs[_0xa1b6('0x31')](_0x19ba05[_0xa1b6('0x48')][_0xa1b6('0x31')]);}_0x41b7bf[_0xa1b6('0x69')]=qs[_0xa1b6('0x51')](_0x19ba05['query']['sort']);_0x41b7bf[_0xa1b6('0x52')]=qs[_0xa1b6('0x4a')](_[_0xa1b6('0x6a')](_0x19ba05['query'],_0x20ccc2[_0xa1b6('0x4a')]));_0x41b7bf[_0xa1b6('0x52')][_0xa1b6('0x66')]=_0x4220e4['id'];if(_0x19ba05[_0xa1b6('0x48')]['filter']){_0x41b7bf[_0xa1b6('0x52')]=_[_0xa1b6('0x53')](_0x41b7bf['where'],{'$or':_[_0xa1b6('0x43')](_0x41b7bf[_0xa1b6('0x4c')],function(_0x13bd9c){var _0x2edd62={};_0x2edd62[_0x13bd9c]={'$like':'%'+_0x19ba05[_0xa1b6('0x48')][_0xa1b6('0x55')]+'%'};return _0x2edd62;})});}_0x41b7bf=_['merge']({},_0x41b7bf,_0x19ba05[_0xa1b6('0x56')]);return db[_0xa1b6('0x6e')][_0xa1b6('0x34')]({'where':_0x41b7bf[_0xa1b6('0x52')]})[_0xa1b6('0x24')](function(_0x326c97){_0x5bc21c['count']=_0x326c97;if(_0x19ba05['query'][_0xa1b6('0x57')]){_0x41b7bf['include']=[{'all':!![]}];}return db[_0xa1b6('0x6e')][_0xa1b6('0x59')](_0x41b7bf);})[_0xa1b6('0x24')](function(_0x4d4299){_0x5bc21c[_0xa1b6('0x5a')]=_0x4d4299;return _0x5bc21c;});}})[_0xa1b6('0x24')](respondWithFilteredResult(_0x2d5481,_0x41b7bf))[_0xa1b6('0x2e')](handleError(_0x2d5481,null));};exports[_0xa1b6('0x70')]=function(_0x8e2e87,_0x156e84,_0x3f76f5){return db['SmsAccount'][_0xa1b6('0x5d')]({'where':{'id':_0x8e2e87[_0xa1b6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x156e84,null))['then'](function(_0x5e3187){if(_0x5e3187){return _0x5e3187[_0xa1b6('0x70')](_0x8e2e87['query'][_0xa1b6('0x6c')]);}})['then'](respondWithStatusCode(_0x156e84,null))[_0xa1b6('0x2e')](handleError(_0x156e84,null));};exports[_0xa1b6('0x71')]=function(_0x2c1c6e,_0x297575,_0x5654d2){var _0xae1a43={'channel':_0xa1b6('0x72')};var _0x2f193b=[];var _0xe7e200=[];var _0x13d52b={};return db['SmsAccount'][_0xa1b6('0x5d')]({'where':{'id':_0x2c1c6e['params']['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0xa1b6('0x24')](handleEntityNotFound(_0x297575,null))[_0xa1b6('0x24')](function(_0x2a9f46){_0xae1a43[_0xa1b6('0x73')]=_0x2a9f46;_0xae1a43[_0xa1b6('0x74')]=_['orderBy'](_0x2a9f46['Applications'],[_0xa1b6('0x75')],[_0xa1b6('0x76')]);if(_0xae1a43[_0xa1b6('0x73')][_0xa1b6('0x77')]){delete _0xae1a43[_0xa1b6('0x73')][_0xa1b6('0x77')];}return db[_0xa1b6('0x78')][_0xa1b6('0x64')]();})[_0xa1b6('0x24')](function(_0x5d7dce){if(!_0x5d7dce){throw new db['Sequelize'][(_0xa1b6('0x79'))](_0xa1b6('0x7a'));}_0x2f193b=_[_0xa1b6('0x7b')](_[_0xa1b6('0x49')](_0x5d7dce),[_0xa1b6('0x7c'),_0xa1b6('0x7d')]);_0xe7e200=_[_0xa1b6('0x7b')](_['keys'](_0x5d7dce),[_0xa1b6('0x7c'),_0xa1b6('0x7d'),_0xa1b6('0x7e'),_0xa1b6('0x7f')]);_0xae1a43[_0xa1b6('0x5f')]={'mapKey':'mobile'};if(_0xae1a43['account'][_0xa1b6('0x46')]){switch(_0xae1a43[_0xa1b6('0x73')]['type']){case'twilio':_0xae1a43['body']['from']=_0x2c1c6e['body'][_0xa1b6('0x80')];_0xae1a43['body']['body']=_0x2c1c6e[_0xa1b6('0x5f')]['Body'];_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x81')]=_0x2c1c6e['body'][_0xa1b6('0x82')];break;case _0xa1b6('0x83'):_0xae1a43[_0xa1b6('0x5f')]['from']='+'+_0x2c1c6e[_0xa1b6('0x5f')][_0xa1b6('0x84')];_0xae1a43[_0xa1b6('0x5f')]['body']=_0x2c1c6e[_0xa1b6('0x5f')][_0xa1b6('0x85')];break;case _0xa1b6('0x86'):_0xae1a43['body'][_0xa1b6('0x87')]=_0x2c1c6e['body'][_0xa1b6('0x87')];_0xae1a43['body']['body']=_0x2c1c6e[_0xa1b6('0x5f')][_0xa1b6('0x2b')];break;case _0xa1b6('0x88'):_0xae1a43['body']['from']=_0x2c1c6e[_0xa1b6('0x5f')][_0xa1b6('0x87')];_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x5f')]=_0x2c1c6e[_0xa1b6('0x5f')][_0xa1b6('0x5f')];_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x81')]=_0x2c1c6e['body'][_0xa1b6('0x89')];break;case _0xa1b6('0x8a'):_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x87')]=_0x2c1c6e['body'][_0xa1b6('0x80')];_0xae1a43['body'][_0xa1b6('0x5f')]=_0x2c1c6e[_0xa1b6('0x5f')][_0xa1b6('0x8b')];_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x81')]=_0x2c1c6e[_0xa1b6('0x5f')]['MessageUUID'];break;case _0xa1b6('0x8c'):_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x87')]='+'+_0x2c1c6e[_0xa1b6('0x5f')][_0xa1b6('0x8d')][0x0][_0xa1b6('0x87')];_0xae1a43['body'][_0xa1b6('0x5f')]=_0x2c1c6e['body']['results'][0x0][_0xa1b6('0x85')];_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x81')]=_0x2c1c6e[_0xa1b6('0x5f')]['results'][0x0][_0xa1b6('0x81')];break;case _0xa1b6('0x8e'):_0xae1a43['body'][_0xa1b6('0x87')]=_0x2c1c6e['body'][_0xa1b6('0x8f')];_0xae1a43['body'][_0xa1b6('0x5f')]=_0x2c1c6e['body'][_0xa1b6('0x90')][_0xa1b6('0x2b')];break;case _0xa1b6('0x91'):_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x87')]=_0x2c1c6e['body']['fromNumber'];_0xae1a43[_0xa1b6('0x5f')]['body']=_0x2c1c6e[_0xa1b6('0x5f')][_0xa1b6('0x85')];_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x81')]=_0x2c1c6e[_0xa1b6('0x5f')]['replyMessageId'];break;case _0xa1b6('0x92'):_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x81')]=_0x2c1c6e['body'][0x0]['message']['id'];_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x87')]=_0x2c1c6e['body'][0x0]['message']['from'];_0xae1a43['body'][_0xa1b6('0x5f')]=_0x2c1c6e[_0xa1b6('0x5f')][0x0][_0xa1b6('0x2b')][_0xa1b6('0x85')];break;case _0xa1b6('0x93'):_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x87')]=_0x2c1c6e[_0xa1b6('0x5f')][_0xa1b6('0x87')];_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x5f')]=_0x2c1c6e[_0xa1b6('0x5f')][_0xa1b6('0x2b')];_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x81')]=_0x2c1c6e[_0xa1b6('0x5f')][_0xa1b6('0x94')];break;}}if(_0xae1a43[_0xa1b6('0x5f')]['id']){delete _0xae1a43[_0xa1b6('0x5f')]['id'];}if(_['isNil'](_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x87')])){throw new db[(_0xa1b6('0x95'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xa1b6('0x96')](_0xae1a43['body']['body'])||_0xae1a43['body'][_0xa1b6('0x5f')]===''){throw new db[(_0xa1b6('0x95'))][(_0xa1b6('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa1b6('0x96')](_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x97')])){throw new db[(_0xa1b6('0x95'))][(_0xa1b6('0x79'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe7e200);}if(!_[_0xa1b6('0x98')](_0xe7e200,_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x97')])){throw new db[(_0xa1b6('0x95'))][(_0xa1b6('0x79'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe7e200);}_0x13d52b[_0xae1a43['body'][_0xa1b6('0x97')]]=_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x87')];return db[_0xa1b6('0x99')][_0xa1b6('0x5d')]({'where':{'id':_0xae1a43[_0xa1b6('0x73')][_0xa1b6('0x7f')]},'include':[{'model':db['CmContact'],'as':_0xa1b6('0x9a'),'where':_0x13d52b,'limit':0x1,'order':[['updatedAt',_0xa1b6('0x9b')]]}]});})[_0xa1b6('0x24')](handleEntityNotFound(_0x297575,null))[_0xa1b6('0x24')](function(_0x2f5752){if(_0x2f5752){_0xae1a43[_0xa1b6('0x9c')]=_[_0xa1b6('0x9d')](_0x2f5752,[_0xa1b6('0x9a')]);if(_0x2f5752[_0xa1b6('0x9a')]['length']){return _0x2f5752['Contacts'][0x0];}var _0x1f55ca=_[_0xa1b6('0x1b')](_0xae1a43[_0xa1b6('0x5f')],{'firstName':_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x87')],'ListId':_0x2f5752['id']});_0x1f55ca[_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x97')]]=_0xae1a43[_0xa1b6('0x5f')]['from'];return db['CmContact'][_0xa1b6('0x5e')](_0x1f55ca,{'fields':_0x2f193b,'raw':!![]});}})[_0xa1b6('0x24')](handleEntityNotFound(_0x297575,null))[_0xa1b6('0x24')](function(_0x50e6dd){if(_0x50e6dd){_0xae1a43[_0xa1b6('0x9e')]=_0x50e6dd;var _0x47f0d1={'ContactId':_0x50e6dd['id'],'phone':_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x87')],'SmsAccountId':_0x2c1c6e['params']['id']};var _0x30c167={'ContactId':_0x50e6dd['id'],'SmsAccountId':_0x2c1c6e[_0xa1b6('0x5c')]['id'],'closed':![]};return db[_0xa1b6('0x9f')][_0xa1b6('0x5d')]({'where':_0x30c167})[_0xa1b6('0x24')](function(_0x2e4f05){if(_0x2e4f05){return[_0x2e4f05,![]];}return db[_0xa1b6('0x9f')][_0xa1b6('0x5e')](_0x47f0d1)[_0xa1b6('0x24')](function(_0x5d8584){return[_0x5d8584,!![]];});});}})[_0xa1b6('0xa0')](function(_0x471129,_0x4ace57){_0xae1a43[_0xa1b6('0xa1')]=_0x471129[_0xa1b6('0x3b')]({'plain':!![]});_0xae1a43[_0xa1b6('0xa1')][_0xa1b6('0xa2')]=![];if(_0x4ace57){if(_0xae1a43[_0xa1b6('0x73')][_0xa1b6('0xa3')]){_0xae1a43[_0xa1b6('0x74')]['push']({'id':0x0,'priority':_0xae1a43[_0xa1b6('0x74')][_0xa1b6('0x4e')]+0x1,'app':_0xa1b6('0xa4'),'appdata':_0xa1b6('0xa5'),'interval':'*,*,*,*'});}_0xae1a43[_0xa1b6('0xa1')][_0xa1b6('0xa2')]=!![];}return db[_0xa1b6('0xa6')][_0xa1b6('0x5e')]({'phone':_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x87')],'messageId':_0xae1a43[_0xa1b6('0x5f')][_0xa1b6('0x81')],'body':_0xae1a43[_0xa1b6('0x5f')]['body'],'SmsAccountId':_0x2c1c6e[_0xa1b6('0x5c')]['id'],'SmsInteractionId':_0x471129['id'],'direction':'in','ContactId':_0x471129['ContactId'],'AttachmentId':_0xae1a43['body'][_0xa1b6('0xa7')]});})[_0xa1b6('0x24')](function(_0x24a62a){_0xae1a43[_0xa1b6('0x2b')]=_0x24a62a;if(_0xae1a43['interaction'][_0xa1b6('0xa8')]){return db[_0xa1b6('0xa9')]['find']({'attributes':['id',_0xa1b6('0x3f')],'where':{'id':_0xae1a43[_0xa1b6('0xa1')][_0xa1b6('0xa8')]}})[_0xa1b6('0x24')](function(_0x200585){if(_0x200585){_0xae1a43[_0xa1b6('0x74')][_0xa1b6('0xaa')]({'id':0x0,'priority':0x0,'app':_0xa1b6('0xab'),'appdata':_0x200585[_0xa1b6('0x3f')]+','+(_0xae1a43[_0xa1b6('0x73')]['waitForTheAssignedAgent']||0xa),'interval':_0xa1b6('0xac')});}return respondWithRpcPromise(_0xa1b6('0xad'),'startRouting',_0xae1a43);});}return respondWithRpcPromise(_0xa1b6('0xad'),_0xa1b6('0xae'),_0xae1a43);})[_0xa1b6('0x24')](function(_0x197a74){if(_0x197a74){var _0x1103cb=0xc8;var _0x53c091='receiveMessage';logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x53c091,_0x1103cb,'entity\x20found');logger[_0xa1b6('0xaf')](_0xa1b6('0xb0'),_0x53c091,_0x1103cb,'entity\x20found',JSON['stringify'](_0x197a74));if(_0xae1a43['account'][_0xa1b6('0x46')]===_0xa1b6('0xb1')){return _0x297575['status'](_0x1103cb)[_0xa1b6('0xb2')]('Content-Type',_0xa1b6('0xb3'))['send'](_0xa1b6('0xb4'));}else{return _0x297575[_0xa1b6('0x2f')](_0x1103cb)['json'](_0x197a74);}}})['catch'](handleError(_0x297575,null));};exports[_0xa1b6('0xb5')]=function(_0x12f429,_0x38c55d){var _0x4d0af5=_0x12f429[_0xa1b6('0x5c')]['id'];var _0x2c4ec2=_0x12f429['body'];var _0x1484b5=0xc8;var _0x5bbc58=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xa1b6('0xb6')][_0xa1b6('0xb7')][_0xa1b6('0xb8')][_0xa1b6('0xb9')]},function(_0x10ed3f){return db[_0xa1b6('0x44')]['findOne']({'where':{'id':_0x4d0af5},'transaction':_0x10ed3f})[_0xa1b6('0x24')](function(_0x87ee3b){if(_0x87ee3b){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x4d0af5},'transaction':_0x10ed3f})['then'](function(){var _0x198b6d=_[_0xa1b6('0x43')](_0x2c4ec2,function(_0x12c259){_0x12c259[_0xa1b6('0x66')]=_0x4d0af5;return _0x12c259;});return db[_0xa1b6('0xba')][_0xa1b6('0xbb')](_0x198b6d,{'transaction':_0x10ed3f});});}else{_0x1484b5=0x194;_0x5bbc58=[];}});})[_0xa1b6('0x24')](function(){if(_0x1484b5!==0x194){return db[_0xa1b6('0xba')]['findAndCountAll']({'where':{'SmsAccountId':_0x4d0af5},'order':_0xa1b6('0x75')})[_0xa1b6('0x24')](function(_0x5d715d){_0x5bbc58=_0x5d715d;});}})[_0xa1b6('0x2e')](function(_0x2f1caf){_0x1484b5=0x1f4;logger[_0xa1b6('0x29')](_0x2f1caf[_0xa1b6('0x3e')]);if(_0x2f1caf['name']){delete _0x2f1caf[_0xa1b6('0x3f')];}_0x5bbc58=_0x2f1caf;})[_0xa1b6('0xbc')](function(){if(_0x5bbc58===null){_0x38c55d[_0xa1b6('0xbd')](_0x1484b5);}else{if(_0x1484b5===0x1f4){_0x38c55d['status'](_0x1484b5)[_0xa1b6('0xbe')](_0x5bbc58);}else{_0x38c55d[_0xa1b6('0x2f')](_0x1484b5)[_0xa1b6('0x36')](_0x5bbc58);}}});};exports[_0xa1b6('0xbf')]=function(_0xdd864a,_0x498e6d,_0xd84d73){var _0x5cbb82={};var _0x26264f={};var _0x51539c;var _0x9c56f7;return db[_0xa1b6('0x44')][_0xa1b6('0x68')]({'where':{'id':_0xdd864a[_0xa1b6('0x5c')]['id']}})[_0xa1b6('0x24')](handleEntityNotFound(_0x498e6d,null))[_0xa1b6('0x24')](function(_0xba4918){if(_0xba4918){_0x51539c=_0xba4918;_0x26264f[_0xa1b6('0x47')]=_[_0xa1b6('0x49')](db[_0xa1b6('0xba')][_0xa1b6('0x45')]);_0x26264f[_0xa1b6('0x48')]=_[_0xa1b6('0x49')](_0xdd864a[_0xa1b6('0x48')]);_0x26264f['filters']=_[_0xa1b6('0x4b')](_0x26264f['model'],_0x26264f[_0xa1b6('0x48')]);_0x5cbb82['attributes']=_['intersection'](_0x26264f[_0xa1b6('0x47')],qs[_0xa1b6('0x4d')](_0xdd864a[_0xa1b6('0x48')]['fields']));_0x5cbb82[_0xa1b6('0x4c')]=_0x5cbb82[_0xa1b6('0x4c')][_0xa1b6('0x4e')]?_0x5cbb82[_0xa1b6('0x4c')]:_0x26264f[_0xa1b6('0x47')];_0x5cbb82[_0xa1b6('0x69')]=qs[_0xa1b6('0x51')](_0xdd864a[_0xa1b6('0x48')][_0xa1b6('0x51')]);_0x5cbb82[_0xa1b6('0x52')]=qs[_0xa1b6('0x4a')](_[_0xa1b6('0x6a')](_0xdd864a[_0xa1b6('0x48')],_0x26264f[_0xa1b6('0x4a')]));if(_0xdd864a[_0xa1b6('0x48')][_0xa1b6('0x55')]){_0x5cbb82[_0xa1b6('0x52')]=_['merge'](_0x5cbb82[_0xa1b6('0x52')],{'$or':_[_0xa1b6('0x43')](_0x5cbb82[_0xa1b6('0x4c')],function(_0x551906){var _0x38e8a8={};_0x38e8a8[_0x551906]={'$like':'%'+_0xdd864a['query']['filter']+'%'};return _0x38e8a8;})});}_0x5cbb82=_['merge']({},_0x5cbb82,_0xdd864a[_0xa1b6('0x56')]);return _0x51539c[_0xa1b6('0xbf')](_0x5cbb82);}})[_0xa1b6('0x24')](function(_0x473379){if(_0x473379){_0x9c56f7=_0x473379[_0xa1b6('0x4e')];if(!_0xdd864a['query'][_0xa1b6('0x4f')](_0xa1b6('0x50'))){_0x5cbb82[_0xa1b6('0x33')]=qs[_0xa1b6('0x33')](_0xdd864a[_0xa1b6('0x48')]['limit']);_0x5cbb82[_0xa1b6('0x31')]=qs[_0xa1b6('0x31')](_0xdd864a['query'][_0xa1b6('0x31')]);}return _0x51539c[_0xa1b6('0xbf')](_0x5cbb82);}})[_0xa1b6('0x24')](function(_0x8e4b93){if(_0x8e4b93){return _0x8e4b93?{'count':_0x9c56f7,'rows':_0x8e4b93}:null;}})[_0xa1b6('0x24')](respondWithResult(_0x498e6d,null))[_0xa1b6('0x2e')](handleError(_0x498e6d,null));};exports[_0xa1b6('0xc0')]=function(_0x305738,_0x51743e,_0x3df07b){var _0x3f7aa0={'raw':![],'where':{}};var _0x747b0={};var _0x4c50e3={'count':0x0,'rows':[]};return db[_0xa1b6('0x44')][_0xa1b6('0x68')]({'where':{'id':_0x305738['params']['id']}})[_0xa1b6('0x24')](handleEntityNotFound(_0x51743e,null))['then'](function(_0x483d4e){if(_0x483d4e){_0x747b0['model']=_[_0xa1b6('0x49')](db[_0xa1b6('0x9f')][_0xa1b6('0x45')]);_0x747b0[_0xa1b6('0x48')]=_['keys'](_0x305738['query']);_0x747b0['filters']=_[_0xa1b6('0x4b')](_0x747b0[_0xa1b6('0x47')],_0x747b0[_0xa1b6('0x48')]);_0x3f7aa0[_0xa1b6('0x4c')]=_['intersection'](_0x747b0['model'],qs[_0xa1b6('0x4d')](_0x305738[_0xa1b6('0x48')][_0xa1b6('0x4d')]));_0x3f7aa0[_0xa1b6('0x4c')]=_0x3f7aa0[_0xa1b6('0x4c')][_0xa1b6('0x4e')]?_0x3f7aa0[_0xa1b6('0x4c')]:_0x747b0[_0xa1b6('0x47')];if(!_0x305738['query'][_0xa1b6('0x4f')]('nolimit')){_0x3f7aa0[_0xa1b6('0x33')]=qs[_0xa1b6('0x33')](_0x305738[_0xa1b6('0x48')][_0xa1b6('0x33')]);_0x3f7aa0['offset']=qs[_0xa1b6('0x31')](_0x305738[_0xa1b6('0x48')][_0xa1b6('0x31')]);}_0x3f7aa0[_0xa1b6('0x69')]=qs[_0xa1b6('0x51')](_0x305738[_0xa1b6('0x48')][_0xa1b6('0x51')]);_0x3f7aa0[_0xa1b6('0x52')]=qs['filters'](_[_0xa1b6('0x6a')](_0x305738[_0xa1b6('0x48')],_0x747b0[_0xa1b6('0x4a')]));_0x3f7aa0['where'][_0xa1b6('0x66')]=_0x483d4e['id'];if(_0x305738['query'][_0xa1b6('0x55')]){_0x3f7aa0[_0xa1b6('0x52')]=_[_0xa1b6('0x53')](_0x3f7aa0[_0xa1b6('0x52')],{'$or':_[_0xa1b6('0x43')](_0x3f7aa0['attributes'],function(_0x456cee){var _0x5227ce={};_0x5227ce[_0x456cee]={'$like':'%'+_0x305738[_0xa1b6('0x48')][_0xa1b6('0x55')]+'%'};return _0x5227ce;})});}_0x3f7aa0=_[_0xa1b6('0x53')]({},_0x3f7aa0,_0x305738[_0xa1b6('0x56')]);return db[_0xa1b6('0x9f')][_0xa1b6('0x34')]({'where':_0x3f7aa0[_0xa1b6('0x52')]})[_0xa1b6('0x24')](function(_0x3f83dd){_0x4c50e3[_0xa1b6('0x34')]=_0x3f83dd;if(_0x305738['query'][_0xa1b6('0x57')]){_0x3f7aa0['include']=[{'model':db[_0xa1b6('0x78')],'as':_0xa1b6('0xc1'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xa1b6('0x3f'),'fullname',_0xa1b6('0xc2')],'required':![]},{'model':db[_0xa1b6('0xc3')],'as':_0xa1b6('0xc4'),'attributes':['id','name','color'],'where':_0x305738[_0xa1b6('0x48')][_0xa1b6('0xc5')]?{'id':_0x305738[_0xa1b6('0x48')][_0xa1b6('0xc5')]}:undefined,'required':_0x305738[_0xa1b6('0x48')][_0xa1b6('0xc5')]?!![]:![]}];}return db[_0xa1b6('0x9f')][_0xa1b6('0x59')](_0x3f7aa0);})['then'](function(_0x27f08b){_0x4c50e3[_0xa1b6('0x5a')]=_0x27f08b;return _0x4c50e3;});}})[_0xa1b6('0x24')](respondWithFilteredResult(_0x51743e,_0x3f7aa0))['catch'](handleError(_0x51743e,null));};exports[_0xa1b6('0xbe')]=function(_0x23dc55,_0xaf1ed8,_0x11e07b){var _0x1d1e5f,_0x33dbf1,_0x5ae226;if(_['isNil'](_0x23dc55[_0xa1b6('0x5f')][_0xa1b6('0x5f')])||_0x23dc55[_0xa1b6('0x5f')]['body']===''){throw new db[(_0xa1b6('0x95'))][(_0xa1b6('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa1b6('0x96')](_0x23dc55[_0xa1b6('0x5f')]['to'])){throw new db[(_0xa1b6('0x95'))][(_0xa1b6('0x79'))]('to\x20is\x20mandatory');}_0x1d1e5f=_0x23dc55[_0xa1b6('0x5f')]['to'];return db[_0xa1b6('0x44')][_0xa1b6('0x5d')]({'where':{'id':_0x23dc55['params']['id']},'include':[{'model':db[_0xa1b6('0x99')],'as':_0xa1b6('0xc6'),'include':[{'model':db[_0xa1b6('0x78')],'as':_0xa1b6('0x9a'),'where':{'mobile':_0x1d1e5f},'limit':0x1,'order':[[_0xa1b6('0x7d'),_0xa1b6('0x9b')]]}]}]})['then'](handleEntityNotFound(_0xaf1ed8,null))['then'](function(_0x32221b){if(_0x32221b&&_0x32221b[_0xa1b6('0xc6')]){_0x33dbf1=_0x32221b[_0xa1b6('0x3b')]({'plain':!![]});if(_0x33dbf1[_0xa1b6('0xc6')]&&_0x33dbf1['List'][_0xa1b6('0x9a')]['length']){return _0x33dbf1[_0xa1b6('0xc6')][_0xa1b6('0x9a')][0x0];}return db[_0xa1b6('0x78')][_0xa1b6('0x5e')](_['defaults'](_0x23dc55[_0xa1b6('0x5f')],{'firstName':_0x1d1e5f,'mobile':_0x1d1e5f,'phone':_0x1d1e5f,'ListId':_0x33dbf1[_0xa1b6('0x7f')]}));}})[_0xa1b6('0x24')](handleEntityNotFound(_0xaf1ed8,null))['then'](function(_0x3b4194){if(_0x3b4194){_0x5ae226=_0x3b4194;return db[_0xa1b6('0x9f')][_0xa1b6('0x5d')]({'where':{'ContactId':_0x5ae226['id'],'closed':![],'SmsAccountId':_0x33dbf1['id']}})['then'](function(_0x523734){if(_0x523734){return[_0x523734,![]];}return db[_0xa1b6('0x9f')]['create']({'UserId':_0x23dc55['user']['id'],'ContactId':_0x5ae226['id'],'SmsAccountId':_0x33dbf1['id'],'phone':_0x1d1e5f,'firstMsgDirection':'out','Messages':[_[_0xa1b6('0x53')](_0x23dc55[_0xa1b6('0x5f')],{'read':![],'body':_0x23dc55[_0xa1b6('0x5f')][_0xa1b6('0x5f')],'phone':_0x1d1e5f,'SmsAccountId':_0x33dbf1['id'],'UserId':_0x23dc55[_0xa1b6('0x60')]['id'],'ContactId':_0x5ae226['id']})]},{'include':[{'model':db[_0xa1b6('0xa6')],'as':_0xa1b6('0xc7')}]})['then'](function(_0xcc52da){return[_0xcc52da,!![]];});});}})['spread'](function(_0x30771b,_0x518c4a){if(_0x518c4a){return _0x30771b;}return db[_0xa1b6('0xa6')]['create'](_[_0xa1b6('0x53')](_0x23dc55[_0xa1b6('0x5f')],{'read':![],'body':_0x23dc55[_0xa1b6('0x5f')][_0xa1b6('0x5f')],'phone':_0x1d1e5f,'SmsAccountId':_0x33dbf1['id'],'SmsInteractionId':_0x30771b['id'],'UserId':_0x23dc55['user']['id'],'ContactId':_0x5ae226['id']}))[_0xa1b6('0x24')](function(_0x20e424){_0x30771b['dataValues'][_0xa1b6('0xc7')]=[];_0x30771b[_0xa1b6('0xc8')][_0xa1b6('0xc7')][_0xa1b6('0xc9')](_0x20e424[_0xa1b6('0xc8')]);return _0x30771b;});})['then'](respondWithResult(_0xaf1ed8,null))['catch'](handleError(_0xaf1ed8,null));};exports['status']=function(_0x161c6a,_0x16536b,_0xdbcb9a){if(_0x161c6a[_0xa1b6('0x5f')]['id']){delete _0x161c6a[_0xa1b6('0x5f')]['id'];}var _0x479f1f,_0x130682,_0x4c071f;return db[_0xa1b6('0x44')][_0xa1b6('0x5d')]({'where':{'id':_0x161c6a[_0xa1b6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x16536b,null))['then'](function(_0x572b69){if(_0x572b69){_0x4c071f=_0x572b69;logger['debug'](_0xa1b6('0x27'),_0xa1b6('0x2f'),_0xa1b6('0xca'),_0x572b69[_0xa1b6('0x46')],util[_0xa1b6('0xcb')](_0x161c6a[_0xa1b6('0x5f')],{'showHidden':![],'depth':null}));switch(_0x572b69[_0xa1b6('0x46')]){case _0xa1b6('0x83'):if(_0x161c6a[_0xa1b6('0x5f')][_0xa1b6('0xcc')]&&_0x161c6a[_0xa1b6('0x5f')][_0xa1b6('0x2f')]){_0x130682=_0x161c6a[_0xa1b6('0x5f')]['status'];return db[_0xa1b6('0xa6')]['find']({'where':{'messageId':_0x161c6a[_0xa1b6('0x5f')][_0xa1b6('0xcc')]}});}break;case'connectel':if(_0x161c6a[_0xa1b6('0x5f')][_0xa1b6('0xcd')]&&_0x161c6a['body']['statusInt']){_0x130682=_0x161c6a[_0xa1b6('0x5f')][_0xa1b6('0xce')];return db['SmsMessage'][_0xa1b6('0x5d')]({'where':{'messageId':_0x161c6a['body'][_0xa1b6('0xcd')]}});}break;case'clicksend':if(_0x161c6a[_0xa1b6('0x5f')][_0xa1b6('0x89')]&&_0x161c6a[_0xa1b6('0x5f')][_0xa1b6('0xcf')]){_0x130682=_0x161c6a['body'][_0xa1b6('0xcf')];return db['SmsMessage'][_0xa1b6('0x5d')]({'where':{'messageId':_0x161c6a[_0xa1b6('0x5f')]['message_id']}});}break;case _0xa1b6('0x8c'):var _0x45c894=_0x161c6a[_0xa1b6('0x5f')][_0xa1b6('0x8d')][0x0];if(_0x45c894[_0xa1b6('0x81')]&&_0x45c894[_0xa1b6('0x2f')][_0xa1b6('0xd0')]===_0xa1b6('0xd1')){_0x130682=_0x45c894['status'][_0xa1b6('0xd0')];return db[_0xa1b6('0xa6')][_0xa1b6('0x5d')]({'where':{'messageId':_0x45c894[_0xa1b6('0x81')]}});}break;case'clickatell':if(_0x161c6a[_0xa1b6('0x5f')]['messageId']&&_0x161c6a[_0xa1b6('0x5f')]['status']){_0x130682=_0x161c6a[_0xa1b6('0x5f')][_0xa1b6('0x2f')];return db[_0xa1b6('0xa6')]['find']({'where':{'messageId':_0x161c6a[_0xa1b6('0x5f')]['messageId']}});}break;case _0xa1b6('0x92'):if(_0x161c6a[_0xa1b6('0x5f')][0x0][_0xa1b6('0x2b')]['id']){_0x130682=_0x161c6a[_0xa1b6('0x5f')][0x0][_0xa1b6('0x46')];return db[_0xa1b6('0xa6')][_0xa1b6('0x5d')]({'where':{'messageId':_0x161c6a['body'][0x0]['message']['id']}});}break;case _0xa1b6('0x93'):if(_0x161c6a[_0xa1b6('0x5f')][_0xa1b6('0xd2')]&&_0x161c6a[_0xa1b6('0x5f')][_0xa1b6('0x2f')]){_0x130682=_0x161c6a[_0xa1b6('0x5f')]['status'];return db[_0xa1b6('0xa6')][_0xa1b6('0x5d')]({'where':{'messageId':_0x161c6a[_0xa1b6('0x5f')][_0xa1b6('0xd2')]}});}break;}}})['then'](handleEntityNotFound(_0x16536b,null))[_0xa1b6('0x24')](function(_0x34bf95){if(_0x34bf95){_0x479f1f=_0x34bf95;switch(_0x4c071f['type']){case _0xa1b6('0x83'):if(_0x130682==='DELIVERED'){return _0x479f1f[_0xa1b6('0xd3')]({'read':!![]});}else{logger[_0xa1b6('0x29')](_0xa1b6('0x27'),_0xa1b6('0x2f'),_0xa1b6('0x83'),util[_0xa1b6('0xcb')](_0x161c6a[_0xa1b6('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xa1b6('0x86'):if(_0x130682==='1'){return _0x479f1f['update']({'read':!![]});}else{logger[_0xa1b6('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa1b6('0x2f'),'skebby',util['inspect'](_0x161c6a['body'],{'showHidden':![],'depth':null}));}break;case _0xa1b6('0x88'):if(!_0x161c6a[_0xa1b6('0x5f')][_0xa1b6('0xd4')]&&_0x130682>=0xc8&&_0x130682<=0xce){return _0x479f1f[_0xa1b6('0xd3')]({'read':!![]});}else{logger[_0xa1b6('0x29')](_0xa1b6('0x27'),'status',_0xa1b6('0x88'),util[_0xa1b6('0xcb')](_0x161c6a[_0xa1b6('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xa1b6('0x8c'):var _0x48527e=_0x161c6a[_0xa1b6('0x5f')][_0xa1b6('0x8d')][0x0];if(_0x48527e[_0xa1b6('0x2f')]['groupName']===_0xa1b6('0xd1')){return _0x479f1f['update']({'read':!![]});}else{logger[_0xa1b6('0x29')](_0xa1b6('0x27'),_0xa1b6('0x2f'),'infobip',util[_0xa1b6('0xcb')](_0x161c6a[_0xa1b6('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xa1b6('0x91'):if(_0x130682==_0xa1b6('0xd5')||_0x130682=='RECEIVED_BY_RECIPIENT'){return _0x479f1f[_0xa1b6('0xd3')]({'read':!![]});}else{logger[_0xa1b6('0x29')](_0xa1b6('0x27'),_0xa1b6('0x2f'),'clickatell',util['inspect'](_0x161c6a[_0xa1b6('0x5f')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x130682==_0xa1b6('0xd6')){return _0x479f1f[_0xa1b6('0xd3')]({'read':!![]});}else{logger[_0xa1b6('0x29')](_0xa1b6('0x27'),'status',_0xa1b6('0x92'),util['inspect'](_0x161c6a['body'],{'showHidden':![],'depth':null}));}break;case _0xa1b6('0x93'):if(_0x130682===_0xa1b6('0xd7')||_0x130682===_0xa1b6('0xd8')){return _0x479f1f[_0xa1b6('0xd3')]({'read':!![]});}else{logger[_0xa1b6('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa1b6('0x2f'),'intelepeer',util['inspect'](_0x161c6a[_0xa1b6('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x479f1f;}})[_0xa1b6('0x24')](respondWithResult(_0x16536b,null))[_0xa1b6('0x2e')](handleError(_0x16536b,null));};exports[_0xa1b6('0xd9')]=function(_0x1faf9d,_0x5aea97,_0x24c189){var _0x449447,_0x16130f,_0xe16bcd;return db['SmsAccount'][_0xa1b6('0x5d')]({'where':{'id':_0x1faf9d[_0xa1b6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5aea97,null))[_0xa1b6('0x24')](function(_0x13be60){if(_0x13be60){_0xe16bcd=_0x13be60;logger['debug'](_0xa1b6('0x27'),_0xa1b6('0x2f'),_0xa1b6('0xca'),_0x13be60[_0xa1b6('0x46')],util[_0xa1b6('0xcb')](_0x1faf9d[_0xa1b6('0x48')],{'showHidden':![],'depth':null}));switch(_0x13be60['type']){case _0xa1b6('0x8e'):if(_0x1faf9d[_0xa1b6('0x48')][_0xa1b6('0xda')]&&_0x1faf9d[_0xa1b6('0x48')][_0xa1b6('0xdb')]){_0x16130f=_0x1faf9d[_0xa1b6('0x48')][_0xa1b6('0xdb')];return db['SmsMessage']['find']({'where':{'messageId':_0x1faf9d[_0xa1b6('0x48')][_0xa1b6('0xda')]}});}break;}}})['then'](handleEntityNotFound(_0x5aea97,null))[_0xa1b6('0x24')](function(_0x31ee87){if(_0x31ee87){_0x449447=_0x31ee87;switch(_0xe16bcd[_0xa1b6('0x46')]){case _0xa1b6('0x8e'):if(_0x16130f==='2'||_0x16130f==='6'){return _0x449447[_0xa1b6('0xd3')]({'read':!![]});}else{logger[_0xa1b6('0x29')](_0xa1b6('0x27'),_0xa1b6('0x2f'),_0xa1b6('0x8e'),util[_0xa1b6('0xcb')](_0x1faf9d[_0xa1b6('0x48')],{'showHidden':![],'depth':null}));};break;}return _0x449447;}})[_0xa1b6('0x24')](respondWithResult(_0x5aea97,null))['catch'](handleError(_0x5aea97,null));};exports[_0xa1b6('0xdc')]=function(_0x42a3f8,_0x3555ae,_0x588bc2){return db[_0xa1b6('0x44')]['find']({'where':{'id':_0x42a3f8[_0xa1b6('0x5c')]['id']}})[_0xa1b6('0x24')](handleEntityNotFound(_0x3555ae,null))['then'](function(_0x529afc){if(_0x529afc){return _0x529afc['addAgents'](_0x42a3f8['body'][_0xa1b6('0x6c')],_[_0xa1b6('0x9d')](_0x42a3f8['body'],[_0xa1b6('0x6c'),'id'])||{})[_0xa1b6('0xa0')](function(_0x3b1baf){for(var _0x234be8=0x0;_0x234be8<_0x42a3f8[_0xa1b6('0x5f')][_0xa1b6('0x6c')][_0xa1b6('0x4e')];_0x234be8+=0x1){socket[_0xa1b6('0xdd')](_0xa1b6('0xde'),{'UserId':Number(_0x42a3f8[_0xa1b6('0x5f')][_0xa1b6('0x6c')][_0x234be8]),'SmsAccountId':Number(_0x42a3f8[_0xa1b6('0x5c')]['id'])});}return _0x3b1baf;});}})[_0xa1b6('0x24')](respondWithResult(_0x3555ae,null))[_0xa1b6('0x2e')](handleError(_0x3555ae,null));};exports[_0xa1b6('0xdf')]=function(_0x1fda8f,_0x33bffc,_0x314061){return db[_0xa1b6('0x44')][_0xa1b6('0x5d')]({'where':{'id':_0x1fda8f[_0xa1b6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x33bffc,null))[_0xa1b6('0x24')](function(_0x4eccf6){if(_0x4eccf6){return _0x4eccf6[_0xa1b6('0xdf')](_0x1fda8f[_0xa1b6('0x48')][_0xa1b6('0x6c')])[_0xa1b6('0x24')](function(){if(_[_0xa1b6('0xe0')](_0x1fda8f[_0xa1b6('0x48')]['ids'])){for(var _0x37017b=0x0;_0x37017b<_0x1fda8f['query']['ids'][_0xa1b6('0x4e')];_0x37017b+=0x1){socket[_0xa1b6('0xdd')](_0xa1b6('0xe1'),{'UserId':Number(_0x1fda8f['query']['ids'][_0x37017b]),'SmsAccountId':Number(_0x1fda8f[_0xa1b6('0x5c')]['id'])});}}else{socket[_0xa1b6('0xdd')](_0xa1b6('0xe1'),{'UserId':Number(_0x1fda8f[_0xa1b6('0x48')][_0xa1b6('0x6c')]),'SmsAccountId':Number(_0x1fda8f[_0xa1b6('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x33bffc,null))[_0xa1b6('0x2e')](handleError(_0x33bffc,null));};exports[_0xa1b6('0xe2')]=function(_0x5ecf25,_0x1232b5,_0x435b2e){var _0x450d3a={};var _0x162b46={};var _0x42f323;var _0x3b577a;return db[_0xa1b6('0x44')][_0xa1b6('0x68')]({'where':{'id':_0x5ecf25[_0xa1b6('0x5c')]['id']}})[_0xa1b6('0x24')](handleEntityNotFound(_0x1232b5,null))[_0xa1b6('0x24')](function(_0x3a77a1){if(_0x3a77a1){_0x42f323=_0x3a77a1;_0x162b46['model']=_[_0xa1b6('0x49')](db[_0xa1b6('0xa9')]['rawAttributes']);_0x162b46[_0xa1b6('0x48')]=_[_0xa1b6('0x49')](_0x5ecf25[_0xa1b6('0x48')]);_0x162b46['filters']=_[_0xa1b6('0x4b')](_0x162b46[_0xa1b6('0x47')],_0x162b46[_0xa1b6('0x48')]);_0x450d3a['attributes']=_[_0xa1b6('0x4b')](_0x162b46[_0xa1b6('0x47')],qs[_0xa1b6('0x4d')](_0x5ecf25[_0xa1b6('0x48')]['fields']));_0x450d3a[_0xa1b6('0x4c')]=_0x450d3a[_0xa1b6('0x4c')][_0xa1b6('0x4e')]?_0x450d3a[_0xa1b6('0x4c')]:_0x162b46[_0xa1b6('0x47')];_0x450d3a[_0xa1b6('0x69')]=qs['sort'](_0x5ecf25[_0xa1b6('0x48')][_0xa1b6('0x51')]);_0x450d3a[_0xa1b6('0x52')]=qs[_0xa1b6('0x4a')](_[_0xa1b6('0x6a')](_0x5ecf25['query'],_0x162b46['filters']));if(_0x5ecf25[_0xa1b6('0x48')][_0xa1b6('0x55')]){_0x450d3a[_0xa1b6('0x52')]=_[_0xa1b6('0x53')](_0x450d3a['where'],{'$or':_['map'](_0x450d3a[_0xa1b6('0x4c')],function(_0x1aad7e){var _0x34d5e8={};_0x34d5e8[_0x1aad7e]={'$like':'%'+_0x5ecf25[_0xa1b6('0x48')][_0xa1b6('0x55')]+'%'};return _0x34d5e8;})});}_0x450d3a=_[_0xa1b6('0x53')]({},_0x450d3a,_0x5ecf25[_0xa1b6('0x56')]);return _0x42f323[_0xa1b6('0xe2')](_0x450d3a);}})[_0xa1b6('0x24')](function(_0x100c4e){if(_0x100c4e){_0x3b577a=_0x100c4e['length'];if(!_0x5ecf25[_0xa1b6('0x48')]['hasOwnProperty']('nolimit')){_0x450d3a[_0xa1b6('0x33')]=qs['limit'](_0x5ecf25[_0xa1b6('0x48')][_0xa1b6('0x33')]);_0x450d3a['offset']=qs[_0xa1b6('0x31')](_0x5ecf25[_0xa1b6('0x48')]['offset']);}return _0x42f323[_0xa1b6('0xe2')](_0x450d3a);}})[_0xa1b6('0x24')](function(_0x2465f7){if(_0x2465f7){return _0x2465f7?{'count':_0x3b577a,'rows':_0x2465f7}:null;}})[_0xa1b6('0x24')](respondWithResult(_0x1232b5,null))['catch'](handleError(_0x1232b5,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 208e8e2..16fe9c3 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 _0x2aff=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x5a1e9e,_0x40e663){var _0x26ece2=function(_0x31c4f6){while(--_0x31c4f6){_0x5a1e9e['push'](_0x5a1e9e['shift']());}};_0x26ece2(++_0x40e663);}(_0x2aff,0xae));var _0xf2af=function(_0x4aa0b2,_0x242da7){_0x4aa0b2=_0x4aa0b2-0x0;var _0x2cfff5=_0x2aff[_0x4aa0b2];return _0x2cfff5;};'use strict';var EventEmitter=require(_0xf2af('0x0'));var SmsAccount=require(_0xf2af('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xf2af('0x2')](0x0);var events={'afterCreate':_0xf2af('0x3'),'afterUpdate':_0xf2af('0x4'),'afterDestroy':_0xf2af('0x5')};function emitEvent(_0x17b5c0){return function(_0x540d32,_0x3a18f5,_0x3f4ab4){SmsAccountEvents[_0xf2af('0x6')](_0x17b5c0+':'+_0x540d32['id'],_0x540d32);SmsAccountEvents[_0xf2af('0x6')](_0x17b5c0,_0x540d32);_0x3f4ab4(null);};}for(var e in events){if(events[_0xf2af('0x7')](e)){var event=events[e];SmsAccount[_0xf2af('0x8')](e,emitEvent(event));}}module[_0xf2af('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0xc02a=['emit','hasOwnProperty','hook','exports','setMaxListeners','save','update','remove'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xc02a,0x64));var _0xac02=function(_0x20d54d,_0x1adc8e){_0x20d54d=_0x20d54d-0x0;var _0x516e8b=_0xc02a[_0x20d54d];return _0x516e8b;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xac02('0x0')](0x0);var events={'afterCreate':_0xac02('0x1'),'afterUpdate':_0xac02('0x2'),'afterDestroy':_0xac02('0x3')};function emitEvent(_0x1e1122){return function(_0xbc4d88,_0x2e7ecc,_0x207871){SmsAccountEvents[_0xac02('0x4')](_0x1e1122+':'+_0xbc4d88['id'],_0xbc4d88);SmsAccountEvents[_0xac02('0x4')](_0x1e1122,_0xbc4d88);_0x207871(null);};}for(var e in events){if(events[_0xac02('0x5')](e)){var event=events[e];SmsAccount[_0xac02('0x6')](e,emitEvent(event));}}module[_0xac02('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index e0d7943..d1a3df0 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 _0x5a09=['path','../../config/environment','SmsAccount','sms_accounts','util','api','moment','bluebird'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x5a09,0x144));var _0x95a0=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x5a09[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var util=require(_0x95a0('0x0'));var logger=require('../../config/logger')(_0x95a0('0x1'));var moment=require(_0x95a0('0x2'));var BPromise=require(_0x95a0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x95a0('0x4'));var rimraf=require('rimraf');var config=require(_0x95a0('0x5'));var attributes=require('./smsAccount.attributes');module['exports']=function(_0x3519b4,_0x33b046){return _0x3519b4['define'](_0x95a0('0x6'),attributes,{'tableName':_0x95a0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f21=['./smsAccount.attributes','define','sms_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x391ba1,_0x56cbfd){var _0x26109c=function(_0x408dd9){while(--_0x408dd9){_0x391ba1['push'](_0x391ba1['shift']());}};_0x26109c(++_0x56cbfd);}(_0x0f21,0x1a7));var _0x10f2=function(_0x1527c8,_0x3b14b9){_0x1527c8=_0x1527c8-0x0;var _0x7c5a60=_0x0f21[_0x1527c8];return _0x7c5a60;};'use strict';var _=require(_0x10f2('0x0'));var util=require(_0x10f2('0x1'));var logger=require('../../config/logger')(_0x10f2('0x2'));var moment=require(_0x10f2('0x3'));var BPromise=require(_0x10f2('0x4'));var rp=require(_0x10f2('0x5'));var fs=require('fs');var path=require(_0x10f2('0x6'));var rimraf=require(_0x10f2('0x7'));var config=require(_0x10f2('0x8'));var attributes=require(_0x10f2('0x9'));module['exports']=function(_0x4de5a6,_0x91271){return _0x4de5a6[_0x10f2('0xa')]('SmsAccount',attributes,{'tableName':_0x10f2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index d207817..5bc7fed 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 _0x3c60=['find','options','raw','where','attributes','include','model','map','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','register','request','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','ShowSmsAccount','SmsAccount'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x3c60,0x18a));var _0x03c6=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x3c60[_0x454165];return _0x56db53;};'use strict';var _=require(_0x03c6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x03c6('0x1'));var rs=require(_0x03c6('0x2'));var fs=require('fs');var Redis=require(_0x03c6('0x3'));var db=require(_0x03c6('0x4'))['db'];var utils=require(_0x03c6('0x5'));var logger=require(_0x03c6('0x6'))(_0x03c6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x03c6('0x8')]=_[_0x03c6('0x9')](config[_0x03c6('0x8')],{'host':_0x03c6('0xa'),'port':0x18eb});var socket=require(_0x03c6('0xb'))(new Redis(config[_0x03c6('0x8')]));require('./smsAccount.socket')[_0x03c6('0xc')](socket);function respondWithRpcPromise(_0x2f3660,_0x2f35f7,_0x4e463a){return new BPromise(function(_0x2155c5,_0x3fd6f2){return client[_0x03c6('0xd')](_0x2f3660,_0x4e463a)['then'](function(_0x15aac2){logger[_0x03c6('0xe')](_0x03c6('0xf'),_0x2f35f7,'request\x20sent');logger[_0x03c6('0x10')](_0x03c6('0x11'),_0x2f35f7,'request\x20sent',JSON['stringify'](_0x15aac2));if(_0x15aac2[_0x03c6('0x12')]){if(_0x15aac2[_0x03c6('0x12')][_0x03c6('0x13')]===0x1f4){logger['error'](_0x03c6('0xf'),_0x2f35f7,_0x15aac2[_0x03c6('0x12')]['message']);return _0x3fd6f2(_0x15aac2[_0x03c6('0x12')][_0x03c6('0x14')]);}logger['error'](_0x03c6('0xf'),_0x2f35f7,_0x15aac2[_0x03c6('0x12')]['message']);return _0x2155c5(_0x15aac2['error'][_0x03c6('0x14')]);}else{logger[_0x03c6('0xe')](_0x03c6('0xf'),_0x2f35f7,_0x03c6('0x15'));_0x2155c5(_0x15aac2[_0x03c6('0x16')]['message']);}})[_0x03c6('0x17')](function(_0xda32e3){logger[_0x03c6('0x12')](_0x03c6('0xf'),_0x2f35f7,_0xda32e3);_0x3fd6f2(_0xda32e3);});});}exports[_0x03c6('0x18')]=function(_0x44c5c6){var _0x10deac=this;return new Promise(function(_0x9dd7b,_0x448d84){return db[_0x03c6('0x19')][_0x03c6('0x1a')]({'raw':_0x44c5c6[_0x03c6('0x1b')]?_0x44c5c6[_0x03c6('0x1b')][_0x03c6('0x1c')]===undefined?!![]:![]:!![],'where':_0x44c5c6[_0x03c6('0x1b')]?_0x44c5c6['options'][_0x03c6('0x1d')]||null:null,'attributes':_0x44c5c6[_0x03c6('0x1b')]?_0x44c5c6[_0x03c6('0x1b')][_0x03c6('0x1e')]||null:null,'include':_0x44c5c6[_0x03c6('0x1b')]?_0x44c5c6[_0x03c6('0x1b')][_0x03c6('0x1f')]?_['map'](_0x44c5c6[_0x03c6('0x1b')][_0x03c6('0x1f')],function(_0x134247){return{'model':db[_0x134247['model']],'as':_0x134247['as'],'attributes':_0x134247['attributes'],'include':_0x134247[_0x03c6('0x1f')]?_['map'](_0x134247[_0x03c6('0x1f')],function(_0x4fb514){return{'model':db[_0x4fb514[_0x03c6('0x20')]],'as':_0x4fb514['as'],'attributes':_0x4fb514['attributes'],'include':_0x4fb514[_0x03c6('0x1f')]?_[_0x03c6('0x21')](_0x4fb514['include'],function(_0x4c83bb){return{'model':db[_0x4c83bb['model']],'as':_0x4c83bb['as'],'attributes':_0x4c83bb[_0x03c6('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34c97e){logger[_0x03c6('0xe')](_0x03c6('0x18'),_0x44c5c6);logger['debug'](_0x03c6('0x18'),_0x44c5c6,JSON[_0x03c6('0x22')](_0x34c97e));_0x9dd7b(_0x34c97e);})[_0x03c6('0x17')](function(_0x496162){logger[_0x03c6('0x12')](_0x03c6('0x18'),_0x496162['message'],_0x44c5c6);_0x448d84(_0x10deac['error'](0x1f4,_0x496162['message']));});});}; \ No newline at end of file +var _0x8a27=['find','options','raw','where','attributes','include','map','model','catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./smsAccount.socket','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','ShowSmsAccount','SmsAccount'];(function(_0x54538f,_0x5b1c97){var _0xcf55cc=function(_0x2f4ae2){while(--_0x2f4ae2){_0x54538f['push'](_0x54538f['shift']());}};_0xcf55cc(++_0x5b1c97);}(_0x8a27,0x1e5));var _0x78a2=function(_0x37d927,_0x340776){_0x37d927=_0x37d927-0x0;var _0xebd484=_0x8a27[_0x37d927];return _0xebd484;};'use strict';var _=require(_0x78a2('0x0'));var util=require('util');var moment=require(_0x78a2('0x1'));var BPromise=require(_0x78a2('0x2'));var rs=require(_0x78a2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78a2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x78a2('0x5'));var config=require(_0x78a2('0x6'));var jayson=require(_0x78a2('0x7'));var client=jayson[_0x78a2('0x8')][_0x78a2('0x9')]({'port':0x232a});config[_0x78a2('0xa')]=_[_0x78a2('0xb')](config[_0x78a2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78a2('0xa')]));require(_0x78a2('0xc'))['register'](socket);function respondWithRpcPromise(_0x4af2b1,_0x3c531a,_0x19aefd){return new BPromise(function(_0x3862d2,_0x191d11){return client[_0x78a2('0xd')](_0x4af2b1,_0x19aefd)[_0x78a2('0xe')](function(_0x5e000a){logger['info'](_0x78a2('0xf'),_0x3c531a,_0x78a2('0x10'));logger['debug'](_0x78a2('0x11'),_0x3c531a,_0x78a2('0x10'),JSON[_0x78a2('0x12')](_0x5e000a));if(_0x5e000a[_0x78a2('0x13')]){if(_0x5e000a[_0x78a2('0x13')]['code']===0x1f4){logger[_0x78a2('0x13')](_0x78a2('0xf'),_0x3c531a,_0x5e000a[_0x78a2('0x13')][_0x78a2('0x14')]);return _0x191d11(_0x5e000a[_0x78a2('0x13')][_0x78a2('0x14')]);}logger[_0x78a2('0x13')](_0x78a2('0xf'),_0x3c531a,_0x5e000a['error'][_0x78a2('0x14')]);return _0x3862d2(_0x5e000a[_0x78a2('0x13')][_0x78a2('0x14')]);}else{logger[_0x78a2('0x15')](_0x78a2('0xf'),_0x3c531a,_0x78a2('0x10'));_0x3862d2(_0x5e000a[_0x78a2('0x16')][_0x78a2('0x14')]);}})['catch'](function(_0x37a1b5){logger['error'](_0x78a2('0xf'),_0x3c531a,_0x37a1b5);_0x191d11(_0x37a1b5);});});}exports[_0x78a2('0x17')]=function(_0x1ea8c9){var _0x8d9342=this;return new Promise(function(_0x4c2854,_0x444568){return db[_0x78a2('0x18')][_0x78a2('0x19')]({'raw':_0x1ea8c9[_0x78a2('0x1a')]?_0x1ea8c9[_0x78a2('0x1a')][_0x78a2('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ea8c9[_0x78a2('0x1a')]?_0x1ea8c9[_0x78a2('0x1a')][_0x78a2('0x1c')]||null:null,'attributes':_0x1ea8c9[_0x78a2('0x1a')]?_0x1ea8c9[_0x78a2('0x1a')][_0x78a2('0x1d')]||null:null,'include':_0x1ea8c9['options']?_0x1ea8c9['options'][_0x78a2('0x1e')]?_[_0x78a2('0x1f')](_0x1ea8c9[_0x78a2('0x1a')][_0x78a2('0x1e')],function(_0x2207e9){return{'model':db[_0x2207e9[_0x78a2('0x20')]],'as':_0x2207e9['as'],'attributes':_0x2207e9[_0x78a2('0x1d')],'include':_0x2207e9[_0x78a2('0x1e')]?_[_0x78a2('0x1f')](_0x2207e9[_0x78a2('0x1e')],function(_0x3d49a6){return{'model':db[_0x3d49a6[_0x78a2('0x20')]],'as':_0x3d49a6['as'],'attributes':_0x3d49a6[_0x78a2('0x1d')],'include':_0x3d49a6[_0x78a2('0x1e')]?_['map'](_0x3d49a6['include'],function(_0x2d9c14){return{'model':db[_0x2d9c14['model']],'as':_0x2d9c14['as'],'attributes':_0x2d9c14['attributes']};}):[]};}):[]};}):[]:[]})[_0x78a2('0xe')](function(_0x361d15){logger[_0x78a2('0x15')]('ShowSmsAccount',_0x1ea8c9);logger['debug'](_0x78a2('0x17'),_0x1ea8c9,JSON[_0x78a2('0x12')](_0x361d15));_0x4c2854(_0x361d15);})[_0x78a2('0x21')](function(_0x47833a){logger[_0x78a2('0x13')](_0x78a2('0x17'),_0x47833a['message'],_0x1ea8c9);_0x444568(_0x8d9342[_0x78a2('0x13')](0x1f4,_0x47833a[_0x78a2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 1134c3d..f4c8412 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 ccb5aaf..817082a 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(_0x489946,_0x54bb3f){var _0x410585=function(_0x355dce){while(--_0x355dce){_0x489946['push'](_0x489946['shift']());}};_0x410585(++_0x54bb3f);}(_0xe14b,0x93));var _0xbe14=function(_0x358642,_0x5666dc){_0x358642=_0x358642-0x0;var _0x4eaea5=_0xe14b[_0x358642];return _0x4eaea5;};'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 _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x3d81a6,_0x4cdd94){var _0x5a3849=function(_0x44946f){while(--_0x44946f){_0x3d81a6['push'](_0x3d81a6['shift']());}};_0x5a3849(++_0x4cdd94);}(_0x008c,0x188));var _0xc008=function(_0x2e030a,_0x8e4c48){_0x2e030a=_0x2e030a-0x0;var _0x597df6=_0x008c[_0x2e030a];return _0x597df6;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index e1cf36b..15469da 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 _0x0f16=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x585d09,_0x1274bc){var _0x7d9a14=function(_0x343d4e){while(--_0x343d4e){_0x585d09['push'](_0x585d09['shift']());}};_0x7d9a14(++_0x1274bc);}(_0x0f16,0x1bb));var _0x60f1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0f16[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x60f1('0x0'));module[_0x60f1('0x1')]={'priority':{'type':Sequelize[_0x60f1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x60f1('0x3')],'allowNull':![],'defaultValue':_0x60f1('0x4')},'appdata':{'type':Sequelize[_0x60f1('0x5')]()},'description':{'type':Sequelize[_0x60f1('0x3')]},'interval':{'type':Sequelize[_0x60f1('0x3')],'defaultValue':_0x60f1('0x6')}}; \ No newline at end of file +var _0xd277=['*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x3e0abf,_0x3b39cd){var _0x57a0ee=function(_0x213852){while(--_0x213852){_0x3e0abf['push'](_0x3e0abf['shift']());}};_0x57a0ee(++_0x3b39cd);}(_0xd277,0xba));var _0x7d27=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd277[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x7d27('0x0'));module[_0x7d27('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7d27('0x2')],'allowNull':![],'defaultValue':_0x7d27('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7d27('0x2')]},'interval':{'type':Sequelize[_0x7d27('0x2')],'defaultValue':_0x7d27('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index e3f2622..fd56a02 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 _0xde12=['fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','then','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','pick','where','VIRTUAL','name','filter','merge','options','includeAll','SmsApplication','findAll','rows','catch','show','params','rawAttributes','include','create','body','find','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x33d617,_0x11e5ef){var _0x2e7741=function(_0x590556){while(--_0x590556){_0x33d617['push'](_0x33d617['shift']());}};_0x2e7741(++_0x11e5ef);}(_0xde12,0x171));var _0x2de1=function(_0x6034f6,_0x243909){_0x6034f6=_0x6034f6-0x0;var _0x2ee72d=_0xde12[_0x6034f6];return _0x2ee72d;};'use strict';var emlformat=require(_0x2de1('0x0'));var rimraf=require(_0x2de1('0x1'));var zipdir=require(_0x2de1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2de1('0x3'));var moment=require('moment');var BPromise=require(_0x2de1('0x4'));var Mustache=require(_0x2de1('0x5'));var util=require(_0x2de1('0x6'));var path=require(_0x2de1('0x7'));var sox=require(_0x2de1('0x8'));var csv=require(_0x2de1('0x9'));var ejs=require(_0x2de1('0xa'));var fs=require('fs');var fs_extra=require(_0x2de1('0xb'));var _=require(_0x2de1('0xc'));var squel=require(_0x2de1('0xd'));var crypto=require(_0x2de1('0xe'));var jsforce=require(_0x2de1('0xf'));var deskjs=require(_0x2de1('0x10'));var toCsv=require(_0x2de1('0x9'));var querystring=require('querystring');var Papa=require(_0x2de1('0x11'));var Redis=require(_0x2de1('0x12'));var authService=require(_0x2de1('0x13'));var qs=require(_0x2de1('0x14'));var as=require(_0x2de1('0x15'));var hardwareService=require(_0x2de1('0x16'));var logger=require(_0x2de1('0x17'))(_0x2de1('0x18'));var utils=require(_0x2de1('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x2de1('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x432462,_0x3490d5){_0x3490d5=_0x3490d5||0xcc;return function(_0x253b9b){if(_0x253b9b){return _0x432462[_0x2de1('0x1b')](_0x3490d5);}return _0x432462[_0x2de1('0x1c')](_0x3490d5)[_0x2de1('0x1d')]();};}function respondWithResult(_0x5a742b,_0x2e5321){_0x2e5321=_0x2e5321||0xc8;return function(_0x4eaa71){if(_0x4eaa71){return _0x5a742b['status'](_0x2e5321)[_0x2de1('0x1e')](_0x4eaa71);}};}function respondWithFilteredResult(_0x5388e4,_0x9e7abc){return function(_0x53296e){if(_0x53296e){var _0x43a944=typeof _0x9e7abc[_0x2de1('0x1f')]===_0x2de1('0x20')&&typeof _0x9e7abc['limit']===_0x2de1('0x20');var _0xecf0e7=_0x53296e['count'];var _0x43b1ab=_0x43a944?0x0:_0x9e7abc[_0x2de1('0x1f')];var _0xc41b59=_0x43a944?_0x53296e[_0x2de1('0x21')]:_0x9e7abc[_0x2de1('0x1f')]+_0x9e7abc['limit'];var _0x3d539f;if(_0xc41b59>=_0xecf0e7){_0xc41b59=_0xecf0e7;_0x3d539f=0xc8;}else{_0x3d539f=0xce;}_0x5388e4['status'](_0x3d539f);return _0x5388e4[_0x2de1('0x22')]('Content-Range',_0x43b1ab+'-'+_0xc41b59+'/'+_0xecf0e7)[_0x2de1('0x1e')](_0x53296e);}return null;};}function patchUpdates(_0x129fe8){return function(_0x474d59){try{jsonpatch[_0x2de1('0x23')](_0x474d59,_0x129fe8,!![]);}catch(_0x3f1a68){return BPromise['reject'](_0x3f1a68);}return _0x474d59[_0x2de1('0x24')]();};}function saveUpdates(_0x3fb4c0,_0x1e7fc7){return function(_0x41a611){if(_0x41a611){return _0x41a611[_0x2de1('0x25')](_0x3fb4c0)[_0x2de1('0x26')](function(_0x58912f){return _0x58912f;});}return null;};}function removeEntity(_0xf7d843,_0x2c786a){return function(_0xe26d8f){if(_0xe26d8f){return _0xe26d8f['destroy']()[_0x2de1('0x26')](function(){_0xf7d843['status'](0xcc)[_0x2de1('0x1d')]();});}};}function handleEntityNotFound(_0x3aa172,_0x30cba6){return function(_0x38a49d){if(!_0x38a49d){_0x3aa172[_0x2de1('0x1b')](0x194);}return _0x38a49d;};}function handleError(_0x5caaa3,_0x19d311){_0x19d311=_0x19d311||0x1f4;return function(_0x5ee704){logger['error'](_0x5ee704['stack']);if(_0x5ee704['name']){delete _0x5ee704['name'];}_0x5caaa3[_0x2de1('0x1c')](_0x19d311)[_0x2de1('0x27')](_0x5ee704);};}exports[_0x2de1('0x28')]=function(_0x45136c,_0x1a43a4){var _0x46dce9={},_0x26e819={},_0x29f91f={'count':0x0,'rows':[]};var _0xbc1bcb=_['map'](db['SmsApplication']['rawAttributes'],function(_0xab267c){return{'name':_0xab267c[_0x2de1('0x29')],'type':_0xab267c[_0x2de1('0x2a')][_0x2de1('0x2b')]};});_0x26e819[_0x2de1('0x2c')]=_[_0x2de1('0x2d')](_0xbc1bcb,'name');_0x26e819[_0x2de1('0x2e')]=_[_0x2de1('0x2f')](_0x45136c[_0x2de1('0x2e')]);_0x26e819[_0x2de1('0x30')]=_[_0x2de1('0x31')](_0x26e819[_0x2de1('0x2c')],_0x26e819[_0x2de1('0x2e')]);_0x46dce9[_0x2de1('0x32')]=_[_0x2de1('0x31')](_0x26e819[_0x2de1('0x2c')],qs['fields'](_0x45136c[_0x2de1('0x2e')][_0x2de1('0x33')]));_0x46dce9[_0x2de1('0x32')]=_0x46dce9[_0x2de1('0x32')][_0x2de1('0x34')]?_0x46dce9['attributes']:_0x26e819[_0x2de1('0x2c')];if(!_0x45136c[_0x2de1('0x2e')][_0x2de1('0x35')](_0x2de1('0x36'))){_0x46dce9[_0x2de1('0x37')]=qs[_0x2de1('0x37')](_0x45136c[_0x2de1('0x2e')][_0x2de1('0x37')]);_0x46dce9[_0x2de1('0x1f')]=qs[_0x2de1('0x1f')](_0x45136c[_0x2de1('0x2e')]['offset']);}_0x46dce9['order']=qs['sort'](_0x45136c['query']['sort']);_0x46dce9['where']=qs[_0x2de1('0x30')](_[_0x2de1('0x38')](_0x45136c[_0x2de1('0x2e')],_0x26e819[_0x2de1('0x30')]),_0xbc1bcb);if(_0x45136c[_0x2de1('0x2e')]['filter']){_0x46dce9['where']=_['merge'](_0x46dce9[_0x2de1('0x39')],{'$or':_[_0x2de1('0x2d')](_0xbc1bcb,function(_0x5a61ea){if(_0x5a61ea['type']!==_0x2de1('0x3a')){var _0x3d540e={};_0x3d540e[_0x5a61ea[_0x2de1('0x3b')]]={'$like':'%'+_0x45136c[_0x2de1('0x2e')][_0x2de1('0x3c')]+'%'};return _0x3d540e;}})});}_0x46dce9=_[_0x2de1('0x3d')]({},_0x46dce9,_0x45136c[_0x2de1('0x3e')]);var _0xcf4061={'where':_0x46dce9[_0x2de1('0x39')]};return db['SmsApplication'][_0x2de1('0x21')](_0xcf4061)['then'](function(_0x121997){_0x29f91f[_0x2de1('0x21')]=_0x121997;if(_0x45136c[_0x2de1('0x2e')][_0x2de1('0x3f')]){_0x46dce9['include']=[{'all':!![]}];}return db[_0x2de1('0x40')][_0x2de1('0x41')](_0x46dce9);})[_0x2de1('0x26')](function(_0x1db490){_0x29f91f[_0x2de1('0x42')]=_0x1db490;return _0x29f91f;})[_0x2de1('0x26')](respondWithFilteredResult(_0x1a43a4,_0x46dce9))[_0x2de1('0x43')](handleError(_0x1a43a4,null));};exports[_0x2de1('0x44')]=function(_0x341657,_0x5b971d){var _0x78173e={'raw':!![],'where':{'id':_0x341657[_0x2de1('0x45')]['id']}},_0x52638c={};_0x52638c['model']=_[_0x2de1('0x2f')](db[_0x2de1('0x40')][_0x2de1('0x46')]);_0x52638c['query']=_['keys'](_0x341657['query']);_0x52638c[_0x2de1('0x30')]=_['intersection'](_0x52638c['model'],_0x52638c[_0x2de1('0x2e')]);_0x78173e[_0x2de1('0x32')]=_['intersection'](_0x52638c[_0x2de1('0x2c')],qs[_0x2de1('0x33')](_0x341657[_0x2de1('0x2e')][_0x2de1('0x33')]));_0x78173e[_0x2de1('0x32')]=_0x78173e[_0x2de1('0x32')][_0x2de1('0x34')]?_0x78173e['attributes']:_0x52638c[_0x2de1('0x2c')];if(_0x341657[_0x2de1('0x2e')]['includeAll']){_0x78173e[_0x2de1('0x47')]=[{'all':!![]}];}_0x78173e=_['merge']({},_0x78173e,_0x341657[_0x2de1('0x3e')]);return db[_0x2de1('0x40')]['find'](_0x78173e)[_0x2de1('0x26')](handleEntityNotFound(_0x5b971d,null))[_0x2de1('0x26')](respondWithResult(_0x5b971d,null))[_0x2de1('0x43')](handleError(_0x5b971d,null));};exports[_0x2de1('0x48')]=function(_0x5ade85,_0x4bf91e){return db[_0x2de1('0x40')][_0x2de1('0x48')](_0x5ade85[_0x2de1('0x49')],{})[_0x2de1('0x26')](respondWithResult(_0x4bf91e,0xc9))['catch'](handleError(_0x4bf91e,null));};exports[_0x2de1('0x25')]=function(_0x22db44,_0x21aae7){if(_0x22db44['body']['id']){delete _0x22db44['body']['id'];}return db[_0x2de1('0x40')][_0x2de1('0x4a')]({'where':{'id':_0x22db44[_0x2de1('0x45')]['id']}})['then'](handleEntityNotFound(_0x21aae7,null))[_0x2de1('0x26')](saveUpdates(_0x22db44[_0x2de1('0x49')],null))[_0x2de1('0x26')](respondWithResult(_0x21aae7,null))[_0x2de1('0x43')](handleError(_0x21aae7,null));};exports[_0x2de1('0x4b')]=function(_0x462e15,_0x55f2a5){return db['SmsApplication'][_0x2de1('0x4a')]({'where':{'id':_0x462e15[_0x2de1('0x45')]['id']}})[_0x2de1('0x26')](handleEntityNotFound(_0x55f2a5,null))[_0x2de1('0x26')](removeEntity(_0x55f2a5,null))['catch'](handleError(_0x55f2a5,null));}; \ No newline at end of file +var _0x5be8=['include','SmsApplication','findAll','create','body','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','undefined','limit','count','offset','set','json','apply','save','update','destroy','then','status','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll'];(function(_0x392f52,_0x187472){var _0x244b1e=function(_0x3dcff9){while(--_0x3dcff9){_0x392f52['push'](_0x392f52['shift']());}};_0x244b1e(++_0x187472);}(_0x5be8,0x1c4));var _0x85be=function(_0x4d2db5,_0x1be7ed){_0x4d2db5=_0x4d2db5-0x0;var _0x249c19=_0x5be8[_0x4d2db5];return _0x249c19;};'use strict';var emlformat=require(_0x85be('0x0'));var rimraf=require(_0x85be('0x1'));var zipdir=require(_0x85be('0x2'));var jsonpatch=require(_0x85be('0x3'));var rp=require('request-promise');var moment=require(_0x85be('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x85be('0x5'));var util=require(_0x85be('0x6'));var path=require(_0x85be('0x7'));var sox=require(_0x85be('0x8'));var csv=require(_0x85be('0x9'));var ejs=require(_0x85be('0xa'));var fs=require('fs');var fs_extra=require(_0x85be('0xb'));var _=require('lodash');var squel=require(_0x85be('0xc'));var crypto=require(_0x85be('0xd'));var jsforce=require(_0x85be('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85be('0x9'));var querystring=require(_0x85be('0xf'));var Papa=require(_0x85be('0x10'));var Redis=require(_0x85be('0x11'));var authService=require(_0x85be('0x12'));var qs=require(_0x85be('0x13'));var as=require(_0x85be('0x14'));var hardwareService=require(_0x85be('0x15'));var logger=require(_0x85be('0x16'))(_0x85be('0x17'));var utils=require(_0x85be('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x85be('0x19'));var db=require(_0x85be('0x1a'))['db'];function respondWithStatusCode(_0x4e4f8a,_0x30284d){_0x30284d=_0x30284d||0xcc;return function(_0xb22e9){if(_0xb22e9){return _0x4e4f8a[_0x85be('0x1b')](_0x30284d);}return _0x4e4f8a['status'](_0x30284d)['end']();};}function respondWithResult(_0x44d8e5,_0x2e080f){_0x2e080f=_0x2e080f||0xc8;return function(_0x391cd2){if(_0x391cd2){return _0x44d8e5['status'](_0x2e080f)['json'](_0x391cd2);}};}function respondWithFilteredResult(_0x4338b5,_0x140d12){return function(_0x4d4a97){if(_0x4d4a97){var _0x331af5=typeof _0x140d12['offset']===_0x85be('0x1c')&&typeof _0x140d12[_0x85be('0x1d')]==='undefined';var _0x2876d6=_0x4d4a97[_0x85be('0x1e')];var _0xc3441d=_0x331af5?0x0:_0x140d12[_0x85be('0x1f')];var _0x3214c6=_0x331af5?_0x4d4a97[_0x85be('0x1e')]:_0x140d12[_0x85be('0x1f')]+_0x140d12[_0x85be('0x1d')];var _0x5c51a2;if(_0x3214c6>=_0x2876d6){_0x3214c6=_0x2876d6;_0x5c51a2=0xc8;}else{_0x5c51a2=0xce;}_0x4338b5['status'](_0x5c51a2);return _0x4338b5[_0x85be('0x20')]('Content-Range',_0xc3441d+'-'+_0x3214c6+'/'+_0x2876d6)[_0x85be('0x21')](_0x4d4a97);}return null;};}function patchUpdates(_0x4efd96){return function(_0x21c6a0){try{jsonpatch[_0x85be('0x22')](_0x21c6a0,_0x4efd96,!![]);}catch(_0x15aa6a){return BPromise['reject'](_0x15aa6a);}return _0x21c6a0[_0x85be('0x23')]();};}function saveUpdates(_0x56c31f,_0x3bf9d2){return function(_0x425a){if(_0x425a){return _0x425a[_0x85be('0x24')](_0x56c31f)['then'](function(_0x1e6184){return _0x1e6184;});}return null;};}function removeEntity(_0x511bd2,_0x40e7dc){return function(_0x220f5e){if(_0x220f5e){return _0x220f5e[_0x85be('0x25')]()[_0x85be('0x26')](function(){_0x511bd2[_0x85be('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c96d6,_0x4bdf06){return function(_0x263d53){if(!_0x263d53){_0x2c96d6[_0x85be('0x1b')](0x194);}return _0x263d53;};}function handleError(_0x116b12,_0x51b521){_0x51b521=_0x51b521||0x1f4;return function(_0xbeabc9){logger[_0x85be('0x28')](_0xbeabc9[_0x85be('0x29')]);if(_0xbeabc9[_0x85be('0x2a')]){delete _0xbeabc9[_0x85be('0x2a')];}_0x116b12[_0x85be('0x27')](_0x51b521)['send'](_0xbeabc9);};}exports[_0x85be('0x2b')]=function(_0x1feca5,_0x761df7){var _0x564fa2={},_0x1d4604={},_0x3b66b3={'count':0x0,'rows':[]};var _0x57177f=_[_0x85be('0x2c')](db['SmsApplication'][_0x85be('0x2d')],function(_0x1aaa05){return{'name':_0x1aaa05[_0x85be('0x2e')],'type':_0x1aaa05[_0x85be('0x2f')][_0x85be('0x30')]};});_0x1d4604['model']=_[_0x85be('0x2c')](_0x57177f,_0x85be('0x2a'));_0x1d4604[_0x85be('0x31')]=_[_0x85be('0x32')](_0x1feca5['query']);_0x1d4604['filters']=_[_0x85be('0x33')](_0x1d4604[_0x85be('0x34')],_0x1d4604[_0x85be('0x31')]);_0x564fa2[_0x85be('0x35')]=_['intersection'](_0x1d4604[_0x85be('0x34')],qs[_0x85be('0x36')](_0x1feca5[_0x85be('0x31')][_0x85be('0x36')]));_0x564fa2['attributes']=_0x564fa2[_0x85be('0x35')][_0x85be('0x37')]?_0x564fa2['attributes']:_0x1d4604[_0x85be('0x34')];if(!_0x1feca5[_0x85be('0x31')][_0x85be('0x38')]('nolimit')){_0x564fa2[_0x85be('0x1d')]=qs[_0x85be('0x1d')](_0x1feca5[_0x85be('0x31')]['limit']);_0x564fa2[_0x85be('0x1f')]=qs['offset'](_0x1feca5[_0x85be('0x31')][_0x85be('0x1f')]);}_0x564fa2['order']=qs[_0x85be('0x39')](_0x1feca5[_0x85be('0x31')]['sort']);_0x564fa2[_0x85be('0x3a')]=qs[_0x85be('0x3b')](_[_0x85be('0x3c')](_0x1feca5[_0x85be('0x31')],_0x1d4604[_0x85be('0x3b')]),_0x57177f);if(_0x1feca5[_0x85be('0x31')]['filter']){_0x564fa2[_0x85be('0x3a')]=_[_0x85be('0x3d')](_0x564fa2['where'],{'$or':_[_0x85be('0x2c')](_0x57177f,function(_0x1da49f){if(_0x1da49f['type']!==_0x85be('0x3e')){var _0x43c9a6={};_0x43c9a6[_0x1da49f[_0x85be('0x2a')]]={'$like':'%'+_0x1feca5[_0x85be('0x31')][_0x85be('0x3f')]+'%'};return _0x43c9a6;}})});}_0x564fa2=_[_0x85be('0x3d')]({},_0x564fa2,_0x1feca5[_0x85be('0x40')]);var _0x1af96e={'where':_0x564fa2[_0x85be('0x3a')]};return db['SmsApplication'][_0x85be('0x1e')](_0x1af96e)[_0x85be('0x26')](function(_0xfa5a38){_0x3b66b3[_0x85be('0x1e')]=_0xfa5a38;if(_0x1feca5[_0x85be('0x31')][_0x85be('0x41')]){_0x564fa2[_0x85be('0x42')]=[{'all':!![]}];}return db[_0x85be('0x43')][_0x85be('0x44')](_0x564fa2);})['then'](function(_0x18a766){_0x3b66b3['rows']=_0x18a766;return _0x3b66b3;})[_0x85be('0x26')](respondWithFilteredResult(_0x761df7,_0x564fa2))['catch'](handleError(_0x761df7,null));};exports['show']=function(_0x38d7cb,_0x325429){var _0x380ff6={'raw':!![],'where':{'id':_0x38d7cb['params']['id']}},_0x569bc2={};_0x569bc2['model']=_[_0x85be('0x32')](db[_0x85be('0x43')]['rawAttributes']);_0x569bc2[_0x85be('0x31')]=_[_0x85be('0x32')](_0x38d7cb[_0x85be('0x31')]);_0x569bc2[_0x85be('0x3b')]=_[_0x85be('0x33')](_0x569bc2[_0x85be('0x34')],_0x569bc2[_0x85be('0x31')]);_0x380ff6[_0x85be('0x35')]=_[_0x85be('0x33')](_0x569bc2[_0x85be('0x34')],qs[_0x85be('0x36')](_0x38d7cb[_0x85be('0x31')][_0x85be('0x36')]));_0x380ff6[_0x85be('0x35')]=_0x380ff6[_0x85be('0x35')]['length']?_0x380ff6[_0x85be('0x35')]:_0x569bc2['model'];if(_0x38d7cb[_0x85be('0x31')][_0x85be('0x41')]){_0x380ff6['include']=[{'all':!![]}];}_0x380ff6=_[_0x85be('0x3d')]({},_0x380ff6,_0x38d7cb['options']);return db['SmsApplication']['find'](_0x380ff6)[_0x85be('0x26')](handleEntityNotFound(_0x325429,null))['then'](respondWithResult(_0x325429,null))['catch'](handleError(_0x325429,null));};exports[_0x85be('0x45')]=function(_0x204b7a,_0x5b044b){return db[_0x85be('0x43')][_0x85be('0x45')](_0x204b7a[_0x85be('0x46')],{})[_0x85be('0x26')](respondWithResult(_0x5b044b,0xc9))['catch'](handleError(_0x5b044b,null));};exports[_0x85be('0x24')]=function(_0x45a0b1,_0xf03a3){if(_0x45a0b1[_0x85be('0x46')]['id']){delete _0x45a0b1[_0x85be('0x46')]['id'];}return db['SmsApplication'][_0x85be('0x47')]({'where':{'id':_0x45a0b1[_0x85be('0x48')]['id']}})[_0x85be('0x26')](handleEntityNotFound(_0xf03a3,null))[_0x85be('0x26')](saveUpdates(_0x45a0b1[_0x85be('0x46')],null))[_0x85be('0x26')](respondWithResult(_0xf03a3,null))[_0x85be('0x49')](handleError(_0xf03a3,null));};exports['destroy']=function(_0x14965d,_0x4d34a4){return db[_0x85be('0x43')][_0x85be('0x47')]({'where':{'id':_0x14965d[_0x85be('0x48')]['id']}})[_0x85be('0x26')](handleEntityNotFound(_0x4d34a4,null))[_0x85be('0x26')](removeEntity(_0x4d34a4,null))['catch'](handleError(_0x4d34a4,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 4d5ab85..cac2e59 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 _0xa081=['utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4'];(function(_0x45e852,_0x44e710){var _0x58cc18=function(_0x403e30){while(--_0x403e30){_0x45e852['push'](_0x45e852['shift']());}};_0x58cc18(++_0x44e710);}(_0xa081,0x146));var _0x1a08=function(_0x5853f4,_0x3da163){_0x5853f4=_0x5853f4-0x0;var _0x52aac7=_0xa081[_0x5853f4];return _0x52aac7;};'use strict';var _=require(_0x1a08('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1a08('0x1'));var BPromise=require(_0x1a08('0x2'));var rp=require(_0x1a08('0x3'));var fs=require('fs');var path=require(_0x1a08('0x4'));var rimraf=require(_0x1a08('0x5'));var config=require(_0x1a08('0x6'));var attributes=require('./smsApplication.attributes');module[_0x1a08('0x7')]=function(_0x4ae349,_0x5ac2d5){return _0x4ae349[_0x1a08('0x8')](_0x1a08('0x9'),attributes,{'tableName':_0x1a08('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1a08('0xb'),'collate':_0x1a08('0xc')});}; \ No newline at end of file +var _0xdf32=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x284d70,_0x4e5330){var _0x5a40f8=function(_0x5507e7){while(--_0x5507e7){_0x284d70['push'](_0x284d70['shift']());}};_0x5a40f8(++_0x4e5330);}(_0xdf32,0x1bc));var _0x2df3=function(_0x440f38,_0x44b431){_0x440f38=_0x440f38-0x0;var _0x4c7dc3=_0xdf32[_0x440f38];return _0x4c7dc3;};'use strict';var _=require('lodash');var util=require(_0x2df3('0x0'));var logger=require(_0x2df3('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2df3('0x2'));var rp=require(_0x2df3('0x3'));var fs=require('fs');var path=require(_0x2df3('0x4'));var rimraf=require('rimraf');var config=require(_0x2df3('0x5'));var attributes=require(_0x2df3('0x6'));module['exports']=function(_0x59f444,_0xc91c){return _0x59f444[_0x2df3('0x7')](_0x2df3('0x8'),attributes,{'tableName':_0x2df3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2df3('0xa'),'collate':_0x2df3('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 80ee55d..e101e8f 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 _0x0b0e=['SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','debug'];(function(_0x4e0a03,_0x5eb6b0){var _0x2478fc=function(_0x59afcc){while(--_0x59afcc){_0x4e0a03['push'](_0x4e0a03['shift']());}};_0x2478fc(++_0x5eb6b0);}(_0x0b0e,0x187));var _0xe0b0=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x0b0e[_0x11005e];return _0x29338f;};'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});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('SmsApplication,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file +var _0x676c=['then','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','SmsApplication,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x29f8da,_0x2622a){var _0x12e682=function(_0x166800){while(--_0x166800){_0x29f8da['push'](_0x29f8da['shift']());}};_0x12e682(++_0x2622a);}(_0x676c,0x198));var _0xc676=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x676c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc676('0x0'));var util=require(_0xc676('0x1'));var moment=require(_0xc676('0x2'));var BPromise=require('bluebird');var rs=require(_0xc676('0x3'));var fs=require('fs');var Redis=require(_0xc676('0x4'));var db=require(_0xc676('0x5'))['db'];var utils=require(_0xc676('0x6'));var logger=require(_0xc676('0x7'))(_0xc676('0x8'));var config=require('../../config/environment');var jayson=require(_0xc676('0x9'));var client=jayson[_0xc676('0xa')][_0xc676('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c7510,_0x36fa26,_0x4a71a8){return new BPromise(function(_0x26ad9c,_0x5e8ad4){return client['request'](_0x2c7510,_0x4a71a8)[_0xc676('0xc')](function(_0x27912c){logger['info']('SmsApplication,\x20%s,\x20%s',_0x36fa26,_0xc676('0xd'));logger[_0xc676('0xe')](_0xc676('0xf'),_0x36fa26,'request\x20sent',JSON['stringify'](_0x27912c));if(_0x27912c[_0xc676('0x10')]){if(_0x27912c[_0xc676('0x10')][_0xc676('0x11')]===0x1f4){logger[_0xc676('0x10')]('SmsApplication,\x20%s,\x20%s',_0x36fa26,_0x27912c[_0xc676('0x10')][_0xc676('0x12')]);return _0x5e8ad4(_0x27912c[_0xc676('0x10')][_0xc676('0x12')]);}logger[_0xc676('0x10')](_0xc676('0x13'),_0x36fa26,_0x27912c[_0xc676('0x10')]['message']);return _0x26ad9c(_0x27912c[_0xc676('0x10')]['message']);}else{logger['info'](_0xc676('0x13'),_0x36fa26,'request\x20sent');_0x26ad9c(_0x27912c['result']['message']);}})[_0xc676('0x14')](function(_0x4ee99d){logger[_0xc676('0x10')](_0xc676('0x13'),_0x36fa26,_0x4ee99d);_0x5e8ad4(_0x4ee99d);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 8022273..3e71904 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 _0xb03e=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags'];(function(_0x2c3e67,_0x44efab){var _0x49b190=function(_0x273837){while(--_0x273837){_0x2c3e67['push'](_0x2c3e67['shift']());}};_0x49b190(++_0x44efab);}(_0xb03e,0x1eb));var _0xeb03=function(_0x587fae,_0xaf26a7){_0x587fae=_0x587fae-0x0;var _0x3b2604=_0xb03e[_0x587fae];return _0x3b2604;};'use strict';var multer=require('multer');var util=require(_0xeb03('0x0'));var path=require(_0xeb03('0x1'));var timeout=require(_0xeb03('0x2'));var express=require(_0xeb03('0x3'));var router=express[_0xeb03('0x4')]();var fs_extra=require(_0xeb03('0x5'));var auth=require(_0xeb03('0x6'));var interaction=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var controller=require(_0xeb03('0x9'));router[_0xeb03('0xa')]('/',auth[_0xeb03('0xb')](),controller['index']);router[_0xeb03('0xa')](_0xeb03('0xc'),auth[_0xeb03('0xb')](),controller[_0xeb03('0xd')]);router[_0xeb03('0xa')](_0xeb03('0xe'),auth['isAuthenticated'](),controller[_0xeb03('0xf')]);router[_0xeb03('0xa')](_0xeb03('0x10'),auth['isAuthenticated'](),controller[_0xeb03('0x11')]);router['get'](_0xeb03('0x12'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x13')]);router[_0xeb03('0x14')]('/',auth[_0xeb03('0xb')](),controller[_0xeb03('0x15')]);router[_0xeb03('0x14')](_0xeb03('0x10'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x16')]);router[_0xeb03('0x14')](_0xeb03('0x17'),auth['isAuthenticated'](),interaction[_0xeb03('0x18')](_0xeb03('0x19'),_0xeb03('0x1a')),controller[_0xeb03('0x1b')]);router['put'](_0xeb03('0xe'),auth[_0xeb03('0xb')](),interaction[_0xeb03('0x18')]('sms',_0xeb03('0x1c')),controller[_0xeb03('0x1d')]);router[_0xeb03('0x1e')](_0xeb03('0xe'),auth[_0xeb03('0xb')](),interaction[_0xeb03('0x18')](_0xeb03('0x19'),_0xeb03('0x1f')),controller[_0xeb03('0x20')]);router[_0xeb03('0x1e')](_0xeb03('0x17'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x21')]);module[_0xeb03('0x22')]=router; \ No newline at end of file +var _0xf4f4=['/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','post','create','tracked','sms','smsinteraction:addtags','put','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy'];(function(_0x18947c,_0xa391b){var _0x5ed660=function(_0xc775cd){while(--_0xc775cd){_0x18947c['push'](_0x18947c['shift']());}};_0x5ed660(++_0xa391b);}(_0xf4f4,0xe3));var _0x4f4f=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0xf4f4[_0xdd2bfa];return _0x55397e;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./smsInteraction.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0x8')]('/:id',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xd')]);router[_0x4f4f('0x8')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xf')]);router[_0x4f4f('0x8')](_0x4f4f('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x4f4f('0x11')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x12')]);router[_0x4f4f('0x11')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller['addMessage']);router[_0x4f4f('0x11')]('/:id/tags',auth[_0x4f4f('0x9')](),interaction[_0x4f4f('0x13')](_0x4f4f('0x14'),_0x4f4f('0x15')),controller['addTags']);router[_0x4f4f('0x16')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x4f4f('0x14'),_0x4f4f('0x17')),controller[_0x4f4f('0x18')]);router[_0x4f4f('0x19')](_0x4f4f('0x1a'),auth[_0x4f4f('0x9')](),interaction[_0x4f4f('0x13')](_0x4f4f('0x14'),_0x4f4f('0x1b')),controller[_0x4f4f('0x1c')]);router[_0x4f4f('0x19')](_0x4f4f('0x1d'),auth['isAuthenticated'](),controller[_0x4f4f('0x1e')]);module[_0x4f4f('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 288fee1..8d1ffec 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 _0xe292=['exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x4b0e72,_0x35b9f8){var _0x1aa516=function(_0xd35b70){while(--_0xd35b70){_0x4b0e72['push'](_0x4b0e72['shift']());}};_0x1aa516(++_0x35b9f8);}(_0xe292,0x19e));var _0x2e29=function(_0x3c1dda,_0x36e64c){_0x3c1dda=_0x3c1dda-0x0;var _0x3481ba=_0xe292[_0x3c1dda];return _0x3481ba;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x2e29('0x0')]={'closed':{'type':Sequelize[_0x2e29('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2e29('0x2')]},'thirdDisposition':{'type':Sequelize[_0x2e29('0x2')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2e29('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2e29('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2e29('0x4')]('in',_0x2e29('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2e29('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x2e88=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x42b5bc,_0x5199cc){var _0x3da972=function(_0x465040){while(--_0x465040){_0x42b5bc['push'](_0x42b5bc['shift']());}};_0x3da972(++_0x5199cc);}(_0x2e88,0x95));var _0x82e8=function(_0x5d8631,_0x44944b){_0x5d8631=_0x5d8631-0x0;var _0x34c15e=_0x2e88[_0x5d8631];return _0x34c15e;};'use strict';var Sequelize=require(_0x82e8('0x0'));var moment=require(_0x82e8('0x1'));module[_0x82e8('0x2')]={'closed':{'type':Sequelize[_0x82e8('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x82e8('0x4')]},'disposition':{'type':Sequelize[_0x82e8('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x82e8('0x5')]},'note':{'type':Sequelize[_0x82e8('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x82e8('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x82e8('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x82e8('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x82e8('0x6')]('in',_0x82e8('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x82e8('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 49f2012..4b57708 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 _0xbdeb=['unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','Messages','secret','read','SmsAccount','Account','Owner','mkdirSync','Sms','createdAt','closedAt','disposition','out','System','lastName','direction','views','transcript-','.pdf','log','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','Users','map','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','total','closed','UserId','unmanaged','SmsInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','field','color','tools_tags','select','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','sms_interactions','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','having','`\x20=\x200','`\x20>\x200','Contact','$substring','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','buildExpression','type','body','some','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','group','Sequelize','SELECT','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','params','includeAll','include','options','create','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','hasOwnProperty','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','emit','smsInteractionTags:save','download'];(function(_0x2c3255,_0x4e00ae){var _0x282aba=function(_0x5721d5){while(--_0x5721d5){_0x2c3255['push'](_0x2c3255['shift']());}};_0x282aba(++_0x4e00ae);}(_0xbdeb,0x1ef));var _0xbbde=function(_0x9b5c26,_0x598ff0){_0x9b5c26=_0x9b5c26-0x0;var _0x52d62c=_0xbdeb[_0x9b5c26];return _0x52d62c;};'use strict';var emlformat=require(_0xbbde('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbbde('0x1'));var jsonpatch=require(_0xbbde('0x2'));var rp=require(_0xbbde('0x3'));var moment=require(_0xbbde('0x4'));var BPromise=require(_0xbbde('0x5'));var Mustache=require(_0xbbde('0x6'));var util=require('util');var path=require(_0xbbde('0x7'));var sox=require(_0xbbde('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbbde('0x9'));var _=require(_0xbbde('0xa'));var squel=require('squel');var crypto=require(_0xbbde('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbbde('0xc'));var toCsv=require(_0xbbde('0xd'));var querystring=require('querystring');var Papa=require(_0xbbde('0xe'));var Redis=require(_0xbbde('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbbde('0x10'));var as=require(_0xbbde('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xbbde('0x12'));var logger=require(_0xbbde('0x13'))(_0xbbde('0x14'));var utils=require(_0xbbde('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbbde('0x16'));var db=require(_0xbbde('0x17'))['db'];config[_0xbbde('0x18')]=_[_0xbbde('0x19')](config[_0xbbde('0x18')],{'host':_0xbbde('0x1a'),'port':0x18eb});var socket=require(_0xbbde('0x1b'))(new Redis(config[_0xbbde('0x18')]));require(_0xbbde('0x1c'))[_0xbbde('0x1d')](socket);function respondWithStatusCode(_0x3497c8,_0x1884f8){_0x1884f8=_0x1884f8||0xcc;return function(_0x2c666a){if(_0x2c666a){return _0x3497c8[_0xbbde('0x1e')](_0x1884f8);}return _0x3497c8[_0xbbde('0x1f')](_0x1884f8)[_0xbbde('0x20')]();};}function respondWithResult(_0x27395e,_0x290c91){_0x290c91=_0x290c91||0xc8;return function(_0xdb593d){if(_0xdb593d){return _0x27395e['status'](_0x290c91)[_0xbbde('0x21')](_0xdb593d);}};}function respondWithFilteredResult(_0x2ece4c,_0x44ce75){return function(_0x51b544){if(_0x51b544){var _0xb50553=typeof _0x44ce75[_0xbbde('0x22')]==='undefined'&&typeof _0x44ce75[_0xbbde('0x23')]===_0xbbde('0x24');var _0x4f4b6b=_0x51b544[_0xbbde('0x25')];var _0x36d0db=_0xb50553?0x0:_0x44ce75[_0xbbde('0x22')];var _0x293df6=_0xb50553?_0x51b544['count']:_0x44ce75[_0xbbde('0x22')]+_0x44ce75[_0xbbde('0x23')];var _0x3107b4;if(_0x293df6>=_0x4f4b6b){_0x293df6=_0x4f4b6b;_0x3107b4=0xc8;}else{_0x3107b4=0xce;}_0x2ece4c[_0xbbde('0x1f')](_0x3107b4);return _0x2ece4c[_0xbbde('0x26')](_0xbbde('0x27'),_0x36d0db+'-'+_0x293df6+'/'+_0x4f4b6b)[_0xbbde('0x21')](_0x51b544);}return null;};}function patchUpdates(_0x58c46b){return function(_0x452c51){try{jsonpatch['apply'](_0x452c51,_0x58c46b,!![]);}catch(_0xecc3d6){return BPromise[_0xbbde('0x28')](_0xecc3d6);}return _0x452c51[_0xbbde('0x29')]();};}function saveUpdates(_0x95cf7f,_0x11dcc4){return function(_0x43ddef){if(_0x43ddef){return _0x43ddef[_0xbbde('0x2a')](_0x95cf7f)[_0xbbde('0x2b')](function(_0x11c87e){return _0x11c87e;});}return null;};}function removeEntity(_0x708e95,_0x2670f3){return function(_0x1001ad){if(_0x1001ad){return _0x1001ad[_0xbbde('0x2c')]()[_0xbbde('0x2b')](function(){_0x708e95[_0xbbde('0x1f')](0xcc)[_0xbbde('0x20')]();});}};}function handleEntityNotFound(_0x1e8cde,_0x3ef824){return function(_0x4edce3){if(!_0x4edce3){_0x1e8cde[_0xbbde('0x1e')](0x194);}return _0x4edce3;};}function handleError(_0x2d8b67,_0x2232e1){_0x2232e1=_0x2232e1||0x1f4;return function(_0x3b53af){logger[_0xbbde('0x2d')](_0x3b53af[_0xbbde('0x2e')]);if(_0x3b53af[_0xbbde('0x2f')]){delete _0x3b53af['name'];}_0x2d8b67[_0xbbde('0x1f')](_0x2232e1)['send'](_0x3b53af);};}function getInteractionUsers(_0x54f195,_0x90fcf2){return new BPromise(function(_0x31dcda,_0x3ccfd5){try{if(_0x90fcf2[_0x54f195['id']]){_0x54f195[_0xbbde('0x30')]=_[_0xbbde('0x31')](_0x90fcf2[_0x54f195['id']],function(_0x52673d){return{'id':_0x52673d['id'],'fullname':_0x52673d['fullname']};});}}catch(_0x59e59e){_0x3ccfd5(_0x59e59e);}_0x31dcda(_0x54f195);});}function getInteractionTags(_0x16e797,_0x22e565){return new BPromise(function(_0x55a6d3,_0x348d97){try{if(_0x16e797[_0xbbde('0x32')]){_0x16e797[_0xbbde('0x33')]=[];_0x16e797['TagIds'][_0xbbde('0x34')](',')[_0xbbde('0x35')](function(_0x35a818){_0x16e797[_0xbbde('0x33')][_0xbbde('0x36')](_0x22e565[_0x35a818]);});}delete _0x16e797[_0xbbde('0x32')];}catch(_0xbe2b91){_0x348d97(_0xbe2b91);}_0x55a6d3(_0x16e797);});}function updateSmsInteraction(_0x131307,_0x150aab,_0x15eb4f){return new BPromise(function(_0x3b813b,_0x5b28fc){return getInteractionUsers(_0x131307,_0x15eb4f)[_0xbbde('0x2b')](function(_0x357c75){return getInteractionTags(_0x357c75,_0x150aab);})[_0xbbde('0x2b')](function(_0x4d22c8){return getStateInteraction(_0x4d22c8);})[_0xbbde('0x2b')](function(_0x106df3){_0x3b813b(_0x106df3);})[_0xbbde('0x37')](function(_0xac921c){_0x5b28fc(_0xac921c);});});}function getStateInteraction(_0x3e502b){return new BPromise(function(_0x41a9ba){_0x3e502b[_0xbbde('0x38')]=0x0;_0x3e502b[_0xbbde('0x39')]=0x0;_0x3e502b[_0xbbde('0x3a')]=0x0;_0x3e502b['unmanaged']=0x0;_0x3e502b[_0xbbde('0x3b')]=0x0;if(!_0x3e502b[_0xbbde('0x3c')]&&!_0x3e502b[_0xbbde('0x3d')]){_0x3e502b[_0xbbde('0x38')]+=0x1;}if(!_0x3e502b[_0xbbde('0x3c')]&&_0x3e502b[_0xbbde('0x3d')]){_0x3e502b[_0xbbde('0x39')]+=0x1;if(_0x3e502b['waiting']){_0x3e502b['waiting']-=0x1;}}if(_0x3e502b[_0xbbde('0x3c')]&&_0x3e502b[_0xbbde('0x3d')]){_0x3e502b[_0xbbde('0x3a')]+=0x1;if(_0x3e502b[_0xbbde('0x39')]){_0x3e502b[_0xbbde('0x39')]-=0x1;}}if(_0x3e502b[_0xbbde('0x3c')]&&!_0x3e502b[_0xbbde('0x3d')]){_0x3e502b[_0xbbde('0x3e')]+=0x1;if(_0x3e502b[_0xbbde('0x38')]){_0x3e502b[_0xbbde('0x38')]-=0x1;}}_0x3e502b[_0xbbde('0x3b')]+=0x1;_0x41a9ba(_0x3e502b);});}exports['index']=function(_0x42f8bf,_0x1c66b7){var _0x5d94c7={},_0x49c25a={},_0x194ff0={'count':0x0,'rows':[]};var _0x203b86=_[_0xbbde('0x31')](db[_0xbbde('0x3f')][_0xbbde('0x40')],function(_0x511bef){return{'name':_0x511bef[_0xbbde('0x41')],'type':_0x511bef['type'][_0xbbde('0x42')]};});_0x49c25a[_0xbbde('0x43')]=_['map'](_0x203b86,_0xbbde('0x2f'));_0x49c25a[_0xbbde('0x44')]=_[_0xbbde('0x45')](_0x42f8bf[_0xbbde('0x44')]);_0x49c25a[_0xbbde('0x46')]=_[_0xbbde('0x47')](_0x49c25a[_0xbbde('0x43')],_0x49c25a[_0xbbde('0x44')]);_0x5d94c7[_0xbbde('0x48')]=_['intersection'](_0x49c25a['model'],qs[_0xbbde('0x49')](_0x42f8bf[_0xbbde('0x44')][_0xbbde('0x49')]));_0x5d94c7[_0xbbde('0x48')]=_0x5d94c7[_0xbbde('0x48')]['length']?_0x5d94c7[_0xbbde('0x48')]:_0x49c25a['model'];if(!_0x42f8bf['query']['hasOwnProperty'](_0xbbde('0x4a'))){_0x5d94c7[_0xbbde('0x23')]=qs['limit'](_0x42f8bf[_0xbbde('0x44')][_0xbbde('0x23')]);_0x5d94c7[_0xbbde('0x22')]=qs[_0xbbde('0x22')](_0x42f8bf[_0xbbde('0x44')][_0xbbde('0x22')]);}_0x5d94c7['order']=qs[_0xbbde('0x4b')](_0x42f8bf[_0xbbde('0x44')][_0xbbde('0x4b')]);_0x5d94c7['where']=qs['filters'](_[_0xbbde('0x4c')](_0x42f8bf['query'],_0x49c25a[_0xbbde('0x46')]),_0x203b86);var _0x19a9dd=[];var _0x3427f5=squel['select']()[_0xbbde('0x4d')]('id')['field'](_0xbbde('0x2f'))['field'](_0xbbde('0x4e'))['from'](_0xbbde('0x4f'));var _0x25c403=squel[_0xbbde('0x50')]()[_0xbbde('0x4d')](_0xbbde('0x51'))['field'](_0xbbde('0x52'))[_0xbbde('0x4d')](_0xbbde('0x53'))['from'](_0xbbde('0x54'),'ui')[_0xbbde('0x55')](_0xbbde('0x56'),'u',_0xbbde('0x57'));var _0x509597=squel[_0xbbde('0x50')]()[_0xbbde('0x58')](_0xbbde('0x59'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o','o.id\x20=\x20i.UserId')[_0xbbde('0x55')]('sms_accounts','a',_0xbbde('0x5a'))['left_join'](_0xbbde('0x5b'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xbbde('0x55')](_0xbbde('0x5c'),'it',_0xbbde('0x5d'))[_0xbbde('0x55')](_0xbbde('0x4f'),'t',_0xbbde('0x5e'));var _0x2f630e=squel[_0xbbde('0x5f')]();var _0x2821e6=[];var _0x3c9c56=squel[_0xbbde('0x5f')]();var _0x194de3;if(_0x42f8bf[_0xbbde('0x44')][_0xbbde('0x60')]){_0x194de3=as[_0xbbde('0x61')](_0x42f8bf[_0xbbde('0x44')][_0xbbde('0x60')]);var _0x4af63d=_0x194de3[_0xbbde('0x62')];for(var _0x4b983a=0x0;_0x4b983a<_0x194de3[_0xbbde('0x63')][_0xbbde('0x64')];_0x4b983a++){var _0x25695e=_0x194de3[_0xbbde('0x63')][_0x4b983a];var _0xc46c47='i';var _0x539079=_[_0xbbde('0x65')](_0x203b86,[_0xbbde('0x2f'),_0x25695e[_0xbbde('0x4d')]]);if(!_0x539079){switch(_0x25695e[_0xbbde('0x4d')]){case'unreadMessages':if(_0x25695e['value']==0x1){_0x509597[_0xbbde('0x66')]('`'+_0x25695e[_0xbbde('0x4d')]+_0xbbde('0x67'));}else{_0x509597['having']('`'+_0x25695e[_0xbbde('0x4d')]+_0xbbde('0x68'));}break;case _0xbbde('0x69'):if(_0x25695e['operator']===_0xbbde('0x6a')){if(_0x25695e['value'][_0xbbde('0x34')]('\x20')[_0xbbde('0x64')]>0x1){_0x2f630e[_0x4af63d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbbde('0x6b')](_0x25695e[_0xbbde('0x6c')]),null);}else{var _0x550aeb='%'+_0x25695e[_0xbbde('0x6c')]+'%';_0x2f630e[_0x4af63d](_0xbbde('0x6d'),_0x550aeb,_0x550aeb,_0x550aeb);}}else{_0x539079=_[_0xbbde('0x65')](_0x203b86,[_0xbbde('0x2f'),_0xbbde('0x6e')]);_0x25695e[_0xbbde('0x4d')]=_0xbbde('0x6e');_0x3f1cbd=as['buildExpression'](_0xc46c47,_0x539079['type'],_0x25695e);_0x2f630e[_0x4af63d](_0x3f1cbd[_0xbbde('0x6f')],_0x3f1cbd[_0xbbde('0x6c')][_0xbbde('0x70')],_0x3f1cbd[_0xbbde('0x6c')][_0xbbde('0x20')]);}break;case _0xbbde('0x71'):var _0x2f2082=_0x25695e['value'][_0xbbde('0x34')](',')[_0xbbde('0x31')](function(_0x1961c5){return Number(_0x1961c5);});_0x2f2082[_0xbbde('0x35')](function(_0x5c4b6b){_0x3c9c56['or'](_0xbbde('0x72'),'%,'+_0x5c4b6b+',%');});_0x2821e6=_[_0xbbde('0x73')](_0x2821e6,_0x2f2082);break;case _0xbbde('0x74'):if(_0x25695e['operator']===_0xbbde('0x6a')){_0x2f630e[_0x4af63d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x25695e[_0xbbde('0x6c')]+'%',null);}else{_0x539079=_[_0xbbde('0x65')](_0x203b86,[_0xbbde('0x2f'),_0xbbde('0x3d')]);_0x25695e[_0xbbde('0x4d')]='UserId';_0x3f1cbd=as[_0xbbde('0x75')](_0xc46c47,_0x539079[_0xbbde('0x76')],_0x25695e);_0x2f630e[_0x4af63d](_0x3f1cbd[_0xbbde('0x6f')],_0x3f1cbd[_0xbbde('0x6c')][_0xbbde('0x70')],_0x3f1cbd[_0xbbde('0x6c')][_0xbbde('0x20')]);}break;case _0xbbde('0x77'):_0x3f1cbd=as['buildExpression']('me',null,_0x25695e);_0x2f630e[_0x4af63d](_0x3f1cbd[_0xbbde('0x6f')],_0x3f1cbd[_0xbbde('0x6c')][_0xbbde('0x70')],_0x3f1cbd['value'][_0xbbde('0x20')]);break;}}else{var _0x3f1cbd=as[_0xbbde('0x75')](_0xc46c47,_0x539079[_0xbbde('0x76')],_0x25695e);_0x2f630e[_0x4af63d](_0x3f1cbd['text'],_0x3f1cbd[_0xbbde('0x6c')][_0xbbde('0x70')],_0x3f1cbd[_0xbbde('0x6c')][_0xbbde('0x20')]);}}}else{var _0xccd1b1=_(_0x42f8bf[_0xbbde('0x44')])['keys']()[_0xbbde('0x31')](function(_0x59a438){return _[_0xbbde('0x78')](_0x203b86,['name',_0x59a438])?_0x59a438:undefined;})[_0xbbde('0x79')]()[_0xbbde('0x6c')]();if(!_[_0xbbde('0x7a')](_0xccd1b1)){_0xccd1b1[_0xbbde('0x35')](function(_0x232bde){if(_0x232bde===_0xbbde('0x7b')){_0x509597[_0xbbde('0x7c')](_0xbbde('0x7d'),[]['concat'](_0x42f8bf[_0xbbde('0x44')][_0x232bde]));}else if(_0x232bde==='createdAt'){var _0x3bdb6b=JSON[_0xbbde('0x7e')](_0x42f8bf[_0xbbde('0x44')][_0x232bde])['$gte'];var _0x553d46=JSON[_0xbbde('0x7e')](_0x42f8bf[_0xbbde('0x44')][_0x232bde])['$lte'];_0x509597[_0xbbde('0x7c')](_0xbbde('0x7f'),_0x3bdb6b,_0x553d46);}else{if(_0x42f8bf[_0xbbde('0x44')][_0x232bde]==='null'){_0x509597[_0xbbde('0x7c')]('i.'+_0x232bde+_0xbbde('0x80'));}else{_0x509597[_0xbbde('0x7c')]('i.'+_0x232bde+'\x20=\x20?',_0x42f8bf[_0xbbde('0x44')][_0x232bde]);}}});}if(_0x42f8bf[_0xbbde('0x44')]['read']){if(_0x42f8bf[_0xbbde('0x44')]['read']==0x1){_0x509597[_0xbbde('0x66')](_0xbbde('0x81'));}else{_0x509597[_0xbbde('0x66')](_0xbbde('0x82'));}}if(_0x42f8bf['query']['tag']){_0x2821e6=_[_0xbbde('0x83')](_0x42f8bf['query'][_0xbbde('0x84')])?_0x42f8bf[_0xbbde('0x44')][_0xbbde('0x84')]:new Array(_0x42f8bf[_0xbbde('0x44')]['tag']);_0x2821e6[_0xbbde('0x35')](function(_0x393b3c){_0x3c9c56['or'](_0xbbde('0x72'),'%,'+_0x393b3c+',%');});}if(_0x42f8bf['query'][_0xbbde('0x85')]){var _0x420472=_0x42f8bf[_0xbbde('0x44')][_0xbbde('0x85')]['replace']('\x5c','\x5c\x5c')[_0xbbde('0x86')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x420472)){_0x2f630e['or'](_0xbbde('0x87'),_0x420472+'%')['or']('i.phone\x20LIKE\x20?',_0x420472+'%');}else{_0x2f630e['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbbde('0x6b')](_0x420472))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x420472+'%');}}}_0x509597['where'](_0x2f630e);_0x509597[_0xbbde('0x88')]('i.id');var _0x1a6c52={'type':db[_0xbbde('0x89')]['QueryTypes'][_0xbbde('0x8a')],'raw':!![]};var _0x5155c0=_0x509597['clone']();_0x5155c0[_0xbbde('0x4d')]('i.id');_0x5155c0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbbde('0x8b'));if(_0x5d94c7[_0xbbde('0x8c')]){_0x5d94c7[_0xbbde('0x8c')][_0xbbde('0x35')](function(_0x319877){var _0x55ab13=_0x319877[0x0]===_0xbbde('0x8d')?_0x319877[0x0]:'i.'+_0x319877[0x0];_0x509597[_0xbbde('0x8c')](_0x55ab13,_0x319877[0x1]===_0xbbde('0x8e')?![]:!![]);});}if(!_[_0xbbde('0x7a')](_0x2821e6)){_0x509597[_0xbbde('0x66')](_0x3c9c56);_0x5155c0[_0xbbde('0x7c')](_0xbbde('0x8f'),_0x2821e6);}BPromise[_0xbbde('0x90')]()[_0xbbde('0x2b')](function(){if(!_0x194de3){if(_0x42f8bf[_0xbbde('0x44')]['SmsAccountId'])return;_0x5155c0[_0xbbde('0x7c')](_0xbbde('0x91'));_0x509597[_0xbbde('0x7c')](_0xbbde('0x91'));return;}if(_0x42f8bf['user'][_0xbbde('0x92')]!=='agent')return;return _0x42f8bf[_0xbbde('0x93')][_0xbbde('0x94')]({'attributes':['id'],'raw':!![]})[_0xbbde('0x2b')](function(_0x34b927){if(_[_0xbbde('0x7a')](_0x34b927)){_0x5155c0[_0xbbde('0x7c')](_0xbbde('0x95'));_0x509597[_0xbbde('0x7c')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x5155c0[_0xbbde('0x7c')](_0xbbde('0x7d'),_['map'](_0x34b927,'id'));_0x509597[_0xbbde('0x7c')]('i.SmsAccountId\x20IN\x20?',_[_0xbbde('0x31')](_0x34b927,'id'));}});})['then'](function(){if(_0x42f8bf[_0xbbde('0x93')]['role']===_0xbbde('0x96')&&!_0x194de3&&!_0x42f8bf[_0xbbde('0x44')]['SmsAccountId'])return[];return db[_0xbbde('0x97')][_0xbbde('0x44')](_0x5155c0[_0xbbde('0x98')](),_0x1a6c52);})[_0xbbde('0x2b')](function(_0x462926){_0x194ff0[_0xbbde('0x25')]=_0x462926[_0xbbde('0x64')];if(_0x194ff0[_0xbbde('0x25')]===0x0)return[];return db[_0xbbde('0x97')][_0xbbde('0x44')](_0x3427f5[_0xbbde('0x98')](),_0x1a6c52)['then'](function(_0x46f743){_0x19a9dd=_['keyBy'](_0x46f743,'id');_0x1a6c52=_[_0xbbde('0x99')](_0x1a6c52,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x42f8bf[_0xbbde('0x44')][_0xbbde('0x49')]){_0x5d94c7[_0xbbde('0x48')][_0xbbde('0x35')](function(_0x5c1225){_0x509597['field']('i.'+_0x5c1225);});}else{_0x509597['field'](_0xbbde('0x9a'),'unreadMessages');_0x509597[_0xbbde('0x4d')](_0xbbde('0x9b'),_0xbbde('0x9c'));_0x509597[_0xbbde('0x4d')](_0xbbde('0x9d'),_0xbbde('0x9e'));_0x509597['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',_0xbbde('0x8d'));_0x509597['field'](_0xbbde('0x9f'));_0x509597[_0xbbde('0x4d')](_0xbbde('0xa0'),_0xbbde('0xa1'));_0x509597[_0xbbde('0x4d')](_0xbbde('0xa2'),_0xbbde('0xa3'));_0x509597[_0xbbde('0x4d')](_0xbbde('0xa4'),'Contact.email');_0x509597[_0xbbde('0x4d')]('c.phone',_0xbbde('0xa5'));_0x509597['field'](_0xbbde('0xa6'),_0xbbde('0xa7'));_0x509597[_0xbbde('0x4d')](_0xbbde('0xa8'),_0xbbde('0xa9'));_0x509597[_0xbbde('0x4d')](_0xbbde('0xaa'),_0xbbde('0xab'));_0x509597[_0xbbde('0x4d')](_0xbbde('0xac'),'Owner.internal');_0x509597[_0xbbde('0x4d')](_0xbbde('0xad'),'TagIds');}if(_0x5d94c7[_0xbbde('0x23')])_0x509597[_0xbbde('0x23')](_0x5d94c7[_0xbbde('0x23')]);if(_0x5d94c7[_0xbbde('0x22')])_0x509597[_0xbbde('0x22')](_0x5d94c7['offset']);return db[_0xbbde('0x97')][_0xbbde('0x44')](_0x509597['toString'](),_0x1a6c52);})[_0xbbde('0x2b')](function(_0x3af161){if(_0x3af161[_0xbbde('0x64')]>0x0)_0x25c403[_0xbbde('0x7c')](_0xbbde('0xae'),_[_0xbbde('0x31')](_0x3af161,'id'));return db[_0xbbde('0x97')][_0xbbde('0x44')](_0x25c403[_0xbbde('0x98')](),_0x1a6c52)[_0xbbde('0x2b')](function(_0x7765a0){var _0x1ded12=_[_0xbbde('0xaf')](_0x7765a0,_0xbbde('0xb0'));var _0x50e3fd=[];_0x3af161[_0xbbde('0x35')](function(_0x2e83c2){_0x50e3fd[_0xbbde('0x36')](updateSmsInteraction(_0x2e83c2,_0x19a9dd,_0x1ded12));});return BPromise[_0xbbde('0xb1')](_0x50e3fd);});});})['then'](function(_0x4255b7){_0x194ff0[_0xbbde('0xb2')]=_0x4255b7;return _0x194ff0;})[_0xbbde('0x2b')](respondWithFilteredResult(_0x1c66b7,_0x5d94c7))[_0xbbde('0x37')](handleError(_0x1c66b7,null));};exports['show']=function(_0x588983,_0x4237c1){var _0x2fded8={'raw':![],'where':{'id':_0x588983[_0xbbde('0xb3')]['id']}},_0x2a5224={};_0x2a5224['model']=_[_0xbbde('0x45')](db[_0xbbde('0x3f')][_0xbbde('0x40')]);_0x2a5224[_0xbbde('0x44')]=_[_0xbbde('0x45')](_0x588983[_0xbbde('0x44')]);_0x2a5224[_0xbbde('0x46')]=_['intersection'](_0x2a5224[_0xbbde('0x43')],_0x2a5224['query']);_0x2fded8[_0xbbde('0x48')]=_['intersection'](_0x2a5224[_0xbbde('0x43')],qs[_0xbbde('0x49')](_0x588983[_0xbbde('0x44')][_0xbbde('0x49')]));_0x2fded8[_0xbbde('0x48')]=_0x2fded8['attributes'][_0xbbde('0x64')]?_0x2fded8['attributes']:_0x2a5224[_0xbbde('0x43')];if(_0x588983[_0xbbde('0x44')][_0xbbde('0xb4')]){_0x2fded8[_0xbbde('0xb5')]=[{'all':!![]}];}_0x2fded8=_['merge']({},_0x2fded8,_0x588983[_0xbbde('0xb6')]);return db[_0xbbde('0x3f')][_0xbbde('0x65')](_0x2fded8)['then'](handleEntityNotFound(_0x4237c1,null))[_0xbbde('0x2b')](respondWithResult(_0x4237c1,null))['catch'](handleError(_0x4237c1,null));};exports[_0xbbde('0xb7')]=function(_0x33e0c9,_0x5733d1){return db[_0xbbde('0x3f')][_0xbbde('0xb7')](_0x33e0c9[_0xbbde('0x77')],{})['then'](respondWithResult(_0x5733d1,0xc9))['catch'](handleError(_0x5733d1,null));};exports[_0xbbde('0x2a')]=function(_0x48d07a,_0x344475){if(_0x48d07a[_0xbbde('0x77')]['id']){delete _0x48d07a['body']['id'];}return db[_0xbbde('0x3f')]['find']({'where':{'id':_0x48d07a[_0xbbde('0xb3')]['id']}})['then'](handleEntityNotFound(_0x344475,null))[_0xbbde('0x2b')](saveUpdates(_0x48d07a[_0xbbde('0x77')],null))[_0xbbde('0x2b')](respondWithResult(_0x344475,null))[_0xbbde('0x37')](handleError(_0x344475,null));};exports[_0xbbde('0x2c')]=function(_0x3d4059,_0x35613c){return db[_0xbbde('0x3f')][_0xbbde('0x65')]({'where':{'id':_0x3d4059[_0xbbde('0xb3')]['id']}})[_0xbbde('0x2b')](handleEntityNotFound(_0x35613c,null))[_0xbbde('0x2b')](removeEntity(_0x35613c,null))[_0xbbde('0x37')](handleError(_0x35613c,null));};exports[_0xbbde('0xb8')]=function(_0x52dce1,_0x4453ab){return db['SmsInteraction'][_0xbbde('0xb8')]()[_0xbbde('0x2b')](respondWithResult(_0x4453ab,null))[_0xbbde('0x37')](handleError(_0x4453ab,null));};exports[_0xbbde('0xb9')]=function(_0x3baaa2,_0x208141,_0x5a24c4){return db[_0xbbde('0xba')]['find']({'where':{'id':_0x3baaa2[_0xbbde('0xb3')]['id']}})[_0xbbde('0x2b')](handleEntityNotFound(_0x208141,null))['then'](function(_0x5b0689){if(_0x5b0689){return _0x5b0689[_0xbbde('0xb9')](_0x3baaa2[_0xbbde('0x77')][_0xbbde('0xbb')],_[_0xbbde('0xbc')](_0x3baaa2[_0xbbde('0x77')],[_0xbbde('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x208141,null))['catch'](handleError(_0x208141,null));};exports[_0xbbde('0xbd')]=function(_0x802027,_0x460157,_0x17bb24){var _0x3159fb={'raw':![],'where':{}};var _0x98dc40={};var _0x4a6a63={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xbbde('0xbe')]({'where':{'id':_0x802027[_0xbbde('0xb3')]['id']}})[_0xbbde('0x2b')](handleEntityNotFound(_0x460157,null))[_0xbbde('0x2b')](function(_0xe353d3){if(_0xe353d3){_0x98dc40['model']=_[_0xbbde('0x45')](db[_0xbbde('0xba')][_0xbbde('0x40')]);_0x98dc40[_0xbbde('0x44')]=_[_0xbbde('0x45')](_0x802027[_0xbbde('0x44')]);_0x98dc40[_0xbbde('0x46')]=_[_0xbbde('0x47')](_0x98dc40[_0xbbde('0x43')],_0x98dc40[_0xbbde('0x44')]);_0x3159fb[_0xbbde('0x48')]=_[_0xbbde('0x47')](_0x98dc40['model'],qs['fields'](_0x802027['query'][_0xbbde('0x49')]));_0x3159fb['attributes']=_0x3159fb[_0xbbde('0x48')][_0xbbde('0x64')]?_0x3159fb[_0xbbde('0x48')]:_0x98dc40[_0xbbde('0x43')];if(!_0x802027[_0xbbde('0x44')][_0xbbde('0xbf')](_0xbbde('0x4a'))){_0x3159fb[_0xbbde('0x23')]=qs[_0xbbde('0x23')](_0x802027[_0xbbde('0x44')][_0xbbde('0x23')]);_0x3159fb[_0xbbde('0x22')]=qs[_0xbbde('0x22')](_0x802027[_0xbbde('0x44')]['offset']);}_0x3159fb[_0xbbde('0x8c')]=qs['sort'](_0x802027[_0xbbde('0x44')][_0xbbde('0x4b')]);_0x3159fb['where']=qs[_0xbbde('0x46')](_[_0xbbde('0x4c')](_0x802027[_0xbbde('0x44')],_0x98dc40[_0xbbde('0x46')]));_0x3159fb[_0xbbde('0x7c')][_0xbbde('0xb0')]=_0xe353d3['id'];if(_0x802027[_0xbbde('0x44')][_0xbbde('0x85')]){_0x3159fb[_0xbbde('0x7c')]=_['merge'](_0x3159fb[_0xbbde('0x7c')],{'$or':_[_0xbbde('0x31')](_0x3159fb[_0xbbde('0x48')],function(_0x4dcb85){var _0x44e495={};_0x44e495[_0x4dcb85]={'$like':'%'+_0x802027['query']['filter']+'%'};return _0x44e495;})});}if(_0x802027['query'][_0xbbde('0xc0')]){var _0x49bd84=_0x802027['query'][_0xbbde('0xc0')][_0xbbde('0x34')](',');var _0x14c5be={};_0x14c5be[_0x49bd84[0x0]]={'$gte':moment(_0x49bd84[0x1])[_0xbbde('0xc1')](_0xbbde('0xc2'))};_0x3159fb[_0xbbde('0x7c')]=_['merge'](_0x3159fb[_0xbbde('0x7c')],_0x14c5be);}_0x3159fb=_[_0xbbde('0x99')]({},_0x3159fb,_0x802027[_0xbbde('0xb6')]);return db['SmsMessage'][_0xbbde('0x25')]({'where':_0x3159fb[_0xbbde('0x7c')]})[_0xbbde('0x2b')](function(_0x3e6737){_0x4a6a63[_0xbbde('0x25')]=_0x3e6737;if(_0x802027[_0xbbde('0x44')][_0xbbde('0xb4')]){_0x3159fb[_0xbbde('0xb5')]=[{'all':!![]}];}return db[_0xbbde('0xba')][_0xbbde('0xc3')](_0x3159fb);})[_0xbbde('0x2b')](function(_0x363c1c){_0x4a6a63[_0xbbde('0xb2')]=_0x363c1c;return _0x4a6a63;});}})['then'](respondWithFilteredResult(_0x460157,_0x3159fb))[_0xbbde('0x37')](handleError(_0x460157,null));};exports['addTags']=function(_0x212f24,_0x35fea3,_0x503a74){return db[_0xbbde('0x3f')]['find']({'where':{'id':_0x212f24[_0xbbde('0xb3')]['id']}})[_0xbbde('0x2b')](handleEntityNotFound(_0x35fea3,null))[_0xbbde('0x2b')](function(_0x54d74f){if(_0x54d74f){return _0x54d74f[_0xbbde('0xc4')](_0x212f24['body'][_0xbbde('0xbb')],_[_0xbbde('0xbc')](_0x212f24[_0xbbde('0x77')],[_0xbbde('0xbb'),'id'])||{})[_0xbbde('0xc5')](function(){return db['Tag'][_0xbbde('0xc3')]({'attributes':['id',_0xbbde('0x2f'),_0xbbde('0x4e')],'where':{'id':_0x212f24[_0xbbde('0x77')][_0xbbde('0xbb')]}});})[_0xbbde('0x2b')](function(_0x29dc59){socket[_0xbbde('0xc6')](_0xbbde('0xc7'),{'id':Number(_0x212f24['params']['id']),'tags':_0x29dc59||[]});return{'id':Number(_0x212f24[_0xbbde('0xb3')]['id']),'tags':_0x29dc59||[]};});}})[_0xbbde('0x2b')](respondWithResult(_0x35fea3,null))[_0xbbde('0x37')](handleError(_0x35fea3,null));};exports['removeTags']=function(_0x3c5028,_0x15b85c,_0x471d98){return db['SmsInteraction'][_0xbbde('0x65')]({'where':{'id':_0x3c5028[_0xbbde('0xb3')]['id']}})['then'](handleEntityNotFound(_0x15b85c,null))[_0xbbde('0x2b')](function(_0x1dc0d7){if(_0x1dc0d7){return _0x1dc0d7['removeTags'](_0x3c5028[_0xbbde('0x44')][_0xbbde('0xbb')]);}})['then'](respondWithStatusCode(_0x15b85c,null))['catch'](handleError(_0x15b85c,null));};exports[_0xbbde('0xc8')]=function(_0x1a4977,_0x33c3d6){var _0x4bbac4=moment()[_0xbbde('0xc9')]()[_0xbbde('0x98')]();var _0x23500b=path[_0xbbde('0xca')](config[_0xbbde('0xcb')],_0xbbde('0xcc'),'files',_0xbbde('0xcd'));var _0x29aa74=path[_0xbbde('0xca')](config[_0xbbde('0xcb')],_0xbbde('0xcc'),_0xbbde('0xce'),_0xbbde('0xcf'));var _0x5b8f71=path['join'](_0x23500b,_0x4bbac4);var _0x16e370=util[_0xbbde('0xc1')](_0xbbde('0xd0'),_0x1a4977[_0xbbde('0xb3')]['id'],_0x4bbac4);var _0x43dc66=path[_0xbbde('0xca')](_0x23500b,_0x16e370);var _0x129029=[];_0x129029['push']({'model':db['User'],'as':_0xbbde('0x74'),'attributes':['id',_0xbbde('0xd1')],'raw':!![]});_0x129029['push']({'model':db[_0xbbde('0xd2')],'as':_0xbbde('0x69'),'attributes':['id',_0xbbde('0xd3'),'lastName'],'raw':!![]});var _0x4b96f7=[{'model':db[_0xbbde('0xba')],'as':_0xbbde('0xd4'),'attributes':['id','body','createdAt','direction',_0xbbde('0xd5'),_0xbbde('0xd6')],'include':_0x129029}];_0x4b96f7[_0xbbde('0x36')]({'model':db[_0xbbde('0xd7')],'as':_0xbbde('0xd8'),'attributes':['id',_0xbbde('0x2f')]});_0x4b96f7[_0xbbde('0x36')]({'model':db[_0xbbde('0x74')],'as':_0xbbde('0xd9'),'attributes':['id',_0xbbde('0xd1')]});return db['SmsInteraction'][_0xbbde('0x65')]({'where':{'id':_0x1a4977[_0xbbde('0xb3')]['id']},'include':_0x4b96f7})[_0xbbde('0x2b')](handleEntityNotFound(_0x33c3d6,null))[_0xbbde('0x2b')](function(_0x3f3d9f){if(_0x3f3d9f){var _0x370223=_0x3f3d9f['get']({'plain':!![]});fs[_0xbbde('0xda')](_0x5b8f71);var _0x24b0ac={'channel':_0xbbde('0xdb'),'account':_0x370223[_0xbbde('0xd8')][_0xbbde('0x2f')],'agent':_0x370223[_0xbbde('0xd9')]?_0x370223[_0xbbde('0xd9')][_0xbbde('0xd1')]:'N.A.','createdAt':moment(_0x370223[_0xbbde('0xdc')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xbbde('0x98')](),'closedAt':_0x370223[_0xbbde('0x3c')]?moment(_0x370223[_0xbbde('0xdd')])[_0xbbde('0xc1')](_0xbbde('0xc2'))[_0xbbde('0x98')]():'','disposition':_0x370223[_0xbbde('0xde')],'messages':_(_0x370223[_0xbbde('0xd4')])[_0xbbde('0x85')]({'secret':![]})['map'](function(_0xfe88ea){return{'date':moment(_0xfe88ea['createdAt'])['format'](_0xbbde('0xc2'))[_0xbbde('0x98')](),'sender':_0xfe88ea['direction']===_0xbbde('0xdf')?_0xfe88ea[_0xbbde('0x74')]?_0xfe88ea[_0xbbde('0x74')][_0xbbde('0xd1')]:_0xbbde('0xe0'):_0xfe88ea[_0xbbde('0x69')]['firstName']+(_0xfe88ea[_0xbbde('0x69')]['lastName']?'\x20'+_0xfe88ea[_0xbbde('0x69')][_0xbbde('0xe1')]:''),'body':_0xfe88ea[_0xbbde('0x77')],'direction':_0xfe88ea[_0xbbde('0xe2')]===_0xbbde('0xdf')?'A':'C','secret':_0xfe88ea['secret'],'read':_0xfe88ea[_0xbbde('0xd6')]};})[_0xbbde('0x6c')]()};return ejs['renderFile'](path[_0xbbde('0xca')](config[_0xbbde('0xcb')],_0xbbde('0xcc'),_0xbbde('0xe3'),'downloadInteraction.ejs'),{'interaction':_0x24b0ac})['then'](function(_0x1ed731){var _0x8ce263=path[_0xbbde('0xca')](_0x5b8f71,_0xbbde('0xe4')+_0x370223['id']+'-'+_0x4bbac4+_0xbbde('0xe5'));var _0x3b6c6e={'path':_0x8ce263,'channel':_0xbbde('0xdb'),'interactionId':_0x370223['id']};return pdf['createPdfFromHTML'](_0x1ed731,_0x3b6c6e);})[_0xbbde('0x2b')](function(){return new BPromise(function(_0x45d872,_0x2950bd){zipdir(_0x5b8f71,{'saveTo':_0x43dc66},function(_0x149dfc,_0x284e9c){if(_0x149dfc)return _0x2950bd(_0x149dfc);return _0x45d872(_0x284e9c);});})[_0xbbde('0x2b')](function(){return new BPromise(function(_0x2ae373,_0x38c6d){rimraf(_0x5b8f71,function(_0x4c5eb7){if(_0x4c5eb7)_0x38c6d(_0x4c5eb7);return _0x2ae373();});});})[_0xbbde('0x2b')](function(){return _0x33c3d6['download'](_0x43dc66,_0x16e370,function(_0x7d6bc7){if(_0x7d6bc7){console[_0xbbde('0xe6')]('err',_0x7d6bc7);}else{fs[_0xbbde('0xe7')](_0x43dc66);}});});});}else{return _0x33c3d6[_0xbbde('0x1e')](0xc8);}})[_0xbbde('0x37')](handleError(_0x33c3d6,null));}; \ No newline at end of file +var _0x15ad=['count','status','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','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','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','start','body','some','compact','SmsAccountId','i.SmsAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','replace','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','all','rows','includeAll','include','options','create','params','describe','addMessage','SmsMessage','ids','getMessages','findOne','filter','$gte','format','findAll','addTags','setTags','omit','emit','smsInteractionTags:save','removeTags','download','root','files','tmp','join','server','attachments','fullname','CmContact','lastName','Messages','direction','SmsAccount','get','mkdirSync','Sms','Account','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','out','System','firstName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','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/environment','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','end','offset','undefined','limit'];(function(_0x3869fd,_0x2b88ce){var _0x3ed23e=function(_0x154b7a){while(--_0x154b7a){_0x3869fd['push'](_0x3869fd['shift']());}};_0x3ed23e(++_0x2b88ce);}(_0x15ad,0x1c7));var _0xd15a=function(_0x2bb3ea,_0x212711){_0x2bb3ea=_0x2bb3ea-0x0;var _0x54a289=_0x15ad[_0x2bb3ea];return _0x54a289;};'use strict';var emlformat=require(_0xd15a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd15a('0x1'));var rp=require(_0xd15a('0x2'));var moment=require('moment');var BPromise=require(_0xd15a('0x3'));var Mustache=require(_0xd15a('0x4'));var util=require(_0xd15a('0x5'));var path=require(_0xd15a('0x6'));var sox=require(_0xd15a('0x7'));var csv=require(_0xd15a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd15a('0x9'));var _=require(_0xd15a('0xa'));var squel=require(_0xd15a('0xb'));var crypto=require('crypto');var jsforce=require(_0xd15a('0xc'));var deskjs=require(_0xd15a('0xd'));var toCsv=require(_0xd15a('0x8'));var querystring=require('querystring');var Papa=require(_0xd15a('0xe'));var Redis=require(_0xd15a('0xf'));var authService=require(_0xd15a('0x10'));var qs=require(_0xd15a('0x11'));var as=require(_0xd15a('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xd15a('0x13'));var logger=require(_0xd15a('0x14'))(_0xd15a('0x15'));var utils=require('../../config/utils');var config=require(_0xd15a('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xd15a('0x17')](config['redis'],{'host':_0xd15a('0x18'),'port':0x18eb});var socket=require(_0xd15a('0x19'))(new Redis(config[_0xd15a('0x1a')]));require(_0xd15a('0x1b'))[_0xd15a('0x1c')](socket);function respondWithStatusCode(_0x5e52a2,_0x310983){_0x310983=_0x310983||0xcc;return function(_0xcd6e0e){if(_0xcd6e0e){return _0x5e52a2['sendStatus'](_0x310983);}return _0x5e52a2['status'](_0x310983)[_0xd15a('0x1d')]();};}function respondWithResult(_0x30e38f,_0x5eb7a0){_0x5eb7a0=_0x5eb7a0||0xc8;return function(_0x52b84e){if(_0x52b84e){return _0x30e38f['status'](_0x5eb7a0)['json'](_0x52b84e);}};}function respondWithFilteredResult(_0x3a17e5,_0x44f942){return function(_0x1a4058){if(_0x1a4058){var _0x200f2b=typeof _0x44f942[_0xd15a('0x1e')]===_0xd15a('0x1f')&&typeof _0x44f942[_0xd15a('0x20')]==='undefined';var _0x3f3831=_0x1a4058['count'];var _0x15138a=_0x200f2b?0x0:_0x44f942['offset'];var _0x41721e=_0x200f2b?_0x1a4058[_0xd15a('0x21')]:_0x44f942[_0xd15a('0x1e')]+_0x44f942[_0xd15a('0x20')];var _0x4d42e4;if(_0x41721e>=_0x3f3831){_0x41721e=_0x3f3831;_0x4d42e4=0xc8;}else{_0x4d42e4=0xce;}_0x3a17e5[_0xd15a('0x22')](_0x4d42e4);return _0x3a17e5[_0xd15a('0x23')]('Content-Range',_0x15138a+'-'+_0x41721e+'/'+_0x3f3831)['json'](_0x1a4058);}return null;};}function patchUpdates(_0x164184){return function(_0x41838b){try{jsonpatch[_0xd15a('0x24')](_0x41838b,_0x164184,!![]);}catch(_0x100db0){return BPromise[_0xd15a('0x25')](_0x100db0);}return _0x41838b['save']();};}function saveUpdates(_0x1f18de,_0x4cdc96){return function(_0x2bc363){if(_0x2bc363){return _0x2bc363[_0xd15a('0x26')](_0x1f18de)[_0xd15a('0x27')](function(_0xd17bff){return _0xd17bff;});}return null;};}function removeEntity(_0x58f029,_0x1e221e){return function(_0x1f9baf){if(_0x1f9baf){return _0x1f9baf[_0xd15a('0x28')]()[_0xd15a('0x27')](function(){_0x58f029['status'](0xcc)[_0xd15a('0x1d')]();});}};}function handleEntityNotFound(_0x2e423c,_0x16146d){return function(_0x1c9e4c){if(!_0x1c9e4c){_0x2e423c[_0xd15a('0x29')](0x194);}return _0x1c9e4c;};}function handleError(_0x50d573,_0x4a5db2){_0x4a5db2=_0x4a5db2||0x1f4;return function(_0x5ade82){logger[_0xd15a('0x2a')](_0x5ade82[_0xd15a('0x2b')]);if(_0x5ade82[_0xd15a('0x2c')]){delete _0x5ade82[_0xd15a('0x2c')];}_0x50d573['status'](_0x4a5db2)[_0xd15a('0x2d')](_0x5ade82);};}function getInteractionUsers(_0x2fefd5,_0x575795){return new BPromise(function(_0x367c05,_0x191c71){try{if(_0x575795[_0x2fefd5['id']]){_0x2fefd5[_0xd15a('0x2e')]=_[_0xd15a('0x2f')](_0x575795[_0x2fefd5['id']],function(_0x2c0147){return{'id':_0x2c0147['id'],'fullname':_0x2c0147['fullname']};});}}catch(_0x1ad8f0){_0x191c71(_0x1ad8f0);}_0x367c05(_0x2fefd5);});}function getInteractionTags(_0x7a9c89,_0x214e18){return new BPromise(function(_0x523826,_0x3d80d1){try{if(_0x7a9c89[_0xd15a('0x30')]){_0x7a9c89[_0xd15a('0x31')]=[];_0x7a9c89[_0xd15a('0x30')][_0xd15a('0x32')](',')[_0xd15a('0x33')](function(_0x4a137d){_0x7a9c89['Tags']['push'](_0x214e18[_0x4a137d]);});}delete _0x7a9c89[_0xd15a('0x30')];}catch(_0x204c51){_0x3d80d1(_0x204c51);}_0x523826(_0x7a9c89);});}function updateSmsInteraction(_0x3dd35b,_0x4ea7bb,_0x234b5d){return new BPromise(function(_0x4891ef,_0x3dcd41){return getInteractionUsers(_0x3dd35b,_0x234b5d)['then'](function(_0x14241c){return getInteractionTags(_0x14241c,_0x4ea7bb);})[_0xd15a('0x27')](function(_0x58ea35){return getStateInteraction(_0x58ea35);})[_0xd15a('0x27')](function(_0x18d226){_0x4891ef(_0x18d226);})[_0xd15a('0x34')](function(_0x3c9b51){_0x3dcd41(_0x3c9b51);});});}function getStateInteraction(_0x303a09){return new BPromise(function(_0x4f23ea){_0x303a09[_0xd15a('0x35')]=0x0;_0x303a09[_0xd15a('0x36')]=0x0;_0x303a09[_0xd15a('0x37')]=0x0;_0x303a09[_0xd15a('0x38')]=0x0;_0x303a09[_0xd15a('0x39')]=0x0;if(!_0x303a09[_0xd15a('0x3a')]&&!_0x303a09[_0xd15a('0x3b')]){_0x303a09[_0xd15a('0x35')]+=0x1;}if(!_0x303a09['closed']&&_0x303a09[_0xd15a('0x3b')]){_0x303a09[_0xd15a('0x36')]+=0x1;if(_0x303a09[_0xd15a('0x35')]){_0x303a09[_0xd15a('0x35')]-=0x1;}}if(_0x303a09['closed']&&_0x303a09[_0xd15a('0x3b')]){_0x303a09[_0xd15a('0x37')]+=0x1;if(_0x303a09[_0xd15a('0x36')]){_0x303a09[_0xd15a('0x36')]-=0x1;}}if(_0x303a09[_0xd15a('0x3a')]&&!_0x303a09[_0xd15a('0x3b')]){_0x303a09[_0xd15a('0x38')]+=0x1;if(_0x303a09['waiting']){_0x303a09[_0xd15a('0x35')]-=0x1;}}_0x303a09[_0xd15a('0x39')]+=0x1;_0x4f23ea(_0x303a09);});}exports[_0xd15a('0x3c')]=function(_0x3b059d,_0x34fee7){var _0x30f492={},_0x106fb7={},_0x1e0817={'count':0x0,'rows':[]};var _0x5a5efc=_[_0xd15a('0x2f')](db[_0xd15a('0x3d')][_0xd15a('0x3e')],function(_0x240019){return{'name':_0x240019[_0xd15a('0x3f')],'type':_0x240019[_0xd15a('0x40')][_0xd15a('0x41')]};});_0x106fb7[_0xd15a('0x42')]=_[_0xd15a('0x2f')](_0x5a5efc,'name');_0x106fb7['query']=_[_0xd15a('0x43')](_0x3b059d[_0xd15a('0x44')]);_0x106fb7['filters']=_[_0xd15a('0x45')](_0x106fb7[_0xd15a('0x42')],_0x106fb7['query']);_0x30f492['attributes']=_[_0xd15a('0x45')](_0x106fb7[_0xd15a('0x42')],qs[_0xd15a('0x46')](_0x3b059d[_0xd15a('0x44')][_0xd15a('0x46')]));_0x30f492[_0xd15a('0x47')]=_0x30f492[_0xd15a('0x47')][_0xd15a('0x48')]?_0x30f492[_0xd15a('0x47')]:_0x106fb7[_0xd15a('0x42')];if(!_0x3b059d[_0xd15a('0x44')][_0xd15a('0x49')](_0xd15a('0x4a'))){_0x30f492[_0xd15a('0x20')]=qs[_0xd15a('0x20')](_0x3b059d[_0xd15a('0x44')][_0xd15a('0x20')]);_0x30f492['offset']=qs[_0xd15a('0x1e')](_0x3b059d[_0xd15a('0x44')]['offset']);}_0x30f492[_0xd15a('0x4b')]=qs['sort'](_0x3b059d['query'][_0xd15a('0x4c')]);_0x30f492[_0xd15a('0x4d')]=qs[_0xd15a('0x4e')](_[_0xd15a('0x4f')](_0x3b059d['query'],_0x106fb7[_0xd15a('0x4e')]),_0x5a5efc);var _0x3ce34b=[];var _0x584c2f=squel[_0xd15a('0x50')]()[_0xd15a('0x51')]('id')[_0xd15a('0x51')](_0xd15a('0x2c'))[_0xd15a('0x51')](_0xd15a('0x52'))[_0xd15a('0x53')](_0xd15a('0x54'));var _0x1508a4=squel[_0xd15a('0x50')]()[_0xd15a('0x51')](_0xd15a('0x55'))[_0xd15a('0x51')](_0xd15a('0x56'))['field'](_0xd15a('0x57'))[_0xd15a('0x53')](_0xd15a('0x58'),'ui')[_0xd15a('0x59')](_0xd15a('0x5a'),'u',_0xd15a('0x5b'));var _0x39986c=squel[_0xd15a('0x50')]()[_0xd15a('0x53')](_0xd15a('0x5c'),'i')[_0xd15a('0x59')](_0xd15a('0x5d'),'c',_0xd15a('0x5e'))['left_join'](_0xd15a('0x5a'),'o',_0xd15a('0x5f'))[_0xd15a('0x59')](_0xd15a('0x60'),'a',_0xd15a('0x61'))[_0xd15a('0x59')](_0xd15a('0x62'),'me',_0xd15a('0x63'))[_0xd15a('0x59')](_0xd15a('0x64'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xd15a('0x59')](_0xd15a('0x54'),'t',_0xd15a('0x65'));var _0x6f8c7e=squel['expr']();var _0x1b977c=[];var _0x29d9c3=squel[_0xd15a('0x66')]();var _0x1418cf;if(_0x3b059d[_0xd15a('0x44')][_0xd15a('0x67')]){_0x1418cf=as[_0xd15a('0x68')](_0x3b059d[_0xd15a('0x44')][_0xd15a('0x67')]);var _0x470423=_0x1418cf[_0xd15a('0x69')];for(var _0x545036=0x0;_0x545036<_0x1418cf['conditions']['length'];_0x545036++){var _0x5af3d4=_0x1418cf[_0xd15a('0x6a')][_0x545036];var _0xe522da='i';var _0xdc054f=_[_0xd15a('0x6b')](_0x5a5efc,['name',_0x5af3d4[_0xd15a('0x51')]]);if(!_0xdc054f){switch(_0x5af3d4[_0xd15a('0x51')]){case _0xd15a('0x6c'):if(_0x5af3d4[_0xd15a('0x6d')]==0x1){_0x39986c[_0xd15a('0x6e')]('`'+_0x5af3d4[_0xd15a('0x51')]+'`\x20=\x200');}else{_0x39986c[_0xd15a('0x6e')]('`'+_0x5af3d4[_0xd15a('0x51')]+_0xd15a('0x6f'));}break;case _0xd15a('0x70'):if(_0x5af3d4[_0xd15a('0x71')]===_0xd15a('0x72')){if(_0x5af3d4[_0xd15a('0x6d')][_0xd15a('0x32')]('\x20')[_0xd15a('0x48')]>0x1){_0x6f8c7e[_0x470423](_0xd15a('0x73'),qs['getFullTextValue'](_0x5af3d4[_0xd15a('0x6d')]),null);}else{var _0x11916d='%'+_0x5af3d4['value']+'%';_0x6f8c7e[_0x470423](_0xd15a('0x74'),_0x11916d,_0x11916d,_0x11916d);}}else{_0xdc054f=_[_0xd15a('0x6b')](_0x5a5efc,[_0xd15a('0x2c'),_0xd15a('0x75')]);_0x5af3d4[_0xd15a('0x51')]='ContactId';_0x35f3cf=as[_0xd15a('0x76')](_0xe522da,_0xdc054f['type'],_0x5af3d4);_0x6f8c7e[_0x470423](_0x35f3cf[_0xd15a('0x77')],_0x35f3cf[_0xd15a('0x6d')]['start'],_0x35f3cf[_0xd15a('0x6d')]['end']);}break;case _0xd15a('0x78'):var _0x208903=_0x5af3d4[_0xd15a('0x6d')]['split'](',')[_0xd15a('0x2f')](function(_0x5d60a7){return Number(_0x5d60a7);});_0x208903['forEach'](function(_0x276567){_0x29d9c3['or'](_0xd15a('0x79'),'%,'+_0x276567+',%');});_0x1b977c=_[_0xd15a('0x7a')](_0x1b977c,_0x208903);break;case _0xd15a('0x7b'):if(_0x5af3d4[_0xd15a('0x71')]==='$substring'){_0x6f8c7e[_0x470423]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5af3d4[_0xd15a('0x6d')]+'%',null);}else{_0xdc054f=_['find'](_0x5a5efc,[_0xd15a('0x2c'),_0xd15a('0x3b')]);_0x5af3d4[_0xd15a('0x51')]=_0xd15a('0x3b');_0x35f3cf=as['buildExpression'](_0xe522da,_0xdc054f['type'],_0x5af3d4);_0x6f8c7e[_0x470423](_0x35f3cf[_0xd15a('0x77')],_0x35f3cf[_0xd15a('0x6d')][_0xd15a('0x7c')],_0x35f3cf['value'][_0xd15a('0x1d')]);}break;case _0xd15a('0x7d'):_0x35f3cf=as[_0xd15a('0x76')]('me',null,_0x5af3d4);_0x6f8c7e[_0x470423](_0x35f3cf[_0xd15a('0x77')],_0x35f3cf[_0xd15a('0x6d')][_0xd15a('0x7c')],_0x35f3cf[_0xd15a('0x6d')][_0xd15a('0x1d')]);break;}}else{var _0x35f3cf=as[_0xd15a('0x76')](_0xe522da,_0xdc054f[_0xd15a('0x40')],_0x5af3d4);_0x6f8c7e[_0x470423](_0x35f3cf[_0xd15a('0x77')],_0x35f3cf[_0xd15a('0x6d')][_0xd15a('0x7c')],_0x35f3cf[_0xd15a('0x6d')][_0xd15a('0x1d')]);}}}else{var _0x541cb6=_(_0x3b059d[_0xd15a('0x44')])[_0xd15a('0x43')]()[_0xd15a('0x2f')](function(_0x31425f){return _[_0xd15a('0x7e')](_0x5a5efc,['name',_0x31425f])?_0x31425f:undefined;})[_0xd15a('0x7f')]()[_0xd15a('0x6d')]();if(!_['isEmpty'](_0x541cb6)){_0x541cb6[_0xd15a('0x33')](function(_0x392092){if(_0x392092===_0xd15a('0x80')){_0x39986c[_0xd15a('0x4d')](_0xd15a('0x81'),[]['concat'](_0x3b059d[_0xd15a('0x44')][_0x392092]));}else if(_0x392092===_0xd15a('0x82')){var _0x2852c5=JSON[_0xd15a('0x83')](_0x3b059d[_0xd15a('0x44')][_0x392092])['$gte'];var _0x1b9ec2=JSON[_0xd15a('0x83')](_0x3b059d['query'][_0x392092])[_0xd15a('0x84')];_0x39986c[_0xd15a('0x4d')](_0xd15a('0x85'),_0x2852c5,_0x1b9ec2);}else{if(_0x3b059d[_0xd15a('0x44')][_0x392092]==='null'){_0x39986c[_0xd15a('0x4d')]('i.'+_0x392092+'\x20IS\x20NULL');}else{_0x39986c['where']('i.'+_0x392092+_0xd15a('0x86'),_0x3b059d[_0xd15a('0x44')][_0x392092]);}}});}if(_0x3b059d[_0xd15a('0x44')]['read']){if(_0x3b059d[_0xd15a('0x44')][_0xd15a('0x87')]==0x1){_0x39986c[_0xd15a('0x6e')](_0xd15a('0x88'));}else{_0x39986c['having'](_0xd15a('0x89'));}}if(_0x3b059d[_0xd15a('0x44')][_0xd15a('0x8a')]){_0x1b977c=_[_0xd15a('0x8b')](_0x3b059d[_0xd15a('0x44')]['tag'])?_0x3b059d['query']['tag']:new Array(_0x3b059d['query'][_0xd15a('0x8a')]);_0x1b977c['forEach'](function(_0x2c3d98){_0x29d9c3['or'](_0xd15a('0x79'),'%,'+_0x2c3d98+',%');});}if(_0x3b059d['query']['filter']){var _0x457a0a=_0x3b059d['query']['filter'][_0xd15a('0x8c')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x457a0a)){_0x6f8c7e['or']('i.id\x20LIKE\x20?',_0x457a0a+'%')['or'](_0xd15a('0x8d'),_0x457a0a+'%');}else{_0x6f8c7e['or'](_0xd15a('0x8e'),qs[_0xd15a('0x8f')](_0x457a0a))['or'](_0xd15a('0x90'),_0x457a0a+'%');}}}_0x39986c[_0xd15a('0x4d')](_0x6f8c7e);_0x39986c[_0xd15a('0x91')](_0xd15a('0x92'));var _0x2049f4={'type':db['Sequelize'][_0xd15a('0x93')][_0xd15a('0x94')],'raw':!![]};var _0x29f0a0=_0x39986c[_0xd15a('0x95')]();_0x29f0a0[_0xd15a('0x51')](_0xd15a('0x92'));_0x29f0a0[_0xd15a('0x51')](_0xd15a('0x96'),'unreadMessages');if(_0x30f492[_0xd15a('0x4b')]){_0x30f492[_0xd15a('0x4b')]['forEach'](function(_0x573779){var _0x5a0bed=_0x573779[0x0]===_0xd15a('0x97')?_0x573779[0x0]:'i.'+_0x573779[0x0];_0x39986c[_0xd15a('0x4b')](_0x5a0bed,_0x573779[0x1]===_0xd15a('0x98')?![]:!![]);});}if(!_[_0xd15a('0x99')](_0x1b977c)){_0x39986c[_0xd15a('0x6e')](_0x29d9c3);_0x29f0a0[_0xd15a('0x4d')](_0xd15a('0x9a'),_0x1b977c);}BPromise['resolve']()[_0xd15a('0x27')](function(){if(!_0x1418cf){if(_0x3b059d[_0xd15a('0x44')][_0xd15a('0x80')])return;_0x29f0a0[_0xd15a('0x4d')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x39986c[_0xd15a('0x4d')](_0xd15a('0x9b'));return;}if(_0x3b059d['user']['role']!==_0xd15a('0x9c'))return;return _0x3b059d[_0xd15a('0x9d')][_0xd15a('0x9e')]({'attributes':['id'],'raw':!![]})[_0xd15a('0x27')](function(_0xddcc34){if(_['isEmpty'](_0xddcc34)){_0x29f0a0[_0xd15a('0x4d')](_0xd15a('0x9f'));_0x39986c[_0xd15a('0x4d')](_0xd15a('0x9f'));}else{_0x29f0a0['where'](_0xd15a('0x81'),_[_0xd15a('0x2f')](_0xddcc34,'id'));_0x39986c[_0xd15a('0x4d')](_0xd15a('0x81'),_[_0xd15a('0x2f')](_0xddcc34,'id'));}});})[_0xd15a('0x27')](function(){if(_0x3b059d[_0xd15a('0x9d')][_0xd15a('0xa0')]===_0xd15a('0x9c')&&!_0x1418cf&&!_0x3b059d[_0xd15a('0x44')][_0xd15a('0x80')])return[];return db[_0xd15a('0xa1')]['query'](_0x29f0a0[_0xd15a('0xa2')](),_0x2049f4);})[_0xd15a('0x27')](function(_0x31806c){_0x1e0817[_0xd15a('0x21')]=_0x31806c[_0xd15a('0x48')];if(_0x1e0817[_0xd15a('0x21')]===0x0)return[];return db[_0xd15a('0xa1')][_0xd15a('0x44')](_0x584c2f[_0xd15a('0xa2')](),_0x2049f4)['then'](function(_0x361b68){_0x3ce34b=_[_0xd15a('0xa3')](_0x361b68,'id');_0x2049f4=_[_0xd15a('0xa4')](_0x2049f4,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3b059d[_0xd15a('0x44')][_0xd15a('0x46')]){_0x30f492['attributes'][_0xd15a('0x33')](function(_0x115fda){_0x39986c['field']('i.'+_0x115fda);});}else{_0x39986c[_0xd15a('0x51')](_0xd15a('0x96'),_0xd15a('0x6c'));_0x39986c[_0xd15a('0x51')](_0xd15a('0xa5'),_0xd15a('0xa6'));_0x39986c[_0xd15a('0x51')](_0xd15a('0xa7'),_0xd15a('0xa8'));_0x39986c['field'](_0xd15a('0xa9'),_0xd15a('0x97'));_0x39986c[_0xd15a('0x51')](_0xd15a('0xaa'));_0x39986c[_0xd15a('0x51')](_0xd15a('0xab'),_0xd15a('0xac'));_0x39986c[_0xd15a('0x51')]('c.lastName',_0xd15a('0xad'));_0x39986c['field'](_0xd15a('0xae'),_0xd15a('0xaf'));_0x39986c[_0xd15a('0x51')]('c.phone','Contact.phone');_0x39986c['field'](_0xd15a('0xb0'),_0xd15a('0xb1'));_0x39986c[_0xd15a('0x51')]('c.fax',_0xd15a('0xb2'));_0x39986c[_0xd15a('0x51')](_0xd15a('0xb3'),_0xd15a('0xb4'));_0x39986c[_0xd15a('0x51')](_0xd15a('0xb5'),_0xd15a('0xb6'));_0x39986c[_0xd15a('0x51')](_0xd15a('0xb7'),_0xd15a('0x30'));}if(_0x30f492['limit'])_0x39986c[_0xd15a('0x20')](_0x30f492[_0xd15a('0x20')]);if(_0x30f492[_0xd15a('0x1e')])_0x39986c[_0xd15a('0x1e')](_0x30f492[_0xd15a('0x1e')]);return db['sequelize'][_0xd15a('0x44')](_0x39986c[_0xd15a('0xa2')](),_0x2049f4);})[_0xd15a('0x27')](function(_0x2291e2){if(_0x2291e2[_0xd15a('0x48')]>0x0)_0x1508a4[_0xd15a('0x4d')](_0xd15a('0xb8'),_[_0xd15a('0x2f')](_0x2291e2,'id'));return db[_0xd15a('0xa1')][_0xd15a('0x44')](_0x1508a4[_0xd15a('0xa2')](),_0x2049f4)['then'](function(_0x5dddad){var _0x5607ff=_[_0xd15a('0xb9')](_0x5dddad,_0xd15a('0xba'));var _0x467a6d=[];_0x2291e2[_0xd15a('0x33')](function(_0x58cbba){_0x467a6d[_0xd15a('0xbb')](updateSmsInteraction(_0x58cbba,_0x3ce34b,_0x5607ff));});return BPromise[_0xd15a('0xbc')](_0x467a6d);});});})['then'](function(_0x2fb9d2){_0x1e0817[_0xd15a('0xbd')]=_0x2fb9d2;return _0x1e0817;})[_0xd15a('0x27')](respondWithFilteredResult(_0x34fee7,_0x30f492))[_0xd15a('0x34')](handleError(_0x34fee7,null));};exports['show']=function(_0x283084,_0x23584d){var _0x3f5878={'raw':![],'where':{'id':_0x283084['params']['id']}},_0x5ee737={};_0x5ee737[_0xd15a('0x42')]=_['keys'](db[_0xd15a('0x3d')][_0xd15a('0x3e')]);_0x5ee737[_0xd15a('0x44')]=_['keys'](_0x283084[_0xd15a('0x44')]);_0x5ee737['filters']=_[_0xd15a('0x45')](_0x5ee737[_0xd15a('0x42')],_0x5ee737[_0xd15a('0x44')]);_0x3f5878[_0xd15a('0x47')]=_[_0xd15a('0x45')](_0x5ee737['model'],qs[_0xd15a('0x46')](_0x283084[_0xd15a('0x44')][_0xd15a('0x46')]));_0x3f5878['attributes']=_0x3f5878[_0xd15a('0x47')][_0xd15a('0x48')]?_0x3f5878[_0xd15a('0x47')]:_0x5ee737['model'];if(_0x283084['query'][_0xd15a('0xbe')]){_0x3f5878[_0xd15a('0xbf')]=[{'all':!![]}];}_0x3f5878=_[_0xd15a('0xa4')]({},_0x3f5878,_0x283084[_0xd15a('0xc0')]);return db[_0xd15a('0x3d')]['find'](_0x3f5878)[_0xd15a('0x27')](handleEntityNotFound(_0x23584d,null))[_0xd15a('0x27')](respondWithResult(_0x23584d,null))['catch'](handleError(_0x23584d,null));};exports[_0xd15a('0xc1')]=function(_0x3b0e17,_0x12ae9e){return db[_0xd15a('0x3d')][_0xd15a('0xc1')](_0x3b0e17[_0xd15a('0x7d')],{})[_0xd15a('0x27')](respondWithResult(_0x12ae9e,0xc9))[_0xd15a('0x34')](handleError(_0x12ae9e,null));};exports[_0xd15a('0x26')]=function(_0x52da49,_0x3d86a5){if(_0x52da49[_0xd15a('0x7d')]['id']){delete _0x52da49[_0xd15a('0x7d')]['id'];}return db[_0xd15a('0x3d')][_0xd15a('0x6b')]({'where':{'id':_0x52da49[_0xd15a('0xc2')]['id']}})[_0xd15a('0x27')](handleEntityNotFound(_0x3d86a5,null))['then'](saveUpdates(_0x52da49[_0xd15a('0x7d')],null))[_0xd15a('0x27')](respondWithResult(_0x3d86a5,null))[_0xd15a('0x34')](handleError(_0x3d86a5,null));};exports[_0xd15a('0x28')]=function(_0x4b036e,_0x5ea30a){return db[_0xd15a('0x3d')]['find']({'where':{'id':_0x4b036e['params']['id']}})[_0xd15a('0x27')](handleEntityNotFound(_0x5ea30a,null))[_0xd15a('0x27')](removeEntity(_0x5ea30a,null))[_0xd15a('0x34')](handleError(_0x5ea30a,null));};exports[_0xd15a('0xc3')]=function(_0x2a9f98,_0x3cd8cd){return db[_0xd15a('0x3d')]['describe']()[_0xd15a('0x27')](respondWithResult(_0x3cd8cd,null))[_0xd15a('0x34')](handleError(_0x3cd8cd,null));};exports[_0xd15a('0xc4')]=function(_0x2f76bf,_0x259055,_0xcbd032){return db[_0xd15a('0xc5')][_0xd15a('0x6b')]({'where':{'id':_0x2f76bf[_0xd15a('0xc2')]['id']}})['then'](handleEntityNotFound(_0x259055,null))[_0xd15a('0x27')](function(_0x2cc03e){if(_0x2cc03e){return _0x2cc03e['addMessage'](_0x2f76bf[_0xd15a('0x7d')][_0xd15a('0xc6')],_['omit'](_0x2f76bf[_0xd15a('0x7d')],['ids','id'])||{});}})[_0xd15a('0x27')](respondWithResult(_0x259055,null))[_0xd15a('0x34')](handleError(_0x259055,null));};exports[_0xd15a('0xc7')]=function(_0x49cf7e,_0x53d428,_0x3f3f5a){var _0x587bc0={'raw':![],'where':{}};var _0x42b4fa={};var _0x5a70a0={'count':0x0,'rows':[]};return db[_0xd15a('0x3d')][_0xd15a('0xc8')]({'where':{'id':_0x49cf7e['params']['id']}})['then'](handleEntityNotFound(_0x53d428,null))[_0xd15a('0x27')](function(_0x546b4d){if(_0x546b4d){_0x42b4fa[_0xd15a('0x42')]=_['keys'](db[_0xd15a('0xc5')][_0xd15a('0x3e')]);_0x42b4fa[_0xd15a('0x44')]=_[_0xd15a('0x43')](_0x49cf7e[_0xd15a('0x44')]);_0x42b4fa[_0xd15a('0x4e')]=_[_0xd15a('0x45')](_0x42b4fa[_0xd15a('0x42')],_0x42b4fa[_0xd15a('0x44')]);_0x587bc0[_0xd15a('0x47')]=_[_0xd15a('0x45')](_0x42b4fa[_0xd15a('0x42')],qs[_0xd15a('0x46')](_0x49cf7e[_0xd15a('0x44')][_0xd15a('0x46')]));_0x587bc0[_0xd15a('0x47')]=_0x587bc0['attributes'][_0xd15a('0x48')]?_0x587bc0[_0xd15a('0x47')]:_0x42b4fa[_0xd15a('0x42')];if(!_0x49cf7e[_0xd15a('0x44')][_0xd15a('0x49')](_0xd15a('0x4a'))){_0x587bc0['limit']=qs[_0xd15a('0x20')](_0x49cf7e[_0xd15a('0x44')][_0xd15a('0x20')]);_0x587bc0[_0xd15a('0x1e')]=qs[_0xd15a('0x1e')](_0x49cf7e[_0xd15a('0x44')][_0xd15a('0x1e')]);}_0x587bc0['order']=qs[_0xd15a('0x4c')](_0x49cf7e[_0xd15a('0x44')][_0xd15a('0x4c')]);_0x587bc0['where']=qs[_0xd15a('0x4e')](_[_0xd15a('0x4f')](_0x49cf7e[_0xd15a('0x44')],_0x42b4fa[_0xd15a('0x4e')]));_0x587bc0[_0xd15a('0x4d')][_0xd15a('0xba')]=_0x546b4d['id'];if(_0x49cf7e['query'][_0xd15a('0xc9')]){_0x587bc0[_0xd15a('0x4d')]=_[_0xd15a('0xa4')](_0x587bc0['where'],{'$or':_[_0xd15a('0x2f')](_0x587bc0[_0xd15a('0x47')],function(_0x5f6222){var _0x3dafa8={};_0x3dafa8[_0x5f6222]={'$like':'%'+_0x49cf7e[_0xd15a('0x44')][_0xd15a('0xc9')]+'%'};return _0x3dafa8;})});}if(_0x49cf7e[_0xd15a('0x44')][_0xd15a('0xca')]){var _0x55176e=_0x49cf7e['query']['$gte'][_0xd15a('0x32')](',');var _0x1b52cb={};_0x1b52cb[_0x55176e[0x0]]={'$gte':moment(_0x55176e[0x1])[_0xd15a('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x587bc0[_0xd15a('0x4d')]=_[_0xd15a('0xa4')](_0x587bc0['where'],_0x1b52cb);}_0x587bc0=_[_0xd15a('0xa4')]({},_0x587bc0,_0x49cf7e[_0xd15a('0xc0')]);return db['SmsMessage'][_0xd15a('0x21')]({'where':_0x587bc0['where']})['then'](function(_0x4a941e){_0x5a70a0[_0xd15a('0x21')]=_0x4a941e;if(_0x49cf7e[_0xd15a('0x44')]['includeAll']){_0x587bc0[_0xd15a('0xbf')]=[{'all':!![]}];}return db[_0xd15a('0xc5')][_0xd15a('0xcc')](_0x587bc0);})[_0xd15a('0x27')](function(_0x100595){_0x5a70a0[_0xd15a('0xbd')]=_0x100595;return _0x5a70a0;});}})[_0xd15a('0x27')](respondWithFilteredResult(_0x53d428,_0x587bc0))[_0xd15a('0x34')](handleError(_0x53d428,null));};exports[_0xd15a('0xcd')]=function(_0x5b2052,_0x3fefc4,_0x29f909){return db['SmsInteraction'][_0xd15a('0x6b')]({'where':{'id':_0x5b2052['params']['id']}})[_0xd15a('0x27')](handleEntityNotFound(_0x3fefc4,null))[_0xd15a('0x27')](function(_0x5401e4){if(_0x5401e4){return _0x5401e4[_0xd15a('0xce')](_0x5b2052[_0xd15a('0x7d')][_0xd15a('0xc6')],_[_0xd15a('0xcf')](_0x5b2052[_0xd15a('0x7d')],[_0xd15a('0xc6'),'id'])||{})['spread'](function(){return db['Tag'][_0xd15a('0xcc')]({'attributes':['id',_0xd15a('0x2c'),'color'],'where':{'id':_0x5b2052[_0xd15a('0x7d')][_0xd15a('0xc6')]}});})[_0xd15a('0x27')](function(_0x579705){socket[_0xd15a('0xd0')](_0xd15a('0xd1'),{'id':Number(_0x5b2052[_0xd15a('0xc2')]['id']),'tags':_0x579705||[]});return{'id':Number(_0x5b2052[_0xd15a('0xc2')]['id']),'tags':_0x579705||[]};});}})[_0xd15a('0x27')](respondWithResult(_0x3fefc4,null))[_0xd15a('0x34')](handleError(_0x3fefc4,null));};exports['removeTags']=function(_0x4c62c2,_0x3bd2f3,_0x5eae4c){return db[_0xd15a('0x3d')][_0xd15a('0x6b')]({'where':{'id':_0x4c62c2['params']['id']}})[_0xd15a('0x27')](handleEntityNotFound(_0x3bd2f3,null))['then'](function(_0x3a382f){if(_0x3a382f){return _0x3a382f[_0xd15a('0xd2')](_0x4c62c2['query'][_0xd15a('0xc6')]);}})[_0xd15a('0x27')](respondWithStatusCode(_0x3bd2f3,null))[_0xd15a('0x34')](handleError(_0x3bd2f3,null));};exports[_0xd15a('0xd3')]=function(_0x3fbb72,_0x1c7992){var _0x307c3b=moment()['unix']()['toString']();var _0x380ef4=path['join'](config[_0xd15a('0xd4')],'server',_0xd15a('0xd5'),_0xd15a('0xd6'));var _0x3c847c=path[_0xd15a('0xd7')](config[_0xd15a('0xd4')],_0xd15a('0xd8'),'files',_0xd15a('0xd9'));var _0x3b3c5e=path[_0xd15a('0xd7')](_0x380ef4,_0x307c3b);var _0x198ac1=util[_0xd15a('0xcb')]('transcript-%d-%s.zip',_0x3fbb72[_0xd15a('0xc2')]['id'],_0x307c3b);var _0x19d0a6=path[_0xd15a('0xd7')](_0x380ef4,_0x198ac1);var _0x136ffd=[];_0x136ffd[_0xd15a('0xbb')]({'model':db[_0xd15a('0x7b')],'as':_0xd15a('0x7b'),'attributes':['id',_0xd15a('0xda')],'raw':!![]});_0x136ffd[_0xd15a('0xbb')]({'model':db[_0xd15a('0xdb')],'as':_0xd15a('0x70'),'attributes':['id','firstName',_0xd15a('0xdc')],'raw':!![]});var _0x31dfa9=[{'model':db[_0xd15a('0xc5')],'as':_0xd15a('0xdd'),'attributes':['id',_0xd15a('0x7d'),_0xd15a('0x82'),_0xd15a('0xde'),'secret','read'],'include':_0x136ffd}];_0x31dfa9[_0xd15a('0xbb')]({'model':db[_0xd15a('0xdf')],'as':'Account','attributes':['id',_0xd15a('0x2c')]});_0x31dfa9[_0xd15a('0xbb')]({'model':db[_0xd15a('0x7b')],'as':'Owner','attributes':['id',_0xd15a('0xda')]});return db['SmsInteraction'][_0xd15a('0x6b')]({'where':{'id':_0x3fbb72['params']['id']},'include':_0x31dfa9})[_0xd15a('0x27')](handleEntityNotFound(_0x1c7992,null))[_0xd15a('0x27')](function(_0x215583){if(_0x215583){var _0x47ece3=_0x215583[_0xd15a('0xe0')]({'plain':!![]});fs[_0xd15a('0xe1')](_0x3b3c5e);var _0x2d1cb6={'channel':_0xd15a('0xe2'),'account':_0x47ece3[_0xd15a('0xe3')][_0xd15a('0x2c')],'agent':_0x47ece3[_0xd15a('0xe4')]?_0x47ece3['Owner'][_0xd15a('0xda')]:_0xd15a('0xe5'),'createdAt':moment(_0x47ece3[_0xd15a('0x82')])['format'](_0xd15a('0xe6'))[_0xd15a('0xa2')](),'closedAt':_0x47ece3[_0xd15a('0x3a')]?moment(_0x47ece3[_0xd15a('0xe7')])[_0xd15a('0xcb')](_0xd15a('0xe6'))[_0xd15a('0xa2')]():'','disposition':_0x47ece3[_0xd15a('0xe8')],'messages':_(_0x47ece3[_0xd15a('0xdd')])[_0xd15a('0xc9')]({'secret':![]})[_0xd15a('0x2f')](function(_0x5af30f){return{'date':moment(_0x5af30f[_0xd15a('0x82')])[_0xd15a('0xcb')](_0xd15a('0xe6'))[_0xd15a('0xa2')](),'sender':_0x5af30f[_0xd15a('0xde')]===_0xd15a('0xe9')?_0x5af30f['User']?_0x5af30f['User'][_0xd15a('0xda')]:_0xd15a('0xea'):_0x5af30f[_0xd15a('0x70')][_0xd15a('0xeb')]+(_0x5af30f[_0xd15a('0x70')]['lastName']?'\x20'+_0x5af30f[_0xd15a('0x70')][_0xd15a('0xdc')]:''),'body':_0x5af30f[_0xd15a('0x7d')],'direction':_0x5af30f[_0xd15a('0xde')]===_0xd15a('0xe9')?'A':'C','secret':_0x5af30f['secret'],'read':_0x5af30f[_0xd15a('0x87')]};})[_0xd15a('0x6d')]()};return ejs[_0xd15a('0xec')](path[_0xd15a('0xd7')](config[_0xd15a('0xd4')],_0xd15a('0xd8'),_0xd15a('0xed'),_0xd15a('0xee')),{'interaction':_0x2d1cb6})['then'](function(_0x4a3365){var _0x4f9f04=path[_0xd15a('0xd7')](_0x3b3c5e,_0xd15a('0xef')+_0x47ece3['id']+'-'+_0x307c3b+_0xd15a('0xf0'));var _0x51d38b={'path':_0x4f9f04,'channel':_0xd15a('0xe2'),'interactionId':_0x47ece3['id']};return pdf[_0xd15a('0xf1')](_0x4a3365,_0x51d38b);})[_0xd15a('0x27')](function(){return new BPromise(function(_0x522caa,_0x248c15){zipdir(_0x3b3c5e,{'saveTo':_0x19d0a6},function(_0x86794f,_0x25f42b){if(_0x86794f)return _0x248c15(_0x86794f);return _0x522caa(_0x25f42b);});})[_0xd15a('0x27')](function(){return new BPromise(function(_0x1a13d0,_0x1c703a){rimraf(_0x3b3c5e,function(_0x4837f6){if(_0x4837f6)_0x1c703a(_0x4837f6);return _0x1a13d0();});});})[_0xd15a('0x27')](function(){return _0x1c7992['download'](_0x19d0a6,_0x198ac1,function(_0x132d1a){if(_0x132d1a){console[_0xd15a('0xf2')](_0xd15a('0xf3'),_0x132d1a);}else{fs['unlinkSync'](_0x19d0a6);}});});});}else{return _0x1c7992[_0xd15a('0x29')](0xc8);}})[_0xd15a('0x34')](handleError(_0x1c7992,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 2cfbc62..b3ed56c 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 _0xfff0=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','map','findAll'];(function(_0x59915b,_0x4e4011){var _0x5bb17c=function(_0x49ad95){while(--_0x49ad95){_0x59915b['push'](_0x59915b['shift']());}};_0x5bb17c(++_0x4e4011);}(_0xfff0,0x139));var _0x0fff=function(_0x1eb1f1,_0xa5f909){_0x1eb1f1=_0x1eb1f1-0x0;var _0x71eef4=_0xfff0[_0x1eb1f1];return _0x71eef4;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x0fff('0x0'))['db'][_0x0fff('0x1')];var SmsMessage=require(_0x0fff('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0fff('0x2')](0x0);var events={'afterCreate':_0x0fff('0x3'),'afterUpdate':_0x0fff('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2cd3d5){return function(_0x17911e,_0x53c517,_0x33c813){_0x17911e[_0x0fff('0x5')]({'attributes':['id'],'raw':!![]})[_0x0fff('0x6')](function(_0x586dc5){_0x17911e[_0x0fff('0x7')]('Users',_0x586dc5[_0x0fff('0x8')](function(_0x5304a5){return{'id':_0x5304a5['id']};}));return SmsMessage[_0x0fff('0x9')]({'where':{'SmsInteractionId':_0x17911e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0fff('0x6')](function(_0x4cc3f3){_0x17911e[_0x0fff('0x7')](_0x0fff('0xa'),_0x4cc3f3[_0x0fff('0xb')]);SmsInteractionEvents[_0x0fff('0xc')](_0x2cd3d5+':'+_0x17911e['id'],_0x17911e);SmsInteractionEvents[_0x0fff('0xc')](_0x2cd3d5,_0x17911e);_0x33c813(null);})[_0x0fff('0xd')](_0x33c813(null));};}for(var e in events){if(events[_0x0fff('0xe')](e)){var event=events[e];SmsInteraction[_0x0fff('0xf')](e,emitEvent(event));}}module[_0x0fff('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0x6a95=['save','getUsers','then','map','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x6a95,0x1db));var _0x56a9=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x6a95[_0x5b561d];return _0x431060;};'use strict';var EventEmitter=require(_0x56a9('0x0'));var SmsInteraction=require(_0x56a9('0x1'))['db'][_0x56a9('0x2')];var SmsMessage=require(_0x56a9('0x1'))['db'][_0x56a9('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x56a9('0x4')](0x0);var events={'afterCreate':_0x56a9('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x12cd60){return function(_0x83f534,_0x1b42ac,_0x2eb132){_0x83f534[_0x56a9('0x6')]({'attributes':['id'],'raw':!![]})[_0x56a9('0x7')](function(_0xd8aa7c){_0x83f534['setDataValue']('Users',_0xd8aa7c[_0x56a9('0x8')](function(_0x15f2ff){return{'id':_0x15f2ff['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x83f534['id'],'direction':'in','read':![]},'raw':!![]});})[_0x56a9('0x7')](function(_0x1eddfd){_0x83f534[_0x56a9('0x9')](_0x56a9('0xa'),_0x1eddfd[_0x56a9('0xb')]);SmsInteractionEvents[_0x56a9('0xc')](_0x12cd60+':'+_0x83f534['id'],_0x83f534);SmsInteractionEvents[_0x56a9('0xc')](_0x12cd60,_0x83f534);_0x2eb132(null);})[_0x56a9('0xd')](_0x2eb132(null));};}for(var e in events){if(events[_0x56a9('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x56a9('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 c0ae0ce..ac60938 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 _0x3e1f=['../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3c9f2d,_0x307254){var _0x3b5230=function(_0x57cfe5){while(--_0x57cfe5){_0x3c9f2d['push'](_0x3c9f2d['shift']());}};_0x3b5230(++_0x307254);}(_0x3e1f,0xc6));var _0xf3e1=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x3e1f[_0x2b5513];return _0x578fd2;};'use strict';var _=require('lodash');var util=require(_0xf3e1('0x0'));var logger=require(_0xf3e1('0x1'))('api');var moment=require(_0xf3e1('0x2'));var BPromise=require(_0xf3e1('0x3'));var rp=require(_0xf3e1('0x4'));var fs=require('fs');var path=require(_0xf3e1('0x5'));var rimraf=require('rimraf');var config=require(_0xf3e1('0x6'));var attributes=require(_0xf3e1('0x7'));module[_0xf3e1('0x8')]=function(_0x2f0fab,_0x128a4b){return _0x2f0fab[_0xf3e1('0x9')](_0xf3e1('0xa'),attributes,{'tableName':_0xf3e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2db187,_0x52fc17,_0x4214d7){if(_0x2db187[_0xf3e1('0xc')](_0xf3e1('0xd'))){_0x2db187[_0xf3e1('0xe')]=moment()[_0xf3e1('0xf')](_0xf3e1('0x10'));}_0x4214d7(null,_0x2db187);}}});}; \ No newline at end of file +var _0x0435=['SmsInteraction','sms_interactions','changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define'];(function(_0x25eff3,_0x2278a7){var _0xb112fa=function(_0x2eacc1){while(--_0x2eacc1){_0x25eff3['push'](_0x25eff3['shift']());}};_0xb112fa(++_0x2278a7);}(_0x0435,0x136));var _0x5043=function(_0xb60674,_0xa4e08a){_0xb60674=_0xb60674-0x0;var _0x2514a0=_0x0435[_0xb60674];return _0x2514a0;};'use strict';var _=require(_0x5043('0x0'));var util=require(_0x5043('0x1'));var logger=require(_0x5043('0x2'))(_0x5043('0x3'));var moment=require(_0x5043('0x4'));var BPromise=require(_0x5043('0x5'));var rp=require(_0x5043('0x6'));var fs=require('fs');var path=require(_0x5043('0x7'));var rimraf=require(_0x5043('0x8'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x4c16bd,_0xd8e953){return _0x4c16bd[_0x5043('0x9')](_0x5043('0xa'),attributes,{'tableName':_0x5043('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x245eb6,_0x421eee,_0x560809){if(_0x245eb6[_0x5043('0xc')](_0x5043('0xd'))){_0x245eb6[_0x5043('0xe')]=moment()[_0x5043('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x560809(null,_0x245eb6);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index f024a11..ec4fa4a 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 _0x0128=['message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','attributes','limit','debug','AddTagsToSmsInteraction','find','ids','omit','spread','AddTags','util','randomstring','ioredis','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3a44e6,_0x1fda9d){var _0x50f4ea=function(_0x8b3f9b){while(--_0x8b3f9b){_0x3a44e6['push'](_0x3a44e6['shift']());}};_0x50f4ea(++_0x1fda9d);}(_0x0128,0xea));var _0x8012=function(_0x623e16,_0x48402c){_0x623e16=_0x623e16-0x0;var _0xbc32a0=_0x0128[_0x623e16];return _0xbc32a0;};'use strict';var _=require('lodash');var util=require(_0x8012('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8012('0x1'));var fs=require('fs');var Redis=require(_0x8012('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8012('0x3'))('rpc');var config=require(_0x8012('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8012('0x5')][_0x8012('0x6')]({'port':0x232a});config[_0x8012('0x7')]=_[_0x8012('0x8')](config[_0x8012('0x7')],{'host':_0x8012('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8012('0x7')]));require('./smsInteraction.socket')[_0x8012('0xa')](socket);function respondWithRpcPromise(_0x5e4da5,_0x550306,_0x264e25){return new BPromise(function(_0x3673d5,_0x178e91){return client['request'](_0x5e4da5,_0x264e25)[_0x8012('0xb')](function(_0x514107){logger[_0x8012('0xc')](_0x8012('0xd'),_0x550306,_0x8012('0xe'));logger['debug'](_0x8012('0xf'),_0x550306,_0x8012('0xe'),JSON[_0x8012('0x10')](_0x514107));if(_0x514107[_0x8012('0x11')]){if(_0x514107['error']['code']===0x1f4){logger[_0x8012('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x550306,_0x514107['error']['message']);return _0x178e91(_0x514107['error'][_0x8012('0x12')]);}logger[_0x8012('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x550306,_0x514107[_0x8012('0x11')][_0x8012('0x12')]);return _0x3673d5(_0x514107[_0x8012('0x11')][_0x8012('0x12')]);}else{logger[_0x8012('0xc')](_0x8012('0xd'),_0x550306,_0x8012('0xe'));_0x3673d5(_0x514107[_0x8012('0x13')][_0x8012('0x12')]);}})[_0x8012('0x14')](function(_0x20bbf3){logger[_0x8012('0x11')](_0x8012('0xd'),_0x550306,_0x20bbf3);_0x178e91(_0x20bbf3);});});}exports[_0x8012('0x15')]=function(_0x3cdf20){var _0x3d5c7a=this;return new Promise(function(_0x4d58d6,_0x54755a){return db[_0x8012('0x16')][_0x8012('0x17')](_0x3cdf20[_0x8012('0x18')],{'raw':_0x3cdf20[_0x8012('0x19')]?_0x3cdf20[_0x8012('0x19')][_0x8012('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cdf20[_0x8012('0x19')]?_0x3cdf20[_0x8012('0x19')]['where']||null:null,'attributes':_0x3cdf20['options']?_0x3cdf20['options'][_0x8012('0x1b')]||null:null,'limit':_0x3cdf20[_0x8012('0x19')]?_0x3cdf20['options'][_0x8012('0x1c')]||null:null})['then'](function(_0x288041){logger[_0x8012('0xc')]('UpdateSmsInteraction',_0x3cdf20);logger[_0x8012('0x1d')](_0x8012('0x15'),_0x3cdf20,JSON[_0x8012('0x10')](_0x288041));_0x4d58d6(_0x288041);})[_0x8012('0x14')](function(_0x4e12ed){logger[_0x8012('0x11')](_0x8012('0x15'),_0x4e12ed[_0x8012('0x12')],_0x3cdf20);_0x54755a(_0x3d5c7a[_0x8012('0x11')](0x1f4,_0x4e12ed[_0x8012('0x12')]));});});};exports[_0x8012('0x1e')]=function(_0x20f934){return new Promise(function(_0xf8e649,_0x5bf429){return db[_0x8012('0x16')][_0x8012('0x1f')]({'where':_0x20f934[_0x8012('0x19')]?_0x20f934[_0x8012('0x19')]['where']||null:null})[_0x8012('0xb')](function(_0x432fd3){if(_0x432fd3){return _0x432fd3['addTags'](_0x20f934['body'][_0x8012('0x20')],_[_0x8012('0x21')](_0x20f934[_0x8012('0x18')],['ids','id'])||{});}})[_0x8012('0x22')](function(_0x2014e6){logger[_0x8012('0xc')](_0x8012('0x23'),_0x20f934);logger['debug']('AddTags',_0x20f934,JSON[_0x8012('0x10')](_0x2014e6));_0xf8e649(_0x2014e6);})['catch'](function(_0x45ace8){logger[_0x8012('0x11')](_0x8012('0x23'),_0x45ace8[_0x8012('0x12')],_0x20f934);_0x5bf429(_this['error'](0x1f4,_0x45ace8['message']));});});}; \ No newline at end of file +var _0x05bc=['result','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','AddTagsToSmsInteraction','find','omit','spread','AddTags','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsInteraction,\x20%s,\x20%s'];(function(_0x2b0e02,_0x35baf2){var _0x49c17e=function(_0x362f76){while(--_0x362f76){_0x2b0e02['push'](_0x2b0e02['shift']());}};_0x49c17e(++_0x35baf2);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc05b('0x0'));var moment=require('moment');var BPromise=require(_0xc05b('0x1'));var rs=require(_0xc05b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc05b('0x3'))['db'];var utils=require(_0xc05b('0x4'));var logger=require(_0xc05b('0x5'))(_0xc05b('0x6'));var config=require(_0xc05b('0x7'));var jayson=require(_0xc05b('0x8'));var client=jayson[_0xc05b('0x9')][_0xc05b('0xa')]({'port':0x232a});config[_0xc05b('0xb')]=_[_0xc05b('0xc')](config[_0xc05b('0xb')],{'host':_0xc05b('0xd'),'port':0x18eb});var socket=require(_0xc05b('0xe'))(new Redis(config[_0xc05b('0xb')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x2e0ae1,_0x430531,_0x376e79){return new BPromise(function(_0xd204ca,_0x321c76){return client[_0xc05b('0xf')](_0x2e0ae1,_0x376e79)[_0xc05b('0x10')](function(_0x3c6cdd){logger[_0xc05b('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x430531,_0xc05b('0x12'));logger[_0xc05b('0x13')](_0xc05b('0x14'),_0x430531,_0xc05b('0x12'),JSON[_0xc05b('0x15')](_0x3c6cdd));if(_0x3c6cdd[_0xc05b('0x16')]){if(_0x3c6cdd['error'][_0xc05b('0x17')]===0x1f4){logger[_0xc05b('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x430531,_0x3c6cdd['error'][_0xc05b('0x18')]);return _0x321c76(_0x3c6cdd[_0xc05b('0x16')][_0xc05b('0x18')]);}logger[_0xc05b('0x16')](_0xc05b('0x19'),_0x430531,_0x3c6cdd[_0xc05b('0x16')][_0xc05b('0x18')]);return _0xd204ca(_0x3c6cdd['error'][_0xc05b('0x18')]);}else{logger[_0xc05b('0x11')](_0xc05b('0x19'),_0x430531,_0xc05b('0x12'));_0xd204ca(_0x3c6cdd[_0xc05b('0x1a')][_0xc05b('0x18')]);}})['catch'](function(_0x36fb39){logger['error'](_0xc05b('0x19'),_0x430531,_0x36fb39);_0x321c76(_0x36fb39);});});}exports[_0xc05b('0x1b')]=function(_0x45d561){var _0x12dcd5=this;return new Promise(function(_0x11531b,_0x48c36e){return db[_0xc05b('0x1c')][_0xc05b('0x1d')](_0x45d561[_0xc05b('0x1e')],{'raw':_0x45d561[_0xc05b('0x1f')]?_0x45d561['options'][_0xc05b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45d561[_0xc05b('0x1f')]?_0x45d561[_0xc05b('0x1f')][_0xc05b('0x21')]||null:null,'attributes':_0x45d561[_0xc05b('0x1f')]?_0x45d561[_0xc05b('0x1f')]['attributes']||null:null,'limit':_0x45d561['options']?_0x45d561[_0xc05b('0x1f')][_0xc05b('0x22')]||null:null})['then'](function(_0x949652){logger['info']('UpdateSmsInteraction',_0x45d561);logger[_0xc05b('0x13')]('UpdateSmsInteraction',_0x45d561,JSON['stringify'](_0x949652));_0x11531b(_0x949652);})['catch'](function(_0x3a085f){logger['error'](_0xc05b('0x1b'),_0x3a085f[_0xc05b('0x18')],_0x45d561);_0x48c36e(_0x12dcd5['error'](0x1f4,_0x3a085f[_0xc05b('0x18')]));});});};exports[_0xc05b('0x23')]=function(_0x444a55){return new Promise(function(_0x3e26c4,_0x23a937){return db[_0xc05b('0x1c')][_0xc05b('0x24')]({'where':_0x444a55[_0xc05b('0x1f')]?_0x444a55[_0xc05b('0x1f')][_0xc05b('0x21')]||null:null})[_0xc05b('0x10')](function(_0x35f8f7){if(_0x35f8f7){return _0x35f8f7['addTags'](_0x444a55[_0xc05b('0x1e')]['ids'],_[_0xc05b('0x25')](_0x444a55['body'],['ids','id'])||{});}})[_0xc05b('0x26')](function(_0x772f50){logger[_0xc05b('0x11')]('AddTags',_0x444a55);logger[_0xc05b('0x13')]('AddTags',_0x444a55,JSON['stringify'](_0x772f50));_0x3e26c4(_0x772f50);})['catch'](function(_0x390e5c){logger[_0xc05b('0x16')](_0xc05b('0x27'),_0x390e5c['message'],_0x444a55);_0x23a937(_this[_0xc05b('0x16')](0x1f4,_0x390e5c[_0xc05b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index c017aea..319e1a9 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 _0xa823=['removeListener','register','smsInteraction:','./smsInteraction.events','save','remove','update','emit'];(function(_0x21d36e,_0x5dc096){var _0x4cc307=function(_0x4ae995){while(--_0x4ae995){_0x21d36e['push'](_0x21d36e['shift']());}};_0x4cc307(++_0x5dc096);}(_0xa823,0x1eb));var _0x3a82=function(_0x555f97,_0x15720e){_0x555f97=_0x555f97-0x0;var _0x113858=_0xa823[_0x555f97];return _0x113858;};'use strict';var SmsInteractionEvents=require(_0x3a82('0x0'));var events=[_0x3a82('0x1'),_0x3a82('0x2'),_0x3a82('0x3')];function createListener(_0x3191c0,_0x407bde){return function(_0xd77729){_0x407bde[_0x3a82('0x4')](_0x3191c0,_0xd77729);};}function removeListener(_0x182725,_0x11762f){return function(){SmsInteractionEvents[_0x3a82('0x5')](_0x182725,_0x11762f);};}exports[_0x3a82('0x6')]=function(_0xd4bde6){for(var _0x41190c=0x0,_0x1f0d48=events['length'];_0x41190c<_0x1f0d48;_0x41190c++){var _0x16b979=events[_0x41190c];var _0x117e09=createListener(_0x3a82('0x7')+_0x16b979,_0xd4bde6);SmsInteractionEvents['on'](_0x16b979,_0x117e09);}}; \ No newline at end of file +var _0x56b0=['./smsInteraction.events','save','remove','update','emit','length','smsInteraction:'];(function(_0x4fab79,_0x4f76dc){var _0x31ec8e=function(_0x30e845){while(--_0x30e845){_0x4fab79['push'](_0x4fab79['shift']());}};_0x31ec8e(++_0x4f76dc);}(_0x56b0,0xd2));var _0x056b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56b0[_0x3dd15e];return _0x231fd0;};'use strict';var SmsInteractionEvents=require(_0x056b('0x0'));var events=[_0x056b('0x1'),_0x056b('0x2'),_0x056b('0x3')];function createListener(_0x1dccea,_0x274727){return function(_0x1b2aae){_0x274727[_0x056b('0x4')](_0x1dccea,_0x1b2aae);};}function removeListener(_0x41b6b,_0x3f87b8){return function(){SmsInteractionEvents['removeListener'](_0x41b6b,_0x3f87b8);};}exports['register']=function(_0x1bd472){for(var _0x14d9ea=0x0,_0x2b9486=events[_0x056b('0x5')];_0x14d9ea<_0x2b9486;_0x14d9ea++){var _0xa64863=events[_0x14d9ea];var _0x56d266=createListener(_0x056b('0x6')+_0xa64863,_0x1bd472);SmsInteractionEvents['on'](_0xa64863,_0x56d266);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 26d396f..ba9016a 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 _0x06d9=['/:id/reject','reject','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create','status','put','update','/:id/accept','accept'];(function(_0x29c455,_0x7a9f1e){var _0x10d573=function(_0x3df016){while(--_0x3df016){_0x29c455['push'](_0x29c455['shift']());}};_0x10d573(++_0x7a9f1e);}(_0x06d9,0xab));var _0x906d=function(_0x910816,_0x4d013a){_0x910816=_0x910816-0x0;var _0x31a06a=_0x06d9[_0x910816];return _0x31a06a;};'use strict';var multer=require(_0x906d('0x0'));var util=require(_0x906d('0x1'));var path=require(_0x906d('0x2'));var timeout=require('connect-timeout');var express=require(_0x906d('0x3'));var router=express[_0x906d('0x4')]();var fs_extra=require(_0x906d('0x5'));var auth=require(_0x906d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x906d('0x7'));router[_0x906d('0x8')]('/',auth[_0x906d('0x9')](),controller[_0x906d('0xa')]);router[_0x906d('0x8')](_0x906d('0xb'),auth[_0x906d('0x9')](),controller[_0x906d('0xc')]);router[_0x906d('0x8')](_0x906d('0xd'),auth[_0x906d('0x9')](),controller[_0x906d('0xe')]);router[_0x906d('0xf')]('/',auth[_0x906d('0x9')](),interaction[_0x906d('0x10')](_0x906d('0x11'),_0x906d('0x12')),controller[_0x906d('0x13')]);router[_0x906d('0xf')]('/:id/status',controller[_0x906d('0x14')]);router[_0x906d('0x15')](_0x906d('0xd'),auth[_0x906d('0x9')](),controller[_0x906d('0x16')]);router['put'](_0x906d('0x17'),auth[_0x906d('0x9')](),controller[_0x906d('0x18')]);router[_0x906d('0x15')](_0x906d('0x19'),auth[_0x906d('0x9')](),controller[_0x906d('0x1a')]);router[_0x906d('0x1b')]('/:id',auth[_0x906d('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2902=['sms','smsmessage:create','post','/:id/status','status','put','update','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','index','describe','/:id','show','isAuthenticated','tracked'];(function(_0x3da725,_0x7c378d){var _0x41bd11=function(_0x4aa73c){while(--_0x4aa73c){_0x3da725['push'](_0x3da725['shift']());}};_0x41bd11(++_0x7c378d);}(_0x2902,0x77));var _0x2290=function(_0x239dba,_0x309e95){_0x239dba=_0x239dba-0x0;var _0x1ceb11=_0x2902[_0x239dba];return _0x1ceb11;};'use strict';var multer=require(_0x2290('0x0'));var util=require(_0x2290('0x1'));var path=require(_0x2290('0x2'));var timeout=require(_0x2290('0x3'));var express=require('express');var router=express[_0x2290('0x4')]();var fs_extra=require(_0x2290('0x5'));var auth=require(_0x2290('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2290('0x7'));var controller=require(_0x2290('0x8'));router[_0x2290('0x9')]('/',auth['isAuthenticated'](),controller[_0x2290('0xa')]);router[_0x2290('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x2290('0xb')]);router[_0x2290('0x9')](_0x2290('0xc'),auth['isAuthenticated'](),controller[_0x2290('0xd')]);router['post']('/',auth[_0x2290('0xe')](),interaction[_0x2290('0xf')](_0x2290('0x10'),_0x2290('0x11')),controller['create']);router[_0x2290('0x12')](_0x2290('0x13'),controller[_0x2290('0x14')]);router[_0x2290('0x15')](_0x2290('0xc'),auth[_0x2290('0xe')](),controller[_0x2290('0x16')]);router[_0x2290('0x15')]('/:id/accept',auth[_0x2290('0xe')](),controller['accept']);router[_0x2290('0x15')](_0x2290('0x17'),auth[_0x2290('0xe')](),controller[_0x2290('0x18')]);router['delete']('/:id',auth[_0x2290('0xe')](),controller[_0x2290('0x19')]);module[_0x2290('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 22c7f75..838db1e 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 _0xff16=['BOOLEAN','out','DATE','STRING','TEXT','exports','medium'];(function(_0x2e9b75,_0x369ac2){var _0x26e045=function(_0x185265){while(--_0x185265){_0x2e9b75['push'](_0x2e9b75['shift']());}};_0x26e045(++_0x369ac2);}(_0xff16,0xa6));var _0x6ff1=function(_0x3f5768,_0x207987){_0x3f5768=_0x3f5768-0x0;var _0x38c0b9=_0xff16[_0x3f5768];return _0x38c0b9;};'use strict';var Sequelize=require('sequelize');module[_0x6ff1('0x0')]={'body':{'type':Sequelize['TEXT'](_0x6ff1('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x6ff1('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x6ff1('0x3')),'defaultValue':_0x6ff1('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x6ff1('0x4')]},'secret':{'type':Sequelize[_0x6ff1('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x6ff1('0x5')]},'providerResponse':{'type':Sequelize[_0x6ff1('0x6')]}}; \ No newline at end of file +var _0x349f=['TEXT','medium','BOOLEAN','out','DATE','STRING','sequelize','exports'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0x349f,0xae));var _0xf349=function(_0x4a5946,_0x5530a7){_0x4a5946=_0x4a5946-0x0;var _0x2214df=_0x349f[_0x4a5946];return _0x2214df;};'use strict';var Sequelize=require(_0xf349('0x0'));module[_0xf349('0x1')]={'body':{'type':Sequelize[_0xf349('0x2')](_0xf349('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf349('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf349('0x5')),'defaultValue':_0xf349('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xf349('0x6')]},'secret':{'type':Sequelize[_0xf349('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf349('0x7')]},'providerResponse':{'type':Sequelize[_0xf349('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index c238085..75d388e 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 _0x15da=['SmsAccount,\x20%s,\x20%s,\x20%s','plivo','indexOf','Status','plivio','inspect','infobip','results','groupName','DELIVERED','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','create','body','find','params','describe','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','interaction','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','internal','event','rejectmessage','SmsAccount','SmsAccountId','twilio','MessageSid','messageId'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x15da,0x98));var _0xa15d=function(_0x3adafa,_0x1ff5ea){_0x3adafa=_0x3adafa-0x0;var _0x229947=_0x15da[_0x3adafa];return _0x229947;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa15d('0x0'));var zipdir=require(_0xa15d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa15d('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa15d('0x3'));var path=require(_0xa15d('0x4'));var sox=require(_0xa15d('0x5'));var csv=require(_0xa15d('0x6'));var ejs=require(_0xa15d('0x7'));var fs=require('fs');var fs_extra=require(_0xa15d('0x8'));var _=require(_0xa15d('0x9'));var squel=require('squel');var crypto=require(_0xa15d('0xa'));var jsforce=require(_0xa15d('0xb'));var deskjs=require(_0xa15d('0xc'));var toCsv=require(_0xa15d('0x6'));var querystring=require(_0xa15d('0xd'));var Papa=require(_0xa15d('0xe'));var Redis=require(_0xa15d('0xf'));var authService=require(_0xa15d('0x10'));var qs=require(_0xa15d('0x11'));var as=require(_0xa15d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa15d('0x13'))(_0xa15d('0x14'));var utils=require(_0xa15d('0x15'));var config=require(_0xa15d('0x16'));var licenseUtil=require(_0xa15d('0x17'));var db=require(_0xa15d('0x18'))['db'];config['redis']=_['defaults'](config[_0xa15d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa15d('0x1a'))(new Redis(config['redis']));require('./smsMessage.socket')[_0xa15d('0x1b')](socket);var jayson=require(_0xa15d('0x1c'));var client=jayson['client'][_0xa15d('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x540865,_0x2b4845,_0x4a0bea,_0x1e32ac){return new BPromise(function(_0x14e95f,_0x21d678){var _0x45ebb0=_0x1e32ac||client;return _0x45ebb0[_0xa15d('0x1e')](_0x540865,_0x4a0bea)[_0xa15d('0x1f')](function(_0x2f1353){logger[_0xa15d('0x20')](_0xa15d('0x21'),_0x2b4845,'request\x20sent');logger[_0xa15d('0x22')](_0xa15d('0x23'),_0x2b4845,_0xa15d('0x24'),JSON['stringify'](_0x2f1353));if(_0x2f1353[_0xa15d('0x25')]){if(_0x2f1353[_0xa15d('0x25')]['code']===0x1f4){logger[_0xa15d('0x25')](_0xa15d('0x21'),_0x2b4845,_0x2f1353['error'][_0xa15d('0x26')]);return _0x21d678(_0x2f1353['error'][_0xa15d('0x26')]);}logger[_0xa15d('0x25')](_0xa15d('0x21'),_0x2b4845,_0x2f1353['error'][_0xa15d('0x26')]);return _0x14e95f(_0x2f1353['error'][_0xa15d('0x26')]);}else{logger[_0xa15d('0x20')](_0xa15d('0x21'),_0x2b4845,_0xa15d('0x24'));_0x14e95f(_0x2f1353[_0xa15d('0x27')]['message']);}})[_0xa15d('0x28')](function(_0x553025){logger[_0xa15d('0x25')](_0xa15d('0x21'),_0x2b4845,_0x553025);_0x21d678(_0x553025);});});}function respondWithStatusCode(_0x2cfe62,_0x9deb29){_0x9deb29=_0x9deb29||0xcc;return function(_0x39047d){if(_0x39047d){return _0x2cfe62['sendStatus'](_0x9deb29);}return _0x2cfe62[_0xa15d('0x29')](_0x9deb29)[_0xa15d('0x2a')]();};}function respondWithResult(_0x1fa4c1,_0x1f7e30){_0x1f7e30=_0x1f7e30||0xc8;return function(_0xce6c74){if(_0xce6c74){return _0x1fa4c1['status'](_0x1f7e30)[_0xa15d('0x2b')](_0xce6c74);}};}function respondWithFilteredResult(_0x26499e,_0x4edd0e){return function(_0x3a60ae){if(_0x3a60ae){var _0x150b08=typeof _0x4edd0e['offset']===_0xa15d('0x2c')&&typeof _0x4edd0e[_0xa15d('0x2d')]===_0xa15d('0x2c');var _0x3d54bd=_0x3a60ae['count'];var _0x32c593=_0x150b08?0x0:_0x4edd0e[_0xa15d('0x2e')];var _0x259ea9=_0x150b08?_0x3a60ae['count']:_0x4edd0e[_0xa15d('0x2e')]+_0x4edd0e[_0xa15d('0x2d')];var _0x5ba3a3;if(_0x259ea9>=_0x3d54bd){_0x259ea9=_0x3d54bd;_0x5ba3a3=0xc8;}else{_0x5ba3a3=0xce;}_0x26499e[_0xa15d('0x29')](_0x5ba3a3);return _0x26499e[_0xa15d('0x2f')](_0xa15d('0x30'),_0x32c593+'-'+_0x259ea9+'/'+_0x3d54bd)[_0xa15d('0x2b')](_0x3a60ae);}return null;};}function patchUpdates(_0x7d4dac){return function(_0x3a3bf5){try{jsonpatch[_0xa15d('0x31')](_0x3a3bf5,_0x7d4dac,!![]);}catch(_0x4810af){return BPromise[_0xa15d('0x32')](_0x4810af);}return _0x3a3bf5[_0xa15d('0x33')]();};}function saveUpdates(_0x5526c6,_0x197bd0){return function(_0x1ff3fb){if(_0x1ff3fb){return _0x1ff3fb[_0xa15d('0x34')](_0x5526c6)[_0xa15d('0x1f')](function(_0x3f15bd){return _0x3f15bd;});}return null;};}function removeEntity(_0x17225c,_0x38c782){return function(_0x4481bd){if(_0x4481bd){return _0x4481bd[_0xa15d('0x35')]()['then'](function(){_0x17225c[_0xa15d('0x29')](0xcc)[_0xa15d('0x2a')]();});}};}function handleEntityNotFound(_0x5cdb2b,_0x401144){return function(_0xe9e81d){if(!_0xe9e81d){_0x5cdb2b[_0xa15d('0x36')](0x194);}return _0xe9e81d;};}function handleError(_0x570c50,_0x9e57a7){_0x9e57a7=_0x9e57a7||0x1f4;return function(_0x35182c){logger[_0xa15d('0x25')](_0x35182c['stack']);if(_0x35182c[_0xa15d('0x37')]){delete _0x35182c[_0xa15d('0x37')];}_0x570c50[_0xa15d('0x29')](_0x9e57a7)[_0xa15d('0x38')](_0x35182c);};}exports[_0xa15d('0x39')]=function(_0x15d84b,_0x1a7d3f){var _0x198b89={},_0x3d3ee2={},_0x641cec={'count':0x0,'rows':[]};var _0x2bbbb2=_[_0xa15d('0x3a')](db[_0xa15d('0x3b')][_0xa15d('0x3c')],function(_0x5a1edb){return{'name':_0x5a1edb[_0xa15d('0x3d')],'type':_0x5a1edb[_0xa15d('0x3e')][_0xa15d('0x3f')]};});_0x3d3ee2[_0xa15d('0x40')]=_[_0xa15d('0x3a')](_0x2bbbb2,_0xa15d('0x37'));_0x3d3ee2['query']=_[_0xa15d('0x41')](_0x15d84b[_0xa15d('0x42')]);_0x3d3ee2[_0xa15d('0x43')]=_[_0xa15d('0x44')](_0x3d3ee2['model'],_0x3d3ee2[_0xa15d('0x42')]);_0x198b89[_0xa15d('0x45')]=_[_0xa15d('0x44')](_0x3d3ee2['model'],qs[_0xa15d('0x46')](_0x15d84b[_0xa15d('0x42')][_0xa15d('0x46')]));_0x198b89[_0xa15d('0x45')]=_0x198b89[_0xa15d('0x45')][_0xa15d('0x47')]?_0x198b89[_0xa15d('0x45')]:_0x3d3ee2[_0xa15d('0x40')];if(!_0x15d84b[_0xa15d('0x42')][_0xa15d('0x48')](_0xa15d('0x49'))){_0x198b89['limit']=qs['limit'](_0x15d84b['query'][_0xa15d('0x2d')]);_0x198b89[_0xa15d('0x2e')]=qs['offset'](_0x15d84b[_0xa15d('0x42')]['offset']);}_0x198b89[_0xa15d('0x4a')]=qs['sort'](_0x15d84b['query'][_0xa15d('0x4b')]);_0x198b89[_0xa15d('0x4c')]=qs[_0xa15d('0x43')](_[_0xa15d('0x4d')](_0x15d84b[_0xa15d('0x42')],_0x3d3ee2['filters']),_0x2bbbb2);if(_0x15d84b[_0xa15d('0x42')][_0xa15d('0x4e')]){_0x198b89[_0xa15d('0x4c')]=_['merge'](_0x198b89[_0xa15d('0x4c')],{'$or':_[_0xa15d('0x3a')](_0x2bbbb2,function(_0x2e8098){if(_0x2e8098[_0xa15d('0x3e')]!=='VIRTUAL'){var _0x4a4c1c={};_0x4a4c1c[_0x2e8098['name']]={'$like':'%'+_0x15d84b[_0xa15d('0x42')][_0xa15d('0x4e')]+'%'};return _0x4a4c1c;}})});}_0x198b89=_[_0xa15d('0x4f')]({},_0x198b89,_0x15d84b[_0xa15d('0x50')]);var _0x308cfc={'where':_0x198b89['where']};return db[_0xa15d('0x3b')][_0xa15d('0x51')](_0x308cfc)[_0xa15d('0x1f')](function(_0x9bbd6d){_0x641cec['count']=_0x9bbd6d;if(_0x15d84b[_0xa15d('0x42')][_0xa15d('0x52')]){_0x198b89[_0xa15d('0x53')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x198b89);})['then'](function(_0x2a8dcb){_0x641cec['rows']=_0x2a8dcb;return _0x641cec;})[_0xa15d('0x1f')](respondWithFilteredResult(_0x1a7d3f,_0x198b89))[_0xa15d('0x28')](handleError(_0x1a7d3f,null));};exports['show']=function(_0x34813f,_0x430ed5){var _0x37b905={'raw':!![],'where':{'id':_0x34813f['params']['id']}},_0x12632d={};_0x12632d[_0xa15d('0x40')]=_['keys'](db[_0xa15d('0x3b')][_0xa15d('0x3c')]);_0x12632d[_0xa15d('0x42')]=_[_0xa15d('0x41')](_0x34813f['query']);_0x12632d[_0xa15d('0x43')]=_['intersection'](_0x12632d['model'],_0x12632d[_0xa15d('0x42')]);_0x37b905[_0xa15d('0x45')]=_[_0xa15d('0x44')](_0x12632d[_0xa15d('0x40')],qs[_0xa15d('0x46')](_0x34813f[_0xa15d('0x42')][_0xa15d('0x46')]));_0x37b905[_0xa15d('0x45')]=_0x37b905[_0xa15d('0x45')]['length']?_0x37b905[_0xa15d('0x45')]:_0x12632d['model'];if(_0x34813f[_0xa15d('0x42')][_0xa15d('0x52')]){_0x37b905[_0xa15d('0x53')]=[{'all':!![]}];}_0x37b905=_[_0xa15d('0x4f')]({},_0x37b905,_0x34813f['options']);return db[_0xa15d('0x3b')]['find'](_0x37b905)['then'](handleEntityNotFound(_0x430ed5,null))[_0xa15d('0x1f')](respondWithResult(_0x430ed5,null))[_0xa15d('0x28')](handleError(_0x430ed5,null));};exports[_0xa15d('0x54')]=function(_0x575963,_0x1995fd){return db['SmsMessage'][_0xa15d('0x54')](_0x575963[_0xa15d('0x55')],{})[_0xa15d('0x1f')](respondWithResult(_0x1995fd,0xc9))['catch'](handleError(_0x1995fd,null));};exports['update']=function(_0x570500,_0x26181c){if(_0x570500['body']['id']){delete _0x570500[_0xa15d('0x55')]['id'];}return db[_0xa15d('0x3b')][_0xa15d('0x56')]({'where':{'id':_0x570500[_0xa15d('0x57')]['id']}})[_0xa15d('0x1f')](handleEntityNotFound(_0x26181c,null))[_0xa15d('0x1f')](saveUpdates(_0x570500[_0xa15d('0x55')],null))[_0xa15d('0x1f')](respondWithResult(_0x26181c,null))[_0xa15d('0x28')](handleError(_0x26181c,null));};exports[_0xa15d('0x35')]=function(_0x57e250,_0x101a6c){return db[_0xa15d('0x3b')][_0xa15d('0x56')]({'where':{'id':_0x57e250['params']['id']}})[_0xa15d('0x1f')](handleEntityNotFound(_0x101a6c,null))[_0xa15d('0x1f')](removeEntity(_0x101a6c,null))[_0xa15d('0x28')](handleError(_0x101a6c,null));};exports['describe']=function(_0x4ae081,_0x14fbb7){return db[_0xa15d('0x3b')][_0xa15d('0x58')]()['then'](respondWithResult(_0x14fbb7,null))[_0xa15d('0x28')](handleError(_0x14fbb7,null));};var interaction_log=require(_0xa15d('0x13'))('sms-interactions');exports[_0xa15d('0x59')]=function(_0xf54fc,_0xbe32e0,_0x394cb6){var _0x427e71={'agent':{},'channel':_0xa15d('0x5a')};if(_0xf54fc[_0xa15d('0x55')]['id']){delete _0xf54fc[_0xa15d('0x55')]['id'];}_0xf54fc[_0xa15d('0x55')][_0xa15d('0x5b')]=!![];_0xf54fc[_0xa15d('0x55')]['readAt']=moment()[_0xa15d('0x5c')](_0xa15d('0x5d'));_0xf54fc['body'][_0xa15d('0x5e')]=_0xf54fc[_0xa15d('0x55')]['UserId']||_0xf54fc[_0xa15d('0x5f')]['id'];_0x427e71[_0xa15d('0x60')]['id']=_0xf54fc[_0xa15d('0x55')][_0xa15d('0x5e')];return db[_0xa15d('0x3b')][_0xa15d('0x56')]({'where':{'id':_0xf54fc[_0xa15d('0x57')]['id'],'UserId':null}})[_0xa15d('0x1f')](handleEntityNotFound(_0xbe32e0,null))['then'](saveUpdates(_0xf54fc['body'],null))[_0xa15d('0x1f')](function(_0x4bd56f){if(_0x4bd56f){_0x427e71[_0xa15d('0x26')]=_0x4bd56f[_0xa15d('0x61')]({'plain':!![]});return db[_0xa15d('0x62')][_0xa15d('0x56')]({'where':{'id':_0x4bd56f[_0xa15d('0x63')]}});}return null;})[_0xa15d('0x1f')](handleEntityNotFound(_0xbe32e0,null))['then'](function(_0x17ceb3){if(_0x17ceb3){return _0x17ceb3[_0xa15d('0x34')]({'UserId':_0xf54fc['body'][_0xa15d('0x5e')],'read1stAt':_['isNil'](_0x17ceb3['read1stAt'])?moment()[_0xa15d('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa15d('0x1f')](function(_0x5705fb){if(_0x5705fb){_0x427e71[_0xa15d('0x64')]=_0x5705fb[_0xa15d('0x61')]({'plain':!![]});interaction_log[_0xa15d('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf54fc[_0xa15d('0x5f')]['id'],_0xf54fc[_0xa15d('0x5f')][_0xa15d('0x37')],_0xf54fc['user']['role'],_0x427e71['interaction']['id'],_0xf54fc['body']?JSON[_0xa15d('0x65')](_0xf54fc[_0xa15d('0x55')]):_0xa15d('0x66'));return respondWithRpcPromise(_0xa15d('0x67'),'acceptMessage',_0x427e71);}return null;})[_0xa15d('0x1f')](function(_0x44c448){var _0x1a140f=_0xa15d('0x68')+_0x44c448[_0xa15d('0x26')][_0xa15d('0x69')];return db[_0xa15d('0x6a')][_0xa15d('0x42')](_0x1a140f,{'type':db['Sequelize'][_0xa15d('0x6b')][_0xa15d('0x6c')],'raw':!![]})['then'](function(_0x2c4da5){return _0x2c4da5;});})[_0xa15d('0x1f')](function(_0x542d58){if(_0x542d58){_0x427e71[_0xa15d('0x26')][_0xa15d('0x6d')]=_0x542d58[0x0];if(!_0xf54fc[_0xa15d('0x55')][_0xa15d('0x5e')])return;return db['User'][_0xa15d('0x56')]({'where':{'id':_0xf54fc[_0xa15d('0x55')][_0xa15d('0x5e')],'role':_0xa15d('0x60')},'attributes':['id','name',_0xa15d('0x6e'),_0xa15d('0x6f'),'internal'],'raw':!![]});}return null;})[_0xa15d('0x1f')](function(_0x405a7a){if(!_0x405a7a)return null;_0x427e71['message'][_0xa15d('0x60')]=_0x405a7a;return _0x427e71;})[_0xa15d('0x1f')](function(_0x5384af){if(_0x5384af){if(_0xf54fc[_0xa15d('0x55')][_0xa15d('0x70')]){_0x427e71[_0xa15d('0x26')][_0xa15d('0x71')]=util['format'](_0xa15d('0x72'),_0xf54fc[_0xa15d('0x5f')][_0xa15d('0x37')]);_0x427e71[_0xa15d('0x26')][_0xa15d('0x73')]=_0x427e71[_0xa15d('0x73')];_0x427e71[_0xa15d('0x26')][_0xa15d('0x74')]=_0x427e71[_0xa15d('0x73')];_0x427e71[_0xa15d('0x26')]['event']=_0xa15d('0x59');return respondWithRpcPromise(_0xa15d('0x75'),_0xa15d('0x75'),{'event':_0xa15d('0x76'),'message':_0x427e71[_0xa15d('0x26')]},client9002)[_0xa15d('0x1f')](function(){return _0x427e71;});}return _0x427e71;}return null;})[_0xa15d('0x1f')](respondWithResult(_0xbe32e0,null))['catch'](handleError(_0xbe32e0,null));};var interaction_log=require(_0xa15d('0x13'))(_0xa15d('0x77'));exports[_0xa15d('0x32')]=function(_0x4eac72,_0x3313f4,_0x51b915){var _0x357132={'agent':{},'channel':_0xa15d('0x5a')};if(_0x4eac72['body']['id']){delete _0x4eac72[_0xa15d('0x55')]['id'];}_0x4eac72[_0xa15d('0x55')][_0xa15d('0x5e')]=_0x4eac72[_0xa15d('0x55')][_0xa15d('0x5e')]||_0x4eac72['user']['id'];_0x357132[_0xa15d('0x60')]['id']=_0x4eac72[_0xa15d('0x55')][_0xa15d('0x5e')];return db[_0xa15d('0x3b')][_0xa15d('0x56')]({'where':{'id':_0x4eac72[_0xa15d('0x57')]['id'],'UserId':null}})[_0xa15d('0x1f')](handleEntityNotFound(_0x3313f4,null))[_0xa15d('0x1f')](function(_0x33f9b3){if(_0x33f9b3){_0x357132['message']=_0x33f9b3['get']({'plain':!![]});return db[_0xa15d('0x62')]['find']({'where':{'id':_0x33f9b3[_0xa15d('0x63')]}});}return null;})[_0xa15d('0x1f')](handleEntityNotFound(_0x3313f4,null))[_0xa15d('0x1f')](function(_0x34003d){if(_0x34003d){_0x357132['interaction']=_0x34003d[_0xa15d('0x61')]({'plain':!![]});interaction_log['info'](_0xa15d('0x78'),_0x4eac72[_0xa15d('0x5f')]['id'],_0x4eac72[_0xa15d('0x5f')][_0xa15d('0x37')],_0x4eac72['user']['role'],_0x357132[_0xa15d('0x64')]['id'],_0x4eac72['body']?JSON[_0xa15d('0x65')](_0x4eac72[_0xa15d('0x55')]):_0xa15d('0x66'));return respondWithRpcPromise(_0xa15d('0x79'),_0xa15d('0x7a'),_0x357132);}return null;})[_0xa15d('0x1f')](function(_0x20276b){var _0x10f85e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20276b['message']['ContactId'];return db['sequelize'][_0xa15d('0x42')](_0x10f85e,{'type':db['Sequelize'][_0xa15d('0x6b')]['SELECT'],'raw':!![]})['then'](function(_0x33fcc6){return _0x33fcc6;});})['then'](function(_0x59527c){if(_0x59527c){_0x357132[_0xa15d('0x26')][_0xa15d('0x6d')]=_0x59527c[0x0];if(!_0x4eac72['body'][_0xa15d('0x5e')])return;return db[_0xa15d('0x7b')][_0xa15d('0x56')]({'where':{'id':_0x4eac72['body'][_0xa15d('0x5e')],'role':'agent'},'attributes':['id',_0xa15d('0x37'),_0xa15d('0x6e'),'email',_0xa15d('0x7c')],'raw':!![]});}return null;})[_0xa15d('0x1f')](function(_0x39f0e7){if(!_0x39f0e7)return null;_0x357132[_0xa15d('0x26')][_0xa15d('0x60')]=_0x39f0e7;return _0x357132;})[_0xa15d('0x1f')](function(_0x10f000){if(_0x10f000){_0x10f000[_0xa15d('0x26')][_0xa15d('0x71')]=util['format'](_0xa15d('0x72'),_0x4eac72[_0xa15d('0x5f')]['name']);_0x10f000[_0xa15d('0x26')][_0xa15d('0x73')]=_0x357132[_0xa15d('0x73')];_0x10f000[_0xa15d('0x26')][_0xa15d('0x74')]=_0x357132[_0xa15d('0x73')];_0x10f000['message'][_0xa15d('0x7d')]=_0xa15d('0x32');respondWithRpcPromise(_0xa15d('0x75'),_0xa15d('0x75'),{'event':_0xa15d('0x7e'),'message':_0x10f000[_0xa15d('0x26')]},client9002);return _0x357132;}return null;})[_0xa15d('0x1f')](respondWithResult(_0x3313f4,null))[_0xa15d('0x28')](handleError(_0x3313f4,null));};exports['status']=function(_0x3bc328,_0x434888,_0x3d1f94){if(_0x3bc328['body']['id']){delete _0x3bc328[_0xa15d('0x55')]['id'];}var _0x2def71;return db[_0xa15d('0x3b')][_0xa15d('0x56')]({'where':{'id':_0x3bc328[_0xa15d('0x57')]['id']}})[_0xa15d('0x1f')](handleEntityNotFound(_0x434888,null))[_0xa15d('0x1f')](function(_0x3e3fc3){if(_0x3e3fc3){_0x2def71=_0x3e3fc3;return db[_0xa15d('0x7f')][_0xa15d('0x56')]({'where':{'id':_0x3e3fc3[_0xa15d('0x80')]}});}})[_0xa15d('0x1f')](handleEntityNotFound(_0x434888,null))[_0xa15d('0x1f')](function(_0x37bc7b){if(_0x37bc7b){logger[_0xa15d('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa15d('0x29'),'received\x20delivery\x20report\x20from',_0x37bc7b[_0xa15d('0x3e')],util['inspect'](_0x3bc328[_0xa15d('0x55')],{'showHidden':![],'depth':null}));switch(_0x37bc7b[_0xa15d('0x3e')]){case _0xa15d('0x81'):if(_0x3bc328[_0xa15d('0x55')][_0xa15d('0x82')]&&_0x3bc328[_0xa15d('0x55')]['MessageSid']===_0x2def71[_0xa15d('0x83')]){return _0x2def71[_0xa15d('0x34')]({'read':!![]});}else{logger[_0xa15d('0x25')](_0xa15d('0x84'),_0xa15d('0x29'),_0xa15d('0x81'),util['inspect'](_0x3bc328['body'],{'showHidden':![],'depth':null}));}break;case _0xa15d('0x85'):if(_0x3bc328['body']['MessageUUID']&&_0x3bc328['body']['MessageUUID']===_0x2def71['messageId']&&_[_0xa15d('0x86')](['sent','delivered'],_0x3bc328[_0xa15d('0x55')][_0xa15d('0x87')])>=0x0){return _0x2def71[_0xa15d('0x34')]({'read':!![]});}else{logger[_0xa15d('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa15d('0x29'),_0xa15d('0x88'),util[_0xa15d('0x89')](_0x3bc328['body'],{'showHidden':![],'depth':null}));}break;case _0xa15d('0x8a'):var _0x452158=_0x3bc328[_0xa15d('0x55')][_0xa15d('0x8b')][0x0];if(_0x452158[_0xa15d('0x29')][_0xa15d('0x8c')]===_0xa15d('0x8d')){return _0x2def71['update']({'read':!![]});}else{logger[_0xa15d('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa15d('0x29'),_0xa15d('0x8a'),util[_0xa15d('0x89')](_0x3bc328[_0xa15d('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x2def71;}})[_0xa15d('0x1f')](respondWithResult(_0x434888,null))[_0xa15d('0x28')](handleError(_0x434888,null));}; \ No newline at end of file +var _0x0598=['request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','offset','undefined','limit','count','set','json','apply','save','destroy','end','sendStatus','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','find','create','body','update','describe','sms-interactions','accept','sms','read','readAt','format','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','SELECT','User','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','infobip','results','groupName','DELIVERED','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','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/license/util','redis','defaults','socket.io-emitter','register','jayson/promise','http','client'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x0598,0x19e));var _0x8059=function(_0x25a25a,_0x2ff0c1){_0x25a25a=_0x25a25a-0x0;var _0x1107d3=_0x0598[_0x25a25a];return _0x1107d3;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8059('0x1'));var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8059('0x3'));var util=require(_0x8059('0x4'));var path=require(_0x8059('0x5'));var sox=require(_0x8059('0x6'));var csv=require(_0x8059('0x7'));var ejs=require(_0x8059('0x8'));var fs=require('fs');var fs_extra=require(_0x8059('0x9'));var _=require('lodash');var squel=require(_0x8059('0xa'));var crypto=require(_0x8059('0xb'));var jsforce=require(_0x8059('0xc'));var deskjs=require(_0x8059('0xd'));var toCsv=require(_0x8059('0x7'));var querystring=require('querystring');var Papa=require(_0x8059('0xe'));var Redis=require('ioredis');var authService=require(_0x8059('0xf'));var qs=require(_0x8059('0x10'));var as=require(_0x8059('0x11'));var hardwareService=require(_0x8059('0x12'));var logger=require(_0x8059('0x13'))(_0x8059('0x14'));var utils=require(_0x8059('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8059('0x16'));var db=require('../../mysqldb')['db'];config[_0x8059('0x17')]=_[_0x8059('0x18')](config[_0x8059('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x8059('0x19'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x8059('0x1a')](socket);var jayson=require(_0x8059('0x1b'));var client=jayson['client'][_0x8059('0x1c')]({'port':0x232c});var client9002=jayson[_0x8059('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x572260,_0x1a14da,_0x516cf5,_0x4f5ff4){return new BPromise(function(_0xaed9a3,_0x5ad16e){var _0x3c4421=_0x4f5ff4||client;return _0x3c4421[_0x8059('0x1e')](_0x572260,_0x516cf5)[_0x8059('0x1f')](function(_0x19d6e4){logger[_0x8059('0x20')](_0x8059('0x21'),_0x1a14da,_0x8059('0x22'));logger[_0x8059('0x23')](_0x8059('0x24'),_0x1a14da,'request\x20sent',JSON[_0x8059('0x25')](_0x19d6e4));if(_0x19d6e4['error']){if(_0x19d6e4['error'][_0x8059('0x26')]===0x1f4){logger[_0x8059('0x27')](_0x8059('0x21'),_0x1a14da,_0x19d6e4[_0x8059('0x27')][_0x8059('0x28')]);return _0x5ad16e(_0x19d6e4[_0x8059('0x27')]['message']);}logger['error'](_0x8059('0x21'),_0x1a14da,_0x19d6e4[_0x8059('0x27')][_0x8059('0x28')]);return _0xaed9a3(_0x19d6e4[_0x8059('0x27')][_0x8059('0x28')]);}else{logger[_0x8059('0x20')](_0x8059('0x21'),_0x1a14da,_0x8059('0x22'));_0xaed9a3(_0x19d6e4[_0x8059('0x29')][_0x8059('0x28')]);}})[_0x8059('0x2a')](function(_0x3cdb8a){logger[_0x8059('0x27')](_0x8059('0x21'),_0x1a14da,_0x3cdb8a);_0x5ad16e(_0x3cdb8a);});});}function respondWithStatusCode(_0x21a1b5,_0x4a355e){_0x4a355e=_0x4a355e||0xcc;return function(_0x12560e){if(_0x12560e){return _0x21a1b5['sendStatus'](_0x4a355e);}return _0x21a1b5[_0x8059('0x2b')](_0x4a355e)['end']();};}function respondWithResult(_0x5bd428,_0x2820e6){_0x2820e6=_0x2820e6||0xc8;return function(_0x1392ff){if(_0x1392ff){return _0x5bd428[_0x8059('0x2b')](_0x2820e6)['json'](_0x1392ff);}};}function respondWithFilteredResult(_0xc6dcb6,_0x3337b3){return function(_0xf880a7){if(_0xf880a7){var _0x2be894=typeof _0x3337b3[_0x8059('0x2c')]===_0x8059('0x2d')&&typeof _0x3337b3[_0x8059('0x2e')]===_0x8059('0x2d');var _0x12fdf8=_0xf880a7[_0x8059('0x2f')];var _0x162a9=_0x2be894?0x0:_0x3337b3[_0x8059('0x2c')];var _0x296995=_0x2be894?_0xf880a7['count']:_0x3337b3[_0x8059('0x2c')]+_0x3337b3[_0x8059('0x2e')];var _0x2709ea;if(_0x296995>=_0x12fdf8){_0x296995=_0x12fdf8;_0x2709ea=0xc8;}else{_0x2709ea=0xce;}_0xc6dcb6[_0x8059('0x2b')](_0x2709ea);return _0xc6dcb6[_0x8059('0x30')]('Content-Range',_0x162a9+'-'+_0x296995+'/'+_0x12fdf8)[_0x8059('0x31')](_0xf880a7);}return null;};}function patchUpdates(_0x4f8a2d){return function(_0x34b892){try{jsonpatch[_0x8059('0x32')](_0x34b892,_0x4f8a2d,!![]);}catch(_0x40abbb){return BPromise['reject'](_0x40abbb);}return _0x34b892[_0x8059('0x33')]();};}function saveUpdates(_0x384d37,_0x1c7011){return function(_0x3ec5d4){if(_0x3ec5d4){return _0x3ec5d4['update'](_0x384d37)[_0x8059('0x1f')](function(_0xc72ee1){return _0xc72ee1;});}return null;};}function removeEntity(_0x490224,_0x27faa6){return function(_0x2e4787){if(_0x2e4787){return _0x2e4787[_0x8059('0x34')]()[_0x8059('0x1f')](function(){_0x490224[_0x8059('0x2b')](0xcc)[_0x8059('0x35')]();});}};}function handleEntityNotFound(_0x70c8d8,_0x21df02){return function(_0x3d46ef){if(!_0x3d46ef){_0x70c8d8[_0x8059('0x36')](0x194);}return _0x3d46ef;};}function handleError(_0x31d389,_0x173420){_0x173420=_0x173420||0x1f4;return function(_0x40c2de){logger[_0x8059('0x27')](_0x40c2de[_0x8059('0x37')]);if(_0x40c2de[_0x8059('0x38')]){delete _0x40c2de[_0x8059('0x38')];}_0x31d389[_0x8059('0x2b')](_0x173420)[_0x8059('0x39')](_0x40c2de);};}exports[_0x8059('0x3a')]=function(_0x6a78b5,_0x2be4f7){var _0x25e625={},_0x454d8f={},_0x565edc={'count':0x0,'rows':[]};var _0x1b187a=_[_0x8059('0x3b')](db[_0x8059('0x3c')][_0x8059('0x3d')],function(_0x15c3ea){return{'name':_0x15c3ea[_0x8059('0x3e')],'type':_0x15c3ea[_0x8059('0x3f')]['key']};});_0x454d8f['model']=_[_0x8059('0x3b')](_0x1b187a,_0x8059('0x38'));_0x454d8f[_0x8059('0x40')]=_[_0x8059('0x41')](_0x6a78b5['query']);_0x454d8f[_0x8059('0x42')]=_[_0x8059('0x43')](_0x454d8f[_0x8059('0x44')],_0x454d8f[_0x8059('0x40')]);_0x25e625[_0x8059('0x45')]=_[_0x8059('0x43')](_0x454d8f[_0x8059('0x44')],qs[_0x8059('0x46')](_0x6a78b5[_0x8059('0x40')][_0x8059('0x46')]));_0x25e625[_0x8059('0x45')]=_0x25e625[_0x8059('0x45')][_0x8059('0x47')]?_0x25e625['attributes']:_0x454d8f[_0x8059('0x44')];if(!_0x6a78b5[_0x8059('0x40')][_0x8059('0x48')]('nolimit')){_0x25e625['limit']=qs['limit'](_0x6a78b5[_0x8059('0x40')][_0x8059('0x2e')]);_0x25e625[_0x8059('0x2c')]=qs[_0x8059('0x2c')](_0x6a78b5[_0x8059('0x40')]['offset']);}_0x25e625['order']=qs['sort'](_0x6a78b5[_0x8059('0x40')]['sort']);_0x25e625[_0x8059('0x49')]=qs[_0x8059('0x42')](_[_0x8059('0x4a')](_0x6a78b5[_0x8059('0x40')],_0x454d8f[_0x8059('0x42')]),_0x1b187a);if(_0x6a78b5['query']['filter']){_0x25e625[_0x8059('0x49')]=_[_0x8059('0x4b')](_0x25e625[_0x8059('0x49')],{'$or':_['map'](_0x1b187a,function(_0x3ed21f){if(_0x3ed21f[_0x8059('0x3f')]!==_0x8059('0x4c')){var _0x34d65c={};_0x34d65c[_0x3ed21f[_0x8059('0x38')]]={'$like':'%'+_0x6a78b5[_0x8059('0x40')][_0x8059('0x4d')]+'%'};return _0x34d65c;}})});}_0x25e625=_['merge']({},_0x25e625,_0x6a78b5[_0x8059('0x4e')]);var _0x3a9216={'where':_0x25e625[_0x8059('0x49')]};return db[_0x8059('0x3c')][_0x8059('0x2f')](_0x3a9216)[_0x8059('0x1f')](function(_0x3946e8){_0x565edc[_0x8059('0x2f')]=_0x3946e8;if(_0x6a78b5['query'][_0x8059('0x4f')]){_0x25e625[_0x8059('0x50')]=[{'all':!![]}];}return db[_0x8059('0x3c')][_0x8059('0x51')](_0x25e625);})[_0x8059('0x1f')](function(_0x40d16d){_0x565edc['rows']=_0x40d16d;return _0x565edc;})[_0x8059('0x1f')](respondWithFilteredResult(_0x2be4f7,_0x25e625))[_0x8059('0x2a')](handleError(_0x2be4f7,null));};exports['show']=function(_0x39dc09,_0x43cdd8){var _0x211d76={'raw':!![],'where':{'id':_0x39dc09[_0x8059('0x52')]['id']}},_0x7bbefe={};_0x7bbefe[_0x8059('0x44')]=_[_0x8059('0x41')](db[_0x8059('0x3c')][_0x8059('0x3d')]);_0x7bbefe['query']=_[_0x8059('0x41')](_0x39dc09[_0x8059('0x40')]);_0x7bbefe['filters']=_[_0x8059('0x43')](_0x7bbefe['model'],_0x7bbefe[_0x8059('0x40')]);_0x211d76[_0x8059('0x45')]=_[_0x8059('0x43')](_0x7bbefe[_0x8059('0x44')],qs[_0x8059('0x46')](_0x39dc09[_0x8059('0x40')][_0x8059('0x46')]));_0x211d76[_0x8059('0x45')]=_0x211d76[_0x8059('0x45')][_0x8059('0x47')]?_0x211d76[_0x8059('0x45')]:_0x7bbefe[_0x8059('0x44')];if(_0x39dc09[_0x8059('0x40')]['includeAll']){_0x211d76['include']=[{'all':!![]}];}_0x211d76=_[_0x8059('0x4b')]({},_0x211d76,_0x39dc09[_0x8059('0x4e')]);return db[_0x8059('0x3c')][_0x8059('0x53')](_0x211d76)[_0x8059('0x1f')](handleEntityNotFound(_0x43cdd8,null))[_0x8059('0x1f')](respondWithResult(_0x43cdd8,null))[_0x8059('0x2a')](handleError(_0x43cdd8,null));};exports[_0x8059('0x54')]=function(_0x46982f,_0x211240){return db[_0x8059('0x3c')][_0x8059('0x54')](_0x46982f[_0x8059('0x55')],{})[_0x8059('0x1f')](respondWithResult(_0x211240,0xc9))['catch'](handleError(_0x211240,null));};exports[_0x8059('0x56')]=function(_0x54da00,_0x10858a){if(_0x54da00['body']['id']){delete _0x54da00[_0x8059('0x55')]['id'];}return db['SmsMessage']['find']({'where':{'id':_0x54da00[_0x8059('0x52')]['id']}})[_0x8059('0x1f')](handleEntityNotFound(_0x10858a,null))[_0x8059('0x1f')](saveUpdates(_0x54da00[_0x8059('0x55')],null))[_0x8059('0x1f')](respondWithResult(_0x10858a,null))[_0x8059('0x2a')](handleError(_0x10858a,null));};exports[_0x8059('0x34')]=function(_0x18cef7,_0x4aa865){return db['SmsMessage']['find']({'where':{'id':_0x18cef7[_0x8059('0x52')]['id']}})[_0x8059('0x1f')](handleEntityNotFound(_0x4aa865,null))[_0x8059('0x1f')](removeEntity(_0x4aa865,null))[_0x8059('0x2a')](handleError(_0x4aa865,null));};exports[_0x8059('0x57')]=function(_0x2c4da3,_0x4f5f97){return db['SmsMessage'][_0x8059('0x57')]()[_0x8059('0x1f')](respondWithResult(_0x4f5f97,null))[_0x8059('0x2a')](handleError(_0x4f5f97,null));};var interaction_log=require(_0x8059('0x13'))(_0x8059('0x58'));exports[_0x8059('0x59')]=function(_0x5249de,_0x573be9,_0xc24343){var _0x494ec2={'agent':{},'channel':_0x8059('0x5a')};if(_0x5249de[_0x8059('0x55')]['id']){delete _0x5249de[_0x8059('0x55')]['id'];}_0x5249de[_0x8059('0x55')][_0x8059('0x5b')]=!![];_0x5249de['body'][_0x8059('0x5c')]=moment()[_0x8059('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x5249de[_0x8059('0x55')]['UserId']=_0x5249de[_0x8059('0x55')][_0x8059('0x5e')]||_0x5249de[_0x8059('0x5f')]['id'];_0x494ec2[_0x8059('0x60')]['id']=_0x5249de[_0x8059('0x55')][_0x8059('0x5e')];return db['SmsMessage'][_0x8059('0x53')]({'where':{'id':_0x5249de['params']['id'],'UserId':null}})[_0x8059('0x1f')](handleEntityNotFound(_0x573be9,null))[_0x8059('0x1f')](saveUpdates(_0x5249de[_0x8059('0x55')],null))['then'](function(_0x394a67){if(_0x394a67){_0x494ec2[_0x8059('0x28')]=_0x394a67[_0x8059('0x61')]({'plain':!![]});return db[_0x8059('0x62')][_0x8059('0x53')]({'where':{'id':_0x394a67[_0x8059('0x63')]}});}return null;})[_0x8059('0x1f')](handleEntityNotFound(_0x573be9,null))[_0x8059('0x1f')](function(_0x462197){if(_0x462197){return _0x462197[_0x8059('0x56')]({'UserId':_0x5249de[_0x8059('0x55')]['UserId'],'read1stAt':_[_0x8059('0x64')](_0x462197[_0x8059('0x65')])?moment()[_0x8059('0x5d')](_0x8059('0x66')):undefined});}return null;})['then'](function(_0x2d0af8){if(_0x2d0af8){_0x494ec2[_0x8059('0x67')]=_0x2d0af8[_0x8059('0x61')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5249de[_0x8059('0x5f')]['id'],_0x5249de[_0x8059('0x5f')][_0x8059('0x38')],_0x5249de['user'][_0x8059('0x68')],_0x494ec2[_0x8059('0x67')]['id'],_0x5249de[_0x8059('0x55')]?JSON[_0x8059('0x25')](_0x5249de[_0x8059('0x55')]):_0x8059('0x69'));return respondWithRpcPromise(_0x8059('0x6a'),_0x8059('0x6b'),_0x494ec2);}return null;})[_0x8059('0x1f')](function(_0x1eaa55){var _0x3f320a=_0x8059('0x6c')+_0x1eaa55[_0x8059('0x28')][_0x8059('0x6d')];return db['sequelize']['query'](_0x3f320a,{'type':db[_0x8059('0x6e')][_0x8059('0x6f')]['SELECT'],'raw':!![]})[_0x8059('0x1f')](function(_0x1ecc61){return _0x1ecc61;});})[_0x8059('0x1f')](function(_0x813a93){if(_0x813a93){_0x494ec2['message'][_0x8059('0x70')]=_0x813a93[0x0];if(!_0x5249de[_0x8059('0x55')][_0x8059('0x5e')])return;return db['User'][_0x8059('0x53')]({'where':{'id':_0x5249de[_0x8059('0x55')][_0x8059('0x5e')],'role':_0x8059('0x60')},'attributes':['id',_0x8059('0x38'),_0x8059('0x71'),_0x8059('0x72'),_0x8059('0x73')],'raw':!![]});}return null;})[_0x8059('0x1f')](function(_0x2803cf){if(!_0x2803cf)return null;_0x494ec2[_0x8059('0x28')][_0x8059('0x60')]=_0x2803cf;return _0x494ec2;})[_0x8059('0x1f')](function(_0x8bb8cb){if(_0x8bb8cb){if(_0x5249de[_0x8059('0x55')]['manual']){_0x494ec2[_0x8059('0x28')][_0x8059('0x74')]=util[_0x8059('0x5d')](_0x8059('0x75'),_0x5249de[_0x8059('0x5f')][_0x8059('0x38')]);_0x494ec2[_0x8059('0x28')][_0x8059('0x76')]=_0x494ec2[_0x8059('0x76')];_0x494ec2[_0x8059('0x28')][_0x8059('0x77')]=_0x494ec2[_0x8059('0x76')];_0x494ec2[_0x8059('0x28')][_0x8059('0x78')]=_0x8059('0x59');return respondWithRpcPromise(_0x8059('0x79'),_0x8059('0x79'),{'event':_0x8059('0x7a'),'message':_0x494ec2[_0x8059('0x28')]},client9002)[_0x8059('0x1f')](function(){return _0x494ec2;});}return _0x494ec2;}return null;})['then'](respondWithResult(_0x573be9,null))[_0x8059('0x2a')](handleError(_0x573be9,null));};var interaction_log=require(_0x8059('0x13'))('sms-interactions');exports[_0x8059('0x7b')]=function(_0x1eb541,_0x3d5aa3,_0x135d4c){var _0x1bc3b4={'agent':{},'channel':_0x8059('0x5a')};if(_0x1eb541[_0x8059('0x55')]['id']){delete _0x1eb541[_0x8059('0x55')]['id'];}_0x1eb541['body']['UserId']=_0x1eb541[_0x8059('0x55')][_0x8059('0x5e')]||_0x1eb541[_0x8059('0x5f')]['id'];_0x1bc3b4[_0x8059('0x60')]['id']=_0x1eb541[_0x8059('0x55')][_0x8059('0x5e')];return db[_0x8059('0x3c')][_0x8059('0x53')]({'where':{'id':_0x1eb541[_0x8059('0x52')]['id'],'UserId':null}})[_0x8059('0x1f')](handleEntityNotFound(_0x3d5aa3,null))[_0x8059('0x1f')](function(_0x4fd752){if(_0x4fd752){_0x1bc3b4['message']=_0x4fd752['get']({'plain':!![]});return db[_0x8059('0x62')][_0x8059('0x53')]({'where':{'id':_0x4fd752[_0x8059('0x63')]}});}return null;})[_0x8059('0x1f')](handleEntityNotFound(_0x3d5aa3,null))[_0x8059('0x1f')](function(_0xf6e17f){if(_0xf6e17f){_0x1bc3b4[_0x8059('0x67')]=_0xf6e17f[_0x8059('0x61')]({'plain':!![]});interaction_log[_0x8059('0x20')](_0x8059('0x7c'),_0x1eb541[_0x8059('0x5f')]['id'],_0x1eb541[_0x8059('0x5f')][_0x8059('0x38')],_0x1eb541[_0x8059('0x5f')][_0x8059('0x68')],_0x1bc3b4['interaction']['id'],_0x1eb541[_0x8059('0x55')]?JSON['stringify'](_0x1eb541[_0x8059('0x55')]):_0x8059('0x69'));return respondWithRpcPromise(_0x8059('0x7d'),'rejectMessage',_0x1bc3b4);}return null;})[_0x8059('0x1f')](function(_0x3bf245){var _0x2dc906='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3bf245[_0x8059('0x28')][_0x8059('0x6d')];return db[_0x8059('0x7e')]['query'](_0x2dc906,{'type':db['Sequelize']['QueryTypes'][_0x8059('0x7f')],'raw':!![]})[_0x8059('0x1f')](function(_0x21a785){return _0x21a785;});})[_0x8059('0x1f')](function(_0x550126){if(_0x550126){_0x1bc3b4['message'][_0x8059('0x70')]=_0x550126[0x0];if(!_0x1eb541['body'][_0x8059('0x5e')])return;return db[_0x8059('0x80')][_0x8059('0x53')]({'where':{'id':_0x1eb541[_0x8059('0x55')][_0x8059('0x5e')],'role':_0x8059('0x60')},'attributes':['id',_0x8059('0x38'),_0x8059('0x71'),'email','internal'],'raw':!![]});}return null;})[_0x8059('0x1f')](function(_0x243e3a){if(!_0x243e3a)return null;_0x1bc3b4[_0x8059('0x28')][_0x8059('0x60')]=_0x243e3a;return _0x1bc3b4;})[_0x8059('0x1f')](function(_0x481f17){if(_0x481f17){_0x481f17[_0x8059('0x28')][_0x8059('0x74')]=util['format'](_0x8059('0x75'),_0x1eb541[_0x8059('0x5f')][_0x8059('0x38')]);_0x481f17['message'][_0x8059('0x76')]=_0x1bc3b4['channel'];_0x481f17[_0x8059('0x28')][_0x8059('0x77')]=_0x1bc3b4['channel'];_0x481f17[_0x8059('0x28')][_0x8059('0x78')]=_0x8059('0x7b');respondWithRpcPromise(_0x8059('0x79'),_0x8059('0x79'),{'event':_0x8059('0x81'),'message':_0x481f17['message']},client9002);return _0x1bc3b4;}return null;})[_0x8059('0x1f')](respondWithResult(_0x3d5aa3,null))[_0x8059('0x2a')](handleError(_0x3d5aa3,null));};exports[_0x8059('0x2b')]=function(_0x2fb45d,_0x4f3bd3,_0x1eb5e6){if(_0x2fb45d['body']['id']){delete _0x2fb45d[_0x8059('0x55')]['id'];}var _0x2087e7;return db[_0x8059('0x3c')][_0x8059('0x53')]({'where':{'id':_0x2fb45d[_0x8059('0x52')]['id']}})[_0x8059('0x1f')](handleEntityNotFound(_0x4f3bd3,null))[_0x8059('0x1f')](function(_0x22438f){if(_0x22438f){_0x2087e7=_0x22438f;return db[_0x8059('0x82')][_0x8059('0x53')]({'where':{'id':_0x22438f[_0x8059('0x83')]}});}})[_0x8059('0x1f')](handleEntityNotFound(_0x4f3bd3,null))['then'](function(_0x7fd63c){if(_0x7fd63c){logger['debug'](_0x8059('0x24'),'status',_0x8059('0x84'),_0x7fd63c[_0x8059('0x3f')],util['inspect'](_0x2fb45d[_0x8059('0x55')],{'showHidden':![],'depth':null}));switch(_0x7fd63c[_0x8059('0x3f')]){case _0x8059('0x85'):if(_0x2fb45d[_0x8059('0x55')][_0x8059('0x86')]&&_0x2fb45d[_0x8059('0x55')][_0x8059('0x86')]===_0x2087e7[_0x8059('0x87')]){return _0x2087e7[_0x8059('0x56')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8059('0x2b'),_0x8059('0x85'),util[_0x8059('0x88')](_0x2fb45d['body'],{'showHidden':![],'depth':null}));}break;case _0x8059('0x89'):if(_0x2fb45d['body'][_0x8059('0x8a')]&&_0x2fb45d[_0x8059('0x55')][_0x8059('0x8a')]===_0x2087e7[_0x8059('0x87')]&&_[_0x8059('0x8b')]([_0x8059('0x8c'),_0x8059('0x8d')],_0x2fb45d[_0x8059('0x55')][_0x8059('0x8e')])>=0x0){return _0x2087e7[_0x8059('0x56')]({'read':!![]});}else{logger[_0x8059('0x27')](_0x8059('0x8f'),_0x8059('0x2b'),'plivio',util[_0x8059('0x88')](_0x2fb45d[_0x8059('0x55')],{'showHidden':![],'depth':null}));}break;case _0x8059('0x90'):var _0x2eda0f=_0x2fb45d[_0x8059('0x55')][_0x8059('0x91')][0x0];if(_0x2eda0f[_0x8059('0x2b')][_0x8059('0x92')]===_0x8059('0x93')){return _0x2087e7[_0x8059('0x56')]({'read':!![]});}else{logger[_0x8059('0x27')](_0x8059('0x8f'),_0x8059('0x2b'),_0x8059('0x90'),util[_0x8059('0x88')](_0x2fb45d[_0x8059('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x2087e7;}})[_0x8059('0x1f')](respondWithResult(_0x4f3bd3,null))[_0x8059('0x2a')](handleError(_0x4f3bd3,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 7fb41eb..523c21e 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 _0x6189=['update','remove','emit','hasOwnProperty','hook','exports','events','SmsMessage','setMaxListeners','save'];(function(_0x31d9b2,_0x9952e){var _0x598124=function(_0x42be1b){while(--_0x42be1b){_0x31d9b2['push'](_0x31d9b2['shift']());}};_0x598124(++_0x9952e);}(_0x6189,0xf6));var _0x9618=function(_0x55cca1,_0x23a4b2){_0x55cca1=_0x55cca1-0x0;var _0x12f83d=_0x6189[_0x55cca1];return _0x12f83d;};'use strict';var EventEmitter=require(_0x9618('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x9618('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x9618('0x2')](0x0);var events={'afterCreate':_0x9618('0x3'),'afterUpdate':_0x9618('0x4'),'afterDestroy':_0x9618('0x5')};function emitEvent(_0x1e21fe){return function(_0x1978ad,_0x2ed9dd,_0x3649fc){SmsMessageEvents[_0x9618('0x6')](_0x1e21fe+':'+_0x1978ad['id'],_0x1978ad);SmsMessageEvents['emit'](_0x1e21fe,_0x1978ad);_0x3649fc(null);};}for(var e in events){if(events[_0x9618('0x7')](e)){var event=events[e];SmsMessage[_0x9618('0x8')](e,emitEvent(event));}}module[_0x9618('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0x746e=['../../mysqldb','SmsMessage','save','remove','emit','hasOwnProperty','hook'];(function(_0x29d1f5,_0x151e77){var _0x475f05=function(_0x10fff7){while(--_0x10fff7){_0x29d1f5['push'](_0x29d1f5['shift']());}};_0x475f05(++_0x151e77);}(_0x746e,0xa8));var _0xe746=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0x746e[_0xe8129c];return _0x709fc5;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xe746('0x0'))['db'][_0xe746('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe746('0x2'),'afterUpdate':'update','afterDestroy':_0xe746('0x3')};function emitEvent(_0x114ff7){return function(_0x4bd4bf,_0x4e598e,_0x28549a){SmsMessageEvents[_0xe746('0x4')](_0x114ff7+':'+_0x4bd4bf['id'],_0x4bd4bf);SmsMessageEvents[_0xe746('0x4')](_0x114ff7,_0x4bd4bf);_0x28549a(null);};}for(var e in events){if(events[_0xe746('0x5')](e)){var event=events[e];SmsMessage[_0xe746('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 0c5d5e1..b86d821 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 _0x335c=['moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','body','models','get','toLowerCase','direction','UserId','isNil','SmsInteractionId','then','update','createdAt','catch','error','out','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','phone','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','login?username=','username','GET','split','sms','POST','user_key','session_key','internal_order_id','deliveryReport','read','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','format','Basic\x20%s','http_code','data','queued_count','head','clickSend','plivo','senderString','%s:%s','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','accountId','applicationId','Missing\x20parameters:\x20username,\x20password','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','lodash','../../config/logger','api'];(function(_0x850fbc,_0x1c1107){var _0xb309d6=function(_0x12e5b3){while(--_0x12e5b3){_0x850fbc['push'](_0x850fbc['shift']());}};_0xb309d6(++_0x1c1107);}(_0x335c,0x75));var _0xc335=function(_0x4845a3,_0x4af292){_0x4845a3=_0x4845a3-0x0;var _0x3eaa25=_0x335c[_0x4845a3];return _0x3eaa25;};'use strict';var _=require(_0xc335('0x0'));var util=require('util');var logger=require(_0xc335('0x1'))(_0xc335('0x2'));var moment=require(_0xc335('0x3'));var BPromise=require(_0xc335('0x4'));var rp=require(_0xc335('0x5'));var fs=require('fs');var path=require(_0xc335('0x6'));var rimraf=require('rimraf');var config=require(_0xc335('0x7'));var attributes=require(_0xc335('0x8'));module[_0xc335('0x9')]=function(_0x1916b4,_0x4835bb){return _0x1916b4[_0xc335('0xa')]('SmsMessage',attributes,{'tableName':_0xc335('0xb'),'paranoid':![],'indexes':[{'name':_0xc335('0xc'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0xc335('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x52d8f4,_0x2b610c,_0x180cec){var _0xb45c8c=_0x1916b4[_0xc335('0xe')];var _0x2735b8=_0x52d8f4[_0xc335('0xf')]({'plain':!![]});if(_0x2735b8['direction'][_0xc335('0x10')]()==='in'||_0x2735b8[_0xc335('0x11')]['toLowerCase']()==='out'&&!_0x2735b8['secret']&&!_['isNil'](_0x2735b8[_0xc335('0x12')])&&!_[_0xc335('0x13')](_0x2735b8[_0xc335('0x14')])){_0xb45c8c['SmsInteraction']['findOne']({'where':{'id':_0x2735b8['SmsInteractionId']}})[_0xc335('0x15')](function(_0x51fb50){if(_0x51fb50){_0x51fb50[_0xc335('0x16')]({'lastMsgAt':_0x2735b8[_0xc335('0x17')],'lastMsgDirection':_0x2735b8[_0xc335('0x11')][_0xc335('0x10')]()});}})[_0xc335('0x18')](function(_0x59651f){console[_0xc335('0x19')](_0x59651f);});}if(_0x2735b8[_0xc335('0x11')]===_0xc335('0x1a')&&!_0x2735b8['secret']){var _0x1b1fe1;_0xb45c8c[_0xc335('0x1b')][_0xc335('0x1c')]({'where':{'id':_0x2735b8[_0xc335('0x1d')]},'raw':!![]})[_0xc335('0x15')](function(_0x7078a4){_0x1b1fe1=_0x7078a4;if(_0x1b1fe1&&_0x1b1fe1[_0xc335('0x1e')]){switch(_0x1b1fe1[_0xc335('0x1e')]){case _0xc335('0x1f'):var _0x34a7eb=require(_0xc335('0x1f'));if(_0x1b1fe1[_0xc335('0x20')]&&_0x1b1fe1[_0xc335('0x21')]&&_0x1b1fe1['phone']){var _0x569082=new _0x34a7eb(_0x1b1fe1['accountSid'],_0x1b1fe1['authToken']);_0x569082[_0xc335('0x22')]['create']({'body':_0x2735b8[_0xc335('0xd')],'to':_0x2735b8[_0xc335('0x23')],'from':_0x1b1fe1[_0xc335('0x23')],'statusCallback':_0x1b1fe1[_0xc335('0x24')]+_0xc335('0x25')+_0x2735b8['id']+_0xc335('0x26')+_0x1b1fe1[_0xc335('0x27')]})[_0xc335('0x15')](function(_0x101c15){if(_0x101c15[_0xc335('0x28')]){return _0x52d8f4[_0xc335('0x16')]({'messageId':_0x101c15['sid']});}})[_0xc335('0x18')](function(_0x58f477){logger[_0xc335('0x19')](_0xc335('0x29'),'afterCreate',_0xc335('0x1f'),util[_0xc335('0x2a')](_0x58f477,{'showHidden':![],'depth':null}));});}else{logger[_0xc335('0x19')](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x1f'),_0xc335('0x2c'));}break;case _0xc335('0x2d'):var _0x531210='https://api.skebby.it/API/v1.0/REST/';if(_0x1b1fe1['username']&&_0x1b1fe1[_0xc335('0x2e')]){var _0x3591ae={'recipient':[_0x2735b8['phone']],'message':_0x2735b8[_0xc335('0xd')],'message_type':_0x1b1fe1[_0xc335('0x2f')]};if(_0x1b1fe1['smsMethod']&&_0x1b1fe1[_0xc335('0x2f')]!=='SI'){_0x3591ae['sender']=_0x1b1fe1['phone'];}var _0x1cf657={'url':_0x531210+_0xc335('0x30')+_0x1b1fe1[_0xc335('0x31')]+'&password='+_0x1b1fe1[_0xc335('0x2e')],'method':_0xc335('0x32')};rp(_0x1cf657)[_0xc335('0x15')](function(_0x572ae1){var _0x2a569d=_0x572ae1[_0xc335('0x33')](';');var _0x7890d9={'user_key':_0x2a569d[0x0],'session_key':_0x2a569d[0x1]};_0x1cf657={'url':_0x531210+_0xc335('0x34'),'method':_0xc335('0x35'),'headers':{'user_key':_0x7890d9[_0xc335('0x36')],'Session_key':_0x7890d9[_0xc335('0x37')]},'json':!![],'body':_0x3591ae};return rp(_0x1cf657);})[_0xc335('0x15')](function(_0x5bc6cb){if(_0x5bc6cb['total_sent']>=0x1){var _0x5a26ea={'messageId':_0x5bc6cb[_0xc335('0x38')]};if(_0x1b1fe1[_0xc335('0x2f')]!=='GP'||!_0x1b1fe1[_0xc335('0x39')]){_0x5a26ea[_0xc335('0x3a')]=!![];}return _0x52d8f4[_0xc335('0x16')](_0x5a26ea);}else{return logger[_0xc335('0x19')](_0xc335('0x29'),_0xc335('0x2b'),'skebby',util['inspect'](_0x5bc6cb,{'showHidden':![],'depth':null}));}})['catch'](function(_0x518291){return logger[_0xc335('0x19')](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x2d'),util[_0xc335('0x2a')](_0x518291,{'showHidden':![],'depth':null}));});}else{logger[_0xc335('0x19')](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x2d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xc335('0x3b'):if(_0x1b1fe1[_0xc335('0x21')]){var _0x3e6ea2={'recipient':_0x2735b8[_0xc335('0x23')],'message':_0x2735b8[_0xc335('0xd')],'sender':_0x1b1fe1['senderString']||_0x1b1fe1['phone'],'authorization':_0x1b1fe1[_0xc335('0x21')]};var _0x2b610c={'method':_0xc335('0x35'),'uri':_0xc335('0x3c'),'body':_0x3e6ea2,'json':!![]};rp(_0x2b610c)[_0xc335('0x15')](function(_0x29aa66){var _0x3fe476={'messageId':_0x29aa66[_0xc335('0x3d')]};if(!_0x1b1fe1[_0xc335('0x39')]){_0x3fe476[_0xc335('0x3a')]=!![];}return _0x52d8f4[_0xc335('0x16')](_0x3fe476);})[_0xc335('0x18')](function(_0x53d27c){logger['error'](_0xc335('0x29'),_0xc335('0x2b'),'connectel',util[_0xc335('0x2a')](_0x53d27c,{'showHidden':![],'depth':null}));});}else{logger[_0xc335('0x19')](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x3b'),_0xc335('0x3e'));}break;case _0xc335('0x3f'):if(_0x1b1fe1['username']&&_0x1b1fe1[_0xc335('0x2e')]){var _0x3e6ea2={'messages':[{'source':'xCALLY\x20Motion','to':_0x2735b8[_0xc335('0x23')],'body':_0x2735b8[_0xc335('0xd')],'from':_0x1b1fe1['senderString']||_0x1b1fe1['phone']}]};var _0x23a812=util[_0xc335('0x40')]('%s:%s',_0x1b1fe1[_0xc335('0x31')],_0x1b1fe1[_0xc335('0x2e')]);var _0x2b610c={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x3e6ea2,'headers':{'Authorization':util['format'](_0xc335('0x41'),new Buffer(_0x23a812)['toString']('base64'))},'json':!![]};rp(_0x2b610c)[_0xc335('0x15')](function(_0x55c4e2){if(_0x55c4e2[_0xc335('0x42')]>=0xc8&&_0x55c4e2['http_code']<=0xce){if(_0x55c4e2[_0xc335('0x43')]&&_0x55c4e2['data'][_0xc335('0x44')]>0x0){var _0x28f4b9=_[_0xc335('0x45')](_0x55c4e2['data']['messages']);var _0x2ccd84={'messageId':_0x28f4b9['message_id']};if(!_0x1b1fe1[_0xc335('0x39')]){_0x2ccd84[_0xc335('0x3a')]=!![];}return _0x52d8f4['update'](_0x2ccd84);}else{logger[_0xc335('0x19')](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x46'),util['inspect'](_0x55c4e2,{'showHidden':![],'depth':null}));}}else{logger[_0xc335('0x19')](_0xc335('0x29'),'afterCreate',_0xc335('0x46'),util[_0xc335('0x2a')](_0x55c4e2,{'showHidden':![],'depth':null}));}})['catch'](function(_0x29fbae){logger[_0xc335('0x19')](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x46'),util[_0xc335('0x2a')](_0x29fbae,{'showHidden':![],'depth':null}));});}else{logger[_0xc335('0x19')](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x46'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xc335('0x47'):if(_0x1b1fe1['authId']&&_0x1b1fe1[_0xc335('0x21')]){var _0x3e6ea2={'dst':_0x2735b8[_0xc335('0x23')],'text':_0x2735b8['body'],'src':_0x1b1fe1[_0xc335('0x48')]||_0x1b1fe1['phone'],'url':_0x1b1fe1[_0xc335('0x24')]+'/api/sms/messages/'+_0x2735b8['id']+'/status?token='+_0x1b1fe1[_0xc335('0x27')]};var _0x23a812=util[_0xc335('0x40')](_0xc335('0x49'),_0x1b1fe1[_0xc335('0x4a')],_0x1b1fe1[_0xc335('0x21')]);var _0x2b610c={'method':_0xc335('0x35'),'uri':util[_0xc335('0x40')](_0xc335('0x4b'),_0x1b1fe1[_0xc335('0x4a')]),'body':_0x3e6ea2,'headers':{'Authorization':util[_0xc335('0x40')](_0xc335('0x41'),new Buffer(_0x23a812)[_0xc335('0x4c')](_0xc335('0x4d')))},'json':!![]};rp(_0x2b610c)[_0xc335('0x15')](function(_0x9a8a0f){var _0x2607d3={'messageId':_0x9a8a0f[_0xc335('0x4e')][0x0]};return _0x52d8f4[_0xc335('0x16')](_0x2607d3);})['catch'](function(_0x3a0c0c){logger[_0xc335('0x19')](_0xc335('0x29'),_0xc335('0x2b'),'plivo',util[_0xc335('0x2a')](_0x3a0c0c,{'showHidden':![],'depth':null}));});}else{logger[_0xc335('0x19')](_0xc335('0x29'),_0xc335('0x2b'),'plivo',_0xc335('0x4f'));}break;case _0xc335('0x50'):if(_0x1b1fe1[_0xc335('0x31')]&&_0x1b1fe1[_0xc335('0x2e')]){if(_0x1b1fe1[_0xc335('0x51')]){var _0x53165f={'method':'POST','uri':_0x1b1fe1['baseUrl']+'/auth/1/session','body':{'username':_0x1b1fe1[_0xc335('0x31')],'password':_0x1b1fe1['password']},'json':!![]};return rp(_0x53165f)[_0xc335('0x15')](function(_0x172080){var _0x22bc07={'method':'POST','uri':_0x1b1fe1[_0xc335('0x51')]+_0xc335('0x52'),'body':{'messages':[{'from':_0x1b1fe1[_0xc335('0x23')],'destinations':[{'to':_0x2735b8[_0xc335('0x23')]}],'text':_0x2735b8[_0xc335('0xd')],'notifyUrl':_0x1b1fe1[_0xc335('0x24')]+_0xc335('0x25')+_0x2735b8['id']+_0xc335('0x26')+_0x1b1fe1['token'],'notifyContentType':_0xc335('0x53'),'callbackData':_0x1b1fe1['phone']+';'+_0x2735b8['body']}]},'headers':{'Authorization':_0xc335('0x54')+_0x172080[_0xc335('0x27')]},'json':!![]};return rp(_0x22bc07)[_0xc335('0x15')](function(_0x2433d1){if(_0x2433d1['messages']){var _0x2e3b84={'messageId':_0x2433d1[_0xc335('0x22')][0x0]['messageId']};if(!_0x1b1fe1[_0xc335('0x39')]){_0x2e3b84[_0xc335('0x3a')]=!![];}return _0x52d8f4[_0xc335('0x16')](_0x2e3b84);}else{return logger['error'](_0xc335('0x29'),_0xc335('0x2b'),'infobip',util[_0xc335('0x2a')](_0x2433d1,{'showHidden':![],'depth':null}));}});})[_0xc335('0x18')](function(_0x1015ad){return logger['error'](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x50'),util[_0xc335('0x2a')](_0x1015ad,{'showHidden':![],'depth':null}));});}else{logger[_0xc335('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc335('0x2b'),'infobip',_0xc335('0x55'));}}else{logger['error'](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x50'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xc335('0x56'):var _0x5b6489=require(_0xc335('0x57'));if(_0x1b1fe1['apiKey']){var _0x4b9a25={};_0x4b9a25[_0xc335('0x58')]=_0x1b1fe1[_0xc335('0x31')];_0x4b9a25[_0xc335('0x23')]=_0x2735b8[_0xc335('0x23')];_0x4b9a25['sender']=_0x1b1fe1[_0xc335('0x23')];_0x4b9a25[_0xc335('0x59')]=_0x2735b8['body'];_0x4b9a25[_0xc335('0x5a')]=+new Date();var _0x590501='';var _0x299fe7='';var _0x569726=Object[_0xc335('0x5b')](_0x4b9a25);_0x569726[_0xc335('0x5c')]();for(var _0x906a5a=0x0;_0x906a5a<_0x569726[_0xc335('0x5d')];_0x906a5a++){if(_0x590501!=''){_0x590501+='&';}_0x590501+=_0x569726[_0x906a5a]+'='+encodeURIComponent(_0x4b9a25[_0x569726[_0x906a5a]]);_0x299fe7+=_0x4b9a25[_0x569726[_0x906a5a]];}_0x299fe7+=_0x1b1fe1['apiKey'];_0x299fe7=_0x5b6489[_0xc335('0x5e')](_0xc335('0x5f'))[_0xc335('0x16')](_0x299fe7)[_0xc335('0x60')](_0xc335('0x61'));if(_0x590501!==''){_0x590501+='&';}_0x590501+=_0xc335('0x62')+_0x299fe7;var _0x1cf657={'method':_0xc335('0x32'),'uri':_0x1b1fe1[_0xc335('0x51')]+'/external/get/send.php?'+_0x590501,'json':!![]};return rp(_0x1cf657)['then'](function(_0x55bfc3){var _0x1b2627=Object['keys'](_0x55bfc3);if(_0x55bfc3[_0x1b2627[0x0]][_0xc335('0x19')]&&parseInt(_0x55bfc3[_0x1b2627[0x0]]['error'])===0x0){var _0x1e06e3={'messageId':_0x55bfc3[_0x1b2627[0x0]][_0xc335('0x63')]};if(!_0x1b1fe1[_0xc335('0x39')]){_0x1e06e3[_0xc335('0x3a')]=!![];}return _0x52d8f4[_0xc335('0x16')](_0x1e06e3);}else{return logger[_0xc335('0x19')](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x56'),util[_0xc335('0x2a')](_0x55bfc3[_0xc335('0x19')],{'showHidden':![],'depth':null}));}})[_0xc335('0x18')](function(_0x321839){return logger['error'](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x56'),util[_0xc335('0x2a')](_0x321839,{'showHidden':![],'depth':null}));});}else{logger[_0xc335('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc335('0x56'),_0xc335('0x64'));}break;case _0xc335('0x65'):if(_0x1b1fe1[_0xc335('0x66')]){var _0x401e42={'method':_0xc335('0x35'),'uri':_0xc335('0x67'),'headers':{'Authorization':_0x1b1fe1[_0xc335('0x66')]},'body':{'content':_0x2735b8['body'],'to':[_0x2735b8['phone']],'from':_0x1b1fe1[_0xc335('0x23')],'binary':![],'clientMessageId':_0xc335('0x68'),'charset':_0xc335('0x69')},'json':!![]};rp(_0x401e42)[_0xc335('0x15')](function(_0x12dfbe){if(!_0x12dfbe[_0xc335('0x19')]){var _0x127f3b={'messageId':_0x12dfbe['messages'][0x0][_0xc335('0x6a')]};if(!_0x1b1fe1['deliveryReport']){_0x127f3b['read']=!![];}return _0x52d8f4[_0xc335('0x16')](_0x127f3b);}else{return logger[_0xc335('0x19')](_0xc335('0x29'),'afterCreate',_0xc335('0x65'),util[_0xc335('0x2a')](_0x12dfbe['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x351409){return logger[_0xc335('0x19')](_0xc335('0x29'),'afterCreate',_0xc335('0x65'),util[_0xc335('0x2a')](_0x351409,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x65'),_0xc335('0x64'));}break;case _0xc335('0x6b'):if(_0x1b1fe1[_0xc335('0x31')]&&_0x1b1fe1['password']){var _0x23a812=util[_0xc335('0x40')](_0xc335('0x49'),_0x1b1fe1[_0xc335('0x31')],_0x1b1fe1[_0xc335('0x2e')]);var _0x2b610c={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x1b1fe1[_0xc335('0x6c')]+'/messages','body':{'to':[_0x2735b8[_0xc335('0x23')]],'text':_0x2735b8[_0xc335('0xd')],'from':_0x1b1fe1['phone'],'applicationId':_0x1b1fe1[_0xc335('0x6d')]},'headers':{'Authorization':util[_0xc335('0x40')](_0xc335('0x41'),new Buffer(_0x23a812)[_0xc335('0x4c')](_0xc335('0x4d')))},'json':!![]};rp(_0x2b610c)[_0xc335('0x15')](function(_0x5e4934){if(_0x5e4934['id']){var _0x49f8fa={'messageId':_0x5e4934['id']};return _0x52d8f4[_0xc335('0x16')](_0x49f8fa);}else{logger[_0xc335('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc335('0x2b'),'bandwidth',util[_0xc335('0x2a')](_0x5e4934,{'showHidden':![],'depth':null}));}})[_0xc335('0x18')](function(_0x2b0964){logger[_0xc335('0x19')](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x6b'),util[_0xc335('0x2a')](_0x2b0964,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x6b'),_0xc335('0x6e'));}break;case _0xc335('0x6f'):if(_0x1b1fe1['apiKey']){var _0xa2a64f={};var _0x1cf657={'method':'POST','uri':_0xc335('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x1b1fe1['apiKey'],'Content-Type':_0xc335('0x53')},'body':{'from':_0x1b1fe1[_0xc335('0x23')],'to':_0x2735b8[_0xc335('0x23')],'text':_0x2735b8['body']},'json':!![]};return rp(_0x1cf657)['then'](function(_0x2c1664){if(_0x2c1664[_0xc335('0x71')]==0xca){_0xa2a64f[_0xc335('0x72')]=_0x2c1664;var _0x14a1dc={'method':_0xc335('0x35'),'uri':_0xc335('0x73'),'headers':{'Authorization':'Bearer\x20'+_0x1b1fe1['apiKey'],'Content-Type':_0xc335('0x53')},'body':{'refid':_0xa2a64f[_0xc335('0x72')][_0xc335('0x74')]},'json':!![]};return rp(_0x14a1dc)['then'](function(_0x291cdc){_0xa2a64f[_0xc335('0x75')]=_0x291cdc;var _0x26f3bf={'messageId':_0xa2a64f[_0xc335('0x72')][_0xc335('0x74')],'read':!![]};return _0x52d8f4[_0xc335('0x16')](_0x26f3bf);});}else{return logger['error'](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x6f'),util['inspect'](_0x2c1664,{'showHidden':![],'depth':null}));}})[_0xc335('0x18')](function(_0x28e39f){return logger[_0xc335('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc335('0x2b'),_0xc335('0x6f'),util[_0xc335('0x2a')](_0x28e39f,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xc335('0x29'),_0xc335('0x2b'),_0xc335('0x6f'),_0xc335('0x76'));}break;}}})[_0xc335('0x77')](function(){_0x180cec();});}else{_0x180cec();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4eab=['plivo','authId','authToken','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','length','apiKey','md5','digest','signature=','/external/get/send.php?','keys','clickatell','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','accountId','/messages','applicationId','intelepeer','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','body','FULLTEXT','models','toLowerCase','direction','out','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','error','secret','find','SmsAccountId','type','twilio','accountSid','phone','messages','create','remote','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','username','&password=','GET','split','sms','POST','user_key','session_key','internal_order_id','deliveryReport','read','skebby','inspect','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','connectel','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','head','message_id','clickSend'];(function(_0x2f8d30,_0x4e8669){var _0x59aba1=function(_0x4d2b04){while(--_0x4d2b04){_0x2f8d30['push'](_0x2f8d30['shift']());}};_0x59aba1(++_0x4e8669);}(_0x4eab,0x19f));var _0xb4ea=function(_0x3f1571,_0x7f23c0){_0x3f1571=_0x3f1571-0x0;var _0x42d82d=_0x4eab[_0x3f1571];return _0x42d82d;};'use strict';var _=require(_0xb4ea('0x0'));var util=require(_0xb4ea('0x1'));var logger=require(_0xb4ea('0x2'))(_0xb4ea('0x3'));var moment=require('moment');var BPromise=require(_0xb4ea('0x4'));var rp=require(_0xb4ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4ea('0x6'));var config=require(_0xb4ea('0x7'));var attributes=require(_0xb4ea('0x8'));module[_0xb4ea('0x9')]=function(_0x4393e7,_0x3827f3){return _0x4393e7[_0xb4ea('0xa')](_0xb4ea('0xb'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xb4ea('0xc'),'fields':[_0xb4ea('0xc')]},{'name':'fti_sms_messages','fields':[_0xb4ea('0xd')],'type':_0xb4ea('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ba079,_0x58ac58,_0x26b7de){var _0x3deff5=_0x4393e7[_0xb4ea('0xf')];var _0x287015=_0x3ba079['get']({'plain':!![]});if(_0x287015['direction'][_0xb4ea('0x10')]()==='in'||_0x287015[_0xb4ea('0x11')][_0xb4ea('0x10')]()===_0xb4ea('0x12')&&!_0x287015['secret']&&!_[_0xb4ea('0x13')](_0x287015[_0xb4ea('0x14')])&&!_[_0xb4ea('0x13')](_0x287015[_0xb4ea('0x15')])){_0x3deff5['SmsInteraction'][_0xb4ea('0x16')]({'where':{'id':_0x287015[_0xb4ea('0x15')]}})[_0xb4ea('0x17')](function(_0x44ab09){if(_0x44ab09){_0x44ab09[_0xb4ea('0x18')]({'lastMsgAt':_0x287015[_0xb4ea('0x19')],'lastMsgDirection':_0x287015[_0xb4ea('0x11')]['toLowerCase']()});}})['catch'](function(_0x365b0d){console[_0xb4ea('0x1a')](_0x365b0d);});}if(_0x287015[_0xb4ea('0x11')]===_0xb4ea('0x12')&&!_0x287015[_0xb4ea('0x1b')]){var _0x20dbbf;_0x3deff5['SmsAccount'][_0xb4ea('0x1c')]({'where':{'id':_0x287015[_0xb4ea('0x1d')]},'raw':!![]})['then'](function(_0x3cf2d7){_0x20dbbf=_0x3cf2d7;if(_0x20dbbf&&_0x20dbbf['type']){switch(_0x20dbbf[_0xb4ea('0x1e')]){case _0xb4ea('0x1f'):var _0x1da5a2=require(_0xb4ea('0x1f'));if(_0x20dbbf[_0xb4ea('0x20')]&&_0x20dbbf['authToken']&&_0x20dbbf[_0xb4ea('0x21')]){var _0x360d1b=new _0x1da5a2(_0x20dbbf[_0xb4ea('0x20')],_0x20dbbf['authToken']);_0x360d1b[_0xb4ea('0x22')][_0xb4ea('0x23')]({'body':_0x287015[_0xb4ea('0xd')],'to':_0x287015['phone'],'from':_0x20dbbf[_0xb4ea('0x21')],'statusCallback':_0x20dbbf[_0xb4ea('0x24')]+'/api/sms/messages/'+_0x287015['id']+_0xb4ea('0x25')+_0x20dbbf[_0xb4ea('0x26')]})[_0xb4ea('0x17')](function(_0x340e81){if(_0x340e81[_0xb4ea('0x27')]){return _0x3ba079[_0xb4ea('0x18')]({'messageId':_0x340e81[_0xb4ea('0x27')]});}})[_0xb4ea('0x28')](function(_0x1ddd35){logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),_0xb4ea('0x2a'),_0xb4ea('0x1f'),util['inspect'](_0x1ddd35,{'showHidden':![],'depth':null}));});}else{logger[_0xb4ea('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4ea('0x2a'),_0xb4ea('0x1f'),_0xb4ea('0x2b'));}break;case'skebby':var _0x3be0d4=_0xb4ea('0x2c');if(_0x20dbbf['username']&&_0x20dbbf[_0xb4ea('0x2d')]){var _0x403150={'recipient':[_0x287015[_0xb4ea('0x21')]],'message':_0x287015['body'],'message_type':_0x20dbbf[_0xb4ea('0x2e')]};if(_0x20dbbf['smsMethod']&&_0x20dbbf['smsMethod']!=='SI'){_0x403150[_0xb4ea('0x2f')]=_0x20dbbf[_0xb4ea('0x21')];}var _0xd80b90={'url':_0x3be0d4+'login?username='+_0x20dbbf[_0xb4ea('0x30')]+_0xb4ea('0x31')+_0x20dbbf[_0xb4ea('0x2d')],'method':_0xb4ea('0x32')};rp(_0xd80b90)[_0xb4ea('0x17')](function(_0x5ebbc9){var _0x3c83ea=_0x5ebbc9[_0xb4ea('0x33')](';');var _0x78839d={'user_key':_0x3c83ea[0x0],'session_key':_0x3c83ea[0x1]};_0xd80b90={'url':_0x3be0d4+_0xb4ea('0x34'),'method':_0xb4ea('0x35'),'headers':{'user_key':_0x78839d[_0xb4ea('0x36')],'Session_key':_0x78839d[_0xb4ea('0x37')]},'json':!![],'body':_0x403150};return rp(_0xd80b90);})[_0xb4ea('0x17')](function(_0x55a58a){if(_0x55a58a['total_sent']>=0x1){var _0x5bfc13={'messageId':_0x55a58a[_0xb4ea('0x38')]};if(_0x20dbbf[_0xb4ea('0x2e')]!=='GP'||!_0x20dbbf[_0xb4ea('0x39')]){_0x5bfc13[_0xb4ea('0x3a')]=!![];}return _0x3ba079['update'](_0x5bfc13);}else{return logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),_0xb4ea('0x2a'),_0xb4ea('0x3b'),util[_0xb4ea('0x3c')](_0x55a58a,{'showHidden':![],'depth':null}));}})[_0xb4ea('0x28')](function(_0x256962){return logger['error'](_0xb4ea('0x29'),_0xb4ea('0x2a'),'skebby',util[_0xb4ea('0x3c')](_0x256962,{'showHidden':![],'depth':null}));});}else{logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),'afterCreate',_0xb4ea('0x3b'),_0xb4ea('0x3d'));}break;case'connectel':if(_0x20dbbf['authToken']){var _0xf25429={'recipient':_0x287015['phone'],'message':_0x287015['body'],'sender':_0x20dbbf[_0xb4ea('0x3e')]||_0x20dbbf['phone'],'authorization':_0x20dbbf['authToken']};var _0x58ac58={'method':'POST','uri':_0xb4ea('0x3f'),'body':_0xf25429,'json':!![]};rp(_0x58ac58)[_0xb4ea('0x17')](function(_0x3fe64b){var _0x4bfa1c={'messageId':_0x3fe64b['requestid']};if(!_0x20dbbf[_0xb4ea('0x39')]){_0x4bfa1c[_0xb4ea('0x3a')]=!![];}return _0x3ba079[_0xb4ea('0x18')](_0x4bfa1c);})[_0xb4ea('0x28')](function(_0x44cacc){logger['error'](_0xb4ea('0x29'),_0xb4ea('0x2a'),_0xb4ea('0x40'),util[_0xb4ea('0x3c')](_0x44cacc,{'showHidden':![],'depth':null}));});}else{logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),_0xb4ea('0x2a'),_0xb4ea('0x40'),_0xb4ea('0x41'));}break;case'clicksend':if(_0x20dbbf[_0xb4ea('0x30')]&&_0x20dbbf['password']){var _0xf25429={'messages':[{'source':_0xb4ea('0x42'),'to':_0x287015[_0xb4ea('0x21')],'body':_0x287015[_0xb4ea('0xd')],'from':_0x20dbbf[_0xb4ea('0x3e')]||_0x20dbbf['phone']}]};var _0x425a56=util[_0xb4ea('0x43')](_0xb4ea('0x44'),_0x20dbbf['username'],_0x20dbbf[_0xb4ea('0x2d')]);var _0x58ac58={'method':_0xb4ea('0x35'),'uri':_0xb4ea('0x45'),'body':_0xf25429,'headers':{'Authorization':util[_0xb4ea('0x43')]('Basic\x20%s',new Buffer(_0x425a56)[_0xb4ea('0x46')](_0xb4ea('0x47')))},'json':!![]};rp(_0x58ac58)[_0xb4ea('0x17')](function(_0x5ce649){if(_0x5ce649[_0xb4ea('0x48')]>=0xc8&&_0x5ce649[_0xb4ea('0x48')]<=0xce){if(_0x5ce649[_0xb4ea('0x49')]&&_0x5ce649[_0xb4ea('0x49')]['queued_count']>0x0){var _0x3d0ecb=_[_0xb4ea('0x4a')](_0x5ce649['data'][_0xb4ea('0x22')]);var _0x1ec34a={'messageId':_0x3d0ecb[_0xb4ea('0x4b')]};if(!_0x20dbbf[_0xb4ea('0x39')]){_0x1ec34a[_0xb4ea('0x3a')]=!![];}return _0x3ba079[_0xb4ea('0x18')](_0x1ec34a);}else{logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),_0xb4ea('0x2a'),_0xb4ea('0x4c'),util[_0xb4ea('0x3c')](_0x5ce649,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xb4ea('0x29'),'afterCreate',_0xb4ea('0x4c'),util['inspect'](_0x5ce649,{'showHidden':![],'depth':null}));}})[_0xb4ea('0x28')](function(_0x2a5cfb){logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),_0xb4ea('0x2a'),'clickSend',util[_0xb4ea('0x3c')](_0x2a5cfb,{'showHidden':![],'depth':null}));});}else{logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),_0xb4ea('0x2a'),_0xb4ea('0x4c'),_0xb4ea('0x3d'));}break;case _0xb4ea('0x4d'):if(_0x20dbbf[_0xb4ea('0x4e')]&&_0x20dbbf[_0xb4ea('0x4f')]){var _0xf25429={'dst':_0x287015[_0xb4ea('0x21')],'text':_0x287015[_0xb4ea('0xd')],'src':_0x20dbbf[_0xb4ea('0x3e')]||_0x20dbbf[_0xb4ea('0x21')],'url':_0x20dbbf[_0xb4ea('0x24')]+_0xb4ea('0x50')+_0x287015['id']+'/status?token='+_0x20dbbf[_0xb4ea('0x26')]};var _0x425a56=util[_0xb4ea('0x43')](_0xb4ea('0x44'),_0x20dbbf[_0xb4ea('0x4e')],_0x20dbbf[_0xb4ea('0x4f')]);var _0x58ac58={'method':_0xb4ea('0x35'),'uri':util[_0xb4ea('0x43')](_0xb4ea('0x51'),_0x20dbbf[_0xb4ea('0x4e')]),'body':_0xf25429,'headers':{'Authorization':util['format'](_0xb4ea('0x52'),new Buffer(_0x425a56)[_0xb4ea('0x46')]('base64'))},'json':!![]};rp(_0x58ac58)['then'](function(_0x899493){var _0x29b434={'messageId':_0x899493[_0xb4ea('0x53')][0x0]};return _0x3ba079[_0xb4ea('0x18')](_0x29b434);})['catch'](function(_0x13f1ff){logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),'afterCreate',_0xb4ea('0x4d'),util[_0xb4ea('0x3c')](_0x13f1ff,{'showHidden':![],'depth':null}));});}else{logger[_0xb4ea('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4ea('0x2a'),_0xb4ea('0x4d'),_0xb4ea('0x54'));}break;case'infobip':if(_0x20dbbf[_0xb4ea('0x30')]&&_0x20dbbf[_0xb4ea('0x2d')]){if(_0x20dbbf['baseUrl']){var _0x97f281={'method':_0xb4ea('0x35'),'uri':_0x20dbbf[_0xb4ea('0x55')]+'/auth/1/session','body':{'username':_0x20dbbf[_0xb4ea('0x30')],'password':_0x20dbbf[_0xb4ea('0x2d')]},'json':!![]};return rp(_0x97f281)['then'](function(_0x24b637){var _0x28858b={'method':_0xb4ea('0x35'),'uri':_0x20dbbf[_0xb4ea('0x55')]+_0xb4ea('0x56'),'body':{'messages':[{'from':_0x20dbbf[_0xb4ea('0x21')],'destinations':[{'to':_0x287015['phone']}],'text':_0x287015[_0xb4ea('0xd')],'notifyUrl':_0x20dbbf[_0xb4ea('0x24')]+_0xb4ea('0x50')+_0x287015['id']+_0xb4ea('0x25')+_0x20dbbf[_0xb4ea('0x26')],'notifyContentType':_0xb4ea('0x57'),'callbackData':_0x20dbbf[_0xb4ea('0x21')]+';'+_0x287015[_0xb4ea('0xd')]}]},'headers':{'Authorization':_0xb4ea('0x58')+_0x24b637['token']},'json':!![]};return rp(_0x28858b)[_0xb4ea('0x17')](function(_0x1c7672){if(_0x1c7672[_0xb4ea('0x22')]){var _0x1cbf58={'messageId':_0x1c7672[_0xb4ea('0x22')][0x0][_0xb4ea('0xc')]};if(!_0x20dbbf[_0xb4ea('0x39')]){_0x1cbf58[_0xb4ea('0x3a')]=!![];}return _0x3ba079[_0xb4ea('0x18')](_0x1cbf58);}else{return logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),_0xb4ea('0x2a'),_0xb4ea('0x59'),util[_0xb4ea('0x3c')](_0x1c7672,{'showHidden':![],'depth':null}));}});})[_0xb4ea('0x28')](function(_0x19bc6e){return logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),'afterCreate',_0xb4ea('0x59'),util[_0xb4ea('0x3c')](_0x19bc6e,{'showHidden':![],'depth':null}));});}else{logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),_0xb4ea('0x2a'),_0xb4ea('0x59'),_0xb4ea('0x5a'));}}else{logger[_0xb4ea('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4ea('0x2a'),_0xb4ea('0x59'),_0xb4ea('0x3d'));}break;case _0xb4ea('0x5b'):var _0x94f830=require(_0xb4ea('0x5c'));if(_0x20dbbf['apiKey']){var _0x3256a5={};_0x3256a5[_0xb4ea('0x5d')]=_0x20dbbf['username'];_0x3256a5[_0xb4ea('0x21')]=_0x287015[_0xb4ea('0x21')];_0x3256a5[_0xb4ea('0x2f')]=_0x20dbbf[_0xb4ea('0x21')];_0x3256a5[_0xb4ea('0x5e')]=_0x287015[_0xb4ea('0xd')];_0x3256a5[_0xb4ea('0x5f')]=+new Date();var _0x7043e1='';var _0x4fd055='';var _0x137252=Object['keys'](_0x3256a5);_0x137252['sort']();for(var _0x141ca8=0x0;_0x141ca8<_0x137252[_0xb4ea('0x60')];_0x141ca8++){if(_0x7043e1!=''){_0x7043e1+='&';}_0x7043e1+=_0x137252[_0x141ca8]+'='+encodeURIComponent(_0x3256a5[_0x137252[_0x141ca8]]);_0x4fd055+=_0x3256a5[_0x137252[_0x141ca8]];}_0x4fd055+=_0x20dbbf[_0xb4ea('0x61')];_0x4fd055=_0x94f830['createHash'](_0xb4ea('0x62'))[_0xb4ea('0x18')](_0x4fd055)[_0xb4ea('0x63')]('hex');if(_0x7043e1!==''){_0x7043e1+='&';}_0x7043e1+=_0xb4ea('0x64')+_0x4fd055;var _0xd80b90={'method':'GET','uri':_0x20dbbf[_0xb4ea('0x55')]+_0xb4ea('0x65')+_0x7043e1,'json':!![]};return rp(_0xd80b90)[_0xb4ea('0x17')](function(_0x28b0f3){var _0x309ebe=Object[_0xb4ea('0x66')](_0x28b0f3);if(_0x28b0f3[_0x309ebe[0x0]][_0xb4ea('0x1a')]&&parseInt(_0x28b0f3[_0x309ebe[0x0]][_0xb4ea('0x1a')])===0x0){var _0x596c71={'messageId':_0x28b0f3[_0x309ebe[0x0]]['id_sms']};if(!_0x20dbbf[_0xb4ea('0x39')]){_0x596c71[_0xb4ea('0x3a')]=!![];}return _0x3ba079['update'](_0x596c71);}else{return logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),_0xb4ea('0x2a'),'csc',util[_0xb4ea('0x3c')](_0x28b0f3['error'],{'showHidden':![],'depth':null}));}})[_0xb4ea('0x28')](function(_0x4bca0b){return logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),_0xb4ea('0x2a'),'csc',util[_0xb4ea('0x3c')](_0x4bca0b,{'showHidden':![],'depth':null}));});}else{logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),_0xb4ea('0x2a'),_0xb4ea('0x5b'),'Missing\x20parameters:\x20apiKey');}break;case _0xb4ea('0x67'):if(_0x20dbbf[_0xb4ea('0x61')]){var _0x4349ca={'method':_0xb4ea('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x20dbbf[_0xb4ea('0x61')]},'body':{'content':_0x287015[_0xb4ea('0xd')],'to':[_0x287015[_0xb4ea('0x21')]],'from':_0x20dbbf[_0xb4ea('0x21')],'binary':![],'clientMessageId':_0xb4ea('0x68'),'charset':_0xb4ea('0x69')},'json':!![]};rp(_0x4349ca)[_0xb4ea('0x17')](function(_0xc2f1f0){if(!_0xc2f1f0['error']){var _0xbac52a={'messageId':_0xc2f1f0['messages'][0x0][_0xb4ea('0x6a')]};if(!_0x20dbbf[_0xb4ea('0x39')]){_0xbac52a[_0xb4ea('0x3a')]=!![];}return _0x3ba079[_0xb4ea('0x18')](_0xbac52a);}else{return logger['error'](_0xb4ea('0x29'),'afterCreate',_0xb4ea('0x67'),util[_0xb4ea('0x3c')](_0xc2f1f0[_0xb4ea('0x1a')],{'showHidden':![],'depth':null}));}})[_0xb4ea('0x28')](function(_0x2eed6a){return logger[_0xb4ea('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4ea('0x2a'),'clickatell',util['inspect'](_0x2eed6a,{'showHidden':![],'depth':null}));});}else{logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),_0xb4ea('0x2a'),_0xb4ea('0x67'),_0xb4ea('0x6b'));}break;case _0xb4ea('0x6c'):if(_0x20dbbf[_0xb4ea('0x30')]&&_0x20dbbf['password']){var _0x425a56=util[_0xb4ea('0x43')]('%s:%s',_0x20dbbf['username'],_0x20dbbf[_0xb4ea('0x2d')]);var _0x58ac58={'method':_0xb4ea('0x35'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x20dbbf[_0xb4ea('0x6d')]+_0xb4ea('0x6e'),'body':{'to':[_0x287015[_0xb4ea('0x21')]],'text':_0x287015[_0xb4ea('0xd')],'from':_0x20dbbf[_0xb4ea('0x21')],'applicationId':_0x20dbbf[_0xb4ea('0x6f')]},'headers':{'Authorization':util[_0xb4ea('0x43')](_0xb4ea('0x52'),new Buffer(_0x425a56)['toString'](_0xb4ea('0x47')))},'json':!![]};rp(_0x58ac58)[_0xb4ea('0x17')](function(_0x1d6cc3){if(_0x1d6cc3['id']){var _0x1699a7={'messageId':_0x1d6cc3['id']};return _0x3ba079[_0xb4ea('0x18')](_0x1699a7);}else{logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),_0xb4ea('0x2a'),_0xb4ea('0x6c'),util[_0xb4ea('0x3c')](_0x1d6cc3,{'showHidden':![],'depth':null}));}})[_0xb4ea('0x28')](function(_0x381c81){logger[_0xb4ea('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4ea('0x2a'),_0xb4ea('0x6c'),util[_0xb4ea('0x3c')](_0x381c81,{'showHidden':![],'depth':null}));});}else{logger[_0xb4ea('0x1a')](_0xb4ea('0x29'),'afterCreate',_0xb4ea('0x6c'),_0xb4ea('0x3d'));}break;case _0xb4ea('0x70'):if(_0x20dbbf['apiKey']){var _0x31a4b4={};var _0xd80b90={'method':_0xb4ea('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x20dbbf[_0xb4ea('0x61')],'Content-Type':_0xb4ea('0x57')},'body':{'from':_0x20dbbf[_0xb4ea('0x21')],'to':_0x287015[_0xb4ea('0x21')],'text':_0x287015[_0xb4ea('0xd')]},'json':!![]};return rp(_0xd80b90)[_0xb4ea('0x17')](function(_0x340e6b){if(_0x340e6b[_0xb4ea('0x71')]==0xca){_0x31a4b4[_0xb4ea('0x72')]=_0x340e6b;var _0x3b0649={'method':'POST','uri':_0xb4ea('0x73'),'headers':{'Authorization':_0xb4ea('0x74')+_0x20dbbf[_0xb4ea('0x61')],'Content-Type':_0xb4ea('0x57')},'body':{'refid':_0x31a4b4[_0xb4ea('0x72')][_0xb4ea('0x75')]},'json':!![]};return rp(_0x3b0649)['then'](function(_0x1522bc){_0x31a4b4[_0xb4ea('0x76')]=_0x1522bc;var _0x412e3e={'messageId':_0x31a4b4[_0xb4ea('0x72')][_0xb4ea('0x75')],'read':!![]};return _0x3ba079[_0xb4ea('0x18')](_0x412e3e);});}else{return logger[_0xb4ea('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4ea('0x2a'),_0xb4ea('0x70'),util[_0xb4ea('0x3c')](_0x340e6b,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2b2a5c){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4ea('0x2a'),_0xb4ea('0x70'),util[_0xb4ea('0x3c')](_0x2b2a5c,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb4ea('0x70'),_0xb4ea('0x77'));}break;}}})[_0xb4ea('0x78')](function(){_0x26b7de();});}else{_0x26b7de();}}},'charset':_0xb4ea('0x79'),'collate':_0xb4ea('0x7a')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 0054436..e90f43b 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 _0x36b0=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','SmsMessage','body','options','CreateSmsMessage','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x5ce81a,_0x364643){var _0xc00bea=function(_0x1764bf){while(--_0x1764bf){_0x5ce81a['push'](_0x5ce81a['shift']());}};_0xc00bea(++_0x364643);}(_0x36b0,0x111));var _0x036b=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x36b0[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x036b('0x0'));var util=require(_0x036b('0x1'));var moment=require('moment');var BPromise=require(_0x036b('0x2'));var rs=require(_0x036b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x036b('0x4'));var logger=require(_0x036b('0x5'))(_0x036b('0x6'));var config=require(_0x036b('0x7'));var jayson=require(_0x036b('0x8'));var client=jayson[_0x036b('0x9')][_0x036b('0xa')]({'port':0x232a});config[_0x036b('0xb')]=_[_0x036b('0xc')](config['redis'],{'host':_0x036b('0xd'),'port':0x18eb});var socket=require(_0x036b('0xe'))(new Redis(config[_0x036b('0xb')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0xfe9091,_0x5813ee,_0x165868){return new BPromise(function(_0x3be515,_0x2fea5b){return client[_0x036b('0xf')](_0xfe9091,_0x165868)[_0x036b('0x10')](function(_0x13c75d){logger[_0x036b('0x11')]('SmsMessage,\x20%s,\x20%s',_0x5813ee,'request\x20sent');logger[_0x036b('0x12')](_0x036b('0x13'),_0x5813ee,'request\x20sent',JSON[_0x036b('0x14')](_0x13c75d));if(_0x13c75d[_0x036b('0x15')]){if(_0x13c75d[_0x036b('0x15')][_0x036b('0x16')]===0x1f4){logger[_0x036b('0x15')](_0x036b('0x17'),_0x5813ee,_0x13c75d[_0x036b('0x15')][_0x036b('0x18')]);return _0x2fea5b(_0x13c75d[_0x036b('0x15')][_0x036b('0x18')]);}logger[_0x036b('0x15')]('SmsMessage,\x20%s,\x20%s',_0x5813ee,_0x13c75d['error'][_0x036b('0x18')]);return _0x3be515(_0x13c75d[_0x036b('0x15')][_0x036b('0x18')]);}else{logger[_0x036b('0x11')](_0x036b('0x17'),_0x5813ee,'request\x20sent');_0x3be515(_0x13c75d[_0x036b('0x19')]['message']);}})[_0x036b('0x1a')](function(_0x3bfb27){logger[_0x036b('0x15')]('SmsMessage,\x20%s,\x20%s',_0x5813ee,_0x3bfb27);_0x2fea5b(_0x3bfb27);});});}exports['CreateSmsMessage']=function(_0xa3343b){var _0x125021=this;return new Promise(function(_0x1da157,_0x5691dd){return db[_0x036b('0x1b')]['create'](_0xa3343b[_0x036b('0x1c')],{'raw':_0xa3343b['options']?_0xa3343b[_0x036b('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x036b('0x10')](function(_0x8e8498){logger['info'](_0x036b('0x1e'),_0xa3343b);logger[_0x036b('0x12')](_0x036b('0x1e'),_0xa3343b,JSON[_0x036b('0x14')](_0x8e8498));_0x1da157(_0x8e8498);})['catch'](function(_0x3881de){logger['error'](_0x036b('0x1e'),_0x3881de['message'],_0xa3343b);_0x5691dd(_0x125021[_0x036b('0x15')](0x1f4,_0x3881de[_0x036b('0x18')]));});});}; \ No newline at end of file +var _0xd9d5=['options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateSmsMessage','SmsMessage'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xd9d5,0x1ef));var _0x5d9d=function(_0xd4618c,_0x3d1d13){_0xd4618c=_0xd4618c-0x0;var _0x37e0f1=_0xd9d5[_0xd4618c];return _0x37e0f1;};'use strict';var _=require(_0x5d9d('0x0'));var util=require(_0x5d9d('0x1'));var moment=require(_0x5d9d('0x2'));var BPromise=require(_0x5d9d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d9d('0x4'));var db=require(_0x5d9d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5d9d('0x6'));var config=require(_0x5d9d('0x7'));var jayson=require(_0x5d9d('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x5d9d('0x9')]=_[_0x5d9d('0xa')](config[_0x5d9d('0x9')],{'host':_0x5d9d('0xb'),'port':0x18eb});var socket=require(_0x5d9d('0xc'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x5d9d('0xd')](socket);function respondWithRpcPromise(_0x592e99,_0x39686f,_0x514bad){return new BPromise(function(_0x5d0736,_0x4d1b05){return client[_0x5d9d('0xe')](_0x592e99,_0x514bad)[_0x5d9d('0xf')](function(_0x3829ce){logger[_0x5d9d('0x10')](_0x5d9d('0x11'),_0x39686f,'request\x20sent');logger[_0x5d9d('0x12')](_0x5d9d('0x13'),_0x39686f,_0x5d9d('0x14'),JSON[_0x5d9d('0x15')](_0x3829ce));if(_0x3829ce[_0x5d9d('0x16')]){if(_0x3829ce[_0x5d9d('0x16')]['code']===0x1f4){logger[_0x5d9d('0x16')](_0x5d9d('0x11'),_0x39686f,_0x3829ce[_0x5d9d('0x16')][_0x5d9d('0x17')]);return _0x4d1b05(_0x3829ce[_0x5d9d('0x16')]['message']);}logger[_0x5d9d('0x16')](_0x5d9d('0x11'),_0x39686f,_0x3829ce[_0x5d9d('0x16')][_0x5d9d('0x17')]);return _0x5d0736(_0x3829ce[_0x5d9d('0x16')]['message']);}else{logger[_0x5d9d('0x10')]('SmsMessage,\x20%s,\x20%s',_0x39686f,_0x5d9d('0x14'));_0x5d0736(_0x3829ce['result'][_0x5d9d('0x17')]);}})[_0x5d9d('0x18')](function(_0x532ec2){logger[_0x5d9d('0x16')](_0x5d9d('0x11'),_0x39686f,_0x532ec2);_0x4d1b05(_0x532ec2);});});}exports[_0x5d9d('0x19')]=function(_0x5f4629){var _0xa6e13d=this;return new Promise(function(_0x35ff7b,_0x3f2153){return db[_0x5d9d('0x1a')]['create'](_0x5f4629['body'],{'raw':_0x5f4629[_0x5d9d('0x1b')]?_0x5f4629[_0x5d9d('0x1b')][_0x5d9d('0x1c')]===undefined?!![]:![]:!![]})[_0x5d9d('0xf')](function(_0x561569){logger[_0x5d9d('0x10')]('CreateSmsMessage',_0x5f4629);logger[_0x5d9d('0x12')](_0x5d9d('0x19'),_0x5f4629,JSON[_0x5d9d('0x15')](_0x561569));_0x35ff7b(_0x561569);})[_0x5d9d('0x18')](function(_0x29ab40){logger[_0x5d9d('0x16')]('CreateSmsMessage',_0x29ab40[_0x5d9d('0x17')],_0x5f4629);_0x3f2153(_0xa6e13d[_0x5d9d('0x16')](0x1f4,_0x29ab40[_0x5d9d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index aa0d003..840ccf8 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 _0xb492=['remove','update','emit','removeListener','length','smsMessage:','save'];(function(_0x1beccb,_0x42af8b){var _0x235962=function(_0x3269f3){while(--_0x3269f3){_0x1beccb['push'](_0x1beccb['shift']());}};_0x235962(++_0x42af8b);}(_0xb492,0x172));var _0x2b49=function(_0x2f96b4,_0x1eb511){_0x2f96b4=_0x2f96b4-0x0;var _0x3cfb03=_0xb492[_0x2f96b4];return _0x3cfb03;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x2b49('0x0'),_0x2b49('0x1'),_0x2b49('0x2')];function createListener(_0x1f3b35,_0x51fad7){return function(_0x522210){_0x51fad7[_0x2b49('0x3')](_0x1f3b35,_0x522210);};}function removeListener(_0x340296,_0x317a1d){return function(){SmsMessageEvents[_0x2b49('0x4')](_0x340296,_0x317a1d);};}exports['register']=function(_0x53508a){for(var _0x346359=0x0,_0x363d21=events[_0x2b49('0x5')];_0x346359<_0x363d21;_0x346359++){var _0x2b745f=events[_0x346359];var _0x1b06c2=createListener(_0x2b49('0x6')+_0x2b745f,_0x53508a);SmsMessageEvents['on'](_0x2b745f,_0x1b06c2);}}; \ No newline at end of file +var _0xcc32=['length','./smsMessage.events','save','remove','emit','removeListener','register'];(function(_0x3e3da3,_0x159986){var _0x2a7b7d=function(_0x4e5de3){while(--_0x4e5de3){_0x3e3da3['push'](_0x3e3da3['shift']());}};_0x2a7b7d(++_0x159986);}(_0xcc32,0xef));var _0x2cc3=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xcc32[_0x19950b];return _0x3c6b41;};'use strict';var SmsMessageEvents=require(_0x2cc3('0x0'));var events=[_0x2cc3('0x1'),_0x2cc3('0x2'),'update'];function createListener(_0x5ee53f,_0x141b86){return function(_0x5e71d3){_0x141b86[_0x2cc3('0x3')](_0x5ee53f,_0x5e71d3);};}function removeListener(_0x49feb9,_0x5bd3ca){return function(){SmsMessageEvents[_0x2cc3('0x4')](_0x49feb9,_0x5bd3ca);};}exports[_0x2cc3('0x5')]=function(_0x1528bf){for(var _0x4938fa=0x0,_0x4d54bd=events[_0x2cc3('0x6')];_0x4938fa<_0x4d54bd;_0x4938fa++){var _0x24debc=events[_0x4938fa];var _0x32fbcf=createListener('smsMessage:'+_0x24debc,_0x1528bf);SmsMessageEvents['on'](_0x24debc,_0x32fbcf);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 3241ff9..8b8c191 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 _0x6d8c=['show','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x6d8c,0x9f));var _0xc6d8=function(_0x327265,_0x2473e6){_0x327265=_0x327265-0x0;var _0x5b7fab=_0x6d8c[_0x327265];return _0x5b7fab;};'use strict';var multer=require(_0xc6d8('0x0'));var util=require(_0xc6d8('0x1'));var path=require(_0xc6d8('0x2'));var timeout=require(_0xc6d8('0x3'));var express=require('express');var router=express[_0xc6d8('0x4')]();var fs_extra=require(_0xc6d8('0x5'));var auth=require(_0xc6d8('0x6'));var interaction=require(_0xc6d8('0x7'));var config=require(_0xc6d8('0x8'));var controller=require(_0xc6d8('0x9'));router[_0xc6d8('0xa')]('/',auth[_0xc6d8('0xb')](),controller[_0xc6d8('0xc')]);router[_0xc6d8('0xa')]('/describe',auth[_0xc6d8('0xb')](),controller[_0xc6d8('0xd')]);router['get'](_0xc6d8('0xe'),auth[_0xc6d8('0xb')](),controller[_0xc6d8('0xf')]);router['get']('/:id/members',auth[_0xc6d8('0xb')](),controller['getMembers']);router[_0xc6d8('0xa')](_0xc6d8('0x10'),auth[_0xc6d8('0xb')](),controller[_0xc6d8('0x11')]);router[_0xc6d8('0xa')](_0xc6d8('0x12'),auth['isAuthenticated'](),controller[_0xc6d8('0x13')]);router[_0xc6d8('0x14')]('/',auth[_0xc6d8('0xb')](),controller['create']);router[_0xc6d8('0x14')](_0xc6d8('0x10'),auth[_0xc6d8('0xb')](),controller['addTeams']);router[_0xc6d8('0x14')]('/:id/users',auth[_0xc6d8('0xb')](),controller[_0xc6d8('0x15')]);router[_0xc6d8('0x16')](_0xc6d8('0xe'),auth[_0xc6d8('0xb')](),controller[_0xc6d8('0x17')]);router[_0xc6d8('0x18')](_0xc6d8('0xe'),auth[_0xc6d8('0xb')](),controller[_0xc6d8('0x19')]);router[_0xc6d8('0x18')](_0xc6d8('0x10'),auth[_0xc6d8('0xb')](),controller[_0xc6d8('0x1a')]);router[_0xc6d8('0x18')](_0xc6d8('0x12'),auth[_0xc6d8('0xb')](),controller[_0xc6d8('0x1b')]);module[_0xc6d8('0x1c')]=router; \ No newline at end of file +var _0x7f7a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','multer','path'];(function(_0x20c7ec,_0x50f63a){var _0x1cddf3=function(_0x5af72d){while(--_0x5af72d){_0x20c7ec['push'](_0x20c7ec['shift']());}};_0x1cddf3(++_0x50f63a);}(_0x7f7a,0x1ae));var _0xa7f7=function(_0x5cf0c1,_0x14c20a){_0x5cf0c1=_0x5cf0c1-0x0;var _0x1fc67d=_0x7f7a[_0x5cf0c1];return _0x1fc67d;};'use strict';var multer=require(_0xa7f7('0x0'));var util=require('util');var path=require(_0xa7f7('0x1'));var timeout=require(_0xa7f7('0x2'));var express=require(_0xa7f7('0x3'));var router=express[_0xa7f7('0x4')]();var fs_extra=require(_0xa7f7('0x5'));var auth=require(_0xa7f7('0x6'));var interaction=require(_0xa7f7('0x7'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0xa7f7('0x8')]('/',auth[_0xa7f7('0x9')](),controller[_0xa7f7('0xa')]);router[_0xa7f7('0x8')](_0xa7f7('0xb'),auth['isAuthenticated'](),controller[_0xa7f7('0xc')]);router[_0xa7f7('0x8')](_0xa7f7('0xd'),auth[_0xa7f7('0x9')](),controller[_0xa7f7('0xe')]);router['get'](_0xa7f7('0xf'),auth[_0xa7f7('0x9')](),controller[_0xa7f7('0x10')]);router[_0xa7f7('0x8')](_0xa7f7('0x11'),auth[_0xa7f7('0x9')](),controller['getTeams']);router[_0xa7f7('0x8')]('/:id/users',auth[_0xa7f7('0x9')](),controller[_0xa7f7('0x12')]);router[_0xa7f7('0x13')]('/',auth[_0xa7f7('0x9')](),controller['create']);router[_0xa7f7('0x13')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router['post'](_0xa7f7('0x14'),auth['isAuthenticated'](),controller[_0xa7f7('0x15')]);router[_0xa7f7('0x16')](_0xa7f7('0xd'),auth[_0xa7f7('0x9')](),controller[_0xa7f7('0x17')]);router[_0xa7f7('0x18')](_0xa7f7('0xd'),auth[_0xa7f7('0x9')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xa7f7('0x9')](),controller[_0xa7f7('0x19')]);router[_0xa7f7('0x18')]('/:id/users',auth[_0xa7f7('0x9')](),controller[_0xa7f7('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 4ee3feb..e1e5540 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 _0xda5f=['name','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x3f185d,_0x35af0d){var _0x2d9ec5=function(_0x4a9486){while(--_0x4a9486){_0x3f185d['push'](_0x3f185d['shift']());}};_0x2d9ec5(++_0x35af0d);}(_0xda5f,0x1d3));var _0xfda5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda5f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfda5('0x0')],'unique':_0xfda5('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfda5('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfda5('0x2')](_0xfda5('0x3'),_0xfda5('0x4'),_0xfda5('0x5'))}}; \ No newline at end of file +var _0xb26f=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x76d679,_0x58270c){var _0x4539b8=function(_0x131f97){while(--_0x131f97){_0x76d679['push'](_0x76d679['shift']());}};_0x4539b8(++_0x58270c);}(_0xb26f,0x170));var _0xfb26=function(_0xd13171,_0xc54453){_0xd13171=_0xd13171-0x0;var _0x452bd0=_0xb26f[_0xd13171];return _0x452bd0;};'use strict';var Sequelize=require(_0xfb26('0x0'));module['exports']={'name':{'type':Sequelize[_0xfb26('0x1')],'unique':_0xfb26('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfb26('0x1')]},'timeout':{'type':Sequelize[_0xfb26('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfb26('0x4')](_0xfb26('0x5'),_0xfb26('0x6'),_0xfb26('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index c6e5b4a..8bf6956 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 _0x3ab0=['smsPause','updatedAt','createdAt','format','SIP','Team','order','getTeams','addTeams','voicePause','interface','flatMap','Agents','sequelize','each','forEach','userSmsQueue:save','ids','select','field','tq.TeamId','from','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','value','removeTeams','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','isArray','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','get','SmsQueues','UserProfileResource','error','stack','name','index','SmsQueue','rawAttributes','fieldName','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','type','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','destroy','describe','getMembers','UserSmsQueue','SmsQueueId','filter','User','UserId','agent'];(function(_0x5093ed,_0x298207){var _0x28532c=function(_0xb53384){while(--_0xb53384){_0x5093ed['push'](_0x5093ed['shift']());}};_0x28532c(++_0x298207);}(_0x3ab0,0xb6));var _0x03ab=function(_0x45510d,_0x5cfd0b){_0x45510d=_0x45510d-0x0;var _0x57344a=_0x3ab0[_0x45510d];return _0x57344a;};'use strict';var emlformat=require(_0x03ab('0x0'));var rimraf=require(_0x03ab('0x1'));var zipdir=require(_0x03ab('0x2'));var jsonpatch=require(_0x03ab('0x3'));var rp=require(_0x03ab('0x4'));var moment=require(_0x03ab('0x5'));var BPromise=require(_0x03ab('0x6'));var Mustache=require(_0x03ab('0x7'));var util=require(_0x03ab('0x8'));var path=require(_0x03ab('0x9'));var sox=require('sox');var csv=require(_0x03ab('0xa'));var ejs=require(_0x03ab('0xb'));var fs=require('fs');var fs_extra=require(_0x03ab('0xc'));var _=require(_0x03ab('0xd'));var squel=require(_0x03ab('0xe'));var crypto=require(_0x03ab('0xf'));var jsforce=require(_0x03ab('0x10'));var deskjs=require(_0x03ab('0x11'));var toCsv=require(_0x03ab('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x03ab('0x12'));var authService=require(_0x03ab('0x13'));var qs=require(_0x03ab('0x14'));var as=require(_0x03ab('0x15'));var hardwareService=require(_0x03ab('0x16'));var logger=require(_0x03ab('0x17'))(_0x03ab('0x18'));var utils=require(_0x03ab('0x19'));var config=require(_0x03ab('0x1a'));var licenseUtil=require(_0x03ab('0x1b'));var db=require('../../mysqldb')['db'];config[_0x03ab('0x1c')]=_[_0x03ab('0x1d')](config[_0x03ab('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x03ab('0x1e'))(new Redis(config[_0x03ab('0x1c')]));require(_0x03ab('0x1f'))['register'](socket);function respondWithStatusCode(_0x57c3c8,_0xa73a71){_0xa73a71=_0xa73a71||0xcc;return function(_0x4b64f4){if(_0x4b64f4){return _0x57c3c8[_0x03ab('0x20')](_0xa73a71);}return _0x57c3c8[_0x03ab('0x21')](_0xa73a71)[_0x03ab('0x22')]();};}function respondWithResult(_0x3d73f6,_0x2f1b87){_0x2f1b87=_0x2f1b87||0xc8;return function(_0x2d6e53){if(_0x2d6e53){return _0x3d73f6[_0x03ab('0x21')](_0x2f1b87)[_0x03ab('0x23')](_0x2d6e53);}};}function respondWithFilteredResult(_0x3a470c,_0xba939a){return function(_0x1b49c8){if(_0x1b49c8){var _0x38ce86=typeof _0xba939a[_0x03ab('0x24')]==='undefined'&&typeof _0xba939a[_0x03ab('0x25')]===_0x03ab('0x26');var _0x138cb2=_0x1b49c8[_0x03ab('0x27')];var _0x4efccd=_0x38ce86?0x0:_0xba939a['offset'];var _0xe5f43b=_0x38ce86?_0x1b49c8[_0x03ab('0x27')]:_0xba939a['offset']+_0xba939a[_0x03ab('0x25')];var _0x620da9;if(_0xe5f43b>=_0x138cb2){_0xe5f43b=_0x138cb2;_0x620da9=0xc8;}else{_0x620da9=0xce;}_0x3a470c['status'](_0x620da9);return _0x3a470c['set'](_0x03ab('0x28'),_0x4efccd+'-'+_0xe5f43b+'/'+_0x138cb2)[_0x03ab('0x23')](_0x1b49c8);}return null;};}function patchUpdates(_0x2469b4){return function(_0x2db19f){try{jsonpatch[_0x03ab('0x29')](_0x2db19f,_0x2469b4,!![]);}catch(_0x2b3859){return BPromise[_0x03ab('0x2a')](_0x2b3859);}return _0x2db19f[_0x03ab('0x2b')]();};}function saveUpdates(_0x46c72a,_0x14a3f7){return function(_0x209ff4){if(_0x209ff4){return _0x209ff4[_0x03ab('0x2c')](_0x46c72a)[_0x03ab('0x2d')](function(_0x134e1e){return _0x134e1e;});}return null;};}function removeEntity(_0x1127bd,_0x1d6f44){return function(_0x481d12){if(_0x481d12){return _0x481d12['destroy']()['then'](function(){var _0x35bc79=_0x481d12[_0x03ab('0x2e')]({'plain':!![]});var _0x3a3161=_0x03ab('0x2f');return db[_0x03ab('0x30')]['destroy']({'where':{'type':_0x3a3161,'resourceId':_0x35bc79['id']}})['then'](function(){return _0x481d12;});})[_0x03ab('0x2d')](function(){_0x1127bd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45489b,_0x33daaf){return function(_0x4ee6c2){if(!_0x4ee6c2){_0x45489b['sendStatus'](0x194);}return _0x4ee6c2;};}function handleError(_0x1083dc,_0x3e559c){_0x3e559c=_0x3e559c||0x1f4;return function(_0x1f036a){logger[_0x03ab('0x31')](_0x1f036a[_0x03ab('0x32')]);if(_0x1f036a[_0x03ab('0x33')]){delete _0x1f036a[_0x03ab('0x33')];}_0x1083dc[_0x03ab('0x21')](_0x3e559c)['send'](_0x1f036a);};}exports[_0x03ab('0x34')]=function(_0x2a072d,_0x5d4c9f){var _0x3aeb8d={},_0x25a892={},_0x481430={'count':0x0,'rows':[]};var _0x585851=_['map'](db[_0x03ab('0x35')][_0x03ab('0x36')],function(_0x2deff7){return{'name':_0x2deff7[_0x03ab('0x37')],'type':_0x2deff7['type']['key']};});_0x25a892['model']=_[_0x03ab('0x38')](_0x585851,_0x03ab('0x33'));_0x25a892[_0x03ab('0x39')]=_[_0x03ab('0x3a')](_0x2a072d[_0x03ab('0x39')]);_0x25a892[_0x03ab('0x3b')]=_[_0x03ab('0x3c')](_0x25a892['model'],_0x25a892[_0x03ab('0x39')]);_0x3aeb8d[_0x03ab('0x3d')]=_[_0x03ab('0x3c')](_0x25a892['model'],qs[_0x03ab('0x3e')](_0x2a072d['query'][_0x03ab('0x3e')]));_0x3aeb8d[_0x03ab('0x3d')]=_0x3aeb8d[_0x03ab('0x3d')][_0x03ab('0x3f')]?_0x3aeb8d[_0x03ab('0x3d')]:_0x25a892[_0x03ab('0x40')];if(!_0x2a072d[_0x03ab('0x39')][_0x03ab('0x41')](_0x03ab('0x42'))){_0x3aeb8d[_0x03ab('0x25')]=qs[_0x03ab('0x25')](_0x2a072d[_0x03ab('0x39')][_0x03ab('0x25')]);_0x3aeb8d[_0x03ab('0x24')]=qs['offset'](_0x2a072d[_0x03ab('0x39')][_0x03ab('0x24')]);}_0x3aeb8d['order']=qs[_0x03ab('0x43')](_0x2a072d[_0x03ab('0x39')][_0x03ab('0x43')]);_0x3aeb8d[_0x03ab('0x44')]=qs[_0x03ab('0x3b')](_[_0x03ab('0x45')](_0x2a072d[_0x03ab('0x39')],_0x25a892['filters']),_0x585851);if(_0x2a072d[_0x03ab('0x39')]['filter']){_0x3aeb8d[_0x03ab('0x44')]=_['merge'](_0x3aeb8d[_0x03ab('0x44')],{'$or':_[_0x03ab('0x38')](_0x585851,function(_0x56ab92){if(_0x56ab92[_0x03ab('0x46')]!=='VIRTUAL'){var _0x22b2cb={};_0x22b2cb[_0x56ab92[_0x03ab('0x33')]]={'$like':'%'+_0x2a072d[_0x03ab('0x39')]['filter']+'%'};return _0x22b2cb;}})});}_0x3aeb8d=_[_0x03ab('0x47')]({},_0x3aeb8d,_0x2a072d[_0x03ab('0x48')]);var _0x215110={'where':_0x3aeb8d['where']};return db[_0x03ab('0x35')][_0x03ab('0x27')](_0x215110)[_0x03ab('0x2d')](function(_0x6c90d5){_0x481430[_0x03ab('0x27')]=_0x6c90d5;if(_0x2a072d['query'][_0x03ab('0x49')]){_0x3aeb8d[_0x03ab('0x4a')]=[{'all':!![]}];}return db[_0x03ab('0x35')][_0x03ab('0x4b')](_0x3aeb8d);})[_0x03ab('0x2d')](function(_0x5cca2a){_0x481430[_0x03ab('0x4c')]=_0x5cca2a;return _0x481430;})[_0x03ab('0x2d')](respondWithFilteredResult(_0x5d4c9f,_0x3aeb8d))[_0x03ab('0x4d')](handleError(_0x5d4c9f,null));};exports[_0x03ab('0x4e')]=function(_0x323ced,_0x6da0c6){var _0x8136ba={'raw':!![],'where':{'id':_0x323ced[_0x03ab('0x4f')]['id']}},_0xba0daa={};_0xba0daa[_0x03ab('0x40')]=_[_0x03ab('0x3a')](db[_0x03ab('0x35')][_0x03ab('0x36')]);_0xba0daa[_0x03ab('0x39')]=_['keys'](_0x323ced[_0x03ab('0x39')]);_0xba0daa[_0x03ab('0x3b')]=_[_0x03ab('0x3c')](_0xba0daa['model'],_0xba0daa[_0x03ab('0x39')]);_0x8136ba[_0x03ab('0x3d')]=_['intersection'](_0xba0daa[_0x03ab('0x40')],qs[_0x03ab('0x3e')](_0x323ced[_0x03ab('0x39')][_0x03ab('0x3e')]));_0x8136ba['attributes']=_0x8136ba['attributes'][_0x03ab('0x3f')]?_0x8136ba[_0x03ab('0x3d')]:_0xba0daa[_0x03ab('0x40')];if(_0x323ced[_0x03ab('0x39')]['includeAll']){_0x8136ba[_0x03ab('0x4a')]=[{'all':!![]}];}_0x8136ba=_[_0x03ab('0x47')]({},_0x8136ba,_0x323ced[_0x03ab('0x48')]);return db[_0x03ab('0x35')][_0x03ab('0x50')](_0x8136ba)[_0x03ab('0x2d')](handleEntityNotFound(_0x6da0c6,null))[_0x03ab('0x2d')](respondWithResult(_0x6da0c6,null))[_0x03ab('0x4d')](handleError(_0x6da0c6,null));};exports[_0x03ab('0x51')]=function(_0x81ca46,_0x55a15e){return db[_0x03ab('0x35')][_0x03ab('0x51')](_0x81ca46[_0x03ab('0x52')],{})[_0x03ab('0x2d')](function(_0x573941){var _0x533605=_0x81ca46[_0x03ab('0x53')][_0x03ab('0x2e')]({'plain':!![]});if(!_0x533605)throw new Error(_0x03ab('0x54'));if(_0x533605[_0x03ab('0x55')]===_0x03ab('0x53')){var _0x159e64=_0x573941[_0x03ab('0x2e')]({'plain':!![]});var _0x2082c9=_0x03ab('0x2f');return db['UserProfileSection']['find']({'where':{'name':_0x2082c9,'userProfileId':_0x533605[_0x03ab('0x56')]},'raw':!![]})[_0x03ab('0x2d')](function(_0x4a10b7){if(_0x4a10b7&&_0x4a10b7['autoAssociation']===0x0){return db[_0x03ab('0x30')]['create']({'name':_0x159e64[_0x03ab('0x33')],'resourceId':_0x159e64['id'],'type':_0x4a10b7[_0x03ab('0x33')],'sectionId':_0x4a10b7['id']},{})[_0x03ab('0x2d')](function(){return _0x573941;});}else{return _0x573941;}})[_0x03ab('0x4d')](function(_0x3883ce){logger[_0x03ab('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3883ce);throw _0x3883ce;});}return _0x573941;})[_0x03ab('0x2d')](respondWithResult(_0x55a15e,0xc9))[_0x03ab('0x4d')](handleError(_0x55a15e,null));};exports[_0x03ab('0x2c')]=function(_0xa108f7,_0x94d8a7){if(_0xa108f7[_0x03ab('0x52')]['id']){delete _0xa108f7[_0x03ab('0x52')]['id'];}return db['SmsQueue'][_0x03ab('0x50')]({'where':{'id':_0xa108f7[_0x03ab('0x4f')]['id']}})['then'](handleEntityNotFound(_0x94d8a7,null))['then'](saveUpdates(_0xa108f7[_0x03ab('0x52')],null))[_0x03ab('0x2d')](respondWithResult(_0x94d8a7,null))[_0x03ab('0x4d')](handleError(_0x94d8a7,null));};exports[_0x03ab('0x57')]=function(_0x589e6d,_0x8d373){return db[_0x03ab('0x35')][_0x03ab('0x50')]({'where':{'id':_0x589e6d[_0x03ab('0x4f')]['id']}})[_0x03ab('0x2d')](handleEntityNotFound(_0x8d373,null))['then'](removeEntity(_0x8d373,null))[_0x03ab('0x4d')](handleError(_0x8d373,null));};exports[_0x03ab('0x58')]=function(_0x32f0de,_0x1b195b){return db[_0x03ab('0x35')]['describe']()[_0x03ab('0x2d')](respondWithResult(_0x1b195b,null))['catch'](handleError(_0x1b195b,null));};exports[_0x03ab('0x59')]=function(_0x14907e,_0x4f0fd9,_0x1a1c4e){var _0x475d56={'raw':!![],'where':{}},_0x25c5ba={},_0x1281a5;return db[_0x03ab('0x35')]['findOne']({'where':{'id':_0x14907e['params']['id']}})[_0x03ab('0x2d')](handleEntityNotFound(_0x4f0fd9,null))['then'](function(_0x4c7721){if(_0x4c7721){_0x1281a5=_0x4c7721[_0x03ab('0x2e')]({'plain':!![]});_0x25c5ba[_0x03ab('0x40')]=_[_0x03ab('0x3a')](db[_0x03ab('0x5a')][_0x03ab('0x36')]);_0x25c5ba[_0x03ab('0x39')]=_[_0x03ab('0x3a')](_0x14907e[_0x03ab('0x39')]);_0x25c5ba['filters']=_[_0x03ab('0x3c')](_0x25c5ba[_0x03ab('0x40')],_0x25c5ba[_0x03ab('0x39')]);_0x475d56[_0x03ab('0x3d')]=_['intersection'](_0x25c5ba[_0x03ab('0x40')],qs[_0x03ab('0x3e')](_0x14907e[_0x03ab('0x39')][_0x03ab('0x3e')]));_0x475d56['attributes']=_0x475d56[_0x03ab('0x3d')]['length']?_0x475d56['attributes']:_0x25c5ba['model'];if(!_0x14907e[_0x03ab('0x39')][_0x03ab('0x41')](_0x03ab('0x42'))){_0x475d56[_0x03ab('0x25')]=qs[_0x03ab('0x25')](_0x14907e[_0x03ab('0x39')][_0x03ab('0x25')]);_0x475d56[_0x03ab('0x24')]=qs[_0x03ab('0x24')](_0x14907e[_0x03ab('0x39')][_0x03ab('0x24')]);}_0x475d56['order']=qs[_0x03ab('0x43')](_0x14907e['query'][_0x03ab('0x43')]);_0x475d56[_0x03ab('0x44')]=qs[_0x03ab('0x3b')](_[_0x03ab('0x45')](_0x14907e[_0x03ab('0x39')],_0x25c5ba[_0x03ab('0x3b')]));_0x475d56['where'][_0x03ab('0x5b')]=_0x4c7721['id'];if(_0x14907e[_0x03ab('0x39')][_0x03ab('0x5c')]){_0x475d56[_0x03ab('0x44')]=_['merge'](_0x475d56[_0x03ab('0x44')],{'$or':_[_0x03ab('0x38')](_0x475d56[_0x03ab('0x3d')],function(_0x34717a){var _0x4f9bc3={};_0x4f9bc3[_0x34717a]={'$like':'%'+_0x14907e['query'][_0x03ab('0x5c')]+'%'};return _0x4f9bc3;})});}_0x475d56=_[_0x03ab('0x47')]({},_0x475d56,_0x14907e[_0x03ab('0x48')]);return db[_0x03ab('0x5a')][_0x03ab('0x4b')](_0x475d56);}})['then'](function(_0x27f2bd){if(_0x27f2bd){return db[_0x03ab('0x5d')]['findAndCountAll']({'where':{'id':_['map'](_0x27f2bd,_0x03ab('0x5e')),'role':_0x03ab('0x5f')},'attributes':['id',_0x03ab('0x33'),_0x03ab('0x60'),_0x03ab('0x61'),_0x03ab('0x62')]});}})[_0x03ab('0x2d')](function(_0x14ed81){if(_0x14ed81){return{'count':_0x14ed81[_0x03ab('0x27')],'rows':_['map'](_0x14ed81['rows'],function(_0x415140){return{'membername':_0x415140[_0x03ab('0x33')],'UserId':_0x415140['id'],'queue_name':_0x1281a5[_0x03ab('0x33')],'SmsQueueId':_0x1281a5['id'],'interface':util[_0x03ab('0x63')]('%s/%s',_0x03ab('0x64'),_0x415140[_0x03ab('0x33')]),'penalty':0x0,'paused':_0x415140[_0x03ab('0x60')],'createdAt':_0x415140[_0x03ab('0x62')],'updatedAt':_0x415140['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4f0fd9,_0x475d56))[_0x03ab('0x4d')](handleError(_0x4f0fd9,null));};exports['getTeams']=function(_0x4eb25,_0x5085b2,_0x5e00f2){var _0x5af644={};var _0xbb5ee4={};var _0x2d2619;var _0x283cd1;return db[_0x03ab('0x35')]['findOne']({'where':{'id':_0x4eb25['params']['id']}})[_0x03ab('0x2d')](handleEntityNotFound(_0x5085b2,null))[_0x03ab('0x2d')](function(_0x200a40){if(_0x200a40){_0x2d2619=_0x200a40;_0xbb5ee4[_0x03ab('0x40')]=_[_0x03ab('0x3a')](db[_0x03ab('0x65')][_0x03ab('0x36')]);_0xbb5ee4[_0x03ab('0x39')]=_[_0x03ab('0x3a')](_0x4eb25['query']);_0xbb5ee4['filters']=_[_0x03ab('0x3c')](_0xbb5ee4[_0x03ab('0x40')],_0xbb5ee4[_0x03ab('0x39')]);_0x5af644[_0x03ab('0x3d')]=_[_0x03ab('0x3c')](_0xbb5ee4[_0x03ab('0x40')],qs[_0x03ab('0x3e')](_0x4eb25[_0x03ab('0x39')][_0x03ab('0x3e')]));_0x5af644[_0x03ab('0x3d')]=_0x5af644['attributes'][_0x03ab('0x3f')]?_0x5af644[_0x03ab('0x3d')]:_0xbb5ee4[_0x03ab('0x40')];_0x5af644[_0x03ab('0x66')]=qs['sort'](_0x4eb25[_0x03ab('0x39')][_0x03ab('0x43')]);_0x5af644[_0x03ab('0x44')]=qs[_0x03ab('0x3b')](_['pick'](_0x4eb25['query'],_0xbb5ee4['filters']));if(_0x4eb25['query']['filter']){_0x5af644[_0x03ab('0x44')]=_[_0x03ab('0x47')](_0x5af644[_0x03ab('0x44')],{'$or':_['map'](_0x5af644['attributes'],function(_0x1fd503){var _0x222fb4={};_0x222fb4[_0x1fd503]={'$like':'%'+_0x4eb25[_0x03ab('0x39')]['filter']+'%'};return _0x222fb4;})});}_0x5af644=_['merge']({},_0x5af644,_0x4eb25['options']);return _0x2d2619[_0x03ab('0x67')](_0x5af644);}})[_0x03ab('0x2d')](function(_0x2b628e){if(_0x2b628e){_0x283cd1=_0x2b628e['length'];if(!_0x4eb25['query'][_0x03ab('0x41')](_0x03ab('0x42'))){_0x5af644[_0x03ab('0x25')]=qs[_0x03ab('0x25')](_0x4eb25[_0x03ab('0x39')]['limit']);_0x5af644['offset']=qs[_0x03ab('0x24')](_0x4eb25[_0x03ab('0x39')]['offset']);}return _0x2d2619['getTeams'](_0x5af644);}})[_0x03ab('0x2d')](function(_0x538d4e){if(_0x538d4e){return _0x538d4e?{'count':_0x283cd1,'rows':_0x538d4e}:null;}})[_0x03ab('0x2d')](respondWithResult(_0x5085b2,null))['catch'](handleError(_0x5085b2,null));};exports[_0x03ab('0x68')]=function(_0x3664ed,_0xdd396d,_0x5d1907){var _0x30bdd9=_0x3664ed[_0x03ab('0x52')]['ids'];return db[_0x03ab('0x65')][_0x03ab('0x4b')]({'where':{'id':_0x30bdd9},'attributes':['id'],'include':[{'model':db[_0x03ab('0x5d')],'as':'Agents','attributes':['id',_0x03ab('0x33'),'online',_0x03ab('0x69'),_0x03ab('0x6a')],'raw':!![]}]})[_0x03ab('0x2d')](function(_0x2e4c7c){if(_0x2e4c7c){var _0x230325=_[_0x03ab('0x6b')](_0x2e4c7c,function(_0x4d3025){var _0x1a102c=_0x4d3025[_0x03ab('0x2e')]({'plain':!![]});return _0x1a102c[_0x03ab('0x6c')];});return db[_0x03ab('0x35')][_0x03ab('0x50')]({'where':{'id':_0x3664ed[_0x03ab('0x4f')]['id']}})['then'](function(_0x4c1fff){return db[_0x03ab('0x6d')]['transaction'](function(_0x3ccc66){return _0x4c1fff[_0x03ab('0x68')](_0x30bdd9,{'transaction':_0x3ccc66})[_0x03ab('0x2d')](function(){return BPromise[_0x03ab('0x6e')](_0x230325,function(_0x443b9c){return db[_0x03ab('0x5a')]['findOrCreate']({'where':{'UserId':_0x443b9c['id'],'SmsQueueId':_0x3664ed[_0x03ab('0x4f')]['id']},'transaction':_0x3ccc66});});})['then'](function(){_0x230325[_0x03ab('0x6f')](function(_0x5d0f82){socket['emit'](_0x03ab('0x70'),{'UserId':_0x5d0f82['id'],'SmsQueueId':_0x4c1fff['id']});});});});});}})[_0x03ab('0x2d')](respondWithStatusCode(_0xdd396d,null))['catch'](handleError(_0xdd396d,null));};exports['removeTeams']=function(_0x294327,_0x1cd2dc,_0x20462b){return db[_0x03ab('0x65')][_0x03ab('0x4b')]({'where':{'id':_0x294327['query'][_0x03ab('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x03ab('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x03ab('0x2d')](handleEntityNotFound(_0x1cd2dc,null))[_0x03ab('0x2d')](function(_0x234639){var _0x12b607=_[_0x03ab('0x38')](_0x234639,'id');var _0x27ec3e=[];var _0x356af3=[];var _0x36acaf=squel[_0x03ab('0x72')]();_0x36acaf[_0x03ab('0x73')](_0x03ab('0x74'))[_0x03ab('0x75')]('team_has_sms_queues','tq')['join']('user_has_teams','ut',_0x03ab('0x76'))[_0x03ab('0x44')](_0x03ab('0x77'),_0x294327[_0x03ab('0x4f')]['id']);for(var _0x4f6cdf=0x0;_0x4f6cdf<_0x234639['length'];_0x4f6cdf+=0x1){let _0x1bc66b=_0x234639[_0x4f6cdf];for(var _0x4a7eb7=0x0;_0x4a7eb7<_0x1bc66b[_0x03ab('0x6c')]['length'];_0x4a7eb7+=0x1){let _0x29bc91=_0x1bc66b[_0x03ab('0x6c')][_0x4a7eb7];var _0x87f604=_0x36acaf[_0x03ab('0x78')]();_0x87f604[_0x03ab('0x44')](_0x03ab('0x79'),_0x29bc91['id']);_0x356af3['push'](db[_0x03ab('0x6d')][_0x03ab('0x39')](_0x87f604[_0x03ab('0x7a')](),{'type':db[_0x03ab('0x6d')][_0x03ab('0x7b')][_0x03ab('0x7c')]})[_0x03ab('0x2d')](function(_0x114450){if(_0x114450['length']===0x1){return _0x29bc91['id'];}else{var _0x218ec7=_[_0x03ab('0x7d')](_[_0x03ab('0x38')](_0x114450,'TeamId'),function(_0x318ef7){return _[_0x03ab('0x7e')](_0x12b607,_0x318ef7);});if(_0x218ec7){return _0x29bc91['id'];}}}));}}return BPromise[_0x03ab('0x7f')](_0x356af3)['then'](function(_0x495b94){_0x27ec3e=_(_0x27ec3e)[_0x03ab('0x80')](_0x495b94)['compact']()[_0x03ab('0x81')]();return db[_0x03ab('0x35')][_0x03ab('0x50')]({'where':{'id':_0x294327['params']['id']}})[_0x03ab('0x2d')](function(_0x2c41d7){return db[_0x03ab('0x6d')]['transaction'](function(_0x68cd23){return _0x2c41d7[_0x03ab('0x82')](_0x294327[_0x03ab('0x39')][_0x03ab('0x71')],{'transaction':_0x68cd23})['then'](function(){if(!_[_0x03ab('0x83')](_0x27ec3e)){return _0x2c41d7[_0x03ab('0x84')](_0x27ec3e,{'transaction':_0x68cd23});}})[_0x03ab('0x2d')](function(){_0x27ec3e['forEach'](function(_0x522423){socket[_0x03ab('0x85')](_0x03ab('0x86'),{'UserId':_0x522423,'SmsQueueId':_0x2c41d7['id']});});});});});});})[_0x03ab('0x2d')](respondWithStatusCode(_0x1cd2dc,null))[_0x03ab('0x4d')](handleError(_0x1cd2dc,null));};exports[_0x03ab('0x87')]=function(_0xb8c82c,_0x5e8674,_0x3b55d5){return db[_0x03ab('0x35')][_0x03ab('0x50')]({'where':{'id':_0xb8c82c['params']['id']}})['then'](handleEntityNotFound(_0x5e8674,null))[_0x03ab('0x2d')](function(_0x56476a){if(_0x56476a){return _0x56476a[_0x03ab('0x87')](_0xb8c82c['body'][_0x03ab('0x71')],_['omit'](_0xb8c82c[_0x03ab('0x52')],[_0x03ab('0x71'),'id'])||{})['spread'](function(_0x4276f5){for(var _0x1bbfae=0x0;_0x1bbfae<_0xb8c82c['body']['ids']['length'];_0x1bbfae+=0x1){socket[_0x03ab('0x85')](_0x03ab('0x70'),{'UserId':Number(_0xb8c82c['body'][_0x03ab('0x71')][_0x1bbfae]),'SmsQueueId':Number(_0xb8c82c[_0x03ab('0x4f')]['id'])});}return _0x4276f5;});}})['then'](respondWithResult(_0x5e8674,null))[_0x03ab('0x4d')](handleError(_0x5e8674,null));};exports[_0x03ab('0x84')]=function(_0x539212,_0x4eb85f,_0xbfc024){return db[_0x03ab('0x35')][_0x03ab('0x50')]({'where':{'id':_0x539212[_0x03ab('0x4f')]['id']}})[_0x03ab('0x2d')](handleEntityNotFound(_0x4eb85f,null))['then'](function(_0x56c943){if(_0x56c943){return _0x56c943[_0x03ab('0x84')](_0x539212[_0x03ab('0x39')][_0x03ab('0x71')])[_0x03ab('0x2d')](function(){if(_[_0x03ab('0x88')](_0x539212[_0x03ab('0x39')][_0x03ab('0x71')])){for(var _0x592ca3=0x0;_0x592ca3<_0x539212[_0x03ab('0x39')][_0x03ab('0x71')][_0x03ab('0x3f')];_0x592ca3+=0x1){socket[_0x03ab('0x85')](_0x03ab('0x86'),{'UserId':Number(_0x539212[_0x03ab('0x39')]['ids'][_0x592ca3]),'SmsQueueId':Number(_0x539212[_0x03ab('0x4f')]['id'])});}}else{socket['emit'](_0x03ab('0x86'),{'UserId':Number(_0x539212[_0x03ab('0x39')][_0x03ab('0x71')]),'SmsQueueId':Number(_0x539212[_0x03ab('0x4f')]['id'])});}});}})[_0x03ab('0x2d')](respondWithStatusCode(_0x4eb85f,null))[_0x03ab('0x4d')](handleError(_0x4eb85f,null));};exports[_0x03ab('0x89')]=function(_0x175e32,_0x53487b,_0x1736b8){var _0x1d14c0={};var _0x112759={};var _0x3ddb73;var _0x1a9cf8;return db[_0x03ab('0x35')][_0x03ab('0x8a')]({'where':{'id':_0x175e32[_0x03ab('0x4f')]['id']}})['then'](handleEntityNotFound(_0x53487b,null))['then'](function(_0x293e9d){if(_0x293e9d){_0x3ddb73=_0x293e9d;_0x112759['model']=_['keys'](db[_0x03ab('0x5d')]['rawAttributes']);_0x112759[_0x03ab('0x39')]=_[_0x03ab('0x3a')](_0x175e32[_0x03ab('0x39')]);_0x112759[_0x03ab('0x3b')]=_['intersection'](_0x112759[_0x03ab('0x40')],_0x112759[_0x03ab('0x39')]);_0x1d14c0['attributes']=_[_0x03ab('0x3c')](_0x112759[_0x03ab('0x40')],qs[_0x03ab('0x3e')](_0x175e32[_0x03ab('0x39')][_0x03ab('0x3e')]));_0x1d14c0[_0x03ab('0x3d')]=_0x1d14c0['attributes'][_0x03ab('0x3f')]?_0x1d14c0[_0x03ab('0x3d')]:_0x112759[_0x03ab('0x40')];_0x1d14c0[_0x03ab('0x66')]=qs[_0x03ab('0x43')](_0x175e32[_0x03ab('0x39')][_0x03ab('0x43')]);_0x1d14c0[_0x03ab('0x44')]=qs[_0x03ab('0x3b')](_[_0x03ab('0x45')](_0x175e32['query'],_0x112759[_0x03ab('0x3b')]));if(_0x175e32[_0x03ab('0x39')][_0x03ab('0x5c')]){_0x1d14c0['where']=_[_0x03ab('0x47')](_0x1d14c0['where'],{'$or':_['map'](_0x1d14c0[_0x03ab('0x3d')],function(_0x230156){var _0x658b2={};_0x658b2[_0x230156]={'$like':'%'+_0x175e32[_0x03ab('0x39')]['filter']+'%'};return _0x658b2;})});}_0x1d14c0=_[_0x03ab('0x47')]({},_0x1d14c0,_0x175e32[_0x03ab('0x48')]);return _0x3ddb73[_0x03ab('0x89')](_0x1d14c0);}})['then'](function(_0x1568a){if(_0x1568a){_0x1a9cf8=_0x1568a[_0x03ab('0x3f')];if(!_0x175e32[_0x03ab('0x39')][_0x03ab('0x41')](_0x03ab('0x42'))){_0x1d14c0[_0x03ab('0x25')]=qs[_0x03ab('0x25')](_0x175e32[_0x03ab('0x39')][_0x03ab('0x25')]);_0x1d14c0[_0x03ab('0x24')]=qs[_0x03ab('0x24')](_0x175e32[_0x03ab('0x39')][_0x03ab('0x24')]);}return _0x3ddb73['getAgents'](_0x1d14c0);}})[_0x03ab('0x2d')](function(_0x124fa6){if(_0x124fa6){return _0x124fa6?{'count':_0x1a9cf8,'rows':_0x124fa6}:null;}})[_0x03ab('0x2d')](respondWithResult(_0x53487b,null))[_0x03ab('0x4d')](handleError(_0x53487b,null));}; \ No newline at end of file +var _0xbf13=['index','map','fieldName','type','filters','intersection','query','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SmsQueue','includeAll','include','rows','catch','show','params','keys','rawAttributes','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','error','body','describe','findOne','UserSmsQueue','findAll','User','agent','smsPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','ids','Team','online','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','each','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','includes','all','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SmsQueues','UserProfileResource','stack','name','send'];(function(_0x9130e8,_0x4125cd){var _0x40307b=function(_0x2aba70){while(--_0x2aba70){_0x9130e8['push'](_0x9130e8['shift']());}};_0x40307b(++_0x4125cd);}(_0xbf13,0xe2));var _0x3bf1=function(_0x22604b,_0x3ecc77){_0x22604b=_0x22604b-0x0;var _0x23ac9c=_0xbf13[_0x22604b];return _0x23ac9c;};'use strict';var emlformat=require(_0x3bf1('0x0'));var rimraf=require(_0x3bf1('0x1'));var zipdir=require(_0x3bf1('0x2'));var jsonpatch=require(_0x3bf1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3bf1('0x4'));var Mustache=require(_0x3bf1('0x5'));var util=require('util');var path=require(_0x3bf1('0x6'));var sox=require(_0x3bf1('0x7'));var csv=require(_0x3bf1('0x8'));var ejs=require(_0x3bf1('0x9'));var fs=require('fs');var fs_extra=require(_0x3bf1('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3bf1('0xb'));var jsforce=require(_0x3bf1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3bf1('0x8'));var querystring=require(_0x3bf1('0xd'));var Papa=require(_0x3bf1('0xe'));var Redis=require(_0x3bf1('0xf'));var authService=require(_0x3bf1('0x10'));var qs=require(_0x3bf1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bf1('0x12'))(_0x3bf1('0x13'));var utils=require('../../config/utils');var config=require(_0x3bf1('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x3bf1('0x15'))['db'];config[_0x3bf1('0x16')]=_[_0x3bf1('0x17')](config[_0x3bf1('0x16')],{'host':_0x3bf1('0x18'),'port':0x18eb});var socket=require(_0x3bf1('0x19'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x3bf1('0x1a')](socket);function respondWithStatusCode(_0x429dfe,_0x3e8405){_0x3e8405=_0x3e8405||0xcc;return function(_0x124e01){if(_0x124e01){return _0x429dfe[_0x3bf1('0x1b')](_0x3e8405);}return _0x429dfe[_0x3bf1('0x1c')](_0x3e8405)[_0x3bf1('0x1d')]();};}function respondWithResult(_0x863c2e,_0x43e714){_0x43e714=_0x43e714||0xc8;return function(_0x3f9fb5){if(_0x3f9fb5){return _0x863c2e[_0x3bf1('0x1c')](_0x43e714)[_0x3bf1('0x1e')](_0x3f9fb5);}};}function respondWithFilteredResult(_0xead943,_0x6b39c9){return function(_0x5cf15b){if(_0x5cf15b){var _0x50df9e=typeof _0x6b39c9[_0x3bf1('0x1f')]===_0x3bf1('0x20')&&typeof _0x6b39c9[_0x3bf1('0x21')]==='undefined';var _0x5a6b90=_0x5cf15b[_0x3bf1('0x22')];var _0x28ea91=_0x50df9e?0x0:_0x6b39c9[_0x3bf1('0x1f')];var _0x13f371=_0x50df9e?_0x5cf15b[_0x3bf1('0x22')]:_0x6b39c9[_0x3bf1('0x1f')]+_0x6b39c9[_0x3bf1('0x21')];var _0x208b6b;if(_0x13f371>=_0x5a6b90){_0x13f371=_0x5a6b90;_0x208b6b=0xc8;}else{_0x208b6b=0xce;}_0xead943[_0x3bf1('0x1c')](_0x208b6b);return _0xead943[_0x3bf1('0x23')](_0x3bf1('0x24'),_0x28ea91+'-'+_0x13f371+'/'+_0x5a6b90)['json'](_0x5cf15b);}return null;};}function patchUpdates(_0x4e7dc0){return function(_0x2f6bb3){try{jsonpatch['apply'](_0x2f6bb3,_0x4e7dc0,!![]);}catch(_0x331cee){return BPromise['reject'](_0x331cee);}return _0x2f6bb3['save']();};}function saveUpdates(_0x19de36,_0x1f97f7){return function(_0x34e572){if(_0x34e572){return _0x34e572[_0x3bf1('0x25')](_0x19de36)[_0x3bf1('0x26')](function(_0x49bcb5){return _0x49bcb5;});}return null;};}function removeEntity(_0x110351,_0x5b4f13){return function(_0x2b9097){if(_0x2b9097){return _0x2b9097[_0x3bf1('0x27')]()['then'](function(){var _0x4dc3ce=_0x2b9097[_0x3bf1('0x28')]({'plain':!![]});var _0x2e4905=_0x3bf1('0x29');return db[_0x3bf1('0x2a')]['destroy']({'where':{'type':_0x2e4905,'resourceId':_0x4dc3ce['id']}})[_0x3bf1('0x26')](function(){return _0x2b9097;});})[_0x3bf1('0x26')](function(){_0x110351['status'](0xcc)[_0x3bf1('0x1d')]();});}};}function handleEntityNotFound(_0x464416,_0x3bad13){return function(_0xb7df09){if(!_0xb7df09){_0x464416[_0x3bf1('0x1b')](0x194);}return _0xb7df09;};}function handleError(_0x2510f0,_0x5bc704){_0x5bc704=_0x5bc704||0x1f4;return function(_0xb07d5){logger['error'](_0xb07d5[_0x3bf1('0x2b')]);if(_0xb07d5[_0x3bf1('0x2c')]){delete _0xb07d5['name'];}_0x2510f0['status'](_0x5bc704)[_0x3bf1('0x2d')](_0xb07d5);};}exports[_0x3bf1('0x2e')]=function(_0x1183f4,_0x5256c5){var _0x13e122={},_0x3154b7={},_0x32dbe9={'count':0x0,'rows':[]};var _0x40739a=_[_0x3bf1('0x2f')](db['SmsQueue']['rawAttributes'],function(_0x4c5849){return{'name':_0x4c5849[_0x3bf1('0x30')],'type':_0x4c5849[_0x3bf1('0x31')]['key']};});_0x3154b7['model']=_[_0x3bf1('0x2f')](_0x40739a,_0x3bf1('0x2c'));_0x3154b7['query']=_['keys'](_0x1183f4['query']);_0x3154b7[_0x3bf1('0x32')]=_[_0x3bf1('0x33')](_0x3154b7['model'],_0x3154b7[_0x3bf1('0x34')]);_0x13e122[_0x3bf1('0x35')]=_[_0x3bf1('0x33')](_0x3154b7[_0x3bf1('0x36')],qs[_0x3bf1('0x37')](_0x1183f4[_0x3bf1('0x34')][_0x3bf1('0x37')]));_0x13e122[_0x3bf1('0x35')]=_0x13e122[_0x3bf1('0x35')]['length']?_0x13e122[_0x3bf1('0x35')]:_0x3154b7['model'];if(!_0x1183f4[_0x3bf1('0x34')][_0x3bf1('0x38')](_0x3bf1('0x39'))){_0x13e122[_0x3bf1('0x21')]=qs[_0x3bf1('0x21')](_0x1183f4[_0x3bf1('0x34')]['limit']);_0x13e122[_0x3bf1('0x1f')]=qs['offset'](_0x1183f4[_0x3bf1('0x34')][_0x3bf1('0x1f')]);}_0x13e122[_0x3bf1('0x3a')]=qs[_0x3bf1('0x3b')](_0x1183f4[_0x3bf1('0x34')][_0x3bf1('0x3b')]);_0x13e122[_0x3bf1('0x3c')]=qs['filters'](_[_0x3bf1('0x3d')](_0x1183f4[_0x3bf1('0x34')],_0x3154b7[_0x3bf1('0x32')]),_0x40739a);if(_0x1183f4[_0x3bf1('0x34')][_0x3bf1('0x3e')]){_0x13e122['where']=_['merge'](_0x13e122['where'],{'$or':_[_0x3bf1('0x2f')](_0x40739a,function(_0x5010f9){if(_0x5010f9[_0x3bf1('0x31')]!==_0x3bf1('0x3f')){var _0x3f68ce={};_0x3f68ce[_0x5010f9[_0x3bf1('0x2c')]]={'$like':'%'+_0x1183f4[_0x3bf1('0x34')][_0x3bf1('0x3e')]+'%'};return _0x3f68ce;}})});}_0x13e122=_[_0x3bf1('0x40')]({},_0x13e122,_0x1183f4[_0x3bf1('0x41')]);var _0x43e703={'where':_0x13e122['where']};return db[_0x3bf1('0x42')][_0x3bf1('0x22')](_0x43e703)['then'](function(_0x2f875c){_0x32dbe9['count']=_0x2f875c;if(_0x1183f4[_0x3bf1('0x34')][_0x3bf1('0x43')]){_0x13e122[_0x3bf1('0x44')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x13e122);})[_0x3bf1('0x26')](function(_0x3b7e78){_0x32dbe9[_0x3bf1('0x45')]=_0x3b7e78;return _0x32dbe9;})[_0x3bf1('0x26')](respondWithFilteredResult(_0x5256c5,_0x13e122))[_0x3bf1('0x46')](handleError(_0x5256c5,null));};exports[_0x3bf1('0x47')]=function(_0x526e14,_0x31be0c){var _0x30a491={'raw':!![],'where':{'id':_0x526e14[_0x3bf1('0x48')]['id']}},_0x5bc6af={};_0x5bc6af[_0x3bf1('0x36')]=_[_0x3bf1('0x49')](db[_0x3bf1('0x42')][_0x3bf1('0x4a')]);_0x5bc6af['query']=_[_0x3bf1('0x49')](_0x526e14['query']);_0x5bc6af[_0x3bf1('0x32')]=_['intersection'](_0x5bc6af[_0x3bf1('0x36')],_0x5bc6af[_0x3bf1('0x34')]);_0x30a491[_0x3bf1('0x35')]=_[_0x3bf1('0x33')](_0x5bc6af[_0x3bf1('0x36')],qs[_0x3bf1('0x37')](_0x526e14[_0x3bf1('0x34')][_0x3bf1('0x37')]));_0x30a491[_0x3bf1('0x35')]=_0x30a491[_0x3bf1('0x35')][_0x3bf1('0x4b')]?_0x30a491[_0x3bf1('0x35')]:_0x5bc6af['model'];if(_0x526e14[_0x3bf1('0x34')][_0x3bf1('0x43')]){_0x30a491[_0x3bf1('0x44')]=[{'all':!![]}];}_0x30a491=_[_0x3bf1('0x40')]({},_0x30a491,_0x526e14['options']);return db[_0x3bf1('0x42')][_0x3bf1('0x4c')](_0x30a491)[_0x3bf1('0x26')](handleEntityNotFound(_0x31be0c,null))[_0x3bf1('0x26')](respondWithResult(_0x31be0c,null))[_0x3bf1('0x46')](handleError(_0x31be0c,null));};exports[_0x3bf1('0x4d')]=function(_0xb8f94c,_0xef2c0e){return db[_0x3bf1('0x42')][_0x3bf1('0x4d')](_0xb8f94c['body'],{})[_0x3bf1('0x26')](function(_0x3b130e){var _0x1ce293=_0xb8f94c['user'][_0x3bf1('0x28')]({'plain':!![]});if(!_0x1ce293)throw new Error(_0x3bf1('0x4e'));if(_0x1ce293[_0x3bf1('0x4f')]===_0x3bf1('0x50')){var _0x177030=_0x3b130e['get']({'plain':!![]});var _0x55a551=_0x3bf1('0x29');return db[_0x3bf1('0x51')][_0x3bf1('0x4c')]({'where':{'name':_0x55a551,'userProfileId':_0x1ce293['userProfileId']},'raw':!![]})[_0x3bf1('0x26')](function(_0x4c7240){if(_0x4c7240&&_0x4c7240[_0x3bf1('0x52')]===0x0){return db[_0x3bf1('0x2a')][_0x3bf1('0x4d')]({'name':_0x177030[_0x3bf1('0x2c')],'resourceId':_0x177030['id'],'type':_0x4c7240['name'],'sectionId':_0x4c7240['id']},{})[_0x3bf1('0x26')](function(){return _0x3b130e;});}else{return _0x3b130e;}})[_0x3bf1('0x46')](function(_0x37470d){logger[_0x3bf1('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37470d);throw _0x37470d;});}return _0x3b130e;})['then'](respondWithResult(_0xef2c0e,0xc9))[_0x3bf1('0x46')](handleError(_0xef2c0e,null));};exports['update']=function(_0x3311bb,_0x34771e){if(_0x3311bb['body']['id']){delete _0x3311bb[_0x3bf1('0x54')]['id'];}return db[_0x3bf1('0x42')][_0x3bf1('0x4c')]({'where':{'id':_0x3311bb[_0x3bf1('0x48')]['id']}})[_0x3bf1('0x26')](handleEntityNotFound(_0x34771e,null))[_0x3bf1('0x26')](saveUpdates(_0x3311bb[_0x3bf1('0x54')],null))['then'](respondWithResult(_0x34771e,null))[_0x3bf1('0x46')](handleError(_0x34771e,null));};exports['destroy']=function(_0x35bd10,_0x20aaa1){return db['SmsQueue'][_0x3bf1('0x4c')]({'where':{'id':_0x35bd10[_0x3bf1('0x48')]['id']}})[_0x3bf1('0x26')](handleEntityNotFound(_0x20aaa1,null))[_0x3bf1('0x26')](removeEntity(_0x20aaa1,null))[_0x3bf1('0x46')](handleError(_0x20aaa1,null));};exports[_0x3bf1('0x55')]=function(_0x3400cc,_0x53eed7){return db[_0x3bf1('0x42')][_0x3bf1('0x55')]()['then'](respondWithResult(_0x53eed7,null))['catch'](handleError(_0x53eed7,null));};exports['getMembers']=function(_0x1ebd3a,_0x24dda1,_0x16d36f){var _0x2cd212={'raw':!![],'where':{}},_0x536f42={},_0xb7f2aa;return db['SmsQueue'][_0x3bf1('0x56')]({'where':{'id':_0x1ebd3a[_0x3bf1('0x48')]['id']}})[_0x3bf1('0x26')](handleEntityNotFound(_0x24dda1,null))[_0x3bf1('0x26')](function(_0x5649aa){if(_0x5649aa){_0xb7f2aa=_0x5649aa[_0x3bf1('0x28')]({'plain':!![]});_0x536f42[_0x3bf1('0x36')]=_['keys'](db[_0x3bf1('0x57')][_0x3bf1('0x4a')]);_0x536f42[_0x3bf1('0x34')]=_['keys'](_0x1ebd3a['query']);_0x536f42['filters']=_[_0x3bf1('0x33')](_0x536f42[_0x3bf1('0x36')],_0x536f42[_0x3bf1('0x34')]);_0x2cd212[_0x3bf1('0x35')]=_[_0x3bf1('0x33')](_0x536f42[_0x3bf1('0x36')],qs[_0x3bf1('0x37')](_0x1ebd3a[_0x3bf1('0x34')][_0x3bf1('0x37')]));_0x2cd212[_0x3bf1('0x35')]=_0x2cd212[_0x3bf1('0x35')][_0x3bf1('0x4b')]?_0x2cd212[_0x3bf1('0x35')]:_0x536f42[_0x3bf1('0x36')];if(!_0x1ebd3a['query'][_0x3bf1('0x38')](_0x3bf1('0x39'))){_0x2cd212[_0x3bf1('0x21')]=qs['limit'](_0x1ebd3a[_0x3bf1('0x34')][_0x3bf1('0x21')]);_0x2cd212[_0x3bf1('0x1f')]=qs['offset'](_0x1ebd3a[_0x3bf1('0x34')]['offset']);}_0x2cd212[_0x3bf1('0x3a')]=qs['sort'](_0x1ebd3a[_0x3bf1('0x34')]['sort']);_0x2cd212[_0x3bf1('0x3c')]=qs['filters'](_[_0x3bf1('0x3d')](_0x1ebd3a[_0x3bf1('0x34')],_0x536f42[_0x3bf1('0x32')]));_0x2cd212['where']['SmsQueueId']=_0x5649aa['id'];if(_0x1ebd3a[_0x3bf1('0x34')][_0x3bf1('0x3e')]){_0x2cd212['where']=_[_0x3bf1('0x40')](_0x2cd212[_0x3bf1('0x3c')],{'$or':_['map'](_0x2cd212['attributes'],function(_0x1bcb6c){var _0xd4ca05={};_0xd4ca05[_0x1bcb6c]={'$like':'%'+_0x1ebd3a['query'][_0x3bf1('0x3e')]+'%'};return _0xd4ca05;})});}_0x2cd212=_[_0x3bf1('0x40')]({},_0x2cd212,_0x1ebd3a[_0x3bf1('0x41')]);return db[_0x3bf1('0x57')][_0x3bf1('0x58')](_0x2cd212);}})[_0x3bf1('0x26')](function(_0x5d19bb){if(_0x5d19bb){return db[_0x3bf1('0x59')]['findAndCountAll']({'where':{'id':_[_0x3bf1('0x2f')](_0x5d19bb,'UserId'),'role':_0x3bf1('0x5a')},'attributes':['id',_0x3bf1('0x2c'),_0x3bf1('0x5b'),'updatedAt',_0x3bf1('0x5c')]});}})['then'](function(_0x24d483){if(_0x24d483){return{'count':_0x24d483[_0x3bf1('0x22')],'rows':_[_0x3bf1('0x2f')](_0x24d483[_0x3bf1('0x45')],function(_0x5ae3ff){return{'membername':_0x5ae3ff[_0x3bf1('0x2c')],'UserId':_0x5ae3ff['id'],'queue_name':_0xb7f2aa[_0x3bf1('0x2c')],'SmsQueueId':_0xb7f2aa['id'],'interface':util[_0x3bf1('0x5d')](_0x3bf1('0x5e'),_0x3bf1('0x5f'),_0x5ae3ff['name']),'penalty':0x0,'paused':_0x5ae3ff[_0x3bf1('0x5b')],'createdAt':_0x5ae3ff[_0x3bf1('0x5c')],'updatedAt':_0x5ae3ff[_0x3bf1('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3bf1('0x26')](respondWithFilteredResult(_0x24dda1,_0x2cd212))['catch'](handleError(_0x24dda1,null));};exports['getTeams']=function(_0x47d028,_0x3eeb5c,_0xb1e610){var _0x5f06c3={};var _0x453c34={};var _0x467e70;var _0x5336ff;return db['SmsQueue'][_0x3bf1('0x56')]({'where':{'id':_0x47d028[_0x3bf1('0x48')]['id']}})[_0x3bf1('0x26')](handleEntityNotFound(_0x3eeb5c,null))[_0x3bf1('0x26')](function(_0x48ddf1){if(_0x48ddf1){_0x467e70=_0x48ddf1;_0x453c34[_0x3bf1('0x36')]=_[_0x3bf1('0x49')](db['Team'][_0x3bf1('0x4a')]);_0x453c34[_0x3bf1('0x34')]=_[_0x3bf1('0x49')](_0x47d028['query']);_0x453c34[_0x3bf1('0x32')]=_[_0x3bf1('0x33')](_0x453c34[_0x3bf1('0x36')],_0x453c34[_0x3bf1('0x34')]);_0x5f06c3['attributes']=_[_0x3bf1('0x33')](_0x453c34[_0x3bf1('0x36')],qs[_0x3bf1('0x37')](_0x47d028[_0x3bf1('0x34')][_0x3bf1('0x37')]));_0x5f06c3['attributes']=_0x5f06c3[_0x3bf1('0x35')][_0x3bf1('0x4b')]?_0x5f06c3['attributes']:_0x453c34['model'];_0x5f06c3['order']=qs[_0x3bf1('0x3b')](_0x47d028[_0x3bf1('0x34')][_0x3bf1('0x3b')]);_0x5f06c3['where']=qs[_0x3bf1('0x32')](_[_0x3bf1('0x3d')](_0x47d028[_0x3bf1('0x34')],_0x453c34[_0x3bf1('0x32')]));if(_0x47d028[_0x3bf1('0x34')]['filter']){_0x5f06c3[_0x3bf1('0x3c')]=_['merge'](_0x5f06c3[_0x3bf1('0x3c')],{'$or':_[_0x3bf1('0x2f')](_0x5f06c3['attributes'],function(_0x5ec55d){var _0x194375={};_0x194375[_0x5ec55d]={'$like':'%'+_0x47d028['query'][_0x3bf1('0x3e')]+'%'};return _0x194375;})});}_0x5f06c3=_[_0x3bf1('0x40')]({},_0x5f06c3,_0x47d028[_0x3bf1('0x41')]);return _0x467e70[_0x3bf1('0x61')](_0x5f06c3);}})['then'](function(_0x13293e){if(_0x13293e){_0x5336ff=_0x13293e[_0x3bf1('0x4b')];if(!_0x47d028['query'][_0x3bf1('0x38')](_0x3bf1('0x39'))){_0x5f06c3[_0x3bf1('0x21')]=qs['limit'](_0x47d028[_0x3bf1('0x34')][_0x3bf1('0x21')]);_0x5f06c3['offset']=qs[_0x3bf1('0x1f')](_0x47d028[_0x3bf1('0x34')]['offset']);}return _0x467e70[_0x3bf1('0x61')](_0x5f06c3);}})[_0x3bf1('0x26')](function(_0x3045de){if(_0x3045de){return _0x3045de?{'count':_0x5336ff,'rows':_0x3045de}:null;}})[_0x3bf1('0x26')](respondWithResult(_0x3eeb5c,null))[_0x3bf1('0x46')](handleError(_0x3eeb5c,null));};exports['addTeams']=function(_0x58636b,_0x29abde,_0x15fe37){var _0x10fcf3=_0x58636b[_0x3bf1('0x54')][_0x3bf1('0x62')];return db[_0x3bf1('0x63')]['findAll']({'where':{'id':_0x10fcf3},'attributes':['id'],'include':[{'model':db[_0x3bf1('0x59')],'as':'Agents','attributes':['id','name',_0x3bf1('0x64'),_0x3bf1('0x65'),_0x3bf1('0x66')],'raw':!![]}]})[_0x3bf1('0x26')](function(_0x1794e6){if(_0x1794e6){var _0x20bc11=_[_0x3bf1('0x67')](_0x1794e6,function(_0x351ce4){var _0x324b39=_0x351ce4[_0x3bf1('0x28')]({'plain':!![]});return _0x324b39[_0x3bf1('0x68')];});return db['SmsQueue'][_0x3bf1('0x4c')]({'where':{'id':_0x58636b[_0x3bf1('0x48')]['id']}})[_0x3bf1('0x26')](function(_0x5e4df9){return db[_0x3bf1('0x69')][_0x3bf1('0x6a')](function(_0x58e129){return _0x5e4df9[_0x3bf1('0x6b')](_0x10fcf3,{'transaction':_0x58e129})['then'](function(){return BPromise[_0x3bf1('0x6c')](_0x20bc11,function(_0x3611d3){return db[_0x3bf1('0x57')][_0x3bf1('0x6d')]({'where':{'UserId':_0x3611d3['id'],'SmsQueueId':_0x58636b['params']['id']},'transaction':_0x58e129});});})[_0x3bf1('0x26')](function(){_0x20bc11['forEach'](function(_0x17c164){socket[_0x3bf1('0x6e')](_0x3bf1('0x6f'),{'UserId':_0x17c164['id'],'SmsQueueId':_0x5e4df9['id']});});});});});}})['then'](respondWithStatusCode(_0x29abde,null))['catch'](handleError(_0x29abde,null));};exports[_0x3bf1('0x70')]=function(_0x8f5271,_0x30a1ec,_0x4700ec){return db[_0x3bf1('0x63')][_0x3bf1('0x58')]({'where':{'id':_0x8f5271['query'][_0x3bf1('0x62')]},'attributes':['id'],'include':[{'model':db[_0x3bf1('0x59')],'as':_0x3bf1('0x68'),'attributes':['id'],'raw':!![]}]})[_0x3bf1('0x26')](handleEntityNotFound(_0x30a1ec,null))[_0x3bf1('0x26')](function(_0x45e349){var _0x147427=_[_0x3bf1('0x2f')](_0x45e349,'id');var _0x15f301=[];var _0x1eab56=[];var _0x4c52b8=squel[_0x3bf1('0x71')]();_0x4c52b8[_0x3bf1('0x72')](_0x3bf1('0x73'))['from'](_0x3bf1('0x74'),'tq')[_0x3bf1('0x75')](_0x3bf1('0x76'),'ut',_0x3bf1('0x77'))[_0x3bf1('0x3c')](_0x3bf1('0x78'),_0x8f5271['params']['id']);for(var _0x3f3b75=0x0;_0x3f3b75<_0x45e349['length'];_0x3f3b75+=0x1){let _0x3c9edd=_0x45e349[_0x3f3b75];for(var _0x1a36a8=0x0;_0x1a36a8<_0x3c9edd[_0x3bf1('0x68')]['length'];_0x1a36a8+=0x1){let _0x3cf44c=_0x3c9edd['Agents'][_0x1a36a8];var _0x2f82b2=_0x4c52b8[_0x3bf1('0x79')]();_0x2f82b2[_0x3bf1('0x3c')]('ut.UserId\x20=\x20?',_0x3cf44c['id']);_0x1eab56[_0x3bf1('0x7a')](db[_0x3bf1('0x69')][_0x3bf1('0x34')](_0x2f82b2[_0x3bf1('0x7b')](),{'type':db[_0x3bf1('0x69')][_0x3bf1('0x7c')]['SELECT']})['then'](function(_0x38c940){if(_0x38c940[_0x3bf1('0x4b')]===0x1){return _0x3cf44c['id'];}else{var _0x33d0cb=_[_0x3bf1('0x7d')](_[_0x3bf1('0x2f')](_0x38c940,'TeamId'),function(_0x1fce3){return _[_0x3bf1('0x7e')](_0x147427,_0x1fce3);});if(_0x33d0cb){return _0x3cf44c['id'];}}}));}}return BPromise[_0x3bf1('0x7f')](_0x1eab56)[_0x3bf1('0x26')](function(_0x10e370){_0x15f301=_(_0x15f301)['union'](_0x10e370)['compact']()[_0x3bf1('0x80')]();return db[_0x3bf1('0x42')]['find']({'where':{'id':_0x8f5271[_0x3bf1('0x48')]['id']}})['then'](function(_0x19e6b0){return db[_0x3bf1('0x69')][_0x3bf1('0x6a')](function(_0x4666b6){return _0x19e6b0[_0x3bf1('0x70')](_0x8f5271[_0x3bf1('0x34')][_0x3bf1('0x62')],{'transaction':_0x4666b6})[_0x3bf1('0x26')](function(){if(!_[_0x3bf1('0x81')](_0x15f301)){return _0x19e6b0[_0x3bf1('0x82')](_0x15f301,{'transaction':_0x4666b6});}})[_0x3bf1('0x26')](function(){_0x15f301['forEach'](function(_0x28a64f){socket[_0x3bf1('0x6e')](_0x3bf1('0x83'),{'UserId':_0x28a64f,'SmsQueueId':_0x19e6b0['id']});});});});});});})[_0x3bf1('0x26')](respondWithStatusCode(_0x30a1ec,null))[_0x3bf1('0x46')](handleError(_0x30a1ec,null));};exports[_0x3bf1('0x84')]=function(_0x31d2cf,_0x47e616,_0x18ca70){return db['SmsQueue'][_0x3bf1('0x4c')]({'where':{'id':_0x31d2cf[_0x3bf1('0x48')]['id']}})[_0x3bf1('0x26')](handleEntityNotFound(_0x47e616,null))[_0x3bf1('0x26')](function(_0x327eeb){if(_0x327eeb){return _0x327eeb[_0x3bf1('0x84')](_0x31d2cf[_0x3bf1('0x54')][_0x3bf1('0x62')],_[_0x3bf1('0x85')](_0x31d2cf[_0x3bf1('0x54')],[_0x3bf1('0x62'),'id'])||{})[_0x3bf1('0x86')](function(_0x5c8aad){for(var _0x1badf9=0x0;_0x1badf9<_0x31d2cf[_0x3bf1('0x54')]['ids'][_0x3bf1('0x4b')];_0x1badf9+=0x1){socket[_0x3bf1('0x6e')](_0x3bf1('0x6f'),{'UserId':Number(_0x31d2cf[_0x3bf1('0x54')]['ids'][_0x1badf9]),'SmsQueueId':Number(_0x31d2cf[_0x3bf1('0x48')]['id'])});}return _0x5c8aad;});}})['then'](respondWithResult(_0x47e616,null))['catch'](handleError(_0x47e616,null));};exports[_0x3bf1('0x82')]=function(_0x531cc1,_0x3f0b1c,_0x4ec86c){return db[_0x3bf1('0x42')]['find']({'where':{'id':_0x531cc1[_0x3bf1('0x48')]['id']}})[_0x3bf1('0x26')](handleEntityNotFound(_0x3f0b1c,null))[_0x3bf1('0x26')](function(_0x58c318){if(_0x58c318){return _0x58c318['removeAgents'](_0x531cc1[_0x3bf1('0x34')][_0x3bf1('0x62')])[_0x3bf1('0x26')](function(){if(_['isArray'](_0x531cc1[_0x3bf1('0x34')][_0x3bf1('0x62')])){for(var _0x1f00b7=0x0;_0x1f00b7<_0x531cc1['query'][_0x3bf1('0x62')][_0x3bf1('0x4b')];_0x1f00b7+=0x1){socket[_0x3bf1('0x6e')]('userSmsQueue:remove',{'UserId':Number(_0x531cc1[_0x3bf1('0x34')][_0x3bf1('0x62')][_0x1f00b7]),'SmsQueueId':Number(_0x531cc1['params']['id'])});}}else{socket[_0x3bf1('0x6e')](_0x3bf1('0x83'),{'UserId':Number(_0x531cc1['query'][_0x3bf1('0x62')]),'SmsQueueId':Number(_0x531cc1[_0x3bf1('0x48')]['id'])});}});}})[_0x3bf1('0x26')](respondWithStatusCode(_0x3f0b1c,null))[_0x3bf1('0x46')](handleError(_0x3f0b1c,null));};exports[_0x3bf1('0x87')]=function(_0x5e865a,_0xe2a6b0,_0x5afa84){var _0x22433a={};var _0x484161={};var _0x1d6294;var _0x122a94;return db['SmsQueue'][_0x3bf1('0x56')]({'where':{'id':_0x5e865a['params']['id']}})[_0x3bf1('0x26')](handleEntityNotFound(_0xe2a6b0,null))[_0x3bf1('0x26')](function(_0x1061d9){if(_0x1061d9){_0x1d6294=_0x1061d9;_0x484161[_0x3bf1('0x36')]=_['keys'](db[_0x3bf1('0x59')][_0x3bf1('0x4a')]);_0x484161['query']=_['keys'](_0x5e865a['query']);_0x484161[_0x3bf1('0x32')]=_[_0x3bf1('0x33')](_0x484161[_0x3bf1('0x36')],_0x484161[_0x3bf1('0x34')]);_0x22433a[_0x3bf1('0x35')]=_['intersection'](_0x484161['model'],qs[_0x3bf1('0x37')](_0x5e865a[_0x3bf1('0x34')]['fields']));_0x22433a[_0x3bf1('0x35')]=_0x22433a[_0x3bf1('0x35')][_0x3bf1('0x4b')]?_0x22433a[_0x3bf1('0x35')]:_0x484161[_0x3bf1('0x36')];_0x22433a[_0x3bf1('0x3a')]=qs[_0x3bf1('0x3b')](_0x5e865a['query'][_0x3bf1('0x3b')]);_0x22433a[_0x3bf1('0x3c')]=qs[_0x3bf1('0x32')](_[_0x3bf1('0x3d')](_0x5e865a[_0x3bf1('0x34')],_0x484161[_0x3bf1('0x32')]));if(_0x5e865a[_0x3bf1('0x34')][_0x3bf1('0x3e')]){_0x22433a['where']=_[_0x3bf1('0x40')](_0x22433a[_0x3bf1('0x3c')],{'$or':_[_0x3bf1('0x2f')](_0x22433a[_0x3bf1('0x35')],function(_0x58536d){var _0x22736d={};_0x22736d[_0x58536d]={'$like':'%'+_0x5e865a[_0x3bf1('0x34')][_0x3bf1('0x3e')]+'%'};return _0x22736d;})});}_0x22433a=_['merge']({},_0x22433a,_0x5e865a['options']);return _0x1d6294[_0x3bf1('0x87')](_0x22433a);}})[_0x3bf1('0x26')](function(_0x592755){if(_0x592755){_0x122a94=_0x592755[_0x3bf1('0x4b')];if(!_0x5e865a[_0x3bf1('0x34')][_0x3bf1('0x38')](_0x3bf1('0x39'))){_0x22433a[_0x3bf1('0x21')]=qs[_0x3bf1('0x21')](_0x5e865a[_0x3bf1('0x34')][_0x3bf1('0x21')]);_0x22433a[_0x3bf1('0x1f')]=qs[_0x3bf1('0x1f')](_0x5e865a[_0x3bf1('0x34')][_0x3bf1('0x1f')]);}return _0x1d6294[_0x3bf1('0x87')](_0x22433a);}})[_0x3bf1('0x26')](function(_0x2c7213){if(_0x2c7213){return _0x2c7213?{'count':_0x122a94,'rows':_0x2c7213}:null;}})[_0x3bf1('0x26')](respondWithResult(_0xe2a6b0,null))[_0x3bf1('0x46')](handleError(_0xe2a6b0,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index c866873..5534a36 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 _0xe1a4=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','SmsQueue'];(function(_0x3a29af,_0x65e838){var _0xe82b7c=function(_0x14561a){while(--_0x14561a){_0x3a29af['push'](_0x3a29af['shift']());}};_0xe82b7c(++_0x65e838);}(_0xe1a4,0x180));var _0x4e1a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xe1a4[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0x4e1a('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x4e1a('0x1')](0x0);var events={'afterCreate':_0x4e1a('0x2'),'afterUpdate':'update','afterDestroy':_0x4e1a('0x3')};function emitEvent(_0x4e3b7a){return function(_0x5ea94f,_0x4b8540,_0x1f0009){SmsQueueEvents[_0x4e1a('0x4')](_0x4e3b7a+':'+_0x5ea94f['id'],_0x5ea94f);SmsQueueEvents[_0x4e1a('0x4')](_0x4e3b7a,_0x5ea94f);_0x1f0009(null);};}for(var e in events){if(events[_0x4e1a('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x4e1a('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0xe14f=['hook','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x1c9c59,_0x37559d){var _0x43be7b=function(_0x27eb97){while(--_0x27eb97){_0x1c9c59['push'](_0x1c9c59['shift']());}};_0x43be7b(++_0x37559d);}(_0xe14f,0xd1));var _0xfe14=function(_0x3e6aef,_0x8bafd6){_0x3e6aef=_0x3e6aef-0x0;var _0xbc16a=_0xe14f[_0x3e6aef];return _0xbc16a;};'use strict';var EventEmitter=require(_0xfe14('0x0'));var SmsQueue=require(_0xfe14('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfe14('0x2'),'afterUpdate':_0xfe14('0x3'),'afterDestroy':_0xfe14('0x4')};function emitEvent(_0x455076){return function(_0x512e9b,_0x84ac88,_0x21563d){SmsQueueEvents['emit'](_0x455076+':'+_0x512e9b['id'],_0x512e9b);SmsQueueEvents[_0xfe14('0x5')](_0x455076,_0x512e9b);_0x21563d(null);};}for(var e in events){if(events[_0xfe14('0x6')](e)){var event=events[e];SmsQueue[_0xfe14('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 66012c8..cc68058 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 _0x4a98=['moment','bluebird','path','rimraf','../../config/environment','define','lodash','util','api'];(function(_0x8889b3,_0x378656){var _0x5992a1=function(_0x4306f1){while(--_0x4306f1){_0x8889b3['push'](_0x8889b3['shift']());}};_0x5992a1(++_0x378656);}(_0x4a98,0x7b));var _0x84a9=function(_0x254d9f,_0x54ddb5){_0x254d9f=_0x254d9f-0x0;var _0x1eedb9=_0x4a98[_0x254d9f];return _0x1eedb9;};'use strict';var _=require(_0x84a9('0x0'));var util=require(_0x84a9('0x1'));var logger=require('../../config/logger')(_0x84a9('0x2'));var moment=require(_0x84a9('0x3'));var BPromise=require(_0x84a9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84a9('0x5'));var rimraf=require(_0x84a9('0x6'));var config=require(_0x84a9('0x7'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x53b667,_0x1e6c7d){return _0x53b667[_0x84a9('0x8')]('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62cf=['bluebird','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','../../config/logger','moment'];(function(_0x5a27c2,_0x5a16e1){var _0x1366e0=function(_0x49ef75){while(--_0x49ef75){_0x5a27c2['push'](_0x5a27c2['shift']());}};_0x1366e0(++_0x5a16e1);}(_0x62cf,0x81));var _0xf62c=function(_0x2e8935,_0x362a51){_0x2e8935=_0x2e8935-0x0;var _0x47620d=_0x62cf[_0x2e8935];return _0x47620d;};'use strict';var _=require(_0xf62c('0x0'));var util=require('util');var logger=require(_0xf62c('0x1'))('api');var moment=require(_0xf62c('0x2'));var BPromise=require(_0xf62c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf62c('0x4'));var config=require(_0xf62c('0x5'));var attributes=require(_0xf62c('0x6'));module[_0xf62c('0x7')]=function(_0x3604f0,_0x40487e){return _0x3604f0[_0xf62c('0x8')](_0xf62c('0x9'),attributes,{'tableName':_0xf62c('0xa'),'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 c3d1841..f4a78bc 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 _0x7344=['then','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','map','attributes','model','debug','catch','find','ShowSmsQueue','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request'];(function(_0x1d784e,_0x4e79d2){var _0x21e5aa=function(_0x44731a){while(--_0x44731a){_0x1d784e['push'](_0x1d784e['shift']());}};_0x21e5aa(++_0x4e79d2);}(_0x7344,0x161));var _0x4734=function(_0x243213,_0x3408e9){_0x243213=_0x243213-0x0;var _0x14b8ce=_0x7344[_0x243213];return _0x14b8ce;};'use strict';var _=require(_0x4734('0x0'));var util=require('util');var moment=require(_0x4734('0x1'));var BPromise=require(_0x4734('0x2'));var rs=require(_0x4734('0x3'));var fs=require('fs');var Redis=require(_0x4734('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4734('0x5'));var logger=require(_0x4734('0x6'))('rpc');var config=require(_0x4734('0x7'));var jayson=require(_0x4734('0x8'));var client=jayson[_0x4734('0x9')]['http']({'port':0x232a});config[_0x4734('0xa')]=_[_0x4734('0xb')](config[_0x4734('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4734('0xc'))(new Redis(config['redis']));require(_0x4734('0xd'))[_0x4734('0xe')](socket);function respondWithRpcPromise(_0x4a1dcf,_0xd57600,_0x3548c7){return new BPromise(function(_0x55f328,_0x237cb7){return client[_0x4734('0xf')](_0x4a1dcf,_0x3548c7)[_0x4734('0x10')](function(_0x1e6fff){logger['info'](_0x4734('0x11'),_0xd57600,_0x4734('0x12'));logger['debug'](_0x4734('0x13'),_0xd57600,_0x4734('0x12'),JSON[_0x4734('0x14')](_0x1e6fff));if(_0x1e6fff['error']){if(_0x1e6fff[_0x4734('0x15')][_0x4734('0x16')]===0x1f4){logger[_0x4734('0x15')](_0x4734('0x11'),_0xd57600,_0x1e6fff[_0x4734('0x15')][_0x4734('0x17')]);return _0x237cb7(_0x1e6fff[_0x4734('0x15')][_0x4734('0x17')]);}logger['error'](_0x4734('0x11'),_0xd57600,_0x1e6fff[_0x4734('0x15')][_0x4734('0x17')]);return _0x55f328(_0x1e6fff[_0x4734('0x15')][_0x4734('0x17')]);}else{logger[_0x4734('0x18')](_0x4734('0x11'),_0xd57600,_0x4734('0x12'));_0x55f328(_0x1e6fff[_0x4734('0x19')][_0x4734('0x17')]);}})['catch'](function(_0x56457f){logger['error']('SmsQueue,\x20%s,\x20%s',_0xd57600,_0x56457f);_0x237cb7(_0x56457f);});});}exports[_0x4734('0x1a')]=function(_0x18e591){var _0xda0375=this;return new Promise(function(_0x24fd05,_0x2e489b){return db[_0x4734('0x1b')][_0x4734('0x1c')]({'raw':_0x18e591['options']?_0x18e591[_0x4734('0x1d')][_0x4734('0x1e')]===undefined?!![]:![]:!![],'where':_0x18e591[_0x4734('0x1d')]?_0x18e591[_0x4734('0x1d')][_0x4734('0x1f')]||null:null,'attributes':_0x18e591[_0x4734('0x1d')]?_0x18e591[_0x4734('0x1d')]['attributes']||null:null,'limit':_0x18e591[_0x4734('0x1d')]?_0x18e591[_0x4734('0x1d')][_0x4734('0x20')]||null:null,'include':_0x18e591[_0x4734('0x1d')]?_0x18e591['options'][_0x4734('0x21')]?_[_0x4734('0x22')](_0x18e591['options'][_0x4734('0x21')],function(_0x2ca9e5){return{'model':db[_0x2ca9e5['model']],'as':_0x2ca9e5['as'],'attributes':_0x2ca9e5['attributes'],'include':_0x2ca9e5[_0x4734('0x21')]?_[_0x4734('0x22')](_0x2ca9e5[_0x4734('0x21')],function(_0x4b09e2){return{'model':db[_0x4b09e2['model']],'as':_0x4b09e2['as'],'attributes':_0x4b09e2[_0x4734('0x23')],'include':_0x4b09e2[_0x4734('0x21')]?_[_0x4734('0x22')](_0x4b09e2[_0x4734('0x21')],function(_0x2db1c4){return{'model':db[_0x2db1c4[_0x4734('0x24')]],'as':_0x2db1c4['as'],'attributes':_0x2db1c4[_0x4734('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4734('0x10')](function(_0x766503){logger['info']('GetSmsQueue',_0x18e591);logger[_0x4734('0x25')](_0x4734('0x1a'),_0x18e591,JSON['stringify'](_0x766503));_0x24fd05(_0x766503);})[_0x4734('0x26')](function(_0x2d02ca){logger[_0x4734('0x15')](_0x4734('0x1a'),_0x2d02ca[_0x4734('0x17')],_0x18e591);_0x2e489b(_0xda0375['error'](0x1f4,_0x2d02ca[_0x4734('0x17')]));});});};exports['ShowSmsQueue']=function(_0x146d77){var _0xdf494b=this;return new Promise(function(_0x462fe1,_0x46cf76){return db[_0x4734('0x1b')][_0x4734('0x27')]({'raw':_0x146d77[_0x4734('0x1d')]?_0x146d77[_0x4734('0x1d')][_0x4734('0x1e')]===undefined?!![]:![]:!![],'where':_0x146d77[_0x4734('0x1d')]?_0x146d77['options']['where']||null:null,'attributes':_0x146d77[_0x4734('0x1d')]?_0x146d77[_0x4734('0x1d')]['attributes']||null:null,'include':_0x146d77[_0x4734('0x1d')]?_0x146d77['options'][_0x4734('0x21')]?_[_0x4734('0x22')](_0x146d77[_0x4734('0x1d')][_0x4734('0x21')],function(_0x1f50f4){return{'model':db[_0x1f50f4[_0x4734('0x24')]],'as':_0x1f50f4['as'],'attributes':_0x1f50f4[_0x4734('0x23')],'include':_0x1f50f4['include']?_['map'](_0x1f50f4['include'],function(_0x45b87d){return{'model':db[_0x45b87d[_0x4734('0x24')]],'as':_0x45b87d['as'],'attributes':_0x45b87d[_0x4734('0x23')],'include':_0x45b87d[_0x4734('0x21')]?_['map'](_0x45b87d[_0x4734('0x21')],function(_0x35f543){return{'model':db[_0x35f543[_0x4734('0x24')]],'as':_0x35f543['as'],'attributes':_0x35f543[_0x4734('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4734('0x10')](function(_0x5ce0f0){logger['info'](_0x4734('0x28'),_0x146d77);logger['debug'](_0x4734('0x28'),_0x146d77,JSON[_0x4734('0x14')](_0x5ce0f0));_0x462fe1(_0x5ce0f0);})[_0x4734('0x26')](function(_0x5785d9){logger['error'](_0x4734('0x28'),_0x5785d9[_0x4734('0x17')],_0x146d77);_0x46cf76(_0xdf494b[_0x4734('0x15')](0x1f4,_0x5785d9['message']));});});}; \ No newline at end of file +var _0x896c=['findAll','options','where','attributes','limit','include','map','model','stringify','ShowSmsQueue','raw','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','./smsQueue.socket','register','request','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','SmsQueue'];(function(_0x48011d,_0x5e90de){var _0x2f0d12=function(_0x538861){while(--_0x538861){_0x48011d['push'](_0x48011d['shift']());}};_0x2f0d12(++_0x5e90de);}(_0x896c,0x161));var _0xc896=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0x896c[_0x1597e2];return _0x4c8c0a;};'use strict';var _=require('lodash');var util=require(_0xc896('0x0'));var moment=require(_0xc896('0x1'));var BPromise=require('bluebird');var rs=require(_0xc896('0x2'));var fs=require('fs');var Redis=require(_0xc896('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc896('0x4'));var logger=require(_0xc896('0x5'))('rpc');var config=require(_0xc896('0x6'));var jayson=require(_0xc896('0x7'));var client=jayson[_0xc896('0x8')][_0xc896('0x9')]({'port':0x232a});config[_0xc896('0xa')]=_[_0xc896('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc896('0xa')]));require(_0xc896('0xc'))[_0xc896('0xd')](socket);function respondWithRpcPromise(_0x54ddda,_0x194c2d,_0x5d5a13){return new BPromise(function(_0x4e53fd,_0x326ab9){return client[_0xc896('0xe')](_0x54ddda,_0x5d5a13)[_0xc896('0xf')](function(_0x4c9fec){logger[_0xc896('0x10')]('SmsQueue,\x20%s,\x20%s',_0x194c2d,_0xc896('0x11'));logger[_0xc896('0x12')](_0xc896('0x13'),_0x194c2d,_0xc896('0x11'),JSON['stringify'](_0x4c9fec));if(_0x4c9fec[_0xc896('0x14')]){if(_0x4c9fec[_0xc896('0x14')]['code']===0x1f4){logger[_0xc896('0x14')](_0xc896('0x15'),_0x194c2d,_0x4c9fec[_0xc896('0x14')][_0xc896('0x16')]);return _0x326ab9(_0x4c9fec[_0xc896('0x14')][_0xc896('0x16')]);}logger[_0xc896('0x14')]('SmsQueue,\x20%s,\x20%s',_0x194c2d,_0x4c9fec[_0xc896('0x14')][_0xc896('0x16')]);return _0x4e53fd(_0x4c9fec['error'][_0xc896('0x16')]);}else{logger[_0xc896('0x10')](_0xc896('0x15'),_0x194c2d,'request\x20sent');_0x4e53fd(_0x4c9fec[_0xc896('0x17')][_0xc896('0x16')]);}})[_0xc896('0x18')](function(_0x498353){logger[_0xc896('0x14')]('SmsQueue,\x20%s,\x20%s',_0x194c2d,_0x498353);_0x326ab9(_0x498353);});});}exports[_0xc896('0x19')]=function(_0x30ac40){var _0x126680=this;return new Promise(function(_0x526c9b,_0x110d5e){return db[_0xc896('0x1a')][_0xc896('0x1b')]({'raw':_0x30ac40[_0xc896('0x1c')]?_0x30ac40[_0xc896('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x30ac40[_0xc896('0x1c')]?_0x30ac40[_0xc896('0x1c')][_0xc896('0x1d')]||null:null,'attributes':_0x30ac40['options']?_0x30ac40[_0xc896('0x1c')][_0xc896('0x1e')]||null:null,'limit':_0x30ac40['options']?_0x30ac40[_0xc896('0x1c')][_0xc896('0x1f')]||null:null,'include':_0x30ac40[_0xc896('0x1c')]?_0x30ac40[_0xc896('0x1c')][_0xc896('0x20')]?_[_0xc896('0x21')](_0x30ac40[_0xc896('0x1c')][_0xc896('0x20')],function(_0x457633){return{'model':db[_0x457633[_0xc896('0x22')]],'as':_0x457633['as'],'attributes':_0x457633['attributes'],'include':_0x457633[_0xc896('0x20')]?_['map'](_0x457633[_0xc896('0x20')],function(_0x30cfe7){return{'model':db[_0x30cfe7['model']],'as':_0x30cfe7['as'],'attributes':_0x30cfe7[_0xc896('0x1e')],'include':_0x30cfe7[_0xc896('0x20')]?_[_0xc896('0x21')](_0x30cfe7[_0xc896('0x20')],function(_0x2311cc){return{'model':db[_0x2311cc[_0xc896('0x22')]],'as':_0x2311cc['as'],'attributes':_0x2311cc[_0xc896('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc896('0xf')](function(_0xbe3d80){logger['info'](_0xc896('0x19'),_0x30ac40);logger[_0xc896('0x12')](_0xc896('0x19'),_0x30ac40,JSON[_0xc896('0x23')](_0xbe3d80));_0x526c9b(_0xbe3d80);})[_0xc896('0x18')](function(_0x29e7f1){logger[_0xc896('0x14')](_0xc896('0x19'),_0x29e7f1[_0xc896('0x16')],_0x30ac40);_0x110d5e(_0x126680[_0xc896('0x14')](0x1f4,_0x29e7f1['message']));});});};exports[_0xc896('0x24')]=function(_0xfb966e){var _0x5b3ec4=this;return new Promise(function(_0x5a2aec,_0xf451a5){return db['SmsQueue']['find']({'raw':_0xfb966e['options']?_0xfb966e[_0xc896('0x1c')][_0xc896('0x25')]===undefined?!![]:![]:!![],'where':_0xfb966e[_0xc896('0x1c')]?_0xfb966e['options'][_0xc896('0x1d')]||null:null,'attributes':_0xfb966e['options']?_0xfb966e[_0xc896('0x1c')][_0xc896('0x1e')]||null:null,'include':_0xfb966e[_0xc896('0x1c')]?_0xfb966e[_0xc896('0x1c')][_0xc896('0x20')]?_[_0xc896('0x21')](_0xfb966e[_0xc896('0x1c')][_0xc896('0x20')],function(_0x1f2600){return{'model':db[_0x1f2600[_0xc896('0x22')]],'as':_0x1f2600['as'],'attributes':_0x1f2600['attributes'],'include':_0x1f2600[_0xc896('0x20')]?_['map'](_0x1f2600['include'],function(_0x260b19){return{'model':db[_0x260b19[_0xc896('0x22')]],'as':_0x260b19['as'],'attributes':_0x260b19[_0xc896('0x1e')],'include':_0x260b19['include']?_[_0xc896('0x21')](_0x260b19['include'],function(_0x58e5fa){return{'model':db[_0x58e5fa[_0xc896('0x22')]],'as':_0x58e5fa['as'],'attributes':_0x58e5fa[_0xc896('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc896('0xf')](function(_0x3d4845){logger['info']('ShowSmsQueue',_0xfb966e);logger[_0xc896('0x12')](_0xc896('0x24'),_0xfb966e,JSON['stringify'](_0x3d4845));_0x5a2aec(_0x3d4845);})[_0xc896('0x18')](function(_0x331076){logger[_0xc896('0x14')](_0xc896('0x24'),_0x331076['message'],_0xfb966e);_0xf451a5(_0x5b3ec4[_0xc896('0x14')](0x1f4,_0x331076['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 2a1de7b..8e88e9b 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 _0xe263=['smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xe263,0x133));var _0x3e26=function(_0x19f386,_0x207cf7){_0x19f386=_0x19f386-0x0;var _0x3fd6a8=_0xe263[_0x19f386];return _0x3fd6a8;};'use strict';var SmsQueueEvents=require(_0x3e26('0x0'));var events=[_0x3e26('0x1'),_0x3e26('0x2'),_0x3e26('0x3')];function createListener(_0x1299ab,_0x3a9fb8){return function(_0x16ba12){_0x3a9fb8[_0x3e26('0x4')](_0x1299ab,_0x16ba12);};}function removeListener(_0x54467e,_0x5d9903){return function(){SmsQueueEvents[_0x3e26('0x5')](_0x54467e,_0x5d9903);};}exports[_0x3e26('0x6')]=function(_0x4f55b6){for(var _0x2924d4=0x0,_0x539460=events[_0x3e26('0x7')];_0x2924d4<_0x539460;_0x2924d4++){var _0x5c43f6=events[_0x2924d4];var _0x5b23be=createListener(_0x3e26('0x8')+_0x5c43f6,_0x4f55b6);SmsQueueEvents['on'](_0x5c43f6,_0x5b23be);}}; \ No newline at end of file +var _0x7a56=['remove','update','emit','removeListener','register','length','smsQueue:','save'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x7a56,0x1b7));var _0x67a5=function(_0x7db8c4,_0x12870e){_0x7db8c4=_0x7db8c4-0x0;var _0x1596e7=_0x7a56[_0x7db8c4];return _0x1596e7;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x67a5('0x0'),_0x67a5('0x1'),_0x67a5('0x2')];function createListener(_0x256016,_0x300b0d){return function(_0x31f8e3){_0x300b0d[_0x67a5('0x3')](_0x256016,_0x31f8e3);};}function removeListener(_0x16e6f3,_0x38722d){return function(){SmsQueueEvents[_0x67a5('0x4')](_0x16e6f3,_0x38722d);};}exports[_0x67a5('0x5')]=function(_0x136f91){for(var _0x376a74=0x0,_0x1095e8=events[_0x67a5('0x6')];_0x376a74<_0x1095e8;_0x376a74++){var _0x23c09d=events[_0x376a74];var _0x192b98=createListener(_0x67a5('0x7')+_0x23c09d,_0x136f91);SmsQueueEvents['on'](_0x23c09d,_0x192b98);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 8240e2e..f3d1435 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 _0xd60d=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0xd60d,0xff));var _0xdd60=function(_0x17b680,_0x46e290){_0x17b680=_0x17b680-0x0;var _0x5caa7c=_0xd60d[_0x17b680];return _0x5caa7c;};'use strict';var multer=require(_0xdd60('0x0'));var util=require(_0xdd60('0x1'));var path=require('path');var timeout=require(_0xdd60('0x2'));var express=require('express');var router=express[_0xdd60('0x3')]();var fs_extra=require(_0xdd60('0x4'));var auth=require(_0xdd60('0x5'));var interaction=require(_0xdd60('0x6'));var config=require(_0xdd60('0x7'));var controller=require('./smsQueueReport.controller');router[_0xdd60('0x8')]('/',auth[_0xdd60('0x9')](),controller[_0xdd60('0xa')]);router[_0xdd60('0x8')](_0xdd60('0xb'),auth[_0xdd60('0x9')](),controller[_0xdd60('0xc')]);router['get'](_0xdd60('0xd'),auth[_0xdd60('0x9')](),controller[_0xdd60('0xe')]);router[_0xdd60('0xf')]('/',auth[_0xdd60('0x9')](),controller['create']);router[_0xdd60('0x10')](_0xdd60('0xd'),auth[_0xdd60('0x9')](),controller[_0xdd60('0x11')]);router[_0xdd60('0x12')](_0xdd60('0xd'),auth['isAuthenticated'](),controller[_0xdd60('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9438=['get','describe','/:id','show','post','put','update','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index'];(function(_0x5a78ab,_0x1b2b03){var _0x4dd303=function(_0x3fc52f){while(--_0x3fc52f){_0x5a78ab['push'](_0x5a78ab['shift']());}};_0x4dd303(++_0x1b2b03);}(_0x9438,0x8d));var _0x8943=function(_0x7a02d5,_0x31119e){_0x7a02d5=_0x7a02d5-0x0;var _0x2bded6=_0x9438[_0x7a02d5];return _0x2bded6;};'use strict';var multer=require(_0x8943('0x0'));var util=require(_0x8943('0x1'));var path=require('path');var timeout=require(_0x8943('0x2'));var express=require(_0x8943('0x3'));var router=express['Router']();var fs_extra=require(_0x8943('0x4'));var auth=require(_0x8943('0x5'));var interaction=require(_0x8943('0x6'));var config=require(_0x8943('0x7'));var controller=require(_0x8943('0x8'));router['get']('/',auth[_0x8943('0x9')](),controller[_0x8943('0xa')]);router[_0x8943('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x8943('0xc')]);router[_0x8943('0xb')](_0x8943('0xd'),auth[_0x8943('0x9')](),controller[_0x8943('0xe')]);router[_0x8943('0xf')]('/',auth[_0x8943('0x9')](),controller['create']);router[_0x8943('0x10')]('/:id',auth[_0x8943('0x9')](),controller[_0x8943('0x11')]);router['delete'](_0x8943('0xd'),auth[_0x8943('0x9')](),controller['destroy']);module[_0x8943('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index fe88306..de5635a 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 _0x175f=['STRING','DATE','sequelize','exports'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x175f,0x1be));var _0xf175=function(_0x47cbc1,_0x3238cd){_0x47cbc1=_0x47cbc1-0x0;var _0x54eef5=_0x175f[_0x47cbc1];return _0x54eef5;};'use strict';var moment=require('moment');var Sequelize=require(_0xf175('0x0'));module[_0xf175('0x1')]={'uniqueid':{'type':Sequelize[_0xf175('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf175('0x2')]},'joinAt':{'type':Sequelize[_0xf175('0x3')]},'leaveAt':{'type':Sequelize[_0xf175('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf175('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4172=['moment','sequelize','STRING','DATE'];(function(_0x5d796b,_0x24d3ad){var _0x535de5=function(_0xd433e9){while(--_0xd433e9){_0x5d796b['push'](_0x5d796b['shift']());}};_0x535de5(++_0x24d3ad);}(_0x4172,0xbc));var _0x2417=function(_0x18a250,_0x412f54){_0x18a250=_0x18a250-0x0;var _0x3e4e16=_0x4172[_0x18a250];return _0x3e4e16;};'use strict';var moment=require(_0x2417('0x0'));var Sequelize=require(_0x2417('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x2417('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2417('0x2')]},'joinAt':{'type':Sequelize[_0x2417('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2417('0x3')]},'reason':{'type':Sequelize[_0x2417('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 2db3365..4aa87cf 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 _0x213f=['attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','options','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','then','stack','name','send','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x407e03,_0x3867fc){var _0x2b9af5=function(_0x541fea){while(--_0x541fea){_0x407e03['push'](_0x407e03['shift']());}};_0x2b9af5(++_0x3867fc);}(_0x213f,0xae));var _0xf213=function(_0x1d8dd7,_0x53e55a){_0x1d8dd7=_0x1d8dd7-0x0;var _0x587305=_0x213f[_0x1d8dd7];return _0x587305;};'use strict';var emlformat=require(_0xf213('0x0'));var rimraf=require(_0xf213('0x1'));var zipdir=require(_0xf213('0x2'));var jsonpatch=require(_0xf213('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf213('0x4'));var util=require('util');var path=require(_0xf213('0x5'));var sox=require(_0xf213('0x6'));var csv=require(_0xf213('0x7'));var ejs=require(_0xf213('0x8'));var fs=require('fs');var fs_extra=require(_0xf213('0x9'));var _=require(_0xf213('0xa'));var squel=require('squel');var crypto=require(_0xf213('0xb'));var jsforce=require(_0xf213('0xc'));var deskjs=require(_0xf213('0xd'));var toCsv=require(_0xf213('0x7'));var querystring=require(_0xf213('0xe'));var Papa=require(_0xf213('0xf'));var Redis=require(_0xf213('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf213('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf213('0x12'));var logger=require(_0xf213('0x13'))(_0xf213('0x14'));var utils=require(_0xf213('0x15'));var config=require(_0xf213('0x16'));var licenseUtil=require(_0xf213('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc2a33a,_0xfe4ed8){_0xfe4ed8=_0xfe4ed8||0xcc;return function(_0x461949){if(_0x461949){return _0xc2a33a[_0xf213('0x18')](_0xfe4ed8);}return _0xc2a33a[_0xf213('0x19')](_0xfe4ed8)[_0xf213('0x1a')]();};}function respondWithResult(_0x29a3de,_0x5333d6){_0x5333d6=_0x5333d6||0xc8;return function(_0xe5aa80){if(_0xe5aa80){return _0x29a3de[_0xf213('0x19')](_0x5333d6)[_0xf213('0x1b')](_0xe5aa80);}};}function respondWithFilteredResult(_0x13345f,_0x201d5e){return function(_0x380984){if(_0x380984){var _0x21ec31=typeof _0x201d5e[_0xf213('0x1c')]===_0xf213('0x1d')&&typeof _0x201d5e[_0xf213('0x1e')]==='undefined';var _0x24e7a6=_0x380984[_0xf213('0x1f')];var _0x1b1b87=_0x21ec31?0x0:_0x201d5e[_0xf213('0x1c')];var _0x3dfc4f=_0x21ec31?_0x380984['count']:_0x201d5e['offset']+_0x201d5e[_0xf213('0x1e')];var _0x2cd53b;if(_0x3dfc4f>=_0x24e7a6){_0x3dfc4f=_0x24e7a6;_0x2cd53b=0xc8;}else{_0x2cd53b=0xce;}_0x13345f[_0xf213('0x19')](_0x2cd53b);return _0x13345f['set'](_0xf213('0x20'),_0x1b1b87+'-'+_0x3dfc4f+'/'+_0x24e7a6)[_0xf213('0x1b')](_0x380984);}return null;};}function patchUpdates(_0x76a52){return function(_0x30f6a9){try{jsonpatch[_0xf213('0x21')](_0x30f6a9,_0x76a52,!![]);}catch(_0x448764){return BPromise['reject'](_0x448764);}return _0x30f6a9[_0xf213('0x22')]();};}function saveUpdates(_0x2ff227,_0x1e529e){return function(_0x37cc97){if(_0x37cc97){return _0x37cc97['update'](_0x2ff227)['then'](function(_0x352a9e){return _0x352a9e;});}return null;};}function removeEntity(_0x3628bd,_0x59eb52){return function(_0x3f3f08){if(_0x3f3f08){return _0x3f3f08[_0xf213('0x23')]()[_0xf213('0x24')](function(){_0x3628bd[_0xf213('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2577e3,_0x4d01ea){return function(_0x3ea2a3){if(!_0x3ea2a3){_0x2577e3[_0xf213('0x18')](0x194);}return _0x3ea2a3;};}function handleError(_0x111980,_0x28a3ba){_0x28a3ba=_0x28a3ba||0x1f4;return function(_0x1b54cb){logger['error'](_0x1b54cb[_0xf213('0x25')]);if(_0x1b54cb[_0xf213('0x26')]){delete _0x1b54cb[_0xf213('0x26')];}_0x111980[_0xf213('0x19')](_0x28a3ba)[_0xf213('0x27')](_0x1b54cb);};}exports['index']=function(_0x3b58c9,_0x5186b3){var _0x1ae3f8={},_0x5576d5={},_0x53884f={'count':0x0,'rows':[]};var _0x3c323d=_[_0xf213('0x28')](db[_0xf213('0x29')][_0xf213('0x2a')],function(_0x31e5df){return{'name':_0x31e5df[_0xf213('0x2b')],'type':_0x31e5df[_0xf213('0x2c')][_0xf213('0x2d')]};});_0x5576d5[_0xf213('0x2e')]=_[_0xf213('0x28')](_0x3c323d,_0xf213('0x26'));_0x5576d5[_0xf213('0x2f')]=_[_0xf213('0x30')](_0x3b58c9['query']);_0x5576d5[_0xf213('0x31')]=_[_0xf213('0x32')](_0x5576d5[_0xf213('0x2e')],_0x5576d5[_0xf213('0x2f')]);_0x1ae3f8[_0xf213('0x33')]=_['intersection'](_0x5576d5[_0xf213('0x2e')],qs[_0xf213('0x34')](_0x3b58c9[_0xf213('0x2f')]['fields']));_0x1ae3f8[_0xf213('0x33')]=_0x1ae3f8['attributes'][_0xf213('0x35')]?_0x1ae3f8[_0xf213('0x33')]:_0x5576d5['model'];if(!_0x3b58c9[_0xf213('0x2f')]['hasOwnProperty'](_0xf213('0x36'))){_0x1ae3f8[_0xf213('0x1e')]=qs[_0xf213('0x1e')](_0x3b58c9['query'][_0xf213('0x1e')]);_0x1ae3f8[_0xf213('0x1c')]=qs[_0xf213('0x1c')](_0x3b58c9['query']['offset']);}_0x1ae3f8[_0xf213('0x37')]=qs[_0xf213('0x38')](_0x3b58c9[_0xf213('0x2f')][_0xf213('0x38')]);_0x1ae3f8['where']=qs[_0xf213('0x31')](_[_0xf213('0x39')](_0x3b58c9[_0xf213('0x2f')],_0x5576d5[_0xf213('0x31')]),_0x3c323d);if(_0x3b58c9[_0xf213('0x2f')]['filter']){_0x1ae3f8[_0xf213('0x3a')]=_[_0xf213('0x3b')](_0x1ae3f8[_0xf213('0x3a')],{'$or':_[_0xf213('0x28')](_0x3c323d,function(_0x276fc7){if(_0x276fc7[_0xf213('0x2c')]!==_0xf213('0x3c')){var _0x12cb81={};_0x12cb81[_0x276fc7[_0xf213('0x26')]]={'$like':'%'+_0x3b58c9[_0xf213('0x2f')][_0xf213('0x3d')]+'%'};return _0x12cb81;}})});}_0x1ae3f8=_[_0xf213('0x3b')]({},_0x1ae3f8,_0x3b58c9['options']);var _0x23c6c8={'where':_0x1ae3f8[_0xf213('0x3a')]};return db[_0xf213('0x29')]['count'](_0x23c6c8)[_0xf213('0x24')](function(_0x2c2bd3){_0x53884f[_0xf213('0x1f')]=_0x2c2bd3;if(_0x3b58c9[_0xf213('0x2f')][_0xf213('0x3e')]){_0x1ae3f8[_0xf213('0x3f')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xf213('0x40')](_0x1ae3f8);})[_0xf213('0x24')](function(_0x2156d5){_0x53884f[_0xf213('0x41')]=_0x2156d5;return _0x53884f;})[_0xf213('0x24')](respondWithFilteredResult(_0x5186b3,_0x1ae3f8))[_0xf213('0x42')](handleError(_0x5186b3,null));};exports[_0xf213('0x43')]=function(_0xd81ea8,_0x5197de){var _0x3dca1b={'raw':!![],'where':{'id':_0xd81ea8['params']['id']}},_0x406988={};_0x406988['model']=_['keys'](db[_0xf213('0x29')][_0xf213('0x2a')]);_0x406988[_0xf213('0x2f')]=_['keys'](_0xd81ea8['query']);_0x406988[_0xf213('0x31')]=_[_0xf213('0x32')](_0x406988[_0xf213('0x2e')],_0x406988[_0xf213('0x2f')]);_0x3dca1b['attributes']=_['intersection'](_0x406988['model'],qs[_0xf213('0x34')](_0xd81ea8[_0xf213('0x2f')]['fields']));_0x3dca1b[_0xf213('0x33')]=_0x3dca1b['attributes'][_0xf213('0x35')]?_0x3dca1b[_0xf213('0x33')]:_0x406988[_0xf213('0x2e')];if(_0xd81ea8[_0xf213('0x2f')]['includeAll']){_0x3dca1b[_0xf213('0x3f')]=[{'all':!![]}];}_0x3dca1b=_[_0xf213('0x3b')]({},_0x3dca1b,_0xd81ea8[_0xf213('0x44')]);return db[_0xf213('0x29')][_0xf213('0x45')](_0x3dca1b)[_0xf213('0x24')](handleEntityNotFound(_0x5197de,null))[_0xf213('0x24')](respondWithResult(_0x5197de,null))[_0xf213('0x42')](handleError(_0x5197de,null));};exports[_0xf213('0x46')]=function(_0x366f7c,_0x5bb640){return db[_0xf213('0x29')][_0xf213('0x46')](_0x366f7c[_0xf213('0x47')],{})[_0xf213('0x24')](respondWithResult(_0x5bb640,0xc9))[_0xf213('0x42')](handleError(_0x5bb640,null));};exports[_0xf213('0x48')]=function(_0x4d243b,_0x4beefd){if(_0x4d243b[_0xf213('0x47')]['id']){delete _0x4d243b[_0xf213('0x47')]['id'];}return db[_0xf213('0x29')][_0xf213('0x45')]({'where':{'id':_0x4d243b[_0xf213('0x49')]['id']}})[_0xf213('0x24')](handleEntityNotFound(_0x4beefd,null))[_0xf213('0x24')](saveUpdates(_0x4d243b[_0xf213('0x47')],null))['then'](respondWithResult(_0x4beefd,null))['catch'](handleError(_0x4beefd,null));};exports[_0xf213('0x23')]=function(_0x420a13,_0x401513){return db[_0xf213('0x29')][_0xf213('0x45')]({'where':{'id':_0x420a13[_0xf213('0x49')]['id']}})['then'](handleEntityNotFound(_0x401513,null))[_0xf213('0x24')](removeEntity(_0x401513,null))[_0xf213('0x42')](handleError(_0x401513,null));};exports[_0xf213('0x4a')]=function(_0x213c55,_0x179f03){return db['SmsQueueReport'][_0xf213('0x4a')]()['then'](respondWithResult(_0x179f03,null))[_0xf213('0x42')](handleError(_0x179f03,null));}; \ No newline at end of file +var _0x7a58=['query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','SmsQueueReport','includeAll','findAll','then','rows','catch','show','params','rawAttributes','fields','length','include','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','Content-Range','reject','save','destroy','sendStatus','error','stack','name','send','index','map','fieldName','key','model'];(function(_0x1daaa9,_0x220393){var _0x1dd221=function(_0x492c61){while(--_0x492c61){_0x1daaa9['push'](_0x1daaa9['shift']());}};_0x1dd221(++_0x220393);}(_0x7a58,0x6b));var _0x87a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a58[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x87a5('0x0'));var rimraf=require(_0x87a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x87a5('0x2'));var rp=require(_0x87a5('0x3'));var moment=require(_0x87a5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x87a5('0x5'));var path=require(_0x87a5('0x6'));var sox=require(_0x87a5('0x7'));var csv=require(_0x87a5('0x8'));var ejs=require(_0x87a5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87a5('0xa'));var squel=require('squel');var crypto=require(_0x87a5('0xb'));var jsforce=require(_0x87a5('0xc'));var deskjs=require(_0x87a5('0xd'));var toCsv=require(_0x87a5('0x8'));var querystring=require(_0x87a5('0xe'));var Papa=require(_0x87a5('0xf'));var Redis=require('ioredis');var authService=require(_0x87a5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x87a5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x87a5('0x12'))(_0x87a5('0x13'));var utils=require(_0x87a5('0x14'));var config=require(_0x87a5('0x15'));var licenseUtil=require(_0x87a5('0x16'));var db=require(_0x87a5('0x17'))['db'];function respondWithStatusCode(_0x6228e2,_0x50780a){_0x50780a=_0x50780a||0xcc;return function(_0x137143){if(_0x137143){return _0x6228e2['sendStatus'](_0x50780a);}return _0x6228e2['status'](_0x50780a)[_0x87a5('0x18')]();};}function respondWithResult(_0x541b14,_0x507e98){_0x507e98=_0x507e98||0xc8;return function(_0x3df5ad){if(_0x3df5ad){return _0x541b14[_0x87a5('0x19')](_0x507e98)[_0x87a5('0x1a')](_0x3df5ad);}};}function respondWithFilteredResult(_0x243132,_0x1b84a2){return function(_0x24a8cf){if(_0x24a8cf){var _0x5c389c=typeof _0x1b84a2[_0x87a5('0x1b')]==='undefined'&&typeof _0x1b84a2[_0x87a5('0x1c')]===_0x87a5('0x1d');var _0x3a3675=_0x24a8cf[_0x87a5('0x1e')];var _0x49b7e6=_0x5c389c?0x0:_0x1b84a2[_0x87a5('0x1b')];var _0x3ffe27=_0x5c389c?_0x24a8cf[_0x87a5('0x1e')]:_0x1b84a2['offset']+_0x1b84a2['limit'];var _0x165353;if(_0x3ffe27>=_0x3a3675){_0x3ffe27=_0x3a3675;_0x165353=0xc8;}else{_0x165353=0xce;}_0x243132[_0x87a5('0x19')](_0x165353);return _0x243132['set'](_0x87a5('0x1f'),_0x49b7e6+'-'+_0x3ffe27+'/'+_0x3a3675)[_0x87a5('0x1a')](_0x24a8cf);}return null;};}function patchUpdates(_0x26661b){return function(_0x3cbceb){try{jsonpatch['apply'](_0x3cbceb,_0x26661b,!![]);}catch(_0x379242){return BPromise[_0x87a5('0x20')](_0x379242);}return _0x3cbceb[_0x87a5('0x21')]();};}function saveUpdates(_0x5a9b69,_0x460d11){return function(_0x371d2f){if(_0x371d2f){return _0x371d2f['update'](_0x5a9b69)['then'](function(_0x3c93ed){return _0x3c93ed;});}return null;};}function removeEntity(_0x279fcd,_0x17d318){return function(_0x3b9dcf){if(_0x3b9dcf){return _0x3b9dcf[_0x87a5('0x22')]()['then'](function(){_0x279fcd[_0x87a5('0x19')](0xcc)[_0x87a5('0x18')]();});}};}function handleEntityNotFound(_0x31824d,_0x22ca3b){return function(_0x5118b5){if(!_0x5118b5){_0x31824d[_0x87a5('0x23')](0x194);}return _0x5118b5;};}function handleError(_0x1f142f,_0x50d39c){_0x50d39c=_0x50d39c||0x1f4;return function(_0x416be0){logger[_0x87a5('0x24')](_0x416be0[_0x87a5('0x25')]);if(_0x416be0[_0x87a5('0x26')]){delete _0x416be0['name'];}_0x1f142f[_0x87a5('0x19')](_0x50d39c)[_0x87a5('0x27')](_0x416be0);};}exports[_0x87a5('0x28')]=function(_0x442bcb,_0x37c9ef){var _0x37bb98={},_0x1dabdf={},_0x1d3eb2={'count':0x0,'rows':[]};var _0x28016b=_[_0x87a5('0x29')](db['SmsQueueReport']['rawAttributes'],function(_0x33ccf8){return{'name':_0x33ccf8[_0x87a5('0x2a')],'type':_0x33ccf8['type'][_0x87a5('0x2b')]};});_0x1dabdf[_0x87a5('0x2c')]=_[_0x87a5('0x29')](_0x28016b,_0x87a5('0x26'));_0x1dabdf[_0x87a5('0x2d')]=_[_0x87a5('0x2e')](_0x442bcb['query']);_0x1dabdf[_0x87a5('0x2f')]=_[_0x87a5('0x30')](_0x1dabdf[_0x87a5('0x2c')],_0x1dabdf[_0x87a5('0x2d')]);_0x37bb98[_0x87a5('0x31')]=_[_0x87a5('0x30')](_0x1dabdf[_0x87a5('0x2c')],qs['fields'](_0x442bcb['query']['fields']));_0x37bb98[_0x87a5('0x31')]=_0x37bb98[_0x87a5('0x31')]['length']?_0x37bb98[_0x87a5('0x31')]:_0x1dabdf[_0x87a5('0x2c')];if(!_0x442bcb[_0x87a5('0x2d')][_0x87a5('0x32')]('nolimit')){_0x37bb98[_0x87a5('0x1c')]=qs[_0x87a5('0x1c')](_0x442bcb[_0x87a5('0x2d')]['limit']);_0x37bb98['offset']=qs['offset'](_0x442bcb[_0x87a5('0x2d')][_0x87a5('0x1b')]);}_0x37bb98[_0x87a5('0x33')]=qs[_0x87a5('0x34')](_0x442bcb[_0x87a5('0x2d')][_0x87a5('0x34')]);_0x37bb98[_0x87a5('0x35')]=qs['filters'](_[_0x87a5('0x36')](_0x442bcb[_0x87a5('0x2d')],_0x1dabdf[_0x87a5('0x2f')]),_0x28016b);if(_0x442bcb[_0x87a5('0x2d')]['filter']){_0x37bb98[_0x87a5('0x35')]=_[_0x87a5('0x37')](_0x37bb98[_0x87a5('0x35')],{'$or':_[_0x87a5('0x29')](_0x28016b,function(_0xf606ed){if(_0xf606ed['type']!==_0x87a5('0x38')){var _0x4c7668={};_0x4c7668[_0xf606ed[_0x87a5('0x26')]]={'$like':'%'+_0x442bcb['query'][_0x87a5('0x39')]+'%'};return _0x4c7668;}})});}_0x37bb98=_[_0x87a5('0x37')]({},_0x37bb98,_0x442bcb[_0x87a5('0x3a')]);var _0x3cb2e2={'where':_0x37bb98[_0x87a5('0x35')]};return db[_0x87a5('0x3b')][_0x87a5('0x1e')](_0x3cb2e2)['then'](function(_0x155ea9){_0x1d3eb2[_0x87a5('0x1e')]=_0x155ea9;if(_0x442bcb[_0x87a5('0x2d')][_0x87a5('0x3c')]){_0x37bb98['include']=[{'all':!![]}];}return db[_0x87a5('0x3b')][_0x87a5('0x3d')](_0x37bb98);})[_0x87a5('0x3e')](function(_0x2f3eec){_0x1d3eb2[_0x87a5('0x3f')]=_0x2f3eec;return _0x1d3eb2;})[_0x87a5('0x3e')](respondWithFilteredResult(_0x37c9ef,_0x37bb98))[_0x87a5('0x40')](handleError(_0x37c9ef,null));};exports[_0x87a5('0x41')]=function(_0x4fff90,_0x2cff59){var _0x3155c9={'raw':!![],'where':{'id':_0x4fff90[_0x87a5('0x42')]['id']}},_0x424e51={};_0x424e51['model']=_['keys'](db['SmsQueueReport'][_0x87a5('0x43')]);_0x424e51['query']=_[_0x87a5('0x2e')](_0x4fff90[_0x87a5('0x2d')]);_0x424e51[_0x87a5('0x2f')]=_[_0x87a5('0x30')](_0x424e51[_0x87a5('0x2c')],_0x424e51[_0x87a5('0x2d')]);_0x3155c9['attributes']=_[_0x87a5('0x30')](_0x424e51[_0x87a5('0x2c')],qs[_0x87a5('0x44')](_0x4fff90[_0x87a5('0x2d')][_0x87a5('0x44')]));_0x3155c9[_0x87a5('0x31')]=_0x3155c9[_0x87a5('0x31')][_0x87a5('0x45')]?_0x3155c9[_0x87a5('0x31')]:_0x424e51['model'];if(_0x4fff90[_0x87a5('0x2d')][_0x87a5('0x3c')]){_0x3155c9[_0x87a5('0x46')]=[{'all':!![]}];}_0x3155c9=_['merge']({},_0x3155c9,_0x4fff90['options']);return db[_0x87a5('0x3b')][_0x87a5('0x47')](_0x3155c9)[_0x87a5('0x3e')](handleEntityNotFound(_0x2cff59,null))[_0x87a5('0x3e')](respondWithResult(_0x2cff59,null))['catch'](handleError(_0x2cff59,null));};exports[_0x87a5('0x48')]=function(_0x2dc90b,_0x4bc032){return db[_0x87a5('0x3b')]['create'](_0x2dc90b[_0x87a5('0x49')],{})['then'](respondWithResult(_0x4bc032,0xc9))[_0x87a5('0x40')](handleError(_0x4bc032,null));};exports[_0x87a5('0x4a')]=function(_0x49743a,_0x138e2d){if(_0x49743a['body']['id']){delete _0x49743a[_0x87a5('0x49')]['id'];}return db[_0x87a5('0x3b')][_0x87a5('0x47')]({'where':{'id':_0x49743a[_0x87a5('0x42')]['id']}})[_0x87a5('0x3e')](handleEntityNotFound(_0x138e2d,null))[_0x87a5('0x3e')](saveUpdates(_0x49743a[_0x87a5('0x49')],null))[_0x87a5('0x3e')](respondWithResult(_0x138e2d,null))[_0x87a5('0x40')](handleError(_0x138e2d,null));};exports[_0x87a5('0x22')]=function(_0x38f953,_0x327791){return db[_0x87a5('0x3b')][_0x87a5('0x47')]({'where':{'id':_0x38f953[_0x87a5('0x42')]['id']}})[_0x87a5('0x3e')](handleEntityNotFound(_0x327791,null))[_0x87a5('0x3e')](removeEntity(_0x327791,null))[_0x87a5('0x40')](handleError(_0x327791,null));};exports[_0x87a5('0x4b')]=function(_0x4bb637,_0x5f36d7){return db[_0x87a5('0x3b')][_0x87a5('0x4b')]()['then'](respondWithResult(_0x5f36d7,null))[_0x87a5('0x40')](handleError(_0x5f36d7,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index f83e514..0d5a915 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x4bc53b,_0x39fc31){var _0x5743f5=function(_0x3db0ea){while(--_0x3db0ea){_0x4bc53b['push'](_0x4bc53b['shift']());}};_0x5743f5(++_0x39fc31);}(_0xe706,0xa3));var _0x6e70=function(_0xea17a7,_0x3f7d93){_0xea17a7=_0xea17a7-0x0;var _0x247ed5=_0xe706[_0xea17a7];return _0x247ed5;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 985c99e..b307a80 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 _0xf75a=['body','where','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','SmsQueueReport,\x20%s,\x20%s','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','then','stringify','UpdateSmsQueueReport','update'];(function(_0xd8bce9,_0x5bc6d4){var _0x5a43bb=function(_0xf281ff){while(--_0xf281ff){_0xd8bce9['push'](_0xd8bce9['shift']());}};_0x5a43bb(++_0x5bc6d4);}(_0xf75a,0x16e));var _0xaf75=function(_0x5a03fa,_0xcf3275){_0x5a03fa=_0x5a03fa-0x0;var _0x29e6c2=_0xf75a[_0x5a03fa];return _0x29e6c2;};'use strict';var _=require(_0xaf75('0x0'));var util=require(_0xaf75('0x1'));var moment=require(_0xaf75('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf75('0x3'));var fs=require('fs');var Redis=require(_0xaf75('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf75('0x5'));var logger=require(_0xaf75('0x6'))(_0xaf75('0x7'));var config=require(_0xaf75('0x8'));var jayson=require(_0xaf75('0x9'));var client=jayson[_0xaf75('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15b747,_0x466a86,_0x28b7ae){return new BPromise(function(_0x413e5e,_0x417105){return client['request'](_0x15b747,_0x28b7ae)['then'](function(_0x17d032){logger[_0xaf75('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x466a86,_0xaf75('0xc'));logger[_0xaf75('0xd')](_0xaf75('0xe'),_0x466a86,_0xaf75('0xc'),JSON['stringify'](_0x17d032));if(_0x17d032[_0xaf75('0xf')]){if(_0x17d032[_0xaf75('0xf')][_0xaf75('0x10')]===0x1f4){logger[_0xaf75('0xf')](_0xaf75('0x11'),_0x466a86,_0x17d032[_0xaf75('0xf')][_0xaf75('0x12')]);return _0x417105(_0x17d032['error']['message']);}logger['error'](_0xaf75('0x11'),_0x466a86,_0x17d032[_0xaf75('0xf')][_0xaf75('0x12')]);return _0x413e5e(_0x17d032['error'][_0xaf75('0x12')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x466a86,_0xaf75('0xc'));_0x413e5e(_0x17d032[_0xaf75('0x13')][_0xaf75('0x12')]);}})[_0xaf75('0x14')](function(_0x3ce063){logger[_0xaf75('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x466a86,_0x3ce063);_0x417105(_0x3ce063);});});}exports[_0xaf75('0x15')]=function(_0x1da83f){var _0x1b5044=this;return new Promise(function(_0x570e06,_0x52609d){return db[_0xaf75('0x16')][_0xaf75('0x17')](_0x1da83f['body'],{'raw':_0x1da83f[_0xaf75('0x18')]?_0x1da83f[_0xaf75('0x18')][_0xaf75('0x19')]===undefined?!![]:![]:!![]})[_0xaf75('0x1a')](function(_0x1240c2){logger[_0xaf75('0xb')](_0xaf75('0x15'),_0x1da83f);logger[_0xaf75('0xd')]('CreateSmsQueueReport',_0x1da83f,JSON[_0xaf75('0x1b')](_0x1240c2));_0x570e06(_0x1240c2);})['catch'](function(_0x58a792){logger[_0xaf75('0xf')](_0xaf75('0x15'),_0x58a792['message'],_0x1da83f);_0x52609d(_0x1b5044[_0xaf75('0xf')](0x1f4,_0x58a792[_0xaf75('0x12')]));});});};exports[_0xaf75('0x1c')]=function(_0x5d7f26){var _0x4ab0dc=this;return new Promise(function(_0x225b31,_0x459b6d){return db[_0xaf75('0x16')][_0xaf75('0x1d')](_0x5d7f26[_0xaf75('0x1e')],{'raw':_0x5d7f26['options']?_0x5d7f26[_0xaf75('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d7f26[_0xaf75('0x18')]?_0x5d7f26['options'][_0xaf75('0x1f')]||null:null,'attributes':_0x5d7f26['options']?_0x5d7f26[_0xaf75('0x18')]['attributes']||null:null,'limit':_0x5d7f26['options']?_0x5d7f26[_0xaf75('0x18')][_0xaf75('0x20')]||null:null})[_0xaf75('0x1a')](function(_0x143a85){logger[_0xaf75('0xb')](_0xaf75('0x1c'),_0x5d7f26);logger[_0xaf75('0xd')]('UpdateSmsQueueReport',_0x5d7f26,JSON[_0xaf75('0x1b')](_0x143a85));_0x225b31(_0x143a85);})[_0xaf75('0x14')](function(_0x51dc43){logger[_0xaf75('0xf')](_0xaf75('0x1c'),_0x51dc43[_0xaf75('0x12')],_0x5d7f26);_0x459b6d(_0x4ab0dc[_0xaf75('0xf')](0x1f4,_0x51dc43['message']));});});}; \ No newline at end of file +var _0x75ca=['update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','debug','catch','UpdateSmsQueueReport'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x75ca,0x1b3));var _0xa75c=function(_0x199bc4,_0x338105){_0x199bc4=_0x199bc4-0x0;var _0x136ffb=_0x75ca[_0x199bc4];return _0x136ffb;};'use strict';var _=require(_0xa75c('0x0'));var util=require(_0xa75c('0x1'));var moment=require(_0xa75c('0x2'));var BPromise=require(_0xa75c('0x3'));var rs=require(_0xa75c('0x4'));var fs=require('fs');var Redis=require(_0xa75c('0x5'));var db=require(_0xa75c('0x6'))['db'];var utils=require(_0xa75c('0x7'));var logger=require(_0xa75c('0x8'))(_0xa75c('0x9'));var config=require(_0xa75c('0xa'));var jayson=require(_0xa75c('0xb'));var client=jayson[_0xa75c('0xc')][_0xa75c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3b32eb,_0x3ad8f3,_0x116185){return new BPromise(function(_0x1006d4,_0x4c9db3){return client[_0xa75c('0xe')](_0x3b32eb,_0x116185)[_0xa75c('0xf')](function(_0x34f4f7){logger[_0xa75c('0x10')](_0xa75c('0x11'),_0x3ad8f3,_0xa75c('0x12'));logger['debug'](_0xa75c('0x13'),_0x3ad8f3,_0xa75c('0x12'),JSON[_0xa75c('0x14')](_0x34f4f7));if(_0x34f4f7[_0xa75c('0x15')]){if(_0x34f4f7[_0xa75c('0x15')]['code']===0x1f4){logger['error'](_0xa75c('0x11'),_0x3ad8f3,_0x34f4f7[_0xa75c('0x15')][_0xa75c('0x16')]);return _0x4c9db3(_0x34f4f7[_0xa75c('0x15')][_0xa75c('0x16')]);}logger[_0xa75c('0x15')](_0xa75c('0x11'),_0x3ad8f3,_0x34f4f7[_0xa75c('0x15')]['message']);return _0x1006d4(_0x34f4f7[_0xa75c('0x15')][_0xa75c('0x16')]);}else{logger['info'](_0xa75c('0x11'),_0x3ad8f3,'request\x20sent');_0x1006d4(_0x34f4f7[_0xa75c('0x17')][_0xa75c('0x16')]);}})['catch'](function(_0x139208){logger[_0xa75c('0x15')](_0xa75c('0x11'),_0x3ad8f3,_0x139208);_0x4c9db3(_0x139208);});});}exports[_0xa75c('0x18')]=function(_0x1e36dc){var _0x30a95e=this;return new Promise(function(_0x36dd51,_0x194778){return db[_0xa75c('0x19')][_0xa75c('0x1a')](_0x1e36dc[_0xa75c('0x1b')],{'raw':_0x1e36dc[_0xa75c('0x1c')]?_0x1e36dc['options'][_0xa75c('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x396ac0){logger[_0xa75c('0x10')](_0xa75c('0x18'),_0x1e36dc);logger[_0xa75c('0x1e')](_0xa75c('0x18'),_0x1e36dc,JSON['stringify'](_0x396ac0));_0x36dd51(_0x396ac0);})[_0xa75c('0x1f')](function(_0x2b042a){logger['error']('CreateSmsQueueReport',_0x2b042a[_0xa75c('0x16')],_0x1e36dc);_0x194778(_0x30a95e[_0xa75c('0x15')](0x1f4,_0x2b042a['message']));});});};exports[_0xa75c('0x20')]=function(_0x5ebf1f){var _0x347d17=this;return new Promise(function(_0x4aa886,_0x5c3b1a){return db[_0xa75c('0x19')][_0xa75c('0x21')](_0x5ebf1f[_0xa75c('0x1b')],{'raw':_0x5ebf1f[_0xa75c('0x1c')]?_0x5ebf1f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ebf1f['options']?_0x5ebf1f['options'][_0xa75c('0x22')]||null:null,'attributes':_0x5ebf1f[_0xa75c('0x1c')]?_0x5ebf1f[_0xa75c('0x1c')][_0xa75c('0x23')]||null:null,'limit':_0x5ebf1f[_0xa75c('0x1c')]?_0x5ebf1f[_0xa75c('0x1c')]['limit']||null:null})[_0xa75c('0xf')](function(_0x56b7e6){logger[_0xa75c('0x10')](_0xa75c('0x20'),_0x5ebf1f);logger[_0xa75c('0x1e')]('UpdateSmsQueueReport',_0x5ebf1f,JSON[_0xa75c('0x14')](_0x56b7e6));_0x4aa886(_0x56b7e6);})[_0xa75c('0x1f')](function(_0x3ee027){logger[_0xa75c('0x15')](_0xa75c('0x20'),_0x3ee027[_0xa75c('0x16')],_0x5ebf1f);_0x5c3b1a(_0x347d17[_0xa75c('0x15')](0x1f4,_0x3ee027[_0xa75c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 66490bf..0a49ede 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 _0xd8b1=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','/describe','isAuthenticated','describe','get','show','create','/:id','update','delete','destroy'];(function(_0x3f2228,_0x3b27d5){var _0x285ae4=function(_0x5e1f23){while(--_0x5e1f23){_0x3f2228['push'](_0x3f2228['shift']());}};_0x285ae4(++_0x3b27d5);}(_0xd8b1,0x105));var _0x1d8b=function(_0x42def7,_0x4a2e96){_0x42def7=_0x42def7-0x0;var _0x5d9971=_0xd8b1[_0x42def7];return _0x5d9971;};'use strict';var multer=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var path=require(_0x1d8b('0x2'));var timeout=require(_0x1d8b('0x3'));var express=require(_0x1d8b('0x4'));var router=express['Router']();var fs_extra=require(_0x1d8b('0x5'));var auth=require(_0x1d8b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1d8b('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1d8b('0x8')]);router['get'](_0x1d8b('0x9'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0xb')]);router[_0x1d8b('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x1d8b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1d8b('0xe')]);router['put'](_0x1d8b('0xf'),auth['isAuthenticated'](),controller[_0x1d8b('0x10')]);router[_0x1d8b('0x11')](_0x1d8b('0xf'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0x12')]);module[_0x1d8b('0x13')]=router; \ No newline at end of file +var _0xf9d5=['update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put'];(function(_0x2da825,_0x43099c){var _0x5a8a19=function(_0x4ad62e){while(--_0x4ad62e){_0x2da825['push'](_0x2da825['shift']());}};_0x5a8a19(++_0x43099c);}(_0xf9d5,0x122));var _0x5f9d=function(_0x56df36,_0x563414){_0x56df36=_0x56df36-0x0;var _0x5138c7=_0xf9d5[_0x56df36];return _0x5138c7;};'use strict';var multer=require('multer');var util=require(_0x5f9d('0x0'));var path=require(_0x5f9d('0x1'));var timeout=require('connect-timeout');var express=require(_0x5f9d('0x2'));var router=express[_0x5f9d('0x3')]();var fs_extra=require(_0x5f9d('0x4'));var auth=require(_0x5f9d('0x5'));var interaction=require(_0x5f9d('0x6'));var config=require(_0x5f9d('0x7'));var controller=require(_0x5f9d('0x8'));router['get']('/',auth[_0x5f9d('0x9')](),controller['index']);router[_0x5f9d('0xa')](_0x5f9d('0xb'),auth['isAuthenticated'](),controller[_0x5f9d('0xc')]);router[_0x5f9d('0xa')](_0x5f9d('0xd'),auth[_0x5f9d('0x9')](),controller[_0x5f9d('0xe')]);router[_0x5f9d('0xf')]('/',auth['isAuthenticated'](),controller[_0x5f9d('0x10')]);router[_0x5f9d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x5f9d('0x12')]);router[_0x5f9d('0x13')](_0x5f9d('0xd'),auth['isAuthenticated'](),controller[_0x5f9d('0x14')]);module[_0x5f9d('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index b7a407d..cd09061 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x57db4c,_0x8f9084){var _0x1758f2=function(_0x141a33){while(--_0x141a33){_0x57db4c['push'](_0x57db4c['shift']());}};_0x1758f2(++_0x8f9084);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x231dda,_0x5b04cc){var _0x3f88cb=function(_0x16eb77){while(--_0x16eb77){_0x231dda['push'](_0x231dda['shift']());}};_0x3f88cb(++_0x5b04cc);}(_0xb43b,0x1b2));var _0xbb43=function(_0x33fbad,_0x382139){_0x33fbad=_0x33fbad-0x0;var _0x100c5c=_0xb43b[_0x33fbad];return _0x100c5c;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index a5ff1f7..e0cba05 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 _0x2094=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','type','VIRTUAL','filter','merge','options','SmsTransferReport','includeAll','findAll','rows','params','include','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','intersection'];(function(_0x1789b4,_0x406949){var _0x28211f=function(_0x9f022b){while(--_0x9f022b){_0x1789b4['push'](_0x1789b4['shift']());}};_0x28211f(++_0x406949);}(_0x2094,0x180));var _0x4209=function(_0x1b2ff2,_0x2a965d){_0x1b2ff2=_0x1b2ff2-0x0;var _0x373890=_0x2094[_0x1b2ff2];return _0x373890;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4209('0x0'));var zipdir=require(_0x4209('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4209('0x2'));var moment=require(_0x4209('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4209('0x4'));var path=require('path');var sox=require(_0x4209('0x5'));var csv=require(_0x4209('0x6'));var ejs=require(_0x4209('0x7'));var fs=require('fs');var fs_extra=require(_0x4209('0x8'));var _=require(_0x4209('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4209('0xa'));var toCsv=require(_0x4209('0x6'));var querystring=require(_0x4209('0xb'));var Papa=require(_0x4209('0xc'));var Redis=require(_0x4209('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4209('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4209('0xf'))(_0x4209('0x10'));var utils=require(_0x4209('0x11'));var config=require(_0x4209('0x12'));var licenseUtil=require(_0x4209('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18183f,_0x3cd48d){_0x3cd48d=_0x3cd48d||0xcc;return function(_0xaf210b){if(_0xaf210b){return _0x18183f[_0x4209('0x14')](_0x3cd48d);}return _0x18183f[_0x4209('0x15')](_0x3cd48d)[_0x4209('0x16')]();};}function respondWithResult(_0x52713a,_0x5b6879){_0x5b6879=_0x5b6879||0xc8;return function(_0x545597){if(_0x545597){return _0x52713a[_0x4209('0x15')](_0x5b6879)[_0x4209('0x17')](_0x545597);}};}function respondWithFilteredResult(_0x2ade5f,_0xa4e576){return function(_0x38782e){if(_0x38782e){var _0xdefa0d=typeof _0xa4e576[_0x4209('0x18')]===_0x4209('0x19')&&typeof _0xa4e576['limit']===_0x4209('0x19');var _0x88e0a=_0x38782e[_0x4209('0x1a')];var _0x5466a0=_0xdefa0d?0x0:_0xa4e576['offset'];var _0x38dc22=_0xdefa0d?_0x38782e[_0x4209('0x1a')]:_0xa4e576['offset']+_0xa4e576[_0x4209('0x1b')];var _0x189dd4;if(_0x38dc22>=_0x88e0a){_0x38dc22=_0x88e0a;_0x189dd4=0xc8;}else{_0x189dd4=0xce;}_0x2ade5f[_0x4209('0x15')](_0x189dd4);return _0x2ade5f[_0x4209('0x1c')](_0x4209('0x1d'),_0x5466a0+'-'+_0x38dc22+'/'+_0x88e0a)['json'](_0x38782e);}return null;};}function patchUpdates(_0x1f022b){return function(_0xdff946){try{jsonpatch[_0x4209('0x1e')](_0xdff946,_0x1f022b,!![]);}catch(_0x28015e){return BPromise[_0x4209('0x1f')](_0x28015e);}return _0xdff946[_0x4209('0x20')]();};}function saveUpdates(_0x36ff64,_0x467f49){return function(_0x25e088){if(_0x25e088){return _0x25e088[_0x4209('0x21')](_0x36ff64)['then'](function(_0x58533a){return _0x58533a;});}return null;};}function removeEntity(_0x2a9cb9,_0xb01884){return function(_0x2f839e){if(_0x2f839e){return _0x2f839e[_0x4209('0x22')]()[_0x4209('0x23')](function(){_0x2a9cb9[_0x4209('0x15')](0xcc)[_0x4209('0x16')]();});}};}function handleEntityNotFound(_0x129717,_0x52f7e2){return function(_0x5eac9a){if(!_0x5eac9a){_0x129717[_0x4209('0x14')](0x194);}return _0x5eac9a;};}function handleError(_0x14786a,_0x5f1548){_0x5f1548=_0x5f1548||0x1f4;return function(_0x5ebede){logger[_0x4209('0x24')](_0x5ebede['stack']);if(_0x5ebede[_0x4209('0x25')]){delete _0x5ebede[_0x4209('0x25')];}_0x14786a[_0x4209('0x15')](_0x5f1548)[_0x4209('0x26')](_0x5ebede);};}exports[_0x4209('0x27')]=function(_0x567f70,_0x3b17e1){var _0x25f57b={},_0x29d8c6={},_0x3204b4={'count':0x0,'rows':[]};var _0x15da96=_['map'](db['SmsTransferReport'][_0x4209('0x28')],function(_0x1d12e3){return{'name':_0x1d12e3[_0x4209('0x29')],'type':_0x1d12e3['type'][_0x4209('0x2a')]};});_0x29d8c6[_0x4209('0x2b')]=_[_0x4209('0x2c')](_0x15da96,_0x4209('0x25'));_0x29d8c6[_0x4209('0x2d')]=_[_0x4209('0x2e')](_0x567f70[_0x4209('0x2d')]);_0x29d8c6['filters']=_[_0x4209('0x2f')](_0x29d8c6['model'],_0x29d8c6[_0x4209('0x2d')]);_0x25f57b[_0x4209('0x30')]=_[_0x4209('0x2f')](_0x29d8c6[_0x4209('0x2b')],qs[_0x4209('0x31')](_0x567f70['query'][_0x4209('0x31')]));_0x25f57b[_0x4209('0x30')]=_0x25f57b[_0x4209('0x30')][_0x4209('0x32')]?_0x25f57b[_0x4209('0x30')]:_0x29d8c6[_0x4209('0x2b')];if(!_0x567f70[_0x4209('0x2d')][_0x4209('0x33')](_0x4209('0x34'))){_0x25f57b['limit']=qs[_0x4209('0x1b')](_0x567f70[_0x4209('0x2d')]['limit']);_0x25f57b[_0x4209('0x18')]=qs[_0x4209('0x18')](_0x567f70[_0x4209('0x2d')]['offset']);}_0x25f57b['order']=qs[_0x4209('0x35')](_0x567f70[_0x4209('0x2d')][_0x4209('0x35')]);_0x25f57b[_0x4209('0x36')]=qs[_0x4209('0x37')](_['pick'](_0x567f70['query'],_0x29d8c6['filters']),_0x15da96);if(_0x567f70[_0x4209('0x2d')]['filter']){_0x25f57b[_0x4209('0x36')]=_['merge'](_0x25f57b[_0x4209('0x36')],{'$or':_[_0x4209('0x2c')](_0x15da96,function(_0x34fb51){if(_0x34fb51[_0x4209('0x38')]!==_0x4209('0x39')){var _0x1c20b7={};_0x1c20b7[_0x34fb51['name']]={'$like':'%'+_0x567f70[_0x4209('0x2d')][_0x4209('0x3a')]+'%'};return _0x1c20b7;}})});}_0x25f57b=_[_0x4209('0x3b')]({},_0x25f57b,_0x567f70[_0x4209('0x3c')]);var _0x3cc584={'where':_0x25f57b[_0x4209('0x36')]};return db[_0x4209('0x3d')][_0x4209('0x1a')](_0x3cc584)[_0x4209('0x23')](function(_0x52945a){_0x3204b4[_0x4209('0x1a')]=_0x52945a;if(_0x567f70[_0x4209('0x2d')][_0x4209('0x3e')]){_0x25f57b['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x4209('0x3f')](_0x25f57b);})[_0x4209('0x23')](function(_0x1c90aa){_0x3204b4[_0x4209('0x40')]=_0x1c90aa;return _0x3204b4;})[_0x4209('0x23')](respondWithFilteredResult(_0x3b17e1,_0x25f57b))['catch'](handleError(_0x3b17e1,null));};exports['show']=function(_0xedabe0,_0x36d4){var _0x2606dd={'raw':!![],'where':{'id':_0xedabe0[_0x4209('0x41')]['id']}},_0x3ebdbc={};_0x3ebdbc[_0x4209('0x2b')]=_[_0x4209('0x2e')](db[_0x4209('0x3d')][_0x4209('0x28')]);_0x3ebdbc[_0x4209('0x2d')]=_[_0x4209('0x2e')](_0xedabe0[_0x4209('0x2d')]);_0x3ebdbc[_0x4209('0x37')]=_[_0x4209('0x2f')](_0x3ebdbc[_0x4209('0x2b')],_0x3ebdbc['query']);_0x2606dd[_0x4209('0x30')]=_[_0x4209('0x2f')](_0x3ebdbc['model'],qs['fields'](_0xedabe0[_0x4209('0x2d')][_0x4209('0x31')]));_0x2606dd[_0x4209('0x30')]=_0x2606dd[_0x4209('0x30')][_0x4209('0x32')]?_0x2606dd[_0x4209('0x30')]:_0x3ebdbc[_0x4209('0x2b')];if(_0xedabe0['query'][_0x4209('0x3e')]){_0x2606dd[_0x4209('0x42')]=[{'all':!![]}];}_0x2606dd=_[_0x4209('0x3b')]({},_0x2606dd,_0xedabe0[_0x4209('0x3c')]);return db['SmsTransferReport'][_0x4209('0x43')](_0x2606dd)[_0x4209('0x23')](handleEntityNotFound(_0x36d4,null))[_0x4209('0x23')](respondWithResult(_0x36d4,null))[_0x4209('0x44')](handleError(_0x36d4,null));};exports[_0x4209('0x45')]=function(_0x156bc7,_0x413792){return db[_0x4209('0x3d')][_0x4209('0x45')](_0x156bc7[_0x4209('0x46')],{})['then'](respondWithResult(_0x413792,0xc9))['catch'](handleError(_0x413792,null));};exports[_0x4209('0x21')]=function(_0x4e5062,_0x4f1fcb){if(_0x4e5062[_0x4209('0x46')]['id']){delete _0x4e5062[_0x4209('0x46')]['id'];}return db[_0x4209('0x3d')][_0x4209('0x43')]({'where':{'id':_0x4e5062[_0x4209('0x41')]['id']}})[_0x4209('0x23')](handleEntityNotFound(_0x4f1fcb,null))[_0x4209('0x23')](saveUpdates(_0x4e5062[_0x4209('0x46')],null))[_0x4209('0x23')](respondWithResult(_0x4f1fcb,null))[_0x4209('0x44')](handleError(_0x4f1fcb,null));};exports[_0x4209('0x22')]=function(_0xa1b6ff,_0x199bae){return db[_0x4209('0x3d')][_0x4209('0x43')]({'where':{'id':_0xa1b6ff[_0x4209('0x41')]['id']}})[_0x4209('0x23')](handleEntityNotFound(_0x199bae,null))[_0x4209('0x23')](removeEntity(_0x199bae,null))['catch'](handleError(_0x199bae,null));};exports[_0x4209('0x47')]=function(_0x27d87e,_0x40ddc3){return db['SmsTransferReport'][_0x4209('0x47')]()[_0x4209('0x23')](respondWithResult(_0x40ddc3,null))['catch'](handleError(_0x40ddc3,null));}; \ No newline at end of file +var _0x0022=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','pick','filters','map','VIRTUAL','filter','options','includeAll','include','SmsTransferReport','findAll','rows','catch','show','params','length','merge','find','create','body','describe','eml-format','rimraf','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x3b64d0,_0x2a2518){var _0x5e1a1d=function(_0x2287c7){while(--_0x2287c7){_0x3b64d0['push'](_0x3b64d0['shift']());}};_0x5e1a1d(++_0x2a2518);}(_0x0022,0x8b));var _0x2002=function(_0x5c36e5,_0x5f3c6e){_0x5c36e5=_0x5c36e5-0x0;var _0x6e8714=_0x0022[_0x5c36e5];return _0x6e8714;};'use strict';var emlformat=require(_0x2002('0x0'));var rimraf=require(_0x2002('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2002('0x2'));var BPromise=require(_0x2002('0x3'));var Mustache=require(_0x2002('0x4'));var util=require('util');var path=require(_0x2002('0x5'));var sox=require(_0x2002('0x6'));var csv=require('to-csv');var ejs=require(_0x2002('0x7'));var fs=require('fs');var fs_extra=require(_0x2002('0x8'));var _=require(_0x2002('0x9'));var squel=require(_0x2002('0xa'));var crypto=require('crypto');var jsforce=require(_0x2002('0xb'));var deskjs=require(_0x2002('0xc'));var toCsv=require(_0x2002('0xd'));var querystring=require(_0x2002('0xe'));var Papa=require(_0x2002('0xf'));var Redis=require(_0x2002('0x10'));var authService=require(_0x2002('0x11'));var qs=require(_0x2002('0x12'));var as=require(_0x2002('0x13'));var hardwareService=require(_0x2002('0x14'));var logger=require(_0x2002('0x15'))('api');var utils=require(_0x2002('0x16'));var config=require(_0x2002('0x17'));var licenseUtil=require(_0x2002('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdffb1e,_0x1a4349){_0x1a4349=_0x1a4349||0xcc;return function(_0x148315){if(_0x148315){return _0xdffb1e[_0x2002('0x19')](_0x1a4349);}return _0xdffb1e[_0x2002('0x1a')](_0x1a4349)[_0x2002('0x1b')]();};}function respondWithResult(_0x56ea41,_0x2c0db3){_0x2c0db3=_0x2c0db3||0xc8;return function(_0x14ef99){if(_0x14ef99){return _0x56ea41[_0x2002('0x1a')](_0x2c0db3)[_0x2002('0x1c')](_0x14ef99);}};}function respondWithFilteredResult(_0x167923,_0x2fc9b8){return function(_0x503e26){if(_0x503e26){var _0xd7004a=typeof _0x2fc9b8[_0x2002('0x1d')]===_0x2002('0x1e')&&typeof _0x2fc9b8[_0x2002('0x1f')]===_0x2002('0x1e');var _0x1a7c86=_0x503e26[_0x2002('0x20')];var _0x659941=_0xd7004a?0x0:_0x2fc9b8[_0x2002('0x1d')];var _0x16042c=_0xd7004a?_0x503e26[_0x2002('0x20')]:_0x2fc9b8['offset']+_0x2fc9b8[_0x2002('0x1f')];var _0x1cd30b;if(_0x16042c>=_0x1a7c86){_0x16042c=_0x1a7c86;_0x1cd30b=0xc8;}else{_0x1cd30b=0xce;}_0x167923['status'](_0x1cd30b);return _0x167923[_0x2002('0x21')](_0x2002('0x22'),_0x659941+'-'+_0x16042c+'/'+_0x1a7c86)['json'](_0x503e26);}return null;};}function patchUpdates(_0x90c833){return function(_0x2b2c86){try{jsonpatch[_0x2002('0x23')](_0x2b2c86,_0x90c833,!![]);}catch(_0x38ab38){return BPromise['reject'](_0x38ab38);}return _0x2b2c86[_0x2002('0x24')]();};}function saveUpdates(_0x12824f,_0x162945){return function(_0x2c01ff){if(_0x2c01ff){return _0x2c01ff[_0x2002('0x25')](_0x12824f)['then'](function(_0x1ff3d6){return _0x1ff3d6;});}return null;};}function removeEntity(_0x3d29de,_0x243bce){return function(_0x51cf9d){if(_0x51cf9d){return _0x51cf9d[_0x2002('0x26')]()[_0x2002('0x27')](function(){_0x3d29de[_0x2002('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17fb0c,_0x3e8d48){return function(_0x59c2c5){if(!_0x59c2c5){_0x17fb0c[_0x2002('0x19')](0x194);}return _0x59c2c5;};}function handleError(_0x4b3c1d,_0x10ba5f){_0x10ba5f=_0x10ba5f||0x1f4;return function(_0x812eb8){logger[_0x2002('0x28')](_0x812eb8[_0x2002('0x29')]);if(_0x812eb8['name']){delete _0x812eb8[_0x2002('0x2a')];}_0x4b3c1d['status'](_0x10ba5f)[_0x2002('0x2b')](_0x812eb8);};}exports['index']=function(_0x49c9a4,_0x5f47c4){var _0x5b759a={},_0x4e678b={},_0x344ede={'count':0x0,'rows':[]};var _0x66c73b=_['map'](db['SmsTransferReport'][_0x2002('0x2c')],function(_0x594c45){return{'name':_0x594c45['fieldName'],'type':_0x594c45[_0x2002('0x2d')][_0x2002('0x2e')]};});_0x4e678b[_0x2002('0x2f')]=_['map'](_0x66c73b,'name');_0x4e678b[_0x2002('0x30')]=_[_0x2002('0x31')](_0x49c9a4[_0x2002('0x30')]);_0x4e678b['filters']=_[_0x2002('0x32')](_0x4e678b['model'],_0x4e678b[_0x2002('0x30')]);_0x5b759a[_0x2002('0x33')]=_[_0x2002('0x32')](_0x4e678b[_0x2002('0x2f')],qs[_0x2002('0x34')](_0x49c9a4[_0x2002('0x30')][_0x2002('0x34')]));_0x5b759a[_0x2002('0x33')]=_0x5b759a[_0x2002('0x33')]['length']?_0x5b759a[_0x2002('0x33')]:_0x4e678b['model'];if(!_0x49c9a4[_0x2002('0x30')]['hasOwnProperty'](_0x2002('0x35'))){_0x5b759a[_0x2002('0x1f')]=qs['limit'](_0x49c9a4[_0x2002('0x30')][_0x2002('0x1f')]);_0x5b759a['offset']=qs[_0x2002('0x1d')](_0x49c9a4[_0x2002('0x30')]['offset']);}_0x5b759a['order']=qs['sort'](_0x49c9a4[_0x2002('0x30')][_0x2002('0x36')]);_0x5b759a[_0x2002('0x37')]=qs['filters'](_[_0x2002('0x38')](_0x49c9a4[_0x2002('0x30')],_0x4e678b[_0x2002('0x39')]),_0x66c73b);if(_0x49c9a4[_0x2002('0x30')]['filter']){_0x5b759a['where']=_['merge'](_0x5b759a[_0x2002('0x37')],{'$or':_[_0x2002('0x3a')](_0x66c73b,function(_0x31eaca){if(_0x31eaca['type']!==_0x2002('0x3b')){var _0x2d960b={};_0x2d960b[_0x31eaca[_0x2002('0x2a')]]={'$like':'%'+_0x49c9a4[_0x2002('0x30')][_0x2002('0x3c')]+'%'};return _0x2d960b;}})});}_0x5b759a=_['merge']({},_0x5b759a,_0x49c9a4[_0x2002('0x3d')]);var _0x4404b1={'where':_0x5b759a[_0x2002('0x37')]};return db['SmsTransferReport']['count'](_0x4404b1)['then'](function(_0x2b308f){_0x344ede[_0x2002('0x20')]=_0x2b308f;if(_0x49c9a4[_0x2002('0x30')][_0x2002('0x3e')]){_0x5b759a[_0x2002('0x3f')]=[{'all':!![]}];}return db[_0x2002('0x40')][_0x2002('0x41')](_0x5b759a);})[_0x2002('0x27')](function(_0xfaff98){_0x344ede[_0x2002('0x42')]=_0xfaff98;return _0x344ede;})[_0x2002('0x27')](respondWithFilteredResult(_0x5f47c4,_0x5b759a))[_0x2002('0x43')](handleError(_0x5f47c4,null));};exports[_0x2002('0x44')]=function(_0xcc901e,_0xec39e9){var _0x541617={'raw':!![],'where':{'id':_0xcc901e[_0x2002('0x45')]['id']}},_0x379dcf={};_0x379dcf[_0x2002('0x2f')]=_[_0x2002('0x31')](db['SmsTransferReport'][_0x2002('0x2c')]);_0x379dcf[_0x2002('0x30')]=_[_0x2002('0x31')](_0xcc901e['query']);_0x379dcf[_0x2002('0x39')]=_[_0x2002('0x32')](_0x379dcf[_0x2002('0x2f')],_0x379dcf[_0x2002('0x30')]);_0x541617[_0x2002('0x33')]=_[_0x2002('0x32')](_0x379dcf[_0x2002('0x2f')],qs['fields'](_0xcc901e[_0x2002('0x30')]['fields']));_0x541617['attributes']=_0x541617['attributes'][_0x2002('0x46')]?_0x541617[_0x2002('0x33')]:_0x379dcf[_0x2002('0x2f')];if(_0xcc901e['query'][_0x2002('0x3e')]){_0x541617[_0x2002('0x3f')]=[{'all':!![]}];}_0x541617=_[_0x2002('0x47')]({},_0x541617,_0xcc901e['options']);return db['SmsTransferReport'][_0x2002('0x48')](_0x541617)['then'](handleEntityNotFound(_0xec39e9,null))['then'](respondWithResult(_0xec39e9,null))[_0x2002('0x43')](handleError(_0xec39e9,null));};exports[_0x2002('0x49')]=function(_0x2bdbdf,_0x253856){return db[_0x2002('0x40')][_0x2002('0x49')](_0x2bdbdf[_0x2002('0x4a')],{})[_0x2002('0x27')](respondWithResult(_0x253856,0xc9))[_0x2002('0x43')](handleError(_0x253856,null));};exports[_0x2002('0x25')]=function(_0x5bfe2c,_0x3b9b35){if(_0x5bfe2c[_0x2002('0x4a')]['id']){delete _0x5bfe2c[_0x2002('0x4a')]['id'];}return db[_0x2002('0x40')][_0x2002('0x48')]({'where':{'id':_0x5bfe2c[_0x2002('0x45')]['id']}})[_0x2002('0x27')](handleEntityNotFound(_0x3b9b35,null))[_0x2002('0x27')](saveUpdates(_0x5bfe2c[_0x2002('0x4a')],null))['then'](respondWithResult(_0x3b9b35,null))['catch'](handleError(_0x3b9b35,null));};exports[_0x2002('0x26')]=function(_0x461d92,_0xcdd555){return db[_0x2002('0x40')][_0x2002('0x48')]({'where':{'id':_0x461d92[_0x2002('0x45')]['id']}})['then'](handleEntityNotFound(_0xcdd555,null))['then'](removeEntity(_0xcdd555,null))[_0x2002('0x43')](handleError(_0xcdd555,null));};exports['describe']=function(_0x1f7568,_0x4d0ae4){return db[_0x2002('0x40')][_0x2002('0x4b')]()[_0x2002('0x27')](respondWithResult(_0x4d0ae4,null))['catch'](handleError(_0x4d0ae4,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 0ca9842..00bbe70 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 _0x8eba=['request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api','moment'];(function(_0x491f9b,_0x3aaa43){var _0x24b994=function(_0x33f2d6){while(--_0x33f2d6){_0x491f9b['push'](_0x491f9b['shift']());}};_0x24b994(++_0x3aaa43);}(_0x8eba,0xf3));var _0xa8eb=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0x8eba[_0xa28b1a];return _0x4c9b78;};'use strict';var _=require(_0xa8eb('0x0'));var util=require(_0xa8eb('0x1'));var logger=require('../../config/logger')(_0xa8eb('0x2'));var moment=require(_0xa8eb('0x3'));var BPromise=require('bluebird');var rp=require(_0xa8eb('0x4'));var fs=require('fs');var path=require(_0xa8eb('0x5'));var rimraf=require(_0xa8eb('0x6'));var config=require(_0xa8eb('0x7'));var attributes=require(_0xa8eb('0x8'));module['exports']=function(_0x10e097,_0x220ba6){return _0x10e097[_0xa8eb('0x9')](_0xa8eb('0xa'),attributes,{'tableName':_0xa8eb('0xb'),'paranoid':![],'indexes':[{'name':_0xa8eb('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf474=['../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x26a11c,_0x28b775){var _0x11be9a=function(_0x109901){while(--_0x109901){_0x26a11c['push'](_0x26a11c['shift']());}};_0x11be9a(++_0x28b775);}(_0xf474,0x13e));var _0x4f47=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xf474[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x4f47('0x0'));var util=require('util');var logger=require(_0x4f47('0x1'))(_0x4f47('0x2'));var moment=require(_0x4f47('0x3'));var BPromise=require(_0x4f47('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f47('0x5'));var rimraf=require(_0x4f47('0x6'));var config=require(_0x4f47('0x7'));var attributes=require(_0x4f47('0x8'));module['exports']=function(_0x1d2896,_0x59b844){return _0x1d2896[_0x4f47('0x9')](_0x4f47('0xa'),attributes,{'tableName':_0x4f47('0xb'),'paranoid':![],'indexes':[{'name':_0x4f47('0xc'),'fields':[_0x4f47('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index c89b6b0..9680c95 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 _0xa87e=['then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x25c4ba,_0x5645ea){var _0x415249=function(_0x2d5afd){while(--_0x2d5afd){_0x25c4ba['push'](_0x25c4ba['shift']());}};_0x415249(++_0x5645ea);}(_0xa87e,0x1c2));var _0xea87=function(_0x514285,_0x12075b){_0x514285=_0x514285-0x0;var _0x5e2bb4=_0xa87e[_0x514285];return _0x5e2bb4;};'use strict';var _=require(_0xea87('0x0'));var util=require(_0xea87('0x1'));var moment=require(_0xea87('0x2'));var BPromise=require(_0xea87('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea87('0x4'));var db=require(_0xea87('0x5'))['db'];var utils=require(_0xea87('0x6'));var logger=require('../../config/logger')(_0xea87('0x7'));var config=require(_0xea87('0x8'));var jayson=require(_0xea87('0x9'));var client=jayson[_0xea87('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa4b0bc,_0x329f85,_0x284019){return new BPromise(function(_0x415772,_0xe43a6a){return client[_0xea87('0xb')](_0xa4b0bc,_0x284019)[_0xea87('0xc')](function(_0x36d16c){logger[_0xea87('0xd')](_0xea87('0xe'),_0x329f85,_0xea87('0xf'));logger[_0xea87('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x329f85,_0xea87('0xf'),JSON[_0xea87('0x11')](_0x36d16c));if(_0x36d16c[_0xea87('0x12')]){if(_0x36d16c['error'][_0xea87('0x13')]===0x1f4){logger['error'](_0xea87('0xe'),_0x329f85,_0x36d16c[_0xea87('0x12')][_0xea87('0x14')]);return _0xe43a6a(_0x36d16c['error'][_0xea87('0x14')]);}logger[_0xea87('0x12')](_0xea87('0xe'),_0x329f85,_0x36d16c[_0xea87('0x12')][_0xea87('0x14')]);return _0x415772(_0x36d16c[_0xea87('0x12')][_0xea87('0x14')]);}else{logger['info'](_0xea87('0xe'),_0x329f85,'request\x20sent');_0x415772(_0x36d16c['result']['message']);}})['catch'](function(_0x27be9b){logger[_0xea87('0x12')](_0xea87('0xe'),_0x329f85,_0x27be9b);_0xe43a6a(_0x27be9b);});});} \ No newline at end of file +var _0xc92f=['request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x42fc8e,_0x26620d){var _0x4ad7b5=function(_0x4b217b){while(--_0x4b217b){_0x42fc8e['push'](_0x42fc8e['shift']());}};_0x4ad7b5(++_0x26620d);}(_0xc92f,0xf3));var _0xfc92=function(_0x151a67,_0x522ab4){_0x151a67=_0x151a67-0x0;var _0xaf97c0=_0xc92f[_0x151a67];return _0xaf97c0;};'use strict';var _=require(_0xfc92('0x0'));var util=require(_0xfc92('0x1'));var moment=require('moment');var BPromise=require(_0xfc92('0x2'));var rs=require(_0xfc92('0x3'));var fs=require('fs');var Redis=require(_0xfc92('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc92('0x5'));var logger=require(_0xfc92('0x6'))(_0xfc92('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfc92('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x394026,_0x4e578a,_0xd80968){return new BPromise(function(_0x49db29,_0x432982){return client[_0xfc92('0x9')](_0x394026,_0xd80968)[_0xfc92('0xa')](function(_0x4f37f2){logger[_0xfc92('0xb')](_0xfc92('0xc'),_0x4e578a,_0xfc92('0xd'));logger['debug'](_0xfc92('0xe'),_0x4e578a,_0xfc92('0xd'),JSON[_0xfc92('0xf')](_0x4f37f2));if(_0x4f37f2[_0xfc92('0x10')]){if(_0x4f37f2[_0xfc92('0x10')][_0xfc92('0x11')]===0x1f4){logger[_0xfc92('0x10')](_0xfc92('0xc'),_0x4e578a,_0x4f37f2[_0xfc92('0x10')][_0xfc92('0x12')]);return _0x432982(_0x4f37f2[_0xfc92('0x10')][_0xfc92('0x12')]);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x4e578a,_0x4f37f2['error'][_0xfc92('0x12')]);return _0x49db29(_0x4f37f2[_0xfc92('0x10')]['message']);}else{logger[_0xfc92('0xb')](_0xfc92('0xc'),_0x4e578a,_0xfc92('0xd'));_0x49db29(_0x4f37f2[_0xfc92('0x13')][_0xfc92('0x12')]);}})[_0xfc92('0x14')](function(_0x492d40){logger[_0xfc92('0x10')](_0xfc92('0xc'),_0x4e578a,_0x492d40);_0x432982(_0x492d40);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 5166498..d9e3516 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 _0x741b=['post','single','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','format','%s-%s%s','basename','now'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x741b,0x187));var _0xb741=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x741b[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xb741('0x0'));var util=require(_0xb741('0x1'));var path=require(_0xb741('0x2'));var timeout=require(_0xb741('0x3'));var express=require(_0xb741('0x4'));var router=express[_0xb741('0x5')]();var fs_extra=require(_0xb741('0x6'));var auth=require(_0xb741('0x7'));var interaction=require(_0xb741('0x8'));var config=require(_0xb741('0x9'));var controller=require('./sound.controller');router[_0xb741('0xa')]('/',auth['isAuthenticated'](),controller[_0xb741('0xb')]);router[_0xb741('0xa')](_0xb741('0xc'),auth[_0xb741('0xd')](),controller[_0xb741('0xe')]);router[_0xb741('0xa')](_0xb741('0xf'),auth[_0xb741('0xd')](),controller[_0xb741('0x10')]);var upload=multer({'storage':multer[_0xb741('0x11')]({'destination':function(_0x23c1c6,_0x3da1da,_0x540ee9){_0x540ee9(null,path[_0xb741('0x12')](config['root'],_0xb741('0x13')));},'filename':function(_0x34cbd6,_0x3cc96a,_0x564db0){_0x3cc96a['originalname']=_0x3cc96a[_0xb741('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x564db0(null,util[_0xb741('0x15')](_0xb741('0x16'),path[_0xb741('0x17')](_0x3cc96a['originalname'],path['extname'](_0x3cc96a['originalname'])),Date[_0xb741('0x18')](),path['extname'](_0x3cc96a['originalname'])));}})});router[_0xb741('0x19')]('/',upload[_0xb741('0x1a')]('file'),controller[_0xb741('0x1b')]);router[_0xb741('0x1c')](_0xb741('0xc'),auth[_0xb741('0xd')](),controller[_0xb741('0x1d')]);router[_0xb741('0x1e')](_0xb741('0xc'),auth[_0xb741('0xd')](),controller[_0xb741('0x1e')]);module[_0xb741('0x1f')]=router; \ No newline at end of file +var _0xf6fb=['create','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','single'];(function(_0x4d06fb,_0x55390d){var _0x2e42fc=function(_0x543897){while(--_0x543897){_0x4d06fb['push'](_0x4d06fb['shift']());}};_0x2e42fc(++_0x55390d);}(_0xf6fb,0x84));var _0xbf6f=function(_0x366aa4,_0x4cccaa){_0x366aa4=_0x366aa4-0x0;var _0x4a2695=_0xf6fb[_0x366aa4];return _0x4a2695;};'use strict';var multer=require(_0xbf6f('0x0'));var util=require(_0xbf6f('0x1'));var path=require(_0xbf6f('0x2'));var timeout=require(_0xbf6f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbf6f('0x4'));var auth=require(_0xbf6f('0x5'));var interaction=require(_0xbf6f('0x6'));var config=require(_0xbf6f('0x7'));var controller=require(_0xbf6f('0x8'));router['get']('/',auth[_0xbf6f('0x9')](),controller[_0xbf6f('0xa')]);router[_0xbf6f('0xb')](_0xbf6f('0xc'),auth['isAuthenticated'](),controller[_0xbf6f('0xd')]);router['get'](_0xbf6f('0xe'),auth[_0xbf6f('0x9')](),controller[_0xbf6f('0xf')]);var upload=multer({'storage':multer[_0xbf6f('0x10')]({'destination':function(_0x1be26c,_0x3b30d9,_0x29a2a8){_0x29a2a8(null,path[_0xbf6f('0x11')](config[_0xbf6f('0x12')],'server/files/sounds/original/'));},'filename':function(_0x51946c,_0xebd7f0,_0x4b7f83){_0xebd7f0[_0xbf6f('0x13')]=_0xebd7f0[_0xbf6f('0x13')][_0xbf6f('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4b7f83(null,util[_0xbf6f('0x15')](_0xbf6f('0x16'),path[_0xbf6f('0x17')](_0xebd7f0[_0xbf6f('0x13')],path[_0xbf6f('0x18')](_0xebd7f0['originalname'])),Date[_0xbf6f('0x19')](),path['extname'](_0xebd7f0['originalname'])));}})});router[_0xbf6f('0x1a')]('/',upload[_0xbf6f('0x1b')]('file'),controller[_0xbf6f('0x1c')]);router['put'](_0xbf6f('0xc'),auth[_0xbf6f('0x9')](),controller[_0xbf6f('0x1d')]);router['delete'](_0xbf6f('0xc'),auth[_0xbf6f('0x9')](),controller[_0xbf6f('0x1e')]);module[_0xbf6f('0x1f')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index c9f30ef..74830a2 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 _0x1b58=['name','STRING','FLOAT','INTEGER','BIGINT','exports'];(function(_0xba382f,_0x103ad2){var _0x139b7b=function(_0x537a1b){while(--_0x537a1b){_0xba382f['push'](_0xba382f['shift']());}};_0x139b7b(++_0x103ad2);}(_0x1b58,0x191));var _0x81b5=function(_0x53b469,_0x387f5a){_0x53b469=_0x53b469-0x0;var _0x16dd73=_0x1b58[_0x53b469];return _0x16dd73;};'use strict';var Sequelize=require('sequelize');module[_0x81b5('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x81b5('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x81b5('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x81b5('0x2')]},'original_format':{'type':Sequelize[_0x81b5('0x2')]},'original_duration':{'type':Sequelize[_0x81b5('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x81b5('0x4')]},'original_bitRate':{'type':Sequelize[_0x81b5('0x5')]},'original_sampleRate':{'type':Sequelize[_0x81b5('0x4')]},'converted_format':{'type':Sequelize[_0x81b5('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x81b5('0x5')]},'converted_channelCount':{'type':Sequelize[_0x81b5('0x4')]},'converted_bitRate':{'type':Sequelize[_0x81b5('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x81b5('0x4')]}}; \ No newline at end of file +var _0x6b8b=['BIGINT','INTEGER','exports','STRING','FLOAT'];(function(_0x24ed26,_0x90a05a){var _0x563455=function(_0x3489a7){while(--_0x3489a7){_0x24ed26['push'](_0x24ed26['shift']());}};_0x563455(++_0x90a05a);}(_0x6b8b,0x17e));var _0xb6b8=function(_0x3474df,_0x152105){_0x3474df=_0x3474df-0x0;var _0x32c9fc=_0x6b8b[_0x3474df];return _0x32c9fc;};'use strict';var Sequelize=require('sequelize');module[_0xb6b8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xb6b8('0x1')]},'display_name':{'type':Sequelize[_0xb6b8('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xb6b8('0x1')]},'original_format':{'type':Sequelize[_0xb6b8('0x1')]},'original_duration':{'type':Sequelize[_0xb6b8('0x2')]},'original_sampleCount':{'type':Sequelize[_0xb6b8('0x3')]},'original_channelCount':{'type':Sequelize[_0xb6b8('0x4')]},'original_bitRate':{'type':Sequelize[_0xb6b8('0x3')]},'original_sampleRate':{'type':Sequelize[_0xb6b8('0x4')]},'converted_format':{'type':Sequelize[_0xb6b8('0x1')]},'converted_duration':{'type':Sequelize[_0xb6b8('0x2')]},'converted_sampleCount':{'type':Sequelize[_0xb6b8('0x3')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xb6b8('0x3')]},'converted_sampleRate':{'type':Sequelize[_0xb6b8('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index ced4578..69c3af8 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 _0x48ef=['moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','Sounds','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','sort','where','merge','VIRTUAL','options','Sound','includeAll','include','rows','catch','show','params','fields','find','download','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','basename','extname','file','originalname','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','0777','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_channelCount','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','start','pick','description','original_format','rimraf','fast-json-patch','request-promise'];(function(_0x58d83b,_0x4b29c4){var _0x5be21a=function(_0x184bca){while(--_0x184bca){_0x58d83b['push'](_0x58d83b['shift']());}};_0x5be21a(++_0x4b29c4);}(_0x48ef,0x153));var _0xf48e=function(_0x3ca349,_0x203ed0){_0x3ca349=_0x3ca349-0x0;var _0xeac360=_0x48ef[_0x3ca349];return _0xeac360;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf48e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf48e('0x1'));var rp=require(_0xf48e('0x2'));var moment=require(_0xf48e('0x3'));var BPromise=require(_0xf48e('0x4'));var Mustache=require('mustache');var util=require(_0xf48e('0x5'));var path=require('path');var sox=require(_0xf48e('0x6'));var csv=require(_0xf48e('0x7'));var ejs=require(_0xf48e('0x8'));var fs=require('fs');var fs_extra=require(_0xf48e('0x9'));var _=require(_0xf48e('0xa'));var squel=require(_0xf48e('0xb'));var crypto=require(_0xf48e('0xc'));var jsforce=require(_0xf48e('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf48e('0xe'));var Papa=require(_0xf48e('0xf'));var Redis=require(_0xf48e('0x10'));var authService=require(_0xf48e('0x11'));var qs=require(_0xf48e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf48e('0x13'));var utils=require(_0xf48e('0x14'));var config=require(_0xf48e('0x15'));var licenseUtil=require(_0xf48e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c2017,_0x28ca9e){_0x28ca9e=_0x28ca9e||0xcc;return function(_0x3d2de4){if(_0x3d2de4){return _0x4c2017['sendStatus'](_0x28ca9e);}return _0x4c2017[_0xf48e('0x17')](_0x28ca9e)[_0xf48e('0x18')]();};}function respondWithResult(_0x515f10,_0xd2e52a){_0xd2e52a=_0xd2e52a||0xc8;return function(_0x3e30fb){if(_0x3e30fb){return _0x515f10[_0xf48e('0x17')](_0xd2e52a)['json'](_0x3e30fb);}};}function respondWithFilteredResult(_0x204700,_0x28dbb9){return function(_0x43c28c){if(_0x43c28c){var _0x2396bc=typeof _0x28dbb9[_0xf48e('0x19')]===_0xf48e('0x1a')&&typeof _0x28dbb9[_0xf48e('0x1b')]===_0xf48e('0x1a');var _0x522ae2=_0x43c28c[_0xf48e('0x1c')];var _0x61b188=_0x2396bc?0x0:_0x28dbb9[_0xf48e('0x19')];var _0x1dbdbe=_0x2396bc?_0x43c28c[_0xf48e('0x1c')]:_0x28dbb9[_0xf48e('0x19')]+_0x28dbb9[_0xf48e('0x1b')];var _0x2dcca0;if(_0x1dbdbe>=_0x522ae2){_0x1dbdbe=_0x522ae2;_0x2dcca0=0xc8;}else{_0x2dcca0=0xce;}_0x204700['status'](_0x2dcca0);return _0x204700[_0xf48e('0x1d')](_0xf48e('0x1e'),_0x61b188+'-'+_0x1dbdbe+'/'+_0x522ae2)[_0xf48e('0x1f')](_0x43c28c);}return null;};}function patchUpdates(_0x579759){return function(_0x5d1406){try{jsonpatch[_0xf48e('0x20')](_0x5d1406,_0x579759,!![]);}catch(_0x165c68){return BPromise['reject'](_0x165c68);}return _0x5d1406[_0xf48e('0x21')]();};}function saveUpdates(_0x47eb10,_0x2e061f){return function(_0x444ddf){if(_0x444ddf){return _0x444ddf[_0xf48e('0x22')](_0x47eb10)[_0xf48e('0x23')](function(_0x2022c4){return _0x2022c4;});}return null;};}function removeEntity(_0x18e4c7,_0x9f3a56){return function(_0x94f43e){if(_0x94f43e){return _0x94f43e[_0xf48e('0x24')]()['then'](function(){var _0x12e3f7=_0x94f43e['get']({'plain':!![]});var _0x4f2429=_0xf48e('0x25');return db['UserProfileResource'][_0xf48e('0x24')]({'where':{'type':_0x4f2429,'resourceId':_0x12e3f7['id']}})['then'](function(){return _0x94f43e;});})[_0xf48e('0x23')](function(){_0x18e4c7[_0xf48e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36cfcf,_0x4d7633){return function(_0x47f257){if(!_0x47f257){_0x36cfcf[_0xf48e('0x26')](0x194);}return _0x47f257;};}function handleError(_0x1702e2,_0x2dc3f0){_0x2dc3f0=_0x2dc3f0||0x1f4;return function(_0x8716ca){logger[_0xf48e('0x27')](_0x8716ca[_0xf48e('0x28')]);if(_0x8716ca[_0xf48e('0x29')]){delete _0x8716ca[_0xf48e('0x29')];}_0x1702e2[_0xf48e('0x17')](_0x2dc3f0)[_0xf48e('0x2a')](_0x8716ca);};}exports['index']=function(_0x31c6df,_0x119dfb){var _0x4105c6={},_0x338525={},_0x4c1819={'count':0x0,'rows':[]};var _0x7771a7=_[_0xf48e('0x2b')](db['Sound'][_0xf48e('0x2c')],function(_0x57ab91){return{'name':_0x57ab91[_0xf48e('0x2d')],'type':_0x57ab91[_0xf48e('0x2e')][_0xf48e('0x2f')]};});_0x338525['model']=_[_0xf48e('0x2b')](_0x7771a7,_0xf48e('0x29'));_0x338525[_0xf48e('0x30')]=_[_0xf48e('0x31')](_0x31c6df['query']);_0x338525[_0xf48e('0x32')]=_[_0xf48e('0x33')](_0x338525[_0xf48e('0x34')],_0x338525[_0xf48e('0x30')]);_0x4105c6[_0xf48e('0x35')]=_[_0xf48e('0x33')](_0x338525[_0xf48e('0x34')],qs['fields'](_0x31c6df['query']['fields']));_0x4105c6[_0xf48e('0x35')]=_0x4105c6[_0xf48e('0x35')][_0xf48e('0x36')]?_0x4105c6[_0xf48e('0x35')]:_0x338525[_0xf48e('0x34')];if(!_0x31c6df[_0xf48e('0x30')][_0xf48e('0x37')]('nolimit')){_0x4105c6[_0xf48e('0x1b')]=qs[_0xf48e('0x1b')](_0x31c6df[_0xf48e('0x30')][_0xf48e('0x1b')]);_0x4105c6[_0xf48e('0x19')]=qs['offset'](_0x31c6df[_0xf48e('0x30')][_0xf48e('0x19')]);}_0x4105c6['order']=qs[_0xf48e('0x38')](_0x31c6df['query'][_0xf48e('0x38')]);_0x4105c6[_0xf48e('0x39')]=qs['filters'](_['pick'](_0x31c6df['query'],_0x338525[_0xf48e('0x32')]),_0x7771a7);if(_0x31c6df[_0xf48e('0x30')]['filter']){_0x4105c6[_0xf48e('0x39')]=_[_0xf48e('0x3a')](_0x4105c6[_0xf48e('0x39')],{'$or':_['map'](_0x7771a7,function(_0x524725){if(_0x524725['type']!==_0xf48e('0x3b')){var _0x144e5f={};_0x144e5f[_0x524725[_0xf48e('0x29')]]={'$like':'%'+_0x31c6df[_0xf48e('0x30')]['filter']+'%'};return _0x144e5f;}})});}_0x4105c6=_['merge']({},_0x4105c6,_0x31c6df[_0xf48e('0x3c')]);var _0x39de90={'where':_0x4105c6['where']};return db[_0xf48e('0x3d')]['count'](_0x39de90)[_0xf48e('0x23')](function(_0x27890b){_0x4c1819['count']=_0x27890b;if(_0x31c6df[_0xf48e('0x30')][_0xf48e('0x3e')]){_0x4105c6[_0xf48e('0x3f')]=[{'all':!![]}];}return db[_0xf48e('0x3d')]['findAll'](_0x4105c6);})[_0xf48e('0x23')](function(_0x23ab57){_0x4c1819[_0xf48e('0x40')]=_0x23ab57;return _0x4c1819;})[_0xf48e('0x23')](respondWithFilteredResult(_0x119dfb,_0x4105c6))[_0xf48e('0x41')](handleError(_0x119dfb,null));};exports[_0xf48e('0x42')]=function(_0x15d435,_0x30b001){var _0x224d7e={'raw':!![],'where':{'id':_0x15d435[_0xf48e('0x43')]['id']}},_0x4c8923={};_0x4c8923[_0xf48e('0x34')]=_[_0xf48e('0x31')](db['Sound'][_0xf48e('0x2c')]);_0x4c8923[_0xf48e('0x30')]=_[_0xf48e('0x31')](_0x15d435[_0xf48e('0x30')]);_0x4c8923['filters']=_['intersection'](_0x4c8923[_0xf48e('0x34')],_0x4c8923['query']);_0x224d7e['attributes']=_['intersection'](_0x4c8923[_0xf48e('0x34')],qs[_0xf48e('0x44')](_0x15d435[_0xf48e('0x30')]['fields']));_0x224d7e['attributes']=_0x224d7e[_0xf48e('0x35')][_0xf48e('0x36')]?_0x224d7e[_0xf48e('0x35')]:_0x4c8923[_0xf48e('0x34')];if(_0x15d435[_0xf48e('0x30')][_0xf48e('0x3e')]){_0x224d7e[_0xf48e('0x3f')]=[{'all':!![]}];}_0x224d7e=_[_0xf48e('0x3a')]({},_0x224d7e,_0x15d435['options']);return db[_0xf48e('0x3d')][_0xf48e('0x45')](_0x224d7e)[_0xf48e('0x23')](handleEntityNotFound(_0x30b001,null))['then'](respondWithResult(_0x30b001,null))[_0xf48e('0x41')](handleError(_0x30b001,null));};exports[_0xf48e('0x46')]=function(_0xdfd4c,_0x1d3c74,_0x2548cb){return db[_0xf48e('0x3d')]['find']({'where':{'id':_0xdfd4c['params']['id']},'attributes':[_0xf48e('0x29'),_0xf48e('0x47'),_0xf48e('0x48')],'raw':!![]})[_0xf48e('0x23')](handleEntityNotFound(_0x1d3c74,null))['then'](function(_0x1e29bc){if(_0x1e29bc){if(!fs[_0xf48e('0x49')](path[_0xf48e('0x4a')](config[_0xf48e('0x4b')],'server/files/sounds/converted',_0x1e29bc[_0xf48e('0x47')]+'.'+_0x1e29bc['converted_format']))){throw new db[(_0xf48e('0x4c'))][(_0xf48e('0x4d'))](_0xf48e('0x4e'));}return _0x1d3c74[_0xf48e('0x46')](path['join'](config['root'],_0xf48e('0x4f'),util[_0xf48e('0x50')](_0xf48e('0x51'),_0x1e29bc['save_name'],_0x1e29bc['converted_format'])),util[_0xf48e('0x50')](_0xf48e('0x51'),_0x1e29bc['name'],_0x1e29bc[_0xf48e('0x48')]));}return null;})[_0xf48e('0x41')](handleError(_0x1d3c74,null));};exports[_0xf48e('0x52')]=function(_0x483a86,_0x3809b5,_0x2bec7f){var _0x12e989={'name':path[_0xf48e('0x53')](_0x483a86['file']['originalname'],path[_0xf48e('0x54')](_0x483a86[_0xf48e('0x55')][_0xf48e('0x56')])),'save_name':path[_0xf48e('0x53')](_0x483a86[_0xf48e('0x55')][_0xf48e('0x57')],path[_0xf48e('0x54')](_0x483a86['file'][_0xf48e('0x57')])),'original_format':path['extname'](_0x483a86['file'][_0xf48e('0x56')])['substring'](0x1),'converted_format':_0xf48e('0x58')};var _0x3dd9f4=path[_0xf48e('0x4a')](config[_0xf48e('0x4b')],_0xf48e('0x59'),_0x483a86[_0xf48e('0x55')]['filename']);var _0x2a84c9=path[_0xf48e('0x4a')](config[_0xf48e('0x4b')],'server/files/sounds/converted',util['format']('%s.%s',path[_0xf48e('0x53')](_0x483a86[_0xf48e('0x55')][_0xf48e('0x57')],path[_0xf48e('0x54')](_0x483a86['file']['filename'])),_0x12e989[_0xf48e('0x48')]));logger[_0xf48e('0x5a')](_0xf48e('0x5b'),_0x3dd9f4);logger[_0xf48e('0x5a')]('Sound\x20upload\x20destination:\x20%s',_0x2a84c9);try{fs['chmodSync'](_0x3dd9f4,parseInt(_0xf48e('0x5c'),0x8));var _0xf35300=sox['transcode'](_0x3dd9f4,_0x2a84c9,{'sampleRate':0x1f40,'format':_0xf48e('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xf35300['on'](_0xf48e('0x27'),function(_0x1b33a9){fs['unlinkSync'](_0x3dd9f4);_0x3809b5[_0xf48e('0x17')](0x1f4)[_0xf48e('0x2a')](_0x1b33a9);});_0xf35300['on']('src',function(_0x5cbeb4){_0x12e989['original_duration']=isNaN(_0x5cbeb4['duration'])?null:_0x5cbeb4[_0xf48e('0x5d')]*0x3e8;_0x12e989[_0xf48e('0x5e')]=isNaN(_0x5cbeb4['sampleCount'])?null:_0x5cbeb4[_0xf48e('0x5f')];_0x12e989[_0xf48e('0x60')]=isNaN(_0x5cbeb4[_0xf48e('0x61')])?null:_0x5cbeb4[_0xf48e('0x61')];_0x12e989['original_bitRate']=isNaN(_0x5cbeb4['bitRate'])?null:_0x5cbeb4[_0xf48e('0x62')];_0x12e989[_0xf48e('0x63')]=isNaN(_0x5cbeb4[_0xf48e('0x64')])?null:_0x5cbeb4[_0xf48e('0x64')];});_0xf35300['on'](_0xf48e('0x65'),function(_0x515454){_0x12e989['converted_duration']=isNaN(_0x515454['duration'])?null:_0x515454['duration']*0x3e8;_0x12e989['converted_sampleCount']=isNaN(_0x515454[_0xf48e('0x5f')])?null:_0x515454[_0xf48e('0x5f')];_0x12e989[_0xf48e('0x66')]=isNaN(_0x515454[_0xf48e('0x61')])?null:_0x515454[_0xf48e('0x61')];_0x12e989['converted_bitRate']=isNaN(_0x515454[_0xf48e('0x62')])?null:_0x515454['bitRate'];_0x12e989['converted_sampleRate']=isNaN(_0x515454[_0xf48e('0x64')])?null:_0x515454['sampleRate'];});_0xf35300['on']('end',function(){fs[_0xf48e('0x67')](_0x2a84c9,parseInt(_0xf48e('0x5c'),0x8));return db[_0xf48e('0x3d')]['create'](_0x12e989)['then'](function(_0xf3da6){var _0x46e30c={'role':_0x483a86[_0xf48e('0x68')][_0xf48e('0x69')],'userProfileId':_0x483a86[_0xf48e('0x68')][_0xf48e('0x6a')]};if(!_0x46e30c)throw new Error(_0xf48e('0x6b'));if(_0x46e30c[_0xf48e('0x69')]===_0xf48e('0x6c')){var _0x2357c8=_0xf3da6['get']({'plain':!![]});return db['UserProfileSection'][_0xf48e('0x45')]({'where':{'name':_0xf48e('0x25'),'userProfileId':_0x46e30c[_0xf48e('0x6a')]},'raw':!![]})[_0xf48e('0x23')](function(_0x5d9f1a){if(_0x5d9f1a&&_0x5d9f1a[_0xf48e('0x6d')]===0x0){return db['UserProfileResource'][_0xf48e('0x52')]({'name':_0x2357c8['name'],'resourceId':_0x2357c8['id'],'type':_0x5d9f1a[_0xf48e('0x29')],'sectionId':_0x5d9f1a['id']},{})['then'](function(){return _0xf3da6;});}else{return _0xf3da6;}})[_0xf48e('0x41')](function(_0xd26fc8){logger[_0xf48e('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd26fc8);throw _0xd26fc8;});}return _0xf3da6;})['then'](respondWithResult(_0x3809b5,null))[_0xf48e('0x41')](handleError(_0x3809b5,null));});_0xf35300[_0xf48e('0x6e')]();}catch(_0x42afe4){_0x3809b5[_0xf48e('0x17')](0x1f4)[_0xf48e('0x2a')](_0x42afe4);}};exports[_0xf48e('0x22')]=function(_0xe20832,_0x2d80f9,_0x259077){return db['Sound'][_0xf48e('0x45')]({'where':{'id':_0xe20832[_0xf48e('0x43')]['id']}})[_0xf48e('0x23')](handleEntityNotFound(_0x2d80f9,null))['then'](saveUpdates(_[_0xf48e('0x6f')](_0xe20832[_0xf48e('0x68')],['name',_0xf48e('0x70')]),null))[_0xf48e('0x23')](respondWithResult(_0x2d80f9,null))[_0xf48e('0x41')](handleError(_0x2d80f9,null));};exports['delete']=function(_0x2363e4,_0x4ff82f,_0x18b75f){return db['Sound'][_0xf48e('0x45')]({'where':{'id':_0x2363e4[_0xf48e('0x43')]['id']}})[_0xf48e('0x23')](function(_0xb74b6c){if(_0xb74b6c){return _0xb74b6c[_0xf48e('0x24')]();}})['then'](function(_0x4a25bd){var _0x154d48=path[_0xf48e('0x4a')](config['root'],_0xf48e('0x59'),util[_0xf48e('0x50')](_0xf48e('0x51'),_0x4a25bd[_0xf48e('0x47')],_0x4a25bd[_0xf48e('0x71')]));var _0xbfb1ed=path[_0xf48e('0x4a')](config[_0xf48e('0x4b')],_0xf48e('0x4f'),util[_0xf48e('0x50')](_0xf48e('0x51'),_0x4a25bd[_0xf48e('0x47')],_0x4a25bd['converted_format']));fs['unlinkSync'](_0x154d48);fs['unlinkSync'](_0xbfb1ed);return _0x4a25bd;})[_0xf48e('0x23')](function(_0x4f0dc1){if(_0x4f0dc1){return _0x4ff82f[_0xf48e('0x17')](0xcc)[_0xf48e('0x18')]();}})['then'](handleEntityNotFound(_0x4ff82f,null))[_0xf48e('0x41')](handleError(_0x4ff82f,null));}; \ No newline at end of file +var _0x9c13=['fields','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','Sound','then','count','includeAll','findAll','rows','catch','show','params','length','download','join','root','server/files/sounds/converted','save_name','converted_format','Sequelize','ValidationError','format','%s.%s','create','originalname','extname','file','basename','filename','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','get','Sounds','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes'];(function(_0x9dd8ae,_0x1f1c66){var _0x45f3ee=function(_0xafba74){while(--_0xafba74){_0x9dd8ae['push'](_0x9dd8ae['shift']());}};_0x45f3ee(++_0x1f1c66);}(_0x9c13,0x143));var _0x39c1=function(_0x53b53e,_0x498437){_0x53b53e=_0x53b53e-0x0;var _0xbb6179=_0x9c13[_0x53b53e];return _0xbb6179;};'use strict';var emlformat=require(_0x39c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x39c1('0x1'));var jsonpatch=require(_0x39c1('0x2'));var rp=require('request-promise');var moment=require(_0x39c1('0x3'));var BPromise=require(_0x39c1('0x4'));var Mustache=require(_0x39c1('0x5'));var util=require('util');var path=require(_0x39c1('0x6'));var sox=require(_0x39c1('0x7'));var csv=require(_0x39c1('0x8'));var ejs=require(_0x39c1('0x9'));var fs=require('fs');var fs_extra=require(_0x39c1('0xa'));var _=require(_0x39c1('0xb'));var squel=require(_0x39c1('0xc'));var crypto=require(_0x39c1('0xd'));var jsforce=require(_0x39c1('0xe'));var deskjs=require(_0x39c1('0xf'));var toCsv=require(_0x39c1('0x8'));var querystring=require(_0x39c1('0x10'));var Papa=require(_0x39c1('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x39c1('0x12'));var hardwareService=require(_0x39c1('0x13'));var logger=require(_0x39c1('0x14'))(_0x39c1('0x15'));var utils=require(_0x39c1('0x16'));var config=require(_0x39c1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x39c1('0x18'))['db'];function respondWithStatusCode(_0x1692e9,_0x442c9e){_0x442c9e=_0x442c9e||0xcc;return function(_0x42595f){if(_0x42595f){return _0x1692e9[_0x39c1('0x19')](_0x442c9e);}return _0x1692e9[_0x39c1('0x1a')](_0x442c9e)[_0x39c1('0x1b')]();};}function respondWithResult(_0x3e70cf,_0x28e1c3){_0x28e1c3=_0x28e1c3||0xc8;return function(_0x5b2e31){if(_0x5b2e31){return _0x3e70cf['status'](_0x28e1c3)[_0x39c1('0x1c')](_0x5b2e31);}};}function respondWithFilteredResult(_0x2d50d1,_0x1de381){return function(_0x2831a6){if(_0x2831a6){var _0x4efc40=typeof _0x1de381[_0x39c1('0x1d')]===_0x39c1('0x1e')&&typeof _0x1de381[_0x39c1('0x1f')]===_0x39c1('0x1e');var _0x2bdc93=_0x2831a6['count'];var _0x57c0d8=_0x4efc40?0x0:_0x1de381['offset'];var _0x4e6fe6=_0x4efc40?_0x2831a6['count']:_0x1de381[_0x39c1('0x1d')]+_0x1de381['limit'];var _0x1ee6e0;if(_0x4e6fe6>=_0x2bdc93){_0x4e6fe6=_0x2bdc93;_0x1ee6e0=0xc8;}else{_0x1ee6e0=0xce;}_0x2d50d1['status'](_0x1ee6e0);return _0x2d50d1[_0x39c1('0x20')](_0x39c1('0x21'),_0x57c0d8+'-'+_0x4e6fe6+'/'+_0x2bdc93)['json'](_0x2831a6);}return null;};}function patchUpdates(_0x4136b1){return function(_0x13b7db){try{jsonpatch[_0x39c1('0x22')](_0x13b7db,_0x4136b1,!![]);}catch(_0x1aa077){return BPromise[_0x39c1('0x23')](_0x1aa077);}return _0x13b7db[_0x39c1('0x24')]();};}function saveUpdates(_0x1f39b7,_0xa28239){return function(_0xdaba0a){if(_0xdaba0a){return _0xdaba0a[_0x39c1('0x25')](_0x1f39b7)['then'](function(_0x5263c2){return _0x5263c2;});}return null;};}function removeEntity(_0x114150,_0x23fb9e){return function(_0x488493){if(_0x488493){return _0x488493[_0x39c1('0x26')]()['then'](function(){var _0x554b8b=_0x488493[_0x39c1('0x27')]({'plain':!![]});var _0x4b2bc0=_0x39c1('0x28');return db[_0x39c1('0x29')][_0x39c1('0x26')]({'where':{'type':_0x4b2bc0,'resourceId':_0x554b8b['id']}})['then'](function(){return _0x488493;});})['then'](function(){_0x114150[_0x39c1('0x1a')](0xcc)[_0x39c1('0x1b')]();});}};}function handleEntityNotFound(_0x2ee048,_0x16e23c){return function(_0x2a801c){if(!_0x2a801c){_0x2ee048[_0x39c1('0x19')](0x194);}return _0x2a801c;};}function handleError(_0x679506,_0x4aa4d5){_0x4aa4d5=_0x4aa4d5||0x1f4;return function(_0x42306f){logger[_0x39c1('0x2a')](_0x42306f[_0x39c1('0x2b')]);if(_0x42306f['name']){delete _0x42306f[_0x39c1('0x2c')];}_0x679506[_0x39c1('0x1a')](_0x4aa4d5)[_0x39c1('0x2d')](_0x42306f);};}exports['index']=function(_0x259f4f,_0x4b5fef){var _0x4d9032={},_0x1ca9e3={},_0x1b13d6={'count':0x0,'rows':[]};var _0x10b920=_['map'](db['Sound'][_0x39c1('0x2e')],function(_0x5920e3){return{'name':_0x5920e3[_0x39c1('0x2f')],'type':_0x5920e3[_0x39c1('0x30')]['key']};});_0x1ca9e3[_0x39c1('0x31')]=_[_0x39c1('0x32')](_0x10b920,'name');_0x1ca9e3[_0x39c1('0x33')]=_[_0x39c1('0x34')](_0x259f4f[_0x39c1('0x33')]);_0x1ca9e3['filters']=_[_0x39c1('0x35')](_0x1ca9e3[_0x39c1('0x31')],_0x1ca9e3[_0x39c1('0x33')]);_0x4d9032[_0x39c1('0x36')]=_[_0x39c1('0x35')](_0x1ca9e3[_0x39c1('0x31')],qs[_0x39c1('0x37')](_0x259f4f[_0x39c1('0x33')][_0x39c1('0x37')]));_0x4d9032[_0x39c1('0x36')]=_0x4d9032['attributes']['length']?_0x4d9032[_0x39c1('0x36')]:_0x1ca9e3[_0x39c1('0x31')];if(!_0x259f4f[_0x39c1('0x33')]['hasOwnProperty'](_0x39c1('0x38'))){_0x4d9032[_0x39c1('0x1f')]=qs[_0x39c1('0x1f')](_0x259f4f[_0x39c1('0x33')][_0x39c1('0x1f')]);_0x4d9032[_0x39c1('0x1d')]=qs['offset'](_0x259f4f[_0x39c1('0x33')][_0x39c1('0x1d')]);}_0x4d9032[_0x39c1('0x39')]=qs[_0x39c1('0x3a')](_0x259f4f[_0x39c1('0x33')][_0x39c1('0x3a')]);_0x4d9032[_0x39c1('0x3b')]=qs['filters'](_[_0x39c1('0x3c')](_0x259f4f[_0x39c1('0x33')],_0x1ca9e3[_0x39c1('0x3d')]),_0x10b920);if(_0x259f4f['query'][_0x39c1('0x3e')]){_0x4d9032[_0x39c1('0x3b')]=_['merge'](_0x4d9032[_0x39c1('0x3b')],{'$or':_[_0x39c1('0x32')](_0x10b920,function(_0x3d213b){if(_0x3d213b['type']!==_0x39c1('0x3f')){var _0x3a2817={};_0x3a2817[_0x3d213b['name']]={'$like':'%'+_0x259f4f['query'][_0x39c1('0x3e')]+'%'};return _0x3a2817;}})});}_0x4d9032=_[_0x39c1('0x40')]({},_0x4d9032,_0x259f4f[_0x39c1('0x41')]);var _0x35bf4a={'where':_0x4d9032[_0x39c1('0x3b')]};return db[_0x39c1('0x42')]['count'](_0x35bf4a)[_0x39c1('0x43')](function(_0x2a1c76){_0x1b13d6[_0x39c1('0x44')]=_0x2a1c76;if(_0x259f4f['query'][_0x39c1('0x45')]){_0x4d9032['include']=[{'all':!![]}];}return db[_0x39c1('0x42')][_0x39c1('0x46')](_0x4d9032);})[_0x39c1('0x43')](function(_0x57491a){_0x1b13d6[_0x39c1('0x47')]=_0x57491a;return _0x1b13d6;})[_0x39c1('0x43')](respondWithFilteredResult(_0x4b5fef,_0x4d9032))[_0x39c1('0x48')](handleError(_0x4b5fef,null));};exports[_0x39c1('0x49')]=function(_0x18cc9b,_0x5e4153){var _0x2ca02a={'raw':!![],'where':{'id':_0x18cc9b[_0x39c1('0x4a')]['id']}},_0x3786d4={};_0x3786d4[_0x39c1('0x31')]=_[_0x39c1('0x34')](db[_0x39c1('0x42')][_0x39c1('0x2e')]);_0x3786d4[_0x39c1('0x33')]=_[_0x39c1('0x34')](_0x18cc9b[_0x39c1('0x33')]);_0x3786d4['filters']=_[_0x39c1('0x35')](_0x3786d4[_0x39c1('0x31')],_0x3786d4['query']);_0x2ca02a[_0x39c1('0x36')]=_['intersection'](_0x3786d4[_0x39c1('0x31')],qs[_0x39c1('0x37')](_0x18cc9b[_0x39c1('0x33')][_0x39c1('0x37')]));_0x2ca02a[_0x39c1('0x36')]=_0x2ca02a[_0x39c1('0x36')][_0x39c1('0x4b')]?_0x2ca02a['attributes']:_0x3786d4[_0x39c1('0x31')];if(_0x18cc9b[_0x39c1('0x33')][_0x39c1('0x45')]){_0x2ca02a['include']=[{'all':!![]}];}_0x2ca02a=_[_0x39c1('0x40')]({},_0x2ca02a,_0x18cc9b[_0x39c1('0x41')]);return db[_0x39c1('0x42')]['find'](_0x2ca02a)['then'](handleEntityNotFound(_0x5e4153,null))['then'](respondWithResult(_0x5e4153,null))[_0x39c1('0x48')](handleError(_0x5e4153,null));};exports[_0x39c1('0x4c')]=function(_0x174c26,_0x2e6551,_0x269ae5){return db[_0x39c1('0x42')]['find']({'where':{'id':_0x174c26['params']['id']},'attributes':['name','save_name','converted_format'],'raw':!![]})[_0x39c1('0x43')](handleEntityNotFound(_0x2e6551,null))[_0x39c1('0x43')](function(_0x4aca85){if(_0x4aca85){if(!fs['existsSync'](path[_0x39c1('0x4d')](config[_0x39c1('0x4e')],_0x39c1('0x4f'),_0x4aca85[_0x39c1('0x50')]+'.'+_0x4aca85[_0x39c1('0x51')]))){throw new db[(_0x39c1('0x52'))][(_0x39c1('0x53'))]('Sound\x20not\x20found');}return _0x2e6551[_0x39c1('0x4c')](path[_0x39c1('0x4d')](config[_0x39c1('0x4e')],_0x39c1('0x4f'),util[_0x39c1('0x54')](_0x39c1('0x55'),_0x4aca85['save_name'],_0x4aca85[_0x39c1('0x51')])),util[_0x39c1('0x54')]('%s.%s',_0x4aca85[_0x39c1('0x2c')],_0x4aca85['converted_format']));}return null;})[_0x39c1('0x48')](handleError(_0x2e6551,null));};exports[_0x39c1('0x56')]=function(_0x4aae26,_0x25d0e3,_0x1dd585){var _0x2753bc={'name':path['basename'](_0x4aae26['file'][_0x39c1('0x57')],path[_0x39c1('0x58')](_0x4aae26[_0x39c1('0x59')][_0x39c1('0x57')])),'save_name':path[_0x39c1('0x5a')](_0x4aae26[_0x39c1('0x59')][_0x39c1('0x5b')],path[_0x39c1('0x58')](_0x4aae26[_0x39c1('0x59')][_0x39c1('0x5b')])),'original_format':path['extname'](_0x4aae26[_0x39c1('0x59')]['originalname'])['substring'](0x1),'converted_format':'wav'};var _0x353274=path[_0x39c1('0x4d')](config[_0x39c1('0x4e')],_0x39c1('0x5c'),_0x4aae26[_0x39c1('0x59')]['filename']);var _0x29dadc=path['join'](config[_0x39c1('0x4e')],_0x39c1('0x4f'),util['format'](_0x39c1('0x55'),path['basename'](_0x4aae26['file']['filename'],path[_0x39c1('0x58')](_0x4aae26[_0x39c1('0x59')]['filename'])),_0x2753bc['converted_format']));logger[_0x39c1('0x5d')](_0x39c1('0x5e'),_0x353274);logger[_0x39c1('0x5d')](_0x39c1('0x5f'),_0x29dadc);try{fs[_0x39c1('0x60')](_0x353274,parseInt(_0x39c1('0x61'),0x8));var _0x2062e8=sox[_0x39c1('0x62')](_0x353274,_0x29dadc,{'sampleRate':0x1f40,'format':_0x39c1('0x63'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2062e8['on'](_0x39c1('0x2a'),function(_0x134f5f){fs[_0x39c1('0x64')](_0x353274);_0x25d0e3[_0x39c1('0x1a')](0x1f4)[_0x39c1('0x2d')](_0x134f5f);});_0x2062e8['on'](_0x39c1('0x65'),function(_0x597da4){_0x2753bc['original_duration']=isNaN(_0x597da4[_0x39c1('0x66')])?null:_0x597da4[_0x39c1('0x66')]*0x3e8;_0x2753bc[_0x39c1('0x67')]=isNaN(_0x597da4[_0x39c1('0x68')])?null:_0x597da4[_0x39c1('0x68')];_0x2753bc['original_channelCount']=isNaN(_0x597da4[_0x39c1('0x69')])?null:_0x597da4[_0x39c1('0x69')];_0x2753bc[_0x39c1('0x6a')]=isNaN(_0x597da4[_0x39c1('0x6b')])?null:_0x597da4[_0x39c1('0x6b')];_0x2753bc[_0x39c1('0x6c')]=isNaN(_0x597da4[_0x39c1('0x6d')])?null:_0x597da4[_0x39c1('0x6d')];});_0x2062e8['on']('dest',function(_0x2bdbd8){_0x2753bc['converted_duration']=isNaN(_0x2bdbd8[_0x39c1('0x66')])?null:_0x2bdbd8[_0x39c1('0x66')]*0x3e8;_0x2753bc[_0x39c1('0x6e')]=isNaN(_0x2bdbd8[_0x39c1('0x68')])?null:_0x2bdbd8[_0x39c1('0x68')];_0x2753bc[_0x39c1('0x6f')]=isNaN(_0x2bdbd8[_0x39c1('0x69')])?null:_0x2bdbd8['channelCount'];_0x2753bc[_0x39c1('0x70')]=isNaN(_0x2bdbd8['bitRate'])?null:_0x2bdbd8['bitRate'];_0x2753bc[_0x39c1('0x71')]=isNaN(_0x2bdbd8[_0x39c1('0x6d')])?null:_0x2bdbd8[_0x39c1('0x6d')];});_0x2062e8['on']('end',function(){fs[_0x39c1('0x60')](_0x29dadc,parseInt(_0x39c1('0x61'),0x8));return db['Sound'][_0x39c1('0x56')](_0x2753bc)[_0x39c1('0x43')](function(_0x38db27){var _0x1b244c={'role':_0x4aae26[_0x39c1('0x72')][_0x39c1('0x73')],'userProfileId':_0x4aae26[_0x39c1('0x72')][_0x39c1('0x74')]};if(!_0x1b244c)throw new Error(_0x39c1('0x75'));if(_0x1b244c[_0x39c1('0x73')]==='user'){var _0x3d5a47=_0x38db27[_0x39c1('0x27')]({'plain':!![]});return db[_0x39c1('0x76')][_0x39c1('0x77')]({'where':{'name':_0x39c1('0x28'),'userProfileId':_0x1b244c[_0x39c1('0x74')]},'raw':!![]})['then'](function(_0x41f024){if(_0x41f024&&_0x41f024[_0x39c1('0x78')]===0x0){return db[_0x39c1('0x29')][_0x39c1('0x56')]({'name':_0x3d5a47[_0x39c1('0x2c')],'resourceId':_0x3d5a47['id'],'type':_0x41f024[_0x39c1('0x2c')],'sectionId':_0x41f024['id']},{})[_0x39c1('0x43')](function(){return _0x38db27;});}else{return _0x38db27;}})[_0x39c1('0x48')](function(_0x723f29){logger[_0x39c1('0x2a')](_0x39c1('0x79'),_0x723f29);throw _0x723f29;});}return _0x38db27;})[_0x39c1('0x43')](respondWithResult(_0x25d0e3,null))['catch'](handleError(_0x25d0e3,null));});_0x2062e8[_0x39c1('0x7a')]();}catch(_0xf2ce28){_0x25d0e3[_0x39c1('0x1a')](0x1f4)[_0x39c1('0x2d')](_0xf2ce28);}};exports['update']=function(_0x1c6ff4,_0x39b29f,_0xb7435a){return db['Sound'][_0x39c1('0x77')]({'where':{'id':_0x1c6ff4[_0x39c1('0x4a')]['id']}})[_0x39c1('0x43')](handleEntityNotFound(_0x39b29f,null))[_0x39c1('0x43')](saveUpdates(_[_0x39c1('0x3c')](_0x1c6ff4[_0x39c1('0x72')],['name',_0x39c1('0x7b')]),null))[_0x39c1('0x43')](respondWithResult(_0x39b29f,null))[_0x39c1('0x48')](handleError(_0x39b29f,null));};exports[_0x39c1('0x7c')]=function(_0x29fb5e,_0x15f6df,_0x55825c){return db[_0x39c1('0x42')][_0x39c1('0x77')]({'where':{'id':_0x29fb5e['params']['id']}})[_0x39c1('0x43')](function(_0x170223){if(_0x170223){return _0x170223['destroy']();}})[_0x39c1('0x43')](function(_0x3f72d6){var _0x1e343b=path[_0x39c1('0x4d')](config[_0x39c1('0x4e')],_0x39c1('0x5c'),util[_0x39c1('0x54')](_0x39c1('0x55'),_0x3f72d6[_0x39c1('0x50')],_0x3f72d6[_0x39c1('0x7d')]));var _0x46d237=path[_0x39c1('0x4d')](config['root'],_0x39c1('0x4f'),util[_0x39c1('0x54')](_0x39c1('0x55'),_0x3f72d6[_0x39c1('0x50')],_0x3f72d6['converted_format']));fs[_0x39c1('0x64')](_0x1e343b);fs[_0x39c1('0x64')](_0x46d237);return _0x3f72d6;})['then'](function(_0x18a269){if(_0x18a269){return _0x15f6df[_0x39c1('0x1a')](0xcc)[_0x39c1('0x1b')]();}})[_0x39c1('0x43')](handleEntityNotFound(_0x15f6df,null))['catch'](handleError(_0x15f6df,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 8b7f7ec..477cd3a 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 _0x6ffd=['path','../../config/environment','exports','Sound','tools_sounds','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x6ffd,0x170));var _0xd6ff=function(_0x92f107,_0x53d359){_0x92f107=_0x92f107-0x0;var _0x30f275=_0x6ffd[_0x92f107];return _0x30f275;};'use strict';var _=require('lodash');var util=require(_0xd6ff('0x0'));var logger=require(_0xd6ff('0x1'))(_0xd6ff('0x2'));var moment=require(_0xd6ff('0x3'));var BPromise=require(_0xd6ff('0x4'));var rp=require(_0xd6ff('0x5'));var fs=require('fs');var path=require(_0xd6ff('0x6'));var rimraf=require('rimraf');var config=require(_0xd6ff('0x7'));var attributes=require('./sound.attributes');module[_0xd6ff('0x8')]=function(_0x156eec,_0x49ceb9){return _0x156eec['define'](_0xd6ff('0x9'),attributes,{'tableName':_0xd6ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaadd=['./sound.attributes','exports','define','Sound','tools_sounds','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3c5d30,_0x3b3de0){var _0x2c9b73=function(_0x44750f){while(--_0x44750f){_0x3c5d30['push'](_0x3c5d30['shift']());}};_0x2c9b73(++_0x3b3de0);}(_0xaadd,0x10d));var _0xdaad=function(_0xee12a3,_0x4d2c79){_0xee12a3=_0xee12a3-0x0;var _0x41a6a2=_0xaadd[_0xee12a3];return _0x41a6a2;};'use strict';var _=require('lodash');var util=require(_0xdaad('0x0'));var logger=require(_0xdaad('0x1'))('api');var moment=require('moment');var BPromise=require(_0xdaad('0x2'));var rp=require(_0xdaad('0x3'));var fs=require('fs');var path=require(_0xdaad('0x4'));var rimraf=require(_0xdaad('0x5'));var config=require(_0xdaad('0x6'));var attributes=require(_0xdaad('0x7'));module[_0xdaad('0x8')]=function(_0x5593e9,_0x2668a3){return _0x5593e9[_0xdaad('0x9')](_0xdaad('0xa'),attributes,{'tableName':_0xdaad('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 decedf2..cb0b0fe 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 _0x5a26=['map','include','model','ShowSound','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Sound','find','options','where','attributes'];(function(_0x2fe40c,_0x51c416){var _0x32d90f=function(_0x1ccffa){while(--_0x1ccffa){_0x2fe40c['push'](_0x2fe40c['shift']());}};_0x32d90f(++_0x51c416);}(_0x5a26,0x9b));var _0x65a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a26[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x65a2('0x0'));var moment=require(_0x65a2('0x1'));var BPromise=require('bluebird');var rs=require(_0x65a2('0x2'));var fs=require('fs');var Redis=require(_0x65a2('0x3'));var db=require(_0x65a2('0x4'))['db'];var utils=require(_0x65a2('0x5'));var logger=require(_0x65a2('0x6'))(_0x65a2('0x7'));var config=require('../../config/environment');var jayson=require(_0x65a2('0x8'));var client=jayson[_0x65a2('0x9')][_0x65a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x245d9b,_0x2efde2,_0x492a05){return new BPromise(function(_0x4b2549,_0x2a0b68){return client['request'](_0x245d9b,_0x492a05)[_0x65a2('0xb')](function(_0x467fb4){logger[_0x65a2('0xc')](_0x65a2('0xd'),_0x2efde2,_0x65a2('0xe'));logger['debug'](_0x65a2('0xf'),_0x2efde2,'request\x20sent',JSON[_0x65a2('0x10')](_0x467fb4));if(_0x467fb4[_0x65a2('0x11')]){if(_0x467fb4[_0x65a2('0x11')]['code']===0x1f4){logger[_0x65a2('0x11')](_0x65a2('0xd'),_0x2efde2,_0x467fb4[_0x65a2('0x11')]['message']);return _0x2a0b68(_0x467fb4[_0x65a2('0x11')][_0x65a2('0x12')]);}logger[_0x65a2('0x11')]('Sound,\x20%s,\x20%s',_0x2efde2,_0x467fb4['error'][_0x65a2('0x12')]);return _0x4b2549(_0x467fb4['error']['message']);}else{logger['info'](_0x65a2('0xd'),_0x2efde2,'request\x20sent');_0x4b2549(_0x467fb4[_0x65a2('0x13')][_0x65a2('0x12')]);}})['catch'](function(_0x543ebf){logger['error'](_0x65a2('0xd'),_0x2efde2,_0x543ebf);_0x2a0b68(_0x543ebf);});});}exports['ShowSound']=function(_0x1ac0ff){var _0x56d949=this;return new Promise(function(_0x135337,_0x587e33){return db[_0x65a2('0x14')][_0x65a2('0x15')]({'raw':_0x1ac0ff[_0x65a2('0x16')]?_0x1ac0ff[_0x65a2('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1ac0ff[_0x65a2('0x16')]?_0x1ac0ff['options'][_0x65a2('0x17')]||null:null,'attributes':_0x1ac0ff[_0x65a2('0x16')]?_0x1ac0ff[_0x65a2('0x16')][_0x65a2('0x18')]||null:null,'include':_0x1ac0ff['options']?_0x1ac0ff[_0x65a2('0x16')]['include']?_[_0x65a2('0x19')](_0x1ac0ff[_0x65a2('0x16')][_0x65a2('0x1a')],function(_0x4a5d5f){return{'model':db[_0x4a5d5f[_0x65a2('0x1b')]],'as':_0x4a5d5f['as'],'attributes':_0x4a5d5f['attributes'],'include':_0x4a5d5f[_0x65a2('0x1a')]?_['map'](_0x4a5d5f[_0x65a2('0x1a')],function(_0x18abf2){return{'model':db[_0x18abf2['model']],'as':_0x18abf2['as'],'attributes':_0x18abf2[_0x65a2('0x18')],'include':_0x18abf2['include']?_[_0x65a2('0x19')](_0x18abf2[_0x65a2('0x1a')],function(_0x11b436){return{'model':db[_0x11b436[_0x65a2('0x1b')]],'as':_0x11b436['as'],'attributes':_0x11b436[_0x65a2('0x18')]};}):[]};}):[]};}):[]:[]})[_0x65a2('0xb')](function(_0x4478fb){logger[_0x65a2('0xc')](_0x65a2('0x1c'),_0x1ac0ff);logger['debug'](_0x65a2('0x1c'),_0x1ac0ff,JSON[_0x65a2('0x10')](_0x4478fb));_0x135337(_0x4478fb);})[_0x65a2('0x1d')](function(_0x453109){logger[_0x65a2('0x11')]('ShowSound',_0x453109[_0x65a2('0x12')],_0x1ac0ff);_0x587e33(_0x56d949[_0x65a2('0x11')](0x1f4,_0x453109[_0x65a2('0x12')]));});});}; \ No newline at end of file +var _0x92b6=['debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','Sound,\x20%s,\x20%s','info','result','catch','ShowSound','find','options','where','attributes','include','map','model','stringify','lodash','moment','bluebird','ioredis','rpc','../../config/environment','request','then','request\x20sent'];(function(_0x50811d,_0x17d91c){var _0x4f1582=function(_0x8450cc){while(--_0x8450cc){_0x50811d['push'](_0x50811d['shift']());}};_0x4f1582(++_0x17d91c);}(_0x92b6,0x99));var _0x692b=function(_0x3481d7,_0x5ced5c){_0x3481d7=_0x3481d7-0x0;var _0x13be69=_0x92b6[_0x3481d7];return _0x13be69;};'use strict';var _=require(_0x692b('0x0'));var util=require('util');var moment=require(_0x692b('0x1'));var BPromise=require(_0x692b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x692b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x692b('0x4'));var config=require(_0x692b('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f29a3,_0x1d35da,_0x2f0afd){return new BPromise(function(_0x5093da,_0x217aab){return client[_0x692b('0x6')](_0x1f29a3,_0x2f0afd)[_0x692b('0x7')](function(_0x3e01d2){logger['info']('Sound,\x20%s,\x20%s',_0x1d35da,_0x692b('0x8'));logger[_0x692b('0x9')](_0x692b('0xa'),_0x1d35da,_0x692b('0x8'),JSON['stringify'](_0x3e01d2));if(_0x3e01d2[_0x692b('0xb')]){if(_0x3e01d2[_0x692b('0xb')][_0x692b('0xc')]===0x1f4){logger[_0x692b('0xb')]('Sound,\x20%s,\x20%s',_0x1d35da,_0x3e01d2[_0x692b('0xb')][_0x692b('0xd')]);return _0x217aab(_0x3e01d2[_0x692b('0xb')][_0x692b('0xd')]);}logger[_0x692b('0xb')](_0x692b('0xe'),_0x1d35da,_0x3e01d2[_0x692b('0xb')][_0x692b('0xd')]);return _0x5093da(_0x3e01d2['error'][_0x692b('0xd')]);}else{logger[_0x692b('0xf')](_0x692b('0xe'),_0x1d35da,_0x692b('0x8'));_0x5093da(_0x3e01d2[_0x692b('0x10')]['message']);}})[_0x692b('0x11')](function(_0x54d9be){logger[_0x692b('0xb')](_0x692b('0xe'),_0x1d35da,_0x54d9be);_0x217aab(_0x54d9be);});});}exports[_0x692b('0x12')]=function(_0x3b34af){var _0xfc42b=this;return new Promise(function(_0x1f7b8d,_0x5c46df){return db['Sound'][_0x692b('0x13')]({'raw':_0x3b34af[_0x692b('0x14')]?_0x3b34af[_0x692b('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3b34af[_0x692b('0x14')]?_0x3b34af['options'][_0x692b('0x15')]||null:null,'attributes':_0x3b34af[_0x692b('0x14')]?_0x3b34af[_0x692b('0x14')][_0x692b('0x16')]||null:null,'include':_0x3b34af[_0x692b('0x14')]?_0x3b34af[_0x692b('0x14')][_0x692b('0x17')]?_[_0x692b('0x18')](_0x3b34af[_0x692b('0x14')][_0x692b('0x17')],function(_0x474a87){return{'model':db[_0x474a87[_0x692b('0x19')]],'as':_0x474a87['as'],'attributes':_0x474a87[_0x692b('0x16')],'include':_0x474a87[_0x692b('0x17')]?_[_0x692b('0x18')](_0x474a87[_0x692b('0x17')],function(_0x22950e){return{'model':db[_0x22950e[_0x692b('0x19')]],'as':_0x22950e['as'],'attributes':_0x22950e[_0x692b('0x16')],'include':_0x22950e[_0x692b('0x17')]?_[_0x692b('0x18')](_0x22950e[_0x692b('0x17')],function(_0x3c7e3b){return{'model':db[_0x3c7e3b['model']],'as':_0x3c7e3b['as'],'attributes':_0x3c7e3b[_0x692b('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x554f82){logger[_0x692b('0xf')](_0x692b('0x12'),_0x3b34af);logger[_0x692b('0x9')](_0x692b('0x12'),_0x3b34af,JSON[_0x692b('0x1a')](_0x554f82));_0x1f7b8d(_0x554f82);})[_0x692b('0x11')](function(_0x224d6d){logger['error']('ShowSound',_0x224d6d['message'],_0x3b34af);_0x5c46df(_0xfc42b['error'](0x1f4,_0x224d6d[_0x692b('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index a88d3bb..bfccd64 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(_0x3a2a76,_0x2cf8a2){var _0xd2e300=function(_0x444515){while(--_0x444515){_0x3a2a76['push'](_0x3a2a76['shift']());}};_0xd2e300(++_0x2cf8a2);}(_0x5eb8,0xb0));var _0x85eb=function(_0x2867d8,_0xef3ee0){_0x2867d8=_0x2867d8-0x0;var _0x3b8176=_0x5eb8[_0x2867d8];return _0x3b8176;};'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 _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareMessage.controller'];(function(_0x5c374a,_0x3a6020){var _0x5cc816=function(_0x43bc11){while(--_0x43bc11){_0x5c374a['push'](_0x5c374a['shift']());}};_0x5cc816(++_0x3a6020);}(_0x14a0,0x8e));var _0x014a=function(_0x229397,_0x2cf584){_0x229397=_0x229397-0x0;var _0x1a3401=_0x14a0[_0x229397];return _0x1a3401;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 1868264..10a1a6b 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 _0xfcf5=['out','sequelize','exports','STRING','TEXT','medium','ENUM'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xfcf5,0x17b));var _0x5fcf=function(_0x439ee3,_0x5b1e9b){_0x439ee3=_0x439ee3-0x0;var _0x5d49a8=_0xfcf5[_0x439ee3];return _0x5d49a8;};'use strict';var Sequelize=require(_0x5fcf('0x0'));module[_0x5fcf('0x1')]={'uniqueid':{'type':Sequelize[_0x5fcf('0x2')]},'body':{'type':Sequelize[_0x5fcf('0x3')](_0x5fcf('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x5fcf('0x5')]('in',_0x5fcf('0x6')),'defaultValue':_0x5fcf('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0x5fcf('0x2')]},'providerResponse':{'type':Sequelize[_0x5fcf('0x3')]}}; \ No newline at end of file +var _0xdee0=['exports','STRING','TEXT','medium','ENUM','out','sequelize'];(function(_0x340bd4,_0x4f2f7f){var _0x5181df=function(_0x3d4323){while(--_0x3d4323){_0x340bd4['push'](_0x340bd4['shift']());}};_0x5181df(++_0x4f2f7f);}(_0xdee0,0x187));var _0x0dee=function(_0x581432,_0x46a929){_0x581432=_0x581432-0x0;var _0x55bd1a=_0xdee0[_0x581432];return _0x55bd1a;};'use strict';var Sequelize=require(_0x0dee('0x0'));module[_0x0dee('0x1')]={'uniqueid':{'type':Sequelize[_0x0dee('0x2')]},'body':{'type':Sequelize[_0x0dee('0x3')](_0x0dee('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x0dee('0x5')]('in',_0x0dee('0x6')),'defaultValue':_0x0dee('0x6'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'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 e492cc2..1c5b304 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 _0x6d11=['lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','apply','reject','then','destroy','stack','name','send','index','map','SquareMessage','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','show','params','fields','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra'];(function(_0x4e7664,_0x463b3a){var _0x1dd5d8=function(_0x57e26c){while(--_0x57e26c){_0x4e7664['push'](_0x4e7664['shift']());}};_0x1dd5d8(++_0x463b3a);}(_0x6d11,0xbf));var _0x16d1=function(_0x3d8995,_0x5f4f4b){_0x3d8995=_0x3d8995-0x0;var _0x5dd8ed=_0x6d11[_0x3d8995];return _0x5dd8ed;};'use strict';var emlformat=require(_0x16d1('0x0'));var rimraf=require(_0x16d1('0x1'));var zipdir=require(_0x16d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16d1('0x3'));var moment=require('moment');var BPromise=require(_0x16d1('0x4'));var Mustache=require(_0x16d1('0x5'));var util=require('util');var path=require('path');var sox=require(_0x16d1('0x6'));var csv=require(_0x16d1('0x7'));var ejs=require(_0x16d1('0x8'));var fs=require('fs');var fs_extra=require(_0x16d1('0x9'));var _=require(_0x16d1('0xa'));var squel=require(_0x16d1('0xb'));var crypto=require(_0x16d1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x16d1('0xd'));var Papa=require(_0x16d1('0xe'));var Redis=require(_0x16d1('0xf'));var authService=require(_0x16d1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x16d1('0x11'));var hardwareService=require(_0x16d1('0x12'));var logger=require(_0x16d1('0x13'))(_0x16d1('0x14'));var utils=require(_0x16d1('0x15'));var config=require(_0x16d1('0x16'));var licenseUtil=require(_0x16d1('0x17'));var db=require(_0x16d1('0x18'))['db'];function respondWithStatusCode(_0x4de260,_0x32fa68){_0x32fa68=_0x32fa68||0xcc;return function(_0x2e71fa){if(_0x2e71fa){return _0x4de260[_0x16d1('0x19')](_0x32fa68);}return _0x4de260[_0x16d1('0x1a')](_0x32fa68)[_0x16d1('0x1b')]();};}function respondWithResult(_0x5a1429,_0xc034b7){_0xc034b7=_0xc034b7||0xc8;return function(_0x1b71d3){if(_0x1b71d3){return _0x5a1429[_0x16d1('0x1a')](_0xc034b7)[_0x16d1('0x1c')](_0x1b71d3);}};}function respondWithFilteredResult(_0x29ebba,_0x173e16){return function(_0x2d7e8a){if(_0x2d7e8a){var _0x4ee46c=typeof _0x173e16[_0x16d1('0x1d')]===_0x16d1('0x1e')&&typeof _0x173e16['limit']==='undefined';var _0x1a9ec8=_0x2d7e8a['count'];var _0x46a25e=_0x4ee46c?0x0:_0x173e16['offset'];var _0x1da1b8=_0x4ee46c?_0x2d7e8a['count']:_0x173e16[_0x16d1('0x1d')]+_0x173e16[_0x16d1('0x1f')];var _0x48cd70;if(_0x1da1b8>=_0x1a9ec8){_0x1da1b8=_0x1a9ec8;_0x48cd70=0xc8;}else{_0x48cd70=0xce;}_0x29ebba['status'](_0x48cd70);return _0x29ebba['set']('Content-Range',_0x46a25e+'-'+_0x1da1b8+'/'+_0x1a9ec8)[_0x16d1('0x1c')](_0x2d7e8a);}return null;};}function patchUpdates(_0x55a0e0){return function(_0x34b88f){try{jsonpatch[_0x16d1('0x20')](_0x34b88f,_0x55a0e0,!![]);}catch(_0x1f6add){return BPromise[_0x16d1('0x21')](_0x1f6add);}return _0x34b88f['save']();};}function saveUpdates(_0x2c7825,_0x58a03b){return function(_0x2a897d){if(_0x2a897d){return _0x2a897d['update'](_0x2c7825)[_0x16d1('0x22')](function(_0x8c7266){return _0x8c7266;});}return null;};}function removeEntity(_0x17e038,_0x47cad4){return function(_0x215c23){if(_0x215c23){return _0x215c23[_0x16d1('0x23')]()[_0x16d1('0x22')](function(){_0x17e038[_0x16d1('0x1a')](0xcc)[_0x16d1('0x1b')]();});}};}function handleEntityNotFound(_0x335c24,_0x4b2b5c){return function(_0x15203b){if(!_0x15203b){_0x335c24[_0x16d1('0x19')](0x194);}return _0x15203b;};}function handleError(_0x262f89,_0x346b69){_0x346b69=_0x346b69||0x1f4;return function(_0x2b8403){logger['error'](_0x2b8403[_0x16d1('0x24')]);if(_0x2b8403[_0x16d1('0x25')]){delete _0x2b8403[_0x16d1('0x25')];}_0x262f89['status'](_0x346b69)[_0x16d1('0x26')](_0x2b8403);};}exports[_0x16d1('0x27')]=function(_0x364bf7,_0x22e5b3){var _0x6396fc={},_0x462e5b={},_0x1dd574={'count':0x0,'rows':[]};var _0x562908=_[_0x16d1('0x28')](db[_0x16d1('0x29')][_0x16d1('0x2a')],function(_0x30cd8f){return{'name':_0x30cd8f['fieldName'],'type':_0x30cd8f['type'][_0x16d1('0x2b')]};});_0x462e5b[_0x16d1('0x2c')]=_[_0x16d1('0x28')](_0x562908,_0x16d1('0x25'));_0x462e5b[_0x16d1('0x2d')]=_[_0x16d1('0x2e')](_0x364bf7[_0x16d1('0x2d')]);_0x462e5b[_0x16d1('0x2f')]=_[_0x16d1('0x30')](_0x462e5b[_0x16d1('0x2c')],_0x462e5b[_0x16d1('0x2d')]);_0x6396fc[_0x16d1('0x31')]=_[_0x16d1('0x30')](_0x462e5b[_0x16d1('0x2c')],qs['fields'](_0x364bf7[_0x16d1('0x2d')]['fields']));_0x6396fc[_0x16d1('0x31')]=_0x6396fc[_0x16d1('0x31')][_0x16d1('0x32')]?_0x6396fc[_0x16d1('0x31')]:_0x462e5b[_0x16d1('0x2c')];if(!_0x364bf7[_0x16d1('0x2d')]['hasOwnProperty']('nolimit')){_0x6396fc['limit']=qs[_0x16d1('0x1f')](_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x1f')]);_0x6396fc[_0x16d1('0x1d')]=qs['offset'](_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x1d')]);}_0x6396fc['order']=qs['sort'](_0x364bf7['query'][_0x16d1('0x33')]);_0x6396fc[_0x16d1('0x34')]=qs[_0x16d1('0x2f')](_['pick'](_0x364bf7[_0x16d1('0x2d')],_0x462e5b[_0x16d1('0x2f')]),_0x562908);if(_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x35')]){_0x6396fc[_0x16d1('0x34')]=_[_0x16d1('0x36')](_0x6396fc[_0x16d1('0x34')],{'$or':_['map'](_0x562908,function(_0x50267b){if(_0x50267b['type']!==_0x16d1('0x37')){var _0x2306d3={};_0x2306d3[_0x50267b[_0x16d1('0x25')]]={'$like':'%'+_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x35')]+'%'};return _0x2306d3;}})});}_0x6396fc=_[_0x16d1('0x36')]({},_0x6396fc,_0x364bf7[_0x16d1('0x38')]);var _0x369b1c={'where':_0x6396fc['where']};return db[_0x16d1('0x29')]['count'](_0x369b1c)['then'](function(_0x352c5b){_0x1dd574[_0x16d1('0x39')]=_0x352c5b;if(_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x3a')]){_0x6396fc[_0x16d1('0x3b')]=[{'all':!![]}];}return db[_0x16d1('0x29')]['findAll'](_0x6396fc);})[_0x16d1('0x22')](function(_0x525212){_0x1dd574['rows']=_0x525212;return _0x1dd574;})['then'](respondWithFilteredResult(_0x22e5b3,_0x6396fc))['catch'](handleError(_0x22e5b3,null));};exports[_0x16d1('0x3c')]=function(_0x168e14,_0x24038b){var _0x1eb761={'raw':!![],'where':{'id':_0x168e14[_0x16d1('0x3d')]['id']}},_0x53de06={};_0x53de06['model']=_[_0x16d1('0x2e')](db[_0x16d1('0x29')][_0x16d1('0x2a')]);_0x53de06[_0x16d1('0x2d')]=_[_0x16d1('0x2e')](_0x168e14[_0x16d1('0x2d')]);_0x53de06[_0x16d1('0x2f')]=_[_0x16d1('0x30')](_0x53de06[_0x16d1('0x2c')],_0x53de06[_0x16d1('0x2d')]);_0x1eb761[_0x16d1('0x31')]=_[_0x16d1('0x30')](_0x53de06[_0x16d1('0x2c')],qs[_0x16d1('0x3e')](_0x168e14[_0x16d1('0x2d')]['fields']));_0x1eb761['attributes']=_0x1eb761[_0x16d1('0x31')][_0x16d1('0x32')]?_0x1eb761[_0x16d1('0x31')]:_0x53de06[_0x16d1('0x2c')];if(_0x168e14[_0x16d1('0x2d')][_0x16d1('0x3a')]){_0x1eb761['include']=[{'all':!![]}];}_0x1eb761=_[_0x16d1('0x36')]({},_0x1eb761,_0x168e14[_0x16d1('0x38')]);return db[_0x16d1('0x29')]['find'](_0x1eb761)['then'](handleEntityNotFound(_0x24038b,null))[_0x16d1('0x22')](respondWithResult(_0x24038b,null))[_0x16d1('0x3f')](handleError(_0x24038b,null));};exports['create']=function(_0x1cc137,_0x583151){return db[_0x16d1('0x29')][_0x16d1('0x40')](_0x1cc137[_0x16d1('0x41')],{})[_0x16d1('0x22')](respondWithResult(_0x583151,0xc9))['catch'](handleError(_0x583151,null));};exports['update']=function(_0x1d92cd,_0x8bb0c1){if(_0x1d92cd['body']['id']){delete _0x1d92cd[_0x16d1('0x41')]['id'];}return db[_0x16d1('0x29')][_0x16d1('0x42')]({'where':{'id':_0x1d92cd[_0x16d1('0x3d')]['id']}})[_0x16d1('0x22')](handleEntityNotFound(_0x8bb0c1,null))['then'](saveUpdates(_0x1d92cd[_0x16d1('0x41')],null))['then'](respondWithResult(_0x8bb0c1,null))[_0x16d1('0x3f')](handleError(_0x8bb0c1,null));};exports[_0x16d1('0x23')]=function(_0x5d384c,_0x413acd){return db[_0x16d1('0x29')][_0x16d1('0x42')]({'where':{'id':_0x5d384c[_0x16d1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x413acd,null))['then'](removeEntity(_0x413acd,null))['catch'](handleError(_0x413acd,null));}; \ No newline at end of file +var _0x04fa=['intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','type','filter','options','includeAll','include','SquareMessage','rows','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','key','model','query','keys','filters'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x04fa,0x119));var _0xa04f=function(_0x2f17e5,_0x2c56bc){_0x2f17e5=_0x2f17e5-0x0;var _0x5ba481=_0x04fa[_0x2f17e5];return _0x5ba481;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa04f('0x0'));var zipdir=require(_0xa04f('0x1'));var jsonpatch=require(_0xa04f('0x2'));var rp=require(_0xa04f('0x3'));var moment=require(_0xa04f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa04f('0x5'));var util=require('util');var path=require(_0xa04f('0x6'));var sox=require(_0xa04f('0x7'));var csv=require(_0xa04f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa04f('0x9'));var _=require(_0xa04f('0xa'));var squel=require(_0xa04f('0xb'));var crypto=require('crypto');var jsforce=require(_0xa04f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa04f('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa04f('0xe'));var hardwareService=require(_0xa04f('0xf'));var logger=require('../../config/logger')(_0xa04f('0x10'));var utils=require('../../config/utils');var config=require(_0xa04f('0x11'));var licenseUtil=require(_0xa04f('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x155b4f,_0x46687a){_0x46687a=_0x46687a||0xcc;return function(_0x5671c2){if(_0x5671c2){return _0x155b4f['sendStatus'](_0x46687a);}return _0x155b4f['status'](_0x46687a)[_0xa04f('0x13')]();};}function respondWithResult(_0x3254ea,_0x3d57cb){_0x3d57cb=_0x3d57cb||0xc8;return function(_0xb396b){if(_0xb396b){return _0x3254ea[_0xa04f('0x14')](_0x3d57cb)[_0xa04f('0x15')](_0xb396b);}};}function respondWithFilteredResult(_0x5b4afd,_0xf25bd){return function(_0x2737f2){if(_0x2737f2){var _0x509830=typeof _0xf25bd[_0xa04f('0x16')]===_0xa04f('0x17')&&typeof _0xf25bd[_0xa04f('0x18')]===_0xa04f('0x17');var _0x4e5908=_0x2737f2[_0xa04f('0x19')];var _0x5d59d5=_0x509830?0x0:_0xf25bd[_0xa04f('0x16')];var _0x25bb59=_0x509830?_0x2737f2['count']:_0xf25bd[_0xa04f('0x16')]+_0xf25bd[_0xa04f('0x18')];var _0x31e707;if(_0x25bb59>=_0x4e5908){_0x25bb59=_0x4e5908;_0x31e707=0xc8;}else{_0x31e707=0xce;}_0x5b4afd['status'](_0x31e707);return _0x5b4afd['set'](_0xa04f('0x1a'),_0x5d59d5+'-'+_0x25bb59+'/'+_0x4e5908)['json'](_0x2737f2);}return null;};}function patchUpdates(_0x5d68f4){return function(_0x141fc8){try{jsonpatch[_0xa04f('0x1b')](_0x141fc8,_0x5d68f4,!![]);}catch(_0x48f760){return BPromise['reject'](_0x48f760);}return _0x141fc8[_0xa04f('0x1c')]();};}function saveUpdates(_0x13fdb1,_0x17d471){return function(_0x3f7268){if(_0x3f7268){return _0x3f7268[_0xa04f('0x1d')](_0x13fdb1)[_0xa04f('0x1e')](function(_0x600bfa){return _0x600bfa;});}return null;};}function removeEntity(_0x40bc69,_0x28dc9b){return function(_0x3ee16d){if(_0x3ee16d){return _0x3ee16d[_0xa04f('0x1f')]()[_0xa04f('0x1e')](function(){_0x40bc69[_0xa04f('0x14')](0xcc)[_0xa04f('0x13')]();});}};}function handleEntityNotFound(_0x5123db,_0x18c13e){return function(_0xee0a84){if(!_0xee0a84){_0x5123db[_0xa04f('0x20')](0x194);}return _0xee0a84;};}function handleError(_0x48f242,_0x54ed09){_0x54ed09=_0x54ed09||0x1f4;return function(_0x3faa79){logger[_0xa04f('0x21')](_0x3faa79[_0xa04f('0x22')]);if(_0x3faa79['name']){delete _0x3faa79[_0xa04f('0x23')];}_0x48f242[_0xa04f('0x14')](_0x54ed09)[_0xa04f('0x24')](_0x3faa79);};}exports['index']=function(_0x3c6ccd,_0x1c0cc5){var _0x25a96f={},_0x7e0865={},_0x1e441c={'count':0x0,'rows':[]};var _0x24cf00=_[_0xa04f('0x25')](db['SquareMessage'][_0xa04f('0x26')],function(_0x3e3395){return{'name':_0x3e3395['fieldName'],'type':_0x3e3395['type'][_0xa04f('0x27')]};});_0x7e0865[_0xa04f('0x28')]=_[_0xa04f('0x25')](_0x24cf00,_0xa04f('0x23'));_0x7e0865[_0xa04f('0x29')]=_[_0xa04f('0x2a')](_0x3c6ccd['query']);_0x7e0865[_0xa04f('0x2b')]=_[_0xa04f('0x2c')](_0x7e0865[_0xa04f('0x28')],_0x7e0865['query']);_0x25a96f['attributes']=_['intersection'](_0x7e0865[_0xa04f('0x28')],qs[_0xa04f('0x2d')](_0x3c6ccd[_0xa04f('0x29')]['fields']));_0x25a96f['attributes']=_0x25a96f[_0xa04f('0x2e')][_0xa04f('0x2f')]?_0x25a96f[_0xa04f('0x2e')]:_0x7e0865[_0xa04f('0x28')];if(!_0x3c6ccd[_0xa04f('0x29')][_0xa04f('0x30')]('nolimit')){_0x25a96f[_0xa04f('0x18')]=qs[_0xa04f('0x18')](_0x3c6ccd[_0xa04f('0x29')]['limit']);_0x25a96f[_0xa04f('0x16')]=qs[_0xa04f('0x16')](_0x3c6ccd[_0xa04f('0x29')][_0xa04f('0x16')]);}_0x25a96f['order']=qs['sort'](_0x3c6ccd['query'][_0xa04f('0x31')]);_0x25a96f[_0xa04f('0x32')]=qs[_0xa04f('0x2b')](_[_0xa04f('0x33')](_0x3c6ccd[_0xa04f('0x29')],_0x7e0865[_0xa04f('0x2b')]),_0x24cf00);if(_0x3c6ccd['query']['filter']){_0x25a96f['where']=_[_0xa04f('0x34')](_0x25a96f[_0xa04f('0x32')],{'$or':_['map'](_0x24cf00,function(_0x3c9639){if(_0x3c9639[_0xa04f('0x35')]!=='VIRTUAL'){var _0x59e7ce={};_0x59e7ce[_0x3c9639[_0xa04f('0x23')]]={'$like':'%'+_0x3c6ccd[_0xa04f('0x29')][_0xa04f('0x36')]+'%'};return _0x59e7ce;}})});}_0x25a96f=_[_0xa04f('0x34')]({},_0x25a96f,_0x3c6ccd[_0xa04f('0x37')]);var _0x30b6e7={'where':_0x25a96f[_0xa04f('0x32')]};return db['SquareMessage'][_0xa04f('0x19')](_0x30b6e7)['then'](function(_0x18b1ae){_0x1e441c['count']=_0x18b1ae;if(_0x3c6ccd[_0xa04f('0x29')][_0xa04f('0x38')]){_0x25a96f[_0xa04f('0x39')]=[{'all':!![]}];}return db[_0xa04f('0x3a')]['findAll'](_0x25a96f);})[_0xa04f('0x1e')](function(_0x5aecf2){_0x1e441c[_0xa04f('0x3b')]=_0x5aecf2;return _0x1e441c;})[_0xa04f('0x1e')](respondWithFilteredResult(_0x1c0cc5,_0x25a96f))[_0xa04f('0x3c')](handleError(_0x1c0cc5,null));};exports['show']=function(_0x54ea98,_0x5abd61){var _0x731d6b={'raw':!![],'where':{'id':_0x54ea98[_0xa04f('0x3d')]['id']}},_0x34a56b={};_0x34a56b['model']=_[_0xa04f('0x2a')](db[_0xa04f('0x3a')][_0xa04f('0x26')]);_0x34a56b['query']=_[_0xa04f('0x2a')](_0x54ea98[_0xa04f('0x29')]);_0x34a56b[_0xa04f('0x2b')]=_[_0xa04f('0x2c')](_0x34a56b[_0xa04f('0x28')],_0x34a56b[_0xa04f('0x29')]);_0x731d6b[_0xa04f('0x2e')]=_[_0xa04f('0x2c')](_0x34a56b[_0xa04f('0x28')],qs[_0xa04f('0x2d')](_0x54ea98[_0xa04f('0x29')]['fields']));_0x731d6b['attributes']=_0x731d6b[_0xa04f('0x2e')][_0xa04f('0x2f')]?_0x731d6b[_0xa04f('0x2e')]:_0x34a56b['model'];if(_0x54ea98[_0xa04f('0x29')][_0xa04f('0x38')]){_0x731d6b[_0xa04f('0x39')]=[{'all':!![]}];}_0x731d6b=_[_0xa04f('0x34')]({},_0x731d6b,_0x54ea98['options']);return db[_0xa04f('0x3a')][_0xa04f('0x3e')](_0x731d6b)[_0xa04f('0x1e')](handleEntityNotFound(_0x5abd61,null))[_0xa04f('0x1e')](respondWithResult(_0x5abd61,null))[_0xa04f('0x3c')](handleError(_0x5abd61,null));};exports[_0xa04f('0x3f')]=function(_0x1d4f25,_0x1a7ea5){return db[_0xa04f('0x3a')]['create'](_0x1d4f25[_0xa04f('0x40')],{})['then'](respondWithResult(_0x1a7ea5,0xc9))[_0xa04f('0x3c')](handleError(_0x1a7ea5,null));};exports[_0xa04f('0x1d')]=function(_0x246d5e,_0x18c591){if(_0x246d5e[_0xa04f('0x40')]['id']){delete _0x246d5e['body']['id'];}return db['SquareMessage'][_0xa04f('0x3e')]({'where':{'id':_0x246d5e[_0xa04f('0x3d')]['id']}})[_0xa04f('0x1e')](handleEntityNotFound(_0x18c591,null))['then'](saveUpdates(_0x246d5e[_0xa04f('0x40')],null))[_0xa04f('0x1e')](respondWithResult(_0x18c591,null))['catch'](handleError(_0x18c591,null));};exports[_0xa04f('0x1f')]=function(_0x518bf4,_0x12ccd2){return db['SquareMessage'][_0xa04f('0x3e')]({'where':{'id':_0x518bf4[_0xa04f('0x3d')]['id']}})['then'](handleEntityNotFound(_0x12ccd2,null))[_0xa04f('0x1e')](removeEntity(_0x12ccd2,null))['catch'](handleError(_0x12ccd2,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 2f9d464..5ad2907 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 _0xc808=['path','rimraf','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','bluebird','request-promise'];(function(_0x2c1aa4,_0x25b489){var _0x4afc0b=function(_0x34a9b5){while(--_0x34a9b5){_0x2c1aa4['push'](_0x2c1aa4['shift']());}};_0x4afc0b(++_0x25b489);}(_0xc808,0x1ca));var _0x8c80=function(_0x2d0d9f,_0x22c0d8){_0x2d0d9f=_0x2d0d9f-0x0;var _0x30243d=_0xc808[_0x2d0d9f];return _0x30243d;};'use strict';var _=require(_0x8c80('0x0'));var util=require(_0x8c80('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8c80('0x2'));var rp=require(_0x8c80('0x3'));var fs=require('fs');var path=require(_0x8c80('0x4'));var rimraf=require(_0x8c80('0x5'));var config=require('../../config/environment');var attributes=require(_0x8c80('0x6'));module[_0x8c80('0x7')]=function(_0x320cff,_0x1b76c7){return _0x320cff[_0x8c80('0x8')](_0x8c80('0x9'),attributes,{'tableName':_0x8c80('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e35=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','define','square_messages','lodash'];(function(_0x479538,_0x26714d){var _0x475d79=function(_0xb1c6bf){while(--_0xb1c6bf){_0x479538['push'](_0x479538['shift']());}};_0x475d79(++_0x26714d);}(_0x3e35,0xbf));var _0x53e3=function(_0x36bc58,_0x27f03c){_0x36bc58=_0x36bc58-0x0;var _0x4a547e=_0x3e35[_0x36bc58];return _0x4a547e;};'use strict';var _=require(_0x53e3('0x0'));var util=require(_0x53e3('0x1'));var logger=require(_0x53e3('0x2'))('api');var moment=require(_0x53e3('0x3'));var BPromise=require(_0x53e3('0x4'));var rp=require(_0x53e3('0x5'));var fs=require('fs');var path=require(_0x53e3('0x6'));var rimraf=require(_0x53e3('0x7'));var config=require(_0x53e3('0x8'));var attributes=require(_0x53e3('0x9'));module['exports']=function(_0x24f82b,_0x1d8808){return _0x24f82b[_0x53e3('0xa')]('SquareMessage',attributes,{'tableName':_0x53e3('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 4004bcd..e95d58b 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 _0xd410=['request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x25a42a,_0x3d489b){var _0x1129b1=function(_0x4ae61b){while(--_0x4ae61b){_0x25a42a['push'](_0x25a42a['shift']());}};_0x1129b1(++_0x3d489b);}(_0xd410,0x6c));var _0x0d41=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xd410[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0d41('0x0'));var util=require(_0x0d41('0x1'));var moment=require(_0x0d41('0x2'));var BPromise=require(_0x0d41('0x3'));var rs=require(_0x0d41('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0d41('0x5'));var logger=require(_0x0d41('0x6'))(_0x0d41('0x7'));var config=require(_0x0d41('0x8'));var jayson=require(_0x0d41('0x9'));var client=jayson[_0x0d41('0xa')][_0x0d41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2de8e7,_0x4ad80c,_0x351f19){return new BPromise(function(_0x142a90,_0x42ae8f){return client[_0x0d41('0xc')](_0x2de8e7,_0x351f19)[_0x0d41('0xd')](function(_0x2f09d8){logger[_0x0d41('0xe')](_0x0d41('0xf'),_0x4ad80c,_0x0d41('0x10'));logger[_0x0d41('0x11')](_0x0d41('0x12'),_0x4ad80c,_0x0d41('0x10'),JSON[_0x0d41('0x13')](_0x2f09d8));if(_0x2f09d8['error']){if(_0x2f09d8[_0x0d41('0x14')][_0x0d41('0x15')]===0x1f4){logger['error'](_0x0d41('0xf'),_0x4ad80c,_0x2f09d8[_0x0d41('0x14')]['message']);return _0x42ae8f(_0x2f09d8[_0x0d41('0x14')]['message']);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x4ad80c,_0x2f09d8[_0x0d41('0x14')][_0x0d41('0x16')]);return _0x142a90(_0x2f09d8[_0x0d41('0x14')][_0x0d41('0x16')]);}else{logger[_0x0d41('0xe')](_0x0d41('0xf'),_0x4ad80c,_0x0d41('0x10'));_0x142a90(_0x2f09d8[_0x0d41('0x17')][_0x0d41('0x16')]);}})[_0x0d41('0x18')](function(_0x141d06){logger[_0x0d41('0x14')](_0x0d41('0xf'),_0x4ad80c,_0x141d06);_0x42ae8f(_0x141d06);});});}exports[_0x0d41('0x19')]=function(_0x45a497){var _0x52b854=this;return new Promise(function(_0x47d0ad,_0x5dea4e){return db[_0x0d41('0x1a')][_0x0d41('0x1b')](_0x45a497[_0x0d41('0x1c')],{'raw':_0x45a497[_0x0d41('0x1d')]?_0x45a497[_0x0d41('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x0d41('0xd')](function(_0x4cd2b3){logger[_0x0d41('0xe')](_0x0d41('0x19'),_0x45a497);logger[_0x0d41('0x11')](_0x0d41('0x19'),_0x45a497,JSON[_0x0d41('0x13')](_0x4cd2b3));_0x47d0ad(_0x4cd2b3);})[_0x0d41('0x18')](function(_0x4b2ea6){logger[_0x0d41('0x14')](_0x0d41('0x19'),_0x4b2ea6[_0x0d41('0x16')],_0x45a497);_0x5dea4e(_0x52b854['error'](0x1f4,_0x4b2ea6[_0x0d41('0x16')]));});});}; \ No newline at end of file +var _0xe3a9=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','lodash','util','bluebird','randomstring'];(function(_0x223fcc,_0x2d7467){var _0x58a774=function(_0x477b05){while(--_0x477b05){_0x223fcc['push'](_0x223fcc['shift']());}};_0x58a774(++_0x2d7467);}(_0xe3a9,0x170));var _0x9e3a=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0xe3a9[_0x44216d];return _0xeca523;};'use strict';var _=require(_0x9e3a('0x0'));var util=require(_0x9e3a('0x1'));var moment=require('moment');var BPromise=require(_0x9e3a('0x2'));var rs=require(_0x9e3a('0x3'));var fs=require('fs');var Redis=require(_0x9e3a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e3a('0x5'));var logger=require(_0x9e3a('0x6'))(_0x9e3a('0x7'));var config=require(_0x9e3a('0x8'));var jayson=require(_0x9e3a('0x9'));var client=jayson[_0x9e3a('0xa')][_0x9e3a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f629a,_0xb60e00,_0x33b54d){return new BPromise(function(_0x20d35f,_0x56c8ec){return client[_0x9e3a('0xc')](_0x4f629a,_0x33b54d)[_0x9e3a('0xd')](function(_0x337a5f){logger[_0x9e3a('0xe')](_0x9e3a('0xf'),_0xb60e00,_0x9e3a('0x10'));logger[_0x9e3a('0x11')](_0x9e3a('0x12'),_0xb60e00,_0x9e3a('0x10'),JSON[_0x9e3a('0x13')](_0x337a5f));if(_0x337a5f[_0x9e3a('0x14')]){if(_0x337a5f['error'][_0x9e3a('0x15')]===0x1f4){logger[_0x9e3a('0x14')](_0x9e3a('0xf'),_0xb60e00,_0x337a5f[_0x9e3a('0x14')]['message']);return _0x56c8ec(_0x337a5f['error'][_0x9e3a('0x16')]);}logger[_0x9e3a('0x14')]('SquareMessage,\x20%s,\x20%s',_0xb60e00,_0x337a5f[_0x9e3a('0x14')][_0x9e3a('0x16')]);return _0x20d35f(_0x337a5f['error'][_0x9e3a('0x16')]);}else{logger[_0x9e3a('0xe')](_0x9e3a('0xf'),_0xb60e00,_0x9e3a('0x10'));_0x20d35f(_0x337a5f[_0x9e3a('0x17')][_0x9e3a('0x16')]);}})[_0x9e3a('0x18')](function(_0x448d11){logger[_0x9e3a('0x14')](_0x9e3a('0xf'),_0xb60e00,_0x448d11);_0x56c8ec(_0x448d11);});});}exports['CreateSquareMessage']=function(_0x447439){var _0xf508a8=this;return new Promise(function(_0x156789,_0x1c341d){return db[_0x9e3a('0x19')][_0x9e3a('0x1a')](_0x447439[_0x9e3a('0x1b')],{'raw':_0x447439[_0x9e3a('0x1c')]?_0x447439[_0x9e3a('0x1c')][_0x9e3a('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x191fcc){logger[_0x9e3a('0xe')](_0x9e3a('0x1e'),_0x447439);logger[_0x9e3a('0x11')](_0x9e3a('0x1e'),_0x447439,JSON[_0x9e3a('0x13')](_0x191fcc));_0x156789(_0x191fcc);})[_0x9e3a('0x18')](function(_0x23f300){logger[_0x9e3a('0x14')]('CreateSquareMessage',_0x23f300[_0x9e3a('0x16')],_0x447439);_0x1c341d(_0xf508a8[_0x9e3a('0x14')](0x1f4,_0x23f300[_0x9e3a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 5178d1e..c26e24e 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 _0x62aa=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','index','/:id','show','/:id/test','isAuthenticated','15s','test','post','create','put','update','delete'];(function(_0x3b7312,_0x1966a2){var _0x3c05fa=function(_0x49d243){while(--_0x49d243){_0x3b7312['push'](_0x3b7312['shift']());}};_0x3c05fa(++_0x1966a2);}(_0x62aa,0xfe));var _0xa62a=function(_0x2f8640,_0x2e4ec2){_0x2f8640=_0x2f8640-0x0;var _0x43bd4d=_0x62aa[_0x2f8640];return _0x43bd4d;};'use strict';var multer=require(_0xa62a('0x0'));var util=require('util');var path=require(_0xa62a('0x1'));var timeout=require(_0xa62a('0x2'));var express=require('express');var router=express[_0xa62a('0x3')]();var fs_extra=require(_0xa62a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa62a('0x5'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0xa62a('0x6')]('/',auth['isAuthenticated'](),controller[_0xa62a('0x7')]);router[_0xa62a('0x6')](_0xa62a('0x8'),auth['isAuthenticated'](),controller[_0xa62a('0x9')]);router[_0xa62a('0x6')](_0xa62a('0xa'),auth[_0xa62a('0xb')](),timeout(_0xa62a('0xc')),controller[_0xa62a('0xd')]);router[_0xa62a('0xe')]('/',auth['isAuthenticated'](),controller[_0xa62a('0xf')]);router[_0xa62a('0x10')](_0xa62a('0x8'),auth[_0xa62a('0xb')](),controller[_0xa62a('0x11')]);router[_0xa62a('0x12')]('/:id',auth[_0xa62a('0xb')](),controller[_0xa62a('0x13')]);module[_0xa62a('0x14')]=router; \ No newline at end of file +var _0xc490=['update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','15s','test','post','create'];(function(_0x4e3f4a,_0xb7a63a){var _0x46c686=function(_0x2fc27f){while(--_0x2fc27f){_0x4e3f4a['push'](_0x4e3f4a['shift']());}};_0x46c686(++_0xb7a63a);}(_0xc490,0xc9));var _0x0c49=function(_0x362c81,_0xad509a){_0x362c81=_0x362c81-0x0;var _0x111ed7=_0xc490[_0x362c81];return _0x111ed7;};'use strict';var multer=require(_0x0c49('0x0'));var util=require('util');var path=require(_0x0c49('0x1'));var timeout=require('connect-timeout');var express=require(_0x0c49('0x2'));var router=express[_0x0c49('0x3')]();var fs_extra=require(_0x0c49('0x4'));var auth=require(_0x0c49('0x5'));var interaction=require(_0x0c49('0x6'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0x0c49('0x7')]('/',auth[_0x0c49('0x8')](),controller['index']);router[_0x0c49('0x7')](_0x0c49('0x9'),auth[_0x0c49('0x8')](),controller[_0x0c49('0xa')]);router[_0x0c49('0x7')]('/:id/test',auth[_0x0c49('0x8')](),timeout(_0x0c49('0xb')),controller[_0x0c49('0xc')]);router[_0x0c49('0xd')]('/',auth[_0x0c49('0x8')](),controller[_0x0c49('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0c49('0xf')]);router['delete'](_0x0c49('0x9'),auth[_0x0c49('0x8')](),controller[_0x0c49('0x10')]);module[_0x0c49('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 991ee2a..3297f64 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 _0x99a2=['exports','STRING','name','sequelize'];(function(_0x57ee6a,_0x264ea7){var _0x284529=function(_0x3874b6){while(--_0x3874b6){_0x57ee6a['push'](_0x57ee6a['shift']());}};_0x284529(++_0x264ea7);}(_0x99a2,0xd7));var _0x299a=function(_0x56c604,_0x5963d1){_0x56c604=_0x56c604-0x0;var _0x179f6c=_0x99a2[_0x56c604];return _0x179f6c;};'use strict';var Sequelize=require(_0x299a('0x0'));module[_0x299a('0x1')]={'name':{'type':Sequelize[_0x299a('0x2')],'unique':_0x299a('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x299a('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x68b3=['sequelize','exports','STRING'];(function(_0x30752c,_0x2fb049){var _0xb6d460=function(_0x20575b){while(--_0x20575b){_0x30752c['push'](_0x30752c['shift']());}};_0xb6d460(++_0x2fb049);}(_0x68b3,0xea));var _0x368b=function(_0x24f546,_0x532b01){_0x24f546=_0x24f546-0x0;var _0x517ece=_0x68b3[_0x24f546];return _0x517ece;};'use strict';var Sequelize=require(_0x368b('0x0'));module[_0x368b('0x1')]={'name':{'type':Sequelize[_0x368b('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x368b('0x2')]},'description':{'type':Sequelize[_0x368b('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index dc94de5..49749a7 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 _0xb70f=['zip-dir','fast-json-patch','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','destroy','then','get','ODBC','UserProfileResource','error','stack','name','send','index','SquareOdbc','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','count','includeAll','findAll','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','openSync','closeSync','rimraf'];(function(_0x2f12c7,_0x47916a){var _0x47cb43=function(_0x226953){while(--_0x226953){_0x2f12c7['push'](_0x2f12c7['shift']());}};_0x47cb43(++_0x47916a);}(_0xb70f,0x180));var _0xfb70=function(_0x411de1,_0x17c724){_0x411de1=_0x411de1-0x0;var _0xa61d4a=_0xb70f[_0x411de1];return _0xa61d4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb70('0x0'));var zipdir=require(_0xfb70('0x1'));var jsonpatch=require(_0xfb70('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfb70('0x3'));var path=require(_0xfb70('0x4'));var sox=require(_0xfb70('0x5'));var csv=require(_0xfb70('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb70('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfb70('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xfb70('0x9'));var toCsv=require(_0xfb70('0x6'));var querystring=require(_0xfb70('0xa'));var Papa=require(_0xfb70('0xb'));var Redis=require(_0xfb70('0xc'));var authService=require(_0xfb70('0xd'));var qs=require(_0xfb70('0xe'));var as=require(_0xfb70('0xf'));var hardwareService=require(_0xfb70('0x10'));var logger=require(_0xfb70('0x11'))(_0xfb70('0x12'));var utils=require(_0xfb70('0x13'));var config=require(_0xfb70('0x14'));var licenseUtil=require(_0xfb70('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x96fa7a,_0x3c2268){_0x3c2268=_0x3c2268||0xcc;return function(_0x292575){if(_0x292575){return _0x96fa7a[_0xfb70('0x16')](_0x3c2268);}return _0x96fa7a[_0xfb70('0x17')](_0x3c2268)[_0xfb70('0x18')]();};}function respondWithResult(_0x485cbe,_0x207635){_0x207635=_0x207635||0xc8;return function(_0x1011b3){if(_0x1011b3){return _0x485cbe['status'](_0x207635)[_0xfb70('0x19')](_0x1011b3);}};}function respondWithFilteredResult(_0x52d75c,_0x5130bd){return function(_0x44b620){if(_0x44b620){var _0x19f180=typeof _0x5130bd[_0xfb70('0x1a')]==='undefined'&&typeof _0x5130bd[_0xfb70('0x1b')]==='undefined';var _0x2d5886=_0x44b620['count'];var _0x972133=_0x19f180?0x0:_0x5130bd[_0xfb70('0x1a')];var _0x55ac81=_0x19f180?_0x44b620['count']:_0x5130bd[_0xfb70('0x1a')]+_0x5130bd[_0xfb70('0x1b')];var _0x1820e3;if(_0x55ac81>=_0x2d5886){_0x55ac81=_0x2d5886;_0x1820e3=0xc8;}else{_0x1820e3=0xce;}_0x52d75c[_0xfb70('0x17')](_0x1820e3);return _0x52d75c['set'](_0xfb70('0x1c'),_0x972133+'-'+_0x55ac81+'/'+_0x2d5886)[_0xfb70('0x19')](_0x44b620);}return null;};}function patchUpdates(_0xcf2dee){return function(_0x250505){try{jsonpatch[_0xfb70('0x1d')](_0x250505,_0xcf2dee,!![]);}catch(_0x913930){return BPromise['reject'](_0x913930);}return _0x250505[_0xfb70('0x1e')]();};}function saveUpdates(_0xd4020c,_0x38a2d3){return function(_0x4b51c7){if(_0x4b51c7){return _0x4b51c7[_0xfb70('0x1f')](_0xd4020c)['then'](function(_0x1be454){return _0x1be454;});}return null;};}function removeEntity(_0x13e773,_0x388156){return function(_0x38effd){if(_0x38effd){return _0x38effd[_0xfb70('0x20')]()[_0xfb70('0x21')](function(){var _0x8cc85=_0x38effd[_0xfb70('0x22')]({'plain':!![]});var _0x467a31=_0xfb70('0x23');return db[_0xfb70('0x24')][_0xfb70('0x20')]({'where':{'type':_0x467a31,'resourceId':_0x8cc85['id']}})['then'](function(){return _0x38effd;});})[_0xfb70('0x21')](function(){_0x13e773[_0xfb70('0x17')](0xcc)[_0xfb70('0x18')]();});}};}function handleEntityNotFound(_0x205d31,_0x11096d){return function(_0x2ceba1){if(!_0x2ceba1){_0x205d31[_0xfb70('0x16')](0x194);}return _0x2ceba1;};}function handleError(_0x3beb29,_0xe5175d){_0xe5175d=_0xe5175d||0x1f4;return function(_0x237f9c){logger[_0xfb70('0x25')](_0x237f9c[_0xfb70('0x26')]);if(_0x237f9c[_0xfb70('0x27')]){delete _0x237f9c[_0xfb70('0x27')];}_0x3beb29[_0xfb70('0x17')](_0xe5175d)[_0xfb70('0x28')](_0x237f9c);};}exports[_0xfb70('0x29')]=function(_0x4ca457,_0x1ce60b){var _0x4f5b1f={},_0x1292a0={},_0x267392={'count':0x0,'rows':[]};var _0x53d3ce=_['map'](db[_0xfb70('0x2a')][_0xfb70('0x2b')],function(_0x46d4ca){return{'name':_0x46d4ca['fieldName'],'type':_0x46d4ca[_0xfb70('0x2c')][_0xfb70('0x2d')]};});_0x1292a0[_0xfb70('0x2e')]=_['map'](_0x53d3ce,_0xfb70('0x27'));_0x1292a0[_0xfb70('0x2f')]=_[_0xfb70('0x30')](_0x4ca457[_0xfb70('0x2f')]);_0x1292a0[_0xfb70('0x31')]=_[_0xfb70('0x32')](_0x1292a0[_0xfb70('0x2e')],_0x1292a0[_0xfb70('0x2f')]);_0x4f5b1f[_0xfb70('0x33')]=_[_0xfb70('0x32')](_0x1292a0['model'],qs[_0xfb70('0x34')](_0x4ca457[_0xfb70('0x2f')][_0xfb70('0x34')]));_0x4f5b1f[_0xfb70('0x33')]=_0x4f5b1f[_0xfb70('0x33')][_0xfb70('0x35')]?_0x4f5b1f[_0xfb70('0x33')]:_0x1292a0['model'];if(!_0x4ca457[_0xfb70('0x2f')][_0xfb70('0x36')](_0xfb70('0x37'))){_0x4f5b1f[_0xfb70('0x1b')]=qs[_0xfb70('0x1b')](_0x4ca457[_0xfb70('0x2f')][_0xfb70('0x1b')]);_0x4f5b1f[_0xfb70('0x1a')]=qs[_0xfb70('0x1a')](_0x4ca457['query']['offset']);}_0x4f5b1f[_0xfb70('0x38')]=qs['sort'](_0x4ca457[_0xfb70('0x2f')]['sort']);_0x4f5b1f[_0xfb70('0x39')]=qs[_0xfb70('0x31')](_['pick'](_0x4ca457[_0xfb70('0x2f')],_0x1292a0['filters']),_0x53d3ce);if(_0x4ca457['query'][_0xfb70('0x3a')]){_0x4f5b1f[_0xfb70('0x39')]=_[_0xfb70('0x3b')](_0x4f5b1f[_0xfb70('0x39')],{'$or':_['map'](_0x53d3ce,function(_0x14665d){if(_0x14665d[_0xfb70('0x2c')]!=='VIRTUAL'){var _0x291dde={};_0x291dde[_0x14665d[_0xfb70('0x27')]]={'$like':'%'+_0x4ca457['query'][_0xfb70('0x3a')]+'%'};return _0x291dde;}})});}_0x4f5b1f=_[_0xfb70('0x3b')]({},_0x4f5b1f,_0x4ca457['options']);var _0x4de0ae={'where':_0x4f5b1f[_0xfb70('0x39')]};return db['SquareOdbc'][_0xfb70('0x3c')](_0x4de0ae)[_0xfb70('0x21')](function(_0x13dec4){_0x267392[_0xfb70('0x3c')]=_0x13dec4;if(_0x4ca457['query'][_0xfb70('0x3d')]){_0x4f5b1f['include']=[{'all':!![]}];}return db['SquareOdbc'][_0xfb70('0x3e')](_0x4f5b1f);})[_0xfb70('0x21')](function(_0x5ba750){_0x267392['rows']=_0x5ba750;return _0x267392;})[_0xfb70('0x21')](respondWithFilteredResult(_0x1ce60b,_0x4f5b1f))['catch'](handleError(_0x1ce60b,null));};exports[_0xfb70('0x3f')]=function(_0x224634,_0x5e825b){var _0x592aa1={'raw':!![],'where':{'id':_0x224634[_0xfb70('0x40')]['id']}},_0x5b8e8c={};_0x5b8e8c[_0xfb70('0x2e')]=_[_0xfb70('0x30')](db[_0xfb70('0x2a')]['rawAttributes']);_0x5b8e8c['query']=_[_0xfb70('0x30')](_0x224634[_0xfb70('0x2f')]);_0x5b8e8c[_0xfb70('0x31')]=_[_0xfb70('0x32')](_0x5b8e8c[_0xfb70('0x2e')],_0x5b8e8c[_0xfb70('0x2f')]);_0x592aa1['attributes']=_[_0xfb70('0x32')](_0x5b8e8c['model'],qs[_0xfb70('0x34')](_0x224634[_0xfb70('0x2f')][_0xfb70('0x34')]));_0x592aa1[_0xfb70('0x33')]=_0x592aa1[_0xfb70('0x33')][_0xfb70('0x35')]?_0x592aa1['attributes']:_0x5b8e8c[_0xfb70('0x2e')];if(_0x224634[_0xfb70('0x2f')][_0xfb70('0x3d')]){_0x592aa1[_0xfb70('0x41')]=[{'all':!![]}];}_0x592aa1=_[_0xfb70('0x3b')]({},_0x592aa1,_0x224634['options']);return db[_0xfb70('0x2a')][_0xfb70('0x42')](_0x592aa1)[_0xfb70('0x21')](handleEntityNotFound(_0x5e825b,null))[_0xfb70('0x21')](respondWithResult(_0x5e825b,null))[_0xfb70('0x43')](handleError(_0x5e825b,null));};exports['create']=function(_0x4447bc,_0x49ca01){return db[_0xfb70('0x2a')][_0xfb70('0x44')](_0x4447bc[_0xfb70('0x45')],{})[_0xfb70('0x21')](function(_0x118cf0){var _0x956db1=_0x4447bc[_0xfb70('0x46')]['get']({'plain':!![]});if(!_0x956db1)throw new Error(_0xfb70('0x47'));if(_0x956db1['role']===_0xfb70('0x46')){var _0x1aa2d2=_0x118cf0['get']({'plain':!![]});var _0x50820e='ODBC';return db['UserProfileSection'][_0xfb70('0x42')]({'where':{'name':_0x50820e,'userProfileId':_0x956db1[_0xfb70('0x48')]},'raw':!![]})[_0xfb70('0x21')](function(_0x82215b){if(_0x82215b&&_0x82215b['autoAssociation']===0x0){return db[_0xfb70('0x24')][_0xfb70('0x44')]({'name':_0x1aa2d2['name'],'resourceId':_0x1aa2d2['id'],'type':_0x82215b[_0xfb70('0x27')],'sectionId':_0x82215b['id']},{})[_0xfb70('0x21')](function(){return _0x118cf0;});}else{return _0x118cf0;}})[_0xfb70('0x43')](function(_0x4ddda1){logger[_0xfb70('0x25')](_0xfb70('0x49'),_0x4ddda1);throw _0x4ddda1;});}return _0x118cf0;})[_0xfb70('0x21')](respondWithResult(_0x49ca01,0xc9))[_0xfb70('0x43')](handleError(_0x49ca01,null));};exports[_0xfb70('0x1f')]=function(_0x430d7d,_0x57e7a3){if(_0x430d7d[_0xfb70('0x45')]['id']){delete _0x430d7d['body']['id'];}return db[_0xfb70('0x2a')][_0xfb70('0x42')]({'where':{'id':_0x430d7d[_0xfb70('0x40')]['id']}})[_0xfb70('0x21')](handleEntityNotFound(_0x57e7a3,null))[_0xfb70('0x21')](saveUpdates(_0x430d7d[_0xfb70('0x45')],null))[_0xfb70('0x21')](respondWithResult(_0x57e7a3,null))[_0xfb70('0x43')](handleError(_0x57e7a3,null));};exports[_0xfb70('0x20')]=function(_0x215dd1,_0x56f420){return db[_0xfb70('0x2a')][_0xfb70('0x42')]({'where':{'id':_0x215dd1[_0xfb70('0x40')]['id']}})[_0xfb70('0x21')](handleEntityNotFound(_0x56f420,null))['then'](removeEntity(_0x56f420,null))[_0xfb70('0x43')](handleError(_0x56f420,null));};exports['test']=function(_0x156cfa,_0x54d8e3,_0x7a2946){var _0x4fa31b;return db['SquareOdbc'][_0xfb70('0x42')]({'where':{'id':_0x156cfa[_0xfb70('0x40')]['id']},'attributes':['id',_0xfb70('0x4a')]})[_0xfb70('0x21')](handleEntityNotFound(_0x54d8e3,null))[_0xfb70('0x21')](function(_0x3bb733){if(_0x3bb733){var _0x532fb5=require('odbc')();_0x532fb5[_0xfb70('0x4b')](_0x3bb733[_0xfb70('0x4a')]);_0x532fb5[_0xfb70('0x4c')]();return _0x3bb733;}})['then'](respondWithResult(_0x54d8e3,null))['catch'](handleError(_0x54d8e3,null));}; \ No newline at end of file +var _0xef58=['merge','type','includeAll','include','findAll','options','find','catch','create','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','params','odbc','openSync','dsn','closeSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','ODBC','error','stack','name','send','index','map','SquareOdbc','rawAttributes','key','keys','filters','model','attributes','intersection','fields','query','length','nolimit','order','sort','where','pick','filter'];(function(_0x807e66,_0xbe9ae8){var _0x48f794=function(_0x397e96){while(--_0x397e96){_0x807e66['push'](_0x807e66['shift']());}};_0x48f794(++_0xbe9ae8);}(_0xef58,0x69));var _0x8ef5=function(_0x5acb6d,_0x533fcd){_0x5acb6d=_0x5acb6d-0x0;var _0x4901f0=_0xef58[_0x5acb6d];return _0x4901f0;};'use strict';var emlformat=require(_0x8ef5('0x0'));var rimraf=require(_0x8ef5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8ef5('0x2'));var moment=require(_0x8ef5('0x3'));var BPromise=require(_0x8ef5('0x4'));var Mustache=require(_0x8ef5('0x5'));var util=require(_0x8ef5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8ef5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ef5('0x8'));var _=require('lodash');var squel=require(_0x8ef5('0x9'));var crypto=require(_0x8ef5('0xa'));var jsforce=require(_0x8ef5('0xb'));var deskjs=require(_0x8ef5('0xc'));var toCsv=require(_0x8ef5('0x7'));var querystring=require(_0x8ef5('0xd'));var Papa=require(_0x8ef5('0xe'));var Redis=require('ioredis');var authService=require(_0x8ef5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8ef5('0x10'));var hardwareService=require(_0x8ef5('0x11'));var logger=require(_0x8ef5('0x12'))(_0x8ef5('0x13'));var utils=require(_0x8ef5('0x14'));var config=require(_0x8ef5('0x15'));var licenseUtil=require(_0x8ef5('0x16'));var db=require(_0x8ef5('0x17'))['db'];function respondWithStatusCode(_0x14f12d,_0x4bc512){_0x4bc512=_0x4bc512||0xcc;return function(_0x5dd3de){if(_0x5dd3de){return _0x14f12d[_0x8ef5('0x18')](_0x4bc512);}return _0x14f12d[_0x8ef5('0x19')](_0x4bc512)[_0x8ef5('0x1a')]();};}function respondWithResult(_0x59c3b2,_0x971b90){_0x971b90=_0x971b90||0xc8;return function(_0x13ee71){if(_0x13ee71){return _0x59c3b2[_0x8ef5('0x19')](_0x971b90)[_0x8ef5('0x1b')](_0x13ee71);}};}function respondWithFilteredResult(_0x3ae872,_0x42c6a5){return function(_0x45a1d6){if(_0x45a1d6){var _0x5ab5c1=typeof _0x42c6a5[_0x8ef5('0x1c')]===_0x8ef5('0x1d')&&typeof _0x42c6a5[_0x8ef5('0x1e')]===_0x8ef5('0x1d');var _0x59b959=_0x45a1d6[_0x8ef5('0x1f')];var _0x407d00=_0x5ab5c1?0x0:_0x42c6a5['offset'];var _0x3aa48c=_0x5ab5c1?_0x45a1d6[_0x8ef5('0x1f')]:_0x42c6a5[_0x8ef5('0x1c')]+_0x42c6a5[_0x8ef5('0x1e')];var _0x4fe58c;if(_0x3aa48c>=_0x59b959){_0x3aa48c=_0x59b959;_0x4fe58c=0xc8;}else{_0x4fe58c=0xce;}_0x3ae872[_0x8ef5('0x19')](_0x4fe58c);return _0x3ae872[_0x8ef5('0x20')]('Content-Range',_0x407d00+'-'+_0x3aa48c+'/'+_0x59b959)[_0x8ef5('0x1b')](_0x45a1d6);}return null;};}function patchUpdates(_0x521c18){return function(_0x257011){try{jsonpatch[_0x8ef5('0x21')](_0x257011,_0x521c18,!![]);}catch(_0x2d11c7){return BPromise['reject'](_0x2d11c7);}return _0x257011['save']();};}function saveUpdates(_0x366bc8,_0x40d44e){return function(_0x57ba44){if(_0x57ba44){return _0x57ba44[_0x8ef5('0x22')](_0x366bc8)[_0x8ef5('0x23')](function(_0x559b8a){return _0x559b8a;});}return null;};}function removeEntity(_0x5c4130,_0x58c2d2){return function(_0x5252f1){if(_0x5252f1){return _0x5252f1[_0x8ef5('0x24')]()['then'](function(){var _0x31502f=_0x5252f1['get']({'plain':!![]});var _0x22e306=_0x8ef5('0x25');return db['UserProfileResource'][_0x8ef5('0x24')]({'where':{'type':_0x22e306,'resourceId':_0x31502f['id']}})['then'](function(){return _0x5252f1;});})[_0x8ef5('0x23')](function(){_0x5c4130[_0x8ef5('0x19')](0xcc)[_0x8ef5('0x1a')]();});}};}function handleEntityNotFound(_0x3d8a71,_0x503e22){return function(_0x50eb98){if(!_0x50eb98){_0x3d8a71[_0x8ef5('0x18')](0x194);}return _0x50eb98;};}function handleError(_0x3c670a,_0x120711){_0x120711=_0x120711||0x1f4;return function(_0x41731e){logger[_0x8ef5('0x26')](_0x41731e[_0x8ef5('0x27')]);if(_0x41731e[_0x8ef5('0x28')]){delete _0x41731e[_0x8ef5('0x28')];}_0x3c670a[_0x8ef5('0x19')](_0x120711)[_0x8ef5('0x29')](_0x41731e);};}exports[_0x8ef5('0x2a')]=function(_0x292c7e,_0x2e4050){var _0x2d27ae={},_0x414756={},_0x561af9={'count':0x0,'rows':[]};var _0x1dd257=_[_0x8ef5('0x2b')](db[_0x8ef5('0x2c')][_0x8ef5('0x2d')],function(_0x21f9f2){return{'name':_0x21f9f2['fieldName'],'type':_0x21f9f2['type'][_0x8ef5('0x2e')]};});_0x414756['model']=_['map'](_0x1dd257,_0x8ef5('0x28'));_0x414756['query']=_[_0x8ef5('0x2f')](_0x292c7e['query']);_0x414756[_0x8ef5('0x30')]=_['intersection'](_0x414756[_0x8ef5('0x31')],_0x414756['query']);_0x2d27ae[_0x8ef5('0x32')]=_[_0x8ef5('0x33')](_0x414756[_0x8ef5('0x31')],qs[_0x8ef5('0x34')](_0x292c7e[_0x8ef5('0x35')]['fields']));_0x2d27ae['attributes']=_0x2d27ae[_0x8ef5('0x32')][_0x8ef5('0x36')]?_0x2d27ae[_0x8ef5('0x32')]:_0x414756['model'];if(!_0x292c7e['query']['hasOwnProperty'](_0x8ef5('0x37'))){_0x2d27ae['limit']=qs[_0x8ef5('0x1e')](_0x292c7e['query'][_0x8ef5('0x1e')]);_0x2d27ae[_0x8ef5('0x1c')]=qs['offset'](_0x292c7e[_0x8ef5('0x35')]['offset']);}_0x2d27ae[_0x8ef5('0x38')]=qs[_0x8ef5('0x39')](_0x292c7e[_0x8ef5('0x35')][_0x8ef5('0x39')]);_0x2d27ae[_0x8ef5('0x3a')]=qs[_0x8ef5('0x30')](_[_0x8ef5('0x3b')](_0x292c7e[_0x8ef5('0x35')],_0x414756['filters']),_0x1dd257);if(_0x292c7e[_0x8ef5('0x35')][_0x8ef5('0x3c')]){_0x2d27ae['where']=_[_0x8ef5('0x3d')](_0x2d27ae['where'],{'$or':_[_0x8ef5('0x2b')](_0x1dd257,function(_0x3ff4b2){if(_0x3ff4b2[_0x8ef5('0x3e')]!=='VIRTUAL'){var _0x222d25={};_0x222d25[_0x3ff4b2[_0x8ef5('0x28')]]={'$like':'%'+_0x292c7e[_0x8ef5('0x35')][_0x8ef5('0x3c')]+'%'};return _0x222d25;}})});}_0x2d27ae=_[_0x8ef5('0x3d')]({},_0x2d27ae,_0x292c7e['options']);var _0x5f17c2={'where':_0x2d27ae['where']};return db['SquareOdbc'][_0x8ef5('0x1f')](_0x5f17c2)[_0x8ef5('0x23')](function(_0xa32a28){_0x561af9['count']=_0xa32a28;if(_0x292c7e[_0x8ef5('0x35')][_0x8ef5('0x3f')]){_0x2d27ae[_0x8ef5('0x40')]=[{'all':!![]}];}return db[_0x8ef5('0x2c')][_0x8ef5('0x41')](_0x2d27ae);})[_0x8ef5('0x23')](function(_0x514a64){_0x561af9['rows']=_0x514a64;return _0x561af9;})[_0x8ef5('0x23')](respondWithFilteredResult(_0x2e4050,_0x2d27ae))['catch'](handleError(_0x2e4050,null));};exports['show']=function(_0x315783,_0xe55002){var _0x58c0bf={'raw':!![],'where':{'id':_0x315783['params']['id']}},_0x79f352={};_0x79f352['model']=_[_0x8ef5('0x2f')](db[_0x8ef5('0x2c')][_0x8ef5('0x2d')]);_0x79f352[_0x8ef5('0x35')]=_[_0x8ef5('0x2f')](_0x315783['query']);_0x79f352[_0x8ef5('0x30')]=_[_0x8ef5('0x33')](_0x79f352['model'],_0x79f352[_0x8ef5('0x35')]);_0x58c0bf[_0x8ef5('0x32')]=_['intersection'](_0x79f352[_0x8ef5('0x31')],qs[_0x8ef5('0x34')](_0x315783[_0x8ef5('0x35')][_0x8ef5('0x34')]));_0x58c0bf[_0x8ef5('0x32')]=_0x58c0bf[_0x8ef5('0x32')][_0x8ef5('0x36')]?_0x58c0bf[_0x8ef5('0x32')]:_0x79f352[_0x8ef5('0x31')];if(_0x315783[_0x8ef5('0x35')][_0x8ef5('0x3f')]){_0x58c0bf[_0x8ef5('0x40')]=[{'all':!![]}];}_0x58c0bf=_['merge']({},_0x58c0bf,_0x315783[_0x8ef5('0x42')]);return db['SquareOdbc'][_0x8ef5('0x43')](_0x58c0bf)[_0x8ef5('0x23')](handleEntityNotFound(_0xe55002,null))[_0x8ef5('0x23')](respondWithResult(_0xe55002,null))[_0x8ef5('0x44')](handleError(_0xe55002,null));};exports[_0x8ef5('0x45')]=function(_0x15074e,_0x1b35aa){return db[_0x8ef5('0x2c')][_0x8ef5('0x45')](_0x15074e['body'],{})[_0x8ef5('0x23')](function(_0x313b01){var _0x3f07a9=_0x15074e[_0x8ef5('0x46')]['get']({'plain':!![]});if(!_0x3f07a9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f07a9[_0x8ef5('0x47')]===_0x8ef5('0x46')){var _0x4c1d73=_0x313b01['get']({'plain':!![]});var _0x2fa448='ODBC';return db[_0x8ef5('0x48')][_0x8ef5('0x43')]({'where':{'name':_0x2fa448,'userProfileId':_0x3f07a9['userProfileId']},'raw':!![]})[_0x8ef5('0x23')](function(_0xe9cdef){if(_0xe9cdef&&_0xe9cdef[_0x8ef5('0x49')]===0x0){return db[_0x8ef5('0x4a')][_0x8ef5('0x45')]({'name':_0x4c1d73[_0x8ef5('0x28')],'resourceId':_0x4c1d73['id'],'type':_0xe9cdef[_0x8ef5('0x28')],'sectionId':_0xe9cdef['id']},{})[_0x8ef5('0x23')](function(){return _0x313b01;});}else{return _0x313b01;}})['catch'](function(_0x4dd325){logger[_0x8ef5('0x26')](_0x8ef5('0x4b'),_0x4dd325);throw _0x4dd325;});}return _0x313b01;})[_0x8ef5('0x23')](respondWithResult(_0x1b35aa,0xc9))['catch'](handleError(_0x1b35aa,null));};exports[_0x8ef5('0x22')]=function(_0x51829e,_0x360504){if(_0x51829e[_0x8ef5('0x4c')]['id']){delete _0x51829e[_0x8ef5('0x4c')]['id'];}return db[_0x8ef5('0x2c')][_0x8ef5('0x43')]({'where':{'id':_0x51829e['params']['id']}})[_0x8ef5('0x23')](handleEntityNotFound(_0x360504,null))[_0x8ef5('0x23')](saveUpdates(_0x51829e[_0x8ef5('0x4c')],null))['then'](respondWithResult(_0x360504,null))[_0x8ef5('0x44')](handleError(_0x360504,null));};exports[_0x8ef5('0x24')]=function(_0x59bea1,_0x50ba51){return db[_0x8ef5('0x2c')][_0x8ef5('0x43')]({'where':{'id':_0x59bea1['params']['id']}})[_0x8ef5('0x23')](handleEntityNotFound(_0x50ba51,null))[_0x8ef5('0x23')](removeEntity(_0x50ba51,null))[_0x8ef5('0x44')](handleError(_0x50ba51,null));};exports[_0x8ef5('0x4d')]=function(_0x28d7ac,_0x4ec4cb,_0x33b4cc){var _0x44867b;return db[_0x8ef5('0x2c')][_0x8ef5('0x43')]({'where':{'id':_0x28d7ac[_0x8ef5('0x4e')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x4ec4cb,null))[_0x8ef5('0x23')](function(_0x241af1){if(_0x241af1){var _0x40b8ea=require(_0x8ef5('0x4f'))();_0x40b8ea[_0x8ef5('0x50')](_0x241af1[_0x8ef5('0x51')]);_0x40b8ea[_0x8ef5('0x52')]();return _0x241af1;}})['then'](respondWithResult(_0x4ec4cb,null))['catch'](handleError(_0x4ec4cb,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index dea2e51..e75be24 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 _0x94aa=['request-promise','path','rimraf','./squareOdbc.attributes','exports','lodash','moment','bluebird'];(function(_0xe66f5a,_0x20056b){var _0x9f6f71=function(_0x85f64b){while(--_0x85f64b){_0xe66f5a['push'](_0xe66f5a['shift']());}};_0x9f6f71(++_0x20056b);}(_0x94aa,0x65));var _0xa94a=function(_0x3d37e4,_0x5a892d){_0x3d37e4=_0x3d37e4-0x0;var _0x280a3a=_0x94aa[_0x3d37e4];return _0x280a3a;};'use strict';var _=require(_0xa94a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa94a('0x1'));var BPromise=require(_0xa94a('0x2'));var rp=require(_0xa94a('0x3'));var fs=require('fs');var path=require(_0xa94a('0x4'));var rimraf=require(_0xa94a('0x5'));var config=require('../../config/environment');var attributes=require(_0xa94a('0x6'));module[_0xa94a('0x7')]=function(_0x3ed81e,_0x549948){return _0x3ed81e['define']('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3780=['request-promise','path','../../config/environment','define','SquareOdbc','square_odbc','lodash','../../config/logger','api','bluebird'];(function(_0x2be6fb,_0x27e4e2){var _0x510509=function(_0x5da0c0){while(--_0x5da0c0){_0x2be6fb['push'](_0x2be6fb['shift']());}};_0x510509(++_0x27e4e2);}(_0x3780,0x15a));var _0x0378=function(_0x2e7b6e,_0x399033){_0x2e7b6e=_0x2e7b6e-0x0;var _0x209ef0=_0x3780[_0x2e7b6e];return _0x209ef0;};'use strict';var _=require(_0x0378('0x0'));var util=require('util');var logger=require(_0x0378('0x1'))(_0x0378('0x2'));var moment=require('moment');var BPromise=require(_0x0378('0x3'));var rp=require(_0x0378('0x4'));var fs=require('fs');var path=require(_0x0378('0x5'));var rimraf=require('rimraf');var config=require(_0x0378('0x6'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x93b080,_0x5707cb){return _0x93b080[_0x0378('0x7')](_0x0378('0x8'),attributes,{'tableName':_0x0378('0x9'),'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 f433caa..4335b9b 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 _0x55de=['catch','ShowSquareOdbc','SquareOdbc','find','raw','options','where','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0xbd0d96,_0x1a2418){var _0x47483e=function(_0x5e38bf){while(--_0x5e38bf){_0xbd0d96['push'](_0xbd0d96['shift']());}};_0x47483e(++_0x1a2418);}(_0x55de,0x176));var _0xe55d=function(_0x36d831,_0x6c602a){_0x36d831=_0x36d831-0x0;var _0x5bc013=_0x55de[_0x36d831];return _0x5bc013;};'use strict';var _=require('lodash');var util=require(_0xe55d('0x0'));var moment=require(_0xe55d('0x1'));var BPromise=require(_0xe55d('0x2'));var rs=require(_0xe55d('0x3'));var fs=require('fs');var Redis=require(_0xe55d('0x4'));var db=require(_0xe55d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe55d('0x6'))(_0xe55d('0x7'));var config=require('../../config/environment');var jayson=require(_0xe55d('0x8'));var client=jayson[_0xe55d('0x9')][_0xe55d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28e147,_0x3c74c3,_0x18fe61){return new BPromise(function(_0x3bd81d,_0x41de5f){return client[_0xe55d('0xb')](_0x28e147,_0x18fe61)[_0xe55d('0xc')](function(_0x2b9365){logger[_0xe55d('0xd')](_0xe55d('0xe'),_0x3c74c3,_0xe55d('0xf'));logger[_0xe55d('0x10')](_0xe55d('0x11'),_0x3c74c3,_0xe55d('0xf'),JSON[_0xe55d('0x12')](_0x2b9365));if(_0x2b9365[_0xe55d('0x13')]){if(_0x2b9365['error']['code']===0x1f4){logger[_0xe55d('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x3c74c3,_0x2b9365['error'][_0xe55d('0x14')]);return _0x41de5f(_0x2b9365[_0xe55d('0x13')]['message']);}logger[_0xe55d('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x3c74c3,_0x2b9365['error'][_0xe55d('0x14')]);return _0x3bd81d(_0x2b9365['error'][_0xe55d('0x14')]);}else{logger[_0xe55d('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x3c74c3,_0xe55d('0xf'));_0x3bd81d(_0x2b9365[_0xe55d('0x15')][_0xe55d('0x14')]);}})[_0xe55d('0x16')](function(_0x511ec9){logger[_0xe55d('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x3c74c3,_0x511ec9);_0x41de5f(_0x511ec9);});});}exports[_0xe55d('0x17')]=function(_0x44b99f){var _0xe437e1=this;return new Promise(function(_0x30ef51,_0x2f2398){return db[_0xe55d('0x18')][_0xe55d('0x19')]({'raw':_0x44b99f['options']?_0x44b99f['options'][_0xe55d('0x1a')]===undefined?!![]:![]:!![],'where':_0x44b99f[_0xe55d('0x1b')]?_0x44b99f[_0xe55d('0x1b')][_0xe55d('0x1c')]||null:null,'attributes':_0x44b99f['options']?_0x44b99f['options'][_0xe55d('0x1d')]||null:null,'include':_0x44b99f['options']?_0x44b99f[_0xe55d('0x1b')][_0xe55d('0x1e')]?_[_0xe55d('0x1f')](_0x44b99f['options'][_0xe55d('0x1e')],function(_0x59049b){return{'model':db[_0x59049b[_0xe55d('0x20')]],'as':_0x59049b['as'],'attributes':_0x59049b['attributes'],'include':_0x59049b[_0xe55d('0x1e')]?_[_0xe55d('0x1f')](_0x59049b['include'],function(_0x1c1f96){return{'model':db[_0x1c1f96['model']],'as':_0x1c1f96['as'],'attributes':_0x1c1f96[_0xe55d('0x1d')],'include':_0x1c1f96['include']?_[_0xe55d('0x1f')](_0x1c1f96[_0xe55d('0x1e')],function(_0x4d12bd){return{'model':db[_0x4d12bd[_0xe55d('0x20')]],'as':_0x4d12bd['as'],'attributes':_0x4d12bd['attributes']};}):[]};}):[]};}):[]:[]})[_0xe55d('0xc')](function(_0x1090a4){logger['info'](_0xe55d('0x17'),_0x44b99f);logger[_0xe55d('0x10')](_0xe55d('0x17'),_0x44b99f,JSON[_0xe55d('0x12')](_0x1090a4));_0x30ef51(_0x1090a4);})[_0xe55d('0x16')](function(_0x2c2f48){logger[_0xe55d('0x13')](_0xe55d('0x17'),_0x2c2f48['message'],_0x44b99f);_0x2f2398(_0xe437e1[_0xe55d('0x13')](0x1f4,_0x2c2f48[_0xe55d('0x14')]));});});}; \ No newline at end of file +var _0x9ca5=['SquareOdbc,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','ShowSquareOdbc','find','options','where','attributes','include','map','model','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/environment','client','http','then','info'];(function(_0x18e1a1,_0x5426d6){var _0x3613d0=function(_0xfd2d84){while(--_0xfd2d84){_0x18e1a1['push'](_0x18e1a1['shift']());}};_0x3613d0(++_0x5426d6);}(_0x9ca5,0x1c1));var _0x59ca=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0x9ca5[_0x126f47];return _0x49508a;};'use strict';var _=require(_0x59ca('0x0'));var util=require('util');var moment=require(_0x59ca('0x1'));var BPromise=require(_0x59ca('0x2'));var rs=require(_0x59ca('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x59ca('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x59ca('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x59ca('0x6')][_0x59ca('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x356676,_0xdae316,_0x2fdb05){return new BPromise(function(_0x1046c4,_0x3b0d45){return client['request'](_0x356676,_0x2fdb05)[_0x59ca('0x8')](function(_0x22ae0c){logger[_0x59ca('0x9')](_0x59ca('0xa'),_0xdae316,'request\x20sent');logger[_0x59ca('0xb')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0xdae316,_0x59ca('0xc'),JSON['stringify'](_0x22ae0c));if(_0x22ae0c[_0x59ca('0xd')]){if(_0x22ae0c[_0x59ca('0xd')][_0x59ca('0xe')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0xdae316,_0x22ae0c[_0x59ca('0xd')][_0x59ca('0xf')]);return _0x3b0d45(_0x22ae0c['error'][_0x59ca('0xf')]);}logger[_0x59ca('0xd')](_0x59ca('0xa'),_0xdae316,_0x22ae0c['error'][_0x59ca('0xf')]);return _0x1046c4(_0x22ae0c[_0x59ca('0xd')]['message']);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0xdae316,'request\x20sent');_0x1046c4(_0x22ae0c[_0x59ca('0x10')][_0x59ca('0xf')]);}})[_0x59ca('0x11')](function(_0x2c8773){logger[_0x59ca('0xd')](_0x59ca('0xa'),_0xdae316,_0x2c8773);_0x3b0d45(_0x2c8773);});});}exports[_0x59ca('0x12')]=function(_0x1067a6){var _0x48e654=this;return new Promise(function(_0x30c937,_0x56f5c1){return db['SquareOdbc'][_0x59ca('0x13')]({'raw':_0x1067a6[_0x59ca('0x14')]?_0x1067a6[_0x59ca('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x1067a6[_0x59ca('0x14')]?_0x1067a6['options'][_0x59ca('0x15')]||null:null,'attributes':_0x1067a6[_0x59ca('0x14')]?_0x1067a6[_0x59ca('0x14')][_0x59ca('0x16')]||null:null,'include':_0x1067a6[_0x59ca('0x14')]?_0x1067a6[_0x59ca('0x14')][_0x59ca('0x17')]?_[_0x59ca('0x18')](_0x1067a6[_0x59ca('0x14')][_0x59ca('0x17')],function(_0x5bcaa7){return{'model':db[_0x5bcaa7[_0x59ca('0x19')]],'as':_0x5bcaa7['as'],'attributes':_0x5bcaa7[_0x59ca('0x16')],'include':_0x5bcaa7['include']?_[_0x59ca('0x18')](_0x5bcaa7['include'],function(_0x584c94){return{'model':db[_0x584c94[_0x59ca('0x19')]],'as':_0x584c94['as'],'attributes':_0x584c94['attributes'],'include':_0x584c94['include']?_[_0x59ca('0x18')](_0x584c94[_0x59ca('0x17')],function(_0x5b973d){return{'model':db[_0x5b973d[_0x59ca('0x19')]],'as':_0x5b973d['as'],'attributes':_0x5b973d[_0x59ca('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f0760){logger[_0x59ca('0x9')](_0x59ca('0x12'),_0x1067a6);logger['debug']('ShowSquareOdbc',_0x1067a6,JSON[_0x59ca('0x1a')](_0x1f0760));_0x30c937(_0x1f0760);})[_0x59ca('0x11')](function(_0x17c751){logger[_0x59ca('0xd')]('ShowSquareOdbc',_0x17c751[_0x59ca('0xf')],_0x1067a6);_0x56f5c1(_0x48e654[_0x59ca('0xd')](0x1f4,_0x17c751['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index b3231c9..2c7c6ac 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 _0x7a71=['/:id','isAuthenticated','show','/:id/users','create','post','addUsers','put','update','delete','destroy','removeUsers','exports','multer','util','path','express','Router','../../components/interaction/service','get'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x7a71,0xad));var _0x17a7=function(_0x47f8b4,_0xd80692){_0x47f8b4=_0x47f8b4-0x0;var _0x1b62de=_0x7a71[_0x47f8b4];return _0x1b62de;};'use strict';var multer=require(_0x17a7('0x0'));var util=require(_0x17a7('0x1'));var path=require(_0x17a7('0x2'));var timeout=require('connect-timeout');var express=require(_0x17a7('0x3'));var router=express[_0x17a7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x17a7('0x5'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0x17a7('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x17a7('0x6')](_0x17a7('0x7'),auth[_0x17a7('0x8')](),controller[_0x17a7('0x9')]);router[_0x17a7('0x6')](_0x17a7('0xa'),auth[_0x17a7('0x8')](),controller['getUsers']);router['post']('/',auth[_0x17a7('0x8')](),controller[_0x17a7('0xb')]);router[_0x17a7('0xc')](_0x17a7('0xa'),auth[_0x17a7('0x8')](),controller[_0x17a7('0xd')]);router[_0x17a7('0xe')](_0x17a7('0x7'),auth[_0x17a7('0x8')](),controller[_0x17a7('0xf')]);router[_0x17a7('0x10')]('/:id',auth[_0x17a7('0x8')](),controller[_0x17a7('0x11')]);router['delete'](_0x17a7('0xa'),auth[_0x17a7('0x8')](),controller[_0x17a7('0x12')]);module[_0x17a7('0x13')]=router; \ No newline at end of file +var _0xc638=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/users','getUsers','post','put','update','delete','destroy','removeUsers','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xc638,0x112));var _0x8c63=function(_0xf7dfd8,_0x2c1ef0){_0xf7dfd8=_0xf7dfd8-0x0;var _0x4b3099=_0xc638[_0xf7dfd8];return _0x4b3099;};'use strict';var multer=require(_0x8c63('0x0'));var util=require(_0x8c63('0x1'));var path=require('path');var timeout=require(_0x8c63('0x2'));var express=require('express');var router=express[_0x8c63('0x3')]();var fs_extra=require(_0x8c63('0x4'));var auth=require(_0x8c63('0x5'));var interaction=require(_0x8c63('0x6'));var config=require(_0x8c63('0x7'));var controller=require('./squareProject.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8c63('0x8')](_0x8c63('0x9'),auth[_0x8c63('0xa')](),controller[_0x8c63('0xb')]);router[_0x8c63('0x8')](_0x8c63('0xc'),auth[_0x8c63('0xa')](),controller[_0x8c63('0xd')]);router[_0x8c63('0xe')]('/',auth[_0x8c63('0xa')](),controller['create']);router[_0x8c63('0xe')](_0x8c63('0xc'),auth[_0x8c63('0xa')](),controller['addUsers']);router[_0x8c63('0xf')](_0x8c63('0x9'),auth[_0x8c63('0xa')](),controller[_0x8c63('0x10')]);router[_0x8c63('0x11')]('/:id',auth[_0x8c63('0xa')](),controller[_0x8c63('0x12')]);router[_0x8c63('0x11')](_0x8c63('0xc'),auth['isAuthenticated'](),controller[_0x8c63('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index c421046..45a4885 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 _0x57f0=['preproduction','toString','utf8','production','DATE','exports','STRING','name','BLOB','long','getDataValue'];(function(_0x2b304c,_0x1bf6c4){var _0x4dd253=function(_0x4906b7){while(--_0x4906b7){_0x2b304c['push'](_0x2b304c['shift']());}};_0x4dd253(++_0x1bf6c4);}(_0x57f0,0x9f));var _0x057f=function(_0x53361f,_0x3b2cb6){_0x53361f=_0x53361f-0x0;var _0x279237=_0x57f0[_0x53361f];return _0x279237;};'use strict';var Sequelize=require('sequelize');module[_0x057f('0x0')]={'name':{'type':Sequelize[_0x057f('0x1')],'unique':_0x057f('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x057f('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x057f('0x3')](_0x057f('0x4')),'get':function(){if(this[_0x057f('0x5')]('preproduction')){return this[_0x057f('0x5')](_0x057f('0x6'))[_0x057f('0x7')](_0x057f('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x057f('0x4')),'get':function(){if(this[_0x057f('0x5')](_0x057f('0x9'))){return this[_0x057f('0x5')](_0x057f('0x9'))[_0x057f('0x7')](_0x057f('0x8'));}}},'savedAt':{'type':Sequelize[_0x057f('0xa')]},'publishedAt':{'type':Sequelize[_0x057f('0xa')]}}; \ No newline at end of file +var _0x24c6=['sequelize','exports','STRING','name','TEXT','long','getDataValue','preproduction','utf8','production','toString','DATE'];(function(_0x351374,_0x495e9b){var _0x32f297=function(_0x113b9b){while(--_0x113b9b){_0x351374['push'](_0x351374['shift']());}};_0x32f297(++_0x495e9b);}(_0x24c6,0x90));var _0x624c=function(_0xac1eb8,_0x55935b){_0xac1eb8=_0xac1eb8-0x0;var _0x311eb4=_0x24c6[_0xac1eb8];return _0x311eb4;};'use strict';var Sequelize=require(_0x624c('0x0'));module[_0x624c('0x1')]={'name':{'type':Sequelize[_0x624c('0x2')],'unique':_0x624c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x624c('0x2')]},'notes':{'type':Sequelize[_0x624c('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x624c('0x5')),'get':function(){if(this[_0x624c('0x6')]('preproduction')){return this[_0x624c('0x6')](_0x624c('0x7'))['toString'](_0x624c('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x624c('0x5')),'get':function(){if(this['getDataValue'](_0x624c('0x9'))){return this[_0x624c('0x6')]('production')[_0x624c('0xa')](_0x624c('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x624c('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 1243406..b819c9c 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 _0x4f8a=['../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','sendStatus','end','json','limit','undefined','count','offset','status','apply','save','update','then','get','SquareProjects','UserProfileResource','destroy','error','name','send','index','map','SquareProject','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addUsers','ids','omit','removeUsers','isArray','emit','getUsers','User','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x3c2b2e,_0x3e6e53){var _0x27a338=function(_0x40d29d){while(--_0x40d29d){_0x3c2b2e['push'](_0x3c2b2e['shift']());}};_0x27a338(++_0x3e6e53);}(_0x4f8a,0xa7));var _0xa4f8=function(_0x5d8d06,_0x34078c){_0x5d8d06=_0x5d8d06-0x0;var _0x4a5e4f=_0x4f8a[_0x5d8d06];return _0x4a5e4f;};'use strict';var emlformat=require(_0xa4f8('0x0'));var rimraf=require(_0xa4f8('0x1'));var zipdir=require(_0xa4f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa4f8('0x3'));var moment=require(_0xa4f8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa4f8('0x5'));var util=require('util');var path=require(_0xa4f8('0x6'));var sox=require(_0xa4f8('0x7'));var csv=require(_0xa4f8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4f8('0x9'));var squel=require(_0xa4f8('0xa'));var crypto=require(_0xa4f8('0xb'));var jsforce=require(_0xa4f8('0xc'));var deskjs=require(_0xa4f8('0xd'));var toCsv=require(_0xa4f8('0x8'));var querystring=require(_0xa4f8('0xe'));var Papa=require(_0xa4f8('0xf'));var Redis=require('ioredis');var authService=require(_0xa4f8('0x10'));var qs=require(_0xa4f8('0x11'));var as=require(_0xa4f8('0x12'));var hardwareService=require(_0xa4f8('0x13'));var logger=require(_0xa4f8('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xa4f8('0x15'));var licenseUtil=require(_0xa4f8('0x16'));var db=require(_0xa4f8('0x17'))['db'];config[_0xa4f8('0x18')]=_[_0xa4f8('0x19')](config[_0xa4f8('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xa4f8('0x1a'))(new Redis(config[_0xa4f8('0x18')]));require(_0xa4f8('0x1b'))['register'](socket);function respondWithStatusCode(_0x303815,_0x287ab0){_0x287ab0=_0x287ab0||0xcc;return function(_0x414d55){if(_0x414d55){return _0x303815[_0xa4f8('0x1c')](_0x287ab0);}return _0x303815['status'](_0x287ab0)[_0xa4f8('0x1d')]();};}function respondWithResult(_0x1eea2a,_0x52b0cd){_0x52b0cd=_0x52b0cd||0xc8;return function(_0x4925e6){if(_0x4925e6){return _0x1eea2a['status'](_0x52b0cd)[_0xa4f8('0x1e')](_0x4925e6);}};}function respondWithFilteredResult(_0x6be650,_0x3ecf60){return function(_0x5bf275){if(_0x5bf275){var _0x47ecb8=typeof _0x3ecf60['offset']==='undefined'&&typeof _0x3ecf60[_0xa4f8('0x1f')]===_0xa4f8('0x20');var _0x5ab0ed=_0x5bf275[_0xa4f8('0x21')];var _0x2c6ff9=_0x47ecb8?0x0:_0x3ecf60[_0xa4f8('0x22')];var _0x2c24f4=_0x47ecb8?_0x5bf275[_0xa4f8('0x21')]:_0x3ecf60[_0xa4f8('0x22')]+_0x3ecf60['limit'];var _0x14c819;if(_0x2c24f4>=_0x5ab0ed){_0x2c24f4=_0x5ab0ed;_0x14c819=0xc8;}else{_0x14c819=0xce;}_0x6be650[_0xa4f8('0x23')](_0x14c819);return _0x6be650['set']('Content-Range',_0x2c6ff9+'-'+_0x2c24f4+'/'+_0x5ab0ed)['json'](_0x5bf275);}return null;};}function patchUpdates(_0x175fbe){return function(_0x442f){try{jsonpatch[_0xa4f8('0x24')](_0x442f,_0x175fbe,!![]);}catch(_0x5f4b01){return BPromise['reject'](_0x5f4b01);}return _0x442f[_0xa4f8('0x25')]();};}function saveUpdates(_0x5bf402,_0x4caa5f){return function(_0x2399ba){if(_0x2399ba){return _0x2399ba[_0xa4f8('0x26')](_0x5bf402)['then'](function(_0x4e4fd4){return _0x4e4fd4;});}return null;};}function removeEntity(_0x2157ac,_0x2ec0e1){return function(_0x2e57f3){if(_0x2e57f3){return _0x2e57f3['destroy']()[_0xa4f8('0x27')](function(){var _0x568fb3=_0x2e57f3[_0xa4f8('0x28')]({'plain':!![]});var _0x675905=_0xa4f8('0x29');return db[_0xa4f8('0x2a')][_0xa4f8('0x2b')]({'where':{'type':_0x675905,'resourceId':_0x568fb3['id']}})[_0xa4f8('0x27')](function(){return _0x2e57f3;});})[_0xa4f8('0x27')](function(){_0x2157ac[_0xa4f8('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x94aad2,_0x29ec2a){return function(_0xcb62c7){if(!_0xcb62c7){_0x94aad2[_0xa4f8('0x1c')](0x194);}return _0xcb62c7;};}function handleError(_0x766f53,_0x522a3d){_0x522a3d=_0x522a3d||0x1f4;return function(_0x1950b7){logger[_0xa4f8('0x2c')](_0x1950b7['stack']);if(_0x1950b7[_0xa4f8('0x2d')]){delete _0x1950b7[_0xa4f8('0x2d')];}_0x766f53[_0xa4f8('0x23')](_0x522a3d)[_0xa4f8('0x2e')](_0x1950b7);};}exports[_0xa4f8('0x2f')]=function(_0x3981d3,_0x5e2490){var _0x456d75={},_0x958d3c={},_0x4db852={'count':0x0,'rows':[]};var _0x34fe4c=_[_0xa4f8('0x30')](db[_0xa4f8('0x31')]['rawAttributes'],function(_0x38ccbf){return{'name':_0x38ccbf[_0xa4f8('0x32')],'type':_0x38ccbf[_0xa4f8('0x33')][_0xa4f8('0x34')]};});_0x958d3c[_0xa4f8('0x35')]=_[_0xa4f8('0x30')](_0x34fe4c,'name');_0x958d3c[_0xa4f8('0x36')]=_[_0xa4f8('0x37')](_0x3981d3[_0xa4f8('0x36')]);_0x958d3c[_0xa4f8('0x38')]=_[_0xa4f8('0x39')](_0x958d3c[_0xa4f8('0x35')],_0x958d3c[_0xa4f8('0x36')]);_0x456d75[_0xa4f8('0x3a')]=_[_0xa4f8('0x39')](_0x958d3c[_0xa4f8('0x35')],qs[_0xa4f8('0x3b')](_0x3981d3['query'][_0xa4f8('0x3b')]));_0x456d75[_0xa4f8('0x3a')]=_0x456d75[_0xa4f8('0x3a')][_0xa4f8('0x3c')]?_0x456d75['attributes']:_0x958d3c[_0xa4f8('0x35')];if(!_0x3981d3[_0xa4f8('0x36')][_0xa4f8('0x3d')](_0xa4f8('0x3e'))){_0x456d75['limit']=qs[_0xa4f8('0x1f')](_0x3981d3[_0xa4f8('0x36')][_0xa4f8('0x1f')]);_0x456d75[_0xa4f8('0x22')]=qs[_0xa4f8('0x22')](_0x3981d3[_0xa4f8('0x36')]['offset']);}_0x456d75[_0xa4f8('0x3f')]=qs[_0xa4f8('0x40')](_0x3981d3[_0xa4f8('0x36')][_0xa4f8('0x40')]);_0x456d75[_0xa4f8('0x41')]=qs['filters'](_[_0xa4f8('0x42')](_0x3981d3[_0xa4f8('0x36')],_0x958d3c[_0xa4f8('0x38')]),_0x34fe4c);if(_0x3981d3[_0xa4f8('0x36')][_0xa4f8('0x43')]){_0x456d75['where']=_[_0xa4f8('0x44')](_0x456d75[_0xa4f8('0x41')],{'$or':_[_0xa4f8('0x30')](_0x34fe4c,function(_0x157c42){if(_0x157c42[_0xa4f8('0x33')]!==_0xa4f8('0x45')){var _0x3d66d0={};_0x3d66d0[_0x157c42[_0xa4f8('0x2d')]]={'$like':'%'+_0x3981d3[_0xa4f8('0x36')][_0xa4f8('0x43')]+'%'};return _0x3d66d0;}})});}_0x456d75=_[_0xa4f8('0x44')]({},_0x456d75,_0x3981d3[_0xa4f8('0x46')]);var _0x1fd9bc={'where':_0x456d75[_0xa4f8('0x41')]};return db[_0xa4f8('0x31')][_0xa4f8('0x21')](_0x1fd9bc)[_0xa4f8('0x27')](function(_0x40f5de){_0x4db852[_0xa4f8('0x21')]=_0x40f5de;if(_0x3981d3['query'][_0xa4f8('0x47')]){_0x456d75[_0xa4f8('0x48')]=[{'all':!![]}];}return db[_0xa4f8('0x31')][_0xa4f8('0x49')](_0x456d75);})[_0xa4f8('0x27')](function(_0x4475a1){_0x4db852[_0xa4f8('0x4a')]=_0x4475a1;return _0x4db852;})[_0xa4f8('0x27')](respondWithFilteredResult(_0x5e2490,_0x456d75))[_0xa4f8('0x4b')](handleError(_0x5e2490,null));};exports[_0xa4f8('0x4c')]=function(_0x22448b,_0x436377){var _0x549231={'raw':![],'where':{'id':_0x22448b['params']['id']}},_0x40ed3a={};_0x40ed3a[_0xa4f8('0x35')]=_['keys'](db['SquareProject'][_0xa4f8('0x4d')]);_0x40ed3a['query']=_['keys'](_0x22448b[_0xa4f8('0x36')]);_0x40ed3a[_0xa4f8('0x38')]=_[_0xa4f8('0x39')](_0x40ed3a[_0xa4f8('0x35')],_0x40ed3a[_0xa4f8('0x36')]);_0x549231[_0xa4f8('0x3a')]=_[_0xa4f8('0x39')](_0x40ed3a[_0xa4f8('0x35')],qs[_0xa4f8('0x3b')](_0x22448b[_0xa4f8('0x36')][_0xa4f8('0x3b')]));_0x549231[_0xa4f8('0x3a')]=_0x549231[_0xa4f8('0x3a')][_0xa4f8('0x3c')]?_0x549231[_0xa4f8('0x3a')]:_0x40ed3a[_0xa4f8('0x35')];if(_0x22448b[_0xa4f8('0x36')]['includeAll']){_0x549231[_0xa4f8('0x48')]=[{'all':!![]}];}_0x549231=_['merge']({},_0x549231,_0x22448b[_0xa4f8('0x46')]);return db[_0xa4f8('0x31')][_0xa4f8('0x4e')](_0x549231)[_0xa4f8('0x27')](handleEntityNotFound(_0x436377,null))[_0xa4f8('0x27')](respondWithResult(_0x436377,null))[_0xa4f8('0x4b')](handleError(_0x436377,null));};exports[_0xa4f8('0x4f')]=function(_0x175469,_0x2ab8da){return db[_0xa4f8('0x31')][_0xa4f8('0x4f')](_0x175469['body'],{})[_0xa4f8('0x27')](function(_0x1cc1ba){var _0x41d801=_0x175469[_0xa4f8('0x50')]['get']({'plain':!![]});if(!_0x41d801)throw new Error(_0xa4f8('0x51'));if(_0x41d801[_0xa4f8('0x52')]===_0xa4f8('0x50')){var _0x91fa48=_0x1cc1ba[_0xa4f8('0x28')]({'plain':!![]});var _0x377f93=_0xa4f8('0x29');return db[_0xa4f8('0x53')][_0xa4f8('0x4e')]({'where':{'name':_0x377f93,'userProfileId':_0x41d801['userProfileId']},'raw':!![]})[_0xa4f8('0x27')](function(_0x61b13){if(_0x61b13&&_0x61b13['autoAssociation']===0x0){return db[_0xa4f8('0x2a')][_0xa4f8('0x4f')]({'name':_0x91fa48[_0xa4f8('0x2d')],'resourceId':_0x91fa48['id'],'type':_0x61b13['name'],'sectionId':_0x61b13['id']},{})[_0xa4f8('0x27')](function(){return _0x1cc1ba;});}else{return _0x1cc1ba;}})[_0xa4f8('0x4b')](function(_0x55c9df){logger[_0xa4f8('0x2c')](_0xa4f8('0x54'),_0x55c9df);throw _0x55c9df;});}return _0x1cc1ba;})[_0xa4f8('0x27')](respondWithResult(_0x2ab8da,0xc9))[_0xa4f8('0x4b')](handleError(_0x2ab8da,null));};exports['update']=function(_0x4777c9,_0x1236fd){if(_0x4777c9[_0xa4f8('0x55')]['id']){delete _0x4777c9[_0xa4f8('0x55')]['id'];}return db[_0xa4f8('0x31')][_0xa4f8('0x4e')]({'where':{'id':_0x4777c9[_0xa4f8('0x56')]['id']}})[_0xa4f8('0x27')](handleEntityNotFound(_0x1236fd,null))[_0xa4f8('0x27')](saveUpdates(_0x4777c9['body'],null))[_0xa4f8('0x27')](respondWithResult(_0x1236fd,null))['catch'](handleError(_0x1236fd,null));};exports[_0xa4f8('0x2b')]=function(_0x4a72c7,_0x390815){return db[_0xa4f8('0x31')]['find']({'where':{'id':_0x4a72c7[_0xa4f8('0x56')]['id']}})[_0xa4f8('0x27')](handleEntityNotFound(_0x390815,null))['then'](removeEntity(_0x390815,null))[_0xa4f8('0x4b')](handleError(_0x390815,null));};exports[_0xa4f8('0x57')]=function(_0x4a34c6,_0x439edd,_0x343291){return db[_0xa4f8('0x31')][_0xa4f8('0x4e')]({'where':{'id':_0x4a34c6[_0xa4f8('0x56')]['id']}})[_0xa4f8('0x27')](handleEntityNotFound(_0x439edd,null))[_0xa4f8('0x27')](function(_0x48fa01){if(_0x48fa01){return _0x48fa01['addUsers'](_0x4a34c6[_0xa4f8('0x55')][_0xa4f8('0x58')],_[_0xa4f8('0x59')](_0x4a34c6[_0xa4f8('0x55')],[_0xa4f8('0x58'),'id'])||{});}})[_0xa4f8('0x27')](respondWithResult(_0x439edd,null))[_0xa4f8('0x4b')](handleError(_0x439edd,null));};exports[_0xa4f8('0x5a')]=function(_0x386dad,_0x1a4a23,_0x42ab51){return db[_0xa4f8('0x31')][_0xa4f8('0x4e')]({'where':{'id':_0x386dad[_0xa4f8('0x56')]['id']}})[_0xa4f8('0x27')](handleEntityNotFound(_0x1a4a23,null))[_0xa4f8('0x27')](function(_0xe07a23){if(_0xe07a23){return _0xe07a23['removeUsers'](_0x386dad[_0xa4f8('0x36')][_0xa4f8('0x58')])[_0xa4f8('0x27')](function(){if(_[_0xa4f8('0x5b')](_0x386dad[_0xa4f8('0x36')][_0xa4f8('0x58')])){for(var _0x287643=0x0;_0x287643<_0x386dad[_0xa4f8('0x36')][_0xa4f8('0x58')][_0xa4f8('0x3c')];_0x287643+=0x1){socket[_0xa4f8('0x5c')]('userSquareProject:remove',{'UserId':Number(_0x386dad[_0xa4f8('0x36')][_0xa4f8('0x58')][_0x287643]),'SquareProjectId':Number(_0x386dad['params']['id'])});}}else{socket[_0xa4f8('0x5c')]('userSquareProject:remove',{'UserId':Number(_0x386dad['query'][_0xa4f8('0x58')]),'SquareProjectId':Number(_0x386dad[_0xa4f8('0x56')]['id'])});}});}})[_0xa4f8('0x27')](respondWithStatusCode(_0x1a4a23,null))['catch'](handleError(_0x1a4a23,null));};exports[_0xa4f8('0x5d')]=function(_0x51fbad,_0x3c9169,_0x5e6f4a){var _0xd54368={};var _0x4697d6={};var _0x53c4d6;var _0x3f5684;return db['SquareProject']['findOne']({'where':{'id':_0x51fbad['params']['id']}})[_0xa4f8('0x27')](handleEntityNotFound(_0x3c9169,null))[_0xa4f8('0x27')](function(_0x453fd3){if(_0x453fd3){_0x53c4d6=_0x453fd3;_0x4697d6[_0xa4f8('0x35')]=_[_0xa4f8('0x37')](db[_0xa4f8('0x5e')]['rawAttributes']);_0x4697d6[_0xa4f8('0x36')]=_['keys'](_0x51fbad[_0xa4f8('0x36')]);_0x4697d6[_0xa4f8('0x38')]=_[_0xa4f8('0x39')](_0x4697d6['model'],_0x4697d6[_0xa4f8('0x36')]);_0xd54368['attributes']=_['intersection'](_0x4697d6[_0xa4f8('0x35')],qs[_0xa4f8('0x3b')](_0x51fbad[_0xa4f8('0x36')]['fields']));_0xd54368['attributes']=_0xd54368['attributes']['length']?_0xd54368[_0xa4f8('0x3a')]:_0x4697d6[_0xa4f8('0x35')];_0xd54368['order']=qs[_0xa4f8('0x40')](_0x51fbad[_0xa4f8('0x36')][_0xa4f8('0x40')]);_0xd54368[_0xa4f8('0x41')]=qs[_0xa4f8('0x38')](_[_0xa4f8('0x42')](_0x51fbad['query'],_0x4697d6[_0xa4f8('0x38')]));if(_0x51fbad[_0xa4f8('0x36')][_0xa4f8('0x43')]){_0xd54368[_0xa4f8('0x41')]=_[_0xa4f8('0x44')](_0xd54368[_0xa4f8('0x41')],{'$or':_[_0xa4f8('0x30')](_0xd54368['attributes'],function(_0x378026){var _0x4db104={};_0x4db104[_0x378026]={'$like':'%'+_0x51fbad[_0xa4f8('0x36')][_0xa4f8('0x43')]+'%'};return _0x4db104;})});}_0xd54368=_['merge']({},_0xd54368,_0x51fbad['options']);return _0x53c4d6[_0xa4f8('0x5d')](_0xd54368);}})['then'](function(_0x547b6c){if(_0x547b6c){_0x3f5684=_0x547b6c['length'];if(!_0x51fbad['query'][_0xa4f8('0x3d')](_0xa4f8('0x3e'))){_0xd54368[_0xa4f8('0x1f')]=qs[_0xa4f8('0x1f')](_0x51fbad['query'][_0xa4f8('0x1f')]);_0xd54368['offset']=qs[_0xa4f8('0x22')](_0x51fbad['query'][_0xa4f8('0x22')]);}return _0x53c4d6[_0xa4f8('0x5d')](_0xd54368);}})['then'](function(_0xe43f30){if(_0xe43f30){return _0xe43f30?{'count':_0x3f5684,'rows':_0xe43f30}:null;}})['then'](respondWithResult(_0x3c9169,null))['catch'](handleError(_0x3c9169,null));}; \ No newline at end of file +var _0xc023=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','count','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','SquareProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','rows','catch','show','params','keys','length','find','create','body','user','SquareProjects','UserProfileSection'];(function(_0x367a3d,_0x452717){var _0x460539=function(_0x1e8beb){while(--_0x1e8beb){_0x367a3d['push'](_0x367a3d['shift']());}};_0x460539(++_0x452717);}(_0xc023,0x1ee));var _0x3c02=function(_0x4c6a7f,_0x452cf6){_0x4c6a7f=_0x4c6a7f-0x0;var _0x1a5474=_0xc023[_0x4c6a7f];return _0x1a5474;};'use strict';var emlformat=require(_0x3c02('0x0'));var rimraf=require(_0x3c02('0x1'));var zipdir=require(_0x3c02('0x2'));var jsonpatch=require(_0x3c02('0x3'));var rp=require(_0x3c02('0x4'));var moment=require(_0x3c02('0x5'));var BPromise=require(_0x3c02('0x6'));var Mustache=require(_0x3c02('0x7'));var util=require(_0x3c02('0x8'));var path=require('path');var sox=require(_0x3c02('0x9'));var csv=require('to-csv');var ejs=require(_0x3c02('0xa'));var fs=require('fs');var fs_extra=require(_0x3c02('0xb'));var _=require(_0x3c02('0xc'));var squel=require('squel');var crypto=require(_0x3c02('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3c02('0xe'));var toCsv=require(_0x3c02('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3c02('0x10'));var authService=require(_0x3c02('0x11'));var qs=require(_0x3c02('0x12'));var as=require(_0x3c02('0x13'));var hardwareService=require(_0x3c02('0x14'));var logger=require(_0x3c02('0x15'))(_0x3c02('0x16'));var utils=require(_0x3c02('0x17'));var config=require(_0x3c02('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3c02('0x19'))['db'];config[_0x3c02('0x1a')]=_[_0x3c02('0x1b')](config[_0x3c02('0x1a')],{'host':_0x3c02('0x1c'),'port':0x18eb});var socket=require(_0x3c02('0x1d'))(new Redis(config[_0x3c02('0x1a')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x2504ed,_0x36f4ba){_0x36f4ba=_0x36f4ba||0xcc;return function(_0x16c105){if(_0x16c105){return _0x2504ed[_0x3c02('0x1e')](_0x36f4ba);}return _0x2504ed[_0x3c02('0x1f')](_0x36f4ba)[_0x3c02('0x20')]();};}function respondWithResult(_0x325c19,_0xeb960c){_0xeb960c=_0xeb960c||0xc8;return function(_0x5b23c8){if(_0x5b23c8){return _0x325c19[_0x3c02('0x1f')](_0xeb960c)[_0x3c02('0x21')](_0x5b23c8);}};}function respondWithFilteredResult(_0x29aaa2,_0x482486){return function(_0x51b48e){if(_0x51b48e){var _0x109433=typeof _0x482486[_0x3c02('0x22')]==='undefined'&&typeof _0x482486[_0x3c02('0x23')]==='undefined';var _0x228c27=_0x51b48e[_0x3c02('0x24')];var _0x10cdf9=_0x109433?0x0:_0x482486[_0x3c02('0x22')];var _0x4d3e13=_0x109433?_0x51b48e[_0x3c02('0x24')]:_0x482486[_0x3c02('0x22')]+_0x482486[_0x3c02('0x23')];var _0x443537;if(_0x4d3e13>=_0x228c27){_0x4d3e13=_0x228c27;_0x443537=0xc8;}else{_0x443537=0xce;}_0x29aaa2[_0x3c02('0x1f')](_0x443537);return _0x29aaa2['set']('Content-Range',_0x10cdf9+'-'+_0x4d3e13+'/'+_0x228c27)['json'](_0x51b48e);}return null;};}function patchUpdates(_0x2165ca){return function(_0x50b278){try{jsonpatch[_0x3c02('0x25')](_0x50b278,_0x2165ca,!![]);}catch(_0x71d906){return BPromise[_0x3c02('0x26')](_0x71d906);}return _0x50b278[_0x3c02('0x27')]();};}function saveUpdates(_0x2fd337,_0x32f9a2){return function(_0x27e04){if(_0x27e04){return _0x27e04[_0x3c02('0x28')](_0x2fd337)[_0x3c02('0x29')](function(_0x18e9de){return _0x18e9de;});}return null;};}function removeEntity(_0x2bd673,_0xfe961f){return function(_0x719482){if(_0x719482){return _0x719482[_0x3c02('0x2a')]()[_0x3c02('0x29')](function(){var _0x44401c=_0x719482[_0x3c02('0x2b')]({'plain':!![]});var _0x1485d0='SquareProjects';return db[_0x3c02('0x2c')][_0x3c02('0x2a')]({'where':{'type':_0x1485d0,'resourceId':_0x44401c['id']}})['then'](function(){return _0x719482;});})[_0x3c02('0x29')](function(){_0x2bd673[_0x3c02('0x1f')](0xcc)[_0x3c02('0x20')]();});}};}function handleEntityNotFound(_0x434bef,_0x44432b){return function(_0x958b2d){if(!_0x958b2d){_0x434bef['sendStatus'](0x194);}return _0x958b2d;};}function handleError(_0x5f2b32,_0x1e0a82){_0x1e0a82=_0x1e0a82||0x1f4;return function(_0x34053e){logger[_0x3c02('0x2d')](_0x34053e[_0x3c02('0x2e')]);if(_0x34053e[_0x3c02('0x2f')]){delete _0x34053e['name'];}_0x5f2b32['status'](_0x1e0a82)['send'](_0x34053e);};}exports['index']=function(_0x3e3b90,_0x4b7774){var _0x31451e={},_0xaf69fc={},_0x126d88={'count':0x0,'rows':[]};var _0x9a512c=_[_0x3c02('0x30')](db[_0x3c02('0x31')][_0x3c02('0x32')],function(_0x407c4a){return{'name':_0x407c4a[_0x3c02('0x33')],'type':_0x407c4a[_0x3c02('0x34')][_0x3c02('0x35')]};});_0xaf69fc[_0x3c02('0x36')]=_[_0x3c02('0x30')](_0x9a512c,_0x3c02('0x2f'));_0xaf69fc[_0x3c02('0x37')]=_['keys'](_0x3e3b90[_0x3c02('0x37')]);_0xaf69fc[_0x3c02('0x38')]=_[_0x3c02('0x39')](_0xaf69fc[_0x3c02('0x36')],_0xaf69fc[_0x3c02('0x37')]);_0x31451e[_0x3c02('0x3a')]=_[_0x3c02('0x39')](_0xaf69fc[_0x3c02('0x36')],qs['fields'](_0x3e3b90[_0x3c02('0x37')][_0x3c02('0x3b')]));_0x31451e[_0x3c02('0x3a')]=_0x31451e[_0x3c02('0x3a')]['length']?_0x31451e[_0x3c02('0x3a')]:_0xaf69fc[_0x3c02('0x36')];if(!_0x3e3b90['query']['hasOwnProperty'](_0x3c02('0x3c'))){_0x31451e[_0x3c02('0x23')]=qs[_0x3c02('0x23')](_0x3e3b90['query'][_0x3c02('0x23')]);_0x31451e[_0x3c02('0x22')]=qs[_0x3c02('0x22')](_0x3e3b90[_0x3c02('0x37')][_0x3c02('0x22')]);}_0x31451e[_0x3c02('0x3d')]=qs[_0x3c02('0x3e')](_0x3e3b90[_0x3c02('0x37')]['sort']);_0x31451e['where']=qs[_0x3c02('0x38')](_[_0x3c02('0x3f')](_0x3e3b90[_0x3c02('0x37')],_0xaf69fc[_0x3c02('0x38')]),_0x9a512c);if(_0x3e3b90[_0x3c02('0x37')][_0x3c02('0x40')]){_0x31451e['where']=_[_0x3c02('0x41')](_0x31451e[_0x3c02('0x42')],{'$or':_[_0x3c02('0x30')](_0x9a512c,function(_0x5d2335){if(_0x5d2335['type']!=='VIRTUAL'){var _0xfbcf5a={};_0xfbcf5a[_0x5d2335[_0x3c02('0x2f')]]={'$like':'%'+_0x3e3b90[_0x3c02('0x37')]['filter']+'%'};return _0xfbcf5a;}})});}_0x31451e=_[_0x3c02('0x41')]({},_0x31451e,_0x3e3b90[_0x3c02('0x43')]);var _0xeeea57={'where':_0x31451e[_0x3c02('0x42')]};return db[_0x3c02('0x31')][_0x3c02('0x24')](_0xeeea57)['then'](function(_0x501e72){_0x126d88['count']=_0x501e72;if(_0x3e3b90[_0x3c02('0x37')][_0x3c02('0x44')]){_0x31451e[_0x3c02('0x45')]=[{'all':!![]}];}return db[_0x3c02('0x31')]['findAll'](_0x31451e);})[_0x3c02('0x29')](function(_0x3a3056){_0x126d88[_0x3c02('0x46')]=_0x3a3056;return _0x126d88;})[_0x3c02('0x29')](respondWithFilteredResult(_0x4b7774,_0x31451e))[_0x3c02('0x47')](handleError(_0x4b7774,null));};exports[_0x3c02('0x48')]=function(_0x5bbddf,_0x460c2a){var _0x59f7c5={'raw':![],'where':{'id':_0x5bbddf[_0x3c02('0x49')]['id']}},_0x49c14d={};_0x49c14d[_0x3c02('0x36')]=_['keys'](db[_0x3c02('0x31')][_0x3c02('0x32')]);_0x49c14d[_0x3c02('0x37')]=_[_0x3c02('0x4a')](_0x5bbddf[_0x3c02('0x37')]);_0x49c14d[_0x3c02('0x38')]=_[_0x3c02('0x39')](_0x49c14d[_0x3c02('0x36')],_0x49c14d['query']);_0x59f7c5['attributes']=_[_0x3c02('0x39')](_0x49c14d[_0x3c02('0x36')],qs[_0x3c02('0x3b')](_0x5bbddf[_0x3c02('0x37')][_0x3c02('0x3b')]));_0x59f7c5['attributes']=_0x59f7c5[_0x3c02('0x3a')][_0x3c02('0x4b')]?_0x59f7c5[_0x3c02('0x3a')]:_0x49c14d[_0x3c02('0x36')];if(_0x5bbddf[_0x3c02('0x37')][_0x3c02('0x44')]){_0x59f7c5[_0x3c02('0x45')]=[{'all':!![]}];}_0x59f7c5=_[_0x3c02('0x41')]({},_0x59f7c5,_0x5bbddf[_0x3c02('0x43')]);return db[_0x3c02('0x31')][_0x3c02('0x4c')](_0x59f7c5)['then'](handleEntityNotFound(_0x460c2a,null))[_0x3c02('0x29')](respondWithResult(_0x460c2a,null))[_0x3c02('0x47')](handleError(_0x460c2a,null));};exports['create']=function(_0x437eb6,_0x280d0c){return db['SquareProject'][_0x3c02('0x4d')](_0x437eb6[_0x3c02('0x4e')],{})[_0x3c02('0x29')](function(_0x1df42d){var _0xc1a948=_0x437eb6['user'][_0x3c02('0x2b')]({'plain':!![]});if(!_0xc1a948)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc1a948['role']===_0x3c02('0x4f')){var _0x46db2e=_0x1df42d[_0x3c02('0x2b')]({'plain':!![]});var _0x1ee537=_0x3c02('0x50');return db[_0x3c02('0x51')][_0x3c02('0x4c')]({'where':{'name':_0x1ee537,'userProfileId':_0xc1a948[_0x3c02('0x52')]},'raw':!![]})[_0x3c02('0x29')](function(_0x201e23){if(_0x201e23&&_0x201e23[_0x3c02('0x53')]===0x0){return db[_0x3c02('0x2c')][_0x3c02('0x4d')]({'name':_0x46db2e[_0x3c02('0x2f')],'resourceId':_0x46db2e['id'],'type':_0x201e23[_0x3c02('0x2f')],'sectionId':_0x201e23['id']},{})['then'](function(){return _0x1df42d;});}else{return _0x1df42d;}})['catch'](function(_0x2331e9){logger[_0x3c02('0x2d')](_0x3c02('0x54'),_0x2331e9);throw _0x2331e9;});}return _0x1df42d;})[_0x3c02('0x29')](respondWithResult(_0x280d0c,0xc9))[_0x3c02('0x47')](handleError(_0x280d0c,null));};exports[_0x3c02('0x28')]=function(_0x161b67,_0x4a7ce8){if(_0x161b67['body']['id']){delete _0x161b67[_0x3c02('0x4e')]['id'];}return db['SquareProject']['find']({'where':{'id':_0x161b67[_0x3c02('0x49')]['id']}})[_0x3c02('0x29')](handleEntityNotFound(_0x4a7ce8,null))[_0x3c02('0x29')](saveUpdates(_0x161b67[_0x3c02('0x4e')],null))[_0x3c02('0x29')](respondWithResult(_0x4a7ce8,null))['catch'](handleError(_0x4a7ce8,null));};exports[_0x3c02('0x2a')]=function(_0x3444d0,_0x3e3b20){return db[_0x3c02('0x31')][_0x3c02('0x4c')]({'where':{'id':_0x3444d0[_0x3c02('0x49')]['id']}})[_0x3c02('0x29')](handleEntityNotFound(_0x3e3b20,null))['then'](removeEntity(_0x3e3b20,null))[_0x3c02('0x47')](handleError(_0x3e3b20,null));};exports[_0x3c02('0x55')]=function(_0x18646f,_0x14cf85,_0x47b3df){return db[_0x3c02('0x31')][_0x3c02('0x4c')]({'where':{'id':_0x18646f['params']['id']}})[_0x3c02('0x29')](handleEntityNotFound(_0x14cf85,null))[_0x3c02('0x29')](function(_0x236de4){if(_0x236de4){return _0x236de4['addUsers'](_0x18646f['body'][_0x3c02('0x56')],_[_0x3c02('0x57')](_0x18646f[_0x3c02('0x4e')],[_0x3c02('0x56'),'id'])||{});}})[_0x3c02('0x29')](respondWithResult(_0x14cf85,null))['catch'](handleError(_0x14cf85,null));};exports[_0x3c02('0x58')]=function(_0x30c975,_0x3eaa34,_0x2b04f7){return db[_0x3c02('0x31')][_0x3c02('0x4c')]({'where':{'id':_0x30c975['params']['id']}})['then'](handleEntityNotFound(_0x3eaa34,null))[_0x3c02('0x29')](function(_0x1adb1f){if(_0x1adb1f){return _0x1adb1f[_0x3c02('0x58')](_0x30c975[_0x3c02('0x37')][_0x3c02('0x56')])[_0x3c02('0x29')](function(){if(_[_0x3c02('0x59')](_0x30c975[_0x3c02('0x37')][_0x3c02('0x56')])){for(var _0x3a5af6=0x0;_0x3a5af6<_0x30c975[_0x3c02('0x37')][_0x3c02('0x56')][_0x3c02('0x4b')];_0x3a5af6+=0x1){socket[_0x3c02('0x5a')](_0x3c02('0x5b'),{'UserId':Number(_0x30c975[_0x3c02('0x37')][_0x3c02('0x56')][_0x3a5af6]),'SquareProjectId':Number(_0x30c975[_0x3c02('0x49')]['id'])});}}else{socket[_0x3c02('0x5a')]('userSquareProject:remove',{'UserId':Number(_0x30c975[_0x3c02('0x37')][_0x3c02('0x56')]),'SquareProjectId':Number(_0x30c975[_0x3c02('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x3eaa34,null))[_0x3c02('0x47')](handleError(_0x3eaa34,null));};exports[_0x3c02('0x5c')]=function(_0x5087ae,_0x1f287e,_0x5f314f){var _0x10b068={};var _0x46e818={};var _0x21a949;var _0x2b41f2;return db[_0x3c02('0x31')][_0x3c02('0x5d')]({'where':{'id':_0x5087ae[_0x3c02('0x49')]['id']}})[_0x3c02('0x29')](handleEntityNotFound(_0x1f287e,null))[_0x3c02('0x29')](function(_0x45cd0c){if(_0x45cd0c){_0x21a949=_0x45cd0c;_0x46e818[_0x3c02('0x36')]=_['keys'](db[_0x3c02('0x5e')][_0x3c02('0x32')]);_0x46e818[_0x3c02('0x37')]=_[_0x3c02('0x4a')](_0x5087ae['query']);_0x46e818['filters']=_[_0x3c02('0x39')](_0x46e818['model'],_0x46e818[_0x3c02('0x37')]);_0x10b068[_0x3c02('0x3a')]=_[_0x3c02('0x39')](_0x46e818['model'],qs[_0x3c02('0x3b')](_0x5087ae[_0x3c02('0x37')][_0x3c02('0x3b')]));_0x10b068[_0x3c02('0x3a')]=_0x10b068['attributes'][_0x3c02('0x4b')]?_0x10b068[_0x3c02('0x3a')]:_0x46e818[_0x3c02('0x36')];_0x10b068[_0x3c02('0x3d')]=qs['sort'](_0x5087ae[_0x3c02('0x37')][_0x3c02('0x3e')]);_0x10b068['where']=qs[_0x3c02('0x38')](_[_0x3c02('0x3f')](_0x5087ae['query'],_0x46e818[_0x3c02('0x38')]));if(_0x5087ae[_0x3c02('0x37')][_0x3c02('0x40')]){_0x10b068[_0x3c02('0x42')]=_[_0x3c02('0x41')](_0x10b068['where'],{'$or':_['map'](_0x10b068['attributes'],function(_0xb0b09d){var _0x2ba813={};_0x2ba813[_0xb0b09d]={'$like':'%'+_0x5087ae['query'][_0x3c02('0x40')]+'%'};return _0x2ba813;})});}_0x10b068=_['merge']({},_0x10b068,_0x5087ae[_0x3c02('0x43')]);return _0x21a949[_0x3c02('0x5c')](_0x10b068);}})['then'](function(_0x44cb1c){if(_0x44cb1c){_0x2b41f2=_0x44cb1c['length'];if(!_0x5087ae[_0x3c02('0x37')][_0x3c02('0x5f')](_0x3c02('0x3c'))){_0x10b068[_0x3c02('0x23')]=qs[_0x3c02('0x23')](_0x5087ae['query'][_0x3c02('0x23')]);_0x10b068[_0x3c02('0x22')]=qs[_0x3c02('0x22')](_0x5087ae[_0x3c02('0x37')][_0x3c02('0x22')]);}return _0x21a949['getUsers'](_0x10b068);}})['then'](function(_0x58712e){if(_0x58712e){return _0x58712e?{'count':_0x2b41f2,'rows':_0x58712e}:null;}})[_0x3c02('0x29')](respondWithResult(_0x1f287e,null))[_0x3c02('0x47')](handleError(_0x1f287e,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 67ea641..96a9f71 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 _0x887e=['exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x887e,0x10f));var _0xe887=function(_0x129d7d,_0x2ba9ec){_0x129d7d=_0x129d7d-0x0;var _0xbc189e=_0x887e[_0x129d7d];return _0xbc189e;};'use strict';var EventEmitter=require(_0xe887('0x0'));var SquareProject=require(_0xe887('0x1'))['db'][_0xe887('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xe887('0x3')](0x0);var events={'afterCreate':_0xe887('0x4'),'afterUpdate':_0xe887('0x5'),'afterDestroy':_0xe887('0x6')};function emitEvent(_0xe62163){return function(_0xdb48b2,_0x37a46e,_0x14cf75){SquareProjectEvents[_0xe887('0x7')](_0xe62163+':'+_0xdb48b2['id'],_0xdb48b2);SquareProjectEvents['emit'](_0xe62163,_0xdb48b2);_0x14cf75(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xe887('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xfce6=['events','../../mysqldb','update','emit','hasOwnProperty','hook','exports'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xfce6,0x13b));var _0x6fce=function(_0x1f96c5,_0x3ceb18){_0x1f96c5=_0x1f96c5-0x0;var _0x4955ee=_0xfce6[_0x1f96c5];return _0x4955ee;};'use strict';var EventEmitter=require(_0x6fce('0x0'));var SquareProject=require(_0x6fce('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6fce('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1dfce0){return function(_0x4a81a,_0xdbec3b,_0x491b58){SquareProjectEvents[_0x6fce('0x3')](_0x1dfce0+':'+_0x4a81a['id'],_0x4a81a);SquareProjectEvents[_0x6fce('0x3')](_0x1dfce0,_0x4a81a);_0x491b58(null);};}for(var e in events){if(events[_0x6fce('0x4')](e)){var event=events[e];SquareProject[_0x6fce('0x5')](e,emitEvent(event));}}module[_0x6fce('0x6')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index fd9cfd1..ddf0825 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 _0x0644=['publishedAt','lodash','../../config/logger','moment','request-promise','path','../../config/environment','./squareProject.attributes','exports','define','square_projects','changed','format','YYYY-MM-DD\x20HH:mm:ss','production'];(function(_0x4d9d79,_0x424f6f){var _0x248b71=function(_0xd54172){while(--_0xd54172){_0x4d9d79['push'](_0x4d9d79['shift']());}};_0x248b71(++_0x424f6f);}(_0x0644,0x11e));var _0x4064=function(_0x70e420,_0x2d7b4e){_0x70e420=_0x70e420-0x0;var _0x3bfbd7=_0x0644[_0x70e420];return _0x3bfbd7;};'use strict';var _=require(_0x4064('0x0'));var util=require('util');var logger=require(_0x4064('0x1'))('api');var moment=require(_0x4064('0x2'));var BPromise=require('bluebird');var rp=require(_0x4064('0x3'));var fs=require('fs');var path=require(_0x4064('0x4'));var rimraf=require('rimraf');var config=require(_0x4064('0x5'));var attributes=require(_0x4064('0x6'));module[_0x4064('0x7')]=function(_0x2e3409,_0x38f4de){return _0x2e3409[_0x4064('0x8')]('SquareProject',attributes,{'tableName':_0x4064('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21386f,_0x345e71,_0x1dd586){if(_0x21386f[_0x4064('0xa')]('preproduction')){_0x21386f['savedAt']=moment()[_0x4064('0xb')](_0x4064('0xc'));}if(_0x21386f[_0x4064('0xa')](_0x4064('0xd'))){_0x21386f[_0x4064('0xe')]=moment()[_0x4064('0xb')](_0x4064('0xc'));}_0x1dd586(null,_0x21386f);}}});}; \ No newline at end of file +var _0xcfeb=['square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','define'];(function(_0x368bcf,_0x1ff941){var _0x23ec7d=function(_0x189527){while(--_0x189527){_0x368bcf['push'](_0x368bcf['shift']());}};_0x23ec7d(++_0x1ff941);}(_0xcfeb,0x1ee));var _0xbcfe=function(_0x4c2655,_0x507f72){_0x4c2655=_0x4c2655-0x0;var _0x45b3f8=_0xcfeb[_0x4c2655];return _0x45b3f8;};'use strict';var _=require('lodash');var util=require(_0xbcfe('0x0'));var logger=require(_0xbcfe('0x1'))(_0xbcfe('0x2'));var moment=require('moment');var BPromise=require(_0xbcfe('0x3'));var rp=require(_0xbcfe('0x4'));var fs=require('fs');var path=require(_0xbcfe('0x5'));var rimraf=require(_0xbcfe('0x6'));var config=require(_0xbcfe('0x7'));var attributes=require(_0xbcfe('0x8'));module['exports']=function(_0x289829,_0x5842f1){return _0x289829[_0xbcfe('0x9')]('SquareProject',attributes,{'tableName':_0xbcfe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5807d0,_0x2cd62d,_0x370204){if(_0x5807d0['changed'](_0xbcfe('0xb'))){_0x5807d0[_0xbcfe('0xc')]=moment()[_0xbcfe('0xd')](_0xbcfe('0xe'));}if(_0x5807d0[_0xbcfe('0xf')](_0xbcfe('0x10'))){_0x5807d0[_0xbcfe('0x11')]=moment()[_0xbcfe('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x370204(null,_0x5807d0);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 3a3c64f..646d0d8 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 _0xd522=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','debug','request\x20sent','error','code','SquareProject,\x20%s,\x20%s','message','catch','ShowSquareProject','SquareProject','options','raw','attributes','include','map','model','lodash','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd522,0xa3));var _0x2d52=function(_0x573fd7,_0x4c63c1){_0x573fd7=_0x573fd7-0x0;var _0x385c9b=_0xd522[_0x573fd7];return _0x385c9b;};'use strict';var _=require(_0x2d52('0x0'));var util=require(_0x2d52('0x1'));var moment=require(_0x2d52('0x2'));var BPromise=require(_0x2d52('0x3'));var rs=require(_0x2d52('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d52('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d52('0x6'))(_0x2d52('0x7'));var config=require(_0x2d52('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2d52('0x9')]({'port':0x232a});config[_0x2d52('0xa')]=_['defaults'](config[_0x2d52('0xa')],{'host':_0x2d52('0xb'),'port':0x18eb});var socket=require(_0x2d52('0xc'))(new Redis(config[_0x2d52('0xa')]));require(_0x2d52('0xd'))[_0x2d52('0xe')](socket);function respondWithRpcPromise(_0x423130,_0x4b1e5b,_0x50d571){return new BPromise(function(_0x449025,_0x306553){return client[_0x2d52('0xf')](_0x423130,_0x50d571)[_0x2d52('0x10')](function(_0x135352){logger[_0x2d52('0x11')]('SquareProject,\x20%s,\x20%s',_0x4b1e5b,'request\x20sent');logger[_0x2d52('0x12')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x4b1e5b,_0x2d52('0x13'),JSON['stringify'](_0x135352));if(_0x135352[_0x2d52('0x14')]){if(_0x135352[_0x2d52('0x14')][_0x2d52('0x15')]===0x1f4){logger[_0x2d52('0x14')](_0x2d52('0x16'),_0x4b1e5b,_0x135352['error'][_0x2d52('0x17')]);return _0x306553(_0x135352[_0x2d52('0x14')][_0x2d52('0x17')]);}logger[_0x2d52('0x14')]('SquareProject,\x20%s,\x20%s',_0x4b1e5b,_0x135352[_0x2d52('0x14')][_0x2d52('0x17')]);return _0x449025(_0x135352[_0x2d52('0x14')][_0x2d52('0x17')]);}else{logger[_0x2d52('0x11')]('SquareProject,\x20%s,\x20%s',_0x4b1e5b,_0x2d52('0x13'));_0x449025(_0x135352['result'][_0x2d52('0x17')]);}})[_0x2d52('0x18')](function(_0x24bb4c){logger[_0x2d52('0x14')](_0x2d52('0x16'),_0x4b1e5b,_0x24bb4c);_0x306553(_0x24bb4c);});});}exports[_0x2d52('0x19')]=function(_0x2eacb9){var _0x31db4e=this;return new Promise(function(_0x3c9473,_0x4a2051){return db[_0x2d52('0x1a')]['find']({'raw':_0x2eacb9['options']?_0x2eacb9[_0x2d52('0x1b')][_0x2d52('0x1c')]===undefined?!![]:![]:!![],'where':_0x2eacb9[_0x2d52('0x1b')]?_0x2eacb9[_0x2d52('0x1b')]['where']||null:null,'attributes':_0x2eacb9[_0x2d52('0x1b')]?_0x2eacb9[_0x2d52('0x1b')][_0x2d52('0x1d')]||null:null,'include':_0x2eacb9[_0x2d52('0x1b')]?_0x2eacb9[_0x2d52('0x1b')][_0x2d52('0x1e')]?_[_0x2d52('0x1f')](_0x2eacb9['options'][_0x2d52('0x1e')],function(_0x24780a){return{'model':db[_0x24780a['model']],'as':_0x24780a['as'],'attributes':_0x24780a[_0x2d52('0x1d')],'include':_0x24780a[_0x2d52('0x1e')]?_['map'](_0x24780a[_0x2d52('0x1e')],function(_0x2e83e4){return{'model':db[_0x2e83e4[_0x2d52('0x20')]],'as':_0x2e83e4['as'],'attributes':_0x2e83e4[_0x2d52('0x1d')],'include':_0x2e83e4[_0x2d52('0x1e')]?_['map'](_0x2e83e4[_0x2d52('0x1e')],function(_0x3f00a0){return{'model':db[_0x3f00a0[_0x2d52('0x20')]],'as':_0x3f00a0['as'],'attributes':_0x3f00a0[_0x2d52('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2d52('0x10')](function(_0x4c5905){logger['info'](_0x2d52('0x19'),_0x2eacb9);logger['debug'](_0x2d52('0x19'),_0x2eacb9,JSON['stringify'](_0x4c5905));_0x3c9473(_0x4c5905);})[_0x2d52('0x18')](function(_0x34fe8b){logger[_0x2d52('0x14')](_0x2d52('0x19'),_0x34fe8b[_0x2d52('0x17')],_0x2eacb9);_0x4a2051(_0x31db4e[_0x2d52('0x14')](0x1f4,_0x34fe8b['message']));});});}; \ No newline at end of file +var _0x543e=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','info','SquareProject,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','ShowSquareProject','SquareProject','find','options','raw','attributes','include','map','model','stringify','lodash','moment','randomstring'];(function(_0x2fdeda,_0x17d17e){var _0x50b0d0=function(_0x3e6493){while(--_0x3e6493){_0x2fdeda['push'](_0x2fdeda['shift']());}};_0x50b0d0(++_0x17d17e);}(_0x543e,0xeb));var _0xe543=function(_0xf0c44f,_0x5b9618){_0xf0c44f=_0xf0c44f-0x0;var _0x2b3a94=_0x543e[_0xf0c44f];return _0x2b3a94;};'use strict';var _=require(_0xe543('0x0'));var util=require('util');var moment=require(_0xe543('0x1'));var BPromise=require('bluebird');var rs=require(_0xe543('0x2'));var fs=require('fs');var Redis=require(_0xe543('0x3'));var db=require(_0xe543('0x4'))['db'];var utils=require(_0xe543('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe543('0x6'));var jayson=require(_0xe543('0x7'));var client=jayson[_0xe543('0x8')][_0xe543('0x9')]({'port':0x232a});config[_0xe543('0xa')]=_[_0xe543('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe543('0xc'))(new Redis(config[_0xe543('0xa')]));require('./squareProject.socket')['register'](socket);function respondWithRpcPromise(_0x505d6b,_0x3e60f9,_0x5bd630){return new BPromise(function(_0x34a86f,_0x46faa9){return client[_0xe543('0xd')](_0x505d6b,_0x5bd630)[_0xe543('0xe')](function(_0x2ce748){logger[_0xe543('0xf')](_0xe543('0x10'),_0x3e60f9,'request\x20sent');logger[_0xe543('0x11')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x3e60f9,'request\x20sent',JSON['stringify'](_0x2ce748));if(_0x2ce748[_0xe543('0x12')]){if(_0x2ce748[_0xe543('0x12')][_0xe543('0x13')]===0x1f4){logger['error'](_0xe543('0x10'),_0x3e60f9,_0x2ce748[_0xe543('0x12')][_0xe543('0x14')]);return _0x46faa9(_0x2ce748[_0xe543('0x12')][_0xe543('0x14')]);}logger[_0xe543('0x12')](_0xe543('0x10'),_0x3e60f9,_0x2ce748['error'][_0xe543('0x14')]);return _0x34a86f(_0x2ce748[_0xe543('0x12')]['message']);}else{logger[_0xe543('0xf')](_0xe543('0x10'),_0x3e60f9,_0xe543('0x15'));_0x34a86f(_0x2ce748[_0xe543('0x16')][_0xe543('0x14')]);}})[_0xe543('0x17')](function(_0x35af1c){logger[_0xe543('0x12')](_0xe543('0x10'),_0x3e60f9,_0x35af1c);_0x46faa9(_0x35af1c);});});}exports[_0xe543('0x18')]=function(_0x4e2d33){var _0x444b46=this;return new Promise(function(_0x41788a,_0x2bc93c){return db[_0xe543('0x19')][_0xe543('0x1a')]({'raw':_0x4e2d33['options']?_0x4e2d33[_0xe543('0x1b')][_0xe543('0x1c')]===undefined?!![]:![]:!![],'where':_0x4e2d33['options']?_0x4e2d33['options']['where']||null:null,'attributes':_0x4e2d33['options']?_0x4e2d33[_0xe543('0x1b')][_0xe543('0x1d')]||null:null,'include':_0x4e2d33[_0xe543('0x1b')]?_0x4e2d33[_0xe543('0x1b')][_0xe543('0x1e')]?_[_0xe543('0x1f')](_0x4e2d33['options'][_0xe543('0x1e')],function(_0x47f399){return{'model':db[_0x47f399[_0xe543('0x20')]],'as':_0x47f399['as'],'attributes':_0x47f399[_0xe543('0x1d')],'include':_0x47f399[_0xe543('0x1e')]?_[_0xe543('0x1f')](_0x47f399[_0xe543('0x1e')],function(_0x47f101){return{'model':db[_0x47f101['model']],'as':_0x47f101['as'],'attributes':_0x47f101[_0xe543('0x1d')],'include':_0x47f101[_0xe543('0x1e')]?_[_0xe543('0x1f')](_0x47f101[_0xe543('0x1e')],function(_0x593dbb){return{'model':db[_0x593dbb['model']],'as':_0x593dbb['as'],'attributes':_0x593dbb['attributes']};}):[]};}):[]};}):[]:[]})[_0xe543('0xe')](function(_0x13bd3d){logger[_0xe543('0xf')](_0xe543('0x18'),_0x4e2d33);logger[_0xe543('0x11')](_0xe543('0x18'),_0x4e2d33,JSON[_0xe543('0x21')](_0x13bd3d));_0x41788a(_0x13bd3d);})['catch'](function(_0x29480f){logger[_0xe543('0x12')](_0xe543('0x18'),_0x29480f['message'],_0x4e2d33);_0x2bc93c(_0x444b46[_0xe543('0x12')](0x1f4,_0x29480f[_0xe543('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index d7f665b..95b0e03 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 _0xbf70=['update','emit','removeListener','register','squareProject:','save','remove'];(function(_0x2193bb,_0x45ea3d){var _0x3c4c18=function(_0x22f1bf){while(--_0x22f1bf){_0x2193bb['push'](_0x2193bb['shift']());}};_0x3c4c18(++_0x45ea3d);}(_0xbf70,0xde));var _0x0bf7=function(_0x6fdfa2,_0x28eb4f){_0x6fdfa2=_0x6fdfa2-0x0;var _0x1d5f13=_0xbf70[_0x6fdfa2];return _0x1d5f13;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x0bf7('0x0'),_0x0bf7('0x1'),_0x0bf7('0x2')];function createListener(_0x49935e,_0x1f407b){return function(_0x33b8e0){_0x1f407b[_0x0bf7('0x3')](_0x49935e,_0x33b8e0);};}function removeListener(_0x28e7d7,_0x622b46){return function(){SquareProjectEvents[_0x0bf7('0x4')](_0x28e7d7,_0x622b46);};}exports[_0x0bf7('0x5')]=function(_0x86edcc){for(var _0xf2b40d=0x0,_0x5e8614=events['length'];_0xf2b40d<_0x5e8614;_0xf2b40d++){var _0x2fabef=events[_0xf2b40d];var _0x291ad6=createListener(_0x0bf7('0x6')+_0x2fabef,_0x86edcc);SquareProjectEvents['on'](_0x2fabef,_0x291ad6);}}; \ No newline at end of file +var _0x0eaf=['save','remove','update','emit','removeListener','length','squareProject:','./squareProject.events'];(function(_0x589607,_0x273c18){var _0x33839a=function(_0xea1f04){while(--_0xea1f04){_0x589607['push'](_0x589607['shift']());}};_0x33839a(++_0x273c18);}(_0x0eaf,0xc7));var _0xf0ea=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0eaf[_0x19950b];return _0x3c6b41;};'use strict';var SquareProjectEvents=require(_0xf0ea('0x0'));var events=[_0xf0ea('0x1'),_0xf0ea('0x2'),_0xf0ea('0x3')];function createListener(_0x2682b6,_0x2656c4){return function(_0x38327d){_0x2656c4[_0xf0ea('0x4')](_0x2682b6,_0x38327d);};}function removeListener(_0xd852a2,_0x4fd664){return function(){SquareProjectEvents[_0xf0ea('0x5')](_0xd852a2,_0x4fd664);};}exports['register']=function(_0x3170c8){for(var _0x587546=0x0,_0x530fb9=events[_0xf0ea('0x6')];_0x587546<_0x530fb9;_0x587546++){var _0x575b22=events[_0x587546];var _0x4cae95=createListener(_0xf0ea('0x7')+_0x575b22,_0x3170c8);SquareProjectEvents['on'](_0x575b22,_0x4cae95);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index bef8b69..3c4eeda 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x17f1b0,_0x5cd2bf){var _0xee0d54=function(_0x570455){while(--_0x570455){_0x17f1b0['push'](_0x17f1b0['shift']());}};_0xee0d54(++_0x5cd2bf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _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(_0x8fc11c,_0x267245){var _0x326ef7=function(_0x52e69c){while(--_0x52e69c){_0x8fc11c['push'](_0x8fc11c['shift']());}};_0x326ef7(++_0x267245);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2c03d5,_0x5aa87c){_0x2c03d5=_0x2c03d5-0x0;var _0x2cbf49=_0x1cb9[_0x2c03d5];return _0x2cbf49;};'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 b1e8f07..f6d3849 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 _0x31f0=['getDataValue','savePath','substring','sequelize','STRING','VIRTUAL'];(function(_0x16f984,_0x370ee9){var _0x50b3a1=function(_0x4bbc72){while(--_0x4bbc72){_0x16f984['push'](_0x16f984['shift']());}};_0x50b3a1(++_0x370ee9);}(_0x31f0,0xb7));var _0x031f=function(_0x15507e,_0x3d9dd9){_0x15507e=_0x15507e-0x0;var _0xe07696=_0x31f0[_0x15507e];return _0xe07696;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x031f('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x031f('0x1')]},'context':{'type':Sequelize[_0x031f('0x1')]},'extension':{'type':Sequelize[_0x031f('0x1')]},'priority':{'type':Sequelize[_0x031f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x031f('0x1')]},'projectName':{'type':Sequelize[_0x031f('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x031f('0x2')],'get':function(){var _0x487e65='';var _0x365f59=this[_0x031f('0x3')](_0x031f('0x4'));if(_0x365f59){_0x487e65=_0x365f59[_0x031f('0x5')](_0x365f59['lastIndexOf']('.'));}return _0x487e65;}}}; \ No newline at end of file +var _0xee14=['VIRTUAL','getDataValue','savePath','substring','STRING'];(function(_0x16835b,_0x370d41){var _0x3dbd1f=function(_0x4bae13){while(--_0x4bae13){_0x16835b['push'](_0x16835b['shift']());}};_0x3dbd1f(++_0x370d41);}(_0xee14,0x13a));var _0x4ee1=function(_0x39cd22,_0x5ad9bf){_0x39cd22=_0x39cd22-0x0;var _0x498ef9=_0xee14[_0x39cd22];return _0x498ef9;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4ee1('0x0')]},'callerid':{'type':Sequelize[_0x4ee1('0x0')]},'calleridname':{'type':Sequelize[_0x4ee1('0x0')]},'context':{'type':Sequelize[_0x4ee1('0x0')]},'extension':{'type':Sequelize[_0x4ee1('0x0')]},'priority':{'type':Sequelize[_0x4ee1('0x0')]},'accountcode':{'type':Sequelize[_0x4ee1('0x0')]},'dnid':{'type':Sequelize[_0x4ee1('0x0')]},'projectName':{'type':Sequelize[_0x4ee1('0x0')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x4ee1('0x0')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x4ee1('0x1')],'get':function(){var _0x3a45a3='';var _0x187656=this[_0x4ee1('0x2')](_0x4ee1('0x3'));if(_0x187656){_0x3a45a3=_0x187656[_0x4ee1('0x4')](_0x187656['lastIndexOf']('.'));}return _0x3a45a3;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 025a099..fc53dcb 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 _0x64d0=['then','error','name','send','map','SquareRecording','rawAttributes','type','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','findAll','catch','show','include','find','create','body','update','params','download','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','recording','ValidationError','SquareRecording\x20not\x20found','extname','unlink','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','save','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64d0,0x1ee));var _0x064d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64d0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x064d('0x0'));var zipdir=require(_0x064d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x064d('0x2'));var BPromise=require(_0x064d('0x3'));var Mustache=require(_0x064d('0x4'));var util=require(_0x064d('0x5'));var path=require(_0x064d('0x6'));var sox=require(_0x064d('0x7'));var csv=require(_0x064d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x064d('0x9'));var _=require(_0x064d('0xa'));var squel=require(_0x064d('0xb'));var crypto=require('crypto');var jsforce=require(_0x064d('0xc'));var deskjs=require(_0x064d('0xd'));var toCsv=require(_0x064d('0x8'));var querystring=require(_0x064d('0xe'));var Papa=require(_0x064d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x064d('0x10'));var as=require(_0x064d('0x11'));var hardwareService=require(_0x064d('0x12'));var logger=require('../../config/logger')(_0x064d('0x13'));var utils=require(_0x064d('0x14'));var config=require(_0x064d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x064d('0x16'))['db'];function respondWithStatusCode(_0x3aeba2,_0x4b9b50){_0x4b9b50=_0x4b9b50||0xcc;return function(_0x4728a6){if(_0x4728a6){return _0x3aeba2['sendStatus'](_0x4b9b50);}return _0x3aeba2[_0x064d('0x17')](_0x4b9b50)[_0x064d('0x18')]();};}function respondWithResult(_0x4be002,_0x2a6f30){_0x2a6f30=_0x2a6f30||0xc8;return function(_0x222f64){if(_0x222f64){return _0x4be002[_0x064d('0x17')](_0x2a6f30)[_0x064d('0x19')](_0x222f64);}};}function respondWithFilteredResult(_0x448899,_0x7f3151){return function(_0x4786d0){if(_0x4786d0){var _0x1213b0=typeof _0x7f3151[_0x064d('0x1a')]==='undefined'&&typeof _0x7f3151[_0x064d('0x1b')]===_0x064d('0x1c');var _0x30162e=_0x4786d0[_0x064d('0x1d')];var _0x5b1ea7=_0x1213b0?0x0:_0x7f3151[_0x064d('0x1a')];var _0x2863f9=_0x1213b0?_0x4786d0[_0x064d('0x1d')]:_0x7f3151['offset']+_0x7f3151['limit'];var _0x446d34;if(_0x2863f9>=_0x30162e){_0x2863f9=_0x30162e;_0x446d34=0xc8;}else{_0x446d34=0xce;}_0x448899[_0x064d('0x17')](_0x446d34);return _0x448899[_0x064d('0x1e')](_0x064d('0x1f'),_0x5b1ea7+'-'+_0x2863f9+'/'+_0x30162e)[_0x064d('0x19')](_0x4786d0);}return null;};}function patchUpdates(_0x21bc88){return function(_0x408ce2){try{jsonpatch['apply'](_0x408ce2,_0x21bc88,!![]);}catch(_0x85a68c){return BPromise['reject'](_0x85a68c);}return _0x408ce2[_0x064d('0x20')]();};}function saveUpdates(_0x22313f,_0x4609c0){return function(_0x1fd881){if(_0x1fd881){return _0x1fd881['update'](_0x22313f)['then'](function(_0x20d2ab){return _0x20d2ab;});}return null;};}function removeEntity(_0x9cf273,_0x325650){return function(_0x40d5db){if(_0x40d5db){return _0x40d5db[_0x064d('0x21')]()[_0x064d('0x22')](function(){_0x9cf273[_0x064d('0x17')](0xcc)[_0x064d('0x18')]();});}};}function handleEntityNotFound(_0x189b54,_0x138385){return function(_0x3a7278){if(!_0x3a7278){_0x189b54['sendStatus'](0x194);}return _0x3a7278;};}function handleError(_0x4609dc,_0x3e480d){_0x3e480d=_0x3e480d||0x1f4;return function(_0x3dddc4){logger[_0x064d('0x23')](_0x3dddc4['stack']);if(_0x3dddc4[_0x064d('0x24')]){delete _0x3dddc4[_0x064d('0x24')];}_0x4609dc['status'](_0x3e480d)[_0x064d('0x25')](_0x3dddc4);};}exports['index']=function(_0xe45a88,_0x51d9bf){var _0x191e7a={},_0x281f2c={},_0x26e4ea={'count':0x0,'rows':[]};var _0x1f59d4=_[_0x064d('0x26')](db[_0x064d('0x27')][_0x064d('0x28')],function(_0x4febff){return{'name':_0x4febff['fieldName'],'type':_0x4febff[_0x064d('0x29')]['key']};});_0x281f2c['model']=_[_0x064d('0x26')](_0x1f59d4,_0x064d('0x24'));_0x281f2c['query']=_[_0x064d('0x2a')](_0xe45a88[_0x064d('0x2b')]);_0x281f2c[_0x064d('0x2c')]=_[_0x064d('0x2d')](_0x281f2c['model'],_0x281f2c[_0x064d('0x2b')]);_0x191e7a[_0x064d('0x2e')]=_[_0x064d('0x2d')](_0x281f2c[_0x064d('0x2f')],qs[_0x064d('0x30')](_0xe45a88[_0x064d('0x2b')]['fields']));_0x191e7a[_0x064d('0x2e')]=_0x191e7a[_0x064d('0x2e')][_0x064d('0x31')]?_0x191e7a[_0x064d('0x2e')]:_0x281f2c[_0x064d('0x2f')];if(!_0xe45a88[_0x064d('0x2b')][_0x064d('0x32')](_0x064d('0x33'))){_0x191e7a[_0x064d('0x1b')]=qs[_0x064d('0x1b')](_0xe45a88[_0x064d('0x2b')][_0x064d('0x1b')]);_0x191e7a['offset']=qs[_0x064d('0x1a')](_0xe45a88[_0x064d('0x2b')][_0x064d('0x1a')]);}_0x191e7a['order']=qs[_0x064d('0x34')](_0xe45a88['query'][_0x064d('0x34')]);_0x191e7a[_0x064d('0x35')]=qs[_0x064d('0x2c')](_[_0x064d('0x36')](_0xe45a88[_0x064d('0x2b')],_0x281f2c[_0x064d('0x2c')]),_0x1f59d4);if(_0xe45a88[_0x064d('0x2b')][_0x064d('0x37')]){_0x191e7a[_0x064d('0x35')]=_['merge'](_0x191e7a[_0x064d('0x35')],{'$or':_[_0x064d('0x26')](_0x1f59d4,function(_0x51e693){if(_0x51e693['type']!=='VIRTUAL'){var _0x2c1a0a={};_0x2c1a0a[_0x51e693[_0x064d('0x24')]]={'$like':'%'+_0xe45a88[_0x064d('0x2b')]['filter']+'%'};return _0x2c1a0a;}})});}_0x191e7a=_[_0x064d('0x38')]({},_0x191e7a,_0xe45a88[_0x064d('0x39')]);var _0x58336b={'where':_0x191e7a[_0x064d('0x35')]};return db[_0x064d('0x27')]['count'](_0x58336b)[_0x064d('0x22')](function(_0x514481){_0x26e4ea[_0x064d('0x1d')]=_0x514481;if(_0xe45a88[_0x064d('0x2b')]['includeAll']){_0x191e7a['include']=[{'all':!![]}];}return db['SquareRecording'][_0x064d('0x3a')](_0x191e7a);})['then'](function(_0x574256){_0x26e4ea['rows']=_0x574256;return _0x26e4ea;})['then'](respondWithFilteredResult(_0x51d9bf,_0x191e7a))[_0x064d('0x3b')](handleError(_0x51d9bf,null));};exports[_0x064d('0x3c')]=function(_0x496a34,_0x23f3fc){var _0x3d28b9={'raw':!![],'where':{'id':_0x496a34['params']['id']}},_0x1844ce={};_0x1844ce[_0x064d('0x2f')]=_[_0x064d('0x2a')](db['SquareRecording'][_0x064d('0x28')]);_0x1844ce[_0x064d('0x2b')]=_[_0x064d('0x2a')](_0x496a34[_0x064d('0x2b')]);_0x1844ce[_0x064d('0x2c')]=_[_0x064d('0x2d')](_0x1844ce['model'],_0x1844ce[_0x064d('0x2b')]);_0x3d28b9['attributes']=_[_0x064d('0x2d')](_0x1844ce[_0x064d('0x2f')],qs['fields'](_0x496a34[_0x064d('0x2b')][_0x064d('0x30')]));_0x3d28b9[_0x064d('0x2e')]=_0x3d28b9[_0x064d('0x2e')][_0x064d('0x31')]?_0x3d28b9['attributes']:_0x1844ce['model'];if(_0x496a34[_0x064d('0x2b')]['includeAll']){_0x3d28b9[_0x064d('0x3d')]=[{'all':!![]}];}_0x3d28b9=_['merge']({},_0x3d28b9,_0x496a34['options']);return db[_0x064d('0x27')][_0x064d('0x3e')](_0x3d28b9)[_0x064d('0x22')](handleEntityNotFound(_0x23f3fc,null))[_0x064d('0x22')](respondWithResult(_0x23f3fc,null))[_0x064d('0x3b')](handleError(_0x23f3fc,null));};exports[_0x064d('0x3f')]=function(_0x65f36,_0x441bdb){return db[_0x064d('0x27')]['create'](_0x65f36[_0x064d('0x40')],{})['then'](respondWithResult(_0x441bdb,0xc9))[_0x064d('0x3b')](handleError(_0x441bdb,null));};exports[_0x064d('0x41')]=function(_0x3b3e81,_0x385199){if(_0x3b3e81[_0x064d('0x40')]['id']){delete _0x3b3e81[_0x064d('0x40')]['id'];}return db['SquareRecording'][_0x064d('0x3e')]({'where':{'id':_0x3b3e81[_0x064d('0x42')]['id']}})[_0x064d('0x22')](handleEntityNotFound(_0x385199,null))['then'](saveUpdates(_0x3b3e81[_0x064d('0x40')],null))[_0x064d('0x22')](respondWithResult(_0x385199,null))[_0x064d('0x3b')](handleError(_0x385199,null));};exports[_0x064d('0x43')]=function(_0x46fb42,_0x3154a1,_0x464192){var _0x15a3db=require('../../components/encryptor');var _0x68d7a5=![];var _0x1e080e={};if(_0x46fb42[_0x064d('0x2b')][_0x064d('0x29')]&&_0x46fb42['query']['type']===_0x064d('0x44')){_0x1e080e[_0x064d('0x44')]=_0x46fb42['params']['id'];}else{_0x1e080e['id']=_0x46fb42[_0x064d('0x42')]['id'];}return db[_0x064d('0x27')][_0x064d('0x3e')]({'where':_0x1e080e,'attributes':['id','savePath',_0x064d('0x45')],'raw':!![]})[_0x064d('0x22')](handleEntityNotFound(_0x3154a1,null))[_0x064d('0x22')](function(_0x29e858){if(_0x29e858){var _0xfe0a5b=_0x29e858[_0x064d('0x46')];var _0x4c2643=util[_0x064d('0x47')](_0x064d('0x48'),_0xfe0a5b);if(fs[_0x064d('0x49')](_0x4c2643)){_0x68d7a5=!![];return _0x15a3db[_0x064d('0x4a')](_0x4c2643,_0xfe0a5b,config['secrets'][_0x064d('0x4b')])[_0x064d('0x22')](function(){return _0x29e858;});}return _0x29e858;}})['then'](function(_0x2cac45){if(_0x2cac45){var _0x4e79d1=_0x2cac45[_0x064d('0x46')];if(!fs[_0x064d('0x49')](_0x4e79d1)){throw new db['Sequelize'][(_0x064d('0x4c'))](_0x064d('0x4d'));}if(_0x2cac45[_0x064d('0x45')]){return _0x3154a1[_0x064d('0x43')](_0x4e79d1,_0x2cac45[_0x064d('0x45')]+path[_0x064d('0x4e')](_0x4e79d1),function(){if(_0x68d7a5){fs[_0x064d('0x4f')](_0x4e79d1);}});}else{return _0x3154a1['download'](_0x4e79d1,function(_0xcb2639){if(_0x68d7a5){fs['unlink'](_0x4e79d1);}});}}})[_0x064d('0x3b')](function(_0x164cc7){if(_0x164cc7['message']===_0x064d('0x4d')){_0x3154a1[_0x064d('0x17')](0x194)['send'](_0x064d('0x50'));}else{return handleError(_0x3154a1,null);}});};exports['destroy']=function(_0x1b6374,_0x251c93){return db['SquareRecording'][_0x064d('0x3e')]({'where':{'id':_0x1b6374[_0x064d('0x42')]['id']}})[_0x064d('0x22')](function(_0x5d7ec2){if(_['isNil'](_0x5d7ec2)){throw new ReferenceError(_0x064d('0x51'));}return _0x5d7ec2;})[_0x064d('0x22')](function(_0x4196dd){var _0x4e116b=_0x4196dd['savePath'];logger['info'](_0x064d('0x52'),_0x4e116b);if(!_[_0x064d('0x53')](_0x4196dd[_0x064d('0x46')])&&fs[_0x064d('0x49')](_0x4e116b)){logger[_0x064d('0x54')](_0x064d('0x55')+_0x4e116b+_0x064d('0x56'));fs[_0x064d('0x57')](_0x4e116b);}_0x4e116b=_0x4e116b+'.cypher';if(!_[_0x064d('0x53')](_0x4196dd[_0x064d('0x46')])&&fs[_0x064d('0x49')](_0x4e116b)){logger['info']('File:\x20\x22'+_0x4e116b+_0x064d('0x56'));fs['unlinkSync'](_0x4e116b);}return _0x4196dd;})['then'](function(_0x14a1bc){if(!_0x14a1bc)throw new InternalError();return _0x14a1bc['destroy']();})[_0x064d('0x22')](function(){_0x251c93[_0x064d('0x17')](0xcc)['end']();})['catch'](handleError(_0x251c93,null));}; \ No newline at end of file +var _0x341c=['savePath','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','SquareRecording','fieldName','key','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','count','include','findAll','rows','show','params','model','rawAttributes','options','catch','create','body','find','download','../../components/encryptor','uniqueid','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s'];(function(_0x1c3629,_0x1339f7){var _0x16374b=function(_0x11e498){while(--_0x11e498){_0x1c3629['push'](_0x1c3629['shift']());}};_0x16374b(++_0x1339f7);}(_0x341c,0x122));var _0xc341=function(_0x21ed1f,_0xabbc54){_0x21ed1f=_0x21ed1f-0x0;var _0x2d8da9=_0x341c[_0x21ed1f];return _0x2d8da9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc341('0x0'));var zipdir=require(_0xc341('0x1'));var jsonpatch=require(_0xc341('0x2'));var rp=require(_0xc341('0x3'));var moment=require('moment');var BPromise=require(_0xc341('0x4'));var Mustache=require('mustache');var util=require(_0xc341('0x5'));var path=require('path');var sox=require(_0xc341('0x6'));var csv=require(_0xc341('0x7'));var ejs=require(_0xc341('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc341('0x9'));var deskjs=require(_0xc341('0xa'));var toCsv=require(_0xc341('0x7'));var querystring=require(_0xc341('0xb'));var Papa=require(_0xc341('0xc'));var Redis=require(_0xc341('0xd'));var authService=require(_0xc341('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc341('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc341('0x10'))(_0xc341('0x11'));var utils=require(_0xc341('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc341('0x13'));var db=require(_0xc341('0x14'))['db'];function respondWithStatusCode(_0x470934,_0x139928){_0x139928=_0x139928||0xcc;return function(_0x3f5891){if(_0x3f5891){return _0x470934['sendStatus'](_0x139928);}return _0x470934[_0xc341('0x15')](_0x139928)['end']();};}function respondWithResult(_0x4b8a61,_0x99470e){_0x99470e=_0x99470e||0xc8;return function(_0x521986){if(_0x521986){return _0x4b8a61[_0xc341('0x15')](_0x99470e)[_0xc341('0x16')](_0x521986);}};}function respondWithFilteredResult(_0x5dc614,_0x1eec4c){return function(_0x511054){if(_0x511054){var _0x2d5592=typeof _0x1eec4c[_0xc341('0x17')]===_0xc341('0x18')&&typeof _0x1eec4c[_0xc341('0x19')]==='undefined';var _0x5aad1f=_0x511054['count'];var _0x460c35=_0x2d5592?0x0:_0x1eec4c[_0xc341('0x17')];var _0x1063a3=_0x2d5592?_0x511054['count']:_0x1eec4c[_0xc341('0x17')]+_0x1eec4c[_0xc341('0x19')];var _0x5a6c41;if(_0x1063a3>=_0x5aad1f){_0x1063a3=_0x5aad1f;_0x5a6c41=0xc8;}else{_0x5a6c41=0xce;}_0x5dc614[_0xc341('0x15')](_0x5a6c41);return _0x5dc614[_0xc341('0x1a')](_0xc341('0x1b'),_0x460c35+'-'+_0x1063a3+'/'+_0x5aad1f)[_0xc341('0x16')](_0x511054);}return null;};}function patchUpdates(_0x3523ef){return function(_0x387998){try{jsonpatch[_0xc341('0x1c')](_0x387998,_0x3523ef,!![]);}catch(_0x1dea37){return BPromise['reject'](_0x1dea37);}return _0x387998[_0xc341('0x1d')]();};}function saveUpdates(_0x54dc15,_0x2f0cb7){return function(_0x267d2b){if(_0x267d2b){return _0x267d2b[_0xc341('0x1e')](_0x54dc15)[_0xc341('0x1f')](function(_0x58589e){return _0x58589e;});}return null;};}function removeEntity(_0x32eb3a,_0x484ec2){return function(_0x5e7e9b){if(_0x5e7e9b){return _0x5e7e9b[_0xc341('0x20')]()[_0xc341('0x1f')](function(){_0x32eb3a[_0xc341('0x15')](0xcc)[_0xc341('0x21')]();});}};}function handleEntityNotFound(_0x239ea4,_0x3b03f0){return function(_0xf54c00){if(!_0xf54c00){_0x239ea4[_0xc341('0x22')](0x194);}return _0xf54c00;};}function handleError(_0x106d6d,_0xfe7a67){_0xfe7a67=_0xfe7a67||0x1f4;return function(_0x317f52){logger[_0xc341('0x23')](_0x317f52[_0xc341('0x24')]);if(_0x317f52[_0xc341('0x25')]){delete _0x317f52[_0xc341('0x25')];}_0x106d6d[_0xc341('0x15')](_0xfe7a67)[_0xc341('0x26')](_0x317f52);};}exports[_0xc341('0x27')]=function(_0x4c66e1,_0xf7c03d){var _0x4b0233={},_0x391d3d={},_0x1cbd62={'count':0x0,'rows':[]};var _0x550bbb=_[_0xc341('0x28')](db[_0xc341('0x29')]['rawAttributes'],function(_0x145a08){return{'name':_0x145a08[_0xc341('0x2a')],'type':_0x145a08['type'][_0xc341('0x2b')]};});_0x391d3d['model']=_[_0xc341('0x28')](_0x550bbb,_0xc341('0x25'));_0x391d3d['query']=_['keys'](_0x4c66e1[_0xc341('0x2c')]);_0x391d3d[_0xc341('0x2d')]=_[_0xc341('0x2e')](_0x391d3d['model'],_0x391d3d[_0xc341('0x2c')]);_0x4b0233[_0xc341('0x2f')]=_[_0xc341('0x2e')](_0x391d3d['model'],qs[_0xc341('0x30')](_0x4c66e1[_0xc341('0x2c')][_0xc341('0x30')]));_0x4b0233['attributes']=_0x4b0233[_0xc341('0x2f')][_0xc341('0x31')]?_0x4b0233[_0xc341('0x2f')]:_0x391d3d['model'];if(!_0x4c66e1[_0xc341('0x2c')][_0xc341('0x32')](_0xc341('0x33'))){_0x4b0233[_0xc341('0x19')]=qs['limit'](_0x4c66e1[_0xc341('0x2c')][_0xc341('0x19')]);_0x4b0233[_0xc341('0x17')]=qs['offset'](_0x4c66e1[_0xc341('0x2c')][_0xc341('0x17')]);}_0x4b0233[_0xc341('0x34')]=qs[_0xc341('0x35')](_0x4c66e1['query'][_0xc341('0x35')]);_0x4b0233['where']=qs[_0xc341('0x2d')](_['pick'](_0x4c66e1[_0xc341('0x2c')],_0x391d3d[_0xc341('0x2d')]),_0x550bbb);if(_0x4c66e1[_0xc341('0x2c')][_0xc341('0x36')]){_0x4b0233[_0xc341('0x37')]=_[_0xc341('0x38')](_0x4b0233[_0xc341('0x37')],{'$or':_[_0xc341('0x28')](_0x550bbb,function(_0x183222){if(_0x183222[_0xc341('0x39')]!==_0xc341('0x3a')){var _0x2c200f={};_0x2c200f[_0x183222[_0xc341('0x25')]]={'$like':'%'+_0x4c66e1[_0xc341('0x2c')][_0xc341('0x36')]+'%'};return _0x2c200f;}})});}_0x4b0233=_[_0xc341('0x38')]({},_0x4b0233,_0x4c66e1['options']);var _0x1d5287={'where':_0x4b0233[_0xc341('0x37')]};return db[_0xc341('0x29')][_0xc341('0x3b')](_0x1d5287)[_0xc341('0x1f')](function(_0x2e3d3a){_0x1cbd62['count']=_0x2e3d3a;if(_0x4c66e1['query']['includeAll']){_0x4b0233[_0xc341('0x3c')]=[{'all':!![]}];}return db[_0xc341('0x29')][_0xc341('0x3d')](_0x4b0233);})['then'](function(_0x546d1a){_0x1cbd62[_0xc341('0x3e')]=_0x546d1a;return _0x1cbd62;})[_0xc341('0x1f')](respondWithFilteredResult(_0xf7c03d,_0x4b0233))['catch'](handleError(_0xf7c03d,null));};exports[_0xc341('0x3f')]=function(_0x4511a8,_0x440edd){var _0x3a114e={'raw':!![],'where':{'id':_0x4511a8[_0xc341('0x40')]['id']}},_0x367111={};_0x367111[_0xc341('0x41')]=_['keys'](db[_0xc341('0x29')][_0xc341('0x42')]);_0x367111['query']=_['keys'](_0x4511a8[_0xc341('0x2c')]);_0x367111[_0xc341('0x2d')]=_[_0xc341('0x2e')](_0x367111[_0xc341('0x41')],_0x367111[_0xc341('0x2c')]);_0x3a114e[_0xc341('0x2f')]=_[_0xc341('0x2e')](_0x367111[_0xc341('0x41')],qs[_0xc341('0x30')](_0x4511a8['query']['fields']));_0x3a114e[_0xc341('0x2f')]=_0x3a114e[_0xc341('0x2f')][_0xc341('0x31')]?_0x3a114e[_0xc341('0x2f')]:_0x367111[_0xc341('0x41')];if(_0x4511a8[_0xc341('0x2c')]['includeAll']){_0x3a114e['include']=[{'all':!![]}];}_0x3a114e=_['merge']({},_0x3a114e,_0x4511a8[_0xc341('0x43')]);return db[_0xc341('0x29')]['find'](_0x3a114e)['then'](handleEntityNotFound(_0x440edd,null))[_0xc341('0x1f')](respondWithResult(_0x440edd,null))[_0xc341('0x44')](handleError(_0x440edd,null));};exports[_0xc341('0x45')]=function(_0x369f02,_0x124da7){return db[_0xc341('0x29')]['create'](_0x369f02[_0xc341('0x46')],{})[_0xc341('0x1f')](respondWithResult(_0x124da7,0xc9))['catch'](handleError(_0x124da7,null));};exports['update']=function(_0x986985,_0x1f1065){if(_0x986985[_0xc341('0x46')]['id']){delete _0x986985[_0xc341('0x46')]['id'];}return db[_0xc341('0x29')][_0xc341('0x47')]({'where':{'id':_0x986985[_0xc341('0x40')]['id']}})['then'](handleEntityNotFound(_0x1f1065,null))[_0xc341('0x1f')](saveUpdates(_0x986985['body'],null))['then'](respondWithResult(_0x1f1065,null))[_0xc341('0x44')](handleError(_0x1f1065,null));};exports[_0xc341('0x48')]=function(_0x45133e,_0xb6e812,_0x18d7b1){var _0x48f9c1=require(_0xc341('0x49'));var _0x4800fc=![];var _0x2da7ce={};if(_0x45133e[_0xc341('0x2c')]['type']&&_0x45133e['query'][_0xc341('0x39')]===_0xc341('0x4a')){_0x2da7ce[_0xc341('0x4a')]=_0x45133e['params']['id'];}else{_0x2da7ce['id']=_0x45133e[_0xc341('0x40')]['id'];}return db[_0xc341('0x29')][_0xc341('0x47')]({'where':_0x2da7ce,'attributes':['id','savePath','filename'],'raw':!![]})[_0xc341('0x1f')](handleEntityNotFound(_0xb6e812,null))[_0xc341('0x1f')](function(_0x2ccb2f){if(_0x2ccb2f){var _0x25ddbf=_0x2ccb2f['savePath'];var _0x434ade=util[_0xc341('0x4b')](_0xc341('0x4c'),_0x25ddbf);if(fs[_0xc341('0x4d')](_0x434ade)){_0x4800fc=!![];return _0x48f9c1[_0xc341('0x4e')](_0x434ade,_0x25ddbf,config['secrets'][_0xc341('0x4f')])['then'](function(){return _0x2ccb2f;});}return _0x2ccb2f;}})[_0xc341('0x1f')](function(_0x43e6da){if(_0x43e6da){var _0x1ad32d=_0x43e6da['savePath'];if(!fs['existsSync'](_0x1ad32d)){throw new db[(_0xc341('0x50'))]['ValidationError'](_0xc341('0x51'));}if(_0x43e6da[_0xc341('0x52')]){return _0xb6e812[_0xc341('0x48')](_0x1ad32d,_0x43e6da[_0xc341('0x52')]+path[_0xc341('0x53')](_0x1ad32d),function(){if(_0x4800fc){fs[_0xc341('0x54')](_0x1ad32d);}});}else{return _0xb6e812['download'](_0x1ad32d,function(_0x4f8c17){if(_0x4800fc){fs[_0xc341('0x54')](_0x1ad32d);}});}}})['catch'](function(_0x2da1b0){if(_0x2da1b0[_0xc341('0x55')]===_0xc341('0x51')){_0xb6e812[_0xc341('0x15')](0x194)['send'](_0xc341('0x56'));}else{return handleError(_0xb6e812,null);}});};exports[_0xc341('0x20')]=function(_0x5eea6a,_0x3a6ac5){return db['SquareRecording']['find']({'where':{'id':_0x5eea6a[_0xc341('0x40')]['id']}})[_0xc341('0x1f')](function(_0x291028){if(_[_0xc341('0x57')](_0x291028)){throw new ReferenceError('Entity\x20not\x20found');}return _0x291028;})[_0xc341('0x1f')](function(_0x4db3e7){var _0x2814f7=_0x4db3e7['savePath'];logger[_0xc341('0x58')](_0xc341('0x59'),_0x2814f7);if(!_[_0xc341('0x57')](_0x4db3e7[_0xc341('0x5a')])&&fs[_0xc341('0x4d')](_0x2814f7)){logger[_0xc341('0x58')]('File:\x20\x22'+_0x2814f7+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc341('0x5b')](_0x2814f7);}_0x2814f7=_0x2814f7+_0xc341('0x5c');if(!_[_0xc341('0x57')](_0x4db3e7['savePath'])&&fs['existsSync'](_0x2814f7)){logger[_0xc341('0x58')](_0xc341('0x5d')+_0x2814f7+_0xc341('0x5e'));fs[_0xc341('0x5b')](_0x2814f7);}return _0x4db3e7;})['then'](function(_0xcc9991){if(!_0xcc9991)throw new InternalError();return _0xcc9991[_0xc341('0x20')]();})[_0xc341('0x1f')](function(){_0x3a6ac5[_0xc341('0x15')](0xcc)[_0xc341('0x21')]();})[_0xc341('0x44')](handleError(_0x3a6ac5,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 40bd964..9b3954e 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 _0xc2a2=['./squareRecording.attributes','exports','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x5adfa9,_0x4b835d){var _0x458f41=function(_0x504e46){while(--_0x504e46){_0x5adfa9['push'](_0x5adfa9['shift']());}};_0x458f41(++_0x4b835d);}(_0xc2a2,0x84));var _0x2c2a=function(_0x20c678,_0x299058){_0x20c678=_0x20c678-0x0;var _0x38c3e3=_0xc2a2[_0x20c678];return _0x38c3e3;};'use strict';var _=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var logger=require(_0x2c2a('0x2'))(_0x2c2a('0x3'));var moment=require('moment');var BPromise=require(_0x2c2a('0x4'));var rp=require(_0x2c2a('0x5'));var fs=require('fs');var path=require(_0x2c2a('0x6'));var rimraf=require('rimraf');var config=require(_0x2c2a('0x7'));var attributes=require(_0x2c2a('0x8'));module[_0x2c2a('0x9')]=function(_0x17db27,_0x51c919){return _0x17db27['define']('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6ce=['lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./squareRecording.attributes','exports','define','square_recordings'];(function(_0x4487fb,_0x2adb19){var _0x49925a=function(_0xa2871b){while(--_0xa2871b){_0x4487fb['push'](_0x4487fb['shift']());}};_0x49925a(++_0x2adb19);}(_0xa6ce,0x15e));var _0xea6c=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0xa6ce[_0x1f71d8];return _0x10b045;};'use strict';var _=require(_0xea6c('0x0'));var util=require('util');var logger=require(_0xea6c('0x1'))(_0xea6c('0x2'));var moment=require('moment');var BPromise=require(_0xea6c('0x3'));var rp=require(_0xea6c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xea6c('0x5'));var attributes=require(_0xea6c('0x6'));module[_0xea6c('0x7')]=function(_0x236ed9,_0x267f26){return _0x236ed9[_0xea6c('0x8')]('SquareRecording',attributes,{'tableName':_0xea6c('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 bc52b6e..672984f 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 _0x4070=['options','CreateSquareRecording','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','create','body'];(function(_0x11cfe7,_0x468d25){var _0x2544f3=function(_0x541baa){while(--_0x541baa){_0x11cfe7['push'](_0x11cfe7['shift']());}};_0x2544f3(++_0x468d25);}(_0x4070,0x12b));var _0x0407=function(_0x3071ab,_0x574a59){_0x3071ab=_0x3071ab-0x0;var _0x2f458c=_0x4070[_0x3071ab];return _0x2f458c;};'use strict';var _=require(_0x0407('0x0'));var util=require('util');var moment=require(_0x0407('0x1'));var BPromise=require(_0x0407('0x2'));var rs=require(_0x0407('0x3'));var fs=require('fs');var Redis=require(_0x0407('0x4'));var db=require(_0x0407('0x5'))['db'];var utils=require(_0x0407('0x6'));var logger=require(_0x0407('0x7'))(_0x0407('0x8'));var config=require('../../config/environment');var jayson=require(_0x0407('0x9'));var client=jayson['client'][_0x0407('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x474beb,_0x1b72a8,_0x4e4789){return new BPromise(function(_0x499517,_0x3ebcd9){return client[_0x0407('0xb')](_0x474beb,_0x4e4789)[_0x0407('0xc')](function(_0xf69df0){logger[_0x0407('0xd')](_0x0407('0xe'),_0x1b72a8,'request\x20sent');logger[_0x0407('0xf')](_0x0407('0x10'),_0x1b72a8,_0x0407('0x11'),JSON[_0x0407('0x12')](_0xf69df0));if(_0xf69df0[_0x0407('0x13')]){if(_0xf69df0[_0x0407('0x13')]['code']===0x1f4){logger['error'](_0x0407('0xe'),_0x1b72a8,_0xf69df0[_0x0407('0x13')][_0x0407('0x14')]);return _0x3ebcd9(_0xf69df0['error']['message']);}logger[_0x0407('0x13')]('SquareRecording,\x20%s,\x20%s',_0x1b72a8,_0xf69df0[_0x0407('0x13')][_0x0407('0x14')]);return _0x499517(_0xf69df0[_0x0407('0x13')][_0x0407('0x14')]);}else{logger[_0x0407('0xd')](_0x0407('0xe'),_0x1b72a8,_0x0407('0x11'));_0x499517(_0xf69df0[_0x0407('0x15')][_0x0407('0x14')]);}})[_0x0407('0x16')](function(_0x50212b){logger[_0x0407('0x13')](_0x0407('0xe'),_0x1b72a8,_0x50212b);_0x3ebcd9(_0x50212b);});});}exports['CreateSquareRecording']=function(_0x290e43){var _0x5dd399=this;return new Promise(function(_0x545eb2,_0x3be009){return db['SquareRecording'][_0x0407('0x17')](_0x290e43[_0x0407('0x18')],{'raw':_0x290e43[_0x0407('0x19')]?_0x290e43[_0x0407('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x0407('0xc')](function(_0x16076e){logger[_0x0407('0xd')](_0x0407('0x1a'),_0x290e43);logger[_0x0407('0xf')](_0x0407('0x1a'),_0x290e43,JSON[_0x0407('0x12')](_0x16076e));_0x545eb2(_0x16076e);})[_0x0407('0x16')](function(_0xbb5476){logger[_0x0407('0x13')](_0x0407('0x1a'),_0xbb5476[_0x0407('0x14')],_0x290e43);_0x3be009(_0x5dd399[_0x0407('0x13')](0x1f4,_0xbb5476[_0x0407('0x14')]));});});}; \ No newline at end of file +var _0xe926=['error','code','message','CreateSquareRecording','body','options','raw','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1c9cfb,_0x4efc3b){var _0x32436a=function(_0x6836da){while(--_0x6836da){_0x1c9cfb['push'](_0x1c9cfb['shift']());}};_0x32436a(++_0x4efc3b);}(_0xe926,0x132));var _0x6e92=function(_0x151418,_0x2cbffa){_0x151418=_0x151418-0x0;var _0x40e29a=_0xe926[_0x151418];return _0x40e29a;};'use strict';var _=require('lodash');var util=require(_0x6e92('0x0'));var moment=require('moment');var BPromise=require(_0x6e92('0x1'));var rs=require(_0x6e92('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6e92('0x3'));var logger=require(_0x6e92('0x4'))(_0x6e92('0x5'));var config=require(_0x6e92('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6e92('0x7')][_0x6e92('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a087d,_0x2684d4,_0x519c59){return new BPromise(function(_0x5b5310,_0x2b149d){return client['request'](_0x1a087d,_0x519c59)[_0x6e92('0x9')](function(_0x24f80c){logger[_0x6e92('0xa')](_0x6e92('0xb'),_0x2684d4,_0x6e92('0xc'));logger[_0x6e92('0xd')](_0x6e92('0xe'),_0x2684d4,_0x6e92('0xc'),JSON[_0x6e92('0xf')](_0x24f80c));if(_0x24f80c['error']){if(_0x24f80c[_0x6e92('0x10')][_0x6e92('0x11')]===0x1f4){logger[_0x6e92('0x10')]('SquareRecording,\x20%s,\x20%s',_0x2684d4,_0x24f80c[_0x6e92('0x10')][_0x6e92('0x12')]);return _0x2b149d(_0x24f80c[_0x6e92('0x10')]['message']);}logger[_0x6e92('0x10')](_0x6e92('0xb'),_0x2684d4,_0x24f80c[_0x6e92('0x10')]['message']);return _0x5b5310(_0x24f80c[_0x6e92('0x10')]['message']);}else{logger[_0x6e92('0xa')](_0x6e92('0xb'),_0x2684d4,_0x6e92('0xc'));_0x5b5310(_0x24f80c['result'][_0x6e92('0x12')]);}})['catch'](function(_0x11f956){logger[_0x6e92('0x10')](_0x6e92('0xb'),_0x2684d4,_0x11f956);_0x2b149d(_0x11f956);});});}exports[_0x6e92('0x13')]=function(_0x13635a){var _0x13b765=this;return new Promise(function(_0x27d1de,_0xa3c965){return db['SquareRecording']['create'](_0x13635a[_0x6e92('0x14')],{'raw':_0x13635a[_0x6e92('0x15')]?_0x13635a[_0x6e92('0x15')][_0x6e92('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x4745ff){logger['info'](_0x6e92('0x13'),_0x13635a);logger['debug'](_0x6e92('0x13'),_0x13635a,JSON['stringify'](_0x4745ff));_0x27d1de(_0x4745ff);})['catch'](function(_0x7d30ad){logger[_0x6e92('0x10')](_0x6e92('0x13'),_0x7d30ad[_0x6e92('0x12')],_0x13635a);_0xa3c965(_0x13b765['error'](0x1f4,_0x7d30ad['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 60573f6..11e6e5e 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(_0x3be0c4,_0x5b7eff){var _0x11af9f=function(_0x3f5113){while(--_0x3f5113){_0x3be0c4['push'](_0x3be0c4['shift']());}};_0x11af9f(++_0x5b7eff);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 8bf06df..7a93bad 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 _0xd73b=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd73b,0x183));var _0xbd73=function(_0x4db97b,_0x94af02){_0x4db97b=_0x4db97b-0x0;var _0x260571=_0xd73b[_0x4db97b];return _0x260571;};'use strict';var Sequelize=require(_0xbd73('0x0'));module[_0xbd73('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xbd73('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xbd73('0x2')]},'type':{'type':Sequelize[_0xbd73('0x2')]},'uniqueid':{'type':Sequelize[_0xbd73('0x2')]},'version':{'type':Sequelize[_0xbd73('0x2')]},'callerid':{'type':Sequelize[_0xbd73('0x2')]},'calleridname':{'type':Sequelize[_0xbd73('0x2')]},'callingpres':{'type':Sequelize[_0xbd73('0x2')]},'callingani2':{'type':Sequelize[_0xbd73('0x2')]},'callington':{'type':Sequelize[_0xbd73('0x2')]},'callingtns':{'type':Sequelize[_0xbd73('0x2')]},'dnid':{'type':Sequelize[_0xbd73('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xbd73('0x2')]},'extension':{'type':Sequelize[_0xbd73('0x2')]},'priority':{'type':Sequelize[_0xbd73('0x2')]},'enhanced':{'type':Sequelize[_0xbd73('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xbd73('0x3')]},'leaveAt':{'type':Sequelize[_0xbd73('0x3')]},'bot':{'type':Sequelize[_0xbd73('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x5ca1=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x3dadbe,_0x2b58d7){var _0x44f961=function(_0x10d652){while(--_0x10d652){_0x3dadbe['push'](_0x3dadbe['shift']());}};_0x44f961(++_0x2b58d7);}(_0x5ca1,0x85));var _0x15ca=function(_0x348853,_0x5d3572){_0x348853=_0x348853-0x0;var _0x2cfbf5=_0x5ca1[_0x348853];return _0x2cfbf5;};'use strict';var Sequelize=require(_0x15ca('0x0'));module[_0x15ca('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x15ca('0x2')]},'language':{'type':Sequelize[_0x15ca('0x2')]},'type':{'type':Sequelize[_0x15ca('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x15ca('0x2')]},'callerid':{'type':Sequelize[_0x15ca('0x2')]},'calleridname':{'type':Sequelize[_0x15ca('0x2')]},'callingpres':{'type':Sequelize[_0x15ca('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x15ca('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x15ca('0x2')]},'extension':{'type':Sequelize[_0x15ca('0x2')]},'priority':{'type':Sequelize[_0x15ca('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x15ca('0x2')]},'threadid':{'type':Sequelize[_0x15ca('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x15ca('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x15ca('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 ced8e20..3fd75b2 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 _0x2a8c=['create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','SquareReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','include','options','find'];(function(_0x22bbc9,_0x34363b){var _0x56f1f7=function(_0x2e2842){while(--_0x2e2842){_0x22bbc9['push'](_0x22bbc9['shift']());}};_0x56f1f7(++_0x34363b);}(_0x2a8c,0xe5));var _0xc2a8=function(_0x5290a7,_0x14889d){_0x5290a7=_0x5290a7-0x0;var _0x38f5d0=_0x2a8c[_0x5290a7];return _0x38f5d0;};'use strict';var emlformat=require(_0xc2a8('0x0'));var rimraf=require(_0xc2a8('0x1'));var zipdir=require(_0xc2a8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc2a8('0x3'));var moment=require('moment');var BPromise=require(_0xc2a8('0x4'));var Mustache=require(_0xc2a8('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc2a8('0x6'));var ejs=require(_0xc2a8('0x7'));var fs=require('fs');var fs_extra=require(_0xc2a8('0x8'));var _=require(_0xc2a8('0x9'));var squel=require(_0xc2a8('0xa'));var crypto=require(_0xc2a8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc2a8('0xc'));var toCsv=require(_0xc2a8('0x6'));var querystring=require('querystring');var Papa=require(_0xc2a8('0xd'));var Redis=require(_0xc2a8('0xe'));var authService=require(_0xc2a8('0xf'));var qs=require(_0xc2a8('0x10'));var as=require(_0xc2a8('0x11'));var hardwareService=require(_0xc2a8('0x12'));var logger=require(_0xc2a8('0x13'))(_0xc2a8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc2a8('0x15'));var db=require(_0xc2a8('0x16'))['db'];function respondWithStatusCode(_0x4b4d11,_0x101152){_0x101152=_0x101152||0xcc;return function(_0x3200b1){if(_0x3200b1){return _0x4b4d11['sendStatus'](_0x101152);}return _0x4b4d11[_0xc2a8('0x17')](_0x101152)[_0xc2a8('0x18')]();};}function respondWithResult(_0x560b94,_0x1977b5){_0x1977b5=_0x1977b5||0xc8;return function(_0x101636){if(_0x101636){return _0x560b94[_0xc2a8('0x17')](_0x1977b5)[_0xc2a8('0x19')](_0x101636);}};}function respondWithFilteredResult(_0x2f424b,_0x3e946){return function(_0x2dd9fb){if(_0x2dd9fb){var _0x31b348=typeof _0x3e946[_0xc2a8('0x1a')]===_0xc2a8('0x1b')&&typeof _0x3e946['limit']===_0xc2a8('0x1b');var _0x2c60c9=_0x2dd9fb[_0xc2a8('0x1c')];var _0x1ac963=_0x31b348?0x0:_0x3e946[_0xc2a8('0x1a')];var _0x48a191=_0x31b348?_0x2dd9fb[_0xc2a8('0x1c')]:_0x3e946[_0xc2a8('0x1a')]+_0x3e946[_0xc2a8('0x1d')];var _0x25c5c4;if(_0x48a191>=_0x2c60c9){_0x48a191=_0x2c60c9;_0x25c5c4=0xc8;}else{_0x25c5c4=0xce;}_0x2f424b[_0xc2a8('0x17')](_0x25c5c4);return _0x2f424b[_0xc2a8('0x1e')](_0xc2a8('0x1f'),_0x1ac963+'-'+_0x48a191+'/'+_0x2c60c9)['json'](_0x2dd9fb);}return null;};}function patchUpdates(_0x4aca5b){return function(_0x1587f1){try{jsonpatch['apply'](_0x1587f1,_0x4aca5b,!![]);}catch(_0x396934){return BPromise[_0xc2a8('0x20')](_0x396934);}return _0x1587f1[_0xc2a8('0x21')]();};}function saveUpdates(_0x1e1ef2,_0x45ad4f){return function(_0x2c7d09){if(_0x2c7d09){return _0x2c7d09[_0xc2a8('0x22')](_0x1e1ef2)[_0xc2a8('0x23')](function(_0xe95030){return _0xe95030;});}return null;};}function removeEntity(_0x55d45b,_0x47d355){return function(_0x174644){if(_0x174644){return _0x174644[_0xc2a8('0x24')]()[_0xc2a8('0x23')](function(){_0x55d45b[_0xc2a8('0x17')](0xcc)[_0xc2a8('0x18')]();});}};}function handleEntityNotFound(_0x195e29,_0x494234){return function(_0xb6b557){if(!_0xb6b557){_0x195e29[_0xc2a8('0x25')](0x194);}return _0xb6b557;};}function handleError(_0x2305a1,_0x1d4aeb){_0x1d4aeb=_0x1d4aeb||0x1f4;return function(_0x562c17){logger[_0xc2a8('0x26')](_0x562c17[_0xc2a8('0x27')]);if(_0x562c17['name']){delete _0x562c17[_0xc2a8('0x28')];}_0x2305a1[_0xc2a8('0x17')](_0x1d4aeb)[_0xc2a8('0x29')](_0x562c17);};}exports[_0xc2a8('0x2a')]=function(_0x209e03,_0x43452d){var _0x2b4aba={},_0x567139={},_0x1988b8={'count':0x0,'rows':[]};var _0x107da2=_['map'](db[_0xc2a8('0x2b')][_0xc2a8('0x2c')],function(_0x47bdd2){return{'name':_0x47bdd2[_0xc2a8('0x2d')],'type':_0x47bdd2[_0xc2a8('0x2e')][_0xc2a8('0x2f')]};});_0x567139['model']=_[_0xc2a8('0x30')](_0x107da2,_0xc2a8('0x28'));_0x567139[_0xc2a8('0x31')]=_[_0xc2a8('0x32')](_0x209e03['query']);_0x567139[_0xc2a8('0x33')]=_[_0xc2a8('0x34')](_0x567139['model'],_0x567139['query']);_0x2b4aba['attributes']=_[_0xc2a8('0x34')](_0x567139[_0xc2a8('0x35')],qs[_0xc2a8('0x36')](_0x209e03['query']['fields']));_0x2b4aba['attributes']=_0x2b4aba[_0xc2a8('0x37')][_0xc2a8('0x38')]?_0x2b4aba[_0xc2a8('0x37')]:_0x567139[_0xc2a8('0x35')];if(!_0x209e03[_0xc2a8('0x31')]['hasOwnProperty'](_0xc2a8('0x39'))){_0x2b4aba[_0xc2a8('0x1d')]=qs['limit'](_0x209e03['query']['limit']);_0x2b4aba[_0xc2a8('0x1a')]=qs[_0xc2a8('0x1a')](_0x209e03[_0xc2a8('0x31')][_0xc2a8('0x1a')]);}_0x2b4aba['order']=qs[_0xc2a8('0x3a')](_0x209e03['query'][_0xc2a8('0x3a')]);_0x2b4aba[_0xc2a8('0x3b')]=qs[_0xc2a8('0x33')](_[_0xc2a8('0x3c')](_0x209e03[_0xc2a8('0x31')],_0x567139[_0xc2a8('0x33')]),_0x107da2);if(_0x209e03[_0xc2a8('0x31')][_0xc2a8('0x3d')]){_0x2b4aba[_0xc2a8('0x3b')]=_[_0xc2a8('0x3e')](_0x2b4aba[_0xc2a8('0x3b')],{'$or':_['map'](_0x107da2,function(_0x31fae5){if(_0x31fae5[_0xc2a8('0x2e')]!==_0xc2a8('0x3f')){var _0x3202b5={};_0x3202b5[_0x31fae5[_0xc2a8('0x28')]]={'$like':'%'+_0x209e03[_0xc2a8('0x31')][_0xc2a8('0x3d')]+'%'};return _0x3202b5;}})});}_0x2b4aba=_[_0xc2a8('0x3e')]({},_0x2b4aba,_0x209e03['options']);var _0x42cbf3={'where':_0x2b4aba[_0xc2a8('0x3b')]};return db[_0xc2a8('0x2b')][_0xc2a8('0x1c')](_0x42cbf3)[_0xc2a8('0x23')](function(_0x392e27){_0x1988b8['count']=_0x392e27;if(_0x209e03[_0xc2a8('0x31')][_0xc2a8('0x40')]){_0x2b4aba['include']=[{'all':!![]}];}return db[_0xc2a8('0x2b')][_0xc2a8('0x41')](_0x2b4aba);})[_0xc2a8('0x23')](function(_0x44fcd0){_0x1988b8[_0xc2a8('0x42')]=_0x44fcd0;return _0x1988b8;})[_0xc2a8('0x23')](respondWithFilteredResult(_0x43452d,_0x2b4aba))[_0xc2a8('0x43')](handleError(_0x43452d,null));};exports['show']=function(_0x41c5fe,_0x5339d2){var _0x156d9b={'raw':!![],'where':{'id':_0x41c5fe['params']['id']}},_0x331bd7={};_0x331bd7[_0xc2a8('0x35')]=_[_0xc2a8('0x32')](db[_0xc2a8('0x2b')][_0xc2a8('0x2c')]);_0x331bd7[_0xc2a8('0x31')]=_[_0xc2a8('0x32')](_0x41c5fe[_0xc2a8('0x31')]);_0x331bd7[_0xc2a8('0x33')]=_[_0xc2a8('0x34')](_0x331bd7[_0xc2a8('0x35')],_0x331bd7[_0xc2a8('0x31')]);_0x156d9b[_0xc2a8('0x37')]=_['intersection'](_0x331bd7[_0xc2a8('0x35')],qs[_0xc2a8('0x36')](_0x41c5fe[_0xc2a8('0x31')][_0xc2a8('0x36')]));_0x156d9b['attributes']=_0x156d9b[_0xc2a8('0x37')]['length']?_0x156d9b[_0xc2a8('0x37')]:_0x331bd7[_0xc2a8('0x35')];if(_0x41c5fe[_0xc2a8('0x31')][_0xc2a8('0x40')]){_0x156d9b[_0xc2a8('0x44')]=[{'all':!![]}];}_0x156d9b=_[_0xc2a8('0x3e')]({},_0x156d9b,_0x41c5fe[_0xc2a8('0x45')]);return db['SquareReport'][_0xc2a8('0x46')](_0x156d9b)[_0xc2a8('0x23')](handleEntityNotFound(_0x5339d2,null))['then'](respondWithResult(_0x5339d2,null))[_0xc2a8('0x43')](handleError(_0x5339d2,null));};exports[_0xc2a8('0x47')]=function(_0x261809,_0xd4b403){return db[_0xc2a8('0x2b')][_0xc2a8('0x47')](_0x261809['body'],{})[_0xc2a8('0x23')](respondWithResult(_0xd4b403,0xc9))[_0xc2a8('0x43')](handleError(_0xd4b403,null));};exports['update']=function(_0x250bb5,_0x1bfed0){if(_0x250bb5['body']['id']){delete _0x250bb5[_0xc2a8('0x48')]['id'];}return db[_0xc2a8('0x2b')][_0xc2a8('0x46')]({'where':{'id':_0x250bb5['params']['id']}})[_0xc2a8('0x23')](handleEntityNotFound(_0x1bfed0,null))['then'](saveUpdates(_0x250bb5['body'],null))[_0xc2a8('0x23')](respondWithResult(_0x1bfed0,null))[_0xc2a8('0x43')](handleError(_0x1bfed0,null));};exports[_0xc2a8('0x24')]=function(_0x136bfa,_0x2f14b6){return db[_0xc2a8('0x2b')][_0xc2a8('0x46')]({'where':{'id':_0x136bfa[_0xc2a8('0x49')]['id']}})[_0xc2a8('0x23')](handleEntityNotFound(_0x2f14b6,null))['then'](removeEntity(_0x2f14b6,null))[_0xc2a8('0x43')](handleError(_0x2f14b6,null));};exports[_0xc2a8('0x4a')]=function(_0x1c8b92,_0x4d9883){return db['SquareReport']['describe']()[_0xc2a8('0x23')](respondWithResult(_0x4d9883,null))[_0xc2a8('0x43')](handleError(_0x4d9883,null));}; \ No newline at end of file +var _0x6986=['where','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','SquareReport','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','sort'];(function(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0x6986,0xa2));var _0x6698=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0x6986[_0x272638];return _0x19d027;};'use strict';var emlformat=require(_0x6698('0x0'));var rimraf=require(_0x6698('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6698('0x2'));var rp=require(_0x6698('0x3'));var moment=require('moment');var BPromise=require(_0x6698('0x4'));var Mustache=require(_0x6698('0x5'));var util=require(_0x6698('0x6'));var path=require('path');var sox=require(_0x6698('0x7'));var csv=require('to-csv');var ejs=require(_0x6698('0x8'));var fs=require('fs');var fs_extra=require(_0x6698('0x9'));var _=require(_0x6698('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6698('0xb'));var deskjs=require(_0x6698('0xc'));var toCsv=require(_0x6698('0xd'));var querystring=require(_0x6698('0xe'));var Papa=require(_0x6698('0xf'));var Redis=require(_0x6698('0x10'));var authService=require(_0x6698('0x11'));var qs=require(_0x6698('0x12'));var as=require(_0x6698('0x13'));var hardwareService=require(_0x6698('0x14'));var logger=require(_0x6698('0x15'))('api');var utils=require(_0x6698('0x16'));var config=require(_0x6698('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6698('0x18'))['db'];function respondWithStatusCode(_0x2cfae7,_0x10b354){_0x10b354=_0x10b354||0xcc;return function(_0x2e3c4b){if(_0x2e3c4b){return _0x2cfae7[_0x6698('0x19')](_0x10b354);}return _0x2cfae7[_0x6698('0x1a')](_0x10b354)[_0x6698('0x1b')]();};}function respondWithResult(_0x4538d2,_0x343a6e){_0x343a6e=_0x343a6e||0xc8;return function(_0x2ed3af){if(_0x2ed3af){return _0x4538d2[_0x6698('0x1a')](_0x343a6e)[_0x6698('0x1c')](_0x2ed3af);}};}function respondWithFilteredResult(_0x4c4ce8,_0x55f0e8){return function(_0x4ac9ec){if(_0x4ac9ec){var _0x29a3b0=typeof _0x55f0e8['offset']===_0x6698('0x1d')&&typeof _0x55f0e8[_0x6698('0x1e')]===_0x6698('0x1d');var _0x13ec6c=_0x4ac9ec[_0x6698('0x1f')];var _0x49e117=_0x29a3b0?0x0:_0x55f0e8['offset'];var _0x136c45=_0x29a3b0?_0x4ac9ec[_0x6698('0x1f')]:_0x55f0e8[_0x6698('0x20')]+_0x55f0e8[_0x6698('0x1e')];var _0x4bce97;if(_0x136c45>=_0x13ec6c){_0x136c45=_0x13ec6c;_0x4bce97=0xc8;}else{_0x4bce97=0xce;}_0x4c4ce8[_0x6698('0x1a')](_0x4bce97);return _0x4c4ce8['set'](_0x6698('0x21'),_0x49e117+'-'+_0x136c45+'/'+_0x13ec6c)['json'](_0x4ac9ec);}return null;};}function patchUpdates(_0x3ba6bb){return function(_0x558143){try{jsonpatch[_0x6698('0x22')](_0x558143,_0x3ba6bb,!![]);}catch(_0x986935){return BPromise[_0x6698('0x23')](_0x986935);}return _0x558143[_0x6698('0x24')]();};}function saveUpdates(_0x30667f,_0x5b754a){return function(_0x905a48){if(_0x905a48){return _0x905a48[_0x6698('0x25')](_0x30667f)[_0x6698('0x26')](function(_0x35d9fe){return _0x35d9fe;});}return null;};}function removeEntity(_0x1ca122,_0x404127){return function(_0x326f35){if(_0x326f35){return _0x326f35[_0x6698('0x27')]()[_0x6698('0x26')](function(){_0x1ca122['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x164066,_0x507162){return function(_0x342a22){if(!_0x342a22){_0x164066['sendStatus'](0x194);}return _0x342a22;};}function handleError(_0x13f95c,_0x6d6694){_0x6d6694=_0x6d6694||0x1f4;return function(_0x487511){logger[_0x6698('0x28')](_0x487511['stack']);if(_0x487511[_0x6698('0x29')]){delete _0x487511[_0x6698('0x29')];}_0x13f95c[_0x6698('0x1a')](_0x6d6694)[_0x6698('0x2a')](_0x487511);};}exports[_0x6698('0x2b')]=function(_0x25b07d,_0x322426){var _0x1a618f={},_0x3d802c={},_0xc577ed={'count':0x0,'rows':[]};var _0x167da2=_['map'](db[_0x6698('0x2c')]['rawAttributes'],function(_0x2a9fbb){return{'name':_0x2a9fbb[_0x6698('0x2d')],'type':_0x2a9fbb[_0x6698('0x2e')]['key']};});_0x3d802c[_0x6698('0x2f')]=_[_0x6698('0x30')](_0x167da2,_0x6698('0x29'));_0x3d802c[_0x6698('0x31')]=_[_0x6698('0x32')](_0x25b07d[_0x6698('0x31')]);_0x3d802c[_0x6698('0x33')]=_['intersection'](_0x3d802c[_0x6698('0x2f')],_0x3d802c[_0x6698('0x31')]);_0x1a618f[_0x6698('0x34')]=_[_0x6698('0x35')](_0x3d802c[_0x6698('0x2f')],qs[_0x6698('0x36')](_0x25b07d[_0x6698('0x31')][_0x6698('0x36')]));_0x1a618f[_0x6698('0x34')]=_0x1a618f[_0x6698('0x34')][_0x6698('0x37')]?_0x1a618f[_0x6698('0x34')]:_0x3d802c['model'];if(!_0x25b07d[_0x6698('0x31')]['hasOwnProperty']('nolimit')){_0x1a618f['limit']=qs[_0x6698('0x1e')](_0x25b07d[_0x6698('0x31')][_0x6698('0x1e')]);_0x1a618f['offset']=qs[_0x6698('0x20')](_0x25b07d[_0x6698('0x31')][_0x6698('0x20')]);}_0x1a618f['order']=qs[_0x6698('0x38')](_0x25b07d['query']['sort']);_0x1a618f[_0x6698('0x39')]=qs[_0x6698('0x33')](_[_0x6698('0x3a')](_0x25b07d['query'],_0x3d802c['filters']),_0x167da2);if(_0x25b07d[_0x6698('0x31')]['filter']){_0x1a618f[_0x6698('0x39')]=_[_0x6698('0x3b')](_0x1a618f['where'],{'$or':_[_0x6698('0x30')](_0x167da2,function(_0x52fd5e){if(_0x52fd5e['type']!==_0x6698('0x3c')){var _0x264c15={};_0x264c15[_0x52fd5e['name']]={'$like':'%'+_0x25b07d['query'][_0x6698('0x3d')]+'%'};return _0x264c15;}})});}_0x1a618f=_[_0x6698('0x3b')]({},_0x1a618f,_0x25b07d['options']);var _0x4e1a45={'where':_0x1a618f[_0x6698('0x39')]};return db['SquareReport'][_0x6698('0x1f')](_0x4e1a45)[_0x6698('0x26')](function(_0x210cce){_0xc577ed[_0x6698('0x1f')]=_0x210cce;if(_0x25b07d[_0x6698('0x31')][_0x6698('0x3e')]){_0x1a618f[_0x6698('0x3f')]=[{'all':!![]}];}return db[_0x6698('0x2c')]['findAll'](_0x1a618f);})[_0x6698('0x26')](function(_0x3619b0){_0xc577ed[_0x6698('0x40')]=_0x3619b0;return _0xc577ed;})[_0x6698('0x26')](respondWithFilteredResult(_0x322426,_0x1a618f))[_0x6698('0x41')](handleError(_0x322426,null));};exports[_0x6698('0x42')]=function(_0x16a9dd,_0x204fc1){var _0x5eb56a={'raw':!![],'where':{'id':_0x16a9dd[_0x6698('0x43')]['id']}},_0x30d37f={};_0x30d37f[_0x6698('0x2f')]=_[_0x6698('0x32')](db[_0x6698('0x2c')]['rawAttributes']);_0x30d37f[_0x6698('0x31')]=_[_0x6698('0x32')](_0x16a9dd[_0x6698('0x31')]);_0x30d37f['filters']=_[_0x6698('0x35')](_0x30d37f['model'],_0x30d37f[_0x6698('0x31')]);_0x5eb56a[_0x6698('0x34')]=_[_0x6698('0x35')](_0x30d37f[_0x6698('0x2f')],qs[_0x6698('0x36')](_0x16a9dd[_0x6698('0x31')][_0x6698('0x36')]));_0x5eb56a[_0x6698('0x34')]=_0x5eb56a['attributes'][_0x6698('0x37')]?_0x5eb56a[_0x6698('0x34')]:_0x30d37f['model'];if(_0x16a9dd[_0x6698('0x31')][_0x6698('0x3e')]){_0x5eb56a['include']=[{'all':!![]}];}_0x5eb56a=_[_0x6698('0x3b')]({},_0x5eb56a,_0x16a9dd[_0x6698('0x44')]);return db[_0x6698('0x2c')][_0x6698('0x45')](_0x5eb56a)['then'](handleEntityNotFound(_0x204fc1,null))[_0x6698('0x26')](respondWithResult(_0x204fc1,null))[_0x6698('0x41')](handleError(_0x204fc1,null));};exports[_0x6698('0x46')]=function(_0x259bbe,_0xa4ba26){return db['SquareReport'][_0x6698('0x46')](_0x259bbe[_0x6698('0x47')],{})[_0x6698('0x26')](respondWithResult(_0xa4ba26,0xc9))[_0x6698('0x41')](handleError(_0xa4ba26,null));};exports[_0x6698('0x25')]=function(_0x1c2d7c,_0x2462ed){if(_0x1c2d7c['body']['id']){delete _0x1c2d7c[_0x6698('0x47')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x1c2d7c['params']['id']}})['then'](handleEntityNotFound(_0x2462ed,null))['then'](saveUpdates(_0x1c2d7c[_0x6698('0x47')],null))[_0x6698('0x26')](respondWithResult(_0x2462ed,null))['catch'](handleError(_0x2462ed,null));};exports[_0x6698('0x27')]=function(_0x7b9cbb,_0x5804d3){return db[_0x6698('0x2c')][_0x6698('0x45')]({'where':{'id':_0x7b9cbb['params']['id']}})[_0x6698('0x26')](handleEntityNotFound(_0x5804d3,null))[_0x6698('0x26')](removeEntity(_0x5804d3,null))['catch'](handleError(_0x5804d3,null));};exports['describe']=function(_0x32e59e,_0x10c3e2){return db['SquareReport'][_0x6698('0x48')]()['then'](respondWithResult(_0x10c3e2,null))[_0x6698('0x41')](handleError(_0x10c3e2,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index a619f39..f93fccc 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 _0x7552=['SquareReport','uid_pname','project_name','leaveAt','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x5960f6,_0x4a4531){var _0x20a6ee=function(_0x2c836a){while(--_0x2c836a){_0x5960f6['push'](_0x5960f6['shift']());}};_0x20a6ee(++_0x4a4531);}(_0x7552,0xd4));var _0x2755=function(_0x1f1a3f,_0x53dbae){_0x1f1a3f=_0x1f1a3f-0x0;var _0x18675e=_0x7552[_0x1f1a3f];return _0x18675e;};'use strict';var _=require('lodash');var util=require(_0x2755('0x0'));var logger=require(_0x2755('0x1'))('api');var moment=require(_0x2755('0x2'));var BPromise=require(_0x2755('0x3'));var rp=require(_0x2755('0x4'));var fs=require('fs');var path=require(_0x2755('0x5'));var rimraf=require('rimraf');var config=require(_0x2755('0x6'));var attributes=require('./squareReport.attributes');module[_0x2755('0x7')]=function(_0x4278cf,_0x26a924){return _0x4278cf[_0x2755('0x8')](_0x2755('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x2755('0xa'),'fields':['uniqueid',_0x2755('0xb')]},{'name':_0x2755('0xc'),'fields':[_0x2755('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2080=['request-promise','path','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','leaveAt','util','../../config/logger','api','moment','bluebird'];(function(_0x20bf47,_0x574f32){var _0x6cefaf=function(_0x3559b2){while(--_0x3559b2){_0x20bf47['push'](_0x20bf47['shift']());}};_0x6cefaf(++_0x574f32);}(_0x2080,0x1ab));var _0x0208=function(_0x1cd8a9,_0x52adaf){_0x1cd8a9=_0x1cd8a9-0x0;var _0x171bd1=_0x2080[_0x1cd8a9];return _0x171bd1;};'use strict';var _=require('lodash');var util=require(_0x0208('0x0'));var logger=require(_0x0208('0x1'))(_0x0208('0x2'));var moment=require(_0x0208('0x3'));var BPromise=require(_0x0208('0x4'));var rp=require(_0x0208('0x5'));var fs=require('fs');var path=require(_0x0208('0x6'));var rimraf=require('rimraf');var config=require(_0x0208('0x7'));var attributes=require(_0x0208('0x8'));module[_0x0208('0x9')]=function(_0x109f81,_0x524101){return _0x109f81[_0x0208('0xa')](_0x0208('0xb'),attributes,{'tableName':_0x0208('0xc'),'paranoid':![],'indexes':[{'name':_0x0208('0xd'),'fields':[_0x0208('0xe'),'project_name']},{'name':_0x0208('0xf'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 1b6ab85..900e6e6 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 _0xfb7c=['request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','body','options','raw','update','where','attributes','limit','UpdateSquareReport','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb7c,0x11f));var _0xcfb7=function(_0x1aef97,_0x5943f4){_0x1aef97=_0x1aef97-0x0;var _0x484622=_0xfb7c[_0x1aef97];return _0x484622;};'use strict';var _=require(_0xcfb7('0x0'));var util=require('util');var moment=require(_0xcfb7('0x1'));var BPromise=require(_0xcfb7('0x2'));var rs=require(_0xcfb7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfb7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcfb7('0x5'))(_0xcfb7('0x6'));var config=require(_0xcfb7('0x7'));var jayson=require(_0xcfb7('0x8'));var client=jayson['client'][_0xcfb7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x506c62,_0x43715c,_0x598a7){return new BPromise(function(_0x41c8da,_0x186882){return client[_0xcfb7('0xa')](_0x506c62,_0x598a7)[_0xcfb7('0xb')](function(_0x5079f8){logger[_0xcfb7('0xc')](_0xcfb7('0xd'),_0x43715c,_0xcfb7('0xe'));logger[_0xcfb7('0xf')](_0xcfb7('0x10'),_0x43715c,_0xcfb7('0xe'),JSON[_0xcfb7('0x11')](_0x5079f8));if(_0x5079f8[_0xcfb7('0x12')]){if(_0x5079f8['error'][_0xcfb7('0x13')]===0x1f4){logger['error'](_0xcfb7('0xd'),_0x43715c,_0x5079f8[_0xcfb7('0x12')]['message']);return _0x186882(_0x5079f8[_0xcfb7('0x12')]['message']);}logger[_0xcfb7('0x12')](_0xcfb7('0xd'),_0x43715c,_0x5079f8[_0xcfb7('0x12')]['message']);return _0x41c8da(_0x5079f8[_0xcfb7('0x12')][_0xcfb7('0x14')]);}else{logger[_0xcfb7('0xc')](_0xcfb7('0xd'),_0x43715c,_0xcfb7('0xe'));_0x41c8da(_0x5079f8[_0xcfb7('0x15')][_0xcfb7('0x14')]);}})[_0xcfb7('0x16')](function(_0x40145a){logger[_0xcfb7('0x12')]('SquareReport,\x20%s,\x20%s',_0x43715c,_0x40145a);_0x186882(_0x40145a);});});}exports[_0xcfb7('0x17')]=function(_0x39f1b5){var _0x234a3b=this;return new Promise(function(_0x37bbe3,_0x3ae03b){return db[_0xcfb7('0x18')]['create'](_0x39f1b5[_0xcfb7('0x19')],{'raw':_0x39f1b5[_0xcfb7('0x1a')]?_0x39f1b5['options'][_0xcfb7('0x1b')]===undefined?!![]:![]:!![]})[_0xcfb7('0xb')](function(_0x55062e){logger['info']('CreateSquareReport',_0x39f1b5);logger[_0xcfb7('0xf')](_0xcfb7('0x17'),_0x39f1b5,JSON['stringify'](_0x55062e));_0x37bbe3(_0x55062e);})[_0xcfb7('0x16')](function(_0x5a6ea5){logger[_0xcfb7('0x12')](_0xcfb7('0x17'),_0x5a6ea5['message'],_0x39f1b5);_0x3ae03b(_0x234a3b[_0xcfb7('0x12')](0x1f4,_0x5a6ea5[_0xcfb7('0x14')]));});});};exports['UpdateSquareReport']=function(_0xd58346){var _0x20a837=this;return new Promise(function(_0x1ca342,_0x478237){return db['SquareReport'][_0xcfb7('0x1c')](_0xd58346[_0xcfb7('0x19')],{'raw':_0xd58346['options']?_0xd58346[_0xcfb7('0x1a')][_0xcfb7('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd58346['options']?_0xd58346['options'][_0xcfb7('0x1d')]||null:null,'attributes':_0xd58346[_0xcfb7('0x1a')]?_0xd58346['options'][_0xcfb7('0x1e')]||null:null,'limit':_0xd58346[_0xcfb7('0x1a')]?_0xd58346['options'][_0xcfb7('0x1f')]||null:null})[_0xcfb7('0xb')](function(_0x3302c7){logger[_0xcfb7('0xc')](_0xcfb7('0x20'),_0xd58346);logger[_0xcfb7('0xf')]('UpdateSquareReport',_0xd58346,JSON[_0xcfb7('0x11')](_0x3302c7));_0x1ca342(_0x3302c7);})[_0xcfb7('0x16')](function(_0x5455ac){logger[_0xcfb7('0x12')](_0xcfb7('0x20'),_0x5455ac[_0xcfb7('0x14')],_0xd58346);_0x478237(_0x20a837[_0xcfb7('0x12')](0x1f4,_0x5455ac['message']));});});}; \ No newline at end of file +var _0x010d=['ioredis','../../mysqldb','../../config/utils','../../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','error','code','message','CreateSquareReport','SquareReport','create','body','options','raw','stringify','UpdateSquareReport','update','attributes','limit','util','randomstring'];(function(_0x5c325f,_0x3968b1){var _0x12cb72=function(_0xc34b64){while(--_0xc34b64){_0x5c325f['push'](_0x5c325f['shift']());}};_0x12cb72(++_0x3968b1);}(_0x010d,0x172));var _0xd010=function(_0x3c6f79,_0x3ed502){_0x3c6f79=_0x3c6f79-0x0;var _0x311855=_0x010d[_0x3c6f79];return _0x311855;};'use strict';var _=require('lodash');var util=require(_0xd010('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd010('0x1'));var fs=require('fs');var Redis=require(_0xd010('0x2'));var db=require(_0xd010('0x3'))['db'];var utils=require(_0xd010('0x4'));var logger=require(_0xd010('0x5'))(_0xd010('0x6'));var config=require(_0xd010('0x7'));var jayson=require(_0xd010('0x8'));var client=jayson[_0xd010('0x9')][_0xd010('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf35a63,_0x48707c,_0xae6629){return new BPromise(function(_0x97dcc2,_0x27e6f9){return client['request'](_0xf35a63,_0xae6629)[_0xd010('0xb')](function(_0x85c420){logger[_0xd010('0xc')](_0xd010('0xd'),_0x48707c,_0xd010('0xe'));logger[_0xd010('0xf')](_0xd010('0x10'),_0x48707c,_0xd010('0xe'),JSON['stringify'](_0x85c420));if(_0x85c420[_0xd010('0x11')]){if(_0x85c420[_0xd010('0x11')][_0xd010('0x12')]===0x1f4){logger[_0xd010('0x11')](_0xd010('0xd'),_0x48707c,_0x85c420[_0xd010('0x11')][_0xd010('0x13')]);return _0x27e6f9(_0x85c420[_0xd010('0x11')][_0xd010('0x13')]);}logger[_0xd010('0x11')]('SquareReport,\x20%s,\x20%s',_0x48707c,_0x85c420[_0xd010('0x11')][_0xd010('0x13')]);return _0x97dcc2(_0x85c420['error'][_0xd010('0x13')]);}else{logger[_0xd010('0xc')](_0xd010('0xd'),_0x48707c,_0xd010('0xe'));_0x97dcc2(_0x85c420['result'][_0xd010('0x13')]);}})['catch'](function(_0x5a47a1){logger[_0xd010('0x11')](_0xd010('0xd'),_0x48707c,_0x5a47a1);_0x27e6f9(_0x5a47a1);});});}exports[_0xd010('0x14')]=function(_0x1e900b){var _0x81be0=this;return new Promise(function(_0x57ad4e,_0x383b7e){return db[_0xd010('0x15')][_0xd010('0x16')](_0x1e900b[_0xd010('0x17')],{'raw':_0x1e900b[_0xd010('0x18')]?_0x1e900b['options'][_0xd010('0x19')]===undefined?!![]:![]:!![]})[_0xd010('0xb')](function(_0x1e0786){logger[_0xd010('0xc')](_0xd010('0x14'),_0x1e900b);logger[_0xd010('0xf')](_0xd010('0x14'),_0x1e900b,JSON[_0xd010('0x1a')](_0x1e0786));_0x57ad4e(_0x1e0786);})['catch'](function(_0x2582f2){logger[_0xd010('0x11')]('CreateSquareReport',_0x2582f2['message'],_0x1e900b);_0x383b7e(_0x81be0[_0xd010('0x11')](0x1f4,_0x2582f2[_0xd010('0x13')]));});});};exports[_0xd010('0x1b')]=function(_0x40ca08){var _0x304ea3=this;return new Promise(function(_0x301ed8,_0x2fd98b){return db[_0xd010('0x15')][_0xd010('0x1c')](_0x40ca08[_0xd010('0x17')],{'raw':_0x40ca08[_0xd010('0x18')]?_0x40ca08['options'][_0xd010('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40ca08[_0xd010('0x18')]?_0x40ca08['options']['where']||null:null,'attributes':_0x40ca08[_0xd010('0x18')]?_0x40ca08[_0xd010('0x18')][_0xd010('0x1d')]||null:null,'limit':_0x40ca08['options']?_0x40ca08[_0xd010('0x18')][_0xd010('0x1e')]||null:null})[_0xd010('0xb')](function(_0x4e866){logger[_0xd010('0xc')](_0xd010('0x1b'),_0x40ca08);logger['debug']('UpdateSquareReport',_0x40ca08,JSON[_0xd010('0x1a')](_0x4e866));_0x301ed8(_0x4e866);})['catch'](function(_0x9189f8){logger['error'](_0xd010('0x1b'),_0x9189f8[_0xd010('0x13')],_0x40ca08);_0x2fd98b(_0x304ea3[_0xd010('0x11')](0x1f4,_0x9189f8['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 3520235..4011079 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 _0x3176=['Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','multer','util','path'];(function(_0x48d122,_0x4bcd20){var _0x36e303=function(_0x2b7a2e){while(--_0x2b7a2e){_0x48d122['push'](_0x48d122['shift']());}};_0x36e303(++_0x4bcd20);}(_0x3176,0x1ea));var _0x6317=function(_0x3cf016,_0x19dc59){_0x3cf016=_0x3cf016-0x0;var _0x1028f0=_0x3176[_0x3cf016];return _0x1028f0;};'use strict';var multer=require(_0x6317('0x0'));var util=require(_0x6317('0x1'));var path=require(_0x6317('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6317('0x3')]();var fs_extra=require(_0x6317('0x4'));var auth=require(_0x6317('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6317('0x6'));var controller=require(_0x6317('0x7'));router[_0x6317('0x8')]('/',auth[_0x6317('0x9')](),controller[_0x6317('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x6317('0x8')](_0x6317('0xb'),auth['isAuthenticated'](),controller[_0x6317('0xc')]);router[_0x6317('0xd')]('/',auth['isAuthenticated'](),controller[_0x6317('0xe')]);router[_0x6317('0xf')](_0x6317('0xb'),auth[_0x6317('0x9')](),controller['update']);router[_0x6317('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6654=['util','path','connect-timeout','express','Router','fs-extra','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy'];(function(_0x5313ba,_0x4335d6){var _0x4bbe99=function(_0x400518){while(--_0x400518){_0x5313ba['push'](_0x5313ba['shift']());}};_0x4bbe99(++_0x4335d6);}(_0x6654,0x1db));var _0x4665=function(_0x6de811,_0x389a4c){_0x6de811=_0x6de811-0x0;var _0x26d735=_0x6654[_0x6de811];return _0x26d735;};'use strict';var multer=require('multer');var util=require(_0x4665('0x0'));var path=require(_0x4665('0x1'));var timeout=require(_0x4665('0x2'));var express=require(_0x4665('0x3'));var router=express[_0x4665('0x4')]();var fs_extra=require(_0x4665('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4665('0x6'));router[_0x4665('0x7')]('/',auth[_0x4665('0x8')](),controller[_0x4665('0x9')]);router[_0x4665('0x7')](_0x4665('0xa'),auth[_0x4665('0x8')](),controller[_0x4665('0xb')]);router[_0x4665('0x7')](_0x4665('0xc'),auth[_0x4665('0x8')](),controller[_0x4665('0xd')]);router[_0x4665('0xe')]('/',auth[_0x4665('0x8')](),controller[_0x4665('0xf')]);router[_0x4665('0x10')]('/:id',auth[_0x4665('0x8')](),controller[_0x4665('0x11')]);router['delete']('/:id',auth[_0x4665('0x8')](),controller[_0x4665('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index f4e8e07..49eba08 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 _0xa513=['STRING','sequelize','exports'];(function(_0x31c27f,_0x40294c){var _0x28f9c6=function(_0x4f7f35){while(--_0x4f7f35){_0x31c27f['push'](_0x31c27f['shift']());}};_0x28f9c6(++_0x40294c);}(_0xa513,0x17e));var _0x3a51=function(_0xcef3d7,_0x4aa295){_0xcef3d7=_0xcef3d7-0x0;var _0x133265=_0xa513[_0xcef3d7];return _0x133265;};'use strict';var Sequelize=require(_0x3a51('0x0'));module[_0x3a51('0x1')]={'uniqueid':{'type':Sequelize[_0x3a51('0x2')]},'node':{'type':Sequelize[_0x3a51('0x2')]},'application':{'type':Sequelize[_0x3a51('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x3a51('0x2')]}}; \ No newline at end of file +var _0x1a41=['STRING','TEXT','sequelize','exports'];(function(_0x281ad8,_0xaee843){var _0x4d3021=function(_0x5df4fe){while(--_0x5df4fe){_0x281ad8['push'](_0x281ad8['shift']());}};_0x4d3021(++_0xaee843);}(_0x1a41,0xee));var _0x11a4=function(_0x2c4ff2,_0x59a66c){_0x2c4ff2=_0x2c4ff2-0x0;var _0x2a9f16=_0x1a41[_0x2c4ff2];return _0x2a9f16;};'use strict';var Sequelize=require(_0x11a4('0x0'));module[_0x11a4('0x1')]={'uniqueid':{'type':Sequelize[_0x11a4('0x2')]},'node':{'type':Sequelize[_0x11a4('0x2')]},'application':{'type':Sequelize[_0x11a4('0x2')]},'data':{'type':Sequelize[_0x11a4('0x3')]},'project_name':{'type':Sequelize[_0x11a4('0x2')]},'callerid':{'type':Sequelize[_0x11a4('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index c11b37d..a3069e0 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 _0x91df=['jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SquareDetailsReport','includeAll','include','findAll','catch','show','keys','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x91df,0x11b));var _0xf91d=function(_0x186638,_0x2f7d3f){_0x186638=_0x186638-0x0;var _0x3c5ca5=_0x91df[_0x186638];return _0x3c5ca5;};'use strict';var emlformat=require(_0xf91d('0x0'));var rimraf=require(_0xf91d('0x1'));var zipdir=require(_0xf91d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf91d('0x3'));var moment=require('moment');var BPromise=require(_0xf91d('0x4'));var Mustache=require(_0xf91d('0x5'));var util=require(_0xf91d('0x6'));var path=require(_0xf91d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf91d('0x8'));var fs=require('fs');var fs_extra=require(_0xf91d('0x9'));var _=require(_0xf91d('0xa'));var squel=require(_0xf91d('0xb'));var crypto=require(_0xf91d('0xc'));var jsforce=require(_0xf91d('0xd'));var deskjs=require(_0xf91d('0xe'));var toCsv=require(_0xf91d('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf91d('0x10'));var authService=require(_0xf91d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf91d('0x12'))(_0xf91d('0x13'));var utils=require(_0xf91d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf91d('0x15'));var db=require(_0xf91d('0x16'))['db'];function respondWithStatusCode(_0x5af71b,_0x322a9c){_0x322a9c=_0x322a9c||0xcc;return function(_0x1d4c34){if(_0x1d4c34){return _0x5af71b[_0xf91d('0x17')](_0x322a9c);}return _0x5af71b['status'](_0x322a9c)[_0xf91d('0x18')]();};}function respondWithResult(_0x48782a,_0x1d0a70){_0x1d0a70=_0x1d0a70||0xc8;return function(_0x51d6bb){if(_0x51d6bb){return _0x48782a[_0xf91d('0x19')](_0x1d0a70)[_0xf91d('0x1a')](_0x51d6bb);}};}function respondWithFilteredResult(_0x594eaa,_0x4b6f09){return function(_0x5aa02b){if(_0x5aa02b){var _0x51a99b=typeof _0x4b6f09[_0xf91d('0x1b')]===_0xf91d('0x1c')&&typeof _0x4b6f09[_0xf91d('0x1d')]==='undefined';var _0x53da1b=_0x5aa02b[_0xf91d('0x1e')];var _0x3b6d26=_0x51a99b?0x0:_0x4b6f09[_0xf91d('0x1b')];var _0x3fb170=_0x51a99b?_0x5aa02b[_0xf91d('0x1e')]:_0x4b6f09[_0xf91d('0x1b')]+_0x4b6f09[_0xf91d('0x1d')];var _0x4f6452;if(_0x3fb170>=_0x53da1b){_0x3fb170=_0x53da1b;_0x4f6452=0xc8;}else{_0x4f6452=0xce;}_0x594eaa[_0xf91d('0x19')](_0x4f6452);return _0x594eaa[_0xf91d('0x1f')](_0xf91d('0x20'),_0x3b6d26+'-'+_0x3fb170+'/'+_0x53da1b)[_0xf91d('0x1a')](_0x5aa02b);}return null;};}function patchUpdates(_0x4cd627){return function(_0x1a10b2){try{jsonpatch[_0xf91d('0x21')](_0x1a10b2,_0x4cd627,!![]);}catch(_0xc85801){return BPromise['reject'](_0xc85801);}return _0x1a10b2[_0xf91d('0x22')]();};}function saveUpdates(_0x4c0a4b,_0x4248fd){return function(_0x527abd){if(_0x527abd){return _0x527abd[_0xf91d('0x23')](_0x4c0a4b)[_0xf91d('0x24')](function(_0x5c6c73){return _0x5c6c73;});}return null;};}function removeEntity(_0x52bbda,_0x50ab17){return function(_0x483e63){if(_0x483e63){return _0x483e63[_0xf91d('0x25')]()[_0xf91d('0x24')](function(){_0x52bbda[_0xf91d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384d4c,_0x163e2f){return function(_0x41f07e){if(!_0x41f07e){_0x384d4c[_0xf91d('0x17')](0x194);}return _0x41f07e;};}function handleError(_0x1d4e92,_0x1f66ef){_0x1f66ef=_0x1f66ef||0x1f4;return function(_0x16dc4e){logger[_0xf91d('0x26')](_0x16dc4e['stack']);if(_0x16dc4e[_0xf91d('0x27')]){delete _0x16dc4e[_0xf91d('0x27')];}_0x1d4e92[_0xf91d('0x19')](_0x1f66ef)[_0xf91d('0x28')](_0x16dc4e);};}exports[_0xf91d('0x29')]=function(_0x2b6096,_0x23b20e){var _0xdecb81={},_0x587849={},_0x37d340={'count':0x0,'rows':[]};var _0x254b68=_[_0xf91d('0x2a')](db['SquareDetailsReport'][_0xf91d('0x2b')],function(_0x3b15ae){return{'name':_0x3b15ae[_0xf91d('0x2c')],'type':_0x3b15ae[_0xf91d('0x2d')][_0xf91d('0x2e')]};});_0x587849[_0xf91d('0x2f')]=_[_0xf91d('0x2a')](_0x254b68,'name');_0x587849[_0xf91d('0x30')]=_['keys'](_0x2b6096[_0xf91d('0x30')]);_0x587849[_0xf91d('0x31')]=_[_0xf91d('0x32')](_0x587849[_0xf91d('0x2f')],_0x587849[_0xf91d('0x30')]);_0xdecb81[_0xf91d('0x33')]=_[_0xf91d('0x32')](_0x587849['model'],qs[_0xf91d('0x34')](_0x2b6096[_0xf91d('0x30')][_0xf91d('0x34')]));_0xdecb81['attributes']=_0xdecb81[_0xf91d('0x33')][_0xf91d('0x35')]?_0xdecb81[_0xf91d('0x33')]:_0x587849[_0xf91d('0x2f')];if(!_0x2b6096[_0xf91d('0x30')]['hasOwnProperty'](_0xf91d('0x36'))){_0xdecb81['limit']=qs[_0xf91d('0x1d')](_0x2b6096['query'][_0xf91d('0x1d')]);_0xdecb81[_0xf91d('0x1b')]=qs[_0xf91d('0x1b')](_0x2b6096[_0xf91d('0x30')][_0xf91d('0x1b')]);}_0xdecb81['order']=qs[_0xf91d('0x37')](_0x2b6096[_0xf91d('0x30')][_0xf91d('0x37')]);_0xdecb81[_0xf91d('0x38')]=qs[_0xf91d('0x31')](_[_0xf91d('0x39')](_0x2b6096[_0xf91d('0x30')],_0x587849['filters']),_0x254b68);if(_0x2b6096[_0xf91d('0x30')][_0xf91d('0x3a')]){_0xdecb81['where']=_[_0xf91d('0x3b')](_0xdecb81[_0xf91d('0x38')],{'$or':_[_0xf91d('0x2a')](_0x254b68,function(_0x343897){if(_0x343897[_0xf91d('0x2d')]!==_0xf91d('0x3c')){var _0x2e91f2={};_0x2e91f2[_0x343897[_0xf91d('0x27')]]={'$like':'%'+_0x2b6096['query'][_0xf91d('0x3a')]+'%'};return _0x2e91f2;}})});}_0xdecb81=_[_0xf91d('0x3b')]({},_0xdecb81,_0x2b6096[_0xf91d('0x3d')]);var _0x1c6635={'where':_0xdecb81['where']};return db[_0xf91d('0x3e')][_0xf91d('0x1e')](_0x1c6635)['then'](function(_0x574992){_0x37d340[_0xf91d('0x1e')]=_0x574992;if(_0x2b6096[_0xf91d('0x30')][_0xf91d('0x3f')]){_0xdecb81[_0xf91d('0x40')]=[{'all':!![]}];}return db[_0xf91d('0x3e')][_0xf91d('0x41')](_0xdecb81);})[_0xf91d('0x24')](function(_0x5ea124){_0x37d340['rows']=_0x5ea124;return _0x37d340;})[_0xf91d('0x24')](respondWithFilteredResult(_0x23b20e,_0xdecb81))[_0xf91d('0x42')](handleError(_0x23b20e,null));};exports[_0xf91d('0x43')]=function(_0x3044b0,_0x25c4e0){var _0x262f79={'raw':!![],'where':{'id':_0x3044b0['params']['id']}},_0x2b4a04={};_0x2b4a04[_0xf91d('0x2f')]=_[_0xf91d('0x44')](db[_0xf91d('0x3e')][_0xf91d('0x2b')]);_0x2b4a04['query']=_[_0xf91d('0x44')](_0x3044b0[_0xf91d('0x30')]);_0x2b4a04[_0xf91d('0x31')]=_[_0xf91d('0x32')](_0x2b4a04[_0xf91d('0x2f')],_0x2b4a04[_0xf91d('0x30')]);_0x262f79[_0xf91d('0x33')]=_[_0xf91d('0x32')](_0x2b4a04[_0xf91d('0x2f')],qs[_0xf91d('0x34')](_0x3044b0['query']['fields']));_0x262f79['attributes']=_0x262f79[_0xf91d('0x33')][_0xf91d('0x35')]?_0x262f79[_0xf91d('0x33')]:_0x2b4a04[_0xf91d('0x2f')];if(_0x3044b0[_0xf91d('0x30')]['includeAll']){_0x262f79[_0xf91d('0x40')]=[{'all':!![]}];}_0x262f79=_[_0xf91d('0x3b')]({},_0x262f79,_0x3044b0[_0xf91d('0x3d')]);return db[_0xf91d('0x3e')][_0xf91d('0x45')](_0x262f79)['then'](handleEntityNotFound(_0x25c4e0,null))[_0xf91d('0x24')](respondWithResult(_0x25c4e0,null))[_0xf91d('0x42')](handleError(_0x25c4e0,null));};exports['create']=function(_0x29a646,_0x132d62){return db[_0xf91d('0x3e')][_0xf91d('0x46')](_0x29a646[_0xf91d('0x47')],{})[_0xf91d('0x24')](respondWithResult(_0x132d62,0xc9))[_0xf91d('0x42')](handleError(_0x132d62,null));};exports[_0xf91d('0x23')]=function(_0x1de697,_0x4a5647){if(_0x1de697[_0xf91d('0x47')]['id']){delete _0x1de697[_0xf91d('0x47')]['id'];}return db[_0xf91d('0x3e')][_0xf91d('0x45')]({'where':{'id':_0x1de697['params']['id']}})['then'](handleEntityNotFound(_0x4a5647,null))['then'](saveUpdates(_0x1de697[_0xf91d('0x47')],null))['then'](respondWithResult(_0x4a5647,null))['catch'](handleError(_0x4a5647,null));};exports[_0xf91d('0x25')]=function(_0x2e2b76,_0x370dc6){return db[_0xf91d('0x3e')]['find']({'where':{'id':_0x2e2b76[_0xf91d('0x48')]['id']}})['then'](handleEntityNotFound(_0x370dc6,null))['then'](removeEntity(_0x370dc6,null))[_0xf91d('0x42')](handleError(_0x370dc6,null));};exports['describe']=function(_0x23f575,_0x3cae8f){return db[_0xf91d('0x3e')][_0xf91d('0x49')]()['then'](respondWithResult(_0x3cae8f,null))[_0xf91d('0x42')](handleError(_0x3cae8f,null));}; \ No newline at end of file +var _0x95fd=['rows','params','catch','create','body','find','destroy','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','index','SquareDetailsReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','options','include','findAll'];(function(_0x56a86e,_0x51f246){var _0x48ae90=function(_0x1a46a8){while(--_0x1a46a8){_0x56a86e['push'](_0x56a86e['shift']());}};_0x48ae90(++_0x51f246);}(_0x95fd,0x16f));var _0xd95f=function(_0x151a4a,_0x142ea9){_0x151a4a=_0x151a4a-0x0;var _0xa46b13=_0x95fd[_0x151a4a];return _0xa46b13;};'use strict';var emlformat=require(_0xd95f('0x0'));var rimraf=require(_0xd95f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd95f('0x2'));var moment=require(_0xd95f('0x3'));var BPromise=require(_0xd95f('0x4'));var Mustache=require('mustache');var util=require(_0xd95f('0x5'));var path=require(_0xd95f('0x6'));var sox=require(_0xd95f('0x7'));var csv=require(_0xd95f('0x8'));var ejs=require(_0xd95f('0x9'));var fs=require('fs');var fs_extra=require(_0xd95f('0xa'));var _=require(_0xd95f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd95f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd95f('0x8'));var querystring=require(_0xd95f('0xd'));var Papa=require(_0xd95f('0xe'));var Redis=require(_0xd95f('0xf'));var authService=require(_0xd95f('0x10'));var qs=require(_0xd95f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd95f('0x12'))(_0xd95f('0x13'));var utils=require(_0xd95f('0x14'));var config=require(_0xd95f('0x15'));var licenseUtil=require(_0xd95f('0x16'));var db=require(_0xd95f('0x17'))['db'];function respondWithStatusCode(_0x1ffea1,_0x33ec7a){_0x33ec7a=_0x33ec7a||0xcc;return function(_0x50f1c6){if(_0x50f1c6){return _0x1ffea1[_0xd95f('0x18')](_0x33ec7a);}return _0x1ffea1[_0xd95f('0x19')](_0x33ec7a)[_0xd95f('0x1a')]();};}function respondWithResult(_0x362256,_0xabdd38){_0xabdd38=_0xabdd38||0xc8;return function(_0x459c2f){if(_0x459c2f){return _0x362256[_0xd95f('0x19')](_0xabdd38)[_0xd95f('0x1b')](_0x459c2f);}};}function respondWithFilteredResult(_0x5c6bd8,_0x5f5c03){return function(_0x56365e){if(_0x56365e){var _0x5a9bb6=typeof _0x5f5c03['offset']===_0xd95f('0x1c')&&typeof _0x5f5c03[_0xd95f('0x1d')]===_0xd95f('0x1c');var _0x5180f2=_0x56365e[_0xd95f('0x1e')];var _0x17726f=_0x5a9bb6?0x0:_0x5f5c03[_0xd95f('0x1f')];var _0x49f82d=_0x5a9bb6?_0x56365e[_0xd95f('0x1e')]:_0x5f5c03['offset']+_0x5f5c03['limit'];var _0x13e569;if(_0x49f82d>=_0x5180f2){_0x49f82d=_0x5180f2;_0x13e569=0xc8;}else{_0x13e569=0xce;}_0x5c6bd8[_0xd95f('0x19')](_0x13e569);return _0x5c6bd8[_0xd95f('0x20')](_0xd95f('0x21'),_0x17726f+'-'+_0x49f82d+'/'+_0x5180f2)[_0xd95f('0x1b')](_0x56365e);}return null;};}function patchUpdates(_0x2d6cfc){return function(_0x19ef8f){try{jsonpatch[_0xd95f('0x22')](_0x19ef8f,_0x2d6cfc,!![]);}catch(_0x2739f5){return BPromise['reject'](_0x2739f5);}return _0x19ef8f[_0xd95f('0x23')]();};}function saveUpdates(_0x4064ce,_0x2f9352){return function(_0x5ea153){if(_0x5ea153){return _0x5ea153[_0xd95f('0x24')](_0x4064ce)[_0xd95f('0x25')](function(_0x831efa){return _0x831efa;});}return null;};}function removeEntity(_0x108602,_0x24ec3f){return function(_0x1d75a3){if(_0x1d75a3){return _0x1d75a3['destroy']()['then'](function(){_0x108602[_0xd95f('0x19')](0xcc)[_0xd95f('0x1a')]();});}};}function handleEntityNotFound(_0x5d23ae,_0x4f0a8f){return function(_0x5385c2){if(!_0x5385c2){_0x5d23ae[_0xd95f('0x18')](0x194);}return _0x5385c2;};}function handleError(_0x537cc2,_0x198a6e){_0x198a6e=_0x198a6e||0x1f4;return function(_0x10346b){logger[_0xd95f('0x26')](_0x10346b[_0xd95f('0x27')]);if(_0x10346b[_0xd95f('0x28')]){delete _0x10346b['name'];}_0x537cc2[_0xd95f('0x19')](_0x198a6e)[_0xd95f('0x29')](_0x10346b);};}exports[_0xd95f('0x2a')]=function(_0x9b4188,_0x57fed6){var _0x20b9f4={},_0x50be1a={},_0x246465={'count':0x0,'rows':[]};var _0x41b137=_['map'](db[_0xd95f('0x2b')][_0xd95f('0x2c')],function(_0x38df39){return{'name':_0x38df39[_0xd95f('0x2d')],'type':_0x38df39[_0xd95f('0x2e')][_0xd95f('0x2f')]};});_0x50be1a[_0xd95f('0x30')]=_[_0xd95f('0x31')](_0x41b137,_0xd95f('0x28'));_0x50be1a['query']=_[_0xd95f('0x32')](_0x9b4188[_0xd95f('0x33')]);_0x50be1a[_0xd95f('0x34')]=_[_0xd95f('0x35')](_0x50be1a[_0xd95f('0x30')],_0x50be1a[_0xd95f('0x33')]);_0x20b9f4[_0xd95f('0x36')]=_[_0xd95f('0x35')](_0x50be1a[_0xd95f('0x30')],qs['fields'](_0x9b4188[_0xd95f('0x33')][_0xd95f('0x37')]));_0x20b9f4[_0xd95f('0x36')]=_0x20b9f4[_0xd95f('0x36')][_0xd95f('0x38')]?_0x20b9f4[_0xd95f('0x36')]:_0x50be1a[_0xd95f('0x30')];if(!_0x9b4188['query']['hasOwnProperty'](_0xd95f('0x39'))){_0x20b9f4[_0xd95f('0x1d')]=qs[_0xd95f('0x1d')](_0x9b4188[_0xd95f('0x33')][_0xd95f('0x1d')]);_0x20b9f4[_0xd95f('0x1f')]=qs['offset'](_0x9b4188['query'][_0xd95f('0x1f')]);}_0x20b9f4['order']=qs[_0xd95f('0x3a')](_0x9b4188[_0xd95f('0x33')][_0xd95f('0x3a')]);_0x20b9f4['where']=qs[_0xd95f('0x34')](_['pick'](_0x9b4188['query'],_0x50be1a['filters']),_0x41b137);if(_0x9b4188[_0xd95f('0x33')]['filter']){_0x20b9f4[_0xd95f('0x3b')]=_[_0xd95f('0x3c')](_0x20b9f4['where'],{'$or':_['map'](_0x41b137,function(_0x381240){if(_0x381240[_0xd95f('0x2e')]!==_0xd95f('0x3d')){var _0x21a790={};_0x21a790[_0x381240[_0xd95f('0x28')]]={'$like':'%'+_0x9b4188['query']['filter']+'%'};return _0x21a790;}})});}_0x20b9f4=_['merge']({},_0x20b9f4,_0x9b4188[_0xd95f('0x3e')]);var _0x29c960={'where':_0x20b9f4[_0xd95f('0x3b')]};return db[_0xd95f('0x2b')][_0xd95f('0x1e')](_0x29c960)[_0xd95f('0x25')](function(_0x5b1435){_0x246465[_0xd95f('0x1e')]=_0x5b1435;if(_0x9b4188[_0xd95f('0x33')]['includeAll']){_0x20b9f4[_0xd95f('0x3f')]=[{'all':!![]}];}return db[_0xd95f('0x2b')][_0xd95f('0x40')](_0x20b9f4);})[_0xd95f('0x25')](function(_0x125563){_0x246465[_0xd95f('0x41')]=_0x125563;return _0x246465;})[_0xd95f('0x25')](respondWithFilteredResult(_0x57fed6,_0x20b9f4))['catch'](handleError(_0x57fed6,null));};exports['show']=function(_0x3d3240,_0x25f9e7){var _0x5c9a74={'raw':!![],'where':{'id':_0x3d3240[_0xd95f('0x42')]['id']}},_0x2a9f5f={};_0x2a9f5f[_0xd95f('0x30')]=_[_0xd95f('0x32')](db[_0xd95f('0x2b')][_0xd95f('0x2c')]);_0x2a9f5f[_0xd95f('0x33')]=_[_0xd95f('0x32')](_0x3d3240[_0xd95f('0x33')]);_0x2a9f5f['filters']=_[_0xd95f('0x35')](_0x2a9f5f[_0xd95f('0x30')],_0x2a9f5f[_0xd95f('0x33')]);_0x5c9a74[_0xd95f('0x36')]=_[_0xd95f('0x35')](_0x2a9f5f[_0xd95f('0x30')],qs['fields'](_0x3d3240[_0xd95f('0x33')][_0xd95f('0x37')]));_0x5c9a74[_0xd95f('0x36')]=_0x5c9a74['attributes'][_0xd95f('0x38')]?_0x5c9a74['attributes']:_0x2a9f5f[_0xd95f('0x30')];if(_0x3d3240['query']['includeAll']){_0x5c9a74['include']=[{'all':!![]}];}_0x5c9a74=_[_0xd95f('0x3c')]({},_0x5c9a74,_0x3d3240['options']);return db[_0xd95f('0x2b')]['find'](_0x5c9a74)[_0xd95f('0x25')](handleEntityNotFound(_0x25f9e7,null))[_0xd95f('0x25')](respondWithResult(_0x25f9e7,null))[_0xd95f('0x43')](handleError(_0x25f9e7,null));};exports[_0xd95f('0x44')]=function(_0x48bf14,_0x59679c){return db[_0xd95f('0x2b')][_0xd95f('0x44')](_0x48bf14[_0xd95f('0x45')],{})['then'](respondWithResult(_0x59679c,0xc9))[_0xd95f('0x43')](handleError(_0x59679c,null));};exports[_0xd95f('0x24')]=function(_0x3f2642,_0x4633a0){if(_0x3f2642[_0xd95f('0x45')]['id']){delete _0x3f2642['body']['id'];}return db[_0xd95f('0x2b')][_0xd95f('0x46')]({'where':{'id':_0x3f2642[_0xd95f('0x42')]['id']}})[_0xd95f('0x25')](handleEntityNotFound(_0x4633a0,null))[_0xd95f('0x25')](saveUpdates(_0x3f2642['body'],null))[_0xd95f('0x25')](respondWithResult(_0x4633a0,null))[_0xd95f('0x43')](handleError(_0x4633a0,null));};exports[_0xd95f('0x47')]=function(_0x1f0549,_0xb01e97){return db[_0xd95f('0x2b')][_0xd95f('0x46')]({'where':{'id':_0x1f0549[_0xd95f('0x42')]['id']}})[_0xd95f('0x25')](handleEntityNotFound(_0xb01e97,null))[_0xd95f('0x25')](removeEntity(_0xb01e97,null))[_0xd95f('0x43')](handleError(_0xb01e97,null));};exports['describe']=function(_0x6ff981,_0x263897){return db['SquareDetailsReport']['describe']()[_0xd95f('0x25')](respondWithResult(_0x263897,null))[_0xd95f('0x43')](handleError(_0x263897,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 5179441..1209f12 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 _0xc5bf=['SquareDetailsReport','report_square_details','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1bea79,_0x256daa){var _0x4ad42b=function(_0x2e329d){while(--_0x2e329d){_0x1bea79['push'](_0x1bea79['shift']());}};_0x4ad42b(++_0x256daa);}(_0xc5bf,0x141));var _0xfc5b=function(_0x558190,_0x5792b9){_0x558190=_0x558190-0x0;var _0x1a3289=_0xc5bf[_0x558190];return _0x1a3289;};'use strict';var _=require(_0xfc5b('0x0'));var util=require(_0xfc5b('0x1'));var logger=require('../../config/logger')(_0xfc5b('0x2'));var moment=require('moment');var BPromise=require(_0xfc5b('0x3'));var rp=require(_0xfc5b('0x4'));var fs=require('fs');var path=require(_0xfc5b('0x5'));var rimraf=require(_0xfc5b('0x6'));var config=require(_0xfc5b('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0xfc5b('0x8')]=function(_0x268ed0,_0x1b6479){return _0x268ed0['define'](_0xfc5b('0x9'),attributes,{'tableName':_0xfc5b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6f1=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','SquareDetailsReport','report_square_details','lodash'];(function(_0x3c89aa,_0x19aaee){var _0x1c231f=function(_0x1ec39b){while(--_0x1ec39b){_0x3c89aa['push'](_0x3c89aa['shift']());}};_0x1c231f(++_0x19aaee);}(_0xb6f1,0x99));var _0x1b6f=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0xb6f1[_0x4e11d5];return _0x5e4e4c;};'use strict';var _=require(_0x1b6f('0x0'));var util=require('util');var logger=require(_0x1b6f('0x1'))(_0x1b6f('0x2'));var moment=require(_0x1b6f('0x3'));var BPromise=require(_0x1b6f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b6f('0x5'));var rimraf=require(_0x1b6f('0x6'));var config=require(_0x1b6f('0x7'));var attributes=require(_0x1b6f('0x8'));module['exports']=function(_0x551387,_0x20eadf){return _0x551387['define'](_0x1b6f('0x9'),attributes,{'tableName':_0x1b6f('0xa'),'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 4b2fb42..1fa9a47 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 _0x6b20=['error','code','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','then','stringify','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x159367,_0x5d91a6){var _0x5bfbb2=function(_0x4f0aef){while(--_0x4f0aef){_0x159367['push'](_0x159367['shift']());}};_0x5bfbb2(++_0x5d91a6);}(_0x6b20,0xd1));var _0x06b2=function(_0x1bafae,_0xf5d1a6){_0x1bafae=_0x1bafae-0x0;var _0x3198fd=_0x6b20[_0x1bafae];return _0x3198fd;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b825,_0x26a325,_0x4e6d3b){return new BPromise(function(_0x21cd31,_0x1828e4){return client[_0x06b2('0xb')](_0x37b825,_0x4e6d3b)['then'](function(_0x37ace0){logger['info'](_0x06b2('0xc'),_0x26a325,'request\x20sent');logger['debug'](_0x06b2('0xd'),_0x26a325,_0x06b2('0xe'),JSON['stringify'](_0x37ace0));if(_0x37ace0[_0x06b2('0xf')]){if(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x10')]===0x1f4){logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x1828e4(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);}logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x21cd31(_0x37ace0['error'][_0x06b2('0x11')]);}else{logger[_0x06b2('0x12')](_0x06b2('0xc'),_0x26a325,_0x06b2('0xe'));_0x21cd31(_0x37ace0[_0x06b2('0x13')][_0x06b2('0x11')]);}})['catch'](function(_0x17e69b){logger[_0x06b2('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x26a325,_0x17e69b);_0x1828e4(_0x17e69b);});});}exports[_0x06b2('0x14')]=function(_0x594b48){var _0x4c9cae=this;return new Promise(function(_0x192270,_0x1b4ab0){return db[_0x06b2('0x15')][_0x06b2('0x16')](_0x594b48['body'],{'raw':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![]})[_0x06b2('0x19')](function(_0xe28985){logger[_0x06b2('0x12')](_0x06b2('0x14'),_0x594b48);logger['debug'](_0x06b2('0x14'),_0x594b48,JSON[_0x06b2('0x1a')](_0xe28985));_0x192270(_0xe28985);})[_0x06b2('0x1b')](function(_0x208384){logger['error']('CreateSquareDetailsReport',_0x208384[_0x06b2('0x11')],_0x594b48);_0x1b4ab0(_0x4c9cae[_0x06b2('0xf')](0x1f4,_0x208384['message']));});});}; \ No newline at end of file +var _0x8f59=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','then','debug','stringify','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x4fcd21,_0x3b4148){var _0x3af7b8=function(_0x4a0f72){while(--_0x4a0f72){_0x4fcd21['push'](_0x4fcd21['shift']());}};_0x3af7b8(++_0x3b4148);}(_0x8f59,0x11d));var _0x98f5=function(_0x5b710b,_0x103f64){_0x5b710b=_0x5b710b-0x0;var _0x40ccbe=_0x8f59[_0x5b710b];return _0x40ccbe;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var moment=require(_0x98f5('0x2'));var BPromise=require(_0x98f5('0x3'));var rs=require(_0x98f5('0x4'));var fs=require('fs');var Redis=require(_0x98f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x98f5('0x6'));var logger=require(_0x98f5('0x7'))(_0x98f5('0x8'));var config=require(_0x98f5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x98f5('0xa')][_0x98f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e2acf,_0x5869ee,_0x5e91b3){return new BPromise(function(_0x109417,_0x1cd8a8){return client[_0x98f5('0xc')](_0x2e2acf,_0x5e91b3)['then'](function(_0x456329){logger[_0x98f5('0xd')](_0x98f5('0xe'),_0x5869ee,_0x98f5('0xf'));logger['debug'](_0x98f5('0x10'),_0x5869ee,'request\x20sent',JSON['stringify'](_0x456329));if(_0x456329[_0x98f5('0x11')]){if(_0x456329[_0x98f5('0x11')]['code']===0x1f4){logger[_0x98f5('0x11')](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);return _0x1cd8a8(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}logger['error'](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')]['message']);return _0x109417(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}else{logger[_0x98f5('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x5869ee,_0x98f5('0xf'));_0x109417(_0x456329[_0x98f5('0x13')][_0x98f5('0x12')]);}})['catch'](function(_0x440cfa){logger[_0x98f5('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x5869ee,_0x440cfa);_0x1cd8a8(_0x440cfa);});});}exports[_0x98f5('0x14')]=function(_0x51a567){var _0x10c57c=this;return new Promise(function(_0x9e42dd,_0x2291d5){return db[_0x98f5('0x15')][_0x98f5('0x16')](_0x51a567[_0x98f5('0x17')],{'raw':_0x51a567['options']?_0x51a567[_0x98f5('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x98f5('0x19')](function(_0x191f23){logger['info'](_0x98f5('0x14'),_0x51a567);logger[_0x98f5('0x1a')](_0x98f5('0x14'),_0x51a567,JSON[_0x98f5('0x1b')](_0x191f23));_0x9e42dd(_0x191f23);})[_0x98f5('0x1c')](function(_0x3dc7c2){logger[_0x98f5('0x11')]('CreateSquareDetailsReport',_0x3dc7c2[_0x98f5('0x12')],_0x51a567);_0x2291d5(_0x10c57c['error'](0x1f4,_0x3dc7c2[_0x98f5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 4b72669..08ba07c 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 _0x864d=['/process/:pid/kill','killProcess','exports','Router','./system.controller','get','isAuthenticated','index'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x864d,0x18b));var _0xd864=function(_0x2e7771,_0x1a9748){_0x2e7771=_0x2e7771-0x0;var _0x16a8ab=_0x864d[_0x2e7771];return _0x16a8ab;};'use strict';var express=require('express');var router=express[_0xd864('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xd864('0x1'));router[_0xd864('0x2')]('/',auth[_0xd864('0x3')](),controller[_0xd864('0x4')]);router[_0xd864('0x2')](_0xd864('0x5'),auth[_0xd864('0x3')](),controller[_0xd864('0x6')]);module[_0xd864('0x7')]=router; \ No newline at end of file +var _0x255c=['../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express'];(function(_0x49ed67,_0x290989){var _0x1523d5=function(_0x34a179){while(--_0x34a179){_0x49ed67['push'](_0x49ed67['shift']());}};_0x1523d5(++_0x290989);}(_0x255c,0xbc));var _0xc255=function(_0x55fb60,_0x4a926c){_0x55fb60=_0x55fb60-0x0;var _0x294b88=_0x255c[_0x55fb60];return _0x294b88;};'use strict';var express=require(_0xc255('0x0'));var router=express['Router']();var auth=require(_0xc255('0x1'));var controller=require(_0xc255('0x2'));router[_0xc255('0x3')]('/',auth[_0xc255('0x4')](),controller[_0xc255('0x5')]);router[_0xc255('0x3')](_0xc255('0x6'),auth[_0xc255('0x4')](),controller[_0xc255('0x7')]);module[_0xc255('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index b81ed87..9df025f 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 _0xa1a1=['name','status','send','getAllData','then','json','killProcess','components/import/cm','format','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect'];(function(_0xe9faa1,_0x70c34){var _0x330d4c=function(_0x538fcc){while(--_0x538fcc){_0xe9faa1['push'](_0xe9faa1['shift']());}};_0x330d4c(++_0x70c34);}(_0xa1a1,0x13b));var _0x1a1a=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0xa1a1[_0x4f1da5];return _0xe972a8;};'use strict';var info=require('systeminformation');var exec=require(_0x1a1a('0x0'))[_0x1a1a('0x1')];var logger=require(_0x1a1a('0x2'))(_0x1a1a('0x3'));var util=require(_0x1a1a('0x4'));var BPromise=require(_0x1a1a('0x5'));var _=require(_0x1a1a('0x6'));function handleError(_0x18b960,_0x1dd8aa,_0x32eaea){_0x1dd8aa=_0x1dd8aa||0x1f4;return function(_0x4f004e){logger[_0x1a1a('0x7')](_0x1a1a('0x8'),_0x32eaea,_0x1dd8aa,util[_0x1a1a('0x9')](_0x4f004e,{'showHidden':![],'depth':null}));delete _0x4f004e[_0x1a1a('0xa')];_0x18b960[_0x1a1a('0xb')](_0x1dd8aa)[_0x1a1a('0xc')](_0x4f004e);};}exports['index']=function(_0x393286,_0x47fee8){return info[_0x1a1a('0xd')]()[_0x1a1a('0xe')](function(_0x33b5eb){return _0x47fee8[_0x1a1a('0xb')](0xc8)[_0x1a1a('0xf')](_0x33b5eb);})['catch'](function(_0x5a46e6){return _0x47fee8['status'](0x1f4)[_0x1a1a('0xf')](_0x5a46e6);});};exports[_0x1a1a('0x10')]=function(_0x5bce92,_0x27f929){var _0x2965c4=[_0x1a1a('0x11')];return new BPromise(function(_0x59af75,_0x3fe2eb){return exec(util[_0x1a1a('0x12')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x5bce92['params'][_0x1a1a('0x13')]),function(_0x31b494,_0x1703fa,_0x1ae619){if(_0x31b494){return _0x3fe2eb(_0x31b494);}return _0x59af75(_0x1703fa);});})['then'](function(_0x2427f7){var _0x574f32=![];var _0x598813=_0x2427f7[_0x1a1a('0x14')](/\n/);for(var _0x200ffb=0x0,_0x5240c1=_0x2965c4['length'];_0x200ffb<_0x5240c1,_0x574f32===![];_0x200ffb+=0x1){if(_0x2427f7[_0x1a1a('0x15')](_0x2965c4[_0x200ffb])>=0x0){_0x574f32=!![];}}if(!_0x574f32){throw new Error(util[_0x1a1a('0x12')](_0x1a1a('0x16'),_0x5bce92['params'][_0x1a1a('0x13')]));}process['kill'](_0x5bce92[_0x1a1a('0x17')][_0x1a1a('0x13')],'SIGINT');return _0x27f929[_0x1a1a('0xb')](0xc8)[_0x1a1a('0xf')]({'message':util['format'](_0x1a1a('0x18'),_0x5bce92[_0x1a1a('0x17')][_0x1a1a('0x13')])});})['catch'](handleError(_0x27f929,null,'killProcess'));}; \ No newline at end of file +var _0xcd7f=['send','then','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status'];(function(_0x115ccf,_0x4d1df4){var _0x22dd80=function(_0x4b19f0){while(--_0x4b19f0){_0x115ccf['push'](_0x115ccf['shift']());}};_0x22dd80(++_0x4d1df4);}(_0xcd7f,0x16d));var _0xfcd7=function(_0x1e1f89,_0x6aa8a){_0x1e1f89=_0x1e1f89-0x0;var _0x483f2c=_0xcd7f[_0x1e1f89];return _0x483f2c;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0xfcd7('0x0')];var logger=require(_0xfcd7('0x1'))(_0xfcd7('0x2'));var util=require(_0xfcd7('0x3'));var BPromise=require(_0xfcd7('0x4'));var _=require(_0xfcd7('0x5'));function handleError(_0x3b3b4f,_0x56eae2,_0x2117c8){_0x56eae2=_0x56eae2||0x1f4;return function(_0x1ebd43){logger[_0xfcd7('0x6')](_0xfcd7('0x7'),_0x2117c8,_0x56eae2,util['inspect'](_0x1ebd43,{'showHidden':![],'depth':null}));delete _0x1ebd43[_0xfcd7('0x8')];_0x3b3b4f[_0xfcd7('0x9')](_0x56eae2)[_0xfcd7('0xa')](_0x1ebd43);};}exports['index']=function(_0x21c99b,_0x3e4c34){return info['getAllData']()[_0xfcd7('0xb')](function(_0xe43844){return _0x3e4c34[_0xfcd7('0x9')](0xc8)['json'](_0xe43844);})['catch'](function(_0x24851c){return _0x3e4c34[_0xfcd7('0x9')](0x1f4)['json'](_0x24851c);});};exports[_0xfcd7('0xc')]=function(_0x29ec88,_0x16b91d){var _0x443ece=[_0xfcd7('0xd')];return new BPromise(function(_0x2b41f9,_0x565e5c){return exec(util['format'](_0xfcd7('0xe'),_0x29ec88[_0xfcd7('0xf')][_0xfcd7('0x10')]),function(_0x47e7a4,_0x2629ec,_0x58a015){if(_0x47e7a4){return _0x565e5c(_0x47e7a4);}return _0x2b41f9(_0x2629ec);});})[_0xfcd7('0xb')](function(_0x5bd06d){var _0x343e99=![];var _0x4feabd=_0x5bd06d[_0xfcd7('0x11')](/\n/);for(var _0x3f6b3f=0x0,_0x3407e2=_0x443ece['length'];_0x3f6b3f<_0x3407e2,_0x343e99===![];_0x3f6b3f+=0x1){if(_0x5bd06d[_0xfcd7('0x12')](_0x443ece[_0x3f6b3f])>=0x0){_0x343e99=!![];}}if(!_0x343e99){throw new Error(util[_0xfcd7('0x13')](_0xfcd7('0x14'),_0x29ec88['params']['pid']));}process[_0xfcd7('0x15')](_0x29ec88[_0xfcd7('0xf')][_0xfcd7('0x10')],_0xfcd7('0x16'));return _0x16b91d['status'](0xc8)['json']({'message':util['format'](_0xfcd7('0x17'),_0x29ec88[_0xfcd7('0xf')][_0xfcd7('0x10')])});})[_0xfcd7('0x18')](handleError(_0x16b91d,null,_0xfcd7('0xc')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index ca6c172..53fc9d3 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 _0x0630=['post','create','put','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','get','isAuthenticated','index','show'];(function(_0x114294,_0x259d34){var _0x37ec86=function(_0x4d789c){while(--_0x4d789c){_0x114294['push'](_0x114294['shift']());}};_0x37ec86(++_0x259d34);}(_0x0630,0x9d));var _0x0063=function(_0x4b196f,_0x18cfb4){_0x4b196f=_0x4b196f-0x0;var _0x455b1b=_0x0630[_0x4b196f];return _0x455b1b;};'use strict';var multer=require(_0x0063('0x0'));var util=require(_0x0063('0x1'));var path=require(_0x0063('0x2'));var timeout=require(_0x0063('0x3'));var express=require(_0x0063('0x4'));var router=express[_0x0063('0x5')]();var fs_extra=require(_0x0063('0x6'));var auth=require(_0x0063('0x7'));var interaction=require(_0x0063('0x8'));var config=require('../../config/environment');var controller=require(_0x0063('0x9'));router[_0x0063('0xa')]('/',auth[_0x0063('0xb')](),controller[_0x0063('0xc')]);router[_0x0063('0xa')]('/:id',auth[_0x0063('0xb')](),controller[_0x0063('0xd')]);router[_0x0063('0xe')]('/',auth['isAuthenticated'](),controller[_0x0063('0xf')]);router[_0x0063('0x10')](_0x0063('0x11'),auth[_0x0063('0xb')](),controller['update']);router['delete'](_0x0063('0x11'),auth[_0x0063('0xb')](),controller[_0x0063('0x12')]);module['exports']=router; \ No newline at end of file +var _0x1740=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x85e887,_0x369ba0){var _0x154a58=function(_0x1936b5){while(--_0x1936b5){_0x85e887['push'](_0x85e887['shift']());}};_0x154a58(++_0x369ba0);}(_0x1740,0x1c6));var _0x0174=function(_0x239bdd,_0x13c56f){_0x239bdd=_0x239bdd-0x0;var _0x3a117d=_0x1740[_0x239bdd];return _0x3a117d;};'use strict';var multer=require(_0x0174('0x0'));var util=require(_0x0174('0x1'));var path=require(_0x0174('0x2'));var timeout=require(_0x0174('0x3'));var express=require(_0x0174('0x4'));var router=express[_0x0174('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0174('0x6'));var interaction=require(_0x0174('0x7'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0x0174('0x8')]('/',auth[_0x0174('0x9')](),controller['index']);router[_0x0174('0x8')](_0x0174('0xa'),auth['isAuthenticated'](),controller[_0x0174('0xb')]);router[_0x0174('0xc')]('/',auth[_0x0174('0x9')](),controller[_0x0174('0xd')]);router['put'](_0x0174('0xa'),auth['isAuthenticated'](),controller[_0x0174('0xe')]);router[_0x0174('0xf')](_0x0174('0xa'),auth[_0x0174('0x9')](),controller[_0x0174('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index c30577e..01ac071 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 _0x282b=['sequelize','exports','STRING','name'];(function(_0x10cfc2,_0x88b59d){var _0x25b436=function(_0x323ead){while(--_0x323ead){_0x10cfc2['push'](_0x10cfc2['shift']());}};_0x25b436(++_0x88b59d);}(_0x282b,0xec));var _0xb282=function(_0x1e6fa5,_0x440ece){_0x1e6fa5=_0x1e6fa5-0x0;var _0x535d02=_0x282b[_0x1e6fa5];return _0x535d02;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'name':{'type':Sequelize[_0xb282('0x2')],'unique':_0xb282('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xb282('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x40ac=['name','#0091EA','sequelize','STRING'];(function(_0x62f768,_0xd0d317){var _0x115eed=function(_0x524c97){while(--_0x524c97){_0x62f768['push'](_0x62f768['shift']());}};_0x115eed(++_0xd0d317);}(_0x40ac,0x1de));var _0xc40a=function(_0x5f0f7a,_0x244c53){_0x5f0f7a=_0x5f0f7a-0x0;var _0x8742e7=_0x40ac[_0x5f0f7a];return _0x8742e7;};'use strict';var Sequelize=require(_0xc40a('0x0'));module['exports']={'name':{'type':Sequelize[_0xc40a('0x1')],'unique':_0xc40a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xc40a('0x1')],'defaultValue':_0xc40a('0x3')},'description':{'type':Sequelize[_0xc40a('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index e505b52..08df4a1 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 _0x0a9a=['end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','options','Tag','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x5a0d6c,_0x180ba4){var _0x1b9fc1=function(_0x5728e3){while(--_0x5728e3){_0x5a0d6c['push'](_0x5a0d6c['shift']());}};_0x1b9fc1(++_0x180ba4);}(_0x0a9a,0x183));var _0xa0a9=function(_0x139845,_0xfdf0ba){_0x139845=_0x139845-0x0;var _0x4ed3b8=_0x0a9a[_0x139845];return _0x4ed3b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa0a9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa0a9('0x1'));var rp=require(_0xa0a9('0x2'));var moment=require(_0xa0a9('0x3'));var BPromise=require(_0xa0a9('0x4'));var Mustache=require('mustache');var util=require(_0xa0a9('0x5'));var path=require(_0xa0a9('0x6'));var sox=require('sox');var csv=require(_0xa0a9('0x7'));var ejs=require(_0xa0a9('0x8'));var fs=require('fs');var fs_extra=require(_0xa0a9('0x9'));var _=require(_0xa0a9('0xa'));var squel=require('squel');var crypto=require(_0xa0a9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa0a9('0xc'));var toCsv=require(_0xa0a9('0x7'));var querystring=require(_0xa0a9('0xd'));var Papa=require(_0xa0a9('0xe'));var Redis=require('ioredis');var authService=require(_0xa0a9('0xf'));var qs=require(_0xa0a9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0a9('0x11'))(_0xa0a9('0x12'));var utils=require('../../config/utils');var config=require(_0xa0a9('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa0a9('0x14'))['db'];function respondWithStatusCode(_0x4b7913,_0xb87a94){_0xb87a94=_0xb87a94||0xcc;return function(_0x1ae2a7){if(_0x1ae2a7){return _0x4b7913[_0xa0a9('0x15')](_0xb87a94);}return _0x4b7913[_0xa0a9('0x16')](_0xb87a94)[_0xa0a9('0x17')]();};}function respondWithResult(_0x4fac40,_0x1f3f23){_0x1f3f23=_0x1f3f23||0xc8;return function(_0x9ef979){if(_0x9ef979){return _0x4fac40[_0xa0a9('0x16')](_0x1f3f23)[_0xa0a9('0x18')](_0x9ef979);}};}function respondWithFilteredResult(_0x2f8b3c,_0x1a7b8a){return function(_0x5a6693){if(_0x5a6693){var _0x176faa=typeof _0x1a7b8a['offset']==='undefined'&&typeof _0x1a7b8a[_0xa0a9('0x19')]===_0xa0a9('0x1a');var _0x476762=_0x5a6693[_0xa0a9('0x1b')];var _0x568409=_0x176faa?0x0:_0x1a7b8a[_0xa0a9('0x1c')];var _0x126401=_0x176faa?_0x5a6693[_0xa0a9('0x1b')]:_0x1a7b8a[_0xa0a9('0x1c')]+_0x1a7b8a[_0xa0a9('0x19')];var _0x3c1b3a;if(_0x126401>=_0x476762){_0x126401=_0x476762;_0x3c1b3a=0xc8;}else{_0x3c1b3a=0xce;}_0x2f8b3c['status'](_0x3c1b3a);return _0x2f8b3c[_0xa0a9('0x1d')](_0xa0a9('0x1e'),_0x568409+'-'+_0x126401+'/'+_0x476762)['json'](_0x5a6693);}return null;};}function patchUpdates(_0x53b99d){return function(_0x465d60){try{jsonpatch[_0xa0a9('0x1f')](_0x465d60,_0x53b99d,!![]);}catch(_0x3d9905){return BPromise['reject'](_0x3d9905);}return _0x465d60[_0xa0a9('0x20')]();};}function saveUpdates(_0x4e6f4c,_0x1fb36b){return function(_0x5e6148){if(_0x5e6148){return _0x5e6148[_0xa0a9('0x21')](_0x4e6f4c)[_0xa0a9('0x22')](function(_0x2f0b14){return _0x2f0b14;});}return null;};}function removeEntity(_0x305747,_0x4938da){return function(_0x423d3a){if(_0x423d3a){return _0x423d3a['destroy']()[_0xa0a9('0x22')](function(){var _0x1f78e1=_0x423d3a[_0xa0a9('0x23')]({'plain':!![]});var _0x252a14='Tags';return db[_0xa0a9('0x24')][_0xa0a9('0x25')]({'where':{'type':_0x252a14,'resourceId':_0x1f78e1['id']}})[_0xa0a9('0x22')](function(){return _0x423d3a;});})[_0xa0a9('0x22')](function(){_0x305747['status'](0xcc)[_0xa0a9('0x17')]();});}};}function handleEntityNotFound(_0x38e454,_0x2eae30){return function(_0x5c446e){if(!_0x5c446e){_0x38e454['sendStatus'](0x194);}return _0x5c446e;};}function handleError(_0x2b3cbb,_0x3ba07e){_0x3ba07e=_0x3ba07e||0x1f4;return function(_0x10bbfd){logger[_0xa0a9('0x26')](_0x10bbfd[_0xa0a9('0x27')]);if(_0x10bbfd[_0xa0a9('0x28')]){delete _0x10bbfd[_0xa0a9('0x28')];}_0x2b3cbb[_0xa0a9('0x16')](_0x3ba07e)[_0xa0a9('0x29')](_0x10bbfd);};}exports[_0xa0a9('0x2a')]=function(_0x41e994,_0x554191){var _0x1f6178={},_0x1957bf={},_0x4fc94a={'count':0x0,'rows':[]};var _0x2f21ea=_[_0xa0a9('0x2b')](db['Tag']['rawAttributes'],function(_0x45374e){return{'name':_0x45374e['fieldName'],'type':_0x45374e['type'][_0xa0a9('0x2c')]};});_0x1957bf[_0xa0a9('0x2d')]=_[_0xa0a9('0x2b')](_0x2f21ea,_0xa0a9('0x28'));_0x1957bf[_0xa0a9('0x2e')]=_[_0xa0a9('0x2f')](_0x41e994[_0xa0a9('0x2e')]);_0x1957bf['filters']=_[_0xa0a9('0x30')](_0x1957bf[_0xa0a9('0x2d')],_0x1957bf['query']);_0x1f6178[_0xa0a9('0x31')]=_[_0xa0a9('0x30')](_0x1957bf[_0xa0a9('0x2d')],qs['fields'](_0x41e994['query'][_0xa0a9('0x32')]));_0x1f6178[_0xa0a9('0x31')]=_0x1f6178[_0xa0a9('0x31')][_0xa0a9('0x33')]?_0x1f6178['attributes']:_0x1957bf[_0xa0a9('0x2d')];if(!_0x41e994[_0xa0a9('0x2e')][_0xa0a9('0x34')]('nolimit')){_0x1f6178[_0xa0a9('0x19')]=qs[_0xa0a9('0x19')](_0x41e994[_0xa0a9('0x2e')]['limit']);_0x1f6178[_0xa0a9('0x1c')]=qs[_0xa0a9('0x1c')](_0x41e994[_0xa0a9('0x2e')][_0xa0a9('0x1c')]);}_0x1f6178[_0xa0a9('0x35')]=qs[_0xa0a9('0x36')](_0x41e994[_0xa0a9('0x2e')][_0xa0a9('0x36')]);_0x1f6178[_0xa0a9('0x37')]=qs[_0xa0a9('0x38')](_[_0xa0a9('0x39')](_0x41e994[_0xa0a9('0x2e')],_0x1957bf[_0xa0a9('0x38')]),_0x2f21ea);if(_0x41e994[_0xa0a9('0x2e')][_0xa0a9('0x3a')]){_0x1f6178[_0xa0a9('0x37')]=_[_0xa0a9('0x3b')](_0x1f6178['where'],{'$or':_[_0xa0a9('0x2b')](_0x2f21ea,function(_0x17428f){if(_0x17428f[_0xa0a9('0x3c')]!=='VIRTUAL'){var _0x757e10={};_0x757e10[_0x17428f[_0xa0a9('0x28')]]={'$like':'%'+_0x41e994[_0xa0a9('0x2e')][_0xa0a9('0x3a')]+'%'};return _0x757e10;}})});}_0x1f6178=_['merge']({},_0x1f6178,_0x41e994[_0xa0a9('0x3d')]);var _0x44791e={'where':_0x1f6178[_0xa0a9('0x37')]};return db[_0xa0a9('0x3e')][_0xa0a9('0x1b')](_0x44791e)['then'](function(_0x373b95){_0x4fc94a[_0xa0a9('0x1b')]=_0x373b95;if(_0x41e994[_0xa0a9('0x2e')][_0xa0a9('0x3f')]){_0x1f6178[_0xa0a9('0x40')]=[{'all':!![]}];}return db['Tag'][_0xa0a9('0x41')](_0x1f6178);})[_0xa0a9('0x22')](function(_0x27358c){_0x4fc94a[_0xa0a9('0x42')]=_0x27358c;return _0x4fc94a;})[_0xa0a9('0x22')](respondWithFilteredResult(_0x554191,_0x1f6178))['catch'](handleError(_0x554191,null));};exports[_0xa0a9('0x43')]=function(_0x1c8760,_0x5081cf){var _0x4cdcd6={'raw':!![],'where':{'id':_0x1c8760[_0xa0a9('0x44')]['id']}},_0x41cd22={};_0x41cd22[_0xa0a9('0x2d')]=_[_0xa0a9('0x2f')](db['Tag'][_0xa0a9('0x45')]);_0x41cd22[_0xa0a9('0x2e')]=_[_0xa0a9('0x2f')](_0x1c8760[_0xa0a9('0x2e')]);_0x41cd22[_0xa0a9('0x38')]=_[_0xa0a9('0x30')](_0x41cd22[_0xa0a9('0x2d')],_0x41cd22[_0xa0a9('0x2e')]);_0x4cdcd6[_0xa0a9('0x31')]=_[_0xa0a9('0x30')](_0x41cd22[_0xa0a9('0x2d')],qs[_0xa0a9('0x32')](_0x1c8760[_0xa0a9('0x2e')][_0xa0a9('0x32')]));_0x4cdcd6[_0xa0a9('0x31')]=_0x4cdcd6[_0xa0a9('0x31')][_0xa0a9('0x33')]?_0x4cdcd6['attributes']:_0x41cd22[_0xa0a9('0x2d')];if(_0x1c8760['query'][_0xa0a9('0x3f')]){_0x4cdcd6[_0xa0a9('0x40')]=[{'all':!![]}];}_0x4cdcd6=_[_0xa0a9('0x3b')]({},_0x4cdcd6,_0x1c8760[_0xa0a9('0x3d')]);return db[_0xa0a9('0x3e')][_0xa0a9('0x46')](_0x4cdcd6)[_0xa0a9('0x22')](handleEntityNotFound(_0x5081cf,null))[_0xa0a9('0x22')](respondWithResult(_0x5081cf,null))[_0xa0a9('0x47')](handleError(_0x5081cf,null));};exports['create']=function(_0x5d4162,_0x46a9ca){return db[_0xa0a9('0x3e')]['create'](_0x5d4162[_0xa0a9('0x48')],{})[_0xa0a9('0x22')](function(_0x2c9c29){var _0x4a35dd=_0x5d4162[_0xa0a9('0x49')][_0xa0a9('0x23')]({'plain':!![]});if(!_0x4a35dd)throw new Error(_0xa0a9('0x4a'));if(_0x4a35dd[_0xa0a9('0x4b')]==='user'){var _0x398501=_0x2c9c29[_0xa0a9('0x23')]({'plain':!![]});var _0x3d9846=_0xa0a9('0x4c');return db[_0xa0a9('0x4d')][_0xa0a9('0x46')]({'where':{'name':_0x3d9846,'userProfileId':_0x4a35dd[_0xa0a9('0x4e')]},'raw':!![]})['then'](function(_0x63cbda){if(_0x63cbda&&_0x63cbda[_0xa0a9('0x4f')]===0x0){return db['UserProfileResource'][_0xa0a9('0x50')]({'name':_0x398501[_0xa0a9('0x28')],'resourceId':_0x398501['id'],'type':_0x63cbda[_0xa0a9('0x28')],'sectionId':_0x63cbda['id']},{})['then'](function(){return _0x2c9c29;});}else{return _0x2c9c29;}})['catch'](function(_0xb952fc){logger[_0xa0a9('0x26')](_0xa0a9('0x51'),_0xb952fc);throw _0xb952fc;});}return _0x2c9c29;})[_0xa0a9('0x22')](respondWithResult(_0x46a9ca,0xc9))['catch'](handleError(_0x46a9ca,null));};exports['update']=function(_0x2121a0,_0x1f0e30){if(_0x2121a0['body']['id']){delete _0x2121a0['body']['id'];}return db[_0xa0a9('0x3e')][_0xa0a9('0x46')]({'where':{'id':_0x2121a0[_0xa0a9('0x44')]['id']}})[_0xa0a9('0x22')](handleEntityNotFound(_0x1f0e30,null))[_0xa0a9('0x22')](saveUpdates(_0x2121a0[_0xa0a9('0x48')],null))[_0xa0a9('0x22')](respondWithResult(_0x1f0e30,null))[_0xa0a9('0x47')](handleError(_0x1f0e30,null));};exports[_0xa0a9('0x25')]=function(_0x23f1b1,_0x2da124){return db['Tag'][_0xa0a9('0x46')]({'where':{'id':_0x23f1b1[_0xa0a9('0x44')]['id']}})[_0xa0a9('0x22')](handleEntityNotFound(_0x2da124,null))['then'](removeEntity(_0x2da124,null))[_0xa0a9('0x47')](handleError(_0x2da124,null));}; \ No newline at end of file +var _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','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','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Tags','then','stack','name','send','map','Tag','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x404791,_0x4e854b){var _0x247d37=function(_0x591f78){while(--_0x591f78){_0x404791['push'](_0x404791['shift']());}};_0x247d37(++_0x4e854b);}(_0x00bb,0x1d8));var _0xb00b=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x00bb[_0x29b609];return _0x54c952;};'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'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['Tag'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['Tag'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 7f9405d..aeddc30 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 _0x27e6=['define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x27e6,0x121));var _0x627e=function(_0x5a4c79,_0x1f5c8b){_0x5a4c79=_0x5a4c79-0x0;var _0x49eed0=_0x27e6[_0x5a4c79];return _0x49eed0;};'use strict';var _=require(_0x627e('0x0'));var util=require(_0x627e('0x1'));var logger=require(_0x627e('0x2'))(_0x627e('0x3'));var moment=require(_0x627e('0x4'));var BPromise=require('bluebird');var rp=require(_0x627e('0x5'));var fs=require('fs');var path=require(_0x627e('0x6'));var rimraf=require(_0x627e('0x7'));var config=require(_0x627e('0x8'));var attributes=require('./tag.attributes');module[_0x627e('0x9')]=function(_0x480c11,_0x516027){return _0x480c11[_0x627e('0xa')](_0x627e('0xb'),attributes,{'tableName':_0x627e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1171=['../../config/environment','./tag.attributes','define','Tag','tools_tags','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x3a50ae,_0x4a505b){var _0x3a16f4=function(_0x508359){while(--_0x508359){_0x3a50ae['push'](_0x3a50ae['shift']());}};_0x3a16f4(++_0x4a505b);}(_0x1171,0x14f));var _0x1117=function(_0xe6164f,_0x47e826){_0xe6164f=_0xe6164f-0x0;var _0x557c61=_0x1171[_0xe6164f];return _0x557c61;};'use strict';var _=require(_0x1117('0x0'));var util=require(_0x1117('0x1'));var logger=require(_0x1117('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1117('0x3'));var fs=require('fs');var path=require(_0x1117('0x4'));var rimraf=require(_0x1117('0x5'));var config=require(_0x1117('0x6'));var attributes=require(_0x1117('0x7'));module['exports']=function(_0x1abc5a,_0x453e1a){return _0x1abc5a[_0x1117('0x8')](_0x1117('0x9'),attributes,{'tableName':_0x1117('0xa'),'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 e5f1396..b35b395 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 _0x98a8=['request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x42c7f8,_0x13ce1c){var _0x5f4ba6=function(_0x392f3e){while(--_0x392f3e){_0x42c7f8['push'](_0x42c7f8['shift']());}};_0x5f4ba6(++_0x13ce1c);}(_0x98a8,0x12c));var _0x898a=function(_0x5ecb9a,_0x5e6d42){_0x5ecb9a=_0x5ecb9a-0x0;var _0x4e2d06=_0x98a8[_0x5ecb9a];return _0x4e2d06;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var moment=require(_0x898a('0x2'));var BPromise=require(_0x898a('0x3'));var rs=require(_0x898a('0x4'));var fs=require('fs');var Redis=require(_0x898a('0x5'));var db=require(_0x898a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x898a('0x7'))(_0x898a('0x8'));var config=require(_0x898a('0x9'));var jayson=require(_0x898a('0xa'));var client=jayson[_0x898a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aadc2,_0x564583,_0xfa8c50){return new BPromise(function(_0x4fbce5,_0x42021d){return client[_0x898a('0xc')](_0x3aadc2,_0xfa8c50)[_0x898a('0xd')](function(_0x96b636){logger[_0x898a('0xe')](_0x898a('0xf'),_0x564583,_0x898a('0x10'));logger[_0x898a('0x11')](_0x898a('0x12'),_0x564583,'request\x20sent',JSON[_0x898a('0x13')](_0x96b636));if(_0x96b636['error']){if(_0x96b636[_0x898a('0x14')]['code']===0x1f4){logger[_0x898a('0x14')](_0x898a('0xf'),_0x564583,_0x96b636[_0x898a('0x14')]['message']);return _0x42021d(_0x96b636['error']['message']);}logger[_0x898a('0x14')](_0x898a('0xf'),_0x564583,_0x96b636[_0x898a('0x14')][_0x898a('0x15')]);return _0x4fbce5(_0x96b636[_0x898a('0x14')][_0x898a('0x15')]);}else{logger['info'](_0x898a('0xf'),_0x564583,'request\x20sent');_0x4fbce5(_0x96b636[_0x898a('0x16')]['message']);}})[_0x898a('0x17')](function(_0x4fb05b){logger[_0x898a('0x14')]('Tag,\x20%s,\x20%s',_0x564583,_0x4fb05b);_0x42021d(_0x4fb05b);});});} \ No newline at end of file +var _0x222f=['result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x42dcbb,_0x54021b){var _0xb8f4a9=function(_0x18324e){while(--_0x18324e){_0x42dcbb['push'](_0x42dcbb['shift']());}};_0xb8f4a9(++_0x54021b);}(_0x222f,0x1a4));var _0xf222=function(_0x447af3,_0x381c44){_0x447af3=_0x447af3-0x0;var _0x202e95=_0x222f[_0x447af3];return _0x202e95;};'use strict';var _=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var moment=require(_0xf222('0x2'));var BPromise=require(_0xf222('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf222('0x4'))['db'];var utils=require(_0xf222('0x5'));var logger=require(_0xf222('0x6'))(_0xf222('0x7'));var config=require('../../config/environment');var jayson=require(_0xf222('0x8'));var client=jayson['client'][_0xf222('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26f129,_0x518ebb,_0xf5a105){return new BPromise(function(_0x302d7a,_0x4aceb4){return client[_0xf222('0xa')](_0x26f129,_0xf5a105)[_0xf222('0xb')](function(_0x878804){logger[_0xf222('0xc')](_0xf222('0xd'),_0x518ebb,_0xf222('0xe'));logger['debug'](_0xf222('0xf'),_0x518ebb,_0xf222('0xe'),JSON[_0xf222('0x10')](_0x878804));if(_0x878804[_0xf222('0x11')]){if(_0x878804['error'][_0xf222('0x12')]===0x1f4){logger[_0xf222('0x11')](_0xf222('0xd'),_0x518ebb,_0x878804[_0xf222('0x11')][_0xf222('0x13')]);return _0x4aceb4(_0x878804[_0xf222('0x11')][_0xf222('0x13')]);}logger[_0xf222('0x11')]('Tag,\x20%s,\x20%s',_0x518ebb,_0x878804['error'][_0xf222('0x13')]);return _0x302d7a(_0x878804[_0xf222('0x11')]['message']);}else{logger[_0xf222('0xc')](_0xf222('0xd'),_0x518ebb,_0xf222('0xe'));_0x302d7a(_0x878804[_0xf222('0x14')][_0xf222('0x13')]);}})[_0xf222('0x15')](function(_0x30b646){logger['error'](_0xf222('0xd'),_0x518ebb,_0x30b646);_0x4aceb4(_0x30b646);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index a15b61b..cd477c1 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 53b6794..8b84c2d 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(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'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 _0xb10b=['name','sequelize','STRING'];(function(_0x507611,_0xe4dee2){var _0x2c6d1a=function(_0x590a3b){while(--_0x590a3b){_0x507611['push'](_0x507611['shift']());}};_0x2c6d1a(++_0xe4dee2);}(_0xb10b,0x12a));var _0xbb10=function(_0x49fffd,_0x534844){_0x49fffd=_0x49fffd-0x0;var _0x4c90ed=_0xb10b[_0x49fffd];return _0x4c90ed;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index b7e3d69..ec1add5 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 _0x268b=['UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','send','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','Queue','sort','capitalize','Queues','addQueues','findOne','add','removeQueues','remove','ids','addAgents','isArray','Voice','Chat','Mail','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','emit','Queue:save','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','removeAgents','Sms','Queue:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','index','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','Team','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','destroy','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x268b,0x159));var _0xb268=function(_0x5465e6,_0x2a8809){_0x5465e6=_0x5465e6-0x0;var _0x10044e=_0x268b[_0x5465e6];return _0x10044e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb268('0x0'));var jsonpatch=require(_0xb268('0x1'));var rp=require(_0xb268('0x2'));var moment=require(_0xb268('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb268('0x4'));var util=require('util');var path=require('path');var sox=require(_0xb268('0x5'));var csv=require(_0xb268('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb268('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb268('0x8'));var toCsv=require(_0xb268('0x6'));var querystring=require('querystring');var Papa=require(_0xb268('0x9'));var Redis=require(_0xb268('0xa'));var authService=require(_0xb268('0xb'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb268('0xc'));var logger=require(_0xb268('0xd'))(_0xb268('0xe'));var utils=require(_0xb268('0xf'));var config=require(_0xb268('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xb268('0x11'))['db'];config[_0xb268('0x12')]=_[_0xb268('0x13')](config[_0xb268('0x12')],{'host':_0xb268('0x14'),'port':0x18eb});var socket=require(_0xb268('0x15'))(new Redis(config[_0xb268('0x12')]));require(_0xb268('0x16'))[_0xb268('0x17')](socket);function respondWithStatusCode(_0x2ae007,_0x27d3d0){_0x27d3d0=_0x27d3d0||0xcc;return function(_0x30caba){if(_0x30caba){return _0x2ae007['sendStatus'](_0x27d3d0);}return _0x2ae007[_0xb268('0x18')](_0x27d3d0)['end']();};}function respondWithResult(_0x20434e,_0x4a539d){_0x4a539d=_0x4a539d||0xc8;return function(_0x38adf0){if(_0x38adf0){return _0x20434e[_0xb268('0x18')](_0x4a539d)[_0xb268('0x19')](_0x38adf0);}};}function respondWithFilteredResult(_0x1ae3ba,_0x1e6bc9){return function(_0x1647c6){if(_0x1647c6){var _0x4954f8=typeof _0x1e6bc9['offset']===_0xb268('0x1a')&&typeof _0x1e6bc9[_0xb268('0x1b')]==='undefined';var _0x449cf0=_0x1647c6[_0xb268('0x1c')];var _0x1e931b=_0x4954f8?0x0:_0x1e6bc9[_0xb268('0x1d')];var _0x3c53a7=_0x4954f8?_0x1647c6[_0xb268('0x1c')]:_0x1e6bc9[_0xb268('0x1d')]+_0x1e6bc9[_0xb268('0x1b')];var _0x124931;if(_0x3c53a7>=_0x449cf0){_0x3c53a7=_0x449cf0;_0x124931=0xc8;}else{_0x124931=0xce;}_0x1ae3ba[_0xb268('0x18')](_0x124931);return _0x1ae3ba[_0xb268('0x1e')](_0xb268('0x1f'),_0x1e931b+'-'+_0x3c53a7+'/'+_0x449cf0)[_0xb268('0x19')](_0x1647c6);}return null;};}function patchUpdates(_0x5cdbdb){return function(_0x3d2b22){try{jsonpatch[_0xb268('0x20')](_0x3d2b22,_0x5cdbdb,!![]);}catch(_0x1ac88b){return BPromise[_0xb268('0x21')](_0x1ac88b);}return _0x3d2b22[_0xb268('0x22')]();};}function saveUpdates(_0xd6bc6c,_0x5cd0b3){return function(_0x1a0ae5){if(_0x1a0ae5){return _0x1a0ae5['update'](_0xd6bc6c)[_0xb268('0x23')](function(_0xc4a568){return _0xc4a568;});}return null;};}function handleEntityNotFound(_0x3f3610,_0x59f156){return function(_0x3bb30b){if(!_0x3bb30b){_0x3f3610[_0xb268('0x24')](0x194);}return _0x3bb30b;};}function handleError(_0x5847a6,_0x3ea6dd){_0x3ea6dd=_0x3ea6dd||0x1f4;return function(_0x42f404){logger[_0xb268('0x25')](_0x42f404[_0xb268('0x26')]);if(_0x42f404[_0xb268('0x27')]){delete _0x42f404[_0xb268('0x27')];}_0x5847a6[_0xb268('0x18')](_0x3ea6dd)['send'](_0x42f404);};}exports[_0xb268('0x28')]=function(_0x52db18,_0x39dd93){var _0x497e97={},_0x3a4773={},_0x4866d9={'count':0x0,'rows':[]};var _0x1b5cbc=_['map'](db['Team'][_0xb268('0x29')],function(_0x1422d7){return{'name':_0x1422d7['fieldName'],'type':_0x1422d7[_0xb268('0x2a')]['key']};});_0x3a4773[_0xb268('0x2b')]=_[_0xb268('0x2c')](_0x1b5cbc,_0xb268('0x27'));_0x3a4773[_0xb268('0x2d')]=_[_0xb268('0x2e')](_0x52db18[_0xb268('0x2d')]);_0x3a4773[_0xb268('0x2f')]=_[_0xb268('0x30')](_0x3a4773[_0xb268('0x2b')],_0x3a4773['query']);_0x497e97[_0xb268('0x31')]=_[_0xb268('0x30')](_0x3a4773[_0xb268('0x2b')],qs[_0xb268('0x32')](_0x52db18[_0xb268('0x2d')]['fields']));_0x497e97[_0xb268('0x31')]=_0x497e97[_0xb268('0x31')][_0xb268('0x33')]?_0x497e97[_0xb268('0x31')]:_0x3a4773[_0xb268('0x2b')];if(!_0x52db18[_0xb268('0x2d')][_0xb268('0x34')](_0xb268('0x35'))){_0x497e97[_0xb268('0x1b')]=qs[_0xb268('0x1b')](_0x52db18[_0xb268('0x2d')][_0xb268('0x1b')]);_0x497e97[_0xb268('0x1d')]=qs[_0xb268('0x1d')](_0x52db18['query'][_0xb268('0x1d')]);}_0x497e97[_0xb268('0x36')]=qs['sort'](_0x52db18['query']['sort']);_0x497e97[_0xb268('0x37')]=qs[_0xb268('0x2f')](_[_0xb268('0x38')](_0x52db18[_0xb268('0x2d')],_0x3a4773[_0xb268('0x2f')]),_0x1b5cbc);if(_0x52db18[_0xb268('0x2d')][_0xb268('0x39')]){_0x497e97[_0xb268('0x37')]=_[_0xb268('0x3a')](_0x497e97[_0xb268('0x37')],{'$or':_[_0xb268('0x2c')](_0x1b5cbc,function(_0x10f28b){if(_0x10f28b['type']!=='VIRTUAL'){var _0x246c52={};_0x246c52[_0x10f28b[_0xb268('0x27')]]={'$like':'%'+_0x52db18['query']['filter']+'%'};return _0x246c52;}})});}_0x497e97=_[_0xb268('0x3a')]({},_0x497e97,_0x52db18[_0xb268('0x3b')]);var _0x4d2e63={'where':_0x497e97['where']};return db[_0xb268('0x3c')][_0xb268('0x1c')](_0x4d2e63)[_0xb268('0x23')](function(_0x4f5be4){_0x4866d9[_0xb268('0x1c')]=_0x4f5be4;if(_0x52db18['query'][_0xb268('0x3d')]){_0x497e97[_0xb268('0x3e')]=[{'all':!![]}];}return db[_0xb268('0x3c')][_0xb268('0x3f')](_0x497e97);})[_0xb268('0x23')](function(_0x16cffc){_0x4866d9[_0xb268('0x40')]=_0x16cffc;return _0x4866d9;})[_0xb268('0x23')](respondWithFilteredResult(_0x39dd93,_0x497e97))[_0xb268('0x41')](handleError(_0x39dd93,null));};exports[_0xb268('0x42')]=function(_0x5804bd,_0x47116b){var _0x1caa5d={'raw':![],'where':{'id':_0x5804bd[_0xb268('0x43')]['id']}},_0x2179a8={};_0x2179a8['model']=_[_0xb268('0x2e')](db[_0xb268('0x3c')][_0xb268('0x29')]);_0x2179a8[_0xb268('0x2d')]=_[_0xb268('0x2e')](_0x5804bd['query']);_0x2179a8[_0xb268('0x2f')]=_[_0xb268('0x30')](_0x2179a8[_0xb268('0x2b')],_0x2179a8[_0xb268('0x2d')]);_0x1caa5d[_0xb268('0x31')]=_[_0xb268('0x30')](_0x2179a8['model'],qs['fields'](_0x5804bd[_0xb268('0x2d')]['fields']));_0x1caa5d['attributes']=_0x1caa5d[_0xb268('0x31')][_0xb268('0x33')]?_0x1caa5d[_0xb268('0x31')]:_0x2179a8[_0xb268('0x2b')];if(_0x5804bd['query']['includeAll']){_0x1caa5d[_0xb268('0x3e')]=[{'all':!![]}];}_0x1caa5d=_[_0xb268('0x3a')]({},_0x1caa5d,_0x5804bd[_0xb268('0x3b')]);return db[_0xb268('0x3c')][_0xb268('0x44')](_0x1caa5d)[_0xb268('0x23')](handleEntityNotFound(_0x47116b,null))[_0xb268('0x23')](respondWithResult(_0x47116b,null))[_0xb268('0x41')](handleError(_0x47116b,null));};exports['create']=function(_0x9e474,_0x1969e8){return db[_0xb268('0x3c')][_0xb268('0x45')](_0x9e474[_0xb268('0x46')],{})['then'](function(_0xb18e82){var _0x567a60=_0x9e474[_0xb268('0x47')][_0xb268('0x48')]({'plain':!![]});if(!_0x567a60)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x567a60['role']===_0xb268('0x47')){var _0x813fcc=_0xb18e82['get']({'plain':!![]});var _0x5d54bd=_0xb268('0x49');return db[_0xb268('0x4a')]['find']({'where':{'name':_0x5d54bd,'userProfileId':_0x567a60[_0xb268('0x4b')]},'raw':!![]})[_0xb268('0x23')](function(_0x188d26){if(_0x188d26&&_0x188d26[_0xb268('0x4c')]===0x0){return db['UserProfileResource'][_0xb268('0x45')]({'name':_0x813fcc[_0xb268('0x27')],'resourceId':_0x813fcc['id'],'type':_0x188d26[_0xb268('0x27')],'sectionId':_0x188d26['id']},{})[_0xb268('0x23')](function(){return _0xb18e82;});}else{return _0xb18e82;}})['catch'](function(_0x23f820){logger[_0xb268('0x25')](_0xb268('0x4d'),_0x23f820);throw _0x23f820;});}return _0xb18e82;})[_0xb268('0x23')](respondWithResult(_0x1969e8,0xc9))['catch'](handleError(_0x1969e8,null));};exports[_0xb268('0x4e')]=function(_0x7f6350,_0x35fd37){if(_0x7f6350[_0xb268('0x46')]['id']){delete _0x7f6350[_0xb268('0x46')]['id'];}return db[_0xb268('0x3c')][_0xb268('0x44')]({'where':{'id':_0x7f6350[_0xb268('0x43')]['id']}})[_0xb268('0x23')](handleEntityNotFound(_0x35fd37,null))['then'](saveUpdates(_0x7f6350['body'],null))['then'](respondWithResult(_0x35fd37,null))[_0xb268('0x41')](handleError(_0x35fd37,null));};exports['destroy']=function(_0x31bfc7,_0x2ea6c7){var _0x161533=_0x31bfc7[_0xb268('0x43')]['id'];var _0x5a48b4=[];return db[_0xb268('0x4f')][_0xb268('0x50')](function(_0x4cc6a4){var _0x17a5cc=_0xb268('0x51')+_0x161533;return db[_0xb268('0x4f')]['query'](_0x17a5cc,{'type':db[_0xb268('0x52')][_0xb268('0x53')][_0xb268('0x54')],'raw':!![],'transaction':_0x4cc6a4})['then'](function(_0x4ccf66){_0x5a48b4=_['map'](_0x4ccf66,function(_0x2bc07b){return Number(_0x2bc07b[_0xb268('0x55')]);});})[_0xb268('0x23')](function(){var _0x102b6e=_0xb268('0x56')+_0x161533;return db[_0xb268('0x4f')][_0xb268('0x2d')](_0x102b6e,{'type':db[_0xb268('0x52')]['QueryTypes'][_0xb268('0x54')],'raw':!![],'transaction':_0x4cc6a4});})['then'](function(_0x7449f9){var _0x298636=_[_0xb268('0x2c')](_0x7449f9,function(_0x1858fa){return Number(_0x1858fa[_0xb268('0x57')]);});return db['UserVoiceQueue'][_0xb268('0x58')]({'where':{'UserId':{'$in':_0x5a48b4},'VoiceQueueId':{'$in':_0x298636}},'transaction':_0x4cc6a4});})['then'](function(){var _0xca38bb='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x161533;return db[_0xb268('0x4f')][_0xb268('0x2d')](_0xca38bb,{'type':db['Sequelize'][_0xb268('0x53')][_0xb268('0x54')],'raw':!![],'transaction':_0x4cc6a4});})[_0xb268('0x23')](function(_0x259879){var _0x36773b=_['map'](_0x259879,function(_0x1034d8){return Number(_0x1034d8['MailQueueId']);});return db['UserMailQueue'][_0xb268('0x58')]({'where':{'UserId':{'$in':_0x5a48b4},'MailQueueId':{'$in':_0x36773b}},'transaction':_0x4cc6a4});})[_0xb268('0x23')](function(){var _0x26da22='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x161533;return db[_0xb268('0x4f')][_0xb268('0x2d')](_0x26da22,{'type':db[_0xb268('0x52')][_0xb268('0x53')][_0xb268('0x54')],'raw':!![],'transaction':_0x4cc6a4});})[_0xb268('0x23')](function(_0x18a6b0){var _0x439314=_[_0xb268('0x2c')](_0x18a6b0,function(_0x18891d){return Number(_0x18891d[_0xb268('0x59')]);});return db[_0xb268('0x5a')][_0xb268('0x58')]({'where':{'UserId':{'$in':_0x5a48b4},'SmsQueueId':{'$in':_0x439314}},'transaction':_0x4cc6a4});})[_0xb268('0x23')](function(){var _0x315847=_0xb268('0x5b')+_0x161533;return db[_0xb268('0x4f')][_0xb268('0x2d')](_0x315847,{'type':db['Sequelize']['QueryTypes'][_0xb268('0x54')],'raw':!![],'transaction':_0x4cc6a4});})['then'](function(_0x4371e9){var _0x282e82=_['map'](_0x4371e9,function(_0x4787fb){return Number(_0x4787fb['ChatQueueId']);});return db[_0xb268('0x5c')][_0xb268('0x58')]({'where':{'UserId':{'$in':_0x5a48b4},'ChatQueueId':{'$in':_0x282e82}},'transaction':_0x4cc6a4});})[_0xb268('0x23')](function(){var _0x52825a='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x161533;return db[_0xb268('0x4f')]['query'](_0x52825a,{'type':db[_0xb268('0x52')][_0xb268('0x53')][_0xb268('0x54')],'raw':!![],'transaction':_0x4cc6a4});})[_0xb268('0x23')](function(_0x6b4f2a){var _0x5ee40f=_['map'](_0x6b4f2a,function(_0x3d7e00){return Number(_0x3d7e00[_0xb268('0x5d')]);});return db[_0xb268('0x5e')][_0xb268('0x58')]({'where':{'UserId':{'$in':_0x5a48b4},'FaxQueueId':{'$in':_0x5ee40f}},'transaction':_0x4cc6a4});})['then'](function(){var _0x1547b1=_0xb268('0x5f')+_0x161533;return db[_0xb268('0x4f')][_0xb268('0x2d')](_0x1547b1,{'type':db[_0xb268('0x52')][_0xb268('0x53')]['SELECT'],'raw':!![],'transaction':_0x4cc6a4});})[_0xb268('0x23')](function(_0x582cdd){var _0x46f090=_[_0xb268('0x2c')](_0x582cdd,function(_0x415695){return Number(_0x415695[_0xb268('0x60')]);});return db['UserOpenchannelQueue'][_0xb268('0x58')]({'where':{'UserId':{'$in':_0x5a48b4},'OpenchannelQueueId':{'$in':_0x46f090}},'transaction':_0x4cc6a4});})['then'](function(){var _0x5cc974=_0xb268('0x61')+_0x161533;return db[_0xb268('0x4f')][_0xb268('0x2d')](_0x5cc974,{'type':db[_0xb268('0x52')][_0xb268('0x53')]['SELECT'],'raw':!![],'transaction':_0x4cc6a4});})[_0xb268('0x23')](function(_0x508b46){var _0x1c45d7=_[_0xb268('0x2c')](_0x508b46,function(_0x5e0c33){return Number(_0x5e0c33[_0xb268('0x62')]);});return db[_0xb268('0x63')][_0xb268('0x58')]({'where':{'UserId':{'$in':_0x5a48b4},'WhatsappQueueId':{'$in':_0x1c45d7}},'transaction':_0x4cc6a4});})[_0xb268('0x23')](function(){return db[_0xb268('0x64')][_0xb268('0x44')]({'where':{'TeamId':_0x161533}});})[_0xb268('0x23')](function(_0x4dc195){if(_0x4dc195===null){return;}return db[_0xb268('0x65')][_0xb268('0x58')]({'where':{'UserId':{'$in':_0x5a48b4},'VoicePrefixId':_0x4dc195[_0xb268('0x66')]},'transaction':_0x4cc6a4});})[_0xb268('0x23')](function(){return db[_0xb268('0x3c')][_0xb268('0x58')]({'where':{'id':_0x161533},'cascade':!![],'transaction':_0x4cc6a4});})[_0xb268('0x23')](function(_0x223f75){if(_0x223f75===0x0){_0x2ea6c7[_0xb268('0x24')](0x194);}else{return db['UserProfileResource'][_0xb268('0x58')]({'where':{'type':_0xb268('0x49'),'resourceId':_0x161533},'cascade':!![],'transaction':_0x4cc6a4})[_0xb268('0x23')](function(){_0x2ea6c7[_0xb268('0x18')](0xcc)['end']();});}})[_0xb268('0x41')](function(_0x262b58){_0x2ea6c7['status'](0x1f4)[_0xb268('0x67')](_0x262b58);});});};exports[_0xb268('0x68')]=function(_0x49ca68,_0x1a2c8c,_0x595705){return db[_0xb268('0x3c')]['findOne']({'where':{'id':_0x49ca68[_0xb268('0x43')]['id']}})['then'](handleEntityNotFound(_0x1a2c8c,null))[_0xb268('0x23')](function(_0x57eeb7){if(!_0x49ca68[_0xb268('0x2d')][_0xb268('0x69')]||!utils[_0xb268('0x6a')](_0x49ca68[_0xb268('0x2d')][_0xb268('0x69')])){throw new db[(_0xb268('0x52'))][(_0xb268('0x6b'))](_0xb268('0x6c'));}var _0x144752={};var _0x1ee4f9={};_0x1ee4f9['model']=_[_0xb268('0x2e')](db[_['capitalize'](_0x49ca68[_0xb268('0x2d')][_0xb268('0x69')][_0xb268('0x6d')]())+_0xb268('0x6e')]['rawAttributes']);_0x1ee4f9[_0xb268('0x2d')]=_[_0xb268('0x2e')](_0x49ca68[_0xb268('0x2d')]);_0x1ee4f9[_0xb268('0x2f')]=_['intersection'](_0x1ee4f9['model'],_0x1ee4f9['query']);_0x144752[_0xb268('0x31')]=_[_0xb268('0x30')](_0x1ee4f9[_0xb268('0x2b')],qs['fields'](_0x49ca68[_0xb268('0x2d')][_0xb268('0x32')]));_0x144752[_0xb268('0x31')]=_0x144752[_0xb268('0x31')]['length']?_0x144752[_0xb268('0x31')]:_0x1ee4f9[_0xb268('0x2b')];_0x144752['limit']=qs['limit'](_0x49ca68['query']['limit']);_0x144752[_0xb268('0x1d')]=qs[_0xb268('0x1d')](_0x49ca68[_0xb268('0x2d')]['offset']);_0x144752[_0xb268('0x36')]=qs[_0xb268('0x6f')](_0x49ca68[_0xb268('0x2d')][_0xb268('0x6f')]);_0x144752[_0xb268('0x37')]=qs['filters'](_[_0xb268('0x38')](_0x49ca68[_0xb268('0x2d')],_0x1ee4f9['filters']));_0x144752=_[_0xb268('0x3a')]({},_0x144752,_0x49ca68[_0xb268('0x3b')]);return _0x57eeb7[_0xb268('0x48')+_[_0xb268('0x70')](_0x49ca68[_0xb268('0x2d')][_0xb268('0x69')][_0xb268('0x6d')]())+_0xb268('0x71')](_0x144752);})[_0xb268('0x23')](respondWithResult(_0x1a2c8c,null))[_0xb268('0x41')](handleError(_0x1a2c8c,null));};exports[_0xb268('0x72')]=function(_0x561ada,_0x2d2b06,_0x21d989){return db[_0xb268('0x3c')][_0xb268('0x73')]({'where':{'id':_0x561ada['params']['id']}})[_0xb268('0x23')](function(_0x27349d){if(_0x27349d){if(!_0x561ada[_0xb268('0x46')][_0xb268('0x69')]||!utils[_0xb268('0x6a')](_0x561ada[_0xb268('0x46')]['channel'])){throw new db[(_0xb268('0x52'))][(_0xb268('0x6b'))](_0xb268('0x6c'));}return _0x27349d[_0xb268('0x74')+_[_0xb268('0x70')](_0x561ada[_0xb268('0x46')][_0xb268('0x69')][_0xb268('0x6d')]())+_0xb268('0x71')](_0x561ada[_0xb268('0x46')]['ids']);}return null;})['then'](handleEntityNotFound(_0x2d2b06,null))[_0xb268('0x23')](respondWithStatusCode(_0x2d2b06,null))[_0xb268('0x41')](handleError(_0x2d2b06,null));};exports[_0xb268('0x75')]=function(_0x34fad4,_0x11ac5a,_0x464c10){return db[_0xb268('0x3c')][_0xb268('0x73')]({'where':{'id':_0x34fad4[_0xb268('0x43')]['id']}})[_0xb268('0x23')](function(_0x638934){if(_0x638934){if(!_0x34fad4[_0xb268('0x2d')][_0xb268('0x69')]||!utils[_0xb268('0x6a')](_0x34fad4['query'][_0xb268('0x69')])){throw new db[(_0xb268('0x52'))][(_0xb268('0x6b'))]('Unknown\x20channel');}return _0x638934[_0xb268('0x76')+_[_0xb268('0x70')](_0x34fad4[_0xb268('0x2d')][_0xb268('0x69')][_0xb268('0x6d')]())+_0xb268('0x71')](_0x34fad4['query'][_0xb268('0x77')]);}return null;})[_0xb268('0x23')](handleEntityNotFound(_0x11ac5a,null))[_0xb268('0x23')](respondWithStatusCode(_0x11ac5a,null))[_0xb268('0x41')](handleError(_0x11ac5a,null));};exports[_0xb268('0x78')]=function(_0x399cc8,_0x531175){var _0x685a2b=_[_0xb268('0x79')](_0x399cc8[_0xb268('0x46')]['ids'])?_0x399cc8[_0xb268('0x46')][_0xb268('0x77')]:[_0x399cc8[_0xb268('0x46')]['ids']];var _0xd6bd77=_0x399cc8[_0xb268('0x43')]['id'];return db[_0xb268('0x3c')][_0xb268('0x44')]({'where':{'id':_0xd6bd77}})[_0xb268('0x23')](handleEntityNotFound(_0x531175,null))[_0xb268('0x23')](function(_0x113138){if(_0x113138){var _0x5a7879=[_0xb268('0x7a'),_0xb268('0x7b'),_0xb268('0x7c'),'Sms',_0xb268('0x7d'),_0xb268('0x7e'),_0xb268('0x7f')];return db[_0xb268('0x4f')][_0xb268('0x50')](function(_0x866068){var _0xf93281=_['map'](_0x5a7879,function(_0x42fd82){var _0x2aa96d={'attributes':['id','name']};if(_0x42fd82===_0xb268('0x7a')){_0x2aa96d[_0xb268('0x80')]={'attributes':[_0xb268('0x81')]};}return _0x113138[_0xb268('0x48')+_0x42fd82+_0xb268('0x71')](_0x2aa96d)['then'](function(_0x3f8539){var _0x1c79ff=_[_0xb268('0x2c')](_0x3f8539,function(_0x38631f){var _0x3d6995=_[_0xb268('0x2c')](_0x685a2b,function(_0x34b05d){var _0x207d64={'where':{'UserId':_0x34b05d,[_0x42fd82+_0xb268('0x82')]:_0x38631f['id']},'transaction':_0x866068};if(_0x42fd82===_0xb268('0x7a')){_0x207d64['defaults']={'penalty':_0x38631f[_0xb268('0x83')][_0xb268('0x81')]};}return db['User'+_0x42fd82+_0xb268('0x6e')]['findOrCreate'](_0x207d64)[_0xb268('0x23')](function(){socket[_0xb268('0x84')](_0xb268('0x47')+_0x42fd82+_0xb268('0x85'),{'UserId':_0x34b05d,[_0x42fd82+_0xb268('0x82')]:_0x38631f['id']});if(_0x42fd82!=='Voice'){return;}return db[_0xb268('0x86')][_0xb268('0x3f')]({'where':{'id':_0x685a2b,'online':0x1},'attributes':['id','name',_0xb268('0x87'),_0xb268('0x88'),_0xb268('0x89')],'raw':!![]})[_0xb268('0x23')](function(_0x2765ab){var _0x2c8c01=_[_0xb268('0x2c')](_0x2765ab,function(_0x4921b4){return db[_0xb268('0x8a')][_0xb268('0x8b')]({'membername':_0x4921b4[_0xb268('0x27')],'UserId':_0x4921b4['id'],'queue_name':_0x38631f[_0xb268('0x27')],'VoiceQueueId':_0x38631f['id'],'interface':_[_0xb268('0x8c')](_0x4921b4[_0xb268('0x89')])?util[_0xb268('0x8d')](_0xb268('0x8e'),_0x4921b4['name']):_0x4921b4[_0xb268('0x89')],'paused':_0x4921b4['voicePause']||![],'penalty':_0x38631f[_0xb268('0x83')][_0xb268('0x81')]},{'transaction':_0x866068});});return Promise[_0xb268('0x8f')](_0x2c8c01);});});});return Promise[_0xb268('0x8f')](_0x3d6995);});return Promise['all'](_0x1c79ff);})[_0xb268('0x23')](function(){return db[_0xb268('0x64')][_0xb268('0x73')]({'where':{'teamId':_0xd6bd77}})[_0xb268('0x23')](function(_0x5629ba){if(_0x5629ba){var _0x212553=_[_0xb268('0x2c')](_0x685a2b,function(_0x3c0334){db[_0xb268('0x65')][_0xb268('0x8b')]({'UserId':_0x3c0334,'VoicePrefixId':_0x5629ba[_0xb268('0x66')]});});return Promise[_0xb268('0x8f')](_0x212553);}});});});return Promise[_0xb268('0x8f')](_0xf93281)['then'](function(){return _0x113138['addAgents'](_0x685a2b,{'transaction':_0x866068})['spread'](function(_0x36f1be){return _0x36f1be;});});});}})[_0xb268('0x23')](respondWithResult(_0x531175,null))[_0xb268('0x41')](handleError(_0x531175,null));};exports[_0xb268('0x90')]=function(_0x147305,_0x25c772){var _0xe03efc=_['isArray'](_0x147305[_0xb268('0x2d')][_0xb268('0x77')])?_0x147305['query'][_0xb268('0x77')]:[_0x147305[_0xb268('0x2d')][_0xb268('0x77')]];var _0x151e71=_0x147305['params']['id'];return db['Team']['find']({'where':{'id':_0x151e71}})[_0xb268('0x23')](handleEntityNotFound(_0x25c772,null))[_0xb268('0x23')](function(_0x5936f8){if(_0x5936f8){var _0xa6442e=['Voice',_0xb268('0x7b'),_0xb268('0x7c'),_0xb268('0x91'),'Fax',_0xb268('0x7e'),_0xb268('0x7f')];return db[_0xb268('0x4f')][_0xb268('0x50')](function(_0x491933){var _0x49703f=_['map'](_0xa6442e,function(_0x1a7c54){var _0x444d47={'attributes':['id',_0xb268('0x27')]};return _0x5936f8[_0xb268('0x48')+_0x1a7c54+_0xb268('0x71')](_0x444d47)[_0xb268('0x23')](function(_0x4602a8){var _0x31f94e=_['map'](_0x4602a8,function(_0x1ef4ab){return _0x1ef4ab[_0xb268('0x90')](_0xe03efc,{'transaction':_0x491933})[_0xb268('0x23')](function(){var _0x5176a7=_[_0xb268('0x2c')](_0xe03efc,function(_0x4a9256){socket[_0xb268('0x84')](_0xb268('0x47')+_0x1a7c54+_0xb268('0x92'),{'UserId':Number(_0x4a9256),[_0x1a7c54+_0xb268('0x82')]:_0x1ef4ab['id']});if(_0x1a7c54!==_0xb268('0x7a')){return;}return db[_0xb268('0x8a')]['destroy']({'where':{'VoiceQueueId':_0x1ef4ab['id'],'UserId':_0x4a9256},'transaction':_0x491933});});return Promise[_0xb268('0x8f')](_0x5176a7);});});return Promise['all'](_0x31f94e);});});return Promise['all'](_0x49703f)[_0xb268('0x23')](function(){return _0x5936f8[_0xb268('0x90')](_0xe03efc,{'transaction':_0x491933});})[_0xb268('0x23')](function(){return db[_0xb268('0x64')][_0xb268('0x73')]({'where':{'teamId':_0x151e71}})[_0xb268('0x23')](function(_0x4870e0){if(_0x4870e0){var _0x1ef97c=_['map'](_0xe03efc,function(_0x3a5793){db[_0xb268('0x65')][_0xb268('0x58')]({'where':{'UserId':_0x3a5793,'VoicePrefixId':_0x4870e0[_0xb268('0x66')]}});});return Promise[_0xb268('0x8f')](_0x1ef97c);}});});});}})['then'](respondWithStatusCode(_0x25c772,null))['catch'](handleError(_0x25c772,null));};exports[_0xb268('0x93')]=function(_0x22e286,_0xad937e,_0x4a05cc){var _0x59e1a4={};var _0x3c13d0={};var _0x2c19a9;var _0x54057e;return db['Team']['findOne']({'where':{'id':_0x22e286['params']['id']}})[_0xb268('0x23')](handleEntityNotFound(_0xad937e,null))['then'](function(_0x656d54){if(_0x656d54){_0x2c19a9=_0x656d54;_0x3c13d0['model']=_['keys'](db[_0xb268('0x86')][_0xb268('0x29')]);_0x3c13d0[_0xb268('0x2d')]=_[_0xb268('0x2e')](_0x22e286['query']);_0x3c13d0[_0xb268('0x2f')]=_[_0xb268('0x30')](_0x3c13d0[_0xb268('0x2b')],_0x3c13d0[_0xb268('0x2d')]);_0x59e1a4[_0xb268('0x31')]=_[_0xb268('0x30')](_0x3c13d0[_0xb268('0x2b')],qs['fields'](_0x22e286[_0xb268('0x2d')][_0xb268('0x32')]));_0x59e1a4[_0xb268('0x31')]=_0x59e1a4[_0xb268('0x31')][_0xb268('0x33')]?_0x59e1a4[_0xb268('0x31')]:_0x3c13d0[_0xb268('0x2b')];_0x59e1a4['order']=qs[_0xb268('0x6f')](_0x22e286['query']['sort']);_0x59e1a4['where']=qs['filters'](_[_0xb268('0x38')](_0x22e286[_0xb268('0x2d')],_0x3c13d0['filters']));if(_0x22e286[_0xb268('0x2d')]['filter']){_0x59e1a4[_0xb268('0x37')]=_['merge'](_0x59e1a4[_0xb268('0x37')],{'$or':_[_0xb268('0x2c')](_0x59e1a4[_0xb268('0x31')],function(_0x498570){var _0x4c2335={};_0x4c2335[_0x498570]={'$like':'%'+_0x22e286['query']['filter']+'%'};return _0x4c2335;})});}_0x59e1a4=_[_0xb268('0x3a')]({},_0x59e1a4,_0x22e286[_0xb268('0x3b')]);return _0x2c19a9[_0xb268('0x93')](_0x59e1a4);}})[_0xb268('0x23')](function(_0x441325){if(_0x441325){_0x54057e=_0x441325[_0xb268('0x33')];if(!_0x22e286[_0xb268('0x2d')]['hasOwnProperty'](_0xb268('0x35'))){_0x59e1a4[_0xb268('0x1b')]=qs[_0xb268('0x1b')](_0x22e286['query'][_0xb268('0x1b')]);_0x59e1a4['offset']=qs[_0xb268('0x1d')](_0x22e286[_0xb268('0x2d')][_0xb268('0x1d')]);}return _0x2c19a9[_0xb268('0x93')](_0x59e1a4);}})[_0xb268('0x23')](function(_0xa94574){if(_0xa94574){return _0xa94574?{'count':_0x54057e,'rows':_0xa94574}:null;}})['then'](respondWithResult(_0xad937e,null))['catch'](handleError(_0xad937e,null));}; \ No newline at end of file +var _0x30b8=['QueryTypes','SELECT','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','Queue','pick','capitalize','Queues','addQueues','add','removeQueues','findOne','remove','ids','addAgents','isArray','Voice','Mail','Sms','Fax','Openchannel','Whatsapp','through','QueueId','defaults','TeamVoiceQueue','penalty','findOrCreate','emit','Queue:save','online','interface','upsert','isNil','format','SIP/%s','voicePause','all','removeAgents','Chat','Queue:remove','UserVoiceQueueRt','getAgents','User','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','register','sendStatus','end','status','json','offset','limit','count','set','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','include','Team','findAll','rows','catch','params','length','includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'];(function(_0x414f45,_0x1ee7d3){var _0x3bc907=function(_0x2e22de){while(--_0x2e22de){_0x414f45['push'](_0x414f45['shift']());}};_0x3bc907(++_0x1ee7d3);}(_0x30b8,0x171));var _0x830b=function(_0x395606,_0x3c10c5){_0x395606=_0x395606-0x0;var _0x100b56=_0x30b8[_0x395606];return _0x100b56;};'use strict';var emlformat=require(_0x830b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x830b('0x1'));var jsonpatch=require(_0x830b('0x2'));var rp=require(_0x830b('0x3'));var moment=require('moment');var BPromise=require(_0x830b('0x4'));var Mustache=require(_0x830b('0x5'));var util=require(_0x830b('0x6'));var path=require('path');var sox=require(_0x830b('0x7'));var csv=require('to-csv');var ejs=require(_0x830b('0x8'));var fs=require('fs');var fs_extra=require(_0x830b('0x9'));var _=require(_0x830b('0xa'));var squel=require(_0x830b('0xb'));var crypto=require('crypto');var jsforce=require(_0x830b('0xc'));var deskjs=require(_0x830b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x830b('0xe'));var Papa=require(_0x830b('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(_0x830b('0x10'));var logger=require(_0x830b('0x11'))(_0x830b('0x12'));var utils=require(_0x830b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x830b('0x14'));var db=require(_0x830b('0x15'))['db'];config[_0x830b('0x16')]=_['defaults'](config[_0x830b('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x830b('0x16')]));require('./team.socket')[_0x830b('0x17')](socket);function respondWithStatusCode(_0x25484e,_0xa4c26){_0xa4c26=_0xa4c26||0xcc;return function(_0x2669f4){if(_0x2669f4){return _0x25484e[_0x830b('0x18')](_0xa4c26);}return _0x25484e['status'](_0xa4c26)[_0x830b('0x19')]();};}function respondWithResult(_0xa94bc3,_0x3e2bd6){_0x3e2bd6=_0x3e2bd6||0xc8;return function(_0x3576b6){if(_0x3576b6){return _0xa94bc3[_0x830b('0x1a')](_0x3e2bd6)[_0x830b('0x1b')](_0x3576b6);}};}function respondWithFilteredResult(_0x15039b,_0xd3b27f){return function(_0x2c6715){if(_0x2c6715){var _0x4a9a95=typeof _0xd3b27f[_0x830b('0x1c')]==='undefined'&&typeof _0xd3b27f[_0x830b('0x1d')]==='undefined';var _0x42ab16=_0x2c6715[_0x830b('0x1e')];var _0x324ad1=_0x4a9a95?0x0:_0xd3b27f[_0x830b('0x1c')];var _0xc1f889=_0x4a9a95?_0x2c6715['count']:_0xd3b27f[_0x830b('0x1c')]+_0xd3b27f[_0x830b('0x1d')];var _0x503b6f;if(_0xc1f889>=_0x42ab16){_0xc1f889=_0x42ab16;_0x503b6f=0xc8;}else{_0x503b6f=0xce;}_0x15039b[_0x830b('0x1a')](_0x503b6f);return _0x15039b[_0x830b('0x1f')]('Content-Range',_0x324ad1+'-'+_0xc1f889+'/'+_0x42ab16)[_0x830b('0x1b')](_0x2c6715);}return null;};}function patchUpdates(_0x5435a3){return function(_0x4eab20){try{jsonpatch['apply'](_0x4eab20,_0x5435a3,!![]);}catch(_0x1e320d){return BPromise[_0x830b('0x20')](_0x1e320d);}return _0x4eab20[_0x830b('0x21')]();};}function saveUpdates(_0xb628dd,_0x599e67){return function(_0x117820){if(_0x117820){return _0x117820[_0x830b('0x22')](_0xb628dd)[_0x830b('0x23')](function(_0x13898e){return _0x13898e;});}return null;};}function handleEntityNotFound(_0x10fd5f,_0x84c754){return function(_0x42aa83){if(!_0x42aa83){_0x10fd5f[_0x830b('0x18')](0x194);}return _0x42aa83;};}function handleError(_0x3d79ad,_0x226a13){_0x226a13=_0x226a13||0x1f4;return function(_0x3a7052){logger[_0x830b('0x24')](_0x3a7052[_0x830b('0x25')]);if(_0x3a7052[_0x830b('0x26')]){delete _0x3a7052[_0x830b('0x26')];}_0x3d79ad[_0x830b('0x1a')](_0x226a13)[_0x830b('0x27')](_0x3a7052);};}exports[_0x830b('0x28')]=function(_0x43532,_0x36a5dc){var _0x10b583={},_0x374518={},_0x18d9af={'count':0x0,'rows':[]};var _0x2e8ef2=_[_0x830b('0x29')](db['Team'][_0x830b('0x2a')],function(_0x30ec28){return{'name':_0x30ec28['fieldName'],'type':_0x30ec28[_0x830b('0x2b')][_0x830b('0x2c')]};});_0x374518['model']=_['map'](_0x2e8ef2,_0x830b('0x26'));_0x374518[_0x830b('0x2d')]=_[_0x830b('0x2e')](_0x43532['query']);_0x374518[_0x830b('0x2f')]=_[_0x830b('0x30')](_0x374518['model'],_0x374518[_0x830b('0x2d')]);_0x10b583[_0x830b('0x31')]=_[_0x830b('0x30')](_0x374518[_0x830b('0x32')],qs[_0x830b('0x33')](_0x43532['query'][_0x830b('0x33')]));_0x10b583[_0x830b('0x31')]=_0x10b583[_0x830b('0x31')]['length']?_0x10b583[_0x830b('0x31')]:_0x374518[_0x830b('0x32')];if(!_0x43532[_0x830b('0x2d')]['hasOwnProperty'](_0x830b('0x34'))){_0x10b583[_0x830b('0x1d')]=qs[_0x830b('0x1d')](_0x43532[_0x830b('0x2d')][_0x830b('0x1d')]);_0x10b583[_0x830b('0x1c')]=qs['offset'](_0x43532[_0x830b('0x2d')]['offset']);}_0x10b583[_0x830b('0x35')]=qs[_0x830b('0x36')](_0x43532['query'][_0x830b('0x36')]);_0x10b583[_0x830b('0x37')]=qs[_0x830b('0x2f')](_['pick'](_0x43532['query'],_0x374518[_0x830b('0x2f')]),_0x2e8ef2);if(_0x43532[_0x830b('0x2d')][_0x830b('0x38')]){_0x10b583[_0x830b('0x37')]=_[_0x830b('0x39')](_0x10b583[_0x830b('0x37')],{'$or':_[_0x830b('0x29')](_0x2e8ef2,function(_0x313ea3){if(_0x313ea3[_0x830b('0x2b')]!==_0x830b('0x3a')){var _0x50d7e1={};_0x50d7e1[_0x313ea3[_0x830b('0x26')]]={'$like':'%'+_0x43532[_0x830b('0x2d')][_0x830b('0x38')]+'%'};return _0x50d7e1;}})});}_0x10b583=_['merge']({},_0x10b583,_0x43532['options']);var _0x4c4f47={'where':_0x10b583[_0x830b('0x37')]};return db['Team'][_0x830b('0x1e')](_0x4c4f47)[_0x830b('0x23')](function(_0x1cb6cf){_0x18d9af['count']=_0x1cb6cf;if(_0x43532['query']['includeAll']){_0x10b583[_0x830b('0x3b')]=[{'all':!![]}];}return db[_0x830b('0x3c')][_0x830b('0x3d')](_0x10b583);})[_0x830b('0x23')](function(_0x188c57){_0x18d9af[_0x830b('0x3e')]=_0x188c57;return _0x18d9af;})[_0x830b('0x23')](respondWithFilteredResult(_0x36a5dc,_0x10b583))[_0x830b('0x3f')](handleError(_0x36a5dc,null));};exports['show']=function(_0x29a7eb,_0x3891f5){var _0x34e077={'raw':![],'where':{'id':_0x29a7eb[_0x830b('0x40')]['id']}},_0x1bd0de={};_0x1bd0de['model']=_[_0x830b('0x2e')](db[_0x830b('0x3c')]['rawAttributes']);_0x1bd0de[_0x830b('0x2d')]=_[_0x830b('0x2e')](_0x29a7eb[_0x830b('0x2d')]);_0x1bd0de['filters']=_[_0x830b('0x30')](_0x1bd0de[_0x830b('0x32')],_0x1bd0de['query']);_0x34e077[_0x830b('0x31')]=_[_0x830b('0x30')](_0x1bd0de[_0x830b('0x32')],qs[_0x830b('0x33')](_0x29a7eb['query'][_0x830b('0x33')]));_0x34e077['attributes']=_0x34e077[_0x830b('0x31')][_0x830b('0x41')]?_0x34e077[_0x830b('0x31')]:_0x1bd0de[_0x830b('0x32')];if(_0x29a7eb['query'][_0x830b('0x42')]){_0x34e077[_0x830b('0x3b')]=[{'all':!![]}];}_0x34e077=_['merge']({},_0x34e077,_0x29a7eb[_0x830b('0x43')]);return db[_0x830b('0x3c')][_0x830b('0x44')](_0x34e077)['then'](handleEntityNotFound(_0x3891f5,null))[_0x830b('0x23')](respondWithResult(_0x3891f5,null))[_0x830b('0x3f')](handleError(_0x3891f5,null));};exports[_0x830b('0x45')]=function(_0x432cae,_0x2deeb3){return db[_0x830b('0x3c')][_0x830b('0x45')](_0x432cae[_0x830b('0x46')],{})['then'](function(_0x445ee1){var _0x13bcea=_0x432cae[_0x830b('0x47')][_0x830b('0x48')]({'plain':!![]});if(!_0x13bcea)throw new Error(_0x830b('0x49'));if(_0x13bcea[_0x830b('0x4a')]===_0x830b('0x47')){var _0x25eb1=_0x445ee1[_0x830b('0x48')]({'plain':!![]});var _0x3549ef=_0x830b('0x4b');return db[_0x830b('0x4c')][_0x830b('0x44')]({'where':{'name':_0x3549ef,'userProfileId':_0x13bcea[_0x830b('0x4d')]},'raw':!![]})['then'](function(_0x2f4719){if(_0x2f4719&&_0x2f4719[_0x830b('0x4e')]===0x0){return db[_0x830b('0x4f')][_0x830b('0x45')]({'name':_0x25eb1[_0x830b('0x26')],'resourceId':_0x25eb1['id'],'type':_0x2f4719[_0x830b('0x26')],'sectionId':_0x2f4719['id']},{})[_0x830b('0x23')](function(){return _0x445ee1;});}else{return _0x445ee1;}})['catch'](function(_0x4f4b0d){logger[_0x830b('0x24')](_0x830b('0x50'),_0x4f4b0d);throw _0x4f4b0d;});}return _0x445ee1;})[_0x830b('0x23')](respondWithResult(_0x2deeb3,0xc9))[_0x830b('0x3f')](handleError(_0x2deeb3,null));};exports[_0x830b('0x22')]=function(_0x1a5198,_0x307fec){if(_0x1a5198[_0x830b('0x46')]['id']){delete _0x1a5198[_0x830b('0x46')]['id'];}return db[_0x830b('0x3c')]['find']({'where':{'id':_0x1a5198[_0x830b('0x40')]['id']}})['then'](handleEntityNotFound(_0x307fec,null))[_0x830b('0x23')](saveUpdates(_0x1a5198['body'],null))[_0x830b('0x23')](respondWithResult(_0x307fec,null))[_0x830b('0x3f')](handleError(_0x307fec,null));};exports[_0x830b('0x51')]=function(_0x55ee1a,_0x3c1660){var _0x417e02=_0x55ee1a[_0x830b('0x40')]['id'];var _0x42e78c=[];return db[_0x830b('0x52')][_0x830b('0x53')](function(_0x2402a0){var _0x24325f=_0x830b('0x54')+_0x417e02;return db[_0x830b('0x52')]['query'](_0x24325f,{'type':db[_0x830b('0x55')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x2402a0})['then'](function(_0x47ee68){_0x42e78c=_[_0x830b('0x29')](_0x47ee68,function(_0x119421){return Number(_0x119421['UserId']);});})[_0x830b('0x23')](function(){var _0x2e3ca6=_0x830b('0x56')+_0x417e02;return db['sequelize'][_0x830b('0x2d')](_0x2e3ca6,{'type':db['Sequelize'][_0x830b('0x57')][_0x830b('0x58')],'raw':!![],'transaction':_0x2402a0});})['then'](function(_0x332d9){var _0x148af1=_[_0x830b('0x29')](_0x332d9,function(_0x29de59){return Number(_0x29de59[_0x830b('0x59')]);});return db['UserVoiceQueue'][_0x830b('0x51')]({'where':{'UserId':{'$in':_0x42e78c},'VoiceQueueId':{'$in':_0x148af1}},'transaction':_0x2402a0});})[_0x830b('0x23')](function(){var _0x430723=_0x830b('0x5a')+_0x417e02;return db[_0x830b('0x52')][_0x830b('0x2d')](_0x430723,{'type':db[_0x830b('0x55')][_0x830b('0x57')][_0x830b('0x58')],'raw':!![],'transaction':_0x2402a0});})[_0x830b('0x23')](function(_0x198ce8){var _0x6b6b42=_['map'](_0x198ce8,function(_0x2277b9){return Number(_0x2277b9['MailQueueId']);});return db[_0x830b('0x5b')]['destroy']({'where':{'UserId':{'$in':_0x42e78c},'MailQueueId':{'$in':_0x6b6b42}},'transaction':_0x2402a0});})[_0x830b('0x23')](function(){var _0x1b0873='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x417e02;return db[_0x830b('0x52')][_0x830b('0x2d')](_0x1b0873,{'type':db[_0x830b('0x55')][_0x830b('0x57')][_0x830b('0x58')],'raw':!![],'transaction':_0x2402a0});})[_0x830b('0x23')](function(_0x4db6de){var _0x56a68e=_[_0x830b('0x29')](_0x4db6de,function(_0x4f40aa){return Number(_0x4f40aa[_0x830b('0x5c')]);});return db[_0x830b('0x5d')][_0x830b('0x51')]({'where':{'UserId':{'$in':_0x42e78c},'SmsQueueId':{'$in':_0x56a68e}},'transaction':_0x2402a0});})['then'](function(){var _0x2ba3c4=_0x830b('0x5e')+_0x417e02;return db['sequelize']['query'](_0x2ba3c4,{'type':db[_0x830b('0x55')][_0x830b('0x57')][_0x830b('0x58')],'raw':!![],'transaction':_0x2402a0});})['then'](function(_0x2a1ed5){var _0x4f45ad=_[_0x830b('0x29')](_0x2a1ed5,function(_0x35b358){return Number(_0x35b358['ChatQueueId']);});return db[_0x830b('0x5f')][_0x830b('0x51')]({'where':{'UserId':{'$in':_0x42e78c},'ChatQueueId':{'$in':_0x4f45ad}},'transaction':_0x2402a0});})['then'](function(){var _0x15c136=_0x830b('0x60')+_0x417e02;return db[_0x830b('0x52')][_0x830b('0x2d')](_0x15c136,{'type':db['Sequelize'][_0x830b('0x57')]['SELECT'],'raw':!![],'transaction':_0x2402a0});})['then'](function(_0x47a7bc){var _0x5782c8=_[_0x830b('0x29')](_0x47a7bc,function(_0x3292c6){return Number(_0x3292c6[_0x830b('0x61')]);});return db[_0x830b('0x62')][_0x830b('0x51')]({'where':{'UserId':{'$in':_0x42e78c},'FaxQueueId':{'$in':_0x5782c8}},'transaction':_0x2402a0});})[_0x830b('0x23')](function(){var _0x4769bd=_0x830b('0x63')+_0x417e02;return db['sequelize']['query'](_0x4769bd,{'type':db['Sequelize']['QueryTypes'][_0x830b('0x58')],'raw':!![],'transaction':_0x2402a0});})[_0x830b('0x23')](function(_0x3f65d9){var _0x36f921=_['map'](_0x3f65d9,function(_0x5cc6be){return Number(_0x5cc6be[_0x830b('0x64')]);});return db['UserOpenchannelQueue']['destroy']({'where':{'UserId':{'$in':_0x42e78c},'OpenchannelQueueId':{'$in':_0x36f921}},'transaction':_0x2402a0});})[_0x830b('0x23')](function(){var _0x43b52e=_0x830b('0x65')+_0x417e02;return db[_0x830b('0x52')][_0x830b('0x2d')](_0x43b52e,{'type':db[_0x830b('0x55')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x2402a0});})[_0x830b('0x23')](function(_0x3796c5){var _0x40fa53=_[_0x830b('0x29')](_0x3796c5,function(_0x325bfe){return Number(_0x325bfe['WhatsappQueueId']);});return db[_0x830b('0x66')][_0x830b('0x51')]({'where':{'UserId':{'$in':_0x42e78c},'WhatsappQueueId':{'$in':_0x40fa53}},'transaction':_0x2402a0});})['then'](function(){return db[_0x830b('0x67')][_0x830b('0x44')]({'where':{'TeamId':_0x417e02}});})[_0x830b('0x23')](function(_0x3344df){if(_0x3344df===null){return;}return db[_0x830b('0x68')][_0x830b('0x51')]({'where':{'UserId':{'$in':_0x42e78c},'VoicePrefixId':_0x3344df[_0x830b('0x69')]},'transaction':_0x2402a0});})[_0x830b('0x23')](function(){return db[_0x830b('0x3c')][_0x830b('0x51')]({'where':{'id':_0x417e02},'cascade':!![],'transaction':_0x2402a0});})[_0x830b('0x23')](function(_0x27f4bd){if(_0x27f4bd===0x0){_0x3c1660['sendStatus'](0x194);}else{return db[_0x830b('0x4f')]['destroy']({'where':{'type':_0x830b('0x4b'),'resourceId':_0x417e02},'cascade':!![],'transaction':_0x2402a0})[_0x830b('0x23')](function(){_0x3c1660['status'](0xcc)[_0x830b('0x19')]();});}})[_0x830b('0x3f')](function(_0x2eb770){_0x3c1660['status'](0x1f4)['send'](_0x2eb770);});});};exports['getQueues']=function(_0x1241a3,_0x567de3,_0x3ee0fa){return db[_0x830b('0x3c')]['findOne']({'where':{'id':_0x1241a3['params']['id']}})['then'](handleEntityNotFound(_0x567de3,null))[_0x830b('0x23')](function(_0x590bc5){if(!_0x1241a3[_0x830b('0x2d')][_0x830b('0x6a')]||!utils[_0x830b('0x6b')](_0x1241a3[_0x830b('0x2d')][_0x830b('0x6a')])){throw new db[(_0x830b('0x55'))][(_0x830b('0x6c'))](_0x830b('0x6d'));}var _0x48057d={};var _0x245789={};_0x245789[_0x830b('0x32')]=_[_0x830b('0x2e')](db[_['capitalize'](_0x1241a3[_0x830b('0x2d')][_0x830b('0x6a')][_0x830b('0x6e')]())+_0x830b('0x6f')][_0x830b('0x2a')]);_0x245789[_0x830b('0x2d')]=_[_0x830b('0x2e')](_0x1241a3['query']);_0x245789[_0x830b('0x2f')]=_[_0x830b('0x30')](_0x245789[_0x830b('0x32')],_0x245789[_0x830b('0x2d')]);_0x48057d[_0x830b('0x31')]=_['intersection'](_0x245789[_0x830b('0x32')],qs[_0x830b('0x33')](_0x1241a3[_0x830b('0x2d')]['fields']));_0x48057d['attributes']=_0x48057d['attributes'][_0x830b('0x41')]?_0x48057d[_0x830b('0x31')]:_0x245789[_0x830b('0x32')];_0x48057d[_0x830b('0x1d')]=qs[_0x830b('0x1d')](_0x1241a3[_0x830b('0x2d')]['limit']);_0x48057d[_0x830b('0x1c')]=qs[_0x830b('0x1c')](_0x1241a3[_0x830b('0x2d')][_0x830b('0x1c')]);_0x48057d[_0x830b('0x35')]=qs[_0x830b('0x36')](_0x1241a3[_0x830b('0x2d')][_0x830b('0x36')]);_0x48057d[_0x830b('0x37')]=qs[_0x830b('0x2f')](_[_0x830b('0x70')](_0x1241a3[_0x830b('0x2d')],_0x245789['filters']));_0x48057d=_[_0x830b('0x39')]({},_0x48057d,_0x1241a3['options']);return _0x590bc5[_0x830b('0x48')+_[_0x830b('0x71')](_0x1241a3[_0x830b('0x2d')]['channel'][_0x830b('0x6e')]())+_0x830b('0x72')](_0x48057d);})['then'](respondWithResult(_0x567de3,null))[_0x830b('0x3f')](handleError(_0x567de3,null));};exports[_0x830b('0x73')]=function(_0x3d4eca,_0x461235,_0x1eeff2){return db['Team']['findOne']({'where':{'id':_0x3d4eca[_0x830b('0x40')]['id']}})[_0x830b('0x23')](function(_0x70906e){if(_0x70906e){if(!_0x3d4eca[_0x830b('0x46')]['channel']||!utils[_0x830b('0x6b')](_0x3d4eca['body']['channel'])){throw new db['Sequelize'][(_0x830b('0x6c'))](_0x830b('0x6d'));}return _0x70906e[_0x830b('0x74')+_[_0x830b('0x71')](_0x3d4eca['body'][_0x830b('0x6a')][_0x830b('0x6e')]())+_0x830b('0x72')](_0x3d4eca[_0x830b('0x46')]['ids']);}return null;})[_0x830b('0x23')](handleEntityNotFound(_0x461235,null))['then'](respondWithStatusCode(_0x461235,null))[_0x830b('0x3f')](handleError(_0x461235,null));};exports[_0x830b('0x75')]=function(_0x46d1d6,_0x5c2a59,_0xd564d9){return db[_0x830b('0x3c')][_0x830b('0x76')]({'where':{'id':_0x46d1d6[_0x830b('0x40')]['id']}})['then'](function(_0xb2a097){if(_0xb2a097){if(!_0x46d1d6[_0x830b('0x2d')][_0x830b('0x6a')]||!utils[_0x830b('0x6b')](_0x46d1d6['query'][_0x830b('0x6a')])){throw new db['Sequelize'][(_0x830b('0x6c'))]('Unknown\x20channel');}return _0xb2a097[_0x830b('0x77')+_[_0x830b('0x71')](_0x46d1d6[_0x830b('0x2d')][_0x830b('0x6a')][_0x830b('0x6e')]())+'Queues'](_0x46d1d6['query'][_0x830b('0x78')]);}return null;})[_0x830b('0x23')](handleEntityNotFound(_0x5c2a59,null))[_0x830b('0x23')](respondWithStatusCode(_0x5c2a59,null))[_0x830b('0x3f')](handleError(_0x5c2a59,null));};exports[_0x830b('0x79')]=function(_0x3444ab,_0x2547f7){var _0x4b08db=_[_0x830b('0x7a')](_0x3444ab[_0x830b('0x46')][_0x830b('0x78')])?_0x3444ab['body'][_0x830b('0x78')]:[_0x3444ab[_0x830b('0x46')][_0x830b('0x78')]];var _0x3f5b68=_0x3444ab['params']['id'];return db[_0x830b('0x3c')]['find']({'where':{'id':_0x3f5b68}})[_0x830b('0x23')](handleEntityNotFound(_0x2547f7,null))[_0x830b('0x23')](function(_0x1c5f21){if(_0x1c5f21){var _0x5bd676=[_0x830b('0x7b'),'Chat',_0x830b('0x7c'),_0x830b('0x7d'),_0x830b('0x7e'),_0x830b('0x7f'),_0x830b('0x80')];return db[_0x830b('0x52')]['transaction'](function(_0x53b94b){var _0x30e6f9=_['map'](_0x5bd676,function(_0xd59da5){var _0x20ce50={'attributes':['id',_0x830b('0x26')]};if(_0xd59da5===_0x830b('0x7b')){_0x20ce50[_0x830b('0x81')]={'attributes':['penalty']};}return _0x1c5f21['get'+_0xd59da5+_0x830b('0x72')](_0x20ce50)['then'](function(_0x85c954){var _0x49b063=_[_0x830b('0x29')](_0x85c954,function(_0x47f0d6){var _0x3185f0=_[_0x830b('0x29')](_0x4b08db,function(_0x3268ef){var _0x4e06e8={'where':{'UserId':_0x3268ef,[_0xd59da5+_0x830b('0x82')]:_0x47f0d6['id']},'transaction':_0x53b94b};if(_0xd59da5===_0x830b('0x7b')){_0x4e06e8[_0x830b('0x83')]={'penalty':_0x47f0d6[_0x830b('0x84')][_0x830b('0x85')]};}return db['User'+_0xd59da5+_0x830b('0x6f')][_0x830b('0x86')](_0x4e06e8)[_0x830b('0x23')](function(){socket[_0x830b('0x87')]('user'+_0xd59da5+_0x830b('0x88'),{'UserId':_0x3268ef,[_0xd59da5+_0x830b('0x82')]:_0x47f0d6['id']});if(_0xd59da5!=='Voice'){return;}return db['User'][_0x830b('0x3d')]({'where':{'id':_0x4b08db,'online':0x1},'attributes':['id',_0x830b('0x26'),_0x830b('0x89'),'voicePause',_0x830b('0x8a')],'raw':!![]})[_0x830b('0x23')](function(_0x43e9dd){var _0x7ba8e1=_[_0x830b('0x29')](_0x43e9dd,function(_0x3fb6ad){return db['UserVoiceQueueRt'][_0x830b('0x8b')]({'membername':_0x3fb6ad['name'],'UserId':_0x3fb6ad['id'],'queue_name':_0x47f0d6[_0x830b('0x26')],'VoiceQueueId':_0x47f0d6['id'],'interface':_[_0x830b('0x8c')](_0x3fb6ad['interface'])?util[_0x830b('0x8d')](_0x830b('0x8e'),_0x3fb6ad['name']):_0x3fb6ad['interface'],'paused':_0x3fb6ad[_0x830b('0x8f')]||![],'penalty':_0x47f0d6[_0x830b('0x84')][_0x830b('0x85')]},{'transaction':_0x53b94b});});return Promise[_0x830b('0x90')](_0x7ba8e1);});});});return Promise['all'](_0x3185f0);});return Promise[_0x830b('0x90')](_0x49b063);})[_0x830b('0x23')](function(){return db[_0x830b('0x67')][_0x830b('0x76')]({'where':{'teamId':_0x3f5b68}})[_0x830b('0x23')](function(_0x1086f8){if(_0x1086f8){var _0x4be0c3=_[_0x830b('0x29')](_0x4b08db,function(_0x454520){db['UserVoicePrefix'][_0x830b('0x8b')]({'UserId':_0x454520,'VoicePrefixId':_0x1086f8[_0x830b('0x69')]});});return Promise[_0x830b('0x90')](_0x4be0c3);}});});});return Promise[_0x830b('0x90')](_0x30e6f9)['then'](function(){return _0x1c5f21[_0x830b('0x79')](_0x4b08db,{'transaction':_0x53b94b})['spread'](function(_0x532e4c){return _0x532e4c;});});});}})[_0x830b('0x23')](respondWithResult(_0x2547f7,null))[_0x830b('0x3f')](handleError(_0x2547f7,null));};exports[_0x830b('0x91')]=function(_0x207a1a,_0x4ac816){var _0xf4b489=_[_0x830b('0x7a')](_0x207a1a[_0x830b('0x2d')][_0x830b('0x78')])?_0x207a1a[_0x830b('0x2d')][_0x830b('0x78')]:[_0x207a1a[_0x830b('0x2d')][_0x830b('0x78')]];var _0x13dbfb=_0x207a1a[_0x830b('0x40')]['id'];return db[_0x830b('0x3c')]['find']({'where':{'id':_0x13dbfb}})[_0x830b('0x23')](handleEntityNotFound(_0x4ac816,null))[_0x830b('0x23')](function(_0x3e71a4){if(_0x3e71a4){var _0x15959c=[_0x830b('0x7b'),_0x830b('0x92'),_0x830b('0x7c'),_0x830b('0x7d'),'Fax',_0x830b('0x7f'),'Whatsapp'];return db[_0x830b('0x52')][_0x830b('0x53')](function(_0x10e864){var _0x24dd6e=_[_0x830b('0x29')](_0x15959c,function(_0x26461c){var _0x298af7={'attributes':['id',_0x830b('0x26')]};return _0x3e71a4[_0x830b('0x48')+_0x26461c+'Queues'](_0x298af7)[_0x830b('0x23')](function(_0x4063eb){var _0x228ac6=_[_0x830b('0x29')](_0x4063eb,function(_0x5f40c8){return _0x5f40c8[_0x830b('0x91')](_0xf4b489,{'transaction':_0x10e864})[_0x830b('0x23')](function(){var _0x1f4903=_[_0x830b('0x29')](_0xf4b489,function(_0xe776d6){socket[_0x830b('0x87')](_0x830b('0x47')+_0x26461c+_0x830b('0x93'),{'UserId':Number(_0xe776d6),[_0x26461c+'QueueId']:_0x5f40c8['id']});if(_0x26461c!==_0x830b('0x7b')){return;}return db[_0x830b('0x94')][_0x830b('0x51')]({'where':{'VoiceQueueId':_0x5f40c8['id'],'UserId':_0xe776d6},'transaction':_0x10e864});});return Promise[_0x830b('0x90')](_0x1f4903);});});return Promise[_0x830b('0x90')](_0x228ac6);});});return Promise[_0x830b('0x90')](_0x24dd6e)[_0x830b('0x23')](function(){return _0x3e71a4[_0x830b('0x91')](_0xf4b489,{'transaction':_0x10e864});})[_0x830b('0x23')](function(){return db[_0x830b('0x67')][_0x830b('0x76')]({'where':{'teamId':_0x13dbfb}})['then'](function(_0x54379d){if(_0x54379d){var _0x4698fc=_['map'](_0xf4b489,function(_0x1d4b04){db[_0x830b('0x68')][_0x830b('0x51')]({'where':{'UserId':_0x1d4b04,'VoicePrefixId':_0x54379d['VoicePrefixId']}});});return Promise[_0x830b('0x90')](_0x4698fc);}});});});}})['then'](respondWithStatusCode(_0x4ac816,null))[_0x830b('0x3f')](handleError(_0x4ac816,null));};exports[_0x830b('0x95')]=function(_0x4d3cef,_0x5089f1,_0x734402){var _0x5c141f={};var _0x35c435={};var _0x5abbeb;var _0x4b9acf;return db[_0x830b('0x3c')][_0x830b('0x76')]({'where':{'id':_0x4d3cef[_0x830b('0x40')]['id']}})[_0x830b('0x23')](handleEntityNotFound(_0x5089f1,null))[_0x830b('0x23')](function(_0x46392d){if(_0x46392d){_0x5abbeb=_0x46392d;_0x35c435['model']=_[_0x830b('0x2e')](db[_0x830b('0x96')][_0x830b('0x2a')]);_0x35c435['query']=_[_0x830b('0x2e')](_0x4d3cef[_0x830b('0x2d')]);_0x35c435[_0x830b('0x2f')]=_[_0x830b('0x30')](_0x35c435[_0x830b('0x32')],_0x35c435[_0x830b('0x2d')]);_0x5c141f[_0x830b('0x31')]=_[_0x830b('0x30')](_0x35c435['model'],qs['fields'](_0x4d3cef['query'][_0x830b('0x33')]));_0x5c141f[_0x830b('0x31')]=_0x5c141f[_0x830b('0x31')]['length']?_0x5c141f['attributes']:_0x35c435[_0x830b('0x32')];_0x5c141f[_0x830b('0x35')]=qs[_0x830b('0x36')](_0x4d3cef[_0x830b('0x2d')][_0x830b('0x36')]);_0x5c141f['where']=qs[_0x830b('0x2f')](_[_0x830b('0x70')](_0x4d3cef[_0x830b('0x2d')],_0x35c435[_0x830b('0x2f')]));if(_0x4d3cef[_0x830b('0x2d')][_0x830b('0x38')]){_0x5c141f[_0x830b('0x37')]=_['merge'](_0x5c141f[_0x830b('0x37')],{'$or':_[_0x830b('0x29')](_0x5c141f[_0x830b('0x31')],function(_0x16a307){var _0x1ca244={};_0x1ca244[_0x16a307]={'$like':'%'+_0x4d3cef['query'][_0x830b('0x38')]+'%'};return _0x1ca244;})});}_0x5c141f=_['merge']({},_0x5c141f,_0x4d3cef['options']);return _0x5abbeb[_0x830b('0x95')](_0x5c141f);}})[_0x830b('0x23')](function(_0x1a395d){if(_0x1a395d){_0x4b9acf=_0x1a395d[_0x830b('0x41')];if(!_0x4d3cef[_0x830b('0x2d')][_0x830b('0x97')](_0x830b('0x34'))){_0x5c141f[_0x830b('0x1d')]=qs[_0x830b('0x1d')](_0x4d3cef[_0x830b('0x2d')]['limit']);_0x5c141f[_0x830b('0x1c')]=qs['offset'](_0x4d3cef[_0x830b('0x2d')][_0x830b('0x1c')]);}return _0x5abbeb[_0x830b('0x95')](_0x5c141f);}})['then'](function(_0x2b2b33){if(_0x2b2b33){return _0x2b2b33?{'count':_0x4b9acf,'rows':_0x2b2b33}:null;}})[_0x830b('0x23')](respondWithResult(_0x5089f1,null))[_0x830b('0x3f')](handleError(_0x5089f1,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index de1ffa1..2fb11a6 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 _0xd9c6=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','Team','setMaxListeners','save','update'];(function(_0x3f2423,_0x2d4d49){var _0x2d3810=function(_0x377a6f){while(--_0x377a6f){_0x3f2423['push'](_0x3f2423['shift']());}};_0x2d3810(++_0x2d4d49);}(_0xd9c6,0xe0));var _0x6d9c=function(_0x176983,_0x22fb60){_0x176983=_0x176983-0x0;var _0x3398d1=_0xd9c6[_0x176983];return _0x3398d1;};'use strict';var EventEmitter=require(_0x6d9c('0x0'));var Team=require(_0x6d9c('0x1'))['db'][_0x6d9c('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x6d9c('0x3')](0x0);var events={'afterCreate':_0x6d9c('0x4'),'afterUpdate':_0x6d9c('0x5'),'afterDestroy':_0x6d9c('0x6')};function emitEvent(_0x3318a8){return function(_0x5e2047,_0x457e69,_0x2e397f){TeamEvents['emit'](_0x3318a8+':'+_0x5e2047['id'],_0x5e2047);TeamEvents[_0x6d9c('0x7')](_0x3318a8,_0x5e2047);_0x2e397f(null);};}for(var e in events){if(events[_0x6d9c('0x8')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x6d9c('0x9')]=TeamEvents; \ No newline at end of file +var _0x87e3=['hook','exports','../../mysqldb','Team','save','update','emit','hasOwnProperty'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x87e3,0x1d2));var _0x387e=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x87e3[_0x4d07cc];return _0x42de3b;};'use strict';var EventEmitter=require('events');var Team=require(_0x387e('0x0'))['db'][_0x387e('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x387e('0x2'),'afterUpdate':_0x387e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x359133){return function(_0x25f6e6,_0x4147c5,_0xee643a){TeamEvents[_0x387e('0x4')](_0x359133+':'+_0x25f6e6['id'],_0x25f6e6);TeamEvents['emit'](_0x359133,_0x25f6e6);_0xee643a(null);};}for(var e in events){if(events[_0x387e('0x5')](e)){var event=events[e];Team[_0x387e('0x6')](e,emitEvent(event));}}module[_0x387e('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 6ded5f8..f8bc4a5 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 _0x75d8=['./team.attributes','define','Team','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x30ef8a,_0x4a4337){var _0x3401b9=function(_0x166931){while(--_0x166931){_0x30ef8a['push'](_0x30ef8a['shift']());}};_0x3401b9(++_0x4a4337);}(_0x75d8,0x13b));var _0x875d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x875d('0x0'));var util=require(_0x875d('0x1'));var logger=require(_0x875d('0x2'))(_0x875d('0x3'));var moment=require(_0x875d('0x4'));var BPromise=require(_0x875d('0x5'));var rp=require(_0x875d('0x6'));var fs=require('fs');var path=require(_0x875d('0x7'));var rimraf=require(_0x875d('0x8'));var config=require(_0x875d('0x9'));var attributes=require(_0x875d('0xa'));module['exports']=function(_0x1a2a76,_0x562eb9){return _0x1a2a76[_0x875d('0xb')](_0x875d('0xc'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb29e=['teams','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','Team'];(function(_0x501737,_0x4a3ed6){var _0x1f1a93=function(_0x4603d0){while(--_0x4603d0){_0x501737['push'](_0x501737['shift']());}};_0x1f1a93(++_0x4a3ed6);}(_0xb29e,0x71));var _0xeb29=function(_0x220f8,_0x4e159e){_0x220f8=_0x220f8-0x0;var _0x5e678e=_0xb29e[_0x220f8];return _0x5e678e;};'use strict';var _=require(_0xeb29('0x0'));var util=require(_0xeb29('0x1'));var logger=require(_0xeb29('0x2'))(_0xeb29('0x3'));var moment=require(_0xeb29('0x4'));var BPromise=require(_0xeb29('0x5'));var rp=require(_0xeb29('0x6'));var fs=require('fs');var path=require(_0xeb29('0x7'));var rimraf=require(_0xeb29('0x8'));var config=require(_0xeb29('0x9'));var attributes=require(_0xeb29('0xa'));module[_0xeb29('0xb')]=function(_0x49d599,_0x318e31){return _0x49d599['define'](_0xeb29('0xc'),attributes,{'tableName':_0xeb29('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index ccd4eda..2e3b69b 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 _0x7935=['localhost','socket.io-emitter','register','then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults'];(function(_0x312fa5,_0x2b6ea1){var _0x43f67a=function(_0x6f407c){while(--_0x6f407c){_0x312fa5['push'](_0x312fa5['shift']());}};_0x43f67a(++_0x2b6ea1);}(_0x7935,0x152));var _0x5793=function(_0x1b6db3,_0x26930b){_0x1b6db3=_0x1b6db3-0x0;var _0x38a71e=_0x7935[_0x1b6db3];return _0x38a71e;};'use strict';var _=require(_0x5793('0x0'));var util=require(_0x5793('0x1'));var moment=require(_0x5793('0x2'));var BPromise=require(_0x5793('0x3'));var rs=require(_0x5793('0x4'));var fs=require('fs');var Redis=require(_0x5793('0x5'));var db=require(_0x5793('0x6'))['db'];var utils=require(_0x5793('0x7'));var logger=require('../../config/logger')(_0x5793('0x8'));var config=require(_0x5793('0x9'));var jayson=require(_0x5793('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x5793('0xb')]=_[_0x5793('0xc')](config['redis'],{'host':_0x5793('0xd'),'port':0x18eb});var socket=require(_0x5793('0xe'))(new Redis(config[_0x5793('0xb')]));require('./team.socket')[_0x5793('0xf')](socket);function respondWithRpcPromise(_0x550ffc,_0x1aee46,_0x588138){return new BPromise(function(_0x2d3514,_0x2a21b8){return client['request'](_0x550ffc,_0x588138)[_0x5793('0x10')](function(_0x44f34b){logger['info'](_0x5793('0x11'),_0x1aee46,_0x5793('0x12'));logger['debug'](_0x5793('0x13'),_0x1aee46,_0x5793('0x12'),JSON[_0x5793('0x14')](_0x44f34b));if(_0x44f34b[_0x5793('0x15')]){if(_0x44f34b[_0x5793('0x15')][_0x5793('0x16')]===0x1f4){logger[_0x5793('0x15')](_0x5793('0x11'),_0x1aee46,_0x44f34b[_0x5793('0x15')][_0x5793('0x17')]);return _0x2a21b8(_0x44f34b[_0x5793('0x15')][_0x5793('0x17')]);}logger['error'](_0x5793('0x11'),_0x1aee46,_0x44f34b[_0x5793('0x15')][_0x5793('0x17')]);return _0x2d3514(_0x44f34b[_0x5793('0x15')][_0x5793('0x17')]);}else{logger[_0x5793('0x18')](_0x5793('0x11'),_0x1aee46,'request\x20sent');_0x2d3514(_0x44f34b[_0x5793('0x19')]['message']);}})[_0x5793('0x1a')](function(_0xf6b859){logger[_0x5793('0x15')](_0x5793('0x11'),_0x1aee46,_0xf6b859);_0x2a21b8(_0xf6b859);});});} \ No newline at end of file +var _0x7e8a=['socket.io-emitter','./team.socket','register','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x21fc1e,_0xeb49ee){var _0x28b8e9=function(_0x20e7ff){while(--_0x20e7ff){_0x21fc1e['push'](_0x21fc1e['shift']());}};_0x28b8e9(++_0xeb49ee);}(_0x7e8a,0x1b2));var _0xa7e8=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x7e8a[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0xa7e8('0x0'));var util=require(_0xa7e8('0x1'));var moment=require(_0xa7e8('0x2'));var BPromise=require(_0xa7e8('0x3'));var rs=require(_0xa7e8('0x4'));var fs=require('fs');var Redis=require(_0xa7e8('0x5'));var db=require(_0xa7e8('0x6'))['db'];var utils=require(_0xa7e8('0x7'));var logger=require('../../config/logger')(_0xa7e8('0x8'));var config=require(_0xa7e8('0x9'));var jayson=require(_0xa7e8('0xa'));var client=jayson[_0xa7e8('0xb')][_0xa7e8('0xc')]({'port':0x232a});config[_0xa7e8('0xd')]=_[_0xa7e8('0xe')](config[_0xa7e8('0xd')],{'host':_0xa7e8('0xf'),'port':0x18eb});var socket=require(_0xa7e8('0x10'))(new Redis(config[_0xa7e8('0xd')]));require(_0xa7e8('0x11'))[_0xa7e8('0x12')](socket);function respondWithRpcPromise(_0x53c8d2,_0x2c8d7e,_0x2fae1c){return new BPromise(function(_0x4bcb74,_0x1c254b){return client['request'](_0x53c8d2,_0x2fae1c)[_0xa7e8('0x13')](function(_0xfffeeb){logger[_0xa7e8('0x14')](_0xa7e8('0x15'),_0x2c8d7e,_0xa7e8('0x16'));logger[_0xa7e8('0x17')]('Team,\x20%s,\x20%s,\x20%s',_0x2c8d7e,_0xa7e8('0x16'),JSON[_0xa7e8('0x18')](_0xfffeeb));if(_0xfffeeb['error']){if(_0xfffeeb[_0xa7e8('0x19')][_0xa7e8('0x1a')]===0x1f4){logger[_0xa7e8('0x19')](_0xa7e8('0x15'),_0x2c8d7e,_0xfffeeb[_0xa7e8('0x19')][_0xa7e8('0x1b')]);return _0x1c254b(_0xfffeeb[_0xa7e8('0x19')][_0xa7e8('0x1b')]);}logger[_0xa7e8('0x19')](_0xa7e8('0x15'),_0x2c8d7e,_0xfffeeb[_0xa7e8('0x19')][_0xa7e8('0x1b')]);return _0x4bcb74(_0xfffeeb[_0xa7e8('0x19')][_0xa7e8('0x1b')]);}else{logger[_0xa7e8('0x14')]('Team,\x20%s,\x20%s',_0x2c8d7e,'request\x20sent');_0x4bcb74(_0xfffeeb[_0xa7e8('0x1c')][_0xa7e8('0x1b')]);}})[_0xa7e8('0x1d')](function(_0xb08bbf){logger[_0xa7e8('0x19')](_0xa7e8('0x15'),_0x2c8d7e,_0xb08bbf);_0x1c254b(_0xb08bbf);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index c3452cd..56b2f0d 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 _0xfdb8=['./team.events','save','remove','update','length','team:'];(function(_0x4a33fd,_0x3e5f43){var _0x91b873=function(_0x5a6f6f){while(--_0x5a6f6f){_0x4a33fd['push'](_0x4a33fd['shift']());}};_0x91b873(++_0x3e5f43);}(_0xfdb8,0x120));var _0x8fdb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfdb8[_0x3dd15e];return _0x231fd0;};'use strict';var TeamEvents=require(_0x8fdb('0x0'));var events=[_0x8fdb('0x1'),_0x8fdb('0x2'),_0x8fdb('0x3')];function createListener(_0x3618b9,_0x52e7ce){return function(_0xc410b4){_0x52e7ce['emit'](_0x3618b9,_0xc410b4);};}function removeListener(_0x32321e,_0x4208ab){return function(){TeamEvents['removeListener'](_0x32321e,_0x4208ab);};}exports['register']=function(_0x7a9123){for(var _0x60813c=0x0,_0x2b7eab=events[_0x8fdb('0x4')];_0x60813c<_0x2b7eab;_0x60813c++){var _0x3997fa=events[_0x60813c];var _0x1b6b84=createListener(_0x8fdb('0x5')+_0x3997fa,_0x7a9123);TeamEvents['on'](_0x3997fa,_0x1b6b84);}}; \ No newline at end of file +var _0x8357=['save','remove','emit','register','./team.events'];(function(_0x5327d3,_0x952206){var _0x1eef65=function(_0x2c881e){while(--_0x2c881e){_0x5327d3['push'](_0x5327d3['shift']());}};_0x1eef65(++_0x952206);}(_0x8357,0x1e4));var _0x7835=function(_0xa8f20f,_0x430d3e){_0xa8f20f=_0xa8f20f-0x0;var _0x5161d2=_0x8357[_0xa8f20f];return _0x5161d2;};'use strict';var TeamEvents=require(_0x7835('0x0'));var events=[_0x7835('0x1'),_0x7835('0x2'),'update'];function createListener(_0x4d1e64,_0x3c227b){return function(_0x45ea02){_0x3c227b[_0x7835('0x3')](_0x4d1e64,_0x45ea02);};}function removeListener(_0x121253,_0x510f88){return function(){TeamEvents['removeListener'](_0x121253,_0x510f88);};}exports[_0x7835('0x4')]=function(_0x492061){for(var _0x3bd4a8=0x0,_0x298c79=events['length'];_0x3bd4a8<_0x298c79;_0x3bd4a8++){var _0x48805f=events[_0x3bd4a8];var _0x11835c=createListener('team:'+_0x48805f,_0x492061);TeamEvents['on'](_0x48805f,_0x11835c);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index f273162..265bcdd 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 _0xfd2f=['sequelize','exports','INTEGER'];(function(_0x236a98,_0x56d14a){var _0x3d9cbb=function(_0x251e87){while(--_0x251e87){_0x236a98['push'](_0x236a98['shift']());}};_0x3d9cbb(++_0x56d14a);}(_0xfd2f,0x14a));var _0xffd2=function(_0xb9c0d4,_0xdd897c){_0xb9c0d4=_0xb9c0d4-0x0;var _0xf40d8c=_0xfd2f[_0xb9c0d4];return _0xf40d8c;};'use strict';var Sequelize=require(_0xffd2('0x0'));module[_0xffd2('0x1')]={'TeamId':{'type':Sequelize[_0xffd2('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x2b52=['INTEGER','sequelize','exports'];(function(_0xe5e087,_0x33e807){var _0x4b0a61=function(_0x4d0b25){while(--_0x4d0b25){_0xe5e087['push'](_0xe5e087['shift']());}};_0x4b0a61(++_0x33e807);}(_0x2b52,0x12a));var _0x22b5=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x2b52[_0x556bb1];return _0x45455f;};'use strict';var Sequelize=require(_0x22b5('0x0'));module[_0x22b5('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x22b5('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 47cb853..d3701ba 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(_0x8d6a00,_0x22158a){var _0x34ed33=function(_0x4bbea0){while(--_0x4bbea0){_0x8d6a00['push'](_0x8d6a00['shift']());}};_0x34ed33(++_0x22158a);}(_0xa20a,0x74));var _0xaa20=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xa20a[_0x5a776b];return _0xbbef59;};'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 _0xd4dc=['TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes'];(function(_0x6025d,_0x4f79ec){var _0x3ceadc=function(_0x4bfd9e){while(--_0x4bfd9e){_0x6025d['push'](_0x6025d['shift']());}};_0x3ceadc(++_0x4f79ec);}(_0xd4dc,0xff));var _0xcd4d=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xd4dc[_0x5f0089];return _0x193892;};'use strict';var _=require(_0xcd4d('0x0'));var util=require('util');var logger=require(_0xcd4d('0x1'))(_0xcd4d('0x2'));var moment=require(_0xcd4d('0x3'));var BPromise=require(_0xcd4d('0x4'));var rp=require(_0xcd4d('0x5'));var fs=require('fs');var path=require(_0xcd4d('0x6'));var rimraf=require(_0xcd4d('0x7'));var config=require('../../config/environment');var attributes=require(_0xcd4d('0x8'));module['exports']=function(_0x5d70fb,_0x3c5bbd){return _0x5d70fb['define'](_0xcd4d('0x9'),attributes,{'tableName':_0xcd4d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 76a3505..7388fda 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x273611,_0xa72fdf){var _0x116c06=function(_0xa3a779){while(--_0xa3a779){_0x273611['push'](_0x273611['shift']());}};_0x116c06(++_0xa72fdf);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x59f5a6,_0x22e5fe){var _0x824ffa=function(_0x283d79){while(--_0x283d79){_0x59f5a6['push'](_0x59f5a6['shift']());}};_0x824ffa(++_0x22e5fe);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 72ba4f9..9159bbc 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 _0xa6cd=['sequelize','exports','INTEGER'];(function(_0x37c2bb,_0x340eab){var _0x22add5=function(_0x363024){while(--_0x363024){_0x37c2bb['push'](_0x37c2bb['shift']());}};_0x22add5(++_0x340eab);}(_0xa6cd,0x171));var _0xda6c=function(_0x446d66,_0x59dc41){_0x446d66=_0x446d66-0x0;var _0x35a945=_0xa6cd[_0x446d66];return _0x35a945;};'use strict';var Sequelize=require(_0xda6c('0x0'));module[_0xda6c('0x1')]={'penalty':{'type':Sequelize[_0xda6c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3279=['INTEGER','sequelize','exports'];(function(_0x5c4504,_0x43bd6d){var _0xa9e952=function(_0x28b57e){while(--_0x28b57e){_0x5c4504['push'](_0x5c4504['shift']());}};_0xa9e952(++_0x43bd6d);}(_0x3279,0xc7));var _0x9327=function(_0xb86c14,_0x3b4dd4){_0xb86c14=_0xb86c14-0x0;var _0x2b6864=_0x3279[_0xb86c14];return _0x2b6864;};'use strict';var Sequelize=require(_0x9327('0x0'));module[_0x9327('0x1')]={'penalty':{'type':Sequelize[_0x9327('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 bd5c337..9253948 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 _0xc560=['../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','lodash','../../config/logger','moment','path','rimraf'];(function(_0x14fa74,_0x3f6532){var _0xf7c81c=function(_0x1974be){while(--_0x1974be){_0x14fa74['push'](_0x14fa74['shift']());}};_0xf7c81c(++_0x3f6532);}(_0xc560,0x82));var _0x0c56=function(_0x182ac7,_0x390778){_0x182ac7=_0x182ac7-0x0;var _0x1dcd69=_0xc560[_0x182ac7];return _0x1dcd69;};'use strict';var _=require(_0x0c56('0x0'));var util=require('util');var logger=require(_0x0c56('0x1'))('api');var moment=require(_0x0c56('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c56('0x3'));var rimraf=require(_0x0c56('0x4'));var config=require(_0x0c56('0x5'));var attributes=require(_0x0c56('0x6'));module['exports']=function(_0x2b5654,_0x2bc0a0){return _0x2b5654[_0x0c56('0x7')](_0x0c56('0x8'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x385b=['../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x72e677,_0xc21f62){var _0x4a0edd=function(_0x12a270){while(--_0x12a270){_0x72e677['push'](_0x72e677['shift']());}};_0x4a0edd(++_0xc21f62);}(_0x385b,0x1a7));var _0xb385=function(_0x1ecae9,_0x3d5fb9){_0x1ecae9=_0x1ecae9-0x0;var _0x5518e1=_0x385b[_0x1ecae9];return _0x5518e1;};'use strict';var _=require('lodash');var util=require(_0xb385('0x0'));var logger=require('../../config/logger')(_0xb385('0x1'));var moment=require(_0xb385('0x2'));var BPromise=require(_0xb385('0x3'));var rp=require(_0xb385('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb385('0x5'));var config=require(_0xb385('0x6'));var attributes=require(_0xb385('0x7'));module[_0xb385('0x8')]=function(_0x3268bc,_0x576d81){return _0x3268bc[_0xb385('0x9')](_0xb385('0xa'),attributes,{'tableName':'team_has_voice_queues','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 ce8eeaf..69abb28 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 _0xa9be=['TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x4e85ec,_0x2913b6){var _0x1c1ab3=function(_0x2c55b6){while(--_0x2c55b6){_0x4e85ec['push'](_0x4e85ec['shift']());}};_0x1c1ab3(++_0x2913b6);}(_0xa9be,0x1eb));var _0xea9b=function(_0xb35081,_0xed423b){_0xb35081=_0xb35081-0x0;var _0x576c56=_0xa9be[_0xb35081];return _0x576c56;};'use strict';var _=require(_0xea9b('0x0'));var util=require(_0xea9b('0x1'));var moment=require(_0xea9b('0x2'));var BPromise=require(_0xea9b('0x3'));var rs=require(_0xea9b('0x4'));var fs=require('fs');var Redis=require(_0xea9b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xea9b('0x6'));var logger=require(_0xea9b('0x7'))(_0xea9b('0x8'));var config=require(_0xea9b('0x9'));var jayson=require(_0xea9b('0xa'));var client=jayson[_0xea9b('0xb')][_0xea9b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f1c0e,_0x10e567,_0x1197c1){return new BPromise(function(_0x4f513f,_0x156dfb){return client['request'](_0x4f1c0e,_0x1197c1)[_0xea9b('0xd')](function(_0x2bacbc){logger[_0xea9b('0xe')](_0xea9b('0xf'),_0x10e567,_0xea9b('0x10'));logger[_0xea9b('0x11')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x10e567,_0xea9b('0x10'),JSON['stringify'](_0x2bacbc));if(_0x2bacbc[_0xea9b('0x12')]){if(_0x2bacbc[_0xea9b('0x12')][_0xea9b('0x13')]===0x1f4){logger[_0xea9b('0x12')](_0xea9b('0xf'),_0x10e567,_0x2bacbc[_0xea9b('0x12')]['message']);return _0x156dfb(_0x2bacbc[_0xea9b('0x12')][_0xea9b('0x14')]);}logger[_0xea9b('0x12')](_0xea9b('0xf'),_0x10e567,_0x2bacbc[_0xea9b('0x12')][_0xea9b('0x14')]);return _0x4f513f(_0x2bacbc['error'][_0xea9b('0x14')]);}else{logger[_0xea9b('0xe')](_0xea9b('0xf'),_0x10e567,'request\x20sent');_0x4f513f(_0x2bacbc[_0xea9b('0x15')][_0xea9b('0x14')]);}})[_0xea9b('0x16')](function(_0x1c2dd8){logger[_0xea9b('0x12')](_0xea9b('0xf'),_0x10e567,_0x1c2dd8);_0x156dfb(_0x1c2dd8);});});} \ No newline at end of file +var _0x7df8=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','request','info','TeamVoiceQueue,\x20%s,\x20%s','error','code','message','request\x20sent','catch'];(function(_0x458897,_0x4aac86){var _0xbc7b62=function(_0x50e2b1){while(--_0x50e2b1){_0x458897['push'](_0x458897['shift']());}};_0xbc7b62(++_0x4aac86);}(_0x7df8,0x1a0));var _0x87df=function(_0x5d1c94,_0x149f99){_0x5d1c94=_0x5d1c94-0x0;var _0x519199=_0x7df8[_0x5d1c94];return _0x519199;};'use strict';var _=require(_0x87df('0x0'));var util=require(_0x87df('0x1'));var moment=require(_0x87df('0x2'));var BPromise=require(_0x87df('0x3'));var rs=require(_0x87df('0x4'));var fs=require('fs');var Redis=require(_0x87df('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x87df('0x6'))(_0x87df('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49f565,_0x2a83f1,_0x41b41f){return new BPromise(function(_0x3daa75,_0x2612e4){return client[_0x87df('0x8')](_0x49f565,_0x41b41f)['then'](function(_0x529c79){logger[_0x87df('0x9')](_0x87df('0xa'),_0x2a83f1,'request\x20sent');logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2a83f1,'request\x20sent',JSON['stringify'](_0x529c79));if(_0x529c79[_0x87df('0xb')]){if(_0x529c79[_0x87df('0xb')][_0x87df('0xc')]===0x1f4){logger[_0x87df('0xb')](_0x87df('0xa'),_0x2a83f1,_0x529c79[_0x87df('0xb')][_0x87df('0xd')]);return _0x2612e4(_0x529c79[_0x87df('0xb')]['message']);}logger['error'](_0x87df('0xa'),_0x2a83f1,_0x529c79[_0x87df('0xb')][_0x87df('0xd')]);return _0x3daa75(_0x529c79[_0x87df('0xb')][_0x87df('0xd')]);}else{logger[_0x87df('0x9')](_0x87df('0xa'),_0x2a83f1,_0x87df('0xe'));_0x3daa75(_0x529c79['result'][_0x87df('0xd')]);}})[_0x87df('0xf')](function(_0x15a429){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x2a83f1,_0x15a429);_0x2612e4(_0x15a429);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 8765da3..4d7ea1d 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 _0x25d4=['connect-timeout','Router','fs-extra','../../components/interaction/service','./template.controller','get','isAuthenticated','create','put','/:id','delete','exports','multer','util','path'];(function(_0x1a2060,_0x3daa38){var _0x332de4=function(_0xfc29a9){while(--_0xfc29a9){_0x1a2060['push'](_0x1a2060['shift']());}};_0x332de4(++_0x3daa38);}(_0x25d4,0xb1));var _0x425d=function(_0xab47de,_0x71bd40){_0xab47de=_0xab47de-0x0;var _0x4f728b=_0x25d4[_0xab47de];return _0x4f728b;};'use strict';var multer=require(_0x425d('0x0'));var util=require(_0x425d('0x1'));var path=require(_0x425d('0x2'));var timeout=require(_0x425d('0x3'));var express=require('express');var router=express[_0x425d('0x4')]();var fs_extra=require(_0x425d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x425d('0x6'));var config=require('../../config/environment');var controller=require(_0x425d('0x7'));router[_0x425d('0x8')]('/',auth[_0x425d('0x9')](),controller['index']);router[_0x425d('0x8')]('/:id',auth[_0x425d('0x9')](),controller['show']);router['post']('/',auth[_0x425d('0x9')](),controller[_0x425d('0xa')]);router[_0x425d('0xb')](_0x425d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x425d('0xd')]('/:id',auth[_0x425d('0x9')](),controller['destroy']);module[_0x425d('0xe')]=router; \ No newline at end of file +var _0xd98a=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x156148,_0x25881b){var _0x4f65d0=function(_0x3fbe54){while(--_0x3fbe54){_0x156148['push'](_0x156148['shift']());}};_0x4f65d0(++_0x25881b);}(_0xd98a,0xfc));var _0xad98=function(_0x242f01,_0x15d59e){_0x242f01=_0x242f01-0x0;var _0x2bb519=_0xd98a[_0x242f01];return _0x2bb519;};'use strict';var multer=require(_0xad98('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xad98('0x1'));var express=require(_0xad98('0x2'));var router=express[_0xad98('0x3')]();var fs_extra=require(_0xad98('0x4'));var auth=require(_0xad98('0x5'));var interaction=require(_0xad98('0x6'));var config=require('../../config/environment');var controller=require('./template.controller');router[_0xad98('0x7')]('/',auth[_0xad98('0x8')](),controller[_0xad98('0x9')]);router[_0xad98('0x7')](_0xad98('0xa'),auth['isAuthenticated'](),controller[_0xad98('0xb')]);router[_0xad98('0xc')]('/',auth['isAuthenticated'](),controller[_0xad98('0xd')]);router['put'](_0xad98('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xad98('0xa'),auth[_0xad98('0x8')](),controller[_0xad98('0xe')]);module[_0xad98('0xf')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index cf247ab..30b65b6 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 _0xa12d=['exports','STRING','TEXT'];(function(_0x133856,_0x2a2e2b){var _0x2cbefc=function(_0x1a5a78){while(--_0x1a5a78){_0x133856['push'](_0x133856['shift']());}};_0x2cbefc(++_0x2a2e2b);}(_0xa12d,0x1a7));var _0xda12=function(_0x5e72dd,_0x5d38db){_0x5e72dd=_0x5e72dd-0x0;var _0x5eee3b=_0xa12d[_0x5e72dd];return _0x5eee3b;};'use strict';var Sequelize=require('sequelize');module[_0xda12('0x0')]={'name':{'type':Sequelize[_0xda12('0x1')]},'description':{'type':Sequelize[_0xda12('0x1')]},'html':{'type':Sequelize[_0xda12('0x2')]}}; \ No newline at end of file +var _0xbc45=['STRING','TEXT','sequelize','exports'];(function(_0x4e90e3,_0x570a1d){var _0x295e5b=function(_0x754043){while(--_0x754043){_0x4e90e3['push'](_0x4e90e3['shift']());}};_0x295e5b(++_0x570a1d);}(_0xbc45,0x19a));var _0x5bc4=function(_0x3a03d9,_0x51d910){_0x3a03d9=_0x3a03d9-0x0;var _0x3eddb6=_0xbc45[_0x3a03d9];return _0x3eddb6;};'use strict';var Sequelize=require(_0x5bc4('0x0'));module[_0x5bc4('0x1')]={'name':{'type':Sequelize[_0x5bc4('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x5bc4('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 545d97b..97ce3a5 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 _0x81b9=['send','index','map','Template','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','filter','merge','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','name'];(function(_0x471dd7,_0x3369c6){var _0x12dc68=function(_0x390f90){while(--_0x390f90){_0x471dd7['push'](_0x471dd7['shift']());}};_0x12dc68(++_0x3369c6);}(_0x81b9,0x79));var _0x981b=function(_0x58e351,_0xc353fb){_0x58e351=_0x58e351-0x0;var _0x164c39=_0x81b9[_0x58e351];return _0x164c39;};'use strict';var emlformat=require(_0x981b('0x0'));var rimraf=require(_0x981b('0x1'));var zipdir=require(_0x981b('0x2'));var jsonpatch=require(_0x981b('0x3'));var rp=require(_0x981b('0x4'));var moment=require(_0x981b('0x5'));var BPromise=require(_0x981b('0x6'));var Mustache=require(_0x981b('0x7'));var util=require(_0x981b('0x8'));var path=require(_0x981b('0x9'));var sox=require(_0x981b('0xa'));var csv=require('to-csv');var ejs=require(_0x981b('0xb'));var fs=require('fs');var fs_extra=require(_0x981b('0xc'));var _=require('lodash');var squel=require(_0x981b('0xd'));var crypto=require(_0x981b('0xe'));var jsforce=require(_0x981b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x981b('0x10'));var querystring=require(_0x981b('0x11'));var Papa=require(_0x981b('0x12'));var Redis=require('ioredis');var authService=require(_0x981b('0x13'));var qs=require(_0x981b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x981b('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x981b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x981b('0x17'))['db'];function respondWithStatusCode(_0xb6019a,_0x5559b9){_0x5559b9=_0x5559b9||0xcc;return function(_0x32bd09){if(_0x32bd09){return _0xb6019a[_0x981b('0x18')](_0x5559b9);}return _0xb6019a[_0x981b('0x19')](_0x5559b9)['end']();};}function respondWithResult(_0x54e24f,_0x4dc992){_0x4dc992=_0x4dc992||0xc8;return function(_0x4ba810){if(_0x4ba810){return _0x54e24f[_0x981b('0x19')](_0x4dc992)[_0x981b('0x1a')](_0x4ba810);}};}function respondWithFilteredResult(_0x12d012,_0x276fd9){return function(_0x4f6500){if(_0x4f6500){var _0x537b97=typeof _0x276fd9['offset']===_0x981b('0x1b')&&typeof _0x276fd9[_0x981b('0x1c')]===_0x981b('0x1b');var _0x59c319=_0x4f6500[_0x981b('0x1d')];var _0x23d7a3=_0x537b97?0x0:_0x276fd9[_0x981b('0x1e')];var _0x559aaf=_0x537b97?_0x4f6500[_0x981b('0x1d')]:_0x276fd9[_0x981b('0x1e')]+_0x276fd9[_0x981b('0x1c')];var _0x247697;if(_0x559aaf>=_0x59c319){_0x559aaf=_0x59c319;_0x247697=0xc8;}else{_0x247697=0xce;}_0x12d012[_0x981b('0x19')](_0x247697);return _0x12d012[_0x981b('0x1f')]('Content-Range',_0x23d7a3+'-'+_0x559aaf+'/'+_0x59c319)[_0x981b('0x1a')](_0x4f6500);}return null;};}function patchUpdates(_0x5c39a2){return function(_0x5800b6){try{jsonpatch[_0x981b('0x20')](_0x5800b6,_0x5c39a2,!![]);}catch(_0x44ce28){return BPromise[_0x981b('0x21')](_0x44ce28);}return _0x5800b6[_0x981b('0x22')]();};}function saveUpdates(_0x1d7e04,_0x4d5d2a){return function(_0x21614f){if(_0x21614f){return _0x21614f[_0x981b('0x23')](_0x1d7e04)[_0x981b('0x24')](function(_0x30c1f1){return _0x30c1f1;});}return null;};}function removeEntity(_0xddf0b6,_0x1d3b7c){return function(_0x28d7e6){if(_0x28d7e6){return _0x28d7e6[_0x981b('0x25')]()[_0x981b('0x24')](function(){var _0x51ecf9=_0x28d7e6[_0x981b('0x26')]({'plain':!![]});var _0x528c7e=_0x981b('0x27');return db[_0x981b('0x28')][_0x981b('0x25')]({'where':{'type':_0x528c7e,'resourceId':_0x51ecf9['id']}})[_0x981b('0x24')](function(){return _0x28d7e6;});})['then'](function(){_0xddf0b6[_0x981b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a3fbf,_0x5e486c){return function(_0x430314){if(!_0x430314){_0x3a3fbf[_0x981b('0x18')](0x194);}return _0x430314;};}function handleError(_0x4957b4,_0x356659){_0x356659=_0x356659||0x1f4;return function(_0x202807){logger[_0x981b('0x29')](_0x202807['stack']);if(_0x202807[_0x981b('0x2a')]){delete _0x202807['name'];}_0x4957b4[_0x981b('0x19')](_0x356659)[_0x981b('0x2b')](_0x202807);};}exports[_0x981b('0x2c')]=function(_0x393fbd,_0x12f984){var _0x349cd5={},_0x3bbec7={},_0xf20c8d={'count':0x0,'rows':[]};var _0x45a068=_[_0x981b('0x2d')](db[_0x981b('0x2e')]['rawAttributes'],function(_0x127426){return{'name':_0x127426[_0x981b('0x2f')],'type':_0x127426[_0x981b('0x30')][_0x981b('0x31')]};});_0x3bbec7[_0x981b('0x32')]=_[_0x981b('0x2d')](_0x45a068,_0x981b('0x2a'));_0x3bbec7[_0x981b('0x33')]=_[_0x981b('0x34')](_0x393fbd['query']);_0x3bbec7['filters']=_['intersection'](_0x3bbec7[_0x981b('0x32')],_0x3bbec7[_0x981b('0x33')]);_0x349cd5[_0x981b('0x35')]=_[_0x981b('0x36')](_0x3bbec7[_0x981b('0x32')],qs[_0x981b('0x37')](_0x393fbd['query'][_0x981b('0x37')]));_0x349cd5[_0x981b('0x35')]=_0x349cd5[_0x981b('0x35')][_0x981b('0x38')]?_0x349cd5['attributes']:_0x3bbec7['model'];if(!_0x393fbd[_0x981b('0x33')][_0x981b('0x39')](_0x981b('0x3a'))){_0x349cd5[_0x981b('0x1c')]=qs['limit'](_0x393fbd[_0x981b('0x33')][_0x981b('0x1c')]);_0x349cd5[_0x981b('0x1e')]=qs['offset'](_0x393fbd[_0x981b('0x33')][_0x981b('0x1e')]);}_0x349cd5[_0x981b('0x3b')]=qs[_0x981b('0x3c')](_0x393fbd[_0x981b('0x33')]['sort']);_0x349cd5['where']=qs[_0x981b('0x3d')](_[_0x981b('0x3e')](_0x393fbd[_0x981b('0x33')],_0x3bbec7['filters']),_0x45a068);if(_0x393fbd[_0x981b('0x33')]['filter']){_0x349cd5[_0x981b('0x3f')]=_['merge'](_0x349cd5[_0x981b('0x3f')],{'$or':_['map'](_0x45a068,function(_0x2d922e){if(_0x2d922e[_0x981b('0x30')]!=='VIRTUAL'){var _0x282639={};_0x282639[_0x2d922e[_0x981b('0x2a')]]={'$like':'%'+_0x393fbd[_0x981b('0x33')][_0x981b('0x40')]+'%'};return _0x282639;}})});}_0x349cd5=_[_0x981b('0x41')]({},_0x349cd5,_0x393fbd[_0x981b('0x42')]);var _0x167ea3={'where':_0x349cd5[_0x981b('0x3f')]};return db[_0x981b('0x2e')][_0x981b('0x1d')](_0x167ea3)['then'](function(_0x1d9dd2){_0xf20c8d[_0x981b('0x1d')]=_0x1d9dd2;if(_0x393fbd[_0x981b('0x33')][_0x981b('0x43')]){_0x349cd5[_0x981b('0x44')]=[{'all':!![]}];}return db[_0x981b('0x2e')][_0x981b('0x45')](_0x349cd5);})[_0x981b('0x24')](function(_0x19c9ac){_0xf20c8d[_0x981b('0x46')]=_0x19c9ac;return _0xf20c8d;})[_0x981b('0x24')](respondWithFilteredResult(_0x12f984,_0x349cd5))[_0x981b('0x47')](handleError(_0x12f984,null));};exports['show']=function(_0x151e6a,_0x217e1b){var _0x3f5bda={'raw':!![],'where':{'id':_0x151e6a['params']['id']}},_0x1dbcca={};_0x1dbcca[_0x981b('0x32')]=_[_0x981b('0x34')](db[_0x981b('0x2e')][_0x981b('0x48')]);_0x1dbcca[_0x981b('0x33')]=_[_0x981b('0x34')](_0x151e6a[_0x981b('0x33')]);_0x1dbcca[_0x981b('0x3d')]=_['intersection'](_0x1dbcca[_0x981b('0x32')],_0x1dbcca[_0x981b('0x33')]);_0x3f5bda[_0x981b('0x35')]=_[_0x981b('0x36')](_0x1dbcca['model'],qs[_0x981b('0x37')](_0x151e6a['query'][_0x981b('0x37')]));_0x3f5bda[_0x981b('0x35')]=_0x3f5bda['attributes'][_0x981b('0x38')]?_0x3f5bda[_0x981b('0x35')]:_0x1dbcca[_0x981b('0x32')];if(_0x151e6a['query']['includeAll']){_0x3f5bda[_0x981b('0x44')]=[{'all':!![]}];}_0x3f5bda=_[_0x981b('0x41')]({},_0x3f5bda,_0x151e6a[_0x981b('0x42')]);return db['Template'][_0x981b('0x49')](_0x3f5bda)[_0x981b('0x24')](handleEntityNotFound(_0x217e1b,null))['then'](respondWithResult(_0x217e1b,null))[_0x981b('0x47')](handleError(_0x217e1b,null));};exports[_0x981b('0x4a')]=function(_0x307a8b,_0x52c9f7){return db[_0x981b('0x2e')]['create'](_0x307a8b[_0x981b('0x4b')],{})['then'](function(_0xffe287){var _0x4f5fe9=_0x307a8b[_0x981b('0x4c')]['get']({'plain':!![]});if(!_0x4f5fe9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f5fe9[_0x981b('0x4d')]===_0x981b('0x4c')){var _0x20c820=_0xffe287['get']({'plain':!![]});var _0x3771a3='Templates';return db[_0x981b('0x4e')][_0x981b('0x49')]({'where':{'name':_0x3771a3,'userProfileId':_0x4f5fe9['userProfileId']},'raw':!![]})[_0x981b('0x24')](function(_0x5cdc9a){if(_0x5cdc9a&&_0x5cdc9a[_0x981b('0x4f')]===0x0){return db[_0x981b('0x28')]['create']({'name':_0x20c820['name'],'resourceId':_0x20c820['id'],'type':_0x5cdc9a[_0x981b('0x2a')],'sectionId':_0x5cdc9a['id']},{})[_0x981b('0x24')](function(){return _0xffe287;});}else{return _0xffe287;}})[_0x981b('0x47')](function(_0x3c85b6){logger[_0x981b('0x29')](_0x981b('0x50'),_0x3c85b6);throw _0x3c85b6;});}return _0xffe287;})[_0x981b('0x24')](respondWithResult(_0x52c9f7,0xc9))[_0x981b('0x47')](handleError(_0x52c9f7,null));};exports[_0x981b('0x23')]=function(_0x1c1f13,_0x402558){if(_0x1c1f13['body']['id']){delete _0x1c1f13[_0x981b('0x4b')]['id'];}return db['Template'][_0x981b('0x49')]({'where':{'id':_0x1c1f13[_0x981b('0x51')]['id']}})[_0x981b('0x24')](handleEntityNotFound(_0x402558,null))[_0x981b('0x24')](saveUpdates(_0x1c1f13['body'],null))[_0x981b('0x24')](respondWithResult(_0x402558,null))[_0x981b('0x47')](handleError(_0x402558,null));};exports[_0x981b('0x25')]=function(_0x418e6b,_0x5aaebf){return db['Template']['find']({'where':{'id':_0x418e6b[_0x981b('0x51')]['id']}})[_0x981b('0x24')](handleEntityNotFound(_0x5aaebf,null))[_0x981b('0x24')](removeEntity(_0x5aaebf,null))[_0x981b('0x47')](handleError(_0x5aaebf,null));}; \ No newline at end of file +var _0xfedc=['includeAll','include','findAll','rows','params','length','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','catch','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','get','Templates','destroy','error','stack','name','send','map','Template','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x180864,_0x5dd061){var _0x2f7dab=function(_0x4b70cf){while(--_0x4b70cf){_0x180864['push'](_0x180864['shift']());}};_0x2f7dab(++_0x5dd061);}(_0xfedc,0xff));var _0xcfed=function(_0x284506,_0x191316){_0x284506=_0x284506-0x0;var _0x1e9ee5=_0xfedc[_0x284506];return _0x1e9ee5;};'use strict';var emlformat=require(_0xcfed('0x0'));var rimraf=require(_0xcfed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcfed('0x2'));var BPromise=require(_0xcfed('0x3'));var Mustache=require(_0xcfed('0x4'));var util=require(_0xcfed('0x5'));var path=require(_0xcfed('0x6'));var sox=require('sox');var csv=require(_0xcfed('0x7'));var ejs=require(_0xcfed('0x8'));var fs=require('fs');var fs_extra=require(_0xcfed('0x9'));var _=require(_0xcfed('0xa'));var squel=require('squel');var crypto=require(_0xcfed('0xb'));var jsforce=require(_0xcfed('0xc'));var deskjs=require(_0xcfed('0xd'));var toCsv=require(_0xcfed('0x7'));var querystring=require(_0xcfed('0xe'));var Papa=require(_0xcfed('0xf'));var Redis=require(_0xcfed('0x10'));var authService=require(_0xcfed('0x11'));var qs=require(_0xcfed('0x12'));var as=require(_0xcfed('0x13'));var hardwareService=require(_0xcfed('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xcfed('0x15'));var config=require(_0xcfed('0x16'));var licenseUtil=require(_0xcfed('0x17'));var db=require(_0xcfed('0x18'))['db'];function respondWithStatusCode(_0x1ac80d,_0x1e8892){_0x1e8892=_0x1e8892||0xcc;return function(_0x102a19){if(_0x102a19){return _0x1ac80d[_0xcfed('0x19')](_0x1e8892);}return _0x1ac80d[_0xcfed('0x1a')](_0x1e8892)[_0xcfed('0x1b')]();};}function respondWithResult(_0x24aaa0,_0x50852c){_0x50852c=_0x50852c||0xc8;return function(_0x55a46c){if(_0x55a46c){return _0x24aaa0[_0xcfed('0x1a')](_0x50852c)[_0xcfed('0x1c')](_0x55a46c);}};}function respondWithFilteredResult(_0x4e6db5,_0x190cdc){return function(_0xcfb819){if(_0xcfb819){var _0x1ef9fe=typeof _0x190cdc[_0xcfed('0x1d')]===_0xcfed('0x1e')&&typeof _0x190cdc[_0xcfed('0x1f')]===_0xcfed('0x1e');var _0xc91ebe=_0xcfb819[_0xcfed('0x20')];var _0x12f95d=_0x1ef9fe?0x0:_0x190cdc['offset'];var _0x552e99=_0x1ef9fe?_0xcfb819[_0xcfed('0x20')]:_0x190cdc[_0xcfed('0x1d')]+_0x190cdc[_0xcfed('0x1f')];var _0x250223;if(_0x552e99>=_0xc91ebe){_0x552e99=_0xc91ebe;_0x250223=0xc8;}else{_0x250223=0xce;}_0x4e6db5[_0xcfed('0x1a')](_0x250223);return _0x4e6db5['set'](_0xcfed('0x21'),_0x12f95d+'-'+_0x552e99+'/'+_0xc91ebe)['json'](_0xcfb819);}return null;};}function patchUpdates(_0x4fc677){return function(_0x1f4bee){try{jsonpatch['apply'](_0x1f4bee,_0x4fc677,!![]);}catch(_0x1c5e88){return BPromise[_0xcfed('0x22')](_0x1c5e88);}return _0x1f4bee[_0xcfed('0x23')]();};}function saveUpdates(_0xae6a49,_0x5b6588){return function(_0x454691){if(_0x454691){return _0x454691[_0xcfed('0x24')](_0xae6a49)[_0xcfed('0x25')](function(_0xb506fd){return _0xb506fd;});}return null;};}function removeEntity(_0xa4b3eb,_0x4d843d){return function(_0x1b76e0){if(_0x1b76e0){return _0x1b76e0['destroy']()[_0xcfed('0x25')](function(){var _0x2131ee=_0x1b76e0[_0xcfed('0x26')]({'plain':!![]});var _0xe38914=_0xcfed('0x27');return db['UserProfileResource'][_0xcfed('0x28')]({'where':{'type':_0xe38914,'resourceId':_0x2131ee['id']}})[_0xcfed('0x25')](function(){return _0x1b76e0;});})[_0xcfed('0x25')](function(){_0xa4b3eb[_0xcfed('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35ad31,_0x22821d){return function(_0x2ee6a4){if(!_0x2ee6a4){_0x35ad31[_0xcfed('0x19')](0x194);}return _0x2ee6a4;};}function handleError(_0x172d97,_0x82795d){_0x82795d=_0x82795d||0x1f4;return function(_0x502ed1){logger[_0xcfed('0x29')](_0x502ed1[_0xcfed('0x2a')]);if(_0x502ed1[_0xcfed('0x2b')]){delete _0x502ed1['name'];}_0x172d97[_0xcfed('0x1a')](_0x82795d)[_0xcfed('0x2c')](_0x502ed1);};}exports['index']=function(_0x529a94,_0x46b59f){var _0x5a822e={},_0x3e9d9a={},_0x39eb8f={'count':0x0,'rows':[]};var _0x53f628=_[_0xcfed('0x2d')](db[_0xcfed('0x2e')][_0xcfed('0x2f')],function(_0x4afa80){return{'name':_0x4afa80[_0xcfed('0x30')],'type':_0x4afa80['type']['key']};});_0x3e9d9a[_0xcfed('0x31')]=_['map'](_0x53f628,_0xcfed('0x2b'));_0x3e9d9a['query']=_[_0xcfed('0x32')](_0x529a94[_0xcfed('0x33')]);_0x3e9d9a[_0xcfed('0x34')]=_[_0xcfed('0x35')](_0x3e9d9a[_0xcfed('0x31')],_0x3e9d9a['query']);_0x5a822e['attributes']=_[_0xcfed('0x35')](_0x3e9d9a[_0xcfed('0x31')],qs[_0xcfed('0x36')](_0x529a94[_0xcfed('0x33')][_0xcfed('0x36')]));_0x5a822e[_0xcfed('0x37')]=_0x5a822e[_0xcfed('0x37')]['length']?_0x5a822e[_0xcfed('0x37')]:_0x3e9d9a[_0xcfed('0x31')];if(!_0x529a94[_0xcfed('0x33')][_0xcfed('0x38')](_0xcfed('0x39'))){_0x5a822e[_0xcfed('0x1f')]=qs['limit'](_0x529a94['query'][_0xcfed('0x1f')]);_0x5a822e[_0xcfed('0x1d')]=qs[_0xcfed('0x1d')](_0x529a94[_0xcfed('0x33')][_0xcfed('0x1d')]);}_0x5a822e['order']=qs[_0xcfed('0x3a')](_0x529a94[_0xcfed('0x33')][_0xcfed('0x3a')]);_0x5a822e[_0xcfed('0x3b')]=qs[_0xcfed('0x34')](_[_0xcfed('0x3c')](_0x529a94[_0xcfed('0x33')],_0x3e9d9a[_0xcfed('0x34')]),_0x53f628);if(_0x529a94[_0xcfed('0x33')][_0xcfed('0x3d')]){_0x5a822e[_0xcfed('0x3b')]=_[_0xcfed('0x3e')](_0x5a822e[_0xcfed('0x3b')],{'$or':_[_0xcfed('0x2d')](_0x53f628,function(_0x5853b6){if(_0x5853b6['type']!==_0xcfed('0x3f')){var _0x1cba05={};_0x1cba05[_0x5853b6[_0xcfed('0x2b')]]={'$like':'%'+_0x529a94[_0xcfed('0x33')][_0xcfed('0x3d')]+'%'};return _0x1cba05;}})});}_0x5a822e=_[_0xcfed('0x3e')]({},_0x5a822e,_0x529a94[_0xcfed('0x40')]);var _0x4a8ca4={'where':_0x5a822e[_0xcfed('0x3b')]};return db[_0xcfed('0x2e')][_0xcfed('0x20')](_0x4a8ca4)[_0xcfed('0x25')](function(_0x42b0f1){_0x39eb8f[_0xcfed('0x20')]=_0x42b0f1;if(_0x529a94[_0xcfed('0x33')][_0xcfed('0x41')]){_0x5a822e[_0xcfed('0x42')]=[{'all':!![]}];}return db[_0xcfed('0x2e')][_0xcfed('0x43')](_0x5a822e);})[_0xcfed('0x25')](function(_0x28a564){_0x39eb8f[_0xcfed('0x44')]=_0x28a564;return _0x39eb8f;})[_0xcfed('0x25')](respondWithFilteredResult(_0x46b59f,_0x5a822e))['catch'](handleError(_0x46b59f,null));};exports['show']=function(_0xbd29e5,_0x3b1916){var _0x191c4b={'raw':!![],'where':{'id':_0xbd29e5[_0xcfed('0x45')]['id']}},_0x110b6f={};_0x110b6f['model']=_[_0xcfed('0x32')](db['Template'][_0xcfed('0x2f')]);_0x110b6f[_0xcfed('0x33')]=_['keys'](_0xbd29e5[_0xcfed('0x33')]);_0x110b6f[_0xcfed('0x34')]=_['intersection'](_0x110b6f[_0xcfed('0x31')],_0x110b6f['query']);_0x191c4b[_0xcfed('0x37')]=_['intersection'](_0x110b6f[_0xcfed('0x31')],qs[_0xcfed('0x36')](_0xbd29e5['query'][_0xcfed('0x36')]));_0x191c4b[_0xcfed('0x37')]=_0x191c4b[_0xcfed('0x37')][_0xcfed('0x46')]?_0x191c4b[_0xcfed('0x37')]:_0x110b6f[_0xcfed('0x31')];if(_0xbd29e5[_0xcfed('0x33')][_0xcfed('0x41')]){_0x191c4b[_0xcfed('0x42')]=[{'all':!![]}];}_0x191c4b=_[_0xcfed('0x3e')]({},_0x191c4b,_0xbd29e5[_0xcfed('0x40')]);return db['Template']['find'](_0x191c4b)[_0xcfed('0x25')](handleEntityNotFound(_0x3b1916,null))[_0xcfed('0x25')](respondWithResult(_0x3b1916,null))['catch'](handleError(_0x3b1916,null));};exports[_0xcfed('0x47')]=function(_0x316463,_0x300392){return db['Template'][_0xcfed('0x47')](_0x316463[_0xcfed('0x48')],{})[_0xcfed('0x25')](function(_0x4b8c80){var _0x2299e3=_0x316463['user']['get']({'plain':!![]});if(!_0x2299e3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2299e3[_0xcfed('0x49')]===_0xcfed('0x4a')){var _0x4ba3d9=_0x4b8c80[_0xcfed('0x26')]({'plain':!![]});var _0x2ba989='Templates';return db[_0xcfed('0x4b')][_0xcfed('0x4c')]({'where':{'name':_0x2ba989,'userProfileId':_0x2299e3[_0xcfed('0x4d')]},'raw':!![]})[_0xcfed('0x25')](function(_0x775cee){if(_0x775cee&&_0x775cee[_0xcfed('0x4e')]===0x0){return db['UserProfileResource'][_0xcfed('0x47')]({'name':_0x4ba3d9[_0xcfed('0x2b')],'resourceId':_0x4ba3d9['id'],'type':_0x775cee[_0xcfed('0x2b')],'sectionId':_0x775cee['id']},{})[_0xcfed('0x25')](function(){return _0x4b8c80;});}else{return _0x4b8c80;}})['catch'](function(_0x32d122){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32d122);throw _0x32d122;});}return _0x4b8c80;})[_0xcfed('0x25')](respondWithResult(_0x300392,0xc9))[_0xcfed('0x4f')](handleError(_0x300392,null));};exports['update']=function(_0x1dbfee,_0x17cdab){if(_0x1dbfee[_0xcfed('0x48')]['id']){delete _0x1dbfee[_0xcfed('0x48')]['id'];}return db['Template']['find']({'where':{'id':_0x1dbfee[_0xcfed('0x45')]['id']}})[_0xcfed('0x25')](handleEntityNotFound(_0x17cdab,null))[_0xcfed('0x25')](saveUpdates(_0x1dbfee['body'],null))[_0xcfed('0x25')](respondWithResult(_0x17cdab,null))[_0xcfed('0x4f')](handleError(_0x17cdab,null));};exports['destroy']=function(_0x200989,_0x4ca504){return db[_0xcfed('0x2e')]['find']({'where':{'id':_0x200989['params']['id']}})[_0xcfed('0x25')](handleEntityNotFound(_0x4ca504,null))[_0xcfed('0x25')](removeEntity(_0x4ca504,null))[_0xcfed('0x4f')](handleError(_0x4ca504,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 98e695d..5eb2fc4 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 _0x8921=['Template','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./template.attributes','exports','define'];(function(_0x56e0e8,_0x16ef91){var _0x2dab50=function(_0x4fe720){while(--_0x4fe720){_0x56e0e8['push'](_0x56e0e8['shift']());}};_0x2dab50(++_0x16ef91);}(_0x8921,0xd2));var _0x1892=function(_0x51d1e9,_0x52a4c0){_0x51d1e9=_0x51d1e9-0x0;var _0x5174e1=_0x8921[_0x51d1e9];return _0x5174e1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1892('0x0'))(_0x1892('0x1'));var moment=require(_0x1892('0x2'));var BPromise=require(_0x1892('0x3'));var rp=require(_0x1892('0x4'));var fs=require('fs');var path=require(_0x1892('0x5'));var rimraf=require('rimraf');var config=require(_0x1892('0x6'));var attributes=require(_0x1892('0x7'));module[_0x1892('0x8')]=function(_0xe222c3,_0x1401a6){return _0xe222c3[_0x1892('0x9')](_0x1892('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x437e=['Template','tools_templates','util','../../config/logger','bluebird','request-promise','path','./template.attributes','exports'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x437e,0xda));var _0xe437=function(_0x14f457,_0x540565){_0x14f457=_0x14f457-0x0;var _0x51056d=_0x437e[_0x14f457];return _0x51056d;};'use strict';var _=require('lodash');var util=require(_0xe437('0x0'));var logger=require(_0xe437('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe437('0x2'));var rp=require(_0xe437('0x3'));var fs=require('fs');var path=require(_0xe437('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe437('0x5'));module[_0xe437('0x6')]=function(_0x12ebfe,_0x44a63d){return _0x12ebfe['define'](_0xe437('0x7'),attributes,{'tableName':_0xe437('0x8'),'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 fd23865..8dbf06d 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 _0xc50b=['attributes','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetTemplate','Template','findAll','options','raw','where','include','model'];(function(_0x782d78,_0x5ec4fe){var _0x4ef52b=function(_0x22f4b9){while(--_0x22f4b9){_0x782d78['push'](_0x782d78['shift']());}};_0x4ef52b(++_0x5ec4fe);}(_0xc50b,0x151));var _0xbc50=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xc50b[_0x28394f];return _0x2618d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbc50('0x0'));var BPromise=require(_0xbc50('0x1'));var rs=require(_0xbc50('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc50('0x3'))(_0xbc50('0x4'));var config=require(_0xbc50('0x5'));var jayson=require(_0xbc50('0x6'));var client=jayson['client'][_0xbc50('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1246bd,_0x535fc0,_0x25efc6){return new BPromise(function(_0x5bc9c0,_0x1fc809){return client['request'](_0x1246bd,_0x25efc6)[_0xbc50('0x8')](function(_0x141b18){logger['info'](_0xbc50('0x9'),_0x535fc0,_0xbc50('0xa'));logger[_0xbc50('0xb')]('Template,\x20%s,\x20%s,\x20%s',_0x535fc0,_0xbc50('0xa'),JSON[_0xbc50('0xc')](_0x141b18));if(_0x141b18[_0xbc50('0xd')]){if(_0x141b18[_0xbc50('0xd')][_0xbc50('0xe')]===0x1f4){logger[_0xbc50('0xd')]('Template,\x20%s,\x20%s',_0x535fc0,_0x141b18[_0xbc50('0xd')][_0xbc50('0xf')]);return _0x1fc809(_0x141b18['error'][_0xbc50('0xf')]);}logger[_0xbc50('0xd')](_0xbc50('0x9'),_0x535fc0,_0x141b18[_0xbc50('0xd')][_0xbc50('0xf')]);return _0x5bc9c0(_0x141b18['error'][_0xbc50('0xf')]);}else{logger[_0xbc50('0x10')](_0xbc50('0x9'),_0x535fc0,_0xbc50('0xa'));_0x5bc9c0(_0x141b18[_0xbc50('0x11')][_0xbc50('0xf')]);}})[_0xbc50('0x12')](function(_0x4285f3){logger['error']('Template,\x20%s,\x20%s',_0x535fc0,_0x4285f3);_0x1fc809(_0x4285f3);});});}exports[_0xbc50('0x13')]=function(_0x475dcb){var _0xe79cd4=this;return new Promise(function(_0xb44d1a,_0xc4f2c8){return db[_0xbc50('0x14')][_0xbc50('0x15')]({'raw':_0x475dcb[_0xbc50('0x16')]?_0x475dcb[_0xbc50('0x16')][_0xbc50('0x17')]===undefined?!![]:![]:!![],'where':_0x475dcb[_0xbc50('0x16')]?_0x475dcb['options'][_0xbc50('0x18')]||null:null,'attributes':_0x475dcb['options']?_0x475dcb['options']['attributes']||null:null,'limit':_0x475dcb[_0xbc50('0x16')]?_0x475dcb[_0xbc50('0x16')]['limit']||null:null,'include':_0x475dcb[_0xbc50('0x16')]?_0x475dcb['options'][_0xbc50('0x19')]?_['map'](_0x475dcb[_0xbc50('0x16')]['include'],function(_0x4e3b52){return{'model':db[_0x4e3b52[_0xbc50('0x1a')]],'as':_0x4e3b52['as'],'attributes':_0x4e3b52['attributes'],'include':_0x4e3b52[_0xbc50('0x19')]?_['map'](_0x4e3b52[_0xbc50('0x19')],function(_0x264808){return{'model':db[_0x264808['model']],'as':_0x264808['as'],'attributes':_0x264808['attributes'],'include':_0x264808[_0xbc50('0x19')]?_['map'](_0x264808['include'],function(_0x1e0bb2){return{'model':db[_0x1e0bb2[_0xbc50('0x1a')]],'as':_0x1e0bb2['as'],'attributes':_0x1e0bb2[_0xbc50('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbc50('0x8')](function(_0x37451e){logger['info'](_0xbc50('0x13'),_0x475dcb);logger[_0xbc50('0xb')](_0xbc50('0x13'),_0x475dcb,JSON[_0xbc50('0xc')](_0x37451e));_0xb44d1a(_0x37451e);})[_0xbc50('0x12')](function(_0x44aa5f){logger[_0xbc50('0xd')](_0xbc50('0x13'),_0x44aa5f[_0xbc50('0xf')],_0x475dcb);_0xc4f2c8(_0xe79cd4['error'](0x1f4,_0x44aa5f['message']));});});}; \ No newline at end of file +var _0x0c87=['message','result','GetTemplate','Template','options','raw','where','attributes','limit','map','include','model','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4fd851,_0x3a7855){var _0x2e97ac=function(_0x3c1752){while(--_0x3c1752){_0x4fd851['push'](_0x4fd851['shift']());}};_0x2e97ac(++_0x3a7855);}(_0x0c87,0x1d5));var _0x70c8=function(_0x489577,_0x5ca21c){_0x489577=_0x489577-0x0;var _0x3f7c42=_0x0c87[_0x489577];return _0x3f7c42;};'use strict';var _=require(_0x70c8('0x0'));var util=require(_0x70c8('0x1'));var moment=require(_0x70c8('0x2'));var BPromise=require(_0x70c8('0x3'));var rs=require(_0x70c8('0x4'));var fs=require('fs');var Redis=require(_0x70c8('0x5'));var db=require(_0x70c8('0x6'))['db'];var utils=require(_0x70c8('0x7'));var logger=require(_0x70c8('0x8'))('rpc');var config=require(_0x70c8('0x9'));var jayson=require(_0x70c8('0xa'));var client=jayson['client'][_0x70c8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x308372,_0x30a150,_0x162501){return new BPromise(function(_0x440f68,_0x4e7f1d){return client[_0x70c8('0xc')](_0x308372,_0x162501)[_0x70c8('0xd')](function(_0x143af2){logger[_0x70c8('0xe')](_0x70c8('0xf'),_0x30a150,_0x70c8('0x10'));logger[_0x70c8('0x11')](_0x70c8('0x12'),_0x30a150,'request\x20sent',JSON['stringify'](_0x143af2));if(_0x143af2[_0x70c8('0x13')]){if(_0x143af2[_0x70c8('0x13')][_0x70c8('0x14')]===0x1f4){logger[_0x70c8('0x13')](_0x70c8('0xf'),_0x30a150,_0x143af2[_0x70c8('0x13')][_0x70c8('0x15')]);return _0x4e7f1d(_0x143af2[_0x70c8('0x13')]['message']);}logger[_0x70c8('0x13')](_0x70c8('0xf'),_0x30a150,_0x143af2[_0x70c8('0x13')][_0x70c8('0x15')]);return _0x440f68(_0x143af2[_0x70c8('0x13')]['message']);}else{logger[_0x70c8('0xe')](_0x70c8('0xf'),_0x30a150,_0x70c8('0x10'));_0x440f68(_0x143af2[_0x70c8('0x16')][_0x70c8('0x15')]);}})['catch'](function(_0x1cc343){logger[_0x70c8('0x13')](_0x70c8('0xf'),_0x30a150,_0x1cc343);_0x4e7f1d(_0x1cc343);});});}exports[_0x70c8('0x17')]=function(_0x3db296){var _0x206e43=this;return new Promise(function(_0xf22a97,_0x23333f){return db[_0x70c8('0x18')]['findAll']({'raw':_0x3db296['options']?_0x3db296[_0x70c8('0x19')][_0x70c8('0x1a')]===undefined?!![]:![]:!![],'where':_0x3db296[_0x70c8('0x19')]?_0x3db296[_0x70c8('0x19')][_0x70c8('0x1b')]||null:null,'attributes':_0x3db296[_0x70c8('0x19')]?_0x3db296[_0x70c8('0x19')][_0x70c8('0x1c')]||null:null,'limit':_0x3db296[_0x70c8('0x19')]?_0x3db296['options'][_0x70c8('0x1d')]||null:null,'include':_0x3db296[_0x70c8('0x19')]?_0x3db296[_0x70c8('0x19')]['include']?_[_0x70c8('0x1e')](_0x3db296[_0x70c8('0x19')][_0x70c8('0x1f')],function(_0x3adedd){return{'model':db[_0x3adedd[_0x70c8('0x20')]],'as':_0x3adedd['as'],'attributes':_0x3adedd[_0x70c8('0x1c')],'include':_0x3adedd['include']?_['map'](_0x3adedd[_0x70c8('0x1f')],function(_0x550009){return{'model':db[_0x550009[_0x70c8('0x20')]],'as':_0x550009['as'],'attributes':_0x550009[_0x70c8('0x1c')],'include':_0x550009[_0x70c8('0x1f')]?_[_0x70c8('0x1e')](_0x550009[_0x70c8('0x1f')],function(_0x502cc7){return{'model':db[_0x502cc7[_0x70c8('0x20')]],'as':_0x502cc7['as'],'attributes':_0x502cc7[_0x70c8('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe2f483){logger[_0x70c8('0xe')]('GetTemplate',_0x3db296);logger[_0x70c8('0x11')](_0x70c8('0x17'),_0x3db296,JSON[_0x70c8('0x21')](_0xe2f483));_0xf22a97(_0xe2f483);})[_0x70c8('0x22')](function(_0x4d0cb5){logger['error']('GetTemplate',_0x4d0cb5[_0x70c8('0x15')],_0x3db296);_0x23333f(_0x206e43['error'](0x1f4,_0x4d0cb5[_0x70c8('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 0608707..68fb5e2 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 _0xb9dd=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','post','addAllCondition','addAnyCondition','addAction','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2d310a,_0x489040){var _0x2f9a4a=function(_0x5384a9){while(--_0x5384a9){_0x2d310a['push'](_0x2d310a['shift']());}};_0x2f9a4a(++_0x489040);}(_0xb9dd,0x74));var _0xdb9d=function(_0x4a98b5,_0x2f831b){_0x4a98b5=_0x4a98b5-0x0;var _0x40a82e=_0xb9dd[_0x4a98b5];return _0x40a82e;};'use strict';var multer=require(_0xdb9d('0x0'));var util=require(_0xdb9d('0x1'));var path=require(_0xdb9d('0x2'));var timeout=require(_0xdb9d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdb9d('0x4'));var auth=require(_0xdb9d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdb9d('0x6'));var controller=require('./trigger.controller');router[_0xdb9d('0x7')]('/',auth[_0xdb9d('0x8')](),controller[_0xdb9d('0x9')]);router[_0xdb9d('0x7')](_0xdb9d('0xa'),auth[_0xdb9d('0x8')](),controller['show']);router[_0xdb9d('0x7')](_0xdb9d('0xb'),auth['isAuthenticated'](),controller[_0xdb9d('0xc')]);router['get'](_0xdb9d('0xd'),auth[_0xdb9d('0x8')](),controller[_0xdb9d('0xe')]);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0xdb9d('0xf')]);router[_0xdb9d('0x10')]('/',auth[_0xdb9d('0x8')](),controller['create']);router[_0xdb9d('0x10')](_0xdb9d('0xb'),auth[_0xdb9d('0x8')](),controller[_0xdb9d('0x11')]);router['post'](_0xdb9d('0xd'),auth[_0xdb9d('0x8')](),controller[_0xdb9d('0x12')]);router[_0xdb9d('0x10')]('/:id/actions',auth[_0xdb9d('0x8')](),controller[_0xdb9d('0x13')]);router[_0xdb9d('0x14')](_0xdb9d('0xa'),auth[_0xdb9d('0x8')](),controller['update']);router[_0xdb9d('0x15')](_0xdb9d('0xa'),auth[_0xdb9d('0x8')](),controller[_0xdb9d('0x16')]);module[_0xdb9d('0x17')]=router; \ No newline at end of file +var _0x21aa=['show','/:id/any_conditions','getAnyConditions','getActions','post','create','/:id/all_conditions','addAllCondition','addAnyCondition','put','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','/:id'];(function(_0x21b978,_0xb7c23e){var _0x24ccbf=function(_0x37cec0){while(--_0x37cec0){_0x21b978['push'](_0x21b978['shift']());}};_0x24ccbf(++_0xb7c23e);}(_0x21aa,0x154));var _0xa21a=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x21aa[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0xa21a('0x0'));var util=require('util');var path=require(_0xa21a('0x1'));var timeout=require(_0xa21a('0x2'));var express=require(_0xa21a('0x3'));var router=express[_0xa21a('0x4')]();var fs_extra=require(_0xa21a('0x5'));var auth=require(_0xa21a('0x6'));var interaction=require(_0xa21a('0x7'));var config=require('../../config/environment');var controller=require(_0xa21a('0x8'));router[_0xa21a('0x9')]('/',auth[_0xa21a('0xa')](),controller['index']);router['get'](_0xa21a('0xb'),auth[_0xa21a('0xa')](),controller[_0xa21a('0xc')]);router['get']('/:id/all_conditions',auth['isAuthenticated'](),controller['getAllConditions']);router[_0xa21a('0x9')](_0xa21a('0xd'),auth[_0xa21a('0xa')](),controller[_0xa21a('0xe')]);router[_0xa21a('0x9')]('/:id/actions',auth[_0xa21a('0xa')](),controller[_0xa21a('0xf')]);router[_0xa21a('0x10')]('/',auth[_0xa21a('0xa')](),controller[_0xa21a('0x11')]);router[_0xa21a('0x10')](_0xa21a('0x12'),auth[_0xa21a('0xa')](),controller[_0xa21a('0x13')]);router[_0xa21a('0x10')](_0xa21a('0xd'),auth[_0xa21a('0xa')](),controller[_0xa21a('0x14')]);router[_0xa21a('0x10')]('/:id/actions',auth['isAuthenticated'](),controller['addAction']);router[_0xa21a('0x15')](_0xa21a('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 769dab8..5575fbb 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 _0xb509=['exports','STRING','sequelize'];(function(_0x529870,_0x975245){var _0x39435f=function(_0x408986){while(--_0x408986){_0x529870['push'](_0x529870['shift']());}};_0x39435f(++_0x975245);}(_0xb509,0xd7));var _0x9b50=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xb509[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require(_0x9b50('0x0'));module[_0x9b50('0x1')]={'name':{'type':Sequelize[_0x9b50('0x2')]},'channel':{'type':Sequelize[_0x9b50('0x2')]},'description':{'type':Sequelize[_0x9b50('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa1f6=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3907a3,_0x21b55e){var _0x53ea7f=function(_0x2e9faa){while(--_0x2e9faa){_0x3907a3['push'](_0x3907a3['shift']());}};_0x53ea7f(++_0x21b55e);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x1602fb,_0x20b6b3){_0x1602fb=_0x1602fb-0x0;var _0x461831=_0xa1f6[_0x1602fb];return _0x461831;};'use strict';var Sequelize=require(_0x6a1f('0x0'));module[_0x6a1f('0x1')]={'name':{'type':Sequelize[_0x6a1f('0x2')]},'channel':{'type':Sequelize[_0x6a1f('0x2')]},'description':{'type':Sequelize[_0x6a1f('0x2')]},'status':{'type':Sequelize[_0x6a1f('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index f33b74e..5d179b9 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 _0xf535=['offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Trigger','include','findAll','catch','show','params','keys','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAnyCondition','TriggerAnyId','getAllConditions','findOne','Condition','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count'];(function(_0x13f5d1,_0x12e3f7){var _0x5621f3=function(_0x3e589e){while(--_0x3e589e){_0x13f5d1['push'](_0x13f5d1['shift']());}};_0x5621f3(++_0x12e3f7);}(_0xf535,0x1d7));var _0x5f53=function(_0xcab4db,_0x1df7c0){_0xcab4db=_0xcab4db-0x0;var _0x19b3b2=_0xf535[_0xcab4db];return _0x19b3b2;};'use strict';var emlformat=require(_0x5f53('0x0'));var rimraf=require(_0x5f53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5f53('0x2'));var rp=require(_0x5f53('0x3'));var moment=require(_0x5f53('0x4'));var BPromise=require(_0x5f53('0x5'));var Mustache=require(_0x5f53('0x6'));var util=require(_0x5f53('0x7'));var path=require('path');var sox=require(_0x5f53('0x8'));var csv=require(_0x5f53('0x9'));var ejs=require(_0x5f53('0xa'));var fs=require('fs');var fs_extra=require(_0x5f53('0xb'));var _=require(_0x5f53('0xc'));var squel=require(_0x5f53('0xd'));var crypto=require(_0x5f53('0xe'));var jsforce=require(_0x5f53('0xf'));var deskjs=require(_0x5f53('0x10'));var toCsv=require(_0x5f53('0x9'));var querystring=require(_0x5f53('0x11'));var Papa=require(_0x5f53('0x12'));var Redis=require(_0x5f53('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5f53('0x14'));var as=require(_0x5f53('0x15'));var hardwareService=require(_0x5f53('0x16'));var logger=require(_0x5f53('0x17'))(_0x5f53('0x18'));var utils=require(_0x5f53('0x19'));var config=require(_0x5f53('0x1a'));var licenseUtil=require(_0x5f53('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52e915,_0x5e0deb){_0x5e0deb=_0x5e0deb||0xcc;return function(_0x33352e){if(_0x33352e){return _0x52e915[_0x5f53('0x1c')](_0x5e0deb);}return _0x52e915[_0x5f53('0x1d')](_0x5e0deb)[_0x5f53('0x1e')]();};}function respondWithResult(_0x50a9d7,_0x9c13f8){_0x9c13f8=_0x9c13f8||0xc8;return function(_0x4ab81e){if(_0x4ab81e){return _0x50a9d7[_0x5f53('0x1d')](_0x9c13f8)[_0x5f53('0x1f')](_0x4ab81e);}};}function respondWithFilteredResult(_0x467cdc,_0x3fdd60){return function(_0xf0962b){if(_0xf0962b){var _0x99a0b8=typeof _0x3fdd60['offset']===_0x5f53('0x20')&&typeof _0x3fdd60['limit']===_0x5f53('0x20');var _0x5deda0=_0xf0962b[_0x5f53('0x21')];var _0xfaaecd=_0x99a0b8?0x0:_0x3fdd60[_0x5f53('0x22')];var _0x3921af=_0x99a0b8?_0xf0962b[_0x5f53('0x21')]:_0x3fdd60[_0x5f53('0x22')]+_0x3fdd60['limit'];var _0x45d912;if(_0x3921af>=_0x5deda0){_0x3921af=_0x5deda0;_0x45d912=0xc8;}else{_0x45d912=0xce;}_0x467cdc[_0x5f53('0x1d')](_0x45d912);return _0x467cdc[_0x5f53('0x23')](_0x5f53('0x24'),_0xfaaecd+'-'+_0x3921af+'/'+_0x5deda0)[_0x5f53('0x1f')](_0xf0962b);}return null;};}function patchUpdates(_0x391863){return function(_0x154934){try{jsonpatch[_0x5f53('0x25')](_0x154934,_0x391863,!![]);}catch(_0x435819){return BPromise[_0x5f53('0x26')](_0x435819);}return _0x154934[_0x5f53('0x27')]();};}function saveUpdates(_0x38b04d,_0x3078ea){return function(_0x3f1204){if(_0x3f1204){return _0x3f1204[_0x5f53('0x28')](_0x38b04d)[_0x5f53('0x29')](function(_0x1c42e3){return _0x1c42e3;});}return null;};}function removeEntity(_0x5641bd,_0xd33af0){return function(_0x8224fb){if(_0x8224fb){return _0x8224fb[_0x5f53('0x2a')]()[_0x5f53('0x29')](function(){var _0x2cb3d6=_0x8224fb[_0x5f53('0x2b')]({'plain':!![]});var _0xc04805=_0x5f53('0x2c');return db[_0x5f53('0x2d')][_0x5f53('0x2a')]({'where':{'type':_0xc04805,'resourceId':_0x2cb3d6['id']}})['then'](function(){return _0x8224fb;});})[_0x5f53('0x29')](function(){_0x5641bd[_0x5f53('0x1d')](0xcc)[_0x5f53('0x1e')]();});}};}function handleEntityNotFound(_0x234253,_0x2c61b4){return function(_0x4bf1ed){if(!_0x4bf1ed){_0x234253[_0x5f53('0x1c')](0x194);}return _0x4bf1ed;};}function handleError(_0x196790,_0x514c56){_0x514c56=_0x514c56||0x1f4;return function(_0xfec7de){logger[_0x5f53('0x2e')](_0xfec7de[_0x5f53('0x2f')]);if(_0xfec7de[_0x5f53('0x30')]){delete _0xfec7de['name'];}_0x196790[_0x5f53('0x1d')](_0x514c56)[_0x5f53('0x31')](_0xfec7de);};}exports[_0x5f53('0x32')]=function(_0x4c6b12,_0x48bd7c){var _0xcc5cbe={},_0x100d7a={},_0x3ab227={'count':0x0,'rows':[]};var _0x4844cc=_['map'](db['Trigger'][_0x5f53('0x33')],function(_0x41d7a1){return{'name':_0x41d7a1[_0x5f53('0x34')],'type':_0x41d7a1[_0x5f53('0x35')][_0x5f53('0x36')]};});_0x100d7a[_0x5f53('0x37')]=_[_0x5f53('0x38')](_0x4844cc,_0x5f53('0x30'));_0x100d7a[_0x5f53('0x39')]=_['keys'](_0x4c6b12[_0x5f53('0x39')]);_0x100d7a[_0x5f53('0x3a')]=_[_0x5f53('0x3b')](_0x100d7a[_0x5f53('0x37')],_0x100d7a[_0x5f53('0x39')]);_0xcc5cbe['attributes']=_[_0x5f53('0x3b')](_0x100d7a[_0x5f53('0x37')],qs['fields'](_0x4c6b12['query'][_0x5f53('0x3c')]));_0xcc5cbe[_0x5f53('0x3d')]=_0xcc5cbe[_0x5f53('0x3d')][_0x5f53('0x3e')]?_0xcc5cbe[_0x5f53('0x3d')]:_0x100d7a[_0x5f53('0x37')];if(!_0x4c6b12[_0x5f53('0x39')][_0x5f53('0x3f')](_0x5f53('0x40'))){_0xcc5cbe[_0x5f53('0x41')]=qs[_0x5f53('0x41')](_0x4c6b12[_0x5f53('0x39')]['limit']);_0xcc5cbe['offset']=qs['offset'](_0x4c6b12[_0x5f53('0x39')]['offset']);}_0xcc5cbe[_0x5f53('0x42')]=qs[_0x5f53('0x43')](_0x4c6b12[_0x5f53('0x39')][_0x5f53('0x43')]);_0xcc5cbe[_0x5f53('0x44')]=qs[_0x5f53('0x3a')](_[_0x5f53('0x45')](_0x4c6b12[_0x5f53('0x39')],_0x100d7a[_0x5f53('0x3a')]),_0x4844cc);if(_0x4c6b12[_0x5f53('0x39')][_0x5f53('0x46')]){_0xcc5cbe['where']=_[_0x5f53('0x47')](_0xcc5cbe[_0x5f53('0x44')],{'$or':_[_0x5f53('0x38')](_0x4844cc,function(_0x35449d){if(_0x35449d['type']!==_0x5f53('0x48')){var _0x3e0c2d={};_0x3e0c2d[_0x35449d[_0x5f53('0x30')]]={'$like':'%'+_0x4c6b12[_0x5f53('0x39')][_0x5f53('0x46')]+'%'};return _0x3e0c2d;}})});}_0xcc5cbe=_['merge']({},_0xcc5cbe,_0x4c6b12[_0x5f53('0x49')]);var _0x3806d={'where':_0xcc5cbe[_0x5f53('0x44')]};return db[_0x5f53('0x4a')]['count'](_0x3806d)[_0x5f53('0x29')](function(_0x2f3f4b){_0x3ab227[_0x5f53('0x21')]=_0x2f3f4b;if(_0x4c6b12['query']['includeAll']){_0xcc5cbe[_0x5f53('0x4b')]=[{'all':!![]}];}return db['Trigger'][_0x5f53('0x4c')](_0xcc5cbe);})[_0x5f53('0x29')](function(_0x36753b){_0x3ab227['rows']=_0x36753b;return _0x3ab227;})[_0x5f53('0x29')](respondWithFilteredResult(_0x48bd7c,_0xcc5cbe))[_0x5f53('0x4d')](handleError(_0x48bd7c,null));};exports[_0x5f53('0x4e')]=function(_0x2dd9a3,_0x3210da){var _0x1a66e5={'raw':![],'where':{'id':_0x2dd9a3[_0x5f53('0x4f')]['id']}},_0xfc1410={};_0xfc1410[_0x5f53('0x37')]=_[_0x5f53('0x50')](db['Trigger'][_0x5f53('0x33')]);_0xfc1410['query']=_[_0x5f53('0x50')](_0x2dd9a3['query']);_0xfc1410['filters']=_['intersection'](_0xfc1410[_0x5f53('0x37')],_0xfc1410[_0x5f53('0x39')]);_0x1a66e5['attributes']=_[_0x5f53('0x3b')](_0xfc1410[_0x5f53('0x37')],qs[_0x5f53('0x3c')](_0x2dd9a3[_0x5f53('0x39')][_0x5f53('0x3c')]));_0x1a66e5[_0x5f53('0x3d')]=_0x1a66e5[_0x5f53('0x3d')][_0x5f53('0x3e')]?_0x1a66e5[_0x5f53('0x3d')]:_0xfc1410[_0x5f53('0x37')];if(_0x2dd9a3[_0x5f53('0x39')][_0x5f53('0x51')]){_0x1a66e5[_0x5f53('0x4b')]=[{'all':!![]}];}_0x1a66e5=_[_0x5f53('0x47')]({},_0x1a66e5,_0x2dd9a3[_0x5f53('0x49')]);return db['Trigger'][_0x5f53('0x52')](_0x1a66e5)[_0x5f53('0x29')](handleEntityNotFound(_0x3210da,null))[_0x5f53('0x29')](respondWithResult(_0x3210da,null))[_0x5f53('0x4d')](handleError(_0x3210da,null));};exports[_0x5f53('0x53')]=function(_0xba9d8,_0x3bd3cc){return db[_0x5f53('0x4a')]['create'](_0xba9d8[_0x5f53('0x54')],{})[_0x5f53('0x29')](function(_0x2918e7){var _0x4aad0d=_0xba9d8[_0x5f53('0x55')][_0x5f53('0x2b')]({'plain':!![]});if(!_0x4aad0d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4aad0d[_0x5f53('0x56')]==='user'){var _0x35eaea=_0x2918e7['get']({'plain':!![]});var _0x449c03=_0x5f53('0x2c');return db[_0x5f53('0x57')][_0x5f53('0x52')]({'where':{'name':_0x449c03,'userProfileId':_0x4aad0d[_0x5f53('0x58')]},'raw':!![]})[_0x5f53('0x29')](function(_0x27234d){if(_0x27234d&&_0x27234d[_0x5f53('0x59')]===0x0){return db[_0x5f53('0x2d')][_0x5f53('0x53')]({'name':_0x35eaea['name'],'resourceId':_0x35eaea['id'],'type':_0x27234d['name'],'sectionId':_0x27234d['id']},{})[_0x5f53('0x29')](function(){return _0x2918e7;});}else{return _0x2918e7;}})[_0x5f53('0x4d')](function(_0x4aacea){logger['error'](_0x5f53('0x5a'),_0x4aacea);throw _0x4aacea;});}return _0x2918e7;})[_0x5f53('0x29')](respondWithResult(_0x3bd3cc,0xc9))[_0x5f53('0x4d')](handleError(_0x3bd3cc,null));};exports[_0x5f53('0x28')]=function(_0x125f82,_0x4b4b46){if(_0x125f82[_0x5f53('0x54')]['id']){delete _0x125f82[_0x5f53('0x54')]['id'];}return db[_0x5f53('0x4a')][_0x5f53('0x52')]({'where':{'id':_0x125f82[_0x5f53('0x4f')]['id']}})[_0x5f53('0x29')](handleEntityNotFound(_0x4b4b46,null))[_0x5f53('0x29')](saveUpdates(_0x125f82['body'],null))[_0x5f53('0x29')](respondWithResult(_0x4b4b46,null))[_0x5f53('0x4d')](handleError(_0x4b4b46,null));};exports[_0x5f53('0x2a')]=function(_0x465505,_0x4a21f6){return db[_0x5f53('0x4a')]['find']({'where':{'id':_0x465505[_0x5f53('0x4f')]['id']}})[_0x5f53('0x29')](handleEntityNotFound(_0x4a21f6,null))[_0x5f53('0x29')](removeEntity(_0x4a21f6,null))['catch'](handleError(_0x4a21f6,null));};exports['addAllCondition']=function(_0xb7642b,_0x4defff,_0x35239e){if(_0xb7642b[_0x5f53('0x54')]['id']){delete _0xb7642b[_0x5f53('0x54')]['id'];}return db[_0x5f53('0x4a')]['find']({'where':{'id':_0xb7642b[_0x5f53('0x4f')]['id']}})[_0x5f53('0x29')](handleEntityNotFound(_0x4defff,null))[_0x5f53('0x29')](function(_0xcff731){if(_0xcff731){_0xb7642b['body']['TriggerAllId']=_0xcff731['id'];return db['Condition'][_0x5f53('0x53')](_0xb7642b[_0x5f53('0x54')]);}})['then'](respondWithResult(_0x4defff,null))['catch'](handleError(_0x4defff,null));};exports[_0x5f53('0x5b')]=function(_0x1d57d4,_0x19e077,_0x4674c1){if(_0x1d57d4[_0x5f53('0x54')]['id']){delete _0x1d57d4['body']['id'];}return db['Trigger'][_0x5f53('0x52')]({'where':{'id':_0x1d57d4[_0x5f53('0x4f')]['id']}})['then'](handleEntityNotFound(_0x19e077,null))[_0x5f53('0x29')](function(_0x437b3e){if(_0x437b3e){_0x1d57d4['body'][_0x5f53('0x5c')]=_0x437b3e['id'];return db['Condition']['create'](_0x1d57d4[_0x5f53('0x54')]);}})[_0x5f53('0x29')](respondWithResult(_0x19e077,null))[_0x5f53('0x4d')](handleError(_0x19e077,null));};exports[_0x5f53('0x5d')]=function(_0x4fac53,_0xff3e1c,_0x476017){var _0x1193e0={};var _0x13c7ff={};var _0x55b605;var _0x1bc520;return db[_0x5f53('0x4a')][_0x5f53('0x5e')]({'where':{'id':_0x4fac53[_0x5f53('0x4f')]['id']}})[_0x5f53('0x29')](handleEntityNotFound(_0xff3e1c,null))['then'](function(_0x53b9c4){if(_0x53b9c4){_0x55b605=_0x53b9c4;_0x13c7ff[_0x5f53('0x37')]=_[_0x5f53('0x50')](db[_0x5f53('0x5f')][_0x5f53('0x33')]);_0x13c7ff[_0x5f53('0x39')]=_[_0x5f53('0x50')](_0x4fac53[_0x5f53('0x39')]);_0x13c7ff[_0x5f53('0x3a')]=_[_0x5f53('0x3b')](_0x13c7ff[_0x5f53('0x37')],_0x13c7ff[_0x5f53('0x39')]);_0x1193e0[_0x5f53('0x3d')]=_[_0x5f53('0x3b')](_0x13c7ff[_0x5f53('0x37')],qs[_0x5f53('0x3c')](_0x4fac53[_0x5f53('0x39')][_0x5f53('0x3c')]));_0x1193e0['attributes']=_0x1193e0[_0x5f53('0x3d')][_0x5f53('0x3e')]?_0x1193e0[_0x5f53('0x3d')]:_0x13c7ff[_0x5f53('0x37')];_0x1193e0[_0x5f53('0x42')]=qs[_0x5f53('0x43')](_0x4fac53['query'][_0x5f53('0x43')]);_0x1193e0[_0x5f53('0x44')]=qs[_0x5f53('0x3a')](_[_0x5f53('0x45')](_0x4fac53['query'],_0x13c7ff[_0x5f53('0x3a')]));if(_0x4fac53[_0x5f53('0x39')]['filter']){_0x1193e0['where']=_[_0x5f53('0x47')](_0x1193e0[_0x5f53('0x44')],{'$or':_['map'](_0x1193e0['attributes'],function(_0x178434){var _0x38ad7c={};_0x38ad7c[_0x178434]={'$like':'%'+_0x4fac53[_0x5f53('0x39')][_0x5f53('0x46')]+'%'};return _0x38ad7c;})});}_0x1193e0=_[_0x5f53('0x47')]({},_0x1193e0,_0x4fac53['options']);return _0x55b605[_0x5f53('0x5d')](_0x1193e0);}})[_0x5f53('0x29')](function(_0xfe98af){if(_0xfe98af){_0x1bc520=_0xfe98af['length'];if(!_0x4fac53[_0x5f53('0x39')][_0x5f53('0x3f')](_0x5f53('0x40'))){_0x1193e0['limit']=qs[_0x5f53('0x41')](_0x4fac53[_0x5f53('0x39')][_0x5f53('0x41')]);_0x1193e0['offset']=qs[_0x5f53('0x22')](_0x4fac53[_0x5f53('0x39')][_0x5f53('0x22')]);}return _0x55b605[_0x5f53('0x5d')](_0x1193e0);}})[_0x5f53('0x29')](function(_0x1eca52){if(_0x1eca52){return _0x1eca52?{'count':_0x1bc520,'rows':_0x1eca52}:null;}})[_0x5f53('0x29')](respondWithResult(_0xff3e1c,null))[_0x5f53('0x4d')](handleError(_0xff3e1c,null));};exports[_0x5f53('0x60')]=function(_0x4f02a1,_0x53dc45,_0xd25011){var _0x755e65={};var _0x218957={};var _0x4f3759;var _0x25ad92;return db['Trigger'][_0x5f53('0x5e')]({'where':{'id':_0x4f02a1[_0x5f53('0x4f')]['id']}})[_0x5f53('0x29')](handleEntityNotFound(_0x53dc45,null))[_0x5f53('0x29')](function(_0x2b8209){if(_0x2b8209){_0x4f3759=_0x2b8209;_0x218957['model']=_[_0x5f53('0x50')](db[_0x5f53('0x5f')][_0x5f53('0x33')]);_0x218957[_0x5f53('0x39')]=_[_0x5f53('0x50')](_0x4f02a1[_0x5f53('0x39')]);_0x218957[_0x5f53('0x3a')]=_[_0x5f53('0x3b')](_0x218957[_0x5f53('0x37')],_0x218957[_0x5f53('0x39')]);_0x755e65[_0x5f53('0x3d')]=_[_0x5f53('0x3b')](_0x218957[_0x5f53('0x37')],qs[_0x5f53('0x3c')](_0x4f02a1[_0x5f53('0x39')][_0x5f53('0x3c')]));_0x755e65[_0x5f53('0x3d')]=_0x755e65['attributes']['length']?_0x755e65['attributes']:_0x218957[_0x5f53('0x37')];_0x755e65['order']=qs[_0x5f53('0x43')](_0x4f02a1['query']['sort']);_0x755e65[_0x5f53('0x44')]=qs[_0x5f53('0x3a')](_[_0x5f53('0x45')](_0x4f02a1[_0x5f53('0x39')],_0x218957[_0x5f53('0x3a')]));if(_0x4f02a1['query']['filter']){_0x755e65['where']=_[_0x5f53('0x47')](_0x755e65[_0x5f53('0x44')],{'$or':_['map'](_0x755e65['attributes'],function(_0x287b81){var _0x2b12e5={};_0x2b12e5[_0x287b81]={'$like':'%'+_0x4f02a1[_0x5f53('0x39')][_0x5f53('0x46')]+'%'};return _0x2b12e5;})});}_0x755e65=_[_0x5f53('0x47')]({},_0x755e65,_0x4f02a1[_0x5f53('0x49')]);return _0x4f3759[_0x5f53('0x60')](_0x755e65);}})[_0x5f53('0x29')](function(_0x16583c){if(_0x16583c){_0x25ad92=_0x16583c[_0x5f53('0x3e')];if(!_0x4f02a1['query']['hasOwnProperty'](_0x5f53('0x40'))){_0x755e65[_0x5f53('0x41')]=qs[_0x5f53('0x41')](_0x4f02a1['query'][_0x5f53('0x41')]);_0x755e65[_0x5f53('0x22')]=qs[_0x5f53('0x22')](_0x4f02a1['query']['offset']);}return _0x4f3759[_0x5f53('0x60')](_0x755e65);}})[_0x5f53('0x29')](function(_0x354bc3){if(_0x354bc3){return _0x354bc3?{'count':_0x25ad92,'rows':_0x354bc3}:null;}})[_0x5f53('0x29')](respondWithResult(_0x53dc45,null))[_0x5f53('0x4d')](handleError(_0x53dc45,null));};exports[_0x5f53('0x61')]=function(_0x5c3836,_0x219275,_0x2af912){if(_0x5c3836['body']['id']){delete _0x5c3836[_0x5f53('0x54')]['id'];}return db[_0x5f53('0x4a')][_0x5f53('0x52')]({'where':{'id':_0x5c3836[_0x5f53('0x4f')]['id']}})[_0x5f53('0x29')](handleEntityNotFound(_0x219275,null))['then'](function(_0x4c7ea8){if(_0x4c7ea8){_0x5c3836['body'][_0x5f53('0x62')]=_0x4c7ea8['id'];return db[_0x5f53('0x63')][_0x5f53('0x53')](_0x5c3836[_0x5f53('0x54')]);}})[_0x5f53('0x29')](respondWithResult(_0x219275,null))[_0x5f53('0x4d')](handleError(_0x219275,null));};exports[_0x5f53('0x64')]=function(_0x54f358,_0x1a20c9,_0x39a758){var _0x34c747={};var _0x479e66={};var _0x38bc8d;var _0x1db95c;return db[_0x5f53('0x4a')][_0x5f53('0x5e')]({'where':{'id':_0x54f358[_0x5f53('0x4f')]['id']}})[_0x5f53('0x29')](handleEntityNotFound(_0x1a20c9,null))[_0x5f53('0x29')](function(_0x53b868){if(_0x53b868){_0x38bc8d=_0x53b868;_0x479e66['model']=_['keys'](db[_0x5f53('0x63')]['rawAttributes']);_0x479e66['query']=_[_0x5f53('0x50')](_0x54f358[_0x5f53('0x39')]);_0x479e66[_0x5f53('0x3a')]=_[_0x5f53('0x3b')](_0x479e66[_0x5f53('0x37')],_0x479e66['query']);_0x34c747['attributes']=_[_0x5f53('0x3b')](_0x479e66[_0x5f53('0x37')],qs['fields'](_0x54f358[_0x5f53('0x39')][_0x5f53('0x3c')]));_0x34c747['attributes']=_0x34c747[_0x5f53('0x3d')][_0x5f53('0x3e')]?_0x34c747[_0x5f53('0x3d')]:_0x479e66[_0x5f53('0x37')];_0x34c747[_0x5f53('0x42')]=qs[_0x5f53('0x43')](_0x54f358[_0x5f53('0x39')][_0x5f53('0x43')]);_0x34c747[_0x5f53('0x44')]=qs[_0x5f53('0x3a')](_['pick'](_0x54f358['query'],_0x479e66[_0x5f53('0x3a')]));if(_0x54f358[_0x5f53('0x39')][_0x5f53('0x46')]){_0x34c747['where']=_[_0x5f53('0x47')](_0x34c747[_0x5f53('0x44')],{'$or':_[_0x5f53('0x38')](_0x34c747[_0x5f53('0x3d')],function(_0x1d09dd){var _0x2ef1c1={};_0x2ef1c1[_0x1d09dd]={'$like':'%'+_0x54f358['query'][_0x5f53('0x46')]+'%'};return _0x2ef1c1;})});}_0x34c747=_[_0x5f53('0x47')]({},_0x34c747,_0x54f358[_0x5f53('0x49')]);return _0x38bc8d['getActions'](_0x34c747);}})[_0x5f53('0x29')](function(_0x213c5d){if(_0x213c5d){_0x1db95c=_0x213c5d[_0x5f53('0x3e')];if(!_0x54f358[_0x5f53('0x39')][_0x5f53('0x3f')](_0x5f53('0x40'))){_0x34c747[_0x5f53('0x41')]=qs[_0x5f53('0x41')](_0x54f358['query'][_0x5f53('0x41')]);_0x34c747[_0x5f53('0x22')]=qs['offset'](_0x54f358[_0x5f53('0x39')][_0x5f53('0x22')]);}return _0x38bc8d[_0x5f53('0x64')](_0x34c747);}})['then'](function(_0x3e1f3e){if(_0x3e1f3e){return _0x3e1f3e?{'count':_0x1db95c,'rows':_0x3e1f3e}:null;}})['then'](respondWithResult(_0x1a20c9,null))[_0x5f53('0x4d')](handleError(_0x1a20c9,null));}; \ No newline at end of file +var _0x3146=['sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','type','VIRTUAL','options','Trigger','includeAll','findAll','rows','catch','params','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','sort','nolimit','getAnyConditions','rawAttributes','TriggerId','getActions','Action','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path'];(function(_0x19c274,_0x3cbbbf){var _0x410aa3=function(_0x23f69a){while(--_0x23f69a){_0x19c274['push'](_0x19c274['shift']());}};_0x410aa3(++_0x3cbbbf);}(_0x3146,0xb7));var _0x6314=function(_0x1af225,_0x46edd2){_0x1af225=_0x1af225-0x0;var _0x4bd6b3=_0x3146[_0x1af225];return _0x4bd6b3;};'use strict';var emlformat=require(_0x6314('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6314('0x1'));var jsonpatch=require(_0x6314('0x2'));var rp=require(_0x6314('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6314('0x4'));var util=require(_0x6314('0x5'));var path=require(_0x6314('0x6'));var sox=require(_0x6314('0x7'));var csv=require(_0x6314('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6314('0x9'));var _=require(_0x6314('0xa'));var squel=require('squel');var crypto=require(_0x6314('0xb'));var jsforce=require(_0x6314('0xc'));var deskjs=require(_0x6314('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6314('0xe'));var Papa=require(_0x6314('0xf'));var Redis=require(_0x6314('0x10'));var authService=require(_0x6314('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6314('0x12'));var logger=require('../../config/logger')(_0x6314('0x13'));var utils=require(_0x6314('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6314('0x15'));var db=require(_0x6314('0x16'))['db'];function respondWithStatusCode(_0x4e8fd4,_0x1e61c9){_0x1e61c9=_0x1e61c9||0xcc;return function(_0x3fbf98){if(_0x3fbf98){return _0x4e8fd4[_0x6314('0x17')](_0x1e61c9);}return _0x4e8fd4['status'](_0x1e61c9)[_0x6314('0x18')]();};}function respondWithResult(_0x5e4c5a,_0x1d9788){_0x1d9788=_0x1d9788||0xc8;return function(_0x6d5145){if(_0x6d5145){return _0x5e4c5a[_0x6314('0x19')](_0x1d9788)[_0x6314('0x1a')](_0x6d5145);}};}function respondWithFilteredResult(_0x61ffc5,_0x13022a){return function(_0x4632ad){if(_0x4632ad){var _0x51992a=typeof _0x13022a[_0x6314('0x1b')]===_0x6314('0x1c')&&typeof _0x13022a[_0x6314('0x1d')]===_0x6314('0x1c');var _0x544a30=_0x4632ad['count'];var _0x565fd2=_0x51992a?0x0:_0x13022a[_0x6314('0x1b')];var _0x12106e=_0x51992a?_0x4632ad[_0x6314('0x1e')]:_0x13022a[_0x6314('0x1b')]+_0x13022a['limit'];var _0x5c713c;if(_0x12106e>=_0x544a30){_0x12106e=_0x544a30;_0x5c713c=0xc8;}else{_0x5c713c=0xce;}_0x61ffc5[_0x6314('0x19')](_0x5c713c);return _0x61ffc5[_0x6314('0x1f')](_0x6314('0x20'),_0x565fd2+'-'+_0x12106e+'/'+_0x544a30)['json'](_0x4632ad);}return null;};}function patchUpdates(_0x5cd253){return function(_0x40c034){try{jsonpatch[_0x6314('0x21')](_0x40c034,_0x5cd253,!![]);}catch(_0x4f1a48){return BPromise[_0x6314('0x22')](_0x4f1a48);}return _0x40c034[_0x6314('0x23')]();};}function saveUpdates(_0x3d3f6c,_0x4ed304){return function(_0x30d0e8){if(_0x30d0e8){return _0x30d0e8['update'](_0x3d3f6c)['then'](function(_0x38c935){return _0x38c935;});}return null;};}function removeEntity(_0x242827,_0x1f9e6f){return function(_0x23fc72){if(_0x23fc72){return _0x23fc72[_0x6314('0x24')]()[_0x6314('0x25')](function(){var _0x4cba52=_0x23fc72[_0x6314('0x26')]({'plain':!![]});var _0xc59759='Triggers';return db['UserProfileResource']['destroy']({'where':{'type':_0xc59759,'resourceId':_0x4cba52['id']}})[_0x6314('0x25')](function(){return _0x23fc72;});})[_0x6314('0x25')](function(){_0x242827['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x13c208,_0x5f2f69){return function(_0x236282){if(!_0x236282){_0x13c208[_0x6314('0x17')](0x194);}return _0x236282;};}function handleError(_0x1883c0,_0x49c3c6){_0x49c3c6=_0x49c3c6||0x1f4;return function(_0x6dbee3){logger['error'](_0x6dbee3[_0x6314('0x27')]);if(_0x6dbee3[_0x6314('0x28')]){delete _0x6dbee3[_0x6314('0x28')];}_0x1883c0['status'](_0x49c3c6)[_0x6314('0x29')](_0x6dbee3);};}exports[_0x6314('0x2a')]=function(_0x4c6512,_0x5e184f){var _0x99af22={},_0x4e6b09={},_0x1b8da0={'count':0x0,'rows':[]};var _0x158398=_[_0x6314('0x2b')](db['Trigger']['rawAttributes'],function(_0x47b3e9){return{'name':_0x47b3e9[_0x6314('0x2c')],'type':_0x47b3e9['type'][_0x6314('0x2d')]};});_0x4e6b09[_0x6314('0x2e')]=_[_0x6314('0x2b')](_0x158398,_0x6314('0x28'));_0x4e6b09[_0x6314('0x2f')]=_[_0x6314('0x30')](_0x4c6512[_0x6314('0x2f')]);_0x4e6b09['filters']=_[_0x6314('0x31')](_0x4e6b09['model'],_0x4e6b09[_0x6314('0x2f')]);_0x99af22[_0x6314('0x32')]=_['intersection'](_0x4e6b09[_0x6314('0x2e')],qs[_0x6314('0x33')](_0x4c6512[_0x6314('0x2f')][_0x6314('0x33')]));_0x99af22[_0x6314('0x32')]=_0x99af22[_0x6314('0x32')][_0x6314('0x34')]?_0x99af22['attributes']:_0x4e6b09[_0x6314('0x2e')];if(!_0x4c6512[_0x6314('0x2f')][_0x6314('0x35')]('nolimit')){_0x99af22['limit']=qs[_0x6314('0x1d')](_0x4c6512[_0x6314('0x2f')][_0x6314('0x1d')]);_0x99af22[_0x6314('0x1b')]=qs[_0x6314('0x1b')](_0x4c6512[_0x6314('0x2f')]['offset']);}_0x99af22[_0x6314('0x36')]=qs['sort'](_0x4c6512[_0x6314('0x2f')]['sort']);_0x99af22[_0x6314('0x37')]=qs[_0x6314('0x38')](_[_0x6314('0x39')](_0x4c6512['query'],_0x4e6b09[_0x6314('0x38')]),_0x158398);if(_0x4c6512[_0x6314('0x2f')][_0x6314('0x3a')]){_0x99af22['where']=_[_0x6314('0x3b')](_0x99af22[_0x6314('0x37')],{'$or':_['map'](_0x158398,function(_0x1fb307){if(_0x1fb307[_0x6314('0x3c')]!==_0x6314('0x3d')){var _0x125113={};_0x125113[_0x1fb307['name']]={'$like':'%'+_0x4c6512[_0x6314('0x2f')][_0x6314('0x3a')]+'%'};return _0x125113;}})});}_0x99af22=_[_0x6314('0x3b')]({},_0x99af22,_0x4c6512[_0x6314('0x3e')]);var _0xf914ff={'where':_0x99af22['where']};return db[_0x6314('0x3f')][_0x6314('0x1e')](_0xf914ff)[_0x6314('0x25')](function(_0xb0af2e){_0x1b8da0['count']=_0xb0af2e;if(_0x4c6512[_0x6314('0x2f')][_0x6314('0x40')]){_0x99af22['include']=[{'all':!![]}];}return db[_0x6314('0x3f')][_0x6314('0x41')](_0x99af22);})[_0x6314('0x25')](function(_0x260d96){_0x1b8da0[_0x6314('0x42')]=_0x260d96;return _0x1b8da0;})[_0x6314('0x25')](respondWithFilteredResult(_0x5e184f,_0x99af22))[_0x6314('0x43')](handleError(_0x5e184f,null));};exports['show']=function(_0x30ef39,_0x5d8742){var _0x3912ec={'raw':![],'where':{'id':_0x30ef39[_0x6314('0x44')]['id']}},_0x489cd3={};_0x489cd3[_0x6314('0x2e')]=_[_0x6314('0x30')](db[_0x6314('0x3f')]['rawAttributes']);_0x489cd3[_0x6314('0x2f')]=_['keys'](_0x30ef39['query']);_0x489cd3[_0x6314('0x38')]=_[_0x6314('0x31')](_0x489cd3[_0x6314('0x2e')],_0x489cd3[_0x6314('0x2f')]);_0x3912ec[_0x6314('0x32')]=_['intersection'](_0x489cd3[_0x6314('0x2e')],qs['fields'](_0x30ef39[_0x6314('0x2f')][_0x6314('0x33')]));_0x3912ec[_0x6314('0x32')]=_0x3912ec[_0x6314('0x32')][_0x6314('0x34')]?_0x3912ec['attributes']:_0x489cd3['model'];if(_0x30ef39[_0x6314('0x2f')][_0x6314('0x40')]){_0x3912ec[_0x6314('0x45')]=[{'all':!![]}];}_0x3912ec=_[_0x6314('0x3b')]({},_0x3912ec,_0x30ef39['options']);return db['Trigger']['find'](_0x3912ec)['then'](handleEntityNotFound(_0x5d8742,null))['then'](respondWithResult(_0x5d8742,null))[_0x6314('0x43')](handleError(_0x5d8742,null));};exports[_0x6314('0x46')]=function(_0x3a825f,_0x4e1bb4){return db[_0x6314('0x3f')]['create'](_0x3a825f['body'],{})[_0x6314('0x25')](function(_0x447837){var _0x2955ec=_0x3a825f[_0x6314('0x47')]['get']({'plain':!![]});if(!_0x2955ec)throw new Error(_0x6314('0x48'));if(_0x2955ec['role']==='user'){var _0x720ac8=_0x447837[_0x6314('0x26')]({'plain':!![]});var _0x3761dd='Triggers';return db[_0x6314('0x49')][_0x6314('0x4a')]({'where':{'name':_0x3761dd,'userProfileId':_0x2955ec[_0x6314('0x4b')]},'raw':!![]})[_0x6314('0x25')](function(_0x720ae6){if(_0x720ae6&&_0x720ae6[_0x6314('0x4c')]===0x0){return db[_0x6314('0x4d')]['create']({'name':_0x720ac8[_0x6314('0x28')],'resourceId':_0x720ac8['id'],'type':_0x720ae6['name'],'sectionId':_0x720ae6['id']},{})[_0x6314('0x25')](function(){return _0x447837;});}else{return _0x447837;}})[_0x6314('0x43')](function(_0x5d5db3){logger[_0x6314('0x4e')](_0x6314('0x4f'),_0x5d5db3);throw _0x5d5db3;});}return _0x447837;})[_0x6314('0x25')](respondWithResult(_0x4e1bb4,0xc9))['catch'](handleError(_0x4e1bb4,null));};exports['update']=function(_0x141efd,_0x22be89){if(_0x141efd[_0x6314('0x50')]['id']){delete _0x141efd[_0x6314('0x50')]['id'];}return db['Trigger'][_0x6314('0x4a')]({'where':{'id':_0x141efd[_0x6314('0x44')]['id']}})['then'](handleEntityNotFound(_0x22be89,null))[_0x6314('0x25')](saveUpdates(_0x141efd[_0x6314('0x50')],null))[_0x6314('0x25')](respondWithResult(_0x22be89,null))['catch'](handleError(_0x22be89,null));};exports['destroy']=function(_0x3c3e87,_0x13f085){return db[_0x6314('0x3f')][_0x6314('0x4a')]({'where':{'id':_0x3c3e87[_0x6314('0x44')]['id']}})[_0x6314('0x25')](handleEntityNotFound(_0x13f085,null))[_0x6314('0x25')](removeEntity(_0x13f085,null))[_0x6314('0x43')](handleError(_0x13f085,null));};exports[_0x6314('0x51')]=function(_0x1193e1,_0x11339c,_0x1980ec){if(_0x1193e1[_0x6314('0x50')]['id']){delete _0x1193e1[_0x6314('0x50')]['id'];}return db[_0x6314('0x3f')][_0x6314('0x4a')]({'where':{'id':_0x1193e1['params']['id']}})['then'](handleEntityNotFound(_0x11339c,null))[_0x6314('0x25')](function(_0x1385d7){if(_0x1385d7){_0x1193e1[_0x6314('0x50')][_0x6314('0x52')]=_0x1385d7['id'];return db['Condition'][_0x6314('0x46')](_0x1193e1[_0x6314('0x50')]);}})['then'](respondWithResult(_0x11339c,null))[_0x6314('0x43')](handleError(_0x11339c,null));};exports[_0x6314('0x53')]=function(_0x51a035,_0x4bff8d,_0x5df81c){if(_0x51a035['body']['id']){delete _0x51a035['body']['id'];}return db[_0x6314('0x3f')][_0x6314('0x4a')]({'where':{'id':_0x51a035[_0x6314('0x44')]['id']}})[_0x6314('0x25')](handleEntityNotFound(_0x4bff8d,null))[_0x6314('0x25')](function(_0x15f6ca){if(_0x15f6ca){_0x51a035[_0x6314('0x50')][_0x6314('0x54')]=_0x15f6ca['id'];return db[_0x6314('0x55')][_0x6314('0x46')](_0x51a035[_0x6314('0x50')]);}})['then'](respondWithResult(_0x4bff8d,null))[_0x6314('0x43')](handleError(_0x4bff8d,null));};exports[_0x6314('0x56')]=function(_0xb2c963,_0x1b3f71,_0x2e6878){var _0x35b5c6={};var _0x3079d3={};var _0x29f162;var _0x778372;return db[_0x6314('0x3f')][_0x6314('0x57')]({'where':{'id':_0xb2c963['params']['id']}})[_0x6314('0x25')](handleEntityNotFound(_0x1b3f71,null))[_0x6314('0x25')](function(_0x12c331){if(_0x12c331){_0x29f162=_0x12c331;_0x3079d3[_0x6314('0x2e')]=_[_0x6314('0x30')](db['Condition']['rawAttributes']);_0x3079d3[_0x6314('0x2f')]=_[_0x6314('0x30')](_0xb2c963['query']);_0x3079d3[_0x6314('0x38')]=_[_0x6314('0x31')](_0x3079d3[_0x6314('0x2e')],_0x3079d3[_0x6314('0x2f')]);_0x35b5c6[_0x6314('0x32')]=_[_0x6314('0x31')](_0x3079d3['model'],qs['fields'](_0xb2c963[_0x6314('0x2f')][_0x6314('0x33')]));_0x35b5c6[_0x6314('0x32')]=_0x35b5c6[_0x6314('0x32')][_0x6314('0x34')]?_0x35b5c6[_0x6314('0x32')]:_0x3079d3['model'];_0x35b5c6['order']=qs[_0x6314('0x58')](_0xb2c963[_0x6314('0x2f')][_0x6314('0x58')]);_0x35b5c6[_0x6314('0x37')]=qs[_0x6314('0x38')](_[_0x6314('0x39')](_0xb2c963[_0x6314('0x2f')],_0x3079d3[_0x6314('0x38')]));if(_0xb2c963['query'][_0x6314('0x3a')]){_0x35b5c6[_0x6314('0x37')]=_[_0x6314('0x3b')](_0x35b5c6[_0x6314('0x37')],{'$or':_[_0x6314('0x2b')](_0x35b5c6['attributes'],function(_0x4ba3db){var _0x15767f={};_0x15767f[_0x4ba3db]={'$like':'%'+_0xb2c963[_0x6314('0x2f')][_0x6314('0x3a')]+'%'};return _0x15767f;})});}_0x35b5c6=_[_0x6314('0x3b')]({},_0x35b5c6,_0xb2c963['options']);return _0x29f162['getAllConditions'](_0x35b5c6);}})['then'](function(_0xf07a96){if(_0xf07a96){_0x778372=_0xf07a96[_0x6314('0x34')];if(!_0xb2c963[_0x6314('0x2f')]['hasOwnProperty'](_0x6314('0x59'))){_0x35b5c6[_0x6314('0x1d')]=qs[_0x6314('0x1d')](_0xb2c963[_0x6314('0x2f')][_0x6314('0x1d')]);_0x35b5c6['offset']=qs['offset'](_0xb2c963['query']['offset']);}return _0x29f162[_0x6314('0x56')](_0x35b5c6);}})[_0x6314('0x25')](function(_0x20ddd3){if(_0x20ddd3){return _0x20ddd3?{'count':_0x778372,'rows':_0x20ddd3}:null;}})[_0x6314('0x25')](respondWithResult(_0x1b3f71,null))[_0x6314('0x43')](handleError(_0x1b3f71,null));};exports[_0x6314('0x5a')]=function(_0x9e341b,_0xa3ebee,_0xcd738){var _0x40e575={};var _0x41f444={};var _0x5203ba;var _0x3da77d;return db[_0x6314('0x3f')][_0x6314('0x57')]({'where':{'id':_0x9e341b['params']['id']}})['then'](handleEntityNotFound(_0xa3ebee,null))[_0x6314('0x25')](function(_0xdc4852){if(_0xdc4852){_0x5203ba=_0xdc4852;_0x41f444[_0x6314('0x2e')]=_[_0x6314('0x30')](db[_0x6314('0x55')][_0x6314('0x5b')]);_0x41f444[_0x6314('0x2f')]=_[_0x6314('0x30')](_0x9e341b[_0x6314('0x2f')]);_0x41f444[_0x6314('0x38')]=_[_0x6314('0x31')](_0x41f444[_0x6314('0x2e')],_0x41f444[_0x6314('0x2f')]);_0x40e575['attributes']=_[_0x6314('0x31')](_0x41f444['model'],qs[_0x6314('0x33')](_0x9e341b[_0x6314('0x2f')][_0x6314('0x33')]));_0x40e575[_0x6314('0x32')]=_0x40e575['attributes'][_0x6314('0x34')]?_0x40e575[_0x6314('0x32')]:_0x41f444[_0x6314('0x2e')];_0x40e575[_0x6314('0x36')]=qs[_0x6314('0x58')](_0x9e341b[_0x6314('0x2f')][_0x6314('0x58')]);_0x40e575[_0x6314('0x37')]=qs['filters'](_[_0x6314('0x39')](_0x9e341b['query'],_0x41f444['filters']));if(_0x9e341b[_0x6314('0x2f')][_0x6314('0x3a')]){_0x40e575['where']=_[_0x6314('0x3b')](_0x40e575['where'],{'$or':_['map'](_0x40e575[_0x6314('0x32')],function(_0x15c1b6){var _0x2bfbe5={};_0x2bfbe5[_0x15c1b6]={'$like':'%'+_0x9e341b['query'][_0x6314('0x3a')]+'%'};return _0x2bfbe5;})});}_0x40e575=_[_0x6314('0x3b')]({},_0x40e575,_0x9e341b[_0x6314('0x3e')]);return _0x5203ba[_0x6314('0x5a')](_0x40e575);}})[_0x6314('0x25')](function(_0x2cd351){if(_0x2cd351){_0x3da77d=_0x2cd351[_0x6314('0x34')];if(!_0x9e341b[_0x6314('0x2f')]['hasOwnProperty'](_0x6314('0x59'))){_0x40e575[_0x6314('0x1d')]=qs['limit'](_0x9e341b[_0x6314('0x2f')][_0x6314('0x1d')]);_0x40e575[_0x6314('0x1b')]=qs['offset'](_0x9e341b[_0x6314('0x2f')][_0x6314('0x1b')]);}return _0x5203ba['getAnyConditions'](_0x40e575);}})[_0x6314('0x25')](function(_0x1a8a67){if(_0x1a8a67){return _0x1a8a67?{'count':_0x3da77d,'rows':_0x1a8a67}:null;}})[_0x6314('0x25')](respondWithResult(_0xa3ebee,null))['catch'](handleError(_0xa3ebee,null));};exports['addAction']=function(_0x35aca7,_0x4bda7e,_0x1560cf){if(_0x35aca7[_0x6314('0x50')]['id']){delete _0x35aca7[_0x6314('0x50')]['id'];}return db['Trigger'][_0x6314('0x4a')]({'where':{'id':_0x35aca7['params']['id']}})[_0x6314('0x25')](handleEntityNotFound(_0x4bda7e,null))['then'](function(_0x7c75b){if(_0x7c75b){_0x35aca7[_0x6314('0x50')][_0x6314('0x5c')]=_0x7c75b['id'];return db['Action'][_0x6314('0x46')](_0x35aca7[_0x6314('0x50')]);}})[_0x6314('0x25')](respondWithResult(_0x4bda7e,null))[_0x6314('0x43')](handleError(_0x4bda7e,null));};exports[_0x6314('0x5d')]=function(_0x1cc042,_0x321a46,_0x3e4965){var _0x40c63b={};var _0xaff83e={};var _0x1d337c;var _0x46ff82;return db[_0x6314('0x3f')][_0x6314('0x57')]({'where':{'id':_0x1cc042[_0x6314('0x44')]['id']}})['then'](handleEntityNotFound(_0x321a46,null))[_0x6314('0x25')](function(_0x3bc79f){if(_0x3bc79f){_0x1d337c=_0x3bc79f;_0xaff83e[_0x6314('0x2e')]=_['keys'](db[_0x6314('0x5e')]['rawAttributes']);_0xaff83e[_0x6314('0x2f')]=_['keys'](_0x1cc042['query']);_0xaff83e['filters']=_[_0x6314('0x31')](_0xaff83e[_0x6314('0x2e')],_0xaff83e[_0x6314('0x2f')]);_0x40c63b[_0x6314('0x32')]=_[_0x6314('0x31')](_0xaff83e['model'],qs['fields'](_0x1cc042[_0x6314('0x2f')][_0x6314('0x33')]));_0x40c63b[_0x6314('0x32')]=_0x40c63b['attributes'][_0x6314('0x34')]?_0x40c63b['attributes']:_0xaff83e[_0x6314('0x2e')];_0x40c63b['order']=qs[_0x6314('0x58')](_0x1cc042[_0x6314('0x2f')][_0x6314('0x58')]);_0x40c63b[_0x6314('0x37')]=qs[_0x6314('0x38')](_[_0x6314('0x39')](_0x1cc042[_0x6314('0x2f')],_0xaff83e['filters']));if(_0x1cc042[_0x6314('0x2f')][_0x6314('0x3a')]){_0x40c63b[_0x6314('0x37')]=_[_0x6314('0x3b')](_0x40c63b['where'],{'$or':_['map'](_0x40c63b[_0x6314('0x32')],function(_0x4c0b62){var _0x595623={};_0x595623[_0x4c0b62]={'$like':'%'+_0x1cc042[_0x6314('0x2f')]['filter']+'%'};return _0x595623;})});}_0x40c63b=_[_0x6314('0x3b')]({},_0x40c63b,_0x1cc042[_0x6314('0x3e')]);return _0x1d337c[_0x6314('0x5d')](_0x40c63b);}})[_0x6314('0x25')](function(_0x135ff1){if(_0x135ff1){_0x46ff82=_0x135ff1['length'];if(!_0x1cc042[_0x6314('0x2f')][_0x6314('0x35')](_0x6314('0x59'))){_0x40c63b[_0x6314('0x1d')]=qs[_0x6314('0x1d')](_0x1cc042[_0x6314('0x2f')][_0x6314('0x1d')]);_0x40c63b[_0x6314('0x1b')]=qs[_0x6314('0x1b')](_0x1cc042['query'][_0x6314('0x1b')]);}return _0x1d337c[_0x6314('0x5d')](_0x40c63b);}})[_0x6314('0x25')](function(_0x3b8c08){if(_0x3b8c08){return _0x3b8c08?{'count':_0x46ff82,'rows':_0x3b8c08}:null;}})[_0x6314('0x25')](respondWithResult(_0x321a46,null))[_0x6314('0x43')](handleError(_0x321a46,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index c0e5b50..0724f51 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 _0xb4e6=['bluebird','path','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment'];(function(_0x534782,_0x345b19){var _0x2d879a=function(_0x276b0d){while(--_0x276b0d){_0x534782['push'](_0x534782['shift']());}};_0x2d879a(++_0x345b19);}(_0xb4e6,0xd8));var _0x6b4e=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0xb4e6[_0x38af48];return _0x445384;};'use strict';var _=require(_0x6b4e('0x0'));var util=require(_0x6b4e('0x1'));var logger=require(_0x6b4e('0x2'))(_0x6b4e('0x3'));var moment=require(_0x6b4e('0x4'));var BPromise=require(_0x6b4e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require('rimraf');var config=require(_0x6b4e('0x7'));var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x431dde,_0x5ad54e){return _0x431dde[_0x6b4e('0xa')](_0x6b4e('0xb'),attributes,{'tableName':_0x6b4e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ef3=['path','rimraf','./trigger.attributes','exports','define','Trigger','lodash','util','api','moment','bluebird'];(function(_0x3f16a7,_0x1c81b6){var _0x4ddf32=function(_0x9432aa){while(--_0x9432aa){_0x3f16a7['push'](_0x3f16a7['shift']());}};_0x4ddf32(++_0x1c81b6);}(_0x1ef3,0x69));var _0x31ef=function(_0x8d7f8,_0x159da4){_0x8d7f8=_0x8d7f8-0x0;var _0x2e1b3f=_0x1ef3[_0x8d7f8];return _0x2e1b3f;};'use strict';var _=require(_0x31ef('0x0'));var util=require(_0x31ef('0x1'));var logger=require('../../config/logger')(_0x31ef('0x2'));var moment=require(_0x31ef('0x3'));var BPromise=require(_0x31ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31ef('0x5'));var rimraf=require(_0x31ef('0x6'));var config=require('../../config/environment');var attributes=require(_0x31ef('0x7'));module[_0x31ef('0x8')]=function(_0x81db4,_0x454b60){return _0x81db4[_0x31ef('0x9')](_0x31ef('0xa'),attributes,{'tableName':'tools_triggers','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 13db16f..14214d6 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 _0xecd2=['limit','include','map','model','attributes','GetTrigger','debug','ShowTrigger','find','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify','error','Trigger,\x20%s,\x20%s','message','result','catch','Trigger','findAll','options','raw','where'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xecd2,0x15d));var _0x2ecd=function(_0xb30045,_0x47b6cf){_0xb30045=_0xb30045-0x0;var _0x17c709=_0xecd2[_0xb30045];return _0x17c709;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2ecd('0x0'));var BPromise=require(_0x2ecd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ecd('0x2'));var db=require(_0x2ecd('0x3'))['db'];var utils=require(_0x2ecd('0x4'));var logger=require(_0x2ecd('0x5'))(_0x2ecd('0x6'));var config=require(_0x2ecd('0x7'));var jayson=require(_0x2ecd('0x8'));var client=jayson[_0x2ecd('0x9')][_0x2ecd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43be2f,_0x5b2d7a,_0x2cf8ee){return new BPromise(function(_0x4a484a,_0x7b794c){return client['request'](_0x43be2f,_0x2cf8ee)[_0x2ecd('0xb')](function(_0x13690d){logger[_0x2ecd('0xc')]('Trigger,\x20%s,\x20%s',_0x5b2d7a,'request\x20sent');logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x5b2d7a,_0x2ecd('0xd'),JSON[_0x2ecd('0xe')](_0x13690d));if(_0x13690d['error']){if(_0x13690d[_0x2ecd('0xf')]['code']===0x1f4){logger[_0x2ecd('0xf')](_0x2ecd('0x10'),_0x5b2d7a,_0x13690d[_0x2ecd('0xf')]['message']);return _0x7b794c(_0x13690d['error'][_0x2ecd('0x11')]);}logger[_0x2ecd('0xf')]('Trigger,\x20%s,\x20%s',_0x5b2d7a,_0x13690d['error'][_0x2ecd('0x11')]);return _0x4a484a(_0x13690d[_0x2ecd('0xf')][_0x2ecd('0x11')]);}else{logger[_0x2ecd('0xc')](_0x2ecd('0x10'),_0x5b2d7a,_0x2ecd('0xd'));_0x4a484a(_0x13690d[_0x2ecd('0x12')][_0x2ecd('0x11')]);}})[_0x2ecd('0x13')](function(_0x3507a3){logger[_0x2ecd('0xf')](_0x2ecd('0x10'),_0x5b2d7a,_0x3507a3);_0x7b794c(_0x3507a3);});});}exports['GetTrigger']=function(_0x371512){var _0x2c05cb=this;return new Promise(function(_0x507d89,_0x54f197){return db[_0x2ecd('0x14')][_0x2ecd('0x15')]({'raw':_0x371512[_0x2ecd('0x16')]?_0x371512[_0x2ecd('0x16')][_0x2ecd('0x17')]===undefined?!![]:![]:!![],'where':_0x371512['options']?_0x371512[_0x2ecd('0x16')][_0x2ecd('0x18')]||null:null,'attributes':_0x371512[_0x2ecd('0x16')]?_0x371512[_0x2ecd('0x16')]['attributes']||null:null,'limit':_0x371512[_0x2ecd('0x16')]?_0x371512[_0x2ecd('0x16')][_0x2ecd('0x19')]||null:null,'include':_0x371512['options']?_0x371512['options'][_0x2ecd('0x1a')]?_[_0x2ecd('0x1b')](_0x371512[_0x2ecd('0x16')][_0x2ecd('0x1a')],function(_0x4b12f5){return{'model':db[_0x4b12f5[_0x2ecd('0x1c')]],'as':_0x4b12f5['as'],'attributes':_0x4b12f5[_0x2ecd('0x1d')],'include':_0x4b12f5[_0x2ecd('0x1a')]?_[_0x2ecd('0x1b')](_0x4b12f5[_0x2ecd('0x1a')],function(_0x53686a){return{'model':db[_0x53686a['model']],'as':_0x53686a['as'],'attributes':_0x53686a[_0x2ecd('0x1d')],'include':_0x53686a[_0x2ecd('0x1a')]?_[_0x2ecd('0x1b')](_0x53686a['include'],function(_0x3f3caa){return{'model':db[_0x3f3caa['model']],'as':_0x3f3caa['as'],'attributes':_0x3f3caa['attributes']};}):[]};}):[]};}):[]:[]})[_0x2ecd('0xb')](function(_0x2faf02){logger[_0x2ecd('0xc')](_0x2ecd('0x1e'),_0x371512);logger[_0x2ecd('0x1f')]('GetTrigger',_0x371512,JSON[_0x2ecd('0xe')](_0x2faf02));_0x507d89(_0x2faf02);})['catch'](function(_0x59d87f){logger[_0x2ecd('0xf')](_0x2ecd('0x1e'),_0x59d87f[_0x2ecd('0x11')],_0x371512);_0x54f197(_0x2c05cb[_0x2ecd('0xf')](0x1f4,_0x59d87f[_0x2ecd('0x11')]));});});};exports[_0x2ecd('0x20')]=function(_0x43c29b){var _0x2e099e=this;return new Promise(function(_0x44bd81,_0x3cd864){return db['Trigger'][_0x2ecd('0x21')]({'raw':_0x43c29b['options']?_0x43c29b[_0x2ecd('0x16')][_0x2ecd('0x17')]===undefined?!![]:![]:!![],'where':_0x43c29b[_0x2ecd('0x16')]?_0x43c29b[_0x2ecd('0x16')][_0x2ecd('0x18')]||null:null,'attributes':_0x43c29b[_0x2ecd('0x16')]?_0x43c29b['options']['attributes']||null:null,'include':_0x43c29b[_0x2ecd('0x16')]?_0x43c29b[_0x2ecd('0x16')][_0x2ecd('0x1a')]?_[_0x2ecd('0x1b')](_0x43c29b[_0x2ecd('0x16')][_0x2ecd('0x1a')],function(_0x3d0bae){return{'model':db[_0x3d0bae[_0x2ecd('0x1c')]],'as':_0x3d0bae['as'],'attributes':_0x3d0bae[_0x2ecd('0x1d')],'include':_0x3d0bae['include']?_[_0x2ecd('0x1b')](_0x3d0bae[_0x2ecd('0x1a')],function(_0x4a0c61){return{'model':db[_0x4a0c61['model']],'as':_0x4a0c61['as'],'attributes':_0x4a0c61[_0x2ecd('0x1d')],'include':_0x4a0c61[_0x2ecd('0x1a')]?_[_0x2ecd('0x1b')](_0x4a0c61['include'],function(_0x81a179){return{'model':db[_0x81a179[_0x2ecd('0x1c')]],'as':_0x81a179['as'],'attributes':_0x81a179[_0x2ecd('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15f8f0){logger[_0x2ecd('0xc')]('ShowTrigger',_0x43c29b);logger[_0x2ecd('0x1f')](_0x2ecd('0x20'),_0x43c29b,JSON['stringify'](_0x15f8f0));_0x44bd81(_0x15f8f0);})[_0x2ecd('0x13')](function(_0x33de17){logger['error'](_0x2ecd('0x20'),_0x33de17[_0x2ecd('0x11')],_0x43c29b);_0x3cd864(_0x2e099e[_0x2ecd('0xf')](0x1f4,_0x33de17['message']));});});}; \ No newline at end of file +var _0x352e=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','model','map','stringify','find','ShowTrigger','lodash'];(function(_0x8299df,_0x2887e1){var _0x4a707f=function(_0x38ff3c){while(--_0x38ff3c){_0x8299df['push'](_0x8299df['shift']());}};_0x4a707f(++_0x2887e1);}(_0x352e,0x1c6));var _0xe352=function(_0x5c7caa,_0x1501c0){_0x5c7caa=_0x5c7caa-0x0;var _0x19ccbf=_0x352e[_0x5c7caa];return _0x19ccbf;};'use strict';var _=require(_0xe352('0x0'));var util=require('util');var moment=require(_0xe352('0x1'));var BPromise=require('bluebird');var rs=require(_0xe352('0x2'));var fs=require('fs');var Redis=require(_0xe352('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe352('0x4'));var logger=require(_0xe352('0x5'))(_0xe352('0x6'));var config=require(_0xe352('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe352('0x8')][_0xe352('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c1145,_0x5608b5,_0x3b174b){return new BPromise(function(_0x425a98,_0xdc7291){return client[_0xe352('0xa')](_0x5c1145,_0x3b174b)[_0xe352('0xb')](function(_0x46d8d8){logger['info'](_0xe352('0xc'),_0x5608b5,_0xe352('0xd'));logger[_0xe352('0xe')](_0xe352('0xf'),_0x5608b5,_0xe352('0xd'),JSON['stringify'](_0x46d8d8));if(_0x46d8d8[_0xe352('0x10')]){if(_0x46d8d8[_0xe352('0x10')][_0xe352('0x11')]===0x1f4){logger[_0xe352('0x10')](_0xe352('0xc'),_0x5608b5,_0x46d8d8[_0xe352('0x10')][_0xe352('0x12')]);return _0xdc7291(_0x46d8d8[_0xe352('0x10')][_0xe352('0x12')]);}logger['error'](_0xe352('0xc'),_0x5608b5,_0x46d8d8[_0xe352('0x10')][_0xe352('0x12')]);return _0x425a98(_0x46d8d8[_0xe352('0x10')][_0xe352('0x12')]);}else{logger[_0xe352('0x13')](_0xe352('0xc'),_0x5608b5,_0xe352('0xd'));_0x425a98(_0x46d8d8['result'][_0xe352('0x12')]);}})[_0xe352('0x14')](function(_0x1f70e0){logger['error'](_0xe352('0xc'),_0x5608b5,_0x1f70e0);_0xdc7291(_0x1f70e0);});});}exports[_0xe352('0x15')]=function(_0x7e2b87){var _0x1cc873=this;return new Promise(function(_0x44ed50,_0x24e3dd){return db[_0xe352('0x16')][_0xe352('0x17')]({'raw':_0x7e2b87[_0xe352('0x18')]?_0x7e2b87['options'][_0xe352('0x19')]===undefined?!![]:![]:!![],'where':_0x7e2b87[_0xe352('0x18')]?_0x7e2b87[_0xe352('0x18')][_0xe352('0x1a')]||null:null,'attributes':_0x7e2b87['options']?_0x7e2b87['options'][_0xe352('0x1b')]||null:null,'limit':_0x7e2b87[_0xe352('0x18')]?_0x7e2b87[_0xe352('0x18')][_0xe352('0x1c')]||null:null,'include':_0x7e2b87[_0xe352('0x18')]?_0x7e2b87[_0xe352('0x18')][_0xe352('0x1d')]?_['map'](_0x7e2b87['options'][_0xe352('0x1d')],function(_0x47698f){return{'model':db[_0x47698f[_0xe352('0x1e')]],'as':_0x47698f['as'],'attributes':_0x47698f[_0xe352('0x1b')],'include':_0x47698f[_0xe352('0x1d')]?_['map'](_0x47698f[_0xe352('0x1d')],function(_0x362b03){return{'model':db[_0x362b03[_0xe352('0x1e')]],'as':_0x362b03['as'],'attributes':_0x362b03[_0xe352('0x1b')],'include':_0x362b03[_0xe352('0x1d')]?_[_0xe352('0x1f')](_0x362b03['include'],function(_0x5f49b2){return{'model':db[_0x5f49b2[_0xe352('0x1e')]],'as':_0x5f49b2['as'],'attributes':_0x5f49b2[_0xe352('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe352('0xb')](function(_0x57eea7){logger['info'](_0xe352('0x15'),_0x7e2b87);logger[_0xe352('0xe')](_0xe352('0x15'),_0x7e2b87,JSON[_0xe352('0x20')](_0x57eea7));_0x44ed50(_0x57eea7);})['catch'](function(_0x3db986){logger[_0xe352('0x10')](_0xe352('0x15'),_0x3db986[_0xe352('0x12')],_0x7e2b87);_0x24e3dd(_0x1cc873[_0xe352('0x10')](0x1f4,_0x3db986[_0xe352('0x12')]));});});};exports['ShowTrigger']=function(_0x50402b){var _0xb24890=this;return new Promise(function(_0x2d700b,_0x2f02b1){return db[_0xe352('0x16')][_0xe352('0x21')]({'raw':_0x50402b[_0xe352('0x18')]?_0x50402b[_0xe352('0x18')][_0xe352('0x19')]===undefined?!![]:![]:!![],'where':_0x50402b[_0xe352('0x18')]?_0x50402b[_0xe352('0x18')][_0xe352('0x1a')]||null:null,'attributes':_0x50402b[_0xe352('0x18')]?_0x50402b[_0xe352('0x18')][_0xe352('0x1b')]||null:null,'include':_0x50402b[_0xe352('0x18')]?_0x50402b['options'][_0xe352('0x1d')]?_['map'](_0x50402b[_0xe352('0x18')][_0xe352('0x1d')],function(_0x28860b){return{'model':db[_0x28860b[_0xe352('0x1e')]],'as':_0x28860b['as'],'attributes':_0x28860b[_0xe352('0x1b')],'include':_0x28860b[_0xe352('0x1d')]?_[_0xe352('0x1f')](_0x28860b['include'],function(_0x8343e0){return{'model':db[_0x8343e0['model']],'as':_0x8343e0['as'],'attributes':_0x8343e0[_0xe352('0x1b')],'include':_0x8343e0[_0xe352('0x1d')]?_['map'](_0x8343e0[_0xe352('0x1d')],function(_0x3adb1b){return{'model':db[_0x3adb1b[_0xe352('0x1e')]],'as':_0x3adb1b['as'],'attributes':_0x3adb1b[_0xe352('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe352('0xb')](function(_0x5d1975){logger[_0xe352('0x13')]('ShowTrigger',_0x50402b);logger[_0xe352('0xe')]('ShowTrigger',_0x50402b,JSON['stringify'](_0x5d1975));_0x2d700b(_0x5d1975);})['catch'](function(_0x5e6afb){logger['error'](_0xe352('0x22'),_0x5e6afb['message'],_0x50402b);_0x2f02b1(_0xb24890[_0xe352('0x10')](0x1f4,_0x5e6afb[_0xe352('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 9e931c1..19ac9bd 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 _0x794b=['get','isAuthenticated','index','/:id','show','post','/:id/clone','create','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../config/environment','./trunk.controller'];(function(_0x24f6fc,_0x37267a){var _0x34e3c9=function(_0x4071db){while(--_0x4071db){_0x24f6fc['push'](_0x24f6fc['shift']());}};_0x34e3c9(++_0x37267a);}(_0x794b,0xf1));var _0xb794=function(_0x3bece3,_0x10a102){_0x3bece3=_0x3bece3-0x0;var _0x4f033c=_0x794b[_0x3bece3];return _0x4f033c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb794('0x0'));var timeout=require('connect-timeout');var express=require(_0xb794('0x1'));var router=express[_0xb794('0x2')]();var fs_extra=require(_0xb794('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb794('0x4'));var controller=require(_0xb794('0x5'));router[_0xb794('0x6')]('/',auth[_0xb794('0x7')](),controller[_0xb794('0x8')]);router[_0xb794('0x6')](_0xb794('0x9'),auth[_0xb794('0x7')](),controller[_0xb794('0xa')]);router[_0xb794('0xb')](_0xb794('0xc'),auth[_0xb794('0x7')](),controller['clone']);router[_0xb794('0xb')]('/',auth[_0xb794('0x7')](),controller[_0xb794('0xd')]);router[_0xb794('0xe')](_0xb794('0x9'),auth[_0xb794('0x7')](),controller[_0xb794('0xf')]);router[_0xb794('0x10')](_0xb794('0x9'),auth[_0xb794('0x7')](),controller[_0xb794('0x11')]);module[_0xb794('0x12')]=router; \ No newline at end of file +var _0xe657=['/:id/clone','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','isAuthenticated','get','/:id','show','post'];(function(_0x3505e,_0x3d12cd){var _0x24cae3=function(_0x345152){while(--_0x345152){_0x3505e['push'](_0x3505e['shift']());}};_0x24cae3(++_0x3d12cd);}(_0xe657,0xee));var _0x7e65=function(_0x47ddfa,_0xea7d22){_0x47ddfa=_0x47ddfa-0x0;var _0xc96b54=_0xe657[_0x47ddfa];return _0xc96b54;};'use strict';var multer=require(_0x7e65('0x0'));var util=require(_0x7e65('0x1'));var path=require(_0x7e65('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e65('0x3'));var router=express[_0x7e65('0x4')]();var fs_extra=require(_0x7e65('0x5'));var auth=require(_0x7e65('0x6'));var interaction=require(_0x7e65('0x7'));var config=require('../../config/environment');var controller=require(_0x7e65('0x8'));router['get']('/',auth[_0x7e65('0x9')](),controller['index']);router[_0x7e65('0xa')](_0x7e65('0xb'),auth['isAuthenticated'](),controller[_0x7e65('0xc')]);router[_0x7e65('0xd')](_0x7e65('0xe'),auth[_0x7e65('0x9')](),controller['clone']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7e65('0xf')]('/:id',auth[_0x7e65('0x9')](),controller['update']);router['delete'](_0x7e65('0xb'),auth[_0x7e65('0x9')](),controller[_0x7e65('0x10')]);module[_0x7e65('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index ba162ba..b0843a2 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 _0x052b=['split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','originate','uac','uas','pai','fingerprint','certificate','active','actpass','update','update,nonat','BOOLEAN','sequelize','exports','STRING','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','auto','rfc2833','yes','nonat','outgoing','force_rport,comedia','setDataValue','nat'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x052b,0x13d));var _0xb052=function(_0x348a3c,_0xe91c07){_0x348a3c=_0x348a3c-0x0;var _0x111670=_0x052b[_0x348a3c];return _0x111670;};'use strict';var Sequelize=require(_0xb052('0x0'));module[_0xb052('0x1')]={'name':{'type':Sequelize[_0xb052('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb052('0x3')](_0xb052('0x4'),_0xb052('0x5'),_0xb052('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xb052('0x3')](_0xb052('0x7'),'ALLOWED_PASSED_SCREEN',_0xb052('0x8'),'ALLOWED',_0xb052('0x9'),'PROHIB_PASSED_SCREEN',_0xb052('0xa'),_0xb052('0xb'))},'deny':{'type':Sequelize[_0xb052('0x2')]},'permit':{'type':Sequelize[_0xb052('0x2')]},'secret':{'type':Sequelize[_0xb052('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xb052('0x2')]},'transport':{'type':Sequelize[_0xb052('0x2')],'defaultValue':_0xb052('0xc'),'set':function(_0x54a22e){this['setDataValue'](_0xb052('0xd'),_0x54a22e?_0x54a22e[_0xb052('0xe')](','):null);},'get':function(){return this[_0xb052('0xf')](_0xb052('0xd'))?this[_0xb052('0xf')](_0xb052('0xd'))['split'](','):null;},'comment':_0xb052('0x10')},'dtmfmode':{'type':Sequelize[_0xb052('0x3')]('rfc2833',_0xb052('0x11'),'shortinfo','inband',_0xb052('0x12')),'defaultValue':_0xb052('0x13')},'directmedia':{'type':Sequelize[_0xb052('0x3')](_0xb052('0x14'),'no',_0xb052('0x15'),'update',_0xb052('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb052('0x3')](_0xb052('0x14'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xb052('0x2')]},'directmediadeny':{'type':Sequelize[_0xb052('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xb052('0x17'),'set':function(_0x5ef317){this[_0xb052('0x18')]('nat',_0x5ef317?_0x5ef317['join'](','):null);},'get':function(){return this['getDataValue'](_0xb052('0x19'))?this[_0xb052('0xf')](_0xb052('0x19'))[_0xb052('0x1a')](','):null;},'comment':_0xb052('0x1b')},'callgroup':{'type':Sequelize[_0xb052('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xb052('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xb052('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb052('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xb052('0x2')],'defaultValue':_0xb052('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x8099bb){this[_0xb052('0x18')]('allow',_0x8099bb?_0x8099bb[_0xb052('0xe')](';'):_0xb052('0x1d'));},'get':function(){return this['getDataValue'](_0xb052('0x1e'))?this[_0xb052('0xf')](_0xb052('0x1e'))[_0xb052('0x1a')](';'):null;},'comment':_0xb052('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0xb052('0x14'),'no')},'insecure':{'type':Sequelize[_0xb052('0x2')],'defaultValue':_0xb052('0x20'),'set':function(_0x3ea28c){this['setDataValue'](_0xb052('0x21'),_0x3ea28c?_0x3ea28c[_0xb052('0xe')](','):null);},'get':function(){return this[_0xb052('0xf')](_0xb052('0x21'))?this['getDataValue']('insecure')[_0xb052('0x1a')](','):null;},'comment':_0xb052('0x22')},'trustrpid':{'type':Sequelize[_0xb052('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xb052('0x14'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb052('0x3')](_0xb052('0x14'),'no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0xb052('0x14'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xb052('0x14'),'no')},'accountcode':{'type':Sequelize[_0xb052('0x23')](0xb)},'setvar':{'type':Sequelize[_0xb052('0x2')]},'callerid':{'type':Sequelize[_0xb052('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xb052('0x2')]},'callcounter':{'type':Sequelize[_0xb052('0x3')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xb052('0x3')](_0xb052('0x14'),'no')},'allowsubscribe':{'type':Sequelize[_0xb052('0x3')](_0xb052('0x14'),'no')},'allowtransfer':{'type':Sequelize[_0xb052('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xb052('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xb052('0x2')]},'template':{'type':Sequelize[_0xb052('0x2')]},'videosupport':{'type':Sequelize[_0xb052('0x3')](_0xb052('0x14'),'no',_0xb052('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xb052('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xb052('0x3')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0xb052('0x25'),'refuse',_0xb052('0x26'))},'session_expires':{'type':Sequelize[_0xb052('0x23')](0xb)},'session_minse':{'type':Sequelize[_0xb052('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xb052('0x27'),'uas'),'defaultValue':_0xb052('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0xb052('0x2')]},'regexten':{'type':Sequelize[_0xb052('0x2')]},'fromdomain':{'type':Sequelize[_0xb052('0x2')]},'fromuser':{'type':Sequelize[_0xb052('0x2')]},'port':{'type':Sequelize[_0xb052('0x23')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xb052('0x14'),'no'),'defaultValue':_0xb052('0x14')},'keepalive':{'type':Sequelize[_0xb052('0x23')](0xb)},'defaultip':{'type':Sequelize[_0xb052('0x2')]},'defaultuser':{'type':Sequelize[_0xb052('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xb052('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xb052('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0xb052('0x3')]('yes','no',_0xb052('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb052('0x2')]},'callbackextension':{'type':Sequelize[_0xb052('0x2')]},'timert1':{'type':Sequelize[_0xb052('0x23')](0xb)},'timerb':{'type':Sequelize[_0xb052('0x23')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xb052('0x2')]},'contactdeny':{'type':Sequelize[_0xb052('0x2')]},'contactacl':{'type':Sequelize[_0xb052('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xb052('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xb052('0x23')](0xb)},'encryption':{'type':Sequelize[_0xb052('0x3')](_0xb052('0x14'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xb052('0x14'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xb052('0x14'),'no')},'icesupport':{'type':Sequelize[_0xb052('0x3')](_0xb052('0x14'),'no')},'dtlsenable':{'type':Sequelize[_0xb052('0x3')](_0xb052('0x14'),'no')},'dtlsverify':{'type':Sequelize[_0xb052('0x3')]('yes','no',_0xb052('0x2a'),_0xb052('0x2b'))},'dtlsrekey':{'type':Sequelize[_0xb052('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xb052('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xb052('0x2')]},'dtlscipher':{'type':Sequelize[_0xb052('0x2')]},'dtlscafile':{'type':Sequelize[_0xb052('0x2')]},'dtlscapath':{'type':Sequelize[_0xb052('0x2')]},'dtlssetup':{'type':Sequelize[_0xb052('0x3')](_0xb052('0x2c'),'passive',_0xb052('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb052('0x2')]},'usereqphone':{'type':Sequelize[_0xb052('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xb052('0x2')]},'recordofffeature':{'type':Sequelize[_0xb052('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xb052('0x3')](_0xb052('0x14'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xb052('0x14'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xb052('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xb052('0x2')]},'description':{'type':Sequelize[_0xb052('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xb052('0x3')](_0xb052('0x14'),'no',_0xb052('0x15'),_0xb052('0x2e'),_0xb052('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xb052('0x2')]},'otherFields':{'type':Sequelize[_0xb052('0x2')]},'active':{'type':Sequelize[_0xb052('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xb052('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xdd88=['udp','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','setDataValue','nat','all','ulaw;alaw;gsm','allow','join','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','uac','uas','pai','fingerprint','certificate','active','passive','actpass','nonat','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','friend','user','peer','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB'];(function(_0x4a9ba4,_0xc6fa4b){var _0x6c23f3=function(_0x1bb9a5){while(--_0x1bb9a5){_0x4a9ba4['push'](_0x4a9ba4['shift']());}};_0x6c23f3(++_0xc6fa4b);}(_0xdd88,0xbf));var _0x8dd8=function(_0xf1f30f,_0x1125f3){_0xf1f30f=_0xf1f30f-0x0;var _0x48f667=_0xdd88[_0xf1f30f];return _0x48f667;};'use strict';var Sequelize=require(_0x8dd8('0x0'));module['exports']={'name':{'type':Sequelize[_0x8dd8('0x1')],'allowNull':![],'unique':_0x8dd8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x4'),_0x8dd8('0x5'),_0x8dd8('0x6')),'allowNull':![],'defaultValue':_0x8dd8('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x8dd8('0x3')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x8dd8('0x7'),_0x8dd8('0x8'),_0x8dd8('0x9'),_0x8dd8('0xa'),_0x8dd8('0xb'),_0x8dd8('0xc'))},'deny':{'type':Sequelize[_0x8dd8('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x8dd8('0x1')]},'remotesecret':{'type':Sequelize[_0x8dd8('0x1')]},'transport':{'type':Sequelize[_0x8dd8('0x1')],'defaultValue':_0x8dd8('0xd'),'set':function(_0x12fad5){this['setDataValue'](_0x8dd8('0xe'),_0x12fad5?_0x12fad5['join'](','):null);},'get':function(){return this[_0x8dd8('0xf')]('transport')?this['getDataValue'](_0x8dd8('0xe'))[_0x8dd8('0x10')](','):null;},'comment':_0x8dd8('0x11')},'dtmfmode':{'type':Sequelize['ENUM'](_0x8dd8('0x12'),'info',_0x8dd8('0x13'),_0x8dd8('0x14'),_0x8dd8('0x15')),'defaultValue':_0x8dd8('0x12')},'directmedia':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no','nonat',_0x8dd8('0x17'),_0x8dd8('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x8dd8('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x8dd8('0x1')]},'nat':{'type':Sequelize[_0x8dd8('0x1')],'defaultValue':_0x8dd8('0x19'),'set':function(_0x57d741){this[_0x8dd8('0x1a')](_0x8dd8('0x1b'),_0x57d741?_0x57d741['join'](','):null);},'get':function(){return this[_0x8dd8('0xf')](_0x8dd8('0x1b'))?this['getDataValue']('nat')[_0x8dd8('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x8dd8('0x1')]},'namedcallgroup':{'type':Sequelize[_0x8dd8('0x1')]},'pickupgroup':{'type':Sequelize[_0x8dd8('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x8dd8('0x1')]},'language':{'type':Sequelize[_0x8dd8('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8dd8('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x8dd8('0x1c')},'allow':{'type':Sequelize[_0x8dd8('0x1')],'allowNull':![],'defaultValue':_0x8dd8('0x1d'),'set':function(_0x3af438){this['setDataValue'](_0x8dd8('0x1e'),_0x3af438?_0x3af438[_0x8dd8('0x1f')](';'):_0x8dd8('0x1d'));},'get':function(){return this['getDataValue'](_0x8dd8('0x1e'))?this[_0x8dd8('0xf')]('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no')},'insecure':{'type':Sequelize[_0x8dd8('0x1')],'defaultValue':_0x8dd8('0x20'),'set':function(_0x4e4b4c){this[_0x8dd8('0x1a')](_0x8dd8('0x21'),_0x4e4b4c?_0x4e4b4c[_0x8dd8('0x1f')](','):null);},'get':function(){return this[_0x8dd8('0xf')](_0x8dd8('0x21'))?this[_0x8dd8('0xf')](_0x8dd8('0x21'))[_0x8dd8('0x10')](','):null;},'comment':_0x8dd8('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x8dd8('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no',_0x8dd8('0x23'))},'promiscredir':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no')},'accountcode':{'type':Sequelize[_0x8dd8('0x24')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8dd8('0x1')],'defaultValue':_0x8dd8('0x25')},'amaflags':{'type':Sequelize[_0x8dd8('0x1')]},'callcounter':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no'),'defaultValue':_0x8dd8('0x16')},'busylevel':{'type':Sequelize[_0x8dd8('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x8dd8('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0x8dd8('0x1')]},'template':{'type':Sequelize[_0x8dd8('0x1')]},'videosupport':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no',_0x8dd8('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8dd8('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x8dd8('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0x8dd8('0x1')]},'session_timers':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x27'),'refuse','originate')},'session_expires':{'type':Sequelize[_0x8dd8('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x8dd8('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x28'),'uas'),'defaultValue':_0x8dd8('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x8dd8('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x8dd8('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x8dd8('0x24')](0x5)},'qualify':{'type':Sequelize[_0x8dd8('0x3')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x8dd8('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x8dd8('0x1')]},'defaultuser':{'type':Sequelize[_0x8dd8('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x8dd8('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x8dd8('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no',_0x8dd8('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x8dd8('0x1')]},'timert1':{'type':Sequelize[_0x8dd8('0x24')](0xb)},'timerb':{'type':Sequelize[_0x8dd8('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x8dd8('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x8dd8('0x1')]},'contactacl':{'type':Sequelize[_0x8dd8('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x8dd8('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x8dd8('0x24')](0xb)},'encryption':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x8dd8('0x16'),'no')},'force_avp':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x8dd8('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x8dd8('0x16'),'no',_0x8dd8('0x2b'),_0x8dd8('0x2c'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x8dd8('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x8dd8('0x1')]},'dtlscafile':{'type':Sequelize[_0x8dd8('0x1')]},'dtlscapath':{'type':Sequelize[_0x8dd8('0x1')]},'dtlssetup':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x2d'),_0x8dd8('0x2e'),_0x8dd8('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8dd8('0x1')]},'usereqphone':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8dd8('0x1')]},'recordofffeature':{'type':Sequelize[_0x8dd8('0x1')]},'call_limit':{'type':Sequelize[_0x8dd8('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x8dd8('0x16'),'no')},'vmexten':{'type':Sequelize[_0x8dd8('0x1')]},'mohinterpret':{'type':Sequelize[_0x8dd8('0x1')]},'mohsuggest':{'type':Sequelize[_0x8dd8('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8dd8('0x1')]},'host':{'type':Sequelize[_0x8dd8('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x8dd8('0x3')](_0x8dd8('0x16'),'no',_0x8dd8('0x30'),_0x8dd8('0x17'),_0x8dd8('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x8dd8('0x1')]},'otherFields':{'type':Sequelize[_0x8dd8('0x1')]},'active':{'type':Sequelize[_0x8dd8('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x8dd8('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index b4c6dc9..a28d151 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 _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x274e82,_0x2b3e01){var _0x361183=function(_0x419b3c){while(--_0x419b3c){_0x274e82['push'](_0x274e82['shift']());}};_0x361183(++_0x2b3e01);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1238fa,_0x3afa6e){_0x1238fa=_0x1238fa-0x0;var _0x251831=_0x8d0e[_0x1238fa];return _0x251831;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));}; \ No newline at end of file +var _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x2302a1,_0x4bc33d){var _0x413cae=function(_0x233632){while(--_0x233632){_0x2302a1['push'](_0x2302a1['shift']());}};_0x413cae(++_0x4bc33d);}(_0xe5b3,0x133));var _0x3e5b=function(_0x338fa1,_0x1b4845){_0x338fa1=_0x338fa1-0x0;var _0x5bb839=_0xe5b3[_0x338fa1];return _0x5bb839;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 283b691..dc8e8fa 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 _0x9d93=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','define','Trunk','tools_trunks','util'];(function(_0x766eab,_0xf92bcd){var _0x2e8569=function(_0x28f894){while(--_0x28f894){_0x766eab['push'](_0x766eab['shift']());}};_0x2e8569(++_0xf92bcd);}(_0x9d93,0x1c7));var _0x39d9=function(_0x4f75c2,_0x2a7ea8){_0x4f75c2=_0x4f75c2-0x0;var _0x4e551a=_0x9d93[_0x4f75c2];return _0x4e551a;};'use strict';var _=require('lodash');var util=require(_0x39d9('0x0'));var logger=require(_0x39d9('0x1'))(_0x39d9('0x2'));var moment=require(_0x39d9('0x3'));var BPromise=require(_0x39d9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39d9('0x5'));var rimraf=require(_0x39d9('0x6'));var config=require(_0x39d9('0x7'));var attributes=require(_0x39d9('0x8'));module['exports']=function(_0x4d2bcd,_0x985ee8){return _0x4d2bcd[_0x39d9('0x9')](_0x39d9('0xa'),attributes,{'tableName':_0x39d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9883=['../../config/environment','./trunk.attributes','tools_trunks','lodash','api','moment','bluebird'];(function(_0x38fcae,_0x26586c){var _0x424873=function(_0x45c6f3){while(--_0x45c6f3){_0x38fcae['push'](_0x38fcae['shift']());}};_0x424873(++_0x26586c);}(_0x9883,0xb9));var _0x3988=function(_0x380f8a,_0x4b24fb){_0x380f8a=_0x380f8a-0x0;var _0x56ff2b=_0x9883[_0x380f8a];return _0x56ff2b;};'use strict';var _=require(_0x3988('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3988('0x1'));var moment=require(_0x3988('0x2'));var BPromise=require(_0x3988('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3988('0x4'));var attributes=require(_0x3988('0x5'));module['exports']=function(_0x4435e9,_0x34692a){return _0x4435e9['define']('Trunk',attributes,{'tableName':_0x3988('0x6'),'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 d7c52d9..063fc6a 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 _0x45e9=['options','attributes','limit','include','map','model','debug','stringify','catch','Trunk','find','ShowTrunk','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','GetTrunk'];(function(_0x35638c,_0x4a7149){var _0x214169=function(_0x3972dd){while(--_0x3972dd){_0x35638c['push'](_0x35638c['shift']());}};_0x214169(++_0x4a7149);}(_0x45e9,0x1be));var _0x945e=function(_0x4f5695,_0x22db00){_0x4f5695=_0x4f5695-0x0;var _0xff77f0=_0x45e9[_0x4f5695];return _0xff77f0;};'use strict';var _=require(_0x945e('0x0'));var util=require(_0x945e('0x1'));var moment=require(_0x945e('0x2'));var BPromise=require(_0x945e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x945e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x945e('0x5'))(_0x945e('0x6'));var config=require('../../config/environment');var jayson=require(_0x945e('0x7'));var client=jayson[_0x945e('0x8')][_0x945e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b5a2,_0x4c7905,_0x35750b){return new BPromise(function(_0x243df0,_0x50d710){return client['request'](_0x36b5a2,_0x35750b)[_0x945e('0xa')](function(_0x3e330b){logger[_0x945e('0xb')](_0x945e('0xc'),_0x4c7905,'request\x20sent');logger['debug'](_0x945e('0xd'),_0x4c7905,'request\x20sent',JSON['stringify'](_0x3e330b));if(_0x3e330b[_0x945e('0xe')]){if(_0x3e330b['error'][_0x945e('0xf')]===0x1f4){logger[_0x945e('0xe')](_0x945e('0xc'),_0x4c7905,_0x3e330b[_0x945e('0xe')][_0x945e('0x10')]);return _0x50d710(_0x3e330b[_0x945e('0xe')][_0x945e('0x10')]);}logger['error'](_0x945e('0xc'),_0x4c7905,_0x3e330b['error'][_0x945e('0x10')]);return _0x243df0(_0x3e330b[_0x945e('0xe')][_0x945e('0x10')]);}else{logger[_0x945e('0xb')](_0x945e('0xc'),_0x4c7905,'request\x20sent');_0x243df0(_0x3e330b[_0x945e('0x11')][_0x945e('0x10')]);}})['catch'](function(_0x28b562){logger[_0x945e('0xe')](_0x945e('0xc'),_0x4c7905,_0x28b562);_0x50d710(_0x28b562);});});}exports[_0x945e('0x12')]=function(_0x5641d2){var _0x120ad0=this;return new Promise(function(_0x92c79e,_0x4798e9){return db['Trunk']['findAll']({'raw':_0x5641d2[_0x945e('0x13')]?_0x5641d2[_0x945e('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x5641d2[_0x945e('0x13')]?_0x5641d2[_0x945e('0x13')]['where']||null:null,'attributes':_0x5641d2[_0x945e('0x13')]?_0x5641d2[_0x945e('0x13')][_0x945e('0x14')]||null:null,'limit':_0x5641d2[_0x945e('0x13')]?_0x5641d2[_0x945e('0x13')][_0x945e('0x15')]||null:null,'include':_0x5641d2[_0x945e('0x13')]?_0x5641d2[_0x945e('0x13')][_0x945e('0x16')]?_[_0x945e('0x17')](_0x5641d2[_0x945e('0x13')][_0x945e('0x16')],function(_0x1f4177){return{'model':db[_0x1f4177[_0x945e('0x18')]],'as':_0x1f4177['as'],'attributes':_0x1f4177[_0x945e('0x14')],'include':_0x1f4177['include']?_[_0x945e('0x17')](_0x1f4177[_0x945e('0x16')],function(_0x34978b){return{'model':db[_0x34978b[_0x945e('0x18')]],'as':_0x34978b['as'],'attributes':_0x34978b['attributes'],'include':_0x34978b[_0x945e('0x16')]?_[_0x945e('0x17')](_0x34978b[_0x945e('0x16')],function(_0xe9f309){return{'model':db[_0xe9f309[_0x945e('0x18')]],'as':_0xe9f309['as'],'attributes':_0xe9f309[_0x945e('0x14')]};}):[]};}):[]};}):[]:[]})[_0x945e('0xa')](function(_0x3f0065){logger[_0x945e('0xb')]('GetTrunk',_0x5641d2);logger[_0x945e('0x19')]('GetTrunk',_0x5641d2,JSON[_0x945e('0x1a')](_0x3f0065));_0x92c79e(_0x3f0065);})[_0x945e('0x1b')](function(_0x892f15){logger[_0x945e('0xe')](_0x945e('0x12'),_0x892f15[_0x945e('0x10')],_0x5641d2);_0x4798e9(_0x120ad0[_0x945e('0xe')](0x1f4,_0x892f15[_0x945e('0x10')]));});});};exports['ShowTrunk']=function(_0x3f7d83){var _0x492292=this;return new Promise(function(_0x273948,_0x5d9c5d){return db[_0x945e('0x1c')][_0x945e('0x1d')]({'raw':_0x3f7d83[_0x945e('0x13')]?_0x3f7d83[_0x945e('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x3f7d83[_0x945e('0x13')]?_0x3f7d83[_0x945e('0x13')]['where']||null:null,'attributes':_0x3f7d83[_0x945e('0x13')]?_0x3f7d83[_0x945e('0x13')]['attributes']||null:null,'include':_0x3f7d83[_0x945e('0x13')]?_0x3f7d83[_0x945e('0x13')][_0x945e('0x16')]?_['map'](_0x3f7d83[_0x945e('0x13')][_0x945e('0x16')],function(_0x4800d7){return{'model':db[_0x4800d7[_0x945e('0x18')]],'as':_0x4800d7['as'],'attributes':_0x4800d7[_0x945e('0x14')],'include':_0x4800d7[_0x945e('0x16')]?_[_0x945e('0x17')](_0x4800d7['include'],function(_0x54a867){return{'model':db[_0x54a867['model']],'as':_0x54a867['as'],'attributes':_0x54a867[_0x945e('0x14')],'include':_0x54a867[_0x945e('0x16')]?_[_0x945e('0x17')](_0x54a867[_0x945e('0x16')],function(_0x18b451){return{'model':db[_0x18b451[_0x945e('0x18')]],'as':_0x18b451['as'],'attributes':_0x18b451[_0x945e('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28ad53){logger[_0x945e('0xb')]('ShowTrunk',_0x3f7d83);logger[_0x945e('0x19')]('ShowTrunk',_0x3f7d83,JSON[_0x945e('0x1a')](_0x28ad53));_0x273948(_0x28ad53);})[_0x945e('0x1b')](function(_0x32b5bb){logger['error'](_0x945e('0x1e'),_0x32b5bb[_0x945e('0x10')],_0x3f7d83);_0x5d9c5d(_0x492292[_0x945e('0xe')](0x1f4,_0x32b5bb[_0x945e('0x10')]));});});}; \ No newline at end of file +var _0x85c6=['options','where','attributes','limit','map','include','model','catch','find','ShowTrunk','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','GetTrunk','Trunk','findAll','raw'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x85c6,0x1e6));var _0x685c=function(_0x48e126,_0x1b24ab){_0x48e126=_0x48e126-0x0;var _0x9ab9aa=_0x85c6[_0x48e126];return _0x9ab9aa;};'use strict';var _=require(_0x685c('0x0'));var util=require(_0x685c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x685c('0x2'));var fs=require('fs');var Redis=require(_0x685c('0x3'));var db=require(_0x685c('0x4'))['db'];var utils=require(_0x685c('0x5'));var logger=require(_0x685c('0x6'))(_0x685c('0x7'));var config=require(_0x685c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x685c('0x9')][_0x685c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52d397,_0x24ba50,_0x53d43d){return new BPromise(function(_0xdf19f1,_0x576aab){return client['request'](_0x52d397,_0x53d43d)[_0x685c('0xb')](function(_0xde3011){logger[_0x685c('0xc')](_0x685c('0xd'),_0x24ba50,_0x685c('0xe'));logger[_0x685c('0xf')](_0x685c('0x10'),_0x24ba50,_0x685c('0xe'),JSON[_0x685c('0x11')](_0xde3011));if(_0xde3011[_0x685c('0x12')]){if(_0xde3011['error']['code']===0x1f4){logger[_0x685c('0x12')](_0x685c('0xd'),_0x24ba50,_0xde3011['error']['message']);return _0x576aab(_0xde3011['error'][_0x685c('0x13')]);}logger[_0x685c('0x12')](_0x685c('0xd'),_0x24ba50,_0xde3011['error'][_0x685c('0x13')]);return _0xdf19f1(_0xde3011['error'][_0x685c('0x13')]);}else{logger['info'](_0x685c('0xd'),_0x24ba50,_0x685c('0xe'));_0xdf19f1(_0xde3011['result'][_0x685c('0x13')]);}})['catch'](function(_0x1cec38){logger['error'](_0x685c('0xd'),_0x24ba50,_0x1cec38);_0x576aab(_0x1cec38);});});}exports[_0x685c('0x14')]=function(_0x1b9a60){var _0xb0925=this;return new Promise(function(_0x223f5e,_0x22f683){return db[_0x685c('0x15')][_0x685c('0x16')]({'raw':_0x1b9a60['options']?_0x1b9a60['options'][_0x685c('0x17')]===undefined?!![]:![]:!![],'where':_0x1b9a60['options']?_0x1b9a60[_0x685c('0x18')][_0x685c('0x19')]||null:null,'attributes':_0x1b9a60['options']?_0x1b9a60[_0x685c('0x18')][_0x685c('0x1a')]||null:null,'limit':_0x1b9a60['options']?_0x1b9a60[_0x685c('0x18')][_0x685c('0x1b')]||null:null,'include':_0x1b9a60[_0x685c('0x18')]?_0x1b9a60[_0x685c('0x18')]['include']?_[_0x685c('0x1c')](_0x1b9a60[_0x685c('0x18')][_0x685c('0x1d')],function(_0x5b9d37){return{'model':db[_0x5b9d37[_0x685c('0x1e')]],'as':_0x5b9d37['as'],'attributes':_0x5b9d37[_0x685c('0x1a')],'include':_0x5b9d37[_0x685c('0x1d')]?_['map'](_0x5b9d37[_0x685c('0x1d')],function(_0x3190ea){return{'model':db[_0x3190ea[_0x685c('0x1e')]],'as':_0x3190ea['as'],'attributes':_0x3190ea[_0x685c('0x1a')],'include':_0x3190ea[_0x685c('0x1d')]?_[_0x685c('0x1c')](_0x3190ea[_0x685c('0x1d')],function(_0x3c6cfa){return{'model':db[_0x3c6cfa[_0x685c('0x1e')]],'as':_0x3c6cfa['as'],'attributes':_0x3c6cfa['attributes']};}):[]};}):[]};}):[]:[]})[_0x685c('0xb')](function(_0x48090c){logger[_0x685c('0xc')](_0x685c('0x14'),_0x1b9a60);logger[_0x685c('0xf')]('GetTrunk',_0x1b9a60,JSON[_0x685c('0x11')](_0x48090c));_0x223f5e(_0x48090c);})[_0x685c('0x1f')](function(_0x44302a){logger['error']('GetTrunk',_0x44302a[_0x685c('0x13')],_0x1b9a60);_0x22f683(_0xb0925['error'](0x1f4,_0x44302a[_0x685c('0x13')]));});});};exports['ShowTrunk']=function(_0xb1be30){var _0x1b01ba=this;return new Promise(function(_0x4a3c8d,_0x3cd44b){return db[_0x685c('0x15')][_0x685c('0x20')]({'raw':_0xb1be30[_0x685c('0x18')]?_0xb1be30[_0x685c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xb1be30[_0x685c('0x18')]?_0xb1be30[_0x685c('0x18')]['where']||null:null,'attributes':_0xb1be30[_0x685c('0x18')]?_0xb1be30['options']['attributes']||null:null,'include':_0xb1be30[_0x685c('0x18')]?_0xb1be30['options'][_0x685c('0x1d')]?_[_0x685c('0x1c')](_0xb1be30['options'][_0x685c('0x1d')],function(_0x140894){return{'model':db[_0x140894[_0x685c('0x1e')]],'as':_0x140894['as'],'attributes':_0x140894[_0x685c('0x1a')],'include':_0x140894[_0x685c('0x1d')]?_['map'](_0x140894[_0x685c('0x1d')],function(_0x1965af){return{'model':db[_0x1965af[_0x685c('0x1e')]],'as':_0x1965af['as'],'attributes':_0x1965af[_0x685c('0x1a')],'include':_0x1965af[_0x685c('0x1d')]?_[_0x685c('0x1c')](_0x1965af[_0x685c('0x1d')],function(_0x17e1c1){return{'model':db[_0x17e1c1['model']],'as':_0x17e1c1['as'],'attributes':_0x17e1c1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e9721){logger['info'](_0x685c('0x21'),_0xb1be30);logger['debug'](_0x685c('0x21'),_0xb1be30,JSON[_0x685c('0x11')](_0x5e9721));_0x4a3c8d(_0x5e9721);})[_0x685c('0x1f')](function(_0x8fa1a2){logger[_0x685c('0x12')]('ShowTrunk',_0x8fa1a2[_0x685c('0x13')],_0xb1be30);_0x3cd44b(_0x1b01ba['error'](0x1f4,_0x8fa1a2['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 3c9c365..b62bd12 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb71a=['../../components/auth/service','./user-setting.controller','put','isAuthenticated','update','exports','express','Router'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xb71a,0x19e));var _0xab71=function(_0xf5d71c,_0x2613a6){_0xf5d71c=_0xf5d71c-0x0;var _0x5af672=_0xb71a[_0xf5d71c];return _0x5af672;};'use strict';var express=require(_0xab71('0x0'));var router=express[_0xab71('0x1')]();var auth=require(_0xab71('0x2'));var controller=require(_0xab71('0x3'));router[_0xab71('0x4')]('/:id',auth[_0xab71('0x5')](),controller[_0xab71('0x6')]);module[_0xab71('0x7')]=router; \ No newline at end of file +var _0x44d0=['express','../../components/auth/service','./user-setting.controller','put','update','exports'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0x44d0,0x90));var _0x044d=function(_0x5e0251,_0x3da697){_0x5e0251=_0x5e0251-0x0;var _0x30f995=_0x44d0[_0x5e0251];return _0x30f995;};'use strict';var express=require(_0x044d('0x0'));var router=express['Router']();var auth=require(_0x044d('0x1'));var controller=require(_0x044d('0x2'));router[_0x044d('0x3')]('/:id',auth['isAuthenticated'](),controller[_0x044d('0x4')]);module[_0x044d('0x5')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index bd80678..86e8104 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b66=['BOOLEAN','TEXT','INTEGER','UserId','sequelize','warning','info','debug','exports','ENUM','error'];(function(_0x1649fe,_0x5916da){var _0x473a67=function(_0x163cae){while(--_0x163cae){_0x1649fe['push'](_0x1649fe['shift']());}};_0x473a67(++_0x5916da);}(_0x5b66,0x143));var _0x65b6=function(_0x1dc384,_0x4f48a2){_0x1dc384=_0x1dc384-0x0;var _0x1f9869=_0x5b66[_0x1dc384];return _0x1f9869;};'use strict';var Sequelize=require(_0x65b6('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x65b6('0x1'),_0x65b6('0x2'),_0x65b6('0x3')];module[_0x65b6('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x65b6('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x65b6('0x6'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x65b6('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x65b6('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x65b6('0x9')],'unique':_0x65b6('0xa')}}; \ No newline at end of file +var _0xd369=['error','INTEGER','sequelize','warning','info','exports','ENUM'];(function(_0x58833c,_0x4b3171){var _0x32b6e6=function(_0x24404a){while(--_0x24404a){_0x58833c['push'](_0x58833c['shift']());}};_0x32b6e6(++_0x4b3171);}(_0xd369,0x1c2));var _0x9d36=function(_0x5f321f,_0x416514){_0x5f321f=_0x5f321f-0x0;var _0x2218e3=_0xd369[_0x5f321f];return _0x2218e3;};'use strict';var Sequelize=require(_0x9d36('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x9d36('0x1'),_0x9d36('0x2'),'debug'];module[_0x9d36('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x9d36('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x9d36('0x5'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x9d36('0x6')],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index dc31c8e..37757a7 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22fb=['sendStatus','stack','send','user','role','Unauthorized','Invalid\x20user\x20setting\x20id','find','params','body','catch','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','defaults','localhost','status','json','update','then'];(function(_0x20897e,_0x2d57d5){var _0x46714e=function(_0x4d1c29){while(--_0x4d1c29){_0x20897e['push'](_0x20897e['shift']());}};_0x46714e(++_0x2d57d5);}(_0x22fb,0x192));var _0xb22f=function(_0x3c7bf0,_0xa54187){_0x3c7bf0=_0x3c7bf0-0x0;var _0x4e7426=_0x22fb[_0x3c7bf0];return _0x4e7426;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0xb22f('0x0'))('api');var config=require(_0xb22f('0x1'));var db=require(_0xb22f('0x2'))['db'];var socket=require(_0xb22f('0x3'))(new Redis(config[_0xb22f('0x4')]));require(_0xb22f('0x5'))['register'](socket);config[_0xb22f('0x4')]=_[_0xb22f('0x6')](config[_0xb22f('0x4')],{'host':_0xb22f('0x7'),'port':0x18eb});function respondWithResult(_0x412a95,_0x367d4b){_0x367d4b=_0x367d4b||0xc8;return function(_0x47f61a){if(_0x47f61a){return _0x412a95[_0xb22f('0x8')](_0x367d4b)[_0xb22f('0x9')](_0x47f61a);}};}function saveUpdates(_0x36e238){return function(_0x391e11){if(_0x391e11){return _0x391e11[_0xb22f('0xa')](_0x36e238)[_0xb22f('0xb')](function(_0x188cea){return _0x188cea;});}return null;};}function handleEntityNotFound(_0x2ca6dd){return function(_0x26cf79){if(!_0x26cf79){_0x2ca6dd[_0xb22f('0xc')](0x194);}return _0x26cf79;};}function handleError(_0x3473d4,_0x593330){_0x593330=_0x593330||0x1f4;return function(_0x4b9e56){logger['error'](_0x4b9e56[_0xb22f('0xd')]);if(_0x4b9e56['name']){delete _0x4b9e56['name'];}_0x3473d4['status'](_0x593330)[_0xb22f('0xe')](_0x4b9e56);};}exports[_0xb22f('0xa')]=function(_0x4ae6bb,_0x2f046d){if(_0x4ae6bb[_0xb22f('0xf')][_0xb22f('0x10')]!=='admin')throw new Error(_0xb22f('0x11'));if(isNaN(Number(_0x4ae6bb['params']['id'])))throw new Error(_0xb22f('0x12'));return db['UserSetting'][_0xb22f('0x13')]({'where':{'id':_0x4ae6bb[_0xb22f('0x14')]['id']}})[_0xb22f('0xb')](handleEntityNotFound(_0x2f046d,null))[_0xb22f('0xb')](saveUpdates(_0x4ae6bb[_0xb22f('0x15')],null))['then'](respondWithResult(_0x2f046d,null))[_0xb22f('0x16')](handleError(_0x2f046d,null));}; \ No newline at end of file +var _0xff98=['Invalid\x20user\x20setting\x20id','UserSetting','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter','./user-setting.socket','redis','localhost','status','json','update','then','sendStatus','stack','name','send','user','role','admin','params'];(function(_0x9ec53c,_0x5682b9){var _0x4ee403=function(_0x2d2d52){while(--_0x2d2d52){_0x9ec53c['push'](_0x9ec53c['shift']());}};_0x4ee403(++_0x5682b9);}(_0xff98,0x9c));var _0x8ff9=function(_0x33cd9f,_0x5d930a){_0x33cd9f=_0x33cd9f-0x0;var _0x26cceb=_0xff98[_0x33cd9f];return _0x26cceb;};'use strict';var _=require('lodash');var Redis=require(_0x8ff9('0x0'));var logger=require(_0x8ff9('0x1'))(_0x8ff9('0x2'));var config=require(_0x8ff9('0x3'));var db=require('../../mysqldb')['db'];var socket=require(_0x8ff9('0x4'))(new Redis(config['redis']));require(_0x8ff9('0x5'))['register'](socket);config[_0x8ff9('0x6')]=_['defaults'](config[_0x8ff9('0x6')],{'host':_0x8ff9('0x7'),'port':0x18eb});function respondWithResult(_0x4122b2,_0x3e6002){_0x3e6002=_0x3e6002||0xc8;return function(_0x280acf){if(_0x280acf){return _0x4122b2[_0x8ff9('0x8')](_0x3e6002)[_0x8ff9('0x9')](_0x280acf);}};}function saveUpdates(_0x22c681){return function(_0x58b8aa){if(_0x58b8aa){return _0x58b8aa[_0x8ff9('0xa')](_0x22c681)[_0x8ff9('0xb')](function(_0x1bab3d){return _0x1bab3d;});}return null;};}function handleEntityNotFound(_0x725644){return function(_0xee279a){if(!_0xee279a){_0x725644[_0x8ff9('0xc')](0x194);}return _0xee279a;};}function handleError(_0x177f72,_0x5164c8){_0x5164c8=_0x5164c8||0x1f4;return function(_0x593faa){logger['error'](_0x593faa[_0x8ff9('0xd')]);if(_0x593faa[_0x8ff9('0xe')]){delete _0x593faa[_0x8ff9('0xe')];}_0x177f72['status'](_0x5164c8)[_0x8ff9('0xf')](_0x593faa);};}exports[_0x8ff9('0xa')]=function(_0x24798a,_0x2e2a89){if(_0x24798a[_0x8ff9('0x10')][_0x8ff9('0x11')]!==_0x8ff9('0x12'))throw new Error('Unauthorized');if(isNaN(Number(_0x24798a[_0x8ff9('0x13')]['id'])))throw new Error(_0x8ff9('0x14'));return db[_0x8ff9('0x15')]['find']({'where':{'id':_0x24798a[_0x8ff9('0x13')]['id']}})['then'](handleEntityNotFound(_0x2e2a89,null))[_0x8ff9('0xb')](saveUpdates(_0x24798a['body'],null))['then'](respondWithResult(_0x2e2a89,null))['catch'](handleError(_0x2e2a89,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 62e740e..b940c3b 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe81a=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x290201,_0x279632){var _0x3d5c08=function(_0x3d0f41){while(--_0x3d0f41){_0x290201['push'](_0x290201['shift']());}};_0x3d5c08(++_0x279632);}(_0xe81a,0xce));var _0xae81=function(_0x1f7c90,_0x23a49e){_0x1f7c90=_0x1f7c90-0x0;var _0x145a29=_0xe81a[_0x1f7c90];return _0x145a29;};'use strict';var EventEmitter=require(_0xae81('0x0'));var UserSetting=require(_0xae81('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xae81('0x2')](0x0);var events={'afterCreate':_0xae81('0x3'),'afterUpdate':_0xae81('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5e42b2){return function(_0x4572e9,_0x15c992,_0x1eee53){UserSettingEvents[_0xae81('0x5')](_0x5e42b2+':'+_0x4572e9['id'],_0x4572e9);UserSettingEvents[_0xae81('0x5')](_0x5e42b2,_0x4572e9);_0x1eee53(null);};}for(var e in events){if(events[_0xae81('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0xae81('0x7')]=UserSettingEvents; \ No newline at end of file +var _0xe580=['hasOwnProperty','hook','exports','../../mysqldb','UserSetting','setMaxListeners','update','emit'];(function(_0x3423bd,_0x3859f7){var _0x44fadf=function(_0x433df6){while(--_0x433df6){_0x3423bd['push'](_0x3423bd['shift']());}};_0x44fadf(++_0x3859f7);}(_0xe580,0x6b));var _0x0e58=function(_0x252331,_0xa2d8b6){_0x252331=_0x252331-0x0;var _0x2a4879=_0xe580[_0x252331];return _0x2a4879;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x0e58('0x0'))['db'][_0x0e58('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x0e58('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0e58('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4a9f3f){return function(_0x369b75,_0x1e644a,_0x21a4fd){UserSettingEvents[_0x0e58('0x4')](_0x4a9f3f+':'+_0x369b75['id'],_0x369b75);UserSettingEvents[_0x0e58('0x4')](_0x4a9f3f,_0x369b75);_0x21a4fd(null);};}for(var e in events){if(events[_0x0e58('0x5')](e)){var event=events[e];UserSetting[_0x0e58('0x6')](e,emitEvent(event));}}module[_0x0e58('0x7')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 8f471f8..aa8544e 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0972=['exports','define','user_settings','clientSideLoggingEnabledSince'];(function(_0x3ab9ef,_0x4d08ff){var _0x1daeec=function(_0x1c0d56){while(--_0x1c0d56){_0x3ab9ef['push'](_0x3ab9ef['shift']());}};_0x1daeec(++_0x4d08ff);}(_0x0972,0x64));var _0x2097=function(_0x329711,_0x294959){_0x329711=_0x329711-0x0;var _0x271579=_0x0972[_0x329711];return _0x271579;};'use strict';var attributes=require('./user-setting.attributes');module[_0x2097('0x0')]=function(_0x517422){return _0x517422[_0x2097('0x1')]('UserSetting',attributes,{'tableName':_0x2097('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x12f523){if(!_0x12f523['clientSideLoggingEnabled'])_0x12f523[_0x2097('0x3')]=null;else if(_0x12f523[_0x2097('0x3')]===null)_0x12f523[_0x2097('0x3')]=new Date();}}});}; \ No newline at end of file +var _0xa4db=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','define','UserSetting'];(function(_0x358df5,_0x2d31af){var _0x3727b2=function(_0x1c7e9a){while(--_0x1c7e9a){_0x358df5['push'](_0x358df5['shift']());}};_0x3727b2(++_0x2d31af);}(_0xa4db,0x139));var _0xba4d=function(_0x1d08c2,_0x595e04){_0x1d08c2=_0x1d08c2-0x0;var _0x1eb356=_0xa4db[_0x1d08c2];return _0x1eb356;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x5a4e93){return _0x5a4e93[_0xba4d('0x0')](_0xba4d('0x1'),attributes,{'tableName':_0xba4d('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f3b60){if(!_0x1f3b60[_0xba4d('0x3')])_0x1f3b60[_0xba4d('0x4')]=null;else if(_0x1f3b60['clientSideLoggingEnabledSince']===null)_0x1f3b60[_0xba4d('0x4')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index c0d9cbe..b1cd473 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x315e=['emit','user-setting:update','user-setting:update:user-','register','user-setting:','./user-setting.events','save','remove'];(function(_0x26852a,_0x4132ee){var _0xd4aeed=function(_0x277b46){while(--_0x277b46){_0x26852a['push'](_0x26852a['shift']());}};_0xd4aeed(++_0x4132ee);}(_0x315e,0x1ed));var _0xe315=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x315e[_0x1facfa];return _0x9ec701;};'use strict';var UserSettingEvents=require(_0xe315('0x0'));var events=[_0xe315('0x1'),_0xe315('0x2'),'update'];function createListener(_0x246d33,_0x526595){return function(_0x24b42f){_0x526595[_0xe315('0x3')](_0x246d33,_0x24b42f);if(_0x246d33===_0xe315('0x4')){_0x526595[_0xe315('0x3')](_0xe315('0x5')+_0x24b42f['UserId'],_0x24b42f);}};}exports[_0xe315('0x6')]=function(_0x2361f7){for(var _0x28144c=0x0,_0x282bea=events['length'];_0x28144c<_0x282bea;_0x28144c++){var _0x44d864=events[_0x28144c];var _0x10d062=createListener(_0xe315('0x7')+_0x44d864,_0x2361f7);UserSettingEvents['on'](_0x44d864,_0x10d062);}}; \ No newline at end of file +var _0x0705=['update','emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events'];(function(_0x5cda5f,_0x93f125){var _0xe3708=function(_0xff3e65){while(--_0xff3e65){_0x5cda5f['push'](_0x5cda5f['shift']());}};_0xe3708(++_0x93f125);}(_0x0705,0x1dc));var _0x5070=function(_0x5e72dc,_0xa12f95){_0x5e72dc=_0x5e72dc-0x0;var _0x197a74=_0x0705[_0x5e72dc];return _0x197a74;};'use strict';var UserSettingEvents=require(_0x5070('0x0'));var events=['save','remove',_0x5070('0x1')];function createListener(_0xc28f74,_0x34f25a){return function(_0x2fc259){_0x34f25a[_0x5070('0x2')](_0xc28f74,_0x2fc259);if(_0xc28f74===_0x5070('0x3')){_0x34f25a[_0x5070('0x2')](_0x5070('0x4')+_0x2fc259[_0x5070('0x5')],_0x2fc259);}};}exports[_0x5070('0x6')]=function(_0x262ef9){for(var _0x16bd78=0x0,_0x2d445d=events[_0x5070('0x7')];_0x16bd78<_0x2d445d;_0x16bd78++){var _0x1af5f3=events[_0x16bd78];var _0x5f29fc=createListener(_0x5070('0x8')+_0x1af5f3,_0x262ef9);UserSettingEvents['on'](_0x1af5f3,_0x5f29fc);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 8d1a3b1..3574a5c 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 _0x8837=['getWhatsappInteractions','getTeams','/:id/lists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getScheduledCalls','getApiKey','post','addContacts','create','/create_many','bulkCreate','root','server/files/images/','format','now','originalname','single','/:id/login','/:id/logout','logout','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addSquareProjects','/:id/api_key','createApiKey','put','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/sms_interactions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/whoami','whoami','/:id','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions'];(function(_0x172298,_0x542449){var _0x44856d=function(_0xa648ba){while(--_0xa648ba){_0x172298['push'](_0x172298['shift']());}};_0x44856d(++_0x542449);}(_0x8837,0x18e));var _0x7883=function(_0x31fb4f,_0x129fd3){_0x31fb4f=_0x31fb4f-0x0;var _0x41beca=_0x8837[_0x31fb4f];return _0x41beca;};'use strict';var multer=require('multer');var util=require(_0x7883('0x0'));var path=require(_0x7883('0x1'));var timeout=require(_0x7883('0x2'));var express=require('express');var router=express[_0x7883('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7883('0x4'));var config=require(_0x7883('0x5'));var controller=require('./user.controller');router[_0x7883('0x6')]('/',auth[_0x7883('0x7')](),controller[_0x7883('0x8')]);router[_0x7883('0x6')]('/describe',auth[_0x7883('0x7')](),controller[_0x7883('0x9')]);router[_0x7883('0x6')](_0x7883('0xa'),auth[_0x7883('0x7')](),controller[_0x7883('0xb')]);router['get']('/presence',auth[_0x7883('0x7')](),controller['getPresence']);router[_0x7883('0x6')](_0x7883('0xc'),auth[_0x7883('0x7')](),controller['show']);router['get'](_0x7883('0xd'),controller['getAvatar']);router[_0x7883('0x6')](_0x7883('0xe'),auth[_0x7883('0x7')](),controller[_0x7883('0xf')]);router[_0x7883('0x6')](_0x7883('0x10'),auth['isAuthenticated'](),controller[_0x7883('0x11')]);router[_0x7883('0x6')](_0x7883('0x12'),auth['isAuthenticated'](),controller[_0x7883('0x13')]);router[_0x7883('0x6')](_0x7883('0x14'),auth[_0x7883('0x7')](),controller[_0x7883('0x15')]);router[_0x7883('0x6')](_0x7883('0x16'),auth['isAuthenticated'](),controller['getGroups']);router['get'](_0x7883('0x17'),auth[_0x7883('0x7')](),controller[_0x7883('0x18')]);router[_0x7883('0x6')](_0x7883('0x19'),auth[_0x7883('0x7')](),controller[_0x7883('0x1a')]);router[_0x7883('0x6')]('/:id/chat/interactions',auth[_0x7883('0x7')](),controller[_0x7883('0x1b')]);router['get'](_0x7883('0x1c'),auth[_0x7883('0x7')](),controller[_0x7883('0x1d')]);router[_0x7883('0x6')](_0x7883('0x1e'),auth[_0x7883('0x7')](),controller[_0x7883('0x1f')]);router[_0x7883('0x6')]('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0x7883('0x20')]);router[_0x7883('0x6')](_0x7883('0x21'),auth[_0x7883('0x7')](),controller['getFaxInteractions']);router[_0x7883('0x6')]('/:id/whatsapp/interactions',auth[_0x7883('0x7')](),controller[_0x7883('0x22')]);router[_0x7883('0x6')]('/:id/teams',auth[_0x7883('0x7')](),controller[_0x7883('0x23')]);router[_0x7883('0x6')](_0x7883('0x24'),auth[_0x7883('0x7')](),controller['getLists']);router[_0x7883('0x6')](_0x7883('0x25'),auth[_0x7883('0x7')](),controller['getAgents']);router['get'](_0x7883('0x26'),auth[_0x7883('0x7')](),controller[_0x7883('0x27')]);router[_0x7883('0x6')](_0x7883('0x28'),auth[_0x7883('0x7')](),controller[_0x7883('0x29')]);router[_0x7883('0x6')]('/:id/mail_accounts',auth[_0x7883('0x7')](),controller['getMailAccounts']);router['get'](_0x7883('0x2a'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get']('/:id/sms_accounts',auth[_0x7883('0x7')](),controller[_0x7883('0x2b')]);router[_0x7883('0x6')](_0x7883('0x2c'),auth[_0x7883('0x7')](),controller[_0x7883('0x2d')]);router[_0x7883('0x6')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x7883('0x2e')]);router['get'](_0x7883('0x2f'),auth[_0x7883('0x7')](),controller['getSquareProjects']);router[_0x7883('0x6')]('/:id/scheduled_calls',auth[_0x7883('0x7')](),controller[_0x7883('0x30')]);router['get']('/:id/api_key',auth[_0x7883('0x7')](),controller[_0x7883('0x31')]);router[_0x7883('0x32')](_0x7883('0x10'),auth['isAuthenticated'](),controller[_0x7883('0x33')]);router[_0x7883('0x32')]('/',auth[_0x7883('0x7')](),controller[_0x7883('0x34')]);router[_0x7883('0x32')](_0x7883('0x35'),auth[_0x7883('0x7')](),controller[_0x7883('0x36')]);router[_0x7883('0x32')](_0x7883('0x12'),auth[_0x7883('0x7')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x21dbbc,_0x30cbf0,_0x3a7155){_0x3a7155(null,path['join'](config[_0x7883('0x37')],_0x7883('0x38')));},'filename':function(_0x45cad0,_0x31d7d9,_0x2e0acf){_0x2e0acf(null,util[_0x7883('0x39')]('%s-%s',Date[_0x7883('0x3a')](),_0x31d7d9[_0x7883('0x3b')]));}})});router[_0x7883('0x32')](_0x7883('0xd'),upload[_0x7883('0x3c')]('file'),controller['addAvatar']);router['post'](_0x7883('0x3d'),auth[_0x7883('0x7')](),controller['login']);router[_0x7883('0x32')](_0x7883('0x3e'),auth['isAuthenticated'](),controller[_0x7883('0x3f')]);router['post']('/:id/pause',auth['isAuthenticated'](),controller[_0x7883('0x40')]);router[_0x7883('0x32')](_0x7883('0x41'),auth[_0x7883('0x7')](),controller[_0x7883('0x42')]);router[_0x7883('0x32')](_0x7883('0x43'),auth[_0x7883('0x7')](),controller[_0x7883('0x44')]);router['post'](_0x7883('0x45'),auth[_0x7883('0x7')](),controller[_0x7883('0x46')]);router[_0x7883('0x32')](_0x7883('0x47'),auth[_0x7883('0x7')](),controller['addMailInteractions']);router['post'](_0x7883('0x48'),auth['isAuthenticated'](),controller[_0x7883('0x49')]);router[_0x7883('0x32')]('/:id/sms_interactions',auth[_0x7883('0x7')](),controller[_0x7883('0x4a')]);router[_0x7883('0x32')](_0x7883('0x4b'),auth[_0x7883('0x7')](),controller[_0x7883('0x4c')]);router['post']('/:id/whatsapp_interactions',auth[_0x7883('0x7')](),controller[_0x7883('0x4d')]);router['post'](_0x7883('0x28'),auth[_0x7883('0x7')](),controller[_0x7883('0x4e')]);router[_0x7883('0x32')](_0x7883('0x4f'),auth[_0x7883('0x7')](),controller['addMailAccounts']);router[_0x7883('0x32')](_0x7883('0x2a'),auth[_0x7883('0x7')](),controller['addOpenchannelAccounts']);router[_0x7883('0x32')](_0x7883('0x50'),auth[_0x7883('0x7')](),controller[_0x7883('0x51')]);router[_0x7883('0x32')]('/:id/chat_websites',auth[_0x7883('0x7')](),controller[_0x7883('0x52')]);router[_0x7883('0x32')](_0x7883('0x53'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x7883('0x32')]('/:id/square_projects',auth[_0x7883('0x7')](),controller[_0x7883('0x54')]);router[_0x7883('0x32')](_0x7883('0x55'),auth[_0x7883('0x7')](),controller[_0x7883('0x56')]);router[_0x7883('0x57')](_0x7883('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x7883('0x57')](_0x7883('0x58'),auth[_0x7883('0x7')](),controller[_0x7883('0x59')]);router['delete']('/:id/queues',auth[_0x7883('0x7')](),controller[_0x7883('0x5a')]);router[_0x7883('0x5b')](_0x7883('0x43'),auth[_0x7883('0x7')](),controller[_0x7883('0x5c')]);router[_0x7883('0x5b')](_0x7883('0xc'),auth[_0x7883('0x7')](),controller[_0x7883('0x5d')]);router[_0x7883('0x5b')](_0x7883('0x45'),auth[_0x7883('0x7')](),controller[_0x7883('0x5e')]);router[_0x7883('0x5b')](_0x7883('0x47'),auth[_0x7883('0x7')](),controller[_0x7883('0x5f')]);router['delete']('/:id/fax_interactions',auth[_0x7883('0x7')](),controller['removeFaxInteractions']);router['delete'](_0x7883('0x60'),auth[_0x7883('0x7')](),controller['removeSmsInteractions']);router['delete']('/:id/openchannel_interactions',auth[_0x7883('0x7')](),controller[_0x7883('0x61')]);router[_0x7883('0x5b')](_0x7883('0x62'),auth[_0x7883('0x7')](),controller[_0x7883('0x63')]);router['delete'](_0x7883('0x28'),auth['isAuthenticated'](),controller[_0x7883('0x64')]);router[_0x7883('0x5b')](_0x7883('0x4f'),auth[_0x7883('0x7')](),controller[_0x7883('0x65')]);router[_0x7883('0x5b')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x7883('0x66')]);router['delete'](_0x7883('0x50'),auth[_0x7883('0x7')](),controller['removeSmsAccounts']);router['delete'](_0x7883('0x2c'),auth[_0x7883('0x7')](),controller[_0x7883('0x67')]);router[_0x7883('0x5b')](_0x7883('0x53'),auth[_0x7883('0x7')](),controller[_0x7883('0x68')]);router[_0x7883('0x5b')]('/:id/square_projects',auth[_0x7883('0x7')](),controller[_0x7883('0x69')]);router[_0x7883('0x5b')](_0x7883('0x55'),auth['isAuthenticated'](),controller[_0x7883('0x6a')]);module[_0x7883('0x6b')]=router; \ No newline at end of file +var _0x5bf7=['addSquareProjects','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','getChatWebsites','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','create','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','file','/:id/logout','pause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts'];(function(_0x2d3140,_0x2e06c0){var _0x181473=function(_0x8ac974){while(--_0x8ac974){_0x2d3140['push'](_0x2d3140['shift']());}};_0x181473(++_0x2e06c0);}(_0x5bf7,0x158));var _0x75bf=function(_0x3cebc6,_0x43fb87){_0x3cebc6=_0x3cebc6-0x0;var _0x8934a0=_0x5bf7[_0x3cebc6];return _0x8934a0;};'use strict';var multer=require(_0x75bf('0x0'));var util=require(_0x75bf('0x1'));var path=require(_0x75bf('0x2'));var timeout=require(_0x75bf('0x3'));var express=require('express');var router=express[_0x75bf('0x4')]();var fs_extra=require(_0x75bf('0x5'));var auth=require(_0x75bf('0x6'));var interaction=require(_0x75bf('0x7'));var config=require(_0x75bf('0x8'));var controller=require(_0x75bf('0x9'));router['get']('/',auth[_0x75bf('0xa')](),controller[_0x75bf('0xb')]);router[_0x75bf('0xc')](_0x75bf('0xd'),auth[_0x75bf('0xa')](),controller[_0x75bf('0xe')]);router[_0x75bf('0xc')]('/whoami',auth[_0x75bf('0xa')](),controller['whoami']);router['get']('/presence',auth['isAuthenticated'](),controller['getPresence']);router['get'](_0x75bf('0xf'),auth['isAuthenticated'](),controller[_0x75bf('0x10')]);router['get'](_0x75bf('0x11'),controller['getAvatar']);router[_0x75bf('0xc')](_0x75bf('0x12'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x13')]);router[_0x75bf('0xc')](_0x75bf('0x14'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x15')]);router[_0x75bf('0xc')](_0x75bf('0x16'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x17')]);router[_0x75bf('0xc')]('/:id/queues_rt',auth[_0x75bf('0xa')](),controller[_0x75bf('0x18')]);router['get']('/:id/groups',auth['isAuthenticated'](),controller[_0x75bf('0x19')]);router[_0x75bf('0xc')](_0x75bf('0x1a'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x1b')]);router['get'](_0x75bf('0x1c'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x1d')]);router[_0x75bf('0xc')](_0x75bf('0x1e'),auth[_0x75bf('0xa')](),controller['getChatInteractions']);router[_0x75bf('0xc')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x75bf('0x1f')]);router['get'](_0x75bf('0x20'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x21')]);router[_0x75bf('0xc')](_0x75bf('0x22'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x75bf('0xc')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x75bf('0x23')]);router[_0x75bf('0xc')](_0x75bf('0x24'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x25')]);router['get'](_0x75bf('0x26'),auth['isAuthenticated'](),controller['getTeams']);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0x75bf('0x27')]);router[_0x75bf('0xc')](_0x75bf('0x28'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x29')]);router['get'](_0x75bf('0x2a'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x2b')]);router[_0x75bf('0xc')]('/:id/fax_accounts',auth[_0x75bf('0xa')](),controller['getFaxAccounts']);router[_0x75bf('0xc')](_0x75bf('0x2c'),auth['isAuthenticated'](),controller[_0x75bf('0x2d')]);router[_0x75bf('0xc')](_0x75bf('0x2e'),auth[_0x75bf('0xa')](),controller['getOpenchannelAccounts']);router['get']('/:id/sms_accounts',auth[_0x75bf('0xa')](),controller[_0x75bf('0x2f')]);router[_0x75bf('0xc')]('/:id/chat_websites',auth[_0x75bf('0xa')](),controller[_0x75bf('0x30')]);router[_0x75bf('0xc')]('/:id/whatsapp_accounts',auth[_0x75bf('0xa')](),controller[_0x75bf('0x31')]);router[_0x75bf('0xc')](_0x75bf('0x32'),auth[_0x75bf('0xa')](),controller['getSquareProjects']);router[_0x75bf('0xc')](_0x75bf('0x33'),auth['isAuthenticated'](),controller['getScheduledCalls']);router['get'](_0x75bf('0x34'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x35')]);router[_0x75bf('0x36')](_0x75bf('0x14'),auth['isAuthenticated'](),controller[_0x75bf('0x37')]);router[_0x75bf('0x36')]('/',auth[_0x75bf('0xa')](),controller[_0x75bf('0x38')]);router['post']('/create_many',auth[_0x75bf('0xa')](),controller[_0x75bf('0x39')]);router[_0x75bf('0x36')](_0x75bf('0x16'),auth[_0x75bf('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0x75bf('0x3a')]({'destination':function(_0x56ca25,_0xf01d94,_0x45110a){_0x45110a(null,path[_0x75bf('0x3b')](config[_0x75bf('0x3c')],_0x75bf('0x3d')));},'filename':function(_0x5afee5,_0x2beb62,_0x5936bf){_0x5936bf(null,util[_0x75bf('0x3e')](_0x75bf('0x3f'),Date[_0x75bf('0x40')](),_0x2beb62['originalname']));}})});router[_0x75bf('0x36')](_0x75bf('0x11'),upload['single'](_0x75bf('0x41')),controller['addAvatar']);router['post']('/:id/login',auth[_0x75bf('0xa')](),controller['login']);router[_0x75bf('0x36')](_0x75bf('0x42'),auth[_0x75bf('0xa')](),controller['logout']);router[_0x75bf('0x36')]('/:id/pause',auth[_0x75bf('0xa')](),controller[_0x75bf('0x43')]);router['post']('/:id/unpause',auth['isAuthenticated'](),controller[_0x75bf('0x44')]);router['post'](_0x75bf('0x26'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x45')]);router[_0x75bf('0x36')]('/:id/chat_interactions',auth[_0x75bf('0xa')](),controller[_0x75bf('0x46')]);router['post'](_0x75bf('0x47'),auth['isAuthenticated'](),controller[_0x75bf('0x48')]);router[_0x75bf('0x36')](_0x75bf('0x49'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x4a')]);router[_0x75bf('0x36')](_0x75bf('0x4b'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x4c')]);router['post'](_0x75bf('0x4d'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x4e')]);router['post'](_0x75bf('0x4f'),auth['isAuthenticated'](),controller['addWhatsappInteractions']);router[_0x75bf('0x36')]('/:id/fax_accounts',auth[_0x75bf('0xa')](),controller[_0x75bf('0x50')]);router['post']('/:id/mail_accounts',auth['isAuthenticated'](),controller['addMailAccounts']);router['post'](_0x75bf('0x2e'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x51')]);router[_0x75bf('0x36')](_0x75bf('0x52'),auth['isAuthenticated'](),controller[_0x75bf('0x53')]);router['post'](_0x75bf('0x54'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x55')]);router['post'](_0x75bf('0x56'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x57')]);router['post']('/:id/square_projects',auth[_0x75bf('0xa')](),controller[_0x75bf('0x58')]);router[_0x75bf('0x36')](_0x75bf('0x34'),auth[_0x75bf('0xa')](),controller['createApiKey']);router[_0x75bf('0x59')](_0x75bf('0xf'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x5a')]);router[_0x75bf('0x59')](_0x75bf('0x5b'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x5c')]);router[_0x75bf('0x5d')](_0x75bf('0x16'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x5e')]);router[_0x75bf('0x5d')]('/:id/teams',auth[_0x75bf('0xa')](),controller[_0x75bf('0x5f')]);router[_0x75bf('0x5d')]('/:id',auth['isAuthenticated'](),controller[_0x75bf('0x60')]);router[_0x75bf('0x5d')](_0x75bf('0x61'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x62')]);router[_0x75bf('0x5d')]('/:id/mail_interactions',auth[_0x75bf('0xa')](),controller['removeMailInteractions']);router['delete'](_0x75bf('0x49'),auth[_0x75bf('0xa')](),controller['removeFaxInteractions']);router[_0x75bf('0x5d')](_0x75bf('0x4b'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x63')]);router[_0x75bf('0x5d')](_0x75bf('0x4d'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x64')]);router[_0x75bf('0x5d')]('/:id/whatsapp_interactions',auth[_0x75bf('0xa')](),controller['removeWhatsappInteractions']);router[_0x75bf('0x5d')](_0x75bf('0x65'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x66')]);router[_0x75bf('0x5d')](_0x75bf('0x2c'),auth['isAuthenticated'](),controller[_0x75bf('0x67')]);router[_0x75bf('0x5d')]('/:id/openchannel_accounts',auth[_0x75bf('0xa')](),controller['removeOpenchannelAccounts']);router['delete'](_0x75bf('0x52'),auth[_0x75bf('0xa')](),controller[_0x75bf('0x68')]);router[_0x75bf('0x5d')]('/:id/chat_websites',auth[_0x75bf('0xa')](),controller[_0x75bf('0x69')]);router[_0x75bf('0x5d')](_0x75bf('0x56'),auth[_0x75bf('0xa')](),controller['removeWhatsappAccounts']);router[_0x75bf('0x5d')]('/:id/square_projects',auth[_0x75bf('0xa')](),controller[_0x75bf('0x6a')]);router[_0x75bf('0x5d')](_0x75bf('0x34'),auth['isAuthenticated'](),controller[_0x75bf('0x6b')]);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 64ccfef..6d5bc6f 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 _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x208e16,_0x327bf7){var _0x2061e4=function(_0x5e5239){while(--_0x5e5239){_0x208e16['push'](_0x208e16['shift']());}};_0x2061e4(++_0x327bf7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d337e,_0x2f7eed){_0x4d337e=_0x4d337e-0x0;var _0x247963=_0xcb91[_0x4d337e];return _0x247963;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['certificate','passive','nonat','update,nonat','TEXT','showWebBar','wss','encryption','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','rtcp_mux','avpf','dtlsverify','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','split','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas'];(function(_0x5beda8,_0x1e8554){var _0x2aa042=function(_0x510f45){while(--_0x510f45){_0x5beda8['push'](_0x5beda8['shift']());}};_0x2aa042(++_0x1e8554);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a9e('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x14')},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x0a9e('0xc'),_0x0a9e('0x17')),'allowNull':!![],'defaultValue':_0x0a9e('0x16')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')]('ALLOWED_NOT_SCREENED',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),'PROHIB_PASSED_SCREEN',_0x0a9e('0x1d'),_0x0a9e('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x540530){this[_0x0a9e('0x4')]('transport',_0x540530?_0x540530[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))['split'](','):null;},'comment':_0x0a9e('0x22')},'dtmfmode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x23'),_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27')),'allowNull':!![],'defaultValue':_0x0a9e('0x23')},'directmedia':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no','nonat',_0x0a9e('0x29'),_0x0a9e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0x15de0e){this['setDataValue']('nat',_0x15de0e?_0x15de0e[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this[_0x0a9e('0x8')](_0x0a9e('0x2c'))[_0x0a9e('0x2d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a9e('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a9e('0x3')]},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x2e'),'set':function(_0x40d766){this['setDataValue'](_0x0a9e('0x2f'),_0x40d766?_0x40d766[_0x0a9e('0x20')](';'):_0x0a9e('0x2e'));},'get':function(){return this[_0x0a9e('0x8')]('allow')?this['getDataValue'](_0x0a9e('0x2f'))[_0x0a9e('0x2d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x5b4f5e){this[_0x0a9e('0x4')](_0x0a9e('0x30'),_0x5b4f5e?_0x5b4f5e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x30'))?this[_0x0a9e('0x8')](_0x0a9e('0x30'))[_0x0a9e('0x2d')](','):null;},'comment':_0x0a9e('0x31')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x32')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x28')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x34'),_0x0a9e('0x35'),_0x0a9e('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38')),'allowNull':!![],'defaultValue':_0x0a9e('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','fingerprint',_0x0a9e('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no',_0x0a9e('0x3b'),_0x0a9e('0x29'),_0x0a9e('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a9e('0x3d')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3649cc){this['setDataValue'](_0x0a9e('0x3e'),_0x3649cc);var _0x5ba1f9=this['get']({'plain':!![]});switch(_0x3649cc){case 0x0:case 0x1:var _0x5674ee=_0x5ba1f9[_0x0a9e('0x21')]?_['isArray'](_0x5ba1f9[_0x0a9e('0x21')])?_0x5ba1f9[_0x0a9e('0x21')][_0x0a9e('0x20')]():_0x5ba1f9[_0x0a9e('0x21')]:_0x0a9e('0x1f');if(_0x5674ee===_0x0a9e('0x3f')){_0x5674ee='udp';}this[_0x0a9e('0x4')]('transport',_0x5674ee);this[_0x0a9e('0x4')](_0x0a9e('0x40'),'no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x41'),null);this[_0x0a9e('0x4')](_0x0a9e('0x42'),null);this['setDataValue'](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('dtlsverify',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this[_0x0a9e('0x4')]('dtlsprivatekey',null);this[_0x0a9e('0x4')](_0x0a9e('0x46'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x3f'));this['setDataValue']('encryption',_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x47'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x41'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x42'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x49'));this['setDataValue'](_0x0a9e('0x45'),_0x5ba1f9[_0x0a9e('0x45')]||_0x0a9e('0x4a'));this['setDataValue'](_0x0a9e('0x4b'),_0x5ba1f9[_0x0a9e('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x0a9e('0x3d')],'set':function(_0x13b5c0){this['setDataValue']('permissions',_0x13b5c0?_0x13b5c0['join'](','):[]);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x4c'))?_[_0x0a9e('0x4d')](this[_0x0a9e('0x8')](_0x0a9e('0x4c'))[_0x0a9e('0x2d')](','),function(_0xeef20){return parseInt(_0xeef20,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0a9e('0x4e')],'get':function(){return this[_0x0a9e('0x8')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a9e('0x8')](_0x0a9e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0xdb98ca){if(typeof _0xdb98ca===_0x0a9e('0x50')){var _0x3df0e3=_0xdb98ca==='1'?!![]:_0xdb98ca==='0'?![]:_0xdb98ca===_0x0a9e('0x51')?!![]:_0xdb98ca===_0x0a9e('0x52')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0x3df0e3);}else{this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0xdb98ca);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xf4120f){this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0xf4120f);if(_0xf4120f===!![]){this['setDataValue'](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')](_0x0a9e('0x56'),0x0);}else{this[_0x0a9e('0x4')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0a9e('0xf')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index bce7ce1..04ce518 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 _0xf642=['checkUserLimits','settingsEnabled','Telephones','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','UserProfileSection','findAll','autoAssociation','compact','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','updatePasswordsHistory','online','loginInPause','voicePause','interface','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','VoiceQueue','SIP/%s','channel','remove','isArray','Queue:remove','UserVoiceQueueRt','userpic','file','filename','getAvatar','join','root','download','existsSync','server/files/images/','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','findOne','CmContact','order','sort','where','pick','options','hasOwnProperty','CmList','List','Tag','color','tag','nolimit','getQueues','isValidChannel','Queue','rawAttributes','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','mobile','format','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','PAUSE','LOGININPAUSE','update','isMiddleware','resolve','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','QueuePause','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','getWhatsappQueues','Whatsapp','getFaxQueues','getOpenchannelQueues','Openchannel','flatten','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Sms','Fax','getLists','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','user_has_mail_interactions:save','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$or','$gt','$gte','$lt','$eq','$between','$in','$notIn','$like','$notLike','$notILike','$overlap','$contained','$any','CmHopper','firstName','Contact','getApiKey','retrieveApiKey','json','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','token','apiKeyNonce','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','isEmpty','inbound','getAgents','lower','col','toString','asc','uniqBy','orderBy','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','ringing','voiceStatus','slice','charAt','toUpperCase','select','ui.','field','user_has_','_interactions','OpenTabs','moment','bluebird','util','path','lodash','squel','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','register','redis','defaults','localhost','client','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','offset','limit','count','set','Content-Range','get','role','admin','Users','user','Agents','agent','telephone','filter','ignore','map','value','includes','find','name','destroy','stack','User','fieldName','type','key','password','salt','getOptions','query','includeAll','include','userSetting','UserSetting','attributes','push','rows','openTabs','length','chat','sms','fax','dataValues','mail','whatsapp','all','show','params','model','keys','filters','intersection','fields','true','merge','openchannel','catch','body','describe','addContacts','ids','omit','securePassword','validatePasswordPattern','max','internal','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','110','104','105','106','108','109','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf642,0x11a));var _0x2f64=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0xf642[_0x2bddf9];return _0x3f3ae9;};'use strict';var moment=require(_0x2f64('0x0'));var BPromise=require(_0x2f64('0x1'));var util=require(_0x2f64('0x2'));var path=require(_0x2f64('0x3'));var fs=require('fs');var _=require(_0x2f64('0x4'));var squel=require(_0x2f64('0x5'));var jayson=require(_0x2f64('0x6'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2f64('0x7'));var logger=require(_0x2f64('0x8'))('api');var utils=require(_0x2f64('0x9'));var config=require(_0x2f64('0xa'));var licenseUtil=require(_0x2f64('0xb'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./user.socket')[_0x2f64('0xc')](socket);config[_0x2f64('0xd')]=_[_0x2f64('0xe')](config['redis'],{'host':_0x2f64('0xf'),'port':0x18eb});var client=jayson[_0x2f64('0x10')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x47b082,_0x188b36,_0x2b29ce,_0x5def39){return new BPromise(function(_0x45f7f1,_0x4ddee7){var _0x446599=_0x5def39||client;return _0x446599[_0x2f64('0x11')](_0x47b082,_0x2b29ce)[_0x2f64('0x12')](function(_0x3d5d13){logger[_0x2f64('0x13')](_0x2f64('0x14'),_0x188b36,_0x2f64('0x15'));logger[_0x2f64('0x16')]('User,\x20%s,\x20%s,\x20%s',_0x188b36,_0x2f64('0x15'),JSON[_0x2f64('0x17')](_0x3d5d13));if(_0x3d5d13[_0x2f64('0x18')]){if(_0x3d5d13['error'][_0x2f64('0x19')]===0x1f4){logger[_0x2f64('0x18')](_0x2f64('0x14'),_0x188b36,_0x3d5d13[_0x2f64('0x18')]['message']);return _0x4ddee7(_0x3d5d13[_0x2f64('0x18')][_0x2f64('0x1a')]);}logger[_0x2f64('0x18')](_0x2f64('0x14'),_0x188b36,_0x3d5d13[_0x2f64('0x18')][_0x2f64('0x1a')]);return _0x45f7f1(_0x3d5d13[_0x2f64('0x18')][_0x2f64('0x1a')]);}else{logger[_0x2f64('0x13')]('User,\x20%s,\x20%s',_0x188b36,'request\x20sent');_0x45f7f1(_0x3d5d13[_0x2f64('0x1b')][_0x2f64('0x1a')]);}})['catch'](function(_0x134c15){logger[_0x2f64('0x18')](_0x2f64('0x14'),_0x188b36,_0x134c15);_0x4ddee7(_0x134c15);});});}function respondWithStatusCode(_0x47c0c3,_0x151d40){_0x151d40=_0x151d40||0xcc;return function(_0x103b5e){if(_0x103b5e){return _0x47c0c3[_0x2f64('0x1c')](_0x151d40);}return _0x47c0c3[_0x2f64('0x1d')](_0x151d40)[_0x2f64('0x1e')]();};}function respondWithResult(_0x137c11,_0x5642ee){_0x5642ee=_0x5642ee||0xc8;return function(_0x13aa6b){if(_0x13aa6b){return _0x137c11[_0x2f64('0x1d')](_0x5642ee)['json'](_0x13aa6b);}};}function respondWithFilteredResult(_0x547e72,_0x30d317){return function(_0x550556){if(_0x550556){var _0x328aeb=typeof _0x30d317[_0x2f64('0x1f')]==='undefined'&&typeof _0x30d317[_0x2f64('0x20')]==='undefined';var _0xbe2595=_0x550556[_0x2f64('0x21')];var _0x2c374b=_0x328aeb?0x0:_0x30d317[_0x2f64('0x1f')];var _0x244328=_0x328aeb?_0x550556[_0x2f64('0x21')]:_0x30d317[_0x2f64('0x1f')]+_0x30d317['limit'];var _0x3dd4c2;if(_0x244328>=_0xbe2595){_0x244328=_0xbe2595;_0x3dd4c2=0xc8;}else{_0x3dd4c2=0xce;}_0x547e72[_0x2f64('0x1d')](_0x3dd4c2);return _0x547e72[_0x2f64('0x22')](_0x2f64('0x23'),_0x2c374b+'-'+_0x244328+'/'+_0xbe2595)['json'](_0x550556);}return null;};}function saveUpdates(_0x3ff047){return function(_0x1cd34c){if(_0x1cd34c){return _0x1cd34c['update'](_0x3ff047)[_0x2f64('0x12')](function(_0x26d777){return _0x26d777;});}return null;};}function removeEntity(_0x23445){return function(_0x3c1554){if(_0x3c1554){return _0x3c1554['destroy']()[_0x2f64('0x12')](function(){var _0x56f206=_0x3c1554[_0x2f64('0x24')]({'plain':!![]});if(_0x56f206[_0x2f64('0x25')]===_0x2f64('0x26'))return;var _0xc43358=[{'name':_0x2f64('0x27'),'value':_0x2f64('0x28'),'ignore':!![]},{'name':_0x2f64('0x29'),'value':_0x2f64('0x2a'),'ignore':![]},{'name':'Telephones','value':_0x2f64('0x2b'),'ignore':![]}];var _0x15dd52=_(_0xc43358)[_0x2f64('0x2c')](_0x2f64('0x2d'))[_0x2f64('0x2e')](_0x2f64('0x2f'))[_0x2f64('0x2f')]();if(_[_0x2f64('0x30')](_0x15dd52,_0x56f206[_0x2f64('0x25')])){return;}var _0x1a914b=_[_0x2f64('0x31')](_0xc43358,[_0x2f64('0x2f'),_0x56f206['role']])[_0x2f64('0x32')];return db['UserProfileResource'][_0x2f64('0x33')]({'where':{'type':_0x1a914b,'resourceId':_0x56f206['id']}})[_0x2f64('0x12')](function(){return _0x3c1554;});})['then'](function(){_0x23445['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e3fae){return function(_0x1b6630){if(!_0x1b6630){_0x4e3fae[_0x2f64('0x1c')](0x194);}return _0x1b6630;};}function handleError(_0x1aed9f,_0x19aa17){_0x19aa17=_0x19aa17||0x1f4;return function(_0x5b6acc){logger[_0x2f64('0x18')](_0x5b6acc[_0x2f64('0x34')]);if(_0x5b6acc['name']){delete _0x5b6acc[_0x2f64('0x32')];}_0x1aed9f[_0x2f64('0x1d')](_0x19aa17)['send'](_0x5b6acc);};}exports['index']=function(_0x390722,_0x298c34){var _0x4d3cac={},_0x53db96={'count':0x0,'rows':[]};var _0x5130ff=_(db[_0x2f64('0x35')]['rawAttributes'])[_0x2f64('0x2e')](function(_0x3a3f33){return{'name':_0x3a3f33[_0x2f64('0x36')],'type':_0x3a3f33[_0x2f64('0x37')][_0x2f64('0x38')]};})['filter'](function(_0x2acd8c){return!_[_0x2f64('0x30')]([_0x2f64('0x39'),_0x2f64('0x3a')],_0x2acd8c[_0x2f64('0x32')]);})[_0x2f64('0x2f')]();_0x4d3cac=qs[_0x2f64('0x3b')](_0x5130ff,_0x390722);var _0x41407a={'where':_0x4d3cac['where']};return db[_0x2f64('0x35')][_0x2f64('0x21')](_0x41407a)['then'](function(_0x56dda2){_0x53db96['count']=_0x56dda2;if(_0x390722[_0x2f64('0x3c')][_0x2f64('0x3d')]){_0x4d3cac[_0x2f64('0x3e')]=[{'all':!![]}];}if(_0x390722[_0x2f64('0x3c')][_0x2f64('0x3f')]==='true'){_0x4d3cac[_0x2f64('0x3e')]=[{'model':db[_0x2f64('0x40')],'as':_0x2f64('0x3f')}];}if(!_['includes'](_0x4d3cac[_0x2f64('0x41')],'id')){_0x4d3cac[_0x2f64('0x41')][_0x2f64('0x42')]('id');}return db[_0x2f64('0x35')]['findAll'](_0x4d3cac);})[_0x2f64('0x12')](function(_0x5460f3){_0x53db96[_0x2f64('0x43')]=_0x5460f3;if(_0x390722['query'][_0x2f64('0x44')]==='true'){var _0x386dca=[];for(var _0x16e7bd=0x0;_0x16e7bd<_0x53db96['rows'][_0x2f64('0x45')];_0x16e7bd++){_0x386dca[_0x2f64('0x42')](get_open_tabs(_0x2f64('0x46'),_0x53db96[_0x2f64('0x43')][_0x16e7bd]['dataValues']));_0x386dca[_0x2f64('0x42')](get_open_tabs(_0x2f64('0x47'),_0x53db96['rows'][_0x16e7bd]['dataValues']));_0x386dca[_0x2f64('0x42')](get_open_tabs(_0x2f64('0x48'),_0x53db96[_0x2f64('0x43')][_0x16e7bd][_0x2f64('0x49')]));_0x386dca[_0x2f64('0x42')](get_open_tabs(_0x2f64('0x4a'),_0x53db96[_0x2f64('0x43')][_0x16e7bd][_0x2f64('0x49')]));_0x386dca[_0x2f64('0x42')](get_open_tabs('openchannel',_0x53db96[_0x2f64('0x43')][_0x16e7bd]['dataValues']));_0x386dca[_0x2f64('0x42')](get_open_tabs(_0x2f64('0x4b'),_0x53db96[_0x2f64('0x43')][_0x16e7bd]['dataValues']));}return BPromise[_0x2f64('0x4c')](_0x386dca)[_0x2f64('0x12')](function(){return _0x53db96;});}else{return _0x53db96;}})[_0x2f64('0x12')](respondWithFilteredResult(_0x298c34,_0x4d3cac))['catch'](handleError(_0x298c34,null));};exports[_0x2f64('0x4d')]=function(_0x21d12e,_0x52545b){var _0x1152fa={'raw':![],'where':{'id':_0x21d12e[_0x2f64('0x4e')]['id']}},_0x219695={};_0x219695[_0x2f64('0x4f')]=_['differenceBy'](_[_0x2f64('0x50')](db['User']['rawAttributes']),[_0x2f64('0x39'),_0x2f64('0x3a')]);_0x219695[_0x2f64('0x3c')]=_['keys'](_0x21d12e[_0x2f64('0x3c')]);_0x219695[_0x2f64('0x51')]=_[_0x2f64('0x52')](_0x219695['model'],_0x219695[_0x2f64('0x3c')]);_0x1152fa[_0x2f64('0x41')]=_[_0x2f64('0x52')](_0x219695[_0x2f64('0x4f')],qs[_0x2f64('0x53')](_0x21d12e[_0x2f64('0x3c')][_0x2f64('0x53')]));_0x1152fa[_0x2f64('0x41')]=_0x1152fa[_0x2f64('0x41')]['length']?_0x1152fa['attributes']:_0x219695[_0x2f64('0x4f')];if(_0x21d12e[_0x2f64('0x3c')][_0x2f64('0x3d')]){_0x1152fa[_0x2f64('0x3e')]=[{'all':!![]}];}if(_0x21d12e[_0x2f64('0x3c')][_0x2f64('0x3f')]===_0x2f64('0x54')){_0x1152fa[_0x2f64('0x3e')]=[{'model':db[_0x2f64('0x40')],'as':_0x2f64('0x3f')}];}_0x1152fa=_[_0x2f64('0x55')]({},_0x1152fa,_0x21d12e['options']);if(!_[_0x2f64('0x30')](_0x1152fa[_0x2f64('0x41')],'id')){_0x1152fa['attributes']['push']('id');}return db[_0x2f64('0x35')][_0x2f64('0x31')](_0x1152fa)[_0x2f64('0x12')](handleEntityNotFound(_0x52545b,null))[_0x2f64('0x12')](function(_0x9fee32){var _0x21f109=[];values=_0x9fee32;if(_0x21d12e[_0x2f64('0x3c')][_0x2f64('0x44')]==='true'){_0x21f109[_0x2f64('0x42')](get_open_tabs('chat',_0x9fee32['dataValues']));_0x21f109[_0x2f64('0x42')](get_open_tabs(_0x2f64('0x47'),_0x9fee32[_0x2f64('0x49')]));_0x21f109[_0x2f64('0x42')](get_open_tabs(_0x2f64('0x56'),_0x9fee32[_0x2f64('0x49')]));_0x21f109[_0x2f64('0x42')](get_open_tabs(_0x2f64('0x4b'),_0x9fee32[_0x2f64('0x49')]));_0x21f109['push'](get_open_tabs(_0x2f64('0x48'),_0x9fee32['dataValues']));_0x21f109[_0x2f64('0x42')](get_open_tabs(_0x2f64('0x4a'),_0x9fee32[_0x2f64('0x49')]));return BPromise[_0x2f64('0x4c')](_0x21f109);}else{return values;}})[_0x2f64('0x12')](function(){return values;})[_0x2f64('0x12')](respondWithResult(_0x52545b,null))[_0x2f64('0x57')](handleError(_0x52545b,null));};exports['update']=function(_0x525f09,_0x52b5c2){if(_0x525f09[_0x2f64('0x58')]['id']){delete _0x525f09[_0x2f64('0x58')]['id'];}delete _0x525f09[_0x2f64('0x58')][_0x2f64('0x25')];return db[_0x2f64('0x35')][_0x2f64('0x31')]({'where':{'id':_0x525f09[_0x2f64('0x4e')]['id']}})[_0x2f64('0x12')](handleEntityNotFound(_0x52b5c2,null))[_0x2f64('0x12')](saveUpdates(_0x525f09[_0x2f64('0x58')],null))[_0x2f64('0x12')](respondWithResult(_0x52b5c2,null))[_0x2f64('0x57')](handleError(_0x52b5c2,null));};exports[_0x2f64('0x59')]=function(_0x41d250,_0x21c7f2){return db[_0x2f64('0x35')]['describe']()[_0x2f64('0x12')](respondWithResult(_0x21c7f2,null))[_0x2f64('0x57')](handleError(_0x21c7f2,null));};exports[_0x2f64('0x5a')]=function(_0x56c6ce,_0x4c032c){return db[_0x2f64('0x35')]['find']({'where':{'id':_0x56c6ce['params']['id']}})[_0x2f64('0x12')](handleEntityNotFound(_0x4c032c,null))['then'](function(_0x493874){if(_0x493874){return _0x493874['addContacts'](_0x56c6ce[_0x2f64('0x58')][_0x2f64('0x5b')],_[_0x2f64('0x5c')](_0x56c6ce[_0x2f64('0x58')],[_0x2f64('0x5b'),'id'])||{});}})[_0x2f64('0x12')](respondWithResult(_0x4c032c,null))['catch'](handleError(_0x4c032c,null));};function validateUser(_0x311fc5){return new BPromise(function(_0x369cfe,_0x2a52a1){if(_0x311fc5['internal'])return _0x369cfe(_0x311fc5);return db['Setting']['findById'](0x1)[_0x2f64('0x12')](function(_0xdbb1f9){if(_0xdbb1f9[_0x2f64('0x5d')])authService[_0x2f64('0x5e')](_0x311fc5[_0x2f64('0x39')]);db[_0x2f64('0x35')][_0x2f64('0x5f')](_0x2f64('0x60'))['then'](function(_0x19b67e){if(_[_0x2f64('0x61')](_0x19b67e)){_0x311fc5[_0x2f64('0x60')]=_0xdbb1f9[_0x2f64('0x62')]||0x1;return;}if(_[_0x2f64('0x61')](_0xdbb1f9[_0x2f64('0x62')])||_0xdbb1f9[_0x2f64('0x62')]===_0x19b67e){_0x311fc5[_0x2f64('0x60')]=_0x19b67e+0x1;return;}if(_0xdbb1f9[_0x2f64('0x62')]>_0x19b67e){_0x311fc5['internal']=_0xdbb1f9[_0x2f64('0x62')];return;}return db[_0x2f64('0x63')]['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x2f64('0x63')][_0x2f64('0x64')][_0x2f64('0x65')]})['then'](function(_0x4ba454){if(_0x4ba454&&_0x4ba454[_0x2f64('0x45')]){for(var _0x11a963=0x0,_0x4796e3=_0x4ba454[_0x2f64('0x45')];_0x11a963<_0x4796e3&&_['isNil'](_0x311fc5['internal']);_0x11a963++){if(_0xdbb1f9['min_internal']<=_0x4ba454[_0x11a963]['from']){_0x311fc5[_0x2f64('0x60')]=_0x4ba454[_0x11a963][_0x2f64('0x66')];}else if(_0xdbb1f9[_0x2f64('0x62')]>_0x4ba454[_0x11a963][_0x2f64('0x66')]&&_0xdbb1f9['min_internal']<=_0x4ba454[_0x11a963]['to']){_0x311fc5[_0x2f64('0x60')]=_0xdbb1f9[_0x2f64('0x62')];}}}if(_[_0x2f64('0x61')](_0x311fc5[_0x2f64('0x60')])){_0x311fc5[_0x2f64('0x60')]=_0x19b67e+0x1;}return _0x369cfe(_0x311fc5);});});})[_0x2f64('0x57')](function(_0xa313e2){_0x2a52a1(_0xa313e2);});});}function updateUser(_0x12e0f4){return new BPromise(function(_0x212c7f,_0x5f9916){try{if(_0x12e0f4[_0x2f64('0x67')]){_0x12e0f4[_0x2f64('0x68')]=_0x12e0f4['internal'];_0x12e0f4[_0x2f64('0x69')]={'mailbox':_0x12e0f4[_0x2f64('0x60')],'password':_0x12e0f4[_0x2f64('0x39')],'fullname':_0x12e0f4[_0x2f64('0x6a')],'email':_0x12e0f4[_0x2f64('0x6b')]};}if(_0x12e0f4[_0x2f64('0x25')]===_0x2f64('0x2a')){if(!_0x12e0f4[_0x2f64('0x6c')])_0x12e0f4[_0x2f64('0x6c')]=[_0x2f64('0x6d'),_0x2f64('0x6e'),_0x2f64('0x6f'),'113',_0x2f64('0x70'),_0x2f64('0x71'),_0x2f64('0x72'),_0x2f64('0x73'),'107',_0x2f64('0x74'),_0x2f64('0x75'),'100',_0x2f64('0x76'),_0x2f64('0x77'),_0x2f64('0x78')];}_0x212c7f(_0x12e0f4);}catch(_0x1eed1d){_0x5f9916(_0x1eed1d);}});}exports[_0x2f64('0x79')]=function(_0x57ae63,_0xd91900){if(_0x57ae63[_0x2f64('0x28')][_0x2f64('0x25')]===_0x2f64('0x2a'))throw new Error(_0x2f64('0x7a'));if(_0x57ae63['body'][_0x2f64('0x25')]===_0x2f64('0x28')&&_0x57ae63[_0x2f64('0x28')][_0x2f64('0x25')]!==_0x2f64('0x26')){throw new Error(_0x2f64('0x7b'));}if(_0x57ae63['body']['role']===_0x2f64('0x26')&&_0x57ae63[_0x2f64('0x28')][_0x2f64('0x25')]!==_0x2f64('0x26')){throw new Error(_0x2f64('0x7c'));}return licenseUtil[_0x2f64('0x7d')]([_0x57ae63[_0x2f64('0x58')]])['then'](function(){return validateUser(_0x57ae63[_0x2f64('0x58')]);})['then'](function(_0x48b312){return updateUser(_0x48b312)[_0x2f64('0x12')](function(_0x4d7165){if(_0x4d7165[_0x2f64('0x25')]===_0x2f64('0x26')){_0x4d7165[_0x2f64('0x7e')]=_0x57ae63['user'][_0x2f64('0x7e')];delete _0x4d7165['userProfileId'];}return _0x4d7165;});})['then'](function(_0xc5eaf6){return db[_0x2f64('0x35')]['create'](_0xc5eaf6,{'include':[{'model':db[_0x2f64('0x69')],'as':_0x2f64('0x69')}]});})['then'](function(_0xebd7de){if(_0x57ae63[_0x2f64('0x58')][_0x2f64('0x25')]===_0x2f64('0x28'))return _0xebd7de;if(_0x57ae63[_0x2f64('0x28')]['role']!==_0x2f64('0x28'))return _0xebd7de;return db['UserProfileSection']['find']({'where':{'name':_0xebd7de[_0x2f64('0x25')]===_0x2f64('0x2a')?_0x2f64('0x29'):_0x2f64('0x7f'),'userProfileId':_0x57ae63['user'][_0x2f64('0x80')]},'raw':!![]})[_0x2f64('0x12')](function(_0xc3cc72){if(!_0xc3cc72||_0xc3cc72['autoAssociation']!=0x0)return _0xebd7de;return db[_0x2f64('0x81')][_0x2f64('0x79')]({'name':_0xebd7de[_0x2f64('0x32')],'resourceId':_0xebd7de['id'],'type':_0xc3cc72[_0x2f64('0x32')],'sectionId':_0xc3cc72['id']},{})[_0x2f64('0x12')](function(){return _0xebd7de;});})[_0x2f64('0x57')](function(_0xafdc7a){logger[_0x2f64('0x18')](_0x2f64('0x82'),_0xafdc7a);throw _0xafdc7a;});})['then'](respondWithResult(_0xd91900,0xc9))[_0x2f64('0x57')](handleError(_0xd91900,null));};exports[_0x2f64('0x83')]=function(_0x21ef8a,_0x2e7851){var _0x34a9b9=_0x21ef8a[_0x2f64('0x58')];var _0x2dbc74=[];if(_0x21ef8a[_0x2f64('0x28')][_0x2f64('0x25')]==='agent')throw new Error(_0x2f64('0x7a'));if(_[_0x2f64('0x84')](_0x34a9b9,['role',_0x2f64('0x28')])&&_0x21ef8a['user'][_0x2f64('0x25')]!==_0x2f64('0x26')){throw new Error(_0x2f64('0x7b'));}if(_[_0x2f64('0x84')](_0x34a9b9,[_0x2f64('0x25'),'admin'])&&_0x21ef8a[_0x2f64('0x28')][_0x2f64('0x25')]!=='admin'){throw new Error(_0x2f64('0x85'));}return licenseUtil[_0x2f64('0x7d')](_0x34a9b9)[_0x2f64('0x12')](function(){return validateUser(_0x34a9b9[0x0]);})[_0x2f64('0x12')](function(){for(var _0x499c4b=0x1;_0x499c4b<_0x34a9b9[_0x2f64('0x45')];_0x499c4b++){var _0x53202c=_0x34a9b9[_0x499c4b-0x1][_0x2f64('0x60')];if(!_0x34a9b9[_0x499c4b]['internal'])_0x34a9b9[_0x499c4b]['internal']=_0x53202c+0x1;_0x2dbc74['push'](validateUser(_0x34a9b9[_0x499c4b]));}return BPromise['all'](_0x2dbc74);})[_0x2f64('0x12')](function(){_0x2dbc74=[];for(var _0x5db200=0x0;_0x5db200<_0x34a9b9[_0x2f64('0x45')];_0x5db200++){_0x2dbc74[_0x2f64('0x42')](updateUser(_0x34a9b9[_0x5db200]));}return BPromise['all'](_0x2dbc74);})['then'](function(){return BPromise[_0x2f64('0x86')](_0x34a9b9,function(_0x4f35cd){return db['User']['create'](_0x4f35cd,{'include':[{'model':db['VoiceMail'],'as':_0x2f64('0x69')}]})[_0x2f64('0x12')](function(_0x280537){_0x4f35cd['id']=_0x280537['id'];return _0x4f35cd;});});})[_0x2f64('0x12')](function(_0x2870fb){if(_0x21ef8a[_0x2f64('0x58')][_0x2f64('0x25')]===_0x2f64('0x28'))return _0x2870fb;if(_0x21ef8a[_0x2f64('0x28')][_0x2f64('0x25')]!=='user')return _0x2870fb;var _0x22208c=_[_0x2f64('0x84')](_0x2870fb,function(_0x3f3bd9){return _0x3f3bd9['role']===_0x2f64('0x2a')||_0x3f3bd9[_0x2f64('0x25')]===_0x2f64('0x2b');});if(!_0x22208c)return _0x2870fb;return db[_0x2f64('0x87')][_0x2f64('0x88')]({'where':{'name':{'$or':['Agents',_0x2f64('0x7f')]},'userProfileId':_0x21ef8a['user']['userProfileId']},'raw':!![]})[_0x2f64('0x12')](function(_0x326dfc){if(_['isEmpty'](_0x326dfc)||!_['some'](_0x326dfc,[_0x2f64('0x89'),0x0]))return _0x2870fb;_0x2dbc74=[];var _0x17bbc7=_(_0x326dfc)[_0x2f64('0x2e')](function(_0xa63051){if(_0xa63051[_0x2f64('0x89')]===0x1)return;return _0xa63051[_0x2f64('0x32')]===_0x2f64('0x29')?_0x2f64('0x2a'):'telephone';})[_0x2f64('0x8a')]()['value']();for(var _0x89909e=0x0;_0x89909e<_0x2870fb[_0x2f64('0x45')];_0x89909e++){if(!_[_0x2f64('0x30')](_0x17bbc7,_0x2870fb[_0x89909e][_0x2f64('0x25')]))return;var _0x3e4da5=_0x2870fb[_0x89909e]['role']===_0x2f64('0x2a')?'Agents':_0x2f64('0x7f');_0x2dbc74[_0x2f64('0x42')](db['UserProfileResource'][_0x2f64('0x79')]({'name':_0x2870fb[_0x89909e][_0x2f64('0x32')],'resourceId':_0x2870fb[_0x89909e]['id'],'type':_0x3e4da5,'sectionId':_[_0x2f64('0x31')](_0x326dfc,[_0x2f64('0x32'),_0x3e4da5])['id']},{}));}return BPromise[_0x2f64('0x4c')](_0x2dbc74);});})['then'](respondWithResult(_0x2e7851,0xc9))[_0x2f64('0x57')](handleError(_0x2e7851,null));};exports[_0x2f64('0x8b')]=function(_0x4fcc29,_0x2e8d8d){if(_0x4fcc29[_0x2f64('0x58')]['id']){delete _0x4fcc29['body']['id'];}return db[_0x2f64('0x35')][_0x2f64('0x31')]({'where':{'id':_0x4fcc29[_0x2f64('0x4e')]['id']}})['then'](function(_0x13e7bb){if(!_0x13e7bb)return null;if(_0x13e7bb['id']===_0x4fcc29['user']['id']){if(!_0x4fcc29[_0x2f64('0x58')]['oldPassword']||!_0x4fcc29[_0x2f64('0x58')][_0x2f64('0x8c')]){throw new db[(_0x2f64('0x8d'))][(_0x2f64('0x8e'))](_0x2f64('0x8f'));}if(!_0x13e7bb['authenticate'](_0x4fcc29[_0x2f64('0x58')][_0x2f64('0x90')])){throw new db[(_0x2f64('0x8d'))][(_0x2f64('0x8e'))](_0x2f64('0x91'));}if(_0x4fcc29['body'][_0x2f64('0x90')]===_0x4fcc29[_0x2f64('0x58')][_0x2f64('0x8c')]){throw new db['Sequelize'][(_0x2f64('0x8e'))](_0x2f64('0x92'));}}else if(_0x4fcc29[_0x2f64('0x28')][_0x2f64('0x25')]===_0x2f64('0x26')){if(!_0x4fcc29['body']['newPassword']){throw new db[(_0x2f64('0x8d'))]['ValidationError'](_0x2f64('0x93'));}}else if(_0x4fcc29[_0x2f64('0x28')][_0x2f64('0x25')]===_0x2f64('0x28')){if(!_0x4fcc29[_0x2f64('0x58')][_0x2f64('0x8c')]){throw new db[(_0x2f64('0x8d'))][(_0x2f64('0x8e'))](_0x2f64('0x93'));}if(_0x13e7bb['role']!==_0x2f64('0x2a')){throw new db['Sequelize'][(_0x2f64('0x8e'))]('Unauthorized');}}else{throw new db[(_0x2f64('0x8d'))]['ValidationError'](_0x2f64('0x7a'));}return _0x13e7bb;})[_0x2f64('0x12')](handleEntityNotFound(_0x2e8d8d,null))[_0x2f64('0x12')](function(_0x879a20){return db['Setting']['findOne']({'attributes':['id','securePassword',_0x2f64('0x94'),_0x2f64('0x95')]})['then'](function(_0x366599){if(_0x366599[_0x2f64('0x5d')])authService[_0x2f64('0x5e')](_0x4fcc29[_0x2f64('0x58')][_0x2f64('0x8c')]);if(!_0x366599[_0x2f64('0x94')]||!_0x879a20['previousPasswords'])return _0x879a20;authService[_0x2f64('0x96')](_0x4fcc29[_0x2f64('0x58')]['newPassword'],_0x879a20[_0x2f64('0x97')],_0x366599['passwordHistoryLimit']);return _0x879a20;})[_0x2f64('0x12')](saveUpdates({'password':_0x4fcc29[_0x2f64('0x58')][_0x2f64('0x8c')],'passwordResetAt':_0x4fcc29[_0x2f64('0x28')]['id']==_0x4fcc29[_0x2f64('0x4e')]['id']?moment():null,'previousPasswords':authService[_0x2f64('0x98')](_0x4fcc29[_0x2f64('0x58')][_0x2f64('0x8c')],_0x879a20[_0x2f64('0x97')])},null));})[_0x2f64('0x12')](respondWithResult(_0x2e8d8d,null))['catch'](handleError(_0x2e8d8d,null));};exports['addQueues']=function(_0x521f18,_0x23dbd9){var _0x420ba5=_0x521f18[_0x2f64('0x58')]['channel'];return db['User'][_0x2f64('0x31')]({'where':{'id':_0x521f18[_0x2f64('0x4e')]['id']},'attributes':['id',_0x2f64('0x32'),_0x2f64('0x25'),_0x2f64('0x99'),_0x2f64('0x9a'),_0x2f64('0x9b'),_0x2f64('0x9c')]})['then'](handleEntityNotFound(_0x23dbd9,null))['then'](function(_0x3df045){if(_0x3df045){if(!utils['isValidChannel'](_0x420ba5)){throw new db[(_0x2f64('0x8d'))][(_0x2f64('0x8e'))](_0x2f64('0x9d'));}return _0x3df045[_0x2f64('0x9e')+_[_0x2f64('0x9f')](_0x420ba5[_0x2f64('0xa0')]())+_0x2f64('0xa1')](_0x521f18[_0x2f64('0x58')]['ids'],{'penalty':_0x521f18[_0x2f64('0x58')][_0x2f64('0xa2')]||0x0})[_0x2f64('0xa3')](function(_0x416740){for(var _0x4c8f61=0x0;_0x4c8f61<_0x521f18[_0x2f64('0x58')][_0x2f64('0x5b')]['length'];_0x4c8f61+=0x1){var _0x1dcfd8={'UserId':Number(_0x521f18[_0x2f64('0x4e')]['id'])};_0x1dcfd8[_[_0x2f64('0x9f')](_0x420ba5[_0x2f64('0xa0')]())+_0x2f64('0xa4')]=Number(_0x521f18[_0x2f64('0x58')][_0x2f64('0x5b')][_0x4c8f61]);socket[_0x2f64('0xa5')](_0x2f64('0x28')+_[_0x2f64('0x9f')](_0x420ba5[_0x2f64('0xa0')]())+_0x2f64('0xa6'),_0x1dcfd8);}return _0x416740;})[_0x2f64('0x12')](function(){if(_0x420ba5===_0x2f64('0xa7')){return db[_0x2f64('0xa8')][_0x2f64('0x88')]({'where':{'id':_0x521f18[_0x2f64('0x58')]['ids']||[]},'raw':!![],'attributes':['id',_0x2f64('0x32')]});}})[_0x2f64('0x12')](function(_0x30dd36){var _0x189821=_0x3df045[_0x2f64('0x24')]({'plain':!![]});var _0x27b543=[];if(_0x420ba5===_0x2f64('0xa7')&&_0x189821['role']===_0x2f64('0x2a')&&_0x189821['online']){for(var _0x3b8779=0x0;_0x3b8779<_0x30dd36[_0x2f64('0x45')];_0x3b8779+=0x1){_0x27b543[_0x2f64('0x42')]({'membername':_0x189821[_0x2f64('0x32')],'UserId':_0x189821['id'],'queue_name':_0x30dd36[_0x3b8779][_0x2f64('0x32')],'VoiceQueueId':_0x30dd36[_0x3b8779]['id'],'interface':_['isNil'](_0x189821[_0x2f64('0x9c')])?util['format'](_0x2f64('0xa9'),_0x189821['name']):_0x189821[_0x2f64('0x9c')],'paused':_0x189821[_0x2f64('0x9b')]||![],'penalty':_0x521f18[_0x2f64('0x58')][_0x2f64('0xa2')]||0x0});}return BPromise[_0x2f64('0x86')](_0x27b543,function(_0x57a1ce){return db['UserVoiceQueueRt']['upsert'](_0x57a1ce);});}return _0x3df045;});}})[_0x2f64('0x12')](respondWithStatusCode(_0x23dbd9,null))[_0x2f64('0x57')](handleError(_0x23dbd9,null));};exports['removeQueues']=function(_0x303aca,_0x363213){var _0x49aae0,_0x2b318e;return db[_0x2f64('0x35')][_0x2f64('0x31')]({'where':{'id':_0x303aca['params']['id']},'attributes':['id',_0x2f64('0x32'),_0x2f64('0x25')]})[_0x2f64('0x12')](handleEntityNotFound(_0x363213,null))[_0x2f64('0x12')](function(_0x33899f){if(_0x33899f){_0x49aae0=_0x33899f;if(!_0x303aca['query'][_0x2f64('0xaa')]||!utils['isValidChannel'](_0x303aca[_0x2f64('0x3c')][_0x2f64('0xaa')])){throw new db[(_0x2f64('0x8d'))][(_0x2f64('0x8e'))](_0x2f64('0x9d'));}return _0x33899f[_0x2f64('0xab')+_[_0x2f64('0x9f')](_0x303aca[_0x2f64('0x3c')][_0x2f64('0xaa')][_0x2f64('0xa0')]())+_0x2f64('0xa1')](_0x303aca['query'][_0x2f64('0x5b')]);}})[_0x2f64('0x12')](function(_0xfcb294){if(_[_0x2f64('0xac')](_0x303aca[_0x2f64('0x3c')]['ids'])){for(var _0x18922d=0x0;_0x18922d<_0x303aca[_0x2f64('0x3c')][_0x2f64('0x5b')]['length'];_0x18922d+=0x1){_0x2b318e={'UserId':Number(_0x303aca[_0x2f64('0x4e')]['id'])};_0x2b318e[_['capitalize'](_0x303aca[_0x2f64('0x3c')][_0x2f64('0xaa')]['toLowerCase']())+_0x2f64('0xa4')]=Number(_0x303aca[_0x2f64('0x3c')]['ids'][_0x18922d]);socket['emit'](_0x2f64('0x28')+_[_0x2f64('0x9f')](_0x303aca['query'][_0x2f64('0xaa')][_0x2f64('0xa0')]())+_0x2f64('0xad'),_0x2b318e);}}else{_0x2b318e={'UserId':Number(_0x303aca[_0x2f64('0x4e')]['id'])};_0x2b318e[_[_0x2f64('0x9f')](_0x303aca['query'][_0x2f64('0xaa')]['toLowerCase']())+'QueueId']=Number(_0x303aca[_0x2f64('0x3c')][_0x2f64('0x5b')]);socket[_0x2f64('0xa5')](_0x2f64('0x28')+_['capitalize'](_0x303aca['query']['channel']['toLowerCase']())+'Queue:remove',_0x2b318e);}return _0xfcb294;})['then'](function(){if(_0x303aca['query'][_0x2f64('0xaa')]===_0x2f64('0xa7')){return db[_0x2f64('0xae')][_0x2f64('0x33')]({'where':{'UserId':_0x303aca[_0x2f64('0x4e')]['id'],'VoiceQueueId':_0x303aca['query']['ids']},'individualHooks':!![]})[_0x2f64('0x12')](function(){return _0x49aae0;});}return _0x49aae0;})['then'](respondWithStatusCode(_0x363213,null))['catch'](handleError(_0x363213,null));};exports['addAvatar']=function(_0x40ff00,_0x3283c9){_0x40ff00['body'][_0x2f64('0xaf')]=_0x40ff00[_0x2f64('0xb0')][_0x2f64('0xb1')];return db[_0x2f64('0x35')]['find']({'where':{'id':_0x40ff00['params']['id']}})['then'](handleEntityNotFound(_0x3283c9,null))[_0x2f64('0x12')](saveUpdates(_0x40ff00[_0x2f64('0x58')],null))['then'](respondWithResult(_0x3283c9,null))['catch'](handleError(_0x3283c9,null));};exports[_0x2f64('0xb2')]=function(_0x52e0d6,_0x57fa3b){var _0x2207b1=path[_0x2f64('0xb3')](config[_0x2f64('0xb4')],'server/files/images/logos/default_profile.png');return db['User']['find']({'where':{'id':_0x52e0d6[_0x2f64('0x4e')]['id']},'attributes':['id',_0x2f64('0xaf')],'raw':!![]})[_0x2f64('0x12')](handleEntityNotFound(_0x57fa3b,null))[_0x2f64('0x12')](function(_0x58ce7d){if(_0x58ce7d){if(_[_0x2f64('0x61')](_0x58ce7d[_0x2f64('0xaf')])){return _0x57fa3b[_0x2f64('0xb5')](_0x2207b1);}else{if(!fs[_0x2f64('0xb6')](path[_0x2f64('0xb3')](config['root'],'server/files/images/',_0x58ce7d[_0x2f64('0xaf')]))){return _0x57fa3b[_0x2f64('0xb5')](_0x2207b1);}return _0x57fa3b[_0x2f64('0xb5')](path[_0x2f64('0xb3')](config[_0x2f64('0xb4')],_0x2f64('0xb7'),_0x58ce7d[_0x2f64('0xaf')]));}}})[_0x2f64('0x57')](handleError(_0x57fa3b,null));};exports['getOpenTabs']=function(_0x3eee52,_0x21bd0a){return db['User'][_0x2f64('0x31')]({'where':{'id':_0x3eee52[_0x2f64('0x4e')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x21bd0a,null))[_0x2f64('0x12')](function(_0x46b65f){var _0x1a9a51=[];values=_0x46b65f[_0x2f64('0x49')];_0x1a9a51[_0x2f64('0x42')](get_open_tabs(_0x2f64('0x46'),_0x46b65f[_0x2f64('0x49')]));_0x1a9a51[_0x2f64('0x42')](get_open_tabs(_0x2f64('0x47'),_0x46b65f[_0x2f64('0x49')]));_0x1a9a51['push'](get_open_tabs(_0x2f64('0x56'),_0x46b65f['dataValues']));_0x1a9a51[_0x2f64('0x42')](get_open_tabs(_0x2f64('0x4b'),_0x46b65f[_0x2f64('0x49')]));_0x1a9a51[_0x2f64('0x42')](get_open_tabs(_0x2f64('0x48'),_0x46b65f['dataValues']));_0x1a9a51[_0x2f64('0x42')](get_open_tabs(_0x2f64('0x4a'),_0x46b65f['dataValues']));return BPromise[_0x2f64('0x4c')](_0x1a9a51);})[_0x2f64('0x12')](function(_0x35b2b2){if(_0x35b2b2){var _0x133f07=_[_0x2f64('0x2e')](values[_0x2f64('0xb8')],function(_0xeb1961){return{'channel':_0x2f64('0xb9'),'id':_0xeb1961['id'],'createdAt':_0xeb1961[_0x2f64('0xba')]};});var _0x54cd26=_[_0x2f64('0x2e')](values[_0x2f64('0xbb')],function(_0x244635){return{'channel':_0x2f64('0xbc'),'id':_0x244635['id'],'createdAt':_0x244635['createdAt']};});var _0x389a83=_[_0x2f64('0x2e')](values[_0x2f64('0xbd')],function(_0x3ab6ff){return{'channel':_0x2f64('0xbe'),'id':_0x3ab6ff['id'],'createdAt':_0x3ab6ff[_0x2f64('0xba')]};});var _0x57f2f9=_[_0x2f64('0x2e')](values[_0x2f64('0xbf')],function(_0x27772a){return{'channel':_0x2f64('0xc0'),'id':_0x27772a['id'],'createdAt':_0x27772a[_0x2f64('0xba')]};});var _0x2b6fb2=_[_0x2f64('0x2e')](values[_0x2f64('0xc1')],function(_0x5b5703){return{'channel':_0x2f64('0xc2'),'id':_0x5b5703['id'],'createdAt':_0x5b5703[_0x2f64('0xba')]};});var _0x49939b=_[_0x2f64('0x2e')](values[_0x2f64('0xc3')],function(_0x3f8cf9){return{'channel':_0x2f64('0xc4'),'id':_0x3f8cf9['id'],'createdAt':_0x3f8cf9[_0x2f64('0xba')]};});var _0x3ab2b6=_[_0x2f64('0xc5')](_0x133f07,_0x54cd26,_0x389a83,_0x57f2f9,_0x2b6fb2,_0x49939b);var _0x151ad3={'count':_0x3ab2b6[_0x2f64('0x45')],'rows':_0x3ab2b6};return _0x151ad3;}else return null;})[_0x2f64('0x12')](respondWithResult(_0x21bd0a,null))[_0x2f64('0x57')](handleError(_0x21bd0a,null));};exports[_0x2f64('0xc6')]=function(_0x50c423,_0x4e4f8b){var _0x53ca8d={};var _0x245119={};var _0x1f03c4;var _0x38b9ee;return db[_0x2f64('0x35')][_0x2f64('0xc7')]({'where':{'id':_0x50c423[_0x2f64('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4e4f8b,null))[_0x2f64('0x12')](function(_0x5ee50b){if(_0x5ee50b){_0x1f03c4=_0x5ee50b;_0x245119['model']=_[_0x2f64('0x50')](db[_0x2f64('0xc8')]['rawAttributes']);_0x245119[_0x2f64('0x3c')]=_[_0x2f64('0x50')](_0x50c423[_0x2f64('0x3c')]);_0x245119[_0x2f64('0x51')]=_[_0x2f64('0x52')](_0x245119['model'],_0x245119[_0x2f64('0x3c')]);_0x53ca8d[_0x2f64('0x41')]=_['intersection'](_0x245119[_0x2f64('0x4f')],qs['fields'](_0x50c423['query']['fields']));_0x53ca8d[_0x2f64('0x41')]=_0x53ca8d[_0x2f64('0x41')][_0x2f64('0x45')]?_0x53ca8d[_0x2f64('0x41')]:_0x245119['model'];_0x53ca8d[_0x2f64('0xc9')]=qs[_0x2f64('0xca')](_0x50c423[_0x2f64('0x3c')][_0x2f64('0xca')]);_0x53ca8d[_0x2f64('0xcb')]=qs[_0x2f64('0x51')](_[_0x2f64('0xcc')](_0x50c423['query'],_0x245119['filters']));if(_0x50c423[_0x2f64('0x3c')][_0x2f64('0x2c')]){_0x53ca8d[_0x2f64('0xcb')]=_[_0x2f64('0x55')](_0x53ca8d['where'],{'$or':_[_0x2f64('0x2e')](_0x53ca8d['attributes'],function(_0xb68bbe){var _0x969900={};_0x969900[_0xb68bbe]={'$like':'%'+_0x50c423['query']['filter']+'%'};return _0x969900;})});}_0x53ca8d=_[_0x2f64('0x55')]({},_0x53ca8d,_0x50c423[_0x2f64('0xcd')]);return _0x1f03c4[_0x2f64('0xc6')](_0x53ca8d);}})[_0x2f64('0x12')](function(_0x37697f){if(_0x37697f){_0x38b9ee=_0x37697f[_0x2f64('0x45')];if(_0x50c423[_0x2f64('0x3c')][_0x2f64('0xce')]('includeAll')){_0x53ca8d['include']=[{'model':db[_0x2f64('0xcf')],'as':_0x2f64('0xd0'),'required':![]},{'model':db[_0x2f64('0xd1')],'as':'Tags','attributes':['id',_0x2f64('0x32'),_0x2f64('0xd2')],'where':_0x50c423[_0x2f64('0x3c')][_0x2f64('0xd3')]?{'id':_0x50c423['query'][_0x2f64('0xd3')]}:undefined,'required':_0x50c423['query'][_0x2f64('0xd3')]?!![]:![]}];}if(!_0x50c423[_0x2f64('0x3c')][_0x2f64('0xce')](_0x2f64('0xd4'))){_0x53ca8d['limit']=qs[_0x2f64('0x20')](_0x50c423['query']['limit']);_0x53ca8d['offset']=qs[_0x2f64('0x1f')](_0x50c423[_0x2f64('0x3c')][_0x2f64('0x1f')]);}return _0x1f03c4[_0x2f64('0xc6')](_0x53ca8d);}})[_0x2f64('0x12')](function(_0x467a26){if(_0x467a26){return _0x467a26?{'count':_0x38b9ee,'rows':_0x467a26}:null;}})['then'](respondWithResult(_0x4e4f8b,null))[_0x2f64('0x57')](handleError(_0x4e4f8b,null));};exports[_0x2f64('0xd5')]=function(_0x9dd130,_0x3c84fe){var _0x34cecf;var _0x505bd7={};var _0x24f609;return db['User'][_0x2f64('0xc7')]({'where':{'id':_0x9dd130[_0x2f64('0x4e')]['id']},'attributes':['id','name','role']})[_0x2f64('0x12')](handleEntityNotFound(_0x3c84fe,null))[_0x2f64('0x12')](function(_0x35de8f){if(!utils[_0x2f64('0xd6')](_0x9dd130[_0x2f64('0x3c')][_0x2f64('0xaa')])){throw new db[(_0x2f64('0x8d'))]['ValidationError'](_0x2f64('0x9d'));}_0x34cecf=_0x35de8f;var _0x4d944d={};_0x4d944d[_0x2f64('0x4f')]=_[_0x2f64('0x50')](db[_[_0x2f64('0x9f')](_0x9dd130[_0x2f64('0x3c')][_0x2f64('0xaa')])+_0x2f64('0xd7')][_0x2f64('0xd8')]);_0x4d944d['query']=_[_0x2f64('0x50')](_0x9dd130['query']);_0x4d944d['filters']=_[_0x2f64('0x52')](_0x4d944d['model'],_0x4d944d[_0x2f64('0x3c')]);_0x505bd7[_0x2f64('0x41')]=_[_0x2f64('0x52')](_0x4d944d[_0x2f64('0x4f')],qs[_0x2f64('0x53')](_0x9dd130['query'][_0x2f64('0x53')]));_0x505bd7[_0x2f64('0x41')]=_0x505bd7['attributes'][_0x2f64('0x45')]?_0x505bd7[_0x2f64('0x41')]:_0x4d944d[_0x2f64('0x4f')];_0x505bd7[_0x2f64('0xc9')]=qs[_0x2f64('0xca')](_0x9dd130['query']['sort']);_0x505bd7[_0x2f64('0xcb')]=qs[_0x2f64('0x51')](_['pick'](_0x9dd130[_0x2f64('0x3c')],_0x4d944d['filters']));if(_0x9dd130[_0x2f64('0x3c')][_0x2f64('0x2c')]){_0x505bd7[_0x2f64('0xcb')]=_[_0x2f64('0x55')](_0x505bd7[_0x2f64('0xcb')],{'$or':_[_0x2f64('0x2e')](_0x505bd7[_0x2f64('0x41')],function(_0x334910){var _0x25ba5b={};_0x25ba5b[_0x334910]={'$like':'%'+_0x9dd130[_0x2f64('0x3c')][_0x2f64('0x2c')]+'%'};return _0x25ba5b;})});}_0x505bd7=_[_0x2f64('0x55')]({},_0x505bd7,_0x9dd130['options']);switch(_0x34cecf[_0x2f64('0x25')]){case _0x2f64('0x26'):return db[_[_0x2f64('0x9f')](_0x9dd130[_0x2f64('0x3c')][_0x2f64('0xaa')])+_0x2f64('0xd7')][_0x2f64('0x88')](_0x505bd7);case'user':case'agent':return _0x34cecf[_0x2f64('0x24')+_['capitalize'](_0x9dd130[_0x2f64('0x3c')][_0x2f64('0xaa')])+_0x2f64('0xa1')](_0x505bd7);default:throw new db[(_0x2f64('0x8d'))]['ValidationError'](_0x2f64('0xd9'));}})['then'](function(_0x571951){_0x24f609=_0x571951[_0x2f64('0x45')];if(!_0x9dd130[_0x2f64('0x3c')]['hasOwnProperty'](_0x2f64('0xd4'))){_0x505bd7[_0x2f64('0x20')]=qs['limit'](_0x9dd130[_0x2f64('0x3c')][_0x2f64('0x20')]);_0x505bd7['offset']=qs[_0x2f64('0x1f')](_0x9dd130[_0x2f64('0x3c')][_0x2f64('0x1f')]);}switch(_0x34cecf[_0x2f64('0x25')]){case _0x2f64('0x26'):return db[_[_0x2f64('0x9f')](_0x9dd130['query'][_0x2f64('0xaa')])+_0x2f64('0xd7')][_0x2f64('0x88')](_0x505bd7);case _0x2f64('0x28'):case _0x2f64('0x2a'):return _0x34cecf[_0x2f64('0x24')+_[_0x2f64('0x9f')](_0x9dd130[_0x2f64('0x3c')][_0x2f64('0xaa')])+_0x2f64('0xa1')](_0x505bd7);}})['then'](function(_0x185e44){return{'count':_0x24f609,'rows':_0x185e44};})[_0x2f64('0x12')](respondWithResult(_0x3c84fe,null))['catch'](handleError(_0x3c84fe,null));};exports[_0x2f64('0xda')]=function(_0x244e7c,_0x9d866c){var _0x2138a4={};var _0x504c7a={};var _0x5a9ab7;var _0x1aa620;return db[_0x2f64('0x35')][_0x2f64('0xc7')]({'where':{'id':_0x244e7c[_0x2f64('0x4e')]['id']}})['then'](handleEntityNotFound(_0x9d866c,null))['then'](function(_0x43e571){if(_0x43e571){_0x5a9ab7=_0x43e571;_0x504c7a[_0x2f64('0x4f')]=_[_0x2f64('0x50')](db[_0x2f64('0xae')][_0x2f64('0xd8')]);_0x504c7a['query']=_[_0x2f64('0x50')](_0x244e7c[_0x2f64('0x3c')]);_0x504c7a[_0x2f64('0x51')]=_[_0x2f64('0x52')](_0x504c7a['model'],_0x504c7a[_0x2f64('0x3c')]);_0x2138a4[_0x2f64('0x41')]=_['intersection'](_0x504c7a[_0x2f64('0x4f')],qs[_0x2f64('0x53')](_0x244e7c[_0x2f64('0x3c')][_0x2f64('0x53')]));_0x2138a4['attributes']=_0x2138a4[_0x2f64('0x41')][_0x2f64('0x45')]?_0x2138a4[_0x2f64('0x41')]:_0x504c7a[_0x2f64('0x4f')];_0x2138a4[_0x2f64('0xc9')]=qs[_0x2f64('0xca')](_0x244e7c[_0x2f64('0x3c')]['sort']);_0x2138a4[_0x2f64('0xcb')]=qs[_0x2f64('0x51')](_[_0x2f64('0xcc')](_0x244e7c[_0x2f64('0x3c')],_0x504c7a[_0x2f64('0x51')]));if(_0x244e7c[_0x2f64('0x3c')][_0x2f64('0x2c')]){_0x2138a4[_0x2f64('0xcb')]=_[_0x2f64('0x55')](_0x2138a4[_0x2f64('0xcb')],{'$or':_[_0x2f64('0x2e')](_0x2138a4['attributes'],function(_0x5bf037){var _0x2652ef={};_0x2652ef[_0x5bf037]={'$like':'%'+_0x244e7c[_0x2f64('0x3c')][_0x2f64('0x2c')]+'%'};return _0x2652ef;})});}_0x2138a4=_[_0x2f64('0x55')]({},_0x2138a4,_0x244e7c[_0x2f64('0xcd')]);return _0x5a9ab7['getVoiceQueuesRt'](_0x2138a4);}})[_0x2f64('0x12')](function(_0x5d2bc7){if(_0x5d2bc7){_0x1aa620=_0x5d2bc7[_0x2f64('0x45')];if(!_0x244e7c[_0x2f64('0x3c')][_0x2f64('0xce')](_0x2f64('0xd4'))){_0x2138a4[_0x2f64('0x20')]=qs[_0x2f64('0x20')](_0x244e7c['query']['limit']);_0x2138a4[_0x2f64('0x1f')]=qs[_0x2f64('0x1f')](_0x244e7c[_0x2f64('0x3c')]['offset']);}return _0x5a9ab7['getVoiceQueuesRt'](_0x2138a4);}})[_0x2f64('0x12')](function(_0x7d4887){if(_0x7d4887){return _0x7d4887?{'count':_0x1aa620,'rows':_0x7d4887}:null;}})['then'](respondWithResult(_0x9d866c,null))[_0x2f64('0x57')](handleError(_0x9d866c,null));};exports[_0x2f64('0xdb')]=function(_0x9e7ffd,_0x14b153){var _0x5cb616={};var _0x4bd2ee={};var _0x316c77;var _0x59ab06;return db['User'][_0x2f64('0xc7')]({'where':{'id':_0x9e7ffd['params']['id']}})['then'](handleEntityNotFound(_0x14b153,null))[_0x2f64('0x12')](function(_0x4822b7){if(_0x4822b7){_0x316c77=_0x4822b7;_0x4bd2ee[_0x2f64('0x4f')]=_[_0x2f64('0x50')](db[_0x2f64('0xdc')]['rawAttributes']);_0x4bd2ee[_0x2f64('0x3c')]=_[_0x2f64('0x50')](_0x9e7ffd[_0x2f64('0x3c')]);_0x4bd2ee[_0x2f64('0x51')]=_[_0x2f64('0x52')](_0x4bd2ee[_0x2f64('0x4f')],_0x4bd2ee[_0x2f64('0x3c')]);_0x5cb616[_0x2f64('0x41')]=_[_0x2f64('0x52')](_0x4bd2ee[_0x2f64('0x4f')],qs[_0x2f64('0x53')](_0x9e7ffd[_0x2f64('0x3c')]['fields']));_0x5cb616['attributes']=_0x5cb616[_0x2f64('0x41')][_0x2f64('0x45')]?_0x5cb616[_0x2f64('0x41')]:_0x4bd2ee[_0x2f64('0x4f')];_0x5cb616[_0x2f64('0xc9')]=qs[_0x2f64('0xca')](_0x9e7ffd['query'][_0x2f64('0xca')]);_0x5cb616[_0x2f64('0xcb')]=qs[_0x2f64('0x51')](_[_0x2f64('0xcc')](_0x9e7ffd['query'],_0x4bd2ee[_0x2f64('0x51')]));if(_0x9e7ffd[_0x2f64('0x3c')][_0x2f64('0x2c')]){_0x5cb616['where']=_[_0x2f64('0x55')](_0x5cb616[_0x2f64('0xcb')],{'$or':_[_0x2f64('0x2e')](_0x5cb616[_0x2f64('0x41')],function(_0x14c4c1){var _0x30b5c0={};_0x30b5c0[_0x14c4c1]={'$like':'%'+_0x9e7ffd['query'][_0x2f64('0x2c')]+'%'};return _0x30b5c0;})});}_0x5cb616=_[_0x2f64('0x55')]({},_0x5cb616,_0x9e7ffd[_0x2f64('0xcd')]);return _0x316c77[_0x2f64('0xdb')](_0x5cb616);}})[_0x2f64('0x12')](function(_0xe33e5c){if(_0xe33e5c){_0x59ab06=_0xe33e5c['length'];if(!_0x9e7ffd['query'][_0x2f64('0xce')]('nolimit')){_0x5cb616[_0x2f64('0x20')]=qs[_0x2f64('0x20')](_0x9e7ffd['query'][_0x2f64('0x20')]);_0x5cb616['offset']=qs[_0x2f64('0x1f')](_0x9e7ffd['query'][_0x2f64('0x1f')]);}return _0x316c77[_0x2f64('0xdb')](_0x5cb616);}})[_0x2f64('0x12')](function(_0x1b8d61){if(_0x1b8d61){return _0x1b8d61?{'count':_0x59ab06,'rows':_0x1b8d61}:null;}})[_0x2f64('0x12')](respondWithResult(_0x14b153,null))[_0x2f64('0x57')](handleError(_0x14b153,null));};exports['getRecordings']=function(_0x3747cc,_0x1acedf){var _0xd137b5={'raw':!![],'where':{}};var _0x23ffaf={};var _0x5ee0ec={'count':0x0,'rows':[]};return db[_0x2f64('0x35')]['findOne']({'where':{'id':_0x3747cc[_0x2f64('0x4e')]['id']}})[_0x2f64('0x12')](handleEntityNotFound(_0x1acedf,null))[_0x2f64('0x12')](function(_0x35b3eb){if(_0x35b3eb){_0x23ffaf['model']=_[_0x2f64('0x50')](db['VoiceRecording'][_0x2f64('0xd8')]);_0x23ffaf[_0x2f64('0x3c')]=_['keys'](_0x3747cc['query']);_0x23ffaf['filters']=_[_0x2f64('0x52')](_0x23ffaf[_0x2f64('0x4f')],_0x23ffaf[_0x2f64('0x3c')]);_0xd137b5[_0x2f64('0x41')]=_[_0x2f64('0x52')](_0x23ffaf[_0x2f64('0x4f')],qs[_0x2f64('0x53')](_0x3747cc['query'][_0x2f64('0x53')]));_0xd137b5[_0x2f64('0x41')]=_0xd137b5['attributes']['length']?_0xd137b5[_0x2f64('0x41')]:_0x23ffaf[_0x2f64('0x4f')];if(!_0x3747cc['query'][_0x2f64('0xce')](_0x2f64('0xd4'))){_0xd137b5[_0x2f64('0x20')]=qs[_0x2f64('0x20')](_0x3747cc[_0x2f64('0x3c')][_0x2f64('0x20')]);_0xd137b5['offset']=qs[_0x2f64('0x1f')](_0x3747cc[_0x2f64('0x3c')][_0x2f64('0x1f')]);}_0xd137b5['order']=qs['sort'](_0x3747cc[_0x2f64('0x3c')]['sort']);_0xd137b5[_0x2f64('0xcb')]=qs[_0x2f64('0x51')](_['pick'](_0x3747cc[_0x2f64('0x3c')],_0x23ffaf[_0x2f64('0x51')]));_0xd137b5[_0x2f64('0xcb')][_0x2f64('0xdd')]=_0x35b3eb['id'];if(_0x3747cc['query']['filter']){_0xd137b5[_0x2f64('0xcb')]=_['merge'](_0xd137b5[_0x2f64('0xcb')],{'$or':_[_0x2f64('0x2e')](_0xd137b5['attributes'],function(_0x5bc67f){var _0x27cef1={};_0x27cef1[_0x5bc67f]={'$like':'%'+_0x3747cc[_0x2f64('0x3c')][_0x2f64('0x2c')]+'%'};return _0x27cef1;})});}_0xd137b5=_['merge']({},_0xd137b5,_0x3747cc[_0x2f64('0xcd')]);return db[_0x2f64('0xde')][_0x2f64('0x21')]({'where':_0xd137b5[_0x2f64('0xcb')]})['then'](function(_0x1dc747){_0x5ee0ec[_0x2f64('0x21')]=_0x1dc747;if(_0x3747cc[_0x2f64('0x3c')][_0x2f64('0x3d')]){_0xd137b5[_0x2f64('0x3e')]=[{'all':!![]}];}return db[_0x2f64('0xde')][_0x2f64('0x88')](_0xd137b5);})[_0x2f64('0x12')](function(_0x1e6aba){_0x5ee0ec['rows']=_0x1e6aba;return _0x5ee0ec;});}})['then'](respondWithFilteredResult(_0x1acedf,_0xd137b5))[_0x2f64('0x57')](handleError(_0x1acedf,null));};exports[_0x2f64('0xdf')]=function(_0x1c8cf7,_0x428f62){var _0x3b746f={'raw':!![],'where':{}};var _0x366a73={};var _0xaffe1f={'count':0x0,'rows':[]};return db[_0x2f64('0x35')][_0x2f64('0xc7')]({'where':{'id':_0x1c8cf7[_0x2f64('0x4e')]['id']}})[_0x2f64('0x12')](handleEntityNotFound(_0x428f62,null))['then'](function(_0x5ad986){if(_0x5ad986){_0x366a73['model']=_[_0x2f64('0x50')](db[_0x2f64('0xe0')]['rawAttributes']);_0x366a73[_0x2f64('0x3c')]=_['keys'](_0x1c8cf7['query']);_0x366a73[_0x2f64('0x51')]=_[_0x2f64('0x52')](_0x366a73['model'],_0x366a73[_0x2f64('0x3c')]);_0x3b746f[_0x2f64('0x41')]=_[_0x2f64('0x52')](_0x366a73[_0x2f64('0x4f')],qs['fields'](_0x1c8cf7['query'][_0x2f64('0x53')]));_0x3b746f[_0x2f64('0x41')]=_0x3b746f[_0x2f64('0x41')]['length']?_0x3b746f[_0x2f64('0x41')]:_0x366a73[_0x2f64('0x4f')];if(!_0x1c8cf7[_0x2f64('0x3c')]['hasOwnProperty']('nolimit')){_0x3b746f[_0x2f64('0x20')]=qs[_0x2f64('0x20')](_0x1c8cf7[_0x2f64('0x3c')][_0x2f64('0x20')]);_0x3b746f['offset']=qs[_0x2f64('0x1f')](_0x1c8cf7['query'][_0x2f64('0x1f')]);}_0x3b746f[_0x2f64('0xc9')]=qs[_0x2f64('0xca')](_0x1c8cf7[_0x2f64('0x3c')][_0x2f64('0xca')]);_0x3b746f[_0x2f64('0xcb')]=qs[_0x2f64('0x51')](_[_0x2f64('0xcc')](_0x1c8cf7['query'],_0x366a73[_0x2f64('0x51')]));_0x3b746f[_0x2f64('0xcb')][_0x2f64('0xdd')]=_0x5ad986['id'];if(_0x1c8cf7[_0x2f64('0x3c')][_0x2f64('0x2c')]){_0x3b746f[_0x2f64('0xcb')]=_['merge'](_0x3b746f[_0x2f64('0xcb')],{'$or':_[_0x2f64('0x2e')](_0x3b746f['attributes'],function(_0x382d67){var _0x2c7646={};_0x2c7646[_0x382d67]={'$like':'%'+_0x1c8cf7[_0x2f64('0x3c')][_0x2f64('0x2c')]+'%'};return _0x2c7646;})});}_0x3b746f=_[_0x2f64('0x55')]({},_0x3b746f,_0x1c8cf7[_0x2f64('0xcd')]);return db[_0x2f64('0xe0')]['count']({'where':_0x3b746f[_0x2f64('0xcb')]})[_0x2f64('0x12')](function(_0x1f3c12){_0xaffe1f[_0x2f64('0x21')]=_0x1f3c12;if(_0x1c8cf7[_0x2f64('0x3c')][_0x2f64('0x3d')]){_0x3b746f['include']=[{'all':!![]}];}return db[_0x2f64('0xe0')][_0x2f64('0x88')](_0x3b746f);})[_0x2f64('0x12')](function(_0x356712){_0xaffe1f[_0x2f64('0x43')]=_0x356712;return _0xaffe1f;});}})['then'](respondWithFilteredResult(_0x428f62,_0x3b746f))[_0x2f64('0x57')](handleError(_0x428f62,null));};exports[_0x2f64('0xe1')]=function(_0x2e79ab,_0x2248c1){var _0x4565ce={};var _0x484f52={};var _0x38bded;var _0x7fa883;return db['User'][_0x2f64('0xc7')]({'where':{'id':_0x2e79ab[_0x2f64('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2248c1,null))[_0x2f64('0x12')](function(_0x199dbe){if(_0x199dbe){_0x38bded=_0x199dbe;_0x484f52[_0x2f64('0x4f')]=_['keys'](db[_0x2f64('0xe2')]['rawAttributes']);_0x484f52[_0x2f64('0x3c')]=_['keys'](_0x2e79ab['query']);_0x484f52[_0x2f64('0x51')]=_[_0x2f64('0x52')](_0x484f52[_0x2f64('0x4f')],_0x484f52[_0x2f64('0x3c')]);_0x4565ce[_0x2f64('0x41')]=_['intersection'](_0x484f52[_0x2f64('0x4f')],qs[_0x2f64('0x53')](_0x2e79ab[_0x2f64('0x3c')]['fields']));_0x4565ce[_0x2f64('0x41')]=_0x4565ce[_0x2f64('0x41')][_0x2f64('0x45')]?_0x4565ce['attributes']:_0x484f52[_0x2f64('0x4f')];_0x4565ce[_0x2f64('0xc9')]=qs['sort'](_0x2e79ab[_0x2f64('0x3c')]['sort']);_0x4565ce[_0x2f64('0xcb')]=qs[_0x2f64('0x51')](_[_0x2f64('0xcc')](_0x2e79ab[_0x2f64('0x3c')],_0x484f52[_0x2f64('0x51')]));if(_0x2e79ab[_0x2f64('0x3c')][_0x2f64('0x2c')]){_0x4565ce[_0x2f64('0xcb')]=_[_0x2f64('0x55')](_0x4565ce[_0x2f64('0xcb')],{'$or':_[_0x2f64('0x2e')](_0x4565ce['attributes'],function(_0x43a5cd){var _0x3f0cef={};_0x3f0cef[_0x43a5cd]={'$like':'%'+_0x2e79ab['query'][_0x2f64('0x2c')]+'%'};return _0x3f0cef;})});}_0x4565ce=_[_0x2f64('0x55')]({},_0x4565ce,_0x2e79ab[_0x2f64('0xcd')]);return _0x38bded[_0x2f64('0xe1')](_0x4565ce);}})['then'](function(_0x53d166){if(_0x53d166){_0x7fa883=_0x53d166[_0x2f64('0x45')];if(!_0x2e79ab[_0x2f64('0x3c')]['hasOwnProperty']('nolimit')){_0x4565ce[_0x2f64('0x20')]=qs[_0x2f64('0x20')](_0x2e79ab[_0x2f64('0x3c')]['limit']);_0x4565ce[_0x2f64('0x1f')]=qs['offset'](_0x2e79ab[_0x2f64('0x3c')][_0x2f64('0x1f')]);}return _0x38bded[_0x2f64('0xe1')](_0x4565ce);}})[_0x2f64('0x12')](function(_0x27cd32){if(_0x27cd32){return _0x27cd32?{'count':_0x7fa883,'rows':_0x27cd32}:null;}})['then'](respondWithResult(_0x2248c1,null))['catch'](handleError(_0x2248c1,null));};exports[_0x2f64('0xe3')]=function(_0x492cca,_0x21a243){var _0x1c14cb={};var _0x1981e3={};var _0x1fbc70;var _0x48ba6b;return db[_0x2f64('0x35')][_0x2f64('0xc7')]({'where':{'id':_0x492cca[_0x2f64('0x4e')]['id']}})['then'](handleEntityNotFound(_0x21a243,null))[_0x2f64('0x12')](function(_0x1ee824){if(_0x1ee824){_0x1fbc70=_0x1ee824;_0x1981e3['model']=_[_0x2f64('0x50')](db[_0x2f64('0xe4')][_0x2f64('0xd8')]);_0x1981e3[_0x2f64('0x3c')]=_['keys'](_0x492cca[_0x2f64('0x3c')]);_0x1981e3[_0x2f64('0x51')]=_[_0x2f64('0x52')](_0x1981e3[_0x2f64('0x4f')],_0x1981e3['query']);_0x1c14cb[_0x2f64('0x41')]=_[_0x2f64('0x52')](_0x1981e3[_0x2f64('0x4f')],qs[_0x2f64('0x53')](_0x492cca[_0x2f64('0x3c')][_0x2f64('0x53')]));_0x1c14cb['attributes']=_0x1c14cb['attributes']['length']?_0x1c14cb[_0x2f64('0x41')]:_0x1981e3[_0x2f64('0x4f')];_0x1c14cb[_0x2f64('0xc9')]=qs[_0x2f64('0xca')](_0x492cca[_0x2f64('0x3c')][_0x2f64('0xca')]);_0x1c14cb['where']=qs[_0x2f64('0x51')](_[_0x2f64('0xcc')](_0x492cca['query'],_0x1981e3[_0x2f64('0x51')]));if(_0x492cca[_0x2f64('0x3c')]['filter']){_0x1c14cb[_0x2f64('0xcb')]=_[_0x2f64('0x55')](_0x1c14cb['where'],{'$or':_[_0x2f64('0x2e')](_0x1c14cb['attributes'],function(_0x1d936f){var _0x1077fa={};_0x1077fa[_0x1d936f]={'$like':'%'+_0x492cca[_0x2f64('0x3c')]['filter']+'%'};return _0x1077fa;})});}_0x1c14cb=_[_0x2f64('0x55')]({},_0x1c14cb,_0x492cca['options']);return _0x1fbc70[_0x2f64('0xe3')](_0x1c14cb);}})['then'](function(_0x52d989){if(_0x52d989){_0x48ba6b=_0x52d989[_0x2f64('0x45')];if(!_0x492cca[_0x2f64('0x3c')][_0x2f64('0xce')](_0x2f64('0xd4'))){_0x1c14cb[_0x2f64('0x20')]=qs[_0x2f64('0x20')](_0x492cca[_0x2f64('0x3c')][_0x2f64('0x20')]);_0x1c14cb[_0x2f64('0x1f')]=qs[_0x2f64('0x1f')](_0x492cca[_0x2f64('0x3c')]['offset']);}return _0x1fbc70[_0x2f64('0xe3')](_0x1c14cb);}})[_0x2f64('0x12')](function(_0x1c0455){if(_0x1c0455){return _0x1c0455?{'count':_0x48ba6b,'rows':_0x1c0455}:null;}})[_0x2f64('0x12')](respondWithResult(_0x21a243,null))[_0x2f64('0x57')](handleError(_0x21a243,null));};exports['getMailInteractions']=function(_0x3a4acf,_0xe2b253){var _0x570088={'raw':!![],'where':{}};var _0x2b79ff={};var _0x178941={'count':0x0,'rows':[]};return db[_0x2f64('0x35')]['findOne']({'where':{'id':_0x3a4acf[_0x2f64('0x4e')]['id']}})[_0x2f64('0x12')](handleEntityNotFound(_0xe2b253,null))[_0x2f64('0x12')](function(_0x400ab7){if(_0x400ab7){_0x2b79ff[_0x2f64('0x4f')]=_[_0x2f64('0x50')](db[_0x2f64('0xe5')][_0x2f64('0xd8')]);_0x2b79ff[_0x2f64('0x3c')]=_[_0x2f64('0x50')](_0x3a4acf['query']);_0x2b79ff[_0x2f64('0x51')]=_[_0x2f64('0x52')](_0x2b79ff['model'],_0x2b79ff['query']);_0x570088[_0x2f64('0x41')]=_[_0x2f64('0x52')](_0x2b79ff['model'],qs['fields'](_0x3a4acf[_0x2f64('0x3c')][_0x2f64('0x53')]));_0x570088['attributes']=_0x570088[_0x2f64('0x41')][_0x2f64('0x45')]?_0x570088[_0x2f64('0x41')]:_0x2b79ff['model'];if(!_0x3a4acf[_0x2f64('0x3c')][_0x2f64('0xce')]('nolimit')){_0x570088['limit']=qs[_0x2f64('0x20')](_0x3a4acf['query']['limit']);_0x570088['offset']=qs[_0x2f64('0x1f')](_0x3a4acf[_0x2f64('0x3c')]['offset']);}_0x570088[_0x2f64('0xc9')]=qs[_0x2f64('0xca')](_0x3a4acf[_0x2f64('0x3c')][_0x2f64('0xca')]);_0x570088[_0x2f64('0xcb')]=qs[_0x2f64('0x51')](_[_0x2f64('0xcc')](_0x3a4acf[_0x2f64('0x3c')],_0x2b79ff[_0x2f64('0x51')]));_0x570088[_0x2f64('0xcb')][_0x2f64('0xdd')]=_0x400ab7['id'];if(_0x3a4acf['query']['filter']){_0x570088[_0x2f64('0xcb')]=_[_0x2f64('0x55')](_0x570088['where'],{'$or':_['map'](_0x570088[_0x2f64('0x41')],function(_0x3f872e){var _0x4295a8={};_0x4295a8[_0x3f872e]={'$like':'%'+_0x3a4acf[_0x2f64('0x3c')][_0x2f64('0x2c')]+'%'};return _0x4295a8;})});}_0x570088=_[_0x2f64('0x55')]({},_0x570088,_0x3a4acf[_0x2f64('0xcd')]);return db['MailInteraction'][_0x2f64('0x21')]({'where':_0x570088[_0x2f64('0xcb')]})['then'](function(_0x3c1b91){_0x178941[_0x2f64('0x21')]=_0x3c1b91;if(_0x3a4acf[_0x2f64('0x3c')][_0x2f64('0x3d')]){_0x570088[_0x2f64('0x3e')]=[{'all':!![]}];}return db[_0x2f64('0xe5')][_0x2f64('0x88')](_0x570088);})[_0x2f64('0x12')](function(_0x4024e9){_0x178941[_0x2f64('0x43')]=_0x4024e9;return _0x178941;});}})[_0x2f64('0x12')](respondWithFilteredResult(_0xe2b253,_0x570088))[_0x2f64('0x57')](handleError(_0xe2b253,null));};exports[_0x2f64('0xe6')]=function(_0xb552e1,_0x2a3bf6){var _0x320e18={};var _0x126b21={};var _0x27610e;var _0x202910;return db['User'][_0x2f64('0xc7')]({'where':{'id':_0xb552e1[_0x2f64('0x4e')]['id']}})[_0x2f64('0x12')](handleEntityNotFound(_0x2a3bf6,null))[_0x2f64('0x12')](function(_0x3f1615){if(_0x3f1615){_0x27610e=_0x3f1615;_0x126b21[_0x2f64('0x4f')]=_[_0x2f64('0x50')](db[_0x2f64('0xe7')]['rawAttributes']);_0x126b21[_0x2f64('0x3c')]=_['keys'](_0xb552e1[_0x2f64('0x3c')]);_0x126b21[_0x2f64('0x51')]=_['intersection'](_0x126b21['model'],_0x126b21[_0x2f64('0x3c')]);_0x320e18['attributes']=_[_0x2f64('0x52')](_0x126b21[_0x2f64('0x4f')],qs[_0x2f64('0x53')](_0xb552e1[_0x2f64('0x3c')][_0x2f64('0x53')]));_0x320e18[_0x2f64('0x41')]=_0x320e18['attributes'][_0x2f64('0x45')]?_0x320e18[_0x2f64('0x41')]:_0x126b21[_0x2f64('0x4f')];_0x320e18[_0x2f64('0xc9')]=qs[_0x2f64('0xca')](_0xb552e1[_0x2f64('0x3c')][_0x2f64('0xca')]);_0x320e18[_0x2f64('0xcb')]=qs[_0x2f64('0x51')](_['pick'](_0xb552e1[_0x2f64('0x3c')],_0x126b21['filters']));if(_0xb552e1[_0x2f64('0x3c')][_0x2f64('0x2c')]){_0x320e18[_0x2f64('0xcb')]=_['merge'](_0x320e18[_0x2f64('0xcb')],{'$or':_[_0x2f64('0x2e')](_0x320e18['attributes'],function(_0x327f45){var _0x435d62={};_0x435d62[_0x327f45]={'$like':'%'+_0xb552e1[_0x2f64('0x3c')]['filter']+'%'};return _0x435d62;})});}_0x320e18=_[_0x2f64('0x55')]({},_0x320e18,_0xb552e1[_0x2f64('0xcd')]);return _0x27610e[_0x2f64('0xe6')](_0x320e18);}})[_0x2f64('0x12')](function(_0x172dc5){if(_0x172dc5){_0x202910=_0x172dc5['length'];if(!_0xb552e1[_0x2f64('0x3c')][_0x2f64('0xce')](_0x2f64('0xd4'))){_0x320e18['limit']=qs[_0x2f64('0x20')](_0xb552e1[_0x2f64('0x3c')][_0x2f64('0x20')]);_0x320e18[_0x2f64('0x1f')]=qs[_0x2f64('0x1f')](_0xb552e1[_0x2f64('0x3c')][_0x2f64('0x1f')]);}return _0x27610e[_0x2f64('0xe6')](_0x320e18);}})[_0x2f64('0x12')](function(_0x3ca199){if(_0x3ca199){return _0x3ca199?{'count':_0x202910,'rows':_0x3ca199}:null;}})[_0x2f64('0x12')](respondWithResult(_0x2a3bf6,null))['catch'](handleError(_0x2a3bf6,null));};exports[_0x2f64('0xe8')]=function(_0x3b0737,_0x394ab3){var _0x4af236={};var _0x4e713d={};var _0x5b5b09;var _0x2ad9e1;return db[_0x2f64('0x35')][_0x2f64('0xc7')]({'where':{'id':_0x3b0737[_0x2f64('0x4e')]['id']}})[_0x2f64('0x12')](handleEntityNotFound(_0x394ab3,null))[_0x2f64('0x12')](function(_0x41576a){if(_0x41576a){_0x5b5b09=_0x41576a;_0x4e713d['model']=_[_0x2f64('0x50')](db['FaxInteraction']['rawAttributes']);_0x4e713d[_0x2f64('0x3c')]=_['keys'](_0x3b0737['query']);_0x4e713d['filters']=_['intersection'](_0x4e713d[_0x2f64('0x4f')],_0x4e713d['query']);_0x4af236[_0x2f64('0x41')]=_[_0x2f64('0x52')](_0x4e713d[_0x2f64('0x4f')],qs[_0x2f64('0x53')](_0x3b0737[_0x2f64('0x3c')][_0x2f64('0x53')]));_0x4af236[_0x2f64('0x41')]=_0x4af236['attributes'][_0x2f64('0x45')]?_0x4af236[_0x2f64('0x41')]:_0x4e713d['model'];_0x4af236['order']=qs['sort'](_0x3b0737['query']['sort']);_0x4af236[_0x2f64('0xcb')]=qs[_0x2f64('0x51')](_[_0x2f64('0xcc')](_0x3b0737[_0x2f64('0x3c')],_0x4e713d[_0x2f64('0x51')]));if(_0x3b0737['query'][_0x2f64('0x2c')]){_0x4af236[_0x2f64('0xcb')]=_[_0x2f64('0x55')](_0x4af236['where'],{'$or':_[_0x2f64('0x2e')](_0x4af236[_0x2f64('0x41')],function(_0x4911d7){var _0x43c632={};_0x43c632[_0x4911d7]={'$like':'%'+_0x3b0737[_0x2f64('0x3c')][_0x2f64('0x2c')]+'%'};return _0x43c632;})});}_0x4af236=_[_0x2f64('0x55')]({},_0x4af236,_0x3b0737[_0x2f64('0xcd')]);return _0x5b5b09['getFaxInteractions'](_0x4af236);}})[_0x2f64('0x12')](function(_0x11e77b){if(_0x11e77b){_0x2ad9e1=_0x11e77b[_0x2f64('0x45')];if(!_0x3b0737['query'][_0x2f64('0xce')]('nolimit')){_0x4af236[_0x2f64('0x20')]=qs['limit'](_0x3b0737[_0x2f64('0x3c')][_0x2f64('0x20')]);_0x4af236[_0x2f64('0x1f')]=qs['offset'](_0x3b0737[_0x2f64('0x3c')][_0x2f64('0x1f')]);}return _0x5b5b09['getFaxInteractions'](_0x4af236);}})['then'](function(_0x2ed889){if(_0x2ed889){return _0x2ed889?{'count':_0x2ad9e1,'rows':_0x2ed889}:null;}})[_0x2f64('0x12')](respondWithResult(_0x394ab3,null))[_0x2f64('0x57')](handleError(_0x394ab3,null));};exports[_0x2f64('0xe9')]=function(_0x1aa511,_0x19f65a){var _0x23e80e={};var _0x397024={};var _0x221ac4;var _0x10b576;return db[_0x2f64('0x35')]['findOne']({'where':{'id':_0x1aa511[_0x2f64('0x4e')]['id']}})['then'](handleEntityNotFound(_0x19f65a,null))[_0x2f64('0x12')](function(_0x136c3e){if(_0x136c3e){_0x221ac4=_0x136c3e;_0x397024['model']=_[_0x2f64('0x50')](db[_0x2f64('0xea')][_0x2f64('0xd8')]);_0x397024[_0x2f64('0x3c')]=_[_0x2f64('0x50')](_0x1aa511[_0x2f64('0x3c')]);_0x397024[_0x2f64('0x51')]=_['intersection'](_0x397024['model'],_0x397024[_0x2f64('0x3c')]);_0x23e80e[_0x2f64('0x41')]=_[_0x2f64('0x52')](_0x397024[_0x2f64('0x4f')],qs[_0x2f64('0x53')](_0x1aa511[_0x2f64('0x3c')][_0x2f64('0x53')]));_0x23e80e['attributes']=_0x23e80e[_0x2f64('0x41')]['length']?_0x23e80e[_0x2f64('0x41')]:_0x397024[_0x2f64('0x4f')];_0x23e80e[_0x2f64('0xc9')]=qs[_0x2f64('0xca')](_0x1aa511[_0x2f64('0x3c')][_0x2f64('0xca')]);_0x23e80e[_0x2f64('0xcb')]=qs['filters'](_[_0x2f64('0xcc')](_0x1aa511[_0x2f64('0x3c')],_0x397024[_0x2f64('0x51')]));if(_0x1aa511['query'][_0x2f64('0x2c')]){_0x23e80e['where']=_[_0x2f64('0x55')](_0x23e80e[_0x2f64('0xcb')],{'$or':_[_0x2f64('0x2e')](_0x23e80e[_0x2f64('0x41')],function(_0x398644){var _0x29605c={};_0x29605c[_0x398644]={'$like':'%'+_0x1aa511[_0x2f64('0x3c')][_0x2f64('0x2c')]+'%'};return _0x29605c;})});}_0x23e80e=_[_0x2f64('0x55')]({},_0x23e80e,_0x1aa511[_0x2f64('0xcd')]);return _0x221ac4['getWhatsappInteractions'](_0x23e80e);}})[_0x2f64('0x12')](function(_0x57ca1b){if(_0x57ca1b){_0x10b576=_0x57ca1b[_0x2f64('0x45')];if(!_0x1aa511[_0x2f64('0x3c')][_0x2f64('0xce')](_0x2f64('0xd4'))){_0x23e80e[_0x2f64('0x20')]=qs[_0x2f64('0x20')](_0x1aa511[_0x2f64('0x3c')]['limit']);_0x23e80e[_0x2f64('0x1f')]=qs[_0x2f64('0x1f')](_0x1aa511[_0x2f64('0x3c')][_0x2f64('0x1f')]);}return _0x221ac4['getWhatsappInteractions'](_0x23e80e);}})[_0x2f64('0x12')](function(_0x10f11c){if(_0x10f11c){return _0x10f11c?{'count':_0x10b576,'rows':_0x10f11c}:null;}})[_0x2f64('0x12')](respondWithResult(_0x19f65a,null))['catch'](handleError(_0x19f65a,null));};exports[_0x2f64('0xeb')]=function(_0x36e06b,_0x5d754c,_0x17ff17){var _0x4af284;var _0x59f414;var _0x565bc2;var _0xa22e41=!_[_0x2f64('0x61')](_0x36e06b[_0x2f64('0x4e')]['id'])?_0x36e06b['params']['id']:!_[_0x2f64('0x61')](_0x36e06b['user']['id'])?_0x36e06b[_0x2f64('0x28')]['id']:null;return db[_0x2f64('0x35')][_0x2f64('0x31')]({'where':{'id':_0xa22e41,'role':{'$or':['admin',_0x2f64('0x28'),'agent']}},'attributes':['id',_0x2f64('0x32'),'phone',_0x2f64('0xec'),'role',_0x2f64('0x60'),_0x2f64('0x9a')]})['then'](function(_0x5003e9){if(_0x5003e9){if(_0x5003e9[_0x2f64('0x25')]===_0x2f64('0x2a')){_0x4af284=_0x5003e9;if(_0x36e06b['body'][_0x2f64('0x9c')]){_0x565bc2=util[_0x2f64('0xed')](_0x2f64('0xee'),_0x4af284[_0x36e06b[_0x2f64('0x58')][_0x2f64('0x9c')]]);}else if(_0x36e06b['body'][_0x2f64('0xef')]){_0x565bc2=util[_0x2f64('0xed')]('SIP/%s',_0x36e06b[_0x2f64('0x58')]['intrf']);}else{_0x565bc2=util[_0x2f64('0xed')](_0x2f64('0xa9'),_0x4af284['name']);}socket['to'](util[_0x2f64('0xed')](_0x2f64('0xf0'),_0x4af284[_0x2f64('0x32')]))[_0x2f64('0xa5')](_0x2f64('0xf1'),{'user':{'id':_0x4af284['id'],'name':_0x4af284['name']},'ip':_0x36e06b['headers'][_0x2f64('0xf2')]||_0x36e06b[_0x2f64('0xf3')][_0x2f64('0xf4')]||_0x36e06b['socket'][_0x2f64('0xf4')]||_0x36e06b[_0x2f64('0xf3')][_0x2f64('0xf5')][_0x2f64('0xf4')]});return db[_0x2f64('0xae')][_0x2f64('0x33')]({'where':{'membername':_0x4af284[_0x2f64('0x32')]},'individualHooks':!![]});}}else{throw new db[(_0x2f64('0x8d'))][(_0x2f64('0x8e'))](_0x2f64('0xf6'));}})[_0x2f64('0x12')](function(){if(_0x4af284){return _0x4af284[_0x2f64('0xf7')]({'raw':!![]});}})[_0x2f64('0x12')](function(_0x1a991a){if(_0x4af284){var _0x1aa80e=[];if(_0x1a991a){_0x59f414=_0x1a991a;if(_0x59f414[_0x2f64('0x45')]){for(var _0x22f3da=0x0;_0x22f3da<_0x59f414['length'];_0x22f3da++){_0x1aa80e[_0x2f64('0x42')]({'membername':_0x4af284[_0x2f64('0x32')],'UserId':_0x4af284['id'],'queue_name':_0x59f414[_0x22f3da][_0x2f64('0x32')],'VoiceQueueId':_0x59f414[_0x22f3da]['id'],'interface':_0x565bc2,'paused':_0x4af284[_0x2f64('0x9a')]||![],'penalty':_0x59f414[_0x22f3da][_0x2f64('0xf8')]||0x0});}return BPromise[_0x2f64('0x86')](_0x1aa80e,function(_0x12c779){return db['UserVoiceQueueRt'][_0x2f64('0xf9')](_0x12c779);});}}}})[_0x2f64('0x12')](function(){if(_0x4af284){return db[_0x2f64('0xfa')]['findAll']({'where':{'membername':_0x4af284[_0x2f64('0x32')],'exitAt':null}});}})[_0x2f64('0x12')](function(_0x1e4b85){if(_0x4af284){var _0x5288e5=[];_0x1e4b85[_0x2f64('0xfb')](function(_0x5d12c2){_0x5288e5['push'](_0x5d12c2['update']({'exitAt':moment()[_0x2f64('0xed')](_0x2f64('0xfc'))}));});return BPromise[_0x2f64('0x4c')](_0x5288e5);}})['then'](function(){if(_0x4af284){var _0x4aa029=[];var _0x4543b4=[];var _0x511ff0=utils['getChannels']();var _0x277af0={'membername':_0x4af284['name'],'interface':_0x565bc2,'enterAt':moment()[_0x2f64('0xed')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x4af284[_0x2f64('0x25')],'internal':_0x4af284[_0x2f64('0x60')]};_0x511ff0[_0x2f64('0xfb')](function(_0x5be781){_0x4aa029[_0x2f64('0x42')](_[_0x2f64('0x55')]({'channel':_0x5be781,'type':_0x2f64('0xfd'),'data1':_0x36e06b[_0x2f64('0x58')]['device'],'data2':_0x565bc2},_0x277af0));if(_0x4af284[_0x2f64('0x9a')]){_0x4543b4['push'](_[_0x2f64('0x55')]({'channel':_0x5be781,'type':_0x2f64('0xfe'),'data1':_0x2f64('0xff')},_0x277af0));}});return db['MemberReport']['bulkCreate'](_0x4aa029[_0x2f64('0xc5')](_0x4543b4),{'individualHooks':!![]});}})[_0x2f64('0x12')](function(){if(_0x4af284){return _0x4af284[_0x2f64('0x100')]({'online':!![],'lastLoginAt':moment()[_0x2f64('0xed')](_0x2f64('0xfc')),'voicePause':_0x4af284[_0x2f64('0x9a')]||![],'mailPause':_0x4af284[_0x2f64('0x9a')]||![],'chatPause':_0x4af284['loginInPause']||![],'faxPause':_0x4af284[_0x2f64('0x9a')]||![],'smsPause':_0x4af284[_0x2f64('0x9a')]||![],'openchannelPause':_0x4af284[_0x2f64('0x9a')]||![],'whatsappPause':_0x4af284[_0x2f64('0x9a')]||![],'pauseType':_0x4af284[_0x2f64('0x9a')]?'LOGININPAUSE':null,'interface':_0x565bc2,'lastPauseAt':moment()[_0x2f64('0xed')](_0x2f64('0xfc'))});}})[_0x2f64('0x12')](function(_0xbeeaec){if(_0x36e06b[_0x2f64('0x101')]){return _0x17ff17();}else{return BPromise[_0x2f64('0x102')](_0xbeeaec)[_0x2f64('0x12')](respondWithResult(_0x5d754c,null));}})[_0x2f64('0x57')](handleError(_0x5d754c,null));};exports['logout']=function(_0x132f34,_0x5446f9){var _0x139994;return db[_0x2f64('0x35')][_0x2f64('0x31')]({'where':{'id':_0x132f34[_0x2f64('0x4e')]['id'],'role':_0x2f64('0x2a')},'attributes':['id','name','role']})[_0x2f64('0x12')](handleEntityNotFound(_0x5446f9,null))[_0x2f64('0x12')](function(_0x548c48){if(_0x548c48){_0x139994=_0x548c48;return db[_0x2f64('0xae')]['destroy']({'where':{'membername':_0x139994[_0x2f64('0x32')]},'individualHooks':!![]});}})['then'](function(){return db[_0x2f64('0xfa')][_0x2f64('0x88')]({'where':{'membername':_0x139994['name'],'exitAt':null}});})[_0x2f64('0x12')](function(_0x1449fc){var _0xce5cd1=[];_0x1449fc[_0x2f64('0xfb')](function(_0x3dbfec){_0xce5cd1['push'](_0x3dbfec[_0x2f64('0x100')]({'exitAt':moment()[_0x2f64('0xed')](_0x2f64('0xfc'))}));});return BPromise['all'](_0xce5cd1);})[_0x2f64('0x12')](function(){return _0x139994['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x5446f9,null))[_0x2f64('0x57')](handleError(_0x5446f9,null));};exports[_0x2f64('0x103')]=function(_0x54132e,_0x1510dc){var _0xc4097f;return db['UserVoiceQueueRt'][_0x2f64('0x100')]({'paused':0x1},{'where':{'UserId':_0x54132e['params']['id']},'individualHooks':!![]})[_0x2f64('0x12')](function(){return db[_0x2f64('0x35')][_0x2f64('0x31')]({'where':{'id':_0x54132e[_0x2f64('0x4e')]['id'],'role':_0x2f64('0x2a')},'attributes':['id',_0x2f64('0x32'),_0x2f64('0x25'),_0x2f64('0x60'),_0x2f64('0x9c')]});})['then'](handleEntityNotFound(_0x1510dc,null))[_0x2f64('0x12')](function(_0x3b081d){if(_0x3b081d){_0xc4097f=_0x3b081d;return respondWithRpcPromise('QueuePause','pause',{'id':_0xc4097f['id'],'name':_0xc4097f[_0x2f64('0x32')],'pause':!![]});}})[_0x2f64('0x12')](function(){if(_0xc4097f){return db[_0x2f64('0xfa')]['findAll']({'where':{'membername':_0xc4097f['name'],'type':_0x2f64('0xfe'),'exitAt':null}});}})[_0x2f64('0x12')](function(_0x4a0249){if(_0x4a0249[_0x2f64('0x45')]){var _0x200866=moment()[_0x2f64('0xed')](_0x2f64('0xfc'));for(var _0x249c64=0x0,_0x52ec6c=_0x4a0249[_0x2f64('0x45')];_0x249c64<_0x52ec6c;_0x249c64++){_0x4a0249[_0x249c64][_0x2f64('0x104')]({'exitAt':_0x200866});}}})[_0x2f64('0x12')](function(){var _0x4c8118=[];var _0x1e404f=utils['getChannels']();_0x1e404f[_0x2f64('0xfb')](function(_0x2147ce){_0x4c8118[_0x2f64('0x42')]({'channel':_0x2147ce,'membername':_0xc4097f['name'],'interface':_['isNil'](_0xc4097f['interface'])?util[_0x2f64('0xed')](_0x2f64('0xa9'),_0xc4097f['name']):_0xc4097f['interface'],'type':'PAUSE','enterAt':moment()[_0x2f64('0xed')](_0x2f64('0xfc')),'data1':_0x54132e[_0x2f64('0x58')][_0x2f64('0x37')]||_0x2f64('0x105'),'role':_0xc4097f[_0x2f64('0x25')],'internal':_0xc4097f['internal']});});return db['MemberReport'][_0x2f64('0x83')](_0x4c8118,{'individualHooks':!![]});})[_0x2f64('0x12')](function(){return _0xc4097f[_0x2f64('0x100')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x54132e[_0x2f64('0x58')]['type']||_0x2f64('0x105'),'lastPauseAt':moment()[_0x2f64('0xed')](_0x2f64('0xfc'))});})[_0x2f64('0x12')](respondWithResult(_0x1510dc,null))[_0x2f64('0x57')](handleError(_0x1510dc,null));};exports[_0x2f64('0x106')]=function(_0x44a798,_0x4030a8){var _0x468eb0;return db['User'][_0x2f64('0x31')]({'where':{'id':_0x44a798['params']['id']},'attributes':['id',_0x2f64('0x32'),_0x2f64('0x25'),_0x2f64('0x9b'),_0x2f64('0x107'),_0x2f64('0x108'),'faxPause',_0x2f64('0x109'),_0x2f64('0x10a'),_0x2f64('0x10b'),_0x2f64('0x10c'),_0x2f64('0x10d')]})[_0x2f64('0x12')](handleEntityNotFound(_0x4030a8,null))['then'](function(_0x4f639){if(_0x4f639){_0x468eb0=_0x4f639;if(_0x44a798['body']['channel']&&!utils[_0x2f64('0xd6')](_0x44a798[_0x2f64('0x58')][_0x2f64('0xaa')])){throw new db['Sequelize'][(_0x2f64('0x8e'))](_0x2f64('0x9d'));}switch(_0x44a798['body']['channel']){case _0x2f64('0xa7'):return respondWithRpcPromise(_0x2f64('0x10e'),_0x2f64('0x106'),{'id':_0x468eb0['id'],'name':_0x468eb0[_0x2f64('0x32')],'pause':![]})[_0x2f64('0x12')](function(){return db[_0x2f64('0xae')][_0x2f64('0x100')]({'paused':0x0},{'where':{'UserId':_0x468eb0['id']},'individualHooks':!![]});})[_0x2f64('0x12')](function(){return db[_0x2f64('0xfa')][_0x2f64('0x31')]({'where':{'channel':_0x44a798[_0x2f64('0x58')][_0x2f64('0xaa')],'membername':_0x468eb0[_0x2f64('0x32')],'type':'PAUSE','exitAt':null}});})[_0x2f64('0x12')](function(_0x500c0f){if(_0x500c0f){return _0x500c0f[_0x2f64('0x100')]({'exitAt':moment()[_0x2f64('0xed')](_0x2f64('0xfc')),'data2':_0x2f64('0x10f')},{'individualHooks':!![]});}return null;})[_0x2f64('0x12')](function(){return _0x468eb0['update']({'voicePause':![]});});case'mail':case _0x2f64('0x46'):case _0x2f64('0x48'):case _0x2f64('0x47'):case _0x2f64('0x4b'):case _0x2f64('0x56'):return db[_0x2f64('0xfa')]['find']({'where':{'channel':_0x44a798[_0x2f64('0x58')]['channel'],'membername':_0x468eb0[_0x2f64('0x32')],'type':_0x2f64('0xfe'),'exitAt':null}})[_0x2f64('0x12')](function(_0x466cbf){if(_0x466cbf){return _0x466cbf[_0x2f64('0x100')]({'exitAt':moment()['format'](_0x2f64('0xfc')),'data2':_0x2f64('0x10f')},{'individualHooks':!![]});}return null;})[_0x2f64('0x12')](function(){var _0x3da547={};_['set'](_0x3da547,util[_0x2f64('0xed')](_0x2f64('0x110'),_0x44a798[_0x2f64('0x58')][_0x2f64('0xaa')],_0x2f64('0x111')),![]);return _0x468eb0[_0x2f64('0x100')](_0x3da547);});default:return respondWithRpcPromise(_0x2f64('0x10e'),'unpause',{'id':_0x468eb0['id'],'name':_0x468eb0[_0x2f64('0x32')],'pause':![]})[_0x2f64('0x12')](function(){return db[_0x2f64('0xae')]['update']({'paused':0x0},{'where':{'UserId':_0x468eb0['id']}});})[_0x2f64('0x12')](function(){return db[_0x2f64('0xfa')]['findAll']({'where':{'membername':_0x468eb0['name'],'type':'PAUSE','exitAt':null}});})[_0x2f64('0x12')](function(_0x3d36c8){var _0x20c98b=[];_0x3d36c8[_0x2f64('0xfb')](function(_0x39b2a8){_0x20c98b[_0x2f64('0x42')](_0x39b2a8[_0x2f64('0x100')]({'exitAt':moment()[_0x2f64('0xed')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x2f64('0x10f')}));});return BPromise[_0x2f64('0x4c')](_0x20c98b);})[_0x2f64('0x12')](function(){return _0x468eb0[_0x2f64('0x100')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x2f64('0x12')](respondWithResult(_0x4030a8,null))[_0x2f64('0x57')](handleError(_0x4030a8,null));};exports[_0x2f64('0x112')]=function(_0x55ffc8,_0xd4de28){var _0x15facc={};var _0x46c0f0={};var _0x1ca340;var _0x5cb30f;return db[_0x2f64('0x35')][_0x2f64('0xc7')]({'where':{'id':_0x55ffc8[_0x2f64('0x4e')]['id']}})[_0x2f64('0x12')](handleEntityNotFound(_0xd4de28,null))['then'](function(_0x5dd387){if(_0x5dd387){_0x1ca340=_0x5dd387;_0x46c0f0['model']=_[_0x2f64('0x50')](db[_0x2f64('0x113')][_0x2f64('0xd8')]);_0x46c0f0[_0x2f64('0x3c')]=_[_0x2f64('0x50')](_0x55ffc8['query']);_0x46c0f0[_0x2f64('0x51')]=_[_0x2f64('0x52')](_0x46c0f0[_0x2f64('0x4f')],_0x46c0f0['query']);_0x15facc[_0x2f64('0x41')]=_[_0x2f64('0x52')](_0x46c0f0[_0x2f64('0x4f')],qs['fields'](_0x55ffc8[_0x2f64('0x3c')][_0x2f64('0x53')]));_0x15facc[_0x2f64('0x41')]=_0x15facc[_0x2f64('0x41')][_0x2f64('0x45')]?_0x15facc['attributes']:_0x46c0f0[_0x2f64('0x4f')];_0x15facc[_0x2f64('0xc9')]=qs[_0x2f64('0xca')](_0x55ffc8[_0x2f64('0x3c')]['sort']);_0x15facc[_0x2f64('0xcb')]=qs[_0x2f64('0x51')](_['pick'](_0x55ffc8[_0x2f64('0x3c')],_0x46c0f0[_0x2f64('0x51')]));if(_0x55ffc8[_0x2f64('0x3c')][_0x2f64('0x2c')]){_0x15facc[_0x2f64('0xcb')]=_[_0x2f64('0x55')](_0x15facc[_0x2f64('0xcb')],{'$or':_[_0x2f64('0x2e')](_0x15facc[_0x2f64('0x41')],function(_0xb2451){var _0x26b95d={};_0x26b95d[_0xb2451]={'$like':'%'+_0x55ffc8[_0x2f64('0x3c')][_0x2f64('0x2c')]+'%'};return _0x26b95d;})});}_0x15facc=_[_0x2f64('0x55')]({},_0x15facc,_0x55ffc8[_0x2f64('0xcd')]);return _0x1ca340[_0x2f64('0x112')](_0x15facc);}})['then'](function(_0x2106e0){if(_0x2106e0){_0x5cb30f=_0x2106e0[_0x2f64('0x45')];if(!_0x55ffc8['query'][_0x2f64('0xce')]('nolimit')){_0x15facc[_0x2f64('0x20')]=qs[_0x2f64('0x20')](_0x55ffc8[_0x2f64('0x3c')]['limit']);_0x15facc[_0x2f64('0x1f')]=qs[_0x2f64('0x1f')](_0x55ffc8[_0x2f64('0x3c')][_0x2f64('0x1f')]);}return _0x1ca340[_0x2f64('0x112')](_0x15facc);}})['then'](function(_0xfb1af){if(_0xfb1af){return _0xfb1af?{'count':_0x5cb30f,'rows':_0xfb1af}:null;}})['then'](respondWithResult(_0xd4de28,null))[_0x2f64('0x57')](handleError(_0xd4de28,null));};exports[_0x2f64('0x114')]=function(_0x233b9e,_0x1518b1){return db[_0x2f64('0x35')]['find']({'where':{'id':_0x233b9e[_0x2f64('0x4e')]['id']}})[_0x2f64('0x12')](handleEntityNotFound(_0x1518b1,null))[_0x2f64('0x12')](function(_0x37c921){if(_0x37c921){var _0x3cf452=_0x37c921[_0x2f64('0x24')]({'plain':!![]});return _0x37c921['addTeams'](_0x233b9e[_0x2f64('0x58')][_0x2f64('0x5b')],_[_0x2f64('0x5c')](_0x233b9e['body'],[_0x2f64('0x5b'),'id'])||{})['then'](function(){for(var _0x50f448=0x0;_0x50f448<_0x233b9e['body'][_0x2f64('0x5b')][_0x2f64('0x45')];_0x50f448++){var _0x539668=[];var _0x4db3b7={};db['Team'][_0x2f64('0xc7')]({'where':{'id':_0x233b9e[_0x2f64('0x58')]['ids'][_0x50f448]}})[_0x2f64('0x12')](function(_0x45534a){_0x4db3b7=_0x45534a[_0x2f64('0x49')];_0x539668[_0x2f64('0x42')](_0x45534a[_0x2f64('0xf7')]()[_0x2f64('0x12')](function(_0x2ddf46){for(var _0x3f34ca=0x0;_0x3f34ca<_0x2ddf46[_0x2f64('0x45')];_0x3f34ca++){_0x2ddf46[_0x3f34ca][_0x2f64('0x115')](_0x2f64('0xaa'),_0x2f64('0x116'));}return _0x2ddf46;}));_0x539668[_0x2f64('0x42')](_0x45534a[_0x2f64('0x117')]()[_0x2f64('0x12')](function(_0x4f8b10){for(var _0x1a3f59=0x0;_0x1a3f59<_0x4f8b10[_0x2f64('0x45')];_0x1a3f59++){_0x4f8b10[_0x1a3f59]['setDataValue']('channel',_0x2f64('0x118'));}return _0x4f8b10;}));_0x539668[_0x2f64('0x42')](_0x45534a[_0x2f64('0x119')]()[_0x2f64('0x12')](function(_0x5eaa50){for(var _0x40ab82=0x0;_0x40ab82<_0x5eaa50[_0x2f64('0x45')];_0x40ab82++){_0x5eaa50[_0x40ab82][_0x2f64('0x115')](_0x2f64('0xaa'),_0x2f64('0x11a'));}return _0x5eaa50;}));_0x539668[_0x2f64('0x42')](_0x45534a[_0x2f64('0x11b')]()[_0x2f64('0x12')](function(_0x52354f){for(var _0x3aa804=0x0;_0x3aa804<_0x52354f[_0x2f64('0x45')];_0x3aa804++){_0x52354f[_0x3aa804][_0x2f64('0x115')](_0x2f64('0xaa'),'Sms');}return _0x52354f;}));_0x539668['push'](_0x45534a[_0x2f64('0x11c')]()[_0x2f64('0x12')](function(_0x29e9df){for(var _0x7af4cb=0x0;_0x7af4cb<_0x29e9df[_0x2f64('0x45')];_0x7af4cb++){_0x29e9df[_0x7af4cb][_0x2f64('0x115')](_0x2f64('0xaa'),_0x2f64('0x11d'));}return _0x29e9df;}));_0x539668[_0x2f64('0x42')](_0x45534a[_0x2f64('0x11e')]()[_0x2f64('0x12')](function(_0x30dee6){for(var _0x1bdf45=0x0;_0x1bdf45<_0x30dee6[_0x2f64('0x45')];_0x1bdf45++){_0x30dee6[_0x1bdf45][_0x2f64('0x115')]('channel','Fax');}return _0x30dee6;}));_0x539668[_0x2f64('0x42')](_0x45534a[_0x2f64('0x11f')]()[_0x2f64('0x12')](function(_0xf51c1){for(var _0x7ec6ce=0x0;_0x7ec6ce<_0xf51c1[_0x2f64('0x45')];_0x7ec6ce++){_0xf51c1[_0x7ec6ce][_0x2f64('0x115')](_0x2f64('0xaa'),_0x2f64('0x120'));}return _0xf51c1;}));return BPromise[_0x2f64('0x4c')](_0x539668);})[_0x2f64('0x12')](function(_0x4681fb){var _0x306d22=_[_0x2f64('0x121')](_0x4681fb);_0x539668=[];return db[_0x2f64('0x63')]['transaction'](function(_0x177479){for(var _0x433ec9=0x0;_0x433ec9<_0x306d22['length'];_0x433ec9++){_0x539668[_0x2f64('0x42')](_0x306d22[_0x433ec9][_0x2f64('0x122')](_0x3cf452['id']),{'transaction':_0x177479});}return BPromise[_0x2f64('0x4c')](_0x539668)[_0x2f64('0x12')](function(){if(_0x3cf452[_0x2f64('0x99')]){return BPromise[_0x2f64('0x86')](_[_0x2f64('0x2c')](_0x306d22,function(_0x57c5ec){return _0x57c5ec[_0x2f64('0x123')](_0x2f64('0xaa'))===_0x2f64('0x116');}),function(_0x302bed){return db[_0x2f64('0xae')][_0x2f64('0xf9')]({'membername':_0x3cf452['name'],'UserId':_0x3cf452['id'],'queue_name':_0x302bed[_0x2f64('0x32')],'VoiceQueueId':_0x302bed['id'],'interface':_[_0x2f64('0x61')](_0x3cf452[_0x2f64('0x9c')])?util[_0x2f64('0xed')]('SIP/%s',_0x3cf452[_0x2f64('0x32')]):_0x3cf452['interface'],'paused':_0x3cf452[_0x2f64('0x9b')]||![],'penalty':_0x3cf452[_0x2f64('0xa2')]},{'transaction':_0x177479});});}else{return;}})[_0x2f64('0x12')](function(){for(var _0x3d4f94=0x0;_0x3d4f94<_0x306d22[_0x2f64('0x45')];_0x3d4f94++){var _0xabfc34=_0x306d22[_0x3d4f94]['getDataValue'](_0x2f64('0xaa'));var _0x10a258=_0xabfc34+_0x2f64('0xa4');socket['emit'](_0x2f64('0x28')+_0xabfc34+'Queue:save',{'UserId':_0x3cf452['id'],['queueField']:_0x306d22[_0x3d4f94]['id']});}});});})[_0x2f64('0x12')](function(){db[_0x2f64('0x124')][_0x2f64('0xc7')]({'where':{'teamId':_0x4db3b7['id']}})['then'](function(_0x38f93d){if(_0x38f93d){db[_0x2f64('0x125')][_0x2f64('0x79')]({'UserId':_0x233b9e['params']['id'],'VoicePrefixId':_0x38f93d[_0x2f64('0x126')]});}});});}});}})[_0x2f64('0x12')](respondWithStatusCode(_0x1518b1,null))[_0x2f64('0x57')](handleError(_0x1518b1,null));};exports[_0x2f64('0x127')]=function(_0x21c4c1,_0x2d33dc){return db[_0x2f64('0x35')]['findOne']({'where':{'id':_0x21c4c1[_0x2f64('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2d33dc,null))[_0x2f64('0x12')](function(_0xad1d99){if(_0xad1d99){var _0x1e6d89=_0xad1d99[_0x2f64('0x24')]({'plain':!![]});var _0x544729=_0x21c4c1['query'][_0x2f64('0x5b')];return _0xad1d99['removeTeams'](_0x544729)[_0x2f64('0x12')](function(){for(var _0x247ed8=0x0;_0x247ed8<_0x544729[_0x2f64('0x45')];_0x247ed8++){var _0xde6074=[];var _0x399310={};db['Team'][_0x2f64('0xc7')]({'where':{'id':_0x544729[_0x247ed8]}})[_0x2f64('0x12')](function(_0x20e579){_0x399310=_0x20e579[_0x2f64('0x49')];_0xde6074['push'](_0x20e579['getVoiceQueues']()[_0x2f64('0x12')](function(_0x219dc6){for(var _0x226f12=0x0;_0x226f12<_0x219dc6[_0x2f64('0x45')];_0x226f12++){_0x219dc6[_0x226f12][_0x2f64('0x115')](_0x2f64('0xaa'),_0x2f64('0x116'));}return _0x219dc6;}));_0xde6074[_0x2f64('0x42')](_0x20e579[_0x2f64('0x117')]()['then'](function(_0x5ef164){for(var _0x238000=0x0;_0x238000<_0x5ef164[_0x2f64('0x45')];_0x238000++){_0x5ef164[_0x238000]['setDataValue'](_0x2f64('0xaa'),_0x2f64('0x118'));}return _0x5ef164;}));_0xde6074['push'](_0x20e579[_0x2f64('0x119')]()[_0x2f64('0x12')](function(_0x4961f0){for(var _0x1d2bd9=0x0;_0x1d2bd9<_0x4961f0[_0x2f64('0x45')];_0x1d2bd9++){_0x4961f0[_0x1d2bd9]['setDataValue'](_0x2f64('0xaa'),_0x2f64('0x11a'));}return _0x4961f0;}));_0xde6074[_0x2f64('0x42')](_0x20e579[_0x2f64('0x11b')]()[_0x2f64('0x12')](function(_0x1122ce){for(var _0x907a4c=0x0;_0x907a4c<_0x1122ce['length'];_0x907a4c++){_0x1122ce[_0x907a4c][_0x2f64('0x115')](_0x2f64('0xaa'),_0x2f64('0x128'));}return _0x1122ce;}));_0xde6074['push'](_0x20e579['getWhatsappQueues']()['then'](function(_0x3bd74d){for(var _0x5a6d55=0x0;_0x5a6d55<_0x3bd74d[_0x2f64('0x45')];_0x5a6d55++){_0x3bd74d[_0x5a6d55][_0x2f64('0x115')]('channel',_0x2f64('0x11d'));}return _0x3bd74d;}));_0xde6074[_0x2f64('0x42')](_0x20e579[_0x2f64('0x11e')]()[_0x2f64('0x12')](function(_0x2bed00){for(var _0x12fb44=0x0;_0x12fb44<_0x2bed00[_0x2f64('0x45')];_0x12fb44++){_0x2bed00[_0x12fb44][_0x2f64('0x115')](_0x2f64('0xaa'),_0x2f64('0x129'));}return _0x2bed00;}));_0xde6074[_0x2f64('0x42')](_0x20e579['getOpenchannelQueues']()[_0x2f64('0x12')](function(_0x100cf8){for(var _0x4d2e3c=0x0;_0x4d2e3c<_0x100cf8['length'];_0x4d2e3c++){_0x100cf8[_0x4d2e3c][_0x2f64('0x115')](_0x2f64('0xaa'),'Openchannel');}return _0x100cf8;}));return BPromise[_0x2f64('0x4c')](_0xde6074);})[_0x2f64('0x12')](function(_0x4ba039){var _0x1b252f=_[_0x2f64('0x121')](_0x4ba039);_0xde6074=[];return db[_0x2f64('0x63')]['transaction'](function(_0x22b596){for(var _0x37b8d0=0x0;_0x37b8d0<_0x1b252f['length'];_0x37b8d0++){_0xde6074[_0x2f64('0x42')](_0x1b252f[_0x37b8d0]['removeAgent'](_0x1e6d89['id']),{'transaction':_0x22b596});}return BPromise[_0x2f64('0x4c')](_0xde6074)[_0x2f64('0x12')](function(){if(_0x1e6d89[_0x2f64('0x99')]){return BPromise[_0x2f64('0x86')](_['filter'](_0x1b252f,function(_0x352510){return _0x352510['getDataValue'](_0x2f64('0xaa'))==='Voice';}),function(_0x2b51a7){return db[_0x2f64('0xae')][_0x2f64('0x33')]({'where':{'VoiceQueueId':_0x2b51a7['id'],'UserId':_0x1e6d89['id']},'transaction':_0x22b596});});}else{return;}})['then'](function(){db[_0x2f64('0x124')]['findOne']({'where':{'teamId':_0x399310['id']}})[_0x2f64('0x12')](function(_0x32affb){if(_0x32affb){return db[_0x2f64('0x125')][_0x2f64('0x33')]({'where':{'UserId':_0x1e6d89['id'],'VoicePrefixId':_0x32affb[_0x2f64('0x49')][_0x2f64('0x126')]}});}});})[_0x2f64('0x12')](function(){for(var _0x417895=0x0;_0x417895<_0x1b252f[_0x2f64('0x45')];_0x417895++){var _0x50d9b3=_0x1b252f[_0x417895][_0x2f64('0x123')](_0x2f64('0xaa'));var _0x261de1=_0x50d9b3+_0x2f64('0xa4');socket[_0x2f64('0xa5')]('user'+_0x50d9b3+_0x2f64('0xad'),{'UserId':_0x1e6d89['id'],['queueField']:_0x1b252f[_0x417895]['id']});}});});});}});}})[_0x2f64('0x12')](respondWithStatusCode(_0x2d33dc,null))[_0x2f64('0x57')](handleError(_0x2d33dc,null));};exports[_0x2f64('0x12a')]=function(_0x3df481,_0x55ee2a){var _0x20e74c={};var _0x3f4ac7={};var _0x57a907;var _0xd4d156;return db[_0x2f64('0x35')][_0x2f64('0xc7')]({'where':{'id':_0x3df481['params']['id']}})[_0x2f64('0x12')](handleEntityNotFound(_0x55ee2a,null))['then'](function(_0x2c8f42){if(_0x2c8f42){_0x57a907=_0x2c8f42;_0x3f4ac7[_0x2f64('0x4f')]=_[_0x2f64('0x50')](db['CmList'][_0x2f64('0xd8')]);_0x3f4ac7[_0x2f64('0x3c')]=_['keys'](_0x3df481[_0x2f64('0x3c')]);_0x3f4ac7[_0x2f64('0x51')]=_[_0x2f64('0x52')](_0x3f4ac7[_0x2f64('0x4f')],_0x3f4ac7['query']);_0x20e74c[_0x2f64('0x41')]=_[_0x2f64('0x52')](_0x3f4ac7[_0x2f64('0x4f')],qs[_0x2f64('0x53')](_0x3df481[_0x2f64('0x3c')][_0x2f64('0x53')]));_0x20e74c['attributes']=_0x20e74c[_0x2f64('0x41')][_0x2f64('0x45')]?_0x20e74c[_0x2f64('0x41')]:_0x3f4ac7[_0x2f64('0x4f')];_0x20e74c[_0x2f64('0xc9')]=qs[_0x2f64('0xca')](_0x3df481[_0x2f64('0x3c')][_0x2f64('0xca')]);_0x20e74c[_0x2f64('0xcb')]=qs[_0x2f64('0x51')](_[_0x2f64('0xcc')](_0x3df481[_0x2f64('0x3c')],_0x3f4ac7[_0x2f64('0x51')]));if(_0x3df481[_0x2f64('0x3c')][_0x2f64('0x2c')]){_0x20e74c[_0x2f64('0xcb')]=_['merge'](_0x20e74c[_0x2f64('0xcb')],{'$or':_[_0x2f64('0x2e')](_0x20e74c[_0x2f64('0x41')],function(_0x1379a2){var _0x2a97a6={};_0x2a97a6[_0x1379a2]={'$like':'%'+_0x3df481[_0x2f64('0x3c')]['filter']+'%'};return _0x2a97a6;})});}_0x20e74c=_[_0x2f64('0x55')]({},_0x20e74c,_0x3df481[_0x2f64('0xcd')]);return _0x57a907[_0x2f64('0x12a')](_0x20e74c);}})[_0x2f64('0x12')](function(_0x204ae2){if(_0x204ae2){_0xd4d156=_0x204ae2['length'];if(!_0x3df481['query']['hasOwnProperty'](_0x2f64('0xd4'))){_0x20e74c[_0x2f64('0x20')]=qs[_0x2f64('0x20')](_0x3df481[_0x2f64('0x3c')][_0x2f64('0x20')]);_0x20e74c[_0x2f64('0x1f')]=qs[_0x2f64('0x1f')](_0x3df481[_0x2f64('0x3c')]['offset']);}return _0x57a907[_0x2f64('0x12a')](_0x20e74c);}})[_0x2f64('0x12')](function(_0x4eaf52){if(_0x4eaf52){return _0x4eaf52?{'count':_0xd4d156,'rows':_0x4eaf52}:null;}})[_0x2f64('0x12')](respondWithResult(_0x55ee2a,null))[_0x2f64('0x57')](handleError(_0x55ee2a,null));};exports['getAgents']=function(_0x15d202,_0x3faf86){var _0x39f437={};var _0x2ad7d2={};var _0x59d3c2;return db['User']['findOne']({'where':{'id':_0x15d202[_0x2f64('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3faf86,null))['then'](function(_0x41b80a){if(_0x41b80a){_0x59d3c2=_0x41b80a;_0x2ad7d2['model']=_['keys'](db[_0x2f64('0x35')][_0x2f64('0xd8')]);_0x2ad7d2[_0x2f64('0x3c')]=_[_0x2f64('0x50')](_0x15d202['query']);_0x2ad7d2[_0x2f64('0x51')]=_[_0x2f64('0x52')](_0x2ad7d2[_0x2f64('0x4f')],_0x2ad7d2[_0x2f64('0x3c')]);_0x39f437[_0x2f64('0x41')]=_['intersection'](_0x2ad7d2['model'],qs[_0x2f64('0x53')](_0x15d202[_0x2f64('0x3c')][_0x2f64('0x53')]));_0x39f437[_0x2f64('0x41')]=_0x39f437[_0x2f64('0x41')][_0x2f64('0x45')]?_0x39f437['attributes']:_0x2ad7d2[_0x2f64('0x4f')];_0x39f437[_0x2f64('0xc9')]=qs['sort'](_0x15d202[_0x2f64('0x3c')][_0x2f64('0xca')]);_0x39f437[_0x2f64('0xcb')]=qs[_0x2f64('0x51')](_[_0x2f64('0xcc')](_0x15d202['query'],_0x2ad7d2[_0x2f64('0x51')]));if(_0x15d202[_0x2f64('0x3c')][_0x2f64('0x2c')]){_0x39f437[_0x2f64('0xcb')]=_[_0x2f64('0x55')](_0x39f437[_0x2f64('0xcb')],{'$or':_[_0x2f64('0x2e')](_0x39f437[_0x2f64('0x41')],function(_0x5e9020){var _0x1a7fe4={};_0x1a7fe4[_0x5e9020]={'$like':'%'+_0x15d202[_0x2f64('0x3c')][_0x2f64('0x2c')]+'%'};return _0x1a7fe4;})});}_0x39f437[_0x2f64('0x4f')]=db['User'];_0x39f437['as']=_0x2f64('0x29');_0x39f437=_[_0x2f64('0x55')]({},_0x39f437,_0x15d202['options']);return _0x59d3c2['getVoiceQueues']({'include':[_0x39f437]});}})[_0x2f64('0x12')](function(_0x1ab470){if(_0x1ab470){var _0x1bd149={},_0x1a88cd=[];for(var _0x26dda4=0x0;_0x26dda4<_0x1ab470[_0x2f64('0x45')];_0x26dda4+=0x1){for(var _0x4aefb9=0x0,_0x5d22f2;_0x4aefb9<_0x1ab470[_0x26dda4][_0x2f64('0x29')][_0x2f64('0x45')];_0x4aefb9+=0x1){_0x5d22f2=_0x1ab470[_0x26dda4]['Agents'][_0x4aefb9][_0x2f64('0x24')]({'plain':!![]});_0x1bd149[_0x5d22f2['id']]=_0x5d22f2;}}_0x1bd149=_[_0x2f64('0x12b')](_0x1bd149);for(var _0x87d8b9=qs[_0x2f64('0x1f')](_0x15d202['query'][_0x2f64('0x1f')]);_0x87d8b9<_0x1bd149['length']&&_0x1a88cd[_0x2f64('0x45')]=_0x9986e9){_0xb7e057=_0x9986e9;_0x24b64c=0xc8;}else{_0x24b64c=0xce;}_0x435ac3[_0xa56e('0x1d')](_0x24b64c);return _0x435ac3[_0xa56e('0x24')]('Content-Range',_0x2eb742+'-'+_0xb7e057+'/'+_0x9986e9)[_0xa56e('0x1f')](_0x35f51d);}return null;};}function saveUpdates(_0x236fbf){return function(_0x3fcf18){if(_0x3fcf18){return _0x3fcf18['update'](_0x236fbf)['then'](function(_0x33f5dd){return _0x33f5dd;});}return null;};}function removeEntity(_0xe7b5bd){return function(_0x4b37ff){if(_0x4b37ff){return _0x4b37ff[_0xa56e('0x25')]()[_0xa56e('0x12')](function(){var _0x2dbaa2=_0x4b37ff['get']({'plain':!![]});if(_0x2dbaa2[_0xa56e('0x26')]===_0xa56e('0x27'))return;var _0x3cc215=[{'name':_0xa56e('0x28'),'value':_0xa56e('0x29'),'ignore':!![]},{'name':_0xa56e('0x2a'),'value':_0xa56e('0x2b'),'ignore':![]},{'name':_0xa56e('0x2c'),'value':'telephone','ignore':![]}];var _0xf54c1f=_(_0x3cc215)[_0xa56e('0x2d')](_0xa56e('0x2e'))['map'](_0xa56e('0x2f'))['value']();if(_[_0xa56e('0x30')](_0xf54c1f,_0x2dbaa2[_0xa56e('0x26')])){return;}var _0x26744e=_[_0xa56e('0x31')](_0x3cc215,[_0xa56e('0x2f'),_0x2dbaa2['role']])['name'];return db[_0xa56e('0x32')][_0xa56e('0x25')]({'where':{'type':_0x26744e,'resourceId':_0x2dbaa2['id']}})[_0xa56e('0x12')](function(){return _0x4b37ff;});})[_0xa56e('0x12')](function(){_0xe7b5bd['status'](0xcc)[_0xa56e('0x1e')]();});}};}function handleEntityNotFound(_0x37cd08){return function(_0x2eadd3){if(!_0x2eadd3){_0x37cd08['sendStatus'](0x194);}return _0x2eadd3;};}function handleError(_0x154e96,_0x50fba5){_0x50fba5=_0x50fba5||0x1f4;return function(_0x349ea8){logger[_0xa56e('0x18')](_0x349ea8[_0xa56e('0x33')]);if(_0x349ea8[_0xa56e('0x34')]){delete _0x349ea8['name'];}_0x154e96['status'](_0x50fba5)[_0xa56e('0x35')](_0x349ea8);};}exports[_0xa56e('0x36')]=function(_0x5cb731,_0x43fd08){var _0x25a6d9={},_0x52d93e={'count':0x0,'rows':[]};var _0x49ef40=_(db[_0xa56e('0x37')][_0xa56e('0x38')])[_0xa56e('0x39')](function(_0x3f24cc){return{'name':_0x3f24cc['fieldName'],'type':_0x3f24cc['type'][_0xa56e('0x3a')]};})[_0xa56e('0x2d')](function(_0x4b8729){return!_[_0xa56e('0x30')](['password','salt'],_0x4b8729[_0xa56e('0x34')]);})[_0xa56e('0x2f')]();_0x25a6d9=qs['getOptions'](_0x49ef40,_0x5cb731);var _0x1dab15={'where':_0x25a6d9[_0xa56e('0x3b')]};return db[_0xa56e('0x37')][_0xa56e('0x23')](_0x1dab15)[_0xa56e('0x12')](function(_0x1313bf){_0x52d93e[_0xa56e('0x23')]=_0x1313bf;if(_0x5cb731[_0xa56e('0x3c')][_0xa56e('0x3d')]){_0x25a6d9[_0xa56e('0x3e')]=[{'all':!![]}];}if(_0x5cb731[_0xa56e('0x3c')]['userSetting']==='true'){_0x25a6d9[_0xa56e('0x3e')]=[{'model':db[_0xa56e('0x3f')],'as':_0xa56e('0x40')}];}if(!_['includes'](_0x25a6d9['attributes'],'id')){_0x25a6d9[_0xa56e('0x41')]['push']('id');}return db[_0xa56e('0x37')][_0xa56e('0x42')](_0x25a6d9);})[_0xa56e('0x12')](function(_0x1e1d3b){_0x52d93e[_0xa56e('0x43')]=_0x1e1d3b;if(_0x5cb731[_0xa56e('0x3c')]['openTabs']===_0xa56e('0x44')){var _0x565269=[];for(var _0x3c7a5d=0x0;_0x3c7a5d<_0x52d93e['rows'][_0xa56e('0x45')];_0x3c7a5d++){_0x565269[_0xa56e('0x46')](get_open_tabs(_0xa56e('0x47'),_0x52d93e[_0xa56e('0x43')][_0x3c7a5d][_0xa56e('0x48')]));_0x565269['push'](get_open_tabs(_0xa56e('0x49'),_0x52d93e[_0xa56e('0x43')][_0x3c7a5d]['dataValues']));_0x565269['push'](get_open_tabs('fax',_0x52d93e[_0xa56e('0x43')][_0x3c7a5d]['dataValues']));_0x565269['push'](get_open_tabs(_0xa56e('0x4a'),_0x52d93e[_0xa56e('0x43')][_0x3c7a5d]['dataValues']));_0x565269[_0xa56e('0x46')](get_open_tabs('openchannel',_0x52d93e['rows'][_0x3c7a5d]['dataValues']));_0x565269['push'](get_open_tabs('whatsapp',_0x52d93e[_0xa56e('0x43')][_0x3c7a5d][_0xa56e('0x48')]));}return BPromise['all'](_0x565269)[_0xa56e('0x12')](function(){return _0x52d93e;});}else{return _0x52d93e;}})[_0xa56e('0x12')](respondWithFilteredResult(_0x43fd08,_0x25a6d9))[_0xa56e('0x4b')](handleError(_0x43fd08,null));};exports[_0xa56e('0x4c')]=function(_0x4ab6ee,_0x4682e8){var _0x326219={'raw':![],'where':{'id':_0x4ab6ee[_0xa56e('0x4d')]['id']}},_0x27c010={};_0x27c010['model']=_[_0xa56e('0x4e')](_[_0xa56e('0x4f')](db[_0xa56e('0x37')][_0xa56e('0x38')]),[_0xa56e('0x50'),'salt']);_0x27c010['query']=_[_0xa56e('0x4f')](_0x4ab6ee[_0xa56e('0x3c')]);_0x27c010[_0xa56e('0x51')]=_[_0xa56e('0x52')](_0x27c010['model'],_0x27c010['query']);_0x326219[_0xa56e('0x41')]=_[_0xa56e('0x52')](_0x27c010[_0xa56e('0x53')],qs[_0xa56e('0x54')](_0x4ab6ee['query'][_0xa56e('0x54')]));_0x326219[_0xa56e('0x41')]=_0x326219[_0xa56e('0x41')][_0xa56e('0x45')]?_0x326219[_0xa56e('0x41')]:_0x27c010[_0xa56e('0x53')];if(_0x4ab6ee[_0xa56e('0x3c')][_0xa56e('0x3d')]){_0x326219['include']=[{'all':!![]}];}if(_0x4ab6ee[_0xa56e('0x3c')][_0xa56e('0x40')]===_0xa56e('0x44')){_0x326219[_0xa56e('0x3e')]=[{'model':db[_0xa56e('0x3f')],'as':'userSetting'}];}_0x326219=_[_0xa56e('0x55')]({},_0x326219,_0x4ab6ee['options']);if(!_[_0xa56e('0x30')](_0x326219[_0xa56e('0x41')],'id')){_0x326219[_0xa56e('0x41')][_0xa56e('0x46')]('id');}return db[_0xa56e('0x37')][_0xa56e('0x31')](_0x326219)['then'](handleEntityNotFound(_0x4682e8,null))['then'](function(_0x495bc1){var _0x4da629=[];values=_0x495bc1;if(_0x4ab6ee[_0xa56e('0x3c')][_0xa56e('0x56')]===_0xa56e('0x44')){_0x4da629[_0xa56e('0x46')](get_open_tabs(_0xa56e('0x47'),_0x495bc1['dataValues']));_0x4da629[_0xa56e('0x46')](get_open_tabs(_0xa56e('0x49'),_0x495bc1['dataValues']));_0x4da629[_0xa56e('0x46')](get_open_tabs(_0xa56e('0x57'),_0x495bc1['dataValues']));_0x4da629[_0xa56e('0x46')](get_open_tabs(_0xa56e('0x58'),_0x495bc1[_0xa56e('0x48')]));_0x4da629[_0xa56e('0x46')](get_open_tabs(_0xa56e('0x59'),_0x495bc1[_0xa56e('0x48')]));_0x4da629[_0xa56e('0x46')](get_open_tabs(_0xa56e('0x4a'),_0x495bc1[_0xa56e('0x48')]));return BPromise[_0xa56e('0x5a')](_0x4da629);}else{return values;}})[_0xa56e('0x12')](function(){return values;})['then'](respondWithResult(_0x4682e8,null))['catch'](handleError(_0x4682e8,null));};exports['update']=function(_0x4d6090,_0x2b6189){if(_0x4d6090[_0xa56e('0x5b')]['id']){delete _0x4d6090[_0xa56e('0x5b')]['id'];}delete _0x4d6090[_0xa56e('0x5b')]['role'];return db[_0xa56e('0x37')][_0xa56e('0x31')]({'where':{'id':_0x4d6090['params']['id']}})[_0xa56e('0x12')](handleEntityNotFound(_0x2b6189,null))[_0xa56e('0x12')](saveUpdates(_0x4d6090[_0xa56e('0x5b')],null))[_0xa56e('0x12')](respondWithResult(_0x2b6189,null))[_0xa56e('0x4b')](handleError(_0x2b6189,null));};exports['describe']=function(_0x4216f5,_0x28ad8d){return db['User']['describe']()[_0xa56e('0x12')](respondWithResult(_0x28ad8d,null))['catch'](handleError(_0x28ad8d,null));};exports[_0xa56e('0x5c')]=function(_0x1e5ffb,_0x2746c5){return db[_0xa56e('0x37')]['find']({'where':{'id':_0x1e5ffb[_0xa56e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2746c5,null))[_0xa56e('0x12')](function(_0x47f181){if(_0x47f181){return _0x47f181['addContacts'](_0x1e5ffb[_0xa56e('0x5b')]['ids'],_['omit'](_0x1e5ffb[_0xa56e('0x5b')],[_0xa56e('0x5d'),'id'])||{});}})[_0xa56e('0x12')](respondWithResult(_0x2746c5,null))[_0xa56e('0x4b')](handleError(_0x2746c5,null));};function validateUser(_0x437856){return new BPromise(function(_0x2d3ce6,_0x23564b){if(_0x437856[_0xa56e('0x5e')])return _0x2d3ce6(_0x437856);return db[_0xa56e('0x5f')][_0xa56e('0x60')](0x1)[_0xa56e('0x12')](function(_0x1f318f){if(_0x1f318f[_0xa56e('0x61')])authService[_0xa56e('0x62')](_0x437856['password']);db[_0xa56e('0x37')][_0xa56e('0x63')]('internal')[_0xa56e('0x12')](function(_0x4b132b){if(_['isNil'](_0x4b132b)){_0x437856['internal']=_0x1f318f[_0xa56e('0x64')]||0x1;return;}if(_[_0xa56e('0x65')](_0x1f318f[_0xa56e('0x64')])||_0x1f318f[_0xa56e('0x64')]===_0x4b132b){_0x437856[_0xa56e('0x5e')]=_0x4b132b+0x1;return;}if(_0x1f318f['min_internal']>_0x4b132b){_0x437856[_0xa56e('0x5e')]=_0x1f318f[_0xa56e('0x64')];return;}return db[_0xa56e('0x66')][_0xa56e('0x3c')](_0xa56e('0x67'),{'type':db[_0xa56e('0x66')]['QueryTypes'][_0xa56e('0x68')]})[_0xa56e('0x12')](function(_0x36fa77){if(_0x36fa77&&_0x36fa77[_0xa56e('0x45')]){for(var _0x89d3e6=0x0,_0x127dbc=_0x36fa77[_0xa56e('0x45')];_0x89d3e6<_0x127dbc&&_[_0xa56e('0x65')](_0x437856[_0xa56e('0x5e')]);_0x89d3e6++){if(_0x1f318f[_0xa56e('0x64')]<=_0x36fa77[_0x89d3e6][_0xa56e('0x69')]){_0x437856['internal']=_0x36fa77[_0x89d3e6]['from'];}else if(_0x1f318f[_0xa56e('0x64')]>_0x36fa77[_0x89d3e6][_0xa56e('0x69')]&&_0x1f318f[_0xa56e('0x64')]<=_0x36fa77[_0x89d3e6]['to']){_0x437856[_0xa56e('0x5e')]=_0x1f318f[_0xa56e('0x64')];}}}if(_['isNil'](_0x437856['internal'])){_0x437856['internal']=_0x4b132b+0x1;}return _0x2d3ce6(_0x437856);});});})[_0xa56e('0x4b')](function(_0x428333){_0x23564b(_0x428333);});});}function updateUser(_0x202a64){return new BPromise(function(_0x1cd5b3,_0x212efe){try{if(_0x202a64[_0xa56e('0x6a')]){_0x202a64['mailbox']=_0x202a64[_0xa56e('0x5e')];_0x202a64['VoiceMail']={'mailbox':_0x202a64[_0xa56e('0x5e')],'password':_0x202a64[_0xa56e('0x50')],'fullname':_0x202a64['fullname'],'email':_0x202a64[_0xa56e('0x6b')]};}if(_0x202a64['role']===_0xa56e('0x2b')){if(!_0x202a64['permissions'])_0x202a64[_0xa56e('0x6c')]=[_0xa56e('0x6d'),'102',_0xa56e('0x6e'),_0xa56e('0x6f'),_0xa56e('0x70'),_0xa56e('0x71'),_0xa56e('0x72'),_0xa56e('0x73'),_0xa56e('0x74'),_0xa56e('0x75'),_0xa56e('0x76'),_0xa56e('0x77'),'111',_0xa56e('0x78'),_0xa56e('0x79')];}_0x1cd5b3(_0x202a64);}catch(_0x413907){_0x212efe(_0x413907);}});}exports[_0xa56e('0x7a')]=function(_0x40bc1e,_0x3c36a2){if(_0x40bc1e['user']['role']===_0xa56e('0x2b'))throw new Error('Unauthorized');if(_0x40bc1e[_0xa56e('0x5b')][_0xa56e('0x26')]==='user'&&_0x40bc1e[_0xa56e('0x29')]['role']!==_0xa56e('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x40bc1e['body'][_0xa56e('0x26')]===_0xa56e('0x27')&&_0x40bc1e[_0xa56e('0x29')][_0xa56e('0x26')]!=='admin'){throw new Error(_0xa56e('0x7b'));}return licenseUtil[_0xa56e('0x7c')]([_0x40bc1e[_0xa56e('0x5b')]])[_0xa56e('0x12')](function(){return validateUser(_0x40bc1e['body']);})[_0xa56e('0x12')](function(_0x18fd22){return updateUser(_0x18fd22)[_0xa56e('0x12')](function(_0x137053){if(_0x137053[_0xa56e('0x26')]===_0xa56e('0x27')){_0x137053['settingsEnabled']=_0x40bc1e[_0xa56e('0x29')][_0xa56e('0x7d')];delete _0x137053[_0xa56e('0x7e')];}return _0x137053;});})[_0xa56e('0x12')](function(_0x211d5f){return db[_0xa56e('0x37')][_0xa56e('0x7a')](_0x211d5f,{'include':[{'model':db[_0xa56e('0x7f')],'as':_0xa56e('0x7f')}]});})[_0xa56e('0x12')](function(_0x3c912b){if(_0x40bc1e[_0xa56e('0x5b')][_0xa56e('0x26')]==='user')return _0x3c912b;if(_0x40bc1e['user'][_0xa56e('0x26')]!==_0xa56e('0x29'))return _0x3c912b;return db[_0xa56e('0x80')][_0xa56e('0x31')]({'where':{'name':_0x3c912b[_0xa56e('0x26')]==='agent'?_0xa56e('0x2a'):'Telephones','userProfileId':_0x40bc1e['user'][_0xa56e('0x7e')]},'raw':!![]})['then'](function(_0xcd457e){if(!_0xcd457e||_0xcd457e[_0xa56e('0x81')]!=0x0)return _0x3c912b;return db['UserProfileResource'][_0xa56e('0x7a')]({'name':_0x3c912b[_0xa56e('0x34')],'resourceId':_0x3c912b['id'],'type':_0xcd457e['name'],'sectionId':_0xcd457e['id']},{})[_0xa56e('0x12')](function(){return _0x3c912b;});})[_0xa56e('0x4b')](function(_0x14f5e4){logger[_0xa56e('0x18')](_0xa56e('0x82'),_0x14f5e4);throw _0x14f5e4;});})[_0xa56e('0x12')](respondWithResult(_0x3c36a2,0xc9))['catch'](handleError(_0x3c36a2,null));};exports[_0xa56e('0x83')]=function(_0x6c45c9,_0x125d34){var _0x47629e=_0x6c45c9['body'];var _0x291168=[];if(_0x6c45c9[_0xa56e('0x29')]['role']==='agent')throw new Error(_0xa56e('0x84'));if(_[_0xa56e('0x85')](_0x47629e,[_0xa56e('0x26'),_0xa56e('0x29')])&&_0x6c45c9[_0xa56e('0x29')][_0xa56e('0x26')]!==_0xa56e('0x27')){throw new Error(_0xa56e('0x86'));}if(_[_0xa56e('0x85')](_0x47629e,[_0xa56e('0x26'),_0xa56e('0x27')])&&_0x6c45c9[_0xa56e('0x29')][_0xa56e('0x26')]!=='admin'){throw new Error(_0xa56e('0x87'));}return licenseUtil[_0xa56e('0x7c')](_0x47629e)[_0xa56e('0x12')](function(){return validateUser(_0x47629e[0x0]);})[_0xa56e('0x12')](function(){for(var _0x39416b=0x1;_0x39416b<_0x47629e[_0xa56e('0x45')];_0x39416b++){var _0x3e421b=_0x47629e[_0x39416b-0x1][_0xa56e('0x5e')];if(!_0x47629e[_0x39416b]['internal'])_0x47629e[_0x39416b][_0xa56e('0x5e')]=_0x3e421b+0x1;_0x291168['push'](validateUser(_0x47629e[_0x39416b]));}return BPromise[_0xa56e('0x5a')](_0x291168);})[_0xa56e('0x12')](function(){_0x291168=[];for(var _0x5545e2=0x0;_0x5545e2<_0x47629e[_0xa56e('0x45')];_0x5545e2++){_0x291168[_0xa56e('0x46')](updateUser(_0x47629e[_0x5545e2]));}return BPromise[_0xa56e('0x5a')](_0x291168);})[_0xa56e('0x12')](function(){return BPromise[_0xa56e('0x88')](_0x47629e,function(_0x206097){return db[_0xa56e('0x37')][_0xa56e('0x7a')](_0x206097,{'include':[{'model':db[_0xa56e('0x7f')],'as':'VoiceMail'}]})[_0xa56e('0x12')](function(_0x3904bc){_0x206097['id']=_0x3904bc['id'];return _0x206097;});});})[_0xa56e('0x12')](function(_0x4909ff){if(_0x6c45c9[_0xa56e('0x5b')][_0xa56e('0x26')]===_0xa56e('0x29'))return _0x4909ff;if(_0x6c45c9[_0xa56e('0x29')][_0xa56e('0x26')]!=='user')return _0x4909ff;var _0x3cb42e=_[_0xa56e('0x85')](_0x4909ff,function(_0x21dc9b){return _0x21dc9b[_0xa56e('0x26')]==='agent'||_0x21dc9b[_0xa56e('0x26')]===_0xa56e('0x89');});if(!_0x3cb42e)return _0x4909ff;return db['UserProfileSection'][_0xa56e('0x42')]({'where':{'name':{'$or':['Agents',_0xa56e('0x2c')]},'userProfileId':_0x6c45c9[_0xa56e('0x29')][_0xa56e('0x7e')]},'raw':!![]})[_0xa56e('0x12')](function(_0x47cf1e){if(_[_0xa56e('0x8a')](_0x47cf1e)||!_[_0xa56e('0x85')](_0x47cf1e,[_0xa56e('0x81'),0x0]))return _0x4909ff;_0x291168=[];var _0x278216=_(_0x47cf1e)['map'](function(_0x1df810){if(_0x1df810[_0xa56e('0x81')]===0x1)return;return _0x1df810[_0xa56e('0x34')]==='Agents'?_0xa56e('0x2b'):_0xa56e('0x89');})[_0xa56e('0x8b')]()[_0xa56e('0x2f')]();for(var _0x343f2a=0x0;_0x343f2a<_0x4909ff['length'];_0x343f2a++){if(!_[_0xa56e('0x30')](_0x278216,_0x4909ff[_0x343f2a][_0xa56e('0x26')]))return;var _0x30f7db=_0x4909ff[_0x343f2a][_0xa56e('0x26')]===_0xa56e('0x2b')?_0xa56e('0x2a'):_0xa56e('0x2c');_0x291168[_0xa56e('0x46')](db[_0xa56e('0x32')][_0xa56e('0x7a')]({'name':_0x4909ff[_0x343f2a][_0xa56e('0x34')],'resourceId':_0x4909ff[_0x343f2a]['id'],'type':_0x30f7db,'sectionId':_['find'](_0x47cf1e,[_0xa56e('0x34'),_0x30f7db])['id']},{}));}return BPromise[_0xa56e('0x5a')](_0x291168);});})[_0xa56e('0x12')](respondWithResult(_0x125d34,0xc9))[_0xa56e('0x4b')](handleError(_0x125d34,null));};exports[_0xa56e('0x8c')]=function(_0xe223d,_0x3f2f30){if(_0xe223d[_0xa56e('0x5b')]['id']){delete _0xe223d[_0xa56e('0x5b')]['id'];}return db[_0xa56e('0x37')][_0xa56e('0x31')]({'where':{'id':_0xe223d[_0xa56e('0x4d')]['id']}})[_0xa56e('0x12')](function(_0x4de9b8){if(!_0x4de9b8)return null;if(_0x4de9b8['id']===_0xe223d[_0xa56e('0x29')]['id']){if(!_0xe223d['body']['oldPassword']||!_0xe223d[_0xa56e('0x5b')][_0xa56e('0x8d')]){throw new db['Sequelize'][(_0xa56e('0x8e'))](_0xa56e('0x8f'));}if(!_0x4de9b8[_0xa56e('0x90')](_0xe223d[_0xa56e('0x5b')][_0xa56e('0x91')])){throw new db[(_0xa56e('0x92'))][(_0xa56e('0x8e'))](_0xa56e('0x93'));}if(_0xe223d['body'][_0xa56e('0x91')]===_0xe223d[_0xa56e('0x5b')][_0xa56e('0x8d')]){throw new db[(_0xa56e('0x92'))]['ValidationError']('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0xe223d[_0xa56e('0x29')][_0xa56e('0x26')]===_0xa56e('0x27')){if(!_0xe223d['body'][_0xa56e('0x8d')]){throw new db[(_0xa56e('0x92'))]['ValidationError'](_0xa56e('0x94'));}}else if(_0xe223d[_0xa56e('0x29')][_0xa56e('0x26')]===_0xa56e('0x29')){if(!_0xe223d[_0xa56e('0x5b')][_0xa56e('0x8d')]){throw new db['Sequelize']['ValidationError'](_0xa56e('0x94'));}if(_0x4de9b8[_0xa56e('0x26')]!==_0xa56e('0x2b')){throw new db[(_0xa56e('0x92'))][(_0xa56e('0x8e'))](_0xa56e('0x84'));}}else{throw new db['Sequelize'][(_0xa56e('0x8e'))]('Unauthorized');}return _0x4de9b8;})[_0xa56e('0x12')](handleEntityNotFound(_0x3f2f30,null))['then'](function(_0x2663f1){return db['Setting'][_0xa56e('0x95')]({'attributes':['id',_0xa56e('0x61'),_0xa56e('0x96'),_0xa56e('0x97')]})['then'](function(_0x4511dc){if(_0x4511dc[_0xa56e('0x61')])authService[_0xa56e('0x62')](_0xe223d[_0xa56e('0x5b')][_0xa56e('0x8d')]);if(!_0x4511dc[_0xa56e('0x96')]||!_0x2663f1[_0xa56e('0x98')])return _0x2663f1;authService[_0xa56e('0x99')](_0xe223d[_0xa56e('0x5b')][_0xa56e('0x8d')],_0x2663f1['previousPasswords'],_0x4511dc[_0xa56e('0x97')]);return _0x2663f1;})[_0xa56e('0x12')](saveUpdates({'password':_0xe223d['body'][_0xa56e('0x8d')],'passwordResetAt':_0xe223d[_0xa56e('0x29')]['id']==_0xe223d[_0xa56e('0x4d')]['id']?moment():null,'previousPasswords':authService[_0xa56e('0x9a')](_0xe223d['body']['newPassword'],_0x2663f1[_0xa56e('0x98')])},null));})[_0xa56e('0x12')](respondWithResult(_0x3f2f30,null))[_0xa56e('0x4b')](handleError(_0x3f2f30,null));};exports[_0xa56e('0x9b')]=function(_0x3e1a97,_0x445aee){var _0x3d10f7=_0x3e1a97['body'][_0xa56e('0x9c')];return db[_0xa56e('0x37')][_0xa56e('0x31')]({'where':{'id':_0x3e1a97['params']['id']},'attributes':['id',_0xa56e('0x34'),_0xa56e('0x26'),_0xa56e('0x9d'),_0xa56e('0x9e'),_0xa56e('0x9f'),_0xa56e('0xa0')]})[_0xa56e('0x12')](handleEntityNotFound(_0x445aee,null))[_0xa56e('0x12')](function(_0x2c0298){if(_0x2c0298){if(!utils[_0xa56e('0xa1')](_0x3d10f7)){throw new db[(_0xa56e('0x92'))][(_0xa56e('0x8e'))](_0xa56e('0xa2'));}return _0x2c0298[_0xa56e('0xa3')+_[_0xa56e('0xa4')](_0x3d10f7[_0xa56e('0xa5')]())+_0xa56e('0xa6')](_0x3e1a97['body'][_0xa56e('0x5d')],{'penalty':_0x3e1a97[_0xa56e('0x5b')][_0xa56e('0xa7')]||0x0})[_0xa56e('0xa8')](function(_0x2f15f7){for(var _0x2b7032=0x0;_0x2b7032<_0x3e1a97[_0xa56e('0x5b')][_0xa56e('0x5d')][_0xa56e('0x45')];_0x2b7032+=0x1){var _0x2a21d0={'UserId':Number(_0x3e1a97[_0xa56e('0x4d')]['id'])};_0x2a21d0[_['capitalize'](_0x3d10f7[_0xa56e('0xa5')]())+'QueueId']=Number(_0x3e1a97[_0xa56e('0x5b')][_0xa56e('0x5d')][_0x2b7032]);socket['emit'](_0xa56e('0x29')+_[_0xa56e('0xa4')](_0x3d10f7[_0xa56e('0xa5')]())+_0xa56e('0xa9'),_0x2a21d0);}return _0x2f15f7;})[_0xa56e('0x12')](function(){if(_0x3d10f7===_0xa56e('0xaa')){return db[_0xa56e('0xab')][_0xa56e('0x42')]({'where':{'id':_0x3e1a97[_0xa56e('0x5b')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0xa56e('0x12')](function(_0x35650b){var _0x2675f6=_0x2c0298[_0xa56e('0xac')]({'plain':!![]});var _0x2ada76=[];if(_0x3d10f7===_0xa56e('0xaa')&&_0x2675f6[_0xa56e('0x26')]===_0xa56e('0x2b')&&_0x2675f6[_0xa56e('0x9d')]){for(var _0x263ee5=0x0;_0x263ee5<_0x35650b['length'];_0x263ee5+=0x1){_0x2ada76[_0xa56e('0x46')]({'membername':_0x2675f6[_0xa56e('0x34')],'UserId':_0x2675f6['id'],'queue_name':_0x35650b[_0x263ee5]['name'],'VoiceQueueId':_0x35650b[_0x263ee5]['id'],'interface':_[_0xa56e('0x65')](_0x2675f6['interface'])?util[_0xa56e('0xad')](_0xa56e('0xae'),_0x2675f6[_0xa56e('0x34')]):_0x2675f6['interface'],'paused':_0x2675f6[_0xa56e('0x9f')]||![],'penalty':_0x3e1a97[_0xa56e('0x5b')][_0xa56e('0xa7')]||0x0});}return BPromise['each'](_0x2ada76,function(_0x3ec01b){return db[_0xa56e('0xaf')][_0xa56e('0xb0')](_0x3ec01b);});}return _0x2c0298;});}})['then'](respondWithStatusCode(_0x445aee,null))['catch'](handleError(_0x445aee,null));};exports[_0xa56e('0xb1')]=function(_0x148afb,_0x3251d2){var _0x516239,_0x388ac2;return db[_0xa56e('0x37')]['find']({'where':{'id':_0x148afb[_0xa56e('0x4d')]['id']},'attributes':['id',_0xa56e('0x34'),_0xa56e('0x26')]})['then'](handleEntityNotFound(_0x3251d2,null))[_0xa56e('0x12')](function(_0x468ec5){if(_0x468ec5){_0x516239=_0x468ec5;if(!_0x148afb[_0xa56e('0x3c')][_0xa56e('0x9c')]||!utils[_0xa56e('0xa1')](_0x148afb['query'][_0xa56e('0x9c')])){throw new db['Sequelize'][(_0xa56e('0x8e'))](_0xa56e('0xa2'));}return _0x468ec5[_0xa56e('0xb2')+_[_0xa56e('0xa4')](_0x148afb[_0xa56e('0x3c')][_0xa56e('0x9c')][_0xa56e('0xa5')]())+_0xa56e('0xa6')](_0x148afb[_0xa56e('0x3c')]['ids']);}})[_0xa56e('0x12')](function(_0x1e9e4d){if(_[_0xa56e('0xb3')](_0x148afb['query'][_0xa56e('0x5d')])){for(var _0x5f4f2b=0x0;_0x5f4f2b<_0x148afb['query']['ids'][_0xa56e('0x45')];_0x5f4f2b+=0x1){_0x388ac2={'UserId':Number(_0x148afb[_0xa56e('0x4d')]['id'])};_0x388ac2[_[_0xa56e('0xa4')](_0x148afb[_0xa56e('0x3c')]['channel'][_0xa56e('0xa5')]())+'QueueId']=Number(_0x148afb[_0xa56e('0x3c')][_0xa56e('0x5d')][_0x5f4f2b]);socket['emit'](_0xa56e('0x29')+_[_0xa56e('0xa4')](_0x148afb[_0xa56e('0x3c')][_0xa56e('0x9c')][_0xa56e('0xa5')]())+_0xa56e('0xb4'),_0x388ac2);}}else{_0x388ac2={'UserId':Number(_0x148afb[_0xa56e('0x4d')]['id'])};_0x388ac2[_['capitalize'](_0x148afb[_0xa56e('0x3c')]['channel'][_0xa56e('0xa5')]())+_0xa56e('0xb5')]=Number(_0x148afb[_0xa56e('0x3c')][_0xa56e('0x5d')]);socket[_0xa56e('0xb6')](_0xa56e('0x29')+_[_0xa56e('0xa4')](_0x148afb[_0xa56e('0x3c')][_0xa56e('0x9c')][_0xa56e('0xa5')]())+_0xa56e('0xb4'),_0x388ac2);}return _0x1e9e4d;})['then'](function(){if(_0x148afb[_0xa56e('0x3c')][_0xa56e('0x9c')]===_0xa56e('0xaa')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x148afb['params']['id'],'VoiceQueueId':_0x148afb[_0xa56e('0x3c')][_0xa56e('0x5d')]},'individualHooks':!![]})[_0xa56e('0x12')](function(){return _0x516239;});}return _0x516239;})[_0xa56e('0x12')](respondWithStatusCode(_0x3251d2,null))['catch'](handleError(_0x3251d2,null));};exports['addAvatar']=function(_0x1159c6,_0x89c830){_0x1159c6['body']['userpic']=_0x1159c6[_0xa56e('0xb7')][_0xa56e('0xb8')];return db[_0xa56e('0x37')][_0xa56e('0x31')]({'where':{'id':_0x1159c6['params']['id']}})[_0xa56e('0x12')](handleEntityNotFound(_0x89c830,null))[_0xa56e('0x12')](saveUpdates(_0x1159c6[_0xa56e('0x5b')],null))[_0xa56e('0x12')](respondWithResult(_0x89c830,null))[_0xa56e('0x4b')](handleError(_0x89c830,null));};exports['getAvatar']=function(_0x14a296,_0xe818d1){var _0x23a513=path[_0xa56e('0xb9')](config[_0xa56e('0xba')],_0xa56e('0xbb'));return db[_0xa56e('0x37')][_0xa56e('0x31')]({'where':{'id':_0x14a296['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0xa56e('0x12')](handleEntityNotFound(_0xe818d1,null))['then'](function(_0x428ad4){if(_0x428ad4){if(_['isNil'](_0x428ad4[_0xa56e('0xbc')])){return _0xe818d1[_0xa56e('0xbd')](_0x23a513);}else{if(!fs[_0xa56e('0xbe')](path[_0xa56e('0xb9')](config['root'],_0xa56e('0xbf'),_0x428ad4[_0xa56e('0xbc')]))){return _0xe818d1[_0xa56e('0xbd')](_0x23a513);}return _0xe818d1[_0xa56e('0xbd')](path['join'](config[_0xa56e('0xba')],_0xa56e('0xbf'),_0x428ad4[_0xa56e('0xbc')]));}}})[_0xa56e('0x4b')](handleError(_0xe818d1,null));};exports[_0xa56e('0xc0')]=function(_0x1a872d,_0x540d27){return db['User'][_0xa56e('0x31')]({'where':{'id':_0x1a872d['params']['id']},'attributes':['id']})[_0xa56e('0x12')](handleEntityNotFound(_0x540d27,null))[_0xa56e('0x12')](function(_0x3d2388){var _0xa0aaab=[];values=_0x3d2388['dataValues'];_0xa0aaab[_0xa56e('0x46')](get_open_tabs('chat',_0x3d2388[_0xa56e('0x48')]));_0xa0aaab['push'](get_open_tabs('sms',_0x3d2388[_0xa56e('0x48')]));_0xa0aaab[_0xa56e('0x46')](get_open_tabs('openchannel',_0x3d2388[_0xa56e('0x48')]));_0xa0aaab[_0xa56e('0x46')](get_open_tabs(_0xa56e('0x58'),_0x3d2388[_0xa56e('0x48')]));_0xa0aaab['push'](get_open_tabs(_0xa56e('0x59'),_0x3d2388[_0xa56e('0x48')]));_0xa0aaab[_0xa56e('0x46')](get_open_tabs('mail',_0x3d2388['dataValues']));return BPromise['all'](_0xa0aaab);})[_0xa56e('0x12')](function(_0x592e55){if(_0x592e55){var _0x4b142d=_['map'](values[_0xa56e('0xc1')],function(_0x37a32d){return{'channel':'CHAT','id':_0x37a32d['id'],'createdAt':_0x37a32d[_0xa56e('0xc2')]};});var _0x54be01=_['map'](values[_0xa56e('0xc3')],function(_0x2a3dac){return{'channel':_0xa56e('0xc4'),'id':_0x2a3dac['id'],'createdAt':_0x2a3dac[_0xa56e('0xc2')]};});var _0xe8eb7c=_[_0xa56e('0x39')](values[_0xa56e('0xc5')],function(_0x3f7b37){return{'channel':_0xa56e('0xc6'),'id':_0x3f7b37['id'],'createdAt':_0x3f7b37[_0xa56e('0xc2')]};});var _0x2804a4=_[_0xa56e('0x39')](values[_0xa56e('0xc7')],function(_0xec819c){return{'channel':_0xa56e('0xc8'),'id':_0xec819c['id'],'createdAt':_0xec819c[_0xa56e('0xc2')]};});var _0x1a120d=_[_0xa56e('0x39')](values[_0xa56e('0xc9')],function(_0x1600f4){return{'channel':'SMS','id':_0x1600f4['id'],'createdAt':_0x1600f4[_0xa56e('0xc2')]};});var _0x55b9a3=_[_0xa56e('0x39')](values[_0xa56e('0xca')],function(_0x1d2202){return{'channel':'WHATSAPP','id':_0x1d2202['id'],'createdAt':_0x1d2202[_0xa56e('0xc2')]};});var _0x484051=_['concat'](_0x4b142d,_0x54be01,_0xe8eb7c,_0x2804a4,_0x1a120d,_0x55b9a3);var _0x48023e={'count':_0x484051['length'],'rows':_0x484051};return _0x48023e;}else return null;})[_0xa56e('0x12')](respondWithResult(_0x540d27,null))[_0xa56e('0x4b')](handleError(_0x540d27,null));};exports[_0xa56e('0xcb')]=function(_0x448f85,_0x3a0ce6){var _0x146982={};var _0x39993f={};var _0x2b6741;var _0x523980;return db['User']['findOne']({'where':{'id':_0x448f85['params']['id']}})[_0xa56e('0x12')](handleEntityNotFound(_0x3a0ce6,null))[_0xa56e('0x12')](function(_0x431f51){if(_0x431f51){_0x2b6741=_0x431f51;_0x39993f[_0xa56e('0x53')]=_[_0xa56e('0x4f')](db[_0xa56e('0xcc')][_0xa56e('0x38')]);_0x39993f[_0xa56e('0x3c')]=_['keys'](_0x448f85['query']);_0x39993f[_0xa56e('0x51')]=_['intersection'](_0x39993f[_0xa56e('0x53')],_0x39993f[_0xa56e('0x3c')]);_0x146982[_0xa56e('0x41')]=_['intersection'](_0x39993f[_0xa56e('0x53')],qs[_0xa56e('0x54')](_0x448f85[_0xa56e('0x3c')]['fields']));_0x146982[_0xa56e('0x41')]=_0x146982[_0xa56e('0x41')][_0xa56e('0x45')]?_0x146982[_0xa56e('0x41')]:_0x39993f[_0xa56e('0x53')];_0x146982[_0xa56e('0xcd')]=qs['sort'](_0x448f85['query'][_0xa56e('0xce')]);_0x146982['where']=qs[_0xa56e('0x51')](_[_0xa56e('0xcf')](_0x448f85['query'],_0x39993f[_0xa56e('0x51')]));if(_0x448f85['query'][_0xa56e('0x2d')]){_0x146982['where']=_['merge'](_0x146982[_0xa56e('0x3b')],{'$or':_['map'](_0x146982[_0xa56e('0x41')],function(_0xf382e){var _0x6e1497={};_0x6e1497[_0xf382e]={'$like':'%'+_0x448f85[_0xa56e('0x3c')][_0xa56e('0x2d')]+'%'};return _0x6e1497;})});}_0x146982=_['merge']({},_0x146982,_0x448f85['options']);return _0x2b6741[_0xa56e('0xcb')](_0x146982);}})[_0xa56e('0x12')](function(_0x2f9e87){if(_0x2f9e87){_0x523980=_0x2f9e87['length'];if(_0x448f85[_0xa56e('0x3c')][_0xa56e('0xd0')](_0xa56e('0x3d'))){_0x146982[_0xa56e('0x3e')]=[{'model':db[_0xa56e('0xd1')],'as':_0xa56e('0xd2'),'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xa56e('0x34'),'color'],'where':_0x448f85[_0xa56e('0x3c')][_0xa56e('0xd3')]?{'id':_0x448f85[_0xa56e('0x3c')][_0xa56e('0xd3')]}:undefined,'required':_0x448f85[_0xa56e('0x3c')]['tag']?!![]:![]}];}if(!_0x448f85['query'][_0xa56e('0xd0')]('nolimit')){_0x146982[_0xa56e('0x22')]=qs['limit'](_0x448f85[_0xa56e('0x3c')][_0xa56e('0x22')]);_0x146982[_0xa56e('0x20')]=qs[_0xa56e('0x20')](_0x448f85[_0xa56e('0x3c')][_0xa56e('0x20')]);}return _0x2b6741['getContacts'](_0x146982);}})['then'](function(_0x149a1d){if(_0x149a1d){return _0x149a1d?{'count':_0x523980,'rows':_0x149a1d}:null;}})[_0xa56e('0x12')](respondWithResult(_0x3a0ce6,null))[_0xa56e('0x4b')](handleError(_0x3a0ce6,null));};exports['getQueues']=function(_0x3ef941,_0xa55a4a){var _0x114c0d;var _0x23ed8b={};var _0x560779;return db[_0xa56e('0x37')][_0xa56e('0x95')]({'where':{'id':_0x3ef941[_0xa56e('0x4d')]['id']},'attributes':['id',_0xa56e('0x34'),_0xa56e('0x26')]})[_0xa56e('0x12')](handleEntityNotFound(_0xa55a4a,null))['then'](function(_0x56be30){if(!utils[_0xa56e('0xa1')](_0x3ef941[_0xa56e('0x3c')][_0xa56e('0x9c')])){throw new db[(_0xa56e('0x92'))][(_0xa56e('0x8e'))](_0xa56e('0xa2'));}_0x114c0d=_0x56be30;var _0x37bfce={};_0x37bfce[_0xa56e('0x53')]=_[_0xa56e('0x4f')](db[_[_0xa56e('0xa4')](_0x3ef941[_0xa56e('0x3c')][_0xa56e('0x9c')])+_0xa56e('0xd4')]['rawAttributes']);_0x37bfce['query']=_[_0xa56e('0x4f')](_0x3ef941[_0xa56e('0x3c')]);_0x37bfce[_0xa56e('0x51')]=_[_0xa56e('0x52')](_0x37bfce['model'],_0x37bfce[_0xa56e('0x3c')]);_0x23ed8b[_0xa56e('0x41')]=_[_0xa56e('0x52')](_0x37bfce[_0xa56e('0x53')],qs[_0xa56e('0x54')](_0x3ef941[_0xa56e('0x3c')][_0xa56e('0x54')]));_0x23ed8b['attributes']=_0x23ed8b['attributes'][_0xa56e('0x45')]?_0x23ed8b[_0xa56e('0x41')]:_0x37bfce['model'];_0x23ed8b[_0xa56e('0xcd')]=qs[_0xa56e('0xce')](_0x3ef941[_0xa56e('0x3c')][_0xa56e('0xce')]);_0x23ed8b['where']=qs[_0xa56e('0x51')](_['pick'](_0x3ef941['query'],_0x37bfce[_0xa56e('0x51')]));if(_0x3ef941[_0xa56e('0x3c')][_0xa56e('0x2d')]){_0x23ed8b[_0xa56e('0x3b')]=_[_0xa56e('0x55')](_0x23ed8b[_0xa56e('0x3b')],{'$or':_['map'](_0x23ed8b['attributes'],function(_0x2a84e4){var _0x4a03a3={};_0x4a03a3[_0x2a84e4]={'$like':'%'+_0x3ef941[_0xa56e('0x3c')]['filter']+'%'};return _0x4a03a3;})});}_0x23ed8b=_['merge']({},_0x23ed8b,_0x3ef941[_0xa56e('0xd5')]);switch(_0x114c0d[_0xa56e('0x26')]){case _0xa56e('0x27'):return db[_['capitalize'](_0x3ef941['query']['channel'])+'Queue']['findAll'](_0x23ed8b);case _0xa56e('0x29'):case'agent':return _0x114c0d['get'+_[_0xa56e('0xa4')](_0x3ef941['query']['channel'])+_0xa56e('0xa6')](_0x23ed8b);default:throw new db[(_0xa56e('0x92'))][(_0xa56e('0x8e'))](_0xa56e('0xd6'));}})['then'](function(_0x5d723a){_0x560779=_0x5d723a[_0xa56e('0x45')];if(!_0x3ef941[_0xa56e('0x3c')][_0xa56e('0xd0')](_0xa56e('0xd7'))){_0x23ed8b[_0xa56e('0x22')]=qs['limit'](_0x3ef941[_0xa56e('0x3c')][_0xa56e('0x22')]);_0x23ed8b['offset']=qs['offset'](_0x3ef941[_0xa56e('0x3c')]['offset']);}switch(_0x114c0d[_0xa56e('0x26')]){case'admin':return db[_[_0xa56e('0xa4')](_0x3ef941['query'][_0xa56e('0x9c')])+_0xa56e('0xd4')][_0xa56e('0x42')](_0x23ed8b);case _0xa56e('0x29'):case'agent':return _0x114c0d[_0xa56e('0xac')+_[_0xa56e('0xa4')](_0x3ef941[_0xa56e('0x3c')][_0xa56e('0x9c')])+'Queues'](_0x23ed8b);}})[_0xa56e('0x12')](function(_0x373d18){return{'count':_0x560779,'rows':_0x373d18};})[_0xa56e('0x12')](respondWithResult(_0xa55a4a,null))[_0xa56e('0x4b')](handleError(_0xa55a4a,null));};exports[_0xa56e('0xd8')]=function(_0x5800d8,_0x569145){var _0x17f45a={};var _0x344c85={};var _0x4b30c3;var _0x1537c3;return db['User'][_0xa56e('0x95')]({'where':{'id':_0x5800d8['params']['id']}})['then'](handleEntityNotFound(_0x569145,null))['then'](function(_0x318e28){if(_0x318e28){_0x4b30c3=_0x318e28;_0x344c85[_0xa56e('0x53')]=_[_0xa56e('0x4f')](db['UserVoiceQueueRt'][_0xa56e('0x38')]);_0x344c85[_0xa56e('0x3c')]=_['keys'](_0x5800d8['query']);_0x344c85[_0xa56e('0x51')]=_[_0xa56e('0x52')](_0x344c85[_0xa56e('0x53')],_0x344c85[_0xa56e('0x3c')]);_0x17f45a[_0xa56e('0x41')]=_[_0xa56e('0x52')](_0x344c85[_0xa56e('0x53')],qs['fields'](_0x5800d8[_0xa56e('0x3c')][_0xa56e('0x54')]));_0x17f45a[_0xa56e('0x41')]=_0x17f45a[_0xa56e('0x41')][_0xa56e('0x45')]?_0x17f45a[_0xa56e('0x41')]:_0x344c85['model'];_0x17f45a['order']=qs[_0xa56e('0xce')](_0x5800d8['query']['sort']);_0x17f45a[_0xa56e('0x3b')]=qs[_0xa56e('0x51')](_[_0xa56e('0xcf')](_0x5800d8['query'],_0x344c85[_0xa56e('0x51')]));if(_0x5800d8[_0xa56e('0x3c')][_0xa56e('0x2d')]){_0x17f45a[_0xa56e('0x3b')]=_[_0xa56e('0x55')](_0x17f45a['where'],{'$or':_['map'](_0x17f45a[_0xa56e('0x41')],function(_0x5d117f){var _0x18b612={};_0x18b612[_0x5d117f]={'$like':'%'+_0x5800d8['query'][_0xa56e('0x2d')]+'%'};return _0x18b612;})});}_0x17f45a=_['merge']({},_0x17f45a,_0x5800d8[_0xa56e('0xd5')]);return _0x4b30c3[_0xa56e('0xd8')](_0x17f45a);}})[_0xa56e('0x12')](function(_0x194733){if(_0x194733){_0x1537c3=_0x194733[_0xa56e('0x45')];if(!_0x5800d8[_0xa56e('0x3c')][_0xa56e('0xd0')](_0xa56e('0xd7'))){_0x17f45a[_0xa56e('0x22')]=qs[_0xa56e('0x22')](_0x5800d8[_0xa56e('0x3c')][_0xa56e('0x22')]);_0x17f45a['offset']=qs['offset'](_0x5800d8['query'][_0xa56e('0x20')]);}return _0x4b30c3[_0xa56e('0xd8')](_0x17f45a);}})['then'](function(_0x538378){if(_0x538378){return _0x538378?{'count':_0x1537c3,'rows':_0x538378}:null;}})[_0xa56e('0x12')](respondWithResult(_0x569145,null))['catch'](handleError(_0x569145,null));};exports[_0xa56e('0xd9')]=function(_0x59c443,_0x7b4bbf){var _0xbb69a0={};var _0x4b9949={};var _0x4427b5;var _0xc7de98;return db[_0xa56e('0x37')][_0xa56e('0x95')]({'where':{'id':_0x59c443[_0xa56e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x7b4bbf,null))[_0xa56e('0x12')](function(_0x22a5ea){if(_0x22a5ea){_0x4427b5=_0x22a5ea;_0x4b9949[_0xa56e('0x53')]=_[_0xa56e('0x4f')](db[_0xa56e('0xda')][_0xa56e('0x38')]);_0x4b9949[_0xa56e('0x3c')]=_[_0xa56e('0x4f')](_0x59c443[_0xa56e('0x3c')]);_0x4b9949[_0xa56e('0x51')]=_[_0xa56e('0x52')](_0x4b9949['model'],_0x4b9949[_0xa56e('0x3c')]);_0xbb69a0['attributes']=_['intersection'](_0x4b9949['model'],qs[_0xa56e('0x54')](_0x59c443[_0xa56e('0x3c')][_0xa56e('0x54')]));_0xbb69a0[_0xa56e('0x41')]=_0xbb69a0[_0xa56e('0x41')][_0xa56e('0x45')]?_0xbb69a0[_0xa56e('0x41')]:_0x4b9949[_0xa56e('0x53')];_0xbb69a0[_0xa56e('0xcd')]=qs[_0xa56e('0xce')](_0x59c443[_0xa56e('0x3c')][_0xa56e('0xce')]);_0xbb69a0[_0xa56e('0x3b')]=qs[_0xa56e('0x51')](_['pick'](_0x59c443[_0xa56e('0x3c')],_0x4b9949['filters']));if(_0x59c443[_0xa56e('0x3c')][_0xa56e('0x2d')]){_0xbb69a0[_0xa56e('0x3b')]=_[_0xa56e('0x55')](_0xbb69a0[_0xa56e('0x3b')],{'$or':_[_0xa56e('0x39')](_0xbb69a0[_0xa56e('0x41')],function(_0x347a6c){var _0x4387ca={};_0x4387ca[_0x347a6c]={'$like':'%'+_0x59c443['query']['filter']+'%'};return _0x4387ca;})});}_0xbb69a0=_[_0xa56e('0x55')]({},_0xbb69a0,_0x59c443[_0xa56e('0xd5')]);return _0x4427b5[_0xa56e('0xd9')](_0xbb69a0);}})['then'](function(_0x28ac40){if(_0x28ac40){_0xc7de98=_0x28ac40[_0xa56e('0x45')];if(!_0x59c443['query'][_0xa56e('0xd0')]('nolimit')){_0xbb69a0['limit']=qs['limit'](_0x59c443[_0xa56e('0x3c')][_0xa56e('0x22')]);_0xbb69a0[_0xa56e('0x20')]=qs['offset'](_0x59c443[_0xa56e('0x3c')][_0xa56e('0x20')]);}return _0x4427b5[_0xa56e('0xd9')](_0xbb69a0);}})[_0xa56e('0x12')](function(_0xb6d2e1){if(_0xb6d2e1){return _0xb6d2e1?{'count':_0xc7de98,'rows':_0xb6d2e1}:null;}})[_0xa56e('0x12')](respondWithResult(_0x7b4bbf,null))[_0xa56e('0x4b')](handleError(_0x7b4bbf,null));};exports['getRecordings']=function(_0x47e4fd,_0x530cfc){var _0xbc6257={'raw':!![],'where':{}};var _0x4a4700={};var _0xc59d84={'count':0x0,'rows':[]};return db['User'][_0xa56e('0x95')]({'where':{'id':_0x47e4fd[_0xa56e('0x4d')]['id']}})[_0xa56e('0x12')](handleEntityNotFound(_0x530cfc,null))[_0xa56e('0x12')](function(_0x4383f5){if(_0x4383f5){_0x4a4700[_0xa56e('0x53')]=_['keys'](db[_0xa56e('0xdb')][_0xa56e('0x38')]);_0x4a4700[_0xa56e('0x3c')]=_[_0xa56e('0x4f')](_0x47e4fd[_0xa56e('0x3c')]);_0x4a4700[_0xa56e('0x51')]=_[_0xa56e('0x52')](_0x4a4700[_0xa56e('0x53')],_0x4a4700['query']);_0xbc6257['attributes']=_['intersection'](_0x4a4700[_0xa56e('0x53')],qs['fields'](_0x47e4fd['query'][_0xa56e('0x54')]));_0xbc6257[_0xa56e('0x41')]=_0xbc6257[_0xa56e('0x41')]['length']?_0xbc6257[_0xa56e('0x41')]:_0x4a4700[_0xa56e('0x53')];if(!_0x47e4fd[_0xa56e('0x3c')][_0xa56e('0xd0')](_0xa56e('0xd7'))){_0xbc6257[_0xa56e('0x22')]=qs[_0xa56e('0x22')](_0x47e4fd[_0xa56e('0x3c')][_0xa56e('0x22')]);_0xbc6257[_0xa56e('0x20')]=qs['offset'](_0x47e4fd[_0xa56e('0x3c')][_0xa56e('0x20')]);}_0xbc6257[_0xa56e('0xcd')]=qs[_0xa56e('0xce')](_0x47e4fd['query'][_0xa56e('0xce')]);_0xbc6257['where']=qs['filters'](_[_0xa56e('0xcf')](_0x47e4fd[_0xa56e('0x3c')],_0x4a4700[_0xa56e('0x51')]));_0xbc6257['where'][_0xa56e('0xdc')]=_0x4383f5['id'];if(_0x47e4fd[_0xa56e('0x3c')][_0xa56e('0x2d')]){_0xbc6257[_0xa56e('0x3b')]=_[_0xa56e('0x55')](_0xbc6257[_0xa56e('0x3b')],{'$or':_[_0xa56e('0x39')](_0xbc6257[_0xa56e('0x41')],function(_0x4b89c5){var _0x18e5d7={};_0x18e5d7[_0x4b89c5]={'$like':'%'+_0x47e4fd['query']['filter']+'%'};return _0x18e5d7;})});}_0xbc6257=_['merge']({},_0xbc6257,_0x47e4fd['options']);return db[_0xa56e('0xdb')][_0xa56e('0x23')]({'where':_0xbc6257[_0xa56e('0x3b')]})[_0xa56e('0x12')](function(_0x3358bf){_0xc59d84['count']=_0x3358bf;if(_0x47e4fd[_0xa56e('0x3c')][_0xa56e('0x3d')]){_0xbc6257['include']=[{'all':!![]}];}return db[_0xa56e('0xdb')]['findAll'](_0xbc6257);})[_0xa56e('0x12')](function(_0x3408d0){_0xc59d84[_0xa56e('0x43')]=_0x3408d0;return _0xc59d84;});}})['then'](respondWithFilteredResult(_0x530cfc,_0xbc6257))[_0xa56e('0x4b')](handleError(_0x530cfc,null));};exports[_0xa56e('0xdd')]=function(_0x43efd5,_0x28fdfe){var _0x41ca8f={'raw':!![],'where':{}};var _0x31d096={};var _0x462445={'count':0x0,'rows':[]};return db[_0xa56e('0x37')][_0xa56e('0x95')]({'where':{'id':_0x43efd5[_0xa56e('0x4d')]['id']}})[_0xa56e('0x12')](handleEntityNotFound(_0x28fdfe,null))[_0xa56e('0x12')](function(_0xc6a723){if(_0xc6a723){_0x31d096[_0xa56e('0x53')]=_[_0xa56e('0x4f')](db[_0xa56e('0xde')]['rawAttributes']);_0x31d096[_0xa56e('0x3c')]=_['keys'](_0x43efd5['query']);_0x31d096['filters']=_[_0xa56e('0x52')](_0x31d096[_0xa56e('0x53')],_0x31d096['query']);_0x41ca8f[_0xa56e('0x41')]=_[_0xa56e('0x52')](_0x31d096[_0xa56e('0x53')],qs[_0xa56e('0x54')](_0x43efd5['query'][_0xa56e('0x54')]));_0x41ca8f[_0xa56e('0x41')]=_0x41ca8f[_0xa56e('0x41')][_0xa56e('0x45')]?_0x41ca8f[_0xa56e('0x41')]:_0x31d096[_0xa56e('0x53')];if(!_0x43efd5[_0xa56e('0x3c')][_0xa56e('0xd0')](_0xa56e('0xd7'))){_0x41ca8f['limit']=qs['limit'](_0x43efd5[_0xa56e('0x3c')]['limit']);_0x41ca8f[_0xa56e('0x20')]=qs[_0xa56e('0x20')](_0x43efd5[_0xa56e('0x3c')][_0xa56e('0x20')]);}_0x41ca8f[_0xa56e('0xcd')]=qs['sort'](_0x43efd5[_0xa56e('0x3c')][_0xa56e('0xce')]);_0x41ca8f[_0xa56e('0x3b')]=qs[_0xa56e('0x51')](_[_0xa56e('0xcf')](_0x43efd5[_0xa56e('0x3c')],_0x31d096['filters']));_0x41ca8f[_0xa56e('0x3b')][_0xa56e('0xdc')]=_0xc6a723['id'];if(_0x43efd5[_0xa56e('0x3c')]['filter']){_0x41ca8f[_0xa56e('0x3b')]=_[_0xa56e('0x55')](_0x41ca8f[_0xa56e('0x3b')],{'$or':_['map'](_0x41ca8f['attributes'],function(_0x154db4){var _0x104c2d={};_0x104c2d[_0x154db4]={'$like':'%'+_0x43efd5[_0xa56e('0x3c')]['filter']+'%'};return _0x104c2d;})});}_0x41ca8f=_[_0xa56e('0x55')]({},_0x41ca8f,_0x43efd5[_0xa56e('0xd5')]);return db[_0xa56e('0xde')][_0xa56e('0x23')]({'where':_0x41ca8f['where']})[_0xa56e('0x12')](function(_0x1cc6d8){_0x462445[_0xa56e('0x23')]=_0x1cc6d8;if(_0x43efd5['query'][_0xa56e('0x3d')]){_0x41ca8f[_0xa56e('0x3e')]=[{'all':!![]}];}return db['ScreenRecording'][_0xa56e('0x42')](_0x41ca8f);})[_0xa56e('0x12')](function(_0x549af4){_0x462445[_0xa56e('0x43')]=_0x549af4;return _0x462445;});}})[_0xa56e('0x12')](respondWithFilteredResult(_0x28fdfe,_0x41ca8f))[_0xa56e('0x4b')](handleError(_0x28fdfe,null));};exports[_0xa56e('0xdf')]=function(_0x39453d,_0x9a4423){var _0x47f3f8={};var _0x5c064a={};var _0x8c7a67;var _0x2bd687;return db[_0xa56e('0x37')][_0xa56e('0x95')]({'where':{'id':_0x39453d['params']['id']}})[_0xa56e('0x12')](handleEntityNotFound(_0x9a4423,null))[_0xa56e('0x12')](function(_0xc70c8d){if(_0xc70c8d){_0x8c7a67=_0xc70c8d;_0x5c064a['model']=_[_0xa56e('0x4f')](db[_0xa56e('0xe0')][_0xa56e('0x38')]);_0x5c064a[_0xa56e('0x3c')]=_['keys'](_0x39453d['query']);_0x5c064a['filters']=_['intersection'](_0x5c064a[_0xa56e('0x53')],_0x5c064a[_0xa56e('0x3c')]);_0x47f3f8['attributes']=_[_0xa56e('0x52')](_0x5c064a['model'],qs[_0xa56e('0x54')](_0x39453d[_0xa56e('0x3c')][_0xa56e('0x54')]));_0x47f3f8[_0xa56e('0x41')]=_0x47f3f8[_0xa56e('0x41')]['length']?_0x47f3f8[_0xa56e('0x41')]:_0x5c064a[_0xa56e('0x53')];_0x47f3f8[_0xa56e('0xcd')]=qs[_0xa56e('0xce')](_0x39453d['query'][_0xa56e('0xce')]);_0x47f3f8['where']=qs[_0xa56e('0x51')](_[_0xa56e('0xcf')](_0x39453d[_0xa56e('0x3c')],_0x5c064a[_0xa56e('0x51')]));if(_0x39453d[_0xa56e('0x3c')][_0xa56e('0x2d')]){_0x47f3f8[_0xa56e('0x3b')]=_[_0xa56e('0x55')](_0x47f3f8[_0xa56e('0x3b')],{'$or':_[_0xa56e('0x39')](_0x47f3f8['attributes'],function(_0x4911a1){var _0x563272={};_0x563272[_0x4911a1]={'$like':'%'+_0x39453d['query']['filter']+'%'};return _0x563272;})});}_0x47f3f8=_[_0xa56e('0x55')]({},_0x47f3f8,_0x39453d['options']);return _0x8c7a67[_0xa56e('0xdf')](_0x47f3f8);}})[_0xa56e('0x12')](function(_0x327e17){if(_0x327e17){_0x2bd687=_0x327e17[_0xa56e('0x45')];if(!_0x39453d[_0xa56e('0x3c')][_0xa56e('0xd0')](_0xa56e('0xd7'))){_0x47f3f8[_0xa56e('0x22')]=qs[_0xa56e('0x22')](_0x39453d[_0xa56e('0x3c')]['limit']);_0x47f3f8['offset']=qs[_0xa56e('0x20')](_0x39453d[_0xa56e('0x3c')][_0xa56e('0x20')]);}return _0x8c7a67[_0xa56e('0xdf')](_0x47f3f8);}})[_0xa56e('0x12')](function(_0x58cfa1){if(_0x58cfa1){return _0x58cfa1?{'count':_0x2bd687,'rows':_0x58cfa1}:null;}})[_0xa56e('0x12')](respondWithResult(_0x9a4423,null))['catch'](handleError(_0x9a4423,null));};exports['getOpenchannelInteractions']=function(_0x42fdeb,_0x4d3346){var _0x28d7c3={};var _0x1d7768={};var _0x511b20;var _0x12bcad;return db[_0xa56e('0x37')][_0xa56e('0x95')]({'where':{'id':_0x42fdeb[_0xa56e('0x4d')]['id']}})[_0xa56e('0x12')](handleEntityNotFound(_0x4d3346,null))[_0xa56e('0x12')](function(_0x212af4){if(_0x212af4){_0x511b20=_0x212af4;_0x1d7768['model']=_[_0xa56e('0x4f')](db[_0xa56e('0xe1')][_0xa56e('0x38')]);_0x1d7768[_0xa56e('0x3c')]=_[_0xa56e('0x4f')](_0x42fdeb[_0xa56e('0x3c')]);_0x1d7768[_0xa56e('0x51')]=_[_0xa56e('0x52')](_0x1d7768[_0xa56e('0x53')],_0x1d7768['query']);_0x28d7c3[_0xa56e('0x41')]=_[_0xa56e('0x52')](_0x1d7768['model'],qs[_0xa56e('0x54')](_0x42fdeb[_0xa56e('0x3c')][_0xa56e('0x54')]));_0x28d7c3['attributes']=_0x28d7c3['attributes'][_0xa56e('0x45')]?_0x28d7c3[_0xa56e('0x41')]:_0x1d7768[_0xa56e('0x53')];_0x28d7c3[_0xa56e('0xcd')]=qs[_0xa56e('0xce')](_0x42fdeb['query'][_0xa56e('0xce')]);_0x28d7c3['where']=qs[_0xa56e('0x51')](_[_0xa56e('0xcf')](_0x42fdeb[_0xa56e('0x3c')],_0x1d7768['filters']));if(_0x42fdeb[_0xa56e('0x3c')][_0xa56e('0x2d')]){_0x28d7c3[_0xa56e('0x3b')]=_['merge'](_0x28d7c3[_0xa56e('0x3b')],{'$or':_[_0xa56e('0x39')](_0x28d7c3[_0xa56e('0x41')],function(_0xf92caa){var _0x2de39c={};_0x2de39c[_0xf92caa]={'$like':'%'+_0x42fdeb[_0xa56e('0x3c')]['filter']+'%'};return _0x2de39c;})});}_0x28d7c3=_[_0xa56e('0x55')]({},_0x28d7c3,_0x42fdeb[_0xa56e('0xd5')]);return _0x511b20['getOpenchannelInteractions'](_0x28d7c3);}})['then'](function(_0x3aa2aa){if(_0x3aa2aa){_0x12bcad=_0x3aa2aa[_0xa56e('0x45')];if(!_0x42fdeb['query']['hasOwnProperty'](_0xa56e('0xd7'))){_0x28d7c3[_0xa56e('0x22')]=qs[_0xa56e('0x22')](_0x42fdeb[_0xa56e('0x3c')][_0xa56e('0x22')]);_0x28d7c3[_0xa56e('0x20')]=qs[_0xa56e('0x20')](_0x42fdeb['query']['offset']);}return _0x511b20[_0xa56e('0xe2')](_0x28d7c3);}})[_0xa56e('0x12')](function(_0x41de9a){if(_0x41de9a){return _0x41de9a?{'count':_0x12bcad,'rows':_0x41de9a}:null;}})[_0xa56e('0x12')](respondWithResult(_0x4d3346,null))[_0xa56e('0x4b')](handleError(_0x4d3346,null));};exports[_0xa56e('0xe3')]=function(_0x415bc7,_0x51225d){var _0x251080={'raw':!![],'where':{}};var _0x2e051b={};var _0x22563b={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x415bc7[_0xa56e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x51225d,null))['then'](function(_0x651b91){if(_0x651b91){_0x2e051b[_0xa56e('0x53')]=_[_0xa56e('0x4f')](db[_0xa56e('0xe4')]['rawAttributes']);_0x2e051b[_0xa56e('0x3c')]=_['keys'](_0x415bc7[_0xa56e('0x3c')]);_0x2e051b[_0xa56e('0x51')]=_[_0xa56e('0x52')](_0x2e051b['model'],_0x2e051b[_0xa56e('0x3c')]);_0x251080[_0xa56e('0x41')]=_[_0xa56e('0x52')](_0x2e051b[_0xa56e('0x53')],qs[_0xa56e('0x54')](_0x415bc7[_0xa56e('0x3c')][_0xa56e('0x54')]));_0x251080['attributes']=_0x251080[_0xa56e('0x41')][_0xa56e('0x45')]?_0x251080[_0xa56e('0x41')]:_0x2e051b[_0xa56e('0x53')];if(!_0x415bc7[_0xa56e('0x3c')]['hasOwnProperty'](_0xa56e('0xd7'))){_0x251080[_0xa56e('0x22')]=qs[_0xa56e('0x22')](_0x415bc7[_0xa56e('0x3c')][_0xa56e('0x22')]);_0x251080[_0xa56e('0x20')]=qs[_0xa56e('0x20')](_0x415bc7['query'][_0xa56e('0x20')]);}_0x251080[_0xa56e('0xcd')]=qs[_0xa56e('0xce')](_0x415bc7[_0xa56e('0x3c')][_0xa56e('0xce')]);_0x251080[_0xa56e('0x3b')]=qs[_0xa56e('0x51')](_[_0xa56e('0xcf')](_0x415bc7[_0xa56e('0x3c')],_0x2e051b['filters']));_0x251080[_0xa56e('0x3b')]['UserId']=_0x651b91['id'];if(_0x415bc7[_0xa56e('0x3c')][_0xa56e('0x2d')]){_0x251080[_0xa56e('0x3b')]=_[_0xa56e('0x55')](_0x251080[_0xa56e('0x3b')],{'$or':_[_0xa56e('0x39')](_0x251080['attributes'],function(_0x10011a){var _0x529e27={};_0x529e27[_0x10011a]={'$like':'%'+_0x415bc7[_0xa56e('0x3c')][_0xa56e('0x2d')]+'%'};return _0x529e27;})});}_0x251080=_['merge']({},_0x251080,_0x415bc7[_0xa56e('0xd5')]);return db['MailInteraction']['count']({'where':_0x251080[_0xa56e('0x3b')]})[_0xa56e('0x12')](function(_0x25b40c){_0x22563b['count']=_0x25b40c;if(_0x415bc7[_0xa56e('0x3c')][_0xa56e('0x3d')]){_0x251080['include']=[{'all':!![]}];}return db['MailInteraction'][_0xa56e('0x42')](_0x251080);})[_0xa56e('0x12')](function(_0x50cfcd){_0x22563b[_0xa56e('0x43')]=_0x50cfcd;return _0x22563b;});}})[_0xa56e('0x12')](respondWithFilteredResult(_0x51225d,_0x251080))[_0xa56e('0x4b')](handleError(_0x51225d,null));};exports['getSmsInteractions']=function(_0x4b3ea1,_0x189060){var _0xe476f0={};var _0x2a0cd8={};var _0x3cbd0d;var _0x32e7da;return db['User']['findOne']({'where':{'id':_0x4b3ea1[_0xa56e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x189060,null))['then'](function(_0x348741){if(_0x348741){_0x3cbd0d=_0x348741;_0x2a0cd8[_0xa56e('0x53')]=_[_0xa56e('0x4f')](db[_0xa56e('0xe5')][_0xa56e('0x38')]);_0x2a0cd8['query']=_[_0xa56e('0x4f')](_0x4b3ea1[_0xa56e('0x3c')]);_0x2a0cd8['filters']=_[_0xa56e('0x52')](_0x2a0cd8[_0xa56e('0x53')],_0x2a0cd8[_0xa56e('0x3c')]);_0xe476f0[_0xa56e('0x41')]=_[_0xa56e('0x52')](_0x2a0cd8[_0xa56e('0x53')],qs[_0xa56e('0x54')](_0x4b3ea1[_0xa56e('0x3c')][_0xa56e('0x54')]));_0xe476f0[_0xa56e('0x41')]=_0xe476f0['attributes'][_0xa56e('0x45')]?_0xe476f0[_0xa56e('0x41')]:_0x2a0cd8['model'];_0xe476f0[_0xa56e('0xcd')]=qs['sort'](_0x4b3ea1[_0xa56e('0x3c')][_0xa56e('0xce')]);_0xe476f0[_0xa56e('0x3b')]=qs[_0xa56e('0x51')](_['pick'](_0x4b3ea1[_0xa56e('0x3c')],_0x2a0cd8[_0xa56e('0x51')]));if(_0x4b3ea1[_0xa56e('0x3c')][_0xa56e('0x2d')]){_0xe476f0[_0xa56e('0x3b')]=_[_0xa56e('0x55')](_0xe476f0[_0xa56e('0x3b')],{'$or':_[_0xa56e('0x39')](_0xe476f0[_0xa56e('0x41')],function(_0x37f82a){var _0x50c3ef={};_0x50c3ef[_0x37f82a]={'$like':'%'+_0x4b3ea1['query'][_0xa56e('0x2d')]+'%'};return _0x50c3ef;})});}_0xe476f0=_[_0xa56e('0x55')]({},_0xe476f0,_0x4b3ea1['options']);return _0x3cbd0d['getSmsInteractions'](_0xe476f0);}})[_0xa56e('0x12')](function(_0x1f139c){if(_0x1f139c){_0x32e7da=_0x1f139c[_0xa56e('0x45')];if(!_0x4b3ea1[_0xa56e('0x3c')][_0xa56e('0xd0')]('nolimit')){_0xe476f0[_0xa56e('0x22')]=qs['limit'](_0x4b3ea1[_0xa56e('0x3c')]['limit']);_0xe476f0[_0xa56e('0x20')]=qs[_0xa56e('0x20')](_0x4b3ea1[_0xa56e('0x3c')][_0xa56e('0x20')]);}return _0x3cbd0d[_0xa56e('0xe6')](_0xe476f0);}})[_0xa56e('0x12')](function(_0x2c21ac){if(_0x2c21ac){return _0x2c21ac?{'count':_0x32e7da,'rows':_0x2c21ac}:null;}})[_0xa56e('0x12')](respondWithResult(_0x189060,null))['catch'](handleError(_0x189060,null));};exports[_0xa56e('0xe7')]=function(_0x1736ba,_0x72e1cc){var _0x1e8984={};var _0x3a4ff3={};var _0x56047e;var _0x3be00f;return db[_0xa56e('0x37')]['findOne']({'where':{'id':_0x1736ba[_0xa56e('0x4d')]['id']}})[_0xa56e('0x12')](handleEntityNotFound(_0x72e1cc,null))[_0xa56e('0x12')](function(_0x1e3ccd){if(_0x1e3ccd){_0x56047e=_0x1e3ccd;_0x3a4ff3[_0xa56e('0x53')]=_['keys'](db[_0xa56e('0xe8')]['rawAttributes']);_0x3a4ff3['query']=_[_0xa56e('0x4f')](_0x1736ba[_0xa56e('0x3c')]);_0x3a4ff3['filters']=_[_0xa56e('0x52')](_0x3a4ff3[_0xa56e('0x53')],_0x3a4ff3[_0xa56e('0x3c')]);_0x1e8984[_0xa56e('0x41')]=_[_0xa56e('0x52')](_0x3a4ff3['model'],qs[_0xa56e('0x54')](_0x1736ba['query'][_0xa56e('0x54')]));_0x1e8984[_0xa56e('0x41')]=_0x1e8984['attributes'][_0xa56e('0x45')]?_0x1e8984[_0xa56e('0x41')]:_0x3a4ff3[_0xa56e('0x53')];_0x1e8984[_0xa56e('0xcd')]=qs['sort'](_0x1736ba[_0xa56e('0x3c')][_0xa56e('0xce')]);_0x1e8984[_0xa56e('0x3b')]=qs['filters'](_['pick'](_0x1736ba[_0xa56e('0x3c')],_0x3a4ff3[_0xa56e('0x51')]));if(_0x1736ba[_0xa56e('0x3c')][_0xa56e('0x2d')]){_0x1e8984['where']=_[_0xa56e('0x55')](_0x1e8984[_0xa56e('0x3b')],{'$or':_[_0xa56e('0x39')](_0x1e8984[_0xa56e('0x41')],function(_0x2c0802){var _0x514282={};_0x514282[_0x2c0802]={'$like':'%'+_0x1736ba[_0xa56e('0x3c')][_0xa56e('0x2d')]+'%'};return _0x514282;})});}_0x1e8984=_['merge']({},_0x1e8984,_0x1736ba[_0xa56e('0xd5')]);return _0x56047e[_0xa56e('0xe7')](_0x1e8984);}})[_0xa56e('0x12')](function(_0x28952d){if(_0x28952d){_0x3be00f=_0x28952d[_0xa56e('0x45')];if(!_0x1736ba[_0xa56e('0x3c')][_0xa56e('0xd0')](_0xa56e('0xd7'))){_0x1e8984[_0xa56e('0x22')]=qs['limit'](_0x1736ba[_0xa56e('0x3c')]['limit']);_0x1e8984[_0xa56e('0x20')]=qs[_0xa56e('0x20')](_0x1736ba[_0xa56e('0x3c')]['offset']);}return _0x56047e['getFaxInteractions'](_0x1e8984);}})[_0xa56e('0x12')](function(_0x38ed87){if(_0x38ed87){return _0x38ed87?{'count':_0x3be00f,'rows':_0x38ed87}:null;}})[_0xa56e('0x12')](respondWithResult(_0x72e1cc,null))[_0xa56e('0x4b')](handleError(_0x72e1cc,null));};exports[_0xa56e('0xe9')]=function(_0x416cd8,_0x130ee2){var _0xb8f4d8={};var _0x3857aa={};var _0x16160f;var _0xc339a;return db[_0xa56e('0x37')]['findOne']({'where':{'id':_0x416cd8[_0xa56e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x130ee2,null))['then'](function(_0x4f6918){if(_0x4f6918){_0x16160f=_0x4f6918;_0x3857aa[_0xa56e('0x53')]=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x3857aa[_0xa56e('0x3c')]=_[_0xa56e('0x4f')](_0x416cd8['query']);_0x3857aa[_0xa56e('0x51')]=_[_0xa56e('0x52')](_0x3857aa[_0xa56e('0x53')],_0x3857aa[_0xa56e('0x3c')]);_0xb8f4d8[_0xa56e('0x41')]=_[_0xa56e('0x52')](_0x3857aa[_0xa56e('0x53')],qs[_0xa56e('0x54')](_0x416cd8[_0xa56e('0x3c')][_0xa56e('0x54')]));_0xb8f4d8[_0xa56e('0x41')]=_0xb8f4d8[_0xa56e('0x41')][_0xa56e('0x45')]?_0xb8f4d8[_0xa56e('0x41')]:_0x3857aa['model'];_0xb8f4d8['order']=qs[_0xa56e('0xce')](_0x416cd8['query'][_0xa56e('0xce')]);_0xb8f4d8[_0xa56e('0x3b')]=qs['filters'](_[_0xa56e('0xcf')](_0x416cd8[_0xa56e('0x3c')],_0x3857aa['filters']));if(_0x416cd8[_0xa56e('0x3c')][_0xa56e('0x2d')]){_0xb8f4d8[_0xa56e('0x3b')]=_[_0xa56e('0x55')](_0xb8f4d8[_0xa56e('0x3b')],{'$or':_['map'](_0xb8f4d8[_0xa56e('0x41')],function(_0x527cf2){var _0x4aa2a8={};_0x4aa2a8[_0x527cf2]={'$like':'%'+_0x416cd8[_0xa56e('0x3c')][_0xa56e('0x2d')]+'%'};return _0x4aa2a8;})});}_0xb8f4d8=_[_0xa56e('0x55')]({},_0xb8f4d8,_0x416cd8[_0xa56e('0xd5')]);return _0x16160f[_0xa56e('0xe9')](_0xb8f4d8);}})[_0xa56e('0x12')](function(_0x1fab76){if(_0x1fab76){_0xc339a=_0x1fab76[_0xa56e('0x45')];if(!_0x416cd8[_0xa56e('0x3c')]['hasOwnProperty']('nolimit')){_0xb8f4d8['limit']=qs[_0xa56e('0x22')](_0x416cd8[_0xa56e('0x3c')][_0xa56e('0x22')]);_0xb8f4d8[_0xa56e('0x20')]=qs[_0xa56e('0x20')](_0x416cd8['query']['offset']);}return _0x16160f[_0xa56e('0xe9')](_0xb8f4d8);}})[_0xa56e('0x12')](function(_0x528b60){if(_0x528b60){return _0x528b60?{'count':_0xc339a,'rows':_0x528b60}:null;}})[_0xa56e('0x12')](respondWithResult(_0x130ee2,null))[_0xa56e('0x4b')](handleError(_0x130ee2,null));};exports[_0xa56e('0xea')]=function(_0x4ea9f5,_0x3d393f,_0x57def6){var _0x5119e0;var _0x578392;var _0x22ab3c;var _0xcaf363=!_[_0xa56e('0x65')](_0x4ea9f5[_0xa56e('0x4d')]['id'])?_0x4ea9f5['params']['id']:!_[_0xa56e('0x65')](_0x4ea9f5[_0xa56e('0x29')]['id'])?_0x4ea9f5[_0xa56e('0x29')]['id']:null;return db['User']['find']({'where':{'id':_0xcaf363,'role':{'$or':[_0xa56e('0x27'),_0xa56e('0x29'),_0xa56e('0x2b')]}},'attributes':['id','name',_0xa56e('0xeb'),_0xa56e('0xec'),_0xa56e('0x26'),_0xa56e('0x5e'),_0xa56e('0x9e')]})[_0xa56e('0x12')](function(_0x4a2880){if(_0x4a2880){if(_0x4a2880[_0xa56e('0x26')]===_0xa56e('0x2b')){_0x5119e0=_0x4a2880;if(_0x4ea9f5['body']['interface']){_0x22ab3c=util['format'](_0xa56e('0xed'),_0x5119e0[_0x4ea9f5[_0xa56e('0x5b')][_0xa56e('0xa0')]]);}else if(_0x4ea9f5[_0xa56e('0x5b')][_0xa56e('0xee')]){_0x22ab3c=util[_0xa56e('0xad')](_0xa56e('0xae'),_0x4ea9f5['body'][_0xa56e('0xee')]);}else{_0x22ab3c=util['format'](_0xa56e('0xae'),_0x5119e0[_0xa56e('0x34')]);}socket['to'](util[_0xa56e('0xad')](_0xa56e('0xef'),_0x5119e0['name']))[_0xa56e('0xb6')]('user:forcelogout',{'user':{'id':_0x5119e0['id'],'name':_0x5119e0[_0xa56e('0x34')]},'ip':_0x4ea9f5[_0xa56e('0xf0')]['x-forwarded-for']||_0x4ea9f5[_0xa56e('0xf1')][_0xa56e('0xf2')]||_0x4ea9f5[_0xa56e('0xf3')][_0xa56e('0xf2')]||_0x4ea9f5[_0xa56e('0xf1')][_0xa56e('0xf3')]['remoteAddress']});return db[_0xa56e('0xaf')][_0xa56e('0x25')]({'where':{'membername':_0x5119e0[_0xa56e('0x34')]},'individualHooks':!![]});}}else{throw new db[(_0xa56e('0x92'))][(_0xa56e('0x8e'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xa56e('0x12')](function(){if(_0x5119e0){return _0x5119e0[_0xa56e('0xf4')]({'raw':!![]});}})[_0xa56e('0x12')](function(_0x26b589){if(_0x5119e0){var _0x55026e=[];if(_0x26b589){_0x578392=_0x26b589;if(_0x578392[_0xa56e('0x45')]){for(var _0x2814c9=0x0;_0x2814c9<_0x578392[_0xa56e('0x45')];_0x2814c9++){_0x55026e['push']({'membername':_0x5119e0[_0xa56e('0x34')],'UserId':_0x5119e0['id'],'queue_name':_0x578392[_0x2814c9][_0xa56e('0x34')],'VoiceQueueId':_0x578392[_0x2814c9]['id'],'interface':_0x22ab3c,'paused':_0x5119e0['loginInPause']||![],'penalty':_0x578392[_0x2814c9][_0xa56e('0xf5')]||0x0});}return BPromise['each'](_0x55026e,function(_0x34e93e){return db[_0xa56e('0xaf')]['upsert'](_0x34e93e);});}}}})[_0xa56e('0x12')](function(){if(_0x5119e0){return db[_0xa56e('0xf6')]['findAll']({'where':{'membername':_0x5119e0['name'],'exitAt':null}});}})[_0xa56e('0x12')](function(_0x265eaf){if(_0x5119e0){var _0x49ede7=[];_0x265eaf[_0xa56e('0xf7')](function(_0x10c0a4){_0x49ede7[_0xa56e('0x46')](_0x10c0a4['update']({'exitAt':moment()['format'](_0xa56e('0xf8'))}));});return BPromise[_0xa56e('0x5a')](_0x49ede7);}})[_0xa56e('0x12')](function(){if(_0x5119e0){var _0x1a71c9=[];var _0x539dfd=[];var _0x4f711a=utils[_0xa56e('0xf9')]();var _0xbc964={'membername':_0x5119e0[_0xa56e('0x34')],'interface':_0x22ab3c,'enterAt':moment()[_0xa56e('0xad')](_0xa56e('0xf8')),'role':_0x5119e0[_0xa56e('0x26')],'internal':_0x5119e0['internal']};_0x4f711a[_0xa56e('0xf7')](function(_0x9bca49){_0x1a71c9[_0xa56e('0x46')](_[_0xa56e('0x55')]({'channel':_0x9bca49,'type':_0xa56e('0xfa'),'data1':_0x4ea9f5['body'][_0xa56e('0xfb')],'data2':_0x22ab3c},_0xbc964));if(_0x5119e0[_0xa56e('0x9e')]){_0x539dfd[_0xa56e('0x46')](_[_0xa56e('0x55')]({'channel':_0x9bca49,'type':_0xa56e('0xfc'),'data1':_0xa56e('0xfd')},_0xbc964));}});return db[_0xa56e('0xf6')][_0xa56e('0x83')](_0x1a71c9['concat'](_0x539dfd),{'individualHooks':!![]});}})[_0xa56e('0x12')](function(){if(_0x5119e0){return _0x5119e0['update']({'online':!![],'lastLoginAt':moment()['format'](_0xa56e('0xf8')),'voicePause':_0x5119e0[_0xa56e('0x9e')]||![],'mailPause':_0x5119e0[_0xa56e('0x9e')]||![],'chatPause':_0x5119e0[_0xa56e('0x9e')]||![],'faxPause':_0x5119e0['loginInPause']||![],'smsPause':_0x5119e0['loginInPause']||![],'openchannelPause':_0x5119e0[_0xa56e('0x9e')]||![],'whatsappPause':_0x5119e0[_0xa56e('0x9e')]||![],'pauseType':_0x5119e0[_0xa56e('0x9e')]?_0xa56e('0xfd'):null,'interface':_0x22ab3c,'lastPauseAt':moment()[_0xa56e('0xad')](_0xa56e('0xf8'))});}})[_0xa56e('0x12')](function(_0x3c7dcd){if(_0x4ea9f5['isMiddleware']){return _0x57def6();}else{return BPromise['resolve'](_0x3c7dcd)[_0xa56e('0x12')](respondWithResult(_0x3d393f,null));}})[_0xa56e('0x4b')](handleError(_0x3d393f,null));};exports[_0xa56e('0xfe')]=function(_0x528d26,_0x385beb){var _0x5f19d2;return db[_0xa56e('0x37')][_0xa56e('0x31')]({'where':{'id':_0x528d26[_0xa56e('0x4d')]['id'],'role':_0xa56e('0x2b')},'attributes':['id',_0xa56e('0x34'),_0xa56e('0x26')]})[_0xa56e('0x12')](handleEntityNotFound(_0x385beb,null))[_0xa56e('0x12')](function(_0x120737){if(_0x120737){_0x5f19d2=_0x120737;return db[_0xa56e('0xaf')][_0xa56e('0x25')]({'where':{'membername':_0x5f19d2['name']},'individualHooks':!![]});}})['then'](function(){return db['MemberReport'][_0xa56e('0x42')]({'where':{'membername':_0x5f19d2['name'],'exitAt':null}});})[_0xa56e('0x12')](function(_0x3a465e){var _0x5ddea4=[];_0x3a465e['forEach'](function(_0x23c29d){_0x5ddea4[_0xa56e('0x46')](_0x23c29d[_0xa56e('0xff')]({'exitAt':moment()['format'](_0xa56e('0xf8'))}));});return BPromise[_0xa56e('0x5a')](_0x5ddea4);})[_0xa56e('0x12')](function(){return _0x5f19d2[_0xa56e('0xff')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xa56e('0x12')](respondWithResult(_0x385beb,null))[_0xa56e('0x4b')](handleError(_0x385beb,null));};exports['pause']=function(_0x2cae38,_0x3f6f00){var _0x1a761a;return db[_0xa56e('0xaf')][_0xa56e('0xff')]({'paused':0x1},{'where':{'UserId':_0x2cae38[_0xa56e('0x4d')]['id']},'individualHooks':!![]})['then'](function(){return db['User'][_0xa56e('0x31')]({'where':{'id':_0x2cae38['params']['id'],'role':_0xa56e('0x2b')},'attributes':['id',_0xa56e('0x34'),_0xa56e('0x26'),'internal',_0xa56e('0xa0')]});})['then'](handleEntityNotFound(_0x3f6f00,null))[_0xa56e('0x12')](function(_0x2f1603){if(_0x2f1603){_0x1a761a=_0x2f1603;return respondWithRpcPromise(_0xa56e('0x100'),'pause',{'id':_0x1a761a['id'],'name':_0x1a761a[_0xa56e('0x34')],'pause':!![]});}})[_0xa56e('0x12')](function(){if(_0x1a761a){return db[_0xa56e('0xf6')]['findAll']({'where':{'membername':_0x1a761a[_0xa56e('0x34')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x47851c){if(_0x47851c['length']){var _0x3e59b0=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x301285=0x0,_0x1bec28=_0x47851c['length'];_0x301285<_0x1bec28;_0x301285++){_0x47851c[_0x301285][_0xa56e('0x101')]({'exitAt':_0x3e59b0});}}})[_0xa56e('0x12')](function(){var _0x2711f0=[];var _0x1f5894=utils[_0xa56e('0xf9')]();_0x1f5894[_0xa56e('0xf7')](function(_0x4752c7){_0x2711f0['push']({'channel':_0x4752c7,'membername':_0x1a761a[_0xa56e('0x34')],'interface':_[_0xa56e('0x65')](_0x1a761a[_0xa56e('0xa0')])?util['format'](_0xa56e('0xae'),_0x1a761a['name']):_0x1a761a['interface'],'type':_0xa56e('0xfc'),'enterAt':moment()[_0xa56e('0xad')](_0xa56e('0xf8')),'data1':_0x2cae38[_0xa56e('0x5b')][_0xa56e('0x102')]||_0xa56e('0x103'),'role':_0x1a761a[_0xa56e('0x26')],'internal':_0x1a761a[_0xa56e('0x5e')]});});return db[_0xa56e('0xf6')][_0xa56e('0x83')](_0x2711f0,{'individualHooks':!![]});})[_0xa56e('0x12')](function(){return _0x1a761a[_0xa56e('0xff')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2cae38[_0xa56e('0x5b')][_0xa56e('0x102')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xa56e('0xad')](_0xa56e('0xf8'))});})['then'](respondWithResult(_0x3f6f00,null))['catch'](handleError(_0x3f6f00,null));};exports['unpause']=function(_0x52ad02,_0x2ecd7a){var _0x309b70;return db['User']['find']({'where':{'id':_0x52ad02['params']['id']},'attributes':['id',_0xa56e('0x34'),_0xa56e('0x26'),_0xa56e('0x9f'),_0xa56e('0x104'),'chatPause',_0xa56e('0x105'),_0xa56e('0x106'),_0xa56e('0x107'),_0xa56e('0x108'),'pauseType',_0xa56e('0x109')]})[_0xa56e('0x12')](handleEntityNotFound(_0x2ecd7a,null))[_0xa56e('0x12')](function(_0x1c7a7f){if(_0x1c7a7f){_0x309b70=_0x1c7a7f;if(_0x52ad02[_0xa56e('0x5b')][_0xa56e('0x9c')]&&!utils[_0xa56e('0xa1')](_0x52ad02[_0xa56e('0x5b')]['channel'])){throw new db[(_0xa56e('0x92'))][(_0xa56e('0x8e'))](_0xa56e('0xa2'));}switch(_0x52ad02['body'][_0xa56e('0x9c')]){case _0xa56e('0xaa'):return respondWithRpcPromise('QueuePause',_0xa56e('0x10a'),{'id':_0x309b70['id'],'name':_0x309b70[_0xa56e('0x34')],'pause':![]})[_0xa56e('0x12')](function(){return db[_0xa56e('0xaf')]['update']({'paused':0x0},{'where':{'UserId':_0x309b70['id']},'individualHooks':!![]});})[_0xa56e('0x12')](function(){return db[_0xa56e('0xf6')]['find']({'where':{'channel':_0x52ad02[_0xa56e('0x5b')][_0xa56e('0x9c')],'membername':_0x309b70[_0xa56e('0x34')],'type':_0xa56e('0xfc'),'exitAt':null}});})[_0xa56e('0x12')](function(_0x1d5314){if(_0x1d5314){return _0x1d5314[_0xa56e('0xff')]({'exitAt':moment()[_0xa56e('0xad')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xa56e('0x10b')},{'individualHooks':!![]});}return null;})[_0xa56e('0x12')](function(){return _0x309b70[_0xa56e('0xff')]({'voicePause':![]});});case _0xa56e('0x4a'):case _0xa56e('0x47'):case _0xa56e('0x59'):case _0xa56e('0x49'):case _0xa56e('0x58'):case _0xa56e('0x57'):return db[_0xa56e('0xf6')]['find']({'where':{'channel':_0x52ad02[_0xa56e('0x5b')][_0xa56e('0x9c')],'membername':_0x309b70[_0xa56e('0x34')],'type':_0xa56e('0xfc'),'exitAt':null}})[_0xa56e('0x12')](function(_0x420bbf){if(_0x420bbf){return _0x420bbf[_0xa56e('0xff')]({'exitAt':moment()[_0xa56e('0xad')](_0xa56e('0xf8')),'data2':_0xa56e('0x10b')},{'individualHooks':!![]});}return null;})[_0xa56e('0x12')](function(){var _0x25d013={};_[_0xa56e('0x24')](_0x25d013,util['format'](_0xa56e('0x10c'),_0x52ad02[_0xa56e('0x5b')][_0xa56e('0x9c')],_0xa56e('0x10d')),![]);return _0x309b70[_0xa56e('0xff')](_0x25d013);});default:return respondWithRpcPromise(_0xa56e('0x100'),_0xa56e('0x10a'),{'id':_0x309b70['id'],'name':_0x309b70['name'],'pause':![]})['then'](function(){return db[_0xa56e('0xaf')][_0xa56e('0xff')]({'paused':0x0},{'where':{'UserId':_0x309b70['id']}});})[_0xa56e('0x12')](function(){return db['MemberReport'][_0xa56e('0x42')]({'where':{'membername':_0x309b70[_0xa56e('0x34')],'type':_0xa56e('0xfc'),'exitAt':null}});})[_0xa56e('0x12')](function(_0x2d0a18){var _0x3d15be=[];_0x2d0a18[_0xa56e('0xf7')](function(_0x3198bd){_0x3d15be[_0xa56e('0x46')](_0x3198bd[_0xa56e('0xff')]({'exitAt':moment()[_0xa56e('0xad')](_0xa56e('0xf8')),'data2':_0xa56e('0x10b')}));});return BPromise[_0xa56e('0x5a')](_0x3d15be);})['then'](function(){return _0x309b70[_0xa56e('0xff')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xa56e('0x12')](respondWithResult(_0x2ecd7a,null))[_0xa56e('0x4b')](handleError(_0x2ecd7a,null));};exports[_0xa56e('0x10e')]=function(_0x296da1,_0x23f517){var _0x5dd5cc={};var _0x4c693a={};var _0x2ff4db;var _0x25bb87;return db[_0xa56e('0x37')]['findOne']({'where':{'id':_0x296da1[_0xa56e('0x4d')]['id']}})[_0xa56e('0x12')](handleEntityNotFound(_0x23f517,null))[_0xa56e('0x12')](function(_0x47e4ec){if(_0x47e4ec){_0x2ff4db=_0x47e4ec;_0x4c693a[_0xa56e('0x53')]=_[_0xa56e('0x4f')](db[_0xa56e('0x10f')][_0xa56e('0x38')]);_0x4c693a[_0xa56e('0x3c')]=_['keys'](_0x296da1[_0xa56e('0x3c')]);_0x4c693a[_0xa56e('0x51')]=_[_0xa56e('0x52')](_0x4c693a[_0xa56e('0x53')],_0x4c693a['query']);_0x5dd5cc[_0xa56e('0x41')]=_['intersection'](_0x4c693a[_0xa56e('0x53')],qs[_0xa56e('0x54')](_0x296da1[_0xa56e('0x3c')][_0xa56e('0x54')]));_0x5dd5cc[_0xa56e('0x41')]=_0x5dd5cc['attributes'][_0xa56e('0x45')]?_0x5dd5cc[_0xa56e('0x41')]:_0x4c693a[_0xa56e('0x53')];_0x5dd5cc['order']=qs[_0xa56e('0xce')](_0x296da1[_0xa56e('0x3c')][_0xa56e('0xce')]);_0x5dd5cc[_0xa56e('0x3b')]=qs[_0xa56e('0x51')](_[_0xa56e('0xcf')](_0x296da1[_0xa56e('0x3c')],_0x4c693a[_0xa56e('0x51')]));if(_0x296da1[_0xa56e('0x3c')][_0xa56e('0x2d')]){_0x5dd5cc[_0xa56e('0x3b')]=_['merge'](_0x5dd5cc[_0xa56e('0x3b')],{'$or':_[_0xa56e('0x39')](_0x5dd5cc[_0xa56e('0x41')],function(_0x56ed06){var _0x38f3b2={};_0x38f3b2[_0x56ed06]={'$like':'%'+_0x296da1[_0xa56e('0x3c')]['filter']+'%'};return _0x38f3b2;})});}_0x5dd5cc=_[_0xa56e('0x55')]({},_0x5dd5cc,_0x296da1['options']);return _0x2ff4db[_0xa56e('0x10e')](_0x5dd5cc);}})[_0xa56e('0x12')](function(_0x5a3e7c){if(_0x5a3e7c){_0x25bb87=_0x5a3e7c[_0xa56e('0x45')];if(!_0x296da1[_0xa56e('0x3c')]['hasOwnProperty']('nolimit')){_0x5dd5cc['limit']=qs['limit'](_0x296da1['query'][_0xa56e('0x22')]);_0x5dd5cc['offset']=qs['offset'](_0x296da1[_0xa56e('0x3c')]['offset']);}return _0x2ff4db[_0xa56e('0x10e')](_0x5dd5cc);}})[_0xa56e('0x12')](function(_0x5282c2){if(_0x5282c2){return _0x5282c2?{'count':_0x25bb87,'rows':_0x5282c2}:null;}})[_0xa56e('0x12')](respondWithResult(_0x23f517,null))[_0xa56e('0x4b')](handleError(_0x23f517,null));};exports[_0xa56e('0x110')]=function(_0x211b5f,_0x1eba47){return db[_0xa56e('0x37')][_0xa56e('0x31')]({'where':{'id':_0x211b5f[_0xa56e('0x4d')]['id']}})[_0xa56e('0x12')](handleEntityNotFound(_0x1eba47,null))[_0xa56e('0x12')](function(_0x5d1ec0){if(_0x5d1ec0){var _0xb86c47=_0x5d1ec0[_0xa56e('0xac')]({'plain':!![]});return _0x5d1ec0[_0xa56e('0x110')](_0x211b5f[_0xa56e('0x5b')][_0xa56e('0x5d')],_['omit'](_0x211b5f['body'],[_0xa56e('0x5d'),'id'])||{})[_0xa56e('0x12')](function(){for(var _0x1f0463=0x0;_0x1f0463<_0x211b5f[_0xa56e('0x5b')]['ids'][_0xa56e('0x45')];_0x1f0463++){var _0x2005fe=[];var _0x28d69b={};db['Team']['findOne']({'where':{'id':_0x211b5f['body'][_0xa56e('0x5d')][_0x1f0463]}})['then'](function(_0x1760de){_0x28d69b=_0x1760de['dataValues'];_0x2005fe[_0xa56e('0x46')](_0x1760de[_0xa56e('0xf4')]()['then'](function(_0x7f5fe2){for(var _0x5e9096=0x0;_0x5e9096<_0x7f5fe2[_0xa56e('0x45')];_0x5e9096++){_0x7f5fe2[_0x5e9096][_0xa56e('0x111')]('channel',_0xa56e('0x112'));}return _0x7f5fe2;}));_0x2005fe[_0xa56e('0x46')](_0x1760de[_0xa56e('0x113')]()[_0xa56e('0x12')](function(_0x37f5b9){for(var _0x5e2fb7=0x0;_0x5e2fb7<_0x37f5b9['length'];_0x5e2fb7++){_0x37f5b9[_0x5e2fb7][_0xa56e('0x111')]('channel',_0xa56e('0x114'));}return _0x37f5b9;}));_0x2005fe['push'](_0x1760de[_0xa56e('0x115')]()['then'](function(_0x293b60){for(var _0x1c7046=0x0;_0x1c7046<_0x293b60[_0xa56e('0x45')];_0x1c7046++){_0x293b60[_0x1c7046][_0xa56e('0x111')](_0xa56e('0x9c'),_0xa56e('0x116'));}return _0x293b60;}));_0x2005fe[_0xa56e('0x46')](_0x1760de[_0xa56e('0x117')]()['then'](function(_0x4895ac){for(var _0x6791c0=0x0;_0x6791c0<_0x4895ac[_0xa56e('0x45')];_0x6791c0++){_0x4895ac[_0x6791c0]['setDataValue'](_0xa56e('0x9c'),_0xa56e('0x118'));}return _0x4895ac;}));_0x2005fe[_0xa56e('0x46')](_0x1760de[_0xa56e('0x119')]()[_0xa56e('0x12')](function(_0x5f724a){for(var _0x2912e7=0x0;_0x2912e7<_0x5f724a['length'];_0x2912e7++){_0x5f724a[_0x2912e7]['setDataValue']('channel',_0xa56e('0x11a'));}return _0x5f724a;}));_0x2005fe[_0xa56e('0x46')](_0x1760de[_0xa56e('0x11b')]()['then'](function(_0x523acb){for(var _0x395e31=0x0;_0x395e31<_0x523acb[_0xa56e('0x45')];_0x395e31++){_0x523acb[_0x395e31][_0xa56e('0x111')](_0xa56e('0x9c'),'Fax');}return _0x523acb;}));_0x2005fe[_0xa56e('0x46')](_0x1760de[_0xa56e('0x11c')]()[_0xa56e('0x12')](function(_0x40203a){for(var _0x3c687e=0x0;_0x3c687e<_0x40203a[_0xa56e('0x45')];_0x3c687e++){_0x40203a[_0x3c687e][_0xa56e('0x111')](_0xa56e('0x9c'),_0xa56e('0x11d'));}return _0x40203a;}));return BPromise['all'](_0x2005fe);})['then'](function(_0x2585b6){var _0x10706a=_[_0xa56e('0x11e')](_0x2585b6);_0x2005fe=[];return db[_0xa56e('0x66')][_0xa56e('0x11f')](function(_0x3a8f86){for(var _0x3063b8=0x0;_0x3063b8<_0x10706a[_0xa56e('0x45')];_0x3063b8++){_0x2005fe[_0xa56e('0x46')](_0x10706a[_0x3063b8][_0xa56e('0x120')](_0xb86c47['id']),{'transaction':_0x3a8f86});}return BPromise[_0xa56e('0x5a')](_0x2005fe)[_0xa56e('0x12')](function(){if(_0xb86c47[_0xa56e('0x9d')]){return BPromise[_0xa56e('0x88')](_[_0xa56e('0x2d')](_0x10706a,function(_0x323dda){return _0x323dda[_0xa56e('0x121')](_0xa56e('0x9c'))==='Voice';}),function(_0x19b8f7){return db[_0xa56e('0xaf')][_0xa56e('0xb0')]({'membername':_0xb86c47[_0xa56e('0x34')],'UserId':_0xb86c47['id'],'queue_name':_0x19b8f7[_0xa56e('0x34')],'VoiceQueueId':_0x19b8f7['id'],'interface':_[_0xa56e('0x65')](_0xb86c47[_0xa56e('0xa0')])?util['format']('SIP/%s',_0xb86c47[_0xa56e('0x34')]):_0xb86c47[_0xa56e('0xa0')],'paused':_0xb86c47['voicePause']||![],'penalty':_0xb86c47['penalty']},{'transaction':_0x3a8f86});});}else{return;}})[_0xa56e('0x12')](function(){for(var _0x496bc6=0x0;_0x496bc6<_0x10706a['length'];_0x496bc6++){var _0x3128a3=_0x10706a[_0x496bc6][_0xa56e('0x121')]('channel');var _0x3c142d=_0x3128a3+'QueueId';socket[_0xa56e('0xb6')](_0xa56e('0x29')+_0x3128a3+'Queue:save',{'UserId':_0xb86c47['id'],['queueField']:_0x10706a[_0x496bc6]['id']});}});});})[_0xa56e('0x12')](function(){db['TeamVoicePrefix'][_0xa56e('0x95')]({'where':{'teamId':_0x28d69b['id']}})['then'](function(_0x11a633){if(_0x11a633){db['UserVoicePrefix']['create']({'UserId':_0x211b5f[_0xa56e('0x4d')]['id'],'VoicePrefixId':_0x11a633[_0xa56e('0x122')]});}});});}});}})[_0xa56e('0x12')](respondWithStatusCode(_0x1eba47,null))[_0xa56e('0x4b')](handleError(_0x1eba47,null));};exports['removeTeams']=function(_0x3a2395,_0x494b47){return db[_0xa56e('0x37')][_0xa56e('0x95')]({'where':{'id':_0x3a2395['params']['id']}})['then'](handleEntityNotFound(_0x494b47,null))['then'](function(_0x55fa16){if(_0x55fa16){var _0xb93dbc=_0x55fa16['get']({'plain':!![]});var _0x4164d=_0x3a2395['query'][_0xa56e('0x5d')];return _0x55fa16[_0xa56e('0x123')](_0x4164d)[_0xa56e('0x12')](function(){for(var _0x338f86=0x0;_0x338f86<_0x4164d[_0xa56e('0x45')];_0x338f86++){var _0x48cf48=[];var _0x5e73a6={};db[_0xa56e('0x10f')][_0xa56e('0x95')]({'where':{'id':_0x4164d[_0x338f86]}})[_0xa56e('0x12')](function(_0x14fc15){_0x5e73a6=_0x14fc15['dataValues'];_0x48cf48['push'](_0x14fc15[_0xa56e('0xf4')]()[_0xa56e('0x12')](function(_0x3beb1a){for(var _0x2b656d=0x0;_0x2b656d<_0x3beb1a[_0xa56e('0x45')];_0x2b656d++){_0x3beb1a[_0x2b656d][_0xa56e('0x111')]('channel',_0xa56e('0x112'));}return _0x3beb1a;}));_0x48cf48[_0xa56e('0x46')](_0x14fc15[_0xa56e('0x113')]()[_0xa56e('0x12')](function(_0x4a88d7){for(var _0x4e11c5=0x0;_0x4e11c5<_0x4a88d7['length'];_0x4e11c5++){_0x4a88d7[_0x4e11c5]['setDataValue'](_0xa56e('0x9c'),_0xa56e('0x114'));}return _0x4a88d7;}));_0x48cf48['push'](_0x14fc15[_0xa56e('0x115')]()[_0xa56e('0x12')](function(_0x4400e1){for(var _0x2fe610=0x0;_0x2fe610<_0x4400e1[_0xa56e('0x45')];_0x2fe610++){_0x4400e1[_0x2fe610][_0xa56e('0x111')]('channel','Mail');}return _0x4400e1;}));_0x48cf48['push'](_0x14fc15['getSmsQueues']()[_0xa56e('0x12')](function(_0x287747){for(var _0x4588a0=0x0;_0x4588a0<_0x287747[_0xa56e('0x45')];_0x4588a0++){_0x287747[_0x4588a0][_0xa56e('0x111')]('channel',_0xa56e('0x118'));}return _0x287747;}));_0x48cf48[_0xa56e('0x46')](_0x14fc15[_0xa56e('0x119')]()[_0xa56e('0x12')](function(_0x45d322){for(var _0x5369b6=0x0;_0x5369b6<_0x45d322[_0xa56e('0x45')];_0x5369b6++){_0x45d322[_0x5369b6][_0xa56e('0x111')](_0xa56e('0x9c'),_0xa56e('0x11a'));}return _0x45d322;}));_0x48cf48[_0xa56e('0x46')](_0x14fc15[_0xa56e('0x11b')]()[_0xa56e('0x12')](function(_0x5c1983){for(var _0x597774=0x0;_0x597774<_0x5c1983['length'];_0x597774++){_0x5c1983[_0x597774][_0xa56e('0x111')](_0xa56e('0x9c'),_0xa56e('0x124'));}return _0x5c1983;}));_0x48cf48['push'](_0x14fc15['getOpenchannelQueues']()['then'](function(_0x5e5335){for(var _0x351324=0x0;_0x351324<_0x5e5335['length'];_0x351324++){_0x5e5335[_0x351324][_0xa56e('0x111')]('channel',_0xa56e('0x11d'));}return _0x5e5335;}));return BPromise[_0xa56e('0x5a')](_0x48cf48);})[_0xa56e('0x12')](function(_0x7f20ca){var _0x584d07=_[_0xa56e('0x11e')](_0x7f20ca);_0x48cf48=[];return db[_0xa56e('0x66')][_0xa56e('0x11f')](function(_0x1b3b03){for(var _0x35074d=0x0;_0x35074d<_0x584d07[_0xa56e('0x45')];_0x35074d++){_0x48cf48[_0xa56e('0x46')](_0x584d07[_0x35074d][_0xa56e('0x125')](_0xb93dbc['id']),{'transaction':_0x1b3b03});}return BPromise['all'](_0x48cf48)[_0xa56e('0x12')](function(){if(_0xb93dbc[_0xa56e('0x9d')]){return BPromise[_0xa56e('0x88')](_[_0xa56e('0x2d')](_0x584d07,function(_0x2ffce2){return _0x2ffce2['getDataValue']('channel')===_0xa56e('0x112');}),function(_0x38624c){return db[_0xa56e('0xaf')]['destroy']({'where':{'VoiceQueueId':_0x38624c['id'],'UserId':_0xb93dbc['id']},'transaction':_0x1b3b03});});}else{return;}})[_0xa56e('0x12')](function(){db[_0xa56e('0x126')][_0xa56e('0x95')]({'where':{'teamId':_0x5e73a6['id']}})[_0xa56e('0x12')](function(_0x4b6611){if(_0x4b6611){return db['UserVoicePrefix'][_0xa56e('0x25')]({'where':{'UserId':_0xb93dbc['id'],'VoicePrefixId':_0x4b6611['dataValues'][_0xa56e('0x122')]}});}});})[_0xa56e('0x12')](function(){for(var _0x4610a8=0x0;_0x4610a8<_0x584d07[_0xa56e('0x45')];_0x4610a8++){var _0x38d689=_0x584d07[_0x4610a8][_0xa56e('0x121')](_0xa56e('0x9c'));var _0x544a4e=_0x38d689+_0xa56e('0xb5');socket[_0xa56e('0xb6')](_0xa56e('0x29')+_0x38d689+_0xa56e('0xb4'),{'UserId':_0xb93dbc['id'],['queueField']:_0x584d07[_0x4610a8]['id']});}});});});}});}})[_0xa56e('0x12')](respondWithStatusCode(_0x494b47,null))[_0xa56e('0x4b')](handleError(_0x494b47,null));};exports[_0xa56e('0x127')]=function(_0x1eea61,_0xd4d800){var _0x98f93a={};var _0x3a3a0b={};var _0x1a2375;var _0x98c3dd;return db[_0xa56e('0x37')]['findOne']({'where':{'id':_0x1eea61[_0xa56e('0x4d')]['id']}})[_0xa56e('0x12')](handleEntityNotFound(_0xd4d800,null))['then'](function(_0x3a8a5c){if(_0x3a8a5c){_0x1a2375=_0x3a8a5c;_0x3a3a0b[_0xa56e('0x53')]=_[_0xa56e('0x4f')](db[_0xa56e('0xd1')]['rawAttributes']);_0x3a3a0b[_0xa56e('0x3c')]=_['keys'](_0x1eea61[_0xa56e('0x3c')]);_0x3a3a0b[_0xa56e('0x51')]=_[_0xa56e('0x52')](_0x3a3a0b[_0xa56e('0x53')],_0x3a3a0b[_0xa56e('0x3c')]);_0x98f93a[_0xa56e('0x41')]=_[_0xa56e('0x52')](_0x3a3a0b[_0xa56e('0x53')],qs[_0xa56e('0x54')](_0x1eea61[_0xa56e('0x3c')]['fields']));_0x98f93a[_0xa56e('0x41')]=_0x98f93a['attributes'][_0xa56e('0x45')]?_0x98f93a[_0xa56e('0x41')]:_0x3a3a0b[_0xa56e('0x53')];_0x98f93a[_0xa56e('0xcd')]=qs[_0xa56e('0xce')](_0x1eea61[_0xa56e('0x3c')]['sort']);_0x98f93a[_0xa56e('0x3b')]=qs[_0xa56e('0x51')](_[_0xa56e('0xcf')](_0x1eea61['query'],_0x3a3a0b['filters']));if(_0x1eea61[_0xa56e('0x3c')][_0xa56e('0x2d')]){_0x98f93a['where']=_['merge'](_0x98f93a[_0xa56e('0x3b')],{'$or':_[_0xa56e('0x39')](_0x98f93a[_0xa56e('0x41')],function(_0x53ddcb){var _0x50c7de={};_0x50c7de[_0x53ddcb]={'$like':'%'+_0x1eea61[_0xa56e('0x3c')][_0xa56e('0x2d')]+'%'};return _0x50c7de;})});}_0x98f93a=_[_0xa56e('0x55')]({},_0x98f93a,_0x1eea61[_0xa56e('0xd5')]);return _0x1a2375[_0xa56e('0x127')](_0x98f93a);}})[_0xa56e('0x12')](function(_0x16d4f7){if(_0x16d4f7){_0x98c3dd=_0x16d4f7[_0xa56e('0x45')];if(!_0x1eea61[_0xa56e('0x3c')]['hasOwnProperty']('nolimit')){_0x98f93a[_0xa56e('0x22')]=qs[_0xa56e('0x22')](_0x1eea61[_0xa56e('0x3c')]['limit']);_0x98f93a[_0xa56e('0x20')]=qs[_0xa56e('0x20')](_0x1eea61[_0xa56e('0x3c')][_0xa56e('0x20')]);}return _0x1a2375[_0xa56e('0x127')](_0x98f93a);}})[_0xa56e('0x12')](function(_0x2c9155){if(_0x2c9155){return _0x2c9155?{'count':_0x98c3dd,'rows':_0x2c9155}:null;}})[_0xa56e('0x12')](respondWithResult(_0xd4d800,null))[_0xa56e('0x4b')](handleError(_0xd4d800,null));};exports[_0xa56e('0x128')]=function(_0x8621a,_0x554305){var _0xea9f49={};var _0x449b18={};var _0x36c43d;return db[_0xa56e('0x37')][_0xa56e('0x95')]({'where':{'id':_0x8621a[_0xa56e('0x4d')]['id']}})[_0xa56e('0x12')](handleEntityNotFound(_0x554305,null))[_0xa56e('0x12')](function(_0x1aba47){if(_0x1aba47){_0x36c43d=_0x1aba47;_0x449b18[_0xa56e('0x53')]=_[_0xa56e('0x4f')](db[_0xa56e('0x37')][_0xa56e('0x38')]);_0x449b18[_0xa56e('0x3c')]=_[_0xa56e('0x4f')](_0x8621a[_0xa56e('0x3c')]);_0x449b18[_0xa56e('0x51')]=_['intersection'](_0x449b18[_0xa56e('0x53')],_0x449b18[_0xa56e('0x3c')]);_0xea9f49[_0xa56e('0x41')]=_[_0xa56e('0x52')](_0x449b18[_0xa56e('0x53')],qs['fields'](_0x8621a['query']['fields']));_0xea9f49[_0xa56e('0x41')]=_0xea9f49['attributes'][_0xa56e('0x45')]?_0xea9f49[_0xa56e('0x41')]:_0x449b18[_0xa56e('0x53')];_0xea9f49[_0xa56e('0xcd')]=qs['sort'](_0x8621a['query'][_0xa56e('0xce')]);_0xea9f49['where']=qs[_0xa56e('0x51')](_[_0xa56e('0xcf')](_0x8621a[_0xa56e('0x3c')],_0x449b18[_0xa56e('0x51')]));if(_0x8621a[_0xa56e('0x3c')][_0xa56e('0x2d')]){_0xea9f49[_0xa56e('0x3b')]=_[_0xa56e('0x55')](_0xea9f49[_0xa56e('0x3b')],{'$or':_[_0xa56e('0x39')](_0xea9f49[_0xa56e('0x41')],function(_0x699f1e){var _0x3cb48a={};_0x3cb48a[_0x699f1e]={'$like':'%'+_0x8621a['query'][_0xa56e('0x2d')]+'%'};return _0x3cb48a;})});}_0xea9f49['model']=db[_0xa56e('0x37')];_0xea9f49['as']=_0xa56e('0x2a');_0xea9f49=_[_0xa56e('0x55')]({},_0xea9f49,_0x8621a[_0xa56e('0xd5')]);return _0x36c43d[_0xa56e('0xf4')]({'include':[_0xea9f49]});}})[_0xa56e('0x12')](function(_0x3e85bc){if(_0x3e85bc){var _0x1f3001={},_0x198053=[];for(var _0x1cfd2f=0x0;_0x1cfd2f<_0x3e85bc[_0xa56e('0x45')];_0x1cfd2f+=0x1){for(var _0x178bf3=0x0,_0x370d8b;_0x178bf3<_0x3e85bc[_0x1cfd2f]['Agents'][_0xa56e('0x45')];_0x178bf3+=0x1){_0x370d8b=_0x3e85bc[_0x1cfd2f][_0xa56e('0x2a')][_0x178bf3][_0xa56e('0xac')]({'plain':!![]});_0x1f3001[_0x370d8b['id']]=_0x370d8b;}}_0x1f3001=_[_0xa56e('0x129')](_0x1f3001);for(var _0x58bdbd=qs[_0xa56e('0x20')](_0x8621a[_0xa56e('0x3c')]['offset']);_0x58bdbd<_0x1f3001[_0xa56e('0x45')]&&_0x198053[_0xa56e('0x45')]=_0x529376['agents']){throw new Error(_0x3f68('0x54'));}})[_0x3f68('0xe')](function(){if(_0x27bf01){return db['UserVoiceQueueRt'][_0x3f68('0x55')]({'where':{'membername':_0x27bf01[_0x3f68('0x26')]},'individualHooks':!![]});}})['then'](function(){if(_0x27bf01){return _0x27bf01['getVoiceQueues']({'raw':!![]});}})[_0x3f68('0xe')](function(_0x15e4fb){if(_0x27bf01){if(_0x15e4fb){var _0x5c339c=[];_0x3e6fb2=_0x15e4fb;if(_0x3e6fb2[_0x3f68('0x2e')]){for(var _0x10b232=0x0;_0x10b232<_0x3e6fb2[_0x3f68('0x2e')];_0x10b232++){_0x5c339c[_0x3f68('0x33')](db[_0x3f68('0x29')][_0x3f68('0x56')]({'membername':_0x27bf01[_0x3f68('0x26')],'UserId':_0x27bf01['id'],'queue_name':_0x3e6fb2[_0x10b232][_0x3f68('0x26')],'VoiceQueueId':_0x3e6fb2[_0x10b232]['id'],'interface':_0x1cc592,'paused':_0x27bf01[_0x3f68('0x4e')]||![],'penalty':_0x3e6fb2[_0x10b232][_0x3f68('0x57')]||0x0}));}return BPromise[_0x3f68('0x4a')](_0x5c339c);}}}})[_0x3f68('0xe')](function(){if(_0x27bf01){return db[_0x3f68('0x2b')][_0x3f68('0x2c')]({'where':{'membername':_0x27bf01[_0x3f68('0x26')],'exitAt':null}});}})[_0x3f68('0xe')](function(_0x14fa44){if(_0x27bf01){if(_0x14fa44&&_0x14fa44['length']){var _0xbd380b=[];_0x14fa44[_0x3f68('0x32')](function(_0x3fd121){_0xbd380b[_0x3f68('0x33')](_0x3fd121[_0x3f68('0x2a')]({'exitAt':moment()[_0x3f68('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0xbd380b);}}})[_0x3f68('0xe')](function(_0x538526){if(_0x27bf01){var _0x58c887=[];var _0x2f587d=[];var _0x51c9db=utils['getChannels']();var _0x404c3f={'membername':_0x27bf01[_0x3f68('0x26')],'interface':_0x1cc592,'enterAt':moment()[_0x3f68('0x2f')](_0x3f68('0x35')),'role':_0x27bf01[_0x3f68('0x4c')],'internal':_0x27bf01[_0x3f68('0x27')]};_0x51c9db[_0x3f68('0x32')](function(_0x4e7c0f){_0x58c887['push'](_[_0x3f68('0x58')]({'channel':_0x4e7c0f,'type':_0x3f68('0x59'),'data1':'callysquare','data2':_0x1cc592},_0x404c3f));if(_0x27bf01['loginInPause']){_0x2f587d[_0x3f68('0x33')](_[_0x3f68('0x58')]({'channel':_0x4e7c0f,'type':'PAUSE','data1':_0x3f68('0x5a')},_0x404c3f));}});return db[_0x3f68('0x2b')][_0x3f68('0x37')](_0x58c887[_0x3f68('0x5b')](_0x2f587d),{'individualHooks':!![]});}})[_0x3f68('0xe')](function(){if(_0x27bf01){return _0x27bf01[_0x3f68('0x2a')]({'online':!![],'lastLoginAt':moment()[_0x3f68('0x2f')](_0x3f68('0x35')),'voicePause':_0x27bf01[_0x3f68('0x4e')]||![],'mailPause':_0x27bf01[_0x3f68('0x4e')]||![],'chatPause':_0x27bf01[_0x3f68('0x4e')]||![],'faxPause':_0x27bf01[_0x3f68('0x4e')]||![],'smsPause':_0x27bf01[_0x3f68('0x4e')]||![],'openchannelPause':_0x27bf01[_0x3f68('0x4e')]||![],'pauseType':_0x27bf01[_0x3f68('0x4e')]?_0x3f68('0x5a'):null,'lastPauseAt':moment()[_0x3f68('0x2f')](_0x3f68('0x35')),'interface':_0x1cc592});}})['then'](function(_0x376655){_0x22ad18(_0x376655);})[_0x3f68('0x18')](function(_0x28a9a9){_0x5ee649(_0xa9227d[_0x3f68('0x15')](0x1f4,_0x28a9a9[_0x3f68('0x17')]));});});}; \ No newline at end of file +var _0xdef7=['concat','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','register','request','then','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','User','findAll','options','where','attributes','include','map','model','GetUser','debug','catch','find','raw','ShowUser','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','findOne','isValidChannel','channel','Unknown\x20channel','voice','system','chat','openchannel','whatsapp','push','destroy','all','mobile','phone','loginInPause','count','../../config/license/util','getLicense','agents','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','LOGININPAUSE'];(function(_0x136e1d,_0x18fee9){var _0x3e0f37=function(_0x2c4dbf){while(--_0x2c4dbf){_0x136e1d['push'](_0x136e1d['shift']());}};_0x3e0f37(++_0x18fee9);}(_0xdef7,0x1b4));var _0x7def=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdef7[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7def('0x0'));var util=require(_0x7def('0x1'));var moment=require(_0x7def('0x2'));var BPromise=require(_0x7def('0x3'));var rs=require(_0x7def('0x4'));var fs=require('fs');var Redis=require(_0x7def('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7def('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x7def('0x7'));var jayson=require(_0x7def('0x8'));var client=jayson['client'][_0x7def('0x9')]({'port':0x232a});config[_0x7def('0xa')]=_[_0x7def('0xb')](config[_0x7def('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7def('0xa')]));require('./user.socket')[_0x7def('0xc')](socket);function respondWithRpcPromise(_0x5414e6,_0x5b0e5b,_0x47419d){return new BPromise(function(_0x16839e,_0x8c726c){return client[_0x7def('0xd')](_0x5414e6,_0x47419d)[_0x7def('0xe')](function(_0x59bdd5){logger['info'](_0x7def('0xf'),_0x5b0e5b,_0x7def('0x10'));logger['debug'](_0x7def('0x11'),_0x5b0e5b,_0x7def('0x10'),JSON[_0x7def('0x12')](_0x59bdd5));if(_0x59bdd5[_0x7def('0x13')]){if(_0x59bdd5[_0x7def('0x13')][_0x7def('0x14')]===0x1f4){logger[_0x7def('0x13')](_0x7def('0xf'),_0x5b0e5b,_0x59bdd5[_0x7def('0x13')][_0x7def('0x15')]);return _0x8c726c(_0x59bdd5[_0x7def('0x13')][_0x7def('0x15')]);}logger['error'](_0x7def('0xf'),_0x5b0e5b,_0x59bdd5[_0x7def('0x13')][_0x7def('0x15')]);return _0x16839e(_0x59bdd5['error'][_0x7def('0x15')]);}else{logger[_0x7def('0x16')](_0x7def('0xf'),_0x5b0e5b,_0x7def('0x10'));_0x16839e(_0x59bdd5[_0x7def('0x17')]['message']);}})['catch'](function(_0x48ef9d){logger['error'](_0x7def('0xf'),_0x5b0e5b,_0x48ef9d);_0x8c726c(_0x48ef9d);});});}exports['GetUser']=function(_0x3e2586){var _0xd5a7e6=this;return new Promise(function(_0x29e102,_0x594d6a){return db[_0x7def('0x18')][_0x7def('0x19')]({'raw':_0x3e2586[_0x7def('0x1a')]?_0x3e2586['options']['raw']===undefined?!![]:![]:!![],'where':_0x3e2586[_0x7def('0x1a')]?_0x3e2586[_0x7def('0x1a')][_0x7def('0x1b')]||null:null,'attributes':_0x3e2586[_0x7def('0x1a')]?_0x3e2586[_0x7def('0x1a')][_0x7def('0x1c')]||null:null,'limit':_0x3e2586[_0x7def('0x1a')]?_0x3e2586[_0x7def('0x1a')]['limit']||null:null,'include':_0x3e2586['options']?_0x3e2586['options'][_0x7def('0x1d')]?_[_0x7def('0x1e')](_0x3e2586['options']['include'],function(_0x256c58){return{'model':db[_0x256c58[_0x7def('0x1f')]],'as':_0x256c58['as'],'attributes':_0x256c58[_0x7def('0x1c')],'include':_0x256c58[_0x7def('0x1d')]?_['map'](_0x256c58[_0x7def('0x1d')],function(_0x1dbd6a){return{'model':db[_0x1dbd6a[_0x7def('0x1f')]],'as':_0x1dbd6a['as'],'attributes':_0x1dbd6a['attributes'],'include':_0x1dbd6a[_0x7def('0x1d')]?_['map'](_0x1dbd6a['include'],function(_0x9a2429){return{'model':db[_0x9a2429['model']],'as':_0x9a2429['as'],'attributes':_0x9a2429[_0x7def('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x114280){logger[_0x7def('0x16')](_0x7def('0x20'),_0x3e2586);logger[_0x7def('0x21')](_0x7def('0x20'),_0x3e2586,JSON[_0x7def('0x12')](_0x114280));_0x29e102(_0x114280);})[_0x7def('0x22')](function(_0x4b94f8){logger[_0x7def('0x13')](_0x7def('0x20'),_0x4b94f8[_0x7def('0x15')],_0x3e2586);_0x594d6a(_0xd5a7e6[_0x7def('0x13')](0x1f4,_0x4b94f8[_0x7def('0x15')]));});});};exports['ShowUser']=function(_0x2cbf43){var _0x32d3a9=this;return new Promise(function(_0x34c123,_0x5dc9ca){return db[_0x7def('0x18')][_0x7def('0x23')]({'raw':_0x2cbf43[_0x7def('0x1a')]?_0x2cbf43[_0x7def('0x1a')][_0x7def('0x24')]===undefined?!![]:![]:!![],'where':_0x2cbf43[_0x7def('0x1a')]?_0x2cbf43['options']['where']||null:null,'attributes':_0x2cbf43[_0x7def('0x1a')]?_0x2cbf43[_0x7def('0x1a')][_0x7def('0x1c')]||null:null,'include':_0x2cbf43['options']?_0x2cbf43['options'][_0x7def('0x1d')]?_[_0x7def('0x1e')](_0x2cbf43[_0x7def('0x1a')][_0x7def('0x1d')],function(_0x565e5f){return{'model':db[_0x565e5f[_0x7def('0x1f')]],'as':_0x565e5f['as'],'attributes':_0x565e5f['attributes'],'include':_0x565e5f[_0x7def('0x1d')]?_[_0x7def('0x1e')](_0x565e5f[_0x7def('0x1d')],function(_0x520ccc){return{'model':db[_0x520ccc[_0x7def('0x1f')]],'as':_0x520ccc['as'],'attributes':_0x520ccc['attributes'],'include':_0x520ccc[_0x7def('0x1d')]?_[_0x7def('0x1e')](_0x520ccc[_0x7def('0x1d')],function(_0x27bab0){return{'model':db[_0x27bab0[_0x7def('0x1f')]],'as':_0x27bab0['as'],'attributes':_0x27bab0[_0x7def('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7def('0xe')](function(_0x561fb5){logger[_0x7def('0x16')](_0x7def('0x25'),_0x2cbf43);logger['debug'](_0x7def('0x25'),_0x2cbf43,JSON[_0x7def('0x12')](_0x561fb5));_0x34c123(_0x561fb5);})[_0x7def('0x22')](function(_0x1fb9c7){logger[_0x7def('0x13')]('ShowUser',_0x1fb9c7['message'],_0x2cbf43);_0x5dc9ca(_0x32d3a9[_0x7def('0x13')](0x1f4,_0x1fb9c7[_0x7def('0x15')]));});});};exports[_0x7def('0x26')]=function(_0x3374f5){var _0x563596=this;return new Promise(function(_0x2e57d1,_0x18a38e){var _0x130042;return db['User']['find']({'where':_0x3374f5[_0x7def('0x1a')][_0x7def('0x1b')]||{},'attributes':['id',_0x7def('0x27'),_0x7def('0x28'),_0x7def('0x29'),_0x7def('0x2a')]})[_0x7def('0xe')](function(_0x544c18){if(_0x544c18){_0x130042=_0x544c18;return db[_0x7def('0x2b')][_0x7def('0x2c')]({'paused':0x1},{'where':{'UserId':_0x130042['id']},'individualHooks':!![]});}})['then'](function(){if(_0x130042){return db[_0x7def('0x2d')][_0x7def('0x19')]({'where':{'membername':_0x130042['name'],'type':_0x7def('0x2e'),'exitAt':null}});}})[_0x7def('0xe')](function(_0x464e6f){if(_0x130042){if(_0x464e6f&&_0x464e6f[_0x7def('0x2f')]){var _0x314cf=moment()[_0x7def('0x30')](_0x7def('0x31'));for(var _0x232ac4=0x0,_0x585ba6=_0x464e6f['length'];_0x232ac4<_0x585ba6;_0x232ac4++){_0x464e6f[_0x232ac4][_0x7def('0x32')]({'exitAt':_0x314cf});}}}})['then'](function(){if(_0x130042){var _0x14b228=[];var _0x25b7e4=utils[_0x7def('0x33')]();_0x25b7e4[_0x7def('0x34')](function(_0x2a775b){_0x14b228['push']({'channel':_0x2a775b,'membername':_0x130042['name'],'interface':_[_0x7def('0x35')](_0x130042[_0x7def('0x2a')])?util[_0x7def('0x30')](_0x7def('0x36'),_0x130042[_0x7def('0x27')]):_0x130042[_0x7def('0x2a')],'type':'PAUSE','enterAt':moment()['format'](_0x7def('0x31')),'data1':_0x3374f5[_0x7def('0x37')][_0x7def('0x38')]||_0x7def('0x39'),'role':_0x130042['role'],'internal':_0x130042['internal'],'uniqueid':_0x3374f5['body'][_0x7def('0x3a')]||null});});return db[_0x7def('0x2d')][_0x7def('0x3b')](_0x14b228,{'individualHooks':!![]});}})[_0x7def('0xe')](function(){if(_0x130042){return _0x130042[_0x7def('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3374f5['body'][_0x7def('0x38')]||_0x7def('0x39'),'lastPauseAt':moment()[_0x7def('0x30')](_0x7def('0x31'))});}})['then'](function(_0x3966e1){_0x2e57d1(_0x3966e1);})[_0x7def('0x22')](function(_0x5591e9){_0x18a38e(_0x563596['error'](0x1f4,_0x5591e9[_0x7def('0x15')]));});});};exports[_0x7def('0x3c')]=function(_0x5aaee5){var _0x3cf871=this;return new Promise(function(_0x1233ae,_0x377999){var _0x560d1c;return db['User'][_0x7def('0x3d')]({'where':_0x5aaee5[_0x7def('0x1a')]['where']||{},'attributes':['id','name']})[_0x7def('0xe')](function(_0x11f93f){if(_0x11f93f){_0x560d1c=_0x11f93f;if(_0x5aaee5[_0x7def('0x37')]['channel']&&!utils[_0x7def('0x3e')](_0x5aaee5['body'][_0x7def('0x3f')])){throw new Error(_0x7def('0x40'));}switch(_0x5aaee5[_0x7def('0x37')][_0x7def('0x3f')]){case _0x7def('0x41'):return db[_0x7def('0x2b')][_0x7def('0x2c')]({'paused':0x0},{'where':{'UserId':_0x560d1c['id']}})[_0x7def('0xe')](function(){return db[_0x7def('0x2d')][_0x7def('0x23')]({'where':{'channel':_0x5aaee5[_0x7def('0x37')][_0x7def('0x3f')],'membername':_0x560d1c[_0x7def('0x27')],'type':_0x7def('0x2e'),'exitAt':null}});})[_0x7def('0xe')](function(_0x3b8bbe){if(_0x3b8bbe){return _0x3b8bbe[_0x7def('0x2c')]({'exitAt':moment()[_0x7def('0x30')](_0x7def('0x31')),'data2':_0x7def('0x42')},{'individualHooks':!![]});}return null;})[_0x7def('0xe')](function(){return _0x560d1c[_0x7def('0x2c')]({'voicePause':![]});});case'mail':case _0x7def('0x43'):case'fax':case'sms':case _0x7def('0x44'):case _0x7def('0x45'):return db['MemberReport']['find']({'where':{'channel':_0x5aaee5[_0x7def('0x37')][_0x7def('0x3f')],'membername':_0x560d1c[_0x7def('0x27')],'type':_0x7def('0x2e'),'exitAt':null}})[_0x7def('0xe')](function(_0x161cfc){return _0x161cfc[_0x7def('0x2c')]({'exitAt':moment()[_0x7def('0x30')](_0x7def('0x31')),'data2':_0x7def('0x42')},{'individualHooks':!![]});})[_0x7def('0xe')](function(){var _0x521dc2={};_['set'](_0x521dc2,util[_0x7def('0x30')]('%s%s',_0x5aaee5[_0x7def('0x37')][_0x7def('0x3f')],'Pause'),![]);return _0x560d1c[_0x7def('0x2c')](_0x521dc2);});default:return db[_0x7def('0x2b')][_0x7def('0x2c')]({'paused':0x0},{'where':{'UserId':_0x560d1c['id']}})[_0x7def('0xe')](function(){return db[_0x7def('0x2d')][_0x7def('0x19')]({'where':{'membername':_0x560d1c['name'],'type':_0x7def('0x2e'),'exitAt':null}});})['then'](function(_0x4a70c3){var _0x55e021=[];_0x4a70c3[_0x7def('0x34')](function(_0x5c7d30){_0x55e021[_0x7def('0x46')](_0x5c7d30[_0x7def('0x2c')]({'exitAt':moment()[_0x7def('0x30')](_0x7def('0x31')),'data2':_0x7def('0x42')}));});return BPromise['all'](_0x55e021);})[_0x7def('0xe')](function(){return _0x560d1c[_0x7def('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x7def('0xe')](function(_0xfe1b61){_0x1233ae(_0xfe1b61);})[_0x7def('0x22')](function(_0x437e18){_0x377999(_0x3cf871['error'](0x1f4,_0x437e18[_0x7def('0x15')]));});});};exports['LogoutUser']=function(_0x16a8be){var _0x131881=this;return new Promise(function(_0x35666a,_0x45c634){var _0x80bda4;return db[_0x7def('0x18')]['findOne']({'where':_0x16a8be['options'][_0x7def('0x1b')]||{},'attributes':['id',_0x7def('0x27')]})[_0x7def('0xe')](function(_0x22284e){if(_0x22284e){_0x80bda4=_0x22284e;return db[_0x7def('0x2b')][_0x7def('0x47')]({'where':{'membername':_0x80bda4[_0x7def('0x27')]},'individualHooks':!![]});}})[_0x7def('0xe')](function(){if(_0x80bda4){return db['MemberReport'][_0x7def('0x19')]({'where':{'membername':_0x80bda4[_0x7def('0x27')],'exitAt':null}});}})[_0x7def('0xe')](function(_0x771d70){if(_0x80bda4){if(_0x771d70&&_0x771d70[_0x7def('0x2f')]){var _0x48d012=[];_0x771d70[_0x7def('0x34')](function(_0x2e11d5){_0x48d012['push'](_0x2e11d5['update']({'exitAt':moment()[_0x7def('0x30')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x7def('0x48')](_0x48d012);}}})['then'](function(){if(_0x80bda4){return _0x80bda4['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x7def('0xe')](function(_0x5567cb){_0x35666a(_0x5567cb);})[_0x7def('0x22')](function(_0x200a55){_0x45c634(_0x131881[_0x7def('0x13')](0x1f4,_0x200a55[_0x7def('0x15')]));});});};exports['LoginUser']=function(_0x11c32e){var _0x182104=this;return new Promise(function(_0x33f9ee,_0x5956d8){var _0x2ede48;var _0x29dcc6;var _0x20de82;var _0x40a637;return db[_0x7def('0x18')]['findOne']({'where':_0x11c32e[_0x7def('0x1a')]['where']||{},'attributes':['id','name',_0x7def('0x28'),_0x7def('0x49'),_0x7def('0x4a'),_0x7def('0x29'),_0x7def('0x4b'),_0x7def('0x2a')]})[_0x7def('0xe')](function(_0x28d01f){if(_0x28d01f){_0x2ede48=_0x28d01f;_0x40a637=_0x11c32e['body'][_0x7def('0x2a')]?_0x11c32e[_0x7def('0x37')][_0x7def('0x2a')]:util[_0x7def('0x30')]('SIP/%s',_0x2ede48[_0x7def('0x27')]);return db[_0x7def('0x18')][_0x7def('0x4c')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x2ede48['id']}}});}})[_0x7def('0xe')](function(_0x490037){if(_0x490037){_0x20de82=_0x490037;return require(_0x7def('0x4d'))[_0x7def('0x4e')]();}})['then'](function(_0x534685){if(_0x534685&&_0x534685[_0x7def('0x4f')]&&_0x20de82>=_0x534685['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x2ede48){return db['UserVoiceQueueRt'][_0x7def('0x47')]({'where':{'membername':_0x2ede48['name']},'individualHooks':!![]});}})[_0x7def('0xe')](function(){if(_0x2ede48){return _0x2ede48[_0x7def('0x50')]({'raw':!![]});}})['then'](function(_0x4ad472){if(_0x2ede48){if(_0x4ad472){var _0x5f03f5=[];_0x29dcc6=_0x4ad472;if(_0x29dcc6[_0x7def('0x2f')]){for(var _0x167cb5=0x0;_0x167cb5<_0x29dcc6['length'];_0x167cb5++){_0x5f03f5[_0x7def('0x46')](db[_0x7def('0x2b')][_0x7def('0x51')]({'membername':_0x2ede48[_0x7def('0x27')],'UserId':_0x2ede48['id'],'queue_name':_0x29dcc6[_0x167cb5]['name'],'VoiceQueueId':_0x29dcc6[_0x167cb5]['id'],'interface':_0x40a637,'paused':_0x2ede48[_0x7def('0x4b')]||![],'penalty':_0x29dcc6[_0x167cb5][_0x7def('0x52')]||0x0}));}return BPromise[_0x7def('0x48')](_0x5f03f5);}}}})[_0x7def('0xe')](function(){if(_0x2ede48){return db[_0x7def('0x2d')][_0x7def('0x19')]({'where':{'membername':_0x2ede48[_0x7def('0x27')],'exitAt':null}});}})[_0x7def('0xe')](function(_0x537b49){if(_0x2ede48){if(_0x537b49&&_0x537b49[_0x7def('0x2f')]){var _0x1dcb30=[];_0x537b49[_0x7def('0x34')](function(_0x53ebcb){_0x1dcb30[_0x7def('0x46')](_0x53ebcb[_0x7def('0x2c')]({'exitAt':moment()[_0x7def('0x30')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x7def('0x48')](_0x1dcb30);}}})[_0x7def('0xe')](function(_0x2ea765){if(_0x2ede48){var _0x440c87=[];var _0x270a06=[];var _0x2c4e73=utils['getChannels']();var _0x271e08={'membername':_0x2ede48[_0x7def('0x27')],'interface':_0x40a637,'enterAt':moment()[_0x7def('0x30')](_0x7def('0x31')),'role':_0x2ede48[_0x7def('0x28')],'internal':_0x2ede48[_0x7def('0x29')]};_0x2c4e73[_0x7def('0x34')](function(_0x5a387c){_0x440c87[_0x7def('0x46')](_[_0x7def('0x53')]({'channel':_0x5a387c,'type':_0x7def('0x54'),'data1':'callysquare','data2':_0x40a637},_0x271e08));if(_0x2ede48[_0x7def('0x4b')]){_0x270a06['push'](_['merge']({'channel':_0x5a387c,'type':'PAUSE','data1':_0x7def('0x55')},_0x271e08));}});return db['MemberReport'][_0x7def('0x3b')](_0x440c87[_0x7def('0x56')](_0x270a06),{'individualHooks':!![]});}})[_0x7def('0xe')](function(){if(_0x2ede48){return _0x2ede48[_0x7def('0x2c')]({'online':!![],'lastLoginAt':moment()['format'](_0x7def('0x31')),'voicePause':_0x2ede48[_0x7def('0x4b')]||![],'mailPause':_0x2ede48[_0x7def('0x4b')]||![],'chatPause':_0x2ede48[_0x7def('0x4b')]||![],'faxPause':_0x2ede48['loginInPause']||![],'smsPause':_0x2ede48[_0x7def('0x4b')]||![],'openchannelPause':_0x2ede48[_0x7def('0x4b')]||![],'pauseType':_0x2ede48[_0x7def('0x4b')]?_0x7def('0x55'):null,'lastPauseAt':moment()[_0x7def('0x30')](_0x7def('0x31')),'interface':_0x40a637});}})[_0x7def('0xe')](function(_0x386a23){_0x33f9ee(_0x386a23);})['catch'](function(_0x172dcf){_0x5956d8(_0x182104[_0x7def('0x13')](0x1f4,_0x172dcf[_0x7def('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 2fa2799..c9138f8 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 _0xba93=['length','user:','./user.events','save','remove','update','register'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xba93,0x191));var _0x3ba9=function(_0x157349,_0x1aa6be){_0x157349=_0x157349-0x0;var _0x18c97c=_0xba93[_0x157349];return _0x18c97c;};'use strict';var UserEvents=require(_0x3ba9('0x0'));var events=[_0x3ba9('0x1'),_0x3ba9('0x2'),_0x3ba9('0x3')];function createListener(_0x39d62d,_0x137b80){return function(_0x38f254){_0x137b80['emit'](_0x39d62d,_0x38f254);};}function removeListener(_0x4d983b,_0x229fe0){return function(){UserEvents['removeListener'](_0x4d983b,_0x229fe0);};}exports[_0x3ba9('0x4')]=function(_0x20e155){for(var _0x5a7d31=0x0,_0x452c58=events[_0x3ba9('0x5')];_0x5a7d31<_0x452c58;_0x5a7d31++){var _0x3fa558=events[_0x5a7d31];var _0x947ded=createListener(_0x3ba9('0x6')+_0x3fa558,_0x20e155);UserEvents['on'](_0x3fa558,_0x947ded);}}; \ No newline at end of file +var _0x8ecf=['./user.events','save','remove','update','emit','removeListener','register','length'];(function(_0x47c902,_0x220fd2){var _0x1ad6a0=function(_0xf9fdb0){while(--_0xf9fdb0){_0x47c902['push'](_0x47c902['shift']());}};_0x1ad6a0(++_0x220fd2);}(_0x8ecf,0x188));var _0xf8ec=function(_0x50a88b,_0x4e7576){_0x50a88b=_0x50a88b-0x0;var _0x38309f=_0x8ecf[_0x50a88b];return _0x38309f;};'use strict';var UserEvents=require(_0xf8ec('0x0'));var events=[_0xf8ec('0x1'),_0xf8ec('0x2'),_0xf8ec('0x3')];function createListener(_0x34939c,_0x3474cf){return function(_0x4bfe4b){_0x3474cf[_0xf8ec('0x4')](_0x34939c,_0x4bfe4b);};}function removeListener(_0xf73e5a,_0x1d73af){return function(){UserEvents[_0xf8ec('0x5')](_0xf73e5a,_0x1d73af);};}exports[_0xf8ec('0x6')]=function(_0x5c3784){for(var _0x4e1ea0=0x0,_0x502bd2=events[_0xf8ec('0x7')];_0x4e1ea0<_0x502bd2;_0x4e1ea0++){var _0x4fd3db=events[_0x4e1ea0];var _0x5ad67f=createListener('user:'+_0x4fd3db,_0x5c3784);UserEvents['on'](_0x4fd3db,_0x5ad67f);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 07c2c1a..40bc685 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xa96846,_0x47eef7){var _0x536c53=function(_0x189896){while(--_0x189896){_0xa96846['push'](_0xa96846['shift']());}};_0x536c53(++_0x47eef7);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3217a8,_0x3c6938){var _0x10d37c=function(_0x5b32bf){while(--_0x5b32bf){_0x3217a8['push'](_0x3217a8['shift']());}};_0x10d37c(++_0x3c6938);}(_0xedd9,0xfc));var _0x9edd=function(_0x45fd68,_0x3f60a2){_0x45fd68=_0x45fd68-0x0;var _0x2ff2b8=_0xedd9[_0x45fd68];return _0x2ff2b8;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 9006424..0d92dd3 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb90a=['INTEGER','sequelize','exports'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xb90a,0x88));var _0xab90=function(_0x11595f,_0x1de87e){_0x11595f=_0x11595f-0x0;var _0x6bd145=_0xb90a[_0x11595f];return _0x6bd145;};'use strict';var Sequelize=require(_0xab90('0x0'));module[_0xab90('0x1')]={'penalty':{'type':Sequelize[_0xab90('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 3c245c9..c15df99 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 _0x23c2=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash'];(function(_0x11a3e0,_0x482eeb){var _0x3ff54e=function(_0x4d247b){while(--_0x4d247b){_0x11a3e0['push'](_0x11a3e0['shift']());}};_0x3ff54e(++_0x482eeb);}(_0x23c2,0x1ee));var _0x223c=function(_0x5d054e,_0x19c2e0){_0x5d054e=_0x5d054e-0x0;var _0x28db29=_0x23c2[_0x5d054e];return _0x28db29;};'use strict';var _=require(_0x223c('0x0'));var util=require(_0x223c('0x1'));var logger=require(_0x223c('0x2'))(_0x223c('0x3'));var moment=require(_0x223c('0x4'));var BPromise=require(_0x223c('0x5'));var rp=require(_0x223c('0x6'));var fs=require('fs');var path=require(_0x223c('0x7'));var rimraf=require(_0x223c('0x8'));var config=require(_0x223c('0x9'));var attributes=require(_0x223c('0xa'));module[_0x223c('0xb')]=function(_0x156e50,_0x2be738){return _0x156e50[_0x223c('0xc')](_0x223c('0xd'),attributes,{'tableName':_0x223c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bfe=['../../config/logger','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util'];(function(_0x2ab34d,_0x3ad21c){var _0x2e874c=function(_0x4dd494){while(--_0x4dd494){_0x2ab34d['push'](_0x2ab34d['shift']());}};_0x2e874c(++_0x3ad21c);}(_0x7bfe,0x166));var _0xe7bf=function(_0x59b519,_0x46e39c){_0x59b519=_0x59b519-0x0;var _0x57b3f4=_0x7bfe[_0x59b519];return _0x57b3f4;};'use strict';var _=require(_0xe7bf('0x0'));var util=require(_0xe7bf('0x1'));var logger=require(_0xe7bf('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe7bf('0x3'));var config=require(_0xe7bf('0x4'));var attributes=require(_0xe7bf('0x5'));module[_0xe7bf('0x6')]=function(_0x53a75d,_0x3f2c0c){return _0x53a75d[_0xe7bf('0x7')](_0xe7bf('0x8'),attributes,{'tableName':_0xe7bf('0x9'),'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 80ce038..7304beb 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 _0x1dbb=['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','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then'];(function(_0x1f6bd1,_0x5bf725){var _0x315af5=function(_0x9f1731){while(--_0x9f1731){_0x1f6bd1['push'](_0x1f6bd1['shift']());}};_0x315af5(++_0x5bf725);}(_0x1dbb,0x14d));var _0xb1db=function(_0x46a649,_0x3bf874){_0x46a649=_0x46a649-0x0;var _0x1b96a8=_0x1dbb[_0x46a649];return _0x1b96a8;};'use strict';var _=require(_0xb1db('0x0'));var util=require(_0xb1db('0x1'));var moment=require(_0xb1db('0x2'));var BPromise=require(_0xb1db('0x3'));var rs=require(_0xb1db('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1db('0x5'))['db'];var utils=require(_0xb1db('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb1db('0x7'));var jayson=require(_0xb1db('0x8'));var client=jayson[_0xb1db('0x9')][_0xb1db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x472061,_0x3f6e6a,_0x3bb1a6){return new BPromise(function(_0x3fefed,_0x2e92c8){return client['request'](_0x472061,_0x3bb1a6)[_0xb1db('0xb')](function(_0x1f0db8){logger[_0xb1db('0xc')](_0xb1db('0xd'),_0x3f6e6a,_0xb1db('0xe'));logger[_0xb1db('0xf')](_0xb1db('0x10'),_0x3f6e6a,_0xb1db('0xe'),JSON[_0xb1db('0x11')](_0x1f0db8));if(_0x1f0db8[_0xb1db('0x12')]){if(_0x1f0db8[_0xb1db('0x12')][_0xb1db('0x13')]===0x1f4){logger[_0xb1db('0x12')](_0xb1db('0xd'),_0x3f6e6a,_0x1f0db8['error'][_0xb1db('0x14')]);return _0x2e92c8(_0x1f0db8[_0xb1db('0x12')][_0xb1db('0x14')]);}logger[_0xb1db('0x12')](_0xb1db('0xd'),_0x3f6e6a,_0x1f0db8[_0xb1db('0x12')]['message']);return _0x3fefed(_0x1f0db8[_0xb1db('0x12')][_0xb1db('0x14')]);}else{logger[_0xb1db('0xc')](_0xb1db('0xd'),_0x3f6e6a,'request\x20sent');_0x3fefed(_0x1f0db8[_0xb1db('0x15')][_0xb1db('0x14')]);}})[_0xb1db('0x16')](function(_0x2d6df6){logger[_0xb1db('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x3f6e6a,_0x2d6df6);_0x2e92c8(_0x2d6df6);});});} \ No newline at end of file +var _0x3659=['jayson/promise','client','http','then','info','UserChatQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5f1c73,_0x4f9432){var _0x3c1fa4=function(_0x334bd2){while(--_0x334bd2){_0x5f1c73['push'](_0x5f1c73['shift']());}};_0x3c1fa4(++_0x4f9432);}(_0x3659,0x183));var _0x9365=function(_0x541095,_0x582b30){_0x541095=_0x541095-0x0;var _0x5a2c40=_0x3659[_0x541095];return _0x5a2c40;};'use strict';var _=require(_0x9365('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9365('0x1'));var rs=require(_0x9365('0x2'));var fs=require('fs');var Redis=require(_0x9365('0x3'));var db=require(_0x9365('0x4'))['db'];var utils=require(_0x9365('0x5'));var logger=require(_0x9365('0x6'))(_0x9365('0x7'));var config=require(_0x9365('0x8'));var jayson=require(_0x9365('0x9'));var client=jayson[_0x9365('0xa')][_0x9365('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fae67,_0x5785f9,_0x282da5){return new BPromise(function(_0x7d9fbc,_0xdb6972){return client['request'](_0x4fae67,_0x282da5)[_0x9365('0xc')](function(_0x362423){logger[_0x9365('0xd')](_0x9365('0xe'),_0x5785f9,'request\x20sent');logger[_0x9365('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x5785f9,_0x9365('0x10'),JSON['stringify'](_0x362423));if(_0x362423[_0x9365('0x11')]){if(_0x362423[_0x9365('0x11')][_0x9365('0x12')]===0x1f4){logger['error'](_0x9365('0xe'),_0x5785f9,_0x362423[_0x9365('0x11')][_0x9365('0x13')]);return _0xdb6972(_0x362423[_0x9365('0x11')][_0x9365('0x13')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x5785f9,_0x362423[_0x9365('0x11')]['message']);return _0x7d9fbc(_0x362423[_0x9365('0x11')][_0x9365('0x13')]);}else{logger[_0x9365('0xd')](_0x9365('0xe'),_0x5785f9,'request\x20sent');_0x7d9fbc(_0x362423[_0x9365('0x14')]['message']);}})[_0x9365('0x15')](function(_0xf6c1e5){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x5785f9,_0xf6c1e5);_0xdb6972(_0xf6c1e5);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 30b5c22..31694ae 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xc3b79c,_0xeb7251){var _0xafebd2=function(_0x29cfcc){while(--_0x29cfcc){_0xc3b79c['push'](_0xc3b79c['shift']());}};_0xafebd2(++_0xeb7251);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xe6c077,_0x1fca9f){var _0x469b48=function(_0x935da2){while(--_0x935da2){_0xe6c077['push'](_0xe6c077['shift']());}};_0x469b48(++_0x1fca9f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0xcb91[_0x2afbb0];return _0x411ff2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 774abd8..8fe9242 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 _0x2618=['sequelize','exports','INTEGER'];(function(_0x1c799d,_0x43f027){var _0x19e7d7=function(_0x467dd3){while(--_0x467dd3){_0x1c799d['push'](_0x1c799d['shift']());}};_0x19e7d7(++_0x43f027);}(_0x2618,0xd8));var _0x8261=function(_0x1100a2,_0x317968){_0x1100a2=_0x1100a2-0x0;var _0x46988c=_0x2618[_0x1100a2];return _0x46988c;};'use strict';var Sequelize=require(_0x8261('0x0'));module[_0x8261('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8261('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x537f=['INTEGER','STRING','exports'];(function(_0x5d08e4,_0x1c1ba6){var _0x1c7d40=function(_0x378004){while(--_0x378004){_0x5d08e4['push'](_0x5d08e4['shift']());}};_0x1c7d40(++_0x1c1ba6);}(_0x537f,0x8f));var _0xf537=function(_0x3abdcb,_0x26365b){_0x3abdcb=_0x3abdcb-0x0;var _0x3e2586=_0x537f[_0x3abdcb];return _0x3e2586;};'use strict';var Sequelize=require('sequelize');module[_0xf537('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf537('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xf537('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 24459ee..5d30bfb 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 _0xca83=['UserFaxQueue','lodash','util','api','bluebird','request-promise','path','rimraf','./userFaxQueue.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca83,0x90));var _0x3ca8=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xca83[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x3ca8('0x0'));var util=require(_0x3ca8('0x1'));var logger=require('../../config/logger')(_0x3ca8('0x2'));var moment=require('moment');var BPromise=require(_0x3ca8('0x3'));var rp=require(_0x3ca8('0x4'));var fs=require('fs');var path=require(_0x3ca8('0x5'));var rimraf=require(_0x3ca8('0x6'));var config=require('../../config/environment');var attributes=require(_0x3ca8('0x7'));module[_0x3ca8('0x8')]=function(_0x5a45cb,_0x1c0ce7){return _0x5a45cb[_0x3ca8('0x9')](_0x3ca8('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea10=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues'];(function(_0x195577,_0x5de53a){var _0x13c367=function(_0x583022){while(--_0x583022){_0x195577['push'](_0x195577['shift']());}};_0x13c367(++_0x5de53a);}(_0xea10,0xaa));var _0x0ea1=function(_0x229d94,_0x5bb1b0){_0x229d94=_0x229d94-0x0;var _0x2022ec=_0xea10[_0x229d94];return _0x2022ec;};'use strict';var _=require('lodash');var util=require(_0x0ea1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0ea1('0x1'));var BPromise=require(_0x0ea1('0x2'));var rp=require(_0x0ea1('0x3'));var fs=require('fs');var path=require(_0x0ea1('0x4'));var rimraf=require(_0x0ea1('0x5'));var config=require(_0x0ea1('0x6'));var attributes=require(_0x0ea1('0x7'));module['exports']=function(_0x25ba3b,_0x3a730b){return _0x25ba3b['define'](_0x0ea1('0x8'),attributes,{'tableName':_0x0ea1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 353d908..5dfe24f 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 _0x5b94=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring'];(function(_0x3d58fb,_0xef01de){var _0x301a03=function(_0x31c1eb){while(--_0x31c1eb){_0x3d58fb['push'](_0x3d58fb['shift']());}};_0x301a03(++_0xef01de);}(_0x5b94,0x100));var _0x45b9=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x5b94[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0x45b9('0x0'));var util=require(_0x45b9('0x1'));var moment=require(_0x45b9('0x2'));var BPromise=require('bluebird');var rs=require(_0x45b9('0x3'));var fs=require('fs');var Redis=require(_0x45b9('0x4'));var db=require(_0x45b9('0x5'))['db'];var utils=require(_0x45b9('0x6'));var logger=require(_0x45b9('0x7'))(_0x45b9('0x8'));var config=require(_0x45b9('0x9'));var jayson=require(_0x45b9('0xa'));var client=jayson[_0x45b9('0xb')][_0x45b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2409a9,_0x4050e9,_0x47c8d9){return new BPromise(function(_0x3fe0de,_0x1948e2){return client[_0x45b9('0xd')](_0x2409a9,_0x47c8d9)[_0x45b9('0xe')](function(_0x46bb59){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x4050e9,'request\x20sent');logger[_0x45b9('0xf')](_0x45b9('0x10'),_0x4050e9,_0x45b9('0x11'),JSON[_0x45b9('0x12')](_0x46bb59));if(_0x46bb59[_0x45b9('0x13')]){if(_0x46bb59[_0x45b9('0x13')][_0x45b9('0x14')]===0x1f4){logger[_0x45b9('0x13')](_0x45b9('0x15'),_0x4050e9,_0x46bb59[_0x45b9('0x13')][_0x45b9('0x16')]);return _0x1948e2(_0x46bb59[_0x45b9('0x13')]['message']);}logger[_0x45b9('0x13')](_0x45b9('0x15'),_0x4050e9,_0x46bb59['error'][_0x45b9('0x16')]);return _0x3fe0de(_0x46bb59['error'][_0x45b9('0x16')]);}else{logger[_0x45b9('0x17')](_0x45b9('0x15'),_0x4050e9,_0x45b9('0x11'));_0x3fe0de(_0x46bb59[_0x45b9('0x18')]['message']);}})[_0x45b9('0x19')](function(_0x283d09){logger[_0x45b9('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x4050e9,_0x283d09);_0x1948e2(_0x283d09);});});} \ No newline at end of file +var _0x39f9=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x23add1,_0x17cee2){var _0x3a1b3d=function(_0x34adff){while(--_0x34adff){_0x23add1['push'](_0x23add1['shift']());}};_0x3a1b3d(++_0x17cee2);}(_0x39f9,0x14c));var _0x939f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x39f9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x939f('0x0'));var util=require(_0x939f('0x1'));var moment=require(_0x939f('0x2'));var BPromise=require(_0x939f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x939f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x939f('0x5'));var logger=require(_0x939f('0x6'))(_0x939f('0x7'));var config=require(_0x939f('0x8'));var jayson=require(_0x939f('0x9'));var client=jayson['client'][_0x939f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48d4c9,_0xa2ccc5,_0x51928a){return new BPromise(function(_0xac5e65,_0x541abb){return client[_0x939f('0xb')](_0x48d4c9,_0x51928a)['then'](function(_0x45242f){logger[_0x939f('0xc')](_0x939f('0xd'),_0xa2ccc5,_0x939f('0xe'));logger['debug'](_0x939f('0xf'),_0xa2ccc5,'request\x20sent',JSON['stringify'](_0x45242f));if(_0x45242f[_0x939f('0x10')]){if(_0x45242f[_0x939f('0x10')][_0x939f('0x11')]===0x1f4){logger[_0x939f('0x10')](_0x939f('0xd'),_0xa2ccc5,_0x45242f[_0x939f('0x10')]['message']);return _0x541abb(_0x45242f['error'][_0x939f('0x12')]);}logger[_0x939f('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0xa2ccc5,_0x45242f[_0x939f('0x10')]['message']);return _0xac5e65(_0x45242f['error'][_0x939f('0x12')]);}else{logger[_0x939f('0xc')](_0x939f('0xd'),_0xa2ccc5,'request\x20sent');_0xac5e65(_0x45242f[_0x939f('0x13')]['message']);}})[_0x939f('0x14')](function(_0x1a0c38){logger[_0x939f('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0xa2ccc5,_0x1a0c38);_0x541abb(_0x1a0c38);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 64b8af3..4538fae 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xbb7025,_0x1862bf){var _0x2f2b5d=function(_0x3e5b77){while(--_0x3e5b77){_0xbb7025['push'](_0xbb7025['shift']());}};_0x2f2b5d(++_0x1862bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x4244bc,_0x465cfc){var _0x442e22=function(_0x4ec59f){while(--_0x4ec59f){_0x4244bc['push'](_0x4244bc['shift']());}};_0x442e22(++_0x465cfc);}(_0xedd9,0xfc));var _0x9edd=function(_0x3f5890,_0x4bf4d8){_0x3f5890=_0x3f5890-0x0;var _0x832c1e=_0xedd9[_0x3f5890];return _0x832c1e;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index cb73b3c..6023053 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 _0xed1e=['exports','INTEGER','sequelize'];(function(_0x451381,_0x54a2bb){var _0x22013a=function(_0x1c0a08){while(--_0x1c0a08){_0x451381['push'](_0x451381['shift']());}};_0x22013a(++_0x54a2bb);}(_0xed1e,0x140));var _0xeed1=function(_0x2920dd,_0x19d049){_0x2920dd=_0x2920dd-0x0;var _0x5d4e52=_0xed1e[_0x2920dd];return _0x5d4e52;};'use strict';var Sequelize=require(_0xeed1('0x0'));module[_0xeed1('0x1')]={'penalty':{'type':Sequelize[_0xeed1('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9b86=['sequelize','exports','INTEGER'];(function(_0x4a0fe8,_0x4b6e7d){var _0x1782da=function(_0x396d0a){while(--_0x396d0a){_0x4a0fe8['push'](_0x4a0fe8['shift']());}};_0x1782da(++_0x4b6e7d);}(_0x9b86,0x171));var _0x69b8=function(_0x5adcb7,_0xd083a){_0x5adcb7=_0x5adcb7-0x0;var _0x1a7001=_0x9b86[_0x5adcb7];return _0x1a7001;};'use strict';var Sequelize=require(_0x69b8('0x0'));module[_0x69b8('0x1')]={'penalty':{'type':Sequelize[_0x69b8('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 3ee9594..1d2e74a 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 _0x73e9=['../../config/logger','moment','bluebird','request-promise','rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','util'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0x73e9,0x154));var _0x973e=function(_0x152a8d,_0x5c9019){_0x152a8d=_0x152a8d-0x0;var _0x144e3d=_0x73e9[_0x152a8d];return _0x144e3d;};'use strict';var _=require('lodash');var util=require(_0x973e('0x0'));var logger=require(_0x973e('0x1'))('api');var moment=require(_0x973e('0x2'));var BPromise=require(_0x973e('0x3'));var rp=require(_0x973e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x973e('0x5'));var config=require('../../config/environment');var attributes=require(_0x973e('0x6'));module[_0x973e('0x7')]=function(_0x74be57,_0x49e340){return _0x74be57[_0x973e('0x8')](_0x973e('0x9'),attributes,{'tableName':_0x973e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b8f=['path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x110240,_0x473d38){var _0x353238=function(_0x10b57b){while(--_0x10b57b){_0x110240['push'](_0x110240['shift']());}};_0x353238(++_0x473d38);}(_0x0b8f,0x190));var _0xf0b8=function(_0x285a9a,_0x3f54bb){_0x285a9a=_0x285a9a-0x0;var _0x31ebe1=_0x0b8f[_0x285a9a];return _0x31ebe1;};'use strict';var _=require(_0xf0b8('0x0'));var util=require('util');var logger=require(_0xf0b8('0x1'))(_0xf0b8('0x2'));var moment=require(_0xf0b8('0x3'));var BPromise=require(_0xf0b8('0x4'));var rp=require(_0xf0b8('0x5'));var fs=require('fs');var path=require(_0xf0b8('0x6'));var rimraf=require(_0xf0b8('0x7'));var config=require(_0xf0b8('0x8'));var attributes=require(_0xf0b8('0x9'));module[_0xf0b8('0xa')]=function(_0x2a58d2,_0x578909){return _0x2a58d2[_0xf0b8('0xb')](_0xf0b8('0xc'),attributes,{'tableName':_0xf0b8('0xd'),'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 12e7e7b..0afac74 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x41cb81,_0x92b027){var _0x54399a=function(_0x127d7d){while(--_0x127d7d){_0x41cb81['push'](_0x41cb81['shift']());}};_0x54399a(++_0x92b027);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('UserMailQueue,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x4278b2,_0x2b539b){var _0x58892e=function(_0x1f8153){while(--_0x1f8153){_0x4278b2['push'](_0x4278b2['shift']());}};_0x58892e(++_0x2b539b);}(_0x55ca,0x126));var _0xa55c=function(_0x5a488c,_0x4cc470){_0x5a488c=_0x5a488c-0x0;var _0x53a7d6=_0x55ca[_0x5a488c];return _0x53a7d6;};'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')]('UserMailQueue,\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')]('UserMailQueue,\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 diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 281f9c6..105f80b 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 _0x1b87=['fs-extra','../../components/interaction/service','isAuthenticated','sendUserNotification','exports','util','path','connect-timeout','express','Router'];(function(_0x593405,_0x3af345){var _0x2f3b3c=function(_0xca9194){while(--_0xca9194){_0x593405['push'](_0x593405['shift']());}};_0x2f3b3c(++_0x3af345);}(_0x1b87,0x14f));var _0x71b8=function(_0x4a4320,_0x5794a1){_0x4a4320=_0x4a4320-0x0;var _0x4b0508=_0x1b87[_0x4a4320];return _0x4b0508;};'use strict';var multer=require('multer');var util=require(_0x71b8('0x0'));var path=require(_0x71b8('0x1'));var timeout=require(_0x71b8('0x2'));var express=require(_0x71b8('0x3'));var router=express[_0x71b8('0x4')]();var fs_extra=require(_0x71b8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x71b8('0x6'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router['post']('/',auth[_0x71b8('0x7')](),controller[_0x71b8('0x8')]);module[_0x71b8('0x9')]=router; \ No newline at end of file +var _0x7d52=['../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1eb7af,_0xa1205a){var _0x4291f3=function(_0x3aa766){while(--_0x3aa766){_0x1eb7af['push'](_0x1eb7af['shift']());}};_0x4291f3(++_0xa1205a);}(_0x7d52,0x1d9));var _0x27d5=function(_0x1880b5,_0x2c7291){_0x1880b5=_0x1880b5-0x0;var _0x4456a5=_0x7d52[_0x1880b5];return _0x4456a5;};'use strict';var multer=require(_0x27d5('0x0'));var util=require(_0x27d5('0x1'));var path=require(_0x27d5('0x2'));var timeout=require(_0x27d5('0x3'));var express=require('express');var router=express[_0x27d5('0x4')]();var fs_extra=require(_0x27d5('0x5'));var auth=require(_0x27d5('0x6'));var interaction=require(_0x27d5('0x7'));var config=require(_0x27d5('0x8'));var controller=require(_0x27d5('0x9'));router[_0x27d5('0xa')]('/',auth[_0x27d5('0xb')](),controller[_0x27d5('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 40d9457..4d0f0dd 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 _0x6e62=['TEXT','BOOLEAN','exports','STRING'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x6e62,0x166));var _0x26e6=function(_0x28db5f,_0x11c014){_0x28db5f=_0x28db5f-0x0;var _0x58d775=_0x6e62[_0x28db5f];return _0x58d775;};'use strict';var Sequelize=require('sequelize');module[_0x26e6('0x0')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x26e6('0x1')]},'recipientsId':{'type':Sequelize[_0x26e6('0x2')]},'recipientsDescription':{'type':Sequelize[_0x26e6('0x1')]},'beep':{'type':Sequelize[_0x26e6('0x3')]}}; \ No newline at end of file +var _0xf661=['TEXT','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf661,0xf6));var _0x1f66=function(_0x48a9ae,_0x2330a2){_0x48a9ae=_0x48a9ae-0x0;var _0x24b268=_0xf661[_0x48a9ae];return _0x24b268;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x1f66('0x0')]},'senderName':{'type':Sequelize[_0x1f66('0x1')]},'recipientsId':{'type':Sequelize[_0x1f66('0x0')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x1f66('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 228dd23..e653c08 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 _0x7b55=['error','stack','name','sendUserNotification','hasOwnProperty','body','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','team','user','some','includes','model','toLowerCase','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','forEach','recipient','text','Template','findOne','render','html','startCase','User','union','ids','queue','replace','Queue','push','flatten','catch','getAgents','map','eml-format','rimraf','bluebird','mustache','path','to-csv','ejs','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./userNotification.socket','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','sendStatus'];(function(_0x292fbe,_0x1148ec){var _0x53ddce=function(_0x1890e5){while(--_0x1890e5){_0x292fbe['push'](_0x292fbe['shift']());}};_0x53ddce(++_0x1148ec);}(_0x7b55,0x19f));var _0x57b5=function(_0x5e3174,_0x421eb1){_0x5e3174=_0x5e3174-0x0;var _0x3864d9=_0x7b55[_0x5e3174];return _0x3864d9;};'use strict';var emlformat=require(_0x57b5('0x0'));var rimraf=require(_0x57b5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x57b5('0x2'));var Mustache=require(_0x57b5('0x3'));var util=require('util');var path=require(_0x57b5('0x4'));var sox=require('sox');var csv=require(_0x57b5('0x5'));var ejs=require(_0x57b5('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x57b5('0x7'));var deskjs=require(_0x57b5('0x8'));var toCsv=require(_0x57b5('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x57b5('0x9'));var authService=require(_0x57b5('0xa'));var qs=require(_0x57b5('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57b5('0xc'));var logger=require(_0x57b5('0xd'))(_0x57b5('0xe'));var utils=require(_0x57b5('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x57b5('0x10'));var db=require('../../mysqldb')['db'];config[_0x57b5('0x11')]=_[_0x57b5('0x12')](config[_0x57b5('0x11')],{'host':_0x57b5('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57b5('0x11')]));require(_0x57b5('0x14'))['register'](socket);function respondWithStatusCode(_0x48d145,_0x4c9d50){_0x4c9d50=_0x4c9d50||0xcc;return function(_0x3f1ab6){if(_0x3f1ab6){return _0x48d145['sendStatus'](_0x4c9d50);}return _0x48d145[_0x57b5('0x15')](_0x4c9d50)['end']();};}function respondWithResult(_0x45ccc6,_0x1415cc){_0x1415cc=_0x1415cc||0xc8;return function(_0x5ace0b){if(_0x5ace0b){return _0x45ccc6[_0x57b5('0x15')](_0x1415cc)[_0x57b5('0x16')](_0x5ace0b);}};}function respondWithFilteredResult(_0x6503e5,_0xaea7c0){return function(_0x1c46ad){if(_0x1c46ad){var _0x19f213=typeof _0xaea7c0[_0x57b5('0x17')]===_0x57b5('0x18')&&typeof _0xaea7c0[_0x57b5('0x19')]==='undefined';var _0xa655fb=_0x1c46ad[_0x57b5('0x1a')];var _0x4dbbfc=_0x19f213?0x0:_0xaea7c0[_0x57b5('0x17')];var _0x1d0a7a=_0x19f213?_0x1c46ad[_0x57b5('0x1a')]:_0xaea7c0['offset']+_0xaea7c0[_0x57b5('0x19')];var _0x4fa145;if(_0x1d0a7a>=_0xa655fb){_0x1d0a7a=_0xa655fb;_0x4fa145=0xc8;}else{_0x4fa145=0xce;}_0x6503e5[_0x57b5('0x15')](_0x4fa145);return _0x6503e5[_0x57b5('0x1b')](_0x57b5('0x1c'),_0x4dbbfc+'-'+_0x1d0a7a+'/'+_0xa655fb)['json'](_0x1c46ad);}return null;};}function patchUpdates(_0x232c5f){return function(_0x5cd308){try{jsonpatch[_0x57b5('0x1d')](_0x5cd308,_0x232c5f,!![]);}catch(_0x5c71b4){return BPromise[_0x57b5('0x1e')](_0x5c71b4);}return _0x5cd308['save']();};}function saveUpdates(_0xb6fa74,_0x57b820){return function(_0x5a0633){if(_0x5a0633){return _0x5a0633['update'](_0xb6fa74)[_0x57b5('0x1f')](function(_0x16b9f6){return _0x16b9f6;});}return null;};}function removeEntity(_0x5cdb78,_0x18ce5c){return function(_0x16d6d2){if(_0x16d6d2){return _0x16d6d2[_0x57b5('0x20')]()[_0x57b5('0x1f')](function(){_0x5cdb78[_0x57b5('0x15')](0xcc)[_0x57b5('0x21')]();});}};}function handleEntityNotFound(_0x15aae9,_0x19810f){return function(_0x5a2c19){if(!_0x5a2c19){_0x15aae9[_0x57b5('0x22')](0x194);}return _0x5a2c19;};}function handleError(_0x5be3bb,_0x254dae){_0x254dae=_0x254dae||0x1f4;return function(_0x90a526){logger[_0x57b5('0x23')](_0x90a526[_0x57b5('0x24')]);if(_0x90a526[_0x57b5('0x25')]){delete _0x90a526[_0x57b5('0x25')];}_0x5be3bb[_0x57b5('0x15')](_0x254dae)['send'](_0x90a526);};}exports[_0x57b5('0x26')]=function(_0x577c86,_0x2e58be,_0x33e55a){if(!_0x577c86['body'][_0x57b5('0x27')]('text')&&!_0x577c86[_0x57b5('0x28')][_0x57b5('0x27')](_0x57b5('0x29'))){throw new db['Sequelize'][(_0x57b5('0x2a'))](_0x57b5('0x2b'));}else{if(_0x577c86[_0x57b5('0x28')][_0x57b5('0x27')](_0x57b5('0x29'))&&!_0x577c86[_0x57b5('0x28')][_0x57b5('0x27')](_0x57b5('0x2c'))){throw new db[(_0x57b5('0x2d'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x577c86['body'][_0x57b5('0x27')](_0x57b5('0x2e'))){throw new db[(_0x57b5('0x2d'))]['ValidationError'](_0x57b5('0x2f'));}else{try{var _0x22d9bb=JSON['parse'](_0x577c86[_0x57b5('0x28')][_0x57b5('0x2e')]);}catch(_0x456625){logger[_0x57b5('0x23')](_0x456625);throw new db['Sequelize']['ValidationError'](_0x57b5('0x30'));}var _0x1581cd=[_0x57b5('0x31'),'faxqueue',_0x57b5('0x32'),_0x57b5('0x33'),_0x57b5('0x34'),_0x57b5('0x35'),'whatsappqueue',_0x57b5('0x36'),_0x57b5('0x37')];if(_[_0x57b5('0x38')](_0x22d9bb,function(_0x4005c0){return!_[_0x57b5('0x39')](_0x1581cd,_0x4005c0[_0x57b5('0x3a')][_0x57b5('0x3b')]());})){throw new db[(_0x57b5('0x2d'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x37576e={};_0x37576e['senderName']=_0x577c86[_0x57b5('0x28')]['hasOwnProperty'](_0x57b5('0x3c'))?_0x577c86[_0x57b5('0x28')][_0x57b5('0x3c')]:_0x577c86[_0x57b5('0x37')][_0x57b5('0x3d')];_0x37576e['recipientsDescription']=_[_0x57b5('0x3e')](_0x577c86[_0x57b5('0x28')][_0x57b5('0x3f')])?null:_0x577c86[_0x57b5('0x28')][_0x57b5('0x3f')];_0x37576e[_0x57b5('0x40')]=_0x577c86[_0x57b5('0x28')][_0x57b5('0x40')]||![];_0x37576e[_0x57b5('0x41')]=_0x577c86[_0x57b5('0x37')]['id'];return getContent(_0x577c86['body'])[_0x57b5('0x1f')](function(_0x4b5338){_0x37576e[_0x57b5('0x28')]=_0x4b5338;return getRecipients(_0x22d9bb);})[_0x57b5('0x1f')](function(_0x5ce2f1){_0x37576e[_0x57b5('0x42')]=_[_0x57b5('0x43')](_0x5ce2f1)[_0x57b5('0x44')](',');return db[_0x57b5('0x45')]['transaction'](function(_0x536ba5){return db[_0x57b5('0x46')]['create'](_0x37576e,{'raw':!![],'transaction':_0x536ba5})[_0x57b5('0x1f')](function(_0x2459a0){var _0x1933ee={'sender':_0x37576e[_0x57b5('0x3c')],'description':_0x37576e[_0x57b5('0x3f')],'content':_0x37576e['body'],'beep':_0x37576e['beep']};_0x5ce2f1[_0x57b5('0x47')](function(_0x36d94f){_0x1933ee[_0x57b5('0x48')]=_0x36d94f;socket['emit']('userNotification:send',_0x1933ee);});return _0x2459a0;});});})[_0x57b5('0x1f')](respondWithResult(_0x2e58be,0xc9))['catch'](handleError(_0x2e58be,null));};function getContent(_0x2a577d){return new BPromise(function(_0x23a98a,_0x29c765){if(_0x2a577d[_0x57b5('0x49')]){_0x23a98a(_0x2a577d['text']);return;}return db[_0x57b5('0x4a')][_0x57b5('0x4b')]({'attributes':['html'],'where':{'id':_0x2a577d[_0x57b5('0x29')]},'raw':!![]})[_0x57b5('0x1f')](function(_0xbd5060){if(!_0xbd5060)throw new db[(_0x57b5('0x2d'))][(_0x57b5('0x2a'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x50b573=Mustache[_0x57b5('0x4c')](_0xbd5060[_0x57b5('0x4d')],_0x2a577d[_0x57b5('0x2c')]);_0x23a98a(_0x50b573);})['catch'](function(_0x3d7848){_0x29c765(_0x3d7848);});});}function getRecipients(_0x4c81d8){return new BPromise(function(_0x42089d,_0x4ded44){var _0x38468d=[];var _0x5c7702=[];_0x4c81d8[_0x57b5('0x47')](function(_0x2e7d9a){var _0x157810=_[_0x57b5('0x4e')](_0x2e7d9a['model'][_0x57b5('0x3b')]());if(_0x157810===_0x57b5('0x4f')){_0x38468d=_[_0x57b5('0x50')](_0x38468d,_0x2e7d9a[_0x57b5('0x51')]);}else{if(_[_0x57b5('0x39')](_0x157810,_0x57b5('0x52')))_0x157810=_0x157810[_0x57b5('0x53')](_0x57b5('0x52'),_0x57b5('0x54'));_0x2e7d9a[_0x57b5('0x51')][_0x57b5('0x47')](function(_0xf4eaf6){_0x5c7702[_0x57b5('0x55')](getAgents(_0x157810,_0xf4eaf6));});}});return BPromise['all'](_0x5c7702)['then'](function(_0x274af7){_0x38468d=_[_0x57b5('0x50')](_0x38468d,_[_0x57b5('0x56')](_0x274af7));_0x42089d(_0x38468d);})[_0x57b5('0x57')](function(_0x5b8593){_0x4ded44(_0x5b8593);});});}function getAgents(_0x26af75,_0x163804){return new BPromise(function(_0x46aebd,_0x8bdd87){return db[_0x26af75][_0x57b5('0x4b')]({'where':{'id':_0x163804}})['then'](function(_0xa3b492){return _0xa3b492[_0x57b5('0x58')]({'attributes':['id'],'raw':!![]})['then'](function(_0x84460c){var _0x21df9c=_[_0x57b5('0x59')](_0x84460c,'id');_0x46aebd(_0x21df9c);});})['catch'](function(_0x137c37){_0x8bdd87(_0x137c37);});});} \ No newline at end of file +var _0x9c06=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','sendUserNotification','body','text','hasOwnProperty','TemplateId','Sequelize','view','ValidationError','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','beep','SenderId','recipientsId','sortBy','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send','catch','Template','findOne','html','render','startCase','union','queue','replace','ids','push','all','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','papaparse'];(function(_0xbc46e1,_0x1bf748){var _0x462028=function(_0x2ff5fc){while(--_0x2ff5fc){_0xbc46e1['push'](_0xbc46e1['shift']());}};_0x462028(++_0x1bf748);}(_0x9c06,0x116));var _0x69c0=function(_0x1171b7,_0x360b6e){_0x1171b7=_0x1171b7-0x0;var _0x1847c0=_0x9c06[_0x1171b7];return _0x1847c0;};'use strict';var emlformat=require(_0x69c0('0x0'));var rimraf=require(_0x69c0('0x1'));var zipdir=require(_0x69c0('0x2'));var jsonpatch=require(_0x69c0('0x3'));var rp=require(_0x69c0('0x4'));var moment=require(_0x69c0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x69c0('0x6'));var util=require(_0x69c0('0x7'));var path=require(_0x69c0('0x8'));var sox=require(_0x69c0('0x9'));var csv=require('to-csv');var ejs=require(_0x69c0('0xa'));var fs=require('fs');var fs_extra=require(_0x69c0('0xb'));var _=require('lodash');var squel=require(_0x69c0('0xc'));var crypto=require(_0x69c0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x69c0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x69c0('0xf'));var Redis=require('ioredis');var authService=require(_0x69c0('0x10'));var qs=require(_0x69c0('0x11'));var as=require(_0x69c0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x69c0('0x13'));var utils=require(_0x69c0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x69c0('0x15'));var db=require(_0x69c0('0x16'))['db'];config[_0x69c0('0x17')]=_[_0x69c0('0x18')](config[_0x69c0('0x17')],{'host':_0x69c0('0x19'),'port':0x18eb});var socket=require(_0x69c0('0x1a'))(new Redis(config[_0x69c0('0x17')]));require(_0x69c0('0x1b'))['register'](socket);function respondWithStatusCode(_0x5ca9ed,_0x5127cc){_0x5127cc=_0x5127cc||0xcc;return function(_0x6db62){if(_0x6db62){return _0x5ca9ed[_0x69c0('0x1c')](_0x5127cc);}return _0x5ca9ed[_0x69c0('0x1d')](_0x5127cc)[_0x69c0('0x1e')]();};}function respondWithResult(_0x304f50,_0x31db72){_0x31db72=_0x31db72||0xc8;return function(_0x3b7ffb){if(_0x3b7ffb){return _0x304f50[_0x69c0('0x1d')](_0x31db72)[_0x69c0('0x1f')](_0x3b7ffb);}};}function respondWithFilteredResult(_0x57f02d,_0x4f3a8b){return function(_0x28acd4){if(_0x28acd4){var _0x20002d=typeof _0x4f3a8b[_0x69c0('0x20')]===_0x69c0('0x21')&&typeof _0x4f3a8b[_0x69c0('0x22')]===_0x69c0('0x21');var _0x5ccf35=_0x28acd4[_0x69c0('0x23')];var _0x342d80=_0x20002d?0x0:_0x4f3a8b[_0x69c0('0x20')];var _0x16c487=_0x20002d?_0x28acd4['count']:_0x4f3a8b[_0x69c0('0x20')]+_0x4f3a8b['limit'];var _0x453fd4;if(_0x16c487>=_0x5ccf35){_0x16c487=_0x5ccf35;_0x453fd4=0xc8;}else{_0x453fd4=0xce;}_0x57f02d[_0x69c0('0x1d')](_0x453fd4);return _0x57f02d[_0x69c0('0x24')](_0x69c0('0x25'),_0x342d80+'-'+_0x16c487+'/'+_0x5ccf35)[_0x69c0('0x1f')](_0x28acd4);}return null;};}function patchUpdates(_0x4c89f1){return function(_0x5deb49){try{jsonpatch[_0x69c0('0x26')](_0x5deb49,_0x4c89f1,!![]);}catch(_0xa1f13f){return BPromise[_0x69c0('0x27')](_0xa1f13f);}return _0x5deb49[_0x69c0('0x28')]();};}function saveUpdates(_0x507003,_0x58e4b0){return function(_0x49a2d4){if(_0x49a2d4){return _0x49a2d4['update'](_0x507003)[_0x69c0('0x29')](function(_0x3c65c7){return _0x3c65c7;});}return null;};}function removeEntity(_0x4416,_0x4a4b7d){return function(_0x5a8c8d){if(_0x5a8c8d){return _0x5a8c8d['destroy']()[_0x69c0('0x29')](function(){_0x4416[_0x69c0('0x1d')](0xcc)[_0x69c0('0x1e')]();});}};}function handleEntityNotFound(_0x1cf3d0,_0xec946f){return function(_0x32371f){if(!_0x32371f){_0x1cf3d0['sendStatus'](0x194);}return _0x32371f;};}function handleError(_0x197920,_0x197566){_0x197566=_0x197566||0x1f4;return function(_0x428766){logger[_0x69c0('0x2a')](_0x428766[_0x69c0('0x2b')]);if(_0x428766['name']){delete _0x428766[_0x69c0('0x2c')];}_0x197920[_0x69c0('0x1d')](_0x197566)['send'](_0x428766);};}exports[_0x69c0('0x2d')]=function(_0x4ffcd3,_0x5896cf,_0x5eadfb){if(!_0x4ffcd3[_0x69c0('0x2e')]['hasOwnProperty'](_0x69c0('0x2f'))&&!_0x4ffcd3['body'][_0x69c0('0x30')](_0x69c0('0x31'))){throw new db[(_0x69c0('0x32'))]['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x4ffcd3[_0x69c0('0x2e')][_0x69c0('0x30')](_0x69c0('0x31'))&&!_0x4ffcd3[_0x69c0('0x2e')]['hasOwnProperty'](_0x69c0('0x33'))){throw new db[(_0x69c0('0x32'))][(_0x69c0('0x34'))](_0x69c0('0x35'));}if(!_0x4ffcd3[_0x69c0('0x2e')][_0x69c0('0x30')]('recipients')){throw new db[(_0x69c0('0x32'))][(_0x69c0('0x34'))](_0x69c0('0x36'));}else{try{var _0x2773a2=JSON[_0x69c0('0x37')](_0x4ffcd3['body'][_0x69c0('0x38')]);}catch(_0x17d691){logger[_0x69c0('0x2a')](_0x17d691);throw new db[(_0x69c0('0x32'))][(_0x69c0('0x34'))](_0x69c0('0x39'));}var _0x1062b6=[_0x69c0('0x3a'),_0x69c0('0x3b'),_0x69c0('0x3c'),_0x69c0('0x3d'),_0x69c0('0x3e'),_0x69c0('0x3f'),_0x69c0('0x40'),_0x69c0('0x41'),_0x69c0('0x42')];if(_['some'](_0x2773a2,function(_0x566c7e){return!_[_0x69c0('0x43')](_0x1062b6,_0x566c7e[_0x69c0('0x44')][_0x69c0('0x45')]());})){throw new db[(_0x69c0('0x32'))]['ValidationError'](_0x69c0('0x46'));}}}var _0x3b4739={};_0x3b4739[_0x69c0('0x47')]=_0x4ffcd3[_0x69c0('0x2e')][_0x69c0('0x30')](_0x69c0('0x47'))?_0x4ffcd3[_0x69c0('0x2e')][_0x69c0('0x47')]:_0x4ffcd3[_0x69c0('0x42')]['fullname'];_0x3b4739[_0x69c0('0x48')]=_['isEmpty'](_0x4ffcd3[_0x69c0('0x2e')][_0x69c0('0x48')])?null:_0x4ffcd3[_0x69c0('0x2e')]['recipientsDescription'];_0x3b4739[_0x69c0('0x49')]=_0x4ffcd3[_0x69c0('0x2e')]['beep']||![];_0x3b4739[_0x69c0('0x4a')]=_0x4ffcd3[_0x69c0('0x42')]['id'];return getContent(_0x4ffcd3['body'])[_0x69c0('0x29')](function(_0x4603d3){_0x3b4739[_0x69c0('0x2e')]=_0x4603d3;return getRecipients(_0x2773a2);})[_0x69c0('0x29')](function(_0x313841){_0x3b4739[_0x69c0('0x4b')]=_[_0x69c0('0x4c')](_0x313841)['join'](',');return db[_0x69c0('0x4d')][_0x69c0('0x4e')](function(_0x460a01){return db[_0x69c0('0x4f')][_0x69c0('0x50')](_0x3b4739,{'raw':!![],'transaction':_0x460a01})['then'](function(_0x10ba7a){var _0x5d3584={'sender':_0x3b4739['senderName'],'description':_0x3b4739[_0x69c0('0x48')],'content':_0x3b4739[_0x69c0('0x2e')],'beep':_0x3b4739[_0x69c0('0x49')]};_0x313841[_0x69c0('0x51')](function(_0x1cfeff){_0x5d3584['recipient']=_0x1cfeff;socket[_0x69c0('0x52')](_0x69c0('0x53'),_0x5d3584);});return _0x10ba7a;});});})[_0x69c0('0x29')](respondWithResult(_0x5896cf,0xc9))[_0x69c0('0x54')](handleError(_0x5896cf,null));};function getContent(_0x2ae7fa){return new BPromise(function(_0x26d44e,_0x2e733e){if(_0x2ae7fa[_0x69c0('0x2f')]){_0x26d44e(_0x2ae7fa[_0x69c0('0x2f')]);return;}return db[_0x69c0('0x55')][_0x69c0('0x56')]({'attributes':[_0x69c0('0x57')],'where':{'id':_0x2ae7fa[_0x69c0('0x31')]},'raw':!![]})[_0x69c0('0x29')](function(_0x5d3d97){if(!_0x5d3d97)throw new db[(_0x69c0('0x32'))][(_0x69c0('0x34'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x55ef87=Mustache[_0x69c0('0x58')](_0x5d3d97['html'],_0x2ae7fa[_0x69c0('0x33')]);_0x26d44e(_0x55ef87);})['catch'](function(_0x424808){_0x2e733e(_0x424808);});});}function getRecipients(_0x57036c){return new BPromise(function(_0xd8907c,_0x4a26e8){var _0x46504b=[];var _0x20e1e7=[];_0x57036c[_0x69c0('0x51')](function(_0x359108){var _0x3a5b60=_[_0x69c0('0x59')](_0x359108['model'][_0x69c0('0x45')]());if(_0x3a5b60==='User'){_0x46504b=_[_0x69c0('0x5a')](_0x46504b,_0x359108['ids']);}else{if(_[_0x69c0('0x43')](_0x3a5b60,_0x69c0('0x5b')))_0x3a5b60=_0x3a5b60[_0x69c0('0x5c')]('queue','Queue');_0x359108[_0x69c0('0x5d')][_0x69c0('0x51')](function(_0xf0b7ab){_0x20e1e7[_0x69c0('0x5e')](getAgents(_0x3a5b60,_0xf0b7ab));});}});return BPromise[_0x69c0('0x5f')](_0x20e1e7)[_0x69c0('0x29')](function(_0x1c95d1){_0x46504b=_[_0x69c0('0x5a')](_0x46504b,_['flatten'](_0x1c95d1));_0xd8907c(_0x46504b);})[_0x69c0('0x54')](function(_0x1e8044){_0x4a26e8(_0x1e8044);});});}function getAgents(_0x3e0f5c,_0xa29a66){return new BPromise(function(_0x33c151,_0x158c58){return db[_0x3e0f5c]['findOne']({'where':{'id':_0xa29a66}})[_0x69c0('0x29')](function(_0x315701){return _0x315701[_0x69c0('0x60')]({'attributes':['id'],'raw':!![]})['then'](function(_0x121d36){var _0x78f544=_[_0x69c0('0x61')](_0x121d36,'id');_0x33c151(_0x78f544);});})[_0x69c0('0x54')](function(_0x1aa98a){_0x158c58(_0x1aa98a);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 82e2efc..fbe12a8 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 _0x3d2e=['exports','events','../../mysqldb','UserNotification','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x1db58a,_0x2bebca){var _0x59c405=function(_0x9ad15c){while(--_0x9ad15c){_0x1db58a['push'](_0x1db58a['shift']());}};_0x59c405(++_0x2bebca);}(_0x3d2e,0xe7));var _0xe3d2=function(_0x432519,_0x2da70c){_0x432519=_0x432519-0x0;var _0x38bad2=_0x3d2e[_0x432519];return _0x38bad2;};'use strict';var EventEmitter=require(_0xe3d2('0x0'));var UserNotification=require(_0xe3d2('0x1'))['db'][_0xe3d2('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xe3d2('0x3')](0x0);var events={'afterCreate':_0xe3d2('0x4'),'afterUpdate':'update','afterDestroy':_0xe3d2('0x5')};function emitEvent(_0x255db2){return function(_0x287fff,_0x3b2fb9,_0x2551d7){UserNotificationEvents[_0xe3d2('0x6')](_0x255db2+':'+_0x287fff['id'],_0x287fff);UserNotificationEvents[_0xe3d2('0x6')](_0x255db2,_0x287fff);_0x2551d7(null);};}for(var e in events){if(events[_0xe3d2('0x7')](e)){var event=events[e];UserNotification[_0xe3d2('0x8')](e,emitEvent(event));}}module[_0xe3d2('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0xf2f0=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xf2f0,0xf7));var _0x0f2f=function(_0x235f95,_0x2bf647){_0x235f95=_0x235f95-0x0;var _0x2348cb=_0xf2f0[_0x235f95];return _0x2348cb;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x0f2f('0x0'))['db'][_0x0f2f('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x0f2f('0x2')](0x0);var events={'afterCreate':_0x0f2f('0x3'),'afterUpdate':_0x0f2f('0x4'),'afterDestroy':_0x0f2f('0x5')};function emitEvent(_0x5087f0){return function(_0x2cf538,_0x356fd2,_0x2725e0){UserNotificationEvents[_0x0f2f('0x6')](_0x5087f0+':'+_0x2cf538['id'],_0x2cf538);UserNotificationEvents[_0x0f2f('0x6')](_0x5087f0,_0x2cf538);_0x2725e0(null);};}for(var e in events){if(events[_0x0f2f('0x7')](e)){var event=events[e];UserNotification[_0x0f2f('0x8')](e,emitEvent(event));}}module[_0x0f2f('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 8754178..1246029 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 _0x7033=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','utf8mb4_unicode_ci','lodash'];(function(_0x5a7855,_0x3df8d1){var _0xc284ca=function(_0x4e4119){while(--_0x4e4119){_0x5a7855['push'](_0x5a7855['shift']());}};_0xc284ca(++_0x3df8d1);}(_0x7033,0x133));var _0x3703=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7033[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x3703('0x0'));var util=require(_0x3703('0x1'));var logger=require(_0x3703('0x2'))(_0x3703('0x3'));var moment=require('moment');var BPromise=require(_0x3703('0x4'));var rp=require(_0x3703('0x5'));var fs=require('fs');var path=require(_0x3703('0x6'));var rimraf=require(_0x3703('0x7'));var config=require(_0x3703('0x8'));var attributes=require(_0x3703('0x9'));module[_0x3703('0xa')]=function(_0x57a14a,_0x9ddbc){return _0x57a14a[_0x3703('0xb')](_0x3703('0xc'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3703('0xd')});}; \ No newline at end of file +var _0xb65f=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications'];(function(_0x20a552,_0x554342){var _0x436e2d=function(_0xea5147){while(--_0xea5147){_0x20a552['push'](_0x20a552['shift']());}};_0x436e2d(++_0x554342);}(_0xb65f,0x1c3));var _0xfb65=function(_0xef0c6b,_0x2f1fc3){_0xef0c6b=_0xef0c6b-0x0;var _0x19cb4b=_0xb65f[_0xef0c6b];return _0x19cb4b;};'use strict';var _=require(_0xfb65('0x0'));var util=require('util');var logger=require(_0xfb65('0x1'))(_0xfb65('0x2'));var moment=require(_0xfb65('0x3'));var BPromise=require(_0xfb65('0x4'));var rp=require(_0xfb65('0x5'));var fs=require('fs');var path=require(_0xfb65('0x6'));var rimraf=require(_0xfb65('0x7'));var config=require(_0xfb65('0x8'));var attributes=require(_0xfb65('0x9'));module[_0xfb65('0xa')]=function(_0x24420c,_0x594d1a){return _0x24420c[_0xfb65('0xb')](_0xfb65('0xc'),attributes,{'tableName':_0xfb65('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xfb65('0xe')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index aa162db..4072157 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 _0xdfa5=['error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2a5303,_0x9ec40b){var _0x5886a9=function(_0x5bb49a){while(--_0x5bb49a){_0x2a5303['push'](_0x2a5303['shift']());}};_0x5886a9(++_0x9ec40b);}(_0xdfa5,0x1cd));var _0x5dfa=function(_0x1eb43c,_0x501066){_0x1eb43c=_0x1eb43c-0x0;var _0x3de2c8=_0xdfa5[_0x1eb43c];return _0x3de2c8;};'use strict';var _=require(_0x5dfa('0x0'));var util=require('util');var moment=require(_0x5dfa('0x1'));var BPromise=require('bluebird');var rs=require(_0x5dfa('0x2'));var fs=require('fs');var Redis=require(_0x5dfa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5dfa('0x4'));var logger=require(_0x5dfa('0x5'))(_0x5dfa('0x6'));var config=require(_0x5dfa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5dfa('0x8')]['http']({'port':0x232a});config[_0x5dfa('0x9')]=_['defaults'](config[_0x5dfa('0x9')],{'host':_0x5dfa('0xa'),'port':0x18eb});var socket=require(_0x5dfa('0xb'))(new Redis(config[_0x5dfa('0x9')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x400f54,_0x428c0d,_0x2550cb){return new BPromise(function(_0xbcdfe2,_0x294ac3){return client[_0x5dfa('0xc')](_0x400f54,_0x2550cb)['then'](function(_0x2db8c0){logger[_0x5dfa('0xd')](_0x5dfa('0xe'),_0x428c0d,_0x5dfa('0xf'));logger[_0x5dfa('0x10')](_0x5dfa('0x11'),_0x428c0d,'request\x20sent',JSON[_0x5dfa('0x12')](_0x2db8c0));if(_0x2db8c0[_0x5dfa('0x13')]){if(_0x2db8c0[_0x5dfa('0x13')][_0x5dfa('0x14')]===0x1f4){logger[_0x5dfa('0x13')](_0x5dfa('0xe'),_0x428c0d,_0x2db8c0['error']['message']);return _0x294ac3(_0x2db8c0[_0x5dfa('0x13')][_0x5dfa('0x15')]);}logger[_0x5dfa('0x13')](_0x5dfa('0xe'),_0x428c0d,_0x2db8c0[_0x5dfa('0x13')]['message']);return _0xbcdfe2(_0x2db8c0[_0x5dfa('0x13')]['message']);}else{logger['info'](_0x5dfa('0xe'),_0x428c0d,_0x5dfa('0xf'));_0xbcdfe2(_0x2db8c0[_0x5dfa('0x16')][_0x5dfa('0x15')]);}})[_0x5dfa('0x17')](function(_0x2fec2d){logger[_0x5dfa('0x13')](_0x5dfa('0xe'),_0x428c0d,_0x2fec2d);_0x294ac3(_0x2fec2d);});});} \ No newline at end of file +var _0x0e69=['message','result','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x1c2298,_0x23dc7c){var _0x4df526=function(_0x2a3bc8){while(--_0x2a3bc8){_0x1c2298['push'](_0x1c2298['shift']());}};_0x4df526(++_0x23dc7c);}(_0x0e69,0x19a));var _0x90e6=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x0e69[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x90e6('0x0'));var util=require(_0x90e6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90e6('0x2'));var db=require(_0x90e6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x90e6('0x4'))(_0x90e6('0x5'));var config=require(_0x90e6('0x6'));var jayson=require(_0x90e6('0x7'));var client=jayson[_0x90e6('0x8')][_0x90e6('0x9')]({'port':0x232a});config[_0x90e6('0xa')]=_[_0x90e6('0xb')](config[_0x90e6('0xa')],{'host':_0x90e6('0xc'),'port':0x18eb});var socket=require(_0x90e6('0xd'))(new Redis(config[_0x90e6('0xa')]));require(_0x90e6('0xe'))[_0x90e6('0xf')](socket);function respondWithRpcPromise(_0x56cffa,_0x3b500a,_0x3f185f){return new BPromise(function(_0x518ab9,_0x351b1d){return client[_0x90e6('0x10')](_0x56cffa,_0x3f185f)[_0x90e6('0x11')](function(_0x4c00bb){logger['info'](_0x90e6('0x12'),_0x3b500a,'request\x20sent');logger[_0x90e6('0x13')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x3b500a,_0x90e6('0x14'),JSON['stringify'](_0x4c00bb));if(_0x4c00bb[_0x90e6('0x15')]){if(_0x4c00bb[_0x90e6('0x15')]['code']===0x1f4){logger[_0x90e6('0x15')]('UserNotification,\x20%s,\x20%s',_0x3b500a,_0x4c00bb['error'][_0x90e6('0x16')]);return _0x351b1d(_0x4c00bb[_0x90e6('0x15')]['message']);}logger[_0x90e6('0x15')](_0x90e6('0x12'),_0x3b500a,_0x4c00bb[_0x90e6('0x15')]['message']);return _0x518ab9(_0x4c00bb['error'][_0x90e6('0x16')]);}else{logger['info'](_0x90e6('0x12'),_0x3b500a,_0x90e6('0x14'));_0x518ab9(_0x4c00bb[_0x90e6('0x17')]['message']);}})['catch'](function(_0x28c31b){logger[_0x90e6('0x15')](_0x90e6('0x12'),_0x3b500a,_0x28c31b);_0x351b1d(_0x28c31b);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 11598c3..10e6e9f 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 _0xc79d=['emit','removeListener','register','length','userNotification:','save','remove','update'];(function(_0x27c375,_0x35bdbb){var _0x29ef9e=function(_0x403a03){while(--_0x403a03){_0x27c375['push'](_0x27c375['shift']());}};_0x29ef9e(++_0x35bdbb);}(_0xc79d,0x6d));var _0xdc79=function(_0x58eee8,_0x106ab4){_0x58eee8=_0x58eee8-0x0;var _0x1ae37e=_0xc79d[_0x58eee8];return _0x1ae37e;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xdc79('0x0'),_0xdc79('0x1'),_0xdc79('0x2')];function createListener(_0x2aa362,_0x2e6794){return function(_0x3f3bd7){_0x2e6794[_0xdc79('0x3')](_0x2aa362,_0x3f3bd7);};}function removeListener(_0x5a95cb,_0x177e37){return function(){UserNotificationEvents[_0xdc79('0x4')](_0x5a95cb,_0x177e37);};}exports[_0xdc79('0x5')]=function(_0x53a8b2){for(var _0x3b37df=0x0,_0x26a790=events[_0xdc79('0x6')];_0x3b37df<_0x26a790;_0x3b37df++){var _0x4c3ba2=events[_0x3b37df];var _0x5ca376=createListener(_0xdc79('0x7')+_0x4c3ba2,_0x53a8b2);UserNotificationEvents['on'](_0x4c3ba2,_0x5ca376);}}; \ No newline at end of file +var _0x38f2=['emit','register','length','userNotification:','./userNotification.events','remove','update'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x38f2,0x146));var _0x238f=function(_0x3c2673,_0x13370a){_0x3c2673=_0x3c2673-0x0;var _0x35f642=_0x38f2[_0x3c2673];return _0x35f642;};'use strict';var UserNotificationEvents=require(_0x238f('0x0'));var events=['save',_0x238f('0x1'),_0x238f('0x2')];function createListener(_0x2989d2,_0x2a366f){return function(_0x53b830){_0x2a366f[_0x238f('0x3')](_0x2989d2,_0x53b830);};}function removeListener(_0x5ce45e,_0x174b7c){return function(){UserNotificationEvents['removeListener'](_0x5ce45e,_0x174b7c);};}exports[_0x238f('0x4')]=function(_0x358a63){for(var _0x237349=0x0,_0x5a3352=events[_0x238f('0x5')];_0x237349<_0x5a3352;_0x237349++){var _0x50508b=events[_0x237349];var _0x50e986=createListener(_0x238f('0x6')+_0x50508b,_0x358a63);UserNotificationEvents['on'](_0x50508b,_0x50e986);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 34d5a14..4669ba0 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3e69b6,_0xc7f3da){var _0x2d1b48=function(_0x1a97ed){while(--_0x1a97ed){_0x3e69b6['push'](_0x3e69b6['shift']());}};_0x2d1b48(++_0xc7f3da);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x57474e,_0x4178b8){_0x57474e=_0x57474e-0x0;var _0xfaae8c=_0xcb91[_0x57474e];return _0xfaae8c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5d8631,_0x44944b){var _0x34c15e=function(_0x4448f8){while(--_0x4448f8){_0x5d8631['push'](_0x5d8631['shift']());}};_0x34c15e(++_0x44944b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 8034cf4..6e7f68b 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 _0x1b31=['sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1b31,0x69));var _0x11b3=function(_0x46612e,_0x12ea33){_0x46612e=_0x46612e-0x0;var _0x1c0ffc=_0x1b31[_0x46612e];return _0x1c0ffc;};'use strict';var Sequelize=require(_0x11b3('0x0'));module[_0x11b3('0x1')]={'penalty':{'type':Sequelize[_0x11b3('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x903e=['INTEGER','exports'];(function(_0x36f47c,_0x38ef4d){var _0x296c55=function(_0x403eec){while(--_0x403eec){_0x36f47c['push'](_0x36f47c['shift']());}};_0x296c55(++_0x38ef4d);}(_0x903e,0x195));var _0xe903=function(_0x4aac5a,_0x15b04c){_0x4aac5a=_0x4aac5a-0x0;var _0x42e7bc=_0x903e[_0x4aac5a];return _0x42e7bc;};'use strict';var Sequelize=require('sequelize');module[_0xe903('0x0')]={'penalty':{'type':Sequelize[_0xe903('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 50b3151..8859544 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 _0x7a80=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','lodash','moment','request-promise','path'];(function(_0x311666,_0x17b07d){var _0x2bc692=function(_0x200073){while(--_0x200073){_0x311666['push'](_0x311666['shift']());}};_0x2bc692(++_0x17b07d);}(_0x7a80,0x140));var _0x07a8=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7a80[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x07a8('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x07a8('0x1'));var BPromise=require('bluebird');var rp=require(_0x07a8('0x2'));var fs=require('fs');var path=require(_0x07a8('0x3'));var rimraf=require(_0x07a8('0x4'));var config=require(_0x07a8('0x5'));var attributes=require(_0x07a8('0x6'));module[_0x07a8('0x7')]=function(_0xa3325e,_0x2a6a56){return _0xa3325e['define'](_0x07a8('0x8'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b49=['exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0b49,0x13c));var _0x90b4=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x0b49[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x90b4('0x0'));var util=require('util');var logger=require(_0x90b4('0x1'))(_0x90b4('0x2'));var moment=require(_0x90b4('0x3'));var BPromise=require(_0x90b4('0x4'));var rp=require(_0x90b4('0x5'));var fs=require('fs');var path=require(_0x90b4('0x6'));var rimraf=require('rimraf');var config=require(_0x90b4('0x7'));var attributes=require(_0x90b4('0x8'));module[_0x90b4('0x9')]=function(_0x2e6135,_0x50b5d0){return _0x2e6135[_0x90b4('0xa')](_0x90b4('0xb'),attributes,{'tableName':_0x90b4('0xc'),'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 42023cc..c4e7d7a 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 _0x7bd3=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util'];(function(_0x93f736,_0x5cf1a2){var _0x1e1e37=function(_0x220674){while(--_0x220674){_0x93f736['push'](_0x93f736['shift']());}};_0x1e1e37(++_0x5cf1a2);}(_0x7bd3,0x82));var _0x37bd=function(_0x9cc995,_0x31270e){_0x9cc995=_0x9cc995-0x0;var _0x38e097=_0x7bd3[_0x9cc995];return _0x38e097;};'use strict';var _=require(_0x37bd('0x0'));var util=require(_0x37bd('0x1'));var moment=require(_0x37bd('0x2'));var BPromise=require(_0x37bd('0x3'));var rs=require(_0x37bd('0x4'));var fs=require('fs');var Redis=require(_0x37bd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x37bd('0x6'));var logger=require(_0x37bd('0x7'))(_0x37bd('0x8'));var config=require('../../config/environment');var jayson=require(_0x37bd('0x9'));var client=jayson[_0x37bd('0xa')][_0x37bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14cc69,_0x594fb8,_0x5155e7){return new BPromise(function(_0x22af73,_0x4719b2){return client['request'](_0x14cc69,_0x5155e7)[_0x37bd('0xc')](function(_0x63af44){logger['info'](_0x37bd('0xd'),_0x594fb8,_0x37bd('0xe'));logger[_0x37bd('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x594fb8,'request\x20sent',JSON['stringify'](_0x63af44));if(_0x63af44[_0x37bd('0x10')]){if(_0x63af44[_0x37bd('0x10')][_0x37bd('0x11')]===0x1f4){logger[_0x37bd('0x10')](_0x37bd('0xd'),_0x594fb8,_0x63af44[_0x37bd('0x10')]['message']);return _0x4719b2(_0x63af44['error'][_0x37bd('0x12')]);}logger['error'](_0x37bd('0xd'),_0x594fb8,_0x63af44[_0x37bd('0x10')]['message']);return _0x22af73(_0x63af44[_0x37bd('0x10')]['message']);}else{logger[_0x37bd('0x13')](_0x37bd('0xd'),_0x594fb8,_0x37bd('0xe'));_0x22af73(_0x63af44[_0x37bd('0x14')]['message']);}})[_0x37bd('0x15')](function(_0x312b3a){logger[_0x37bd('0x10')](_0x37bd('0xd'),_0x594fb8,_0x312b3a);_0x4719b2(_0x312b3a);});});} \ No newline at end of file +var _0xda44=['request\x20sent','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','http','request','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2d810e,_0xba30ad){var _0x219c45=function(_0x15cede){while(--_0x15cede){_0x2d810e['push'](_0x2d810e['shift']());}};_0x219c45(++_0xba30ad);}(_0xda44,0x1d1));var _0x4da4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xda44[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4da4('0x0'));var util=require(_0x4da4('0x1'));var moment=require('moment');var BPromise=require(_0x4da4('0x2'));var rs=require(_0x4da4('0x3'));var fs=require('fs');var Redis=require(_0x4da4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4da4('0x5'));var config=require(_0x4da4('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4da4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28b86d,_0x469ac3,_0x59a984){return new BPromise(function(_0x548ab7,_0x3fb8bf){return client[_0x4da4('0x8')](_0x28b86d,_0x59a984)['then'](function(_0x16eb7d){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x469ac3,'request\x20sent');logger[_0x4da4('0x9')](_0x4da4('0xa'),_0x469ac3,_0x4da4('0xb'),JSON['stringify'](_0x16eb7d));if(_0x16eb7d[_0x4da4('0xc')]){if(_0x16eb7d['error'][_0x4da4('0xd')]===0x1f4){logger[_0x4da4('0xc')](_0x4da4('0xe'),_0x469ac3,_0x16eb7d[_0x4da4('0xc')][_0x4da4('0xf')]);return _0x3fb8bf(_0x16eb7d[_0x4da4('0xc')][_0x4da4('0xf')]);}logger[_0x4da4('0xc')](_0x4da4('0xe'),_0x469ac3,_0x16eb7d[_0x4da4('0xc')]['message']);return _0x548ab7(_0x16eb7d[_0x4da4('0xc')][_0x4da4('0xf')]);}else{logger['info'](_0x4da4('0xe'),_0x469ac3,_0x4da4('0xb'));_0x548ab7(_0x16eb7d[_0x4da4('0x10')][_0x4da4('0xf')]);}})['catch'](function(_0x370dc0){logger[_0x4da4('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x469ac3,_0x370dc0);_0x3fb8bf(_0x370dc0);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 6a7a1b4..659cecd 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 _0xcea5=['post','clone','addSections','/:id/resources','addResources','put','destroy','delete','removeSections','removeResources','exports','util','connect-timeout','Router','fs-extra','../../config/environment','./userProfile.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/sections','getSections','getResources','create'];(function(_0x2fc960,_0x5219db){var _0x3072a7=function(_0x3f6730){while(--_0x3f6730){_0x2fc960['push'](_0x2fc960['shift']());}};_0x3072a7(++_0x5219db);}(_0xcea5,0x1f1));var _0x5cea=function(_0x3f755c,_0x1c9abe){_0x3f755c=_0x3f755c-0x0;var _0x33beda=_0xcea5[_0x3f755c];return _0x33beda;};'use strict';var multer=require('multer');var util=require(_0x5cea('0x0'));var path=require('path');var timeout=require(_0x5cea('0x1'));var express=require('express');var router=express[_0x5cea('0x2')]();var fs_extra=require(_0x5cea('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5cea('0x4'));var controller=require(_0x5cea('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5cea('0x6')](_0x5cea('0x7'),auth['isAuthenticated'](),controller[_0x5cea('0x8')]);router[_0x5cea('0x6')](_0x5cea('0x9'),auth[_0x5cea('0xa')](),controller[_0x5cea('0xb')]);router['get'](_0x5cea('0xc'),auth[_0x5cea('0xa')](),controller[_0x5cea('0xd')]);router[_0x5cea('0x6')]('/:id/resources',auth[_0x5cea('0xa')](),controller[_0x5cea('0xe')]);router['post']('/',auth[_0x5cea('0xa')](),controller[_0x5cea('0xf')]);router[_0x5cea('0x10')]('/:id/clone',auth[_0x5cea('0xa')](),controller[_0x5cea('0x11')]);router[_0x5cea('0x10')]('/:id/sections',auth['isAuthenticated'](),controller[_0x5cea('0x12')]);router[_0x5cea('0x10')](_0x5cea('0x13'),auth['isAuthenticated'](),controller[_0x5cea('0x14')]);router[_0x5cea('0x15')](_0x5cea('0x9'),auth[_0x5cea('0xa')](),controller['update']);router['delete'](_0x5cea('0x9'),auth[_0x5cea('0xa')](),controller[_0x5cea('0x16')]);router[_0x5cea('0x17')](_0x5cea('0xc'),auth['isAuthenticated'](),controller[_0x5cea('0x18')]);router[_0x5cea('0x17')]('/:id/resources',auth['isAuthenticated'](),controller[_0x5cea('0x19')]);module[_0x5cea('0x1a')]=router; \ No newline at end of file +var _0xa7d0=['../../config/environment','./userProfile.controller','get','isAuthenticated','index','describe','/:id','/:id/sections','getSections','/:id/resources','post','create','/:id/clone','clone','addResources','put','update','delete','destroy','removeResources','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5cbb55,_0x11f460){var _0x1c17b1=function(_0x45a995){while(--_0x45a995){_0x5cbb55['push'](_0x5cbb55['shift']());}};_0x1c17b1(++_0x11f460);}(_0xa7d0,0x68));var _0x0a7d=function(_0x402688,_0x140e65){_0x402688=_0x402688-0x0;var _0x1789ff=_0xa7d0[_0x402688];return _0x1789ff;};'use strict';var multer=require(_0x0a7d('0x0'));var util=require(_0x0a7d('0x1'));var path=require(_0x0a7d('0x2'));var timeout=require(_0x0a7d('0x3'));var express=require(_0x0a7d('0x4'));var router=express[_0x0a7d('0x5')]();var fs_extra=require(_0x0a7d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0a7d('0x7'));var config=require(_0x0a7d('0x8'));var controller=require(_0x0a7d('0x9'));router[_0x0a7d('0xa')]('/',auth[_0x0a7d('0xb')](),controller[_0x0a7d('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0a7d('0xd')]);router[_0x0a7d('0xa')](_0x0a7d('0xe'),auth[_0x0a7d('0xb')](),controller['show']);router[_0x0a7d('0xa')](_0x0a7d('0xf'),auth[_0x0a7d('0xb')](),controller[_0x0a7d('0x10')]);router[_0x0a7d('0xa')](_0x0a7d('0x11'),auth['isAuthenticated'](),controller['getResources']);router[_0x0a7d('0x12')]('/',auth[_0x0a7d('0xb')](),controller[_0x0a7d('0x13')]);router[_0x0a7d('0x12')](_0x0a7d('0x14'),auth['isAuthenticated'](),controller[_0x0a7d('0x15')]);router[_0x0a7d('0x12')](_0x0a7d('0xf'),auth['isAuthenticated'](),controller['addSections']);router[_0x0a7d('0x12')](_0x0a7d('0x11'),auth['isAuthenticated'](),controller[_0x0a7d('0x16')]);router[_0x0a7d('0x17')](_0x0a7d('0xe'),auth['isAuthenticated'](),controller[_0x0a7d('0x18')]);router[_0x0a7d('0x19')](_0x0a7d('0xe'),auth[_0x0a7d('0xb')](),controller[_0x0a7d('0x1a')]);router['delete'](_0x0a7d('0xf'),auth[_0x0a7d('0xb')](),controller['removeSections']);router[_0x0a7d('0x19')]('/:id/resources',auth[_0x0a7d('0xb')](),controller[_0x0a7d('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 3237550..240e9cc 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 _0x1797=['setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','name','STRING'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x1797,0xcc));var _0x7179=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x1797[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0x7179('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7179('0x1')},'crudPermissions':{'type':Sequelize[_0x7179('0x2')],'set':function(_0x4f651e){this[_0x7179('0x3')](_0x7179('0x4'),_0x4f651e?_0x4f651e[_0x7179('0x5')](''):[]);},'get':function(){return this[_0x7179('0x6')](_0x7179('0x4'))?this[_0x7179('0x6')]('crudPermissions')[_0x7179('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x7179('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x7179('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x7179('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x7179('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7179('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x7179('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7179('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe688=['STRING','setDataValue','join','getDataValue','crudPermissions','BOOLEAN','sequelize','exports'];(function(_0x2db17a,_0x499db9){var _0x1544da=function(_0x573633){while(--_0x573633){_0x2db17a['push'](_0x2db17a['shift']());}};_0x1544da(++_0x499db9);}(_0xe688,0x8e));var _0x8e68=function(_0x46e111,_0x37f8ef){_0x46e111=_0x46e111-0x0;var _0x199ea2=_0xe688[_0x46e111];return _0x199ea2;};'use strict';var Sequelize=require(_0x8e68('0x0'));module[_0x8e68('0x1')]={'name':{'type':Sequelize[_0x8e68('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x8e68('0x2')],'set':function(_0x49a65a){this[_0x8e68('0x3')]('crudPermissions',_0x49a65a?_0x49a65a[_0x8e68('0x4')](''):[]);},'get':function(){return this[_0x8e68('0x5')](_0x8e68('0x6'))?this[_0x8e68('0x5')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8e68('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x8e68('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8e68('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x8e68('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x8e68('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8e68('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8e68('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x8e68('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 6a77829..8436ae3 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 _0xcefd=['fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','name','send','index','map','UserProfile','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','clone','omit','createdAt','updatedAt','transaction','get','UserProfileSection','findAll','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','describe','each','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','push','resourceId','Plugin','addResources','sequelize','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x3e368f,_0x207e96){var _0x268f2b=function(_0x3504da){while(--_0x3504da){_0x3e368f['push'](_0x3e368f['shift']());}};_0x268f2b(++_0x207e96);}(_0xcefd,0x1bd));var _0xdcef=function(_0x51ee2c,_0x24ce75){_0x51ee2c=_0x51ee2c-0x0;var _0x5d76c2=_0xcefd[_0x51ee2c];return _0x5d76c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdcef('0x0'));var zipdir=require(_0xdcef('0x1'));var jsonpatch=require(_0xdcef('0x2'));var rp=require(_0xdcef('0x3'));var moment=require(_0xdcef('0x4'));var BPromise=require(_0xdcef('0x5'));var Mustache=require(_0xdcef('0x6'));var util=require('util');var path=require(_0xdcef('0x7'));var sox=require(_0xdcef('0x8'));var csv=require(_0xdcef('0x9'));var ejs=require(_0xdcef('0xa'));var fs=require('fs');var fs_extra=require(_0xdcef('0xb'));var _=require('lodash');var squel=require(_0xdcef('0xc'));var crypto=require(_0xdcef('0xd'));var jsforce=require(_0xdcef('0xe'));var deskjs=require(_0xdcef('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdcef('0x10'));var Papa=require(_0xdcef('0x11'));var Redis=require(_0xdcef('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdcef('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdcef('0x14'));var logger=require(_0xdcef('0x15'))(_0xdcef('0x16'));var utils=require(_0xdcef('0x17'));var config=require(_0xdcef('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xdcef('0x19'))['db'];config[_0xdcef('0x1a')]=_['defaults'](config[_0xdcef('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xdcef('0x1b'))(new Redis(config[_0xdcef('0x1a')]));require(_0xdcef('0x1c'))[_0xdcef('0x1d')](socket);function respondWithStatusCode(_0x5a20f2,_0x227f49){_0x227f49=_0x227f49||0xcc;return function(_0x3f399d){if(_0x3f399d){return _0x5a20f2['sendStatus'](_0x227f49);}return _0x5a20f2[_0xdcef('0x1e')](_0x227f49)[_0xdcef('0x1f')]();};}function respondWithResult(_0x20d127,_0x55784f){_0x55784f=_0x55784f||0xc8;return function(_0x5522e6){if(_0x5522e6){return _0x20d127[_0xdcef('0x1e')](_0x55784f)[_0xdcef('0x20')](_0x5522e6);}};}function respondWithFilteredResult(_0x61eebb,_0x525a1d){return function(_0x1a79f8){if(_0x1a79f8){var _0x3e2df7=typeof _0x525a1d[_0xdcef('0x21')]==='undefined'&&typeof _0x525a1d[_0xdcef('0x22')]==='undefined';var _0x16c2bd=_0x1a79f8[_0xdcef('0x23')];var _0x151719=_0x3e2df7?0x0:_0x525a1d[_0xdcef('0x21')];var _0x1ba061=_0x3e2df7?_0x1a79f8[_0xdcef('0x23')]:_0x525a1d[_0xdcef('0x21')]+_0x525a1d[_0xdcef('0x22')];var _0x2200b5;if(_0x1ba061>=_0x16c2bd){_0x1ba061=_0x16c2bd;_0x2200b5=0xc8;}else{_0x2200b5=0xce;}_0x61eebb['status'](_0x2200b5);return _0x61eebb[_0xdcef('0x24')](_0xdcef('0x25'),_0x151719+'-'+_0x1ba061+'/'+_0x16c2bd)[_0xdcef('0x20')](_0x1a79f8);}return null;};}function patchUpdates(_0x697abf){return function(_0x5a7e1f){try{jsonpatch[_0xdcef('0x26')](_0x5a7e1f,_0x697abf,!![]);}catch(_0x407fa6){return BPromise['reject'](_0x407fa6);}return _0x5a7e1f[_0xdcef('0x27')]();};}function saveUpdates(_0x19ba1b,_0x280985){return function(_0x1eb490){if(_0x1eb490){return _0x1eb490['update'](_0x19ba1b)[_0xdcef('0x28')](function(_0x4dc915){return _0x4dc915;});}return null;};}function removeEntity(_0x5a7f8e,_0xf9b6a5){return function(_0x84beb3){if(_0x84beb3){return _0x84beb3[_0xdcef('0x29')]()[_0xdcef('0x28')](function(){_0x5a7f8e[_0xdcef('0x1e')](0xcc)[_0xdcef('0x1f')]();});}};}function handleEntityNotFound(_0x1ca0cf,_0x3be3eb){return function(_0x38e03f){if(!_0x38e03f){_0x1ca0cf[_0xdcef('0x2a')](0x194);}return _0x38e03f;};}function handleError(_0x5399f4,_0x3f21f2){_0x3f21f2=_0x3f21f2||0x1f4;return function(_0x5413fe){logger[_0xdcef('0x2b')](_0x5413fe['stack']);if(_0x5413fe[_0xdcef('0x2c')]){delete _0x5413fe['name'];}_0x5399f4['status'](_0x3f21f2)[_0xdcef('0x2d')](_0x5413fe);};}exports[_0xdcef('0x2e')]=function(_0x29229f,_0x2ee1a3){var _0x23f68e={},_0x538866={},_0x4952e1={'count':0x0,'rows':[]};var _0x58849e=_[_0xdcef('0x2f')](db[_0xdcef('0x30')][_0xdcef('0x31')],function(_0x3fec4b){return{'name':_0x3fec4b[_0xdcef('0x32')],'type':_0x3fec4b[_0xdcef('0x33')]['key']};});_0x538866[_0xdcef('0x34')]=_[_0xdcef('0x2f')](_0x58849e,_0xdcef('0x2c'));_0x538866['query']=_[_0xdcef('0x35')](_0x29229f[_0xdcef('0x36')]);_0x538866['filters']=_[_0xdcef('0x37')](_0x538866['model'],_0x538866[_0xdcef('0x36')]);_0x23f68e[_0xdcef('0x38')]=_[_0xdcef('0x37')](_0x538866[_0xdcef('0x34')],qs[_0xdcef('0x39')](_0x29229f['query']['fields']));_0x23f68e['attributes']=_0x23f68e[_0xdcef('0x38')][_0xdcef('0x3a')]?_0x23f68e[_0xdcef('0x38')]:_0x538866[_0xdcef('0x34')];if(!_0x29229f['query'][_0xdcef('0x3b')](_0xdcef('0x3c'))){_0x23f68e[_0xdcef('0x22')]=qs[_0xdcef('0x22')](_0x29229f[_0xdcef('0x36')][_0xdcef('0x22')]);_0x23f68e[_0xdcef('0x21')]=qs[_0xdcef('0x21')](_0x29229f[_0xdcef('0x36')]['offset']);}_0x23f68e[_0xdcef('0x3d')]=qs[_0xdcef('0x3e')](_0x29229f[_0xdcef('0x36')][_0xdcef('0x3e')]);_0x23f68e['where']=qs[_0xdcef('0x3f')](_['pick'](_0x29229f[_0xdcef('0x36')],_0x538866[_0xdcef('0x3f')]),_0x58849e);if(_0x29229f[_0xdcef('0x36')][_0xdcef('0x40')]){_0x23f68e[_0xdcef('0x41')]=_[_0xdcef('0x42')](_0x23f68e[_0xdcef('0x41')],{'$or':_['map'](_0x58849e,function(_0x222108){if(_0x222108[_0xdcef('0x33')]!==_0xdcef('0x43')){var _0x51fee9={};_0x51fee9[_0x222108['name']]={'$like':'%'+_0x29229f[_0xdcef('0x36')][_0xdcef('0x40')]+'%'};return _0x51fee9;}})});}_0x23f68e=_['merge']({},_0x23f68e,_0x29229f[_0xdcef('0x44')]);var _0x6ae33e={'where':_0x23f68e[_0xdcef('0x41')]};return db[_0xdcef('0x30')][_0xdcef('0x23')](_0x6ae33e)[_0xdcef('0x28')](function(_0x207467){_0x4952e1['count']=_0x207467;if(_0x29229f['query'][_0xdcef('0x45')]){_0x23f68e[_0xdcef('0x46')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x23f68e);})[_0xdcef('0x28')](function(_0x4bb109){_0x4952e1[_0xdcef('0x47')]=_0x4bb109;return _0x4952e1;})[_0xdcef('0x28')](respondWithFilteredResult(_0x2ee1a3,_0x23f68e))[_0xdcef('0x48')](handleError(_0x2ee1a3,null));};exports[_0xdcef('0x49')]=function(_0x48f3fd,_0x3babd0){var _0x148379={'raw':![],'where':{'id':_0x48f3fd[_0xdcef('0x4a')]['id']}},_0x2519b9={};_0x2519b9[_0xdcef('0x34')]=_[_0xdcef('0x35')](db['UserProfile'][_0xdcef('0x31')]);_0x2519b9[_0xdcef('0x36')]=_['keys'](_0x48f3fd[_0xdcef('0x36')]);_0x2519b9[_0xdcef('0x3f')]=_['intersection'](_0x2519b9[_0xdcef('0x34')],_0x2519b9['query']);_0x148379[_0xdcef('0x38')]=_[_0xdcef('0x37')](_0x2519b9['model'],qs[_0xdcef('0x39')](_0x48f3fd['query'][_0xdcef('0x39')]));_0x148379['attributes']=_0x148379[_0xdcef('0x38')][_0xdcef('0x3a')]?_0x148379[_0xdcef('0x38')]:_0x2519b9[_0xdcef('0x34')];if(_0x48f3fd[_0xdcef('0x36')][_0xdcef('0x45')]){_0x148379['include']=[{'all':!![]}];}_0x148379=_['merge']({},_0x148379,_0x48f3fd[_0xdcef('0x44')]);return db['UserProfile'][_0xdcef('0x4b')](_0x148379)['then'](handleEntityNotFound(_0x3babd0,null))[_0xdcef('0x28')](respondWithResult(_0x3babd0,null))['catch'](handleError(_0x3babd0,null));};exports[_0xdcef('0x4c')]=function(_0x44c68b,_0x16eaaa){return db['UserProfile']['create'](_0x44c68b[_0xdcef('0x4d')],{})[_0xdcef('0x28')](respondWithResult(_0x16eaaa,0xc9))[_0xdcef('0x48')](handleError(_0x16eaaa,null));};exports[_0xdcef('0x4e')]=function(_0x20c0f5,_0x41b5cb){var _0x97ff91={'where':{'id':_0x20c0f5[_0xdcef('0x4a')]['id']}},_0x488d77={};_0x488d77[_0xdcef('0x34')]=_[_0xdcef('0x35')](db['UserProfile'][_0xdcef('0x31')]);_0x97ff91[_0xdcef('0x38')]=_[_0xdcef('0x37')](_0x488d77['model'],qs[_0xdcef('0x39')](_0x20c0f5[_0xdcef('0x36')][_0xdcef('0x39')]));_0x97ff91[_0xdcef('0x38')]=_0x97ff91[_0xdcef('0x38')][_0xdcef('0x3a')]?_0x97ff91[_0xdcef('0x38')]:_0x488d77[_0xdcef('0x34')];if(_0x20c0f5['query'][_0xdcef('0x45')]){_0x97ff91[_0xdcef('0x46')]=[{'all':!![]}];}_0x97ff91=_[_0xdcef('0x42')]({},_0x97ff91,_0x20c0f5[_0xdcef('0x44')]);return db[_0xdcef('0x30')][_0xdcef('0x4b')](_0x97ff91)[_0xdcef('0x28')](handleEntityNotFound(_0x41b5cb,null))[_0xdcef('0x28')](function(_0x5a1262){if(_0x5a1262){var _0x45b3ef=_0x5a1262['get']({'plain':!![]});_0x45b3ef=qs[_0xdcef('0x4f')](_0x45b3ef,['id',_0xdcef('0x50'),_0xdcef('0x51'),'crudPermissions']);_0x20c0f5[_0xdcef('0x4d')]=_['omit'](_0x20c0f5[_0xdcef('0x4d')],['id',_0xdcef('0x50'),_0xdcef('0x51')]);return db['sequelize'][_0xdcef('0x52')](function(_0x5cb58f){return db[_0xdcef('0x30')][_0xdcef('0x4c')](_[_0xdcef('0x42')](_0x45b3ef,_0x20c0f5[_0xdcef('0x4d')]),{'include':_0x20c0f5[_0xdcef('0x36')][_0xdcef('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x5cb58f})['then'](function(_0x314d47){var _0x1a76e2=_0x314d47[_0xdcef('0x53')]({'plain':!![]});return db[_0xdcef('0x54')][_0xdcef('0x55')]({'where':{'userProfileId':_0x20c0f5[_0xdcef('0x4a')]['id']},'raw':!![]})[_0xdcef('0x28')](function(_0x586b30){if(_0x586b30){return BPromise['each'](_0x586b30,function(_0x10b3c3){return new BPromise(function(_0x3a5bce,_0x4108da){if(_0x10b3c3[_0xdcef('0x56')]===null||_0x10b3c3['autoAssociation']===0x1)_0x3a5bce(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x10b3c3['id']},'raw':!![]})[_0xdcef('0x28')](function(_0x1bb2a3){var _0x36cf8d=_[_0xdcef('0x2f')](_0x1bb2a3,function(_0x3ae139){return qs[_0xdcef('0x4f')](_0x3ae139,['id','createdAt',_0xdcef('0x51'),_0xdcef('0x57')]);});_0x3a5bce(_0x36cf8d);})[_0xdcef('0x48')](function(_0x3eca5b){_0x4108da(_0x3eca5b);});})[_0xdcef('0x28')](function(_0x40dab2){var _0x24c350=qs[_0xdcef('0x4f')](_0x10b3c3,['id','createdAt','updatedAt']);_0x24c350[_0xdcef('0x58')]=_0x1a76e2['id'];if(_0x40dab2)_0x24c350[_0xdcef('0x59')]=_0x40dab2;return _0x24c350;})['then'](function(_0x3e69f2){return db[_0xdcef('0x54')][_0xdcef('0x4c')](_0x3e69f2,{'include':[{'model':db[_0xdcef('0x5a')],'as':_0xdcef('0x59')}],'raw':!![],'transaction':_0x5cb58f});});})[_0xdcef('0x28')](function(){return _0x1a76e2;});}});});});}})[_0xdcef('0x28')](respondWithResult(_0x41b5cb,0xc9))['catch'](handleError(_0x41b5cb,null));};exports['update']=function(_0x59acfe,_0x3e9258){if(_0x59acfe['body']['id']){delete _0x59acfe[_0xdcef('0x4d')]['id'];}return db[_0xdcef('0x30')]['find']({'where':{'id':_0x59acfe['params']['id']}})[_0xdcef('0x28')](handleEntityNotFound(_0x3e9258,null))[_0xdcef('0x28')](saveUpdates(_0x59acfe[_0xdcef('0x4d')],null))[_0xdcef('0x28')](respondWithResult(_0x3e9258,null))[_0xdcef('0x48')](handleError(_0x3e9258,null));};exports[_0xdcef('0x29')]=function(_0x1762ce,_0x20a181){return db['UserProfile'][_0xdcef('0x4b')]({'where':{'id':_0x1762ce[_0xdcef('0x4a')]['id']}})[_0xdcef('0x28')](handleEntityNotFound(_0x20a181,null))[_0xdcef('0x28')](removeEntity(_0x20a181,null))['catch'](handleError(_0x20a181,null));};exports[_0xdcef('0x5b')]=function(_0x4e879f,_0x53d5d1){return db['UserProfile'][_0xdcef('0x5b')]()[_0xdcef('0x28')](respondWithResult(_0x53d5d1,null))[_0xdcef('0x48')](handleError(_0x53d5d1,null));};exports['addSections']=function(_0x243b90,_0x49c23a){var _0x41ea7d=_0x243b90[_0xdcef('0x4d')];return db[_0xdcef('0x30')][_0xdcef('0x4b')]({'where':{'id':_0x243b90[_0xdcef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x49c23a,null))['then'](function(_0x20bfcf){if(_0x20bfcf){return db['sequelize']['transaction'](function(_0x38791e){return db[_0xdcef('0x54')][_0xdcef('0x29')]({'where':{'userProfileId':_0x243b90[_0xdcef('0x4a')]['id'],'sectionId':_[_0xdcef('0x2f')](_0x41ea7d,function(_0x4f584d){return _0x4f584d[_0xdcef('0x57')];})},'transaction':_0x38791e})[_0xdcef('0x28')](function(){var _0x280117=_['map'](_0x41ea7d,function(_0x179bdd){_0x179bdd[_0xdcef('0x58')]=_0x243b90['params']['id'];return _0x179bdd;});var _0x26ee2f=[];return BPromise[_0xdcef('0x5c')](_0x280117,function(_0x40f492){return db[_0xdcef('0x54')][_0xdcef('0x4c')](_0x40f492,{'include':[{'model':db[_0xdcef('0x5a')],'as':_0xdcef('0x59')}],'raw':!![],'transaction':_0x38791e})[_0xdcef('0x28')](function(_0x4b852f){_0x26ee2f['push'](_0x4b852f['get']({'plain':!![]}));});})['then'](function(){return _0x26ee2f;});});});}})[_0xdcef('0x28')](function(_0x295118){return _0x295118;})['then'](respondWithResult(_0x49c23a,null))[_0xdcef('0x48')](handleError(_0x49c23a,null));};exports[_0xdcef('0x5d')]=function(_0x572fd8,_0x39e0f7){var _0xa86f07;return db[_0xdcef('0x30')][_0xdcef('0x4b')]({'where':{'id':_0x572fd8[_0xdcef('0x4a')]['id']},'attributes':['id',_0xdcef('0x2c')]})[_0xdcef('0x28')](handleEntityNotFound(_0x39e0f7,null))[_0xdcef('0x28')](function(_0x3931ff){if(_0x3931ff){_0xa86f07=_0x3931ff;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x572fd8[_0xdcef('0x4a')]['id'],'sectionId':_0x572fd8[_0xdcef('0x36')][_0xdcef('0x5e')]}});}})[_0xdcef('0x28')](function(){return _0xa86f07;})['then'](respondWithStatusCode(_0x39e0f7,null))[_0xdcef('0x48')](handleError(_0x39e0f7,null));};exports[_0xdcef('0x5f')]=function(_0xc7dd18,_0x50e24c){var _0x3b2b1d=[];var _0xe883b1=[];return db[_0xdcef('0x54')]['findAll']({'where':{'userProfileId':_0xc7dd18[_0xdcef('0x4a')]['id']},'raw':!![]})[_0xdcef('0x28')](function(_0x31d1b0){_0x3b2b1d=_[_0xdcef('0x40')](_0x31d1b0,function(_0x30f54d){return _0x30f54d[_0xdcef('0x60')]===0x1||_[_0xdcef('0x61')]([0x3eb,0x709],_0x30f54d[_0xdcef('0x57')]);});if(!_[_0xdcef('0x62')](_0x3b2b1d)){return _[_0xdcef('0x2f')](_0x3b2b1d,function(_0x121a46){return _0x121a46['sectionId'];});}else{return;}})['then'](function(_0x3e92eb){if(_0x3e92eb)_0xe883b1=_0x3e92eb;if(_[_0xdcef('0x61')](_0xe883b1,0x64)){var _0x21a29e=_['find'](_0x3b2b1d,{'sectionId':0x64});return hasDefaultDashboard(_0x21a29e)['then'](function(_0x256ea4){return _[_0xdcef('0x2f')](_0x3b2b1d,function(_0x16f607){if(_0x16f607[_0xdcef('0x57')]===0x64){_0x16f607['subsections']=_0x256ea4;}return _0x16f607;});});}else{return;}})[_0xdcef('0x28')](function(_0x9689e2){if(_0x9689e2)_0x3b2b1d=_0x9689e2;if(_[_0xdcef('0x61')](_0xe883b1,0x3eb)){var _0x21a3b5=_[_0xdcef('0x4b')](_0x3b2b1d,{'sectionId':0x3eb});return getCustomDashboards(_0x21a3b5)[_0xdcef('0x28')](function(_0x2c193a){return _[_0xdcef('0x2f')](_0x3b2b1d,function(_0x445e5f){if(_0x21a3b5[_0xdcef('0x60')]){if(_0x445e5f['sectionId']===0x3eb){_0x445e5f[_0xdcef('0x63')]=_0x2c193a;}}else{if(_0x445e5f[_0xdcef('0x57')]===0x64){_0x445e5f[_0xdcef('0x63')]=_0x2c193a;}}return _0x445e5f;});});}else{return;}})[_0xdcef('0x28')](function(_0x231da6){if(_0x231da6)_0x3b2b1d=_0x231da6;if(_[_0xdcef('0x61')](_0xe883b1,0x709)){var _0x150191=_['find'](_0x3b2b1d,{'sectionId':0x709});return getPlugins(_0x150191)[_0xdcef('0x28')](function(_0xcedd0c){if(_0x150191['enabled']){return _[_0xdcef('0x2f')](_0x3b2b1d,function(_0x18852a){if(_0x18852a['sectionId']===0x709){_0x18852a['subsections']=_0xcedd0c;}return _0x18852a;});}else{var _0x219ed6={'sectionId':0x76c,'enabled':0x1,'subsections':_0xcedd0c};var _0x38c73f=_[_0xdcef('0x2f')](_0x3b2b1d);_0x38c73f['push'](_0x219ed6);return _0x38c73f;}});}else{return;}})['then'](function(_0x54866f){if(_0x54866f)_0x3b2b1d=_0x54866f;return _[_0xdcef('0x40')](_0x3b2b1d,['enabled',0x1]);})['then'](respondWithResult(_0x50e24c,null))['catch'](handleError(_0x50e24c,null));};function hasDefaultDashboard(_0x30c20d){var _0x1116bb=[0x65];return new BPromise(function(_0x2740cb,_0x40c429){try{if(_0x30c20d[_0xdcef('0x56')]){_0x2740cb(_0x1116bb);}else{return db[_0xdcef('0x5a')][_0xdcef('0x64')]({'where':{'sectionId':_0x30c20d['id']},'raw':!![]})[_0xdcef('0x28')](function(_0x4473f9){_0x4473f9?_0x2740cb(_0x1116bb):_0x2740cb();});}}catch(_0x2cf5f){_0x40c429(_0x2cf5f);}});}function getCustomDashboards(_0x4f45c4){var _0x213073=[];return new BPromise(function(_0x313d54,_0x350e21){try{if(_0x4f45c4['autoAssociation']){return db[_0xdcef('0x65')][_0xdcef('0x55')]({'raw':!![]})[_0xdcef('0x28')](function(_0x3723b5){_0x3723b5[_0xdcef('0x66')](function(_0x2815f4){_0x213073[_0xdcef('0x67')](_0x2815f4['id']+0x1869f);});_0x313d54(_0x213073);});}else{return db[_0xdcef('0x5a')][_0xdcef('0x55')]({'where':{'sectionId':_0x4f45c4['id']},'raw':!![]})[_0xdcef('0x28')](function(_0x3a30e8){_0x3a30e8['forEach'](function(_0x59e6fb){_0x213073['push'](_0x59e6fb[_0xdcef('0x68')]+0x1869f);});_0x313d54(_0x213073);});}}catch(_0x5cb762){_0x350e21(_0x5cb762);}});}function getPlugins(_0x4a3292){var _0x1056ad=[];return new BPromise(function(_0x2b0358,_0x53af90){try{if(_0x4a3292[_0xdcef('0x56')]){return db[_0xdcef('0x69')][_0xdcef('0x55')]({'raw':!![]})['then'](function(_0x48f521){_0x48f521[_0xdcef('0x66')](function(_0x320ab0){_0x1056ad[_0xdcef('0x67')](_0x320ab0['id']+0x15b38);});_0x2b0358(_0x1056ad);});}else{return db[_0xdcef('0x5a')]['findAll']({'where':{'sectionId':_0x4a3292['id']},'raw':!![]})[_0xdcef('0x28')](function(_0x3c4719){_0x3c4719[_0xdcef('0x66')](function(_0x14a000){_0x1056ad[_0xdcef('0x67')](_0x14a000[_0xdcef('0x68')]+0x15b38);});_0x2b0358(_0x1056ad);});}}catch(_0x53e4a6){_0x53af90(_0x53e4a6);}});}exports[_0xdcef('0x6a')]=function(_0x449f48,_0x18d4a3){return db[_0xdcef('0x30')]['find']({'where':{'id':_0x449f48[_0xdcef('0x4a')]['id']}})[_0xdcef('0x28')](handleEntityNotFound(_0x18d4a3,null))[_0xdcef('0x28')](function(_0xc31a0c){if(_0xc31a0c){return db[_0xdcef('0x6b')]['transaction'](function(_0x557121){return db[_0xdcef('0x54')][_0xdcef('0x55')]({'where':{'userProfileId':_0x449f48['params']['id']},'attributes':['id'],'raw':!![]})[_0xdcef('0x28')](function(_0x5f24bf){if(_0x5f24bf){return db[_0xdcef('0x54')]['destroy']({'where':{'userProfileId':_0x449f48['params']['id'],'id':_[_0xdcef('0x2f')](_0x5f24bf,function(_0x3c9563){return _0x3c9563['id'];})},'transaction':_0x557121});}})[_0xdcef('0x28')](function(_0x557479){var _0x23264d=_[_0xdcef('0x2f')](_0x449f48[_0xdcef('0x4d')],function(_0x597f6f){_0x597f6f[_0xdcef('0x58')]=_0x449f48['params']['id'];return _0x597f6f;});return db[_0xdcef('0x54')][_0xdcef('0x6c')](_0x23264d,{'raw':!![],'transaction':_0x557121});})[_0xdcef('0x28')](function(_0x315fb9){var _0x5e2c7d=_[_0xdcef('0x40')](_[_0xdcef('0x2f')](_0x315fb9,function(_0x4d814b){return _0x4d814b[_0xdcef('0x53')]({'plain':!![]});}),{'includeAll':![]});if(_0x5e2c7d){return db[_0xdcef('0x54')]['findAll']({'where':{'userProfileId':_0x449f48[_0xdcef('0x4a')]['id'],'sectionId':_['map'](_0x5e2c7d,function(_0x12631d){return _0x12631d[_0xdcef('0x57')];})},'attributes':['id',_0xdcef('0x57')],'raw':!![]})[_0xdcef('0x28')](function(_0x3043c3){var _0x4a0874=_[_0xdcef('0x2f')](_0x449f48[_0xdcef('0x4d')],function(_0x57a2b9){_0x57a2b9[_0xdcef('0x58')]=_0x449f48[_0xdcef('0x4a')]['id'];return _0x57a2b9;});return db[_0xdcef('0x5a')][_0xdcef('0x6c')](_0x4a0874,{'raw':!![],'transaction':_0x557121});});}})['catch'](handleError(_0x18d4a3,null));});}})[_0xdcef('0x28')](function(_0x15b367){var _0x5b7ac7=_[_0xdcef('0x2f')](_0x15b367,function(_0x5c356f){return _0x5c356f['get']({'plain':!![]});});})[_0xdcef('0x28')](respondWithResult(_0x18d4a3,null))['catch'](handleError(_0x18d4a3,null));};exports[_0xdcef('0x6d')]=function(_0x1e6775,_0x3942c6,_0x5baf61){return db[_0xdcef('0x30')][_0xdcef('0x4b')]({'where':{'id':_0x1e6775[_0xdcef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3942c6,null))[_0xdcef('0x28')](function(_0x1de762){if(_0x1de762){return _0x1de762[_0xdcef('0x6d')](_0x1e6775[_0xdcef('0x36')][_0xdcef('0x5e')]);}})[_0xdcef('0x28')](respondWithStatusCode(_0x3942c6,null))[_0xdcef('0x48')](handleError(_0x3942c6,null));};exports[_0xdcef('0x6e')]=function(_0x22aac1,_0x1e2a02){var _0x3a7739={};if(!_0x22aac1[_0xdcef('0x36')][_0xdcef('0x6f')])throw new Error(_0xdcef('0x70'));if(!_0x22aac1['query']['hasOwnProperty']('nolimit')){_0x3a7739[_0xdcef('0x22')]=qs[_0xdcef('0x22')](_0x22aac1[_0xdcef('0x36')][_0xdcef('0x22')]);_0x3a7739[_0xdcef('0x21')]=qs[_0xdcef('0x21')](_0x22aac1['query'][_0xdcef('0x21')]);}return db['UserProfile'][_0xdcef('0x4b')]({'where':{'id':_0x22aac1['params']['id']}})['then'](function(_0xee6502){if(!_0xee6502)throw new Error(_0xdcef('0x71')+_0x22aac1['params']['id']);return db['UserProfile'][_0xdcef('0x6e')](_0x22aac1);})[_0xdcef('0x28')](respondWithFilteredResult(_0x1e2a02,_0x3a7739))[_0xdcef('0x48')](handleError(_0x1e2a02,null));}; \ No newline at end of file +var _0x3cae=['where','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','merge','find','create','clone','get','omit','updatedAt','crudPermissions','body','createdAt','sequelize','transaction','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection','UserProfileResource','describe','addSections','push','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','findOne','forEach','resourceId','bulkCreate','removeResources','section','Missing\x20section\x20parameter','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfile','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0xa506fe,_0x3c76c8){var _0x37598e=function(_0x3436f1){while(--_0x3436f1){_0xa506fe['push'](_0xa506fe['shift']());}};_0x37598e(++_0x3c76c8);}(_0x3cae,0x117));var _0xe3ca=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x3cae[_0x4099ee];return _0x1b7bfc;};'use strict';var emlformat=require(_0xe3ca('0x0'));var rimraf=require(_0xe3ca('0x1'));var zipdir=require(_0xe3ca('0x2'));var jsonpatch=require(_0xe3ca('0x3'));var rp=require(_0xe3ca('0x4'));var moment=require(_0xe3ca('0x5'));var BPromise=require(_0xe3ca('0x6'));var Mustache=require('mustache');var util=require(_0xe3ca('0x7'));var path=require(_0xe3ca('0x8'));var sox=require('sox');var csv=require(_0xe3ca('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe3ca('0xa'));var _=require(_0xe3ca('0xb'));var squel=require(_0xe3ca('0xc'));var crypto=require('crypto');var jsforce=require(_0xe3ca('0xd'));var deskjs=require(_0xe3ca('0xe'));var toCsv=require(_0xe3ca('0x9'));var querystring=require(_0xe3ca('0xf'));var Papa=require(_0xe3ca('0x10'));var Redis=require(_0xe3ca('0x11'));var authService=require(_0xe3ca('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe3ca('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe3ca('0x14'))(_0xe3ca('0x15'));var utils=require(_0xe3ca('0x16'));var config=require(_0xe3ca('0x17'));var licenseUtil=require(_0xe3ca('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe3ca('0x19')](config['redis'],{'host':_0xe3ca('0x1a'),'port':0x18eb});var socket=require(_0xe3ca('0x1b'))(new Redis(config['redis']));require(_0xe3ca('0x1c'))[_0xe3ca('0x1d')](socket);function respondWithStatusCode(_0x210c69,_0x6a8907){_0x6a8907=_0x6a8907||0xcc;return function(_0x9ef773){if(_0x9ef773){return _0x210c69[_0xe3ca('0x1e')](_0x6a8907);}return _0x210c69[_0xe3ca('0x1f')](_0x6a8907)[_0xe3ca('0x20')]();};}function respondWithResult(_0x5f2e2d,_0x479977){_0x479977=_0x479977||0xc8;return function(_0xca43ee){if(_0xca43ee){return _0x5f2e2d[_0xe3ca('0x1f')](_0x479977)[_0xe3ca('0x21')](_0xca43ee);}};}function respondWithFilteredResult(_0x3dae55,_0x1dd153){return function(_0x2d73d9){if(_0x2d73d9){var _0x5bb8d8=typeof _0x1dd153[_0xe3ca('0x22')]===_0xe3ca('0x23')&&typeof _0x1dd153[_0xe3ca('0x24')]==='undefined';var _0x4b7b9f=_0x2d73d9['count'];var _0x21c516=_0x5bb8d8?0x0:_0x1dd153['offset'];var _0x508317=_0x5bb8d8?_0x2d73d9[_0xe3ca('0x25')]:_0x1dd153[_0xe3ca('0x22')]+_0x1dd153[_0xe3ca('0x24')];var _0x149291;if(_0x508317>=_0x4b7b9f){_0x508317=_0x4b7b9f;_0x149291=0xc8;}else{_0x149291=0xce;}_0x3dae55[_0xe3ca('0x1f')](_0x149291);return _0x3dae55['set'](_0xe3ca('0x26'),_0x21c516+'-'+_0x508317+'/'+_0x4b7b9f)[_0xe3ca('0x21')](_0x2d73d9);}return null;};}function patchUpdates(_0x5bc481){return function(_0x3f4740){try{jsonpatch[_0xe3ca('0x27')](_0x3f4740,_0x5bc481,!![]);}catch(_0x33dc04){return BPromise[_0xe3ca('0x28')](_0x33dc04);}return _0x3f4740[_0xe3ca('0x29')]();};}function saveUpdates(_0x392bdb,_0x2b571f){return function(_0x25b39e){if(_0x25b39e){return _0x25b39e[_0xe3ca('0x2a')](_0x392bdb)[_0xe3ca('0x2b')](function(_0xa5b18f){return _0xa5b18f;});}return null;};}function removeEntity(_0x5098e3,_0x16e1d6){return function(_0x5740af){if(_0x5740af){return _0x5740af[_0xe3ca('0x2c')]()[_0xe3ca('0x2b')](function(){_0x5098e3[_0xe3ca('0x1f')](0xcc)[_0xe3ca('0x20')]();});}};}function handleEntityNotFound(_0x576491,_0x4c01c8){return function(_0x2e1636){if(!_0x2e1636){_0x576491[_0xe3ca('0x1e')](0x194);}return _0x2e1636;};}function handleError(_0x4569e3,_0x4ef90f){_0x4ef90f=_0x4ef90f||0x1f4;return function(_0x1dbd98){logger[_0xe3ca('0x2d')](_0x1dbd98[_0xe3ca('0x2e')]);if(_0x1dbd98[_0xe3ca('0x2f')]){delete _0x1dbd98['name'];}_0x4569e3['status'](_0x4ef90f)[_0xe3ca('0x30')](_0x1dbd98);};}exports['index']=function(_0x24d40a,_0x5cf384){var _0x5576b4={},_0xd5e714={},_0x1517ac={'count':0x0,'rows':[]};var _0xcb58e9=_[_0xe3ca('0x31')](db[_0xe3ca('0x32')]['rawAttributes'],function(_0x11dd1d){return{'name':_0x11dd1d['fieldName'],'type':_0x11dd1d['type'][_0xe3ca('0x33')]};});_0xd5e714[_0xe3ca('0x34')]=_[_0xe3ca('0x31')](_0xcb58e9,_0xe3ca('0x2f'));_0xd5e714[_0xe3ca('0x35')]=_[_0xe3ca('0x36')](_0x24d40a[_0xe3ca('0x35')]);_0xd5e714[_0xe3ca('0x37')]=_[_0xe3ca('0x38')](_0xd5e714[_0xe3ca('0x34')],_0xd5e714[_0xe3ca('0x35')]);_0x5576b4[_0xe3ca('0x39')]=_['intersection'](_0xd5e714[_0xe3ca('0x34')],qs[_0xe3ca('0x3a')](_0x24d40a[_0xe3ca('0x35')][_0xe3ca('0x3a')]));_0x5576b4[_0xe3ca('0x39')]=_0x5576b4[_0xe3ca('0x39')]['length']?_0x5576b4[_0xe3ca('0x39')]:_0xd5e714[_0xe3ca('0x34')];if(!_0x24d40a[_0xe3ca('0x35')][_0xe3ca('0x3b')](_0xe3ca('0x3c'))){_0x5576b4[_0xe3ca('0x24')]=qs[_0xe3ca('0x24')](_0x24d40a[_0xe3ca('0x35')][_0xe3ca('0x24')]);_0x5576b4['offset']=qs[_0xe3ca('0x22')](_0x24d40a[_0xe3ca('0x35')]['offset']);}_0x5576b4[_0xe3ca('0x3d')]=qs[_0xe3ca('0x3e')](_0x24d40a[_0xe3ca('0x35')]['sort']);_0x5576b4[_0xe3ca('0x3f')]=qs[_0xe3ca('0x37')](_['pick'](_0x24d40a[_0xe3ca('0x35')],_0xd5e714['filters']),_0xcb58e9);if(_0x24d40a['query'][_0xe3ca('0x40')]){_0x5576b4[_0xe3ca('0x3f')]=_['merge'](_0x5576b4[_0xe3ca('0x3f')],{'$or':_[_0xe3ca('0x31')](_0xcb58e9,function(_0xa1b3fa){if(_0xa1b3fa[_0xe3ca('0x41')]!==_0xe3ca('0x42')){var _0x2f1dcb={};_0x2f1dcb[_0xa1b3fa[_0xe3ca('0x2f')]]={'$like':'%'+_0x24d40a[_0xe3ca('0x35')][_0xe3ca('0x40')]+'%'};return _0x2f1dcb;}})});}_0x5576b4=_['merge']({},_0x5576b4,_0x24d40a[_0xe3ca('0x43')]);var _0x13781d={'where':_0x5576b4[_0xe3ca('0x3f')]};return db[_0xe3ca('0x32')][_0xe3ca('0x25')](_0x13781d)[_0xe3ca('0x2b')](function(_0x2a0290){_0x1517ac[_0xe3ca('0x25')]=_0x2a0290;if(_0x24d40a[_0xe3ca('0x35')][_0xe3ca('0x44')]){_0x5576b4[_0xe3ca('0x45')]=[{'all':!![]}];}return db[_0xe3ca('0x32')][_0xe3ca('0x46')](_0x5576b4);})['then'](function(_0x275010){_0x1517ac[_0xe3ca('0x47')]=_0x275010;return _0x1517ac;})['then'](respondWithFilteredResult(_0x5cf384,_0x5576b4))[_0xe3ca('0x48')](handleError(_0x5cf384,null));};exports[_0xe3ca('0x49')]=function(_0x8f004d,_0x4df55d){var _0x294797={'raw':![],'where':{'id':_0x8f004d[_0xe3ca('0x4a')]['id']}},_0x1c4706={};_0x1c4706[_0xe3ca('0x34')]=_[_0xe3ca('0x36')](db[_0xe3ca('0x32')][_0xe3ca('0x4b')]);_0x1c4706['query']=_[_0xe3ca('0x36')](_0x8f004d[_0xe3ca('0x35')]);_0x1c4706['filters']=_['intersection'](_0x1c4706[_0xe3ca('0x34')],_0x1c4706[_0xe3ca('0x35')]);_0x294797['attributes']=_[_0xe3ca('0x38')](_0x1c4706[_0xe3ca('0x34')],qs['fields'](_0x8f004d['query'][_0xe3ca('0x3a')]));_0x294797[_0xe3ca('0x39')]=_0x294797[_0xe3ca('0x39')][_0xe3ca('0x4c')]?_0x294797[_0xe3ca('0x39')]:_0x1c4706['model'];if(_0x8f004d[_0xe3ca('0x35')][_0xe3ca('0x44')]){_0x294797[_0xe3ca('0x45')]=[{'all':!![]}];}_0x294797=_[_0xe3ca('0x4d')]({},_0x294797,_0x8f004d[_0xe3ca('0x43')]);return db[_0xe3ca('0x32')][_0xe3ca('0x4e')](_0x294797)[_0xe3ca('0x2b')](handleEntityNotFound(_0x4df55d,null))[_0xe3ca('0x2b')](respondWithResult(_0x4df55d,null))['catch'](handleError(_0x4df55d,null));};exports['create']=function(_0x539d5f,_0x542dfb){return db[_0xe3ca('0x32')][_0xe3ca('0x4f')](_0x539d5f['body'],{})['then'](respondWithResult(_0x542dfb,0xc9))[_0xe3ca('0x48')](handleError(_0x542dfb,null));};exports[_0xe3ca('0x50')]=function(_0x468a60,_0x5e6d80){var _0x4e48ca={'where':{'id':_0x468a60['params']['id']}},_0x3b5202={};_0x3b5202[_0xe3ca('0x34')]=_[_0xe3ca('0x36')](db[_0xe3ca('0x32')][_0xe3ca('0x4b')]);_0x4e48ca[_0xe3ca('0x39')]=_[_0xe3ca('0x38')](_0x3b5202[_0xe3ca('0x34')],qs[_0xe3ca('0x3a')](_0x468a60[_0xe3ca('0x35')][_0xe3ca('0x3a')]));_0x4e48ca[_0xe3ca('0x39')]=_0x4e48ca['attributes'][_0xe3ca('0x4c')]?_0x4e48ca[_0xe3ca('0x39')]:_0x3b5202['model'];if(_0x468a60[_0xe3ca('0x35')][_0xe3ca('0x44')]){_0x4e48ca[_0xe3ca('0x45')]=[{'all':!![]}];}_0x4e48ca=_[_0xe3ca('0x4d')]({},_0x4e48ca,_0x468a60['options']);return db['UserProfile'][_0xe3ca('0x4e')](_0x4e48ca)[_0xe3ca('0x2b')](handleEntityNotFound(_0x5e6d80,null))[_0xe3ca('0x2b')](function(_0x4aaf8e){if(_0x4aaf8e){var _0xcd4de3=_0x4aaf8e[_0xe3ca('0x51')]({'plain':!![]});_0xcd4de3=qs[_0xe3ca('0x52')](_0xcd4de3,['id','createdAt',_0xe3ca('0x53'),_0xe3ca('0x54')]);_0x468a60[_0xe3ca('0x55')]=_[_0xe3ca('0x52')](_0x468a60[_0xe3ca('0x55')],['id',_0xe3ca('0x56'),_0xe3ca('0x53')]);return db[_0xe3ca('0x57')][_0xe3ca('0x58')](function(_0x48a64a){return db[_0xe3ca('0x32')][_0xe3ca('0x4f')](_[_0xe3ca('0x4d')](_0xcd4de3,_0x468a60[_0xe3ca('0x55')]),{'include':_0x468a60[_0xe3ca('0x35')][_0xe3ca('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x48a64a})[_0xe3ca('0x2b')](function(_0x56ab94){var _0x378294=_0x56ab94[_0xe3ca('0x51')]({'plain':!![]});return db['UserProfileSection'][_0xe3ca('0x46')]({'where':{'userProfileId':_0x468a60[_0xe3ca('0x4a')]['id']},'raw':!![]})['then'](function(_0x47fc85){if(_0x47fc85){return BPromise[_0xe3ca('0x59')](_0x47fc85,function(_0x320665){return new BPromise(function(_0xec2366,_0x5ca9a4){if(_0x320665['autoAssociation']===null||_0x320665[_0xe3ca('0x5a')]===0x1)_0xec2366(null);return db['UserProfileResource'][_0xe3ca('0x46')]({'where':{'sectionId':_0x320665['id']},'raw':!![]})[_0xe3ca('0x2b')](function(_0x21d256){var _0x45984c=_[_0xe3ca('0x31')](_0x21d256,function(_0x821d5c){return qs[_0xe3ca('0x52')](_0x821d5c,['id',_0xe3ca('0x56'),_0xe3ca('0x53'),_0xe3ca('0x5b')]);});_0xec2366(_0x45984c);})['catch'](function(_0xac1e23){_0x5ca9a4(_0xac1e23);});})[_0xe3ca('0x2b')](function(_0x28ccd6){var _0x32c62a=qs[_0xe3ca('0x52')](_0x320665,['id','createdAt',_0xe3ca('0x53')]);_0x32c62a[_0xe3ca('0x5c')]=_0x378294['id'];if(_0x28ccd6)_0x32c62a[_0xe3ca('0x5d')]=_0x28ccd6;return _0x32c62a;})[_0xe3ca('0x2b')](function(_0x1bbd98){return db[_0xe3ca('0x5e')][_0xe3ca('0x4f')](_0x1bbd98,{'include':[{'model':db[_0xe3ca('0x5f')],'as':_0xe3ca('0x5d')}],'raw':!![],'transaction':_0x48a64a});});})[_0xe3ca('0x2b')](function(){return _0x378294;});}});});});}})[_0xe3ca('0x2b')](respondWithResult(_0x5e6d80,0xc9))['catch'](handleError(_0x5e6d80,null));};exports['update']=function(_0x26db6f,_0x4c3def){if(_0x26db6f[_0xe3ca('0x55')]['id']){delete _0x26db6f[_0xe3ca('0x55')]['id'];}return db[_0xe3ca('0x32')][_0xe3ca('0x4e')]({'where':{'id':_0x26db6f['params']['id']}})[_0xe3ca('0x2b')](handleEntityNotFound(_0x4c3def,null))[_0xe3ca('0x2b')](saveUpdates(_0x26db6f['body'],null))['then'](respondWithResult(_0x4c3def,null))[_0xe3ca('0x48')](handleError(_0x4c3def,null));};exports[_0xe3ca('0x2c')]=function(_0x121383,_0x473de7){return db[_0xe3ca('0x32')][_0xe3ca('0x4e')]({'where':{'id':_0x121383[_0xe3ca('0x4a')]['id']}})['then'](handleEntityNotFound(_0x473de7,null))[_0xe3ca('0x2b')](removeEntity(_0x473de7,null))[_0xe3ca('0x48')](handleError(_0x473de7,null));};exports[_0xe3ca('0x60')]=function(_0x26829c,_0x4da4f1){return db['UserProfile'][_0xe3ca('0x60')]()[_0xe3ca('0x2b')](respondWithResult(_0x4da4f1,null))[_0xe3ca('0x48')](handleError(_0x4da4f1,null));};exports[_0xe3ca('0x61')]=function(_0x172e34,_0x5d107f){var _0x673cf0=_0x172e34[_0xe3ca('0x55')];return db[_0xe3ca('0x32')][_0xe3ca('0x4e')]({'where':{'id':_0x172e34[_0xe3ca('0x4a')]['id']}})[_0xe3ca('0x2b')](handleEntityNotFound(_0x5d107f,null))[_0xe3ca('0x2b')](function(_0x7c1f3a){if(_0x7c1f3a){return db['sequelize'][_0xe3ca('0x58')](function(_0x141ea9){return db[_0xe3ca('0x5e')][_0xe3ca('0x2c')]({'where':{'userProfileId':_0x172e34[_0xe3ca('0x4a')]['id'],'sectionId':_[_0xe3ca('0x31')](_0x673cf0,function(_0x5c96f3){return _0x5c96f3[_0xe3ca('0x5b')];})},'transaction':_0x141ea9})[_0xe3ca('0x2b')](function(){var _0x3cb361=_['map'](_0x673cf0,function(_0x1e309b){_0x1e309b[_0xe3ca('0x5c')]=_0x172e34['params']['id'];return _0x1e309b;});var _0x205278=[];return BPromise[_0xe3ca('0x59')](_0x3cb361,function(_0x323af2){return db[_0xe3ca('0x5e')][_0xe3ca('0x4f')](_0x323af2,{'include':[{'model':db['UserProfileResource'],'as':_0xe3ca('0x5d')}],'raw':!![],'transaction':_0x141ea9})[_0xe3ca('0x2b')](function(_0x4cfce7){_0x205278[_0xe3ca('0x62')](_0x4cfce7[_0xe3ca('0x51')]({'plain':!![]}));});})['then'](function(){return _0x205278;});});});}})[_0xe3ca('0x2b')](function(_0x39675a){return _0x39675a;})['then'](respondWithResult(_0x5d107f,null))[_0xe3ca('0x48')](handleError(_0x5d107f,null));};exports[_0xe3ca('0x63')]=function(_0xf21044,_0x41c222){var _0x385975;return db[_0xe3ca('0x32')][_0xe3ca('0x4e')]({'where':{'id':_0xf21044['params']['id']},'attributes':['id','name']})[_0xe3ca('0x2b')](handleEntityNotFound(_0x41c222,null))[_0xe3ca('0x2b')](function(_0x429b61){if(_0x429b61){_0x385975=_0x429b61;return db[_0xe3ca('0x5e')]['destroy']({'where':{'userProfileId':_0xf21044[_0xe3ca('0x4a')]['id'],'sectionId':_0xf21044['query'][_0xe3ca('0x64')]}});}})[_0xe3ca('0x2b')](function(){return _0x385975;})[_0xe3ca('0x2b')](respondWithStatusCode(_0x41c222,null))[_0xe3ca('0x48')](handleError(_0x41c222,null));};exports[_0xe3ca('0x65')]=function(_0x17c3aa,_0xc605d7){var _0x4894fe=[];var _0x426f6b=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x17c3aa['params']['id']},'raw':!![]})[_0xe3ca('0x2b')](function(_0x5d61aa){_0x4894fe=_[_0xe3ca('0x40')](_0x5d61aa,function(_0x5e3ae6){return _0x5e3ae6[_0xe3ca('0x66')]===0x1||_['includes']([0x3eb,0x709],_0x5e3ae6[_0xe3ca('0x5b')]);});if(!_[_0xe3ca('0x67')](_0x4894fe)){return _[_0xe3ca('0x31')](_0x4894fe,function(_0x41be9e){return _0x41be9e['sectionId'];});}else{return;}})['then'](function(_0x275571){if(_0x275571)_0x426f6b=_0x275571;if(_[_0xe3ca('0x68')](_0x426f6b,0x64)){var _0x5f3a6a=_[_0xe3ca('0x4e')](_0x4894fe,{'sectionId':0x64});return hasDefaultDashboard(_0x5f3a6a)[_0xe3ca('0x2b')](function(_0x19cae9){return _[_0xe3ca('0x31')](_0x4894fe,function(_0x435e60){if(_0x435e60[_0xe3ca('0x5b')]===0x64){_0x435e60[_0xe3ca('0x69')]=_0x19cae9;}return _0x435e60;});});}else{return;}})['then'](function(_0x999f20){if(_0x999f20)_0x4894fe=_0x999f20;if(_[_0xe3ca('0x68')](_0x426f6b,0x3eb)){var _0x2506e2=_[_0xe3ca('0x4e')](_0x4894fe,{'sectionId':0x3eb});return getCustomDashboards(_0x2506e2)[_0xe3ca('0x2b')](function(_0x5df0ab){return _[_0xe3ca('0x31')](_0x4894fe,function(_0x142d8f){if(_0x2506e2[_0xe3ca('0x66')]){if(_0x142d8f[_0xe3ca('0x5b')]===0x3eb){_0x142d8f[_0xe3ca('0x69')]=_0x5df0ab;}}else{if(_0x142d8f['sectionId']===0x64){_0x142d8f['subsections']=_0x5df0ab;}}return _0x142d8f;});});}else{return;}})[_0xe3ca('0x2b')](function(_0x2355eb){if(_0x2355eb)_0x4894fe=_0x2355eb;if(_[_0xe3ca('0x68')](_0x426f6b,0x709)){var _0x201f1c=_[_0xe3ca('0x4e')](_0x4894fe,{'sectionId':0x709});return getPlugins(_0x201f1c)['then'](function(_0x3b16df){if(_0x201f1c[_0xe3ca('0x66')]){return _[_0xe3ca('0x31')](_0x4894fe,function(_0x38c781){if(_0x38c781['sectionId']===0x709){_0x38c781[_0xe3ca('0x69')]=_0x3b16df;}return _0x38c781;});}else{var _0x2e8213={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3b16df};var _0x54e309=_[_0xe3ca('0x31')](_0x4894fe);_0x54e309[_0xe3ca('0x62')](_0x2e8213);return _0x54e309;}});}else{return;}})[_0xe3ca('0x2b')](function(_0x336998){if(_0x336998)_0x4894fe=_0x336998;return _['filter'](_0x4894fe,[_0xe3ca('0x66'),0x1]);})['then'](respondWithResult(_0xc605d7,null))['catch'](handleError(_0xc605d7,null));};function hasDefaultDashboard(_0x50c76c){var _0x49028b=[0x65];return new BPromise(function(_0x5e7ad3,_0x513ed0){try{if(_0x50c76c[_0xe3ca('0x5a')]){_0x5e7ad3(_0x49028b);}else{return db['UserProfileResource'][_0xe3ca('0x6a')]({'where':{'sectionId':_0x50c76c['id']},'raw':!![]})[_0xe3ca('0x2b')](function(_0x40440f){_0x40440f?_0x5e7ad3(_0x49028b):_0x5e7ad3();});}}catch(_0x43cefb){_0x513ed0(_0x43cefb);}});}function getCustomDashboards(_0x143f7b){var _0xceb789=[];return new BPromise(function(_0x204c41,_0xbc0d72){try{if(_0x143f7b[_0xe3ca('0x5a')]){return db['Dashboard']['findAll']({'raw':!![]})[_0xe3ca('0x2b')](function(_0x4501be){_0x4501be[_0xe3ca('0x6b')](function(_0x5a39cf){_0xceb789[_0xe3ca('0x62')](_0x5a39cf['id']+0x1869f);});_0x204c41(_0xceb789);});}else{return db[_0xe3ca('0x5f')][_0xe3ca('0x46')]({'where':{'sectionId':_0x143f7b['id']},'raw':!![]})[_0xe3ca('0x2b')](function(_0x3f95d0){_0x3f95d0[_0xe3ca('0x6b')](function(_0x4e530d){_0xceb789['push'](_0x4e530d[_0xe3ca('0x6c')]+0x1869f);});_0x204c41(_0xceb789);});}}catch(_0x177603){_0xbc0d72(_0x177603);}});}function getPlugins(_0x33ccf5){var _0x3c9ac7=[];return new BPromise(function(_0x19c3f9,_0x1557f3){try{if(_0x33ccf5[_0xe3ca('0x5a')]){return db['Plugin'][_0xe3ca('0x46')]({'raw':!![]})[_0xe3ca('0x2b')](function(_0x4a3a7b){_0x4a3a7b[_0xe3ca('0x6b')](function(_0x46f019){_0x3c9ac7[_0xe3ca('0x62')](_0x46f019['id']+0x15b38);});_0x19c3f9(_0x3c9ac7);});}else{return db[_0xe3ca('0x5f')][_0xe3ca('0x46')]({'where':{'sectionId':_0x33ccf5['id']},'raw':!![]})['then'](function(_0xb9a39d){_0xb9a39d[_0xe3ca('0x6b')](function(_0x5c54ef){_0x3c9ac7[_0xe3ca('0x62')](_0x5c54ef[_0xe3ca('0x6c')]+0x15b38);});_0x19c3f9(_0x3c9ac7);});}}catch(_0x28e129){_0x1557f3(_0x28e129);}});}exports['addResources']=function(_0xf55308,_0x2919d8){return db[_0xe3ca('0x32')][_0xe3ca('0x4e')]({'where':{'id':_0xf55308[_0xe3ca('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2919d8,null))['then'](function(_0x28390a){if(_0x28390a){return db[_0xe3ca('0x57')][_0xe3ca('0x58')](function(_0x3cefcb){return db[_0xe3ca('0x5e')][_0xe3ca('0x46')]({'where':{'userProfileId':_0xf55308[_0xe3ca('0x4a')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x493929){if(_0x493929){return db['UserProfileSection'][_0xe3ca('0x2c')]({'where':{'userProfileId':_0xf55308[_0xe3ca('0x4a')]['id'],'id':_['map'](_0x493929,function(_0x2a55bb){return _0x2a55bb['id'];})},'transaction':_0x3cefcb});}})[_0xe3ca('0x2b')](function(_0x67cd4f){var _0x29c598=_[_0xe3ca('0x31')](_0xf55308['body'],function(_0x4751e6){_0x4751e6['userProfileId']=_0xf55308[_0xe3ca('0x4a')]['id'];return _0x4751e6;});return db[_0xe3ca('0x5e')][_0xe3ca('0x6d')](_0x29c598,{'raw':!![],'transaction':_0x3cefcb});})[_0xe3ca('0x2b')](function(_0x5acf08){var _0x345a9d=_[_0xe3ca('0x40')](_['map'](_0x5acf08,function(_0x490f44){return _0x490f44['get']({'plain':!![]});}),{'includeAll':![]});if(_0x345a9d){return db['UserProfileSection'][_0xe3ca('0x46')]({'where':{'userProfileId':_0xf55308[_0xe3ca('0x4a')]['id'],'sectionId':_[_0xe3ca('0x31')](_0x345a9d,function(_0xd14213){return _0xd14213[_0xe3ca('0x5b')];})},'attributes':['id',_0xe3ca('0x5b')],'raw':!![]})[_0xe3ca('0x2b')](function(_0x56dd60){var _0x3485d5=_[_0xe3ca('0x31')](_0xf55308[_0xe3ca('0x55')],function(_0x7e75f9){_0x7e75f9[_0xe3ca('0x5c')]=_0xf55308[_0xe3ca('0x4a')]['id'];return _0x7e75f9;});return db[_0xe3ca('0x5f')][_0xe3ca('0x6d')](_0x3485d5,{'raw':!![],'transaction':_0x3cefcb});});}})[_0xe3ca('0x48')](handleError(_0x2919d8,null));});}})[_0xe3ca('0x2b')](function(_0x260f9e){var _0x405ce1=_[_0xe3ca('0x31')](_0x260f9e,function(_0x17f73e){return _0x17f73e['get']({'plain':!![]});});})[_0xe3ca('0x2b')](respondWithResult(_0x2919d8,null))[_0xe3ca('0x48')](handleError(_0x2919d8,null));};exports['removeResources']=function(_0x73ad33,_0x92f8e9,_0x48b673){return db[_0xe3ca('0x32')][_0xe3ca('0x4e')]({'where':{'id':_0x73ad33['params']['id']}})[_0xe3ca('0x2b')](handleEntityNotFound(_0x92f8e9,null))['then'](function(_0x5830df){if(_0x5830df){return _0x5830df[_0xe3ca('0x6e')](_0x73ad33[_0xe3ca('0x35')][_0xe3ca('0x64')]);}})[_0xe3ca('0x2b')](respondWithStatusCode(_0x92f8e9,null))['catch'](handleError(_0x92f8e9,null));};exports['getResources']=function(_0x395be4,_0x58a0ab){var _0x2c13ee={};if(!_0x395be4[_0xe3ca('0x35')][_0xe3ca('0x6f')])throw new Error(_0xe3ca('0x70'));if(!_0x395be4[_0xe3ca('0x35')][_0xe3ca('0x3b')](_0xe3ca('0x3c'))){_0x2c13ee[_0xe3ca('0x24')]=qs[_0xe3ca('0x24')](_0x395be4[_0xe3ca('0x35')][_0xe3ca('0x24')]);_0x2c13ee[_0xe3ca('0x22')]=qs[_0xe3ca('0x22')](_0x395be4[_0xe3ca('0x35')]['offset']);}return db[_0xe3ca('0x32')][_0xe3ca('0x4e')]({'where':{'id':_0x395be4[_0xe3ca('0x4a')]['id']}})[_0xe3ca('0x2b')](function(_0x3444dd){if(!_0x3444dd)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x395be4['params']['id']);return db['UserProfile'][_0xe3ca('0x71')](_0x395be4);})[_0xe3ca('0x2b')](respondWithFilteredResult(_0x58a0ab,_0x2c13ee))[_0xe3ca('0x48')](handleError(_0x58a0ab,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 6f99030..16a2ee7 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 _0xac6a=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','remove'];(function(_0x40f310,_0x33f8ba){var _0x414b2d=function(_0x23aa85){while(--_0x23aa85){_0x40f310['push'](_0x40f310['shift']());}};_0x414b2d(++_0x33f8ba);}(_0xac6a,0xc2));var _0xaac6=function(_0x3809a4,_0x31b0df){_0x3809a4=_0x3809a4-0x0;var _0x715fe8=_0xac6a[_0x3809a4];return _0x715fe8;};'use strict';var EventEmitter=require(_0xaac6('0x0'));var UserProfile=require(_0xaac6('0x1'))['db'][_0xaac6('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xaac6('0x3')](0x0);var events={'afterCreate':_0xaac6('0x4'),'afterUpdate':'update','afterDestroy':_0xaac6('0x5')};function emitEvent(_0x4c0cf4){return function(_0x9dc043,_0x1a0d76,_0x44259b){UserProfileEvents[_0xaac6('0x6')](_0x4c0cf4+':'+_0x9dc043['id'],_0x9dc043);UserProfileEvents[_0xaac6('0x6')](_0x4c0cf4,_0x9dc043);_0x44259b(null);};}for(var e in events){if(events[_0xaac6('0x7')](e)){var event=events[e];UserProfile[_0xaac6('0x8')](e,emitEvent(event));}}module[_0xaac6('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x27a0=['hook','exports','../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x46a920,_0x571299){var _0x32592e=function(_0x3b28bc){while(--_0x3b28bc){_0x46a920['push'](_0x46a920['shift']());}};_0x32592e(++_0x571299);}(_0x27a0,0xbf));var _0x027a=function(_0x518c3b,_0x596ad8){_0x518c3b=_0x518c3b-0x0;var _0x4d9721=_0x27a0[_0x518c3b];return _0x4d9721;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x027a('0x0'))['db'][_0x027a('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x027a('0x2')](0x0);var events={'afterCreate':_0x027a('0x3'),'afterUpdate':_0x027a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x58a58b){return function(_0x4e8d6b,_0x47cd65,_0x30a54d){UserProfileEvents[_0x027a('0x5')](_0x58a58b+':'+_0x4e8d6b['id'],_0x4e8d6b);UserProfileEvents[_0x027a('0x5')](_0x58a58b,_0x4e8d6b);_0x30a54d(null);};}for(var e in events){if(events[_0x027a('0x6')](e)){var event=events[e];UserProfile[_0x027a('0x7')](e,emitEvent(event));}}module[_0x027a('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 5676a48..838ad50 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 _0x3ffd=['VoiceMusicOnHold','chanspies','VoiceChanSpy','Campaign','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','CannedAnswer','dispositions','Disposition','customdashboards','Interval','pauses','Pause','Schedule','sounds','tags','Tag','templates','trunks','Trunk','plugins','AnalyticExtractedReport','metrics','AnalyticMetric','charAt','toUpperCase','slice','SELECT','select','ui.','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','user_profiles','raw','section','mergeResources','length','push','UserProfileSection','find','params','all','isEmpty','ignore','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','default','reportId','DefaultReports','custom','CustomReports','rows','count','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','fax','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','findAll','then','map','catch','value','model','associatedResources','name','resourceId','type','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','User','agent','role','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3ffd,0x7c));var _0xd3ff=function(_0xbc4659,_0x578fba){_0xbc4659=_0xbc4659-0x0;var _0x5831f9=_0x3ffd[_0xbc4659];return _0x5831f9;};'use strict';var _=require('lodash');var attributes=require(_0xd3ff('0x0'));var qs=require(_0xd3ff('0x1'));var squel=require(_0xd3ff('0x2'));module['exports']=function(_0x29457f){var _0x452a5b=_0x29457f[_0xd3ff('0x3')];function _0x3b37af(_0x4e5317,_0x3574b9){return new Promise(function(_0x20770f,_0x2296f7){if(!_0x3574b9)return _0x20770f(null);var _0x169125=_0x3574b9[_0xd3ff('0x4')]?{[_0x3574b9[_0xd3ff('0x4')][_0xd3ff('0x5')]]:_0x3574b9[_0xd3ff('0x4')]['value']}:undefined;return _0x452a5b[_0x4e5317][_0xd3ff('0x6')]({'where':_0x169125,'raw':!![]})[_0xd3ff('0x7')](function(_0x66f38a){_0x3574b9['associatedResources']=_[_0xd3ff('0x8')](_0x66f38a,'id');_0x20770f(_0x3574b9);})[_0xd3ff('0x9')](function(_0x562746){_0x2296f7(_0x562746);});});}function _0x5366c6(_0x51b6c6,_0x2077dd){return new Promise(function(_0x30eaa5,_0x2f3cdd){var _0x32e2c7=_0x51b6c6[_0xd3ff('0x4')]?{[_0x51b6c6['filter']['field']]:_0x51b6c6['filter'][_0xd3ff('0xa')]}:undefined;return _0x452a5b[_0x51b6c6[_0xd3ff('0xb')]][_0xd3ff('0x6')]({'where':_0x32e2c7,'raw':!![]})[_0xd3ff('0x7')](function(_0x21e971){_0x2077dd[_0xd3ff('0xc')]=_[_0xd3ff('0x8')](_0x21e971,function(_0x1bbe9b){return _0x1bbe9b[_0xd3ff('0xd')];});_0x30eaa5(_0x2077dd);})['catch'](function(_0x4d9404){_0x2f3cdd(_0x4d9404);});});}function _0x23a177(_0x1f9564,_0x201f50,_0x1db0fd){if(!_0x201f50)return Promise['resolve'](null);return new Promise(function(_0x16c59f,_0x43fefe){return _0x452a5b['UserProfileResource'][_0xd3ff('0x6')]({'where':{'sectionId':_0x201f50['id']},'raw':!![]})['then'](function(_0x4bcf16){if(_0x1f9564[_0xd3ff('0x5')]&&_0x1f9564[_0xd3ff('0x5')]!=='id'){_0x201f50[_0xd3ff('0xc')]=_[_0xd3ff('0x8')](_0x4bcf16,function(_0x51d0a5){return _0x51d0a5[_0x1f9564['field']];});}else{if(_0x1db0fd==='AnalyticExtractedReport'){_0x201f50[_0xd3ff('0xc')]=_[_0xd3ff('0x8')](_0x4bcf16,function(_0x50de82){return{'id':_0x50de82[_0xd3ff('0xe')],'type':_0x50de82[_0xd3ff('0xf')]};});}else{_0x201f50[_0xd3ff('0xc')]=_['map'](_0x4bcf16,function(_0x18ce3e){return _0x18ce3e[_0xd3ff('0xe')];});}}_0x16c59f(_0x201f50);})[_0xd3ff('0x9')](function(_0x39e2a5){_0x43fefe(_0x39e2a5);});});}function _0x170f8c(_0x5663ee,_0x2e0614){var _0x5e0eee={'parentSections':[]};switch(_0x5663ee[_0xd3ff('0x10')]()){case _0xd3ff('0x11'):_0x5e0eee['childModel']=_0xd3ff('0x12');break;case _0xd3ff('0x13'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x15');break;case _0xd3ff('0x16'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x17');_0x5e0eee[_0xd3ff('0x18')]=[{'name':_0xd3ff('0x19'),'field':_0xd3ff('0xd'),'foreignKey':_0xd3ff('0x1a')}];break;case _0xd3ff('0x1b'):_0x5e0eee['childModel']=_0xd3ff('0x1c');break;case _0xd3ff('0x1d'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x1e');_0x5e0eee['parentSections']=[{'name':_0xd3ff('0x1f'),'field':'id','foreignKey':_0xd3ff('0x20')}];break;case'lists':_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x21');break;case'companies':_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x22');break;case _0xd3ff('0x23'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x24');break;case _0xd3ff('0x25'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x26');break;case _0xd3ff('0x27'):_0x5e0eee['childModel']=_0xd3ff('0x28');break;case _0xd3ff('0x29'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x2a');break;case _0xd3ff('0x2b'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x2c');break;case _0xd3ff('0x2d'):case _0xd3ff('0x2e'):case'outboundroutes':_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x2f');break;case'contexts':_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x30');break;case _0xd3ff('0x31'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x32');break;case'voicerecordings':_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x33');_0x5e0eee['parentSections']=[{'name':_0xd3ff('0x34'),'field':_0xd3ff('0xd'),'foreignKey':_0xd3ff('0x35'),'model':_0xd3ff('0x36'),'filter':{'field':'role','value':[_0xd3ff('0x37')]}},{'name':'Telephones','field':'name','foreignKey':'membername','model':'User','filter':{'field':_0xd3ff('0x38'),'value':[_0xd3ff('0x39')]}},{'name':_0xd3ff('0x3a'),'field':_0xd3ff('0xd'),'foreignKey':'queue','model':_0xd3ff('0x3b'),'filter':{'field':_0xd3ff('0xf'),'value':[_0xd3ff('0x3c')]}},{'name':_0xd3ff('0x3d'),'field':_0xd3ff('0xd'),'foreignKey':_0xd3ff('0x3e'),'model':'VoiceQueue','filter':{'field':'type','value':[_0xd3ff('0x3f')]}}];break;case _0xd3ff('0x40'):_0x5e0eee['childModel']=_0xd3ff('0x41');break;case _0xd3ff('0x42'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x43');break;case'voiceprefixes':_0x5e0eee[_0xd3ff('0x14')]='VoicePrefix';break;case'ivrcampaigns':_0x5e0eee['childModel']=_0xd3ff('0x44');break;case'mailqueues':_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x45');break;case _0xd3ff('0x46'):_0x5e0eee['childModel']=_0xd3ff('0x47');break;case'mailsubstatuses':_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x48');break;case _0xd3ff('0x49'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x4a');break;case _0xd3ff('0x4b'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x4c');break;case _0xd3ff('0x4d'):_0x5e0eee['childModel']=_0xd3ff('0x4e');break;case _0xd3ff('0x4f'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x50');break;case _0xd3ff('0x51'):_0x5e0eee[_0xd3ff('0x14')]='WhatsappQueue';break;case _0xd3ff('0x52'):_0x5e0eee[_0xd3ff('0x14')]='WhatsappAccount';break;case _0xd3ff('0x53'):_0x5e0eee['childModel']=_0xd3ff('0x54');break;case _0xd3ff('0x55'):case _0xd3ff('0x56'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x3b');if(_0x2e0614){_0x5e0eee[_0xd3ff('0x18')]=[{'name':_0xd3ff('0x3a')},{'name':_0xd3ff('0x3d')}];}break;case _0xd3ff('0x57'):case _0xd3ff('0x58'):case _0xd3ff('0x59'):_0x5e0eee[_0xd3ff('0x14')]='User';if(_0x2e0614){_0x5e0eee[_0xd3ff('0x18')]=[{'name':_0xd3ff('0x5a'),'filter':{'field':_0xd3ff('0x38'),'value':[_0xd3ff('0x5b'),_0xd3ff('0x5c')]},'ignore':!![]},{'name':_0xd3ff('0x34')},{'name':'Telephones'}];}break;case _0xd3ff('0x5d'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x5e');break;case _0xd3ff('0x5f'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x60');break;case _0xd3ff('0x61'):_0x5e0eee[_0xd3ff('0x14')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x5e0eee['childModel']=_0xd3ff('0x62');break;case _0xd3ff('0x63'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x64');break;case _0xd3ff('0x65'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x66');break;case'vtigeraccounts':_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x36');break;case'cannedanswers':_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x67');break;case _0xd3ff('0x68'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x69');break;case _0xd3ff('0x6a'):_0x5e0eee['childModel']='Dashboard';break;case'intervals':_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x6b');break;case _0xd3ff('0x6c'):_0x5e0eee['childModel']=_0xd3ff('0x6d');break;case'scheduler':_0x5e0eee['childModel']=_0xd3ff('0x6e');break;case _0xd3ff('0x6f'):_0x5e0eee[_0xd3ff('0x14')]='Sound';break;case _0xd3ff('0x70'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x71');break;case _0xd3ff('0x72'):_0x5e0eee[_0xd3ff('0x14')]='Template';break;case'triggers':_0x5e0eee[_0xd3ff('0x14')]='Trigger';break;case _0xd3ff('0x73'):_0x5e0eee['childModel']=_0xd3ff('0x74');break;case'variables':_0x5e0eee[_0xd3ff('0x14')]='Variable';break;case _0xd3ff('0x75'):_0x5e0eee['childModel']='Plugin';break;case'extractedreports':_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x76');_0x5e0eee[_0xd3ff('0x18')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0xd3ff('0x77'):_0x5e0eee[_0xd3ff('0x14')]=_0xd3ff('0x78');break;}return _0x5e0eee;}function _0x47c5d6(_0x5c22e3,_0x5df75f){var _0x4b4b07=_0x5c22e3[_0xd3ff('0x79')](0x0)[_0xd3ff('0x7a')]()+_0x5c22e3[_0xd3ff('0x7b')](0x1);var _0x5e6c6f={'type':_0x452a5b['Sequelize']['QueryTypes'][_0xd3ff('0x7c')],'raw':!![]};return new Promise(function(_0x349a6a,_0x4058db){var _0x250b44=squel[_0xd3ff('0x7d')]()[_0xd3ff('0x5')](_0xd3ff('0x7e')+_0x4b4b07+'InteractionId','id')[_0xd3ff('0x5')](_0xd3ff('0x7f'))[_0xd3ff('0x80')](_0xd3ff('0x81')+_0x5c22e3+_0xd3ff('0x82'),'ui')[_0xd3ff('0x83')]('ui.UserId\x20=\x20?',_0x5df75f['id']);return _0x452a5b[_0xd3ff('0x84')][_0xd3ff('0x85')](_0x250b44[_0xd3ff('0x86')](),_0x5e6c6f)[_0xd3ff('0x7')](function(_0x481510){_0x5df75f[_0x4b4b07+_0xd3ff('0x87')]=_0x481510;_0x349a6a(_0x481510);})[_0xd3ff('0x9')](function(_0x417673){_0x4058db(_0x417673);});});}return _0x29457f[_0xd3ff('0x88')]('UserProfile',attributes,{'tableName':_0xd3ff('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x121f0b){var _0x42d2dd={'raw':_0x121f0b['query'][_0xd3ff('0x8a')],'where':{}};var _0x54b4b3={};var _0x1bd3f8={'count':0x0,'rows':[]};var _0x1bd98f=_0x121f0b[_0xd3ff('0x85')][_0xd3ff('0x8b')];var _0x49ff67=_0x121f0b['query'][_0xd3ff('0x8c')]||![];var _0x3c0e64=_0x170f8c(_0x1bd98f,_0x49ff67);if(!_0x3c0e64[_0xd3ff('0x14')])throw new Error('Invalid\x20section\x20\x27'+_0x1bd98f+'\x27');var _0x1ae3a0=[{'name':_0x1bd98f}];if(!_['isEmpty'](_0x3c0e64[_0xd3ff('0x18')]))_0x1ae3a0=_0x3c0e64[_0xd3ff('0x18')];var _0x151a18=[];for(var _0x274044=0x0;_0x274044<_0x1ae3a0[_0xd3ff('0x8d')];_0x274044++){_0x151a18[_0xd3ff('0x8e')](_0x452a5b[_0xd3ff('0x8f')][_0xd3ff('0x90')]({'where':{'userProfileId':_0x121f0b[_0xd3ff('0x91')]['id'],'name':_0x1ae3a0[_0x274044]['name']},'raw':!![]}));}return Promise[_0xd3ff('0x92')](_0x151a18)[_0xd3ff('0x7')](function(_0x1b6b4f){var _0x4adcce=_[_0xd3ff('0x4')](_0x1b6b4f,function(_0x4acc10){return _0x4acc10?_0x4acc10:undefined;});var _0x562e41=_[_0xd3ff('0x4')](_0x1ae3a0,['ignore',!![]]);var _0x53bc25=_[_0xd3ff('0x93')](_0x4adcce)&&_[_0xd3ff('0x93')](_0x562e41)?null:_['union'](_0x562e41,_0x4adcce);if(!_0x53bc25)return null;var _0x33a7da=[];for(var _0x3b2d44=0x0;_0x3b2d44<_0x53bc25['length'];_0x3b2d44++){var _0x158e53=_[_0xd3ff('0x90')](_0x1ae3a0,function(_0x3c241f){return _0x53bc25[_0x3b2d44]?_0x3c241f['name']===_0x53bc25[_0x3b2d44][_0xd3ff('0xd')]:null;});if(_0x158e53){if(_0x53bc25[_0x3b2d44][_0xd3ff('0x94')]){_0x33a7da[_0xd3ff('0x8e')](_0x3b37af(_0x3c0e64[_0xd3ff('0x14')],_0x53bc25[_0x3b2d44]));}else{if(!_0x53bc25[_0x3b2d44]['autoAssociation']){_0x33a7da[_0xd3ff('0x8e')](_0x23a177(_0x158e53,_0x53bc25[_0x3b2d44],_0x3c0e64[_0xd3ff('0x14')]));}else{if(_0x158e53[_0xd3ff('0xb')]){_0x33a7da[_0xd3ff('0x8e')](_0x5366c6(_0x158e53,_0x53bc25[_0x3b2d44]));}}}}}return Promise[_0xd3ff('0x92')](_0x33a7da);})[_0xd3ff('0x7')](function(_0x4f2e36){var _0x40f325=_0x4f2e36;var _0x352bb6=null;if(_0x40f325){_0x352bb6=_0x40f325[_0xd3ff('0x8d')]===0x1?_0x40f325[0x0]:null;}if(!_0x352bb6&&!_0x40f325)return _0x1bd3f8;var _0x2e430c=_0x452a5b[_0x3c0e64[_0xd3ff('0x14')]][_0xd3ff('0x95')];_0x54b4b3[_0xd3ff('0xb')]=_['keys'](_0x2e430c);_0x54b4b3[_0xd3ff('0x85')]=_[_0xd3ff('0x96')](_0x121f0b['query']);_0x54b4b3[_0xd3ff('0x97')]=_[_0xd3ff('0x98')](_0x54b4b3[_0xd3ff('0xb')],_0x54b4b3[_0xd3ff('0x85')]);_0x42d2dd[_0xd3ff('0x99')]=_[_0xd3ff('0x98')](_0x54b4b3['model'],qs['fields'](_0x121f0b[_0xd3ff('0x85')][_0xd3ff('0x9a')]));_0x42d2dd[_0xd3ff('0x99')]=_0x42d2dd[_0xd3ff('0x99')][_0xd3ff('0x8d')]?_0x42d2dd[_0xd3ff('0x99')]:_0x54b4b3[_0xd3ff('0xb')];if(!_0x121f0b[_0xd3ff('0x85')][_0xd3ff('0x9b')](_0xd3ff('0x9c'))){_0x42d2dd['limit']=qs[_0xd3ff('0x9d')](_0x121f0b[_0xd3ff('0x85')]['limit']);_0x42d2dd['offset']=qs[_0xd3ff('0x9e')](_0x121f0b['query'][_0xd3ff('0x9e')]);}_0x42d2dd[_0xd3ff('0x9f')]=qs[_0xd3ff('0xa0')](_0x121f0b[_0xd3ff('0x85')]['sort']);_0x42d2dd[_0xd3ff('0x83')]=qs['filters'](_[_0xd3ff('0xa1')](_0x121f0b[_0xd3ff('0x85')],_0x54b4b3['filters']));if(_0x121f0b[_0xd3ff('0x85')][_0xd3ff('0x4')]){_0x42d2dd[_0xd3ff('0x83')]=_[_0xd3ff('0xa2')](_0x42d2dd['where'],{'$or':_[_0xd3ff('0x8')](_0x2e430c,function(_0x518522){if(_0x518522[_0xd3ff('0xf')][_0xd3ff('0xa3')]!=='VIRTUAL'){var _0x417e51={};_0x417e51[_0x518522['field']]={'$like':'%'+_0x121f0b[_0xd3ff('0x85')][_0xd3ff('0x4')]+'%'};return _0x417e51;}})});}var _0x8dbfbe=[];var _0x3c1b09=null;var _0x1098a9={};if(_0x352bb6){_0x3c1b09=_[_0xd3ff('0x90')](_0x1ae3a0,[_0xd3ff('0xd'),_0x352bb6[_0xd3ff('0xd')]]);if(_0x3c1b09['field']){_0x1098a9={};if(_0x3c0e64[_0xd3ff('0x14')]==='AnalyticExtractedReport'){_0x1098a9[_0x3c1b09['foreignKey']]=_[_0xd3ff('0x8')](_0x352bb6[_0xd3ff('0xc')],'id');}else{_0x1098a9[_0x3c1b09['foreignKey']]=_0x352bb6[_0xd3ff('0xc')];}_0x8dbfbe[_0xd3ff('0x8e')](_0x1098a9);}else{_0x42d2dd[_0xd3ff('0x83')]['id']=_0x352bb6[_0xd3ff('0xc')];}}else{for(var _0x50c3bc=0x0;_0x50c3bc<_0x40f325['length'];_0x50c3bc++){_0x3c1b09=_[_0xd3ff('0x90')](_0x1ae3a0,[_0xd3ff('0xd'),_0x40f325[_0x50c3bc]['name']]);if(_0x3c1b09[_0xd3ff('0x5')]){_0x1098a9={};_0x1098a9[_0x3c1b09[_0xd3ff('0xa4')]]=_0x40f325[_0x50c3bc]['associatedResources'];_0x8dbfbe[_0xd3ff('0x8e')](_0x1098a9);}else{if(!_0x42d2dd['where']['id'])_0x42d2dd['where']['id']=[];_0x40f325[_0x50c3bc][_0xd3ff('0xc')][_0xd3ff('0xa5')](function(_0x37ead8){_0x42d2dd[_0xd3ff('0x83')]['id'][_0xd3ff('0x8e')](_0x37ead8);});}}}if(!_['isEmpty'](_0x8dbfbe)){_0x42d2dd[_0xd3ff('0x83')]=_[_0xd3ff('0xa2')](_0x42d2dd[_0xd3ff('0x83')],{'$and':{'$or':_0x8dbfbe}});}_0x42d2dd=_[_0xd3ff('0xa2')]({},_0x42d2dd,_0x121f0b[_0xd3ff('0xa6')]);if(_0x352bb6&&!_0x352bb6[_0xd3ff('0xa7')]&&_0x3c0e64['childModel']===_0xd3ff('0x76')){if(_0x121f0b[_0xd3ff('0x85')][_0xd3ff('0xa8')]){_0x42d2dd[_0xd3ff('0xa9')]=[{'all':!![]}];}return _0x452a5b[_0x3c0e64[_0xd3ff('0x14')]][_0xd3ff('0x6')](_0x42d2dd)[_0xd3ff('0x7')](function(_0x1ec74a){var _0x2a8d1c=[];_0x1ec74a[_0xd3ff('0xa5')](function(_0x3188a1){var _0x209575;switch(_0x3188a1[_0xd3ff('0xaa')]){case _0xd3ff('0xab'):_0x209575=_[_0xd3ff('0x90')](_0x352bb6[_0xd3ff('0xc')],function(_0x50a0c8){return _0x50a0c8['id']===_0x3188a1[_0xd3ff('0xac')]&&_0x50a0c8['type']===_0xd3ff('0xad');});break;case _0xd3ff('0xae'):_0x209575=_[_0xd3ff('0x90')](_0x352bb6[_0xd3ff('0xc')],function(_0x224df4){return _0x224df4['id']===_0x3188a1[_0xd3ff('0xac')]&&_0x224df4['type']===_0xd3ff('0xaf');});break;}if(_0x209575)_0x2a8d1c[_0xd3ff('0x8e')](_0x3188a1);});_0x1bd3f8['count']=_0x2a8d1c[_0xd3ff('0x8d')];_0x1bd3f8[_0xd3ff('0xb0')]=_0x2a8d1c;return _0x1bd3f8;});}else{return _0x452a5b[_0x3c0e64[_0xd3ff('0x14')]]['count']({'where':_0x42d2dd[_0xd3ff('0x83')]})[_0xd3ff('0x7')](function(_0x480657){_0x1bd3f8[_0xd3ff('0xb1')]=_0x480657;if(_0x121f0b[_0xd3ff('0x85')][_0xd3ff('0xa8')]){if(_0x3c0e64['childModel']==='CmContact'){_0x42d2dd[_0xd3ff('0xa9')]=[{'model':_0x452a5b['Tag'],'as':_0xd3ff('0xb2'),'attributes':['id',_0xd3ff('0xd'),_0xd3ff('0xb3')],'required':_0x121f0b[_0xd3ff('0x85')][_0xd3ff('0xb4')]?!![]:![]},{'model':_0x452a5b[_0xd3ff('0x71')],'as':_0xd3ff('0xb5'),'attributes':['id',_0xd3ff('0xd'),_0xd3ff('0xb3')],'through':_0x121f0b['query']['tag']?{'attributes':[],'where':{'TagId':_0x121f0b['query'][_0xd3ff('0xb4')]||undefined}}:{},'required':_0x121f0b[_0xd3ff('0x85')]['tag']?!![]:![]}];}else{_0x42d2dd[_0xd3ff('0xa9')]=[{'all':!![]}];}}return _0x452a5b[_0x3c0e64[_0xd3ff('0x14')]][_0xd3ff('0x6')](_0x42d2dd);})['then'](function(_0x46d513){_0x1bd3f8[_0xd3ff('0xb0')]=_0x46d513;if(_0x1bd98f===_0xd3ff('0x34')&&_0x121f0b['query'][_0xd3ff('0xb6')]===_0xd3ff('0xb7')){var _0x26d58d=[];for(var _0x1602a4=0x0;_0x1602a4<_0x1bd3f8[_0xd3ff('0xb0')][_0xd3ff('0x8d')];_0x1602a4++){_0x26d58d['push'](_0x47c5d6(_0xd3ff('0xb8'),_0x1bd3f8['rows'][_0x1602a4][_0xd3ff('0xb9')]));_0x26d58d['push'](_0x47c5d6('sms',_0x1bd3f8[_0xd3ff('0xb0')][_0x1602a4][_0xd3ff('0xb9')]));_0x26d58d[_0xd3ff('0x8e')](_0x47c5d6(_0xd3ff('0xba'),_0x1bd3f8[_0xd3ff('0xb0')][_0x1602a4][_0xd3ff('0xb9')]));_0x26d58d[_0xd3ff('0x8e')](_0x47c5d6('mail',_0x1bd3f8[_0xd3ff('0xb0')][_0x1602a4][_0xd3ff('0xb9')]));_0x26d58d['push'](_0x47c5d6(_0xd3ff('0xbb'),_0x1bd3f8['rows'][_0x1602a4]['dataValues']));_0x26d58d[_0xd3ff('0x8e')](_0x47c5d6(_0xd3ff('0xbc'),_0x1bd3f8['rows'][_0x1602a4][_0xd3ff('0xb9')]));}return Promise['all'](_0x26d58d)[_0xd3ff('0x7')](function(){return _0x1bd3f8;});}return _0x1bd3f8;});}});}}});}; \ No newline at end of file +var _0x1347=['companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','Users','user','zendeskaccounts','ZendeskAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','templates','Template','triggers','Trigger','trunks','Trunk','plugins','Reports','reportId','metrics','charAt','toUpperCase','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile','user_profiles','raw','section','mergeResources','length','push','UserProfileSection','isEmpty','union','find','ignore','autoAssociation','rawAttributes','keys','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','merge','foreignKey','forEach','options','includeAll','reportType','default','custom','CustomReports','rows','count','include','Tag','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','lodash','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','catch','model','map','name','resolve','AnalyticExtractedReport','resourceId','type','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','JscriptyProject','CmContact','Lists','ListId','lists','CmList'];(function(_0x26f603,_0x1f8732){var _0x273ed5=function(_0x1acfd8){while(--_0x1acfd8){_0x26f603['push'](_0x26f603['shift']());}};_0x273ed5(++_0x1f8732);}(_0x1347,0x9b));var _0x7134=function(_0xe45b6d,_0x443cac){_0xe45b6d=_0xe45b6d-0x0;var _0x4d6f47=_0x1347[_0xe45b6d];return _0x4d6f47;};'use strict';var _=require(_0x7134('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x7134('0x1'));var squel=require(_0x7134('0x2'));module[_0x7134('0x3')]=function(_0x3a30d3){var _0x32fc58=_0x3a30d3[_0x7134('0x4')];function _0x2eb6e1(_0x2cc803,_0x44cc42){return new Promise(function(_0x766943,_0x31675c){if(!_0x44cc42)return _0x766943(null);var _0x17858b=_0x44cc42[_0x7134('0x5')]?{[_0x44cc42['filter'][_0x7134('0x6')]]:_0x44cc42[_0x7134('0x5')][_0x7134('0x7')]}:undefined;return _0x32fc58[_0x2cc803][_0x7134('0x8')]({'where':_0x17858b,'raw':!![]})[_0x7134('0x9')](function(_0x3ae98d){_0x44cc42[_0x7134('0xa')]=_['map'](_0x3ae98d,'id');_0x766943(_0x44cc42);})[_0x7134('0xb')](function(_0x43db04){_0x31675c(_0x43db04);});});}function _0x24afc7(_0xd32127,_0x2e75c6){return new Promise(function(_0x4a92b6,_0x567b40){var _0x2ab3e5=_0xd32127['filter']?{[_0xd32127['filter'][_0x7134('0x6')]]:_0xd32127[_0x7134('0x5')][_0x7134('0x7')]}:undefined;return _0x32fc58[_0xd32127[_0x7134('0xc')]][_0x7134('0x8')]({'where':_0x2ab3e5,'raw':!![]})[_0x7134('0x9')](function(_0x51dff2){_0x2e75c6['associatedResources']=_[_0x7134('0xd')](_0x51dff2,function(_0x1f36f6){return _0x1f36f6[_0x7134('0xe')];});_0x4a92b6(_0x2e75c6);})['catch'](function(_0x1a5e04){_0x567b40(_0x1a5e04);});});}function _0x3f6508(_0x582290,_0x83e812,_0x342f8c){if(!_0x83e812)return Promise[_0x7134('0xf')](null);return new Promise(function(_0x52b1d6,_0x38bb53){return _0x32fc58['UserProfileResource'][_0x7134('0x8')]({'where':{'sectionId':_0x83e812['id']},'raw':!![]})[_0x7134('0x9')](function(_0x5d81d3){if(_0x582290[_0x7134('0x6')]&&_0x582290[_0x7134('0x6')]!=='id'){_0x83e812[_0x7134('0xa')]=_[_0x7134('0xd')](_0x5d81d3,function(_0x5016e4){return _0x5016e4[_0x582290['field']];});}else{if(_0x342f8c===_0x7134('0x10')){_0x83e812[_0x7134('0xa')]=_[_0x7134('0xd')](_0x5d81d3,function(_0x224a26){return{'id':_0x224a26[_0x7134('0x11')],'type':_0x224a26[_0x7134('0x12')]};});}else{_0x83e812['associatedResources']=_[_0x7134('0xd')](_0x5d81d3,function(_0x159758){return _0x159758[_0x7134('0x11')];});}}_0x52b1d6(_0x83e812);})[_0x7134('0xb')](function(_0x531a99){_0x38bb53(_0x531a99);});});}function _0x469099(_0x30960a,_0x4f7997){var _0x266402={'parentSections':[]};switch(_0x30960a['toLowerCase']()){case'squareprojects':_0x266402[_0x7134('0x13')]=_0x7134('0x14');break;case _0x7134('0x15'):_0x266402[_0x7134('0x13')]=_0x7134('0x16');break;case _0x7134('0x17'):_0x266402[_0x7134('0x13')]=_0x7134('0x18');_0x266402[_0x7134('0x19')]=[{'name':_0x7134('0x1a'),'field':'name','foreignKey':_0x7134('0x1b')}];break;case'projects':_0x266402['childModel']=_0x7134('0x1c');break;case'contacts':_0x266402[_0x7134('0x13')]=_0x7134('0x1d');_0x266402[_0x7134('0x19')]=[{'name':_0x7134('0x1e'),'field':'id','foreignKey':_0x7134('0x1f')}];break;case _0x7134('0x20'):_0x266402[_0x7134('0x13')]=_0x7134('0x21');break;case _0x7134('0x22'):_0x266402['childModel']=_0x7134('0x23');break;case _0x7134('0x24'):_0x266402[_0x7134('0x13')]=_0x7134('0x25');break;case _0x7134('0x26'):_0x266402[_0x7134('0x13')]=_0x7134('0x27');break;case'chatwebsites':_0x266402[_0x7134('0x13')]=_0x7134('0x28');break;case _0x7134('0x29'):_0x266402[_0x7134('0x13')]=_0x7134('0x2a');break;case _0x7134('0x2b'):_0x266402[_0x7134('0x13')]=_0x7134('0x2c');break;case _0x7134('0x2d'):case'internalroutes':case _0x7134('0x2e'):_0x266402['childModel']='VoiceExtension';break;case _0x7134('0x2f'):_0x266402[_0x7134('0x13')]=_0x7134('0x30');break;case _0x7134('0x31'):_0x266402[_0x7134('0x13')]=_0x7134('0x32');break;case'voicerecordings':_0x266402[_0x7134('0x13')]='VoiceRecording';_0x266402[_0x7134('0x19')]=[{'name':_0x7134('0x33'),'field':_0x7134('0xe'),'foreignKey':_0x7134('0x34'),'model':_0x7134('0x35'),'filter':{'field':_0x7134('0x36'),'value':[_0x7134('0x37')]}},{'name':_0x7134('0x38'),'field':'name','foreignKey':_0x7134('0x34'),'model':_0x7134('0x35'),'filter':{'field':_0x7134('0x36'),'value':[_0x7134('0x39')]}},{'name':_0x7134('0x3a'),'field':_0x7134('0xe'),'foreignKey':_0x7134('0x3b'),'model':_0x7134('0x3c'),'filter':{'field':_0x7134('0x12'),'value':['inbound']}},{'name':_0x7134('0x3d'),'field':_0x7134('0xe'),'foreignKey':_0x7134('0x3b'),'model':_0x7134('0x3c'),'filter':{'field':'type','value':[_0x7134('0x3e')]}}];break;case _0x7134('0x3f'):_0x266402['childModel']=_0x7134('0x40');break;case'chanspies':_0x266402[_0x7134('0x13')]=_0x7134('0x41');break;case _0x7134('0x42'):_0x266402[_0x7134('0x13')]=_0x7134('0x43');break;case _0x7134('0x44'):_0x266402[_0x7134('0x13')]=_0x7134('0x45');break;case _0x7134('0x46'):_0x266402['childModel']=_0x7134('0x47');break;case _0x7134('0x48'):_0x266402[_0x7134('0x13')]=_0x7134('0x49');break;case _0x7134('0x4a'):_0x266402[_0x7134('0x13')]=_0x7134('0x4b');break;case'openchannelqueues':_0x266402[_0x7134('0x13')]=_0x7134('0x4c');break;case _0x7134('0x4d'):_0x266402[_0x7134('0x13')]=_0x7134('0x4e');break;case _0x7134('0x4f'):_0x266402[_0x7134('0x13')]=_0x7134('0x50');break;case'smsaccounts':_0x266402['childModel']=_0x7134('0x51');break;case _0x7134('0x52'):_0x266402[_0x7134('0x13')]='WhatsappQueue';break;case _0x7134('0x53'):_0x266402['childModel']=_0x7134('0x54');break;case _0x7134('0x55'):_0x266402[_0x7134('0x13')]=_0x7134('0x56');break;case _0x7134('0x57'):case _0x7134('0x58'):_0x266402[_0x7134('0x13')]=_0x7134('0x3c');if(_0x4f7997){_0x266402[_0x7134('0x19')]=[{'name':'VoiceQueues'},{'name':_0x7134('0x3d')}];}break;case'users':case'agents':case'telephones':_0x266402[_0x7134('0x13')]='User';if(_0x4f7997){_0x266402[_0x7134('0x19')]=[{'name':_0x7134('0x59'),'filter':{'field':_0x7134('0x36'),'value':['admin',_0x7134('0x5a')]},'ignore':!![]},{'name':_0x7134('0x33')},{'name':_0x7134('0x38')}];}break;case _0x7134('0x5b'):_0x266402[_0x7134('0x13')]=_0x7134('0x5c');break;case'salesforceaccounts':_0x266402[_0x7134('0x13')]='SalesforceAccount';break;case _0x7134('0x5d'):_0x266402[_0x7134('0x13')]='FreshdeskAccount';break;case _0x7134('0x5e'):_0x266402[_0x7134('0x13')]=_0x7134('0x5f');break;case _0x7134('0x60'):_0x266402[_0x7134('0x13')]=_0x7134('0x61');break;case'zohoaccounts':_0x266402[_0x7134('0x13')]=_0x7134('0x62');break;case'vtigeraccounts':_0x266402[_0x7134('0x13')]='User';break;case _0x7134('0x63'):_0x266402[_0x7134('0x13')]=_0x7134('0x64');break;case _0x7134('0x65'):_0x266402['childModel']=_0x7134('0x66');break;case'customdashboards':_0x266402['childModel']='Dashboard';break;case _0x7134('0x67'):_0x266402[_0x7134('0x13')]=_0x7134('0x68');break;case _0x7134('0x69'):_0x266402[_0x7134('0x13')]=_0x7134('0x6a');break;case'scheduler':_0x266402[_0x7134('0x13')]=_0x7134('0x6b');break;case _0x7134('0x6c'):_0x266402[_0x7134('0x13')]=_0x7134('0x6d');break;case'tags':_0x266402[_0x7134('0x13')]='Tag';break;case _0x7134('0x6e'):_0x266402['childModel']=_0x7134('0x6f');break;case _0x7134('0x70'):_0x266402['childModel']=_0x7134('0x71');break;case _0x7134('0x72'):_0x266402['childModel']=_0x7134('0x73');break;case'variables':_0x266402[_0x7134('0x13')]='Variable';break;case _0x7134('0x74'):_0x266402[_0x7134('0x13')]='Plugin';break;case'extractedreports':_0x266402[_0x7134('0x13')]='AnalyticExtractedReport';_0x266402[_0x7134('0x19')]=[{'name':_0x7134('0x75'),'field':'id','foreignKey':_0x7134('0x76')}];break;case _0x7134('0x77'):_0x266402[_0x7134('0x13')]='AnalyticMetric';break;}return _0x266402;}function _0x2c777a(_0x486d65,_0x527b63){var _0xecdc42=_0x486d65[_0x7134('0x78')](0x0)[_0x7134('0x79')]()+_0x486d65['slice'](0x1);var _0x17fc14={'type':_0x32fc58[_0x7134('0x7a')][_0x7134('0x7b')]['SELECT'],'raw':!![]};return new Promise(function(_0x55a52b,_0x477a7d){var _0x171b5c=squel[_0x7134('0x7c')]()[_0x7134('0x6')](_0x7134('0x7d')+_0xecdc42+_0x7134('0x7e'),'id')['field'](_0x7134('0x7f'))[_0x7134('0x80')](_0x7134('0x81')+_0x486d65+_0x7134('0x82'),'ui')[_0x7134('0x83')](_0x7134('0x84'),_0x527b63['id']);return _0x32fc58[_0x7134('0x85')][_0x7134('0x86')](_0x171b5c[_0x7134('0x87')](),_0x17fc14)['then'](function(_0x35954b){_0x527b63[_0xecdc42+'OpenTabs']=_0x35954b;_0x55a52b(_0x35954b);})[_0x7134('0xb')](function(_0x17ffa6){_0x477a7d(_0x17ffa6);});});}return _0x3a30d3[_0x7134('0x88')](_0x7134('0x89'),attributes,{'tableName':_0x7134('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x5d1f6c){var _0x5735c3={'raw':_0x5d1f6c[_0x7134('0x86')][_0x7134('0x8b')],'where':{}};var _0x4f90b8={};var _0x888e4d={'count':0x0,'rows':[]};var _0x5e9a2c=_0x5d1f6c[_0x7134('0x86')][_0x7134('0x8c')];var _0x34c1a=_0x5d1f6c[_0x7134('0x86')][_0x7134('0x8d')]||![];var _0x4be9fd=_0x469099(_0x5e9a2c,_0x34c1a);if(!_0x4be9fd[_0x7134('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x5e9a2c+'\x27');var _0x2cd0e1=[{'name':_0x5e9a2c}];if(!_['isEmpty'](_0x4be9fd[_0x7134('0x19')]))_0x2cd0e1=_0x4be9fd[_0x7134('0x19')];var _0x54835e=[];for(var _0x1b0a03=0x0;_0x1b0a03<_0x2cd0e1[_0x7134('0x8e')];_0x1b0a03++){_0x54835e[_0x7134('0x8f')](_0x32fc58[_0x7134('0x90')]['find']({'where':{'userProfileId':_0x5d1f6c['params']['id'],'name':_0x2cd0e1[_0x1b0a03][_0x7134('0xe')]},'raw':!![]}));}return Promise['all'](_0x54835e)[_0x7134('0x9')](function(_0x1d8216){var _0x410f29=_[_0x7134('0x5')](_0x1d8216,function(_0x46d807){return _0x46d807?_0x46d807:undefined;});var _0x15bfcc=_['filter'](_0x2cd0e1,['ignore',!![]]);var _0x4f6830=_[_0x7134('0x91')](_0x410f29)&&_['isEmpty'](_0x15bfcc)?null:_[_0x7134('0x92')](_0x15bfcc,_0x410f29);if(!_0x4f6830)return null;var _0x53da52=[];for(var _0x1b2f49=0x0;_0x1b2f49<_0x4f6830[_0x7134('0x8e')];_0x1b2f49++){var _0x1baf74=_[_0x7134('0x93')](_0x2cd0e1,function(_0x30edb8){return _0x4f6830[_0x1b2f49]?_0x30edb8[_0x7134('0xe')]===_0x4f6830[_0x1b2f49]['name']:null;});if(_0x1baf74){if(_0x4f6830[_0x1b2f49][_0x7134('0x94')]){_0x53da52[_0x7134('0x8f')](_0x2eb6e1(_0x4be9fd[_0x7134('0x13')],_0x4f6830[_0x1b2f49]));}else{if(!_0x4f6830[_0x1b2f49][_0x7134('0x95')]){_0x53da52[_0x7134('0x8f')](_0x3f6508(_0x1baf74,_0x4f6830[_0x1b2f49],_0x4be9fd[_0x7134('0x13')]));}else{if(_0x1baf74[_0x7134('0xc')]){_0x53da52[_0x7134('0x8f')](_0x24afc7(_0x1baf74,_0x4f6830[_0x1b2f49]));}}}}}return Promise['all'](_0x53da52);})[_0x7134('0x9')](function(_0x452315){var _0x39eb35=_0x452315;var _0x311a35=null;if(_0x39eb35){_0x311a35=_0x39eb35[_0x7134('0x8e')]===0x1?_0x39eb35[0x0]:null;}if(!_0x311a35&&!_0x39eb35)return _0x888e4d;var _0xb24edf=_0x32fc58[_0x4be9fd[_0x7134('0x13')]][_0x7134('0x96')];_0x4f90b8['model']=_[_0x7134('0x97')](_0xb24edf);_0x4f90b8[_0x7134('0x86')]=_[_0x7134('0x97')](_0x5d1f6c[_0x7134('0x86')]);_0x4f90b8['filters']=_['intersection'](_0x4f90b8[_0x7134('0xc')],_0x4f90b8[_0x7134('0x86')]);_0x5735c3[_0x7134('0x98')]=_['intersection'](_0x4f90b8[_0x7134('0xc')],qs[_0x7134('0x99')](_0x5d1f6c['query'][_0x7134('0x99')]));_0x5735c3[_0x7134('0x98')]=_0x5735c3[_0x7134('0x98')][_0x7134('0x8e')]?_0x5735c3[_0x7134('0x98')]:_0x4f90b8[_0x7134('0xc')];if(!_0x5d1f6c[_0x7134('0x86')][_0x7134('0x9a')](_0x7134('0x9b'))){_0x5735c3[_0x7134('0x9c')]=qs[_0x7134('0x9c')](_0x5d1f6c[_0x7134('0x86')][_0x7134('0x9c')]);_0x5735c3[_0x7134('0x9d')]=qs[_0x7134('0x9d')](_0x5d1f6c[_0x7134('0x86')][_0x7134('0x9d')]);}_0x5735c3[_0x7134('0x9e')]=qs['sort'](_0x5d1f6c['query'][_0x7134('0x9f')]);_0x5735c3[_0x7134('0x83')]=qs[_0x7134('0xa0')](_[_0x7134('0xa1')](_0x5d1f6c[_0x7134('0x86')],_0x4f90b8[_0x7134('0xa0')]));if(_0x5d1f6c[_0x7134('0x86')][_0x7134('0x5')]){_0x5735c3[_0x7134('0x83')]=_[_0x7134('0xa2')](_0x5735c3[_0x7134('0x83')],{'$or':_[_0x7134('0xd')](_0xb24edf,function(_0x9a0d5c){if(_0x9a0d5c[_0x7134('0x12')]['key']!=='VIRTUAL'){var _0x1087ac={};_0x1087ac[_0x9a0d5c[_0x7134('0x6')]]={'$like':'%'+_0x5d1f6c[_0x7134('0x86')][_0x7134('0x5')]+'%'};return _0x1087ac;}})});}var _0x4947ad=[];var _0x376502=null;var _0x4d7e2f={};if(_0x311a35){_0x376502=_[_0x7134('0x93')](_0x2cd0e1,[_0x7134('0xe'),_0x311a35[_0x7134('0xe')]]);if(_0x376502['field']){_0x4d7e2f={};if(_0x4be9fd[_0x7134('0x13')]===_0x7134('0x10')){_0x4d7e2f[_0x376502['foreignKey']]=_['map'](_0x311a35['associatedResources'],'id');}else{_0x4d7e2f[_0x376502[_0x7134('0xa3')]]=_0x311a35['associatedResources'];}_0x4947ad[_0x7134('0x8f')](_0x4d7e2f);}else{_0x5735c3['where']['id']=_0x311a35['associatedResources'];}}else{for(var _0x4972b1=0x0;_0x4972b1<_0x39eb35[_0x7134('0x8e')];_0x4972b1++){_0x376502=_[_0x7134('0x93')](_0x2cd0e1,[_0x7134('0xe'),_0x39eb35[_0x4972b1][_0x7134('0xe')]]);if(_0x376502[_0x7134('0x6')]){_0x4d7e2f={};_0x4d7e2f[_0x376502[_0x7134('0xa3')]]=_0x39eb35[_0x4972b1][_0x7134('0xa')];_0x4947ad['push'](_0x4d7e2f);}else{if(!_0x5735c3[_0x7134('0x83')]['id'])_0x5735c3[_0x7134('0x83')]['id']=[];_0x39eb35[_0x4972b1][_0x7134('0xa')][_0x7134('0xa4')](function(_0x1e45df){_0x5735c3[_0x7134('0x83')]['id']['push'](_0x1e45df);});}}}if(!_[_0x7134('0x91')](_0x4947ad)){_0x5735c3['where']=_['merge'](_0x5735c3[_0x7134('0x83')],{'$and':{'$or':_0x4947ad}});}_0x5735c3=_[_0x7134('0xa2')]({},_0x5735c3,_0x5d1f6c[_0x7134('0xa5')]);if(_0x311a35&&!_0x311a35[_0x7134('0x95')]&&_0x4be9fd['childModel']===_0x7134('0x10')){if(_0x5d1f6c[_0x7134('0x86')][_0x7134('0xa6')]){_0x5735c3['include']=[{'all':!![]}];}return _0x32fc58[_0x4be9fd[_0x7134('0x13')]][_0x7134('0x8')](_0x5735c3)[_0x7134('0x9')](function(_0x11c930){var _0x29c2cc=[];_0x11c930[_0x7134('0xa4')](function(_0x419b52){var _0x269a7c;switch(_0x419b52[_0x7134('0xa7')]){case _0x7134('0xa8'):_0x269a7c=_[_0x7134('0x93')](_0x311a35[_0x7134('0xa')],function(_0x288972){return _0x288972['id']===_0x419b52[_0x7134('0x76')]&&_0x288972[_0x7134('0x12')]==='DefaultReports';});break;case _0x7134('0xa9'):_0x269a7c=_['find'](_0x311a35[_0x7134('0xa')],function(_0x498b26){return _0x498b26['id']===_0x419b52[_0x7134('0x76')]&&_0x498b26[_0x7134('0x12')]===_0x7134('0xaa');});break;}if(_0x269a7c)_0x29c2cc[_0x7134('0x8f')](_0x419b52);});_0x888e4d['count']=_0x29c2cc[_0x7134('0x8e')];_0x888e4d[_0x7134('0xab')]=_0x29c2cc;return _0x888e4d;});}else{return _0x32fc58[_0x4be9fd[_0x7134('0x13')]][_0x7134('0xac')]({'where':_0x5735c3[_0x7134('0x83')]})['then'](function(_0x3b4e25){_0x888e4d[_0x7134('0xac')]=_0x3b4e25;if(_0x5d1f6c[_0x7134('0x86')][_0x7134('0xa6')]){if(_0x4be9fd[_0x7134('0x13')]===_0x7134('0x1d')){_0x5735c3[_0x7134('0xad')]=[{'model':_0x32fc58[_0x7134('0xae')],'as':_0x7134('0xaf'),'attributes':['id','name',_0x7134('0xb0')],'required':_0x5d1f6c[_0x7134('0x86')][_0x7134('0xb1')]?!![]:![]},{'model':_0x32fc58['Tag'],'as':_0x7134('0xb2'),'attributes':['id',_0x7134('0xe'),'color'],'through':_0x5d1f6c['query'][_0x7134('0xb1')]?{'attributes':[],'where':{'TagId':_0x5d1f6c['query'][_0x7134('0xb1')]||undefined}}:{},'required':_0x5d1f6c[_0x7134('0x86')]['tag']?!![]:![]}];}else{_0x5735c3['include']=[{'all':!![]}];}}return _0x32fc58[_0x4be9fd[_0x7134('0x13')]]['findAll'](_0x5735c3);})[_0x7134('0x9')](function(_0x5e7a25){_0x888e4d['rows']=_0x5e7a25;if(_0x5e9a2c===_0x7134('0x33')&&_0x5d1f6c[_0x7134('0x86')][_0x7134('0xb3')]===_0x7134('0xb4')){var _0x45c8b6=[];for(var _0x2eef95=0x0;_0x2eef95<_0x888e4d[_0x7134('0xab')][_0x7134('0x8e')];_0x2eef95++){_0x45c8b6[_0x7134('0x8f')](_0x2c777a(_0x7134('0xb5'),_0x888e4d['rows'][_0x2eef95][_0x7134('0xb6')]));_0x45c8b6[_0x7134('0x8f')](_0x2c777a(_0x7134('0xb7'),_0x888e4d['rows'][_0x2eef95][_0x7134('0xb6')]));_0x45c8b6['push'](_0x2c777a(_0x7134('0xb8'),_0x888e4d['rows'][_0x2eef95][_0x7134('0xb6')]));_0x45c8b6[_0x7134('0x8f')](_0x2c777a(_0x7134('0xb9'),_0x888e4d['rows'][_0x2eef95][_0x7134('0xb6')]));_0x45c8b6[_0x7134('0x8f')](_0x2c777a(_0x7134('0xba'),_0x888e4d['rows'][_0x2eef95][_0x7134('0xb6')]));_0x45c8b6[_0x7134('0x8f')](_0x2c777a(_0x7134('0xbb'),_0x888e4d[_0x7134('0xab')][_0x2eef95][_0x7134('0xb6')]));}return Promise[_0x7134('0xbc')](_0x45c8b6)['then'](function(){return _0x888e4d;});}return _0x888e4d;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 612a206..cfbe5e5 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 _0x9fd4=['localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis'];(function(_0x2892cb,_0x4240f3){var _0x332019=function(_0x2579ce){while(--_0x2579ce){_0x2892cb['push'](_0x2892cb['shift']());}};_0x332019(++_0x4240f3);}(_0x9fd4,0x16c));var _0x49fd=function(_0x4cba28,_0x174f6d){_0x4cba28=_0x4cba28-0x0;var _0x540267=_0x9fd4[_0x4cba28];return _0x540267;};'use strict';var _=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var moment=require(_0x49fd('0x2'));var BPromise=require(_0x49fd('0x3'));var rs=require(_0x49fd('0x4'));var fs=require('fs');var Redis=require(_0x49fd('0x5'));var db=require(_0x49fd('0x6'))['db'];var utils=require(_0x49fd('0x7'));var logger=require(_0x49fd('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x49fd('0x9'));var client=jayson[_0x49fd('0xa')][_0x49fd('0xb')]({'port':0x232a});config[_0x49fd('0xc')]=_['defaults'](config[_0x49fd('0xc')],{'host':_0x49fd('0xd'),'port':0x18eb});var socket=require(_0x49fd('0xe'))(new Redis(config[_0x49fd('0xc')]));require(_0x49fd('0xf'))['register'](socket);function respondWithRpcPromise(_0x35034c,_0x130c9b,_0x3e1c71){return new BPromise(function(_0x4969d3,_0x426ec2){return client[_0x49fd('0x10')](_0x35034c,_0x3e1c71)[_0x49fd('0x11')](function(_0x53a44e){logger[_0x49fd('0x12')](_0x49fd('0x13'),_0x130c9b,_0x49fd('0x14'));logger[_0x49fd('0x15')](_0x49fd('0x16'),_0x130c9b,_0x49fd('0x14'),JSON[_0x49fd('0x17')](_0x53a44e));if(_0x53a44e[_0x49fd('0x18')]){if(_0x53a44e[_0x49fd('0x18')][_0x49fd('0x19')]===0x1f4){logger[_0x49fd('0x18')](_0x49fd('0x13'),_0x130c9b,_0x53a44e[_0x49fd('0x18')][_0x49fd('0x1a')]);return _0x426ec2(_0x53a44e[_0x49fd('0x18')][_0x49fd('0x1a')]);}logger[_0x49fd('0x18')](_0x49fd('0x13'),_0x130c9b,_0x53a44e[_0x49fd('0x18')][_0x49fd('0x1a')]);return _0x4969d3(_0x53a44e[_0x49fd('0x18')][_0x49fd('0x1a')]);}else{logger[_0x49fd('0x12')](_0x49fd('0x13'),_0x130c9b,_0x49fd('0x14'));_0x4969d3(_0x53a44e[_0x49fd('0x1b')]['message']);}})[_0x49fd('0x1c')](function(_0x3fd46b){logger['error']('UserProfile,\x20%s,\x20%s',_0x130c9b,_0x3fd46b);_0x426ec2(_0x3fd46b);});});} \ No newline at end of file +var _0x3024=['../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x3024,0x64));var _0x4302=function(_0x19ef9e,_0x42691c){_0x19ef9e=_0x19ef9e-0x0;var _0x57eea1=_0x3024[_0x19ef9e];return _0x57eea1;};'use strict';var _=require(_0x4302('0x0'));var util=require(_0x4302('0x1'));var moment=require('moment');var BPromise=require(_0x4302('0x2'));var rs=require(_0x4302('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4302('0x4'));var logger=require('../../config/logger')(_0x4302('0x5'));var config=require(_0x4302('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4302('0x7')][_0x4302('0x8')]({'port':0x232a});config['redis']=_[_0x4302('0x9')](config[_0x4302('0xa')],{'host':_0x4302('0xb'),'port':0x18eb});var socket=require(_0x4302('0xc'))(new Redis(config[_0x4302('0xa')]));require(_0x4302('0xd'))[_0x4302('0xe')](socket);function respondWithRpcPromise(_0x5630e5,_0x1a51bd,_0x34878d){return new BPromise(function(_0xe7d6b8,_0x493f5a){return client[_0x4302('0xf')](_0x5630e5,_0x34878d)[_0x4302('0x10')](function(_0x57722d){logger[_0x4302('0x11')](_0x4302('0x12'),_0x1a51bd,_0x4302('0x13'));logger['debug'](_0x4302('0x14'),_0x1a51bd,_0x4302('0x13'),JSON['stringify'](_0x57722d));if(_0x57722d[_0x4302('0x15')]){if(_0x57722d[_0x4302('0x15')][_0x4302('0x16')]===0x1f4){logger['error'](_0x4302('0x12'),_0x1a51bd,_0x57722d[_0x4302('0x15')]['message']);return _0x493f5a(_0x57722d[_0x4302('0x15')][_0x4302('0x17')]);}logger['error'](_0x4302('0x12'),_0x1a51bd,_0x57722d[_0x4302('0x15')][_0x4302('0x17')]);return _0xe7d6b8(_0x57722d[_0x4302('0x15')][_0x4302('0x17')]);}else{logger[_0x4302('0x11')](_0x4302('0x12'),_0x1a51bd,_0x4302('0x13'));_0xe7d6b8(_0x57722d[_0x4302('0x18')][_0x4302('0x17')]);}})[_0x4302('0x19')](function(_0x402eeb){logger[_0x4302('0x15')](_0x4302('0x12'),_0x1a51bd,_0x402eeb);_0x493f5a(_0x402eeb);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 1e60322..54461ee 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 _0x99d9=['userProfile:','save','remove','removeListener','length'];(function(_0x23a989,_0xcee78e){var _0x201a3a=function(_0x5b7a55){while(--_0x5b7a55){_0x23a989['push'](_0x23a989['shift']());}};_0x201a3a(++_0xcee78e);}(_0x99d9,0x173));var _0x999d=function(_0x5ed383,_0x12b442){_0x5ed383=_0x5ed383-0x0;var _0x1a2249=_0x99d9[_0x5ed383];return _0x1a2249;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x999d('0x0'),_0x999d('0x1'),'update'];function createListener(_0x285e97,_0x403faf){return function(_0x2219d6){_0x403faf['emit'](_0x285e97,_0x2219d6);};}function removeListener(_0x43bbaa,_0x3f2572){return function(){UserProfileEvents[_0x999d('0x2')](_0x43bbaa,_0x3f2572);};}exports['register']=function(_0x3e90c6){for(var _0x4da2e2=0x0,_0x562569=events[_0x999d('0x3')];_0x4da2e2<_0x562569;_0x4da2e2++){var _0x131abb=events[_0x4da2e2];var _0x457c25=createListener(_0x999d('0x4')+_0x131abb,_0x3e90c6);UserProfileEvents['on'](_0x131abb,_0x457c25);}}; \ No newline at end of file +var _0x0b66=['./userProfile.events','save','remove','update','removeListener','register','userProfile:'];(function(_0xbc1a4b,_0x4dfbe4){var _0x108b87=function(_0x409062){while(--_0x409062){_0xbc1a4b['push'](_0xbc1a4b['shift']());}};_0x108b87(++_0x4dfbe4);}(_0x0b66,0x1dc));var _0x60b6=function(_0x405569,_0x1d94f3){_0x405569=_0x405569-0x0;var _0x28c5b9=_0x0b66[_0x405569];return _0x28c5b9;};'use strict';var UserProfileEvents=require(_0x60b6('0x0'));var events=[_0x60b6('0x1'),_0x60b6('0x2'),_0x60b6('0x3')];function createListener(_0x31df31,_0x3e17ec){return function(_0x34547a){_0x3e17ec['emit'](_0x31df31,_0x34547a);};}function removeListener(_0x33921b,_0xf06d33){return function(){UserProfileEvents[_0x60b6('0x4')](_0x33921b,_0xf06d33);};}exports[_0x60b6('0x5')]=function(_0x21e180){for(var _0x3d4143=0x0,_0x3516e6=events['length'];_0x3d4143<_0x3516e6;_0x3d4143++){var _0x3ecc87=events[_0x3d4143];var _0x451cb9=createListener(_0x60b6('0x6')+_0x3ecc87,_0x21e180);UserProfileEvents['on'](_0x3ecc87,_0x451cb9);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 406ad51..fcc105a 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 _0xbf99=['multer','path','fs-extra','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','delete','destroy','exports'];(function(_0x2cb856,_0x506f72){var _0x24bb8a=function(_0x481e31){while(--_0x481e31){_0x2cb856['push'](_0x2cb856['shift']());}};_0x24bb8a(++_0x506f72);}(_0xbf99,0x1ed));var _0x9bf9=function(_0x27b59c,_0x3a4b59){_0x27b59c=_0x27b59c-0x0;var _0x42a391=_0xbf99[_0x27b59c];return _0x42a391;};'use strict';var multer=require(_0x9bf9('0x0'));var util=require('util');var path=require(_0x9bf9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9bf9('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x9bf9('0x3'));var config=require('../../config/environment');var controller=require(_0x9bf9('0x4'));router[_0x9bf9('0x5')]('/',auth[_0x9bf9('0x6')](),controller[_0x9bf9('0x7')]);router[_0x9bf9('0x5')](_0x9bf9('0x8'),auth[_0x9bf9('0x6')](),controller[_0x9bf9('0x9')]);router['get']('/:id',auth[_0x9bf9('0x6')](),controller['show']);router[_0x9bf9('0xa')]('/',auth[_0x9bf9('0x6')](),controller[_0x9bf9('0xb')]);router[_0x9bf9('0xc')](_0x9bf9('0xd'),auth[_0x9bf9('0x6')](),controller['update']);router[_0x9bf9('0xe')](_0x9bf9('0xd'),auth['isAuthenticated'](),controller[_0x9bf9('0xf')]);module[_0x9bf9('0x10')]=router; \ No newline at end of file +var _0x2d0a=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','post','update','delete'];(function(_0x3c2bbf,_0x33e4f5){var _0x309dbc=function(_0x17f545){while(--_0x17f545){_0x3c2bbf['push'](_0x3c2bbf['shift']());}};_0x309dbc(++_0x33e4f5);}(_0x2d0a,0x17c));var _0xa2d0=function(_0x285f57,_0x59e17e){_0x285f57=_0x285f57-0x0;var _0x147319=_0x2d0a[_0x285f57];return _0x147319;};'use strict';var multer=require(_0xa2d0('0x0'));var util=require(_0xa2d0('0x1'));var path=require(_0xa2d0('0x2'));var timeout=require(_0xa2d0('0x3'));var express=require(_0xa2d0('0x4'));var router=express['Router']();var fs_extra=require(_0xa2d0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa2d0('0x6'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0xa2d0('0x7')]('/',auth[_0xa2d0('0x8')](),controller[_0xa2d0('0x9')]);router['get']('/describe',auth[_0xa2d0('0x8')](),controller[_0xa2d0('0xa')]);router[_0xa2d0('0x7')](_0xa2d0('0xb'),auth[_0xa2d0('0x8')](),controller[_0xa2d0('0xc')]);router[_0xa2d0('0xd')]('/',auth[_0xa2d0('0x8')](),controller['create']);router['put'](_0xa2d0('0xb'),auth['isAuthenticated'](),controller[_0xa2d0('0xe')]);router[_0xa2d0('0xf')](_0xa2d0('0xb'),auth[_0xa2d0('0x8')](),controller[_0xa2d0('0x10')]);module[_0xa2d0('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 4e9d8ae..7aa9841 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 _0x2f68=['sequelize','STRING','INTEGER'];(function(_0x4cffa0,_0x345efe){var _0x912413=function(_0x17e39f){while(--_0x17e39f){_0x4cffa0['push'](_0x4cffa0['shift']());}};_0x912413(++_0x345efe);}(_0x2f68,0x93));var _0x82f6=function(_0x13b55c,_0x3510a1){_0x13b55c=_0x13b55c-0x0;var _0x4cdc2a=_0x2f68[_0x13b55c];return _0x4cdc2a;};'use strict';var Sequelize=require(_0x82f6('0x0'));module['exports']={'name':{'type':Sequelize[_0x82f6('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x82f6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x82f6('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5fa4=['INTEGER','STRING'];(function(_0x51d56b,_0x195852){var _0x2e1ffe=function(_0x55dec8){while(--_0x55dec8){_0x51d56b['push'](_0x51d56b['shift']());}};_0x2e1ffe(++_0x195852);}(_0x5fa4,0x1d5));var _0x45fa=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5fa4[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x45fa('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x45fa('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x45fa('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 80edd47..1c14e64 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 _0xba34=['../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x403f5f,_0x283f67){var _0x15b1cd=function(_0x238cab){while(--_0x238cab){_0x403f5f['push'](_0x403f5f['shift']());}};_0x15b1cd(++_0x283f67);}(_0xba34,0x119));var _0x4ba3=function(_0x315fa1,_0x22c3f4){_0x315fa1=_0x315fa1-0x0;var _0xca018c=_0xba34[_0x315fa1];return _0xca018c;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['UserProfileResource']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));};exports['describe']=function(_0x43f820,_0x19d70f){return db[_0x4ba3('0x2d')][_0x4ba3('0x4b')]()[_0x4ba3('0x26')](respondWithResult(_0x19d70f,null))[_0x4ba3('0x46')](handleError(_0x19d70f,null));}; \ No newline at end of file +var _0x5f66=['bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x3aaef5,_0x16cdc8){var _0x4c0ed5=function(_0x4f7046){while(--_0x4f7046){_0x3aaef5['push'](_0x3aaef5['shift']());}};_0x4c0ed5(++_0x16cdc8);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['UserProfileResource'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};exports[_0x65f6('0x45')]=function(_0x3b241f,_0x1ca67e){return db['UserProfileResource'][_0x65f6('0x45')]()[_0x65f6('0x21')](respondWithResult(_0x1ca67e,null))['catch'](handleError(_0x1ca67e,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 6d0d4c2..e6488a8 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 _0xa146=['../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','api','request-promise','path','rimraf'];(function(_0x2eba04,_0x4bc5ee){var _0xe5b821=function(_0x44c570){while(--_0x44c570){_0x2eba04['push'](_0x2eba04['shift']());}};_0xe5b821(++_0x4bc5ee);}(_0xa146,0x1f0));var _0x6a14=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xa146[_0x334841];return _0x5beb4b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x6a14('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6a14('0x1'));var fs=require('fs');var path=require(_0x6a14('0x2'));var rimraf=require(_0x6a14('0x3'));var config=require(_0x6a14('0x4'));var attributes=require(_0x6a14('0x5'));module[_0x6a14('0x6')]=function(_0x326657,_0x888ad7){return _0x326657[_0x6a14('0x7')](_0x6a14('0x8'),attributes,{'tableName':_0x6a14('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9a84=['../../config/logger','api','bluebird','rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId'];(function(_0x41e793,_0x166684){var _0x2885fa=function(_0x383785){while(--_0x383785){_0x41e793['push'](_0x41e793['shift']());}};_0x2885fa(++_0x166684);}(_0x9a84,0x113));var _0x49a8=function(_0x435b2f,_0x4c44da){_0x435b2f=_0x435b2f-0x0;var _0x181648=_0x9a84[_0x435b2f];return _0x181648;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49a8('0x0'))(_0x49a8('0x1'));var moment=require('moment');var BPromise=require(_0x49a8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x49a8('0x3'));var config=require(_0x49a8('0x4'));var attributes=require(_0x49a8('0x5'));module['exports']=function(_0x173202,_0x390baf){return _0x173202[_0x49a8('0x6')](_0x49a8('0x7'),attributes,{'tableName':_0x49a8('0x8'),'paranoid':![],'indexes':[{'name':_0x49a8('0x9'),'fields':['resourceId',_0x49a8('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 0e79b7a..7069586 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 _0x2bca=['request','then','UserProfileResource,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','http'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0x2bca,0x173));var _0xa2bc=function(_0x1af08d,_0x3d549f){_0x1af08d=_0x1af08d-0x0;var _0x155da6=_0x2bca[_0x1af08d];return _0x155da6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa2bc('0x0'));var BPromise=require(_0xa2bc('0x1'));var rs=require(_0xa2bc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa2bc('0x3'))['db'];var utils=require(_0xa2bc('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa2bc('0x5'));var client=jayson['client'][_0xa2bc('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2eb8f1,_0x333126,_0x1f7b00){return new BPromise(function(_0x4597a1,_0x3a2cf9){return client[_0xa2bc('0x7')](_0x2eb8f1,_0x1f7b00)[_0xa2bc('0x8')](function(_0x4df4f9){logger['info'](_0xa2bc('0x9'),_0x333126,'request\x20sent');logger[_0xa2bc('0xa')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x333126,'request\x20sent',JSON[_0xa2bc('0xb')](_0x4df4f9));if(_0x4df4f9[_0xa2bc('0xc')]){if(_0x4df4f9[_0xa2bc('0xc')]['code']===0x1f4){logger['error'](_0xa2bc('0x9'),_0x333126,_0x4df4f9[_0xa2bc('0xc')][_0xa2bc('0xd')]);return _0x3a2cf9(_0x4df4f9[_0xa2bc('0xc')]['message']);}logger[_0xa2bc('0xc')](_0xa2bc('0x9'),_0x333126,_0x4df4f9[_0xa2bc('0xc')]['message']);return _0x4597a1(_0x4df4f9[_0xa2bc('0xc')][_0xa2bc('0xd')]);}else{logger[_0xa2bc('0xe')](_0xa2bc('0x9'),_0x333126,_0xa2bc('0xf'));_0x4597a1(_0x4df4f9[_0xa2bc('0x10')][_0xa2bc('0xd')]);}})[_0xa2bc('0x11')](function(_0x15d325){logger[_0xa2bc('0xc')](_0xa2bc('0x9'),_0x333126,_0x15d325);_0x3a2cf9(_0x15d325);});});} \ No newline at end of file +var _0x9efe=['request','then','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x325dca,_0x4acb56){var _0x40f51f=function(_0x217945){while(--_0x217945){_0x325dca['push'](_0x325dca['shift']());}};_0x40f51f(++_0x4acb56);}(_0x9efe,0x120));var _0xe9ef=function(_0x1e67d0,_0x13b2c1){_0x1e67d0=_0x1e67d0-0x0;var _0x54f7de=_0x9efe[_0x1e67d0];return _0x54f7de;};'use strict';var _=require(_0xe9ef('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe9ef('0x1'));var rs=require(_0xe9ef('0x2'));var fs=require('fs');var Redis=require(_0xe9ef('0x3'));var db=require(_0xe9ef('0x4'))['db'];var utils=require(_0xe9ef('0x5'));var logger=require('../../config/logger')(_0xe9ef('0x6'));var config=require(_0xe9ef('0x7'));var jayson=require(_0xe9ef('0x8'));var client=jayson[_0xe9ef('0x9')][_0xe9ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x100ee3,_0x16ff26,_0x3978e6){return new BPromise(function(_0x55e8e0,_0x3396dc){return client[_0xe9ef('0xb')](_0x100ee3,_0x3978e6)[_0xe9ef('0xc')](function(_0x24c50a){logger['info'](_0xe9ef('0xd'),_0x16ff26,'request\x20sent');logger[_0xe9ef('0xe')](_0xe9ef('0xf'),_0x16ff26,_0xe9ef('0x10'),JSON[_0xe9ef('0x11')](_0x24c50a));if(_0x24c50a[_0xe9ef('0x12')]){if(_0x24c50a[_0xe9ef('0x12')][_0xe9ef('0x13')]===0x1f4){logger['error'](_0xe9ef('0xd'),_0x16ff26,_0x24c50a[_0xe9ef('0x12')][_0xe9ef('0x14')]);return _0x3396dc(_0x24c50a['error'][_0xe9ef('0x14')]);}logger[_0xe9ef('0x12')](_0xe9ef('0xd'),_0x16ff26,_0x24c50a[_0xe9ef('0x12')][_0xe9ef('0x14')]);return _0x55e8e0(_0x24c50a[_0xe9ef('0x12')][_0xe9ef('0x14')]);}else{logger[_0xe9ef('0x15')]('UserProfileResource,\x20%s,\x20%s',_0x16ff26,_0xe9ef('0x10'));_0x55e8e0(_0x24c50a[_0xe9ef('0x16')]['message']);}})['catch'](function(_0x53ba57){logger['error'](_0xe9ef('0xd'),_0x16ff26,_0x53ba57);_0x3396dc(_0x53ba57);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 5b0aee8..7c237f6 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 _0x8c7f=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8c7f,0x16e));var _0xf8c7=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x8c7f[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0xf8c7('0x0'));var util=require(_0xf8c7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf8c7('0x2'));var router=express[_0xf8c7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf8c7('0x4'));var interaction=require(_0xf8c7('0x5'));var config=require(_0xf8c7('0x6'));var controller=require(_0xf8c7('0x7'));router[_0xf8c7('0x8')]('/',auth[_0xf8c7('0x9')](),controller[_0xf8c7('0xa')]);router['get'](_0xf8c7('0xb'),auth[_0xf8c7('0x9')](),controller['describe']);router[_0xf8c7('0x8')](_0xf8c7('0xc'),auth['isAuthenticated'](),controller[_0xf8c7('0xd')]);router[_0xf8c7('0xe')]('/',auth['isAuthenticated'](),controller[_0xf8c7('0xf')]);router[_0xf8c7('0x10')](_0xf8c7('0xc'),auth['isAuthenticated'](),controller[_0xf8c7('0x11')]);router[_0xf8c7('0x12')]('/:id',auth[_0xf8c7('0x9')](),controller[_0xf8c7('0x13')]);module[_0xf8c7('0x14')]=router; \ No newline at end of file +var _0xf395=['util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1cc8a2,_0x5dce88){var _0xadb7a6=function(_0x385f03){while(--_0x385f03){_0x1cc8a2['push'](_0x1cc8a2['shift']());}};_0xadb7a6(++_0x5dce88);}(_0xf395,0xbd));var _0x5f39=function(_0x4a2c5d,_0x1cfe0e){_0x4a2c5d=_0x4a2c5d-0x0;var _0x40bde1=_0xf395[_0x4a2c5d];return _0x40bde1;};'use strict';var multer=require('multer');var util=require(_0x5f39('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5f39('0x1'));var router=express[_0x5f39('0x2')]();var fs_extra=require(_0x5f39('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5f39('0x4'));var config=require(_0x5f39('0x5'));var controller=require(_0x5f39('0x6'));router[_0x5f39('0x7')]('/',auth[_0x5f39('0x8')](),controller[_0x5f39('0x9')]);router['get'](_0x5f39('0xa'),auth[_0x5f39('0x8')](),controller[_0x5f39('0xb')]);router[_0x5f39('0x7')](_0x5f39('0xc'),auth['isAuthenticated'](),controller[_0x5f39('0xd')]);router[_0x5f39('0xe')]('/',auth['isAuthenticated'](),controller[_0x5f39('0xf')]);router[_0x5f39('0x10')]('/:id',auth[_0x5f39('0x8')](),controller[_0x5f39('0x11')]);router[_0x5f39('0x12')](_0x5f39('0xc'),auth[_0x5f39('0x8')](),controller[_0x5f39('0x13')]);module[_0x5f39('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 99e08b5..cb8e388 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 _0x4cf8=['split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x272c74,_0x543b55){var _0x47b772=function(_0x1d9bfc){while(--_0x1d9bfc){_0x272c74['push'](_0x272c74['shift']());}};_0x47b772(++_0x543b55);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x56eb70,_0x2bd75c){_0x56eb70=_0x56eb70-0x0;var _0x47f1fe=_0x4cf8[_0x56eb70];return _0x47f1fe;};'use strict';var Sequelize=require(_0x84cf('0x0'));module[_0x84cf('0x1')]={'name':{'type':Sequelize[_0x84cf('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x84cf('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x84cf('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x84cf('0x2')],'set':function(_0x3bbbc3){this[_0x84cf('0x5')](_0x84cf('0x6'),_0x3bbbc3?_0x3bbbc3[_0x84cf('0x7')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x84cf('0x8')]('crudPermissions')[_0x84cf('0x9')](''):[];}}}; \ No newline at end of file +var _0x5b12=['split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','getDataValue','crudPermissions'];(function(_0x4947bf,_0x1d6619){var _0x2d1f49=function(_0x47e114){while(--_0x47e114){_0x4947bf['push'](_0x4947bf['shift']());}};_0x2d1f49(++_0x1d6619);}(_0x5b12,0xa3));var _0x25b1=function(_0x245374,_0xa3dc3c){_0x245374=_0x245374-0x0;var _0x396104=_0x5b12[_0x245374];return _0x396104;};'use strict';var Sequelize=require(_0x25b1('0x0'));module[_0x25b1('0x1')]={'name':{'type':Sequelize[_0x25b1('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x25b1('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x25b1('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x25b1('0x2')],'set':function(_0x47995b){this[_0x25b1('0x5')]('crudPermissions',_0x47995b?_0x47995b['join'](''):[]);},'get':function(){return this[_0x25b1('0x6')]('crudPermissions')?this['getDataValue'](_0x25b1('0x7'))[_0x25b1('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index e0b7e25..12418c3 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 _0x60c9=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','error','name','send','index','map','UserProfileSection','fieldName','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','then','includeAll','findAll','catch','show','params','rawAttributes','include','find','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse'];(function(_0x18f8d3,_0xd97b7f){var _0x339428=function(_0x33ffe5){while(--_0x33ffe5){_0x18f8d3['push'](_0x18f8d3['shift']());}};_0x339428(++_0xd97b7f);}(_0x60c9,0x1a0));var _0x960c=function(_0x3a6244,_0x1a4fd1){_0x3a6244=_0x3a6244-0x0;var _0x177b64=_0x60c9[_0x3a6244];return _0x177b64;};'use strict';var emlformat=require(_0x960c('0x0'));var rimraf=require(_0x960c('0x1'));var zipdir=require(_0x960c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x960c('0x3'));var moment=require(_0x960c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x960c('0x5'));var util=require(_0x960c('0x6'));var path=require(_0x960c('0x7'));var sox=require(_0x960c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x960c('0x9'));var _=require(_0x960c('0xa'));var squel=require(_0x960c('0xb'));var crypto=require('crypto');var jsforce=require(_0x960c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x960c('0xd'));var querystring=require(_0x960c('0xe'));var Papa=require(_0x960c('0xf'));var Redis=require(_0x960c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x960c('0x11'));var hardwareService=require(_0x960c('0x12'));var logger=require(_0x960c('0x13'))('api');var utils=require(_0x960c('0x14'));var config=require(_0x960c('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1127b2,_0x129ce2){_0x129ce2=_0x129ce2||0xcc;return function(_0x4067ea){if(_0x4067ea){return _0x1127b2[_0x960c('0x16')](_0x129ce2);}return _0x1127b2[_0x960c('0x17')](_0x129ce2)[_0x960c('0x18')]();};}function respondWithResult(_0x1da197,_0x5411d4){_0x5411d4=_0x5411d4||0xc8;return function(_0x366864){if(_0x366864){return _0x1da197[_0x960c('0x17')](_0x5411d4)[_0x960c('0x19')](_0x366864);}};}function respondWithFilteredResult(_0x377797,_0x5ebaf9){return function(_0x2d507e){if(_0x2d507e){var _0x461431=typeof _0x5ebaf9[_0x960c('0x1a')]===_0x960c('0x1b')&&typeof _0x5ebaf9[_0x960c('0x1c')]===_0x960c('0x1b');var _0x132d10=_0x2d507e[_0x960c('0x1d')];var _0x17231a=_0x461431?0x0:_0x5ebaf9['offset'];var _0x4a45b1=_0x461431?_0x2d507e[_0x960c('0x1d')]:_0x5ebaf9['offset']+_0x5ebaf9['limit'];var _0x3b6cf3;if(_0x4a45b1>=_0x132d10){_0x4a45b1=_0x132d10;_0x3b6cf3=0xc8;}else{_0x3b6cf3=0xce;}_0x377797[_0x960c('0x17')](_0x3b6cf3);return _0x377797[_0x960c('0x1e')](_0x960c('0x1f'),_0x17231a+'-'+_0x4a45b1+'/'+_0x132d10)[_0x960c('0x19')](_0x2d507e);}return null;};}function patchUpdates(_0xe86155){return function(_0x6b86b0){try{jsonpatch[_0x960c('0x20')](_0x6b86b0,_0xe86155,!![]);}catch(_0x3da119){return BPromise['reject'](_0x3da119);}return _0x6b86b0[_0x960c('0x21')]();};}function saveUpdates(_0x317f3e,_0x37362a){return function(_0x1c7df4){if(_0x1c7df4){return _0x1c7df4[_0x960c('0x22')](_0x317f3e)['then'](function(_0x33db55){return _0x33db55;});}return null;};}function removeEntity(_0x5406db,_0x5375f6){return function(_0x57cdb0){if(_0x57cdb0){return _0x57cdb0[_0x960c('0x23')]()['then'](function(){_0x5406db[_0x960c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35c81d,_0x299c04){return function(_0x3a32cf){if(!_0x3a32cf){_0x35c81d[_0x960c('0x16')](0x194);}return _0x3a32cf;};}function handleError(_0x4f0f80,_0x14a806){_0x14a806=_0x14a806||0x1f4;return function(_0x38ff9f){logger[_0x960c('0x24')](_0x38ff9f['stack']);if(_0x38ff9f[_0x960c('0x25')]){delete _0x38ff9f[_0x960c('0x25')];}_0x4f0f80[_0x960c('0x17')](_0x14a806)[_0x960c('0x26')](_0x38ff9f);};}exports[_0x960c('0x27')]=function(_0x3d9edc,_0x299a12){var _0x29812d={},_0x43ce5f={},_0x4bda61={'count':0x0,'rows':[]};var _0x32cb89=_[_0x960c('0x28')](db[_0x960c('0x29')]['rawAttributes'],function(_0x1edb5a){return{'name':_0x1edb5a[_0x960c('0x2a')],'type':_0x1edb5a['type']['key']};});_0x43ce5f['model']=_['map'](_0x32cb89,_0x960c('0x25'));_0x43ce5f[_0x960c('0x2b')]=_[_0x960c('0x2c')](_0x3d9edc[_0x960c('0x2b')]);_0x43ce5f[_0x960c('0x2d')]=_[_0x960c('0x2e')](_0x43ce5f['model'],_0x43ce5f[_0x960c('0x2b')]);_0x29812d[_0x960c('0x2f')]=_[_0x960c('0x2e')](_0x43ce5f[_0x960c('0x30')],qs['fields'](_0x3d9edc[_0x960c('0x2b')][_0x960c('0x31')]));_0x29812d[_0x960c('0x2f')]=_0x29812d[_0x960c('0x2f')][_0x960c('0x32')]?_0x29812d['attributes']:_0x43ce5f[_0x960c('0x30')];if(!_0x3d9edc[_0x960c('0x2b')][_0x960c('0x33')](_0x960c('0x34'))){_0x29812d[_0x960c('0x1c')]=qs['limit'](_0x3d9edc[_0x960c('0x2b')]['limit']);_0x29812d[_0x960c('0x1a')]=qs['offset'](_0x3d9edc[_0x960c('0x2b')]['offset']);}_0x29812d[_0x960c('0x35')]=qs['sort'](_0x3d9edc[_0x960c('0x2b')][_0x960c('0x36')]);_0x29812d[_0x960c('0x37')]=qs[_0x960c('0x2d')](_[_0x960c('0x38')](_0x3d9edc[_0x960c('0x2b')],_0x43ce5f[_0x960c('0x2d')]),_0x32cb89);if(_0x3d9edc[_0x960c('0x2b')][_0x960c('0x39')]){_0x29812d[_0x960c('0x37')]=_[_0x960c('0x3a')](_0x29812d[_0x960c('0x37')],{'$or':_[_0x960c('0x28')](_0x32cb89,function(_0x3dc39e){if(_0x3dc39e[_0x960c('0x3b')]!=='VIRTUAL'){var _0x4027cb={};_0x4027cb[_0x3dc39e[_0x960c('0x25')]]={'$like':'%'+_0x3d9edc['query'][_0x960c('0x39')]+'%'};return _0x4027cb;}})});}_0x29812d=_[_0x960c('0x3a')]({},_0x29812d,_0x3d9edc[_0x960c('0x3c')]);var _0x195d0b={'where':_0x29812d[_0x960c('0x37')]};return db['UserProfileSection'][_0x960c('0x1d')](_0x195d0b)[_0x960c('0x3d')](function(_0x187a48){_0x4bda61[_0x960c('0x1d')]=_0x187a48;if(_0x3d9edc[_0x960c('0x2b')][_0x960c('0x3e')]){_0x29812d['include']=[{'all':!![]}];}return db[_0x960c('0x29')][_0x960c('0x3f')](_0x29812d);})[_0x960c('0x3d')](function(_0x127fdb){_0x4bda61['rows']=_0x127fdb;return _0x4bda61;})[_0x960c('0x3d')](respondWithFilteredResult(_0x299a12,_0x29812d))[_0x960c('0x40')](handleError(_0x299a12,null));};exports[_0x960c('0x41')]=function(_0x418f6e,_0x43c2c1){var _0xd3b277={'raw':![],'where':{'id':_0x418f6e[_0x960c('0x42')]['id']}},_0xfac744={};_0xfac744[_0x960c('0x30')]=_['keys'](db[_0x960c('0x29')][_0x960c('0x43')]);_0xfac744[_0x960c('0x2b')]=_['keys'](_0x418f6e[_0x960c('0x2b')]);_0xfac744[_0x960c('0x2d')]=_['intersection'](_0xfac744['model'],_0xfac744[_0x960c('0x2b')]);_0xd3b277[_0x960c('0x2f')]=_[_0x960c('0x2e')](_0xfac744[_0x960c('0x30')],qs[_0x960c('0x31')](_0x418f6e['query'][_0x960c('0x31')]));_0xd3b277[_0x960c('0x2f')]=_0xd3b277[_0x960c('0x2f')][_0x960c('0x32')]?_0xd3b277[_0x960c('0x2f')]:_0xfac744['model'];if(_0x418f6e[_0x960c('0x2b')]['includeAll']){_0xd3b277[_0x960c('0x44')]=[{'all':!![]}];}_0xd3b277=_['merge']({},_0xd3b277,_0x418f6e[_0x960c('0x3c')]);return db[_0x960c('0x29')][_0x960c('0x45')](_0xd3b277)['then'](handleEntityNotFound(_0x43c2c1,null))[_0x960c('0x3d')](respondWithResult(_0x43c2c1,null))['catch'](handleError(_0x43c2c1,null));};exports['create']=function(_0x1fd71e,_0x544f92){return db['UserProfileSection']['create'](_0x1fd71e[_0x960c('0x46')],{})[_0x960c('0x3d')](respondWithResult(_0x544f92,0xc9))[_0x960c('0x40')](handleError(_0x544f92,null));};exports[_0x960c('0x22')]=function(_0xd65615,_0x4cd8e5){if(_0xd65615[_0x960c('0x46')]['id']){delete _0xd65615[_0x960c('0x46')]['id'];}return db[_0x960c('0x29')][_0x960c('0x45')]({'where':{'id':_0xd65615['params']['id']}})[_0x960c('0x3d')](handleEntityNotFound(_0x4cd8e5,null))[_0x960c('0x3d')](saveUpdates(_0xd65615['body'],null))[_0x960c('0x3d')](respondWithResult(_0x4cd8e5,null))[_0x960c('0x40')](handleError(_0x4cd8e5,null));};exports[_0x960c('0x23')]=function(_0x4006ac,_0x45b78b){return db[_0x960c('0x29')][_0x960c('0x45')]({'where':{'id':_0x4006ac[_0x960c('0x42')]['id']}})[_0x960c('0x3d')](handleEntityNotFound(_0x45b78b,null))[_0x960c('0x3d')](removeEntity(_0x45b78b,null))[_0x960c('0x40')](handleError(_0x45b78b,null));};exports[_0x960c('0x47')]=function(_0x57a6af,_0x2b54f6){return db['UserProfileSection'][_0x960c('0x47')]()[_0x960c('0x3d')](respondWithResult(_0x2b54f6,null))[_0x960c('0x40')](handleError(_0x2b54f6,null));}; \ No newline at end of file +var _0xf580=['length','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields'];(function(_0x569caa,_0x5174ce){var _0x44cb5a=function(_0x456df4){while(--_0x456df4){_0x569caa['push'](_0x569caa['shift']());}};_0x44cb5a(++_0x5174ce);}(_0xf580,0x1e5));var _0x0f58=function(_0x5e91ff,_0xf83dac){_0x5e91ff=_0x5e91ff-0x0;var _0x5bd5f3=_0xf580[_0x5e91ff];return _0x5bd5f3;};'use strict';var emlformat=require(_0x0f58('0x0'));var rimraf=require(_0x0f58('0x1'));var zipdir=require(_0x0f58('0x2'));var jsonpatch=require(_0x0f58('0x3'));var rp=require(_0x0f58('0x4'));var moment=require(_0x0f58('0x5'));var BPromise=require(_0x0f58('0x6'));var Mustache=require(_0x0f58('0x7'));var util=require('util');var path=require(_0x0f58('0x8'));var sox=require('sox');var csv=require(_0x0f58('0x9'));var ejs=require(_0x0f58('0xa'));var fs=require('fs');var fs_extra=require(_0x0f58('0xb'));var _=require(_0x0f58('0xc'));var squel=require(_0x0f58('0xd'));var crypto=require(_0x0f58('0xe'));var jsforce=require(_0x0f58('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0f58('0x9'));var querystring=require(_0x0f58('0x10'));var Papa=require(_0x0f58('0x11'));var Redis=require('ioredis');var authService=require(_0x0f58('0x12'));var qs=require(_0x0f58('0x13'));var as=require(_0x0f58('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f58('0x15'))('api');var utils=require(_0x0f58('0x16'));var config=require(_0x0f58('0x17'));var licenseUtil=require(_0x0f58('0x18'));var db=require(_0x0f58('0x19'))['db'];function respondWithStatusCode(_0x2fad6e,_0x36ffa0){_0x36ffa0=_0x36ffa0||0xcc;return function(_0x8ce42e){if(_0x8ce42e){return _0x2fad6e[_0x0f58('0x1a')](_0x36ffa0);}return _0x2fad6e[_0x0f58('0x1b')](_0x36ffa0)[_0x0f58('0x1c')]();};}function respondWithResult(_0x4bd5f9,_0xc9f054){_0xc9f054=_0xc9f054||0xc8;return function(_0x135b6e){if(_0x135b6e){return _0x4bd5f9[_0x0f58('0x1b')](_0xc9f054)[_0x0f58('0x1d')](_0x135b6e);}};}function respondWithFilteredResult(_0x165bb7,_0x568f42){return function(_0x3955a2){if(_0x3955a2){var _0x589a49=typeof _0x568f42[_0x0f58('0x1e')]===_0x0f58('0x1f')&&typeof _0x568f42['limit']==='undefined';var _0x4014a5=_0x3955a2['count'];var _0xd7a21f=_0x589a49?0x0:_0x568f42['offset'];var _0x3e7a9e=_0x589a49?_0x3955a2[_0x0f58('0x20')]:_0x568f42['offset']+_0x568f42[_0x0f58('0x21')];var _0x2313d8;if(_0x3e7a9e>=_0x4014a5){_0x3e7a9e=_0x4014a5;_0x2313d8=0xc8;}else{_0x2313d8=0xce;}_0x165bb7[_0x0f58('0x1b')](_0x2313d8);return _0x165bb7[_0x0f58('0x22')](_0x0f58('0x23'),_0xd7a21f+'-'+_0x3e7a9e+'/'+_0x4014a5)[_0x0f58('0x1d')](_0x3955a2);}return null;};}function patchUpdates(_0x27d118){return function(_0x2d295b){try{jsonpatch[_0x0f58('0x24')](_0x2d295b,_0x27d118,!![]);}catch(_0x2c9607){return BPromise['reject'](_0x2c9607);}return _0x2d295b[_0x0f58('0x25')]();};}function saveUpdates(_0x5728d7,_0x5f3ff7){return function(_0x24bc10){if(_0x24bc10){return _0x24bc10[_0x0f58('0x26')](_0x5728d7)[_0x0f58('0x27')](function(_0x2bc66e){return _0x2bc66e;});}return null;};}function removeEntity(_0x7fcc87,_0x48ceba){return function(_0xfc6f2a){if(_0xfc6f2a){return _0xfc6f2a[_0x0f58('0x28')]()[_0x0f58('0x27')](function(){_0x7fcc87[_0x0f58('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47b256,_0x4d5037){return function(_0x5c2670){if(!_0x5c2670){_0x47b256['sendStatus'](0x194);}return _0x5c2670;};}function handleError(_0x3dab71,_0x4df4f5){_0x4df4f5=_0x4df4f5||0x1f4;return function(_0x38079c){logger[_0x0f58('0x29')](_0x38079c[_0x0f58('0x2a')]);if(_0x38079c['name']){delete _0x38079c[_0x0f58('0x2b')];}_0x3dab71[_0x0f58('0x1b')](_0x4df4f5)[_0x0f58('0x2c')](_0x38079c);};}exports[_0x0f58('0x2d')]=function(_0x28fda0,_0x485e97){var _0x405211={},_0x14341f={},_0x5a5bf1={'count':0x0,'rows':[]};var _0x204318=_[_0x0f58('0x2e')](db[_0x0f58('0x2f')][_0x0f58('0x30')],function(_0x44c0fa){return{'name':_0x44c0fa[_0x0f58('0x31')],'type':_0x44c0fa[_0x0f58('0x32')][_0x0f58('0x33')]};});_0x14341f[_0x0f58('0x34')]=_['map'](_0x204318,_0x0f58('0x2b'));_0x14341f[_0x0f58('0x35')]=_[_0x0f58('0x36')](_0x28fda0['query']);_0x14341f[_0x0f58('0x37')]=_[_0x0f58('0x38')](_0x14341f['model'],_0x14341f['query']);_0x405211[_0x0f58('0x39')]=_[_0x0f58('0x38')](_0x14341f[_0x0f58('0x34')],qs['fields'](_0x28fda0[_0x0f58('0x35')]['fields']));_0x405211[_0x0f58('0x39')]=_0x405211[_0x0f58('0x39')]['length']?_0x405211[_0x0f58('0x39')]:_0x14341f[_0x0f58('0x34')];if(!_0x28fda0['query'][_0x0f58('0x3a')](_0x0f58('0x3b'))){_0x405211[_0x0f58('0x21')]=qs[_0x0f58('0x21')](_0x28fda0[_0x0f58('0x35')]['limit']);_0x405211[_0x0f58('0x1e')]=qs['offset'](_0x28fda0[_0x0f58('0x35')]['offset']);}_0x405211[_0x0f58('0x3c')]=qs[_0x0f58('0x3d')](_0x28fda0[_0x0f58('0x35')][_0x0f58('0x3d')]);_0x405211['where']=qs[_0x0f58('0x37')](_[_0x0f58('0x3e')](_0x28fda0['query'],_0x14341f[_0x0f58('0x37')]),_0x204318);if(_0x28fda0[_0x0f58('0x35')][_0x0f58('0x3f')]){_0x405211[_0x0f58('0x40')]=_['merge'](_0x405211['where'],{'$or':_['map'](_0x204318,function(_0x344acc){if(_0x344acc[_0x0f58('0x32')]!==_0x0f58('0x41')){var _0x374ca4={};_0x374ca4[_0x344acc[_0x0f58('0x2b')]]={'$like':'%'+_0x28fda0[_0x0f58('0x35')][_0x0f58('0x3f')]+'%'};return _0x374ca4;}})});}_0x405211=_['merge']({},_0x405211,_0x28fda0[_0x0f58('0x42')]);var _0x3fd74d={'where':_0x405211[_0x0f58('0x40')]};return db[_0x0f58('0x2f')][_0x0f58('0x20')](_0x3fd74d)[_0x0f58('0x27')](function(_0x58ed51){_0x5a5bf1[_0x0f58('0x20')]=_0x58ed51;if(_0x28fda0['query'][_0x0f58('0x43')]){_0x405211[_0x0f58('0x44')]=[{'all':!![]}];}return db['UserProfileSection'][_0x0f58('0x45')](_0x405211);})[_0x0f58('0x27')](function(_0x2167e8){_0x5a5bf1[_0x0f58('0x46')]=_0x2167e8;return _0x5a5bf1;})[_0x0f58('0x27')](respondWithFilteredResult(_0x485e97,_0x405211))[_0x0f58('0x47')](handleError(_0x485e97,null));};exports[_0x0f58('0x48')]=function(_0x141992,_0x32c232){var _0x124b50={'raw':![],'where':{'id':_0x141992[_0x0f58('0x49')]['id']}},_0x3a0ac3={};_0x3a0ac3[_0x0f58('0x34')]=_['keys'](db['UserProfileSection'][_0x0f58('0x30')]);_0x3a0ac3[_0x0f58('0x35')]=_[_0x0f58('0x36')](_0x141992[_0x0f58('0x35')]);_0x3a0ac3[_0x0f58('0x37')]=_[_0x0f58('0x38')](_0x3a0ac3[_0x0f58('0x34')],_0x3a0ac3[_0x0f58('0x35')]);_0x124b50[_0x0f58('0x39')]=_['intersection'](_0x3a0ac3[_0x0f58('0x34')],qs[_0x0f58('0x4a')](_0x141992[_0x0f58('0x35')][_0x0f58('0x4a')]));_0x124b50[_0x0f58('0x39')]=_0x124b50[_0x0f58('0x39')][_0x0f58('0x4b')]?_0x124b50[_0x0f58('0x39')]:_0x3a0ac3[_0x0f58('0x34')];if(_0x141992[_0x0f58('0x35')][_0x0f58('0x43')]){_0x124b50[_0x0f58('0x44')]=[{'all':!![]}];}_0x124b50=_['merge']({},_0x124b50,_0x141992['options']);return db[_0x0f58('0x2f')]['find'](_0x124b50)[_0x0f58('0x27')](handleEntityNotFound(_0x32c232,null))[_0x0f58('0x27')](respondWithResult(_0x32c232,null))[_0x0f58('0x47')](handleError(_0x32c232,null));};exports[_0x0f58('0x4c')]=function(_0x104c66,_0x482dcd){return db['UserProfileSection']['create'](_0x104c66['body'],{})[_0x0f58('0x27')](respondWithResult(_0x482dcd,0xc9))['catch'](handleError(_0x482dcd,null));};exports[_0x0f58('0x26')]=function(_0x5763df,_0x16e785){if(_0x5763df[_0x0f58('0x4d')]['id']){delete _0x5763df['body']['id'];}return db[_0x0f58('0x2f')][_0x0f58('0x4e')]({'where':{'id':_0x5763df['params']['id']}})[_0x0f58('0x27')](handleEntityNotFound(_0x16e785,null))[_0x0f58('0x27')](saveUpdates(_0x5763df['body'],null))[_0x0f58('0x27')](respondWithResult(_0x16e785,null))[_0x0f58('0x47')](handleError(_0x16e785,null));};exports[_0x0f58('0x28')]=function(_0x44d0b3,_0x85f140){return db[_0x0f58('0x2f')][_0x0f58('0x4e')]({'where':{'id':_0x44d0b3['params']['id']}})['then'](handleEntityNotFound(_0x85f140,null))[_0x0f58('0x27')](removeEntity(_0x85f140,null))['catch'](handleError(_0x85f140,null));};exports[_0x0f58('0x4f')]=function(_0x144ac9,_0x4eac6e){return db['UserProfileSection'][_0x0f58('0x4f')]()[_0x0f58('0x27')](respondWithResult(_0x4eac6e,null))[_0x0f58('0x47')](handleError(_0x4eac6e,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 3550547..7ec2e94 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 _0x818b=['moment','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','userProfileId','lodash','util','../../config/logger','api'];(function(_0x2d907f,_0x57bf59){var _0x509e8d=function(_0x4418ce){while(--_0x4418ce){_0x2d907f['push'](_0x2d907f['shift']());}};_0x509e8d(++_0x57bf59);}(_0x818b,0x1ca));var _0xb818=function(_0x1a6403,_0x1c9252){_0x1a6403=_0x1a6403-0x0;var _0x26447a=_0x818b[_0x1a6403];return _0x26447a;};'use strict';var _=require(_0xb818('0x0'));var util=require(_0xb818('0x1'));var logger=require(_0xb818('0x2'))(_0xb818('0x3'));var moment=require(_0xb818('0x4'));var BPromise=require('bluebird');var rp=require(_0xb818('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb818('0x6'));var config=require(_0xb818('0x7'));var attributes=require(_0xb818('0x8'));module[_0xb818('0x9')]=function(_0x22c10d,_0x3fd00a){return _0x22c10d[_0xb818('0xa')](_0xb818('0xb'),attributes,{'tableName':_0xb818('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0xb818('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x31d4=['path','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','compositeIndex','userProfileId','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xea6018,_0x4cf082){var _0x57b54d=function(_0x49099a){while(--_0x49099a){_0xea6018['push'](_0xea6018['shift']());}};_0x57b54d(++_0x4cf082);}(_0x31d4,0x6a));var _0x431d=function(_0x2440fe,_0x281a11){_0x2440fe=_0x2440fe-0x0;var _0x5cf734=_0x31d4[_0x2440fe];return _0x5cf734;};'use strict';var _=require(_0x431d('0x0'));var util=require(_0x431d('0x1'));var logger=require(_0x431d('0x2'))(_0x431d('0x3'));var moment=require(_0x431d('0x4'));var BPromise=require('bluebird');var rp=require(_0x431d('0x5'));var fs=require('fs');var path=require(_0x431d('0x6'));var rimraf=require(_0x431d('0x7'));var config=require(_0x431d('0x8'));var attributes=require(_0x431d('0x9'));module['exports']=function(_0x2559f5,_0x544b5e){return _0x2559f5[_0x431d('0xa')](_0x431d('0xb'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x431d('0xc'),'fields':['sectionId',_0x431d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index a283d2a..fbfaad7 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 _0x0f6e=['UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','UserProfileSection,\x20%s,\x20%s','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f6e,0x70));var _0xe0f6=function(_0x194cf8,_0x536123){_0x194cf8=_0x194cf8-0x0;var _0x17444f=_0x0f6e[_0x194cf8];return _0x17444f;};'use strict';var _=require(_0xe0f6('0x0'));var util=require(_0xe0f6('0x1'));var moment=require(_0xe0f6('0x2'));var BPromise=require(_0xe0f6('0x3'));var rs=require(_0xe0f6('0x4'));var fs=require('fs');var Redis=require(_0xe0f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe0f6('0x6'));var logger=require('../../config/logger')(_0xe0f6('0x7'));var config=require(_0xe0f6('0x8'));var jayson=require(_0xe0f6('0x9'));var client=jayson['client'][_0xe0f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36a734,_0x12a149,_0x53d54d){return new BPromise(function(_0x1e556f,_0x43eda2){return client['request'](_0x36a734,_0x53d54d)['then'](function(_0x26839b){logger[_0xe0f6('0xb')](_0xe0f6('0xc'),_0x12a149,'request\x20sent');logger[_0xe0f6('0xd')](_0xe0f6('0xe'),_0x12a149,_0xe0f6('0xf'),JSON[_0xe0f6('0x10')](_0x26839b));if(_0x26839b[_0xe0f6('0x11')]){if(_0x26839b[_0xe0f6('0x11')]['code']===0x1f4){logger[_0xe0f6('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x12a149,_0x26839b[_0xe0f6('0x11')]['message']);return _0x43eda2(_0x26839b[_0xe0f6('0x11')][_0xe0f6('0x12')]);}logger[_0xe0f6('0x11')](_0xe0f6('0xc'),_0x12a149,_0x26839b[_0xe0f6('0x11')][_0xe0f6('0x12')]);return _0x1e556f(_0x26839b['error'][_0xe0f6('0x12')]);}else{logger[_0xe0f6('0xb')](_0xe0f6('0xc'),_0x12a149,'request\x20sent');_0x1e556f(_0x26839b[_0xe0f6('0x13')][_0xe0f6('0x12')]);}})[_0xe0f6('0x14')](function(_0x2f526e){logger[_0xe0f6('0x11')](_0xe0f6('0xc'),_0x12a149,_0x2f526e);_0x43eda2(_0x2f526e);});});} \ No newline at end of file +var _0x4779=['randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x578b2e,_0x2a9e48){var _0x459bb8=function(_0x5db1b4){while(--_0x5db1b4){_0x578b2e['push'](_0x578b2e['shift']());}};_0x459bb8(++_0x2a9e48);}(_0x4779,0xc2));var _0x9477=function(_0x50da5e,_0x358328){_0x50da5e=_0x50da5e-0x0;var _0x217090=_0x4779[_0x50da5e];return _0x217090;};'use strict';var _=require(_0x9477('0x0'));var util=require(_0x9477('0x1'));var moment=require(_0x9477('0x2'));var BPromise=require(_0x9477('0x3'));var rs=require(_0x9477('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9477('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9477('0x6'))(_0x9477('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9477('0x8')][_0x9477('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x397ba0,_0x10bc1e,_0x651a80){return new BPromise(function(_0x342695,_0x456ea4){return client[_0x9477('0xa')](_0x397ba0,_0x651a80)[_0x9477('0xb')](function(_0x18d862){logger[_0x9477('0xc')](_0x9477('0xd'),_0x10bc1e,_0x9477('0xe'));logger[_0x9477('0xf')](_0x9477('0x10'),_0x10bc1e,_0x9477('0xe'),JSON[_0x9477('0x11')](_0x18d862));if(_0x18d862[_0x9477('0x12')]){if(_0x18d862[_0x9477('0x12')][_0x9477('0x13')]===0x1f4){logger[_0x9477('0x12')](_0x9477('0xd'),_0x10bc1e,_0x18d862[_0x9477('0x12')][_0x9477('0x14')]);return _0x456ea4(_0x18d862[_0x9477('0x12')][_0x9477('0x14')]);}logger['error'](_0x9477('0xd'),_0x10bc1e,_0x18d862[_0x9477('0x12')]['message']);return _0x342695(_0x18d862[_0x9477('0x12')][_0x9477('0x14')]);}else{logger[_0x9477('0xc')](_0x9477('0xd'),_0x10bc1e,'request\x20sent');_0x342695(_0x18d862[_0x9477('0x15')][_0x9477('0x14')]);}})['catch'](function(_0x1a2e62){logger[_0x9477('0x12')](_0x9477('0xd'),_0x10bc1e,_0x1a2e62);_0x456ea4(_0x1a2e62);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 580540a..6f584e9 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3844d1,_0x3f751f){var _0x5c8b23=function(_0x5e1e3e){while(--_0x5e1e3e){_0x3844d1['push'](_0x3844d1['shift']());}};_0x5c8b23(++_0x3f751f);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5ce9b5,_0x4c86bf){var _0x45280b=function(_0x2e6a45){while(--_0x2e6a45){_0x5ce9b5['push'](_0x5ce9b5['shift']());}};_0x45280b(++_0x4c86bf);}(_0xe706,0xa3));var _0x6e70=function(_0x277415,_0x38968b){_0x277415=_0x277415-0x0;var _0x376342=_0xe706[_0x277415];return _0x376342;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 75fcaf9..d332018 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 _0x6594=['sequelize','exports'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x6594,0x112));var _0x4659=function(_0x407e38,_0x30e1cb){_0x407e38=_0x407e38-0x0;var _0x996a91=_0x6594[_0x407e38];return _0x996a91;};'use strict';var Sequelize=require(_0x4659('0x0'));module[_0x4659('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4c88=['sequelize','exports'];(function(_0x5ba468,_0x410bc2){var _0x217799=function(_0x3751f4){while(--_0x3751f4){_0x5ba468['push'](_0x5ba468['shift']());}};_0x217799(++_0x410bc2);}(_0x4c88,0x1c6));var _0x84c8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4c88[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x84c8('0x0'));module[_0x84c8('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 480a354..1748fe5 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 _0x8aad=['api','bluebird','request-promise','../../config/environment','define','user_has_sms_queues','lodash','util'];(function(_0x46facc,_0x541f45){var _0x168550=function(_0x2a6b81){while(--_0x2a6b81){_0x46facc['push'](_0x46facc['shift']());}};_0x168550(++_0x541f45);}(_0x8aad,0x146));var _0xd8aa=function(_0x4550c9,_0x15b621){_0x4550c9=_0x4550c9-0x0;var _0x291f00=_0x8aad[_0x4550c9];return _0x291f00;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var logger=require('../../config/logger')(_0xd8aa('0x2'));var moment=require('moment');var BPromise=require(_0xd8aa('0x3'));var rp=require(_0xd8aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8aa('0x5'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x16b648,_0x43ddeb){return _0x16b648[_0xd8aa('0x6')]('UserSmsQueue',attributes,{'tableName':_0xd8aa('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','define','user_has_sms_queues','lodash'];(function(_0x19aae1,_0x448ae1){var _0x57bff9=function(_0x658117){while(--_0x658117){_0x19aae1['push'](_0x19aae1['shift']());}};_0x57bff9(++_0x448ae1);}(_0x5496,0x175));var _0x6549=function(_0x414a1c,_0x350393){_0x414a1c=_0x414a1c-0x0;var _0x42d26f=_0x5496[_0x414a1c];return _0x42d26f;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('UserSmsQueue',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 02d32dd..a98a1c1 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 _0xa6ed=['debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x1eca3a,_0x1dc8a1){var _0x2bab21=function(_0x18a85b){while(--_0x18a85b){_0x1eca3a['push'](_0x1eca3a['shift']());}};_0x2bab21(++_0x1dc8a1);}(_0xa6ed,0x103));var _0xda6e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa6ed[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xda6e('0x0'));var util=require(_0xda6e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda6e('0x2'))['db'];var utils=require(_0xda6e('0x3'));var logger=require(_0xda6e('0x4'))(_0xda6e('0x5'));var config=require(_0xda6e('0x6'));var jayson=require(_0xda6e('0x7'));var client=jayson['client'][_0xda6e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x353b07,_0x3b461f,_0x400655){return new BPromise(function(_0x3a204c,_0x55dfaa){return client[_0xda6e('0x9')](_0x353b07,_0x400655)[_0xda6e('0xa')](function(_0x552748){logger[_0xda6e('0xb')](_0xda6e('0xc'),_0x3b461f,_0xda6e('0xd'));logger[_0xda6e('0xe')](_0xda6e('0xf'),_0x3b461f,'request\x20sent',JSON['stringify'](_0x552748));if(_0x552748[_0xda6e('0x10')]){if(_0x552748[_0xda6e('0x10')][_0xda6e('0x11')]===0x1f4){logger[_0xda6e('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x3b461f,_0x552748[_0xda6e('0x10')][_0xda6e('0x12')]);return _0x55dfaa(_0x552748[_0xda6e('0x10')][_0xda6e('0x12')]);}logger[_0xda6e('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x3b461f,_0x552748[_0xda6e('0x10')][_0xda6e('0x12')]);return _0x3a204c(_0x552748['error']['message']);}else{logger[_0xda6e('0xb')](_0xda6e('0xc'),_0x3b461f,_0xda6e('0xd'));_0x3a204c(_0x552748[_0xda6e('0x13')][_0xda6e('0x12')]);}})[_0xda6e('0x14')](function(_0x62007f){logger[_0xda6e('0x10')](_0xda6e('0xc'),_0x3b461f,_0x62007f);_0x55dfaa(_0x62007f);});});} \ No newline at end of file +var _0x2e31=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','randomstring'];(function(_0x3de77f,_0x16022f){var _0x66d7a1=function(_0xe64061){while(--_0xe64061){_0x3de77f['push'](_0x3de77f['shift']());}};_0x66d7a1(++_0x16022f);}(_0x2e31,0xf4));var _0x12e3=function(_0x1f2e01,_0x4a5aea){_0x1f2e01=_0x1f2e01-0x0;var _0x22ca2a=_0x2e31[_0x1f2e01];return _0x22ca2a;};'use strict';var _=require(_0x12e3('0x0'));var util=require(_0x12e3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x12e3('0x2'));var fs=require('fs');var Redis=require(_0x12e3('0x3'));var db=require(_0x12e3('0x4'))['db'];var utils=require(_0x12e3('0x5'));var logger=require(_0x12e3('0x6'))('rpc');var config=require(_0x12e3('0x7'));var jayson=require(_0x12e3('0x8'));var client=jayson['client'][_0x12e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57a019,_0x4cd3d2,_0x3314ca){return new BPromise(function(_0x45ddd4,_0x4fc35c){return client[_0x12e3('0xa')](_0x57a019,_0x3314ca)[_0x12e3('0xb')](function(_0xa3e5ba){logger[_0x12e3('0xc')](_0x12e3('0xd'),_0x4cd3d2,_0x12e3('0xe'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x4cd3d2,_0x12e3('0xe'),JSON[_0x12e3('0xf')](_0xa3e5ba));if(_0xa3e5ba['error']){if(_0xa3e5ba['error']['code']===0x1f4){logger['error'](_0x12e3('0xd'),_0x4cd3d2,_0xa3e5ba[_0x12e3('0x10')][_0x12e3('0x11')]);return _0x4fc35c(_0xa3e5ba[_0x12e3('0x10')]['message']);}logger[_0x12e3('0x10')](_0x12e3('0xd'),_0x4cd3d2,_0xa3e5ba[_0x12e3('0x10')][_0x12e3('0x11')]);return _0x45ddd4(_0xa3e5ba['error'][_0x12e3('0x11')]);}else{logger[_0x12e3('0xc')](_0x12e3('0xd'),_0x4cd3d2,_0x12e3('0xe'));_0x45ddd4(_0xa3e5ba[_0x12e3('0x12')]['message']);}})['catch'](function(_0xe37fce){logger[_0x12e3('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x4cd3d2,_0xe37fce);_0x4fc35c(_0xe37fce);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index ec80351..2c7f75a 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 _0x7247=['exports','INTEGER','sequelize'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x7247,0x155));var _0x7724=function(_0x1193eb,_0x2a1969){_0x1193eb=_0x1193eb-0x0;var _0x5507f2=_0x7247[_0x1193eb];return _0x5507f2;};'use strict';var Sequelize=require(_0x7724('0x0'));module[_0x7724('0x1')]={'UserId':{'type':Sequelize[_0x7724('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x7724('0x2')]}}; \ No newline at end of file +var _0xeb16=['INTEGER','exports'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0xeb16,0xbd));var _0x6eb1=function(_0x1d681,_0x23d3ba){_0x1d681=_0x1d681-0x0;var _0x17074d=_0xeb16[_0x1d681];return _0x17074d;};'use strict';var Sequelize=require('sequelize');module[_0x6eb1('0x0')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x6eb1('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index a516a7b..cfac492 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(_0x23ed8c,_0x31c58c){var _0x28b354=function(_0x4441c8){while(--_0x4441c8){_0x23ed8c['push'](_0x23ed8c['shift']());}};_0x28b354(++_0x31c58c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x4f877a,_0x39fe0b){var _0x27815e=function(_0x270702){while(--_0x270702){_0x4f877a['push'](_0x4f877a['shift']());}};_0x27815e(++_0x39fe0b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 4648d19..bcaf567 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x59a27c,_0x531c79){var _0x2895c8=function(_0x26854f){while(--_0x26854f){_0x59a27c['push'](_0x59a27c['shift']());}};_0x2895c8(++_0x531c79);}(_0x70e0,0x17b));var _0x070e=function(_0x4c7a8d,_0x4a6e72){_0x4c7a8d=_0x4c7a8d-0x0;var _0x48b213=_0x70e0[_0x4c7a8d];return _0x48b213;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5098aa,_0x393e67){var _0x4d288b=function(_0x3b2c87){while(--_0x3b2c87){_0x5098aa['push'](_0x5098aa['shift']());}};_0x4d288b(++_0x393e67);}(_0xedd9,0xfc));var _0x9edd=function(_0x24927b,_0x57ebb9){_0x24927b=_0x24927b-0x0;var _0xa33c72=_0xedd9[_0x24927b];return _0xa33c72;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 64a315d..a7014ec 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 _0x0358=['exports','INTEGER'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x0358,0xb6));var _0x8035=function(_0x28632d,_0x8d99a5){_0x28632d=_0x28632d-0x0;var _0x5385f6=_0x0358[_0x28632d];return _0x5385f6;};'use strict';var Sequelize=require('sequelize');module[_0x8035('0x0')]={'penalty':{'type':Sequelize[_0x8035('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x80ea=['sequelize','exports','INTEGER'];(function(_0x3732a5,_0x36f1c9){var _0x568c38=function(_0x340c1a){while(--_0x340c1a){_0x3732a5['push'](_0x3732a5['shift']());}};_0x568c38(++_0x36f1c9);}(_0x80ea,0x15c));var _0xa80e=function(_0x3b69fd,_0x29ff16){_0x3b69fd=_0x3b69fd-0x0;var _0x25bbf8=_0x80ea[_0x3b69fd];return _0x25bbf8;};'use strict';var Sequelize=require(_0xa80e('0x0'));module[_0xa80e('0x1')]={'penalty':{'type':Sequelize[_0xa80e('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 4331c6c..9116b6f 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 _0xaf95=['moment','bluebird','request-promise','rimraf','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger'];(function(_0x394e9f,_0x10b779){var _0x33ad31=function(_0x5f3dfd){while(--_0x5f3dfd){_0x394e9f['push'](_0x394e9f['shift']());}};_0x33ad31(++_0x10b779);}(_0xaf95,0x1cb));var _0x5af9=function(_0x45ce4e,_0x3a367c){_0x45ce4e=_0x45ce4e-0x0;var _0x4a105a=_0xaf95[_0x45ce4e];return _0x4a105a;};'use strict';var _=require(_0x5af9('0x0'));var util=require(_0x5af9('0x1'));var logger=require(_0x5af9('0x2'))('api');var moment=require(_0x5af9('0x3'));var BPromise=require(_0x5af9('0x4'));var rp=require(_0x5af9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5af9('0x6'));var config=require('../../config/environment');var attributes=require(_0x5af9('0x7'));module[_0x5af9('0x8')]=function(_0x2e302a,_0x3beed6){return _0x2e302a['define'](_0x5af9('0x9'),attributes,{'tableName':_0x5af9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20d2=['path','rimraf','../../config/environment','exports','define','UserVoiceQueue','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20d2,0x186));var _0x220d=function(_0x222054,_0x45620f){_0x222054=_0x222054-0x0;var _0x5de492=_0x20d2[_0x222054];return _0x5de492;};'use strict';var _=require(_0x220d('0x0'));var util=require(_0x220d('0x1'));var logger=require(_0x220d('0x2'))(_0x220d('0x3'));var moment=require(_0x220d('0x4'));var BPromise=require('bluebird');var rp=require(_0x220d('0x5'));var fs=require('fs');var path=require(_0x220d('0x6'));var rimraf=require(_0x220d('0x7'));var config=require(_0x220d('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0x220d('0x9')]=function(_0x5c85e7,_0x232340){return _0x5c85e7[_0x220d('0xa')](_0x220d('0xb'),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 018365a..5429855 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 _0x1ef5=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0xd03382,_0x2e3944){var _0xb970e0=function(_0x4010c6){while(--_0x4010c6){_0xd03382['push'](_0xd03382['shift']());}};_0xb970e0(++_0x2e3944);}(_0x1ef5,0xc7));var _0x51ef=function(_0x3e8028,_0x3344ab){_0x3e8028=_0x3e8028-0x0;var _0x5a3363=_0x1ef5[_0x3e8028];return _0x5a3363;};'use strict';var _=require(_0x51ef('0x0'));var util=require(_0x51ef('0x1'));var moment=require('moment');var BPromise=require(_0x51ef('0x2'));var rs=require(_0x51ef('0x3'));var fs=require('fs');var Redis=require(_0x51ef('0x4'));var db=require(_0x51ef('0x5'))['db'];var utils=require(_0x51ef('0x6'));var logger=require('../../config/logger')(_0x51ef('0x7'));var config=require(_0x51ef('0x8'));var jayson=require(_0x51ef('0x9'));var client=jayson[_0x51ef('0xa')][_0x51ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a7b30,_0xa3382,_0x10bc22){return new BPromise(function(_0x4637e3,_0x159f32){return client[_0x51ef('0xc')](_0x2a7b30,_0x10bc22)[_0x51ef('0xd')](function(_0x37824d){logger[_0x51ef('0xe')](_0x51ef('0xf'),_0xa3382,_0x51ef('0x10'));logger['debug'](_0x51ef('0x11'),_0xa3382,_0x51ef('0x10'),JSON[_0x51ef('0x12')](_0x37824d));if(_0x37824d[_0x51ef('0x13')]){if(_0x37824d[_0x51ef('0x13')][_0x51ef('0x14')]===0x1f4){logger[_0x51ef('0x13')](_0x51ef('0xf'),_0xa3382,_0x37824d[_0x51ef('0x13')][_0x51ef('0x15')]);return _0x159f32(_0x37824d[_0x51ef('0x13')][_0x51ef('0x15')]);}logger[_0x51ef('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0xa3382,_0x37824d[_0x51ef('0x13')][_0x51ef('0x15')]);return _0x4637e3(_0x37824d[_0x51ef('0x13')][_0x51ef('0x15')]);}else{logger[_0x51ef('0xe')](_0x51ef('0xf'),_0xa3382,_0x51ef('0x10'));_0x4637e3(_0x37824d[_0x51ef('0x16')][_0x51ef('0x15')]);}})[_0x51ef('0x17')](function(_0x150bca){logger[_0x51ef('0x13')](_0x51ef('0xf'),_0xa3382,_0x150bca);_0x159f32(_0x150bca);});});} \ No newline at end of file +var _0x8dba=['util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash'];(function(_0x27a3cb,_0x4af597){var _0x54ff38=function(_0x3a82d2){while(--_0x3a82d2){_0x27a3cb['push'](_0x27a3cb['shift']());}};_0x54ff38(++_0x4af597);}(_0x8dba,0xaa));var _0xa8db=function(_0x2889ac,_0x347407){_0x2889ac=_0x2889ac-0x0;var _0x2ef9b3=_0x8dba[_0x2889ac];return _0x2ef9b3;};'use strict';var _=require(_0xa8db('0x0'));var util=require(_0xa8db('0x1'));var moment=require('moment');var BPromise=require(_0xa8db('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa8db('0x3'));var db=require(_0xa8db('0x4'))['db'];var utils=require(_0xa8db('0x5'));var logger=require('../../config/logger')(_0xa8db('0x6'));var config=require(_0xa8db('0x7'));var jayson=require(_0xa8db('0x8'));var client=jayson['client'][_0xa8db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd807a8,_0x5e52b9,_0x595f2d){return new BPromise(function(_0x573a42,_0x37d471){return client['request'](_0xd807a8,_0x595f2d)[_0xa8db('0xa')](function(_0x4491d6){logger[_0xa8db('0xb')](_0xa8db('0xc'),_0x5e52b9,_0xa8db('0xd'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5e52b9,'request\x20sent',JSON[_0xa8db('0xe')](_0x4491d6));if(_0x4491d6['error']){if(_0x4491d6['error']['code']===0x1f4){logger[_0xa8db('0xf')](_0xa8db('0xc'),_0x5e52b9,_0x4491d6[_0xa8db('0xf')][_0xa8db('0x10')]);return _0x37d471(_0x4491d6[_0xa8db('0xf')]['message']);}logger[_0xa8db('0xf')](_0xa8db('0xc'),_0x5e52b9,_0x4491d6[_0xa8db('0xf')]['message']);return _0x573a42(_0x4491d6[_0xa8db('0xf')][_0xa8db('0x10')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x5e52b9,_0xa8db('0xd'));_0x573a42(_0x4491d6[_0xa8db('0x11')][_0xa8db('0x10')]);}})[_0xa8db('0x12')](function(_0x4f52a5){logger[_0xa8db('0xf')](_0xa8db('0xc'),_0x5e52b9,_0x4f52a5);_0x37d471(_0x4f52a5);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index e4286de..891f836 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1e6b13,_0x6a943b){var _0x41ace7=function(_0x19c8f1){while(--_0x19c8f1){_0x1e6b13['push'](_0x1e6b13['shift']());}};_0x41ace7(++_0x6a943b);}(_0x70e0,0x17b));var _0x070e=function(_0x3fc3d0,_0x34939e){_0x3fc3d0=_0x3fc3d0-0x0;var _0x290e76=_0x70e0[_0x3fc3d0];return _0x290e76;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3d3531,_0x1e4748){var _0x299781=function(_0x3b90e8){while(--_0x3b90e8){_0x3d3531['push'](_0x3d3531['shift']());}};_0x299781(++_0x1e4748);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 42825a7..f80d634 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 _0xb4ac=['INTEGER','STRING','queue_interface','Required\x20by\x20Asterisk','sequelize','exports'];(function(_0x5b0ac2,_0x5c724c){var _0x10c8ed=function(_0x38ad2a){while(--_0x38ad2a){_0x5b0ac2['push'](_0x5b0ac2['shift']());}};_0x10c8ed(++_0x5c724c);}(_0xb4ac,0x10c));var _0xcb4a=function(_0x58b4b0,_0x45efed){_0x58b4b0=_0x58b4b0-0x0;var _0x2c5f4d=_0xb4ac[_0x58b4b0];return _0x2c5f4d;};'use strict';var Sequelize=require(_0xcb4a('0x0'));module[_0xcb4a('0x1')]={'uniqueid':{'type':Sequelize[_0xcb4a('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xcb4a('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xcb4a('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xcb4a('0x3')],'allowNull':![],'unique':_0xcb4a('0x4'),'comment':_0xcb4a('0x5')},'VoiceQueueId':{'type':Sequelize[_0xcb4a('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcb4a('0x4'),'comment':_0xcb4a('0x5')},'penalty':{'type':Sequelize[_0xcb4a('0x2')](0xb),'defaultValue':0x0,'comment':_0xcb4a('0x5')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xcb4a('0x5')}}; \ No newline at end of file +var _0x034b=['queue_interface','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x4e8047,_0x151df8){var _0x3f438f=function(_0x36e1c5){while(--_0x36e1c5){_0x4e8047['push'](_0x4e8047['shift']());}};_0x3f438f(++_0x151df8);}(_0x034b,0x1b4));var _0xb034=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x034b[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0xb034('0x0')]={'uniqueid':{'type':Sequelize[_0xb034('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xb034('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xb034('0x2')},'UserId':{'type':Sequelize[_0xb034('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xb034('0x3')],'allowNull':![],'unique':_0xb034('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xb034('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xb034('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 476427e..9921e4a 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 _0x0c56=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0c56,0x15d));var _0x60c5=function(_0x33526d,_0x3258ce){_0x33526d=_0x33526d-0x0;var _0x31f39a=_0x0c56[_0x33526d];return _0x31f39a;};'use strict';var EventEmitter=require(_0x60c5('0x0'));var UserVoiceQueueRt=require(_0x60c5('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x60c5('0x2')](0x0);var events={'afterCreate':_0x60c5('0x3'),'afterUpdate':_0x60c5('0x4'),'afterDestroy':_0x60c5('0x5')};function emitEvent(_0x14ffbf){return function(_0x236bc8,_0x570971,_0x2dc8e3){UserVoiceQueueRtEvents[_0x60c5('0x6')](_0x14ffbf+':'+_0x236bc8['id'],_0x236bc8);UserVoiceQueueRtEvents['emit'](_0x14ffbf,_0x236bc8);_0x2dc8e3(null);};}for(var e in events){if(events[_0x60c5('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x60c5('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x8bd4=['setMaxListeners','save','update','emit','hook','exports','UserVoiceQueueRt'];(function(_0x231645,_0x415585){var _0x1d0936=function(_0x35400e){while(--_0x35400e){_0x231645['push'](_0x231645['shift']());}};_0x1d0936(++_0x415585);}(_0x8bd4,0x1db));var _0x48bd=function(_0x34b368,_0xbf8e49){_0x34b368=_0x34b368-0x0;var _0x5e8b61=_0x8bd4[_0x34b368];return _0x5e8b61;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x48bd('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x48bd('0x1')](0x0);var events={'afterCreate':_0x48bd('0x2'),'afterUpdate':_0x48bd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x55bd64){return function(_0x380d70,_0x4a84fb,_0x1f67af){UserVoiceQueueRtEvents['emit'](_0x55bd64+':'+_0x380d70['id'],_0x380d70);UserVoiceQueueRtEvents[_0x48bd('0x4')](_0x55bd64,_0x380d70);_0x1f67af(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x48bd('0x5')](e,emitEvent(event));}}module[_0x48bd('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 69389d0..b1319af 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 _0x3c66=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x4ad558,_0x398e6a){var _0x3cf835=function(_0x36b4f0){while(--_0x36b4f0){_0x4ad558['push'](_0x4ad558['shift']());}};_0x3cf835(++_0x398e6a);}(_0x3c66,0x165));var _0x63c6=function(_0x44fb7a,_0x486eeb){_0x44fb7a=_0x44fb7a-0x0;var _0x44cea9=_0x3c66[_0x44fb7a];return _0x44cea9;};'use strict';var _=require(_0x63c6('0x0'));var util=require('util');var logger=require(_0x63c6('0x1'))(_0x63c6('0x2'));var moment=require(_0x63c6('0x3'));var BPromise=require(_0x63c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63c6('0x5'));var rimraf=require(_0x63c6('0x6'));var config=require(_0x63c6('0x7'));var attributes=require(_0x63c6('0x8'));module['exports']=function(_0x2a3935,_0x1b9011){return _0x2a3935[_0x63c6('0x9')](_0x63c6('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6530=['api','bluebird','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x1c69c1,_0x3ae8a1){var _0x2d93c8=function(_0x484349){while(--_0x484349){_0x1c69c1['push'](_0x1c69c1['shift']());}};_0x2d93c8(++_0x3ae8a1);}(_0x6530,0x116));var _0x0653=function(_0x1f286b,_0x42248a){_0x1f286b=_0x1f286b-0x0;var _0x4fc275=_0x6530[_0x1f286b];return _0x4fc275;};'use strict';var _=require(_0x0653('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0653('0x1'));var moment=require('moment');var BPromise=require(_0x0653('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0653('0x3'));var config=require(_0x0653('0x4'));var attributes=require(_0x0653('0x5'));module[_0x0653('0x6')]=function(_0x5f5132,_0x18ad42){return _0x5f5132['define'](_0x0653('0x7'),attributes,{'tableName':_0x0653('0x8'),'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 679ac71..3ae054f 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 _0xd487=['client','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3ea00b,_0x53df66){var _0x5c620f=function(_0x7ae181){while(--_0x7ae181){_0x3ea00b['push'](_0x3ea00b['shift']());}};_0x5c620f(++_0x53df66);}(_0xd487,0x66));var _0x7d48=function(_0xe51920,_0x4a1092){_0xe51920=_0xe51920-0x0;var _0x4e4c70=_0xd487[_0xe51920];return _0x4e4c70;};'use strict';var _=require(_0x7d48('0x0'));var util=require(_0x7d48('0x1'));var moment=require(_0x7d48('0x2'));var BPromise=require(_0x7d48('0x3'));var rs=require(_0x7d48('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7d48('0x5'))(_0x7d48('0x6'));var config=require(_0x7d48('0x7'));var jayson=require(_0x7d48('0x8'));var client=jayson[_0x7d48('0x9')][_0x7d48('0xa')]({'port':0x232a});config[_0x7d48('0xb')]=_['defaults'](config['redis'],{'host':_0x7d48('0xc'),'port':0x18eb});var socket=require(_0x7d48('0xd'))(new Redis(config[_0x7d48('0xb')]));require(_0x7d48('0xe'))['register'](socket);function respondWithRpcPromise(_0x46e08f,_0x147d20,_0x4bf2e1){return new BPromise(function(_0x16a71c,_0x3e5cfa){return client[_0x7d48('0xf')](_0x46e08f,_0x4bf2e1)[_0x7d48('0x10')](function(_0x140e5d){logger['info'](_0x7d48('0x11'),_0x147d20,_0x7d48('0x12'));logger[_0x7d48('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x147d20,_0x7d48('0x12'),JSON[_0x7d48('0x14')](_0x140e5d));if(_0x140e5d[_0x7d48('0x15')]){if(_0x140e5d[_0x7d48('0x15')][_0x7d48('0x16')]===0x1f4){logger['error'](_0x7d48('0x11'),_0x147d20,_0x140e5d['error']['message']);return _0x3e5cfa(_0x140e5d[_0x7d48('0x15')][_0x7d48('0x17')]);}logger[_0x7d48('0x15')](_0x7d48('0x11'),_0x147d20,_0x140e5d[_0x7d48('0x15')][_0x7d48('0x17')]);return _0x16a71c(_0x140e5d[_0x7d48('0x15')][_0x7d48('0x17')]);}else{logger[_0x7d48('0x18')](_0x7d48('0x11'),_0x147d20,'request\x20sent');_0x16a71c(_0x140e5d[_0x7d48('0x19')][_0x7d48('0x17')]);}})[_0x7d48('0x1a')](function(_0x23c192){logger[_0x7d48('0x15')](_0x7d48('0x11'),_0x147d20,_0x23c192);_0x3e5cfa(_0x23c192);});});}exports['GetVoiceQueueRtPauses']=function(_0x4e7e95){var _0x24e8b8=this;return new Promise(function(_0x76be3,_0x481d65){return db['UserVoiceQueueRt'][_0x7d48('0x1b')]({'raw':_0x4e7e95[_0x7d48('0x1c')]?_0x4e7e95['options'][_0x7d48('0x1d')]===undefined?!![]:![]:!![],'where':_0x4e7e95[_0x7d48('0x1c')]?_0x4e7e95[_0x7d48('0x1c')][_0x7d48('0x1e')]||null:null,'attributes':[[db[_0x7d48('0x1f')]['fn'](_0x7d48('0x20'),db['sequelize']['fn']('IF',db[_0x7d48('0x1f')][_0x7d48('0x21')](_0x7d48('0x22')))),_0x7d48('0x23')]]})[_0x7d48('0x10')](function(_0x454bfe){logger[_0x7d48('0x18')](_0x7d48('0x24'),_0x4e7e95);logger[_0x7d48('0x13')](_0x7d48('0x24'),_0x4e7e95,JSON['stringify'](_0x454bfe));_0x76be3(_0x454bfe);})[_0x7d48('0x1a')](function(_0x401eff){logger[_0x7d48('0x15')](_0x7d48('0x24'),_0x401eff[_0x7d48('0x17')],_0x4e7e95);_0x481d65(_0x24e8b8[_0x7d48('0x15')](0x1f4,_0x401eff[_0x7d48('0x17')]));});});}; \ No newline at end of file +var _0x71ed=['localhost','socket.io-emitter','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x1977f1,_0x19ef5c){var _0x5185ce=function(_0x388d7c){while(--_0x388d7c){_0x1977f1['push'](_0x1977f1['shift']());}};_0x5185ce(++_0x19ef5c);}(_0x71ed,0xaf));var _0xd71e=function(_0x1ee9eb,_0x486aba){_0x1ee9eb=_0x1ee9eb-0x0;var _0x33a2b5=_0x71ed[_0x1ee9eb];return _0x33a2b5;};'use strict';var _=require(_0xd71e('0x0'));var util=require(_0xd71e('0x1'));var moment=require(_0xd71e('0x2'));var BPromise=require(_0xd71e('0x3'));var rs=require(_0xd71e('0x4'));var fs=require('fs');var Redis=require(_0xd71e('0x5'));var db=require(_0xd71e('0x6'))['db'];var utils=require(_0xd71e('0x7'));var logger=require(_0xd71e('0x8'))(_0xd71e('0x9'));var config=require(_0xd71e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xd71e('0xb')][_0xd71e('0xc')]({'port':0x232a});config[_0xd71e('0xd')]=_[_0xd71e('0xe')](config['redis'],{'host':_0xd71e('0xf'),'port':0x18eb});var socket=require(_0xd71e('0x10'))(new Redis(config[_0xd71e('0xd')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x5df618,_0x1bde01,_0x13c434){return new BPromise(function(_0x102145,_0xb6ff71){return client[_0xd71e('0x11')](_0x5df618,_0x13c434)[_0xd71e('0x12')](function(_0x1f683e){logger['info'](_0xd71e('0x13'),_0x1bde01,_0xd71e('0x14'));logger[_0xd71e('0x15')](_0xd71e('0x16'),_0x1bde01,_0xd71e('0x14'),JSON[_0xd71e('0x17')](_0x1f683e));if(_0x1f683e['error']){if(_0x1f683e['error'][_0xd71e('0x18')]===0x1f4){logger[_0xd71e('0x19')](_0xd71e('0x13'),_0x1bde01,_0x1f683e['error'][_0xd71e('0x1a')]);return _0xb6ff71(_0x1f683e[_0xd71e('0x19')][_0xd71e('0x1a')]);}logger[_0xd71e('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1bde01,_0x1f683e[_0xd71e('0x19')][_0xd71e('0x1a')]);return _0x102145(_0x1f683e['error'][_0xd71e('0x1a')]);}else{logger['info'](_0xd71e('0x13'),_0x1bde01,'request\x20sent');_0x102145(_0x1f683e[_0xd71e('0x1b')][_0xd71e('0x1a')]);}})['catch'](function(_0x412d83){logger[_0xd71e('0x19')](_0xd71e('0x13'),_0x1bde01,_0x412d83);_0xb6ff71(_0x412d83);});});}exports[_0xd71e('0x1c')]=function(_0x1cbcc4){var _0x1dc549=this;return new Promise(function(_0x2fafb9,_0x5f1f16){return db[_0xd71e('0x1d')][_0xd71e('0x1e')]({'raw':_0x1cbcc4[_0xd71e('0x1f')]?_0x1cbcc4['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cbcc4['options']?_0x1cbcc4[_0xd71e('0x1f')]['where']||null:null,'attributes':[[db[_0xd71e('0x20')]['fn'](_0xd71e('0x21'),db[_0xd71e('0x20')]['fn']('IF',db[_0xd71e('0x20')][_0xd71e('0x22')](_0xd71e('0x23')))),'outboundQueuePauses']]})[_0xd71e('0x12')](function(_0x461d97){logger[_0xd71e('0x24')](_0xd71e('0x1c'),_0x1cbcc4);logger[_0xd71e('0x15')](_0xd71e('0x1c'),_0x1cbcc4,JSON['stringify'](_0x461d97));_0x2fafb9(_0x461d97);})[_0xd71e('0x25')](function(_0x1ea45d){logger[_0xd71e('0x19')](_0xd71e('0x1c'),_0x1ea45d[_0xd71e('0x1a')],_0x1cbcc4);_0x5f1f16(_0x1dc549[_0xd71e('0x19')](0x1f4,_0x1ea45d[_0xd71e('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index dc3f034..93f1c7f 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 _0x8375=['userVoiceQueueRt:','save','remove','update','register'];(function(_0x5bc411,_0x43f76d){var _0x41c153=function(_0x4a7251){while(--_0x4a7251){_0x5bc411['push'](_0x5bc411['shift']());}};_0x41c153(++_0x43f76d);}(_0x8375,0x132));var _0x5837=function(_0x50033b,_0x3b4078){_0x50033b=_0x50033b-0x0;var _0xb5803d=_0x8375[_0x50033b];return _0xb5803d;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x5837('0x0'),_0x5837('0x1'),_0x5837('0x2')];function createListener(_0x1fb900,_0x3bd795){return function(_0x144751){_0x3bd795['emit'](_0x1fb900,_0x144751);};}function removeListener(_0x2ddfc1,_0x110a7d){return function(){UserVoiceQueueRtEvents['removeListener'](_0x2ddfc1,_0x110a7d);};}exports[_0x5837('0x3')]=function(_0x438491){for(var _0x21c9bd=0x0,_0x1e0d00=events['length'];_0x21c9bd<_0x1e0d00;_0x21c9bd++){var _0x23454c=events[_0x21c9bd];var _0x1f4f78=createListener(_0x5837('0x4')+_0x23454c,_0x438491);UserVoiceQueueRtEvents['on'](_0x23454c,_0x1f4f78);}}; \ No newline at end of file +var _0x908e=['emit','length','./userVoiceQueueRt.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x908e,0x182));var _0xe908=function(_0x4ccb06,_0x1980d4){_0x4ccb06=_0x4ccb06-0x0;var _0x39f3c5=_0x908e[_0x4ccb06];return _0x39f3c5;};'use strict';var UserVoiceQueueRtEvents=require(_0xe908('0x0'));var events=[_0xe908('0x1'),'remove','update'];function createListener(_0x380c86,_0x2d374a){return function(_0x1b6093){_0x2d374a[_0xe908('0x2')](_0x380c86,_0x1b6093);};}function removeListener(_0x4c2cdb,_0x46a00d){return function(){UserVoiceQueueRtEvents['removeListener'](_0x4c2cdb,_0x46a00d);};}exports['register']=function(_0x448267){for(var _0x27b216=0x0,_0x2df114=events[_0xe908('0x3')];_0x27b216<_0x2df114;_0x27b216++){var _0x7a1fdd=events[_0x27b216];var _0x6e8920=createListener('userVoiceQueueRt:'+_0x7a1fdd,_0x448267);UserVoiceQueueRtEvents['on'](_0x7a1fdd,_0x6e8920);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 76f1946..8c6937e 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x4a76fa,_0x1f3e84){var _0x12f356=function(_0x36991a){while(--_0x36991a){_0x4a76fa['push'](_0x4a76fa['shift']());}};_0x12f356(++_0x1f3e84);}(_0xedd9,0xfc));var _0x9edd=function(_0x33a78c,_0x55f525){_0x33a78c=_0x33a78c-0x0;var _0x400259=_0xedd9[_0x33a78c];return _0x400259;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x16c254,_0x556653){var _0x39ad40=function(_0x50f260){while(--_0x50f260){_0x16c254['push'](_0x16c254['shift']());}};_0x39ad40(++_0x556653);}(_0x70e0,0x17b));var _0x070e=function(_0x445949,_0x240d7a){_0x445949=_0x445949-0x0;var _0x542b20=_0x70e0[_0x445949];return _0x542b20;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 3cba003..3b31ffa 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 _0xb3a7=['sequelize','INTEGER'];(function(_0x3a1b47,_0x13d438){var _0x4c94f6=function(_0x4de678){while(--_0x4de678){_0x3a1b47['push'](_0x3a1b47['shift']());}};_0x4c94f6(++_0x13d438);}(_0xb3a7,0xaa));var _0x7b3a=function(_0x3e478a,_0x36e3d7){_0x3e478a=_0x3e478a-0x0;var _0x2a05d9=_0xb3a7[_0x3e478a];return _0x2a05d9;};'use strict';var Sequelize=require(_0x7b3a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7b3a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8910=['exports','INTEGER','sequelize'];(function(_0x1f66ce,_0x50133a){var _0x5a6489=function(_0x545150){while(--_0x545150){_0x1f66ce['push'](_0x1f66ce['shift']());}};_0x5a6489(++_0x50133a);}(_0x8910,0xc8));var _0x0891=function(_0x292911,_0x279a2e){_0x292911=_0x292911-0x0;var _0x18dee9=_0x8910[_0x292911];return _0x18dee9;};'use strict';var Sequelize=require(_0x0891('0x0'));module[_0x0891('0x1')]={'penalty':{'type':Sequelize[_0x0891('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 98d6d70..7facd4e 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 _0x2ebb=['define','UserWhatsappQueue','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes'];(function(_0x4edb99,_0x598090){var _0x428be2=function(_0x6cb902){while(--_0x6cb902){_0x4edb99['push'](_0x4edb99['shift']());}};_0x428be2(++_0x598090);}(_0x2ebb,0x17e));var _0xb2eb=function(_0x2e7e5a,_0x2d6289){_0x2e7e5a=_0x2e7e5a-0x0;var _0x170faa=_0x2ebb[_0x2e7e5a];return _0x170faa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb2eb('0x0'))(_0xb2eb('0x1'));var moment=require(_0xb2eb('0x2'));var BPromise=require(_0xb2eb('0x3'));var rp=require(_0xb2eb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb2eb('0x5'));var config=require(_0xb2eb('0x6'));var attributes=require(_0xb2eb('0x7'));module['exports']=function(_0x2403ca,_0x15c1c3){return _0x2403ca[_0xb2eb('0x8')](_0xb2eb('0x9'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x686a=['rimraf','../../config/environment','user_has_whatsapp_queues','lodash','util','api','moment','request-promise','path'];(function(_0x72083a,_0x3d62fb){var _0x45de8f=function(_0x1d4bae){while(--_0x1d4bae){_0x72083a['push'](_0x72083a['shift']());}};_0x45de8f(++_0x3d62fb);}(_0x686a,0x162));var _0xa686=function(_0x476b5f,_0x1f9952){_0x476b5f=_0x476b5f-0x0;var _0x5a23d8=_0x686a[_0x476b5f];return _0x5a23d8;};'use strict';var _=require(_0xa686('0x0'));var util=require(_0xa686('0x1'));var logger=require('../../config/logger')(_0xa686('0x2'));var moment=require(_0xa686('0x3'));var BPromise=require('bluebird');var rp=require(_0xa686('0x4'));var fs=require('fs');var path=require(_0xa686('0x5'));var rimraf=require(_0xa686('0x6'));var config=require(_0xa686('0x7'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x2974e6,_0x33283e){return _0x2974e6['define']('UserWhatsappQueue',attributes,{'tableName':_0xa686('0x8'),'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 f73951f..2ea4f91 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 _0x1c4e=['request\x20sent','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','catch','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x29001c,_0x524f18){var _0x5ee4c1=function(_0x18f43a){while(--_0x18f43a){_0x29001c['push'](_0x29001c['shift']());}};_0x5ee4c1(++_0x524f18);}(_0x1c4e,0x133));var _0xe1c4=function(_0x536869,_0x2128d8){_0x536869=_0x536869-0x0;var _0x2746f3=_0x1c4e[_0x536869];return _0x2746f3;};'use strict';var _=require('lodash');var util=require(_0xe1c4('0x0'));var moment=require(_0xe1c4('0x1'));var BPromise=require('bluebird');var rs=require(_0xe1c4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe1c4('0x3'));var logger=require('../../config/logger')(_0xe1c4('0x4'));var config=require(_0xe1c4('0x5'));var jayson=require(_0xe1c4('0x6'));var client=jayson[_0xe1c4('0x7')][_0xe1c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e02c7,_0x4ce065,_0x4736c0){return new BPromise(function(_0x3f17fd,_0x4d100a){return client['request'](_0x5e02c7,_0x4736c0)[_0xe1c4('0x9')](function(_0x40dd98){logger[_0xe1c4('0xa')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4ce065,'request\x20sent');logger[_0xe1c4('0xb')](_0xe1c4('0xc'),_0x4ce065,_0xe1c4('0xd'),JSON[_0xe1c4('0xe')](_0x40dd98));if(_0x40dd98[_0xe1c4('0xf')]){if(_0x40dd98[_0xe1c4('0xf')][_0xe1c4('0x10')]===0x1f4){logger[_0xe1c4('0xf')](_0xe1c4('0x11'),_0x4ce065,_0x40dd98[_0xe1c4('0xf')]['message']);return _0x4d100a(_0x40dd98[_0xe1c4('0xf')][_0xe1c4('0x12')]);}logger[_0xe1c4('0xf')](_0xe1c4('0x11'),_0x4ce065,_0x40dd98[_0xe1c4('0xf')]['message']);return _0x3f17fd(_0x40dd98['error']['message']);}else{logger['info'](_0xe1c4('0x11'),_0x4ce065,'request\x20sent');_0x3f17fd(_0x40dd98['result'][_0xe1c4('0x12')]);}})[_0xe1c4('0x13')](function(_0x2fb0e7){logger[_0xe1c4('0xf')](_0xe1c4('0x11'),_0x4ce065,_0x2fb0e7);_0x4d100a(_0x2fb0e7);});});} \ No newline at end of file +var _0x90e3=['code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x13dc4b,_0x4635e8){var _0x25626d=function(_0x21b6e1){while(--_0x21b6e1){_0x13dc4b['push'](_0x13dc4b['shift']());}};_0x25626d(++_0x4635e8);}(_0x90e3,0xcc));var _0x390e=function(_0x89ace6,_0x39064b){_0x89ace6=_0x89ace6-0x0;var _0x302694=_0x90e3[_0x89ace6];return _0x302694;};'use strict';var _=require('lodash');var util=require(_0x390e('0x0'));var moment=require(_0x390e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x390e('0x2'));var db=require(_0x390e('0x3'))['db'];var utils=require(_0x390e('0x4'));var logger=require(_0x390e('0x5'))(_0x390e('0x6'));var config=require(_0x390e('0x7'));var jayson=require(_0x390e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41c8d1,_0x2d2bf0,_0x1734b1){return new BPromise(function(_0x59aa3b,_0x54f1db){return client[_0x390e('0x9')](_0x41c8d1,_0x1734b1)['then'](function(_0x2e70ac){logger[_0x390e('0xa')](_0x390e('0xb'),_0x2d2bf0,'request\x20sent');logger[_0x390e('0xc')](_0x390e('0xd'),_0x2d2bf0,_0x390e('0xe'),JSON['stringify'](_0x2e70ac));if(_0x2e70ac['error']){if(_0x2e70ac[_0x390e('0xf')][_0x390e('0x10')]===0x1f4){logger[_0x390e('0xf')](_0x390e('0xb'),_0x2d2bf0,_0x2e70ac[_0x390e('0xf')][_0x390e('0x11')]);return _0x54f1db(_0x2e70ac['error'][_0x390e('0x11')]);}logger['error'](_0x390e('0xb'),_0x2d2bf0,_0x2e70ac[_0x390e('0xf')][_0x390e('0x11')]);return _0x59aa3b(_0x2e70ac[_0x390e('0xf')][_0x390e('0x11')]);}else{logger[_0x390e('0xa')](_0x390e('0xb'),_0x2d2bf0,_0x390e('0xe'));_0x59aa3b(_0x2e70ac[_0x390e('0x12')][_0x390e('0x11')]);}})[_0x390e('0x13')](function(_0x5ab1a1){logger[_0x390e('0xf')](_0x390e('0xb'),_0x2d2bf0,_0x5ab1a1);_0x54f1db(_0x5ab1a1);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index bb90edd..270fef6 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 _0x62c8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','path','Router','fs-extra'];(function(_0x4b5edc,_0x31c291){var _0x16a44b=function(_0x4669fe){while(--_0x4669fe){_0x4b5edc['push'](_0x4b5edc['shift']());}};_0x16a44b(++_0x31c291);}(_0x62c8,0x1ad));var _0x862c=function(_0xbbf661,_0x5ac5d1){_0xbbf661=_0xbbf661-0x0;var _0x447719=_0x62c8[_0xbbf661];return _0x447719;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x862c('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x862c('0x1')]();var fs_extra=require(_0x862c('0x2'));var auth=require(_0x862c('0x3'));var interaction=require(_0x862c('0x4'));var config=require(_0x862c('0x5'));var controller=require(_0x862c('0x6'));router['get']('/',auth[_0x862c('0x7')](),controller[_0x862c('0x8')]);router[_0x862c('0x9')](_0x862c('0xa'),auth[_0x862c('0x7')](),controller[_0x862c('0xb')]);router[_0x862c('0xc')]('/',auth[_0x862c('0x7')](),controller[_0x862c('0xd')]);router[_0x862c('0xe')](_0x862c('0xa'),auth['isAuthenticated'](),controller[_0x862c('0xf')]);router[_0x862c('0x10')](_0x862c('0xa'),auth[_0x862c('0x7')](),controller[_0x862c('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb377=['update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','show','post','isAuthenticated','create','put','/:id'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xb377,0x1b6));var _0x7b37=function(_0x102b99,_0x19c6ed){_0x102b99=_0x102b99-0x0;var _0x39bff9=_0xb377[_0x102b99];return _0x39bff9;};'use strict';var multer=require(_0x7b37('0x0'));var util=require(_0x7b37('0x1'));var path=require(_0x7b37('0x2'));var timeout=require(_0x7b37('0x3'));var express=require(_0x7b37('0x4'));var router=express[_0x7b37('0x5')]();var fs_extra=require(_0x7b37('0x6'));var auth=require(_0x7b37('0x7'));var interaction=require(_0x7b37('0x8'));var config=require(_0x7b37('0x9'));var controller=require(_0x7b37('0xa'));router[_0x7b37('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b37('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7b37('0xc')]);router[_0x7b37('0xd')]('/',auth[_0x7b37('0xe')](),controller[_0x7b37('0xf')]);router[_0x7b37('0x10')](_0x7b37('0x11'),auth[_0x7b37('0xe')](),controller[_0x7b37('0x12')]);router['delete'](_0x7b37('0x11'),auth[_0x7b37('0xe')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 8928a99..1e5cb44 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 _0xa063=['sequelize','exports','STRING','name'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xa063,0x100));var _0x3a06=function(_0x2becce,_0x1d205f){_0x2becce=_0x2becce-0x0;var _0x19b9fe=_0xa063[_0x2becce];return _0x19b9fe;};'use strict';var Sequelize=require(_0x3a06('0x0'));module[_0x3a06('0x1')]={'name':{'type':Sequelize[_0x3a06('0x2')],'unique':_0x3a06('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd011=['sequelize','STRING'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xd011,0x156));var _0x1d01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd011[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1d01('0x0'));module['exports']={'name':{'type':Sequelize[_0x1d01('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1d01('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 6280031..ddc6dfb 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 _0x47fd=['includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','stack','name','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0x47fd,0x64));var _0xd47f=function(_0x19cb5a,_0x583fbd){_0x19cb5a=_0x19cb5a-0x0;var _0x9b2f0f=_0x47fd[_0x19cb5a];return _0x9b2f0f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd47f('0x0'));var jsonpatch=require(_0xd47f('0x1'));var rp=require(_0xd47f('0x2'));var moment=require(_0xd47f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd47f('0x4'));var util=require(_0xd47f('0x5'));var path=require(_0xd47f('0x6'));var sox=require(_0xd47f('0x7'));var csv=require('to-csv');var ejs=require(_0xd47f('0x8'));var fs=require('fs');var fs_extra=require(_0xd47f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd47f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd47f('0xb'));var toCsv=require(_0xd47f('0xc'));var querystring=require('querystring');var Papa=require(_0xd47f('0xd'));var Redis=require(_0xd47f('0xe'));var authService=require(_0xd47f('0xf'));var qs=require(_0xd47f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd47f('0x11'))(_0xd47f('0x12'));var utils=require(_0xd47f('0x13'));var config=require(_0xd47f('0x14'));var licenseUtil=require(_0xd47f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x111e6c,_0x54d95b){_0x54d95b=_0x54d95b||0xcc;return function(_0x2c7050){if(_0x2c7050){return _0x111e6c[_0xd47f('0x16')](_0x54d95b);}return _0x111e6c[_0xd47f('0x17')](_0x54d95b)[_0xd47f('0x18')]();};}function respondWithResult(_0xb38926,_0x4d4f74){_0x4d4f74=_0x4d4f74||0xc8;return function(_0x1f1fb1){if(_0x1f1fb1){return _0xb38926[_0xd47f('0x17')](_0x4d4f74)['json'](_0x1f1fb1);}};}function respondWithFilteredResult(_0xd281d0,_0x545ddd){return function(_0x14a4e2){if(_0x14a4e2){var _0x1aee60=typeof _0x545ddd[_0xd47f('0x19')]===_0xd47f('0x1a')&&typeof _0x545ddd[_0xd47f('0x1b')]==='undefined';var _0x20d06d=_0x14a4e2[_0xd47f('0x1c')];var _0x2bdf1f=_0x1aee60?0x0:_0x545ddd[_0xd47f('0x19')];var _0x3a31b5=_0x1aee60?_0x14a4e2[_0xd47f('0x1c')]:_0x545ddd['offset']+_0x545ddd['limit'];var _0x4ea4a5;if(_0x3a31b5>=_0x20d06d){_0x3a31b5=_0x20d06d;_0x4ea4a5=0xc8;}else{_0x4ea4a5=0xce;}_0xd281d0[_0xd47f('0x17')](_0x4ea4a5);return _0xd281d0[_0xd47f('0x1d')](_0xd47f('0x1e'),_0x2bdf1f+'-'+_0x3a31b5+'/'+_0x20d06d)[_0xd47f('0x1f')](_0x14a4e2);}return null;};}function patchUpdates(_0x521afc){return function(_0x392a7a){try{jsonpatch[_0xd47f('0x20')](_0x392a7a,_0x521afc,!![]);}catch(_0x5dc9ad){return BPromise[_0xd47f('0x21')](_0x5dc9ad);}return _0x392a7a[_0xd47f('0x22')]();};}function saveUpdates(_0x2dbc9c,_0x50471b){return function(_0x1adb51){if(_0x1adb51){return _0x1adb51[_0xd47f('0x23')](_0x2dbc9c)[_0xd47f('0x24')](function(_0xc5c469){return _0xc5c469;});}return null;};}function removeEntity(_0x5138c5,_0x11c320){return function(_0x2157c0){if(_0x2157c0){return _0x2157c0[_0xd47f('0x25')]()[_0xd47f('0x24')](function(){var _0x17b149=_0x2157c0[_0xd47f('0x26')]({'plain':!![]});var _0x32c075=_0xd47f('0x27');return db[_0xd47f('0x28')][_0xd47f('0x25')]({'where':{'type':_0x32c075,'resourceId':_0x17b149['id']}})[_0xd47f('0x24')](function(){return _0x2157c0;});})[_0xd47f('0x24')](function(){_0x5138c5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45f928,_0x5e0015){return function(_0x1da07b){if(!_0x1da07b){_0x45f928[_0xd47f('0x16')](0x194);}return _0x1da07b;};}function handleError(_0x5bd567,_0x295c28){_0x295c28=_0x295c28||0x1f4;return function(_0x13d18c){logger['error'](_0x13d18c[_0xd47f('0x29')]);if(_0x13d18c[_0xd47f('0x2a')]){delete _0x13d18c['name'];}_0x5bd567['status'](_0x295c28)['send'](_0x13d18c);};}exports[_0xd47f('0x2b')]=function(_0x3b4b5b,_0x20468a){var _0x1ffc70={},_0x20f858={},_0x29b3a6={'count':0x0,'rows':[]};var _0x5a50f9=_[_0xd47f('0x2c')](db[_0xd47f('0x2d')][_0xd47f('0x2e')],function(_0x44e13f){return{'name':_0x44e13f[_0xd47f('0x2f')],'type':_0x44e13f[_0xd47f('0x30')][_0xd47f('0x31')]};});_0x20f858[_0xd47f('0x32')]=_['map'](_0x5a50f9,_0xd47f('0x2a'));_0x20f858[_0xd47f('0x33')]=_[_0xd47f('0x34')](_0x3b4b5b[_0xd47f('0x33')]);_0x20f858[_0xd47f('0x35')]=_[_0xd47f('0x36')](_0x20f858[_0xd47f('0x32')],_0x20f858[_0xd47f('0x33')]);_0x1ffc70['attributes']=_['intersection'](_0x20f858['model'],qs[_0xd47f('0x37')](_0x3b4b5b[_0xd47f('0x33')][_0xd47f('0x37')]));_0x1ffc70[_0xd47f('0x38')]=_0x1ffc70['attributes'][_0xd47f('0x39')]?_0x1ffc70[_0xd47f('0x38')]:_0x20f858[_0xd47f('0x32')];if(!_0x3b4b5b[_0xd47f('0x33')][_0xd47f('0x3a')](_0xd47f('0x3b'))){_0x1ffc70[_0xd47f('0x1b')]=qs[_0xd47f('0x1b')](_0x3b4b5b[_0xd47f('0x33')]['limit']);_0x1ffc70[_0xd47f('0x19')]=qs[_0xd47f('0x19')](_0x3b4b5b[_0xd47f('0x33')][_0xd47f('0x19')]);}_0x1ffc70[_0xd47f('0x3c')]=qs[_0xd47f('0x3d')](_0x3b4b5b[_0xd47f('0x33')][_0xd47f('0x3d')]);_0x1ffc70[_0xd47f('0x3e')]=qs[_0xd47f('0x35')](_[_0xd47f('0x3f')](_0x3b4b5b[_0xd47f('0x33')],_0x20f858[_0xd47f('0x35')]),_0x5a50f9);if(_0x3b4b5b[_0xd47f('0x33')][_0xd47f('0x40')]){_0x1ffc70[_0xd47f('0x3e')]=_[_0xd47f('0x41')](_0x1ffc70[_0xd47f('0x3e')],{'$or':_[_0xd47f('0x2c')](_0x5a50f9,function(_0x81e526){if(_0x81e526['type']!==_0xd47f('0x42')){var _0x20365e={};_0x20365e[_0x81e526['name']]={'$like':'%'+_0x3b4b5b[_0xd47f('0x33')][_0xd47f('0x40')]+'%'};return _0x20365e;}})});}_0x1ffc70=_[_0xd47f('0x41')]({},_0x1ffc70,_0x3b4b5b[_0xd47f('0x43')]);var _0x5c03dd={'where':_0x1ffc70['where']};return db[_0xd47f('0x2d')][_0xd47f('0x1c')](_0x5c03dd)['then'](function(_0x125593){_0x29b3a6['count']=_0x125593;if(_0x3b4b5b[_0xd47f('0x33')][_0xd47f('0x44')]){_0x1ffc70[_0xd47f('0x45')]=[{'all':!![]}];}return db[_0xd47f('0x2d')][_0xd47f('0x46')](_0x1ffc70);})['then'](function(_0x314efa){_0x29b3a6['rows']=_0x314efa;return _0x29b3a6;})[_0xd47f('0x24')](respondWithFilteredResult(_0x20468a,_0x1ffc70))[_0xd47f('0x47')](handleError(_0x20468a,null));};exports[_0xd47f('0x48')]=function(_0xd1c60f,_0xc481f4){var _0x193115={'raw':!![],'where':{'id':_0xd1c60f[_0xd47f('0x49')]['id']}},_0x475aa5={};_0x475aa5[_0xd47f('0x32')]=_[_0xd47f('0x34')](db[_0xd47f('0x2d')][_0xd47f('0x2e')]);_0x475aa5[_0xd47f('0x33')]=_[_0xd47f('0x34')](_0xd1c60f['query']);_0x475aa5['filters']=_[_0xd47f('0x36')](_0x475aa5[_0xd47f('0x32')],_0x475aa5[_0xd47f('0x33')]);_0x193115[_0xd47f('0x38')]=_[_0xd47f('0x36')](_0x475aa5[_0xd47f('0x32')],qs['fields'](_0xd1c60f[_0xd47f('0x33')]['fields']));_0x193115['attributes']=_0x193115[_0xd47f('0x38')][_0xd47f('0x39')]?_0x193115[_0xd47f('0x38')]:_0x475aa5[_0xd47f('0x32')];if(_0xd1c60f[_0xd47f('0x33')][_0xd47f('0x44')]){_0x193115[_0xd47f('0x45')]=[{'all':!![]}];}_0x193115=_[_0xd47f('0x41')]({},_0x193115,_0xd1c60f[_0xd47f('0x43')]);return db[_0xd47f('0x2d')][_0xd47f('0x4a')](_0x193115)['then'](handleEntityNotFound(_0xc481f4,null))[_0xd47f('0x24')](respondWithResult(_0xc481f4,null))[_0xd47f('0x47')](handleError(_0xc481f4,null));};exports['create']=function(_0x4bc1e2,_0x4c91c2){return db[_0xd47f('0x2d')][_0xd47f('0x4b')](_0x4bc1e2[_0xd47f('0x4c')],{})[_0xd47f('0x24')](function(_0x15be6a){var _0x330748=_0x4bc1e2['user'][_0xd47f('0x26')]({'plain':!![]});if(!_0x330748)throw new Error(_0xd47f('0x4d'));if(_0x330748[_0xd47f('0x4e')]===_0xd47f('0x4f')){var _0x53005d=_0x15be6a[_0xd47f('0x26')]({'plain':!![]});var _0x3094ec=_0xd47f('0x27');return db[_0xd47f('0x50')][_0xd47f('0x4a')]({'where':{'name':_0x3094ec,'userProfileId':_0x330748[_0xd47f('0x51')]},'raw':!![]})[_0xd47f('0x24')](function(_0x440a11){if(_0x440a11&&_0x440a11['autoAssociation']===0x0){return db['UserProfileResource'][_0xd47f('0x4b')]({'name':_0x53005d[_0xd47f('0x2a')],'resourceId':_0x53005d['id'],'type':_0x440a11[_0xd47f('0x2a')],'sectionId':_0x440a11['id']},{})[_0xd47f('0x24')](function(){return _0x15be6a;});}else{return _0x15be6a;}})[_0xd47f('0x47')](function(_0xb89f73){logger[_0xd47f('0x52')](_0xd47f('0x53'),_0xb89f73);throw _0xb89f73;});}return _0x15be6a;})['then'](respondWithResult(_0x4c91c2,0xc9))[_0xd47f('0x47')](handleError(_0x4c91c2,null));};exports[_0xd47f('0x23')]=function(_0x30d2c1,_0xd0b280){if(_0x30d2c1[_0xd47f('0x4c')]['id']){delete _0x30d2c1[_0xd47f('0x4c')]['id'];}return db[_0xd47f('0x2d')][_0xd47f('0x4a')]({'where':{'id':_0x30d2c1[_0xd47f('0x49')]['id']}})['then'](handleEntityNotFound(_0xd0b280,null))[_0xd47f('0x24')](saveUpdates(_0x30d2c1['body'],null))[_0xd47f('0x24')](respondWithResult(_0xd0b280,null))['catch'](handleError(_0xd0b280,null));};exports[_0xd47f('0x25')]=function(_0x4ee921,_0x345459){return db[_0xd47f('0x2d')]['find']({'where':{'id':_0x4ee921[_0xd47f('0x49')]['id']}})[_0xd47f('0x24')](handleEntityNotFound(_0x345459,null))[_0xd47f('0x24')](removeEntity(_0x345459,null))['catch'](handleError(_0x345459,null));}; \ No newline at end of file +var _0xa72e=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','reject','save','update','destroy','then','get','Variables','UserProfileResource','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','count','includeAll','include','findAll','rows','catch','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto'];(function(_0x2e0a25,_0x2da7a6){var _0x359873=function(_0x47fb4b){while(--_0x47fb4b){_0x2e0a25['push'](_0x2e0a25['shift']());}};_0x359873(++_0x2da7a6);}(_0xa72e,0x95));var _0xea72=function(_0x28015c,_0x1bfa10){_0x28015c=_0x28015c-0x0;var _0x515597=_0xa72e[_0x28015c];return _0x515597;};'use strict';var emlformat=require(_0xea72('0x0'));var rimraf=require(_0xea72('0x1'));var zipdir=require(_0xea72('0x2'));var jsonpatch=require(_0xea72('0x3'));var rp=require(_0xea72('0x4'));var moment=require(_0xea72('0x5'));var BPromise=require(_0xea72('0x6'));var Mustache=require(_0xea72('0x7'));var util=require('util');var path=require(_0xea72('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xea72('0x9'));var fs=require('fs');var fs_extra=require(_0xea72('0xa'));var _=require(_0xea72('0xb'));var squel=require('squel');var crypto=require(_0xea72('0xc'));var jsforce=require(_0xea72('0xd'));var deskjs=require(_0xea72('0xe'));var toCsv=require(_0xea72('0xf'));var querystring=require(_0xea72('0x10'));var Papa=require(_0xea72('0x11'));var Redis=require(_0xea72('0x12'));var authService=require(_0xea72('0x13'));var qs=require(_0xea72('0x14'));var as=require(_0xea72('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea72('0x16'))(_0xea72('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xea72('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdafbcd,_0x14270a){_0x14270a=_0x14270a||0xcc;return function(_0x591f4f){if(_0x591f4f){return _0xdafbcd[_0xea72('0x19')](_0x14270a);}return _0xdafbcd[_0xea72('0x1a')](_0x14270a)[_0xea72('0x1b')]();};}function respondWithResult(_0x1c8c67,_0x1d42c3){_0x1d42c3=_0x1d42c3||0xc8;return function(_0x271c2a){if(_0x271c2a){return _0x1c8c67[_0xea72('0x1a')](_0x1d42c3)[_0xea72('0x1c')](_0x271c2a);}};}function respondWithFilteredResult(_0x3a9a6c,_0xf4f4bd){return function(_0x488c2f){if(_0x488c2f){var _0x493f00=typeof _0xf4f4bd[_0xea72('0x1d')]===_0xea72('0x1e')&&typeof _0xf4f4bd[_0xea72('0x1f')]===_0xea72('0x1e');var _0x2f6486=_0x488c2f['count'];var _0xf8a8e8=_0x493f00?0x0:_0xf4f4bd['offset'];var _0x32a78a=_0x493f00?_0x488c2f['count']:_0xf4f4bd[_0xea72('0x1d')]+_0xf4f4bd[_0xea72('0x1f')];var _0x315e72;if(_0x32a78a>=_0x2f6486){_0x32a78a=_0x2f6486;_0x315e72=0xc8;}else{_0x315e72=0xce;}_0x3a9a6c[_0xea72('0x1a')](_0x315e72);return _0x3a9a6c[_0xea72('0x20')]('Content-Range',_0xf8a8e8+'-'+_0x32a78a+'/'+_0x2f6486)['json'](_0x488c2f);}return null;};}function patchUpdates(_0x32f91f){return function(_0x500ae8){try{jsonpatch['apply'](_0x500ae8,_0x32f91f,!![]);}catch(_0x430948){return BPromise[_0xea72('0x21')](_0x430948);}return _0x500ae8[_0xea72('0x22')]();};}function saveUpdates(_0x55586e,_0x1d86e1){return function(_0x41aecc){if(_0x41aecc){return _0x41aecc[_0xea72('0x23')](_0x55586e)['then'](function(_0x290f23){return _0x290f23;});}return null;};}function removeEntity(_0x3df2b2,_0x3ccc17){return function(_0x159ee1){if(_0x159ee1){return _0x159ee1[_0xea72('0x24')]()[_0xea72('0x25')](function(){var _0x5cb70d=_0x159ee1[_0xea72('0x26')]({'plain':!![]});var _0x2a4fbd=_0xea72('0x27');return db[_0xea72('0x28')][_0xea72('0x24')]({'where':{'type':_0x2a4fbd,'resourceId':_0x5cb70d['id']}})[_0xea72('0x25')](function(){return _0x159ee1;});})[_0xea72('0x25')](function(){_0x3df2b2['status'](0xcc)[_0xea72('0x1b')]();});}};}function handleEntityNotFound(_0x42d2b0,_0x5ca26e){return function(_0x519a76){if(!_0x519a76){_0x42d2b0[_0xea72('0x19')](0x194);}return _0x519a76;};}function handleError(_0x5306fe,_0x5d4a1f){_0x5d4a1f=_0x5d4a1f||0x1f4;return function(_0x7794f6){logger[_0xea72('0x29')](_0x7794f6[_0xea72('0x2a')]);if(_0x7794f6[_0xea72('0x2b')]){delete _0x7794f6[_0xea72('0x2b')];}_0x5306fe[_0xea72('0x1a')](_0x5d4a1f)[_0xea72('0x2c')](_0x7794f6);};}exports[_0xea72('0x2d')]=function(_0x1cba1d,_0x38cc5c){var _0x42de8a={},_0x599509={},_0x299b4a={'count':0x0,'rows':[]};var _0x2bc4d7=_[_0xea72('0x2e')](db[_0xea72('0x2f')][_0xea72('0x30')],function(_0x190341){return{'name':_0x190341[_0xea72('0x31')],'type':_0x190341['type']['key']};});_0x599509[_0xea72('0x32')]=_['map'](_0x2bc4d7,'name');_0x599509[_0xea72('0x33')]=_[_0xea72('0x34')](_0x1cba1d[_0xea72('0x33')]);_0x599509[_0xea72('0x35')]=_[_0xea72('0x36')](_0x599509[_0xea72('0x32')],_0x599509[_0xea72('0x33')]);_0x42de8a[_0xea72('0x37')]=_['intersection'](_0x599509[_0xea72('0x32')],qs[_0xea72('0x38')](_0x1cba1d[_0xea72('0x33')][_0xea72('0x38')]));_0x42de8a[_0xea72('0x37')]=_0x42de8a['attributes'][_0xea72('0x39')]?_0x42de8a['attributes']:_0x599509[_0xea72('0x32')];if(!_0x1cba1d['query'][_0xea72('0x3a')](_0xea72('0x3b'))){_0x42de8a[_0xea72('0x1f')]=qs[_0xea72('0x1f')](_0x1cba1d[_0xea72('0x33')][_0xea72('0x1f')]);_0x42de8a[_0xea72('0x1d')]=qs[_0xea72('0x1d')](_0x1cba1d[_0xea72('0x33')][_0xea72('0x1d')]);}_0x42de8a[_0xea72('0x3c')]=qs[_0xea72('0x3d')](_0x1cba1d[_0xea72('0x33')][_0xea72('0x3d')]);_0x42de8a['where']=qs[_0xea72('0x35')](_[_0xea72('0x3e')](_0x1cba1d[_0xea72('0x33')],_0x599509[_0xea72('0x35')]),_0x2bc4d7);if(_0x1cba1d['query']['filter']){_0x42de8a[_0xea72('0x3f')]=_[_0xea72('0x40')](_0x42de8a[_0xea72('0x3f')],{'$or':_[_0xea72('0x2e')](_0x2bc4d7,function(_0x2c0f01){if(_0x2c0f01[_0xea72('0x41')]!=='VIRTUAL'){var _0x72aad4={};_0x72aad4[_0x2c0f01['name']]={'$like':'%'+_0x1cba1d['query']['filter']+'%'};return _0x72aad4;}})});}_0x42de8a=_[_0xea72('0x40')]({},_0x42de8a,_0x1cba1d['options']);var _0x4671be={'where':_0x42de8a[_0xea72('0x3f')]};return db['Variable'][_0xea72('0x42')](_0x4671be)['then'](function(_0x50e978){_0x299b4a['count']=_0x50e978;if(_0x1cba1d[_0xea72('0x33')][_0xea72('0x43')]){_0x42de8a[_0xea72('0x44')]=[{'all':!![]}];}return db['Variable'][_0xea72('0x45')](_0x42de8a);})[_0xea72('0x25')](function(_0x10153b){_0x299b4a[_0xea72('0x46')]=_0x10153b;return _0x299b4a;})[_0xea72('0x25')](respondWithFilteredResult(_0x38cc5c,_0x42de8a))[_0xea72('0x47')](handleError(_0x38cc5c,null));};exports['show']=function(_0x39c450,_0x3ee9fc){var _0x242f7b={'raw':!![],'where':{'id':_0x39c450['params']['id']}},_0x513a0b={};_0x513a0b[_0xea72('0x32')]=_['keys'](db[_0xea72('0x2f')][_0xea72('0x30')]);_0x513a0b[_0xea72('0x33')]=_['keys'](_0x39c450[_0xea72('0x33')]);_0x513a0b['filters']=_[_0xea72('0x36')](_0x513a0b['model'],_0x513a0b[_0xea72('0x33')]);_0x242f7b['attributes']=_[_0xea72('0x36')](_0x513a0b[_0xea72('0x32')],qs[_0xea72('0x38')](_0x39c450['query'][_0xea72('0x38')]));_0x242f7b['attributes']=_0x242f7b[_0xea72('0x37')]['length']?_0x242f7b[_0xea72('0x37')]:_0x513a0b[_0xea72('0x32')];if(_0x39c450[_0xea72('0x33')][_0xea72('0x43')]){_0x242f7b['include']=[{'all':!![]}];}_0x242f7b=_[_0xea72('0x40')]({},_0x242f7b,_0x39c450['options']);return db[_0xea72('0x2f')][_0xea72('0x48')](_0x242f7b)[_0xea72('0x25')](handleEntityNotFound(_0x3ee9fc,null))['then'](respondWithResult(_0x3ee9fc,null))[_0xea72('0x47')](handleError(_0x3ee9fc,null));};exports[_0xea72('0x49')]=function(_0x53feb2,_0x29a1ec){return db['Variable']['create'](_0x53feb2['body'],{})[_0xea72('0x25')](function(_0x3fabae){var _0x3a9611=_0x53feb2[_0xea72('0x4a')][_0xea72('0x26')]({'plain':!![]});if(!_0x3a9611)throw new Error(_0xea72('0x4b'));if(_0x3a9611[_0xea72('0x4c')]==='user'){var _0x1bbaa8=_0x3fabae[_0xea72('0x26')]({'plain':!![]});var _0x171b79='Variables';return db['UserProfileSection'][_0xea72('0x48')]({'where':{'name':_0x171b79,'userProfileId':_0x3a9611[_0xea72('0x4d')]},'raw':!![]})['then'](function(_0x3c5470){if(_0x3c5470&&_0x3c5470['autoAssociation']===0x0){return db[_0xea72('0x28')][_0xea72('0x49')]({'name':_0x1bbaa8[_0xea72('0x2b')],'resourceId':_0x1bbaa8['id'],'type':_0x3c5470['name'],'sectionId':_0x3c5470['id']},{})['then'](function(){return _0x3fabae;});}else{return _0x3fabae;}})['catch'](function(_0x20f27b){logger[_0xea72('0x29')](_0xea72('0x4e'),_0x20f27b);throw _0x20f27b;});}return _0x3fabae;})[_0xea72('0x25')](respondWithResult(_0x29a1ec,0xc9))[_0xea72('0x47')](handleError(_0x29a1ec,null));};exports[_0xea72('0x23')]=function(_0x4fb5be,_0x2b9dca){if(_0x4fb5be[_0xea72('0x4f')]['id']){delete _0x4fb5be['body']['id'];}return db[_0xea72('0x2f')][_0xea72('0x48')]({'where':{'id':_0x4fb5be[_0xea72('0x50')]['id']}})[_0xea72('0x25')](handleEntityNotFound(_0x2b9dca,null))[_0xea72('0x25')](saveUpdates(_0x4fb5be['body'],null))[_0xea72('0x25')](respondWithResult(_0x2b9dca,null))['catch'](handleError(_0x2b9dca,null));};exports[_0xea72('0x24')]=function(_0x29991a,_0x244c68){return db[_0xea72('0x2f')][_0xea72('0x48')]({'where':{'id':_0x29991a['params']['id']}})[_0xea72('0x25')](handleEntityNotFound(_0x244c68,null))[_0xea72('0x25')](removeEntity(_0x244c68,null))[_0xea72('0x47')](handleError(_0x244c68,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 94988e6..3b96e2f 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 _0x0447=['rimraf','../../config/environment','./variable.attributes','exports','Variable','lodash','api','moment','bluebird','path'];(function(_0x214c9a,_0x92da21){var _0x54a223=function(_0x528516){while(--_0x528516){_0x214c9a['push'](_0x214c9a['shift']());}};_0x54a223(++_0x92da21);}(_0x0447,0x131));var _0x7044=function(_0xff01f6,_0x14b5b9){_0xff01f6=_0xff01f6-0x0;var _0x65e73f=_0x0447[_0xff01f6];return _0x65e73f;};'use strict';var _=require(_0x7044('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7044('0x1'));var moment=require(_0x7044('0x2'));var BPromise=require(_0x7044('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7044('0x4'));var rimraf=require(_0x7044('0x5'));var config=require(_0x7044('0x6'));var attributes=require(_0x7044('0x7'));module[_0x7044('0x8')]=function(_0x7a060f,_0x2f1307){return _0x7a060f['define'](_0x7044('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f23=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','tools_variables','util','../../config/logger'];(function(_0x2d2878,_0x32f822){var _0x57704b=function(_0x2ab252){while(--_0x2ab252){_0x2d2878['push'](_0x2d2878['shift']());}};_0x57704b(++_0x32f822);}(_0x2f23,0x82));var _0x32f2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2f23[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x32f2('0x0'));var logger=require(_0x32f2('0x1'))(_0x32f2('0x2'));var moment=require(_0x32f2('0x3'));var BPromise=require(_0x32f2('0x4'));var rp=require(_0x32f2('0x5'));var fs=require('fs');var path=require(_0x32f2('0x6'));var rimraf=require(_0x32f2('0x7'));var config=require(_0x32f2('0x8'));var attributes=require(_0x32f2('0x9'));module[_0x32f2('0xa')]=function(_0x6bda5,_0x419f87){return _0x6bda5['define']('Variable',attributes,{'tableName':_0x32f2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index b109ca7..616c2a7 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 _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x26f518,_0x5a6c2d){var _0x3666d=function(_0x38ef7f){while(--_0x38ef7f){_0x26f518['push'](_0x26f518['shift']());}};_0x3666d(++_0x5a6c2d);}(_0x55ca,0x126));var _0xa55c=function(_0x453583,_0x5ca1e8){_0x453583=_0x453583-0x0;var _0x3e9101=_0x55ca[_0x453583];return _0x3e9101;};'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')]('Variable,\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')]('Variable,\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);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file +var _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x4d3b39,_0x4ec5ad){var _0x3f92ca=function(_0x155efa){while(--_0x155efa){_0x4d3b39['push'](_0x4d3b39['shift']());}};_0x3f92ca(++_0x4ec5ad);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5f2fce,_0x19b8e7){_0x5f2fce=_0x5f2fce-0x0;var _0x40947b=_0x1cb9[_0x5f2fce];return _0x40947b;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 7e354b5..cd5c984 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 _0x6fb9=['reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','get','index','/fetch','isAuthenticated','canUpdate','/reset'];(function(_0x331bb5,_0x403d98){var _0x25c4c3=function(_0x4ee42d){while(--_0x4ee42d){_0x331bb5['push'](_0x331bb5['shift']());}};_0x25c4c3(++_0x403d98);}(_0x6fb9,0x152));var _0x96fb=function(_0x161ac3,_0x142e49){_0x161ac3=_0x161ac3-0x0;var _0x3bb837=_0x6fb9[_0x161ac3];return _0x3bb837;};'use strict';var express=require(_0x96fb('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0x96fb('0x1')]('/',controller[_0x96fb('0x2')]);router[_0x96fb('0x1')](_0x96fb('0x3'),auth[_0x96fb('0x4')](),auth[_0x96fb('0x5')](),controller['fetch']);router[_0x96fb('0x1')](_0x96fb('0x6'),auth[_0x96fb('0x4')](),auth[_0x96fb('0x5')](),controller[_0x96fb('0x7')]);router[_0x96fb('0x1')](_0x96fb('0x8'),auth[_0x96fb('0x4')](),auth[_0x96fb('0x5')](),controller[_0x96fb('0x9')]);router[_0x96fb('0x1')](_0x96fb('0xa'),auth[_0x96fb('0x4')](),controller[_0x96fb('0xb')]);router[_0x96fb('0x1')](_0x96fb('0xc'),controller[_0x96fb('0xd')]);module[_0x96fb('0xe')]=router; \ No newline at end of file +var _0x9f7f=['Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/migrations','migrations','exports','express'];(function(_0x33aab3,_0x5f591e){var _0x3467f0=function(_0x247531){while(--_0x247531){_0x33aab3['push'](_0x33aab3['shift']());}};_0x3467f0(++_0x5f591e);}(_0x9f7f,0xdf));var _0xf9f7=function(_0x1dfb39,_0x43448f){_0x1dfb39=_0x1dfb39-0x0;var _0x51a58e=_0x9f7f[_0x1dfb39];return _0x51a58e;};'use strict';var express=require(_0xf9f7('0x0'));var router=express[_0xf9f7('0x1')]();var auth=require(_0xf9f7('0x2'));var controller=require(_0xf9f7('0x3'));router[_0xf9f7('0x4')]('/',controller['index']);router['get'](_0xf9f7('0x5'),auth[_0xf9f7('0x6')](),auth[_0xf9f7('0x7')](),controller[_0xf9f7('0x8')]);router[_0xf9f7('0x4')](_0xf9f7('0x9'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xf9f7('0xa')]);router[_0xf9f7('0x4')](_0xf9f7('0xb'),auth[_0xf9f7('0x6')](),auth['canUpdate'](),controller[_0xf9f7('0xc')]);router['get']('/restart',auth['isAuthenticated'](),controller['restart']);router[_0xf9f7('0x4')](_0xf9f7('0xd'),controller[_0xf9f7('0xe')]);module[_0xf9f7('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 902ad8a..6bf2815 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 _0x6039=['readdirSync','join','root','server','length','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.','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','exports','version','query','fetch','tags','latest','status','json','origin','info','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','error','restart','then','pm2\x20restart\x20motion\x20%s','catch','migrations'];(function(_0x5cb554,_0x46a114){var _0x597fef=function(_0xb398d4){while(--_0xb398d4){_0x5cb554['push'](_0x5cb554['shift']());}};_0x597fef(++_0x46a114);}(_0x6039,0x70));var _0x9603=function(_0x4055e6,_0x1b4e35){_0x4055e6=_0x4055e6-0x0;var _0x4c16e8=_0x6039[_0x4055e6];return _0x4c16e8;};'use strict';var Umzug=require(_0x9603('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x9603('0x1'))(module,'version');var compareVersions=require(_0x9603('0x2'));var exec=require(_0x9603('0x3'))[_0x9603('0x4')];var db=require(_0x9603('0x5'))['db'];var config=require(_0x9603('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x9603('0x7'))(_0x9603('0x8'));var git=require(_0x9603('0x9'))(config['root']);exports['index']=function(_0xae24a5,_0x59cbac){var _0x3dfd89={'current':module[_0x9603('0xa')][_0x9603('0xb')],'phonebar':0x2};if(_0xae24a5[_0x9603('0xc')]&&_0xae24a5[_0x9603('0xc')]['latest']){return git[_0x9603('0xd')]()[_0x9603('0xe')](function(_0x2a75ae,_0x1a5bba){_0x3dfd89[_0x9603('0xf')]=(_0x2a75ae?module[_0x9603('0xa')][_0x9603('0xb')]:_0x1a5bba[_0x9603('0xf')])||'2.0.0';return _0x59cbac[_0x9603('0x10')](0xc8)[_0x9603('0x11')](_0x3dfd89);});}else{return _0x59cbac['status'](0xc8)[_0x9603('0x11')](_0x3dfd89);}};exports[_0x9603('0xd')]=function(_0x279785,_0x2c7853){return git[_0x9603('0xd')]([_0x9603('0x12'),'master'],function(_0x47bf4a){if(_0x47bf4a){logger['error'](_0x47bf4a);return _0x2c7853[_0x9603('0x10')](0x1f4)[_0x9603('0x11')](_0x47bf4a);}logger[_0x9603('0x13')]('git\x20fetch');return _0x2c7853['status'](0xc8)[_0x9603('0x11')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x361fcb,_0x2bba17){return git[_0x9603('0x14')]([_0x9603('0x15'),_0x9603('0x16')],function(_0x2b0b92){if(_0x2b0b92){logger['error'](_0x2b0b92);return _0x2bba17['status'](0x1f4)[_0x9603('0x11')](_0x2b0b92);}logger[_0x9603('0x13')](_0x9603('0x17'));return _0x2bba17[_0x9603('0x10')](0xc8)[_0x9603('0x11')]({'output':_0x9603('0x18')});});};exports['pull']=function(_0x137b54,_0x3ef875){exec(_0x9603('0x19'),function(_0x3074cf,_0x258040,_0x7451b3){logger['info'](_0x258040);logger['info'](_0x7451b3);if(_0x3074cf){logger[_0x9603('0x1a')](_0x3074cf);return _0x3ef875[_0x9603('0x10')](0x1f4)[_0x9603('0x11')](_0x3074cf);}return _0x3ef875[_0x9603('0x10')](0xc8)[_0x9603('0x11')]({'output':_0x258040});});};exports[_0x9603('0x1b')]=function(_0x413bdb,_0x424324){return pm2[_0x9603('0x1b')]('motion2')[_0x9603('0x1c')](function(_0xc66673){logger[_0x9603('0x13')](_0x9603('0x1d'),_0xc66673);return _0x424324[_0x9603('0x10')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x9603('0x1e')](function(_0x13a7e4){logger[_0x9603('0x1a')](_0x13a7e4);return _0x424324[_0x9603('0x10')](0x1f4)['json'](_0x13a7e4);});};exports[_0x9603('0x1f')]=function(_0x47eec6,_0x3058f5){var _0x2c1999=fs[_0x9603('0x20')](path[_0x9603('0x21')](config[_0x9603('0x22')],_0x9603('0x23'),_0x9603('0x1f')));var _0x3861ea=[];for(var _0x554867=0x0;_0x554867<_0x2c1999[_0x9603('0x24')];_0x554867++){var _0x3bc54d=_0x2c1999[_0x554867]['replace']('.js','');if(compareVersions(module['exports']['version'],_0x3bc54d)===-0x1){_0x3861ea[_0x9603('0x25')](_0x3bc54d);}}if(_0x3861ea[_0x9603('0x24')]){var _0x17feaa=_0x3861ea['sort'](compareVersions);var _0xba576c=new Umzug({'storage':_0x9603('0x26'),'storageOptions':{'model':db[_0x9603('0x27')],'modelName':_0x9603('0x27'),'columnName':_0x9603('0xb')},'migrations':{'params':[db[_0x9603('0x26')][_0x9603('0x28')](),db[_0x9603('0x26')][_0x9603('0x29')],function(){throw new Error(_0x9603('0x2a'));}],'path':path[_0x9603('0x21')](config[_0x9603('0x22')],'server',_0x9603('0x1f')),'pattern':/\.js$/}});_0xba576c['up']({'migrations':_['map'](_0x17feaa,function(_0x439d94){return _0x439d94+_0x9603('0x2b');})})['then'](function(){return _0x3058f5[_0x9603('0x10')](0xc8)['json']({'output':_0x9603('0x2c')+module[_0x9603('0xa')][_0x9603('0xb')]+_0x9603('0x2d')+_['last'](_0x17feaa),'migrations':_[_0x9603('0x21')](_0x17feaa)});})[_0x9603('0x1e')](function(_0x59b5fd){if(_0x59b5fd instanceof db['sequelize'][_0x9603('0x2e')]){return _0x3058f5['status'](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x3058f5[_0x9603('0x10')](0x1f4)['json'](_0x59b5fd);}});}else{return _0x3058f5['status'](0xc8)['json']({'output':_0x9603('0x2f')});}}; \ No newline at end of file +var _0x116c=['latest','tags','2.0.0','status','json','fetch','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','replace','push','length','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query'];(function(_0x5cc993,_0x2375ab){var _0x35a33b=function(_0x219c71){while(--_0x219c71){_0x5cc993['push'](_0x5cc993['shift']());}};_0x35a33b(++_0x2375ab);}(_0x116c,0xc0));var _0xc116=function(_0x5e502b,_0x509baa){_0x5e502b=_0x5e502b-0x0;var _0x5468a4=_0x116c[_0x5e502b];return _0x5468a4;};'use strict';var Umzug=require(_0xc116('0x0'));var path=require(_0xc116('0x1'));var fs=require('fs');var _=require(_0xc116('0x2'));var pkginfo=require('pkginfo')(module,_0xc116('0x3'));var compareVersions=require(_0xc116('0x4'));var exec=require(_0xc116('0x5'))[_0xc116('0x6')];var db=require(_0xc116('0x7'))['db'];var config=require(_0xc116('0x8'));var pm2=require(_0xc116('0x9'));var logger=require('../../config/logger')(_0xc116('0xa'));var git=require(_0xc116('0xb'))(config[_0xc116('0xc')]);exports[_0xc116('0xd')]=function(_0x2db17e,_0x318a78){var _0x4007f5={'current':module[_0xc116('0xe')]['version'],'phonebar':0x2};if(_0x2db17e[_0xc116('0xf')]&&_0x2db17e[_0xc116('0xf')][_0xc116('0x10')]){return git['fetch']()[_0xc116('0x11')](function(_0x1ea905,_0x3ed13d){_0x4007f5[_0xc116('0x10')]=(_0x1ea905?module[_0xc116('0xe')]['version']:_0x3ed13d['latest'])||_0xc116('0x12');return _0x318a78[_0xc116('0x13')](0xc8)[_0xc116('0x14')](_0x4007f5);});}else{return _0x318a78[_0xc116('0x13')](0xc8)[_0xc116('0x14')](_0x4007f5);}};exports['fetch']=function(_0x32d855,_0x57ff9a){return git[_0xc116('0x15')]([_0xc116('0x16'),_0xc116('0x17')],function(_0xfa6d82){if(_0xfa6d82){logger[_0xc116('0x18')](_0xfa6d82);return _0x57ff9a['status'](0x1f4)[_0xc116('0x14')](_0xfa6d82);}logger[_0xc116('0x19')]('git\x20fetch');return _0x57ff9a[_0xc116('0x13')](0xc8)['json']({'output':_0xc116('0x1a')});});};exports[_0xc116('0x1b')]=function(_0x16d8da,_0x2b220a){return git['reset']([_0xc116('0x1c'),_0xc116('0x1d')],function(_0x441c8a){if(_0x441c8a){logger[_0xc116('0x18')](_0x441c8a);return _0x2b220a[_0xc116('0x13')](0x1f4)[_0xc116('0x14')](_0x441c8a);}logger[_0xc116('0x19')](_0xc116('0x1e'));return _0x2b220a[_0xc116('0x13')](0xc8)[_0xc116('0x14')]({'output':'git\x20reset\x20--hard'});});};exports[_0xc116('0x1f')]=function(_0x2c0d30,_0x53c817){exec('npm\x20install\x20--production',function(_0x87907d,_0x52f3f7,_0x13fec5){logger[_0xc116('0x19')](_0x52f3f7);logger[_0xc116('0x19')](_0x13fec5);if(_0x87907d){logger[_0xc116('0x18')](_0x87907d);return _0x53c817['status'](0x1f4)[_0xc116('0x14')](_0x87907d);}return _0x53c817[_0xc116('0x13')](0xc8)['json']({'output':_0x52f3f7});});};exports[_0xc116('0x20')]=function(_0x3b9a4d,_0x18f69b){return pm2[_0xc116('0x20')](_0xc116('0x21'))[_0xc116('0x22')](function(_0x4bd10){logger[_0xc116('0x19')](_0xc116('0x23'),_0x4bd10);return _0x18f69b[_0xc116('0x13')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xc116('0x24')](function(_0x36015){logger[_0xc116('0x18')](_0x36015);return _0x18f69b['status'](0x1f4)[_0xc116('0x14')](_0x36015);});};exports[_0xc116('0x25')]=function(_0x9011,_0x3ec9dd){var _0x11a4bc=fs[_0xc116('0x26')](path[_0xc116('0x27')](config[_0xc116('0xc')],'server',_0xc116('0x25')));var _0x4e63dd=[];for(var _0x1b12b2=0x0;_0x1b12b2<_0x11a4bc['length'];_0x1b12b2++){var _0x2ac037=_0x11a4bc[_0x1b12b2][_0xc116('0x28')]('.js','');if(compareVersions(module[_0xc116('0xe')]['version'],_0x2ac037)===-0x1){_0x4e63dd[_0xc116('0x29')](_0x2ac037);}}if(_0x4e63dd[_0xc116('0x2a')]){var _0x139758=_0x4e63dd[_0xc116('0x2b')](compareVersions);var _0x540871=new Umzug({'storage':_0xc116('0x2c'),'storageOptions':{'model':db[_0xc116('0x2d')],'modelName':_0xc116('0x2d'),'columnName':_0xc116('0x3')},'migrations':{'params':[db[_0xc116('0x2c')][_0xc116('0x2e')](),db['sequelize']['constructor'],function(){throw new Error(_0xc116('0x2f'));}],'path':path[_0xc116('0x27')](config[_0xc116('0xc')],'server',_0xc116('0x25')),'pattern':/\.js$/}});_0x540871['up']({'migrations':_['map'](_0x139758,function(_0x33c547){return _0x33c547+'.js';})})[_0xc116('0x22')](function(){return _0x3ec9dd[_0xc116('0x13')](0xc8)[_0xc116('0x14')]({'output':_0xc116('0x30')+module[_0xc116('0xe')][_0xc116('0x3')]+_0xc116('0x31')+_[_0xc116('0x32')](_0x139758),'migrations':_['join'](_0x139758)});})['catch'](function(_0x1c1478){if(_0x1c1478 instanceof db[_0xc116('0x2c')]['UniqueConstraintError']){return _0x3ec9dd[_0xc116('0x13')](0xc8)[_0xc116('0x14')]({'output':_0xc116('0x33')});}else{return _0x3ec9dd['status'](0x1f4)[_0xc116('0x14')](_0x1c1478);}});}else{return _0x3ec9dd[_0xc116('0x13')](0xc8)[_0xc116('0x14')]({'output':_0xc116('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index dbe1f10..021a551 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 _0x9d9a=['post','create','put','update','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','/describe','get','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9d9a,0x1ba));var _0xa9d9=function(_0x5a8aae,_0x97e1e){_0x5a8aae=_0x5a8aae-0x0;var _0x2c3368=_0x9d9a[_0x5a8aae];return _0x2c3368;};'use strict';var multer=require('multer');var util=require(_0xa9d9('0x0'));var path=require(_0xa9d9('0x1'));var timeout=require('connect-timeout');var express=require(_0xa9d9('0x2'));var router=express[_0xa9d9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa9d9('0x4'));var interaction=require(_0xa9d9('0x5'));var config=require(_0xa9d9('0x6'));var controller=require(_0xa9d9('0x7'));router['get']('/',auth[_0xa9d9('0x8')](),controller[_0xa9d9('0x9')]);router['get'](_0xa9d9('0xa'),auth[_0xa9d9('0x8')](),controller['describe']);router[_0xa9d9('0xb')](_0xa9d9('0xc'),auth[_0xa9d9('0x8')](),controller[_0xa9d9('0xd')]);router[_0xa9d9('0xe')]('/',auth[_0xa9d9('0x8')](),controller[_0xa9d9('0xf')]);router[_0xa9d9('0x10')](_0xa9d9('0xc'),auth['isAuthenticated'](),controller[_0xa9d9('0x11')]);router['delete'](_0xa9d9('0xc'),auth[_0xa9d9('0x8')](),controller['destroy']);module[_0xa9d9('0x12')]=router; \ No newline at end of file +var _0x78bf=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','multer','util','path','connect-timeout'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x78bf,0x1f4));var _0xf78b=function(_0x2b68fc,_0x10362e){_0x2b68fc=_0x2b68fc-0x0;var _0x2e3490=_0x78bf[_0x2b68fc];return _0x2e3490;};'use strict';var multer=require(_0xf78b('0x0'));var util=require(_0xf78b('0x1'));var path=require(_0xf78b('0x2'));var timeout=require(_0xf78b('0x3'));var express=require(_0xf78b('0x4'));var router=express['Router']();var fs_extra=require(_0xf78b('0x5'));var auth=require(_0xf78b('0x6'));var interaction=require(_0xf78b('0x7'));var config=require(_0xf78b('0x8'));var controller=require(_0xf78b('0x9'));router[_0xf78b('0xa')]('/',auth[_0xf78b('0xb')](),controller[_0xf78b('0xc')]);router[_0xf78b('0xa')](_0xf78b('0xd'),auth[_0xf78b('0xb')](),controller[_0xf78b('0xe')]);router['get'](_0xf78b('0xf'),auth[_0xf78b('0xb')](),controller[_0xf78b('0x10')]);router[_0xf78b('0x11')]('/',auth[_0xf78b('0xb')](),controller[_0xf78b('0x12')]);router['put'](_0xf78b('0xf'),auth[_0xf78b('0xb')](),controller[_0xf78b('0x13')]);router[_0xf78b('0x14')](_0xf78b('0xf'),auth[_0xf78b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 1fe4fab..a2bdd5c 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 _0xc2a2=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x22262a,_0x431d82){var _0x34ed6d=function(_0x359d95){while(--_0x359d95){_0x22262a['push'](_0x22262a['shift']());}};_0x34ed6d(++_0x431d82);}(_0xc2a2,0x84));var _0x2c2a=function(_0x45f822,_0x5bd217){_0x45f822=_0x45f822-0x0;var _0x3fcbae=_0xc2a2[_0x45f822];return _0x3fcbae;};'use strict';var Sequelize=require(_0x2c2a('0x0'));module[_0x2c2a('0x1')]={'type':{'type':Sequelize[_0x2c2a('0x2')]},'uniqueid':{'type':Sequelize[_0x2c2a('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2c2a('0x2')]},'queue':{'type':Sequelize[_0x2c2a('0x2')]},'interface':{'type':Sequelize[_0x2c2a('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x2c2a('0x3')]},'agentconnectAt':{'type':Sequelize[_0x2c2a('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x2c2a('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x2c2a('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x2c2a('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2c2a('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x2c2a('0x2')]},'channel':{'type':Sequelize[_0x2c2a('0x2')]},'channelstate':{'type':Sequelize[_0x2c2a('0x4')]},'channelstatedesc':{'type':Sequelize[_0x2c2a('0x2')]},'connectedlinenum':{'type':Sequelize[_0x2c2a('0x2')]},'connectedlinename':{'type':Sequelize[_0x2c2a('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2c2a('0x2')]},'exten':{'type':Sequelize[_0x2c2a('0x2')]},'priority':{'type':Sequelize[_0x2c2a('0x2')]},'destchannel':{'type':Sequelize[_0x2c2a('0x2')]},'destchannelstate':{'type':Sequelize[_0x2c2a('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x2c2a('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x2c2a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x2c2a('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x2c2a('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x2c2a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x2c2a('0x2')]},'destuniqueid':{'type':Sequelize[_0x2c2a('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x2c2a('0x2')]},'transfer':{'type':Sequelize[_0x2c2a('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2c2a('0x2')],'comment':_0x2c2a('0x6')},'transferexten':{'type':Sequelize[_0x2c2a('0x2')]},'transferuniqueid':{'type':Sequelize[_0x2c2a('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4dd2=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x169788,_0xf70078){var _0x6900cd=function(_0x3c362d){while(--_0x3c362d){_0x169788['push'](_0x169788['shift']());}};_0x6900cd(++_0xf70078);}(_0x4dd2,0xf1));var _0x24dd=function(_0x384231,_0x50be41){_0x384231=_0x384231-0x0;var _0x2480bf=_0x4dd2[_0x384231];return _0x2480bf;};'use strict';var Sequelize=require('sequelize');module[_0x24dd('0x0')]={'type':{'type':Sequelize[_0x24dd('0x1')]},'uniqueid':{'type':Sequelize[_0x24dd('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x24dd('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x24dd('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x24dd('0x2')]},'agentconnectAt':{'type':Sequelize[_0x24dd('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x24dd('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x24dd('0x3')]},'agentcomplete':{'type':Sequelize[_0x24dd('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x24dd('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x24dd('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x24dd('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x24dd('0x3')]},'reason':{'type':Sequelize[_0x24dd('0x1')]},'lastevent':{'type':Sequelize[_0x24dd('0x1')]},'channel':{'type':Sequelize[_0x24dd('0x1')]},'channelstate':{'type':Sequelize[_0x24dd('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x24dd('0x1')]},'connectedlinename':{'type':Sequelize[_0x24dd('0x1')]},'language':{'type':Sequelize[_0x24dd('0x1')]},'accountcode':{'type':Sequelize[_0x24dd('0x1')]},'context':{'type':Sequelize[_0x24dd('0x1')]},'exten':{'type':Sequelize[_0x24dd('0x1')]},'priority':{'type':Sequelize[_0x24dd('0x1')]},'destchannel':{'type':Sequelize[_0x24dd('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x24dd('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x24dd('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x24dd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x24dd('0x1')]},'destcontext':{'type':Sequelize[_0x24dd('0x1')]},'destexten':{'type':Sequelize[_0x24dd('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x24dd('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x24dd('0x1')]},'transfer':{'type':Sequelize[_0x24dd('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x24dd('0x1')],'comment':_0x24dd('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x24dd('0x1')]},'agententerreason':{'type':Sequelize[_0x24dd('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 546a0a1..8704e68 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(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_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 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(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 f368b19..8f368e5 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 _0xc474=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','moment'];(function(_0x5e4904,_0x3e2b55){var _0xe6c9c=function(_0x2af15f){while(--_0x2af15f){_0x5e4904['push'](_0x5e4904['shift']());}};_0xe6c9c(++_0x3e2b55);}(_0xc474,0xfc));var _0x4c47=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xc474[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x4c47('0x0'));var util=require(_0x4c47('0x1'));var logger=require(_0x4c47('0x2'))('api');var moment=require(_0x4c47('0x3'));var BPromise=require(_0x4c47('0x4'));var rp=require(_0x4c47('0x5'));var fs=require('fs');var path=require(_0x4c47('0x6'));var rimraf=require(_0x4c47('0x7'));var config=require(_0x4c47('0x8'));var attributes=require(_0x4c47('0x9'));module[_0x4c47('0xa')]=function(_0x58db78,_0x5aaf0e){return _0x58db78[_0x4c47('0xb')](_0x4c47('0xc'),attributes,{'tableName':_0x4c47('0xd'),'paranoid':![],'indexes':[{'fields':[_0x4c47('0xe'),_0x4c47('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x24ca=['request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','destuniqueid','lodash','../../config/logger','api','moment'];(function(_0x120bc2,_0x57a253){var _0x454a41=function(_0x21adfe){while(--_0x21adfe){_0x120bc2['push'](_0x120bc2['shift']());}};_0x454a41(++_0x57a253);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1c0f3d,_0x55a9e2){_0x1c0f3d=_0x1c0f3d-0x0;var _0x4d71a8=_0x24ca[_0x1c0f3d];return _0x4d71a8;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var logger=require(_0xa24c('0x1'))(_0xa24c('0x2'));var moment=require(_0xa24c('0x3'));var BPromise=require('bluebird');var rp=require(_0xa24c('0x4'));var fs=require('fs');var path=require(_0xa24c('0x5'));var rimraf=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var attributes=require(_0xa24c('0x8'));module[_0xa24c('0x9')]=function(_0xf0511,_0x3c0aaa){return _0xf0511[_0xa24c('0xa')](_0xa24c('0xb'),attributes,{'tableName':_0xa24c('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xa24c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 1ac0fc6..9803918 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 _0xf9e6=['debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceAgentReport,\x20%s,\x20%s','result','catch','CreateVoiceAgentReport','create','raw','info','UpdateVoiceAgentReport','VoiceAgentReport','body','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent'];(function(_0x4129e0,_0x27d2e5){var _0x15f3ba=function(_0x254de1){while(--_0x254de1){_0x4129e0['push'](_0x4129e0['shift']());}};_0x15f3ba(++_0x27d2e5);}(_0xf9e6,0x17c));var _0x6f9e=function(_0x1ac730,_0x4ca2fe){_0x1ac730=_0x1ac730-0x0;var _0x1d821c=_0xf9e6[_0x1ac730];return _0x1d821c;};'use strict';var _=require(_0x6f9e('0x0'));var util=require(_0x6f9e('0x1'));var moment=require(_0x6f9e('0x2'));var BPromise=require(_0x6f9e('0x3'));var rs=require(_0x6f9e('0x4'));var fs=require('fs');var Redis=require(_0x6f9e('0x5'));var db=require(_0x6f9e('0x6'))['db'];var utils=require(_0x6f9e('0x7'));var logger=require(_0x6f9e('0x8'))(_0x6f9e('0x9'));var config=require(_0x6f9e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6f9e('0xb')][_0x6f9e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc63185,_0x2f044f,_0x35f160){return new BPromise(function(_0x47e6c0,_0xfcdf56){return client[_0x6f9e('0xd')](_0xc63185,_0x35f160)[_0x6f9e('0xe')](function(_0x2d8e82){logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x2f044f,_0x6f9e('0xf'));logger[_0x6f9e('0x10')](_0x6f9e('0x11'),_0x2f044f,'request\x20sent',JSON[_0x6f9e('0x12')](_0x2d8e82));if(_0x2d8e82[_0x6f9e('0x13')]){if(_0x2d8e82[_0x6f9e('0x13')][_0x6f9e('0x14')]===0x1f4){logger[_0x6f9e('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x2f044f,_0x2d8e82['error'][_0x6f9e('0x15')]);return _0xfcdf56(_0x2d8e82[_0x6f9e('0x13')][_0x6f9e('0x15')]);}logger['error'](_0x6f9e('0x16'),_0x2f044f,_0x2d8e82['error'][_0x6f9e('0x15')]);return _0x47e6c0(_0x2d8e82[_0x6f9e('0x13')][_0x6f9e('0x15')]);}else{logger['info'](_0x6f9e('0x16'),_0x2f044f,'request\x20sent');_0x47e6c0(_0x2d8e82[_0x6f9e('0x17')][_0x6f9e('0x15')]);}})[_0x6f9e('0x18')](function(_0x1f7a5d){logger['error'](_0x6f9e('0x16'),_0x2f044f,_0x1f7a5d);_0xfcdf56(_0x1f7a5d);});});}exports[_0x6f9e('0x19')]=function(_0x3778c5){var _0x5b889b=this;return new Promise(function(_0x1f1465,_0x434dbd){return db['VoiceAgentReport'][_0x6f9e('0x1a')](_0x3778c5['body'],{'raw':_0x3778c5['options']?_0x3778c5['options'][_0x6f9e('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1a242b){logger[_0x6f9e('0x1c')]('CreateVoiceAgentReport',_0x3778c5);logger[_0x6f9e('0x10')]('CreateVoiceAgentReport',_0x3778c5,JSON['stringify'](_0x1a242b));_0x1f1465(_0x1a242b);})[_0x6f9e('0x18')](function(_0x467336){logger[_0x6f9e('0x13')]('CreateVoiceAgentReport',_0x467336[_0x6f9e('0x15')],_0x3778c5);_0x434dbd(_0x5b889b[_0x6f9e('0x13')](0x1f4,_0x467336['message']));});});};exports[_0x6f9e('0x1d')]=function(_0x4317b6){var _0x5842fe=this;return new Promise(function(_0x5307f0,_0x3e278a){return db[_0x6f9e('0x1e')]['update'](_0x4317b6[_0x6f9e('0x1f')],{'raw':_0x4317b6[_0x6f9e('0x20')]?_0x4317b6[_0x6f9e('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4317b6['options']?_0x4317b6[_0x6f9e('0x20')][_0x6f9e('0x21')]||null:null,'attributes':_0x4317b6[_0x6f9e('0x20')]?_0x4317b6[_0x6f9e('0x20')][_0x6f9e('0x22')]||null:null,'limit':_0x4317b6[_0x6f9e('0x20')]?_0x4317b6['options'][_0x6f9e('0x23')]||null:null})['then'](function(_0x32bd96){logger['info']('UpdateVoiceAgentReport',_0x4317b6);logger[_0x6f9e('0x10')](_0x6f9e('0x1d'),_0x4317b6,JSON[_0x6f9e('0x12')](_0x32bd96));_0x5307f0(_0x32bd96);})[_0x6f9e('0x18')](function(_0x499c36){logger[_0x6f9e('0x13')]('UpdateVoiceAgentReport',_0x499c36[_0x6f9e('0x15')],_0x4317b6);_0x3e278a(_0x5842fe[_0x6f9e('0x13')](0x1f4,_0x499c36[_0x6f9e('0x15')]));});});}; \ No newline at end of file +var _0x230f=['where','attributes','limit','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','message','error','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','then','UpdateVoiceAgentReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x230f,0x114));var _0xf230=function(_0x3e36b6,_0x43de3b){_0x3e36b6=_0x3e36b6-0x0;var _0x4a3a36=_0x230f[_0x3e36b6];return _0x4a3a36;};'use strict';var _=require(_0xf230('0x0'));var util=require('util');var moment=require(_0xf230('0x1'));var BPromise=require(_0xf230('0x2'));var rs=require(_0xf230('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf230('0x4'))['db'];var utils=require(_0xf230('0x5'));var logger=require(_0xf230('0x6'))(_0xf230('0x7'));var config=require(_0xf230('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf230('0x9')][_0xf230('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa4c084,_0x4b1b8c,_0x2b0684){return new BPromise(function(_0x461279,_0x28d240){return client[_0xf230('0xb')](_0xa4c084,_0x2b0684)['then'](function(_0x2ebabb){logger['info'](_0xf230('0xc'),_0x4b1b8c,_0xf230('0xd'));logger[_0xf230('0xe')](_0xf230('0xf'),_0x4b1b8c,_0xf230('0xd'),JSON['stringify'](_0x2ebabb));if(_0x2ebabb['error']){if(_0x2ebabb['error']['code']===0x1f4){logger['error'](_0xf230('0xc'),_0x4b1b8c,_0x2ebabb['error'][_0xf230('0x10')]);return _0x28d240(_0x2ebabb['error']['message']);}logger[_0xf230('0x11')](_0xf230('0xc'),_0x4b1b8c,_0x2ebabb[_0xf230('0x11')][_0xf230('0x10')]);return _0x461279(_0x2ebabb[_0xf230('0x11')]['message']);}else{logger[_0xf230('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x4b1b8c,_0xf230('0xd'));_0x461279(_0x2ebabb[_0xf230('0x13')][_0xf230('0x10')]);}})[_0xf230('0x14')](function(_0x40abd3){logger[_0xf230('0x11')](_0xf230('0xc'),_0x4b1b8c,_0x40abd3);_0x28d240(_0x40abd3);});});}exports[_0xf230('0x15')]=function(_0x130af8){var _0x1b598c=this;return new Promise(function(_0x2fc328,_0x5b32db){return db[_0xf230('0x16')][_0xf230('0x17')](_0x130af8[_0xf230('0x18')],{'raw':_0x130af8[_0xf230('0x19')]?_0x130af8[_0xf230('0x19')][_0xf230('0x1a')]===undefined?!![]:![]:!![]})[_0xf230('0x1b')](function(_0x5147f8){logger[_0xf230('0x12')]('CreateVoiceAgentReport',_0x130af8);logger[_0xf230('0xe')](_0xf230('0x15'),_0x130af8,JSON['stringify'](_0x5147f8));_0x2fc328(_0x5147f8);})[_0xf230('0x14')](function(_0xf99cce){logger[_0xf230('0x11')](_0xf230('0x15'),_0xf99cce[_0xf230('0x10')],_0x130af8);_0x5b32db(_0x1b598c['error'](0x1f4,_0xf99cce[_0xf230('0x10')]));});});};exports[_0xf230('0x1c')]=function(_0x10b7b9){var _0x149556=this;return new Promise(function(_0x501d27,_0x57e067){return db[_0xf230('0x16')][_0xf230('0x1d')](_0x10b7b9[_0xf230('0x18')],{'raw':_0x10b7b9[_0xf230('0x19')]?_0x10b7b9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10b7b9[_0xf230('0x19')]?_0x10b7b9[_0xf230('0x19')][_0xf230('0x1e')]||null:null,'attributes':_0x10b7b9[_0xf230('0x19')]?_0x10b7b9[_0xf230('0x19')][_0xf230('0x1f')]||null:null,'limit':_0x10b7b9[_0xf230('0x19')]?_0x10b7b9[_0xf230('0x19')][_0xf230('0x20')]||null:null})[_0xf230('0x1b')](function(_0x38cb44){logger[_0xf230('0x12')](_0xf230('0x1c'),_0x10b7b9);logger[_0xf230('0xe')]('UpdateVoiceAgentReport',_0x10b7b9,JSON[_0xf230('0x21')](_0x38cb44));_0x501d27(_0x38cb44);})['catch'](function(_0x5aec2d){logger[_0xf230('0x11')]('UpdateVoiceAgentReport',_0x5aec2d['message'],_0x10b7b9);_0x57e067(_0x149556[_0xf230('0x11')](0x1f4,_0x5aec2d[_0xf230('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index c7dbf7d..1d17a97 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 _0x4bc3=['post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x2b2506,_0x168c92){var _0x250184=function(_0x468c29){while(--_0x468c29){_0x2b2506['push'](_0x2b2506['shift']());}};_0x250184(++_0x168c92);}(_0x4bc3,0x16e));var _0x34bc=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x4bc3[_0xc0a3d3];return _0x3386e8;};'use strict';var multer=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var path=require('path');var timeout=require(_0x34bc('0x2'));var express=require(_0x34bc('0x3'));var router=express['Router']();var fs_extra=require(_0x34bc('0x4'));var auth=require(_0x34bc('0x5'));var interaction=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var controller=require(_0x34bc('0x8'));router[_0x34bc('0x9')]('/',auth[_0x34bc('0xa')](),controller['index']);router[_0x34bc('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x34bc('0xb')]);router[_0x34bc('0x9')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller[_0x34bc('0xd')]);router[_0x34bc('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x34bc('0xf')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller['update']);router[_0x34bc('0x10')]('/:id',auth[_0x34bc('0xa')](),controller[_0x34bc('0x11')]);module[_0x34bc('0x12')]=router; \ No newline at end of file +var _0xeec6=['isAuthenticated','index','/describe','describe','get','show','post','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xeec6,0x1c2));var _0x6eec=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xeec6[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get']('/',auth[_0x6eec('0xa')](),controller[_0x6eec('0xb')]);router['get'](_0x6eec('0xc'),auth[_0x6eec('0xa')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xa')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6eec('0x11'),auth[_0x6eec('0xa')](),controller['update']);router['delete'](_0x6eec('0x11'),auth['isAuthenticated'](),controller[_0x6eec('0x12')]);module[_0x6eec('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 4251490..9aeeecb 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 _0x55af=['STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports'];(function(_0x3f0f88,_0x364184){var _0x1fa680=function(_0x3c0ee9){while(--_0x3c0ee9){_0x3f0f88['push'](_0x3f0f88['shift']());}};_0x1fa680(++_0x364184);}(_0x55af,0x1ab));var _0xf55a=function(_0x5d7b0b,_0x3fa6aa){_0x5d7b0b=_0x5d7b0b-0x0;var _0x3571fb=_0x55af[_0x5d7b0b];return _0x3571fb;};'use strict';var Sequelize=require(_0xf55a('0x0'));module[_0xf55a('0x1')]={'uniqueid':{'type':Sequelize[_0xf55a('0x2')]},'type':{'type':Sequelize[_0xf55a('0x3')](_0xf55a('0x4'),_0xf55a('0x5'),_0xf55a('0x6'),_0xf55a('0x7'),_0xf55a('0x8'),_0xf55a('0x9'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xf55a('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xf55a('0x2')]},'callerid':{'type':Sequelize[_0xf55a('0x2')]},'channel':{'type':Sequelize[_0xf55a('0x2')]},'destinationchannel':{'type':Sequelize[_0xf55a('0x2')]},'lastapplication':{'type':Sequelize[_0xf55a('0x2')]},'lastdata':{'type':Sequelize[_0xf55a('0xa')]},'starttime':{'type':Sequelize[_0xf55a('0xb')]},'systemanswertime':{'type':Sequelize[_0xf55a('0xb')]},'answertime':{'type':Sequelize[_0xf55a('0xb')]},'endtime':{'type':Sequelize[_0xf55a('0xb')]},'duration':{'type':Sequelize[_0xf55a('0xc')]},'billableseconds':{'type':Sequelize[_0xf55a('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf55a('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xf55a('0x2')]},'userDisposition':{'type':Sequelize[_0xf55a('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xf55a('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xf55a('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xf55a('0x2')]},'routeid':{'type':Sequelize[_0xf55a('0xc')]},'sipcallid':{'type':Sequelize[_0xf55a('0x2')]}}; \ No newline at end of file +var _0xafcd=['internal','outbound','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound'];(function(_0x1a1b43,_0x252b30){var _0x1fffab=function(_0x157964){while(--_0x157964){_0x1a1b43['push'](_0x1a1b43['shift']());}};_0x1fffab(++_0x252b30);}(_0xafcd,0x157));var _0xdafc=function(_0x1afc73,_0x1e3ecb){_0x1afc73=_0x1afc73-0x0;var _0x23f0d2=_0xafcd[_0x1afc73];return _0x23f0d2;};'use strict';var Sequelize=require(_0xdafc('0x0'));module[_0xdafc('0x1')]={'uniqueid':{'type':Sequelize[_0xdafc('0x2')]},'type':{'type':Sequelize[_0xdafc('0x3')](_0xdafc('0x4'),_0xdafc('0x5'),_0xdafc('0x6'),'inbound-fax',_0xdafc('0x7'),_0xdafc('0x8'))},'tag':{'type':Sequelize[_0xdafc('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xdafc('0x2')]},'destination':{'type':Sequelize[_0xdafc('0x2')]},'destinationcontext':{'type':Sequelize[_0xdafc('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xdafc('0x2')]},'destinationchannel':{'type':Sequelize[_0xdafc('0x2')]},'lastapplication':{'type':Sequelize[_0xdafc('0x2')]},'lastdata':{'type':Sequelize[_0xdafc('0x9')]},'starttime':{'type':Sequelize[_0xdafc('0xa')]},'systemanswertime':{'type':Sequelize[_0xdafc('0xa')]},'answertime':{'type':Sequelize[_0xdafc('0xa')]},'endtime':{'type':Sequelize[_0xdafc('0xa')]},'duration':{'type':Sequelize[_0xdafc('0xb')]},'billableseconds':{'type':Sequelize[_0xdafc('0xb')]},'mohtime':{'type':Sequelize[_0xdafc('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xdafc('0x2')]},'userDisposition':{'type':Sequelize[_0xdafc('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xdafc('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xdafc('0x2')]},'note':{'type':Sequelize[_0xdafc('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'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 84767b1..16a7292 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(_0x5be795,_0x1cb1b8){var _0x4e8a3b=function(_0x5584ef){while(--_0x5584ef){_0x5be795['push'](_0x5be795['shift']());}};_0x4e8a3b(++_0x1cb1b8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4810db,_0x19a012){_0x4810db=_0x4810db-0x0;var _0x585ca3=_0x5f2f[_0x4810db];return _0x585ca3;};'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 _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x5a8974,_0x1b0cba){_0x5a8974=_0x5a8974-0x0;var _0x48969e=_0x2032[_0x5a8974];return _0x48969e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index f4506ab..b7728ac 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 _0xd52d=['exports','define','report_call','uniqueid','util','../../config/logger','moment','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x39e039,_0x3b8b7e){var _0x191326=function(_0x23f368){while(--_0x23f368){_0x39e039['push'](_0x39e039['shift']());}};_0x191326(++_0x3b8b7e);}(_0xd52d,0x1c7));var _0xdd52=function(_0x13f86b,_0x51574b){_0x13f86b=_0x13f86b-0x0;var _0x14ee59=_0xd52d[_0x13f86b];return _0x14ee59;};'use strict';var _=require('lodash');var util=require(_0xdd52('0x0'));var logger=require(_0xdd52('0x1'))('api');var moment=require(_0xdd52('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd52('0x3'));var rimraf=require(_0xdd52('0x4'));var config=require(_0xdd52('0x5'));var attributes=require(_0xdd52('0x6'));module[_0xdd52('0x7')]=function(_0x3b56e5,_0x319c4a){return _0x3b56e5[_0xdd52('0x8')]('VoiceCallReport',attributes,{'tableName':_0xdd52('0x9'),'paranoid':![],'indexes':[{'fields':[_0xdd52('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc5e=['VoiceCallReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x30ec56,_0x1c6ddb){var _0xe1115b=function(_0x86fcbd){while(--_0x86fcbd){_0x30ec56['push'](_0x30ec56['shift']());}};_0xe1115b(++_0x1c6ddb);}(_0xbc5e,0xda));var _0xebc5=function(_0xd57f0b,_0x35435b){_0xd57f0b=_0xd57f0b-0x0;var _0x52d53b=_0xbc5e[_0xd57f0b];return _0x52d53b;};'use strict';var _=require(_0xebc5('0x0'));var util=require(_0xebc5('0x1'));var logger=require(_0xebc5('0x2'))(_0xebc5('0x3'));var moment=require(_0xebc5('0x4'));var BPromise=require(_0xebc5('0x5'));var rp=require(_0xebc5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xebc5('0x7'));var config=require(_0xebc5('0x8'));var attributes=require(_0xebc5('0x9'));module['exports']=function(_0x1d4bf2,_0x34a53a){return _0x1d4bf2['define'](_0xebc5('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xebc5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index c2abfb9..c85ad02 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 _0xce7c=['where','attributes','include','map','model','debug','catch','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceCallReport,\x20%s,\x20%s','result','GetVoiceCallReport','VoiceCallReport','options','raw'];(function(_0x2d5470,_0x1d44c1){var _0x147a88=function(_0x279827){while(--_0x279827){_0x2d5470['push'](_0x2d5470['shift']());}};_0x147a88(++_0x1d44c1);}(_0xce7c,0x1b8));var _0xcce7=function(_0x49fcfc,_0x104175){_0x49fcfc=_0x49fcfc-0x0;var _0x4ab162=_0xce7c[_0x49fcfc];return _0x4ab162;};'use strict';var _=require(_0xcce7('0x0'));var util=require(_0xcce7('0x1'));var moment=require(_0xcce7('0x2'));var BPromise=require(_0xcce7('0x3'));var rs=require(_0xcce7('0x4'));var fs=require('fs');var Redis=require(_0xcce7('0x5'));var db=require(_0xcce7('0x6'))['db'];var utils=require(_0xcce7('0x7'));var logger=require(_0xcce7('0x8'))(_0xcce7('0x9'));var config=require(_0xcce7('0xa'));var jayson=require(_0xcce7('0xb'));var client=jayson['client'][_0xcce7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ca616,_0x2909b4,_0xe9bbfa){return new BPromise(function(_0x4875d7,_0x38e697){return client[_0xcce7('0xd')](_0x4ca616,_0xe9bbfa)[_0xcce7('0xe')](function(_0xdd30ad){logger[_0xcce7('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x2909b4,_0xcce7('0x10'));logger['debug'](_0xcce7('0x11'),_0x2909b4,_0xcce7('0x10'),JSON[_0xcce7('0x12')](_0xdd30ad));if(_0xdd30ad['error']){if(_0xdd30ad[_0xcce7('0x13')][_0xcce7('0x14')]===0x1f4){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x2909b4,_0xdd30ad[_0xcce7('0x13')]['message']);return _0x38e697(_0xdd30ad[_0xcce7('0x13')][_0xcce7('0x15')]);}logger[_0xcce7('0x13')](_0xcce7('0x16'),_0x2909b4,_0xdd30ad['error'][_0xcce7('0x15')]);return _0x4875d7(_0xdd30ad[_0xcce7('0x13')][_0xcce7('0x15')]);}else{logger[_0xcce7('0xf')](_0xcce7('0x16'),_0x2909b4,_0xcce7('0x10'));_0x4875d7(_0xdd30ad[_0xcce7('0x17')][_0xcce7('0x15')]);}})['catch'](function(_0x127ac1){logger[_0xcce7('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x2909b4,_0x127ac1);_0x38e697(_0x127ac1);});});}exports[_0xcce7('0x18')]=function(_0x22996f){var _0x1b7c35=this;return new Promise(function(_0x1d25e5,_0x6fb527){return db[_0xcce7('0x19')]['findAll']({'raw':_0x22996f[_0xcce7('0x1a')]?_0x22996f[_0xcce7('0x1a')][_0xcce7('0x1b')]===undefined?!![]:![]:!![],'where':_0x22996f[_0xcce7('0x1a')]?_0x22996f[_0xcce7('0x1a')][_0xcce7('0x1c')]||null:null,'attributes':_0x22996f['options']?_0x22996f[_0xcce7('0x1a')][_0xcce7('0x1d')]||null:null,'limit':_0x22996f['options']?_0x22996f[_0xcce7('0x1a')]['limit']||null:null,'include':_0x22996f['options']?_0x22996f['options']['include']?_['map'](_0x22996f[_0xcce7('0x1a')][_0xcce7('0x1e')],function(_0x15d92e){return{'model':db[_0x15d92e['model']],'as':_0x15d92e['as'],'attributes':_0x15d92e['attributes'],'include':_0x15d92e[_0xcce7('0x1e')]?_[_0xcce7('0x1f')](_0x15d92e[_0xcce7('0x1e')],function(_0x26c273){return{'model':db[_0x26c273['model']],'as':_0x26c273['as'],'attributes':_0x26c273[_0xcce7('0x1d')],'include':_0x26c273['include']?_[_0xcce7('0x1f')](_0x26c273['include'],function(_0x48de15){return{'model':db[_0x48de15[_0xcce7('0x20')]],'as':_0x48de15['as'],'attributes':_0x48de15['attributes']};}):[]};}):[]};}):[]:[]})[_0xcce7('0xe')](function(_0x3f9c79){logger['info'](_0xcce7('0x18'),_0x22996f);logger[_0xcce7('0x21')](_0xcce7('0x18'),_0x22996f,JSON[_0xcce7('0x12')](_0x3f9c79));_0x1d25e5(_0x3f9c79);})[_0xcce7('0x22')](function(_0x4acd91){logger[_0xcce7('0x13')](_0xcce7('0x18'),_0x4acd91['message'],_0x22996f);_0x6fb527(_0x1b7c35[_0xcce7('0x13')](0x1f4,_0x4acd91[_0xcce7('0x15')]));});});};exports['CreateVoiceCallReport']=function(_0x132916){var _0x3d1aa4=this;return new Promise(function(_0x3878be,_0x256dc9){return db[_0xcce7('0x19')][_0xcce7('0x23')](_0x132916[_0xcce7('0x24')],{'raw':_0x132916[_0xcce7('0x1a')]?_0x132916[_0xcce7('0x1a')][_0xcce7('0x1b')]===undefined?!![]:![]:!![]})[_0xcce7('0xe')](function(_0x4009e9){logger[_0xcce7('0xf')](_0xcce7('0x25'),_0x132916);logger['debug'](_0xcce7('0x25'),_0x132916,JSON[_0xcce7('0x12')](_0x4009e9));_0x3878be(_0x4009e9);})[_0xcce7('0x22')](function(_0x4179fe){logger[_0xcce7('0x13')]('CreateVoiceCallReport',_0x4179fe['message'],_0x132916);_0x256dc9(_0x3d1aa4['error'](0x1f4,_0x4179fe[_0xcce7('0x15')]));});});};exports[_0xcce7('0x26')]=function(_0x1bafc4){var _0xf02d24=this;return new Promise(function(_0x4692d2,_0x50e49f){return db['VoiceCallReport']['update'](_0x1bafc4[_0xcce7('0x24')],{'raw':_0x1bafc4[_0xcce7('0x1a')]?_0x1bafc4[_0xcce7('0x1a')][_0xcce7('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bafc4['options']?_0x1bafc4[_0xcce7('0x1a')]['where']||null:null,'attributes':_0x1bafc4[_0xcce7('0x1a')]?_0x1bafc4[_0xcce7('0x1a')][_0xcce7('0x1d')]||null:null,'limit':_0x1bafc4[_0xcce7('0x1a')]?_0x1bafc4[_0xcce7('0x1a')]['limit']||null:null})[_0xcce7('0xe')](function(_0x2b3baa){logger['info'](_0xcce7('0x26'),_0x1bafc4);logger['debug']('UpdateVoiceCallReport',_0x1bafc4,JSON['stringify'](_0x2b3baa));_0x4692d2(_0x2b3baa);})[_0xcce7('0x22')](function(_0x67fce0){logger[_0xcce7('0x13')]('UpdateVoiceCallReport',_0x67fce0['message'],_0x1bafc4);_0x50e49f(_0xf02d24[_0xcce7('0x13')](0x1f4,_0x67fce0[_0xcce7('0x15')]));});});}; \ No newline at end of file +var _0xc0dd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','map','include','model','then','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','limit'];(function(_0x1b7ea6,_0x195a62){var _0x4fcea6=function(_0x29ace1){while(--_0x29ace1){_0x1b7ea6['push'](_0x1b7ea6['shift']());}};_0x4fcea6(++_0x195a62);}(_0xc0dd,0x138));var _0xdc0d=function(_0x33d589,_0x4eeaf4){_0x33d589=_0x33d589-0x0;var _0x5d830f=_0xc0dd[_0x33d589];return _0x5d830f;};'use strict';var _=require('lodash');var util=require(_0xdc0d('0x0'));var moment=require(_0xdc0d('0x1'));var BPromise=require(_0xdc0d('0x2'));var rs=require(_0xdc0d('0x3'));var fs=require('fs');var Redis=require(_0xdc0d('0x4'));var db=require(_0xdc0d('0x5'))['db'];var utils=require(_0xdc0d('0x6'));var logger=require('../../config/logger')(_0xdc0d('0x7'));var config=require(_0xdc0d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdc0d('0x9')][_0xdc0d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e813b,_0x5b0ee1,_0x1ec6f1){return new BPromise(function(_0x51dece,_0x3c1e86){return client[_0xdc0d('0xb')](_0x1e813b,_0x1ec6f1)['then'](function(_0x4457a9){logger[_0xdc0d('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x5b0ee1,_0xdc0d('0xd'));logger[_0xdc0d('0xe')](_0xdc0d('0xf'),_0x5b0ee1,_0xdc0d('0xd'),JSON[_0xdc0d('0x10')](_0x4457a9));if(_0x4457a9['error']){if(_0x4457a9[_0xdc0d('0x11')]['code']===0x1f4){logger[_0xdc0d('0x11')](_0xdc0d('0x12'),_0x5b0ee1,_0x4457a9[_0xdc0d('0x11')][_0xdc0d('0x13')]);return _0x3c1e86(_0x4457a9[_0xdc0d('0x11')][_0xdc0d('0x13')]);}logger[_0xdc0d('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x5b0ee1,_0x4457a9['error'][_0xdc0d('0x13')]);return _0x51dece(_0x4457a9[_0xdc0d('0x11')][_0xdc0d('0x13')]);}else{logger[_0xdc0d('0xc')](_0xdc0d('0x12'),_0x5b0ee1,_0xdc0d('0xd'));_0x51dece(_0x4457a9[_0xdc0d('0x14')]['message']);}})[_0xdc0d('0x15')](function(_0x14c33f){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x5b0ee1,_0x14c33f);_0x3c1e86(_0x14c33f);});});}exports[_0xdc0d('0x16')]=function(_0x3c107c){var _0x31aafa=this;return new Promise(function(_0x416566,_0x17f38f){return db[_0xdc0d('0x17')][_0xdc0d('0x18')]({'raw':_0x3c107c[_0xdc0d('0x19')]?_0x3c107c[_0xdc0d('0x19')][_0xdc0d('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c107c[_0xdc0d('0x19')]?_0x3c107c[_0xdc0d('0x19')][_0xdc0d('0x1b')]||null:null,'attributes':_0x3c107c[_0xdc0d('0x19')]?_0x3c107c[_0xdc0d('0x19')][_0xdc0d('0x1c')]||null:null,'limit':_0x3c107c['options']?_0x3c107c['options']['limit']||null:null,'include':_0x3c107c[_0xdc0d('0x19')]?_0x3c107c[_0xdc0d('0x19')]['include']?_[_0xdc0d('0x1d')](_0x3c107c[_0xdc0d('0x19')][_0xdc0d('0x1e')],function(_0x55a8b2){return{'model':db[_0x55a8b2['model']],'as':_0x55a8b2['as'],'attributes':_0x55a8b2[_0xdc0d('0x1c')],'include':_0x55a8b2[_0xdc0d('0x1e')]?_[_0xdc0d('0x1d')](_0x55a8b2['include'],function(_0x2ec4b0){return{'model':db[_0x2ec4b0[_0xdc0d('0x1f')]],'as':_0x2ec4b0['as'],'attributes':_0x2ec4b0['attributes'],'include':_0x2ec4b0[_0xdc0d('0x1e')]?_[_0xdc0d('0x1d')](_0x2ec4b0['include'],function(_0x366aae){return{'model':db[_0x366aae['model']],'as':_0x366aae['as'],'attributes':_0x366aae[_0xdc0d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdc0d('0x20')](function(_0x56de39){logger[_0xdc0d('0xc')](_0xdc0d('0x16'),_0x3c107c);logger['debug']('GetVoiceCallReport',_0x3c107c,JSON[_0xdc0d('0x10')](_0x56de39));_0x416566(_0x56de39);})[_0xdc0d('0x15')](function(_0x2e34b6){logger[_0xdc0d('0x11')](_0xdc0d('0x16'),_0x2e34b6[_0xdc0d('0x13')],_0x3c107c);_0x17f38f(_0x31aafa[_0xdc0d('0x11')](0x1f4,_0x2e34b6[_0xdc0d('0x13')]));});});};exports[_0xdc0d('0x21')]=function(_0x4e6a2b){var _0x294d41=this;return new Promise(function(_0x240813,_0x133968){return db[_0xdc0d('0x17')][_0xdc0d('0x22')](_0x4e6a2b[_0xdc0d('0x23')],{'raw':_0x4e6a2b[_0xdc0d('0x19')]?_0x4e6a2b[_0xdc0d('0x19')][_0xdc0d('0x1a')]===undefined?!![]:![]:!![]})[_0xdc0d('0x20')](function(_0x141a35){logger[_0xdc0d('0xc')](_0xdc0d('0x21'),_0x4e6a2b);logger[_0xdc0d('0xe')](_0xdc0d('0x21'),_0x4e6a2b,JSON['stringify'](_0x141a35));_0x240813(_0x141a35);})[_0xdc0d('0x15')](function(_0x246558){logger[_0xdc0d('0x11')](_0xdc0d('0x21'),_0x246558[_0xdc0d('0x13')],_0x4e6a2b);_0x133968(_0x294d41[_0xdc0d('0x11')](0x1f4,_0x246558[_0xdc0d('0x13')]));});});};exports[_0xdc0d('0x24')]=function(_0x22e219){var _0x236bb8=this;return new Promise(function(_0x504809,_0xd558af){return db[_0xdc0d('0x17')][_0xdc0d('0x25')](_0x22e219[_0xdc0d('0x23')],{'raw':_0x22e219['options']?_0x22e219[_0xdc0d('0x19')][_0xdc0d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22e219[_0xdc0d('0x19')]?_0x22e219[_0xdc0d('0x19')][_0xdc0d('0x1b')]||null:null,'attributes':_0x22e219['options']?_0x22e219[_0xdc0d('0x19')][_0xdc0d('0x1c')]||null:null,'limit':_0x22e219['options']?_0x22e219[_0xdc0d('0x19')][_0xdc0d('0x26')]||null:null})[_0xdc0d('0x20')](function(_0x3c6264){logger[_0xdc0d('0xc')](_0xdc0d('0x24'),_0x22e219);logger[_0xdc0d('0xe')](_0xdc0d('0x24'),_0x22e219,JSON[_0xdc0d('0x10')](_0x3c6264));_0x504809(_0x3c6264);})[_0xdc0d('0x15')](function(_0x308c92){logger[_0xdc0d('0x11')](_0xdc0d('0x24'),_0x308c92[_0xdc0d('0x13')],_0x22e219);_0xd558af(_0x236bb8[_0xdc0d('0x11')](0x1f4,_0x308c92['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 7c08deb..30043ab 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 _0x3e36=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','get','/:id','create','put','update'];(function(_0x53b50e,_0xc49361){var _0x3f8625=function(_0x4ce88b){while(--_0x4ce88b){_0x53b50e['push'](_0x53b50e['shift']());}};_0x3f8625(++_0xc49361);}(_0x3e36,0x101));var _0x63e3=function(_0x1d76f9,_0x5ae479){_0x1d76f9=_0x1d76f9-0x0;var _0xb27277=_0x3e36[_0x1d76f9];return _0xb27277;};'use strict';var multer=require(_0x63e3('0x0'));var util=require(_0x63e3('0x1'));var path=require(_0x63e3('0x2'));var timeout=require(_0x63e3('0x3'));var express=require('express');var router=express[_0x63e3('0x4')]();var fs_extra=require(_0x63e3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x63e3('0x6'));var config=require(_0x63e3('0x7'));var controller=require(_0x63e3('0x8'));router['get']('/',auth[_0x63e3('0x9')](),controller['index']);router[_0x63e3('0xa')](_0x63e3('0xb'),auth[_0x63e3('0x9')](),controller['show']);router['post']('/',auth[_0x63e3('0x9')](),controller[_0x63e3('0xc')]);router[_0x63e3('0xd')](_0x63e3('0xb'),auth[_0x63e3('0x9')](),controller[_0x63e3('0xe')]);router[_0x63e3('0xf')]('/:id',auth[_0x63e3('0x9')](),controller['destroy']);module[_0x63e3('0x10')]=router; \ No newline at end of file +var _0x6b48=['destroy','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/:id','show','post','isAuthenticated','create','put','update','delete'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6b48,0x7f));var _0x86b4=function(_0xf95466,_0x43525b){_0xf95466=_0xf95466-0x0;var _0x1a0343=_0x6b48[_0xf95466];return _0x1a0343;};'use strict';var multer=require(_0x86b4('0x0'));var util=require('util');var path=require(_0x86b4('0x1'));var timeout=require(_0x86b4('0x2'));var express=require(_0x86b4('0x3'));var router=express[_0x86b4('0x4')]();var fs_extra=require(_0x86b4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x86b4('0x6'));var controller=require('./voiceChanSpy.controller');router[_0x86b4('0x7')]('/',auth['isAuthenticated'](),controller[_0x86b4('0x8')]);router[_0x86b4('0x7')](_0x86b4('0x9'),auth['isAuthenticated'](),controller[_0x86b4('0xa')]);router[_0x86b4('0xb')]('/',auth[_0x86b4('0xc')](),controller[_0x86b4('0xd')]);router[_0x86b4('0xe')](_0x86b4('0x9'),auth[_0x86b4('0xc')](),controller[_0x86b4('0xf')]);router[_0x86b4('0x10')](_0x86b4('0x9'),auth['isAuthenticated'](),controller[_0x86b4('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 6dd22cf..257baff 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 _0xd860=['setDataValue','options','getDataValue','split','BOOLEAN','exports','STRING','name'];(function(_0x55bc93,_0x181883){var _0x170446=function(_0x2fcaa3){while(--_0x2fcaa3){_0x55bc93['push'](_0x55bc93['shift']());}};_0x170446(++_0x181883);}(_0xd860,0x105));var _0x0d86=function(_0x50a026,_0x4cf35f){_0x50a026=_0x50a026-0x0;var _0x28cbe6=_0xd860[_0x50a026];return _0x28cbe6;};'use strict';var Sequelize=require('sequelize');module[_0x0d86('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x0d86('0x1')],'unique':_0x0d86('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x0d86('0x1')],'set':function(_0x55a8f9){this[_0x0d86('0x3')](_0x0d86('0x4'),_0x55a8f9?_0x55a8f9['join'](''):[]);},'get':function(){return this[_0x0d86('0x5')]('options')?this['getDataValue']('options')[_0x0d86('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x0d86('0x1')]},'record':{'type':Sequelize[_0x0d86('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x0d86('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc59b=['sequelize','exports','STRING','name','setDataValue','options','join','getDataValue','split','BOOLEAN'];(function(_0x46181b,_0x2606c7){var _0x5c6860=function(_0x4be75d){while(--_0x4be75d){_0x46181b['push'](_0x46181b['shift']());}};_0x5c6860(++_0x2606c7);}(_0xc59b,0x1d6));var _0xbc59=function(_0x4bd7d0,_0xc8e3f7){_0x4bd7d0=_0x4bd7d0-0x0;var _0x3749e2=_0xc59b[_0x4bd7d0];return _0x3749e2;};'use strict';var Sequelize=require(_0xbc59('0x0'));module[_0xbc59('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xbc59('0x2')],'unique':_0xbc59('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xbc59('0x2')],'set':function(_0x40764b){this[_0xbc59('0x4')](_0xbc59('0x5'),_0x40764b?_0x40764b[_0xbc59('0x6')](''):[]);},'get':function(){return this[_0xbc59('0x7')]('options')?this[_0xbc59('0x7')]('options')[_0xbc59('0x8')](''):[];}},'auth':{'type':Sequelize[_0xbc59('0x9')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xbc59('0x2')]},'description':{'type':Sequelize[_0xbc59('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 77c04cc..8006c60 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 _0xaf5a=['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','limit','offset','count','set','Content-Range','json','apply','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','index','VoiceChanSpy','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x16974e,_0x332b87){var _0x101346=function(_0x15154d){while(--_0x15154d){_0x16974e['push'](_0x16974e['shift']());}};_0x101346(++_0x332b87);}(_0xaf5a,0x144));var _0xaaf5=function(_0x3f9819,_0x4c2e0b){_0x3f9819=_0x3f9819-0x0;var _0x2700c2=_0xaf5a[_0x3f9819];return _0x2700c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaaf5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaaf5('0x1'));var rp=require(_0xaaf5('0x2'));var moment=require(_0xaaf5('0x3'));var BPromise=require(_0xaaf5('0x4'));var Mustache=require(_0xaaf5('0x5'));var util=require(_0xaaf5('0x6'));var path=require(_0xaaf5('0x7'));var sox=require(_0xaaf5('0x8'));var csv=require('to-csv');var ejs=require(_0xaaf5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaaf5('0xa'));var squel=require(_0xaaf5('0xb'));var crypto=require(_0xaaf5('0xc'));var jsforce=require(_0xaaf5('0xd'));var deskjs=require(_0xaaf5('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaaf5('0xf'));var Papa=require(_0xaaf5('0x10'));var Redis=require(_0xaaf5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaaf5('0x12'));var as=require(_0xaaf5('0x13'));var hardwareService=require(_0xaaf5('0x14'));var logger=require(_0xaaf5('0x15'))(_0xaaf5('0x16'));var utils=require(_0xaaf5('0x17'));var config=require(_0xaaf5('0x18'));var licenseUtil=require(_0xaaf5('0x19'));var db=require(_0xaaf5('0x1a'))['db'];function respondWithStatusCode(_0x1323e2,_0x55794e){_0x55794e=_0x55794e||0xcc;return function(_0x200236){if(_0x200236){return _0x1323e2[_0xaaf5('0x1b')](_0x55794e);}return _0x1323e2[_0xaaf5('0x1c')](_0x55794e)[_0xaaf5('0x1d')]();};}function respondWithResult(_0xb6c7f1,_0x33647b){_0x33647b=_0x33647b||0xc8;return function(_0x39bf16){if(_0x39bf16){return _0xb6c7f1[_0xaaf5('0x1c')](_0x33647b)['json'](_0x39bf16);}};}function respondWithFilteredResult(_0x5c1b47,_0x4f6721){return function(_0x3e5981){if(_0x3e5981){var _0x3a58e6=typeof _0x4f6721['offset']===_0xaaf5('0x1e')&&typeof _0x4f6721[_0xaaf5('0x1f')]===_0xaaf5('0x1e');var _0x5bf25e=_0x3e5981['count'];var _0x236371=_0x3a58e6?0x0:_0x4f6721[_0xaaf5('0x20')];var _0x2f7bdc=_0x3a58e6?_0x3e5981[_0xaaf5('0x21')]:_0x4f6721[_0xaaf5('0x20')]+_0x4f6721['limit'];var _0x29899a;if(_0x2f7bdc>=_0x5bf25e){_0x2f7bdc=_0x5bf25e;_0x29899a=0xc8;}else{_0x29899a=0xce;}_0x5c1b47[_0xaaf5('0x1c')](_0x29899a);return _0x5c1b47[_0xaaf5('0x22')](_0xaaf5('0x23'),_0x236371+'-'+_0x2f7bdc+'/'+_0x5bf25e)[_0xaaf5('0x24')](_0x3e5981);}return null;};}function patchUpdates(_0x270c72){return function(_0x35d940){try{jsonpatch[_0xaaf5('0x25')](_0x35d940,_0x270c72,!![]);}catch(_0x187175){return BPromise['reject'](_0x187175);}return _0x35d940[_0xaaf5('0x26')]();};}function saveUpdates(_0xe6471f,_0x232a5d){return function(_0x2ac3cf){if(_0x2ac3cf){return _0x2ac3cf[_0xaaf5('0x27')](_0xe6471f)[_0xaaf5('0x28')](function(_0x2900bf){return _0x2900bf;});}return null;};}function removeEntity(_0x16a1d0,_0x577761){return function(_0x290d68){if(_0x290d68){return _0x290d68[_0xaaf5('0x29')]()[_0xaaf5('0x28')](function(){var _0x355693=_0x290d68[_0xaaf5('0x2a')]({'plain':!![]});var _0x46dacd=_0xaaf5('0x2b');return db[_0xaaf5('0x2c')][_0xaaf5('0x29')]({'where':{'type':_0x46dacd,'resourceId':_0x355693['id']}})[_0xaaf5('0x28')](function(){return _0x290d68;});})['then'](function(){_0x16a1d0[_0xaaf5('0x1c')](0xcc)[_0xaaf5('0x1d')]();});}};}function handleEntityNotFound(_0x27b974,_0x27e96e){return function(_0x6915e6){if(!_0x6915e6){_0x27b974[_0xaaf5('0x1b')](0x194);}return _0x6915e6;};}function handleError(_0x2c1fa4,_0x516bc3){_0x516bc3=_0x516bc3||0x1f4;return function(_0x12ee67){logger[_0xaaf5('0x2d')](_0x12ee67[_0xaaf5('0x2e')]);if(_0x12ee67['name']){delete _0x12ee67['name'];}_0x2c1fa4[_0xaaf5('0x1c')](_0x516bc3)['send'](_0x12ee67);};}exports[_0xaaf5('0x2f')]=function(_0x481eb5,_0x2e93c4){var _0x1951ae={},_0x4e852c={},_0x491ca1={'count':0x0,'rows':[]};var _0x4bb9c8=_['map'](db[_0xaaf5('0x30')][_0xaaf5('0x31')],function(_0x21fa04){return{'name':_0x21fa04[_0xaaf5('0x32')],'type':_0x21fa04[_0xaaf5('0x33')][_0xaaf5('0x34')]};});_0x4e852c[_0xaaf5('0x35')]=_['map'](_0x4bb9c8,_0xaaf5('0x36'));_0x4e852c[_0xaaf5('0x37')]=_[_0xaaf5('0x38')](_0x481eb5[_0xaaf5('0x37')]);_0x4e852c['filters']=_['intersection'](_0x4e852c[_0xaaf5('0x35')],_0x4e852c[_0xaaf5('0x37')]);_0x1951ae['attributes']=_[_0xaaf5('0x39')](_0x4e852c[_0xaaf5('0x35')],qs['fields'](_0x481eb5[_0xaaf5('0x37')][_0xaaf5('0x3a')]));_0x1951ae[_0xaaf5('0x3b')]=_0x1951ae['attributes'][_0xaaf5('0x3c')]?_0x1951ae[_0xaaf5('0x3b')]:_0x4e852c['model'];if(!_0x481eb5[_0xaaf5('0x37')]['hasOwnProperty'](_0xaaf5('0x3d'))){_0x1951ae[_0xaaf5('0x1f')]=qs[_0xaaf5('0x1f')](_0x481eb5[_0xaaf5('0x37')][_0xaaf5('0x1f')]);_0x1951ae['offset']=qs[_0xaaf5('0x20')](_0x481eb5['query'][_0xaaf5('0x20')]);}_0x1951ae[_0xaaf5('0x3e')]=qs['sort'](_0x481eb5[_0xaaf5('0x37')][_0xaaf5('0x3f')]);_0x1951ae[_0xaaf5('0x40')]=qs[_0xaaf5('0x41')](_['pick'](_0x481eb5['query'],_0x4e852c[_0xaaf5('0x41')]),_0x4bb9c8);if(_0x481eb5['query'][_0xaaf5('0x42')]){_0x1951ae['where']=_['merge'](_0x1951ae['where'],{'$or':_['map'](_0x4bb9c8,function(_0x4fe5d9){if(_0x4fe5d9[_0xaaf5('0x33')]!==_0xaaf5('0x43')){var _0x1e345f={};_0x1e345f[_0x4fe5d9[_0xaaf5('0x36')]]={'$like':'%'+_0x481eb5[_0xaaf5('0x37')]['filter']+'%'};return _0x1e345f;}})});}_0x1951ae=_[_0xaaf5('0x44')]({},_0x1951ae,_0x481eb5[_0xaaf5('0x45')]);var _0x505a36={'where':_0x1951ae[_0xaaf5('0x40')]};return db['VoiceChanSpy']['count'](_0x505a36)[_0xaaf5('0x28')](function(_0x39ee6a){_0x491ca1[_0xaaf5('0x21')]=_0x39ee6a;if(_0x481eb5[_0xaaf5('0x37')][_0xaaf5('0x46')]){_0x1951ae['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0xaaf5('0x47')](_0x1951ae);})[_0xaaf5('0x28')](function(_0x240118){_0x491ca1[_0xaaf5('0x48')]=_0x240118;return _0x491ca1;})[_0xaaf5('0x28')](respondWithFilteredResult(_0x2e93c4,_0x1951ae))[_0xaaf5('0x49')](handleError(_0x2e93c4,null));};exports[_0xaaf5('0x4a')]=function(_0x4a90ea,_0x859136){var _0xf2f50a={'raw':![],'where':{'id':_0x4a90ea[_0xaaf5('0x4b')]['id']}},_0x2a91e8={};_0x2a91e8['model']=_[_0xaaf5('0x38')](db['VoiceChanSpy'][_0xaaf5('0x31')]);_0x2a91e8['query']=_[_0xaaf5('0x38')](_0x4a90ea['query']);_0x2a91e8['filters']=_['intersection'](_0x2a91e8['model'],_0x2a91e8[_0xaaf5('0x37')]);_0xf2f50a[_0xaaf5('0x3b')]=_[_0xaaf5('0x39')](_0x2a91e8[_0xaaf5('0x35')],qs[_0xaaf5('0x3a')](_0x4a90ea[_0xaaf5('0x37')][_0xaaf5('0x3a')]));_0xf2f50a['attributes']=_0xf2f50a[_0xaaf5('0x3b')][_0xaaf5('0x3c')]?_0xf2f50a['attributes']:_0x2a91e8[_0xaaf5('0x35')];if(_0x4a90ea[_0xaaf5('0x37')][_0xaaf5('0x46')]){_0xf2f50a[_0xaaf5('0x4c')]=[{'all':!![]}];}_0xf2f50a=_[_0xaaf5('0x44')]({},_0xf2f50a,_0x4a90ea[_0xaaf5('0x45')]);return db['VoiceChanSpy']['find'](_0xf2f50a)[_0xaaf5('0x28')](handleEntityNotFound(_0x859136,null))[_0xaaf5('0x28')](respondWithResult(_0x859136,null))[_0xaaf5('0x49')](handleError(_0x859136,null));};exports['create']=function(_0x470afa,_0x584cce){return db[_0xaaf5('0x30')][_0xaaf5('0x4d')](_0x470afa[_0xaaf5('0x4e')],{})[_0xaaf5('0x28')](function(_0x1413e4){var _0x11201a=_0x470afa[_0xaaf5('0x4f')]['get']({'plain':!![]});if(!_0x11201a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11201a[_0xaaf5('0x50')]===_0xaaf5('0x4f')){var _0x33c979=_0x1413e4[_0xaaf5('0x2a')]({'plain':!![]});var _0x46ddfa='ChanSpies';return db[_0xaaf5('0x51')][_0xaaf5('0x52')]({'where':{'name':_0x46ddfa,'userProfileId':_0x11201a['userProfileId']},'raw':!![]})[_0xaaf5('0x28')](function(_0x409b29){if(_0x409b29&&_0x409b29[_0xaaf5('0x53')]===0x0){return db['UserProfileResource'][_0xaaf5('0x4d')]({'name':_0x33c979['name'],'resourceId':_0x33c979['id'],'type':_0x409b29['name'],'sectionId':_0x409b29['id']},{})['then'](function(){return _0x1413e4;});}else{return _0x1413e4;}})[_0xaaf5('0x49')](function(_0x5b1318){logger[_0xaaf5('0x2d')](_0xaaf5('0x54'),_0x5b1318);throw _0x5b1318;});}return _0x1413e4;})[_0xaaf5('0x28')](respondWithResult(_0x584cce,0xc9))[_0xaaf5('0x49')](handleError(_0x584cce,null));};exports[_0xaaf5('0x27')]=function(_0x528d4f,_0x6de53a){if(_0x528d4f[_0xaaf5('0x4e')]['id']){delete _0x528d4f[_0xaaf5('0x4e')]['id'];}return db[_0xaaf5('0x30')]['find']({'where':{'id':_0x528d4f[_0xaaf5('0x4b')]['id']}})[_0xaaf5('0x28')](handleEntityNotFound(_0x6de53a,null))[_0xaaf5('0x28')](saveUpdates(_0x528d4f['body'],null))['then'](respondWithResult(_0x6de53a,null))[_0xaaf5('0x49')](handleError(_0x6de53a,null));};exports[_0xaaf5('0x29')]=function(_0x2862c4,_0x754534){return db['VoiceChanSpy'][_0xaaf5('0x52')]({'where':{'id':_0x2862c4[_0xaaf5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x754534,null))[_0xaaf5('0x28')](removeEntity(_0x754534,null))[_0xaaf5('0x49')](handleError(_0x754534,null));}; \ No newline at end of file +var _0xe739=['VoiceChanSpy','findAll','rows','show','params','length','includeAll','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xe739,0x105));var _0x9e73=function(_0x45037e,_0x560658){_0x45037e=_0x45037e-0x0;var _0x520f3a=_0xe739[_0x45037e];return _0x520f3a;};'use strict';var emlformat=require(_0x9e73('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e73('0x1'));var jsonpatch=require(_0x9e73('0x2'));var rp=require(_0x9e73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9e73('0x4'));var path=require(_0x9e73('0x5'));var sox=require(_0x9e73('0x6'));var csv=require(_0x9e73('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e73('0x8'));var _=require(_0x9e73('0x9'));var squel=require(_0x9e73('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e73('0xb'));var deskjs=require(_0x9e73('0xc'));var toCsv=require(_0x9e73('0x7'));var querystring=require(_0x9e73('0xd'));var Papa=require(_0x9e73('0xe'));var Redis=require(_0x9e73('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9e73('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e73('0x11'))('api');var utils=require(_0x9e73('0x12'));var config=require(_0x9e73('0x13'));var licenseUtil=require(_0x9e73('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x102bb9,_0x4696e2){_0x4696e2=_0x4696e2||0xcc;return function(_0x45c2d0){if(_0x45c2d0){return _0x102bb9[_0x9e73('0x15')](_0x4696e2);}return _0x102bb9['status'](_0x4696e2)[_0x9e73('0x16')]();};}function respondWithResult(_0x607981,_0x3a7bd5){_0x3a7bd5=_0x3a7bd5||0xc8;return function(_0x5be2fa){if(_0x5be2fa){return _0x607981[_0x9e73('0x17')](_0x3a7bd5)[_0x9e73('0x18')](_0x5be2fa);}};}function respondWithFilteredResult(_0x597492,_0x367857){return function(_0x327305){if(_0x327305){var _0x21bd3a=typeof _0x367857['offset']===_0x9e73('0x19')&&typeof _0x367857['limit']===_0x9e73('0x19');var _0x58bbaa=_0x327305[_0x9e73('0x1a')];var _0x48b1db=_0x21bd3a?0x0:_0x367857['offset'];var _0x419c5b=_0x21bd3a?_0x327305[_0x9e73('0x1a')]:_0x367857[_0x9e73('0x1b')]+_0x367857[_0x9e73('0x1c')];var _0x3e56d8;if(_0x419c5b>=_0x58bbaa){_0x419c5b=_0x58bbaa;_0x3e56d8=0xc8;}else{_0x3e56d8=0xce;}_0x597492[_0x9e73('0x17')](_0x3e56d8);return _0x597492[_0x9e73('0x1d')](_0x9e73('0x1e'),_0x48b1db+'-'+_0x419c5b+'/'+_0x58bbaa)[_0x9e73('0x18')](_0x327305);}return null;};}function patchUpdates(_0x3f56bf){return function(_0x4a5cd1){try{jsonpatch[_0x9e73('0x1f')](_0x4a5cd1,_0x3f56bf,!![]);}catch(_0x5c6bae){return BPromise[_0x9e73('0x20')](_0x5c6bae);}return _0x4a5cd1['save']();};}function saveUpdates(_0x31d354,_0x589a5d){return function(_0x2c2b32){if(_0x2c2b32){return _0x2c2b32[_0x9e73('0x21')](_0x31d354)['then'](function(_0x55704a){return _0x55704a;});}return null;};}function removeEntity(_0x127afd,_0x5c6322){return function(_0x256ea1){if(_0x256ea1){return _0x256ea1[_0x9e73('0x22')]()[_0x9e73('0x23')](function(){var _0x5117af=_0x256ea1[_0x9e73('0x24')]({'plain':!![]});var _0x3a845c='ChanSpies';return db['UserProfileResource'][_0x9e73('0x22')]({'where':{'type':_0x3a845c,'resourceId':_0x5117af['id']}})['then'](function(){return _0x256ea1;});})['then'](function(){_0x127afd[_0x9e73('0x17')](0xcc)[_0x9e73('0x16')]();});}};}function handleEntityNotFound(_0x46991c,_0x47dcd2){return function(_0x368a70){if(!_0x368a70){_0x46991c[_0x9e73('0x15')](0x194);}return _0x368a70;};}function handleError(_0x4e77bb,_0xbbc614){_0xbbc614=_0xbbc614||0x1f4;return function(_0x24532d){logger[_0x9e73('0x25')](_0x24532d[_0x9e73('0x26')]);if(_0x24532d[_0x9e73('0x27')]){delete _0x24532d['name'];}_0x4e77bb[_0x9e73('0x17')](_0xbbc614)['send'](_0x24532d);};}exports[_0x9e73('0x28')]=function(_0x1ba338,_0xb3ef4f){var _0x15e4f3={},_0x2ef884={},_0x48d73c={'count':0x0,'rows':[]};var _0x11aaa7=_[_0x9e73('0x29')](db['VoiceChanSpy']['rawAttributes'],function(_0x296b93){return{'name':_0x296b93[_0x9e73('0x2a')],'type':_0x296b93[_0x9e73('0x2b')][_0x9e73('0x2c')]};});_0x2ef884[_0x9e73('0x2d')]=_[_0x9e73('0x29')](_0x11aaa7,'name');_0x2ef884[_0x9e73('0x2e')]=_[_0x9e73('0x2f')](_0x1ba338[_0x9e73('0x2e')]);_0x2ef884[_0x9e73('0x30')]=_[_0x9e73('0x31')](_0x2ef884[_0x9e73('0x2d')],_0x2ef884[_0x9e73('0x2e')]);_0x15e4f3[_0x9e73('0x32')]=_[_0x9e73('0x31')](_0x2ef884[_0x9e73('0x2d')],qs['fields'](_0x1ba338[_0x9e73('0x2e')][_0x9e73('0x33')]));_0x15e4f3[_0x9e73('0x32')]=_0x15e4f3[_0x9e73('0x32')]['length']?_0x15e4f3[_0x9e73('0x32')]:_0x2ef884[_0x9e73('0x2d')];if(!_0x1ba338['query']['hasOwnProperty'](_0x9e73('0x34'))){_0x15e4f3[_0x9e73('0x1c')]=qs[_0x9e73('0x1c')](_0x1ba338[_0x9e73('0x2e')][_0x9e73('0x1c')]);_0x15e4f3[_0x9e73('0x1b')]=qs['offset'](_0x1ba338['query']['offset']);}_0x15e4f3[_0x9e73('0x35')]=qs[_0x9e73('0x36')](_0x1ba338[_0x9e73('0x2e')]['sort']);_0x15e4f3['where']=qs['filters'](_[_0x9e73('0x37')](_0x1ba338[_0x9e73('0x2e')],_0x2ef884[_0x9e73('0x30')]),_0x11aaa7);if(_0x1ba338[_0x9e73('0x2e')]['filter']){_0x15e4f3[_0x9e73('0x38')]=_[_0x9e73('0x39')](_0x15e4f3[_0x9e73('0x38')],{'$or':_[_0x9e73('0x29')](_0x11aaa7,function(_0x28d10e){if(_0x28d10e[_0x9e73('0x2b')]!==_0x9e73('0x3a')){var _0x3431a8={};_0x3431a8[_0x28d10e[_0x9e73('0x27')]]={'$like':'%'+_0x1ba338[_0x9e73('0x2e')]['filter']+'%'};return _0x3431a8;}})});}_0x15e4f3=_['merge']({},_0x15e4f3,_0x1ba338['options']);var _0x510b69={'where':_0x15e4f3[_0x9e73('0x38')]};return db[_0x9e73('0x3b')]['count'](_0x510b69)[_0x9e73('0x23')](function(_0x2038fb){_0x48d73c['count']=_0x2038fb;if(_0x1ba338['query']['includeAll']){_0x15e4f3['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x9e73('0x3c')](_0x15e4f3);})[_0x9e73('0x23')](function(_0xee1f5){_0x48d73c[_0x9e73('0x3d')]=_0xee1f5;return _0x48d73c;})['then'](respondWithFilteredResult(_0xb3ef4f,_0x15e4f3))['catch'](handleError(_0xb3ef4f,null));};exports[_0x9e73('0x3e')]=function(_0x2ad38a,_0x41c3af){var _0x37a43f={'raw':![],'where':{'id':_0x2ad38a[_0x9e73('0x3f')]['id']}},_0x3f348f={};_0x3f348f['model']=_[_0x9e73('0x2f')](db[_0x9e73('0x3b')]['rawAttributes']);_0x3f348f[_0x9e73('0x2e')]=_[_0x9e73('0x2f')](_0x2ad38a['query']);_0x3f348f[_0x9e73('0x30')]=_[_0x9e73('0x31')](_0x3f348f['model'],_0x3f348f[_0x9e73('0x2e')]);_0x37a43f[_0x9e73('0x32')]=_[_0x9e73('0x31')](_0x3f348f[_0x9e73('0x2d')],qs[_0x9e73('0x33')](_0x2ad38a[_0x9e73('0x2e')][_0x9e73('0x33')]));_0x37a43f[_0x9e73('0x32')]=_0x37a43f[_0x9e73('0x32')][_0x9e73('0x40')]?_0x37a43f[_0x9e73('0x32')]:_0x3f348f[_0x9e73('0x2d')];if(_0x2ad38a[_0x9e73('0x2e')][_0x9e73('0x41')]){_0x37a43f[_0x9e73('0x42')]=[{'all':!![]}];}_0x37a43f=_[_0x9e73('0x39')]({},_0x37a43f,_0x2ad38a['options']);return db[_0x9e73('0x3b')]['find'](_0x37a43f)['then'](handleEntityNotFound(_0x41c3af,null))[_0x9e73('0x23')](respondWithResult(_0x41c3af,null))[_0x9e73('0x43')](handleError(_0x41c3af,null));};exports['create']=function(_0x4baaf7,_0x308e86){return db[_0x9e73('0x3b')][_0x9e73('0x44')](_0x4baaf7[_0x9e73('0x45')],{})[_0x9e73('0x23')](function(_0x4617da){var _0x2c55df=_0x4baaf7[_0x9e73('0x46')][_0x9e73('0x24')]({'plain':!![]});if(!_0x2c55df)throw new Error(_0x9e73('0x47'));if(_0x2c55df[_0x9e73('0x48')]===_0x9e73('0x46')){var _0x230249=_0x4617da[_0x9e73('0x24')]({'plain':!![]});var _0x5a5ba9=_0x9e73('0x49');return db[_0x9e73('0x4a')][_0x9e73('0x4b')]({'where':{'name':_0x5a5ba9,'userProfileId':_0x2c55df[_0x9e73('0x4c')]},'raw':!![]})[_0x9e73('0x23')](function(_0x28869a){if(_0x28869a&&_0x28869a[_0x9e73('0x4d')]===0x0){return db[_0x9e73('0x4e')]['create']({'name':_0x230249['name'],'resourceId':_0x230249['id'],'type':_0x28869a['name'],'sectionId':_0x28869a['id']},{})[_0x9e73('0x23')](function(){return _0x4617da;});}else{return _0x4617da;}})['catch'](function(_0x22f69a){logger['error'](_0x9e73('0x4f'),_0x22f69a);throw _0x22f69a;});}return _0x4617da;})['then'](respondWithResult(_0x308e86,0xc9))[_0x9e73('0x43')](handleError(_0x308e86,null));};exports[_0x9e73('0x21')]=function(_0x23e23d,_0x43c524){if(_0x23e23d[_0x9e73('0x45')]['id']){delete _0x23e23d[_0x9e73('0x45')]['id'];}return db[_0x9e73('0x3b')]['find']({'where':{'id':_0x23e23d[_0x9e73('0x3f')]['id']}})['then'](handleEntityNotFound(_0x43c524,null))[_0x9e73('0x23')](saveUpdates(_0x23e23d[_0x9e73('0x45')],null))[_0x9e73('0x23')](respondWithResult(_0x43c524,null))['catch'](handleError(_0x43c524,null));};exports[_0x9e73('0x22')]=function(_0x2e61eb,_0x50737d){return db[_0x9e73('0x3b')][_0x9e73('0x4b')]({'where':{'id':_0x2e61eb[_0x9e73('0x3f')]['id']}})[_0x9e73('0x23')](handleEntityNotFound(_0x50737d,null))[_0x9e73('0x23')](removeEntity(_0x50737d,null))['catch'](handleError(_0x50737d,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index f57d78d..c64e258 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 _0xdfd9=['concat','internal','User','findAll','agent','then','catch','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','./voiceChanSpy.attributes','context','format','%s%s','system','push','merge','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xdfd9,0x14d));var _0x9dfd=function(_0xc6d895,_0x5e13d2){_0xc6d895=_0xc6d895-0x0;var _0x41c69e=_0xdfd9[_0xc6d895];return _0x41c69e;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require('bluebird');var attributes=require(_0x9dfd('0x0'));var getUserApplications=function(_0x23599e,_0x117f44,_0x9fa2ec){var _0x563ae6=0x1;var _0x5e353f=[];var _0x50770d={'context':_0x117f44[_0x9dfd('0x1')]||'from-sip','exten':util[_0x9dfd('0x2')](_0x9dfd('0x3'),_0x23599e['prefix'],_0x9fa2ec),'type':_0x9dfd('0x4'),'isApp':![],'ChanSpyId':_0x23599e['id'],'UserId':_0x117f44['id']};_0x5e353f[_0x9dfd('0x5')](_[_0x9dfd('0x6')]({'app':'Set','appdata':util['format']('CDR(type)=%s',_0x9dfd('0x7')),'priority':_0x563ae6++},_0x50770d));if(_0x23599e[_0x9dfd('0x8')]){_0x5e353f[_0x9dfd('0x5')](_['merge']({'app':_0x9dfd('0x9'),'appdata':util['format'](_0x9dfd('0xa'),_0x23599e[_0x9dfd('0xb')]),'priority':_0x563ae6++},_0x50770d));}if(_0x23599e['auth']){_0x5e353f[_0x9dfd('0x5')](_[_0x9dfd('0x6')]({'app':_0x9dfd('0xc'),'appdata':_0x23599e[_0x9dfd('0xd')],'priority':_0x563ae6++},_0x50770d));}_0x5e353f[_0x9dfd('0x5')](_[_0x9dfd('0x6')]({'app':_0x9dfd('0xe'),'appdata':util[_0x9dfd('0x2')](_0x9dfd('0xf'),_0x117f44[_0x9dfd('0x10')],_0x23599e[_0x9dfd('0x11')]?_0x23599e[_0x9dfd('0x11')]['join'](''):''),'priority':_0x563ae6++},_0x50770d));if(_0x23599e[_0x9dfd('0x8')]){_0x5e353f['push'](_['merge']({'app':_0x9dfd('0x12'),'priority':_0x563ae6++},_0x50770d));}return _0x5e353f;};var getChanSpyApplications=function(_0x213747,_0x324c3f){var _0x232447=[];for(var _0x30ed1d=0x0,_0x1012c2=0x1;_0x30ed1d<_0x324c3f['length'];_0x30ed1d++,_0x1012c2=0x1){_0x232447=_0x232447[_0x9dfd('0x13')](getUserApplications(_0x213747,_0x324c3f[_0x30ed1d],_0x324c3f[_0x30ed1d][_0x9dfd('0x14')]));if(_0x324c3f[_0x30ed1d][_0x9dfd('0x14')]!=_0x324c3f[_0x30ed1d][_0x9dfd('0x10')]){_0x232447=_0x232447[_0x9dfd('0x13')](getUserApplications(_0x213747,_0x324c3f[_0x30ed1d],_0x324c3f[_0x30ed1d][_0x9dfd('0x10')]));}}return _0x232447;};var getChanSpyPromise=function(_0x21d22b,_0x4db0a1){return new BPromise(function(_0x372b8f,_0xf81daa){return _0x21d22b[_0x9dfd('0x15')][_0x9dfd('0x16')]({'attributes':['id',_0x9dfd('0x10'),_0x9dfd('0x14')],'where':{'role':_0x9dfd('0x17'),'chanspy':!![]},'raw':!![]})[_0x9dfd('0x18')](function(_0x38489f){if(_0x38489f){return _0x372b8f(getChanSpyApplications(_0x4db0a1,_0x38489f));}return _0x372b8f([]);})[_0x9dfd('0x19')](function(_0x1f07aa){_0xf81daa(_0x1f07aa);});});};module['exports']=function(_0x372216,_0x3279c3){var _0x49a0d2=_0x372216['models'];return _0x372216[_0x9dfd('0x1a')](_0x9dfd('0x1b'),attributes,{'tableName':_0x9dfd('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x55a3cb,_0x35ea9a,_0x257817){return getChanSpyPromise(_0x49a0d2,_0x55a3cb)[_0x9dfd('0x18')](function(_0xef0340){if(_0xef0340&&_0xef0340['length']){return _0x49a0d2[_0x9dfd('0x1d')][_0x9dfd('0x1e')](_0xef0340);}})[_0x9dfd('0x18')](function(){_0x257817();})[_0x9dfd('0x19')](function(_0x1a2846){_0x257817(_0x1a2846);});},'afterUpdate':function(_0x11f249,_0x189d8c,_0x182cd4){return _0x49a0d2[_0x9dfd('0x1d')][_0x9dfd('0x1f')]({'where':{'ChanSpyId':_0x11f249['id']}})[_0x9dfd('0x18')](function(){return getChanSpyPromise(_0x49a0d2,_0x11f249);})[_0x9dfd('0x18')](function(_0xbdd5c8){if(_0xbdd5c8&&_0xbdd5c8['length']){return _0x49a0d2[_0x9dfd('0x1d')][_0x9dfd('0x1e')](_0xbdd5c8);}})[_0x9dfd('0x18')](function(){_0x182cd4();})[_0x9dfd('0x19')](function(_0x7a1a87){_0x182cd4(_0x7a1a87);});},'afterDestroy':function(_0x127874,_0x5e8659,_0x28568e){return _0x49a0d2[_0x9dfd('0x1d')][_0x9dfd('0x1f')]({'where':{'ChanSpyId':_0x127874['id']}})[_0x9dfd('0x18')](function(){_0x28568e();})[_0x9dfd('0x19')](function(_0x2516d8){_0x28568e(_0x2516d8);});}}});}; \ No newline at end of file +var _0xe911=['catch','models','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','destroy','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push','Set','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','ChanSpy','SIP/%s,%s','name','options','internal','concat','User','findAll','agent','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe911,0x1c3));var _0x1e91=function(_0x8eb327,_0x2e032f){_0x8eb327=_0x8eb327-0x0;var _0x393b21=_0xe911[_0x8eb327];return _0x393b21;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require('bluebird');var attributes=require(_0x1e91('0x0'));var getUserApplications=function(_0x4071c3,_0x50ee05,_0x5cd417){var _0x454d57=0x1;var _0x56019a=[];var _0x546e14={'context':_0x50ee05[_0x1e91('0x1')]||'from-sip','exten':util[_0x1e91('0x2')](_0x1e91('0x3'),_0x4071c3[_0x1e91('0x4')],_0x5cd417),'type':_0x1e91('0x5'),'isApp':![],'ChanSpyId':_0x4071c3['id'],'UserId':_0x50ee05['id']};_0x56019a[_0x1e91('0x6')](_['merge']({'app':_0x1e91('0x7'),'appdata':util[_0x1e91('0x2')]('CDR(type)=%s',_0x1e91('0x8')),'priority':_0x454d57++},_0x546e14));if(_0x4071c3[_0x1e91('0x9')]){_0x56019a[_0x1e91('0x6')](_[_0x1e91('0xa')]({'app':_0x1e91('0xb'),'appdata':util[_0x1e91('0x2')](_0x1e91('0xc'),_0x4071c3[_0x1e91('0xd')]),'priority':_0x454d57++},_0x546e14));}if(_0x4071c3['auth']){_0x56019a[_0x1e91('0x6')](_[_0x1e91('0xa')]({'app':_0x1e91('0xe'),'appdata':_0x4071c3['password'],'priority':_0x454d57++},_0x546e14));}_0x56019a[_0x1e91('0x6')](_['merge']({'app':_0x1e91('0xf'),'appdata':util['format'](_0x1e91('0x10'),_0x50ee05[_0x1e91('0x11')],_0x4071c3[_0x1e91('0x12')]?_0x4071c3['options']['join'](''):''),'priority':_0x454d57++},_0x546e14));if(_0x4071c3[_0x1e91('0x9')]){_0x56019a['push'](_[_0x1e91('0xa')]({'app':'StopMixMonitor','priority':_0x454d57++},_0x546e14));}return _0x56019a;};var getChanSpyApplications=function(_0x395235,_0x52fba1){var _0x1a1674=[];for(var _0x36f516=0x0,_0xdba0b9=0x1;_0x36f516<_0x52fba1['length'];_0x36f516++,_0xdba0b9=0x1){_0x1a1674=_0x1a1674['concat'](getUserApplications(_0x395235,_0x52fba1[_0x36f516],_0x52fba1[_0x36f516][_0x1e91('0x13')]));if(_0x52fba1[_0x36f516][_0x1e91('0x13')]!=_0x52fba1[_0x36f516][_0x1e91('0x11')]){_0x1a1674=_0x1a1674[_0x1e91('0x14')](getUserApplications(_0x395235,_0x52fba1[_0x36f516],_0x52fba1[_0x36f516][_0x1e91('0x11')]));}}return _0x1a1674;};var getChanSpyPromise=function(_0xda2af6,_0x53675b){return new BPromise(function(_0x560d6d,_0x42ac75){return _0xda2af6[_0x1e91('0x15')][_0x1e91('0x16')]({'attributes':['id',_0x1e91('0x11'),_0x1e91('0x13')],'where':{'role':_0x1e91('0x17'),'chanspy':!![]},'raw':!![]})[_0x1e91('0x18')](function(_0x294f55){if(_0x294f55){return _0x560d6d(getChanSpyApplications(_0x53675b,_0x294f55));}return _0x560d6d([]);})[_0x1e91('0x19')](function(_0x47c29c){_0x42ac75(_0x47c29c);});});};module['exports']=function(_0x128854,_0x18301f){var _0x4aef75=_0x128854[_0x1e91('0x1a')];return _0x128854[_0x1e91('0x1b')](_0x1e91('0x1c'),attributes,{'tableName':_0x1e91('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x35dcf8,_0x57a56e,_0x503e2e){return getChanSpyPromise(_0x4aef75,_0x35dcf8)['then'](function(_0x1ade08){if(_0x1ade08&&_0x1ade08[_0x1e91('0x1e')]){return _0x4aef75[_0x1e91('0x1f')][_0x1e91('0x20')](_0x1ade08);}})[_0x1e91('0x18')](function(){_0x503e2e();})[_0x1e91('0x19')](function(_0x4067e5){_0x503e2e(_0x4067e5);});},'afterUpdate':function(_0x1afabe,_0x3eeddc,_0x2d418a){return _0x4aef75[_0x1e91('0x1f')]['destroy']({'where':{'ChanSpyId':_0x1afabe['id']}})['then'](function(){return getChanSpyPromise(_0x4aef75,_0x1afabe);})[_0x1e91('0x18')](function(_0x1b2f8f){if(_0x1b2f8f&&_0x1b2f8f[_0x1e91('0x1e')]){return _0x4aef75[_0x1e91('0x1f')]['bulkCreate'](_0x1b2f8f);}})['then'](function(){_0x2d418a();})[_0x1e91('0x19')](function(_0x19f412){_0x2d418a(_0x19f412);});},'afterDestroy':function(_0x5e1cb2,_0x51c308,_0x492b22){return _0x4aef75[_0x1e91('0x1f')][_0x1e91('0x21')]({'where':{'ChanSpyId':_0x5e1cb2['id']}})[_0x1e91('0x18')](function(){_0x492b22();})[_0x1e91('0x19')](function(_0x20d5e5){_0x492b22(_0x20d5e5);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 2b857dd..b681d11 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 _0x19ea=['result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x44709b,_0x1cfbf1){var _0x47cd92=function(_0x492705){while(--_0x492705){_0x44709b['push'](_0x44709b['shift']());}};_0x47cd92(++_0x1cfbf1);}(_0x19ea,0xfe));var _0xa19e=function(_0x3fb9dd,_0x174fff){_0x3fb9dd=_0x3fb9dd-0x0;var _0x20136a=_0x19ea[_0x3fb9dd];return _0x20136a;};'use strict';var _=require(_0xa19e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa19e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19e('0x2'));var db=require(_0xa19e('0x3'))['db'];var utils=require(_0xa19e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa19e('0x5'));var jayson=require(_0xa19e('0x6'));var client=jayson[_0xa19e('0x7')][_0xa19e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1087e7,_0x30fd4a,_0x336e23){return new BPromise(function(_0x1867cb,_0x44e468){return client[_0xa19e('0x9')](_0x1087e7,_0x336e23)[_0xa19e('0xa')](function(_0x59b907){logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));logger[_0xa19e('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x30fd4a,_0xa19e('0xd'),JSON[_0xa19e('0xf')](_0x59b907));if(_0x59b907[_0xa19e('0x10')]){if(_0x59b907['error'][_0xa19e('0x11')]===0x1f4){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x44e468(_0x59b907['error'][_0xa19e('0x12')]);}logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x1867cb(_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);}else{logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));_0x1867cb(_0x59b907[_0xa19e('0x13')]['message']);}})[_0xa19e('0x14')](function(_0x34066a){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x34066a);_0x44e468(_0x34066a);});});} \ No newline at end of file +var _0x8130=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x773fa3,_0x1f033f){var _0x48666d=function(_0xc98c60){while(--_0xc98c60){_0x773fa3['push'](_0x773fa3['shift']());}};_0x48666d(++_0x1f033f);}(_0x8130,0x146));var _0x0813=function(_0x1ed161,_0x11cce0){_0x1ed161=_0x1ed161-0x0;var _0x1b6bf4=_0x8130[_0x1ed161];return _0x1b6bf4;};'use strict';var _=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var moment=require('moment');var BPromise=require(_0x0813('0x2'));var rs=require(_0x0813('0x3'));var fs=require('fs');var Redis=require(_0x0813('0x4'));var db=require(_0x0813('0x5'))['db'];var utils=require(_0x0813('0x6'));var logger=require(_0x0813('0x7'))('rpc');var config=require(_0x0813('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0813('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2df45a,_0x2bbdfd,_0x19a508){return new BPromise(function(_0x2ab8f0,_0x115a90){return client[_0x0813('0xa')](_0x2df45a,_0x19a508)['then'](function(_0x44ec2c){logger[_0x0813('0xb')](_0x0813('0xc'),_0x2bbdfd,'request\x20sent');logger['debug'](_0x0813('0xd'),_0x2bbdfd,'request\x20sent',JSON[_0x0813('0xe')](_0x44ec2c));if(_0x44ec2c['error']){if(_0x44ec2c[_0x0813('0xf')][_0x0813('0x10')]===0x1f4){logger[_0x0813('0xf')](_0x0813('0xc'),_0x2bbdfd,_0x44ec2c['error']['message']);return _0x115a90(_0x44ec2c[_0x0813('0xf')][_0x0813('0x11')]);}logger['error'](_0x0813('0xc'),_0x2bbdfd,_0x44ec2c['error']['message']);return _0x2ab8f0(_0x44ec2c[_0x0813('0xf')][_0x0813('0x11')]);}else{logger['info'](_0x0813('0xc'),_0x2bbdfd,'request\x20sent');_0x2ab8f0(_0x44ec2c[_0x0813('0x12')][_0x0813('0x11')]);}})[_0x0813('0x13')](function(_0xee126d){logger[_0x0813('0xf')](_0x0813('0xc'),_0x2bbdfd,_0xee126d);_0x115a90(_0xee126d);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 4e016c6..0f75e33 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 _0x7adb=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x6f3531,_0x40e673){var _0x3f63ce=function(_0x15b1a3){while(--_0x15b1a3){_0x6f3531['push'](_0x6f3531['shift']());}};_0x3f63ce(++_0x40e673);}(_0x7adb,0xff));var _0xb7ad=function(_0x518959,_0x39f956){_0x518959=_0x518959-0x0;var _0x52f663=_0x7adb[_0x518959];return _0x52f663;};'use strict';var multer=require(_0xb7ad('0x0'));var util=require(_0xb7ad('0x1'));var path=require(_0xb7ad('0x2'));var timeout=require(_0xb7ad('0x3'));var express=require(_0xb7ad('0x4'));var router=express[_0xb7ad('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb7ad('0x6'));var interaction=require(_0xb7ad('0x7'));var config=require(_0xb7ad('0x8'));var controller=require(_0xb7ad('0x9'));router[_0xb7ad('0xa')]('/',auth[_0xb7ad('0xb')](),controller[_0xb7ad('0xc')]);router['get'](_0xb7ad('0xd'),auth[_0xb7ad('0xb')](),controller[_0xb7ad('0xe')]);router['post']('/',auth[_0xb7ad('0xb')](),controller[_0xb7ad('0xf')]);router[_0xb7ad('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb7ad('0x11')]('/:id',auth[_0xb7ad('0xb')](),controller[_0xb7ad('0x12')]);module[_0xb7ad('0x13')]=router; \ No newline at end of file +var _0x2fd2=['get','isAuthenticated','index','show','post','create','put','/:id','delete','multer','util','path','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);}(_0x2fd2,0x100));var _0x22fd=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2fd2[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x22fd('0x0'));var util=require(_0x22fd('0x1'));var path=require(_0x22fd('0x2'));var timeout=require(_0x22fd('0x3'));var express=require(_0x22fd('0x4'));var router=express[_0x22fd('0x5')]();var fs_extra=require(_0x22fd('0x6'));var auth=require(_0x22fd('0x7'));var interaction=require(_0x22fd('0x8'));var config=require(_0x22fd('0x9'));var controller=require('./voiceContext.controller');router[_0x22fd('0xa')]('/',auth[_0x22fd('0xb')](),controller[_0x22fd('0xc')]);router[_0x22fd('0xa')]('/:id',auth[_0x22fd('0xb')](),controller[_0x22fd('0xd')]);router[_0x22fd('0xe')]('/',auth[_0x22fd('0xb')](),controller[_0x22fd('0xf')]);router[_0x22fd('0x10')](_0x22fd('0x11'),auth[_0x22fd('0xb')](),controller['update']);router[_0x22fd('0x12')](_0x22fd('0x11'),auth[_0x22fd('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 1ccbd7f..f5ffc70 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 _0x60e7=['sequelize','name','STRING','BOOLEAN'];(function(_0x309a28,_0x1f6466){var _0x47dce8=function(_0x55168f){while(--_0x55168f){_0x309a28['push'](_0x309a28['shift']());}};_0x47dce8(++_0x1f6466);}(_0x60e7,0x104));var _0x760e=function(_0x381d73,_0x4befa3){_0x381d73=_0x381d73-0x0;var _0x55b6a0=_0x60e7[_0x381d73];return _0x55b6a0;};'use strict';var Sequelize=require(_0x760e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x760e('0x1')},'description':{'type':Sequelize[_0x760e('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x760e('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5ee4=['name','BOOLEAN','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5ee4,0xea));var _0x45ee=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x5ee4[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require('sequelize');module[_0x45ee('0x0')]={'name':{'type':Sequelize[_0x45ee('0x1')],'unique':_0x45ee('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x45ee('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 2ce532d..752feda 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 _0x4b6f=['fieldName','type','key','model','keys','query','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','params','create','body','findAll','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','Reload','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','get','Contexts','stack','name','send','map','VoiceContext','rawAttributes'];(function(_0x10cbdf,_0x2147d7){var _0x7514e8=function(_0x265bff){while(--_0x265bff){_0x10cbdf['push'](_0x10cbdf['shift']());}};_0x7514e8(++_0x2147d7);}(_0x4b6f,0x8e));var _0xf4b6=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x4b6f[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf4b6('0x0'));var zipdir=require(_0xf4b6('0x1'));var jsonpatch=require(_0xf4b6('0x2'));var rp=require(_0xf4b6('0x3'));var moment=require(_0xf4b6('0x4'));var BPromise=require(_0xf4b6('0x5'));var Mustache=require(_0xf4b6('0x6'));var util=require(_0xf4b6('0x7'));var path=require(_0xf4b6('0x8'));var sox=require(_0xf4b6('0x9'));var csv=require('to-csv');var ejs=require(_0xf4b6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf4b6('0xb'));var deskjs=require(_0xf4b6('0xc'));var toCsv=require(_0xf4b6('0xd'));var querystring=require(_0xf4b6('0xe'));var Papa=require(_0xf4b6('0xf'));var Redis=require(_0xf4b6('0x10'));var authService=require(_0xf4b6('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4b6('0x12'))(_0xf4b6('0x13'));var utils=require('../../config/utils');var config=require(_0xf4b6('0x14'));var licenseUtil=require(_0xf4b6('0x15'));var db=require(_0xf4b6('0x16'))['db'];var jayson=require(_0xf4b6('0x17'));var client=jayson[_0xf4b6('0x18')][_0xf4b6('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3455e7,_0x2c9983,_0x154c5e,_0x4923fd){return new BPromise(function(_0x3043ec,_0x4ce227){var _0x4fbfef=_0x4923fd||client;return _0x4fbfef[_0xf4b6('0x1a')](_0x3455e7,_0x154c5e)[_0xf4b6('0x1b')](function(_0x24e427){logger['info'](_0xf4b6('0x1c'),_0x2c9983,_0xf4b6('0x1d'));logger['debug'](_0xf4b6('0x1e'),_0x2c9983,_0xf4b6('0x1d'),JSON[_0xf4b6('0x1f')](_0x24e427));if(_0x24e427[_0xf4b6('0x20')]){if(_0x24e427[_0xf4b6('0x20')]['code']===0x1f4){logger[_0xf4b6('0x20')](_0xf4b6('0x1c'),_0x2c9983,_0x24e427[_0xf4b6('0x20')][_0xf4b6('0x21')]);return _0x4ce227(_0x24e427[_0xf4b6('0x20')][_0xf4b6('0x21')]);}logger[_0xf4b6('0x20')](_0xf4b6('0x1c'),_0x2c9983,_0x24e427[_0xf4b6('0x20')][_0xf4b6('0x21')]);return _0x3043ec(_0x24e427[_0xf4b6('0x20')]['message']);}else{logger[_0xf4b6('0x22')]('VoiceContext,\x20%s,\x20%s',_0x2c9983,_0xf4b6('0x1d'));_0x3043ec(_0x24e427[_0xf4b6('0x23')]['message']);}})[_0xf4b6('0x24')](function(_0x2aa94f){logger[_0xf4b6('0x20')](_0xf4b6('0x1c'),_0x2c9983,_0x2aa94f);_0x4ce227(_0x2aa94f);});});}function respondWithStatusCode(_0x5dd10a,_0x20da91){_0x20da91=_0x20da91||0xcc;return function(_0x96ef95){if(_0x96ef95){return _0x5dd10a['sendStatus'](_0x20da91);}return _0x5dd10a[_0xf4b6('0x25')](_0x20da91)[_0xf4b6('0x26')]();};}function respondWithResult(_0x494779,_0x53fed8){_0x53fed8=_0x53fed8||0xc8;return function(_0x53f255){if(_0x53f255){return _0x494779[_0xf4b6('0x25')](_0x53fed8)['json'](_0x53f255);}};}function respondWithFilteredResult(_0x38ffa7,_0x46cd60){return function(_0x2a2bd2){if(_0x2a2bd2){var _0x36e823=typeof _0x46cd60[_0xf4b6('0x27')]===_0xf4b6('0x28')&&typeof _0x46cd60[_0xf4b6('0x29')]==='undefined';var _0x375ade=_0x2a2bd2['count'];var _0x769ea1=_0x36e823?0x0:_0x46cd60[_0xf4b6('0x27')];var _0x35e256=_0x36e823?_0x2a2bd2[_0xf4b6('0x2a')]:_0x46cd60['offset']+_0x46cd60[_0xf4b6('0x29')];var _0xf38308;if(_0x35e256>=_0x375ade){_0x35e256=_0x375ade;_0xf38308=0xc8;}else{_0xf38308=0xce;}_0x38ffa7[_0xf4b6('0x25')](_0xf38308);return _0x38ffa7[_0xf4b6('0x2b')](_0xf4b6('0x2c'),_0x769ea1+'-'+_0x35e256+'/'+_0x375ade)[_0xf4b6('0x2d')](_0x2a2bd2);}return null;};}function patchUpdates(_0x1a4847){return function(_0x341d5c){try{jsonpatch['apply'](_0x341d5c,_0x1a4847,!![]);}catch(_0x3b58f0){return BPromise[_0xf4b6('0x2e')](_0x3b58f0);}return _0x341d5c[_0xf4b6('0x2f')]();};}function saveUpdates(_0xc2e27a,_0x33a695){return function(_0x3e2f13){if(_0x3e2f13){return _0x3e2f13[_0xf4b6('0x30')](_0xc2e27a)[_0xf4b6('0x1b')](function(_0x2a58ea){return _0x2a58ea;});}return null;};}function removeEntity(_0x1b3194,_0x243a5d){return function(_0x47d9ae){if(_0x47d9ae){return _0x47d9ae[_0xf4b6('0x31')]()[_0xf4b6('0x1b')](function(){var _0x2974e8=_0x47d9ae[_0xf4b6('0x32')]({'plain':!![]});var _0x19aae1=_0xf4b6('0x33');return db['UserProfileResource'][_0xf4b6('0x31')]({'where':{'type':_0x19aae1,'resourceId':_0x2974e8['id']}})['then'](function(){return _0x47d9ae;});})[_0xf4b6('0x1b')](function(){_0x1b3194[_0xf4b6('0x25')](0xcc)[_0xf4b6('0x26')]();});}};}function handleEntityNotFound(_0xa6da52,_0x293200){return function(_0x2bdee4){if(!_0x2bdee4){_0xa6da52['sendStatus'](0x194);}return _0x2bdee4;};}function handleError(_0x3d0534,_0x3f364d){_0x3f364d=_0x3f364d||0x1f4;return function(_0x525352){logger['error'](_0x525352[_0xf4b6('0x34')]);if(_0x525352['name']){delete _0x525352[_0xf4b6('0x35')];}_0x3d0534['status'](_0x3f364d)[_0xf4b6('0x36')](_0x525352);};}exports['index']=function(_0x1ebdbb,_0x2fbf49){var _0x362148={},_0x152c98={},_0x23a198={'count':0x0,'rows':[]};var _0x37af9d=_[_0xf4b6('0x37')](db[_0xf4b6('0x38')][_0xf4b6('0x39')],function(_0x37bce7){return{'name':_0x37bce7[_0xf4b6('0x3a')],'type':_0x37bce7[_0xf4b6('0x3b')][_0xf4b6('0x3c')]};});_0x152c98[_0xf4b6('0x3d')]=_['map'](_0x37af9d,_0xf4b6('0x35'));_0x152c98['query']=_[_0xf4b6('0x3e')](_0x1ebdbb[_0xf4b6('0x3f')]);_0x152c98[_0xf4b6('0x40')]=_['intersection'](_0x152c98['model'],_0x152c98['query']);_0x362148['attributes']=_[_0xf4b6('0x41')](_0x152c98['model'],qs[_0xf4b6('0x42')](_0x1ebdbb['query'][_0xf4b6('0x42')]));_0x362148['attributes']=_0x362148['attributes'][_0xf4b6('0x43')]?_0x362148[_0xf4b6('0x44')]:_0x152c98['model'];if(!_0x1ebdbb['query']['hasOwnProperty'](_0xf4b6('0x45'))){_0x362148['limit']=qs['limit'](_0x1ebdbb[_0xf4b6('0x3f')][_0xf4b6('0x29')]);_0x362148[_0xf4b6('0x27')]=qs['offset'](_0x1ebdbb[_0xf4b6('0x3f')][_0xf4b6('0x27')]);}_0x362148[_0xf4b6('0x46')]=qs[_0xf4b6('0x47')](_0x1ebdbb[_0xf4b6('0x3f')][_0xf4b6('0x47')]);_0x362148[_0xf4b6('0x48')]=qs[_0xf4b6('0x40')](_[_0xf4b6('0x49')](_0x1ebdbb[_0xf4b6('0x3f')],_0x152c98[_0xf4b6('0x40')]),_0x37af9d);if(_0x1ebdbb[_0xf4b6('0x3f')][_0xf4b6('0x4a')]){_0x362148[_0xf4b6('0x48')]=_[_0xf4b6('0x4b')](_0x362148['where'],{'$or':_[_0xf4b6('0x37')](_0x37af9d,function(_0x3b72a6){if(_0x3b72a6['type']!==_0xf4b6('0x4c')){var _0x475a86={};_0x475a86[_0x3b72a6[_0xf4b6('0x35')]]={'$like':'%'+_0x1ebdbb[_0xf4b6('0x3f')][_0xf4b6('0x4a')]+'%'};return _0x475a86;}})});}_0x362148=_[_0xf4b6('0x4b')]({},_0x362148,_0x1ebdbb[_0xf4b6('0x4d')]);var _0x5d6a39={'where':_0x362148[_0xf4b6('0x48')]};return db[_0xf4b6('0x38')][_0xf4b6('0x2a')](_0x5d6a39)[_0xf4b6('0x1b')](function(_0x3e0c85){_0x23a198['count']=_0x3e0c85;if(_0x1ebdbb[_0xf4b6('0x3f')]['includeAll']){_0x362148[_0xf4b6('0x4e')]=[{'all':!![]}];}return db[_0xf4b6('0x38')]['findAll'](_0x362148);})[_0xf4b6('0x1b')](function(_0x1f8d31){_0x23a198[_0xf4b6('0x4f')]=_0x1f8d31;return _0x23a198;})[_0xf4b6('0x1b')](respondWithFilteredResult(_0x2fbf49,_0x362148))[_0xf4b6('0x24')](handleError(_0x2fbf49,null));};exports['show']=function(_0x52f17b,_0x363bfd){var _0x529ea3={'raw':![],'where':{'id':_0x52f17b[_0xf4b6('0x50')]['id']}},_0x48d0f2={};_0x48d0f2[_0xf4b6('0x3d')]=_[_0xf4b6('0x3e')](db[_0xf4b6('0x38')][_0xf4b6('0x39')]);_0x48d0f2[_0xf4b6('0x3f')]=_[_0xf4b6('0x3e')](_0x52f17b['query']);_0x48d0f2['filters']=_['intersection'](_0x48d0f2[_0xf4b6('0x3d')],_0x48d0f2[_0xf4b6('0x3f')]);_0x529ea3['attributes']=_[_0xf4b6('0x41')](_0x48d0f2[_0xf4b6('0x3d')],qs[_0xf4b6('0x42')](_0x52f17b['query'][_0xf4b6('0x42')]));_0x529ea3[_0xf4b6('0x44')]=_0x529ea3[_0xf4b6('0x44')][_0xf4b6('0x43')]?_0x529ea3[_0xf4b6('0x44')]:_0x48d0f2[_0xf4b6('0x3d')];if(_0x52f17b[_0xf4b6('0x3f')]['includeAll']){_0x529ea3[_0xf4b6('0x4e')]=[{'all':!![]}];}_0x529ea3=_[_0xf4b6('0x4b')]({},_0x529ea3,_0x52f17b['options']);return db['VoiceContext']['find'](_0x529ea3)[_0xf4b6('0x1b')](handleEntityNotFound(_0x363bfd,null))[_0xf4b6('0x1b')](respondWithResult(_0x363bfd,null))[_0xf4b6('0x24')](handleError(_0x363bfd,null));};exports[_0xf4b6('0x51')]=function(_0x3752dc,_0x1e10e3,_0x37a0c6){var _0x5f1f02;return db[_0xf4b6('0x38')]['create'](_0x3752dc[_0xf4b6('0x52')],{'raw':!![]})[_0xf4b6('0x1b')](function(_0x37167d){_0x5f1f02=_0x37167d;return db[_0xf4b6('0x38')][_0xf4b6('0x53')]({'raw':!![]});})[_0xf4b6('0x1b')](function(_0x1bed62){var _0x274696=fs['readFileSync'](path[_0xf4b6('0x54')](config[_0xf4b6('0x55')],_0xf4b6('0x56')),_0xf4b6('0x57'));var _0x555141=ejs[_0xf4b6('0x58')](_0x274696,{'contexts':_0x1bed62||[]});fs['writeFileSync'](_0xf4b6('0x59'),_0x555141);})[_0xf4b6('0x1b')](function(){return respondWithRpcPromise('Reload',_0xf4b6('0x51'),{'module':_0xf4b6('0x5a')});})['then'](function(){var _0x27c7d2=_0x3752dc[_0xf4b6('0x5b')][_0xf4b6('0x32')]({'plain':!![]});if(!_0x27c7d2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27c7d2[_0xf4b6('0x5c')]===_0xf4b6('0x5b')){var _0x4fff6d=_0x5f1f02[_0xf4b6('0x32')]({'plain':!![]});return db[_0xf4b6('0x5d')][_0xf4b6('0x5e')]({'where':{'name':_0xf4b6('0x33'),'userProfileId':_0x27c7d2[_0xf4b6('0x5f')]},'raw':!![]})[_0xf4b6('0x1b')](function(_0x23dc3f){if(_0x23dc3f&&_0x23dc3f[_0xf4b6('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x4fff6d['name'],'resourceId':_0x4fff6d['id'],'type':_0x23dc3f[_0xf4b6('0x35')],'sectionId':_0x23dc3f['id']},{})[_0xf4b6('0x1b')](function(){return _0x5f1f02;});}else{return _0x5f1f02;}})['catch'](function(_0x2062e5){logger[_0xf4b6('0x20')](_0xf4b6('0x61'),_0x2062e5);throw _0x2062e5;});}return _0x5f1f02;})['then'](respondWithResult(_0x1e10e3,0xc9))['catch'](handleError(_0x1e10e3,null));};exports[_0xf4b6('0x30')]=function(_0x3eec38,_0x5482fd,_0x964c7f){var _0x2c9d79;return db[_0xf4b6('0x38')][_0xf4b6('0x5e')]({'where':{'id':_0x3eec38['params']['id']}})[_0xf4b6('0x1b')](handleEntityNotFound(_0x5482fd,null))[_0xf4b6('0x1b')](saveUpdates(_0x3eec38[_0xf4b6('0x52')],null))[_0xf4b6('0x1b')](function(_0x3a5105){if(_0x3a5105){_0x2c9d79=_0x3a5105;return db[_0xf4b6('0x38')][_0xf4b6('0x53')]({'raw':!![]});}})[_0xf4b6('0x1b')](function(_0x2d56c8){var _0x5c7ee0=fs[_0xf4b6('0x62')](path[_0xf4b6('0x54')](config[_0xf4b6('0x55')],_0xf4b6('0x56')),'utf8');var _0x510a51=ejs[_0xf4b6('0x58')](_0x5c7ee0,{'contexts':_0x2d56c8||[]});fs['writeFileSync'](_0xf4b6('0x59'),_0x510a51);})[_0xf4b6('0x1b')](function(){return respondWithRpcPromise(_0xf4b6('0x63'),_0xf4b6('0x30'),{'module':_0xf4b6('0x5a')});})[_0xf4b6('0x1b')](function(){return _0x2c9d79;})[_0xf4b6('0x1b')](respondWithResult(_0x5482fd,null))[_0xf4b6('0x24')](handleError(_0x5482fd,null));};exports[_0xf4b6('0x31')]=function(_0x11b381,_0x2f702f,_0x28b870){var _0x39828a;return db['VoiceContext']['find']({'where':{'id':_0x11b381[_0xf4b6('0x50')]['id']}})[_0xf4b6('0x1b')](handleEntityNotFound(_0x2f702f,null))['then'](removeEntity(_0x2f702f,null))['then'](function(){return db[_0xf4b6('0x38')][_0xf4b6('0x53')]({'raw':!![]});})[_0xf4b6('0x1b')](function(_0x4cd63e){var _0x325e6e=fs[_0xf4b6('0x62')](path[_0xf4b6('0x54')](config[_0xf4b6('0x55')],'server/files/templates/context.ejs'),_0xf4b6('0x57'));var _0x977ba2=ejs[_0xf4b6('0x58')](_0x325e6e,{'contexts':_0x4cd63e});fs['writeFileSync'](_0xf4b6('0x59'),_0x977ba2);return respondWithRpcPromise(_0xf4b6('0x63'),_0xf4b6('0x31'),{'module':'chan_sip.so'});})['catch'](handleError(_0x2f702f,null));}; \ No newline at end of file +var _0xd100=['UserProfileResource','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','count','findAll','show','params','rawAttributes','includeAll','find','create','VoiceContext','readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','root','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','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','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x1daab7,_0x35d8a3){var _0x144765=function(_0x448ddb){while(--_0x448ddb){_0x1daab7['push'](_0x1daab7['shift']());}};_0x144765(++_0x35d8a3);}(_0xd100,0x10b));var _0x0d10=function(_0x25b4c9,_0x10dff1){_0x25b4c9=_0x25b4c9-0x0;var _0x8bac1b=_0xd100[_0x25b4c9];return _0x8bac1b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0d10('0x0'));var zipdir=require(_0x0d10('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d10('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0d10('0x3'));var util=require(_0x0d10('0x4'));var path=require(_0x0d10('0x5'));var sox=require(_0x0d10('0x6'));var csv=require(_0x0d10('0x7'));var ejs=require(_0x0d10('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d10('0x9'));var squel=require(_0x0d10('0xa'));var crypto=require(_0x0d10('0xb'));var jsforce=require(_0x0d10('0xc'));var deskjs=require(_0x0d10('0xd'));var toCsv=require(_0x0d10('0x7'));var querystring=require(_0x0d10('0xe'));var Papa=require(_0x0d10('0xf'));var Redis=require(_0x0d10('0x10'));var authService=require(_0x0d10('0x11'));var qs=require(_0x0d10('0x12'));var as=require(_0x0d10('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d10('0x14'))(_0x0d10('0x15'));var utils=require(_0x0d10('0x16'));var config=require(_0x0d10('0x17'));var licenseUtil=require(_0x0d10('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0d10('0x19'));var client=jayson[_0x0d10('0x1a')][_0x0d10('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x52f167,_0x52d649,_0x2675f9,_0x44e338){return new BPromise(function(_0x4834ea,_0x29f1f9){var _0x34ec7f=_0x44e338||client;return _0x34ec7f[_0x0d10('0x1c')](_0x52f167,_0x2675f9)['then'](function(_0x1341f2){logger['info'](_0x0d10('0x1d'),_0x52d649,_0x0d10('0x1e'));logger[_0x0d10('0x1f')](_0x0d10('0x20'),_0x52d649,'request\x20sent',JSON[_0x0d10('0x21')](_0x1341f2));if(_0x1341f2[_0x0d10('0x22')]){if(_0x1341f2[_0x0d10('0x22')][_0x0d10('0x23')]===0x1f4){logger['error'](_0x0d10('0x1d'),_0x52d649,_0x1341f2['error'][_0x0d10('0x24')]);return _0x29f1f9(_0x1341f2[_0x0d10('0x22')]['message']);}logger[_0x0d10('0x22')](_0x0d10('0x1d'),_0x52d649,_0x1341f2[_0x0d10('0x22')]['message']);return _0x4834ea(_0x1341f2['error']['message']);}else{logger[_0x0d10('0x25')](_0x0d10('0x1d'),_0x52d649,_0x0d10('0x1e'));_0x4834ea(_0x1341f2['result'][_0x0d10('0x24')]);}})[_0x0d10('0x26')](function(_0x437927){logger[_0x0d10('0x22')](_0x0d10('0x1d'),_0x52d649,_0x437927);_0x29f1f9(_0x437927);});});}function respondWithStatusCode(_0x12c42b,_0x141bee){_0x141bee=_0x141bee||0xcc;return function(_0x2609cc){if(_0x2609cc){return _0x12c42b[_0x0d10('0x27')](_0x141bee);}return _0x12c42b[_0x0d10('0x28')](_0x141bee)[_0x0d10('0x29')]();};}function respondWithResult(_0x541f72,_0x5001c7){_0x5001c7=_0x5001c7||0xc8;return function(_0xf49ff3){if(_0xf49ff3){return _0x541f72['status'](_0x5001c7)[_0x0d10('0x2a')](_0xf49ff3);}};}function respondWithFilteredResult(_0x4b2254,_0x298cc){return function(_0xddda4){if(_0xddda4){var _0x2297ca=typeof _0x298cc[_0x0d10('0x2b')]===_0x0d10('0x2c')&&typeof _0x298cc[_0x0d10('0x2d')]===_0x0d10('0x2c');var _0x5928bf=_0xddda4['count'];var _0x26f011=_0x2297ca?0x0:_0x298cc[_0x0d10('0x2b')];var _0x21062a=_0x2297ca?_0xddda4['count']:_0x298cc['offset']+_0x298cc[_0x0d10('0x2d')];var _0x1392b7;if(_0x21062a>=_0x5928bf){_0x21062a=_0x5928bf;_0x1392b7=0xc8;}else{_0x1392b7=0xce;}_0x4b2254['status'](_0x1392b7);return _0x4b2254[_0x0d10('0x2e')](_0x0d10('0x2f'),_0x26f011+'-'+_0x21062a+'/'+_0x5928bf)['json'](_0xddda4);}return null;};}function patchUpdates(_0x5266e2){return function(_0x39959e){try{jsonpatch[_0x0d10('0x30')](_0x39959e,_0x5266e2,!![]);}catch(_0x322329){return BPromise[_0x0d10('0x31')](_0x322329);}return _0x39959e[_0x0d10('0x32')]();};}function saveUpdates(_0x4fff88,_0x3f1295){return function(_0x8db890){if(_0x8db890){return _0x8db890[_0x0d10('0x33')](_0x4fff88)[_0x0d10('0x34')](function(_0x5ab8bb){return _0x5ab8bb;});}return null;};}function removeEntity(_0x3a0662,_0x54a1ca){return function(_0x1c9d5a){if(_0x1c9d5a){return _0x1c9d5a[_0x0d10('0x35')]()['then'](function(){var _0x5077dc=_0x1c9d5a['get']({'plain':!![]});var _0x11855b='Contexts';return db[_0x0d10('0x36')]['destroy']({'where':{'type':_0x11855b,'resourceId':_0x5077dc['id']}})['then'](function(){return _0x1c9d5a;});})[_0x0d10('0x34')](function(){_0x3a0662[_0x0d10('0x28')](0xcc)[_0x0d10('0x29')]();});}};}function handleEntityNotFound(_0x1330c4,_0x5662dd){return function(_0x1fa24e){if(!_0x1fa24e){_0x1330c4['sendStatus'](0x194);}return _0x1fa24e;};}function handleError(_0x196ca8,_0x470c26){_0x470c26=_0x470c26||0x1f4;return function(_0x2b5374){logger[_0x0d10('0x22')](_0x2b5374[_0x0d10('0x37')]);if(_0x2b5374[_0x0d10('0x38')]){delete _0x2b5374['name'];}_0x196ca8['status'](_0x470c26)[_0x0d10('0x39')](_0x2b5374);};}exports['index']=function(_0x5f0e87,_0x2afac5){var _0x5e9b11={},_0x5e8c27={},_0x2b1562={'count':0x0,'rows':[]};var _0x5cd12=_[_0x0d10('0x3a')](db['VoiceContext']['rawAttributes'],function(_0x3984ef){return{'name':_0x3984ef[_0x0d10('0x3b')],'type':_0x3984ef['type'][_0x0d10('0x3c')]};});_0x5e8c27[_0x0d10('0x3d')]=_['map'](_0x5cd12,_0x0d10('0x38'));_0x5e8c27[_0x0d10('0x3e')]=_[_0x0d10('0x3f')](_0x5f0e87[_0x0d10('0x3e')]);_0x5e8c27[_0x0d10('0x40')]=_[_0x0d10('0x41')](_0x5e8c27['model'],_0x5e8c27['query']);_0x5e9b11[_0x0d10('0x42')]=_[_0x0d10('0x41')](_0x5e8c27['model'],qs[_0x0d10('0x43')](_0x5f0e87[_0x0d10('0x3e')][_0x0d10('0x43')]));_0x5e9b11[_0x0d10('0x42')]=_0x5e9b11['attributes'][_0x0d10('0x44')]?_0x5e9b11[_0x0d10('0x42')]:_0x5e8c27[_0x0d10('0x3d')];if(!_0x5f0e87[_0x0d10('0x3e')][_0x0d10('0x45')](_0x0d10('0x46'))){_0x5e9b11[_0x0d10('0x2d')]=qs[_0x0d10('0x2d')](_0x5f0e87[_0x0d10('0x3e')]['limit']);_0x5e9b11[_0x0d10('0x2b')]=qs['offset'](_0x5f0e87[_0x0d10('0x3e')][_0x0d10('0x2b')]);}_0x5e9b11[_0x0d10('0x47')]=qs[_0x0d10('0x48')](_0x5f0e87[_0x0d10('0x3e')][_0x0d10('0x48')]);_0x5e9b11['where']=qs[_0x0d10('0x40')](_[_0x0d10('0x49')](_0x5f0e87[_0x0d10('0x3e')],_0x5e8c27[_0x0d10('0x40')]),_0x5cd12);if(_0x5f0e87[_0x0d10('0x3e')][_0x0d10('0x4a')]){_0x5e9b11[_0x0d10('0x4b')]=_[_0x0d10('0x4c')](_0x5e9b11['where'],{'$or':_['map'](_0x5cd12,function(_0x36f27e){if(_0x36f27e[_0x0d10('0x4d')]!==_0x0d10('0x4e')){var _0x227314={};_0x227314[_0x36f27e[_0x0d10('0x38')]]={'$like':'%'+_0x5f0e87['query'][_0x0d10('0x4a')]+'%'};return _0x227314;}})});}_0x5e9b11=_[_0x0d10('0x4c')]({},_0x5e9b11,_0x5f0e87[_0x0d10('0x4f')]);var _0x13416c={'where':_0x5e9b11[_0x0d10('0x4b')]};return db['VoiceContext']['count'](_0x13416c)[_0x0d10('0x34')](function(_0xebfe8f){_0x2b1562[_0x0d10('0x50')]=_0xebfe8f;if(_0x5f0e87[_0x0d10('0x3e')]['includeAll']){_0x5e9b11['include']=[{'all':!![]}];}return db['VoiceContext'][_0x0d10('0x51')](_0x5e9b11);})[_0x0d10('0x34')](function(_0x43a865){_0x2b1562['rows']=_0x43a865;return _0x2b1562;})[_0x0d10('0x34')](respondWithFilteredResult(_0x2afac5,_0x5e9b11))[_0x0d10('0x26')](handleError(_0x2afac5,null));};exports[_0x0d10('0x52')]=function(_0x24e63c,_0x3ce34d){var _0x337e51={'raw':![],'where':{'id':_0x24e63c[_0x0d10('0x53')]['id']}},_0xc26ef={};_0xc26ef[_0x0d10('0x3d')]=_[_0x0d10('0x3f')](db['VoiceContext'][_0x0d10('0x54')]);_0xc26ef[_0x0d10('0x3e')]=_[_0x0d10('0x3f')](_0x24e63c['query']);_0xc26ef[_0x0d10('0x40')]=_['intersection'](_0xc26ef[_0x0d10('0x3d')],_0xc26ef[_0x0d10('0x3e')]);_0x337e51[_0x0d10('0x42')]=_[_0x0d10('0x41')](_0xc26ef[_0x0d10('0x3d')],qs['fields'](_0x24e63c['query'][_0x0d10('0x43')]));_0x337e51[_0x0d10('0x42')]=_0x337e51['attributes'][_0x0d10('0x44')]?_0x337e51[_0x0d10('0x42')]:_0xc26ef['model'];if(_0x24e63c[_0x0d10('0x3e')][_0x0d10('0x55')]){_0x337e51['include']=[{'all':!![]}];}_0x337e51=_['merge']({},_0x337e51,_0x24e63c[_0x0d10('0x4f')]);return db['VoiceContext'][_0x0d10('0x56')](_0x337e51)[_0x0d10('0x34')](handleEntityNotFound(_0x3ce34d,null))[_0x0d10('0x34')](respondWithResult(_0x3ce34d,null))[_0x0d10('0x26')](handleError(_0x3ce34d,null));};exports[_0x0d10('0x57')]=function(_0x5c2317,_0xbecc46,_0x10b0ea){var _0x4e3d50;return db[_0x0d10('0x58')][_0x0d10('0x57')](_0x5c2317['body'],{'raw':!![]})[_0x0d10('0x34')](function(_0xca2c50){_0x4e3d50=_0xca2c50;return db[_0x0d10('0x58')][_0x0d10('0x51')]({'raw':!![]});})[_0x0d10('0x34')](function(_0x264437){var _0x2d18cf=fs[_0x0d10('0x59')](path[_0x0d10('0x5a')](config['root'],_0x0d10('0x5b')),_0x0d10('0x5c'));var _0xeb7428=ejs[_0x0d10('0x5d')](_0x2d18cf,{'contexts':_0x264437||[]});fs[_0x0d10('0x5e')](_0x0d10('0x5f'),_0xeb7428);})[_0x0d10('0x34')](function(){return respondWithRpcPromise(_0x0d10('0x60'),_0x0d10('0x57'),{'module':_0x0d10('0x61')});})[_0x0d10('0x34')](function(){var _0x21e181=_0x5c2317[_0x0d10('0x62')][_0x0d10('0x63')]({'plain':!![]});if(!_0x21e181)throw new Error(_0x0d10('0x64'));if(_0x21e181[_0x0d10('0x65')]===_0x0d10('0x62')){var _0x2a7617=_0x4e3d50['get']({'plain':!![]});return db[_0x0d10('0x66')][_0x0d10('0x56')]({'where':{'name':'Contexts','userProfileId':_0x21e181[_0x0d10('0x67')]},'raw':!![]})[_0x0d10('0x34')](function(_0x442533){if(_0x442533&&_0x442533['autoAssociation']===0x0){return db[_0x0d10('0x36')]['create']({'name':_0x2a7617[_0x0d10('0x38')],'resourceId':_0x2a7617['id'],'type':_0x442533[_0x0d10('0x38')],'sectionId':_0x442533['id']},{})[_0x0d10('0x34')](function(){return _0x4e3d50;});}else{return _0x4e3d50;}})['catch'](function(_0x3cea1b){logger['error'](_0x0d10('0x68'),_0x3cea1b);throw _0x3cea1b;});}return _0x4e3d50;})['then'](respondWithResult(_0xbecc46,0xc9))['catch'](handleError(_0xbecc46,null));};exports['update']=function(_0x29cdab,_0x2b3078,_0x3e1d82){var _0x47a139;return db['VoiceContext'][_0x0d10('0x56')]({'where':{'id':_0x29cdab[_0x0d10('0x53')]['id']}})[_0x0d10('0x34')](handleEntityNotFound(_0x2b3078,null))[_0x0d10('0x34')](saveUpdates(_0x29cdab[_0x0d10('0x69')],null))[_0x0d10('0x34')](function(_0x1a9c56){if(_0x1a9c56){_0x47a139=_0x1a9c56;return db['VoiceContext'][_0x0d10('0x51')]({'raw':!![]});}})[_0x0d10('0x34')](function(_0x476594){var _0x4a9e28=fs[_0x0d10('0x59')](path[_0x0d10('0x5a')](config['root'],'server/files/templates/context.ejs'),_0x0d10('0x5c'));var _0x1efd5a=ejs[_0x0d10('0x5d')](_0x4a9e28,{'contexts':_0x476594||[]});fs[_0x0d10('0x5e')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1efd5a);})['then'](function(){return respondWithRpcPromise(_0x0d10('0x60'),'update',{'module':'chan_sip.so'});})[_0x0d10('0x34')](function(){return _0x47a139;})[_0x0d10('0x34')](respondWithResult(_0x2b3078,null))['catch'](handleError(_0x2b3078,null));};exports[_0x0d10('0x35')]=function(_0x334e45,_0xd52abb,_0x925a8e){var _0x3188eb;return db['VoiceContext'][_0x0d10('0x56')]({'where':{'id':_0x334e45[_0x0d10('0x53')]['id']}})[_0x0d10('0x34')](handleEntityNotFound(_0xd52abb,null))[_0x0d10('0x34')](removeEntity(_0xd52abb,null))[_0x0d10('0x34')](function(){return db['VoiceContext'][_0x0d10('0x51')]({'raw':!![]});})[_0x0d10('0x34')](function(_0x35ca03){var _0x463720=fs['readFileSync'](path['join'](config[_0x0d10('0x6a')],_0x0d10('0x5b')),'utf8');var _0xe7c361=ejs[_0x0d10('0x5d')](_0x463720,{'contexts':_0x35ca03});fs[_0x0d10('0x5e')](_0x0d10('0x5f'),_0xe7c361);return respondWithRpcPromise(_0x0d10('0x60'),_0x0d10('0x35'),{'module':_0x0d10('0x61')});})['catch'](handleError(_0xd52abb,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index e821eea..a70ecc0 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 _0x62cc=['rimraf','../../config/environment','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xc5c9ed,_0x121354){var _0x3262f3=function(_0x554b18){while(--_0x554b18){_0xc5c9ed['push'](_0xc5c9ed['shift']());}};_0x3262f3(++_0x121354);}(_0x62cc,0xf4));var _0xc62c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62cc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc62c('0x0'));var util=require(_0xc62c('0x1'));var logger=require(_0xc62c('0x2'))(_0xc62c('0x3'));var moment=require(_0xc62c('0x4'));var BPromise=require(_0xc62c('0x5'));var rp=require(_0xc62c('0x6'));var fs=require('fs');var path=require(_0xc62c('0x7'));var rimraf=require(_0xc62c('0x8'));var config=require(_0xc62c('0x9'));var attributes=require('./voiceContext.attributes');module[_0xc62c('0xa')]=function(_0x13191d,_0x52be84){return _0x13191d[_0xc62c('0xb')](_0xc62c('0xc'),attributes,{'tableName':_0xc62c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65c6=['path','rimraf','../../config/environment','exports','voice_contexts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x31b424,_0x5a3feb){var _0x4b5fbf=function(_0x309707){while(--_0x309707){_0x31b424['push'](_0x31b424['shift']());}};_0x4b5fbf(++_0x5a3feb);}(_0x65c6,0x1a7));var _0x665c=function(_0x10403f,_0x3fd9e5){_0x10403f=_0x10403f-0x0;var _0x57fece=_0x65c6[_0x10403f];return _0x57fece;};'use strict';var _=require('lodash');var util=require(_0x665c('0x0'));var logger=require(_0x665c('0x1'))(_0x665c('0x2'));var moment=require(_0x665c('0x3'));var BPromise=require(_0x665c('0x4'));var rp=require(_0x665c('0x5'));var fs=require('fs');var path=require(_0x665c('0x6'));var rimraf=require(_0x665c('0x7'));var config=require(_0x665c('0x8'));var attributes=require('./voiceContext.attributes');module[_0x665c('0x9')]=function(_0x12cce9,_0x40837c){return _0x12cce9['define']('VoiceContext',attributes,{'tableName':_0x665c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 2dbd75e..ea07afd 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 _0x9d1f=['code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','error'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9d1f,0x1a9));var _0xf9d1=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0x9d1f[_0x5471ec];return _0x121d4c;};'use strict';var _=require(_0xf9d1('0x0'));var util=require('util');var moment=require(_0xf9d1('0x1'));var BPromise=require(_0xf9d1('0x2'));var rs=require(_0xf9d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf9d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9d1('0x5'))(_0xf9d1('0x6'));var config=require(_0xf9d1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf9d1('0x8')][_0xf9d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5183c1,_0x11d535,_0xb4be01){return new BPromise(function(_0x41c1bc,_0x582512){return client[_0xf9d1('0xa')](_0x5183c1,_0xb4be01)[_0xf9d1('0xb')](function(_0x9a36f){logger['info']('VoiceContext,\x20%s,\x20%s',_0x11d535,_0xf9d1('0xc'));logger[_0xf9d1('0xd')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x11d535,'request\x20sent',JSON[_0xf9d1('0xe')](_0x9a36f));if(_0x9a36f[_0xf9d1('0xf')]){if(_0x9a36f[_0xf9d1('0xf')][_0xf9d1('0x10')]===0x1f4){logger['error'](_0xf9d1('0x11'),_0x11d535,_0x9a36f['error'][_0xf9d1('0x12')]);return _0x582512(_0x9a36f[_0xf9d1('0xf')]['message']);}logger[_0xf9d1('0xf')](_0xf9d1('0x11'),_0x11d535,_0x9a36f[_0xf9d1('0xf')][_0xf9d1('0x12')]);return _0x41c1bc(_0x9a36f[_0xf9d1('0xf')][_0xf9d1('0x12')]);}else{logger['info'](_0xf9d1('0x11'),_0x11d535,_0xf9d1('0xc'));_0x41c1bc(_0x9a36f[_0xf9d1('0x13')][_0xf9d1('0x12')]);}})[_0xf9d1('0x14')](function(_0x57c13b){logger[_0xf9d1('0xf')](_0xf9d1('0x11'),_0x11d535,_0x57c13b);_0x582512(_0x57c13b);});});} \ No newline at end of file +var _0xef6a=['info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','client','http','request','request\x20sent','debug','error','code','VoiceContext,\x20%s,\x20%s','message'];(function(_0x1e571e,_0x557ecd){var _0x29534b=function(_0x25da09){while(--_0x25da09){_0x1e571e['push'](_0x1e571e['shift']());}};_0x29534b(++_0x557ecd);}(_0xef6a,0x1e9));var _0xaef6=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xef6a[_0x29d94e];return _0x106237;};'use strict';var _=require(_0xaef6('0x0'));var util=require(_0xaef6('0x1'));var moment=require(_0xaef6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaef6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaef6('0x4'));var logger=require(_0xaef6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaef6('0x6')][_0xaef6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3eda46,_0x47549e,_0x43e36f){return new BPromise(function(_0xe76eb9,_0x9ecdbb){return client[_0xaef6('0x8')](_0x3eda46,_0x43e36f)['then'](function(_0x40898b){logger['info']('VoiceContext,\x20%s,\x20%s',_0x47549e,_0xaef6('0x9'));logger[_0xaef6('0xa')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x47549e,_0xaef6('0x9'),JSON['stringify'](_0x40898b));if(_0x40898b[_0xaef6('0xb')]){if(_0x40898b[_0xaef6('0xb')][_0xaef6('0xc')]===0x1f4){logger[_0xaef6('0xb')](_0xaef6('0xd'),_0x47549e,_0x40898b[_0xaef6('0xb')][_0xaef6('0xe')]);return _0x9ecdbb(_0x40898b[_0xaef6('0xb')][_0xaef6('0xe')]);}logger[_0xaef6('0xb')](_0xaef6('0xd'),_0x47549e,_0x40898b['error']['message']);return _0xe76eb9(_0x40898b[_0xaef6('0xb')][_0xaef6('0xe')]);}else{logger[_0xaef6('0xf')](_0xaef6('0xd'),_0x47549e,_0xaef6('0x9'));_0xe76eb9(_0x40898b[_0xaef6('0x10')][_0xaef6('0xe')]);}})[_0xaef6('0x11')](function(_0x4d2b1f){logger['error'](_0xaef6('0xd'),_0x47549e,_0x4d2b1f);_0x9ecdbb(_0x4d2b1f);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index f1a687c..2728d35 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 _0xcef6=['../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','delete','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2a289f,_0x36e857){var _0x19cfe4=function(_0x2b7da5){while(--_0x2b7da5){_0x2a289f['push'](_0x2a289f['shift']());}};_0x19cfe4(++_0x36e857);}(_0xcef6,0xa3));var _0x6cef=function(_0x6d070a,_0x47e825){_0x6d070a=_0x6d070a-0x0;var _0x2c065d=_0xcef6[_0x6d070a];return _0x2c065d;};'use strict';var multer=require(_0x6cef('0x0'));var util=require(_0x6cef('0x1'));var path=require('path');var timeout=require(_0x6cef('0x2'));var express=require(_0x6cef('0x3'));var router=express['Router']();var fs_extra=require(_0x6cef('0x4'));var auth=require(_0x6cef('0x5'));var interaction=require(_0x6cef('0x6'));var config=require(_0x6cef('0x7'));var controller=require(_0x6cef('0x8'));router[_0x6cef('0x9')]('/',auth[_0x6cef('0xa')](),controller[_0x6cef('0xb')]);router[_0x6cef('0x9')](_0x6cef('0xc'),auth[_0x6cef('0xa')](),controller['describe']);router['get'](_0x6cef('0xd'),auth[_0x6cef('0xa')](),controller[_0x6cef('0xe')]);router[_0x6cef('0xf')]('/',auth[_0x6cef('0xa')](),controller['create']);router['put'](_0x6cef('0xd'),auth[_0x6cef('0xa')](),controller['update']);router[_0x6cef('0x10')]('/:id',auth[_0x6cef('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x74dd=['create','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x259d2d,_0x19209a){var _0x364204=function(_0x52fafe){while(--_0x52fafe){_0x259d2d['push'](_0x259d2d['shift']());}};_0x364204(++_0x19209a);}(_0x74dd,0x90));var _0xd74d=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0x74dd[_0x352e09];return _0x1b7094;};'use strict';var multer=require(_0xd74d('0x0'));var util=require(_0xd74d('0x1'));var path=require(_0xd74d('0x2'));var timeout=require(_0xd74d('0x3'));var express=require(_0xd74d('0x4'));var router=express[_0xd74d('0x5')]();var fs_extra=require(_0xd74d('0x6'));var auth=require(_0xd74d('0x7'));var interaction=require(_0xd74d('0x8'));var config=require(_0xd74d('0x9'));var controller=require(_0xd74d('0xa'));router[_0xd74d('0xb')]('/',auth[_0xd74d('0xc')](),controller[_0xd74d('0xd')]);router[_0xd74d('0xb')](_0xd74d('0xe'),auth['isAuthenticated'](),controller[_0xd74d('0xf')]);router[_0xd74d('0xb')]('/:id',auth[_0xd74d('0xc')](),controller[_0xd74d('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd74d('0x11')]);router['put']('/:id',auth[_0xd74d('0xc')](),controller[_0xd74d('0x12')]);router[_0xd74d('0x13')](_0xd74d('0x14'),auth[_0xd74d('0xc')](),controller[_0xd74d('0x15')]);module[_0xd74d('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 19f5b15..5734013 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 _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}}; \ No newline at end of file +var _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 7cfbd20..44ed31c 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 _0x8b29=['length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','end','error','stack','name','send','index','VoiceDialReport','rawAttributes','key','model','map','query','keys','intersection','attributes','fields'];(function(_0x1ddf04,_0x4a43eb){var _0x41f47a=function(_0x2885fa){while(--_0x2885fa){_0x1ddf04['push'](_0x1ddf04['shift']());}};_0x41f47a(++_0x4a43eb);}(_0x8b29,0x13b));var _0x98b2=function(_0x26e4d6,_0xcd32d9){_0x26e4d6=_0x26e4d6-0x0;var _0x5e6ca0=_0x8b29[_0x26e4d6];return _0x5e6ca0;};'use strict';var emlformat=require(_0x98b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x98b2('0x1'));var jsonpatch=require(_0x98b2('0x2'));var rp=require('request-promise');var moment=require(_0x98b2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x98b2('0x4'));var util=require(_0x98b2('0x5'));var path=require('path');var sox=require(_0x98b2('0x6'));var csv=require(_0x98b2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x98b2('0x8'));var squel=require(_0x98b2('0x9'));var crypto=require('crypto');var jsforce=require(_0x98b2('0xa'));var deskjs=require(_0x98b2('0xb'));var toCsv=require(_0x98b2('0x7'));var querystring=require(_0x98b2('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x98b2('0xd'));var qs=require(_0x98b2('0xe'));var as=require(_0x98b2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x98b2('0x10'))(_0x98b2('0x11'));var utils=require(_0x98b2('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x98b2('0x13'));var db=require(_0x98b2('0x14'))['db'];function respondWithStatusCode(_0x502367,_0xefa86e){_0xefa86e=_0xefa86e||0xcc;return function(_0x18b048){if(_0x18b048){return _0x502367[_0x98b2('0x15')](_0xefa86e);}return _0x502367[_0x98b2('0x16')](_0xefa86e)['end']();};}function respondWithResult(_0x230b28,_0x366b8d){_0x366b8d=_0x366b8d||0xc8;return function(_0x15c21f){if(_0x15c21f){return _0x230b28['status'](_0x366b8d)[_0x98b2('0x17')](_0x15c21f);}};}function respondWithFilteredResult(_0x584f64,_0x59be4e){return function(_0x223823){if(_0x223823){var _0x4eaef1=typeof _0x59be4e['offset']===_0x98b2('0x18')&&typeof _0x59be4e[_0x98b2('0x19')]===_0x98b2('0x18');var _0x1c43f4=_0x223823[_0x98b2('0x1a')];var _0x114884=_0x4eaef1?0x0:_0x59be4e['offset'];var _0x2408d0=_0x4eaef1?_0x223823[_0x98b2('0x1a')]:_0x59be4e[_0x98b2('0x1b')]+_0x59be4e[_0x98b2('0x19')];var _0xe97c91;if(_0x2408d0>=_0x1c43f4){_0x2408d0=_0x1c43f4;_0xe97c91=0xc8;}else{_0xe97c91=0xce;}_0x584f64[_0x98b2('0x16')](_0xe97c91);return _0x584f64[_0x98b2('0x1c')]('Content-Range',_0x114884+'-'+_0x2408d0+'/'+_0x1c43f4)[_0x98b2('0x17')](_0x223823);}return null;};}function patchUpdates(_0xaf119){return function(_0x3f6404){try{jsonpatch[_0x98b2('0x1d')](_0x3f6404,_0xaf119,!![]);}catch(_0x105fa4){return BPromise[_0x98b2('0x1e')](_0x105fa4);}return _0x3f6404[_0x98b2('0x1f')]();};}function saveUpdates(_0x43c201,_0x4a2259){return function(_0x2c859b){if(_0x2c859b){return _0x2c859b[_0x98b2('0x20')](_0x43c201)[_0x98b2('0x21')](function(_0x231130){return _0x231130;});}return null;};}function removeEntity(_0xcc7821,_0x3ca0b1){return function(_0x444031){if(_0x444031){return _0x444031['destroy']()[_0x98b2('0x21')](function(){_0xcc7821[_0x98b2('0x16')](0xcc)[_0x98b2('0x22')]();});}};}function handleEntityNotFound(_0x4fc4a0,_0x4f4390){return function(_0x50a5b9){if(!_0x50a5b9){_0x4fc4a0['sendStatus'](0x194);}return _0x50a5b9;};}function handleError(_0x473880,_0x267276){_0x267276=_0x267276||0x1f4;return function(_0x5ba686){logger[_0x98b2('0x23')](_0x5ba686[_0x98b2('0x24')]);if(_0x5ba686[_0x98b2('0x25')]){delete _0x5ba686[_0x98b2('0x25')];}_0x473880['status'](_0x267276)[_0x98b2('0x26')](_0x5ba686);};}exports[_0x98b2('0x27')]=function(_0x558888,_0x405ac3){var _0x318752={},_0x25c48e={},_0x517368={'count':0x0,'rows':[]};var _0x4eeca9=_['map'](db[_0x98b2('0x28')][_0x98b2('0x29')],function(_0x3def7f){return{'name':_0x3def7f['fieldName'],'type':_0x3def7f['type'][_0x98b2('0x2a')]};});_0x25c48e[_0x98b2('0x2b')]=_[_0x98b2('0x2c')](_0x4eeca9,_0x98b2('0x25'));_0x25c48e[_0x98b2('0x2d')]=_[_0x98b2('0x2e')](_0x558888['query']);_0x25c48e['filters']=_[_0x98b2('0x2f')](_0x25c48e[_0x98b2('0x2b')],_0x25c48e[_0x98b2('0x2d')]);_0x318752[_0x98b2('0x30')]=_[_0x98b2('0x2f')](_0x25c48e[_0x98b2('0x2b')],qs[_0x98b2('0x31')](_0x558888[_0x98b2('0x2d')][_0x98b2('0x31')]));_0x318752[_0x98b2('0x30')]=_0x318752[_0x98b2('0x30')][_0x98b2('0x32')]?_0x318752['attributes']:_0x25c48e['model'];if(!_0x558888[_0x98b2('0x2d')][_0x98b2('0x33')](_0x98b2('0x34'))){_0x318752[_0x98b2('0x19')]=qs[_0x98b2('0x19')](_0x558888[_0x98b2('0x2d')]['limit']);_0x318752['offset']=qs[_0x98b2('0x1b')](_0x558888[_0x98b2('0x2d')][_0x98b2('0x1b')]);}_0x318752[_0x98b2('0x35')]=qs['sort'](_0x558888[_0x98b2('0x2d')][_0x98b2('0x36')]);_0x318752['where']=qs[_0x98b2('0x37')](_[_0x98b2('0x38')](_0x558888[_0x98b2('0x2d')],_0x25c48e['filters']),_0x4eeca9);if(_0x558888[_0x98b2('0x2d')]['filter']){_0x318752[_0x98b2('0x39')]=_[_0x98b2('0x3a')](_0x318752[_0x98b2('0x39')],{'$or':_['map'](_0x4eeca9,function(_0x1733b4){if(_0x1733b4['type']!==_0x98b2('0x3b')){var _0x149bb4={};_0x149bb4[_0x1733b4[_0x98b2('0x25')]]={'$like':'%'+_0x558888['query']['filter']+'%'};return _0x149bb4;}})});}_0x318752=_[_0x98b2('0x3a')]({},_0x318752,_0x558888[_0x98b2('0x3c')]);var _0x323e1e={'where':_0x318752['where']};return db[_0x98b2('0x28')][_0x98b2('0x1a')](_0x323e1e)[_0x98b2('0x21')](function(_0x20090c){_0x517368[_0x98b2('0x1a')]=_0x20090c;if(_0x558888[_0x98b2('0x2d')][_0x98b2('0x3d')]){_0x318752[_0x98b2('0x3e')]=[{'all':!![]}];}return db[_0x98b2('0x28')][_0x98b2('0x3f')](_0x318752);})[_0x98b2('0x21')](function(_0x176664){_0x517368[_0x98b2('0x40')]=_0x176664;return _0x517368;})[_0x98b2('0x21')](respondWithFilteredResult(_0x405ac3,_0x318752))[_0x98b2('0x41')](handleError(_0x405ac3,null));};exports[_0x98b2('0x42')]=function(_0x5b8daa,_0x3d5f45){var _0x5e51b4={'raw':!![],'where':{'id':_0x5b8daa[_0x98b2('0x43')]['id']}},_0x4c2e85={};_0x4c2e85[_0x98b2('0x2b')]=_['keys'](db[_0x98b2('0x28')]['rawAttributes']);_0x4c2e85[_0x98b2('0x2d')]=_[_0x98b2('0x2e')](_0x5b8daa[_0x98b2('0x2d')]);_0x4c2e85[_0x98b2('0x37')]=_['intersection'](_0x4c2e85['model'],_0x4c2e85[_0x98b2('0x2d')]);_0x5e51b4['attributes']=_[_0x98b2('0x2f')](_0x4c2e85[_0x98b2('0x2b')],qs['fields'](_0x5b8daa['query']['fields']));_0x5e51b4[_0x98b2('0x30')]=_0x5e51b4['attributes'][_0x98b2('0x32')]?_0x5e51b4['attributes']:_0x4c2e85[_0x98b2('0x2b')];if(_0x5b8daa[_0x98b2('0x2d')][_0x98b2('0x3d')]){_0x5e51b4[_0x98b2('0x3e')]=[{'all':!![]}];}_0x5e51b4=_['merge']({},_0x5e51b4,_0x5b8daa[_0x98b2('0x3c')]);return db[_0x98b2('0x28')][_0x98b2('0x44')](_0x5e51b4)[_0x98b2('0x21')](handleEntityNotFound(_0x3d5f45,null))[_0x98b2('0x21')](respondWithResult(_0x3d5f45,null))[_0x98b2('0x41')](handleError(_0x3d5f45,null));};exports[_0x98b2('0x45')]=function(_0x8006af,_0xbb144){return db[_0x98b2('0x28')]['create'](_0x8006af[_0x98b2('0x46')],{})[_0x98b2('0x21')](respondWithResult(_0xbb144,0xc9))[_0x98b2('0x41')](handleError(_0xbb144,null));};exports['update']=function(_0x3a513c,_0x36691e){if(_0x3a513c[_0x98b2('0x46')]['id']){delete _0x3a513c[_0x98b2('0x46')]['id'];}return db['VoiceDialReport'][_0x98b2('0x44')]({'where':{'id':_0x3a513c['params']['id']}})[_0x98b2('0x21')](handleEntityNotFound(_0x36691e,null))[_0x98b2('0x21')](saveUpdates(_0x3a513c['body'],null))[_0x98b2('0x21')](respondWithResult(_0x36691e,null))['catch'](handleError(_0x36691e,null));};exports[_0x98b2('0x47')]=function(_0x3e9e50,_0x4d8834){return db[_0x98b2('0x28')]['find']({'where':{'id':_0x3e9e50[_0x98b2('0x43')]['id']}})['then'](handleEntityNotFound(_0x4d8834,null))[_0x98b2('0x21')](removeEntity(_0x4d8834,null))[_0x98b2('0x41')](handleError(_0x4d8834,null));};exports[_0x98b2('0x48')]=function(_0x5e0634,_0x5a9f62){return db['VoiceDialReport'][_0x98b2('0x48')]()[_0x98b2('0x21')](respondWithResult(_0x5a9f62,null))[_0x98b2('0x41')](handleError(_0x5a9f62,null));}; \ No newline at end of file +var _0xf2f2=['util','path','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','error','name','send','map','VoiceDialReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','options','catch','body','find','describe','eml-format','fast-json-patch','request-promise','mustache'];(function(_0x156763,_0x4c1a2c){var _0x1a1a8d=function(_0x3c0a82){while(--_0x3c0a82){_0x156763['push'](_0x156763['shift']());}};_0x1a1a8d(++_0x4c1a2c);}(_0xf2f2,0x1c3));var _0x2f2f=function(_0x50e7e0,_0x5affce){_0x50e7e0=_0x50e7e0-0x0;var _0x1a0307=_0xf2f2[_0x50e7e0];return _0x1a0307;};'use strict';var emlformat=require(_0x2f2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2f2f('0x1'));var rp=require(_0x2f2f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2f2f('0x3'));var util=require(_0x2f2f('0x4'));var path=require(_0x2f2f('0x5'));var sox=require(_0x2f2f('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f2f('0x7'));var squel=require(_0x2f2f('0x8'));var crypto=require('crypto');var jsforce=require(_0x2f2f('0x9'));var deskjs=require(_0x2f2f('0xa'));var toCsv=require(_0x2f2f('0xb'));var querystring=require('querystring');var Papa=require(_0x2f2f('0xc'));var Redis=require('ioredis');var authService=require(_0x2f2f('0xd'));var qs=require(_0x2f2f('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f2f('0xf'));var logger=require(_0x2f2f('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x2f2f('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419f83,_0x5bf64c){_0x5bf64c=_0x5bf64c||0xcc;return function(_0x46b7e4){if(_0x46b7e4){return _0x419f83[_0x2f2f('0x12')](_0x5bf64c);}return _0x419f83[_0x2f2f('0x13')](_0x5bf64c)[_0x2f2f('0x14')]();};}function respondWithResult(_0x4a41c8,_0x40b2bb){_0x40b2bb=_0x40b2bb||0xc8;return function(_0x5b300e){if(_0x5b300e){return _0x4a41c8[_0x2f2f('0x13')](_0x40b2bb)[_0x2f2f('0x15')](_0x5b300e);}};}function respondWithFilteredResult(_0x3f6bd2,_0x5b8b4c){return function(_0x5a6925){if(_0x5a6925){var _0x22eb78=typeof _0x5b8b4c[_0x2f2f('0x16')]===_0x2f2f('0x17')&&typeof _0x5b8b4c[_0x2f2f('0x18')]===_0x2f2f('0x17');var _0x5ce1df=_0x5a6925[_0x2f2f('0x19')];var _0x34a6f7=_0x22eb78?0x0:_0x5b8b4c[_0x2f2f('0x16')];var _0x3bdaa0=_0x22eb78?_0x5a6925[_0x2f2f('0x19')]:_0x5b8b4c[_0x2f2f('0x16')]+_0x5b8b4c[_0x2f2f('0x18')];var _0x48139c;if(_0x3bdaa0>=_0x5ce1df){_0x3bdaa0=_0x5ce1df;_0x48139c=0xc8;}else{_0x48139c=0xce;}_0x3f6bd2[_0x2f2f('0x13')](_0x48139c);return _0x3f6bd2[_0x2f2f('0x1a')]('Content-Range',_0x34a6f7+'-'+_0x3bdaa0+'/'+_0x5ce1df)['json'](_0x5a6925);}return null;};}function patchUpdates(_0x459e43){return function(_0x281b54){try{jsonpatch[_0x2f2f('0x1b')](_0x281b54,_0x459e43,!![]);}catch(_0x4caaae){return BPromise['reject'](_0x4caaae);}return _0x281b54['save']();};}function saveUpdates(_0x46b104,_0x5c9973){return function(_0x5ad313){if(_0x5ad313){return _0x5ad313[_0x2f2f('0x1c')](_0x46b104)[_0x2f2f('0x1d')](function(_0x11f2d0){return _0x11f2d0;});}return null;};}function removeEntity(_0x6615ca,_0x2b6304){return function(_0x2ba494){if(_0x2ba494){return _0x2ba494['destroy']()[_0x2f2f('0x1d')](function(){_0x6615ca[_0x2f2f('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x226b93,_0x461065){return function(_0x28ce66){if(!_0x28ce66){_0x226b93[_0x2f2f('0x12')](0x194);}return _0x28ce66;};}function handleError(_0x36075b,_0x4256bd){_0x4256bd=_0x4256bd||0x1f4;return function(_0x198ecd){logger[_0x2f2f('0x1e')](_0x198ecd['stack']);if(_0x198ecd[_0x2f2f('0x1f')]){delete _0x198ecd[_0x2f2f('0x1f')];}_0x36075b[_0x2f2f('0x13')](_0x4256bd)[_0x2f2f('0x20')](_0x198ecd);};}exports['index']=function(_0x137a34,_0x3ec8c9){var _0x2ce4ab={},_0x1fb3f1={},_0x5ca1a7={'count':0x0,'rows':[]};var _0xc51821=_[_0x2f2f('0x21')](db[_0x2f2f('0x22')][_0x2f2f('0x23')],function(_0x307aac){return{'name':_0x307aac[_0x2f2f('0x24')],'type':_0x307aac['type']['key']};});_0x1fb3f1[_0x2f2f('0x25')]=_[_0x2f2f('0x21')](_0xc51821,_0x2f2f('0x1f'));_0x1fb3f1[_0x2f2f('0x26')]=_[_0x2f2f('0x27')](_0x137a34[_0x2f2f('0x26')]);_0x1fb3f1[_0x2f2f('0x28')]=_[_0x2f2f('0x29')](_0x1fb3f1[_0x2f2f('0x25')],_0x1fb3f1['query']);_0x2ce4ab[_0x2f2f('0x2a')]=_['intersection'](_0x1fb3f1[_0x2f2f('0x25')],qs[_0x2f2f('0x2b')](_0x137a34[_0x2f2f('0x26')]['fields']));_0x2ce4ab[_0x2f2f('0x2a')]=_0x2ce4ab[_0x2f2f('0x2a')][_0x2f2f('0x2c')]?_0x2ce4ab[_0x2f2f('0x2a')]:_0x1fb3f1[_0x2f2f('0x25')];if(!_0x137a34[_0x2f2f('0x26')][_0x2f2f('0x2d')](_0x2f2f('0x2e'))){_0x2ce4ab[_0x2f2f('0x18')]=qs[_0x2f2f('0x18')](_0x137a34[_0x2f2f('0x26')][_0x2f2f('0x18')]);_0x2ce4ab['offset']=qs[_0x2f2f('0x16')](_0x137a34['query'][_0x2f2f('0x16')]);}_0x2ce4ab[_0x2f2f('0x2f')]=qs[_0x2f2f('0x30')](_0x137a34[_0x2f2f('0x26')][_0x2f2f('0x30')]);_0x2ce4ab[_0x2f2f('0x31')]=qs[_0x2f2f('0x28')](_[_0x2f2f('0x32')](_0x137a34[_0x2f2f('0x26')],_0x1fb3f1[_0x2f2f('0x28')]),_0xc51821);if(_0x137a34[_0x2f2f('0x26')][_0x2f2f('0x33')]){_0x2ce4ab[_0x2f2f('0x31')]=_[_0x2f2f('0x34')](_0x2ce4ab[_0x2f2f('0x31')],{'$or':_[_0x2f2f('0x21')](_0xc51821,function(_0x1002a7){if(_0x1002a7[_0x2f2f('0x35')]!==_0x2f2f('0x36')){var _0x34c60c={};_0x34c60c[_0x1002a7['name']]={'$like':'%'+_0x137a34[_0x2f2f('0x26')][_0x2f2f('0x33')]+'%'};return _0x34c60c;}})});}_0x2ce4ab=_[_0x2f2f('0x34')]({},_0x2ce4ab,_0x137a34['options']);var _0x578ac9={'where':_0x2ce4ab[_0x2f2f('0x31')]};return db[_0x2f2f('0x22')][_0x2f2f('0x19')](_0x578ac9)[_0x2f2f('0x1d')](function(_0x3a3a4b){_0x5ca1a7[_0x2f2f('0x19')]=_0x3a3a4b;if(_0x137a34[_0x2f2f('0x26')][_0x2f2f('0x37')]){_0x2ce4ab[_0x2f2f('0x38')]=[{'all':!![]}];}return db[_0x2f2f('0x22')][_0x2f2f('0x39')](_0x2ce4ab);})[_0x2f2f('0x1d')](function(_0x351827){_0x5ca1a7[_0x2f2f('0x3a')]=_0x351827;return _0x5ca1a7;})['then'](respondWithFilteredResult(_0x3ec8c9,_0x2ce4ab))['catch'](handleError(_0x3ec8c9,null));};exports['show']=function(_0xaad166,_0x35f561){var _0x1db816={'raw':!![],'where':{'id':_0xaad166[_0x2f2f('0x3b')]['id']}},_0x4a3879={};_0x4a3879['model']=_[_0x2f2f('0x27')](db[_0x2f2f('0x22')][_0x2f2f('0x23')]);_0x4a3879[_0x2f2f('0x26')]=_[_0x2f2f('0x27')](_0xaad166[_0x2f2f('0x26')]);_0x4a3879['filters']=_[_0x2f2f('0x29')](_0x4a3879[_0x2f2f('0x25')],_0x4a3879[_0x2f2f('0x26')]);_0x1db816['attributes']=_[_0x2f2f('0x29')](_0x4a3879[_0x2f2f('0x25')],qs[_0x2f2f('0x2b')](_0xaad166[_0x2f2f('0x26')][_0x2f2f('0x2b')]));_0x1db816['attributes']=_0x1db816[_0x2f2f('0x2a')]['length']?_0x1db816[_0x2f2f('0x2a')]:_0x4a3879['model'];if(_0xaad166['query'][_0x2f2f('0x37')]){_0x1db816[_0x2f2f('0x38')]=[{'all':!![]}];}_0x1db816=_[_0x2f2f('0x34')]({},_0x1db816,_0xaad166[_0x2f2f('0x3c')]);return db['VoiceDialReport']['find'](_0x1db816)['then'](handleEntityNotFound(_0x35f561,null))['then'](respondWithResult(_0x35f561,null))[_0x2f2f('0x3d')](handleError(_0x35f561,null));};exports['create']=function(_0x37c245,_0x21861a){return db[_0x2f2f('0x22')]['create'](_0x37c245[_0x2f2f('0x3e')],{})[_0x2f2f('0x1d')](respondWithResult(_0x21861a,0xc9))[_0x2f2f('0x3d')](handleError(_0x21861a,null));};exports['update']=function(_0x44ec16,_0x2d05cb){if(_0x44ec16[_0x2f2f('0x3e')]['id']){delete _0x44ec16['body']['id'];}return db[_0x2f2f('0x22')][_0x2f2f('0x3f')]({'where':{'id':_0x44ec16['params']['id']}})[_0x2f2f('0x1d')](handleEntityNotFound(_0x2d05cb,null))[_0x2f2f('0x1d')](saveUpdates(_0x44ec16['body'],null))[_0x2f2f('0x1d')](respondWithResult(_0x2d05cb,null))[_0x2f2f('0x3d')](handleError(_0x2d05cb,null));};exports['destroy']=function(_0x4b2701,_0x46b878){return db[_0x2f2f('0x22')][_0x2f2f('0x3f')]({'where':{'id':_0x4b2701[_0x2f2f('0x3b')]['id']}})['then'](handleEntityNotFound(_0x46b878,null))[_0x2f2f('0x1d')](removeEntity(_0x46b878,null))[_0x2f2f('0x3d')](handleError(_0x46b878,null));};exports[_0x2f2f('0x40')]=function(_0x26bd3c,_0x1f28ec){return db[_0x2f2f('0x22')][_0x2f2f('0x40')]()[_0x2f2f('0x1d')](respondWithResult(_0x1f28ec,null))[_0x2f2f('0x3d')](handleError(_0x1f28ec,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index ff66ef8..ae8d8ad 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 _0x5145=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x5145,0x93));var _0x5514=function(_0x38358d,_0x41ac85){_0x38358d=_0x38358d-0x0;var _0x435d52=_0x5145[_0x38358d];return _0x435d52;};'use strict';var _=require(_0x5514('0x0'));var util=require(_0x5514('0x1'));var logger=require(_0x5514('0x2'))('api');var moment=require(_0x5514('0x3'));var BPromise=require('bluebird');var rp=require(_0x5514('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5514('0x5'));var config=require(_0x5514('0x6'));var attributes=require(_0x5514('0x7'));module[_0x5514('0x8')]=function(_0x399032,_0x205a65){return _0x399032[_0x5514('0x9')](_0x5514('0xa'),attributes,{'tableName':_0x5514('0xb'),'paranoid':![],'indexes':[{'fields':[_0x5514('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x49e5=['exports','define','VoiceDialReport','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x46e1aa,_0x3d0210){var _0x32bcf2=function(_0x2fac1b){while(--_0x2fac1b){_0x46e1aa['push'](_0x46e1aa['shift']());}};_0x32bcf2(++_0x3d0210);}(_0x49e5,0x196));var _0x549e=function(_0x580409,_0x11a6e8){_0x580409=_0x580409-0x0;var _0x126a85=_0x49e5[_0x580409];return _0x126a85;};'use strict';var _=require(_0x549e('0x0'));var util=require(_0x549e('0x1'));var logger=require(_0x549e('0x2'))(_0x549e('0x3'));var moment=require(_0x549e('0x4'));var BPromise=require(_0x549e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x549e('0x6'));var rimraf=require(_0x549e('0x7'));var config=require(_0x549e('0x8'));var attributes=require(_0x549e('0x9'));module[_0x549e('0xa')]=function(_0x480e2c,_0x1b110f){return _0x480e2c[_0x549e('0xb')](_0x549e('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 913ac67..2c233a6 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 _0xa804=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','CreateVoiceDialReport','body','options','UpdateVoiceDialReport','VoiceDialReport','raw','where'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xa804,0x65));var _0x4a80=function(_0x255349,_0x1e9f38){_0x255349=_0x255349-0x0;var _0x5414bc=_0xa804[_0x255349];return _0x5414bc;};'use strict';var _=require(_0x4a80('0x0'));var util=require(_0x4a80('0x1'));var moment=require(_0x4a80('0x2'));var BPromise=require(_0x4a80('0x3'));var rs=require(_0x4a80('0x4'));var fs=require('fs');var Redis=require(_0x4a80('0x5'));var db=require(_0x4a80('0x6'))['db'];var utils=require(_0x4a80('0x7'));var logger=require(_0x4a80('0x8'))(_0x4a80('0x9'));var config=require(_0x4a80('0xa'));var jayson=require(_0x4a80('0xb'));var client=jayson[_0x4a80('0xc')][_0x4a80('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3d29c9,_0x1f6d9e,_0x544d48){return new BPromise(function(_0x5d1fe1,_0x32291a){return client['request'](_0x3d29c9,_0x544d48)[_0x4a80('0xe')](function(_0x4e9cc5){logger[_0x4a80('0xf')](_0x4a80('0x10'),_0x1f6d9e,'request\x20sent');logger[_0x4a80('0x11')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x1f6d9e,_0x4a80('0x12'),JSON[_0x4a80('0x13')](_0x4e9cc5));if(_0x4e9cc5[_0x4a80('0x14')]){if(_0x4e9cc5['error']['code']===0x1f4){logger[_0x4a80('0x14')]('VoiceDialReport,\x20%s,\x20%s',_0x1f6d9e,_0x4e9cc5[_0x4a80('0x14')][_0x4a80('0x15')]);return _0x32291a(_0x4e9cc5[_0x4a80('0x14')][_0x4a80('0x15')]);}logger['error'](_0x4a80('0x10'),_0x1f6d9e,_0x4e9cc5[_0x4a80('0x14')][_0x4a80('0x15')]);return _0x5d1fe1(_0x4e9cc5[_0x4a80('0x14')]['message']);}else{logger[_0x4a80('0xf')](_0x4a80('0x10'),_0x1f6d9e,_0x4a80('0x12'));_0x5d1fe1(_0x4e9cc5[_0x4a80('0x16')][_0x4a80('0x15')]);}})[_0x4a80('0x17')](function(_0x395805){logger[_0x4a80('0x14')]('VoiceDialReport,\x20%s,\x20%s',_0x1f6d9e,_0x395805);_0x32291a(_0x395805);});});}exports[_0x4a80('0x18')]=function(_0x3283a4){var _0x594503=this;return new Promise(function(_0x4402cb,_0x103cba){return db['VoiceDialReport']['create'](_0x3283a4[_0x4a80('0x19')],{'raw':_0x3283a4[_0x4a80('0x1a')]?_0x3283a4[_0x4a80('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4d9074){logger['info']('CreateVoiceDialReport',_0x3283a4);logger['debug']('CreateVoiceDialReport',_0x3283a4,JSON['stringify'](_0x4d9074));_0x4402cb(_0x4d9074);})[_0x4a80('0x17')](function(_0x1f4bc2){logger['error'](_0x4a80('0x18'),_0x1f4bc2[_0x4a80('0x15')],_0x3283a4);_0x103cba(_0x594503['error'](0x1f4,_0x1f4bc2['message']));});});};exports[_0x4a80('0x1b')]=function(_0x2c2b5d){var _0x1ba598=this;return new Promise(function(_0x4832a3,_0x455a9f){return db[_0x4a80('0x1c')]['update'](_0x2c2b5d[_0x4a80('0x19')],{'raw':_0x2c2b5d[_0x4a80('0x1a')]?_0x2c2b5d[_0x4a80('0x1a')][_0x4a80('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c2b5d['options']?_0x2c2b5d[_0x4a80('0x1a')][_0x4a80('0x1e')]||null:null,'attributes':_0x2c2b5d[_0x4a80('0x1a')]?_0x2c2b5d[_0x4a80('0x1a')][_0x4a80('0x1f')]||null:null,'limit':_0x2c2b5d[_0x4a80('0x1a')]?_0x2c2b5d[_0x4a80('0x1a')][_0x4a80('0x20')]||null:null})[_0x4a80('0xe')](function(_0x28ed39){logger[_0x4a80('0xf')](_0x4a80('0x1b'),_0x2c2b5d);logger['debug']('UpdateVoiceDialReport',_0x2c2b5d,JSON['stringify'](_0x28ed39));_0x4832a3(_0x28ed39);})[_0x4a80('0x17')](function(_0x231416){logger[_0x4a80('0x14')](_0x4a80('0x1b'),_0x231416['message'],_0x2c2b5d);_0x455a9f(_0x1ba598[_0x4a80('0x14')](0x1f4,_0x231416['message']));});});}; \ No newline at end of file +var _0xe84d=['then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','VoiceDialReport','create','body','options','CreateVoiceDialReport','stringify','UpdateVoiceDialReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request'];(function(_0x3af7c4,_0x122873){var _0x591ea1=function(_0x32c2df){while(--_0x32c2df){_0x3af7c4['push'](_0x3af7c4['shift']());}};_0x591ea1(++_0x122873);}(_0xe84d,0x79));var _0xde84=function(_0x461f68,_0x316570){_0x461f68=_0x461f68-0x0;var _0x445dc5=_0xe84d[_0x461f68];return _0x445dc5;};'use strict';var _=require(_0xde84('0x0'));var util=require('util');var moment=require(_0xde84('0x1'));var BPromise=require(_0xde84('0x2'));var rs=require(_0xde84('0x3'));var fs=require('fs');var Redis=require(_0xde84('0x4'));var db=require(_0xde84('0x5'))['db'];var utils=require(_0xde84('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xde84('0x7'));var jayson=require(_0xde84('0x8'));var client=jayson[_0xde84('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa35410,_0x5b54e8,_0x32dd56){return new BPromise(function(_0x1af7e3,_0x133884){return client[_0xde84('0xa')](_0xa35410,_0x32dd56)[_0xde84('0xb')](function(_0x3841a1){logger['info'](_0xde84('0xc'),_0x5b54e8,_0xde84('0xd'));logger[_0xde84('0xe')](_0xde84('0xf'),_0x5b54e8,_0xde84('0xd'),JSON['stringify'](_0x3841a1));if(_0x3841a1['error']){if(_0x3841a1['error'][_0xde84('0x10')]===0x1f4){logger[_0xde84('0x11')](_0xde84('0xc'),_0x5b54e8,_0x3841a1[_0xde84('0x11')][_0xde84('0x12')]);return _0x133884(_0x3841a1[_0xde84('0x11')][_0xde84('0x12')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x5b54e8,_0x3841a1[_0xde84('0x11')][_0xde84('0x12')]);return _0x1af7e3(_0x3841a1[_0xde84('0x11')]['message']);}else{logger[_0xde84('0x13')](_0xde84('0xc'),_0x5b54e8,_0xde84('0xd'));_0x1af7e3(_0x3841a1[_0xde84('0x14')][_0xde84('0x12')]);}})[_0xde84('0x15')](function(_0x40068f){logger['error'](_0xde84('0xc'),_0x5b54e8,_0x40068f);_0x133884(_0x40068f);});});}exports['CreateVoiceDialReport']=function(_0x42e20d){var _0x2e66de=this;return new Promise(function(_0x41fac1,_0xaa960f){return db[_0xde84('0x16')][_0xde84('0x17')](_0x42e20d[_0xde84('0x18')],{'raw':_0x42e20d['options']?_0x42e20d[_0xde84('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xde84('0xb')](function(_0xb4466b){logger[_0xde84('0x13')](_0xde84('0x1a'),_0x42e20d);logger[_0xde84('0xe')](_0xde84('0x1a'),_0x42e20d,JSON[_0xde84('0x1b')](_0xb4466b));_0x41fac1(_0xb4466b);})[_0xde84('0x15')](function(_0x4484c6){logger['error'](_0xde84('0x1a'),_0x4484c6['message'],_0x42e20d);_0xaa960f(_0x2e66de[_0xde84('0x11')](0x1f4,_0x4484c6[_0xde84('0x12')]));});});};exports[_0xde84('0x1c')]=function(_0x48261a){var _0x34a97e=this;return new Promise(function(_0xcd3faf,_0x3201f7){return db[_0xde84('0x16')][_0xde84('0x1d')](_0x48261a['body'],{'raw':_0x48261a[_0xde84('0x19')]?_0x48261a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48261a[_0xde84('0x19')]?_0x48261a['options'][_0xde84('0x1e')]||null:null,'attributes':_0x48261a[_0xde84('0x19')]?_0x48261a[_0xde84('0x19')][_0xde84('0x1f')]||null:null,'limit':_0x48261a[_0xde84('0x19')]?_0x48261a[_0xde84('0x19')][_0xde84('0x20')]||null:null})[_0xde84('0xb')](function(_0xf2b0ae){logger['info'](_0xde84('0x1c'),_0x48261a);logger[_0xde84('0xe')]('UpdateVoiceDialReport',_0x48261a,JSON['stringify'](_0xf2b0ae));_0xcd3faf(_0xf2b0ae);})[_0xde84('0x15')](function(_0x596dd9){logger[_0xde84('0x11')](_0xde84('0x1c'),_0x596dd9[_0xde84('0x12')],_0x48261a);_0x3201f7(_0x34a97e[_0xde84('0x11')](0x1f4,_0x596dd9[_0xde84('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 7aa4ecd..26bf1eb 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 _0x5745=['get','isAuthenticated','index','show','create','/:id/applications','put','update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./voiceExtension.controller'];(function(_0x123450,_0x491c01){var _0x23b29d=function(_0x2c23cb){while(--_0x2c23cb){_0x123450['push'](_0x123450['shift']());}};_0x23b29d(++_0x491c01);}(_0x5745,0xc5));var _0x5574=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5745[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x5574('0x0'));var util=require(_0x5574('0x1'));var path=require('path');var timeout=require(_0x5574('0x2'));var express=require(_0x5574('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5574('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5574('0x5'));var controller=require(_0x5574('0x6'));router[_0x5574('0x7')]('/',auth[_0x5574('0x8')](),controller[_0x5574('0x9')]);router['get']('/:id',auth[_0x5574('0x8')](),controller[_0x5574('0xa')]);router['post']('/',auth[_0x5574('0x8')](),controller[_0x5574('0xb')]);router['post'](_0x5574('0xc'),auth[_0x5574('0x8')](),controller['addApplications']);router[_0x5574('0xd')]('/:id',auth[_0x5574('0x8')](),controller[_0x5574('0xe')]);router[_0x5574('0xf')]('/:id',auth[_0x5574('0x8')](),controller[_0x5574('0x10')]);module['exports']=router; \ No newline at end of file +var _0x7a4d=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0x651909,_0x15c6b4){var _0x572299=function(_0x5e8a48){while(--_0x5e8a48){_0x651909['push'](_0x651909['shift']());}};_0x572299(++_0x15c6b4);}(_0x7a4d,0xe0));var _0xd7a4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x7a4d[_0x32f7d7];return _0x133d09;};'use strict';var multer=require(_0xd7a4('0x0'));var util=require(_0xd7a4('0x1'));var path=require(_0xd7a4('0x2'));var timeout=require(_0xd7a4('0x3'));var express=require(_0xd7a4('0x4'));var router=express[_0xd7a4('0x5')]();var fs_extra=require(_0xd7a4('0x6'));var auth=require(_0xd7a4('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd7a4('0x8'));var controller=require(_0xd7a4('0x9'));router[_0xd7a4('0xa')]('/',auth[_0xd7a4('0xb')](),controller[_0xd7a4('0xc')]);router[_0xd7a4('0xa')]('/:id',auth[_0xd7a4('0xb')](),controller[_0xd7a4('0xd')]);router[_0xd7a4('0xe')]('/',auth[_0xd7a4('0xb')](),controller[_0xd7a4('0xf')]);router[_0xd7a4('0xe')]('/:id/applications',auth[_0xd7a4('0xb')](),controller['addApplications']);router[_0xd7a4('0x10')](_0xd7a4('0x11'),auth[_0xd7a4('0xb')](),controller[_0xd7a4('0x12')]);router[_0xd7a4('0x13')]('/:id',auth[_0xd7a4('0xb')](),controller[_0xd7a4('0x14')]);module[_0xd7a4('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 78d8da6..cc8e4a9 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 _0x7ea2=['sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','VIRTUAL'];(function(_0x1dad92,_0x2f948c){var _0x90a9f6=function(_0x5644db){while(--_0x5644db){_0x1dad92['push'](_0x1dad92['shift']());}};_0x90a9f6(++_0x2f948c);}(_0x7ea2,0x165));var _0x27ea=function(_0x2a1b33,_0x409f50){_0x2a1b33=_0x2a1b33-0x0;var _0x4c50e7=_0x7ea2[_0x2a1b33];return _0x4c50e7;};'use strict';var Sequelize=require(_0x27ea('0x0'));module[_0x27ea('0x1')]={'context':{'type':Sequelize[_0x27ea('0x2')],'allowNull':![],'unique':_0x27ea('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x27ea('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x27ea('0x3')},'tag':{'type':Sequelize[_0x27ea('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x27ea('0x2')],'allowNull':![],'defaultValue':_0x27ea('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x27ea('0x5')](_0x27ea('0x6'),_0x27ea('0x7'),_0x27ea('0x8'),_0x27ea('0x9'),_0x27ea('0xa'),_0x27ea('0xb'),_0x27ea('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0x27ea('0x2')]},'interval':{'type':Sequelize[_0x27ea('0x2')],'allowNull':![],'defaultValue':_0x27ea('0xd')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x27ea('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x27ea('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x27ea('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x27ea('0xf')]},'recordingFormat':{'type':Sequelize[_0x27ea('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x27ea('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0x27ea('0x10')],'get':function(_0x2c61ee){return this['getDataValue']('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x6afa=['VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','inbound-fax','outbound-fax','*,*,*,*','INTEGER','BOOLEAN','wav'];(function(_0x263992,_0x1b4090){var _0x379836=function(_0x4a8db4){while(--_0x4a8db4){_0x263992['push'](_0x263992['shift']());}};_0x379836(++_0x1b4090);}(_0x6afa,0xe4));var _0xa6af=function(_0x195b0c,_0x5298d3){_0x195b0c=_0x195b0c-0x0;var _0x456ba7=_0x6afa[_0x195b0c];return _0x456ba7;};'use strict';var Sequelize=require(_0xa6af('0x0'));module[_0xa6af('0x1')]={'context':{'type':Sequelize[_0xa6af('0x2')],'allowNull':![],'unique':_0xa6af('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xa6af('0x2')],'allowNull':![],'unique':_0xa6af('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xa6af('0x3')},'tag':{'type':Sequelize[_0xa6af('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xa6af('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xa6af('0x4')](_0xa6af('0x5'),'outbound','internal',_0xa6af('0x6'),_0xa6af('0x7'),'system','any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa6af('0x2')],'allowNull':![],'defaultValue':_0xa6af('0x8')},'IntervalId':{'type':Sequelize[_0xa6af('0x9')]},'isApp':{'type':Sequelize[_0xa6af('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xa6af('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xa6af('0x9')]},'recordingFormat':{'type':Sequelize[_0xa6af('0x2')],'defaultValue':_0xa6af('0xb')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xa6af('0xc')],'get':function(_0x4892d0){return this[_0xa6af('0xd')](_0xa6af('0xe'));}},'alias':{'type':Sequelize[_0xa6af('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 910c52a..679f36b 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 _0xaaf8=['bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','includes','type','name','UserProfileResource','end','error','stack','send','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','create','body','startsWith','concat','exten','user','role','UserProfileSection','userProfileId','autoAssociation','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp'];(function(_0x3c032e,_0xaca9e5){var _0x1a0fe1=function(_0x156eda){while(--_0x156eda){_0x3c032e['push'](_0x3c032e['shift']());}};_0x1a0fe1(++_0xaca9e5);}(_0xaaf8,0x11a));var _0x8aaf=function(_0x20e51b,_0x3e9eb6){_0x20e51b=_0x20e51b-0x0;var _0x4e12a8=_0xaaf8[_0x20e51b];return _0x4e12a8;};'use strict';var _=require(_0x8aaf('0x0'));var Redis=require(_0x8aaf('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x8aaf('0x2'));var db=require(_0x8aaf('0x3'))['db'];config[_0x8aaf('0x4')]=_[_0x8aaf('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8aaf('0x6'))(new Redis(config['redis']));require(_0x8aaf('0x7'))[_0x8aaf('0x8')](socket);function respondWithStatusCode(_0x1148a7,_0x46555c){_0x46555c=_0x46555c||0xcc;return function(_0x5dfd40){if(_0x5dfd40){return _0x1148a7[_0x8aaf('0x9')](_0x46555c);}return _0x1148a7[_0x8aaf('0xa')](_0x46555c)['end']();};}function respondWithResult(_0x352da7,_0x15a314){_0x15a314=_0x15a314||0xc8;return function(_0x52ec84){if(_0x52ec84){return _0x352da7['status'](_0x15a314)[_0x8aaf('0xb')](_0x52ec84);}};}function respondWithFilteredResult(_0x1d6bcb,_0x4d8c02){return function(_0x2c3754){if(_0x2c3754){var _0x49167d=typeof _0x4d8c02[_0x8aaf('0xc')]===_0x8aaf('0xd')&&typeof _0x4d8c02[_0x8aaf('0xe')]==='undefined';var _0x3664bd=_0x2c3754[_0x8aaf('0xf')];var _0x43ea3b=_0x49167d?0x0:_0x4d8c02[_0x8aaf('0xc')];var _0x2226ac=_0x49167d?_0x2c3754['count']:_0x4d8c02[_0x8aaf('0xc')]+_0x4d8c02[_0x8aaf('0xe')];var _0xd56ddf;if(_0x2226ac>=_0x3664bd){_0x2226ac=_0x3664bd;_0xd56ddf=0xc8;}else{_0xd56ddf=0xce;}_0x1d6bcb[_0x8aaf('0xa')](_0xd56ddf);return _0x1d6bcb[_0x8aaf('0x10')](_0x8aaf('0x11'),_0x43ea3b+'-'+_0x2226ac+'/'+_0x3664bd)[_0x8aaf('0xb')](_0x2c3754);}return null;};}function removeEntity(_0x2313a9){return function(_0xaf4f89){if(_0xaf4f89){return _0xaf4f89[_0x8aaf('0x12')]()[_0x8aaf('0x13')](function(){var _0x16f8df=_0xaf4f89[_0x8aaf('0x14')]({'plain':!![]});var _0x4176d3=[{'name':_0x8aaf('0x15'),'value':_0x8aaf('0x16'),'ignore':![]},{'name':_0x8aaf('0x17'),'value':_0x8aaf('0x18'),'ignore':![]},{'name':'InternalRoutes','value':_0x8aaf('0x19'),'ignore':![]}];var _0x104a4d=_(_0x4176d3)[_0x8aaf('0x1a')](_0x8aaf('0x1b'))[_0x8aaf('0x1c')](_0x8aaf('0x1d'))['value']();if(_[_0x8aaf('0x1e')](_0x104a4d,_0x16f8df['type'])){return;}var _0x3a7a4c=_['find'](_0x4176d3,[_0x8aaf('0x1d'),_0x16f8df[_0x8aaf('0x1f')]])[_0x8aaf('0x20')];return db[_0x8aaf('0x21')][_0x8aaf('0x12')]({'where':{'type':_0x3a7a4c,'resourceId':_0x16f8df['id']}})[_0x8aaf('0x13')](function(){return _0xaf4f89;});})['then'](function(){_0x2313a9[_0x8aaf('0xa')](0xcc)[_0x8aaf('0x22')]();});}};}function handleEntityNotFound(_0x47b0e0){return function(_0x5e0b69){if(!_0x5e0b69){_0x47b0e0[_0x8aaf('0x9')](0x194);}return _0x5e0b69;};}function handleError(_0x571315,_0x39a292){_0x39a292=_0x39a292||0x1f4;return function(_0x37f2bf){logger[_0x8aaf('0x23')](_0x37f2bf[_0x8aaf('0x24')]);if(_0x37f2bf[_0x8aaf('0x20')]){delete _0x37f2bf[_0x8aaf('0x20')];}_0x571315[_0x8aaf('0xa')](_0x39a292)[_0x8aaf('0x25')](_0x37f2bf);};}exports['index']=function(_0x79ebaf,_0x567638){var _0x5020db={},_0x341ff3={},_0x4a7383={'count':0x0,'rows':[]};var _0x31258e=_[_0x8aaf('0x1c')](db[_0x8aaf('0x26')][_0x8aaf('0x27')],function(_0x3b5a5d){return{'name':_0x3b5a5d[_0x8aaf('0x28')],'type':_0x3b5a5d[_0x8aaf('0x1f')][_0x8aaf('0x29')]};});_0x341ff3[_0x8aaf('0x2a')]=_[_0x8aaf('0x1c')](_0x31258e,_0x8aaf('0x20'));_0x341ff3[_0x8aaf('0x2b')]=_[_0x8aaf('0x2c')](_0x79ebaf[_0x8aaf('0x2b')]);_0x341ff3[_0x8aaf('0x2d')]=_[_0x8aaf('0x2e')](_0x341ff3[_0x8aaf('0x2a')],_0x341ff3[_0x8aaf('0x2b')]);_0x5020db[_0x8aaf('0x2f')]=_[_0x8aaf('0x2e')](_0x341ff3[_0x8aaf('0x2a')],qs[_0x8aaf('0x30')](_0x79ebaf[_0x8aaf('0x2b')][_0x8aaf('0x30')]));_0x5020db[_0x8aaf('0x2f')]=_0x5020db[_0x8aaf('0x2f')][_0x8aaf('0x31')]?_0x5020db[_0x8aaf('0x2f')]:_0x341ff3[_0x8aaf('0x2a')];if(!_0x79ebaf['query'][_0x8aaf('0x32')](_0x8aaf('0x33'))){_0x5020db[_0x8aaf('0xe')]=qs['limit'](_0x79ebaf[_0x8aaf('0x2b')][_0x8aaf('0xe')]);_0x5020db[_0x8aaf('0xc')]=qs[_0x8aaf('0xc')](_0x79ebaf[_0x8aaf('0x2b')]['offset']);}_0x5020db[_0x8aaf('0x34')]=qs[_0x8aaf('0x35')](_0x79ebaf['query']['sort']);_0x5020db[_0x8aaf('0x36')]=qs[_0x8aaf('0x2d')](_[_0x8aaf('0x37')](_0x79ebaf[_0x8aaf('0x2b')],_0x341ff3[_0x8aaf('0x2d')]),_0x31258e);if(_0x79ebaf['query'][_0x8aaf('0x1a')]){_0x5020db[_0x8aaf('0x36')]=_[_0x8aaf('0x38')](_0x5020db[_0x8aaf('0x36')],{'$or':_[_0x8aaf('0x1c')](_0x31258e,function(_0x251c29){if(_0x251c29[_0x8aaf('0x1f')]!==_0x8aaf('0x39')){var _0x38290f={};_0x38290f[_0x251c29[_0x8aaf('0x20')]]={'$like':'%'+_0x79ebaf[_0x8aaf('0x2b')][_0x8aaf('0x1a')]+'%'};return _0x38290f;}})});}_0x5020db=_['merge']({},_0x5020db,_0x79ebaf['options']);var _0x222fd1={'where':_0x5020db['where']};return db[_0x8aaf('0x26')][_0x8aaf('0xf')](_0x222fd1)[_0x8aaf('0x13')](function(_0x125f55){_0x4a7383[_0x8aaf('0xf')]=_0x125f55;if(_0x79ebaf[_0x8aaf('0x2b')]['includeAll']){_0x5020db[_0x8aaf('0x3a')]=[{'all':!![]}];}return db[_0x8aaf('0x26')][_0x8aaf('0x3b')](_0x5020db);})[_0x8aaf('0x13')](function(_0x27ce23){_0x4a7383[_0x8aaf('0x3c')]=_0x27ce23;return _0x4a7383;})[_0x8aaf('0x13')](respondWithFilteredResult(_0x567638,_0x5020db))[_0x8aaf('0x3d')](handleError(_0x567638,null));};exports[_0x8aaf('0x3e')]=function(_0x19b21d,_0x51ad06){var _0x5d2b4e={'raw':![],'where':{'id':_0x19b21d[_0x8aaf('0x3f')]['id']}},_0x28f829={};_0x28f829[_0x8aaf('0x2a')]=_[_0x8aaf('0x2c')](db[_0x8aaf('0x26')][_0x8aaf('0x27')]);_0x28f829[_0x8aaf('0x2b')]=_[_0x8aaf('0x2c')](_0x19b21d[_0x8aaf('0x2b')]);_0x28f829[_0x8aaf('0x2d')]=_[_0x8aaf('0x2e')](_0x28f829['model'],_0x28f829[_0x8aaf('0x2b')]);_0x5d2b4e['attributes']=_[_0x8aaf('0x2e')](_0x28f829[_0x8aaf('0x2a')],qs[_0x8aaf('0x30')](_0x19b21d[_0x8aaf('0x2b')][_0x8aaf('0x30')]));_0x5d2b4e[_0x8aaf('0x2f')]=_0x5d2b4e['attributes'][_0x8aaf('0x31')]?_0x5d2b4e['attributes']:_0x28f829[_0x8aaf('0x2a')];if(_0x19b21d[_0x8aaf('0x2b')][_0x8aaf('0x40')]){_0x5d2b4e[_0x8aaf('0x3a')]=[{'all':!![]}];}_0x5d2b4e=_[_0x8aaf('0x38')]({},_0x5d2b4e,_0x19b21d['options']);return db['VoiceExtension'][_0x8aaf('0x41')](_0x5d2b4e)[_0x8aaf('0x13')](handleEntityNotFound(_0x51ad06,null))['then'](respondWithResult(_0x51ad06,null))['catch'](handleError(_0x51ad06,null));};exports[_0x8aaf('0x12')]=function(_0x11916c,_0x2561bc){return db['VoiceExtension'][_0x8aaf('0x41')]({'where':{'id':_0x11916c[_0x8aaf('0x3f')]['id']}})[_0x8aaf('0x13')](handleEntityNotFound(_0x2561bc,null))[_0x8aaf('0x13')](removeEntity(_0x2561bc,null))['catch'](handleError(_0x2561bc,null));};exports[_0x8aaf('0x42')]=function(_0x35929c,_0x5d74ba){if(_0x35929c[_0x8aaf('0x43')]['type']===_0x8aaf('0x18')&&!_[_0x8aaf('0x44')](_0x35929c[_0x8aaf('0x43')]['exten'],'_')){_0x35929c['body']['exten']='_'[_0x8aaf('0x45')](_0x35929c[_0x8aaf('0x43')][_0x8aaf('0x46')]);}return db[_0x8aaf('0x26')][_0x8aaf('0x42')](_0x35929c['body'],{'raw':![]})['then'](function(_0x3973e0){var _0x18be26=_0x35929c[_0x8aaf('0x47')][_0x8aaf('0x14')]({'plain':!![]});if(!_0x18be26)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18be26[_0x8aaf('0x48')]===_0x8aaf('0x47')){var _0x4e63fb=_0x3973e0[_0x8aaf('0x14')]({'plain':!![]});var _0x4deb00=[{'name':_0x8aaf('0x15'),'value':_0x8aaf('0x16')},{'name':_0x8aaf('0x17'),'value':'outbound'},{'name':'InternalRoutes','value':'internal'}];var _0x270cda=_[_0x8aaf('0x41')](_0x4deb00,[_0x8aaf('0x1d'),_0x4e63fb[_0x8aaf('0x1f')]])[_0x8aaf('0x20')];return db[_0x8aaf('0x49')][_0x8aaf('0x41')]({'where':{'name':_0x270cda,'userProfileId':_0x18be26[_0x8aaf('0x4a')]},'raw':!![]})['then'](function(_0x1cdf8d){if(_0x1cdf8d&&_0x1cdf8d[_0x8aaf('0x4b')]===0x0){return db[_0x8aaf('0x21')][_0x8aaf('0x42')]({'name':_0x4e63fb[_0x8aaf('0x20')],'resourceId':_0x4e63fb['id'],'type':_0x1cdf8d[_0x8aaf('0x20')],'sectionId':_0x1cdf8d['id']},{})[_0x8aaf('0x13')](function(){return _0x3973e0;});}else{return _0x3973e0;}})[_0x8aaf('0x3d')](function(_0x21bebf){logger[_0x8aaf('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21bebf);throw _0x21bebf;});}return _0x3973e0;})['then'](respondWithResult(_0x5d74ba,0xc9))[_0x8aaf('0x3d')](handleError(_0x5d74ba,null));};exports[_0x8aaf('0x4c')]=function(_0x30e786,_0x90f3d3){if(_0x30e786[_0x8aaf('0x43')]['id']){delete _0x30e786['body']['id'];}return db[_0x8aaf('0x26')][_0x8aaf('0x41')]({'where':{'id':_0x30e786[_0x8aaf('0x3f')]['id']}})[_0x8aaf('0x13')](handleEntityNotFound(_0x90f3d3,null))[_0x8aaf('0x13')](function(_0x53a14f){if(_0x53a14f){return db['VoiceExtension']['update'](_[_0x8aaf('0x37')](_0x30e786['body'],[_0x8aaf('0x46'),_0x8aaf('0x4d'),_0x8aaf('0x4e'),_0x8aaf('0x4f'),_0x8aaf('0x50'),_0x8aaf('0x51'),_0x8aaf('0x52')]),{'where':{'context':_0x53a14f[_0x8aaf('0x4d')],'exten':_0x53a14f[_0x8aaf('0x46')]},'individualHooks':!![]})[_0x8aaf('0x13')](function(_0x552f78){return _0x552f78;});}return null;})[_0x8aaf('0x13')](respondWithStatusCode(_0x90f3d3,null))[_0x8aaf('0x3d')](handleError(_0x90f3d3,null));};exports[_0x8aaf('0x53')]=function(_0x41ddc8,_0x4d601f){var _0x3a8e36=_0x41ddc8[_0x8aaf('0x3f')]['id'];var _0x3f8ba8=_0x41ddc8['body'];var _0x15ec59=0xc8;var _0x2ab9ee=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x8aaf('0x54')]['Transaction'][_0x8aaf('0x55')][_0x8aaf('0x56')]},function(_0x5ecf81){return db[_0x8aaf('0x26')][_0x8aaf('0x57')]({'where':{'id':_0x3a8e36},'transaction':_0x5ecf81})['then'](function(_0x1c3aaa){if(_0x1c3aaa){return db[_0x8aaf('0x26')][_0x8aaf('0x12')]({'where':{'VoiceExtensionId':_0x3a8e36},'transaction':_0x5ecf81})[_0x8aaf('0x13')](function(){var _0x1a3e6c=_[_0x8aaf('0x1c')](_0x3f8ba8,function(_0x19b201){_0x19b201[_0x8aaf('0x58')]=_0x3a8e36;_0x19b201[_0x8aaf('0x59')]=!![];return _0x19b201;});return _0x1c3aaa['createRouting'](_0x1a3e6c);})[_0x8aaf('0x13')](function(_0x38f960){return db[_0x8aaf('0x26')][_0x8aaf('0x5a')](_0x38f960,{'transaction':_0x5ecf81});});}else{_0x15ec59=0x194;_0x2ab9ee=[];}});})[_0x8aaf('0x13')](function(){if(_0x15ec59!==0x194){return db[_0x8aaf('0x26')][_0x8aaf('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3a8e36},'order':_0x8aaf('0x5c')})[_0x8aaf('0x13')](function(_0x124d0b){_0x2ab9ee=_0x124d0b;});}})[_0x8aaf('0x3d')](function(_0x484f8a){_0x15ec59=0x1f4;logger[_0x8aaf('0x23')](_0x484f8a[_0x8aaf('0x24')]);if(_0x484f8a[_0x8aaf('0x20')]){delete _0x484f8a[_0x8aaf('0x20')];}_0x2ab9ee=_0x484f8a;})['finally'](function(){if(_0x2ab9ee===null){_0x4d601f[_0x8aaf('0x9')](_0x15ec59);}else{if(_0x15ec59===0x1f4){_0x4d601f[_0x8aaf('0xa')](_0x15ec59)[_0x8aaf('0x25')](_0x2ab9ee);}else{_0x4d601f[_0x8aaf('0xa')](_0x15ec59)[_0x8aaf('0xb')](_0x2ab9ee);}}});}; \ No newline at end of file +var _0xd22d=['localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','find','name','UserProfileResource','destroy','then','error','stack','send','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','merge','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','options','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','isApp','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x490a09,_0x1b1be1){var _0x583016=function(_0x457327){while(--_0x457327){_0x490a09['push'](_0x490a09['shift']());}};_0x583016(++_0x1b1be1);}(_0xd22d,0x10c));var _0xdd22=function(_0x4d9f63,_0x115c88){_0x4d9f63=_0x4d9f63-0x0;var _0xa6dcfe=_0xd22d[_0x4d9f63];return _0xa6dcfe;};'use strict';var _=require(_0xdd22('0x0'));var Redis=require(_0xdd22('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xdd22('0x2'))(_0xdd22('0x3'));var config=require(_0xdd22('0x4'));var db=require(_0xdd22('0x5'))['db'];config[_0xdd22('0x6')]=_[_0xdd22('0x7')](config['redis'],{'host':_0xdd22('0x8'),'port':0x18eb});var socket=require(_0xdd22('0x9'))(new Redis(config[_0xdd22('0x6')]));require(_0xdd22('0xa'))[_0xdd22('0xb')](socket);function respondWithStatusCode(_0x3eeec1,_0x4d4196){_0x4d4196=_0x4d4196||0xcc;return function(_0x561691){if(_0x561691){return _0x3eeec1[_0xdd22('0xc')](_0x4d4196);}return _0x3eeec1[_0xdd22('0xd')](_0x4d4196)[_0xdd22('0xe')]();};}function respondWithResult(_0x5ad2c8,_0x264474){_0x264474=_0x264474||0xc8;return function(_0x54a273){if(_0x54a273){return _0x5ad2c8[_0xdd22('0xd')](_0x264474)['json'](_0x54a273);}};}function respondWithFilteredResult(_0x5d83d1,_0x13e7ef){return function(_0x3afb7b){if(_0x3afb7b){var _0x44bc8a=typeof _0x13e7ef[_0xdd22('0xf')]===_0xdd22('0x10')&&typeof _0x13e7ef[_0xdd22('0x11')]==='undefined';var _0x10e37e=_0x3afb7b['count'];var _0x307f05=_0x44bc8a?0x0:_0x13e7ef[_0xdd22('0xf')];var _0x4a8034=_0x44bc8a?_0x3afb7b[_0xdd22('0x12')]:_0x13e7ef[_0xdd22('0xf')]+_0x13e7ef[_0xdd22('0x11')];var _0x2c62e7;if(_0x4a8034>=_0x10e37e){_0x4a8034=_0x10e37e;_0x2c62e7=0xc8;}else{_0x2c62e7=0xce;}_0x5d83d1[_0xdd22('0xd')](_0x2c62e7);return _0x5d83d1['set'](_0xdd22('0x13'),_0x307f05+'-'+_0x4a8034+'/'+_0x10e37e)[_0xdd22('0x14')](_0x3afb7b);}return null;};}function removeEntity(_0x2351e0){return function(_0x2e523c){if(_0x2e523c){return _0x2e523c['destroy']()['then'](function(){var _0x2e1f67=_0x2e523c[_0xdd22('0x15')]({'plain':!![]});var _0x2b5843=[{'name':_0xdd22('0x16'),'value':_0xdd22('0x17'),'ignore':![]},{'name':_0xdd22('0x18'),'value':_0xdd22('0x19'),'ignore':![]},{'name':_0xdd22('0x1a'),'value':_0xdd22('0x1b'),'ignore':![]}];var _0x39963a=_(_0x2b5843)[_0xdd22('0x1c')]('ignore')[_0xdd22('0x1d')](_0xdd22('0x1e'))['value']();if(_[_0xdd22('0x1f')](_0x39963a,_0x2e1f67['type'])){return;}var _0x3b9072=_[_0xdd22('0x20')](_0x2b5843,['value',_0x2e1f67['type']])[_0xdd22('0x21')];return db[_0xdd22('0x22')][_0xdd22('0x23')]({'where':{'type':_0x3b9072,'resourceId':_0x2e1f67['id']}})['then'](function(){return _0x2e523c;});})[_0xdd22('0x24')](function(){_0x2351e0[_0xdd22('0xd')](0xcc)[_0xdd22('0xe')]();});}};}function handleEntityNotFound(_0x4e88b4){return function(_0x4216e0){if(!_0x4216e0){_0x4e88b4[_0xdd22('0xc')](0x194);}return _0x4216e0;};}function handleError(_0x2b4bab,_0x1ee8dd){_0x1ee8dd=_0x1ee8dd||0x1f4;return function(_0x5cb5c6){logger[_0xdd22('0x25')](_0x5cb5c6[_0xdd22('0x26')]);if(_0x5cb5c6[_0xdd22('0x21')]){delete _0x5cb5c6[_0xdd22('0x21')];}_0x2b4bab[_0xdd22('0xd')](_0x1ee8dd)[_0xdd22('0x27')](_0x5cb5c6);};}exports['index']=function(_0x45a05b,_0x2be071){var _0x39784b={},_0x100023={},_0x4f5dc9={'count':0x0,'rows':[]};var _0x5dcd88=_['map'](db['VoiceExtension'][_0xdd22('0x28')],function(_0x13efa8){return{'name':_0x13efa8[_0xdd22('0x29')],'type':_0x13efa8[_0xdd22('0x2a')]['key']};});_0x100023[_0xdd22('0x2b')]=_[_0xdd22('0x1d')](_0x5dcd88,_0xdd22('0x21'));_0x100023[_0xdd22('0x2c')]=_[_0xdd22('0x2d')](_0x45a05b[_0xdd22('0x2c')]);_0x100023['filters']=_[_0xdd22('0x2e')](_0x100023['model'],_0x100023[_0xdd22('0x2c')]);_0x39784b[_0xdd22('0x2f')]=_[_0xdd22('0x2e')](_0x100023[_0xdd22('0x2b')],qs[_0xdd22('0x30')](_0x45a05b[_0xdd22('0x2c')][_0xdd22('0x30')]));_0x39784b[_0xdd22('0x2f')]=_0x39784b[_0xdd22('0x2f')]['length']?_0x39784b[_0xdd22('0x2f')]:_0x100023[_0xdd22('0x2b')];if(!_0x45a05b[_0xdd22('0x2c')][_0xdd22('0x31')](_0xdd22('0x32'))){_0x39784b[_0xdd22('0x11')]=qs[_0xdd22('0x11')](_0x45a05b[_0xdd22('0x2c')][_0xdd22('0x11')]);_0x39784b['offset']=qs[_0xdd22('0xf')](_0x45a05b[_0xdd22('0x2c')][_0xdd22('0xf')]);}_0x39784b[_0xdd22('0x33')]=qs[_0xdd22('0x34')](_0x45a05b[_0xdd22('0x2c')][_0xdd22('0x34')]);_0x39784b[_0xdd22('0x35')]=qs[_0xdd22('0x36')](_['pick'](_0x45a05b[_0xdd22('0x2c')],_0x100023[_0xdd22('0x36')]),_0x5dcd88);if(_0x45a05b['query'][_0xdd22('0x1c')]){_0x39784b['where']=_['merge'](_0x39784b[_0xdd22('0x35')],{'$or':_[_0xdd22('0x1d')](_0x5dcd88,function(_0x3c77f1){if(_0x3c77f1[_0xdd22('0x2a')]!==_0xdd22('0x37')){var _0x53134d={};_0x53134d[_0x3c77f1[_0xdd22('0x21')]]={'$like':'%'+_0x45a05b['query'][_0xdd22('0x1c')]+'%'};return _0x53134d;}})});}_0x39784b=_[_0xdd22('0x38')]({},_0x39784b,_0x45a05b['options']);var _0x1afb1c={'where':_0x39784b[_0xdd22('0x35')]};return db[_0xdd22('0x39')][_0xdd22('0x12')](_0x1afb1c)[_0xdd22('0x24')](function(_0x3d48e0){_0x4f5dc9[_0xdd22('0x12')]=_0x3d48e0;if(_0x45a05b[_0xdd22('0x2c')][_0xdd22('0x3a')]){_0x39784b[_0xdd22('0x3b')]=[{'all':!![]}];}return db[_0xdd22('0x39')][_0xdd22('0x3c')](_0x39784b);})[_0xdd22('0x24')](function(_0x146e80){_0x4f5dc9[_0xdd22('0x3d')]=_0x146e80;return _0x4f5dc9;})['then'](respondWithFilteredResult(_0x2be071,_0x39784b))[_0xdd22('0x3e')](handleError(_0x2be071,null));};exports[_0xdd22('0x3f')]=function(_0x5eae6e,_0x17a018){var _0x5e17a2={'raw':![],'where':{'id':_0x5eae6e[_0xdd22('0x40')]['id']}},_0x2b18ba={};_0x2b18ba[_0xdd22('0x2b')]=_[_0xdd22('0x2d')](db[_0xdd22('0x39')][_0xdd22('0x28')]);_0x2b18ba[_0xdd22('0x2c')]=_[_0xdd22('0x2d')](_0x5eae6e['query']);_0x2b18ba[_0xdd22('0x36')]=_[_0xdd22('0x2e')](_0x2b18ba[_0xdd22('0x2b')],_0x2b18ba[_0xdd22('0x2c')]);_0x5e17a2[_0xdd22('0x2f')]=_[_0xdd22('0x2e')](_0x2b18ba[_0xdd22('0x2b')],qs[_0xdd22('0x30')](_0x5eae6e[_0xdd22('0x2c')]['fields']));_0x5e17a2[_0xdd22('0x2f')]=_0x5e17a2[_0xdd22('0x2f')]['length']?_0x5e17a2[_0xdd22('0x2f')]:_0x2b18ba['model'];if(_0x5eae6e[_0xdd22('0x2c')]['includeAll']){_0x5e17a2[_0xdd22('0x3b')]=[{'all':!![]}];}_0x5e17a2=_['merge']({},_0x5e17a2,_0x5eae6e[_0xdd22('0x41')]);return db['VoiceExtension'][_0xdd22('0x20')](_0x5e17a2)[_0xdd22('0x24')](handleEntityNotFound(_0x17a018,null))['then'](respondWithResult(_0x17a018,null))[_0xdd22('0x3e')](handleError(_0x17a018,null));};exports[_0xdd22('0x23')]=function(_0x349f4c,_0x22de65){return db[_0xdd22('0x39')]['find']({'where':{'id':_0x349f4c['params']['id']}})[_0xdd22('0x24')](handleEntityNotFound(_0x22de65,null))['then'](removeEntity(_0x22de65,null))[_0xdd22('0x3e')](handleError(_0x22de65,null));};exports[_0xdd22('0x42')]=function(_0x3deaa0,_0x37eddb){if(_0x3deaa0['body'][_0xdd22('0x2a')]==='outbound'&&!_['startsWith'](_0x3deaa0[_0xdd22('0x43')][_0xdd22('0x44')],'_')){_0x3deaa0[_0xdd22('0x43')][_0xdd22('0x44')]='_'[_0xdd22('0x45')](_0x3deaa0[_0xdd22('0x43')]['exten']);}return db[_0xdd22('0x39')]['create'](_0x3deaa0[_0xdd22('0x43')],{'raw':![]})[_0xdd22('0x24')](function(_0x526319){var _0x44cfdd=_0x3deaa0[_0xdd22('0x46')][_0xdd22('0x15')]({'plain':!![]});if(!_0x44cfdd)throw new Error(_0xdd22('0x47'));if(_0x44cfdd[_0xdd22('0x48')]===_0xdd22('0x46')){var _0x48feb0=_0x526319[_0xdd22('0x15')]({'plain':!![]});var _0x270183=[{'name':_0xdd22('0x16'),'value':'inbound'},{'name':_0xdd22('0x18'),'value':_0xdd22('0x19')},{'name':'InternalRoutes','value':_0xdd22('0x1b')}];var _0x18896b=_['find'](_0x270183,[_0xdd22('0x1e'),_0x48feb0[_0xdd22('0x2a')]])[_0xdd22('0x21')];return db[_0xdd22('0x49')][_0xdd22('0x20')]({'where':{'name':_0x18896b,'userProfileId':_0x44cfdd[_0xdd22('0x4a')]},'raw':!![]})['then'](function(_0x292584){if(_0x292584&&_0x292584[_0xdd22('0x4b')]===0x0){return db['UserProfileResource'][_0xdd22('0x42')]({'name':_0x48feb0[_0xdd22('0x21')],'resourceId':_0x48feb0['id'],'type':_0x292584['name'],'sectionId':_0x292584['id']},{})['then'](function(){return _0x526319;});}else{return _0x526319;}})['catch'](function(_0x174d42){logger[_0xdd22('0x25')](_0xdd22('0x4c'),_0x174d42);throw _0x174d42;});}return _0x526319;})[_0xdd22('0x24')](respondWithResult(_0x37eddb,0xc9))[_0xdd22('0x3e')](handleError(_0x37eddb,null));};exports['update']=function(_0x34e539,_0x990713){if(_0x34e539['body']['id']){delete _0x34e539[_0xdd22('0x43')]['id'];}return db[_0xdd22('0x39')]['find']({'where':{'id':_0x34e539[_0xdd22('0x40')]['id']}})['then'](handleEntityNotFound(_0x990713,null))[_0xdd22('0x24')](function(_0x6554dc){if(_0x6554dc){return db[_0xdd22('0x39')][_0xdd22('0x4d')](_[_0xdd22('0x4e')](_0x34e539[_0xdd22('0x43')],[_0xdd22('0x44'),_0xdd22('0x4f'),'description','recordingFormat',_0xdd22('0x50'),_0xdd22('0x51'),_0xdd22('0x52')]),{'where':{'context':_0x6554dc[_0xdd22('0x4f')],'exten':_0x6554dc['exten']},'individualHooks':!![]})[_0xdd22('0x24')](function(_0xbe100e){return _0xbe100e;});}return null;})['then'](respondWithStatusCode(_0x990713,null))[_0xdd22('0x3e')](handleError(_0x990713,null));};exports[_0xdd22('0x53')]=function(_0x430fd3,_0x415672){var _0x273ab4=_0x430fd3[_0xdd22('0x40')]['id'];var _0x125c8c=_0x430fd3[_0xdd22('0x43')];var _0x460f7f=0xc8;var _0x33dd58=null;return db[_0xdd22('0x54')]['transaction']({'isolationLevel':db[_0xdd22('0x54')][_0xdd22('0x55')][_0xdd22('0x56')][_0xdd22('0x57')]},function(_0x52b139){return db['VoiceExtension']['findOne']({'where':{'id':_0x273ab4},'transaction':_0x52b139})[_0xdd22('0x24')](function(_0x56fa66){if(_0x56fa66){return db[_0xdd22('0x39')]['destroy']({'where':{'VoiceExtensionId':_0x273ab4},'transaction':_0x52b139})[_0xdd22('0x24')](function(){var _0x499af0=_[_0xdd22('0x1d')](_0x125c8c,function(_0x1fb69f){_0x1fb69f[_0xdd22('0x58')]=_0x273ab4;_0x1fb69f[_0xdd22('0x59')]=!![];return _0x1fb69f;});return _0x56fa66['createRouting'](_0x499af0);})[_0xdd22('0x24')](function(_0x440b2f){return db[_0xdd22('0x39')]['bulkCreate'](_0x440b2f,{'transaction':_0x52b139});});}else{_0x460f7f=0x194;_0x33dd58=[];}});})[_0xdd22('0x24')](function(){if(_0x460f7f!==0x194){return db['VoiceExtension'][_0xdd22('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x273ab4},'order':_0xdd22('0x5b')})[_0xdd22('0x24')](function(_0x46d93e){_0x33dd58=_0x46d93e;});}})[_0xdd22('0x3e')](function(_0x1e321c){_0x460f7f=0x1f4;logger[_0xdd22('0x25')](_0x1e321c[_0xdd22('0x26')]);if(_0x1e321c[_0xdd22('0x21')]){delete _0x1e321c[_0xdd22('0x21')];}_0x33dd58=_0x1e321c;})['finally'](function(){if(_0x33dd58===null){_0x415672[_0xdd22('0xc')](_0x460f7f);}else{if(_0x460f7f===0x1f4){_0x415672[_0xdd22('0xd')](_0x460f7f)['send'](_0x33dd58);}else{_0x415672['status'](_0x460f7f)[_0xdd22('0x14')](_0x33dd58);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 4feef35..e49a1a4 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 _0x045f=['hasOwnProperty','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update'];(function(_0x18e062,_0x4d279d){var _0xdf3847=function(_0x1b0bb4){while(--_0x1b0bb4){_0x18e062['push'](_0x18e062['shift']());}};_0xdf3847(++_0x4d279d);}(_0x045f,0x162));var _0xf045=function(_0x34cf44,_0x31d9bf){_0x34cf44=_0x34cf44-0x0;var _0x2884f7=_0x045f[_0x34cf44];return _0x2884f7;};'use strict';var EventEmitter=require(_0xf045('0x0'));var VoiceExtension=require(_0xf045('0x1'))['db'][_0xf045('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xf045('0x3')](0x0);var events={'afterCreate':_0xf045('0x4'),'afterUpdate':_0xf045('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4f18d7){return function(_0x1ffa29,_0x20203b,_0x2a31ac){VoiceExtensionEvents['emit'](_0x4f18d7+':'+_0x1ffa29['id'],_0x1ffa29);VoiceExtensionEvents['emit'](_0x4f18d7,_0x1ffa29);_0x2a31ac(null);};}for(var e in events){if(events[_0xf045('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xf045('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0x7652=['hasOwnProperty','hook','events','VoiceExtension','update','emit'];(function(_0x147f22,_0x3fb477){var _0x480aec=function(_0x42c78d){while(--_0x42c78d){_0x147f22['push'](_0x147f22['shift']());}};_0x480aec(++_0x3fb477);}(_0x7652,0x188));var _0x2765=function(_0x13d816,_0x37ca7){_0x13d816=_0x13d816-0x0;var _0x5ab9fe=_0x7652[_0x13d816];return _0x5ab9fe;};'use strict';var EventEmitter=require(_0x2765('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x2765('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2765('0x2'),'afterDestroy':'remove'};function emitEvent(_0x184068){return function(_0x3474d7,_0x4124d3,_0x8c2175){VoiceExtensionEvents['emit'](_0x184068+':'+_0x3474d7['id'],_0x3474d7);VoiceExtensionEvents[_0x2765('0x3')](_0x184068,_0x3474d7);_0x8c2175(null);};}for(var e in events){if(events[_0x2765('0x4')](e)){var event=events[e];VoiceExtension[_0x2765('0x5')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 1ca21e7..cf4f501 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 _0xd90b=['interval','IntervalId','then','*,*,*,*','intervals','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','ExecIf','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','outboundDial','appdata','last','priority','concat','define','VoiceExtension','get','Hangup','lodash','type','Set','CDR(type)=','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','split','length','name','trunk','param','phone','prefix','SIP','join','U(xcally-mixmonitor-context)','replace','findAll'];(function(_0x38afdc,_0x3e1528){var _0x53cb2c=function(_0x2af24e){while(--_0x2af24e){_0x38afdc['push'](_0x38afdc['shift']());}};_0x53cb2c(++_0x3e1528);}(_0xd90b,0xbd));var _0xbd90=function(_0x63ee6,_0x1caeb0){_0x63ee6=_0x63ee6-0x0;var _0x3ed4e4=_0xd90b[_0x63ee6];return _0x3ed4e4;};'use strict';var _=require(_0xbd90('0x0'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x2f8d43){var _0x5a9a50=_0x2f8d43['models'];function _0x40bb8c(_0x4a2e40){var _0x3d994c=0x2;var _0x1813c7=[{'type':_0x4a2e40[_0xbd90('0x1')],'app':_0xbd90('0x2'),'appdata':_0xbd90('0x3')+_0x4a2e40[_0xbd90('0x1')],'context':_0x4a2e40['context'],'exten':_0x4a2e40[_0xbd90('0x4')],'priority':_0x3d994c++,'VoiceExtensionId':_0x4a2e40['id']},{'type':_0x4a2e40[_0xbd90('0x1')],'app':_0x4a2e40[_0xbd90('0x5')]?_0xbd90('0x2'):_0xbd90('0x6'),'appdata':_0x4a2e40[_0xbd90('0x5')]?_0xbd90('0x7')+_0x4a2e40[_0xbd90('0x5')]:_0xbd90('0x8'),'context':_0x4a2e40[_0xbd90('0x9')],'exten':_0x4a2e40[_0xbd90('0x4')],'priority':_0x3d994c++,'VoiceExtensionId':_0x4a2e40['id']}];if(_0x4a2e40['type']===_0xbd90('0xa')){_0x1813c7[_0xbd90('0xb')]({'type':'inbound','app':'Set','appdata':_0xbd90('0xc')+_0x4a2e40['id'],'context':_0x4a2e40[_0xbd90('0x9')],'exten':_0x4a2e40[_0xbd90('0x4')],'priority':_0x3d994c++,'VoiceExtensionId':_0x4a2e40['id']});}_0x1813c7[_0xbd90('0xb')]({'type':_0x4a2e40['type'],'app':_0xbd90('0x2'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4a2e40['context'],'exten':_0x4a2e40['exten'],'priority':_0x3d994c++,'VoiceExtensionId':_0x4a2e40['id']},{'type':_0x4a2e40[_0xbd90('0x1')],'app':_0xbd90('0x2'),'appdata':_0xbd90('0xd'),'context':_0x4a2e40[_0xbd90('0x9')],'exten':_0x4a2e40[_0xbd90('0x4')],'priority':_0x3d994c++,'VoiceExtensionId':_0x4a2e40['id']},{'type':_0x4a2e40[_0xbd90('0x1')],'app':'Set','appdata':_0xbd90('0xe'),'context':_0x4a2e40[_0xbd90('0x9')],'exten':_0x4a2e40['exten'],'priority':_0x3d994c++,'VoiceExtensionId':_0x4a2e40['id']});return _0x1813c7;}function _0x172871(_0x396b50){var _0x2f1e13=0x2;var _0x516f4b=[{'type':_0xbd90('0xf'),'app':_0xbd90('0x2'),'appdata':_0xbd90('0x10'),'context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50['exten'],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':'outbound','app':_0x396b50[_0xbd90('0x5')]?'Set':_0xbd90('0x6'),'appdata':_0x396b50[_0xbd90('0x5')]?_0xbd90('0x7')+_0x396b50[_0xbd90('0x5')]:_0xbd90('0x8'),'context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':'outbound','app':'Set','appdata':_0xbd90('0x11')+(_0x396b50['cutdigits']?_0xbd90('0x12')+_0x396b50['cutdigits']+'}':_0xbd90('0x13')),'context':_0x396b50['context'],'exten':_0x396b50['exten'],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':'outbound','app':_0xbd90('0x2'),'appdata':_0xbd90('0xc')+_0x396b50['id'],'context':_0x396b50['context'],'exten':_0x396b50['exten'],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':_0xbd90('0xf'),'app':'ExecIf','appdata':_0xbd90('0x14')+(_0x2f1e13+0x2)+_0xbd90('0x15')+(_0x2f1e13+0x1)+')','context':_0x396b50['context'],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':_0xbd90('0xf'),'app':_0xbd90('0x2'),'appdata':_0x396b50[_0xbd90('0x16')]?_0xbd90('0x17')+_0x396b50[_0xbd90('0x16')]+'}':_0xbd90('0x18'),'context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':_0xbd90('0xf'),'app':_0xbd90('0x2'),'appdata':_0xbd90('0x19'),'context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':_0xbd90('0xf'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x396b50['context'],'exten':_0x396b50['exten'],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':_0xbd90('0xf'),'app':_0xbd90('0x2'),'appdata':'MONITOR_OPTIONS=ab','context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':_0xbd90('0xf'),'app':'Set','appdata':'outboundrouteid='+_0x396b50['id'],'context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']}];if(_0x396b50[_0xbd90('0x1a')]('recordingFormat')&&_0x396b50[_0xbd90('0x1b')]!==_0xbd90('0x1c')){_0x516f4b[_0xbd90('0xb')]({'type':_0xbd90('0xf'),'app':_0xbd90('0x2'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':_0xbd90('0xf'),'app':_0xbd90('0x2'),'appdata':_0xbd90('0x1d')+_0x396b50['recordingFormat']||_0xbd90('0x1e'),'context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']});}return _0x516f4b;}function _0x379156(_0x97b43e,_0x3f01d3){var _0x328bff=[{'name':'trunk','param':0x0},{'name':_0xbd90('0x1f'),'param':0x1},{'name':_0xbd90('0x20'),'param':0x2},{'name':'url','param':0x3}];var _0x58af7f={};var _0x3c3e75=_0x3f01d3[_0xbd90('0x21')](',');var _0x57973f=[];for(var _0x2bde49=0x0;_0x2bde49<_0x328bff[_0xbd90('0x22')];_0x2bde49++){switch(_0x328bff[_0x2bde49][_0xbd90('0x23')]){case _0xbd90('0x24'):_0x58af7f[_0xbd90('0x24')]=_0x3c3e75[_0x328bff[_0x2bde49][_0xbd90('0x25')]][_0xbd90('0x21')]('/')[0x1];_0x58af7f[_0xbd90('0x26')]=_0x3c3e75[_0x328bff[_0x2bde49][_0xbd90('0x25')]][_0xbd90('0x21')]('/')[0x2];_0x58af7f[_0xbd90('0x27')]=_0x58af7f[_0xbd90('0x26')]?_0x58af7f[_0xbd90('0x26')][_0xbd90('0x21')]('$')[0x0]:undefined;_0x58af7f[_0xbd90('0x26')]=_0x97b43e[_0xbd90('0x16')]?(_0x58af7f[_0xbd90('0x27')]||'')+_0xbd90('0x12')+_0x97b43e['cutdigits']+'}':(_0x58af7f[_0xbd90('0x27')]||'')+'${EXTEN}';_0x57973f[_0x328bff[_0x2bde49][_0xbd90('0x25')]]=[_0xbd90('0x28'),_0x58af7f['trunk'],_0x58af7f['phone']][_0xbd90('0x29')]('/');break;case _0xbd90('0x20'):_0x58af7f[_0xbd90('0x20')]=_0x3c3e75[_0x328bff[_0x2bde49][_0xbd90('0x25')]];if(_0x97b43e['recordingFormat']!==_0xbd90('0x1c')){if(_0x58af7f[_0xbd90('0x20')]['indexOf'](_0xbd90('0x2a'))<0x0){_0x58af7f[_0xbd90('0x20')]+='U(xcally-mixmonitor-context)';}}else{_0x58af7f['options']=_0x58af7f['options'][_0xbd90('0x2b')](_0xbd90('0x2a'),'');}_0x57973f[_0x328bff[_0x2bde49][_0xbd90('0x25')]]=_0x58af7f[_0xbd90('0x20')];break;default:_0x57973f[_0x328bff[_0x2bde49][_0xbd90('0x25')]]=_0x3c3e75[_0x328bff[_0x2bde49][_0xbd90('0x25')]];}}return _0x57973f[_0xbd90('0x29')](',');}function _0x38d4cc(_0x55b20b,_0x1d7ab1,_0x3ccfe9){return new Promise(function(_0x101da7,_0x4be952){var _0x4ea963=[];if(_['isEmpty'](_0x1d7ab1))return _0x101da7(_0x4ea963);_0x5a9a50['Interval'][_0xbd90('0x2c')]({'attributes':['id',_0xbd90('0x2d'),_0xbd90('0x2e')],'raw':!![]})[_0xbd90('0x2f')](function(_0x1cc904){for(var _0x572d83=0x0,_0xff8bc0=0x0;_0x572d83<_0x1d7ab1[_0xbd90('0x22')];_0x572d83++,_0xff8bc0=0x0){var _0x1c3ede=_0x1d7ab1[_0x572d83];var _0x1cf02a=[];var _0x31e0fe=[];delete _0x1c3ede['id'];if(_0x1c3ede[_0xbd90('0x2d')]!==_0xbd90('0x30')){_0x1c3ede[_0xbd90('0x31')]=[_0x1c3ede[_0xbd90('0x2d')]];}else{_0x1c3ede[_0xbd90('0x31')]=_0x1c3ede[_0xbd90('0x2e')]?_['map'](_[_0xbd90('0x32')](_0x1cc904,{'IntervalId':_0x1c3ede[_0xbd90('0x2e')]}),_0xbd90('0x2d')):[];}_0x1c3ede[_0xbd90('0x9')]=_0x55b20b[_0xbd90('0x9')];_0x1c3ede['exten']=_0x55b20b[_0xbd90('0x4')];if(_0x1c3ede[_0xbd90('0x1')])_0x1c3ede[_0xbd90('0x1')]=_0x1c3ede[_0xbd90('0x1')]['toLowerCase']();if(_0x55b20b[_0xbd90('0x1')]===_0xbd90('0xf')){if(_0x1c3ede[_0xbd90('0x1a')](_0xbd90('0x33'))&&_0x1c3ede[_0xbd90('0x33')]&&_0x1c3ede[_0xbd90('0x33')]!=='--'){_0x1cf02a[_0xbd90('0xb')]({'type':_0x1c3ede['type'][_0xbd90('0x34')](),'app':'Set','appdata':_0xbd90('0x35')+_0x1c3ede[_0xbd90('0x33')],'context':_0x55b20b[_0xbd90('0x9')],'exten':_0x55b20b[_0xbd90('0x4')],'priority':_0x1c3ede[_0xbd90('0x31')][_0xbd90('0x22')]+_0x3ccfe9+_0xff8bc0++,'VoiceExtensionId':_0x55b20b['id']});}_0x1cf02a[_0xbd90('0xb')]({'type':_0x1c3ede[_0xbd90('0x1')][_0xbd90('0x34')](),'app':'ExecIf','appdata':_0xbd90('0x36')+(_0x1c3ede[_0xbd90('0x37')]?_0xbd90('0x38')+_0x1c3ede['callerID']+')':_0xbd90('0x39')),'context':_0x55b20b['context'],'exten':_0x55b20b[_0xbd90('0x4')],'priority':_0x1c3ede[_0xbd90('0x31')][_0xbd90('0x22')]+_0x3ccfe9+_0xff8bc0++,'VoiceExtensionId':_0x55b20b['id']});}else{if(_0x1c3ede[_0xbd90('0x1a')](_0xbd90('0x3a'))){if(['queue',_0xbd90('0x3b')][_0xbd90('0x3c')](_0x1c3ede['app'][_0xbd90('0x34')]())&&_0x1c3ede[_0xbd90('0x3d')]!==_0xbd90('0x3e')){if(_0x1c3ede[_0xbd90('0x3a')]){_0x1cf02a['push']({'type':_0x1c3ede[_0xbd90('0x1')]['toLowerCase'](),'app':'ExecIf','appdata':_0xbd90('0x3f'),'context':_0x55b20b[_0xbd90('0x9')],'exten':_0x55b20b[_0xbd90('0x4')],'priority':_0x1c3ede[_0xbd90('0x31')][_0xbd90('0x22')]+_0x3ccfe9+_0xff8bc0++,'VoiceExtensionId':_0x55b20b['id']});_0x1cf02a[_0xbd90('0xb')]({'type':_0x1c3ede[_0xbd90('0x1')]['toLowerCase'](),'app':_0xbd90('0x2'),'appdata':_0xbd90('0x40'),'context':_0x55b20b[_0xbd90('0x9')],'exten':_0x55b20b['exten'],'priority':_0x1c3ede[_0xbd90('0x31')][_0xbd90('0x22')]+_0x3ccfe9+_0xff8bc0++,'VoiceExtensionId':_0x55b20b['id']});}else{_0x1cf02a[_0xbd90('0xb')]({'type':_0x1c3ede[_0xbd90('0x1')]['toLowerCase'](),'app':_0xbd90('0x41'),'appdata':_0xbd90('0x42'),'context':_0x55b20b['context'],'exten':_0x55b20b[_0xbd90('0x4')],'priority':_0x1c3ede[_0xbd90('0x31')][_0xbd90('0x22')]+_0x3ccfe9+_0xff8bc0++,'VoiceExtensionId':_0x55b20b['id']});_0x1cf02a[_0xbd90('0xb')]({'type':_0x1c3ede[_0xbd90('0x1')]['toLowerCase'](),'app':_0xbd90('0x2'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x55b20b[_0xbd90('0x9')],'exten':_0x55b20b[_0xbd90('0x4')],'priority':_0x1c3ede['intervals'][_0xbd90('0x22')]+_0x3ccfe9+_0xff8bc0++,'VoiceExtensionId':_0x55b20b['id']});}}}}for(var _0xec5387=0x0;_0xec5387<_0x1c3ede[_0xbd90('0x31')][_0xbd90('0x22')];_0xec5387++){var _0x49b069=_0x3ccfe9+_0x1c3ede['intervals'][_0xbd90('0x22')];var _0x53354f=_0xec5387===_0x1c3ede['intervals'][_0xbd90('0x22')]-0x1?_0x3ccfe9+_0x1cf02a[_0xbd90('0x22')]+_0x31e0fe[_0xbd90('0x22')]+0x2:_0x3ccfe9+_0xec5387+0x1;_0x1cf02a[_0xbd90('0x43')](_0xec5387,0x0,{'type':_0x55b20b[_0xbd90('0x1')],'app':'GotoIfTime','appdata':_0x1c3ede[_0xbd90('0x31')][_0xec5387]+'?'+_0x55b20b[_0xbd90('0x9')]+_0xbd90('0x44')+_0x49b069+':'+_0x55b20b[_0xbd90('0x9')]+_0xbd90('0x44')+_0x53354f,'exten':_0x55b20b[_0xbd90('0x4')],'context':_0x55b20b['context'],'priority':_0x3ccfe9+_0xec5387,'VoiceExtensionId':_0x55b20b['id']});}if(_0x1c3ede['appType']===_0xbd90('0x45'))_0x1c3ede[_0xbd90('0x46')]=_0x379156(_0x55b20b,_0x1c3ede['appdata']);_0x1c3ede['priority']=_0x1cf02a[_0xbd90('0x22')]?_[_0xbd90('0x47')](_0x1cf02a)[_0xbd90('0x48')]+0x1:_0x3ccfe9;_0x4ea963=_[_0xbd90('0x49')](_0x4ea963,_0x1cf02a,[_0x1c3ede],_0x31e0fe);_0x3ccfe9=_[_0xbd90('0x47')](_0x4ea963)['priority']+0x1;}return _0x101da7(_0x4ea963);})['catch'](function(_0x1cbed5){_0x4be952(_0x1cbed5);});});}return _0x2f8d43[_0xbd90('0x4a')](_0xbd90('0x4b'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x572089){var _0x87656b=this[_0xbd90('0x4c')]({'plain':!![]});var _0x4b17e8=_0x87656b['type']===_0xbd90('0xf')?_0x172871(_0x87656b):_0x40bb8c(_0x87656b);return _0x38d4cc(_0x87656b,_0x572089,_['last'](_0x4b17e8)[_0xbd90('0x48')]+0x1)['then'](function(_0x21c91c){var _0x5820bb=_[_0xbd90('0x49')](_0x4b17e8,_0x21c91c);_0x5820bb[_0xbd90('0xb')]({'type':_0x87656b[_0xbd90('0x1')],'app':_0xbd90('0x4d'),'exten':_0x87656b[_0xbd90('0x4')],'context':_0x87656b['context'],'priority':_[_0xbd90('0x47')](_0x5820bb)[_0xbd90('0x48')]+0x1,'VoiceExtensionId':_0x87656b['id']});return _0x5820bb;});}}});}; \ No newline at end of file +var _0xc01b=['indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','filter','tag','toLowerCase','CDR(tag)=','length','callerID','Set(CALLERID(all)=','answer','playback','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','priority','catch','define','VoiceExtension','get','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','timeout','split','trunk','param','phone','prefix','SIP','join','options','none'];(function(_0x49052b,_0x3ba709){var _0x48c045=function(_0x41ac38){while(--_0x41ac38){_0x49052b['push'](_0x49052b['shift']());}};_0x48c045(++_0x3ba709);}(_0xc01b,0x74));var _0xbc01=function(_0x113b2d,_0x4b682b){_0x113b2d=_0x113b2d-0x0;var _0x1ea017=_0xc01b[_0x113b2d];return _0x1ea017;};'use strict';var _=require(_0xbc01('0x0'));var attributes=require(_0xbc01('0x1'));module[_0xbc01('0x2')]=function(_0x79c950){var _0x2ca5aa=_0x79c950[_0xbc01('0x3')];function _0x2fa563(_0x5ede59){var _0x2c35d0=0x2;var _0x133078=[{'type':_0x5ede59[_0xbc01('0x4')],'app':_0xbc01('0x5'),'appdata':_0xbc01('0x6')+_0x5ede59[_0xbc01('0x4')],'context':_0x5ede59[_0xbc01('0x7')],'exten':_0x5ede59[_0xbc01('0x8')],'priority':_0x2c35d0++,'VoiceExtensionId':_0x5ede59['id']},{'type':_0x5ede59[_0xbc01('0x4')],'app':_0x5ede59[_0xbc01('0x9')]?_0xbc01('0x5'):'NoOp','appdata':_0x5ede59['alias']?_0xbc01('0xa')+_0x5ede59[_0xbc01('0x9')]:_0xbc01('0xb'),'context':_0x5ede59[_0xbc01('0x7')],'exten':_0x5ede59[_0xbc01('0x8')],'priority':_0x2c35d0++,'VoiceExtensionId':_0x5ede59['id']}];if(_0x5ede59[_0xbc01('0x4')]===_0xbc01('0xc')){_0x133078['push']({'type':_0xbc01('0xc'),'app':_0xbc01('0x5'),'appdata':_0xbc01('0xd')+_0x5ede59['id'],'context':_0x5ede59['context'],'exten':_0x5ede59[_0xbc01('0x8')],'priority':_0x2c35d0++,'VoiceExtensionId':_0x5ede59['id']});}_0x133078[_0xbc01('0xe')]({'type':_0x5ede59[_0xbc01('0x4')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5ede59['context'],'exten':_0x5ede59[_0xbc01('0x8')],'priority':_0x2c35d0++,'VoiceExtensionId':_0x5ede59['id']},{'type':_0x5ede59[_0xbc01('0x4')],'app':_0xbc01('0x5'),'appdata':_0xbc01('0xf'),'context':_0x5ede59['context'],'exten':_0x5ede59[_0xbc01('0x8')],'priority':_0x2c35d0++,'VoiceExtensionId':_0x5ede59['id']},{'type':_0x5ede59[_0xbc01('0x4')],'app':_0xbc01('0x5'),'appdata':_0xbc01('0x10'),'context':_0x5ede59[_0xbc01('0x7')],'exten':_0x5ede59[_0xbc01('0x8')],'priority':_0x2c35d0++,'VoiceExtensionId':_0x5ede59['id']});return _0x133078;}function _0xb56a44(_0x166a34){var _0x1e3105=0x2;var _0x4af959=[{'type':_0xbc01('0x11'),'app':_0xbc01('0x5'),'appdata':_0xbc01('0x12'),'context':_0x166a34['context'],'exten':_0x166a34[_0xbc01('0x8')],'priority':_0x1e3105++,'VoiceExtensionId':_0x166a34['id']},{'type':_0xbc01('0x11'),'app':_0x166a34['alias']?_0xbc01('0x5'):_0xbc01('0x13'),'appdata':_0x166a34[_0xbc01('0x9')]?_0xbc01('0xa')+_0x166a34[_0xbc01('0x9')]:_0xbc01('0xb'),'context':_0x166a34[_0xbc01('0x7')],'exten':_0x166a34[_0xbc01('0x8')],'priority':_0x1e3105++,'VoiceExtensionId':_0x166a34['id']},{'type':'outbound','app':'Set','appdata':'CDR(destination)='+(_0x166a34[_0xbc01('0x14')]?_0xbc01('0x15')+_0x166a34[_0xbc01('0x14')]+'}':_0xbc01('0x16')),'context':_0x166a34[_0xbc01('0x7')],'exten':_0x166a34[_0xbc01('0x8')],'priority':_0x1e3105++,'VoiceExtensionId':_0x166a34['id']},{'type':_0xbc01('0x11'),'app':_0xbc01('0x5'),'appdata':_0xbc01('0xd')+_0x166a34['id'],'context':_0x166a34[_0xbc01('0x7')],'exten':_0x166a34['exten'],'priority':_0x1e3105++,'VoiceExtensionId':_0x166a34['id']},{'type':_0xbc01('0x11'),'app':_0xbc01('0x17'),'appdata':_0xbc01('0x18')+(_0x1e3105+0x2)+_0xbc01('0x19')+(_0x1e3105+0x1)+')','context':_0x166a34[_0xbc01('0x7')],'exten':_0x166a34[_0xbc01('0x8')],'priority':_0x1e3105++,'VoiceExtensionId':_0x166a34['id']},{'type':_0xbc01('0x11'),'app':'Set','appdata':_0x166a34[_0xbc01('0x14')]?_0xbc01('0x1a')+_0x166a34[_0xbc01('0x14')]+'}':_0xbc01('0x1b'),'context':_0x166a34[_0xbc01('0x7')],'exten':_0x166a34[_0xbc01('0x8')],'priority':_0x1e3105++,'VoiceExtensionId':_0x166a34['id']},{'type':_0xbc01('0x11'),'app':_0xbc01('0x5'),'appdata':_0xbc01('0x1c'),'context':_0x166a34[_0xbc01('0x7')],'exten':_0x166a34[_0xbc01('0x8')],'priority':_0x1e3105++,'VoiceExtensionId':_0x166a34['id']},{'type':'outbound','app':_0xbc01('0x5'),'appdata':_0xbc01('0xf'),'context':_0x166a34[_0xbc01('0x7')],'exten':_0x166a34[_0xbc01('0x8')],'priority':_0x1e3105++,'VoiceExtensionId':_0x166a34['id']},{'type':_0xbc01('0x11'),'app':_0xbc01('0x5'),'appdata':_0xbc01('0x10'),'context':_0x166a34['context'],'exten':_0x166a34[_0xbc01('0x8')],'priority':_0x1e3105++,'VoiceExtensionId':_0x166a34['id']},{'type':'outbound','app':_0xbc01('0x5'),'appdata':_0xbc01('0x1d')+_0x166a34['id'],'context':_0x166a34[_0xbc01('0x7')],'exten':_0x166a34[_0xbc01('0x8')],'priority':_0x1e3105++,'VoiceExtensionId':_0x166a34['id']}];if(_0x166a34[_0xbc01('0x1e')](_0xbc01('0x1f'))&&_0x166a34[_0xbc01('0x1f')]!=='none'){_0x4af959['push']({'type':_0xbc01('0x11'),'app':_0xbc01('0x5'),'appdata':_0xbc01('0x20'),'context':_0x166a34['context'],'exten':_0x166a34[_0xbc01('0x8')],'priority':_0x1e3105++,'VoiceExtensionId':_0x166a34['id']},{'type':_0xbc01('0x11'),'app':_0xbc01('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x166a34[_0xbc01('0x1f')]||_0xbc01('0x21'),'context':_0x166a34[_0xbc01('0x7')],'exten':_0x166a34[_0xbc01('0x8')],'priority':_0x1e3105++,'VoiceExtensionId':_0x166a34['id']});}return _0x4af959;}function _0x59edb1(_0x54f9cd,_0x2596ee){var _0x476072=[{'name':'trunk','param':0x0},{'name':_0xbc01('0x22'),'param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x59c2af={};var _0x157c5d=_0x2596ee[_0xbc01('0x23')](',');var _0x55b232=[];for(var _0x524472=0x0;_0x524472<_0x476072['length'];_0x524472++){switch(_0x476072[_0x524472]['name']){case _0xbc01('0x24'):_0x59c2af[_0xbc01('0x24')]=_0x157c5d[_0x476072[_0x524472][_0xbc01('0x25')]][_0xbc01('0x23')]('/')[0x1];_0x59c2af[_0xbc01('0x26')]=_0x157c5d[_0x476072[_0x524472]['param']][_0xbc01('0x23')]('/')[0x2];_0x59c2af[_0xbc01('0x27')]=_0x59c2af[_0xbc01('0x26')]?_0x59c2af['phone'][_0xbc01('0x23')]('$')[0x0]:undefined;_0x59c2af[_0xbc01('0x26')]=_0x54f9cd['cutdigits']?(_0x59c2af[_0xbc01('0x27')]||'')+_0xbc01('0x15')+_0x54f9cd['cutdigits']+'}':(_0x59c2af[_0xbc01('0x27')]||'')+'${EXTEN}';_0x55b232[_0x476072[_0x524472][_0xbc01('0x25')]]=[_0xbc01('0x28'),_0x59c2af[_0xbc01('0x24')],_0x59c2af[_0xbc01('0x26')]][_0xbc01('0x29')]('/');break;case'options':_0x59c2af[_0xbc01('0x2a')]=_0x157c5d[_0x476072[_0x524472]['param']];if(_0x54f9cd['recordingFormat']!==_0xbc01('0x2b')){if(_0x59c2af[_0xbc01('0x2a')][_0xbc01('0x2c')]('U(xcally-mixmonitor-context)')<0x0){_0x59c2af[_0xbc01('0x2a')]+=_0xbc01('0x2d');}}else{_0x59c2af[_0xbc01('0x2a')]=_0x59c2af['options'][_0xbc01('0x2e')]('U(xcally-mixmonitor-context)','');}_0x55b232[_0x476072[_0x524472][_0xbc01('0x25')]]=_0x59c2af['options'];break;default:_0x55b232[_0x476072[_0x524472][_0xbc01('0x25')]]=_0x157c5d[_0x476072[_0x524472][_0xbc01('0x25')]];}}return _0x55b232['join'](',');}function _0x41f30b(_0x50491f,_0xe31ac6,_0x3117c7){return new Promise(function(_0xc355ed,_0x50d9a1){var _0x487de7=[];if(_[_0xbc01('0x2f')](_0xe31ac6))return _0xc355ed(_0x487de7);_0x2ca5aa[_0xbc01('0x30')][_0xbc01('0x31')]({'attributes':['id',_0xbc01('0x32'),_0xbc01('0x33')],'raw':!![]})[_0xbc01('0x34')](function(_0x3aabcf){for(var _0x51e282=0x0,_0x4887b2=0x0;_0x51e282<_0xe31ac6['length'];_0x51e282++,_0x4887b2=0x0){var _0x428c87=_0xe31ac6[_0x51e282];var _0x396a89=[];var _0xf0271e=[];delete _0x428c87['id'];if(_0x428c87[_0xbc01('0x32')]!==_0xbc01('0x35')){_0x428c87['intervals']=[_0x428c87[_0xbc01('0x32')]];}else{_0x428c87[_0xbc01('0x36')]=_0x428c87[_0xbc01('0x33')]?_['map'](_[_0xbc01('0x37')](_0x3aabcf,{'IntervalId':_0x428c87[_0xbc01('0x33')]}),_0xbc01('0x32')):[];}_0x428c87[_0xbc01('0x7')]=_0x50491f[_0xbc01('0x7')];_0x428c87[_0xbc01('0x8')]=_0x50491f[_0xbc01('0x8')];if(_0x428c87[_0xbc01('0x4')])_0x428c87[_0xbc01('0x4')]=_0x428c87[_0xbc01('0x4')]['toLowerCase']();if(_0x50491f['type']==='outbound'){if(_0x428c87[_0xbc01('0x1e')](_0xbc01('0x38'))&&_0x428c87[_0xbc01('0x38')]&&_0x428c87[_0xbc01('0x38')]!=='--'){_0x396a89['push']({'type':_0x428c87[_0xbc01('0x4')][_0xbc01('0x39')](),'app':_0xbc01('0x5'),'appdata':_0xbc01('0x3a')+_0x428c87[_0xbc01('0x38')],'context':_0x50491f[_0xbc01('0x7')],'exten':_0x50491f[_0xbc01('0x8')],'priority':_0x428c87[_0xbc01('0x36')][_0xbc01('0x3b')]+_0x3117c7+_0x4887b2++,'VoiceExtensionId':_0x50491f['id']});}_0x396a89['push']({'type':_0x428c87[_0xbc01('0x4')][_0xbc01('0x39')](),'app':_0xbc01('0x17'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x428c87[_0xbc01('0x3c')]?_0xbc01('0x3d')+_0x428c87[_0xbc01('0x3c')]+')':'NoOp(No\x20number\x20available)'),'context':_0x50491f[_0xbc01('0x7')],'exten':_0x50491f[_0xbc01('0x8')],'priority':_0x428c87['intervals'][_0xbc01('0x3b')]+_0x3117c7+_0x4887b2++,'VoiceExtensionId':_0x50491f['id']});}else{if(_0x428c87['hasOwnProperty'](_0xbc01('0x3e'))){if(['queue',_0xbc01('0x3f')]['includes'](_0x428c87['app'][_0xbc01('0x39')]())&&_0x428c87[_0xbc01('0x40')]!==_0xbc01('0x41')){if(_0x428c87['answer']){_0x396a89[_0xbc01('0xe')]({'type':_0x428c87[_0xbc01('0x4')][_0xbc01('0x39')](),'app':_0xbc01('0x17'),'appdata':_0xbc01('0x42'),'context':_0x50491f[_0xbc01('0x7')],'exten':_0x50491f['exten'],'priority':_0x428c87[_0xbc01('0x36')][_0xbc01('0x3b')]+_0x3117c7+_0x4887b2++,'VoiceExtensionId':_0x50491f['id']});_0x396a89['push']({'type':_0x428c87[_0xbc01('0x4')]['toLowerCase'](),'app':_0xbc01('0x5'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x50491f[_0xbc01('0x7')],'exten':_0x50491f['exten'],'priority':_0x428c87[_0xbc01('0x36')][_0xbc01('0x3b')]+_0x3117c7+_0x4887b2++,'VoiceExtensionId':_0x50491f['id']});}else{_0x396a89[_0xbc01('0xe')]({'type':_0x428c87[_0xbc01('0x4')][_0xbc01('0x39')](),'app':_0xbc01('0x17'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x50491f['context'],'exten':_0x50491f['exten'],'priority':_0x428c87[_0xbc01('0x36')][_0xbc01('0x3b')]+_0x3117c7+_0x4887b2++,'VoiceExtensionId':_0x50491f['id']});_0x396a89['push']({'type':_0x428c87[_0xbc01('0x4')]['toLowerCase'](),'app':_0xbc01('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x50491f[_0xbc01('0x7')],'exten':_0x50491f['exten'],'priority':_0x428c87[_0xbc01('0x36')][_0xbc01('0x3b')]+_0x3117c7+_0x4887b2++,'VoiceExtensionId':_0x50491f['id']});}}}}for(var _0x191d15=0x0;_0x191d15<_0x428c87[_0xbc01('0x36')][_0xbc01('0x3b')];_0x191d15++){var _0x1037ac=_0x3117c7+_0x428c87['intervals'][_0xbc01('0x3b')];var _0x15b53b=_0x191d15===_0x428c87[_0xbc01('0x36')]['length']-0x1?_0x3117c7+_0x396a89[_0xbc01('0x3b')]+_0xf0271e[_0xbc01('0x3b')]+0x2:_0x3117c7+_0x191d15+0x1;_0x396a89[_0xbc01('0x43')](_0x191d15,0x0,{'type':_0x50491f[_0xbc01('0x4')],'app':_0xbc01('0x44'),'appdata':_0x428c87[_0xbc01('0x36')][_0x191d15]+'?'+_0x50491f[_0xbc01('0x7')]+_0xbc01('0x45')+_0x1037ac+':'+_0x50491f['context']+',${EXTEN},'+_0x15b53b,'exten':_0x50491f[_0xbc01('0x8')],'context':_0x50491f[_0xbc01('0x7')],'priority':_0x3117c7+_0x191d15,'VoiceExtensionId':_0x50491f['id']});}if(_0x428c87['appType']===_0xbc01('0x46'))_0x428c87['appdata']=_0x59edb1(_0x50491f,_0x428c87[_0xbc01('0x47')]);_0x428c87['priority']=_0x396a89[_0xbc01('0x3b')]?_['last'](_0x396a89)['priority']+0x1:_0x3117c7;_0x487de7=_['concat'](_0x487de7,_0x396a89,[_0x428c87],_0xf0271e);_0x3117c7=_[_0xbc01('0x48')](_0x487de7)[_0xbc01('0x49')]+0x1;}return _0xc355ed(_0x487de7);})[_0xbc01('0x4a')](function(_0x472c04){_0x50d9a1(_0x472c04);});});}return _0x79c950[_0xbc01('0x4b')](_0xbc01('0x4c'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x421d6c){var _0x50c71a=this[_0xbc01('0x4d')]({'plain':!![]});var _0x2ae863=_0x50c71a['type']===_0xbc01('0x11')?_0xb56a44(_0x50c71a):_0x2fa563(_0x50c71a);return _0x41f30b(_0x50c71a,_0x421d6c,_[_0xbc01('0x48')](_0x2ae863)[_0xbc01('0x49')]+0x1)['then'](function(_0x215dbf){var _0x77d796=_[_0xbc01('0x4e')](_0x2ae863,_0x215dbf);_0x77d796[_0xbc01('0xe')]({'type':_0x50c71a[_0xbc01('0x4')],'app':_0xbc01('0x4f'),'exten':_0x50c71a[_0xbc01('0x8')],'context':_0x50c71a[_0xbc01('0x7')],'priority':_['last'](_0x77d796)[_0xbc01('0x49')]+0x1,'VoiceExtensionId':_0x50c71a['id']});return _0x77d796;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 119a38d..96f9b40 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 _0x1696=['map','model','GetVoiceExtension','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','VoiceExtension','findAll','options','raw','attributes','limit','include'];(function(_0x54d986,_0x519d66){var _0x231b88=function(_0x476fc4){while(--_0x476fc4){_0x54d986['push'](_0x54d986['shift']());}};_0x231b88(++_0x519d66);}(_0x1696,0x79));var _0x6169=function(_0x10a4f7,_0x23c3a4){_0x10a4f7=_0x10a4f7-0x0;var _0x102b7b=_0x1696[_0x10a4f7];return _0x102b7b;};'use strict';var _=require(_0x6169('0x0'));var util=require('util');var moment=require(_0x6169('0x1'));var BPromise=require(_0x6169('0x2'));var rs=require(_0x6169('0x3'));var fs=require('fs');var Redis=require(_0x6169('0x4'));var db=require(_0x6169('0x5'))['db'];var utils=require(_0x6169('0x6'));var logger=require(_0x6169('0x7'))(_0x6169('0x8'));var config=require(_0x6169('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6169('0xa')][_0x6169('0xb')]({'port':0x232a});config[_0x6169('0xc')]=_[_0x6169('0xd')](config[_0x6169('0xc')],{'host':_0x6169('0xe'),'port':0x18eb});var socket=require(_0x6169('0xf'))(new Redis(config['redis']));require(_0x6169('0x10'))['register'](socket);function respondWithRpcPromise(_0x1cdeb4,_0x5d46d7,_0x5b5f33){return new BPromise(function(_0x46c85b,_0x2f714f){return client[_0x6169('0x11')](_0x1cdeb4,_0x5b5f33)[_0x6169('0x12')](function(_0x58df8b){logger['info'](_0x6169('0x13'),_0x5d46d7,_0x6169('0x14'));logger['debug'](_0x6169('0x15'),_0x5d46d7,_0x6169('0x14'),JSON[_0x6169('0x16')](_0x58df8b));if(_0x58df8b['error']){if(_0x58df8b['error']['code']===0x1f4){logger[_0x6169('0x17')](_0x6169('0x13'),_0x5d46d7,_0x58df8b[_0x6169('0x17')][_0x6169('0x18')]);return _0x2f714f(_0x58df8b[_0x6169('0x17')]['message']);}logger[_0x6169('0x17')](_0x6169('0x13'),_0x5d46d7,_0x58df8b['error'][_0x6169('0x18')]);return _0x46c85b(_0x58df8b['error'][_0x6169('0x18')]);}else{logger[_0x6169('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x5d46d7,_0x6169('0x14'));_0x46c85b(_0x58df8b[_0x6169('0x1a')][_0x6169('0x18')]);}})[_0x6169('0x1b')](function(_0xff7981){logger[_0x6169('0x17')](_0x6169('0x13'),_0x5d46d7,_0xff7981);_0x2f714f(_0xff7981);});});}exports['GetVoiceExtension']=function(_0x57a6b2){var _0x74a11d=this;return new Promise(function(_0x29b77a,_0x486186){return db[_0x6169('0x1c')][_0x6169('0x1d')]({'raw':_0x57a6b2[_0x6169('0x1e')]?_0x57a6b2[_0x6169('0x1e')][_0x6169('0x1f')]===undefined?!![]:![]:!![],'where':_0x57a6b2['options']?_0x57a6b2[_0x6169('0x1e')]['where']||null:null,'attributes':_0x57a6b2[_0x6169('0x1e')]?_0x57a6b2[_0x6169('0x1e')][_0x6169('0x20')]||null:null,'limit':_0x57a6b2['options']?_0x57a6b2[_0x6169('0x1e')][_0x6169('0x21')]||null:null,'include':_0x57a6b2['options']?_0x57a6b2['options'][_0x6169('0x22')]?_[_0x6169('0x23')](_0x57a6b2[_0x6169('0x1e')][_0x6169('0x22')],function(_0x1b207e){return{'model':db[_0x1b207e[_0x6169('0x24')]],'as':_0x1b207e['as'],'attributes':_0x1b207e[_0x6169('0x20')],'include':_0x1b207e[_0x6169('0x22')]?_['map'](_0x1b207e[_0x6169('0x22')],function(_0x5ba226){return{'model':db[_0x5ba226['model']],'as':_0x5ba226['as'],'attributes':_0x5ba226['attributes'],'include':_0x5ba226['include']?_[_0x6169('0x23')](_0x5ba226['include'],function(_0x4466f3){return{'model':db[_0x4466f3[_0x6169('0x24')]],'as':_0x4466f3['as'],'attributes':_0x4466f3[_0x6169('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51e2ea){logger['info'](_0x6169('0x25'),_0x57a6b2);logger[_0x6169('0x26')]('GetVoiceExtension',_0x57a6b2,JSON['stringify'](_0x51e2ea));_0x29b77a(_0x51e2ea);})[_0x6169('0x1b')](function(_0x182502){logger['error'](_0x6169('0x25'),_0x182502[_0x6169('0x18')],_0x57a6b2);_0x486186(_0x74a11d['error'](0x1f4,_0x182502['message']));});});}; \ No newline at end of file +var _0x47a1=['findAll','options','raw','where','attributes','limit','map','include','model','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetVoiceExtension','VoiceExtension'];(function(_0x2d05cf,_0x58750d){var _0x36421a=function(_0x45e48c){while(--_0x45e48c){_0x2d05cf['push'](_0x2d05cf['shift']());}};_0x36421a(++_0x58750d);}(_0x47a1,0xbd));var _0x147a=function(_0x55b05d,_0x5a75cf){_0x55b05d=_0x55b05d-0x0;var _0x131c3a=_0x47a1[_0x55b05d];return _0x131c3a;};'use strict';var _=require(_0x147a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x147a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x147a('0x2'));var db=require(_0x147a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x147a('0x4'))(_0x147a('0x5'));var config=require(_0x147a('0x6'));var jayson=require(_0x147a('0x7'));var client=jayson[_0x147a('0x8')]['http']({'port':0x232a});config[_0x147a('0x9')]=_[_0x147a('0xa')](config[_0x147a('0x9')],{'host':_0x147a('0xb'),'port':0x18eb});var socket=require(_0x147a('0xc'))(new Redis(config[_0x147a('0x9')]));require(_0x147a('0xd'))['register'](socket);function respondWithRpcPromise(_0x30e455,_0x3e59e2,_0x5a39d1){return new BPromise(function(_0x2a2a75,_0x5a4ffb){return client[_0x147a('0xe')](_0x30e455,_0x5a39d1)[_0x147a('0xf')](function(_0x337f06){logger['info'](_0x147a('0x10'),_0x3e59e2,_0x147a('0x11'));logger[_0x147a('0x12')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x3e59e2,_0x147a('0x11'),JSON[_0x147a('0x13')](_0x337f06));if(_0x337f06[_0x147a('0x14')]){if(_0x337f06[_0x147a('0x14')][_0x147a('0x15')]===0x1f4){logger[_0x147a('0x14')](_0x147a('0x10'),_0x3e59e2,_0x337f06[_0x147a('0x14')][_0x147a('0x16')]);return _0x5a4ffb(_0x337f06['error'][_0x147a('0x16')]);}logger['error'](_0x147a('0x10'),_0x3e59e2,_0x337f06[_0x147a('0x14')][_0x147a('0x16')]);return _0x2a2a75(_0x337f06[_0x147a('0x14')][_0x147a('0x16')]);}else{logger[_0x147a('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x3e59e2,'request\x20sent');_0x2a2a75(_0x337f06['result'][_0x147a('0x16')]);}})[_0x147a('0x18')](function(_0x59d61d){logger[_0x147a('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x3e59e2,_0x59d61d);_0x5a4ffb(_0x59d61d);});});}exports[_0x147a('0x19')]=function(_0x59241){var _0x11230b=this;return new Promise(function(_0x11d87a,_0x2093cf){return db[_0x147a('0x1a')][_0x147a('0x1b')]({'raw':_0x59241[_0x147a('0x1c')]?_0x59241[_0x147a('0x1c')][_0x147a('0x1d')]===undefined?!![]:![]:!![],'where':_0x59241[_0x147a('0x1c')]?_0x59241['options'][_0x147a('0x1e')]||null:null,'attributes':_0x59241[_0x147a('0x1c')]?_0x59241[_0x147a('0x1c')][_0x147a('0x1f')]||null:null,'limit':_0x59241[_0x147a('0x1c')]?_0x59241[_0x147a('0x1c')][_0x147a('0x20')]||null:null,'include':_0x59241['options']?_0x59241['options']['include']?_[_0x147a('0x21')](_0x59241['options'][_0x147a('0x22')],function(_0x57f5f0){return{'model':db[_0x57f5f0[_0x147a('0x23')]],'as':_0x57f5f0['as'],'attributes':_0x57f5f0[_0x147a('0x1f')],'include':_0x57f5f0[_0x147a('0x22')]?_['map'](_0x57f5f0['include'],function(_0x30c5e0){return{'model':db[_0x30c5e0[_0x147a('0x23')]],'as':_0x30c5e0['as'],'attributes':_0x30c5e0[_0x147a('0x1f')],'include':_0x30c5e0[_0x147a('0x22')]?_[_0x147a('0x21')](_0x30c5e0[_0x147a('0x22')],function(_0x38fb06){return{'model':db[_0x38fb06[_0x147a('0x23')]],'as':_0x38fb06['as'],'attributes':_0x38fb06['attributes']};}):[]};}):[]};}):[]:[]})[_0x147a('0xf')](function(_0x2d161d){logger[_0x147a('0x17')](_0x147a('0x19'),_0x59241);logger['debug']('GetVoiceExtension',_0x59241,JSON['stringify'](_0x2d161d));_0x11d87a(_0x2d161d);})[_0x147a('0x18')](function(_0x2f5bc7){logger['error'](_0x147a('0x19'),_0x2f5bc7[_0x147a('0x16')],_0x59241);_0x2093cf(_0x11230b[_0x147a('0x14')](0x1f4,_0x2f5bc7[_0x147a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 5becce1..7a6f7b3 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 _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x47b03c,_0x373356){var _0x490014=function(_0x4c1354){while(--_0x4c1354){_0x47b03c['push'](_0x47b03c['shift']());}};_0x490014(++_0x373356);}(_0x4975,0x86));var _0x5497=function(_0x59d14b,_0x2c5c15){_0x59d14b=_0x59d14b-0x0;var _0x580b9d=_0x4975[_0x59d14b];return _0x580b9d;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file +var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x587845,_0x3115b9){var _0x1c2292=function(_0x174e88){while(--_0x174e88){_0x587845['push'](_0x587845['shift']());}};_0x1c2292(++_0x3115b9);}(_0xe14b,0x93));var _0xbe14=function(_0x1c161d,_0x229fad){_0x1c161d=_0x1c161d-0x0;var _0x2c8852=_0xe14b[_0x1c161d];return _0x2c8852;};'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 890c734..120cf31 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 _0xa456=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','post','create','put','delete','multer'];(function(_0x40b898,_0x2fd575){var _0x2ff0bb=function(_0x5a37ae){while(--_0x5a37ae){_0x40b898['push'](_0x40b898['shift']());}};_0x2ff0bb(++_0x2fd575);}(_0xa456,0x142));var _0x6a45=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xa456[_0x2aea9e];return _0x430b92;};'use strict';var multer=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var path=require(_0x6a45('0x2'));var timeout=require(_0x6a45('0x3'));var express=require('express');var router=express[_0x6a45('0x4')]();var fs_extra=require(_0x6a45('0x5'));var auth=require(_0x6a45('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6a45('0x7'));var controller=require(_0x6a45('0x8'));router[_0x6a45('0x9')]('/',auth[_0x6a45('0xa')](),controller['index']);router[_0x6a45('0x9')](_0x6a45('0xb'),auth[_0x6a45('0xa')](),controller[_0x6a45('0xc')]);router[_0x6a45('0x9')]('/:id/messages',auth[_0x6a45('0xa')](),controller['getMessages']);router[_0x6a45('0xd')]('/',auth[_0x6a45('0xa')](),controller[_0x6a45('0xe')]);router[_0x6a45('0xf')](_0x6a45('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x6a45('0x10')](_0x6a45('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x687b=['../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x157084,_0x4b431c){var _0x1714a1=function(_0x2e55b0){while(--_0x2e55b0){_0x157084['push'](_0x157084['shift']());}};_0x1714a1(++_0x4b431c);}(_0x687b,0x14a));var _0xb687=function(_0x2709bd,_0x274e31){_0x2709bd=_0x2709bd-0x0;var _0x4b5d5c=_0x687b[_0x2709bd];return _0x4b5d5c;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb687('0x4'));var auth=require(_0xb687('0x5'));var interaction=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var controller=require(_0xb687('0x8'));router[_0xb687('0x9')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0xb')]);router[_0xb687('0x9')](_0xb687('0xc'),auth['isAuthenticated'](),controller[_0xb687('0xd')]);router[_0xb687('0x9')]('/:id/messages',auth[_0xb687('0xa')](),controller[_0xb687('0xe')]);router[_0xb687('0xf')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0x10')]);router[_0xb687('0x11')](_0xb687('0xc'),auth[_0xb687('0xa')](),controller[_0xb687('0x12')]);router['delete'](_0xb687('0xc'),auth[_0xb687('0xa')](),controller[_0xb687('0x13')]);module[_0xb687('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 620f603..7a9db67 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 _0x4346=['trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4346,0x6b));var _0x6434=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x4346[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x6434('0x0'));module[_0x6434('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6434('0x2')],'defaultValue':_0x6434('0x3'),'unique':_0x6434('0x4')},'mailbox':{'type':Sequelize[_0x6434('0x2')],'defaultValue':'','allowNull':![],'unique':_0x6434('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x6434('0x2')]},'email':{'type':Sequelize[_0x6434('0x2')],'validate':{'isEmail':!![]},'set':function(_0x3300e9){this[_0x6434('0x5')](_0x6434('0x6'),typeof _0x3300e9==='string'&&_0x3300e9[_0x6434('0x7')]()?_0x3300e9[_0x6434('0x7')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x6434('0x2')],'defaultValue':_0x6434('0x8')},'attach':{'type':Sequelize[_0x6434('0x9')](_0x6434('0xa'),'no'),'defaultValue':_0x6434('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x6434('0x9')](_0x6434('0xa'),'no'),'defaultValue':_0x6434('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x6434('0x2')]},'review':{'type':Sequelize['ENUM'](_0x6434('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x6434('0x9')](_0x6434('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x6434('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x6434('0x9')](_0x6434('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x6434('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x6434('0x9')](_0x6434('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x6434('0x9')](_0x6434('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x6434('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x6434('0x9')](_0x6434('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x6434('0x9')](_0x6434('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x6434('0x9')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x6434('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x6434('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x6434('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x6434('0xe')],'get':function(){return this[_0x6434('0xf')](_0x6434('0x10'))+_0x6434('0x11')+this[_0x6434('0xf')](_0x6434('0x12'));}}}; \ No newline at end of file +var _0x8099=['yes','TINYINT(4)','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','email','string','central','ENUM'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x8099,0x1d4));var _0x9809=function(_0x38b6f5,_0x25de4c){_0x38b6f5=_0x38b6f5-0x0;var _0x78c7f9=_0x8099[_0x38b6f5];return _0x78c7f9;};'use strict';var Sequelize=require('sequelize');module[_0x9809('0x0')]={'customer_id':{'type':Sequelize[_0x9809('0x1')]},'context':{'type':Sequelize[_0x9809('0x1')],'defaultValue':_0x9809('0x2'),'unique':_0x9809('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x9809('0x3')},'password':{'type':Sequelize[_0x9809('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9809('0x1')],'validate':{'isEmail':!![]},'set':function(_0x518013){this['setDataValue'](_0x9809('0x4'),typeof _0x518013===_0x9809('0x5')&&_0x518013['trim']()?_0x518013['trim']():null);}},'pager':{'type':Sequelize[_0x9809('0x1')]},'tz':{'type':Sequelize[_0x9809('0x1')],'defaultValue':_0x9809('0x6')},'attach':{'type':Sequelize[_0x9809('0x7')](_0x9809('0x8'),'no'),'defaultValue':_0x9809('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x9809('0x7')](_0x9809('0x8'),'no'),'defaultValue':_0x9809('0x8'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x9809('0x1')]},'review':{'type':Sequelize[_0x9809('0x7')](_0x9809('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x9809('0x7')](_0x9809('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x9809('0x7')](_0x9809('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x9809('0x7')](_0x9809('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x9809('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x9809('0x7')](_0x9809('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x9809('0x7')](_0x9809('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x9809('0x7')](_0x9809('0x8'),'no'),'defaultValue':_0x9809('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x9809('0x7')](_0x9809('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x9809('0x7')](_0x9809('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x9809('0x7')](_0x9809('0x8'),'no'),'defaultValue':_0x9809('0x8'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x9809('0x1')]},'emailbody':{'type':Sequelize[_0x9809('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9809('0xa')](_0x9809('0xb'))+_0x9809('0xc')+this[_0x9809('0xa')](_0x9809('0xd'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 195ddb0..1e095da 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 _0xe605=['count','set','Content-Range','apply','save','update','then','destroy','Voicemails','UserProfileResource','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','VoiceMail','findAll','rows','show','params','intersection','find','catch','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','hasOwnProperty','mailbox','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x5b2a7c,_0xa75601){var _0x4d7661=function(_0x10be25){while(--_0x10be25){_0x5b2a7c['push'](_0x5b2a7c['shift']());}};_0x4d7661(++_0xa75601);}(_0xe605,0x92));var _0x5e60=function(_0x1117b1,_0x1d3488){_0x1117b1=_0x1117b1-0x0;var _0x122eed=_0xe605[_0x1117b1];return _0x122eed;};'use strict';var emlformat=require(_0x5e60('0x0'));var rimraf=require(_0x5e60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e60('0x2'));var rp=require(_0x5e60('0x3'));var moment=require(_0x5e60('0x4'));var BPromise=require(_0x5e60('0x5'));var Mustache=require(_0x5e60('0x6'));var util=require(_0x5e60('0x7'));var path=require(_0x5e60('0x8'));var sox=require(_0x5e60('0x9'));var csv=require(_0x5e60('0xa'));var ejs=require(_0x5e60('0xb'));var fs=require('fs');var fs_extra=require(_0x5e60('0xc'));var _=require(_0x5e60('0xd'));var squel=require('squel');var crypto=require(_0x5e60('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e60('0xf'));var Papa=require(_0x5e60('0x10'));var Redis=require(_0x5e60('0x11'));var authService=require(_0x5e60('0x12'));var qs=require(_0x5e60('0x13'));var as=require(_0x5e60('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e60('0x15'))('api');var utils=require(_0x5e60('0x16'));var config=require(_0x5e60('0x17'));var licenseUtil=require(_0x5e60('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371df7,_0x178782){_0x178782=_0x178782||0xcc;return function(_0x1f4e14){if(_0x1f4e14){return _0x371df7[_0x5e60('0x19')](_0x178782);}return _0x371df7[_0x5e60('0x1a')](_0x178782)[_0x5e60('0x1b')]();};}function respondWithResult(_0x4fd10e,_0x209adb){_0x209adb=_0x209adb||0xc8;return function(_0x45304f){if(_0x45304f){return _0x4fd10e[_0x5e60('0x1a')](_0x209adb)[_0x5e60('0x1c')](_0x45304f);}};}function respondWithFilteredResult(_0x5b028f,_0x20af5f){return function(_0x529ffe){if(_0x529ffe){var _0x1ffd77=typeof _0x20af5f[_0x5e60('0x1d')]==='undefined'&&typeof _0x20af5f[_0x5e60('0x1e')]===_0x5e60('0x1f');var _0xaa7d05=_0x529ffe[_0x5e60('0x20')];var _0x5c485d=_0x1ffd77?0x0:_0x20af5f[_0x5e60('0x1d')];var _0x22d718=_0x1ffd77?_0x529ffe['count']:_0x20af5f[_0x5e60('0x1d')]+_0x20af5f[_0x5e60('0x1e')];var _0x17c630;if(_0x22d718>=_0xaa7d05){_0x22d718=_0xaa7d05;_0x17c630=0xc8;}else{_0x17c630=0xce;}_0x5b028f[_0x5e60('0x1a')](_0x17c630);return _0x5b028f[_0x5e60('0x21')](_0x5e60('0x22'),_0x5c485d+'-'+_0x22d718+'/'+_0xaa7d05)[_0x5e60('0x1c')](_0x529ffe);}return null;};}function patchUpdates(_0x524c93){return function(_0x3282e4){try{jsonpatch[_0x5e60('0x23')](_0x3282e4,_0x524c93,!![]);}catch(_0x228f13){return BPromise['reject'](_0x228f13);}return _0x3282e4[_0x5e60('0x24')]();};}function saveUpdates(_0x5d77dd,_0x376069){return function(_0x1a44e5){if(_0x1a44e5){return _0x1a44e5[_0x5e60('0x25')](_0x5d77dd)[_0x5e60('0x26')](function(_0x34e98d){return _0x34e98d;});}return null;};}function removeEntity(_0x2a499e,_0x2636f1){return function(_0x5d2c03){if(_0x5d2c03){return _0x5d2c03[_0x5e60('0x27')]()[_0x5e60('0x26')](function(){var _0x19f37b=_0x5d2c03['get']({'plain':!![]});var _0x45cb62=_0x5e60('0x28');return db[_0x5e60('0x29')][_0x5e60('0x27')]({'where':{'type':_0x45cb62,'resourceId':_0x19f37b['id']}})['then'](function(){return _0x5d2c03;});})[_0x5e60('0x26')](function(){_0x2a499e['status'](0xcc)[_0x5e60('0x1b')]();});}};}function handleEntityNotFound(_0x221322,_0x4ba727){return function(_0x46691f){if(!_0x46691f){_0x221322[_0x5e60('0x19')](0x194);}return _0x46691f;};}function handleError(_0x5b1b46,_0x1ee931){_0x1ee931=_0x1ee931||0x1f4;return function(_0xac9c7a){logger['error'](_0xac9c7a['stack']);if(_0xac9c7a['name']){delete _0xac9c7a[_0x5e60('0x2a')];}_0x5b1b46[_0x5e60('0x1a')](_0x1ee931)[_0x5e60('0x2b')](_0xac9c7a);};}exports[_0x5e60('0x2c')]=function(_0x3ccfee,_0x558197){var _0x168ce6={},_0x405461={},_0x4d4b55={'count':0x0,'rows':[]};var _0x11fc87=_['map'](db['VoiceMail'][_0x5e60('0x2d')],function(_0x3c4340){return{'name':_0x3c4340[_0x5e60('0x2e')],'type':_0x3c4340[_0x5e60('0x2f')][_0x5e60('0x30')]};});_0x405461[_0x5e60('0x31')]=_[_0x5e60('0x32')](_0x11fc87,_0x5e60('0x2a'));_0x405461[_0x5e60('0x33')]=_[_0x5e60('0x34')](_0x3ccfee['query']);_0x405461[_0x5e60('0x35')]=_['intersection'](_0x405461['model'],_0x405461[_0x5e60('0x33')]);_0x168ce6[_0x5e60('0x36')]=_['intersection'](_0x405461[_0x5e60('0x31')],qs['fields'](_0x3ccfee[_0x5e60('0x33')][_0x5e60('0x37')]));_0x168ce6[_0x5e60('0x36')]=_0x168ce6[_0x5e60('0x36')][_0x5e60('0x38')]?_0x168ce6[_0x5e60('0x36')]:_0x405461[_0x5e60('0x31')];if(!_0x3ccfee[_0x5e60('0x33')]['hasOwnProperty'](_0x5e60('0x39'))){_0x168ce6[_0x5e60('0x1e')]=qs[_0x5e60('0x1e')](_0x3ccfee[_0x5e60('0x33')][_0x5e60('0x1e')]);_0x168ce6[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0x3ccfee['query'][_0x5e60('0x1d')]);}_0x168ce6[_0x5e60('0x3a')]=qs['sort'](_0x3ccfee['query'][_0x5e60('0x3b')]);_0x168ce6[_0x5e60('0x3c')]=qs[_0x5e60('0x35')](_[_0x5e60('0x3d')](_0x3ccfee[_0x5e60('0x33')],_0x405461['filters']),_0x11fc87);if(_0x3ccfee[_0x5e60('0x33')][_0x5e60('0x3e')]){_0x168ce6[_0x5e60('0x3c')]=_[_0x5e60('0x3f')](_0x168ce6[_0x5e60('0x3c')],{'$or':_[_0x5e60('0x32')](_0x11fc87,function(_0x2b635a){if(_0x2b635a['type']!==_0x5e60('0x40')){var _0x1f95b2={};_0x1f95b2[_0x2b635a['name']]={'$like':'%'+_0x3ccfee['query']['filter']+'%'};return _0x1f95b2;}})});}_0x168ce6=_[_0x5e60('0x3f')]({},_0x168ce6,_0x3ccfee[_0x5e60('0x41')]);var _0x2c6d5b={'where':_0x168ce6[_0x5e60('0x3c')]};return db['VoiceMail'][_0x5e60('0x20')](_0x2c6d5b)[_0x5e60('0x26')](function(_0x4b6192){_0x4d4b55['count']=_0x4b6192;if(_0x3ccfee[_0x5e60('0x33')][_0x5e60('0x42')]){_0x168ce6[_0x5e60('0x43')]=[{'all':!![]}];}return db[_0x5e60('0x44')][_0x5e60('0x45')](_0x168ce6);})[_0x5e60('0x26')](function(_0x2522d2){_0x4d4b55[_0x5e60('0x46')]=_0x2522d2;return _0x4d4b55;})[_0x5e60('0x26')](respondWithFilteredResult(_0x558197,_0x168ce6))['catch'](handleError(_0x558197,null));};exports[_0x5e60('0x47')]=function(_0x2bb154,_0x59a2eb){var _0x1b1567={'raw':!![],'where':{'id':_0x2bb154[_0x5e60('0x48')]['id']}},_0x4aac07={};_0x4aac07[_0x5e60('0x31')]=_[_0x5e60('0x34')](db['VoiceMail'][_0x5e60('0x2d')]);_0x4aac07[_0x5e60('0x33')]=_[_0x5e60('0x34')](_0x2bb154[_0x5e60('0x33')]);_0x4aac07['filters']=_['intersection'](_0x4aac07['model'],_0x4aac07[_0x5e60('0x33')]);_0x1b1567[_0x5e60('0x36')]=_[_0x5e60('0x49')](_0x4aac07[_0x5e60('0x31')],qs[_0x5e60('0x37')](_0x2bb154[_0x5e60('0x33')]['fields']));_0x1b1567[_0x5e60('0x36')]=_0x1b1567[_0x5e60('0x36')][_0x5e60('0x38')]?_0x1b1567[_0x5e60('0x36')]:_0x4aac07[_0x5e60('0x31')];if(_0x2bb154[_0x5e60('0x33')][_0x5e60('0x42')]){_0x1b1567['include']=[{'all':!![]}];}_0x1b1567=_[_0x5e60('0x3f')]({},_0x1b1567,_0x2bb154[_0x5e60('0x41')]);return db[_0x5e60('0x44')][_0x5e60('0x4a')](_0x1b1567)[_0x5e60('0x26')](handleEntityNotFound(_0x59a2eb,null))[_0x5e60('0x26')](respondWithResult(_0x59a2eb,null))[_0x5e60('0x4b')](handleError(_0x59a2eb,null));};exports[_0x5e60('0x4c')]=function(_0x1518bd,_0x350d6d){return db[_0x5e60('0x44')][_0x5e60('0x4c')](_0x1518bd[_0x5e60('0x4d')],{})[_0x5e60('0x26')](function(_0x1aa381){var _0x176ef3=_0x1518bd[_0x5e60('0x4e')][_0x5e60('0x4f')]({'plain':!![]});if(!_0x176ef3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x176ef3['role']===_0x5e60('0x4e')){var _0x4d3588=_0x1aa381[_0x5e60('0x4f')]({'plain':!![]});var _0x1d247e=_0x5e60('0x28');return db[_0x5e60('0x50')][_0x5e60('0x4a')]({'where':{'name':_0x1d247e,'userProfileId':_0x176ef3[_0x5e60('0x51')]},'raw':!![]})['then'](function(_0x48bea6){if(_0x48bea6&&_0x48bea6[_0x5e60('0x52')]===0x0){return db[_0x5e60('0x29')][_0x5e60('0x4c')]({'name':_0x4d3588['name'],'resourceId':_0x4d3588['id'],'type':_0x48bea6['name'],'sectionId':_0x48bea6['id']},{})[_0x5e60('0x26')](function(){return _0x1aa381;});}else{return _0x1aa381;}})[_0x5e60('0x4b')](function(_0x179cc6){logger['error'](_0x5e60('0x53'),_0x179cc6);throw _0x179cc6;});}return _0x1aa381;})[_0x5e60('0x26')](respondWithResult(_0x350d6d,0xc9))[_0x5e60('0x4b')](handleError(_0x350d6d,null));};exports[_0x5e60('0x25')]=function(_0x17d002,_0x148204){if(_0x17d002['body']['id']){delete _0x17d002[_0x5e60('0x4d')]['id'];}return db[_0x5e60('0x44')]['find']({'where':{'id':_0x17d002[_0x5e60('0x48')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x148204,null))[_0x5e60('0x26')](saveUpdates(_0x17d002['body'],null))[_0x5e60('0x26')](respondWithResult(_0x148204,null))[_0x5e60('0x4b')](handleError(_0x148204,null));};exports['destroy']=function(_0x26e129,_0x367208){return db[_0x5e60('0x44')][_0x5e60('0x4a')]({'where':{'id':_0x26e129['params']['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x367208,null))[_0x5e60('0x26')](removeEntity(_0x367208,null))['catch'](handleError(_0x367208,null));};exports[_0x5e60('0x54')]=function(_0x4cb322,_0x8d00b9,_0x5220fc){return db[_0x5e60('0x44')][_0x5e60('0x55')]({'where':{'id':_0x4cb322['params']['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x8d00b9,null))['then'](function(_0x1a2094){var _0x566fc7;var _0x157787={},_0x5b4daa={};_0x5b4daa[_0x5e60('0x31')]=_[_0x5e60('0x34')](db[_0x5e60('0x56')][_0x5e60('0x2d')]);_0x5b4daa[_0x5e60('0x33')]=_[_0x5e60('0x34')](_0x4cb322[_0x5e60('0x33')]);_0x5b4daa['filters']=_[_0x5e60('0x49')](_0x5b4daa[_0x5e60('0x31')],_0x5b4daa[_0x5e60('0x33')]);_0x157787[_0x5e60('0x36')]=_[_0x5e60('0x49')](_0x5b4daa[_0x5e60('0x31')],qs['fields'](_0x4cb322['query']['fields']));_0x157787[_0x5e60('0x36')]=_0x157787[_0x5e60('0x36')]['length']?_0x157787[_0x5e60('0x36')]:_0x5b4daa[_0x5e60('0x31')];if(!_0x4cb322['query'][_0x5e60('0x57')](_0x5e60('0x39'))){_0x157787[_0x5e60('0x1e')]=qs[_0x5e60('0x1e')](_0x4cb322[_0x5e60('0x33')][_0x5e60('0x1e')]);_0x157787[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0x4cb322[_0x5e60('0x33')][_0x5e60('0x1d')]);}_0x157787[_0x5e60('0x3a')]=qs[_0x5e60('0x3b')](_0x4cb322[_0x5e60('0x33')][_0x5e60('0x3b')]);_0x157787[_0x5e60('0x3c')]=qs[_0x5e60('0x35')](_[_0x5e60('0x3d')](_0x4cb322['query'],_0x5b4daa[_0x5e60('0x35')]));if(_0x4cb322[_0x5e60('0x33')][_0x5e60('0x3e')]){_0x157787['where']=_[_0x5e60('0x3f')](_0x157787[_0x5e60('0x3c')],{'$or':_['map'](_0x157787[_0x5e60('0x36')],function(_0x6f4d2f){var _0x5bbaaf={};_0x5bbaaf[_0x6f4d2f]={'$like':'%'+_0x4cb322[_0x5e60('0x33')][_0x5e60('0x3e')]+'%'};return _0x5bbaaf;})});}_0x157787[_0x5e60('0x3c')]=_[_0x5e60('0x3f')](_0x157787[_0x5e60('0x3c')],{'mailboxuser':_0x1a2094[_0x5e60('0x58')]});_0x157787=_[_0x5e60('0x3f')]({},_0x157787,_0x4cb322[_0x5e60('0x41')]);return db[_0x5e60('0x56')]['findAndCountAll'](_0x157787)[_0x5e60('0x26')](respondWithFilteredResult(_0x8d00b9,_0x157787));})[_0x5e60('0x4b')](handleError(_0x8d00b9,null));}; \ No newline at end of file +var _0xe5b5=['stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','filter','where','merge','options','VoiceMail','includeAll','include','findAll','catch','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','getMessages','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x3a21c0,_0x348451){_0x3a21c0=_0x3a21c0-0x0;var _0x411e84=_0xe5b5[_0x3a21c0];return _0x411e84;};'use strict';var emlformat=require(_0x5e5b('0x0'));var rimraf=require(_0x5e5b('0x1'));var zipdir=require(_0x5e5b('0x2'));var jsonpatch=require(_0x5e5b('0x3'));var rp=require(_0x5e5b('0x4'));var moment=require(_0x5e5b('0x5'));var BPromise=require(_0x5e5b('0x6'));var Mustache=require(_0x5e5b('0x7'));var util=require(_0x5e5b('0x8'));var path=require(_0x5e5b('0x9'));var sox=require(_0x5e5b('0xa'));var csv=require(_0x5e5b('0xb'));var ejs=require(_0x5e5b('0xc'));var fs=require('fs');var fs_extra=require(_0x5e5b('0xd'));var _=require(_0x5e5b('0xe'));var squel=require(_0x5e5b('0xf'));var crypto=require(_0x5e5b('0x10'));var jsforce=require(_0x5e5b('0x11'));var deskjs=require(_0x5e5b('0x12'));var toCsv=require(_0x5e5b('0xb'));var querystring=require(_0x5e5b('0x13'));var Papa=require(_0x5e5b('0x14'));var Redis=require(_0x5e5b('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x5e5b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e5b('0x17'));var logger=require(_0x5e5b('0x18'))(_0x5e5b('0x19'));var utils=require(_0x5e5b('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x310f71,_0x18434e){_0x18434e=_0x18434e||0xcc;return function(_0x4559a0){if(_0x4559a0){return _0x310f71[_0x5e5b('0x1b')](_0x18434e);}return _0x310f71[_0x5e5b('0x1c')](_0x18434e)[_0x5e5b('0x1d')]();};}function respondWithResult(_0x2e331d,_0x49edd0){_0x49edd0=_0x49edd0||0xc8;return function(_0x2b37fa){if(_0x2b37fa){return _0x2e331d[_0x5e5b('0x1c')](_0x49edd0)['json'](_0x2b37fa);}};}function respondWithFilteredResult(_0x227417,_0x578c14){return function(_0x4e9509){if(_0x4e9509){var _0x13a1cb=typeof _0x578c14[_0x5e5b('0x1e')]===_0x5e5b('0x1f')&&typeof _0x578c14['limit']===_0x5e5b('0x1f');var _0x4d490c=_0x4e9509[_0x5e5b('0x20')];var _0x45a091=_0x13a1cb?0x0:_0x578c14['offset'];var _0xe5aa6b=_0x13a1cb?_0x4e9509[_0x5e5b('0x20')]:_0x578c14[_0x5e5b('0x1e')]+_0x578c14['limit'];var _0x2bf0b7;if(_0xe5aa6b>=_0x4d490c){_0xe5aa6b=_0x4d490c;_0x2bf0b7=0xc8;}else{_0x2bf0b7=0xce;}_0x227417[_0x5e5b('0x1c')](_0x2bf0b7);return _0x227417['set'](_0x5e5b('0x21'),_0x45a091+'-'+_0xe5aa6b+'/'+_0x4d490c)[_0x5e5b('0x22')](_0x4e9509);}return null;};}function patchUpdates(_0x3c488e){return function(_0x2d8252){try{jsonpatch[_0x5e5b('0x23')](_0x2d8252,_0x3c488e,!![]);}catch(_0x33d61b){return BPromise[_0x5e5b('0x24')](_0x33d61b);}return _0x2d8252[_0x5e5b('0x25')]();};}function saveUpdates(_0x4a78e3,_0x512e46){return function(_0x256a00){if(_0x256a00){return _0x256a00[_0x5e5b('0x26')](_0x4a78e3)[_0x5e5b('0x27')](function(_0xe1c268){return _0xe1c268;});}return null;};}function removeEntity(_0x2e38ed,_0x28cd95){return function(_0x135c6c){if(_0x135c6c){return _0x135c6c[_0x5e5b('0x28')]()[_0x5e5b('0x27')](function(){var _0x26bc02=_0x135c6c[_0x5e5b('0x29')]({'plain':!![]});var _0x4da321=_0x5e5b('0x2a');return db[_0x5e5b('0x2b')][_0x5e5b('0x28')]({'where':{'type':_0x4da321,'resourceId':_0x26bc02['id']}})['then'](function(){return _0x135c6c;});})[_0x5e5b('0x27')](function(){_0x2e38ed[_0x5e5b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13ff91,_0x21c74b){return function(_0x39ce16){if(!_0x39ce16){_0x13ff91[_0x5e5b('0x1b')](0x194);}return _0x39ce16;};}function handleError(_0x31af09,_0x250fbd){_0x250fbd=_0x250fbd||0x1f4;return function(_0x2cb695){logger[_0x5e5b('0x2c')](_0x2cb695[_0x5e5b('0x2d')]);if(_0x2cb695[_0x5e5b('0x2e')]){delete _0x2cb695[_0x5e5b('0x2e')];}_0x31af09[_0x5e5b('0x1c')](_0x250fbd)['send'](_0x2cb695);};}exports['index']=function(_0x365f6f,_0x289f54){var _0xb68419={},_0x3dcdab={},_0x12f1ee={'count':0x0,'rows':[]};var _0x4b9be8=_[_0x5e5b('0x2f')](db['VoiceMail'][_0x5e5b('0x30')],function(_0x384d8f){return{'name':_0x384d8f[_0x5e5b('0x31')],'type':_0x384d8f[_0x5e5b('0x32')]['key']};});_0x3dcdab[_0x5e5b('0x33')]=_[_0x5e5b('0x2f')](_0x4b9be8,'name');_0x3dcdab[_0x5e5b('0x34')]=_[_0x5e5b('0x35')](_0x365f6f[_0x5e5b('0x34')]);_0x3dcdab[_0x5e5b('0x36')]=_[_0x5e5b('0x37')](_0x3dcdab[_0x5e5b('0x33')],_0x3dcdab[_0x5e5b('0x34')]);_0xb68419[_0x5e5b('0x38')]=_['intersection'](_0x3dcdab[_0x5e5b('0x33')],qs[_0x5e5b('0x39')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x39')]));_0xb68419[_0x5e5b('0x38')]=_0xb68419[_0x5e5b('0x38')]['length']?_0xb68419['attributes']:_0x3dcdab[_0x5e5b('0x33')];if(!_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3a')]('nolimit')){_0xb68419[_0x5e5b('0x3b')]=qs[_0x5e5b('0x3b')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3b')]);_0xb68419['offset']=qs[_0x5e5b('0x1e')](_0x365f6f[_0x5e5b('0x34')]['offset']);}_0xb68419['order']=qs[_0x5e5b('0x3c')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3c')]);_0xb68419['where']=qs[_0x5e5b('0x36')](_['pick'](_0x365f6f['query'],_0x3dcdab[_0x5e5b('0x36')]),_0x4b9be8);if(_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3d')]){_0xb68419[_0x5e5b('0x3e')]=_[_0x5e5b('0x3f')](_0xb68419[_0x5e5b('0x3e')],{'$or':_[_0x5e5b('0x2f')](_0x4b9be8,function(_0x14ac35){if(_0x14ac35[_0x5e5b('0x32')]!=='VIRTUAL'){var _0x1f1907={};_0x1f1907[_0x14ac35[_0x5e5b('0x2e')]]={'$like':'%'+_0x365f6f['query'][_0x5e5b('0x3d')]+'%'};return _0x1f1907;}})});}_0xb68419=_['merge']({},_0xb68419,_0x365f6f[_0x5e5b('0x40')]);var _0x14b152={'where':_0xb68419[_0x5e5b('0x3e')]};return db[_0x5e5b('0x41')][_0x5e5b('0x20')](_0x14b152)[_0x5e5b('0x27')](function(_0x371550){_0x12f1ee[_0x5e5b('0x20')]=_0x371550;if(_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x42')]){_0xb68419[_0x5e5b('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x5e5b('0x44')](_0xb68419);})[_0x5e5b('0x27')](function(_0x46fec9){_0x12f1ee['rows']=_0x46fec9;return _0x12f1ee;})[_0x5e5b('0x27')](respondWithFilteredResult(_0x289f54,_0xb68419))[_0x5e5b('0x45')](handleError(_0x289f54,null));};exports['show']=function(_0x6672d9,_0x44b7be){var _0x5d3135={'raw':!![],'where':{'id':_0x6672d9['params']['id']}},_0x257bb7={};_0x257bb7['model']=_['keys'](db[_0x5e5b('0x41')]['rawAttributes']);_0x257bb7[_0x5e5b('0x34')]=_['keys'](_0x6672d9[_0x5e5b('0x34')]);_0x257bb7[_0x5e5b('0x36')]=_[_0x5e5b('0x37')](_0x257bb7[_0x5e5b('0x33')],_0x257bb7[_0x5e5b('0x34')]);_0x5d3135[_0x5e5b('0x38')]=_[_0x5e5b('0x37')](_0x257bb7['model'],qs['fields'](_0x6672d9[_0x5e5b('0x34')]['fields']));_0x5d3135['attributes']=_0x5d3135['attributes'][_0x5e5b('0x46')]?_0x5d3135['attributes']:_0x257bb7[_0x5e5b('0x33')];if(_0x6672d9[_0x5e5b('0x34')][_0x5e5b('0x42')]){_0x5d3135[_0x5e5b('0x43')]=[{'all':!![]}];}_0x5d3135=_[_0x5e5b('0x3f')]({},_0x5d3135,_0x6672d9[_0x5e5b('0x40')]);return db['VoiceMail'][_0x5e5b('0x47')](_0x5d3135)[_0x5e5b('0x27')](handleEntityNotFound(_0x44b7be,null))['then'](respondWithResult(_0x44b7be,null))[_0x5e5b('0x45')](handleError(_0x44b7be,null));};exports['create']=function(_0x41e4b3,_0x36d8fa){return db[_0x5e5b('0x41')][_0x5e5b('0x48')](_0x41e4b3['body'],{})[_0x5e5b('0x27')](function(_0x1c4efe){var _0x4f4ea3=_0x41e4b3[_0x5e5b('0x49')][_0x5e5b('0x29')]({'plain':!![]});if(!_0x4f4ea3)throw new Error(_0x5e5b('0x4a'));if(_0x4f4ea3[_0x5e5b('0x4b')]===_0x5e5b('0x49')){var _0x5ae8d0=_0x1c4efe['get']({'plain':!![]});var _0x690f8c=_0x5e5b('0x2a');return db['UserProfileSection'][_0x5e5b('0x47')]({'where':{'name':_0x690f8c,'userProfileId':_0x4f4ea3[_0x5e5b('0x4c')]},'raw':!![]})[_0x5e5b('0x27')](function(_0x5a9eae){if(_0x5a9eae&&_0x5a9eae[_0x5e5b('0x4d')]===0x0){return db[_0x5e5b('0x2b')][_0x5e5b('0x48')]({'name':_0x5ae8d0['name'],'resourceId':_0x5ae8d0['id'],'type':_0x5a9eae[_0x5e5b('0x2e')],'sectionId':_0x5a9eae['id']},{})[_0x5e5b('0x27')](function(){return _0x1c4efe;});}else{return _0x1c4efe;}})[_0x5e5b('0x45')](function(_0x4a4e0f){logger['error'](_0x5e5b('0x4e'),_0x4a4e0f);throw _0x4a4e0f;});}return _0x1c4efe;})['then'](respondWithResult(_0x36d8fa,0xc9))['catch'](handleError(_0x36d8fa,null));};exports[_0x5e5b('0x26')]=function(_0x13eee9,_0x4774ee){if(_0x13eee9['body']['id']){delete _0x13eee9[_0x5e5b('0x4f')]['id'];}return db[_0x5e5b('0x41')][_0x5e5b('0x47')]({'where':{'id':_0x13eee9[_0x5e5b('0x50')]['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x4774ee,null))[_0x5e5b('0x27')](saveUpdates(_0x13eee9['body'],null))['then'](respondWithResult(_0x4774ee,null))[_0x5e5b('0x45')](handleError(_0x4774ee,null));};exports[_0x5e5b('0x28')]=function(_0x1cc741,_0x357e55){return db['VoiceMail'][_0x5e5b('0x47')]({'where':{'id':_0x1cc741['params']['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x357e55,null))[_0x5e5b('0x27')](removeEntity(_0x357e55,null))[_0x5e5b('0x45')](handleError(_0x357e55,null));};exports[_0x5e5b('0x51')]=function(_0x2d17b0,_0x30b010,_0x275930){return db[_0x5e5b('0x41')]['findOne']({'where':{'id':_0x2d17b0[_0x5e5b('0x50')]['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x30b010,null))[_0x5e5b('0x27')](function(_0x1aea38){var _0x129026;var _0x5543eb={},_0x2ccee2={};_0x2ccee2[_0x5e5b('0x33')]=_[_0x5e5b('0x35')](db[_0x5e5b('0x52')][_0x5e5b('0x30')]);_0x2ccee2['query']=_[_0x5e5b('0x35')](_0x2d17b0['query']);_0x2ccee2[_0x5e5b('0x36')]=_['intersection'](_0x2ccee2[_0x5e5b('0x33')],_0x2ccee2[_0x5e5b('0x34')]);_0x5543eb[_0x5e5b('0x38')]=_[_0x5e5b('0x37')](_0x2ccee2[_0x5e5b('0x33')],qs[_0x5e5b('0x39')](_0x2d17b0['query'][_0x5e5b('0x39')]));_0x5543eb[_0x5e5b('0x38')]=_0x5543eb[_0x5e5b('0x38')][_0x5e5b('0x46')]?_0x5543eb['attributes']:_0x2ccee2['model'];if(!_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3a')]('nolimit')){_0x5543eb[_0x5e5b('0x3b')]=qs[_0x5e5b('0x3b')](_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3b')]);_0x5543eb[_0x5e5b('0x1e')]=qs['offset'](_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x1e')]);}_0x5543eb['order']=qs['sort'](_0x2d17b0['query'][_0x5e5b('0x3c')]);_0x5543eb[_0x5e5b('0x3e')]=qs[_0x5e5b('0x36')](_[_0x5e5b('0x53')](_0x2d17b0[_0x5e5b('0x34')],_0x2ccee2['filters']));if(_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3d')]){_0x5543eb['where']=_[_0x5e5b('0x3f')](_0x5543eb['where'],{'$or':_['map'](_0x5543eb[_0x5e5b('0x38')],function(_0x4fa0db){var _0x454026={};_0x454026[_0x4fa0db]={'$like':'%'+_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3d')]+'%'};return _0x454026;})});}_0x5543eb[_0x5e5b('0x3e')]=_[_0x5e5b('0x3f')](_0x5543eb['where'],{'mailboxuser':_0x1aea38[_0x5e5b('0x54')]});_0x5543eb=_[_0x5e5b('0x3f')]({},_0x5543eb,_0x2d17b0[_0x5e5b('0x40')]);return db[_0x5e5b('0x52')][_0x5e5b('0x55')](_0x5543eb)[_0x5e5b('0x27')](respondWithFilteredResult(_0x30b010,_0x5543eb));})[_0x5e5b('0x45')](handleError(_0x30b010,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index b458815..fbc79ca 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 _0xe1a6=['../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','mailbox','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x58cb10,_0x3bc7f4){var _0x4681c1=function(_0x52e62f){while(--_0x52e62f){_0x58cb10['push'](_0x58cb10['shift']());}};_0x4681c1(++_0x3bc7f4);}(_0xe1a6,0x19c));var _0x6e1a=function(_0x3b3a4b,_0x3514b0){_0x3b3a4b=_0x3b3a4b-0x0;var _0x272baf=_0xe1a6[_0x3b3a4b];return _0x272baf;};'use strict';var _=require(_0x6e1a('0x0'));var util=require(_0x6e1a('0x1'));var logger=require(_0x6e1a('0x2'))(_0x6e1a('0x3'));var moment=require(_0x6e1a('0x4'));var BPromise=require('bluebird');var rp=require(_0x6e1a('0x5'));var fs=require('fs');var path=require(_0x6e1a('0x6'));var rimraf=require(_0x6e1a('0x7'));var config=require(_0x6e1a('0x8'));var attributes=require(_0x6e1a('0x9'));module[_0x6e1a('0xa')]=function(_0x5be8f8,_0x166e39){return _0x5be8f8[_0x6e1a('0xb')](_0x6e1a('0xc'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x6e1a('0xd'),'fields':[_0x6e1a('0xe'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe272=['../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','moment','rimraf'];(function(_0x5e82b4,_0x1a1c2f){var _0x277015=function(_0x25ae1b){while(--_0x25ae1b){_0x5e82b4['push'](_0x5e82b4['shift']());}};_0x277015(++_0x1a1c2f);}(_0xe272,0x1ad));var _0x2e27=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xe272[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x2e27('0x0'));var util=require(_0x2e27('0x1'));var logger=require(_0x2e27('0x2'))('api');var moment=require(_0x2e27('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2e27('0x4'));var config=require(_0x2e27('0x5'));var attributes=require(_0x2e27('0x6'));module[_0x2e27('0x7')]=function(_0x33e66f,_0x88e368){return _0x33e66f[_0x2e27('0x8')](_0x2e27('0x9'),attributes,{'tableName':_0x2e27('0xa'),'paranoid':![],'indexes':[{'name':_0x2e27('0xb'),'fields':[_0x2e27('0xc'),_0x2e27('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 1b3347d..7861f2d 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 _0xc8c9=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util'];(function(_0x465562,_0x52317d){var _0x5cc85f=function(_0x464b8d){while(--_0x464b8d){_0x465562['push'](_0x465562['shift']());}};_0x5cc85f(++_0x52317d);}(_0xc8c9,0x108));var _0x9c8c=function(_0x4ffa64,_0x271035){_0x4ffa64=_0x4ffa64-0x0;var _0x5da001=_0xc8c9[_0x4ffa64];return _0x5da001;};'use strict';var _=require(_0x9c8c('0x0'));var util=require(_0x9c8c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9c8c('0x2'));var fs=require('fs');var Redis=require(_0x9c8c('0x3'));var db=require(_0x9c8c('0x4'))['db'];var utils=require(_0x9c8c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9c8c('0x6'));var jayson=require(_0x9c8c('0x7'));var client=jayson[_0x9c8c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e8140,_0x381ea3,_0x232d3b){return new BPromise(function(_0x28520e,_0x3da690){return client[_0x9c8c('0x9')](_0x4e8140,_0x232d3b)['then'](function(_0xc7dfe4){logger[_0x9c8c('0xa')](_0x9c8c('0xb'),_0x381ea3,_0x9c8c('0xc'));logger[_0x9c8c('0xd')](_0x9c8c('0xe'),_0x381ea3,_0x9c8c('0xc'),JSON['stringify'](_0xc7dfe4));if(_0xc7dfe4[_0x9c8c('0xf')]){if(_0xc7dfe4[_0x9c8c('0xf')]['code']===0x1f4){logger[_0x9c8c('0xf')]('VoiceMail,\x20%s,\x20%s',_0x381ea3,_0xc7dfe4[_0x9c8c('0xf')][_0x9c8c('0x10')]);return _0x3da690(_0xc7dfe4[_0x9c8c('0xf')][_0x9c8c('0x10')]);}logger[_0x9c8c('0xf')](_0x9c8c('0xb'),_0x381ea3,_0xc7dfe4[_0x9c8c('0xf')][_0x9c8c('0x10')]);return _0x28520e(_0xc7dfe4['error'][_0x9c8c('0x10')]);}else{logger[_0x9c8c('0xa')](_0x9c8c('0xb'),_0x381ea3,_0x9c8c('0xc'));_0x28520e(_0xc7dfe4[_0x9c8c('0x11')][_0x9c8c('0x10')]);}})[_0x9c8c('0x12')](function(_0x4dfc5b){logger[_0x9c8c('0xf')]('VoiceMail,\x20%s,\x20%s',_0x381ea3,_0x4dfc5b);_0x3da690(_0x4dfc5b);});});} \ No newline at end of file +var _0xf7f3=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','request\x20sent','debug'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xf7f3,0x9f));var _0x3f7f=function(_0x1516b4,_0x5135dc){_0x1516b4=_0x1516b4-0x0;var _0x46fe7c=_0xf7f3[_0x1516b4];return _0x46fe7c;};'use strict';var _=require('lodash');var util=require(_0x3f7f('0x0'));var moment=require(_0x3f7f('0x1'));var BPromise=require(_0x3f7f('0x2'));var rs=require(_0x3f7f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f7f('0x4'))['db'];var utils=require(_0x3f7f('0x5'));var logger=require(_0x3f7f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3f7f('0x7'));var client=jayson[_0x3f7f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1aa838,_0x55ce72,_0x432b80){return new BPromise(function(_0x3d562c,_0x5b7e99){return client['request'](_0x1aa838,_0x432b80)[_0x3f7f('0x9')](function(_0x3e656a){logger['info']('VoiceMail,\x20%s,\x20%s',_0x55ce72,_0x3f7f('0xa'));logger[_0x3f7f('0xb')](_0x3f7f('0xc'),_0x55ce72,_0x3f7f('0xa'),JSON[_0x3f7f('0xd')](_0x3e656a));if(_0x3e656a[_0x3f7f('0xe')]){if(_0x3e656a[_0x3f7f('0xe')][_0x3f7f('0xf')]===0x1f4){logger[_0x3f7f('0xe')](_0x3f7f('0x10'),_0x55ce72,_0x3e656a[_0x3f7f('0xe')]['message']);return _0x5b7e99(_0x3e656a[_0x3f7f('0xe')][_0x3f7f('0x11')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x55ce72,_0x3e656a['error'][_0x3f7f('0x11')]);return _0x3d562c(_0x3e656a[_0x3f7f('0xe')][_0x3f7f('0x11')]);}else{logger['info'](_0x3f7f('0x10'),_0x55ce72,_0x3f7f('0xa'));_0x3d562c(_0x3e656a[_0x3f7f('0x12')][_0x3f7f('0x11')]);}})['catch'](function(_0x478941){logger[_0x3f7f('0xe')]('VoiceMail,\x20%s,\x20%s',_0x55ce72,_0x478941);_0x5b7e99(_0x478941);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 1f0ef06..9eb3553 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 _0x7bf6=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','post','create','update'];(function(_0xf509e0,_0x1c4525){var _0x2e0747=function(_0x240315){while(--_0x240315){_0xf509e0['push'](_0xf509e0['shift']());}};_0x2e0747(++_0x1c4525);}(_0x7bf6,0x193));var _0x67bf=function(_0x3213b4,_0x3cddd0){_0x3213b4=_0x3213b4-0x0;var _0xa97785=_0x7bf6[_0x3213b4];return _0xa97785;};'use strict';var multer=require(_0x67bf('0x0'));var util=require(_0x67bf('0x1'));var path=require(_0x67bf('0x2'));var timeout=require(_0x67bf('0x3'));var express=require(_0x67bf('0x4'));var router=express[_0x67bf('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x67bf('0x6'));var config=require(_0x67bf('0x7'));var controller=require('./voiceMailMessage.controller');router[_0x67bf('0x8')]('/',auth[_0x67bf('0x9')](),controller[_0x67bf('0xa')]);router[_0x67bf('0x8')](_0x67bf('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x67bf('0x8')](_0x67bf('0xc'),auth[_0x67bf('0x9')](),controller[_0x67bf('0xd')]);router[_0x67bf('0xe')]('/',auth[_0x67bf('0x9')](),controller[_0x67bf('0xf')]);router['put']('/:id',auth[_0x67bf('0x9')](),controller[_0x67bf('0x10')]);router[_0x67bf('0x11')](_0x67bf('0xb'),auth[_0x67bf('0x9')](),controller[_0x67bf('0x12')]);module[_0x67bf('0x13')]=router; \ No newline at end of file +var _0x8333=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put'];(function(_0x43ceb1,_0x560cd3){var _0x42721a=function(_0x5d097a){while(--_0x5d097a){_0x43ceb1['push'](_0x43ceb1['shift']());}};_0x42721a(++_0x560cd3);}(_0x8333,0x1d1));var _0x3833=function(_0x443fd6,_0x520f27){_0x443fd6=_0x443fd6-0x0;var _0x5557a6=_0x8333[_0x443fd6];return _0x5557a6;};'use strict';var multer=require(_0x3833('0x0'));var util=require(_0x3833('0x1'));var path=require(_0x3833('0x2'));var timeout=require(_0x3833('0x3'));var express=require(_0x3833('0x4'));var router=express[_0x3833('0x5')]();var fs_extra=require(_0x3833('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3833('0x7'));var config=require(_0x3833('0x8'));var controller=require(_0x3833('0x9'));router[_0x3833('0xa')]('/',auth[_0x3833('0xb')](),controller[_0x3833('0xc')]);router['get'](_0x3833('0xd'),auth[_0x3833('0xb')](),controller['show']);router[_0x3833('0xa')](_0x3833('0xe'),auth[_0x3833('0xb')](),controller[_0x3833('0xf')]);router['post']('/',auth[_0x3833('0xb')](),controller[_0x3833('0x10')]);router[_0x3833('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3833('0x12')](_0x3833('0xd'),auth[_0x3833('0xb')](),controller[_0x3833('0x13')]);module[_0x3833('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 6be0599..7c96d39 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 _0xbfd0=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x5202ed,_0x4f140b){var _0x5f0099=function(_0xb838d){while(--_0xb838d){_0x5202ed['push'](_0x5202ed['shift']());}};_0x5f0099(++_0x4f140b);}(_0xbfd0,0xf5));var _0x0bfd=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xbfd0[_0x18cd5b];return _0x5eaa52;};'use strict';var Sequelize=require('sequelize');module[_0x0bfd('0x0')]={'name':{'type':Sequelize[_0x0bfd('0x1')],'get':function(_0x2ac21c){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x0bfd('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x0bfd('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x0bfd('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x0bfd('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x0bfd('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x0bfd('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x0bfd('0x4')](_0x0bfd('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x0bfd('0x3')],'defaultValue':''},'stamp':{'type':_0x0bfd('0x6'),'defaultValue':Sequelize[_0x0bfd('0x7')](_0x0bfd('0x8'))}}; \ No newline at end of file +var _0x6017=['STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','INTEGER'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x6017,0x1f0));var _0x7601=function(_0x292289,_0x308eb3){_0x292289=_0x292289-0x0;var _0x58058e=_0x6017[_0x292289];return _0x58058e;};'use strict';var Sequelize=require(_0x7601('0x0'));module[_0x7601('0x1')]={'name':{'type':Sequelize[_0x7601('0x2')],'get':function(_0x58fad4){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x7601('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x7601('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x7601('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x7601('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x7601('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x7601('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x7601('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x7601('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x7601('0x5')](_0x7601('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x7601('0x4')],'defaultValue':''},'stamp':{'type':_0x7601('0x7'),'defaultValue':Sequelize[_0x7601('0x8')](_0x7601('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 378e3f9..97dd2bd 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 _0xeb5d=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','rows','show','keys','include','find','catch','create','body','params','download','msg_id','recording','Sequelize','ValidationError','audio/wav','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','name','index','map','VoiceMailMessage','type','key','model','query'];(function(_0xd5eb5d,_0x4045ea){var _0x9ff8be=function(_0x24fbda){while(--_0x24fbda){_0xd5eb5d['push'](_0xd5eb5d['shift']());}};_0x9ff8be(++_0x4045ea);}(_0xeb5d,0x1e8));var _0xdeb5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xeb5d[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xdeb5('0x0'));var rimraf=require(_0xdeb5('0x1'));var zipdir=require(_0xdeb5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdeb5('0x3'));var BPromise=require(_0xdeb5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdeb5('0x5'));var sox=require(_0xdeb5('0x6'));var csv=require(_0xdeb5('0x7'));var ejs=require(_0xdeb5('0x8'));var fs=require('fs');var fs_extra=require(_0xdeb5('0x9'));var _=require(_0xdeb5('0xa'));var squel=require(_0xdeb5('0xb'));var crypto=require(_0xdeb5('0xc'));var jsforce=require(_0xdeb5('0xd'));var deskjs=require(_0xdeb5('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdeb5('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdeb5('0x10'));var as=require(_0xdeb5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdeb5('0x12'));var config=require(_0xdeb5('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb30afa,_0x335de7){_0x335de7=_0x335de7||0xcc;return function(_0x1b0a24){if(_0x1b0a24){return _0xb30afa[_0xdeb5('0x14')](_0x335de7);}return _0xb30afa[_0xdeb5('0x15')](_0x335de7)[_0xdeb5('0x16')]();};}function respondWithResult(_0xd6f257,_0x178af2){_0x178af2=_0x178af2||0xc8;return function(_0x597ec4){if(_0x597ec4){return _0xd6f257[_0xdeb5('0x15')](_0x178af2)[_0xdeb5('0x17')](_0x597ec4);}};}function respondWithFilteredResult(_0x5d4f6d,_0x539449){return function(_0x4b4de8){if(_0x4b4de8){var _0x113f56=typeof _0x539449[_0xdeb5('0x18')]==='undefined'&&typeof _0x539449['limit']===_0xdeb5('0x19');var _0x59b149=_0x4b4de8[_0xdeb5('0x1a')];var _0x1ade79=_0x113f56?0x0:_0x539449[_0xdeb5('0x18')];var _0x2c2e74=_0x113f56?_0x4b4de8['count']:_0x539449[_0xdeb5('0x18')]+_0x539449[_0xdeb5('0x1b')];var _0x270d3e;if(_0x2c2e74>=_0x59b149){_0x2c2e74=_0x59b149;_0x270d3e=0xc8;}else{_0x270d3e=0xce;}_0x5d4f6d['status'](_0x270d3e);return _0x5d4f6d[_0xdeb5('0x1c')](_0xdeb5('0x1d'),_0x1ade79+'-'+_0x2c2e74+'/'+_0x59b149)['json'](_0x4b4de8);}return null;};}function patchUpdates(_0x1f8695){return function(_0x584662){try{jsonpatch['apply'](_0x584662,_0x1f8695,!![]);}catch(_0x3ed54c){return BPromise[_0xdeb5('0x1e')](_0x3ed54c);}return _0x584662[_0xdeb5('0x1f')]();};}function saveUpdates(_0x511c7d,_0x2ca4e8){return function(_0x5a8c86){if(_0x5a8c86){return _0x5a8c86[_0xdeb5('0x20')](_0x511c7d)[_0xdeb5('0x21')](function(_0x104462){return _0x104462;});}return null;};}function removeEntity(_0x424622,_0x55eaf3){return function(_0x1515af){if(_0x1515af){return _0x1515af[_0xdeb5('0x22')]()[_0xdeb5('0x21')](function(){_0x424622[_0xdeb5('0x15')](0xcc)[_0xdeb5('0x16')]();});}};}function handleEntityNotFound(_0x2e038d,_0x302003){return function(_0x11d367){if(!_0x11d367){_0x2e038d[_0xdeb5('0x14')](0x194);}return _0x11d367;};}function handleError(_0x50b07c,_0x3cbd6b){_0x3cbd6b=_0x3cbd6b||0x1f4;return function(_0x3baeff){logger[_0xdeb5('0x23')](_0x3baeff['stack']);if(_0x3baeff[_0xdeb5('0x24')]){delete _0x3baeff['name'];}_0x50b07c['status'](_0x3cbd6b)['send'](_0x3baeff);};}exports[_0xdeb5('0x25')]=function(_0x311010,_0x2ec340){var _0x487b93={},_0x48709c={},_0x30f55b={'count':0x0,'rows':[]};var _0x513bff=_[_0xdeb5('0x26')](db[_0xdeb5('0x27')]['rawAttributes'],function(_0x8a5a7f){return{'name':_0x8a5a7f['fieldName'],'type':_0x8a5a7f[_0xdeb5('0x28')][_0xdeb5('0x29')]};});_0x48709c[_0xdeb5('0x2a')]=_['differenceBy'](_[_0xdeb5('0x26')](_0x513bff,_0xdeb5('0x24')),['name']);_0x48709c[_0xdeb5('0x2b')]=_['keys'](_0x311010['query']);_0x48709c[_0xdeb5('0x2c')]=_[_0xdeb5('0x2d')](_0x48709c[_0xdeb5('0x2a')],_0x48709c[_0xdeb5('0x2b')]);_0x487b93['attributes']=_[_0xdeb5('0x2d')](_0x48709c[_0xdeb5('0x2a')],qs[_0xdeb5('0x2e')](_0x311010[_0xdeb5('0x2b')][_0xdeb5('0x2e')]));_0x487b93[_0xdeb5('0x2f')]=_0x487b93[_0xdeb5('0x2f')][_0xdeb5('0x30')]?_0x487b93['attributes']:_0x48709c[_0xdeb5('0x2a')];if(!_0x311010[_0xdeb5('0x2b')][_0xdeb5('0x31')](_0xdeb5('0x32'))){_0x487b93[_0xdeb5('0x1b')]=qs['limit'](_0x311010[_0xdeb5('0x2b')]['limit']);_0x487b93[_0xdeb5('0x18')]=qs[_0xdeb5('0x18')](_0x311010[_0xdeb5('0x2b')][_0xdeb5('0x18')]);}_0x487b93[_0xdeb5('0x33')]=qs['sort'](_0x311010[_0xdeb5('0x2b')][_0xdeb5('0x34')]);_0x487b93[_0xdeb5('0x35')]=qs[_0xdeb5('0x2c')](_['pick'](_0x311010[_0xdeb5('0x2b')],_0x48709c[_0xdeb5('0x2c')]),_0x513bff);if(_0x311010[_0xdeb5('0x2b')][_0xdeb5('0x36')]){_0x487b93[_0xdeb5('0x35')]=_[_0xdeb5('0x37')](_0x487b93[_0xdeb5('0x35')],{'$or':_[_0xdeb5('0x26')](_0x513bff,function(_0x58a38d){if(_0x58a38d[_0xdeb5('0x28')]!=='VIRTUAL'){var _0x2a4c87={};_0x2a4c87[_0x58a38d[_0xdeb5('0x24')]]={'$like':'%'+_0x311010[_0xdeb5('0x2b')][_0xdeb5('0x36')]+'%'};return _0x2a4c87;}})});}_0x487b93=_[_0xdeb5('0x37')]({},_0x487b93,_0x311010[_0xdeb5('0x38')]);var _0x17adc6={'where':_0x487b93[_0xdeb5('0x35')]};return db['VoiceMailMessage'][_0xdeb5('0x1a')](_0x17adc6)[_0xdeb5('0x21')](function(_0x1c2123){_0x30f55b[_0xdeb5('0x1a')]=_0x1c2123;if(_0x311010[_0xdeb5('0x2b')][_0xdeb5('0x39')]){_0x487b93['include']=[{'all':!![]}];}return db[_0xdeb5('0x27')]['findAll'](_0x487b93);})['then'](function(_0x3d1f12){_0x30f55b[_0xdeb5('0x3a')]=_0x3d1f12;return _0x30f55b;})[_0xdeb5('0x21')](respondWithFilteredResult(_0x2ec340,_0x487b93))['catch'](handleError(_0x2ec340,null));};exports[_0xdeb5('0x3b')]=function(_0x5c110d,_0xc5f8c1){var _0x4cf3f6={'raw':!![],'where':{'id':_0x5c110d['params']['id']}},_0x5c890a={};_0x5c890a[_0xdeb5('0x2a')]=_[_0xdeb5('0x3c')](db[_0xdeb5('0x27')]['rawAttributes']);_0x5c890a[_0xdeb5('0x2b')]=_['keys'](_0x5c110d[_0xdeb5('0x2b')]);_0x5c890a[_0xdeb5('0x2c')]=_[_0xdeb5('0x2d')](_0x5c890a[_0xdeb5('0x2a')],_0x5c890a[_0xdeb5('0x2b')]);_0x4cf3f6[_0xdeb5('0x2f')]=_['intersection'](_0x5c890a[_0xdeb5('0x2a')],qs[_0xdeb5('0x2e')](_0x5c110d[_0xdeb5('0x2b')]['fields']));_0x4cf3f6[_0xdeb5('0x2f')]=_0x4cf3f6[_0xdeb5('0x2f')]['length']?_0x4cf3f6['attributes']:_0x5c890a[_0xdeb5('0x2a')];if(_0x5c110d['query'][_0xdeb5('0x39')]){_0x4cf3f6[_0xdeb5('0x3d')]=[{'all':!![]}];}_0x4cf3f6=_[_0xdeb5('0x37')]({},_0x4cf3f6,_0x5c110d[_0xdeb5('0x38')]);return db[_0xdeb5('0x27')][_0xdeb5('0x3e')](_0x4cf3f6)[_0xdeb5('0x21')](handleEntityNotFound(_0xc5f8c1,null))['then'](respondWithResult(_0xc5f8c1,null))[_0xdeb5('0x3f')](handleError(_0xc5f8c1,null));};exports[_0xdeb5('0x40')]=function(_0x4df90d,_0xd90716){return db['VoiceMailMessage'][_0xdeb5('0x40')](_0x4df90d[_0xdeb5('0x41')],{})[_0xdeb5('0x21')](respondWithResult(_0xd90716,0xc9))['catch'](handleError(_0xd90716,null));};exports[_0xdeb5('0x20')]=function(_0x353158,_0x2f2e76){if(_0x353158['body']['id']){delete _0x353158[_0xdeb5('0x41')]['id'];}return db[_0xdeb5('0x27')]['find']({'where':{'id':_0x353158[_0xdeb5('0x42')]['id']}})[_0xdeb5('0x21')](handleEntityNotFound(_0x2f2e76,null))[_0xdeb5('0x21')](saveUpdates(_0x353158[_0xdeb5('0x41')],null))['then'](respondWithResult(_0x2f2e76,null))[_0xdeb5('0x3f')](handleError(_0x2f2e76,null));};exports['destroy']=function(_0x525dd8,_0x748261){return db[_0xdeb5('0x27')]['find']({'where':{'id':_0x525dd8[_0xdeb5('0x42')]['id']}})[_0xdeb5('0x21')](handleEntityNotFound(_0x748261,null))[_0xdeb5('0x21')](removeEntity(_0x748261,null))[_0xdeb5('0x3f')](handleError(_0x748261,null));};exports[_0xdeb5('0x43')]=function(_0x13a6e2,_0x2b92ad,_0x3b3324){return db[_0xdeb5('0x27')]['find']({'where':{'id':_0x13a6e2[_0xdeb5('0x42')]['id']},'attributes':['id','recording',_0xdeb5('0x44')]})[_0xdeb5('0x21')](handleEntityNotFound(_0x2b92ad,null))['then'](function(_0x676c07){if(_0x676c07){if(!_0x676c07[_0xdeb5('0x45')]){throw new db[(_0xdeb5('0x46'))][(_0xdeb5('0x47'))]('VoiceMailMessage\x20not\x20found');}var _0x453a56={'Content-Type':_0xdeb5('0x48'),'Content-Disposition':'attachment'};if(_0x676c07[_0xdeb5('0x44')]){_0x453a56['Content-Disposition']=_0xdeb5('0x49')+_0x676c07['msg_id']+_0xdeb5('0x4a');}_0x2b92ad['set'](_0x453a56);return _0x2b92ad[_0xdeb5('0x4b')](new Buffer(_0x676c07[_0xdeb5('0x45')]));}})['catch'](handleError(_0x2b92ad,null));}; \ No newline at end of file +var _0xef3d=['.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','VoiceMailMessage','rawAttributes','fieldName','key','map','name','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','params','create','body','download','find','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22'];(function(_0x53895b,_0x399fd6){var _0x462a47=function(_0x25e2c8){while(--_0x25e2c8){_0x53895b['push'](_0x53895b['shift']());}};_0x462a47(++_0x399fd6);}(_0xef3d,0x10c));var _0xdef3=function(_0x178d06,_0x62d45d){_0x178d06=_0x178d06-0x0;var _0x2a95cb=_0xef3d[_0x178d06];return _0x2a95cb;};'use strict';var emlformat=require(_0xdef3('0x0'));var rimraf=require(_0xdef3('0x1'));var zipdir=require(_0xdef3('0x2'));var jsonpatch=require(_0xdef3('0x3'));var rp=require(_0xdef3('0x4'));var moment=require(_0xdef3('0x5'));var BPromise=require(_0xdef3('0x6'));var Mustache=require(_0xdef3('0x7'));var util=require(_0xdef3('0x8'));var path=require('path');var sox=require(_0xdef3('0x9'));var csv=require(_0xdef3('0xa'));var ejs=require(_0xdef3('0xb'));var fs=require('fs');var fs_extra=require(_0xdef3('0xc'));var _=require(_0xdef3('0xd'));var squel=require('squel');var crypto=require(_0xdef3('0xe'));var jsforce=require(_0xdef3('0xf'));var deskjs=require(_0xdef3('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdef3('0x11'));var Redis=require(_0xdef3('0x12'));var authService=require(_0xdef3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdef3('0x14'));var hardwareService=require(_0xdef3('0x15'));var logger=require(_0xdef3('0x16'))(_0xdef3('0x17'));var utils=require(_0xdef3('0x18'));var config=require(_0xdef3('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xdef3('0x1a'))['db'];function respondWithStatusCode(_0x4358f9,_0x124a3a){_0x124a3a=_0x124a3a||0xcc;return function(_0x1c83c8){if(_0x1c83c8){return _0x4358f9[_0xdef3('0x1b')](_0x124a3a);}return _0x4358f9[_0xdef3('0x1c')](_0x124a3a)[_0xdef3('0x1d')]();};}function respondWithResult(_0x396282,_0x2ca1a4){_0x2ca1a4=_0x2ca1a4||0xc8;return function(_0x276638){if(_0x276638){return _0x396282[_0xdef3('0x1c')](_0x2ca1a4)[_0xdef3('0x1e')](_0x276638);}};}function respondWithFilteredResult(_0x4b4592,_0x308204){return function(_0x3e47c4){if(_0x3e47c4){var _0x1a8cea=typeof _0x308204[_0xdef3('0x1f')]===_0xdef3('0x20')&&typeof _0x308204[_0xdef3('0x21')]===_0xdef3('0x20');var _0x12c060=_0x3e47c4[_0xdef3('0x22')];var _0x25a4bf=_0x1a8cea?0x0:_0x308204['offset'];var _0x4e8276=_0x1a8cea?_0x3e47c4['count']:_0x308204['offset']+_0x308204[_0xdef3('0x21')];var _0x32687b;if(_0x4e8276>=_0x12c060){_0x4e8276=_0x12c060;_0x32687b=0xc8;}else{_0x32687b=0xce;}_0x4b4592[_0xdef3('0x1c')](_0x32687b);return _0x4b4592[_0xdef3('0x23')](_0xdef3('0x24'),_0x25a4bf+'-'+_0x4e8276+'/'+_0x12c060)['json'](_0x3e47c4);}return null;};}function patchUpdates(_0x4ba3c0){return function(_0x33ab71){try{jsonpatch[_0xdef3('0x25')](_0x33ab71,_0x4ba3c0,!![]);}catch(_0x144faf){return BPromise[_0xdef3('0x26')](_0x144faf);}return _0x33ab71[_0xdef3('0x27')]();};}function saveUpdates(_0x39a76a,_0x3900dd){return function(_0x1bc2f6){if(_0x1bc2f6){return _0x1bc2f6[_0xdef3('0x28')](_0x39a76a)[_0xdef3('0x29')](function(_0x511c3a){return _0x511c3a;});}return null;};}function removeEntity(_0x5f433d,_0x258c73){return function(_0x377051){if(_0x377051){return _0x377051[_0xdef3('0x2a')]()['then'](function(){_0x5f433d[_0xdef3('0x1c')](0xcc)[_0xdef3('0x1d')]();});}};}function handleEntityNotFound(_0x18e779,_0x2dd636){return function(_0x373d1d){if(!_0x373d1d){_0x18e779['sendStatus'](0x194);}return _0x373d1d;};}function handleError(_0xb7b372,_0x28f49e){_0x28f49e=_0x28f49e||0x1f4;return function(_0x592ad5){logger[_0xdef3('0x2b')](_0x592ad5[_0xdef3('0x2c')]);if(_0x592ad5['name']){delete _0x592ad5['name'];}_0xb7b372['status'](_0x28f49e)[_0xdef3('0x2d')](_0x592ad5);};}exports[_0xdef3('0x2e')]=function(_0x2b5a4b,_0x2df480){var _0x12d608={},_0x23fcdf={},_0x5ac924={'count':0x0,'rows':[]};var _0x4fe792=_['map'](db[_0xdef3('0x2f')][_0xdef3('0x30')],function(_0x146f61){return{'name':_0x146f61[_0xdef3('0x31')],'type':_0x146f61['type'][_0xdef3('0x32')]};});_0x23fcdf['model']=_['differenceBy'](_[_0xdef3('0x33')](_0x4fe792,_0xdef3('0x34')),['name']);_0x23fcdf['query']=_[_0xdef3('0x35')](_0x2b5a4b[_0xdef3('0x36')]);_0x23fcdf[_0xdef3('0x37')]=_[_0xdef3('0x38')](_0x23fcdf[_0xdef3('0x39')],_0x23fcdf['query']);_0x12d608[_0xdef3('0x3a')]=_[_0xdef3('0x38')](_0x23fcdf[_0xdef3('0x39')],qs[_0xdef3('0x3b')](_0x2b5a4b['query'][_0xdef3('0x3b')]));_0x12d608[_0xdef3('0x3a')]=_0x12d608[_0xdef3('0x3a')][_0xdef3('0x3c')]?_0x12d608[_0xdef3('0x3a')]:_0x23fcdf['model'];if(!_0x2b5a4b['query'][_0xdef3('0x3d')](_0xdef3('0x3e'))){_0x12d608[_0xdef3('0x21')]=qs['limit'](_0x2b5a4b[_0xdef3('0x36')][_0xdef3('0x21')]);_0x12d608[_0xdef3('0x1f')]=qs[_0xdef3('0x1f')](_0x2b5a4b[_0xdef3('0x36')][_0xdef3('0x1f')]);}_0x12d608[_0xdef3('0x3f')]=qs[_0xdef3('0x40')](_0x2b5a4b[_0xdef3('0x36')][_0xdef3('0x40')]);_0x12d608['where']=qs[_0xdef3('0x37')](_['pick'](_0x2b5a4b[_0xdef3('0x36')],_0x23fcdf[_0xdef3('0x37')]),_0x4fe792);if(_0x2b5a4b['query'][_0xdef3('0x41')]){_0x12d608['where']=_[_0xdef3('0x42')](_0x12d608[_0xdef3('0x43')],{'$or':_[_0xdef3('0x33')](_0x4fe792,function(_0x4b07e5){if(_0x4b07e5['type']!==_0xdef3('0x44')){var _0x46c966={};_0x46c966[_0x4b07e5['name']]={'$like':'%'+_0x2b5a4b[_0xdef3('0x36')][_0xdef3('0x41')]+'%'};return _0x46c966;}})});}_0x12d608=_[_0xdef3('0x42')]({},_0x12d608,_0x2b5a4b[_0xdef3('0x45')]);var _0x3f00a9={'where':_0x12d608[_0xdef3('0x43')]};return db[_0xdef3('0x2f')][_0xdef3('0x22')](_0x3f00a9)[_0xdef3('0x29')](function(_0x131d7e){_0x5ac924['count']=_0x131d7e;if(_0x2b5a4b[_0xdef3('0x36')]['includeAll']){_0x12d608[_0xdef3('0x46')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xdef3('0x47')](_0x12d608);})[_0xdef3('0x29')](function(_0x9f318f){_0x5ac924[_0xdef3('0x48')]=_0x9f318f;return _0x5ac924;})[_0xdef3('0x29')](respondWithFilteredResult(_0x2df480,_0x12d608))[_0xdef3('0x49')](handleError(_0x2df480,null));};exports[_0xdef3('0x4a')]=function(_0x4dd4c7,_0x32a3d4){var _0xba82bb={'raw':!![],'where':{'id':_0x4dd4c7[_0xdef3('0x4b')]['id']}},_0x18273d={};_0x18273d[_0xdef3('0x39')]=_['keys'](db[_0xdef3('0x2f')][_0xdef3('0x30')]);_0x18273d[_0xdef3('0x36')]=_[_0xdef3('0x35')](_0x4dd4c7[_0xdef3('0x36')]);_0x18273d[_0xdef3('0x37')]=_[_0xdef3('0x38')](_0x18273d[_0xdef3('0x39')],_0x18273d['query']);_0xba82bb[_0xdef3('0x3a')]=_[_0xdef3('0x38')](_0x18273d[_0xdef3('0x39')],qs['fields'](_0x4dd4c7['query'][_0xdef3('0x3b')]));_0xba82bb[_0xdef3('0x3a')]=_0xba82bb[_0xdef3('0x3a')][_0xdef3('0x3c')]?_0xba82bb[_0xdef3('0x3a')]:_0x18273d['model'];if(_0x4dd4c7[_0xdef3('0x36')]['includeAll']){_0xba82bb[_0xdef3('0x46')]=[{'all':!![]}];}_0xba82bb=_['merge']({},_0xba82bb,_0x4dd4c7[_0xdef3('0x45')]);return db[_0xdef3('0x2f')]['find'](_0xba82bb)['then'](handleEntityNotFound(_0x32a3d4,null))[_0xdef3('0x29')](respondWithResult(_0x32a3d4,null))['catch'](handleError(_0x32a3d4,null));};exports[_0xdef3('0x4c')]=function(_0x10a9d2,_0x53cf2b){return db[_0xdef3('0x2f')][_0xdef3('0x4c')](_0x10a9d2['body'],{})[_0xdef3('0x29')](respondWithResult(_0x53cf2b,0xc9))[_0xdef3('0x49')](handleError(_0x53cf2b,null));};exports[_0xdef3('0x28')]=function(_0x54b98f,_0x2a0714){if(_0x54b98f[_0xdef3('0x4d')]['id']){delete _0x54b98f['body']['id'];}return db[_0xdef3('0x2f')]['find']({'where':{'id':_0x54b98f[_0xdef3('0x4b')]['id']}})[_0xdef3('0x29')](handleEntityNotFound(_0x2a0714,null))['then'](saveUpdates(_0x54b98f[_0xdef3('0x4d')],null))[_0xdef3('0x29')](respondWithResult(_0x2a0714,null))[_0xdef3('0x49')](handleError(_0x2a0714,null));};exports[_0xdef3('0x2a')]=function(_0x31b237,_0x451d9a){return db[_0xdef3('0x2f')]['find']({'where':{'id':_0x31b237[_0xdef3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x451d9a,null))[_0xdef3('0x29')](removeEntity(_0x451d9a,null))[_0xdef3('0x49')](handleError(_0x451d9a,null));};exports[_0xdef3('0x4e')]=function(_0x28377b,_0x6d26fa,_0x1059f2){return db[_0xdef3('0x2f')][_0xdef3('0x4f')]({'where':{'id':_0x28377b[_0xdef3('0x4b')]['id']},'attributes':['id',_0xdef3('0x50'),_0xdef3('0x51')]})[_0xdef3('0x29')](handleEntityNotFound(_0x6d26fa,null))[_0xdef3('0x29')](function(_0x5c5e59){if(_0x5c5e59){if(!_0x5c5e59['recording']){throw new db['Sequelize'][(_0xdef3('0x52'))](_0xdef3('0x53'));}var _0x3986a3={'Content-Type':_0xdef3('0x54'),'Content-Disposition':_0xdef3('0x55')};if(_0x5c5e59[_0xdef3('0x51')]){_0x3986a3[_0xdef3('0x56')]=_0xdef3('0x57')+_0x5c5e59[_0xdef3('0x51')]+_0xdef3('0x58');}_0x6d26fa['set'](_0x3986a3);return _0x6d26fa[_0xdef3('0x2d')](new Buffer(_0x5c5e59[_0xdef3('0x50')]));}})['catch'](handleError(_0x6d26fa,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index b6aa8ff..888929b 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 _0x654a=['rimraf','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','../../config/logger','api','bluebird','path'];(function(_0xf5547d,_0x342db1){var _0x1fbb3b=function(_0x3dd8cb){while(--_0x3dd8cb){_0xf5547d['push'](_0xf5547d['shift']());}};_0x1fbb3b(++_0x342db1);}(_0x654a,0x167));var _0xa654=function(_0x188c88,_0x210793){_0x188c88=_0x188c88-0x0;var _0x4e4c38=_0x654a[_0x188c88];return _0x4e4c38;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa654('0x0'))(_0xa654('0x1'));var moment=require('moment');var BPromise=require(_0xa654('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa654('0x3'));var rimraf=require(_0xa654('0x4'));var config=require(_0xa654('0x5'));var attributes=require('./voiceMailMessage.attributes');module[_0xa654('0x6')]=function(_0x6c60f5,_0xeca6eb){return _0x6c60f5[_0xa654('0x7')](_0xa654('0x8'),attributes,{'tableName':_0xa654('0x9'),'paranoid':![],'indexes':[{'name':_0xa654('0xa'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x335e=['moment','request-promise','path','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','api'];(function(_0x387230,_0x1dfca3){var _0x215dac=function(_0x55cce5){while(--_0x55cce5){_0x387230['push'](_0x387230['shift']());}};_0x215dac(++_0x1dfca3);}(_0x335e,0x17d));var _0xe335=function(_0x217736,_0xdc3a1c){_0x217736=_0x217736-0x0;var _0x28e0c3=_0x335e[_0x217736];return _0x28e0c3;};'use strict';var _=require('lodash');var util=require(_0xe335('0x0'));var logger=require(_0xe335('0x1'))(_0xe335('0x2'));var moment=require(_0xe335('0x3'));var BPromise=require('bluebird');var rp=require(_0xe335('0x4'));var fs=require('fs');var path=require(_0xe335('0x5'));var rimraf=require('rimraf');var config=require(_0xe335('0x6'));var attributes=require(_0xe335('0x7'));module['exports']=function(_0x42db97,_0x21f156){return _0x42db97[_0xe335('0x8')](_0xe335('0x9'),attributes,{'tableName':_0xe335('0xa'),'paranoid':![],'indexes':[{'name':_0xe335('0xb'),'fields':[_0xe335('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 97b64bd..e119a22 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 _0x9c9a=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','VoiceMailMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x2de0a7,_0x38d3e7){var _0x429437=function(_0x23c148){while(--_0x23c148){_0x2de0a7['push'](_0x2de0a7['shift']());}};_0x429437(++_0x38d3e7);}(_0x9c9a,0x154));var _0xa9c9=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9c9a[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xa9c9('0x0'));var util=require(_0xa9c9('0x1'));var moment=require(_0xa9c9('0x2'));var BPromise=require(_0xa9c9('0x3'));var rs=require(_0xa9c9('0x4'));var fs=require('fs');var Redis=require(_0xa9c9('0x5'));var db=require(_0xa9c9('0x6'))['db'];var utils=require(_0xa9c9('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa9c9('0x8'));var client=jayson['client'][_0xa9c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15b918,_0x12f7d5,_0x3477c1){return new BPromise(function(_0x592c6f,_0xd7ed1f){return client['request'](_0x15b918,_0x3477c1)['then'](function(_0xd68194){logger['info'](_0xa9c9('0xa'),_0x12f7d5,'request\x20sent');logger[_0xa9c9('0xb')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x12f7d5,_0xa9c9('0xc'),JSON[_0xa9c9('0xd')](_0xd68194));if(_0xd68194[_0xa9c9('0xe')]){if(_0xd68194[_0xa9c9('0xe')][_0xa9c9('0xf')]===0x1f4){logger[_0xa9c9('0xe')](_0xa9c9('0xa'),_0x12f7d5,_0xd68194[_0xa9c9('0xe')][_0xa9c9('0x10')]);return _0xd7ed1f(_0xd68194['error'][_0xa9c9('0x10')]);}logger[_0xa9c9('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x12f7d5,_0xd68194['error'][_0xa9c9('0x10')]);return _0x592c6f(_0xd68194['error'][_0xa9c9('0x10')]);}else{logger[_0xa9c9('0x11')](_0xa9c9('0xa'),_0x12f7d5,'request\x20sent');_0x592c6f(_0xd68194[_0xa9c9('0x12')][_0xa9c9('0x10')]);}})[_0xa9c9('0x13')](function(_0x5d717a){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x12f7d5,_0x5d717a);_0xd7ed1f(_0x5d717a);});});} \ No newline at end of file +var _0x4966=['then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4a471c,_0x4dab35){var _0x4301fe=function(_0x180267){while(--_0x180267){_0x4a471c['push'](_0x4a471c['shift']());}};_0x4301fe(++_0x4dab35);}(_0x4966,0x11b));var _0x6496=function(_0x3fa59c,_0x2302f9){_0x3fa59c=_0x3fa59c-0x0;var _0x239a2c=_0x4966[_0x3fa59c];return _0x239a2c;};'use strict';var _=require('lodash');var util=require(_0x6496('0x0'));var moment=require(_0x6496('0x1'));var BPromise=require(_0x6496('0x2'));var rs=require(_0x6496('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6496('0x4'));var logger=require(_0x6496('0x5'))(_0x6496('0x6'));var config=require(_0x6496('0x7'));var jayson=require(_0x6496('0x8'));var client=jayson[_0x6496('0x9')][_0x6496('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b8ff7,_0x1671f1,_0x48bc3a){return new BPromise(function(_0x49aea3,_0x20312d){return client['request'](_0x4b8ff7,_0x48bc3a)[_0x6496('0xb')](function(_0x1f9827){logger[_0x6496('0xc')](_0x6496('0xd'),_0x1671f1,_0x6496('0xe'));logger[_0x6496('0xf')](_0x6496('0x10'),_0x1671f1,'request\x20sent',JSON['stringify'](_0x1f9827));if(_0x1f9827['error']){if(_0x1f9827[_0x6496('0x11')][_0x6496('0x12')]===0x1f4){logger['error'](_0x6496('0xd'),_0x1671f1,_0x1f9827[_0x6496('0x11')][_0x6496('0x13')]);return _0x20312d(_0x1f9827[_0x6496('0x11')][_0x6496('0x13')]);}logger[_0x6496('0x11')](_0x6496('0xd'),_0x1671f1,_0x1f9827[_0x6496('0x11')][_0x6496('0x13')]);return _0x49aea3(_0x1f9827[_0x6496('0x11')][_0x6496('0x13')]);}else{logger[_0x6496('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x1671f1,_0x6496('0xe'));_0x49aea3(_0x1f9827['result'][_0x6496('0x13')]);}})[_0x6496('0x14')](function(_0x40adfe){logger[_0x6496('0x11')](_0x6496('0xd'),_0x1671f1,_0x40adfe);_0x20312d(_0x40adfe);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 5cb8ad5..c4c08d6 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 _0xa0e4=['removeSound','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','show','/:id/sounds','getSounds','post','create','addSound','put','delete','destroy','/:id/sounds/:id2'];(function(_0x3fd921,_0x122be6){var _0x123603=function(_0x260dcb){while(--_0x260dcb){_0x3fd921['push'](_0x3fd921['shift']());}};_0x123603(++_0x122be6);}(_0xa0e4,0x12e));var _0x4a0e=function(_0x419b6a,_0x265b43){_0x419b6a=_0x419b6a-0x0;var _0x229232=_0xa0e4[_0x419b6a];return _0x229232;};'use strict';var multer=require('multer');var util=require(_0x4a0e('0x0'));var path=require(_0x4a0e('0x1'));var timeout=require(_0x4a0e('0x2'));var express=require(_0x4a0e('0x3'));var router=express[_0x4a0e('0x4')]();var fs_extra=require(_0x4a0e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4a0e('0x6'));var config=require(_0x4a0e('0x7'));var controller=require(_0x4a0e('0x8'));router['get']('/',auth[_0x4a0e('0x9')](),controller[_0x4a0e('0xa')]);router[_0x4a0e('0xb')](_0x4a0e('0xc'),auth[_0x4a0e('0x9')](),controller[_0x4a0e('0xd')]);router['get'](_0x4a0e('0xe'),auth[_0x4a0e('0x9')](),controller[_0x4a0e('0xf')]);router[_0x4a0e('0x10')]('/',auth[_0x4a0e('0x9')](),controller[_0x4a0e('0x11')]);router[_0x4a0e('0x10')](_0x4a0e('0xe'),auth[_0x4a0e('0x9')](),controller[_0x4a0e('0x12')]);router[_0x4a0e('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4a0e('0x14')](_0x4a0e('0xc'),auth['isAuthenticated'](),controller[_0x4a0e('0x15')]);router['delete'](_0x4a0e('0x16'),auth[_0x4a0e('0x9')](),controller[_0x4a0e('0x17')]);module[_0x4a0e('0x18')]=router; \ No newline at end of file +var _0x080c=['update','destroy','delete','removeSound','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','create','post','addSound','put'];(function(_0x11684d,_0x51bfdf){var _0x30c6f9=function(_0x11cec1){while(--_0x11cec1){_0x11684d['push'](_0x11684d['shift']());}};_0x30c6f9(++_0x51bfdf);}(_0x080c,0x17c));var _0xc080=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x080c[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0xc080('0x0'));var util=require(_0xc080('0x1'));var path=require(_0xc080('0x2'));var timeout=require(_0xc080('0x3'));var express=require(_0xc080('0x4'));var router=express[_0xc080('0x5')]();var fs_extra=require(_0xc080('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc080('0x7'));var config=require('../../config/environment');var controller=require(_0xc080('0x8'));router[_0xc080('0x9')]('/',auth[_0xc080('0xa')](),controller[_0xc080('0xb')]);router[_0xc080('0x9')](_0xc080('0xc'),auth[_0xc080('0xa')](),controller[_0xc080('0xd')]);router[_0xc080('0x9')](_0xc080('0xe'),auth['isAuthenticated'](),controller[_0xc080('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc080('0x10')]);router[_0xc080('0x11')]('/:id/sounds',auth[_0xc080('0xa')](),controller[_0xc080('0x12')]);router[_0xc080('0x13')](_0xc080('0xc'),auth[_0xc080('0xa')](),controller[_0xc080('0x14')]);router['delete'](_0xc080('0xc'),auth[_0xc080('0xa')](),controller[_0xc080('0x15')]);router[_0xc080('0x16')]('/:id/sounds/:id2',auth[_0xc080('0xa')](),controller[_0xc080('0x17')]);module[_0xc080('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index ded68c6..9ce5423 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 _0xf060=['STRING','name','ENUM','files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','exports'];(function(_0xe2d501,_0x453cac){var _0x1c4e7a=function(_0x401ff1){while(--_0x401ff1){_0xe2d501['push'](_0xe2d501['shift']());}};_0x1c4e7a(++_0x453cac);}(_0xf060,0x1ac));var _0x0f06=function(_0x29f1b5,_0x19ac42){_0x29f1b5=_0x29f1b5-0x0;var _0x5bcfbd=_0xf060[_0x29f1b5];return _0x5bcfbd;};'use strict';var Sequelize=require('sequelize');module[_0x0f06('0x0')]={'name':{'type':Sequelize[_0x0f06('0x1')],'allowNull':![],'unique':_0x0f06('0x2')},'mode':{'type':Sequelize[_0x0f06('0x3')]('custom',_0x0f06('0x4'),_0x0f06('0x5'),_0x0f06('0x6'),'quietmp3',_0x0f06('0x7')),'allowNull':!![],'defaultValue':_0x0f06('0x4')},'directory':{'type':Sequelize[_0x0f06('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x0f06('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x0f06('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x0f06('0x1')],'allowNull':!![],'defaultValue':_0x0f06('0x8')},'format':{'type':Sequelize[_0x0f06('0x1')],'allowNull':!![]},'stamp':{'type':_0x0f06('0x9')},'defaultEntry':{'type':Sequelize[_0x0f06('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9ae5=['BOOLEAN','sequelize','STRING','ENUM','files','mp3nb','quietmp3nb','quietmp3','TIMESTAMP'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ae5,0xbe));var _0x59ae=function(_0x7a4cf4,_0x3c9997){_0x7a4cf4=_0x7a4cf4-0x0;var _0x5101f9=_0x9ae5[_0x7a4cf4];return _0x5101f9;};'use strict';var Sequelize=require(_0x59ae('0x0'));module['exports']={'name':{'type':Sequelize[_0x59ae('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x59ae('0x2')]('custom',_0x59ae('0x3'),_0x59ae('0x4'),_0x59ae('0x5'),_0x59ae('0x6'),'mp3'),'allowNull':!![],'defaultValue':_0x59ae('0x3')},'directory':{'type':Sequelize[_0x59ae('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x59ae('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x59ae('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x59ae('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x59ae('0x7')},'defaultEntry':{'type':Sequelize[_0x59ae('0x8')],'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 8e4ffe7..b2f27e6 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 _0x7e00=['VoiceMusicOnHold','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','params','includeAll','find','catch','update','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','get','UserProfileSection','userProfileId','autoAssociation','forEach','rmdirSync','Sequelize','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','extname','symlinkSync','ValidationError','message','findOne','id2','getSounds','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','error','stack','name','send','map'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x7e00,0x17f));var _0x07e0=function(_0x35a5d2,_0x26dd88){_0x35a5d2=_0x35a5d2-0x0;var _0x109435=_0x7e00[_0x35a5d2];return _0x109435;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x07e0('0x0'));var jsonpatch=require(_0x07e0('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x07e0('0x2'));var path=require(_0x07e0('0x3'));var sox=require(_0x07e0('0x4'));var csv=require(_0x07e0('0x5'));var ejs=require(_0x07e0('0x6'));var fs=require('fs');var fs_extra=require(_0x07e0('0x7'));var _=require(_0x07e0('0x8'));var squel=require(_0x07e0('0x9'));var crypto=require(_0x07e0('0xa'));var jsforce=require(_0x07e0('0xb'));var deskjs=require(_0x07e0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x07e0('0xd'));var Papa=require(_0x07e0('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x07e0('0xf'));var as=require(_0x07e0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x07e0('0x11'));var config=require(_0x07e0('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x07e0('0x13'))['db'];function respondWithStatusCode(_0x23f049,_0x3445a0){_0x3445a0=_0x3445a0||0xcc;return function(_0x4849d8){if(_0x4849d8){return _0x23f049[_0x07e0('0x14')](_0x3445a0);}return _0x23f049['status'](_0x3445a0)[_0x07e0('0x15')]();};}function respondWithResult(_0x453fd2,_0x162e6e){_0x162e6e=_0x162e6e||0xc8;return function(_0x269b74){if(_0x269b74){return _0x453fd2[_0x07e0('0x16')](_0x162e6e)[_0x07e0('0x17')](_0x269b74);}};}function respondWithFilteredResult(_0x204258,_0x485cdb){return function(_0x9da39d){if(_0x9da39d){var _0x45bbe2=typeof _0x485cdb[_0x07e0('0x18')]===_0x07e0('0x19')&&typeof _0x485cdb[_0x07e0('0x1a')]==='undefined';var _0x9108ad=_0x9da39d[_0x07e0('0x1b')];var _0x970f6b=_0x45bbe2?0x0:_0x485cdb[_0x07e0('0x18')];var _0x1a23df=_0x45bbe2?_0x9da39d['count']:_0x485cdb[_0x07e0('0x18')]+_0x485cdb[_0x07e0('0x1a')];var _0x16222f;if(_0x1a23df>=_0x9108ad){_0x1a23df=_0x9108ad;_0x16222f=0xc8;}else{_0x16222f=0xce;}_0x204258[_0x07e0('0x16')](_0x16222f);return _0x204258[_0x07e0('0x1c')](_0x07e0('0x1d'),_0x970f6b+'-'+_0x1a23df+'/'+_0x9108ad)[_0x07e0('0x17')](_0x9da39d);}return null;};}function patchUpdates(_0x15e324){return function(_0x33bfd3){try{jsonpatch[_0x07e0('0x1e')](_0x33bfd3,_0x15e324,!![]);}catch(_0x2127d9){return BPromise[_0x07e0('0x1f')](_0x2127d9);}return _0x33bfd3[_0x07e0('0x20')]();};}function saveUpdates(_0x4279a3,_0x157204){return function(_0x1ff197){if(_0x1ff197){return _0x1ff197['update'](_0x4279a3)[_0x07e0('0x21')](function(_0x56910a){return _0x56910a;});}return null;};}function removeEntity(_0x5028f4,_0x3a2139){return function(_0x5697cb){if(_0x5697cb){return _0x5697cb[_0x07e0('0x22')]()['then'](function(){var _0x506f61=_0x5697cb['get']({'plain':!![]});var _0x390d9c='MusicOnHolds';return db[_0x07e0('0x23')][_0x07e0('0x22')]({'where':{'type':_0x390d9c,'resourceId':_0x506f61['id']}})[_0x07e0('0x21')](function(){return _0x5697cb;});})[_0x07e0('0x21')](function(){_0x5028f4[_0x07e0('0x16')](0xcc)[_0x07e0('0x15')]();});}};}function handleEntityNotFound(_0x56d87f,_0x599c78){return function(_0x5b9af5){if(!_0x5b9af5){_0x56d87f[_0x07e0('0x14')](0x194);}return _0x5b9af5;};}function handleError(_0x5ef602,_0x4a7680){_0x4a7680=_0x4a7680||0x1f4;return function(_0x422844){logger[_0x07e0('0x24')](_0x422844[_0x07e0('0x25')]);if(_0x422844['name']){delete _0x422844[_0x07e0('0x26')];}_0x5ef602['status'](_0x4a7680)[_0x07e0('0x27')](_0x422844);};}exports['index']=function(_0x40ed02,_0x4e5c66){var _0x1d41e4={},_0x196a6d={},_0xac9c58={'count':0x0,'rows':[]};var _0x46c146=_[_0x07e0('0x28')](db[_0x07e0('0x29')][_0x07e0('0x2a')],function(_0x224578){return{'name':_0x224578[_0x07e0('0x2b')],'type':_0x224578[_0x07e0('0x2c')][_0x07e0('0x2d')]};});_0x196a6d['model']=_[_0x07e0('0x28')](_0x46c146,_0x07e0('0x26'));_0x196a6d[_0x07e0('0x2e')]=_[_0x07e0('0x2f')](_0x40ed02['query']);_0x196a6d[_0x07e0('0x30')]=_[_0x07e0('0x31')](_0x196a6d[_0x07e0('0x32')],_0x196a6d[_0x07e0('0x2e')]);_0x1d41e4['attributes']=_[_0x07e0('0x31')](_0x196a6d[_0x07e0('0x32')],qs[_0x07e0('0x33')](_0x40ed02[_0x07e0('0x2e')]['fields']));_0x1d41e4[_0x07e0('0x34')]=_0x1d41e4[_0x07e0('0x34')][_0x07e0('0x35')]?_0x1d41e4[_0x07e0('0x34')]:_0x196a6d[_0x07e0('0x32')];if(!_0x40ed02[_0x07e0('0x2e')][_0x07e0('0x36')](_0x07e0('0x37'))){_0x1d41e4['limit']=qs['limit'](_0x40ed02[_0x07e0('0x2e')][_0x07e0('0x1a')]);_0x1d41e4[_0x07e0('0x18')]=qs[_0x07e0('0x18')](_0x40ed02[_0x07e0('0x2e')]['offset']);}_0x1d41e4[_0x07e0('0x38')]=qs[_0x07e0('0x39')](_0x40ed02[_0x07e0('0x2e')][_0x07e0('0x39')]);delete _0x40ed02[_0x07e0('0x2e')][_0x07e0('0x39')];_0x1d41e4[_0x07e0('0x3a')]=qs['filters'](_[_0x07e0('0x3b')](_0x40ed02['query'],_0x196a6d[_0x07e0('0x30')]),_0x46c146);if(_0x40ed02['query']['filter']){_0x1d41e4[_0x07e0('0x3a')]=_[_0x07e0('0x3c')](_0x1d41e4[_0x07e0('0x3a')],{'$or':_[_0x07e0('0x28')](_0x46c146,function(_0x51a3f0){if(_0x51a3f0[_0x07e0('0x2c')]!==_0x07e0('0x3d')){var _0x95a9bf={};_0x95a9bf[_0x51a3f0[_0x07e0('0x26')]]={'$like':'%'+_0x40ed02['query'][_0x07e0('0x3e')]+'%'};return _0x95a9bf;}})});}_0x1d41e4=_[_0x07e0('0x3c')]({},_0x1d41e4,_0x40ed02[_0x07e0('0x3f')]);var _0x349771={'where':_0x1d41e4[_0x07e0('0x3a')]};return db[_0x07e0('0x29')][_0x07e0('0x1b')](_0x349771)[_0x07e0('0x21')](function(_0x4a9033){_0xac9c58[_0x07e0('0x1b')]=_0x4a9033;if(_0x40ed02[_0x07e0('0x2e')]['includeAll']){_0x1d41e4['include']=[{'all':!![]}];}return db[_0x07e0('0x29')][_0x07e0('0x40')](_0x1d41e4);})[_0x07e0('0x21')](function(_0x5a143e){_0xac9c58[_0x07e0('0x41')]=_0x5a143e;return _0xac9c58;})[_0x07e0('0x21')](respondWithFilteredResult(_0x4e5c66,_0x1d41e4))['catch'](handleError(_0x4e5c66,null));};exports['show']=function(_0x5b37c2,_0x1cc804){var _0x5ad7ac={'raw':![],'where':{'id':_0x5b37c2[_0x07e0('0x42')]['id']}},_0x589b78={};_0x589b78[_0x07e0('0x32')]=_[_0x07e0('0x2f')](db[_0x07e0('0x29')][_0x07e0('0x2a')]);_0x589b78['query']=_['keys'](_0x5b37c2[_0x07e0('0x2e')]);_0x589b78[_0x07e0('0x30')]=_[_0x07e0('0x31')](_0x589b78[_0x07e0('0x32')],_0x589b78[_0x07e0('0x2e')]);_0x5ad7ac['attributes']=_['intersection'](_0x589b78[_0x07e0('0x32')],qs[_0x07e0('0x33')](_0x5b37c2[_0x07e0('0x2e')][_0x07e0('0x33')]));_0x5ad7ac['attributes']=_0x5ad7ac[_0x07e0('0x34')][_0x07e0('0x35')]?_0x5ad7ac[_0x07e0('0x34')]:_0x589b78['model'];if(_0x5b37c2['query'][_0x07e0('0x43')]){_0x5ad7ac['include']=[{'all':!![]}];}_0x5ad7ac=_[_0x07e0('0x3c')]({},_0x5ad7ac,_0x5b37c2[_0x07e0('0x3f')]);return db[_0x07e0('0x29')][_0x07e0('0x44')](_0x5ad7ac)[_0x07e0('0x21')](handleEntityNotFound(_0x1cc804,null))[_0x07e0('0x21')](respondWithResult(_0x1cc804,null))[_0x07e0('0x45')](handleError(_0x1cc804,null));};exports[_0x07e0('0x46')]=function(_0x5ac002,_0x49ed9b){if(_0x5ac002[_0x07e0('0x47')]['id']){delete _0x5ac002['body']['id'];}return db[_0x07e0('0x29')]['find']({'where':{'id':_0x5ac002[_0x07e0('0x42')]['id']}})[_0x07e0('0x21')](handleEntityNotFound(_0x49ed9b,null))[_0x07e0('0x21')](saveUpdates(_0x5ac002[_0x07e0('0x47')],null))[_0x07e0('0x21')](respondWithResult(_0x49ed9b,null))[_0x07e0('0x45')](handleError(_0x49ed9b,null));};exports[_0x07e0('0x48')]=function(_0x13bdf4,_0x5c3430,_0x39fa4e){return db[_0x07e0('0x49')][_0x07e0('0x4a')](function(_0x1234f2){if(_0x13bdf4[_0x07e0('0x47')][_0x07e0('0x4b')]===_0x07e0('0x4c')){_0x13bdf4[_0x07e0('0x47')][_0x07e0('0x4d')]=path[_0x07e0('0x4e')](config[_0x07e0('0x4f')],_0x07e0('0x50'),_0x13bdf4[_0x07e0('0x47')]['name']);}return db['VoiceMusicOnHold'][_0x07e0('0x48')](_0x13bdf4[_0x07e0('0x47')],{'transaction':_0x1234f2})[_0x07e0('0x21')](function(_0x398e44){if(_0x13bdf4['body'][_0x07e0('0x4b')]===_0x07e0('0x4c')){fs[_0x07e0('0x51')](_0x398e44['directory'],parseInt(_0x07e0('0x52'),0x8));}var _0x58dc9a=_0x13bdf4[_0x07e0('0x53')][_0x07e0('0x54')]({'plain':!![]});if(!_0x58dc9a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58dc9a['role']===_0x07e0('0x53')){var _0x5ed311=_0x398e44[_0x07e0('0x54')]({'plain':!![]});return db[_0x07e0('0x55')][_0x07e0('0x44')]({'where':{'name':'MusicOnHolds','userProfileId':_0x58dc9a[_0x07e0('0x56')]},'raw':!![]})[_0x07e0('0x21')](function(_0xd46d9c){if(_0xd46d9c&&_0xd46d9c[_0x07e0('0x57')]===0x0){return db[_0x07e0('0x23')][_0x07e0('0x48')]({'name':_0x5ed311[_0x07e0('0x26')],'resourceId':_0x5ed311['id'],'type':_0xd46d9c[_0x07e0('0x26')],'sectionId':_0xd46d9c['id']},{})[_0x07e0('0x21')](function(){return _0x398e44;});}else{return _0x398e44;}})['catch'](function(_0x1f1269){logger[_0x07e0('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f1269);});}return _0x398e44;});})['then'](respondWithResult(_0x5c3430,0xc9))[_0x07e0('0x45')](handleError(_0x5c3430,null));};exports[_0x07e0('0x22')]=function(_0x267986,_0x3a998f,_0x8236a5){var _0x3c5364;return db[_0x07e0('0x29')][_0x07e0('0x44')]({'where':{'id':_0x267986[_0x07e0('0x42')]['id']}})[_0x07e0('0x21')](function(_0x3ba190){if(_0x3ba190){return db[_0x07e0('0x49')]['transaction'](function(_0x32f279){return _0x3ba190[_0x07e0('0x22')]({'transaction':_0x32f279,'raw':!![]})['then'](function(_0x3aacde){if(_0x3aacde[_0x07e0('0x4d')]){fs['readdirSync'](_0x3aacde['directory'])[_0x07e0('0x58')](function(_0x55a8bd){fs['unlinkSync'](path[_0x07e0('0x4e')](_0x3aacde[_0x07e0('0x4d')],_0x55a8bd));});fs[_0x07e0('0x59')](_0x3aacde[_0x07e0('0x4d')]);}return _0x3aacde;});})['catch'](function(_0x1437de){throw new db[(_0x07e0('0x5a'))]['ValidationError'](_0x1437de['message']);});}})[_0x07e0('0x21')](handleEntityNotFound(_0x3a998f,null))[_0x07e0('0x21')](removeEntity(_0x3a998f,null))[_0x07e0('0x45')](handleError(_0x3a998f,null));};exports[_0x07e0('0x5b')]=function(_0x3380ad,_0x3ed57e,_0x12fa1a){return db[_0x07e0('0x49')][_0x07e0('0x4a')](function(_0xe57903){var _0x8540ff;return db[_0x07e0('0x29')][_0x07e0('0x44')]({'where':{'id':_0x3380ad[_0x07e0('0x42')]['id']}})['then'](function(_0x2759d2){if(_0x2759d2){_0x8540ff=_0x2759d2;return _0x2759d2['addSound'](_0x3380ad[_0x07e0('0x47')]['id'],{'transaction':_0xe57903});}})['then'](function(_0x1f994a){if(_0x1f994a){return db[_0x07e0('0x5c')]['findOne']({'where':{'id':_0x3380ad[_0x07e0('0x47')]['id']},'attributes':['id',_0x07e0('0x26'),_0x07e0('0x5d'),_0x07e0('0x5e'),_0x07e0('0x5f')],'raw':!![]});}})[_0x07e0('0x21')](function(_0x1d999d){if(_0x1d999d){var _0x10218e=path[_0x07e0('0x4e')](config[_0x07e0('0x4f')],_0x07e0('0x60'),util['format'](_0x07e0('0x61'),path[_0x07e0('0x62')](_0x1d999d['save_name'],path[_0x07e0('0x63')](_0x1d999d[_0x07e0('0x5d')])),_0x1d999d['converted_format']));var _0x2303c6=path['join'](config['root'],_0x07e0('0x50'),_0x8540ff[_0x07e0('0x26')],util['format'](_0x07e0('0x61'),_0x1d999d[_0x07e0('0x26')],_0x1d999d[_0x07e0('0x5e')]));fs[_0x07e0('0x64')](_0x10218e,_0x2303c6);return _0x1d999d;}})[_0x07e0('0x45')](function(_0x417047){throw new db[(_0x07e0('0x5a'))][(_0x07e0('0x65'))](_0x417047[_0x07e0('0x66')]);});})[_0x07e0('0x21')](handleEntityNotFound(_0x3ed57e,null))[_0x07e0('0x21')](respondWithResult(_0x3ed57e,0xc9))['catch'](handleError(_0x3ed57e,null));};exports['removeSound']=function(_0xb155ac,_0x15a636,_0x31249f){return db['sequelize'][_0x07e0('0x4a')](function(_0x96dd38){var _0x4741ac;return db[_0x07e0('0x29')][_0x07e0('0x67')]({'where':{'id':_0xb155ac[_0x07e0('0x42')]['id']}})['then'](handleEntityNotFound(_0x15a636,null))[_0x07e0('0x21')](function(_0x18c04c){if(_0x18c04c){_0x4741ac=_0x18c04c;return _0x18c04c['removeSound'](_0xb155ac['params'][_0x07e0('0x68')]);}})['then'](function(_0x37f691){if(_0x37f691){return db[_0x07e0('0x5c')][_0x07e0('0x67')]({'where':{'id':_0xb155ac['params'][_0x07e0('0x68')]},'attributes':['id',_0x07e0('0x26'),_0x07e0('0x5d'),_0x07e0('0x5e'),_0x07e0('0x5f')],'raw':!![]});}})[_0x07e0('0x21')](function(_0x552d90){if(_0x552d90){fs['unlinkSync'](path[_0x07e0('0x4e')](_0x4741ac[_0x07e0('0x4d')],util['format'](_0x07e0('0x61'),_0x552d90[_0x07e0('0x26')],_0x552d90[_0x07e0('0x5e')])));return _0x552d90;}})['catch'](function(_0x2b01c5){throw new db[(_0x07e0('0x5a'))][(_0x07e0('0x65'))](_0x2b01c5[_0x07e0('0x66')]);});})['then'](handleEntityNotFound(_0x15a636,null))['then'](respondWithStatusCode(_0x15a636,0xcc))[_0x07e0('0x45')](handleError(_0x15a636,null));};exports[_0x07e0('0x69')]=function(_0xc0b4f1,_0x47e911,_0x404954){var _0x150781={};var _0x3782fb={};var _0x2b3687;var _0x442666;return db[_0x07e0('0x29')][_0x07e0('0x67')]({'where':{'id':_0xc0b4f1['params']['id']}})[_0x07e0('0x21')](handleEntityNotFound(_0x47e911,null))[_0x07e0('0x21')](function(_0x4469e4){if(_0x4469e4){_0x2b3687=_0x4469e4;_0x3782fb['model']=_['keys'](db[_0x07e0('0x5c')][_0x07e0('0x2a')]);_0x3782fb[_0x07e0('0x2e')]=_['keys'](_0xc0b4f1[_0x07e0('0x2e')]);_0x3782fb[_0x07e0('0x30')]=_[_0x07e0('0x31')](_0x3782fb[_0x07e0('0x32')],_0x3782fb['query']);_0x150781[_0x07e0('0x34')]=_[_0x07e0('0x31')](_0x3782fb[_0x07e0('0x32')],qs['fields'](_0xc0b4f1[_0x07e0('0x2e')]['fields']));_0x150781[_0x07e0('0x34')]=_0x150781[_0x07e0('0x34')]['length']?_0x150781[_0x07e0('0x34')]:_0x3782fb['model'];_0x150781[_0x07e0('0x38')]=qs[_0x07e0('0x39')](_0xc0b4f1[_0x07e0('0x2e')][_0x07e0('0x39')]);_0x150781[_0x07e0('0x3a')]=qs['filters'](_[_0x07e0('0x3b')](_0xc0b4f1['query'],_0x3782fb[_0x07e0('0x30')]));if(_0xc0b4f1['query'][_0x07e0('0x3e')]){_0x150781[_0x07e0('0x3a')]=_[_0x07e0('0x3c')](_0x150781[_0x07e0('0x3a')],{'$or':_['map'](_0x150781[_0x07e0('0x34')],function(_0x881ca4){var _0x33e25e={};_0x33e25e[_0x881ca4]={'$like':'%'+_0xc0b4f1[_0x07e0('0x2e')][_0x07e0('0x3e')]+'%'};return _0x33e25e;})});}_0x150781=_[_0x07e0('0x3c')]({},_0x150781,_0xc0b4f1[_0x07e0('0x3f')]);return _0x2b3687[_0x07e0('0x69')](_0x150781);}})['then'](function(_0x41d890){if(_0x41d890){_0x442666=_0x41d890[_0x07e0('0x35')];if(!_0xc0b4f1[_0x07e0('0x2e')][_0x07e0('0x36')](_0x07e0('0x37'))){_0x150781[_0x07e0('0x1a')]=qs[_0x07e0('0x1a')](_0xc0b4f1[_0x07e0('0x2e')][_0x07e0('0x1a')]);_0x150781[_0x07e0('0x18')]=qs[_0x07e0('0x18')](_0xc0b4f1['query'][_0x07e0('0x18')]);}return _0x2b3687[_0x07e0('0x69')](_0x150781);}})[_0x07e0('0x21')](function(_0x37b556){if(_0x37b556){return _0x37b556?{'count':_0x442666,'rows':_0x37b556}:null;}})[_0x07e0('0x21')](respondWithResult(_0x47e911,null))['catch'](handleError(_0x47e911,null));}; \ No newline at end of file +var _0x14a6=['length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','body','create','sequelize','mode','files','directory','root','server/files/moh','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','transaction','readdirSync','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','converted_format','server/files/sounds/converted','format','%s.%s','basename','extname','save_name','symlinkSync','removeSound','id2','createdAt','getSounds','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','Content-Range','apply','reject','update','then','destroy','get','MusicOnHolds','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x14a6,0x125));var _0x614a=function(_0x4d18c2,_0x9b85d0){_0x4d18c2=_0x4d18c2-0x0;var _0x1cadf9=_0x14a6[_0x4d18c2];return _0x1cadf9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x614a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x614a('0x1'));var moment=require(_0x614a('0x2'));var BPromise=require(_0x614a('0x3'));var Mustache=require(_0x614a('0x4'));var util=require(_0x614a('0x5'));var path=require(_0x614a('0x6'));var sox=require(_0x614a('0x7'));var csv=require(_0x614a('0x8'));var ejs=require(_0x614a('0x9'));var fs=require('fs');var fs_extra=require(_0x614a('0xa'));var _=require(_0x614a('0xb'));var squel=require(_0x614a('0xc'));var crypto=require(_0x614a('0xd'));var jsforce=require(_0x614a('0xe'));var deskjs=require(_0x614a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x614a('0x10'));var Papa=require(_0x614a('0x11'));var Redis=require(_0x614a('0x12'));var authService=require(_0x614a('0x13'));var qs=require(_0x614a('0x14'));var as=require(_0x614a('0x15'));var hardwareService=require(_0x614a('0x16'));var logger=require(_0x614a('0x17'))(_0x614a('0x18'));var utils=require(_0x614a('0x19'));var config=require(_0x614a('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x614a('0x1b'))['db'];function respondWithStatusCode(_0x18448e,_0x38f117){_0x38f117=_0x38f117||0xcc;return function(_0x2478f1){if(_0x2478f1){return _0x18448e[_0x614a('0x1c')](_0x38f117);}return _0x18448e['status'](_0x38f117)[_0x614a('0x1d')]();};}function respondWithResult(_0x199c59,_0x20e115){_0x20e115=_0x20e115||0xc8;return function(_0x10837f){if(_0x10837f){return _0x199c59['status'](_0x20e115)[_0x614a('0x1e')](_0x10837f);}};}function respondWithFilteredResult(_0x450e48,_0x21cf17){return function(_0x345e49){if(_0x345e49){var _0x34ddef=typeof _0x21cf17['offset']===_0x614a('0x1f')&&typeof _0x21cf17[_0x614a('0x20')]==='undefined';var _0x20e178=_0x345e49[_0x614a('0x21')];var _0x536724=_0x34ddef?0x0:_0x21cf17['offset'];var _0x4abc73=_0x34ddef?_0x345e49[_0x614a('0x21')]:_0x21cf17[_0x614a('0x22')]+_0x21cf17[_0x614a('0x20')];var _0x4fb491;if(_0x4abc73>=_0x20e178){_0x4abc73=_0x20e178;_0x4fb491=0xc8;}else{_0x4fb491=0xce;}_0x450e48[_0x614a('0x23')](_0x4fb491);return _0x450e48['set'](_0x614a('0x24'),_0x536724+'-'+_0x4abc73+'/'+_0x20e178)[_0x614a('0x1e')](_0x345e49);}return null;};}function patchUpdates(_0x59aab8){return function(_0x49ebf4){try{jsonpatch[_0x614a('0x25')](_0x49ebf4,_0x59aab8,!![]);}catch(_0x354a66){return BPromise[_0x614a('0x26')](_0x354a66);}return _0x49ebf4['save']();};}function saveUpdates(_0x37571c,_0x4322a8){return function(_0x5707ba){if(_0x5707ba){return _0x5707ba[_0x614a('0x27')](_0x37571c)[_0x614a('0x28')](function(_0x366b4f){return _0x366b4f;});}return null;};}function removeEntity(_0x3414e,_0x49e916){return function(_0x2b7420){if(_0x2b7420){return _0x2b7420[_0x614a('0x29')]()[_0x614a('0x28')](function(){var _0x1fb9a2=_0x2b7420[_0x614a('0x2a')]({'plain':!![]});var _0xaef4e4=_0x614a('0x2b');return db['UserProfileResource'][_0x614a('0x29')]({'where':{'type':_0xaef4e4,'resourceId':_0x1fb9a2['id']}})[_0x614a('0x28')](function(){return _0x2b7420;});})[_0x614a('0x28')](function(){_0x3414e[_0x614a('0x23')](0xcc)[_0x614a('0x1d')]();});}};}function handleEntityNotFound(_0x246d1f,_0xede8d1){return function(_0x2ffb18){if(!_0x2ffb18){_0x246d1f[_0x614a('0x1c')](0x194);}return _0x2ffb18;};}function handleError(_0x31966f,_0x4a17ae){_0x4a17ae=_0x4a17ae||0x1f4;return function(_0x282622){logger['error'](_0x282622[_0x614a('0x2c')]);if(_0x282622[_0x614a('0x2d')]){delete _0x282622[_0x614a('0x2d')];}_0x31966f['status'](_0x4a17ae)[_0x614a('0x2e')](_0x282622);};}exports[_0x614a('0x2f')]=function(_0x209f43,_0x1eb460){var _0x30282f={},_0x4a2ec7={},_0x4ae97d={'count':0x0,'rows':[]};var _0x567182=_[_0x614a('0x30')](db[_0x614a('0x31')][_0x614a('0x32')],function(_0x4d19cb){return{'name':_0x4d19cb[_0x614a('0x33')],'type':_0x4d19cb[_0x614a('0x34')][_0x614a('0x35')]};});_0x4a2ec7[_0x614a('0x36')]=_[_0x614a('0x30')](_0x567182,_0x614a('0x2d'));_0x4a2ec7[_0x614a('0x37')]=_[_0x614a('0x38')](_0x209f43[_0x614a('0x37')]);_0x4a2ec7[_0x614a('0x39')]=_[_0x614a('0x3a')](_0x4a2ec7[_0x614a('0x36')],_0x4a2ec7[_0x614a('0x37')]);_0x30282f[_0x614a('0x3b')]=_[_0x614a('0x3a')](_0x4a2ec7['model'],qs[_0x614a('0x3c')](_0x209f43[_0x614a('0x37')]['fields']));_0x30282f['attributes']=_0x30282f[_0x614a('0x3b')][_0x614a('0x3d')]?_0x30282f[_0x614a('0x3b')]:_0x4a2ec7[_0x614a('0x36')];if(!_0x209f43[_0x614a('0x37')][_0x614a('0x3e')](_0x614a('0x3f'))){_0x30282f[_0x614a('0x20')]=qs[_0x614a('0x20')](_0x209f43[_0x614a('0x37')][_0x614a('0x20')]);_0x30282f['offset']=qs[_0x614a('0x22')](_0x209f43[_0x614a('0x37')][_0x614a('0x22')]);}_0x30282f[_0x614a('0x40')]=qs[_0x614a('0x41')](_0x209f43['query'][_0x614a('0x41')]);delete _0x209f43['query'][_0x614a('0x41')];_0x30282f['where']=qs[_0x614a('0x39')](_[_0x614a('0x42')](_0x209f43[_0x614a('0x37')],_0x4a2ec7[_0x614a('0x39')]),_0x567182);if(_0x209f43['query'][_0x614a('0x43')]){_0x30282f[_0x614a('0x44')]=_[_0x614a('0x45')](_0x30282f[_0x614a('0x44')],{'$or':_[_0x614a('0x30')](_0x567182,function(_0xbaa30e){if(_0xbaa30e['type']!==_0x614a('0x46')){var _0x23f75d={};_0x23f75d[_0xbaa30e[_0x614a('0x2d')]]={'$like':'%'+_0x209f43[_0x614a('0x37')][_0x614a('0x43')]+'%'};return _0x23f75d;}})});}_0x30282f=_[_0x614a('0x45')]({},_0x30282f,_0x209f43[_0x614a('0x47')]);var _0x30a9f9={'where':_0x30282f[_0x614a('0x44')]};return db['VoiceMusicOnHold'][_0x614a('0x21')](_0x30a9f9)[_0x614a('0x28')](function(_0x3fe3c4){_0x4ae97d[_0x614a('0x21')]=_0x3fe3c4;if(_0x209f43[_0x614a('0x37')][_0x614a('0x48')]){_0x30282f[_0x614a('0x49')]=[{'all':!![]}];}return db[_0x614a('0x31')][_0x614a('0x4a')](_0x30282f);})[_0x614a('0x28')](function(_0x196021){_0x4ae97d[_0x614a('0x4b')]=_0x196021;return _0x4ae97d;})['then'](respondWithFilteredResult(_0x1eb460,_0x30282f))[_0x614a('0x4c')](handleError(_0x1eb460,null));};exports['show']=function(_0x791e1,_0xea20d8){var _0x312b7c={'raw':![],'where':{'id':_0x791e1['params']['id']}},_0x3ce1c9={};_0x3ce1c9['model']=_['keys'](db[_0x614a('0x31')][_0x614a('0x32')]);_0x3ce1c9[_0x614a('0x37')]=_[_0x614a('0x38')](_0x791e1['query']);_0x3ce1c9[_0x614a('0x39')]=_[_0x614a('0x3a')](_0x3ce1c9[_0x614a('0x36')],_0x3ce1c9[_0x614a('0x37')]);_0x312b7c[_0x614a('0x3b')]=_[_0x614a('0x3a')](_0x3ce1c9[_0x614a('0x36')],qs[_0x614a('0x3c')](_0x791e1[_0x614a('0x37')][_0x614a('0x3c')]));_0x312b7c[_0x614a('0x3b')]=_0x312b7c[_0x614a('0x3b')]['length']?_0x312b7c[_0x614a('0x3b')]:_0x3ce1c9[_0x614a('0x36')];if(_0x791e1[_0x614a('0x37')][_0x614a('0x48')]){_0x312b7c[_0x614a('0x49')]=[{'all':!![]}];}_0x312b7c=_[_0x614a('0x45')]({},_0x312b7c,_0x791e1[_0x614a('0x47')]);return db[_0x614a('0x31')][_0x614a('0x4d')](_0x312b7c)[_0x614a('0x28')](handleEntityNotFound(_0xea20d8,null))['then'](respondWithResult(_0xea20d8,null))[_0x614a('0x4c')](handleError(_0xea20d8,null));};exports['update']=function(_0x5795c1,_0x48e827){if(_0x5795c1[_0x614a('0x4e')]['id']){delete _0x5795c1[_0x614a('0x4e')]['id'];}return db[_0x614a('0x31')][_0x614a('0x4d')]({'where':{'id':_0x5795c1['params']['id']}})['then'](handleEntityNotFound(_0x48e827,null))[_0x614a('0x28')](saveUpdates(_0x5795c1[_0x614a('0x4e')],null))[_0x614a('0x28')](respondWithResult(_0x48e827,null))[_0x614a('0x4c')](handleError(_0x48e827,null));};exports[_0x614a('0x4f')]=function(_0x383bea,_0x4e50dd,_0x4419a5){return db[_0x614a('0x50')]['transaction'](function(_0x141896){if(_0x383bea[_0x614a('0x4e')][_0x614a('0x51')]===_0x614a('0x52')){_0x383bea[_0x614a('0x4e')][_0x614a('0x53')]=path['join'](config[_0x614a('0x54')],_0x614a('0x55'),_0x383bea[_0x614a('0x4e')][_0x614a('0x2d')]);}return db[_0x614a('0x31')]['create'](_0x383bea[_0x614a('0x4e')],{'transaction':_0x141896})[_0x614a('0x28')](function(_0x1fe41e){if(_0x383bea[_0x614a('0x4e')][_0x614a('0x51')]===_0x614a('0x52')){fs['mkdirSync'](_0x1fe41e[_0x614a('0x53')],parseInt(_0x614a('0x56'),0x8));}var _0x19275f=_0x383bea['user'][_0x614a('0x2a')]({'plain':!![]});if(!_0x19275f)throw new Error(_0x614a('0x57'));if(_0x19275f[_0x614a('0x58')]==='user'){var _0x46f4a7=_0x1fe41e['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x614a('0x2b'),'userProfileId':_0x19275f[_0x614a('0x59')]},'raw':!![]})[_0x614a('0x28')](function(_0x285202){if(_0x285202&&_0x285202['autoAssociation']===0x0){return db[_0x614a('0x5a')][_0x614a('0x4f')]({'name':_0x46f4a7['name'],'resourceId':_0x46f4a7['id'],'type':_0x285202[_0x614a('0x2d')],'sectionId':_0x285202['id']},{})[_0x614a('0x28')](function(){return _0x1fe41e;});}else{return _0x1fe41e;}})[_0x614a('0x4c')](function(_0x8c7903){logger[_0x614a('0x5b')](_0x614a('0x5c'),_0x8c7903);});}return _0x1fe41e;});})[_0x614a('0x28')](respondWithResult(_0x4e50dd,0xc9))[_0x614a('0x4c')](handleError(_0x4e50dd,null));};exports[_0x614a('0x29')]=function(_0x4bcef8,_0xb2b4ce,_0x6db8a4){var _0x5b6bad;return db['VoiceMusicOnHold'][_0x614a('0x4d')]({'where':{'id':_0x4bcef8[_0x614a('0x5d')]['id']}})[_0x614a('0x28')](function(_0x2f60f1){if(_0x2f60f1){return db[_0x614a('0x50')][_0x614a('0x5e')](function(_0x1e8fed){return _0x2f60f1[_0x614a('0x29')]({'transaction':_0x1e8fed,'raw':!![]})[_0x614a('0x28')](function(_0x2ba8ca){if(_0x2ba8ca[_0x614a('0x53')]){fs[_0x614a('0x5f')](_0x2ba8ca[_0x614a('0x53')])[_0x614a('0x60')](function(_0x1f7674){fs[_0x614a('0x61')](path[_0x614a('0x62')](_0x2ba8ca['directory'],_0x1f7674));});fs[_0x614a('0x63')](_0x2ba8ca[_0x614a('0x53')]);}return _0x2ba8ca;});})[_0x614a('0x4c')](function(_0x5f1959){throw new db[(_0x614a('0x64'))][(_0x614a('0x65'))](_0x5f1959[_0x614a('0x66')]);});}})[_0x614a('0x28')](handleEntityNotFound(_0xb2b4ce,null))[_0x614a('0x28')](removeEntity(_0xb2b4ce,null))[_0x614a('0x4c')](handleError(_0xb2b4ce,null));};exports[_0x614a('0x67')]=function(_0x493c0c,_0xba7135,_0x181c83){return db[_0x614a('0x50')][_0x614a('0x5e')](function(_0x36d823){var _0x3d9d1e;return db[_0x614a('0x31')][_0x614a('0x4d')]({'where':{'id':_0x493c0c[_0x614a('0x5d')]['id']}})['then'](function(_0x3c0a3f){if(_0x3c0a3f){_0x3d9d1e=_0x3c0a3f;return _0x3c0a3f[_0x614a('0x67')](_0x493c0c['body']['id'],{'transaction':_0x36d823});}})[_0x614a('0x28')](function(_0x17905c){if(_0x17905c){return db[_0x614a('0x68')][_0x614a('0x69')]({'where':{'id':_0x493c0c['body']['id']},'attributes':['id',_0x614a('0x2d'),'save_name',_0x614a('0x6a'),'createdAt'],'raw':!![]});}})['then'](function(_0x51af6a){if(_0x51af6a){var _0x73b9bb=path[_0x614a('0x62')](config[_0x614a('0x54')],_0x614a('0x6b'),util[_0x614a('0x6c')](_0x614a('0x6d'),path[_0x614a('0x6e')](_0x51af6a['save_name'],path[_0x614a('0x6f')](_0x51af6a[_0x614a('0x70')])),_0x51af6a['converted_format']));var _0x261361=path['join'](config['root'],'server/files/moh',_0x3d9d1e[_0x614a('0x2d')],util[_0x614a('0x6c')](_0x614a('0x6d'),_0x51af6a[_0x614a('0x2d')],_0x51af6a[_0x614a('0x6a')]));fs[_0x614a('0x71')](_0x73b9bb,_0x261361);return _0x51af6a;}})['catch'](function(_0xafc090){throw new db[(_0x614a('0x64'))]['ValidationError'](_0xafc090[_0x614a('0x66')]);});})[_0x614a('0x28')](handleEntityNotFound(_0xba7135,null))[_0x614a('0x28')](respondWithResult(_0xba7135,0xc9))[_0x614a('0x4c')](handleError(_0xba7135,null));};exports[_0x614a('0x72')]=function(_0x4ced3f,_0x145146,_0x13b3b3){return db['sequelize'][_0x614a('0x5e')](function(_0x45934c){var _0x1ebd35;return db[_0x614a('0x31')]['findOne']({'where':{'id':_0x4ced3f['params']['id']}})[_0x614a('0x28')](handleEntityNotFound(_0x145146,null))[_0x614a('0x28')](function(_0xbfcc00){if(_0xbfcc00){_0x1ebd35=_0xbfcc00;return _0xbfcc00['removeSound'](_0x4ced3f[_0x614a('0x5d')][_0x614a('0x73')]);}})[_0x614a('0x28')](function(_0x15261d){if(_0x15261d){return db[_0x614a('0x68')][_0x614a('0x69')]({'where':{'id':_0x4ced3f[_0x614a('0x5d')][_0x614a('0x73')]},'attributes':['id',_0x614a('0x2d'),'save_name',_0x614a('0x6a'),_0x614a('0x74')],'raw':!![]});}})['then'](function(_0x4270fc){if(_0x4270fc){fs['unlinkSync'](path[_0x614a('0x62')](_0x1ebd35[_0x614a('0x53')],util['format'](_0x614a('0x6d'),_0x4270fc[_0x614a('0x2d')],_0x4270fc[_0x614a('0x6a')])));return _0x4270fc;}})['catch'](function(_0x1114bb){throw new db[(_0x614a('0x64'))][(_0x614a('0x65'))](_0x1114bb[_0x614a('0x66')]);});})[_0x614a('0x28')](handleEntityNotFound(_0x145146,null))[_0x614a('0x28')](respondWithStatusCode(_0x145146,0xcc))[_0x614a('0x4c')](handleError(_0x145146,null));};exports[_0x614a('0x75')]=function(_0x45d89c,_0x5a9c0a,_0x24ae48){var _0x46adc8={};var _0x20c021={};var _0xd60f9f;var _0x41c536;return db[_0x614a('0x31')][_0x614a('0x69')]({'where':{'id':_0x45d89c[_0x614a('0x5d')]['id']}})[_0x614a('0x28')](handleEntityNotFound(_0x5a9c0a,null))[_0x614a('0x28')](function(_0x191730){if(_0x191730){_0xd60f9f=_0x191730;_0x20c021[_0x614a('0x36')]=_[_0x614a('0x38')](db[_0x614a('0x68')][_0x614a('0x32')]);_0x20c021['query']=_['keys'](_0x45d89c['query']);_0x20c021['filters']=_[_0x614a('0x3a')](_0x20c021[_0x614a('0x36')],_0x20c021[_0x614a('0x37')]);_0x46adc8[_0x614a('0x3b')]=_[_0x614a('0x3a')](_0x20c021['model'],qs[_0x614a('0x3c')](_0x45d89c['query']['fields']));_0x46adc8['attributes']=_0x46adc8[_0x614a('0x3b')][_0x614a('0x3d')]?_0x46adc8['attributes']:_0x20c021[_0x614a('0x36')];_0x46adc8['order']=qs['sort'](_0x45d89c[_0x614a('0x37')][_0x614a('0x41')]);_0x46adc8[_0x614a('0x44')]=qs['filters'](_['pick'](_0x45d89c[_0x614a('0x37')],_0x20c021['filters']));if(_0x45d89c[_0x614a('0x37')][_0x614a('0x43')]){_0x46adc8[_0x614a('0x44')]=_[_0x614a('0x45')](_0x46adc8[_0x614a('0x44')],{'$or':_[_0x614a('0x30')](_0x46adc8[_0x614a('0x3b')],function(_0x3fcea0){var _0x165880={};_0x165880[_0x3fcea0]={'$like':'%'+_0x45d89c[_0x614a('0x37')][_0x614a('0x43')]+'%'};return _0x165880;})});}_0x46adc8=_[_0x614a('0x45')]({},_0x46adc8,_0x45d89c[_0x614a('0x47')]);return _0xd60f9f[_0x614a('0x75')](_0x46adc8);}})[_0x614a('0x28')](function(_0x4bbaa4){if(_0x4bbaa4){_0x41c536=_0x4bbaa4[_0x614a('0x3d')];if(!_0x45d89c['query'][_0x614a('0x3e')](_0x614a('0x3f'))){_0x46adc8['limit']=qs[_0x614a('0x20')](_0x45d89c[_0x614a('0x37')]['limit']);_0x46adc8[_0x614a('0x22')]=qs['offset'](_0x45d89c[_0x614a('0x37')][_0x614a('0x22')]);}return _0xd60f9f['getSounds'](_0x46adc8);}})[_0x614a('0x28')](function(_0x1ff828){if(_0x1ff828){return _0x1ff828?{'count':_0x41c536,'rows':_0x1ff828}:null;}})[_0x614a('0x28')](respondWithResult(_0x5a9c0a,null))['catch'](handleError(_0x5a9c0a,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index a28ab80..f933d5a 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 _0xf4f9=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf4f9,0x134));var _0x9f4f=function(_0x2aac3d,_0x5df9f5){_0x2aac3d=_0x2aac3d-0x0;var _0x4ff386=_0xf4f9[_0x2aac3d];return _0x4ff386;};'use strict';var _=require(_0x9f4f('0x0'));var util=require(_0x9f4f('0x1'));var logger=require(_0x9f4f('0x2'))(_0x9f4f('0x3'));var moment=require(_0x9f4f('0x4'));var BPromise=require('bluebird');var rp=require(_0x9f4f('0x5'));var fs=require('fs');var path=require(_0x9f4f('0x6'));var rimraf=require(_0x9f4f('0x7'));var config=require(_0x9f4f('0x8'));var attributes=require(_0x9f4f('0x9'));module[_0x9f4f('0xa')]=function(_0x25380e,_0x2f3549){return _0x25380e[_0x9f4f('0xb')](_0x9f4f('0xc'),attributes,{'tableName':_0x9f4f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe691=['VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x24722c,_0x2c3a80){var _0x46c402=function(_0x58f48e){while(--_0x58f48e){_0x24722c['push'](_0x24722c['shift']());}};_0x46c402(++_0x2c3a80);}(_0xe691,0x120));var _0x1e69=function(_0x4db46b,_0xadcb1a){_0x4db46b=_0x4db46b-0x0;var _0x565be8=_0xe691[_0x4db46b];return _0x565be8;};'use strict';var _=require(_0x1e69('0x0'));var util=require(_0x1e69('0x1'));var logger=require(_0x1e69('0x2'))(_0x1e69('0x3'));var moment=require('moment');var BPromise=require(_0x1e69('0x4'));var rp=require(_0x1e69('0x5'));var fs=require('fs');var path=require(_0x1e69('0x6'));var rimraf=require(_0x1e69('0x7'));var config=require(_0x1e69('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x1e69('0x9')]=function(_0x154f30,_0x3ddfe1){return _0x154f30[_0x1e69('0xa')](_0x1e69('0xb'),attributes,{'tableName':_0x1e69('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 513709a..f7d13b7 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 _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(_0x3510f1,_0x22c6bc){var _0x26a37d=function(_0x1c9886){while(--_0x1c9886){_0x3510f1['push'](_0x3510f1['shift']());}};_0x26a37d(++_0x22c6bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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','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(_0xddebfa,_0x3c8a63){var _0x47cfb8=function(_0x53c33d){while(--_0x53c33d){_0xddebfa['push'](_0xddebfa['shift']());}};_0x47cfb8(++_0x3c8a63);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 7a29cfb..80e3098 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 _0x03d2=['Router','fs-extra','../../components/auth/service','./voicePrefix.controller','index','get','isAuthenticated','show','/:id/users','/:id/teams','post','create','addAgents','addTeams','put','/:id','destroy','removeAgents','delete','exports','multer','util','path'];(function(_0x474a31,_0x4ba9cd){var _0x355f3e=function(_0x34abfd){while(--_0x34abfd){_0x474a31['push'](_0x474a31['shift']());}};_0x355f3e(++_0x4ba9cd);}(_0x03d2,0xe3));var _0x203d=function(_0x1c07da,_0x18bf94){_0x1c07da=_0x1c07da-0x0;var _0x399e50=_0x03d2[_0x1c07da];return _0x399e50;};'use strict';var multer=require(_0x203d('0x0'));var util=require(_0x203d('0x1'));var path=require(_0x203d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x203d('0x3')]();var fs_extra=require(_0x203d('0x4'));var auth=require(_0x203d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x203d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x203d('0x7')]);router[_0x203d('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x203d('0x8')]('/:id',auth[_0x203d('0x9')](),controller[_0x203d('0xa')]);router['get'](_0x203d('0xb'),auth[_0x203d('0x9')](),controller['getAgents']);router[_0x203d('0x8')](_0x203d('0xc'),auth[_0x203d('0x9')](),controller['getTeams']);router[_0x203d('0xd')]('/',auth[_0x203d('0x9')](),controller[_0x203d('0xe')]);router[_0x203d('0xd')](_0x203d('0xb'),auth[_0x203d('0x9')](),controller[_0x203d('0xf')]);router[_0x203d('0xd')](_0x203d('0xc'),auth[_0x203d('0x9')](),controller[_0x203d('0x10')]);router[_0x203d('0x11')]('/:id',auth[_0x203d('0x9')](),controller['update']);router['delete'](_0x203d('0x12'),auth[_0x203d('0x9')](),controller[_0x203d('0x13')]);router['delete'](_0x203d('0xb'),auth[_0x203d('0x9')](),controller[_0x203d('0x14')]);router[_0x203d('0x15')](_0x203d('0xc'),auth[_0x203d('0x9')](),controller['removeTeams']);module[_0x203d('0x16')]=router; \ No newline at end of file +var _0x567c=['/describe','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','create','post','addAgents','addTeams','put','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0x567c,0x8d));var _0xc567=function(_0x555c42,_0x1aad30){_0x555c42=_0x555c42-0x0;var _0x482a6b=_0x567c[_0x555c42];return _0x482a6b;};'use strict';var multer=require(_0xc567('0x0'));var util=require(_0xc567('0x1'));var path=require(_0xc567('0x2'));var timeout=require(_0xc567('0x3'));var express=require(_0xc567('0x4'));var router=express[_0xc567('0x5')]();var fs_extra=require(_0xc567('0x6'));var auth=require(_0xc567('0x7'));var interaction=require(_0xc567('0x8'));var config=require(_0xc567('0x9'));var controller=require(_0xc567('0xa'));router[_0xc567('0xb')]('/',auth[_0xc567('0xc')](),controller[_0xc567('0xd')]);router[_0xc567('0xb')](_0xc567('0xe'),auth[_0xc567('0xc')](),controller[_0xc567('0xf')]);router[_0xc567('0xb')](_0xc567('0x10'),auth[_0xc567('0xc')](),controller[_0xc567('0x11')]);router['get'](_0xc567('0x12'),auth['isAuthenticated'](),controller[_0xc567('0x13')]);router[_0xc567('0xb')](_0xc567('0x14'),auth['isAuthenticated'](),controller[_0xc567('0x15')]);router['post']('/',auth[_0xc567('0xc')](),controller[_0xc567('0x16')]);router[_0xc567('0x17')](_0xc567('0x12'),auth['isAuthenticated'](),controller[_0xc567('0x18')]);router[_0xc567('0x17')](_0xc567('0x14'),auth['isAuthenticated'](),controller[_0xc567('0x19')]);router[_0xc567('0x1a')](_0xc567('0x10'),auth['isAuthenticated'](),controller[_0xc567('0x1b')]);router[_0xc567('0x1c')]('/:id',auth[_0xc567('0xc')](),controller[_0xc567('0x1d')]);router[_0xc567('0x1c')]('/:id/users',auth[_0xc567('0xc')](),controller[_0xc567('0x1e')]);router[_0xc567('0x1c')](_0xc567('0x14'),auth['isAuthenticated'](),controller['removeTeams']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index ec8fe5e..da1d8fc 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 _0x853b=['name','INTEGER','exports','STRING','getDataValue'];(function(_0x3cd7aa,_0x21ac22){var _0x22d00c=function(_0x10674f){while(--_0x10674f){_0x3cd7aa['push'](_0x3cd7aa['shift']());}};_0x22d00c(++_0x21ac22);}(_0x853b,0x183));var _0xb853=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x853b[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0xb853('0x0')]={'name':{'type':Sequelize[_0xb853('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x2440dd){return'system-'+this[_0xb853('0x2')](_0xb853('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xb853('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xb853('0x4')]}}; \ No newline at end of file +var _0x734b=['getDataValue','STRING','INTEGER','sequelize','exports','name','VIRTUAL','system-'];(function(_0x11b5c5,_0x237c33){var _0x1e94a3=function(_0x591373){while(--_0x591373){_0x11b5c5['push'](_0x11b5c5['shift']());}};_0x1e94a3(++_0x237c33);}(_0x734b,0x173));var _0xb734=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x734b[_0x1b4b23];return _0x2a325b;};'use strict';var Sequelize=require(_0xb734('0x0'));module[_0xb734('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb734('0x2')},'prefix':{'type':Sequelize[_0xb734('0x3')],'get':function(_0x341342){return _0xb734('0x4')+this[_0xb734('0x5')](_0xb734('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xb734('0x6')]},'VoiceExtensionId':{'type':Sequelize[_0xb734('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 0aedf2b..013bfe3 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 _0x583c=['fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','VoicePrefix','fieldName','type','model','query','keys','filters','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','intersection','length','include','find','describe','create','sequelize','transaction','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','exten','app','system','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','context','${EXTEN:','charAt','system-','VoiceExtension','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','filter','Team','hasOwnProperty','getTeams','addTeams','Agents','online','voicePause','flatMap','each','UserVoicePrefix','removeTeams','select','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','all','union','compact','value','isEmpty','forEach','eml-format','rimraf','zip-dir'];(function(_0xb533a9,_0x18b6da){var _0x574c4e=function(_0x4d3568){while(--_0x4d3568){_0xb533a9['push'](_0xb533a9['shift']());}};_0x574c4e(++_0x18b6da);}(_0x583c,0x12b));var _0xc583=function(_0x547e20,_0x284545){_0x547e20=_0x547e20-0x0;var _0x359171=_0x583c[_0x547e20];return _0x359171;};'use strict';var emlformat=require(_0xc583('0x0'));var rimraf=require(_0xc583('0x1'));var zipdir=require(_0xc583('0x2'));var jsonpatch=require(_0xc583('0x3'));var rp=require('request-promise');var moment=require(_0xc583('0x4'));var BPromise=require(_0xc583('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc583('0x6'));var sox=require(_0xc583('0x7'));var csv=require('to-csv');var ejs=require(_0xc583('0x8'));var fs=require('fs');var fs_extra=require(_0xc583('0x9'));var _=require(_0xc583('0xa'));var squel=require(_0xc583('0xb'));var crypto=require('crypto');var jsforce=require(_0xc583('0xc'));var deskjs=require(_0xc583('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc583('0xe'));var Papa=require(_0xc583('0xf'));var Redis=require(_0xc583('0x10'));var authService=require(_0xc583('0x11'));var qs=require(_0xc583('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc583('0x13'));var logger=require(_0xc583('0x14'))('api');var utils=require(_0xc583('0x15'));var config=require(_0xc583('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc583('0x17'))['db'];config[_0xc583('0x18')]=_[_0xc583('0x19')](config[_0xc583('0x18')],{'host':_0xc583('0x1a'),'port':0x18eb});var socket=require(_0xc583('0x1b'))(new Redis(config[_0xc583('0x18')]));require(_0xc583('0x1c'))[_0xc583('0x1d')](socket);function respondWithStatusCode(_0x5403a3,_0x21cf25){_0x21cf25=_0x21cf25||0xcc;return function(_0x51ecd7){if(_0x51ecd7){return _0x5403a3[_0xc583('0x1e')](_0x21cf25);}return _0x5403a3[_0xc583('0x1f')](_0x21cf25)['end']();};}function respondWithResult(_0x263552,_0x311ad5){_0x311ad5=_0x311ad5||0xc8;return function(_0x5b1871){if(_0x5b1871){return _0x263552[_0xc583('0x1f')](_0x311ad5)[_0xc583('0x20')](_0x5b1871);}};}function respondWithFilteredResult(_0x5127fa,_0x21cf22){return function(_0x8a2d84){if(_0x8a2d84){var _0x12aac2=typeof _0x21cf22[_0xc583('0x21')]==='undefined'&&typeof _0x21cf22[_0xc583('0x22')]==='undefined';var _0x227ec2=_0x8a2d84[_0xc583('0x23')];var _0xfd9a60=_0x12aac2?0x0:_0x21cf22[_0xc583('0x21')];var _0x1052b5=_0x12aac2?_0x8a2d84[_0xc583('0x23')]:_0x21cf22[_0xc583('0x21')]+_0x21cf22[_0xc583('0x22')];var _0x37fcd4;if(_0x1052b5>=_0x227ec2){_0x1052b5=_0x227ec2;_0x37fcd4=0xc8;}else{_0x37fcd4=0xce;}_0x5127fa[_0xc583('0x1f')](_0x37fcd4);return _0x5127fa[_0xc583('0x24')](_0xc583('0x25'),_0xfd9a60+'-'+_0x1052b5+'/'+_0x227ec2)[_0xc583('0x20')](_0x8a2d84);}return null;};}function patchUpdates(_0x478ee1){return function(_0x542256){try{jsonpatch[_0xc583('0x26')](_0x542256,_0x478ee1,!![]);}catch(_0x3e075c){return BPromise[_0xc583('0x27')](_0x3e075c);}return _0x542256['save']();};}function saveUpdates(_0x1521e2,_0x959500){return function(_0x37f156){if(_0x37f156){return _0x37f156[_0xc583('0x28')](_0x1521e2)[_0xc583('0x29')](function(_0x48c95e){return _0x48c95e;});}return null;};}function removeEntity(_0x4cad36,_0x45871c){return function(_0x4f366b){if(_0x4f366b){return _0x4f366b[_0xc583('0x2a')]()[_0xc583('0x29')](function(){var _0xbabf24=_0x4f366b[_0xc583('0x2b')]({'plain':!![]});var _0x24aab5='VoicePrefixes';return db[_0xc583('0x2c')][_0xc583('0x2a')]({'where':{'type':_0x24aab5,'resourceId':_0xbabf24['id']}})['then'](function(){return _0x4f366b;});})[_0xc583('0x29')](function(){_0x4cad36['status'](0xcc)[_0xc583('0x2d')]();});}};}function handleEntityNotFound(_0x8d4ecb,_0x1c80b1){return function(_0x3ed083){if(!_0x3ed083){_0x8d4ecb[_0xc583('0x1e')](0x194);}return _0x3ed083;};}function handleError(_0x19079b,_0x113b39){_0x113b39=_0x113b39||0x1f4;return function(_0x4a87b5){logger[_0xc583('0x2e')](_0x4a87b5[_0xc583('0x2f')]);if(_0x4a87b5[_0xc583('0x30')]){delete _0x4a87b5[_0xc583('0x30')];}_0x19079b[_0xc583('0x1f')](_0x113b39)[_0xc583('0x31')](_0x4a87b5);};}exports['index']=function(_0x2246dd,_0x58d97f){var _0x510931={},_0x299551={},_0x2df18d={'count':0x0,'rows':[]};var _0x20bbce=_[_0xc583('0x32')](db[_0xc583('0x33')]['rawAttributes'],function(_0x3e41c0){return{'name':_0x3e41c0[_0xc583('0x34')],'type':_0x3e41c0[_0xc583('0x35')]['key']};});_0x299551[_0xc583('0x36')]=_['map'](_0x20bbce,_0xc583('0x30'));_0x299551[_0xc583('0x37')]=_[_0xc583('0x38')](_0x2246dd[_0xc583('0x37')]);_0x299551[_0xc583('0x39')]=_['intersection'](_0x299551[_0xc583('0x36')],_0x299551['query']);_0x510931[_0xc583('0x3a')]=_['intersection'](_0x299551[_0xc583('0x36')],qs[_0xc583('0x3b')](_0x2246dd[_0xc583('0x37')][_0xc583('0x3b')]));_0x510931[_0xc583('0x3a')]=_0x510931[_0xc583('0x3a')]['length']?_0x510931['attributes']:_0x299551[_0xc583('0x36')];if(!_0x2246dd[_0xc583('0x37')]['hasOwnProperty'](_0xc583('0x3c'))){_0x510931[_0xc583('0x22')]=qs[_0xc583('0x22')](_0x2246dd[_0xc583('0x37')][_0xc583('0x22')]);_0x510931[_0xc583('0x21')]=qs['offset'](_0x2246dd[_0xc583('0x37')]['offset']);}_0x510931[_0xc583('0x3d')]=qs[_0xc583('0x3e')](_0x2246dd[_0xc583('0x37')]['sort']);_0x510931['where']=qs['filters'](_[_0xc583('0x3f')](_0x2246dd[_0xc583('0x37')],_0x299551[_0xc583('0x39')]),_0x20bbce);if(_0x2246dd[_0xc583('0x37')]['filter']){_0x510931[_0xc583('0x40')]=_[_0xc583('0x41')](_0x510931['where'],{'$or':_['map'](_0x20bbce,function(_0x1ea5da){if(_0x1ea5da['type']!==_0xc583('0x42')){var _0x1ec6f9={};_0x1ec6f9[_0x1ea5da[_0xc583('0x30')]]={'$like':'%'+_0x2246dd[_0xc583('0x37')]['filter']+'%'};return _0x1ec6f9;}})});}_0x510931=_[_0xc583('0x41')]({},_0x510931,_0x2246dd[_0xc583('0x43')]);var _0x39c5ab={'where':_0x510931[_0xc583('0x40')]};return db[_0xc583('0x33')]['count'](_0x39c5ab)[_0xc583('0x29')](function(_0x5f5a97){_0x2df18d['count']=_0x5f5a97;if(_0x2246dd[_0xc583('0x37')][_0xc583('0x44')]){_0x510931['include']=[{'all':!![]}];}return db['VoicePrefix'][_0xc583('0x45')](_0x510931);})[_0xc583('0x29')](function(_0x7d1b29){_0x2df18d[_0xc583('0x46')]=_0x7d1b29;return _0x2df18d;})['then'](respondWithFilteredResult(_0x58d97f,_0x510931))[_0xc583('0x47')](handleError(_0x58d97f,null));};exports['show']=function(_0x8c8209,_0x4edac2){var _0x28ab1a={'raw':![],'where':{'id':_0x8c8209[_0xc583('0x48')]['id']}},_0x14e9ad={};_0x14e9ad[_0xc583('0x36')]=_[_0xc583('0x38')](db['VoicePrefix'][_0xc583('0x49')]);_0x14e9ad[_0xc583('0x37')]=_[_0xc583('0x38')](_0x8c8209['query']);_0x14e9ad['filters']=_['intersection'](_0x14e9ad[_0xc583('0x36')],_0x14e9ad['query']);_0x28ab1a[_0xc583('0x3a')]=_[_0xc583('0x4a')](_0x14e9ad[_0xc583('0x36')],qs[_0xc583('0x3b')](_0x8c8209[_0xc583('0x37')][_0xc583('0x3b')]));_0x28ab1a[_0xc583('0x3a')]=_0x28ab1a[_0xc583('0x3a')][_0xc583('0x4b')]?_0x28ab1a[_0xc583('0x3a')]:_0x14e9ad[_0xc583('0x36')];if(_0x8c8209['query'][_0xc583('0x44')]){_0x28ab1a[_0xc583('0x4c')]=[{'all':!![]}];}_0x28ab1a=_[_0xc583('0x41')]({},_0x28ab1a,_0x8c8209[_0xc583('0x43')]);return db['VoicePrefix'][_0xc583('0x4d')](_0x28ab1a)[_0xc583('0x29')](handleEntityNotFound(_0x4edac2,null))[_0xc583('0x29')](respondWithResult(_0x4edac2,null))[_0xc583('0x47')](handleError(_0x4edac2,null));};exports[_0xc583('0x2a')]=function(_0x22da88,_0x3f60ae){return db[_0xc583('0x33')][_0xc583('0x4d')]({'where':{'id':_0x22da88['params']['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x3f60ae,null))[_0xc583('0x29')](removeEntity(_0x3f60ae,null))[_0xc583('0x47')](handleError(_0x3f60ae,null));};exports[_0xc583('0x4e')]=function(_0x3c442e,_0xc42b2a){return db[_0xc583('0x33')][_0xc583('0x4e')]()[_0xc583('0x29')](respondWithResult(_0xc42b2a,null))[_0xc583('0x47')](handleError(_0xc42b2a,null));};exports[_0xc583('0x4f')]=function(_0x7be0b3,_0x305239){var _0x4c486b;return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x44413e){return db[_0xc583('0x33')][_0xc583('0x4f')](_0x7be0b3[_0xc583('0x52')],{'transaction':_0x44413e})[_0xc583('0x29')](function(_0x1aff76){_0x4c486b=_0x1aff76[_0xc583('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0xc583('0x4d')]({'where':{'id':_0x4c486b[_0xc583('0x53')]},'raw':!![]})[_0xc583('0x29')](function(_0x59ce34){return createVoicePrefixExtensions(_0x4c486b,_0x59ce34,_0x44413e);});});})['then'](function(){var _0x2bb764=_0x7be0b3['user'][_0xc583('0x2b')]({'plain':!![]});if(!_0x2bb764)throw new Error(_0xc583('0x54'));if(_0x2bb764['role']==='user'){var _0x282290=_0x4c486b;return db[_0xc583('0x55')][_0xc583('0x4d')]({'where':{'name':_0xc583('0x56'),'userProfileId':_0x2bb764[_0xc583('0x57')]},'raw':!![]})[_0xc583('0x29')](function(_0x3e2758){if(_0x3e2758&&_0x3e2758[_0xc583('0x58')]===0x0){return db['UserProfileResource'][_0xc583('0x4f')]({'name':_0x282290[_0xc583('0x30')],'resourceId':_0x282290['id'],'type':_0x3e2758[_0xc583('0x30')],'sectionId':_0x3e2758['id']},{})[_0xc583('0x29')](function(){return _0x4c486b;});}else{return _0x4c486b;}})['catch'](function(_0x43fda1){logger[_0xc583('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43fda1);throw _0x43fda1;});}return _0x4c486b;})['then'](respondWithResult(_0x305239,null))[_0xc583('0x47')](handleError(_0x305239,null));};function Extension(_0x5ccfe7,_0x30b1e0,_0x1ba5cc,_0x40e8a6){this['context']='from-sip';this[_0xc583('0x59')]=_0x5ccfe7;this[_0xc583('0x5a')]=_0x1ba5cc;this[_0xc583('0x35')]=_0xc583('0x5b');this['description']=_0xc583('0x5c');this[_0xc583('0x5d')]=_0x30b1e0;this['appdata']=_0x40e8a6;}function createVoicePrefixExtensions(_0x508f4b,_0x28013a,_0x579c62){return new BPromise(function(_0x5df37d,_0x507f18){var _0x415b0f=new Extension(formatPrefixName(_0x508f4b[_0xc583('0x5e')]),0x1,_0xc583('0x5f'),_0xc583('0x60'));_0x415b0f['VoicePrefixId']=_0x508f4b['id'];return db['VoiceExtension'][_0xc583('0x4f')](_0x415b0f,{'transaction':_0x579c62})[_0xc583('0x29')](function(_0x599663){var _0x52cd21=_0x599663[_0xc583('0x2b')]({'plain':!![]});var _0x48f217=_[_0xc583('0x32')](addVoicePrefixExtensions(_0x508f4b,_0x28013a),function(_0x43f208){_0x43f208['VoiceExtensionId']=_0x52cd21['id'];_0x43f208[_0xc583('0x61')]=_0x508f4b['id'];return _0x43f208;});return db['VoiceExtension'][_0xc583('0x62')](_0x48f217,{'transaction':_0x579c62})[_0xc583('0x29')](function(_0x4b3f49){if(!_0x4b3f49){return _0x507f18(_0xc583('0x63'));}else{return _0x5df37d(_0x4b3f49);}})[_0xc583('0x47')](function(_0x20783b){return _0x507f18(_0x20783b);});});;});};function addVoicePrefixExtensions(_0xf4bc67,_0x1b5003){var _0x330a8e=[];var _0x37613c=formatPrefixName(_0xf4bc67[_0xc583('0x5e')]);_0x330a8e['push'](new Extension(_0x37613c,0x2,'Set','CDR(prefix)='+_0xf4bc67[_0xc583('0x30')]));if(_0xf4bc67['callerIdAll']){_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x3,_0xc583('0x65'),_0xc583('0x66')+_0xf4bc67[_0xc583('0x67')]));}else{_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x3,_0xc583('0x5f'),_0xc583('0x68')));}_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x4,'goto',_0x1b5003[_0xc583('0x69')]+','+_0xc583('0x6a')+(0x8+_0xf4bc67[_0xc583('0x30')][_0xc583('0x4b')])+'}'+','+0x1));return _0x330a8e;}function formatPrefixName(_0x41a064){var _0xb243ac='_';for(var _0x548f1c=0x0;_0x548f1c<_0x41a064[_0xc583('0x4b')];_0x548f1c++){if(_0x41a064[_0xc583('0x6b')](_0x548f1c)=='-'){_0xb243ac+=_0x41a064[_0xc583('0x6b')](_0x548f1c);}else{_0xb243ac+='['+_0x41a064[_0xc583('0x6b')](_0x548f1c)+']';}}_0xb243ac+='.';return _0xb243ac;}exports[_0xc583('0x28')]=function(_0x2b719f,_0x547d2f,_0x3e4616){var _0x1b6948=_0x2b719f[_0xc583('0x52')];_0x1b6948['prefix']=_0xc583('0x6c')+_0x1b6948['name']+'-';return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x240174){return db[_0xc583('0x33')][_0xc583('0x28')](_0x1b6948,{'where':{'id':_0x1b6948['id']},'transaction':_0x240174})[_0xc583('0x29')](function(){return db[_0xc583('0x6d')]['destroy']({'where':{'VoicePrefixId':_0x1b6948['id']},'transaction':_0x240174})['then'](function(){return db['VoiceExtension']['find']({'where':{'id':_0x1b6948[_0xc583('0x53')]},'raw':!![]})[_0xc583('0x29')](function(_0x3a2a5c){return createVoicePrefixExtensions(_0x1b6948,_0x3a2a5c,_0x240174);});});});})[_0xc583('0x29')](function(){return db[_0xc583('0x33')][_0xc583('0x6e')](_0x1b6948['id']);})[_0xc583('0x29')](respondWithResult(_0x547d2f,null))[_0xc583('0x47')](handleError(_0x547d2f,null));};exports[_0xc583('0x6f')]=function(_0x1b8304,_0x4c9516,_0x22b75d){return db[_0xc583('0x33')]['find']({'where':{'id':_0x1b8304['params']['id']}})['then'](handleEntityNotFound(_0x4c9516,null))[_0xc583('0x29')](function(_0x10037e){if(_0x10037e){return _0x10037e[_0xc583('0x6f')](_0x1b8304[_0xc583('0x52')][_0xc583('0x70')],_[_0xc583('0x71')](_0x1b8304[_0xc583('0x52')],[_0xc583('0x70'),'id'])||{})[_0xc583('0x72')](function(_0x516fcb){for(var _0x442844=0x0;_0x442844<_0x1b8304[_0xc583('0x52')]['ids'][_0xc583('0x4b')];_0x442844+=0x1){socket[_0xc583('0x73')](_0xc583('0x74'),{'UserId':Number(_0x1b8304[_0xc583('0x52')][_0xc583('0x70')][_0x442844]),'VoicePrefixId':Number(_0x1b8304['params']['id'])});}return _0x516fcb;});}})[_0xc583('0x29')](respondWithResult(_0x4c9516,null))[_0xc583('0x47')](handleError(_0x4c9516,null));};exports[_0xc583('0x75')]=function(_0x2f0aa9,_0x50ef13,_0x4d6582){return db['VoicePrefix'][_0xc583('0x4d')]({'where':{'id':_0x2f0aa9['params']['id']}})['then'](handleEntityNotFound(_0x50ef13,null))['then'](function(_0x1c7323){if(_0x1c7323){return _0x1c7323[_0xc583('0x75')](_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')])[_0xc583('0x29')](function(){if(_['isArray'](_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')])){for(var _0x9a09b0=0x0;_0x9a09b0<_0x2f0aa9['query'][_0xc583('0x70')][_0xc583('0x4b')];_0x9a09b0+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')][_0x9a09b0]),'VoicePrefixId':Number(_0x2f0aa9[_0xc583('0x48')]['id'])});}}else{socket[_0xc583('0x73')](_0xc583('0x76'),{'UserId':Number(_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')]),'VoicePrefixId':Number(_0x2f0aa9[_0xc583('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x50ef13,null))[_0xc583('0x47')](handleError(_0x50ef13,null));};exports[_0xc583('0x77')]=function(_0x3ea593,_0x3eabb9,_0x674d99){var _0x2b98b7={};var _0x20c4e6={};var _0x149051;var _0x1f0ab4;return db[_0xc583('0x33')][_0xc583('0x78')]({'where':{'id':_0x3ea593[_0xc583('0x48')]['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x3eabb9,null))[_0xc583('0x29')](function(_0x42ff52){if(_0x42ff52){_0x149051=_0x42ff52;_0x20c4e6[_0xc583('0x36')]=_[_0xc583('0x38')](db[_0xc583('0x79')][_0xc583('0x49')]);_0x20c4e6[_0xc583('0x37')]=_[_0xc583('0x38')](_0x3ea593[_0xc583('0x37')]);_0x20c4e6[_0xc583('0x39')]=_[_0xc583('0x4a')](_0x20c4e6['model'],_0x20c4e6['query']);_0x2b98b7[_0xc583('0x3a')]=_[_0xc583('0x4a')](_0x20c4e6['model'],qs['fields'](_0x3ea593[_0xc583('0x37')][_0xc583('0x3b')]));_0x2b98b7['attributes']=_0x2b98b7['attributes'][_0xc583('0x4b')]?_0x2b98b7[_0xc583('0x3a')]:_0x20c4e6[_0xc583('0x36')];_0x2b98b7['order']=qs['sort'](_0x3ea593[_0xc583('0x37')][_0xc583('0x3e')]);_0x2b98b7[_0xc583('0x40')]=qs['filters'](_[_0xc583('0x3f')](_0x3ea593[_0xc583('0x37')],_0x20c4e6['filters']));if(_0x3ea593[_0xc583('0x37')][_0xc583('0x7a')]){_0x2b98b7[_0xc583('0x40')]=_[_0xc583('0x41')](_0x2b98b7[_0xc583('0x40')],{'$or':_[_0xc583('0x32')](_0x2b98b7[_0xc583('0x3a')],function(_0x47e7f8){var _0x4a2671={};_0x4a2671[_0x47e7f8]={'$like':'%'+_0x3ea593['query'][_0xc583('0x7a')]+'%'};return _0x4a2671;})});}_0x2b98b7=_[_0xc583('0x41')]({},_0x2b98b7,_0x3ea593[_0xc583('0x43')]);return _0x149051[_0xc583('0x77')](_0x2b98b7);}})[_0xc583('0x29')](function(_0x3ab1a1){if(_0x3ab1a1){_0x1f0ab4=_0x3ab1a1[_0xc583('0x4b')];if(!_0x3ea593[_0xc583('0x37')]['hasOwnProperty'](_0xc583('0x3c'))){_0x2b98b7[_0xc583('0x22')]=qs[_0xc583('0x22')](_0x3ea593[_0xc583('0x37')]['limit']);_0x2b98b7['offset']=qs['offset'](_0x3ea593[_0xc583('0x37')][_0xc583('0x21')]);}return _0x149051[_0xc583('0x77')](_0x2b98b7);}})[_0xc583('0x29')](function(_0x3a04a6){if(_0x3a04a6){return _0x3a04a6?{'count':_0x1f0ab4,'rows':_0x3a04a6}:null;}})[_0xc583('0x29')](respondWithResult(_0x3eabb9,null))['catch'](handleError(_0x3eabb9,null));};exports['getTeams']=function(_0x1907ff,_0x422848,_0x492e13){var _0xc11b2e={};var _0x1a2a0d={};var _0x2f6ea4;var _0x3e4c37;return db[_0xc583('0x33')][_0xc583('0x78')]({'where':{'id':_0x1907ff['params']['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x422848,null))[_0xc583('0x29')](function(_0x3eb4a8){if(_0x3eb4a8){_0x2f6ea4=_0x3eb4a8;_0x1a2a0d[_0xc583('0x36')]=_[_0xc583('0x38')](db[_0xc583('0x7b')][_0xc583('0x49')]);_0x1a2a0d[_0xc583('0x37')]=_[_0xc583('0x38')](_0x1907ff[_0xc583('0x37')]);_0x1a2a0d['filters']=_[_0xc583('0x4a')](_0x1a2a0d[_0xc583('0x36')],_0x1a2a0d[_0xc583('0x37')]);_0xc11b2e['attributes']=_[_0xc583('0x4a')](_0x1a2a0d['model'],qs[_0xc583('0x3b')](_0x1907ff[_0xc583('0x37')][_0xc583('0x3b')]));_0xc11b2e[_0xc583('0x3a')]=_0xc11b2e[_0xc583('0x3a')][_0xc583('0x4b')]?_0xc11b2e[_0xc583('0x3a')]:_0x1a2a0d['model'];_0xc11b2e[_0xc583('0x3d')]=qs['sort'](_0x1907ff[_0xc583('0x37')]['sort']);_0xc11b2e[_0xc583('0x40')]=qs[_0xc583('0x39')](_[_0xc583('0x3f')](_0x1907ff[_0xc583('0x37')],_0x1a2a0d[_0xc583('0x39')]));if(_0x1907ff[_0xc583('0x37')][_0xc583('0x7a')]){_0xc11b2e[_0xc583('0x40')]=_['merge'](_0xc11b2e[_0xc583('0x40')],{'$or':_[_0xc583('0x32')](_0xc11b2e[_0xc583('0x3a')],function(_0x3ae684){var _0x424cd7={};_0x424cd7[_0x3ae684]={'$like':'%'+_0x1907ff['query'][_0xc583('0x7a')]+'%'};return _0x424cd7;})});}_0xc11b2e=_[_0xc583('0x41')]({},_0xc11b2e,_0x1907ff[_0xc583('0x43')]);return _0x2f6ea4['getTeams'](_0xc11b2e);}})['then'](function(_0xbbdcc4){if(_0xbbdcc4){_0x3e4c37=_0xbbdcc4[_0xc583('0x4b')];if(!_0x1907ff[_0xc583('0x37')][_0xc583('0x7c')](_0xc583('0x3c'))){_0xc11b2e[_0xc583('0x22')]=qs['limit'](_0x1907ff[_0xc583('0x37')][_0xc583('0x22')]);_0xc11b2e[_0xc583('0x21')]=qs[_0xc583('0x21')](_0x1907ff[_0xc583('0x37')]['offset']);}return _0x2f6ea4[_0xc583('0x7d')](_0xc11b2e);}})['then'](function(_0x1371a2){if(_0x1371a2){return _0x1371a2?{'count':_0x3e4c37,'rows':_0x1371a2}:null;}})['then'](respondWithResult(_0x422848,null))[_0xc583('0x47')](handleError(_0x422848,null));};exports[_0xc583('0x7e')]=function(_0x5b9b20,_0x5ebdb6,_0x1f1dfc){var _0x3f8a4e=_0x5b9b20[_0xc583('0x52')][_0xc583('0x70')];var _0x43e533;return db['Team'][_0xc583('0x45')]({'where':{'id':_0x3f8a4e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc583('0x7f'),'attributes':['id',_0xc583('0x30'),_0xc583('0x80'),_0xc583('0x81'),'interface'],'raw':!![]}]})['then'](function(_0x54f43b){if(_0x54f43b){_0x43e533=_0x54f43b;var _0x1cbdea=_[_0xc583('0x82')](_0x54f43b,function(_0x2afb8c){var _0x5252a8=_0x2afb8c[_0xc583('0x2b')]({'plain':!![]});return _0x5252a8[_0xc583('0x7f')];});return db['VoicePrefix'][_0xc583('0x4d')]({'where':{'id':_0x5b9b20['params']['id']}})[_0xc583('0x29')](function(_0x3d1570){return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x48e574){return _0x3d1570[_0xc583('0x7e')](_0x3f8a4e,{'transaction':_0x48e574})[_0xc583('0x29')](function(){return BPromise[_0xc583('0x83')](_0x43e533,function(_0x499821){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x499821['id'],'VoicePrefixId':_0x5b9b20[_0xc583('0x48')]['id']},{'transaction':_0x48e574});});})[_0xc583('0x29')](function(){return BPromise['each'](_0x1cbdea,function(_0x363a8e){return db[_0xc583('0x84')]['findOrCreate']({'where':{'UserId':_0x363a8e['id'],'VoicePrefixId':_0x5b9b20['params']['id']},'transaction':_0x48e574});});})[_0xc583('0x29')](function(){_0x1cbdea['forEach'](function(_0x790cd1){socket[_0xc583('0x73')](_0xc583('0x74'),{'UserId':_0x790cd1['id'],'VoicePrefixId':_0x3d1570['id']});});});});});}})[_0xc583('0x29')](respondWithStatusCode(_0x5ebdb6,null))[_0xc583('0x47')](handleError(_0x5ebdb6,null));};exports[_0xc583('0x85')]=function(_0x59781d,_0x3bcbce,_0x1628f4){return db[_0xc583('0x7b')][_0xc583('0x45')]({'where':{'id':_0x59781d[_0xc583('0x37')][_0xc583('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc583('0x7f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3bcbce,null))[_0xc583('0x29')](function(_0x146b9c){var _0x4a6c7c=_['map'](_0x146b9c,'id');var _0x42b5a5=[];var _0x583588=[];var _0x564e57=squel[_0xc583('0x86')]();_0x564e57['field'](_0xc583('0x87'))[_0xc583('0x88')](_0xc583('0x89'),'tq')[_0xc583('0x8a')]('user_has_teams','ut',_0xc583('0x8b'))[_0xc583('0x40')](_0xc583('0x8c'),_0x59781d[_0xc583('0x48')]['id']);for(var _0x162607=0x0;_0x162607<_0x146b9c[_0xc583('0x4b')];_0x162607+=0x1){let _0x39a000=_0x146b9c[_0x162607];for(var _0x63eee8=0x0;_0x63eee8<_0x39a000[_0xc583('0x7f')][_0xc583('0x4b')];_0x63eee8+=0x1){let _0x459caf=_0x39a000[_0xc583('0x7f')][_0x63eee8];var _0x4075bd=_0x564e57['clone']();_0x4075bd[_0xc583('0x40')](_0xc583('0x8d'),_0x459caf['id']);_0x583588[_0xc583('0x64')](db[_0xc583('0x50')][_0xc583('0x37')](_0x4075bd[_0xc583('0x8e')](),{'type':db[_0xc583('0x50')][_0xc583('0x8f')]['SELECT']})[_0xc583('0x29')](function(_0x7ac229){if(_0x7ac229['length']===0x1){return _0x459caf['id'];}else{var _0x56cc96=_[_0xc583('0x90')](_[_0xc583('0x32')](_0x7ac229,'TeamId'),function(_0x25dde6){return _['includes'](_0x4a6c7c,_0x25dde6);});if(_0x56cc96){return _0x459caf['id'];}}}));}}return BPromise[_0xc583('0x91')](_0x583588)[_0xc583('0x29')](function(_0x1de88f){_0x42b5a5=_(_0x42b5a5)[_0xc583('0x92')](_0x1de88f)[_0xc583('0x93')]()[_0xc583('0x94')]();return db[_0xc583('0x33')]['find']({'where':{'id':_0x59781d['params']['id']}})[_0xc583('0x29')](function(_0x592b63){return db[_0xc583('0x50')]['transaction'](function(_0x440079){return _0x592b63[_0xc583('0x85')](_0x59781d['query'][_0xc583('0x70')],{'transaction':_0x440079})[_0xc583('0x29')](function(){if(!_[_0xc583('0x95')](_0x42b5a5)){return _0x592b63[_0xc583('0x75')](_0x42b5a5,{'transaction':_0x440079});}})['then'](function(){_0x42b5a5[_0xc583('0x96')](function(_0x182c40){socket[_0xc583('0x73')]('userVoicePrefix:remove',{'UserId':_0x182c40,'VoicePrefixId':_0x592b63['id']});});});});});});})[_0xc583('0x29')](respondWithStatusCode(_0x3bcbce,null))[_0xc583('0x47')](handleError(_0x3bcbce,null));}; \ No newline at end of file +var _0x0120=['get','VoicePrefixes','UserProfileResource','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','addAgents','params','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Agents','online','interface','flatMap','sequelize','addTeams','each','TeamVoicePrefix','upsert','findOrCreate','userVoicePrefix:save','removeTeams','from','team_has_voice_prefixes','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x3ffb33,_0xd9c589){var _0x478895=function(_0x1f6bb2){while(--_0x1f6bb2){_0x3ffb33['push'](_0x3ffb33['shift']());}};_0x478895(++_0xd9c589);}(_0x0120,0x6f));var _0x0012=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0120[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x0012('0x0'));var rimraf=require(_0x0012('0x1'));var zipdir=require(_0x0012('0x2'));var jsonpatch=require(_0x0012('0x3'));var rp=require(_0x0012('0x4'));var moment=require(_0x0012('0x5'));var BPromise=require(_0x0012('0x6'));var Mustache=require(_0x0012('0x7'));var util=require(_0x0012('0x8'));var path=require(_0x0012('0x9'));var sox=require(_0x0012('0xa'));var csv=require(_0x0012('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0012('0xc'));var crypto=require(_0x0012('0xd'));var jsforce=require(_0x0012('0xe'));var deskjs=require(_0x0012('0xf'));var toCsv=require(_0x0012('0xb'));var querystring=require('querystring');var Papa=require(_0x0012('0x10'));var Redis=require(_0x0012('0x11'));var authService=require(_0x0012('0x12'));var qs=require(_0x0012('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0012('0x14'));var logger=require('../../config/logger')(_0x0012('0x15'));var utils=require(_0x0012('0x16'));var config=require(_0x0012('0x17'));var licenseUtil=require(_0x0012('0x18'));var db=require(_0x0012('0x19'))['db'];config['redis']=_[_0x0012('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0012('0x1b'))['register'](socket);function respondWithStatusCode(_0x3995fd,_0xf658bc){_0xf658bc=_0xf658bc||0xcc;return function(_0x47a6ef){if(_0x47a6ef){return _0x3995fd[_0x0012('0x1c')](_0xf658bc);}return _0x3995fd[_0x0012('0x1d')](_0xf658bc)[_0x0012('0x1e')]();};}function respondWithResult(_0x3b8dfc,_0x522e9b){_0x522e9b=_0x522e9b||0xc8;return function(_0x4e72da){if(_0x4e72da){return _0x3b8dfc[_0x0012('0x1d')](_0x522e9b)[_0x0012('0x1f')](_0x4e72da);}};}function respondWithFilteredResult(_0x3948bf,_0x2e88a8){return function(_0x1d0423){if(_0x1d0423){var _0x22ded1=typeof _0x2e88a8[_0x0012('0x20')]===_0x0012('0x21')&&typeof _0x2e88a8['limit']===_0x0012('0x21');var _0x56b0e1=_0x1d0423['count'];var _0x45d00b=_0x22ded1?0x0:_0x2e88a8[_0x0012('0x20')];var _0xa2e623=_0x22ded1?_0x1d0423[_0x0012('0x22')]:_0x2e88a8['offset']+_0x2e88a8['limit'];var _0x460d82;if(_0xa2e623>=_0x56b0e1){_0xa2e623=_0x56b0e1;_0x460d82=0xc8;}else{_0x460d82=0xce;}_0x3948bf[_0x0012('0x1d')](_0x460d82);return _0x3948bf[_0x0012('0x23')](_0x0012('0x24'),_0x45d00b+'-'+_0xa2e623+'/'+_0x56b0e1)[_0x0012('0x1f')](_0x1d0423);}return null;};}function patchUpdates(_0x2e6a2c){return function(_0x2c9a96){try{jsonpatch[_0x0012('0x25')](_0x2c9a96,_0x2e6a2c,!![]);}catch(_0x57487e){return BPromise[_0x0012('0x26')](_0x57487e);}return _0x2c9a96[_0x0012('0x27')]();};}function saveUpdates(_0x4cf4bd,_0x36cf42){return function(_0x13a78e){if(_0x13a78e){return _0x13a78e[_0x0012('0x28')](_0x4cf4bd)[_0x0012('0x29')](function(_0x42bcd7){return _0x42bcd7;});}return null;};}function removeEntity(_0x5e820b,_0x351ffd){return function(_0x18b0a7){if(_0x18b0a7){return _0x18b0a7[_0x0012('0x2a')]()[_0x0012('0x29')](function(){var _0x173cb3=_0x18b0a7[_0x0012('0x2b')]({'plain':!![]});var _0x15d48a=_0x0012('0x2c');return db[_0x0012('0x2d')][_0x0012('0x2a')]({'where':{'type':_0x15d48a,'resourceId':_0x173cb3['id']}})[_0x0012('0x29')](function(){return _0x18b0a7;});})[_0x0012('0x29')](function(){_0x5e820b[_0x0012('0x1d')](0xcc)[_0x0012('0x1e')]();});}};}function handleEntityNotFound(_0x1282bb,_0x276389){return function(_0x1b676d){if(!_0x1b676d){_0x1282bb[_0x0012('0x1c')](0x194);}return _0x1b676d;};}function handleError(_0x1c23e0,_0x291085){_0x291085=_0x291085||0x1f4;return function(_0x1bb14d){logger['error'](_0x1bb14d[_0x0012('0x2e')]);if(_0x1bb14d[_0x0012('0x2f')]){delete _0x1bb14d['name'];}_0x1c23e0[_0x0012('0x1d')](_0x291085)[_0x0012('0x30')](_0x1bb14d);};}exports[_0x0012('0x31')]=function(_0x1b6cef,_0x287b05){var _0x47d73b={},_0x13f169={},_0x187f4b={'count':0x0,'rows':[]};var _0x2e7487=_['map'](db[_0x0012('0x32')][_0x0012('0x33')],function(_0x398990){return{'name':_0x398990[_0x0012('0x34')],'type':_0x398990[_0x0012('0x35')][_0x0012('0x36')]};});_0x13f169['model']=_[_0x0012('0x37')](_0x2e7487,_0x0012('0x2f'));_0x13f169[_0x0012('0x38')]=_[_0x0012('0x39')](_0x1b6cef['query']);_0x13f169['filters']=_[_0x0012('0x3a')](_0x13f169[_0x0012('0x3b')],_0x13f169[_0x0012('0x38')]);_0x47d73b[_0x0012('0x3c')]=_[_0x0012('0x3a')](_0x13f169[_0x0012('0x3b')],qs[_0x0012('0x3d')](_0x1b6cef['query'][_0x0012('0x3d')]));_0x47d73b[_0x0012('0x3c')]=_0x47d73b['attributes'][_0x0012('0x3e')]?_0x47d73b[_0x0012('0x3c')]:_0x13f169[_0x0012('0x3b')];if(!_0x1b6cef[_0x0012('0x38')][_0x0012('0x3f')](_0x0012('0x40'))){_0x47d73b[_0x0012('0x41')]=qs['limit'](_0x1b6cef[_0x0012('0x38')]['limit']);_0x47d73b[_0x0012('0x20')]=qs['offset'](_0x1b6cef['query'][_0x0012('0x20')]);}_0x47d73b[_0x0012('0x42')]=qs[_0x0012('0x43')](_0x1b6cef['query'][_0x0012('0x43')]);_0x47d73b[_0x0012('0x44')]=qs[_0x0012('0x45')](_[_0x0012('0x46')](_0x1b6cef[_0x0012('0x38')],_0x13f169[_0x0012('0x45')]),_0x2e7487);if(_0x1b6cef[_0x0012('0x38')][_0x0012('0x47')]){_0x47d73b['where']=_[_0x0012('0x48')](_0x47d73b[_0x0012('0x44')],{'$or':_[_0x0012('0x37')](_0x2e7487,function(_0x1799f2){if(_0x1799f2[_0x0012('0x35')]!==_0x0012('0x49')){var _0x375317={};_0x375317[_0x1799f2['name']]={'$like':'%'+_0x1b6cef['query'][_0x0012('0x47')]+'%'};return _0x375317;}})});}_0x47d73b=_['merge']({},_0x47d73b,_0x1b6cef[_0x0012('0x4a')]);var _0x30af1b={'where':_0x47d73b[_0x0012('0x44')]};return db[_0x0012('0x32')][_0x0012('0x22')](_0x30af1b)['then'](function(_0x1bd93a){_0x187f4b[_0x0012('0x22')]=_0x1bd93a;if(_0x1b6cef['query'][_0x0012('0x4b')]){_0x47d73b[_0x0012('0x4c')]=[{'all':!![]}];}return db[_0x0012('0x32')][_0x0012('0x4d')](_0x47d73b);})['then'](function(_0x4ba00e){_0x187f4b[_0x0012('0x4e')]=_0x4ba00e;return _0x187f4b;})['then'](respondWithFilteredResult(_0x287b05,_0x47d73b))[_0x0012('0x4f')](handleError(_0x287b05,null));};exports['show']=function(_0xdd4689,_0x1296fd){var _0x3daefd={'raw':![],'where':{'id':_0xdd4689['params']['id']}},_0x364f8e={};_0x364f8e[_0x0012('0x3b')]=_['keys'](db[_0x0012('0x32')][_0x0012('0x33')]);_0x364f8e[_0x0012('0x38')]=_[_0x0012('0x39')](_0xdd4689[_0x0012('0x38')]);_0x364f8e[_0x0012('0x45')]=_[_0x0012('0x3a')](_0x364f8e['model'],_0x364f8e[_0x0012('0x38')]);_0x3daefd[_0x0012('0x3c')]=_[_0x0012('0x3a')](_0x364f8e[_0x0012('0x3b')],qs[_0x0012('0x3d')](_0xdd4689[_0x0012('0x38')]['fields']));_0x3daefd['attributes']=_0x3daefd['attributes']['length']?_0x3daefd[_0x0012('0x3c')]:_0x364f8e[_0x0012('0x3b')];if(_0xdd4689[_0x0012('0x38')][_0x0012('0x4b')]){_0x3daefd[_0x0012('0x4c')]=[{'all':!![]}];}_0x3daefd=_['merge']({},_0x3daefd,_0xdd4689[_0x0012('0x4a')]);return db[_0x0012('0x32')][_0x0012('0x50')](_0x3daefd)[_0x0012('0x29')](handleEntityNotFound(_0x1296fd,null))[_0x0012('0x29')](respondWithResult(_0x1296fd,null))[_0x0012('0x4f')](handleError(_0x1296fd,null));};exports[_0x0012('0x2a')]=function(_0x26fb2b,_0x2177a6){return db[_0x0012('0x32')][_0x0012('0x50')]({'where':{'id':_0x26fb2b['params']['id']}})[_0x0012('0x29')](handleEntityNotFound(_0x2177a6,null))[_0x0012('0x29')](removeEntity(_0x2177a6,null))[_0x0012('0x4f')](handleError(_0x2177a6,null));};exports['describe']=function(_0x2d4ee7,_0x2f451b){return db[_0x0012('0x32')][_0x0012('0x51')]()[_0x0012('0x29')](respondWithResult(_0x2f451b,null))['catch'](handleError(_0x2f451b,null));};exports[_0x0012('0x52')]=function(_0x552f02,_0x430973){var _0x42f296;return db['sequelize'][_0x0012('0x53')](function(_0x19cf31){return db[_0x0012('0x32')][_0x0012('0x52')](_0x552f02[_0x0012('0x54')],{'transaction':_0x19cf31})[_0x0012('0x29')](function(_0x4e9f7e){_0x42f296=_0x4e9f7e[_0x0012('0x2b')]({'plain':!![]});return db[_0x0012('0x55')][_0x0012('0x50')]({'where':{'id':_0x42f296[_0x0012('0x56')]},'raw':!![]})['then'](function(_0x102637){return createVoicePrefixExtensions(_0x42f296,_0x102637,_0x19cf31);});});})[_0x0012('0x29')](function(){var _0x2e79aa=_0x552f02['user'][_0x0012('0x2b')]({'plain':!![]});if(!_0x2e79aa)throw new Error(_0x0012('0x57'));if(_0x2e79aa[_0x0012('0x58')]===_0x0012('0x59')){var _0x1a48d9=_0x42f296;return db[_0x0012('0x5a')][_0x0012('0x50')]({'where':{'name':_0x0012('0x2c'),'userProfileId':_0x2e79aa[_0x0012('0x5b')]},'raw':!![]})[_0x0012('0x29')](function(_0x263634){if(_0x263634&&_0x263634['autoAssociation']===0x0){return db['UserProfileResource'][_0x0012('0x52')]({'name':_0x1a48d9[_0x0012('0x2f')],'resourceId':_0x1a48d9['id'],'type':_0x263634[_0x0012('0x2f')],'sectionId':_0x263634['id']},{})[_0x0012('0x29')](function(){return _0x42f296;});}else{return _0x42f296;}})['catch'](function(_0x248497){logger[_0x0012('0x5c')](_0x0012('0x5d'),_0x248497);throw _0x248497;});}return _0x42f296;})[_0x0012('0x29')](respondWithResult(_0x430973,null))[_0x0012('0x4f')](handleError(_0x430973,null));};function Extension(_0x130045,_0x51eae3,_0x17eaff,_0x490644){this[_0x0012('0x5e')]=_0x0012('0x5f');this[_0x0012('0x60')]=_0x130045;this[_0x0012('0x61')]=_0x17eaff;this[_0x0012('0x35')]='system';this[_0x0012('0x62')]=_0x0012('0x63');this[_0x0012('0x64')]=_0x51eae3;this[_0x0012('0x65')]=_0x490644;}function createVoicePrefixExtensions(_0x2ceed5,_0x3d32c2,_0x562d6d){return new BPromise(function(_0x4e4d52,_0x4ea93b){var _0xd7db34=new Extension(formatPrefixName(_0x2ceed5[_0x0012('0x66')]),0x1,'NoOp','Voice\x20Prefix');_0xd7db34['VoicePrefixId']=_0x2ceed5['id'];return db[_0x0012('0x55')][_0x0012('0x52')](_0xd7db34,{'transaction':_0x562d6d})[_0x0012('0x29')](function(_0x472843){var _0x1f0af9=_0x472843[_0x0012('0x2b')]({'plain':!![]});var _0x10cb5e=_[_0x0012('0x37')](addVoicePrefixExtensions(_0x2ceed5,_0x3d32c2),function(_0x2612e2){_0x2612e2[_0x0012('0x56')]=_0x1f0af9['id'];_0x2612e2['VoicePrefixId']=_0x2ceed5['id'];return _0x2612e2;});return db[_0x0012('0x55')][_0x0012('0x67')](_0x10cb5e,{'transaction':_0x562d6d})[_0x0012('0x29')](function(_0x5cfc9f){if(!_0x5cfc9f){return _0x4ea93b(_0x0012('0x68'));}else{return _0x4e4d52(_0x5cfc9f);}})[_0x0012('0x4f')](function(_0x4cba06){return _0x4ea93b(_0x4cba06);});});;});};function addVoicePrefixExtensions(_0x388466,_0x534840){var _0x2958c7=[];var _0x1661c2=formatPrefixName(_0x388466[_0x0012('0x66')]);_0x2958c7[_0x0012('0x69')](new Extension(_0x1661c2,0x2,'Set',_0x0012('0x6a')+_0x388466[_0x0012('0x2f')]));if(_0x388466[_0x0012('0x6b')]){_0x2958c7[_0x0012('0x69')](new Extension(_0x1661c2,0x3,_0x0012('0x6c'),_0x0012('0x6d')+_0x388466[_0x0012('0x6b')]));}else{_0x2958c7['push'](new Extension(_0x1661c2,0x3,'NoOp',_0x0012('0x6e')));}_0x2958c7[_0x0012('0x69')](new Extension(_0x1661c2,0x4,_0x0012('0x6f'),_0x534840[_0x0012('0x5e')]+','+_0x0012('0x70')+(0x8+_0x388466[_0x0012('0x2f')][_0x0012('0x3e')])+'}'+','+0x1));return _0x2958c7;}function formatPrefixName(_0x38cc51){var _0x548487='_';for(var _0x15b058=0x0;_0x15b058<_0x38cc51[_0x0012('0x3e')];_0x15b058++){if(_0x38cc51[_0x0012('0x71')](_0x15b058)=='-'){_0x548487+=_0x38cc51[_0x0012('0x71')](_0x15b058);}else{_0x548487+='['+_0x38cc51[_0x0012('0x71')](_0x15b058)+']';}}_0x548487+='.';return _0x548487;}exports[_0x0012('0x28')]=function(_0x496ab9,_0x4fc9b1,_0x571247){var _0x49963a=_0x496ab9['body'];_0x49963a['prefix']=_0x0012('0x72')+_0x49963a[_0x0012('0x2f')]+'-';return db['sequelize'][_0x0012('0x53')](function(_0x1c93e7){return db[_0x0012('0x32')][_0x0012('0x28')](_0x49963a,{'where':{'id':_0x49963a['id']},'transaction':_0x1c93e7})[_0x0012('0x29')](function(){return db['VoiceExtension'][_0x0012('0x2a')]({'where':{'VoicePrefixId':_0x49963a['id']},'transaction':_0x1c93e7})[_0x0012('0x29')](function(){return db[_0x0012('0x55')][_0x0012('0x50')]({'where':{'id':_0x49963a[_0x0012('0x56')]},'raw':!![]})[_0x0012('0x29')](function(_0x47e12a){return createVoicePrefixExtensions(_0x49963a,_0x47e12a,_0x1c93e7);});});});})['then'](function(){return db[_0x0012('0x32')]['findById'](_0x49963a['id']);})[_0x0012('0x29')](respondWithResult(_0x4fc9b1,null))[_0x0012('0x4f')](handleError(_0x4fc9b1,null));};exports[_0x0012('0x73')]=function(_0xdd97af,_0x521a88,_0x493a0d){return db[_0x0012('0x32')][_0x0012('0x50')]({'where':{'id':_0xdd97af[_0x0012('0x74')]['id']}})['then'](handleEntityNotFound(_0x521a88,null))[_0x0012('0x29')](function(_0x48d748){if(_0x48d748){return _0x48d748['addAgents'](_0xdd97af['body'][_0x0012('0x75')],_[_0x0012('0x76')](_0xdd97af['body'],[_0x0012('0x75'),'id'])||{})[_0x0012('0x77')](function(_0x574cf7){for(var _0x4e0a8f=0x0;_0x4e0a8f<_0xdd97af[_0x0012('0x54')]['ids'][_0x0012('0x3e')];_0x4e0a8f+=0x1){socket[_0x0012('0x78')]('userVoicePrefix:save',{'UserId':Number(_0xdd97af['body'][_0x0012('0x75')][_0x4e0a8f]),'VoicePrefixId':Number(_0xdd97af[_0x0012('0x74')]['id'])});}return _0x574cf7;});}})[_0x0012('0x29')](respondWithResult(_0x521a88,null))[_0x0012('0x4f')](handleError(_0x521a88,null));};exports['removeAgents']=function(_0x523419,_0x2852ac,_0x58d4dc){return db[_0x0012('0x32')][_0x0012('0x50')]({'where':{'id':_0x523419['params']['id']}})[_0x0012('0x29')](handleEntityNotFound(_0x2852ac,null))[_0x0012('0x29')](function(_0xd6f0ff){if(_0xd6f0ff){return _0xd6f0ff[_0x0012('0x79')](_0x523419[_0x0012('0x38')][_0x0012('0x75')])[_0x0012('0x29')](function(){if(_[_0x0012('0x7a')](_0x523419[_0x0012('0x38')][_0x0012('0x75')])){for(var _0x4a2ce1=0x0;_0x4a2ce1<_0x523419[_0x0012('0x38')]['ids']['length'];_0x4a2ce1+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x523419['query'][_0x0012('0x75')][_0x4a2ce1]),'VoicePrefixId':Number(_0x523419['params']['id'])});}}else{socket[_0x0012('0x78')](_0x0012('0x7b'),{'UserId':Number(_0x523419[_0x0012('0x38')]['ids']),'VoicePrefixId':Number(_0x523419[_0x0012('0x74')]['id'])});}});}})[_0x0012('0x29')](respondWithStatusCode(_0x2852ac,null))[_0x0012('0x4f')](handleError(_0x2852ac,null));};exports[_0x0012('0x7c')]=function(_0x35d36e,_0x26e6ed,_0xd6b12a){var _0x5dc5b5={};var _0x399108={};var _0x482684;var _0x526fae;return db[_0x0012('0x32')][_0x0012('0x7d')]({'where':{'id':_0x35d36e['params']['id']}})[_0x0012('0x29')](handleEntityNotFound(_0x26e6ed,null))['then'](function(_0xe913ef){if(_0xe913ef){_0x482684=_0xe913ef;_0x399108[_0x0012('0x3b')]=_[_0x0012('0x39')](db[_0x0012('0x7e')]['rawAttributes']);_0x399108[_0x0012('0x38')]=_[_0x0012('0x39')](_0x35d36e[_0x0012('0x38')]);_0x399108[_0x0012('0x45')]=_[_0x0012('0x3a')](_0x399108['model'],_0x399108[_0x0012('0x38')]);_0x5dc5b5[_0x0012('0x3c')]=_[_0x0012('0x3a')](_0x399108[_0x0012('0x3b')],qs[_0x0012('0x3d')](_0x35d36e['query'][_0x0012('0x3d')]));_0x5dc5b5['attributes']=_0x5dc5b5[_0x0012('0x3c')][_0x0012('0x3e')]?_0x5dc5b5['attributes']:_0x399108[_0x0012('0x3b')];_0x5dc5b5[_0x0012('0x42')]=qs['sort'](_0x35d36e[_0x0012('0x38')][_0x0012('0x43')]);_0x5dc5b5[_0x0012('0x44')]=qs[_0x0012('0x45')](_[_0x0012('0x46')](_0x35d36e[_0x0012('0x38')],_0x399108[_0x0012('0x45')]));if(_0x35d36e['query'][_0x0012('0x47')]){_0x5dc5b5[_0x0012('0x44')]=_[_0x0012('0x48')](_0x5dc5b5[_0x0012('0x44')],{'$or':_[_0x0012('0x37')](_0x5dc5b5[_0x0012('0x3c')],function(_0x203996){var _0x4da831={};_0x4da831[_0x203996]={'$like':'%'+_0x35d36e[_0x0012('0x38')][_0x0012('0x47')]+'%'};return _0x4da831;})});}_0x5dc5b5=_[_0x0012('0x48')]({},_0x5dc5b5,_0x35d36e[_0x0012('0x4a')]);return _0x482684[_0x0012('0x7c')](_0x5dc5b5);}})[_0x0012('0x29')](function(_0x119e75){if(_0x119e75){_0x526fae=_0x119e75['length'];if(!_0x35d36e[_0x0012('0x38')]['hasOwnProperty'](_0x0012('0x40'))){_0x5dc5b5[_0x0012('0x41')]=qs[_0x0012('0x41')](_0x35d36e[_0x0012('0x38')]['limit']);_0x5dc5b5[_0x0012('0x20')]=qs[_0x0012('0x20')](_0x35d36e[_0x0012('0x38')][_0x0012('0x20')]);}return _0x482684[_0x0012('0x7c')](_0x5dc5b5);}})[_0x0012('0x29')](function(_0x384731){if(_0x384731){return _0x384731?{'count':_0x526fae,'rows':_0x384731}:null;}})[_0x0012('0x29')](respondWithResult(_0x26e6ed,null))[_0x0012('0x4f')](handleError(_0x26e6ed,null));};exports[_0x0012('0x7f')]=function(_0x2cd7f9,_0x30739b,_0x529ad1){var _0x4de297={};var _0x493cf8={};var _0x10acaa;var _0x6b90b3;return db['VoicePrefix'][_0x0012('0x7d')]({'where':{'id':_0x2cd7f9['params']['id']}})[_0x0012('0x29')](handleEntityNotFound(_0x30739b,null))['then'](function(_0x2ecb66){if(_0x2ecb66){_0x10acaa=_0x2ecb66;_0x493cf8['model']=_['keys'](db['Team'][_0x0012('0x33')]);_0x493cf8[_0x0012('0x38')]=_['keys'](_0x2cd7f9[_0x0012('0x38')]);_0x493cf8[_0x0012('0x45')]=_[_0x0012('0x3a')](_0x493cf8['model'],_0x493cf8[_0x0012('0x38')]);_0x4de297[_0x0012('0x3c')]=_[_0x0012('0x3a')](_0x493cf8['model'],qs[_0x0012('0x3d')](_0x2cd7f9[_0x0012('0x38')][_0x0012('0x3d')]));_0x4de297[_0x0012('0x3c')]=_0x4de297['attributes'][_0x0012('0x3e')]?_0x4de297['attributes']:_0x493cf8[_0x0012('0x3b')];_0x4de297['order']=qs[_0x0012('0x43')](_0x2cd7f9[_0x0012('0x38')][_0x0012('0x43')]);_0x4de297[_0x0012('0x44')]=qs['filters'](_[_0x0012('0x46')](_0x2cd7f9[_0x0012('0x38')],_0x493cf8['filters']));if(_0x2cd7f9[_0x0012('0x38')][_0x0012('0x47')]){_0x4de297[_0x0012('0x44')]=_[_0x0012('0x48')](_0x4de297[_0x0012('0x44')],{'$or':_[_0x0012('0x37')](_0x4de297['attributes'],function(_0x49cd17){var _0x5d13c2={};_0x5d13c2[_0x49cd17]={'$like':'%'+_0x2cd7f9[_0x0012('0x38')][_0x0012('0x47')]+'%'};return _0x5d13c2;})});}_0x4de297=_[_0x0012('0x48')]({},_0x4de297,_0x2cd7f9[_0x0012('0x4a')]);return _0x10acaa[_0x0012('0x7f')](_0x4de297);}})[_0x0012('0x29')](function(_0x314645){if(_0x314645){_0x6b90b3=_0x314645[_0x0012('0x3e')];if(!_0x2cd7f9[_0x0012('0x38')][_0x0012('0x3f')](_0x0012('0x40'))){_0x4de297[_0x0012('0x41')]=qs[_0x0012('0x41')](_0x2cd7f9[_0x0012('0x38')][_0x0012('0x41')]);_0x4de297[_0x0012('0x20')]=qs['offset'](_0x2cd7f9[_0x0012('0x38')][_0x0012('0x20')]);}return _0x10acaa[_0x0012('0x7f')](_0x4de297);}})[_0x0012('0x29')](function(_0x3e8b0a){if(_0x3e8b0a){return _0x3e8b0a?{'count':_0x6b90b3,'rows':_0x3e8b0a}:null;}})[_0x0012('0x29')](respondWithResult(_0x30739b,null))[_0x0012('0x4f')](handleError(_0x30739b,null));};exports['addTeams']=function(_0x5e3240,_0x18aee3,_0x57f5a3){var _0x346739=_0x5e3240[_0x0012('0x54')][_0x0012('0x75')];var _0x270d2c;return db['Team']['findAll']({'where':{'id':_0x346739},'attributes':['id'],'include':[{'model':db[_0x0012('0x7e')],'as':_0x0012('0x80'),'attributes':['id','name',_0x0012('0x81'),'voicePause',_0x0012('0x82')],'raw':!![]}]})[_0x0012('0x29')](function(_0x22a7f8){if(_0x22a7f8){_0x270d2c=_0x22a7f8;var _0xe30fa=_[_0x0012('0x83')](_0x22a7f8,function(_0x250d30){var _0x300690=_0x250d30[_0x0012('0x2b')]({'plain':!![]});return _0x300690['Agents'];});return db[_0x0012('0x32')][_0x0012('0x50')]({'where':{'id':_0x5e3240['params']['id']}})['then'](function(_0x973452){return db[_0x0012('0x84')][_0x0012('0x53')](function(_0x26fa8a){return _0x973452[_0x0012('0x85')](_0x346739,{'transaction':_0x26fa8a})[_0x0012('0x29')](function(){return BPromise[_0x0012('0x86')](_0x270d2c,function(_0x5d3b2e){return db[_0x0012('0x87')][_0x0012('0x88')]({'TeamId':_0x5d3b2e['id'],'VoicePrefixId':_0x5e3240[_0x0012('0x74')]['id']},{'transaction':_0x26fa8a});});})[_0x0012('0x29')](function(){return BPromise['each'](_0xe30fa,function(_0x558eb3){return db['UserVoicePrefix'][_0x0012('0x89')]({'where':{'UserId':_0x558eb3['id'],'VoicePrefixId':_0x5e3240[_0x0012('0x74')]['id']},'transaction':_0x26fa8a});});})[_0x0012('0x29')](function(){_0xe30fa['forEach'](function(_0x24264b){socket[_0x0012('0x78')](_0x0012('0x8a'),{'UserId':_0x24264b['id'],'VoicePrefixId':_0x973452['id']});});});});});}})[_0x0012('0x29')](respondWithStatusCode(_0x18aee3,null))['catch'](handleError(_0x18aee3,null));};exports[_0x0012('0x8b')]=function(_0x12c6fa,_0x5b1cb3,_0x5cb8b9){return db['Team'][_0x0012('0x4d')]({'where':{'id':_0x12c6fa[_0x0012('0x38')][_0x0012('0x75')]},'attributes':['id'],'include':[{'model':db[_0x0012('0x7e')],'as':_0x0012('0x80'),'attributes':['id'],'raw':!![]}]})[_0x0012('0x29')](handleEntityNotFound(_0x5b1cb3,null))[_0x0012('0x29')](function(_0x2c186c){var _0x1c0814=_[_0x0012('0x37')](_0x2c186c,'id');var _0x1c1b75=[];var _0x272b17=[];var _0x504cba=squel['select']();_0x504cba['field']('tq.TeamId')[_0x0012('0x8c')](_0x0012('0x8d'),'tq')['join']('user_has_teams','ut',_0x0012('0x8e'))['where'](_0x0012('0x8f'),_0x12c6fa['params']['id']);for(var _0x58e8cf=0x0;_0x58e8cf<_0x2c186c[_0x0012('0x3e')];_0x58e8cf+=0x1){let _0x2c692=_0x2c186c[_0x58e8cf];for(var _0x3bad29=0x0;_0x3bad29<_0x2c692[_0x0012('0x80')]['length'];_0x3bad29+=0x1){let _0x4ccd2f=_0x2c692[_0x0012('0x80')][_0x3bad29];var _0x14b576=_0x504cba['clone']();_0x14b576[_0x0012('0x44')](_0x0012('0x90'),_0x4ccd2f['id']);_0x272b17[_0x0012('0x69')](db['sequelize'][_0x0012('0x38')](_0x14b576[_0x0012('0x91')](),{'type':db[_0x0012('0x84')][_0x0012('0x92')][_0x0012('0x93')]})['then'](function(_0x860c38){if(_0x860c38[_0x0012('0x3e')]===0x1){return _0x4ccd2f['id'];}else{var _0x316014=_['every'](_['map'](_0x860c38,_0x0012('0x94')),function(_0x50acf5){return _[_0x0012('0x95')](_0x1c0814,_0x50acf5);});if(_0x316014){return _0x4ccd2f['id'];}}}));}}return BPromise['all'](_0x272b17)[_0x0012('0x29')](function(_0x3153a3){_0x1c1b75=_(_0x1c1b75)[_0x0012('0x96')](_0x3153a3)[_0x0012('0x97')]()[_0x0012('0x98')]();return db['VoicePrefix'][_0x0012('0x50')]({'where':{'id':_0x12c6fa['params']['id']}})[_0x0012('0x29')](function(_0x343e40){return db['sequelize']['transaction'](function(_0x260d80){return _0x343e40[_0x0012('0x8b')](_0x12c6fa[_0x0012('0x38')]['ids'],{'transaction':_0x260d80})[_0x0012('0x29')](function(){if(!_[_0x0012('0x99')](_0x1c1b75)){return _0x343e40[_0x0012('0x79')](_0x1c1b75,{'transaction':_0x260d80});}})[_0x0012('0x29')](function(){_0x1c1b75['forEach'](function(_0x5d5544){socket[_0x0012('0x78')](_0x0012('0x7b'),{'UserId':_0x5d5544,'VoicePrefixId':_0x343e40['id']});});});});});});})['then'](respondWithStatusCode(_0x5b1cb3,null))[_0x0012('0x4f')](handleError(_0x5b1cb3,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index e1a033c..7634c84 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 _0xcbe8=['hasOwnProperty','hook','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x1ab0e6,_0x17ba8d){var _0x248815=function(_0x5d2b40){while(--_0x5d2b40){_0x1ab0e6['push'](_0x1ab0e6['shift']());}};_0x248815(++_0x17ba8d);}(_0xcbe8,0x1d6));var _0x8cbe=function(_0x48dbe0,_0x51ce3f){_0x48dbe0=_0x48dbe0-0x0;var _0x10992a=_0xcbe8[_0x48dbe0];return _0x10992a;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x8cbe('0x0'))['db'][_0x8cbe('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8cbe('0x2')](0x0);var events={'afterCreate':_0x8cbe('0x3'),'afterUpdate':_0x8cbe('0x4'),'afterDestroy':_0x8cbe('0x5')};function emitEvent(_0x5df7bb){return function(_0x30cc6a,_0x522a85,_0x502584){VoicePrefixEvents[_0x8cbe('0x6')](_0x5df7bb+':'+_0x30cc6a['id'],_0x30cc6a);VoicePrefixEvents[_0x8cbe('0x6')](_0x5df7bb,_0x30cc6a);_0x502584(null);};}for(var e in events){if(events[_0x8cbe('0x7')](e)){var event=events[e];VoicePrefix[_0x8cbe('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x73ba=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x127af0,_0x2127fb){var _0x28902a=function(_0x3a9dc0){while(--_0x3a9dc0){_0x127af0['push'](_0x127af0['shift']());}};_0x28902a(++_0x2127fb);}(_0x73ba,0x190));var _0xa73b=function(_0x4914e1,_0x21fbb1){_0x4914e1=_0x4914e1-0x0;var _0x2ab742=_0x73ba[_0x4914e1];return _0x2ab742;};'use strict';var EventEmitter=require(_0xa73b('0x0'));var VoicePrefix=require(_0xa73b('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xa73b('0x2')](0x0);var events={'afterCreate':_0xa73b('0x3'),'afterUpdate':_0xa73b('0x4'),'afterDestroy':_0xa73b('0x5')};function emitEvent(_0x1a37c4){return function(_0x189bb1,_0x52e708,_0x3bb61e){VoicePrefixEvents[_0xa73b('0x6')](_0x1a37c4+':'+_0x189bb1['id'],_0x189bb1);VoicePrefixEvents[_0xa73b('0x6')](_0x1a37c4,_0x189bb1);_0x3bb61e(null);};}for(var e in events){if(events[_0xa73b('0x7')](e)){var event=events[e];VoicePrefix[_0xa73b('0x8')](e,emitEvent(event));}}module[_0xa73b('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 924d0a7..2c3b550 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 _0x6eae=['define','VoicePrefix','voice_prefixes','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./voicePrefix.attributes','exports'];(function(_0x2e2821,_0x245593){var _0x1a0965=function(_0x237d45){while(--_0x237d45){_0x2e2821['push'](_0x2e2821['shift']());}};_0x1a0965(++_0x245593);}(_0x6eae,0x9f));var _0xe6ea=function(_0x4c4ed4,_0x2fe832){_0x4c4ed4=_0x4c4ed4-0x0;var _0x300016=_0x6eae[_0x4c4ed4];return _0x300016;};'use strict';var _=require(_0xe6ea('0x0'));var util=require('util');var logger=require(_0xe6ea('0x1'))(_0xe6ea('0x2'));var moment=require(_0xe6ea('0x3'));var BPromise=require(_0xe6ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6ea('0x5'));var rimraf=require(_0xe6ea('0x6'));var config=require('../../config/environment');var attributes=require(_0xe6ea('0x7'));module[_0xe6ea('0x8')]=function(_0x194a97,_0x3eebeb){return _0x194a97[_0xe6ea('0x9')](_0xe6ea('0xa'),attributes,{'tableName':_0xe6ea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0c9=['./voicePrefix.attributes','VoicePrefix','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4f9636,_0x351ee0){var _0x17bd52=function(_0x25a108){while(--_0x25a108){_0x4f9636['push'](_0x4f9636['shift']());}};_0x17bd52(++_0x351ee0);}(_0xc0c9,0xbd));var _0x9c0c=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xc0c9[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x9c0c('0x0'));var util=require('util');var logger=require(_0x9c0c('0x1'))(_0x9c0c('0x2'));var moment=require(_0x9c0c('0x3'));var BPromise=require(_0x9c0c('0x4'));var rp=require(_0x9c0c('0x5'));var fs=require('fs');var path=require(_0x9c0c('0x6'));var rimraf=require(_0x9c0c('0x7'));var config=require(_0x9c0c('0x8'));var attributes=require(_0x9c0c('0x9'));module['exports']=function(_0x55b698,_0x39d022){return _0x55b698['define'](_0x9c0c('0xa'),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 dd7b17f..0d86a00 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 _0x084b=['http','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4f7a8a,_0x590072){var _0x356fdc=function(_0x4d8d34){while(--_0x4d8d34){_0x4f7a8a['push'](_0x4f7a8a['shift']());}};_0x356fdc(++_0x590072);}(_0x084b,0xd5));var _0xb084=function(_0x4a2a8b,_0x40f374){_0x4a2a8b=_0x4a2a8b-0x0;var _0x4a7583=_0x084b[_0x4a2a8b];return _0x4a7583;};'use strict';var _=require(_0xb084('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb084('0x1'));var fs=require('fs');var Redis=require(_0xb084('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb084('0x3'));var logger=require(_0xb084('0x4'))(_0xb084('0x5'));var config=require('../../config/environment');var jayson=require(_0xb084('0x6'));var client=jayson['client'][_0xb084('0x7')]({'port':0x232a});config[_0xb084('0x8')]=_[_0xb084('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb084('0xa'))(new Redis(config[_0xb084('0x8')]));require(_0xb084('0xb'))[_0xb084('0xc')](socket);function respondWithRpcPromise(_0xebe5ee,_0x4542bd,_0x2b23e9){return new BPromise(function(_0x111211,_0x145198){return client[_0xb084('0xd')](_0xebe5ee,_0x2b23e9)[_0xb084('0xe')](function(_0x1e4166){logger[_0xb084('0xf')](_0xb084('0x10'),_0x4542bd,'request\x20sent');logger['debug'](_0xb084('0x11'),_0x4542bd,'request\x20sent',JSON['stringify'](_0x1e4166));if(_0x1e4166[_0xb084('0x12')]){if(_0x1e4166[_0xb084('0x12')]['code']===0x1f4){logger['error'](_0xb084('0x10'),_0x4542bd,_0x1e4166[_0xb084('0x12')][_0xb084('0x13')]);return _0x145198(_0x1e4166[_0xb084('0x12')][_0xb084('0x13')]);}logger['error'](_0xb084('0x10'),_0x4542bd,_0x1e4166[_0xb084('0x12')][_0xb084('0x13')]);return _0x111211(_0x1e4166[_0xb084('0x12')][_0xb084('0x13')]);}else{logger[_0xb084('0xf')](_0xb084('0x10'),_0x4542bd,_0xb084('0x14'));_0x111211(_0x1e4166[_0xb084('0x15')][_0xb084('0x13')]);}})['catch'](function(_0x49884a){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x4542bd,_0x49884a);_0x145198(_0x49884a);});});} \ No newline at end of file +var _0x9541=['http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','VoicePrefix,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x3313f3,_0x52362b){var _0x3c3c38=function(_0x55545e){while(--_0x55545e){_0x3313f3['push'](_0x3313f3['shift']());}};_0x3c3c38(++_0x52362b);}(_0x9541,0xb3));var _0x1954=function(_0x4f7396,_0x4f3ea2){_0x4f7396=_0x4f7396-0x0;var _0xce8e83=_0x9541[_0x4f7396];return _0xce8e83;};'use strict';var _=require(_0x1954('0x0'));var util=require(_0x1954('0x1'));var moment=require(_0x1954('0x2'));var BPromise=require(_0x1954('0x3'));var rs=require(_0x1954('0x4'));var fs=require('fs');var Redis=require(_0x1954('0x5'));var db=require(_0x1954('0x6'))['db'];var utils=require(_0x1954('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1954('0x8'));var jayson=require(_0x1954('0x9'));var client=jayson['client'][_0x1954('0xa')]({'port':0x232a});config[_0x1954('0xb')]=_[_0x1954('0xc')](config[_0x1954('0xb')],{'host':_0x1954('0xd'),'port':0x18eb});var socket=require(_0x1954('0xe'))(new Redis(config['redis']));require(_0x1954('0xf'))[_0x1954('0x10')](socket);function respondWithRpcPromise(_0xb8ac4b,_0x3b4a4c,_0x40bbfb){return new BPromise(function(_0x1733f8,_0x2f711d){return client[_0x1954('0x11')](_0xb8ac4b,_0x40bbfb)['then'](function(_0x39e5fe){logger[_0x1954('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x3b4a4c,_0x1954('0x13'));logger['debug'](_0x1954('0x14'),_0x3b4a4c,'request\x20sent',JSON['stringify'](_0x39e5fe));if(_0x39e5fe['error']){if(_0x39e5fe[_0x1954('0x15')][_0x1954('0x16')]===0x1f4){logger[_0x1954('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x3b4a4c,_0x39e5fe[_0x1954('0x15')]['message']);return _0x2f711d(_0x39e5fe['error'][_0x1954('0x17')]);}logger[_0x1954('0x15')](_0x1954('0x18'),_0x3b4a4c,_0x39e5fe[_0x1954('0x15')][_0x1954('0x17')]);return _0x1733f8(_0x39e5fe[_0x1954('0x15')][_0x1954('0x17')]);}else{logger[_0x1954('0x12')](_0x1954('0x18'),_0x3b4a4c,_0x1954('0x13'));_0x1733f8(_0x39e5fe[_0x1954('0x19')][_0x1954('0x17')]);}})[_0x1954('0x1a')](function(_0x40caff){logger[_0x1954('0x15')](_0x1954('0x18'),_0x3b4a4c,_0x40caff);_0x2f711d(_0x40caff);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 7d6d2b5..bf74f40 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 _0xd139=['save','emit','removeListener','length','./voicePrefix.events'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd139,0x14e));var _0x9d13=function(_0x1c1194,_0x9219db){_0x1c1194=_0x1c1194-0x0;var _0x539906=_0xd139[_0x1c1194];return _0x539906;};'use strict';var VoicePrefixEvents=require(_0x9d13('0x0'));var events=[_0x9d13('0x1'),'remove','update'];function createListener(_0x21fb63,_0x477215){return function(_0x3d392a){_0x477215[_0x9d13('0x2')](_0x21fb63,_0x3d392a);};}function removeListener(_0x1d39f0,_0xdeacf6){return function(){VoicePrefixEvents[_0x9d13('0x3')](_0x1d39f0,_0xdeacf6);};}exports['register']=function(_0x4c8e60){for(var _0x2918eb=0x0,_0x50294b=events[_0x9d13('0x4')];_0x2918eb<_0x50294b;_0x2918eb++){var _0x4b3db0=events[_0x2918eb];var _0x434ef6=createListener('voicePrefix:'+_0x4b3db0,_0x4c8e60);VoicePrefixEvents['on'](_0x4b3db0,_0x434ef6);}}; \ No newline at end of file +var _0xa74f=['emit','removeListener','length','voicePrefix:','remove'];(function(_0x3c8f01,_0x53646e){var _0x4c8c52=function(_0xe32b8c){while(--_0xe32b8c){_0x3c8f01['push'](_0x3c8f01['shift']());}};_0x4c8c52(++_0x53646e);}(_0xa74f,0x9a));var _0xfa74=function(_0x1a595a,_0x263824){_0x1a595a=_0x1a595a-0x0;var _0x33f008=_0xa74f[_0x1a595a];return _0x33f008;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0xfa74('0x0'),'update'];function createListener(_0x4b5765,_0x29e4c8){return function(_0x110824){_0x29e4c8[_0xfa74('0x1')](_0x4b5765,_0x110824);};}function removeListener(_0x25a9b7,_0x5b367b){return function(){VoicePrefixEvents[_0xfa74('0x2')](_0x25a9b7,_0x5b367b);};}exports['register']=function(_0x543cfe){for(var _0x43dd2f=0x0,_0x9ddbd2=events[_0xfa74('0x3')];_0x43dd2f<_0x9ddbd2;_0x43dd2f++){var _0x2d9fa9=events[_0x43dd2f];var _0x287921=createListener(_0xfa74('0x4')+_0x2d9fa9,_0x543cfe);VoicePrefixEvents['on'](_0x2d9fa9,_0x287921);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 73ed915..7537905 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x40227a,_0x30a9fe){var _0x5c6e0c=function(_0x4dcd2a){while(--_0x4dcd2a){_0x40227a['push'](_0x40227a['shift']());}};_0x5c6e0c(++_0x30a9fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x4089b3,_0x1f63e7){var _0x3d2460=function(_0x29eadc){while(--_0x29eadc){_0x4089b3['push'](_0x4089b3['shift']());}};_0x3d2460(++_0x1f63e7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index c0c729d..1c976db 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 _0xab10=['Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','fewestcalls','rrmemory','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','predictive','power','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)'];(function(_0x349d8a,_0x80fbc5){var _0x5657e0=function(_0xf103eb){while(--_0xf103eb){_0x349d8a['push'](_0x349d8a['shift']());}};_0x5657e0(++_0x80fbc5);}(_0xab10,0xc0));var _0x0ab1=function(_0x55da52,_0x31e164){_0x55da52=_0x55da52-0x0;var _0x518aa8=_0xab10[_0x55da52];return _0x518aa8;};'use strict';var Sequelize=require(_0x0ab1('0x0'));module[_0x0ab1('0x1')]={'name':{'type':Sequelize[_0x0ab1('0x2')],'allowNull':![],'unique':_0x0ab1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0ab1('0x4')](_0x0ab1('0x5'),_0x0ab1('0x6')),'allowNull':![],'defaultValue':_0x0ab1('0x5')},'musiconhold':{'type':Sequelize[_0x0ab1('0x2')],'defaultValue':_0x0ab1('0x7')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x0ab1('0x4')]('rr',_0x0ab1('0x8'),'leastrecent',_0x0ab1('0x9'),'random',_0x0ab1('0xa'),'linear',_0x0ab1('0xb'),_0x0ab1('0xc')),'allowNull':![],'defaultValue':_0x0ab1('0x8'),'set':function(_0x34f714){this[_0x0ab1('0xd')](_0x0ab1('0xe'),_0x34f714?_0x34f714:_0x0ab1('0xa'));},'get':function(){var _0x53aa10=this[_0x0ab1('0xf')](_0x0ab1('0x10'));var _0x36c512=this[_0x0ab1('0xf')](_0x0ab1('0x11'));var _0x497b96=this[_0x0ab1('0xf')](_0x0ab1('0xe'));if(_0x53aa10===_0x0ab1('0x5')){return _0x497b96;}if(_0x36c512===_0x0ab1('0x12')&&_0x497b96==='rrmemory'||_0x36c512===_0x0ab1('0x12')&&_0x497b96===_0x0ab1('0x13')){return _0x497b96;}if(_0x36c512==='progressive'||_0x36c512===_0x0ab1('0x14')||_0x36c512===_0x0ab1('0x15')){return _0x497b96;}return null;}},'servicelevel':{'type':Sequelize[_0x0ab1('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0ab1('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0ab1('0x16')](0xb)},'timeout':{'type':Sequelize[_0x0ab1('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x0ab1('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0ab1('0x2')]},'weight':{'type':Sequelize[_0x0ab1('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0ab1('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0ab1('0x4')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x0ab1('0x4')](_0x0ab1('0x17'),'no',_0x0ab1('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0ab1('0x16')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x0ab1('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0ab1('0x4')](_0x0ab1('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0ab1('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0ab1('0x4')](_0x0ab1('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x0ab1('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0ab1('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0ab1('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x0ab1('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0ab1('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0ab1('0x4')](_0x0ab1('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x0ab1('0x4')](_0x0ab1('0x17'),'no'),'defaultValue':_0x0ab1('0x17')},'announce_holdtime':{'type':Sequelize[_0x0ab1('0x4')](_0x0ab1('0x17'),'no',_0x0ab1('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0ab1('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x0ab1('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x0ab1('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0ab1('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0ab1('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0ab1('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0ab1('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0ab1('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0ab1('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0ab1('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0ab1('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0ab1('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x0ab1('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0ab1('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0ab1('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x1ad6db){this[_0x0ab1('0xd')](_0x0ab1('0x1a'),_0x1ad6db?_0x1ad6db[_0x0ab1('0x1b')](','):[]);},'get':function(){return this[_0x0ab1('0xf')](_0x0ab1('0x1a'))?this[_0x0ab1('0xf')](_0x0ab1('0x1a'))[_0x0ab1('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x0ab1('0x2')],'defaultValue':_0x0ab1('0x17'),'set':function(_0x740496){this[_0x0ab1('0xd')](_0x0ab1('0x1d'),_0x740496?_0x740496[_0x0ab1('0x1b')](','):undefined);},'get':function(){return this[_0x0ab1('0xf')]('joinempty')?this[_0x0ab1('0xf')](_0x0ab1('0x1d'))[_0x0ab1('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0xfa8141){this[_0x0ab1('0xd')](_0x0ab1('0x1e'),_0xfa8141?_0xfa8141[_0x0ab1('0x1b')](','):undefined);},'get':function(){return this[_0x0ab1('0xf')]('leavewhenempty')?this[_0x0ab1('0xf')](_0x0ab1('0x1e'))[_0x0ab1('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0ab1('0x4')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0ab1('0x4')](_0x0ab1('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x0ab1('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0ab1('0x4')](_0x0ab1('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0ab1('0x2')]},'description':{'type':Sequelize[_0x0ab1('0x2')]},'acw':{'type':Sequelize[_0x0ab1('0x1f')],'defaultValue':0x0,'set':function(_0x5be76b){this[_0x0ab1('0xd')](_0x0ab1('0x20'),_0x5be76b);if(_0x5be76b){if(this[_0x0ab1('0xf')]('wrapuptime')<0x2){this[_0x0ab1('0xd')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0ab1('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0ab1('0x1f')],'defaultValue':0x0,'comment':_0x0ab1('0x21')},'dialMethod':{'type':Sequelize[_0x0ab1('0x4')]('preview',_0x0ab1('0x22'),'power',_0x0ab1('0x14'),_0x0ab1('0x12')),'defaultValue':_0x0ab1('0x22'),'comment':_0x0ab1('0x23')},'dialLimitChannel':{'type':Sequelize[_0x0ab1('0x16')](0x4)[_0x0ab1('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0ab1('0x25')},'dialLimitQueue':{'type':Sequelize[_0x0ab1('0x16')](0x4)[_0x0ab1('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0ab1('0x26')},'dialPowerLevel':{'type':Sequelize[_0x0ab1('0x27')](0x2)[_0x0ab1('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0ab1('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x0ab1('0x4')]('agentBusyFactor',_0x0ab1('0x29')),'defaultValue':_0x0ab1('0x29'),'comment':_0x0ab1('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0ab1('0x27')](0x2)[_0x0ab1('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0ab1('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0ab1('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0ab1('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0ab1('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0ab1('0x16')](0x3)[_0x0ab1('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ab1('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x0ab1('0x2')],'defaultValue':'tTxX','comment':_0x0ab1('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x0ab1('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ab1('0x2f')},'dialQueueProject':{'type':Sequelize[_0x0ab1('0x2')],'comment':_0x0ab1('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0ab1('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0ab1('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ab1('0x31')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ab1('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0ab1('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ab1('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0ab1('0x24')],'defaultValue':0x3,'comment':_0x0ab1('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0ab1('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ab1('0x35')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0ab1('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0ab1('0x36')},'dialTimezone':{'type':Sequelize[_0x0ab1('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0ab1('0x2')],'defaultValue':_0x0ab1('0x37')},'dialPrefix':{'type':Sequelize[_0x0ab1('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x0ab1('0x4')](_0x0ab1('0x38'),_0x0ab1('0x39'),'onlyIfOpen'),'defaultValue':_0x0ab1('0x38')},'dialAMDActive':{'type':Sequelize[_0x0ab1('0x1f')],'defaultValue':0x0,'comment':_0x0ab1('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x0ab1('0x16')](0x9)[_0x0ab1('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0ab1('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x0ab1('0x16')](0x9)[_0x0ab1('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0ab1('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0ab1('0x16')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0ab1('0x16')](0x9)[_0x0ab1('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x0ab1('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0ab1('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0ab1('0x16')](0x9)[_0x0ab1('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0ab1('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0ab1('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0ab1('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0ab1('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0ab1('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0ab1('0x16')](0x9)[_0x0ab1('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0ab1('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x0ab1('0x16')](0x5)[_0x0ab1('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0ab1('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x0ab1('0x1f')],'defaultValue':0x0,'comment':_0x0ab1('0x43')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x0ab1('0x44'),_0x0ab1('0x45')),'defaultValue':_0x0ab1('0x44')},'dialQueueProject2':{'type':Sequelize[_0x0ab1('0x2')],'comment':_0x0ab1('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0ab1('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0ab1('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0ab1('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0ab1('0x46')},'dialCutDigit':{'type':Sequelize[_0x0ab1('0x16')](0x3)[_0x0ab1('0x24')],'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':_0x0ab1('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0ab1('0x16')](0x5)[_0x0ab1('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x0ab1('0x16')](0x3)[_0x0ab1('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ab1('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x0ab1('0x16')](0x5)[_0x0ab1('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ab1('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0ab1('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ab1('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0ab1('0x16')](0x5)[_0x0ab1('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x0ab1('0x16')](0x3)[_0x0ab1('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0ab1('0x16')](0x5)[_0x0ab1('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ab1('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0ab1('0x16')](0x3)[_0x0ab1('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ab1('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0ab1('0x16')](0x5)[_0x0ab1('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ab1('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0ab1('0x16')],'allowNull':!![],'comment':_0x0ab1('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x0ab1('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1cea98){if(!_0x1cea98)this[_0x0ab1('0xd')](_0x0ab1('0x4f'),null);this['setDataValue'](_0x0ab1('0x50'),_0x1cea98);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x0ab1('0x16')](0x3)[_0x0ab1('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x0ab1('0x16')](0x3)[_0x0ab1('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x0ab1('0x1f')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x0ab1('0x1f')],'defaultValue':![]}}; \ No newline at end of file +var _0xde0a=['UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','BOOLEAN','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','TEXT','periodic_announce','split','join','joinempty','leavewhenempty','acw','wrapuptime','preview'];(function(_0x300dd9,_0xf8e587){var _0x5e58d8=function(_0x2aa160){while(--_0x2aa160){_0x300dd9['push'](_0x300dd9['shift']());}};_0x5e58d8(++_0xf8e587);}(_0xde0a,0xcb));var _0xade0=function(_0x3dcb23,_0x54cf68){_0x3dcb23=_0x3dcb23-0x0;var _0x47730b=_0xde0a[_0x3dcb23];return _0x47730b;};'use strict';var Sequelize=require(_0xade0('0x0'));module[_0xade0('0x1')]={'name':{'type':Sequelize[_0xade0('0x2')],'allowNull':![],'unique':_0xade0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xade0('0x4')](_0xade0('0x5'),_0xade0('0x6')),'allowNull':![],'defaultValue':_0xade0('0x5')},'musiconhold':{'type':Sequelize[_0xade0('0x2')],'defaultValue':_0xade0('0x7')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xade0('0x8'),_0xade0('0x9'),_0xade0('0xa'),_0xade0('0xb'),_0xade0('0xc'),'linear',_0xade0('0xd'),_0xade0('0xe')),'allowNull':![],'defaultValue':_0xade0('0x8'),'set':function(_0x32b4b4){this[_0xade0('0xf')](_0xade0('0x10'),_0x32b4b4?_0x32b4b4:_0xade0('0xc'));},'get':function(){var _0x97dfab=this[_0xade0('0x11')](_0xade0('0x12'));var _0x315ce7=this[_0xade0('0x11')](_0xade0('0x13'));var _0x561dcc=this[_0xade0('0x11')](_0xade0('0x10'));if(_0x97dfab==='inbound'){return _0x561dcc;}if(_0x315ce7===_0xade0('0x14')&&_0x561dcc===_0xade0('0xc')||_0x315ce7===_0xade0('0x14')&&_0x561dcc===_0xade0('0x15')){return _0x561dcc;}if(_0x315ce7===_0xade0('0x16')||_0x315ce7===_0xade0('0x17')||_0x315ce7===_0xade0('0x18')){return _0x561dcc;}return null;}},'servicelevel':{'type':Sequelize[_0xade0('0x19')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xade0('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xade0('0x19')](0xb)},'timeout':{'type':Sequelize[_0xade0('0x19')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xade0('0x19')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xade0('0x2')]},'weight':{'type':Sequelize[_0xade0('0x19')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xade0('0x19')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xade0('0x4')]('yes','no'),'defaultValue':_0xade0('0x1a')},'autopause':{'type':Sequelize[_0xade0('0x4')]('yes','no',_0xade0('0x1b')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xade0('0x19')](0xb)},'autopausebusy':{'type':Sequelize[_0xade0('0x4')](_0xade0('0x1a'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xade0('0x1a'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xade0('0x1a'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xade0('0x4')](_0xade0('0x1a'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xade0('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xade0('0x1a'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xade0('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xade0('0x19')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xade0('0x19')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xade0('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xade0('0x4')](_0xade0('0x1a'),'no'),'defaultValue':_0xade0('0x1a')},'announce_holdtime':{'type':Sequelize[_0xade0('0x4')](_0xade0('0x1a'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xade0('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xade0('0x1a'),'no')},'announce_position_limit':{'type':Sequelize[_0xade0('0x19')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xade0('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xade0('0x2')]},'queue_youarenext':{'type':Sequelize[_0xade0('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xade0('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xade0('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xade0('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xade0('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xade0('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xade0('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xade0('0x2')]},'queue_quantity1':{'type':Sequelize[_0xade0('0x2')]},'queue_quantity2':{'type':Sequelize[_0xade0('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xade0('0x2')]},'queue_less_than':{'type':Sequelize[_0xade0('0x2')]},'periodic_announce':{'type':Sequelize[_0xade0('0x1c')],'set':function(_0x20ee88){this[_0xade0('0xf')](_0xade0('0x1d'),_0x20ee88?_0x20ee88['join'](','):[]);},'get':function(){return this[_0xade0('0x11')](_0xade0('0x1d'))?this[_0xade0('0x11')]('periodic_announce')[_0xade0('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0xade0('0x2')],'defaultValue':_0xade0('0x1a'),'set':function(_0xa5c73){this[_0xade0('0xf')]('joinempty',_0xa5c73?_0xa5c73[_0xade0('0x1f')](','):undefined);},'get':function(){return this[_0xade0('0x11')](_0xade0('0x20'))?this[_0xade0('0x11')](_0xade0('0x20'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xade0('0x2')],'defaultValue':'no','set':function(_0x25801d){this['setDataValue'](_0xade0('0x21'),_0x25801d?_0x25801d[_0xade0('0x1f')](','):undefined);},'get':function(){return this[_0xade0('0x11')](_0xade0('0x21'))?this['getDataValue'](_0xade0('0x21'))[_0xade0('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xade0('0x4')](_0xade0('0x1a'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xade0('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xade0('0x4')](_0xade0('0x1a'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xade0('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x2600f3){this[_0xade0('0xf')](_0xade0('0x22'),_0x2600f3);if(_0x2600f3){if(this[_0xade0('0x11')]('wrapuptime')<0x2){this['setDataValue'](_0xade0('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0xade0('0x24'),_0xade0('0x16'),_0xade0('0x18'),_0xade0('0x17'),_0xade0('0x14')),'defaultValue':_0xade0('0x16'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xade0('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xade0('0x26')},'dialPowerLevel':{'type':Sequelize[_0xade0('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xade0('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0xade0('0x4')]('agentBusyFactor','dropRate'),'defaultValue':_0xade0('0x29'),'comment':_0xade0('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xade0('0x27')](0x2)[_0xade0('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xade0('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xade0('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0xade0('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xade0('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xade0('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xade0('0x2')],'defaultValue':_0xade0('0x2d'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xade0('0x19')](0x3)[_0xade0('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xade0('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xade0('0x19')](0x3)[_0xade0('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xade0('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xade0('0x19')](0x5)[_0xade0('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xade0('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xade0('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0xade0('0x19')](0x5)[_0xade0('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xade0('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xade0('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xade0('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xade0('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xade0('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0xade0('0x19')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xade0('0x33')},'dialTimezone':{'type':Sequelize[_0xade0('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xade0('0x2')],'defaultValue':_0xade0('0x34')},'dialPrefix':{'type':Sequelize[_0xade0('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xade0('0x35'),_0xade0('0x36')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xade0('0x37')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xade0('0x19')](0x9)[_0xade0('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xade0('0x19')](0x9)[_0xade0('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xade0('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xade0('0x19')](0x9)[_0xade0('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xade0('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xade0('0x19')](0x9)[_0xade0('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xade0('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0xade0('0x19')](0x9)[_0xade0('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xade0('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xade0('0x19')](0x9)[_0xade0('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xade0('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xade0('0x19')](0x9)[_0xade0('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xade0('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xade0('0x19')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xade0('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xade0('0x19')](0x9)[_0xade0('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xade0('0x3f')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xade0('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xade0('0x40')},'dialRecallInQueue':{'type':Sequelize[_0xade0('0x37')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xade0('0x41'),_0xade0('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xade0('0x2')],'comment':_0xade0('0x43')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xade0('0x37')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xade0('0x19')](0x3)[_0xade0('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xade0('0x44')},'dialCutDigit':{'type':Sequelize[_0xade0('0x19')](0x3)[_0xade0('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xade0('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xade0('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xade0('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xade0('0x19')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xade0('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0xade0('0x19')](0x3)[_0xade0('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xade0('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0xade0('0x19')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xade0('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xade0('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xade0('0x19')](0x5)[_0xade0('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xade0('0x4a')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xade0('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xade0('0x19')](0x5)[_0xade0('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xade0('0x19')](0x3)[_0xade0('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xade0('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xade0('0x19')](0x5)[_0xade0('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xade0('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xade0('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0xade0('0x37')],'defaultValue':![],'comment':_0xade0('0x4e'),'set':function(_0x172127){if(!_0x172127)this[_0xade0('0xf')](_0xade0('0x4f'),null);this['setDataValue']('mandatoryDisposition',_0x172127);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xade0('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xade0('0x19')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xade0('0x37')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xade0('0x37')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index c41619b..b549150 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 _0xc413=['ListId','ContactId','CmListId','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','removeLists','addBlackLists','cm_hopper_black','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','params','findOne','CmHopper','nolimit','rows','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','voicePause','flatMap','Agents','forEach','penalty','sequelize','transaction','TeamVoiceQueue','upsert','UserVoiceQueue','each','isNil','format','SIP/%s','interface','emit','userVoiceQueue:save','ids','User','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','UserVoiceQueueRt','addAgents','online','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt'];(function(_0x5d1d6c,_0x8c94ff){var _0x3f4b02=function(_0x12a703){while(--_0x12a703){_0x5d1d6c['push'](_0x5d1d6c['shift']());}};_0x3f4b02(++_0x8c94ff);}(_0xc413,0xcd));var _0x3c41=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xc413[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require(_0x3c41('0x0'));var rimraf=require(_0x3c41('0x1'));var zipdir=require(_0x3c41('0x2'));var jsonpatch=require(_0x3c41('0x3'));var rp=require(_0x3c41('0x4'));var moment=require(_0x3c41('0x5'));var BPromise=require(_0x3c41('0x6'));var Mustache=require(_0x3c41('0x7'));var util=require(_0x3c41('0x8'));var path=require(_0x3c41('0x9'));var sox=require(_0x3c41('0xa'));var csv=require(_0x3c41('0xb'));var ejs=require(_0x3c41('0xc'));var fs=require('fs');var fs_extra=require(_0x3c41('0xd'));var _=require('lodash');var squel=require(_0x3c41('0xe'));var crypto=require(_0x3c41('0xf'));var jsforce=require(_0x3c41('0x10'));var deskjs=require(_0x3c41('0x11'));var toCsv=require('to-csv');var querystring=require(_0x3c41('0x12'));var Papa=require(_0x3c41('0x13'));var Redis=require(_0x3c41('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x3c41('0x15'));var as=require(_0x3c41('0x16'));var hardwareService=require(_0x3c41('0x17'));var logger=require(_0x3c41('0x18'))(_0x3c41('0x19'));var utils=require('../../config/utils');var config=require(_0x3c41('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x3c41('0x1b'))['db'];config[_0x3c41('0x1c')]=_[_0x3c41('0x1d')](config['redis'],{'host':_0x3c41('0x1e'),'port':0x18eb});var socket=require(_0x3c41('0x1f'))(new Redis(config[_0x3c41('0x1c')]));require('./voiceQueue.socket')[_0x3c41('0x20')](socket);function respondWithStatusCode(_0x20de93,_0xbd9a01){_0xbd9a01=_0xbd9a01||0xcc;return function(_0x473bb3){if(_0x473bb3){return _0x20de93[_0x3c41('0x21')](_0xbd9a01);}return _0x20de93[_0x3c41('0x22')](_0xbd9a01)[_0x3c41('0x23')]();};}function respondWithResult(_0x3a4db4,_0x18dd4a){_0x18dd4a=_0x18dd4a||0xc8;return function(_0x2d4ff6){if(_0x2d4ff6){return _0x3a4db4[_0x3c41('0x22')](_0x18dd4a)['json'](_0x2d4ff6);}};}function respondWithFilteredResult(_0x145742,_0xcdc8c4){return function(_0x28797a){if(_0x28797a){var _0x444ec2=typeof _0xcdc8c4[_0x3c41('0x24')]===_0x3c41('0x25')&&typeof _0xcdc8c4[_0x3c41('0x26')]==='undefined';var _0x14365a=_0x28797a[_0x3c41('0x27')];var _0x5674d9=_0x444ec2?0x0:_0xcdc8c4[_0x3c41('0x24')];var _0x8b8b99=_0x444ec2?_0x28797a[_0x3c41('0x27')]:_0xcdc8c4[_0x3c41('0x24')]+_0xcdc8c4[_0x3c41('0x26')];var _0x2ba20d;if(_0x8b8b99>=_0x14365a){_0x8b8b99=_0x14365a;_0x2ba20d=0xc8;}else{_0x2ba20d=0xce;}_0x145742[_0x3c41('0x22')](_0x2ba20d);return _0x145742['set'](_0x3c41('0x28'),_0x5674d9+'-'+_0x8b8b99+'/'+_0x14365a)[_0x3c41('0x29')](_0x28797a);}return null;};}function patchUpdates(_0x5c638b){return function(_0x191087){try{jsonpatch[_0x3c41('0x2a')](_0x191087,_0x5c638b,!![]);}catch(_0x4414dc){return BPromise['reject'](_0x4414dc);}return _0x191087['save']();};}function saveUpdates(_0xe353f2,_0x152c9d){return function(_0x40a227){if(_0x40a227){return _0x40a227[_0x3c41('0x2b')](_0xe353f2)['then'](function(_0x20f034){return _0x20f034;});}return null;};}function removeEntity(_0x46667a,_0x424f6d){return function(_0x1f2879){if(_0x1f2879){return _0x1f2879[_0x3c41('0x2c')]()[_0x3c41('0x2d')](function(){var _0x2fb4aa=_0x1f2879[_0x3c41('0x2e')]({'plain':!![]});var _0x4d2c3f=[{'name':_0x3c41('0x2f'),'value':_0x3c41('0x30'),'ignore':![]},{'name':_0x3c41('0x31'),'value':_0x3c41('0x32'),'ignore':![]}];var _0x135212=_(_0x4d2c3f)[_0x3c41('0x33')](_0x3c41('0x34'))[_0x3c41('0x35')](_0x3c41('0x36'))['value']();if(_['includes'](_0x135212,_0x2fb4aa[_0x3c41('0x37')])){return;}var _0x4782ec=_['find'](_0x4d2c3f,[_0x3c41('0x36'),_0x2fb4aa[_0x3c41('0x37')]])[_0x3c41('0x38')];return db[_0x3c41('0x39')]['destroy']({'where':{'type':_0x4782ec,'resourceId':_0x2fb4aa['id']}})[_0x3c41('0x2d')](function(){return _0x1f2879;});})[_0x3c41('0x2d')](function(){_0x46667a[_0x3c41('0x22')](0xcc)[_0x3c41('0x23')]();});}};}function handleEntityNotFound(_0x4ff9f2,_0x175d5f){return function(_0x20a8d6){if(!_0x20a8d6){_0x4ff9f2['sendStatus'](0x194);}return _0x20a8d6;};}function handleError(_0x50d8e3,_0x2f249a){_0x2f249a=_0x2f249a||0x1f4;return function(_0xc8aba7){logger[_0x3c41('0x3a')](_0xc8aba7[_0x3c41('0x3b')]);if(_0xc8aba7['name']){delete _0xc8aba7['name'];}_0x50d8e3[_0x3c41('0x22')](_0x2f249a)[_0x3c41('0x3c')](_0xc8aba7);};}exports[_0x3c41('0x3d')]=function(_0xd90ab0,_0x413e9e){var _0x1366dc={},_0x27d1c8={},_0x58a04e={'count':0x0,'rows':[]};var _0x186cc7=_['map'](db[_0x3c41('0x3e')][_0x3c41('0x3f')],function(_0x103f93){return{'name':_0x103f93[_0x3c41('0x40')],'type':_0x103f93[_0x3c41('0x37')]['key']};});_0x27d1c8[_0x3c41('0x41')]=_[_0x3c41('0x35')](_0x186cc7,'name');_0x27d1c8[_0x3c41('0x42')]=_[_0x3c41('0x43')](_0xd90ab0[_0x3c41('0x42')]);_0x27d1c8[_0x3c41('0x44')]=_[_0x3c41('0x45')](_0x27d1c8['model'],_0x27d1c8[_0x3c41('0x42')]);_0x1366dc[_0x3c41('0x46')]=_[_0x3c41('0x45')](_0x27d1c8[_0x3c41('0x41')],qs[_0x3c41('0x47')](_0xd90ab0[_0x3c41('0x42')]['fields']));_0x1366dc[_0x3c41('0x46')]=_0x1366dc['attributes'][_0x3c41('0x48')]?_0x1366dc[_0x3c41('0x46')]:_0x27d1c8[_0x3c41('0x41')];if(!_0xd90ab0[_0x3c41('0x42')][_0x3c41('0x49')]('nolimit')){_0x1366dc[_0x3c41('0x26')]=qs[_0x3c41('0x26')](_0xd90ab0[_0x3c41('0x42')]['limit']);_0x1366dc[_0x3c41('0x24')]=qs['offset'](_0xd90ab0['query'][_0x3c41('0x24')]);}_0x1366dc[_0x3c41('0x4a')]=qs['sort'](_0xd90ab0['query'][_0x3c41('0x4b')]);_0x1366dc[_0x3c41('0x4c')]=qs[_0x3c41('0x44')](_[_0x3c41('0x4d')](_0xd90ab0[_0x3c41('0x42')],_0x27d1c8[_0x3c41('0x44')]),_0x186cc7);if(_0xd90ab0['query'][_0x3c41('0x33')]){_0x1366dc[_0x3c41('0x4c')]=_[_0x3c41('0x4e')](_0x1366dc['where'],{'$or':_[_0x3c41('0x35')](_0x186cc7,function(_0x7be6de){if(_0x7be6de[_0x3c41('0x37')]!==_0x3c41('0x4f')){var _0x3af289={};_0x3af289[_0x7be6de['name']]={'$like':'%'+_0xd90ab0[_0x3c41('0x42')][_0x3c41('0x33')]+'%'};return _0x3af289;}})});}_0x1366dc=_[_0x3c41('0x4e')]({},_0x1366dc,_0xd90ab0[_0x3c41('0x50')]);var _0x7bc413={'where':_0x1366dc['where']};return db[_0x3c41('0x3e')][_0x3c41('0x27')](_0x7bc413)['then'](function(_0x44ce90){_0x58a04e[_0x3c41('0x27')]=_0x44ce90;if(_0xd90ab0[_0x3c41('0x42')][_0x3c41('0x51')]){_0x1366dc[_0x3c41('0x52')]=[{'all':!![]}];}return db[_0x3c41('0x3e')][_0x3c41('0x53')](_0x1366dc);})['then'](function(_0x113caa){_0x58a04e['rows']=_0x113caa;return _0x58a04e;})[_0x3c41('0x2d')](respondWithFilteredResult(_0x413e9e,_0x1366dc))[_0x3c41('0x54')](handleError(_0x413e9e,null));};exports[_0x3c41('0x55')]=function(_0x351332,_0x4785cb){var _0x1852b2={'raw':![],'where':{'id':_0x351332['params']['id']}},_0x40e3cd={};_0x40e3cd[_0x3c41('0x41')]=_[_0x3c41('0x43')](db[_0x3c41('0x3e')][_0x3c41('0x3f')]);_0x40e3cd[_0x3c41('0x42')]=_[_0x3c41('0x43')](_0x351332[_0x3c41('0x42')]);_0x40e3cd[_0x3c41('0x44')]=_[_0x3c41('0x45')](_0x40e3cd['model'],_0x40e3cd[_0x3c41('0x42')]);_0x1852b2['attributes']=_[_0x3c41('0x45')](_0x40e3cd[_0x3c41('0x41')],qs[_0x3c41('0x47')](_0x351332['query'][_0x3c41('0x47')]));_0x1852b2[_0x3c41('0x46')]=_0x1852b2[_0x3c41('0x46')]['length']?_0x1852b2[_0x3c41('0x46')]:_0x40e3cd[_0x3c41('0x41')];if(_0x351332[_0x3c41('0x42')][_0x3c41('0x51')]){_0x1852b2['include']=[{'all':!![]}];}_0x1852b2=_[_0x3c41('0x4e')]({},_0x1852b2,_0x351332['options']);return db[_0x3c41('0x3e')][_0x3c41('0x56')](_0x1852b2)[_0x3c41('0x2d')](handleEntityNotFound(_0x4785cb,null))[_0x3c41('0x2d')](respondWithResult(_0x4785cb,null))[_0x3c41('0x54')](handleError(_0x4785cb,null));};exports[_0x3c41('0x57')]=function(_0x122401,_0x342c5c){return db[_0x3c41('0x3e')]['create'](_0x122401[_0x3c41('0x58')],{})[_0x3c41('0x2d')](function(_0xb76c75){var _0x4f087e=_0x122401[_0x3c41('0x59')][_0x3c41('0x2e')]({'plain':!![]});if(!_0x4f087e)throw new Error(_0x3c41('0x5a'));if(_0x4f087e[_0x3c41('0x5b')]===_0x3c41('0x59')){var _0xbc0cb1=_0xb76c75['get']({'plain':!![]});var _0x184309=[{'name':_0x3c41('0x2f'),'value':_0x3c41('0x30')},{'name':'QueueCampaigns','value':_0x3c41('0x32')}];var _0x264763=_[_0x3c41('0x56')](_0x184309,[_0x3c41('0x36'),_0xbc0cb1[_0x3c41('0x37')]])[_0x3c41('0x38')];return db[_0x3c41('0x5c')]['find']({'where':{'name':_0x264763,'userProfileId':_0x4f087e['userProfileId']},'raw':!![]})[_0x3c41('0x2d')](function(_0x4eef6c){if(_0x4eef6c&&_0x4eef6c[_0x3c41('0x5d')]===0x0){return db['UserProfileResource']['create']({'name':_0xbc0cb1[_0x3c41('0x38')],'resourceId':_0xbc0cb1['id'],'type':_0x4eef6c['name'],'sectionId':_0x4eef6c['id']},{})[_0x3c41('0x2d')](function(){return _0xb76c75;});}else{return _0xb76c75;}})[_0x3c41('0x54')](function(_0x171666){logger[_0x3c41('0x3a')](_0x3c41('0x5e'),_0x171666);throw _0x171666;});}return _0xb76c75;})['then'](respondWithResult(_0x342c5c,0xc9))[_0x3c41('0x54')](handleError(_0x342c5c,null));};exports[_0x3c41('0x5f')]=function(_0x1dce4b,_0x5abe78){var _0x31d6ea={'where':{'id':_0x1dce4b['params']['id']}},_0x5b8674={};_0x5b8674[_0x3c41('0x41')]=_[_0x3c41('0x43')](db[_0x3c41('0x3e')][_0x3c41('0x3f')]);_0x31d6ea['attributes']=_['intersection'](_0x5b8674['model'],qs[_0x3c41('0x47')](_0x1dce4b[_0x3c41('0x42')][_0x3c41('0x47')]));_0x31d6ea[_0x3c41('0x46')]=_0x31d6ea[_0x3c41('0x46')][_0x3c41('0x48')]?_0x31d6ea[_0x3c41('0x46')]:_0x5b8674[_0x3c41('0x41')];if(_0x1dce4b[_0x3c41('0x42')][_0x3c41('0x51')]){_0x31d6ea[_0x3c41('0x52')]=[{'all':!![]}];}_0x31d6ea=_[_0x3c41('0x4e')]({},_0x31d6ea,_0x1dce4b[_0x3c41('0x50')]);return db['VoiceQueue'][_0x3c41('0x56')](_0x31d6ea)[_0x3c41('0x2d')](handleEntityNotFound(_0x5abe78,null))['then'](function(_0x4826af){if(_0x4826af){var _0x42bf9b=_0x4826af[_0x3c41('0x2e')]({'plain':!![]});_0x42bf9b=qs[_0x3c41('0x60')](_0x42bf9b,['id','createdAt','updatedAt']);_0x1dce4b['body']=_[_0x3c41('0x60')](_0x1dce4b[_0x3c41('0x58')],['id',_0x3c41('0x61'),_0x3c41('0x62')]);return db['VoiceQueue'][_0x3c41('0x57')](_[_0x3c41('0x4e')](_0x42bf9b,_0x1dce4b[_0x3c41('0x58')]),{'include':_0x1dce4b['query'][_0x3c41('0x51')]?[{'all':!![]}]:undefined})[_0x3c41('0x2d')](function(_0x4f7bf8){var _0x5bda73=_0x1dce4b[_0x3c41('0x59')]['get']({'plain':!![]});if(!_0x5bda73)throw new Error(_0x3c41('0x5a'));if(_0x5bda73[_0x3c41('0x5b')]==='user'){var _0xf2f930=_0x4f7bf8['get']({'plain':!![]});var _0x37226d=[{'name':'VoiceQueues','value':_0x3c41('0x30')},{'name':_0x3c41('0x31'),'value':'outbound'}];var _0x515bae=_[_0x3c41('0x56')](_0x37226d,[_0x3c41('0x36'),_0xf2f930[_0x3c41('0x37')]])['name'];return db[_0x3c41('0x5c')][_0x3c41('0x56')]({'where':{'name':_0x515bae,'userProfileId':_0x5bda73[_0x3c41('0x63')]},'raw':!![]})['then'](function(_0x98eec5){if(_0x98eec5&&_0x98eec5[_0x3c41('0x5d')]===0x0){return db[_0x3c41('0x39')][_0x3c41('0x57')]({'name':_0xf2f930[_0x3c41('0x38')],'resourceId':_0xf2f930['id'],'type':_0x98eec5[_0x3c41('0x38')],'sectionId':_0x98eec5['id']},{})[_0x3c41('0x2d')](function(){return _0x4f7bf8;});}else{return _0x4f7bf8;}})[_0x3c41('0x54')](function(_0xb786a8){logger[_0x3c41('0x3a')](_0x3c41('0x5e'),_0xb786a8);throw _0xb786a8;});}return _0x4f7bf8;});}})[_0x3c41('0x2d')](respondWithResult(_0x5abe78,0xc9))[_0x3c41('0x54')](handleError(_0x5abe78,null));};exports[_0x3c41('0x2b')]=function(_0x581347,_0x4fef51){if(_0x581347['body']['id']){delete _0x581347[_0x3c41('0x58')]['id'];}return db[_0x3c41('0x3e')]['find']({'where':{'id':_0x581347[_0x3c41('0x64')]['id']}})[_0x3c41('0x2d')](handleEntityNotFound(_0x4fef51,null))[_0x3c41('0x2d')](saveUpdates(_0x581347['body'],null))[_0x3c41('0x2d')](respondWithResult(_0x4fef51,null))[_0x3c41('0x54')](handleError(_0x4fef51,null));};exports[_0x3c41('0x2c')]=function(_0x450d5a,_0x33087d){return db[_0x3c41('0x3e')][_0x3c41('0x56')]({'where':{'id':_0x450d5a[_0x3c41('0x64')]['id']}})[_0x3c41('0x2d')](handleEntityNotFound(_0x33087d,null))['then'](removeEntity(_0x33087d,null))['catch'](handleError(_0x33087d,null));};exports['getHoppers']=function(_0x3d104f,_0x47e49e,_0x4bbc78){var _0x2dc766={'raw':![],'where':{}};var _0x59bd38={};var _0x5e0ab4={'count':0x0,'rows':[]};return db[_0x3c41('0x3e')][_0x3c41('0x65')]({'where':{'id':_0x3d104f['params']['id']}})['then'](handleEntityNotFound(_0x47e49e,null))['then'](function(_0x204e2e){if(_0x204e2e){_0x59bd38[_0x3c41('0x41')]=_['keys'](db[_0x3c41('0x66')]['rawAttributes']);_0x59bd38[_0x3c41('0x42')]=_[_0x3c41('0x43')](_0x3d104f[_0x3c41('0x42')]);_0x59bd38[_0x3c41('0x44')]=_['intersection'](_0x59bd38[_0x3c41('0x41')],_0x59bd38[_0x3c41('0x42')]);_0x2dc766[_0x3c41('0x46')]=_['intersection'](_0x59bd38[_0x3c41('0x41')],qs[_0x3c41('0x47')](_0x3d104f[_0x3c41('0x42')][_0x3c41('0x47')]));_0x2dc766[_0x3c41('0x46')]=_0x2dc766[_0x3c41('0x46')]['length']?_0x2dc766[_0x3c41('0x46')]:_0x59bd38[_0x3c41('0x41')];if(!_0x3d104f['query'][_0x3c41('0x49')](_0x3c41('0x67'))){_0x2dc766[_0x3c41('0x26')]=qs[_0x3c41('0x26')](_0x3d104f['query'][_0x3c41('0x26')]);_0x2dc766[_0x3c41('0x24')]=qs[_0x3c41('0x24')](_0x3d104f[_0x3c41('0x42')]['offset']);}_0x2dc766['order']=qs[_0x3c41('0x4b')](_0x3d104f[_0x3c41('0x42')]['sort']);_0x2dc766[_0x3c41('0x4c')]=qs[_0x3c41('0x44')](_[_0x3c41('0x4d')](_0x3d104f[_0x3c41('0x42')],_0x59bd38[_0x3c41('0x44')]));_0x2dc766[_0x3c41('0x4c')]['VoiceQueueId']=_0x204e2e['id'];if(_0x3d104f[_0x3c41('0x42')][_0x3c41('0x33')]){_0x2dc766[_0x3c41('0x4c')]=_[_0x3c41('0x4e')](_0x2dc766[_0x3c41('0x4c')],{'$or':_[_0x3c41('0x35')](_0x2dc766[_0x3c41('0x46')],function(_0x144703){var _0xce4db={};_0xce4db[_0x144703]={'$like':'%'+_0x3d104f['query']['filter']+'%'};return _0xce4db;})});}_0x2dc766=_[_0x3c41('0x4e')]({},_0x2dc766,_0x3d104f[_0x3c41('0x50')]);return db[_0x3c41('0x66')][_0x3c41('0x27')]({'where':_0x2dc766[_0x3c41('0x4c')]})[_0x3c41('0x2d')](function(_0x1f2bd5){_0x5e0ab4[_0x3c41('0x27')]=_0x1f2bd5;if(_0x3d104f[_0x3c41('0x42')]['includeAll']){_0x2dc766[_0x3c41('0x52')]=[{'all':!![]}];}return db['CmHopper'][_0x3c41('0x53')](_0x2dc766);})['then'](function(_0x1286be){_0x5e0ab4[_0x3c41('0x68')]=_0x1286be;return _0x5e0ab4;});}})['then'](respondWithFilteredResult(_0x47e49e,_0x2dc766))['catch'](handleError(_0x47e49e,null));};exports[_0x3c41('0x69')]=function(_0x203235,_0x364e38,_0x5d6083){var _0x3fe18a={'raw':!![],'where':{}};var _0x253ed4={};var _0x12ef9b={'count':0x0,'rows':[]};return db[_0x3c41('0x3e')]['findOne']({'where':{'id':_0x203235[_0x3c41('0x64')]['id']}})[_0x3c41('0x2d')](handleEntityNotFound(_0x364e38,null))[_0x3c41('0x2d')](function(_0x5ebba6){if(_0x5ebba6){_0x253ed4['model']=_[_0x3c41('0x43')](db[_0x3c41('0x6a')][_0x3c41('0x3f')]);_0x253ed4[_0x3c41('0x42')]=_['keys'](_0x203235[_0x3c41('0x42')]);_0x253ed4[_0x3c41('0x44')]=_[_0x3c41('0x45')](_0x253ed4[_0x3c41('0x41')],_0x253ed4[_0x3c41('0x42')]);_0x3fe18a[_0x3c41('0x46')]=_['intersection'](_0x253ed4[_0x3c41('0x41')],qs[_0x3c41('0x47')](_0x203235[_0x3c41('0x42')]['fields']));_0x3fe18a[_0x3c41('0x46')]=_0x3fe18a[_0x3c41('0x46')][_0x3c41('0x48')]?_0x3fe18a[_0x3c41('0x46')]:_0x253ed4['model'];if(!_0x203235[_0x3c41('0x42')]['hasOwnProperty'](_0x3c41('0x67'))){_0x3fe18a[_0x3c41('0x26')]=qs['limit'](_0x203235[_0x3c41('0x42')]['limit']);_0x3fe18a[_0x3c41('0x24')]=qs[_0x3c41('0x24')](_0x203235[_0x3c41('0x42')][_0x3c41('0x24')]);}_0x3fe18a[_0x3c41('0x4a')]=qs[_0x3c41('0x4b')](_0x203235[_0x3c41('0x42')][_0x3c41('0x4b')]);_0x3fe18a[_0x3c41('0x4c')]=qs['filters'](_['pick'](_0x203235[_0x3c41('0x42')],_0x253ed4['filters']));_0x3fe18a[_0x3c41('0x4c')][_0x3c41('0x6b')]=_0x5ebba6['id'];if(_0x203235[_0x3c41('0x42')][_0x3c41('0x33')]){_0x3fe18a[_0x3c41('0x4c')]=_[_0x3c41('0x4e')](_0x3fe18a[_0x3c41('0x4c')],{'$or':_['map'](_0x3fe18a[_0x3c41('0x46')],function(_0x3f7bcf){var _0x557158={};_0x557158[_0x3f7bcf]={'$like':'%'+_0x203235[_0x3c41('0x42')][_0x3c41('0x33')]+'%'};return _0x557158;})});}_0x3fe18a=_['merge']({},_0x3fe18a,_0x203235[_0x3c41('0x50')]);return db[_0x3c41('0x6a')][_0x3c41('0x27')]({'where':_0x3fe18a['where']})[_0x3c41('0x2d')](function(_0x22478d){_0x12ef9b[_0x3c41('0x27')]=_0x22478d;if(_0x203235[_0x3c41('0x42')][_0x3c41('0x51')]){_0x3fe18a[_0x3c41('0x52')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3c41('0x53')](_0x3fe18a);})[_0x3c41('0x2d')](function(_0xa66138){_0x12ef9b[_0x3c41('0x68')]=_0xa66138;return _0x12ef9b;});}})[_0x3c41('0x2d')](respondWithFilteredResult(_0x364e38,_0x3fe18a))[_0x3c41('0x54')](handleError(_0x364e38,null));};exports[_0x3c41('0x6c')]=function(_0x1f0c8a,_0x2539fa,_0x47ee78){var _0x4eb1e0={'raw':!![],'where':{}};var _0x37bf79={};var _0x233601={'count':0x0,'rows':[]};return db[_0x3c41('0x3e')]['findOne']({'where':{'id':_0x1f0c8a[_0x3c41('0x64')]['id']}})[_0x3c41('0x2d')](handleEntityNotFound(_0x2539fa,null))[_0x3c41('0x2d')](function(_0x14f1f5){if(_0x14f1f5){_0x37bf79[_0x3c41('0x41')]=_[_0x3c41('0x43')](db[_0x3c41('0x6d')][_0x3c41('0x3f')]);_0x37bf79[_0x3c41('0x42')]=_[_0x3c41('0x43')](_0x1f0c8a[_0x3c41('0x42')]);_0x37bf79[_0x3c41('0x44')]=_['intersection'](_0x37bf79[_0x3c41('0x41')],_0x37bf79[_0x3c41('0x42')]);_0x4eb1e0['attributes']=_['intersection'](_0x37bf79[_0x3c41('0x41')],qs['fields'](_0x1f0c8a['query'][_0x3c41('0x47')]));_0x4eb1e0[_0x3c41('0x46')]=_0x4eb1e0[_0x3c41('0x46')][_0x3c41('0x48')]?_0x4eb1e0[_0x3c41('0x46')]:_0x37bf79[_0x3c41('0x41')];if(!_0x1f0c8a[_0x3c41('0x42')][_0x3c41('0x49')](_0x3c41('0x67'))){_0x4eb1e0[_0x3c41('0x26')]=qs[_0x3c41('0x26')](_0x1f0c8a[_0x3c41('0x42')][_0x3c41('0x26')]);_0x4eb1e0[_0x3c41('0x24')]=qs[_0x3c41('0x24')](_0x1f0c8a[_0x3c41('0x42')][_0x3c41('0x24')]);}_0x4eb1e0[_0x3c41('0x4a')]=qs['sort'](_0x1f0c8a[_0x3c41('0x42')]['sort']);_0x4eb1e0[_0x3c41('0x4c')]=qs[_0x3c41('0x44')](_[_0x3c41('0x4d')](_0x1f0c8a['query'],_0x37bf79[_0x3c41('0x44')]));_0x4eb1e0['where'][_0x3c41('0x6b')]=_0x14f1f5['id'];if(_0x1f0c8a[_0x3c41('0x42')][_0x3c41('0x33')]){_0x4eb1e0[_0x3c41('0x4c')]=_[_0x3c41('0x4e')](_0x4eb1e0[_0x3c41('0x4c')],{'$or':_[_0x3c41('0x35')](_0x4eb1e0['attributes'],function(_0x51dc88){var _0x6e3bdf={};_0x6e3bdf[_0x51dc88]={'$like':'%'+_0x1f0c8a[_0x3c41('0x42')][_0x3c41('0x33')]+'%'};return _0x6e3bdf;})});}_0x4eb1e0=_[_0x3c41('0x4e')]({},_0x4eb1e0,_0x1f0c8a['options']);return db['CmHopperFinal'][_0x3c41('0x27')]({'where':_0x4eb1e0[_0x3c41('0x4c')]})[_0x3c41('0x2d')](function(_0x3988b9){_0x233601['count']=_0x3988b9;if(_0x1f0c8a[_0x3c41('0x42')]['includeAll']){_0x4eb1e0[_0x3c41('0x52')]=[{'all':!![]}];}return db[_0x3c41('0x6d')][_0x3c41('0x53')](_0x4eb1e0);})['then'](function(_0x522f58){_0x233601[_0x3c41('0x68')]=_0x522f58;return _0x233601;});}})[_0x3c41('0x2d')](respondWithFilteredResult(_0x2539fa,_0x4eb1e0))[_0x3c41('0x54')](handleError(_0x2539fa,null));};exports[_0x3c41('0x6e')]=function(_0x3fc4bc,_0x535678,_0x22cf9f){var _0x34cefc={'raw':!![],'where':{}};var _0x3ab25b={};var _0x311cbc={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3c41('0x65')]({'where':{'id':_0x3fc4bc['params']['id']}})[_0x3c41('0x2d')](handleEntityNotFound(_0x535678,null))[_0x3c41('0x2d')](function(_0x46856c){if(_0x46856c){_0x3ab25b[_0x3c41('0x41')]=_[_0x3c41('0x43')](db[_0x3c41('0x6f')][_0x3c41('0x3f')]);_0x3ab25b[_0x3c41('0x42')]=_[_0x3c41('0x43')](_0x3fc4bc[_0x3c41('0x42')]);_0x3ab25b[_0x3c41('0x44')]=_[_0x3c41('0x45')](_0x3ab25b[_0x3c41('0x41')],_0x3ab25b['query']);_0x34cefc[_0x3c41('0x46')]=_[_0x3c41('0x45')](_0x3ab25b[_0x3c41('0x41')],qs['fields'](_0x3fc4bc[_0x3c41('0x42')][_0x3c41('0x47')]));_0x34cefc[_0x3c41('0x46')]=_0x34cefc[_0x3c41('0x46')][_0x3c41('0x48')]?_0x34cefc[_0x3c41('0x46')]:_0x3ab25b[_0x3c41('0x41')];if(!_0x3fc4bc['query'][_0x3c41('0x49')](_0x3c41('0x67'))){_0x34cefc['limit']=qs[_0x3c41('0x26')](_0x3fc4bc['query']['limit']);_0x34cefc[_0x3c41('0x24')]=qs[_0x3c41('0x24')](_0x3fc4bc[_0x3c41('0x42')][_0x3c41('0x24')]);}_0x34cefc[_0x3c41('0x4a')]=qs[_0x3c41('0x4b')](_0x3fc4bc[_0x3c41('0x42')]['sort']);_0x34cefc[_0x3c41('0x4c')]=qs[_0x3c41('0x44')](_[_0x3c41('0x4d')](_0x3fc4bc[_0x3c41('0x42')],_0x3ab25b[_0x3c41('0x44')]));_0x34cefc['where'][_0x3c41('0x6b')]=_0x46856c['id'];if(_0x3fc4bc[_0x3c41('0x42')][_0x3c41('0x33')]){_0x34cefc[_0x3c41('0x4c')]=_[_0x3c41('0x4e')](_0x34cefc['where'],{'$or':_[_0x3c41('0x35')](_0x34cefc[_0x3c41('0x46')],function(_0x1d3328){var _0x18f21e={};_0x18f21e[_0x1d3328]={'$like':'%'+_0x3fc4bc[_0x3c41('0x42')][_0x3c41('0x33')]+'%'};return _0x18f21e;})});}_0x34cefc=_[_0x3c41('0x4e')]({},_0x34cefc,_0x3fc4bc[_0x3c41('0x50')]);return db['CmHopperBlack'][_0x3c41('0x27')]({'where':_0x34cefc['where']})[_0x3c41('0x2d')](function(_0xb1467e){_0x311cbc[_0x3c41('0x27')]=_0xb1467e;if(_0x3fc4bc[_0x3c41('0x42')][_0x3c41('0x51')]){_0x34cefc['include']=[{'all':!![]}];}return db[_0x3c41('0x6f')][_0x3c41('0x53')](_0x34cefc);})[_0x3c41('0x2d')](function(_0x55b94e){_0x311cbc[_0x3c41('0x68')]=_0x55b94e;return _0x311cbc;});}})[_0x3c41('0x2d')](respondWithFilteredResult(_0x535678,_0x34cefc))[_0x3c41('0x54')](handleError(_0x535678,null));};exports[_0x3c41('0x70')]=function(_0x1bc2e5,_0x5a1d2f,_0xaa7bf8){var _0x1d7e4e={};var _0x404a61={};var _0x31fdf8;var _0x101566;return db['VoiceQueue']['findOne']({'where':{'id':_0x1bc2e5[_0x3c41('0x64')]['id']}})[_0x3c41('0x2d')](handleEntityNotFound(_0x5a1d2f,null))['then'](function(_0x2c84de){if(_0x2c84de){_0x31fdf8=_0x2c84de;_0x404a61[_0x3c41('0x41')]=_[_0x3c41('0x43')](db[_0x3c41('0x71')][_0x3c41('0x3f')]);_0x404a61[_0x3c41('0x42')]=_[_0x3c41('0x43')](_0x1bc2e5[_0x3c41('0x42')]);_0x404a61[_0x3c41('0x44')]=_[_0x3c41('0x45')](_0x404a61['model'],_0x404a61[_0x3c41('0x42')]);_0x1d7e4e[_0x3c41('0x46')]=_[_0x3c41('0x45')](_0x404a61['model'],qs[_0x3c41('0x47')](_0x1bc2e5[_0x3c41('0x42')][_0x3c41('0x47')]));_0x1d7e4e['attributes']=_0x1d7e4e[_0x3c41('0x46')][_0x3c41('0x48')]?_0x1d7e4e[_0x3c41('0x46')]:_0x404a61[_0x3c41('0x41')];_0x1d7e4e[_0x3c41('0x4a')]=qs[_0x3c41('0x4b')](_0x1bc2e5[_0x3c41('0x42')][_0x3c41('0x4b')]);_0x1d7e4e['where']=qs[_0x3c41('0x44')](_[_0x3c41('0x4d')](_0x1bc2e5['query'],_0x404a61[_0x3c41('0x44')]));if(_0x1bc2e5[_0x3c41('0x42')][_0x3c41('0x33')]){_0x1d7e4e['where']=_[_0x3c41('0x4e')](_0x1d7e4e[_0x3c41('0x4c')],{'$or':_['map'](_0x1d7e4e['attributes'],function(_0x21129e){var _0x3e8c9f={};_0x3e8c9f[_0x21129e]={'$like':'%'+_0x1bc2e5[_0x3c41('0x42')]['filter']+'%'};return _0x3e8c9f;})});}_0x1d7e4e=_[_0x3c41('0x4e')]({},_0x1d7e4e,_0x1bc2e5[_0x3c41('0x50')]);return _0x31fdf8['getTeams'](_0x1d7e4e);}})[_0x3c41('0x2d')](function(_0x1c1426){if(_0x1c1426){_0x101566=_0x1c1426[_0x3c41('0x48')];if(!_0x1bc2e5['query'][_0x3c41('0x49')]('nolimit')){_0x1d7e4e['limit']=qs[_0x3c41('0x26')](_0x1bc2e5[_0x3c41('0x42')][_0x3c41('0x26')]);_0x1d7e4e[_0x3c41('0x24')]=qs['offset'](_0x1bc2e5[_0x3c41('0x42')][_0x3c41('0x24')]);}return _0x31fdf8[_0x3c41('0x70')](_0x1d7e4e);}})['then'](function(_0x30ce3d){if(_0x30ce3d){return _0x30ce3d?{'count':_0x101566,'rows':_0x30ce3d}:null;}})['then'](respondWithResult(_0x5a1d2f,null))[_0x3c41('0x54')](handleError(_0x5a1d2f,null));};exports[_0x3c41('0x72')]=function(_0x4bdffd,_0x468ab3,_0x420e82){var _0x25eff3=_0x4bdffd[_0x3c41('0x58')][_0x3c41('0x73')];var _0x36dc3d=_['map'](_0x25eff3,'id');return db['Team']['findAll']({'where':{'id':_0x36dc3d},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x3c41('0x38'),'online',_0x3c41('0x74'),'interface'],'raw':!![]}]})[_0x3c41('0x2d')](function(_0x75e903){if(_0x75e903){var _0x483dc4=_[_0x3c41('0x75')](_0x75e903,function(_0x605f1){var _0x29459c=_0x605f1[_0x3c41('0x2e')]({'plain':!![]});_0x29459c[_0x3c41('0x76')][_0x3c41('0x77')](function(_0x2bcca6){_0x2bcca6[_0x3c41('0x78')]=_[_0x3c41('0x56')](_0x25eff3,{'id':_0x29459c['id']})[_0x3c41('0x78')];});return _0x29459c[_0x3c41('0x76')];});return db[_0x3c41('0x3e')][_0x3c41('0x56')]({'where':{'id':_0x4bdffd[_0x3c41('0x64')]['id']}})[_0x3c41('0x2d')](function(_0x1188e9){return db[_0x3c41('0x79')][_0x3c41('0x7a')](function(_0x1b3c75){return _0x1188e9[_0x3c41('0x72')](_0x36dc3d,{'transaction':_0x1b3c75})[_0x3c41('0x2d')](function(){return BPromise['each'](_0x25eff3,function(_0x3fed3f){return db[_0x3c41('0x7b')][_0x3c41('0x7c')]({'TeamId':_0x3fed3f['id'],'VoiceQueueId':_0x4bdffd[_0x3c41('0x64')]['id'],'penalty':_0x3fed3f[_0x3c41('0x78')]},{'transaction':_0x1b3c75});});})[_0x3c41('0x2d')](function(){return BPromise['each'](_0x483dc4,function(_0x3c742f){return db[_0x3c41('0x7d')]['findOrCreate']({'where':{'UserId':_0x3c742f['id'],'VoiceQueueId':_0x4bdffd[_0x3c41('0x64')]['id']},'defaults':{'penalty':_0x3c742f[_0x3c41('0x78')]},'transaction':_0x1b3c75});});})['then'](function(){return BPromise[_0x3c41('0x7e')](_[_0x3c41('0x33')](_0x483dc4,{'online':!![]}),function(_0x369521){return db['UserVoiceQueueRt']['upsert']({'membername':_0x369521[_0x3c41('0x38')],'UserId':_0x369521['id'],'queue_name':_0x1188e9[_0x3c41('0x38')],'VoiceQueueId':_0x1188e9['id'],'interface':_[_0x3c41('0x7f')](_0x369521['interface'])?util[_0x3c41('0x80')](_0x3c41('0x81'),_0x369521[_0x3c41('0x38')]):_0x369521[_0x3c41('0x82')],'paused':_0x369521[_0x3c41('0x74')]||![],'penalty':_0x369521[_0x3c41('0x78')]},{'transaction':_0x1b3c75});});})[_0x3c41('0x2d')](function(){_0x483dc4[_0x3c41('0x77')](function(_0xa79197){socket[_0x3c41('0x83')](_0x3c41('0x84'),{'UserId':_0xa79197['id'],'VoiceQueueId':_0x1188e9['id']});});});});});}})['then'](respondWithStatusCode(_0x468ab3,null))[_0x3c41('0x54')](handleError(_0x468ab3,null));};exports['removeTeams']=function(_0x407a8b,_0x17ed86,_0x168fab){return db[_0x3c41('0x71')][_0x3c41('0x53')]({'where':{'id':_0x407a8b[_0x3c41('0x42')][_0x3c41('0x85')]},'attributes':['id'],'include':[{'model':db[_0x3c41('0x86')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3c41('0x2d')](handleEntityNotFound(_0x17ed86,null))[_0x3c41('0x2d')](function(_0x5e6243){var _0x3ed3aa=_[_0x3c41('0x35')](_0x5e6243,'id');var _0x413178=[];var _0x26c91a=[];var _0x3a888c=squel[_0x3c41('0x87')]();_0x3a888c[_0x3c41('0x88')](_0x3c41('0x89'))['from'](_0x3c41('0x8a'),'tq')[_0x3c41('0x8b')](_0x3c41('0x8c'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x3c41('0x8d'),_0x407a8b['params']['id']);for(var _0x44245c=0x0;_0x44245c<_0x5e6243[_0x3c41('0x48')];_0x44245c+=0x1){let _0x518d13=_0x5e6243[_0x44245c];for(var _0x39f18e=0x0;_0x39f18e<_0x518d13['Agents'][_0x3c41('0x48')];_0x39f18e+=0x1){let _0x27f73b=_0x518d13[_0x3c41('0x76')][_0x39f18e];var _0x1c28e4=_0x3a888c[_0x3c41('0x5f')]();_0x1c28e4[_0x3c41('0x4c')](_0x3c41('0x8e'),_0x27f73b['id']);_0x26c91a[_0x3c41('0x8f')](db[_0x3c41('0x79')]['query'](_0x1c28e4[_0x3c41('0x90')](),{'type':db[_0x3c41('0x79')]['QueryTypes']['SELECT']})[_0x3c41('0x2d')](function(_0x156375){if(_0x156375[_0x3c41('0x48')]===0x1){return _0x27f73b['id'];}else{var _0x18e694=_[_0x3c41('0x91')](_['map'](_0x156375,_0x3c41('0x92')),function(_0x23d176){return _[_0x3c41('0x93')](_0x3ed3aa,_0x23d176);});if(_0x18e694){return _0x27f73b['id'];}}}));}}return BPromise[_0x3c41('0x94')](_0x26c91a)[_0x3c41('0x2d')](function(_0x561e9a){_0x413178=_(_0x413178)[_0x3c41('0x95')](_0x561e9a)[_0x3c41('0x96')]()[_0x3c41('0x36')]();return db[_0x3c41('0x3e')][_0x3c41('0x56')]({'where':{'id':_0x407a8b[_0x3c41('0x64')]['id']}})[_0x3c41('0x2d')](function(_0x421513){return db['sequelize'][_0x3c41('0x7a')](function(_0x1fd313){return _0x421513['removeTeams'](_0x407a8b[_0x3c41('0x42')][_0x3c41('0x85')],{'transaction':_0x1fd313})['then'](function(){if(!_[_0x3c41('0x97')](_0x413178)){return _0x421513[_0x3c41('0x98')](_0x413178,{'transaction':_0x1fd313})[_0x3c41('0x2d')](function(){return db[_0x3c41('0x99')][_0x3c41('0x2c')]({'where':{'VoiceQueueId':_0x407a8b['params']['id'],'UserId':_0x413178},'transaction':_0x1fd313});});}})[_0x3c41('0x2d')](function(){_0x413178[_0x3c41('0x77')](function(_0x63e489){socket[_0x3c41('0x83')]('userVoiceQueue:remove',{'UserId':_0x63e489,'VoiceQueueId':_0x421513['id']});});});});});});})[_0x3c41('0x2d')](respondWithStatusCode(_0x17ed86,null))[_0x3c41('0x54')](handleError(_0x17ed86,null));};exports[_0x3c41('0x9a')]=function(_0x211480,_0x148ab2,_0x3f15dd){var _0x1edd1b,_0x35cffd;return db[_0x3c41('0x3e')][_0x3c41('0x56')]({'where':{'id':_0x211480['params']['id']}})['then'](handleEntityNotFound(_0x148ab2,null))[_0x3c41('0x2d')](function(_0x41f2a7){if(_0x41f2a7){_0x35cffd=_0x41f2a7;return _0x41f2a7[_0x3c41('0x9a')](_0x211480[_0x3c41('0x58')][_0x3c41('0x85')],_[_0x3c41('0x60')](_0x211480[_0x3c41('0x58')],[_0x3c41('0x85'),'id'])||{})['spread'](function(_0x223b59){for(var _0x446abf=0x0;_0x446abf<_0x211480[_0x3c41('0x58')][_0x3c41('0x85')][_0x3c41('0x48')];_0x446abf+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x211480['body'][_0x3c41('0x85')][_0x446abf]),'VoiceQueueId':Number(_0x211480['params']['id'])});}return _0x223b59;});}})[_0x3c41('0x2d')](function(_0x2c3bf2){_0x1edd1b=_0x2c3bf2||[];if(_0x35cffd){return db[_0x3c41('0x86')]['findAll']({'where':{'id':_0x211480['body'][_0x3c41('0x85')]},'attributes':['id','name',_0x3c41('0x9b'),_0x3c41('0x74'),_0x3c41('0x82')],'raw':!![]});}})[_0x3c41('0x2d')](function(_0x4d4840){if(!_['isEmpty'](_0x4d4840)){var _0x4b8fb6=[];for(var _0x1bdf64=0x0;_0x1bdf64<_0x4d4840[_0x3c41('0x48')];_0x1bdf64++){if(_0x4d4840[_0x1bdf64][_0x3c41('0x9b')]){_0x4b8fb6[_0x3c41('0x8f')](db[_0x3c41('0x99')][_0x3c41('0x7c')]({'membername':_0x4d4840[_0x1bdf64][_0x3c41('0x38')],'UserId':_0x4d4840[_0x1bdf64]['id'],'queue_name':_0x35cffd[_0x3c41('0x38')],'VoiceQueueId':_0x35cffd['id'],'interface':_[_0x3c41('0x7f')](_0x4d4840[_0x1bdf64][_0x3c41('0x82')])?util['format'](_0x3c41('0x81'),_0x4d4840[_0x1bdf64]['name']):_0x4d4840[_0x1bdf64][_0x3c41('0x82')],'paused':_0x4d4840[_0x1bdf64][_0x3c41('0x74')]||![],'penalty':_0x211480['body'][_0x3c41('0x78')]||0x0}));}}return BPromise[_0x3c41('0x94')](_0x4b8fb6);}})[_0x3c41('0x2d')](function(){return _0x1edd1b;})[_0x3c41('0x2d')](respondWithResult(_0x148ab2,null))[_0x3c41('0x54')](handleError(_0x148ab2,null));};exports[_0x3c41('0x98')]=function(_0x2b7821,_0x42c93f,_0x57ca11){return db['VoiceQueue'][_0x3c41('0x56')]({'where':{'id':_0x2b7821['params']['id']}})[_0x3c41('0x2d')](handleEntityNotFound(_0x42c93f,null))[_0x3c41('0x2d')](function(_0x5af94c){if(_0x5af94c){return _0x5af94c[_0x3c41('0x98')](_0x2b7821['query'][_0x3c41('0x85')])['then'](function(){if(_['isArray'](_0x2b7821[_0x3c41('0x42')]['ids'])){for(var _0x4b9c30=0x0;_0x4b9c30<_0x2b7821[_0x3c41('0x42')][_0x3c41('0x85')][_0x3c41('0x48')];_0x4b9c30+=0x1){socket['emit'](_0x3c41('0x9c'),{'UserId':Number(_0x2b7821['query'][_0x3c41('0x85')][_0x4b9c30]),'VoiceQueueId':Number(_0x2b7821[_0x3c41('0x64')]['id'])});}}else{socket[_0x3c41('0x83')](_0x3c41('0x9c'),{'UserId':Number(_0x2b7821['query'][_0x3c41('0x85')]),'VoiceQueueId':Number(_0x2b7821[_0x3c41('0x64')]['id'])});}});}})[_0x3c41('0x2d')](function(_0x5b3c13){return db[_0x3c41('0x99')][_0x3c41('0x2c')]({'where':{'VoiceQueueId':_0x2b7821['params']['id'],'UserId':_0x2b7821[_0x3c41('0x42')]['ids']}})['then'](function(){return _0x5b3c13;});})[_0x3c41('0x2d')](respondWithStatusCode(_0x42c93f,null))[_0x3c41('0x54')](handleError(_0x42c93f,null));};exports[_0x3c41('0x9d')]=function(_0x5eeef4,_0x3b0b81,_0x2cfdff){var _0x72a223={};var _0x5d94e3={};var _0x5c448a;var _0x502cbb;return db[_0x3c41('0x3e')][_0x3c41('0x65')]({'where':{'id':_0x5eeef4[_0x3c41('0x64')]['id']}})[_0x3c41('0x2d')](handleEntityNotFound(_0x3b0b81,null))[_0x3c41('0x2d')](function(_0x4c336b){if(_0x4c336b){_0x5c448a=_0x4c336b;_0x5d94e3[_0x3c41('0x41')]=_[_0x3c41('0x43')](db[_0x3c41('0x86')][_0x3c41('0x3f')]);_0x5d94e3[_0x3c41('0x42')]=_[_0x3c41('0x43')](_0x5eeef4['query']);_0x5d94e3[_0x3c41('0x44')]=_[_0x3c41('0x45')](_0x5d94e3[_0x3c41('0x41')],_0x5d94e3[_0x3c41('0x42')]);_0x72a223['attributes']=_[_0x3c41('0x45')](_0x5d94e3[_0x3c41('0x41')],qs['fields'](_0x5eeef4[_0x3c41('0x42')][_0x3c41('0x47')]));_0x72a223[_0x3c41('0x46')]=_0x72a223[_0x3c41('0x46')][_0x3c41('0x48')]?_0x72a223[_0x3c41('0x46')]:_0x5d94e3[_0x3c41('0x41')];_0x72a223['order']=qs[_0x3c41('0x4b')](_0x5eeef4[_0x3c41('0x42')][_0x3c41('0x4b')]);_0x72a223[_0x3c41('0x4c')]=qs['filters'](_[_0x3c41('0x4d')](_0x5eeef4['query'],_0x5d94e3[_0x3c41('0x44')]));if(_0x5eeef4[_0x3c41('0x42')][_0x3c41('0x33')]){_0x72a223[_0x3c41('0x4c')]=_[_0x3c41('0x4e')](_0x72a223['where'],{'$or':_[_0x3c41('0x35')](_0x72a223[_0x3c41('0x46')],function(_0x3c4e5e){var _0x1d23cb={};_0x1d23cb[_0x3c4e5e]={'$like':'%'+_0x5eeef4['query'][_0x3c41('0x33')]+'%'};return _0x1d23cb;})});}_0x72a223=_[_0x3c41('0x4e')]({},_0x72a223,_0x5eeef4[_0x3c41('0x50')]);return _0x5c448a[_0x3c41('0x9d')](_0x72a223);}})[_0x3c41('0x2d')](function(_0x3aa954){if(_0x3aa954){_0x502cbb=_0x3aa954[_0x3c41('0x48')];if(!_0x5eeef4[_0x3c41('0x42')]['hasOwnProperty'](_0x3c41('0x67'))){_0x72a223[_0x3c41('0x26')]=qs[_0x3c41('0x26')](_0x5eeef4[_0x3c41('0x42')][_0x3c41('0x26')]);_0x72a223[_0x3c41('0x24')]=qs[_0x3c41('0x24')](_0x5eeef4[_0x3c41('0x42')][_0x3c41('0x24')]);}return _0x5c448a[_0x3c41('0x9d')](_0x72a223);}})[_0x3c41('0x2d')](function(_0x48d8e0){if(_0x48d8e0){return _0x48d8e0?{'count':_0x502cbb,'rows':_0x48d8e0}:null;}})['then'](respondWithResult(_0x3b0b81,null))['catch'](handleError(_0x3b0b81,null));};exports[_0x3c41('0x9e')]=function(_0x214065,_0x3ade72,_0x8ec91f){var _0x3dea81={};var _0x4d9004={};var _0x4c3f20;var _0x5424c2;return db[_0x3c41('0x3e')][_0x3c41('0x65')]({'where':{'id':_0x214065['params']['id']}})['then'](handleEntityNotFound(_0x3ade72,null))['then'](function(_0x55018a){if(_0x55018a){_0x4c3f20=_0x55018a;_0x4d9004[_0x3c41('0x41')]=_[_0x3c41('0x43')](db[_0x3c41('0x99')][_0x3c41('0x3f')]);_0x4d9004[_0x3c41('0x42')]=_['keys'](_0x214065[_0x3c41('0x42')]);_0x4d9004[_0x3c41('0x44')]=_[_0x3c41('0x45')](_0x4d9004[_0x3c41('0x41')],_0x4d9004[_0x3c41('0x42')]);_0x3dea81[_0x3c41('0x46')]=_[_0x3c41('0x45')](_0x4d9004['model'],qs['fields'](_0x214065['query']['fields']));_0x3dea81['attributes']=_0x3dea81[_0x3c41('0x46')][_0x3c41('0x48')]?_0x3dea81[_0x3c41('0x46')]:_0x4d9004[_0x3c41('0x41')];_0x3dea81['order']=qs[_0x3c41('0x4b')](_0x214065['query'][_0x3c41('0x4b')]);_0x3dea81['where']=qs[_0x3c41('0x44')](_[_0x3c41('0x4d')](_0x214065[_0x3c41('0x42')],_0x4d9004[_0x3c41('0x44')]));if(_0x214065[_0x3c41('0x42')][_0x3c41('0x33')]){_0x3dea81[_0x3c41('0x4c')]=_[_0x3c41('0x4e')](_0x3dea81[_0x3c41('0x4c')],{'$or':_['map'](_0x3dea81[_0x3c41('0x46')],function(_0xbbe654){var _0x142ac4={};_0x142ac4[_0xbbe654]={'$like':'%'+_0x214065[_0x3c41('0x42')][_0x3c41('0x33')]+'%'};return _0x142ac4;})});}_0x3dea81=_[_0x3c41('0x4e')]({},_0x3dea81,_0x214065['options']);return _0x4c3f20['getMembers'](_0x3dea81);}})[_0x3c41('0x2d')](function(_0x1b18d8){if(_0x1b18d8){_0x5424c2=_0x1b18d8['length'];if(!_0x214065[_0x3c41('0x42')][_0x3c41('0x49')](_0x3c41('0x67'))){_0x3dea81[_0x3c41('0x26')]=qs[_0x3c41('0x26')](_0x214065[_0x3c41('0x42')][_0x3c41('0x26')]);_0x3dea81['offset']=qs['offset'](_0x214065['query'][_0x3c41('0x24')]);}return _0x4c3f20['getMembers'](_0x3dea81);}})[_0x3c41('0x2d')](function(_0x2d14e6){return _0x2d14e6?{'count':_0x5424c2,'rows':_0x2d14e6}:null;})[_0x3c41('0x2d')](respondWithResult(_0x3ade72,null))[_0x3c41('0x54')](handleError(_0x3ade72,null));};exports[_0x3c41('0x9f')]=function(_0x1a04b8,_0x3c9832,_0x475cf5){var _0x574a8f={};var _0x59abd1={};var _0xc357cb;var _0x931ff4;return db[_0x3c41('0x3e')][_0x3c41('0x65')]({'where':{'id':_0x1a04b8[_0x3c41('0x64')]['id']}})[_0x3c41('0x2d')](handleEntityNotFound(_0x3c9832,null))[_0x3c41('0x2d')](function(_0x148b7b){if(_0x148b7b){_0xc357cb=_0x148b7b;_0x59abd1[_0x3c41('0x41')]=_[_0x3c41('0x43')](db[_0x3c41('0xa0')]['rawAttributes']);_0x59abd1[_0x3c41('0x42')]=_[_0x3c41('0x43')](_0x1a04b8['query']);_0x59abd1[_0x3c41('0x44')]=_[_0x3c41('0x45')](_0x59abd1[_0x3c41('0x41')],_0x59abd1[_0x3c41('0x42')]);_0x574a8f[_0x3c41('0x46')]=_[_0x3c41('0x45')](_0x59abd1[_0x3c41('0x41')],qs[_0x3c41('0x47')](_0x1a04b8[_0x3c41('0x42')][_0x3c41('0x47')]));_0x574a8f[_0x3c41('0x46')]=_0x574a8f[_0x3c41('0x46')][_0x3c41('0x48')]?_0x574a8f[_0x3c41('0x46')]:_0x59abd1[_0x3c41('0x41')];_0x574a8f[_0x3c41('0x4a')]=qs[_0x3c41('0x4b')](_0x1a04b8[_0x3c41('0x42')][_0x3c41('0x4b')]);_0x574a8f['where']=qs['filters'](_[_0x3c41('0x4d')](_0x1a04b8[_0x3c41('0x42')],_0x59abd1['filters']));if(_0x1a04b8['query'][_0x3c41('0x33')]){_0x574a8f['where']=_['merge'](_0x574a8f['where'],{'$or':_[_0x3c41('0x35')](_0x574a8f[_0x3c41('0x46')],function(_0x5f530d){var _0x42c8f3={};_0x42c8f3[_0x5f530d]={'$like':'%'+_0x1a04b8[_0x3c41('0x42')][_0x3c41('0x33')]+'%'};return _0x42c8f3;})});}_0x574a8f=_[_0x3c41('0x4e')]({},_0x574a8f,_0x1a04b8[_0x3c41('0x50')]);return _0xc357cb[_0x3c41('0x9f')](_0x574a8f);}})[_0x3c41('0x2d')](function(_0x5404dc){if(_0x5404dc){_0x931ff4=_0x5404dc['length'];if(!_0x1a04b8[_0x3c41('0x42')][_0x3c41('0x49')](_0x3c41('0x67'))){_0x574a8f[_0x3c41('0x26')]=qs[_0x3c41('0x26')](_0x1a04b8[_0x3c41('0x42')][_0x3c41('0x26')]);_0x574a8f[_0x3c41('0x24')]=qs['offset'](_0x1a04b8[_0x3c41('0x42')][_0x3c41('0x24')]);}return _0xc357cb[_0x3c41('0x9f')](_0x574a8f);}})[_0x3c41('0x2d')](function(_0x94a5b2){if(_0x94a5b2){return _0x94a5b2?{'count':_0x931ff4,'rows':_0x94a5b2}:null;}})[_0x3c41('0x2d')](respondWithResult(_0x3c9832,null))[_0x3c41('0x54')](handleError(_0x3c9832,null));};exports[_0x3c41('0xa1')]=function(_0x52f857,_0x3a934a,_0x49031e){var _0x43b75a,_0x2ed900;return db[_0x3c41('0x3e')][_0x3c41('0x56')]({'where':{'id':_0x52f857[_0x3c41('0x64')]['id']}})['then'](handleEntityNotFound(_0x3a934a,null))[_0x3c41('0x2d')](function(_0x5924e4){if(_0x5924e4){_0x2ed900=_0x5924e4;return _0x5924e4['addLists'](_0x52f857[_0x3c41('0x58')]['ids'],_[_0x3c41('0x60')](_0x52f857['body'],['ids','id'])||{});}return null;})[_0x3c41('0xa2')](function(_0x23e8b6){var _0x4f4346;_0x43b75a=_0x23e8b6||[];var _0x1de2ba=[];if(_0x23e8b6){for(var _0x1d98fc=0x0;_0x1d98fc<_0x23e8b6[_0x3c41('0x48')];_0x1d98fc+=0x1){var _0x107ff8=_0x23e8b6[_0x1d98fc][_0x3c41('0x2e')]({'plain':!![]});_0x2ed900[_0x3c41('0xa3')]=_0x52f857[_0x3c41('0x58')][_0x3c41('0xa3')]?_0x52f857[_0x3c41('0x58')][_0x3c41('0xa3')]:_0x2ed900[_0x3c41('0xa3')];switch(_0x2ed900['dialCheckDuplicateType']){case _0x3c41('0xa4'):_0x4f4346=squel[_0x3c41('0xa5')]()[_0x3c41('0xa6')](_0x3c41('0xa7'))[_0x3c41('0xa8')]([_0x3c41('0xa9'),_0x3c41('0xaa'),'ContactId',_0x3c41('0xab'),_0x3c41('0x6b'),_0x3c41('0x61'),_0x3c41('0x62')],squel['select']()[_0x3c41('0x88')](_0x3c41('0xa9'),'phone')[_0x3c41('0x88')]('NOW()','scheduledAt')['field']('id',_0x3c41('0xac'))[_0x3c41('0x88')](_0x107ff8[_0x3c41('0xad')][_0x3c41('0x90')](),_0x3c41('0xab'))[_0x3c41('0x88')](_0x52f857[_0x3c41('0x64')]['id'][_0x3c41('0x90')](),_0x3c41('0x6b'))[_0x3c41('0x88')](_0x3c41('0xae'),_0x3c41('0x61'))[_0x3c41('0x88')](_0x3c41('0xae'),_0x3c41('0x62'))[_0x3c41('0xaf')](_0x3c41('0xb0'))[_0x3c41('0x4c')](_0x3c41('0xb1'))[_0x3c41('0x4c')](_0x3c41('0xb2'),_0x107ff8[_0x3c41('0xad')][_0x3c41('0x90')]())['where'](_0x3c41('0xb3'))[_0x3c41('0x4c')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x3c41('0xb4'))[_0x3c41('0xaf')](_0x3c41('0xb5'))[_0x3c41('0x4c')](_0x3c41('0x8d'),_0x52f857['params']['id'][_0x3c41('0x90')]()))[_0x3c41('0x4c')](_0x3c41('0xb6'),squel[_0x3c41('0x87')]()[_0x3c41('0x88')](_0x3c41('0xb7'))[_0x3c41('0xaf')](_0x3c41('0xa7'))['where'](_0x3c41('0x8d'),_0x52f857[_0x3c41('0x64')]['id'][_0x3c41('0x90')]())))['toString']();break;case _0x3c41('0xb8'):_0x4f4346=squel[_0x3c41('0xa5')]()[_0x3c41('0xa6')](_0x3c41('0xa7'))[_0x3c41('0xa8')]([_0x3c41('0xa9'),'scheduledAt','ContactId',_0x3c41('0xab'),_0x3c41('0x6b'),_0x3c41('0x61'),_0x3c41('0x62')],squel[_0x3c41('0x87')]()[_0x3c41('0x88')](_0x3c41('0xa9'),_0x3c41('0xa9'))[_0x3c41('0x88')](_0x3c41('0xae'),_0x3c41('0xaa'))['field']('id',_0x3c41('0xac'))[_0x3c41('0x88')](_0x107ff8[_0x3c41('0xad')][_0x3c41('0x90')](),_0x3c41('0xab'))[_0x3c41('0x88')](_0x52f857[_0x3c41('0x64')]['id'][_0x3c41('0x90')](),'VoiceQueueId')[_0x3c41('0x88')](_0x3c41('0xae'),'createdAt')[_0x3c41('0x88')](_0x3c41('0xae'),_0x3c41('0x62'))[_0x3c41('0xaf')](_0x3c41('0xb0'))[_0x3c41('0x4c')]('deletedAt\x20IS\x20NULL')[_0x3c41('0x4c')](_0x3c41('0xb2'),_0x107ff8[_0x3c41('0xad')][_0x3c41('0x90')]())[_0x3c41('0x4c')](_0x3c41('0xb3'))[_0x3c41('0x4c')](_0x3c41('0xb6'),squel[_0x3c41('0x87')]()[_0x3c41('0x88')]('COALESCE(phone,\x27\x27)')[_0x3c41('0xaf')](_0x3c41('0xa7'))[_0x3c41('0x4c')](_0x3c41('0x8d'),_0x52f857[_0x3c41('0x64')]['id'][_0x3c41('0x90')]())))[_0x3c41('0x90')]();break;default:_0x4f4346=squel['insert']()[_0x3c41('0xa6')]('cm_hopper')[_0x3c41('0xa8')]([_0x3c41('0xa9'),_0x3c41('0xaa'),_0x3c41('0xac'),_0x3c41('0xab'),_0x3c41('0x6b'),_0x3c41('0x61'),_0x3c41('0x62')],squel[_0x3c41('0x87')]()[_0x3c41('0x88')](_0x3c41('0xa9'),_0x3c41('0xa9'))['field'](_0x3c41('0xae'),_0x3c41('0xaa'))[_0x3c41('0x88')]('id','ContactId')[_0x3c41('0x88')](_0x107ff8[_0x3c41('0xad')][_0x3c41('0x90')](),'ListId')[_0x3c41('0x88')](_0x52f857['params']['id'][_0x3c41('0x90')](),_0x3c41('0x6b'))[_0x3c41('0x88')](_0x3c41('0xae'),_0x3c41('0x61'))[_0x3c41('0x88')](_0x3c41('0xae'),_0x3c41('0x62'))['from'](_0x3c41('0xb0'))[_0x3c41('0x4c')](_0x3c41('0xb1'))[_0x3c41('0x4c')]('ListId\x20=\x20?',_0x107ff8[_0x3c41('0xad')]['toString']())[_0x3c41('0x4c')](_0x3c41('0xb3')))[_0x3c41('0x90')]();}_0x1de2ba[_0x3c41('0x8f')](db[_0x3c41('0x79')][_0x3c41('0x42')](_0x4f4346));}return BPromise[_0x3c41('0x94')](_0x1de2ba);}})[_0x3c41('0x2d')](function(){return _0x43b75a;})[_0x3c41('0x2d')](respondWithResult(_0x3a934a,null))[_0x3c41('0x54')](handleError(_0x3a934a,null));};exports[_0x3c41('0xb9')]=function(_0x32e269,_0x3f81a1,_0x42d988){return db[_0x3c41('0x3e')][_0x3c41('0x56')]({'where':{'id':_0x32e269[_0x3c41('0x64')]['id']}})['then'](handleEntityNotFound(_0x3f81a1,null))[_0x3c41('0x2d')](function(_0x67c0ac){if(_0x67c0ac){return _0x67c0ac[_0x3c41('0xb9')](_0x32e269[_0x3c41('0x42')]['ids']);}})[_0x3c41('0x2d')](function(_0x5dd071){if(_0x5dd071){return db[_0x3c41('0x66')][_0x3c41('0x2c')]({'where':{'ListId':_0x32e269[_0x3c41('0x42')]['ids'],'VoiceQueueId':_0x32e269[_0x3c41('0x64')]['id']}})[_0x3c41('0x2d')](function(){return _0x5dd071;});}})['then'](respondWithStatusCode(_0x3f81a1,null))[_0x3c41('0x54')](handleError(_0x3f81a1,null));};exports['getBlackLists']=function(_0x59babd,_0x179a60,_0x5853){var _0x5670dd={};var _0x2a3e9a={};var _0xca03ae;var _0x3ce14f;return db[_0x3c41('0x3e')][_0x3c41('0x65')]({'where':{'id':_0x59babd[_0x3c41('0x64')]['id']}})['then'](handleEntityNotFound(_0x179a60,null))[_0x3c41('0x2d')](function(_0x435867){if(_0x435867){_0xca03ae=_0x435867;_0x2a3e9a[_0x3c41('0x41')]=_[_0x3c41('0x43')](db[_0x3c41('0xa0')]['rawAttributes']);_0x2a3e9a[_0x3c41('0x42')]=_[_0x3c41('0x43')](_0x59babd['query']);_0x2a3e9a['filters']=_[_0x3c41('0x45')](_0x2a3e9a[_0x3c41('0x41')],_0x2a3e9a[_0x3c41('0x42')]);_0x5670dd[_0x3c41('0x46')]=_[_0x3c41('0x45')](_0x2a3e9a[_0x3c41('0x41')],qs[_0x3c41('0x47')](_0x59babd['query']['fields']));_0x5670dd[_0x3c41('0x46')]=_0x5670dd[_0x3c41('0x46')]['length']?_0x5670dd[_0x3c41('0x46')]:_0x2a3e9a['model'];_0x5670dd['order']=qs['sort'](_0x59babd[_0x3c41('0x42')]['sort']);_0x5670dd[_0x3c41('0x4c')]=qs[_0x3c41('0x44')](_[_0x3c41('0x4d')](_0x59babd[_0x3c41('0x42')],_0x2a3e9a['filters']));if(_0x59babd[_0x3c41('0x42')][_0x3c41('0x33')]){_0x5670dd['where']=_[_0x3c41('0x4e')](_0x5670dd[_0x3c41('0x4c')],{'$or':_[_0x3c41('0x35')](_0x5670dd[_0x3c41('0x46')],function(_0x18bf48){var _0x56a848={};_0x56a848[_0x18bf48]={'$like':'%'+_0x59babd[_0x3c41('0x42')][_0x3c41('0x33')]+'%'};return _0x56a848;})});}_0x5670dd=_[_0x3c41('0x4e')]({},_0x5670dd,_0x59babd[_0x3c41('0x50')]);return _0xca03ae['getBlackLists'](_0x5670dd);}})['then'](function(_0x25de63){if(_0x25de63){_0x3ce14f=_0x25de63['length'];if(!_0x59babd[_0x3c41('0x42')]['hasOwnProperty'](_0x3c41('0x67'))){_0x5670dd['limit']=qs[_0x3c41('0x26')](_0x59babd[_0x3c41('0x42')][_0x3c41('0x26')]);_0x5670dd[_0x3c41('0x24')]=qs[_0x3c41('0x24')](_0x59babd[_0x3c41('0x42')][_0x3c41('0x24')]);}return _0xca03ae['getBlackLists'](_0x5670dd);}})['then'](function(_0x4d10bc){if(_0x4d10bc){return _0x4d10bc?{'count':_0x3ce14f,'rows':_0x4d10bc}:null;}})['then'](respondWithResult(_0x179a60,null))['catch'](handleError(_0x179a60,null));};exports[_0x3c41('0xba')]=function(_0x4d6390,_0x158837,_0x50c2b6){var _0x146be0,_0xd02a8c;return db[_0x3c41('0x3e')][_0x3c41('0x56')]({'where':{'id':_0x4d6390[_0x3c41('0x64')]['id']}})[_0x3c41('0x2d')](handleEntityNotFound(_0x158837,null))[_0x3c41('0x2d')](function(_0xc5e803){if(_0xc5e803){_0xd02a8c=_0xc5e803;return _0xc5e803[_0x3c41('0xba')](_0x4d6390[_0x3c41('0x58')]['ids'],_['omit'](_0x4d6390['body'],[_0x3c41('0x85'),'id'])||{});}return null;})[_0x3c41('0xa2')](function(_0x366f5c){var _0x216d98;_0x146be0=_0x366f5c||[];var _0x2fb3ed=[];if(_0x366f5c){for(var _0x304a33=0x0;_0x304a33<_0x366f5c[_0x3c41('0x48')];_0x304a33+=0x1){var _0x397262=_0x366f5c[_0x304a33][_0x3c41('0x2e')]({'plain':!![]});_0x216d98=squel[_0x3c41('0xa5')]()[_0x3c41('0xa6')](_0x3c41('0xbb'))[_0x3c41('0xa8')]([_0x3c41('0xa9'),_0x3c41('0xac'),_0x3c41('0xab'),_0x3c41('0x6b'),_0x3c41('0x61'),_0x3c41('0x62')],squel[_0x3c41('0x87')]()[_0x3c41('0x88')](_0x3c41('0xa9'),_0x3c41('0xa9'))[_0x3c41('0x88')]('id',_0x3c41('0xac'))[_0x3c41('0x88')](_0x397262['CmListId'][_0x3c41('0x90')](),'ListId')[_0x3c41('0x88')](_0x4d6390[_0x3c41('0x64')]['id'][_0x3c41('0x90')](),_0x3c41('0x6b'))[_0x3c41('0x88')]('NOW()',_0x3c41('0x61'))['field']('NOW()',_0x3c41('0x62'))[_0x3c41('0xaf')](_0x3c41('0xb0'))['where'](_0x3c41('0xb1'))[_0x3c41('0x4c')](_0x3c41('0xb2'),_0x397262[_0x3c41('0xad')][_0x3c41('0x90')]())[_0x3c41('0x4c')](_0x3c41('0xb3')))[_0x3c41('0x90')]();_0x2fb3ed[_0x3c41('0x8f')](db[_0x3c41('0x79')]['query'](_0x216d98));}return BPromise['all'](_0x2fb3ed);}})[_0x3c41('0x2d')](function(){return _0x146be0;})[_0x3c41('0x2d')](respondWithResult(_0x158837,null))[_0x3c41('0x54')](handleError(_0x158837,null));};exports['removeBlackLists']=function(_0x5a3778,_0x24d6cd,_0x454d3c){return db['VoiceQueue'][_0x3c41('0x56')]({'where':{'id':_0x5a3778[_0x3c41('0x64')]['id']}})[_0x3c41('0x2d')](handleEntityNotFound(_0x24d6cd,null))['then'](function(_0x5810f1){if(_0x5810f1){return _0x5810f1['removeBlackLists'](_0x5a3778[_0x3c41('0x42')][_0x3c41('0x85')]);}})['then'](function(_0x54a7c4){if(_0x54a7c4){return db[_0x3c41('0x6f')]['destroy']({'where':{'ListId':_0x5a3778['query']['ids'],'VoiceQueueId':_0x5a3778[_0x3c41('0x64')]['id']}})[_0x3c41('0x2d')](function(){return _0x54a7c4;});}})[_0x3c41('0x2d')](respondWithStatusCode(_0x24d6cd,null))[_0x3c41('0x54')](handleError(_0x24d6cd,null));}; \ No newline at end of file +var _0x765a=['fromQuery','ContactId','ListId\x20=\x20?','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','localhost','register','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','destroy','then','get','inbound','outbound','filter','ignore','map','value','type','find','name','UserProfileResource','stack','send','index','VoiceQueue','fieldName','key','keys','query','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','VoiceQueues','QueueCampaigns','error','update','body','getHoppers','CmHopper','pick','VoiceQueueId','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','Agents','voicePause','interface','flatMap','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','format','emit','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','compact','isEmpty','removeAgents','addAgents','spread','User','online','isNil','all','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ListId','field','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)'];(function(_0x15d229,_0x132b33){var _0x2ebafc=function(_0x41a43c){while(--_0x41a43c){_0x15d229['push'](_0x15d229['shift']());}};_0x2ebafc(++_0x132b33);}(_0x765a,0x171));var _0xa765=function(_0x2461c6,_0x3fa016){_0x2461c6=_0x2461c6-0x0;var _0x3f1ce9=_0x765a[_0x2461c6];return _0x3f1ce9;};'use strict';var emlformat=require(_0xa765('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa765('0x1'));var jsonpatch=require(_0xa765('0x2'));var rp=require(_0xa765('0x3'));var moment=require(_0xa765('0x4'));var BPromise=require(_0xa765('0x5'));var Mustache=require(_0xa765('0x6'));var util=require(_0xa765('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa765('0x8'));var ejs=require(_0xa765('0x9'));var fs=require('fs');var fs_extra=require(_0xa765('0xa'));var _=require('lodash');var squel=require(_0xa765('0xb'));var crypto=require(_0xa765('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa765('0xd'));var toCsv=require(_0xa765('0x8'));var querystring=require(_0xa765('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa765('0xf'));var hardwareService=require(_0xa765('0x10'));var logger=require(_0xa765('0x11'))(_0xa765('0x12'));var utils=require('../../config/utils');var config=require(_0xa765('0x13'));var licenseUtil=require(_0xa765('0x14'));var db=require(_0xa765('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xa765('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')[_0xa765('0x17')](socket);function respondWithStatusCode(_0x4c864a,_0x21f657){_0x21f657=_0x21f657||0xcc;return function(_0x2eba66){if(_0x2eba66){return _0x4c864a[_0xa765('0x18')](_0x21f657);}return _0x4c864a['status'](_0x21f657)[_0xa765('0x19')]();};}function respondWithResult(_0x3c4f85,_0x1f7b88){_0x1f7b88=_0x1f7b88||0xc8;return function(_0x567fd5){if(_0x567fd5){return _0x3c4f85['status'](_0x1f7b88)[_0xa765('0x1a')](_0x567fd5);}};}function respondWithFilteredResult(_0x185e9f,_0x2f2bee){return function(_0x2aaff2){if(_0x2aaff2){var _0xc618bf=typeof _0x2f2bee['offset']===_0xa765('0x1b')&&typeof _0x2f2bee['limit']===_0xa765('0x1b');var _0x1fe45c=_0x2aaff2[_0xa765('0x1c')];var _0xd998f2=_0xc618bf?0x0:_0x2f2bee[_0xa765('0x1d')];var _0x416589=_0xc618bf?_0x2aaff2[_0xa765('0x1c')]:_0x2f2bee['offset']+_0x2f2bee[_0xa765('0x1e')];var _0x562cb3;if(_0x416589>=_0x1fe45c){_0x416589=_0x1fe45c;_0x562cb3=0xc8;}else{_0x562cb3=0xce;}_0x185e9f[_0xa765('0x1f')](_0x562cb3);return _0x185e9f[_0xa765('0x20')](_0xa765('0x21'),_0xd998f2+'-'+_0x416589+'/'+_0x1fe45c)['json'](_0x2aaff2);}return null;};}function patchUpdates(_0x4cf9ed){return function(_0x2f6003){try{jsonpatch[_0xa765('0x22')](_0x2f6003,_0x4cf9ed,!![]);}catch(_0x37b905){return BPromise[_0xa765('0x23')](_0x37b905);}return _0x2f6003[_0xa765('0x24')]();};}function saveUpdates(_0x507e72,_0x4671e5){return function(_0x227dc9){if(_0x227dc9){return _0x227dc9['update'](_0x507e72)['then'](function(_0x2396b2){return _0x2396b2;});}return null;};}function removeEntity(_0xdaecca,_0x497de4){return function(_0x1732b2){if(_0x1732b2){return _0x1732b2[_0xa765('0x25')]()[_0xa765('0x26')](function(){var _0x110ab9=_0x1732b2[_0xa765('0x27')]({'plain':!![]});var _0x3c7771=[{'name':'VoiceQueues','value':_0xa765('0x28'),'ignore':![]},{'name':'QueueCampaigns','value':_0xa765('0x29'),'ignore':![]}];var _0x15ed06=_(_0x3c7771)[_0xa765('0x2a')](_0xa765('0x2b'))[_0xa765('0x2c')](_0xa765('0x2d'))[_0xa765('0x2d')]();if(_['includes'](_0x15ed06,_0x110ab9[_0xa765('0x2e')])){return;}var _0x5278c6=_[_0xa765('0x2f')](_0x3c7771,[_0xa765('0x2d'),_0x110ab9[_0xa765('0x2e')]])[_0xa765('0x30')];return db[_0xa765('0x31')]['destroy']({'where':{'type':_0x5278c6,'resourceId':_0x110ab9['id']}})[_0xa765('0x26')](function(){return _0x1732b2;});})[_0xa765('0x26')](function(){_0xdaecca[_0xa765('0x1f')](0xcc)[_0xa765('0x19')]();});}};}function handleEntityNotFound(_0x1c1278,_0xe3380b){return function(_0x2478b5){if(!_0x2478b5){_0x1c1278[_0xa765('0x18')](0x194);}return _0x2478b5;};}function handleError(_0x4a930d,_0xb620ec){_0xb620ec=_0xb620ec||0x1f4;return function(_0x572d9e){logger['error'](_0x572d9e[_0xa765('0x32')]);if(_0x572d9e[_0xa765('0x30')]){delete _0x572d9e[_0xa765('0x30')];}_0x4a930d['status'](_0xb620ec)[_0xa765('0x33')](_0x572d9e);};}exports[_0xa765('0x34')]=function(_0x597780,_0x981632){var _0x4017c3={},_0x5dd46b={},_0x4332c7={'count':0x0,'rows':[]};var _0x60ff86=_[_0xa765('0x2c')](db[_0xa765('0x35')]['rawAttributes'],function(_0x263179){return{'name':_0x263179[_0xa765('0x36')],'type':_0x263179['type'][_0xa765('0x37')]};});_0x5dd46b['model']=_[_0xa765('0x2c')](_0x60ff86,_0xa765('0x30'));_0x5dd46b['query']=_[_0xa765('0x38')](_0x597780[_0xa765('0x39')]);_0x5dd46b['filters']=_['intersection'](_0x5dd46b[_0xa765('0x3a')],_0x5dd46b[_0xa765('0x39')]);_0x4017c3[_0xa765('0x3b')]=_['intersection'](_0x5dd46b[_0xa765('0x3a')],qs['fields'](_0x597780[_0xa765('0x39')][_0xa765('0x3c')]));_0x4017c3[_0xa765('0x3b')]=_0x4017c3[_0xa765('0x3b')][_0xa765('0x3d')]?_0x4017c3[_0xa765('0x3b')]:_0x5dd46b[_0xa765('0x3a')];if(!_0x597780['query'][_0xa765('0x3e')](_0xa765('0x3f'))){_0x4017c3[_0xa765('0x1e')]=qs[_0xa765('0x1e')](_0x597780[_0xa765('0x39')][_0xa765('0x1e')]);_0x4017c3[_0xa765('0x1d')]=qs[_0xa765('0x1d')](_0x597780[_0xa765('0x39')][_0xa765('0x1d')]);}_0x4017c3[_0xa765('0x40')]=qs['sort'](_0x597780[_0xa765('0x39')][_0xa765('0x41')]);_0x4017c3[_0xa765('0x42')]=qs[_0xa765('0x43')](_['pick'](_0x597780['query'],_0x5dd46b[_0xa765('0x43')]),_0x60ff86);if(_0x597780[_0xa765('0x39')][_0xa765('0x2a')]){_0x4017c3[_0xa765('0x42')]=_['merge'](_0x4017c3[_0xa765('0x42')],{'$or':_['map'](_0x60ff86,function(_0x21913e){if(_0x21913e[_0xa765('0x2e')]!==_0xa765('0x44')){var _0x939b51={};_0x939b51[_0x21913e[_0xa765('0x30')]]={'$like':'%'+_0x597780[_0xa765('0x39')]['filter']+'%'};return _0x939b51;}})});}_0x4017c3=_[_0xa765('0x45')]({},_0x4017c3,_0x597780[_0xa765('0x46')]);var _0x31ae87={'where':_0x4017c3[_0xa765('0x42')]};return db[_0xa765('0x35')][_0xa765('0x1c')](_0x31ae87)['then'](function(_0x269da0){_0x4332c7[_0xa765('0x1c')]=_0x269da0;if(_0x597780[_0xa765('0x39')][_0xa765('0x47')]){_0x4017c3[_0xa765('0x48')]=[{'all':!![]}];}return db[_0xa765('0x35')][_0xa765('0x49')](_0x4017c3);})['then'](function(_0x52243f){_0x4332c7[_0xa765('0x4a')]=_0x52243f;return _0x4332c7;})[_0xa765('0x26')](respondWithFilteredResult(_0x981632,_0x4017c3))[_0xa765('0x4b')](handleError(_0x981632,null));};exports[_0xa765('0x4c')]=function(_0x4a774e,_0x59cd5d){var _0x10097d={'raw':![],'where':{'id':_0x4a774e[_0xa765('0x4d')]['id']}},_0x40d557={};_0x40d557[_0xa765('0x3a')]=_[_0xa765('0x38')](db['VoiceQueue'][_0xa765('0x4e')]);_0x40d557[_0xa765('0x39')]=_['keys'](_0x4a774e[_0xa765('0x39')]);_0x40d557['filters']=_[_0xa765('0x4f')](_0x40d557[_0xa765('0x3a')],_0x40d557[_0xa765('0x39')]);_0x10097d[_0xa765('0x3b')]=_['intersection'](_0x40d557[_0xa765('0x3a')],qs[_0xa765('0x3c')](_0x4a774e[_0xa765('0x39')][_0xa765('0x3c')]));_0x10097d[_0xa765('0x3b')]=_0x10097d[_0xa765('0x3b')][_0xa765('0x3d')]?_0x10097d[_0xa765('0x3b')]:_0x40d557[_0xa765('0x3a')];if(_0x4a774e[_0xa765('0x39')][_0xa765('0x47')]){_0x10097d[_0xa765('0x48')]=[{'all':!![]}];}_0x10097d=_[_0xa765('0x45')]({},_0x10097d,_0x4a774e[_0xa765('0x46')]);return db[_0xa765('0x35')]['find'](_0x10097d)[_0xa765('0x26')](handleEntityNotFound(_0x59cd5d,null))[_0xa765('0x26')](respondWithResult(_0x59cd5d,null))['catch'](handleError(_0x59cd5d,null));};exports[_0xa765('0x50')]=function(_0x3718e9,_0x35b5e8){return db[_0xa765('0x35')][_0xa765('0x50')](_0x3718e9['body'],{})['then'](function(_0x2cc745){var _0x539ada=_0x3718e9[_0xa765('0x51')][_0xa765('0x27')]({'plain':!![]});if(!_0x539ada)throw new Error(_0xa765('0x52'));if(_0x539ada[_0xa765('0x53')]==='user'){var _0x5e28ed=_0x2cc745[_0xa765('0x27')]({'plain':!![]});var _0x268f91=[{'name':'VoiceQueues','value':_0xa765('0x28')},{'name':'QueueCampaigns','value':'outbound'}];var _0x2e467d=_['find'](_0x268f91,[_0xa765('0x2d'),_0x5e28ed[_0xa765('0x2e')]])[_0xa765('0x30')];return db['UserProfileSection'][_0xa765('0x2f')]({'where':{'name':_0x2e467d,'userProfileId':_0x539ada[_0xa765('0x54')]},'raw':!![]})['then'](function(_0x6a53ba){if(_0x6a53ba&&_0x6a53ba[_0xa765('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x5e28ed['name'],'resourceId':_0x5e28ed['id'],'type':_0x6a53ba[_0xa765('0x30')],'sectionId':_0x6a53ba['id']},{})[_0xa765('0x26')](function(){return _0x2cc745;});}else{return _0x2cc745;}})[_0xa765('0x4b')](function(_0x4fa4ee){logger['error'](_0xa765('0x56'),_0x4fa4ee);throw _0x4fa4ee;});}return _0x2cc745;})[_0xa765('0x26')](respondWithResult(_0x35b5e8,0xc9))['catch'](handleError(_0x35b5e8,null));};exports[_0xa765('0x57')]=function(_0x196855,_0x5bc31f){var _0x28644b={'where':{'id':_0x196855['params']['id']}},_0xdb3343={};_0xdb3343[_0xa765('0x3a')]=_[_0xa765('0x38')](db[_0xa765('0x35')][_0xa765('0x4e')]);_0x28644b[_0xa765('0x3b')]=_['intersection'](_0xdb3343['model'],qs[_0xa765('0x3c')](_0x196855[_0xa765('0x39')][_0xa765('0x3c')]));_0x28644b[_0xa765('0x3b')]=_0x28644b[_0xa765('0x3b')][_0xa765('0x3d')]?_0x28644b['attributes']:_0xdb3343['model'];if(_0x196855[_0xa765('0x39')][_0xa765('0x47')]){_0x28644b[_0xa765('0x48')]=[{'all':!![]}];}_0x28644b=_['merge']({},_0x28644b,_0x196855[_0xa765('0x46')]);return db[_0xa765('0x35')][_0xa765('0x2f')](_0x28644b)[_0xa765('0x26')](handleEntityNotFound(_0x5bc31f,null))[_0xa765('0x26')](function(_0x100700){if(_0x100700){var _0x1e5af8=_0x100700['get']({'plain':!![]});_0x1e5af8=qs[_0xa765('0x58')](_0x1e5af8,['id',_0xa765('0x59'),_0xa765('0x5a')]);_0x196855['body']=_['omit'](_0x196855['body'],['id',_0xa765('0x59'),_0xa765('0x5a')]);return db[_0xa765('0x35')][_0xa765('0x50')](_[_0xa765('0x45')](_0x1e5af8,_0x196855['body']),{'include':_0x196855['query'][_0xa765('0x47')]?[{'all':!![]}]:undefined})[_0xa765('0x26')](function(_0x2f258d){var _0x69d19d=_0x196855['user'][_0xa765('0x27')]({'plain':!![]});if(!_0x69d19d)throw new Error(_0xa765('0x52'));if(_0x69d19d[_0xa765('0x53')]==='user'){var _0x5169e9=_0x2f258d[_0xa765('0x27')]({'plain':!![]});var _0x2cd12e=[{'name':_0xa765('0x5b'),'value':_0xa765('0x28')},{'name':_0xa765('0x5c'),'value':'outbound'}];var _0x27dccf=_[_0xa765('0x2f')](_0x2cd12e,[_0xa765('0x2d'),_0x5169e9['type']])[_0xa765('0x30')];return db['UserProfileSection'][_0xa765('0x2f')]({'where':{'name':_0x27dccf,'userProfileId':_0x69d19d[_0xa765('0x54')]},'raw':!![]})['then'](function(_0xe2c1a6){if(_0xe2c1a6&&_0xe2c1a6['autoAssociation']===0x0){return db[_0xa765('0x31')][_0xa765('0x50')]({'name':_0x5169e9[_0xa765('0x30')],'resourceId':_0x5169e9['id'],'type':_0xe2c1a6[_0xa765('0x30')],'sectionId':_0xe2c1a6['id']},{})[_0xa765('0x26')](function(){return _0x2f258d;});}else{return _0x2f258d;}})[_0xa765('0x4b')](function(_0x4124ea){logger[_0xa765('0x5d')](_0xa765('0x56'),_0x4124ea);throw _0x4124ea;});}return _0x2f258d;});}})[_0xa765('0x26')](respondWithResult(_0x5bc31f,0xc9))[_0xa765('0x4b')](handleError(_0x5bc31f,null));};exports[_0xa765('0x5e')]=function(_0x528a7e,_0x13c969){if(_0x528a7e['body']['id']){delete _0x528a7e['body']['id'];}return db[_0xa765('0x35')]['find']({'where':{'id':_0x528a7e['params']['id']}})[_0xa765('0x26')](handleEntityNotFound(_0x13c969,null))['then'](saveUpdates(_0x528a7e[_0xa765('0x5f')],null))[_0xa765('0x26')](respondWithResult(_0x13c969,null))[_0xa765('0x4b')](handleError(_0x13c969,null));};exports[_0xa765('0x25')]=function(_0x27100c,_0x59495d){return db['VoiceQueue'][_0xa765('0x2f')]({'where':{'id':_0x27100c['params']['id']}})['then'](handleEntityNotFound(_0x59495d,null))[_0xa765('0x26')](removeEntity(_0x59495d,null))[_0xa765('0x4b')](handleError(_0x59495d,null));};exports[_0xa765('0x60')]=function(_0x25f40e,_0xdcffc7,_0x2823a0){var _0x4620fc={'raw':![],'where':{}};var _0x297770={};var _0x355bee={'count':0x0,'rows':[]};return db[_0xa765('0x35')]['findOne']({'where':{'id':_0x25f40e['params']['id']}})[_0xa765('0x26')](handleEntityNotFound(_0xdcffc7,null))['then'](function(_0x222801){if(_0x222801){_0x297770[_0xa765('0x3a')]=_[_0xa765('0x38')](db[_0xa765('0x61')][_0xa765('0x4e')]);_0x297770[_0xa765('0x39')]=_[_0xa765('0x38')](_0x25f40e[_0xa765('0x39')]);_0x297770[_0xa765('0x43')]=_[_0xa765('0x4f')](_0x297770[_0xa765('0x3a')],_0x297770['query']);_0x4620fc[_0xa765('0x3b')]=_[_0xa765('0x4f')](_0x297770[_0xa765('0x3a')],qs[_0xa765('0x3c')](_0x25f40e[_0xa765('0x39')][_0xa765('0x3c')]));_0x4620fc[_0xa765('0x3b')]=_0x4620fc[_0xa765('0x3b')][_0xa765('0x3d')]?_0x4620fc[_0xa765('0x3b')]:_0x297770[_0xa765('0x3a')];if(!_0x25f40e['query'][_0xa765('0x3e')]('nolimit')){_0x4620fc[_0xa765('0x1e')]=qs[_0xa765('0x1e')](_0x25f40e[_0xa765('0x39')][_0xa765('0x1e')]);_0x4620fc[_0xa765('0x1d')]=qs[_0xa765('0x1d')](_0x25f40e[_0xa765('0x39')][_0xa765('0x1d')]);}_0x4620fc['order']=qs[_0xa765('0x41')](_0x25f40e['query'][_0xa765('0x41')]);_0x4620fc[_0xa765('0x42')]=qs['filters'](_[_0xa765('0x62')](_0x25f40e[_0xa765('0x39')],_0x297770[_0xa765('0x43')]));_0x4620fc['where'][_0xa765('0x63')]=_0x222801['id'];if(_0x25f40e[_0xa765('0x39')][_0xa765('0x2a')]){_0x4620fc[_0xa765('0x42')]=_['merge'](_0x4620fc[_0xa765('0x42')],{'$or':_['map'](_0x4620fc[_0xa765('0x3b')],function(_0x1532b8){var _0x499c5c={};_0x499c5c[_0x1532b8]={'$like':'%'+_0x25f40e['query']['filter']+'%'};return _0x499c5c;})});}_0x4620fc=_[_0xa765('0x45')]({},_0x4620fc,_0x25f40e[_0xa765('0x46')]);return db[_0xa765('0x61')][_0xa765('0x1c')]({'where':_0x4620fc[_0xa765('0x42')]})['then'](function(_0x18eb5d){_0x355bee[_0xa765('0x1c')]=_0x18eb5d;if(_0x25f40e['query'][_0xa765('0x47')]){_0x4620fc[_0xa765('0x48')]=[{'all':!![]}];}return db[_0xa765('0x61')][_0xa765('0x49')](_0x4620fc);})[_0xa765('0x26')](function(_0x233643){_0x355bee['rows']=_0x233643;return _0x355bee;});}})['then'](respondWithFilteredResult(_0xdcffc7,_0x4620fc))[_0xa765('0x4b')](handleError(_0xdcffc7,null));};exports['getHopperHistories']=function(_0x360550,_0x431bd4,_0x221f57){var _0x43da71={'raw':!![],'where':{}};var _0x4e0dc6={};var _0x5ec231={'count':0x0,'rows':[]};return db[_0xa765('0x35')][_0xa765('0x64')]({'where':{'id':_0x360550['params']['id']}})[_0xa765('0x26')](handleEntityNotFound(_0x431bd4,null))[_0xa765('0x26')](function(_0x1f6302){if(_0x1f6302){_0x4e0dc6[_0xa765('0x3a')]=_[_0xa765('0x38')](db['CmHopperHistory'][_0xa765('0x4e')]);_0x4e0dc6[_0xa765('0x39')]=_[_0xa765('0x38')](_0x360550[_0xa765('0x39')]);_0x4e0dc6['filters']=_[_0xa765('0x4f')](_0x4e0dc6[_0xa765('0x3a')],_0x4e0dc6['query']);_0x43da71[_0xa765('0x3b')]=_[_0xa765('0x4f')](_0x4e0dc6[_0xa765('0x3a')],qs[_0xa765('0x3c')](_0x360550[_0xa765('0x39')][_0xa765('0x3c')]));_0x43da71[_0xa765('0x3b')]=_0x43da71[_0xa765('0x3b')][_0xa765('0x3d')]?_0x43da71[_0xa765('0x3b')]:_0x4e0dc6['model'];if(!_0x360550[_0xa765('0x39')][_0xa765('0x3e')](_0xa765('0x3f'))){_0x43da71['limit']=qs[_0xa765('0x1e')](_0x360550['query'][_0xa765('0x1e')]);_0x43da71[_0xa765('0x1d')]=qs['offset'](_0x360550[_0xa765('0x39')]['offset']);}_0x43da71[_0xa765('0x40')]=qs[_0xa765('0x41')](_0x360550[_0xa765('0x39')][_0xa765('0x41')]);_0x43da71[_0xa765('0x42')]=qs[_0xa765('0x43')](_[_0xa765('0x62')](_0x360550[_0xa765('0x39')],_0x4e0dc6['filters']));_0x43da71[_0xa765('0x42')][_0xa765('0x63')]=_0x1f6302['id'];if(_0x360550['query'][_0xa765('0x2a')]){_0x43da71[_0xa765('0x42')]=_[_0xa765('0x45')](_0x43da71['where'],{'$or':_[_0xa765('0x2c')](_0x43da71[_0xa765('0x3b')],function(_0x543e16){var _0x2a2dfa={};_0x2a2dfa[_0x543e16]={'$like':'%'+_0x360550['query'][_0xa765('0x2a')]+'%'};return _0x2a2dfa;})});}_0x43da71=_[_0xa765('0x45')]({},_0x43da71,_0x360550['options']);return db['CmHopperHistory']['count']({'where':_0x43da71[_0xa765('0x42')]})['then'](function(_0x4fac98){_0x5ec231[_0xa765('0x1c')]=_0x4fac98;if(_0x360550[_0xa765('0x39')][_0xa765('0x47')]){_0x43da71['include']=[{'all':!![]}];}return db[_0xa765('0x65')]['findAll'](_0x43da71);})['then'](function(_0x5e30d9){_0x5ec231[_0xa765('0x4a')]=_0x5e30d9;return _0x5ec231;});}})['then'](respondWithFilteredResult(_0x431bd4,_0x43da71))[_0xa765('0x4b')](handleError(_0x431bd4,null));};exports[_0xa765('0x66')]=function(_0x55488b,_0x113df8,_0x20b42b){var _0x134777={'raw':!![],'where':{}};var _0x5ea0ab={};var _0x481d8c={'count':0x0,'rows':[]};return db[_0xa765('0x35')][_0xa765('0x64')]({'where':{'id':_0x55488b[_0xa765('0x4d')]['id']}})[_0xa765('0x26')](handleEntityNotFound(_0x113df8,null))[_0xa765('0x26')](function(_0x176360){if(_0x176360){_0x5ea0ab[_0xa765('0x3a')]=_[_0xa765('0x38')](db[_0xa765('0x67')][_0xa765('0x4e')]);_0x5ea0ab[_0xa765('0x39')]=_[_0xa765('0x38')](_0x55488b[_0xa765('0x39')]);_0x5ea0ab[_0xa765('0x43')]=_['intersection'](_0x5ea0ab[_0xa765('0x3a')],_0x5ea0ab[_0xa765('0x39')]);_0x134777[_0xa765('0x3b')]=_[_0xa765('0x4f')](_0x5ea0ab['model'],qs[_0xa765('0x3c')](_0x55488b[_0xa765('0x39')][_0xa765('0x3c')]));_0x134777[_0xa765('0x3b')]=_0x134777[_0xa765('0x3b')]['length']?_0x134777[_0xa765('0x3b')]:_0x5ea0ab['model'];if(!_0x55488b[_0xa765('0x39')][_0xa765('0x3e')](_0xa765('0x3f'))){_0x134777[_0xa765('0x1e')]=qs[_0xa765('0x1e')](_0x55488b[_0xa765('0x39')]['limit']);_0x134777[_0xa765('0x1d')]=qs[_0xa765('0x1d')](_0x55488b[_0xa765('0x39')][_0xa765('0x1d')]);}_0x134777[_0xa765('0x40')]=qs[_0xa765('0x41')](_0x55488b[_0xa765('0x39')][_0xa765('0x41')]);_0x134777[_0xa765('0x42')]=qs[_0xa765('0x43')](_[_0xa765('0x62')](_0x55488b[_0xa765('0x39')],_0x5ea0ab[_0xa765('0x43')]));_0x134777[_0xa765('0x42')][_0xa765('0x63')]=_0x176360['id'];if(_0x55488b[_0xa765('0x39')][_0xa765('0x2a')]){_0x134777[_0xa765('0x42')]=_['merge'](_0x134777[_0xa765('0x42')],{'$or':_['map'](_0x134777[_0xa765('0x3b')],function(_0xf83506){var _0xe6dfa0={};_0xe6dfa0[_0xf83506]={'$like':'%'+_0x55488b[_0xa765('0x39')]['filter']+'%'};return _0xe6dfa0;})});}_0x134777=_[_0xa765('0x45')]({},_0x134777,_0x55488b[_0xa765('0x46')]);return db[_0xa765('0x67')]['count']({'where':_0x134777['where']})['then'](function(_0x4f8d8c){_0x481d8c[_0xa765('0x1c')]=_0x4f8d8c;if(_0x55488b[_0xa765('0x39')]['includeAll']){_0x134777[_0xa765('0x48')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xa765('0x49')](_0x134777);})[_0xa765('0x26')](function(_0x1283ef){_0x481d8c[_0xa765('0x4a')]=_0x1283ef;return _0x481d8c;});}})[_0xa765('0x26')](respondWithFilteredResult(_0x113df8,_0x134777))['catch'](handleError(_0x113df8,null));};exports[_0xa765('0x68')]=function(_0x56b049,_0x3c5149,_0x24ceb1){var _0x12b697={'raw':!![],'where':{}};var _0x4f8e5e={};var _0xab99b={'count':0x0,'rows':[]};return db[_0xa765('0x35')][_0xa765('0x64')]({'where':{'id':_0x56b049['params']['id']}})['then'](handleEntityNotFound(_0x3c5149,null))[_0xa765('0x26')](function(_0xf3f9be){if(_0xf3f9be){_0x4f8e5e[_0xa765('0x3a')]=_[_0xa765('0x38')](db[_0xa765('0x69')][_0xa765('0x4e')]);_0x4f8e5e[_0xa765('0x39')]=_[_0xa765('0x38')](_0x56b049[_0xa765('0x39')]);_0x4f8e5e[_0xa765('0x43')]=_[_0xa765('0x4f')](_0x4f8e5e[_0xa765('0x3a')],_0x4f8e5e[_0xa765('0x39')]);_0x12b697[_0xa765('0x3b')]=_[_0xa765('0x4f')](_0x4f8e5e[_0xa765('0x3a')],qs[_0xa765('0x3c')](_0x56b049[_0xa765('0x39')]['fields']));_0x12b697[_0xa765('0x3b')]=_0x12b697[_0xa765('0x3b')][_0xa765('0x3d')]?_0x12b697[_0xa765('0x3b')]:_0x4f8e5e['model'];if(!_0x56b049[_0xa765('0x39')]['hasOwnProperty'](_0xa765('0x3f'))){_0x12b697[_0xa765('0x1e')]=qs[_0xa765('0x1e')](_0x56b049[_0xa765('0x39')][_0xa765('0x1e')]);_0x12b697[_0xa765('0x1d')]=qs[_0xa765('0x1d')](_0x56b049[_0xa765('0x39')]['offset']);}_0x12b697[_0xa765('0x40')]=qs['sort'](_0x56b049[_0xa765('0x39')][_0xa765('0x41')]);_0x12b697[_0xa765('0x42')]=qs[_0xa765('0x43')](_['pick'](_0x56b049[_0xa765('0x39')],_0x4f8e5e[_0xa765('0x43')]));_0x12b697[_0xa765('0x42')][_0xa765('0x63')]=_0xf3f9be['id'];if(_0x56b049[_0xa765('0x39')]['filter']){_0x12b697[_0xa765('0x42')]=_[_0xa765('0x45')](_0x12b697[_0xa765('0x42')],{'$or':_[_0xa765('0x2c')](_0x12b697[_0xa765('0x3b')],function(_0x2f71cd){var _0x415716={};_0x415716[_0x2f71cd]={'$like':'%'+_0x56b049[_0xa765('0x39')][_0xa765('0x2a')]+'%'};return _0x415716;})});}_0x12b697=_[_0xa765('0x45')]({},_0x12b697,_0x56b049[_0xa765('0x46')]);return db[_0xa765('0x69')][_0xa765('0x1c')]({'where':_0x12b697[_0xa765('0x42')]})[_0xa765('0x26')](function(_0xbb6f6f){_0xab99b[_0xa765('0x1c')]=_0xbb6f6f;if(_0x56b049[_0xa765('0x39')][_0xa765('0x47')]){_0x12b697['include']=[{'all':!![]}];}return db[_0xa765('0x69')][_0xa765('0x49')](_0x12b697);})['then'](function(_0x286765){_0xab99b[_0xa765('0x4a')]=_0x286765;return _0xab99b;});}})['then'](respondWithFilteredResult(_0x3c5149,_0x12b697))[_0xa765('0x4b')](handleError(_0x3c5149,null));};exports[_0xa765('0x6a')]=function(_0x1c3a5c,_0x55d20b,_0x4237c3){var _0x4c7323={};var _0x49b0bc={};var _0x1d2ace;var _0x3ab664;return db['VoiceQueue'][_0xa765('0x64')]({'where':{'id':_0x1c3a5c[_0xa765('0x4d')]['id']}})[_0xa765('0x26')](handleEntityNotFound(_0x55d20b,null))['then'](function(_0x5a628c){if(_0x5a628c){_0x1d2ace=_0x5a628c;_0x49b0bc[_0xa765('0x3a')]=_[_0xa765('0x38')](db[_0xa765('0x6b')][_0xa765('0x4e')]);_0x49b0bc[_0xa765('0x39')]=_[_0xa765('0x38')](_0x1c3a5c[_0xa765('0x39')]);_0x49b0bc[_0xa765('0x43')]=_[_0xa765('0x4f')](_0x49b0bc['model'],_0x49b0bc['query']);_0x4c7323[_0xa765('0x3b')]=_[_0xa765('0x4f')](_0x49b0bc[_0xa765('0x3a')],qs['fields'](_0x1c3a5c[_0xa765('0x39')][_0xa765('0x3c')]));_0x4c7323[_0xa765('0x3b')]=_0x4c7323[_0xa765('0x3b')]['length']?_0x4c7323['attributes']:_0x49b0bc['model'];_0x4c7323[_0xa765('0x40')]=qs[_0xa765('0x41')](_0x1c3a5c['query']['sort']);_0x4c7323[_0xa765('0x42')]=qs['filters'](_[_0xa765('0x62')](_0x1c3a5c[_0xa765('0x39')],_0x49b0bc[_0xa765('0x43')]));if(_0x1c3a5c[_0xa765('0x39')][_0xa765('0x2a')]){_0x4c7323[_0xa765('0x42')]=_[_0xa765('0x45')](_0x4c7323[_0xa765('0x42')],{'$or':_['map'](_0x4c7323[_0xa765('0x3b')],function(_0x529687){var _0x515bea={};_0x515bea[_0x529687]={'$like':'%'+_0x1c3a5c[_0xa765('0x39')][_0xa765('0x2a')]+'%'};return _0x515bea;})});}_0x4c7323=_[_0xa765('0x45')]({},_0x4c7323,_0x1c3a5c[_0xa765('0x46')]);return _0x1d2ace[_0xa765('0x6a')](_0x4c7323);}})[_0xa765('0x26')](function(_0x6c4bac){if(_0x6c4bac){_0x3ab664=_0x6c4bac[_0xa765('0x3d')];if(!_0x1c3a5c[_0xa765('0x39')][_0xa765('0x3e')](_0xa765('0x3f'))){_0x4c7323[_0xa765('0x1e')]=qs[_0xa765('0x1e')](_0x1c3a5c[_0xa765('0x39')][_0xa765('0x1e')]);_0x4c7323[_0xa765('0x1d')]=qs[_0xa765('0x1d')](_0x1c3a5c[_0xa765('0x39')][_0xa765('0x1d')]);}return _0x1d2ace[_0xa765('0x6a')](_0x4c7323);}})['then'](function(_0x2046b5){if(_0x2046b5){return _0x2046b5?{'count':_0x3ab664,'rows':_0x2046b5}:null;}})[_0xa765('0x26')](respondWithResult(_0x55d20b,null))[_0xa765('0x4b')](handleError(_0x55d20b,null));};exports[_0xa765('0x6c')]=function(_0x568123,_0x4c20db,_0x5687ac){var _0x8297=_0x568123['body']['teams'];var _0x1fce0a=_['map'](_0x8297,'id');return db[_0xa765('0x6b')][_0xa765('0x49')]({'where':{'id':_0x1fce0a},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa765('0x6d'),'attributes':['id',_0xa765('0x30'),'online',_0xa765('0x6e'),_0xa765('0x6f')],'raw':!![]}]})['then'](function(_0x24e9f6){if(_0x24e9f6){var _0x578d24=_[_0xa765('0x70')](_0x24e9f6,function(_0x19884b){var _0x55b151=_0x19884b[_0xa765('0x27')]({'plain':!![]});_0x55b151['Agents'][_0xa765('0x71')](function(_0x3ca0a7){_0x3ca0a7[_0xa765('0x72')]=_[_0xa765('0x2f')](_0x8297,{'id':_0x55b151['id']})['penalty'];});return _0x55b151['Agents'];});return db['VoiceQueue']['find']({'where':{'id':_0x568123[_0xa765('0x4d')]['id']}})[_0xa765('0x26')](function(_0x397db4){return db['sequelize'][_0xa765('0x73')](function(_0x2faa4e){return _0x397db4[_0xa765('0x6c')](_0x1fce0a,{'transaction':_0x2faa4e})[_0xa765('0x26')](function(){return BPromise[_0xa765('0x74')](_0x8297,function(_0x48e810){return db[_0xa765('0x75')][_0xa765('0x76')]({'TeamId':_0x48e810['id'],'VoiceQueueId':_0x568123[_0xa765('0x4d')]['id'],'penalty':_0x48e810[_0xa765('0x72')]},{'transaction':_0x2faa4e});});})['then'](function(){return BPromise[_0xa765('0x74')](_0x578d24,function(_0x53c12c){return db[_0xa765('0x77')]['findOrCreate']({'where':{'UserId':_0x53c12c['id'],'VoiceQueueId':_0x568123[_0xa765('0x4d')]['id']},'defaults':{'penalty':_0x53c12c[_0xa765('0x72')]},'transaction':_0x2faa4e});});})['then'](function(){return BPromise[_0xa765('0x74')](_[_0xa765('0x2a')](_0x578d24,{'online':!![]}),function(_0x2ac51d){return db[_0xa765('0x78')]['upsert']({'membername':_0x2ac51d[_0xa765('0x30')],'UserId':_0x2ac51d['id'],'queue_name':_0x397db4[_0xa765('0x30')],'VoiceQueueId':_0x397db4['id'],'interface':_['isNil'](_0x2ac51d[_0xa765('0x6f')])?util[_0xa765('0x79')]('SIP/%s',_0x2ac51d['name']):_0x2ac51d['interface'],'paused':_0x2ac51d[_0xa765('0x6e')]||![],'penalty':_0x2ac51d[_0xa765('0x72')]},{'transaction':_0x2faa4e});});})[_0xa765('0x26')](function(){_0x578d24[_0xa765('0x71')](function(_0x182357){socket[_0xa765('0x7a')](_0xa765('0x7b'),{'UserId':_0x182357['id'],'VoiceQueueId':_0x397db4['id']});});});});});}})[_0xa765('0x26')](respondWithStatusCode(_0x4c20db,null))[_0xa765('0x4b')](handleError(_0x4c20db,null));};exports[_0xa765('0x7c')]=function(_0x142e0c,_0x539742,_0x5357ed){return db[_0xa765('0x6b')][_0xa765('0x49')]({'where':{'id':_0x142e0c['query'][_0xa765('0x7d')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x539742,null))['then'](function(_0x2fb94b){var _0x3832f3=_[_0xa765('0x2c')](_0x2fb94b,'id');var _0x4b08c3=[];var _0x48f48c=[];var _0x18bf31=squel[_0xa765('0x7e')]();_0x18bf31['field'](_0xa765('0x7f'))[_0xa765('0x80')](_0xa765('0x81'),'tq')[_0xa765('0x82')]('user_has_teams','ut',_0xa765('0x83'))[_0xa765('0x42')]('VoiceQueueId\x20=\x20?',_0x142e0c[_0xa765('0x4d')]['id']);for(var _0x23f8a6=0x0;_0x23f8a6<_0x2fb94b[_0xa765('0x3d')];_0x23f8a6+=0x1){let _0x2db8b7=_0x2fb94b[_0x23f8a6];for(var _0x311663=0x0;_0x311663<_0x2db8b7['Agents'][_0xa765('0x3d')];_0x311663+=0x1){let _0x1ea75e=_0x2db8b7[_0xa765('0x6d')][_0x311663];var _0x599915=_0x18bf31[_0xa765('0x57')]();_0x599915[_0xa765('0x42')](_0xa765('0x84'),_0x1ea75e['id']);_0x48f48c[_0xa765('0x85')](db[_0xa765('0x86')]['query'](_0x599915[_0xa765('0x87')](),{'type':db[_0xa765('0x86')][_0xa765('0x88')][_0xa765('0x89')]})['then'](function(_0x4b80f3){if(_0x4b80f3['length']===0x1){return _0x1ea75e['id'];}else{var _0x357e1d=_['every'](_[_0xa765('0x2c')](_0x4b80f3,_0xa765('0x8a')),function(_0x7a1ef3){return _[_0xa765('0x8b')](_0x3832f3,_0x7a1ef3);});if(_0x357e1d){return _0x1ea75e['id'];}}}));}}return BPromise['all'](_0x48f48c)[_0xa765('0x26')](function(_0x4d1317){_0x4b08c3=_(_0x4b08c3)['union'](_0x4d1317)[_0xa765('0x8c')]()[_0xa765('0x2d')]();return db[_0xa765('0x35')][_0xa765('0x2f')]({'where':{'id':_0x142e0c['params']['id']}})[_0xa765('0x26')](function(_0x1272e9){return db['sequelize'][_0xa765('0x73')](function(_0x1ec324){return _0x1272e9[_0xa765('0x7c')](_0x142e0c[_0xa765('0x39')][_0xa765('0x7d')],{'transaction':_0x1ec324})[_0xa765('0x26')](function(){if(!_[_0xa765('0x8d')](_0x4b08c3)){return _0x1272e9[_0xa765('0x8e')](_0x4b08c3,{'transaction':_0x1ec324})[_0xa765('0x26')](function(){return db[_0xa765('0x78')][_0xa765('0x25')]({'where':{'VoiceQueueId':_0x142e0c[_0xa765('0x4d')]['id'],'UserId':_0x4b08c3},'transaction':_0x1ec324});});}})[_0xa765('0x26')](function(){_0x4b08c3[_0xa765('0x71')](function(_0x2a8a56){socket[_0xa765('0x7a')]('userVoiceQueue:remove',{'UserId':_0x2a8a56,'VoiceQueueId':_0x1272e9['id']});});});});});});})[_0xa765('0x26')](respondWithStatusCode(_0x539742,null))['catch'](handleError(_0x539742,null));};exports[_0xa765('0x8f')]=function(_0x29c671,_0x151b86,_0x3cee12){var _0x2946eb,_0x2ce094;return db[_0xa765('0x35')]['find']({'where':{'id':_0x29c671[_0xa765('0x4d')]['id']}})[_0xa765('0x26')](handleEntityNotFound(_0x151b86,null))[_0xa765('0x26')](function(_0x41f8c9){if(_0x41f8c9){_0x2ce094=_0x41f8c9;return _0x41f8c9[_0xa765('0x8f')](_0x29c671[_0xa765('0x5f')][_0xa765('0x7d')],_[_0xa765('0x58')](_0x29c671[_0xa765('0x5f')],['ids','id'])||{})[_0xa765('0x90')](function(_0xb47acd){for(var _0x38816a=0x0;_0x38816a<_0x29c671['body'][_0xa765('0x7d')][_0xa765('0x3d')];_0x38816a+=0x1){socket[_0xa765('0x7a')](_0xa765('0x7b'),{'UserId':Number(_0x29c671[_0xa765('0x5f')]['ids'][_0x38816a]),'VoiceQueueId':Number(_0x29c671[_0xa765('0x4d')]['id'])});}return _0xb47acd;});}})['then'](function(_0x417c51){_0x2946eb=_0x417c51||[];if(_0x2ce094){return db[_0xa765('0x91')]['findAll']({'where':{'id':_0x29c671['body'][_0xa765('0x7d')]},'attributes':['id',_0xa765('0x30'),'online',_0xa765('0x6e'),_0xa765('0x6f')],'raw':!![]});}})[_0xa765('0x26')](function(_0x189737){if(!_[_0xa765('0x8d')](_0x189737)){var _0x347931=[];for(var _0x52fae4=0x0;_0x52fae4<_0x189737['length'];_0x52fae4++){if(_0x189737[_0x52fae4][_0xa765('0x92')]){_0x347931[_0xa765('0x85')](db['UserVoiceQueueRt'][_0xa765('0x76')]({'membername':_0x189737[_0x52fae4][_0xa765('0x30')],'UserId':_0x189737[_0x52fae4]['id'],'queue_name':_0x2ce094[_0xa765('0x30')],'VoiceQueueId':_0x2ce094['id'],'interface':_[_0xa765('0x93')](_0x189737[_0x52fae4][_0xa765('0x6f')])?util[_0xa765('0x79')]('SIP/%s',_0x189737[_0x52fae4][_0xa765('0x30')]):_0x189737[_0x52fae4][_0xa765('0x6f')],'paused':_0x189737[_0x52fae4][_0xa765('0x6e')]||![],'penalty':_0x29c671['body']['penalty']||0x0}));}}return BPromise[_0xa765('0x94')](_0x347931);}})['then'](function(){return _0x2946eb;})['then'](respondWithResult(_0x151b86,null))[_0xa765('0x4b')](handleError(_0x151b86,null));};exports['removeAgents']=function(_0x477a81,_0x124d03,_0x20059a){return db[_0xa765('0x35')][_0xa765('0x2f')]({'where':{'id':_0x477a81[_0xa765('0x4d')]['id']}})[_0xa765('0x26')](handleEntityNotFound(_0x124d03,null))[_0xa765('0x26')](function(_0x43c2bf){if(_0x43c2bf){return _0x43c2bf[_0xa765('0x8e')](_0x477a81[_0xa765('0x39')][_0xa765('0x7d')])[_0xa765('0x26')](function(){if(_['isArray'](_0x477a81[_0xa765('0x39')][_0xa765('0x7d')])){for(var _0x338a4b=0x0;_0x338a4b<_0x477a81['query']['ids'][_0xa765('0x3d')];_0x338a4b+=0x1){socket[_0xa765('0x7a')](_0xa765('0x95'),{'UserId':Number(_0x477a81[_0xa765('0x39')][_0xa765('0x7d')][_0x338a4b]),'VoiceQueueId':Number(_0x477a81[_0xa765('0x4d')]['id'])});}}else{socket[_0xa765('0x7a')](_0xa765('0x95'),{'UserId':Number(_0x477a81[_0xa765('0x39')]['ids']),'VoiceQueueId':Number(_0x477a81[_0xa765('0x4d')]['id'])});}});}})[_0xa765('0x26')](function(_0x555989){return db[_0xa765('0x78')][_0xa765('0x25')]({'where':{'VoiceQueueId':_0x477a81['params']['id'],'UserId':_0x477a81['query'][_0xa765('0x7d')]}})[_0xa765('0x26')](function(){return _0x555989;});})['then'](respondWithStatusCode(_0x124d03,null))[_0xa765('0x4b')](handleError(_0x124d03,null));};exports[_0xa765('0x96')]=function(_0x4bd8a5,_0x2a6d97,_0xb2d49){var _0x3cc059={};var _0x10accf={};var _0x2c2b8b;var _0x42c79d;return db[_0xa765('0x35')]['findOne']({'where':{'id':_0x4bd8a5['params']['id']}})['then'](handleEntityNotFound(_0x2a6d97,null))[_0xa765('0x26')](function(_0x4cec44){if(_0x4cec44){_0x2c2b8b=_0x4cec44;_0x10accf[_0xa765('0x3a')]=_['keys'](db[_0xa765('0x91')][_0xa765('0x4e')]);_0x10accf[_0xa765('0x39')]=_['keys'](_0x4bd8a5[_0xa765('0x39')]);_0x10accf[_0xa765('0x43')]=_[_0xa765('0x4f')](_0x10accf[_0xa765('0x3a')],_0x10accf[_0xa765('0x39')]);_0x3cc059[_0xa765('0x3b')]=_[_0xa765('0x4f')](_0x10accf[_0xa765('0x3a')],qs[_0xa765('0x3c')](_0x4bd8a5[_0xa765('0x39')][_0xa765('0x3c')]));_0x3cc059[_0xa765('0x3b')]=_0x3cc059[_0xa765('0x3b')][_0xa765('0x3d')]?_0x3cc059[_0xa765('0x3b')]:_0x10accf[_0xa765('0x3a')];_0x3cc059[_0xa765('0x40')]=qs[_0xa765('0x41')](_0x4bd8a5[_0xa765('0x39')][_0xa765('0x41')]);_0x3cc059[_0xa765('0x42')]=qs['filters'](_['pick'](_0x4bd8a5['query'],_0x10accf[_0xa765('0x43')]));if(_0x4bd8a5[_0xa765('0x39')][_0xa765('0x2a')]){_0x3cc059['where']=_['merge'](_0x3cc059['where'],{'$or':_[_0xa765('0x2c')](_0x3cc059[_0xa765('0x3b')],function(_0x335ae5){var _0x5f297c={};_0x5f297c[_0x335ae5]={'$like':'%'+_0x4bd8a5[_0xa765('0x39')][_0xa765('0x2a')]+'%'};return _0x5f297c;})});}_0x3cc059=_[_0xa765('0x45')]({},_0x3cc059,_0x4bd8a5[_0xa765('0x46')]);return _0x2c2b8b['getAgents'](_0x3cc059);}})['then'](function(_0x150c6f){if(_0x150c6f){_0x42c79d=_0x150c6f[_0xa765('0x3d')];if(!_0x4bd8a5[_0xa765('0x39')][_0xa765('0x3e')]('nolimit')){_0x3cc059['limit']=qs[_0xa765('0x1e')](_0x4bd8a5[_0xa765('0x39')][_0xa765('0x1e')]);_0x3cc059[_0xa765('0x1d')]=qs[_0xa765('0x1d')](_0x4bd8a5[_0xa765('0x39')][_0xa765('0x1d')]);}return _0x2c2b8b['getAgents'](_0x3cc059);}})[_0xa765('0x26')](function(_0x592cf8){if(_0x592cf8){return _0x592cf8?{'count':_0x42c79d,'rows':_0x592cf8}:null;}})['then'](respondWithResult(_0x2a6d97,null))[_0xa765('0x4b')](handleError(_0x2a6d97,null));};exports['getMembers']=function(_0x55547a,_0x568752,_0x3070af){var _0x5c7490={};var _0x4e3a42={};var _0x6df353;var _0x14fcde;return db[_0xa765('0x35')][_0xa765('0x64')]({'where':{'id':_0x55547a[_0xa765('0x4d')]['id']}})[_0xa765('0x26')](handleEntityNotFound(_0x568752,null))[_0xa765('0x26')](function(_0x4fe41d){if(_0x4fe41d){_0x6df353=_0x4fe41d;_0x4e3a42[_0xa765('0x3a')]=_[_0xa765('0x38')](db[_0xa765('0x78')][_0xa765('0x4e')]);_0x4e3a42[_0xa765('0x39')]=_[_0xa765('0x38')](_0x55547a['query']);_0x4e3a42[_0xa765('0x43')]=_[_0xa765('0x4f')](_0x4e3a42['model'],_0x4e3a42[_0xa765('0x39')]);_0x5c7490['attributes']=_[_0xa765('0x4f')](_0x4e3a42[_0xa765('0x3a')],qs[_0xa765('0x3c')](_0x55547a['query']['fields']));_0x5c7490[_0xa765('0x3b')]=_0x5c7490[_0xa765('0x3b')]['length']?_0x5c7490[_0xa765('0x3b')]:_0x4e3a42[_0xa765('0x3a')];_0x5c7490[_0xa765('0x40')]=qs[_0xa765('0x41')](_0x55547a[_0xa765('0x39')][_0xa765('0x41')]);_0x5c7490[_0xa765('0x42')]=qs[_0xa765('0x43')](_['pick'](_0x55547a[_0xa765('0x39')],_0x4e3a42[_0xa765('0x43')]));if(_0x55547a[_0xa765('0x39')][_0xa765('0x2a')]){_0x5c7490['where']=_[_0xa765('0x45')](_0x5c7490[_0xa765('0x42')],{'$or':_[_0xa765('0x2c')](_0x5c7490['attributes'],function(_0x28bc1a){var _0x5b388a={};_0x5b388a[_0x28bc1a]={'$like':'%'+_0x55547a[_0xa765('0x39')][_0xa765('0x2a')]+'%'};return _0x5b388a;})});}_0x5c7490=_['merge']({},_0x5c7490,_0x55547a[_0xa765('0x46')]);return _0x6df353['getMembers'](_0x5c7490);}})[_0xa765('0x26')](function(_0x1b394a){if(_0x1b394a){_0x14fcde=_0x1b394a[_0xa765('0x3d')];if(!_0x55547a[_0xa765('0x39')][_0xa765('0x3e')](_0xa765('0x3f'))){_0x5c7490[_0xa765('0x1e')]=qs['limit'](_0x55547a[_0xa765('0x39')][_0xa765('0x1e')]);_0x5c7490['offset']=qs['offset'](_0x55547a[_0xa765('0x39')][_0xa765('0x1d')]);}return _0x6df353[_0xa765('0x97')](_0x5c7490);}})[_0xa765('0x26')](function(_0x5ac924){return _0x5ac924?{'count':_0x14fcde,'rows':_0x5ac924}:null;})[_0xa765('0x26')](respondWithResult(_0x568752,null))[_0xa765('0x4b')](handleError(_0x568752,null));};exports[_0xa765('0x98')]=function(_0x299632,_0x5a33b5,_0x422adc){var _0x2fd931={};var _0x197d1d={};var _0x3d1cfd;var _0x5987f4;return db['VoiceQueue'][_0xa765('0x64')]({'where':{'id':_0x299632[_0xa765('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5a33b5,null))[_0xa765('0x26')](function(_0x1526d5){if(_0x1526d5){_0x3d1cfd=_0x1526d5;_0x197d1d[_0xa765('0x3a')]=_[_0xa765('0x38')](db[_0xa765('0x99')][_0xa765('0x4e')]);_0x197d1d[_0xa765('0x39')]=_[_0xa765('0x38')](_0x299632['query']);_0x197d1d[_0xa765('0x43')]=_[_0xa765('0x4f')](_0x197d1d[_0xa765('0x3a')],_0x197d1d[_0xa765('0x39')]);_0x2fd931[_0xa765('0x3b')]=_[_0xa765('0x4f')](_0x197d1d[_0xa765('0x3a')],qs[_0xa765('0x3c')](_0x299632[_0xa765('0x39')][_0xa765('0x3c')]));_0x2fd931[_0xa765('0x3b')]=_0x2fd931[_0xa765('0x3b')][_0xa765('0x3d')]?_0x2fd931[_0xa765('0x3b')]:_0x197d1d[_0xa765('0x3a')];_0x2fd931[_0xa765('0x40')]=qs[_0xa765('0x41')](_0x299632[_0xa765('0x39')][_0xa765('0x41')]);_0x2fd931[_0xa765('0x42')]=qs[_0xa765('0x43')](_[_0xa765('0x62')](_0x299632[_0xa765('0x39')],_0x197d1d[_0xa765('0x43')]));if(_0x299632[_0xa765('0x39')]['filter']){_0x2fd931[_0xa765('0x42')]=_[_0xa765('0x45')](_0x2fd931[_0xa765('0x42')],{'$or':_[_0xa765('0x2c')](_0x2fd931[_0xa765('0x3b')],function(_0x3bcbe7){var _0x4f609c={};_0x4f609c[_0x3bcbe7]={'$like':'%'+_0x299632['query'][_0xa765('0x2a')]+'%'};return _0x4f609c;})});}_0x2fd931=_['merge']({},_0x2fd931,_0x299632[_0xa765('0x46')]);return _0x3d1cfd[_0xa765('0x98')](_0x2fd931);}})['then'](function(_0x186c4f){if(_0x186c4f){_0x5987f4=_0x186c4f[_0xa765('0x3d')];if(!_0x299632[_0xa765('0x39')]['hasOwnProperty'](_0xa765('0x3f'))){_0x2fd931[_0xa765('0x1e')]=qs['limit'](_0x299632[_0xa765('0x39')][_0xa765('0x1e')]);_0x2fd931[_0xa765('0x1d')]=qs['offset'](_0x299632[_0xa765('0x39')][_0xa765('0x1d')]);}return _0x3d1cfd[_0xa765('0x98')](_0x2fd931);}})['then'](function(_0x2c7d29){if(_0x2c7d29){return _0x2c7d29?{'count':_0x5987f4,'rows':_0x2c7d29}:null;}})['then'](respondWithResult(_0x5a33b5,null))[_0xa765('0x4b')](handleError(_0x5a33b5,null));};exports[_0xa765('0x9a')]=function(_0x58e9af,_0x185331,_0x145e29){var _0x18b4ca,_0xff26cf;return db[_0xa765('0x35')][_0xa765('0x2f')]({'where':{'id':_0x58e9af[_0xa765('0x4d')]['id']}})['then'](handleEntityNotFound(_0x185331,null))[_0xa765('0x26')](function(_0x5704c1){if(_0x5704c1){_0xff26cf=_0x5704c1;return _0x5704c1['addLists'](_0x58e9af['body'][_0xa765('0x7d')],_[_0xa765('0x58')](_0x58e9af[_0xa765('0x5f')],[_0xa765('0x7d'),'id'])||{});}return null;})['spread'](function(_0x526cbe){var _0x5ec47b;_0x18b4ca=_0x526cbe||[];var _0x30e55d=[];if(_0x526cbe){for(var _0x53e038=0x0;_0x53e038<_0x526cbe[_0xa765('0x3d')];_0x53e038+=0x1){var _0xe68303=_0x526cbe[_0x53e038][_0xa765('0x27')]({'plain':!![]});_0xff26cf[_0xa765('0x9b')]=_0x58e9af[_0xa765('0x5f')]['dialCheckDuplicateType']?_0x58e9af['body']['dialCheckDuplicateType']:_0xff26cf[_0xa765('0x9b')];switch(_0xff26cf[_0xa765('0x9b')]){case _0xa765('0x9c'):_0x5ec47b=squel[_0xa765('0x9d')]()[_0xa765('0x9e')](_0xa765('0x9f'))['fromQuery']([_0xa765('0xa0'),_0xa765('0xa1'),'ContactId',_0xa765('0xa2'),_0xa765('0x63'),_0xa765('0x59'),'updatedAt'],squel[_0xa765('0x7e')]()[_0xa765('0xa3')](_0xa765('0xa0'),'phone')[_0xa765('0xa3')](_0xa765('0xa4'),'scheduledAt')[_0xa765('0xa3')]('id','ContactId')['field'](_0xe68303[_0xa765('0xa5')][_0xa765('0x87')](),_0xa765('0xa2'))[_0xa765('0xa3')](_0x58e9af[_0xa765('0x4d')]['id'][_0xa765('0x87')](),_0xa765('0x63'))[_0xa765('0xa3')]('NOW()',_0xa765('0x59'))[_0xa765('0xa3')](_0xa765('0xa4'),_0xa765('0x5a'))[_0xa765('0x80')](_0xa765('0xa6'))['where'](_0xa765('0xa7'))[_0xa765('0x42')]('ListId\x20=\x20?',_0xe68303[_0xa765('0xa5')]['toString']())[_0xa765('0x42')](_0xa765('0xa8'))[_0xa765('0x42')](_0xa765('0xa9'),squel['select']()['field'](_0xa765('0xaa'))['from'](_0xa765('0xab'))[_0xa765('0x42')](_0xa765('0xac'),_0x58e9af['params']['id']['toString']()))[_0xa765('0x42')](_0xa765('0xa9'),squel['select']()['field'](_0xa765('0xad'))[_0xa765('0x80')](_0xa765('0x9f'))['where']('VoiceQueueId\x20=\x20?',_0x58e9af[_0xa765('0x4d')]['id']['toString']())))[_0xa765('0x87')]();break;case'onlyIfOpen':_0x5ec47b=squel[_0xa765('0x9d')]()[_0xa765('0x9e')](_0xa765('0x9f'))[_0xa765('0xae')]([_0xa765('0xa0'),_0xa765('0xa1'),_0xa765('0xaf'),_0xa765('0xa2'),'VoiceQueueId',_0xa765('0x59'),'updatedAt'],squel[_0xa765('0x7e')]()['field']('phone','phone')['field']('NOW()',_0xa765('0xa1'))[_0xa765('0xa3')]('id',_0xa765('0xaf'))[_0xa765('0xa3')](_0xe68303[_0xa765('0xa5')][_0xa765('0x87')](),_0xa765('0xa2'))[_0xa765('0xa3')](_0x58e9af[_0xa765('0x4d')]['id']['toString'](),'VoiceQueueId')['field']('NOW()','createdAt')[_0xa765('0xa3')](_0xa765('0xa4'),_0xa765('0x5a'))[_0xa765('0x80')]('cm_contacts')[_0xa765('0x42')](_0xa765('0xa7'))[_0xa765('0x42')](_0xa765('0xb0'),_0xe68303[_0xa765('0xa5')][_0xa765('0x87')]())[_0xa765('0x42')](_0xa765('0xa8'))[_0xa765('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa765('0x7e')]()[_0xa765('0xa3')](_0xa765('0xad'))['from']('cm_hopper')[_0xa765('0x42')](_0xa765('0xac'),_0x58e9af['params']['id'][_0xa765('0x87')]())))['toString']();break;default:_0x5ec47b=squel['insert']()['into'](_0xa765('0x9f'))[_0xa765('0xae')]([_0xa765('0xa0'),_0xa765('0xa1'),_0xa765('0xaf'),_0xa765('0xa2'),_0xa765('0x63'),_0xa765('0x59'),_0xa765('0x5a')],squel[_0xa765('0x7e')]()[_0xa765('0xa3')](_0xa765('0xa0'),'phone')[_0xa765('0xa3')](_0xa765('0xa4'),_0xa765('0xa1'))[_0xa765('0xa3')]('id',_0xa765('0xaf'))[_0xa765('0xa3')](_0xe68303[_0xa765('0xa5')]['toString'](),'ListId')[_0xa765('0xa3')](_0x58e9af[_0xa765('0x4d')]['id'][_0xa765('0x87')](),'VoiceQueueId')[_0xa765('0xa3')](_0xa765('0xa4'),'createdAt')[_0xa765('0xa3')](_0xa765('0xa4'),_0xa765('0x5a'))[_0xa765('0x80')]('cm_contacts')['where'](_0xa765('0xa7'))[_0xa765('0x42')](_0xa765('0xb0'),_0xe68303[_0xa765('0xa5')]['toString']())[_0xa765('0x42')](_0xa765('0xa8')))[_0xa765('0x87')]();}_0x30e55d[_0xa765('0x85')](db[_0xa765('0x86')]['query'](_0x5ec47b));}return BPromise[_0xa765('0x94')](_0x30e55d);}})[_0xa765('0x26')](function(){return _0x18b4ca;})[_0xa765('0x26')](respondWithResult(_0x185331,null))[_0xa765('0x4b')](handleError(_0x185331,null));};exports['removeLists']=function(_0x4f55af,_0x5b9c6d,_0x4ea2a0){return db[_0xa765('0x35')][_0xa765('0x2f')]({'where':{'id':_0x4f55af['params']['id']}})[_0xa765('0x26')](handleEntityNotFound(_0x5b9c6d,null))[_0xa765('0x26')](function(_0x2454d5){if(_0x2454d5){return _0x2454d5['removeLists'](_0x4f55af[_0xa765('0x39')][_0xa765('0x7d')]);}})[_0xa765('0x26')](function(_0x2bdf94){if(_0x2bdf94){return db[_0xa765('0x61')][_0xa765('0x25')]({'where':{'ListId':_0x4f55af[_0xa765('0x39')][_0xa765('0x7d')],'VoiceQueueId':_0x4f55af[_0xa765('0x4d')]['id']}})[_0xa765('0x26')](function(){return _0x2bdf94;});}})['then'](respondWithStatusCode(_0x5b9c6d,null))['catch'](handleError(_0x5b9c6d,null));};exports[_0xa765('0xb1')]=function(_0x51c099,_0x54e097,_0x42350c){var _0x34f2b4={};var _0x44efdf={};var _0x5c8cf2;var _0x2e854d;return db[_0xa765('0x35')][_0xa765('0x64')]({'where':{'id':_0x51c099['params']['id']}})[_0xa765('0x26')](handleEntityNotFound(_0x54e097,null))['then'](function(_0x1c8520){if(_0x1c8520){_0x5c8cf2=_0x1c8520;_0x44efdf[_0xa765('0x3a')]=_[_0xa765('0x38')](db['CmList']['rawAttributes']);_0x44efdf[_0xa765('0x39')]=_[_0xa765('0x38')](_0x51c099['query']);_0x44efdf[_0xa765('0x43')]=_[_0xa765('0x4f')](_0x44efdf['model'],_0x44efdf[_0xa765('0x39')]);_0x34f2b4[_0xa765('0x3b')]=_[_0xa765('0x4f')](_0x44efdf[_0xa765('0x3a')],qs[_0xa765('0x3c')](_0x51c099[_0xa765('0x39')][_0xa765('0x3c')]));_0x34f2b4[_0xa765('0x3b')]=_0x34f2b4[_0xa765('0x3b')]['length']?_0x34f2b4[_0xa765('0x3b')]:_0x44efdf[_0xa765('0x3a')];_0x34f2b4[_0xa765('0x40')]=qs['sort'](_0x51c099['query'][_0xa765('0x41')]);_0x34f2b4['where']=qs['filters'](_[_0xa765('0x62')](_0x51c099[_0xa765('0x39')],_0x44efdf['filters']));if(_0x51c099[_0xa765('0x39')][_0xa765('0x2a')]){_0x34f2b4[_0xa765('0x42')]=_[_0xa765('0x45')](_0x34f2b4[_0xa765('0x42')],{'$or':_[_0xa765('0x2c')](_0x34f2b4[_0xa765('0x3b')],function(_0x400d54){var _0x5c092e={};_0x5c092e[_0x400d54]={'$like':'%'+_0x51c099['query'][_0xa765('0x2a')]+'%'};return _0x5c092e;})});}_0x34f2b4=_[_0xa765('0x45')]({},_0x34f2b4,_0x51c099['options']);return _0x5c8cf2[_0xa765('0xb1')](_0x34f2b4);}})[_0xa765('0x26')](function(_0x3de004){if(_0x3de004){_0x2e854d=_0x3de004['length'];if(!_0x51c099[_0xa765('0x39')][_0xa765('0x3e')](_0xa765('0x3f'))){_0x34f2b4[_0xa765('0x1e')]=qs[_0xa765('0x1e')](_0x51c099[_0xa765('0x39')][_0xa765('0x1e')]);_0x34f2b4['offset']=qs[_0xa765('0x1d')](_0x51c099[_0xa765('0x39')][_0xa765('0x1d')]);}return _0x5c8cf2['getBlackLists'](_0x34f2b4);}})[_0xa765('0x26')](function(_0xedca4){if(_0xedca4){return _0xedca4?{'count':_0x2e854d,'rows':_0xedca4}:null;}})[_0xa765('0x26')](respondWithResult(_0x54e097,null))[_0xa765('0x4b')](handleError(_0x54e097,null));};exports[_0xa765('0xb2')]=function(_0x41b52e,_0x4bbf5a,_0x454fb0){var _0x4b37e1,_0x12c6a9;return db[_0xa765('0x35')]['find']({'where':{'id':_0x41b52e[_0xa765('0x4d')]['id']}})[_0xa765('0x26')](handleEntityNotFound(_0x4bbf5a,null))['then'](function(_0x230235){if(_0x230235){_0x12c6a9=_0x230235;return _0x230235[_0xa765('0xb2')](_0x41b52e[_0xa765('0x5f')][_0xa765('0x7d')],_[_0xa765('0x58')](_0x41b52e[_0xa765('0x5f')],[_0xa765('0x7d'),'id'])||{});}return null;})[_0xa765('0x90')](function(_0x33f293){var _0x21cd1c;_0x4b37e1=_0x33f293||[];var _0x2cf5cf=[];if(_0x33f293){for(var _0x5bcdd4=0x0;_0x5bcdd4<_0x33f293[_0xa765('0x3d')];_0x5bcdd4+=0x1){var _0x4ab16e=_0x33f293[_0x5bcdd4][_0xa765('0x27')]({'plain':!![]});_0x21cd1c=squel[_0xa765('0x9d')]()['into'](_0xa765('0xb3'))[_0xa765('0xae')]([_0xa765('0xa0'),_0xa765('0xaf'),_0xa765('0xa2'),_0xa765('0x63'),_0xa765('0x59'),_0xa765('0x5a')],squel[_0xa765('0x7e')]()[_0xa765('0xa3')](_0xa765('0xa0'),_0xa765('0xa0'))['field']('id',_0xa765('0xaf'))[_0xa765('0xa3')](_0x4ab16e[_0xa765('0xa5')][_0xa765('0x87')](),_0xa765('0xa2'))[_0xa765('0xa3')](_0x41b52e[_0xa765('0x4d')]['id'][_0xa765('0x87')](),_0xa765('0x63'))['field'](_0xa765('0xa4'),_0xa765('0x59'))[_0xa765('0xa3')]('NOW()',_0xa765('0x5a'))[_0xa765('0x80')](_0xa765('0xa6'))['where'](_0xa765('0xa7'))[_0xa765('0x42')](_0xa765('0xb0'),_0x4ab16e[_0xa765('0xa5')]['toString']())[_0xa765('0x42')](_0xa765('0xa8')))[_0xa765('0x87')]();_0x2cf5cf['push'](db[_0xa765('0x86')][_0xa765('0x39')](_0x21cd1c));}return BPromise[_0xa765('0x94')](_0x2cf5cf);}})[_0xa765('0x26')](function(){return _0x4b37e1;})[_0xa765('0x26')](respondWithResult(_0x4bbf5a,null))[_0xa765('0x4b')](handleError(_0x4bbf5a,null));};exports['removeBlackLists']=function(_0x1284ee,_0x14d750,_0x31e5c9){return db[_0xa765('0x35')]['find']({'where':{'id':_0x1284ee[_0xa765('0x4d')]['id']}})[_0xa765('0x26')](handleEntityNotFound(_0x14d750,null))[_0xa765('0x26')](function(_0x18aef7){if(_0x18aef7){return _0x18aef7[_0xa765('0xb4')](_0x1284ee[_0xa765('0x39')]['ids']);}})['then'](function(_0x10e461){if(_0x10e461){return db[_0xa765('0x69')][_0xa765('0x25')]({'where':{'ListId':_0x1284ee['query']['ids'],'VoiceQueueId':_0x1284ee['params']['id']}})[_0xa765('0x26')](function(){return _0x10e461;});}})[_0xa765('0x26')](respondWithStatusCode(_0x14d750,null))[_0xa765('0x4b')](handleError(_0x14d750,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 124c80a..cde5229 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 _0x12df=['emit','hook','exports','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove'];(function(_0x3fe11b,_0x256855){var _0x2ca335=function(_0x38ea64){while(--_0x38ea64){_0x3fe11b['push'](_0x3fe11b['shift']());}};_0x2ca335(++_0x256855);}(_0x12df,0x108));var _0xf12d=function(_0x4693f1,_0x1b1994){_0x4693f1=_0x4693f1-0x0;var _0x4a4b1a=_0x12df[_0x4693f1];return _0x4a4b1a;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xf12d('0x0'))['db'][_0xf12d('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf12d('0x2')](0x0);var events={'afterCreate':_0xf12d('0x3'),'afterUpdate':_0xf12d('0x4'),'afterDestroy':_0xf12d('0x5')};function emitEvent(_0x1a610f){return function(_0x465db4,_0x5079af,_0x24ccd5){VoiceQueueEvents[_0xf12d('0x6')](_0x1a610f+':'+_0x465db4['id'],_0x465db4);VoiceQueueEvents['emit'](_0x1a610f,_0x465db4);_0x24ccd5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xf12d('0x7')](e,emitEvent(event));}}module[_0xf12d('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x240c=['hook','setMaxListeners','save','update','remove','emit'];(function(_0x16d34a,_0x416914){var _0x2cb8c4=function(_0x478099){while(--_0x478099){_0x16d34a['push'](_0x16d34a['shift']());}};_0x2cb8c4(++_0x416914);}(_0x240c,0x139));var _0xc240=function(_0x2018f7,_0x790b84){_0x2018f7=_0x2018f7-0x0;var _0x58c8fc=_0x240c[_0x2018f7];return _0x58c8fc;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc240('0x0')](0x0);var events={'afterCreate':_0xc240('0x1'),'afterUpdate':_0xc240('0x2'),'afterDestroy':_0xc240('0x3')};function emitEvent(_0x213c47){return function(_0x16a892,_0x29d548,_0x269127){VoiceQueueEvents['emit'](_0x213c47+':'+_0x16a892['id'],_0x16a892);VoiceQueueEvents[_0xc240('0x4')](_0x213c47,_0x16a892);_0x269127(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xc240('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 4888407..01b2501 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 _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x17dfb,_0x30c8aa){var _0x206654=function(_0x2920ab){while(--_0x2920ab){_0x17dfb['push'](_0x17dfb['shift']());}};_0x206654(++_0x30c8aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x21113d,_0x1829d0){var _0x3865bb=function(_0x55ff53){while(--_0x55ff53){_0x21113d['push'](_0x21113d['shift']());}};_0x3865bb(++_0x1829d0);}(_0xedd9,0xfc));var _0x9edd=function(_0x2e3d80,_0xd01ecc){_0x2e3d80=_0x2e3d80-0x0;var _0x3afbad=_0xedd9[_0x2e3d80];return _0x3afbad;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 6737070..7cbb857 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 _0x5801=['error','message','result','catch','VoiceQueue','findAll','options','where','attributes','limit','include','map','model','GetVoiceQueue','stringify','ShowVoiceQueue','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','localhost','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5801,0x198));var _0x1580=function(_0x2d439e,_0xf3bc3b){_0x2d439e=_0x2d439e-0x0;var _0x1b7b36=_0x5801[_0x2d439e];return _0x1b7b36;};'use strict';var _=require(_0x1580('0x0'));var util=require(_0x1580('0x1'));var moment=require(_0x1580('0x2'));var BPromise=require(_0x1580('0x3'));var rs=require(_0x1580('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1580('0x5'))['db'];var utils=require(_0x1580('0x6'));var logger=require(_0x1580('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1580('0x8'));var client=jayson[_0x1580('0x9')]['http']({'port':0x232a});config[_0x1580('0xa')]=_['defaults'](config[_0x1580('0xa')],{'host':_0x1580('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1580('0xc'))[_0x1580('0xd')](socket);function respondWithRpcPromise(_0x1b7b93,_0x548953,_0x50bbf4){return new BPromise(function(_0x4d508a,_0x3af09e){return client[_0x1580('0xe')](_0x1b7b93,_0x50bbf4)[_0x1580('0xf')](function(_0xb9eb6){logger[_0x1580('0x10')](_0x1580('0x11'),_0x548953,_0x1580('0x12'));logger[_0x1580('0x13')](_0x1580('0x14'),_0x548953,'request\x20sent',JSON['stringify'](_0xb9eb6));if(_0xb9eb6[_0x1580('0x15')]){if(_0xb9eb6[_0x1580('0x15')]['code']===0x1f4){logger[_0x1580('0x15')](_0x1580('0x11'),_0x548953,_0xb9eb6['error']['message']);return _0x3af09e(_0xb9eb6[_0x1580('0x15')][_0x1580('0x16')]);}logger[_0x1580('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x548953,_0xb9eb6[_0x1580('0x15')][_0x1580('0x16')]);return _0x4d508a(_0xb9eb6[_0x1580('0x15')][_0x1580('0x16')]);}else{logger[_0x1580('0x10')](_0x1580('0x11'),_0x548953,_0x1580('0x12'));_0x4d508a(_0xb9eb6[_0x1580('0x17')][_0x1580('0x16')]);}})[_0x1580('0x18')](function(_0x40a1f5){logger[_0x1580('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x548953,_0x40a1f5);_0x3af09e(_0x40a1f5);});});}exports['GetVoiceQueue']=function(_0x2433c0){var _0x1bddc2=this;return new Promise(function(_0x4853d5,_0x5baf0d){return db[_0x1580('0x19')][_0x1580('0x1a')]({'raw':_0x2433c0[_0x1580('0x1b')]?_0x2433c0[_0x1580('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2433c0['options']?_0x2433c0['options'][_0x1580('0x1c')]||null:null,'attributes':_0x2433c0[_0x1580('0x1b')]?_0x2433c0[_0x1580('0x1b')][_0x1580('0x1d')]||null:null,'limit':_0x2433c0[_0x1580('0x1b')]?_0x2433c0[_0x1580('0x1b')][_0x1580('0x1e')]||null:null,'include':_0x2433c0[_0x1580('0x1b')]?_0x2433c0[_0x1580('0x1b')][_0x1580('0x1f')]?_[_0x1580('0x20')](_0x2433c0[_0x1580('0x1b')]['include'],function(_0x2ecfde){return{'model':db[_0x2ecfde['model']],'as':_0x2ecfde['as'],'attributes':_0x2ecfde['attributes'],'include':_0x2ecfde[_0x1580('0x1f')]?_[_0x1580('0x20')](_0x2ecfde['include'],function(_0x256310){return{'model':db[_0x256310[_0x1580('0x21')]],'as':_0x256310['as'],'attributes':_0x256310['attributes'],'include':_0x256310[_0x1580('0x1f')]?_[_0x1580('0x20')](_0x256310[_0x1580('0x1f')],function(_0xde46b0){return{'model':db[_0xde46b0[_0x1580('0x21')]],'as':_0xde46b0['as'],'attributes':_0xde46b0[_0x1580('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x175dc1){logger[_0x1580('0x10')](_0x1580('0x22'),_0x2433c0);logger[_0x1580('0x13')](_0x1580('0x22'),_0x2433c0,JSON[_0x1580('0x23')](_0x175dc1));_0x4853d5(_0x175dc1);})[_0x1580('0x18')](function(_0x3e4ee8){logger['error'](_0x1580('0x22'),_0x3e4ee8[_0x1580('0x16')],_0x2433c0);_0x5baf0d(_0x1bddc2[_0x1580('0x15')](0x1f4,_0x3e4ee8[_0x1580('0x16')]));});});};exports[_0x1580('0x24')]=function(_0x2cb438){var _0x317f11=this;return new Promise(function(_0x1d0d69,_0x3658bd){return db[_0x1580('0x19')][_0x1580('0x25')]({'raw':_0x2cb438[_0x1580('0x1b')]?_0x2cb438[_0x1580('0x1b')][_0x1580('0x26')]===undefined?!![]:![]:!![],'where':_0x2cb438[_0x1580('0x1b')]?_0x2cb438[_0x1580('0x1b')][_0x1580('0x1c')]||null:null,'attributes':_0x2cb438['options']?_0x2cb438[_0x1580('0x1b')][_0x1580('0x1d')]||null:null,'include':_0x2cb438[_0x1580('0x1b')]?_0x2cb438[_0x1580('0x1b')][_0x1580('0x1f')]?_[_0x1580('0x20')](_0x2cb438[_0x1580('0x1b')]['include'],function(_0x36c8b4){return{'model':db[_0x36c8b4['model']],'as':_0x36c8b4['as'],'attributes':_0x36c8b4['attributes'],'include':_0x36c8b4[_0x1580('0x1f')]?_['map'](_0x36c8b4[_0x1580('0x1f')],function(_0x1017f6){return{'model':db[_0x1017f6[_0x1580('0x21')]],'as':_0x1017f6['as'],'attributes':_0x1017f6[_0x1580('0x1d')],'include':_0x1017f6[_0x1580('0x1f')]?_[_0x1580('0x20')](_0x1017f6[_0x1580('0x1f')],function(_0x1d5f5a){return{'model':db[_0x1d5f5a[_0x1580('0x21')]],'as':_0x1d5f5a['as'],'attributes':_0x1d5f5a[_0x1580('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1580('0xf')](function(_0x34f178){logger[_0x1580('0x10')](_0x1580('0x24'),_0x2cb438);logger[_0x1580('0x13')](_0x1580('0x24'),_0x2cb438,JSON['stringify'](_0x34f178));_0x1d0d69(_0x34f178);})['catch'](function(_0x121e9f){logger[_0x1580('0x15')]('ShowVoiceQueue',_0x121e9f[_0x1580('0x16')],_0x2cb438);_0x3658bd(_0x317f11['error'](0x1f4,_0x121e9f[_0x1580('0x16')]));});});}; \ No newline at end of file +var _0xe024=['lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','map','include','model','debug','ShowVoiceQueue'];(function(_0x55daed,_0x892a6d){var _0x5d5451=function(_0x5e5e93){while(--_0x5e5e93){_0x55daed['push'](_0x55daed['shift']());}};_0x5d5451(++_0x892a6d);}(_0xe024,0x1b0));var _0x4e02=function(_0x542d80,_0x150561){_0x542d80=_0x542d80-0x0;var _0x1f4492=_0xe024[_0x542d80];return _0x1f4492;};'use strict';var _=require(_0x4e02('0x0'));var util=require(_0x4e02('0x1'));var moment=require(_0x4e02('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e02('0x3'))['db'];var utils=require(_0x4e02('0x4'));var logger=require('../../config/logger')(_0x4e02('0x5'));var config=require(_0x4e02('0x6'));var jayson=require(_0x4e02('0x7'));var client=jayson['client'][_0x4e02('0x8')]({'port':0x232a});config['redis']=_[_0x4e02('0x9')](config[_0x4e02('0xa')],{'host':_0x4e02('0xb'),'port':0x18eb});var socket=require(_0x4e02('0xc'))(new Redis(config[_0x4e02('0xa')]));require(_0x4e02('0xd'))['register'](socket);function respondWithRpcPromise(_0x33ae48,_0x2358c2,_0x1d1065){return new BPromise(function(_0x4883e4,_0x371c9c){return client[_0x4e02('0xe')](_0x33ae48,_0x1d1065)[_0x4e02('0xf')](function(_0x2df849){logger['info'](_0x4e02('0x10'),_0x2358c2,_0x4e02('0x11'));logger['debug'](_0x4e02('0x12'),_0x2358c2,_0x4e02('0x11'),JSON[_0x4e02('0x13')](_0x2df849));if(_0x2df849[_0x4e02('0x14')]){if(_0x2df849['error']['code']===0x1f4){logger[_0x4e02('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x2358c2,_0x2df849[_0x4e02('0x14')]['message']);return _0x371c9c(_0x2df849['error'][_0x4e02('0x15')]);}logger[_0x4e02('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x2358c2,_0x2df849[_0x4e02('0x14')][_0x4e02('0x15')]);return _0x4883e4(_0x2df849[_0x4e02('0x14')]['message']);}else{logger[_0x4e02('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x2358c2,_0x4e02('0x11'));_0x4883e4(_0x2df849['result'][_0x4e02('0x15')]);}})[_0x4e02('0x17')](function(_0x326e26){logger[_0x4e02('0x14')](_0x4e02('0x10'),_0x2358c2,_0x326e26);_0x371c9c(_0x326e26);});});}exports[_0x4e02('0x18')]=function(_0x3fad32){var _0x1d638b=this;return new Promise(function(_0x361e8a,_0x3f107f){return db[_0x4e02('0x19')]['findAll']({'raw':_0x3fad32['options']?_0x3fad32[_0x4e02('0x1a')][_0x4e02('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fad32[_0x4e02('0x1a')]?_0x3fad32['options'][_0x4e02('0x1c')]||null:null,'attributes':_0x3fad32[_0x4e02('0x1a')]?_0x3fad32['options'][_0x4e02('0x1d')]||null:null,'limit':_0x3fad32['options']?_0x3fad32[_0x4e02('0x1a')][_0x4e02('0x1e')]||null:null,'include':_0x3fad32[_0x4e02('0x1a')]?_0x3fad32['options']['include']?_[_0x4e02('0x1f')](_0x3fad32[_0x4e02('0x1a')]['include'],function(_0x2c210e){return{'model':db[_0x2c210e['model']],'as':_0x2c210e['as'],'attributes':_0x2c210e['attributes'],'include':_0x2c210e[_0x4e02('0x20')]?_[_0x4e02('0x1f')](_0x2c210e['include'],function(_0x5b20bc){return{'model':db[_0x5b20bc[_0x4e02('0x21')]],'as':_0x5b20bc['as'],'attributes':_0x5b20bc['attributes'],'include':_0x5b20bc[_0x4e02('0x20')]?_[_0x4e02('0x1f')](_0x5b20bc['include'],function(_0x5e1e29){return{'model':db[_0x5e1e29[_0x4e02('0x21')]],'as':_0x5e1e29['as'],'attributes':_0x5e1e29[_0x4e02('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd619a4){logger[_0x4e02('0x16')]('GetVoiceQueue',_0x3fad32);logger[_0x4e02('0x22')](_0x4e02('0x18'),_0x3fad32,JSON[_0x4e02('0x13')](_0xd619a4));_0x361e8a(_0xd619a4);})[_0x4e02('0x17')](function(_0x993a87){logger['error'](_0x4e02('0x18'),_0x993a87['message'],_0x3fad32);_0x3f107f(_0x1d638b[_0x4e02('0x14')](0x1f4,_0x993a87[_0x4e02('0x15')]));});});};exports['ShowVoiceQueue']=function(_0x2774f3){var _0x2369ac=this;return new Promise(function(_0x14994d,_0x52bdaa){return db[_0x4e02('0x19')]['find']({'raw':_0x2774f3[_0x4e02('0x1a')]?_0x2774f3[_0x4e02('0x1a')][_0x4e02('0x1b')]===undefined?!![]:![]:!![],'where':_0x2774f3[_0x4e02('0x1a')]?_0x2774f3['options'][_0x4e02('0x1c')]||null:null,'attributes':_0x2774f3[_0x4e02('0x1a')]?_0x2774f3[_0x4e02('0x1a')][_0x4e02('0x1d')]||null:null,'include':_0x2774f3[_0x4e02('0x1a')]?_0x2774f3[_0x4e02('0x1a')][_0x4e02('0x20')]?_['map'](_0x2774f3['options']['include'],function(_0x5dbea8){return{'model':db[_0x5dbea8[_0x4e02('0x21')]],'as':_0x5dbea8['as'],'attributes':_0x5dbea8[_0x4e02('0x1d')],'include':_0x5dbea8[_0x4e02('0x20')]?_[_0x4e02('0x1f')](_0x5dbea8[_0x4e02('0x20')],function(_0x200115){return{'model':db[_0x200115[_0x4e02('0x21')]],'as':_0x200115['as'],'attributes':_0x200115[_0x4e02('0x1d')],'include':_0x200115[_0x4e02('0x20')]?_[_0x4e02('0x1f')](_0x200115['include'],function(_0x10269d){return{'model':db[_0x10269d[_0x4e02('0x21')]],'as':_0x10269d['as'],'attributes':_0x10269d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x234674){logger[_0x4e02('0x16')]('ShowVoiceQueue',_0x2774f3);logger['debug'](_0x4e02('0x23'),_0x2774f3,JSON[_0x4e02('0x13')](_0x234674));_0x14994d(_0x234674);})[_0x4e02('0x17')](function(_0x419c59){logger[_0x4e02('0x14')](_0x4e02('0x23'),_0x419c59[_0x4e02('0x15')],_0x2774f3);_0x52bdaa(_0x2369ac[_0x4e02('0x14')](0x1f4,_0x419c59[_0x4e02('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 0417c20..7af9582 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 _0xec23=['removeListener','register','length','voiceQueue:','emit'];(function(_0x3b1906,_0x76d59a){var _0x598817=function(_0x1147d2){while(--_0x1147d2){_0x3b1906['push'](_0x3b1906['shift']());}};_0x598817(++_0x76d59a);}(_0xec23,0x153));var _0x3ec2=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0xec23[_0x3b2244];return _0x2dcc14;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save','remove','update'];function createListener(_0x5ec1e8,_0x2cbbba){return function(_0xd20ff8){_0x2cbbba[_0x3ec2('0x0')](_0x5ec1e8,_0xd20ff8);};}function removeListener(_0x5b1396,_0xa3fe9){return function(){VoiceQueueEvents[_0x3ec2('0x1')](_0x5b1396,_0xa3fe9);};}exports[_0x3ec2('0x2')]=function(_0x294458){for(var _0x1aa8ba=0x0,_0x570074=events[_0x3ec2('0x3')];_0x1aa8ba<_0x570074;_0x1aa8ba++){var _0x103173=events[_0x1aa8ba];var _0x24881b=createListener(_0x3ec2('0x4')+_0x103173,_0x294458);VoiceQueueEvents['on'](_0x103173,_0x24881b);}}; \ No newline at end of file +var _0x0beb=['update','emit','removeListener','length','./voiceQueue.events','save','remove'];(function(_0x38c459,_0x1207cf){var _0x3508de=function(_0x54a775){while(--_0x54a775){_0x38c459['push'](_0x38c459['shift']());}};_0x3508de(++_0x1207cf);}(_0x0beb,0xb3));var _0xb0be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0beb[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueEvents=require(_0xb0be('0x0'));var events=[_0xb0be('0x1'),_0xb0be('0x2'),_0xb0be('0x3')];function createListener(_0x3c44a8,_0x142c72){return function(_0x5214f0){_0x142c72[_0xb0be('0x4')](_0x3c44a8,_0x5214f0);};}function removeListener(_0x386dc0,_0x4aac24){return function(){VoiceQueueEvents[_0xb0be('0x5')](_0x386dc0,_0x4aac24);};}exports['register']=function(_0x5c14fe){for(var _0x38b421=0x0,_0xc96cd9=events[_0xb0be('0x6')];_0x38b421<_0xc96cd9;_0x38b421++){var _0x18ce71=events[_0x38b421];var _0x40c599=createListener('voiceQueue:'+_0x18ce71,_0x5c14fe);VoiceQueueEvents['on'](_0x18ce71,_0x40c599);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index fa84eb7..0d412df 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 _0xa6f0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/index','getVoiceQueuesReport','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4e65f5,_0xb0ef91){var _0x1f12c9=function(_0x415780){while(--_0x415780){_0x4e65f5['push'](_0x4e65f5['shift']());}};_0x1f12c9(++_0xb0ef91);}(_0xa6f0,0x77));var _0x0a6f=function(_0x5b02c0,_0x1c10c0){_0x5b02c0=_0x5b02c0-0x0;var _0x51dc76=_0xa6f0[_0x5b02c0];return _0x51dc76;};'use strict';var multer=require(_0x0a6f('0x0'));var util=require(_0x0a6f('0x1'));var path=require(_0x0a6f('0x2'));var timeout=require(_0x0a6f('0x3'));var express=require(_0x0a6f('0x4'));var router=express[_0x0a6f('0x5')]();var fs_extra=require(_0x0a6f('0x6'));var auth=require(_0x0a6f('0x7'));var interaction=require(_0x0a6f('0x8'));var config=require(_0x0a6f('0x9'));var controller=require(_0x0a6f('0xa'));router[_0x0a6f('0xb')]('/',auth[_0x0a6f('0xc')](),controller['index']);router[_0x0a6f('0xb')]('/describe',auth[_0x0a6f('0xc')](),controller['describe']);router[_0x0a6f('0xb')](_0x0a6f('0xd'),auth[_0x0a6f('0xc')](),controller[_0x0a6f('0xe')]);router[_0x0a6f('0xb')](_0x0a6f('0xf'),auth[_0x0a6f('0xc')](),controller[_0x0a6f('0x10')]);router[_0x0a6f('0x11')]('/',auth[_0x0a6f('0xc')](),controller['create']);router['put'](_0x0a6f('0xf'),auth[_0x0a6f('0xc')](),controller['update']);router[_0x0a6f('0x12')]('/:id',auth[_0x0a6f('0xc')](),controller[_0x0a6f('0x13')]);module[_0x0a6f('0x14')]=router; \ No newline at end of file +var _0xa07d=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','/:id','create','update','delete'];(function(_0x3394d3,_0x528214){var _0x15d9c3=function(_0x14ae08){while(--_0x14ae08){_0x3394d3['push'](_0x3394d3['shift']());}};_0x15d9c3(++_0x528214);}(_0xa07d,0x1d0));var _0xda07=function(_0x916ccc,_0x19734f){_0x916ccc=_0x916ccc-0x0;var _0xfd449b=_0xa07d[_0x916ccc];return _0xfd449b;};'use strict';var multer=require(_0xda07('0x0'));var util=require('util');var path=require(_0xda07('0x1'));var timeout=require(_0xda07('0x2'));var express=require('express');var router=express[_0xda07('0x3')]();var fs_extra=require(_0xda07('0x4'));var auth=require(_0xda07('0x5'));var interaction=require(_0xda07('0x6'));var config=require(_0xda07('0x7'));var controller=require(_0xda07('0x8'));router[_0xda07('0x9')]('/',auth[_0xda07('0xa')](),controller[_0xda07('0xb')]);router[_0xda07('0x9')](_0xda07('0xc'),auth[_0xda07('0xa')](),controller[_0xda07('0xd')]);router[_0xda07('0x9')](_0xda07('0xe'),auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0xda07('0x9')](_0xda07('0xf'),auth[_0xda07('0xa')](),controller['show']);router['post']('/',auth[_0xda07('0xa')](),controller[_0xda07('0x10')]);router['put']('/:id',auth[_0xda07('0xa')](),controller[_0xda07('0x11')]);router[_0xda07('0x12')](_0xda07('0xf'),auth[_0xda07('0xa')](),controller[_0xda07('0x13')]);module[_0xda07('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 111599c..7ab8fbd 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 _0xacca=['format','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xacca,0x15e));var _0xaacc=function(_0x204ecb,_0x484d14){_0x204ecb=_0x204ecb-0x0;var _0x18dd2b=_0xacca[_0x204ecb];return _0x18dd2b;};'use strict';var Sequelize=require(_0xaacc('0x0'));var moment=require(_0xaacc('0x1'));module[_0xaacc('0x2')]={'type':{'type':Sequelize[_0xaacc('0x3')]},'uniqueid':{'type':Sequelize[_0xaacc('0x3')]},'calleridnum':{'type':Sequelize[_0xaacc('0x3')]},'calleridname':{'type':Sequelize[_0xaacc('0x3')]},'queue':{'type':Sequelize[_0xaacc('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xaacc('0x4')],'set':function(_0xf1fb9){var _0x1a6f12=moment(_0xf1fb9);var _0x427dad=moment(this[_0xaacc('0x5')](_0xaacc('0x6')))[_0xaacc('0x7')]('YYYY-MM-DD\x20HH:mm:ss');var _0x37c9d2=_0x1a6f12[_0xaacc('0x8')](_0x427dad,_0xaacc('0x9'));this[_0xaacc('0xa')](_0xaacc('0xb'),_0xf1fb9);this['setDataValue'](_0xaacc('0xc'),_0x37c9d2||null);}},'position':{'type':Sequelize[_0xaacc('0xd')]},'count':{'type':Sequelize[_0xaacc('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xaacc('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xaacc('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xaacc('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xaacc('0x4')]},'queuecallerexit':{'type':Sequelize[_0xaacc('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xaacc('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xaacc('0x3')],'comment':_0xaacc('0xf')},'originalposition':{'type':Sequelize[_0xaacc('0xd')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xaacc('0x3')]},'connectedlinename':{'type':Sequelize[_0xaacc('0x3')]},'accountcode':{'type':Sequelize[_0xaacc('0x3')]},'context':{'type':Sequelize[_0xaacc('0x3')]},'exten':{'type':Sequelize[_0xaacc('0x3')]},'priority':{'type':Sequelize[_0xaacc('0x3')]},'holdtime':{'type':Sequelize[_0xaacc('0xd')]},'mohtime':{'type':Sequelize[_0xaacc('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xaacc('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xaacc('0x3')]},'transfer':{'type':Sequelize[_0xaacc('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xaacc('0x10')},'transferexten':{'type':Sequelize[_0xaacc('0x3')]},'transferuniqueid':{'type':Sequelize[_0xaacc('0x3')]},'disposition':{'type':Sequelize[_0xaacc('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xaacc('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7726=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','diff','queuecallerleaveAt','setDataValue','holdtime'];(function(_0x5707d7,_0x2fb3aa){var _0x23dcc4=function(_0x11e4a6){while(--_0x11e4a6){_0x5707d7['push'](_0x5707d7['shift']());}};_0x23dcc4(++_0x2fb3aa);}(_0x7726,0x17c));var _0x6772=function(_0x1cc51a,_0x11952b){_0x1cc51a=_0x1cc51a-0x0;var _0x4903f0=_0x7726[_0x1cc51a];return _0x4903f0;};'use strict';var Sequelize=require(_0x6772('0x0'));var moment=require(_0x6772('0x1'));module['exports']={'type':{'type':Sequelize[_0x6772('0x2')]},'uniqueid':{'type':Sequelize[_0x6772('0x2')]},'calleridnum':{'type':Sequelize[_0x6772('0x2')]},'calleridname':{'type':Sequelize[_0x6772('0x2')]},'queue':{'type':Sequelize[_0x6772('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x6772('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0xe81e08){var _0x2e033c=moment(_0xe81e08);var _0x42a482=moment(this['getDataValue']('queuecallerjoinAt'))[_0x6772('0x4')](_0x6772('0x5'));var _0x12b1c5=_0x2e033c[_0x6772('0x6')](_0x42a482,'seconds');this['setDataValue'](_0x6772('0x7'),_0xe81e08);this[_0x6772('0x8')](_0x6772('0x9'),_0x12b1c5||null);}},'position':{'type':Sequelize[_0x6772('0xa')]},'count':{'type':Sequelize[_0x6772('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x6772('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x6772('0x3')]},'queuecallerexit':{'type':Sequelize[_0x6772('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x6772('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x6772('0xa')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x6772('0x2')]},'connectedlinename':{'type':Sequelize[_0x6772('0x2')]},'accountcode':{'type':Sequelize[_0x6772('0x2')]},'context':{'type':Sequelize[_0x6772('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x6772('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6772('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x6772('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6772('0x2')],'comment':_0x6772('0xc')},'transferexten':{'type':Sequelize[_0x6772('0x2')]},'transferuniqueid':{'type':Sequelize[_0x6772('0x2')]},'disposition':{'type':Sequelize[_0x6772('0x2')]},'secondDisposition':{'type':Sequelize[_0x6772('0x2')]},'thirdDisposition':{'type':Sequelize[_0x6772('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x6772('0xa')],'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 f2ea410..4378d7e 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 _0x4e55=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','json','offset','undefined','limit','count','apply','reject','update','destroy','then','end','sendStatus','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','create','body','params','find','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4e55,0xf4));var _0x54e5=function(_0x20c74c,_0x3c6a24){_0x20c74c=_0x20c74c-0x0;var _0x161309=_0x4e55[_0x20c74c];return _0x161309;};'use strict';var emlformat=require(_0x54e5('0x0'));var rimraf=require(_0x54e5('0x1'));var zipdir=require(_0x54e5('0x2'));var jsonpatch=require(_0x54e5('0x3'));var rp=require(_0x54e5('0x4'));var moment=require('moment');var BPromise=require(_0x54e5('0x5'));var Mustache=require(_0x54e5('0x6'));var util=require(_0x54e5('0x7'));var path=require(_0x54e5('0x8'));var sox=require(_0x54e5('0x9'));var csv=require(_0x54e5('0xa'));var ejs=require(_0x54e5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54e5('0xc'));var squel=require(_0x54e5('0xd'));var crypto=require(_0x54e5('0xe'));var jsforce=require(_0x54e5('0xf'));var deskjs=require(_0x54e5('0x10'));var toCsv=require(_0x54e5('0xa'));var querystring=require(_0x54e5('0x11'));var Papa=require('papaparse');var Redis=require(_0x54e5('0x12'));var authService=require(_0x54e5('0x13'));var qs=require(_0x54e5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54e5('0x15'));var logger=require(_0x54e5('0x16'))(_0x54e5('0x17'));var utils=require(_0x54e5('0x18'));var config=require(_0x54e5('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x54e5('0x1a'))['db'];config[_0x54e5('0x1b')]=_[_0x54e5('0x1c')](config[_0x54e5('0x1b')],{'host':_0x54e5('0x1d'),'port':0x18eb});var socket=require(_0x54e5('0x1e'))(new Redis(config[_0x54e5('0x1b')]));require(_0x54e5('0x1f'))[_0x54e5('0x20')](socket);function respondWithStatusCode(_0x5ddf3e,_0x5d3491){_0x5d3491=_0x5d3491||0xcc;return function(_0x1fceb3){if(_0x1fceb3){return _0x5ddf3e['sendStatus'](_0x5d3491);}return _0x5ddf3e[_0x54e5('0x21')](_0x5d3491)['end']();};}function respondWithResult(_0xbe8cb2,_0xe52644){_0xe52644=_0xe52644||0xc8;return function(_0x2590e2){if(_0x2590e2){return _0xbe8cb2['status'](_0xe52644)[_0x54e5('0x22')](_0x2590e2);}};}function respondWithFilteredResult(_0x2e510c,_0x4cdbee){return function(_0x3e7fe1){if(_0x3e7fe1){var _0x420cea=typeof _0x4cdbee[_0x54e5('0x23')]===_0x54e5('0x24')&&typeof _0x4cdbee[_0x54e5('0x25')]==='undefined';var _0x492963=_0x3e7fe1[_0x54e5('0x26')];var _0x53ba91=_0x420cea?0x0:_0x4cdbee[_0x54e5('0x23')];var _0x38dac5=_0x420cea?_0x3e7fe1[_0x54e5('0x26')]:_0x4cdbee[_0x54e5('0x23')]+_0x4cdbee['limit'];var _0x325831;if(_0x38dac5>=_0x492963){_0x38dac5=_0x492963;_0x325831=0xc8;}else{_0x325831=0xce;}_0x2e510c[_0x54e5('0x21')](_0x325831);return _0x2e510c['set']('Content-Range',_0x53ba91+'-'+_0x38dac5+'/'+_0x492963)[_0x54e5('0x22')](_0x3e7fe1);}return null;};}function patchUpdates(_0x283fc7){return function(_0x1dcc83){try{jsonpatch[_0x54e5('0x27')](_0x1dcc83,_0x283fc7,!![]);}catch(_0x5bbe7b){return BPromise[_0x54e5('0x28')](_0x5bbe7b);}return _0x1dcc83['save']();};}function saveUpdates(_0x7daefc,_0x52485e){return function(_0x1e070d){if(_0x1e070d){return _0x1e070d[_0x54e5('0x29')](_0x7daefc)['then'](function(_0x5e0eb4){return _0x5e0eb4;});}return null;};}function removeEntity(_0xc19ef5,_0x5e43d9){return function(_0xbe7289){if(_0xbe7289){return _0xbe7289[_0x54e5('0x2a')]()[_0x54e5('0x2b')](function(){_0xc19ef5[_0x54e5('0x21')](0xcc)[_0x54e5('0x2c')]();});}};}function handleEntityNotFound(_0x405983,_0x83e7e1){return function(_0x2f0dc4){if(!_0x2f0dc4){_0x405983[_0x54e5('0x2d')](0x194);}return _0x2f0dc4;};}function handleError(_0x914811,_0x1f43f9){_0x1f43f9=_0x1f43f9||0x1f4;return function(_0x3253d6){logger['error'](_0x3253d6[_0x54e5('0x2e')]);if(_0x3253d6[_0x54e5('0x2f')]){delete _0x3253d6[_0x54e5('0x2f')];}_0x914811[_0x54e5('0x21')](_0x1f43f9)['send'](_0x3253d6);};}exports[_0x54e5('0x30')]=function(_0x4e9f1a,_0x1608e8){var _0x8bdbb0={},_0x26209d={},_0x229ea0={'count':0x0,'rows':[]};var _0x5c52dc=_['map'](db['VoiceQueueReport'][_0x54e5('0x31')],function(_0x3fc946){return{'name':_0x3fc946[_0x54e5('0x32')],'type':_0x3fc946[_0x54e5('0x33')][_0x54e5('0x34')]};});_0x26209d[_0x54e5('0x35')]=_[_0x54e5('0x36')](_0x5c52dc,_0x54e5('0x2f'));_0x26209d[_0x54e5('0x37')]=_[_0x54e5('0x38')](_0x4e9f1a[_0x54e5('0x37')]);_0x26209d[_0x54e5('0x39')]=_[_0x54e5('0x3a')](_0x26209d[_0x54e5('0x35')],_0x26209d['query']);_0x8bdbb0['attributes']=_[_0x54e5('0x3a')](_0x26209d['model'],qs[_0x54e5('0x3b')](_0x4e9f1a[_0x54e5('0x37')][_0x54e5('0x3b')]));_0x8bdbb0[_0x54e5('0x3c')]=_0x8bdbb0[_0x54e5('0x3c')][_0x54e5('0x3d')]?_0x8bdbb0[_0x54e5('0x3c')]:_0x26209d[_0x54e5('0x35')];if(!_0x4e9f1a[_0x54e5('0x37')][_0x54e5('0x3e')](_0x54e5('0x3f'))){_0x8bdbb0[_0x54e5('0x25')]=qs[_0x54e5('0x25')](_0x4e9f1a[_0x54e5('0x37')][_0x54e5('0x25')]);_0x8bdbb0[_0x54e5('0x23')]=qs[_0x54e5('0x23')](_0x4e9f1a[_0x54e5('0x37')][_0x54e5('0x23')]);}_0x8bdbb0[_0x54e5('0x40')]=qs[_0x54e5('0x41')](_0x4e9f1a[_0x54e5('0x37')]['sort']);_0x8bdbb0['where']=qs[_0x54e5('0x39')](_[_0x54e5('0x42')](_0x4e9f1a[_0x54e5('0x37')],_0x26209d[_0x54e5('0x39')]),_0x5c52dc);if(_0x4e9f1a[_0x54e5('0x37')][_0x54e5('0x43')]){_0x8bdbb0[_0x54e5('0x44')]=_['merge'](_0x8bdbb0[_0x54e5('0x44')],{'$or':_[_0x54e5('0x36')](_0x5c52dc,function(_0x1828f2){if(_0x1828f2[_0x54e5('0x33')]!==_0x54e5('0x45')){var _0x18d0cb={};_0x18d0cb[_0x1828f2[_0x54e5('0x2f')]]={'$like':'%'+_0x4e9f1a[_0x54e5('0x37')][_0x54e5('0x43')]+'%'};return _0x18d0cb;}})});}_0x8bdbb0=_[_0x54e5('0x46')]({},_0x8bdbb0,_0x4e9f1a[_0x54e5('0x47')]);var _0x47dbbe={'where':_0x8bdbb0[_0x54e5('0x44')]};return db[_0x54e5('0x48')][_0x54e5('0x26')](_0x47dbbe)[_0x54e5('0x2b')](function(_0x493bd9){_0x229ea0[_0x54e5('0x26')]=_0x493bd9;if(_0x4e9f1a[_0x54e5('0x37')][_0x54e5('0x49')]){_0x8bdbb0[_0x54e5('0x4a')]=[{'all':!![]}];}return db[_0x54e5('0x48')][_0x54e5('0x4b')](_0x8bdbb0);})['then'](function(_0x489947){_0x229ea0[_0x54e5('0x4c')]=_0x489947;return _0x229ea0;})['then'](respondWithFilteredResult(_0x1608e8,_0x8bdbb0))[_0x54e5('0x4d')](handleError(_0x1608e8,null));};exports[_0x54e5('0x4e')]=function(_0x3915e0,_0x599037){var _0x2f21d7={'raw':![],'where':{'id':_0x3915e0['params']['id']}},_0x153dae={};_0x153dae[_0x54e5('0x35')]=_['keys'](db[_0x54e5('0x48')][_0x54e5('0x31')]);_0x153dae[_0x54e5('0x37')]=_[_0x54e5('0x38')](_0x3915e0[_0x54e5('0x37')]);_0x153dae['filters']=_[_0x54e5('0x3a')](_0x153dae[_0x54e5('0x35')],_0x153dae['query']);_0x2f21d7['attributes']=_['intersection'](_0x153dae[_0x54e5('0x35')],qs['fields'](_0x3915e0[_0x54e5('0x37')][_0x54e5('0x3b')]));_0x2f21d7[_0x54e5('0x3c')]=_0x2f21d7[_0x54e5('0x3c')][_0x54e5('0x3d')]?_0x2f21d7['attributes']:_0x153dae[_0x54e5('0x35')];if(_0x3915e0['query'][_0x54e5('0x49')]){_0x2f21d7[_0x54e5('0x4a')]=[{'all':!![]}];}_0x2f21d7=_[_0x54e5('0x46')]({},_0x2f21d7,_0x3915e0['options']);return db[_0x54e5('0x48')]['find'](_0x2f21d7)[_0x54e5('0x2b')](handleEntityNotFound(_0x599037,null))['then'](respondWithResult(_0x599037,null))[_0x54e5('0x4d')](handleError(_0x599037,null));};exports[_0x54e5('0x4f')]=function(_0x4b5006,_0x449b5c){return db[_0x54e5('0x48')]['create'](_0x4b5006['body'],{})[_0x54e5('0x2b')](respondWithResult(_0x449b5c,0xc9))['catch'](handleError(_0x449b5c,null));};exports['update']=function(_0x1282b3,_0x38d170){if(_0x1282b3[_0x54e5('0x50')]['id']){delete _0x1282b3[_0x54e5('0x50')]['id'];}return db[_0x54e5('0x48')]['find']({'where':{'id':_0x1282b3[_0x54e5('0x51')]['id']}})[_0x54e5('0x2b')](handleEntityNotFound(_0x38d170,null))['then'](saveUpdates(_0x1282b3['body'],null))[_0x54e5('0x2b')](respondWithResult(_0x38d170,null))['catch'](handleError(_0x38d170,null));};exports[_0x54e5('0x2a')]=function(_0x32769b,_0xcdae2f){return db[_0x54e5('0x48')][_0x54e5('0x52')]({'where':{'id':_0x32769b[_0x54e5('0x51')]['id']}})[_0x54e5('0x2b')](handleEntityNotFound(_0xcdae2f,null))[_0x54e5('0x2b')](removeEntity(_0xcdae2f,null))[_0x54e5('0x4d')](handleError(_0xcdae2f,null));};exports[_0x54e5('0x53')]=function(_0x28f343,_0x4ce1b6){return db[_0x54e5('0x48')][_0x54e5('0x53')]()[_0x54e5('0x2b')](respondWithResult(_0x4ce1b6,null))[_0x54e5('0x4d')](handleError(_0x4ce1b6,null));};exports[_0x54e5('0x54')]=function(_0x3f9d69,_0x5ec94c){var _0x1c3356={},_0x27298b={},_0x6ecc7e={'count':0x0,'rows':[]};_0x27298b[_0x54e5('0x35')]=_[_0x54e5('0x38')](db[_0x54e5('0x48')][_0x54e5('0x31')]);_0x27298b[_0x54e5('0x37')]=_[_0x54e5('0x38')](_0x3f9d69['query']);_0x27298b[_0x54e5('0x39')]=_[_0x54e5('0x3a')](_0x27298b[_0x54e5('0x35')],_0x27298b[_0x54e5('0x37')]);_0x1c3356[_0x54e5('0x3c')]=_['intersection'](_0x27298b[_0x54e5('0x35')],qs[_0x54e5('0x3b')](_0x3f9d69[_0x54e5('0x37')][_0x54e5('0x3b')]));_0x1c3356[_0x54e5('0x3c')]=_0x1c3356[_0x54e5('0x3c')]['length']?_0x1c3356[_0x54e5('0x3c')]:_0x27298b['model'];if(!_0x3f9d69[_0x54e5('0x37')]['hasOwnProperty'](_0x54e5('0x3f'))){_0x1c3356[_0x54e5('0x25')]=qs[_0x54e5('0x25')](_0x3f9d69[_0x54e5('0x37')][_0x54e5('0x25')]);_0x1c3356['offset']=qs[_0x54e5('0x23')](_0x3f9d69[_0x54e5('0x37')][_0x54e5('0x23')]);}_0x1c3356[_0x54e5('0x40')]=qs[_0x54e5('0x41')](_0x3f9d69['query'][_0x54e5('0x41')]);_0x1c3356['where']=qs[_0x54e5('0x39')](_['pick'](_0x3f9d69['query'],_0x27298b[_0x54e5('0x39')]));if(_0x3f9d69[_0x54e5('0x37')][_0x54e5('0x43')]){_0x1c3356[_0x54e5('0x44')]=_[_0x54e5('0x46')](_0x1c3356[_0x54e5('0x44')],{'$or':_[_0x54e5('0x36')](_0x1c3356[_0x54e5('0x3c')],function(_0x51a782){var _0x2a347a={};_0x2a347a[_0x51a782]={'$like':'%'+_0x3f9d69[_0x54e5('0x37')][_0x54e5('0x43')]+'%'};return _0x2a347a;})});}_0x1c3356=_['merge']({},_0x1c3356,_0x3f9d69[_0x54e5('0x47')]);var _0x202acf={'where':_0x1c3356[_0x54e5('0x44')]};return db['VoiceQueueReport'][_0x54e5('0x26')](_0x202acf)['then'](function(_0x1a056f){_0x6ecc7e[_0x54e5('0x26')]=_0x1a056f;if(_0x3f9d69[_0x54e5('0x37')][_0x54e5('0x49')]){_0x1c3356['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x54e5('0x4b')](_0x1c3356);})[_0x54e5('0x2b')](function(_0x1fecc5){_0x6ecc7e['rows']=_0x1fecc5;return _0x6ecc7e;})['then'](respondWithFilteredResult(_0x5ec94c,_0x1c3356,_0x54e5('0x54')))[_0x54e5('0x4d')](handleError(_0x5ec94c,null,_0x54e5('0x54')));}; \ No newline at end of file +var _0xa822=['end','json','offset','limit','count','status','apply','reject','save','update','then','destroy','error','name','index','map','VoiceQueueReport','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getVoiceQueuesReport','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus'];(function(_0x544adb,_0x54d8f6){var _0xa304e5=function(_0x2ab152){while(--_0x2ab152){_0x544adb['push'](_0x544adb['shift']());}};_0xa304e5(++_0x54d8f6);}(_0xa822,0x80));var _0x2a82=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0xa822[_0x1d1d09];return _0x8827e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2a82('0x0'));var rp=require(_0x2a82('0x1'));var moment=require(_0x2a82('0x2'));var BPromise=require(_0x2a82('0x3'));var Mustache=require(_0x2a82('0x4'));var util=require(_0x2a82('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2a82('0x6'));var fs=require('fs');var fs_extra=require(_0x2a82('0x7'));var _=require(_0x2a82('0x8'));var squel=require(_0x2a82('0x9'));var crypto=require(_0x2a82('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2a82('0xb'));var toCsv=require(_0x2a82('0xc'));var querystring=require(_0x2a82('0xd'));var Papa=require('papaparse');var Redis=require(_0x2a82('0xe'));var authService=require(_0x2a82('0xf'));var qs=require(_0x2a82('0x10'));var as=require(_0x2a82('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a82('0x12'))(_0x2a82('0x13'));var utils=require(_0x2a82('0x14'));var config=require(_0x2a82('0x15'));var licenseUtil=require(_0x2a82('0x16'));var db=require(_0x2a82('0x17'))['db'];config[_0x2a82('0x18')]=_[_0x2a82('0x19')](config['redis'],{'host':_0x2a82('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2a82('0x18')]));require(_0x2a82('0x1b'))[_0x2a82('0x1c')](socket);function respondWithStatusCode(_0x1362e1,_0x409631){_0x409631=_0x409631||0xcc;return function(_0x369c31){if(_0x369c31){return _0x1362e1[_0x2a82('0x1d')](_0x409631);}return _0x1362e1['status'](_0x409631)[_0x2a82('0x1e')]();};}function respondWithResult(_0xb026a4,_0x5bddaa){_0x5bddaa=_0x5bddaa||0xc8;return function(_0xbe97a5){if(_0xbe97a5){return _0xb026a4['status'](_0x5bddaa)[_0x2a82('0x1f')](_0xbe97a5);}};}function respondWithFilteredResult(_0x288471,_0x2c85a3){return function(_0x305667){if(_0x305667){var _0x25cbb5=typeof _0x2c85a3[_0x2a82('0x20')]==='undefined'&&typeof _0x2c85a3[_0x2a82('0x21')]==='undefined';var _0x4fdacf=_0x305667['count'];var _0x4bb1bb=_0x25cbb5?0x0:_0x2c85a3[_0x2a82('0x20')];var _0x4e523d=_0x25cbb5?_0x305667[_0x2a82('0x22')]:_0x2c85a3['offset']+_0x2c85a3[_0x2a82('0x21')];var _0x272aa5;if(_0x4e523d>=_0x4fdacf){_0x4e523d=_0x4fdacf;_0x272aa5=0xc8;}else{_0x272aa5=0xce;}_0x288471[_0x2a82('0x23')](_0x272aa5);return _0x288471['set']('Content-Range',_0x4bb1bb+'-'+_0x4e523d+'/'+_0x4fdacf)['json'](_0x305667);}return null;};}function patchUpdates(_0x265960){return function(_0x580c55){try{jsonpatch[_0x2a82('0x24')](_0x580c55,_0x265960,!![]);}catch(_0x45881f){return BPromise[_0x2a82('0x25')](_0x45881f);}return _0x580c55[_0x2a82('0x26')]();};}function saveUpdates(_0x53b19b,_0x8bedeb){return function(_0x209d41){if(_0x209d41){return _0x209d41[_0x2a82('0x27')](_0x53b19b)[_0x2a82('0x28')](function(_0xe369e2){return _0xe369e2;});}return null;};}function removeEntity(_0x979103,_0x508ea1){return function(_0x2d485c){if(_0x2d485c){return _0x2d485c[_0x2a82('0x29')]()[_0x2a82('0x28')](function(){_0x979103[_0x2a82('0x23')](0xcc)[_0x2a82('0x1e')]();});}};}function handleEntityNotFound(_0x549508,_0x5e6269){return function(_0x47bbac){if(!_0x47bbac){_0x549508[_0x2a82('0x1d')](0x194);}return _0x47bbac;};}function handleError(_0x42d4a3,_0x4f7b06){_0x4f7b06=_0x4f7b06||0x1f4;return function(_0x5f522f){logger[_0x2a82('0x2a')](_0x5f522f['stack']);if(_0x5f522f[_0x2a82('0x2b')]){delete _0x5f522f['name'];}_0x42d4a3[_0x2a82('0x23')](_0x4f7b06)['send'](_0x5f522f);};}exports[_0x2a82('0x2c')]=function(_0x11a686,_0x5ca250){var _0x44d31c={},_0x2f857b={},_0x554af1={'count':0x0,'rows':[]};var _0x553b20=_[_0x2a82('0x2d')](db[_0x2a82('0x2e')]['rawAttributes'],function(_0x40bd33){return{'name':_0x40bd33[_0x2a82('0x2f')],'type':_0x40bd33[_0x2a82('0x30')][_0x2a82('0x31')]};});_0x2f857b[_0x2a82('0x32')]=_[_0x2a82('0x2d')](_0x553b20,_0x2a82('0x2b'));_0x2f857b['query']=_[_0x2a82('0x33')](_0x11a686['query']);_0x2f857b[_0x2a82('0x34')]=_[_0x2a82('0x35')](_0x2f857b['model'],_0x2f857b[_0x2a82('0x36')]);_0x44d31c[_0x2a82('0x37')]=_[_0x2a82('0x35')](_0x2f857b['model'],qs[_0x2a82('0x38')](_0x11a686['query'][_0x2a82('0x38')]));_0x44d31c[_0x2a82('0x37')]=_0x44d31c[_0x2a82('0x37')][_0x2a82('0x39')]?_0x44d31c['attributes']:_0x2f857b[_0x2a82('0x32')];if(!_0x11a686[_0x2a82('0x36')][_0x2a82('0x3a')](_0x2a82('0x3b'))){_0x44d31c[_0x2a82('0x21')]=qs[_0x2a82('0x21')](_0x11a686[_0x2a82('0x36')][_0x2a82('0x21')]);_0x44d31c[_0x2a82('0x20')]=qs['offset'](_0x11a686[_0x2a82('0x36')][_0x2a82('0x20')]);}_0x44d31c[_0x2a82('0x3c')]=qs[_0x2a82('0x3d')](_0x11a686['query'][_0x2a82('0x3d')]);_0x44d31c[_0x2a82('0x3e')]=qs[_0x2a82('0x34')](_[_0x2a82('0x3f')](_0x11a686[_0x2a82('0x36')],_0x2f857b[_0x2a82('0x34')]),_0x553b20);if(_0x11a686[_0x2a82('0x36')][_0x2a82('0x40')]){_0x44d31c[_0x2a82('0x3e')]=_[_0x2a82('0x41')](_0x44d31c[_0x2a82('0x3e')],{'$or':_['map'](_0x553b20,function(_0x4a589e){if(_0x4a589e['type']!==_0x2a82('0x42')){var _0x4969e8={};_0x4969e8[_0x4a589e[_0x2a82('0x2b')]]={'$like':'%'+_0x11a686[_0x2a82('0x36')][_0x2a82('0x40')]+'%'};return _0x4969e8;}})});}_0x44d31c=_[_0x2a82('0x41')]({},_0x44d31c,_0x11a686[_0x2a82('0x43')]);var _0x2f418a={'where':_0x44d31c[_0x2a82('0x3e')]};return db[_0x2a82('0x2e')]['count'](_0x2f418a)[_0x2a82('0x28')](function(_0x3e3ac7){_0x554af1['count']=_0x3e3ac7;if(_0x11a686['query']['includeAll']){_0x44d31c[_0x2a82('0x44')]=[{'all':!![]}];}return db[_0x2a82('0x2e')][_0x2a82('0x45')](_0x44d31c);})[_0x2a82('0x28')](function(_0x207b53){_0x554af1[_0x2a82('0x46')]=_0x207b53;return _0x554af1;})['then'](respondWithFilteredResult(_0x5ca250,_0x44d31c))[_0x2a82('0x47')](handleError(_0x5ca250,null));};exports[_0x2a82('0x48')]=function(_0x31e188,_0x4ae672){var _0x13d36c={'raw':![],'where':{'id':_0x31e188[_0x2a82('0x49')]['id']}},_0x30b230={};_0x30b230[_0x2a82('0x32')]=_['keys'](db[_0x2a82('0x2e')]['rawAttributes']);_0x30b230[_0x2a82('0x36')]=_[_0x2a82('0x33')](_0x31e188[_0x2a82('0x36')]);_0x30b230[_0x2a82('0x34')]=_['intersection'](_0x30b230['model'],_0x30b230[_0x2a82('0x36')]);_0x13d36c[_0x2a82('0x37')]=_[_0x2a82('0x35')](_0x30b230[_0x2a82('0x32')],qs[_0x2a82('0x38')](_0x31e188[_0x2a82('0x36')][_0x2a82('0x38')]));_0x13d36c['attributes']=_0x13d36c['attributes'][_0x2a82('0x39')]?_0x13d36c[_0x2a82('0x37')]:_0x30b230[_0x2a82('0x32')];if(_0x31e188[_0x2a82('0x36')][_0x2a82('0x4a')]){_0x13d36c['include']=[{'all':!![]}];}_0x13d36c=_['merge']({},_0x13d36c,_0x31e188[_0x2a82('0x43')]);return db[_0x2a82('0x2e')][_0x2a82('0x4b')](_0x13d36c)[_0x2a82('0x28')](handleEntityNotFound(_0x4ae672,null))['then'](respondWithResult(_0x4ae672,null))[_0x2a82('0x47')](handleError(_0x4ae672,null));};exports[_0x2a82('0x4c')]=function(_0x5a25e9,_0x36fecc){return db[_0x2a82('0x2e')][_0x2a82('0x4c')](_0x5a25e9[_0x2a82('0x4d')],{})['then'](respondWithResult(_0x36fecc,0xc9))['catch'](handleError(_0x36fecc,null));};exports[_0x2a82('0x27')]=function(_0x7bb5ab,_0x598d4b){if(_0x7bb5ab[_0x2a82('0x4d')]['id']){delete _0x7bb5ab[_0x2a82('0x4d')]['id'];}return db['VoiceQueueReport'][_0x2a82('0x4b')]({'where':{'id':_0x7bb5ab['params']['id']}})[_0x2a82('0x28')](handleEntityNotFound(_0x598d4b,null))[_0x2a82('0x28')](saveUpdates(_0x7bb5ab[_0x2a82('0x4d')],null))[_0x2a82('0x28')](respondWithResult(_0x598d4b,null))['catch'](handleError(_0x598d4b,null));};exports[_0x2a82('0x29')]=function(_0x271239,_0x3bd6c1){return db[_0x2a82('0x2e')][_0x2a82('0x4b')]({'where':{'id':_0x271239[_0x2a82('0x49')]['id']}})['then'](handleEntityNotFound(_0x3bd6c1,null))[_0x2a82('0x28')](removeEntity(_0x3bd6c1,null))[_0x2a82('0x47')](handleError(_0x3bd6c1,null));};exports['describe']=function(_0x44b8d7,_0xf215c0){return db[_0x2a82('0x2e')]['describe']()['then'](respondWithResult(_0xf215c0,null))[_0x2a82('0x47')](handleError(_0xf215c0,null));};exports[_0x2a82('0x4e')]=function(_0x5e2697,_0x471d56){var _0x36e0ba={},_0x376f71={},_0x2d50dc={'count':0x0,'rows':[]};_0x376f71[_0x2a82('0x32')]=_[_0x2a82('0x33')](db[_0x2a82('0x2e')]['rawAttributes']);_0x376f71[_0x2a82('0x36')]=_[_0x2a82('0x33')](_0x5e2697[_0x2a82('0x36')]);_0x376f71[_0x2a82('0x34')]=_[_0x2a82('0x35')](_0x376f71[_0x2a82('0x32')],_0x376f71['query']);_0x36e0ba[_0x2a82('0x37')]=_[_0x2a82('0x35')](_0x376f71[_0x2a82('0x32')],qs[_0x2a82('0x38')](_0x5e2697[_0x2a82('0x36')][_0x2a82('0x38')]));_0x36e0ba[_0x2a82('0x37')]=_0x36e0ba[_0x2a82('0x37')][_0x2a82('0x39')]?_0x36e0ba[_0x2a82('0x37')]:_0x376f71[_0x2a82('0x32')];if(!_0x5e2697[_0x2a82('0x36')][_0x2a82('0x3a')]('nolimit')){_0x36e0ba[_0x2a82('0x21')]=qs['limit'](_0x5e2697[_0x2a82('0x36')][_0x2a82('0x21')]);_0x36e0ba[_0x2a82('0x20')]=qs['offset'](_0x5e2697[_0x2a82('0x36')]['offset']);}_0x36e0ba[_0x2a82('0x3c')]=qs['sort'](_0x5e2697['query'][_0x2a82('0x3d')]);_0x36e0ba[_0x2a82('0x3e')]=qs[_0x2a82('0x34')](_[_0x2a82('0x3f')](_0x5e2697['query'],_0x376f71[_0x2a82('0x34')]));if(_0x5e2697[_0x2a82('0x36')]['filter']){_0x36e0ba[_0x2a82('0x3e')]=_['merge'](_0x36e0ba[_0x2a82('0x3e')],{'$or':_['map'](_0x36e0ba[_0x2a82('0x37')],function(_0x52d4c9){var _0x5aeff1={};_0x5aeff1[_0x52d4c9]={'$like':'%'+_0x5e2697[_0x2a82('0x36')][_0x2a82('0x40')]+'%'};return _0x5aeff1;})});}_0x36e0ba=_[_0x2a82('0x41')]({},_0x36e0ba,_0x5e2697[_0x2a82('0x43')]);var _0x19a373={'where':_0x36e0ba[_0x2a82('0x3e')]};return db[_0x2a82('0x2e')][_0x2a82('0x22')](_0x19a373)['then'](function(_0x17dbb6){_0x2d50dc[_0x2a82('0x22')]=_0x17dbb6;if(_0x5e2697[_0x2a82('0x36')][_0x2a82('0x4a')]){_0x36e0ba['include']=[{'all':!![]}];}return db[_0x2a82('0x2e')]['findAll'](_0x36e0ba);})['then'](function(_0x4ea5cd){_0x2d50dc['rows']=_0x4ea5cd;return _0x2d50dc;})[_0x2a82('0x28')](respondWithFilteredResult(_0x471d56,_0x36e0ba,_0x2a82('0x4e')))[_0x2a82('0x47')](handleError(_0x471d56,null,_0x2a82('0x4e')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 86add62..916e9c3 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 _0x6397=['VoiceQueueReport','setMaxListeners','save','update','remove','emit'];(function(_0x12b0cd,_0x4ec1ab){var _0x51db97=function(_0x13cddb){while(--_0x13cddb){_0x12b0cd['push'](_0x12b0cd['shift']());}};_0x51db97(++_0x4ec1ab);}(_0x6397,0x126));var _0x7639=function(_0x539fef,_0x17f310){_0x539fef=_0x539fef-0x0;var _0x1c9d6f=_0x6397[_0x539fef];return _0x1c9d6f;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0x7639('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x7639('0x1')](0x0);var events={'afterCreate':_0x7639('0x2'),'afterUpdate':_0x7639('0x3'),'afterDestroy':_0x7639('0x4')};function emitEvent(_0x488f5c){return function(_0x3b8711,_0x32fb2d,_0xb94cc8){VoiceQueueReportEvents['emit'](_0x488f5c+':'+_0x3b8711['id'],_0x3b8711);VoiceQueueReportEvents[_0x7639('0x5')](_0x488f5c,_0x3b8711);_0xb94cc8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x1892=['update','remove','emit','hasOwnProperty','events','../../mysqldb','VoiceQueueReport'];(function(_0x56ba92,_0xb3c986){var _0x8fe94d=function(_0x23b21c){while(--_0x23b21c){_0x56ba92['push'](_0x56ba92['shift']());}};_0x8fe94d(++_0xb3c986);}(_0x1892,0x19a));var _0x2189=function(_0x5a67bf,_0x5c3aa7){_0x5a67bf=_0x5a67bf-0x0;var _0x4b23eb=_0x1892[_0x5a67bf];return _0x4b23eb;};'use strict';var EventEmitter=require(_0x2189('0x0'));var VoiceQueueReport=require(_0x2189('0x1'))['db'][_0x2189('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2189('0x3'),'afterDestroy':_0x2189('0x4')};function emitEvent(_0x518a25){return function(_0x3f6f6d,_0x59e841,_0x2a123f){VoiceQueueReportEvents['emit'](_0x518a25+':'+_0x3f6f6d['id'],_0x3f6f6d);VoiceQueueReportEvents[_0x2189('0x5')](_0x518a25,_0x3f6f6d);_0x2a123f(null);};}for(var e in events){if(events[_0x2189('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 52b5892..433014c 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 _0xaf8f=['api','moment','bluebird','request-promise','path','../../config/environment','exports','report_queue','../../config/logger'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xaf8f,0x104));var _0xfaf8=function(_0x27b568,_0x5dee02){_0x27b568=_0x27b568-0x0;var _0x4bbb85=_0xaf8f[_0x27b568];return _0x4bbb85;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfaf8('0x0'))(_0xfaf8('0x1'));var moment=require(_0xfaf8('0x2'));var BPromise=require(_0xfaf8('0x3'));var rp=require(_0xfaf8('0x4'));var fs=require('fs');var path=require(_0xfaf8('0x5'));var rimraf=require('rimraf');var config=require(_0xfaf8('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0xfaf8('0x7')]=function(_0x8afbc6,_0x17e017){return _0x8afbc6['define']('VoiceQueueReport',attributes,{'tableName':_0xfaf8('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x02e5=['util','moment','bluebird','path','rimraf','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02e5,0x1af));var _0x502e=function(_0x924f23,_0x51680c){_0x924f23=_0x924f23-0x0;var _0x3aaf55=_0x02e5[_0x924f23];return _0x3aaf55;};'use strict';var _=require(_0x502e('0x0'));var util=require(_0x502e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x502e('0x2'));var BPromise=require(_0x502e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x502e('0x4'));var rimraf=require(_0x502e('0x5'));var config=require('../../config/environment');var attributes=require(_0x502e('0x6'));module['exports']=function(_0x47cf0b,_0x2c4aba){return _0x47cf0b[_0x502e('0x7')](_0x502e('0x8'),attributes,{'tableName':_0x502e('0x9'),'paranoid':![],'indexes':[{'fields':[_0x502e('0xa')]},{'fields':[_0x502e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 6683c74..45da826 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 _0x4577=['client','http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment'];(function(_0x57bf18,_0x6756a){var _0xdeff2e=function(_0x23e2a6){while(--_0x23e2a6){_0x57bf18['push'](_0x57bf18['shift']());}};_0xdeff2e(++_0x6756a);}(_0x4577,0x17f));var _0x7457=function(_0x7cdaf1,_0x40e620){_0x7cdaf1=_0x7cdaf1-0x0;var _0xf58e9a=_0x4577[_0x7cdaf1];return _0xf58e9a;};'use strict';var _=require(_0x7457('0x0'));var util=require(_0x7457('0x1'));var moment=require('moment');var BPromise=require(_0x7457('0x2'));var rs=require(_0x7457('0x3'));var fs=require('fs');var Redis=require(_0x7457('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7457('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7457('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7457('0x7')][_0x7457('0x8')]({'port':0x232a});config[_0x7457('0x9')]=_[_0x7457('0xa')](config[_0x7457('0x9')],{'host':_0x7457('0xb'),'port':0x18eb});var socket=require(_0x7457('0xc'))(new Redis(config['redis']));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x439837,_0x40b3e4,_0x199511){return new BPromise(function(_0x598634,_0x307d5f){return client['request'](_0x439837,_0x199511)[_0x7457('0xd')](function(_0x482e55){logger[_0x7457('0xe')]('VoiceQueueReport,\x20%s,\x20%s',_0x40b3e4,_0x7457('0xf'));logger[_0x7457('0x10')](_0x7457('0x11'),_0x40b3e4,'request\x20sent',JSON[_0x7457('0x12')](_0x482e55));if(_0x482e55[_0x7457('0x13')]){if(_0x482e55[_0x7457('0x13')][_0x7457('0x14')]===0x1f4){logger[_0x7457('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x40b3e4,_0x482e55[_0x7457('0x13')]['message']);return _0x307d5f(_0x482e55[_0x7457('0x13')][_0x7457('0x15')]);}logger['error'](_0x7457('0x16'),_0x40b3e4,_0x482e55[_0x7457('0x13')][_0x7457('0x15')]);return _0x598634(_0x482e55[_0x7457('0x13')][_0x7457('0x15')]);}else{logger[_0x7457('0xe')](_0x7457('0x16'),_0x40b3e4,_0x7457('0xf'));_0x598634(_0x482e55['result']['message']);}})['catch'](function(_0x3c93bc){logger['error'](_0x7457('0x16'),_0x40b3e4,_0x3c93bc);_0x307d5f(_0x3c93bc);});});}exports[_0x7457('0x17')]=function(_0x2ed170){var _0x24718b=this;return new Promise(function(_0xd975f3,_0x22a40d){return db[_0x7457('0x18')][_0x7457('0x19')]({'raw':_0x2ed170['options']?_0x2ed170[_0x7457('0x1a')][_0x7457('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ed170['options']?_0x2ed170[_0x7457('0x1a')][_0x7457('0x1c')]||null:null,'attributes':_0x2ed170[_0x7457('0x1a')]?_0x2ed170[_0x7457('0x1a')][_0x7457('0x1d')]||null:null,'limit':_0x2ed170[_0x7457('0x1a')]?_0x2ed170[_0x7457('0x1a')][_0x7457('0x1e')]||null:null,'include':_0x2ed170[_0x7457('0x1a')]?_0x2ed170[_0x7457('0x1a')][_0x7457('0x1f')]?_[_0x7457('0x20')](_0x2ed170[_0x7457('0x1a')][_0x7457('0x1f')],function(_0x21ea3d){return{'model':db[_0x21ea3d[_0x7457('0x21')]],'as':_0x21ea3d['as'],'attributes':_0x21ea3d[_0x7457('0x1d')],'include':_0x21ea3d[_0x7457('0x1f')]?_[_0x7457('0x20')](_0x21ea3d[_0x7457('0x1f')],function(_0x23d6b4){return{'model':db[_0x23d6b4[_0x7457('0x21')]],'as':_0x23d6b4['as'],'attributes':_0x23d6b4[_0x7457('0x1d')],'include':_0x23d6b4['include']?_[_0x7457('0x20')](_0x23d6b4['include'],function(_0x551e21){return{'model':db[_0x551e21[_0x7457('0x21')]],'as':_0x551e21['as'],'attributes':_0x551e21[_0x7457('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7457('0xd')](function(_0xf9c66e){logger[_0x7457('0xe')](_0x7457('0x17'),_0x2ed170);logger[_0x7457('0x10')](_0x7457('0x17'),_0x2ed170,JSON[_0x7457('0x12')](_0xf9c66e));_0xd975f3(_0xf9c66e);})['catch'](function(_0x1c7433){logger['error'](_0x7457('0x17'),_0x1c7433[_0x7457('0x15')],_0x2ed170);_0x22a40d(_0x24718b[_0x7457('0x13')](0x1f4,_0x1c7433[_0x7457('0x15')]));});});};exports['CreateVoiceQueueReport']=function(_0x21a4d5){var _0x1c4c0b=this;return new Promise(function(_0x2acdc9,_0x1c7816){return db[_0x7457('0x18')][_0x7457('0x22')](_0x21a4d5[_0x7457('0x23')],{'raw':_0x21a4d5[_0x7457('0x1a')]?_0x21a4d5[_0x7457('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x7457('0xd')](function(_0x3eeca0){logger[_0x7457('0xe')](_0x7457('0x24'),_0x21a4d5);logger[_0x7457('0x10')](_0x7457('0x24'),_0x21a4d5,JSON[_0x7457('0x12')](_0x3eeca0));_0x2acdc9(_0x3eeca0);})['catch'](function(_0x1f7a4a){logger[_0x7457('0x13')](_0x7457('0x24'),_0x1f7a4a['message'],_0x21a4d5);_0x1c7816(_0x1c4c0b[_0x7457('0x13')](0x1f4,_0x1f7a4a[_0x7457('0x15')]));});});};exports['UpdateVoiceQueueReport']=function(_0x4e0119){var _0x192fe4=this;return new Promise(function(_0x1af18a,_0x3a5b38){return db[_0x7457('0x18')]['update'](_0x4e0119[_0x7457('0x23')],{'raw':_0x4e0119['options']?_0x4e0119[_0x7457('0x1a')][_0x7457('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e0119[_0x7457('0x1a')]?_0x4e0119[_0x7457('0x1a')][_0x7457('0x1c')]||null:null,'attributes':_0x4e0119['options']?_0x4e0119['options'][_0x7457('0x1d')]||null:null,'limit':_0x4e0119[_0x7457('0x1a')]?_0x4e0119[_0x7457('0x1a')][_0x7457('0x1e')]||null:null})['then'](function(_0x337e00){logger[_0x7457('0xe')]('UpdateVoiceQueueReport',_0x4e0119);logger[_0x7457('0x10')](_0x7457('0x25'),_0x4e0119,JSON[_0x7457('0x12')](_0x337e00));_0x1af18a(_0x337e00);})[_0x7457('0x26')](function(_0x2698c6){logger['error'](_0x7457('0x25'),_0x2698c6[_0x7457('0x15')],_0x4e0119);_0x3a5b38(_0x192fe4[_0x7457('0x13')](0x1f4,_0x2698c6[_0x7457('0x15')]));});});}; \ No newline at end of file +var _0xf173=['model','debug','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','include','map'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xf173,0x1e0));var _0x3f17=function(_0x180a09,_0x4ecc1e){_0x180a09=_0x180a09-0x0;var _0x1facc4=_0xf173[_0x180a09];return _0x1facc4;};'use strict';var _=require(_0x3f17('0x0'));var util=require(_0x3f17('0x1'));var moment=require('moment');var BPromise=require(_0x3f17('0x2'));var rs=require(_0x3f17('0x3'));var fs=require('fs');var Redis=require(_0x3f17('0x4'));var db=require(_0x3f17('0x5'))['db'];var utils=require(_0x3f17('0x6'));var logger=require(_0x3f17('0x7'))(_0x3f17('0x8'));var config=require(_0x3f17('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3f17('0xa')]['http']({'port':0x232a});config[_0x3f17('0xb')]=_[_0x3f17('0xc')](config[_0x3f17('0xb')],{'host':_0x3f17('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3f17('0xe'))[_0x3f17('0xf')](socket);function respondWithRpcPromise(_0x586904,_0x17abaa,_0x2a8636){return new BPromise(function(_0x3efb50,_0x1f99fc){return client['request'](_0x586904,_0x2a8636)[_0x3f17('0x10')](function(_0x47ed31){logger[_0x3f17('0x11')](_0x3f17('0x12'),_0x17abaa,_0x3f17('0x13'));logger['debug'](_0x3f17('0x14'),_0x17abaa,'request\x20sent',JSON[_0x3f17('0x15')](_0x47ed31));if(_0x47ed31['error']){if(_0x47ed31[_0x3f17('0x16')][_0x3f17('0x17')]===0x1f4){logger[_0x3f17('0x16')](_0x3f17('0x12'),_0x17abaa,_0x47ed31[_0x3f17('0x16')][_0x3f17('0x18')]);return _0x1f99fc(_0x47ed31['error']['message']);}logger[_0x3f17('0x16')](_0x3f17('0x12'),_0x17abaa,_0x47ed31[_0x3f17('0x16')][_0x3f17('0x18')]);return _0x3efb50(_0x47ed31['error'][_0x3f17('0x18')]);}else{logger[_0x3f17('0x11')](_0x3f17('0x12'),_0x17abaa,_0x3f17('0x13'));_0x3efb50(_0x47ed31[_0x3f17('0x19')]['message']);}})[_0x3f17('0x1a')](function(_0x1d0462){logger[_0x3f17('0x16')](_0x3f17('0x12'),_0x17abaa,_0x1d0462);_0x1f99fc(_0x1d0462);});});}exports[_0x3f17('0x1b')]=function(_0x5b7437){var _0x2bfa97=this;return new Promise(function(_0x3546dd,_0x2b632f){return db[_0x3f17('0x1c')]['findAll']({'raw':_0x5b7437[_0x3f17('0x1d')]?_0x5b7437[_0x3f17('0x1d')][_0x3f17('0x1e')]===undefined?!![]:![]:!![],'where':_0x5b7437['options']?_0x5b7437[_0x3f17('0x1d')][_0x3f17('0x1f')]||null:null,'attributes':_0x5b7437[_0x3f17('0x1d')]?_0x5b7437[_0x3f17('0x1d')][_0x3f17('0x20')]||null:null,'limit':_0x5b7437[_0x3f17('0x1d')]?_0x5b7437[_0x3f17('0x1d')][_0x3f17('0x21')]||null:null,'include':_0x5b7437[_0x3f17('0x1d')]?_0x5b7437[_0x3f17('0x1d')][_0x3f17('0x22')]?_[_0x3f17('0x23')](_0x5b7437[_0x3f17('0x1d')][_0x3f17('0x22')],function(_0x23f761){return{'model':db[_0x23f761[_0x3f17('0x24')]],'as':_0x23f761['as'],'attributes':_0x23f761[_0x3f17('0x20')],'include':_0x23f761[_0x3f17('0x22')]?_[_0x3f17('0x23')](_0x23f761['include'],function(_0x56c5db){return{'model':db[_0x56c5db[_0x3f17('0x24')]],'as':_0x56c5db['as'],'attributes':_0x56c5db[_0x3f17('0x20')],'include':_0x56c5db[_0x3f17('0x22')]?_['map'](_0x56c5db[_0x3f17('0x22')],function(_0x457831){return{'model':db[_0x457831[_0x3f17('0x24')]],'as':_0x457831['as'],'attributes':_0x457831['attributes']};}):[]};}):[]};}):[]:[]})[_0x3f17('0x10')](function(_0x3da9b8){logger[_0x3f17('0x11')]('GetVoiceQueueReport',_0x5b7437);logger[_0x3f17('0x25')](_0x3f17('0x1b'),_0x5b7437,JSON[_0x3f17('0x15')](_0x3da9b8));_0x3546dd(_0x3da9b8);})['catch'](function(_0x25276f){logger[_0x3f17('0x16')](_0x3f17('0x1b'),_0x25276f[_0x3f17('0x18')],_0x5b7437);_0x2b632f(_0x2bfa97['error'](0x1f4,_0x25276f['message']));});});};exports[_0x3f17('0x26')]=function(_0x49d877){var _0x3fe4dd=this;return new Promise(function(_0x131246,_0x2dd6f4){return db[_0x3f17('0x1c')][_0x3f17('0x27')](_0x49d877['body'],{'raw':_0x49d877[_0x3f17('0x1d')]?_0x49d877[_0x3f17('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x3f17('0x10')](function(_0x2ff379){logger[_0x3f17('0x11')]('CreateVoiceQueueReport',_0x49d877);logger[_0x3f17('0x25')](_0x3f17('0x26'),_0x49d877,JSON['stringify'](_0x2ff379));_0x131246(_0x2ff379);})[_0x3f17('0x1a')](function(_0x4ec76e){logger['error'](_0x3f17('0x26'),_0x4ec76e[_0x3f17('0x18')],_0x49d877);_0x2dd6f4(_0x3fe4dd['error'](0x1f4,_0x4ec76e['message']));});});};exports[_0x3f17('0x28')]=function(_0x4e52e7){var _0x4f2873=this;return new Promise(function(_0x1262e8,_0x35ac81){return db['VoiceQueueReport'][_0x3f17('0x29')](_0x4e52e7[_0x3f17('0x2a')],{'raw':_0x4e52e7['options']?_0x4e52e7[_0x3f17('0x1d')][_0x3f17('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e52e7[_0x3f17('0x1d')]?_0x4e52e7['options'][_0x3f17('0x1f')]||null:null,'attributes':_0x4e52e7[_0x3f17('0x1d')]?_0x4e52e7[_0x3f17('0x1d')][_0x3f17('0x20')]||null:null,'limit':_0x4e52e7[_0x3f17('0x1d')]?_0x4e52e7[_0x3f17('0x1d')][_0x3f17('0x21')]||null:null})[_0x3f17('0x10')](function(_0x3efa7a){logger[_0x3f17('0x11')](_0x3f17('0x28'),_0x4e52e7);logger[_0x3f17('0x25')]('UpdateVoiceQueueReport',_0x4e52e7,JSON[_0x3f17('0x15')](_0x3efa7a));_0x1262e8(_0x3efa7a);})['catch'](function(_0x23156){logger[_0x3f17('0x16')](_0x3f17('0x28'),_0x23156['message'],_0x4e52e7);_0x35ac81(_0x4f2873[_0x3f17('0x16')](0x1f4,_0x23156[_0x3f17('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 7416da6..ddc8e16 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 _0xa2c8=['save','remove','update','emit','register','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x36ebaa,_0x47870d){var _0x4d98ab=function(_0x1031ca){while(--_0x1031ca){_0x36ebaa['push'](_0x36ebaa['shift']());}};_0x4d98ab(++_0x47870d);}(_0xa2c8,0x99));var _0x8a2c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa2c8[_0x14add3];return _0x4a174f;};'use strict';var VoiceQueueReportEvents=require(_0x8a2c('0x0'));var events=[_0x8a2c('0x1'),_0x8a2c('0x2'),_0x8a2c('0x3')];function createListener(_0x1bdb36,_0x67da9d){return function(_0x48d4f9){_0x67da9d[_0x8a2c('0x4')](_0x1bdb36,_0x48d4f9);};}function removeListener(_0x590508,_0x486724){return function(){VoiceQueueReportEvents['removeListener'](_0x590508,_0x486724);};}exports[_0x8a2c('0x5')]=function(_0x40fb26){for(var _0x3f754a=0x0,_0x1031fb=events['length'];_0x3f754a<_0x1031fb;_0x3f754a++){var _0xe1e335=events[_0x3f754a];var _0x1d2885=createListener(_0x8a2c('0x6')+_0xe1e335,_0x40fb26);VoiceQueueReportEvents['on'](_0xe1e335,_0x1d2885);}}; \ No newline at end of file +var _0xdca7=['removeListener','voiceQueueReport:','./voiceQueueReport.events','remove','update','emit'];(function(_0x5f4c37,_0x46f099){var _0x2f2d4a=function(_0x2d7f79){while(--_0x2d7f79){_0x5f4c37['push'](_0x5f4c37['shift']());}};_0x2f2d4a(++_0x46f099);}(_0xdca7,0xe6));var _0x7dca=function(_0x13c105,_0x3c2764){_0x13c105=_0x13c105-0x0;var _0x6ea94f=_0xdca7[_0x13c105];return _0x6ea94f;};'use strict';var VoiceQueueReportEvents=require(_0x7dca('0x0'));var events=['save',_0x7dca('0x1'),_0x7dca('0x2')];function createListener(_0x189505,_0x5e5ed4){return function(_0x3eca32){_0x5e5ed4[_0x7dca('0x3')](_0x189505,_0x3eca32);};}function removeListener(_0x4adb53,_0x52623e){return function(){VoiceQueueReportEvents[_0x7dca('0x4')](_0x4adb53,_0x52623e);};}exports['register']=function(_0x51d88b){for(var _0x514d8d=0x0,_0xbc4387=events['length'];_0x514d8d<_0xbc4387;_0x514d8d++){var _0x5a27cc=events[_0x514d8d];var _0x38cb81=createListener(_0x7dca('0x5')+_0x5a27cc,_0x51d88b);VoiceQueueReportEvents['on'](_0x5a27cc,_0x38cb81);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index ed65f0a..333c1af 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 _0x0642=['isAuthenticated','index','/:id','post','create','put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x26bcf1,_0xf3fe0c){var _0x38cb47=function(_0x3e69d5){while(--_0x3e69d5){_0x26bcf1['push'](_0x26bcf1['shift']());}};_0x38cb47(++_0xf3fe0c);}(_0x0642,0x1dc));var _0x2064=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x0642[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x2064('0x0'));var util=require('util');var path=require(_0x2064('0x1'));var timeout=require(_0x2064('0x2'));var express=require(_0x2064('0x3'));var router=express[_0x2064('0x4')]();var fs_extra=require(_0x2064('0x5'));var auth=require(_0x2064('0x6'));var interaction=require(_0x2064('0x7'));var config=require(_0x2064('0x8'));var controller=require('./voiceQueuesLog.controller');router[_0x2064('0x9')]('/',auth[_0x2064('0xa')](),controller[_0x2064('0xb')]);router[_0x2064('0x9')](_0x2064('0xc'),auth[_0x2064('0xa')](),controller['show']);router[_0x2064('0xd')]('/',auth[_0x2064('0xa')](),controller[_0x2064('0xe')]);router[_0x2064('0xf')](_0x2064('0xc'),auth[_0x2064('0xa')](),controller['update']);router['delete'](_0x2064('0xc'),auth['isAuthenticated'](),controller[_0x2064('0x10')]);module[_0x2064('0x11')]=router; \ No newline at end of file +var _0xa942=['delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x12a717,_0x401232){var _0x1657bd=function(_0x282a83){while(--_0x282a83){_0x12a717['push'](_0x12a717['shift']());}};_0x1657bd(++_0x401232);}(_0xa942,0xc8));var _0x2a94=function(_0x4712dc,_0x519f68){_0x4712dc=_0x4712dc-0x0;var _0x296481=_0xa942[_0x4712dc];return _0x296481;};'use strict';var multer=require(_0x2a94('0x0'));var util=require(_0x2a94('0x1'));var path=require(_0x2a94('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2a94('0x3')]();var fs_extra=require(_0x2a94('0x4'));var auth=require(_0x2a94('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2a94('0x6'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2a94('0x7')]);router[_0x2a94('0x8')](_0x2a94('0x9'),auth[_0x2a94('0xa')](),controller[_0x2a94('0xb')]);router[_0x2a94('0xc')]('/',auth[_0x2a94('0xa')](),controller[_0x2a94('0xd')]);router[_0x2a94('0xe')](_0x2a94('0x9'),auth[_0x2a94('0xa')](),controller[_0x2a94('0xf')]);router[_0x2a94('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2a94('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 50896a8..2828854 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 _0xaf79=['YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING','DATE'];(function(_0x1074cb,_0x53a10e){var _0x43b10f=function(_0x472d21){while(--_0x472d21){_0x1074cb['push'](_0x1074cb['shift']());}};_0x43b10f(++_0x53a10e);}(_0xaf79,0x1f0));var _0x9af7=function(_0x47708d,_0x4313c8){_0x47708d=_0x47708d-0x0;var _0x5b2c78=_0xaf79[_0x47708d];return _0x5b2c78;};'use strict';var Sequelize=require(_0x9af7('0x0'));var moment=require('moment');module[_0x9af7('0x1')]={'time':{'type':Sequelize[_0x9af7('0x2')]},'callid':{'type':Sequelize[_0x9af7('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x9af7('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x9af7('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x9af7('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x9af7('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x9af7('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x9af7('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x9af7('0x4'))}}; \ No newline at end of file +var _0xe056=['moment','exports','STRING','DATE','format','sequelize'];(function(_0x70a10e,_0x6c742a){var _0x183f5c=function(_0x49f29b){while(--_0x49f29b){_0x70a10e['push'](_0x70a10e['shift']());}};_0x183f5c(++_0x6c742a);}(_0xe056,0xc5));var _0x6e05=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0xe056[_0x43b06b];return _0x2c555b;};'use strict';var Sequelize=require(_0x6e05('0x0'));var moment=require(_0x6e05('0x1'));module[_0x6e05('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x6e05('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x6e05('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x6e05('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x6e05('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x6e05('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x6e05('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x6e05('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x6e05('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x6e05('0x4')],'allowNull':![],'defaultValue':moment()[_0x6e05('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 9bf774e..b623b52 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 _0xd2d8=['../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','VoiceQueuesLog','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','rows','catch','params','intersection','options','create','body','find','eml-format','rimraf','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2d8,0xc9));var _0x8d2d=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0xd2d8[_0xa30766];return _0x24e780;};'use strict';var emlformat=require(_0x8d2d('0x0'));var rimraf=require(_0x8d2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8d2d('0x2'));var BPromise=require(_0x8d2d('0x3'));var Mustache=require('mustache');var util=require(_0x8d2d('0x4'));var path=require(_0x8d2d('0x5'));var sox=require(_0x8d2d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d2d('0x7'));var _=require(_0x8d2d('0x8'));var squel=require(_0x8d2d('0x9'));var crypto=require(_0x8d2d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8d2d('0xb'));var toCsv=require(_0x8d2d('0xc'));var querystring=require(_0x8d2d('0xd'));var Papa=require(_0x8d2d('0xe'));var Redis=require(_0x8d2d('0xf'));var authService=require(_0x8d2d('0x10'));var qs=require(_0x8d2d('0x11'));var as=require(_0x8d2d('0x12'));var hardwareService=require(_0x8d2d('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8d2d('0x14'));var licenseUtil=require(_0x8d2d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa506a5,_0xb1c7f){_0xb1c7f=_0xb1c7f||0xcc;return function(_0x18fcc5){if(_0x18fcc5){return _0xa506a5[_0x8d2d('0x16')](_0xb1c7f);}return _0xa506a5[_0x8d2d('0x17')](_0xb1c7f)[_0x8d2d('0x18')]();};}function respondWithResult(_0x5e290c,_0x2e31c8){_0x2e31c8=_0x2e31c8||0xc8;return function(_0x576287){if(_0x576287){return _0x5e290c[_0x8d2d('0x17')](_0x2e31c8)[_0x8d2d('0x19')](_0x576287);}};}function respondWithFilteredResult(_0x266346,_0x4542e6){return function(_0xe42b42){if(_0xe42b42){var _0x23cf5b=typeof _0x4542e6[_0x8d2d('0x1a')]==='undefined'&&typeof _0x4542e6['limit']===_0x8d2d('0x1b');var _0x34dade=_0xe42b42[_0x8d2d('0x1c')];var _0x3bc14c=_0x23cf5b?0x0:_0x4542e6[_0x8d2d('0x1a')];var _0x1beb12=_0x23cf5b?_0xe42b42[_0x8d2d('0x1c')]:_0x4542e6[_0x8d2d('0x1a')]+_0x4542e6[_0x8d2d('0x1d')];var _0x4ad7ac;if(_0x1beb12>=_0x34dade){_0x1beb12=_0x34dade;_0x4ad7ac=0xc8;}else{_0x4ad7ac=0xce;}_0x266346['status'](_0x4ad7ac);return _0x266346[_0x8d2d('0x1e')](_0x8d2d('0x1f'),_0x3bc14c+'-'+_0x1beb12+'/'+_0x34dade)['json'](_0xe42b42);}return null;};}function patchUpdates(_0x35dbaa){return function(_0x47db24){try{jsonpatch[_0x8d2d('0x20')](_0x47db24,_0x35dbaa,!![]);}catch(_0x51a2d8){return BPromise[_0x8d2d('0x21')](_0x51a2d8);}return _0x47db24[_0x8d2d('0x22')]();};}function saveUpdates(_0x51af24,_0x42ae40){return function(_0x49e6ad){if(_0x49e6ad){return _0x49e6ad[_0x8d2d('0x23')](_0x51af24)[_0x8d2d('0x24')](function(_0x85d087){return _0x85d087;});}return null;};}function removeEntity(_0x21f8ec,_0xf0c3e6){return function(_0x479f34){if(_0x479f34){return _0x479f34[_0x8d2d('0x25')]()[_0x8d2d('0x24')](function(){_0x21f8ec[_0x8d2d('0x17')](0xcc)[_0x8d2d('0x18')]();});}};}function handleEntityNotFound(_0x281c57,_0x452a03){return function(_0x5edd5f){if(!_0x5edd5f){_0x281c57[_0x8d2d('0x16')](0x194);}return _0x5edd5f;};}function handleError(_0x37d394,_0x11d618){_0x11d618=_0x11d618||0x1f4;return function(_0x27a254){logger[_0x8d2d('0x26')](_0x27a254[_0x8d2d('0x27')]);if(_0x27a254[_0x8d2d('0x28')]){delete _0x27a254['name'];}_0x37d394[_0x8d2d('0x17')](_0x11d618)[_0x8d2d('0x29')](_0x27a254);};}exports['index']=function(_0x55c02c,_0x2bf840){var _0x4b77d0={},_0x24127c={},_0x31a95b={'count':0x0,'rows':[]};var _0x33e41c=_['map'](db[_0x8d2d('0x2a')][_0x8d2d('0x2b')],function(_0x4c7e62){return{'name':_0x4c7e62[_0x8d2d('0x2c')],'type':_0x4c7e62['type'][_0x8d2d('0x2d')]};});_0x24127c[_0x8d2d('0x2e')]=_[_0x8d2d('0x2f')](_0x33e41c,_0x8d2d('0x28'));_0x24127c[_0x8d2d('0x30')]=_[_0x8d2d('0x31')](_0x55c02c['query']);_0x24127c[_0x8d2d('0x32')]=_['intersection'](_0x24127c[_0x8d2d('0x2e')],_0x24127c[_0x8d2d('0x30')]);_0x4b77d0[_0x8d2d('0x33')]=_['intersection'](_0x24127c[_0x8d2d('0x2e')],qs[_0x8d2d('0x34')](_0x55c02c[_0x8d2d('0x30')]['fields']));_0x4b77d0[_0x8d2d('0x33')]=_0x4b77d0['attributes'][_0x8d2d('0x35')]?_0x4b77d0['attributes']:_0x24127c[_0x8d2d('0x2e')];if(!_0x55c02c['query'][_0x8d2d('0x36')](_0x8d2d('0x37'))){_0x4b77d0['limit']=qs[_0x8d2d('0x1d')](_0x55c02c['query'][_0x8d2d('0x1d')]);_0x4b77d0['offset']=qs[_0x8d2d('0x1a')](_0x55c02c[_0x8d2d('0x30')][_0x8d2d('0x1a')]);}_0x4b77d0[_0x8d2d('0x38')]=qs[_0x8d2d('0x39')](_0x55c02c[_0x8d2d('0x30')][_0x8d2d('0x39')]);_0x4b77d0[_0x8d2d('0x3a')]=qs[_0x8d2d('0x32')](_[_0x8d2d('0x3b')](_0x55c02c[_0x8d2d('0x30')],_0x24127c['filters']),_0x33e41c);if(_0x55c02c[_0x8d2d('0x30')][_0x8d2d('0x3c')]){_0x4b77d0[_0x8d2d('0x3a')]=_['merge'](_0x4b77d0[_0x8d2d('0x3a')],{'$or':_[_0x8d2d('0x2f')](_0x33e41c,function(_0x46fc8e){if(_0x46fc8e[_0x8d2d('0x3d')]!==_0x8d2d('0x3e')){var _0x4c34b7={};_0x4c34b7[_0x46fc8e[_0x8d2d('0x28')]]={'$like':'%'+_0x55c02c['query']['filter']+'%'};return _0x4c34b7;}})});}_0x4b77d0=_[_0x8d2d('0x3f')]({},_0x4b77d0,_0x55c02c['options']);var _0x5317ec={'where':_0x4b77d0['where']};return db[_0x8d2d('0x2a')][_0x8d2d('0x1c')](_0x5317ec)[_0x8d2d('0x24')](function(_0x3dc7c0){_0x31a95b['count']=_0x3dc7c0;if(_0x55c02c[_0x8d2d('0x30')][_0x8d2d('0x40')]){_0x4b77d0[_0x8d2d('0x41')]=[{'all':!![]}];}return db[_0x8d2d('0x2a')]['findAll'](_0x4b77d0);})[_0x8d2d('0x24')](function(_0x4cd65d){_0x31a95b[_0x8d2d('0x42')]=_0x4cd65d;return _0x31a95b;})[_0x8d2d('0x24')](respondWithFilteredResult(_0x2bf840,_0x4b77d0))[_0x8d2d('0x43')](handleError(_0x2bf840,null));};exports['show']=function(_0x1c8feb,_0x24e903){var _0x2ebe95={'raw':!![],'where':{'id':_0x1c8feb[_0x8d2d('0x44')]['id']}},_0x220663={};_0x220663[_0x8d2d('0x2e')]=_[_0x8d2d('0x31')](db[_0x8d2d('0x2a')][_0x8d2d('0x2b')]);_0x220663[_0x8d2d('0x30')]=_[_0x8d2d('0x31')](_0x1c8feb[_0x8d2d('0x30')]);_0x220663[_0x8d2d('0x32')]=_[_0x8d2d('0x45')](_0x220663[_0x8d2d('0x2e')],_0x220663[_0x8d2d('0x30')]);_0x2ebe95[_0x8d2d('0x33')]=_[_0x8d2d('0x45')](_0x220663['model'],qs[_0x8d2d('0x34')](_0x1c8feb['query'][_0x8d2d('0x34')]));_0x2ebe95[_0x8d2d('0x33')]=_0x2ebe95['attributes'][_0x8d2d('0x35')]?_0x2ebe95[_0x8d2d('0x33')]:_0x220663[_0x8d2d('0x2e')];if(_0x1c8feb[_0x8d2d('0x30')][_0x8d2d('0x40')]){_0x2ebe95[_0x8d2d('0x41')]=[{'all':!![]}];}_0x2ebe95=_[_0x8d2d('0x3f')]({},_0x2ebe95,_0x1c8feb[_0x8d2d('0x46')]);return db[_0x8d2d('0x2a')]['find'](_0x2ebe95)[_0x8d2d('0x24')](handleEntityNotFound(_0x24e903,null))[_0x8d2d('0x24')](respondWithResult(_0x24e903,null))[_0x8d2d('0x43')](handleError(_0x24e903,null));};exports[_0x8d2d('0x47')]=function(_0x16a5f4,_0x224448){return db[_0x8d2d('0x2a')][_0x8d2d('0x47')](_0x16a5f4[_0x8d2d('0x48')],{})['then'](respondWithResult(_0x224448,0xc9))['catch'](handleError(_0x224448,null));};exports[_0x8d2d('0x23')]=function(_0xc3a0dc,_0x2f20ed){if(_0xc3a0dc[_0x8d2d('0x48')]['id']){delete _0xc3a0dc[_0x8d2d('0x48')]['id'];}return db[_0x8d2d('0x2a')][_0x8d2d('0x49')]({'where':{'id':_0xc3a0dc[_0x8d2d('0x44')]['id']}})[_0x8d2d('0x24')](handleEntityNotFound(_0x2f20ed,null))[_0x8d2d('0x24')](saveUpdates(_0xc3a0dc[_0x8d2d('0x48')],null))[_0x8d2d('0x24')](respondWithResult(_0x2f20ed,null))[_0x8d2d('0x43')](handleError(_0x2f20ed,null));};exports['destroy']=function(_0x5a6b3f,_0x5810f4){return db['VoiceQueuesLog'][_0x8d2d('0x49')]({'where':{'id':_0x5a6b3f[_0x8d2d('0x44')]['id']}})['then'](handleEntityNotFound(_0x5810f4,null))[_0x8d2d('0x24')](removeEntity(_0x5810f4,null))[_0x8d2d('0x43')](handleError(_0x5810f4,null));}; \ No newline at end of file +var _0xb47d=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','sendStatus','error','stack','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','rows','catch','show','fields','include','find','body','params','destroy','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','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4ce442,_0x4ffbf5){var _0x3a7796=function(_0x3b0f95){while(--_0x3b0f95){_0x4ce442['push'](_0x4ce442['shift']());}};_0x3a7796(++_0x4ffbf5);}(_0xb47d,0x11a));var _0xdb47=function(_0x1d888b,_0x471583){_0x1d888b=_0x1d888b-0x0;var _0x51ddb8=_0xb47d[_0x1d888b];return _0x51ddb8;};'use strict';var emlformat=require(_0xdb47('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb47('0x1'));var jsonpatch=require(_0xdb47('0x2'));var rp=require(_0xdb47('0x3'));var moment=require(_0xdb47('0x4'));var BPromise=require(_0xdb47('0x5'));var Mustache=require(_0xdb47('0x6'));var util=require(_0xdb47('0x7'));var path=require(_0xdb47('0x8'));var sox=require(_0xdb47('0x9'));var csv=require(_0xdb47('0xa'));var ejs=require(_0xdb47('0xb'));var fs=require('fs');var fs_extra=require(_0xdb47('0xc'));var _=require(_0xdb47('0xd'));var squel=require(_0xdb47('0xe'));var crypto=require(_0xdb47('0xf'));var jsforce=require(_0xdb47('0x10'));var deskjs=require(_0xdb47('0x11'));var toCsv=require(_0xdb47('0xa'));var querystring=require('querystring');var Papa=require(_0xdb47('0x12'));var Redis=require('ioredis');var authService=require(_0xdb47('0x13'));var qs=require(_0xdb47('0x14'));var as=require(_0xdb47('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb47('0x16'))(_0xdb47('0x17'));var utils=require(_0xdb47('0x18'));var config=require(_0xdb47('0x19'));var licenseUtil=require(_0xdb47('0x1a'));var db=require(_0xdb47('0x1b'))['db'];function respondWithStatusCode(_0x370513,_0x58172c){_0x58172c=_0x58172c||0xcc;return function(_0x56c603){if(_0x56c603){return _0x370513['sendStatus'](_0x58172c);}return _0x370513[_0xdb47('0x1c')](_0x58172c)[_0xdb47('0x1d')]();};}function respondWithResult(_0xf89ce1,_0x343028){_0x343028=_0x343028||0xc8;return function(_0x1fae5b){if(_0x1fae5b){return _0xf89ce1['status'](_0x343028)['json'](_0x1fae5b);}};}function respondWithFilteredResult(_0x36a4e7,_0x4bbdbc){return function(_0x2e694d){if(_0x2e694d){var _0x10ef24=typeof _0x4bbdbc[_0xdb47('0x1e')]===_0xdb47('0x1f')&&typeof _0x4bbdbc[_0xdb47('0x20')]===_0xdb47('0x1f');var _0x12085c=_0x2e694d[_0xdb47('0x21')];var _0x3eec55=_0x10ef24?0x0:_0x4bbdbc['offset'];var _0x5e9f9a=_0x10ef24?_0x2e694d[_0xdb47('0x21')]:_0x4bbdbc[_0xdb47('0x1e')]+_0x4bbdbc[_0xdb47('0x20')];var _0x58e7a1;if(_0x5e9f9a>=_0x12085c){_0x5e9f9a=_0x12085c;_0x58e7a1=0xc8;}else{_0x58e7a1=0xce;}_0x36a4e7[_0xdb47('0x1c')](_0x58e7a1);return _0x36a4e7[_0xdb47('0x22')](_0xdb47('0x23'),_0x3eec55+'-'+_0x5e9f9a+'/'+_0x12085c)['json'](_0x2e694d);}return null;};}function patchUpdates(_0x29fb26){return function(_0x248d65){try{jsonpatch['apply'](_0x248d65,_0x29fb26,!![]);}catch(_0x282fa3){return BPromise[_0xdb47('0x24')](_0x282fa3);}return _0x248d65[_0xdb47('0x25')]();};}function saveUpdates(_0x2942c1,_0x3a29e7){return function(_0x4722d6){if(_0x4722d6){return _0x4722d6[_0xdb47('0x26')](_0x2942c1)[_0xdb47('0x27')](function(_0xdd4c51){return _0xdd4c51;});}return null;};}function removeEntity(_0x5c3afc,_0x2855bb){return function(_0x407b0a){if(_0x407b0a){return _0x407b0a['destroy']()[_0xdb47('0x27')](function(){_0x5c3afc[_0xdb47('0x1c')](0xcc)[_0xdb47('0x1d')]();});}};}function handleEntityNotFound(_0x497b35,_0x63dd70){return function(_0x3fa435){if(!_0x3fa435){_0x497b35[_0xdb47('0x28')](0x194);}return _0x3fa435;};}function handleError(_0xcd8a03,_0x584e11){_0x584e11=_0x584e11||0x1f4;return function(_0x5a79cf){logger[_0xdb47('0x29')](_0x5a79cf[_0xdb47('0x2a')]);if(_0x5a79cf['name']){delete _0x5a79cf['name'];}_0xcd8a03[_0xdb47('0x1c')](_0x584e11)[_0xdb47('0x2b')](_0x5a79cf);};}exports[_0xdb47('0x2c')]=function(_0x3a5750,_0x5222a7){var _0x55fdff={},_0x341fcb={},_0x469e41={'count':0x0,'rows':[]};var _0x41be56=_[_0xdb47('0x2d')](db[_0xdb47('0x2e')][_0xdb47('0x2f')],function(_0x5f56eb){return{'name':_0x5f56eb[_0xdb47('0x30')],'type':_0x5f56eb[_0xdb47('0x31')][_0xdb47('0x32')]};});_0x341fcb[_0xdb47('0x33')]=_['map'](_0x41be56,_0xdb47('0x34'));_0x341fcb['query']=_[_0xdb47('0x35')](_0x3a5750[_0xdb47('0x36')]);_0x341fcb[_0xdb47('0x37')]=_[_0xdb47('0x38')](_0x341fcb[_0xdb47('0x33')],_0x341fcb[_0xdb47('0x36')]);_0x55fdff[_0xdb47('0x39')]=_[_0xdb47('0x38')](_0x341fcb[_0xdb47('0x33')],qs['fields'](_0x3a5750[_0xdb47('0x36')]['fields']));_0x55fdff[_0xdb47('0x39')]=_0x55fdff['attributes']['length']?_0x55fdff[_0xdb47('0x39')]:_0x341fcb[_0xdb47('0x33')];if(!_0x3a5750[_0xdb47('0x36')][_0xdb47('0x3a')]('nolimit')){_0x55fdff[_0xdb47('0x20')]=qs[_0xdb47('0x20')](_0x3a5750[_0xdb47('0x36')]['limit']);_0x55fdff[_0xdb47('0x1e')]=qs['offset'](_0x3a5750['query'][_0xdb47('0x1e')]);}_0x55fdff['order']=qs[_0xdb47('0x3b')](_0x3a5750[_0xdb47('0x36')][_0xdb47('0x3b')]);_0x55fdff['where']=qs[_0xdb47('0x37')](_[_0xdb47('0x3c')](_0x3a5750[_0xdb47('0x36')],_0x341fcb[_0xdb47('0x37')]),_0x41be56);if(_0x3a5750[_0xdb47('0x36')][_0xdb47('0x3d')]){_0x55fdff['where']=_[_0xdb47('0x3e')](_0x55fdff[_0xdb47('0x3f')],{'$or':_['map'](_0x41be56,function(_0x346e08){if(_0x346e08[_0xdb47('0x31')]!==_0xdb47('0x40')){var _0x8c0724={};_0x8c0724[_0x346e08['name']]={'$like':'%'+_0x3a5750[_0xdb47('0x36')][_0xdb47('0x3d')]+'%'};return _0x8c0724;}})});}_0x55fdff=_[_0xdb47('0x3e')]({},_0x55fdff,_0x3a5750[_0xdb47('0x41')]);var _0x516bed={'where':_0x55fdff[_0xdb47('0x3f')]};return db[_0xdb47('0x2e')][_0xdb47('0x21')](_0x516bed)[_0xdb47('0x27')](function(_0x3e8612){_0x469e41[_0xdb47('0x21')]=_0x3e8612;if(_0x3a5750[_0xdb47('0x36')][_0xdb47('0x42')]){_0x55fdff['include']=[{'all':!![]}];}return db[_0xdb47('0x2e')]['findAll'](_0x55fdff);})[_0xdb47('0x27')](function(_0x17c9f7){_0x469e41[_0xdb47('0x43')]=_0x17c9f7;return _0x469e41;})[_0xdb47('0x27')](respondWithFilteredResult(_0x5222a7,_0x55fdff))[_0xdb47('0x44')](handleError(_0x5222a7,null));};exports[_0xdb47('0x45')]=function(_0x1282fc,_0x2b384b){var _0x250553={'raw':!![],'where':{'id':_0x1282fc['params']['id']}},_0x5862e8={};_0x5862e8[_0xdb47('0x33')]=_['keys'](db[_0xdb47('0x2e')][_0xdb47('0x2f')]);_0x5862e8['query']=_[_0xdb47('0x35')](_0x1282fc[_0xdb47('0x36')]);_0x5862e8['filters']=_[_0xdb47('0x38')](_0x5862e8[_0xdb47('0x33')],_0x5862e8['query']);_0x250553[_0xdb47('0x39')]=_[_0xdb47('0x38')](_0x5862e8[_0xdb47('0x33')],qs[_0xdb47('0x46')](_0x1282fc['query']['fields']));_0x250553[_0xdb47('0x39')]=_0x250553[_0xdb47('0x39')]['length']?_0x250553[_0xdb47('0x39')]:_0x5862e8['model'];if(_0x1282fc[_0xdb47('0x36')][_0xdb47('0x42')]){_0x250553[_0xdb47('0x47')]=[{'all':!![]}];}_0x250553=_['merge']({},_0x250553,_0x1282fc[_0xdb47('0x41')]);return db[_0xdb47('0x2e')][_0xdb47('0x48')](_0x250553)['then'](handleEntityNotFound(_0x2b384b,null))[_0xdb47('0x27')](respondWithResult(_0x2b384b,null))[_0xdb47('0x44')](handleError(_0x2b384b,null));};exports['create']=function(_0x53c543,_0x2d8117){return db['VoiceQueuesLog']['create'](_0x53c543['body'],{})[_0xdb47('0x27')](respondWithResult(_0x2d8117,0xc9))['catch'](handleError(_0x2d8117,null));};exports[_0xdb47('0x26')]=function(_0xc75497,_0x27eaf6){if(_0xc75497[_0xdb47('0x49')]['id']){delete _0xc75497[_0xdb47('0x49')]['id'];}return db[_0xdb47('0x2e')][_0xdb47('0x48')]({'where':{'id':_0xc75497[_0xdb47('0x4a')]['id']}})[_0xdb47('0x27')](handleEntityNotFound(_0x27eaf6,null))[_0xdb47('0x27')](saveUpdates(_0xc75497[_0xdb47('0x49')],null))[_0xdb47('0x27')](respondWithResult(_0x27eaf6,null))[_0xdb47('0x44')](handleError(_0x27eaf6,null));};exports[_0xdb47('0x4b')]=function(_0x1ff00e,_0x188745){return db[_0xdb47('0x2e')][_0xdb47('0x48')]({'where':{'id':_0x1ff00e[_0xdb47('0x4a')]['id']}})[_0xdb47('0x27')](handleEntityNotFound(_0x188745,null))[_0xdb47('0x27')](removeEntity(_0x188745,null))[_0xdb47('0x44')](handleError(_0x188745,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index b4f6bfc..a6321d6 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 _0x180f=['request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','voice_queues_log','event_dtm','event','dtm','lodash','util','api','moment'];(function(_0x2fe606,_0x4bbc13){var _0x5cf17c=function(_0x490221){while(--_0x490221){_0x2fe606['push'](_0x2fe606['shift']());}};_0x5cf17c(++_0x4bbc13);}(_0x180f,0xf3));var _0xf180=function(_0x187d80,_0x5b793f){_0x187d80=_0x187d80-0x0;var _0x498a77=_0x180f[_0x187d80];return _0x498a77;};'use strict';var _=require(_0xf180('0x0'));var util=require(_0xf180('0x1'));var logger=require('../../config/logger')(_0xf180('0x2'));var moment=require(_0xf180('0x3'));var BPromise=require('bluebird');var rp=require(_0xf180('0x4'));var fs=require('fs');var path=require(_0xf180('0x5'));var rimraf=require(_0xf180('0x6'));var config=require(_0xf180('0x7'));var attributes=require(_0xf180('0x8'));module['exports']=function(_0x2ef675,_0x3c6552){return _0x2ef675['define']('VoiceQueuesLog',attributes,{'tableName':_0xf180('0x9'),'paranoid':![],'indexes':[{'name':_0xf180('0xa'),'fields':[_0xf180('0xb'),_0xf180('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x62c8=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm'];(function(_0x20f76a,_0x2605e2){var _0x30016d=function(_0x5b800a){while(--_0x5b800a){_0x20f76a['push'](_0x20f76a['shift']());}};_0x30016d(++_0x2605e2);}(_0x62c8,0x1ad));var _0x862c=function(_0x2e3119,_0x5e75a1){_0x2e3119=_0x2e3119-0x0;var _0x4bb31e=_0x62c8[_0x2e3119];return _0x4bb31e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x862c('0x0'))('api');var moment=require('moment');var BPromise=require(_0x862c('0x1'));var rp=require(_0x862c('0x2'));var fs=require('fs');var path=require(_0x862c('0x3'));var rimraf=require(_0x862c('0x4'));var config=require(_0x862c('0x5'));var attributes=require(_0x862c('0x6'));module['exports']=function(_0x335320,_0x2c6929){return _0x335320[_0x862c('0x7')](_0x862c('0x8'),attributes,{'tableName':_0x862c('0x9'),'paranoid':![],'indexes':[{'name':_0x862c('0xa'),'fields':[_0x862c('0xb'),_0x862c('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 0d5cb44..00ba3e9 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 _0x2ec2=['request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x27125a,_0x252d0d){var _0x391f7a=function(_0x4068fb){while(--_0x4068fb){_0x27125a['push'](_0x27125a['shift']());}};_0x391f7a(++_0x252d0d);}(_0x2ec2,0xe7));var _0x22ec=function(_0x680b65,_0x5b2e9c){_0x680b65=_0x680b65-0x0;var _0x1c2053=_0x2ec2[_0x680b65];return _0x1c2053;};'use strict';var _=require(_0x22ec('0x0'));var util=require('util');var moment=require(_0x22ec('0x1'));var BPromise=require(_0x22ec('0x2'));var rs=require(_0x22ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x22ec('0x4'));var logger=require(_0x22ec('0x5'))('rpc');var config=require(_0x22ec('0x6'));var jayson=require(_0x22ec('0x7'));var client=jayson['client'][_0x22ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46cb05,_0x3cc58a,_0x34654e){return new BPromise(function(_0x2854c4,_0x36f001){return client[_0x22ec('0x9')](_0x46cb05,_0x34654e)[_0x22ec('0xa')](function(_0x38930a){logger['info'](_0x22ec('0xb'),_0x3cc58a,_0x22ec('0xc'));logger[_0x22ec('0xd')](_0x22ec('0xe'),_0x3cc58a,'request\x20sent',JSON[_0x22ec('0xf')](_0x38930a));if(_0x38930a['error']){if(_0x38930a[_0x22ec('0x10')][_0x22ec('0x11')]===0x1f4){logger[_0x22ec('0x10')](_0x22ec('0xb'),_0x3cc58a,_0x38930a[_0x22ec('0x10')][_0x22ec('0x12')]);return _0x36f001(_0x38930a[_0x22ec('0x10')][_0x22ec('0x12')]);}logger['error'](_0x22ec('0xb'),_0x3cc58a,_0x38930a[_0x22ec('0x10')][_0x22ec('0x12')]);return _0x2854c4(_0x38930a[_0x22ec('0x10')][_0x22ec('0x12')]);}else{logger[_0x22ec('0x13')](_0x22ec('0xb'),_0x3cc58a,_0x22ec('0xc'));_0x2854c4(_0x38930a['result']['message']);}})['catch'](function(_0x5e5538){logger['error'](_0x22ec('0xb'),_0x3cc58a,_0x5e5538);_0x36f001(_0x5e5538);});});} \ No newline at end of file +var _0x7a62=['rpc','../../config/environment','jayson/promise','client','request','request\x20sent','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x5c4e53,_0x5c15f7){var _0x581e7c=function(_0x2c1329){while(--_0x2c1329){_0x5c4e53['push'](_0x5c4e53['shift']());}};_0x581e7c(++_0x5c15f7);}(_0x7a62,0x1b0));var _0x27a6=function(_0x49c19b,_0x37de5f){_0x49c19b=_0x49c19b-0x0;var _0x253096=_0x7a62[_0x49c19b];return _0x253096;};'use strict';var _=require(_0x27a6('0x0'));var util=require(_0x27a6('0x1'));var moment=require(_0x27a6('0x2'));var BPromise=require(_0x27a6('0x3'));var rs=require(_0x27a6('0x4'));var fs=require('fs');var Redis=require(_0x27a6('0x5'));var db=require(_0x27a6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x27a6('0x7'))(_0x27a6('0x8'));var config=require(_0x27a6('0x9'));var jayson=require(_0x27a6('0xa'));var client=jayson[_0x27a6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56d355,_0x1aebef,_0xfbd80d){return new BPromise(function(_0x3d6006,_0x13d6c7){return client[_0x27a6('0xc')](_0x56d355,_0xfbd80d)['then'](function(_0x3c1af7){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x1aebef,_0x27a6('0xd'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x1aebef,_0x27a6('0xd'),JSON['stringify'](_0x3c1af7));if(_0x3c1af7[_0x27a6('0xe')]){if(_0x3c1af7['error'][_0x27a6('0xf')]===0x1f4){logger[_0x27a6('0xe')](_0x27a6('0x10'),_0x1aebef,_0x3c1af7[_0x27a6('0xe')][_0x27a6('0x11')]);return _0x13d6c7(_0x3c1af7[_0x27a6('0xe')][_0x27a6('0x11')]);}logger[_0x27a6('0xe')](_0x27a6('0x10'),_0x1aebef,_0x3c1af7[_0x27a6('0xe')][_0x27a6('0x11')]);return _0x3d6006(_0x3c1af7[_0x27a6('0xe')][_0x27a6('0x11')]);}else{logger[_0x27a6('0x12')](_0x27a6('0x10'),_0x1aebef,_0x27a6('0xd'));_0x3d6006(_0x3c1af7[_0x27a6('0x13')][_0x27a6('0x11')]);}})['catch'](function(_0x47b5df){logger[_0x27a6('0xe')](_0x27a6('0x10'),_0x1aebef,_0x47b5df);_0x13d6c7(_0x47b5df);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index d430cf4..93e7373 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 _0x4875=['downloadTranscribe','create','runTranscribe','put','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','/:id/downloads','downloads','/:id/transcribe'];(function(_0x499f94,_0x5e1b4b){var _0x267334=function(_0x3d2659){while(--_0x3d2659){_0x499f94['push'](_0x499f94['shift']());}};_0x267334(++_0x5e1b4b);}(_0x4875,0x1e5));var _0x5487=function(_0x171945,_0xd87274){_0x171945=_0x171945-0x0;var _0x2d73e6=_0x4875[_0x171945];return _0x2d73e6;};'use strict';var multer=require(_0x5487('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5487('0x1'));var express=require(_0x5487('0x2'));var router=express[_0x5487('0x3')]();var fs_extra=require(_0x5487('0x4'));var auth=require(_0x5487('0x5'));var interaction=require(_0x5487('0x6'));var config=require('../../config/environment');var controller=require(_0x5487('0x7'));router[_0x5487('0x8')]('/',auth['isAuthenticated'](),controller[_0x5487('0x9')]);router[_0x5487('0x8')](_0x5487('0xa'),auth[_0x5487('0xb')](),controller[_0x5487('0xc')]);router['get'](_0x5487('0xd'),auth[_0x5487('0xb')](),controller[_0x5487('0xe')]);router[_0x5487('0x8')](_0x5487('0xf'),auth[_0x5487('0xb')](),controller['download']);router['get'](_0x5487('0x10'),controller[_0x5487('0x11')]);router[_0x5487('0x8')](_0x5487('0x12'),auth[_0x5487('0xb')](),controller[_0x5487('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5487('0x14')]);router['post'](_0x5487('0x12'),auth['isAuthenticated'](),controller[_0x5487('0x15')]);router[_0x5487('0x16')](_0x5487('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x5487('0xd'),auth[_0x5487('0xb')](),controller['destroy']);module[_0x5487('0x17')]=router; \ No newline at end of file +var _0xa1fc=['isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','put','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xa1fc,0xe9));var _0xca1f=function(_0x3230ed,_0x39d1b9){_0x3230ed=_0x3230ed-0x0;var _0x126b76=_0xa1fc[_0x3230ed];return _0x126b76;};'use strict';var multer=require('multer');var util=require(_0xca1f('0x0'));var path=require('path');var timeout=require(_0xca1f('0x1'));var express=require('express');var router=express[_0xca1f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xca1f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xca1f('0x4'));var controller=require(_0xca1f('0x5'));router[_0xca1f('0x6')]('/',auth[_0xca1f('0x7')](),controller[_0xca1f('0x8')]);router[_0xca1f('0x6')](_0xca1f('0x9'),auth[_0xca1f('0x7')](),controller[_0xca1f('0xa')]);router[_0xca1f('0x6')](_0xca1f('0xb'),auth[_0xca1f('0x7')](),controller[_0xca1f('0xc')]);router[_0xca1f('0x6')](_0xca1f('0xd'),auth['isAuthenticated'](),controller[_0xca1f('0xe')]);router[_0xca1f('0x6')](_0xca1f('0xf'),controller[_0xca1f('0x10')]);router['get'](_0xca1f('0x11'),auth[_0xca1f('0x7')](),controller['downloadTranscribe']);router[_0xca1f('0x12')]('/',auth[_0xca1f('0x7')](),controller[_0xca1f('0x13')]);router['post'](_0xca1f('0x11'),auth[_0xca1f('0x7')](),controller[_0xca1f('0x14')]);router[_0xca1f('0x15')](_0xca1f('0xb'),auth[_0xca1f('0x7')](),controller['update']);router[_0xca1f('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xca1f('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index acdae4f..badb58c 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(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 5cbd658..1d2da46 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 _0x0327=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','send','index','map','VoiceRecording','fieldName','type','model','format','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','downloads','sequelize','MD5','col','token','$and','push','Sequelize','extname','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','destroy','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','Setting','findOne','transcribe','transcribeAccountId','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir'];(function(_0x37e4f7,_0x1c15ae){var _0x8ded6c=function(_0xccdc9a){while(--_0xccdc9a){_0x37e4f7['push'](_0x37e4f7['shift']());}};_0x8ded6c(++_0x1c15ae);}(_0x0327,0x1d8));var _0x7032=function(_0x9f303f,_0x130e64){_0x9f303f=_0x9f303f-0x0;var _0x1d64bd=_0x0327[_0x9f303f];return _0x1d64bd;};'use strict';var emlformat=require(_0x7032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7032('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7032('0x2'));var moment=require(_0x7032('0x3'));var BPromise=require(_0x7032('0x4'));var Mustache=require(_0x7032('0x5'));var util=require(_0x7032('0x6'));var path=require(_0x7032('0x7'));var sox=require(_0x7032('0x8'));var csv=require('to-csv');var ejs=require(_0x7032('0x9'));var fs=require('fs');var fs_extra=require(_0x7032('0xa'));var _=require(_0x7032('0xb'));var squel=require(_0x7032('0xc'));var crypto=require(_0x7032('0xd'));var jsforce=require(_0x7032('0xe'));var deskjs=require(_0x7032('0xf'));var toCsv=require(_0x7032('0x10'));var querystring=require(_0x7032('0x11'));var Papa=require(_0x7032('0x12'));var AWS=require(_0x7032('0x13'));var uuidv4=require(_0x7032('0x14'));var Redis=require(_0x7032('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x7032('0x16'));var as=require(_0x7032('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7032('0x18'))(_0x7032('0x19'));var utils=require(_0x7032('0x1a'));var config=require(_0x7032('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x7032('0x1c'))['db'];function respondWithStatusCode(_0x49597b,_0x20dbcd){_0x20dbcd=_0x20dbcd||0xcc;return function(_0x2a257e){if(_0x2a257e){return _0x49597b[_0x7032('0x1d')](_0x20dbcd);}return _0x49597b[_0x7032('0x1e')](_0x20dbcd)[_0x7032('0x1f')]();};}function respondWithResult(_0x5590a3,_0xda78e0){_0xda78e0=_0xda78e0||0xc8;return function(_0x967994){if(_0x967994){return _0x5590a3[_0x7032('0x1e')](_0xda78e0)[_0x7032('0x20')](_0x967994);}};}function respondWithFilteredResult(_0xafe90b,_0x43026e){return function(_0x179cb5){if(_0x179cb5){var _0x4267a8=typeof _0x43026e[_0x7032('0x21')]===_0x7032('0x22')&&typeof _0x43026e[_0x7032('0x23')]===_0x7032('0x22');var _0x311694=_0x179cb5[_0x7032('0x24')];var _0x382159=_0x4267a8?0x0:_0x43026e['offset'];var _0x391b18=_0x4267a8?_0x179cb5[_0x7032('0x24')]:_0x43026e[_0x7032('0x21')]+_0x43026e[_0x7032('0x23')];var _0x551eb8;if(_0x391b18>=_0x311694){_0x391b18=_0x311694;_0x551eb8=0xc8;}else{_0x551eb8=0xce;}_0xafe90b[_0x7032('0x1e')](_0x551eb8);return _0xafe90b[_0x7032('0x25')](_0x7032('0x26'),_0x382159+'-'+_0x391b18+'/'+_0x311694)[_0x7032('0x20')](_0x179cb5);}return null;};}function patchUpdates(_0x45c4a5){return function(_0x147bf6){try{jsonpatch[_0x7032('0x27')](_0x147bf6,_0x45c4a5,!![]);}catch(_0x21055a){return BPromise[_0x7032('0x28')](_0x21055a);}return _0x147bf6[_0x7032('0x29')]();};}function saveUpdates(_0x2d62b6,_0x1d8157){return function(_0x173cf2){if(_0x173cf2){return _0x173cf2[_0x7032('0x2a')](_0x2d62b6)['then'](function(_0x1ea939){return _0x1ea939;});}return null;};}function removeEntity(_0x1d6358,_0x3c6bd9){return function(_0x1845ee){if(_0x1845ee){return _0x1845ee['destroy']()[_0x7032('0x2b')](function(){_0x1d6358[_0x7032('0x1e')](0xcc)[_0x7032('0x1f')]();});}};}function handleEntityNotFound(_0x31d109,_0x29e94f){return function(_0x392b59){if(!_0x392b59){_0x31d109[_0x7032('0x1d')](0x194);}return _0x392b59;};}function handleError(_0x2f29f8,_0xda6d38){_0xda6d38=_0xda6d38||0x1f4;return function(_0x35b8d8){logger['error'](_0x35b8d8['stack']);if(_0x35b8d8[_0x7032('0x2c')]){delete _0x35b8d8[_0x7032('0x2c')];}_0x2f29f8[_0x7032('0x1e')](_0xda6d38)[_0x7032('0x2d')](_0x35b8d8);};}exports[_0x7032('0x2e')]=function(_0x41a962,_0x44a479){var _0x57273b={},_0xdc8745={},_0x57607e={'count':0x0,'rows':[]};var _0x35d06b=_[_0x7032('0x2f')](db[_0x7032('0x30')]['rawAttributes'],function(_0x6cc80f){return{'name':_0x6cc80f[_0x7032('0x31')],'type':_0x6cc80f[_0x7032('0x32')]['key']};});_0xdc8745[_0x7032('0x33')]=_['differenceBy'](_['map'](_0x35d06b,_0x7032('0x2c')),[_0x7032('0x34')]);_0xdc8745[_0x7032('0x35')]=_[_0x7032('0x36')](_0x41a962[_0x7032('0x35')]);_0xdc8745[_0x7032('0x37')]=_[_0x7032('0x38')](_0xdc8745['model'],_0xdc8745[_0x7032('0x35')]);_0x57273b['attributes']=_[_0x7032('0x38')](_0xdc8745[_0x7032('0x33')],qs[_0x7032('0x39')](_0x41a962[_0x7032('0x35')]['fields']));_0x57273b[_0x7032('0x3a')]=_0x57273b['attributes'][_0x7032('0x3b')]?_0x57273b[_0x7032('0x3a')]:_0xdc8745[_0x7032('0x33')];if(!_0x41a962[_0x7032('0x35')][_0x7032('0x3c')](_0x7032('0x3d'))){_0x57273b[_0x7032('0x23')]=qs[_0x7032('0x23')](_0x41a962['query'][_0x7032('0x23')]);_0x57273b[_0x7032('0x21')]=qs[_0x7032('0x21')](_0x41a962[_0x7032('0x35')]['offset']);}_0x57273b['order']=qs[_0x7032('0x3e')](_0x41a962[_0x7032('0x35')]['sort']);_0x57273b[_0x7032('0x3f')]=qs[_0x7032('0x37')](_[_0x7032('0x40')](_0x41a962[_0x7032('0x35')],_0xdc8745[_0x7032('0x37')]),_0x35d06b);if(_0x41a962[_0x7032('0x35')]['filter']){_0x57273b[_0x7032('0x3f')]=_[_0x7032('0x41')](_0x57273b[_0x7032('0x3f')],{'$or':_[_0x7032('0x2f')](_0x35d06b,function(_0x32f5f1){if(_0x32f5f1[_0x7032('0x32')]!==_0x7032('0x42')){var _0x33751a={};_0x33751a[_0x32f5f1[_0x7032('0x2c')]]={'$like':'%'+_0x41a962[_0x7032('0x35')][_0x7032('0x43')]+'%'};return _0x33751a;}})});}_0x57273b=_['merge']({},_0x57273b,_0x41a962['options']);var _0x2c9264={'where':_0x57273b[_0x7032('0x3f')]};return db[_0x7032('0x30')][_0x7032('0x24')](_0x2c9264)[_0x7032('0x2b')](function(_0x4cb496){_0x57607e['count']=_0x4cb496;if(_0x41a962[_0x7032('0x35')][_0x7032('0x44')]){_0x57273b['include']=[{'all':!![]}];}return db[_0x7032('0x30')][_0x7032('0x45')](_0x57273b);})['then'](function(_0xd69fb4){_0x57607e[_0x7032('0x46')]=_0xd69fb4;return _0x57607e;})[_0x7032('0x2b')](respondWithFilteredResult(_0x44a479,_0x57273b))[_0x7032('0x47')](handleError(_0x44a479,null));};exports[_0x7032('0x48')]=function(_0xb80593,_0x3eb246){var _0x2a3d6b={'raw':![],'where':{'id':_0xb80593[_0x7032('0x49')]['id']}},_0x169bb3={};_0x169bb3[_0x7032('0x33')]=_[_0x7032('0x36')](db[_0x7032('0x30')][_0x7032('0x4a')]);_0x169bb3['query']=_[_0x7032('0x36')](_0xb80593[_0x7032('0x35')]);_0x169bb3[_0x7032('0x37')]=_[_0x7032('0x38')](_0x169bb3[_0x7032('0x33')],_0x169bb3[_0x7032('0x35')]);_0x2a3d6b['attributes']=_[_0x7032('0x38')](_0x169bb3[_0x7032('0x33')],qs[_0x7032('0x39')](_0xb80593['query'][_0x7032('0x39')]));_0x2a3d6b[_0x7032('0x3a')]=_0x2a3d6b[_0x7032('0x3a')][_0x7032('0x3b')]?_0x2a3d6b[_0x7032('0x3a')]:_0x169bb3['model'];if(_0xb80593[_0x7032('0x35')][_0x7032('0x44')]){_0x2a3d6b[_0x7032('0x4b')]=[{'all':!![]}];}_0x2a3d6b=_[_0x7032('0x41')]({},_0x2a3d6b,_0xb80593['options']);return db[_0x7032('0x30')][_0x7032('0x4c')](_0x2a3d6b)[_0x7032('0x2b')](handleEntityNotFound(_0x3eb246,null))[_0x7032('0x2b')](respondWithResult(_0x3eb246,null))[_0x7032('0x47')](handleError(_0x3eb246,null));};exports[_0x7032('0x4d')]=function(_0x296d08,_0x58b495){return db['VoiceRecording'][_0x7032('0x4d')](_0x296d08[_0x7032('0x4e')],{})['then'](respondWithResult(_0x58b495,0xc9))[_0x7032('0x47')](handleError(_0x58b495,null));};exports[_0x7032('0x2a')]=function(_0x1fd031,_0x3d42cf){if(_0x1fd031[_0x7032('0x4e')]['id']){delete _0x1fd031[_0x7032('0x4e')]['id'];}return db[_0x7032('0x30')][_0x7032('0x4c')]({'where':{'id':_0x1fd031[_0x7032('0x49')]['id']}})['then'](handleEntityNotFound(_0x3d42cf,null))[_0x7032('0x2b')](saveUpdates(_0x1fd031[_0x7032('0x4e')],null))['then'](respondWithResult(_0x3d42cf,null))['catch'](handleError(_0x3d42cf,null));};exports['describe']=function(_0x4a0c60,_0x555e34){return db[_0x7032('0x30')]['describe']()[_0x7032('0x2b')](respondWithResult(_0x555e34,null))[_0x7032('0x47')](handleError(_0x555e34,null));};exports[_0x7032('0x4f')]=function(_0x331419,_0xb0d39c,_0x3e1016){var _0x3e9105=require(_0x7032('0x50'));var _0x3a864b=![];var _0xe1dd8f={};if(_0x331419['query'][_0x7032('0x32')]&&_0x331419[_0x7032('0x35')][_0x7032('0x32')]===_0x7032('0x51')){_0xe1dd8f[_0x7032('0x51')]=_0x331419[_0x7032('0x49')]['id'];}else{_0xe1dd8f['id']=_0x331419['params']['id'];}return db[_0x7032('0x30')][_0x7032('0x4c')]({'where':_0xe1dd8f,'attributes':['id',_0x7032('0x52')],'raw':!![]})[_0x7032('0x2b')](handleEntityNotFound(_0xb0d39c,null))[_0x7032('0x2b')](function(_0x18de55){if(_0x18de55){var _0x48ee0d=_0x18de55['value'];var _0x3aece3=util['format'](_0x7032('0x53'),_0x48ee0d);if(fs[_0x7032('0x54')](_0x3aece3)){_0x3a864b=!![];return _0x3e9105[_0x7032('0x55')](_0x3aece3,_0x48ee0d,config[_0x7032('0x56')][_0x7032('0x57')])[_0x7032('0x2b')](function(){return _0x18de55;});}return _0x18de55;}})[_0x7032('0x2b')](function(_0x2ddd2c){if(_0x2ddd2c){var _0x285729=_0x2ddd2c['value'];if(!fs[_0x7032('0x54')](_0x285729)){throw new db['Sequelize'][(_0x7032('0x58'))](_0x7032('0x59'));}if(_0x2ddd2c[_0x7032('0x5a')]){return _0xb0d39c[_0x7032('0x4f')](_0x285729,_0x2ddd2c[_0x7032('0x5a')]+path['extname'](_0x285729),function(){if(_0x3a864b){fs[_0x7032('0x5b')](_0x285729);}});}else{return _0xb0d39c[_0x7032('0x4f')](_0x285729,function(_0x4e690f){if(_0x3a864b){fs['unlink'](_0x285729);}});}}})[_0x7032('0x47')](function(_0x54e4b5){if(_0x54e4b5[_0x7032('0x5c')]===_0x7032('0x59')){_0xb0d39c['status'](0x194)['send']('Not\x20found');}else{return handleError(_0xb0d39c,null);}});};exports[_0x7032('0x5d')]=function(_0x5a38fa,_0x51a1d2,_0x475190){var _0x2ed055=require('../../components/encryptor');var _0x2af472=![];var _0x5f09bc={'$and':[db[_0x7032('0x5e')]['where'](db[_0x7032('0x5e')]['fn'](_0x7032('0x5f'),db['sequelize'][_0x7032('0x60')](_0x7032('0x51'))),_0x5a38fa[_0x7032('0x35')][_0x7032('0x61')])]};if(_0x5a38fa[_0x7032('0x35')][_0x7032('0x32')]&&_0x5a38fa[_0x7032('0x35')][_0x7032('0x32')]===_0x7032('0x51')){_0x5f09bc[_0x7032('0x62')]['push']({'uniqueid':_0x5a38fa[_0x7032('0x49')]['id']});}else{_0x5f09bc['$and'][_0x7032('0x63')]({'id':_0x5a38fa[_0x7032('0x49')]['id']});}return db[_0x7032('0x30')]['find']({'where':_0x5f09bc,'attributes':['id',_0x7032('0x52')],'raw':!![]})[_0x7032('0x2b')](handleEntityNotFound(_0x51a1d2,null))[_0x7032('0x2b')](function(_0x5b3b0e){if(_0x5b3b0e){var _0x1b9645=util[_0x7032('0x34')](_0x7032('0x53'),_0x5b3b0e[_0x7032('0x52')]);if(fs[_0x7032('0x54')](_0x1b9645)){_0x2af472=!![];return _0x2ed055[_0x7032('0x55')](_0x1b9645,_0x5b3b0e[_0x7032('0x52')],config[_0x7032('0x56')][_0x7032('0x57')])[_0x7032('0x2b')](function(){return _0x5b3b0e;});}return _0x5b3b0e;}})['then'](function(_0x3785dd){if(_0x3785dd){if(!fs['existsSync'](_0x3785dd['value'])){throw new db[(_0x7032('0x64'))]['ValidationError'](_0x7032('0x59'));}if(_0x3785dd[_0x7032('0x5a')]){return _0x51a1d2[_0x7032('0x4f')](_0x3785dd[_0x7032('0x52')],_0x3785dd['filename']+path[_0x7032('0x65')](_0x3785dd[_0x7032('0x52')]),function(){if(_0x2af472){fs[_0x7032('0x5b')](_0x3785dd[_0x7032('0x52')]);}});}else{return _0x51a1d2[_0x7032('0x4f')](_0x3785dd['value'],function(_0x47a284){if(_0x2af472){fs[_0x7032('0x5b')](_0x3785dd[_0x7032('0x52')]);}});}}})['catch'](handleError(_0x51a1d2,null));};exports['destroy']=function(_0x54816b,_0x1de861){return db[_0x7032('0x30')][_0x7032('0x4c')]({'where':{'id':_0x54816b[_0x7032('0x49')]['id']}})[_0x7032('0x2b')](function(_0x29d564){if(_[_0x7032('0x66')](_0x29d564)){throw new ReferenceError(_0x7032('0x67'));}return _0x29d564;})['then'](function(_0x18ba73){var _0x2b1946=_0x18ba73[_0x7032('0x52')];logger['info'](_0x7032('0x68'),_0x2b1946);if(!_[_0x7032('0x66')](_0x18ba73[_0x7032('0x52')])&&fs[_0x7032('0x54')](_0x2b1946)){logger[_0x7032('0x69')]('File:\x20\x22'+_0x2b1946+_0x7032('0x6a'));fs[_0x7032('0x6b')](_0x2b1946);}_0x2b1946=_0x2b1946+'.cypher';if(!_['isNil'](_0x18ba73[_0x7032('0x52')])&&fs[_0x7032('0x54')](_0x2b1946)){logger[_0x7032('0x69')](_0x7032('0x6c')+_0x2b1946+_0x7032('0x6a'));fs[_0x7032('0x6b')](_0x2b1946);}return _0x18ba73;})['then'](function(_0x398584){if(!_0x398584)throw new InternalError();return _0x398584[_0x7032('0x6d')]();})[_0x7032('0x2b')](function(){_0x1de861['status'](0xcc)[_0x7032('0x1f')]();})[_0x7032('0x47')](handleError(_0x1de861,null));};function getBucketslist(_0x5e4331,_0x36f7d0,_0x33d3fd){return new Promise(function(_0x3ead4d,_0xb733ab){var _0x46f858=new AWS['S3']({'accessKeyId':_0x36f7d0,'secretAccessKey':_0x5e4331,'region':_0x33d3fd});_0x46f858[_0x7032('0x6e')]({},function(_0x65356,_0x4da9a3){if(_0x65356){return _0xb733ab(_0x65356);}else{return _0x3ead4d(_0x4da9a3);}});});}function createBucket(_0x25144d,_0x5dfb95,_0x8b2beb,_0x2f98da){return new Promise(function(_0x40318d,_0x7d6884){var _0x4b4e92=new AWS['S3']({'accessKeyId':_0x5dfb95,'secretAccessKey':_0x25144d,'region':_0x8b2beb});_0x4b4e92[_0x7032('0x6f')]({'Bucket':_0x2f98da},function(_0x4c3402,_0x128b80){if(_0x4c3402){return _0x7d6884(_0x4c3402);}else{return _0x40318d(_0x128b80);}});});}function uploadFile(_0x3bd883,_0x394b1a,_0x58ca65,_0x1f6603,_0x8eae43,_0x17d361){return new Promise(function(_0x9c3451,_0x853f55){var _0x70aa32=new AWS['S3']({'accessKeyId':_0x394b1a,'secretAccessKey':_0x3bd883,'region':_0x58ca65});_0x70aa32[_0x7032('0x70')]({'Bucket':_0x1f6603,'Key':_0x8eae43,'Body':_0x17d361},function(_0x4a496a,_0x476be1){if(_0x4a496a){return _0x853f55(_0x4a496a);}else{return _0x9c3451(_0x476be1);}});});}function startTranscribe(_0x210f22,_0x53a55f,_0x44f98a,_0x35c898,_0x3782b3,_0x799c9){return new Promise(function(_0x1016b9,_0x3f45fd){var _0x289f5b=new AWS[(_0x7032('0x71'))]({'accessKeyId':_0x53a55f,'secretAccessKey':_0x210f22,'region':_0x44f98a});_0x289f5b[_0x7032('0x72')]({'TranscriptionJobName':_0x35c898,'LanguageCode':_0x3782b3,'Media':{'MediaFileUri':_0x799c9}},function(_0x4961f7,_0xdfff56){if(_0x4961f7){return _0x3f45fd(_0x4961f7);}else{return _0x1016b9(_0xdfff56);}});});}function transcribe(_0x554184,_0x94f744,_0x529bac,_0x3fbb82,_0x1d6393,_0x5bc946,_0x15ac70){return new Promise(function(_0x269efd,_0x10707b){var _0x2ecad6={};logger['info'](util[_0x7032('0x34')](_0x7032('0x73'),_0x554184,_0x1d6393));return uploadFile(_0x94f744,_0x529bac,_0x3fbb82,_0x1d6393,path[_0x7032('0x74')](_0x5bc946),fs['readFileSync'](_0x5bc946))[_0x7032('0x2b')](function(_0x202031){logger[_0x7032('0x69')](util['format'](_0x7032('0x75'),_0x554184,_0x1d6393,_0x202031[_0x7032('0x76')]));_0x2ecad6['bucket']=_0x202031[_0x7032('0x77')];_0x2ecad6['location']=_0x202031[_0x7032('0x76')];logger['info'](util[_0x7032('0x34')](_0x7032('0x78'),_0x554184));return startTranscribe(_0x94f744,_0x529bac,_0x3fbb82,uuidv4(),_0x15ac70,_0x202031[_0x7032('0x76')]);})['then'](function(_0xaed77c){logger[_0x7032('0x69')](util[_0x7032('0x34')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x554184,_0xaed77c[_0x7032('0x79')][_0x7032('0x7a')]));_0x2ecad6[_0x7032('0x7b')]=_0xaed77c[_0x7032('0x79')]['TranscriptionJobName'];_0x2ecad6['transcribeStatus']=_0xaed77c[_0x7032('0x79')][_0x7032('0x7c')];return _0x269efd(_0x2ecad6);})[_0x7032('0x47')](function(_0x370939){return _0x10707b(_0x370939);});});}exports[_0x7032('0x7d')]=function(_0x191cde,_0x3743d0,_0x1ea6d1){var _0x2b617e;var _0x180be2;var _0x2ab9d9;var _0x4d4930=require(_0x7032('0x50'));return db[_0x7032('0x30')]['findOne']({'where':{'id':_0x191cde[_0x7032('0x49')]['id']}})['then'](function(_0x18233e){if(_0x18233e){var _0x35f0d9=util[_0x7032('0x34')](_0x7032('0x53'),_0x18233e['value']);if(fs[_0x7032('0x54')](_0x35f0d9)){cypher=!![];return _0x4d4930[_0x7032('0x55')](_0x35f0d9,_0x18233e[_0x7032('0x52')],config[_0x7032('0x56')]['recording'])[_0x7032('0x2b')](function(){return _0x18233e;});}return _0x18233e;}})['then'](function(_0x494da0){if(!_0x494da0){throw new db[(_0x7032('0x64'))][(_0x7032('0x58'))]('Voice\x20Recording\x20not\x20found');}_0x180be2=_0x494da0;return db[_0x7032('0x7e')][_0x7032('0x7f')]({'where':{'id':0x1}});})[_0x7032('0x2b')](handleEntityNotFound(_0x3743d0,null))[_0x7032('0x2b')](function(_0x3ae0ff){if(_0x3ae0ff){_0x2b617e=_0x3ae0ff;if(!_0x2b617e[_0x7032('0x80')]||!_0x2b617e[_0x7032('0x81')]||!_0x2b617e[_0x7032('0x82')]||!_0x2b617e[_0x7032('0x83')]||!_0x2b617e[_0x7032('0x84')]){throw new db[(_0x7032('0x64'))][(_0x7032('0x58'))](_0x7032('0x85'));}if(_0x191cde[_0x7032('0x4e')][_0x7032('0x86')]&&(!_0x2b617e[_0x7032('0x87')]||!_0x2b617e['sentimentAccountId']||!_0x2b617e[_0x7032('0x88')]||!_0x2b617e[_0x7032('0x83')]||!_0x2b617e[_0x7032('0x84')])){throw new db[(_0x7032('0x64'))]['ValidationError'](_0x7032('0x89'));}return db[_0x7032('0x8a')]['findOne']({'where':{'id':_0x2b617e[_0x7032('0x81')]}});}})[_0x7032('0x2b')](function(_0x394e1b){if(!_0x394e1b){throw new db[(_0x7032('0x64'))][(_0x7032('0x58'))](_0x7032('0x8b'));}if(!_0x394e1b[_0x7032('0x8c')]||!_0x394e1b[_0x7032('0x8d')]){throw new db[(_0x7032('0x64'))][(_0x7032('0x58'))]('Cloud\x20Provider\x20not\x20configured');}_0x2ab9d9=_0x394e1b;return getBucketslist(_0x2ab9d9[_0x7032('0x8c')],_0x2ab9d9['data2'],_0x2b617e[_0x7032('0x82')]);})[_0x7032('0x2b')](function(_0x4be287){if(_0x4be287&&_0x4be287[_0x7032('0x8e')]){var _0xe6fcfd=_[_0x7032('0x4c')](_0x4be287[_0x7032('0x8e')],function(_0x1aee22){return _0x1aee22[_0x7032('0x8f')]===_0x2b617e[_0x7032('0x84')];});if(!_0xe6fcfd){logger[_0x7032('0x69')](util[_0x7032('0x34')](_0x7032('0x90'),_0x191cde[_0x7032('0x49')]['id'],_0x2b617e['bucket']));return createBucket(_0x2ab9d9['data1'],_0x2ab9d9['data2'],_0x2b617e['transcribeRegion'],_0x2b617e[_0x7032('0x84')]);}logger[_0x7032('0x69')](util[_0x7032('0x34')](_0x7032('0x91'),_0x191cde['params']['id'],_0x2b617e[_0x7032('0x84')]));return;}})[_0x7032('0x2b')](function(_0x48e886){if(_0x180be2[_0x7032('0x92')]===_0x7032('0x93')){return transcribe(_0x191cde['params']['id'],_0x2ab9d9['data1'],_0x2ab9d9[_0x7032('0x8d')],_0x2b617e[_0x7032('0x82')],_0x2b617e[_0x7032('0x84')],_0x180be2[_0x7032('0x52')],_0x2b617e[_0x7032('0x83')]);}else{logger[_0x7032('0x69')](util['format'](_0x7032('0x94'),_0x191cde[_0x7032('0x49')]['id']));return{'transcribeStatus':_0x7032('0x95')};}})['then'](function(_0x5e2678){if(_0x5e2678){_0x5e2678[_0x7032('0x96')]=_0x191cde[_0x7032('0x4e')][_0x7032('0x86')];return _0x180be2['updateAttributes'](_0x5e2678);}})['then'](respondWithResult(_0x3743d0,null))[_0x7032('0x47')](handleError(_0x3743d0,null));};function writeFile(_0x2b2ea7,_0x507987){return new Promise(function(_0x4e31ae,_0x571d01){fs[_0x7032('0x97')](_0x507987,_0x2b2ea7,function(_0x5cc279,_0x1e327f){if(_0x5cc279){return _0x571d01(_0x5cc279);}else{return _0x4e31ae(_0x1e327f);}});});}exports[_0x7032('0x98')]=function(_0xc3336,_0x408457,_0x35c029){return db[_0x7032('0x30')][_0x7032('0x7f')]({'where':{'id':_0xc3336[_0x7032('0x49')]['id']}})[_0x7032('0x2b')](handleEntityNotFound(_0x408457))['then'](function(_0x3acaa0){if(_0x3acaa0&&_0x3acaa0[_0x7032('0x99')]){var _0x4c525b=_0x3acaa0[_0x7032('0x99')];var _0x377324=config[_0x7032('0x9a')]+_0x7032('0x9b')+_0x3acaa0['id']+_0x7032('0x9c');if(fs['existsSync'](_0x377324)){return _0x377324;}return writeFile(_0x4c525b,_0x377324)[_0x7032('0x2b')](function(){return _0x377324;});}else{throw new db[(_0x7032('0x64'))]['ValidationError'](_0x7032('0x9d'));}})['then'](function(_0x1505f9){return _0x408457[_0x7032('0x4f')](_0x1505f9);})[_0x7032('0x47')](handleError(_0x408457));}; \ No newline at end of file +var _0x55ce=['hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','show','params','rawAttributes','intersection','find','catch','create','body','update','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','downloads','sequelize','col','token','$and','push','secrets','download','destroy','isNil','Entity\x20not\x20found','info','File:\x20\x22','unlinkSync','.cypher','listBuckets','createBucket','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','bucket','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','stack','name','send','map','VoiceRecording','type','key','model','differenceBy','format','keys','query','filters','fields','attributes','length'];(function(_0x5fe7ce,_0x1a0d39){var _0x3b5793=function(_0x221d2a){while(--_0x221d2a){_0x5fe7ce['push'](_0x5fe7ce['shift']());}};_0x3b5793(++_0x1a0d39);}(_0x55ce,0xf4));var _0xe55c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x55ce[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xe55c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe55c('0x1'));var rp=require(_0xe55c('0x2'));var moment=require(_0xe55c('0x3'));var BPromise=require(_0xe55c('0x4'));var Mustache=require(_0xe55c('0x5'));var util=require(_0xe55c('0x6'));var path=require(_0xe55c('0x7'));var sox=require('sox');var csv=require(_0xe55c('0x8'));var ejs=require(_0xe55c('0x9'));var fs=require('fs');var fs_extra=require(_0xe55c('0xa'));var _=require('lodash');var squel=require(_0xe55c('0xb'));var crypto=require(_0xe55c('0xc'));var jsforce=require(_0xe55c('0xd'));var deskjs=require(_0xe55c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe55c('0xf'));var Papa=require(_0xe55c('0x10'));var AWS=require(_0xe55c('0x11'));var uuidv4=require(_0xe55c('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe55c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe55c('0x14'))(_0xe55c('0x15'));var utils=require(_0xe55c('0x16'));var config=require(_0xe55c('0x17'));var licenseUtil=require(_0xe55c('0x18'));var db=require(_0xe55c('0x19'))['db'];function respondWithStatusCode(_0x21d8e7,_0x4d876e){_0x4d876e=_0x4d876e||0xcc;return function(_0x47897e){if(_0x47897e){return _0x21d8e7[_0xe55c('0x1a')](_0x4d876e);}return _0x21d8e7['status'](_0x4d876e)[_0xe55c('0x1b')]();};}function respondWithResult(_0x10cc7b,_0x4e2fb5){_0x4e2fb5=_0x4e2fb5||0xc8;return function(_0x1ea8da){if(_0x1ea8da){return _0x10cc7b[_0xe55c('0x1c')](_0x4e2fb5)[_0xe55c('0x1d')](_0x1ea8da);}};}function respondWithFilteredResult(_0x1e245b,_0x1970a2){return function(_0x2f7f77){if(_0x2f7f77){var _0x939a0b=typeof _0x1970a2['offset']==='undefined'&&typeof _0x1970a2[_0xe55c('0x1e')]===_0xe55c('0x1f');var _0x282ab4=_0x2f7f77[_0xe55c('0x20')];var _0x420816=_0x939a0b?0x0:_0x1970a2[_0xe55c('0x21')];var _0x2ea394=_0x939a0b?_0x2f7f77[_0xe55c('0x20')]:_0x1970a2['offset']+_0x1970a2[_0xe55c('0x1e')];var _0x14b7db;if(_0x2ea394>=_0x282ab4){_0x2ea394=_0x282ab4;_0x14b7db=0xc8;}else{_0x14b7db=0xce;}_0x1e245b[_0xe55c('0x1c')](_0x14b7db);return _0x1e245b[_0xe55c('0x22')](_0xe55c('0x23'),_0x420816+'-'+_0x2ea394+'/'+_0x282ab4)[_0xe55c('0x1d')](_0x2f7f77);}return null;};}function patchUpdates(_0x509ffb){return function(_0x4beec4){try{jsonpatch[_0xe55c('0x24')](_0x4beec4,_0x509ffb,!![]);}catch(_0x1d3a81){return BPromise[_0xe55c('0x25')](_0x1d3a81);}return _0x4beec4[_0xe55c('0x26')]();};}function saveUpdates(_0x1580be,_0x69b4e3){return function(_0x54ab4e){if(_0x54ab4e){return _0x54ab4e['update'](_0x1580be)[_0xe55c('0x27')](function(_0x34a1b6){return _0x34a1b6;});}return null;};}function removeEntity(_0x251fc8,_0x36c0f8){return function(_0x61e5c1){if(_0x61e5c1){return _0x61e5c1['destroy']()[_0xe55c('0x27')](function(){_0x251fc8['status'](0xcc)[_0xe55c('0x1b')]();});}};}function handleEntityNotFound(_0x1aff8d,_0x4b2fde){return function(_0x3cbe16){if(!_0x3cbe16){_0x1aff8d['sendStatus'](0x194);}return _0x3cbe16;};}function handleError(_0x350dff,_0x980b04){_0x980b04=_0x980b04||0x1f4;return function(_0x415e46){logger['error'](_0x415e46[_0xe55c('0x28')]);if(_0x415e46[_0xe55c('0x29')]){delete _0x415e46[_0xe55c('0x29')];}_0x350dff[_0xe55c('0x1c')](_0x980b04)[_0xe55c('0x2a')](_0x415e46);};}exports['index']=function(_0x3f2756,_0x264dc6){var _0x747c1c={},_0x1c570e={},_0x478cf9={'count':0x0,'rows':[]};var _0x3096a6=_[_0xe55c('0x2b')](db[_0xe55c('0x2c')]['rawAttributes'],function(_0x4abddd){return{'name':_0x4abddd['fieldName'],'type':_0x4abddd[_0xe55c('0x2d')][_0xe55c('0x2e')]};});_0x1c570e[_0xe55c('0x2f')]=_[_0xe55c('0x30')](_[_0xe55c('0x2b')](_0x3096a6,_0xe55c('0x29')),[_0xe55c('0x31')]);_0x1c570e['query']=_[_0xe55c('0x32')](_0x3f2756[_0xe55c('0x33')]);_0x1c570e[_0xe55c('0x34')]=_['intersection'](_0x1c570e[_0xe55c('0x2f')],_0x1c570e[_0xe55c('0x33')]);_0x747c1c['attributes']=_['intersection'](_0x1c570e[_0xe55c('0x2f')],qs[_0xe55c('0x35')](_0x3f2756[_0xe55c('0x33')][_0xe55c('0x35')]));_0x747c1c[_0xe55c('0x36')]=_0x747c1c[_0xe55c('0x36')][_0xe55c('0x37')]?_0x747c1c[_0xe55c('0x36')]:_0x1c570e[_0xe55c('0x2f')];if(!_0x3f2756[_0xe55c('0x33')][_0xe55c('0x38')](_0xe55c('0x39'))){_0x747c1c[_0xe55c('0x1e')]=qs[_0xe55c('0x1e')](_0x3f2756[_0xe55c('0x33')][_0xe55c('0x1e')]);_0x747c1c[_0xe55c('0x21')]=qs[_0xe55c('0x21')](_0x3f2756[_0xe55c('0x33')][_0xe55c('0x21')]);}_0x747c1c[_0xe55c('0x3a')]=qs[_0xe55c('0x3b')](_0x3f2756['query']['sort']);_0x747c1c[_0xe55c('0x3c')]=qs['filters'](_[_0xe55c('0x3d')](_0x3f2756['query'],_0x1c570e[_0xe55c('0x34')]),_0x3096a6);if(_0x3f2756['query']['filter']){_0x747c1c[_0xe55c('0x3c')]=_[_0xe55c('0x3e')](_0x747c1c[_0xe55c('0x3c')],{'$or':_[_0xe55c('0x2b')](_0x3096a6,function(_0x5220e1){if(_0x5220e1[_0xe55c('0x2d')]!==_0xe55c('0x3f')){var _0x52bdef={};_0x52bdef[_0x5220e1[_0xe55c('0x29')]]={'$like':'%'+_0x3f2756[_0xe55c('0x33')][_0xe55c('0x40')]+'%'};return _0x52bdef;}})});}_0x747c1c=_['merge']({},_0x747c1c,_0x3f2756[_0xe55c('0x41')]);var _0x4ba91e={'where':_0x747c1c[_0xe55c('0x3c')]};return db[_0xe55c('0x2c')]['count'](_0x4ba91e)[_0xe55c('0x27')](function(_0x3704b7){_0x478cf9[_0xe55c('0x20')]=_0x3704b7;if(_0x3f2756['query'][_0xe55c('0x42')]){_0x747c1c['include']=[{'all':!![]}];}return db[_0xe55c('0x2c')]['findAll'](_0x747c1c);})['then'](function(_0x55094e){_0x478cf9[_0xe55c('0x43')]=_0x55094e;return _0x478cf9;})['then'](respondWithFilteredResult(_0x264dc6,_0x747c1c))['catch'](handleError(_0x264dc6,null));};exports[_0xe55c('0x44')]=function(_0x5edea9,_0x43e31d){var _0x1bb760={'raw':![],'where':{'id':_0x5edea9[_0xe55c('0x45')]['id']}},_0x55c266={};_0x55c266[_0xe55c('0x2f')]=_[_0xe55c('0x32')](db['VoiceRecording'][_0xe55c('0x46')]);_0x55c266[_0xe55c('0x33')]=_[_0xe55c('0x32')](_0x5edea9[_0xe55c('0x33')]);_0x55c266[_0xe55c('0x34')]=_['intersection'](_0x55c266[_0xe55c('0x2f')],_0x55c266['query']);_0x1bb760[_0xe55c('0x36')]=_[_0xe55c('0x47')](_0x55c266['model'],qs[_0xe55c('0x35')](_0x5edea9[_0xe55c('0x33')][_0xe55c('0x35')]));_0x1bb760[_0xe55c('0x36')]=_0x1bb760[_0xe55c('0x36')][_0xe55c('0x37')]?_0x1bb760[_0xe55c('0x36')]:_0x55c266[_0xe55c('0x2f')];if(_0x5edea9[_0xe55c('0x33')][_0xe55c('0x42')]){_0x1bb760['include']=[{'all':!![]}];}_0x1bb760=_[_0xe55c('0x3e')]({},_0x1bb760,_0x5edea9[_0xe55c('0x41')]);return db['VoiceRecording'][_0xe55c('0x48')](_0x1bb760)['then'](handleEntityNotFound(_0x43e31d,null))['then'](respondWithResult(_0x43e31d,null))[_0xe55c('0x49')](handleError(_0x43e31d,null));};exports[_0xe55c('0x4a')]=function(_0x441ebd,_0x21b289){return db['VoiceRecording'][_0xe55c('0x4a')](_0x441ebd[_0xe55c('0x4b')],{})['then'](respondWithResult(_0x21b289,0xc9))[_0xe55c('0x49')](handleError(_0x21b289,null));};exports[_0xe55c('0x4c')]=function(_0x3b4c10,_0x1f63fd){if(_0x3b4c10[_0xe55c('0x4b')]['id']){delete _0x3b4c10[_0xe55c('0x4b')]['id'];}return db[_0xe55c('0x2c')][_0xe55c('0x48')]({'where':{'id':_0x3b4c10['params']['id']}})['then'](handleEntityNotFound(_0x1f63fd,null))[_0xe55c('0x27')](saveUpdates(_0x3b4c10[_0xe55c('0x4b')],null))[_0xe55c('0x27')](respondWithResult(_0x1f63fd,null))['catch'](handleError(_0x1f63fd,null));};exports[_0xe55c('0x4d')]=function(_0x56aadc,_0xd8d73c){return db['VoiceRecording']['describe']()[_0xe55c('0x27')](respondWithResult(_0xd8d73c,null))[_0xe55c('0x49')](handleError(_0xd8d73c,null));};exports['download']=function(_0x16c481,_0x73afa1,_0x42a9ab){var _0x665ae=require(_0xe55c('0x4e'));var _0xaee31b=![];var _0x4256d6={};if(_0x16c481[_0xe55c('0x33')][_0xe55c('0x2d')]&&_0x16c481[_0xe55c('0x33')][_0xe55c('0x2d')]===_0xe55c('0x4f')){_0x4256d6[_0xe55c('0x4f')]=_0x16c481[_0xe55c('0x45')]['id'];}else{_0x4256d6['id']=_0x16c481['params']['id'];}return db[_0xe55c('0x2c')][_0xe55c('0x48')]({'where':_0x4256d6,'attributes':['id','value'],'raw':!![]})[_0xe55c('0x27')](handleEntityNotFound(_0x73afa1,null))['then'](function(_0x1dba09){if(_0x1dba09){var _0x2a5c00=_0x1dba09[_0xe55c('0x50')];var _0x37e32f=util[_0xe55c('0x31')](_0xe55c('0x51'),_0x2a5c00);if(fs[_0xe55c('0x52')](_0x37e32f)){_0xaee31b=!![];return _0x665ae[_0xe55c('0x53')](_0x37e32f,_0x2a5c00,config['secrets'][_0xe55c('0x54')])[_0xe55c('0x27')](function(){return _0x1dba09;});}return _0x1dba09;}})[_0xe55c('0x27')](function(_0x319abd){if(_0x319abd){var _0x25c81d=_0x319abd[_0xe55c('0x50')];if(!fs[_0xe55c('0x52')](_0x25c81d)){throw new db[(_0xe55c('0x55'))][(_0xe55c('0x56'))](_0xe55c('0x57'));}if(_0x319abd[_0xe55c('0x58')]){return _0x73afa1['download'](_0x25c81d,_0x319abd[_0xe55c('0x58')]+path[_0xe55c('0x59')](_0x25c81d),function(){if(_0xaee31b){fs[_0xe55c('0x5a')](_0x25c81d);}});}else{return _0x73afa1['download'](_0x25c81d,function(_0xa877b8){if(_0xaee31b){fs[_0xe55c('0x5a')](_0x25c81d);}});}}})[_0xe55c('0x49')](function(_0x521f79){if(_0x521f79['message']===_0xe55c('0x57')){_0x73afa1[_0xe55c('0x1c')](0x194)[_0xe55c('0x2a')]('Not\x20found');}else{return handleError(_0x73afa1,null);}});};exports[_0xe55c('0x5b')]=function(_0x10278c,_0x1c48cb,_0x4c08b8){var _0x42d2a4=require(_0xe55c('0x4e'));var _0x2ef85a=![];var _0x4848ce={'$and':[db['sequelize'][_0xe55c('0x3c')](db[_0xe55c('0x5c')]['fn']('MD5',db[_0xe55c('0x5c')][_0xe55c('0x5d')](_0xe55c('0x4f'))),_0x10278c[_0xe55c('0x33')][_0xe55c('0x5e')])]};if(_0x10278c['query'][_0xe55c('0x2d')]&&_0x10278c['query'][_0xe55c('0x2d')]===_0xe55c('0x4f')){_0x4848ce[_0xe55c('0x5f')][_0xe55c('0x60')]({'uniqueid':_0x10278c[_0xe55c('0x45')]['id']});}else{_0x4848ce[_0xe55c('0x5f')][_0xe55c('0x60')]({'id':_0x10278c['params']['id']});}return db[_0xe55c('0x2c')][_0xe55c('0x48')]({'where':_0x4848ce,'attributes':['id',_0xe55c('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x1c48cb,null))[_0xe55c('0x27')](function(_0x46e4cc){if(_0x46e4cc){var _0x5a3193=util['format']('%s.cypher',_0x46e4cc['value']);if(fs[_0xe55c('0x52')](_0x5a3193)){_0x2ef85a=!![];return _0x42d2a4['decryptFile'](_0x5a3193,_0x46e4cc[_0xe55c('0x50')],config[_0xe55c('0x61')][_0xe55c('0x54')])[_0xe55c('0x27')](function(){return _0x46e4cc;});}return _0x46e4cc;}})[_0xe55c('0x27')](function(_0xa3a831){if(_0xa3a831){if(!fs[_0xe55c('0x52')](_0xa3a831['value'])){throw new db[(_0xe55c('0x55'))][(_0xe55c('0x56'))]('VoiceRecording\x20not\x20found');}if(_0xa3a831[_0xe55c('0x58')]){return _0x1c48cb[_0xe55c('0x62')](_0xa3a831['value'],_0xa3a831[_0xe55c('0x58')]+path[_0xe55c('0x59')](_0xa3a831[_0xe55c('0x50')]),function(){if(_0x2ef85a){fs[_0xe55c('0x5a')](_0xa3a831['value']);}});}else{return _0x1c48cb[_0xe55c('0x62')](_0xa3a831[_0xe55c('0x50')],function(_0x3e8a85){if(_0x2ef85a){fs[_0xe55c('0x5a')](_0xa3a831['value']);}});}}})[_0xe55c('0x49')](handleError(_0x1c48cb,null));};exports[_0xe55c('0x63')]=function(_0x4c06b6,_0x615e3e){return db[_0xe55c('0x2c')][_0xe55c('0x48')]({'where':{'id':_0x4c06b6[_0xe55c('0x45')]['id']}})[_0xe55c('0x27')](function(_0x22b4f5){if(_[_0xe55c('0x64')](_0x22b4f5)){throw new ReferenceError(_0xe55c('0x65'));}return _0x22b4f5;})['then'](function(_0x1d9715){var _0x5ee408=_0x1d9715[_0xe55c('0x50')];logger[_0xe55c('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0x5ee408);if(!_[_0xe55c('0x64')](_0x1d9715[_0xe55c('0x50')])&&fs[_0xe55c('0x52')](_0x5ee408)){logger['info'](_0xe55c('0x67')+_0x5ee408+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe55c('0x68')](_0x5ee408);}_0x5ee408=_0x5ee408+_0xe55c('0x69');if(!_[_0xe55c('0x64')](_0x1d9715[_0xe55c('0x50')])&&fs[_0xe55c('0x52')](_0x5ee408)){logger[_0xe55c('0x66')]('File:\x20\x22'+_0x5ee408+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe55c('0x68')](_0x5ee408);}return _0x1d9715;})['then'](function(_0x16dab6){if(!_0x16dab6)throw new InternalError();return _0x16dab6[_0xe55c('0x63')]();})['then'](function(){_0x615e3e['status'](0xcc)[_0xe55c('0x1b')]();})[_0xe55c('0x49')](handleError(_0x615e3e,null));};function getBucketslist(_0x5acade,_0x1f3b3a,_0x5460e2){return new Promise(function(_0x320af2,_0x47d56f){var _0x2e1820=new AWS['S3']({'accessKeyId':_0x1f3b3a,'secretAccessKey':_0x5acade,'region':_0x5460e2});_0x2e1820[_0xe55c('0x6a')]({},function(_0x4ad7be,_0x2db8bb){if(_0x4ad7be){return _0x47d56f(_0x4ad7be);}else{return _0x320af2(_0x2db8bb);}});});}function createBucket(_0x46ffb8,_0x1123ff,_0x4832d7,_0x2cd44b){return new Promise(function(_0x25199b,_0x222e85){var _0x1eb655=new AWS['S3']({'accessKeyId':_0x1123ff,'secretAccessKey':_0x46ffb8,'region':_0x4832d7});_0x1eb655[_0xe55c('0x6b')]({'Bucket':_0x2cd44b},function(_0x44f63a,_0x108cc9){if(_0x44f63a){return _0x222e85(_0x44f63a);}else{return _0x25199b(_0x108cc9);}});});}function uploadFile(_0x3a0771,_0x27e2b0,_0x92c7b9,_0x467193,_0x3d9394,_0x28ea87){return new Promise(function(_0x444d76,_0x3f718a){var _0x12b016=new AWS['S3']({'accessKeyId':_0x27e2b0,'secretAccessKey':_0x3a0771,'region':_0x92c7b9});_0x12b016['upload']({'Bucket':_0x467193,'Key':_0x3d9394,'Body':_0x28ea87},function(_0x31a9a7,_0x53acf9){if(_0x31a9a7){return _0x3f718a(_0x31a9a7);}else{return _0x444d76(_0x53acf9);}});});}function startTranscribe(_0x41e883,_0x5da94b,_0x523e84,_0x30a895,_0x494715,_0x1ff59a){return new Promise(function(_0x406e10,_0x587a63){var _0x10819e=new AWS[(_0xe55c('0x6c'))]({'accessKeyId':_0x5da94b,'secretAccessKey':_0x41e883,'region':_0x523e84});_0x10819e['startTranscriptionJob']({'TranscriptionJobName':_0x30a895,'LanguageCode':_0x494715,'Media':{'MediaFileUri':_0x1ff59a}},function(_0x18bc2a,_0x25be9c){if(_0x18bc2a){return _0x587a63(_0x18bc2a);}else{return _0x406e10(_0x25be9c);}});});}function transcribe(_0x316438,_0x432365,_0x5e0b40,_0x4c84fb,_0x218aa7,_0x24a183,_0x5798c){return new Promise(function(_0xa700,_0x6d079a){var _0x520b07={};logger[_0xe55c('0x66')](util[_0xe55c('0x31')](_0xe55c('0x6d'),_0x316438,_0x218aa7));return uploadFile(_0x432365,_0x5e0b40,_0x4c84fb,_0x218aa7,path[_0xe55c('0x6e')](_0x24a183),fs[_0xe55c('0x6f')](_0x24a183))[_0xe55c('0x27')](function(_0x2faea3){logger['info'](util[_0xe55c('0x31')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x316438,_0x218aa7,_0x2faea3['Location']));_0x520b07['bucket']=_0x2faea3['Bucket'];_0x520b07[_0xe55c('0x70')]=_0x2faea3[_0xe55c('0x71')];logger[_0xe55c('0x66')](util[_0xe55c('0x31')](_0xe55c('0x72'),_0x316438));return startTranscribe(_0x432365,_0x5e0b40,_0x4c84fb,uuidv4(),_0x5798c,_0x2faea3[_0xe55c('0x71')]);})[_0xe55c('0x27')](function(_0x6c569e){logger[_0xe55c('0x66')](util[_0xe55c('0x31')](_0xe55c('0x73'),_0x316438,_0x6c569e['TranscriptionJob'][_0xe55c('0x74')]));_0x520b07[_0xe55c('0x75')]=_0x6c569e[_0xe55c('0x76')][_0xe55c('0x74')];_0x520b07['transcribeStatus']=_0x6c569e[_0xe55c('0x76')][_0xe55c('0x77')];return _0xa700(_0x520b07);})[_0xe55c('0x49')](function(_0x2a01f1){return _0x6d079a(_0x2a01f1);});});}exports[_0xe55c('0x78')]=function(_0x594bba,_0x403d78,_0x4ef496){var _0x5009a1;var _0x373e1b;var _0x4f7c54;var _0x3e1e01=require(_0xe55c('0x4e'));return db['VoiceRecording'][_0xe55c('0x79')]({'where':{'id':_0x594bba[_0xe55c('0x45')]['id']}})[_0xe55c('0x27')](function(_0x279e61){if(_0x279e61){var _0x4dddea=util['format']('%s.cypher',_0x279e61[_0xe55c('0x50')]);if(fs[_0xe55c('0x52')](_0x4dddea)){cypher=!![];return _0x3e1e01[_0xe55c('0x53')](_0x4dddea,_0x279e61[_0xe55c('0x50')],config[_0xe55c('0x61')][_0xe55c('0x54')])[_0xe55c('0x27')](function(){return _0x279e61;});}return _0x279e61;}})[_0xe55c('0x27')](function(_0x3047cc){if(!_0x3047cc){throw new db['Sequelize'][(_0xe55c('0x56'))](_0xe55c('0x7a'));}_0x373e1b=_0x3047cc;return db[_0xe55c('0x7b')][_0xe55c('0x79')]({'where':{'id':0x1}});})[_0xe55c('0x27')](handleEntityNotFound(_0x403d78,null))[_0xe55c('0x27')](function(_0x766691){if(_0x766691){_0x5009a1=_0x766691;if(!_0x5009a1['transcribe']||!_0x5009a1[_0xe55c('0x7c')]||!_0x5009a1[_0xe55c('0x7d')]||!_0x5009a1[_0xe55c('0x7e')]||!_0x5009a1[_0xe55c('0x7f')]){throw new db[(_0xe55c('0x55'))][(_0xe55c('0x56'))]('Transcribe\x20not\x20configured');}if(_0x594bba[_0xe55c('0x4b')][_0xe55c('0x80')]&&(!_0x5009a1[_0xe55c('0x81')]||!_0x5009a1[_0xe55c('0x82')]||!_0x5009a1['sentimentRegion']||!_0x5009a1[_0xe55c('0x7e')]||!_0x5009a1[_0xe55c('0x7f')])){throw new db['Sequelize'][(_0xe55c('0x56'))](_0xe55c('0x83'));}return db[_0xe55c('0x84')]['findOne']({'where':{'id':_0x5009a1[_0xe55c('0x7c')]}});}})[_0xe55c('0x27')](function(_0x95d583){if(!_0x95d583){throw new db['Sequelize'][(_0xe55c('0x56'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x95d583['data1']||!_0x95d583[_0xe55c('0x85')]){throw new db[(_0xe55c('0x55'))][(_0xe55c('0x56'))](_0xe55c('0x86'));}_0x4f7c54=_0x95d583;return getBucketslist(_0x4f7c54['data1'],_0x4f7c54['data2'],_0x5009a1[_0xe55c('0x7d')]);})[_0xe55c('0x27')](function(_0x1ba503){if(_0x1ba503&&_0x1ba503[_0xe55c('0x87')]){var _0x1a5981=_[_0xe55c('0x48')](_0x1ba503[_0xe55c('0x87')],function(_0x514eea){return _0x514eea[_0xe55c('0x88')]===_0x5009a1[_0xe55c('0x7f')];});if(!_0x1a5981){logger[_0xe55c('0x66')](util['format'](_0xe55c('0x89'),_0x594bba[_0xe55c('0x45')]['id'],_0x5009a1[_0xe55c('0x7f')]));return createBucket(_0x4f7c54[_0xe55c('0x8a')],_0x4f7c54[_0xe55c('0x85')],_0x5009a1[_0xe55c('0x7d')],_0x5009a1[_0xe55c('0x7f')]);}logger[_0xe55c('0x66')](util[_0xe55c('0x31')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x594bba[_0xe55c('0x45')]['id'],_0x5009a1[_0xe55c('0x7f')]));return;}})[_0xe55c('0x27')](function(_0x4caf2b){if(_0x373e1b[_0xe55c('0x8b')]===_0xe55c('0x8c')){return transcribe(_0x594bba[_0xe55c('0x45')]['id'],_0x4f7c54['data1'],_0x4f7c54[_0xe55c('0x85')],_0x5009a1['transcribeRegion'],_0x5009a1[_0xe55c('0x7f')],_0x373e1b['value'],_0x5009a1[_0xe55c('0x7e')]);}else{logger[_0xe55c('0x66')](util['format'](_0xe55c('0x8d'),_0x594bba[_0xe55c('0x45')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x196439){if(_0x196439){_0x196439[_0xe55c('0x8e')]=_0x594bba[_0xe55c('0x4b')][_0xe55c('0x80')];return _0x373e1b[_0xe55c('0x8f')](_0x196439);}})['then'](respondWithResult(_0x403d78,null))[_0xe55c('0x49')](handleError(_0x403d78,null));};function writeFile(_0x4a8539,_0x3979ed){return new Promise(function(_0x48b220,_0xf6566f){fs[_0xe55c('0x90')](_0x3979ed,_0x4a8539,function(_0x3f5c7a,_0x33442c){if(_0x3f5c7a){return _0xf6566f(_0x3f5c7a);}else{return _0x48b220(_0x33442c);}});});}exports['downloadTranscribe']=function(_0x5a80b6,_0x4828d1,_0x23d076){return db['VoiceRecording'][_0xe55c('0x79')]({'where':{'id':_0x5a80b6[_0xe55c('0x45')]['id']}})[_0xe55c('0x27')](handleEntityNotFound(_0x4828d1))[_0xe55c('0x27')](function(_0x129618){if(_0x129618&&_0x129618[_0xe55c('0x91')]){var _0x3bb350=_0x129618[_0xe55c('0x91')];var _0x3f0a96=config[_0xe55c('0x92')]+_0xe55c('0x93')+_0x129618['id']+_0xe55c('0x94');if(fs[_0xe55c('0x52')](_0x3f0a96)){return _0x3f0a96;}return writeFile(_0x3bb350,_0x3f0a96)[_0xe55c('0x27')](function(){return _0x3f0a96;});}else{throw new db[(_0xe55c('0x55'))][(_0xe55c('0x56'))](_0xe55c('0x95'));}})[_0xe55c('0x27')](function(_0x51d2f8){return _0x4828d1['download'](_0x51d2f8);})['catch'](handleError(_0x4828d1));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index c60833a..992f30f 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 _0xe8b1=['bluebird','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','uniqueid','lodash','util','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe8b1,0x104));var _0x1e8b=function(_0x2e20fb,_0x5b5c93){_0x2e20fb=_0x2e20fb-0x0;var _0x5e445a=_0xe8b1[_0x2e20fb];return _0x5e445a;};'use strict';var _=require(_0x1e8b('0x0'));var util=require(_0x1e8b('0x1'));var logger=require('../../config/logger')(_0x1e8b('0x2'));var moment=require(_0x1e8b('0x3'));var BPromise=require(_0x1e8b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e8b('0x5'));var rimraf=require(_0x1e8b('0x6'));var config=require(_0x1e8b('0x7'));var attributes=require(_0x1e8b('0x8'));module[_0x1e8b('0x9')]=function(_0x13f6b8,_0x3e80d8){return _0x13f6b8['define']('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x1e8b('0xa'),'fields':[_0x1e8b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd948=['VoiceRecording','uniqueid','../../config/logger','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x273bb2,_0x319264){var _0x22f932=function(_0x2124ba){while(--_0x2124ba){_0x273bb2['push'](_0x273bb2['shift']());}};_0x22f932(++_0x319264);}(_0xd948,0x12a));var _0x8d94=function(_0x1cd235,_0x2276db){_0x1cd235=_0x1cd235-0x0;var _0x197360=_0xd948[_0x1cd235];return _0x197360;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8d94('0x0'))('api');var moment=require('moment');var BPromise=require(_0x8d94('0x1'));var rp=require(_0x8d94('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8d94('0x3'));var attributes=require('./voiceRecording.attributes');module[_0x8d94('0x4')]=function(_0x472326,_0x23f62f){return _0x472326[_0x8d94('0x5')](_0x8d94('0x6'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x8d94('0x7'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index aa24a2a..65d7ffd 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 _0xfb11=['update','body','options','where','attributes','debug','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','recording','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateVoiceRecording','VoiceRecording'];(function(_0x119cd8,_0x556b73){var _0x7072a3=function(_0x5908d1){while(--_0x5908d1){_0x119cd8['push'](_0x119cd8['shift']());}};_0x7072a3(++_0x556b73);}(_0xfb11,0x1ad));var _0x1fb1=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xfb11[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var moment=require(_0x1fb1('0x1'));var BPromise=require(_0x1fb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fb1('0x4'));var logger=require('../../config/logger')(_0x1fb1('0x5'));var config=require(_0x1fb1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1fb1('0x7')][_0x1fb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c098d,_0x1859da,_0x2596c2){return new BPromise(function(_0x34e61a,_0x236b20){return client[_0x1fb1('0x9')](_0x4c098d,_0x2596c2)[_0x1fb1('0xa')](function(_0x438d15){logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,_0x1fb1('0xd'));logger['debug'](_0x1fb1('0xe'),_0x1859da,'request\x20sent',JSON[_0x1fb1('0xf')](_0x438d15));if(_0x438d15['error']){if(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x11')]===0x1f4){logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x236b20(_0x438d15['error'][_0x1fb1('0x12')]);}logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x34e61a(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);}else{logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,'request\x20sent');_0x34e61a(_0x438d15['result'][_0x1fb1('0x12')]);}})[_0x1fb1('0x13')](function(_0x3924ab){logger['error'](_0x1fb1('0xc'),_0x1859da,_0x3924ab);_0x236b20(_0x3924ab);});});}exports[_0x1fb1('0x14')]=function(_0x24d4df){var _0x34076b=this;return new Promise(function(_0x33c6b6,_0x27d71f){return db[_0x1fb1('0x15')][_0x1fb1('0x16')](_0x24d4df[_0x1fb1('0x17')],{'raw':_0x24d4df['options']?_0x24d4df[_0x1fb1('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24d4df['options']?_0x24d4df[_0x1fb1('0x18')][_0x1fb1('0x19')]||null:null,'attributes':_0x24d4df[_0x1fb1('0x18')]?_0x24d4df['options'][_0x1fb1('0x1a')]||null:null,'limit':_0x24d4df['options']?_0x24d4df['options']['limit']||null:null})[_0x1fb1('0xa')](function(_0x1f8e5a){logger[_0x1fb1('0xb')](_0x1fb1('0x14'),_0x24d4df);logger[_0x1fb1('0x1b')]('UpdateVoiceRecording',_0x24d4df,JSON[_0x1fb1('0xf')](_0x1f8e5a));_0x33c6b6(_0x1f8e5a);})[_0x1fb1('0x13')](function(_0x1dc03f){logger[_0x1fb1('0x10')](_0x1fb1('0x14'),_0x1dc03f[_0x1fb1('0x12')],_0x24d4df);_0x27d71f(_0x34076b[_0x1fb1('0x10')](0x1f4,_0x1dc03f[_0x1fb1('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x1b25b3){var _0x1aac7d=this;return new Promise(function(_0x46ff60,_0xc5188b){var _0x1898e7=require(_0x1fb1('0x1c'));var _0x1a74c4;return db[_0x1fb1('0x1d')][_0x1fb1('0x1e')]({'attributes':['id',_0x1fb1('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x1fb1('0xa')](function(_0x497017){_0x1a74c4=_0x497017;return db[_0x1fb1('0x15')][_0x1fb1('0x20')](_0x1b25b3[_0x1fb1('0x17')]);})['then'](function(_0x106134){if(_0x1a74c4[_0x1fb1('0x1f')]&&fs[_0x1fb1('0x21')](_0x106134[_0x1fb1('0x22')])){var _0x5402e9=util[_0x1fb1('0x23')](_0x1fb1('0x24'),_0x106134['value']);return _0x1898e7[_0x1fb1('0x25')](_0x106134['value'],_0x5402e9,config['secrets'][_0x1fb1('0x26')])[_0x1fb1('0xa')](function(){fs['unlink'](_0x106134[_0x1fb1('0x22')]);logger[_0x1fb1('0xb')](_0x1fb1('0x27'));return _0x106134;});}return _0x106134;})[_0x1fb1('0xa')](function(_0x32d797){logger['info'](_0x1fb1('0x28'),_0x1b25b3);logger[_0x1fb1('0x1b')](_0x1fb1('0x28'),_0x1b25b3,JSON[_0x1fb1('0xf')](_0x32d797));_0x46ff60(_0x32d797);})[_0x1fb1('0x13')](function(_0x307700){logger[_0x1fb1('0x10')](_0x1fb1('0x28'),_0x307700[_0x1fb1('0x12')],_0x1b25b3);_0xc5188b(_0x1aac7d['error'](0x1f4,_0x307700[_0x1fb1('0x12')]));});});}; \ No newline at end of file +var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','attributes','limit','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','format','%s.cypher','value','encryptFile','secrets','unlink','info','CreateVoiceRecording\x20file\x20encrypted','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3e81d6,_0x2f52da){var _0x532e4d=function(_0x1308ee){while(--_0x1308ee){_0x3e81d6['push'](_0x3e81d6['shift']());}};_0x532e4d(++_0x2f52da);}(_0xc2c7,0x134));var _0x7c2c=function(_0x3f9fbb,_0x5c04c0){_0x3f9fbb=_0x3f9fbb-0x0;var _0x3a42ff=_0xc2c7[_0x3f9fbb];return _0x3a42ff;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});}exports[_0x7c2c('0x15')]=function(_0x14453f){var _0x2a9539=this;return new Promise(function(_0x17df4a,_0x26be0f){return db[_0x7c2c('0x16')][_0x7c2c('0x17')](_0x14453f[_0x7c2c('0x18')],{'raw':_0x14453f[_0x7c2c('0x19')]?_0x14453f[_0x7c2c('0x19')][_0x7c2c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14453f['options']?_0x14453f[_0x7c2c('0x19')]['where']||null:null,'attributes':_0x14453f['options']?_0x14453f[_0x7c2c('0x19')][_0x7c2c('0x1b')]||null:null,'limit':_0x14453f[_0x7c2c('0x19')]?_0x14453f[_0x7c2c('0x19')][_0x7c2c('0x1c')]||null:null})[_0x7c2c('0xc')](function(_0xa84620){logger['info'](_0x7c2c('0x15'),_0x14453f);logger['debug'](_0x7c2c('0x15'),_0x14453f,JSON['stringify'](_0xa84620));_0x17df4a(_0xa84620);})[_0x7c2c('0x1d')](function(_0x274c3b){logger[_0x7c2c('0x12')]('UpdateVoiceRecording',_0x274c3b['message'],_0x14453f);_0x26be0f(_0x2a9539[_0x7c2c('0x12')](0x1f4,_0x274c3b[_0x7c2c('0x14')]));});});};exports[_0x7c2c('0x1e')]=function(_0x150690){var _0x31d8f3=this;return new Promise(function(_0xa8e145,_0x3f4618){var _0x4b1dd0=require(_0x7c2c('0x1f'));var _0xf39941;return db[_0x7c2c('0x20')][_0x7c2c('0x21')]({'attributes':['id',_0x7c2c('0x22')],'where':{'id':0x1},'raw':!![]})[_0x7c2c('0xc')](function(_0xf2bfd1){_0xf39941=_0xf2bfd1;return db[_0x7c2c('0x16')][_0x7c2c('0x23')](_0x150690['body']);})[_0x7c2c('0xc')](function(_0x3a3730){if(_0xf39941[_0x7c2c('0x22')]&&fs[_0x7c2c('0x24')](_0x3a3730['value'])){var _0xcb98ba=util[_0x7c2c('0x25')](_0x7c2c('0x26'),_0x3a3730[_0x7c2c('0x27')]);return _0x4b1dd0[_0x7c2c('0x28')](_0x3a3730[_0x7c2c('0x27')],_0xcb98ba,config[_0x7c2c('0x29')]['recording'])[_0x7c2c('0xc')](function(){fs[_0x7c2c('0x2a')](_0x3a3730[_0x7c2c('0x27')]);logger[_0x7c2c('0x2b')](_0x7c2c('0x2c'));return _0x3a3730;});}return _0x3a3730;})['then'](function(_0x47ef3c){logger[_0x7c2c('0x2b')]('CreateVoiceRecording',_0x150690);logger['debug'](_0x7c2c('0x1e'),_0x150690,JSON[_0x7c2c('0x11')](_0x47ef3c));_0xa8e145(_0x47ef3c);})[_0x7c2c('0x1d')](function(_0x156c03){logger['error'](_0x7c2c('0x1e'),_0x156c03[_0x7c2c('0x14')],_0x150690);_0x3f4618(_0x31d8f3[_0x7c2c('0x12')](0x1f4,_0x156c03[_0x7c2c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 3c7206b..ca765cc 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 _0xf729=['create','put','exports','path','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x1460ab,_0x74d06e){var _0x1eeb5c=function(_0x28de38){while(--_0x28de38){_0x1460ab['push'](_0x1460ab['shift']());}};_0x1eeb5c(++_0x74d06e);}(_0xf729,0xf1));var _0x9f72=function(_0x5466c5,_0x3efd25){_0x5466c5=_0x5466c5-0x0;var _0x4d489c=_0xf729[_0x5466c5];return _0x4d489c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9f72('0x0'));var timeout=require('connect-timeout');var express=require(_0x9f72('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9f72('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x9f72('0x3'));var controller=require('./voiceTransferReport.controller');router[_0x9f72('0x4')]('/',auth[_0x9f72('0x5')](),controller['index']);router[_0x9f72('0x4')](_0x9f72('0x6'),auth[_0x9f72('0x5')](),controller[_0x9f72('0x7')]);router[_0x9f72('0x4')](_0x9f72('0x8'),auth[_0x9f72('0x5')](),controller[_0x9f72('0x9')]);router[_0x9f72('0xa')]('/',auth[_0x9f72('0x5')](),controller[_0x9f72('0xb')]);router[_0x9f72('0xc')]('/:id',auth[_0x9f72('0x5')](),controller['update']);router['delete'](_0x9f72('0x8'),auth[_0x9f72('0x5')](),controller['destroy']);module[_0x9f72('0xd')]=router; \ No newline at end of file +var _0x3c24=['create','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x274d73,_0x5cdcc7){var _0x6c21d5=function(_0x88c505){while(--_0x88c505){_0x274d73['push'](_0x274d73['shift']());}};_0x6c21d5(++_0x5cdcc7);}(_0x3c24,0x1be));var _0x43c2=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0x3c24[_0x2dbce7];return _0x3a3ed0;};'use strict';var multer=require(_0x43c2('0x0'));var util=require(_0x43c2('0x1'));var path=require(_0x43c2('0x2'));var timeout=require(_0x43c2('0x3'));var express=require(_0x43c2('0x4'));var router=express[_0x43c2('0x5')]();var fs_extra=require(_0x43c2('0x6'));var auth=require(_0x43c2('0x7'));var interaction=require(_0x43c2('0x8'));var config=require(_0x43c2('0x9'));var controller=require(_0x43c2('0xa'));router[_0x43c2('0xb')]('/',auth[_0x43c2('0xc')](),controller[_0x43c2('0xd')]);router[_0x43c2('0xb')](_0x43c2('0xe'),auth[_0x43c2('0xc')](),controller[_0x43c2('0xf')]);router[_0x43c2('0xb')]('/:id',auth[_0x43c2('0xc')](),controller['show']);router['post']('/',auth[_0x43c2('0xc')](),controller[_0x43c2('0x10')]);router[_0x43c2('0x11')](_0x43c2('0x12'),auth[_0x43c2('0xc')](),controller['update']);router['delete'](_0x43c2('0x12'),auth['isAuthenticated'](),controller[_0x43c2('0x13')]);module[_0x43c2('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 987b07b..5e0e1e5 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 _0x6055=['moment','exports','blind','STRING','ENUM'];(function(_0x5cd9ba,_0x4bd01d){var _0x1e23c8=function(_0xe47df5){while(--_0xe47df5){_0x5cd9ba['push'](_0x5cd9ba['shift']());}};_0x1e23c8(++_0x4bd01d);}(_0x6055,0x186));var _0x5605=function(_0x142ccc,_0xa1cb6e){_0x142ccc=_0x142ccc-0x0;var _0x2b4230=_0x6055[_0x142ccc];return _0x2b4230;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5605('0x0'));module[_0x5605('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5605('0x2'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x5605('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x5605('0x3')]},'transferercalleridname':{'type':Sequelize[_0x5605('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x5605('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x5605('0x3')]},'transferercontext':{'type':Sequelize[_0x5605('0x3')]},'transfererexten':{'type':Sequelize[_0x5605('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x5605('0x3')]},'transfereechannel':{'type':Sequelize[_0x5605('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x5605('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x5605('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x5605('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x5605('0x3')]},'isexternal':{'type':Sequelize[_0x5605('0x4')]('Yes','No')},'context':{'type':Sequelize[_0x5605('0x3')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbf26=['exports','ENUM','blind','attended','STRING','Yes','sequelize','moment'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xbf26,0x16e));var _0x6bf2=function(_0x4c0749,_0x224354){_0x4c0749=_0x4c0749-0x0;var _0xf894c2=_0xbf26[_0x4c0749];return _0xf894c2;};'use strict';var Sequelize=require(_0x6bf2('0x0'));var moment=require(_0x6bf2('0x1'));module[_0x6bf2('0x2')]={'type':{'type':Sequelize[_0x6bf2('0x3')](_0x6bf2('0x4'),_0x6bf2('0x5'))},'result':{'type':Sequelize[_0x6bf2('0x6')]},'transfererchannel':{'type':Sequelize[_0x6bf2('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x6bf2('0x6')]},'transferercalleridname':{'type':Sequelize[_0x6bf2('0x6')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x6bf2('0x6')]},'transferercontext':{'type':Sequelize[_0x6bf2('0x6')]},'transfererexten':{'type':Sequelize[_0x6bf2('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x6bf2('0x6')]},'transfereechannel':{'type':Sequelize[_0x6bf2('0x6')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x6bf2('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x6bf2('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x6bf2('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x6bf2('0x6')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x6bf2('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x6bf2('0x6')]},'isexternal':{'type':Sequelize[_0x6bf2('0x3')](_0x6bf2('0x7'),'No')},'context':{'type':Sequelize[_0x6bf2('0x6')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 6da7f63..140a48c 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 _0x600e=['set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','VoiceTransferReport','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x600e,0x1b6));var _0xe600=function(_0x730b5,_0x251f55){_0x730b5=_0x730b5-0x0;var _0x19ce0e=_0x600e[_0x730b5];return _0x19ce0e;};'use strict';var emlformat=require(_0xe600('0x0'));var rimraf=require(_0xe600('0x1'));var zipdir=require(_0xe600('0x2'));var jsonpatch=require(_0xe600('0x3'));var rp=require(_0xe600('0x4'));var moment=require(_0xe600('0x5'));var BPromise=require(_0xe600('0x6'));var Mustache=require(_0xe600('0x7'));var util=require(_0xe600('0x8'));var path=require('path');var sox=require(_0xe600('0x9'));var csv=require('to-csv');var ejs=require(_0xe600('0xa'));var fs=require('fs');var fs_extra=require(_0xe600('0xb'));var _=require(_0xe600('0xc'));var squel=require(_0xe600('0xd'));var crypto=require(_0xe600('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe600('0xf'));var toCsv=require(_0xe600('0x10'));var querystring=require(_0xe600('0x11'));var Papa=require(_0xe600('0x12'));var Redis=require(_0xe600('0x13'));var authService=require(_0xe600('0x14'));var qs=require(_0xe600('0x15'));var as=require(_0xe600('0x16'));var hardwareService=require(_0xe600('0x17'));var logger=require('../../config/logger')(_0xe600('0x18'));var utils=require(_0xe600('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe600('0x1a'));var db=require(_0xe600('0x1b'))['db'];function respondWithStatusCode(_0xf9ca3a,_0x4aa2fc){_0x4aa2fc=_0x4aa2fc||0xcc;return function(_0x383efa){if(_0x383efa){return _0xf9ca3a[_0xe600('0x1c')](_0x4aa2fc);}return _0xf9ca3a[_0xe600('0x1d')](_0x4aa2fc)[_0xe600('0x1e')]();};}function respondWithResult(_0x197592,_0xf01f15){_0xf01f15=_0xf01f15||0xc8;return function(_0x5beabb){if(_0x5beabb){return _0x197592[_0xe600('0x1d')](_0xf01f15)[_0xe600('0x1f')](_0x5beabb);}};}function respondWithFilteredResult(_0x481a1f,_0x5cc04e){return function(_0x3857bc){if(_0x3857bc){var _0x282e8a=typeof _0x5cc04e[_0xe600('0x20')]===_0xe600('0x21')&&typeof _0x5cc04e[_0xe600('0x22')]==='undefined';var _0x694924=_0x3857bc[_0xe600('0x23')];var _0x50a3ae=_0x282e8a?0x0:_0x5cc04e[_0xe600('0x20')];var _0x185a6e=_0x282e8a?_0x3857bc[_0xe600('0x23')]:_0x5cc04e[_0xe600('0x20')]+_0x5cc04e[_0xe600('0x22')];var _0x55f85e;if(_0x185a6e>=_0x694924){_0x185a6e=_0x694924;_0x55f85e=0xc8;}else{_0x55f85e=0xce;}_0x481a1f[_0xe600('0x1d')](_0x55f85e);return _0x481a1f[_0xe600('0x24')](_0xe600('0x25'),_0x50a3ae+'-'+_0x185a6e+'/'+_0x694924)[_0xe600('0x1f')](_0x3857bc);}return null;};}function patchUpdates(_0x29279f){return function(_0x11f23c){try{jsonpatch[_0xe600('0x26')](_0x11f23c,_0x29279f,!![]);}catch(_0x39714d){return BPromise[_0xe600('0x27')](_0x39714d);}return _0x11f23c['save']();};}function saveUpdates(_0x3b04ad,_0x23f173){return function(_0x34c8c7){if(_0x34c8c7){return _0x34c8c7['update'](_0x3b04ad)['then'](function(_0x1f3739){return _0x1f3739;});}return null;};}function removeEntity(_0x319130,_0x5f54a3){return function(_0x45a545){if(_0x45a545){return _0x45a545[_0xe600('0x28')]()[_0xe600('0x29')](function(){_0x319130[_0xe600('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d5cda,_0x421eda){return function(_0x429df8){if(!_0x429df8){_0x4d5cda[_0xe600('0x1c')](0x194);}return _0x429df8;};}function handleError(_0x1168be,_0x2fe4c3){_0x2fe4c3=_0x2fe4c3||0x1f4;return function(_0x3d376a){logger[_0xe600('0x2a')](_0x3d376a[_0xe600('0x2b')]);if(_0x3d376a[_0xe600('0x2c')]){delete _0x3d376a[_0xe600('0x2c')];}_0x1168be['status'](_0x2fe4c3)[_0xe600('0x2d')](_0x3d376a);};}exports[_0xe600('0x2e')]=function(_0x4446ac,_0x474190){var _0x5c2133={},_0x410428={},_0x38038a={'count':0x0,'rows':[]};var _0x535b47=_[_0xe600('0x2f')](db[_0xe600('0x30')]['rawAttributes'],function(_0x1be7b6){return{'name':_0x1be7b6[_0xe600('0x31')],'type':_0x1be7b6[_0xe600('0x32')]['key']};});_0x410428[_0xe600('0x33')]=_[_0xe600('0x2f')](_0x535b47,_0xe600('0x2c'));_0x410428[_0xe600('0x34')]=_[_0xe600('0x35')](_0x4446ac[_0xe600('0x34')]);_0x410428[_0xe600('0x36')]=_[_0xe600('0x37')](_0x410428[_0xe600('0x33')],_0x410428[_0xe600('0x34')]);_0x5c2133['attributes']=_[_0xe600('0x37')](_0x410428[_0xe600('0x33')],qs[_0xe600('0x38')](_0x4446ac[_0xe600('0x34')][_0xe600('0x38')]));_0x5c2133[_0xe600('0x39')]=_0x5c2133[_0xe600('0x39')][_0xe600('0x3a')]?_0x5c2133[_0xe600('0x39')]:_0x410428['model'];if(!_0x4446ac[_0xe600('0x34')][_0xe600('0x3b')]('nolimit')){_0x5c2133[_0xe600('0x22')]=qs[_0xe600('0x22')](_0x4446ac[_0xe600('0x34')][_0xe600('0x22')]);_0x5c2133[_0xe600('0x20')]=qs[_0xe600('0x20')](_0x4446ac[_0xe600('0x34')][_0xe600('0x20')]);}_0x5c2133[_0xe600('0x3c')]=qs[_0xe600('0x3d')](_0x4446ac['query'][_0xe600('0x3d')]);_0x5c2133['where']=qs[_0xe600('0x36')](_[_0xe600('0x3e')](_0x4446ac[_0xe600('0x34')],_0x410428[_0xe600('0x36')]),_0x535b47);if(_0x4446ac['query'][_0xe600('0x3f')]){_0x5c2133[_0xe600('0x40')]=_['merge'](_0x5c2133[_0xe600('0x40')],{'$or':_['map'](_0x535b47,function(_0x3bf276){if(_0x3bf276[_0xe600('0x32')]!==_0xe600('0x41')){var _0x28133e={};_0x28133e[_0x3bf276[_0xe600('0x2c')]]={'$like':'%'+_0x4446ac['query'][_0xe600('0x3f')]+'%'};return _0x28133e;}})});}_0x5c2133=_[_0xe600('0x42')]({},_0x5c2133,_0x4446ac['options']);var _0x53f14b={'where':_0x5c2133[_0xe600('0x40')]};return db[_0xe600('0x30')][_0xe600('0x23')](_0x53f14b)[_0xe600('0x29')](function(_0x34c04d){_0x38038a[_0xe600('0x23')]=_0x34c04d;if(_0x4446ac[_0xe600('0x34')][_0xe600('0x43')]){_0x5c2133[_0xe600('0x44')]=[{'all':!![]}];}return db[_0xe600('0x30')][_0xe600('0x45')](_0x5c2133);})['then'](function(_0x4c3736){_0x38038a['rows']=_0x4c3736;return _0x38038a;})[_0xe600('0x29')](respondWithFilteredResult(_0x474190,_0x5c2133))[_0xe600('0x46')](handleError(_0x474190,null));};exports[_0xe600('0x47')]=function(_0x1a1b4e,_0x1c0b48){var _0x18cea7={'raw':!![],'where':{'id':_0x1a1b4e[_0xe600('0x48')]['id']}},_0x1f0ce7={};_0x1f0ce7[_0xe600('0x33')]=_[_0xe600('0x35')](db[_0xe600('0x30')][_0xe600('0x49')]);_0x1f0ce7['query']=_[_0xe600('0x35')](_0x1a1b4e['query']);_0x1f0ce7[_0xe600('0x36')]=_[_0xe600('0x37')](_0x1f0ce7[_0xe600('0x33')],_0x1f0ce7[_0xe600('0x34')]);_0x18cea7[_0xe600('0x39')]=_['intersection'](_0x1f0ce7[_0xe600('0x33')],qs[_0xe600('0x38')](_0x1a1b4e[_0xe600('0x34')]['fields']));_0x18cea7[_0xe600('0x39')]=_0x18cea7[_0xe600('0x39')][_0xe600('0x3a')]?_0x18cea7[_0xe600('0x39')]:_0x1f0ce7[_0xe600('0x33')];if(_0x1a1b4e['query'][_0xe600('0x43')]){_0x18cea7[_0xe600('0x44')]=[{'all':!![]}];}_0x18cea7=_[_0xe600('0x42')]({},_0x18cea7,_0x1a1b4e['options']);return db[_0xe600('0x30')][_0xe600('0x4a')](_0x18cea7)[_0xe600('0x29')](handleEntityNotFound(_0x1c0b48,null))['then'](respondWithResult(_0x1c0b48,null))['catch'](handleError(_0x1c0b48,null));};exports[_0xe600('0x4b')]=function(_0x5974f2,_0x2df4f2){return db[_0xe600('0x30')]['create'](_0x5974f2[_0xe600('0x4c')],{})[_0xe600('0x29')](respondWithResult(_0x2df4f2,0xc9))[_0xe600('0x46')](handleError(_0x2df4f2,null));};exports[_0xe600('0x4d')]=function(_0x5666ba,_0x159192){if(_0x5666ba[_0xe600('0x4c')]['id']){delete _0x5666ba[_0xe600('0x4c')]['id'];}return db[_0xe600('0x30')][_0xe600('0x4a')]({'where':{'id':_0x5666ba['params']['id']}})[_0xe600('0x29')](handleEntityNotFound(_0x159192,null))[_0xe600('0x29')](saveUpdates(_0x5666ba[_0xe600('0x4c')],null))[_0xe600('0x29')](respondWithResult(_0x159192,null))[_0xe600('0x46')](handleError(_0x159192,null));};exports[_0xe600('0x28')]=function(_0x39e7ca,_0x4c4f18){return db[_0xe600('0x30')][_0xe600('0x4a')]({'where':{'id':_0x39e7ca[_0xe600('0x48')]['id']}})[_0xe600('0x29')](handleEntityNotFound(_0x4c4f18,null))[_0xe600('0x29')](removeEntity(_0x4c4f18,null))[_0xe600('0x46')](handleError(_0x4c4f18,null));};exports[_0xe600('0x4e')]=function(_0x215504,_0x49ac92){return db[_0xe600('0x30')][_0xe600('0x4e')]()['then'](respondWithResult(_0x49ac92,null))['catch'](handleError(_0x49ac92,null));}; \ No newline at end of file +var _0xc0ba=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','squel','crypto'];(function(_0x20d54d,_0x1adc8e){var _0x516e8b=function(_0x2754e1){while(--_0x2754e1){_0x20d54d['push'](_0x20d54d['shift']());}};_0x516e8b(++_0x1adc8e);}(_0xc0ba,0x11a));var _0xac0b=function(_0x57d100,_0x3559c7){_0x57d100=_0x57d100-0x0;var _0x170781=_0xc0ba[_0x57d100];return _0x170781;};'use strict';var emlformat=require(_0xac0b('0x0'));var rimraf=require(_0xac0b('0x1'));var zipdir=require(_0xac0b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xac0b('0x3'));var BPromise=require(_0xac0b('0x4'));var Mustache=require(_0xac0b('0x5'));var util=require('util');var path=require(_0xac0b('0x6'));var sox=require('sox');var csv=require(_0xac0b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xac0b('0x8'));var crypto=require(_0xac0b('0x9'));var jsforce=require(_0xac0b('0xa'));var deskjs=require(_0xac0b('0xb'));var toCsv=require(_0xac0b('0x7'));var querystring=require(_0xac0b('0xc'));var Papa=require(_0xac0b('0xd'));var Redis=require(_0xac0b('0xe'));var authService=require(_0xac0b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xac0b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac0b('0x11'))(_0xac0b('0x12'));var utils=require(_0xac0b('0x13'));var config=require(_0xac0b('0x14'));var licenseUtil=require(_0xac0b('0x15'));var db=require(_0xac0b('0x16'))['db'];function respondWithStatusCode(_0x2727c8,_0x409ab1){_0x409ab1=_0x409ab1||0xcc;return function(_0xae38af){if(_0xae38af){return _0x2727c8[_0xac0b('0x17')](_0x409ab1);}return _0x2727c8['status'](_0x409ab1)[_0xac0b('0x18')]();};}function respondWithResult(_0x17be75,_0x5a099a){_0x5a099a=_0x5a099a||0xc8;return function(_0x18a885){if(_0x18a885){return _0x17be75[_0xac0b('0x19')](_0x5a099a)[_0xac0b('0x1a')](_0x18a885);}};}function respondWithFilteredResult(_0x19d9e6,_0x2323de){return function(_0x3abd35){if(_0x3abd35){var _0x4da676=typeof _0x2323de[_0xac0b('0x1b')]==='undefined'&&typeof _0x2323de[_0xac0b('0x1c')]==='undefined';var _0x2b5c38=_0x3abd35[_0xac0b('0x1d')];var _0x51ad04=_0x4da676?0x0:_0x2323de[_0xac0b('0x1b')];var _0x42658d=_0x4da676?_0x3abd35[_0xac0b('0x1d')]:_0x2323de[_0xac0b('0x1b')]+_0x2323de[_0xac0b('0x1c')];var _0x50387c;if(_0x42658d>=_0x2b5c38){_0x42658d=_0x2b5c38;_0x50387c=0xc8;}else{_0x50387c=0xce;}_0x19d9e6[_0xac0b('0x19')](_0x50387c);return _0x19d9e6[_0xac0b('0x1e')](_0xac0b('0x1f'),_0x51ad04+'-'+_0x42658d+'/'+_0x2b5c38)[_0xac0b('0x1a')](_0x3abd35);}return null;};}function patchUpdates(_0x422cbe){return function(_0x5817ce){try{jsonpatch[_0xac0b('0x20')](_0x5817ce,_0x422cbe,!![]);}catch(_0x43606c){return BPromise[_0xac0b('0x21')](_0x43606c);}return _0x5817ce[_0xac0b('0x22')]();};}function saveUpdates(_0x4d234b,_0x1a46e0){return function(_0x475257){if(_0x475257){return _0x475257[_0xac0b('0x23')](_0x4d234b)[_0xac0b('0x24')](function(_0x39996a){return _0x39996a;});}return null;};}function removeEntity(_0x185a08,_0x565058){return function(_0x2c3f6c){if(_0x2c3f6c){return _0x2c3f6c['destroy']()[_0xac0b('0x24')](function(){_0x185a08[_0xac0b('0x19')](0xcc)[_0xac0b('0x18')]();});}};}function handleEntityNotFound(_0x39db7c,_0x29a741){return function(_0xd95ad){if(!_0xd95ad){_0x39db7c[_0xac0b('0x17')](0x194);}return _0xd95ad;};}function handleError(_0x462fb5,_0x27ac78){_0x27ac78=_0x27ac78||0x1f4;return function(_0x2258fb){logger[_0xac0b('0x25')](_0x2258fb['stack']);if(_0x2258fb[_0xac0b('0x26')]){delete _0x2258fb[_0xac0b('0x26')];}_0x462fb5['status'](_0x27ac78)[_0xac0b('0x27')](_0x2258fb);};}exports[_0xac0b('0x28')]=function(_0x57b5eb,_0x3aac9c){var _0x25a22e={},_0x348392={},_0x7a329c={'count':0x0,'rows':[]};var _0x4701b5=_[_0xac0b('0x29')](db[_0xac0b('0x2a')][_0xac0b('0x2b')],function(_0x4cc9cf){return{'name':_0x4cc9cf[_0xac0b('0x2c')],'type':_0x4cc9cf['type'][_0xac0b('0x2d')]};});_0x348392['model']=_['map'](_0x4701b5,_0xac0b('0x26'));_0x348392[_0xac0b('0x2e')]=_['keys'](_0x57b5eb[_0xac0b('0x2e')]);_0x348392[_0xac0b('0x2f')]=_[_0xac0b('0x30')](_0x348392[_0xac0b('0x31')],_0x348392[_0xac0b('0x2e')]);_0x25a22e['attributes']=_['intersection'](_0x348392['model'],qs['fields'](_0x57b5eb[_0xac0b('0x2e')][_0xac0b('0x32')]));_0x25a22e[_0xac0b('0x33')]=_0x25a22e['attributes'][_0xac0b('0x34')]?_0x25a22e[_0xac0b('0x33')]:_0x348392[_0xac0b('0x31')];if(!_0x57b5eb[_0xac0b('0x2e')][_0xac0b('0x35')]('nolimit')){_0x25a22e[_0xac0b('0x1c')]=qs[_0xac0b('0x1c')](_0x57b5eb[_0xac0b('0x2e')][_0xac0b('0x1c')]);_0x25a22e['offset']=qs['offset'](_0x57b5eb[_0xac0b('0x2e')][_0xac0b('0x1b')]);}_0x25a22e[_0xac0b('0x36')]=qs[_0xac0b('0x37')](_0x57b5eb[_0xac0b('0x2e')][_0xac0b('0x37')]);_0x25a22e[_0xac0b('0x38')]=qs[_0xac0b('0x2f')](_['pick'](_0x57b5eb[_0xac0b('0x2e')],_0x348392['filters']),_0x4701b5);if(_0x57b5eb['query']['filter']){_0x25a22e[_0xac0b('0x38')]=_['merge'](_0x25a22e[_0xac0b('0x38')],{'$or':_['map'](_0x4701b5,function(_0x3c04ba){if(_0x3c04ba[_0xac0b('0x39')]!==_0xac0b('0x3a')){var _0x405c37={};_0x405c37[_0x3c04ba['name']]={'$like':'%'+_0x57b5eb[_0xac0b('0x2e')][_0xac0b('0x3b')]+'%'};return _0x405c37;}})});}_0x25a22e=_[_0xac0b('0x3c')]({},_0x25a22e,_0x57b5eb[_0xac0b('0x3d')]);var _0xc23ce7={'where':_0x25a22e[_0xac0b('0x38')]};return db[_0xac0b('0x2a')]['count'](_0xc23ce7)[_0xac0b('0x24')](function(_0x243a0c){_0x7a329c[_0xac0b('0x1d')]=_0x243a0c;if(_0x57b5eb['query'][_0xac0b('0x3e')]){_0x25a22e[_0xac0b('0x3f')]=[{'all':!![]}];}return db[_0xac0b('0x2a')][_0xac0b('0x40')](_0x25a22e);})['then'](function(_0x4af43f){_0x7a329c[_0xac0b('0x41')]=_0x4af43f;return _0x7a329c;})[_0xac0b('0x24')](respondWithFilteredResult(_0x3aac9c,_0x25a22e))[_0xac0b('0x42')](handleError(_0x3aac9c,null));};exports['show']=function(_0x5210bd,_0x507779){var _0x2d3cd2={'raw':!![],'where':{'id':_0x5210bd[_0xac0b('0x43')]['id']}},_0x3ca2cb={};_0x3ca2cb[_0xac0b('0x31')]=_['keys'](db[_0xac0b('0x2a')]['rawAttributes']);_0x3ca2cb[_0xac0b('0x2e')]=_['keys'](_0x5210bd[_0xac0b('0x2e')]);_0x3ca2cb[_0xac0b('0x2f')]=_[_0xac0b('0x30')](_0x3ca2cb[_0xac0b('0x31')],_0x3ca2cb[_0xac0b('0x2e')]);_0x2d3cd2[_0xac0b('0x33')]=_[_0xac0b('0x30')](_0x3ca2cb[_0xac0b('0x31')],qs[_0xac0b('0x32')](_0x5210bd[_0xac0b('0x2e')][_0xac0b('0x32')]));_0x2d3cd2['attributes']=_0x2d3cd2[_0xac0b('0x33')][_0xac0b('0x34')]?_0x2d3cd2[_0xac0b('0x33')]:_0x3ca2cb[_0xac0b('0x31')];if(_0x5210bd[_0xac0b('0x2e')][_0xac0b('0x3e')]){_0x2d3cd2[_0xac0b('0x3f')]=[{'all':!![]}];}_0x2d3cd2=_[_0xac0b('0x3c')]({},_0x2d3cd2,_0x5210bd[_0xac0b('0x3d')]);return db[_0xac0b('0x2a')][_0xac0b('0x44')](_0x2d3cd2)[_0xac0b('0x24')](handleEntityNotFound(_0x507779,null))[_0xac0b('0x24')](respondWithResult(_0x507779,null))[_0xac0b('0x42')](handleError(_0x507779,null));};exports[_0xac0b('0x45')]=function(_0x4f50af,_0x31353c){return db[_0xac0b('0x2a')][_0xac0b('0x45')](_0x4f50af[_0xac0b('0x46')],{})[_0xac0b('0x24')](respondWithResult(_0x31353c,0xc9))['catch'](handleError(_0x31353c,null));};exports[_0xac0b('0x23')]=function(_0x80147b,_0x4e79b1){if(_0x80147b[_0xac0b('0x46')]['id']){delete _0x80147b[_0xac0b('0x46')]['id'];}return db[_0xac0b('0x2a')][_0xac0b('0x44')]({'where':{'id':_0x80147b[_0xac0b('0x43')]['id']}})[_0xac0b('0x24')](handleEntityNotFound(_0x4e79b1,null))['then'](saveUpdates(_0x80147b[_0xac0b('0x46')],null))['then'](respondWithResult(_0x4e79b1,null))[_0xac0b('0x42')](handleError(_0x4e79b1,null));};exports[_0xac0b('0x47')]=function(_0x5e91d7,_0x395f90){return db[_0xac0b('0x2a')][_0xac0b('0x44')]({'where':{'id':_0x5e91d7[_0xac0b('0x43')]['id']}})[_0xac0b('0x24')](handleEntityNotFound(_0x395f90,null))['then'](removeEntity(_0x395f90,null))[_0xac0b('0x42')](handleError(_0x395f90,null));};exports[_0xac0b('0x48')]=function(_0x3bf489,_0x16d2d6){return db[_0xac0b('0x2a')]['describe']()['then'](respondWithResult(_0x16d2d6,null))[_0xac0b('0x42')](handleError(_0x16d2d6,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index c167066..dc53f02 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 _0x0dc3=['path','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xe7281f,_0x2d77c3){var _0x90dc99=function(_0x1e335b){while(--_0x1e335b){_0xe7281f['push'](_0xe7281f['shift']());}};_0x90dc99(++_0x2d77c3);}(_0x0dc3,0x192));var _0x30dc=function(_0x2ee790,_0x5a8661){_0x2ee790=_0x2ee790-0x0;var _0x5a54a5=_0x0dc3[_0x2ee790];return _0x5a54a5;};'use strict';var _=require(_0x30dc('0x0'));var util=require(_0x30dc('0x1'));var logger=require(_0x30dc('0x2'))(_0x30dc('0x3'));var moment=require('moment');var BPromise=require(_0x30dc('0x4'));var rp=require(_0x30dc('0x5'));var fs=require('fs');var path=require(_0x30dc('0x6'));var rimraf=require('rimraf');var config=require(_0x30dc('0x7'));var attributes=require(_0x30dc('0x8'));module[_0x30dc('0x9')]=function(_0x32cbb8,_0x504e51){return _0x32cbb8[_0x30dc('0xa')](_0x30dc('0xb'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfee1=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','define','lodash','util'];(function(_0x359cfe,_0x1378ec){var _0x3cfcc5=function(_0x48bc91){while(--_0x48bc91){_0x359cfe['push'](_0x359cfe['shift']());}};_0x3cfcc5(++_0x1378ec);}(_0xfee1,0xda));var _0x1fee=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfee1[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1fee('0x0'));var util=require(_0x1fee('0x1'));var logger=require(_0x1fee('0x2'))(_0x1fee('0x3'));var moment=require(_0x1fee('0x4'));var BPromise=require('bluebird');var rp=require(_0x1fee('0x5'));var fs=require('fs');var path=require(_0x1fee('0x6'));var rimraf=require(_0x1fee('0x7'));var config=require(_0x1fee('0x8'));var attributes=require(_0x1fee('0x9'));module['exports']=function(_0x22bc10,_0x197fc7){return _0x22bc10[_0x1fee('0xa')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 1679475..1875802 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 _0x0b5c=['options','raw','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceTransferReport','create','body'];(function(_0x20878b,_0x46af56){var _0xa3e9c0=function(_0xd42539){while(--_0xd42539){_0x20878b['push'](_0x20878b['shift']());}};_0xa3e9c0(++_0x46af56);}(_0x0b5c,0x99));var _0xc0b5=function(_0x2cb467,_0x585170){_0x2cb467=_0x2cb467-0x0;var _0x5416c4=_0x0b5c[_0x2cb467];return _0x5416c4;};'use strict';var _=require(_0xc0b5('0x0'));var util=require(_0xc0b5('0x1'));var moment=require(_0xc0b5('0x2'));var BPromise=require('bluebird');var rs=require(_0xc0b5('0x3'));var fs=require('fs');var Redis=require(_0xc0b5('0x4'));var db=require(_0xc0b5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc0b5('0x6'))(_0xc0b5('0x7'));var config=require(_0xc0b5('0x8'));var jayson=require(_0xc0b5('0x9'));var client=jayson[_0xc0b5('0xa')][_0xc0b5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b2201,_0x19123e,_0x35506b){return new BPromise(function(_0x2cc3d1,_0x25abca){return client[_0xc0b5('0xc')](_0x4b2201,_0x35506b)[_0xc0b5('0xd')](function(_0x302682){logger[_0xc0b5('0xe')](_0xc0b5('0xf'),_0x19123e,_0xc0b5('0x10'));logger[_0xc0b5('0x11')](_0xc0b5('0x12'),_0x19123e,'request\x20sent',JSON['stringify'](_0x302682));if(_0x302682[_0xc0b5('0x13')]){if(_0x302682[_0xc0b5('0x13')][_0xc0b5('0x14')]===0x1f4){logger['error'](_0xc0b5('0xf'),_0x19123e,_0x302682[_0xc0b5('0x13')][_0xc0b5('0x15')]);return _0x25abca(_0x302682['error'][_0xc0b5('0x15')]);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x19123e,_0x302682[_0xc0b5('0x13')][_0xc0b5('0x15')]);return _0x2cc3d1(_0x302682[_0xc0b5('0x13')][_0xc0b5('0x15')]);}else{logger[_0xc0b5('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x19123e,_0xc0b5('0x10'));_0x2cc3d1(_0x302682[_0xc0b5('0x16')][_0xc0b5('0x15')]);}})[_0xc0b5('0x17')](function(_0x333c0c){logger[_0xc0b5('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x19123e,_0x333c0c);_0x25abca(_0x333c0c);});});}exports[_0xc0b5('0x18')]=function(_0x1c4853){var _0x3c44ee=this;return new Promise(function(_0x4480a0,_0x5c69e9){return db['VoiceTransferReport'][_0xc0b5('0x19')](_0x1c4853[_0xc0b5('0x1a')],{'raw':_0x1c4853['options']?_0x1c4853[_0xc0b5('0x1b')][_0xc0b5('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2a679a){logger[_0xc0b5('0xe')](_0xc0b5('0x18'),_0x1c4853);logger[_0xc0b5('0x11')](_0xc0b5('0x18'),_0x1c4853,JSON[_0xc0b5('0x1d')](_0x2a679a));_0x4480a0(_0x2a679a);})['catch'](function(_0x22b687){logger['error']('CreateVoiceTransferReport',_0x22b687[_0xc0b5('0x15')],_0x1c4853);_0x5c69e9(_0x3c44ee[_0xc0b5('0x13')](0x1f4,_0x22b687[_0xc0b5('0x15')]));});});}; \ No newline at end of file +var _0x9cff=['stringify','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','code','error','VoiceTransferReport,\x20%s,\x20%s','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','then'];(function(_0x27def7,_0x3f0835){var _0x581cbc=function(_0x5b8ae4){while(--_0x5b8ae4){_0x27def7['push'](_0x27def7['shift']());}};_0x581cbc(++_0x3f0835);}(_0x9cff,0x1e2));var _0xf9cf=function(_0xfd4894,_0x30e841){_0xfd4894=_0xfd4894-0x0;var _0x5c08d3=_0x9cff[_0xfd4894];return _0x5c08d3;};'use strict';var _=require(_0xf9cf('0x0'));var util=require(_0xf9cf('0x1'));var moment=require('moment');var BPromise=require(_0xf9cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9cf('0x3'));var db=require(_0xf9cf('0x4'))['db'];var utils=require(_0xf9cf('0x5'));var logger=require(_0xf9cf('0x6'))(_0xf9cf('0x7'));var config=require(_0xf9cf('0x8'));var jayson=require(_0xf9cf('0x9'));var client=jayson[_0xf9cf('0xa')][_0xf9cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d919,_0x2c39a1,_0x696103){return new BPromise(function(_0x3b0020,_0x5048f7){return client[_0xf9cf('0xc')](_0x4d919,_0x696103)['then'](function(_0x29e169){logger[_0xf9cf('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x2c39a1,_0xf9cf('0xe'));logger[_0xf9cf('0xf')](_0xf9cf('0x10'),_0x2c39a1,'request\x20sent',JSON['stringify'](_0x29e169));if(_0x29e169['error']){if(_0x29e169['error'][_0xf9cf('0x11')]===0x1f4){logger[_0xf9cf('0x12')](_0xf9cf('0x13'),_0x2c39a1,_0x29e169[_0xf9cf('0x12')][_0xf9cf('0x14')]);return _0x5048f7(_0x29e169[_0xf9cf('0x12')][_0xf9cf('0x14')]);}logger['error'](_0xf9cf('0x13'),_0x2c39a1,_0x29e169[_0xf9cf('0x12')][_0xf9cf('0x14')]);return _0x3b0020(_0x29e169[_0xf9cf('0x12')][_0xf9cf('0x14')]);}else{logger['info'](_0xf9cf('0x13'),_0x2c39a1,_0xf9cf('0xe'));_0x3b0020(_0x29e169[_0xf9cf('0x15')][_0xf9cf('0x14')]);}})['catch'](function(_0x43f9b0){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x2c39a1,_0x43f9b0);_0x5048f7(_0x43f9b0);});});}exports[_0xf9cf('0x16')]=function(_0x4ce381){var _0x440e78=this;return new Promise(function(_0x7ed633,_0x3bdd1b){return db[_0xf9cf('0x17')][_0xf9cf('0x18')](_0x4ce381['body'],{'raw':_0x4ce381[_0xf9cf('0x19')]?_0x4ce381['options'][_0xf9cf('0x1a')]===undefined?!![]:![]:!![]})[_0xf9cf('0x1b')](function(_0x136ebe){logger[_0xf9cf('0xd')]('CreateVoiceTransferReport',_0x4ce381);logger[_0xf9cf('0xf')](_0xf9cf('0x16'),_0x4ce381,JSON[_0xf9cf('0x1c')](_0x136ebe));_0x7ed633(_0x136ebe);})[_0xf9cf('0x1d')](function(_0x4751e0){logger['error'](_0xf9cf('0x16'),_0x4751e0[_0xf9cf('0x14')],_0x4ce381);_0x3bdd1b(_0x440e78[_0xf9cf('0x12')](0x1f4,_0x4751e0['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 0d1be8e..1ac5b0b 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 _0xf4eb=['/hangup','isAuthenticated','isWebrtcLicence','hangup','/hold','hold','/unhold','unhold','/calls','calls','transfer','exports','express','/originate','originate','post'];(function(_0x595df3,_0x4e4078){var _0x2a3785=function(_0x3df1c8){while(--_0x3df1c8){_0x595df3['push'](_0x595df3['shift']());}};_0x2a3785(++_0x4e4078);}(_0xf4eb,0xec));var _0xbf4e=function(_0x799f7d,_0x15fae5){_0x799f7d=_0x799f7d-0x0;var _0x431355=_0xf4eb[_0x799f7d];return _0x431355;};'use strict';var express=require(_0xbf4e('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router['post'](_0xbf4e('0x1'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbf4e('0x2')]);router[_0xbf4e('0x3')](_0xbf4e('0x4'),auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x3')]('/answer',auth[_0xbf4e('0x5')](),auth['isWebrtcLicence'](),controller['answer']);router[_0xbf4e('0x3')](_0xbf4e('0x8'),auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x3')](_0xbf4e('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbf4e('0xb')]);router['post'](_0xbf4e('0xc'),auth[_0xbf4e('0x5')](),auth['isWebrtcLicence'](),controller[_0xbf4e('0xd')]);router['post']('/transfer',auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xe')]);module[_0xbf4e('0xf')]=router; \ No newline at end of file +var _0x008c=['/transfer','transfer','express','Router','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','/calls','calls'];(function(_0x12ba93,_0x3a910f){var _0x6bcadd=function(_0x46cd02){while(--_0x46cd02){_0x12ba93['push'](_0x12ba93['shift']());}};_0x6bcadd(++_0x3a910f);}(_0x008c,0x188));var _0xc008=function(_0x28fca4,_0x11e78b){_0x28fca4=_0x28fca4-0x0;var _0x42fd01=_0x008c[_0x28fca4];return _0x42fd01;};'use strict';var express=require(_0xc008('0x0'));var router=express[_0xc008('0x1')]();var auth=require(_0xc008('0x2'));var controller=require(_0xc008('0x3'));router[_0xc008('0x4')]('/originate',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0x7')]);router[_0xc008('0x4')](_0xc008('0x8'),auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0x9')]);router[_0xc008('0x4')]('/answer',auth[_0xc008('0x5')](),auth['isWebrtcLicence'](),controller[_0xc008('0xa')]);router['post']('/hold',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller['hold']);router['post']('/unhold',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller['unhold']);router[_0xc008('0x4')](_0xc008('0xb'),auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0xc')]);router[_0xc008('0x4')](_0xc008('0xd'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xc008('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 394ffc9..aa1d9fe 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 _0x34e8=['path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','defaults','localhost','socket.io-emitter','redis','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','handleError:','error','stack','name','status','send','request','then','message','result','catch','User','agent','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','hangup','hangup\x20fired:','user:%s','hangup\x20executed!','answer\x20fired:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','calls','calls\x20fired:','all','conference','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!'];(function(_0x2d0f9f,_0x5e62d3){var _0x68047d=function(_0x4f3534){while(--_0x4f3534){_0x2d0f9f['push'](_0x2d0f9f['shift']());}};_0x68047d(++_0x5e62d3);}(_0x34e8,0x12c));var _0x834e=function(_0x2f88dd,_0x550700){_0x2f88dd=_0x2f88dd-0x0;var _0x5cdcbd=_0x34e8[_0x2f88dd];return _0x5cdcbd;};'use strict';var path=require(_0x834e('0x0'));var fs=require('fs');var _=require(_0x834e('0x1'));var db=require(_0x834e('0x2'))['db'];var config=require(_0x834e('0x3'));var util=require('util');var BPromise=require(_0x834e('0x4'));var jayson=require(_0x834e('0x5'));var amiClient=jayson[_0x834e('0x6')][_0x834e('0x7')]({'port':0x232a});var logger=require(_0x834e('0x8'))(_0x834e('0x9'));var Redis=require(_0x834e('0xa'));config['redis']=_[_0x834e('0xb')](config['redis'],{'host':_0x834e('0xc'),'port':0x18eb});var io=require(_0x834e('0xd'))(new Redis(config[_0x834e('0xe')]));var Schema=require(_0x834e('0xf'));var originateValidation=new Schema({'userId':{'type':_0x834e('0x10'),'required':[!![],_0x834e('0x11')]},'callNumber':{'type':_0x834e('0x12'),'required':[!![],_0x834e('0x13')]},'callerId':{'type':_0x834e('0x12')},'callbackUrl':{'type':_0x834e('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0x834e('0x10'),'required':[!![],_0x834e('0x11')]},'sessionId':{'type':_0x834e('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x834e('0x10'),'required':[!![],_0x834e('0x11')]},'sessionId':{'type':_0x834e('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x834e('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x834e('0x12'),'required':[!![],_0x834e('0x14')]},'transferNumber':{'type':'string','required':[!![],_0x834e('0x15')]}});var holdValidation=new Schema({'userId':{'type':_0x834e('0x10'),'required':[!![],_0x834e('0x11')]},'sessionId':{'type':_0x834e('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x834e('0x11')]},'sessionId':{'type':_0x834e('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x834e('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x834e('0x11')]}});function emit(_0x36d443,_0x478afe,_0x43ac41){logger[_0x834e('0x16')](_0x36d443,_0x478afe,JSON[_0x834e('0x17')](_0x43ac41));io['to'](_0x36d443)['emit'](_0x478afe,_0x43ac41);}function handleError(_0x283e56){return function(_0x211e9a){console[_0x834e('0x18')](_0x834e('0x19'),_0x211e9a,_0x211e9a instanceof RangeError);logger[_0x834e('0x1a')](_0x211e9a[_0x834e('0x1b')]);if(_0x211e9a instanceof RangeError){if(_0x211e9a[_0x834e('0x1c')]){delete _0x211e9a['name'];}_0x283e56[_0x834e('0x1d')](0x194)[_0x834e('0x1e')](_0x211e9a);}else{if(_0x211e9a[_0x834e('0x1c')]){delete _0x211e9a[_0x834e('0x1c')];}_0x283e56['status'](0x1f4)[_0x834e('0x1e')](_0x211e9a);}};}function checkError(){return function(_0x62f8f1){if(!_0x62f8f1){throw new RangeError('NotFound');}return _0x62f8f1;};}function respondWithRpcPromise(_0x1b4bdf,_0x28d687){return new BPromise(function(_0x8d406e,_0x5c55ca){var _0x4e3f48=amiClient;return _0x4e3f48[_0x834e('0x1f')](_0x1b4bdf,_0x28d687)[_0x834e('0x20')](function(_0x589dde){if(_0x589dde[_0x834e('0x1a')]){if(_0x589dde[_0x834e('0x1a')]['code']===0x1f4){return _0x5c55ca(_0x589dde[_0x834e('0x1a')][_0x834e('0x21')]);}return _0x8d406e(_0x589dde[_0x834e('0x1a')]['message']);}else{_0x8d406e(_0x589dde[_0x834e('0x22')]);}})[_0x834e('0x23')](function(_0x5e1cc5){_0x5c55ca(_0x5e1cc5);});});}function getAgent(_0x5bef62){return db[_0x834e('0x24')]['findOne']({'where':{'id':_0x5bef62,'role':_0x834e('0x25')}})[_0x834e('0x20')](checkError());}function getAgentCheckSession(_0x3db026,_0x2cc2eb){return new BPromise(function(_0x3cd928,_0x130cc5){var _0x491919=respondWithRpcPromise('VoiceChannels');var _0x4dc64a=getAgent(_0x3db026);Promise['all']([_0x491919,_0x4dc64a])[_0x834e('0x20')](function(_0x567cea){var _0x106d6a=_0x567cea[0x0];var _0x5dacc1=_0x567cea[0x1];var _0xb5bc06=_[_0x834e('0x26')](_0x106d6a[_0x834e('0x27')],function(_0x1e026a){return _0x1e026a[_0x834e('0x28')]==_0x5dacc1['id']&&_0x1e026a[_0x834e('0x29')]==_0x2cc2eb;});if(_0xb5bc06[_0x834e('0x2a')]==0x1){_0x3cd928(_0x5dacc1);}else{_0x130cc5(new RangeError(_0x834e('0x2b')+_0x2cc2eb+_0x834e('0x2c')));}});});}exports['originate']=function(_0xef9ec2,_0x5cad11){logger[_0x834e('0x16')](_0x834e('0x2d'),_0xef9ec2[_0x834e('0x2e')]);var _0x2b3418=originateValidation[_0x834e('0xf')](_0xef9ec2[_0x834e('0x2e')]);if(_0x2b3418[_0x834e('0x2a')]>0x0){return _0x5cad11[_0x834e('0x1d')](0x190)[_0x834e('0x2f')](_0x2b3418);}var _0x12b2bc=_0xef9ec2['body'][_0x834e('0x30')];var _0x2f408a=_0xef9ec2[_0x834e('0x2e')][_0x834e('0x31')];var _0x595cc0=_0xef9ec2[_0x834e('0x2e')][_0x834e('0x32')];var _0x4b12f5=_0xef9ec2['body']['callbackUrl'];return getAgent(_0x12b2bc)[_0x834e('0x20')](function(_0x41bf4d){logger[_0x834e('0x16')](_0x834e('0x33'),_0x41bf4d[_0x834e('0x1c')]);emit(util[_0x834e('0x34')]('user:%s',_0x41bf4d[_0x834e('0x1c')]),'webbar:originate',{'callNumber':_0x2f408a,'callerId':_0x595cc0,'callbackUrl':_0x4b12f5});return _0x5cad11[_0x834e('0x1d')](0xc8)[_0x834e('0x2f')]({'error':![],'message':'originate\x20executed!'});})[_0x834e('0x23')](handleError(_0x5cad11));};exports[_0x834e('0x35')]=function(_0x491c28,_0x481f70){logger[_0x834e('0x16')](_0x834e('0x36'),_0x491c28[_0x834e('0x2e')]);var _0x130c23=hangupValidation[_0x834e('0xf')](_0x491c28['body']);if(_0x130c23[_0x834e('0x2a')]>0x0){return _0x481f70['status'](0x190)['json'](_0x130c23);}var _0x1b2edf=_0x491c28['body'][_0x834e('0x30')];var _0x1ba66d=_0x491c28[_0x834e('0x2e')][_0x834e('0x29')];return getAgent(_0x1b2edf)[_0x834e('0x20')](function(_0x574ea8){logger[_0x834e('0x16')](_0x834e('0x33'),_0x574ea8[_0x834e('0x1c')]);emit(util['format'](_0x834e('0x37'),_0x574ea8[_0x834e('0x1c')]),'webbar:hangup',{'sessionId':_0x1ba66d});return _0x481f70[_0x834e('0x1d')](0xc8)['json']({'error':![],'message':_0x834e('0x38')});})[_0x834e('0x23')](handleError(_0x481f70));};exports['answer']=function(_0x4a6942,_0x22ea21){logger[_0x834e('0x16')](_0x834e('0x39'),_0x4a6942[_0x834e('0x2e')]);var _0x8ad264=answerValidation[_0x834e('0xf')](_0x4a6942[_0x834e('0x2e')]);if(_0x8ad264['length']>0x0){return _0x22ea21[_0x834e('0x1d')](0x190)['json'](_0x8ad264);}var _0x321efa=_0x4a6942['body'][_0x834e('0x30')];var _0x5a5807=_0x4a6942[_0x834e('0x2e')][_0x834e('0x29')];return getAgent(_0x321efa)['then'](function(_0x39e7b9){logger[_0x834e('0x16')](_0x834e('0x33'),_0x39e7b9[_0x834e('0x1c')]);emit(util[_0x834e('0x34')](_0x834e('0x37'),_0x39e7b9[_0x834e('0x1c')]),_0x834e('0x3a'),{'sessionId':_0x5a5807});return _0x22ea21[_0x834e('0x1d')](0xc8)[_0x834e('0x2f')]({'error':![],'message':'answer\x20executed!'});})[_0x834e('0x23')](handleError(_0x22ea21));};exports[_0x834e('0x3b')]=function(_0x47a8a9,_0x112306){logger[_0x834e('0x16')](_0x834e('0x3c'),_0x47a8a9[_0x834e('0x2e')]);var _0x19b5ef=holdValidation[_0x834e('0xf')](_0x47a8a9['body']);if(_0x19b5ef['length']>0x0){return _0x112306[_0x834e('0x1d')](0x190)[_0x834e('0x2f')](_0x19b5ef);}var _0x30568e=_0x47a8a9[_0x834e('0x2e')][_0x834e('0x30')];var _0xd1d83b=_0x47a8a9[_0x834e('0x2e')][_0x834e('0x29')];return getAgent(_0x30568e)[_0x834e('0x20')](function(_0x390c45){logger[_0x834e('0x16')](_0x834e('0x33'),_0x390c45[_0x834e('0x1c')]);emit(util[_0x834e('0x34')](_0x834e('0x37'),_0x390c45[_0x834e('0x1c')]),_0x834e('0x3d'),{'sessionId':_0xd1d83b});return _0x112306[_0x834e('0x1d')](0xc8)[_0x834e('0x2f')]({'error':![],'message':_0x834e('0x3e')});})['catch'](handleError(_0x112306));};exports[_0x834e('0x3f')]=function(_0x1f08b9,_0x4e73e0){logger[_0x834e('0x16')](_0x834e('0x40'),_0x1f08b9['body']);var _0x3dcca3=unholdValidation[_0x834e('0xf')](_0x1f08b9[_0x834e('0x2e')]);if(_0x3dcca3[_0x834e('0x2a')]>0x0){return _0x4e73e0[_0x834e('0x1d')](0x190)[_0x834e('0x2f')](_0x3dcca3);}var _0x4549ba=_0x1f08b9['body'][_0x834e('0x30')];var _0x8bc6c6=_0x1f08b9[_0x834e('0x2e')][_0x834e('0x29')];return getAgent(_0x4549ba)[_0x834e('0x20')](function(_0x396bbe){logger[_0x834e('0x16')](_0x834e('0x33'),_0x396bbe['name']);emit(util[_0x834e('0x34')]('user:%s',_0x396bbe[_0x834e('0x1c')]),'webbar:unhold',{'sessionId':_0x8bc6c6});return _0x4e73e0[_0x834e('0x1d')](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x834e('0x23')](handleError(_0x4e73e0));};exports[_0x834e('0x41')]=function(_0x5291ae,_0x5be43d){logger[_0x834e('0x16')](_0x834e('0x42'),_0x5be43d[_0x834e('0x2e')]);var _0x387365=callsValidation[_0x834e('0xf')](_0x5291ae[_0x834e('0x2e')]);if(_0x387365[_0x834e('0x2a')]>0x0){return _0x5be43d[_0x834e('0x1d')](0x190)['json'](_0x387365);}var _0x142334=_0x5291ae[_0x834e('0x2e')]['userId'];var _0x281342=respondWithRpcPromise('VoiceChannels');var _0x3e58ef=getAgent(_0x142334);return Promise[_0x834e('0x43')]([_0x281342,_0x3e58ef])['then'](function(_0x41ef86){var _0x37ee0e=_0x41ef86[0x0];var _0x2de29a=_0x41ef86[0x1];var _0x25f720=_['filter'](_0x37ee0e[_0x834e('0x27')],function(_0x438f75){return _0x438f75[_0x834e('0x28')]==_0x2de29a['id'];});return _0x5be43d['status'](0xc8)[_0x834e('0x2f')]({'count':_0x25f720[_0x834e('0x2a')],'rows':_0x25f720});})[_0x834e('0x23')](handleError(_0x5be43d));};exports[_0x834e('0x44')]=function(_0x3183c5,_0x125f37){logger[_0x834e('0x16')](_0x834e('0x45'),_0x3183c5[_0x834e('0x2e')]);var _0xfcccd8=conferenceValidation[_0x834e('0xf')](_0x3183c5[_0x834e('0x2e')]);if(_0xfcccd8[_0x834e('0x2a')]>0x0){return _0x125f37[_0x834e('0x1d')](0x190)[_0x834e('0x2f')](_0xfcccd8);}var _0x17b8e3=_0x3183c5[_0x834e('0x2e')][_0x834e('0x30')];return getAgent(_0x17b8e3)[_0x834e('0x20')](function(_0x3e3467){logger[_0x834e('0x16')](_0x834e('0x33'),_0x3e3467['name']);emit(util[_0x834e('0x34')](_0x834e('0x37'),_0x3e3467[_0x834e('0x1c')]),_0x834e('0x46'));return _0x125f37['status'](0xc8)[_0x834e('0x2f')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x125f37));};exports[_0x834e('0x47')]=function(_0x2b1ec7,_0x1644dd){logger[_0x834e('0x16')](_0x834e('0x48'),_0x2b1ec7[_0x834e('0x2e')]);var _0xbb926d=transferValidation[_0x834e('0xf')](_0x2b1ec7['body']);if(_0xbb926d[_0x834e('0x2a')]>0x0){return _0x1644dd['status'](0x190)[_0x834e('0x2f')](_0xbb926d);}var _0xd35dda=_0x2b1ec7['body']['userId'];var _0x4a4def=_0x2b1ec7[_0x834e('0x2e')][_0x834e('0x29')];var _0x2cca07=_0x2b1ec7[_0x834e('0x2e')]['transferNumber'];return getAgent(_0xd35dda)[_0x834e('0x20')](function(_0x15018f){logger[_0x834e('0x16')](_0x834e('0x33'),_0x15018f[_0x834e('0x1c')]);emit(util[_0x834e('0x34')](_0x834e('0x37'),_0x15018f[_0x834e('0x1c')]),_0x834e('0x49'),{'sessionId':_0x4a4def,'transferNumber':_0x2cca07});return _0x1644dd[_0x834e('0x1d')](0xc8)['json']({'error':![],'message':_0x834e('0x4a')});})[_0x834e('0x23')](handleError(_0x1644dd));}; \ No newline at end of file +var _0x524a=['webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','conference\x20fired:','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','webbarapi','ioredis','redis','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','catch','User','findOne','VoiceChannels','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','validate','body','callNumber','callerId','callbackUrl','user:%s','originate\x20executed!','json','userId','entityFound:','format','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:'];(function(_0x1d0764,_0x2beb7c){var _0x423f49=function(_0x5334ee){while(--_0x5334ee){_0x1d0764['push'](_0x1d0764['shift']());}};_0x423f49(++_0x2beb7c);}(_0x524a,0xf5));var _0xa524=function(_0x318da9,_0x20193f){_0x318da9=_0x318da9-0x0;var _0x21e4c5=_0x524a[_0x318da9];return _0x21e4c5;};'use strict';var path=require(_0xa524('0x0'));var fs=require('fs');var _=require(_0xa524('0x1'));var db=require(_0xa524('0x2'))['db'];var config=require(_0xa524('0x3'));var util=require('util');var BPromise=require(_0xa524('0x4'));var jayson=require(_0xa524('0x5'));var amiClient=jayson[_0xa524('0x6')]['http']({'port':0x232a});var logger=require('../../config/logger')(_0xa524('0x7'));var Redis=require(_0xa524('0x8'));config[_0xa524('0x9')]=_['defaults'](config[_0xa524('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xa524('0xa'))(new Redis(config[_0xa524('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xa524('0xb'),'required':[!![],_0xa524('0xc')]},'callNumber':{'type':_0xa524('0xd'),'required':[!![],_0xa524('0xe')]},'callerId':{'type':_0xa524('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xa524('0xb'),'required':[!![],_0xa524('0xc')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa524('0xc')]},'sessionId':{'type':_0xa524('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xa524('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],_0xa524('0xf')]},'transferNumber':{'type':'string','required':[!![],_0xa524('0x10')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa524('0xc')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa524('0xb'),'required':[!![],_0xa524('0xc')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa524('0xb'),'required':[!![],_0xa524('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0xa524('0xb'),'required':[!![],_0xa524('0xc')]}});function emit(_0x45347f,_0x433c8a,_0x371385){logger['info'](_0x45347f,_0x433c8a,JSON[_0xa524('0x11')](_0x371385));io['to'](_0x45347f)[_0xa524('0x12')](_0x433c8a,_0x371385);}function handleError(_0x1fd8f5){return function(_0x3d6a0d){console[_0xa524('0x13')](_0xa524('0x14'),_0x3d6a0d,_0x3d6a0d instanceof RangeError);logger[_0xa524('0x15')](_0x3d6a0d[_0xa524('0x16')]);if(_0x3d6a0d instanceof RangeError){if(_0x3d6a0d['name']){delete _0x3d6a0d[_0xa524('0x17')];}_0x1fd8f5[_0xa524('0x18')](0x194)[_0xa524('0x19')](_0x3d6a0d);}else{if(_0x3d6a0d[_0xa524('0x17')]){delete _0x3d6a0d['name'];}_0x1fd8f5['status'](0x1f4)[_0xa524('0x19')](_0x3d6a0d);}};}function checkError(){return function(_0xc560dd){if(!_0xc560dd){throw new RangeError(_0xa524('0x1a'));}return _0xc560dd;};}function respondWithRpcPromise(_0x1093cc,_0x1e6abb){return new BPromise(function(_0x3866e2,_0x4abffe){var _0x262eac=amiClient;return _0x262eac[_0xa524('0x1b')](_0x1093cc,_0x1e6abb)[_0xa524('0x1c')](function(_0x40fb4b){if(_0x40fb4b[_0xa524('0x15')]){if(_0x40fb4b[_0xa524('0x15')][_0xa524('0x1d')]===0x1f4){return _0x4abffe(_0x40fb4b['error'][_0xa524('0x1e')]);}return _0x3866e2(_0x40fb4b[_0xa524('0x15')]['message']);}else{_0x3866e2(_0x40fb4b['result']);}})[_0xa524('0x1f')](function(_0x2ed3b0){_0x4abffe(_0x2ed3b0);});});}function getAgent(_0x156b8b){return db[_0xa524('0x20')][_0xa524('0x21')]({'where':{'id':_0x156b8b,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x1aeabc,_0x869b22){return new BPromise(function(_0x1582fa,_0x9e9e5e){var _0x505c42=respondWithRpcPromise(_0xa524('0x22'));var _0x32ba03=getAgent(_0x1aeabc);Promise['all']([_0x505c42,_0x32ba03])[_0xa524('0x1c')](function(_0x147094){var _0x4c587b=_0x147094[0x0];var _0x393813=_0x147094[0x1];var _0x5f03ad=_[_0xa524('0x23')](_0x4c587b[_0xa524('0x24')],function(_0x45b846){return _0x45b846[_0xa524('0x25')]==_0x393813['id']&&_0x45b846[_0xa524('0x26')]==_0x869b22;});if(_0x5f03ad[_0xa524('0x27')]==0x1){_0x1582fa(_0x393813);}else{_0x9e9e5e(new RangeError(_0xa524('0x28')+_0x869b22+_0xa524('0x29')));}});});}exports[_0xa524('0x2a')]=function(_0x5b6a54,_0x535e41){logger[_0xa524('0x2b')]('originate\x20fired:',_0x5b6a54['body']);var _0x46af1b=originateValidation[_0xa524('0x2c')](_0x5b6a54[_0xa524('0x2d')]);if(_0x46af1b[_0xa524('0x27')]>0x0){return _0x535e41['status'](0x190)['json'](_0x46af1b);}var _0x1facef=_0x5b6a54['body']['userId'];var _0x268341=_0x5b6a54[_0xa524('0x2d')][_0xa524('0x2e')];var _0x35086a=_0x5b6a54[_0xa524('0x2d')][_0xa524('0x2f')];var _0x9bb038=_0x5b6a54[_0xa524('0x2d')][_0xa524('0x30')];return getAgent(_0x1facef)[_0xa524('0x1c')](function(_0xc7b408){logger[_0xa524('0x2b')]('entityFound:',_0xc7b408['name']);emit(util['format'](_0xa524('0x31'),_0xc7b408[_0xa524('0x17')]),'webbar:originate',{'callNumber':_0x268341,'callerId':_0x35086a,'callbackUrl':_0x9bb038});return _0x535e41[_0xa524('0x18')](0xc8)['json']({'error':![],'message':_0xa524('0x32')});})[_0xa524('0x1f')](handleError(_0x535e41));};exports['hangup']=function(_0x208822,_0x259532){logger[_0xa524('0x2b')]('hangup\x20fired:',_0x208822[_0xa524('0x2d')]);var _0x268930=hangupValidation['validate'](_0x208822[_0xa524('0x2d')]);if(_0x268930[_0xa524('0x27')]>0x0){return _0x259532['status'](0x190)[_0xa524('0x33')](_0x268930);}var _0x31d21d=_0x208822['body'][_0xa524('0x34')];var _0x462af9=_0x208822[_0xa524('0x2d')][_0xa524('0x26')];return getAgent(_0x31d21d)[_0xa524('0x1c')](function(_0x38f87a){logger[_0xa524('0x2b')](_0xa524('0x35'),_0x38f87a[_0xa524('0x17')]);emit(util[_0xa524('0x36')](_0xa524('0x31'),_0x38f87a['name']),_0xa524('0x37'),{'sessionId':_0x462af9});return _0x259532['status'](0xc8)[_0xa524('0x33')]({'error':![],'message':_0xa524('0x38')});})[_0xa524('0x1f')](handleError(_0x259532));};exports[_0xa524('0x39')]=function(_0x33068e,_0x3ba597){logger[_0xa524('0x2b')](_0xa524('0x3a'),_0x33068e[_0xa524('0x2d')]);var _0x2dc240=answerValidation['validate'](_0x33068e[_0xa524('0x2d')]);if(_0x2dc240[_0xa524('0x27')]>0x0){return _0x3ba597['status'](0x190)[_0xa524('0x33')](_0x2dc240);}var _0x3f5564=_0x33068e['body']['userId'];var _0x4dff4b=_0x33068e['body']['sessionId'];return getAgent(_0x3f5564)[_0xa524('0x1c')](function(_0x2cf0f5){logger[_0xa524('0x2b')](_0xa524('0x35'),_0x2cf0f5['name']);emit(util[_0xa524('0x36')](_0xa524('0x31'),_0x2cf0f5[_0xa524('0x17')]),_0xa524('0x3b'),{'sessionId':_0x4dff4b});return _0x3ba597['status'](0xc8)[_0xa524('0x33')]({'error':![],'message':_0xa524('0x3c')});})[_0xa524('0x1f')](handleError(_0x3ba597));};exports[_0xa524('0x3d')]=function(_0x239c77,_0x4b5eed){logger[_0xa524('0x2b')](_0xa524('0x3e'),_0x239c77[_0xa524('0x2d')]);var _0x150428=holdValidation[_0xa524('0x2c')](_0x239c77[_0xa524('0x2d')]);if(_0x150428[_0xa524('0x27')]>0x0){return _0x4b5eed[_0xa524('0x18')](0x190)[_0xa524('0x33')](_0x150428);}var _0x4cee61=_0x239c77['body'][_0xa524('0x34')];var _0x26096a=_0x239c77[_0xa524('0x2d')][_0xa524('0x26')];return getAgent(_0x4cee61)[_0xa524('0x1c')](function(_0xddc80){logger['info'](_0xa524('0x35'),_0xddc80[_0xa524('0x17')]);emit(util[_0xa524('0x36')](_0xa524('0x31'),_0xddc80[_0xa524('0x17')]),_0xa524('0x3f'),{'sessionId':_0x26096a});return _0x4b5eed['status'](0xc8)[_0xa524('0x33')]({'error':![],'message':_0xa524('0x40')});})[_0xa524('0x1f')](handleError(_0x4b5eed));};exports[_0xa524('0x41')]=function(_0x25ffbd,_0x244efa){logger[_0xa524('0x2b')](_0xa524('0x42'),_0x25ffbd[_0xa524('0x2d')]);var _0x217314=unholdValidation[_0xa524('0x2c')](_0x25ffbd[_0xa524('0x2d')]);if(_0x217314[_0xa524('0x27')]>0x0){return _0x244efa[_0xa524('0x18')](0x190)[_0xa524('0x33')](_0x217314);}var _0x5e9919=_0x25ffbd[_0xa524('0x2d')][_0xa524('0x34')];var _0x4eeab2=_0x25ffbd['body'][_0xa524('0x26')];return getAgent(_0x5e9919)[_0xa524('0x1c')](function(_0x2278d2){logger[_0xa524('0x2b')](_0xa524('0x35'),_0x2278d2[_0xa524('0x17')]);emit(util[_0xa524('0x36')]('user:%s',_0x2278d2[_0xa524('0x17')]),_0xa524('0x43'),{'sessionId':_0x4eeab2});return _0x244efa[_0xa524('0x18')](0xc8)[_0xa524('0x33')]({'error':![],'message':_0xa524('0x44')});})['catch'](handleError(_0x244efa));};exports[_0xa524('0x45')]=function(_0x4f7531,_0x205a09){logger[_0xa524('0x2b')](_0xa524('0x46'),_0x205a09[_0xa524('0x2d')]);var _0x161393=callsValidation[_0xa524('0x2c')](_0x4f7531[_0xa524('0x2d')]);if(_0x161393['length']>0x0){return _0x205a09['status'](0x190)[_0xa524('0x33')](_0x161393);}var _0x17b33d=_0x4f7531[_0xa524('0x2d')]['userId'];var _0x2e21f3=respondWithRpcPromise(_0xa524('0x22'));var _0x49a480=getAgent(_0x17b33d);return Promise[_0xa524('0x47')]([_0x2e21f3,_0x49a480])[_0xa524('0x1c')](function(_0x1563ef){var _0x3e841e=_0x1563ef[0x0];var _0x6aad5c=_0x1563ef[0x1];var _0x248ba2=_[_0xa524('0x23')](_0x3e841e['rows'],function(_0xdbda6e){return _0xdbda6e[_0xa524('0x25')]==_0x6aad5c['id'];});return _0x205a09[_0xa524('0x18')](0xc8)[_0xa524('0x33')]({'count':_0x248ba2['length'],'rows':_0x248ba2});})[_0xa524('0x1f')](handleError(_0x205a09));};exports[_0xa524('0x48')]=function(_0x5cd707,_0x1d5df2){logger[_0xa524('0x2b')](_0xa524('0x49'),_0x5cd707[_0xa524('0x2d')]);var _0x541645=conferenceValidation['validate'](_0x5cd707[_0xa524('0x2d')]);if(_0x541645['length']>0x0){return _0x1d5df2['status'](0x190)['json'](_0x541645);}var _0x2e5216=_0x5cd707['body']['userId'];return getAgent(_0x2e5216)[_0xa524('0x1c')](function(_0x3e4255){logger[_0xa524('0x2b')](_0xa524('0x35'),_0x3e4255['name']);emit(util[_0xa524('0x36')](_0xa524('0x31'),_0x3e4255[_0xa524('0x17')]),'webbar:conference');return _0x1d5df2[_0xa524('0x18')](0xc8)[_0xa524('0x33')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x1d5df2));};exports[_0xa524('0x4a')]=function(_0x3e8167,_0x158e1c){logger[_0xa524('0x2b')]('transfer\x20fired:',_0x3e8167['body']);var _0x300bb7=transferValidation[_0xa524('0x2c')](_0x3e8167[_0xa524('0x2d')]);if(_0x300bb7['length']>0x0){return _0x158e1c['status'](0x190)[_0xa524('0x33')](_0x300bb7);}var _0x4a9127=_0x3e8167['body']['userId'];var _0x4f71b1=_0x3e8167[_0xa524('0x2d')][_0xa524('0x26')];var _0x5a5ce4=_0x3e8167['body'][_0xa524('0x4b')];return getAgent(_0x4a9127)[_0xa524('0x1c')](function(_0x50ec48){logger[_0xa524('0x2b')](_0xa524('0x35'),_0x50ec48[_0xa524('0x17')]);emit(util[_0xa524('0x36')](_0xa524('0x31'),_0x50ec48[_0xa524('0x17')]),_0xa524('0x4c'),{'sessionId':_0x4f71b1,'transferNumber':_0x5a5ce4});return _0x158e1c[_0xa524('0x18')](0xc8)[_0xa524('0x33')]({'error':![],'message':_0xa524('0x4d')});})['catch'](handleError(_0x158e1c));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 026a5d7..1c00b4c 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 _0x7096=['removeAgents','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/notify','/:id/send','send','/:id','update','delete','destroy','removeDispositions','removeAnswers'];(function(_0x2e78be,_0x51d282){var _0x3f4962=function(_0x10a0f1){while(--_0x10a0f1){_0x2e78be['push'](_0x2e78be['shift']());}};_0x3f4962(++_0x51d282);}(_0x7096,0x10c));var _0x6709=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x7096[_0x543084];return _0x306a57;};'use strict';var multer=require('multer');var util=require(_0x6709('0x0'));var path=require('path');var timeout=require(_0x6709('0x1'));var express=require('express');var router=express[_0x6709('0x2')]();var fs_extra=require(_0x6709('0x3'));var auth=require(_0x6709('0x4'));var interaction=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var controller=require(_0x6709('0x7'));router[_0x6709('0x8')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xa')]);router[_0x6709('0x8')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0xc')]);router['get']('/:id',auth[_0x6709('0x9')](),controller[_0x6709('0xd')]);router[_0x6709('0x8')](_0x6709('0xe'),auth[_0x6709('0x9')](),controller[_0x6709('0xf')]);router['get']('/:id/canned_answers',auth[_0x6709('0x9')](),controller[_0x6709('0x10')]);router[_0x6709('0x8')](_0x6709('0x11'),auth[_0x6709('0x9')](),controller[_0x6709('0x12')]);router[_0x6709('0x8')](_0x6709('0x13'),auth['isAuthenticated'](),controller[_0x6709('0x14')]);router[_0x6709('0x15')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0x16')]);router['post'](_0x6709('0xe'),auth['isAuthenticated'](),controller[_0x6709('0x17')]);router['post'](_0x6709('0x18'),auth[_0x6709('0x9')](),controller[_0x6709('0x19')]);router[_0x6709('0x15')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x6709('0x15')](_0x6709('0x13'),auth['isAuthenticated'](),controller[_0x6709('0x1a')]);router[_0x6709('0x15')](_0x6709('0x1b'),controller['notify']);router[_0x6709('0x15')](_0x6709('0x1c'),auth[_0x6709('0x9')](),controller[_0x6709('0x1d')]);router['put'](_0x6709('0x1e'),auth[_0x6709('0x9')](),controller[_0x6709('0x1f')]);router[_0x6709('0x20')](_0x6709('0x1e'),auth[_0x6709('0x9')](),controller[_0x6709('0x21')]);router[_0x6709('0x20')](_0x6709('0xe'),auth[_0x6709('0x9')](),controller[_0x6709('0x22')]);router[_0x6709('0x20')]('/:id/canned_answers',auth[_0x6709('0x9')](),controller[_0x6709('0x23')]);router[_0x6709('0x20')]('/:id/users',auth[_0x6709('0x9')](),controller[_0x6709('0x24')]);module[_0x6709('0x25')]=router; \ No newline at end of file +var _0x5f2f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','post','create','addDisposition','/:id/canned_answers','addAnswer','addAgents','addApplications','/:id/notify','notify','send','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x5f2f,0x73));var _0xf5f2=function(_0x538ffd,_0x4a95bc){_0x538ffd=_0x538ffd-0x0;var _0x58c67c=_0x5f2f[_0x538ffd];return _0x58c67c;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/canned_answers',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['get'](_0xf5f2('0x13'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);router[_0xf5f2('0x9')](_0xf5f2('0x15'),auth[_0xf5f2('0xa')](),controller['getApplications']);router[_0xf5f2('0x16')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x17')]);router[_0xf5f2('0x16')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x18')]);router[_0xf5f2('0x16')](_0xf5f2('0x19'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x16')](_0xf5f2('0x13'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1b')]);router[_0xf5f2('0x16')](_0xf5f2('0x15'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x16')](_0xf5f2('0x1d'),controller[_0xf5f2('0x1e')]);router[_0xf5f2('0x16')]('/:id/send',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1f')]);router['put']('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x20')]);router['delete'](_0xf5f2('0xe'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x21')]);router[_0xf5f2('0x22')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x23')]);router[_0xf5f2('0x22')](_0xf5f2('0x19'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x24')]);router['delete']('/:id/users',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x25')]);module[_0xf5f2('0x26')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index a771989..3a8148c 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 _0x82b6=['mandatoryDispositionPauseId','sequelize','randomstring','exports','name','STRING','generate','ENUM','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3eb620,_0x37511b){var _0x4b89ab=function(_0x51e3f4){while(--_0x51e3f4){_0x3eb620['push'](_0x3eb620['shift']());}};_0x4b89ab(++_0x37511b);}(_0x82b6,0x76));var _0x682b=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0x82b6[_0x547456];return _0xc1fd7b;};'use strict';var Sequelize=require(_0x682b('0x0'));var rs=require(_0x682b('0x1'));module[_0x682b('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x682b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x682b('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x682b('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x682b('0x4')],'defaultValue':function(){return rs[_0x682b('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x682b('0x6')]('twilio','sinch')},'accountSid':{'type':Sequelize[_0x682b('0x4')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x682b('0x4')]},'notificationTemplate':{'type':Sequelize[_0x682b('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x682b('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x682b('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x682b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x682b('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x682b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x682b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x682b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x682b('0x9')],'comment':_0x682b('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x682b('0x8')],'defaultValue':![],'comment':_0x682b('0xb'),'set':function(_0x4c13f0){if(!_0x4c13f0){this['setDataValue'](_0x682b('0xc'),null);}this['setDataValue']('mandatoryDisposition',_0x4c13f0);}},'description':{'type':Sequelize[_0x682b('0x4')]}}; \ No newline at end of file +var _0xbd21=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x27a21c,_0x431713){var _0x47bbcf=function(_0x93e08){while(--_0x93e08){_0x27a21c['push'](_0x27a21c['shift']());}};_0x47bbcf(++_0x431713);}(_0xbd21,0x9b));var _0x1bd2=function(_0x159856,_0x54e81b){_0x159856=_0x159856-0x0;var _0x2a17cb=_0xbd21[_0x159856];return _0x2a17cb;};'use strict';var Sequelize=require(_0x1bd2('0x0'));var rs=require(_0x1bd2('0x1'));module['exports']={'name':{'type':Sequelize[_0x1bd2('0x2')],'unique':_0x1bd2('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x1bd2('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x1bd2('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x1bd2('0x2')],'defaultValue':function(){return rs[_0x1bd2('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1bd2('0x5')](_0x1bd2('0x6'),_0x1bd2('0x7'))},'accountSid':{'type':Sequelize[_0x1bd2('0x2')]},'baseUrl':{'type':Sequelize[_0x1bd2('0x2')]},'authToken':{'type':Sequelize[_0x1bd2('0x2')]},'notificationTemplate':{'type':Sequelize[_0x1bd2('0x8')],'defaultValue':function(){return _0x1bd2('0x9');}},'notificationSound':{'type':Sequelize[_0x1bd2('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x1bd2('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1bd2('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1bd2('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1bd2('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1bd2('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1bd2('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x1bd2('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x1bd2('0xa')],'defaultValue':![],'comment':_0x1bd2('0xd'),'set':function(_0x36ac58){if(!_0x36ac58){this[_0x1bd2('0xe')](_0x1bd2('0xf'),null);}this[_0x1bd2('0xe')](_0x1bd2('0x10'),_0x36ac58);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 152fcc5..f1e7e1d 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 _0xff93=['asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','MessageSid','notifications','messageId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','Contacts','DESC','list','contact','WhatsappInteraction','autoclose','push','close','unmanaged','*,*,*,*','interaction','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','CmList','List','Messages','spread','dataValues','eml-format','rimraf','fast-json-patch','moment','bluebird','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/utils','../../config/license/util','../../mysqldb','redis','defaults','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','json','apply','reject','save','update','destroy','get','WhatsappAccounts','end','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','WhatsappAccount','includeAll','include','findAll','params','options','create','body','user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','nolimit','rows','removeDispositions','CannedAnswer','getAnswers','removeAnswers','addAgents','ids','omit','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','User','getAgents','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','account','sinch','statuses','state','read','WhatsappMessage','message_id','applications'];(function(_0x4a7f36,_0x579ba5){var _0x1a64cc=function(_0x550eb7){while(--_0x550eb7){_0x4a7f36['push'](_0x4a7f36['shift']());}};_0x1a64cc(++_0x579ba5);}(_0xff93,0xf2));var _0x3ff9=function(_0x4a1703,_0x4800ec){_0x4a1703=_0x4a1703-0x0;var _0x3ac5f0=_0xff93[_0x4a1703];return _0x3ac5f0;};'use strict';var emlformat=require(_0x3ff9('0x0'));var rimraf=require(_0x3ff9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ff9('0x2'));var rp=require('request-promise');var moment=require(_0x3ff9('0x3'));var BPromise=require(_0x3ff9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3ff9('0x5'));var sox=require(_0x3ff9('0x6'));var csv=require(_0x3ff9('0x7'));var ejs=require(_0x3ff9('0x8'));var fs=require('fs');var fs_extra=require(_0x3ff9('0x9'));var _=require(_0x3ff9('0xa'));var squel=require(_0x3ff9('0xb'));var crypto=require('crypto');var jsforce=require(_0x3ff9('0xc'));var deskjs=require(_0x3ff9('0xd'));var toCsv=require(_0x3ff9('0x7'));var querystring=require(_0x3ff9('0xe'));var Papa=require(_0x3ff9('0xf'));var Redis=require(_0x3ff9('0x10'));var authService=require(_0x3ff9('0x11'));var qs=require(_0x3ff9('0x12'));var as=require(_0x3ff9('0x13'));var hardwareService=require(_0x3ff9('0x14'));var logger=require(_0x3ff9('0x15'))(_0x3ff9('0x16'));var utils=require(_0x3ff9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3ff9('0x18'));var db=require(_0x3ff9('0x19'))['db'];config[_0x3ff9('0x1a')]=_[_0x3ff9('0x1b')](config[_0x3ff9('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3ff9('0x1a')]));require(_0x3ff9('0x1c'))[_0x3ff9('0x1d')](socket);var jayson=require(_0x3ff9('0x1e'));var client=jayson[_0x3ff9('0x1f')][_0x3ff9('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x4e5980,_0xc648e,_0x2782e1,_0x268878){return new BPromise(function(_0x28a2c1,_0x3710e9){var _0x8e9973=_0x268878||client;return _0x8e9973[_0x3ff9('0x21')](_0x4e5980,_0x2782e1)[_0x3ff9('0x22')](function(_0x1e2dc4){logger[_0x3ff9('0x23')](_0x3ff9('0x24'),_0xc648e,'request\x20sent');logger[_0x3ff9('0x25')](_0x3ff9('0x26'),_0xc648e,_0x3ff9('0x27'),JSON[_0x3ff9('0x28')](_0x1e2dc4));if(_0x1e2dc4[_0x3ff9('0x29')]){if(_0x1e2dc4[_0x3ff9('0x29')][_0x3ff9('0x2a')]===0x1f4){logger[_0x3ff9('0x29')](_0x3ff9('0x24'),_0xc648e,_0x1e2dc4[_0x3ff9('0x29')][_0x3ff9('0x2b')]);return _0x3710e9(_0x1e2dc4['error'][_0x3ff9('0x2b')]);}logger[_0x3ff9('0x29')](_0x3ff9('0x24'),_0xc648e,_0x1e2dc4[_0x3ff9('0x29')][_0x3ff9('0x2b')]);return _0x28a2c1(_0x1e2dc4[_0x3ff9('0x29')][_0x3ff9('0x2b')]);}else{logger['info'](_0x3ff9('0x24'),_0xc648e,_0x3ff9('0x27'));_0x28a2c1(_0x1e2dc4[_0x3ff9('0x2c')]['message']);}})[_0x3ff9('0x2d')](function(_0x7b1df6){logger[_0x3ff9('0x29')](_0x3ff9('0x24'),_0xc648e,_0x7b1df6);_0x3710e9(_0x7b1df6);});});}function respondWithStatusCode(_0x164ffc,_0x44c399){_0x44c399=_0x44c399||0xcc;return function(_0x4401fc){if(_0x4401fc){return _0x164ffc[_0x3ff9('0x2e')](_0x44c399);}return _0x164ffc[_0x3ff9('0x2f')](_0x44c399)['end']();};}function respondWithResult(_0x266862,_0xa0cef4){_0xa0cef4=_0xa0cef4||0xc8;return function(_0x57e797){if(_0x57e797){return _0x266862[_0x3ff9('0x2f')](_0xa0cef4)['json'](_0x57e797);}};}function respondWithFilteredResult(_0xa74625,_0x401ce6){return function(_0x3f1bf0){if(_0x3f1bf0){var _0x47d4e2=typeof _0x401ce6[_0x3ff9('0x30')]===_0x3ff9('0x31')&&typeof _0x401ce6[_0x3ff9('0x32')]===_0x3ff9('0x31');var _0x5198b7=_0x3f1bf0[_0x3ff9('0x33')];var _0x7c230f=_0x47d4e2?0x0:_0x401ce6[_0x3ff9('0x30')];var _0x2378c5=_0x47d4e2?_0x3f1bf0[_0x3ff9('0x33')]:_0x401ce6['offset']+_0x401ce6[_0x3ff9('0x32')];var _0x4a1115;if(_0x2378c5>=_0x5198b7){_0x2378c5=_0x5198b7;_0x4a1115=0xc8;}else{_0x4a1115=0xce;}_0xa74625['status'](_0x4a1115);return _0xa74625['set']('Content-Range',_0x7c230f+'-'+_0x2378c5+'/'+_0x5198b7)[_0x3ff9('0x34')](_0x3f1bf0);}return null;};}function patchUpdates(_0x2630a8){return function(_0x5193de){try{jsonpatch[_0x3ff9('0x35')](_0x5193de,_0x2630a8,!![]);}catch(_0x258b18){return BPromise[_0x3ff9('0x36')](_0x258b18);}return _0x5193de[_0x3ff9('0x37')]();};}function saveUpdates(_0x3b92da,_0x372ef1){return function(_0x5af159){if(_0x5af159){return _0x5af159[_0x3ff9('0x38')](_0x3b92da)[_0x3ff9('0x22')](function(_0x4ac033){return _0x4ac033;});}return null;};}function removeEntity(_0x2cee74,_0x26f1d4){return function(_0x36bb4e){if(_0x36bb4e){return _0x36bb4e[_0x3ff9('0x39')]()[_0x3ff9('0x22')](function(){var _0x24592d=_0x36bb4e[_0x3ff9('0x3a')]({'plain':!![]});var _0x42a6f5=_0x3ff9('0x3b');return db['UserProfileResource'][_0x3ff9('0x39')]({'where':{'type':_0x42a6f5,'resourceId':_0x24592d['id']}})[_0x3ff9('0x22')](function(){return _0x36bb4e;});})[_0x3ff9('0x22')](function(){_0x2cee74[_0x3ff9('0x2f')](0xcc)[_0x3ff9('0x3c')]();});}};}function handleEntityNotFound(_0x377b4b,_0x1ee1ec){return function(_0x3e150f){if(!_0x3e150f){_0x377b4b[_0x3ff9('0x2e')](0x194);}return _0x3e150f;};}function handleError(_0x55e6ca,_0x4f6efb){_0x4f6efb=_0x4f6efb||0x1f4;return function(_0x5e6d3){logger[_0x3ff9('0x29')](_0x5e6d3[_0x3ff9('0x3d')]);if(_0x5e6d3['name']){delete _0x5e6d3[_0x3ff9('0x3e')];}_0x55e6ca[_0x3ff9('0x2f')](_0x4f6efb)[_0x3ff9('0x3f')](_0x5e6d3);};}exports['index']=function(_0x1cb357,_0x830e47){var _0x1ace8a={'include':[{'model':db[_0x3ff9('0x40')],'as':_0x3ff9('0x41')}]},_0x4466a5={},_0x16f9f9={'count':0x0,'rows':[]};var _0x5d5066=_[_0x3ff9('0x42')](db['WhatsappAccount'][_0x3ff9('0x43')],function(_0x12cc36){return{'name':_0x12cc36['fieldName'],'type':_0x12cc36[_0x3ff9('0x44')][_0x3ff9('0x45')]};});_0x4466a5['model']=_[_0x3ff9('0x42')](_0x5d5066,_0x3ff9('0x3e'));_0x4466a5['query']=_[_0x3ff9('0x46')](_0x1cb357[_0x3ff9('0x47')]);_0x4466a5[_0x3ff9('0x48')]=_['intersection'](_0x4466a5[_0x3ff9('0x49')],_0x4466a5['query']);_0x1ace8a[_0x3ff9('0x4a')]=_[_0x3ff9('0x4b')](_0x4466a5['model'],qs[_0x3ff9('0x4c')](_0x1cb357[_0x3ff9('0x47')][_0x3ff9('0x4c')]));_0x1ace8a['attributes']=_0x1ace8a[_0x3ff9('0x4a')][_0x3ff9('0x4d')]?_0x1ace8a[_0x3ff9('0x4a')]:_0x4466a5['model'];if(!_0x1cb357[_0x3ff9('0x47')][_0x3ff9('0x4e')]('nolimit')){_0x1ace8a[_0x3ff9('0x32')]=qs['limit'](_0x1cb357['query'][_0x3ff9('0x32')]);_0x1ace8a['offset']=qs[_0x3ff9('0x30')](_0x1cb357[_0x3ff9('0x47')][_0x3ff9('0x30')]);}_0x1ace8a[_0x3ff9('0x4f')]=qs[_0x3ff9('0x50')](_0x1cb357['query'][_0x3ff9('0x50')]);_0x1ace8a['where']=qs[_0x3ff9('0x48')](_[_0x3ff9('0x51')](_0x1cb357[_0x3ff9('0x47')],_0x4466a5[_0x3ff9('0x48')]),_0x5d5066);if(_0x1cb357[_0x3ff9('0x47')]['filter']){_0x1ace8a[_0x3ff9('0x52')]=_[_0x3ff9('0x53')](_0x1ace8a['where'],{'$or':_[_0x3ff9('0x42')](_0x5d5066,function(_0x47807a){if(_0x47807a[_0x3ff9('0x44')]!==_0x3ff9('0x54')){var _0x5186ce={};_0x5186ce[_0x47807a[_0x3ff9('0x3e')]]={'$like':'%'+_0x1cb357[_0x3ff9('0x47')][_0x3ff9('0x55')]+'%'};return _0x5186ce;}})});}_0x1ace8a=_[_0x3ff9('0x53')]({},_0x1ace8a,_0x1cb357['options']);var _0x4db3dd={'where':_0x1ace8a['where']};return db[_0x3ff9('0x56')][_0x3ff9('0x33')](_0x4db3dd)[_0x3ff9('0x22')](function(_0x4f6284){_0x16f9f9[_0x3ff9('0x33')]=_0x4f6284;if(_0x1cb357[_0x3ff9('0x47')][_0x3ff9('0x57')]){_0x1ace8a[_0x3ff9('0x58')]=[{'all':!![]}];}return db[_0x3ff9('0x56')][_0x3ff9('0x59')](_0x1ace8a);})['then'](function(_0x223f99){_0x16f9f9['rows']=_0x223f99;return _0x16f9f9;})[_0x3ff9('0x22')](respondWithFilteredResult(_0x830e47,_0x1ace8a))['catch'](handleError(_0x830e47,null));};exports['show']=function(_0x4b5bf9,_0x4e494b){var _0x4f5bed={'raw':![],'where':{'id':_0x4b5bf9[_0x3ff9('0x5a')]['id']},'include':[{'model':db[_0x3ff9('0x40')],'as':_0x3ff9('0x41')}]},_0x4576e3={};_0x4576e3[_0x3ff9('0x49')]=_[_0x3ff9('0x46')](db[_0x3ff9('0x56')][_0x3ff9('0x43')]);_0x4576e3[_0x3ff9('0x47')]=_[_0x3ff9('0x46')](_0x4b5bf9[_0x3ff9('0x47')]);_0x4576e3[_0x3ff9('0x48')]=_[_0x3ff9('0x4b')](_0x4576e3['model'],_0x4576e3[_0x3ff9('0x47')]);_0x4f5bed[_0x3ff9('0x4a')]=_[_0x3ff9('0x4b')](_0x4576e3['model'],qs[_0x3ff9('0x4c')](_0x4b5bf9['query'][_0x3ff9('0x4c')]));_0x4f5bed[_0x3ff9('0x4a')]=_0x4f5bed[_0x3ff9('0x4a')][_0x3ff9('0x4d')]?_0x4f5bed[_0x3ff9('0x4a')]:_0x4576e3[_0x3ff9('0x49')];if(_0x4b5bf9['query'][_0x3ff9('0x57')]){_0x4f5bed[_0x3ff9('0x58')]=[{'all':!![]}];}_0x4f5bed=_[_0x3ff9('0x53')]({},_0x4f5bed,_0x4b5bf9[_0x3ff9('0x5b')]);return db[_0x3ff9('0x56')]['find'](_0x4f5bed)[_0x3ff9('0x22')](handleEntityNotFound(_0x4e494b,null))[_0x3ff9('0x22')](respondWithResult(_0x4e494b,null))[_0x3ff9('0x2d')](handleError(_0x4e494b,null));};exports[_0x3ff9('0x5c')]=function(_0x227394,_0x23a0ec){return db[_0x3ff9('0x56')]['create'](_0x227394[_0x3ff9('0x5d')],{})[_0x3ff9('0x22')](function(_0x179ab7){var _0x429ad6=_0x227394[_0x3ff9('0x5e')][_0x3ff9('0x3a')]({'plain':!![]});if(!_0x429ad6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x429ad6[_0x3ff9('0x5f')]===_0x3ff9('0x5e')){var _0x21408b=_0x179ab7[_0x3ff9('0x3a')]({'plain':!![]});var _0x1f9fe3=_0x3ff9('0x3b');return db[_0x3ff9('0x60')][_0x3ff9('0x61')]({'where':{'name':_0x1f9fe3,'userProfileId':_0x429ad6['userProfileId']},'raw':!![]})[_0x3ff9('0x22')](function(_0x207c94){if(_0x207c94&&_0x207c94[_0x3ff9('0x62')]===0x0){return db[_0x3ff9('0x63')][_0x3ff9('0x5c')]({'name':_0x21408b[_0x3ff9('0x3e')],'resourceId':_0x21408b['id'],'type':_0x207c94['name'],'sectionId':_0x207c94['id']},{})['then'](function(){return _0x179ab7;});}else{return _0x179ab7;}})[_0x3ff9('0x2d')](function(_0x17d516){logger[_0x3ff9('0x29')](_0x3ff9('0x64'),_0x17d516);throw _0x17d516;});}return _0x179ab7;})[_0x3ff9('0x22')](respondWithResult(_0x23a0ec,0xc9))['catch'](handleError(_0x23a0ec,null));};exports[_0x3ff9('0x38')]=function(_0x27a49a,_0xf5903f){if(_0x27a49a['body']['id']){delete _0x27a49a[_0x3ff9('0x5d')]['id'];}return db[_0x3ff9('0x56')][_0x3ff9('0x61')]({'where':{'id':_0x27a49a[_0x3ff9('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x3ff9('0x41')}]})[_0x3ff9('0x22')](handleEntityNotFound(_0xf5903f,null))[_0x3ff9('0x22')](saveUpdates(_0x27a49a[_0x3ff9('0x5d')],null))[_0x3ff9('0x22')](respondWithResult(_0xf5903f,null))[_0x3ff9('0x2d')](handleError(_0xf5903f,null));};exports[_0x3ff9('0x39')]=function(_0x400d44,_0x38880e){return db['WhatsappAccount'][_0x3ff9('0x61')]({'where':{'id':_0x400d44[_0x3ff9('0x5a')]['id']}})[_0x3ff9('0x22')](handleEntityNotFound(_0x38880e,null))['then'](removeEntity(_0x38880e,null))[_0x3ff9('0x2d')](handleError(_0x38880e,null));};exports[_0x3ff9('0x65')]=function(_0x12b4d9,_0x4d1041){return db[_0x3ff9('0x56')]['describe']()[_0x3ff9('0x22')](respondWithResult(_0x4d1041,null))[_0x3ff9('0x2d')](handleError(_0x4d1041,null));};exports[_0x3ff9('0x66')]=function(_0x24b3e0,_0x326e92,_0x406f98){if(_0x24b3e0[_0x3ff9('0x5d')]['id']){delete _0x24b3e0[_0x3ff9('0x5d')]['id'];}return db['WhatsappAccount'][_0x3ff9('0x61')]({'where':{'id':_0x24b3e0[_0x3ff9('0x5a')]['id']}})[_0x3ff9('0x22')](handleEntityNotFound(_0x326e92,null))[_0x3ff9('0x22')](function(_0x23b7ce){if(_0x23b7ce){_0x24b3e0[_0x3ff9('0x5d')][_0x3ff9('0x67')]=_0x23b7ce['id'];return db['Disposition']['create'](_0x24b3e0[_0x3ff9('0x5d')]);}})[_0x3ff9('0x22')](respondWithResult(_0x326e92,null))[_0x3ff9('0x2d')](handleError(_0x326e92,null));};exports[_0x3ff9('0x68')]=function(_0x38e135,_0x8e27a,_0x1e715b){var _0x493f58={'raw':![],'where':{}};var _0x1f8392={};var _0x10aad1={'count':0x0,'rows':[]};return db[_0x3ff9('0x56')][_0x3ff9('0x69')]({'where':{'id':_0x38e135[_0x3ff9('0x5a')]['id']}})[_0x3ff9('0x22')](handleEntityNotFound(_0x8e27a,null))[_0x3ff9('0x22')](function(_0x49854c){if(_0x49854c){_0x1f8392[_0x3ff9('0x49')]=_[_0x3ff9('0x46')](db[_0x3ff9('0x6a')][_0x3ff9('0x43')]);_0x1f8392['query']=_[_0x3ff9('0x46')](_0x38e135[_0x3ff9('0x47')]);_0x1f8392[_0x3ff9('0x48')]=_[_0x3ff9('0x4b')](_0x1f8392[_0x3ff9('0x49')],_0x1f8392[_0x3ff9('0x47')]);_0x493f58[_0x3ff9('0x4a')]=_[_0x3ff9('0x4b')](_0x1f8392['model'],qs[_0x3ff9('0x4c')](_0x38e135[_0x3ff9('0x47')][_0x3ff9('0x4c')]));_0x493f58[_0x3ff9('0x4a')]=_0x493f58[_0x3ff9('0x4a')]['length']?_0x493f58[_0x3ff9('0x4a')]:_0x1f8392['model'];if(!_0x38e135[_0x3ff9('0x47')][_0x3ff9('0x4e')](_0x3ff9('0x6b'))){_0x493f58[_0x3ff9('0x32')]=qs[_0x3ff9('0x32')](_0x38e135[_0x3ff9('0x47')][_0x3ff9('0x32')]);_0x493f58[_0x3ff9('0x30')]=qs[_0x3ff9('0x30')](_0x38e135[_0x3ff9('0x47')][_0x3ff9('0x30')]);}_0x493f58['order']=qs[_0x3ff9('0x50')](_0x38e135[_0x3ff9('0x47')][_0x3ff9('0x50')]);_0x493f58[_0x3ff9('0x52')]=qs['filters'](_[_0x3ff9('0x51')](_0x38e135[_0x3ff9('0x47')],_0x1f8392[_0x3ff9('0x48')]));_0x493f58[_0x3ff9('0x52')][_0x3ff9('0x67')]=_0x49854c['id'];if(_0x38e135[_0x3ff9('0x47')][_0x3ff9('0x55')]){_0x493f58[_0x3ff9('0x52')]=_['merge'](_0x493f58[_0x3ff9('0x52')],{'$or':_[_0x3ff9('0x42')](_0x493f58[_0x3ff9('0x4a')],function(_0x14f55b){var _0xe386de={};_0xe386de[_0x14f55b]={'$like':'%'+_0x38e135[_0x3ff9('0x47')]['filter']+'%'};return _0xe386de;})});}_0x493f58=_['merge']({},_0x493f58,_0x38e135[_0x3ff9('0x5b')]);return db['Disposition'][_0x3ff9('0x33')]({'where':_0x493f58['where']})[_0x3ff9('0x22')](function(_0x5ddc01){_0x10aad1['count']=_0x5ddc01;if(_0x38e135['query'][_0x3ff9('0x57')]){_0x493f58['include']=[{'all':!![]}];}return db[_0x3ff9('0x6a')][_0x3ff9('0x59')](_0x493f58);})['then'](function(_0x10366f){_0x10aad1[_0x3ff9('0x6c')]=_0x10366f;return _0x10aad1;});}})['then'](respondWithFilteredResult(_0x8e27a,_0x493f58))[_0x3ff9('0x2d')](handleError(_0x8e27a,null));};exports[_0x3ff9('0x6d')]=function(_0x12b182,_0xf1683c,_0x73f5bc){return db[_0x3ff9('0x56')][_0x3ff9('0x61')]({'where':{'id':_0x12b182[_0x3ff9('0x5a')]['id']}})['then'](handleEntityNotFound(_0xf1683c,null))['then'](function(_0x18a558){if(_0x18a558){return _0x18a558[_0x3ff9('0x6d')](_0x12b182[_0x3ff9('0x47')]['ids']);}})[_0x3ff9('0x22')](respondWithStatusCode(_0xf1683c,null))[_0x3ff9('0x2d')](handleError(_0xf1683c,null));};exports['addAnswer']=function(_0x2e7193,_0x5ed623,_0x1dfd57){if(_0x2e7193['body']['id']){delete _0x2e7193['body']['id'];}return db[_0x3ff9('0x56')]['find']({'where':{'id':_0x2e7193[_0x3ff9('0x5a')]['id']}})[_0x3ff9('0x22')](handleEntityNotFound(_0x5ed623,null))[_0x3ff9('0x22')](function(_0xc8f75){if(_0xc8f75){_0x2e7193[_0x3ff9('0x5d')][_0x3ff9('0x67')]=_0xc8f75['id'];return db[_0x3ff9('0x6e')]['create'](_0x2e7193[_0x3ff9('0x5d')]);}})[_0x3ff9('0x22')](respondWithResult(_0x5ed623,null))[_0x3ff9('0x2d')](handleError(_0x5ed623,null));};exports[_0x3ff9('0x6f')]=function(_0x129aee,_0xec8783,_0x51673f){var _0x5ede4d={'raw':![],'where':{}};var _0x40a538={};var _0x28d1db={'count':0x0,'rows':[]};return db[_0x3ff9('0x56')][_0x3ff9('0x69')]({'where':{'id':_0x129aee[_0x3ff9('0x5a')]['id']}})['then'](handleEntityNotFound(_0xec8783,null))[_0x3ff9('0x22')](function(_0x5594c7){if(_0x5594c7){_0x40a538[_0x3ff9('0x49')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x40a538[_0x3ff9('0x47')]=_[_0x3ff9('0x46')](_0x129aee['query']);_0x40a538[_0x3ff9('0x48')]=_['intersection'](_0x40a538[_0x3ff9('0x49')],_0x40a538[_0x3ff9('0x47')]);_0x5ede4d[_0x3ff9('0x4a')]=_[_0x3ff9('0x4b')](_0x40a538['model'],qs['fields'](_0x129aee['query'][_0x3ff9('0x4c')]));_0x5ede4d[_0x3ff9('0x4a')]=_0x5ede4d[_0x3ff9('0x4a')][_0x3ff9('0x4d')]?_0x5ede4d['attributes']:_0x40a538[_0x3ff9('0x49')];if(!_0x129aee[_0x3ff9('0x47')][_0x3ff9('0x4e')](_0x3ff9('0x6b'))){_0x5ede4d[_0x3ff9('0x32')]=qs[_0x3ff9('0x32')](_0x129aee[_0x3ff9('0x47')][_0x3ff9('0x32')]);_0x5ede4d[_0x3ff9('0x30')]=qs[_0x3ff9('0x30')](_0x129aee[_0x3ff9('0x47')][_0x3ff9('0x30')]);}_0x5ede4d[_0x3ff9('0x4f')]=qs['sort'](_0x129aee[_0x3ff9('0x47')][_0x3ff9('0x50')]);_0x5ede4d['where']=qs[_0x3ff9('0x48')](_[_0x3ff9('0x51')](_0x129aee[_0x3ff9('0x47')],_0x40a538[_0x3ff9('0x48')]));_0x5ede4d[_0x3ff9('0x52')][_0x3ff9('0x67')]=_0x5594c7['id'];if(_0x129aee[_0x3ff9('0x47')]['filter']){_0x5ede4d[_0x3ff9('0x52')]=_[_0x3ff9('0x53')](_0x5ede4d[_0x3ff9('0x52')],{'$or':_['map'](_0x5ede4d['attributes'],function(_0x1c00ce){var _0x3c8565={};_0x3c8565[_0x1c00ce]={'$like':'%'+_0x129aee[_0x3ff9('0x47')][_0x3ff9('0x55')]+'%'};return _0x3c8565;})});}_0x5ede4d=_[_0x3ff9('0x53')]({},_0x5ede4d,_0x129aee[_0x3ff9('0x5b')]);return db[_0x3ff9('0x6e')][_0x3ff9('0x33')]({'where':_0x5ede4d[_0x3ff9('0x52')]})[_0x3ff9('0x22')](function(_0xd53f5b){_0x28d1db[_0x3ff9('0x33')]=_0xd53f5b;if(_0x129aee[_0x3ff9('0x47')]['includeAll']){_0x5ede4d['include']=[{'all':!![]}];}return db[_0x3ff9('0x6e')][_0x3ff9('0x59')](_0x5ede4d);})[_0x3ff9('0x22')](function(_0x2dd282){_0x28d1db['rows']=_0x2dd282;return _0x28d1db;});}})['then'](respondWithFilteredResult(_0xec8783,_0x5ede4d))['catch'](handleError(_0xec8783,null));};exports[_0x3ff9('0x70')]=function(_0x20766d,_0x1e97b7,_0x4175d9){return db['WhatsappAccount'][_0x3ff9('0x61')]({'where':{'id':_0x20766d[_0x3ff9('0x5a')]['id']}})[_0x3ff9('0x22')](handleEntityNotFound(_0x1e97b7,null))[_0x3ff9('0x22')](function(_0x40d424){if(_0x40d424){return _0x40d424['removeAnswers'](_0x20766d[_0x3ff9('0x47')]['ids']);}})[_0x3ff9('0x22')](respondWithStatusCode(_0x1e97b7,null))[_0x3ff9('0x2d')](handleError(_0x1e97b7,null));};exports[_0x3ff9('0x71')]=function(_0x2b3fa4,_0xd78183,_0x4d8d96){return db[_0x3ff9('0x56')][_0x3ff9('0x61')]({'where':{'id':_0x2b3fa4[_0x3ff9('0x5a')]['id']}})['then'](handleEntityNotFound(_0xd78183,null))[_0x3ff9('0x22')](function(_0x53008e){if(_0x53008e){return _0x53008e[_0x3ff9('0x71')](_0x2b3fa4[_0x3ff9('0x5d')][_0x3ff9('0x72')],_[_0x3ff9('0x73')](_0x2b3fa4[_0x3ff9('0x5d')],[_0x3ff9('0x72'),'id'])||{})['spread'](function(_0x2c3e5a){for(var _0x5104bf=0x0;_0x5104bf<_0x2b3fa4['body'][_0x3ff9('0x72')][_0x3ff9('0x4d')];_0x5104bf+=0x1){socket['emit'](_0x3ff9('0x74'),{'UserId':Number(_0x2b3fa4[_0x3ff9('0x5d')]['ids'][_0x5104bf]),'WhatsappAccountId':Number(_0x2b3fa4[_0x3ff9('0x5a')]['id'])});}return _0x2c3e5a;});}})[_0x3ff9('0x22')](respondWithResult(_0xd78183,null))[_0x3ff9('0x2d')](handleError(_0xd78183,null));};exports['removeAgents']=function(_0x6440ee,_0x5e12f4,_0x5bc26e){return db[_0x3ff9('0x56')][_0x3ff9('0x61')]({'where':{'id':_0x6440ee[_0x3ff9('0x5a')]['id']}})[_0x3ff9('0x22')](handleEntityNotFound(_0x5e12f4,null))['then'](function(_0x149d4a){if(_0x149d4a){return _0x149d4a[_0x3ff9('0x75')](_0x6440ee['query'][_0x3ff9('0x72')])['then'](function(){if(_[_0x3ff9('0x76')](_0x6440ee['query']['ids'])){for(var _0x4b2f86=0x0;_0x4b2f86<_0x6440ee['query'][_0x3ff9('0x72')][_0x3ff9('0x4d')];_0x4b2f86+=0x1){socket[_0x3ff9('0x77')](_0x3ff9('0x78'),{'UserId':Number(_0x6440ee[_0x3ff9('0x47')][_0x3ff9('0x72')][_0x4b2f86]),'WhatsappAccountId':Number(_0x6440ee['params']['id'])});}}else{socket[_0x3ff9('0x77')](_0x3ff9('0x78'),{'UserId':Number(_0x6440ee[_0x3ff9('0x47')][_0x3ff9('0x72')]),'WhatsappAccountId':Number(_0x6440ee['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5e12f4,null))[_0x3ff9('0x2d')](handleError(_0x5e12f4,null));};exports['getAgents']=function(_0x73827e,_0x4e080e,_0x309134){var _0x5d87a6={};var _0x17512b={};var _0x4e4908;var _0x1948c9;return db[_0x3ff9('0x56')][_0x3ff9('0x69')]({'where':{'id':_0x73827e[_0x3ff9('0x5a')]['id']}})[_0x3ff9('0x22')](handleEntityNotFound(_0x4e080e,null))[_0x3ff9('0x22')](function(_0x4d6918){if(_0x4d6918){_0x4e4908=_0x4d6918;_0x17512b[_0x3ff9('0x49')]=_[_0x3ff9('0x46')](db[_0x3ff9('0x79')]['rawAttributes']);_0x17512b['query']=_[_0x3ff9('0x46')](_0x73827e[_0x3ff9('0x47')]);_0x17512b[_0x3ff9('0x48')]=_['intersection'](_0x17512b[_0x3ff9('0x49')],_0x17512b[_0x3ff9('0x47')]);_0x5d87a6[_0x3ff9('0x4a')]=_[_0x3ff9('0x4b')](_0x17512b[_0x3ff9('0x49')],qs['fields'](_0x73827e['query'][_0x3ff9('0x4c')]));_0x5d87a6[_0x3ff9('0x4a')]=_0x5d87a6['attributes']['length']?_0x5d87a6[_0x3ff9('0x4a')]:_0x17512b[_0x3ff9('0x49')];_0x5d87a6[_0x3ff9('0x4f')]=qs[_0x3ff9('0x50')](_0x73827e[_0x3ff9('0x47')][_0x3ff9('0x50')]);_0x5d87a6[_0x3ff9('0x52')]=qs[_0x3ff9('0x48')](_[_0x3ff9('0x51')](_0x73827e[_0x3ff9('0x47')],_0x17512b[_0x3ff9('0x48')]));if(_0x73827e[_0x3ff9('0x47')][_0x3ff9('0x55')]){_0x5d87a6[_0x3ff9('0x52')]=_[_0x3ff9('0x53')](_0x5d87a6[_0x3ff9('0x52')],{'$or':_[_0x3ff9('0x42')](_0x5d87a6[_0x3ff9('0x4a')],function(_0x4c39a8){var _0x277da5={};_0x277da5[_0x4c39a8]={'$like':'%'+_0x73827e[_0x3ff9('0x47')]['filter']+'%'};return _0x277da5;})});}_0x5d87a6=_[_0x3ff9('0x53')]({},_0x5d87a6,_0x73827e[_0x3ff9('0x5b')]);return _0x4e4908[_0x3ff9('0x7a')](_0x5d87a6);}})['then'](function(_0x2dcb9c){if(_0x2dcb9c){_0x1948c9=_0x2dcb9c[_0x3ff9('0x4d')];if(!_0x73827e[_0x3ff9('0x47')][_0x3ff9('0x4e')](_0x3ff9('0x6b'))){_0x5d87a6['limit']=qs[_0x3ff9('0x32')](_0x73827e[_0x3ff9('0x47')][_0x3ff9('0x32')]);_0x5d87a6['offset']=qs[_0x3ff9('0x30')](_0x73827e['query'][_0x3ff9('0x30')]);}return _0x4e4908['getAgents'](_0x5d87a6);}})[_0x3ff9('0x22')](function(_0x396ea7){if(_0x396ea7){return _0x396ea7?{'count':_0x1948c9,'rows':_0x396ea7}:null;}})['then'](respondWithResult(_0x4e080e,null))[_0x3ff9('0x2d')](handleError(_0x4e080e,null));};exports[_0x3ff9('0x7b')]=function(_0x4a47f7,_0x4e4edd){var _0x1b131a=_0x4a47f7[_0x3ff9('0x5a')]['id'];var _0x495fb8=_0x4a47f7[_0x3ff9('0x5d')];var _0x505bbf=0xc8;var _0x4915dd=null;return db['sequelize'][_0x3ff9('0x7c')]({'isolationLevel':db[_0x3ff9('0x7d')][_0x3ff9('0x7e')][_0x3ff9('0x7f')][_0x3ff9('0x80')]},function(_0x1715bb){return db[_0x3ff9('0x56')][_0x3ff9('0x69')]({'where':{'id':_0x1b131a},'transaction':_0x1715bb})[_0x3ff9('0x22')](function(_0x11514a){if(_0x11514a){return db[_0x3ff9('0x81')][_0x3ff9('0x39')]({'where':{'WhatsappAccountId':_0x1b131a},'transaction':_0x1715bb})[_0x3ff9('0x22')](function(){var _0x206550=_[_0x3ff9('0x42')](_0x495fb8,function(_0x459cc1){_0x459cc1[_0x3ff9('0x67')]=_0x1b131a;return _0x459cc1;});return db[_0x3ff9('0x81')][_0x3ff9('0x82')](_0x206550,{'transaction':_0x1715bb});});}else{_0x505bbf=0x194;_0x4915dd=[];}});})[_0x3ff9('0x22')](function(){if(_0x505bbf!==0x194){return db['WhatsappApplication'][_0x3ff9('0x83')]({'where':{'WhatsappAccountId':_0x1b131a},'order':_0x3ff9('0x84')})['then'](function(_0x5118ae){_0x4915dd=_0x5118ae;});}})['catch'](function(_0x2d062c){_0x505bbf=0x1f4;logger[_0x3ff9('0x29')](_0x2d062c['stack']);if(_0x2d062c['name']){delete _0x2d062c[_0x3ff9('0x3e')];}_0x4915dd=_0x2d062c;})['finally'](function(){if(_0x4915dd===null){_0x4e4edd[_0x3ff9('0x2e')](_0x505bbf);}else{if(_0x505bbf===0x1f4){_0x4e4edd[_0x3ff9('0x2f')](_0x505bbf)[_0x3ff9('0x3f')](_0x4915dd);}else{_0x4e4edd['status'](_0x505bbf)[_0x3ff9('0x34')](_0x4915dd);}}});};exports['getApplications']=function(_0x41adda,_0x36c69c,_0x6d1269){var _0xa01170={};var _0xaa4fd8={};var _0x413c8c;var _0x221315;return db[_0x3ff9('0x56')]['findOne']({'where':{'id':_0x41adda['params']['id']}})[_0x3ff9('0x22')](handleEntityNotFound(_0x36c69c,null))['then'](function(_0x32e2ad){if(_0x32e2ad){_0x413c8c=_0x32e2ad;_0xaa4fd8[_0x3ff9('0x49')]=_[_0x3ff9('0x46')](db[_0x3ff9('0x81')]['rawAttributes']);_0xaa4fd8[_0x3ff9('0x47')]=_[_0x3ff9('0x46')](_0x41adda[_0x3ff9('0x47')]);_0xaa4fd8[_0x3ff9('0x48')]=_[_0x3ff9('0x4b')](_0xaa4fd8['model'],_0xaa4fd8['query']);_0xa01170['attributes']=_[_0x3ff9('0x4b')](_0xaa4fd8['model'],qs[_0x3ff9('0x4c')](_0x41adda[_0x3ff9('0x47')][_0x3ff9('0x4c')]));_0xa01170['attributes']=_0xa01170[_0x3ff9('0x4a')][_0x3ff9('0x4d')]?_0xa01170[_0x3ff9('0x4a')]:_0xaa4fd8[_0x3ff9('0x49')];_0xa01170[_0x3ff9('0x4f')]=qs[_0x3ff9('0x50')](_0x41adda['query']['sort']);_0xa01170['where']=qs[_0x3ff9('0x48')](_[_0x3ff9('0x51')](_0x41adda[_0x3ff9('0x47')],_0xaa4fd8[_0x3ff9('0x48')]));if(_0x41adda[_0x3ff9('0x47')][_0x3ff9('0x55')]){_0xa01170[_0x3ff9('0x52')]=_[_0x3ff9('0x53')](_0xa01170[_0x3ff9('0x52')],{'$or':_[_0x3ff9('0x42')](_0xa01170['attributes'],function(_0x12816e){var _0x2aa55c={};_0x2aa55c[_0x12816e]={'$like':'%'+_0x41adda['query'][_0x3ff9('0x55')]+'%'};return _0x2aa55c;})});}_0xa01170=_['merge']({},_0xa01170,_0x41adda[_0x3ff9('0x5b')]);return _0x413c8c[_0x3ff9('0x85')](_0xa01170);}})['then'](function(_0x5dd17d){if(_0x5dd17d){_0x221315=_0x5dd17d[_0x3ff9('0x4d')];if(!_0x41adda[_0x3ff9('0x47')]['hasOwnProperty'](_0x3ff9('0x6b'))){_0xa01170[_0x3ff9('0x32')]=qs[_0x3ff9('0x32')](_0x41adda[_0x3ff9('0x47')]['limit']);_0xa01170[_0x3ff9('0x30')]=qs[_0x3ff9('0x30')](_0x41adda[_0x3ff9('0x47')]['offset']);}return _0x413c8c['getApplications'](_0xa01170);}})['then'](function(_0x40c44b){if(_0x40c44b){return _0x40c44b?{'count':_0x221315,'rows':_0x40c44b}:null;}})['then'](respondWithResult(_0x36c69c,null))['catch'](handleError(_0x36c69c,null));};exports[_0x3ff9('0x86')]=function(_0x5ddd5a,_0x583f3c,_0x3ed132){var _0x5eba30={'channel':'whatsapp'};var _0x30c59a=[];var _0x3fc059=[];var _0x56983d={};return db[_0x3ff9('0x56')]['find']({'where':{'id':_0x5ddd5a[_0x3ff9('0x5a')]['id']},'include':[{'model':db[_0x3ff9('0x81')],'as':_0x3ff9('0x87')}]})['then'](handleEntityNotFound(_0x583f3c,null))['then'](function(_0x52b957){_0x5eba30[_0x3ff9('0x88')]=_0x52b957;if(_0x5eba30[_0x3ff9('0x88')]&&_0x5eba30[_0x3ff9('0x88')][_0x3ff9('0x44')]===_0x3ff9('0x89')&&_0x5ddd5a[_0x3ff9('0x5d')][_0x3ff9('0x8a')]){if(_0x5ddd5a[_0x3ff9('0x5d')][_0x3ff9('0x8a')][_0x3ff9('0x4d')]===0x0)return;if(_0x5ddd5a[_0x3ff9('0x5d')][_0x3ff9('0x8a')][0x0][_0x3ff9('0x8b')]!==_0x3ff9('0x8c'))return;return db[_0x3ff9('0x8d')][_0x3ff9('0x38')]({'read':!![],'readAt':_0x5ddd5a['body'][_0x3ff9('0x8a')][0x0]['timestamp']},{'where':{'messageId':_0x5ddd5a[_0x3ff9('0x5d')][_0x3ff9('0x8a')][0x0][_0x3ff9('0x8e')]},'individualHooks':!![]})[_0x3ff9('0x22')](function(_0x1bf052){return _0x583f3c[_0x3ff9('0x2f')](0xc8)[_0x3ff9('0x34')](_0x1bf052);});}_0x5eba30[_0x3ff9('0x8f')]=_['orderBy'](_0x52b957['Applications'],[_0x3ff9('0x84')],[_0x3ff9('0x90')]);if(_0x5eba30['account']['Applications']){delete _0x5eba30[_0x3ff9('0x88')][_0x3ff9('0x87')];}return db[_0x3ff9('0x91')][_0x3ff9('0x65')]()[_0x3ff9('0x22')](function(_0x18df09){if(!_0x18df09){throw new db[(_0x3ff9('0x92'))][(_0x3ff9('0x93'))]('no\x20available\x20attributes');}_0x30c59a=_[_0x3ff9('0x94')](_[_0x3ff9('0x46')](_0x18df09),[_0x3ff9('0x95'),_0x3ff9('0x96')]);_0x3fc059=_['difference'](_[_0x3ff9('0x46')](_0x18df09),['createdAt',_0x3ff9('0x96'),_0x3ff9('0x97'),_0x3ff9('0x98')]);_0x5eba30['body']={'mapKey':_0x3ff9('0x99')};if(_0x5eba30['account']&&_0x5eba30['account'][_0x3ff9('0x44')]===_0x3ff9('0x9a')){_0x5eba30[_0x3ff9('0x5d')][_0x3ff9('0x9b')]=_0x5ddd5a[_0x3ff9('0x5d')][_0x3ff9('0x9c')][_0x3ff9('0x9d')](_0x3ff9('0x9e'),'');_0x5eba30[_0x3ff9('0x5d')]['body']=_0x5ddd5a['body']['Body'];_0x5eba30['body']['messageId']=_0x5ddd5a[_0x3ff9('0x5d')][_0x3ff9('0x9f')];}if(_0x5eba30[_0x3ff9('0x88')]&&_0x5eba30[_0x3ff9('0x88')][_0x3ff9('0x44')]===_0x3ff9('0x89')){_0x5eba30[_0x3ff9('0x5d')][_0x3ff9('0x9b')]=_0x5ddd5a[_0x3ff9('0x5d')][_0x3ff9('0xa0')][0x0][_0x3ff9('0x9b')];_0x5eba30[_0x3ff9('0x5d')][_0x3ff9('0x5d')]=_0x5ddd5a['body']['notifications'][0x0][_0x3ff9('0x2b')][_0x3ff9('0x5d')];_0x5eba30[_0x3ff9('0x5d')][_0x3ff9('0xa1')]=_0x5ddd5a[_0x3ff9('0x5d')][_0x3ff9('0xa0')][0x0]['message_id'];}if(_0x5eba30[_0x3ff9('0x5d')]['id']){delete _0x5eba30[_0x3ff9('0x5d')]['id'];}if(_[_0x3ff9('0xa2')](_0x5eba30[_0x3ff9('0x5d')][_0x3ff9('0x9b')])){throw new db['Sequelize'][(_0x3ff9('0x93'))]('from\x20is\x20mandatory');}if(_[_0x3ff9('0xa2')](_0x5eba30[_0x3ff9('0x5d')]['body'])||_0x5eba30['body'][_0x3ff9('0x5d')]===''){throw new db[(_0x3ff9('0x92'))]['ValidationError'](_0x3ff9('0xa3'));}if(_[_0x3ff9('0xa2')](_0x5eba30[_0x3ff9('0x5d')]['mapKey'])){throw new db[(_0x3ff9('0x92'))][(_0x3ff9('0x93'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3fc059);}if(!_[_0x3ff9('0xa4')](_0x3fc059,_0x5eba30[_0x3ff9('0x5d')]['mapKey'])){throw new db['Sequelize'][(_0x3ff9('0x93'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3fc059);}_0x56983d[_0x5eba30[_0x3ff9('0x5d')][_0x3ff9('0xa5')]]=_0x5eba30[_0x3ff9('0x5d')][_0x3ff9('0x9b')];return db['CmList'][_0x3ff9('0x61')]({'where':{'id':_0x5eba30[_0x3ff9('0x88')][_0x3ff9('0x98')]},'include':[{'model':db[_0x3ff9('0x91')],'as':_0x3ff9('0xa6'),'where':_0x56983d,'limit':0x1,'order':[[_0x3ff9('0x96'),_0x3ff9('0xa7')]]}]});})[_0x3ff9('0x22')](handleEntityNotFound(_0x583f3c,null))[_0x3ff9('0x22')](function(_0x58151d){if(_0x58151d){_0x5eba30[_0x3ff9('0xa8')]=_['omit'](_0x58151d,[_0x3ff9('0xa6')]);if(_0x58151d[_0x3ff9('0xa6')][_0x3ff9('0x4d')]){return _0x58151d['Contacts'][0x0];}var _0x3885d1=_[_0x3ff9('0x1b')](_0x5eba30[_0x3ff9('0x5d')],{'firstName':_0x5eba30[_0x3ff9('0x5d')][_0x3ff9('0x9b')],'ListId':_0x58151d['id']});_0x3885d1[_0x5eba30[_0x3ff9('0x5d')][_0x3ff9('0xa5')]]=_0x5eba30[_0x3ff9('0x5d')][_0x3ff9('0x9b')];return db['CmContact'][_0x3ff9('0x5c')](_0x3885d1,{'fields':_0x30c59a,'raw':!![]});}})[_0x3ff9('0x22')](handleEntityNotFound(_0x583f3c,null))[_0x3ff9('0x22')](function(_0x18db68){if(_0x18db68){_0x5eba30[_0x3ff9('0xa9')]=_0x18db68;var _0x49a1e3={'ContactId':_0x18db68['id'],'phone':_0x5eba30[_0x3ff9('0x5d')][_0x3ff9('0x9b')],'WhatsappAccountId':_0x5ddd5a[_0x3ff9('0x5a')]['id']};var _0x5a5b12={'ContactId':_0x18db68['id'],'WhatsappAccountId':_0x5ddd5a[_0x3ff9('0x5a')]['id'],'closed':![]};return db[_0x3ff9('0xaa')][_0x3ff9('0x61')]({'where':_0x5a5b12})['then'](function(_0x5b4aa6){if(_0x5b4aa6){return[_0x5b4aa6,![]];}return db['WhatsappInteraction'][_0x3ff9('0x5c')](_0x49a1e3)['then'](function(_0x3e314d){return[_0x3e314d,!![]];});});}})['spread'](function(_0x22d67e,_0x1495ef){_0x5eba30['interaction']=_0x22d67e[_0x3ff9('0x3a')]({'plain':!![]});_0x5eba30['interaction']['created']=![];if(_0x1495ef){if(_0x5eba30[_0x3ff9('0x88')][_0x3ff9('0xab')]){_0x5eba30[_0x3ff9('0x8f')][_0x3ff9('0xac')]({'id':0x0,'priority':_0x5eba30['applications'][_0x3ff9('0x4d')]+0x1,'app':_0x3ff9('0xad'),'appdata':_0x3ff9('0xae'),'interval':_0x3ff9('0xaf')});}_0x5eba30[_0x3ff9('0xb0')]['created']=!![];}return db['WhatsappMessage'][_0x3ff9('0x5c')]({'phone':_0x5eba30[_0x3ff9('0x5d')][_0x3ff9('0x9b')],'messageId':_0x5eba30['body']['messageId'],'body':_0x5eba30[_0x3ff9('0x5d')][_0x3ff9('0x5d')],'WhatsappAccountId':_0x5ddd5a[_0x3ff9('0x5a')]['id'],'WhatsappInteractionId':_0x22d67e['id'],'direction':'in','ContactId':_0x22d67e[_0x3ff9('0xb1')],'AttachmentId':_0x5eba30[_0x3ff9('0x5d')][_0x3ff9('0xb2')]});})[_0x3ff9('0x22')](function(_0x14821c){_0x5eba30['message']=_0x14821c;if(_0x5eba30[_0x3ff9('0xb0')]['UserId']){return db[_0x3ff9('0x79')][_0x3ff9('0x61')]({'attributes':['id','name'],'where':{'id':_0x5eba30['interaction'][_0x3ff9('0xb3')]}})[_0x3ff9('0x22')](function(_0x36cf6e){if(_0x36cf6e){_0x5eba30['applications'][_0x3ff9('0xb4')]({'id':0x0,'priority':0x0,'app':_0x3ff9('0xb5'),'appdata':_0x36cf6e[_0x3ff9('0x3e')]+','+(_0x5eba30[_0x3ff9('0x88')][_0x3ff9('0xb6')]||0xa),'interval':_0x3ff9('0xaf')});}return respondWithRpcPromise(_0x3ff9('0xb7'),_0x3ff9('0xb8'),_0x5eba30);});}return respondWithRpcPromise('Start',_0x3ff9('0xb8'),_0x5eba30);})[_0x3ff9('0x22')](function(_0x32cb6b){if(_0x32cb6b){var _0xcb991b=0xc8;var _0x159584='receiveMessage';logger[_0x3ff9('0x23')](_0x3ff9('0x26'),_0x159584,_0xcb991b,'entity\x20found');logger[_0x3ff9('0x25')](_0x3ff9('0xb9'),_0x159584,_0xcb991b,_0x3ff9('0xba'),JSON['stringify'](_0x32cb6b));if(_0x5eba30['account'][_0x3ff9('0x44')]===_0x3ff9('0x9a')){return _0x583f3c[_0x3ff9('0x2f')](_0xcb991b)['set'](_0x3ff9('0xbb'),'text/xml')['send']('\x0a');}else{return _0x583f3c[_0x3ff9('0x2f')](_0xcb991b)['json'](_0x32cb6b);}}});})[_0x3ff9('0x2d')](handleError(_0x583f3c,null));};exports[_0x3ff9('0x3f')]=function(_0x13d021,_0x9d2037,_0x570bd3){var _0x2ffe56,_0x4c70e4,_0x108b9a;if(_[_0x3ff9('0xa2')](_0x13d021[_0x3ff9('0x5d')]['body'])||_0x13d021['body'][_0x3ff9('0x5d')]===''){throw new db['Sequelize'][(_0x3ff9('0x93'))](_0x3ff9('0xa3'));}if(_[_0x3ff9('0xa2')](_0x13d021['body']['to'])){throw new db[(_0x3ff9('0x92'))]['ValidationError']('to\x20is\x20mandatory');}_0x2ffe56=_0x13d021[_0x3ff9('0x5d')]['to'];return db[_0x3ff9('0x56')][_0x3ff9('0x61')]({'where':{'id':_0x13d021[_0x3ff9('0x5a')]['id']},'include':[{'model':db[_0x3ff9('0xbc')],'as':_0x3ff9('0xbd'),'include':[{'model':db[_0x3ff9('0x91')],'as':_0x3ff9('0xa6'),'where':{'mobile':_0x2ffe56},'limit':0x1,'order':[[_0x3ff9('0x96'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x9d2037,null))[_0x3ff9('0x22')](function(_0x184a4e){if(_0x184a4e&&_0x184a4e[_0x3ff9('0xbd')]){_0x4c70e4=_0x184a4e[_0x3ff9('0x3a')]({'plain':!![]});if(_0x4c70e4[_0x3ff9('0xbd')]&&_0x4c70e4[_0x3ff9('0xbd')][_0x3ff9('0xa6')][_0x3ff9('0x4d')]){return _0x4c70e4[_0x3ff9('0xbd')][_0x3ff9('0xa6')][0x0];}return db['CmContact']['create'](_[_0x3ff9('0x1b')](_0x13d021['body'],{'firstName':_0x2ffe56,'mobile':_0x2ffe56,'phone':_0x2ffe56,'ListId':_0x4c70e4[_0x3ff9('0x98')]}));}})['then'](handleEntityNotFound(_0x9d2037,null))[_0x3ff9('0x22')](function(_0x225a3e){if(_0x225a3e){_0x108b9a=_0x225a3e;return db[_0x3ff9('0xaa')]['find']({'where':{'ContactId':_0x108b9a['id'],'closed':![],'WhatsappAccountId':_0x4c70e4['id']}})[_0x3ff9('0x22')](function(_0x49fe46){if(_0x49fe46){return[_0x49fe46,![]];}return db[_0x3ff9('0xaa')][_0x3ff9('0x5c')]({'UserId':_0x13d021[_0x3ff9('0x5e')]['id'],'ContactId':_0x108b9a['id'],'WhatsappAccountId':_0x4c70e4['id'],'phone':_0x2ffe56,'firstMsgDirection':'out','Messages':[_[_0x3ff9('0x53')](_0x13d021[_0x3ff9('0x5d')],{'read':![],'body':_0x13d021['body'][_0x3ff9('0x5d')],'phone':_0x2ffe56,'WhatsappAccountId':_0x4c70e4['id'],'UserId':_0x13d021[_0x3ff9('0x5e')]['id'],'ContactId':_0x108b9a['id']})]},{'include':[{'model':db[_0x3ff9('0x8d')],'as':_0x3ff9('0xbe')}]})['then'](function(_0x5bb63f){return[_0x5bb63f,!![]];});});}})[_0x3ff9('0xbf')](function(_0x2b1930,_0x50746a){if(_0x50746a){return _0x2b1930;}return db['WhatsappMessage'][_0x3ff9('0x5c')](_[_0x3ff9('0x53')](_0x13d021['body'],{'read':![],'body':_0x13d021[_0x3ff9('0x5d')][_0x3ff9('0x5d')],'phone':_0x2ffe56,'WhatsappAccountId':_0x4c70e4['id'],'WhatsappInteractionId':_0x2b1930['id'],'UserId':_0x13d021[_0x3ff9('0x5e')]['id'],'ContactId':_0x108b9a['id']}))[_0x3ff9('0x22')](function(_0x4a9f17){_0x2b1930[_0x3ff9('0xc0')][_0x3ff9('0xbe')]=[];_0x2b1930[_0x3ff9('0xc0')][_0x3ff9('0xbe')][_0x3ff9('0xac')](_0x4a9f17['dataValues']);return _0x2b1930;});})[_0x3ff9('0x22')](respondWithResult(_0x9d2037,null))[_0x3ff9('0x2d')](handleError(_0x9d2037,null));}; \ No newline at end of file +var _0xafe3=['whatsapp:','messageId','sinch','notifications','isNil','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','Contacts','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','WhatsappMessage','AttachmentId','UserId','User','agent','*,*,*,*','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappAccount.socket','register','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','UserProfileResource','status','stack','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','keys','length','merge','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','findAll','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','userWhatsappAccount:remove','getAgents','addApplications','transaction','sequelize','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','finally','getApplications','notify','whatsapp','Applications','account','statuses','state','read','timestamp','message_id','orderBy','priority','asc','CmContact','Sequelize','updatedAt','difference','createdAt','CompanyId','mobile','twilio','from','replace'];(function(_0x31ee81,_0x18551f){var _0x23808f=function(_0x543034){while(--_0x543034){_0x31ee81['push'](_0x31ee81['shift']());}};_0x23808f(++_0x18551f);}(_0xafe3,0x1a7));var _0x3afe=function(_0x2dc831,_0x26682e){_0x2dc831=_0x2dc831-0x0;var _0xa9a976=_0xafe3[_0x2dc831];return _0xa9a976;};'use strict';var emlformat=require(_0x3afe('0x0'));var rimraf=require(_0x3afe('0x1'));var zipdir=require(_0x3afe('0x2'));var jsonpatch=require(_0x3afe('0x3'));var rp=require(_0x3afe('0x4'));var moment=require(_0x3afe('0x5'));var BPromise=require(_0x3afe('0x6'));var Mustache=require(_0x3afe('0x7'));var util=require(_0x3afe('0x8'));var path=require(_0x3afe('0x9'));var sox=require(_0x3afe('0xa'));var csv=require(_0x3afe('0xb'));var ejs=require(_0x3afe('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3afe('0xd'));var squel=require(_0x3afe('0xe'));var crypto=require(_0x3afe('0xf'));var jsforce=require(_0x3afe('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3afe('0xb'));var querystring=require('querystring');var Papa=require(_0x3afe('0x11'));var Redis=require(_0x3afe('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3afe('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3afe('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3afe('0x15'));var db=require(_0x3afe('0x16'))['db'];config[_0x3afe('0x17')]=_[_0x3afe('0x18')](config[_0x3afe('0x17')],{'host':_0x3afe('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3afe('0x17')]));require(_0x3afe('0x1a'))[_0x3afe('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x3afe('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x5ac9a8,_0x1d304b,_0x1c5c2e,_0x1601e6){return new BPromise(function(_0x27654a,_0x419bd4){var _0x1fa406=_0x1601e6||client;return _0x1fa406['request'](_0x5ac9a8,_0x1c5c2e)[_0x3afe('0x1d')](function(_0x39b634){logger[_0x3afe('0x1e')](_0x3afe('0x1f'),_0x1d304b,_0x3afe('0x20'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1d304b,'request\x20sent',JSON[_0x3afe('0x21')](_0x39b634));if(_0x39b634[_0x3afe('0x22')]){if(_0x39b634[_0x3afe('0x22')]['code']===0x1f4){logger['error'](_0x3afe('0x1f'),_0x1d304b,_0x39b634[_0x3afe('0x22')][_0x3afe('0x23')]);return _0x419bd4(_0x39b634[_0x3afe('0x22')][_0x3afe('0x23')]);}logger['error'](_0x3afe('0x1f'),_0x1d304b,_0x39b634[_0x3afe('0x22')][_0x3afe('0x23')]);return _0x27654a(_0x39b634['error'][_0x3afe('0x23')]);}else{logger[_0x3afe('0x1e')](_0x3afe('0x1f'),_0x1d304b,_0x3afe('0x20'));_0x27654a(_0x39b634['result'][_0x3afe('0x23')]);}})[_0x3afe('0x24')](function(_0x2cc822){logger[_0x3afe('0x22')](_0x3afe('0x1f'),_0x1d304b,_0x2cc822);_0x419bd4(_0x2cc822);});});}function respondWithStatusCode(_0x2babda,_0x44af75){_0x44af75=_0x44af75||0xcc;return function(_0x10e949){if(_0x10e949){return _0x2babda[_0x3afe('0x25')](_0x44af75);}return _0x2babda['status'](_0x44af75)[_0x3afe('0x26')]();};}function respondWithResult(_0x5923f5,_0x33be7c){_0x33be7c=_0x33be7c||0xc8;return function(_0x2a6287){if(_0x2a6287){return _0x5923f5['status'](_0x33be7c)[_0x3afe('0x27')](_0x2a6287);}};}function respondWithFilteredResult(_0x119e9c,_0x5590ea){return function(_0xf31c35){if(_0xf31c35){var _0x1af897=typeof _0x5590ea[_0x3afe('0x28')]===_0x3afe('0x29')&&typeof _0x5590ea[_0x3afe('0x2a')]==='undefined';var _0x570054=_0xf31c35[_0x3afe('0x2b')];var _0x14f838=_0x1af897?0x0:_0x5590ea[_0x3afe('0x28')];var _0x29dd2d=_0x1af897?_0xf31c35['count']:_0x5590ea[_0x3afe('0x28')]+_0x5590ea[_0x3afe('0x2a')];var _0x284245;if(_0x29dd2d>=_0x570054){_0x29dd2d=_0x570054;_0x284245=0xc8;}else{_0x284245=0xce;}_0x119e9c['status'](_0x284245);return _0x119e9c[_0x3afe('0x2c')](_0x3afe('0x2d'),_0x14f838+'-'+_0x29dd2d+'/'+_0x570054)['json'](_0xf31c35);}return null;};}function patchUpdates(_0x53a3d8){return function(_0x842702){try{jsonpatch[_0x3afe('0x2e')](_0x842702,_0x53a3d8,!![]);}catch(_0x2d071c){return BPromise['reject'](_0x2d071c);}return _0x842702[_0x3afe('0x2f')]();};}function saveUpdates(_0x107f49,_0xe48bf8){return function(_0xd32ee0){if(_0xd32ee0){return _0xd32ee0['update'](_0x107f49)[_0x3afe('0x1d')](function(_0x5f107b){return _0x5f107b;});}return null;};}function removeEntity(_0x1a6a8b,_0x231a64){return function(_0x12c5f6){if(_0x12c5f6){return _0x12c5f6[_0x3afe('0x30')]()['then'](function(){var _0x530ee3=_0x12c5f6['get']({'plain':!![]});var _0xa3f96d='WhatsappAccounts';return db[_0x3afe('0x31')][_0x3afe('0x30')]({'where':{'type':_0xa3f96d,'resourceId':_0x530ee3['id']}})['then'](function(){return _0x12c5f6;});})[_0x3afe('0x1d')](function(){_0x1a6a8b[_0x3afe('0x32')](0xcc)[_0x3afe('0x26')]();});}};}function handleEntityNotFound(_0x46f40c,_0x3b77ff){return function(_0x26b76e){if(!_0x26b76e){_0x46f40c[_0x3afe('0x25')](0x194);}return _0x26b76e;};}function handleError(_0xaa3621,_0x4e8fc4){_0x4e8fc4=_0x4e8fc4||0x1f4;return function(_0x419589){logger['error'](_0x419589[_0x3afe('0x33')]);if(_0x419589['name']){delete _0x419589[_0x3afe('0x34')];}_0xaa3621[_0x3afe('0x32')](_0x4e8fc4)[_0x3afe('0x35')](_0x419589);};}exports[_0x3afe('0x36')]=function(_0x2846f8,_0x59b557){var _0x5a78b7={'include':[{'model':db[_0x3afe('0x37')],'as':_0x3afe('0x38')}]},_0x1713a3={},_0x152ee7={'count':0x0,'rows':[]};var _0x1d8257=_['map'](db[_0x3afe('0x39')][_0x3afe('0x3a')],function(_0x1e7113){return{'name':_0x1e7113[_0x3afe('0x3b')],'type':_0x1e7113[_0x3afe('0x3c')][_0x3afe('0x3d')]};});_0x1713a3[_0x3afe('0x3e')]=_[_0x3afe('0x3f')](_0x1d8257,_0x3afe('0x34'));_0x1713a3[_0x3afe('0x40')]=_['keys'](_0x2846f8['query']);_0x1713a3[_0x3afe('0x41')]=_[_0x3afe('0x42')](_0x1713a3[_0x3afe('0x3e')],_0x1713a3[_0x3afe('0x40')]);_0x5a78b7[_0x3afe('0x43')]=_[_0x3afe('0x42')](_0x1713a3['model'],qs['fields'](_0x2846f8[_0x3afe('0x40')][_0x3afe('0x44')]));_0x5a78b7[_0x3afe('0x43')]=_0x5a78b7['attributes']['length']?_0x5a78b7[_0x3afe('0x43')]:_0x1713a3[_0x3afe('0x3e')];if(!_0x2846f8[_0x3afe('0x40')][_0x3afe('0x45')]('nolimit')){_0x5a78b7[_0x3afe('0x2a')]=qs[_0x3afe('0x2a')](_0x2846f8[_0x3afe('0x40')][_0x3afe('0x2a')]);_0x5a78b7[_0x3afe('0x28')]=qs[_0x3afe('0x28')](_0x2846f8[_0x3afe('0x40')][_0x3afe('0x28')]);}_0x5a78b7[_0x3afe('0x46')]=qs[_0x3afe('0x47')](_0x2846f8[_0x3afe('0x40')][_0x3afe('0x47')]);_0x5a78b7[_0x3afe('0x48')]=qs[_0x3afe('0x41')](_[_0x3afe('0x49')](_0x2846f8[_0x3afe('0x40')],_0x1713a3[_0x3afe('0x41')]),_0x1d8257);if(_0x2846f8[_0x3afe('0x40')][_0x3afe('0x4a')]){_0x5a78b7[_0x3afe('0x48')]=_['merge'](_0x5a78b7['where'],{'$or':_[_0x3afe('0x3f')](_0x1d8257,function(_0x124106){if(_0x124106[_0x3afe('0x3c')]!==_0x3afe('0x4b')){var _0x41cca6={};_0x41cca6[_0x124106[_0x3afe('0x34')]]={'$like':'%'+_0x2846f8[_0x3afe('0x40')]['filter']+'%'};return _0x41cca6;}})});}_0x5a78b7=_['merge']({},_0x5a78b7,_0x2846f8[_0x3afe('0x4c')]);var _0x4666db={'where':_0x5a78b7[_0x3afe('0x48')]};return db[_0x3afe('0x39')]['count'](_0x4666db)['then'](function(_0x28242b){_0x152ee7['count']=_0x28242b;if(_0x2846f8['query'][_0x3afe('0x4d')]){_0x5a78b7[_0x3afe('0x4e')]=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x5a78b7);})['then'](function(_0x27f22a){_0x152ee7[_0x3afe('0x4f')]=_0x27f22a;return _0x152ee7;})['then'](respondWithFilteredResult(_0x59b557,_0x5a78b7))[_0x3afe('0x24')](handleError(_0x59b557,null));};exports[_0x3afe('0x50')]=function(_0x6f37bb,_0x3c47b5){var _0x26b75a={'raw':![],'where':{'id':_0x6f37bb[_0x3afe('0x51')]['id']},'include':[{'model':db[_0x3afe('0x37')],'as':_0x3afe('0x38')}]},_0x5e2af4={};_0x5e2af4['model']=_[_0x3afe('0x52')](db[_0x3afe('0x39')]['rawAttributes']);_0x5e2af4[_0x3afe('0x40')]=_[_0x3afe('0x52')](_0x6f37bb[_0x3afe('0x40')]);_0x5e2af4[_0x3afe('0x41')]=_[_0x3afe('0x42')](_0x5e2af4[_0x3afe('0x3e')],_0x5e2af4[_0x3afe('0x40')]);_0x26b75a[_0x3afe('0x43')]=_['intersection'](_0x5e2af4['model'],qs[_0x3afe('0x44')](_0x6f37bb[_0x3afe('0x40')][_0x3afe('0x44')]));_0x26b75a[_0x3afe('0x43')]=_0x26b75a['attributes'][_0x3afe('0x53')]?_0x26b75a[_0x3afe('0x43')]:_0x5e2af4[_0x3afe('0x3e')];if(_0x6f37bb[_0x3afe('0x40')]['includeAll']){_0x26b75a[_0x3afe('0x4e')]=[{'all':!![]}];}_0x26b75a=_[_0x3afe('0x54')]({},_0x26b75a,_0x6f37bb['options']);return db[_0x3afe('0x39')][_0x3afe('0x55')](_0x26b75a)[_0x3afe('0x1d')](handleEntityNotFound(_0x3c47b5,null))[_0x3afe('0x1d')](respondWithResult(_0x3c47b5,null))[_0x3afe('0x24')](handleError(_0x3c47b5,null));};exports[_0x3afe('0x56')]=function(_0x35c79f,_0x200791){return db['WhatsappAccount']['create'](_0x35c79f['body'],{})[_0x3afe('0x1d')](function(_0x242db1){var _0x392e7b=_0x35c79f['user'][_0x3afe('0x57')]({'plain':!![]});if(!_0x392e7b)throw new Error(_0x3afe('0x58'));if(_0x392e7b[_0x3afe('0x59')]===_0x3afe('0x5a')){var _0x43e418=_0x242db1[_0x3afe('0x57')]({'plain':!![]});var _0x42df90=_0x3afe('0x5b');return db[_0x3afe('0x5c')][_0x3afe('0x55')]({'where':{'name':_0x42df90,'userProfileId':_0x392e7b[_0x3afe('0x5d')]},'raw':!![]})['then'](function(_0x1632f2){if(_0x1632f2&&_0x1632f2[_0x3afe('0x5e')]===0x0){return db['UserProfileResource'][_0x3afe('0x56')]({'name':_0x43e418[_0x3afe('0x34')],'resourceId':_0x43e418['id'],'type':_0x1632f2[_0x3afe('0x34')],'sectionId':_0x1632f2['id']},{})[_0x3afe('0x1d')](function(){return _0x242db1;});}else{return _0x242db1;}})[_0x3afe('0x24')](function(_0x54b673){logger[_0x3afe('0x22')](_0x3afe('0x5f'),_0x54b673);throw _0x54b673;});}return _0x242db1;})[_0x3afe('0x1d')](respondWithResult(_0x200791,0xc9))[_0x3afe('0x24')](handleError(_0x200791,null));};exports[_0x3afe('0x60')]=function(_0x67c5cb,_0x4272d3){if(_0x67c5cb[_0x3afe('0x61')]['id']){delete _0x67c5cb[_0x3afe('0x61')]['id'];}return db[_0x3afe('0x39')][_0x3afe('0x55')]({'where':{'id':_0x67c5cb[_0x3afe('0x51')]['id']},'include':[{'model':db[_0x3afe('0x37')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4272d3,null))['then'](saveUpdates(_0x67c5cb[_0x3afe('0x61')],null))[_0x3afe('0x1d')](respondWithResult(_0x4272d3,null))[_0x3afe('0x24')](handleError(_0x4272d3,null));};exports[_0x3afe('0x30')]=function(_0x530605,_0x1792ac){return db[_0x3afe('0x39')][_0x3afe('0x55')]({'where':{'id':_0x530605['params']['id']}})['then'](handleEntityNotFound(_0x1792ac,null))[_0x3afe('0x1d')](removeEntity(_0x1792ac,null))['catch'](handleError(_0x1792ac,null));};exports[_0x3afe('0x62')]=function(_0x222873,_0x4de89f){return db['WhatsappAccount'][_0x3afe('0x62')]()[_0x3afe('0x1d')](respondWithResult(_0x4de89f,null))['catch'](handleError(_0x4de89f,null));};exports[_0x3afe('0x63')]=function(_0x11e172,_0xc27c3d,_0x4a15ce){if(_0x11e172['body']['id']){delete _0x11e172[_0x3afe('0x61')]['id'];}return db['WhatsappAccount'][_0x3afe('0x55')]({'where':{'id':_0x11e172[_0x3afe('0x51')]['id']}})[_0x3afe('0x1d')](handleEntityNotFound(_0xc27c3d,null))[_0x3afe('0x1d')](function(_0x319beb){if(_0x319beb){_0x11e172['body'][_0x3afe('0x64')]=_0x319beb['id'];return db[_0x3afe('0x65')][_0x3afe('0x56')](_0x11e172['body']);}})['then'](respondWithResult(_0xc27c3d,null))[_0x3afe('0x24')](handleError(_0xc27c3d,null));};exports[_0x3afe('0x66')]=function(_0x58d96b,_0x172524,_0xe9817f){var _0x231414={'raw':![],'where':{}};var _0x41477a={};var _0x5e3e7e={'count':0x0,'rows':[]};return db[_0x3afe('0x39')][_0x3afe('0x67')]({'where':{'id':_0x58d96b[_0x3afe('0x51')]['id']}})['then'](handleEntityNotFound(_0x172524,null))['then'](function(_0x4cd62e){if(_0x4cd62e){_0x41477a[_0x3afe('0x3e')]=_[_0x3afe('0x52')](db[_0x3afe('0x65')][_0x3afe('0x3a')]);_0x41477a[_0x3afe('0x40')]=_[_0x3afe('0x52')](_0x58d96b[_0x3afe('0x40')]);_0x41477a[_0x3afe('0x41')]=_[_0x3afe('0x42')](_0x41477a[_0x3afe('0x3e')],_0x41477a[_0x3afe('0x40')]);_0x231414[_0x3afe('0x43')]=_['intersection'](_0x41477a[_0x3afe('0x3e')],qs[_0x3afe('0x44')](_0x58d96b[_0x3afe('0x40')][_0x3afe('0x44')]));_0x231414[_0x3afe('0x43')]=_0x231414[_0x3afe('0x43')][_0x3afe('0x53')]?_0x231414[_0x3afe('0x43')]:_0x41477a[_0x3afe('0x3e')];if(!_0x58d96b['query'][_0x3afe('0x45')](_0x3afe('0x68'))){_0x231414[_0x3afe('0x2a')]=qs['limit'](_0x58d96b[_0x3afe('0x40')][_0x3afe('0x2a')]);_0x231414[_0x3afe('0x28')]=qs[_0x3afe('0x28')](_0x58d96b[_0x3afe('0x40')][_0x3afe('0x28')]);}_0x231414[_0x3afe('0x46')]=qs[_0x3afe('0x47')](_0x58d96b[_0x3afe('0x40')][_0x3afe('0x47')]);_0x231414[_0x3afe('0x48')]=qs['filters'](_[_0x3afe('0x49')](_0x58d96b['query'],_0x41477a[_0x3afe('0x41')]));_0x231414[_0x3afe('0x48')][_0x3afe('0x64')]=_0x4cd62e['id'];if(_0x58d96b[_0x3afe('0x40')][_0x3afe('0x4a')]){_0x231414[_0x3afe('0x48')]=_[_0x3afe('0x54')](_0x231414[_0x3afe('0x48')],{'$or':_[_0x3afe('0x3f')](_0x231414[_0x3afe('0x43')],function(_0xf13a6f){var _0x26388f={};_0x26388f[_0xf13a6f]={'$like':'%'+_0x58d96b['query'][_0x3afe('0x4a')]+'%'};return _0x26388f;})});}_0x231414=_[_0x3afe('0x54')]({},_0x231414,_0x58d96b[_0x3afe('0x4c')]);return db[_0x3afe('0x65')]['count']({'where':_0x231414['where']})[_0x3afe('0x1d')](function(_0x1b8064){_0x5e3e7e[_0x3afe('0x2b')]=_0x1b8064;if(_0x58d96b[_0x3afe('0x40')][_0x3afe('0x4d')]){_0x231414['include']=[{'all':!![]}];}return db[_0x3afe('0x65')]['findAll'](_0x231414);})[_0x3afe('0x1d')](function(_0x1f918e){_0x5e3e7e[_0x3afe('0x4f')]=_0x1f918e;return _0x5e3e7e;});}})['then'](respondWithFilteredResult(_0x172524,_0x231414))[_0x3afe('0x24')](handleError(_0x172524,null));};exports[_0x3afe('0x69')]=function(_0x2f2efa,_0x166b93,_0x3e1249){return db['WhatsappAccount'][_0x3afe('0x55')]({'where':{'id':_0x2f2efa['params']['id']}})[_0x3afe('0x1d')](handleEntityNotFound(_0x166b93,null))[_0x3afe('0x1d')](function(_0x52a31b){if(_0x52a31b){return _0x52a31b[_0x3afe('0x69')](_0x2f2efa[_0x3afe('0x40')][_0x3afe('0x6a')]);}})[_0x3afe('0x1d')](respondWithStatusCode(_0x166b93,null))['catch'](handleError(_0x166b93,null));};exports[_0x3afe('0x6b')]=function(_0x7c4ae,_0x47320f,_0x434ec7){if(_0x7c4ae[_0x3afe('0x61')]['id']){delete _0x7c4ae['body']['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x7c4ae[_0x3afe('0x51')]['id']}})[_0x3afe('0x1d')](handleEntityNotFound(_0x47320f,null))[_0x3afe('0x1d')](function(_0x477b60){if(_0x477b60){_0x7c4ae['body']['WhatsappAccountId']=_0x477b60['id'];return db['CannedAnswer'][_0x3afe('0x56')](_0x7c4ae['body']);}})[_0x3afe('0x1d')](respondWithResult(_0x47320f,null))[_0x3afe('0x24')](handleError(_0x47320f,null));};exports[_0x3afe('0x6c')]=function(_0x2ea5e3,_0x545900,_0x9b06d7){var _0x55af91={'raw':![],'where':{}};var _0x3f8fb7={};var _0x39f777={'count':0x0,'rows':[]};return db[_0x3afe('0x39')][_0x3afe('0x67')]({'where':{'id':_0x2ea5e3['params']['id']}})['then'](handleEntityNotFound(_0x545900,null))['then'](function(_0x144f00){if(_0x144f00){_0x3f8fb7[_0x3afe('0x3e')]=_[_0x3afe('0x52')](db['CannedAnswer'][_0x3afe('0x3a')]);_0x3f8fb7[_0x3afe('0x40')]=_[_0x3afe('0x52')](_0x2ea5e3[_0x3afe('0x40')]);_0x3f8fb7[_0x3afe('0x41')]=_['intersection'](_0x3f8fb7[_0x3afe('0x3e')],_0x3f8fb7['query']);_0x55af91[_0x3afe('0x43')]=_[_0x3afe('0x42')](_0x3f8fb7[_0x3afe('0x3e')],qs['fields'](_0x2ea5e3[_0x3afe('0x40')][_0x3afe('0x44')]));_0x55af91['attributes']=_0x55af91[_0x3afe('0x43')][_0x3afe('0x53')]?_0x55af91[_0x3afe('0x43')]:_0x3f8fb7['model'];if(!_0x2ea5e3[_0x3afe('0x40')][_0x3afe('0x45')](_0x3afe('0x68'))){_0x55af91['limit']=qs[_0x3afe('0x2a')](_0x2ea5e3['query']['limit']);_0x55af91[_0x3afe('0x28')]=qs['offset'](_0x2ea5e3[_0x3afe('0x40')][_0x3afe('0x28')]);}_0x55af91['order']=qs[_0x3afe('0x47')](_0x2ea5e3[_0x3afe('0x40')][_0x3afe('0x47')]);_0x55af91['where']=qs['filters'](_[_0x3afe('0x49')](_0x2ea5e3[_0x3afe('0x40')],_0x3f8fb7[_0x3afe('0x41')]));_0x55af91['where'][_0x3afe('0x64')]=_0x144f00['id'];if(_0x2ea5e3[_0x3afe('0x40')]['filter']){_0x55af91[_0x3afe('0x48')]=_[_0x3afe('0x54')](_0x55af91[_0x3afe('0x48')],{'$or':_[_0x3afe('0x3f')](_0x55af91['attributes'],function(_0x50a81e){var _0x2a84ad={};_0x2a84ad[_0x50a81e]={'$like':'%'+_0x2ea5e3[_0x3afe('0x40')]['filter']+'%'};return _0x2a84ad;})});}_0x55af91=_[_0x3afe('0x54')]({},_0x55af91,_0x2ea5e3[_0x3afe('0x4c')]);return db[_0x3afe('0x6d')][_0x3afe('0x2b')]({'where':_0x55af91['where']})[_0x3afe('0x1d')](function(_0x258da){_0x39f777[_0x3afe('0x2b')]=_0x258da;if(_0x2ea5e3[_0x3afe('0x40')][_0x3afe('0x4d')]){_0x55af91[_0x3afe('0x4e')]=[{'all':!![]}];}return db[_0x3afe('0x6d')][_0x3afe('0x6e')](_0x55af91);})[_0x3afe('0x1d')](function(_0x4916f6){_0x39f777[_0x3afe('0x4f')]=_0x4916f6;return _0x39f777;});}})[_0x3afe('0x1d')](respondWithFilteredResult(_0x545900,_0x55af91))['catch'](handleError(_0x545900,null));};exports[_0x3afe('0x6f')]=function(_0x1030db,_0x405890,_0x30465c){return db[_0x3afe('0x39')][_0x3afe('0x55')]({'where':{'id':_0x1030db[_0x3afe('0x51')]['id']}})[_0x3afe('0x1d')](handleEntityNotFound(_0x405890,null))[_0x3afe('0x1d')](function(_0x3f12b2){if(_0x3f12b2){return _0x3f12b2[_0x3afe('0x6f')](_0x1030db[_0x3afe('0x40')][_0x3afe('0x6a')]);}})[_0x3afe('0x1d')](respondWithStatusCode(_0x405890,null))[_0x3afe('0x24')](handleError(_0x405890,null));};exports[_0x3afe('0x70')]=function(_0x26bdf2,_0x4149f6,_0x531fc4){return db[_0x3afe('0x39')][_0x3afe('0x55')]({'where':{'id':_0x26bdf2[_0x3afe('0x51')]['id']}})[_0x3afe('0x1d')](handleEntityNotFound(_0x4149f6,null))[_0x3afe('0x1d')](function(_0x217682){if(_0x217682){return _0x217682[_0x3afe('0x70')](_0x26bdf2[_0x3afe('0x61')]['ids'],_[_0x3afe('0x71')](_0x26bdf2[_0x3afe('0x61')],[_0x3afe('0x6a'),'id'])||{})[_0x3afe('0x72')](function(_0x2577c6){for(var _0x221b2d=0x0;_0x221b2d<_0x26bdf2['body'][_0x3afe('0x6a')][_0x3afe('0x53')];_0x221b2d+=0x1){socket[_0x3afe('0x73')](_0x3afe('0x74'),{'UserId':Number(_0x26bdf2[_0x3afe('0x61')][_0x3afe('0x6a')][_0x221b2d]),'WhatsappAccountId':Number(_0x26bdf2[_0x3afe('0x51')]['id'])});}return _0x2577c6;});}})[_0x3afe('0x1d')](respondWithResult(_0x4149f6,null))[_0x3afe('0x24')](handleError(_0x4149f6,null));};exports['removeAgents']=function(_0x3d9a95,_0x5418ad,_0x113140){return db[_0x3afe('0x39')][_0x3afe('0x55')]({'where':{'id':_0x3d9a95[_0x3afe('0x51')]['id']}})[_0x3afe('0x1d')](handleEntityNotFound(_0x5418ad,null))[_0x3afe('0x1d')](function(_0x297697){if(_0x297697){return _0x297697['removeAgents'](_0x3d9a95['query'][_0x3afe('0x6a')])[_0x3afe('0x1d')](function(){if(_['isArray'](_0x3d9a95[_0x3afe('0x40')][_0x3afe('0x6a')])){for(var _0x43b6f3=0x0;_0x43b6f3<_0x3d9a95[_0x3afe('0x40')][_0x3afe('0x6a')][_0x3afe('0x53')];_0x43b6f3+=0x1){socket[_0x3afe('0x73')](_0x3afe('0x75'),{'UserId':Number(_0x3d9a95[_0x3afe('0x40')][_0x3afe('0x6a')][_0x43b6f3]),'WhatsappAccountId':Number(_0x3d9a95[_0x3afe('0x51')]['id'])});}}else{socket['emit'](_0x3afe('0x75'),{'UserId':Number(_0x3d9a95[_0x3afe('0x40')][_0x3afe('0x6a')]),'WhatsappAccountId':Number(_0x3d9a95['params']['id'])});}});}})[_0x3afe('0x1d')](respondWithStatusCode(_0x5418ad,null))[_0x3afe('0x24')](handleError(_0x5418ad,null));};exports['getAgents']=function(_0x14ad32,_0x264d86,_0x5ce823){var _0x256469={};var _0x5b76c0={};var _0x4e468b;var _0x153e2c;return db[_0x3afe('0x39')][_0x3afe('0x67')]({'where':{'id':_0x14ad32['params']['id']}})[_0x3afe('0x1d')](handleEntityNotFound(_0x264d86,null))['then'](function(_0x1255e5){if(_0x1255e5){_0x4e468b=_0x1255e5;_0x5b76c0[_0x3afe('0x3e')]=_[_0x3afe('0x52')](db['User'][_0x3afe('0x3a')]);_0x5b76c0[_0x3afe('0x40')]=_[_0x3afe('0x52')](_0x14ad32[_0x3afe('0x40')]);_0x5b76c0['filters']=_[_0x3afe('0x42')](_0x5b76c0[_0x3afe('0x3e')],_0x5b76c0[_0x3afe('0x40')]);_0x256469[_0x3afe('0x43')]=_[_0x3afe('0x42')](_0x5b76c0['model'],qs[_0x3afe('0x44')](_0x14ad32[_0x3afe('0x40')]['fields']));_0x256469[_0x3afe('0x43')]=_0x256469['attributes'][_0x3afe('0x53')]?_0x256469[_0x3afe('0x43')]:_0x5b76c0[_0x3afe('0x3e')];_0x256469[_0x3afe('0x46')]=qs[_0x3afe('0x47')](_0x14ad32[_0x3afe('0x40')][_0x3afe('0x47')]);_0x256469[_0x3afe('0x48')]=qs[_0x3afe('0x41')](_['pick'](_0x14ad32['query'],_0x5b76c0['filters']));if(_0x14ad32[_0x3afe('0x40')][_0x3afe('0x4a')]){_0x256469[_0x3afe('0x48')]=_[_0x3afe('0x54')](_0x256469[_0x3afe('0x48')],{'$or':_[_0x3afe('0x3f')](_0x256469[_0x3afe('0x43')],function(_0x4d0e5b){var _0x2c0efb={};_0x2c0efb[_0x4d0e5b]={'$like':'%'+_0x14ad32[_0x3afe('0x40')]['filter']+'%'};return _0x2c0efb;})});}_0x256469=_[_0x3afe('0x54')]({},_0x256469,_0x14ad32['options']);return _0x4e468b[_0x3afe('0x76')](_0x256469);}})['then'](function(_0x3febf2){if(_0x3febf2){_0x153e2c=_0x3febf2[_0x3afe('0x53')];if(!_0x14ad32[_0x3afe('0x40')][_0x3afe('0x45')](_0x3afe('0x68'))){_0x256469[_0x3afe('0x2a')]=qs[_0x3afe('0x2a')](_0x14ad32[_0x3afe('0x40')][_0x3afe('0x2a')]);_0x256469[_0x3afe('0x28')]=qs[_0x3afe('0x28')](_0x14ad32[_0x3afe('0x40')][_0x3afe('0x28')]);}return _0x4e468b['getAgents'](_0x256469);}})[_0x3afe('0x1d')](function(_0x21a18e){if(_0x21a18e){return _0x21a18e?{'count':_0x153e2c,'rows':_0x21a18e}:null;}})['then'](respondWithResult(_0x264d86,null))[_0x3afe('0x24')](handleError(_0x264d86,null));};exports[_0x3afe('0x77')]=function(_0x50ecbd,_0x441abb){var _0x2ca077=_0x50ecbd[_0x3afe('0x51')]['id'];var _0x4fbddb=_0x50ecbd[_0x3afe('0x61')];var _0x1fe936=0xc8;var _0x5680c0=null;return db['sequelize'][_0x3afe('0x78')]({'isolationLevel':db[_0x3afe('0x79')]['Transaction'][_0x3afe('0x7a')]['READ_COMMITTED']},function(_0x6bb0c9){return db['WhatsappAccount'][_0x3afe('0x67')]({'where':{'id':_0x2ca077},'transaction':_0x6bb0c9})['then'](function(_0x46a806){if(_0x46a806){return db[_0x3afe('0x7b')][_0x3afe('0x30')]({'where':{'WhatsappAccountId':_0x2ca077},'transaction':_0x6bb0c9})[_0x3afe('0x1d')](function(){var _0x54c867=_[_0x3afe('0x3f')](_0x4fbddb,function(_0x59351a){_0x59351a[_0x3afe('0x64')]=_0x2ca077;return _0x59351a;});return db['WhatsappApplication'][_0x3afe('0x7c')](_0x54c867,{'transaction':_0x6bb0c9});});}else{_0x1fe936=0x194;_0x5680c0=[];}});})[_0x3afe('0x1d')](function(){if(_0x1fe936!==0x194){return db['WhatsappApplication'][_0x3afe('0x7d')]({'where':{'WhatsappAccountId':_0x2ca077},'order':'priority'})[_0x3afe('0x1d')](function(_0x22e40b){_0x5680c0=_0x22e40b;});}})[_0x3afe('0x24')](function(_0x4a20eb){_0x1fe936=0x1f4;logger[_0x3afe('0x22')](_0x4a20eb['stack']);if(_0x4a20eb['name']){delete _0x4a20eb[_0x3afe('0x34')];}_0x5680c0=_0x4a20eb;})[_0x3afe('0x7e')](function(){if(_0x5680c0===null){_0x441abb['sendStatus'](_0x1fe936);}else{if(_0x1fe936===0x1f4){_0x441abb['status'](_0x1fe936)[_0x3afe('0x35')](_0x5680c0);}else{_0x441abb['status'](_0x1fe936)[_0x3afe('0x27')](_0x5680c0);}}});};exports[_0x3afe('0x7f')]=function(_0x33d3ea,_0xbcaf2c,_0x4c13e6){var _0x6cdfc1={};var _0x1d6b10={};var _0x475016;var _0x132073;return db[_0x3afe('0x39')][_0x3afe('0x67')]({'where':{'id':_0x33d3ea[_0x3afe('0x51')]['id']}})[_0x3afe('0x1d')](handleEntityNotFound(_0xbcaf2c,null))[_0x3afe('0x1d')](function(_0x5a1026){if(_0x5a1026){_0x475016=_0x5a1026;_0x1d6b10[_0x3afe('0x3e')]=_['keys'](db[_0x3afe('0x7b')][_0x3afe('0x3a')]);_0x1d6b10[_0x3afe('0x40')]=_[_0x3afe('0x52')](_0x33d3ea[_0x3afe('0x40')]);_0x1d6b10[_0x3afe('0x41')]=_['intersection'](_0x1d6b10['model'],_0x1d6b10[_0x3afe('0x40')]);_0x6cdfc1[_0x3afe('0x43')]=_['intersection'](_0x1d6b10[_0x3afe('0x3e')],qs[_0x3afe('0x44')](_0x33d3ea[_0x3afe('0x40')][_0x3afe('0x44')]));_0x6cdfc1[_0x3afe('0x43')]=_0x6cdfc1['attributes']['length']?_0x6cdfc1['attributes']:_0x1d6b10[_0x3afe('0x3e')];_0x6cdfc1[_0x3afe('0x46')]=qs[_0x3afe('0x47')](_0x33d3ea[_0x3afe('0x40')][_0x3afe('0x47')]);_0x6cdfc1[_0x3afe('0x48')]=qs[_0x3afe('0x41')](_[_0x3afe('0x49')](_0x33d3ea[_0x3afe('0x40')],_0x1d6b10['filters']));if(_0x33d3ea[_0x3afe('0x40')]['filter']){_0x6cdfc1[_0x3afe('0x48')]=_[_0x3afe('0x54')](_0x6cdfc1[_0x3afe('0x48')],{'$or':_[_0x3afe('0x3f')](_0x6cdfc1['attributes'],function(_0x317347){var _0x306bc0={};_0x306bc0[_0x317347]={'$like':'%'+_0x33d3ea['query'][_0x3afe('0x4a')]+'%'};return _0x306bc0;})});}_0x6cdfc1=_[_0x3afe('0x54')]({},_0x6cdfc1,_0x33d3ea[_0x3afe('0x4c')]);return _0x475016[_0x3afe('0x7f')](_0x6cdfc1);}})[_0x3afe('0x1d')](function(_0x121fdc){if(_0x121fdc){_0x132073=_0x121fdc[_0x3afe('0x53')];if(!_0x33d3ea[_0x3afe('0x40')][_0x3afe('0x45')](_0x3afe('0x68'))){_0x6cdfc1[_0x3afe('0x2a')]=qs['limit'](_0x33d3ea['query'][_0x3afe('0x2a')]);_0x6cdfc1[_0x3afe('0x28')]=qs[_0x3afe('0x28')](_0x33d3ea[_0x3afe('0x40')][_0x3afe('0x28')]);}return _0x475016['getApplications'](_0x6cdfc1);}})[_0x3afe('0x1d')](function(_0x666f4f){if(_0x666f4f){return _0x666f4f?{'count':_0x132073,'rows':_0x666f4f}:null;}})[_0x3afe('0x1d')](respondWithResult(_0xbcaf2c,null))[_0x3afe('0x24')](handleError(_0xbcaf2c,null));};exports[_0x3afe('0x80')]=function(_0x28807f,_0x51e5e6,_0x2c2431){var _0x4da8fa={'channel':_0x3afe('0x81')};var _0x2e7f77=[];var _0x42cb67=[];var _0x35a6ec={};return db['WhatsappAccount'][_0x3afe('0x55')]({'where':{'id':_0x28807f[_0x3afe('0x51')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x3afe('0x82')}]})[_0x3afe('0x1d')](handleEntityNotFound(_0x51e5e6,null))['then'](function(_0x14b5bf){_0x4da8fa[_0x3afe('0x83')]=_0x14b5bf;if(_0x4da8fa['account']&&_0x4da8fa[_0x3afe('0x83')]['type']==='sinch'&&_0x28807f[_0x3afe('0x61')][_0x3afe('0x84')]){if(_0x28807f[_0x3afe('0x61')][_0x3afe('0x84')][_0x3afe('0x53')]===0x0)return;if(_0x28807f['body'][_0x3afe('0x84')][0x0][_0x3afe('0x85')]!==_0x3afe('0x86'))return;return db['WhatsappMessage'][_0x3afe('0x60')]({'read':!![],'readAt':_0x28807f[_0x3afe('0x61')][_0x3afe('0x84')][0x0][_0x3afe('0x87')]},{'where':{'messageId':_0x28807f[_0x3afe('0x61')]['statuses'][0x0][_0x3afe('0x88')]},'individualHooks':!![]})[_0x3afe('0x1d')](function(_0x12e8e8){return _0x51e5e6[_0x3afe('0x32')](0xc8)[_0x3afe('0x27')](_0x12e8e8);});}_0x4da8fa['applications']=_[_0x3afe('0x89')](_0x14b5bf[_0x3afe('0x82')],[_0x3afe('0x8a')],[_0x3afe('0x8b')]);if(_0x4da8fa[_0x3afe('0x83')]['Applications']){delete _0x4da8fa[_0x3afe('0x83')][_0x3afe('0x82')];}return db[_0x3afe('0x8c')][_0x3afe('0x62')]()[_0x3afe('0x1d')](function(_0x47e349){if(!_0x47e349){throw new db[(_0x3afe('0x8d'))]['ValidationError']('no\x20available\x20attributes');}_0x2e7f77=_['difference'](_['keys'](_0x47e349),['createdAt',_0x3afe('0x8e')]);_0x42cb67=_[_0x3afe('0x8f')](_[_0x3afe('0x52')](_0x47e349),[_0x3afe('0x90'),'updatedAt',_0x3afe('0x91'),'ListId']);_0x4da8fa[_0x3afe('0x61')]={'mapKey':_0x3afe('0x92')};if(_0x4da8fa[_0x3afe('0x83')]&&_0x4da8fa[_0x3afe('0x83')][_0x3afe('0x3c')]===_0x3afe('0x93')){_0x4da8fa[_0x3afe('0x61')][_0x3afe('0x94')]=_0x28807f[_0x3afe('0x61')]['From'][_0x3afe('0x95')](_0x3afe('0x96'),'');_0x4da8fa[_0x3afe('0x61')][_0x3afe('0x61')]=_0x28807f[_0x3afe('0x61')]['Body'];_0x4da8fa[_0x3afe('0x61')][_0x3afe('0x97')]=_0x28807f[_0x3afe('0x61')]['MessageSid'];}if(_0x4da8fa[_0x3afe('0x83')]&&_0x4da8fa[_0x3afe('0x83')]['type']===_0x3afe('0x98')){_0x4da8fa['body'][_0x3afe('0x94')]=_0x28807f[_0x3afe('0x61')][_0x3afe('0x99')][0x0][_0x3afe('0x94')];_0x4da8fa[_0x3afe('0x61')][_0x3afe('0x61')]=_0x28807f[_0x3afe('0x61')][_0x3afe('0x99')][0x0][_0x3afe('0x23')]['body'];_0x4da8fa['body'][_0x3afe('0x97')]=_0x28807f[_0x3afe('0x61')][_0x3afe('0x99')][0x0][_0x3afe('0x88')];}if(_0x4da8fa[_0x3afe('0x61')]['id']){delete _0x4da8fa['body']['id'];}if(_[_0x3afe('0x9a')](_0x4da8fa['body']['from'])){throw new db['Sequelize'][(_0x3afe('0x9b'))](_0x3afe('0x9c'));}if(_[_0x3afe('0x9a')](_0x4da8fa[_0x3afe('0x61')][_0x3afe('0x61')])||_0x4da8fa[_0x3afe('0x61')][_0x3afe('0x61')]===''){throw new db[(_0x3afe('0x8d'))][(_0x3afe('0x9b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3afe('0x9a')](_0x4da8fa[_0x3afe('0x61')][_0x3afe('0x9d')])){throw new db[(_0x3afe('0x8d'))][(_0x3afe('0x9b'))](_0x3afe('0x9e')+_0x42cb67);}if(!_['includes'](_0x42cb67,_0x4da8fa[_0x3afe('0x61')]['mapKey'])){throw new db['Sequelize'][(_0x3afe('0x9b'))](_0x3afe('0x9f')+_0x42cb67);}_0x35a6ec[_0x4da8fa[_0x3afe('0x61')][_0x3afe('0x9d')]]=_0x4da8fa['body'][_0x3afe('0x94')];return db['CmList'][_0x3afe('0x55')]({'where':{'id':_0x4da8fa[_0x3afe('0x83')][_0x3afe('0xa0')]},'include':[{'model':db['CmContact'],'as':_0x3afe('0xa1'),'where':_0x35a6ec,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x3afe('0x1d')](handleEntityNotFound(_0x51e5e6,null))[_0x3afe('0x1d')](function(_0x12ebc8){if(_0x12ebc8){_0x4da8fa[_0x3afe('0xa2')]=_[_0x3afe('0x71')](_0x12ebc8,[_0x3afe('0xa1')]);if(_0x12ebc8[_0x3afe('0xa1')][_0x3afe('0x53')]){return _0x12ebc8[_0x3afe('0xa1')][0x0];}var _0x466570=_[_0x3afe('0x18')](_0x4da8fa[_0x3afe('0x61')],{'firstName':_0x4da8fa[_0x3afe('0x61')]['from'],'ListId':_0x12ebc8['id']});_0x466570[_0x4da8fa[_0x3afe('0x61')][_0x3afe('0x9d')]]=_0x4da8fa[_0x3afe('0x61')][_0x3afe('0x94')];return db[_0x3afe('0x8c')][_0x3afe('0x56')](_0x466570,{'fields':_0x2e7f77,'raw':!![]});}})[_0x3afe('0x1d')](handleEntityNotFound(_0x51e5e6,null))[_0x3afe('0x1d')](function(_0x4666ef){if(_0x4666ef){_0x4da8fa[_0x3afe('0xa3')]=_0x4666ef;var _0x44bd96={'ContactId':_0x4666ef['id'],'phone':_0x4da8fa[_0x3afe('0x61')][_0x3afe('0x94')],'WhatsappAccountId':_0x28807f[_0x3afe('0x51')]['id']};var _0x418c26={'ContactId':_0x4666ef['id'],'WhatsappAccountId':_0x28807f[_0x3afe('0x51')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x3afe('0x55')]({'where':_0x418c26})[_0x3afe('0x1d')](function(_0x4a2c5e){if(_0x4a2c5e){return[_0x4a2c5e,![]];}return db[_0x3afe('0xa4')]['create'](_0x44bd96)[_0x3afe('0x1d')](function(_0x95bebd){return[_0x95bebd,!![]];});});}})[_0x3afe('0x72')](function(_0x4b1ee6,_0x536f35){_0x4da8fa[_0x3afe('0xa5')]=_0x4b1ee6[_0x3afe('0x57')]({'plain':!![]});_0x4da8fa[_0x3afe('0xa5')][_0x3afe('0xa6')]=![];if(_0x536f35){if(_0x4da8fa[_0x3afe('0x83')][_0x3afe('0xa7')]){_0x4da8fa['applications'][_0x3afe('0xa8')]({'id':0x0,'priority':_0x4da8fa['applications']['length']+0x1,'app':_0x3afe('0xa9'),'appdata':_0x3afe('0xaa'),'interval':'*,*,*,*'});}_0x4da8fa[_0x3afe('0xa5')]['created']=!![];}return db[_0x3afe('0xab')][_0x3afe('0x56')]({'phone':_0x4da8fa[_0x3afe('0x61')][_0x3afe('0x94')],'messageId':_0x4da8fa[_0x3afe('0x61')][_0x3afe('0x97')],'body':_0x4da8fa[_0x3afe('0x61')]['body'],'WhatsappAccountId':_0x28807f[_0x3afe('0x51')]['id'],'WhatsappInteractionId':_0x4b1ee6['id'],'direction':'in','ContactId':_0x4b1ee6['ContactId'],'AttachmentId':_0x4da8fa[_0x3afe('0x61')][_0x3afe('0xac')]});})[_0x3afe('0x1d')](function(_0x41158d){_0x4da8fa['message']=_0x41158d;if(_0x4da8fa[_0x3afe('0xa5')][_0x3afe('0xad')]){return db[_0x3afe('0xae')][_0x3afe('0x55')]({'attributes':['id','name'],'where':{'id':_0x4da8fa['interaction']['UserId']}})[_0x3afe('0x1d')](function(_0x4da33f){if(_0x4da33f){_0x4da8fa['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x3afe('0xaf'),'appdata':_0x4da33f['name']+','+(_0x4da8fa[_0x3afe('0x83')]['waitForTheAssignedAgent']||0xa),'interval':_0x3afe('0xb0')});}return respondWithRpcPromise('Start',_0x3afe('0xb1'),_0x4da8fa);});}return respondWithRpcPromise('Start',_0x3afe('0xb1'),_0x4da8fa);})['then'](function(_0x570ad3){if(_0x570ad3){var _0x298d4c=0xc8;var _0x14fd4d=_0x3afe('0xb2');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x14fd4d,_0x298d4c,'entity\x20found');logger['debug'](_0x3afe('0xb3'),_0x14fd4d,_0x298d4c,_0x3afe('0xb4'),JSON['stringify'](_0x570ad3));if(_0x4da8fa[_0x3afe('0x83')]['type']===_0x3afe('0x93')){return _0x51e5e6[_0x3afe('0x32')](_0x298d4c)[_0x3afe('0x2c')](_0x3afe('0xb5'),_0x3afe('0xb6'))[_0x3afe('0x35')]('\x0a');}else{return _0x51e5e6[_0x3afe('0x32')](_0x298d4c)[_0x3afe('0x27')](_0x570ad3);}}});})[_0x3afe('0x24')](handleError(_0x51e5e6,null));};exports[_0x3afe('0x35')]=function(_0x3a1fa4,_0x3ef0ae,_0x1a9f45){var _0x2f2b1e,_0x502dfb,_0x1bd4bd;if(_[_0x3afe('0x9a')](_0x3a1fa4[_0x3afe('0x61')]['body'])||_0x3a1fa4[_0x3afe('0x61')]['body']===''){throw new db[(_0x3afe('0x8d'))][(_0x3afe('0x9b'))](_0x3afe('0xb7'));}if(_[_0x3afe('0x9a')](_0x3a1fa4[_0x3afe('0x61')]['to'])){throw new db['Sequelize']['ValidationError'](_0x3afe('0xb8'));}_0x2f2b1e=_0x3a1fa4[_0x3afe('0x61')]['to'];return db[_0x3afe('0x39')][_0x3afe('0x55')]({'where':{'id':_0x3a1fa4[_0x3afe('0x51')]['id']},'include':[{'model':db[_0x3afe('0xb9')],'as':_0x3afe('0xba'),'include':[{'model':db[_0x3afe('0x8c')],'as':_0x3afe('0xa1'),'where':{'mobile':_0x2f2b1e},'limit':0x1,'order':[[_0x3afe('0x8e'),_0x3afe('0xbb')]]}]}]})[_0x3afe('0x1d')](handleEntityNotFound(_0x3ef0ae,null))[_0x3afe('0x1d')](function(_0x39b06c){if(_0x39b06c&&_0x39b06c[_0x3afe('0xba')]){_0x502dfb=_0x39b06c[_0x3afe('0x57')]({'plain':!![]});if(_0x502dfb[_0x3afe('0xba')]&&_0x502dfb[_0x3afe('0xba')][_0x3afe('0xa1')]['length']){return _0x502dfb[_0x3afe('0xba')][_0x3afe('0xa1')][0x0];}return db[_0x3afe('0x8c')][_0x3afe('0x56')](_[_0x3afe('0x18')](_0x3a1fa4[_0x3afe('0x61')],{'firstName':_0x2f2b1e,'mobile':_0x2f2b1e,'phone':_0x2f2b1e,'ListId':_0x502dfb[_0x3afe('0xa0')]}));}})[_0x3afe('0x1d')](handleEntityNotFound(_0x3ef0ae,null))[_0x3afe('0x1d')](function(_0x4bb802){if(_0x4bb802){_0x1bd4bd=_0x4bb802;return db[_0x3afe('0xa4')]['find']({'where':{'ContactId':_0x1bd4bd['id'],'closed':![],'WhatsappAccountId':_0x502dfb['id']}})[_0x3afe('0x1d')](function(_0x10aa08){if(_0x10aa08){return[_0x10aa08,![]];}return db['WhatsappInteraction'][_0x3afe('0x56')]({'UserId':_0x3a1fa4[_0x3afe('0x5a')]['id'],'ContactId':_0x1bd4bd['id'],'WhatsappAccountId':_0x502dfb['id'],'phone':_0x2f2b1e,'firstMsgDirection':_0x3afe('0xbc'),'Messages':[_[_0x3afe('0x54')](_0x3a1fa4['body'],{'read':![],'body':_0x3a1fa4[_0x3afe('0x61')]['body'],'phone':_0x2f2b1e,'WhatsappAccountId':_0x502dfb['id'],'UserId':_0x3a1fa4['user']['id'],'ContactId':_0x1bd4bd['id']})]},{'include':[{'model':db[_0x3afe('0xab')],'as':_0x3afe('0xbd')}]})[_0x3afe('0x1d')](function(_0x188b4d){return[_0x188b4d,!![]];});});}})['spread'](function(_0x5907c3,_0x9ce401){if(_0x9ce401){return _0x5907c3;}return db[_0x3afe('0xab')][_0x3afe('0x56')](_[_0x3afe('0x54')](_0x3a1fa4[_0x3afe('0x61')],{'read':![],'body':_0x3a1fa4[_0x3afe('0x61')][_0x3afe('0x61')],'phone':_0x2f2b1e,'WhatsappAccountId':_0x502dfb['id'],'WhatsappInteractionId':_0x5907c3['id'],'UserId':_0x3a1fa4[_0x3afe('0x5a')]['id'],'ContactId':_0x1bd4bd['id']}))[_0x3afe('0x1d')](function(_0x44616c){_0x5907c3[_0x3afe('0xbe')][_0x3afe('0xbd')]=[];_0x5907c3[_0x3afe('0xbe')][_0x3afe('0xbd')]['push'](_0x44616c['dataValues']);return _0x5907c3;});})[_0x3afe('0x1d')](respondWithResult(_0x3ef0ae,null))['catch'](handleError(_0x3ef0ae,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 62c5883..63f67bd 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 _0x951a=['hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x54683b,_0x2b4038){var _0x702e6e=function(_0x524ac3){while(--_0x524ac3){_0x54683b['push'](_0x54683b['shift']());}};_0x702e6e(++_0x2b4038);}(_0x951a,0xf2));var _0xa951=function(_0x38c3d9,_0x31a0bd){_0x38c3d9=_0x38c3d9-0x0;var _0x5009c8=_0x951a[_0x38c3d9];return _0x5009c8;};'use strict';var EventEmitter=require(_0xa951('0x0'));var WhatsappAccount=require(_0xa951('0x1'))['db'][_0xa951('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xa951('0x3')](0x0);var events={'afterCreate':_0xa951('0x4'),'afterUpdate':_0xa951('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1b3fae){return function(_0x4ef645,_0x5ce60f,_0x2ee183){WhatsappAccountEvents['emit'](_0x1b3fae+':'+_0x4ef645['id'],_0x4ef645);WhatsappAccountEvents[_0xa951('0x6')](_0x1b3fae,_0x4ef645);_0x2ee183(null);};}for(var e in events){if(events[_0xa951('0x7')](e)){var event=events[e];WhatsappAccount[_0xa951('0x8')](e,emitEvent(event));}}module[_0xa951('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x182a=['save','update','remove','emit','hook','events','WhatsappAccount'];(function(_0x517ad3,_0x6181f5){var _0x4dbff4=function(_0x10f378){while(--_0x10f378){_0x517ad3['push'](_0x517ad3['shift']());}};_0x4dbff4(++_0x6181f5);}(_0x182a,0x19b));var _0xa182=function(_0x1d20e8,_0x2e5b46){_0x1d20e8=_0x1d20e8-0x0;var _0x30de48=_0x182a[_0x1d20e8];return _0x30de48;};'use strict';var EventEmitter=require(_0xa182('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xa182('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa182('0x2'),'afterUpdate':_0xa182('0x3'),'afterDestroy':_0xa182('0x4')};function emitEvent(_0x111525){return function(_0x3a6bf9,_0x220207,_0x2f53a6){WhatsappAccountEvents[_0xa182('0x5')](_0x111525+':'+_0x3a6bf9['id'],_0x3a6bf9);WhatsappAccountEvents[_0xa182('0x5')](_0x111525,_0x3a6bf9);_0x2f53a6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xa182('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 407425a..9693c0d 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 _0xd062=['request-promise','path','rimraf','../../config/environment','exports','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','moment','bluebird'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xd062,0x1e7));var _0x2d06=function(_0x38861d,_0x503fcc){_0x38861d=_0x38861d-0x0;var _0x1a1232=_0xd062[_0x38861d];return _0x1a1232;};'use strict';var _=require(_0x2d06('0x0'));var util=require(_0x2d06('0x1'));var logger=require(_0x2d06('0x2'))('api');var moment=require(_0x2d06('0x3'));var BPromise=require(_0x2d06('0x4'));var rp=require(_0x2d06('0x5'));var fs=require('fs');var path=require(_0x2d06('0x6'));var rimraf=require(_0x2d06('0x7'));var config=require(_0x2d06('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0x2d06('0x9')]=function(_0x50ab94,_0xf18b58){return _0x50ab94['define'](_0x2d06('0xa'),attributes,{'tableName':_0x2d06('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90b3=['./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x90b3,0x13c));var _0x390b=function(_0x146182,_0xb6cc9){_0x146182=_0x146182-0x0;var _0x37ae77=_0x90b3[_0x146182];return _0x37ae77;};'use strict';var _=require(_0x390b('0x0'));var util=require(_0x390b('0x1'));var logger=require(_0x390b('0x2'))(_0x390b('0x3'));var moment=require(_0x390b('0x4'));var BPromise=require(_0x390b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x390b('0x6'));var rimraf=require(_0x390b('0x7'));var config=require(_0x390b('0x8'));var attributes=require(_0x390b('0x9'));module[_0x390b('0xa')]=function(_0x4b755d,_0x42b874){return _0x4b755d[_0x390b('0xb')](_0x390b('0xc'),attributes,{'tableName':'whatsapp_accounts','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 bb816f8..5eda238 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 _0x78ab=['request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','ShowWhatsappAccount','find','options','raw','attributes','map','include','model','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x2a5bb7,_0x3a0bf3){var _0x503330=function(_0x61d76b){while(--_0x61d76b){_0x2a5bb7['push'](_0x2a5bb7['shift']());}};_0x503330(++_0x3a0bf3);}(_0x78ab,0x81));var _0xb78a=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x78ab[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xb78a('0x0'));var util=require(_0xb78a('0x1'));var moment=require(_0xb78a('0x2'));var BPromise=require(_0xb78a('0x3'));var rs=require(_0xb78a('0x4'));var fs=require('fs');var Redis=require(_0xb78a('0x5'));var db=require(_0xb78a('0x6'))['db'];var utils=require(_0xb78a('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xb78a('0x8'));var jayson=require(_0xb78a('0x9'));var client=jayson[_0xb78a('0xa')][_0xb78a('0xb')]({'port':0x232a});config[_0xb78a('0xc')]=_['defaults'](config['redis'],{'host':_0xb78a('0xd'),'port':0x18eb});var socket=require(_0xb78a('0xe'))(new Redis(config[_0xb78a('0xc')]));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x3985df,_0x55a21d,_0x116ae4){return new BPromise(function(_0x1f4f05,_0x3369bb){return client[_0xb78a('0xf')](_0x3985df,_0x116ae4)['then'](function(_0x352df4){logger[_0xb78a('0x10')](_0xb78a('0x11'),_0x55a21d,_0xb78a('0x12'));logger['debug'](_0xb78a('0x13'),_0x55a21d,_0xb78a('0x12'),JSON[_0xb78a('0x14')](_0x352df4));if(_0x352df4['error']){if(_0x352df4['error'][_0xb78a('0x15')]===0x1f4){logger[_0xb78a('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x55a21d,_0x352df4['error'][_0xb78a('0x17')]);return _0x3369bb(_0x352df4['error'][_0xb78a('0x17')]);}logger[_0xb78a('0x16')](_0xb78a('0x11'),_0x55a21d,_0x352df4['error'][_0xb78a('0x17')]);return _0x1f4f05(_0x352df4[_0xb78a('0x16')][_0xb78a('0x17')]);}else{logger[_0xb78a('0x10')](_0xb78a('0x11'),_0x55a21d,_0xb78a('0x12'));_0x1f4f05(_0x352df4[_0xb78a('0x18')]['message']);}})[_0xb78a('0x19')](function(_0xf8b96a){logger[_0xb78a('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x55a21d,_0xf8b96a);_0x3369bb(_0xf8b96a);});});}exports[_0xb78a('0x1a')]=function(_0x2d05bf){var _0x227677=this;return new Promise(function(_0x2e0005,_0x17cc12){return db['WhatsappAccount'][_0xb78a('0x1b')]({'raw':_0x2d05bf['options']?_0x2d05bf[_0xb78a('0x1c')][_0xb78a('0x1d')]===undefined?!![]:![]:!![],'where':_0x2d05bf[_0xb78a('0x1c')]?_0x2d05bf[_0xb78a('0x1c')]['where']||null:null,'attributes':_0x2d05bf['options']?_0x2d05bf[_0xb78a('0x1c')][_0xb78a('0x1e')]||null:null,'include':_0x2d05bf[_0xb78a('0x1c')]?_0x2d05bf['options']['include']?_[_0xb78a('0x1f')](_0x2d05bf[_0xb78a('0x1c')][_0xb78a('0x20')],function(_0x220f8b){return{'model':db[_0x220f8b[_0xb78a('0x21')]],'as':_0x220f8b['as'],'attributes':_0x220f8b[_0xb78a('0x1e')],'include':_0x220f8b['include']?_[_0xb78a('0x1f')](_0x220f8b[_0xb78a('0x20')],function(_0x420187){return{'model':db[_0x420187['model']],'as':_0x420187['as'],'attributes':_0x420187[_0xb78a('0x1e')],'include':_0x420187[_0xb78a('0x20')]?_['map'](_0x420187['include'],function(_0x1dc418){return{'model':db[_0x1dc418[_0xb78a('0x21')]],'as':_0x1dc418['as'],'attributes':_0x1dc418[_0xb78a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb78a('0x22')](function(_0x5dfe65){logger[_0xb78a('0x10')](_0xb78a('0x1a'),_0x2d05bf);logger[_0xb78a('0x23')](_0xb78a('0x1a'),_0x2d05bf,JSON[_0xb78a('0x14')](_0x5dfe65));_0x2e0005(_0x5dfe65);})[_0xb78a('0x19')](function(_0x33e47e){logger[_0xb78a('0x16')](_0xb78a('0x1a'),_0x33e47e['message'],_0x2d05bf);_0x17cc12(_0x227677[_0xb78a('0x16')](0x1f4,_0x33e47e['message']));});});}; \ No newline at end of file +var _0x6e78=['message','info','result','catch','ShowWhatsappAccount','options','raw','include','map','model','attributes','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6e78,0x169));var _0x86e7=function(_0xa3a075,_0xe09a8e){_0xa3a075=_0xa3a075-0x0;var _0x5ef8e0=_0x6e78[_0xa3a075];return _0x5ef8e0;};'use strict';var _=require(_0x86e7('0x0'));var util=require('util');var moment=require(_0x86e7('0x1'));var BPromise=require('bluebird');var rs=require(_0x86e7('0x2'));var fs=require('fs');var Redis=require(_0x86e7('0x3'));var db=require(_0x86e7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x86e7('0x5'))('rpc');var config=require(_0x86e7('0x6'));var jayson=require(_0x86e7('0x7'));var client=jayson[_0x86e7('0x8')][_0x86e7('0x9')]({'port':0x232a});config['redis']=_[_0x86e7('0xa')](config[_0x86e7('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x86e7('0xc'))(new Redis(config['redis']));require(_0x86e7('0xd'))[_0x86e7('0xe')](socket);function respondWithRpcPromise(_0x3def0a,_0x137f8e,_0x326ac8){return new BPromise(function(_0x4bb9ee,_0x4198ee){return client[_0x86e7('0xf')](_0x3def0a,_0x326ac8)[_0x86e7('0x10')](function(_0x38a572){logger['info'](_0x86e7('0x11'),_0x137f8e,_0x86e7('0x12'));logger[_0x86e7('0x13')](_0x86e7('0x14'),_0x137f8e,_0x86e7('0x12'),JSON[_0x86e7('0x15')](_0x38a572));if(_0x38a572[_0x86e7('0x16')]){if(_0x38a572['error'][_0x86e7('0x17')]===0x1f4){logger[_0x86e7('0x16')](_0x86e7('0x11'),_0x137f8e,_0x38a572[_0x86e7('0x16')][_0x86e7('0x18')]);return _0x4198ee(_0x38a572[_0x86e7('0x16')][_0x86e7('0x18')]);}logger[_0x86e7('0x16')](_0x86e7('0x11'),_0x137f8e,_0x38a572[_0x86e7('0x16')][_0x86e7('0x18')]);return _0x4bb9ee(_0x38a572['error']['message']);}else{logger[_0x86e7('0x19')](_0x86e7('0x11'),_0x137f8e,_0x86e7('0x12'));_0x4bb9ee(_0x38a572[_0x86e7('0x1a')]['message']);}})[_0x86e7('0x1b')](function(_0x155eee){logger[_0x86e7('0x16')](_0x86e7('0x11'),_0x137f8e,_0x155eee);_0x4198ee(_0x155eee);});});}exports[_0x86e7('0x1c')]=function(_0x550e6b){var _0x549498=this;return new Promise(function(_0x465fae,_0x530541){return db['WhatsappAccount']['find']({'raw':_0x550e6b[_0x86e7('0x1d')]?_0x550e6b[_0x86e7('0x1d')][_0x86e7('0x1e')]===undefined?!![]:![]:!![],'where':_0x550e6b[_0x86e7('0x1d')]?_0x550e6b[_0x86e7('0x1d')]['where']||null:null,'attributes':_0x550e6b[_0x86e7('0x1d')]?_0x550e6b[_0x86e7('0x1d')]['attributes']||null:null,'include':_0x550e6b[_0x86e7('0x1d')]?_0x550e6b['options'][_0x86e7('0x1f')]?_[_0x86e7('0x20')](_0x550e6b['options'][_0x86e7('0x1f')],function(_0x26ccbb){return{'model':db[_0x26ccbb[_0x86e7('0x21')]],'as':_0x26ccbb['as'],'attributes':_0x26ccbb[_0x86e7('0x22')],'include':_0x26ccbb[_0x86e7('0x1f')]?_[_0x86e7('0x20')](_0x26ccbb[_0x86e7('0x1f')],function(_0x3b0dab){return{'model':db[_0x3b0dab[_0x86e7('0x21')]],'as':_0x3b0dab['as'],'attributes':_0x3b0dab[_0x86e7('0x22')],'include':_0x3b0dab[_0x86e7('0x1f')]?_[_0x86e7('0x20')](_0x3b0dab[_0x86e7('0x1f')],function(_0x5b8d18){return{'model':db[_0x5b8d18[_0x86e7('0x21')]],'as':_0x5b8d18['as'],'attributes':_0x5b8d18[_0x86e7('0x22')]};}):[]};}):[]};}):[]:[]})[_0x86e7('0x10')](function(_0x1320d3){logger[_0x86e7('0x19')](_0x86e7('0x1c'),_0x550e6b);logger['debug'](_0x86e7('0x1c'),_0x550e6b,JSON[_0x86e7('0x15')](_0x1320d3));_0x465fae(_0x1320d3);})[_0x86e7('0x1b')](function(_0x10d0ea){logger[_0x86e7('0x16')](_0x86e7('0x1c'),_0x10d0ea['message'],_0x550e6b);_0x530541(_0x549498[_0x86e7('0x16')](0x1f4,_0x10d0ea[_0x86e7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index dd2d5db..4f4c53c 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 _0x8b9c=['./whatsappAccount.events','save','remove','update','removeListener','register','whatsappAccount:'];(function(_0x4c8379,_0x59ef99){var _0x16ea53=function(_0x2621e5){while(--_0x2621e5){_0x4c8379['push'](_0x4c8379['shift']());}};_0x16ea53(++_0x59ef99);}(_0x8b9c,0xee));var _0xc8b9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8b9c[_0x19e35c];return _0x3e1fe8;};'use strict';var WhatsappAccountEvents=require(_0xc8b9('0x0'));var events=[_0xc8b9('0x1'),_0xc8b9('0x2'),_0xc8b9('0x3')];function createListener(_0x19e285,_0x5256b9){return function(_0x507be4){_0x5256b9['emit'](_0x19e285,_0x507be4);};}function removeListener(_0x486b58,_0x304ff4){return function(){WhatsappAccountEvents[_0xc8b9('0x4')](_0x486b58,_0x304ff4);};}exports[_0xc8b9('0x5')]=function(_0x491bed){for(var _0x2c5e9a=0x0,_0x4926af=events['length'];_0x2c5e9a<_0x4926af;_0x2c5e9a++){var _0xbbdc2e=events[_0x2c5e9a];var _0x4a13ed=createListener(_0xc8b9('0x6')+_0xbbdc2e,_0x491bed);WhatsappAccountEvents['on'](_0xbbdc2e,_0x4a13ed);}}; \ No newline at end of file +var _0x9f11=['removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save','remove'];(function(_0xfa44f8,_0x148d09){var _0x20eae6=function(_0x3d2e80){while(--_0x3d2e80){_0xfa44f8['push'](_0xfa44f8['shift']());}};_0x20eae6(++_0x148d09);}(_0x9f11,0x1e7));var _0x19f1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9f11[_0x20a584];return _0x4b41a8;};'use strict';var WhatsappAccountEvents=require(_0x19f1('0x0'));var events=[_0x19f1('0x1'),_0x19f1('0x2'),'update'];function createListener(_0x178c82,_0x4b7a9a){return function(_0x2f45e7){_0x4b7a9a['emit'](_0x178c82,_0x2f45e7);};}function removeListener(_0x5e129e,_0x73da53){return function(){WhatsappAccountEvents[_0x19f1('0x3')](_0x5e129e,_0x73da53);};}exports[_0x19f1('0x4')]=function(_0x5f497f){for(var _0x2bf377=0x0,_0x53d64b=events[_0x19f1('0x5')];_0x2bf377<_0x53d64b;_0x2bf377++){var _0x235478=events[_0x2bf377];var _0x50b909=createListener(_0x19f1('0x6')+_0x235478,_0x5f497f);WhatsappAccountEvents['on'](_0x235478,_0x50b909);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 8bb1dee..930649d 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 _0x2713=['../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2713,0x151));var _0x3271=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2713[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x3271('0x0'));var util=require('util');var path=require(_0x3271('0x1'));var timeout=require(_0x3271('0x2'));var express=require(_0x3271('0x3'));var router=express['Router']();var fs_extra=require(_0x3271('0x4'));var auth=require(_0x3271('0x5'));var interaction=require(_0x3271('0x6'));var config=require('../../config/environment');var controller=require(_0x3271('0x7'));router[_0x3271('0x8')]('/',auth[_0x3271('0x9')](),controller[_0x3271('0xa')]);router['get'](_0x3271('0xb'),auth['isAuthenticated'](),controller[_0x3271('0xc')]);router[_0x3271('0xd')]('/',auth[_0x3271('0x9')](),controller['create']);router[_0x3271('0xe')]('/:id',auth[_0x3271('0x9')](),controller[_0x3271('0xf')]);router[_0x3271('0x10')](_0x3271('0xb'),auth[_0x3271('0x9')](),controller['destroy']);module[_0x3271('0x11')]=router; \ No newline at end of file +var _0x6164=['isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get'];(function(_0x147ab3,_0x487355){var _0x510108=function(_0x48d14f){while(--_0x48d14f){_0x147ab3['push'](_0x147ab3['shift']());}};_0x510108(++_0x487355);}(_0x6164,0x172));var _0x4616=function(_0x47f4c2,_0x134e7b){_0x47f4c2=_0x47f4c2-0x0;var _0x22c63e=_0x6164[_0x47f4c2];return _0x22c63e;};'use strict';var multer=require(_0x4616('0x0'));var util=require(_0x4616('0x1'));var path=require('path');var timeout=require(_0x4616('0x2'));var express=require(_0x4616('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4616('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4616('0x5'));var controller=require(_0x4616('0x6'));router[_0x4616('0x7')]('/',auth[_0x4616('0x8')](),controller[_0x4616('0x9')]);router['get']('/:id',auth[_0x4616('0x8')](),controller[_0x4616('0xa')]);router['post']('/',auth[_0x4616('0x8')](),controller[_0x4616('0xb')]);router[_0x4616('0xc')](_0x4616('0xd'),auth['isAuthenticated'](),controller[_0x4616('0xe')]);router[_0x4616('0xf')](_0x4616('0xd'),auth[_0x4616('0x8')](),controller[_0x4616('0x10')]);module[_0x4616('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 e5a47a4..5c5c4cf 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 _0x08f8=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x08f8,0xb0));var _0x808f=function(_0x207299,_0x3701c4){_0x207299=_0x207299-0x0;var _0xa86e9c=_0x08f8[_0x207299];return _0xa86e9c;};'use strict';var Sequelize=require('sequelize');module[_0x808f('0x0')]={'priority':{'type':Sequelize[_0x808f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x808f('0x2')],'allowNull':![],'defaultValue':_0x808f('0x3')},'appdata':{'type':Sequelize[_0x808f('0x4')]()},'description':{'type':Sequelize[_0x808f('0x2')]},'interval':{'type':Sequelize[_0x808f('0x2')],'defaultValue':_0x808f('0x5')}}; \ No newline at end of file +var _0xef4a=['INTEGER','noop','STRING','sequelize','exports'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0xef4a,0x161));var _0xaef4=function(_0x18d52e,_0x40dcd5){_0x18d52e=_0x18d52e-0x0;var _0x535d46=_0xef4a[_0x18d52e];return _0x535d46;};'use strict';var Sequelize=require(_0xaef4('0x0'));module[_0xaef4('0x1')]={'priority':{'type':Sequelize[_0xaef4('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xaef4('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xaef4('0x4')]},'interval':{'type':Sequelize[_0xaef4('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index df78f42..dd74b67 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 _0x80c4=['order','sort','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','WhatsappApplication','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x50ba26,_0x55def7){var _0x5ec7ac=function(_0xba3b07){while(--_0xba3b07){_0x50ba26['push'](_0x50ba26['shift']());}};_0x5ec7ac(++_0x55def7);}(_0x80c4,0xa3));var _0x480c=function(_0x3dbb16,_0x881a4a){_0x3dbb16=_0x3dbb16-0x0;var _0x47afd9=_0x80c4[_0x3dbb16];return _0x47afd9;};'use strict';var emlformat=require(_0x480c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x480c('0x1'));var jsonpatch=require(_0x480c('0x2'));var rp=require(_0x480c('0x3'));var moment=require(_0x480c('0x4'));var BPromise=require(_0x480c('0x5'));var Mustache=require(_0x480c('0x6'));var util=require('util');var path=require(_0x480c('0x7'));var sox=require(_0x480c('0x8'));var csv=require(_0x480c('0x9'));var ejs=require(_0x480c('0xa'));var fs=require('fs');var fs_extra=require(_0x480c('0xb'));var _=require(_0x480c('0xc'));var squel=require(_0x480c('0xd'));var crypto=require(_0x480c('0xe'));var jsforce=require(_0x480c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x480c('0x9'));var querystring=require(_0x480c('0x10'));var Papa=require(_0x480c('0x11'));var Redis=require(_0x480c('0x12'));var authService=require(_0x480c('0x13'));var qs=require(_0x480c('0x14'));var as=require(_0x480c('0x15'));var hardwareService=require(_0x480c('0x16'));var logger=require(_0x480c('0x17'))(_0x480c('0x18'));var utils=require(_0x480c('0x19'));var config=require(_0x480c('0x1a'));var licenseUtil=require(_0x480c('0x1b'));var db=require(_0x480c('0x1c'))['db'];function respondWithStatusCode(_0x428d08,_0x3f5438){_0x3f5438=_0x3f5438||0xcc;return function(_0x376da3){if(_0x376da3){return _0x428d08[_0x480c('0x1d')](_0x3f5438);}return _0x428d08['status'](_0x3f5438)[_0x480c('0x1e')]();};}function respondWithResult(_0x29613b,_0x5efdbb){_0x5efdbb=_0x5efdbb||0xc8;return function(_0x3b48b6){if(_0x3b48b6){return _0x29613b[_0x480c('0x1f')](_0x5efdbb)[_0x480c('0x20')](_0x3b48b6);}};}function respondWithFilteredResult(_0x513f2d,_0x5ea02c){return function(_0x445635){if(_0x445635){var _0x164428=typeof _0x5ea02c[_0x480c('0x21')]===_0x480c('0x22')&&typeof _0x5ea02c[_0x480c('0x23')]==='undefined';var _0x5b5ea3=_0x445635['count'];var _0xfc8a9f=_0x164428?0x0:_0x5ea02c[_0x480c('0x21')];var _0x54750c=_0x164428?_0x445635[_0x480c('0x24')]:_0x5ea02c['offset']+_0x5ea02c[_0x480c('0x23')];var _0x1507d1;if(_0x54750c>=_0x5b5ea3){_0x54750c=_0x5b5ea3;_0x1507d1=0xc8;}else{_0x1507d1=0xce;}_0x513f2d[_0x480c('0x1f')](_0x1507d1);return _0x513f2d['set'](_0x480c('0x25'),_0xfc8a9f+'-'+_0x54750c+'/'+_0x5b5ea3)[_0x480c('0x20')](_0x445635);}return null;};}function patchUpdates(_0x9e5a12){return function(_0x5840be){try{jsonpatch[_0x480c('0x26')](_0x5840be,_0x9e5a12,!![]);}catch(_0x50bb63){return BPromise[_0x480c('0x27')](_0x50bb63);}return _0x5840be[_0x480c('0x28')]();};}function saveUpdates(_0x5b5a51,_0x3b5bca){return function(_0x3cca31){if(_0x3cca31){return _0x3cca31[_0x480c('0x29')](_0x5b5a51)[_0x480c('0x2a')](function(_0x5dbf8f){return _0x5dbf8f;});}return null;};}function removeEntity(_0x1bc75c,_0x241901){return function(_0x5288f5){if(_0x5288f5){return _0x5288f5[_0x480c('0x2b')]()[_0x480c('0x2a')](function(){_0x1bc75c[_0x480c('0x1f')](0xcc)[_0x480c('0x1e')]();});}};}function handleEntityNotFound(_0x12445d,_0x7f067f){return function(_0x4008ff){if(!_0x4008ff){_0x12445d[_0x480c('0x1d')](0x194);}return _0x4008ff;};}function handleError(_0x72e37b,_0x40def3){_0x40def3=_0x40def3||0x1f4;return function(_0x1363ef){logger['error'](_0x1363ef['stack']);if(_0x1363ef[_0x480c('0x2c')]){delete _0x1363ef['name'];}_0x72e37b['status'](_0x40def3)['send'](_0x1363ef);};}exports['index']=function(_0x4451fe,_0x6019aa){var _0x337816={},_0x377e5c={},_0x592c2b={'count':0x0,'rows':[]};var _0x4a54b2=_['map'](db[_0x480c('0x2d')][_0x480c('0x2e')],function(_0x5c56e5){return{'name':_0x5c56e5[_0x480c('0x2f')],'type':_0x5c56e5['type']['key']};});_0x377e5c[_0x480c('0x30')]=_[_0x480c('0x31')](_0x4a54b2,_0x480c('0x2c'));_0x377e5c[_0x480c('0x32')]=_[_0x480c('0x33')](_0x4451fe[_0x480c('0x32')]);_0x377e5c[_0x480c('0x34')]=_[_0x480c('0x35')](_0x377e5c['model'],_0x377e5c['query']);_0x337816[_0x480c('0x36')]=_[_0x480c('0x35')](_0x377e5c['model'],qs[_0x480c('0x37')](_0x4451fe[_0x480c('0x32')][_0x480c('0x37')]));_0x337816[_0x480c('0x36')]=_0x337816[_0x480c('0x36')][_0x480c('0x38')]?_0x337816[_0x480c('0x36')]:_0x377e5c[_0x480c('0x30')];if(!_0x4451fe[_0x480c('0x32')][_0x480c('0x39')](_0x480c('0x3a'))){_0x337816[_0x480c('0x23')]=qs[_0x480c('0x23')](_0x4451fe[_0x480c('0x32')][_0x480c('0x23')]);_0x337816['offset']=qs[_0x480c('0x21')](_0x4451fe[_0x480c('0x32')][_0x480c('0x21')]);}_0x337816[_0x480c('0x3b')]=qs['sort'](_0x4451fe[_0x480c('0x32')][_0x480c('0x3c')]);_0x337816['where']=qs[_0x480c('0x34')](_['pick'](_0x4451fe[_0x480c('0x32')],_0x377e5c[_0x480c('0x34')]),_0x4a54b2);if(_0x4451fe[_0x480c('0x32')]['filter']){_0x337816[_0x480c('0x3d')]=_[_0x480c('0x3e')](_0x337816[_0x480c('0x3d')],{'$or':_[_0x480c('0x31')](_0x4a54b2,function(_0x588669){if(_0x588669[_0x480c('0x3f')]!==_0x480c('0x40')){var _0x21877b={};_0x21877b[_0x588669[_0x480c('0x2c')]]={'$like':'%'+_0x4451fe[_0x480c('0x32')]['filter']+'%'};return _0x21877b;}})});}_0x337816=_['merge']({},_0x337816,_0x4451fe[_0x480c('0x41')]);var _0x2b5003={'where':_0x337816[_0x480c('0x3d')]};return db[_0x480c('0x2d')]['count'](_0x2b5003)[_0x480c('0x2a')](function(_0x30d983){_0x592c2b[_0x480c('0x24')]=_0x30d983;if(_0x4451fe[_0x480c('0x32')][_0x480c('0x42')]){_0x337816[_0x480c('0x43')]=[{'all':!![]}];}return db[_0x480c('0x2d')]['findAll'](_0x337816);})[_0x480c('0x2a')](function(_0x4ca83c){_0x592c2b[_0x480c('0x44')]=_0x4ca83c;return _0x592c2b;})[_0x480c('0x2a')](respondWithFilteredResult(_0x6019aa,_0x337816))['catch'](handleError(_0x6019aa,null));};exports[_0x480c('0x45')]=function(_0x2aad21,_0x4bee28){var _0xa5e32d={'raw':!![],'where':{'id':_0x2aad21[_0x480c('0x46')]['id']}},_0x4d62fb={};_0x4d62fb[_0x480c('0x30')]=_[_0x480c('0x33')](db['WhatsappApplication'][_0x480c('0x2e')]);_0x4d62fb[_0x480c('0x32')]=_[_0x480c('0x33')](_0x2aad21[_0x480c('0x32')]);_0x4d62fb[_0x480c('0x34')]=_[_0x480c('0x35')](_0x4d62fb[_0x480c('0x30')],_0x4d62fb[_0x480c('0x32')]);_0xa5e32d[_0x480c('0x36')]=_[_0x480c('0x35')](_0x4d62fb[_0x480c('0x30')],qs['fields'](_0x2aad21[_0x480c('0x32')]['fields']));_0xa5e32d[_0x480c('0x36')]=_0xa5e32d['attributes'][_0x480c('0x38')]?_0xa5e32d[_0x480c('0x36')]:_0x4d62fb[_0x480c('0x30')];if(_0x2aad21[_0x480c('0x32')][_0x480c('0x42')]){_0xa5e32d['include']=[{'all':!![]}];}_0xa5e32d=_[_0x480c('0x3e')]({},_0xa5e32d,_0x2aad21['options']);return db[_0x480c('0x2d')][_0x480c('0x47')](_0xa5e32d)['then'](handleEntityNotFound(_0x4bee28,null))['then'](respondWithResult(_0x4bee28,null))[_0x480c('0x48')](handleError(_0x4bee28,null));};exports['create']=function(_0x2649e0,_0x2c1ca6){return db[_0x480c('0x2d')]['create'](_0x2649e0['body'],{})['then'](respondWithResult(_0x2c1ca6,0xc9))[_0x480c('0x48')](handleError(_0x2c1ca6,null));};exports['update']=function(_0x3d7b08,_0x1ec5a2){if(_0x3d7b08[_0x480c('0x49')]['id']){delete _0x3d7b08[_0x480c('0x49')]['id'];}return db['WhatsappApplication'][_0x480c('0x47')]({'where':{'id':_0x3d7b08[_0x480c('0x46')]['id']}})[_0x480c('0x2a')](handleEntityNotFound(_0x1ec5a2,null))[_0x480c('0x2a')](saveUpdates(_0x3d7b08[_0x480c('0x49')],null))[_0x480c('0x2a')](respondWithResult(_0x1ec5a2,null))[_0x480c('0x48')](handleError(_0x1ec5a2,null));};exports[_0x480c('0x2b')]=function(_0x5d5668,_0x41c2d3){return db[_0x480c('0x2d')]['find']({'where':{'id':_0x5d5668['params']['id']}})[_0x480c('0x2a')](handleEntityNotFound(_0x41c2d3,null))['then'](removeEntity(_0x41c2d3,null))['catch'](handleError(_0x41c2d3,null));}; \ No newline at end of file +var _0x25e7=['catch','show','fields','create','body','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','WhatsappApplication','findAll','rows'];(function(_0xae9024,_0x17f58e){var _0x23e7d3=function(_0x5911fb){while(--_0x5911fb){_0xae9024['push'](_0xae9024['shift']());}};_0x23e7d3(++_0x17f58e);}(_0x25e7,0x1d6));var _0x725e=function(_0x2089fe,_0x1a95c6){_0x2089fe=_0x2089fe-0x0;var _0x5eb20b=_0x25e7[_0x2089fe];return _0x5eb20b;};'use strict';var emlformat=require(_0x725e('0x0'));var rimraf=require(_0x725e('0x1'));var zipdir=require(_0x725e('0x2'));var jsonpatch=require(_0x725e('0x3'));var rp=require(_0x725e('0x4'));var moment=require(_0x725e('0x5'));var BPromise=require(_0x725e('0x6'));var Mustache=require(_0x725e('0x7'));var util=require(_0x725e('0x8'));var path=require(_0x725e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x725e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x725e('0xb'));var crypto=require(_0x725e('0xc'));var jsforce=require(_0x725e('0xd'));var deskjs=require(_0x725e('0xe'));var toCsv=require(_0x725e('0xf'));var querystring=require(_0x725e('0x10'));var Papa=require(_0x725e('0x11'));var Redis=require(_0x725e('0x12'));var authService=require(_0x725e('0x13'));var qs=require(_0x725e('0x14'));var as=require(_0x725e('0x15'));var hardwareService=require(_0x725e('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x725e('0x17'));var config=require(_0x725e('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11916d,_0x14218e){_0x14218e=_0x14218e||0xcc;return function(_0x5c5e44){if(_0x5c5e44){return _0x11916d[_0x725e('0x19')](_0x14218e);}return _0x11916d[_0x725e('0x1a')](_0x14218e)[_0x725e('0x1b')]();};}function respondWithResult(_0x4e0515,_0x3f8052){_0x3f8052=_0x3f8052||0xc8;return function(_0x221e02){if(_0x221e02){return _0x4e0515[_0x725e('0x1a')](_0x3f8052)[_0x725e('0x1c')](_0x221e02);}};}function respondWithFilteredResult(_0x24c3c1,_0x13fbfe){return function(_0x523422){if(_0x523422){var _0x156b99=typeof _0x13fbfe[_0x725e('0x1d')]===_0x725e('0x1e')&&typeof _0x13fbfe['limit']===_0x725e('0x1e');var _0x125fef=_0x523422[_0x725e('0x1f')];var _0x397e33=_0x156b99?0x0:_0x13fbfe[_0x725e('0x1d')];var _0x2811e7=_0x156b99?_0x523422['count']:_0x13fbfe[_0x725e('0x1d')]+_0x13fbfe[_0x725e('0x20')];var _0x1b8879;if(_0x2811e7>=_0x125fef){_0x2811e7=_0x125fef;_0x1b8879=0xc8;}else{_0x1b8879=0xce;}_0x24c3c1[_0x725e('0x1a')](_0x1b8879);return _0x24c3c1[_0x725e('0x21')](_0x725e('0x22'),_0x397e33+'-'+_0x2811e7+'/'+_0x125fef)['json'](_0x523422);}return null;};}function patchUpdates(_0x2fc416){return function(_0xd30de9){try{jsonpatch[_0x725e('0x23')](_0xd30de9,_0x2fc416,!![]);}catch(_0x40c21b){return BPromise[_0x725e('0x24')](_0x40c21b);}return _0xd30de9[_0x725e('0x25')]();};}function saveUpdates(_0x127c99,_0x262b01){return function(_0x7d0792){if(_0x7d0792){return _0x7d0792['update'](_0x127c99)[_0x725e('0x26')](function(_0x36cbab){return _0x36cbab;});}return null;};}function removeEntity(_0x389668,_0x3facae){return function(_0x5a8191){if(_0x5a8191){return _0x5a8191[_0x725e('0x27')]()['then'](function(){_0x389668['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2aad7b,_0x1cbaae){return function(_0x2d3c55){if(!_0x2d3c55){_0x2aad7b['sendStatus'](0x194);}return _0x2d3c55;};}function handleError(_0xab6cfd,_0x8a138f){_0x8a138f=_0x8a138f||0x1f4;return function(_0x5a5bef){logger[_0x725e('0x28')](_0x5a5bef[_0x725e('0x29')]);if(_0x5a5bef['name']){delete _0x5a5bef[_0x725e('0x2a')];}_0xab6cfd['status'](_0x8a138f)['send'](_0x5a5bef);};}exports[_0x725e('0x2b')]=function(_0x5b8dec,_0x3b42bd){var _0x4cc4ad={},_0x4de2e0={},_0x9b5b7f={'count':0x0,'rows':[]};var _0x31a8ff=_[_0x725e('0x2c')](db['WhatsappApplication'][_0x725e('0x2d')],function(_0x5b03d9){return{'name':_0x5b03d9[_0x725e('0x2e')],'type':_0x5b03d9[_0x725e('0x2f')][_0x725e('0x30')]};});_0x4de2e0[_0x725e('0x31')]=_[_0x725e('0x2c')](_0x31a8ff,_0x725e('0x2a'));_0x4de2e0[_0x725e('0x32')]=_[_0x725e('0x33')](_0x5b8dec[_0x725e('0x32')]);_0x4de2e0[_0x725e('0x34')]=_[_0x725e('0x35')](_0x4de2e0['model'],_0x4de2e0[_0x725e('0x32')]);_0x4cc4ad[_0x725e('0x36')]=_['intersection'](_0x4de2e0[_0x725e('0x31')],qs['fields'](_0x5b8dec[_0x725e('0x32')]['fields']));_0x4cc4ad[_0x725e('0x36')]=_0x4cc4ad[_0x725e('0x36')][_0x725e('0x37')]?_0x4cc4ad[_0x725e('0x36')]:_0x4de2e0[_0x725e('0x31')];if(!_0x5b8dec[_0x725e('0x32')]['hasOwnProperty']('nolimit')){_0x4cc4ad[_0x725e('0x20')]=qs[_0x725e('0x20')](_0x5b8dec[_0x725e('0x32')]['limit']);_0x4cc4ad[_0x725e('0x1d')]=qs['offset'](_0x5b8dec[_0x725e('0x32')][_0x725e('0x1d')]);}_0x4cc4ad[_0x725e('0x38')]=qs[_0x725e('0x39')](_0x5b8dec['query']['sort']);_0x4cc4ad[_0x725e('0x3a')]=qs[_0x725e('0x34')](_[_0x725e('0x3b')](_0x5b8dec['query'],_0x4de2e0[_0x725e('0x34')]),_0x31a8ff);if(_0x5b8dec[_0x725e('0x32')][_0x725e('0x3c')]){_0x4cc4ad['where']=_[_0x725e('0x3d')](_0x4cc4ad['where'],{'$or':_[_0x725e('0x2c')](_0x31a8ff,function(_0x462dac){if(_0x462dac[_0x725e('0x2f')]!==_0x725e('0x3e')){var _0x46eaa0={};_0x46eaa0[_0x462dac['name']]={'$like':'%'+_0x5b8dec['query'][_0x725e('0x3c')]+'%'};return _0x46eaa0;}})});}_0x4cc4ad=_[_0x725e('0x3d')]({},_0x4cc4ad,_0x5b8dec[_0x725e('0x3f')]);var _0x5dd1d1={'where':_0x4cc4ad[_0x725e('0x3a')]};return db['WhatsappApplication'][_0x725e('0x1f')](_0x5dd1d1)[_0x725e('0x26')](function(_0x337e53){_0x9b5b7f[_0x725e('0x1f')]=_0x337e53;if(_0x5b8dec['query'][_0x725e('0x40')]){_0x4cc4ad[_0x725e('0x41')]=[{'all':!![]}];}return db[_0x725e('0x42')][_0x725e('0x43')](_0x4cc4ad);})[_0x725e('0x26')](function(_0x19ed0a){_0x9b5b7f[_0x725e('0x44')]=_0x19ed0a;return _0x9b5b7f;})['then'](respondWithFilteredResult(_0x3b42bd,_0x4cc4ad))[_0x725e('0x45')](handleError(_0x3b42bd,null));};exports[_0x725e('0x46')]=function(_0x58ebe3,_0x2200ad){var _0x3b7a87={'raw':!![],'where':{'id':_0x58ebe3['params']['id']}},_0x5e719e={};_0x5e719e['model']=_['keys'](db[_0x725e('0x42')][_0x725e('0x2d')]);_0x5e719e[_0x725e('0x32')]=_['keys'](_0x58ebe3[_0x725e('0x32')]);_0x5e719e['filters']=_['intersection'](_0x5e719e[_0x725e('0x31')],_0x5e719e[_0x725e('0x32')]);_0x3b7a87[_0x725e('0x36')]=_[_0x725e('0x35')](_0x5e719e[_0x725e('0x31')],qs[_0x725e('0x47')](_0x58ebe3['query'][_0x725e('0x47')]));_0x3b7a87['attributes']=_0x3b7a87[_0x725e('0x36')][_0x725e('0x37')]?_0x3b7a87['attributes']:_0x5e719e[_0x725e('0x31')];if(_0x58ebe3['query'][_0x725e('0x40')]){_0x3b7a87[_0x725e('0x41')]=[{'all':!![]}];}_0x3b7a87=_['merge']({},_0x3b7a87,_0x58ebe3['options']);return db[_0x725e('0x42')]['find'](_0x3b7a87)[_0x725e('0x26')](handleEntityNotFound(_0x2200ad,null))['then'](respondWithResult(_0x2200ad,null))['catch'](handleError(_0x2200ad,null));};exports['create']=function(_0x118ef5,_0x38a81f){return db['WhatsappApplication'][_0x725e('0x48')](_0x118ef5[_0x725e('0x49')],{})['then'](respondWithResult(_0x38a81f,0xc9))[_0x725e('0x45')](handleError(_0x38a81f,null));};exports[_0x725e('0x4a')]=function(_0x4d5415,_0x19f524){if(_0x4d5415[_0x725e('0x49')]['id']){delete _0x4d5415[_0x725e('0x49')]['id'];}return db[_0x725e('0x42')][_0x725e('0x4b')]({'where':{'id':_0x4d5415[_0x725e('0x4c')]['id']}})[_0x725e('0x26')](handleEntityNotFound(_0x19f524,null))[_0x725e('0x26')](saveUpdates(_0x4d5415[_0x725e('0x49')],null))[_0x725e('0x26')](respondWithResult(_0x19f524,null))['catch'](handleError(_0x19f524,null));};exports[_0x725e('0x27')]=function(_0x5e3678,_0x11e2f7){return db[_0x725e('0x42')][_0x725e('0x4b')]({'where':{'id':_0x5e3678[_0x725e('0x4c')]['id']}})[_0x725e('0x26')](handleEntityNotFound(_0x11e2f7,null))[_0x725e('0x26')](removeEntity(_0x11e2f7,null))[_0x725e('0x45')](handleError(_0x11e2f7,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 8fcba3e..1b613fa 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 _0xb91a=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xb91a,0xf4));var _0xab91=function(_0x42f85d,_0x7271e){_0x42f85d=_0x42f85d-0x0;var _0x2147ca=_0xb91a[_0x42f85d];return _0x2147ca;};'use strict';var _=require(_0xab91('0x0'));var util=require(_0xab91('0x1'));var logger=require(_0xab91('0x2'))('api');var moment=require('moment');var BPromise=require(_0xab91('0x3'));var rp=require(_0xab91('0x4'));var fs=require('fs');var path=require(_0xab91('0x5'));var rimraf=require(_0xab91('0x6'));var config=require(_0xab91('0x7'));var attributes=require(_0xab91('0x8'));module[_0xab91('0x9')]=function(_0x429933,_0x290af9){return _0x429933[_0xab91('0xa')]('WhatsappApplication',attributes,{'tableName':_0xab91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab91('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x447b=['exports','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes'];(function(_0x30d887,_0x46a843){var _0x117730=function(_0x1ce73d){while(--_0x1ce73d){_0x30d887['push'](_0x30d887['shift']());}};_0x117730(++_0x46a843);}(_0x447b,0xe4));var _0xb447=function(_0x3be82c,_0x3307d7){_0x3be82c=_0x3be82c-0x0;var _0x40d25a=_0x447b[_0x3be82c];return _0x40d25a;};'use strict';var _=require(_0xb447('0x0'));var util=require(_0xb447('0x1'));var logger=require('../../config/logger')(_0xb447('0x2'));var moment=require(_0xb447('0x3'));var BPromise=require(_0xb447('0x4'));var rp=require(_0xb447('0x5'));var fs=require('fs');var path=require(_0xb447('0x6'));var rimraf=require(_0xb447('0x7'));var config=require(_0xb447('0x8'));var attributes=require(_0xb447('0x9'));module[_0xb447('0xa')]=function(_0x1f132a,_0x514a91){return _0x1f132a['define'](_0xb447('0xb'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb447('0xc'),'collate':_0xb447('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index c16d4f9..bc0ce2c 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 _0x032e=['code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x214f9f,_0x50f5c4){var _0x4ce0cc=function(_0x2d0c35){while(--_0x2d0c35){_0x214f9f['push'](_0x214f9f['shift']());}};_0x4ce0cc(++_0x50f5c4);}(_0x032e,0x124));var _0xe032=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x032e[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37432f,_0x1576c8,_0x3289b0){return new BPromise(function(_0xd84027,_0xaf3907){return client[_0xe032('0xb')](_0x37432f,_0x3289b0)[_0xe032('0xc')](function(_0x2d8a14){logger[_0xe032('0xd')](_0xe032('0xe'),_0x1576c8,'request\x20sent');logger[_0xe032('0xf')](_0xe032('0x10'),_0x1576c8,_0xe032('0x11'),JSON[_0xe032('0x12')](_0x2d8a14));if(_0x2d8a14[_0xe032('0x13')]){if(_0x2d8a14[_0xe032('0x13')][_0xe032('0x14')]===0x1f4){logger['error'](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xaf3907(_0x2d8a14[_0xe032('0x13')]['message']);}logger[_0xe032('0x13')](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xd84027(_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);}else{logger[_0xe032('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x1576c8,_0xe032('0x11'));_0xd84027(_0x2d8a14[_0xe032('0x16')][_0xe032('0x15')]);}})[_0xe032('0x17')](function(_0x1938c4){logger[_0xe032('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x1576c8,_0x1938c4);_0xaf3907(_0x1938c4);});});} \ No newline at end of file +var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappApplication,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x65589e,_0x5a5205){var _0x52aec8=function(_0x510b2c){while(--_0x510b2c){_0x65589e['push'](_0x65589e['shift']());}};_0x52aec8(++_0x5a5205);}(_0x4b84,0x1cc));var _0x44b8=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0x4b84[_0x40d8d7];return _0x3454cc;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('WhatsappApplication,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 78cb175..1474acd 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 _0x1db9=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id/messages','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1db9,0x176));var _0x91db=function(_0x47b28a,_0x1b778f){_0x47b28a=_0x47b28a-0x0;var _0x16993d=_0x1db9[_0x47b28a];return _0x16993d;};'use strict';var multer=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var path=require(_0x91db('0x2'));var timeout=require(_0x91db('0x3'));var express=require(_0x91db('0x4'));var router=express[_0x91db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91db('0x6'));var interaction=require(_0x91db('0x7'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x91db('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x91db('0x8')](_0x91db('0x9'),auth[_0x91db('0xa')](),controller[_0x91db('0xb')]);router[_0x91db('0x8')]('/:id',auth[_0x91db('0xa')](),controller['show']);router[_0x91db('0x8')](_0x91db('0xc'),auth[_0x91db('0xa')](),controller['getMessages']);router[_0x91db('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x91db('0xd')]('/',auth[_0x91db('0xa')](),controller['create']);router['post'](_0x91db('0xc'),auth[_0x91db('0xa')](),controller[_0x91db('0xe')]);router[_0x91db('0xd')](_0x91db('0xf'),auth['isAuthenticated'](),interaction[_0x91db('0x10')](_0x91db('0x11'),_0x91db('0x12')),controller[_0x91db('0x13')]);router[_0x91db('0x14')](_0x91db('0x15'),auth[_0x91db('0xa')](),interaction[_0x91db('0x10')](_0x91db('0x11'),_0x91db('0x16')),controller[_0x91db('0x17')]);router[_0x91db('0x18')]('/:id',auth[_0x91db('0xa')](),interaction[_0x91db('0x10')](_0x91db('0x11'),_0x91db('0x19')),controller[_0x91db('0x1a')]);router[_0x91db('0x18')]('/:id/tags',auth['isAuthenticated'](),controller[_0x91db('0x1b')]);module[_0x91db('0x1c')]=router; \ No newline at end of file +var _0x3c6c=['get','index','/:id','isAuthenticated','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xf737cf,_0x268687){var _0x62555d=function(_0x3d49b2){while(--_0x3d49b2){_0xf737cf['push'](_0xf737cf['shift']());}};_0x62555d(++_0x268687);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x2e4d96,_0x48940b){_0x2e4d96=_0x2e4d96-0x0;var _0x4264a8=_0x3c6c[_0x2e4d96];return _0x4264a8;};'use strict';var multer=require(_0xc3c6('0x0'));var util=require('util');var path=require(_0xc3c6('0x1'));var timeout=require(_0xc3c6('0x2'));var express=require(_0xc3c6('0x3'));var router=express[_0xc3c6('0x4')]();var fs_extra=require(_0xc3c6('0x5'));var auth=require(_0xc3c6('0x6'));var interaction=require(_0xc3c6('0x7'));var config=require(_0xc3c6('0x8'));var controller=require('./whatsappInteraction.controller');router[_0xc3c6('0x9')]('/',auth['isAuthenticated'](),controller[_0xc3c6('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),controller['show']);router[_0xc3c6('0x9')](_0xc3c6('0xd'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0xe')]);router['get'](_0xc3c6('0xf'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc3c6('0x11')]);router[_0xc3c6('0x12')](_0xc3c6('0xd'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0x13')]);router[_0xc3c6('0x12')](_0xc3c6('0x14'),auth[_0xc3c6('0xc')](),interaction[_0xc3c6('0x15')](_0xc3c6('0x16'),_0xc3c6('0x17')),controller[_0xc3c6('0x18')]);router[_0xc3c6('0x19')](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),interaction[_0xc3c6('0x15')](_0xc3c6('0x16'),_0xc3c6('0x1a')),controller[_0xc3c6('0x1b')]);router[_0xc3c6('0x1c')](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),interaction[_0xc3c6('0x15')](_0xc3c6('0x16'),_0xc3c6('0x1d')),controller[_0xc3c6('0x1e')]);router['delete'](_0xc3c6('0x14'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0x1f')]);module[_0xc3c6('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 595c222..d170775 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 _0x8c52=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x251170,_0x32fb45){var _0x32583d=function(_0x55ece5){while(--_0x55ece5){_0x251170['push'](_0x251170['shift']());}};_0x32583d(++_0x32fb45);}(_0x8c52,0x7e));var _0x28c5=function(_0x2103dd,_0x2cb8f6){_0x2103dd=_0x2103dd-0x0;var _0x457cf6=_0x8c52[_0x2103dd];return _0x457cf6;};'use strict';var Sequelize=require(_0x28c5('0x0'));var moment=require('moment');module[_0x28c5('0x1')]={'closed':{'type':Sequelize[_0x28c5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x28c5('0x3')]},'disposition':{'type':Sequelize[_0x28c5('0x4')]},'secondDisposition':{'type':Sequelize[_0x28c5('0x4')]},'thirdDisposition':{'type':Sequelize[_0x28c5('0x4')]},'note':{'type':Sequelize[_0x28c5('0x4')]},'phone':{'type':Sequelize[_0x28c5('0x4')]},'read1stAt':{'type':Sequelize[_0x28c5('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x28c5('0x5')]('in',_0x28c5('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x28c5('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8ce1=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x586fa2,_0x1a45bc){var _0x515be9=function(_0x4e90d5){while(--_0x4e90d5){_0x586fa2['push'](_0x586fa2['shift']());}};_0x515be9(++_0x1a45bc);}(_0x8ce1,0x183));var _0x18ce=function(_0x439c3c,_0x358636){_0x439c3c=_0x439c3c-0x0;var _0x2cde64=_0x8ce1[_0x439c3c];return _0x2cde64;};'use strict';var Sequelize=require(_0x18ce('0x0'));var moment=require(_0x18ce('0x1'));module[_0x18ce('0x2')]={'closed':{'type':Sequelize[_0x18ce('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x18ce('0x4')]},'disposition':{'type':Sequelize[_0x18ce('0x5')]},'secondDisposition':{'type':Sequelize[_0x18ce('0x5')]},'thirdDisposition':{'type':Sequelize[_0x18ce('0x5')]},'note':{'type':Sequelize[_0x18ce('0x5')]},'phone':{'type':Sequelize[_0x18ce('0x5')]},'read1stAt':{'type':Sequelize[_0x18ce('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x18ce('0x6')]('in',_0x18ce('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x18ce('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x18ce('0x6')]('in',_0x18ce('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 6118ced..dda187f 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 _0xffc0=['forEach','push','TagIds','catch','waiting','talking','answered','total','closed','UserId','unmanaged','index','WhatsappInteraction','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','tools_tags','ui.WhatsappInteractionId','from','user_has_whatsapp_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','users','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','parseSearch','conditions','length','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','text','keys','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','params','include','options','create','describe','addMessage','WhatsappMessage','omit','getMessages','findOne','merge','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','ids','color','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','firstName','lastName','attachments','Attachment','direction','read','WhatsappAccount','Owner','fullname','Whatsapp','Account','N.A.','closedAt','disposition','Messages','basename','existsSync','pipe','System','secret','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','offset','undefined','limit','count','set','apply','reject','update','destroy','then','end','error','name','send','Users','map','Tags','split'];(function(_0x399aea,_0x1b44f3){var _0x479eb5=function(_0x2da6db){while(--_0x2da6db){_0x399aea['push'](_0x399aea['shift']());}};_0x479eb5(++_0x1b44f3);}(_0xffc0,0x1a0));var _0x0ffc=function(_0x38b8db,_0x6008e7){_0x38b8db=_0x38b8db-0x0;var _0x564b69=_0xffc0[_0x38b8db];return _0x564b69;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ffc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ffc('0x1'));var rp=require(_0x0ffc('0x2'));var moment=require(_0x0ffc('0x3'));var BPromise=require(_0x0ffc('0x4'));var Mustache=require(_0x0ffc('0x5'));var util=require(_0x0ffc('0x6'));var path=require(_0x0ffc('0x7'));var sox=require('sox');var csv=require(_0x0ffc('0x8'));var ejs=require(_0x0ffc('0x9'));var fs=require('fs');var fs_extra=require(_0x0ffc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0ffc('0xb'));var jsforce=require(_0x0ffc('0xc'));var deskjs=require(_0x0ffc('0xd'));var toCsv=require(_0x0ffc('0x8'));var querystring=require('querystring');var Papa=require(_0x0ffc('0xe'));var Redis=require(_0x0ffc('0xf'));var authService=require(_0x0ffc('0x10'));var qs=require(_0x0ffc('0x11'));var as=require(_0x0ffc('0x12'));var pdf=require(_0x0ffc('0x13'));var hardwareService=require(_0x0ffc('0x14'));var logger=require(_0x0ffc('0x15'))('api');var utils=require(_0x0ffc('0x16'));var config=require(_0x0ffc('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ffc('0x18'))['db'];config[_0x0ffc('0x19')]=_[_0x0ffc('0x1a')](config['redis'],{'host':_0x0ffc('0x1b'),'port':0x18eb});var socket=require(_0x0ffc('0x1c'))(new Redis(config['redis']));require(_0x0ffc('0x1d'))[_0x0ffc('0x1e')](socket);function respondWithStatusCode(_0x1e32b4,_0x11a5ee){_0x11a5ee=_0x11a5ee||0xcc;return function(_0x20edfc){if(_0x20edfc){return _0x1e32b4['sendStatus'](_0x11a5ee);}return _0x1e32b4[_0x0ffc('0x1f')](_0x11a5ee)['end']();};}function respondWithResult(_0x7f401,_0xc2bb7e){_0xc2bb7e=_0xc2bb7e||0xc8;return function(_0x4abd72){if(_0x4abd72){return _0x7f401[_0x0ffc('0x1f')](_0xc2bb7e)['json'](_0x4abd72);}};}function respondWithFilteredResult(_0x52ca5a,_0x5b0018){return function(_0x4e8e65){if(_0x4e8e65){var _0x314dab=typeof _0x5b0018[_0x0ffc('0x20')]===_0x0ffc('0x21')&&typeof _0x5b0018[_0x0ffc('0x22')]===_0x0ffc('0x21');var _0x480931=_0x4e8e65['count'];var _0x245016=_0x314dab?0x0:_0x5b0018['offset'];var _0x49e690=_0x314dab?_0x4e8e65[_0x0ffc('0x23')]:_0x5b0018[_0x0ffc('0x20')]+_0x5b0018['limit'];var _0x21cde8;if(_0x49e690>=_0x480931){_0x49e690=_0x480931;_0x21cde8=0xc8;}else{_0x21cde8=0xce;}_0x52ca5a[_0x0ffc('0x1f')](_0x21cde8);return _0x52ca5a[_0x0ffc('0x24')]('Content-Range',_0x245016+'-'+_0x49e690+'/'+_0x480931)['json'](_0x4e8e65);}return null;};}function patchUpdates(_0x15fd93){return function(_0x2721b6){try{jsonpatch[_0x0ffc('0x25')](_0x2721b6,_0x15fd93,!![]);}catch(_0x948451){return BPromise[_0x0ffc('0x26')](_0x948451);}return _0x2721b6['save']();};}function saveUpdates(_0x501c0c,_0x3e1180){return function(_0x529415){if(_0x529415){return _0x529415[_0x0ffc('0x27')](_0x501c0c)['then'](function(_0x25e3c0){return _0x25e3c0;});}return null;};}function removeEntity(_0x136b0a,_0x23b14e){return function(_0x1265f5){if(_0x1265f5){return _0x1265f5[_0x0ffc('0x28')]()[_0x0ffc('0x29')](function(){_0x136b0a[_0x0ffc('0x1f')](0xcc)[_0x0ffc('0x2a')]();});}};}function handleEntityNotFound(_0x58c686,_0x637c33){return function(_0x195033){if(!_0x195033){_0x58c686['sendStatus'](0x194);}return _0x195033;};}function handleError(_0x5bb1d5,_0x40166f){_0x40166f=_0x40166f||0x1f4;return function(_0x5f3a01){logger[_0x0ffc('0x2b')](_0x5f3a01['stack']);if(_0x5f3a01['name']){delete _0x5f3a01[_0x0ffc('0x2c')];}_0x5bb1d5['status'](_0x40166f)[_0x0ffc('0x2d')](_0x5f3a01);};}function getInteractionUsers(_0x18dc67,_0x28c608){return new BPromise(function(_0x4e813f,_0x29f0cf){try{if(_0x28c608[_0x18dc67['id']]){_0x18dc67[_0x0ffc('0x2e')]=_[_0x0ffc('0x2f')](_0x28c608[_0x18dc67['id']],function(_0x10e86d){return{'id':_0x10e86d['id'],'fullname':_0x10e86d['fullname']};});}}catch(_0x170390){_0x29f0cf(_0x170390);}_0x4e813f(_0x18dc67);});}function getInteractionTags(_0x557f1f,_0x28f022){return new BPromise(function(_0x5a1d7e,_0x256d86){try{if(_0x557f1f['TagIds']){_0x557f1f[_0x0ffc('0x30')]=[];_0x557f1f['TagIds'][_0x0ffc('0x31')](',')[_0x0ffc('0x32')](function(_0x48fdca){_0x557f1f[_0x0ffc('0x30')][_0x0ffc('0x33')](_0x28f022[_0x48fdca]);});}delete _0x557f1f[_0x0ffc('0x34')];}catch(_0x663de6){_0x256d86(_0x663de6);}_0x5a1d7e(_0x557f1f);});}function updateWhatsappInteraction(_0x581c42,_0x1b38db,_0x175b42){return new BPromise(function(_0x43e727,_0x3dafd3){return getInteractionUsers(_0x581c42,_0x175b42)[_0x0ffc('0x29')](function(_0x6f3091){return getInteractionTags(_0x6f3091,_0x1b38db);})[_0x0ffc('0x29')](function(_0x597d9a){return getStateInteraction(_0x597d9a);})[_0x0ffc('0x29')](function(_0x3e3c5f){_0x43e727(_0x3e3c5f);})[_0x0ffc('0x35')](function(_0x18e518){_0x3dafd3(_0x18e518);});});}function getStateInteraction(_0x51ddf6){return new BPromise(function(_0xa281de){_0x51ddf6[_0x0ffc('0x36')]=0x0;_0x51ddf6[_0x0ffc('0x37')]=0x0;_0x51ddf6[_0x0ffc('0x38')]=0x0;_0x51ddf6['unmanaged']=0x0;_0x51ddf6[_0x0ffc('0x39')]=0x0;if(!_0x51ddf6[_0x0ffc('0x3a')]&&!_0x51ddf6[_0x0ffc('0x3b')]){_0x51ddf6[_0x0ffc('0x36')]+=0x1;}if(!_0x51ddf6[_0x0ffc('0x3a')]&&_0x51ddf6[_0x0ffc('0x3b')]){_0x51ddf6[_0x0ffc('0x37')]+=0x1;if(_0x51ddf6[_0x0ffc('0x36')]){_0x51ddf6[_0x0ffc('0x36')]-=0x1;}}if(_0x51ddf6['closed']&&_0x51ddf6[_0x0ffc('0x3b')]){_0x51ddf6[_0x0ffc('0x38')]+=0x1;if(_0x51ddf6[_0x0ffc('0x37')]){_0x51ddf6[_0x0ffc('0x37')]-=0x1;}}if(_0x51ddf6['closed']&&!_0x51ddf6[_0x0ffc('0x3b')]){_0x51ddf6[_0x0ffc('0x3c')]+=0x1;if(_0x51ddf6[_0x0ffc('0x36')]){_0x51ddf6[_0x0ffc('0x36')]-=0x1;}}_0x51ddf6[_0x0ffc('0x39')]+=0x1;_0xa281de(_0x51ddf6);});}exports[_0x0ffc('0x3d')]=function(_0x157391,_0x280d2a){var _0x25676f={},_0x5cf45e={},_0x173af5={'count':0x0,'rows':[]};var _0x2cbcda=_[_0x0ffc('0x2f')](db[_0x0ffc('0x3e')]['rawAttributes'],function(_0x515893){return{'name':_0x515893['fieldName'],'type':_0x515893[_0x0ffc('0x3f')]['key']};});_0x5cf45e[_0x0ffc('0x40')]=_['map'](_0x2cbcda,_0x0ffc('0x2c'));_0x5cf45e[_0x0ffc('0x41')]=_['keys'](_0x157391['query']);_0x5cf45e[_0x0ffc('0x42')]=_[_0x0ffc('0x43')](_0x5cf45e['model'],_0x5cf45e[_0x0ffc('0x41')]);_0x25676f[_0x0ffc('0x44')]=_['intersection'](_0x5cf45e['model'],qs[_0x0ffc('0x45')](_0x157391['query'][_0x0ffc('0x45')]));_0x25676f['attributes']=_0x25676f['attributes']['length']?_0x25676f[_0x0ffc('0x44')]:_0x5cf45e['model'];if(!_0x157391[_0x0ffc('0x41')][_0x0ffc('0x46')](_0x0ffc('0x47'))){_0x25676f['limit']=qs[_0x0ffc('0x22')](_0x157391[_0x0ffc('0x41')][_0x0ffc('0x22')]);_0x25676f[_0x0ffc('0x20')]=qs[_0x0ffc('0x20')](_0x157391[_0x0ffc('0x41')][_0x0ffc('0x20')]);}_0x25676f[_0x0ffc('0x48')]=qs['sort'](_0x157391[_0x0ffc('0x41')][_0x0ffc('0x49')]);_0x25676f[_0x0ffc('0x4a')]=qs['filters'](_[_0x0ffc('0x4b')](_0x157391[_0x0ffc('0x41')],_0x5cf45e[_0x0ffc('0x42')]),_0x2cbcda);var _0x2b16f7=[];var _0x4a146f=squel[_0x0ffc('0x4c')]()[_0x0ffc('0x4d')]('id')['field'](_0x0ffc('0x2c'))[_0x0ffc('0x4d')]('color')['from'](_0x0ffc('0x4e'));var _0x34e244=squel[_0x0ffc('0x4c')]()['field']('u.id')[_0x0ffc('0x4d')]('u.fullname')[_0x0ffc('0x4d')](_0x0ffc('0x4f'))[_0x0ffc('0x50')](_0x0ffc('0x51'),'ui')[_0x0ffc('0x52')]('users','u',_0x0ffc('0x53'));var _0x39ba1f=squel[_0x0ffc('0x4c')]()[_0x0ffc('0x50')]('whatsapp_interactions','i')['left_join'](_0x0ffc('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0ffc('0x52')](_0x0ffc('0x55'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x0ffc('0x56'),'a',_0x0ffc('0x57'))['left_join'](_0x0ffc('0x58'),'me',_0x0ffc('0x59'))[_0x0ffc('0x52')](_0x0ffc('0x5a'),'it',_0x0ffc('0x5b'))[_0x0ffc('0x52')](_0x0ffc('0x4e'),'t','t.id\x20=\x20it.TagId');var _0x52bacc=squel[_0x0ffc('0x5c')]();var _0x2715f3=[];var _0x5aea61=squel[_0x0ffc('0x5c')]();var _0x39dec3;if(_0x157391[_0x0ffc('0x41')]['search']){_0x39dec3=as[_0x0ffc('0x5d')](_0x157391['query']['search']);var _0x9df9c4=_0x39dec3['sqlOperator'];for(var _0x4fec77=0x0;_0x4fec77<_0x39dec3[_0x0ffc('0x5e')][_0x0ffc('0x5f')];_0x4fec77++){var _0xd5e2cf=_0x39dec3['conditions'][_0x4fec77];var _0x252aa0='i';var _0x3320e9=_['find'](_0x2cbcda,['name',_0xd5e2cf[_0x0ffc('0x4d')]]);if(!_0x3320e9){switch(_0xd5e2cf[_0x0ffc('0x4d')]){case _0x0ffc('0x60'):if(_0xd5e2cf[_0x0ffc('0x61')]==0x1){_0x39ba1f[_0x0ffc('0x62')]('`'+_0xd5e2cf['field']+_0x0ffc('0x63'));}else{_0x39ba1f['having']('`'+_0xd5e2cf['field']+_0x0ffc('0x64'));}break;case _0x0ffc('0x65'):if(_0xd5e2cf[_0x0ffc('0x66')]==='$substring'){if(_0xd5e2cf['value']['split']('\x20')[_0x0ffc('0x5f')]>0x1){_0x52bacc[_0x9df9c4](_0x0ffc('0x67'),qs['getFullTextValue'](_0xd5e2cf[_0x0ffc('0x61')]),null);}else{var _0x455e96='%'+_0xd5e2cf['value']+'%';_0x52bacc[_0x9df9c4](_0x0ffc('0x68'),_0x455e96,_0x455e96,_0x455e96);}}else{_0x3320e9=_[_0x0ffc('0x69')](_0x2cbcda,[_0x0ffc('0x2c'),'ContactId']);_0xd5e2cf[_0x0ffc('0x4d')]=_0x0ffc('0x6a');_0x435ea9=as[_0x0ffc('0x6b')](_0x252aa0,_0x3320e9[_0x0ffc('0x3f')],_0xd5e2cf);_0x52bacc[_0x9df9c4](_0x435ea9['text'],_0x435ea9['value'][_0x0ffc('0x6c')],_0x435ea9['value'][_0x0ffc('0x2a')]);}break;case _0x0ffc('0x6d'):var _0x53b3a8=_0xd5e2cf[_0x0ffc('0x61')]['split'](',')[_0x0ffc('0x2f')](function(_0x44397e){return Number(_0x44397e);});_0x53b3a8['forEach'](function(_0x5d515c){_0x5aea61['or'](_0x0ffc('0x6e'),'%,'+_0x5d515c+',%');});_0x2715f3=_[_0x0ffc('0x6f')](_0x2715f3,_0x53b3a8);break;case _0x0ffc('0x70'):if(_0xd5e2cf[_0x0ffc('0x66')]===_0x0ffc('0x71')){_0x52bacc[_0x9df9c4](_0x0ffc('0x72'),'%'+_0xd5e2cf['value']+'%',null);}else{_0x3320e9=_['find'](_0x2cbcda,[_0x0ffc('0x2c'),_0x0ffc('0x3b')]);_0xd5e2cf[_0x0ffc('0x4d')]=_0x0ffc('0x3b');_0x435ea9=as[_0x0ffc('0x6b')](_0x252aa0,_0x3320e9['type'],_0xd5e2cf);_0x52bacc[_0x9df9c4](_0x435ea9['text'],_0x435ea9[_0x0ffc('0x61')][_0x0ffc('0x6c')],_0x435ea9[_0x0ffc('0x61')]['end']);}break;case _0x0ffc('0x73'):_0x435ea9=as[_0x0ffc('0x6b')]('me',null,_0xd5e2cf);_0x52bacc[_0x9df9c4](_0x435ea9[_0x0ffc('0x74')],_0x435ea9[_0x0ffc('0x61')][_0x0ffc('0x6c')],_0x435ea9['value'][_0x0ffc('0x2a')]);break;}}else{var _0x435ea9=as[_0x0ffc('0x6b')](_0x252aa0,_0x3320e9[_0x0ffc('0x3f')],_0xd5e2cf);_0x52bacc[_0x9df9c4](_0x435ea9['text'],_0x435ea9[_0x0ffc('0x61')][_0x0ffc('0x6c')],_0x435ea9[_0x0ffc('0x61')][_0x0ffc('0x2a')]);}}}else{var _0x589e42=_(_0x157391[_0x0ffc('0x41')])[_0x0ffc('0x75')]()[_0x0ffc('0x2f')](function(_0x1adfb6){return _[_0x0ffc('0x76')](_0x2cbcda,[_0x0ffc('0x2c'),_0x1adfb6])?_0x1adfb6:undefined;})[_0x0ffc('0x77')]()['value']();if(!_[_0x0ffc('0x78')](_0x589e42)){_0x589e42['forEach'](function(_0x3bde31){if(_0x3bde31===_0x0ffc('0x79')){_0x39ba1f['where'](_0x0ffc('0x7a'),[][_0x0ffc('0x7b')](_0x157391[_0x0ffc('0x41')][_0x3bde31]));}else if(_0x3bde31===_0x0ffc('0x7c')){var _0x2418d6=JSON[_0x0ffc('0x7d')](_0x157391[_0x0ffc('0x41')][_0x3bde31])[_0x0ffc('0x7e')];var _0x581591=JSON[_0x0ffc('0x7d')](_0x157391[_0x0ffc('0x41')][_0x3bde31])[_0x0ffc('0x7f')];_0x39ba1f[_0x0ffc('0x4a')](_0x0ffc('0x80'),_0x2418d6,_0x581591);}else{if(_0x157391[_0x0ffc('0x41')][_0x3bde31]===_0x0ffc('0x81')){_0x39ba1f[_0x0ffc('0x4a')]('i.'+_0x3bde31+'\x20IS\x20NULL');}else{_0x39ba1f[_0x0ffc('0x4a')]('i.'+_0x3bde31+_0x0ffc('0x82'),_0x157391['query'][_0x3bde31]);}}});}if(_0x157391[_0x0ffc('0x41')]['read']){if(_0x157391[_0x0ffc('0x41')]['read']==0x1){_0x39ba1f[_0x0ffc('0x62')]('`unreadMessages`\x20=\x200');}else{_0x39ba1f[_0x0ffc('0x62')](_0x0ffc('0x83'));}}if(_0x157391[_0x0ffc('0x41')]['tag']){_0x2715f3=_['isArray'](_0x157391[_0x0ffc('0x41')]['tag'])?_0x157391['query'][_0x0ffc('0x84')]:new Array(_0x157391[_0x0ffc('0x41')]['tag']);_0x2715f3[_0x0ffc('0x32')](function(_0x489c4a){_0x5aea61['or'](_0x0ffc('0x6e'),'%,'+_0x489c4a+',%');});}if(_0x157391[_0x0ffc('0x41')][_0x0ffc('0x85')]){var _0x53fbd4=_0x157391[_0x0ffc('0x41')][_0x0ffc('0x85')][_0x0ffc('0x86')]('\x5c','\x5c\x5c')[_0x0ffc('0x86')](/'/g,'\x27\x27');if(qs[_0x0ffc('0x87')](_0x53fbd4)){_0x52bacc['or']('i.id\x20LIKE\x20?',_0x53fbd4+'%')['or'](_0x0ffc('0x88'),_0x53fbd4+'%');}else{_0x52bacc['or'](_0x0ffc('0x89'),qs['getFullTextValue'](_0x53fbd4))['or'](_0x0ffc('0x8a'),_0x53fbd4+'%');}}}_0x39ba1f['where'](_0x52bacc);_0x39ba1f[_0x0ffc('0x8b')](_0x0ffc('0x8c'));var _0x26c098={'type':db[_0x0ffc('0x8d')][_0x0ffc('0x8e')][_0x0ffc('0x8f')],'raw':!![]};var _0x5956a0=_0x39ba1f[_0x0ffc('0x90')]();_0x5956a0[_0x0ffc('0x4d')]('i.id');_0x5956a0[_0x0ffc('0x4d')](_0x0ffc('0x91'),_0x0ffc('0x60'));if(_0x25676f[_0x0ffc('0x48')]){_0x25676f[_0x0ffc('0x48')][_0x0ffc('0x32')](function(_0x115958){var _0x2fbe10=_0x115958[0x0]===_0x0ffc('0x92')?_0x115958[0x0]:'i.'+_0x115958[0x0];_0x39ba1f[_0x0ffc('0x48')](_0x2fbe10,_0x115958[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x2715f3)){_0x39ba1f['having'](_0x5aea61);_0x5956a0[_0x0ffc('0x4a')](_0x0ffc('0x93'),_0x2715f3);}BPromise[_0x0ffc('0x94')]()[_0x0ffc('0x29')](function(){if(!_0x39dec3){if(_0x157391[_0x0ffc('0x41')]['WhatsappAccountId'])return;_0x5956a0[_0x0ffc('0x4a')](_0x0ffc('0x95'));_0x39ba1f[_0x0ffc('0x4a')](_0x0ffc('0x95'));return;}if(_0x157391['user'][_0x0ffc('0x96')]!==_0x0ffc('0x97'))return;return _0x157391[_0x0ffc('0x98')][_0x0ffc('0x99')]({'attributes':['id'],'raw':!![]})[_0x0ffc('0x29')](function(_0xc6ffb6){if(_[_0x0ffc('0x78')](_0xc6ffb6)){_0x5956a0[_0x0ffc('0x4a')](_0x0ffc('0x9a'));_0x39ba1f['where'](_0x0ffc('0x9a'));}else{_0x5956a0[_0x0ffc('0x4a')]('i.WhatsappAccountId\x20IN\x20?',_[_0x0ffc('0x2f')](_0xc6ffb6,'id'));_0x39ba1f[_0x0ffc('0x4a')](_0x0ffc('0x7a'),_[_0x0ffc('0x2f')](_0xc6ffb6,'id'));}});})[_0x0ffc('0x29')](function(){if(_0x157391['user'][_0x0ffc('0x96')]===_0x0ffc('0x97')&&!_0x39dec3&&!_0x157391['query']['WhatsappAccountId'])return[];return db[_0x0ffc('0x9b')][_0x0ffc('0x41')](_0x5956a0['toString'](),_0x26c098);})['then'](function(_0x44c882){_0x173af5[_0x0ffc('0x23')]=_0x44c882[_0x0ffc('0x5f')];if(_0x173af5[_0x0ffc('0x23')]===0x0)return[];return db['sequelize'][_0x0ffc('0x41')](_0x4a146f[_0x0ffc('0x9c')](),_0x26c098)[_0x0ffc('0x29')](function(_0x528ae2){_0x2b16f7=_[_0x0ffc('0x9d')](_0x528ae2,'id');_0x26c098=_['merge'](_0x26c098,{'model':db[_0x0ffc('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x157391[_0x0ffc('0x41')][_0x0ffc('0x45')]){_0x25676f[_0x0ffc('0x44')][_0x0ffc('0x32')](function(_0x59cb48){_0x39ba1f[_0x0ffc('0x4d')]('i.'+_0x59cb48);});}else{_0x39ba1f[_0x0ffc('0x4d')](_0x0ffc('0x91'),_0x0ffc('0x60'));_0x39ba1f['field'](_0x0ffc('0x9e'),'Account.key');_0x39ba1f[_0x0ffc('0x4d')](_0x0ffc('0x9f'),_0x0ffc('0xa0'));_0x39ba1f[_0x0ffc('0x4d')]('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');_0x39ba1f['field'](_0x0ffc('0xa1'));_0x39ba1f[_0x0ffc('0x4d')]('c.firstName',_0x0ffc('0xa2'));_0x39ba1f['field'](_0x0ffc('0xa3'),'Contact.lastName');_0x39ba1f[_0x0ffc('0x4d')](_0x0ffc('0xa4'),_0x0ffc('0xa5'));_0x39ba1f[_0x0ffc('0x4d')]('c.phone',_0x0ffc('0xa6'));_0x39ba1f[_0x0ffc('0x4d')](_0x0ffc('0xa7'),_0x0ffc('0xa8'));_0x39ba1f[_0x0ffc('0x4d')](_0x0ffc('0xa9'),_0x0ffc('0xaa'));_0x39ba1f[_0x0ffc('0x4d')](_0x0ffc('0xab'),_0x0ffc('0xac'));_0x39ba1f[_0x0ffc('0x4d')]('o.internal','Owner.internal');_0x39ba1f['field'](_0x0ffc('0xad'),_0x0ffc('0x34'));}if(_0x25676f[_0x0ffc('0x22')])_0x39ba1f[_0x0ffc('0x22')](_0x25676f['limit']);if(_0x25676f[_0x0ffc('0x20')])_0x39ba1f['offset'](_0x25676f['offset']);return db[_0x0ffc('0x9b')][_0x0ffc('0x41')](_0x39ba1f[_0x0ffc('0x9c')](),_0x26c098);})['then'](function(_0xc53a71){if(_0xc53a71[_0x0ffc('0x5f')]>0x0)_0x34e244['where'](_0x0ffc('0xae'),_[_0x0ffc('0x2f')](_0xc53a71,'id'));return db[_0x0ffc('0x9b')][_0x0ffc('0x41')](_0x34e244['toString'](),_0x26c098)[_0x0ffc('0x29')](function(_0x5715ee){var _0xf7f324=_[_0x0ffc('0xaf')](_0x5715ee,_0x0ffc('0xb0'));var _0xc5a87b=[];_0xc53a71[_0x0ffc('0x32')](function(_0xe9549c){_0xc5a87b[_0x0ffc('0x33')](updateWhatsappInteraction(_0xe9549c,_0x2b16f7,_0xf7f324));});return BPromise[_0x0ffc('0xb1')](_0xc5a87b);});});})[_0x0ffc('0x29')](function(_0x1e3ef7){_0x173af5[_0x0ffc('0xb2')]=_0x1e3ef7;return _0x173af5;})['then'](respondWithFilteredResult(_0x280d2a,_0x25676f))['catch'](handleError(_0x280d2a,null));};exports['show']=function(_0x5c57e3,_0x4e97c8){var _0x487f59={'raw':![],'where':{'id':_0x5c57e3[_0x0ffc('0xb3')]['id']}},_0x3f4929={};_0x3f4929[_0x0ffc('0x40')]=_[_0x0ffc('0x75')](db[_0x0ffc('0x3e')]['rawAttributes']);_0x3f4929[_0x0ffc('0x41')]=_[_0x0ffc('0x75')](_0x5c57e3[_0x0ffc('0x41')]);_0x3f4929['filters']=_[_0x0ffc('0x43')](_0x3f4929[_0x0ffc('0x40')],_0x3f4929[_0x0ffc('0x41')]);_0x487f59[_0x0ffc('0x44')]=_[_0x0ffc('0x43')](_0x3f4929[_0x0ffc('0x40')],qs[_0x0ffc('0x45')](_0x5c57e3['query'][_0x0ffc('0x45')]));_0x487f59[_0x0ffc('0x44')]=_0x487f59[_0x0ffc('0x44')]['length']?_0x487f59[_0x0ffc('0x44')]:_0x3f4929['model'];if(_0x5c57e3[_0x0ffc('0x41')]['includeAll']){_0x487f59[_0x0ffc('0xb4')]=[{'all':!![]}];}_0x487f59=_['merge']({},_0x487f59,_0x5c57e3[_0x0ffc('0xb5')]);return db[_0x0ffc('0x3e')][_0x0ffc('0x69')](_0x487f59)[_0x0ffc('0x29')](handleEntityNotFound(_0x4e97c8,null))['then'](respondWithResult(_0x4e97c8,null))[_0x0ffc('0x35')](handleError(_0x4e97c8,null));};exports[_0x0ffc('0xb6')]=function(_0xcc734f,_0x3a999e){return db[_0x0ffc('0x3e')][_0x0ffc('0xb6')](_0xcc734f['body'],{})[_0x0ffc('0x29')](respondWithResult(_0x3a999e,0xc9))['catch'](handleError(_0x3a999e,null));};exports[_0x0ffc('0x27')]=function(_0x493e2f,_0x3b2c0f){if(_0x493e2f['body']['id']){delete _0x493e2f[_0x0ffc('0x73')]['id'];}return db[_0x0ffc('0x3e')][_0x0ffc('0x69')]({'where':{'id':_0x493e2f[_0x0ffc('0xb3')]['id']}})[_0x0ffc('0x29')](handleEntityNotFound(_0x3b2c0f,null))[_0x0ffc('0x29')](saveUpdates(_0x493e2f[_0x0ffc('0x73')],null))[_0x0ffc('0x29')](respondWithResult(_0x3b2c0f,null))[_0x0ffc('0x35')](handleError(_0x3b2c0f,null));};exports[_0x0ffc('0x28')]=function(_0x1dc98d,_0x1a34c3){return db['WhatsappInteraction'][_0x0ffc('0x69')]({'where':{'id':_0x1dc98d['params']['id']}})[_0x0ffc('0x29')](handleEntityNotFound(_0x1a34c3,null))['then'](removeEntity(_0x1a34c3,null))[_0x0ffc('0x35')](handleError(_0x1a34c3,null));};exports[_0x0ffc('0xb7')]=function(_0x4ed331,_0x433efe){return db[_0x0ffc('0x3e')]['describe']()['then'](respondWithResult(_0x433efe,null))['catch'](handleError(_0x433efe,null));};exports[_0x0ffc('0xb8')]=function(_0x4dce3a,_0x4c9fda,_0x8732cb){return db[_0x0ffc('0xb9')][_0x0ffc('0x69')]({'where':{'id':_0x4dce3a[_0x0ffc('0xb3')]['id']}})['then'](handleEntityNotFound(_0x4c9fda,null))['then'](function(_0x4077a6){if(_0x4077a6){return _0x4077a6['addMessage'](_0x4dce3a[_0x0ffc('0x73')]['ids'],_[_0x0ffc('0xba')](_0x4dce3a[_0x0ffc('0x73')],['ids','id'])||{});}})[_0x0ffc('0x29')](respondWithResult(_0x4c9fda,null))[_0x0ffc('0x35')](handleError(_0x4c9fda,null));};exports[_0x0ffc('0xbb')]=function(_0x384d19,_0x19f8c3,_0x48c6da){var _0x868b05={'raw':![],'where':{}};var _0x1e8689={};var _0x229f61={'count':0x0,'rows':[]};return db[_0x0ffc('0x3e')][_0x0ffc('0xbc')]({'where':{'id':_0x384d19[_0x0ffc('0xb3')]['id']}})[_0x0ffc('0x29')](handleEntityNotFound(_0x19f8c3,null))['then'](function(_0x4a24a8){if(_0x4a24a8){_0x1e8689[_0x0ffc('0x40')]=_['keys'](db['WhatsappMessage']['rawAttributes']);_0x1e8689['query']=_[_0x0ffc('0x75')](_0x384d19[_0x0ffc('0x41')]);_0x1e8689['filters']=_[_0x0ffc('0x43')](_0x1e8689['model'],_0x1e8689[_0x0ffc('0x41')]);_0x868b05[_0x0ffc('0x44')]=_[_0x0ffc('0x43')](_0x1e8689[_0x0ffc('0x40')],qs[_0x0ffc('0x45')](_0x384d19[_0x0ffc('0x41')][_0x0ffc('0x45')]));_0x868b05[_0x0ffc('0x44')]=_0x868b05[_0x0ffc('0x44')][_0x0ffc('0x5f')]?_0x868b05[_0x0ffc('0x44')]:_0x1e8689['model'];if(!_0x384d19['query']['hasOwnProperty'](_0x0ffc('0x47'))){_0x868b05[_0x0ffc('0x22')]=qs[_0x0ffc('0x22')](_0x384d19[_0x0ffc('0x41')][_0x0ffc('0x22')]);_0x868b05[_0x0ffc('0x20')]=qs[_0x0ffc('0x20')](_0x384d19[_0x0ffc('0x41')][_0x0ffc('0x20')]);}_0x868b05[_0x0ffc('0x48')]=qs[_0x0ffc('0x49')](_0x384d19[_0x0ffc('0x41')][_0x0ffc('0x49')]);_0x868b05[_0x0ffc('0x4a')]=qs[_0x0ffc('0x42')](_[_0x0ffc('0x4b')](_0x384d19[_0x0ffc('0x41')],_0x1e8689[_0x0ffc('0x42')]));_0x868b05['where']['WhatsappInteractionId']=_0x4a24a8['id'];if(_0x384d19['query']['filter']){_0x868b05[_0x0ffc('0x4a')]=_[_0x0ffc('0xbd')](_0x868b05[_0x0ffc('0x4a')],{'$or':_[_0x0ffc('0x2f')](_0x868b05[_0x0ffc('0x44')],function(_0x423e09){var _0x4051b5={};_0x4051b5[_0x423e09]={'$like':'%'+_0x384d19[_0x0ffc('0x41')]['filter']+'%'};return _0x4051b5;})});}if(_0x384d19[_0x0ffc('0x41')][_0x0ffc('0x7e')]){var _0x93f14f=_0x384d19[_0x0ffc('0x41')][_0x0ffc('0x7e')][_0x0ffc('0x31')](',');var _0xd3359c={};_0xd3359c[_0x93f14f[0x0]]={'$gte':moment(_0x93f14f[0x1])[_0x0ffc('0xbe')](_0x0ffc('0xbf'))};_0x868b05[_0x0ffc('0x4a')]=_[_0x0ffc('0xbd')](_0x868b05[_0x0ffc('0x4a')],_0xd3359c);}_0x868b05=_[_0x0ffc('0xbd')]({},_0x868b05,_0x384d19[_0x0ffc('0xb5')]);return db[_0x0ffc('0xb9')][_0x0ffc('0x23')]({'where':_0x868b05[_0x0ffc('0x4a')]})['then'](function(_0x36bae4){_0x229f61['count']=_0x36bae4;if(_0x384d19['query'][_0x0ffc('0xc0')]){_0x868b05[_0x0ffc('0xb4')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x0ffc('0xc1')](_0x868b05);})[_0x0ffc('0x29')](function(_0x47d390){_0x229f61[_0x0ffc('0xb2')]=_0x47d390;return _0x229f61;});}})[_0x0ffc('0x29')](respondWithFilteredResult(_0x19f8c3,_0x868b05))[_0x0ffc('0x35')](handleError(_0x19f8c3,null));};exports[_0x0ffc('0xc2')]=function(_0x406a44,_0x1b2258,_0x4b8acd){return db[_0x0ffc('0x3e')][_0x0ffc('0x69')]({'where':{'id':_0x406a44[_0x0ffc('0xb3')]['id']}})[_0x0ffc('0x29')](handleEntityNotFound(_0x1b2258,null))['then'](function(_0x1b7161){if(_0x1b7161){return _0x1b7161[_0x0ffc('0xc3')](_0x406a44[_0x0ffc('0x73')][_0x0ffc('0xc4')],_[_0x0ffc('0xba')](_0x406a44[_0x0ffc('0x73')],[_0x0ffc('0xc4'),'id'])||{})['spread'](function(){return db[_0x0ffc('0x6d')][_0x0ffc('0xc1')]({'attributes':['id',_0x0ffc('0x2c'),_0x0ffc('0xc5')],'where':{'id':_0x406a44[_0x0ffc('0x73')][_0x0ffc('0xc4')]}});})['then'](function(_0x146b00){socket['emit'](_0x0ffc('0xc6'),{'id':Number(_0x406a44[_0x0ffc('0xb3')]['id']),'tags':_0x146b00||[]});return{'id':Number(_0x406a44['params']['id']),'tags':_0x146b00||[]};});}})[_0x0ffc('0x29')](respondWithResult(_0x1b2258,null))['catch'](handleError(_0x1b2258,null));};exports[_0x0ffc('0xc7')]=function(_0xf333a8,_0x49a6ea,_0x49ef7d){return db[_0x0ffc('0x3e')][_0x0ffc('0x69')]({'where':{'id':_0xf333a8[_0x0ffc('0xb3')]['id']}})[_0x0ffc('0x29')](handleEntityNotFound(_0x49a6ea,null))['then'](function(_0x1386b2){if(_0x1386b2){return _0x1386b2[_0x0ffc('0xc7')](_0xf333a8[_0x0ffc('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x49a6ea,null))[_0x0ffc('0x35')](handleError(_0x49a6ea,null));};exports[_0x0ffc('0xc8')]=function(_0x8a1f04,_0x570c50){var _0x5b0078=moment()[_0x0ffc('0xc9')]()[_0x0ffc('0x9c')]();var _0x2e93c2=path[_0x0ffc('0xca')](config[_0x0ffc('0xcb')],_0x0ffc('0xcc'),_0x0ffc('0xcd'),_0x0ffc('0xce'));var _0x8cc252=path[_0x0ffc('0xca')](config[_0x0ffc('0xcb')],_0x0ffc('0xcc'),_0x0ffc('0xcd'),'attachments');var _0x567b87=path[_0x0ffc('0xca')](_0x2e93c2,_0x5b0078);var _0x176649=util['format']('transcript-%d-%s.zip',_0x8a1f04['params']['id'],_0x5b0078);var _0x501010=path[_0x0ffc('0xca')](_0x2e93c2,_0x176649);var _0x9366a8=[];_0x9366a8['push']({'model':db['User'],'as':_0x0ffc('0x70'),'attributes':['id','fullname'],'raw':!![]});_0x9366a8[_0x0ffc('0x33')]({'model':db['CmContact'],'as':_0x0ffc('0x65'),'attributes':['id',_0x0ffc('0xcf'),_0x0ffc('0xd0')],'raw':!![]});if(_0x8a1f04['query'][_0x0ffc('0xd1')]){_0x9366a8[_0x0ffc('0x33')]({'model':db['Attachment'],'as':_0x0ffc('0xd2'),'raw':!![]});}var _0x4bc8b4=[{'model':db[_0x0ffc('0xb9')],'as':'Messages','attributes':['id',_0x0ffc('0x73'),'createdAt',_0x0ffc('0xd3'),'secret',_0x0ffc('0xd4')],'include':_0x9366a8}];_0x4bc8b4[_0x0ffc('0x33')]({'model':db[_0x0ffc('0xd5')],'as':'Account','attributes':['id',_0x0ffc('0x2c')]});_0x4bc8b4[_0x0ffc('0x33')]({'model':db['User'],'as':_0x0ffc('0xd6'),'attributes':['id',_0x0ffc('0xd7')]});return db[_0x0ffc('0x3e')][_0x0ffc('0x69')]({'where':{'id':_0x8a1f04[_0x0ffc('0xb3')]['id']},'include':_0x4bc8b4})[_0x0ffc('0x29')](handleEntityNotFound(_0x570c50,null))[_0x0ffc('0x29')](function(_0x47935e){if(_0x47935e){var _0x499853=_0x47935e['get']({'plain':!![]});fs['mkdirSync'](_0x567b87);var _0x463ee3={'channel':_0x0ffc('0xd8'),'account':_0x499853[_0x0ffc('0xd9')][_0x0ffc('0x2c')],'agent':_0x499853['Owner']?_0x499853[_0x0ffc('0xd6')][_0x0ffc('0xd7')]:_0x0ffc('0xda'),'createdAt':moment(_0x499853[_0x0ffc('0x7c')])[_0x0ffc('0xbe')](_0x0ffc('0xbf'))['toString'](),'closedAt':_0x499853['closed']?moment(_0x499853[_0x0ffc('0xdb')])[_0x0ffc('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0ffc('0x9c')]():'','disposition':_0x499853[_0x0ffc('0xdc')],'messages':_(_0x499853[_0x0ffc('0xdd')])[_0x0ffc('0x85')]({'secret':![]})[_0x0ffc('0x2f')](function(_0x8d11b9){if(_0x8d11b9[_0x0ffc('0xd2')]){var _0x18c0f1=path[_0x0ffc('0xca')](_0x8cc252,_0x8d11b9[_0x0ffc('0xd2')][_0x0ffc('0xde')]);if(fs[_0x0ffc('0xdf')](_0x18c0f1)){fs['createReadStream'](_0x18c0f1)[_0x0ffc('0xe0')](fs['createWriteStream'](path[_0x0ffc('0xca')](_0x567b87,_0x8d11b9[_0x0ffc('0xd2')]['basename'])));}}return{'date':moment(_0x8d11b9[_0x0ffc('0x7c')])['format'](_0x0ffc('0xbf'))['toString'](),'sender':_0x8d11b9['direction']==='out'?_0x8d11b9[_0x0ffc('0x70')]?_0x8d11b9[_0x0ffc('0x70')][_0x0ffc('0xd7')]:_0x0ffc('0xe1'):_0x8d11b9[_0x0ffc('0x65')][_0x0ffc('0xcf')]+(_0x8d11b9[_0x0ffc('0x65')]['lastName']?'\x20'+_0x8d11b9[_0x0ffc('0x65')][_0x0ffc('0xd0')]:''),'body':_0x8d11b9[_0x0ffc('0xd2')]?_0x8d11b9['Attachment'][_0x0ffc('0xde')]:_0x8d11b9[_0x0ffc('0x73')],'direction':_0x8d11b9[_0x0ffc('0xd3')]==='out'?'A':'C','secret':_0x8d11b9[_0x0ffc('0xe2')],'read':_0x8d11b9[_0x0ffc('0xd4')],'attachment':_0x8d11b9[_0x0ffc('0xd2')]};})['value']()};return ejs[_0x0ffc('0xe3')](path[_0x0ffc('0xca')](config[_0x0ffc('0xcb')],'server','views',_0x0ffc('0xe4')),{'interaction':_0x463ee3})['then'](function(_0x39278b){var _0x9a34c4=path[_0x0ffc('0xca')](_0x567b87,_0x0ffc('0xe5')+_0x499853['id']+'-'+_0x5b0078+_0x0ffc('0xe6'));var _0x2e0f2f={'path':_0x9a34c4,'channel':_0x0ffc('0xd8'),'interactionId':_0x499853['id']};return pdf[_0x0ffc('0xe7')](_0x39278b,_0x2e0f2f);})[_0x0ffc('0x29')](function(){return new BPromise(function(_0x2c519c,_0x53d37f){zipdir(_0x567b87,{'saveTo':_0x501010},function(_0x21cd7a,_0x2d3f40){if(_0x21cd7a)return _0x53d37f(_0x21cd7a);return _0x2c519c(_0x2d3f40);});})['then'](function(){return new BPromise(function(_0x1673d8,_0x25ab11){rimraf(_0x567b87,function(_0x1e3446){if(_0x1e3446)_0x25ab11(_0x1e3446);return _0x1673d8();});});})['then'](function(){return _0x570c50['download'](_0x501010,_0x176649,function(_0x4ba86d){if(_0x4ba86d){console[_0x0ffc('0xe8')]('err',_0x4ba86d);}else{fs['unlinkSync'](_0x501010);}});});});}else{return _0x570c50['sendStatus'](0xc8);}})[_0x0ffc('0x35')](handleError(_0x570c50,null));}; \ No newline at end of file +var _0x57b7=['i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','null','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','toString','sequelize','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','params','includeAll','include','options','create','body','describe','addMessage','WhatsappMessage','ids','getMessages','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','omit','Tag','findAll','removeTags','download','join','root','files','server','attachments','transcript-%d-%s.zip','CmContact','lastName','Attachment','Messages','secret','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','closedAt','disposition','existsSync','pipe','createWriteStream','direction','firstName','basename','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','status','end','json','limit','undefined','count','offset','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','Users','map','fullname','TagIds','split','forEach','Tags','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','query','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','WhatsappAccountId','where'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x57b7,0x160));var _0x757b=function(_0x2988c8,_0x43f10c){_0x2988c8=_0x2988c8-0x0;var _0x2efa56=_0x57b7[_0x2988c8];return _0x2efa56;};'use strict';var emlformat=require(_0x757b('0x0'));var rimraf=require(_0x757b('0x1'));var zipdir=require(_0x757b('0x2'));var jsonpatch=require(_0x757b('0x3'));var rp=require(_0x757b('0x4'));var moment=require(_0x757b('0x5'));var BPromise=require(_0x757b('0x6'));var Mustache=require('mustache');var util=require(_0x757b('0x7'));var path=require(_0x757b('0x8'));var sox=require(_0x757b('0x9'));var csv=require(_0x757b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x757b('0xb'));var _=require(_0x757b('0xc'));var squel=require(_0x757b('0xd'));var crypto=require(_0x757b('0xe'));var jsforce=require(_0x757b('0xf'));var deskjs=require(_0x757b('0x10'));var toCsv=require(_0x757b('0xa'));var querystring=require(_0x757b('0x11'));var Papa=require('papaparse');var Redis=require(_0x757b('0x12'));var authService=require(_0x757b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x757b('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x757b('0x15'));var logger=require('../../config/logger')(_0x757b('0x16'));var utils=require(_0x757b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x757b('0x18'));var db=require(_0x757b('0x19'))['db'];config['redis']=_[_0x757b('0x1a')](config['redis'],{'host':_0x757b('0x1b'),'port':0x18eb});var socket=require(_0x757b('0x1c'))(new Redis(config['redis']));require(_0x757b('0x1d'))['register'](socket);function respondWithStatusCode(_0x274538,_0x10abf4){_0x10abf4=_0x10abf4||0xcc;return function(_0x1a4c30){if(_0x1a4c30){return _0x274538['sendStatus'](_0x10abf4);}return _0x274538[_0x757b('0x1e')](_0x10abf4)[_0x757b('0x1f')]();};}function respondWithResult(_0x5c338e,_0x268a27){_0x268a27=_0x268a27||0xc8;return function(_0x493286){if(_0x493286){return _0x5c338e['status'](_0x268a27)[_0x757b('0x20')](_0x493286);}};}function respondWithFilteredResult(_0x4c931a,_0x7c892c){return function(_0x267b5d){if(_0x267b5d){var _0x3bd3ab=typeof _0x7c892c['offset']==='undefined'&&typeof _0x7c892c[_0x757b('0x21')]===_0x757b('0x22');var _0x401182=_0x267b5d[_0x757b('0x23')];var _0xda81d9=_0x3bd3ab?0x0:_0x7c892c[_0x757b('0x24')];var _0x4680e9=_0x3bd3ab?_0x267b5d[_0x757b('0x23')]:_0x7c892c[_0x757b('0x24')]+_0x7c892c[_0x757b('0x21')];var _0x5ee3f8;if(_0x4680e9>=_0x401182){_0x4680e9=_0x401182;_0x5ee3f8=0xc8;}else{_0x5ee3f8=0xce;}_0x4c931a[_0x757b('0x1e')](_0x5ee3f8);return _0x4c931a[_0x757b('0x25')](_0x757b('0x26'),_0xda81d9+'-'+_0x4680e9+'/'+_0x401182)[_0x757b('0x20')](_0x267b5d);}return null;};}function patchUpdates(_0x2a7b2a){return function(_0x2f589e){try{jsonpatch['apply'](_0x2f589e,_0x2a7b2a,!![]);}catch(_0x200891){return BPromise['reject'](_0x200891);}return _0x2f589e[_0x757b('0x27')]();};}function saveUpdates(_0x1cda09,_0x2985ca){return function(_0x110063){if(_0x110063){return _0x110063[_0x757b('0x28')](_0x1cda09)[_0x757b('0x29')](function(_0x490212){return _0x490212;});}return null;};}function removeEntity(_0x53ddfa,_0x4a7602){return function(_0x1a8fb7){if(_0x1a8fb7){return _0x1a8fb7[_0x757b('0x2a')]()[_0x757b('0x29')](function(){_0x53ddfa['status'](0xcc)[_0x757b('0x1f')]();});}};}function handleEntityNotFound(_0x108022,_0x1ef05b){return function(_0x1f9312){if(!_0x1f9312){_0x108022[_0x757b('0x2b')](0x194);}return _0x1f9312;};}function handleError(_0x35fa71,_0x4f015b){_0x4f015b=_0x4f015b||0x1f4;return function(_0x143e03){logger[_0x757b('0x2c')](_0x143e03[_0x757b('0x2d')]);if(_0x143e03[_0x757b('0x2e')]){delete _0x143e03['name'];}_0x35fa71['status'](_0x4f015b)['send'](_0x143e03);};}function getInteractionUsers(_0x2cff2f,_0x30e708){return new BPromise(function(_0x11ec53,_0x374512){try{if(_0x30e708[_0x2cff2f['id']]){_0x2cff2f[_0x757b('0x2f')]=_[_0x757b('0x30')](_0x30e708[_0x2cff2f['id']],function(_0x1a8b47){return{'id':_0x1a8b47['id'],'fullname':_0x1a8b47[_0x757b('0x31')]};});}}catch(_0x304092){_0x374512(_0x304092);}_0x11ec53(_0x2cff2f);});}function getInteractionTags(_0x1cbdc5,_0xf9252a){return new BPromise(function(_0x1484de,_0x350d9a){try{if(_0x1cbdc5[_0x757b('0x32')]){_0x1cbdc5['Tags']=[];_0x1cbdc5['TagIds'][_0x757b('0x33')](',')[_0x757b('0x34')](function(_0x110942){_0x1cbdc5[_0x757b('0x35')][_0x757b('0x36')](_0xf9252a[_0x110942]);});}delete _0x1cbdc5[_0x757b('0x32')];}catch(_0x4ee3d4){_0x350d9a(_0x4ee3d4);}_0x1484de(_0x1cbdc5);});}function updateWhatsappInteraction(_0x5672db,_0x3e625b,_0x62447f){return new BPromise(function(_0x2db29f,_0x4f96f1){return getInteractionUsers(_0x5672db,_0x62447f)['then'](function(_0x1d815e){return getInteractionTags(_0x1d815e,_0x3e625b);})[_0x757b('0x29')](function(_0x53fe52){return getStateInteraction(_0x53fe52);})[_0x757b('0x29')](function(_0x36dd88){_0x2db29f(_0x36dd88);})[_0x757b('0x37')](function(_0x45f958){_0x4f96f1(_0x45f958);});});}function getStateInteraction(_0x358dbe){return new BPromise(function(_0x2c16bb){_0x358dbe[_0x757b('0x38')]=0x0;_0x358dbe[_0x757b('0x39')]=0x0;_0x358dbe[_0x757b('0x3a')]=0x0;_0x358dbe[_0x757b('0x3b')]=0x0;_0x358dbe[_0x757b('0x3c')]=0x0;if(!_0x358dbe[_0x757b('0x3d')]&&!_0x358dbe[_0x757b('0x3e')]){_0x358dbe[_0x757b('0x38')]+=0x1;}if(!_0x358dbe['closed']&&_0x358dbe[_0x757b('0x3e')]){_0x358dbe['talking']+=0x1;if(_0x358dbe['waiting']){_0x358dbe[_0x757b('0x38')]-=0x1;}}if(_0x358dbe[_0x757b('0x3d')]&&_0x358dbe[_0x757b('0x3e')]){_0x358dbe['answered']+=0x1;if(_0x358dbe[_0x757b('0x39')]){_0x358dbe[_0x757b('0x39')]-=0x1;}}if(_0x358dbe[_0x757b('0x3d')]&&!_0x358dbe[_0x757b('0x3e')]){_0x358dbe['unmanaged']+=0x1;if(_0x358dbe[_0x757b('0x38')]){_0x358dbe[_0x757b('0x38')]-=0x1;}}_0x358dbe['total']+=0x1;_0x2c16bb(_0x358dbe);});}exports[_0x757b('0x3f')]=function(_0x2c99c8,_0x3031c9){var _0x3ec245={},_0x489a8a={},_0x295ade={'count':0x0,'rows':[]};var _0x37bff3=_[_0x757b('0x30')](db[_0x757b('0x40')][_0x757b('0x41')],function(_0x35f1b8){return{'name':_0x35f1b8[_0x757b('0x42')],'type':_0x35f1b8[_0x757b('0x43')][_0x757b('0x44')]};});_0x489a8a[_0x757b('0x45')]=_[_0x757b('0x30')](_0x37bff3,_0x757b('0x2e'));_0x489a8a['query']=_[_0x757b('0x46')](_0x2c99c8['query']);_0x489a8a[_0x757b('0x47')]=_[_0x757b('0x48')](_0x489a8a['model'],_0x489a8a['query']);_0x3ec245[_0x757b('0x49')]=_[_0x757b('0x48')](_0x489a8a[_0x757b('0x45')],qs[_0x757b('0x4a')](_0x2c99c8['query'][_0x757b('0x4a')]));_0x3ec245['attributes']=_0x3ec245[_0x757b('0x49')][_0x757b('0x4b')]?_0x3ec245[_0x757b('0x49')]:_0x489a8a[_0x757b('0x45')];if(!_0x2c99c8['query'][_0x757b('0x4c')](_0x757b('0x4d'))){_0x3ec245['limit']=qs[_0x757b('0x21')](_0x2c99c8['query'][_0x757b('0x21')]);_0x3ec245[_0x757b('0x24')]=qs['offset'](_0x2c99c8[_0x757b('0x4e')][_0x757b('0x24')]);}_0x3ec245[_0x757b('0x4f')]=qs['sort'](_0x2c99c8[_0x757b('0x4e')][_0x757b('0x50')]);_0x3ec245['where']=qs['filters'](_[_0x757b('0x51')](_0x2c99c8['query'],_0x489a8a['filters']),_0x37bff3);var _0x10ff08=[];var _0x30bf24=squel[_0x757b('0x52')]()[_0x757b('0x53')]('id')['field'](_0x757b('0x2e'))[_0x757b('0x53')](_0x757b('0x54'))[_0x757b('0x55')](_0x757b('0x56'));var _0x5ef778=squel[_0x757b('0x52')]()[_0x757b('0x53')](_0x757b('0x57'))[_0x757b('0x53')](_0x757b('0x58'))[_0x757b('0x53')]('ui.WhatsappInteractionId')[_0x757b('0x55')]('user_has_whatsapp_interactions','ui')[_0x757b('0x59')](_0x757b('0x5a'),'u',_0x757b('0x5b'));var _0x29deea=squel[_0x757b('0x52')]()[_0x757b('0x55')]('whatsapp_interactions','i')[_0x757b('0x59')](_0x757b('0x5c'),'c',_0x757b('0x5d'))[_0x757b('0x59')](_0x757b('0x5a'),'o','o.id\x20=\x20i.UserId')[_0x757b('0x59')](_0x757b('0x5e'),'a',_0x757b('0x5f'))[_0x757b('0x59')](_0x757b('0x60'),'me',_0x757b('0x61'))[_0x757b('0x59')](_0x757b('0x62'),'it',_0x757b('0x63'))[_0x757b('0x59')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x4cfd1d=squel[_0x757b('0x64')]();var _0x18b48c=[];var _0x29ad08=squel[_0x757b('0x64')]();var _0x30a980;if(_0x2c99c8[_0x757b('0x4e')][_0x757b('0x65')]){_0x30a980=as[_0x757b('0x66')](_0x2c99c8[_0x757b('0x4e')][_0x757b('0x65')]);var _0x46fd0d=_0x30a980[_0x757b('0x67')];for(var _0x53cc0d=0x0;_0x53cc0d<_0x30a980[_0x757b('0x68')][_0x757b('0x4b')];_0x53cc0d++){var _0x2383fd=_0x30a980['conditions'][_0x53cc0d];var _0xd951cf='i';var _0x3a922a=_[_0x757b('0x69')](_0x37bff3,[_0x757b('0x2e'),_0x2383fd[_0x757b('0x53')]]);if(!_0x3a922a){switch(_0x2383fd[_0x757b('0x53')]){case'unreadMessages':if(_0x2383fd['value']==0x1){_0x29deea['having']('`'+_0x2383fd[_0x757b('0x53')]+_0x757b('0x6a'));}else{_0x29deea['having']('`'+_0x2383fd['field']+_0x757b('0x6b'));}break;case _0x757b('0x6c'):if(_0x2383fd[_0x757b('0x6d')]===_0x757b('0x6e')){if(_0x2383fd[_0x757b('0x6f')][_0x757b('0x33')]('\x20')[_0x757b('0x4b')]>0x1){_0x4cfd1d[_0x46fd0d](_0x757b('0x70'),qs[_0x757b('0x71')](_0x2383fd['value']),null);}else{var _0x442bcb='%'+_0x2383fd['value']+'%';_0x4cfd1d[_0x46fd0d](_0x757b('0x72'),_0x442bcb,_0x442bcb,_0x442bcb);}}else{_0x3a922a=_['find'](_0x37bff3,['name','ContactId']);_0x2383fd[_0x757b('0x53')]=_0x757b('0x73');_0x1f9bf2=as[_0x757b('0x74')](_0xd951cf,_0x3a922a['type'],_0x2383fd);_0x4cfd1d[_0x46fd0d](_0x1f9bf2[_0x757b('0x75')],_0x1f9bf2[_0x757b('0x6f')][_0x757b('0x76')],_0x1f9bf2['value']['end']);}break;case'Tag':var _0x45db58=_0x2383fd['value']['split'](',')[_0x757b('0x30')](function(_0x46fd4e){return Number(_0x46fd4e);});_0x45db58[_0x757b('0x34')](function(_0x14b4fc){_0x29ad08['or'](_0x757b('0x77'),'%,'+_0x14b4fc+',%');});_0x18b48c=_[_0x757b('0x78')](_0x18b48c,_0x45db58);break;case _0x757b('0x79'):if(_0x2383fd[_0x757b('0x6d')]==='$substring'){_0x4cfd1d[_0x46fd0d](_0x757b('0x7a'),'%'+_0x2383fd[_0x757b('0x6f')]+'%',null);}else{_0x3a922a=_[_0x757b('0x69')](_0x37bff3,[_0x757b('0x2e'),_0x757b('0x3e')]);_0x2383fd['field']=_0x757b('0x3e');_0x1f9bf2=as[_0x757b('0x74')](_0xd951cf,_0x3a922a[_0x757b('0x43')],_0x2383fd);_0x4cfd1d[_0x46fd0d](_0x1f9bf2[_0x757b('0x75')],_0x1f9bf2[_0x757b('0x6f')][_0x757b('0x76')],_0x1f9bf2[_0x757b('0x6f')][_0x757b('0x1f')]);}break;case'body':_0x1f9bf2=as[_0x757b('0x74')]('me',null,_0x2383fd);_0x4cfd1d[_0x46fd0d](_0x1f9bf2[_0x757b('0x75')],_0x1f9bf2[_0x757b('0x6f')][_0x757b('0x76')],_0x1f9bf2['value'][_0x757b('0x1f')]);break;}}else{var _0x1f9bf2=as['buildExpression'](_0xd951cf,_0x3a922a[_0x757b('0x43')],_0x2383fd);_0x4cfd1d[_0x46fd0d](_0x1f9bf2['text'],_0x1f9bf2[_0x757b('0x6f')]['start'],_0x1f9bf2['value']['end']);}}}else{var _0x3d2dda=_(_0x2c99c8[_0x757b('0x4e')])[_0x757b('0x46')]()[_0x757b('0x30')](function(_0x1c217f){return _[_0x757b('0x7b')](_0x37bff3,['name',_0x1c217f])?_0x1c217f:undefined;})[_0x757b('0x7c')]()[_0x757b('0x6f')]();if(!_[_0x757b('0x7d')](_0x3d2dda)){_0x3d2dda['forEach'](function(_0x38b55f){if(_0x38b55f===_0x757b('0x7e')){_0x29deea[_0x757b('0x7f')](_0x757b('0x80'),[][_0x757b('0x81')](_0x2c99c8[_0x757b('0x4e')][_0x38b55f]));}else if(_0x38b55f===_0x757b('0x82')){var _0x56c593=JSON[_0x757b('0x83')](_0x2c99c8[_0x757b('0x4e')][_0x38b55f])['$gte'];var _0xda9e65=JSON[_0x757b('0x83')](_0x2c99c8[_0x757b('0x4e')][_0x38b55f])[_0x757b('0x84')];_0x29deea[_0x757b('0x7f')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x56c593,_0xda9e65);}else{if(_0x2c99c8[_0x757b('0x4e')][_0x38b55f]===_0x757b('0x85')){_0x29deea[_0x757b('0x7f')]('i.'+_0x38b55f+'\x20IS\x20NULL');}else{_0x29deea[_0x757b('0x7f')]('i.'+_0x38b55f+'\x20=\x20?',_0x2c99c8[_0x757b('0x4e')][_0x38b55f]);}}});}if(_0x2c99c8['query'][_0x757b('0x86')]){if(_0x2c99c8['query'][_0x757b('0x86')]==0x1){_0x29deea[_0x757b('0x87')](_0x757b('0x88'));}else{_0x29deea['having'](_0x757b('0x89'));}}if(_0x2c99c8['query'][_0x757b('0x8a')]){_0x18b48c=_[_0x757b('0x8b')](_0x2c99c8['query']['tag'])?_0x2c99c8[_0x757b('0x4e')][_0x757b('0x8a')]:new Array(_0x2c99c8[_0x757b('0x4e')][_0x757b('0x8a')]);_0x18b48c[_0x757b('0x34')](function(_0x522bd4){_0x29ad08['or'](_0x757b('0x77'),'%,'+_0x522bd4+',%');});}if(_0x2c99c8[_0x757b('0x4e')][_0x757b('0x8c')]){var _0x1ad7d9=_0x2c99c8[_0x757b('0x4e')][_0x757b('0x8c')][_0x757b('0x8d')]('\x5c','\x5c\x5c')[_0x757b('0x8d')](/'/g,'\x27\x27');if(qs[_0x757b('0x8e')](_0x1ad7d9)){_0x4cfd1d['or'](_0x757b('0x8f'),_0x1ad7d9+'%')['or'](_0x757b('0x90'),_0x1ad7d9+'%');}else{_0x4cfd1d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x757b('0x71')](_0x1ad7d9))['or'](_0x757b('0x91'),_0x1ad7d9+'%');}}}_0x29deea['where'](_0x4cfd1d);_0x29deea['group'](_0x757b('0x92'));var _0x298474={'type':db[_0x757b('0x93')]['QueryTypes']['SELECT'],'raw':!![]};var _0x7f7bf6=_0x29deea[_0x757b('0x94')]();_0x7f7bf6[_0x757b('0x53')](_0x757b('0x92'));_0x7f7bf6[_0x757b('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x757b('0x95'));if(_0x3ec245[_0x757b('0x4f')]){_0x3ec245[_0x757b('0x4f')]['forEach'](function(_0x5cd1b2){var _0x3f1102=_0x5cd1b2[0x0]===_0x757b('0x96')?_0x5cd1b2[0x0]:'i.'+_0x5cd1b2[0x0];_0x29deea[_0x757b('0x4f')](_0x3f1102,_0x5cd1b2[0x1]===_0x757b('0x97')?![]:!![]);});}if(!_['isEmpty'](_0x18b48c)){_0x29deea[_0x757b('0x87')](_0x29ad08);_0x7f7bf6[_0x757b('0x7f')](_0x757b('0x98'),_0x18b48c);}BPromise['resolve']()[_0x757b('0x29')](function(){if(!_0x30a980){if(_0x2c99c8[_0x757b('0x4e')][_0x757b('0x7e')])return;_0x7f7bf6[_0x757b('0x7f')](_0x757b('0x99'));_0x29deea[_0x757b('0x7f')](_0x757b('0x99'));return;}if(_0x2c99c8[_0x757b('0x9a')][_0x757b('0x9b')]!==_0x757b('0x9c'))return;return _0x2c99c8[_0x757b('0x9a')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x757b('0x29')](function(_0x4bad51){if(_[_0x757b('0x7d')](_0x4bad51)){_0x7f7bf6[_0x757b('0x7f')]('i.WhatsappAccountId\x20IS\x20NULL');_0x29deea[_0x757b('0x7f')](_0x757b('0x9d'));}else{_0x7f7bf6[_0x757b('0x7f')](_0x757b('0x80'),_[_0x757b('0x30')](_0x4bad51,'id'));_0x29deea[_0x757b('0x7f')](_0x757b('0x80'),_[_0x757b('0x30')](_0x4bad51,'id'));}});})[_0x757b('0x29')](function(){if(_0x2c99c8[_0x757b('0x9a')][_0x757b('0x9b')]===_0x757b('0x9c')&&!_0x30a980&&!_0x2c99c8['query']['WhatsappAccountId'])return[];return db['sequelize'][_0x757b('0x4e')](_0x7f7bf6[_0x757b('0x9e')](),_0x298474);})['then'](function(_0x11420c){_0x295ade[_0x757b('0x23')]=_0x11420c[_0x757b('0x4b')];if(_0x295ade[_0x757b('0x23')]===0x0)return[];return db[_0x757b('0x9f')][_0x757b('0x4e')](_0x30bf24[_0x757b('0x9e')](),_0x298474)[_0x757b('0x29')](function(_0x1f2d22){_0x10ff08=_['keyBy'](_0x1f2d22,'id');_0x298474=_[_0x757b('0xa0')](_0x298474,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2c99c8[_0x757b('0x4e')][_0x757b('0x4a')]){_0x3ec245[_0x757b('0x49')][_0x757b('0x34')](function(_0x3a0a8a){_0x29deea[_0x757b('0x53')]('i.'+_0x3a0a8a);});}else{_0x29deea[_0x757b('0x53')](_0x757b('0xa1'),'unreadMessages');_0x29deea['field']('a.key',_0x757b('0xa2'));_0x29deea[_0x757b('0x53')](_0x757b('0xa3'),_0x757b('0xa4'));_0x29deea[_0x757b('0x53')](_0x757b('0xa5'),'contactName');_0x29deea[_0x757b('0x53')]('i.*');_0x29deea[_0x757b('0x53')](_0x757b('0xa6'),_0x757b('0xa7'));_0x29deea['field']('c.lastName','Contact.lastName');_0x29deea[_0x757b('0x53')](_0x757b('0xa8'),_0x757b('0xa9'));_0x29deea[_0x757b('0x53')](_0x757b('0xaa'),_0x757b('0xab'));_0x29deea[_0x757b('0x53')](_0x757b('0xac'),'Contact.mobile');_0x29deea[_0x757b('0x53')](_0x757b('0xad'),_0x757b('0xae'));_0x29deea[_0x757b('0x53')](_0x757b('0xaf'),_0x757b('0xb0'));_0x29deea[_0x757b('0x53')](_0x757b('0xb1'),_0x757b('0xb2'));_0x29deea[_0x757b('0x53')](_0x757b('0xb3'),_0x757b('0x32'));}if(_0x3ec245[_0x757b('0x21')])_0x29deea[_0x757b('0x21')](_0x3ec245[_0x757b('0x21')]);if(_0x3ec245[_0x757b('0x24')])_0x29deea[_0x757b('0x24')](_0x3ec245[_0x757b('0x24')]);return db['sequelize'][_0x757b('0x4e')](_0x29deea[_0x757b('0x9e')](),_0x298474);})['then'](function(_0x11271e){if(_0x11271e['length']>0x0)_0x5ef778['where'](_0x757b('0xb4'),_['map'](_0x11271e,'id'));return db[_0x757b('0x9f')][_0x757b('0x4e')](_0x5ef778[_0x757b('0x9e')](),_0x298474)[_0x757b('0x29')](function(_0x541baa){var _0x45a1d4=_[_0x757b('0xb5')](_0x541baa,'WhatsappInteractionId');var _0x21c6da=[];_0x11271e[_0x757b('0x34')](function(_0x5d8c56){_0x21c6da[_0x757b('0x36')](updateWhatsappInteraction(_0x5d8c56,_0x10ff08,_0x45a1d4));});return BPromise[_0x757b('0xb6')](_0x21c6da);});});})['then'](function(_0x1c08c3){_0x295ade[_0x757b('0xb7')]=_0x1c08c3;return _0x295ade;})['then'](respondWithFilteredResult(_0x3031c9,_0x3ec245))['catch'](handleError(_0x3031c9,null));};exports['show']=function(_0x203271,_0x5396c0){var _0x542153={'raw':![],'where':{'id':_0x203271[_0x757b('0xb8')]['id']}},_0x11f3a6={};_0x11f3a6[_0x757b('0x45')]=_[_0x757b('0x46')](db[_0x757b('0x40')][_0x757b('0x41')]);_0x11f3a6[_0x757b('0x4e')]=_['keys'](_0x203271[_0x757b('0x4e')]);_0x11f3a6[_0x757b('0x47')]=_[_0x757b('0x48')](_0x11f3a6[_0x757b('0x45')],_0x11f3a6[_0x757b('0x4e')]);_0x542153['attributes']=_['intersection'](_0x11f3a6[_0x757b('0x45')],qs[_0x757b('0x4a')](_0x203271[_0x757b('0x4e')][_0x757b('0x4a')]));_0x542153['attributes']=_0x542153[_0x757b('0x49')]['length']?_0x542153[_0x757b('0x49')]:_0x11f3a6['model'];if(_0x203271[_0x757b('0x4e')][_0x757b('0xb9')]){_0x542153[_0x757b('0xba')]=[{'all':!![]}];}_0x542153=_[_0x757b('0xa0')]({},_0x542153,_0x203271[_0x757b('0xbb')]);return db[_0x757b('0x40')][_0x757b('0x69')](_0x542153)[_0x757b('0x29')](handleEntityNotFound(_0x5396c0,null))['then'](respondWithResult(_0x5396c0,null))[_0x757b('0x37')](handleError(_0x5396c0,null));};exports['create']=function(_0x41803d,_0x5d8e33){return db[_0x757b('0x40')][_0x757b('0xbc')](_0x41803d[_0x757b('0xbd')],{})[_0x757b('0x29')](respondWithResult(_0x5d8e33,0xc9))['catch'](handleError(_0x5d8e33,null));};exports[_0x757b('0x28')]=function(_0x4149d7,_0x743078){if(_0x4149d7['body']['id']){delete _0x4149d7[_0x757b('0xbd')]['id'];}return db['WhatsappInteraction'][_0x757b('0x69')]({'where':{'id':_0x4149d7[_0x757b('0xb8')]['id']}})['then'](handleEntityNotFound(_0x743078,null))[_0x757b('0x29')](saveUpdates(_0x4149d7[_0x757b('0xbd')],null))[_0x757b('0x29')](respondWithResult(_0x743078,null))[_0x757b('0x37')](handleError(_0x743078,null));};exports[_0x757b('0x2a')]=function(_0x11a1b5,_0x306eff){return db[_0x757b('0x40')][_0x757b('0x69')]({'where':{'id':_0x11a1b5[_0x757b('0xb8')]['id']}})[_0x757b('0x29')](handleEntityNotFound(_0x306eff,null))['then'](removeEntity(_0x306eff,null))[_0x757b('0x37')](handleError(_0x306eff,null));};exports[_0x757b('0xbe')]=function(_0x386096,_0x2db021){return db[_0x757b('0x40')]['describe']()[_0x757b('0x29')](respondWithResult(_0x2db021,null))['catch'](handleError(_0x2db021,null));};exports[_0x757b('0xbf')]=function(_0x2590d9,_0x57987a,_0x312eea){return db[_0x757b('0xc0')][_0x757b('0x69')]({'where':{'id':_0x2590d9['params']['id']}})['then'](handleEntityNotFound(_0x57987a,null))[_0x757b('0x29')](function(_0x469674){if(_0x469674){return _0x469674[_0x757b('0xbf')](_0x2590d9['body'][_0x757b('0xc1')],_['omit'](_0x2590d9[_0x757b('0xbd')],[_0x757b('0xc1'),'id'])||{});}})[_0x757b('0x29')](respondWithResult(_0x57987a,null))[_0x757b('0x37')](handleError(_0x57987a,null));};exports[_0x757b('0xc2')]=function(_0x23066d,_0x177a46,_0x13eedc){var _0x3643ae={'raw':![],'where':{}};var _0x4e1d7f={};var _0x50de84={'count':0x0,'rows':[]};return db[_0x757b('0x40')]['findOne']({'where':{'id':_0x23066d[_0x757b('0xb8')]['id']}})[_0x757b('0x29')](handleEntityNotFound(_0x177a46,null))[_0x757b('0x29')](function(_0xd3ddcc){if(_0xd3ddcc){_0x4e1d7f[_0x757b('0x45')]=_[_0x757b('0x46')](db[_0x757b('0xc0')][_0x757b('0x41')]);_0x4e1d7f['query']=_[_0x757b('0x46')](_0x23066d[_0x757b('0x4e')]);_0x4e1d7f[_0x757b('0x47')]=_['intersection'](_0x4e1d7f[_0x757b('0x45')],_0x4e1d7f[_0x757b('0x4e')]);_0x3643ae[_0x757b('0x49')]=_['intersection'](_0x4e1d7f[_0x757b('0x45')],qs[_0x757b('0x4a')](_0x23066d[_0x757b('0x4e')][_0x757b('0x4a')]));_0x3643ae['attributes']=_0x3643ae[_0x757b('0x49')][_0x757b('0x4b')]?_0x3643ae['attributes']:_0x4e1d7f['model'];if(!_0x23066d['query']['hasOwnProperty'](_0x757b('0x4d'))){_0x3643ae[_0x757b('0x21')]=qs[_0x757b('0x21')](_0x23066d[_0x757b('0x4e')]['limit']);_0x3643ae[_0x757b('0x24')]=qs[_0x757b('0x24')](_0x23066d[_0x757b('0x4e')][_0x757b('0x24')]);}_0x3643ae['order']=qs[_0x757b('0x50')](_0x23066d[_0x757b('0x4e')][_0x757b('0x50')]);_0x3643ae['where']=qs[_0x757b('0x47')](_[_0x757b('0x51')](_0x23066d[_0x757b('0x4e')],_0x4e1d7f[_0x757b('0x47')]));_0x3643ae['where'][_0x757b('0xc3')]=_0xd3ddcc['id'];if(_0x23066d[_0x757b('0x4e')][_0x757b('0x8c')]){_0x3643ae[_0x757b('0x7f')]=_[_0x757b('0xa0')](_0x3643ae[_0x757b('0x7f')],{'$or':_[_0x757b('0x30')](_0x3643ae[_0x757b('0x49')],function(_0x58ee0d){var _0x5741a3={};_0x5741a3[_0x58ee0d]={'$like':'%'+_0x23066d[_0x757b('0x4e')][_0x757b('0x8c')]+'%'};return _0x5741a3;})});}if(_0x23066d[_0x757b('0x4e')][_0x757b('0xc4')]){var _0x14e0c2=_0x23066d[_0x757b('0x4e')]['$gte'][_0x757b('0x33')](',');var _0x3e7b73={};_0x3e7b73[_0x14e0c2[0x0]]={'$gte':moment(_0x14e0c2[0x1])[_0x757b('0xc5')](_0x757b('0xc6'))};_0x3643ae[_0x757b('0x7f')]=_[_0x757b('0xa0')](_0x3643ae['where'],_0x3e7b73);}_0x3643ae=_[_0x757b('0xa0')]({},_0x3643ae,_0x23066d[_0x757b('0xbb')]);return db[_0x757b('0xc0')][_0x757b('0x23')]({'where':_0x3643ae[_0x757b('0x7f')]})['then'](function(_0x8ab76b){_0x50de84[_0x757b('0x23')]=_0x8ab76b;if(_0x23066d[_0x757b('0x4e')][_0x757b('0xb9')]){_0x3643ae[_0x757b('0xba')]=[{'all':!![]}];}return db[_0x757b('0xc0')]['findAll'](_0x3643ae);})[_0x757b('0x29')](function(_0x270117){_0x50de84['rows']=_0x270117;return _0x50de84;});}})[_0x757b('0x29')](respondWithFilteredResult(_0x177a46,_0x3643ae))[_0x757b('0x37')](handleError(_0x177a46,null));};exports[_0x757b('0xc7')]=function(_0x27f0eb,_0x50ac76,_0x425f8e){return db[_0x757b('0x40')][_0x757b('0x69')]({'where':{'id':_0x27f0eb[_0x757b('0xb8')]['id']}})['then'](handleEntityNotFound(_0x50ac76,null))['then'](function(_0xba3b91){if(_0xba3b91){return _0xba3b91[_0x757b('0xc8')](_0x27f0eb[_0x757b('0xbd')][_0x757b('0xc1')],_[_0x757b('0xc9')](_0x27f0eb[_0x757b('0xbd')],[_0x757b('0xc1'),'id'])||{})['spread'](function(){return db[_0x757b('0xca')][_0x757b('0xcb')]({'attributes':['id','name',_0x757b('0x54')],'where':{'id':_0x27f0eb[_0x757b('0xbd')][_0x757b('0xc1')]}});})[_0x757b('0x29')](function(_0x333813){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x27f0eb[_0x757b('0xb8')]['id']),'tags':_0x333813||[]});return{'id':Number(_0x27f0eb[_0x757b('0xb8')]['id']),'tags':_0x333813||[]};});}})[_0x757b('0x29')](respondWithResult(_0x50ac76,null))[_0x757b('0x37')](handleError(_0x50ac76,null));};exports[_0x757b('0xcc')]=function(_0x20b471,_0x4858a5,_0x30f7db){return db[_0x757b('0x40')][_0x757b('0x69')]({'where':{'id':_0x20b471[_0x757b('0xb8')]['id']}})[_0x757b('0x29')](handleEntityNotFound(_0x4858a5,null))[_0x757b('0x29')](function(_0x15858e){if(_0x15858e){return _0x15858e[_0x757b('0xcc')](_0x20b471[_0x757b('0x4e')]['ids']);}})[_0x757b('0x29')](respondWithStatusCode(_0x4858a5,null))[_0x757b('0x37')](handleError(_0x4858a5,null));};exports[_0x757b('0xcd')]=function(_0x96dda9,_0x5dee15){var _0x5a1433=moment()['unix']()[_0x757b('0x9e')]();var _0x1585f2=path[_0x757b('0xce')](config[_0x757b('0xcf')],'server',_0x757b('0xd0'),'tmp');var _0x3e817c=path['join'](config[_0x757b('0xcf')],_0x757b('0xd1'),_0x757b('0xd0'),_0x757b('0xd2'));var _0x5a242c=path[_0x757b('0xce')](_0x1585f2,_0x5a1433);var _0x444b26=util[_0x757b('0xc5')](_0x757b('0xd3'),_0x96dda9[_0x757b('0xb8')]['id'],_0x5a1433);var _0x29ec1a=path[_0x757b('0xce')](_0x1585f2,_0x444b26);var _0x234b11=[];_0x234b11[_0x757b('0x36')]({'model':db['User'],'as':'User','attributes':['id',_0x757b('0x31')],'raw':!![]});_0x234b11[_0x757b('0x36')]({'model':db[_0x757b('0xd4')],'as':_0x757b('0x6c'),'attributes':['id','firstName',_0x757b('0xd5')],'raw':!![]});if(_0x96dda9[_0x757b('0x4e')]['attachments']){_0x234b11['push']({'model':db[_0x757b('0xd6')],'as':'Attachment','raw':!![]});}var _0x4f28de=[{'model':db[_0x757b('0xc0')],'as':_0x757b('0xd7'),'attributes':['id',_0x757b('0xbd'),_0x757b('0x82'),'direction',_0x757b('0xd8'),_0x757b('0x86')],'include':_0x234b11}];_0x4f28de[_0x757b('0x36')]({'model':db[_0x757b('0xd9')],'as':_0x757b('0xda'),'attributes':['id','name']});_0x4f28de[_0x757b('0x36')]({'model':db['User'],'as':'Owner','attributes':['id',_0x757b('0x31')]});return db[_0x757b('0x40')][_0x757b('0x69')]({'where':{'id':_0x96dda9[_0x757b('0xb8')]['id']},'include':_0x4f28de})[_0x757b('0x29')](handleEntityNotFound(_0x5dee15,null))[_0x757b('0x29')](function(_0x546a93){if(_0x546a93){var _0x4ec346=_0x546a93[_0x757b('0xdb')]({'plain':!![]});fs[_0x757b('0xdc')](_0x5a242c);var _0x16cfaa={'channel':_0x757b('0xdd'),'account':_0x4ec346[_0x757b('0xda')][_0x757b('0x2e')],'agent':_0x4ec346[_0x757b('0xde')]?_0x4ec346[_0x757b('0xde')]['fullname']:_0x757b('0xdf'),'createdAt':moment(_0x4ec346[_0x757b('0x82')])[_0x757b('0xc5')](_0x757b('0xc6'))['toString'](),'closedAt':_0x4ec346['closed']?moment(_0x4ec346[_0x757b('0xe0')])['format'](_0x757b('0xc6'))[_0x757b('0x9e')]():'','disposition':_0x4ec346[_0x757b('0xe1')],'messages':_(_0x4ec346[_0x757b('0xd7')])[_0x757b('0x8c')]({'secret':![]})[_0x757b('0x30')](function(_0x45adfa){if(_0x45adfa[_0x757b('0xd6')]){var _0x29b982=path[_0x757b('0xce')](_0x3e817c,_0x45adfa['Attachment']['basename']);if(fs[_0x757b('0xe2')](_0x29b982)){fs['createReadStream'](_0x29b982)[_0x757b('0xe3')](fs[_0x757b('0xe4')](path[_0x757b('0xce')](_0x5a242c,_0x45adfa[_0x757b('0xd6')]['basename'])));}}return{'date':moment(_0x45adfa[_0x757b('0x82')])[_0x757b('0xc5')](_0x757b('0xc6'))[_0x757b('0x9e')](),'sender':_0x45adfa[_0x757b('0xe5')]==='out'?_0x45adfa[_0x757b('0x79')]?_0x45adfa['User']['fullname']:'System':_0x45adfa[_0x757b('0x6c')][_0x757b('0xe6')]+(_0x45adfa[_0x757b('0x6c')][_0x757b('0xd5')]?'\x20'+_0x45adfa[_0x757b('0x6c')][_0x757b('0xd5')]:''),'body':_0x45adfa['Attachment']?_0x45adfa['Attachment'][_0x757b('0xe7')]:_0x45adfa[_0x757b('0xbd')],'direction':_0x45adfa['direction']===_0x757b('0xe8')?'A':'C','secret':_0x45adfa['secret'],'read':_0x45adfa[_0x757b('0x86')],'attachment':_0x45adfa['Attachment']};})[_0x757b('0x6f')]()};return ejs[_0x757b('0xe9')](path[_0x757b('0xce')](config['root'],'server',_0x757b('0xea'),_0x757b('0xeb')),{'interaction':_0x16cfaa})['then'](function(_0x120e94){var _0x4464f8=path[_0x757b('0xce')](_0x5a242c,_0x757b('0xec')+_0x4ec346['id']+'-'+_0x5a1433+_0x757b('0xed'));var _0x46299b={'path':_0x4464f8,'channel':_0x757b('0xdd'),'interactionId':_0x4ec346['id']};return pdf['createPdfFromHTML'](_0x120e94,_0x46299b);})[_0x757b('0x29')](function(){return new BPromise(function(_0x30e35d,_0x3cc65c){zipdir(_0x5a242c,{'saveTo':_0x29ec1a},function(_0x2dc16c,_0x3246fe){if(_0x2dc16c)return _0x3cc65c(_0x2dc16c);return _0x30e35d(_0x3246fe);});})[_0x757b('0x29')](function(){return new BPromise(function(_0x3037bb,_0x250e72){rimraf(_0x5a242c,function(_0x276944){if(_0x276944)_0x250e72(_0x276944);return _0x3037bb();});});})[_0x757b('0x29')](function(){return _0x5dee15['download'](_0x29ec1a,_0x444b26,function(_0x5d1e58){if(_0x5d1e58){console[_0x757b('0xee')](_0x757b('0xef'),_0x5d1e58);}else{fs['unlinkSync'](_0x29ec1a);}});});});}else{return _0x5dee15['sendStatus'](0xc8);}})[_0x757b('0x37')](handleError(_0x5dee15,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 07d63d8..527f7bd 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 _0x9b87=['unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','findAll'];(function(_0x3eb078,_0x2a0ec0){var _0xdfc759=function(_0x7e671f){while(--_0x7e671f){_0x3eb078['push'](_0x3eb078['shift']());}};_0xdfc759(++_0x2a0ec0);}(_0x9b87,0x8e));var _0x79b8=function(_0x50d849,_0x35be22){_0x50d849=_0x50d849-0x0;var _0x4e7f60=_0x9b87[_0x50d849];return _0x4e7f60;};'use strict';var EventEmitter=require(_0x79b8('0x0'));var WhatsappInteraction=require(_0x79b8('0x1'))['db'][_0x79b8('0x2')];var WhatsappMessage=require(_0x79b8('0x1'))['db'][_0x79b8('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x79b8('0x4')](0x0);var events={'afterCreate':_0x79b8('0x5'),'afterUpdate':_0x79b8('0x6'),'afterDestroy':_0x79b8('0x7')};function emitEvent(_0xa65bbc){return function(_0x1f9679,_0x399796,_0x3ccc53){_0x1f9679[_0x79b8('0x8')]({'attributes':['id'],'raw':!![]})[_0x79b8('0x9')](function(_0xf5e0f2){_0x1f9679['setDataValue']('Users',_0xf5e0f2['map'](function(_0x4c058b){return{'id':_0x4c058b['id']};}));return WhatsappMessage[_0x79b8('0xa')]({'where':{'WhatsappInteractionId':_0x1f9679['id'],'direction':'in','read':![]},'raw':!![]});})[_0x79b8('0x9')](function(_0x2f3453){_0x1f9679['setDataValue'](_0x79b8('0xb'),_0x2f3453[_0x79b8('0xc')]);WhatsappInteractionEvents[_0x79b8('0xd')](_0xa65bbc+':'+_0x1f9679['id'],_0x1f9679);WhatsappInteractionEvents['emit'](_0xa65bbc,_0x1f9679);_0x3ccc53(null);})['catch'](_0x3ccc53(null));};}for(var e in events){if(events[_0x79b8('0xe')](e)){var event=events[e];WhatsappInteraction[_0x79b8('0xf')](e,emitEvent(event));}}module[_0x79b8('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x6584=['findAll','unreadMessages','emit','catch','hook','events','../../mysqldb','WhatsappInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map'];(function(_0x223280,_0x301105){var _0x1950be=function(_0x417610){while(--_0x417610){_0x223280['push'](_0x223280['shift']());}};_0x1950be(++_0x301105);}(_0x6584,0x175));var _0x4658=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x6584[_0x48d6a3];return _0x38bfa0;};'use strict';var EventEmitter=require(_0x4658('0x0'));var WhatsappInteraction=require(_0x4658('0x1'))['db'][_0x4658('0x2')];var WhatsappMessage=require(_0x4658('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x4658('0x3')](0x0);var events={'afterCreate':_0x4658('0x4'),'afterUpdate':_0x4658('0x5'),'afterDestroy':'remove'};function emitEvent(_0x53a2eb){return function(_0x15fbf2,_0x126301,_0x253182){_0x15fbf2[_0x4658('0x6')]({'attributes':['id'],'raw':!![]})[_0x4658('0x7')](function(_0x56c592){_0x15fbf2[_0x4658('0x8')](_0x4658('0x9'),_0x56c592[_0x4658('0xa')](function(_0x51d3f4){return{'id':_0x51d3f4['id']};}));return WhatsappMessage[_0x4658('0xb')]({'where':{'WhatsappInteractionId':_0x15fbf2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4658('0x7')](function(_0x570ef0){_0x15fbf2['setDataValue'](_0x4658('0xc'),_0x570ef0['length']);WhatsappInteractionEvents[_0x4658('0xd')](_0x53a2eb+':'+_0x15fbf2['id'],_0x15fbf2);WhatsappInteractionEvents['emit'](_0x53a2eb,_0x15fbf2);_0x253182(null);})[_0x4658('0xe')](_0x253182(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x4658('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 7013845..0617733 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 _0x70b8=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','WhatsappInteraction','whatsapp_interactions','changed'];(function(_0x2fb7a5,_0x3dfffe){var _0x4b6a39=function(_0x512851){while(--_0x512851){_0x2fb7a5['push'](_0x2fb7a5['shift']());}};_0x4b6a39(++_0x3dfffe);}(_0x70b8,0xf4));var _0x870b=function(_0xa2511f,_0x1ea220){_0xa2511f=_0xa2511f-0x0;var _0x519109=_0x70b8[_0xa2511f];return _0x519109;};'use strict';var _=require(_0x870b('0x0'));var util=require('util');var logger=require(_0x870b('0x1'))(_0x870b('0x2'));var moment=require(_0x870b('0x3'));var BPromise=require(_0x870b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x870b('0x5'));var rimraf=require(_0x870b('0x6'));var config=require(_0x870b('0x7'));var attributes=require(_0x870b('0x8'));module['exports']=function(_0xa8545,_0xed6380){return _0xa8545['define'](_0x870b('0x9'),attributes,{'tableName':_0x870b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x100f9e,_0x323220,_0x599de3){if(_0x100f9e[_0x870b('0xb')](_0x870b('0xc'))){_0x100f9e[_0x870b('0xd')]=moment()[_0x870b('0xe')](_0x870b('0xf'));}_0x599de3(null,_0x100f9e);}}});}; \ No newline at end of file +var _0x1e39=['WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','define'];(function(_0x5d917b,_0x4e9627){var _0x262152=function(_0x3bcf28){while(--_0x3bcf28){_0x5d917b['push'](_0x5d917b['shift']());}};_0x262152(++_0x4e9627);}(_0x1e39,0xc2));var _0x91e3=function(_0x4ffa64,_0x271035){_0x4ffa64=_0x4ffa64-0x0;var _0x5da001=_0x1e39[_0x4ffa64];return _0x5da001;};'use strict';var _=require('lodash');var util=require(_0x91e3('0x0'));var logger=require(_0x91e3('0x1'))(_0x91e3('0x2'));var moment=require(_0x91e3('0x3'));var BPromise=require('bluebird');var rp=require(_0x91e3('0x4'));var fs=require('fs');var path=require(_0x91e3('0x5'));var rimraf=require(_0x91e3('0x6'));var config=require('../../config/environment');var attributes=require(_0x91e3('0x7'));module[_0x91e3('0x8')]=function(_0x309c14,_0x207d82){return _0x309c14[_0x91e3('0x9')](_0x91e3('0xa'),attributes,{'tableName':_0x91e3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2fdb50,_0x3cb448,_0x45e006){if(_0x2fdb50[_0x91e3('0xc')](_0x91e3('0xd'))){_0x2fdb50[_0x91e3('0xe')]=moment()[_0x91e3('0xf')](_0x91e3('0x10'));}_0x45e006(null,_0x2fdb50);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 29e6f40..4697bb8 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 _0x74fd=['addTags','AddTags','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','limit','AddTagsToWhatsappInteraction'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x74fd,0x102));var _0xd74f=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x74fd[_0x179e11];return _0x549f04;};'use strict';var _=require('lodash');var util=require(_0xd74f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd74f('0x1'));var fs=require('fs');var Redis=require(_0xd74f('0x2'));var db=require(_0xd74f('0x3'))['db'];var utils=require(_0xd74f('0x4'));var logger=require(_0xd74f('0x5'))(_0xd74f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xd74f('0x7')]=_['defaults'](config['redis'],{'host':_0xd74f('0x8'),'port':0x18eb});var socket=require(_0xd74f('0x9'))(new Redis(config['redis']));require(_0xd74f('0xa'))['register'](socket);function respondWithRpcPromise(_0x39aba5,_0x3160fa,_0x418456){return new BPromise(function(_0x481463,_0x13d964){return client[_0xd74f('0xb')](_0x39aba5,_0x418456)[_0xd74f('0xc')](function(_0x859eb2){logger[_0xd74f('0xd')](_0xd74f('0xe'),_0x3160fa,_0xd74f('0xf'));logger[_0xd74f('0x10')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x3160fa,'request\x20sent',JSON[_0xd74f('0x11')](_0x859eb2));if(_0x859eb2['error']){if(_0x859eb2['error']['code']===0x1f4){logger['error'](_0xd74f('0xe'),_0x3160fa,_0x859eb2[_0xd74f('0x12')]['message']);return _0x13d964(_0x859eb2[_0xd74f('0x12')][_0xd74f('0x13')]);}logger[_0xd74f('0x12')](_0xd74f('0xe'),_0x3160fa,_0x859eb2[_0xd74f('0x12')][_0xd74f('0x13')]);return _0x481463(_0x859eb2[_0xd74f('0x12')]['message']);}else{logger[_0xd74f('0xd')](_0xd74f('0xe'),_0x3160fa,_0xd74f('0xf'));_0x481463(_0x859eb2['result']['message']);}})[_0xd74f('0x14')](function(_0x4c745e){logger['error'](_0xd74f('0xe'),_0x3160fa,_0x4c745e);_0x13d964(_0x4c745e);});});}exports[_0xd74f('0x15')]=function(_0x26474a){var _0x1dc939=this;return new Promise(function(_0xd739e3,_0xd2b419){return db[_0xd74f('0x16')][_0xd74f('0x17')](_0x26474a[_0xd74f('0x18')],{'raw':_0x26474a[_0xd74f('0x19')]?_0x26474a[_0xd74f('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26474a[_0xd74f('0x19')]?_0x26474a[_0xd74f('0x19')][_0xd74f('0x1a')]||null:null,'attributes':_0x26474a[_0xd74f('0x19')]?_0x26474a['options'][_0xd74f('0x1b')]||null:null,'limit':_0x26474a[_0xd74f('0x19')]?_0x26474a[_0xd74f('0x19')][_0xd74f('0x1c')]||null:null})[_0xd74f('0xc')](function(_0x52faf6){logger['info']('UpdateWhatsappInteraction',_0x26474a);logger[_0xd74f('0x10')]('UpdateWhatsappInteraction',_0x26474a,JSON[_0xd74f('0x11')](_0x52faf6));_0xd739e3(_0x52faf6);})['catch'](function(_0x5acd0d){logger[_0xd74f('0x12')]('UpdateWhatsappInteraction',_0x5acd0d['message'],_0x26474a);_0xd2b419(_0x1dc939['error'](0x1f4,_0x5acd0d[_0xd74f('0x13')]));});});};exports[_0xd74f('0x1d')]=function(_0x5dbfcd){return new Promise(function(_0x48df3f,_0x15f613){return db[_0xd74f('0x16')]['find']({'where':_0x5dbfcd['options']?_0x5dbfcd[_0xd74f('0x19')]['where']||null:null})[_0xd74f('0xc')](function(_0xc9dc85){if(_0xc9dc85){return _0xc9dc85[_0xd74f('0x1e')](_0x5dbfcd[_0xd74f('0x18')]['ids'],_['omit'](_0x5dbfcd[_0xd74f('0x18')],['ids','id'])||{});}})['spread'](function(_0x3726fa){logger[_0xd74f('0xd')]('AddTags',_0x5dbfcd);logger[_0xd74f('0x10')](_0xd74f('0x1f'),_0x5dbfcd,JSON['stringify'](_0x3726fa));_0x48df3f(_0x3726fa);})[_0xd74f('0x14')](function(_0xcd5f66){logger[_0xd74f('0x12')](_0xd74f('0x1f'),_0xcd5f66[_0xd74f('0x13')],_0x5dbfcd);_0x15f613(_this[_0xd74f('0x12')](0x1f4,_0xcd5f66[_0xd74f('0x13')]));});});}; \ No newline at end of file +var _0xcd7c=['omit','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','defaults','redis','socket.io-emitter','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','limit','then','stringify','AddTagsToWhatsappInteraction','addTags','ids'];(function(_0x1e7f3b,_0x52a82a){var _0x40bba0=function(_0x365b23){while(--_0x365b23){_0x1e7f3b['push'](_0x1e7f3b['shift']());}};_0x40bba0(++_0x52a82a);}(_0xcd7c,0x1b3));var _0xccd7=function(_0x2634b7,_0x5ea43a){_0x2634b7=_0x2634b7-0x0;var _0x180976=_0xcd7c[_0x2634b7];return _0x180976;};'use strict';var _=require('lodash');var util=require(_0xccd7('0x0'));var moment=require(_0xccd7('0x1'));var BPromise=require('bluebird');var rs=require(_0xccd7('0x2'));var fs=require('fs');var Redis=require(_0xccd7('0x3'));var db=require(_0xccd7('0x4'))['db'];var utils=require(_0xccd7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xccd7('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xccd7('0x7')]({'port':0x232a});config['redis']=_[_0xccd7('0x8')](config[_0xccd7('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xccd7('0xa'))(new Redis(config[_0xccd7('0x9')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x45fa56,_0x1ee8c0,_0x178d34){return new BPromise(function(_0x49558d,_0x35faa3){return client['request'](_0x45fa56,_0x178d34)['then'](function(_0x77d029){logger[_0xccd7('0xb')](_0xccd7('0xc'),_0x1ee8c0,_0xccd7('0xd'));logger[_0xccd7('0xe')](_0xccd7('0xf'),_0x1ee8c0,'request\x20sent',JSON['stringify'](_0x77d029));if(_0x77d029['error']){if(_0x77d029[_0xccd7('0x10')]['code']===0x1f4){logger[_0xccd7('0x10')](_0xccd7('0xc'),_0x1ee8c0,_0x77d029[_0xccd7('0x10')][_0xccd7('0x11')]);return _0x35faa3(_0x77d029[_0xccd7('0x10')][_0xccd7('0x11')]);}logger[_0xccd7('0x10')](_0xccd7('0xc'),_0x1ee8c0,_0x77d029['error'][_0xccd7('0x11')]);return _0x49558d(_0x77d029[_0xccd7('0x10')][_0xccd7('0x11')]);}else{logger[_0xccd7('0xb')](_0xccd7('0xc'),_0x1ee8c0,_0xccd7('0xd'));_0x49558d(_0x77d029[_0xccd7('0x12')]['message']);}})[_0xccd7('0x13')](function(_0x18b734){logger['error'](_0xccd7('0xc'),_0x1ee8c0,_0x18b734);_0x35faa3(_0x18b734);});});}exports[_0xccd7('0x14')]=function(_0x2c28dc){var _0x52b7f3=this;return new Promise(function(_0x2d19ad,_0x4e2139){return db[_0xccd7('0x15')][_0xccd7('0x16')](_0x2c28dc[_0xccd7('0x17')],{'raw':_0x2c28dc[_0xccd7('0x18')]?_0x2c28dc[_0xccd7('0x18')][_0xccd7('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c28dc[_0xccd7('0x18')]?_0x2c28dc['options'][_0xccd7('0x1a')]||null:null,'attributes':_0x2c28dc[_0xccd7('0x18')]?_0x2c28dc[_0xccd7('0x18')]['attributes']||null:null,'limit':_0x2c28dc[_0xccd7('0x18')]?_0x2c28dc[_0xccd7('0x18')][_0xccd7('0x1b')]||null:null})[_0xccd7('0x1c')](function(_0x3ec333){logger[_0xccd7('0xb')](_0xccd7('0x14'),_0x2c28dc);logger['debug'](_0xccd7('0x14'),_0x2c28dc,JSON[_0xccd7('0x1d')](_0x3ec333));_0x2d19ad(_0x3ec333);})[_0xccd7('0x13')](function(_0x3f8810){logger[_0xccd7('0x10')]('UpdateWhatsappInteraction',_0x3f8810[_0xccd7('0x11')],_0x2c28dc);_0x4e2139(_0x52b7f3[_0xccd7('0x10')](0x1f4,_0x3f8810[_0xccd7('0x11')]));});});};exports[_0xccd7('0x1e')]=function(_0x3dc442){return new Promise(function(_0x2bdc71,_0x2927e7){return db[_0xccd7('0x15')]['find']({'where':_0x3dc442['options']?_0x3dc442[_0xccd7('0x18')][_0xccd7('0x1a')]||null:null})['then'](function(_0x1a55ef){if(_0x1a55ef){return _0x1a55ef[_0xccd7('0x1f')](_0x3dc442[_0xccd7('0x17')][_0xccd7('0x20')],_[_0xccd7('0x21')](_0x3dc442[_0xccd7('0x17')],['ids','id'])||{});}})[_0xccd7('0x22')](function(_0x7218ce){logger['info']('AddTags',_0x3dc442);logger[_0xccd7('0xe')](_0xccd7('0x23'),_0x3dc442,JSON[_0xccd7('0x1d')](_0x7218ce));_0x2bdc71(_0x7218ce);})['catch'](function(_0x50e3af){logger[_0xccd7('0x10')](_0xccd7('0x23'),_0x50e3af[_0xccd7('0x11')],_0x3dc442);_0x2927e7(_this[_0xccd7('0x10')](0x1f4,_0x50e3af[_0xccd7('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 37eaca8..205b1a4 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 _0x74e2=['removeListener','register','length','save','update','emit'];(function(_0x49cc37,_0x42f7d7){var _0x4fda0c=function(_0x27ac11){while(--_0x27ac11){_0x49cc37['push'](_0x49cc37['shift']());}};_0x4fda0c(++_0x42f7d7);}(_0x74e2,0x183));var _0x274e=function(_0x29d7df,_0x188541){_0x29d7df=_0x29d7df-0x0;var _0x5d02fa=_0x74e2[_0x29d7df];return _0x5d02fa;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x274e('0x0'),'remove',_0x274e('0x1')];function createListener(_0x4b5639,_0xe6e55d){return function(_0x4f7abc){_0xe6e55d[_0x274e('0x2')](_0x4b5639,_0x4f7abc);};}function removeListener(_0x1e3601,_0x2b258b){return function(){WhatsappInteractionEvents[_0x274e('0x3')](_0x1e3601,_0x2b258b);};}exports[_0x274e('0x4')]=function(_0x4937e6){for(var _0xbce3db=0x0,_0x2a80a1=events[_0x274e('0x5')];_0xbce3db<_0x2a80a1;_0xbce3db++){var _0x1cff08=events[_0xbce3db];var _0xbf5869=createListener('whatsappInteraction:'+_0x1cff08,_0x4937e6);WhatsappInteractionEvents['on'](_0x1cff08,_0xbf5869);}}; \ No newline at end of file +var _0x37b5=['whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x4b9888,_0x47aed9){var _0x4a96f9=function(_0x1c327d){while(--_0x1c327d){_0x4b9888['push'](_0x4b9888['shift']());}};_0x4a96f9(++_0x47aed9);}(_0x37b5,0x111));var _0x537b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x37b5[_0x20a584];return _0x4b41a8;};'use strict';var WhatsappInteractionEvents=require(_0x537b('0x0'));var events=[_0x537b('0x1'),_0x537b('0x2'),_0x537b('0x3')];function createListener(_0x4d6498,_0xb5c6a4){return function(_0x53094c){_0xb5c6a4[_0x537b('0x4')](_0x4d6498,_0x53094c);};}function removeListener(_0xfd6510,_0x369dcb){return function(){WhatsappInteractionEvents[_0x537b('0x5')](_0xfd6510,_0x369dcb);};}exports[_0x537b('0x6')]=function(_0x436ea1){for(var _0x13ebbd=0x0,_0x223a8b=events['length'];_0x13ebbd<_0x223a8b;_0x13ebbd++){var _0x4fd45a=events[_0x13ebbd];var _0x33cc29=createListener(_0x537b('0x7')+_0x4fd45a,_0x436ea1);WhatsappInteractionEvents['on'](_0x4fd45a,_0x33cc29);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 6246f3c..c8a0b7f 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 _0x8440=['tracked','create','/:id/status','status','update','/:id/accept','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x39758d,_0x346423){var _0x44ac11=function(_0x175008){while(--_0x175008){_0x39758d['push'](_0x39758d['shift']());}};_0x44ac11(++_0x346423);}(_0x8440,0xc0));var _0x0844=function(_0x493bde,_0x1b3654){_0x493bde=_0x493bde-0x0;var _0x508e56=_0x8440[_0x493bde];return _0x508e56;};'use strict';var multer=require(_0x0844('0x0'));var util=require(_0x0844('0x1'));var path=require(_0x0844('0x2'));var timeout=require('connect-timeout');var express=require(_0x0844('0x3'));var router=express[_0x0844('0x4')]();var fs_extra=require(_0x0844('0x5'));var auth=require(_0x0844('0x6'));var interaction=require(_0x0844('0x7'));var config=require('../../config/environment');var controller=require(_0x0844('0x8'));router[_0x0844('0x9')]('/',auth[_0x0844('0xa')](),controller[_0x0844('0xb')]);router[_0x0844('0x9')](_0x0844('0xc'),auth['isAuthenticated'](),controller[_0x0844('0xd')]);router[_0x0844('0x9')](_0x0844('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x0844('0xf')]('/',auth[_0x0844('0xa')](),interaction[_0x0844('0x10')]('whatsapp','whatsappmessage:create'),controller[_0x0844('0x11')]);router[_0x0844('0xf')](_0x0844('0x12'),controller[_0x0844('0x13')]);router['put'](_0x0844('0xe'),auth[_0x0844('0xa')](),controller[_0x0844('0x14')]);router['put'](_0x0844('0x15'),auth[_0x0844('0xa')](),controller['accept']);router[_0x0844('0x16')]('/:id/reject',auth[_0x0844('0xa')](),controller['reject']);router[_0x0844('0x17')](_0x0844('0xe'),auth['isAuthenticated'](),controller[_0x0844('0x18')]);module[_0x0844('0x19')]=router; \ No newline at end of file +var _0x4d31=['post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0xd73c41,_0xbfce22){var _0x254a8c=function(_0x3a39a5){while(--_0x3a39a5){_0xd73c41['push'](_0xd73c41['shift']());}};_0x254a8c(++_0xbfce22);}(_0x4d31,0xf0));var _0x14d3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4d31[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x14d3('0x0'));var util=require(_0x14d3('0x1'));var path=require(_0x14d3('0x2'));var timeout=require(_0x14d3('0x3'));var express=require(_0x14d3('0x4'));var router=express[_0x14d3('0x5')]();var fs_extra=require(_0x14d3('0x6'));var auth=require(_0x14d3('0x7'));var interaction=require(_0x14d3('0x8'));var config=require('../../config/environment');var controller=require(_0x14d3('0x9'));router[_0x14d3('0xa')]('/',auth[_0x14d3('0xb')](),controller[_0x14d3('0xc')]);router[_0x14d3('0xa')](_0x14d3('0xd'),auth[_0x14d3('0xb')](),controller[_0x14d3('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x14d3('0xf')]);router[_0x14d3('0x10')]('/',auth['isAuthenticated'](),interaction[_0x14d3('0x11')](_0x14d3('0x12'),_0x14d3('0x13')),controller[_0x14d3('0x14')]);router['post'](_0x14d3('0x15'),controller[_0x14d3('0x16')]);router[_0x14d3('0x17')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x14d3('0x17')](_0x14d3('0x18'),auth[_0x14d3('0xb')](),controller[_0x14d3('0x19')]);router[_0x14d3('0x17')](_0x14d3('0x1a'),auth['isAuthenticated'](),controller[_0x14d3('0x1b')]);router[_0x14d3('0x1c')](_0x14d3('0x1d'),auth[_0x14d3('0xb')](),controller[_0x14d3('0x1e')]);module[_0x14d3('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index b24e1f6..5ba5887 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 _0x5b65=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize'];(function(_0x3281cd,_0xd0ecac){var _0x25fa56=function(_0x4d19f0){while(--_0x4d19f0){_0x3281cd['push'](_0x3281cd['shift']());}};_0x25fa56(++_0xd0ecac);}(_0x5b65,0x179));var _0x55b6=function(_0x568f01,_0x258dc3){_0x568f01=_0x568f01-0x0;var _0x2f3325=_0x5b65[_0x568f01];return _0x2f3325;};'use strict';var Sequelize=require(_0x55b6('0x0'));module[_0x55b6('0x1')]={'body':{'type':Sequelize[_0x55b6('0x2')](_0x55b6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x55b6('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x55b6('0x5')]('in',_0x55b6('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x55b6('0x7')]},'readAt':{'type':Sequelize[_0x55b6('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x55b6('0x2')]}}; \ No newline at end of file +var _0xca8d=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x57b25a,_0x3b70e5){var _0x8783c1=function(_0x16cb66){while(--_0x16cb66){_0x57b25a['push'](_0x57b25a['shift']());}};_0x8783c1(++_0x3b70e5);}(_0xca8d,0x172));var _0xdca8=function(_0x189a72,_0x4ac342){_0x189a72=_0x189a72-0x0;var _0x2b457a=_0xca8d[_0x189a72];return _0x2b457a;};'use strict';var Sequelize=require(_0xdca8('0x0'));module[_0xdca8('0x1')]={'body':{'type':Sequelize[_0xdca8('0x2')](_0xdca8('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdca8('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdca8('0x5')]('in',_0xdca8('0x6')),'defaultValue':_0xdca8('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xdca8('0x7')](0xbe)},'phone':{'type':Sequelize[_0xdca8('0x7')]},'readAt':{'type':Sequelize[_0xdca8('0x8')]},'secret':{'type':Sequelize[_0xdca8('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdca8('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 9ae37d5..9386500 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 _0xf415=['./whatsappMessage.socket','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','../../config/logger','accept','whatsapp','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','contact','User','motionChannel','WhatsappAccount','WhatsappAccountId','debug','received\x20delivery\x20report\x20from','inspect','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter'];(function(_0x31115e,_0x423cd4){var _0x5ea9bb=function(_0x17427d){while(--_0x17427d){_0x31115e['push'](_0x31115e['shift']());}};_0x5ea9bb(++_0x423cd4);}(_0xf415,0x6e));var _0x5f41=function(_0x2414a4,_0x40295){_0x2414a4=_0x2414a4-0x0;var _0x2520fb=_0xf415[_0x2414a4];return _0x2520fb;};'use strict';var emlformat=require(_0x5f41('0x0'));var rimraf=require(_0x5f41('0x1'));var zipdir=require(_0x5f41('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f41('0x3'));var moment=require('moment');var BPromise=require(_0x5f41('0x4'));var Mustache=require(_0x5f41('0x5'));var util=require(_0x5f41('0x6'));var path=require(_0x5f41('0x7'));var sox=require('sox');var csv=require(_0x5f41('0x8'));var ejs=require(_0x5f41('0x9'));var fs=require('fs');var fs_extra=require(_0x5f41('0xa'));var _=require(_0x5f41('0xb'));var squel=require(_0x5f41('0xc'));var crypto=require(_0x5f41('0xd'));var jsforce=require(_0x5f41('0xe'));var deskjs=require(_0x5f41('0xf'));var toCsv=require(_0x5f41('0x8'));var querystring=require(_0x5f41('0x10'));var Papa=require(_0x5f41('0x11'));var Redis=require(_0x5f41('0x12'));var authService=require(_0x5f41('0x13'));var qs=require(_0x5f41('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f41('0x15'));var logger=require('../../config/logger')(_0x5f41('0x16'));var utils=require(_0x5f41('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5f41('0x18'));var db=require(_0x5f41('0x19'))['db'];config[_0x5f41('0x1a')]=_['defaults'](config['redis'],{'host':_0x5f41('0x1b'),'port':0x18eb});var socket=require(_0x5f41('0x1c'))(new Redis(config[_0x5f41('0x1a')]));require(_0x5f41('0x1d'))['register'](socket);var jayson=require(_0x5f41('0x1e'));var client=jayson[_0x5f41('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x5f41('0x1f')][_0x5f41('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x435f43,_0x4c6014,_0x4546a2,_0x1341c0){return new BPromise(function(_0x34070c,_0x2efa34){var _0x18485c=_0x1341c0||client;return _0x18485c[_0x5f41('0x21')](_0x435f43,_0x4546a2)[_0x5f41('0x22')](function(_0x5ce9d0){logger[_0x5f41('0x23')](_0x5f41('0x24'),_0x4c6014,_0x5f41('0x25'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4c6014,_0x5f41('0x25'),JSON[_0x5f41('0x26')](_0x5ce9d0));if(_0x5ce9d0[_0x5f41('0x27')]){if(_0x5ce9d0[_0x5f41('0x27')][_0x5f41('0x28')]===0x1f4){logger[_0x5f41('0x27')](_0x5f41('0x24'),_0x4c6014,_0x5ce9d0['error'][_0x5f41('0x29')]);return _0x2efa34(_0x5ce9d0['error'][_0x5f41('0x29')]);}logger[_0x5f41('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x4c6014,_0x5ce9d0[_0x5f41('0x27')]['message']);return _0x34070c(_0x5ce9d0[_0x5f41('0x27')][_0x5f41('0x29')]);}else{logger[_0x5f41('0x23')](_0x5f41('0x24'),_0x4c6014,_0x5f41('0x25'));_0x34070c(_0x5ce9d0[_0x5f41('0x2a')][_0x5f41('0x29')]);}})[_0x5f41('0x2b')](function(_0x564a9e){logger[_0x5f41('0x27')](_0x5f41('0x24'),_0x4c6014,_0x564a9e);_0x2efa34(_0x564a9e);});});}function respondWithStatusCode(_0x16fc3b,_0x5716e8){_0x5716e8=_0x5716e8||0xcc;return function(_0x58ec74){if(_0x58ec74){return _0x16fc3b['sendStatus'](_0x5716e8);}return _0x16fc3b[_0x5f41('0x2c')](_0x5716e8)[_0x5f41('0x2d')]();};}function respondWithResult(_0x38bed3,_0x4b481d){_0x4b481d=_0x4b481d||0xc8;return function(_0x33684d){if(_0x33684d){return _0x38bed3[_0x5f41('0x2c')](_0x4b481d)[_0x5f41('0x2e')](_0x33684d);}};}function respondWithFilteredResult(_0x490443,_0x22453f){return function(_0x4c5e56){if(_0x4c5e56){var _0x1cc4b4=typeof _0x22453f[_0x5f41('0x2f')]==='undefined'&&typeof _0x22453f[_0x5f41('0x30')]===_0x5f41('0x31');var _0x35dda4=_0x4c5e56[_0x5f41('0x32')];var _0x242c92=_0x1cc4b4?0x0:_0x22453f[_0x5f41('0x2f')];var _0x23cbb3=_0x1cc4b4?_0x4c5e56[_0x5f41('0x32')]:_0x22453f['offset']+_0x22453f['limit'];var _0x45e8c7;if(_0x23cbb3>=_0x35dda4){_0x23cbb3=_0x35dda4;_0x45e8c7=0xc8;}else{_0x45e8c7=0xce;}_0x490443[_0x5f41('0x2c')](_0x45e8c7);return _0x490443[_0x5f41('0x33')](_0x5f41('0x34'),_0x242c92+'-'+_0x23cbb3+'/'+_0x35dda4)[_0x5f41('0x2e')](_0x4c5e56);}return null;};}function patchUpdates(_0x19713f){return function(_0x5e2f5c){try{jsonpatch[_0x5f41('0x35')](_0x5e2f5c,_0x19713f,!![]);}catch(_0x325cc8){return BPromise[_0x5f41('0x36')](_0x325cc8);}return _0x5e2f5c[_0x5f41('0x37')]();};}function saveUpdates(_0x3667b9,_0x2eb804){return function(_0x9380f9){if(_0x9380f9){return _0x9380f9[_0x5f41('0x38')](_0x3667b9)[_0x5f41('0x22')](function(_0x336051){return _0x336051;});}return null;};}function removeEntity(_0x1250ac,_0x5e3f26){return function(_0x363e6b){if(_0x363e6b){return _0x363e6b[_0x5f41('0x39')]()[_0x5f41('0x22')](function(){_0x1250ac[_0x5f41('0x2c')](0xcc)[_0x5f41('0x2d')]();});}};}function handleEntityNotFound(_0x30a3d4,_0x58cbfe){return function(_0x59b76f){if(!_0x59b76f){_0x30a3d4[_0x5f41('0x3a')](0x194);}return _0x59b76f;};}function handleError(_0x2e3352,_0x523072){_0x523072=_0x523072||0x1f4;return function(_0x1f4f57){logger[_0x5f41('0x27')](_0x1f4f57[_0x5f41('0x3b')]);if(_0x1f4f57[_0x5f41('0x3c')]){delete _0x1f4f57[_0x5f41('0x3c')];}_0x2e3352[_0x5f41('0x2c')](_0x523072)[_0x5f41('0x3d')](_0x1f4f57);};}exports[_0x5f41('0x3e')]=function(_0x31df63,_0x32fca5){var _0xc2b07f={},_0x1bee9b={},_0x3036aa={'count':0x0,'rows':[]};var _0x135ded=_[_0x5f41('0x3f')](db[_0x5f41('0x40')][_0x5f41('0x41')],function(_0x2b4672){return{'name':_0x2b4672[_0x5f41('0x42')],'type':_0x2b4672[_0x5f41('0x43')]['key']};});_0x1bee9b[_0x5f41('0x44')]=_['map'](_0x135ded,_0x5f41('0x3c'));_0x1bee9b[_0x5f41('0x45')]=_[_0x5f41('0x46')](_0x31df63['query']);_0x1bee9b[_0x5f41('0x47')]=_[_0x5f41('0x48')](_0x1bee9b[_0x5f41('0x44')],_0x1bee9b['query']);_0xc2b07f['attributes']=_[_0x5f41('0x48')](_0x1bee9b['model'],qs[_0x5f41('0x49')](_0x31df63[_0x5f41('0x45')][_0x5f41('0x49')]));_0xc2b07f[_0x5f41('0x4a')]=_0xc2b07f['attributes'][_0x5f41('0x4b')]?_0xc2b07f[_0x5f41('0x4a')]:_0x1bee9b[_0x5f41('0x44')];if(!_0x31df63[_0x5f41('0x45')]['hasOwnProperty'](_0x5f41('0x4c'))){_0xc2b07f[_0x5f41('0x30')]=qs['limit'](_0x31df63[_0x5f41('0x45')][_0x5f41('0x30')]);_0xc2b07f['offset']=qs['offset'](_0x31df63[_0x5f41('0x45')]['offset']);}_0xc2b07f[_0x5f41('0x4d')]=qs[_0x5f41('0x4e')](_0x31df63['query'][_0x5f41('0x4e')]);_0xc2b07f[_0x5f41('0x4f')]=qs[_0x5f41('0x47')](_[_0x5f41('0x50')](_0x31df63[_0x5f41('0x45')],_0x1bee9b['filters']),_0x135ded);if(_0x31df63[_0x5f41('0x45')][_0x5f41('0x51')]){_0xc2b07f[_0x5f41('0x4f')]=_[_0x5f41('0x52')](_0xc2b07f[_0x5f41('0x4f')],{'$or':_['map'](_0x135ded,function(_0x4b8394){if(_0x4b8394['type']!=='VIRTUAL'){var _0x555e57={};_0x555e57[_0x4b8394[_0x5f41('0x3c')]]={'$like':'%'+_0x31df63[_0x5f41('0x45')]['filter']+'%'};return _0x555e57;}})});}_0xc2b07f=_[_0x5f41('0x52')]({},_0xc2b07f,_0x31df63[_0x5f41('0x53')]);var _0x3c0a4a={'where':_0xc2b07f[_0x5f41('0x4f')]};return db[_0x5f41('0x40')][_0x5f41('0x32')](_0x3c0a4a)['then'](function(_0x30af20){_0x3036aa[_0x5f41('0x32')]=_0x30af20;if(_0x31df63[_0x5f41('0x45')][_0x5f41('0x54')]){_0xc2b07f[_0x5f41('0x55')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x5f41('0x56')](_0xc2b07f);})['then'](function(_0x9139d9){_0x3036aa[_0x5f41('0x57')]=_0x9139d9;return _0x3036aa;})[_0x5f41('0x22')](respondWithFilteredResult(_0x32fca5,_0xc2b07f))[_0x5f41('0x2b')](handleError(_0x32fca5,null));};exports[_0x5f41('0x58')]=function(_0x5b2e12,_0x38eaab){var _0x8ff53a={'raw':!![],'where':{'id':_0x5b2e12[_0x5f41('0x59')]['id']}},_0x168682={};_0x168682[_0x5f41('0x44')]=_[_0x5f41('0x46')](db[_0x5f41('0x40')][_0x5f41('0x41')]);_0x168682[_0x5f41('0x45')]=_[_0x5f41('0x46')](_0x5b2e12['query']);_0x168682[_0x5f41('0x47')]=_['intersection'](_0x168682['model'],_0x168682[_0x5f41('0x45')]);_0x8ff53a[_0x5f41('0x4a')]=_[_0x5f41('0x48')](_0x168682[_0x5f41('0x44')],qs[_0x5f41('0x49')](_0x5b2e12[_0x5f41('0x45')]['fields']));_0x8ff53a[_0x5f41('0x4a')]=_0x8ff53a[_0x5f41('0x4a')][_0x5f41('0x4b')]?_0x8ff53a['attributes']:_0x168682[_0x5f41('0x44')];if(_0x5b2e12['query']['includeAll']){_0x8ff53a[_0x5f41('0x55')]=[{'all':!![]}];}_0x8ff53a=_[_0x5f41('0x52')]({},_0x8ff53a,_0x5b2e12['options']);return db[_0x5f41('0x40')][_0x5f41('0x5a')](_0x8ff53a)[_0x5f41('0x22')](handleEntityNotFound(_0x38eaab,null))[_0x5f41('0x22')](respondWithResult(_0x38eaab,null))[_0x5f41('0x2b')](handleError(_0x38eaab,null));};exports[_0x5f41('0x5b')]=function(_0x183419,_0x5aa2ee){return db[_0x5f41('0x40')][_0x5f41('0x5b')](_0x183419[_0x5f41('0x5c')],{})[_0x5f41('0x22')](respondWithResult(_0x5aa2ee,0xc9))[_0x5f41('0x2b')](handleError(_0x5aa2ee,null));};exports[_0x5f41('0x38')]=function(_0x4f57ad,_0x387925){if(_0x4f57ad[_0x5f41('0x5c')]['id']){delete _0x4f57ad['body']['id'];}return db[_0x5f41('0x40')][_0x5f41('0x5a')]({'where':{'id':_0x4f57ad[_0x5f41('0x59')]['id']}})['then'](handleEntityNotFound(_0x387925,null))[_0x5f41('0x22')](saveUpdates(_0x4f57ad['body'],null))[_0x5f41('0x22')](respondWithResult(_0x387925,null))[_0x5f41('0x2b')](handleError(_0x387925,null));};exports[_0x5f41('0x39')]=function(_0x20cdaa,_0xc55f98){return db[_0x5f41('0x40')]['find']({'where':{'id':_0x20cdaa[_0x5f41('0x59')]['id']}})[_0x5f41('0x22')](handleEntityNotFound(_0xc55f98,null))[_0x5f41('0x22')](removeEntity(_0xc55f98,null))['catch'](handleError(_0xc55f98,null));};exports['describe']=function(_0x39ce35,_0x402256){return db[_0x5f41('0x40')]['describe']()[_0x5f41('0x22')](respondWithResult(_0x402256,null))[_0x5f41('0x2b')](handleError(_0x402256,null));};var interaction_log=require(_0x5f41('0x5d'))('whatsapp-interactions');exports[_0x5f41('0x5e')]=function(_0x4e1bbd,_0x5ef0e6,_0x2c2cdb){var _0x8c0850={'agent':{},'channel':_0x5f41('0x5f')};if(_0x4e1bbd['body']['id']){delete _0x4e1bbd[_0x5f41('0x5c')]['id'];}_0x4e1bbd['body']['read']=!![];_0x4e1bbd[_0x5f41('0x5c')]['readAt']=moment()[_0x5f41('0x60')](_0x5f41('0x61'));_0x4e1bbd[_0x5f41('0x5c')][_0x5f41('0x62')]=_0x4e1bbd[_0x5f41('0x5c')]['UserId']||_0x4e1bbd[_0x5f41('0x63')]['id'];_0x8c0850[_0x5f41('0x64')]['id']=_0x4e1bbd[_0x5f41('0x5c')][_0x5f41('0x62')];return db[_0x5f41('0x40')][_0x5f41('0x5a')]({'where':{'id':_0x4e1bbd[_0x5f41('0x59')]['id'],'UserId':null}})[_0x5f41('0x22')](handleEntityNotFound(_0x5ef0e6,null))[_0x5f41('0x22')](saveUpdates(_0x4e1bbd[_0x5f41('0x5c')],null))[_0x5f41('0x22')](function(_0x32f956){if(_0x32f956){_0x8c0850['message']=_0x32f956[_0x5f41('0x65')]({'plain':!![]});return db[_0x5f41('0x66')]['find']({'where':{'id':_0x32f956[_0x5f41('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x5ef0e6,null))['then'](function(_0x13f514){if(_0x13f514){return _0x13f514[_0x5f41('0x38')]({'UserId':_0x4e1bbd['body'][_0x5f41('0x62')],'read1stAt':_[_0x5f41('0x68')](_0x13f514['read1stAt'])?moment()[_0x5f41('0x60')](_0x5f41('0x61')):undefined});}return null;})['then'](function(_0x491d0b){if(_0x491d0b){_0x8c0850[_0x5f41('0x69')]=_0x491d0b['get']({'plain':!![]});interaction_log[_0x5f41('0x23')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e1bbd[_0x5f41('0x63')]['id'],_0x4e1bbd[_0x5f41('0x63')][_0x5f41('0x3c')],_0x4e1bbd[_0x5f41('0x63')]['role'],_0x8c0850['interaction']['id'],_0x4e1bbd[_0x5f41('0x5c')]?JSON[_0x5f41('0x26')](_0x4e1bbd[_0x5f41('0x5c')]):_0x5f41('0x6a'));return respondWithRpcPromise(_0x5f41('0x6b'),_0x5f41('0x6c'),_0x8c0850);}return null;})[_0x5f41('0x22')](function(_0x2a733f){var _0x863cc8=_0x5f41('0x6d')+_0x2a733f[_0x5f41('0x29')][_0x5f41('0x6e')];return db['sequelize'][_0x5f41('0x45')](_0x863cc8,{'type':db[_0x5f41('0x6f')][_0x5f41('0x70')][_0x5f41('0x71')],'raw':!![]})['then'](function(_0x3ad7cc){return _0x3ad7cc;});})[_0x5f41('0x22')](function(_0x56755e){if(_0x56755e){_0x8c0850[_0x5f41('0x29')]['contact']=_0x56755e[0x0];if(!_0x4e1bbd[_0x5f41('0x5c')]['UserId'])return;return db['User'][_0x5f41('0x5a')]({'where':{'id':_0x4e1bbd[_0x5f41('0x5c')][_0x5f41('0x62')],'role':_0x5f41('0x64')},'attributes':['id',_0x5f41('0x3c'),_0x5f41('0x72'),_0x5f41('0x73'),_0x5f41('0x74')],'raw':!![]});}return null;})[_0x5f41('0x22')](function(_0x4adda3){if(!_0x4adda3)return null;_0x8c0850[_0x5f41('0x29')][_0x5f41('0x64')]=_0x4adda3;return _0x8c0850;})[_0x5f41('0x22')](function(_0x2671bd){if(_0x2671bd){if(_0x4e1bbd[_0x5f41('0x5c')][_0x5f41('0x75')]){_0x8c0850[_0x5f41('0x29')][_0x5f41('0x76')]=util[_0x5f41('0x60')](_0x5f41('0x77'),_0x4e1bbd[_0x5f41('0x63')]['name']);_0x8c0850[_0x5f41('0x29')][_0x5f41('0x78')]=_0x8c0850[_0x5f41('0x78')];_0x8c0850[_0x5f41('0x29')]['motionChannel']=_0x8c0850['channel'];_0x8c0850['message'][_0x5f41('0x79')]=_0x5f41('0x5e');return respondWithRpcPromise(_0x5f41('0x7a'),_0x5f41('0x7a'),{'event':_0x5f41('0x7b'),'message':_0x8c0850[_0x5f41('0x29')]},client9002)[_0x5f41('0x22')](function(){return _0x8c0850;});}return _0x8c0850;}return null;})[_0x5f41('0x22')](respondWithResult(_0x5ef0e6,null))['catch'](handleError(_0x5ef0e6,null));};var interaction_log=require(_0x5f41('0x5d'))('whatsapp-interactions');exports[_0x5f41('0x36')]=function(_0x2ad5c4,_0xf8a6fa,_0x39866b){var _0x4ca3b3={'agent':{},'channel':_0x5f41('0x5f')};if(_0x2ad5c4[_0x5f41('0x5c')]['id']){delete _0x2ad5c4[_0x5f41('0x5c')]['id'];}_0x2ad5c4[_0x5f41('0x5c')][_0x5f41('0x62')]=_0x2ad5c4[_0x5f41('0x5c')][_0x5f41('0x62')]||_0x2ad5c4['user']['id'];_0x4ca3b3[_0x5f41('0x64')]['id']=_0x2ad5c4['body'][_0x5f41('0x62')];return db[_0x5f41('0x40')][_0x5f41('0x5a')]({'where':{'id':_0x2ad5c4[_0x5f41('0x59')]['id'],'UserId':null}})[_0x5f41('0x22')](handleEntityNotFound(_0xf8a6fa,null))[_0x5f41('0x22')](function(_0x4ec25f){if(_0x4ec25f){_0x4ca3b3[_0x5f41('0x29')]=_0x4ec25f[_0x5f41('0x65')]({'plain':!![]});return db[_0x5f41('0x66')][_0x5f41('0x5a')]({'where':{'id':_0x4ec25f[_0x5f41('0x67')]}});}return null;})[_0x5f41('0x22')](handleEntityNotFound(_0xf8a6fa,null))[_0x5f41('0x22')](function(_0x196080){if(_0x196080){_0x4ca3b3['interaction']=_0x196080[_0x5f41('0x65')]({'plain':!![]});interaction_log[_0x5f41('0x23')](_0x5f41('0x7c'),_0x2ad5c4[_0x5f41('0x63')]['id'],_0x2ad5c4['user'][_0x5f41('0x3c')],_0x2ad5c4[_0x5f41('0x63')]['role'],_0x4ca3b3['interaction']['id'],_0x2ad5c4[_0x5f41('0x5c')]?JSON[_0x5f41('0x26')](_0x2ad5c4['body']):'null');return respondWithRpcPromise(_0x5f41('0x7d'),'rejectMessage',_0x4ca3b3);}return null;})[_0x5f41('0x22')](function(_0x20f7b1){var _0x16145f=_0x5f41('0x6d')+_0x20f7b1[_0x5f41('0x29')][_0x5f41('0x6e')];return db[_0x5f41('0x7e')][_0x5f41('0x45')](_0x16145f,{'type':db[_0x5f41('0x6f')]['QueryTypes'][_0x5f41('0x71')],'raw':!![]})['then'](function(_0x2860c5){return _0x2860c5;});})['then'](function(_0xd66e87){if(_0xd66e87){_0x4ca3b3[_0x5f41('0x29')][_0x5f41('0x7f')]=_0xd66e87[0x0];if(!_0x2ad5c4['body'][_0x5f41('0x62')])return;return db[_0x5f41('0x80')]['find']({'where':{'id':_0x2ad5c4[_0x5f41('0x5c')][_0x5f41('0x62')],'role':_0x5f41('0x64')},'attributes':['id',_0x5f41('0x3c'),_0x5f41('0x72'),_0x5f41('0x73'),'internal'],'raw':!![]});}return null;})[_0x5f41('0x22')](function(_0x4ad6cf){if(!_0x4ad6cf)return null;_0x4ca3b3['message'][_0x5f41('0x64')]=_0x4ad6cf;return _0x4ca3b3;})[_0x5f41('0x22')](function(_0x4aebb0){if(_0x4aebb0){_0x4aebb0[_0x5f41('0x29')][_0x5f41('0x76')]=util['format']('SIP/%s',_0x2ad5c4['user']['name']);_0x4aebb0[_0x5f41('0x29')][_0x5f41('0x78')]=_0x4ca3b3[_0x5f41('0x78')];_0x4aebb0[_0x5f41('0x29')][_0x5f41('0x81')]=_0x4ca3b3[_0x5f41('0x78')];_0x4aebb0[_0x5f41('0x29')]['event']=_0x5f41('0x36');respondWithRpcPromise(_0x5f41('0x7a'),_0x5f41('0x7a'),{'event':'rejectmessage','message':_0x4aebb0[_0x5f41('0x29')]},client9002);return _0x4ca3b3;}return null;})[_0x5f41('0x22')](respondWithResult(_0xf8a6fa,null))['catch'](handleError(_0xf8a6fa,null));};exports[_0x5f41('0x2c')]=function(_0x21c86a,_0x6a7c80,_0x182284){if(_0x21c86a['body']['id']){delete _0x21c86a[_0x5f41('0x5c')]['id'];}var _0x298ca4;return db[_0x5f41('0x40')][_0x5f41('0x5a')]({'where':{'id':_0x21c86a['params']['id']}})[_0x5f41('0x22')](handleEntityNotFound(_0x6a7c80,null))['then'](function(_0x301996){if(_0x301996){_0x298ca4=_0x301996;return db[_0x5f41('0x82')][_0x5f41('0x5a')]({'where':{'id':_0x301996[_0x5f41('0x83')]}});}})[_0x5f41('0x22')](handleEntityNotFound(_0x6a7c80,null))['then'](function(_0x4ea2c0){if(_0x4ea2c0){logger[_0x5f41('0x84')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x5f41('0x2c'),_0x5f41('0x85'),_0x4ea2c0['type'],util[_0x5f41('0x86')](_0x21c86a[_0x5f41('0x5c')],{'showHidden':![],'depth':null}));switch(_0x4ea2c0['type']){case'twilio':if(_0x21c86a[_0x5f41('0x5c')][_0x5f41('0x87')]&&_0x21c86a[_0x5f41('0x5c')][_0x5f41('0x87')]===_0x298ca4['messageId']&&_0x21c86a[_0x5f41('0x5c')][_0x5f41('0x88')]&&_0x21c86a['body'][_0x5f41('0x88')]==='read'){return _0x298ca4[_0x5f41('0x38')]({'read':!![]});}else{logger['error'](_0x5f41('0x89'),'status',_0x5f41('0x8a'),util[_0x5f41('0x86')](_0x21c86a['body'],{'showHidden':![],'depth':null}));}break;}return _0x298ca4;}})['then'](respondWithResult(_0x6a7c80,null))[_0x5f41('0x2b')](handleError(_0x6a7c80,null));}; \ No newline at end of file +var _0xd86b=['contact','User','fullname','email','internal','manual','interface','channel','event','accept','EventManager','acceptmessage','whatsapp-interactions','reject','get','RejectMessage','rejectMessage','ContactId','QueryTypes','SELECT','SIP/%s','motionChannel','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','jayson/promise','http','client','info','WhatsappMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','save','then','stack','name','WhatsappMessage','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','findAll','rows','catch','show','params','keys','length','includeAll','options','find','create','body','update','destroy','describe','whatsapp','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','read1stAt','format','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize'];(function(_0x187278,_0x108703){var _0x1e10bb=function(_0x4f4526){while(--_0x4f4526){_0x187278['push'](_0x187278['shift']());}};_0x1e10bb(++_0x108703);}(_0xd86b,0x1be));var _0xbd86=function(_0xcdac34,_0x43f665){_0xcdac34=_0xcdac34-0x0;var _0x269d23=_0xd86b[_0xcdac34];return _0x269d23;};'use strict';var emlformat=require(_0xbd86('0x0'));var rimraf=require(_0xbd86('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd86('0x2'));var rp=require('request-promise');var moment=require(_0xbd86('0x3'));var BPromise=require(_0xbd86('0x4'));var Mustache=require(_0xbd86('0x5'));var util=require(_0xbd86('0x6'));var path=require(_0xbd86('0x7'));var sox=require(_0xbd86('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd86('0x9'));var _=require('lodash');var squel=require(_0xbd86('0xa'));var crypto=require(_0xbd86('0xb'));var jsforce=require(_0xbd86('0xc'));var deskjs=require(_0xbd86('0xd'));var toCsv=require(_0xbd86('0xe'));var querystring=require(_0xbd86('0xf'));var Papa=require(_0xbd86('0x10'));var Redis=require(_0xbd86('0x11'));var authService=require(_0xbd86('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd86('0x13'))(_0xbd86('0x14'));var utils=require(_0xbd86('0x15'));var config=require(_0xbd86('0x16'));var licenseUtil=require(_0xbd86('0x17'));var db=require('../../mysqldb')['db'];config[_0xbd86('0x18')]=_[_0xbd86('0x19')](config[_0xbd86('0x18')],{'host':_0xbd86('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);var jayson=require(_0xbd86('0x1b'));var client=jayson['client'][_0xbd86('0x1c')]({'port':0x232c});var client9002=jayson[_0xbd86('0x1d')][_0xbd86('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1d44e2,_0x2afe03,_0x273815,_0x224489){return new BPromise(function(_0x25ce06,_0x3b76e0){var _0x5dbc6e=_0x224489||client;return _0x5dbc6e['request'](_0x1d44e2,_0x273815)['then'](function(_0x59dac7){logger[_0xbd86('0x1e')](_0xbd86('0x1f'),_0x2afe03,'request\x20sent');logger[_0xbd86('0x20')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2afe03,'request\x20sent',JSON[_0xbd86('0x21')](_0x59dac7));if(_0x59dac7[_0xbd86('0x22')]){if(_0x59dac7[_0xbd86('0x22')][_0xbd86('0x23')]===0x1f4){logger[_0xbd86('0x22')](_0xbd86('0x1f'),_0x2afe03,_0x59dac7['error'][_0xbd86('0x24')]);return _0x3b76e0(_0x59dac7['error'][_0xbd86('0x24')]);}logger[_0xbd86('0x22')](_0xbd86('0x1f'),_0x2afe03,_0x59dac7[_0xbd86('0x22')][_0xbd86('0x24')]);return _0x25ce06(_0x59dac7[_0xbd86('0x22')][_0xbd86('0x24')]);}else{logger['info'](_0xbd86('0x1f'),_0x2afe03,_0xbd86('0x25'));_0x25ce06(_0x59dac7['result']['message']);}})['catch'](function(_0x30ddba){logger[_0xbd86('0x22')](_0xbd86('0x1f'),_0x2afe03,_0x30ddba);_0x3b76e0(_0x30ddba);});});}function respondWithStatusCode(_0x2b6602,_0x5e06ea){_0x5e06ea=_0x5e06ea||0xcc;return function(_0x28a824){if(_0x28a824){return _0x2b6602[_0xbd86('0x26')](_0x5e06ea);}return _0x2b6602[_0xbd86('0x27')](_0x5e06ea)[_0xbd86('0x28')]();};}function respondWithResult(_0x4e128f,_0xbbd78b){_0xbbd78b=_0xbbd78b||0xc8;return function(_0x50fac0){if(_0x50fac0){return _0x4e128f['status'](_0xbbd78b)['json'](_0x50fac0);}};}function respondWithFilteredResult(_0x3c98c9,_0x5c740a){return function(_0x384f61){if(_0x384f61){var _0x3396b0=typeof _0x5c740a[_0xbd86('0x29')]==='undefined'&&typeof _0x5c740a[_0xbd86('0x2a')]===_0xbd86('0x2b');var _0x4facab=_0x384f61[_0xbd86('0x2c')];var _0x1e22f2=_0x3396b0?0x0:_0x5c740a[_0xbd86('0x29')];var _0x150350=_0x3396b0?_0x384f61[_0xbd86('0x2c')]:_0x5c740a[_0xbd86('0x29')]+_0x5c740a[_0xbd86('0x2a')];var _0x454fc1;if(_0x150350>=_0x4facab){_0x150350=_0x4facab;_0x454fc1=0xc8;}else{_0x454fc1=0xce;}_0x3c98c9['status'](_0x454fc1);return _0x3c98c9['set'](_0xbd86('0x2d'),_0x1e22f2+'-'+_0x150350+'/'+_0x4facab)[_0xbd86('0x2e')](_0x384f61);}return null;};}function patchUpdates(_0x18188c){return function(_0x103fa7){try{jsonpatch[_0xbd86('0x2f')](_0x103fa7,_0x18188c,!![]);}catch(_0x43fc9a){return BPromise['reject'](_0x43fc9a);}return _0x103fa7[_0xbd86('0x30')]();};}function saveUpdates(_0x3dc521,_0x4d80cd){return function(_0x462875){if(_0x462875){return _0x462875['update'](_0x3dc521)[_0xbd86('0x31')](function(_0x2145cc){return _0x2145cc;});}return null;};}function removeEntity(_0x2d4b0b,_0x203f7f){return function(_0x19a996){if(_0x19a996){return _0x19a996['destroy']()[_0xbd86('0x31')](function(){_0x2d4b0b[_0xbd86('0x27')](0xcc)[_0xbd86('0x28')]();});}};}function handleEntityNotFound(_0x30b0c7,_0x2769a0){return function(_0x4df774){if(!_0x4df774){_0x30b0c7[_0xbd86('0x26')](0x194);}return _0x4df774;};}function handleError(_0x4e249c,_0x1c573e){_0x1c573e=_0x1c573e||0x1f4;return function(_0x18a8f4){logger['error'](_0x18a8f4[_0xbd86('0x32')]);if(_0x18a8f4[_0xbd86('0x33')]){delete _0x18a8f4[_0xbd86('0x33')];}_0x4e249c['status'](_0x1c573e)['send'](_0x18a8f4);};}exports['index']=function(_0x529a5a,_0xdaaf67){var _0x5c4854={},_0x36f4a2={},_0x3d9b08={'count':0x0,'rows':[]};var _0x270b83=_['map'](db[_0xbd86('0x34')][_0xbd86('0x35')],function(_0x2a3788){return{'name':_0x2a3788['fieldName'],'type':_0x2a3788[_0xbd86('0x36')][_0xbd86('0x37')]};});_0x36f4a2[_0xbd86('0x38')]=_['map'](_0x270b83,'name');_0x36f4a2['query']=_['keys'](_0x529a5a[_0xbd86('0x39')]);_0x36f4a2[_0xbd86('0x3a')]=_[_0xbd86('0x3b')](_0x36f4a2[_0xbd86('0x38')],_0x36f4a2[_0xbd86('0x39')]);_0x5c4854[_0xbd86('0x3c')]=_[_0xbd86('0x3b')](_0x36f4a2[_0xbd86('0x38')],qs[_0xbd86('0x3d')](_0x529a5a[_0xbd86('0x39')][_0xbd86('0x3d')]));_0x5c4854['attributes']=_0x5c4854[_0xbd86('0x3c')]['length']?_0x5c4854[_0xbd86('0x3c')]:_0x36f4a2['model'];if(!_0x529a5a[_0xbd86('0x39')][_0xbd86('0x3e')](_0xbd86('0x3f'))){_0x5c4854[_0xbd86('0x2a')]=qs['limit'](_0x529a5a[_0xbd86('0x39')]['limit']);_0x5c4854[_0xbd86('0x29')]=qs[_0xbd86('0x29')](_0x529a5a[_0xbd86('0x39')][_0xbd86('0x29')]);}_0x5c4854[_0xbd86('0x40')]=qs['sort'](_0x529a5a['query'][_0xbd86('0x41')]);_0x5c4854[_0xbd86('0x42')]=qs[_0xbd86('0x3a')](_[_0xbd86('0x43')](_0x529a5a['query'],_0x36f4a2[_0xbd86('0x3a')]),_0x270b83);if(_0x529a5a[_0xbd86('0x39')][_0xbd86('0x44')]){_0x5c4854[_0xbd86('0x42')]=_[_0xbd86('0x45')](_0x5c4854['where'],{'$or':_[_0xbd86('0x46')](_0x270b83,function(_0x53635a){if(_0x53635a[_0xbd86('0x36')]!==_0xbd86('0x47')){var _0x351f88={};_0x351f88[_0x53635a[_0xbd86('0x33')]]={'$like':'%'+_0x529a5a[_0xbd86('0x39')][_0xbd86('0x44')]+'%'};return _0x351f88;}})});}_0x5c4854=_[_0xbd86('0x45')]({},_0x5c4854,_0x529a5a['options']);var _0x58f7a8={'where':_0x5c4854[_0xbd86('0x42')]};return db['WhatsappMessage']['count'](_0x58f7a8)['then'](function(_0xdb28c1){_0x3d9b08[_0xbd86('0x2c')]=_0xdb28c1;if(_0x529a5a[_0xbd86('0x39')]['includeAll']){_0x5c4854[_0xbd86('0x48')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xbd86('0x49')](_0x5c4854);})[_0xbd86('0x31')](function(_0xd5c157){_0x3d9b08[_0xbd86('0x4a')]=_0xd5c157;return _0x3d9b08;})['then'](respondWithFilteredResult(_0xdaaf67,_0x5c4854))[_0xbd86('0x4b')](handleError(_0xdaaf67,null));};exports[_0xbd86('0x4c')]=function(_0xbda2aa,_0x54cff3){var _0x2dc362={'raw':!![],'where':{'id':_0xbda2aa[_0xbd86('0x4d')]['id']}},_0x2beb76={};_0x2beb76[_0xbd86('0x38')]=_[_0xbd86('0x4e')](db[_0xbd86('0x34')]['rawAttributes']);_0x2beb76[_0xbd86('0x39')]=_[_0xbd86('0x4e')](_0xbda2aa[_0xbd86('0x39')]);_0x2beb76['filters']=_[_0xbd86('0x3b')](_0x2beb76[_0xbd86('0x38')],_0x2beb76[_0xbd86('0x39')]);_0x2dc362[_0xbd86('0x3c')]=_[_0xbd86('0x3b')](_0x2beb76[_0xbd86('0x38')],qs[_0xbd86('0x3d')](_0xbda2aa[_0xbd86('0x39')]['fields']));_0x2dc362[_0xbd86('0x3c')]=_0x2dc362[_0xbd86('0x3c')][_0xbd86('0x4f')]?_0x2dc362[_0xbd86('0x3c')]:_0x2beb76['model'];if(_0xbda2aa[_0xbd86('0x39')][_0xbd86('0x50')]){_0x2dc362[_0xbd86('0x48')]=[{'all':!![]}];}_0x2dc362=_[_0xbd86('0x45')]({},_0x2dc362,_0xbda2aa[_0xbd86('0x51')]);return db[_0xbd86('0x34')][_0xbd86('0x52')](_0x2dc362)[_0xbd86('0x31')](handleEntityNotFound(_0x54cff3,null))[_0xbd86('0x31')](respondWithResult(_0x54cff3,null))[_0xbd86('0x4b')](handleError(_0x54cff3,null));};exports[_0xbd86('0x53')]=function(_0x23979d,_0x222fd9){return db[_0xbd86('0x34')]['create'](_0x23979d[_0xbd86('0x54')],{})[_0xbd86('0x31')](respondWithResult(_0x222fd9,0xc9))['catch'](handleError(_0x222fd9,null));};exports[_0xbd86('0x55')]=function(_0x75920f,_0xc0b7d0){if(_0x75920f[_0xbd86('0x54')]['id']){delete _0x75920f[_0xbd86('0x54')]['id'];}return db[_0xbd86('0x34')][_0xbd86('0x52')]({'where':{'id':_0x75920f[_0xbd86('0x4d')]['id']}})[_0xbd86('0x31')](handleEntityNotFound(_0xc0b7d0,null))['then'](saveUpdates(_0x75920f[_0xbd86('0x54')],null))[_0xbd86('0x31')](respondWithResult(_0xc0b7d0,null))[_0xbd86('0x4b')](handleError(_0xc0b7d0,null));};exports[_0xbd86('0x56')]=function(_0x4dc6c2,_0x151670){return db[_0xbd86('0x34')]['find']({'where':{'id':_0x4dc6c2[_0xbd86('0x4d')]['id']}})[_0xbd86('0x31')](handleEntityNotFound(_0x151670,null))[_0xbd86('0x31')](removeEntity(_0x151670,null))[_0xbd86('0x4b')](handleError(_0x151670,null));};exports[_0xbd86('0x57')]=function(_0x1dfa36,_0x34dac8){return db[_0xbd86('0x34')][_0xbd86('0x57')]()['then'](respondWithResult(_0x34dac8,null))[_0xbd86('0x4b')](handleError(_0x34dac8,null));};var interaction_log=require(_0xbd86('0x13'))('whatsapp-interactions');exports['accept']=function(_0x214b34,_0x4af1d9,_0xc2aaaf){var _0x3a2d30={'agent':{},'channel':_0xbd86('0x58')};if(_0x214b34[_0xbd86('0x54')]['id']){delete _0x214b34[_0xbd86('0x54')]['id'];}_0x214b34['body']['read']=!![];_0x214b34[_0xbd86('0x54')]['readAt']=moment()['format'](_0xbd86('0x59'));_0x214b34['body'][_0xbd86('0x5a')]=_0x214b34[_0xbd86('0x54')][_0xbd86('0x5a')]||_0x214b34[_0xbd86('0x5b')]['id'];_0x3a2d30[_0xbd86('0x5c')]['id']=_0x214b34[_0xbd86('0x54')][_0xbd86('0x5a')];return db[_0xbd86('0x34')]['find']({'where':{'id':_0x214b34['params']['id'],'UserId':null}})[_0xbd86('0x31')](handleEntityNotFound(_0x4af1d9,null))[_0xbd86('0x31')](saveUpdates(_0x214b34[_0xbd86('0x54')],null))[_0xbd86('0x31')](function(_0x26f63a){if(_0x26f63a){_0x3a2d30[_0xbd86('0x24')]=_0x26f63a['get']({'plain':!![]});return db[_0xbd86('0x5d')][_0xbd86('0x52')]({'where':{'id':_0x26f63a[_0xbd86('0x5e')]}});}return null;})[_0xbd86('0x31')](handleEntityNotFound(_0x4af1d9,null))[_0xbd86('0x31')](function(_0x30b5a1){if(_0x30b5a1){return _0x30b5a1[_0xbd86('0x55')]({'UserId':_0x214b34[_0xbd86('0x54')][_0xbd86('0x5a')],'read1stAt':_['isNil'](_0x30b5a1[_0xbd86('0x5f')])?moment()[_0xbd86('0x60')](_0xbd86('0x59')):undefined});}return null;})[_0xbd86('0x31')](function(_0x51f1b8){if(_0x51f1b8){_0x3a2d30['interaction']=_0x51f1b8['get']({'plain':!![]});interaction_log[_0xbd86('0x1e')](_0xbd86('0x61'),_0x214b34[_0xbd86('0x5b')]['id'],_0x214b34[_0xbd86('0x5b')][_0xbd86('0x33')],_0x214b34[_0xbd86('0x5b')][_0xbd86('0x62')],_0x3a2d30[_0xbd86('0x63')]['id'],_0x214b34[_0xbd86('0x54')]?JSON[_0xbd86('0x21')](_0x214b34[_0xbd86('0x54')]):_0xbd86('0x64'));return respondWithRpcPromise(_0xbd86('0x65'),_0xbd86('0x66'),_0x3a2d30);}return null;})[_0xbd86('0x31')](function(_0x5266ad){var _0x3b4028=_0xbd86('0x67')+_0x5266ad['message']['ContactId'];return db[_0xbd86('0x68')][_0xbd86('0x39')](_0x3b4028,{'type':db[_0xbd86('0x69')]['QueryTypes']['SELECT'],'raw':!![]})[_0xbd86('0x31')](function(_0x42e3b2){return _0x42e3b2;});})[_0xbd86('0x31')](function(_0x4952b5){if(_0x4952b5){_0x3a2d30[_0xbd86('0x24')][_0xbd86('0x6a')]=_0x4952b5[0x0];if(!_0x214b34[_0xbd86('0x54')][_0xbd86('0x5a')])return;return db[_0xbd86('0x6b')][_0xbd86('0x52')]({'where':{'id':_0x214b34[_0xbd86('0x54')][_0xbd86('0x5a')],'role':_0xbd86('0x5c')},'attributes':['id',_0xbd86('0x33'),_0xbd86('0x6c'),_0xbd86('0x6d'),_0xbd86('0x6e')],'raw':!![]});}return null;})['then'](function(_0x426004){if(!_0x426004)return null;_0x3a2d30[_0xbd86('0x24')][_0xbd86('0x5c')]=_0x426004;return _0x3a2d30;})[_0xbd86('0x31')](function(_0x280bd6){if(_0x280bd6){if(_0x214b34['body'][_0xbd86('0x6f')]){_0x3a2d30['message'][_0xbd86('0x70')]=util[_0xbd86('0x60')]('SIP/%s',_0x214b34[_0xbd86('0x5b')]['name']);_0x3a2d30[_0xbd86('0x24')][_0xbd86('0x71')]=_0x3a2d30[_0xbd86('0x71')];_0x3a2d30[_0xbd86('0x24')]['motionChannel']=_0x3a2d30[_0xbd86('0x71')];_0x3a2d30['message'][_0xbd86('0x72')]=_0xbd86('0x73');return respondWithRpcPromise('EventManager',_0xbd86('0x74'),{'event':_0xbd86('0x75'),'message':_0x3a2d30[_0xbd86('0x24')]},client9002)[_0xbd86('0x31')](function(){return _0x3a2d30;});}return _0x3a2d30;}return null;})[_0xbd86('0x31')](respondWithResult(_0x4af1d9,null))[_0xbd86('0x4b')](handleError(_0x4af1d9,null));};var interaction_log=require(_0xbd86('0x13'))(_0xbd86('0x76'));exports[_0xbd86('0x77')]=function(_0xfd1d67,_0x233fe2,_0x77bb4d){var _0x3b5637={'agent':{},'channel':_0xbd86('0x58')};if(_0xfd1d67[_0xbd86('0x54')]['id']){delete _0xfd1d67[_0xbd86('0x54')]['id'];}_0xfd1d67['body'][_0xbd86('0x5a')]=_0xfd1d67[_0xbd86('0x54')][_0xbd86('0x5a')]||_0xfd1d67[_0xbd86('0x5b')]['id'];_0x3b5637['agent']['id']=_0xfd1d67['body'][_0xbd86('0x5a')];return db['WhatsappMessage'][_0xbd86('0x52')]({'where':{'id':_0xfd1d67[_0xbd86('0x4d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x233fe2,null))[_0xbd86('0x31')](function(_0x3d0822){if(_0x3d0822){_0x3b5637['message']=_0x3d0822[_0xbd86('0x78')]({'plain':!![]});return db[_0xbd86('0x5d')]['find']({'where':{'id':_0x3d0822[_0xbd86('0x5e')]}});}return null;})[_0xbd86('0x31')](handleEntityNotFound(_0x233fe2,null))['then'](function(_0x33e04a){if(_0x33e04a){_0x3b5637['interaction']=_0x33e04a[_0xbd86('0x78')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xfd1d67['user']['id'],_0xfd1d67[_0xbd86('0x5b')][_0xbd86('0x33')],_0xfd1d67['user'][_0xbd86('0x62')],_0x3b5637['interaction']['id'],_0xfd1d67[_0xbd86('0x54')]?JSON[_0xbd86('0x21')](_0xfd1d67['body']):'null');return respondWithRpcPromise(_0xbd86('0x79'),_0xbd86('0x7a'),_0x3b5637);}return null;})[_0xbd86('0x31')](function(_0x75b618){var _0x77efd8=_0xbd86('0x67')+_0x75b618[_0xbd86('0x24')][_0xbd86('0x7b')];return db[_0xbd86('0x68')][_0xbd86('0x39')](_0x77efd8,{'type':db[_0xbd86('0x69')][_0xbd86('0x7c')][_0xbd86('0x7d')],'raw':!![]})['then'](function(_0x4eeda1){return _0x4eeda1;});})[_0xbd86('0x31')](function(_0x4cd92e){if(_0x4cd92e){_0x3b5637[_0xbd86('0x24')][_0xbd86('0x6a')]=_0x4cd92e[0x0];if(!_0xfd1d67[_0xbd86('0x54')][_0xbd86('0x5a')])return;return db['User'][_0xbd86('0x52')]({'where':{'id':_0xfd1d67[_0xbd86('0x54')]['UserId'],'role':_0xbd86('0x5c')},'attributes':['id',_0xbd86('0x33'),_0xbd86('0x6c'),_0xbd86('0x6d'),_0xbd86('0x6e')],'raw':!![]});}return null;})[_0xbd86('0x31')](function(_0x4bb2b5){if(!_0x4bb2b5)return null;_0x3b5637['message'][_0xbd86('0x5c')]=_0x4bb2b5;return _0x3b5637;})['then'](function(_0x4a87ec){if(_0x4a87ec){_0x4a87ec[_0xbd86('0x24')][_0xbd86('0x70')]=util[_0xbd86('0x60')](_0xbd86('0x7e'),_0xfd1d67[_0xbd86('0x5b')][_0xbd86('0x33')]);_0x4a87ec['message'][_0xbd86('0x71')]=_0x3b5637[_0xbd86('0x71')];_0x4a87ec['message'][_0xbd86('0x7f')]=_0x3b5637['channel'];_0x4a87ec[_0xbd86('0x24')][_0xbd86('0x72')]=_0xbd86('0x77');respondWithRpcPromise(_0xbd86('0x74'),_0xbd86('0x74'),{'event':'rejectmessage','message':_0x4a87ec[_0xbd86('0x24')]},client9002);return _0x3b5637;}return null;})[_0xbd86('0x31')](respondWithResult(_0x233fe2,null))[_0xbd86('0x4b')](handleError(_0x233fe2,null));};exports[_0xbd86('0x27')]=function(_0x419054,_0x17ad05,_0x33b242){if(_0x419054['body']['id']){delete _0x419054[_0xbd86('0x54')]['id'];}var _0xaeec28;return db[_0xbd86('0x34')]['find']({'where':{'id':_0x419054['params']['id']}})['then'](handleEntityNotFound(_0x17ad05,null))[_0xbd86('0x31')](function(_0x5c3bea){if(_0x5c3bea){_0xaeec28=_0x5c3bea;return db[_0xbd86('0x80')][_0xbd86('0x52')]({'where':{'id':_0x5c3bea[_0xbd86('0x81')]}});}})[_0xbd86('0x31')](handleEntityNotFound(_0x17ad05,null))[_0xbd86('0x31')](function(_0x4ba636){if(_0x4ba636){logger[_0xbd86('0x20')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xbd86('0x27'),_0xbd86('0x82'),_0x4ba636[_0xbd86('0x36')],util[_0xbd86('0x83')](_0x419054[_0xbd86('0x54')],{'showHidden':![],'depth':null}));switch(_0x4ba636[_0xbd86('0x36')]){case _0xbd86('0x84'):if(_0x419054[_0xbd86('0x54')][_0xbd86('0x85')]&&_0x419054[_0xbd86('0x54')][_0xbd86('0x85')]===_0xaeec28[_0xbd86('0x86')]&&_0x419054['body'][_0xbd86('0x87')]&&_0x419054[_0xbd86('0x54')]['MessageStatus']===_0xbd86('0x88')){return _0xaeec28[_0xbd86('0x55')]({'read':!![]});}else{logger[_0xbd86('0x22')](_0xbd86('0x89'),_0xbd86('0x27'),_0xbd86('0x84'),util['inspect'](_0x419054[_0xbd86('0x54')],{'showHidden':![],'depth':null}));}break;}return _0xaeec28;}})[_0xbd86('0x31')](respondWithResult(_0x17ad05,null))['catch'](handleError(_0x17ad05,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index ad94626..bb8baef 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 _0x36ee=['WhatsappMessage','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36ee,0xe8));var _0xe36e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36ee[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0xe36e('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe36e('0x1'),'afterUpdate':_0xe36e('0x2'),'afterDestroy':_0xe36e('0x3')};function emitEvent(_0xe3bee0){return function(_0x567a84,_0x1118af,_0x29e692){WhatsappMessageEvents[_0xe36e('0x4')](_0xe3bee0+':'+_0x567a84['id'],_0x567a84);WhatsappMessageEvents[_0xe36e('0x4')](_0xe3bee0,_0x567a84);_0x29e692(null);};}for(var e in events){if(events[_0xe36e('0x5')](e)){var event=events[e];WhatsappMessage[_0xe36e('0x6')](e,emitEvent(event));}}module[_0xe36e('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x8caf=['remove','emit','hasOwnProperty','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x95b616,_0x296372){_0x95b616=_0x95b616-0x0;var _0x596532=_0x8caf[_0x95b616];return _0x596532;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xf8ca('0x0'))['db'][_0xf8ca('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf8ca('0x2')](0x0);var events={'afterCreate':_0xf8ca('0x3'),'afterUpdate':_0xf8ca('0x4'),'afterDestroy':_0xf8ca('0x5')};function emitEvent(_0x4e6684){return function(_0x129ca9,_0x23939c,_0x2a9691){WhatsappMessageEvents[_0xf8ca('0x6')](_0x4e6684+':'+_0x129ca9['id'],_0x129ca9);WhatsappMessageEvents[_0xf8ca('0x6')](_0x4e6684,_0x129ca9);_0x2a9691(null);};}for(var e in events){if(events[_0xf8ca('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xf8ca('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 421f946..a42e965 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 _0xdd14=['bluebird','node-fetch','path','../../config/environment','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','error','WhatsappAccount','find','then','type','twilio','accountSid','phone','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','authToken','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0xffeeb6,_0x44a2dd){var _0x4b86bc=function(_0x2ffdc0){while(--_0x2ffdc0){_0xffeeb6['push'](_0xffeeb6['shift']());}};_0x4b86bc(++_0x44a2dd);}(_0xdd14,0x16f));var _0x4dd1=function(_0x8a5413,_0x335551){_0x8a5413=_0x8a5413-0x0;var _0x3eaf4e=_0xdd14[_0x8a5413];return _0x3eaf4e;};'use strict';var _=require(_0x4dd1('0x0'));var util=require(_0x4dd1('0x1'));var logger=require(_0x4dd1('0x2'))(_0x4dd1('0x3'));var moment=require(_0x4dd1('0x4'));var BPromise=require(_0x4dd1('0x5'));var rp=require('request-promise');var fetch=require(_0x4dd1('0x6'));var fs=require('fs');var path=require(_0x4dd1('0x7'));var rimraf=require('rimraf');var config=require(_0x4dd1('0x8'));var attributes=require('./whatsappMessage.attributes');module[_0x4dd1('0x9')]=function(_0x29d3d8,_0x2121a8){return _0x29d3d8[_0x4dd1('0xa')]('WhatsappMessage',attributes,{'tableName':_0x4dd1('0xb'),'paranoid':![],'indexes':[{'name':_0x4dd1('0xc'),'fields':[_0x4dd1('0xc')]},{'name':_0x4dd1('0xd'),'fields':[_0x4dd1('0xe')],'type':_0x4dd1('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2bcb32,_0x433a63,_0x44e9e5){var _0x2ca559=_0x29d3d8[_0x4dd1('0x10')];var _0xf28501=_0x2bcb32[_0x4dd1('0x11')]({'plain':!![]});if(_0xf28501[_0x4dd1('0x12')][_0x4dd1('0x13')]()==='in'||_0xf28501['direction'][_0x4dd1('0x13')]()===_0x4dd1('0x14')&&!_0xf28501[_0x4dd1('0x15')]&&!_['isNil'](_0xf28501[_0x4dd1('0x16')])){_0x2ca559[_0x4dd1('0x17')][_0x4dd1('0x18')]({'where':{'id':_0xf28501[_0x4dd1('0x19')]}})['then'](function(_0x28dd73){if(_0x28dd73){_0x28dd73[_0x4dd1('0x1a')]({'lastMsgAt':_0xf28501[_0x4dd1('0x1b')],'lastMsgDirection':_0xf28501[_0x4dd1('0x12')][_0x4dd1('0x13')]()});}})[_0x4dd1('0x1c')](function(_0x543969){console[_0x4dd1('0x1d')](_0x543969);});}if(_0xf28501[_0x4dd1('0x12')]===_0x4dd1('0x14')&&!_0xf28501[_0x4dd1('0x15')]){var _0x31f052;_0x2ca559[_0x4dd1('0x1e')][_0x4dd1('0x1f')]({'where':{'id':_0xf28501['WhatsappAccountId']},'raw':!![]})[_0x4dd1('0x20')](function(_0x52115f){_0x31f052=_0x52115f;if(_0x31f052&&_0x31f052[_0x4dd1('0x21')]){switch(_0x31f052['type']){case _0x4dd1('0x22'):var _0x28c02e=require(_0x4dd1('0x22'));if(_0x31f052[_0x4dd1('0x23')]&&_0x31f052['authToken']&&_0x31f052[_0x4dd1('0x24')]){var _0x1fb864=new _0x28c02e(_0x31f052[_0x4dd1('0x23')],_0x31f052['authToken']);_0x1fb864[_0x4dd1('0x25')]['create']({'body':_0xf28501[_0x4dd1('0xe')],'to':_0x4dd1('0x26')+_0xf28501['phone'],'from':_0x4dd1('0x26')+_0x31f052['phone'],'statusCallback':_0x31f052[_0x4dd1('0x27')]+_0x4dd1('0x28')+_0xf28501['id']+_0x4dd1('0x29')+_0x31f052['token']})[_0x4dd1('0x20')](function(_0x597ea4){if(_0x597ea4['sid']){return _0x2bcb32[_0x4dd1('0x1a')]({'messageId':_0x597ea4[_0x4dd1('0x2a')]});}})[_0x4dd1('0x1c')](function(_0x158691){logger[_0x4dd1('0x1d')](_0x4dd1('0x2b'),_0x4dd1('0x2c'),_0x4dd1('0x22'),util[_0x4dd1('0x2d')](_0x158691,{'showHidden':![],'depth':null}));});}else{logger[_0x4dd1('0x1d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4dd1('0x2c'),'twilio',_0x4dd1('0x2e'));}break;case _0x4dd1('0x2f'):var _0x27f232=_0x31f052['accountSid'];var _0x2d4d7b=_0x31f052[_0x4dd1('0x30')];var _0x565736=_0x31f052[_0x4dd1('0x31')]+_0x4dd1('0x32')+_0x27f232+_0x4dd1('0x33');var _0x4b7758={'to':[_0xf28501[_0x4dd1('0x24')]],'message':{'type':_0x4dd1('0x34'),'text':_0xf28501[_0x4dd1('0xe')]}};var _0x2b6c4d={'method':_0x4dd1('0x35'),'uri':_0x565736,'headers':{'Authorization':_0x4dd1('0x36')+_0x2d4d7b,'Content-Type':_0x4dd1('0x37')},'body':_0x4b7758,'json':!![]};rp(_0x2b6c4d)[_0x4dd1('0x20')](function(_0x21bedf){if(_0x21bedf[_0x4dd1('0x38')][0x0][_0x4dd1('0x39')]){return _0x2bcb32['update']({'messageId':_0x21bedf['statuses'][0x0][_0x4dd1('0x39')]});}})[_0x4dd1('0x1c')](function(_0x1714ee){logger[_0x4dd1('0x3a')](_0x4dd1('0x3b'),_0x1714ee);});break;}}})[_0x4dd1('0x3c')](function(){_0x44e9e5();});}else{_0x44e9e5();}}},'charset':'utf8mb4','collate':_0x4dd1('0x3d')});}; \ No newline at end of file +var _0xf23b=['whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','out','isNil','UserId','findOne','update','toLowerCase','error','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','create','whatsapp:','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','/whatsapp/v1/','text','POST','Bearer\x20','application/json','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports'];(function(_0x26aa07,_0x55175f){var _0x3683e9=function(_0x484a30){while(--_0x484a30){_0x26aa07['push'](_0x26aa07['shift']());}};_0x3683e9(++_0x55175f);}(_0xf23b,0x133));var _0xbf23=function(_0x377c5a,_0x1cc6ff){_0x377c5a=_0x377c5a-0x0;var _0x49d7ff=_0xf23b[_0x377c5a];return _0x49d7ff;};'use strict';var _=require(_0xbf23('0x0'));var util=require(_0xbf23('0x1'));var logger=require(_0xbf23('0x2'))(_0xbf23('0x3'));var moment=require(_0xbf23('0x4'));var BPromise=require('bluebird');var rp=require(_0xbf23('0x5'));var fetch=require(_0xbf23('0x6'));var fs=require('fs');var path=require(_0xbf23('0x7'));var rimraf=require('rimraf');var config=require(_0xbf23('0x8'));var attributes=require(_0xbf23('0x9'));module[_0xbf23('0xa')]=function(_0x393a52,_0x18857b){return _0x393a52['define']('WhatsappMessage',attributes,{'tableName':_0xbf23('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xbf23('0xc')]},{'name':_0xbf23('0xd'),'fields':[_0xbf23('0xe')],'type':_0xbf23('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x16e09c,_0x5dc111,_0x1cfeec){var _0x1d372c=_0x393a52[_0xbf23('0x10')];var _0x7ecb96=_0x16e09c[_0xbf23('0x11')]({'plain':!![]});if(_0x7ecb96[_0xbf23('0x12')]['toLowerCase']()==='in'||_0x7ecb96[_0xbf23('0x12')]['toLowerCase']()===_0xbf23('0x13')&&!_0x7ecb96['secret']&&!_[_0xbf23('0x14')](_0x7ecb96[_0xbf23('0x15')])){_0x1d372c['WhatsappInteraction'][_0xbf23('0x16')]({'where':{'id':_0x7ecb96['WhatsappInteractionId']}})['then'](function(_0x54fedf){if(_0x54fedf){_0x54fedf[_0xbf23('0x17')]({'lastMsgAt':_0x7ecb96['createdAt'],'lastMsgDirection':_0x7ecb96['direction'][_0xbf23('0x18')]()});}})['catch'](function(_0x46ef3b){console[_0xbf23('0x19')](_0x46ef3b);});}if(_0x7ecb96[_0xbf23('0x12')]===_0xbf23('0x13')&&!_0x7ecb96['secret']){var _0x4d0e9c;_0x1d372c['WhatsappAccount'][_0xbf23('0x1a')]({'where':{'id':_0x7ecb96[_0xbf23('0x1b')]},'raw':!![]})[_0xbf23('0x1c')](function(_0xf3c001){_0x4d0e9c=_0xf3c001;if(_0x4d0e9c&&_0x4d0e9c['type']){switch(_0x4d0e9c[_0xbf23('0x1d')]){case _0xbf23('0x1e'):var _0x3a88bd=require('twilio');if(_0x4d0e9c[_0xbf23('0x1f')]&&_0x4d0e9c[_0xbf23('0x20')]&&_0x4d0e9c[_0xbf23('0x21')]){var _0x3f7f2e=new _0x3a88bd(_0x4d0e9c['accountSid'],_0x4d0e9c[_0xbf23('0x20')]);_0x3f7f2e['messages'][_0xbf23('0x22')]({'body':_0x7ecb96['body'],'to':_0xbf23('0x23')+_0x7ecb96[_0xbf23('0x21')],'from':_0xbf23('0x23')+_0x4d0e9c[_0xbf23('0x21')],'statusCallback':_0x4d0e9c['remote']+'/api/whatsapp/messages/'+_0x7ecb96['id']+'/status?token='+_0x4d0e9c[_0xbf23('0x24')]})[_0xbf23('0x1c')](function(_0x5195bd){if(_0x5195bd['sid']){return _0x16e09c[_0xbf23('0x17')]({'messageId':_0x5195bd[_0xbf23('0x25')]});}})[_0xbf23('0x26')](function(_0x380bd4){logger[_0xbf23('0x19')](_0xbf23('0x27'),_0xbf23('0x28'),_0xbf23('0x1e'),util[_0xbf23('0x29')](_0x380bd4,{'showHidden':![],'depth':null}));});}else{logger[_0xbf23('0x19')](_0xbf23('0x27'),'afterCreate','twilio',_0xbf23('0x2a'));}break;case'sinch':var _0x2a7baf=_0x4d0e9c[_0xbf23('0x1f')];var _0x58d130=_0x4d0e9c[_0xbf23('0x20')];var _0x55b1e2=_0x4d0e9c['baseUrl']+_0xbf23('0x2b')+_0x2a7baf+'/messages/';var _0xe59053={'to':[_0x7ecb96[_0xbf23('0x21')]],'message':{'type':_0xbf23('0x2c'),'text':_0x7ecb96[_0xbf23('0xe')]}};var _0x2627f8={'method':_0xbf23('0x2d'),'uri':_0x55b1e2,'headers':{'Authorization':_0xbf23('0x2e')+_0x58d130,'Content-Type':_0xbf23('0x2f')},'body':_0xe59053,'json':!![]};rp(_0x2627f8)['then'](function(_0x2f96a9){if(_0x2f96a9[_0xbf23('0x30')][0x0]['message_id']){return _0x16e09c['update']({'messageId':_0x2f96a9[_0xbf23('0x30')][0x0]['message_id']});}})[_0xbf23('0x26')](function(_0x27ae70){logger[_0xbf23('0x31')](_0xbf23('0x32'),_0x27ae70);});break;}}})[_0xbf23('0x33')](function(){_0x1cfeec();});}else{_0x1cfeec();}}},'charset':_0xbf23('0x34'),'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 1cdbea0..7a37099 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 _0x2291=['moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','WhatsappMessage','create','body','options','raw','CreateWhatsappMessage','stringify','util'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x2291,0x11f));var _0x1229=function(_0x41bedb,_0x456545){_0x41bedb=_0x41bedb-0x0;var _0x5384af=_0x2291[_0x41bedb];return _0x5384af;};'use strict';var _=require('lodash');var util=require(_0x1229('0x0'));var moment=require(_0x1229('0x1'));var BPromise=require('bluebird');var rs=require(_0x1229('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1229('0x3'));var logger=require(_0x1229('0x4'))(_0x1229('0x5'));var config=require(_0x1229('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1229('0x7')]['http']({'port':0x232a});config[_0x1229('0x8')]=_[_0x1229('0x9')](config[_0x1229('0x8')],{'host':_0x1229('0xa'),'port':0x18eb});var socket=require(_0x1229('0xb'))(new Redis(config[_0x1229('0x8')]));require(_0x1229('0xc'))[_0x1229('0xd')](socket);function respondWithRpcPromise(_0x4ba9c7,_0x3ba6bc,_0x4f716d){return new BPromise(function(_0x27faac,_0x43bd4d){return client[_0x1229('0xe')](_0x4ba9c7,_0x4f716d)[_0x1229('0xf')](function(_0x2adb84){logger[_0x1229('0x10')](_0x1229('0x11'),_0x3ba6bc,_0x1229('0x12'));logger[_0x1229('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3ba6bc,_0x1229('0x12'),JSON['stringify'](_0x2adb84));if(_0x2adb84[_0x1229('0x14')]){if(_0x2adb84[_0x1229('0x14')][_0x1229('0x15')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x3ba6bc,_0x2adb84['error']['message']);return _0x43bd4d(_0x2adb84['error'][_0x1229('0x16')]);}logger[_0x1229('0x14')](_0x1229('0x11'),_0x3ba6bc,_0x2adb84[_0x1229('0x14')][_0x1229('0x16')]);return _0x27faac(_0x2adb84[_0x1229('0x14')][_0x1229('0x16')]);}else{logger[_0x1229('0x10')](_0x1229('0x11'),_0x3ba6bc,'request\x20sent');_0x27faac(_0x2adb84[_0x1229('0x17')][_0x1229('0x16')]);}})[_0x1229('0x18')](function(_0x28c013){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x3ba6bc,_0x28c013);_0x43bd4d(_0x28c013);});});}exports['CreateWhatsappMessage']=function(_0x5e87a9){var _0x4ea8ec=this;return new Promise(function(_0x3f0c3e,_0x257f99){return db[_0x1229('0x19')][_0x1229('0x1a')](_0x5e87a9[_0x1229('0x1b')],{'raw':_0x5e87a9[_0x1229('0x1c')]?_0x5e87a9[_0x1229('0x1c')][_0x1229('0x1d')]===undefined?!![]:![]:!![]})[_0x1229('0xf')](function(_0x506a13){logger[_0x1229('0x10')](_0x1229('0x1e'),_0x5e87a9);logger[_0x1229('0x13')](_0x1229('0x1e'),_0x5e87a9,JSON[_0x1229('0x1f')](_0x506a13));_0x3f0c3e(_0x506a13);})[_0x1229('0x18')](function(_0x8d3af0){logger['error'](_0x1229('0x1e'),_0x8d3af0[_0x1229('0x16')],_0x5e87a9);_0x257f99(_0x4ea8ec[_0x1229('0x14')](0x1f4,_0x8d3af0[_0x1229('0x16')]));});});}; \ No newline at end of file +var _0x916d=['rpc','../../config/environment','jayson/promise','client','http','redis','./whatsappMessage.socket','register','request','info','request\x20sent','debug','error','WhatsappMessage,\x20%s,\x20%s','message','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x171075,_0x144eca){var _0x4d56d6=function(_0xdfb8b8){while(--_0xdfb8b8){_0x171075['push'](_0x171075['shift']());}};_0x4d56d6(++_0x144eca);}(_0x916d,0x1d8));var _0xd916=function(_0xa0b5c0,_0x2cbfca){_0xa0b5c0=_0xa0b5c0-0x0;var _0x26d63f=_0x916d[_0xa0b5c0];return _0x26d63f;};'use strict';var _=require(_0xd916('0x0'));var util=require(_0xd916('0x1'));var moment=require(_0xd916('0x2'));var BPromise=require(_0xd916('0x3'));var rs=require(_0xd916('0x4'));var fs=require('fs');var Redis=require(_0xd916('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd916('0x6'));var logger=require(_0xd916('0x7'))(_0xd916('0x8'));var config=require(_0xd916('0x9'));var jayson=require(_0xd916('0xa'));var client=jayson[_0xd916('0xb')][_0xd916('0xc')]({'port':0x232a});config[_0xd916('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd916('0xd')]));require(_0xd916('0xe'))[_0xd916('0xf')](socket);function respondWithRpcPromise(_0x494a3f,_0x4cf34e,_0x28112e){return new BPromise(function(_0x100895,_0x5d55ad){return client[_0xd916('0x10')](_0x494a3f,_0x28112e)['then'](function(_0xf6c69d){logger[_0xd916('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x4cf34e,_0xd916('0x12'));logger[_0xd916('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4cf34e,_0xd916('0x12'),JSON['stringify'](_0xf6c69d));if(_0xf6c69d[_0xd916('0x14')]){if(_0xf6c69d[_0xd916('0x14')]['code']===0x1f4){logger[_0xd916('0x14')](_0xd916('0x15'),_0x4cf34e,_0xf6c69d[_0xd916('0x14')][_0xd916('0x16')]);return _0x5d55ad(_0xf6c69d['error']['message']);}logger[_0xd916('0x14')](_0xd916('0x15'),_0x4cf34e,_0xf6c69d['error'][_0xd916('0x16')]);return _0x100895(_0xf6c69d[_0xd916('0x14')][_0xd916('0x16')]);}else{logger[_0xd916('0x11')](_0xd916('0x15'),_0x4cf34e,'request\x20sent');_0x100895(_0xf6c69d['result'][_0xd916('0x16')]);}})[_0xd916('0x17')](function(_0x29528a){logger[_0xd916('0x14')](_0xd916('0x15'),_0x4cf34e,_0x29528a);_0x5d55ad(_0x29528a);});});}exports[_0xd916('0x18')]=function(_0x2112fe){var _0x10b91e=this;return new Promise(function(_0x4a1a4c,_0x3abd5e){return db[_0xd916('0x19')]['create'](_0x2112fe[_0xd916('0x1a')],{'raw':_0x2112fe[_0xd916('0x1b')]?_0x2112fe['options'][_0xd916('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2ac188){logger['info']('CreateWhatsappMessage',_0x2112fe);logger[_0xd916('0x13')]('CreateWhatsappMessage',_0x2112fe,JSON[_0xd916('0x1d')](_0x2ac188));_0x4a1a4c(_0x2ac188);})['catch'](function(_0x4c5cca){logger[_0xd916('0x14')](_0xd916('0x18'),_0x4c5cca[_0xd916('0x16')],_0x2112fe);_0x3abd5e(_0x10b91e[_0xd916('0x14')](0x1f4,_0x4c5cca[_0xd916('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index cb703da..d701886 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 _0x9033=['whatsappMessage:','./whatsappMessage.events','remove','update','emit','removeListener','register','length'];(function(_0x1af5cf,_0x1e3000){var _0x34674a=function(_0x4d5731){while(--_0x4d5731){_0x1af5cf['push'](_0x1af5cf['shift']());}};_0x34674a(++_0x1e3000);}(_0x9033,0x181));var _0x3903=function(_0x7db377,_0x51fd82){_0x7db377=_0x7db377-0x0;var _0x536015=_0x9033[_0x7db377];return _0x536015;};'use strict';var WhatsappMessageEvents=require(_0x3903('0x0'));var events=['save',_0x3903('0x1'),_0x3903('0x2')];function createListener(_0x508690,_0xf7aea2){return function(_0x44087a){_0xf7aea2[_0x3903('0x3')](_0x508690,_0x44087a);};}function removeListener(_0x2e3411,_0x1da0a8){return function(){WhatsappMessageEvents[_0x3903('0x4')](_0x2e3411,_0x1da0a8);};}exports[_0x3903('0x5')]=function(_0x1693ad){for(var _0x227e9a=0x0,_0x965436=events[_0x3903('0x6')];_0x227e9a<_0x965436;_0x227e9a++){var _0x1b4f26=events[_0x227e9a];var _0x28cbfc=createListener(_0x3903('0x7')+_0x1b4f26,_0x1693ad);WhatsappMessageEvents['on'](_0x1b4f26,_0x28cbfc);}}; \ No newline at end of file +var _0xacad=['./whatsappMessage.events','save','remove','update','emit','length','whatsappMessage:'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xacad,0x118));var _0xdaca=function(_0x43106c,_0x4bbe09){_0x43106c=_0x43106c-0x0;var _0x247be3=_0xacad[_0x43106c];return _0x247be3;};'use strict';var WhatsappMessageEvents=require(_0xdaca('0x0'));var events=[_0xdaca('0x1'),_0xdaca('0x2'),_0xdaca('0x3')];function createListener(_0x237919,_0x4e326d){return function(_0x2c0950){_0x4e326d[_0xdaca('0x4')](_0x237919,_0x2c0950);};}function removeListener(_0x571c1d,_0x358c60){return function(){WhatsappMessageEvents['removeListener'](_0x571c1d,_0x358c60);};}exports['register']=function(_0x41bd10){for(var _0x2e97bd=0x0,_0x23452f=events[_0xdaca('0x5')];_0x2e97bd<_0x23452f;_0x2e97bd++){var _0x24542a=events[_0x2e97bd];var _0x2fd340=createListener(_0xdaca('0x6')+_0x24542a,_0x41bd10);WhatsappMessageEvents['on'](_0x24542a,_0x2fd340);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index caa14c9..92865c8 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 _0x1646=['getAgents','create','addTeams','post','addAgents','put','update','delete','removeTeams','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x4dbdda,_0x11f07c){var _0x1acbf1=function(_0x1a9fc8){while(--_0x1a9fc8){_0x4dbdda['push'](_0x4dbdda['shift']());}};_0x1acbf1(++_0x11f07c);}(_0x1646,0x117));var _0x6164=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x1646[_0x311c35];return _0x5cc50c;};'use strict';var multer=require('multer');var util=require(_0x6164('0x0'));var path=require('path');var timeout=require(_0x6164('0x1'));var express=require(_0x6164('0x2'));var router=express[_0x6164('0x3')]();var fs_extra=require(_0x6164('0x4'));var auth=require(_0x6164('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6164('0x6'));router[_0x6164('0x7')]('/',auth[_0x6164('0x8')](),controller[_0x6164('0x9')]);router['get'](_0x6164('0xa'),auth['isAuthenticated'](),controller[_0x6164('0xb')]);router['get'](_0x6164('0xc'),auth['isAuthenticated'](),controller[_0x6164('0xd')]);router[_0x6164('0x7')]('/:id/members',auth['isAuthenticated'](),controller[_0x6164('0xe')]);router['get'](_0x6164('0xf'),auth['isAuthenticated'](),controller[_0x6164('0x10')]);router[_0x6164('0x7')](_0x6164('0x11'),auth['isAuthenticated'](),controller[_0x6164('0x12')]);router['post']('/',auth[_0x6164('0x8')](),controller[_0x6164('0x13')]);router['post']('/:id/teams',auth[_0x6164('0x8')](),controller[_0x6164('0x14')]);router[_0x6164('0x15')](_0x6164('0x11'),auth[_0x6164('0x8')](),controller[_0x6164('0x16')]);router[_0x6164('0x17')](_0x6164('0xc'),auth[_0x6164('0x8')](),controller[_0x6164('0x18')]);router['delete'](_0x6164('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x6164('0x19')]('/:id/teams',auth[_0x6164('0x8')](),controller[_0x6164('0x1a')]);router[_0x6164('0x19')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x1a27=['addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x4fe777,_0x40dec8){var _0x2a3437=function(_0x4efe76){while(--_0x4efe76){_0x4fe777['push'](_0x4fe777['shift']());}};_0x2a3437(++_0x40dec8);}(_0x1a27,0x17c));var _0x71a2=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x1a27[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x71a2('0x0'));var util=require(_0x71a2('0x1'));var path=require(_0x71a2('0x2'));var timeout=require(_0x71a2('0x3'));var express=require(_0x71a2('0x4'));var router=express[_0x71a2('0x5')]();var fs_extra=require(_0x71a2('0x6'));var auth=require(_0x71a2('0x7'));var interaction=require(_0x71a2('0x8'));var config=require(_0x71a2('0x9'));var controller=require('./whatsappQueue.controller');router[_0x71a2('0xa')]('/',auth[_0x71a2('0xb')](),controller[_0x71a2('0xc')]);router[_0x71a2('0xa')]('/describe',auth[_0x71a2('0xb')](),controller[_0x71a2('0xd')]);router[_0x71a2('0xa')](_0x71a2('0xe'),auth[_0x71a2('0xb')](),controller[_0x71a2('0xf')]);router[_0x71a2('0xa')](_0x71a2('0x10'),auth[_0x71a2('0xb')](),controller['getMembers']);router['get'](_0x71a2('0x11'),auth[_0x71a2('0xb')](),controller[_0x71a2('0x12')]);router[_0x71a2('0xa')](_0x71a2('0x13'),auth['isAuthenticated'](),controller[_0x71a2('0x14')]);router[_0x71a2('0x15')]('/',auth['isAuthenticated'](),controller[_0x71a2('0x16')]);router[_0x71a2('0x15')](_0x71a2('0x11'),auth['isAuthenticated'](),controller[_0x71a2('0x17')]);router[_0x71a2('0x15')](_0x71a2('0x13'),auth[_0x71a2('0xb')](),controller[_0x71a2('0x18')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x71a2('0x19')]);router[_0x71a2('0x1a')](_0x71a2('0xe'),auth[_0x71a2('0xb')](),controller[_0x71a2('0x1b')]);router[_0x71a2('0x1a')](_0x71a2('0x11'),auth[_0x71a2('0xb')](),controller[_0x71a2('0x1c')]);router['delete'](_0x71a2('0x13'),auth[_0x71a2('0xb')](),controller[_0x71a2('0x1d')]);module[_0x71a2('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 5e22aff..f9442a7 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 _0xb16f=['beepall','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x5751a1,_0x3658fa){var _0x12d6d7=function(_0x1bdacb){while(--_0x1bdacb){_0x5751a1['push'](_0x5751a1['shift']());}};_0x12d6d7(++_0x3658fa);}(_0xb16f,0xf6));var _0xfb16=function(_0x12fcbd,_0x884804){_0x12fcbd=_0x12fcbd-0x0;var _0x28ec2a=_0xb16f[_0x12fcbd];return _0x28ec2a;};'use strict';var Sequelize=require(_0xfb16('0x0'));module[_0xfb16('0x1')]={'name':{'type':Sequelize[_0xfb16('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xfb16('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfb16('0x4')](_0xfb16('0x5'),_0xfb16('0x6'),'roundrobin')},'description':{'type':Sequelize[_0xfb16('0x2')]}}; \ No newline at end of file +var _0x9de3=['sequelize','STRING','name','INTEGER','rrmemory','roundrobin'];(function(_0x48949e,_0xf30b55){var _0x2b7bb6=function(_0x4c8694){while(--_0x4c8694){_0x48949e['push'](_0x48949e['shift']());}};_0x2b7bb6(++_0xf30b55);}(_0x9de3,0xea));var _0x39de=function(_0xb094cf,_0x2e1e79){_0xb094cf=_0xb094cf-0x0;var _0x3a0234=_0x9de3[_0xb094cf];return _0x3a0234;};'use strict';var Sequelize=require(_0x39de('0x0'));module['exports']={'name':{'type':Sequelize[_0x39de('0x1')],'unique':_0x39de('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x39de('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x39de('0x4'),'beepall',_0x39de('0x5'))},'description':{'type':Sequelize[_0x39de('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 715d655..58204d2 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 _0x91a8=['WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','addAgents','omit','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','sendStatus','status','undefined','offset','count','limit','reject','save','update','then','WhatsappQueues','destroy','end','name','send','index','map','WhatsappQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','error','params','describe','getMembers','findOne','nolimit','order','UserWhatsappQueue','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','SIP','Team','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','from','team_has_whatsapp_queues','join','user_has_teams'];(function(_0x3ebea5,_0x5d473e){var _0x36b2cd=function(_0x165f69){while(--_0x165f69){_0x3ebea5['push'](_0x3ebea5['shift']());}};_0x36b2cd(++_0x5d473e);}(_0x91a8,0x11b));var _0x891a=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x91a8[_0x397cfb];return _0x15fed9;};'use strict';var emlformat=require(_0x891a('0x0'));var rimraf=require(_0x891a('0x1'));var zipdir=require(_0x891a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x891a('0x3'));var BPromise=require(_0x891a('0x4'));var Mustache=require(_0x891a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x891a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x891a('0x7'));var squel=require('squel');var crypto=require(_0x891a('0x8'));var jsforce=require(_0x891a('0x9'));var deskjs=require(_0x891a('0xa'));var toCsv=require(_0x891a('0xb'));var querystring=require(_0x891a('0xc'));var Papa=require(_0x891a('0xd'));var Redis=require(_0x891a('0xe'));var authService=require(_0x891a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x891a('0x10'));var hardwareService=require(_0x891a('0x11'));var logger=require('../../config/logger')(_0x891a('0x12'));var utils=require(_0x891a('0x13'));var config=require(_0x891a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x891a('0x15'))['db'];config[_0x891a('0x16')]=_[_0x891a('0x17')](config[_0x891a('0x16')],{'host':_0x891a('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x891a('0x16')]));require(_0x891a('0x19'))[_0x891a('0x1a')](socket);function respondWithStatusCode(_0x4dd612,_0x567abd){_0x567abd=_0x567abd||0xcc;return function(_0x1e6382){if(_0x1e6382){return _0x4dd612[_0x891a('0x1b')](_0x567abd);}return _0x4dd612[_0x891a('0x1c')](_0x567abd)['end']();};}function respondWithResult(_0x20cefa,_0x73a2be){_0x73a2be=_0x73a2be||0xc8;return function(_0x31823f){if(_0x31823f){return _0x20cefa[_0x891a('0x1c')](_0x73a2be)['json'](_0x31823f);}};}function respondWithFilteredResult(_0x41816a,_0x3cdd45){return function(_0xfed805){if(_0xfed805){var _0x5a4bf9=typeof _0x3cdd45['offset']===_0x891a('0x1d')&&typeof _0x3cdd45['limit']===_0x891a('0x1d');var _0xf551d6=_0xfed805['count'];var _0x24f7d1=_0x5a4bf9?0x0:_0x3cdd45[_0x891a('0x1e')];var _0x1e6082=_0x5a4bf9?_0xfed805[_0x891a('0x1f')]:_0x3cdd45[_0x891a('0x1e')]+_0x3cdd45[_0x891a('0x20')];var _0x3e66bf;if(_0x1e6082>=_0xf551d6){_0x1e6082=_0xf551d6;_0x3e66bf=0xc8;}else{_0x3e66bf=0xce;}_0x41816a['status'](_0x3e66bf);return _0x41816a['set']('Content-Range',_0x24f7d1+'-'+_0x1e6082+'/'+_0xf551d6)['json'](_0xfed805);}return null;};}function patchUpdates(_0x5ac31d){return function(_0x3b54d2){try{jsonpatch['apply'](_0x3b54d2,_0x5ac31d,!![]);}catch(_0x50b8aa){return BPromise[_0x891a('0x21')](_0x50b8aa);}return _0x3b54d2[_0x891a('0x22')]();};}function saveUpdates(_0x347820,_0x5ef47f){return function(_0x256d4a){if(_0x256d4a){return _0x256d4a[_0x891a('0x23')](_0x347820)['then'](function(_0x24af25){return _0x24af25;});}return null;};}function removeEntity(_0x1a7881,_0x3f07db){return function(_0x18179b){if(_0x18179b){return _0x18179b['destroy']()[_0x891a('0x24')](function(){var _0x57d30e=_0x18179b['get']({'plain':!![]});var _0x5a4ecb=_0x891a('0x25');return db['UserProfileResource'][_0x891a('0x26')]({'where':{'type':_0x5a4ecb,'resourceId':_0x57d30e['id']}})[_0x891a('0x24')](function(){return _0x18179b;});})[_0x891a('0x24')](function(){_0x1a7881[_0x891a('0x1c')](0xcc)[_0x891a('0x27')]();});}};}function handleEntityNotFound(_0x5dcb10,_0x21165f){return function(_0x387388){if(!_0x387388){_0x5dcb10[_0x891a('0x1b')](0x194);}return _0x387388;};}function handleError(_0x8d56ef,_0x412d0f){_0x412d0f=_0x412d0f||0x1f4;return function(_0x94284e){logger['error'](_0x94284e['stack']);if(_0x94284e[_0x891a('0x28')]){delete _0x94284e[_0x891a('0x28')];}_0x8d56ef[_0x891a('0x1c')](_0x412d0f)[_0x891a('0x29')](_0x94284e);};}exports[_0x891a('0x2a')]=function(_0x489eaf,_0x5efedb){var _0x217ccc={},_0x1857c5={},_0x22a2bd={'count':0x0,'rows':[]};var _0x2a4078=_[_0x891a('0x2b')](db[_0x891a('0x2c')][_0x891a('0x2d')],function(_0x28250a){return{'name':_0x28250a['fieldName'],'type':_0x28250a[_0x891a('0x2e')][_0x891a('0x2f')]};});_0x1857c5[_0x891a('0x30')]=_[_0x891a('0x2b')](_0x2a4078,_0x891a('0x28'));_0x1857c5[_0x891a('0x31')]=_[_0x891a('0x32')](_0x489eaf[_0x891a('0x31')]);_0x1857c5[_0x891a('0x33')]=_[_0x891a('0x34')](_0x1857c5['model'],_0x1857c5['query']);_0x217ccc[_0x891a('0x35')]=_[_0x891a('0x34')](_0x1857c5[_0x891a('0x30')],qs['fields'](_0x489eaf[_0x891a('0x31')][_0x891a('0x36')]));_0x217ccc[_0x891a('0x35')]=_0x217ccc[_0x891a('0x35')][_0x891a('0x37')]?_0x217ccc[_0x891a('0x35')]:_0x1857c5['model'];if(!_0x489eaf[_0x891a('0x31')][_0x891a('0x38')]('nolimit')){_0x217ccc[_0x891a('0x20')]=qs[_0x891a('0x20')](_0x489eaf[_0x891a('0x31')][_0x891a('0x20')]);_0x217ccc[_0x891a('0x1e')]=qs[_0x891a('0x1e')](_0x489eaf[_0x891a('0x31')][_0x891a('0x1e')]);}_0x217ccc['order']=qs[_0x891a('0x39')](_0x489eaf[_0x891a('0x31')][_0x891a('0x39')]);_0x217ccc[_0x891a('0x3a')]=qs[_0x891a('0x33')](_[_0x891a('0x3b')](_0x489eaf[_0x891a('0x31')],_0x1857c5[_0x891a('0x33')]),_0x2a4078);if(_0x489eaf[_0x891a('0x31')][_0x891a('0x3c')]){_0x217ccc[_0x891a('0x3a')]=_[_0x891a('0x3d')](_0x217ccc['where'],{'$or':_['map'](_0x2a4078,function(_0x351ccc){if(_0x351ccc['type']!==_0x891a('0x3e')){var _0x177626={};_0x177626[_0x351ccc[_0x891a('0x28')]]={'$like':'%'+_0x489eaf[_0x891a('0x31')][_0x891a('0x3c')]+'%'};return _0x177626;}})});}_0x217ccc=_[_0x891a('0x3d')]({},_0x217ccc,_0x489eaf[_0x891a('0x3f')]);var _0x2128cd={'where':_0x217ccc[_0x891a('0x3a')]};return db['WhatsappQueue']['count'](_0x2128cd)[_0x891a('0x24')](function(_0x288e7a){_0x22a2bd[_0x891a('0x1f')]=_0x288e7a;if(_0x489eaf['query'][_0x891a('0x40')]){_0x217ccc[_0x891a('0x41')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x891a('0x42')](_0x217ccc);})[_0x891a('0x24')](function(_0xc604e1){_0x22a2bd[_0x891a('0x43')]=_0xc604e1;return _0x22a2bd;})[_0x891a('0x24')](respondWithFilteredResult(_0x5efedb,_0x217ccc))[_0x891a('0x44')](handleError(_0x5efedb,null));};exports['show']=function(_0x243280,_0x46619c){var _0x4ea3c8={'raw':!![],'where':{'id':_0x243280['params']['id']}},_0x6050f1={};_0x6050f1[_0x891a('0x30')]=_[_0x891a('0x32')](db[_0x891a('0x2c')][_0x891a('0x2d')]);_0x6050f1[_0x891a('0x31')]=_['keys'](_0x243280[_0x891a('0x31')]);_0x6050f1[_0x891a('0x33')]=_[_0x891a('0x34')](_0x6050f1[_0x891a('0x30')],_0x6050f1[_0x891a('0x31')]);_0x4ea3c8[_0x891a('0x35')]=_[_0x891a('0x34')](_0x6050f1[_0x891a('0x30')],qs[_0x891a('0x36')](_0x243280[_0x891a('0x31')][_0x891a('0x36')]));_0x4ea3c8[_0x891a('0x35')]=_0x4ea3c8['attributes'][_0x891a('0x37')]?_0x4ea3c8[_0x891a('0x35')]:_0x6050f1['model'];if(_0x243280['query'][_0x891a('0x40')]){_0x4ea3c8[_0x891a('0x41')]=[{'all':!![]}];}_0x4ea3c8=_[_0x891a('0x3d')]({},_0x4ea3c8,_0x243280[_0x891a('0x3f')]);return db['WhatsappQueue'][_0x891a('0x45')](_0x4ea3c8)[_0x891a('0x24')](handleEntityNotFound(_0x46619c,null))['then'](respondWithResult(_0x46619c,null))[_0x891a('0x44')](handleError(_0x46619c,null));};exports[_0x891a('0x46')]=function(_0x382956,_0x2e624a){return db[_0x891a('0x2c')][_0x891a('0x46')](_0x382956[_0x891a('0x47')],{})[_0x891a('0x24')](function(_0x2ad4e8){var _0x24e384=_0x382956['user'][_0x891a('0x48')]({'plain':!![]});if(!_0x24e384)throw new Error(_0x891a('0x49'));if(_0x24e384[_0x891a('0x4a')]===_0x891a('0x4b')){var _0x526413=_0x2ad4e8['get']({'plain':!![]});var _0x508f59=_0x891a('0x25');return db[_0x891a('0x4c')][_0x891a('0x45')]({'where':{'name':_0x508f59,'userProfileId':_0x24e384['userProfileId']},'raw':!![]})[_0x891a('0x24')](function(_0x421db3){if(_0x421db3&&_0x421db3[_0x891a('0x4d')]===0x0){return db[_0x891a('0x4e')][_0x891a('0x46')]({'name':_0x526413[_0x891a('0x28')],'resourceId':_0x526413['id'],'type':_0x421db3[_0x891a('0x28')],'sectionId':_0x421db3['id']},{})[_0x891a('0x24')](function(){return _0x2ad4e8;});}else{return _0x2ad4e8;}})[_0x891a('0x44')](function(_0x2f0be9){logger[_0x891a('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f0be9);throw _0x2f0be9;});}return _0x2ad4e8;})['then'](respondWithResult(_0x2e624a,0xc9))[_0x891a('0x44')](handleError(_0x2e624a,null));};exports[_0x891a('0x23')]=function(_0x274733,_0x151da0){if(_0x274733['body']['id']){delete _0x274733[_0x891a('0x47')]['id'];}return db[_0x891a('0x2c')][_0x891a('0x45')]({'where':{'id':_0x274733['params']['id']}})['then'](handleEntityNotFound(_0x151da0,null))['then'](saveUpdates(_0x274733[_0x891a('0x47')],null))[_0x891a('0x24')](respondWithResult(_0x151da0,null))[_0x891a('0x44')](handleError(_0x151da0,null));};exports[_0x891a('0x26')]=function(_0x12e700,_0x559adf){return db['WhatsappQueue'][_0x891a('0x45')]({'where':{'id':_0x12e700[_0x891a('0x50')]['id']}})[_0x891a('0x24')](handleEntityNotFound(_0x559adf,null))[_0x891a('0x24')](removeEntity(_0x559adf,null))[_0x891a('0x44')](handleError(_0x559adf,null));};exports[_0x891a('0x51')]=function(_0xe97644,_0x20ade0){return db[_0x891a('0x2c')][_0x891a('0x51')]()[_0x891a('0x24')](respondWithResult(_0x20ade0,null))[_0x891a('0x44')](handleError(_0x20ade0,null));};exports[_0x891a('0x52')]=function(_0x196fd3,_0x12e170,_0x530a90){var _0x3dd24e={'raw':!![],'where':{}},_0x1a8060={},_0x1880bf;return db[_0x891a('0x2c')][_0x891a('0x53')]({'where':{'id':_0x196fd3[_0x891a('0x50')]['id']}})['then'](handleEntityNotFound(_0x12e170,null))[_0x891a('0x24')](function(_0x4d2b14){if(_0x4d2b14){_0x1880bf=_0x4d2b14[_0x891a('0x48')]({'plain':!![]});_0x1a8060[_0x891a('0x30')]=_[_0x891a('0x32')](db['UserWhatsappQueue'][_0x891a('0x2d')]);_0x1a8060['query']=_[_0x891a('0x32')](_0x196fd3[_0x891a('0x31')]);_0x1a8060[_0x891a('0x33')]=_[_0x891a('0x34')](_0x1a8060[_0x891a('0x30')],_0x1a8060[_0x891a('0x31')]);_0x3dd24e[_0x891a('0x35')]=_[_0x891a('0x34')](_0x1a8060['model'],qs[_0x891a('0x36')](_0x196fd3['query'][_0x891a('0x36')]));_0x3dd24e[_0x891a('0x35')]=_0x3dd24e['attributes'][_0x891a('0x37')]?_0x3dd24e[_0x891a('0x35')]:_0x1a8060[_0x891a('0x30')];if(!_0x196fd3['query'][_0x891a('0x38')](_0x891a('0x54'))){_0x3dd24e[_0x891a('0x20')]=qs[_0x891a('0x20')](_0x196fd3[_0x891a('0x31')][_0x891a('0x20')]);_0x3dd24e[_0x891a('0x1e')]=qs[_0x891a('0x1e')](_0x196fd3[_0x891a('0x31')][_0x891a('0x1e')]);}_0x3dd24e[_0x891a('0x55')]=qs[_0x891a('0x39')](_0x196fd3['query'][_0x891a('0x39')]);_0x3dd24e[_0x891a('0x3a')]=qs[_0x891a('0x33')](_[_0x891a('0x3b')](_0x196fd3['query'],_0x1a8060['filters']));_0x3dd24e[_0x891a('0x3a')]['WhatsappQueueId']=_0x4d2b14['id'];if(_0x196fd3[_0x891a('0x31')][_0x891a('0x3c')]){_0x3dd24e[_0x891a('0x3a')]=_[_0x891a('0x3d')](_0x3dd24e['where'],{'$or':_[_0x891a('0x2b')](_0x3dd24e[_0x891a('0x35')],function(_0x4ac203){var _0x3e943d={};_0x3e943d[_0x4ac203]={'$like':'%'+_0x196fd3[_0x891a('0x31')][_0x891a('0x3c')]+'%'};return _0x3e943d;})});}_0x3dd24e=_['merge']({},_0x3dd24e,_0x196fd3[_0x891a('0x3f')]);return db[_0x891a('0x56')][_0x891a('0x42')](_0x3dd24e);}})[_0x891a('0x24')](function(_0x34ff48){if(_0x34ff48){return db['User'][_0x891a('0x57')]({'where':{'id':_['map'](_0x34ff48,_0x891a('0x58')),'role':_0x891a('0x59')},'attributes':['id',_0x891a('0x28'),_0x891a('0x5a'),_0x891a('0x5b'),_0x891a('0x5c')]});}})[_0x891a('0x24')](function(_0x3f5073){if(_0x3f5073){return{'count':_0x3f5073[_0x891a('0x1f')],'rows':_[_0x891a('0x2b')](_0x3f5073[_0x891a('0x43')],function(_0x4f677a){return{'membername':_0x4f677a[_0x891a('0x28')],'UserId':_0x4f677a['id'],'queue_name':_0x1880bf[_0x891a('0x28')],'WhatsappQueueId':_0x1880bf['id'],'interface':util['format']('%s/%s',_0x891a('0x5d'),_0x4f677a[_0x891a('0x28')]),'penalty':0x0,'paused':_0x4f677a[_0x891a('0x5a')],'createdAt':_0x4f677a['createdAt'],'updatedAt':_0x4f677a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x891a('0x24')](respondWithFilteredResult(_0x12e170,_0x3dd24e))[_0x891a('0x44')](handleError(_0x12e170,null));};exports['getTeams']=function(_0x10a74a,_0x46c31c,_0x5822b4){var _0x37baa7={};var _0x1bb2aa={};var _0x4ed84b;var _0x405502;return db[_0x891a('0x2c')]['findOne']({'where':{'id':_0x10a74a['params']['id']}})[_0x891a('0x24')](handleEntityNotFound(_0x46c31c,null))[_0x891a('0x24')](function(_0x5c382c){if(_0x5c382c){_0x4ed84b=_0x5c382c;_0x1bb2aa[_0x891a('0x30')]=_[_0x891a('0x32')](db[_0x891a('0x5e')]['rawAttributes']);_0x1bb2aa[_0x891a('0x31')]=_[_0x891a('0x32')](_0x10a74a[_0x891a('0x31')]);_0x1bb2aa[_0x891a('0x33')]=_[_0x891a('0x34')](_0x1bb2aa[_0x891a('0x30')],_0x1bb2aa[_0x891a('0x31')]);_0x37baa7[_0x891a('0x35')]=_[_0x891a('0x34')](_0x1bb2aa[_0x891a('0x30')],qs[_0x891a('0x36')](_0x10a74a['query'][_0x891a('0x36')]));_0x37baa7[_0x891a('0x35')]=_0x37baa7[_0x891a('0x35')][_0x891a('0x37')]?_0x37baa7[_0x891a('0x35')]:_0x1bb2aa[_0x891a('0x30')];_0x37baa7[_0x891a('0x55')]=qs[_0x891a('0x39')](_0x10a74a['query'][_0x891a('0x39')]);_0x37baa7['where']=qs['filters'](_[_0x891a('0x3b')](_0x10a74a[_0x891a('0x31')],_0x1bb2aa['filters']));if(_0x10a74a['query'][_0x891a('0x3c')]){_0x37baa7[_0x891a('0x3a')]=_[_0x891a('0x3d')](_0x37baa7[_0x891a('0x3a')],{'$or':_[_0x891a('0x2b')](_0x37baa7[_0x891a('0x35')],function(_0x1adfc6){var _0x21fb82={};_0x21fb82[_0x1adfc6]={'$like':'%'+_0x10a74a[_0x891a('0x31')][_0x891a('0x3c')]+'%'};return _0x21fb82;})});}_0x37baa7=_[_0x891a('0x3d')]({},_0x37baa7,_0x10a74a['options']);return _0x4ed84b[_0x891a('0x5f')](_0x37baa7);}})[_0x891a('0x24')](function(_0x1ce565){if(_0x1ce565){_0x405502=_0x1ce565[_0x891a('0x37')];if(!_0x10a74a['query'][_0x891a('0x38')]('nolimit')){_0x37baa7[_0x891a('0x20')]=qs[_0x891a('0x20')](_0x10a74a['query'][_0x891a('0x20')]);_0x37baa7['offset']=qs[_0x891a('0x1e')](_0x10a74a['query'][_0x891a('0x1e')]);}return _0x4ed84b[_0x891a('0x5f')](_0x37baa7);}})[_0x891a('0x24')](function(_0x23e90a){if(_0x23e90a){return _0x23e90a?{'count':_0x405502,'rows':_0x23e90a}:null;}})['then'](respondWithResult(_0x46c31c,null))[_0x891a('0x44')](handleError(_0x46c31c,null));};exports[_0x891a('0x60')]=function(_0x404fe7,_0x11bad1,_0x2e1be8){var _0x41d986=_0x404fe7['body'][_0x891a('0x61')];return db['Team'][_0x891a('0x42')]({'where':{'id':_0x41d986},'attributes':['id'],'include':[{'model':db[_0x891a('0x62')],'as':_0x891a('0x63'),'attributes':['id','name',_0x891a('0x64'),_0x891a('0x65'),_0x891a('0x66')],'raw':!![]}]})[_0x891a('0x24')](function(_0xf3c572){if(_0xf3c572){var _0x386130=_[_0x891a('0x67')](_0xf3c572,function(_0x4dc6da){var _0x27a85c=_0x4dc6da[_0x891a('0x48')]({'plain':!![]});return _0x27a85c[_0x891a('0x63')];});return db[_0x891a('0x2c')][_0x891a('0x45')]({'where':{'id':_0x404fe7[_0x891a('0x50')]['id']}})[_0x891a('0x24')](function(_0x564da6){return db[_0x891a('0x68')][_0x891a('0x69')](function(_0x34fce1){return _0x564da6[_0x891a('0x60')](_0x41d986,{'transaction':_0x34fce1})[_0x891a('0x24')](function(){return BPromise['each'](_0x386130,function(_0x3b7c8b){return db[_0x891a('0x56')][_0x891a('0x6a')]({'where':{'UserId':_0x3b7c8b['id'],'WhatsappQueueId':_0x404fe7[_0x891a('0x50')]['id']},'transaction':_0x34fce1});});})[_0x891a('0x24')](function(){_0x386130[_0x891a('0x6b')](function(_0xb12bef){socket[_0x891a('0x6c')](_0x891a('0x6d'),{'UserId':_0xb12bef['id'],'WhatsappQueueId':_0x564da6['id']});});});});});}})['then'](respondWithStatusCode(_0x11bad1,null))[_0x891a('0x44')](handleError(_0x11bad1,null));};exports[_0x891a('0x6e')]=function(_0x1614dd,_0xf65372,_0x27988a){return db[_0x891a('0x5e')][_0x891a('0x42')]({'where':{'id':_0x1614dd[_0x891a('0x31')][_0x891a('0x61')]},'attributes':['id'],'include':[{'model':db[_0x891a('0x62')],'as':_0x891a('0x63'),'attributes':['id'],'raw':!![]}]})[_0x891a('0x24')](handleEntityNotFound(_0xf65372,null))['then'](function(_0xf63750){var _0x377a84=_[_0x891a('0x2b')](_0xf63750,'id');var _0x2b0ead=[];var _0x3f6d91=[];var _0x238d60=squel[_0x891a('0x6f')]();_0x238d60['field']('tq.TeamId')[_0x891a('0x70')](_0x891a('0x71'),'tq')[_0x891a('0x72')](_0x891a('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x891a('0x74'),_0x1614dd[_0x891a('0x50')]['id']);for(var _0x4aabe8=0x0;_0x4aabe8<_0xf63750[_0x891a('0x37')];_0x4aabe8+=0x1){let _0x3d6ac3=_0xf63750[_0x4aabe8];for(var _0x5590fd=0x0;_0x5590fd<_0x3d6ac3[_0x891a('0x63')][_0x891a('0x37')];_0x5590fd+=0x1){let _0x136914=_0x3d6ac3[_0x891a('0x63')][_0x5590fd];var _0x1d808b=_0x238d60[_0x891a('0x75')]();_0x1d808b[_0x891a('0x3a')](_0x891a('0x76'),_0x136914['id']);_0x3f6d91['push'](db['sequelize'][_0x891a('0x31')](_0x1d808b[_0x891a('0x77')](),{'type':db['sequelize'][_0x891a('0x78')][_0x891a('0x79')]})[_0x891a('0x24')](function(_0x315b4f){if(_0x315b4f[_0x891a('0x37')]===0x1){return _0x136914['id'];}else{var _0x203e87=_[_0x891a('0x7a')](_[_0x891a('0x2b')](_0x315b4f,_0x891a('0x7b')),function(_0x1d8c55){return _['includes'](_0x377a84,_0x1d8c55);});if(_0x203e87){return _0x136914['id'];}}}));}}return BPromise[_0x891a('0x7c')](_0x3f6d91)['then'](function(_0x569e88){_0x2b0ead=_(_0x2b0ead)[_0x891a('0x7d')](_0x569e88)['compact']()['value']();return db[_0x891a('0x2c')][_0x891a('0x45')]({'where':{'id':_0x1614dd[_0x891a('0x50')]['id']}})[_0x891a('0x24')](function(_0x54aedb){return db[_0x891a('0x68')][_0x891a('0x69')](function(_0x2d2c37){return _0x54aedb[_0x891a('0x6e')](_0x1614dd[_0x891a('0x31')][_0x891a('0x61')],{'transaction':_0x2d2c37})[_0x891a('0x24')](function(){if(!_[_0x891a('0x7e')](_0x2b0ead)){return _0x54aedb[_0x891a('0x7f')](_0x2b0ead,{'transaction':_0x2d2c37});}})[_0x891a('0x24')](function(){_0x2b0ead['forEach'](function(_0x587549){socket[_0x891a('0x6c')]('userWhatsappQueue:remove',{'UserId':_0x587549,'WhatsappQueueId':_0x54aedb['id']});});});});});});})[_0x891a('0x24')](respondWithStatusCode(_0xf65372,null))[_0x891a('0x44')](handleError(_0xf65372,null));};exports[_0x891a('0x80')]=function(_0x3a7169,_0x22e1d0,_0xfc1429){return db[_0x891a('0x2c')][_0x891a('0x45')]({'where':{'id':_0x3a7169['params']['id']}})[_0x891a('0x24')](handleEntityNotFound(_0x22e1d0,null))[_0x891a('0x24')](function(_0x109fd5){if(_0x109fd5){return _0x109fd5['addAgents'](_0x3a7169[_0x891a('0x47')][_0x891a('0x61')],_[_0x891a('0x81')](_0x3a7169[_0x891a('0x47')],[_0x891a('0x61'),'id'])||{})['spread'](function(_0x11a0f5){for(var _0x4f9481=0x0;_0x4f9481<_0x3a7169[_0x891a('0x47')][_0x891a('0x61')]['length'];_0x4f9481+=0x1){socket[_0x891a('0x6c')](_0x891a('0x6d'),{'UserId':Number(_0x3a7169['body']['ids'][_0x4f9481]),'WhatsappQueueId':Number(_0x3a7169['params']['id'])});}return _0x11a0f5;});}})[_0x891a('0x24')](respondWithResult(_0x22e1d0,null))[_0x891a('0x44')](handleError(_0x22e1d0,null));};exports[_0x891a('0x7f')]=function(_0x433491,_0x31cf27,_0x5e8bcc){return db[_0x891a('0x2c')][_0x891a('0x45')]({'where':{'id':_0x433491['params']['id']}})[_0x891a('0x24')](handleEntityNotFound(_0x31cf27,null))['then'](function(_0x50b91e){if(_0x50b91e){return _0x50b91e[_0x891a('0x7f')](_0x433491[_0x891a('0x31')][_0x891a('0x61')])[_0x891a('0x24')](function(){if(_[_0x891a('0x82')](_0x433491['query'][_0x891a('0x61')])){for(var _0x33fe97=0x0;_0x33fe97<_0x433491[_0x891a('0x31')]['ids'][_0x891a('0x37')];_0x33fe97+=0x1){socket[_0x891a('0x6c')](_0x891a('0x83'),{'UserId':Number(_0x433491[_0x891a('0x31')][_0x891a('0x61')][_0x33fe97]),'WhatsappQueueId':Number(_0x433491[_0x891a('0x50')]['id'])});}}else{socket[_0x891a('0x6c')]('userWhatsappQueue:remove',{'UserId':Number(_0x433491[_0x891a('0x31')][_0x891a('0x61')]),'WhatsappQueueId':Number(_0x433491[_0x891a('0x50')]['id'])});}});}})[_0x891a('0x24')](respondWithStatusCode(_0x31cf27,null))['catch'](handleError(_0x31cf27,null));};exports[_0x891a('0x84')]=function(_0x41151f,_0x13a999,_0x390d9c){var _0x108c5c={};var _0x4f48ae={};var _0x50236f;var _0x25d1cd;return db[_0x891a('0x2c')][_0x891a('0x53')]({'where':{'id':_0x41151f[_0x891a('0x50')]['id']}})[_0x891a('0x24')](handleEntityNotFound(_0x13a999,null))[_0x891a('0x24')](function(_0x24d8ba){if(_0x24d8ba){_0x50236f=_0x24d8ba;_0x4f48ae[_0x891a('0x30')]=_[_0x891a('0x32')](db['User'][_0x891a('0x2d')]);_0x4f48ae['query']=_[_0x891a('0x32')](_0x41151f[_0x891a('0x31')]);_0x4f48ae[_0x891a('0x33')]=_['intersection'](_0x4f48ae['model'],_0x4f48ae['query']);_0x108c5c['attributes']=_['intersection'](_0x4f48ae[_0x891a('0x30')],qs[_0x891a('0x36')](_0x41151f['query'][_0x891a('0x36')]));_0x108c5c['attributes']=_0x108c5c[_0x891a('0x35')][_0x891a('0x37')]?_0x108c5c[_0x891a('0x35')]:_0x4f48ae[_0x891a('0x30')];_0x108c5c[_0x891a('0x55')]=qs[_0x891a('0x39')](_0x41151f[_0x891a('0x31')]['sort']);_0x108c5c[_0x891a('0x3a')]=qs[_0x891a('0x33')](_[_0x891a('0x3b')](_0x41151f[_0x891a('0x31')],_0x4f48ae['filters']));if(_0x41151f[_0x891a('0x31')][_0x891a('0x3c')]){_0x108c5c[_0x891a('0x3a')]=_['merge'](_0x108c5c['where'],{'$or':_[_0x891a('0x2b')](_0x108c5c[_0x891a('0x35')],function(_0x1269f0){var _0x63218f={};_0x63218f[_0x1269f0]={'$like':'%'+_0x41151f['query'][_0x891a('0x3c')]+'%'};return _0x63218f;})});}_0x108c5c=_[_0x891a('0x3d')]({},_0x108c5c,_0x41151f['options']);return _0x50236f[_0x891a('0x84')](_0x108c5c);}})['then'](function(_0x49405f){if(_0x49405f){_0x25d1cd=_0x49405f['length'];if(!_0x41151f[_0x891a('0x31')][_0x891a('0x38')]('nolimit')){_0x108c5c[_0x891a('0x20')]=qs[_0x891a('0x20')](_0x41151f[_0x891a('0x31')]['limit']);_0x108c5c['offset']=qs[_0x891a('0x1e')](_0x41151f[_0x891a('0x31')][_0x891a('0x1e')]);}return _0x50236f['getAgents'](_0x108c5c);}})[_0x891a('0x24')](function(_0x31b42e){if(_0x31b42e){return _0x31b42e?{'count':_0x25d1cd,'rows':_0x31b42e}:null;}})[_0x891a('0x24')](respondWithResult(_0x13a999,null))[_0x891a('0x44')](handleError(_0x13a999,null));}; \ No newline at end of file +var _0x7427=['VIRTUAL','filter','options','include','catch','show','params','keys','rawAttributes','includeAll','find','user','role','WhatsappQueues','UserProfileSection','userProfileId','create','body','destroy','describe','getMembers','UserWhatsappQueue','hasOwnProperty','pick','WhatsappQueueId','findAll','User','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','count','format','%s/%s','SIP','findOne','Team','getTeams','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','end','json','offset','undefined','limit','status','set','apply','reject','update','then','get','UserProfileResource','sendStatus','stack','name','send','index','map','WhatsappQueue','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge'];(function(_0x1fe809,_0x315d3e){var _0x45ae6a=function(_0x47f2ce){while(--_0x47f2ce){_0x1fe809['push'](_0x1fe809['shift']());}};_0x45ae6a(++_0x315d3e);}(_0x7427,0xd5));var _0x7742=function(_0x383158,_0x415e43){_0x383158=_0x383158-0x0;var _0x507985=_0x7427[_0x383158];return _0x507985;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7742('0x0'));var zipdir=require(_0x7742('0x1'));var jsonpatch=require(_0x7742('0x2'));var rp=require('request-promise');var moment=require(_0x7742('0x3'));var BPromise=require(_0x7742('0x4'));var Mustache=require(_0x7742('0x5'));var util=require('util');var path=require(_0x7742('0x6'));var sox=require(_0x7742('0x7'));var csv=require('to-csv');var ejs=require(_0x7742('0x8'));var fs=require('fs');var fs_extra=require(_0x7742('0x9'));var _=require(_0x7742('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7742('0xb'));var deskjs=require(_0x7742('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7742('0xd'));var Papa=require(_0x7742('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7742('0xf'));var as=require(_0x7742('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7742('0x11'))(_0x7742('0x12'));var utils=require(_0x7742('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7742('0x14'))['db'];config['redis']=_[_0x7742('0x15')](config[_0x7742('0x16')],{'host':_0x7742('0x17'),'port':0x18eb});var socket=require(_0x7742('0x18'))(new Redis(config[_0x7742('0x16')]));require(_0x7742('0x19'))['register'](socket);function respondWithStatusCode(_0xe306eb,_0x15fe90){_0x15fe90=_0x15fe90||0xcc;return function(_0x106935){if(_0x106935){return _0xe306eb['sendStatus'](_0x15fe90);}return _0xe306eb['status'](_0x15fe90)[_0x7742('0x1a')]();};}function respondWithResult(_0x30a9b4,_0x9ad7a0){_0x9ad7a0=_0x9ad7a0||0xc8;return function(_0x5c5a0c){if(_0x5c5a0c){return _0x30a9b4['status'](_0x9ad7a0)[_0x7742('0x1b')](_0x5c5a0c);}};}function respondWithFilteredResult(_0x5bdca8,_0x101065){return function(_0x485ef4){if(_0x485ef4){var _0x23392f=typeof _0x101065[_0x7742('0x1c')]===_0x7742('0x1d')&&typeof _0x101065[_0x7742('0x1e')]===_0x7742('0x1d');var _0x138d31=_0x485ef4['count'];var _0x5c6d45=_0x23392f?0x0:_0x101065[_0x7742('0x1c')];var _0x3dcc81=_0x23392f?_0x485ef4['count']:_0x101065[_0x7742('0x1c')]+_0x101065[_0x7742('0x1e')];var _0xa961ed;if(_0x3dcc81>=_0x138d31){_0x3dcc81=_0x138d31;_0xa961ed=0xc8;}else{_0xa961ed=0xce;}_0x5bdca8[_0x7742('0x1f')](_0xa961ed);return _0x5bdca8[_0x7742('0x20')]('Content-Range',_0x5c6d45+'-'+_0x3dcc81+'/'+_0x138d31)[_0x7742('0x1b')](_0x485ef4);}return null;};}function patchUpdates(_0x3579fc){return function(_0x58c58b){try{jsonpatch[_0x7742('0x21')](_0x58c58b,_0x3579fc,!![]);}catch(_0x16276a){return BPromise[_0x7742('0x22')](_0x16276a);}return _0x58c58b['save']();};}function saveUpdates(_0x4744d7,_0x4a2218){return function(_0x48fa4f){if(_0x48fa4f){return _0x48fa4f[_0x7742('0x23')](_0x4744d7)[_0x7742('0x24')](function(_0x1e9ae9){return _0x1e9ae9;});}return null;};}function removeEntity(_0x4ca3c5,_0x16a8aa){return function(_0x3a62d3){if(_0x3a62d3){return _0x3a62d3['destroy']()[_0x7742('0x24')](function(){var _0x25d4cf=_0x3a62d3[_0x7742('0x25')]({'plain':!![]});var _0x83cc1a='WhatsappQueues';return db[_0x7742('0x26')]['destroy']({'where':{'type':_0x83cc1a,'resourceId':_0x25d4cf['id']}})['then'](function(){return _0x3a62d3;});})[_0x7742('0x24')](function(){_0x4ca3c5[_0x7742('0x1f')](0xcc)[_0x7742('0x1a')]();});}};}function handleEntityNotFound(_0x323168,_0x36780b){return function(_0x3c57ed){if(!_0x3c57ed){_0x323168[_0x7742('0x27')](0x194);}return _0x3c57ed;};}function handleError(_0x49b15a,_0x2e7c5c){_0x2e7c5c=_0x2e7c5c||0x1f4;return function(_0x4e4355){logger['error'](_0x4e4355[_0x7742('0x28')]);if(_0x4e4355[_0x7742('0x29')]){delete _0x4e4355[_0x7742('0x29')];}_0x49b15a[_0x7742('0x1f')](_0x2e7c5c)[_0x7742('0x2a')](_0x4e4355);};}exports[_0x7742('0x2b')]=function(_0x4ac2d4,_0x5b77bf){var _0x59f210={},_0x1d7cae={},_0x47a2aa={'count':0x0,'rows':[]};var _0x3f6f0c=_[_0x7742('0x2c')](db[_0x7742('0x2d')]['rawAttributes'],function(_0x337571){return{'name':_0x337571['fieldName'],'type':_0x337571['type'][_0x7742('0x2e')]};});_0x1d7cae[_0x7742('0x2f')]=_['map'](_0x3f6f0c,'name');_0x1d7cae[_0x7742('0x30')]=_['keys'](_0x4ac2d4[_0x7742('0x30')]);_0x1d7cae['filters']=_[_0x7742('0x31')](_0x1d7cae[_0x7742('0x2f')],_0x1d7cae[_0x7742('0x30')]);_0x59f210[_0x7742('0x32')]=_[_0x7742('0x31')](_0x1d7cae[_0x7742('0x2f')],qs[_0x7742('0x33')](_0x4ac2d4[_0x7742('0x30')]['fields']));_0x59f210[_0x7742('0x32')]=_0x59f210[_0x7742('0x32')][_0x7742('0x34')]?_0x59f210[_0x7742('0x32')]:_0x1d7cae[_0x7742('0x2f')];if(!_0x4ac2d4['query']['hasOwnProperty'](_0x7742('0x35'))){_0x59f210[_0x7742('0x1e')]=qs[_0x7742('0x1e')](_0x4ac2d4[_0x7742('0x30')][_0x7742('0x1e')]);_0x59f210[_0x7742('0x1c')]=qs[_0x7742('0x1c')](_0x4ac2d4['query'][_0x7742('0x1c')]);}_0x59f210[_0x7742('0x36')]=qs[_0x7742('0x37')](_0x4ac2d4[_0x7742('0x30')][_0x7742('0x37')]);_0x59f210[_0x7742('0x38')]=qs[_0x7742('0x39')](_['pick'](_0x4ac2d4[_0x7742('0x30')],_0x1d7cae[_0x7742('0x39')]),_0x3f6f0c);if(_0x4ac2d4[_0x7742('0x30')]['filter']){_0x59f210[_0x7742('0x38')]=_[_0x7742('0x3a')](_0x59f210[_0x7742('0x38')],{'$or':_['map'](_0x3f6f0c,function(_0x4a2e60){if(_0x4a2e60['type']!==_0x7742('0x3b')){var _0x4fc794={};_0x4fc794[_0x4a2e60[_0x7742('0x29')]]={'$like':'%'+_0x4ac2d4[_0x7742('0x30')][_0x7742('0x3c')]+'%'};return _0x4fc794;}})});}_0x59f210=_[_0x7742('0x3a')]({},_0x59f210,_0x4ac2d4[_0x7742('0x3d')]);var _0x529a28={'where':_0x59f210[_0x7742('0x38')]};return db[_0x7742('0x2d')]['count'](_0x529a28)[_0x7742('0x24')](function(_0x5e4782){_0x47a2aa['count']=_0x5e4782;if(_0x4ac2d4['query']['includeAll']){_0x59f210[_0x7742('0x3e')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x59f210);})[_0x7742('0x24')](function(_0x58add4){_0x47a2aa['rows']=_0x58add4;return _0x47a2aa;})[_0x7742('0x24')](respondWithFilteredResult(_0x5b77bf,_0x59f210))[_0x7742('0x3f')](handleError(_0x5b77bf,null));};exports[_0x7742('0x40')]=function(_0x1cc264,_0x3537a9){var _0x33424b={'raw':!![],'where':{'id':_0x1cc264[_0x7742('0x41')]['id']}},_0x1c59ba={};_0x1c59ba[_0x7742('0x2f')]=_[_0x7742('0x42')](db['WhatsappQueue'][_0x7742('0x43')]);_0x1c59ba[_0x7742('0x30')]=_[_0x7742('0x42')](_0x1cc264['query']);_0x1c59ba['filters']=_['intersection'](_0x1c59ba['model'],_0x1c59ba[_0x7742('0x30')]);_0x33424b[_0x7742('0x32')]=_[_0x7742('0x31')](_0x1c59ba[_0x7742('0x2f')],qs[_0x7742('0x33')](_0x1cc264[_0x7742('0x30')][_0x7742('0x33')]));_0x33424b['attributes']=_0x33424b['attributes'][_0x7742('0x34')]?_0x33424b['attributes']:_0x1c59ba['model'];if(_0x1cc264['query'][_0x7742('0x44')]){_0x33424b['include']=[{'all':!![]}];}_0x33424b=_[_0x7742('0x3a')]({},_0x33424b,_0x1cc264[_0x7742('0x3d')]);return db[_0x7742('0x2d')][_0x7742('0x45')](_0x33424b)[_0x7742('0x24')](handleEntityNotFound(_0x3537a9,null))[_0x7742('0x24')](respondWithResult(_0x3537a9,null))[_0x7742('0x3f')](handleError(_0x3537a9,null));};exports['create']=function(_0x162234,_0x20f0cb){return db['WhatsappQueue']['create'](_0x162234['body'],{})[_0x7742('0x24')](function(_0x464fab){var _0x11a9aa=_0x162234[_0x7742('0x46')]['get']({'plain':!![]});if(!_0x11a9aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11a9aa[_0x7742('0x47')]==='user'){var _0x2adcad=_0x464fab[_0x7742('0x25')]({'plain':!![]});var _0x9549d5=_0x7742('0x48');return db[_0x7742('0x49')][_0x7742('0x45')]({'where':{'name':_0x9549d5,'userProfileId':_0x11a9aa[_0x7742('0x4a')]},'raw':!![]})['then'](function(_0x427570){if(_0x427570&&_0x427570['autoAssociation']===0x0){return db[_0x7742('0x26')][_0x7742('0x4b')]({'name':_0x2adcad[_0x7742('0x29')],'resourceId':_0x2adcad['id'],'type':_0x427570['name'],'sectionId':_0x427570['id']},{})['then'](function(){return _0x464fab;});}else{return _0x464fab;}})[_0x7742('0x3f')](function(_0x587ef8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x587ef8);throw _0x587ef8;});}return _0x464fab;})['then'](respondWithResult(_0x20f0cb,0xc9))[_0x7742('0x3f')](handleError(_0x20f0cb,null));};exports['update']=function(_0x7d5ba,_0x4adfb0){if(_0x7d5ba['body']['id']){delete _0x7d5ba[_0x7742('0x4c')]['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x7d5ba[_0x7742('0x41')]['id']}})[_0x7742('0x24')](handleEntityNotFound(_0x4adfb0,null))[_0x7742('0x24')](saveUpdates(_0x7d5ba[_0x7742('0x4c')],null))[_0x7742('0x24')](respondWithResult(_0x4adfb0,null))[_0x7742('0x3f')](handleError(_0x4adfb0,null));};exports[_0x7742('0x4d')]=function(_0x59271b,_0x111193){return db['WhatsappQueue']['find']({'where':{'id':_0x59271b['params']['id']}})[_0x7742('0x24')](handleEntityNotFound(_0x111193,null))[_0x7742('0x24')](removeEntity(_0x111193,null))[_0x7742('0x3f')](handleError(_0x111193,null));};exports[_0x7742('0x4e')]=function(_0x51b185,_0x425dd7){return db[_0x7742('0x2d')]['describe']()[_0x7742('0x24')](respondWithResult(_0x425dd7,null))['catch'](handleError(_0x425dd7,null));};exports[_0x7742('0x4f')]=function(_0x4be22a,_0x1f5e76,_0xbb91c4){var _0x1286e7={'raw':!![],'where':{}},_0x4283e0={},_0x48bf71;return db[_0x7742('0x2d')]['findOne']({'where':{'id':_0x4be22a[_0x7742('0x41')]['id']}})[_0x7742('0x24')](handleEntityNotFound(_0x1f5e76,null))['then'](function(_0x10fc80){if(_0x10fc80){_0x48bf71=_0x10fc80[_0x7742('0x25')]({'plain':!![]});_0x4283e0[_0x7742('0x2f')]=_[_0x7742('0x42')](db[_0x7742('0x50')][_0x7742('0x43')]);_0x4283e0['query']=_[_0x7742('0x42')](_0x4be22a[_0x7742('0x30')]);_0x4283e0['filters']=_[_0x7742('0x31')](_0x4283e0[_0x7742('0x2f')],_0x4283e0[_0x7742('0x30')]);_0x1286e7[_0x7742('0x32')]=_[_0x7742('0x31')](_0x4283e0['model'],qs[_0x7742('0x33')](_0x4be22a[_0x7742('0x30')][_0x7742('0x33')]));_0x1286e7['attributes']=_0x1286e7['attributes'][_0x7742('0x34')]?_0x1286e7[_0x7742('0x32')]:_0x4283e0['model'];if(!_0x4be22a[_0x7742('0x30')][_0x7742('0x51')](_0x7742('0x35'))){_0x1286e7[_0x7742('0x1e')]=qs['limit'](_0x4be22a['query'][_0x7742('0x1e')]);_0x1286e7[_0x7742('0x1c')]=qs[_0x7742('0x1c')](_0x4be22a[_0x7742('0x30')][_0x7742('0x1c')]);}_0x1286e7['order']=qs[_0x7742('0x37')](_0x4be22a['query'][_0x7742('0x37')]);_0x1286e7[_0x7742('0x38')]=qs[_0x7742('0x39')](_[_0x7742('0x52')](_0x4be22a['query'],_0x4283e0[_0x7742('0x39')]));_0x1286e7[_0x7742('0x38')][_0x7742('0x53')]=_0x10fc80['id'];if(_0x4be22a[_0x7742('0x30')]['filter']){_0x1286e7['where']=_['merge'](_0x1286e7[_0x7742('0x38')],{'$or':_['map'](_0x1286e7[_0x7742('0x32')],function(_0x2a3b44){var _0x9bc5d4={};_0x9bc5d4[_0x2a3b44]={'$like':'%'+_0x4be22a[_0x7742('0x30')][_0x7742('0x3c')]+'%'};return _0x9bc5d4;})});}_0x1286e7=_[_0x7742('0x3a')]({},_0x1286e7,_0x4be22a[_0x7742('0x3d')]);return db[_0x7742('0x50')][_0x7742('0x54')](_0x1286e7);}})[_0x7742('0x24')](function(_0x4de128){if(_0x4de128){return db[_0x7742('0x55')][_0x7742('0x56')]({'where':{'id':_['map'](_0x4de128,'UserId'),'role':_0x7742('0x57')},'attributes':['id','name',_0x7742('0x58'),_0x7742('0x59'),_0x7742('0x5a')]});}})[_0x7742('0x24')](function(_0x26776c){if(_0x26776c){return{'count':_0x26776c[_0x7742('0x5b')],'rows':_[_0x7742('0x2c')](_0x26776c['rows'],function(_0x509b34){return{'membername':_0x509b34['name'],'UserId':_0x509b34['id'],'queue_name':_0x48bf71[_0x7742('0x29')],'WhatsappQueueId':_0x48bf71['id'],'interface':util[_0x7742('0x5c')](_0x7742('0x5d'),_0x7742('0x5e'),_0x509b34[_0x7742('0x29')]),'penalty':0x0,'paused':_0x509b34['whatsappPause'],'createdAt':_0x509b34[_0x7742('0x5a')],'updatedAt':_0x509b34['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7742('0x24')](respondWithFilteredResult(_0x1f5e76,_0x1286e7))['catch'](handleError(_0x1f5e76,null));};exports['getTeams']=function(_0x49eb4e,_0x5893bf,_0x1e5c25){var _0x477cd8={};var _0x257670={};var _0x69f3cc;var _0x537b2b;return db['WhatsappQueue'][_0x7742('0x5f')]({'where':{'id':_0x49eb4e['params']['id']}})[_0x7742('0x24')](handleEntityNotFound(_0x5893bf,null))[_0x7742('0x24')](function(_0x3f0787){if(_0x3f0787){_0x69f3cc=_0x3f0787;_0x257670[_0x7742('0x2f')]=_[_0x7742('0x42')](db[_0x7742('0x60')][_0x7742('0x43')]);_0x257670[_0x7742('0x30')]=_[_0x7742('0x42')](_0x49eb4e[_0x7742('0x30')]);_0x257670[_0x7742('0x39')]=_[_0x7742('0x31')](_0x257670[_0x7742('0x2f')],_0x257670['query']);_0x477cd8[_0x7742('0x32')]=_[_0x7742('0x31')](_0x257670[_0x7742('0x2f')],qs[_0x7742('0x33')](_0x49eb4e[_0x7742('0x30')][_0x7742('0x33')]));_0x477cd8[_0x7742('0x32')]=_0x477cd8[_0x7742('0x32')]['length']?_0x477cd8[_0x7742('0x32')]:_0x257670['model'];_0x477cd8[_0x7742('0x36')]=qs[_0x7742('0x37')](_0x49eb4e[_0x7742('0x30')][_0x7742('0x37')]);_0x477cd8[_0x7742('0x38')]=qs[_0x7742('0x39')](_[_0x7742('0x52')](_0x49eb4e[_0x7742('0x30')],_0x257670[_0x7742('0x39')]));if(_0x49eb4e[_0x7742('0x30')][_0x7742('0x3c')]){_0x477cd8[_0x7742('0x38')]=_['merge'](_0x477cd8[_0x7742('0x38')],{'$or':_[_0x7742('0x2c')](_0x477cd8[_0x7742('0x32')],function(_0x248fca){var _0x2c1f8c={};_0x2c1f8c[_0x248fca]={'$like':'%'+_0x49eb4e[_0x7742('0x30')][_0x7742('0x3c')]+'%'};return _0x2c1f8c;})});}_0x477cd8=_['merge']({},_0x477cd8,_0x49eb4e[_0x7742('0x3d')]);return _0x69f3cc[_0x7742('0x61')](_0x477cd8);}})[_0x7742('0x24')](function(_0x291205){if(_0x291205){_0x537b2b=_0x291205[_0x7742('0x34')];if(!_0x49eb4e[_0x7742('0x30')][_0x7742('0x51')]('nolimit')){_0x477cd8[_0x7742('0x1e')]=qs[_0x7742('0x1e')](_0x49eb4e[_0x7742('0x30')][_0x7742('0x1e')]);_0x477cd8[_0x7742('0x1c')]=qs[_0x7742('0x1c')](_0x49eb4e[_0x7742('0x30')][_0x7742('0x1c')]);}return _0x69f3cc['getTeams'](_0x477cd8);}})[_0x7742('0x24')](function(_0x14285c){if(_0x14285c){return _0x14285c?{'count':_0x537b2b,'rows':_0x14285c}:null;}})[_0x7742('0x24')](respondWithResult(_0x5893bf,null))[_0x7742('0x3f')](handleError(_0x5893bf,null));};exports[_0x7742('0x62')]=function(_0x3587f9,_0x58e041,_0x493df2){var _0x2d3042=_0x3587f9[_0x7742('0x4c')][_0x7742('0x63')];return db[_0x7742('0x60')]['findAll']({'where':{'id':_0x2d3042},'attributes':['id'],'include':[{'model':db[_0x7742('0x55')],'as':_0x7742('0x64'),'attributes':['id',_0x7742('0x29'),_0x7742('0x65'),_0x7742('0x66'),'interface'],'raw':!![]}]})[_0x7742('0x24')](function(_0x2afb50){if(_0x2afb50){var _0xfa3828=_[_0x7742('0x67')](_0x2afb50,function(_0x3f2d6d){var _0x3c0cec=_0x3f2d6d[_0x7742('0x25')]({'plain':!![]});return _0x3c0cec[_0x7742('0x64')];});return db[_0x7742('0x2d')][_0x7742('0x45')]({'where':{'id':_0x3587f9[_0x7742('0x41')]['id']}})[_0x7742('0x24')](function(_0xfc1783){return db[_0x7742('0x68')][_0x7742('0x69')](function(_0x365124){return _0xfc1783[_0x7742('0x62')](_0x2d3042,{'transaction':_0x365124})[_0x7742('0x24')](function(){return BPromise[_0x7742('0x6a')](_0xfa3828,function(_0x3005d2){return db[_0x7742('0x50')][_0x7742('0x6b')]({'where':{'UserId':_0x3005d2['id'],'WhatsappQueueId':_0x3587f9[_0x7742('0x41')]['id']},'transaction':_0x365124});});})[_0x7742('0x24')](function(){_0xfa3828[_0x7742('0x6c')](function(_0x763727){socket[_0x7742('0x6d')](_0x7742('0x6e'),{'UserId':_0x763727['id'],'WhatsappQueueId':_0xfc1783['id']});});});});});}})[_0x7742('0x24')](respondWithStatusCode(_0x58e041,null))[_0x7742('0x3f')](handleError(_0x58e041,null));};exports['removeTeams']=function(_0x4408b5,_0x32a01b,_0x349ff4){return db['Team'][_0x7742('0x54')]({'where':{'id':_0x4408b5[_0x7742('0x30')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7742('0x55')],'as':_0x7742('0x64'),'attributes':['id'],'raw':!![]}]})[_0x7742('0x24')](handleEntityNotFound(_0x32a01b,null))[_0x7742('0x24')](function(_0xfbed00){var _0x11a6c0=_[_0x7742('0x2c')](_0xfbed00,'id');var _0x195220=[];var _0x55f3f4=[];var _0x4be21f=squel['select']();_0x4be21f[_0x7742('0x6f')](_0x7742('0x70'))[_0x7742('0x71')](_0x7742('0x72'),'tq')[_0x7742('0x73')](_0x7742('0x74'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7742('0x38')]('WhatsappQueueId\x20=\x20?',_0x4408b5['params']['id']);for(var _0xbb15be=0x0;_0xbb15be<_0xfbed00[_0x7742('0x34')];_0xbb15be+=0x1){let _0x20307a=_0xfbed00[_0xbb15be];for(var _0x213783=0x0;_0x213783<_0x20307a['Agents'][_0x7742('0x34')];_0x213783+=0x1){let _0x2849cf=_0x20307a[_0x7742('0x64')][_0x213783];var _0x2163c1=_0x4be21f['clone']();_0x2163c1['where'](_0x7742('0x75'),_0x2849cf['id']);_0x55f3f4[_0x7742('0x76')](db[_0x7742('0x68')][_0x7742('0x30')](_0x2163c1[_0x7742('0x77')](),{'type':db['sequelize'][_0x7742('0x78')][_0x7742('0x79')]})[_0x7742('0x24')](function(_0x5b5324){if(_0x5b5324[_0x7742('0x34')]===0x1){return _0x2849cf['id'];}else{var _0x4a823f=_[_0x7742('0x7a')](_[_0x7742('0x2c')](_0x5b5324,_0x7742('0x7b')),function(_0x451735){return _[_0x7742('0x7c')](_0x11a6c0,_0x451735);});if(_0x4a823f){return _0x2849cf['id'];}}}));}}return BPromise[_0x7742('0x7d')](_0x55f3f4)[_0x7742('0x24')](function(_0xc88a10){_0x195220=_(_0x195220)['union'](_0xc88a10)[_0x7742('0x7e')]()[_0x7742('0x7f')]();return db[_0x7742('0x2d')]['find']({'where':{'id':_0x4408b5[_0x7742('0x41')]['id']}})[_0x7742('0x24')](function(_0x37cb88){return db[_0x7742('0x68')][_0x7742('0x69')](function(_0x3f36d9){return _0x37cb88[_0x7742('0x80')](_0x4408b5[_0x7742('0x30')][_0x7742('0x63')],{'transaction':_0x3f36d9})['then'](function(){if(!_[_0x7742('0x81')](_0x195220)){return _0x37cb88[_0x7742('0x82')](_0x195220,{'transaction':_0x3f36d9});}})[_0x7742('0x24')](function(){_0x195220[_0x7742('0x6c')](function(_0x5d75e3){socket[_0x7742('0x6d')](_0x7742('0x83'),{'UserId':_0x5d75e3,'WhatsappQueueId':_0x37cb88['id']});});});});});});})['then'](respondWithStatusCode(_0x32a01b,null))[_0x7742('0x3f')](handleError(_0x32a01b,null));};exports[_0x7742('0x84')]=function(_0x378c84,_0x360a5f,_0x25291e){return db[_0x7742('0x2d')][_0x7742('0x45')]({'where':{'id':_0x378c84[_0x7742('0x41')]['id']}})[_0x7742('0x24')](handleEntityNotFound(_0x360a5f,null))[_0x7742('0x24')](function(_0x215ed8){if(_0x215ed8){return _0x215ed8['addAgents'](_0x378c84[_0x7742('0x4c')][_0x7742('0x63')],_[_0x7742('0x85')](_0x378c84[_0x7742('0x4c')],[_0x7742('0x63'),'id'])||{})['spread'](function(_0x16d537){for(var _0x12af06=0x0;_0x12af06<_0x378c84[_0x7742('0x4c')][_0x7742('0x63')]['length'];_0x12af06+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':Number(_0x378c84['body'][_0x7742('0x63')][_0x12af06]),'WhatsappQueueId':Number(_0x378c84[_0x7742('0x41')]['id'])});}return _0x16d537;});}})[_0x7742('0x24')](respondWithResult(_0x360a5f,null))[_0x7742('0x3f')](handleError(_0x360a5f,null));};exports['removeAgents']=function(_0x389c4d,_0x224762,_0x139236){return db['WhatsappQueue']['find']({'where':{'id':_0x389c4d[_0x7742('0x41')]['id']}})[_0x7742('0x24')](handleEntityNotFound(_0x224762,null))[_0x7742('0x24')](function(_0x52aab2){if(_0x52aab2){return _0x52aab2[_0x7742('0x82')](_0x389c4d[_0x7742('0x30')]['ids'])[_0x7742('0x24')](function(){if(_[_0x7742('0x86')](_0x389c4d[_0x7742('0x30')]['ids'])){for(var _0x2de58f=0x0;_0x2de58f<_0x389c4d[_0x7742('0x30')][_0x7742('0x63')][_0x7742('0x34')];_0x2de58f+=0x1){socket[_0x7742('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0x389c4d['query']['ids'][_0x2de58f]),'WhatsappQueueId':Number(_0x389c4d['params']['id'])});}}else{socket[_0x7742('0x6d')](_0x7742('0x83'),{'UserId':Number(_0x389c4d[_0x7742('0x30')][_0x7742('0x63')]),'WhatsappQueueId':Number(_0x389c4d[_0x7742('0x41')]['id'])});}});}})[_0x7742('0x24')](respondWithStatusCode(_0x224762,null))['catch'](handleError(_0x224762,null));};exports[_0x7742('0x87')]=function(_0x343ee6,_0x182f49,_0x252670){var _0xb7708f={};var _0x556fe1={};var _0xa93f17;var _0x2039a9;return db[_0x7742('0x2d')]['findOne']({'where':{'id':_0x343ee6['params']['id']}})[_0x7742('0x24')](handleEntityNotFound(_0x182f49,null))[_0x7742('0x24')](function(_0xa3c3f8){if(_0xa3c3f8){_0xa93f17=_0xa3c3f8;_0x556fe1[_0x7742('0x2f')]=_[_0x7742('0x42')](db[_0x7742('0x55')][_0x7742('0x43')]);_0x556fe1[_0x7742('0x30')]=_[_0x7742('0x42')](_0x343ee6[_0x7742('0x30')]);_0x556fe1[_0x7742('0x39')]=_[_0x7742('0x31')](_0x556fe1[_0x7742('0x2f')],_0x556fe1[_0x7742('0x30')]);_0xb7708f[_0x7742('0x32')]=_[_0x7742('0x31')](_0x556fe1[_0x7742('0x2f')],qs[_0x7742('0x33')](_0x343ee6['query'][_0x7742('0x33')]));_0xb7708f[_0x7742('0x32')]=_0xb7708f['attributes']['length']?_0xb7708f[_0x7742('0x32')]:_0x556fe1[_0x7742('0x2f')];_0xb7708f['order']=qs[_0x7742('0x37')](_0x343ee6['query'][_0x7742('0x37')]);_0xb7708f[_0x7742('0x38')]=qs[_0x7742('0x39')](_[_0x7742('0x52')](_0x343ee6[_0x7742('0x30')],_0x556fe1[_0x7742('0x39')]));if(_0x343ee6['query'][_0x7742('0x3c')]){_0xb7708f[_0x7742('0x38')]=_[_0x7742('0x3a')](_0xb7708f[_0x7742('0x38')],{'$or':_[_0x7742('0x2c')](_0xb7708f[_0x7742('0x32')],function(_0x28972c){var _0x1244c3={};_0x1244c3[_0x28972c]={'$like':'%'+_0x343ee6[_0x7742('0x30')][_0x7742('0x3c')]+'%'};return _0x1244c3;})});}_0xb7708f=_['merge']({},_0xb7708f,_0x343ee6[_0x7742('0x3d')]);return _0xa93f17[_0x7742('0x87')](_0xb7708f);}})['then'](function(_0x40efc9){if(_0x40efc9){_0x2039a9=_0x40efc9['length'];if(!_0x343ee6['query'][_0x7742('0x51')](_0x7742('0x35'))){_0xb7708f[_0x7742('0x1e')]=qs[_0x7742('0x1e')](_0x343ee6['query'][_0x7742('0x1e')]);_0xb7708f[_0x7742('0x1c')]=qs['offset'](_0x343ee6[_0x7742('0x30')][_0x7742('0x1c')]);}return _0xa93f17[_0x7742('0x87')](_0xb7708f);}})[_0x7742('0x24')](function(_0x27b3f9){if(_0x27b3f9){return _0x27b3f9?{'count':_0x2039a9,'rows':_0x27b3f9}:null;}})[_0x7742('0x24')](respondWithResult(_0x182f49,null))[_0x7742('0x3f')](handleError(_0x182f49,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 758d2c8..104ac01 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 _0x326a=['WhatsappQueue','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x15dbca,_0x1d7c3c){var _0x326533=function(_0x507ee2){while(--_0x507ee2){_0x15dbca['push'](_0x15dbca['shift']());}};_0x326533(++_0x1d7c3c);}(_0x326a,0x180));var _0xa326=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x326a[_0x7e2eb0];return _0xd92de4;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xa326('0x0'))['db'][_0xa326('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa326('0x2'),'afterDestroy':'remove'};function emitEvent(_0x473089){return function(_0x596bea,_0x2201c8,_0x26a1b4){WhatsappQueueEvents[_0xa326('0x3')](_0x473089+':'+_0x596bea['id'],_0x596bea);WhatsappQueueEvents[_0xa326('0x3')](_0x473089,_0x596bea);_0x26a1b4(null);};}for(var e in events){if(events[_0xa326('0x4')](e)){var event=events[e];WhatsappQueue[_0xa326('0x5')](e,emitEvent(event));}}module[_0xa326('0x6')]=WhatsappQueueEvents; \ No newline at end of file +var _0x8f04=['hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x510175,_0x2d8316){var _0x1aef82=function(_0x249e4e){while(--_0x249e4e){_0x510175['push'](_0x510175['shift']());}};_0x1aef82(++_0x2d8316);}(_0x8f04,0x6b));var _0x48f0=function(_0x126670,_0x913215){_0x126670=_0x126670-0x0;var _0x5b2a0a=_0x8f04[_0x126670];return _0x5b2a0a;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x48f0('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x48f0('0x1')](0x0);var events={'afterCreate':_0x48f0('0x2'),'afterUpdate':_0x48f0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x6e088f){return function(_0x548a21,_0x29a25b,_0x4bc0e1){WhatsappQueueEvents[_0x48f0('0x4')](_0x6e088f+':'+_0x548a21['id'],_0x548a21);WhatsappQueueEvents[_0x48f0('0x4')](_0x6e088f,_0x548a21);_0x4bc0e1(null);};}for(var e in events){if(events[_0x48f0('0x5')](e)){var event=events[e];WhatsappQueue[_0x48f0('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 3289112..13d0c4c 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 _0x4216=['path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','util','api','moment','bluebird','request-promise'];(function(_0x56eba7,_0x40be8b){var _0x38a131=function(_0x30c790){while(--_0x30c790){_0x56eba7['push'](_0x56eba7['shift']());}};_0x38a131(++_0x40be8b);}(_0x4216,0x19f));var _0x6421=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4216[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x6421('0x0'));var logger=require('../../config/logger')(_0x6421('0x1'));var moment=require(_0x6421('0x2'));var BPromise=require(_0x6421('0x3'));var rp=require(_0x6421('0x4'));var fs=require('fs');var path=require(_0x6421('0x5'));var rimraf=require(_0x6421('0x6'));var config=require(_0x6421('0x7'));var attributes=require(_0x6421('0x8'));module[_0x6421('0x9')]=function(_0x5019d5,_0x193904){return _0x5019d5[_0x6421('0xa')](_0x6421('0xb'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15f6=['request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','util','../../config/logger','api','bluebird'];(function(_0x454ade,_0x41af23){var _0xe50fed=function(_0x1afd67){while(--_0x1afd67){_0x454ade['push'](_0x454ade['shift']());}};_0xe50fed(++_0x41af23);}(_0x15f6,0xdf));var _0x615f=function(_0x518974,_0x3ea954){_0x518974=_0x518974-0x0;var _0x4e937e=_0x15f6[_0x518974];return _0x4e937e;};'use strict';var _=require(_0x615f('0x0'));var util=require(_0x615f('0x1'));var logger=require(_0x615f('0x2'))(_0x615f('0x3'));var moment=require('moment');var BPromise=require(_0x615f('0x4'));var rp=require(_0x615f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x615f('0x6'));var config=require(_0x615f('0x7'));var attributes=require(_0x615f('0x8'));module[_0x615f('0x9')]=function(_0x4301ea,_0x4622b5){return _0x4301ea[_0x615f('0xa')](_0x615f('0xb'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index cbf1024..f67909b 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 _0x9802=['model','attributes','map','stringify','ShowWhatsappQueue','WhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','WhatsappQueue,\x20%s,\x20%s','message','info','result','catch','GetWhatsappQueue','findAll','raw','options','where','limit','include'];(function(_0x320f68,_0x4b96c1){var _0x4e2c15=function(_0xba55f3){while(--_0xba55f3){_0x320f68['push'](_0x320f68['shift']());}};_0x4e2c15(++_0x4b96c1);}(_0x9802,0x8b));var _0x2980=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9802[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x2980('0x0'));var util=require(_0x2980('0x1'));var moment=require(_0x2980('0x2'));var BPromise=require(_0x2980('0x3'));var rs=require(_0x2980('0x4'));var fs=require('fs');var Redis=require(_0x2980('0x5'));var db=require(_0x2980('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2980('0x7'))(_0x2980('0x8'));var config=require('../../config/environment');var jayson=require(_0x2980('0x9'));var client=jayson[_0x2980('0xa')][_0x2980('0xb')]({'port':0x232a});config[_0x2980('0xc')]=_[_0x2980('0xd')](config['redis'],{'host':_0x2980('0xe'),'port':0x18eb});var socket=require(_0x2980('0xf'))(new Redis(config[_0x2980('0xc')]));require(_0x2980('0x10'))[_0x2980('0x11')](socket);function respondWithRpcPromise(_0x1432ce,_0x1e2f10,_0x504c3d){return new BPromise(function(_0x309814,_0x537bff){return client[_0x2980('0x12')](_0x1432ce,_0x504c3d)[_0x2980('0x13')](function(_0x1b8beb){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x1e2f10,_0x2980('0x14'));logger[_0x2980('0x15')](_0x2980('0x16'),_0x1e2f10,_0x2980('0x14'),JSON['stringify'](_0x1b8beb));if(_0x1b8beb[_0x2980('0x17')]){if(_0x1b8beb[_0x2980('0x17')][_0x2980('0x18')]===0x1f4){logger['error'](_0x2980('0x19'),_0x1e2f10,_0x1b8beb[_0x2980('0x17')][_0x2980('0x1a')]);return _0x537bff(_0x1b8beb[_0x2980('0x17')]['message']);}logger[_0x2980('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x1e2f10,_0x1b8beb[_0x2980('0x17')][_0x2980('0x1a')]);return _0x309814(_0x1b8beb[_0x2980('0x17')][_0x2980('0x1a')]);}else{logger[_0x2980('0x1b')](_0x2980('0x19'),_0x1e2f10,_0x2980('0x14'));_0x309814(_0x1b8beb[_0x2980('0x1c')][_0x2980('0x1a')]);}})[_0x2980('0x1d')](function(_0x216570){logger[_0x2980('0x17')](_0x2980('0x19'),_0x1e2f10,_0x216570);_0x537bff(_0x216570);});});}exports[_0x2980('0x1e')]=function(_0x33a9b7){var _0x16443e=this;return new Promise(function(_0x374960,_0x1ad4bb){return db['WhatsappQueue'][_0x2980('0x1f')]({'raw':_0x33a9b7['options']?_0x33a9b7['options'][_0x2980('0x20')]===undefined?!![]:![]:!![],'where':_0x33a9b7[_0x2980('0x21')]?_0x33a9b7[_0x2980('0x21')][_0x2980('0x22')]||null:null,'attributes':_0x33a9b7[_0x2980('0x21')]?_0x33a9b7[_0x2980('0x21')]['attributes']||null:null,'limit':_0x33a9b7[_0x2980('0x21')]?_0x33a9b7[_0x2980('0x21')][_0x2980('0x23')]||null:null,'include':_0x33a9b7[_0x2980('0x21')]?_0x33a9b7['options'][_0x2980('0x24')]?_['map'](_0x33a9b7[_0x2980('0x21')][_0x2980('0x24')],function(_0xd0258f){return{'model':db[_0xd0258f[_0x2980('0x25')]],'as':_0xd0258f['as'],'attributes':_0xd0258f[_0x2980('0x26')],'include':_0xd0258f[_0x2980('0x24')]?_[_0x2980('0x27')](_0xd0258f[_0x2980('0x24')],function(_0x1e877e){return{'model':db[_0x1e877e[_0x2980('0x25')]],'as':_0x1e877e['as'],'attributes':_0x1e877e[_0x2980('0x26')],'include':_0x1e877e[_0x2980('0x24')]?_[_0x2980('0x27')](_0x1e877e[_0x2980('0x24')],function(_0xe4a6f5){return{'model':db[_0xe4a6f5[_0x2980('0x25')]],'as':_0xe4a6f5['as'],'attributes':_0xe4a6f5[_0x2980('0x26')]};}):[]};}):[]};}):[]:[]})[_0x2980('0x13')](function(_0xa0f175){logger[_0x2980('0x1b')](_0x2980('0x1e'),_0x33a9b7);logger[_0x2980('0x15')](_0x2980('0x1e'),_0x33a9b7,JSON[_0x2980('0x28')](_0xa0f175));_0x374960(_0xa0f175);})[_0x2980('0x1d')](function(_0x3a1bb2){logger[_0x2980('0x17')](_0x2980('0x1e'),_0x3a1bb2[_0x2980('0x1a')],_0x33a9b7);_0x1ad4bb(_0x16443e[_0x2980('0x17')](0x1f4,_0x3a1bb2[_0x2980('0x1a')]));});});};exports[_0x2980('0x29')]=function(_0x50054c){var _0x2c8717=this;return new Promise(function(_0x44a870,_0x10268c){return db[_0x2980('0x2a')][_0x2980('0x2b')]({'raw':_0x50054c['options']?_0x50054c[_0x2980('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x50054c[_0x2980('0x21')]?_0x50054c[_0x2980('0x21')]['where']||null:null,'attributes':_0x50054c['options']?_0x50054c[_0x2980('0x21')][_0x2980('0x26')]||null:null,'include':_0x50054c['options']?_0x50054c['options'][_0x2980('0x24')]?_[_0x2980('0x27')](_0x50054c[_0x2980('0x21')][_0x2980('0x24')],function(_0x1f6e8d){return{'model':db[_0x1f6e8d['model']],'as':_0x1f6e8d['as'],'attributes':_0x1f6e8d[_0x2980('0x26')],'include':_0x1f6e8d[_0x2980('0x24')]?_[_0x2980('0x27')](_0x1f6e8d[_0x2980('0x24')],function(_0x1170b9){return{'model':db[_0x1170b9[_0x2980('0x25')]],'as':_0x1170b9['as'],'attributes':_0x1170b9['attributes'],'include':_0x1170b9['include']?_[_0x2980('0x27')](_0x1170b9[_0x2980('0x24')],function(_0x2c11a3){return{'model':db[_0x2c11a3[_0x2980('0x25')]],'as':_0x2c11a3['as'],'attributes':_0x2c11a3[_0x2980('0x26')]};}):[]};}):[]};}):[]:[]})[_0x2980('0x13')](function(_0x320264){logger[_0x2980('0x1b')](_0x2980('0x29'),_0x50054c);logger[_0x2980('0x15')](_0x2980('0x29'),_0x50054c,JSON['stringify'](_0x320264));_0x44a870(_0x320264);})[_0x2980('0x1d')](function(_0x59a2f3){logger[_0x2980('0x17')](_0x2980('0x29'),_0x59a2f3[_0x2980('0x1a')],_0x50054c);_0x10268c(_0x2c8717[_0x2980('0x17')](0x1f4,_0x59a2f3['message']));});});}; \ No newline at end of file +var _0x6ea3=['map','model','attributes','info','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','include'];(function(_0x359b75,_0x36340b){var _0x54c10b=function(_0x3f4132){while(--_0x3f4132){_0x359b75['push'](_0x359b75['shift']());}};_0x54c10b(++_0x36340b);}(_0x6ea3,0x146));var _0x36ea=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x6ea3[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0x36ea('0x0'));var util=require(_0x36ea('0x1'));var moment=require(_0x36ea('0x2'));var BPromise=require(_0x36ea('0x3'));var rs=require(_0x36ea('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x36ea('0x5'))['db'];var utils=require(_0x36ea('0x6'));var logger=require(_0x36ea('0x7'))(_0x36ea('0x8'));var config=require(_0x36ea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x36ea('0xa')][_0x36ea('0xb')]({'port':0x232a});config['redis']=_[_0x36ea('0xc')](config[_0x36ea('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x36ea('0xe'))(new Redis(config[_0x36ea('0xd')]));require(_0x36ea('0xf'))[_0x36ea('0x10')](socket);function respondWithRpcPromise(_0x597906,_0x77419d,_0x52f1ec){return new BPromise(function(_0x39e7e5,_0x1ae587){return client[_0x36ea('0x11')](_0x597906,_0x52f1ec)[_0x36ea('0x12')](function(_0x4eda6f){logger['info'](_0x36ea('0x13'),_0x77419d,_0x36ea('0x14'));logger[_0x36ea('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x77419d,_0x36ea('0x14'),JSON[_0x36ea('0x16')](_0x4eda6f));if(_0x4eda6f[_0x36ea('0x17')]){if(_0x4eda6f['error'][_0x36ea('0x18')]===0x1f4){logger[_0x36ea('0x17')](_0x36ea('0x13'),_0x77419d,_0x4eda6f[_0x36ea('0x17')][_0x36ea('0x19')]);return _0x1ae587(_0x4eda6f[_0x36ea('0x17')][_0x36ea('0x19')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x77419d,_0x4eda6f[_0x36ea('0x17')][_0x36ea('0x19')]);return _0x39e7e5(_0x4eda6f[_0x36ea('0x17')][_0x36ea('0x19')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x77419d,_0x36ea('0x14'));_0x39e7e5(_0x4eda6f[_0x36ea('0x1a')]['message']);}})[_0x36ea('0x1b')](function(_0xdb7d70){logger[_0x36ea('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x77419d,_0xdb7d70);_0x1ae587(_0xdb7d70);});});}exports[_0x36ea('0x1c')]=function(_0x1db6a4){var _0x1c9b2b=this;return new Promise(function(_0x1fa9a4,_0x10b737){return db[_0x36ea('0x1d')]['findAll']({'raw':_0x1db6a4[_0x36ea('0x1e')]?_0x1db6a4[_0x36ea('0x1e')][_0x36ea('0x1f')]===undefined?!![]:![]:!![],'where':_0x1db6a4[_0x36ea('0x1e')]?_0x1db6a4[_0x36ea('0x1e')][_0x36ea('0x20')]||null:null,'attributes':_0x1db6a4[_0x36ea('0x1e')]?_0x1db6a4[_0x36ea('0x1e')]['attributes']||null:null,'limit':_0x1db6a4[_0x36ea('0x1e')]?_0x1db6a4[_0x36ea('0x1e')]['limit']||null:null,'include':_0x1db6a4[_0x36ea('0x1e')]?_0x1db6a4[_0x36ea('0x1e')][_0x36ea('0x21')]?_[_0x36ea('0x22')](_0x1db6a4[_0x36ea('0x1e')][_0x36ea('0x21')],function(_0xc68bd0){return{'model':db[_0xc68bd0[_0x36ea('0x23')]],'as':_0xc68bd0['as'],'attributes':_0xc68bd0['attributes'],'include':_0xc68bd0[_0x36ea('0x21')]?_['map'](_0xc68bd0[_0x36ea('0x21')],function(_0x15af1e){return{'model':db[_0x15af1e[_0x36ea('0x23')]],'as':_0x15af1e['as'],'attributes':_0x15af1e['attributes'],'include':_0x15af1e['include']?_[_0x36ea('0x22')](_0x15af1e[_0x36ea('0x21')],function(_0x38369a){return{'model':db[_0x38369a[_0x36ea('0x23')]],'as':_0x38369a['as'],'attributes':_0x38369a[_0x36ea('0x24')]};}):[]};}):[]};}):[]:[]})[_0x36ea('0x12')](function(_0x228c3d){logger[_0x36ea('0x25')](_0x36ea('0x1c'),_0x1db6a4);logger[_0x36ea('0x15')](_0x36ea('0x1c'),_0x1db6a4,JSON[_0x36ea('0x16')](_0x228c3d));_0x1fa9a4(_0x228c3d);})['catch'](function(_0x3e6f07){logger[_0x36ea('0x17')](_0x36ea('0x1c'),_0x3e6f07['message'],_0x1db6a4);_0x10b737(_0x1c9b2b[_0x36ea('0x17')](0x1f4,_0x3e6f07[_0x36ea('0x19')]));});});};exports[_0x36ea('0x26')]=function(_0x3235d8){var _0x34b902=this;return new Promise(function(_0x55f29d,_0x1d59f0){return db['WhatsappQueue'][_0x36ea('0x27')]({'raw':_0x3235d8[_0x36ea('0x1e')]?_0x3235d8[_0x36ea('0x1e')][_0x36ea('0x1f')]===undefined?!![]:![]:!![],'where':_0x3235d8['options']?_0x3235d8[_0x36ea('0x1e')]['where']||null:null,'attributes':_0x3235d8[_0x36ea('0x1e')]?_0x3235d8[_0x36ea('0x1e')][_0x36ea('0x24')]||null:null,'include':_0x3235d8[_0x36ea('0x1e')]?_0x3235d8[_0x36ea('0x1e')][_0x36ea('0x21')]?_[_0x36ea('0x22')](_0x3235d8[_0x36ea('0x1e')][_0x36ea('0x21')],function(_0x4272e2){return{'model':db[_0x4272e2[_0x36ea('0x23')]],'as':_0x4272e2['as'],'attributes':_0x4272e2[_0x36ea('0x24')],'include':_0x4272e2['include']?_[_0x36ea('0x22')](_0x4272e2[_0x36ea('0x21')],function(_0x53bd0c){return{'model':db[_0x53bd0c[_0x36ea('0x23')]],'as':_0x53bd0c['as'],'attributes':_0x53bd0c[_0x36ea('0x24')],'include':_0x53bd0c[_0x36ea('0x21')]?_[_0x36ea('0x22')](_0x53bd0c[_0x36ea('0x21')],function(_0x2d5dad){return{'model':db[_0x2d5dad[_0x36ea('0x23')]],'as':_0x2d5dad['as'],'attributes':_0x2d5dad[_0x36ea('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x159089){logger[_0x36ea('0x25')](_0x36ea('0x26'),_0x3235d8);logger[_0x36ea('0x15')](_0x36ea('0x26'),_0x3235d8,JSON['stringify'](_0x159089));_0x55f29d(_0x159089);})[_0x36ea('0x1b')](function(_0x20b2d2){logger[_0x36ea('0x17')](_0x36ea('0x26'),_0x20b2d2['message'],_0x3235d8);_0x1d59f0(_0x34b902[_0x36ea('0x17')](0x1f4,_0x20b2d2[_0x36ea('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index c5e99f4..ae2c609 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 _0x7fc6=['./whatsappQueue.events','save','update','emit','length','whatsappQueue:'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x7fc6,0x180));var _0x67fc=function(_0x244604,_0x3b8e5f){_0x244604=_0x244604-0x0;var _0x1a51b8=_0x7fc6[_0x244604];return _0x1a51b8;};'use strict';var WhatsappQueueEvents=require(_0x67fc('0x0'));var events=[_0x67fc('0x1'),'remove',_0x67fc('0x2')];function createListener(_0x1fdd7e,_0x41fd0e){return function(_0x38e283){_0x41fd0e[_0x67fc('0x3')](_0x1fdd7e,_0x38e283);};}function removeListener(_0xb71c3c,_0x541e20){return function(){WhatsappQueueEvents['removeListener'](_0xb71c3c,_0x541e20);};}exports['register']=function(_0x16280c){for(var _0x201dc7=0x0,_0x29e39e=events[_0x67fc('0x4')];_0x201dc7<_0x29e39e;_0x201dc7++){var _0x12d1bc=events[_0x201dc7];var _0x33d53a=createListener(_0x67fc('0x5')+_0x12d1bc,_0x16280c);WhatsappQueueEvents['on'](_0x12d1bc,_0x33d53a);}}; \ No newline at end of file +var _0xc8fa=['whatsappQueue:','./whatsappQueue.events','remove','update','emit','removeListener'];(function(_0x2415b7,_0x513710){var _0x1adac3=function(_0x4e1177){while(--_0x4e1177){_0x2415b7['push'](_0x2415b7['shift']());}};_0x1adac3(++_0x513710);}(_0xc8fa,0xf7));var _0xac8f=function(_0x32fe12,_0x32f64d){_0x32fe12=_0x32fe12-0x0;var _0x5346d4=_0xc8fa[_0x32fe12];return _0x5346d4;};'use strict';var WhatsappQueueEvents=require(_0xac8f('0x0'));var events=['save',_0xac8f('0x1'),_0xac8f('0x2')];function createListener(_0x27a536,_0x3c56b0){return function(_0x36819f){_0x3c56b0[_0xac8f('0x3')](_0x27a536,_0x36819f);};}function removeListener(_0xb21d3e,_0xf62cbd){return function(){WhatsappQueueEvents[_0xac8f('0x4')](_0xb21d3e,_0xf62cbd);};}exports['register']=function(_0x44fe12){for(var _0x169742=0x0,_0x439ef6=events['length'];_0x169742<_0x439ef6;_0x169742++){var _0x42f9e5=events[_0x169742];var _0xd23612=createListener(_0xac8f('0x5')+_0x42f9e5,_0x44fe12);WhatsappQueueEvents['on'](_0x42f9e5,_0xd23612);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 2dd0e1b..eb23126 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 _0x4d76=['destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete'];(function(_0x16b4c8,_0x330cbf){var _0x37ff11=function(_0x2e3031){while(--_0x2e3031){_0x16b4c8['push'](_0x16b4c8['shift']());}};_0x37ff11(++_0x330cbf);}(_0x4d76,0xd2));var _0x64d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d76[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x64d7('0x0'));var path=require(_0x64d7('0x1'));var timeout=require('connect-timeout');var express=require(_0x64d7('0x2'));var router=express['Router']();var fs_extra=require(_0x64d7('0x3'));var auth=require(_0x64d7('0x4'));var interaction=require(_0x64d7('0x5'));var config=require(_0x64d7('0x6'));var controller=require(_0x64d7('0x7'));router[_0x64d7('0x8')]('/',auth[_0x64d7('0x9')](),controller[_0x64d7('0xa')]);router[_0x64d7('0x8')](_0x64d7('0xb'),auth[_0x64d7('0x9')](),controller['describe']);router['get'](_0x64d7('0xc'),auth['isAuthenticated'](),controller[_0x64d7('0xd')]);router[_0x64d7('0xe')]('/',auth[_0x64d7('0x9')](),controller[_0x64d7('0xf')]);router['put'](_0x64d7('0xc'),auth[_0x64d7('0x9')](),controller[_0x64d7('0x10')]);router[_0x64d7('0x11')](_0x64d7('0xc'),auth[_0x64d7('0x9')](),controller[_0x64d7('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8f92=['util','path','express','Router','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x5149a7,_0x1f1ef9){var _0x1e04bb=function(_0x2892f9){while(--_0x2892f9){_0x5149a7['push'](_0x5149a7['shift']());}};_0x1e04bb(++_0x1f1ef9);}(_0x8f92,0x8c));var _0x28f9=function(_0x2db30b,_0x740f15){_0x2db30b=_0x2db30b-0x0;var _0x2db253=_0x8f92[_0x2db30b];return _0x2db253;};'use strict';var multer=require('multer');var util=require(_0x28f9('0x0'));var path=require(_0x28f9('0x1'));var timeout=require('connect-timeout');var express=require(_0x28f9('0x2'));var router=express[_0x28f9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x28f9('0x4'));var config=require(_0x28f9('0x5'));var controller=require(_0x28f9('0x6'));router[_0x28f9('0x7')]('/',auth[_0x28f9('0x8')](),controller[_0x28f9('0x9')]);router[_0x28f9('0x7')](_0x28f9('0xa'),auth['isAuthenticated'](),controller[_0x28f9('0xb')]);router['get'](_0x28f9('0xc'),auth[_0x28f9('0x8')](),controller[_0x28f9('0xd')]);router[_0x28f9('0xe')]('/',auth['isAuthenticated'](),controller[_0x28f9('0xf')]);router[_0x28f9('0x10')]('/:id',auth[_0x28f9('0x8')](),controller['update']);router[_0x28f9('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x28f9('0x12')]);module[_0x28f9('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index a3326c8..72d0a6f 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(_0xda90d7,_0x2f62f5){var _0x520af6=function(_0x416dca){while(--_0x416dca){_0xda90d7['push'](_0xda90d7['shift']());}};_0x520af6(++_0x2f62f5);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0xd9488c,_0x55c332){var _0x4d9473=function(_0x4c203d){while(--_0x4c203d){_0xd9488c['push'](_0xd9488c['shift']());}};_0x4d9473(++_0x55c332);}(_0x7a54,0x106));var _0x47a5=function(_0x31309f,_0x3ff030){_0x31309f=_0x31309f-0x0;var _0x3aa3fe=_0x7a54[_0x31309f];return _0x3aa3fe;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index ce9230f..fed0e53 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 _0x4e81=['limit','count','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','WhatsappQueueReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4e81,0x1bc));var _0x14e8=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0x4e81[_0x5a5395];return _0x4da43d;};'use strict';var emlformat=require(_0x14e8('0x0'));var rimraf=require(_0x14e8('0x1'));var zipdir=require(_0x14e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14e8('0x3'));var Mustache=require(_0x14e8('0x4'));var util=require(_0x14e8('0x5'));var path=require(_0x14e8('0x6'));var sox=require(_0x14e8('0x7'));var csv=require(_0x14e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0x8'));var querystring=require(_0x14e8('0xe'));var Papa=require(_0x14e8('0xf'));var Redis=require(_0x14e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x11'));var as=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var licenseUtil=require(_0x14e8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37eccb,_0x59c6c9){_0x59c6c9=_0x59c6c9||0xcc;return function(_0x2607ef){if(_0x2607ef){return _0x37eccb[_0x14e8('0x19')](_0x59c6c9);}return _0x37eccb[_0x14e8('0x1a')](_0x59c6c9)['end']();};}function respondWithResult(_0x22fa86,_0x4e1064){_0x4e1064=_0x4e1064||0xc8;return function(_0x458e4a){if(_0x458e4a){return _0x22fa86['status'](_0x4e1064)[_0x14e8('0x1b')](_0x458e4a);}};}function respondWithFilteredResult(_0x3761a1,_0xc6101f){return function(_0x135996){if(_0x135996){var _0x52e64f=typeof _0xc6101f[_0x14e8('0x1c')]===_0x14e8('0x1d')&&typeof _0xc6101f[_0x14e8('0x1e')]===_0x14e8('0x1d');var _0xd4d6b2=_0x135996[_0x14e8('0x1f')];var _0x10dc8b=_0x52e64f?0x0:_0xc6101f[_0x14e8('0x1c')];var _0x5a38c1=_0x52e64f?_0x135996[_0x14e8('0x1f')]:_0xc6101f[_0x14e8('0x1c')]+_0xc6101f[_0x14e8('0x1e')];var _0x7b10f2;if(_0x5a38c1>=_0xd4d6b2){_0x5a38c1=_0xd4d6b2;_0x7b10f2=0xc8;}else{_0x7b10f2=0xce;}_0x3761a1[_0x14e8('0x1a')](_0x7b10f2);return _0x3761a1['set'](_0x14e8('0x20'),_0x10dc8b+'-'+_0x5a38c1+'/'+_0xd4d6b2)[_0x14e8('0x1b')](_0x135996);}return null;};}function patchUpdates(_0x2abfec){return function(_0x48e30a){try{jsonpatch[_0x14e8('0x21')](_0x48e30a,_0x2abfec,!![]);}catch(_0x47f060){return BPromise[_0x14e8('0x22')](_0x47f060);}return _0x48e30a[_0x14e8('0x23')]();};}function saveUpdates(_0x3e8d5c,_0x117b00){return function(_0xcf673){if(_0xcf673){return _0xcf673['update'](_0x3e8d5c)[_0x14e8('0x24')](function(_0x5b11f9){return _0x5b11f9;});}return null;};}function removeEntity(_0x31bdd3,_0x185a0e){return function(_0x4ffc8b){if(_0x4ffc8b){return _0x4ffc8b['destroy']()['then'](function(){_0x31bdd3[_0x14e8('0x1a')](0xcc)[_0x14e8('0x25')]();});}};}function handleEntityNotFound(_0x3eae0b,_0x20bfe8){return function(_0x333d44){if(!_0x333d44){_0x3eae0b['sendStatus'](0x194);}return _0x333d44;};}function handleError(_0x23a9dc,_0x3fd96d){_0x3fd96d=_0x3fd96d||0x1f4;return function(_0x3c09cb){logger[_0x14e8('0x26')](_0x3c09cb[_0x14e8('0x27')]);if(_0x3c09cb[_0x14e8('0x28')]){delete _0x3c09cb[_0x14e8('0x28')];}_0x23a9dc['status'](_0x3fd96d)[_0x14e8('0x29')](_0x3c09cb);};}exports[_0x14e8('0x2a')]=function(_0x393ab0,_0x5f5abb){var _0x48eed0={},_0x5cacd7={},_0x8fe0e2={'count':0x0,'rows':[]};var _0x2a408d=_['map'](db[_0x14e8('0x2b')][_0x14e8('0x2c')],function(_0x176e8f){return{'name':_0x176e8f[_0x14e8('0x2d')],'type':_0x176e8f['type'][_0x14e8('0x2e')]};});_0x5cacd7[_0x14e8('0x2f')]=_[_0x14e8('0x30')](_0x2a408d,_0x14e8('0x28'));_0x5cacd7[_0x14e8('0x31')]=_['keys'](_0x393ab0[_0x14e8('0x31')]);_0x5cacd7[_0x14e8('0x32')]=_[_0x14e8('0x33')](_0x5cacd7[_0x14e8('0x2f')],_0x5cacd7['query']);_0x48eed0[_0x14e8('0x34')]=_['intersection'](_0x5cacd7[_0x14e8('0x2f')],qs[_0x14e8('0x35')](_0x393ab0[_0x14e8('0x31')][_0x14e8('0x35')]));_0x48eed0[_0x14e8('0x34')]=_0x48eed0[_0x14e8('0x34')][_0x14e8('0x36')]?_0x48eed0[_0x14e8('0x34')]:_0x5cacd7[_0x14e8('0x2f')];if(!_0x393ab0[_0x14e8('0x31')][_0x14e8('0x37')](_0x14e8('0x38'))){_0x48eed0['limit']=qs['limit'](_0x393ab0['query'][_0x14e8('0x1e')]);_0x48eed0['offset']=qs[_0x14e8('0x1c')](_0x393ab0['query'][_0x14e8('0x1c')]);}_0x48eed0[_0x14e8('0x39')]=qs[_0x14e8('0x3a')](_0x393ab0[_0x14e8('0x31')]['sort']);_0x48eed0[_0x14e8('0x3b')]=qs['filters'](_[_0x14e8('0x3c')](_0x393ab0[_0x14e8('0x31')],_0x5cacd7[_0x14e8('0x32')]),_0x2a408d);if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x3d')]){_0x48eed0[_0x14e8('0x3b')]=_['merge'](_0x48eed0[_0x14e8('0x3b')],{'$or':_['map'](_0x2a408d,function(_0x30baf1){if(_0x30baf1[_0x14e8('0x3e')]!==_0x14e8('0x3f')){var _0x4cafe6={};_0x4cafe6[_0x30baf1[_0x14e8('0x28')]]={'$like':'%'+_0x393ab0[_0x14e8('0x31')]['filter']+'%'};return _0x4cafe6;}})});}_0x48eed0=_[_0x14e8('0x40')]({},_0x48eed0,_0x393ab0[_0x14e8('0x41')]);var _0x1f429a={'where':_0x48eed0[_0x14e8('0x3b')]};return db[_0x14e8('0x2b')][_0x14e8('0x1f')](_0x1f429a)[_0x14e8('0x24')](function(_0x38ec58){_0x8fe0e2[_0x14e8('0x1f')]=_0x38ec58;if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x42')]){_0x48eed0[_0x14e8('0x43')]=[{'all':!![]}];}return db[_0x14e8('0x2b')][_0x14e8('0x44')](_0x48eed0);})[_0x14e8('0x24')](function(_0x596ac7){_0x8fe0e2[_0x14e8('0x45')]=_0x596ac7;return _0x8fe0e2;})['then'](respondWithFilteredResult(_0x5f5abb,_0x48eed0))['catch'](handleError(_0x5f5abb,null));};exports['show']=function(_0x3d2d95,_0x5ed821){var _0x46a3c4={'raw':!![],'where':{'id':_0x3d2d95[_0x14e8('0x46')]['id']}},_0x45bff0={};_0x45bff0[_0x14e8('0x2f')]=_[_0x14e8('0x47')](db[_0x14e8('0x2b')][_0x14e8('0x2c')]);_0x45bff0[_0x14e8('0x31')]=_[_0x14e8('0x47')](_0x3d2d95[_0x14e8('0x31')]);_0x45bff0[_0x14e8('0x32')]=_['intersection'](_0x45bff0[_0x14e8('0x2f')],_0x45bff0[_0x14e8('0x31')]);_0x46a3c4[_0x14e8('0x34')]=_[_0x14e8('0x33')](_0x45bff0['model'],qs[_0x14e8('0x35')](_0x3d2d95[_0x14e8('0x31')]['fields']));_0x46a3c4['attributes']=_0x46a3c4[_0x14e8('0x34')]['length']?_0x46a3c4['attributes']:_0x45bff0[_0x14e8('0x2f')];if(_0x3d2d95[_0x14e8('0x31')]['includeAll']){_0x46a3c4[_0x14e8('0x43')]=[{'all':!![]}];}_0x46a3c4=_[_0x14e8('0x40')]({},_0x46a3c4,_0x3d2d95['options']);return db[_0x14e8('0x2b')][_0x14e8('0x48')](_0x46a3c4)[_0x14e8('0x24')](handleEntityNotFound(_0x5ed821,null))[_0x14e8('0x24')](respondWithResult(_0x5ed821,null))[_0x14e8('0x49')](handleError(_0x5ed821,null));};exports[_0x14e8('0x4a')]=function(_0x343529,_0x2541ad){return db[_0x14e8('0x2b')][_0x14e8('0x4a')](_0x343529[_0x14e8('0x4b')],{})[_0x14e8('0x24')](respondWithResult(_0x2541ad,0xc9))[_0x14e8('0x49')](handleError(_0x2541ad,null));};exports[_0x14e8('0x4c')]=function(_0x1bf742,_0x1f50bc){if(_0x1bf742['body']['id']){delete _0x1bf742[_0x14e8('0x4b')]['id'];}return db['WhatsappQueueReport'][_0x14e8('0x48')]({'where':{'id':_0x1bf742[_0x14e8('0x46')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x1f50bc,null))[_0x14e8('0x24')](saveUpdates(_0x1bf742['body'],null))['then'](respondWithResult(_0x1f50bc,null))['catch'](handleError(_0x1f50bc,null));};exports[_0x14e8('0x4d')]=function(_0x49657e,_0x55f9b0){return db[_0x14e8('0x2b')][_0x14e8('0x48')]({'where':{'id':_0x49657e['params']['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x55f9b0,null))[_0x14e8('0x24')](removeEntity(_0x55f9b0,null))[_0x14e8('0x49')](handleError(_0x55f9b0,null));};exports[_0x14e8('0x4e')]=function(_0x4cc86a,_0x519c9c){return db[_0x14e8('0x2b')][_0x14e8('0x4e')]()[_0x14e8('0x24')](respondWithResult(_0x519c9c,null))[_0x14e8('0x49')](handleError(_0x519c9c,null));}; \ No newline at end of file +var _0x8f59=['../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x493f48,_0x11bdd9){var _0x3ebd23=function(_0x20bc85){while(--_0x20bc85){_0x493f48['push'](_0x493f48['shift']());}};_0x3ebd23(++_0x11bdd9);}(_0x8f59,0x11d));var _0x98f5=function(_0x2813fa,_0x3211d4){_0x2813fa=_0x2813fa-0x0;var _0x8a2acb=_0x8f59[_0x2813fa];return _0x8a2acb;};'use strict';var emlformat=require(_0x98f5('0x0'));var rimraf=require(_0x98f5('0x1'));var zipdir=require(_0x98f5('0x2'));var jsonpatch=require(_0x98f5('0x3'));var rp=require(_0x98f5('0x4'));var moment=require(_0x98f5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x98f5('0x6'));var util=require(_0x98f5('0x7'));var path=require(_0x98f5('0x8'));var sox=require(_0x98f5('0x9'));var csv=require('to-csv');var ejs=require(_0x98f5('0xa'));var fs=require('fs');var fs_extra=require(_0x98f5('0xb'));var _=require(_0x98f5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x98f5('0xd'));var deskjs=require(_0x98f5('0xe'));var toCsv=require(_0x98f5('0xf'));var querystring=require('querystring');var Papa=require(_0x98f5('0x10'));var Redis=require(_0x98f5('0x11'));var authService=require(_0x98f5('0x12'));var qs=require(_0x98f5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98f5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x98f5('0x15'));var config=require(_0x98f5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x98f5('0x17'))['db'];function respondWithStatusCode(_0x259abe,_0x1f00e8){_0x1f00e8=_0x1f00e8||0xcc;return function(_0x160626){if(_0x160626){return _0x259abe[_0x98f5('0x18')](_0x1f00e8);}return _0x259abe[_0x98f5('0x19')](_0x1f00e8)['end']();};}function respondWithResult(_0x24a7a9,_0xbade31){_0xbade31=_0xbade31||0xc8;return function(_0x5b8bab){if(_0x5b8bab){return _0x24a7a9[_0x98f5('0x19')](_0xbade31)[_0x98f5('0x1a')](_0x5b8bab);}};}function respondWithFilteredResult(_0xaa951a,_0x4ae70d){return function(_0x2437e7){if(_0x2437e7){var _0xc7a49b=typeof _0x4ae70d[_0x98f5('0x1b')]==='undefined'&&typeof _0x4ae70d[_0x98f5('0x1c')]===_0x98f5('0x1d');var _0x574644=_0x2437e7[_0x98f5('0x1e')];var _0x51a567=_0xc7a49b?0x0:_0x4ae70d[_0x98f5('0x1b')];var _0x9e42dd=_0xc7a49b?_0x2437e7[_0x98f5('0x1e')]:_0x4ae70d[_0x98f5('0x1b')]+_0x4ae70d[_0x98f5('0x1c')];var _0xa4477c;if(_0x9e42dd>=_0x574644){_0x9e42dd=_0x574644;_0xa4477c=0xc8;}else{_0xa4477c=0xce;}_0xaa951a['status'](_0xa4477c);return _0xaa951a[_0x98f5('0x1f')]('Content-Range',_0x51a567+'-'+_0x9e42dd+'/'+_0x574644)[_0x98f5('0x1a')](_0x2437e7);}return null;};}function patchUpdates(_0x191f23){return function(_0x5deca0){try{jsonpatch[_0x98f5('0x20')](_0x5deca0,_0x191f23,!![]);}catch(_0x2933d1){return BPromise[_0x98f5('0x21')](_0x2933d1);}return _0x5deca0[_0x98f5('0x22')]();};}function saveUpdates(_0x3b2d9d,_0x3dc7c2){return function(_0x38b46d){if(_0x38b46d){return _0x38b46d['update'](_0x3b2d9d)[_0x98f5('0x23')](function(_0x49ee4e){return _0x49ee4e;});}return null;};}function removeEntity(_0xcb10d6,_0x495889){return function(_0x44bfbb){if(_0x44bfbb){return _0x44bfbb[_0x98f5('0x24')]()[_0x98f5('0x23')](function(){_0xcb10d6[_0x98f5('0x19')](0xcc)[_0x98f5('0x25')]();});}};}function handleEntityNotFound(_0x18052d,_0x46dbd4){return function(_0x58d506){if(!_0x58d506){_0x18052d[_0x98f5('0x18')](0x194);}return _0x58d506;};}function handleError(_0x2b80a1,_0x5d7423){_0x5d7423=_0x5d7423||0x1f4;return function(_0x1a1c55){logger[_0x98f5('0x26')](_0x1a1c55[_0x98f5('0x27')]);if(_0x1a1c55[_0x98f5('0x28')]){delete _0x1a1c55[_0x98f5('0x28')];}_0x2b80a1[_0x98f5('0x19')](_0x5d7423)[_0x98f5('0x29')](_0x1a1c55);};}exports[_0x98f5('0x2a')]=function(_0x576c4b,_0x4c10b8){var _0x428c85={},_0x71661e={},_0x18bb29={'count':0x0,'rows':[]};var _0x209d15=_[_0x98f5('0x2b')](db[_0x98f5('0x2c')]['rawAttributes'],function(_0x29e1f5){return{'name':_0x29e1f5[_0x98f5('0x2d')],'type':_0x29e1f5[_0x98f5('0x2e')][_0x98f5('0x2f')]};});_0x71661e[_0x98f5('0x30')]=_[_0x98f5('0x2b')](_0x209d15,'name');_0x71661e[_0x98f5('0x31')]=_[_0x98f5('0x32')](_0x576c4b[_0x98f5('0x31')]);_0x71661e[_0x98f5('0x33')]=_['intersection'](_0x71661e[_0x98f5('0x30')],_0x71661e[_0x98f5('0x31')]);_0x428c85[_0x98f5('0x34')]=_[_0x98f5('0x35')](_0x71661e[_0x98f5('0x30')],qs[_0x98f5('0x36')](_0x576c4b[_0x98f5('0x31')][_0x98f5('0x36')]));_0x428c85[_0x98f5('0x34')]=_0x428c85[_0x98f5('0x34')][_0x98f5('0x37')]?_0x428c85[_0x98f5('0x34')]:_0x71661e[_0x98f5('0x30')];if(!_0x576c4b[_0x98f5('0x31')][_0x98f5('0x38')](_0x98f5('0x39'))){_0x428c85[_0x98f5('0x1c')]=qs[_0x98f5('0x1c')](_0x576c4b[_0x98f5('0x31')][_0x98f5('0x1c')]);_0x428c85['offset']=qs[_0x98f5('0x1b')](_0x576c4b['query']['offset']);}_0x428c85[_0x98f5('0x3a')]=qs[_0x98f5('0x3b')](_0x576c4b[_0x98f5('0x31')][_0x98f5('0x3b')]);_0x428c85['where']=qs[_0x98f5('0x33')](_[_0x98f5('0x3c')](_0x576c4b[_0x98f5('0x31')],_0x71661e['filters']),_0x209d15);if(_0x576c4b[_0x98f5('0x31')][_0x98f5('0x3d')]){_0x428c85['where']=_[_0x98f5('0x3e')](_0x428c85[_0x98f5('0x3f')],{'$or':_[_0x98f5('0x2b')](_0x209d15,function(_0x580f19){if(_0x580f19[_0x98f5('0x2e')]!==_0x98f5('0x40')){var _0x19f045={};_0x19f045[_0x580f19[_0x98f5('0x28')]]={'$like':'%'+_0x576c4b[_0x98f5('0x31')]['filter']+'%'};return _0x19f045;}})});}_0x428c85=_['merge']({},_0x428c85,_0x576c4b[_0x98f5('0x41')]);var _0x14faf2={'where':_0x428c85[_0x98f5('0x3f')]};return db[_0x98f5('0x2c')][_0x98f5('0x1e')](_0x14faf2)[_0x98f5('0x23')](function(_0x58064e){_0x18bb29['count']=_0x58064e;if(_0x576c4b[_0x98f5('0x31')][_0x98f5('0x42')]){_0x428c85[_0x98f5('0x43')]=[{'all':!![]}];}return db[_0x98f5('0x2c')]['findAll'](_0x428c85);})['then'](function(_0x2dafcd){_0x18bb29[_0x98f5('0x44')]=_0x2dafcd;return _0x18bb29;})[_0x98f5('0x23')](respondWithFilteredResult(_0x4c10b8,_0x428c85))[_0x98f5('0x45')](handleError(_0x4c10b8,null));};exports['show']=function(_0x51ae92,_0x3db067){var _0x3a191f={'raw':!![],'where':{'id':_0x51ae92['params']['id']}},_0x372c33={};_0x372c33[_0x98f5('0x30')]=_['keys'](db[_0x98f5('0x2c')]['rawAttributes']);_0x372c33[_0x98f5('0x31')]=_[_0x98f5('0x32')](_0x51ae92[_0x98f5('0x31')]);_0x372c33['filters']=_[_0x98f5('0x35')](_0x372c33[_0x98f5('0x30')],_0x372c33['query']);_0x3a191f[_0x98f5('0x34')]=_[_0x98f5('0x35')](_0x372c33['model'],qs[_0x98f5('0x36')](_0x51ae92['query'][_0x98f5('0x36')]));_0x3a191f[_0x98f5('0x34')]=_0x3a191f['attributes']['length']?_0x3a191f['attributes']:_0x372c33['model'];if(_0x51ae92[_0x98f5('0x31')]['includeAll']){_0x3a191f[_0x98f5('0x43')]=[{'all':!![]}];}_0x3a191f=_[_0x98f5('0x3e')]({},_0x3a191f,_0x51ae92[_0x98f5('0x41')]);return db[_0x98f5('0x2c')][_0x98f5('0x46')](_0x3a191f)[_0x98f5('0x23')](handleEntityNotFound(_0x3db067,null))['then'](respondWithResult(_0x3db067,null))[_0x98f5('0x45')](handleError(_0x3db067,null));};exports[_0x98f5('0x47')]=function(_0x4b3fa8,_0x2c3cef){return db[_0x98f5('0x2c')][_0x98f5('0x47')](_0x4b3fa8['body'],{})[_0x98f5('0x23')](respondWithResult(_0x2c3cef,0xc9))[_0x98f5('0x45')](handleError(_0x2c3cef,null));};exports[_0x98f5('0x48')]=function(_0x1d4b3b,_0x4a0cda){if(_0x1d4b3b[_0x98f5('0x49')]['id']){delete _0x1d4b3b[_0x98f5('0x49')]['id'];}return db[_0x98f5('0x2c')][_0x98f5('0x46')]({'where':{'id':_0x1d4b3b[_0x98f5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4a0cda,null))[_0x98f5('0x23')](saveUpdates(_0x1d4b3b[_0x98f5('0x49')],null))['then'](respondWithResult(_0x4a0cda,null))[_0x98f5('0x45')](handleError(_0x4a0cda,null));};exports['destroy']=function(_0x27ed57,_0x4cb157){return db[_0x98f5('0x2c')][_0x98f5('0x46')]({'where':{'id':_0x27ed57[_0x98f5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4cb157,null))[_0x98f5('0x23')](removeEntity(_0x4cb157,null))[_0x98f5('0x45')](handleError(_0x4cb157,null));};exports[_0x98f5('0x4b')]=function(_0x2953e3,_0xde3d2d){return db[_0x98f5('0x2c')][_0x98f5('0x4b')]()[_0x98f5('0x23')](respondWithResult(_0xde3d2d,null))[_0x98f5('0x45')](handleError(_0xde3d2d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index d88cae3..af68acb 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 _0x9c86=['exports','define','WhatsappQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x3c698b,_0x1c5997){var _0x405c4b=function(_0x3680c3){while(--_0x3680c3){_0x3c698b['push'](_0x3c698b['shift']());}};_0x405c4b(++_0x1c5997);}(_0x9c86,0xd6));var _0x69c8=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x9c86[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x69c8('0x0'));var util=require(_0x69c8('0x1'));var logger=require(_0x69c8('0x2'))(_0x69c8('0x3'));var moment=require(_0x69c8('0x4'));var BPromise=require(_0x69c8('0x5'));var rp=require(_0x69c8('0x6'));var fs=require('fs');var path=require(_0x69c8('0x7'));var rimraf=require('rimraf');var config=require(_0x69c8('0x8'));var attributes=require(_0x69c8('0x9'));module[_0x69c8('0xa')]=function(_0x2925f5,_0x5cc45f){return _0x2925f5[_0x69c8('0xb')](_0x69c8('0xc'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x69c8('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb455=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x2bdd09,_0x4627f7){var _0x2728a6=function(_0x7f043a){while(--_0x7f043a){_0x2bdd09['push'](_0x2bdd09['shift']());}};_0x2728a6(++_0x4627f7);}(_0xb455,0x1b4));var _0x5b45=function(_0x345a1d,_0x446aef){_0x345a1d=_0x345a1d-0x0;var _0x5f2b9c=_0xb455[_0x345a1d];return _0x5f2b9c;};'use strict';var _=require(_0x5b45('0x0'));var util=require(_0x5b45('0x1'));var logger=require(_0x5b45('0x2'))(_0x5b45('0x3'));var moment=require(_0x5b45('0x4'));var BPromise=require(_0x5b45('0x5'));var rp=require(_0x5b45('0x6'));var fs=require('fs');var path=require(_0x5b45('0x7'));var rimraf=require('rimraf');var config=require(_0x5b45('0x8'));var attributes=require(_0x5b45('0x9'));module[_0x5b45('0xa')]=function(_0x39639c,_0x44df1c){return _0x39639c[_0x5b45('0xb')](_0x5b45('0xc'),attributes,{'tableName':_0x5b45('0xd'),'paranoid':![],'indexes':[{'name':_0x5b45('0xe'),'fields':[_0x5b45('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index ee24889..aa5f45b 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 _0x5c32=['../../config/utils','../../config/environment','jayson/promise','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','WhatsappQueueReport','body','options','then','CreateWhatsappQueueReport','stringify','update','raw','where','limit','UpdateWhatsappQueueReport','util','moment','bluebird','ioredis'];(function(_0x42c00a,_0x236322){var _0x92ad35=function(_0x4a9d2e){while(--_0x4a9d2e){_0x42c00a['push'](_0x42c00a['shift']());}};_0x92ad35(++_0x236322);}(_0x5c32,0x101));var _0x25c3=function(_0x16a798,_0x15b296){_0x16a798=_0x16a798-0x0;var _0x111bc7=_0x5c32[_0x16a798];return _0x111bc7;};'use strict';var _=require('lodash');var util=require(_0x25c3('0x0'));var moment=require(_0x25c3('0x1'));var BPromise=require(_0x25c3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x25c3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x25c3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x25c3('0x5'));var jayson=require(_0x25c3('0x6'));var client=jayson['client'][_0x25c3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x476f18,_0x646818,_0x515c77){return new BPromise(function(_0x57d550,_0x2869a0){return client[_0x25c3('0x8')](_0x476f18,_0x515c77)['then'](function(_0x186b52){logger[_0x25c3('0x9')](_0x25c3('0xa'),_0x646818,_0x25c3('0xb'));logger[_0x25c3('0xc')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x646818,_0x25c3('0xb'),JSON['stringify'](_0x186b52));if(_0x186b52[_0x25c3('0xd')]){if(_0x186b52[_0x25c3('0xd')][_0x25c3('0xe')]===0x1f4){logger[_0x25c3('0xd')](_0x25c3('0xa'),_0x646818,_0x186b52[_0x25c3('0xd')][_0x25c3('0xf')]);return _0x2869a0(_0x186b52[_0x25c3('0xd')][_0x25c3('0xf')]);}logger[_0x25c3('0xd')](_0x25c3('0xa'),_0x646818,_0x186b52['error'][_0x25c3('0xf')]);return _0x57d550(_0x186b52[_0x25c3('0xd')][_0x25c3('0xf')]);}else{logger[_0x25c3('0x9')](_0x25c3('0xa'),_0x646818,'request\x20sent');_0x57d550(_0x186b52[_0x25c3('0x10')][_0x25c3('0xf')]);}})[_0x25c3('0x11')](function(_0x4c7d5e){logger['error'](_0x25c3('0xa'),_0x646818,_0x4c7d5e);_0x2869a0(_0x4c7d5e);});});}exports['CreateWhatsappQueueReport']=function(_0x223b3e){var _0x450974=this;return new Promise(function(_0x2eb97b,_0x11c75b){return db[_0x25c3('0x12')]['create'](_0x223b3e[_0x25c3('0x13')],{'raw':_0x223b3e[_0x25c3('0x14')]?_0x223b3e[_0x25c3('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x25c3('0x15')](function(_0x824d86){logger[_0x25c3('0x9')](_0x25c3('0x16'),_0x223b3e);logger[_0x25c3('0xc')](_0x25c3('0x16'),_0x223b3e,JSON[_0x25c3('0x17')](_0x824d86));_0x2eb97b(_0x824d86);})[_0x25c3('0x11')](function(_0x2bcce5){logger[_0x25c3('0xd')](_0x25c3('0x16'),_0x2bcce5[_0x25c3('0xf')],_0x223b3e);_0x11c75b(_0x450974['error'](0x1f4,_0x2bcce5[_0x25c3('0xf')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x120ee1){var _0x388b17=this;return new Promise(function(_0x594781,_0x4ac756){return db[_0x25c3('0x12')][_0x25c3('0x18')](_0x120ee1[_0x25c3('0x13')],{'raw':_0x120ee1[_0x25c3('0x14')]?_0x120ee1[_0x25c3('0x14')][_0x25c3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x120ee1['options']?_0x120ee1[_0x25c3('0x14')][_0x25c3('0x1a')]||null:null,'attributes':_0x120ee1[_0x25c3('0x14')]?_0x120ee1[_0x25c3('0x14')]['attributes']||null:null,'limit':_0x120ee1[_0x25c3('0x14')]?_0x120ee1[_0x25c3('0x14')][_0x25c3('0x1b')]||null:null})[_0x25c3('0x15')](function(_0x51069f){logger['info']('UpdateWhatsappQueueReport',_0x120ee1);logger['debug']('UpdateWhatsappQueueReport',_0x120ee1,JSON[_0x25c3('0x17')](_0x51069f));_0x594781(_0x51069f);})[_0x25c3('0x11')](function(_0x5b914b){logger[_0x25c3('0xd')](_0x25c3('0x1c'),_0x5b914b['message'],_0x120ee1);_0x4ac756(_0x388b17[_0x25c3('0xd')](0x1f4,_0x5b914b[_0x25c3('0xf')]));});});}; \ No newline at end of file +var _0x4012=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','debug','update','body','where','attributes','limit','UpdateWhatsappQueueReport','lodash','moment'];(function(_0x198fc6,_0x5eaee9){var _0x4376bb=function(_0x4b3241){while(--_0x4b3241){_0x198fc6['push'](_0x198fc6['shift']());}};_0x4376bb(++_0x5eaee9);}(_0x4012,0xd6));var _0x2401=function(_0x2d3243,_0x9e035){_0x2d3243=_0x2d3243-0x0;var _0x4a97d3=_0x4012[_0x2d3243];return _0x4a97d3;};'use strict';var _=require(_0x2401('0x0'));var util=require('util');var moment=require(_0x2401('0x1'));var BPromise=require(_0x2401('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2401('0x3'));var db=require(_0x2401('0x4'))['db'];var utils=require(_0x2401('0x5'));var logger=require(_0x2401('0x6'))(_0x2401('0x7'));var config=require(_0x2401('0x8'));var jayson=require(_0x2401('0x9'));var client=jayson[_0x2401('0xa')][_0x2401('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x85f35f,_0x184814,_0x245b35){return new BPromise(function(_0x267711,_0x1fb21f){return client[_0x2401('0xc')](_0x85f35f,_0x245b35)[_0x2401('0xd')](function(_0x4e621c){logger['info'](_0x2401('0xe'),_0x184814,'request\x20sent');logger['debug'](_0x2401('0xf'),_0x184814,_0x2401('0x10'),JSON[_0x2401('0x11')](_0x4e621c));if(_0x4e621c[_0x2401('0x12')]){if(_0x4e621c[_0x2401('0x12')][_0x2401('0x13')]===0x1f4){logger[_0x2401('0x12')](_0x2401('0xe'),_0x184814,_0x4e621c[_0x2401('0x12')]['message']);return _0x1fb21f(_0x4e621c[_0x2401('0x12')][_0x2401('0x14')]);}logger[_0x2401('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x184814,_0x4e621c[_0x2401('0x12')]['message']);return _0x267711(_0x4e621c[_0x2401('0x12')][_0x2401('0x14')]);}else{logger[_0x2401('0x15')]('WhatsappQueueReport,\x20%s,\x20%s',_0x184814,_0x2401('0x10'));_0x267711(_0x4e621c[_0x2401('0x16')][_0x2401('0x14')]);}})[_0x2401('0x17')](function(_0x2fcca1){logger[_0x2401('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x184814,_0x2fcca1);_0x1fb21f(_0x2fcca1);});});}exports[_0x2401('0x18')]=function(_0x42743a){var _0x26c333=this;return new Promise(function(_0x52ef0b,_0x228698){return db[_0x2401('0x19')][_0x2401('0x1a')](_0x42743a['body'],{'raw':_0x42743a[_0x2401('0x1b')]?_0x42743a[_0x2401('0x1b')][_0x2401('0x1c')]===undefined?!![]:![]:!![]})[_0x2401('0xd')](function(_0xba2e76){logger[_0x2401('0x15')](_0x2401('0x18'),_0x42743a);logger[_0x2401('0x1d')]('CreateWhatsappQueueReport',_0x42743a,JSON[_0x2401('0x11')](_0xba2e76));_0x52ef0b(_0xba2e76);})['catch'](function(_0x1fa176){logger['error']('CreateWhatsappQueueReport',_0x1fa176['message'],_0x42743a);_0x228698(_0x26c333[_0x2401('0x12')](0x1f4,_0x1fa176[_0x2401('0x14')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x29b790){var _0x164589=this;return new Promise(function(_0x567a9d,_0x4c9acf){return db[_0x2401('0x19')][_0x2401('0x1e')](_0x29b790[_0x2401('0x1f')],{'raw':_0x29b790['options']?_0x29b790['options'][_0x2401('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29b790[_0x2401('0x1b')]?_0x29b790[_0x2401('0x1b')][_0x2401('0x20')]||null:null,'attributes':_0x29b790['options']?_0x29b790['options'][_0x2401('0x21')]||null:null,'limit':_0x29b790[_0x2401('0x1b')]?_0x29b790['options'][_0x2401('0x22')]||null:null})['then'](function(_0x1a50aa){logger[_0x2401('0x15')]('UpdateWhatsappQueueReport',_0x29b790);logger[_0x2401('0x1d')](_0x2401('0x23'),_0x29b790,JSON[_0x2401('0x11')](_0x1a50aa));_0x567a9d(_0x1a50aa);})[_0x2401('0x17')](function(_0x31af41){logger['error'](_0x2401('0x23'),_0x31af41[_0x2401('0x14')],_0x29b790);_0x4c9acf(_0x164589['error'](0x1f4,_0x31af41[_0x2401('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index ff45fcc..5a9e8cb 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 _0xc591=['connect-timeout','express','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','destroy','exports','util'];(function(_0x56191f,_0x26f14e){var _0x720eb0=function(_0x2192fc){while(--_0x2192fc){_0x56191f['push'](_0x56191f['shift']());}};_0x720eb0(++_0x26f14e);}(_0xc591,0x1e5));var _0x1c59=function(_0x50c96f,_0x2ee009){_0x50c96f=_0x50c96f-0x0;var _0x38fcf2=_0xc591[_0x50c96f];return _0x38fcf2;};'use strict';var multer=require('multer');var util=require(_0x1c59('0x0'));var path=require('path');var timeout=require(_0x1c59('0x1'));var express=require(_0x1c59('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1c59('0x3'));var config=require(_0x1c59('0x4'));var controller=require(_0x1c59('0x5'));router[_0x1c59('0x6')]('/',auth[_0x1c59('0x7')](),controller[_0x1c59('0x8')]);router[_0x1c59('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x1c59('0x9')]);router[_0x1c59('0x6')](_0x1c59('0xa'),auth[_0x1c59('0x7')](),controller[_0x1c59('0xb')]);router[_0x1c59('0xc')]('/',auth[_0x1c59('0x7')](),controller[_0x1c59('0xd')]);router['put']('/:id',auth[_0x1c59('0x7')](),controller[_0x1c59('0xe')]);router[_0x1c59('0xf')](_0x1c59('0xa'),auth[_0x1c59('0x7')](),controller[_0x1c59('0x10')]);module[_0x1c59('0x11')]=router; \ No newline at end of file +var _0x1e9d=['post','create','put','update','delete','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0xed313e,_0x238e63){var _0x3b3d86=function(_0x575cd2){while(--_0x575cd2){_0xed313e['push'](_0xed313e['shift']());}};_0x3b3d86(++_0x238e63);}(_0x1e9d,0x142));var _0xd1e9=function(_0x44bfe2,_0x445f82){_0x44bfe2=_0x44bfe2-0x0;var _0x51a0f0=_0x1e9d[_0x44bfe2];return _0x51a0f0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd1e9('0x0'));var timeout=require('connect-timeout');var express=require(_0xd1e9('0x1'));var router=express['Router']();var fs_extra=require(_0xd1e9('0x2'));var auth=require(_0xd1e9('0x3'));var interaction=require(_0xd1e9('0x4'));var config=require(_0xd1e9('0x5'));var controller=require(_0xd1e9('0x6'));router['get']('/',auth[_0xd1e9('0x7')](),controller[_0xd1e9('0x8')]);router[_0xd1e9('0x9')](_0xd1e9('0xa'),auth['isAuthenticated'](),controller[_0xd1e9('0xb')]);router[_0xd1e9('0x9')](_0xd1e9('0xc'),auth['isAuthenticated'](),controller[_0xd1e9('0xd')]);router[_0xd1e9('0xe')]('/',auth[_0xd1e9('0x7')](),controller[_0xd1e9('0xf')]);router[_0xd1e9('0x10')](_0xd1e9('0xc'),auth[_0xd1e9('0x7')](),controller[_0xd1e9('0x11')]);router[_0xd1e9('0x12')](_0xd1e9('0xc'),auth[_0xd1e9('0x7')](),controller[_0xd1e9('0x13')]);module[_0xd1e9('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 56589cd..2c12220 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 _0x3419=['ENUM','account','queue','DATE','sequelize','exports','STRING'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x3419,0xb3));var _0x9341=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0x3419[_0xca1f0e];return _0x35e4ef;};'use strict';var Sequelize=require(_0x9341('0x0'));module[_0x9341('0x1')]={'uniqueid':{'type':Sequelize[_0x9341('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9341('0x3')](_0x9341('0x4'),'agent',_0x9341('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x9341('0x6')]}}; \ No newline at end of file +var _0xbe51=['queue','DATE','sequelize','exports','ENUM','agent'];(function(_0x442d7c,_0x20f4dd){var _0x430761=function(_0x2e3cc4){while(--_0x2e3cc4){_0x442d7c['push'](_0x442d7c['shift']());}};_0x430761(++_0x20f4dd);}(_0xbe51,0x1e2));var _0x1be5=function(_0x1383ff,_0x7c6f31){_0x1383ff=_0x1383ff-0x0;var _0x2edd17=_0xbe51[_0x1383ff];return _0x2edd17;};'use strict';var Sequelize=require(_0x1be5('0x0'));module[_0x1be5('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1be5('0x2')]('account',_0x1be5('0x3'),_0x1be5('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x1be5('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 86f4144..b3b3b05 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 _0xb98d=['count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','WhatsappTransferReport','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb98d,0x19d));var _0xdb98=function(_0x52b4c3,_0xbfd896){_0x52b4c3=_0x52b4c3-0x0;var _0x524094=_0xb98d[_0x52b4c3];return _0x524094;};'use strict';var emlformat=require(_0xdb98('0x0'));var rimraf=require(_0xdb98('0x1'));var zipdir=require(_0xdb98('0x2'));var jsonpatch=require(_0xdb98('0x3'));var rp=require(_0xdb98('0x4'));var moment=require(_0xdb98('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdb98('0x6'));var path=require(_0xdb98('0x7'));var sox=require(_0xdb98('0x8'));var csv=require(_0xdb98('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb98('0xa'));var _=require('lodash');var squel=require(_0xdb98('0xb'));var crypto=require('crypto');var jsforce=require(_0xdb98('0xc'));var deskjs=require(_0xdb98('0xd'));var toCsv=require(_0xdb98('0x9'));var querystring=require(_0xdb98('0xe'));var Papa=require(_0xdb98('0xf'));var Redis=require(_0xdb98('0x10'));var authService=require(_0xdb98('0x11'));var qs=require(_0xdb98('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb98('0x13'));var logger=require(_0xdb98('0x14'))('api');var utils=require(_0xdb98('0x15'));var config=require(_0xdb98('0x16'));var licenseUtil=require(_0xdb98('0x17'));var db=require(_0xdb98('0x18'))['db'];function respondWithStatusCode(_0x36025e,_0x2df1a5){_0x2df1a5=_0x2df1a5||0xcc;return function(_0x14e683){if(_0x14e683){return _0x36025e[_0xdb98('0x19')](_0x2df1a5);}return _0x36025e[_0xdb98('0x1a')](_0x2df1a5)[_0xdb98('0x1b')]();};}function respondWithResult(_0x2c9c06,_0x153363){_0x153363=_0x153363||0xc8;return function(_0x151ceb){if(_0x151ceb){return _0x2c9c06['status'](_0x153363)['json'](_0x151ceb);}};}function respondWithFilteredResult(_0xdada5e,_0x10643f){return function(_0x2fb856){if(_0x2fb856){var _0x2ff19a=typeof _0x10643f[_0xdb98('0x1c')]===_0xdb98('0x1d')&&typeof _0x10643f[_0xdb98('0x1e')]===_0xdb98('0x1d');var _0x189a8f=_0x2fb856[_0xdb98('0x1f')];var _0x4d62fc=_0x2ff19a?0x0:_0x10643f['offset'];var _0x5b01bc=_0x2ff19a?_0x2fb856[_0xdb98('0x1f')]:_0x10643f['offset']+_0x10643f['limit'];var _0xb496ad;if(_0x5b01bc>=_0x189a8f){_0x5b01bc=_0x189a8f;_0xb496ad=0xc8;}else{_0xb496ad=0xce;}_0xdada5e[_0xdb98('0x1a')](_0xb496ad);return _0xdada5e[_0xdb98('0x20')]('Content-Range',_0x4d62fc+'-'+_0x5b01bc+'/'+_0x189a8f)['json'](_0x2fb856);}return null;};}function patchUpdates(_0x281124){return function(_0x100961){try{jsonpatch[_0xdb98('0x21')](_0x100961,_0x281124,!![]);}catch(_0x27473d){return BPromise[_0xdb98('0x22')](_0x27473d);}return _0x100961[_0xdb98('0x23')]();};}function saveUpdates(_0x2fa6fe,_0x3ab0d5){return function(_0xe031c7){if(_0xe031c7){return _0xe031c7[_0xdb98('0x24')](_0x2fa6fe)[_0xdb98('0x25')](function(_0x513809){return _0x513809;});}return null;};}function removeEntity(_0x274b49,_0x4e6890){return function(_0x39024a){if(_0x39024a){return _0x39024a[_0xdb98('0x26')]()[_0xdb98('0x25')](function(){_0x274b49[_0xdb98('0x1a')](0xcc)[_0xdb98('0x1b')]();});}};}function handleEntityNotFound(_0x57bd08,_0x38b3e1){return function(_0x57b9f2){if(!_0x57b9f2){_0x57bd08[_0xdb98('0x19')](0x194);}return _0x57b9f2;};}function handleError(_0x456652,_0x232efe){_0x232efe=_0x232efe||0x1f4;return function(_0xbda95b){logger[_0xdb98('0x27')](_0xbda95b['stack']);if(_0xbda95b[_0xdb98('0x28')]){delete _0xbda95b[_0xdb98('0x28')];}_0x456652[_0xdb98('0x1a')](_0x232efe)[_0xdb98('0x29')](_0xbda95b);};}exports[_0xdb98('0x2a')]=function(_0x463c73,_0x1ad5af){var _0x34603e={},_0xc3ca81={},_0x253675={'count':0x0,'rows':[]};var _0x49c1d3=_[_0xdb98('0x2b')](db[_0xdb98('0x2c')]['rawAttributes'],function(_0x35eb2c){return{'name':_0x35eb2c['fieldName'],'type':_0x35eb2c[_0xdb98('0x2d')][_0xdb98('0x2e')]};});_0xc3ca81[_0xdb98('0x2f')]=_[_0xdb98('0x2b')](_0x49c1d3,_0xdb98('0x28'));_0xc3ca81[_0xdb98('0x30')]=_[_0xdb98('0x31')](_0x463c73[_0xdb98('0x30')]);_0xc3ca81['filters']=_[_0xdb98('0x32')](_0xc3ca81[_0xdb98('0x2f')],_0xc3ca81['query']);_0x34603e[_0xdb98('0x33')]=_[_0xdb98('0x32')](_0xc3ca81['model'],qs[_0xdb98('0x34')](_0x463c73[_0xdb98('0x30')][_0xdb98('0x34')]));_0x34603e[_0xdb98('0x33')]=_0x34603e[_0xdb98('0x33')][_0xdb98('0x35')]?_0x34603e[_0xdb98('0x33')]:_0xc3ca81['model'];if(!_0x463c73[_0xdb98('0x30')]['hasOwnProperty'](_0xdb98('0x36'))){_0x34603e['limit']=qs[_0xdb98('0x1e')](_0x463c73[_0xdb98('0x30')]['limit']);_0x34603e[_0xdb98('0x1c')]=qs[_0xdb98('0x1c')](_0x463c73[_0xdb98('0x30')][_0xdb98('0x1c')]);}_0x34603e[_0xdb98('0x37')]=qs[_0xdb98('0x38')](_0x463c73['query']['sort']);_0x34603e[_0xdb98('0x39')]=qs['filters'](_['pick'](_0x463c73[_0xdb98('0x30')],_0xc3ca81[_0xdb98('0x3a')]),_0x49c1d3);if(_0x463c73[_0xdb98('0x30')][_0xdb98('0x3b')]){_0x34603e[_0xdb98('0x39')]=_[_0xdb98('0x3c')](_0x34603e[_0xdb98('0x39')],{'$or':_['map'](_0x49c1d3,function(_0x585d61){if(_0x585d61[_0xdb98('0x2d')]!==_0xdb98('0x3d')){var _0x3263d7={};_0x3263d7[_0x585d61[_0xdb98('0x28')]]={'$like':'%'+_0x463c73[_0xdb98('0x30')]['filter']+'%'};return _0x3263d7;}})});}_0x34603e=_[_0xdb98('0x3c')]({},_0x34603e,_0x463c73[_0xdb98('0x3e')]);var _0x2854ce={'where':_0x34603e['where']};return db[_0xdb98('0x2c')][_0xdb98('0x1f')](_0x2854ce)[_0xdb98('0x25')](function(_0x1ff8c4){_0x253675[_0xdb98('0x1f')]=_0x1ff8c4;if(_0x463c73[_0xdb98('0x30')][_0xdb98('0x3f')]){_0x34603e[_0xdb98('0x40')]=[{'all':!![]}];}return db[_0xdb98('0x2c')][_0xdb98('0x41')](_0x34603e);})['then'](function(_0x5ccee1){_0x253675[_0xdb98('0x42')]=_0x5ccee1;return _0x253675;})[_0xdb98('0x25')](respondWithFilteredResult(_0x1ad5af,_0x34603e))['catch'](handleError(_0x1ad5af,null));};exports[_0xdb98('0x43')]=function(_0x1808ca,_0x3cd1c3){var _0x507a1b={'raw':!![],'where':{'id':_0x1808ca[_0xdb98('0x44')]['id']}},_0x1e84ba={};_0x1e84ba['model']=_[_0xdb98('0x31')](db[_0xdb98('0x2c')]['rawAttributes']);_0x1e84ba[_0xdb98('0x30')]=_[_0xdb98('0x31')](_0x1808ca[_0xdb98('0x30')]);_0x1e84ba[_0xdb98('0x3a')]=_[_0xdb98('0x32')](_0x1e84ba['model'],_0x1e84ba[_0xdb98('0x30')]);_0x507a1b['attributes']=_[_0xdb98('0x32')](_0x1e84ba[_0xdb98('0x2f')],qs[_0xdb98('0x34')](_0x1808ca[_0xdb98('0x30')][_0xdb98('0x34')]));_0x507a1b['attributes']=_0x507a1b[_0xdb98('0x33')]['length']?_0x507a1b['attributes']:_0x1e84ba[_0xdb98('0x2f')];if(_0x1808ca[_0xdb98('0x30')][_0xdb98('0x3f')]){_0x507a1b[_0xdb98('0x40')]=[{'all':!![]}];}_0x507a1b=_['merge']({},_0x507a1b,_0x1808ca[_0xdb98('0x3e')]);return db[_0xdb98('0x2c')][_0xdb98('0x45')](_0x507a1b)['then'](handleEntityNotFound(_0x3cd1c3,null))[_0xdb98('0x25')](respondWithResult(_0x3cd1c3,null))[_0xdb98('0x46')](handleError(_0x3cd1c3,null));};exports[_0xdb98('0x47')]=function(_0x42157e,_0x36f9b5){return db[_0xdb98('0x2c')]['create'](_0x42157e[_0xdb98('0x48')],{})[_0xdb98('0x25')](respondWithResult(_0x36f9b5,0xc9))[_0xdb98('0x46')](handleError(_0x36f9b5,null));};exports[_0xdb98('0x24')]=function(_0x4e01dc,_0x562f85){if(_0x4e01dc[_0xdb98('0x48')]['id']){delete _0x4e01dc['body']['id'];}return db[_0xdb98('0x2c')][_0xdb98('0x45')]({'where':{'id':_0x4e01dc['params']['id']}})[_0xdb98('0x25')](handleEntityNotFound(_0x562f85,null))[_0xdb98('0x25')](saveUpdates(_0x4e01dc['body'],null))['then'](respondWithResult(_0x562f85,null))[_0xdb98('0x46')](handleError(_0x562f85,null));};exports[_0xdb98('0x26')]=function(_0x1db444,_0x4035dc){return db[_0xdb98('0x2c')]['find']({'where':{'id':_0x1db444[_0xdb98('0x44')]['id']}})['then'](handleEntityNotFound(_0x4035dc,null))[_0xdb98('0x25')](removeEntity(_0x4035dc,null))[_0xdb98('0x46')](handleError(_0x4035dc,null));};exports[_0xdb98('0x49')]=function(_0x5027ae,_0x2bb2b6){return db[_0xdb98('0x2c')]['describe']()[_0xdb98('0x25')](respondWithResult(_0x2bb2b6,null))[_0xdb98('0x46')](handleError(_0x2bb2b6,null));}; \ No newline at end of file +var _0x6802=['end','status','json','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','WhatsappTransferReport','includeAll','include','findAll','rows','show','params','keys','fields','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6802,0x123));var _0x2680=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x6802[_0x3de8a4];return _0x4635cf;};'use strict';var emlformat=require(_0x2680('0x0'));var rimraf=require(_0x2680('0x1'));var zipdir=require(_0x2680('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2680('0x3'));var moment=require(_0x2680('0x4'));var BPromise=require(_0x2680('0x5'));var Mustache=require(_0x2680('0x6'));var util=require('util');var path=require(_0x2680('0x7'));var sox=require(_0x2680('0x8'));var csv=require(_0x2680('0x9'));var ejs=require(_0x2680('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2680('0xb'));var squel=require(_0x2680('0xc'));var crypto=require(_0x2680('0xd'));var jsforce=require(_0x2680('0xe'));var deskjs=require(_0x2680('0xf'));var toCsv=require(_0x2680('0x9'));var querystring=require('querystring');var Papa=require(_0x2680('0x10'));var Redis=require('ioredis');var authService=require(_0x2680('0x11'));var qs=require(_0x2680('0x12'));var as=require(_0x2680('0x13'));var hardwareService=require(_0x2680('0x14'));var logger=require(_0x2680('0x15'))(_0x2680('0x16'));var utils=require('../../config/utils');var config=require(_0x2680('0x17'));var licenseUtil=require(_0x2680('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1700d4,_0x509fc8){_0x509fc8=_0x509fc8||0xcc;return function(_0x554956){if(_0x554956){return _0x1700d4['sendStatus'](_0x509fc8);}return _0x1700d4['status'](_0x509fc8)[_0x2680('0x19')]();};}function respondWithResult(_0x1f5c66,_0x5914f5){_0x5914f5=_0x5914f5||0xc8;return function(_0x31fadc){if(_0x31fadc){return _0x1f5c66[_0x2680('0x1a')](_0x5914f5)[_0x2680('0x1b')](_0x31fadc);}};}function respondWithFilteredResult(_0x54ad04,_0x3f2856){return function(_0x14708d){if(_0x14708d){var _0xdfe87e=typeof _0x3f2856['offset']==='undefined'&&typeof _0x3f2856[_0x2680('0x1c')]===_0x2680('0x1d');var _0x9f4eac=_0x14708d[_0x2680('0x1e')];var _0x5abe74=_0xdfe87e?0x0:_0x3f2856['offset'];var _0xab4d4f=_0xdfe87e?_0x14708d[_0x2680('0x1e')]:_0x3f2856['offset']+_0x3f2856[_0x2680('0x1c')];var _0x112b4f;if(_0xab4d4f>=_0x9f4eac){_0xab4d4f=_0x9f4eac;_0x112b4f=0xc8;}else{_0x112b4f=0xce;}_0x54ad04[_0x2680('0x1a')](_0x112b4f);return _0x54ad04[_0x2680('0x1f')](_0x2680('0x20'),_0x5abe74+'-'+_0xab4d4f+'/'+_0x9f4eac)[_0x2680('0x1b')](_0x14708d);}return null;};}function patchUpdates(_0x309027){return function(_0x27bef5){try{jsonpatch[_0x2680('0x21')](_0x27bef5,_0x309027,!![]);}catch(_0x1605c1){return BPromise[_0x2680('0x22')](_0x1605c1);}return _0x27bef5[_0x2680('0x23')]();};}function saveUpdates(_0x28ed93,_0x41fe20){return function(_0x597673){if(_0x597673){return _0x597673['update'](_0x28ed93)[_0x2680('0x24')](function(_0x377d1a){return _0x377d1a;});}return null;};}function removeEntity(_0x34de9f,_0x35a151){return function(_0x1068e1){if(_0x1068e1){return _0x1068e1[_0x2680('0x25')]()[_0x2680('0x24')](function(){_0x34de9f[_0x2680('0x1a')](0xcc)[_0x2680('0x19')]();});}};}function handleEntityNotFound(_0x483705,_0x13086d){return function(_0x416426){if(!_0x416426){_0x483705['sendStatus'](0x194);}return _0x416426;};}function handleError(_0x2a56ab,_0x23d284){_0x23d284=_0x23d284||0x1f4;return function(_0x38730){logger[_0x2680('0x26')](_0x38730[_0x2680('0x27')]);if(_0x38730[_0x2680('0x28')]){delete _0x38730[_0x2680('0x28')];}_0x2a56ab[_0x2680('0x1a')](_0x23d284)[_0x2680('0x29')](_0x38730);};}exports[_0x2680('0x2a')]=function(_0x4fa279,_0x12d6f3){var _0x111ab8={},_0x3fe14b={},_0x456fa2={'count':0x0,'rows':[]};var _0x27fcaf=_['map'](db['WhatsappTransferReport'][_0x2680('0x2b')],function(_0xc058){return{'name':_0xc058[_0x2680('0x2c')],'type':_0xc058[_0x2680('0x2d')][_0x2680('0x2e')]};});_0x3fe14b[_0x2680('0x2f')]=_[_0x2680('0x30')](_0x27fcaf,_0x2680('0x28'));_0x3fe14b[_0x2680('0x31')]=_['keys'](_0x4fa279['query']);_0x3fe14b[_0x2680('0x32')]=_['intersection'](_0x3fe14b[_0x2680('0x2f')],_0x3fe14b['query']);_0x111ab8[_0x2680('0x33')]=_[_0x2680('0x34')](_0x3fe14b[_0x2680('0x2f')],qs['fields'](_0x4fa279[_0x2680('0x31')]['fields']));_0x111ab8[_0x2680('0x33')]=_0x111ab8[_0x2680('0x33')][_0x2680('0x35')]?_0x111ab8['attributes']:_0x3fe14b['model'];if(!_0x4fa279['query'][_0x2680('0x36')](_0x2680('0x37'))){_0x111ab8[_0x2680('0x1c')]=qs['limit'](_0x4fa279[_0x2680('0x31')][_0x2680('0x1c')]);_0x111ab8[_0x2680('0x38')]=qs['offset'](_0x4fa279[_0x2680('0x31')][_0x2680('0x38')]);}_0x111ab8[_0x2680('0x39')]=qs[_0x2680('0x3a')](_0x4fa279[_0x2680('0x31')]['sort']);_0x111ab8[_0x2680('0x3b')]=qs['filters'](_[_0x2680('0x3c')](_0x4fa279['query'],_0x3fe14b[_0x2680('0x32')]),_0x27fcaf);if(_0x4fa279[_0x2680('0x31')][_0x2680('0x3d')]){_0x111ab8['where']=_[_0x2680('0x3e')](_0x111ab8[_0x2680('0x3b')],{'$or':_[_0x2680('0x30')](_0x27fcaf,function(_0x81ea7){if(_0x81ea7[_0x2680('0x2d')]!=='VIRTUAL'){var _0x1f0f89={};_0x1f0f89[_0x81ea7[_0x2680('0x28')]]={'$like':'%'+_0x4fa279[_0x2680('0x31')]['filter']+'%'};return _0x1f0f89;}})});}_0x111ab8=_[_0x2680('0x3e')]({},_0x111ab8,_0x4fa279[_0x2680('0x3f')]);var _0x2f4a49={'where':_0x111ab8['where']};return db[_0x2680('0x40')][_0x2680('0x1e')](_0x2f4a49)[_0x2680('0x24')](function(_0x419679){_0x456fa2[_0x2680('0x1e')]=_0x419679;if(_0x4fa279[_0x2680('0x31')][_0x2680('0x41')]){_0x111ab8[_0x2680('0x42')]=[{'all':!![]}];}return db[_0x2680('0x40')][_0x2680('0x43')](_0x111ab8);})[_0x2680('0x24')](function(_0x50de39){_0x456fa2[_0x2680('0x44')]=_0x50de39;return _0x456fa2;})[_0x2680('0x24')](respondWithFilteredResult(_0x12d6f3,_0x111ab8))['catch'](handleError(_0x12d6f3,null));};exports[_0x2680('0x45')]=function(_0x2b8a15,_0x1ac14c){var _0x2b8334={'raw':!![],'where':{'id':_0x2b8a15[_0x2680('0x46')]['id']}},_0x18ddb9={};_0x18ddb9['model']=_[_0x2680('0x47')](db[_0x2680('0x40')][_0x2680('0x2b')]);_0x18ddb9['query']=_[_0x2680('0x47')](_0x2b8a15[_0x2680('0x31')]);_0x18ddb9[_0x2680('0x32')]=_['intersection'](_0x18ddb9['model'],_0x18ddb9['query']);_0x2b8334[_0x2680('0x33')]=_['intersection'](_0x18ddb9[_0x2680('0x2f')],qs[_0x2680('0x48')](_0x2b8a15[_0x2680('0x31')][_0x2680('0x48')]));_0x2b8334['attributes']=_0x2b8334[_0x2680('0x33')][_0x2680('0x35')]?_0x2b8334[_0x2680('0x33')]:_0x18ddb9['model'];if(_0x2b8a15[_0x2680('0x31')][_0x2680('0x41')]){_0x2b8334[_0x2680('0x42')]=[{'all':!![]}];}_0x2b8334=_[_0x2680('0x3e')]({},_0x2b8334,_0x2b8a15[_0x2680('0x3f')]);return db['WhatsappTransferReport'][_0x2680('0x49')](_0x2b8334)[_0x2680('0x24')](handleEntityNotFound(_0x1ac14c,null))['then'](respondWithResult(_0x1ac14c,null))[_0x2680('0x4a')](handleError(_0x1ac14c,null));};exports[_0x2680('0x4b')]=function(_0x30dc10,_0x3e8896){return db['WhatsappTransferReport'][_0x2680('0x4b')](_0x30dc10[_0x2680('0x4c')],{})[_0x2680('0x24')](respondWithResult(_0x3e8896,0xc9))[_0x2680('0x4a')](handleError(_0x3e8896,null));};exports[_0x2680('0x4d')]=function(_0x583505,_0x357845){if(_0x583505[_0x2680('0x4c')]['id']){delete _0x583505[_0x2680('0x4c')]['id'];}return db[_0x2680('0x40')][_0x2680('0x49')]({'where':{'id':_0x583505[_0x2680('0x46')]['id']}})[_0x2680('0x24')](handleEntityNotFound(_0x357845,null))[_0x2680('0x24')](saveUpdates(_0x583505[_0x2680('0x4c')],null))[_0x2680('0x24')](respondWithResult(_0x357845,null))[_0x2680('0x4a')](handleError(_0x357845,null));};exports[_0x2680('0x25')]=function(_0x266b41,_0x2c007f){return db[_0x2680('0x40')][_0x2680('0x49')]({'where':{'id':_0x266b41[_0x2680('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c007f,null))[_0x2680('0x24')](removeEntity(_0x2c007f,null))[_0x2680('0x4a')](handleError(_0x2c007f,null));};exports['describe']=function(_0x100fdd,_0x4b083f){return db[_0x2680('0x40')][_0x2680('0x4e')]()[_0x2680('0x24')](respondWithResult(_0x4b083f,null))[_0x2680('0x4a')](handleError(_0x4b083f,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index a92ab1e..c2ad948 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 _0x04df=['bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','../../config/logger','api','moment'];(function(_0x4a3044,_0x2ec4d9){var _0x7a00b3=function(_0x4fc2b5){while(--_0x4fc2b5){_0x4a3044['push'](_0x4a3044['shift']());}};_0x7a00b3(++_0x2ec4d9);}(_0x04df,0x194));var _0xf04d=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x04df[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf04d('0x0'))(_0xf04d('0x1'));var moment=require(_0xf04d('0x2'));var BPromise=require(_0xf04d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf04d('0x4'));var rimraf=require(_0xf04d('0x5'));var config=require(_0xf04d('0x6'));var attributes=require(_0xf04d('0x7'));module['exports']=function(_0x21ad92,_0x43795a){return _0x21ad92['define'](_0xf04d('0x8'),attributes,{'tableName':_0xf04d('0x9'),'paranoid':![],'indexes':[{'name':_0xf04d('0xa'),'fields':[_0xf04d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x75c6=['uniqueid','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_whatsapp_transfer'];(function(_0x3c375a,_0x43d36c){var _0x45d126=function(_0x27406e){while(--_0x27406e){_0x3c375a['push'](_0x3c375a['shift']());}};_0x45d126(++_0x43d36c);}(_0x75c6,0x1e5));var _0x675c=function(_0x569560,_0x16b989){_0x569560=_0x569560-0x0;var _0x3c1de0=_0x75c6[_0x569560];return _0x3c1de0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x675c('0x0'));var moment=require(_0x675c('0x1'));var BPromise=require(_0x675c('0x2'));var rp=require(_0x675c('0x3'));var fs=require('fs');var path=require(_0x675c('0x4'));var rimraf=require(_0x675c('0x5'));var config=require(_0x675c('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0x675c('0x7')]=function(_0xcf9dfe,_0x4592fe){return _0xcf9dfe[_0x675c('0x8')]('WhatsappTransferReport',attributes,{'tableName':_0x675c('0x9'),'paranoid':![],'indexes':[{'name':_0x675c('0xa'),'fields':[_0x675c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 1295750..5d69dac 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 _0xd5df=['WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x2d5801,_0x5611d7){var _0x220536=function(_0x42d3f7){while(--_0x42d3f7){_0x2d5801['push'](_0x2d5801['shift']());}};_0x220536(++_0x5611d7);}(_0xd5df,0x110));var _0xfd5d=function(_0x1fda66,_0x22b586){_0x1fda66=_0x1fda66-0x0;var _0x565a23=_0xd5df[_0x1fda66];return _0x565a23;};'use strict';var _=require(_0xfd5d('0x0'));var util=require(_0xfd5d('0x1'));var moment=require(_0xfd5d('0x2'));var BPromise=require(_0xfd5d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd5d('0x4'));var db=require(_0xfd5d('0x5'))['db'];var utils=require(_0xfd5d('0x6'));var logger=require(_0xfd5d('0x7'))('rpc');var config=require(_0xfd5d('0x8'));var jayson=require(_0xfd5d('0x9'));var client=jayson[_0xfd5d('0xa')][_0xfd5d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b6ac8,_0x57b0e8,_0x32be95){return new BPromise(function(_0x57de92,_0x2e36f1){return client[_0xfd5d('0xc')](_0x4b6ac8,_0x32be95)[_0xfd5d('0xd')](function(_0x261168){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x57b0e8,_0xfd5d('0xe'));logger[_0xfd5d('0xf')](_0xfd5d('0x10'),_0x57b0e8,'request\x20sent',JSON[_0xfd5d('0x11')](_0x261168));if(_0x261168[_0xfd5d('0x12')]){if(_0x261168['error'][_0xfd5d('0x13')]===0x1f4){logger[_0xfd5d('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x57b0e8,_0x261168[_0xfd5d('0x12')][_0xfd5d('0x14')]);return _0x2e36f1(_0x261168[_0xfd5d('0x12')][_0xfd5d('0x14')]);}logger[_0xfd5d('0x12')](_0xfd5d('0x15'),_0x57b0e8,_0x261168[_0xfd5d('0x12')][_0xfd5d('0x14')]);return _0x57de92(_0x261168[_0xfd5d('0x12')]['message']);}else{logger[_0xfd5d('0x16')](_0xfd5d('0x15'),_0x57b0e8,'request\x20sent');_0x57de92(_0x261168['result'][_0xfd5d('0x14')]);}})[_0xfd5d('0x17')](function(_0x376184){logger[_0xfd5d('0x12')](_0xfd5d('0x15'),_0x57b0e8,_0x376184);_0x2e36f1(_0x376184);});});} \ No newline at end of file +var _0xc820=['WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x21b411,_0x2045b5){var _0x4ffff9=function(_0x4db578){while(--_0x4db578){_0x21b411['push'](_0x21b411['shift']());}};_0x4ffff9(++_0x2045b5);}(_0xc820,0x1a9));var _0x0c82=function(_0x5a0c59,_0x8efe32){_0x5a0c59=_0x5a0c59-0x0;var _0x58367d=_0xc820[_0x5a0c59];return _0x58367d;};'use strict';var _=require(_0x0c82('0x0'));var util=require(_0x0c82('0x1'));var moment=require(_0x0c82('0x2'));var BPromise=require(_0x0c82('0x3'));var rs=require(_0x0c82('0x4'));var fs=require('fs');var Redis=require(_0x0c82('0x5'));var db=require(_0x0c82('0x6'))['db'];var utils=require(_0x0c82('0x7'));var logger=require(_0x0c82('0x8'))('rpc');var config=require(_0x0c82('0x9'));var jayson=require(_0x0c82('0xa'));var client=jayson[_0x0c82('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25de4f,_0x23679d,_0x4338e1){return new BPromise(function(_0x14eee9,_0x54e5b){return client[_0x0c82('0xc')](_0x25de4f,_0x4338e1)[_0x0c82('0xd')](function(_0xb5365){logger[_0x0c82('0xe')](_0x0c82('0xf'),_0x23679d,_0x0c82('0x10'));logger[_0x0c82('0x11')](_0x0c82('0x12'),_0x23679d,_0x0c82('0x10'),JSON['stringify'](_0xb5365));if(_0xb5365[_0x0c82('0x13')]){if(_0xb5365[_0x0c82('0x13')]['code']===0x1f4){logger[_0x0c82('0x13')](_0x0c82('0xf'),_0x23679d,_0xb5365['error'][_0x0c82('0x14')]);return _0x54e5b(_0xb5365[_0x0c82('0x13')][_0x0c82('0x14')]);}logger['error'](_0x0c82('0xf'),_0x23679d,_0xb5365['error'][_0x0c82('0x14')]);return _0x14eee9(_0xb5365[_0x0c82('0x13')][_0x0c82('0x14')]);}else{logger[_0x0c82('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x23679d,_0x0c82('0x10'));_0x14eee9(_0xb5365['result'][_0x0c82('0x14')]);}})[_0x0c82('0x15')](function(_0x514b7c){logger['error'](_0x0c82('0xf'),_0x23679d,_0x514b7c);_0x54e5b(_0x514b7c);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index e75cd56..52dc427 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd206=['./config/schedule/whatsapp','sequelize','sync','seedDB','then','default','info','start','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','Online\x20apps:','online','join','map','filter','status','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule'];(function(_0x206aee,_0x1e9dd5){var _0x330a42=function(_0x47c0bb){while(--_0x47c0bb){_0x206aee['push'](_0x206aee['shift']());}};_0x330a42(++_0x1e9dd5);}(_0xd206,0x107));var _0x6d20=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xd206[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x6d20('0x0'));var db=require(_0x6d20('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x6d20('0x2'));var rpc=require(_0x6d20('0x3'));var config=require(_0x6d20('0x4'));var logger=require('./config/logger')(_0x6d20('0x5'));var pm2=require(_0x6d20('0x6'));var pm2Config=require(_0x6d20('0x7'));var schedule=require(_0x6d20('0x8'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x6d20('0x9'));var transcribe=require('./config/schedule/transcribe');var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x6d20('0xa')][_0x6d20('0xb')]()['then'](function(){if(config[_0x6d20('0xc')]){return seedDb['default']();}})[_0x6d20('0xd')](function(){return checkLicense[_0x6d20('0xe')]();})['then'](function(){return rpc['listen']();})['then'](function(_0x2d5a4c){logger[_0x6d20('0xf')](_0x2d5a4c);return chat['start']();})[_0x6d20('0xd')](function(){return whatsapp['start']();})[_0x6d20('0xd')](function(){return schedule['start']();})['then'](function(){return transcribe['start']();})['then'](function(){return provider[_0x6d20('0x10')]();})[_0x6d20('0xd')](function(_0x3e3c61){logger[_0x6d20('0xf')](_0x3e3c61);return pm2[_0x6d20('0x10')](pm2Config);})[_0x6d20('0xd')](function(_0x56b632){var _0x375349=_0x56b632['filter'](function(_0x39a64f){return typeof _0x39a64f[_0x6d20('0x11')]==='number'&&_0x39a64f[_0x6d20('0x11')]>=0x0;});if(_0x375349[_0x6d20('0x12')]>0x0){throw new Error(_0x375349[_0x6d20('0x12')]+_0x6d20('0x13')+_['map'](_0x375349,function(_0x5ef31b){return'\x22'+_0x5ef31b[_0x6d20('0x14')][_0x6d20('0x15')]+'\x22';}));}logger['info'](_0x6d20('0x16'),_['map'](_['filter'](_0x56b632,{'status':_0x6d20('0x17')}),_0x6d20('0x15'))[_0x6d20('0x18')]());logger[_0x6d20('0xf')]('Offline\x20apps:',_[_0x6d20('0x19')](_[_0x6d20('0x1a')](_0x56b632,function(_0x35802d){return _0x35802d[_0x6d20('0x1b')]!==_0x6d20('0x17');}),_0x6d20('0x15'))[_0x6d20('0x18')]()||_0x6d20('0x1c'));console[_0x6d20('0x1d')](_0x6d20('0x1e'));})['catch'](function(_0x1c4121){console['log'](_0x6d20('0x1f'),_0x1c4121);logger['error'](_0x6d20('0x20'),_0x1c4121);process[_0x6d20('0x21')](0x1);});}main(); \ No newline at end of file +var _0x5a63=['default','listen','info','start','exitCode','number','length','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','filter','status','None','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','then'];(function(_0x3e961c,_0x5747e7){var _0x474f9c=function(_0x33f8ea){while(--_0x33f8ea){_0x3e961c['push'](_0x3e961c['shift']());}};_0x474f9c(++_0x5747e7);}(_0x5a63,0xe3));var _0x35a6=function(_0x54d40c,_0x3a87a6){_0x54d40c=_0x54d40c-0x0;var _0x49055f=_0x5a63[_0x54d40c];return _0x49055f;};'use strict';var _=require(_0x35a6('0x0'));var db=require(_0x35a6('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require('./config/license');var rpc=require(_0x35a6('0x2'));var config=require('./config/environment');var logger=require('./config/logger')(_0x35a6('0x3'));var pm2=require(_0x35a6('0x4'));var pm2Config=require(_0x35a6('0x5'));var schedule=require(_0x35a6('0x6'));var chat=require(_0x35a6('0x7'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x35a6('0x8'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x35a6('0x9')]['sync']()[_0x35a6('0xa')](function(){if(config['seedDB']){return seedDb[_0x35a6('0xb')]();}})[_0x35a6('0xa')](function(){return checkLicense[_0x35a6('0xb')]();})[_0x35a6('0xa')](function(){return rpc[_0x35a6('0xc')]();})['then'](function(_0x2899a8){logger[_0x35a6('0xd')](_0x2899a8);return chat[_0x35a6('0xe')]();})['then'](function(){return whatsapp[_0x35a6('0xe')]();})['then'](function(){return schedule[_0x35a6('0xe')]();})[_0x35a6('0xa')](function(){return transcribe[_0x35a6('0xe')]();})[_0x35a6('0xa')](function(){return provider[_0x35a6('0xe')]();})['then'](function(_0x436c0a){logger[_0x35a6('0xd')](_0x436c0a);return pm2[_0x35a6('0xe')](pm2Config);})[_0x35a6('0xa')](function(_0x250c7){var _0x30154b=_0x250c7['filter'](function(_0x32347a){return typeof _0x32347a[_0x35a6('0xf')]===_0x35a6('0x10')&&_0x32347a[_0x35a6('0xf')]>=0x0;});if(_0x30154b[_0x35a6('0x11')]>0x0){throw new Error(_0x30154b[_0x35a6('0x11')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x35a6('0x12')](_0x30154b,function(_0x4047d2){return'\x22'+_0x4047d2[_0x35a6('0x13')][_0x35a6('0x14')]+'\x22';}));}logger[_0x35a6('0xd')](_0x35a6('0x15'),_[_0x35a6('0x12')](_['filter'](_0x250c7,{'status':_0x35a6('0x16')}),_0x35a6('0x14'))[_0x35a6('0x17')]());logger['info'](_0x35a6('0x18'),_[_0x35a6('0x12')](_[_0x35a6('0x19')](_0x250c7,function(_0x4a68b6){return _0x4a68b6[_0x35a6('0x1a')]!==_0x35a6('0x16');}),'name')[_0x35a6('0x17')]()||_0x35a6('0x1b'));console['log']('App\x20Ready!');})[_0x35a6('0x1c')](function(_0x13f029){console[_0x35a6('0x1d')](_0x35a6('0x1e'),_0x13f029);logger[_0x35a6('0x1f')](_0x35a6('0x20'),_0x13f029);process[_0x35a6('0x21')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index a770b43..e5d13fa 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 _0x9c44=['showWebBar','lastLoginAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','user','ChatInteraction','findOne','params','then','status','disposition','unmanaged','json','Unmanaged.','catch','isAuthenticated','headers','authorization','startsWith','Basic','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','User','find','sub','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','use','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','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~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','sign','options','promisify','toString','hex','floor','now','HS512','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','crypto','util','moment','secrets','session','role','name','internal','email','userpic','voicePause','chatPause','faxPause','smsPause'];(function(_0x3f8282,_0x11b607){var _0x50f918=function(_0x3a37de){while(--_0x3a37de){_0x3f8282['push'](_0x3f8282['shift']());}};_0x50f918(++_0x11b607);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require(_0x49c4('0x0'));var licenseUtil=require(_0x49c4('0x1'));var encryptor=require(_0x49c4('0x2'));var _=require(_0x49c4('0x3'));var jwt=require(_0x49c4('0x4'));var expressJwt=require(_0x49c4('0x5'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0x49c4('0x6'));var BPromise=require('bluebird');var util=require(_0x49c4('0x7'));var moment=require(_0x49c4('0x8'));var validateJwt=expressJwt({'secret':config[_0x49c4('0x9')][_0x49c4('0xa')]});var userAttributes=['id',_0x49c4('0xb'),'fullname',_0x49c4('0xc'),_0x49c4('0xd'),_0x49c4('0xe'),_0x49c4('0xf'),'permissions','md5secret',_0x49c4('0x10'),_0x49c4('0x11'),'mailPause',_0x49c4('0x12'),_0x49c4('0x13'),'openchannelPause','pauseType',_0x49c4('0x14'),_0x49c4('0x15'),'lastPauseAt',_0x49c4('0x16'),_0x49c4('0x17'),'passwordResetAt',_0x49c4('0x18'),_0x49c4('0x19'),_0x49c4('0x1a'),_0x49c4('0x1b'),_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),'phoneBarPrefixRequired',_0x49c4('0x20'),_0x49c4('0x21'),_0x49c4('0x22'),_0x49c4('0x23'),_0x49c4('0x24'),'privacyEnabled',_0x49c4('0x25'),_0x49c4('0x26'),'downloadVoiceRecordings','downloadOmnichannelInteractions',_0x49c4('0x27'),_0x49c4('0x28'),_0x49c4('0x29'),'chatAutoanswer',_0x49c4('0x2a'),'emailAutoanswer',_0x49c4('0x2b'),_0x49c4('0x2c'),_0x49c4('0x2d'),_0x49c4('0x2e'),_0x49c4('0x2f'),_0x49c4('0x30'),_0x49c4('0x31'),_0x49c4('0x32'),_0x49c4('0x33')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])['use'](function(_0x1c99b1,_0x4f0b62,_0x592bb8){if(_0x1c99b1[_0x49c4('0x34')]){_0x592bb8();}else{return db[_0x49c4('0x35')][_0x49c4('0x36')]({'where':{'id':_0x1c99b1[_0x49c4('0x37')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0x49c4('0x38')](function(_0x9cb797){if(_0x9cb797&&_0x9cb797['closed']){return _0x4f0b62[_0x49c4('0x39')](_0x9cb797[_0x49c4('0x3a')]===_0x49c4('0x3b')?0x195:0x193)[_0x49c4('0x3c')]({'message':_0x9cb797['disposition']==='unmanaged'?_0x49c4('0x3d'):'Forbidden.'});}else{_0x592bb8();}})[_0x49c4('0x3e')](function(_0x3852b2){_0x592bb8(_0x3852b2);});}});};exports[_0x49c4('0x3f')]=function isAuthenticated(_0x372a47){return compose()['use'](function(_0x889909,_0x2b2793,_0x46e04d){var _0x4f28a2;if(_0x889909[_0x49c4('0x40')][_0x49c4('0x41')]){if(_[_0x49c4('0x42')](_0x889909[_0x49c4('0x40')][_0x49c4('0x41')],_0x49c4('0x43'))){var _0x46f7ea=basicAuth(_0x889909);db['User']['find']({'where':{'name':_0x46f7ea['name']}})[_0x49c4('0x38')](function(_0x7ee704){if(!_0x7ee704||!_0x7ee704[_0x49c4('0x44')](_0x46f7ea[_0x49c4('0x45')])){return _0x2b2793[_0x49c4('0x39')](0x191)['json']({'message':_0x49c4('0x46')});}_0x889909[_0x49c4('0x34')]={'id':_0x7ee704['id']};_0x46e04d();})[_0x49c4('0x3e')](function(_0x24bba9){_0x46e04d(_0x24bba9);});}else if(_['startsWith'](_0x889909['headers'][_0x49c4('0x41')],_0x49c4('0x47'))){validateJwt(_0x889909,_0x2b2793,_0x46e04d);}else{if(_0x372a47){_0x46e04d();}else{return _0x2b2793[_0x49c4('0x39')](0x193)[_0x49c4('0x3c')]({'message':_0x49c4('0x48')});}}}else if(_0x889909['query'][_0x49c4('0x49')]){try{var _0x84c621={'audience':hardwareConf[_0x49c4('0x4a')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x889909['query'][_0x49c4('0x49')],_0x84c621)[_0x49c4('0x38')](function(_0x3bec0a){return db[_0x49c4('0x4b')][_0x49c4('0x4c')]({'where':{'id':_0x3bec0a[_0x49c4('0x4d')]}})[_0x49c4('0x38')](function(_0x27ef5f){_0x4f28a2=_0x27ef5f;return db[_0x49c4('0x4e')]['findOne']({'where':{'id':0x1},'attributes':[_0x49c4('0x4f'),'blockDuration'],'raw':!![]});})[_0x49c4('0x38')](function(_0x349791){if(!_0x4f28a2||!_[_0x49c4('0x50')](_0x4f28a2[_0x49c4('0x51')],_0x3bec0a['nonce'])){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x52')});}if(_0x4f28a2['disabled']){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x53')});}if(_0x4f28a2[_0x49c4('0x54')]){if(_0x349791[_0x49c4('0x55')]>0x0){if(moment(_0x4f28a2[_0x49c4('0x56')])[_0x49c4('0x57')](_0x349791[_0x49c4('0x55')],_0x49c4('0x58'))>moment()){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x53')});}}_0x889909[_0x49c4('0x34')]={'id':_0x4f28a2['id']};_0x46e04d();});})[_0x49c4('0x3e')](function(){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x53')});});}catch(_0x248c0a){_0x46e04d(_0x248c0a);}}else if(_0x372a47){_0x46e04d();}else{return _0x2b2793[_0x49c4('0x39')](0x193)[_0x49c4('0x3c')]({'message':_0x49c4('0x48')});}})[_0x49c4('0x59')](function(_0x4e38bc,_0x212366,_0x49829e){if(_0x4e38bc[_0x49c4('0x34')]){db[_0x49c4('0x4b')][_0x49c4('0x4c')]({'where':{'id':_0x4e38bc[_0x49c4('0x34')]['id']},'attributes':userAttributes})[_0x49c4('0x38')](function(_0x281b83){if(!_0x281b83){return _0x212366['status'](0x194)['json']({'message':_0x49c4('0x5a')});}_0x4e38bc[_0x49c4('0x34')]=_0x281b83;_0x49829e();})[_0x49c4('0x3e')](function(_0x117151){_0x49829e(_0x117151);});}else if(_0x372a47){_0x49829e();}else{return _0x212366['status'](0x194)[_0x49c4('0x3c')]({'message':_0x49c4('0x5b')});}});};exports[_0x49c4('0x5c')]=function canUpdate(){return compose()[_0x49c4('0x59')](function(_0x81a674,_0x3bde49,_0x1a9593){return licenseUtil[_0x49c4('0x5d')]()[_0x49c4('0x38')](function(_0x5640d3){if(_0x5640d3[_0x49c4('0x5e')]){_0x1a9593();}else{return _0x3bde49['status'](0x193)[_0x49c4('0x3c')]({'message':_0x49c4('0x5f')});}})[_0x49c4('0x3e')](function(_0x258abe){_0x1a9593(_0x258abe);});});};exports[_0x49c4('0x60')]=function isWebrtcLicence(){return compose()['use'](function(_0x592e8e,_0x15b674,_0x384862){return licenseUtil[_0x49c4('0x5d')]()[_0x49c4('0x38')](function(_0x5d4790){if(_0x5d4790[_0x49c4('0x61')]){_0x384862();}else{return _0x15b674['status'](0x193)[_0x49c4('0x3c')]({'message':'Forbidden'});}})[_0x49c4('0x3e')](function(_0x906d3){_0x384862(_0x906d3);});});};exports[_0x49c4('0x62')]=function(_0x27adfe,_0x2d8087,_0x30bea5){_0x27adfe[_0x49c4('0x62')]=!![];return _0x30bea5();};exports['signToken']=function signToken(_0x3b731f){return signJwt(_0x3b731f);};exports[_0x49c4('0x63')]=function(_0x4a5c34,_0x1e1ac4){if(!_0x4a5c34[_0x49c4('0x34')]){return _0x1e1ac4[_0x49c4('0x39')](0x194)[_0x49c4('0x3c')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x5d8bf0={'payload':{'id':_0x4a5c34[_0x49c4('0x34')]['id'],'role':_0x4a5c34['user'][_0x49c4('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5d8bf0)[_0x49c4('0x38')](function(_0x3811b2){_0x1e1ac4[_0x49c4('0x64')](_0x49c4('0x65'),_0x3811b2);_0x1e1ac4[_0x49c4('0x66')](_0x49c4('0x67'));})['catch'](function(_0x1f26c2){return _0x1e1ac4[_0x49c4('0x39')](0x1f4)[_0x49c4('0x68')](_0x1f26c2);});};exports[_0x49c4('0x69')]=function(_0x17ef75){if(_[_0x49c4('0x6a')](_0x17ef75[_0x49c4('0x51')])||_[_0x49c4('0x6a')](_0x17ef75[_0x49c4('0x6b')])){return null;}else{return createJwt(_0x17ef75);}};exports[_0x49c4('0x6c')]=function(_0x5b822f){_0x5b822f['apiKeyNonce']=generateNonce();_0x5b822f[_0x49c4('0x6b')]=generateIssuedAt();return createJwt(_0x5b822f);};exports[_0x49c4('0x6d')]=function(_0x527e74,_0x59a8bc){var _0x77163d=_0x527e74['query']['apikey'];if(_0x77163d){var _0x3208c2={'nonce':_0x59a8bc[_0x49c4('0x51')],'iat':_0x59a8bc[_0x49c4('0x6b')],'audience':hardwareConf[_0x49c4('0x4a')](),'issuer':hardwareConf[_0x49c4('0x4a')]()};return verifyJwt(_0x77163d,_0x3208c2)[_0x49c4('0x38')](function(){return generateApiKey(_0x59a8bc);});}else{throw{'message':_0x49c4('0x6e')};}};exports['validatePasswordPattern']=function(_0x859dde){var _0xcc6a2b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xcc6a2b[_0x49c4('0x6f')](_0x859dde))throw new db[(_0x49c4('0x70'))][(_0x49c4('0x71'))](_0x49c4('0x72'));return;};exports['validatePasswordHistory']=function(_0x5c7ddd,_0x1ef0c1,_0x155c43){var _0x2a6308=encryptor[_0x49c4('0x73')](_0x1ef0c1)[_0x49c4('0x74')](',');for(var _0x6b2592=0x0;_0x6b2592<_0x155c43;_0x6b2592++){if(!_0x2a6308[_0x6b2592])break;if(_0x5c7ddd[_0x49c4('0x75')]()===_0x2a6308[_0x6b2592]['toLowerCase']()){var _0x45d715=util[_0x49c4('0x76')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x155c43);if(_0x155c43===0x1){_0x45d715=_0x49c4('0x77');}throw new db['Sequelize'][(_0x49c4('0x71'))](_0x45d715);}}return;};exports[_0x49c4('0x78')]=function(_0x9eaa84,_0x2fe89a){var _0x845f7e=_0x2fe89a?encryptor[_0x49c4('0x73')](_0x2fe89a)[_0x49c4('0x74')](','):[];if(_0x845f7e[_0x49c4('0x79')]===0x5){_0x845f7e['splice'](-0x1,0x1);}_0x845f7e[_0x49c4('0x7a')](_0x9eaa84);return encryptor[_0x49c4('0x7b')](_0x845f7e['join'](','));};function signJwt(_0x10dec7){var _0x299e74=BPromise['promisify'](jwt[_0x49c4('0x7c')],{'context':jwt});var _0x42e0e6=_0x10dec7['secret']||config['secrets']['session'];return new BPromise(function(_0x513879,_0xc43386){_0x299e74(_0x10dec7['payload'],_0x42e0e6,_0x10dec7[_0x49c4('0x7d')])[_0x49c4('0x38')](function(_0x515240){_0x513879(_0x515240);})[_0x49c4('0x3e')](function(_0xdb2b33){_0xc43386(_0xdb2b33);});});}function verifyJwt(_0x5ac9f0,_0x34272f,_0x3dcf4c){var _0x167e84=BPromise[_0x49c4('0x7e')](jwt['verify'],{'context':jwt});var _0x431921=_0x3dcf4c||config[_0x49c4('0x9')][_0x49c4('0xa')];return new BPromise(function(_0x20e97d,_0x5d3375){_0x167e84(_0x5ac9f0,_0x431921,_0x34272f)[_0x49c4('0x38')](function(_0x4a93bc){_0x20e97d(_0x4a93bc);})['catch'](function(_0x58259d){_0x5d3375(_0x58259d);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x49c4('0x7f')](_0x49c4('0x80'));}function generateIssuedAt(){return Math[_0x49c4('0x81')](Date[_0x49c4('0x82')]()/0x3e8)['toString']();}function createJwt(_0x4daa6d){var _0x340523={'payload':{'iat':_0x4daa6d[_0x49c4('0x6b')],'nonce':_0x4daa6d[_0x49c4('0x51')]},'options':{'algorithm':_0x49c4('0x83'),'subject':_0x4daa6d['id'][_0x49c4('0x7f')](),'issuer':hardwareConf[_0x49c4('0x4a')](),'audience':hardwareConf[_0x49c4('0x4a')]()}};return signJwt(_0x340523)[_0x49c4('0x38')](function(_0x4d49e0){return{'iat':_0x4daa6d[_0x49c4('0x6b')],'nonce':_0x4daa6d['apiKeyNonce'],'token':_0x4d49e0};});} \ No newline at end of file +var _0x008c=['The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','sign','session','payload','options','promisify','verify','randomBytes','hex','floor','HS512','toString','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','name','userpic','permissions','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','hotdesk','interface','userProfileId','privacyEnabled','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswer','smsAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','disposition','then','unmanaged','json','headers','startsWith','User','find','authenticate','pass','status','Wrong\x20credentials.','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','blockDuration','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','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~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x008c,0x188));var _0xc008=function(_0x57d232,_0x1eb10c){_0x57d232=_0x57d232-0x0;var _0x4c7e6d=_0x008c[_0x57d232];return _0x4c7e6d;};'use strict';var db=require(_0xc008('0x0'))['db'];var config=require(_0xc008('0x1'));var hardwareConf=require(_0xc008('0x2'));var licenseUtil=require(_0xc008('0x3'));var encryptor=require(_0xc008('0x4'));var _=require('lodash');var jwt=require(_0xc008('0x5'));var expressJwt=require(_0xc008('0x6'));var compose=require(_0xc008('0x7'));var basicAuth=require(_0xc008('0x8'));var crypto=require(_0xc008('0x9'));var BPromise=require(_0xc008('0xa'));var util=require(_0xc008('0xb'));var moment=require(_0xc008('0xc'));var validateJwt=expressJwt({'secret':config[_0xc008('0xd')]['session']});var userAttributes=['id',_0xc008('0xe'),'fullname',_0xc008('0xf'),'internal','email',_0xc008('0x10'),_0xc008('0x11'),'md5secret','voicePause','chatPause',_0xc008('0x12'),_0xc008('0x13'),'smsPause',_0xc008('0x14'),_0xc008('0x15'),_0xc008('0x16'),_0xc008('0x17'),_0xc008('0x18'),_0xc008('0x19'),_0xc008('0x1a'),'passwordResetAt','alias',_0xc008('0x1b'),'phoneBarAutoAnswerDelay',_0xc008('0x1c'),_0xc008('0x1d'),_0xc008('0x1e'),_0xc008('0x1f'),_0xc008('0x20'),'phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort',_0xc008('0x21'),_0xc008('0x22'),_0xc008('0x23'),_0xc008('0x24'),'settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions',_0xc008('0x25'),_0xc008('0x26'),'selectRecallMeCampaign',_0xc008('0x27'),'chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer',_0xc008('0x28'),'openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer',_0xc008('0x29')];exports[_0xc008('0x2a')]=function(){return this[_0xc008('0x2b')](!![])[_0xc008('0x2c')](function(_0x11cc75,_0x110128,_0x4f43e2){if(_0x11cc75[_0xc008('0x2d')]){_0x4f43e2();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x11cc75[_0xc008('0x2e')]['id']},'attributes':['id',_0xc008('0x2f'),_0xc008('0x30')],'raw':!![]})[_0xc008('0x31')](function(_0x5410f5){if(_0x5410f5&&_0x5410f5['closed']){return _0x110128['status'](_0x5410f5[_0xc008('0x30')]===_0xc008('0x32')?0x195:0x193)[_0xc008('0x33')]({'message':_0x5410f5[_0xc008('0x30')]==='unmanaged'?'Unmanaged.':'Forbidden.'});}else{_0x4f43e2();}})['catch'](function(_0x4caaf4){_0x4f43e2(_0x4caaf4);});}});};exports[_0xc008('0x2b')]=function isAuthenticated(_0x29ba43){return compose()[_0xc008('0x2c')](function(_0x529961,_0x24c14c,_0x32390d){var _0x209591;if(_0x529961[_0xc008('0x34')]['authorization']){if(_[_0xc008('0x35')](_0x529961[_0xc008('0x34')]['authorization'],'Basic')){var _0x539766=basicAuth(_0x529961);db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'name':_0x539766[_0xc008('0xf')]}})[_0xc008('0x31')](function(_0x1de04b){if(!_0x1de04b||!_0x1de04b[_0xc008('0x38')](_0x539766[_0xc008('0x39')])){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x3b')});}_0x529961[_0xc008('0x2d')]={'id':_0x1de04b['id']};_0x32390d();})[_0xc008('0x3c')](function(_0x596ee8){_0x32390d(_0x596ee8);});}else if(_[_0xc008('0x35')](_0x529961[_0xc008('0x34')]['authorization'],_0xc008('0x3d'))){validateJwt(_0x529961,_0x24c14c,_0x32390d);}else{if(_0x29ba43){_0x32390d();}else{return _0x24c14c[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x3e')});}}}else if(_0x529961[_0xc008('0x3f')][_0xc008('0x40')]){try{var _0x7cfbc5={'audience':hardwareConf[_0xc008('0x41')](),'issuer':hardwareConf[_0xc008('0x41')]()};verifyJwt(_0x529961['query'][_0xc008('0x40')],_0x7cfbc5)[_0xc008('0x31')](function(_0x459df4){return db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'id':_0x459df4[_0xc008('0x42')]}})[_0xc008('0x31')](function(_0x5d0e06){_0x209591=_0x5d0e06;return db[_0xc008('0x43')][_0xc008('0x44')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc008('0x45')],'raw':!![]});})[_0xc008('0x31')](function(_0x5e38d5){if(!_0x209591||!_[_0xc008('0x46')](_0x209591[_0xc008('0x47')],_0x459df4[_0xc008('0x48')])){return _0x24c14c['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x209591[_0xc008('0x49')]){return _0x24c14c['status'](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}if(_0x209591[_0xc008('0x4b')]){if(_0x5e38d5[_0xc008('0x45')]>0x0){if(moment(_0x209591[_0xc008('0x4c')])[_0xc008('0x4d')](_0x5e38d5[_0xc008('0x45')],_0xc008('0x4e'))>moment()){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}}else{return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}}_0x529961['user']={'id':_0x209591['id']};_0x32390d();});})[_0xc008('0x3c')](function(){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});});}catch(_0x49a16d){_0x32390d(_0x49a16d);}}else if(_0x29ba43){_0x32390d();}else{return _0x24c14c[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x3e')});}})[_0xc008('0x2c')](function(_0x2d142d,_0x5706bb,_0x398cdd){if(_0x2d142d[_0xc008('0x2d')]){db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'id':_0x2d142d[_0xc008('0x2d')]['id']},'attributes':userAttributes})['then'](function(_0xf4cc4b){if(!_0xf4cc4b){return _0x5706bb[_0xc008('0x3a')](0x194)[_0xc008('0x33')]({'message':_0xc008('0x4f')});}_0x2d142d['user']=_0xf4cc4b;_0x398cdd();})[_0xc008('0x3c')](function(_0xe37446){_0x398cdd(_0xe37446);});}else if(_0x29ba43){_0x398cdd();}else{return _0x5706bb[_0xc008('0x3a')](0x194)['json']({'message':_0xc008('0x50')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xc008('0x2c')](function(_0x5d3a72,_0x46fa8f,_0x213014){return licenseUtil['getLicense']()[_0xc008('0x31')](function(_0x24ba0f){if(_0x24ba0f[_0xc008('0x51')]){_0x213014();}else{return _0x46fa8f['status'](0x193)[_0xc008('0x33')]({'message':_0xc008('0x52')});}})[_0xc008('0x3c')](function(_0x44fc5d){_0x213014(_0x44fc5d);});});};exports[_0xc008('0x53')]=function isWebrtcLicence(){return compose()[_0xc008('0x2c')](function(_0x59ca2b,_0x47cafa,_0x5283a8){return licenseUtil[_0xc008('0x54')]()[_0xc008('0x31')](function(_0x103a83){if(_0x103a83[_0xc008('0x55')]){_0x5283a8();}else{return _0x47cafa[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x52')});}})[_0xc008('0x3c')](function(_0x572593){_0x5283a8(_0x572593);});});};exports['isMiddleware']=function(_0x516e43,_0x2d5a49,_0x2651cf){_0x516e43[_0xc008('0x56')]=!![];return _0x2651cf();};exports['signToken']=function signToken(_0x28bc33){return signJwt(_0x28bc33);};exports[_0xc008('0x57')]=function(_0x17ab1a,_0x1c2c50){if(!_0x17ab1a[_0xc008('0x2d')]){return _0x1c2c50[_0xc008('0x3a')](0x194)[_0xc008('0x33')]({'message':_0xc008('0x58')});}var _0x3fd7d9={'payload':{'id':_0x17ab1a[_0xc008('0x2d')]['id'],'role':_0x17ab1a['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3fd7d9)[_0xc008('0x31')](function(_0x51cb14){_0x1c2c50[_0xc008('0x59')](_0xc008('0x5a'),_0x51cb14);_0x1c2c50[_0xc008('0x5b')]('/dashboards/general');})[_0xc008('0x3c')](function(_0x32b435){return _0x1c2c50[_0xc008('0x3a')](0x1f4)[_0xc008('0x5c')](_0x32b435);});};exports[_0xc008('0x5d')]=function(_0x51105f){if(_[_0xc008('0x5e')](_0x51105f[_0xc008('0x47')])||_['isNil'](_0x51105f[_0xc008('0x5f')])){return null;}else{return createJwt(_0x51105f);}};exports[_0xc008('0x60')]=function(_0x5b5fbf){_0x5b5fbf['apiKeyNonce']=generateNonce();_0x5b5fbf[_0xc008('0x5f')]=generateIssuedAt();return createJwt(_0x5b5fbf);};exports[_0xc008('0x61')]=function(_0x20947b,_0x30d0aa){var _0x14b6a0=_0x20947b['query']['apikey'];if(_0x14b6a0){var _0x34b72a={'nonce':_0x30d0aa['apiKeyNonce'],'iat':_0x30d0aa[_0xc008('0x5f')],'audience':hardwareConf[_0xc008('0x41')](),'issuer':hardwareConf[_0xc008('0x41')]()};return verifyJwt(_0x14b6a0,_0x34b72a)[_0xc008('0x31')](function(){return generateApiKey(_0x30d0aa);});}else{throw{'message':_0xc008('0x62')};}};exports[_0xc008('0x63')]=function(_0x49d8b0){var _0x2ea742=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2ea742[_0xc008('0x64')](_0x49d8b0))throw new db[(_0xc008('0x65'))][(_0xc008('0x66'))](_0xc008('0x67'));return;};exports['validatePasswordHistory']=function(_0x41fae3,_0x4fdab4,_0x535e6e){var _0x5dbfca=encryptor[_0xc008('0x68')](_0x4fdab4)[_0xc008('0x69')](',');for(var _0x5dfb69=0x0;_0x5dfb69<_0x535e6e;_0x5dfb69++){if(!_0x5dbfca[_0x5dfb69])break;if(_0x41fae3['toLowerCase']()===_0x5dbfca[_0x5dfb69][_0xc008('0x6a')]()){var _0x2d8361=util[_0xc008('0x6b')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x535e6e);if(_0x535e6e===0x1){_0x2d8361=_0xc008('0x6c');}throw new db[(_0xc008('0x65'))][(_0xc008('0x66'))](_0x2d8361);}}return;};exports[_0xc008('0x6d')]=function(_0x5baff1,_0x4022dd){var _0x4eaa6d=_0x4022dd?encryptor[_0xc008('0x68')](_0x4022dd)[_0xc008('0x69')](','):[];if(_0x4eaa6d[_0xc008('0x6e')]===0x5){_0x4eaa6d[_0xc008('0x6f')](-0x1,0x1);}_0x4eaa6d[_0xc008('0x70')](_0x5baff1);return encryptor[_0xc008('0x71')](_0x4eaa6d['join'](','));};function signJwt(_0x375e71){var _0x570001=BPromise['promisify'](jwt[_0xc008('0x72')],{'context':jwt});var _0x30aa1e=_0x375e71['secret']||config[_0xc008('0xd')][_0xc008('0x73')];return new BPromise(function(_0x3e373e,_0x4517c0){_0x570001(_0x375e71[_0xc008('0x74')],_0x30aa1e,_0x375e71[_0xc008('0x75')])[_0xc008('0x31')](function(_0x57ce9a){_0x3e373e(_0x57ce9a);})[_0xc008('0x3c')](function(_0x462e1e){_0x4517c0(_0x462e1e);});});}function verifyJwt(_0x3bfb15,_0x2a60e6,_0xb3ca0f){var _0x167425=BPromise[_0xc008('0x76')](jwt[_0xc008('0x77')],{'context':jwt});var _0xbc430a=_0xb3ca0f||config[_0xc008('0xd')][_0xc008('0x73')];return new BPromise(function(_0x2b5eb6,_0x131b81){_0x167425(_0x3bfb15,_0xbc430a,_0x2a60e6)[_0xc008('0x31')](function(_0x4e0251){_0x2b5eb6(_0x4e0251);})[_0xc008('0x3c')](function(_0x2e5467){_0x131b81(_0x2e5467);});});}function generateNonce(){return crypto[_0xc008('0x78')](0x10)['toString'](_0xc008('0x79'));}function generateIssuedAt(){return Math[_0xc008('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x1a03fd){var _0x2a4c2b={'payload':{'iat':_0x1a03fd[_0xc008('0x5f')],'nonce':_0x1a03fd[_0xc008('0x47')]},'options':{'algorithm':_0xc008('0x7b'),'subject':_0x1a03fd['id'][_0xc008('0x7c')](),'issuer':hardwareConf[_0xc008('0x41')](),'audience':hardwareConf[_0xc008('0x41')]()}};return signJwt(_0x2a4c2b)[_0xc008('0x31')](function(_0x1b059b){return{'iat':_0x1a03fd[_0xc008('0x5f')],'nonce':_0x1a03fd['apiKeyNonce'],'token':_0x1b059b};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index eb5dae3..65d18a2 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 _0x5e79=['hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createReadStream','encryptString','utf8','base64','decryptString','secret','createDecipher','crypto','../../config/environment','../../config/logger','app','secrets','session','aes192','encrypt','algorithm','join','test','getCiphers','filter'];(function(_0x32752f,_0x38cf1c){var _0x4c98e6=function(_0x18cd12){while(--_0x18cd12){_0x32752f['push'](_0x32752f['shift']());}};_0x4c98e6(++_0x38cf1c);}(_0x5e79,0x13d));var _0x95e7=function(_0x3cc1bf,_0x34455c){_0x3cc1bf=_0x3cc1bf-0x0;var _0x3e867d=_0x5e79[_0x3cc1bf];return _0x3e867d;};'use strict';var crypto=require(_0x95e7('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x95e7('0x1'));var logger=require(_0x95e7('0x2'))(_0x95e7('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x95e7('0x4')][_0x95e7('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x95e7('0x6')};if(config['encrypt']&&config[_0x95e7('0x7')][_0x95e7('0x8')]){var isSupported=isAlgorithmSupported(config[_0x95e7('0x7')][_0x95e7('0x8')]);if(isSupported){fileOptions[_0x95e7('0x8')]=config[_0x95e7('0x7')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x95e7('0x9')](',\x20');logger['error'](config['encrypt']['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0xb662f4){return AES_SUPPORTED_RX[_0x95e7('0xa')](_0xb662f4);}function getSupportedCiphers(){return crypto[_0x95e7('0xb')]()[_0x95e7('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0xe425a8){return getSupportedCiphers()['indexOf'](_0xe425a8)>-0x1;}function combineOptions(_0x21c4ff){var _0xdfb322={};for(var _0x41fdb0 in fileOptions){if(fileOptions[_0x95e7('0xd')](_0x41fdb0)){_0xdfb322[_0x41fdb0]=fileOptions[_0x41fdb0];}}if(_0x21c4ff){for(var _0x498f4e in _0x21c4ff){if(_0x21c4ff[_0x95e7('0xd')](_0x498f4e)){_0xdfb322[_0x498f4e]=_0x21c4ff[_0x498f4e];}}}return _0xdfb322;}exports[_0x95e7('0xe')]=function(_0x232da1,_0xff4f93,_0xf5120a,_0x417203){return new BPromise(function(_0x5ea9ba,_0x540b06){_0x417203=combineOptions(_0x417203);var _0x81c701=new Buffer(_0xf5120a);var _0x414bc2=fs['createReadStream'](_0x232da1);var _0x37ef2f=fs[_0x95e7('0xf')](_0xff4f93);var _0x18a906=crypto[_0x95e7('0x10')](_0x417203[_0x95e7('0x8')],_0x81c701);_0x414bc2['on'](_0x95e7('0x11'),function(_0xc5b952){var _0x1f7159=new Buffer(_0x18a906[_0x95e7('0x12')](_0xc5b952),_0x95e7('0x13'));_0x37ef2f[_0x95e7('0x14')](_0x1f7159);});_0x414bc2['on'](_0x95e7('0x15'),function(){try{var _0x114090=new Buffer(_0x18a906[_0x95e7('0x16')](_0x95e7('0x13')),'binary');_0x37ef2f['write'](_0x114090);_0x37ef2f[_0x95e7('0x15')]();_0x37ef2f['on'](_0x95e7('0x17'),function(){return _0x5ea9ba(_0xff4f93);});}catch(_0xbb40f7){fs[_0x95e7('0x18')](_0xff4f93);return _0x540b06(_0xbb40f7);}});});};exports[_0x95e7('0x19')]=function(_0x204e0f,_0x3d2859,_0x594467,_0x315082){return new BPromise(function(_0x574130,_0x1dc1da){_0x315082=combineOptions(_0x315082);var _0x1a6670=new Buffer(_0x594467);var _0x2b1cd9=fs[_0x95e7('0x1a')](_0x204e0f);var _0x1ceaab=fs[_0x95e7('0xf')](_0x3d2859);var _0x44ff70=crypto['createDecipher'](_0x315082[_0x95e7('0x8')],_0x1a6670);_0x2b1cd9['on'](_0x95e7('0x11'),function(_0x55dbda){var _0x576e66=new Buffer(_0x44ff70['update'](_0x55dbda),_0x95e7('0x13'));_0x1ceaab[_0x95e7('0x14')](_0x576e66);});_0x2b1cd9['on'](_0x95e7('0x15'),function(){try{var _0x100f47=new Buffer(_0x44ff70[_0x95e7('0x16')]('binary'),_0x95e7('0x13'));_0x1ceaab['write'](_0x100f47);_0x1ceaab['end']();_0x1ceaab['on'](_0x95e7('0x17'),function(){return _0x574130(_0x3d2859);});}catch(_0x355624){fs['unlink'](_0x3d2859);return _0x1dc1da(_0x355624);}});});};exports[_0x95e7('0x1b')]=function(_0x217c59,_0x3a2896,_0x3e18a7){var _0x18c9ec=_0x3e18a7||stringOptions[_0x95e7('0x8')];var _0x1fcc35=_0x3a2896||stringOptions['secret'];var _0x2ac195=crypto[_0x95e7('0x10')](_0x18c9ec,_0x1fcc35);var _0x2bdf30=_0x2ac195['update'](_0x217c59,_0x95e7('0x1c'),_0x95e7('0x1d'));_0x2bdf30+=_0x2ac195[_0x95e7('0x16')](_0x95e7('0x1d'));return _0x2bdf30;};exports[_0x95e7('0x1e')]=function(_0x251831,_0x398254,_0xcc7731){var _0x1436b8=_0xcc7731||stringOptions['algorithm'];var _0x24ed15=_0x398254||stringOptions[_0x95e7('0x1f')];var _0x3db8f2=crypto[_0x95e7('0x20')](_0x1436b8,_0x24ed15);var _0x49cb6a=_0x3db8f2[_0x95e7('0x12')](_0x251831,_0x95e7('0x1d'),_0x95e7('0x1c'));_0x49cb6a+=_0x3db8f2['final'](_0x95e7('0x1c'));return _0x49cb6a;}; \ No newline at end of file +var _0x135f=['secret','createDecipher','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','encryptFile','createReadStream','createCipher','data','binary','write','end','final','close','unlink','createWriteStream','update','encryptString','utf8','base64','decryptString'];(function(_0x180271,_0x2a7b1e){var _0x1cf12f=function(_0x181e42){while(--_0x181e42){_0x180271['push'](_0x180271['shift']());}};_0x1cf12f(++_0x2a7b1e);}(_0x135f,0x1a6));var _0xf135=function(_0x55ae84,_0x34d710){_0x55ae84=_0x55ae84-0x0;var _0x426fd6=_0x135f[_0x55ae84];return _0x426fd6;};'use strict';var crypto=require(_0xf135('0x0'));var fs=require('fs');var BPromise=require(_0xf135('0x1'));var _=require(_0xf135('0x2'));var config=require(_0xf135('0x3'));var logger=require(_0xf135('0x4'))(_0xf135('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xf135('0x6')][_0xf135('0x7')],'algorithm':_0xf135('0x8')};const fileOptions={'algorithm':_0xf135('0x9')};if(config['encrypt']&&config[_0xf135('0xa')][_0xf135('0xb')]){var isSupported=isAlgorithmSupported(config[_0xf135('0xa')]['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0xf135('0xa')][_0xf135('0xb')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xf135('0xc')](config[_0xf135('0xa')][_0xf135('0xb')],_0xf135('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x53501d){return AES_SUPPORTED_RX[_0xf135('0xe')](_0x53501d);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xf135('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x4baf95){return getSupportedCiphers()[_0xf135('0x10')](_0x4baf95)>-0x1;}function combineOptions(_0x2ea45a){var _0x2a8620={};for(var _0x4b516a in fileOptions){if(fileOptions['hasOwnProperty'](_0x4b516a)){_0x2a8620[_0x4b516a]=fileOptions[_0x4b516a];}}if(_0x2ea45a){for(var _0x10433e in _0x2ea45a){if(_0x2ea45a['hasOwnProperty'](_0x10433e)){_0x2a8620[_0x10433e]=_0x2ea45a[_0x10433e];}}}return _0x2a8620;}exports[_0xf135('0x11')]=function(_0x27580d,_0x245c35,_0x4eab17,_0x46a7f3){return new BPromise(function(_0x54d701,_0x88465f){_0x46a7f3=combineOptions(_0x46a7f3);var _0x52578a=new Buffer(_0x4eab17);var _0x18e60b=fs[_0xf135('0x12')](_0x27580d);var _0x3da6b6=fs['createWriteStream'](_0x245c35);var _0x26ef72=crypto[_0xf135('0x13')](_0x46a7f3['algorithm'],_0x52578a);_0x18e60b['on'](_0xf135('0x14'),function(_0x3e3abf){var _0x2ca544=new Buffer(_0x26ef72['update'](_0x3e3abf),_0xf135('0x15'));_0x3da6b6[_0xf135('0x16')](_0x2ca544);});_0x18e60b['on'](_0xf135('0x17'),function(){try{var _0xc91cf0=new Buffer(_0x26ef72[_0xf135('0x18')](_0xf135('0x15')),_0xf135('0x15'));_0x3da6b6['write'](_0xc91cf0);_0x3da6b6[_0xf135('0x17')]();_0x3da6b6['on'](_0xf135('0x19'),function(){return _0x54d701(_0x245c35);});}catch(_0x5919a1){fs[_0xf135('0x1a')](_0x245c35);return _0x88465f(_0x5919a1);}});});};exports['decryptFile']=function(_0x25e377,_0x18b924,_0xec6b86,_0x21d67b){return new BPromise(function(_0x359363,_0xcbd7a){_0x21d67b=combineOptions(_0x21d67b);var _0x1ce51b=new Buffer(_0xec6b86);var _0x21d91e=fs[_0xf135('0x12')](_0x25e377);var _0x1fd986=fs[_0xf135('0x1b')](_0x18b924);var _0x1c7aae=crypto['createDecipher'](_0x21d67b[_0xf135('0xb')],_0x1ce51b);_0x21d91e['on']('data',function(_0x51fd51){var _0x31a802=new Buffer(_0x1c7aae[_0xf135('0x1c')](_0x51fd51),_0xf135('0x15'));_0x1fd986[_0xf135('0x16')](_0x31a802);});_0x21d91e['on'](_0xf135('0x17'),function(){try{var _0x1ca320=new Buffer(_0x1c7aae[_0xf135('0x18')]('binary'),'binary');_0x1fd986[_0xf135('0x16')](_0x1ca320);_0x1fd986[_0xf135('0x17')]();_0x1fd986['on'](_0xf135('0x19'),function(){return _0x359363(_0x18b924);});}catch(_0x509ae4){fs[_0xf135('0x1a')](_0x18b924);return _0xcbd7a(_0x509ae4);}});});};exports[_0xf135('0x1d')]=function(_0x10cdcb,_0x1a6c16,_0x2bdca5){var _0x3158ee=_0x2bdca5||stringOptions['algorithm'];var _0x21b92f=_0x1a6c16||stringOptions['secret'];var _0x165301=crypto[_0xf135('0x13')](_0x3158ee,_0x21b92f);var _0x4ea1e8=_0x165301['update'](_0x10cdcb,_0xf135('0x1e'),_0xf135('0x1f'));_0x4ea1e8+=_0x165301['final'](_0xf135('0x1f'));return _0x4ea1e8;};exports[_0xf135('0x20')]=function(_0x2adf7c,_0x137a39,_0x3c59a7){var _0x4864e8=_0x3c59a7||stringOptions[_0xf135('0xb')];var _0x25162e=_0x137a39||stringOptions[_0xf135('0x21')];var _0x164ec7=crypto[_0xf135('0x22')](_0x4864e8,_0x25162e);var _0x4c77ca=_0x164ec7[_0xf135('0x1c')](_0x2adf7c,_0xf135('0x1f'),'utf8');_0x4c77ca+=_0x164ec7[_0xf135('0x18')](_0xf135('0x1e'));return _0x4c77ca;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 6590dbd..041233c 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 _0xa35a=['%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','inspect','Failed','finally','exit','path','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Setting','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','length','range','num','isInteger','forEach','push'];(function(_0x1c136c,_0x428b77){var _0x4dd978=function(_0x24cc56){while(--_0x24cc56){_0x1c136c['push'](_0x1c136c['shift']());}};_0x4dd978(++_0x428b77);}(_0xa35a,0x133));var _0xaa35=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xa35a[_0x2c7618];return _0x5ce3f0;};'use strict';var util=require('util');var path=require(_0xaa35('0x0'));var _=require('lodash');var csv=require(_0xaa35('0x1'));var fs=require('fs');var BPromise=require(_0xaa35('0x2'));var zipdir=require(_0xaa35('0x3'));var rimraf=require(_0xaa35('0x4'));var db=require(_0xaa35('0x5'))['db'];var dbH=require(_0xaa35('0x5'))[_0xaa35('0x6')];var logger=require(_0xaa35('0x7'))(_0xaa35('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xaa35('0x9')][0x2]);var QUERY=process[_0xaa35('0x9')][0x3];var PATH=process[_0xaa35('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x326e5e,_0x36ec5a){var _0x527e65={'status':_0x326e5e};var _0x2849af={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x36ec5a){_0x527e65[_0xaa35('0xa')]=_0x36ec5a;}return db['AnalyticExtractedReport'][_0xaa35('0xb')](_0x527e65,_0x2849af);}function main(){var _0x3364ba=0x1388;var _0x5306;logger[_0xaa35('0xc')](util[_0xaa35('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xaa35('0xe')][_0xaa35('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xaa35('0x10'),_0xaa35('0x11')]})[_0xaa35('0x12')](function(_0x575668){if(_0x575668){_0x5306=_0x575668;_0x3364ba=_0x5306[_0xaa35('0x11')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0xaa35('0x13')](util['format'](_0xaa35('0x14'),QUERY),{'type':dbH[_0xaa35('0x15')]['QueryTypes'][_0xaa35('0x16')]});})[_0xaa35('0x12')](function(_0x500f3a){if(!_0x500f3a[0x0]['num']){return analyticExtractedReport('Empty');}var _0x462280=[];var _0x291fc9=0x0;if(_0x5306[_0xaa35('0x10')]){if(_0x500f3a&&_0x500f3a[_0xaa35('0x17')]){var _0x25dc4a=_[_0xaa35('0x18')](_0x500f3a[0x0][_0xaa35('0x19')]/_0x3364ba);var _0x2b6789=Number[_0xaa35('0x1a')](_0x500f3a[0x0][_0xaa35('0x19')]/_0x3364ba)?_0x500f3a[0x0][_0xaa35('0x19')]%_0x3364ba:0x0;_0x25dc4a[_0xaa35('0x1b')](function(_0x1d1d58){if(_0x1d1d58>0x0){_0x291fc9+=_0x3364ba;}_0x462280[_0xaa35('0x1c')](dbH[_0xaa35('0x15')][_0xaa35('0x13')](util['format'](_0xaa35('0x1d'),QUERY,_0x3364ba,_0x291fc9),{'type':dbH[_0xaa35('0x15')][_0xaa35('0x1e')][_0xaa35('0x16')]}));});if(_0x2b6789>0x0){_0x291fc9+=_0x3364ba;_0x462280['push'](dbH[_0xaa35('0x15')][_0xaa35('0x13')](util[_0xaa35('0xd')](_0xaa35('0x1d'),QUERY,_0x2b6789,_0x291fc9),{'type':dbH['sequelize'][_0xaa35('0x1e')][_0xaa35('0x16')]}));}}}else{_0x462280[_0xaa35('0x1c')](dbH[_0xaa35('0x15')][_0xaa35('0x13')](QUERY,{'type':dbH['sequelize'][_0xaa35('0x1e')][_0xaa35('0x16')]}));}var _0x11695e=path[_0xaa35('0x1f')](PATH);var _0x247be6=path['basename'](PATH,'.csv');var _0x1a3a03=_0x5306['split']&&_0x462280[_0xaa35('0x17')]>0x1;var _0x588807=[];if(!fs['existsSync'](path[_0xaa35('0x20')](_0x11695e,_0x247be6))&&_0x1a3a03){fs[_0xaa35('0x21')](path[_0xaa35('0x20')](_0x11695e,_0x247be6));}return BPromise[_0xaa35('0x22')](_0x462280,function(_0x376057){_0x588807[_0xaa35('0x1c')](_0x376057);})[_0xaa35('0x12')](function(){for(var _0x17374a=0x0;_0x17374a<_0x588807['length'];_0x17374a+=0x1){var _0x2cbf94;var _0x41184c=_0x588807[_0x17374a];if(_0x1a3a03){_0x2cbf94=path['join'](_0x11695e,_0x247be6,util[_0xaa35('0xd')](_0xaa35('0x23'),_0x247be6,_0x17374a,_0xaa35('0x24')));}else{_0x2cbf94=path[_0xaa35('0x20')](_0x11695e,util['format'](_0xaa35('0x25'),_0x247be6,_0xaa35('0x24')));}fs[_0xaa35('0x26')](_0x2cbf94,csv(_0x41184c));}})[_0xaa35('0x12')](function(){if(_0x1a3a03){return new Promise(function(_0x5a1243){zipdir(path[_0xaa35('0x20')](_0x11695e,_0x247be6),{'saveTo':path[_0xaa35('0x20')](_0x11695e,util[_0xaa35('0xd')](_0xaa35('0x25'),_0x247be6,_0xaa35('0x27')))},function(_0x3359b2,_0x4863e5){rimraf(path[_0xaa35('0x20')](_0x11695e,_0x247be6),function(){});_0x5a1243(_0xaa35('0x28'));});});}})[_0xaa35('0x12')](function(){logger[_0xaa35('0xc')](util['format'](_0xaa35('0x29'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x1a3a03?util['format'](_0xaa35('0x25'),_0x247be6,_0x1a3a03?_0xaa35('0x27'):'csv'):null);});})['catch'](function(_0x2e46d0){logger[_0xaa35('0xc')](util[_0xaa35('0xd')](_0xaa35('0x2a'),EXTRACTED_REPORT_ID,_0xaa35('0x2b')),util[_0xaa35('0x2c')](_0x2e46d0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xaa35('0x2d'));})[_0xaa35('0x2e')](function(){process[_0xaa35('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x7840=['sequelize','QueryTypes','SELECT','num','split','length','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','join','each','%s%d.%s','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','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','splitSizeCsv','then'];(function(_0x4237a6,_0x2c950b){var _0x5dcabe=function(_0x21dd92){while(--_0x21dd92){_0x4237a6['push'](_0x4237a6['shift']());}};_0x5dcabe(++_0x2c950b);}(_0x7840,0xcf));var _0x0784=function(_0x259117,_0x42513e){_0x259117=_0x259117-0x0;var _0x5cf948=_0x7840[_0x259117];return _0x5cf948;};'use strict';var util=require(_0x0784('0x0'));var path=require(_0x0784('0x1'));var _=require(_0x0784('0x2'));var csv=require(_0x0784('0x3'));var fs=require('fs');var BPromise=require(_0x0784('0x4'));var zipdir=require(_0x0784('0x5'));var rimraf=require('rimraf');var db=require(_0x0784('0x6'))['db'];var dbH=require(_0x0784('0x6'))['dbH'];var logger=require('../../config/logger')(_0x0784('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x0784('0x8')][0x2]);var QUERY=process[_0x0784('0x8')][0x3];var PATH=process[_0x0784('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x331266,_0x2867fc){var _0x4e59a3={'status':_0x331266};var _0x5123e5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2867fc){_0x4e59a3[_0x0784('0x9')]=_0x2867fc;}return db[_0x0784('0xa')][_0x0784('0xb')](_0x4e59a3,_0x5123e5);}function main(){var _0x58eb40=0x1388;var _0x24d1ef;logger[_0x0784('0xc')](util[_0x0784('0xd')](_0x0784('0xe'),EXTRACTED_REPORT_ID,_0x0784('0xf')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})['then'](function(_0x259f26){if(_0x259f26){_0x24d1ef=_0x259f26;_0x58eb40=_0x24d1ef[_0x0784('0x10')]||0x1388;}})[_0x0784('0x11')](function(){return dbH[_0x0784('0x12')]['query'](util[_0x0784('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0784('0x12')][_0x0784('0x13')][_0x0784('0x14')]});})[_0x0784('0x11')](function(_0x499cac){if(!_0x499cac[0x0][_0x0784('0x15')]){return analyticExtractedReport('Empty');}var _0x1664ad=[];var _0x342549=0x0;if(_0x24d1ef[_0x0784('0x16')]){if(_0x499cac&&_0x499cac[_0x0784('0x17')]){var _0xdf201f=_['range'](_0x499cac[0x0][_0x0784('0x15')]/_0x58eb40);var _0xe4f010=Number[_0x0784('0x18')](_0x499cac[0x0][_0x0784('0x15')]/_0x58eb40)?_0x499cac[0x0]['num']%_0x58eb40:0x0;_0xdf201f[_0x0784('0x19')](function(_0x4e0a87){if(_0x4e0a87>0x0){_0x342549+=_0x58eb40;}_0x1664ad['push'](dbH[_0x0784('0x12')][_0x0784('0x1a')](util[_0x0784('0xd')](_0x0784('0x1b'),QUERY,_0x58eb40,_0x342549),{'type':dbH[_0x0784('0x12')][_0x0784('0x13')][_0x0784('0x14')]}));});if(_0xe4f010>0x0){_0x342549+=_0x58eb40;_0x1664ad[_0x0784('0x1c')](dbH['sequelize'][_0x0784('0x1a')](util['format'](_0x0784('0x1b'),QUERY,_0xe4f010,_0x342549),{'type':dbH[_0x0784('0x12')][_0x0784('0x13')][_0x0784('0x14')]}));}}}else{_0x1664ad[_0x0784('0x1c')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0x0784('0x13')][_0x0784('0x14')]}));}var _0x2ac139=path[_0x0784('0x1d')](PATH);var _0x486c97=path[_0x0784('0x1e')](PATH,'.csv');var _0x2def0a=_0x24d1ef[_0x0784('0x16')]&&_0x1664ad[_0x0784('0x17')]>0x1;var _0x2d8e17=[];if(!fs['existsSync'](path[_0x0784('0x1f')](_0x2ac139,_0x486c97))&&_0x2def0a){fs['mkdirSync'](path[_0x0784('0x1f')](_0x2ac139,_0x486c97));}return BPromise[_0x0784('0x20')](_0x1664ad,function(_0x13ec80){_0x2d8e17['push'](_0x13ec80);})[_0x0784('0x11')](function(){for(var _0x1377cf=0x0;_0x1377cf<_0x2d8e17['length'];_0x1377cf+=0x1){var _0x1ec28d;var _0x4ae69a=_0x2d8e17[_0x1377cf];if(_0x2def0a){_0x1ec28d=path['join'](_0x2ac139,_0x486c97,util[_0x0784('0xd')](_0x0784('0x21'),_0x486c97,_0x1377cf,_0x0784('0x22')));}else{_0x1ec28d=path[_0x0784('0x1f')](_0x2ac139,util['format'](_0x0784('0x23'),_0x486c97,_0x0784('0x22')));}fs['writeFileSync'](_0x1ec28d,csv(_0x4ae69a));}})['then'](function(){if(_0x2def0a){return new Promise(function(_0x1c14b7){zipdir(path['join'](_0x2ac139,_0x486c97),{'saveTo':path[_0x0784('0x1f')](_0x2ac139,util[_0x0784('0xd')](_0x0784('0x23'),_0x486c97,_0x0784('0x24')))},function(_0x24f364,_0x983587){rimraf(path[_0x0784('0x1f')](_0x2ac139,_0x486c97),function(){});_0x1c14b7(_0x0784('0x25'));});});}})[_0x0784('0x11')](function(){logger[_0x0784('0xc')](util[_0x0784('0xd')](_0x0784('0x26'),EXTRACTED_REPORT_ID,_0x0784('0xf')));return analyticExtractedReport(_0x0784('0x27'),_0x2def0a?util[_0x0784('0xd')]('%s.%s',_0x486c97,_0x2def0a?_0x0784('0x24'):_0x0784('0x22')):null);});})[_0x0784('0x28')](function(_0x278b74){logger[_0x0784('0xc')](util[_0x0784('0xd')](_0x0784('0x29'),EXTRACTED_REPORT_ID,_0x0784('0xf')),util['inspect'](_0x278b74,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0784('0x2a'));})[_0x0784('0x2b')](function(){process[_0x0784('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 232de8d..89db760 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 _0x1329=['update','map','fill','auto','body','push','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','before','margin','landscape','toString','\x20/\x20','footer','black','right','num','Empty','Setting','find','then','splitSizePdf','length','range','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','basename','.pdf','split','existsSync','join','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','end','createPdfFromHTML','lodash','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','analytics','argv','savename'];(function(_0x4d5f08,_0x23e79c){var _0x24d1d8=function(_0x261ab8){while(--_0x261ab8){_0x4d5f08['push'](_0x4d5f08['shift']());}};_0x24d1d8(++_0x23e79c);}(_0x1329,0xa4));var _0x9132=function(_0x35672c,_0x5aa089){_0x35672c=_0x35672c-0x0;var _0x8601c2=_0x1329[_0x35672c];return _0x8601c2;};'use strict';var _=require(_0x9132('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x9132('0x1'));var moment=require(_0x9132('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x9132('0x3'));var zipdir=require(_0x9132('0x4'));var rimraf=require(_0x9132('0x5'));var JSDOM=require(_0x9132('0x6'))[_0x9132('0x7')];var window=new JSDOM('')[_0x9132('0x8')];var BPromise=require('bluebird');var db=require(_0x9132('0x9'))['db'];var dbH=require(_0x9132('0x9'))[_0x9132('0xa')];var logger=require('../../config/logger')(_0x9132('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x9132('0xc')][0x2]);var QUERY=process[_0x9132('0xc')][0x3];var PATH=process[_0x9132('0xc')][0x4];var NAME=process[_0x9132('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x31c794,_0x3b1293){var _0x2fc2f8={'status':_0x31c794};var _0x58ea76={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3b1293){_0x2fc2f8[_0x9132('0xd')]=_0x3b1293;}return db['AnalyticExtractedReport'][_0x9132('0xe')](_0x2fc2f8,_0x58ea76);}function getHeaders(_0x2ff66b){return _['map'](_0x2ff66b,function(_0x498b62){return{'text':_0x498b62,'style':'tableHeader'};});}function getRows(_0x4b5719,_0x2445da){return _[_0x9132('0xf')](_0x2445da,function(_0x2fa28d){return _(_0x2fa28d)['pick'](_0x4b5719)[_0x9132('0xf')](function(_0x22ee66){return _0x22ee66?_['toString'](_0x22ee66):'';})['value']();});}function createTable(_0x39a455,_0x5e5486){var _0x245af3={'widths':_[_0x9132('0x10')](Array(_0x39a455['length']),0x91),'heights':function(_0x163eb7){return _0x163eb7===0x0?_0x9132('0x11'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x41ab1b=getHeaders(_0x39a455);_0x245af3[_0x9132('0x12')][_0x9132('0x13')](_0x41ab1b);var _0x18bb76=getRows(_0x39a455,_0x5e5486);_0x245af3[_0x9132('0x12')]=_0x245af3['body'][_0x9132('0x14')](_0x18bb76);return _0x245af3;}function createTables(_0x239141){var _0x5346e0=[];var _0x300039=_['chunk'](Object[_0x9132('0x15')](_0x239141[0x0]),0x5);_0x300039[_0x9132('0x16')](function(_0x33e348){_0x5346e0['push'](createTable(_0x33e348,_0x239141));});return _0x5346e0;}function getPDFDocDefinition(_0x5dcb3a){var _0x331406=util[_0x9132('0x17')](_0x9132('0x18'),NAME,EXTRACTED_REPORT[_0x9132('0x19')],moment(EXTRACTED_REPORT[_0x9132('0x1a')])[_0x9132('0x17')](FORMAT),moment(EXTRACTED_REPORT[_0x9132('0x1b')])[_0x9132('0x17')](FORMAT));var _0x1db1c6=[];for(var _0x262e60=0x0;_0x262e60<_0x5dcb3a['length'];_0x262e60++){var _0x239d19=[];if(_0x262e60===0x0){_0x239d19[_0x9132('0x13')]({'text':_0x331406,'style':_0x9132('0x1c')});}var _0x5023c7={'table':_0x5dcb3a[_0x262e60]};if(_0x262e60>0x0){_0x5023c7['pageBreak']=_0x9132('0x1d');_0x5023c7[_0x9132('0x1e')]=[0x0,0x46,0x0,0x0];}_0x239d19[_0x9132('0x13')](_0x5023c7);_0x1db1c6[_0x9132('0x13')](_0x239d19);}return{'pageSize':'A4','pageOrientation':_0x9132('0x1f'),'content':_0x1db1c6,'footer':function(_0x59ba41,_0x235f15){return{'text':_0x59ba41[_0x9132('0x20')]()+_0x9132('0x21')+_0x235f15,'style':_0x9132('0x22')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x9132('0x23')},'footer':{'alignment':_0x9132('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x390671){var _0xc194cc=0x1388;var _0x85407e;if(!_0x390671[0x0][_0x9132('0x25')]){return analyticExtractedReport(_0x9132('0x26'));}return db[_0x9132('0x27')][_0x9132('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0x9132('0x29')](function(_0xb2d746){if(_0xb2d746){_0x85407e=_0xb2d746;_0xc194cc=_0x85407e[_0x9132('0x2a')]||0x3e8;}})[_0x9132('0x29')](function(){var _0x53ac93=[];var _0xddc89e=0x0;if(_0x85407e['split']){if(_0x390671&&_0x390671[_0x9132('0x2b')]){var _0x10f1a6=_[_0x9132('0x2c')](_0x390671[0x0][_0x9132('0x25')]/_0xc194cc);var _0x18618b=Number[_0x9132('0x2d')](_0x390671[0x0][_0x9132('0x25')]/_0xc194cc)?_0x390671[0x0][_0x9132('0x25')]%_0xc194cc:0x0;_0x10f1a6[_0x9132('0x16')](function(_0x397033){if(_0x397033>0x0){_0xddc89e+=_0xc194cc;}_0x53ac93[_0x9132('0x13')](dbH[_0x9132('0x2e')]['query'](util[_0x9132('0x17')](_0x9132('0x2f'),QUERY,_0xc194cc,_0xddc89e),{'type':dbH[_0x9132('0x2e')][_0x9132('0x30')][_0x9132('0x31')]}));});if(_0x18618b>0x0){_0xddc89e+=_0xc194cc;_0x53ac93[_0x9132('0x13')](dbH[_0x9132('0x2e')][_0x9132('0x32')](util[_0x9132('0x17')](_0x9132('0x2f'),QUERY,_0x18618b,_0xddc89e),{'type':dbH['sequelize']['QueryTypes'][_0x9132('0x31')]}));}}}else{_0x53ac93[_0x9132('0x13')](dbH['sequelize'][_0x9132('0x32')](QUERY,{'type':dbH[_0x9132('0x2e')][_0x9132('0x30')][_0x9132('0x31')]}));}var _0x4d4651=path['dirname'](PATH);var _0x3df64b=path[_0x9132('0x33')](PATH,_0x9132('0x34'));var _0x50d9e9=_0x85407e[_0x9132('0x35')]&&_0x53ac93[_0x9132('0x2b')]>0x1;var _0x2815a2=[];if(!fs[_0x9132('0x36')](path[_0x9132('0x37')](_0x4d4651,_0x3df64b))&&_0x50d9e9){fs['mkdirSync'](path[_0x9132('0x37')](_0x4d4651,_0x3df64b));}return BPromise['each'](_0x53ac93,function(_0x1d4440){_0x2815a2[_0x9132('0x13')](_0x1d4440);})['then'](function(){var _0x55d137=[];for(var _0x10db57=0x0;_0x10db57<_0x2815a2['length'];_0x10db57+=0x1){var _0x3369bc=_0x2815a2[_0x10db57];var _0x28e95c=createTables(_[_0x9132('0x38')](_0x3369bc));var _0x1860e2;var _0x4558e9=getPDFDocDefinition(_0x28e95c);var _0xf5589c=getPDFPrinter();var _0x3d86aa=_0xf5589c[_0x9132('0x39')](_0x4558e9);if(_0x50d9e9){_0x1860e2=path['join'](_0x4d4651,_0x3df64b,util[_0x9132('0x17')](_0x9132('0x3a'),_0x3df64b,_0x10db57,_0x9132('0x3b')));}else{_0x1860e2=path['join'](_0x4d4651,util[_0x9132('0x17')](_0x9132('0x3c'),_0x3df64b,_0x9132('0x3b')));}_0x55d137[_0x9132('0x13')](writePDFDocument(_0x3d86aa,_0x1860e2));}return Promise[_0x9132('0x3d')](_0x55d137);})[_0x9132('0x29')](function(){if(_0x50d9e9){return new Promise(function(_0xd1f638){zipdir(path[_0x9132('0x37')](_0x4d4651,_0x3df64b),{'saveTo':path[_0x9132('0x37')](_0x4d4651,util['format'](_0x9132('0x3c'),_0x3df64b,_0x9132('0x3e')))},function(){rimraf(path[_0x9132('0x37')](_0x4d4651,_0x3df64b),function(){});_0xd1f638('zip\x20finished');});});}})['then'](function(){if(!_0x50d9e9)return;rimraf(path[_0x9132('0x37')](_0x4d4651,_0x3df64b),function(){});})[_0x9132('0x29')](function(){logger[_0x9132('0x3f')](util['format'](_0x9132('0x40'),EXTRACTED_REPORT_ID,_0x9132('0x41')));return analyticExtractedReport(_0x9132('0x42'),_0x50d9e9?util[_0x9132('0x17')](_0x9132('0x3c'),_0x3df64b,_0x50d9e9?_0x9132('0x3e'):_0x9132('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x9132('0x3f')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0x9132('0x43')][_0x9132('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9132('0x29')](function(_0xce2a5f){EXTRACTED_REPORT=_0xce2a5f;return dbH[_0x9132('0x2e')]['query'](util[_0x9132('0x17')](_0x9132('0x45'),QUERY),{'type':dbH[_0x9132('0x2e')][_0x9132('0x30')]['SELECT']});})[_0x9132('0x29')](extractReport)[_0x9132('0x46')](function(_0x339315){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9132('0x41')),util['inspect'](_0x339315,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9132('0x47'));})[_0x9132('0x48')](function(){process[_0x9132('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2adf7b=new PdfPrinter({'Arial':{'normal':__dirname+_0x9132('0x4a'),'bold':__dirname+_0x9132('0x4b'),'italics':__dirname+_0x9132('0x4c'),'bolditalics':__dirname+_0x9132('0x4d')}});return _0x2adf7b;}function getPDFDocDefinitionFromHTML(_0x1bfb4d,_0x3a03db){var _0x159ac7=util[_0x9132('0x17')](_0x9132('0x4e'),_0x3a03db[_0x9132('0x4f')],_0x3a03db[_0x9132('0x50')]);var _0x4857eb=moment()['format'](_0x9132('0x51'))['toString']();var _0x3e7db0=htmlToPdfmake(_0x1bfb4d,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3e7db0],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x9132('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x9132('0x52')}},'header':function(){return[{'text':_0x9132('0x53'),'style':_0x9132('0x1c')}];},'footer':function(_0x30d90f,_0x1e29ed){return[{'text':util['format'](_0x9132('0x54'),_0x159ac7,_0x30d90f,_0x1e29ed,_0x4857eb),'style':_0x9132('0x22')}];}};}function writePDFDocument(_0x41b001,_0x33ac29){return new Promise(function(_0x134226,_0x22509d){var _0x70425a=_0x41b001['pipe'](fs[_0x9132('0x55')](_0x33ac29));_0x70425a['on'](_0x9132('0x56'),function(){_0x134226(_0x9132('0x56'));});_0x70425a['on']('error',function(_0x26d564){_0x22509d(_0x26d564);});_0x41b001[_0x9132('0x57')]();});}exports[_0x9132('0x58')]=function(_0x2442bd,_0x2d9ae6){var _0x4a7973=getPDFPrinter();var _0x3c5721=getPDFDocDefinitionFromHTML(_0x2442bd,_0x2d9ae6);var _0x2eb51f=_0x4a7973[_0x9132('0x39')](_0x3c5721);return writePDFDocument(_0x2eb51f,_0x2d9ae6[_0x9132('0x1')])[_0x9132('0x46')](function(_0x1c7cf7){throw _0x1c7cf7;});}; \ No newline at end of file +var _0xd30a=['header','pageBreak','before','margin','landscape','footer','Arial','black','right','num','find','split','splitSizePdf','then','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','existsSync','join','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','JSDOM','window','bluebird','dbH','../../config/logger','analytics','argv','savename','update','map','tableHeader','toString','value','fill','length','auto','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','endDate'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xd30a,0xf0));var _0xad30=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xd30a[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xad30('0x0'));var fs=require('fs');var util=require(_0xad30('0x1'));var path=require(_0xad30('0x2'));var moment=require(_0xad30('0x3'));var htmlToPdfmake=require(_0xad30('0x4'));var PdfPrinter=require(_0xad30('0x5'));var zipdir=require(_0xad30('0x6'));var rimraf=require(_0xad30('0x7'));var JSDOM=require('jsdom')[_0xad30('0x8')];var window=new JSDOM('')[_0xad30('0x9')];var BPromise=require(_0xad30('0xa'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xad30('0xb')];var logger=require(_0xad30('0xc'))(_0xad30('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xad30('0xe')][0x2]);var QUERY=process[_0xad30('0xe')][0x3];var PATH=process[_0xad30('0xe')][0x4];var NAME=process[_0xad30('0xe')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5a8178,_0x13ffff){var _0x45524b={'status':_0x5a8178};var _0x44ad50={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x13ffff){_0x45524b[_0xad30('0xf')]=_0x13ffff;}return db['AnalyticExtractedReport'][_0xad30('0x10')](_0x45524b,_0x44ad50);}function getHeaders(_0x300328){return _[_0xad30('0x11')](_0x300328,function(_0x438eeb){return{'text':_0x438eeb,'style':_0xad30('0x12')};});}function getRows(_0x765186,_0x27ae2b){return _[_0xad30('0x11')](_0x27ae2b,function(_0x2ff223){return _(_0x2ff223)['pick'](_0x765186)['map'](function(_0x3e7791){return _0x3e7791?_[_0xad30('0x13')](_0x3e7791):'';})[_0xad30('0x14')]();});}function createTable(_0x1adddd,_0x34ac73){var _0x5e23ce={'widths':_[_0xad30('0x15')](Array(_0x1adddd[_0xad30('0x16')]),0x91),'heights':function(_0xa98ef){return _0xa98ef===0x0?_0xad30('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2ad431=getHeaders(_0x1adddd);_0x5e23ce[_0xad30('0x18')][_0xad30('0x19')](_0x2ad431);var _0x9648c7=getRows(_0x1adddd,_0x34ac73);_0x5e23ce[_0xad30('0x18')]=_0x5e23ce['body'][_0xad30('0x1a')](_0x9648c7);return _0x5e23ce;}function createTables(_0x8e1516){var _0x374204=[];var _0x1ad1ff=_[_0xad30('0x1b')](Object[_0xad30('0x1c')](_0x8e1516[0x0]),0x5);_0x1ad1ff[_0xad30('0x1d')](function(_0x5d2695){_0x374204[_0xad30('0x19')](createTable(_0x5d2695,_0x8e1516));});return _0x374204;}function getPDFDocDefinition(_0x2d5ee2){var _0x2efa73=util[_0xad30('0x1e')](_0xad30('0x1f'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0xad30('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0xad30('0x20')])[_0xad30('0x1e')](FORMAT));var _0x3d6a84=[];for(var _0x3e05bc=0x0;_0x3e05bc<_0x2d5ee2[_0xad30('0x16')];_0x3e05bc++){var _0x41a53a=[];if(_0x3e05bc===0x0){_0x41a53a[_0xad30('0x19')]({'text':_0x2efa73,'style':_0xad30('0x21')});}var _0x3aac77={'table':_0x2d5ee2[_0x3e05bc]};if(_0x3e05bc>0x0){_0x3aac77[_0xad30('0x22')]=_0xad30('0x23');_0x3aac77[_0xad30('0x24')]=[0x0,0x46,0x0,0x0];}_0x41a53a['push'](_0x3aac77);_0x3d6a84[_0xad30('0x19')](_0x41a53a);}return{'pageSize':'A4','pageOrientation':_0xad30('0x25'),'content':_0x3d6a84,'footer':function(_0x43bb9d,_0xb44dad){return{'text':_0x43bb9d[_0xad30('0x13')]()+'\x20/\x20'+_0xb44dad,'style':_0xad30('0x26')};},'defaultStyle':{'font':_0xad30('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xad30('0x28')},'footer':{'alignment':_0xad30('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x323210){var _0x3bf3bb=0x1388;var _0x522f34;if(!_0x323210[0x0][_0xad30('0x2a')]){return analyticExtractedReport('Empty');}return db['Setting'][_0xad30('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xad30('0x2c'),_0xad30('0x2d')]})[_0xad30('0x2e')](function(_0x194df8){if(_0x194df8){_0x522f34=_0x194df8;_0x3bf3bb=_0x522f34[_0xad30('0x2d')]||0x3e8;}})['then'](function(){var _0x2f8a4e=[];var _0x2983b7=0x0;if(_0x522f34['split']){if(_0x323210&&_0x323210['length']){var _0x5d3220=_['range'](_0x323210[0x0][_0xad30('0x2a')]/_0x3bf3bb);var _0x24755e=Number[_0xad30('0x2f')](_0x323210[0x0][_0xad30('0x2a')]/_0x3bf3bb)?_0x323210[0x0][_0xad30('0x2a')]%_0x3bf3bb:0x0;_0x5d3220[_0xad30('0x1d')](function(_0x1e1754){if(_0x1e1754>0x0){_0x2983b7+=_0x3bf3bb;}_0x2f8a4e[_0xad30('0x19')](dbH[_0xad30('0x30')][_0xad30('0x31')](util['format'](_0xad30('0x32'),QUERY,_0x3bf3bb,_0x2983b7),{'type':dbH[_0xad30('0x30')][_0xad30('0x33')][_0xad30('0x34')]}));});if(_0x24755e>0x0){_0x2983b7+=_0x3bf3bb;_0x2f8a4e[_0xad30('0x19')](dbH[_0xad30('0x30')][_0xad30('0x31')](util[_0xad30('0x1e')](_0xad30('0x32'),QUERY,_0x24755e,_0x2983b7),{'type':dbH[_0xad30('0x30')][_0xad30('0x33')][_0xad30('0x34')]}));}}}else{_0x2f8a4e[_0xad30('0x19')](dbH[_0xad30('0x30')][_0xad30('0x31')](QUERY,{'type':dbH[_0xad30('0x30')][_0xad30('0x33')][_0xad30('0x34')]}));}var _0x58c3a9=path[_0xad30('0x35')](PATH);var _0x578150=path[_0xad30('0x36')](PATH,'.pdf');var _0x5d3c6a=_0x522f34[_0xad30('0x2c')]&&_0x2f8a4e[_0xad30('0x16')]>0x1;var _0x9ea9=[];if(!fs[_0xad30('0x37')](path[_0xad30('0x38')](_0x58c3a9,_0x578150))&&_0x5d3c6a){fs['mkdirSync'](path['join'](_0x58c3a9,_0x578150));}return BPromise['each'](_0x2f8a4e,function(_0x404542){_0x9ea9[_0xad30('0x19')](_0x404542);})[_0xad30('0x2e')](function(){var _0x20fa89=[];for(var _0x461ce7=0x0;_0x461ce7<_0x9ea9[_0xad30('0x16')];_0x461ce7+=0x1){var _0x4316e0=_0x9ea9[_0x461ce7];var _0x50cbf9=createTables(_['flatten'](_0x4316e0));var _0x79de58;var _0x37cf88=getPDFDocDefinition(_0x50cbf9);var _0x1c4e0a=getPDFPrinter();var _0x471b18=_0x1c4e0a[_0xad30('0x39')](_0x37cf88);if(_0x5d3c6a){_0x79de58=path[_0xad30('0x38')](_0x58c3a9,_0x578150,util['format'](_0xad30('0x3a'),_0x578150,_0x461ce7,_0xad30('0x3b')));}else{_0x79de58=path[_0xad30('0x38')](_0x58c3a9,util[_0xad30('0x1e')](_0xad30('0x3c'),_0x578150,_0xad30('0x3b')));}_0x20fa89[_0xad30('0x19')](writePDFDocument(_0x471b18,_0x79de58));}return Promise[_0xad30('0x3d')](_0x20fa89);})[_0xad30('0x2e')](function(){if(_0x5d3c6a){return new Promise(function(_0x375ed8){zipdir(path[_0xad30('0x38')](_0x58c3a9,_0x578150),{'saveTo':path[_0xad30('0x38')](_0x58c3a9,util[_0xad30('0x1e')](_0xad30('0x3c'),_0x578150,_0xad30('0x3e')))},function(){rimraf(path['join'](_0x58c3a9,_0x578150),function(){});_0x375ed8(_0xad30('0x3f'));});});}})[_0xad30('0x2e')](function(){if(!_0x5d3c6a)return;rimraf(path['join'](_0x58c3a9,_0x578150),function(){});})[_0xad30('0x2e')](function(){logger[_0xad30('0x40')](util['format'](_0xad30('0x41'),EXTRACTED_REPORT_ID,_0xad30('0x42')));return analyticExtractedReport(_0xad30('0x43'),_0x5d3c6a?util[_0xad30('0x1e')]('%s.%s',_0x578150,_0x5d3c6a?'zip':_0xad30('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xad30('0x40')](util['format'](_0xad30('0x44'),EXTRACTED_REPORT_ID,_0xad30('0x42')));return db['AnalyticExtractedReport'][_0xad30('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x33a8c5){EXTRACTED_REPORT=_0x33a8c5;return dbH[_0xad30('0x30')][_0xad30('0x31')](util[_0xad30('0x1e')](_0xad30('0x46'),QUERY),{'type':dbH['sequelize'][_0xad30('0x33')]['SELECT']});})[_0xad30('0x2e')](extractReport)[_0xad30('0x47')](function(_0x419712){logger['info'](util[_0xad30('0x1e')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xad30('0x42')),util[_0xad30('0x48')](_0x419712,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xad30('0x49'));})[_0xad30('0x4a')](function(){process[_0xad30('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x601ff3=new PdfPrinter({'Arial':{'normal':__dirname+_0xad30('0x4c'),'bold':__dirname+_0xad30('0x4d'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xad30('0x4e')}});return _0x601ff3;}function getPDFDocDefinitionFromHTML(_0x53a263,_0xaf50a5){var _0x1f53e4=util[_0xad30('0x1e')](_0xad30('0x4f'),_0xaf50a5[_0xad30('0x50')],_0xaf50a5[_0xad30('0x51')]);var _0xd9052f=moment()['format'](_0xad30('0x52'))['toString']();var _0x114153=htmlToPdfmake(_0x53a263,{'window':window,'tableAutoSize':!![]});return{'content':[_0x114153],'defaultStyle':{'font':_0xad30('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xad30('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xad30('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xad30('0x53')}},'header':function(){return[{'text':_0xad30('0x54'),'style':_0xad30('0x21')}];},'footer':function(_0x6757dd,_0x31d047){return[{'text':util[_0xad30('0x1e')](_0xad30('0x55'),_0x1f53e4,_0x6757dd,_0x31d047,_0xd9052f),'style':_0xad30('0x26')}];}};}function writePDFDocument(_0x46c006,_0x34406c){return new Promise(function(_0x2b63b7,_0xaf281b){var _0x3b9b47=_0x46c006[_0xad30('0x56')](fs['createWriteStream'](_0x34406c));_0x3b9b47['on'](_0xad30('0x57'),function(){_0x2b63b7(_0xad30('0x57'));});_0x3b9b47['on'](_0xad30('0x58'),function(_0x17b616){_0xaf281b(_0x17b616);});_0x46c006[_0xad30('0x59')]();});}exports[_0xad30('0x5a')]=function(_0x510174,_0x2cf862){var _0x553de3=getPDFPrinter();var _0x466ba8=getPDFDocDefinitionFromHTML(_0x510174,_0x2cf862);var _0x2f01b7=_0x553de3[_0xad30('0x39')](_0x466ba8);return writePDFDocument(_0x2f01b7,_0x2cf862['path'])['catch'](function(_0x4b1407){throw _0x4b1407;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 1da6828..1d6d521 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 _0xce89=['Failed','finally','exit','util','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Setting','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','range','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','basename','join','mkdirSync','each','length','xlsx','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','%s.%s','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect'];(function(_0x416376,_0x1f7137){var _0x364985=function(_0x3725d6){while(--_0x3725d6){_0x416376['push'](_0x416376['shift']());}};_0x364985(++_0x1f7137);}(_0xce89,0x1aa));var _0x9ce8=function(_0x5a5dc6,_0x1ad6dd){_0x5a5dc6=_0x5a5dc6-0x0;var _0x4c47b9=_0xce89[_0x5a5dc6];return _0x4c47b9;};'use strict';var util=require(_0x9ce8('0x0'));var path=require(_0x9ce8('0x1'));var _=require(_0x9ce8('0x2'));var fs=require('fs');var json2xls=require(_0x9ce8('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x9ce8('0x4'));var rimraf=require(_0x9ce8('0x5'));var db=require(_0x9ce8('0x6'))['db'];var dbH=require(_0x9ce8('0x6'))['dbH'];var logger=require('../../config/logger')(_0x9ce8('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x9ce8('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2f9a38,_0x4eab2d){var _0x4f1d91={'status':_0x2f9a38};var _0x1c0fec={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4eab2d){_0x4f1d91[_0x9ce8('0x9')]=_0x4eab2d;}return db[_0x9ce8('0xa')][_0x9ce8('0xb')](_0x4f1d91,_0x1c0fec);}function main(){var _0x4487b2=0x1388;var _0x3187a5;logger[_0x9ce8('0xc')](util[_0x9ce8('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0x9ce8('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9ce8('0xf'),_0x9ce8('0x10')]})[_0x9ce8('0x11')](function(_0x32b57d){if(_0x32b57d){_0x3187a5=_0x32b57d;_0x4487b2=_0x3187a5[_0x9ce8('0x10')]||0x1388;}})[_0x9ce8('0x11')](function(){return dbH['sequelize'][_0x9ce8('0x12')](util[_0x9ce8('0xd')](_0x9ce8('0x13'),QUERY),{'type':dbH[_0x9ce8('0x14')][_0x9ce8('0x15')][_0x9ce8('0x16')]});})['then'](function(_0x1d81b1){if(!_0x1d81b1[0x0][_0x9ce8('0x17')]){return analyticExtractedReport('Empty');}var _0x3d166c=[];var _0x2d1193=0x0;if(_0x3187a5[_0x9ce8('0xf')]){if(_0x1d81b1&&_0x1d81b1['length']){var _0x3d31b0=_[_0x9ce8('0x18')](_0x1d81b1[0x0][_0x9ce8('0x17')]/_0x4487b2);var _0x2fa353=Number['isInteger'](_0x1d81b1[0x0][_0x9ce8('0x17')]/_0x4487b2)?_0x1d81b1[0x0][_0x9ce8('0x17')]%_0x4487b2:0x0;_0x3d31b0[_0x9ce8('0x19')](function(_0x41bf0e){if(_0x41bf0e>0x0){_0x2d1193+=_0x4487b2;}_0x3d166c['push'](dbH[_0x9ce8('0x14')]['query'](util[_0x9ce8('0xd')](_0x9ce8('0x1a'),QUERY,_0x4487b2,_0x2d1193),{'type':dbH['sequelize']['QueryTypes'][_0x9ce8('0x16')]}));});if(_0x2fa353>0x0){_0x2d1193+=_0x4487b2;_0x3d166c[_0x9ce8('0x1b')](dbH[_0x9ce8('0x14')]['query'](util[_0x9ce8('0xd')](_0x9ce8('0x1a'),QUERY,_0x2fa353,_0x2d1193),{'type':dbH[_0x9ce8('0x14')][_0x9ce8('0x15')][_0x9ce8('0x16')]}));}}}else{_0x3d166c['push'](dbH[_0x9ce8('0x14')][_0x9ce8('0x12')](QUERY,{'type':dbH[_0x9ce8('0x14')]['QueryTypes'][_0x9ce8('0x16')]}));}var _0x49bb9c=path['dirname'](PATH);var _0x4925c4=path[_0x9ce8('0x1c')](PATH,'.xlsx');var _0x31a03f=_0x3187a5[_0x9ce8('0xf')]&&_0x3d166c['length']>0x1;var _0x1a944b=[];if(!fs['existsSync'](path[_0x9ce8('0x1d')](_0x49bb9c,_0x4925c4))&&_0x31a03f){fs[_0x9ce8('0x1e')](path['join'](_0x49bb9c,_0x4925c4));}return BPromise[_0x9ce8('0x1f')](_0x3d166c,function(_0x340542){_0x1a944b[_0x9ce8('0x1b')](_0x340542);})[_0x9ce8('0x11')](function(){for(var _0x32e939=0x0;_0x32e939<_0x1a944b[_0x9ce8('0x20')];_0x32e939+=0x1){var _0x57f8a3;var _0x1ff700=_0x1a944b[_0x32e939];if(_0x31a03f){_0x57f8a3=path[_0x9ce8('0x1d')](_0x49bb9c,_0x4925c4,util[_0x9ce8('0xd')]('%s%d.%s',_0x4925c4,_0x32e939,_0x9ce8('0x21')));}else{_0x57f8a3=path[_0x9ce8('0x1d')](_0x49bb9c,util[_0x9ce8('0xd')]('%s.%s',_0x4925c4,_0x9ce8('0x21')));}fs[_0x9ce8('0x22')](_0x57f8a3,json2xls(_0x1ff700),_0x9ce8('0x23'));}})['then'](function(){if(_0x31a03f){return new Promise(function(_0x57d63d){zipdir(path[_0x9ce8('0x1d')](_0x49bb9c,_0x4925c4),{'saveTo':path[_0x9ce8('0x1d')](_0x49bb9c,util[_0x9ce8('0xd')]('%s.%s',_0x4925c4,_0x9ce8('0x24')))},function(_0x599afb,_0x18b763){rimraf(path[_0x9ce8('0x1d')](_0x49bb9c,_0x4925c4),function(){});_0x57d63d('zip\x20finished');});});}})[_0x9ce8('0x11')](function(){logger[_0x9ce8('0xc')](util['format'](_0x9ce8('0x25'),EXTRACTED_REPORT_ID,_0x9ce8('0x26')));return analyticExtractedReport(_0x9ce8('0x27'),_0x31a03f?util[_0x9ce8('0xd')](_0x9ce8('0x28'),_0x4925c4,_0x31a03f?_0x9ce8('0x24'):'xlsx'):null);});})[_0x9ce8('0x29')](function(_0x54fead){logger[_0x9ce8('0xc')](util['format'](_0x9ce8('0x2a'),EXTRACTED_REPORT_ID,_0x9ce8('0x26')),util[_0x9ce8('0x2b')](_0x54fead,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9ce8('0x2c'));})[_0x9ce8('0x2d')](function(){process[_0x9ce8('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd193=['Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','json2xls','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num'];(function(_0x531d63,_0x1320ae){var _0x157e26=function(_0x99b402){while(--_0x99b402){_0x531d63['push'](_0x531d63['shift']());}};_0x157e26(++_0x1320ae);}(_0xd193,0x119));var _0x3d19=function(_0x5b27b1,_0x4e6c72){_0x5b27b1=_0x5b27b1-0x0;var _0xd8c9d8=_0xd193[_0x5b27b1];return _0xd8c9d8;};'use strict';var util=require(_0x3d19('0x0'));var path=require(_0x3d19('0x1'));var _=require(_0x3d19('0x2'));var fs=require('fs');var json2xls=require(_0x3d19('0x3'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x3d19('0x4'));var db=require(_0x3d19('0x5'))['db'];var dbH=require(_0x3d19('0x5'))[_0x3d19('0x6')];var logger=require('../../config/logger')(_0x3d19('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x3d19('0x8')][0x2]);var QUERY=process[_0x3d19('0x8')][0x3];var PATH=process[_0x3d19('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x29d860,_0x304c91){var _0x29d989={'status':_0x29d860};var _0x1b72f5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x304c91){_0x29d989[_0x3d19('0x9')]=_0x304c91;}return db[_0x3d19('0xa')]['update'](_0x29d989,_0x1b72f5);}function main(){var _0x3da59c=0x1388;var _0x59a7e1;logger[_0x3d19('0xb')](util[_0x3d19('0xc')](_0x3d19('0xd'),EXTRACTED_REPORT_ID,_0x3d19('0xe')));return db[_0x3d19('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3d19('0x10'),_0x3d19('0x11')]})['then'](function(_0x7bb278){if(_0x7bb278){_0x59a7e1=_0x7bb278;_0x3da59c=_0x59a7e1[_0x3d19('0x11')]||0x1388;}})[_0x3d19('0x12')](function(){return dbH[_0x3d19('0x13')][_0x3d19('0x14')](util[_0x3d19('0xc')](_0x3d19('0x15'),QUERY),{'type':dbH[_0x3d19('0x13')][_0x3d19('0x16')][_0x3d19('0x17')]});})['then'](function(_0x1ae9ad){if(!_0x1ae9ad[0x0][_0x3d19('0x18')]){return analyticExtractedReport(_0x3d19('0x19'));}var _0x460ea2=[];var _0x1e291e=0x0;if(_0x59a7e1[_0x3d19('0x10')]){if(_0x1ae9ad&&_0x1ae9ad[_0x3d19('0x1a')]){var _0x5cc622=_[_0x3d19('0x1b')](_0x1ae9ad[0x0][_0x3d19('0x18')]/_0x3da59c);var _0x5acba2=Number[_0x3d19('0x1c')](_0x1ae9ad[0x0][_0x3d19('0x18')]/_0x3da59c)?_0x1ae9ad[0x0][_0x3d19('0x18')]%_0x3da59c:0x0;_0x5cc622[_0x3d19('0x1d')](function(_0x53ddbe){if(_0x53ddbe>0x0){_0x1e291e+=_0x3da59c;}_0x460ea2[_0x3d19('0x1e')](dbH['sequelize'][_0x3d19('0x14')](util[_0x3d19('0xc')](_0x3d19('0x1f'),QUERY,_0x3da59c,_0x1e291e),{'type':dbH[_0x3d19('0x13')][_0x3d19('0x16')][_0x3d19('0x17')]}));});if(_0x5acba2>0x0){_0x1e291e+=_0x3da59c;_0x460ea2[_0x3d19('0x1e')](dbH['sequelize'][_0x3d19('0x14')](util[_0x3d19('0xc')](_0x3d19('0x1f'),QUERY,_0x5acba2,_0x1e291e),{'type':dbH['sequelize'][_0x3d19('0x16')][_0x3d19('0x17')]}));}}}else{_0x460ea2[_0x3d19('0x1e')](dbH[_0x3d19('0x13')][_0x3d19('0x14')](QUERY,{'type':dbH[_0x3d19('0x13')]['QueryTypes'][_0x3d19('0x17')]}));}var _0x1eac87=path['dirname'](PATH);var _0x41ad72=path[_0x3d19('0x20')](PATH,_0x3d19('0x21'));var _0x21aeb5=_0x59a7e1[_0x3d19('0x10')]&&_0x460ea2[_0x3d19('0x1a')]>0x1;var _0x376fbd=[];if(!fs[_0x3d19('0x22')](path[_0x3d19('0x23')](_0x1eac87,_0x41ad72))&&_0x21aeb5){fs[_0x3d19('0x24')](path['join'](_0x1eac87,_0x41ad72));}return BPromise[_0x3d19('0x25')](_0x460ea2,function(_0x45da0f){_0x376fbd['push'](_0x45da0f);})[_0x3d19('0x12')](function(){for(var _0x13fbbf=0x0;_0x13fbbf<_0x376fbd[_0x3d19('0x1a')];_0x13fbbf+=0x1){var _0x1a4080;var _0x14791b=_0x376fbd[_0x13fbbf];if(_0x21aeb5){_0x1a4080=path[_0x3d19('0x23')](_0x1eac87,_0x41ad72,util[_0x3d19('0xc')](_0x3d19('0x26'),_0x41ad72,_0x13fbbf,_0x3d19('0x27')));}else{_0x1a4080=path[_0x3d19('0x23')](_0x1eac87,util[_0x3d19('0xc')](_0x3d19('0x28'),_0x41ad72,_0x3d19('0x27')));}fs[_0x3d19('0x29')](_0x1a4080,json2xls(_0x14791b),_0x3d19('0x2a'));}})[_0x3d19('0x12')](function(){if(_0x21aeb5){return new Promise(function(_0x7d245f){zipdir(path[_0x3d19('0x23')](_0x1eac87,_0x41ad72),{'saveTo':path['join'](_0x1eac87,util[_0x3d19('0xc')](_0x3d19('0x28'),_0x41ad72,'zip'))},function(_0x1fda0e,_0x59dc25){rimraf(path[_0x3d19('0x23')](_0x1eac87,_0x41ad72),function(){});_0x7d245f('zip\x20finished');});});}})[_0x3d19('0x12')](function(){logger[_0x3d19('0xb')](util[_0x3d19('0xc')](_0x3d19('0x2b'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x3d19('0x2c'),_0x21aeb5?util[_0x3d19('0xc')](_0x3d19('0x28'),_0x41ad72,_0x21aeb5?_0x3d19('0x2d'):_0x3d19('0x27')):null);});})[_0x3d19('0x2e')](function(_0x39456a){logger[_0x3d19('0xb')](util[_0x3d19('0xc')](_0x3d19('0x2f'),EXTRACTED_REPORT_ID,_0x3d19('0xe')),util[_0x3d19('0x30')](_0x39456a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3d19('0x31'));})[_0x3d19('0x32')](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 ee96b97..821127d 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 _0xb2ba=['callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','util','Interval','then','models','VoiceExtension','IntervalId','findAll','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','hasOwnProperty','priority','extension','find','exten','type','Set','format','VoiceExtensionId','inbound','extensions','CDR(routeid)=','context','outbound','push','CDR(destination)=','cutdigits','${EXTEN:','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','MONITOR_OPTIONS=ab','length','toLowerCase','interval','map','intervals','tag','CDR(tag)='];(function(_0x4b7e39,_0xf3fa9f){var _0x3ad2a3=function(_0x24467f){while(--_0x24467f){_0x4b7e39['push'](_0x4b7e39['shift']());}};_0x3ad2a3(++_0xf3fa9f);}(_0xb2ba,0x159));var _0xab2b=function(_0x5a16be,_0x2466f9){_0x5a16be=_0x5a16be-0x0;var _0x27f77b=_0xb2ba[_0x5a16be];return _0x27f77b;};'use strict';var _=require('lodash');var util=require(_0xab2b('0x0'));function rewrite(_0x24584e,_0x2af434){var _0x289282=this;return _0x24584e['models'][_0xab2b('0x1')]['findAll']({'raw':!![]})[_0xab2b('0x2')](function(_0x4d0784){_0x289282['intervals']=_0x4d0784;return _0x24584e[_0xab2b('0x3')][_0xab2b('0x4')]['findAll']({'where':{'IntervalId':_0x2af434[_0xab2b('0x5')]},'raw':!![]});})[_0xab2b('0x2')](function(_0x50b2a8){return _0x24584e[_0xab2b('0x3')][_0xab2b('0x4')][_0xab2b('0x6')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x50b2a8,'exten'))}},'order':[{'raw':_0xab2b('0x7')}],'raw':!![]});})[_0xab2b('0x2')](function(_0x5765fc){var _0x364adb=_['filter'](_0x5765fc,{'priority':'1'});var _0x5c5a2d=_[_0xab2b('0x8')](_0x5765fc,{'isApp':0x1});var _0x49e679=_['groupBy'](_0x5c5a2d,'exten');var _0x416be1=[_0xab2b('0x9'),'playback'];var _0x29627d=[];var _0x2108c6=[];for(var _0x452b19 in _0x49e679){if(_0x49e679[_0xab2b('0xa')](_0x452b19)){_0x289282[_0xab2b('0xb')]=0x2;_0x289282['extensions']=[];_0x289282[_0xab2b('0xc')]=_[_0xab2b('0xd')](_0x364adb,{'exten':_0x49e679[_0x452b19][0x0][_0xab2b('0xe')]});_0x289282['extensions']['push']({'type':_0x49e679[_0x452b19][0x0][_0xab2b('0xf')],'app':_0xab2b('0x10'),'appdata':util[_0xab2b('0x11')]('CDR(type)=%s',_0x49e679[_0x452b19][0x0][_0xab2b('0xf')]),'context':_0x49e679[_0x452b19][0x0]['context'],'exten':_0x49e679[_0x452b19][0x0]['exten'],'priority':_0x289282['priority']++,'VoiceExtensionId':_0x49e679[_0x452b19][0x0][_0xab2b('0x12')]});if(_0x49e679[_0x452b19][0x0][_0xab2b('0xf')]===_0xab2b('0x13')){_0x289282[_0xab2b('0x14')]['push']({'type':_0x49e679[_0x452b19][0x0][_0xab2b('0xf')],'app':_0xab2b('0x10'),'appdata':_0xab2b('0x15')+_0x49e679[_0x452b19][0x0][_0xab2b('0x12')],'context':_0x49e679[_0x452b19][0x0][_0xab2b('0x16')],'exten':_0x49e679[_0x452b19][0x0]['exten'],'priority':_0x289282['priority']++,'VoiceExtensionId':_0x49e679[_0x452b19][0x0]['VoiceExtensionId']});}else if(_0x49e679[_0x452b19][0x0][_0xab2b('0xf')]===_0xab2b('0x17')){if(_0x289282[_0xab2b('0xc')]){_0x289282['extensions'][_0xab2b('0x18')]({'type':_0x49e679[_0x452b19][0x0][_0xab2b('0xf')],'app':_0xab2b('0x10'),'appdata':_0xab2b('0x19')+(_0x289282[_0xab2b('0xc')][_0xab2b('0x1a')]?_0xab2b('0x1b')+_0x289282[_0xab2b('0xc')]['cutdigits']+'}':'${EXTEN}'),'context':_0x49e679[_0x452b19][0x0][_0xab2b('0x16')],'exten':_0x49e679[_0x452b19][0x0]['exten'],'priority':_0x289282[_0xab2b('0xb')]++,'VoiceExtensionId':_0x49e679[_0x452b19][0x0]['VoiceExtensionId']});}_0x289282[_0xab2b('0x14')][_0xab2b('0x18')]({'type':_0x49e679[_0x452b19][0x0][_0xab2b('0xf')],'app':_0xab2b('0x10'),'appdata':_0xab2b('0x15')+_0x49e679[_0x452b19][0x0]['VoiceExtensionId'],'context':_0x49e679[_0x452b19][0x0][_0xab2b('0x16')],'exten':_0x49e679[_0x452b19][0x0][_0xab2b('0xe')],'priority':_0x289282[_0xab2b('0xb')]++,'VoiceExtensionId':_0x49e679[_0x452b19][0x0][_0xab2b('0x12')]});var _0x1bcfdf=_0x289282[_0xab2b('0xb')]++;_0x289282[_0xab2b('0x14')][_0xab2b('0x18')]({'type':_0x49e679[_0x452b19][0x0][_0xab2b('0xf')],'app':'ExecIf','appdata':_0xab2b('0x1c')+(_0x1bcfdf+0x2)+'):Goto('+(_0x1bcfdf+0x1)+')','context':_0x49e679[_0x452b19][0x0][_0xab2b('0x16')],'exten':_0x49e679[_0x452b19][0x0]['exten'],'priority':_0x1bcfdf,'VoiceExtensionId':_0x49e679[_0x452b19][0x0][_0xab2b('0x12')]});if(_0x289282[_0xab2b('0xc')]){_0x289282[_0xab2b('0x14')]['push']({'type':_0x49e679[_0x452b19][0x0][_0xab2b('0xf')],'app':'Set','appdata':_0x289282[_0xab2b('0xc')]['cutdigits']?_0xab2b('0x1d')+_0x289282['extension'][_0xab2b('0x1a')]+'}':_0xab2b('0x1e'),'context':_0x49e679[_0x452b19][0x0][_0xab2b('0x16')],'exten':_0x49e679[_0x452b19][0x0]['exten'],'priority':_0x289282[_0xab2b('0xb')]++,'VoiceExtensionId':_0x49e679[_0x452b19][0x0][_0xab2b('0x12')]});}_0x289282[_0xab2b('0x14')][_0xab2b('0x18')]({'type':_0x49e679[_0x452b19][0x0]['type'],'app':_0xab2b('0x10'),'appdata':_0xab2b('0x1f')+_0x49e679[_0x452b19][0x0][_0xab2b('0x12')],'context':_0x49e679[_0x452b19][0x0][_0xab2b('0x16')],'exten':_0x49e679[_0x452b19][0x0][_0xab2b('0xe')],'priority':_0x289282[_0xab2b('0xb')]++,'VoiceExtensionId':_0x49e679[_0x452b19][0x0][_0xab2b('0x12')]});if(_0x289282[_0xab2b('0xc')]&&_0x289282[_0xab2b('0xc')]['hasOwnProperty'](_0xab2b('0x20'))&&_0x289282[_0xab2b('0xc')][_0xab2b('0x20')]!==_0xab2b('0x21')){_0x289282['extensions'][_0xab2b('0x18')]({'type':_0x49e679[_0x452b19][0x0][_0xab2b('0xf')],'app':_0xab2b('0x10'),'appdata':_0xab2b('0x22'),'context':_0x49e679[_0x452b19][0x0][_0xab2b('0x16')],'exten':_0x49e679[_0x452b19][0x0][_0xab2b('0xe')],'priority':_0x289282[_0xab2b('0xb')]++,'VoiceExtensionId':_0x49e679[_0x452b19][0x0][_0xab2b('0x12')]});_0x289282['extensions']['push']({'type':_0x49e679[_0x452b19][0x0][_0xab2b('0xf')],'app':_0xab2b('0x10'),'appdata':_0xab2b('0x23')+_0x289282[_0xab2b('0xc')][_0xab2b('0x20')]||_0xab2b('0x24'),'context':_0x49e679[_0x452b19][0x0][_0xab2b('0x16')],'exten':_0x49e679[_0x452b19][0x0]['exten'],'priority':_0x289282[_0xab2b('0xb')]++,'VoiceExtensionId':_0x49e679[_0x452b19][0x0][_0xab2b('0x12')]});}}_0x289282[_0xab2b('0x14')][_0xab2b('0x18')]({'type':_0x49e679[_0x452b19][0x0][_0xab2b('0xf')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x49e679[_0x452b19][0x0][_0xab2b('0x16')],'exten':_0x49e679[_0x452b19][0x0][_0xab2b('0xe')],'priority':_0x289282[_0xab2b('0xb')]++,'VoiceExtensionId':_0x49e679[_0x452b19][0x0][_0xab2b('0x12')]});_0x289282[_0xab2b('0x14')][_0xab2b('0x18')]({'type':_0x49e679[_0x452b19][0x0][_0xab2b('0xf')],'app':_0xab2b('0x10'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x49e679[_0x452b19][0x0]['context'],'exten':_0x49e679[_0x452b19][0x0][_0xab2b('0xe')],'priority':_0x289282[_0xab2b('0xb')]++,'VoiceExtensionId':_0x49e679[_0x452b19][0x0][_0xab2b('0x12')]});_0x289282[_0xab2b('0x14')][_0xab2b('0x18')]({'type':_0x49e679[_0x452b19][0x0][_0xab2b('0xf')],'app':'Set','appdata':_0xab2b('0x25'),'context':_0x49e679[_0x452b19][0x0][_0xab2b('0x16')],'exten':_0x49e679[_0x452b19][0x0]['exten'],'priority':_0x289282['priority']++,'VoiceExtensionId':_0x49e679[_0x452b19][0x0][_0xab2b('0x12')]});for(var _0x2f235c=0x0,_0x4fc19e=0x0;_0x2f235c<_0x49e679[_0x452b19][_0xab2b('0x26')];_0x2f235c+=0x1,_0x4fc19e=0x0){var _0x95e2dc=_0x49e679[_0x452b19][_0x2f235c];if(_0x95e2dc[_0xab2b('0xf')]){_0x95e2dc['type']=_0x95e2dc[_0xab2b('0xf')][_0xab2b('0x27')]();}var _0x5236ac=[];var _0xa684ac=[];delete _0x95e2dc['id'];delete _0x95e2dc['createdAt'];delete _0x95e2dc['updatedAt'];var _0x585e3e=_0x95e2dc[_0xab2b('0x28')]!=='*,*,*,*'?[_0x95e2dc[_0xab2b('0x28')]]:_0x95e2dc[_0xab2b('0x5')]?_[_0xab2b('0x29')](_['filter'](_0x289282[_0xab2b('0x2a')],{'IntervalId':_0x95e2dc[_0xab2b('0x5')]}),_0xab2b('0x28')):[];if(_0x95e2dc['hasOwnProperty'](_0xab2b('0x2b'))){if(_0x95e2dc[_0xab2b('0x2b')]&&_0x95e2dc[_0xab2b('0x2b')]!=='--'){_0x5236ac[_0xab2b('0x18')]({'type':_0x95e2dc['type'],'app':_0xab2b('0x10'),'appdata':_0xab2b('0x2c')+_0x95e2dc[_0xab2b('0x2b')],'context':_0x95e2dc[_0xab2b('0x16')],'exten':_0x95e2dc['exten'],'priority':_0x585e3e['length']+_0x289282[_0xab2b('0xb')]+_0x4fc19e++,'VoiceExtensionId':_0x95e2dc[_0xab2b('0x12')]});}}if(_0x95e2dc['type']==='outbound'&&_0x95e2dc['hasOwnProperty'](_0xab2b('0x2d'))){if(_0x95e2dc['callerID']){_0x5236ac[_0xab2b('0x18')]({'type':_0x95e2dc[_0xab2b('0xf')],'app':_0xab2b('0x2e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x95e2dc[_0xab2b('0x2d')]+')','context':_0x95e2dc['context'],'exten':_0x95e2dc[_0xab2b('0xe')],'priority':_0x585e3e['length']+_0x289282[_0xab2b('0xb')]+_0x4fc19e++,'VoiceExtensionId':_0x95e2dc[_0xab2b('0x12')]});}else{_0x5236ac[_0xab2b('0x18')]({'type':_0x95e2dc[_0xab2b('0xf')],'app':'ExecIf','appdata':_0xab2b('0x2f'),'context':_0x95e2dc['context'],'exten':_0x95e2dc[_0xab2b('0xe')],'priority':_0x585e3e['length']+_0x289282[_0xab2b('0xb')]+_0x4fc19e++,'VoiceExtensionId':_0x95e2dc['VoiceExtensionId']});}}if(_0x95e2dc[_0xab2b('0xa')](_0xab2b('0x30'))){if(_0x416be1[_0xab2b('0x31')](_0x95e2dc[_0xab2b('0x32')][_0xab2b('0x27')]())>=0x0&&_0x95e2dc['appType']!=='custom'){if(_0x95e2dc[_0xab2b('0x30')]){_0x5236ac[_0xab2b('0x18')]({'type':_0x95e2dc['type'],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x95e2dc['context'],'exten':_0x95e2dc[_0xab2b('0xe')],'priority':_0x585e3e['length']+_0x289282[_0xab2b('0xb')]+_0x4fc19e++,'VoiceExtensionId':_0x95e2dc[_0xab2b('0x12')]});_0x5236ac['push']({'type':_0x95e2dc[_0xab2b('0xf')],'app':_0xab2b('0x10'),'appdata':_0xab2b('0x33'),'context':_0x95e2dc[_0xab2b('0x16')],'exten':_0x95e2dc['exten'],'priority':_0x585e3e[_0xab2b('0x26')]+_0x289282[_0xab2b('0xb')]+_0x4fc19e++,'VoiceExtensionId':_0x95e2dc['VoiceExtensionId']});}else{_0x5236ac[_0xab2b('0x18')]({'type':_0x95e2dc[_0xab2b('0xf')],'app':'ExecIf','appdata':_0xab2b('0x34'),'context':_0x95e2dc[_0xab2b('0x16')],'exten':_0x95e2dc[_0xab2b('0xe')],'priority':_0x585e3e[_0xab2b('0x26')]+_0x289282[_0xab2b('0xb')]+_0x4fc19e++,'VoiceExtensionId':_0x95e2dc[_0xab2b('0x12')]});_0x5236ac[_0xab2b('0x18')]({'type':_0x95e2dc[_0xab2b('0xf')],'app':'Set','appdata':_0xab2b('0x35'),'context':_0x95e2dc['context'],'exten':_0x95e2dc[_0xab2b('0xe')],'priority':_0x585e3e[_0xab2b('0x26')]+_0x289282['priority']+_0x4fc19e++,'VoiceExtensionId':_0x95e2dc[_0xab2b('0x12')]});}}}for(var _0x122817=0x0;_0x122817<_0x585e3e[_0xab2b('0x26')];_0x122817+=0x1){var _0x37b0d9=_0x289282[_0xab2b('0xb')]+_0x585e3e[_0xab2b('0x26')];var _0x5c1b00=_0x122817===_0x585e3e[_0xab2b('0x26')]-0x1?_0x289282[_0xab2b('0xb')]+_0x5236ac['length']+_0xa684ac[_0xab2b('0x26')]+0x2:_0x289282[_0xab2b('0xb')]+_0x122817+0x1;_0x5236ac[_0xab2b('0x36')](_0x122817,0x0,{'type':_0x95e2dc[_0xab2b('0xf')],'app':'GotoIfTime','appdata':_0x585e3e[_0x122817]+'?'+_0x95e2dc[_0xab2b('0x16')]+_0xab2b('0x37')+_0x37b0d9+':'+_0x95e2dc['context']+_0xab2b('0x37')+_0x5c1b00,'exten':_0x95e2dc[_0xab2b('0xe')],'context':_0x95e2dc[_0xab2b('0x16')],'priority':_0x289282[_0xab2b('0xb')]+_0x122817,'VoiceExtensionId':_0x49e679[_0x452b19][0x0][_0xab2b('0x12')]});}_0x95e2dc[_0xab2b('0xb')]=_0x5236ac['length']?_['last'](_0x5236ac)[_0xab2b('0xb')]+0x1:_0x289282[_0xab2b('0xb')];_0x289282[_0xab2b('0xb')]=(_0xa684ac[_0xab2b('0x26')]?_[_0xab2b('0x38')](_0xa684ac)[_0xab2b('0xb')]:_0x95e2dc[_0xab2b('0xb')])+0x1;_0x289282[_0xab2b('0x14')]=_['concat'](_0x289282[_0xab2b('0x14')],_0x5236ac,[_0x95e2dc],_0xa684ac);}_0x289282[_0xab2b('0x14')][_0xab2b('0x18')]({'type':_0x49e679[_0x452b19][0x0][_0xab2b('0xf')],'app':'Hangup','exten':_0x49e679[_0x452b19][0x0]['exten'],'context':_0x49e679[_0x452b19][0x0][_0xab2b('0x16')],'priority':_0x289282[_0xab2b('0xb')],'VoiceExtensionId':_0x49e679[_0x452b19][0x0]['VoiceExtensionId']});_0x29627d[_0xab2b('0x18')](_0x49e679[_0x452b19][0x0][_0xab2b('0x12')]);_0x2108c6=_[_0xab2b('0x39')](_0x2108c6,_0x289282['extensions']);}}return _0x24584e[_0xab2b('0x3a')](function(_0x3826f0){return _0x24584e[_0xab2b('0x3')][_0xab2b('0x4')][_0xab2b('0x3b')]({'where':{'VoiceExtensionId':{'$in':_0x29627d}},'transaction':_0x3826f0})['then'](function(_0x16b1f6){return _0x24584e['models'][_0xab2b('0x4')][_0xab2b('0x3c')](_[_0xab2b('0x3d')](_0x2108c6,_0xab2b('0xb')),{'transaction':_0x3826f0});});});})[_0xab2b('0x3e')](function(_0x53f741){console[_0xab2b('0x3f')](_0x53f741);});}exports[_0xab2b('0x40')]=rewrite; \ No newline at end of file +var _0x7e7b=['tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','concat','Hangup','transaction','destroy','bulkCreate','sortBy','rewrite','lodash','util','models','findAll','intervals','VoiceExtension','IntervalId','then','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','push','format','CDR(type)=%s','type','context','exten','inbound','Set','CDR(routeid)=','VoiceExtensionId','outbound','extension','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','MONITOR_OPTIONS=ab','toLowerCase','createdAt','interval'];(function(_0x37b4a3,_0xef476b){var _0x42ce57=function(_0x3cac1d){while(--_0x3cac1d){_0x37b4a3['push'](_0x37b4a3['shift']());}};_0x42ce57(++_0xef476b);}(_0x7e7b,0x9b));var _0xb7e7=function(_0x3b1c2c,_0x2120fc){_0x3b1c2c=_0x3b1c2c-0x0;var _0x45744f=_0x7e7b[_0x3b1c2c];return _0x45744f;};'use strict';var _=require(_0xb7e7('0x0'));var util=require(_0xb7e7('0x1'));function rewrite(_0x5bdfda,_0x4f5b9b){var _0x38aaba=this;return _0x5bdfda[_0xb7e7('0x2')]['Interval'][_0xb7e7('0x3')]({'raw':!![]})['then'](function(_0x565ced){_0x38aaba[_0xb7e7('0x4')]=_0x565ced;return _0x5bdfda['models'][_0xb7e7('0x5')]['findAll']({'where':{'IntervalId':_0x4f5b9b[_0xb7e7('0x6')]},'raw':!![]});})[_0xb7e7('0x7')](function(_0x4b4a9f){return _0x5bdfda[_0xb7e7('0x2')][_0xb7e7('0x5')][_0xb7e7('0x3')]({'where':{'exten':{'$in':_[_0xb7e7('0x8')](_['map'](_0x4b4a9f,'exten'))}},'order':[{'raw':_0xb7e7('0x9')}],'raw':!![]});})[_0xb7e7('0x7')](function(_0x5751a4){var _0x24fa2a=_[_0xb7e7('0xa')](_0x5751a4,{'priority':'1'});var _0x501c0f=_[_0xb7e7('0xa')](_0x5751a4,{'isApp':0x1});var _0x2ab045=_[_0xb7e7('0xb')](_0x501c0f,'exten');var _0x3838dc=[_0xb7e7('0xc'),_0xb7e7('0xd')];var _0x1d38da=[];var _0x3ce646=[];for(var _0x2c850f in _0x2ab045){if(_0x2ab045[_0xb7e7('0xe')](_0x2c850f)){_0x38aaba[_0xb7e7('0xf')]=0x2;_0x38aaba[_0xb7e7('0x10')]=[];_0x38aaba['extension']=_['find'](_0x24fa2a,{'exten':_0x2ab045[_0x2c850f][0x0]['exten']});_0x38aaba[_0xb7e7('0x10')][_0xb7e7('0x11')]({'type':_0x2ab045[_0x2c850f][0x0]['type'],'app':'Set','appdata':util[_0xb7e7('0x12')](_0xb7e7('0x13'),_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x14')]),'context':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x15')],'exten':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x16')],'priority':_0x38aaba[_0xb7e7('0xf')]++,'VoiceExtensionId':_0x2ab045[_0x2c850f][0x0]['VoiceExtensionId']});if(_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x14')]===_0xb7e7('0x17')){_0x38aaba[_0xb7e7('0x10')]['push']({'type':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x14')],'app':_0xb7e7('0x18'),'appdata':_0xb7e7('0x19')+_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x1a')],'context':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x15')],'exten':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x16')],'priority':_0x38aaba[_0xb7e7('0xf')]++,'VoiceExtensionId':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x1a')]});}else if(_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x14')]===_0xb7e7('0x1b')){if(_0x38aaba[_0xb7e7('0x1c')]){_0x38aaba['extensions']['push']({'type':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x14')],'app':_0xb7e7('0x18'),'appdata':_0xb7e7('0x1d')+(_0x38aaba[_0xb7e7('0x1c')][_0xb7e7('0x1e')]?'${EXTEN:'+_0x38aaba['extension'][_0xb7e7('0x1e')]+'}':_0xb7e7('0x1f')),'context':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x15')],'exten':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x16')],'priority':_0x38aaba[_0xb7e7('0xf')]++,'VoiceExtensionId':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x1a')]});}_0x38aaba[_0xb7e7('0x10')][_0xb7e7('0x11')]({'type':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x14')],'app':_0xb7e7('0x18'),'appdata':_0xb7e7('0x19')+_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x1a')],'context':_0x2ab045[_0x2c850f][0x0]['context'],'exten':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x16')],'priority':_0x38aaba[_0xb7e7('0xf')]++,'VoiceExtensionId':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x1a')]});var _0x2068fa=_0x38aaba['priority']++;_0x38aaba['extensions']['push']({'type':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x14')],'app':_0xb7e7('0x20'),'appdata':_0xb7e7('0x21')+(_0x2068fa+0x2)+_0xb7e7('0x22')+(_0x2068fa+0x1)+')','context':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x15')],'exten':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x16')],'priority':_0x2068fa,'VoiceExtensionId':_0x2ab045[_0x2c850f][0x0]['VoiceExtensionId']});if(_0x38aaba[_0xb7e7('0x1c')]){_0x38aaba['extensions'][_0xb7e7('0x11')]({'type':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x14')],'app':_0xb7e7('0x18'),'appdata':_0x38aaba['extension'][_0xb7e7('0x1e')]?'CDR(prefix)=${EXTEN:0:'+_0x38aaba[_0xb7e7('0x1c')]['cutdigits']+'}':_0xb7e7('0x23'),'context':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x15')],'exten':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x16')],'priority':_0x38aaba[_0xb7e7('0xf')]++,'VoiceExtensionId':_0x2ab045[_0x2c850f][0x0]['VoiceExtensionId']});}_0x38aaba[_0xb7e7('0x10')]['push']({'type':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x14')],'app':_0xb7e7('0x18'),'appdata':_0xb7e7('0x24')+_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x1a')],'context':_0x2ab045[_0x2c850f][0x0]['context'],'exten':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x16')],'priority':_0x38aaba[_0xb7e7('0xf')]++,'VoiceExtensionId':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x1a')]});if(_0x38aaba[_0xb7e7('0x1c')]&&_0x38aaba[_0xb7e7('0x1c')]['hasOwnProperty']('recordingFormat')&&_0x38aaba[_0xb7e7('0x1c')][_0xb7e7('0x25')]!==_0xb7e7('0x26')){_0x38aaba[_0xb7e7('0x10')][_0xb7e7('0x11')]({'type':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x14')],'app':_0xb7e7('0x18'),'appdata':_0xb7e7('0x27'),'context':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x15')],'exten':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x16')],'priority':_0x38aaba[_0xb7e7('0xf')]++,'VoiceExtensionId':_0x2ab045[_0x2c850f][0x0]['VoiceExtensionId']});_0x38aaba[_0xb7e7('0x10')][_0xb7e7('0x11')]({'type':_0x2ab045[_0x2c850f][0x0]['type'],'app':_0xb7e7('0x18'),'appdata':_0xb7e7('0x28')+_0x38aaba['extension'][_0xb7e7('0x25')]||_0xb7e7('0x29'),'context':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x15')],'exten':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x16')],'priority':_0x38aaba['priority']++,'VoiceExtensionId':_0x2ab045[_0x2c850f][0x0]['VoiceExtensionId']});}}_0x38aaba[_0xb7e7('0x10')][_0xb7e7('0x11')]({'type':_0x2ab045[_0x2c850f][0x0]['type'],'app':_0xb7e7('0x18'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x15')],'exten':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x16')],'priority':_0x38aaba[_0xb7e7('0xf')]++,'VoiceExtensionId':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x1a')]});_0x38aaba[_0xb7e7('0x10')][_0xb7e7('0x11')]({'type':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x14')],'app':_0xb7e7('0x18'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x15')],'exten':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x16')],'priority':_0x38aaba[_0xb7e7('0xf')]++,'VoiceExtensionId':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x1a')]});_0x38aaba[_0xb7e7('0x10')]['push']({'type':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x14')],'app':_0xb7e7('0x18'),'appdata':_0xb7e7('0x2a'),'context':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x15')],'exten':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x16')],'priority':_0x38aaba[_0xb7e7('0xf')]++,'VoiceExtensionId':_0x2ab045[_0x2c850f][0x0]['VoiceExtensionId']});for(var _0x16882b=0x0,_0xd2de76=0x0;_0x16882b<_0x2ab045[_0x2c850f]['length'];_0x16882b+=0x1,_0xd2de76=0x0){var _0x38a698=_0x2ab045[_0x2c850f][_0x16882b];if(_0x38a698['type']){_0x38a698[_0xb7e7('0x14')]=_0x38a698['type'][_0xb7e7('0x2b')]();}var _0xa46654=[];var _0x5f2881=[];delete _0x38a698['id'];delete _0x38a698[_0xb7e7('0x2c')];delete _0x38a698['updatedAt'];var _0x1d4427=_0x38a698['interval']!=='*,*,*,*'?[_0x38a698[_0xb7e7('0x2d')]]:_0x38a698['IntervalId']?_['map'](_[_0xb7e7('0xa')](_0x38aaba[_0xb7e7('0x4')],{'IntervalId':_0x38a698[_0xb7e7('0x6')]}),_0xb7e7('0x2d')):[];if(_0x38a698['hasOwnProperty'](_0xb7e7('0x2e'))){if(_0x38a698['tag']&&_0x38a698[_0xb7e7('0x2e')]!=='--'){_0xa46654[_0xb7e7('0x11')]({'type':_0x38a698[_0xb7e7('0x14')],'app':_0xb7e7('0x18'),'appdata':_0xb7e7('0x2f')+_0x38a698[_0xb7e7('0x2e')],'context':_0x38a698[_0xb7e7('0x15')],'exten':_0x38a698['exten'],'priority':_0x1d4427[_0xb7e7('0x30')]+_0x38aaba[_0xb7e7('0xf')]+_0xd2de76++,'VoiceExtensionId':_0x38a698['VoiceExtensionId']});}}if(_0x38a698[_0xb7e7('0x14')]==='outbound'&&_0x38a698[_0xb7e7('0xe')](_0xb7e7('0x31'))){if(_0x38a698[_0xb7e7('0x31')]){_0xa46654[_0xb7e7('0x11')]({'type':_0x38a698[_0xb7e7('0x14')],'app':_0xb7e7('0x20'),'appdata':_0xb7e7('0x32')+_0x38a698[_0xb7e7('0x31')]+')','context':_0x38a698[_0xb7e7('0x15')],'exten':_0x38a698[_0xb7e7('0x16')],'priority':_0x1d4427[_0xb7e7('0x30')]+_0x38aaba[_0xb7e7('0xf')]+_0xd2de76++,'VoiceExtensionId':_0x38a698[_0xb7e7('0x1a')]});}else{_0xa46654[_0xb7e7('0x11')]({'type':_0x38a698[_0xb7e7('0x14')],'app':_0xb7e7('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x38a698[_0xb7e7('0x15')],'exten':_0x38a698['exten'],'priority':_0x1d4427[_0xb7e7('0x30')]+_0x38aaba[_0xb7e7('0xf')]+_0xd2de76++,'VoiceExtensionId':_0x38a698[_0xb7e7('0x1a')]});}}if(_0x38a698[_0xb7e7('0xe')]('answer')){if(_0x3838dc['indexOf'](_0x38a698[_0xb7e7('0x33')][_0xb7e7('0x2b')]())>=0x0&&_0x38a698[_0xb7e7('0x34')]!==_0xb7e7('0x35')){if(_0x38a698['answer']){_0xa46654[_0xb7e7('0x11')]({'type':_0x38a698[_0xb7e7('0x14')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x38a698['context'],'exten':_0x38a698[_0xb7e7('0x16')],'priority':_0x1d4427[_0xb7e7('0x30')]+_0x38aaba[_0xb7e7('0xf')]+_0xd2de76++,'VoiceExtensionId':_0x38a698[_0xb7e7('0x1a')]});_0xa46654['push']({'type':_0x38a698[_0xb7e7('0x14')],'app':_0xb7e7('0x18'),'appdata':_0xb7e7('0x36'),'context':_0x38a698[_0xb7e7('0x15')],'exten':_0x38a698['exten'],'priority':_0x1d4427['length']+_0x38aaba[_0xb7e7('0xf')]+_0xd2de76++,'VoiceExtensionId':_0x38a698[_0xb7e7('0x1a')]});}else{_0xa46654['push']({'type':_0x38a698[_0xb7e7('0x14')],'app':_0xb7e7('0x20'),'appdata':_0xb7e7('0x37'),'context':_0x38a698[_0xb7e7('0x15')],'exten':_0x38a698[_0xb7e7('0x16')],'priority':_0x1d4427['length']+_0x38aaba[_0xb7e7('0xf')]+_0xd2de76++,'VoiceExtensionId':_0x38a698[_0xb7e7('0x1a')]});_0xa46654[_0xb7e7('0x11')]({'type':_0x38a698['type'],'app':_0xb7e7('0x18'),'appdata':_0xb7e7('0x38'),'context':_0x38a698[_0xb7e7('0x15')],'exten':_0x38a698[_0xb7e7('0x16')],'priority':_0x1d4427[_0xb7e7('0x30')]+_0x38aaba[_0xb7e7('0xf')]+_0xd2de76++,'VoiceExtensionId':_0x38a698[_0xb7e7('0x1a')]});}}}for(var _0x3d4bd3=0x0;_0x3d4bd3<_0x1d4427[_0xb7e7('0x30')];_0x3d4bd3+=0x1){var _0x1a4383=_0x38aaba[_0xb7e7('0xf')]+_0x1d4427[_0xb7e7('0x30')];var _0x2bd305=_0x3d4bd3===_0x1d4427[_0xb7e7('0x30')]-0x1?_0x38aaba['priority']+_0xa46654['length']+_0x5f2881[_0xb7e7('0x30')]+0x2:_0x38aaba[_0xb7e7('0xf')]+_0x3d4bd3+0x1;_0xa46654[_0xb7e7('0x39')](_0x3d4bd3,0x0,{'type':_0x38a698['type'],'app':_0xb7e7('0x3a'),'appdata':_0x1d4427[_0x3d4bd3]+'?'+_0x38a698[_0xb7e7('0x15')]+_0xb7e7('0x3b')+_0x1a4383+':'+_0x38a698[_0xb7e7('0x15')]+_0xb7e7('0x3b')+_0x2bd305,'exten':_0x38a698[_0xb7e7('0x16')],'context':_0x38a698[_0xb7e7('0x15')],'priority':_0x38aaba['priority']+_0x3d4bd3,'VoiceExtensionId':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x1a')]});}_0x38a698[_0xb7e7('0xf')]=_0xa46654[_0xb7e7('0x30')]?_['last'](_0xa46654)[_0xb7e7('0xf')]+0x1:_0x38aaba[_0xb7e7('0xf')];_0x38aaba['priority']=(_0x5f2881[_0xb7e7('0x30')]?_['last'](_0x5f2881)[_0xb7e7('0xf')]:_0x38a698[_0xb7e7('0xf')])+0x1;_0x38aaba[_0xb7e7('0x10')]=_[_0xb7e7('0x3c')](_0x38aaba[_0xb7e7('0x10')],_0xa46654,[_0x38a698],_0x5f2881);}_0x38aaba[_0xb7e7('0x10')]['push']({'type':_0x2ab045[_0x2c850f][0x0]['type'],'app':_0xb7e7('0x3d'),'exten':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x16')],'context':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x15')],'priority':_0x38aaba['priority'],'VoiceExtensionId':_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x1a')]});_0x1d38da['push'](_0x2ab045[_0x2c850f][0x0][_0xb7e7('0x1a')]);_0x3ce646=_['concat'](_0x3ce646,_0x38aaba[_0xb7e7('0x10')]);}}return _0x5bdfda[_0xb7e7('0x3e')](function(_0x5e3509){return _0x5bdfda[_0xb7e7('0x2')][_0xb7e7('0x5')][_0xb7e7('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x1d38da}},'transaction':_0x5e3509})[_0xb7e7('0x7')](function(_0x2d5bd8){return _0x5bdfda[_0xb7e7('0x2')][_0xb7e7('0x5')][_0xb7e7('0x40')](_[_0xb7e7('0x41')](_0x3ce646,_0xb7e7('0xf')),{'transaction':_0x5e3509});});});})['catch'](function(_0x521706){console['error'](_0x521706);});}exports[_0xb7e7('0x42')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index f7ef4d9..ed802e0 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 _0xdb14=['api','redis','defaults','localhost','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','keys','then','push','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','toString','NOW()','from','where','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','cm_contacts','deletedAt\x20IS\x20NULL','str','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','catch','all','BlackLists','get','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger'];(function(_0x2bbaea,_0x21508a){var _0x3853b9=function(_0x1aeee1){while(--_0x1aeee1){_0x2bbaea['push'](_0x2bbaea['shift']());}};_0x3853b9(++_0x21508a);}(_0xdb14,0xd8));var _0x4db1=function(_0x212f65,_0x4f7a57){_0x212f65=_0x212f65-0x0;var _0x2bd077=_0xdb14[_0x212f65];return _0x2bd077;};'use strict';var BPromise=require(_0x4db1('0x0'));var util=require(_0x4db1('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x4db1('0x2'));var Papa=require(_0x4db1('0x3'));var Redis=require(_0x4db1('0x4'));var db=require(_0x4db1('0x5'))['db'];var config=require(_0x4db1('0x6'));var logger=require(_0x4db1('0x7'))(_0x4db1('0x8'));config[_0x4db1('0x9')]=_[_0x4db1('0xa')](config['redis'],{'host':_0x4db1('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0x4db1('0xc')](socket);try{if(!process[_0x4db1('0xd')][0x2]||process[_0x4db1('0xd')][0x2]===_0x4db1('0xe')||process[_0x4db1('0xd')][0x2]===_0x4db1('0xf')){throw new Error(_0x4db1('0x10'));}var FILEPATH=process[_0x4db1('0xd')][0x2];if(!process['argv'][0x3]||process[_0x4db1('0xd')][0x3]===_0x4db1('0xe')||process[_0x4db1('0xd')][0x3]===_0x4db1('0xf')||!process['argv'][0x4]||process[_0x4db1('0xd')][0x4]===_0x4db1('0xe')||process['argv'][0x4]===_0x4db1('0xf')){throw new Error(_0x4db1('0x11'));}var FIELDS=_[_0x4db1('0x12')](process[_0x4db1('0xd')][0x3][_0x4db1('0x13')](','),process['argv'][0x4][_0x4db1('0x13')](','));if(!process[_0x4db1('0xd')][0x5]||process[_0x4db1('0xd')][0x5]===_0x4db1('0xe')||process[_0x4db1('0xd')][0x5]===_0x4db1('0xf')){throw new Error(_0x4db1('0x14'));}var LISTID=process[_0x4db1('0xd')][0x5];var COMPANYID=process[_0x4db1('0xd')][0x6]&&process['argv'][0x6]!==_0x4db1('0xe')&&process['argv'][0x6]!==_0x4db1('0xf')?process[_0x4db1('0xd')][0x6]:null;var DUPLICATES=process[_0x4db1('0xd')][0x7]&&process[_0x4db1('0xd')][0x7]!==_0x4db1('0xe')&&process[_0x4db1('0xd')][0x7]!=='null'?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x4db1('0xd')][0x8]==='undefined'||process[_0x4db1('0xd')][0x8]===_0x4db1('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x4db1('0xd')][0x8];}catch(_0x53bb3e){logger[_0x4db1('0x15')](_0x53bb3e);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(_0x38247f,_0x12aec5,_0xbe3c39,_0x21be65){var _0x189d6f={'message':_0x12aec5};_0x189d6f[_0x38247f]=!![];if(_0xbe3c39){_0x189d6f[_0x4db1('0x16')]=_0xbe3c39;}if(_0x21be65){_0x189d6f[_0x4db1('0x17')]=_0x21be65;}return _0x189d6f;}function isEmail(_0x36a9e5){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))*$/[_0x4db1('0x18')](_0x36a9e5);}function checkRow(_0x3aab63,_0x1a52d4,_0x542463){return new BPromise(function(_0x2e214b,_0x1d515f){if(_['isNil'](_0x3aab63)){return _0x1d515f(handleCheckRowError(_0x4db1('0x15'),_0x4db1('0x19'),null,_0x542463));}if(_0x3aab63[_0x4db1('0x1a')]&&_0x3aab63['errors']['length']){var _0xb111f4=_[_0x4db1('0x1b')](_0x3aab63['errors'],_0x4db1('0x1c'))[_0x4db1('0x1d')](';');return _0x1d515f(handleCheckRowError(_0x4db1('0x15'),_0xb111f4,null,_0x542463));}var _0x52a651={};for(var _0x13a922 in FIELDS){if(FIELDS[_0x4db1('0x1e')](_0x13a922)&&FIELDS[_0x13a922]){_0x52a651[_0x13a922]=_0x3aab63[_0x4db1('0x1f')][0x0][FIELDS[_0x13a922]]||_0x3aab63[_0x4db1('0x1f')][0x0]['\ufeff'+FIELDS[_0x13a922]];}}if(!_0x52a651['firstName']){return _0x1d515f(handleCheckRowError('error',_0x4db1('0x20'),null,_0x542463));}if(!_0x52a651[_0x4db1('0x21')]){return _0x1d515f(handleCheckRowError(_0x4db1('0x15'),_0x4db1('0x22'),null,_0x542463));}if(_0x52a651[_0x4db1('0x23')]){var _0x1dec28=moment(_0x52a651['birthDate'],_0x4db1('0x24'));if(!_0x1dec28['isValid']()){return _0x1d515f(handleCheckRowError(_0x4db1('0x15'),_0x4db1('0x25'),null,_0x542463));}}if(_0x52a651['email']){if(!isEmail(_0x52a651[_0x4db1('0x26')])){return _0x1d515f(handleCheckRowError(_0x4db1('0x15'),_0x4db1('0x27'),null,_0x542463));}}_0x52a651[_0x4db1('0x28')]=LISTID;_0x52a651[_0x4db1('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x4db1('0x2a')]&&_0x1a52d4){var _0x3951c9={};for(var _0x5bbddd=0x0,_0x3ef98d=DUPLICATES['length'];_0x5bbddd<_0x3ef98d;_0x5bbddd+=0x1){_0x3951c9[DUPLICATES[_0x5bbddd]]=_0x52a651[DUPLICATES[_0x5bbddd]];}var _0x431ab1=_[_0x4db1('0x2b')](_0x1a52d4,_0x3951c9);if(_0x431ab1){return _0x1d515f(handleCheckRowError(_0x4db1('0x2c'),_0x4db1('0x2d'),_0x431ab1,_0x542463));}}return db['CmContact']['create'](_0x52a651,{'raw':!![],'hooks':![],'fields':_[_0x4db1('0x2e')](_0x52a651)})[_0x4db1('0x2f')](function(_0x520f8a){if(DUPLICATES&&DUPLICATES[_0x4db1('0x2a')]&&_0x1a52d4){_0x1a52d4[_0x4db1('0x30')](_['pick'](_0x52a651,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x520f8a['id'];return _0x2e214b();})['catch'](function(_0x5ef287){return _0x1d515f(handleCheckRowError(_0x4db1('0x15'),_0x4db1('0x31')+(_0x5ef287['message']||JSON[_0x4db1('0x32')](_0x5ef287)),null,_0x542463));});});}function checkHopper(){function _0x164df7(){return function(_0x24f55d){logger[_0x4db1('0x15')](_0x4db1('0x33'),_0x4db1('0x34'),util[_0x4db1('0x35')](_0x24f55d,{'showHidden':![],'depth':null}));};}var _0x45e6e1=function(_0x23c44b,_0xcfb7f1){var _0x513a4f=squel[_0x4db1('0x36')]()[_0x4db1('0x37')](_0x4db1('0x38'))[_0x4db1('0x39')]([_0x4db1('0x21'),_0x4db1('0x3a'),_0x4db1('0x3b'),_0x4db1('0x28'),_0xcfb7f1,_0x4db1('0x3c'),_0x4db1('0x3d')],squel['select']()[_0x4db1('0x3e')](_0x4db1('0x21'),_0x4db1('0x21'))[_0x4db1('0x3e')]('NOW()',_0x4db1('0x3a'))[_0x4db1('0x3e')]('id',_0x4db1('0x3b'))[_0x4db1('0x3e')](LISTID[_0x4db1('0x3f')](),'ListId')['field'](_0x23c44b['id'][_0x4db1('0x3f')](),_0xcfb7f1)[_0x4db1('0x3e')]('NOW()','createdAt')[_0x4db1('0x3e')](_0x4db1('0x40'),'updatedAt')[_0x4db1('0x41')]('cm_contacts')[_0x4db1('0x42')]('deletedAt\x20IS\x20NULL')['where'](_0x4db1('0x43'),LISTID[_0x4db1('0x3f')]())[_0x4db1('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x4db1('0x42')](_0x4db1('0x44'),squel[_0x4db1('0x45')]()['field'](_0x4db1('0x21'))['from']('cm_hopper')[_0x4db1('0x42')](_0xcfb7f1+_0x4db1('0x46'),_0x23c44b['id']['toString']())))[_0x4db1('0x3f')]();return _0x513a4f;};var _0xd4447f=function(_0x58b2a5,_0x405bf8){var _0x3201c6=squel[_0x4db1('0x36')]()[_0x4db1('0x37')](_0x4db1('0x38'))[_0x4db1('0x39')]([_0x4db1('0x21'),'scheduledAt',_0x4db1('0x3b'),_0x4db1('0x28'),_0x405bf8,_0x4db1('0x3c'),'updatedAt'],squel['select']()['field'](_0x4db1('0x21'),'phone')[_0x4db1('0x3e')]('NOW()',_0x4db1('0x3a'))[_0x4db1('0x3e')]('id',_0x4db1('0x3b'))['field'](LISTID[_0x4db1('0x3f')](),_0x4db1('0x28'))[_0x4db1('0x3e')](_0x58b2a5['id'][_0x4db1('0x3f')](),_0x405bf8)[_0x4db1('0x3e')](_0x4db1('0x40'),_0x4db1('0x3c'))[_0x4db1('0x3e')](_0x4db1('0x40'),_0x4db1('0x3d'))[_0x4db1('0x41')]('cm_contacts')[_0x4db1('0x42')]('deletedAt\x20IS\x20NULL')['where'](_0x4db1('0x43'),LISTID[_0x4db1('0x3f')]())[_0x4db1('0x42')](_0x4db1('0x47'),squel['str'](hopperContacts))[_0x4db1('0x42')](_0x4db1('0x48'))['where'](_0x4db1('0x44'),squel[_0x4db1('0x45')]()[_0x4db1('0x3e')](_0x4db1('0x49'))['from'](_0x4db1('0x4a'))[_0x4db1('0x42')](_0x405bf8+_0x4db1('0x46'),_0x58b2a5['id'][_0x4db1('0x3f')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x4db1('0x3e')]('phone')['from']('cm_hopper')[_0x4db1('0x42')](_0x405bf8+_0x4db1('0x46'),_0x58b2a5['id'][_0x4db1('0x3f')]())))[_0x4db1('0x3f')]();return _0x3201c6;};function _0x2abd89(_0x43d95e,_0x80cdaa){var _0x1633fd=squel[_0x4db1('0x36')]()[_0x4db1('0x37')]('cm_hopper')[_0x4db1('0x39')](['phone',_0x4db1('0x3a'),_0x4db1('0x3b'),'ListId',_0x80cdaa,_0x4db1('0x3c'),_0x4db1('0x3d')],squel[_0x4db1('0x45')]()[_0x4db1('0x3e')](_0x4db1('0x21'),'phone')[_0x4db1('0x3e')](_0x4db1('0x40'),_0x4db1('0x3a'))[_0x4db1('0x3e')]('id',_0x4db1('0x3b'))[_0x4db1('0x3e')](LISTID[_0x4db1('0x3f')](),'ListId')[_0x4db1('0x3e')](_0x43d95e['id'][_0x4db1('0x3f')](),_0x80cdaa)[_0x4db1('0x3e')](_0x4db1('0x40'),_0x4db1('0x3c'))[_0x4db1('0x3e')](_0x4db1('0x40'),_0x4db1('0x3d'))[_0x4db1('0x41')](_0x4db1('0x4b'))[_0x4db1('0x42')](_0x4db1('0x4c'))[_0x4db1('0x42')](_0x4db1('0x43'),LISTID['toString']())[_0x4db1('0x42')](_0x4db1('0x47'),squel[_0x4db1('0x4d')](hopperContacts))[_0x4db1('0x42')](_0x4db1('0x48')))['toString']();return _0x1633fd;}function _0x5b723b(_0x30edb4,_0x131118){var _0x4ad340=squel[_0x4db1('0x36')]()['into'](_0x4db1('0x4e'))[_0x4db1('0x39')]([_0x4db1('0x21'),_0x4db1('0x3b'),_0x4db1('0x28'),_0x131118,_0x4db1('0x3c'),_0x4db1('0x3d')],squel[_0x4db1('0x45')]()[_0x4db1('0x3e')]('phone',_0x4db1('0x21'))['field']('id',_0x4db1('0x3b'))[_0x4db1('0x3e')](LISTID['toString'](),_0x4db1('0x28'))[_0x4db1('0x3e')](_0x30edb4['id']['toString'](),_0x131118)[_0x4db1('0x3e')](_0x4db1('0x40'),_0x4db1('0x3c'))['field'](_0x4db1('0x40'),_0x4db1('0x3d'))['from'](_0x4db1('0x4b'))[_0x4db1('0x42')](_0x4db1('0x4c'))[_0x4db1('0x42')](_0x4db1('0x43'),LISTID[_0x4db1('0x3f')]())[_0x4db1('0x42')](_0x4db1('0x47'),squel[_0x4db1('0x4d')](hopperContacts))[_0x4db1('0x42')](_0x4db1('0x48')))['toString']();return _0x4ad340;}return db[_0x4db1('0x4f')][_0x4db1('0x50')]({'where':{'type':_0x4db1('0x51')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x4db1('0x52')],'as':_0x4db1('0x53'),'where':{'id':LISTID}}]})[_0x4db1('0x2f')](function(_0x40a287){var _0x1b0014=[];if(_0x40a287){var _0x37d80a;for(var _0x1ff8fb=0x0,_0x4fb3a4;_0x1ff8fb<_0x40a287[_0x4db1('0x2a')];_0x1ff8fb+=0x1){_0x4fb3a4=_0x40a287[_0x1ff8fb]['get']({'plain':!![]});switch(_0x4fb3a4[_0x4db1('0x54')]){case _0x4db1('0x55'):_0x1b0014[_0x4db1('0x30')](db[_0x4db1('0x56')][_0x4db1('0x57')](_0xd4447f(_0x4fb3a4,_0x4db1('0x58')))[_0x4db1('0x2f')](function(){})['catch'](_0x164df7()));break;case _0x4db1('0x59'):_0x1b0014['push'](db[_0x4db1('0x56')][_0x4db1('0x57')](_0x45e6e1(_0x4fb3a4,_0x4db1('0x58')))[_0x4db1('0x2f')](function(){})[_0x4db1('0x5a')](_0x164df7()));break;default:_0x1b0014[_0x4db1('0x30')](db[_0x4db1('0x56')][_0x4db1('0x57')](_0x2abd89(_0x4fb3a4,_0x4db1('0x58')))[_0x4db1('0x2f')](function(){})[_0x4db1('0x5a')](_0x164df7()));}}}return _0x1b0014;})[_0x4db1('0x5b')]()['then'](function(){return db[_0x4db1('0x4f')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x4db1('0x52')],'as':_0x4db1('0x5c'),'where':{'id':LISTID}}]})[_0x4db1('0x2f')](function(_0x3bded3){var _0x1d4b8e=[];if(_0x3bded3){var _0x2aedc0;for(var _0xa171ff=0x0,_0x40ac9c;_0xa171ff<_0x3bded3[_0x4db1('0x2a')];_0xa171ff+=0x1){_0x40ac9c=_0x3bded3[_0xa171ff]['get']({'plain':!![]});_0x1d4b8e['push'](db['sequelize']['query'](_0x5b723b(_0x40ac9c,_0x4db1('0x58')))[_0x4db1('0x2f')](function(){})[_0x4db1('0x5a')](_0x164df7()));}}return _0x1d4b8e;})[_0x4db1('0x5b')]();})[_0x4db1('0x2f')](function(){return db['Campaign'][_0x4db1('0x50')]({'attributes':['id',_0x4db1('0x54')],'include':[{'model':db[_0x4db1('0x52')],'as':_0x4db1('0x53'),'where':{'id':LISTID}}]})[_0x4db1('0x2f')](function(_0x327fc7){var _0x216ebc=[];if(_0x327fc7){for(var _0xd543c3=0x0,_0xc8eb5;_0xd543c3<_0x327fc7[_0x4db1('0x2a')];_0xd543c3+=0x1){_0xc8eb5=_0x327fc7[_0xd543c3][_0x4db1('0x5d')]({'plain':!![]});switch(_0xc8eb5[_0x4db1('0x54')]){case _0x4db1('0x55'):_0x216ebc[_0x4db1('0x30')](db[_0x4db1('0x56')]['query'](_0xd4447f(_0xc8eb5,_0x4db1('0x5e')))[_0x4db1('0x2f')](function(){})[_0x4db1('0x5a')](_0x164df7()));break;case _0x4db1('0x59'):_0x216ebc['push'](db[_0x4db1('0x56')][_0x4db1('0x57')](_0x45e6e1(_0xc8eb5,_0x4db1('0x5e')))[_0x4db1('0x2f')](function(){})[_0x4db1('0x5a')](_0x164df7()));break;default:_0x216ebc['push'](db[_0x4db1('0x56')]['query'](_0x2abd89(_0xc8eb5,_0x4db1('0x5e')))[_0x4db1('0x2f')](function(){})['catch'](_0x164df7()));}}}return _0x216ebc;})[_0x4db1('0x5b')]();})[_0x4db1('0x2f')](function(){return db['Campaign'][_0x4db1('0x50')]({'attributes':['id'],'include':[{'model':db[_0x4db1('0x52')],'as':_0x4db1('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x353313){var _0x48ed33=[];if(_0x353313){for(var _0x4b2cef=0x0,_0x43618d;_0x4b2cef<_0x353313['length'];_0x4b2cef+=0x1){_0x43618d=_0x353313[_0x4b2cef][_0x4db1('0x5d')]({'plain':!![]});_0x48ed33[_0x4db1('0x30')](db['sequelize']['query'](_0x5b723b(_0x43618d,_0x4db1('0x5e')))['then'](function(){})[_0x4db1('0x5a')](_0x164df7()));}}return _0x48ed33;})[_0x4db1('0x5b')]();})[_0x4db1('0x5a')](function(_0x5cb32d){logger[_0x4db1('0x15')](_0x4db1('0x5f'),_0x4db1('0x60'),_0x5cb32d['message']);});}var processPromises=function(_0xd1f9e1){return BPromise[_0x4db1('0x5b')](promises)[_0x4db1('0x2f')](function(_0x2c4df9){})[_0x4db1('0x5a')](function(_0x42d62e){logger[_0x4db1('0x15')](_0x4db1('0x61'),JSON[_0x4db1('0x32')](_0x42d62e));})[_0x4db1('0x62')](function(){socket[_0x4db1('0x63')](_0x4db1('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xd1f9e1){return _0xd1f9e1['resume']();}});};var endCsv=function(){return BPromise[_0x4db1('0x65')]()[_0x4db1('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0x4db1('0x2f')](function(){socket[_0x4db1('0x63')](_0x4db1('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x4db1('0x66')](FILEPATH);}catch(_0xd458a3){logger['error'](_0x4db1('0x67'),JSON[_0x4db1('0x32')](_0xd458a3));}finally{process['exit'](0x0);}});};process['on'](_0x4db1('0x68'),function(){logger[_0x4db1('0x69')](_0x4db1('0x6a'));endCsv();});function main(){return BPromise['resolve']()[_0x4db1('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x4db1('0x13')](',');return db[_0x4db1('0x6b')][_0x4db1('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x4db1('0x2f')](function(_0x411815){var _0x216f1e=fs[_0x4db1('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x216f1e,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4b096d,_0x27e07a){total+=0x1;var _0x16b295=total;promises[_0x4db1('0x30')](checkRow(_0x4b096d,_0x411815,_0x16b295)[_0x4db1('0x2f')](function(){success+=0x1;})[_0x4db1('0x5a')](function(_0x3abd92){if(_0x3abd92['error']){errors+=0x1;delete _0x3abd92[_0x4db1('0x15')];}else if(_0x3abd92[_0x4db1('0x2c')]){duplicates+=0x1;delete _0x3abd92[_0x4db1('0x2c')];}rows['push'](_0x3abd92);}));if(total%0xc8===0x0){_0x27e07a[_0x4db1('0x6d')]();return processPromises(_0x27e07a);}},'complete':function(){return processPromises()[_0x4db1('0x2f')](function(){logger[_0x4db1('0x69')](_0x4db1('0x6e'));endCsv();});},'error':function(_0x4cfff0,_0x16e25a){logger[_0x4db1('0x69')](_0x4db1('0x6f'),JSON['stringify'](_0x4cfff0));endCsv();}});})['catch'](function(_0x17a377){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x4db1('0x32')](_0x17a377));});}main(); \ No newline at end of file +var _0x3bde=['VoiceQueueId','onlyIfOpen','all','BlackLists','Campaign','always','CampaignId','get','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20socket_timestamp\x20parameter!','error','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','sequelize','query'];(function(_0x466e67,_0x1b5666){var _0x2fc85f=function(_0x3f2b69){while(--_0x3f2b69){_0x466e67['push'](_0x466e67['shift']());}};_0x2fc85f(++_0x1b5666);}(_0x3bde,0x158));var _0xe3bd=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x3bde[_0x599e60];return _0x468e19;};'use strict';var BPromise=require(_0xe3bd('0x0'));var util=require(_0xe3bd('0x1'));var _=require(_0xe3bd('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0xe3bd('0x3'));var Redis=require(_0xe3bd('0x4'));var db=require(_0xe3bd('0x5'))['db'];var config=require(_0xe3bd('0x6'));var logger=require(_0xe3bd('0x7'))(_0xe3bd('0x8'));config[_0xe3bd('0x9')]=_[_0xe3bd('0xa')](config[_0xe3bd('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe3bd('0xb'))(new Redis(config['redis']));require(_0xe3bd('0xc'))[_0xe3bd('0xd')](socket);try{if(!process['argv'][0x2]||process[_0xe3bd('0xe')][0x2]===_0xe3bd('0xf')||process[_0xe3bd('0xe')][0x2]===_0xe3bd('0x10')){throw new Error(_0xe3bd('0x11'));}var FILEPATH=process[_0xe3bd('0xe')][0x2];if(!process['argv'][0x3]||process[_0xe3bd('0xe')][0x3]==='undefined'||process[_0xe3bd('0xe')][0x3]==='null'||!process[_0xe3bd('0xe')][0x4]||process['argv'][0x4]===_0xe3bd('0xf')||process[_0xe3bd('0xe')][0x4]===_0xe3bd('0x10')){throw new Error(_0xe3bd('0x12'));}var FIELDS=_['zipObject'](process[_0xe3bd('0xe')][0x3]['split'](','),process[_0xe3bd('0xe')][0x4][_0xe3bd('0x13')](','));if(!process[_0xe3bd('0xe')][0x5]||process[_0xe3bd('0xe')][0x5]===_0xe3bd('0xf')||process['argv'][0x5]===_0xe3bd('0x10')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xe3bd('0xe')][0x5];var COMPANYID=process[_0xe3bd('0xe')][0x6]&&process['argv'][0x6]!==_0xe3bd('0xf')&&process[_0xe3bd('0xe')][0x6]!==_0xe3bd('0x10')?process[_0xe3bd('0xe')][0x6]:null;var DUPLICATES=process[_0xe3bd('0xe')][0x7]&&process['argv'][0x7]!==_0xe3bd('0xf')&&process[_0xe3bd('0xe')][0x7]!==_0xe3bd('0x10')?process[_0xe3bd('0xe')][0x7]:null;if(!process[_0xe3bd('0xe')][0x8]||process[_0xe3bd('0xe')][0x8]===_0xe3bd('0xf')||process[_0xe3bd('0xe')][0x8]===_0xe3bd('0x10')){throw new Error(_0xe3bd('0x14'));}var SOCKET_TIMESTAMP=process[_0xe3bd('0xe')][0x8];}catch(_0x385c11){logger[_0xe3bd('0x15')](_0x385c11);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(_0x2a9578,_0x47602c,_0x515012,_0x1c38eb){var _0x56b463={'message':_0x47602c};_0x56b463[_0x2a9578]=!![];if(_0x515012){_0x56b463['contact']=_0x515012;}if(_0x1c38eb){_0x56b463['index']=_0x1c38eb;}return _0x56b463;}function isEmail(_0x4adc60){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))*$/[_0xe3bd('0x16')](_0x4adc60);}function checkRow(_0x2a414d,_0x4399ab,_0x458455){return new BPromise(function(_0x4cf1f0,_0xa69ae3){if(_[_0xe3bd('0x17')](_0x2a414d)){return _0xa69ae3(handleCheckRowError('error',_0xe3bd('0x18'),null,_0x458455));}if(_0x2a414d[_0xe3bd('0x19')]&&_0x2a414d[_0xe3bd('0x19')][_0xe3bd('0x1a')]){var _0x1e907d=_[_0xe3bd('0x1b')](_0x2a414d[_0xe3bd('0x19')],_0xe3bd('0x1c'))[_0xe3bd('0x1d')](';');return _0xa69ae3(handleCheckRowError('error',_0x1e907d,null,_0x458455));}var _0x342130={};for(var _0x19454d in FIELDS){if(FIELDS[_0xe3bd('0x1e')](_0x19454d)&&FIELDS[_0x19454d]){_0x342130[_0x19454d]=_0x2a414d[_0xe3bd('0x1f')][0x0][FIELDS[_0x19454d]]||_0x2a414d['data'][0x0]['\ufeff'+FIELDS[_0x19454d]];}}if(!_0x342130['firstName']){return _0xa69ae3(handleCheckRowError(_0xe3bd('0x15'),_0xe3bd('0x20'),null,_0x458455));}if(!_0x342130[_0xe3bd('0x21')]){return _0xa69ae3(handleCheckRowError('error',_0xe3bd('0x22'),null,_0x458455));}if(_0x342130[_0xe3bd('0x23')]){var _0x168443=moment(_0x342130[_0xe3bd('0x23')],_0xe3bd('0x24'));if(!_0x168443[_0xe3bd('0x25')]()){return _0xa69ae3(handleCheckRowError('error',_0xe3bd('0x26'),null,_0x458455));}}if(_0x342130[_0xe3bd('0x27')]){if(!isEmail(_0x342130['email'])){return _0xa69ae3(handleCheckRowError('error',_0xe3bd('0x28'),null,_0x458455));}}_0x342130[_0xe3bd('0x29')]=LISTID;_0x342130[_0xe3bd('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xe3bd('0x1a')]&&_0x4399ab){var _0x3a90ed={};for(var _0x3c91cb=0x0,_0x526f2=DUPLICATES[_0xe3bd('0x1a')];_0x3c91cb<_0x526f2;_0x3c91cb+=0x1){_0x3a90ed[DUPLICATES[_0x3c91cb]]=_0x342130[DUPLICATES[_0x3c91cb]];}var _0x270d3e=_[_0xe3bd('0x2b')](_0x4399ab,_0x3a90ed);if(_0x270d3e){return _0xa69ae3(handleCheckRowError(_0xe3bd('0x2c'),_0xe3bd('0x2d'),_0x270d3e,_0x458455));}}return db[_0xe3bd('0x2e')]['create'](_0x342130,{'raw':!![],'hooks':![],'fields':_['keys'](_0x342130)})[_0xe3bd('0x2f')](function(_0x2d06d1){if(DUPLICATES&&DUPLICATES['length']&&_0x4399ab){_0x4399ab[_0xe3bd('0x30')](_['pick'](_0x342130,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2d06d1['id'];return _0x4cf1f0();})[_0xe3bd('0x31')](function(_0x5c8c42){return _0xa69ae3(handleCheckRowError('error',_0xe3bd('0x32')+(_0x5c8c42['message']||JSON[_0xe3bd('0x33')](_0x5c8c42)),null,_0x458455));});});}function checkHopper(){function _0x135a71(){return function(_0x14b8a8){logger[_0xe3bd('0x15')](_0xe3bd('0x34'),'checkHopper',util['inspect'](_0x14b8a8,{'showHidden':![],'depth':null}));};}var _0x42ade0=function(_0x273890,_0x3d2327){var _0x11ee3a=squel[_0xe3bd('0x35')]()[_0xe3bd('0x36')](_0xe3bd('0x37'))[_0xe3bd('0x38')](['phone',_0xe3bd('0x39'),_0xe3bd('0x3a'),_0xe3bd('0x29'),_0x3d2327,_0xe3bd('0x3b'),_0xe3bd('0x3c')],squel[_0xe3bd('0x3d')]()['field'](_0xe3bd('0x21'),_0xe3bd('0x21'))[_0xe3bd('0x3e')](_0xe3bd('0x3f'),_0xe3bd('0x39'))[_0xe3bd('0x3e')]('id',_0xe3bd('0x3a'))[_0xe3bd('0x3e')](LISTID[_0xe3bd('0x40')](),'ListId')['field'](_0x273890['id'][_0xe3bd('0x40')](),_0x3d2327)[_0xe3bd('0x3e')](_0xe3bd('0x3f'),_0xe3bd('0x3b'))[_0xe3bd('0x3e')](_0xe3bd('0x3f'),_0xe3bd('0x3c'))['from'](_0xe3bd('0x41'))[_0xe3bd('0x42')](_0xe3bd('0x43'))[_0xe3bd('0x42')](_0xe3bd('0x44'),LISTID[_0xe3bd('0x40')]())[_0xe3bd('0x42')](_0xe3bd('0x45'))['where'](_0xe3bd('0x46'),squel[_0xe3bd('0x3d')]()[_0xe3bd('0x3e')](_0xe3bd('0x21'))[_0xe3bd('0x47')](_0xe3bd('0x37'))['where'](_0x3d2327+_0xe3bd('0x48'),_0x273890['id']['toString']())))['toString']();return _0x11ee3a;};var _0x97e947=function(_0x1d48d8,_0x5386a1){var _0x2c52ec=squel[_0xe3bd('0x35')]()[_0xe3bd('0x36')]('cm_hopper')[_0xe3bd('0x38')](['phone',_0xe3bd('0x39'),_0xe3bd('0x3a'),_0xe3bd('0x29'),_0x5386a1,_0xe3bd('0x3b'),_0xe3bd('0x3c')],squel['select']()[_0xe3bd('0x3e')]('phone',_0xe3bd('0x21'))[_0xe3bd('0x3e')]('NOW()',_0xe3bd('0x39'))['field']('id',_0xe3bd('0x3a'))[_0xe3bd('0x3e')](LISTID[_0xe3bd('0x40')](),_0xe3bd('0x29'))[_0xe3bd('0x3e')](_0x1d48d8['id'][_0xe3bd('0x40')](),_0x5386a1)[_0xe3bd('0x3e')](_0xe3bd('0x3f'),'createdAt')[_0xe3bd('0x3e')](_0xe3bd('0x3f'),'updatedAt')['from'](_0xe3bd('0x41'))[_0xe3bd('0x42')]('deletedAt\x20IS\x20NULL')[_0xe3bd('0x42')]('ListId\x20=\x20?',LISTID[_0xe3bd('0x40')]())[_0xe3bd('0x42')](_0xe3bd('0x49'),squel[_0xe3bd('0x4a')](hopperContacts))[_0xe3bd('0x42')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xe3bd('0x46'),squel['select']()[_0xe3bd('0x3e')](_0xe3bd('0x4b'))[_0xe3bd('0x47')]('cm_hopper_final')[_0xe3bd('0x42')](_0x5386a1+_0xe3bd('0x48'),_0x1d48d8['id'][_0xe3bd('0x40')]()))[_0xe3bd('0x42')](_0xe3bd('0x46'),squel[_0xe3bd('0x3d')]()[_0xe3bd('0x3e')](_0xe3bd('0x21'))[_0xe3bd('0x47')]('cm_hopper')[_0xe3bd('0x42')](_0x5386a1+'\x20=\x20?',_0x1d48d8['id'][_0xe3bd('0x40')]())))['toString']();return _0x2c52ec;};function _0x32b39d(_0x3f16b4,_0x4fb4b8){var _0x24d0e3=squel['insert']()[_0xe3bd('0x36')](_0xe3bd('0x37'))[_0xe3bd('0x38')](['phone',_0xe3bd('0x39'),_0xe3bd('0x3a'),_0xe3bd('0x29'),_0x4fb4b8,'createdAt',_0xe3bd('0x3c')],squel[_0xe3bd('0x3d')]()[_0xe3bd('0x3e')](_0xe3bd('0x21'),_0xe3bd('0x21'))[_0xe3bd('0x3e')](_0xe3bd('0x3f'),'scheduledAt')[_0xe3bd('0x3e')]('id',_0xe3bd('0x3a'))[_0xe3bd('0x3e')](LISTID[_0xe3bd('0x40')](),'ListId')[_0xe3bd('0x3e')](_0x3f16b4['id']['toString'](),_0x4fb4b8)['field'](_0xe3bd('0x3f'),_0xe3bd('0x3b'))[_0xe3bd('0x3e')](_0xe3bd('0x3f'),'updatedAt')[_0xe3bd('0x47')](_0xe3bd('0x41'))[_0xe3bd('0x42')]('deletedAt\x20IS\x20NULL')[_0xe3bd('0x42')](_0xe3bd('0x44'),LISTID['toString']())[_0xe3bd('0x42')](_0xe3bd('0x49'),squel['str'](hopperContacts))[_0xe3bd('0x42')](_0xe3bd('0x45')))[_0xe3bd('0x40')]();return _0x24d0e3;}function _0x4be1c5(_0x506222,_0x3a78a5){var _0x33ae2b=squel['insert']()['into'](_0xe3bd('0x4c'))[_0xe3bd('0x38')]([_0xe3bd('0x21'),_0xe3bd('0x3a'),_0xe3bd('0x29'),_0x3a78a5,'createdAt',_0xe3bd('0x3c')],squel[_0xe3bd('0x3d')]()[_0xe3bd('0x3e')]('phone',_0xe3bd('0x21'))[_0xe3bd('0x3e')]('id',_0xe3bd('0x3a'))['field'](LISTID['toString'](),_0xe3bd('0x29'))[_0xe3bd('0x3e')](_0x506222['id'][_0xe3bd('0x40')](),_0x3a78a5)[_0xe3bd('0x3e')](_0xe3bd('0x3f'),_0xe3bd('0x3b'))[_0xe3bd('0x3e')](_0xe3bd('0x3f'),_0xe3bd('0x3c'))[_0xe3bd('0x47')](_0xe3bd('0x41'))[_0xe3bd('0x42')](_0xe3bd('0x43'))[_0xe3bd('0x42')](_0xe3bd('0x44'),LISTID['toString']())['where'](_0xe3bd('0x49'),squel[_0xe3bd('0x4a')](hopperContacts))[_0xe3bd('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0xe3bd('0x40')]();return _0x33ae2b;}return db[_0xe3bd('0x4d')][_0xe3bd('0x4e')]({'where':{'type':_0xe3bd('0x4f')},'attributes':['id',_0xe3bd('0x50')],'include':[{'model':db[_0xe3bd('0x51')],'as':'Lists','where':{'id':LISTID}}]})[_0xe3bd('0x2f')](function(_0x403a28){var _0x59b36b=[];if(_0x403a28){var _0x265027;for(var _0x3c21d4=0x0,_0x55c489;_0x3c21d4<_0x403a28[_0xe3bd('0x1a')];_0x3c21d4+=0x1){_0x55c489=_0x403a28[_0x3c21d4]['get']({'plain':!![]});switch(_0x55c489[_0xe3bd('0x50')]){case'always':_0x59b36b[_0xe3bd('0x30')](db[_0xe3bd('0x52')][_0xe3bd('0x53')](_0x97e947(_0x55c489,_0xe3bd('0x54')))[_0xe3bd('0x2f')](function(){})['catch'](_0x135a71()));break;case _0xe3bd('0x55'):_0x59b36b[_0xe3bd('0x30')](db[_0xe3bd('0x52')][_0xe3bd('0x53')](_0x42ade0(_0x55c489,'VoiceQueueId'))[_0xe3bd('0x2f')](function(){})[_0xe3bd('0x31')](_0x135a71()));break;default:_0x59b36b[_0xe3bd('0x30')](db[_0xe3bd('0x52')][_0xe3bd('0x53')](_0x32b39d(_0x55c489,_0xe3bd('0x54')))[_0xe3bd('0x2f')](function(){})[_0xe3bd('0x31')](_0x135a71()));}}}return _0x59b36b;})[_0xe3bd('0x56')]()['then'](function(){return db[_0xe3bd('0x4d')][_0xe3bd('0x4e')]({'where':{'type':_0xe3bd('0x4f')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xe3bd('0x57'),'where':{'id':LISTID}}]})[_0xe3bd('0x2f')](function(_0x76ee39){var _0x26c564=[];if(_0x76ee39){var _0x432922;for(var _0x10ef7b=0x0,_0x457f5f;_0x10ef7b<_0x76ee39[_0xe3bd('0x1a')];_0x10ef7b+=0x1){_0x457f5f=_0x76ee39[_0x10ef7b]['get']({'plain':!![]});_0x26c564['push'](db[_0xe3bd('0x52')][_0xe3bd('0x53')](_0x4be1c5(_0x457f5f,_0xe3bd('0x54')))['then'](function(){})[_0xe3bd('0x31')](_0x135a71()));}}return _0x26c564;})[_0xe3bd('0x56')]();})[_0xe3bd('0x2f')](function(){return db[_0xe3bd('0x58')][_0xe3bd('0x4e')]({'attributes':['id',_0xe3bd('0x50')],'include':[{'model':db[_0xe3bd('0x51')],'as':'Lists','where':{'id':LISTID}}]})[_0xe3bd('0x2f')](function(_0x220c25){var _0x3ee14c=[];if(_0x220c25){for(var _0x3dea43=0x0,_0xa92d76;_0x3dea43<_0x220c25['length'];_0x3dea43+=0x1){_0xa92d76=_0x220c25[_0x3dea43]['get']({'plain':!![]});switch(_0xa92d76[_0xe3bd('0x50')]){case _0xe3bd('0x59'):_0x3ee14c[_0xe3bd('0x30')](db[_0xe3bd('0x52')][_0xe3bd('0x53')](_0x97e947(_0xa92d76,_0xe3bd('0x5a')))[_0xe3bd('0x2f')](function(){})[_0xe3bd('0x31')](_0x135a71()));break;case _0xe3bd('0x55'):_0x3ee14c[_0xe3bd('0x30')](db[_0xe3bd('0x52')]['query'](_0x42ade0(_0xa92d76,_0xe3bd('0x5a')))[_0xe3bd('0x2f')](function(){})[_0xe3bd('0x31')](_0x135a71()));break;default:_0x3ee14c[_0xe3bd('0x30')](db[_0xe3bd('0x52')]['query'](_0x32b39d(_0xa92d76,_0xe3bd('0x5a')))[_0xe3bd('0x2f')](function(){})['catch'](_0x135a71()));}}}return _0x3ee14c;})[_0xe3bd('0x56')]();})[_0xe3bd('0x2f')](function(){return db[_0xe3bd('0x58')][_0xe3bd('0x4e')]({'attributes':['id'],'include':[{'model':db[_0xe3bd('0x51')],'as':_0xe3bd('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x3d5b8e){var _0x1a5fbf=[];if(_0x3d5b8e){for(var _0x3aad4b=0x0,_0x4a5091;_0x3aad4b<_0x3d5b8e[_0xe3bd('0x1a')];_0x3aad4b+=0x1){_0x4a5091=_0x3d5b8e[_0x3aad4b][_0xe3bd('0x5b')]({'plain':!![]});_0x1a5fbf['push'](db['sequelize'][_0xe3bd('0x53')](_0x4be1c5(_0x4a5091,'CampaignId'))[_0xe3bd('0x2f')](function(){})[_0xe3bd('0x31')](_0x135a71()));}}return _0x1a5fbf;})[_0xe3bd('0x56')]();})[_0xe3bd('0x31')](function(_0x5d311e){logger[_0xe3bd('0x15')](_0xe3bd('0x5c'),_0xe3bd('0x5d'),_0x5d311e['message']);});}var processPromises=function(_0x4d199d){return BPromise[_0xe3bd('0x56')](promises)[_0xe3bd('0x2f')](function(_0x56d73c){})[_0xe3bd('0x31')](function(_0x469113){logger['error'](_0xe3bd('0x5e'),JSON[_0xe3bd('0x33')](_0x469113));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4d199d){return _0x4d199d['resume']();}});};var endCsv=function(){return BPromise[_0xe3bd('0x5f')]()[_0xe3bd('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0xe3bd('0x2f')](function(){socket['emit'](_0xe3bd('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xe3bd('0x61')](FILEPATH);}catch(_0x184cab){logger[_0xe3bd('0x15')](_0xe3bd('0x62'),JSON[_0xe3bd('0x33')](_0x184cab));}finally{process[_0xe3bd('0x63')](0x0);}});};process['on']('SIGINT',function(){logger[_0xe3bd('0x64')](_0xe3bd('0x65'));endCsv();});function main(){return BPromise[_0xe3bd('0x5f')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xe3bd('0x13')](',');return db[_0xe3bd('0x2e')][_0xe3bd('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xe3bd('0x2f')](function(_0x113aef){var _0x97f4fe=fs[_0xe3bd('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xe3bd('0x67')](_0x97f4fe,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3416f6,_0xbaabbf){total+=0x1;var _0x540db9=total;promises[_0xe3bd('0x30')](checkRow(_0x3416f6,_0x113aef,_0x540db9)['then'](function(){success+=0x1;})[_0xe3bd('0x31')](function(_0x338e8d){if(_0x338e8d[_0xe3bd('0x15')]){errors+=0x1;delete _0x338e8d[_0xe3bd('0x15')];}else if(_0x338e8d[_0xe3bd('0x2c')]){duplicates+=0x1;delete _0x338e8d[_0xe3bd('0x2c')];}rows['push'](_0x338e8d);}));if(total%0xc8===0x0){_0xbaabbf['pause']();return processPromises(_0xbaabbf);}},'complete':function(){return processPromises()[_0xe3bd('0x2f')](function(){logger['info'](_0xe3bd('0x68'));endCsv();});},'error':function(_0x14897f,_0x5c888b){logger[_0xe3bd('0x64')](_0xe3bd('0x69'),JSON[_0xe3bd('0x33')](_0x14897f));endCsv();}});})[_0xe3bd('0x31')](function(_0x31cc6a){logger[_0xe3bd('0x15')](_0xe3bd('0x6a'),JSON[_0xe3bd('0x33')](_0x31cc6a));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 649575d..3f82641 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 _0x780a=['replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','SystemRow','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','ioredis','../../../mysqldb','../../../config/logger','import','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','insert','into','cm_hopper','scheduledat','ListId','createdAt','priority','UserId','recallme','fields','from','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_contacts.updatedAt','cm_hopper_black','fromQuery','ContactId','updatedAt','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','concat','keys','CompanyId','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','push','code','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','then','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','length','all','timezones','dialTimezone','isNil','utcOffset','offset','set','main','send','start','binding','root','server/files/tmp','.csv','includes','header',',utcOffset','writeFileSync','createReadStream','data','errors','hasOwnProperty','trim'];(function(_0x5ad04c,_0x5ae6ff){var _0xaa839d=function(_0xb91ab0){while(--_0xb91ab0){_0x5ad04c['push'](_0x5ad04c['shift']());}};_0xaa839d(++_0x5ae6ff);}(_0x780a,0x15b));var _0xa780=function(_0x169255,_0x2a936a){_0x169255=_0x169255-0x0;var _0x2a4a71=_0x780a[_0x169255];return _0x2a4a71;};'use strict';var fs=require('fs');var path=require(_0xa780('0x0'));var _=require(_0xa780('0x1'));var Papa=require(_0xa780('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require('moment');var squel=require('squel');var Redis=require(_0xa780('0x3'));var db=require(_0xa780('0x4'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require(_0xa780('0x5'))(_0xa780('0x6'));config[_0xa780('0x7')]=_['defaults'](config[_0xa780('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa780('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xa780('0x8')](_0xa780('0x9'));function isEmail(_0x9a0277){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))*$/[_0xa780('0xa')](_0x9a0277);}function selectNotIn(_0x18acf9,_0x11de95,_0x2bb0a3,_0x4b863f,_0x2ec552){return squel[_0xa780('0xb')]()[_0xa780('0xc')](_0xa780('0xd'))['from'](_0x4b863f)[_0xa780('0xe')](_0x11de95,null,_0x11de95+_0xa780('0xf')+_0x4b863f+'.'+_0x2bb0a3)[_0xa780('0x10')](_0x4b863f+'.'+_0x2bb0a3+_0xa780('0x11')+_0x18acf9+'.'+_0x2bb0a3)[_0xa780('0x10')](_0x11de95+_0xa780('0x12')+_0x2ec552['join']()+')');}function insertCmHopper(_0x29c22c,_0x5a2e34,_0x7ef799,_0x3451e6,_0x5e5fc9){var _0x2e5822=['cm_contacts.phone',_0xa780('0x13'),_0xa780('0x14'),'cm_contacts.ListId',_0x5a2e34+'.'+_0x3451e6,_0xa780('0x15'),'cm_contacts.updatedAt',_0xa780('0x16'),'cm_contacts.UserId','\x22'+_0x5e5fc9+'\x22'];return squel[_0xa780('0x17')]()[_0xa780('0x18')](_0xa780('0x19'))['fromQuery']([_0xa780('0xd'),_0xa780('0x1a'),'ContactId',_0xa780('0x1b'),_0x3451e6,_0xa780('0x1c'),'updatedAt',_0xa780('0x1d'),_0xa780('0x1e'),_0xa780('0x1f')],squel['select']()[_0xa780('0x20')](_0x2e5822)[_0xa780('0x21')](_0x5a2e34)[_0xa780('0xe')](_0xa780('0x22'),null,'cm_contacts.ListId\x20=\x20'+_0x5a2e34+_0xa780('0x23'))[_0xa780('0xe')](_0x7ef799,null,_0x7ef799+_0xa780('0xf')+_0x5a2e34+'.'+_0x3451e6)[_0xa780('0x10')](_0x5a2e34+_0xa780('0x24'),_0x29c22c)[_0xa780('0x10')](_0xa780('0x25'),NOW)[_0xa780('0x10')](_0xa780('0x26'),selectNotIn(_0x5a2e34,_0x7ef799,_0x3451e6,'cm_hopper',[_0xa780('0x27'),_0xa780('0x28')]))[_0xa780('0x10')](_0xa780('0x26'),selectNotIn(_0x5a2e34,_0x7ef799,_0x3451e6,_0xa780('0x19'),['\x22always\x22'])))[_0xa780('0x29')]();}function insertCmHopperBlack(_0x814b8,_0x5a7be7,_0x2f1b68,_0x4fba4d){var _0x52015d=['cm_contacts.phone','cm_contacts.id',_0xa780('0x2a'),_0x5a7be7+'.'+_0x4fba4d,'cm_contacts.createdAt',_0xa780('0x2b')];return squel['insert']()[_0xa780('0x18')](_0xa780('0x2c'))[_0xa780('0x2d')](['phone',_0xa780('0x2e'),'ListId',_0x4fba4d,_0xa780('0x1c'),_0xa780('0x2f')],squel[_0xa780('0xb')]()['fields'](_0x52015d)[_0xa780('0x21')](_0x5a7be7)[_0xa780('0xe')](_0xa780('0x22'),null,_0xa780('0x30')+_0x5a7be7+'.CmListId')[_0xa780('0xe')](_0x2f1b68,null,_0x2f1b68+_0xa780('0xf')+_0x5a7be7+'.'+_0x4fba4d)[_0xa780('0x10')](_0x5a7be7+_0xa780('0x24'),_0x814b8)[_0xa780('0x10')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xa780('0x10')](_0xa780('0x26'),squel['select']()['field']('phone')[_0xa780('0x21')]('cm_hopper_black')[_0xa780('0x10')](_0xa780('0x31'),_0x814b8)['where'](_0x4fba4d+_0xa780('0x32'),_0x5a7be7+'.'+_0x4fba4d)))['toString']();}function insertTzCmHopper(_0x41e886,_0xe643aa,_0x45dc6f,_0x26bfe2,_0x3a5a73,_0x5b8ada){var _0x43277d=['cm_contacts.phone',_0xa780('0x33')+_0x5b8ada+_0xa780('0x34'),_0xa780('0x14'),'cm_contacts.ListId',_0xe643aa+'.'+_0x26bfe2,_0xa780('0x15'),_0xa780('0x2b'),'cm_contacts.priority',_0xa780('0x35'),'\x22'+_0x3a5a73+'\x22'];var _0x3361f7=squel[_0xa780('0x17')]()['into'](_0xa780('0x19'))['fromQuery']([_0xa780('0xd'),_0xa780('0x1a'),_0xa780('0x2e'),_0xa780('0x1b'),_0x26bfe2,_0xa780('0x1c'),_0xa780('0x2f'),_0xa780('0x1d'),'UserId','recallme'],squel[_0xa780('0xb')]()[_0xa780('0x20')](_0x43277d)[_0xa780('0x21')](_0xe643aa)['join']('cm_contacts',null,_0xa780('0x30')+_0xe643aa+_0xa780('0x23'))[_0xa780('0xe')](_0x45dc6f,null,_0x45dc6f+_0xa780('0xf')+_0xe643aa+'.'+_0x26bfe2)[_0xa780('0xe')](_0x5b8ada,null,_0x5b8ada+_0xa780('0xf')+_0xe643aa+'.'+_0x26bfe2)[_0xa780('0x10')](_0xe643aa+_0xa780('0x24'),_0x41e886)[_0xa780('0x10')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xa780('0x10')](_0xa780('0x26'),selectNotIn(_0xe643aa,_0x45dc6f,_0x26bfe2,_0xa780('0x19'),[_0xa780('0x27'),_0xa780('0x28')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xe643aa,_0x45dc6f,_0x26bfe2,_0xa780('0x19'),['\x22always\x22'])))[_0xa780('0x29')]();return _0x3361f7;}function insertTzCmHopperBlack(_0x29b4f2,_0x84f5e4,_0x206f2c,_0x332794){var _0x44d989=['cm_contacts.phone',_0xa780('0x14'),_0xa780('0x2a'),_0x84f5e4+'.'+_0x332794,_0xa780('0x15'),'cm_contacts.updatedAt'];return squel[_0xa780('0x17')]()[_0xa780('0x18')]('cm_hopper_black')['fromQuery']([_0xa780('0xd'),_0xa780('0x2e'),'ListId',_0x332794,_0xa780('0x1c'),_0xa780('0x2f')],squel['select']()[_0xa780('0x20')](_0x44d989)[_0xa780('0x21')](_0x84f5e4)[_0xa780('0xe')]('cm_contacts',null,_0xa780('0x30')+_0x84f5e4+_0xa780('0x23'))[_0xa780('0xe')](_0x206f2c,null,_0x206f2c+_0xa780('0xf')+_0x84f5e4+'.'+_0x332794)[_0xa780('0x10')](_0x84f5e4+_0xa780('0x24'),_0x29b4f2)[_0xa780('0x10')](_0xa780('0x25'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xa780('0xb')]()[_0xa780('0xc')](_0xa780('0xd'))[_0xa780('0x21')](_0xa780('0x2c'))[_0xa780('0x10')](_0xa780('0x31'),_0x29b4f2)[_0xa780('0x10')](_0x332794+_0xa780('0x32'),_0x84f5e4+'.'+_0x332794)))[_0xa780('0x29')]();}function insertCmContact(_0x4d0d17,_0x2d6b74,_0x392598,_0x5776a5){var _0x274953=_[_0xa780('0x36')](_[_0xa780('0x37')](_0x5776a5),[_0xa780('0x1b'),_0xa780('0x38'),_0xa780('0x1c'),_0xa780('0x2f')]);return squel[_0xa780('0x17')]()[_0xa780('0x18')](_0xa780('0x22'))[_0xa780('0x2d')](_0x274953,squel[_0xa780('0xb')]()['fields'](_0x274953)[_0xa780('0x21')](_0x2d6b74)[_0xa780('0x10')]('('+_0x392598[_0xa780('0xe')](',')+')\x20NOT\x20IN\x20?',squel[_0xa780('0xb')]()[_0xa780('0x20')](_0x392598)[_0xa780('0x21')]('cm_contacts')['where'](_0xa780('0x31'),_0x4d0d17)[_0xa780('0x10')](_0xa780('0x39')))[_0xa780('0x10')]('id\x20IN\x20?',squel[_0xa780('0xb')]()[_0xa780('0xc')](_0xa780('0x3a'),_0xa780('0x3b'))[_0xa780('0x21')](_0x2d6b74)[_0xa780('0x3c')](_0x392598[_0xa780('0xe')](','))))[_0xa780('0x29')]();}function handleStop(){logger[_0xa780('0x3d')](_0xa780('0x3e'));stopped=!![];}function handleUncaughtException(_0x47147d){logger[_0xa780('0x3f')](_0x47147d[_0xa780('0x40')]);process[_0xa780('0x41')](0x1);}function handleError(_0x2ea30f,_0x2a1799){stats['errors'][_0xa780('0x42')]({'name':_0x2a1799[_0xa780('0x43')],'message':_0x2a1799[_0xa780('0x40')],'row':_0x2ea30f});}function handleQuery(_0x346ec7){logger[_0xa780('0x3d')](_0x346ec7);return db[_0xa780('0x44')][_0xa780('0x45')](_0x346ec7)[_0xa780('0x46')](function(_0x5d5689){results['push'](_0x5d5689);})[_0xa780('0x47')](function(_0x3afd9b){logger[_0xa780('0x3f')](_0x3afd9b[_0xa780('0x40')]);});}function updateTzCampaigns(_0x2c3584){return new Promise(function(_0x2e80f7,_0x52c4ce){var _0x5e6fd5=squel[_0xa780('0xb')]()[_0xa780('0x20')]([_0xa780('0x48'),_0xa780('0x49')])[_0xa780('0x21')](_0xa780('0x4a'))[_0xa780('0xe')](_0xa780('0x4b'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0xa780('0x10')]('campaigns_has_cm_lists.CmListId='+_0x2c3584);db[_0xa780('0x44')][_0xa780('0x45')](_0x5e6fd5['toString']())[_0xa780('0x46')](function(_0x35d877){var _0x26aeba=[];for(var _0x1b4c42=0x0;_0x1b4c42<_0x35d877['length'];_0x1b4c42++){_0x26aeba['push'](getTimezoneData(_0x35d877[_0x1b4c42],tmp_campaigns));}BPromise['all'](_0x26aeba)[_0xa780('0x4c')](function(){_0x2e80f7({'val':0x1});});})[_0xa780('0x47')](function(_0x3adaaa){logger[_0xa780('0x3f')](_0x3adaaa[_0xa780('0x40')]);_0x2e80f7({'val':0x0});});});}function updateTzVoiceQueues(_0x2b1a9d){return new Promise(function(_0x3bc5d1,_0x2b0683){var _0x84ad5f=squel['select']()['fields']([_0xa780('0x4d'),_0xa780('0x4e')])[_0xa780('0x21')](_0xa780('0x4f'))[_0xa780('0xe')](_0xa780('0x50'),null,_0xa780('0x51'))[_0xa780('0x10')]('voice_queues_has_cm_lists.CmListId='+_0x2b1a9d);db[_0xa780('0x44')][_0xa780('0x45')](_0x84ad5f[_0xa780('0x29')]())['spread'](function(_0xf4af7f){var _0x45fb64=[];for(var _0x22af69=0x0;_0x22af69<_0xf4af7f[_0xa780('0x52')];_0x22af69++){_0x45fb64[_0xa780('0x42')](getTimezoneData(_0xf4af7f[_0x22af69],tmp_voice_queues));}BPromise[_0xa780('0x53')](_0x45fb64)['then'](function(){_0x3bc5d1({'val':0x1});});})[_0xa780('0x47')](function(_0x58ee69){logger[_0xa780('0x3f')](_0x58ee69[_0xa780('0x40')]);_0x3bc5d1({'val':0x0});});});}function getTimezoneData(_0x4e788a,_0x5912b4){return new Promise(function(_0x3959a6,_0x2aecde){var _0x22c5a1=shared[_0xa780('0x54')];var _0x362154=_0x22c5a1[_0x4e788a[_0xa780('0x55')]];if(_[_0xa780('0x56')](_0x362154)){_0x3959a6({'ret':0x1});}else{var _0x24648f=_0x362154[_0xa780('0x57')];var _0x5cdc3a=squel[_0xa780('0x17')]()[_0xa780('0x18')](_0x5912b4)['set']('id',_0x4e788a['id'])['set'](_0xa780('0x58'),_0x24648f)[_0xa780('0x59')]('dialTimezone',_0x4e788a[_0xa780('0x55')])[_0xa780('0x29')]();return db[_0xa780('0x44')][_0xa780('0x45')](_0x5cdc3a)[_0xa780('0x46')](function(_0x5a49dd){_0x3959a6({'ret':0x1});})[_0xa780('0x47')](function(_0x72511){logger[_0xa780('0x3f')](_0x72511['message']);_0x2aecde({'ret':0x1});});}});}function handleTZQuery(_0x3ec6b7){logger[_0xa780('0x3d')](_0x3ec6b7);return db[_0xa780('0x44')][_0xa780('0x45')](_0x3ec6b7)['spread'](function(_0xbefe0d){})[_0xa780('0x47')](function(_0x5eab6f){logger[_0xa780('0x3f')](_0x5eab6f[_0xa780('0x40')]);});}function main(_0x88b51f,_0xc4f717,_0x916d8,_0x5b25ec){logger[_0xa780('0x3d')](_0xa780('0x5a'),_0x88b51f,JSON['stringify'](_0xc4f717));process[_0xa780('0x5b')](_0xa780('0x5c'));var _0x4185db=_0xc4f717[_0xa780('0x5d')];var _0x30986a=_0xc4f717['socket_timestamp'];var _0x35c025=path[_0xa780('0xe')](config[_0xa780('0x5e')],_0xa780('0x5f'),_0x30986a+_0xa780('0x60'));hasTZ=_[_0xa780('0x37')](_0x4185db)[_0xa780('0x61')](_0xa780('0x55'));var _0x454761=_['keys'](_0x4185db)[_0xa780('0xe')]();logger['info'](_0xa780('0x62'),_0x454761);if(hasTZ)_0x454761+=_0xa780('0x63');fs[_0xa780('0x64')](_0x35c025,_0x454761+'\x0a');Papa['parse'](fs[_0xa780('0x65')](_0x88b51f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x69dac3,_0x387f4d){try{for(var _0x2632c5=0x0,_0x405d7a=[];_0x2632c5<_0x69dac3['data'][_0xa780('0x52')];_0x2632c5++){stats['rows']+=0x1;if(_0x69dac3['errors'][_0x2632c5]){handleError(_0x69dac3[_0xa780('0x66')][_0x2632c5],_0x69dac3[_0xa780('0x67')][_0x2632c5]);}else{var _0x4f2b32=[];for(var _0x73a8c1 in _0x4185db){if(_0x4185db[_0xa780('0x68')](_0x73a8c1)){if(_0x69dac3[_0xa780('0x66')][_0x2632c5][_0x4185db[_0x73a8c1]]){var _0x2ead5d=_[_0xa780('0x69')](_0x69dac3[_0xa780('0x66')][_0x2632c5][_0x4185db[_0x73a8c1]][_0xa780('0x6a')](/"/g,'\x27'));switch(_0x73a8c1){case'scheduledat':var _0x4b0b2b=moment(_0x2ead5d,_0xa780('0x9'),!![]);if(_0x4b0b2b['isValid']()){_0x405d7a[_0xa780('0x42')]('\x22'+_0x2ead5d+'\x22');}else{_0x4f2b32['push'](_0xa780('0x6b'));}break;case _0xa780('0x1d'):var _0x2cdbf8=parseInt(_0x2ead5d);_0x2ead5d=_[_0xa780('0x6c')](_0x2cdbf8)||_0x2cdbf8<0x0||_0x2cdbf8>0x4?_0x5b25ec?0x3:0x2:_0x2cdbf8;_0x405d7a[_0xa780('0x42')]('\x22'+_0x2ead5d+'\x22');break;case'UserId':var _0x5c5707=parseInt(_0x2ead5d);if(_[_0xa780('0x6d')](_0x5c5707)&&_[_0xa780('0x61')](_0x916d8,_0x5c5707)){_0x405d7a[_0xa780('0x42')]('\x22'+_0x5c5707+'\x22');}else{_0x4f2b32[_0xa780('0x42')](_0xa780('0x6e'));}break;case _0xa780('0x6f'):if(isEmail(_0x2ead5d)){_0x405d7a[_0xa780('0x42')]('\x22'+_0x2ead5d+'\x22');}else{_0x4f2b32[_0xa780('0x42')](_0xa780('0x70'));}break;case _0xa780('0x71'):var _0x15debf=moment(_0x2ead5d,'YYYY-MM-DD',!![]);if(_0x15debf[_0xa780('0x72')]()){_0x405d7a[_0xa780('0x42')]('\x22'+_0x2ead5d+'\x22');}else{_0x4f2b32[_0xa780('0x42')](_0xa780('0x73'));}break;case'dialTimezone':var _0xb09a49=shared[_0xa780('0x54')];var _0x190b6f=_0xb09a49[_0x2ead5d];if(!_[_0xa780('0x56')](_0x190b6f)){var _0x4f062b=_0x190b6f[_0xa780('0x57')];_0x405d7a['push']('\x22'+_0x2ead5d+'\x22');_0x405d7a[_0xa780('0x42')]('\x22'+_0x4f062b+'\x22');}break;default:_0x405d7a[_0xa780('0x42')]('\x22'+_0x2ead5d+'\x22');}}else{switch(_0x73a8c1){case'firstName':case _0xa780('0xd'):_0x4f2b32['push'](_0x73a8c1+'\x20not\x20specified');break;default:_0x405d7a[_0xa780('0x42')]('\x22\x22');}}}}if(_0x4f2b32[_0xa780('0x52')]){handleError(_0x69dac3[_0xa780('0x66')][_0x2632c5],{'code':_0xa780('0x74'),'message':_0x4f2b32[_0xa780('0xe')]()});}else{fs['appendFileSync'](_0x35c025,_0x405d7a[_0xa780('0xe')]()+'\x0a');}_0x405d7a=[];}if(!(stats['rows']%0xc8)){socket[_0xa780('0x75')]('contact:import:'+_0x30986a,stats);stats[_0xa780('0x67')]=[];}}if(stopped){logger['info'](_0xa780('0x76'));_0x387f4d[_0xa780('0x77')]();}}catch(_0x136459){handleError(_0x69dac3[_0xa780('0x66')][_0x2632c5],{'code':_0xa780('0x78'),'message':_0x136459[_0xa780('0x40')]});logger['error'](_0xa780('0x79'),_0x136459[_0xa780('0x40')]);}},'complete':function(){try{var _0x33ec68=[];var _0x189e51=[];var _0x10e3d8=_0xa780('0x22');if(_0xc4f717['duplicates']&&_0xc4f717[_0xa780('0x7a')][_0xa780('0x52')]){_0x10e3d8=_0xa780('0x7b')+_0x30986a;_0x33ec68[_0xa780('0x42')](_0xa780('0x7c')+_0x10e3d8+_0xa780('0x7d'));}tmp_campaigns=_0xa780('0x7e')+_0x30986a;tmp_voice_queues=_0xa780('0x7f')+_0x30986a;_0x189e51['push'](_0xa780('0x7c')+tmp_campaigns+_0xa780('0x80'));_0x189e51[_0xa780('0x42')](_0xa780('0x7c')+tmp_voice_queues+_0xa780('0x80'));BPromise[_0xa780('0x81')](_0x189e51,handleTZQuery)[_0xa780('0x4c')](function(_0x4c2f94){updateTzCampaigns(_0xc4f717[_0xa780('0x1b')])['then'](function(_0xb8800e){updateTzVoiceQueues(_0xc4f717['ListId'])[_0xa780('0x4c')](function(_0x87d247){var _0x499062=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x35c025,_0x10e3d8,_0x454761,_0xc4f717['ListId'],_0xc4f717[_0xa780('0x38')]||null,NOW,NOW);if(_['isNil'](_0x4185db[_0xa780('0x1a')])){_0x499062+=_0xa780('0x82');}_0x33ec68['push'](_0x499062);if(_0xc4f717[_0xa780('0x7a')]&&_0xc4f717[_0xa780('0x7a')][_0xa780('0x52')]){_0x33ec68[_0xa780('0x42')](insertCmContact(_0xc4f717[_0xa780('0x1b')],_0x10e3d8,_0xc4f717[_0xa780('0x7a')],_0x4185db));_0x33ec68[_0xa780('0x42')](_0xa780('0x83')+_0x10e3d8+';');}if(hasTZ){_0x33ec68[_0xa780('0x42')](insertTzCmHopper(_0xc4f717[_0xa780('0x1b')],'voice_queues_has_cm_lists',_0xa780('0x4f'),_0xa780('0x84'),_0x5b25ec,tmp_voice_queues));_0x33ec68[_0xa780('0x42')](insertTzCmHopperBlack(_0xc4f717[_0xa780('0x1b')],_0xa780('0x85'),'voice_queues','VoiceQueueId'));_0x33ec68['push'](insertTzCmHopper(_0xc4f717['ListId'],_0xa780('0x4b'),_0xa780('0x4a'),_0xa780('0x86'),_0x5b25ec,tmp_campaigns));_0x33ec68['push'](insertTzCmHopperBlack(_0xc4f717['ListId'],_0xa780('0x87'),_0xa780('0x4a'),_0xa780('0x86')));}else{_0x33ec68[_0xa780('0x42')](insertCmHopper(_0xc4f717[_0xa780('0x1b')],_0xa780('0x50'),'voice_queues',_0xa780('0x84'),_0x5b25ec));_0x33ec68[_0xa780('0x42')](insertCmHopperBlack(_0xc4f717[_0xa780('0x1b')],_0xa780('0x85'),_0xa780('0x4f'),_0xa780('0x84')));_0x33ec68[_0xa780('0x42')](insertCmHopper(_0xc4f717[_0xa780('0x1b')],'campaigns_has_cm_lists',_0xa780('0x4a'),_0xa780('0x86'),_0x5b25ec));_0x33ec68['push'](insertCmHopperBlack(_0xc4f717[_0xa780('0x1b')],'campaigns_has_cm_blacklists',_0xa780('0x4a'),_0xa780('0x86')));}_0x33ec68['push'](_0xa780('0x83')+tmp_campaigns+';');_0x33ec68[_0xa780('0x42')](_0xa780('0x83')+tmp_voice_queues+';');BPromise[_0xa780('0x81')](_0x33ec68,handleQuery)[_0xa780('0x4c')](function(_0x450645){stats[_0xa780('0x88')]=!![];stats[_0xa780('0x89')]=_0xc4f717[_0xa780('0x7a')]&&_0xc4f717['duplicates']['length']?results[0x2][_0xa780('0x89')]:results[0x0]['affectedRows'];socket['emit']('contact:import:'+_0x30986a,stats);fs[_0xa780('0x8a')](_0x88b51f);fs[_0xa780('0x8a')](_0x35c025);process[_0xa780('0x41')](0x0);})['catch'](function(_0x117e66){logger[_0xa780('0x3f')](_0x117e66[_0xa780('0x40')]);process['exit'](0x1);});});});});}catch(_0x5fdc8d){logger[_0xa780('0x3f')](_0xa780('0x8b'),_0x5fdc8d[_0xa780('0x40')]);process[_0xa780('0x41')](0x1);}},'error':function(_0x4d69f3,_0x4ca485,_0x2508f3,_0x59e212){throw new Error(_0x59e212);}});}function validate(){if(process[_0xa780('0x8c')]&&process[_0xa780('0x8c')]['length']<0x4){throw new Error(_0xa780('0x8d'));}var _0x15b759=path['join'](config['root'],_0xa780('0x5f'),process[_0xa780('0x8c')][0x2]);if(!fs[_0xa780('0x8e')](_0x15b759)){throw new Error(_0xa780('0x8f'));}var _0x3e87db={};try{_0x3e87db=JSON[_0xa780('0x90')](process['argv'][0x3]);if(!_0x3e87db[_0xa780('0x5d')]){throw new Error(_0xa780('0x91'));}if(!_0x3e87db['binding'][_0xa780('0xd')]){throw new Error(_0xa780('0x92'));}if(!_0x3e87db[_0xa780('0x5d')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x23131f=0x0;if(_0x3e87db[_0xa780('0x5d')][_0xa780('0x1e')]){_0x23131f=0x1;}if(!_0x3e87db[_0xa780('0x1b')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x1b354e){throw new Error(_0xa780('0x93'));}var _0x2d4797=[];try{_0x2d4797=_[_0xa780('0x94')](JSON[_0xa780('0x90')](process[_0xa780('0x8c')][0x4]),'id');}catch(_0x10a058){logger[_0xa780('0x3d')](_0xa780('0x95'));}main(_0x15b759,_0x3e87db,_0x2d4797,_0x23131f);}validate();process['on'](_0xa780('0x96'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x843a=['.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_hopper_black','updatedAt','fields','.CmListId\x20=\x20?','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','recallme','\x22onlyIfOpen\x22','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','Received\x20SIGINT','error','message','exit','push','code','query','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','spread','length','all','then','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','set','offset','info','main','binding','socket_timestamp','root','.csv',',utcOffset','writeFileSync','parse','createReadStream','data','rows','errors','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','isNil','utcOffset','\x20not\x20specified','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','server/files/tmp','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','squel','ioredis','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join'];(function(_0x3d30d1,_0x23b5ee){var _0x278967=function(_0x198577){while(--_0x198577){_0x3d30d1['push'](_0x3d30d1['shift']());}};_0x278967(++_0x23b5ee);}(_0x843a,0x1b7));var _0xa843=function(_0x61fd69,_0x179eb7){_0x61fd69=_0x61fd69-0x0;var _0xdd6cfc=_0x843a[_0x61fd69];return _0xdd6cfc;};'use strict';var fs=require('fs');var path=require(_0xa843('0x0'));var _=require(_0xa843('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0xa843('0x2'));var Redis=require(_0xa843('0x3'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require('../../../config/logger')(_0xa843('0x4'));config[_0xa843('0x5')]=_[_0xa843('0x6')](config[_0xa843('0x5')],{'host':_0xa843('0x7'),'port':0x18eb});var socket=require(_0xa843('0x8'))(new Redis(config[_0xa843('0x5')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xa843('0x9')](_0xa843('0xa'));function isEmail(_0x3985ca){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))*$/[_0xa843('0xb')](_0x3985ca);}function selectNotIn(_0x48806f,_0x2ec63f,_0x200e3b,_0x50b6c7,_0x48c569){return squel[_0xa843('0xc')]()[_0xa843('0xd')](_0xa843('0xe'))[_0xa843('0xf')](_0x50b6c7)[_0xa843('0x10')](_0x2ec63f,null,_0x2ec63f+_0xa843('0x11')+_0x50b6c7+'.'+_0x200e3b)['where'](_0x50b6c7+'.'+_0x200e3b+'\x20=\x20'+_0x48806f+'.'+_0x200e3b)[_0xa843('0x12')](_0x2ec63f+_0xa843('0x13')+_0x48c569['join']()+')');}function insertCmHopper(_0x4e1c33,_0x1dd3fb,_0x94c125,_0x5b56e2,_0x5e53c7){var _0xdebd12=[_0xa843('0x14'),_0xa843('0x15'),_0xa843('0x16'),_0xa843('0x17'),_0x1dd3fb+'.'+_0x5b56e2,_0xa843('0x18'),_0xa843('0x19'),_0xa843('0x1a'),'cm_contacts.UserId','\x22'+_0x5e53c7+'\x22'];return squel[_0xa843('0x1b')]()[_0xa843('0x1c')](_0xa843('0x1d'))[_0xa843('0x1e')]([_0xa843('0xe'),_0xa843('0x1f'),_0xa843('0x20'),_0xa843('0x21'),_0x5b56e2,_0xa843('0x22'),'updatedAt',_0xa843('0x23'),_0xa843('0x24'),'recallme'],squel[_0xa843('0xc')]()['fields'](_0xdebd12)[_0xa843('0xf')](_0x1dd3fb)[_0xa843('0x10')](_0xa843('0x25'),null,_0xa843('0x26')+_0x1dd3fb+_0xa843('0x27'))[_0xa843('0x10')](_0x94c125,null,_0x94c125+_0xa843('0x11')+_0x1dd3fb+'.'+_0x5b56e2)['where'](_0x1dd3fb+'.CmListId\x20=\x20?',_0x4e1c33)[_0xa843('0x12')](_0xa843('0x28'),NOW)[_0xa843('0x12')](_0xa843('0x29'),selectNotIn(_0x1dd3fb,_0x94c125,_0x5b56e2,'cm_hopper',['\x22always\x22','\x22onlyIfOpen\x22']))['where'](_0xa843('0x29'),selectNotIn(_0x1dd3fb,_0x94c125,_0x5b56e2,'cm_hopper',[_0xa843('0x2a')])))[_0xa843('0x2b')]();}function insertCmHopperBlack(_0x3ac2a0,_0x5469f1,_0x4ab839,_0x447949){var _0xa1ec56=[_0xa843('0x14'),_0xa843('0x16'),_0xa843('0x17'),_0x5469f1+'.'+_0x447949,_0xa843('0x18'),'cm_contacts.updatedAt'];return squel[_0xa843('0x1b')]()[_0xa843('0x1c')](_0xa843('0x2c'))['fromQuery']([_0xa843('0xe'),'ContactId',_0xa843('0x21'),_0x447949,_0xa843('0x22'),_0xa843('0x2d')],squel[_0xa843('0xc')]()[_0xa843('0x2e')](_0xa1ec56)[_0xa843('0xf')](_0x5469f1)['join'](_0xa843('0x25'),null,_0xa843('0x26')+_0x5469f1+_0xa843('0x27'))[_0xa843('0x10')](_0x4ab839,null,_0x4ab839+_0xa843('0x11')+_0x5469f1+'.'+_0x447949)[_0xa843('0x12')](_0x5469f1+_0xa843('0x2f'),_0x3ac2a0)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xa843('0x12')](_0xa843('0x29'),squel[_0xa843('0xc')]()[_0xa843('0xd')]('phone')[_0xa843('0xf')](_0xa843('0x2c'))['where'](_0xa843('0x30'),_0x3ac2a0)[_0xa843('0x12')](_0x447949+'\x20=\x20?',_0x5469f1+'.'+_0x447949)))['toString']();}function insertTzCmHopper(_0x466757,_0x44bca7,_0x32dcee,_0x470111,_0x10643f,_0x2bf38b){var _0x5353c7=[_0xa843('0x14'),_0xa843('0x31')+_0x2bf38b+_0xa843('0x32'),_0xa843('0x16'),_0xa843('0x17'),_0x44bca7+'.'+_0x470111,_0xa843('0x18'),_0xa843('0x19'),_0xa843('0x1a'),'cm_contacts.UserId','\x22'+_0x10643f+'\x22'];var _0x3b53d5=squel[_0xa843('0x1b')]()[_0xa843('0x1c')](_0xa843('0x1d'))['fromQuery']([_0xa843('0xe'),_0xa843('0x1f'),_0xa843('0x20'),_0xa843('0x21'),_0x470111,_0xa843('0x22'),'updatedAt',_0xa843('0x23'),_0xa843('0x24'),_0xa843('0x33')],squel[_0xa843('0xc')]()[_0xa843('0x2e')](_0x5353c7)[_0xa843('0xf')](_0x44bca7)[_0xa843('0x10')](_0xa843('0x25'),null,_0xa843('0x26')+_0x44bca7+_0xa843('0x27'))[_0xa843('0x10')](_0x32dcee,null,_0x32dcee+_0xa843('0x11')+_0x44bca7+'.'+_0x470111)[_0xa843('0x10')](_0x2bf38b,null,_0x2bf38b+_0xa843('0x11')+_0x44bca7+'.'+_0x470111)[_0xa843('0x12')](_0x44bca7+_0xa843('0x2f'),_0x466757)['where'](_0xa843('0x28'),NOW)[_0xa843('0x12')](_0xa843('0x29'),selectNotIn(_0x44bca7,_0x32dcee,_0x470111,_0xa843('0x1d'),[_0xa843('0x2a'),_0xa843('0x34')]))[_0xa843('0x12')](_0xa843('0x29'),selectNotIn(_0x44bca7,_0x32dcee,_0x470111,_0xa843('0x1d'),[_0xa843('0x2a')])))['toString']();return _0x3b53d5;}function insertTzCmHopperBlack(_0x8075fd,_0x335aae,_0x1118a4,_0x36a922){var _0x22db93=[_0xa843('0x14'),_0xa843('0x16'),_0xa843('0x17'),_0x335aae+'.'+_0x36a922,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0xa843('0x1b')]()[_0xa843('0x1c')](_0xa843('0x2c'))[_0xa843('0x1e')](['phone',_0xa843('0x20'),_0xa843('0x21'),_0x36a922,'createdAt','updatedAt'],squel[_0xa843('0xc')]()[_0xa843('0x2e')](_0x22db93)[_0xa843('0xf')](_0x335aae)['join'](_0xa843('0x25'),null,'cm_contacts.ListId\x20=\x20'+_0x335aae+_0xa843('0x27'))['join'](_0x1118a4,null,_0x1118a4+_0xa843('0x11')+_0x335aae+'.'+_0x36a922)[_0xa843('0x12')](_0x335aae+_0xa843('0x2f'),_0x8075fd)[_0xa843('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xa843('0x12')](_0xa843('0x29'),squel[_0xa843('0xc')]()[_0xa843('0xd')](_0xa843('0xe'))['from'](_0xa843('0x2c'))['where']('ListId\x20=\x20?',_0x8075fd)[_0xa843('0x12')](_0x36a922+'\x20=\x20?',_0x335aae+'.'+_0x36a922)))[_0xa843('0x2b')]();}function insertCmContact(_0x56d746,_0xaeb751,_0x5e94c7,_0x1ed72f){var _0x2efb87=_[_0xa843('0x35')](_[_0xa843('0x36')](_0x1ed72f),[_0xa843('0x21'),_0xa843('0x37'),_0xa843('0x22'),_0xa843('0x2d')]);return squel[_0xa843('0x1b')]()['into'](_0xa843('0x25'))[_0xa843('0x1e')](_0x2efb87,squel[_0xa843('0xc')]()[_0xa843('0x2e')](_0x2efb87)[_0xa843('0xf')](_0xaeb751)[_0xa843('0x12')]('('+_0x5e94c7[_0xa843('0x10')](',')+_0xa843('0x38'),squel[_0xa843('0xc')]()[_0xa843('0x2e')](_0x5e94c7)[_0xa843('0xf')]('cm_contacts')[_0xa843('0x12')](_0xa843('0x30'),_0x56d746)['where'](_0xa843('0x39')))[_0xa843('0x12')](_0xa843('0x3a'),squel[_0xa843('0xc')]()[_0xa843('0xd')](_0xa843('0x3b'),_0xa843('0x3c'))[_0xa843('0xf')](_0xaeb751)['group'](_0x5e94c7['join'](','))))['toString']();}function handleStop(){logger['info'](_0xa843('0x3d'));stopped=!![];}function handleUncaughtException(_0x2a5474){logger[_0xa843('0x3e')](_0x2a5474[_0xa843('0x3f')]);process[_0xa843('0x40')](0x1);}function handleError(_0x2187e7,_0x26d925){stats['errors'][_0xa843('0x41')]({'name':_0x26d925[_0xa843('0x42')],'message':_0x26d925[_0xa843('0x3f')],'row':_0x2187e7});}function handleQuery(_0x39d786){logger['info'](_0x39d786);return db['sequelize'][_0xa843('0x43')](_0x39d786)['spread'](function(_0x366e43){results[_0xa843('0x41')](_0x366e43);})['catch'](function(_0x3c89d6){logger[_0xa843('0x3e')](_0x3c89d6['message']);});}function updateTzCampaigns(_0x2a1bdc){return new Promise(function(_0x4f8a6b,_0x5af6d3){var _0x3dc774=squel[_0xa843('0xc')]()[_0xa843('0x2e')]([_0xa843('0x44'),_0xa843('0x45')])[_0xa843('0xf')](_0xa843('0x46'))[_0xa843('0x10')](_0xa843('0x47'),null,_0xa843('0x48'))['where'](_0xa843('0x49')+_0x2a1bdc);db[_0xa843('0x4a')][_0xa843('0x43')](_0x3dc774[_0xa843('0x2b')]())[_0xa843('0x4b')](function(_0x2df99b){var _0x1b17e4=[];for(var _0x398d6e=0x0;_0x398d6e<_0x2df99b[_0xa843('0x4c')];_0x398d6e++){_0x1b17e4[_0xa843('0x41')](getTimezoneData(_0x2df99b[_0x398d6e],tmp_campaigns));}BPromise[_0xa843('0x4d')](_0x1b17e4)[_0xa843('0x4e')](function(){_0x4f8a6b({'val':0x1});});})[_0xa843('0x4f')](function(_0x634366){logger[_0xa843('0x3e')](_0x634366['message']);_0x4f8a6b({'val':0x0});});});}function updateTzVoiceQueues(_0x222a5e){return new Promise(function(_0x1b9dec,_0x1fa362){var _0x15c746=squel[_0xa843('0xc')]()[_0xa843('0x2e')]([_0xa843('0x50'),_0xa843('0x51')])[_0xa843('0xf')](_0xa843('0x52'))[_0xa843('0x10')]('voice_queues_has_cm_lists',null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xa843('0x12')](_0xa843('0x53')+_0x222a5e);db['sequelize'][_0xa843('0x43')](_0x15c746[_0xa843('0x2b')]())['spread'](function(_0x2e7b47){var _0x8694dc=[];for(var _0x4d75d0=0x0;_0x4d75d0<_0x2e7b47[_0xa843('0x4c')];_0x4d75d0++){_0x8694dc[_0xa843('0x41')](getTimezoneData(_0x2e7b47[_0x4d75d0],tmp_voice_queues));}BPromise[_0xa843('0x4d')](_0x8694dc)[_0xa843('0x4e')](function(){_0x1b9dec({'val':0x1});});})[_0xa843('0x4f')](function(_0x5fcedc){logger[_0xa843('0x3e')](_0x5fcedc[_0xa843('0x3f')]);_0x1b9dec({'val':0x0});});});}function getTimezoneData(_0x5879aa,_0x29f382){return new Promise(function(_0x48494a,_0x3d3a71){var _0x564692=shared[_0xa843('0x54')];var _0x2171d4=_0x564692[_0x5879aa[_0xa843('0x55')]];if(_['isNil'](_0x2171d4)){_0x48494a({'ret':0x1});}else{var _0x4d65d9=_0x2171d4['utcOffset'];var _0x43be36=squel[_0xa843('0x1b')]()[_0xa843('0x1c')](_0x29f382)[_0xa843('0x56')]('id',_0x5879aa['id'])[_0xa843('0x56')](_0xa843('0x57'),_0x4d65d9)[_0xa843('0x56')](_0xa843('0x55'),_0x5879aa['dialTimezone'])['toString']();return db[_0xa843('0x4a')][_0xa843('0x43')](_0x43be36)[_0xa843('0x4b')](function(_0x165c09){_0x48494a({'ret':0x1});})[_0xa843('0x4f')](function(_0xab676b){logger[_0xa843('0x3e')](_0xab676b[_0xa843('0x3f')]);_0x3d3a71({'ret':0x1});});}});}function handleTZQuery(_0x5a9806){logger[_0xa843('0x58')](_0x5a9806);return db['sequelize']['query'](_0x5a9806)[_0xa843('0x4b')](function(_0x384272){})[_0xa843('0x4f')](function(_0x2eb80a){logger[_0xa843('0x3e')](_0x2eb80a[_0xa843('0x3f')]);});}function main(_0xb7dc9f,_0x3fb853,_0x4eaceb,_0x531cfb){logger[_0xa843('0x58')](_0xa843('0x59'),_0xb7dc9f,JSON['stringify'](_0x3fb853));process['send']('start');var _0x55a777=_0x3fb853[_0xa843('0x5a')];var _0x4b00c0=_0x3fb853[_0xa843('0x5b')];var _0x1d2343=path['join'](config[_0xa843('0x5c')],'server/files/tmp',_0x4b00c0+_0xa843('0x5d'));hasTZ=_['keys'](_0x55a777)['includes'](_0xa843('0x55'));var _0x263601=_[_0xa843('0x36')](_0x55a777)[_0xa843('0x10')]();logger['info']('header',_0x263601);if(hasTZ)_0x263601+=_0xa843('0x5e');fs[_0xa843('0x5f')](_0x1d2343,_0x263601+'\x0a');Papa[_0xa843('0x60')](fs[_0xa843('0x61')](_0xb7dc9f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x526394,_0x1bc733){try{for(var _0x316dd2=0x0,_0x43ba0e=[];_0x316dd2<_0x526394[_0xa843('0x62')][_0xa843('0x4c')];_0x316dd2++){stats[_0xa843('0x63')]+=0x1;if(_0x526394[_0xa843('0x64')][_0x316dd2]){handleError(_0x526394[_0xa843('0x62')][_0x316dd2],_0x526394[_0xa843('0x64')][_0x316dd2]);}else{var _0x333e99=[];for(var _0x2e9be1 in _0x55a777){if(_0x55a777['hasOwnProperty'](_0x2e9be1)){if(_0x526394[_0xa843('0x62')][_0x316dd2][_0x55a777[_0x2e9be1]]){var _0x596f16=_[_0xa843('0x65')](_0x526394[_0xa843('0x62')][_0x316dd2][_0x55a777[_0x2e9be1]][_0xa843('0x66')](/"/g,'\x27'));switch(_0x2e9be1){case _0xa843('0x1f'):var _0x221176=moment(_0x596f16,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x221176[_0xa843('0x67')]()){_0x43ba0e[_0xa843('0x41')]('\x22'+_0x596f16+'\x22');}else{_0x333e99[_0xa843('0x41')](_0xa843('0x68'));}break;case _0xa843('0x23'):var _0x1a29bc=parseInt(_0x596f16);_0x596f16=_[_0xa843('0x69')](_0x1a29bc)||_0x1a29bc<0x0||_0x1a29bc>0x4?_0x531cfb?0x3:0x2:_0x1a29bc;_0x43ba0e['push']('\x22'+_0x596f16+'\x22');break;case _0xa843('0x24'):var _0x53a6f0=parseInt(_0x596f16);if(_[_0xa843('0x6a')](_0x53a6f0)&&_[_0xa843('0x6b')](_0x4eaceb,_0x53a6f0)){_0x43ba0e[_0xa843('0x41')]('\x22'+_0x53a6f0+'\x22');}else{_0x333e99[_0xa843('0x41')](_0xa843('0x6c'));}break;case _0xa843('0x6d'):if(isEmail(_0x596f16)){_0x43ba0e[_0xa843('0x41')]('\x22'+_0x596f16+'\x22');}else{_0x333e99[_0xa843('0x41')](_0xa843('0x6e'));}break;case _0xa843('0x6f'):var _0x3be89b=moment(_0x596f16,'YYYY-MM-DD',!![]);if(_0x3be89b[_0xa843('0x67')]()){_0x43ba0e[_0xa843('0x41')]('\x22'+_0x596f16+'\x22');}else{_0x333e99[_0xa843('0x41')](_0xa843('0x70'));}break;case _0xa843('0x55'):var _0x43cadd=shared['timezones'];var _0x209f08=_0x43cadd[_0x596f16];if(!_[_0xa843('0x71')](_0x209f08)){var _0x274e87=_0x209f08[_0xa843('0x72')];_0x43ba0e['push']('\x22'+_0x596f16+'\x22');_0x43ba0e[_0xa843('0x41')]('\x22'+_0x274e87+'\x22');}break;default:_0x43ba0e[_0xa843('0x41')]('\x22'+_0x596f16+'\x22');}}else{switch(_0x2e9be1){case'firstName':case _0xa843('0xe'):_0x333e99[_0xa843('0x41')](_0x2e9be1+_0xa843('0x73'));break;default:_0x43ba0e[_0xa843('0x41')]('\x22\x22');}}}}if(_0x333e99['length']){handleError(_0x526394['data'][_0x316dd2],{'code':'SystemRow','message':_0x333e99[_0xa843('0x10')]()});}else{fs[_0xa843('0x74')](_0x1d2343,_0x43ba0e[_0xa843('0x10')]()+'\x0a');}_0x43ba0e=[];}if(!(stats[_0xa843('0x63')]%0xc8)){socket[_0xa843('0x75')](_0xa843('0x76')+_0x4b00c0,stats);stats[_0xa843('0x64')]=[];}}if(stopped){logger[_0xa843('0x58')](_0xa843('0x77'));_0x1bc733['abort']();}}catch(_0x34ba1a){handleError(_0x526394[_0xa843('0x62')][_0x316dd2],{'code':_0xa843('0x78'),'message':_0x34ba1a['message']});logger[_0xa843('0x3e')](_0xa843('0x79'),_0x34ba1a[_0xa843('0x3f')]);}},'complete':function(){try{var _0x571cd2=[];var _0x1fc628=[];var _0x5bf3d5=_0xa843('0x25');if(_0x3fb853['duplicates']&&_0x3fb853[_0xa843('0x7a')][_0xa843('0x4c')]){_0x5bf3d5=_0xa843('0x7b')+_0x4b00c0;_0x571cd2[_0xa843('0x41')](_0xa843('0x7c')+_0x5bf3d5+_0xa843('0x7d'));}tmp_campaigns=_0xa843('0x7e')+_0x4b00c0;tmp_voice_queues=_0xa843('0x7f')+_0x4b00c0;_0x1fc628[_0xa843('0x41')](_0xa843('0x7c')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x1fc628[_0xa843('0x41')](_0xa843('0x7c')+tmp_voice_queues+_0xa843('0x80'));BPromise[_0xa843('0x81')](_0x1fc628,handleTZQuery)[_0xa843('0x4e')](function(_0x3cd73e){updateTzCampaigns(_0x3fb853[_0xa843('0x21')])[_0xa843('0x4e')](function(_0x420221){updateTzVoiceQueues(_0x3fb853[_0xa843('0x21')])[_0xa843('0x4e')](function(_0x221f60){var _0x2036d5=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x1d2343,_0x5bf3d5,_0x263601,_0x3fb853[_0xa843('0x21')],_0x3fb853[_0xa843('0x37')]||null,NOW,NOW);if(_[_0xa843('0x71')](_0x55a777['scheduledat'])){_0x2036d5+=_0xa843('0x82');}_0x571cd2['push'](_0x2036d5);if(_0x3fb853[_0xa843('0x7a')]&&_0x3fb853[_0xa843('0x7a')][_0xa843('0x4c')]){_0x571cd2['push'](insertCmContact(_0x3fb853['ListId'],_0x5bf3d5,_0x3fb853['duplicates'],_0x55a777));_0x571cd2['push'](_0xa843('0x83')+_0x5bf3d5+';');}if(hasTZ){_0x571cd2[_0xa843('0x41')](insertTzCmHopper(_0x3fb853['ListId'],_0xa843('0x84'),'voice_queues',_0xa843('0x85'),_0x531cfb,tmp_voice_queues));_0x571cd2[_0xa843('0x41')](insertTzCmHopperBlack(_0x3fb853[_0xa843('0x21')],_0xa843('0x86'),'voice_queues',_0xa843('0x85')));_0x571cd2[_0xa843('0x41')](insertTzCmHopper(_0x3fb853[_0xa843('0x21')],_0xa843('0x47'),'campaigns',_0xa843('0x87'),_0x531cfb,tmp_campaigns));_0x571cd2['push'](insertTzCmHopperBlack(_0x3fb853['ListId'],'campaigns_has_cm_blacklists','campaigns',_0xa843('0x87')));}else{_0x571cd2[_0xa843('0x41')](insertCmHopper(_0x3fb853[_0xa843('0x21')],_0xa843('0x84'),_0xa843('0x52'),_0xa843('0x85'),_0x531cfb));_0x571cd2[_0xa843('0x41')](insertCmHopperBlack(_0x3fb853[_0xa843('0x21')],'voice_queues_has_cm_blacklists',_0xa843('0x52'),'VoiceQueueId'));_0x571cd2[_0xa843('0x41')](insertCmHopper(_0x3fb853[_0xa843('0x21')],_0xa843('0x47'),_0xa843('0x46'),_0xa843('0x87'),_0x531cfb));_0x571cd2[_0xa843('0x41')](insertCmHopperBlack(_0x3fb853[_0xa843('0x21')],_0xa843('0x88'),'campaigns',_0xa843('0x87')));}_0x571cd2[_0xa843('0x41')](_0xa843('0x83')+tmp_campaigns+';');_0x571cd2[_0xa843('0x41')](_0xa843('0x83')+tmp_voice_queues+';');BPromise['each'](_0x571cd2,handleQuery)[_0xa843('0x4e')](function(_0x4df069){stats[_0xa843('0x89')]=!![];stats[_0xa843('0x8a')]=_0x3fb853[_0xa843('0x7a')]&&_0x3fb853[_0xa843('0x7a')]['length']?results[0x2][_0xa843('0x8a')]:results[0x0][_0xa843('0x8a')];socket[_0xa843('0x75')](_0xa843('0x76')+_0x4b00c0,stats);fs[_0xa843('0x8b')](_0xb7dc9f);fs[_0xa843('0x8b')](_0x1d2343);process[_0xa843('0x40')](0x0);})[_0xa843('0x4f')](function(_0x116af4){logger['error'](_0x116af4[_0xa843('0x3f')]);process[_0xa843('0x40')](0x1);});});});});}catch(_0x4a2058){logger[_0xa843('0x3e')]('complete',_0x4a2058[_0xa843('0x3f')]);process[_0xa843('0x40')](0x1);}},'error':function(_0x28e7f1,_0xa8949e,_0x5ec4d5,_0x4f0357){throw new Error(_0x4f0357);}});}function validate(){if(process['argv']&&process[_0xa843('0x8c')][_0xa843('0x4c')]<0x4){throw new Error(_0xa843('0x8d'));}var _0x18fbc3=path[_0xa843('0x10')](config['root'],_0xa843('0x8e'),process[_0xa843('0x8c')][0x2]);if(!fs['existsSync'](_0x18fbc3)){throw new Error(_0xa843('0x8f'));}var _0x436e07={};try{_0x436e07=JSON[_0xa843('0x60')](process[_0xa843('0x8c')][0x3]);if(!_0x436e07[_0xa843('0x5a')]){throw new Error(_0xa843('0x90'));}if(!_0x436e07['binding'][_0xa843('0xe')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x436e07[_0xa843('0x5a')]['firstName']){throw new Error(_0xa843('0x91'));}var _0x14fe4=0x0;if(_0x436e07[_0xa843('0x5a')][_0xa843('0x24')]){_0x14fe4=0x1;}if(!_0x436e07[_0xa843('0x21')]){throw new Error(_0xa843('0x92'));}}catch(_0x198b92){throw new Error(_0xa843('0x93'));}var _0x46d931=[];try{_0x46d931=_[_0xa843('0x94')](JSON[_0xa843('0x60')](process[_0xa843('0x8c')][0x4]),'id');}catch(_0xe77f67){logger['info'](_0xa843('0x95'));}main(_0x18fbc3,_0x436e07,_0x46d931,_0x14fe4);}validate();process['on'](_0xa843('0x96'),handleStop);process['on'](_0xa843('0x97'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index afc94bc..b0dd0da 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 _0xd9dd=['answertime','Duration','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','queue','outbound','destcalleridnum','getDescriptions','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','uniqueid','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','talktime','Called\x20Number','Member\x20Name','membername','UniqueId','Date','starttime'];(function(_0x304f49,_0x4e81b9){var _0x350d4a=function(_0x1da26d){while(--_0x1da26d){_0x304f49['push'](_0x304f49['shift']());}};_0x350d4a(++_0x4e81b9);}(_0xd9dd,0xca));var _0xdd9d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd9dd[_0x122ef9];return _0x42fba0;};'use strict';exports['getSubjects']=function(_0x2294d1,_0xe4a62c){var _0x372ca4=[{'type':_0xdd9d('0x0'),'content':_0xdd9d('0x1'),'variableName':null}];switch(_0x2294d1[_0xdd9d('0x2')]()){case'voice':switch(_0xe4a62c[_0xdd9d('0x2')]()){case _0xdd9d('0x3'):_0x372ca4[_0xdd9d('0x4')]({'type':_0xdd9d('0x5'),'content':'','variableName':_0xdd9d('0x6')});_0x372ca4['push']({'type':'variable','content':'','variableName':'calleridnum'});break;case _0xdd9d('0x7'):_0x372ca4[_0xdd9d('0x4')]({'type':_0xdd9d('0x0'),'content':'Outbound\x20Call','variableName':null});_0x372ca4['push']({'type':_0xdd9d('0x5'),'content':'','variableName':_0xdd9d('0x8')});break;}}return _0x372ca4;};exports[_0xdd9d('0x9')]=function(_0x20f825,_0x1e5a15){var _0x4b328d=[];switch(_0x20f825[_0xdd9d('0x2')]()){case _0xdd9d('0xa'):switch(_0x1e5a15[_0xdd9d('0x2')]()){case _0xdd9d('0x3'):_0x4b328d=[{'type':_0xdd9d('0x0'),'content':_0xdd9d('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xdd9d('0xc'),'content':'','key':_0xdd9d('0xd'),'keyType':'variable','variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0xdd9d('0xe'),'keyType':'variable','variableName':_0xdd9d('0xf')},{'type':'keyValue','content':'','key':_0xdd9d('0x10'),'keyType':'variable','variableName':_0xdd9d('0x11')},{'type':_0xdd9d('0xc'),'content':'','key':'Queue','keyType':_0xdd9d('0x5'),'variableName':_0xdd9d('0x6')},{'type':_0xdd9d('0xc'),'content':'','key':'UniqueId','keyType':_0xdd9d('0x5'),'variableName':_0xdd9d('0x12')},{'type':_0xdd9d('0xc'),'content':'','key':'Date','keyType':_0xdd9d('0x5'),'variableName':_0xdd9d('0x13')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xdd9d('0xc'),'content':'','key':_0xdd9d('0x14'),'keyType':_0xdd9d('0x5'),'variableName':_0xdd9d('0x15')},{'type':'keyValue','content':'','key':_0xdd9d('0x16'),'keyType':_0xdd9d('0x5'),'variableName':'destcalleridnum'},{'type':_0xdd9d('0x0'),'content':_0xdd9d('0x17'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xdd9d('0x18'),'keyType':_0xdd9d('0x5'),'variableName':'agentcalledAt'},{'type':_0xdd9d('0xc'),'content':'','key':_0xdd9d('0x19'),'keyType':'variable','variableName':_0xdd9d('0x1a')},{'type':_0xdd9d('0xc'),'content':'','key':_0xdd9d('0x1b'),'keyType':_0xdd9d('0x5'),'variableName':_0xdd9d('0x1c')},{'type':_0xdd9d('0xc'),'content':'','key':_0xdd9d('0x1d'),'keyType':'variable','variableName':_0xdd9d('0x1e')},{'type':_0xdd9d('0xc'),'content':'','key':'Talk\x20Time','keyType':_0xdd9d('0x5'),'variableName':_0xdd9d('0x1f')}];break;case _0xdd9d('0x7'):_0x4b328d=[{'type':_0xdd9d('0x0'),'content':_0xdd9d('0xb'),'variableName':null},{'type':_0xdd9d('0xc'),'content':'','key':_0xdd9d('0x20'),'keyType':_0xdd9d('0x5'),'keyContent':'','variableName':_0xdd9d('0x8')},{'type':_0xdd9d('0xc'),'content':'','key':_0xdd9d('0x21'),'keyType':_0xdd9d('0x5'),'keyContent':'','variableName':_0xdd9d('0x22')},{'type':'keyValue','content':'','key':_0xdd9d('0x23'),'keyType':_0xdd9d('0x5'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xdd9d('0x24'),'keyType':_0xdd9d('0x5'),'keyContent':'','variableName':_0xdd9d('0x25')},{'type':'string','content':_0xdd9d('0x17')},{'type':_0xdd9d('0xc'),'content':'','key':'Answer\x20Time','keyType':_0xdd9d('0x5'),'keyContent':'','variableName':_0xdd9d('0x26')},{'type':_0xdd9d('0xc'),'content':'','key':'Complete\x20Time','keyType':_0xdd9d('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0xdd9d('0xc'),'content':'','key':_0xdd9d('0x27'),'keyType':_0xdd9d('0x5'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x4b328d;}; \ No newline at end of file +var _0x8f44=['string','Outbound\x20Call','destcalleridnum','getDescriptions','inbound','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','Queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','membername','UniqueId','starttime','Answer\x20Time','answertime','endtime','Duration','Billable\x20Time','billableseconds','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','push','queue','variable','calleridnum','outbound'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0x8f44,0x15f));var _0x48f4=function(_0x4bbca5,_0x11da29){_0x4bbca5=_0x4bbca5-0x0;var _0x392373=_0x8f44[_0x4bbca5];return _0x392373;};'use strict';exports[_0x48f4('0x0')]=function(_0xbbf0b6,_0x548724){var _0x4b34db=[{'type':'string','content':_0x48f4('0x1'),'variableName':null}];switch(_0xbbf0b6[_0x48f4('0x2')]()){case _0x48f4('0x3'):switch(_0x548724[_0x48f4('0x2')]()){case'inbound':_0x4b34db[_0x48f4('0x4')]({'type':'variable','content':'','variableName':_0x48f4('0x5')});_0x4b34db['push']({'type':_0x48f4('0x6'),'content':'','variableName':_0x48f4('0x7')});break;case _0x48f4('0x8'):_0x4b34db['push']({'type':_0x48f4('0x9'),'content':_0x48f4('0xa'),'variableName':null});_0x4b34db[_0x48f4('0x4')]({'type':_0x48f4('0x6'),'content':'','variableName':_0x48f4('0xb')});break;}}return _0x4b34db;};exports[_0x48f4('0xc')]=function(_0x472c32,_0x51a4e7){var _0x44d3ac=[];switch(_0x472c32[_0x48f4('0x2')]()){case'voice':switch(_0x51a4e7['toLowerCase']()){case _0x48f4('0xd'):_0x44d3ac=[{'type':_0x48f4('0x9'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x48f4('0xe'),'content':'','key':_0x48f4('0xf'),'keyType':_0x48f4('0x6'),'variableName':_0x48f4('0x7')},{'type':_0x48f4('0xe'),'content':'','key':_0x48f4('0x10'),'keyType':_0x48f4('0x6'),'variableName':_0x48f4('0x11')},{'type':_0x48f4('0xe'),'content':'','key':_0x48f4('0x12'),'keyType':_0x48f4('0x6'),'variableName':'destexten'},{'type':_0x48f4('0xe'),'content':'','key':_0x48f4('0x13'),'keyType':'variable','variableName':'queue'},{'type':_0x48f4('0xe'),'content':'','key':'UniqueId','keyType':_0x48f4('0x6'),'variableName':_0x48f4('0x14')},{'type':'keyValue','content':'','key':_0x48f4('0x15'),'keyType':_0x48f4('0x6'),'variableName':_0x48f4('0x16')},{'type':_0x48f4('0x9'),'content':_0x48f4('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x48f4('0xe'),'content':'','key':_0x48f4('0x18'),'keyType':_0x48f4('0x6'),'variableName':_0x48f4('0x19')},{'type':_0x48f4('0xe'),'content':'','key':_0x48f4('0x1a'),'keyType':'variable','variableName':_0x48f4('0xb')},{'type':_0x48f4('0x9'),'content':_0x48f4('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x48f4('0x1c'),'keyType':_0x48f4('0x6'),'variableName':'agentcalledAt'},{'type':_0x48f4('0xe'),'content':'','key':_0x48f4('0x1d'),'keyType':_0x48f4('0x6'),'variableName':_0x48f4('0x1e')},{'type':_0x48f4('0xe'),'content':'','key':'Agent\x20Complete','keyType':_0x48f4('0x6'),'variableName':_0x48f4('0x1f')},{'type':_0x48f4('0xe'),'content':'','key':'Hold\x20Time','keyType':_0x48f4('0x6'),'variableName':'holdtime'},{'type':_0x48f4('0xe'),'content':'','key':_0x48f4('0x20'),'keyType':_0x48f4('0x6'),'variableName':_0x48f4('0x21')}];break;case _0x48f4('0x8'):_0x44d3ac=[{'type':'string','content':_0x48f4('0x22'),'variableName':null},{'type':_0x48f4('0xe'),'content':'','key':_0x48f4('0x23'),'keyType':_0x48f4('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x48f4('0xe'),'content':'','key':'Member\x20Name','keyType':_0x48f4('0x6'),'keyContent':'','variableName':_0x48f4('0x24')},{'type':_0x48f4('0xe'),'content':'','key':_0x48f4('0x25'),'keyType':_0x48f4('0x6'),'keyContent':'','variableName':_0x48f4('0x14')},{'type':'keyValue','content':'','key':'Date','keyType':_0x48f4('0x6'),'keyContent':'','variableName':_0x48f4('0x26')},{'type':_0x48f4('0x9'),'content':_0x48f4('0x1b')},{'type':'keyValue','content':'','key':_0x48f4('0x27'),'keyType':_0x48f4('0x6'),'keyContent':'','variableName':_0x48f4('0x28')},{'type':_0x48f4('0xe'),'content':'','key':'Complete\x20Time','keyType':_0x48f4('0x6'),'keyContent':'','variableName':_0x48f4('0x29')},{'type':_0x48f4('0xe'),'content':'','key':_0x48f4('0x2a'),'keyType':_0x48f4('0x6'),'keyContent':'','variableName':'duration'},{'type':_0x48f4('0xe'),'content':'','key':_0x48f4('0x2b'),'keyType':_0x48f4('0x6'),'keyContent':'','variableName':_0x48f4('0x2c')}];break;}}return _0x44d3ac;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index b799560..6539ea8 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 _0xd4cd=['InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','then','update','info','error','tracked','query','body','omit','html','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst'];(function(_0x1e9973,_0x12f645){var _0x2aec73=function(_0x304707){while(--_0x304707){_0x1e9973['push'](_0x1e9973['shift']());}};_0x2aec73(++_0x12f645);}(_0xd4cd,0x152));var _0xdd4c=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xd4cd[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xdd4c('0x0'));var db=require(_0xdd4c('0x1'))['db'];var loggers={'openchannel':require(_0xdd4c('0x2'))(_0xdd4c('0x3')),'mail':require('../../config/logger')(_0xdd4c('0x4')),'fax':require(_0xdd4c('0x2'))(_0xdd4c('0x5')),'sms':require(_0xdd4c('0x2'))(_0xdd4c('0x6')),'chat':require(_0xdd4c('0x2'))(_0xdd4c('0x7')),'whatsapp':require(_0xdd4c('0x2'))(_0xdd4c('0x8'))};function getInteractionId(_0x81473f,_0x36da08,_0x33465e){if(_0x81473f&&_0x81473f[_[_0xdd4c('0x9')](_0x33465e)+_0xdd4c('0xa')]){return _0x81473f[_[_0xdd4c('0x9')](_0x33465e)+_0xdd4c('0xa')];}else if(_0x81473f&&_0x81473f['id']){return _0x81473f['id'];}else if(_0x36da08&&_0x36da08['id']){return _0x36da08['id'];}else{return'unknown';}}function log(_0x30a595,_0x5df5b7,_0x2aad85,_0x248aba,_0x4b7a7c,_0x51029b){loggers[_0x4b7a7c[_0xdd4c('0xb')]()][_0x30a595](_0xdd4c('0xc'),_0x51029b[_0xdd4c('0xd')](),_0x5df5b7?_0x5df5b7['id']:null,_0x5df5b7?_0x5df5b7[_0xdd4c('0xe')]:null,_0x5df5b7?_0x5df5b7['role']:null,getInteractionId(_0x2aad85,_0x248aba,_0x4b7a7c),_0x2aad85?JSON[_0xdd4c('0xf')](_0x2aad85):_0xdd4c('0x10'));}function updateUser(_0x2e39d0,_0x120254,_0x352271,_0xf8b5ac,_0x37b1ff){db[_[_0xdd4c('0x9')](_0xf8b5ac)+_0xdd4c('0x11')]['findOne']({'where':{'id':getInteractionId(_0x120254,_0x352271,_0xf8b5ac)}})[_0xdd4c('0x12')](function(_0x2bda54){if(_0x2bda54){return _0x2bda54[_0xdd4c('0x13')]({'UserId':_0x2e39d0?_0x2e39d0['id']:null});}})[_0xdd4c('0x12')](function(_0x4c6842){if(_0x4c6842){log(_0xdd4c('0x14'),_0x2e39d0,_0x120254,_0x352271,_0xf8b5ac,_0x37b1ff);}})['catch'](function(){log(_0xdd4c('0x15'),_0x2e39d0,_0x120254,_0x352271,_0xf8b5ac,_0x37b1ff);});}exports[_0xdd4c('0x16')]=function(_0xeb3f95,_0x39cfa8){return function(_0x282d68,_0x4c0120,_0x3bd6ec){var _0x3d1216=_0x282d68['user'];var _0x1b3fce={};var _0x4b4433=_0x282d68[_0xdd4c('0x17')];if(_0x1b3fce){_0x1b3fce=_['clone'](_0x282d68[_0xdd4c('0x18')]);_0x1b3fce=_[_0xdd4c('0x19')](_0x1b3fce,[_0xdd4c('0x18'),_0xdd4c('0x1a'),'phone',_0xdd4c('0x1b'),_0xdd4c('0x1c')]);}updateUser(_0x3d1216,_0x1b3fce,_0x4b4433,_0xeb3f95,_0x39cfa8);_0x3bd6ec(null);};}; \ No newline at end of file +var _0x7af7=['chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','null','Interaction','findOne','then','update','error','tracked','clone','body','omit','html','phone','fax','mobile','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions'];(function(_0x197ef7,_0x4b917f){var _0x4ff7fa=function(_0x24a4da){while(--_0x24a4da){_0x197ef7['push'](_0x197ef7['shift']());}};_0x4ff7fa(++_0x4b917f);}(_0x7af7,0x10f));var _0x77af=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x7af7[_0x8de54f];return _0x14cba4;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x77af('0x0'))(_0x77af('0x1')),'mail':require(_0x77af('0x0'))(_0x77af('0x2')),'fax':require(_0x77af('0x0'))(_0x77af('0x3')),'sms':require(_0x77af('0x0'))('sms-interactions'),'chat':require(_0x77af('0x0'))(_0x77af('0x4')),'whatsapp':require(_0x77af('0x0'))(_0x77af('0x5'))};function getInteractionId(_0xd194b6,_0x24e237,_0x178bce){if(_0xd194b6&&_0xd194b6[_[_0x77af('0x6')](_0x178bce)+'InteractionId']){return _0xd194b6[_[_0x77af('0x6')](_0x178bce)+_0x77af('0x7')];}else if(_0xd194b6&&_0xd194b6['id']){return _0xd194b6['id'];}else if(_0x24e237&&_0x24e237['id']){return _0x24e237['id'];}else{return _0x77af('0x8');}}function log(_0x451f92,_0x498d57,_0x467638,_0x2513e8,_0x1a5c1d,_0x4aa125){loggers[_0x1a5c1d[_0x77af('0x9')]()][_0x451f92]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4aa125[_0x77af('0xa')](),_0x498d57?_0x498d57['id']:null,_0x498d57?_0x498d57['name']:null,_0x498d57?_0x498d57['role']:null,getInteractionId(_0x467638,_0x2513e8,_0x1a5c1d),_0x467638?JSON['stringify'](_0x467638):_0x77af('0xb'));}function updateUser(_0x440f0e,_0x368504,_0x2592d3,_0x4f5c03,_0x46f8dc){db[_[_0x77af('0x6')](_0x4f5c03)+_0x77af('0xc')][_0x77af('0xd')]({'where':{'id':getInteractionId(_0x368504,_0x2592d3,_0x4f5c03)}})[_0x77af('0xe')](function(_0x972a7e){if(_0x972a7e){return _0x972a7e[_0x77af('0xf')]({'UserId':_0x440f0e?_0x440f0e['id']:null});}})['then'](function(_0x3b47ef){if(_0x3b47ef){log('info',_0x440f0e,_0x368504,_0x2592d3,_0x4f5c03,_0x46f8dc);}})['catch'](function(){log(_0x77af('0x10'),_0x440f0e,_0x368504,_0x2592d3,_0x4f5c03,_0x46f8dc);});}exports[_0x77af('0x11')]=function(_0x3e5e53,_0x3f71bb){return function(_0x54c3ad,_0x36281c,_0x2a0fb9){var _0x3e2502=_0x54c3ad['user'];var _0x5388a4={};var _0x54bd30=_0x54c3ad['query'];if(_0x5388a4){_0x5388a4=_[_0x77af('0x12')](_0x54c3ad[_0x77af('0x13')]);_0x5388a4=_[_0x77af('0x14')](_0x5388a4,[_0x77af('0x13'),_0x77af('0x15'),_0x77af('0x16'),_0x77af('0x17'),_0x77af('0x18')]);}updateUser(_0x3e2502,_0x5388a4,_0x54bd30,_0x3e5e53,_0x3f71bb);_0x2a0fb9(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 011afa8..4189683 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 _0x1fec=['License','findOne','then','status','catch','users','User','admin','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','%s:%s:%s','base64','final','parse','hasOwnProperty','use'];(function(_0x2b68a0,_0x31dd39){var _0x3da45d=function(_0x3c180c){while(--_0x3c180c){_0x2b68a0['push'](_0x2b68a0['shift']());}};_0x3da45d(++_0x31dd39);}(_0x1fec,0x103));var _0xc1fe=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x1fec[_0xbd08b4];return _0x314f1e;};'use strict';var crypto=require(_0xc1fe('0x0'));var util=require(_0xc1fe('0x1'));var compose=require(_0xc1fe('0x2'));var db=require(_0xc1fe('0x3'))['db'];var config=require(_0xc1fe('0x4'));function getValueFromLicense(_0x587e54,_0x39580f){if(_0x587e54&&_0x39580f){if(_0x39580f[_0xc1fe('0x5')]&&_0x39580f[_0xc1fe('0x6')]){var _0x186179=_0x39580f[_0xc1fe('0x5')];var _0x5eec48=_0x39580f[_0xc1fe('0x6')];var _0x262b3b=_0x186179[_0xc1fe('0x7')]('-')[0x4];var _0x1158ab=_0x186179['split']('-')[0x0];var _0x363068=crypto[_0xc1fe('0x8')](_0xc1fe('0x9'),util['format'](_0xc1fe('0xa'),_0x262b3b,_0x186179,_0x1158ab));var _0x1df463=_0x363068['update'](_0x5eec48,_0xc1fe('0xb'),'utf8');_0x1df463+=_0x363068[_0xc1fe('0xc')]('utf8');var _0x3791c5=JSON[_0xc1fe('0xd')](_0x1df463);return _0x3791c5[_0xc1fe('0xe')](_0x587e54)?_0x3791c5[_0x587e54]:null;}}return null;}function isLimit(_0x3521d0,_0x69144b,_0x5bb99a,_0x1d7e7f){var _0x54961d=_0x69144b;return compose()[_0xc1fe('0xf')](function(_0x2de15c,_0x18ad67,_0x118fed){return db[_0xc1fe('0x10')][_0xc1fe('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xc1fe('0x12')](function(_0x528bfc){var _0x32509a=getValueFromLicense(_0x3521d0,_0x528bfc);return _0x32509a?_0x32509a:_0x54961d;})[_0xc1fe('0x12')](function(_0x1c846c){_0x54961d=_0x1c846c;return _0x5bb99a['count'](_0x1d7e7f);})[_0xc1fe('0x12')](function(_0x145f8a){if(_0x145f8a>=_0x54961d){return _0x18ad67[_0xc1fe('0x13')](0x193)['json']({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x3521d0)});}_0x118fed();})[_0xc1fe('0x14')](function(_0x1dd069){_0x118fed(_0x1dd069);});});}function isUserLimit(){return isLimit(_0xc1fe('0x15'),0x1,db[_0xc1fe('0x16')],{'where':{'$or':[{'role':_0xc1fe('0x17')},{'role':'user'}]}});}exports[_0xc1fe('0x18')]=isUserLimit; \ No newline at end of file +var _0xaed9=['users','User','admin','user','isUserLimit','crypto','../../mysqldb','../../config/environment','license','split','createDecipher','%s:%s:%s','utf8','final','hasOwnProperty','use','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0xaed9,0x12b));var _0x9aed=function(_0x2c3b42,_0x55051e){_0x2c3b42=_0x2c3b42-0x0;var _0x4f66da=_0xaed9[_0x2c3b42];return _0x4f66da;};'use strict';var crypto=require(_0x9aed('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require(_0x9aed('0x1'))['db'];var config=require(_0x9aed('0x2'));function getValueFromLicense(_0x519c7d,_0x4df293){if(_0x519c7d&&_0x4df293){if(_0x4df293['data1']&&_0x4df293[_0x9aed('0x3')]){var _0x52406d=_0x4df293['data1'];var _0x4348a0=_0x4df293[_0x9aed('0x3')];var _0x4dc1a1=_0x52406d[_0x9aed('0x4')]('-')[0x4];var _0x2abf0b=_0x52406d['split']('-')[0x0];var _0x1502c5=crypto[_0x9aed('0x5')]('aes-256-ctr',util['format'](_0x9aed('0x6'),_0x4dc1a1,_0x52406d,_0x2abf0b));var _0x272200=_0x1502c5['update'](_0x4348a0,'base64',_0x9aed('0x7'));_0x272200+=_0x1502c5[_0x9aed('0x8')]('utf8');var _0x2f1a07=JSON['parse'](_0x272200);return _0x2f1a07[_0x9aed('0x9')](_0x519c7d)?_0x2f1a07[_0x519c7d]:null;}}return null;}function isLimit(_0x48ce29,_0x5ce389,_0x583bd6,_0x410433){var _0x4b7421=_0x5ce389;return compose()[_0x9aed('0xa')](function(_0x56b6c9,_0x374894,_0x272908){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0x9aed('0xb')](function(_0x1144b6){var _0x2a2c60=getValueFromLicense(_0x48ce29,_0x1144b6);return _0x2a2c60?_0x2a2c60:_0x4b7421;})['then'](function(_0x277957){_0x4b7421=_0x277957;return _0x583bd6[_0x9aed('0xc')](_0x410433);})[_0x9aed('0xb')](function(_0x2bd775){if(_0x2bd775>=_0x4b7421){return _0x374894['status'](0x193)[_0x9aed('0xd')]({'message':util['format'](_0x9aed('0xe'),_0x48ce29)});}_0x272908();})[_0x9aed('0xf')](function(_0x166731){_0x272908(_0x166731);});});}function isUserLimit(){return isLimit(_0x9aed('0x10'),0x1,db[_0x9aed('0x11')],{'where':{'$or':[{'role':_0x9aed('0x12')},{'role':_0x9aed('0x13')}]}});}exports[_0x9aed('0x14')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 7e4bb64..a099cb6 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 _0x54cd=['NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','$gte','>=\x20?','start','$between','pop','DATE','utcOffset','minutes','seconds','lodash','moment','parseSearch','and','[$and]','replace','[$or]','split','length','slice','forEach','shift','match','filter','map','conditions','push','buildExpression','operator','value','$lte','add','format','YYYY-MM-DD','castTo','CAST(','field','$ne','text','\x20OR\x20','IN\x20?','$notIn'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x54cd,0x188));var _0xd54c=function(_0x14d366,_0x2e706){_0x14d366=_0x14d366-0x0;var _0x189034=_0x54cd[_0x14d366];return _0x189034;};'use strict';var _=require(_0xd54c('0x0'));var moment=require(_0xd54c('0x1'));exports[_0xd54c('0x2')]=function(_0x23c669){var _0x3d701e={'conditions':[]};_0x3d701e['sqlOperator']=_['startsWith'](_0x23c669,'[$or]')?'or':_0xd54c('0x3');var _0x230e0c=_0x23c669['replace'](_0xd54c('0x4'),'')[_0xd54c('0x5')](_0xd54c('0x6'),'')[_0xd54c('0x7')]('||');for(var _0x3801ab=0x0;_0x3801ab<_0x230e0c[_0xd54c('0x8')];_0x3801ab++){var _0x47b2b5=_0x230e0c[_0x3801ab]['split'](':=');var _0x258d11=_0x47b2b5[0x0];var _0x597e22=_0x47b2b5[_0xd54c('0x9')](0x1);_0x597e22[_0xd54c('0xa')](function(_0xeff80){var _0x2a3bb6=_0xeff80[_0xd54c('0x7')]('[')[_0xd54c('0xb')]();var _0x4a38d1=_0xeff80[_0xd54c('0xc')](/\[(.*?)\]/g);_0x4a38d1['forEach'](function(_0x5b6453){var _0x1e02db=_0x5b6453[_0xd54c('0x7')]('[')[_0xd54c('0xd')](function(_0x2dab2f){return _0x2dab2f['indexOf'](']')>-0x1;})[_0xd54c('0xe')](function(_0x2372ec){return _0x2372ec[_0xd54c('0x7')](']')[0x0];})[0x0];_0x3d701e[_0xd54c('0xf')][_0xd54c('0x10')]({'field':_0x258d11,'operator':_0x2a3bb6,'value':_0x1e02db});});});}return _0x3d701e;};exports[_0xd54c('0x11')]=function(_0x5b9e29,_0x539cd5,_0x764ec8){var _0x54952d={};if(_0x539cd5==='DATE'){if(_0x764ec8[_0xd54c('0x12')]==='$eq'){_0x764ec8[_0xd54c('0x12')]='$between';_0x764ec8[_0xd54c('0x13')]+=','+_0x764ec8[_0xd54c('0x13')];}else if(_['includes'](['$gt',_0xd54c('0x14')],_0x764ec8[_0xd54c('0x12')])){_0x764ec8[_0xd54c('0x13')]=moment(_0x764ec8['value'])[_0xd54c('0x15')](0x1,'days')[_0xd54c('0x16')](_0xd54c('0x17'));}}if(_0x764ec8[_0xd54c('0x18')]){_0x539cd5=_0x764ec8[_0xd54c('0x18')];_0x54952d['text']=_0xd54c('0x19')+_0x5b9e29+'.'+_0x764ec8[_0xd54c('0x1a')]+'\x20AS\x20'+_0x764ec8[_0xd54c('0x18')]+')\x20'+parseOperator(_0x764ec8[_0xd54c('0x12')]);}else{_0x54952d['text']=_0x5b9e29+'.'+_0x764ec8[_0xd54c('0x1a')]+'\x20'+parseOperator(_0x764ec8[_0xd54c('0x12')]);}if(_['includes']([_0xd54c('0x1b'),'$notIn'],_0x764ec8['operator']))_0x54952d[_0xd54c('0x1c')]='('+_0x54952d['text']+_0xd54c('0x1d')+_0x5b9e29+'.'+_0x764ec8['field']+'\x20IS\x20NULL)';_0x54952d[_0xd54c('0x13')]=parseValue(_0x539cd5,_0x764ec8['operator'],_0x764ec8[_0xd54c('0x13')]);return _0x54952d;};function parseOperator(_0xb192c0){var _0x28c569;switch(_0xb192c0){case'$in':_0x28c569=_0xd54c('0x1e');break;case _0xd54c('0x1f'):_0x28c569=_0xd54c('0x20');break;case'$eq':_0x28c569=_0xd54c('0x21');break;case _0xd54c('0x1b'):_0x28c569=_0xd54c('0x22');break;case _0xd54c('0x23'):case _0xd54c('0x24'):case _0xd54c('0x25'):_0x28c569=_0xd54c('0x26');break;case _0xd54c('0x27'):_0x28c569=_0xd54c('0x28');break;case _0xd54c('0x29'):_0x28c569=_0xd54c('0x2a');break;case _0xd54c('0x14'):_0x28c569=_0xd54c('0x2b');break;case _0xd54c('0x2c'):_0x28c569=_0xd54c('0x2d');break;case'$between':_0x28c569='BETWEEN\x20?\x20AND\x20?';break;}return _0x28c569;}function parseValue(_0x1a2051,_0x21a883,_0x3fc2d0){var _0x2154cf={'start':undefined,'end':undefined};switch(_0x21a883){case'$in':case _0xd54c('0x1f'):_0x2154cf['start']=_0x3fc2d0[_0xd54c('0x7')](',');break;case _0xd54c('0x23'):_0x2154cf[_0xd54c('0x2e')]='%'+_0x3fc2d0+'%';break;case'$startsWith':_0x2154cf[_0xd54c('0x2e')]=_0x3fc2d0+'%';break;case _0xd54c('0x25'):_0x2154cf[_0xd54c('0x2e')]='%'+_0x3fc2d0;break;case _0xd54c('0x2f'):var _0xbfa53f=_0x3fc2d0[_0xd54c('0x7')](',');var _0x3fc2d0=_0xbfa53f[_0xd54c('0xb')]();var _0x5cbdb4=_0xbfa53f[_0xd54c('0x30')]();if(_0x1a2051===_0xd54c('0x31')){_0x3fc2d0=moment(_0x3fc2d0)[_0xd54c('0x32')](0x0,!![])['format']();_0x5cbdb4=moment(_0x5cbdb4)['utcOffset'](0x0,!![])['add'](0x17,'hours')[_0xd54c('0x15')](0x3b,_0xd54c('0x33'))[_0xd54c('0x15')](0x3b,_0xd54c('0x34'))[_0xd54c('0x16')]();}_0x2154cf={'start':_0x3fc2d0,'end':_0x5cbdb4};break;default:_0x2154cf[_0xd54c('0x2e')]=_0x3fc2d0;break;}return _0x2154cf;} \ No newline at end of file +var _0x48cb=['conditions','push','buildExpression','DATE','operator','$eq','value','$gt','add','format','YYYY-MM-DD','castTo','text','CAST(','includes','$ne','$notIn','\x20OR\x20','field','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','$in','start','pop','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','startsWith','[$or]','replace','[$and]','split','length','slice','shift','match','indexOf','map'];(function(_0x852df6,_0x4ddbad){var _0xc528ce=function(_0x1a2bac){while(--_0x1a2bac){_0x852df6['push'](_0x852df6['shift']());}};_0xc528ce(++_0x4ddbad);}(_0x48cb,0x100));var _0xb48c=function(_0x1d7e99,_0xd29d19){_0x1d7e99=_0x1d7e99-0x0;var _0xd3e019=_0x48cb[_0x1d7e99];return _0xd3e019;};'use strict';var _=require(_0xb48c('0x0'));var moment=require(_0xb48c('0x1'));exports[_0xb48c('0x2')]=function(_0x56749b){var _0x52a90d={'conditions':[]};_0x52a90d['sqlOperator']=_[_0xb48c('0x3')](_0x56749b,_0xb48c('0x4'))?'or':'and';var _0x38b31a=_0x56749b[_0xb48c('0x5')](_0xb48c('0x6'),'')['replace'](_0xb48c('0x4'),'')[_0xb48c('0x7')]('||');for(var _0x312724=0x0;_0x312724<_0x38b31a[_0xb48c('0x8')];_0x312724++){var _0x4eb0de=_0x38b31a[_0x312724][_0xb48c('0x7')](':=');var _0x4f80f1=_0x4eb0de[0x0];var _0x1d4bec=_0x4eb0de[_0xb48c('0x9')](0x1);_0x1d4bec['forEach'](function(_0x5a4639){var _0x26c778=_0x5a4639[_0xb48c('0x7')]('[')[_0xb48c('0xa')]();var _0x1d4cd9=_0x5a4639[_0xb48c('0xb')](/\[(.*?)\]/g);_0x1d4cd9['forEach'](function(_0x25a1ff){var _0x1f0559=_0x25a1ff[_0xb48c('0x7')]('[')['filter'](function(_0xa52852){return _0xa52852[_0xb48c('0xc')](']')>-0x1;})[_0xb48c('0xd')](function(_0xbe60ae){return _0xbe60ae[_0xb48c('0x7')](']')[0x0];})[0x0];_0x52a90d[_0xb48c('0xe')][_0xb48c('0xf')]({'field':_0x4f80f1,'operator':_0x26c778,'value':_0x1f0559});});});}return _0x52a90d;};exports[_0xb48c('0x10')]=function(_0x2bab4f,_0x220739,_0x2d2161){var _0x9db232={};if(_0x220739===_0xb48c('0x11')){if(_0x2d2161[_0xb48c('0x12')]===_0xb48c('0x13')){_0x2d2161[_0xb48c('0x12')]='$between';_0x2d2161[_0xb48c('0x14')]+=','+_0x2d2161[_0xb48c('0x14')];}else if(_['includes']([_0xb48c('0x15'),'$lte'],_0x2d2161[_0xb48c('0x12')])){_0x2d2161[_0xb48c('0x14')]=moment(_0x2d2161[_0xb48c('0x14')])[_0xb48c('0x16')](0x1,'days')[_0xb48c('0x17')](_0xb48c('0x18'));}}if(_0x2d2161[_0xb48c('0x19')]){_0x220739=_0x2d2161[_0xb48c('0x19')];_0x9db232[_0xb48c('0x1a')]=_0xb48c('0x1b')+_0x2bab4f+'.'+_0x2d2161['field']+'\x20AS\x20'+_0x2d2161[_0xb48c('0x19')]+')\x20'+parseOperator(_0x2d2161[_0xb48c('0x12')]);}else{_0x9db232[_0xb48c('0x1a')]=_0x2bab4f+'.'+_0x2d2161['field']+'\x20'+parseOperator(_0x2d2161[_0xb48c('0x12')]);}if(_[_0xb48c('0x1c')]([_0xb48c('0x1d'),_0xb48c('0x1e')],_0x2d2161['operator']))_0x9db232[_0xb48c('0x1a')]='('+_0x9db232['text']+_0xb48c('0x1f')+_0x2bab4f+'.'+_0x2d2161[_0xb48c('0x20')]+'\x20IS\x20NULL)';_0x9db232[_0xb48c('0x14')]=parseValue(_0x220739,_0x2d2161[_0xb48c('0x12')],_0x2d2161[_0xb48c('0x14')]);return _0x9db232;};function parseOperator(_0x553829){var _0x545a63;switch(_0x553829){case'$in':_0x545a63=_0xb48c('0x21');break;case'$notIn':_0x545a63=_0xb48c('0x22');break;case _0xb48c('0x13'):_0x545a63=_0xb48c('0x23');break;case _0xb48c('0x1d'):_0x545a63=_0xb48c('0x24');break;case _0xb48c('0x25'):case _0xb48c('0x26'):case _0xb48c('0x27'):_0x545a63=_0xb48c('0x28');break;case _0xb48c('0x29'):_0x545a63=_0xb48c('0x2a');break;case _0xb48c('0x15'):_0x545a63='>\x20?';break;case'$lte':_0x545a63='<=\x20?';break;case _0xb48c('0x2b'):_0x545a63=_0xb48c('0x2c');break;case _0xb48c('0x2d'):_0x545a63=_0xb48c('0x2e');break;}return _0x545a63;}function parseValue(_0x4d33d9,_0xa1208a,_0x1fb330){var _0x1759d7={'start':undefined,'end':undefined};switch(_0xa1208a){case _0xb48c('0x2f'):case _0xb48c('0x1e'):_0x1759d7[_0xb48c('0x30')]=_0x1fb330[_0xb48c('0x7')](',');break;case'$substring':_0x1759d7['start']='%'+_0x1fb330+'%';break;case _0xb48c('0x26'):_0x1759d7['start']=_0x1fb330+'%';break;case _0xb48c('0x27'):_0x1759d7[_0xb48c('0x30')]='%'+_0x1fb330;break;case _0xb48c('0x2d'):var _0x25eb87=_0x1fb330[_0xb48c('0x7')](',');var _0x1fb330=_0x25eb87[_0xb48c('0xa')]();var _0x587508=_0x25eb87[_0xb48c('0x31')]();if(_0x4d33d9===_0xb48c('0x11')){_0x1fb330=moment(_0x1fb330)[_0xb48c('0x32')](0x0,!![])[_0xb48c('0x17')]();_0x587508=moment(_0x587508)['utcOffset'](0x0,!![])[_0xb48c('0x16')](0x17,_0xb48c('0x33'))[_0xb48c('0x16')](0x3b,_0xb48c('0x34'))['add'](0x3b,_0xb48c('0x35'))[_0xb48c('0x17')]();}_0x1759d7={'start':_0x1fb330,'end':_0x587508};break;default:_0x1759d7[_0xb48c('0x30')]=_0x1fb330;break;}return _0x1759d7;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index bf068da..98aab02 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 _0x3831=['unsigned','DESC','ASC','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','intersection','model','attributes','nolimit','offset','order','where','filter','object','value','merge','VIRTUAL','lower','options','lodash','moment','parse','keys','fields','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','col'];(function(_0x14ad95,_0xa1f725){var _0x2a16f2=function(_0x5763bf){while(--_0x5763bf){_0x14ad95['push'](_0x14ad95['shift']());}};_0x2a16f2(++_0xa1f725);}(_0x3831,0x14c));var _0x1383=function(_0x5f046c,_0x53eb88){_0x5f046c=_0x5f046c-0x0;var _0x568032=_0x3831[_0x5f046c];return _0x568032;};'use strict';var _=require(_0x1383('0x0'));var sequelize=require('sequelize');var moment=require(_0x1383('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x42a46a){var _0x3a25fd=['ne'];try{var _0x15e6b5=JSON[_0x1383('0x2')](_0x42a46a);var _0x580d3d=Object[_0x1383('0x3')](_0x15e6b5)[0x0];return _0x3a25fd['includes'](_0x580d3d);}catch(_0x21ea2c){return![];}}function getOperatorValue(_0x53b708){var _0x5b64b1=JSON['parse'](_0x53b708);var _0x45a030=Object['keys'](_0x5b64b1)[0x0];var _0x187027=_0x5b64b1[_0x45a030];return{['$'+_0x45a030]:_0x187027};}exports[_0x1383('0x4')]=function(_0x2e9a5b){var _0x266bde=null;if(_0x2e9a5b){_0x266bde=_0x2e9a5b[_0x1383('0x5')](',');}return _0x266bde;};exports[_0x1383('0x6')]=function(_0x3ca0e6,_0xe0ee2f){var _0x47ba84={};if(!_[_0x1383('0x7')](_0x3ca0e6)){_[_0x1383('0x8')](_0x3ca0e6,function(_0x627ec3,_0xb11599){try{if(_0xe0ee2f){var _0x3675cb=_['find'](_0xe0ee2f,{'name':_0xb11599})||{};if(hasSequelizeOperator(_0x627ec3)){_0x47ba84[_0xb11599]=getOperatorValue(_0x627ec3);}else if(_0x3675cb[_0x1383('0x9')]===_0x1383('0xa')&&_[_0x1383('0xb')](_0x627ec3)){var _0x48c107=JSON['parse'](_0x627ec3);var _0x32e302={'$gte':moment(moment(_0x48c107[_0x1383('0xc')])[_0x1383('0xd')](_0x1383('0xe')))[_0x1383('0xf')]()[_0x1383('0xd')](),'$lte':moment(moment(_0x48c107[_0x1383('0x10')])[_0x1383('0xd')]('YYYY-MM-DD'))[_0x1383('0xf')]()[_0x1383('0x11')](0x1,'s')[_0x1383('0xd')]()};_0x47ba84[_0xb11599]=_0x32e302;}else if(_0x3675cb[_0x1383('0x12')]===_0x1383('0x13')){_0x47ba84[_0xb11599]=_0x627ec3;}else{_0x47ba84[_0xb11599]=_[_0x1383('0x14')](_0x627ec3)?_0x627ec3:JSON[_0x1383('0x2')](_0x627ec3);}}else{_0x47ba84[_0xb11599]=_['isArray'](_0x627ec3)?_0x627ec3:JSON['parse'](_0x627ec3);}}catch(_0x2301a6){_0x47ba84[_0xb11599]=_0x627ec3['split'](',');}});}return _0x47ba84;};exports[_0x1383('0x15')]=function(_0x5b3705){_0x5b3705=parseInt(_0x5b3705,0xa);if(!_0x5b3705||_0x5b3705<0x0){_0x5b3705=LIMIT_VALUE;}return _0x5b3705;};exports['offset']=function(_0x4d854f){_0x4d854f=parseInt(_0x4d854f,0xa);if(!_0x4d854f||_0x4d854f<0x0){_0x4d854f=0x0;}return _0x4d854f;};exports[_0x1383('0x16')]=function(_0x598d09){var _0x2aa3b6,_0x57a840=null;if(_0x598d09){_0x2aa3b6=_0x598d09[_0x1383('0x5')](',');_0x57a840=_[_0x1383('0x17')](_0x2aa3b6,function(_0xca314){if(_0xca314[_0x1383('0x18')]('-')===0x0){return[_0xca314===_0x1383('0x19')?sequelize[_0x1383('0x1a')](sequelize[_0x1383('0x1b')](_0x1383('0x19')),_0x1383('0x1c')):_0xca314['substr'](0x1),_0x1383('0x1d')];}else{return[_0xca314===_0x1383('0x19')?sequelize[_0x1383('0x1a')](sequelize[_0x1383('0x1b')](_0x1383('0x19')),_0x1383('0x1c')):_0xca314,_0x1383('0x1e')];}});}return _0x57a840;};exports['omit']=function(_0x5c4658,_0x1d24b7){if(_[_0x1383('0x7')](_0x5c4658)){return _0x5c4658;}if(_[_0x1383('0x14')](_0x5c4658)){for(var _0x3b158d=0x0;_0x3b158d<_0x5c4658[_0x1383('0x1f')];_0x3b158d+=0x1){_0x5c4658[_0x3b158d]=this['omit'](_0x5c4658[_0x3b158d],_0x1d24b7);}return _0x5c4658;}if(!_['isObject'](_0x5c4658)){return _0x5c4658;}if(_['isString'](_0x1d24b7)){_0x1d24b7=[_0x1d24b7];}if(!_[_0x1383('0x14')](_0x1d24b7)){return _0x5c4658;}for(var _0x128628=0x0;_0x128628<_0x1d24b7[_0x1383('0x1f')];_0x128628+=0x1){_[_0x1383('0x20')](_0x5c4658,_0x1d24b7[_0x128628]);}for(var _0x5866a1 in _0x5c4658){if(_0x5c4658[_0x1383('0x21')](_0x5866a1)){_0x5c4658[_0x5866a1]=this['omit'](_0x5c4658[_0x5866a1],_0x1d24b7);}}return _0x5c4658;};exports[_0x1383('0x22')]=function(_0xf0037f){return _0xf0037f[_0x1383('0x23')](RegExp(_0x1383('0x24')))?!![]:![];};exports[_0x1383('0x25')]=function(_0x15a3c4){return _0x15a3c4[_0x1383('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0x1383('0x26')]=function(_0x1e91e7){var _0x29ca05=[];_0x1e91e7[_0x1383('0x5')](/[ ,]+/)[_0x1383('0x27')](function(_0x370bea){_0x370bea=_0x370bea[_0x1383('0x28')](/([^:]")"+/g,'$1');_0x370bea='+'+_0x370bea+'*';var _0x4c5810=/[ `!@#$%^&*()_\-?~]/;if(_0x370bea[_0x1383('0x23')](_0x4c5810))_0x370bea='\x22'+_0x370bea+'\x22';_0x29ca05[_0x1383('0x29')](_0x370bea);});return _0x29ca05[_0x1383('0x2a')]('\x20');};exports[_0x1383('0x2b')]=function(_0x64c8ce,_0x307ad7,_0x52b5b8){var _0x4522f5={},_0x12111e={};if(_0x307ad7[_0x1383('0x2c')][_0x1383('0x2d')]){_0x307ad7[_0x1383('0x2c')]['id']=_0x307ad7[_0x1383('0x2c')]['$id'];delete _0x307ad7[_0x1383('0x2c')]['$id'];}_0x4522f5['model']=_[_0x1383('0x17')](_0x64c8ce,_0x1383('0x12'));_0x4522f5[_0x1383('0x2c')]=_['keys'](_0x307ad7['query']);_0x4522f5['filters']=_[_0x1383('0x2e')](_0x4522f5[_0x1383('0x2f')],_0x4522f5[_0x1383('0x2c')]);_0x12111e['attributes']=_['intersection'](_0x4522f5[_0x1383('0x2f')],this[_0x1383('0x4')](_0x307ad7[_0x1383('0x2c')][_0x1383('0x4')]));_0x12111e['attributes']=_0x12111e['attributes'][_0x1383('0x1f')]?_0x12111e[_0x1383('0x30')]:_0x4522f5[_0x1383('0x2f')];if(!_0x307ad7[_0x1383('0x2c')][_0x1383('0x21')](_0x1383('0x31'))){_0x12111e[_0x1383('0x15')]=this['limit'](_0x307ad7[_0x1383('0x2c')]['limit']);_0x12111e[_0x1383('0x32')]=this[_0x1383('0x32')](_0x307ad7[_0x1383('0x2c')]['offset']);}_0x12111e[_0x1383('0x33')]=this['sort'](_0x307ad7['query'][_0x1383('0x16')]);_0x12111e[_0x1383('0x34')]=this[_0x1383('0x6')](_['pick'](_0x307ad7[_0x1383('0x2c')],_0x4522f5[_0x1383('0x6')]),_0x64c8ce);if(_0x307ad7[_0x1383('0x2c')][_0x1383('0x35')]){var _0x56c269=_0x64c8ce;var _0x1ea73e=_0x307ad7['query']['filter'];if(typeof _0x1ea73e===_0x1383('0x36')){_0x56c269=_[_0x1383('0x35')](_0x64c8ce,function(_0x524eaf){return _['includes'](_0x1ea73e['columns'],_0x524eaf[_0x1383('0x12')]);});_0x1ea73e=_0x1ea73e[_0x1383('0x37')];}_0x12111e[_0x1383('0x34')]=_[_0x1383('0x38')](_0x12111e[_0x1383('0x34')],{'$or':_[_0x1383('0x17')](_0x56c269,function(_0x12d58d){if(_0x12d58d[_0x1383('0x9')]!==_0x1383('0x39')){if(_0x52b5b8){return sequelize['where'](sequelize['fn'](_0x1383('0x3a'),sequelize[_0x1383('0x1b')](_0x12d58d[_0x1383('0x12')])),{'$like':sequelize['fn']('lower','%'+_0x307ad7[_0x1383('0x2c')]['filter']+'%')});}else{var _0x2bc288={};_0x2bc288[_0x12d58d[_0x1383('0x12')]]={'$like':'%'+_0x307ad7[_0x1383('0x2c')][_0x1383('0x35')]+'%'};return _0x2bc288;}}})});}_0x12111e=_[_0x1383('0x38')]({},_0x12111e,_0x307ad7[_0x1383('0x3b')]);return _0x12111e;}; \ No newline at end of file +var _0x5fc3=['YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','col','unsigned','DESC','ASC','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','$id','query','model','keys','intersection','attributes','nolimit','offset','order','where','pick','filter','object','value','merge','lower','options','lodash','sequelize','parse','includes','fields','split','filters','isEmpty','find','type','$gte','format'];(function(_0x2dae17,_0x3c82d5){var _0x581d53=function(_0x4c2d6a){while(--_0x4c2d6a){_0x2dae17['push'](_0x2dae17['shift']());}};_0x581d53(++_0x3c82d5);}(_0x5fc3,0xa8));var _0x35fc=function(_0x54ea7a,_0x19df9b){_0x54ea7a=_0x54ea7a-0x0;var _0x65a10d=_0x5fc3[_0x54ea7a];return _0x65a10d;};'use strict';var _=require(_0x35fc('0x0'));var sequelize=require(_0x35fc('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x253d6e){var _0x2ac6da=['ne'];try{var _0x196bc2=JSON[_0x35fc('0x2')](_0x253d6e);var _0xb4f9ce=Object['keys'](_0x196bc2)[0x0];return _0x2ac6da[_0x35fc('0x3')](_0xb4f9ce);}catch(_0x1d5fec){return![];}}function getOperatorValue(_0x186a06){var _0x5b85ad=JSON['parse'](_0x186a06);var _0x19a0d1=Object['keys'](_0x5b85ad)[0x0];var _0x16e153=_0x5b85ad[_0x19a0d1];return{['$'+_0x19a0d1]:_0x16e153};}exports[_0x35fc('0x4')]=function(_0xc72d93){var _0x1e5f90=null;if(_0xc72d93){_0x1e5f90=_0xc72d93[_0x35fc('0x5')](',');}return _0x1e5f90;};exports[_0x35fc('0x6')]=function(_0x2051ab,_0x565f95){var _0x1083a9={};if(!_[_0x35fc('0x7')](_0x2051ab)){_['forOwn'](_0x2051ab,function(_0x471549,_0x33f491){try{if(_0x565f95){var _0x5021d4=_[_0x35fc('0x8')](_0x565f95,{'name':_0x33f491})||{};if(hasSequelizeOperator(_0x471549)){_0x1083a9[_0x33f491]=getOperatorValue(_0x471549);}else if(_0x5021d4[_0x35fc('0x9')]==='DATE'&&_['isPlainObject'](_0x471549)){var _0x409357=JSON['parse'](_0x471549);var _0x397738={'$gte':moment(moment(_0x409357[_0x35fc('0xa')])[_0x35fc('0xb')](_0x35fc('0xc')))[_0x35fc('0xd')]()['format'](),'$lte':moment(moment(_0x409357['$lte'])['format']('YYYY-MM-DD'))[_0x35fc('0xd')]()[_0x35fc('0xe')](0x1,'s')[_0x35fc('0xb')]()};_0x1083a9[_0x33f491]=_0x397738;}else if(_0x5021d4[_0x35fc('0xf')]===_0x35fc('0x10')){_0x1083a9[_0x33f491]=_0x471549;}else{_0x1083a9[_0x33f491]=_[_0x35fc('0x11')](_0x471549)?_0x471549:JSON['parse'](_0x471549);}}else{_0x1083a9[_0x33f491]=_[_0x35fc('0x11')](_0x471549)?_0x471549:JSON[_0x35fc('0x2')](_0x471549);}}catch(_0x553677){_0x1083a9[_0x33f491]=_0x471549[_0x35fc('0x5')](',');}});}return _0x1083a9;};exports[_0x35fc('0x12')]=function(_0x2e513b){_0x2e513b=parseInt(_0x2e513b,0xa);if(!_0x2e513b||_0x2e513b<0x0){_0x2e513b=LIMIT_VALUE;}return _0x2e513b;};exports['offset']=function(_0x1a86e9){_0x1a86e9=parseInt(_0x1a86e9,0xa);if(!_0x1a86e9||_0x1a86e9<0x0){_0x1a86e9=0x0;}return _0x1a86e9;};exports[_0x35fc('0x13')]=function(_0x465eb3){var _0x488234,_0x402cff=null;if(_0x465eb3){_0x488234=_0x465eb3[_0x35fc('0x5')](',');_0x402cff=_[_0x35fc('0x14')](_0x488234,function(_0x251a1f){if(_0x251a1f[_0x35fc('0x15')]('-')===0x0){return[_0x251a1f===_0x35fc('0x16')?sequelize[_0x35fc('0x17')](sequelize[_0x35fc('0x18')](_0x35fc('0x16')),_0x35fc('0x19')):_0x251a1f['substr'](0x1),_0x35fc('0x1a')];}else{return[_0x251a1f===_0x35fc('0x16')?sequelize[_0x35fc('0x17')](sequelize[_0x35fc('0x18')](_0x35fc('0x16')),'unsigned'):_0x251a1f,_0x35fc('0x1b')];}});}return _0x402cff;};exports[_0x35fc('0x1c')]=function(_0x561bf8,_0x265324){if(_[_0x35fc('0x7')](_0x561bf8)){return _0x561bf8;}if(_[_0x35fc('0x11')](_0x561bf8)){for(var _0x51cfec=0x0;_0x51cfec<_0x561bf8[_0x35fc('0x1d')];_0x51cfec+=0x1){_0x561bf8[_0x51cfec]=this['omit'](_0x561bf8[_0x51cfec],_0x265324);}return _0x561bf8;}if(!_[_0x35fc('0x1e')](_0x561bf8)){return _0x561bf8;}if(_[_0x35fc('0x1f')](_0x265324)){_0x265324=[_0x265324];}if(!_['isArray'](_0x265324)){return _0x561bf8;}for(var _0x519264=0x0;_0x519264<_0x265324[_0x35fc('0x1d')];_0x519264+=0x1){_['unset'](_0x561bf8,_0x265324[_0x519264]);}for(var _0x274208 in _0x561bf8){if(_0x561bf8[_0x35fc('0x20')](_0x274208)){_0x561bf8[_0x274208]=this['omit'](_0x561bf8[_0x274208],_0x265324);}}return _0x561bf8;};exports[_0x35fc('0x21')]=function(_0x645eac){return _0x645eac[_0x35fc('0x22')](RegExp(_0x35fc('0x23')))?!![]:![];};exports[_0x35fc('0x24')]=function(_0x134dfa){return _0x134dfa[_0x35fc('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x35fc('0x25')]=function(_0x54aedc){var _0x1cd1ae=[];_0x54aedc[_0x35fc('0x5')](/[ ,]+/)[_0x35fc('0x26')](function(_0x52acc5){_0x52acc5=_0x52acc5[_0x35fc('0x27')](/([^:]")"+/g,'$1');_0x52acc5='+'+_0x52acc5+'*';var _0x16f067=/[ `!@#$%^&*()_\-?~]/;if(_0x52acc5[_0x35fc('0x22')](_0x16f067))_0x52acc5='\x22'+_0x52acc5+'\x22';_0x1cd1ae[_0x35fc('0x28')](_0x52acc5);});return _0x1cd1ae[_0x35fc('0x29')]('\x20');};exports[_0x35fc('0x2a')]=function(_0x222ddb,_0x37b435,_0xf4dfab){var _0x127bfc={},_0x57072d={};if(_0x37b435['query'][_0x35fc('0x2b')]){_0x37b435['query']['id']=_0x37b435[_0x35fc('0x2c')][_0x35fc('0x2b')];delete _0x37b435[_0x35fc('0x2c')][_0x35fc('0x2b')];}_0x127bfc[_0x35fc('0x2d')]=_[_0x35fc('0x14')](_0x222ddb,'name');_0x127bfc[_0x35fc('0x2c')]=_[_0x35fc('0x2e')](_0x37b435[_0x35fc('0x2c')]);_0x127bfc[_0x35fc('0x6')]=_[_0x35fc('0x2f')](_0x127bfc[_0x35fc('0x2d')],_0x127bfc['query']);_0x57072d[_0x35fc('0x30')]=_[_0x35fc('0x2f')](_0x127bfc[_0x35fc('0x2d')],this['fields'](_0x37b435[_0x35fc('0x2c')]['fields']));_0x57072d[_0x35fc('0x30')]=_0x57072d[_0x35fc('0x30')][_0x35fc('0x1d')]?_0x57072d[_0x35fc('0x30')]:_0x127bfc['model'];if(!_0x37b435['query']['hasOwnProperty'](_0x35fc('0x31'))){_0x57072d['limit']=this[_0x35fc('0x12')](_0x37b435['query'][_0x35fc('0x12')]);_0x57072d[_0x35fc('0x32')]=this[_0x35fc('0x32')](_0x37b435[_0x35fc('0x2c')][_0x35fc('0x32')]);}_0x57072d[_0x35fc('0x33')]=this[_0x35fc('0x13')](_0x37b435['query'][_0x35fc('0x13')]);_0x57072d[_0x35fc('0x34')]=this['filters'](_[_0x35fc('0x35')](_0x37b435[_0x35fc('0x2c')],_0x127bfc[_0x35fc('0x6')]),_0x222ddb);if(_0x37b435[_0x35fc('0x2c')][_0x35fc('0x36')]){var _0x31d926=_0x222ddb;var _0x58f25c=_0x37b435[_0x35fc('0x2c')][_0x35fc('0x36')];if(typeof _0x58f25c===_0x35fc('0x37')){_0x31d926=_['filter'](_0x222ddb,function(_0x17821e){return _[_0x35fc('0x3')](_0x58f25c['columns'],_0x17821e[_0x35fc('0xf')]);});_0x58f25c=_0x58f25c[_0x35fc('0x38')];}_0x57072d[_0x35fc('0x34')]=_[_0x35fc('0x39')](_0x57072d[_0x35fc('0x34')],{'$or':_[_0x35fc('0x14')](_0x31d926,function(_0x211b70){if(_0x211b70[_0x35fc('0x9')]!=='VIRTUAL'){if(_0xf4dfab){return sequelize['where'](sequelize['fn'](_0x35fc('0x3a'),sequelize[_0x35fc('0x18')](_0x211b70['name'])),{'$like':sequelize['fn']('lower','%'+_0x37b435['query'][_0x35fc('0x36')]+'%')});}else{var _0x10f98b={};_0x10f98b[_0x211b70['name']]={'$like':'%'+_0x37b435[_0x35fc('0x2c')][_0x35fc('0x36')]+'%'};return _0x10f98b;}}})});}_0x57072d=_[_0x35fc('0x39')]({},_0x57072d,_0x37b435[_0x35fc('0x3b')]);return _0x57072d;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 76efc28..92a3a45 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x485abd,_0x32c7c1){var _0x3379f1=function(_0x36b528){while(--_0x36b528){_0x485abd['push'](_0x485abd['shift']());}};_0x3379f1(++_0x32c7c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0xd47a72,_0x42387c){var _0x24f993=function(_0x30e52f){while(--_0x30e52f){_0xd47a72['push'](_0xd47a72['shift']());}};_0x24f993(++_0x42387c);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 785f258..534b8b2 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 _0x2153=['createHash','md5','update','hex','getUuid','platform','licenseToken','win32','utf8','macAddress','ipAddress','digest','substring','lodash','crypto','execSync','../environment','orderBy','keys','length','family','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join'];(function(_0x4c8891,_0x51c147){var _0x2f7062=function(_0x5d9dca){while(--_0x5d9dca){_0x4c8891['push'](_0x4c8891['shift']());}};_0x2f7062(++_0x51c147);}(_0x2153,0x14d));var _0x3215=function(_0x5bcfa3,_0x5359eb){_0x5bcfa3=_0x5bcfa3-0x0;var _0x3534f5=_0x2153[_0x5bcfa3];return _0x3534f5;};'use strict';var _=require(_0x3215('0x0'));var os=require('os');var crypto=require(_0x3215('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0x3215('0x2')];var config=require(_0x3215('0x3'));function getInterfaces(){var _0x2243ed=[];var _0x35ceed=os['networkInterfaces']();var _0x516fb1=_[_0x3215('0x4')](_[_0x3215('0x5')](_0x35ceed));for(var _0x2baa67=0x0;_0x2baa67<_0x516fb1[_0x3215('0x6')];_0x2baa67++){var _0x42ef76=_0x35ceed[_0x516fb1[_0x2baa67]]['filter'](function(_0x48a916){return _0x48a916[_0x3215('0x7')]==='IPv4'&&_0x48a916['internal']===![];});_0x2243ed=_0x2243ed[_0x3215('0x8')](_0x42ef76);}return _0x2243ed;}function getFirstInterface(){var _0x936fa2=_[_0x3215('0x9')](getInterfaces());return{'macAddress':_0x936fa2&&_0x936fa2[_0x3215('0xa')]?_0x936fa2['mac']:_0x3215('0xb'),'ipAddress':_0x936fa2&&_0x936fa2[_0x3215('0xc')]?_0x936fa2[_0x3215('0xc')]:_0x3215('0xd')};}exports[_0x3215('0xe')]=getFirstInterface;function getCPUhash(){var _0xbd36c3=_['orderBy'](os[_0x3215('0xf')]()[_0x3215('0x10')](function(_0x4388d1){return _0x4388d1[_0x3215('0x11')];}))[_0x3215('0x12')](':');return crypto[_0x3215('0x13')](_0x3215('0x14'))[_0x3215('0x15')](_0xbd36c3)['digest'](_0x3215('0x16'));}exports[_0x3215('0x17')]=function(){var _0x1e54a0=os[_0x3215('0x18')]();var _0x4fd910=/[0-9a-f-]{36}/;if(config[_0x3215('0x19')]&&_0x4fd910['test'](config[_0x3215('0x19')])){return config['licenseToken'];}else if(_0x1e54a0===_0x3215('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x3215('0x1b')})['replace']('\x0d\x0a','');}else{var _0x5a49b7=getFirstInterface();var _0x18f360=getCPUhash();var _0x26c197=_0x18f360+'|'+os['hostname']()+'|'+_0x5a49b7[_0x3215('0x1c')]+'|'+_0x5a49b7[_0x3215('0x1d')];var _0x311745=crypto['createHash'](_0x3215('0x14'))['update'](_0x26c197)[_0x3215('0x1e')](_0x3215('0x16'));return _0x311745[_0x3215('0x1f')](0x0,0x8)+'-'+_0x311745['substring'](0x8,0xc)+'-'+_0x311745[_0x3215('0x1f')](0xc,0x10)+'-'+_0x311745[_0x3215('0x1f')](0x10,0x14)+'-'+_0x311745[_0x3215('0x1f')](0x14);}}; \ No newline at end of file +var _0x1657=['digest','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','orderBy','keys','length','filter','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','join','createHash','md5','update'];(function(_0x4c4fcc,_0x2ce71e){var _0x565347=function(_0x23e153){while(--_0x23e153){_0x4c4fcc['push'](_0x4c4fcc['shift']());}};_0x565347(++_0x2ce71e);}(_0x1657,0x16a));var _0x7165=function(_0x46d970,_0x595f76){_0x46d970=_0x46d970-0x0;var _0x42965a=_0x1657[_0x46d970];return _0x42965a;};'use strict';var _=require(_0x7165('0x0'));var os=require('os');var crypto=require(_0x7165('0x1'));var machine=require(_0x7165('0x2'));var exec=require(_0x7165('0x3'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x2733d2=[];var _0x37d9a9=os['networkInterfaces']();var _0x2f2c30=_[_0x7165('0x4')](_[_0x7165('0x5')](_0x37d9a9));for(var _0x490b7b=0x0;_0x490b7b<_0x2f2c30[_0x7165('0x6')];_0x490b7b++){var _0x396836=_0x37d9a9[_0x2f2c30[_0x490b7b]][_0x7165('0x7')](function(_0x306334){return _0x306334['family']===_0x7165('0x8')&&_0x306334['internal']===![];});_0x2733d2=_0x2733d2[_0x7165('0x9')](_0x396836);}return _0x2733d2;}function getFirstInterface(){var _0x3a40fa=_[_0x7165('0xa')](getInterfaces());return{'macAddress':_0x3a40fa&&_0x3a40fa[_0x7165('0xb')]?_0x3a40fa[_0x7165('0xb')]:_0x7165('0xc'),'ipAddress':_0x3a40fa&&_0x3a40fa[_0x7165('0xd')]?_0x3a40fa[_0x7165('0xd')]:_0x7165('0xe')};}exports[_0x7165('0xf')]=getFirstInterface;function getCPUhash(){var _0x2247d2=_['orderBy'](os['cpus']()[_0x7165('0x10')](function(_0x897845){return _0x897845[_0x7165('0x11')];}))[_0x7165('0x12')](':');return crypto[_0x7165('0x13')](_0x7165('0x14'))[_0x7165('0x15')](_0x2247d2)[_0x7165('0x16')]('hex');}exports[_0x7165('0x17')]=function(){var _0x3550bf=os['platform']();var _0x1ede80=/[0-9a-f-]{36}/;if(config[_0x7165('0x18')]&&_0x1ede80[_0x7165('0x19')](config[_0x7165('0x18')])){return config[_0x7165('0x18')];}else if(_0x3550bf===_0x7165('0x1a')){return exec(_0x7165('0x1b'),{'encoding':_0x7165('0x1c')})[_0x7165('0x1d')]('\x0d\x0a','');}else{var _0x110948=getFirstInterface();var _0x1367f3=getCPUhash();var _0x4e6dd2=_0x1367f3+'|'+os['hostname']()+'|'+_0x110948[_0x7165('0x1e')]+'|'+_0x110948['ipAddress'];var _0x176eca=crypto[_0x7165('0x13')]('md5')[_0x7165('0x15')](_0x4e6dd2)[_0x7165('0x16')]('hex');return _0x176eca['substring'](0x0,0x8)+'-'+_0x176eca[_0x7165('0x1f')](0x8,0xc)+'-'+_0x176eca[_0x7165('0x1f')](0xc,0x10)+'-'+_0x176eca[_0x7165('0x1f')](0x10,0x14)+'-'+_0x176eca[_0x7165('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 95ba24b..ae81d68 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 _0xa0ef=['pkginfo','version','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','get','data1','data2','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','catch','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','moment','bluebird'];(function(_0x23f3fe,_0x37a19c){var _0x1b1cb1=function(_0x1a96a7){while(--_0x1a96a7){_0x23f3fe['push'](_0x23f3fe['shift']());}};_0x1b1cb1(++_0x37a19c);}(_0xa0ef,0x166));var _0xfa0e=function(_0x158965,_0x117f97){_0x158965=_0x158965-0x0;var _0x3a3e9d=_0xa0ef[_0x158965];return _0x3a3e9d;};'use strict';var util=require('util');var moment=require(_0xfa0e('0x0'));var rp=require('request-promise');var BPromise=require(_0xfa0e('0x1'));var pkginfo=require(_0xfa0e('0x2'))(module,_0xfa0e('0x3'));var db=require('../../mysqldb')['db'];var encryptor=require(_0xfa0e('0x4'));var hardware=require(_0xfa0e('0x5'));var logger=require(_0xfa0e('0x6'))(_0xfa0e('0x7'));var HOST=_0xfa0e('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x53bc75){return new BPromise(function(_0x2ed88e,_0x18ae49){var _0x2c4047=util['format'](_0xfa0e('0x9'),HOST,_0x53bc75,module[_0xfa0e('0xa')]['version']);if(oldToken){_0x2c4047=util[_0xfa0e('0xb')](_0xfa0e('0xc'),HOST,_0x53bc75,module[_0xfa0e('0xa')][_0xfa0e('0x3')],oldToken);}var _0x26ce2d={'uri':_0x2c4047,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x26ce2d)[_0xfa0e('0xd')](function(_0x50f202){_0x2ed88e(_0x50f202);})['catch'](function(_0x34b92a){_0x18ae49(_0x34b92a);});});}function manageLicense(_0x4aa93a,_0x55fe5f){var _0x352dc1=_0x55fe5f[_0xfa0e('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x352dc1[_0xfa0e('0xf')]!==_0x4aa93a&&!_0x352dc1[_0xfa0e('0x10')]){oldToken=_0x352dc1[_0xfa0e('0xf')];}httpRequest(_0x4aa93a)[_0xfa0e('0xd')](function(_0x4bdc42){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4bdc42[_0xfa0e('0x11')]){isOldTokenSent=![];if(!_0x352dc1['license']&&_0x352dc1[_0xfa0e('0x7')]!=_0x4bdc42[_0xfa0e('0x7')]||_0x352dc1[_0xfa0e('0x7')]&&_0x352dc1[_0xfa0e('0x10')]){logger['info'](_0xfa0e('0x12'));}if(_0x352dc1[_0xfa0e('0x7')]&&!_0x352dc1[_0xfa0e('0x10')]&&_0x352dc1[_0xfa0e('0x7')]!=_0x4bdc42[_0xfa0e('0x7')]){logger[_0xfa0e('0x13')](_0xfa0e('0x14'));}if(_0x352dc1[_0xfa0e('0x7')]&&!_0x352dc1[_0xfa0e('0x10')]&&_0x352dc1[_0xfa0e('0x7')]==_0x4bdc42[_0xfa0e('0x7')]){return _0x55fe5f;}return _0x55fe5f[_0xfa0e('0x15')]({'data1':_0x4aa93a,'data2':null,'license':_0x4bdc42[_0xfa0e('0x7')]});}else{if(_0x4bdc42[_0xfa0e('0x7')]||_0x352dc1[_0xfa0e('0x7')]){if(!_0x352dc1[_0xfa0e('0x10')]){if(_0x352dc1['data1']==_0x4aa93a){GRAY_PERIOD_REASON='Disabled';logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xfa0e('0x16');logger[_0xfa0e('0x13')](_0xfa0e('0x17'),_0x352dc1['data1'],_0x4aa93a);}logger[_0xfa0e('0x13')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xfa0e('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x55fe5f[_0xfa0e('0x15')]({'data2':encryptor['encryptString'](moment()[_0xfa0e('0xb')](_0xfa0e('0x18')))});}else{if(moment()[_0xfa0e('0x19')](encryptor['decryptString'](_0x352dc1['data2']),_0xfa0e('0x1a'))>DAYS){logger[_0xfa0e('0x13')](_0xfa0e('0x1b'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x55fe5f[_0xfa0e('0x15')]({'data1':_0x4aa93a,'data2':null,'license':null});}}}else{if(_0x352dc1[_0xfa0e('0xf')]!=_0x4aa93a){logger['info'](_0xfa0e('0x17'),_0x352dc1[_0xfa0e('0xf')],_0x4aa93a);return _0x55fe5f[_0xfa0e('0x15')]({'data1':_0x4aa93a,'data2':null,'license':null});}}}return _0x55fe5f;})['then'](function(_0x4b83db){_0x55fe5f=_0x4b83db;})[_0xfa0e('0x1c')](function(_0x2473ba){logger['error'](_0x2473ba['message']);})[_0xfa0e('0x1d')](function(){setTimeout(function(){manageLicense(hardware[_0xfa0e('0x1e')](),_0x55fe5f);},TIME);});}function defaultLicense(){var _0x281137=hardware[_0xfa0e('0x1e')]();if(_0x281137){return db[_0xfa0e('0x1f')][_0xfa0e('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x281137}})['spread'](function(_0x31d2ca,_0x1a8eb8){logger['info'](_0xfa0e('0x21'),_0x281137);manageLicense(_0x281137,_0x31d2ca);})[_0xfa0e('0x1c')](function(_0xe53bcf){logger[_0xfa0e('0x22')](_0xe53bcf['message']);});}}exports[_0xfa0e('0x23')]=defaultLicense; \ No newline at end of file +var _0xa6a9=['exports','GET','then','catch','get','data2','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','error','message','getUuid','License','findOrCreate','spread','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s'];(function(_0x425cf7,_0x2ee065){var _0x4abda7=function(_0x100f96){while(--_0x100f96){_0x425cf7['push'](_0x425cf7['shift']());}};_0x4abda7(++_0x2ee065);}(_0xa6a9,0x196));var _0x9a6a=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0xa6a9[_0xb875ee];return _0x4c7f3a;};'use strict';var util=require(_0x9a6a('0x0'));var moment=require(_0x9a6a('0x1'));var rp=require(_0x9a6a('0x2'));var BPromise=require(_0x9a6a('0x3'));var pkginfo=require(_0x9a6a('0x4'))(module,_0x9a6a('0x5'));var db=require(_0x9a6a('0x6'))['db'];var encryptor=require(_0x9a6a('0x7'));var hardware=require(_0x9a6a('0x8'));var logger=require('../logger')(_0x9a6a('0x9'));var HOST=_0x9a6a('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3cf120){return new BPromise(function(_0x9c824c,_0x474c64){var _0x2bd732=util[_0x9a6a('0xb')](_0x9a6a('0xc'),HOST,_0x3cf120,module['exports']['version']);if(oldToken){_0x2bd732=util[_0x9a6a('0xb')](_0x9a6a('0xd'),HOST,_0x3cf120,module[_0x9a6a('0xe')][_0x9a6a('0x5')],oldToken);}var _0x17b451={'uri':_0x2bd732,'method':_0x9a6a('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x17b451)[_0x9a6a('0x10')](function(_0x28cfa1){_0x9c824c(_0x28cfa1);})[_0x9a6a('0x11')](function(_0x20760d){_0x474c64(_0x20760d);});});}function manageLicense(_0x51a842,_0x5b1d4e){var _0x4db276=_0x5b1d4e[_0x9a6a('0x12')]({'plain':!![]});if(!isOldTokenSent&&_0x4db276['data1']!==_0x51a842&&!_0x4db276[_0x9a6a('0x13')]){oldToken=_0x4db276[_0x9a6a('0x14')];}httpRequest(_0x51a842)[_0x9a6a('0x10')](function(_0x190a7a){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x190a7a[_0x9a6a('0x15')]){isOldTokenSent=![];if(!_0x4db276[_0x9a6a('0x9')]&&_0x4db276[_0x9a6a('0x9')]!=_0x190a7a[_0x9a6a('0x9')]||_0x4db276[_0x9a6a('0x9')]&&_0x4db276['data2']){logger[_0x9a6a('0x16')](_0x9a6a('0x17'));}if(_0x4db276[_0x9a6a('0x9')]&&!_0x4db276[_0x9a6a('0x13')]&&_0x4db276['license']!=_0x190a7a[_0x9a6a('0x9')]){logger[_0x9a6a('0x16')](_0x9a6a('0x18'));}if(_0x4db276['license']&&!_0x4db276[_0x9a6a('0x13')]&&_0x4db276[_0x9a6a('0x9')]==_0x190a7a[_0x9a6a('0x9')]){return _0x5b1d4e;}return _0x5b1d4e[_0x9a6a('0x19')]({'data1':_0x51a842,'data2':null,'license':_0x190a7a[_0x9a6a('0x9')]});}else{if(_0x190a7a[_0x9a6a('0x9')]||_0x4db276[_0x9a6a('0x9')]){if(!_0x4db276['data2']){if(_0x4db276[_0x9a6a('0x14')]==_0x51a842){GRAY_PERIOD_REASON=_0x9a6a('0x1a');logger['info'](_0x9a6a('0x1b'));}else{GRAY_PERIOD_REASON=_0x9a6a('0x1c');logger[_0x9a6a('0x16')](_0x9a6a('0x1d'),_0x4db276['data1'],_0x51a842);}logger[_0x9a6a('0x16')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x9a6a('0x1e')](),moment()['format'](_0x9a6a('0x1f')));return _0x5b1d4e[_0x9a6a('0x19')]({'data2':encryptor[_0x9a6a('0x20')](moment()[_0x9a6a('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x9a6a('0x21')](encryptor['decryptString'](_0x4db276[_0x9a6a('0x13')]),_0x9a6a('0x22'))>DAYS){logger[_0x9a6a('0x16')]('DEMO\x20START\x20AT\x20%s',moment()[_0x9a6a('0xb')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x5b1d4e['update']({'data1':_0x51a842,'data2':null,'license':null});}}}else{if(_0x4db276['data1']!=_0x51a842){logger[_0x9a6a('0x16')](_0x9a6a('0x1d'),_0x4db276[_0x9a6a('0x14')],_0x51a842);return _0x5b1d4e[_0x9a6a('0x19')]({'data1':_0x51a842,'data2':null,'license':null});}}}return _0x5b1d4e;})[_0x9a6a('0x10')](function(_0x553cd1){_0x5b1d4e=_0x553cd1;})['catch'](function(_0x87001c){logger[_0x9a6a('0x23')](_0x87001c[_0x9a6a('0x24')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x9a6a('0x25')](),_0x5b1d4e);},TIME);});}function defaultLicense(){var _0x1a35a7=hardware['getUuid']();if(_0x1a35a7){return db[_0x9a6a('0x26')][_0x9a6a('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x1a35a7}})[_0x9a6a('0x28')](function(_0x2ec03b,_0x4e599){logger[_0x9a6a('0x16')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x1a35a7);manageLicense(_0x1a35a7,_0x2ec03b);})['catch'](function(_0x1cb6a6){logger['error'](_0x1cb6a6[_0x9a6a('0x24')]);});}}exports[_0x9a6a('0x29')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 8a35039..f9f5f59 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 _0x0330=['uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','format','parse','demo','machineUuid','add','grayReason','disabled','message','User','findAll','role','COUNT','sequelize','col','count','admin','user','users','telephones','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x0330,0xad));var _0x0033=function(_0x43e492,_0x551f79){_0x43e492=_0x43e492-0x0;var _0x2b798a=_0x0330[_0x43e492];return _0x2b798a;};'use strict';var util=require(_0x0033('0x0'));var _=require(_0x0033('0x1'));var moment=require(_0x0033('0x2'));var BPromise=require(_0x0033('0x3'));var hardware=require(_0x0033('0x4'));var encryptor=require(_0x0033('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0033('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x0033('0x7'),'machineUuid':hardware[_0x0033('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0033('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x0033('0x9'),'machineUuid':hardware[_0x0033('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2681b2){return new BPromise(function(_0x43b877,_0x42485f){return db[_0x0033('0xa')][_0x0033('0xb')](_[_0x0033('0xc')](_0x2681b2,{'raw':!![],'where':{'id':0x1}}))[_0x0033('0xd')](function(_0x125d1e){return checkLicense(_0x125d1e,null);})[_0x0033('0xd')](function(_0x5d3fd4){_0x43b877(_0x5d3fd4);return;})[_0x0033('0xe')](function(_0x1539ed){_0x42485f(_0x1539ed);});});}function checkLicense(_0x4dc35c,_0x384aad){if(!_0x4dc35c){demoLicense[_0x0033('0xf')]=_0x4dc35c[_0x0033('0x10')];return demoLicense;}try{var _0x33b288=_0x384aad||_0x4dc35c[_0x0033('0x11')];if(_[_0x0033('0x12')](_0x33b288)){throw new Error(_0x0033('0x13'));}var _0x18cfe0=_0x4dc35c[_0x0033('0x10')];var _0xe991d8=_0x4dc35c[_0x0033('0x14')];var _0x393fb4=_0x18cfe0['split']('-')[0x4];var _0xe6fe2c=_0x18cfe0[_0x0033('0x15')]('-')[0x0];var _0x31ff57=encryptor['decryptString'](_0x33b288,util[_0x0033('0x16')]('%s:%s:%s',_0x393fb4,_0x18cfe0,_0xe6fe2c));var _0x59442d=JSON[_0x0033('0x17')](_0x31ff57);_0x59442d[_0x0033('0x18')]=![];_0x59442d[_0x0033('0xf')]=_0x18cfe0;_0x59442d[_0x0033('0x19')]=hardware[_0x0033('0x8')]();if(_0xe991d8){var _0x397a98=encryptor['decryptString'](_0xe991d8);_0x59442d['gray']=_0x397a98;_0x59442d['deadline']=moment(_0x397a98)[_0x0033('0x1a')](0x7,'days')[_0x0033('0x16')]();_0x59442d[_0x0033('0x1b')]=_0x59442d['uuid']!=_0x59442d[_0x0033('0x19')]?'changed':_0x0033('0x1c');}return _0x59442d;}catch(_0x276e5c){breakingLicense[_0x0033('0xf')]=_0x4dc35c[_0x0033('0x10')];breakingLicense['message']=_0x276e5c[_0x0033('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x25b2cb,_0x185cf6){getLicense()[_0x0033('0xd')](function(_0x3338d3){return db[_0x0033('0x1e')][_0x0033('0x1f')]({'attributes':[_0x0033('0x20'),[db['sequelize']['fn'](_0x0033('0x21'),db[_0x0033('0x22')][_0x0033('0x23')](_0x0033('0x20'))),_0x0033('0x24')]],'group':_0x0033('0x20'),'where':{'role':{'$or':[_0x0033('0x25'),_0x0033('0x26'),'telephone']}},'raw':!![]})[_0x0033('0xd')](function(_0x65608b){var _0xcb43aa={'user':_0x3338d3[_0x0033('0x27')]||0x0,'telephone':_0x3338d3[_0x0033('0x28')]||0x0};_0x65608b['forEach'](function(_0x493725){var _0x5bc453=_0x493725[_0x0033('0x20')]==='admin'?_0x0033('0x26'):_0x493725['role'];_0xcb43aa[_0x5bc453]-=_0x493725[_0x0033('0x24')];if(_0xcb43aa[_0x5bc453]<0x0)_0xcb43aa[_0x5bc453]=0x0;});_0x25b2cb(_0xcb43aa);return;});})[_0x0033('0xe')](function(_0x4b0c82){_0x185cf6(_0x4b0c82);});});}function checkUserLimits(_0x51e787){return new BPromise(function(_0x535910,_0x1470fd){getLimits()[_0x0033('0xd')](function(_0x82a9ab){var _0x4a1b0e=_[_0x0033('0x29')](_[_0x0033('0x2a')](_0x51e787,'role'),[_0x0033('0x25'),'user',_0x0033('0x2b')]);var _0xf158f2=(_0x4a1b0e[_0x0033('0x25')]||0x0)+(_0x4a1b0e['user']||0x0);var _0x20a07b=_0x4a1b0e[_0x0033('0x2b')]||0x0;if(_0xf158f2>_0x82a9ab[_0x0033('0x26')])return _0x1470fd(_0x0033('0x2c'));if(_0x20a07b>_0x82a9ab['telephone'])return _0x1470fd(_0x0033('0x2d'));return _0x535910();})[_0x0033('0xe')](function(_0x2702a5){_0x1470fd(_0x2702a5);});});}module[_0x0033('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xf6e3=['license','data2','decryptString','%s:%s:%s','parse','gray','add','days','format','grayReason','disabled','data1','User','findAll','role','sequelize','COUNT','col','count','user','telephone','telephones','forEach','pick','countBy','admin','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','catch','exports','util','lodash','moment','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','uuid'];(function(_0x2cd23a,_0x4ea6d6){var _0x34c6a0=function(_0x2e6ef7){while(--_0x2e6ef7){_0x2cd23a['push'](_0x2cd23a['shift']());}};_0x34c6a0(++_0x4ea6d6);}(_0xf6e3,0x1e0));var _0x3f6e=function(_0x5e32bf,_0x4570bd){_0x5e32bf=_0x5e32bf-0x0;var _0x1ab9c6=_0xf6e3[_0x5e32bf];return _0x1ab9c6;};'use strict';var util=require(_0x3f6e('0x0'));var _=require(_0x3f6e('0x1'));var moment=require(_0x3f6e('0x2'));var BPromise=require('bluebird');var hardware=require(_0x3f6e('0x3'));var encryptor=require(_0x3f6e('0x4'));var db=require(_0x3f6e('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x3f6e('0x6'),'machineUuid':hardware[_0x3f6e('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3f6e('0x8'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x3f6e('0x9'),'machineUuid':hardware[_0x3f6e('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x36874c){return new BPromise(function(_0xa89866,_0x60e475){return db[_0x3f6e('0xa')][_0x3f6e('0xb')](_[_0x3f6e('0xc')](_0x36874c,{'raw':!![],'where':{'id':0x1}}))[_0x3f6e('0xd')](function(_0x458baa){return checkLicense(_0x458baa,null);})[_0x3f6e('0xd')](function(_0x33885e){_0xa89866(_0x33885e);return;})['catch'](function(_0x48714f){_0x60e475(_0x48714f);});});}function checkLicense(_0x3d9027,_0x42ca8e){if(!_0x3d9027){demoLicense[_0x3f6e('0xe')]=_0x3d9027['data1'];return demoLicense;}try{var _0x587356=_0x42ca8e||_0x3d9027[_0x3f6e('0xf')];if(_['isEmpty'](_0x587356)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x2ca051=_0x3d9027['data1'];var _0x2d0f8b=_0x3d9027[_0x3f6e('0x10')];var _0x47cc06=_0x2ca051['split']('-')[0x4];var _0x7f2bf6=_0x2ca051['split']('-')[0x0];var _0x38ffa5=encryptor[_0x3f6e('0x11')](_0x587356,util['format'](_0x3f6e('0x12'),_0x47cc06,_0x2ca051,_0x7f2bf6));var _0x50fcb9=JSON[_0x3f6e('0x13')](_0x38ffa5);_0x50fcb9['demo']=![];_0x50fcb9[_0x3f6e('0xe')]=_0x2ca051;_0x50fcb9['machineUuid']=hardware[_0x3f6e('0x7')]();if(_0x2d0f8b){var _0x25dab0=encryptor[_0x3f6e('0x11')](_0x2d0f8b);_0x50fcb9[_0x3f6e('0x14')]=_0x25dab0;_0x50fcb9['deadline']=moment(_0x25dab0)[_0x3f6e('0x15')](0x7,_0x3f6e('0x16'))[_0x3f6e('0x17')]();_0x50fcb9[_0x3f6e('0x18')]=_0x50fcb9[_0x3f6e('0xe')]!=_0x50fcb9['machineUuid']?'changed':_0x3f6e('0x19');}return _0x50fcb9;}catch(_0x3ae892){breakingLicense['uuid']=_0x3d9027[_0x3f6e('0x1a')];breakingLicense['message']=_0x3ae892['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x8f4e3a,_0x4f2741){getLicense()[_0x3f6e('0xd')](function(_0x237b1d){return db[_0x3f6e('0x1b')][_0x3f6e('0x1c')]({'attributes':[_0x3f6e('0x1d'),[db[_0x3f6e('0x1e')]['fn'](_0x3f6e('0x1f'),db[_0x3f6e('0x1e')][_0x3f6e('0x20')]('role')),_0x3f6e('0x21')]],'group':'role','where':{'role':{'$or':['admin',_0x3f6e('0x22'),_0x3f6e('0x23')]}},'raw':!![]})['then'](function(_0x56c5f3){var _0x2d2823={'user':_0x237b1d['users']||0x0,'telephone':_0x237b1d[_0x3f6e('0x24')]||0x0};_0x56c5f3[_0x3f6e('0x25')](function(_0x32e9e6){var _0x242123=_0x32e9e6[_0x3f6e('0x1d')]==='admin'?_0x3f6e('0x22'):_0x32e9e6['role'];_0x2d2823[_0x242123]-=_0x32e9e6[_0x3f6e('0x21')];if(_0x2d2823[_0x242123]<0x0)_0x2d2823[_0x242123]=0x0;});_0x8f4e3a(_0x2d2823);return;});})['catch'](function(_0x3deaab){_0x4f2741(_0x3deaab);});});}function checkUserLimits(_0x3a6d41){return new BPromise(function(_0x81fdd7,_0x4c69e7){getLimits()['then'](function(_0x2c99a1){var _0xe84a41=_[_0x3f6e('0x26')](_[_0x3f6e('0x27')](_0x3a6d41,_0x3f6e('0x1d')),[_0x3f6e('0x28'),'user',_0x3f6e('0x23')]);var _0x2bb5d0=(_0xe84a41[_0x3f6e('0x28')]||0x0)+(_0xe84a41[_0x3f6e('0x22')]||0x0);var _0xad6d3f=_0xe84a41['telephone']||0x0;if(_0x2bb5d0>_0x2c99a1[_0x3f6e('0x22')])return _0x4c69e7(_0x3f6e('0x29'));if(_0xad6d3f>_0x2c99a1['telephone'])return _0x4c69e7(_0x3f6e('0x2a'));return _0x81fdd7();})[_0x3f6e('0x2b')](function(_0x28807c){_0x4c69e7(_0x28807c);});});}module[_0x3f6e('0x2c')]={'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 9918cd8..eba595a 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 _0x236c=['secret','exports','myappanuglar-secret','app-id'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x236c,0x155));var _0xc236=function(_0x26d345,_0x3468da){_0x26d345=_0x26d345-0x0;var _0x35d45d=_0x236c[_0x26d345];return _0x35d45d;};'use strict';module[_0xc236('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xc236('0x1'),'GOOGLE_ID':_0xc236('0x2'),'GOOGLE_SECRET':_0xc236('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x7334=['myappanuglar-secret','exports','http://localhost:9000'];(function(_0x53d41b,_0x1a3163){var _0x3c604f=function(_0xeac8be){while(--_0xeac8be){_0x53d41b['push'](_0x53d41b['shift']());}};_0x3c604f(++_0x1a3163);}(_0x7334,0x184));var _0x4733=function(_0x5f497a,_0x354128){_0x5f497a=_0x5f497a-0x0;var _0x53f8de=_0x7334[_0x5f497a];return _0x53f8de;};'use strict';module[_0x4733('0x0')]={'DOMAIN':_0x4733('0x1'),'SESSION_SECRET':_0x4733('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index f03ded0..09a49cb 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa67f=['fileLogger','exports','../utils/loggers'];(function(_0x4b0c74,_0x297d0a){var _0x2b72b3=function(_0x1f891e){while(--_0x1f891e){_0x4b0c74['push'](_0x4b0c74['shift']());}};_0x2b72b3(++_0x297d0a);}(_0xa67f,0x131));var _0xfa67=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xa67f[_0x8c43de];return _0xa6591b;};'use strict';var fileLogger=require(_0xfa67('0x0'))[_0xfa67('0x1')];module[_0xfa67('0x2')]=fileLogger; \ No newline at end of file +var _0xc663=['../utils/loggers','fileLogger','exports'];(function(_0x1b86cc,_0x3d8754){var _0x4e65d=function(_0x38e9b6){while(--_0x38e9b6){_0x1b86cc['push'](_0x1b86cc['shift']());}};_0x4e65d(++_0x3d8754);}(_0xc663,0xf6));var _0x3c66=function(_0x9d639c,_0x524dbe){_0x9d639c=_0x9d639c-0x0;var _0x1671de=_0xc663[_0x9d639c];return _0x1671de;};'use strict';var fileLogger=require(_0x3c66('0x0'))[_0x3c66('0x1')];module[_0x3c66('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index b0a5386..3af8934 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 _0x4299=['path','join','../../services/express/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','../../services/xdr/index.js'];(function(_0x24df19,_0x43bfc7){var _0x1670e7=function(_0x558326){while(--_0x558326){_0x24df19['push'](_0x24df19['shift']());}};_0x1670e7(++_0x43bfc7);}(_0x4299,0x1a7));var _0x9429=function(_0x527bca,_0xbabf7d){_0x527bca=_0x527bca-0x0;var _0x42e348=_0x4299[_0x527bca];return _0x42e348;};'use strict';var path=require(_0x9429('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x9429('0x1')](__dirname,_0x9429('0x2'))},{'name':'ami','script':path[_0x9429('0x1')](__dirname,'../../services/ami/index.js')},{'name':_0x9429('0x3'),'script':path[_0x9429('0x1')](__dirname,_0x9429('0x4'))},{'name':_0x9429('0x5'),'script':path[_0x9429('0x1')](__dirname,_0x9429('0x6'))},{'name':'routing','script':path[_0x9429('0x1')](__dirname,_0x9429('0x7'))},{'name':'xdr','script':path['join'](__dirname,_0x9429('0x8'))}]};module['exports']=config; \ No newline at end of file +var _0x6027=['../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','express','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','email'];(function(_0x471273,_0x216ce4){var _0x4a318c=function(_0x61d51b){while(--_0x61d51b){_0x471273['push'](_0x471273['shift']());}};_0x4a318c(++_0x216ce4);}(_0x6027,0xe9));var _0x7602=function(_0x295583,_0x4756aa){_0x295583=_0x295583-0x0;var _0x4c2ae6=_0x6027[_0x295583];return _0x4c2ae6;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x7602('0x0'),'script':path[_0x7602('0x1')](__dirname,_0x7602('0x2'))},{'name':_0x7602('0x3'),'script':path[_0x7602('0x1')](__dirname,_0x7602('0x4'))},{'name':'agi','script':path[_0x7602('0x1')](__dirname,_0x7602('0x5'))},{'name':_0x7602('0x6'),'script':path[_0x7602('0x1')](__dirname,_0x7602('0x7'))},{'name':_0x7602('0x8'),'script':path['join'](__dirname,_0x7602('0x9'))},{'name':'xdr','script':path['join'](__dirname,_0x7602('0xa'))}]};module[_0x7602('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index e26281e..ac4d6cc 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 _0xb4b3=['saved','pm2','connect','connected','start','then','disconnect','stop','list','describe','dump'];(function(_0x1bf51c,_0x2c8cf8){var _0x5c16db=function(_0x7932e5){while(--_0x7932e5){_0x1bf51c['push'](_0x1bf51c['shift']());}};_0x5c16db(++_0x2c8cf8);}(_0xb4b3,0x161));var _0x3b4b=function(_0x56f783,_0x3bb441){_0x56f783=_0x56f783-0x0;var _0x61a043=_0xb4b3[_0x56f783];return _0x61a043;};'use strict';var pm2=require(_0x3b4b('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x5c1906,_0x3fb7b1){return pm2[_0x3b4b('0x1')](function(_0x4101b4){if(_0x4101b4){return _0x3fb7b1(_0x4101b4);}return _0x5c1906(_0x3b4b('0x2'));});});};exports[_0x3b4b('0x3')]=function(_0x4f2d09){return connect()[_0x3b4b('0x4')](function(){return new BPromise(function(_0xb24159,_0x302e3c){return pm2[_0x3b4b('0x3')](_0x4f2d09,function(_0x47b730,_0x357a6c){if(_0x47b730){return _0x302e3c(_0x47b730);}pm2[_0x3b4b('0x5')]();return _0xb24159(_0x357a6c);});});});};exports[_0x3b4b('0x6')]=function(_0x3c2651){return connect()[_0x3b4b('0x4')](function(){return new BPromise(function(_0x2a5b56,_0x47f482){return pm2[_0x3b4b('0x6')](_0x3c2651,function(_0xf3125a,_0x44ff88){if(_0xf3125a){return _0x47f482(_0xf3125a);}pm2[_0x3b4b('0x5')]();return _0x2a5b56(_0x44ff88);});});});};exports['restart']=function(_0x28baf5){return connect()[_0x3b4b('0x4')](function(){return new BPromise(function(_0x4f2a31,_0x4e176d){return pm2['restart'](_0x28baf5,function(_0x37480b,_0x374687){if(_0x37480b){return _0x4e176d(_0x37480b);}pm2[_0x3b4b('0x5')]();return _0x4f2a31(_0x374687);});});});};exports[_0x3b4b('0x7')]=function(){return connect()[_0x3b4b('0x4')](function(){return new BPromise(function(_0x1421ca,_0x5a9bfe){return pm2['list'](function(_0xedf2cc,_0x190069){if(_0xedf2cc){return _0x5a9bfe(_0xedf2cc);}pm2[_0x3b4b('0x5')]();return _0x1421ca(_0x190069);});});});};exports[_0x3b4b('0x8')]=function(_0x54c6f7){return connect()[_0x3b4b('0x4')](function(){return new BPromise(function(_0x6eb9e8,_0x431f53){return pm2[_0x3b4b('0x8')](_0x54c6f7,function(_0x440676,_0x52529c){if(_0x440676){return _0x431f53(_0x440676);}pm2[_0x3b4b('0x5')]();return _0x6eb9e8(_0x52529c);});});});};exports['delete']=function(_0x479cfa){return connect()[_0x3b4b('0x4')](function(){return new BPromise(function(_0x27bc46,_0x3e7c5f){return pm2['delete'](_0x479cfa,function(_0x39be99,_0x29c53f){if(_0x39be99){return _0x3e7c5f(_0x39be99);}pm2[_0x3b4b('0x5')]();return _0x27bc46(_0x29c53f);});});});};exports[_0x3b4b('0x9')]=function(){return connect()[_0x3b4b('0x4')](function(){return new BPromise(function(_0x48d87f,_0x3e6598){return pm2[_0x3b4b('0x9')](function(_0x41ed1){if(_0x41ed1){return _0x3e6598(_0x41ed1);}return _0x48d87f(_0x3b4b('0xa'));});});});}; \ No newline at end of file +var _0xafae=['./config','connected','then','start','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird'];(function(_0x124721,_0x1923f5){var _0x4532d8=function(_0x2ca44f){while(--_0x2ca44f){_0x124721['push'](_0x124721['shift']());}};_0x4532d8(++_0x1923f5);}(_0xafae,0xfa));var _0xeafa=function(_0x3dec80,_0x3b9e93){_0x3dec80=_0x3dec80-0x0;var _0x7b391f=_0xafae[_0x3dec80];return _0x7b391f;};'use strict';var pm2=require(_0xeafa('0x0'));var BPromise=require(_0xeafa('0x1'));var config=require(_0xeafa('0x2'));function connect(){return new BPromise(function(_0x340897,_0x25f5c6){return pm2['connect'](function(_0x4ccb38){if(_0x4ccb38){return _0x25f5c6(_0x4ccb38);}return _0x340897(_0xeafa('0x3'));});});};exports['start']=function(_0x104a78){return connect()[_0xeafa('0x4')](function(){return new BPromise(function(_0x12ef6c,_0x1548f6){return pm2[_0xeafa('0x5')](_0x104a78,function(_0x206e49,_0x325407){if(_0x206e49){return _0x1548f6(_0x206e49);}pm2[_0xeafa('0x6')]();return _0x12ef6c(_0x325407);});});});};exports[_0xeafa('0x7')]=function(_0x2441a5){return connect()[_0xeafa('0x4')](function(){return new BPromise(function(_0x18cbab,_0x2abc6c){return pm2[_0xeafa('0x7')](_0x2441a5,function(_0x2a96c4,_0x1d3da){if(_0x2a96c4){return _0x2abc6c(_0x2a96c4);}pm2[_0xeafa('0x6')]();return _0x18cbab(_0x1d3da);});});});};exports['restart']=function(_0x52e0e2){return connect()[_0xeafa('0x4')](function(){return new BPromise(function(_0x234228,_0x2f21c4){return pm2[_0xeafa('0x8')](_0x52e0e2,function(_0x23df6f,_0x2348f3){if(_0x23df6f){return _0x2f21c4(_0x23df6f);}pm2[_0xeafa('0x6')]();return _0x234228(_0x2348f3);});});});};exports[_0xeafa('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x341fbf,_0x35856e){return pm2[_0xeafa('0x9')](function(_0x184bd2,_0xfcb6d1){if(_0x184bd2){return _0x35856e(_0x184bd2);}pm2[_0xeafa('0x6')]();return _0x341fbf(_0xfcb6d1);});});});};exports[_0xeafa('0xa')]=function(_0x23b36e){return connect()[_0xeafa('0x4')](function(){return new BPromise(function(_0x8c39c6,_0x197015){return pm2['describe'](_0x23b36e,function(_0x30ff7a,_0x1be8dd){if(_0x30ff7a){return _0x197015(_0x30ff7a);}pm2['disconnect']();return _0x8c39c6(_0x1be8dd);});});});};exports[_0xeafa('0xb')]=function(_0x19bc42){return connect()['then'](function(){return new BPromise(function(_0x323b1b,_0x757d7e){return pm2['delete'](_0x19bc42,function(_0x25000c,_0x1ef90e){if(_0x25000c){return _0x757d7e(_0x25000c);}pm2['disconnect']();return _0x323b1b(_0x1ef90e);});});});};exports['dump']=function(){return connect()[_0xeafa('0x4')](function(){return new BPromise(function(_0x302ead,_0x242fe2){return pm2[_0xeafa('0xc')](function(_0x292056){if(_0x292056){return _0x242fe2(_0x292056);}return _0x302ead(_0xeafa('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index acd622b..62eaf63 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 _0x19dd=['chatTimeout','ChatInteraction','findAll','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','../logger','schedule','defaults','localhost','redis','Setting','find','then'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x19dd,0x1c6));var _0xd19d=function(_0x5cb5e9,_0x5bb17c){_0x5cb5e9=_0x5cb5e9-0x0;var _0x57ad5d=_0x19dd[_0x5cb5e9];return _0x57ad5d;};'use strict';var _=require(_0xd19d('0x0'));var moment=require(_0xd19d('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0xd19d('0x2'))(_0xd19d('0x3'));config['redis']=_[_0xd19d('0x4')](config['redis'],{'host':_0xd19d('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd19d('0x6')]));function closeInteractions(){var _0x49b91f=0x0;var _0x579bec=[];return db[_0xd19d('0x7')][_0xd19d('0x8')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xd19d('0x9')](function(_0x1ed578){_0x49b91f=_0x1ed578[_0xd19d('0xa')];if(_0x49b91f){return db[_0xd19d('0xb')][_0xd19d('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x1ed578[_0xd19d('0xa')],_0xd19d('0xd'))}}});}else{return[];}})[_0xd19d('0x9')](function(_0x24c8cc){if(_0x24c8cc&&_0x24c8cc[_0xd19d('0xe')]){_0x579bec=_[_0xd19d('0xf')](_0x24c8cc||[],'id');logger[_0xd19d('0x10')](_0xd19d('0x11'),_0x579bec['join']());return db[_0xd19d('0xb')][_0xd19d('0x12')]({'closeReason':'system','disposition':_0xd19d('0x13'),'closed':!![],'closedAt':moment()[_0xd19d('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x579bec}});}})[_0xd19d('0x9')](function(){if(_0x579bec&&_0x579bec[_0xd19d('0xe')]){logger['info'](_0xd19d('0x15'),_0x579bec[_0xd19d('0x16')]());for(var _0x1edb21=0x0;_0x1edb21<_0x579bec['length'];_0x1edb21++){io[_0xd19d('0x17')](_0xd19d('0x18'),{'id':_0x579bec[_0x1edb21],'closed':!![]});}}})[_0xd19d('0x19')](function(_0x2cf32d){logger['error'](_0xd19d('0x1a'),_0x2cf32d?util[_0xd19d('0x1b')](_0x2cf32d,{'showHidden':![],'depth':null}):'');});}exports[_0xd19d('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xf436=['util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','length','map','info','join','update','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment'];(function(_0x437b02,_0x34b630){var _0xf8c681=function(_0x28f83e){while(--_0x28f83e){_0x437b02['push'](_0x437b02['shift']());}};_0xf8c681(++_0x34b630);}(_0xf436,0x13d));var _0x6f43=function(_0x19809d,_0x54a5f0){_0x19809d=_0x19809d-0x0;var _0x5c601e=_0xf436[_0x19809d];return _0x5c601e;};'use strict';var _=require(_0x6f43('0x0'));var moment=require(_0x6f43('0x1'));var Redis=require('ioredis');var util=require(_0x6f43('0x2'));var config=require(_0x6f43('0x3'));var db=require(_0x6f43('0x4'))['db'];var logger=require(_0x6f43('0x5'))(_0x6f43('0x6'));config[_0x6f43('0x7')]=_['defaults'](config[_0x6f43('0x7')],{'host':_0x6f43('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6f43('0x7')]));function closeInteractions(){var _0x1a1b53=0x0;var _0x44b007=[];return db['Setting'][_0x6f43('0x9')]({'raw':!![],'attributes':['id',_0x6f43('0xa')],'where':{'id':0x1}})[_0x6f43('0xb')](function(_0x145644){_0x1a1b53=_0x145644['chatTimeout'];if(_0x1a1b53){return db[_0x6f43('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x6f43('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x6f43('0xe')](_0x145644['chatTimeout'],_0x6f43('0xf'))}}});}else{return[];}})[_0x6f43('0xb')](function(_0x5a71e4){if(_0x5a71e4&&_0x5a71e4[_0x6f43('0x10')]){_0x44b007=_[_0x6f43('0x11')](_0x5a71e4||[],'id');logger[_0x6f43('0x12')]('[CHAT]\x20Interactions\x20to\x20close:',_0x44b007[_0x6f43('0x13')]());return db[_0x6f43('0xc')][_0x6f43('0x14')]({'closeReason':'system','disposition':_0x6f43('0x15'),'closed':!![],'closedAt':moment()[_0x6f43('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x44b007}});}})[_0x6f43('0xb')](function(){if(_0x44b007&&_0x44b007[_0x6f43('0x10')]){logger[_0x6f43('0x12')](_0x6f43('0x17'),_0x44b007[_0x6f43('0x13')]());for(var _0x4250cf=0x0;_0x4250cf<_0x44b007[_0x6f43('0x10')];_0x4250cf++){io[_0x6f43('0x18')]('chatInteraction:update',{'id':_0x44b007[_0x4250cf],'closed':!![]});}}})[_0x6f43('0x19')](function(_0x392540){logger[_0x6f43('0x1a')](_0x6f43('0x1b'),_0x392540?util['inspect'](_0x392540,{'showHidden':![],'depth':null}):'');});}exports[_0x6f43('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 41788fe..a1e9616 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x504f=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x341fd6,_0x9d0e71){var _0x3755d3=function(_0x3b7fd3){while(--_0x3b7fd3){_0x341fd6['push'](_0x341fd6['shift']());}};_0x3755d3(++_0x9d0e71);}(_0x504f,0x18e));var _0xf504=function(_0x26bc3f,_0x3af26a){_0x26bc3f=_0x26bc3f-0x0;var _0x5b71eb=_0x504f[_0x26bc3f];return _0x5b71eb;};'use strict';function start(){var _0x6e47ec=require(_0xf504('0x0'));return _0x6e47ec['startAllRefreshIntervals']();}module[_0xf504('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xcb1b=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x2016a5,_0x418658){var _0x41e31f=function(_0x2b1cec){while(--_0x2b1cec){_0x2016a5['push'](_0x2016a5['shift']());}};_0x41e31f(++_0x418658);}(_0xcb1b,0x1b8));var _0xbcb1=function(_0x47147e,_0x40a905){_0x47147e=_0x47147e-0x0;var _0x19673f=_0xcb1b[_0x47147e];return _0x19673f;};'use strict';function start(){var _0x3afba7=require(_0xbcb1('0x0'));return _0x3afba7[_0xbcb1('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 526935b..c36956a 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 _0x9099=['sendIfEmpty','SendMail','then','error\x20mail','email\x20sent','error','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','MailServerOut','CloudProvider','keys','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','run\x20job','cron','isBetween','startAt','endAt','start','stop\x20cron','update','update\x20cron','run','util','path','lodash','cron-job-manager','jayson/promise','bluebird','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','format','MailAccount','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync'];(function(_0x324391,_0x546d4b){var _0x40484b=function(_0x3993dd){while(--_0x3993dd){_0x324391['push'](_0x324391['shift']());}};_0x40484b(++_0x546d4b);}(_0x9099,0x17a));var _0x9909=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x9099[_0x3054be];return _0x3df150;};'use strict';var fs=require('fs');var util=require(_0x9909('0x0'));var path=require(_0x9909('0x1'));var _=require(_0x9909('0x2'));var moment=require('moment');var CronJobManager=require(_0x9909('0x3'));var jayson=require(_0x9909('0x4'));var BPromise=require(_0x9909('0x5'));var logger=require('../logger')(_0x9909('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x9909('0x7'));var analyticDefaultReportController=require(_0x9909('0x8'));var client=jayson[_0x9909('0x9')][_0x9909('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4e32eb,_0x2a69dc){return function(){logger[_0x9909('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x4e32eb[_0x9909('0xc')]);var _0x19a207=!![];var _0x401f36=_0x4e32eb['MailAccount']['getSmtpOptions']();var _0x1abd01={'account':_0x401f36,'message':{'from':util[_0x9909('0xd')]('\x22%s\x22\x20<%s>',_0x4e32eb[_0x9909('0xe')][_0x9909('0xf')],_0x4e32eb[_0x9909('0xe')][_0x9909('0xc')]||_0x4e32eb['MailAccount'][_0x9909('0x10')][_0x9909('0x11')]),'to':_0x4e32eb['email'],'cc':_0x4e32eb['cc'],'bcc':_0x4e32eb[_0x9909('0x12')],'subject':util[_0x9909('0xd')](_0x9909('0x13'),_0x2a69dc[_0x9909('0xf')],_0x4e32eb[_0x9909('0x14')],_0x4e32eb[_0x9909('0x15')])}};var _0x2156ad=path[_0x9909('0x16')](__dirname,_0x9909('0x17'));var _0x2e863c=_0x2a69dc[_0x9909('0x18')];var _0x377c85=util[_0x9909('0xd')](_0x9909('0x19'),path[_0x9909('0x1a')](_0x2a69dc[_0x9909('0x18')],path[_0x9909('0x1b')](_0x2a69dc[_0x9909('0x18')])),_0x9909('0x1c'));var _0x49481b=path[_0x9909('0x16')](_0x2156ad,_0x2e863c);var _0x1a35a9=path[_0x9909('0x16')](_0x2156ad,_0x377c85);if(fs['existsSync'](_0x49481b)){_0x2a69dc[_0x9909('0x1d')]=_0x9909('0x1e');_0x1abd01['message'][_0x9909('0x1f')]=[{'filename':_0x2e863c,'path':_0x49481b}];_0x1abd01[_0x9909('0x20')][_0x9909('0x21')]=util['format'](_0x9909('0x22'),JSON[_0x9909('0x23')](_0x2a69dc,null,0x2));}else if(fs[_0x9909('0x24')](_0x1a35a9)){_0x2a69dc[_0x9909('0x1d')]=_0x9909('0x1e');_0x1abd01[_0x9909('0x20')]['attachments']=[{'filename':_0x377c85,'path':_0x1a35a9}];}else{_0x1abd01[_0x9909('0x20')][_0x9909('0x21')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x4e32eb[_0x9909('0x25')]){_0x19a207=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x19a207){return client['request'](_0x9909('0x26'),_0x1abd01)[_0x9909('0x27')](function(_0x4b148e){if(_0x4b148e['error']){return logger['error'](_0x9909('0x28'),JSON[_0x9909('0x23')](_0x4b148e));}return logger[_0x9909('0xb')](_0x9909('0x29'));})['catch'](function(_0x2018e9){return logger[_0x9909('0x2a')](_0x9909('0x28'),JSON[_0x9909('0x23')](_0x2018e9));});}};}function handleError(){return function(_0x41ea37){return logger[_0x9909('0x2a')](JSON[_0x9909('0x23')](_0x41ea37));};}function handleResult(_0x18bdf8){return function(_0x55532e){logger[_0x9909('0xb')](_0x9909('0x2b'),JSON[_0x9909('0x23')](_0x55532e));if(_0x18bdf8['MailAccount']&&_0x18bdf8[_0x9909('0xe')][_0x9909('0x10')]&&!_[_0x9909('0x2c')](_0x18bdf8[_0x9909('0xc')])){setTimeout(handleSendEmail(_0x18bdf8,_0x55532e),0x3c*0x3e8);}};}function handleJob(_0x3801f5){return function(){try{if(_[_0x9909('0x2c')](_0x3801f5[_0x9909('0x14')])){return logger[_0x9909('0xb')](_0x9909('0x2d'));}if(_[_0x9909('0x2c')](_0x3801f5[_0x9909('0x15')])){return logger[_0x9909('0xb')](_0x9909('0x2e'));}var _0x33e498={'startDate':moment()[_0x9909('0x2f')](_0x3801f5[_0x9909('0x14')],_0x3801f5[_0x9909('0x15')])[_0x9909('0xd')](_0x9909('0x30')),'endDate':moment()['format'](_0x9909('0x30')),'type':_0x9909('0x31'),'output':_0x3801f5[_0x9909('0x32')],'name':_0x3801f5['name']};if(!_[_0x9909('0x2c')](_0x3801f5[_0x9909('0x33')])){logger[_0x9909('0xb')](_0x9909('0x34'),_0x3801f5[_0x9909('0x33')]);return analyticDefaultReportController[_0x9909('0x35')]({'id':_0x3801f5['DefaultReportId']},_0x33e498)[_0x9909('0x27')](handleResult(_0x3801f5))[_0x9909('0x36')](handleError());}if(!_[_0x9909('0x2c')](_0x3801f5[_0x9909('0x37')])){logger[_0x9909('0xb')](_0x9909('0x38'),_0x3801f5[_0x9909('0x37')]);return analyticCustomReportController[_0x9909('0x35')]({'id':_0x3801f5[_0x9909('0x37')]},_0x33e498)[_0x9909('0x27')](handleResult(_0x3801f5))[_0x9909('0x36')](handleError());}}catch(_0x184ac9){logger[_0x9909('0x2a')](JSON[_0x9909('0x23')](_0x184ac9));}return logger['info']('no\x20report\x20id');};}function getJobs(_0xf86617){var _0x186251={};if(_0xf86617){_0x186251['id']=_0xf86617;}return db['Schedule']['findAll']({'where':_0x186251,'include':[{'model':db['MailAccount'],'attributes':['id',_0x9909('0xf'),_0x9909('0xc')],'include':[{'model':db[_0x9909('0x39')],'as':_0x9909('0x10'),'include':[{'model':db[_0x9909('0x3a')],'as':_0x9909('0x3a')}]}]}]})[_0x9909('0x27')](function(_0x5107e6){var _0x49adad=_[_0x9909('0x3b')](manager['jobs']);var _0x700087=_[_0x9909('0x3c')](_0x5107e6,function(_0x167366){return _0x167366['id'][_0x9909('0x3d')]();});var _0x5a3723=_[_0x9909('0x3e')](_0x5107e6,function(_0x16228f){return _0x16228f['id'][_0x9909('0x3d')]();});var _0x2e7144=_0xf86617?_0x700087:_[_0x9909('0x3f')](_0x700087,_0x49adad);var _0xa51037=_[_0x9909('0x40')](_0x700087,_0x49adad);var _0x46f7fc=_[_0x9909('0x3f')](_0x49adad,_0x700087);var _0x4ee839;var _0x1f3799;for(_0x4ee839=0x0;_0x4ee839<_0x46f7fc[_0x9909('0x41')]&&!_0xf86617;_0x4ee839+=0x1){_0x1f3799=_0x46f7fc[_0x4ee839][_0x9909('0x3d')]();if(manager[_0x9909('0x42')](_0x1f3799)){manager[_0x9909('0x43')](_0x1f3799);manager[_0x9909('0x44')](_0x1f3799);logger[_0x9909('0xb')](_0x9909('0x45'),_0x1f3799);}}logger[_0x9909('0xb')](_0x9909('0x46'),JSON['stringify'](_0x2e7144));for(_0x4ee839=0x0;_0x4ee839<_0x2e7144['length'];_0x4ee839+=0x1){_0x1f3799=_0x2e7144[_0x4ee839]['toString']();logger['info'](_0x9909('0x47'),_0x1f3799);if(_0xf86617){logger[_0x9909('0xb')](_0x9909('0x48'),_0xf86617);logger['info'](JSON[_0x9909('0x23')](_0x5a3723[_0x1f3799]));BPromise['resolve']()[_0x9909('0x27')](handleJob(_0x5a3723[_0x1f3799]));logger[_0x9909('0xb')](_0x9909('0x49'),_0x5a3723[_0x1f3799][_0x9909('0xf')],_0x5a3723[_0x1f3799][_0x9909('0x4a')]);}else if(_0x5a3723[_0x1f3799]['cron']&&_0x5a3723[_0x1f3799]['active']&&moment()[_0x9909('0x4b')](_0x5a3723[_0x1f3799][_0x9909('0x4c')],_0x5a3723[_0x1f3799][_0x9909('0x4d')])){manager['add'](_0x1f3799,_0x5a3723[_0x1f3799][_0x9909('0x4a')],handleJob(_0x5a3723[_0x1f3799]));manager[_0x9909('0x4e')](_0x1f3799);logger[_0x9909('0xb')]('add\x20cron',_0x5a3723[_0x1f3799][_0x9909('0xf')],_0x5a3723[_0x1f3799]['cron']);}else if(manager[_0x9909('0x42')](_0x1f3799)){manager['stop'](_0x1f3799);manager[_0x9909('0x44')](_0x1f3799);logger[_0x9909('0xb')](_0x9909('0x4f'),_0x5a3723[_0x1f3799][_0x9909('0xf')],_0x5a3723[_0x1f3799][_0x9909('0x4a')]);}}for(_0x4ee839=0x0,_0x1f3799;_0x4ee839<_0xa51037[_0x9909('0x41')]&&!_0xf86617;_0x4ee839+=0x1){_0x1f3799=_0xa51037[_0x4ee839]['toString']();if(manager['exists'](_0x1f3799)){if(_0x5a3723[_0x1f3799][_0x9909('0x4a')]&&_0x5a3723[_0x1f3799]['active']&&moment()[_0x9909('0x4b')](_0x5a3723[_0x1f3799][_0x9909('0x4c')],_0x5a3723[_0x1f3799]['endAt'])){manager[_0x9909('0x50')](_0x1f3799,_0x5a3723[_0x1f3799][_0x9909('0x4a')],handleJob(_0x5a3723[_0x1f3799]));logger['info'](_0x9909('0x51'),_0x5a3723[_0x1f3799][_0x9909('0xf')],_0x5a3723[_0x1f3799][_0x9909('0x4a')]);}else{manager['stop'](_0x1f3799);manager['deleteJob'](_0x1f3799);logger[_0x9909('0xb')]('stop\x20cron',_0x5a3723[_0x1f3799][_0x9909('0xf')],_0x5a3723[_0x1f3799][_0x9909('0x4a')]);}}}})[_0x9909('0x36')](function(_0x43ec5a){logger[_0x9909('0x2a')](JSON['stringify'](_0x43ec5a));});}exports[_0x9909('0x52')]=function(_0x2c9772){return getJobs(_0x2c9772);};exports[_0x9909('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xecbd=['bcc','name','subtractNumber','subtractUnit','join','%s.%s','basename','savename','extname','zip','existsSync','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','then','error','catch','error\x20mail','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','exists','stop','deleteJob','delete\x20cron','length','my\x20id','resolve','cron','active','isBetween','startAt','endAt','start','add\x20cron','stop\x20cron','update','path','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','client','info','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','email','Smtp','user'];(function(_0x144049,_0x4e6ccf){var _0x517caa=function(_0x7416b8){while(--_0x7416b8){_0x144049['push'](_0x144049['shift']());}};_0x517caa(++_0x4e6ccf);}(_0xecbd,0xd7));var _0xdecb=function(_0x3c0864,_0x48969e){_0x3c0864=_0x3c0864-0x0;var _0x4c7348=_0xecbd[_0x3c0864];return _0x4c7348;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xdecb('0x0'));var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0xdecb('0x1'));var jayson=require(_0xdecb('0x2'));var BPromise=require(_0xdecb('0x3'));var logger=require(_0xdecb('0x4'))(_0xdecb('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xdecb('0x6'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xdecb('0x7')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x26272f,_0x398e6d){return function(){logger[_0xdecb('0x8')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x26272f['email']);var _0x2f8db4=!![];var _0x1790ee=_0x26272f[_0xdecb('0x9')][_0xdecb('0xa')]();var _0x3c1172={'account':_0x1790ee,'message':{'from':util[_0xdecb('0xb')](_0xdecb('0xc'),_0x26272f[_0xdecb('0x9')]['name'],_0x26272f[_0xdecb('0x9')][_0xdecb('0xd')]||_0x26272f['MailAccount'][_0xdecb('0xe')][_0xdecb('0xf')]),'to':_0x26272f[_0xdecb('0xd')],'cc':_0x26272f['cc'],'bcc':_0x26272f[_0xdecb('0x10')],'subject':util[_0xdecb('0xb')]('Report\x20%s\x20last\x20%s\x20%s',_0x398e6d[_0xdecb('0x11')],_0x26272f[_0xdecb('0x12')],_0x26272f[_0xdecb('0x13')])}};var _0x17fe2c=path[_0xdecb('0x14')](__dirname,'../../files/reports');var _0xa116d0=_0x398e6d['savename'];var _0x2d1b0f=util['format'](_0xdecb('0x15'),path[_0xdecb('0x16')](_0x398e6d[_0xdecb('0x17')],path[_0xdecb('0x18')](_0x398e6d[_0xdecb('0x17')])),_0xdecb('0x19'));var _0x337742=path[_0xdecb('0x14')](_0x17fe2c,_0xa116d0);var _0x351820=path['join'](_0x17fe2c,_0x2d1b0f);if(fs[_0xdecb('0x1a')](_0x337742)){_0x398e6d['status']=_0xdecb('0x1b');_0x3c1172[_0xdecb('0x1c')][_0xdecb('0x1d')]=[{'filename':_0xa116d0,'path':_0x337742}];_0x3c1172[_0xdecb('0x1c')][_0xdecb('0x1e')]=util[_0xdecb('0xb')](_0xdecb('0x1f'),JSON[_0xdecb('0x20')](_0x398e6d,null,0x2));}else if(fs[_0xdecb('0x1a')](_0x351820)){_0x398e6d['status']='Sent';_0x3c1172['message'][_0xdecb('0x1d')]=[{'filename':_0x2d1b0f,'path':_0x351820}];}else{_0x3c1172[_0xdecb('0x1c')][_0xdecb('0x1e')]=_0xdecb('0x21');if(!_0x26272f[_0xdecb('0x22')]){_0x2f8db4=![];logger[_0xdecb('0x8')](_0xdecb('0x23'));}}if(_0x2f8db4){return client['request']('SendMail',_0x3c1172)[_0xdecb('0x24')](function(_0x14ff2c){if(_0x14ff2c[_0xdecb('0x25')]){return logger[_0xdecb('0x25')]('error\x20mail',JSON[_0xdecb('0x20')](_0x14ff2c));}return logger[_0xdecb('0x8')]('email\x20sent');})[_0xdecb('0x26')](function(_0x447e78){return logger[_0xdecb('0x25')](_0xdecb('0x27'),JSON[_0xdecb('0x20')](_0x447e78));});}};}function handleError(){return function(_0x223151){return logger[_0xdecb('0x25')](JSON[_0xdecb('0x20')](_0x223151));};}function handleResult(_0x680166){return function(_0x3bc4bf){logger['info'](_0xdecb('0x28'),JSON[_0xdecb('0x20')](_0x3bc4bf));if(_0x680166[_0xdecb('0x9')]&&_0x680166[_0xdecb('0x9')][_0xdecb('0xe')]&&!_[_0xdecb('0x29')](_0x680166[_0xdecb('0xd')])){setTimeout(handleSendEmail(_0x680166,_0x3bc4bf),0x3c*0x3e8);}};}function handleJob(_0x5e505e){return function(){try{if(_[_0xdecb('0x29')](_0x5e505e['subtractNumber'])){return logger[_0xdecb('0x8')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x5e505e['subtractUnit'])){return logger[_0xdecb('0x8')](_0xdecb('0x2a'));}var _0x26dd37={'startDate':moment()[_0xdecb('0x2b')](_0x5e505e['subtractNumber'],_0x5e505e[_0xdecb('0x13')])[_0xdecb('0xb')](_0xdecb('0x2c')),'endDate':moment()[_0xdecb('0xb')](_0xdecb('0x2c')),'type':'scheduled','output':_0x5e505e[_0xdecb('0x2d')],'name':_0x5e505e[_0xdecb('0x11')]};if(!_['isNil'](_0x5e505e[_0xdecb('0x2e')])){logger[_0xdecb('0x8')]('exec\x20defaul\x20report\x20id:%s',_0x5e505e[_0xdecb('0x2e')]);return analyticDefaultReportController[_0xdecb('0x2f')]({'id':_0x5e505e[_0xdecb('0x2e')]},_0x26dd37)['then'](handleResult(_0x5e505e))[_0xdecb('0x26')](handleError());}if(!_['isNil'](_0x5e505e[_0xdecb('0x30')])){logger[_0xdecb('0x8')](_0xdecb('0x31'),_0x5e505e[_0xdecb('0x30')]);return analyticCustomReportController[_0xdecb('0x2f')]({'id':_0x5e505e['CustomReportId']},_0x26dd37)[_0xdecb('0x24')](handleResult(_0x5e505e))[_0xdecb('0x26')](handleError());}}catch(_0x598a53){logger[_0xdecb('0x25')](JSON['stringify'](_0x598a53));}return logger[_0xdecb('0x8')](_0xdecb('0x32'));};}function getJobs(_0x78ed9a){var _0x177ce0={};if(_0x78ed9a){_0x177ce0['id']=_0x78ed9a;}return db[_0xdecb('0x33')][_0xdecb('0x34')]({'where':_0x177ce0,'include':[{'model':db[_0xdecb('0x9')],'attributes':['id',_0xdecb('0x11'),'email'],'include':[{'model':db[_0xdecb('0x35')],'as':_0xdecb('0xe'),'include':[{'model':db[_0xdecb('0x36')],'as':_0xdecb('0x36')}]}]}]})[_0xdecb('0x24')](function(_0x152e96){var _0x1cb8d6=_[_0xdecb('0x37')](manager[_0xdecb('0x38')]);var _0x56bb68=_[_0xdecb('0x39')](_0x152e96,function(_0x18524e){return _0x18524e['id'][_0xdecb('0x3a')]();});var _0x498605=_[_0xdecb('0x3b')](_0x152e96,function(_0x3b2faf){return _0x3b2faf['id'][_0xdecb('0x3a')]();});var _0x523f62=_0x78ed9a?_0x56bb68:_['difference'](_0x56bb68,_0x1cb8d6);var _0x57e59e=_['intersection'](_0x56bb68,_0x1cb8d6);var _0x34c02a=_[_0xdecb('0x3c')](_0x1cb8d6,_0x56bb68);var _0x2b72ae;var _0x1574ca;for(_0x2b72ae=0x0;_0x2b72ae<_0x34c02a['length']&&!_0x78ed9a;_0x2b72ae+=0x1){_0x1574ca=_0x34c02a[_0x2b72ae][_0xdecb('0x3a')]();if(manager[_0xdecb('0x3d')](_0x1574ca)){manager[_0xdecb('0x3e')](_0x1574ca);manager[_0xdecb('0x3f')](_0x1574ca);logger[_0xdecb('0x8')](_0xdecb('0x40'),_0x1574ca);}}logger[_0xdecb('0x8')]('toRun',JSON[_0xdecb('0x20')](_0x523f62));for(_0x2b72ae=0x0;_0x2b72ae<_0x523f62[_0xdecb('0x41')];_0x2b72ae+=0x1){_0x1574ca=_0x523f62[_0x2b72ae][_0xdecb('0x3a')]();logger['info']('index',_0x1574ca);if(_0x78ed9a){logger['info'](_0xdecb('0x42'),_0x78ed9a);logger[_0xdecb('0x8')](JSON[_0xdecb('0x20')](_0x498605[_0x1574ca]));BPromise[_0xdecb('0x43')]()[_0xdecb('0x24')](handleJob(_0x498605[_0x1574ca]));logger[_0xdecb('0x8')]('run\x20job',_0x498605[_0x1574ca][_0xdecb('0x11')],_0x498605[_0x1574ca][_0xdecb('0x44')]);}else if(_0x498605[_0x1574ca][_0xdecb('0x44')]&&_0x498605[_0x1574ca][_0xdecb('0x45')]&&moment()[_0xdecb('0x46')](_0x498605[_0x1574ca][_0xdecb('0x47')],_0x498605[_0x1574ca][_0xdecb('0x48')])){manager['add'](_0x1574ca,_0x498605[_0x1574ca][_0xdecb('0x44')],handleJob(_0x498605[_0x1574ca]));manager[_0xdecb('0x49')](_0x1574ca);logger[_0xdecb('0x8')](_0xdecb('0x4a'),_0x498605[_0x1574ca][_0xdecb('0x11')],_0x498605[_0x1574ca]['cron']);}else if(manager['exists'](_0x1574ca)){manager['stop'](_0x1574ca);manager[_0xdecb('0x3f')](_0x1574ca);logger[_0xdecb('0x8')](_0xdecb('0x4b'),_0x498605[_0x1574ca][_0xdecb('0x11')],_0x498605[_0x1574ca][_0xdecb('0x44')]);}}for(_0x2b72ae=0x0,_0x1574ca;_0x2b72ae<_0x57e59e[_0xdecb('0x41')]&&!_0x78ed9a;_0x2b72ae+=0x1){_0x1574ca=_0x57e59e[_0x2b72ae][_0xdecb('0x3a')]();if(manager['exists'](_0x1574ca)){if(_0x498605[_0x1574ca][_0xdecb('0x44')]&&_0x498605[_0x1574ca][_0xdecb('0x45')]&&moment()['isBetween'](_0x498605[_0x1574ca][_0xdecb('0x47')],_0x498605[_0x1574ca][_0xdecb('0x48')])){manager[_0xdecb('0x4c')](_0x1574ca,_0x498605[_0x1574ca][_0xdecb('0x44')],handleJob(_0x498605[_0x1574ca]));logger['info']('update\x20cron',_0x498605[_0x1574ca][_0xdecb('0x11')],_0x498605[_0x1574ca][_0xdecb('0x44')]);}else{manager[_0xdecb('0x3e')](_0x1574ca);manager[_0xdecb('0x3f')](_0x1574ca);logger[_0xdecb('0x8')](_0xdecb('0x4b'),_0x498605[_0x1574ca]['name'],_0x498605[_0x1574ca][_0xdecb('0x44')]);}}}})[_0xdecb('0x26')](function(_0x37dc30){logger[_0xdecb('0x25')](JSON[_0xdecb('0x20')](_0x37dc30));});}exports['run']=function(_0x138544){return getJobs(_0x138544);};exports[_0xdecb('0x49')]=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 761aab9..e96f30d 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 _0xe61a=['findAll','IN_PROGRESS','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','all','start','lodash','aws-sdk','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','then','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','transcripts','length','results','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','Sequelize','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Mixed','Neutral','FAILED','update','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','sentiment','Sentiment\x20Analysis\x20not\x20configured','data1','Negative','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording'];(function(_0x2802dd,_0xe238d8){var _0xb56e9b=function(_0x8e9d35){while(--_0x8e9d35){_0x2802dd['push'](_0x2802dd['shift']());}};_0xb56e9b(++_0xe238d8);}(_0xe61a,0x120));var _0xae61=function(_0x38ffb7,_0x387850){_0x38ffb7=_0x38ffb7-0x0;var _0x4fe12f=_0xe61a[_0x38ffb7];return _0x4fe12f;};var _=require(_0xae61('0x0'));var AWS=require(_0xae61('0x1'));var rp=require('request-promise');var util=require(_0xae61('0x2'));var BPromise=require('bluebird');var db=require(_0xae61('0x3'))['db'];var logger=require(_0xae61('0x4'))(_0xae61('0x5'));function getTranscriptionJob(_0x5db26b,_0x28ffeb,_0x362ecb,_0x50f80e){return new Promise(function(_0x4e92f8,_0xb9dcc8){var _0x2b02ca=new AWS[(_0xae61('0x6'))]({'accessKeyId':_0x28ffeb,'secretAccessKey':_0x5db26b,'region':_0x362ecb});_0x2b02ca[_0xae61('0x7')]({'TranscriptionJobName':_0x50f80e},function(_0x4290b0,_0x48951b){if(_0x4290b0){return _0xb9dcc8(_0x4290b0);}else{return _0x4e92f8(_0x48951b);}});});}function sentiment(_0x431d22,_0x247fc7,_0x33a612,_0x508bce,_0x3a4da6){return new Promise(function(_0x683b45,_0x245176){var _0x579c99=new AWS['Comprehend']({'accessKeyId':_0x247fc7,'secretAccessKey':_0x431d22,'region':_0x33a612});_0x579c99[_0xae61('0x8')]({'Text':_0x508bce,'LanguageCode':_0x3a4da6[_0xae61('0x9')](0x0,0x2)},function(_0x28d0a8,_0x58ba3c){if(_0x28d0a8){return _0x245176(_0x28d0a8);}else{return _0x683b45(_0x58ba3c);}});});}function checkTranscribeJob(_0x5040cb,_0x5ca51c,_0x20c7eb){var _0x26e389;return new BPromise(function(_0x54d89b,_0x68ac35){logger[_0xae61('0xa')](util[_0xae61('0xb')](_0xae61('0xc'),_0x5040cb['id'],_0x5040cb[_0xae61('0xd')]));return getTranscriptionJob(_0x20c7eb['data1'],_0x20c7eb[_0xae61('0xe')],_0x5ca51c[_0xae61('0xf')],_0x5040cb['transcribeName'])[_0xae61('0x10')](function(_0x2f54a8){logger[_0xae61('0xa')](util[_0xae61('0xb')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x5040cb['id'],_0x5040cb[_0xae61('0xd')],_0x2f54a8[_0xae61('0x11')][_0xae61('0x12')]));if(!_0x5040cb[_0xae61('0x13')]){switch(_0x2f54a8[_0xae61('0x11')][_0xae61('0x12')]){case _0xae61('0x14'):var _0x2e5991={'transcribeStatus':_0x2f54a8[_0xae61('0x11')][_0xae61('0x12')],'fileUri':_0x2f54a8[_0xae61('0x11')][_0xae61('0x15')][_0xae61('0x16')]};logger[_0xae61('0xa')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x5040cb['id']));return rp({'uri':_0x2f54a8[_0xae61('0x11')][_0xae61('0x15')][_0xae61('0x16')],'json':!![]})[_0xae61('0x10')](function(_0x7bedd3){logger[_0xae61('0xa')](util[_0xae61('0xb')](_0xae61('0x17'),_0x5040cb['id']));if(_0x7bedd3&&_0x7bedd3['results']&&_0x7bedd3['results'][_0xae61('0x18')]&&_0x7bedd3['results'][_0xae61('0x18')][_0xae61('0x19')]){_0x2e5991[_0xae61('0x13')]='';for(var _0x496876=0x0;_0x496876<_0x7bedd3[_0xae61('0x1a')][_0xae61('0x18')][_0xae61('0x19')];_0x496876++){_0x2e5991[_0xae61('0x13')]+=_0x7bedd3[_0xae61('0x1a')][_0xae61('0x18')][_0x496876]['transcript']+'';}}return _0x5040cb['update'](_0x2e5991);})[_0xae61('0x10')](function(){logger[_0xae61('0xa')](util[_0xae61('0xb')](_0xae61('0x1b'),_0x5040cb['id']));if(!_0x5040cb[_0xae61('0x1c')]){throw new db['Sequelize'][(_0xae61('0x1d'))](_0xae61('0x1e'));}if(!_0x5ca51c['sentiment']||!_0x5ca51c['sentimentAccountId']||!_0x5ca51c[_0xae61('0x1f')]||!_0x5ca51c[_0xae61('0x20')]||!_0x5ca51c[_0xae61('0x21')]){throw new db[(_0xae61('0x22'))][(_0xae61('0x1d'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2e5991[_0xae61('0x13')]){throw new Error(_0xae61('0x23'));}if(_0x5ca51c[_0xae61('0x24')]===_0x20c7eb['id']){return _0x20c7eb;}else{return db[_0xae61('0x25')][_0xae61('0x26')]({'where':{'id':_settings[_0xae61('0x24')]}});}})[_0xae61('0x10')](function(_0x2a0036){if(!_0x2a0036){throw new db[(_0xae61('0x22'))][(_0xae61('0x1d'))](_0xae61('0x27'));}if(!_0x2a0036['data1']||!_0x2a0036[_0xae61('0xe')]){throw new db[(_0xae61('0x22'))][(_0xae61('0x1d'))](_0xae61('0x28'));}_0x26e389=_0x2a0036;logger[_0xae61('0xa')](util['format'](_0xae61('0x29'),_0x5040cb['id']));return sentiment(_0x26e389['data1'],_0x26e389[_0xae61('0xe')],_0x5ca51c[_0xae61('0x1f')],_0x2e5991[_0xae61('0x13')],_0x5ca51c[_0xae61('0x20')]);})[_0xae61('0x10')](function(_0x267954){logger[_0xae61('0xa')](util['format'](_0xae61('0x2a'),_0x5040cb['id']));return _0x5040cb['update']({'sentiment':_0x267954[_0xae61('0x2b')],'sPositive':_0x267954['SentimentScore'][_0xae61('0x2c')],'sNegative':_0x267954[_0xae61('0x2d')]['Negative'],'sMixed':_0x267954['SentimentScore'][_0xae61('0x2e')],'sNeutral':_0x267954[_0xae61('0x2d')][_0xae61('0x2f')]});})[_0xae61('0x10')](function(){logger[_0xae61('0xa')](util[_0xae61('0xb')](_0xae61('0x1b'),_0x5040cb['id']));_0x54d89b();});case _0xae61('0x30'):return _0x5040cb[_0xae61('0x31')]({'transcribeStatus':_0xae61('0x30'),'failureReason':_0x2f54a8[_0xae61('0x11')][_0xae61('0x32')]})[_0xae61('0x10')](function(){logger[_0xae61('0xa')](util[_0xae61('0xb')](_0xae61('0x1b'),_0x5040cb['id']));_0x54d89b();});default:logger[_0xae61('0xa')](util['format'](_0xae61('0x33'),_0x5040cb['id']));break;}}else{return BPromise['resolve']()[_0xae61('0x10')](function(){if(!_0x5040cb[_0xae61('0x1c')]){throw new db[(_0xae61('0x22'))]['ValidationError'](_0xae61('0x1e'));}if(!_0x5ca51c[_0xae61('0x34')]||!_0x5ca51c['sentimentAccountId']||!_0x5ca51c[_0xae61('0x1f')]||!_0x5ca51c['language']||!_0x5ca51c[_0xae61('0x21')]){throw new db[(_0xae61('0x22'))][(_0xae61('0x1d'))](_0xae61('0x35'));}if(!_0x5040cb[_0xae61('0x13')]){throw new Error(_0xae61('0x23'));}if(_0x5ca51c[_0xae61('0x24')]===_0x20c7eb['id']){return _0x20c7eb;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0xae61('0x24')]}});}})[_0xae61('0x10')](function(_0x434395){if(!_0x434395){throw new db[(_0xae61('0x22'))]['ValidationError'](_0xae61('0x27'));}if(!_0x434395[_0xae61('0x36')]||!_0x434395[_0xae61('0xe')]){throw new db['Sequelize'][(_0xae61('0x1d'))](_0xae61('0x28'));}_0x26e389=_0x434395;logger[_0xae61('0xa')](util[_0xae61('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x5040cb['id']));return sentiment(_0x26e389['data1'],_0x26e389['data2'],_0x5ca51c[_0xae61('0x1f')],_0x5040cb[_0xae61('0x13')],_0x5ca51c[_0xae61('0x20')]);})[_0xae61('0x10')](function(_0x27286c){logger[_0xae61('0xa')](util[_0xae61('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x5040cb['id']));return _0x5040cb['update']({'sentiment':_0x27286c[_0xae61('0x2b')],'sPositive':_0x27286c[_0xae61('0x2d')]['Positive'],'sNegative':_0x27286c[_0xae61('0x2d')][_0xae61('0x37')],'sMixed':_0x27286c['SentimentScore'][_0xae61('0x2e')],'sNeutral':_0x27286c[_0xae61('0x2d')][_0xae61('0x2f')],'transcribeStatus':_0xae61('0x14')});})[_0xae61('0x10')](function(){logger[_0xae61('0xa')](util[_0xae61('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5040cb['id']));_0x54d89b();});}})['catch'](function(_0x5e6ed2){if(_0x5e6ed2){if(!_0x5e6ed2[_0xae61('0x38')]||_0x5e6ed2[_0xae61('0x38')]!==_0xae61('0x39')){logger[_0xae61('0x3a')](util[_0xae61('0xb')](_0xae61('0x3b'),_0x5040cb['id']),util[_0xae61('0x3c')](_0x5e6ed2,{'showHidden':![],'depth':null}));}}_0x54d89b();});});}function checkTranscribe(){var _0x491702;var _0x29e84e;var _0x5337aa;return db[_0xae61('0x3d')][_0xae61('0x3e')]({'where':{'transcribeStatus':_0xae61('0x3f')}})[_0xae61('0x10')](function(_0x90cde0){if(!_0x90cde0||!_0x90cde0[_0xae61('0x19')]){throw new db[(_0xae61('0x22'))][(_0xae61('0x1d'))]('No\x20transcribe\x20job\x20to\x20check');}_0x491702=_0x90cde0;return db['Setting'][_0xae61('0x26')]({'where':{'id':0x1}});})[_0xae61('0x10')](function(_0x14bce3){if(!_0x14bce3){throw new db[(_0xae61('0x22'))][(_0xae61('0x1d'))](_0xae61('0x40'));}_0x29e84e=_0x14bce3;if(!_0x29e84e['transcribe']||!_0x29e84e[_0xae61('0x41')]||!_0x29e84e[_0xae61('0xf')]||!_0x29e84e[_0xae61('0x20')]||!_0x29e84e[_0xae61('0x21')]){throw new db[(_0xae61('0x22'))][(_0xae61('0x1d'))](_0xae61('0x42'));}return db['CloudProvider'][_0xae61('0x26')]({'where':{'id':_0x29e84e[_0xae61('0x41')]}});})[_0xae61('0x10')](function(_0xd53969){if(!_0xd53969){throw new db[(_0xae61('0x22'))][(_0xae61('0x1d'))](_0xae61('0x27'));}if(!_0xd53969[_0xae61('0x36')]||!_0xd53969[_0xae61('0xe')]){throw new db[(_0xae61('0x22'))][(_0xae61('0x1d'))](_0xae61('0x28'));}_0x5337aa=_0xd53969;var _0x4227b3=[];_0x491702['forEach'](function(_0x1ddc7b){_0x4227b3[_0xae61('0x43')](checkTranscribeJob(_0x1ddc7b,_0x29e84e,_0x5337aa));});return BPromise[_0xae61('0x44')](_0x4227b3);})['catch'](function(_0x50700a){if(_0x50700a){if(!_0x50700a['name']||_0x50700a[_0xae61('0x38')]!==_0xae61('0x39')){logger[_0xae61('0x3a')](util[_0xae61('0x3c')](_0x50700a,{'showHidden':![],'depth':null}));}}});}exports[_0xae61('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x81fa=['Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','format','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','fileText','transcript','update','Sequelize','ValidationError','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','bucket','Sentiment','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting'];(function(_0x1cf8c0,_0x1ba498){var _0x25d6d5=function(_0x5de11a){while(--_0x5de11a){_0x1cf8c0['push'](_0x1cf8c0['shift']());}};_0x25d6d5(++_0x1ba498);}(_0x81fa,0xdd));var _0xa81f=function(_0x20b30e,_0x1908c7){_0x20b30e=_0x20b30e-0x0;var _0x5073ba=_0x81fa[_0x20b30e];return _0x5073ba;};var _=require(_0xa81f('0x0'));var AWS=require(_0xa81f('0x1'));var rp=require('request-promise');var util=require(_0xa81f('0x2'));var BPromise=require(_0xa81f('0x3'));var db=require(_0xa81f('0x4'))['db'];var logger=require(_0xa81f('0x5'))('transcribe');function getTranscriptionJob(_0x1c7d2f,_0x202dbf,_0x466875,_0x3a5438){return new Promise(function(_0x1dc233,_0x158719){var _0x3ceca1=new AWS[(_0xa81f('0x6'))]({'accessKeyId':_0x202dbf,'secretAccessKey':_0x1c7d2f,'region':_0x466875});_0x3ceca1[_0xa81f('0x7')]({'TranscriptionJobName':_0x3a5438},function(_0x3447bb,_0x38e313){if(_0x3447bb){return _0x158719(_0x3447bb);}else{return _0x1dc233(_0x38e313);}});});}function sentiment(_0x442db2,_0x49ea5c,_0x4cbd21,_0x28b82f,_0x182ae7){return new Promise(function(_0x57db85,_0x47e978){var _0x5b8b3c=new AWS[(_0xa81f('0x8'))]({'accessKeyId':_0x49ea5c,'secretAccessKey':_0x442db2,'region':_0x4cbd21});_0x5b8b3c['detectSentiment']({'Text':_0x28b82f,'LanguageCode':_0x182ae7[_0xa81f('0x9')](0x0,0x2)},function(_0x5b71ae,_0x3e178b){if(_0x5b71ae){return _0x47e978(_0x5b71ae);}else{return _0x57db85(_0x3e178b);}});});}function checkTranscribeJob(_0x4e7eb8,_0x1aeead,_0x47df65){var _0x3487df;return new BPromise(function(_0x47419e,_0x315558){logger[_0xa81f('0xa')](util['format'](_0xa81f('0xb'),_0x4e7eb8['id'],_0x4e7eb8[_0xa81f('0xc')]));return getTranscriptionJob(_0x47df65[_0xa81f('0xd')],_0x47df65[_0xa81f('0xe')],_0x1aeead[_0xa81f('0xf')],_0x4e7eb8[_0xa81f('0xc')])[_0xa81f('0x10')](function(_0x4e41ba){logger[_0xa81f('0xa')](util['format'](_0xa81f('0x11'),_0x4e7eb8['id'],_0x4e7eb8[_0xa81f('0xc')],_0x4e41ba[_0xa81f('0x12')][_0xa81f('0x13')]));if(!_0x4e7eb8['fileText']){switch(_0x4e41ba[_0xa81f('0x12')][_0xa81f('0x13')]){case'COMPLETED':var _0x588d80={'transcribeStatus':_0x4e41ba['TranscriptionJob'][_0xa81f('0x13')],'fileUri':_0x4e41ba['TranscriptionJob'][_0xa81f('0x14')][_0xa81f('0x15')]};logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x17'),_0x4e7eb8['id']));return rp({'uri':_0x4e41ba[_0xa81f('0x12')][_0xa81f('0x14')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x4fa8ad){logger[_0xa81f('0xa')](util[_0xa81f('0x16')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x4e7eb8['id']));if(_0x4fa8ad&&_0x4fa8ad[_0xa81f('0x18')]&&_0x4fa8ad[_0xa81f('0x18')]['transcripts']&&_0x4fa8ad['results'][_0xa81f('0x19')][_0xa81f('0x1a')]){_0x588d80[_0xa81f('0x1b')]='';for(var _0x45ccd6=0x0;_0x45ccd6<_0x4fa8ad[_0xa81f('0x18')]['transcripts'][_0xa81f('0x1a')];_0x45ccd6++){_0x588d80[_0xa81f('0x1b')]+=_0x4fa8ad[_0xa81f('0x18')][_0xa81f('0x19')][_0x45ccd6][_0xa81f('0x1c')]+'';}}return _0x4e7eb8[_0xa81f('0x1d')](_0x588d80);})[_0xa81f('0x10')](function(){logger[_0xa81f('0xa')](util[_0xa81f('0x16')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4e7eb8['id']));if(!_0x4e7eb8['tempSentiment']){throw new db[(_0xa81f('0x1e'))][(_0xa81f('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1aeead['sentiment']||!_0x1aeead[_0xa81f('0x20')]||!_0x1aeead[_0xa81f('0x21')]||!_0x1aeead[_0xa81f('0x22')]||!_0x1aeead['bucket']){throw new db['Sequelize']['ValidationError'](_0xa81f('0x23'));}if(!_0x588d80['fileText']){throw new Error(_0xa81f('0x24'));}if(_0x1aeead[_0xa81f('0x20')]===_0x47df65['id']){return _0x47df65;}else{return db[_0xa81f('0x25')][_0xa81f('0x26')]({'where':{'id':_settings[_0xa81f('0x20')]}});}})[_0xa81f('0x10')](function(_0x514450){if(!_0x514450){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x27'));}if(!_0x514450['data1']||!_0x514450[_0xa81f('0xe')]){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x28'));}_0x3487df=_0x514450;logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x29'),_0x4e7eb8['id']));return sentiment(_0x3487df[_0xa81f('0xd')],_0x3487df[_0xa81f('0xe')],_0x1aeead[_0xa81f('0x21')],_0x588d80[_0xa81f('0x1b')],_0x1aeead[_0xa81f('0x22')]);})['then'](function(_0x432bff){logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x2a'),_0x4e7eb8['id']));return _0x4e7eb8[_0xa81f('0x1d')]({'sentiment':_0x432bff['Sentiment'],'sPositive':_0x432bff[_0xa81f('0x2b')][_0xa81f('0x2c')],'sNegative':_0x432bff[_0xa81f('0x2b')][_0xa81f('0x2d')],'sMixed':_0x432bff['SentimentScore'][_0xa81f('0x2e')],'sNeutral':_0x432bff[_0xa81f('0x2b')][_0xa81f('0x2f')]});})[_0xa81f('0x10')](function(){logger['info'](util[_0xa81f('0x16')](_0xa81f('0x30'),_0x4e7eb8['id']));_0x47419e();});case _0xa81f('0x31'):return _0x4e7eb8[_0xa81f('0x1d')]({'transcribeStatus':'FAILED','failureReason':_0x4e41ba[_0xa81f('0x12')]['FailureReason']})[_0xa81f('0x10')](function(){logger['info'](util[_0xa81f('0x16')](_0xa81f('0x30'),_0x4e7eb8['id']));_0x47419e();});default:logger[_0xa81f('0xa')](util['format'](_0xa81f('0x32'),_0x4e7eb8['id']));break;}}else{return BPromise['resolve']()[_0xa81f('0x10')](function(){if(!_0x4e7eb8[_0xa81f('0x33')]){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x34'));}if(!_0x1aeead[_0xa81f('0x35')]||!_0x1aeead[_0xa81f('0x20')]||!_0x1aeead[_0xa81f('0x21')]||!_0x1aeead[_0xa81f('0x22')]||!_0x1aeead[_0xa81f('0x36')]){throw new db[(_0xa81f('0x1e'))][(_0xa81f('0x1f'))](_0xa81f('0x23'));}if(!_0x4e7eb8[_0xa81f('0x1b')]){throw new Error(_0xa81f('0x24'));}if(_0x1aeead[_0xa81f('0x20')]===_0x47df65['id']){return _0x47df65;}else{return db['CloudProvider'][_0xa81f('0x26')]({'where':{'id':_settings[_0xa81f('0x20')]}});}})[_0xa81f('0x10')](function(_0x2450d9){if(!_0x2450d9){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x27'));}if(!_0x2450d9[_0xa81f('0xd')]||!_0x2450d9[_0xa81f('0xe')]){throw new db[(_0xa81f('0x1e'))]['ValidationError'](_0xa81f('0x28'));}_0x3487df=_0x2450d9;logger['info'](util[_0xa81f('0x16')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4e7eb8['id']));return sentiment(_0x3487df['data1'],_0x3487df[_0xa81f('0xe')],_0x1aeead['sentimentRegion'],_0x4e7eb8[_0xa81f('0x1b')],_0x1aeead[_0xa81f('0x22')]);})[_0xa81f('0x10')](function(_0x430364){logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x2a'),_0x4e7eb8['id']));return _0x4e7eb8[_0xa81f('0x1d')]({'sentiment':_0x430364[_0xa81f('0x37')],'sPositive':_0x430364['SentimentScore'][_0xa81f('0x2c')],'sNegative':_0x430364[_0xa81f('0x2b')][_0xa81f('0x2d')],'sMixed':_0x430364['SentimentScore'][_0xa81f('0x2e')],'sNeutral':_0x430364[_0xa81f('0x2b')][_0xa81f('0x2f')],'transcribeStatus':_0xa81f('0x38')});})[_0xa81f('0x10')](function(){logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x30'),_0x4e7eb8['id']));_0x47419e();});}})[_0xa81f('0x39')](function(_0x3aae75){if(_0x3aae75){if(!_0x3aae75[_0xa81f('0x3a')]||_0x3aae75[_0xa81f('0x3a')]!==_0xa81f('0x3b')){logger[_0xa81f('0x3c')](util[_0xa81f('0x16')](_0xa81f('0x3d'),_0x4e7eb8['id']),util[_0xa81f('0x3e')](_0x3aae75,{'showHidden':![],'depth':null}));}}_0x47419e();});});}function checkTranscribe(){var _0x28dda4;var _0x2143d7;var _0x3f9182;return db['VoiceRecording'][_0xa81f('0x3f')]({'where':{'transcribeStatus':_0xa81f('0x40')}})['then'](function(_0x4f88ad){if(!_0x4f88ad||!_0x4f88ad[_0xa81f('0x1a')]){throw new db[(_0xa81f('0x1e'))][(_0xa81f('0x1f'))](_0xa81f('0x41'));}_0x28dda4=_0x4f88ad;return db[_0xa81f('0x42')][_0xa81f('0x26')]({'where':{'id':0x1}});})[_0xa81f('0x10')](function(_0x32ee66){if(!_0x32ee66){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x43'));}_0x2143d7=_0x32ee66;if(!_0x2143d7['transcribe']||!_0x2143d7[_0xa81f('0x44')]||!_0x2143d7['transcribeRegion']||!_0x2143d7[_0xa81f('0x22')]||!_0x2143d7[_0xa81f('0x36')]){throw new db[(_0xa81f('0x1e'))]['ValidationError'](_0xa81f('0x45'));}return db[_0xa81f('0x25')]['findOne']({'where':{'id':_0x2143d7[_0xa81f('0x44')]}});})[_0xa81f('0x10')](function(_0x111272){if(!_0x111272){throw new db[(_0xa81f('0x1e'))]['ValidationError'](_0xa81f('0x27'));}if(!_0x111272[_0xa81f('0xd')]||!_0x111272[_0xa81f('0xe')]){throw new db[(_0xa81f('0x1e'))][(_0xa81f('0x1f'))](_0xa81f('0x28'));}_0x3f9182=_0x111272;var _0x325be2=[];_0x28dda4[_0xa81f('0x46')](function(_0x21716b){_0x325be2[_0xa81f('0x47')](checkTranscribeJob(_0x21716b,_0x2143d7,_0x3f9182));});return BPromise['all'](_0x325be2);})[_0xa81f('0x39')](function(_0x234a35){if(_0x234a35){if(!_0x234a35[_0xa81f('0x3a')]||_0x234a35[_0xa81f('0x3a')]!=='SequelizeValidationError'){logger[_0xa81f('0x3c')](util[_0xa81f('0x3e')](_0x234a35,{'showHidden':![],'depth':null}));}}});}exports['start']=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 59a0f52..3114e3a 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 _0x6564=['lastMsgAt','length','join','update','format','YYYY-MM-DD\x20HH:mm:ss','then','info','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','../../mysqldb','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll'];(function(_0x52b2cc,_0x1eadc5){var _0x2d9ab0=function(_0x5b8569){while(--_0x5b8569){_0x52b2cc['push'](_0x52b2cc['shift']());}};_0x2d9ab0(++_0x1eadc5);}(_0x6564,0x17d));var _0x4656=function(_0xbd815f,_0x54269e){_0xbd815f=_0xbd815f-0x0;var _0x3790db=_0x6564[_0xbd815f];return _0x3790db;};'use strict';var _=require(_0x4656('0x0'));var moment=require(_0x4656('0x1'));var Redis=require(_0x4656('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0x4656('0x3'))['db'];var logger=require('../logger')(_0x4656('0x4'));config[_0x4656('0x5')]=_['defaults'](config[_0x4656('0x5')],{'host':_0x4656('0x6'),'port':0x18eb});var io=require(_0x4656('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x550286=[];return db[_0x4656('0x8')][_0x4656('0x9')]({'raw':!![],'attributes':['id',_0x4656('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,'hours')}}})['then'](function(_0x2a490f){if(_0x2a490f&&_0x2a490f[_0x4656('0xb')]){_0x550286=_['map'](_0x2a490f||[],'id');logger['info']('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x550286[_0x4656('0xc')]());return db[_0x4656('0x8')][_0x4656('0xd')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x4656('0xe')](_0x4656('0xf'))},{'where':{'id':_0x550286}});}})[_0x4656('0x10')](function(){if(_0x550286&&_0x550286[_0x4656('0xb')]){logger[_0x4656('0x11')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x550286[_0x4656('0xc')]());for(var _0x40d69a=0x0;_0x40d69a<_0x550286[_0x4656('0xb')];_0x40d69a++){io[_0x4656('0x12')](_0x4656('0x13'),{'id':_0x550286[_0x40d69a],'closed':!![]});}}})[_0x4656('0x14')](function(_0x14c2dd){logger['error'](_0x4656('0x15'),_0x14c2dd?util[_0x4656('0x16')](_0x14c2dd,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd2fa=['schedule','redis','defaults','localhost','WhatsappInteraction','findAll','subtract','hours','then','length','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0xd2fa,0x161));var _0xad2f=function(_0x5bbd8f,_0x2bd2c4){_0x5bbd8f=_0x5bbd8f-0x0;var _0x1dd98a=_0xd2fa[_0x5bbd8f];return _0x1dd98a;};'use strict';var _=require(_0xad2f('0x0'));var moment=require(_0xad2f('0x1'));var Redis=require(_0xad2f('0x2'));var util=require(_0xad2f('0x3'));var config=require(_0xad2f('0x4'));var db=require(_0xad2f('0x5'))['db'];var logger=require(_0xad2f('0x6'))(_0xad2f('0x7'));config[_0xad2f('0x8')]=_[_0xad2f('0x9')](config['redis'],{'host':_0xad2f('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xad2f('0x8')]));function closeInteractions(){var _0x52f63c=[];return db[_0xad2f('0xb')][_0xad2f('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xad2f('0xd')](0x18,_0xad2f('0xe'))}}})[_0xad2f('0xf')](function(_0x2640c0){if(_0x2640c0&&_0x2640c0[_0xad2f('0x10')]){_0x52f63c=_['map'](_0x2640c0||[],'id');logger['info']('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x52f63c[_0xad2f('0x11')]());return db[_0xad2f('0xb')][_0xad2f('0x12')]({'closeReason':_0xad2f('0x13'),'disposition':_0xad2f('0x14'),'closed':!![],'closedAt':moment()[_0xad2f('0x15')](_0xad2f('0x16'))},{'where':{'id':_0x52f63c}});}})['then'](function(){if(_0x52f63c&&_0x52f63c[_0xad2f('0x10')]){logger[_0xad2f('0x17')](_0xad2f('0x18'),_0x52f63c[_0xad2f('0x11')]());for(var _0x278bc9=0x0;_0x278bc9<_0x52f63c[_0xad2f('0x10')];_0x278bc9++){io['emit'](_0xad2f('0x19'),{'id':_0x52f63c[_0x278bc9],'closed':!![]});}}})[_0xad2f('0x1a')](function(_0x162de1){logger[_0xad2f('0x1b')](_0xad2f('0x1c'),_0x162de1?util['inspect'](_0x162de1,{'showHidden':![],'depth':null}):'');});}exports[_0xad2f('0x1d')]=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 a9e2989..78895ff 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f3a=['finished\x20populating','contacts2','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','CmContact','then','bulkCreate','contacts1','CmHopper','destroy','log'];(function(_0x1c8a06,_0x26adf9){var _0xfe307c=function(_0x113268){while(--_0x113268){_0x1c8a06['push'](_0x1c8a06['shift']());}};_0xfe307c(++_0x26adf9);}(_0x6f3a,0x102));var _0xa6f3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f3a[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var db=require(_0xa6f3('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xa6f3('0x1')+i,'lastName':_0xa6f3('0x2')+i,'phone':0xf879fb460+i,'email':_0xa6f3('0x3')+i+_0xa6f3('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa6f3('0x5')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa6f3('0x6')](),'updatedAt':Date[_0xa6f3('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xa6f3('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xa6f3('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xa6f3('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xa6f3('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa6f3('0x6')](),'updatedAt':Date[_0xa6f3('0x6')]()});}db[_0xa6f3('0x7')]['destroy']({'where':{}})[_0xa6f3('0x8')](function(){return db[_0xa6f3('0x7')][_0xa6f3('0x9')](contacts);})[_0xa6f3('0x8')](function(){console['log']('finished\x20populating',_0xa6f3('0xa'));return db[_0xa6f3('0xb')][_0xa6f3('0xc')]({'where':{}});})[_0xa6f3('0x8')](function(){return db['CmHopper'][_0xa6f3('0x9')](hopper);})[_0xa6f3('0x8')](function(){console[_0xa6f3('0xd')](_0xa6f3('0xe'),'hopper1');return db[_0xa6f3('0x7')]['bulkCreate'](contacts2);})['then'](function(){console['log'](_0xa6f3('0xe'),_0xa6f3('0xf'));return db[_0xa6f3('0xb')]['bulkCreate'](hopper2);})['then'](function(){console[_0xa6f3('0xd')](_0xa6f3('0xe'),'hopper2');})['catch'](function(_0x8ba348){console[_0xa6f3('0xd')](_0x8ba348);}); \ No newline at end of file +var _0x7731=['innocenzo.biondo','push','now','Innocenzo','CmContact','log','finished\x20populating','contacts1','CmHopper','destroy','then','bulkCreate','hopper2','util','Biondo'];(function(_0x35490b,_0x3a2bff){var _0x22e3b0=function(_0x1965eb){while(--_0x1965eb){_0x35490b['push'](_0x35490b['shift']());}};_0x22e3b0(++_0x3a2bff);}(_0x7731,0xc1));var _0x1773=function(_0xf53bb2,_0x4cea10){_0xf53bb2=_0xf53bb2-0x0;var _0x31d2ca=_0x7731[_0xf53bb2];return _0x31d2ca;};'use strict';var util=require(_0x1773('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x1773('0x1')+i,'phone':0xf879fb460+i,'email':_0x1773('0x2')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x1773('0x3')]({'id':i,'active':![],'scheduledat':Date[_0x1773('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1773('0x4')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x1773('0x3')]({'id':i,'firstName':_0x1773('0x5')+i,'lastName':_0x1773('0x1')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x1773('0x3')]({'id':i,'active':![],'scheduledat':Date[_0x1773('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1773('0x4')](),'updatedAt':Date[_0x1773('0x4')]()});}db[_0x1773('0x6')]['destroy']({'where':{}})['then'](function(){return db[_0x1773('0x6')]['bulkCreate'](contacts);})['then'](function(){console[_0x1773('0x7')](_0x1773('0x8'),_0x1773('0x9'));return db[_0x1773('0xa')][_0x1773('0xb')]({'where':{}});})[_0x1773('0xc')](function(){return db[_0x1773('0xa')][_0x1773('0xd')](hopper);})[_0x1773('0xc')](function(){console[_0x1773('0x7')](_0x1773('0x8'),'hopper1');return db[_0x1773('0x6')][_0x1773('0xd')](contacts2);})['then'](function(){console['log'](_0x1773('0x8'),'contacts2');return db[_0x1773('0xa')][_0x1773('0xd')](hopper2);})[_0x1773('0xc')](function(){console[_0x1773('0x7')](_0x1773('0x8'),_0x1773('0xe'));})['catch'](function(_0x3e1e48){console[_0x1773('0x7')](_0x3e1e48);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index cb225d1..2d4e14f 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd19b=['%s%s@xcally.com','password','friend','udp','wss','all','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user','catch','util','push','format','%s%s','agent'];(function(_0x4edd21,_0x16b15b){var _0x51737a=function(_0x295894){while(--_0x295894){_0x4edd21['push'](_0x4edd21['shift']());}};_0x51737a(++_0x16b15b);}(_0xd19b,0x151));var _0xbd19=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0xd19b[_0xa388a2];return _0x7ce7f6;};'use strict';var util=require(_0xbd19('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xbd19('0x1')]({'name':util[_0xbd19('0x2')]('%s%s','agent',i),'fullname':util['format'](_0xbd19('0x3'),_0xbd19('0x4'),i),'email':util[_0xbd19('0x2')](_0xbd19('0x5'),_0xbd19('0x4'),i),'role':_0xbd19('0x4'),'password':_0xbd19('0x6'),'internal':0xfa0+i,'type':_0xbd19('0x7'),'transport':[_0xbd19('0x8'),'ws',_0xbd19('0x9')],'disallow':[_0xbd19('0xa')],'allow':['ulaw'],'defaultuser':util[_0xbd19('0x2')]('%s%s',_0xbd19('0x4'),i),'encryption':_0xbd19('0xb'),'avpf':_0xbd19('0xb'),'force_avp':_0xbd19('0xb'),'icesupport':_0xbd19('0xb'),'dtlsenable':_0xbd19('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xbd19('0xc'),'dtlssetup':'actpass','callerid':util[_0xbd19('0x2')](_0xbd19('0xd'),util[_0xbd19('0x2')](_0xbd19('0x3'),'agent',i),0xfa0+i)});}db[_0xbd19('0xe')][_0xbd19('0xf')](users)['then'](function(){console[_0xbd19('0x10')](_0xbd19('0x11'));})[_0xbd19('0x12')](function(_0x3882e2){console[_0xbd19('0x10')](_0x3882e2);}); \ No newline at end of file +var _0xec64=['add\x20user','catch','log','util','../mysqldb','push','%s%s','format','agent','%s%s@xcally.com','friend','udp','wss','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then'];(function(_0x65397d,_0xf997ae){var _0x357509=function(_0xd16a93){while(--_0xd16a93){_0x65397d['push'](_0x65397d['shift']());}};_0x357509(++_0xf997ae);}(_0xec64,0x81));var _0x4ec6=function(_0xa4c85,_0x2b52a7){_0xa4c85=_0xa4c85-0x0;var _0x172c1f=_0xec64[_0xa4c85];return _0x172c1f;};'use strict';var util=require(_0x4ec6('0x0'));var db=require(_0x4ec6('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x4ec6('0x2')]({'name':util['format'](_0x4ec6('0x3'),'agent',i),'fullname':util[_0x4ec6('0x4')](_0x4ec6('0x3'),_0x4ec6('0x5'),i),'email':util[_0x4ec6('0x4')](_0x4ec6('0x6'),'agent',i),'role':_0x4ec6('0x5'),'password':'password','internal':0xfa0+i,'type':_0x4ec6('0x7'),'transport':[_0x4ec6('0x8'),'ws',_0x4ec6('0x9')],'disallow':['all'],'allow':[_0x4ec6('0xa')],'defaultuser':util[_0x4ec6('0x4')](_0x4ec6('0x3'),_0x4ec6('0x5'),i),'encryption':_0x4ec6('0xb'),'avpf':_0x4ec6('0xb'),'force_avp':_0x4ec6('0xb'),'icesupport':_0x4ec6('0xb'),'dtlsenable':_0x4ec6('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x4ec6('0xc'),'dtlssetup':_0x4ec6('0xd'),'callerid':util[_0x4ec6('0x4')](_0x4ec6('0xe'),util[_0x4ec6('0x4')]('%s%s','agent',i),0xfa0+i)});}db[_0x4ec6('0xf')][_0x4ec6('0x10')](users)[_0x4ec6('0x11')](function(){console['log'](_0x4ec6('0x12'));})[_0x4ec6('0x13')](function(_0x6ec754){console[_0x4ec6('0x14')](_0x6ec754);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index bfa3816..872ce91 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e08=['hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','userProfileId','OpenchannelQueues','WhatsappQueues','WhatsappQueue','Telephones','agent','getSmsQueues','getMailQueues','getWhatsappQueues','voice','chat','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','util','../mysqldb','./environment','name','User','telephone','type','ivr','findOne','VoiceQueues','FaxQueues','SmsQueues','MailQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','role','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8e08,0xf9));var _0x88e0=function(_0x2a50c0,_0xceb69d){_0x2a50c0=_0x2a50c0-0x0;var _0x6f01c1=_0x8e08[_0x2a50c0];return _0x6f01c1;};'use strict';var _=require('lodash');var util=require(_0x88e0('0x0'));var BPromise=require('bluebird');var db=require(_0x88e0('0x1'))['db'];var config=require(_0x88e0('0x2'));var queryQueues={'attributes':['id',_0x88e0('0x3')],'include':[{'as':'Agents','model':db[_0x88e0('0x4')],'attributes':['id',_0x88e0('0x3'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x88e0('0x5')}};var queryTrunks={'raw':!![],'attributes':['id',_0x88e0('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x88e0('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x88e0('0x6')],'where':{'type':_0x88e0('0x7')}};function getAssociatedResources(_0x2828d4,_0x4baf1f,_0x54ff22){return db['UserProfileSection'][_0x88e0('0x8')]({'where':{'name':_0x2828d4,'userProfileId':_0x4baf1f},'raw':!![]})['then'](function(_0x18da09){if(_0x18da09){if(_0x18da09['autoAssociation']){switch(_0x2828d4){case _0x88e0('0x9'):case'ChatQueues':case _0x88e0('0xa'):case _0x88e0('0xb'):case _0x88e0('0xc'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x54ff22][_0x88e0('0xd')](queryQueues);case'Telephones':return db[_0x54ff22][_0x88e0('0xd')](queryTelephones);case _0x88e0('0xe'):return db[_0x54ff22][_0x88e0('0xd')](queryTrunks);case _0x88e0('0xf'):return db[_0x54ff22][_0x88e0('0xd')](queryCampaigns);}}else{return db[_0x88e0('0x10')][_0x88e0('0xd')]({'attributes':[_0x88e0('0x11')],'where':{'sectionId':_0x18da09['id']},'raw':!![]})[_0x88e0('0x12')](function(_0x413135){if(_0x413135){var _0x739ed2={'where':{'id':_[_0x88e0('0x13')](_0x413135,_0x88e0('0x11'))},'raw':!![]};switch(_0x54ff22){case _0x88e0('0x4'):_0x739ed2['where'][_0x88e0('0x14')]=_0x88e0('0x5');break;case _0x88e0('0x15'):_0x739ed2['where'][_0x88e0('0x6')]='ivr';break;}return db[_0x54ff22][_0x88e0('0xd')](_0x739ed2);}else{return[];}});}}else{return[];}})[_0x88e0('0x12')](function(_0x38caeb){return _0x38caeb;});}function joinOrLeaveQueues(_0x1caa9b,_0x5d639b,_0x4a50b0,_0xcee4b9){_0x1caa9b[_0x5d639b](util[_0x88e0('0x16')](_0x88e0('0x17'),_0x4a50b0,_0xcee4b9[_0x88e0('0x3')]));if(_0xcee4b9[_0x88e0('0x18')]){for(var _0x1d970b=0x0;_0x1d970b<_0xcee4b9[_0x88e0('0x18')][_0x88e0('0x19')];_0x1d970b+=0x1){_0x1caa9b[_0x5d639b](util['format'](_0x88e0('0x1a'),_0xcee4b9[_0x88e0('0x18')][_0x1d970b][_0x88e0('0x3')]));}}}function joinOrLeave(_0x5a7f39,_0x1a5e0e,_0x3f2726){var _0x350c4c;if(_0x5a7f39[_0x88e0('0x1b')][_0x88e0('0x1c')]['id']){db[_0x88e0('0x4')][_0x88e0('0x1d')]({'attributes':['id','name','role','userProfileId'],'where':{'id':_0x5a7f39[_0x88e0('0x1b')][_0x88e0('0x1c')]['id']},'include':[{'model':db[_0x88e0('0x1e')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x88e0('0x1f')],'as':_0x88e0('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x88e0('0x21')],'as':_0x88e0('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x88e0('0x23')],'as':_0x88e0('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x88e0('0x25')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x88e0('0x26')],'as':_0x88e0('0x27'),'attributes':['id'],'raw':!![]}]})[_0x88e0('0x12')](function(_0xd5a42d){if(_0xd5a42d){_0x350c4c=_0xd5a42d;_0x5a7f39[_0x1a5e0e](util[_0x88e0('0x16')](_0x88e0('0x1a'),_0xd5a42d['name']));var _0x11f864=[];switch(_0xd5a42d[_0x88e0('0x14')]){case'admin':_0x5a7f39[_0x1a5e0e](_0x88e0('0x28'));_0x5a7f39[_0x1a5e0e](_0x88e0('0x29'));if(queryQueues[_0x88e0('0x2a')](_0x88e0('0x2b'))){delete queryQueues['include'];}_0x11f864[_0x88e0('0x2c')](db[_0x88e0('0x2d')]['findAll'](queryQueues));_0x11f864[_0x88e0('0x2c')](db[_0x88e0('0x2e')][_0x88e0('0xd')](queryQueues));_0x11f864['push'](db[_0x88e0('0x2f')][_0x88e0('0xd')](queryQueues));_0x11f864[_0x88e0('0x2c')](db[_0x88e0('0x30')][_0x88e0('0xd')](queryQueues));_0x11f864[_0x88e0('0x2c')](db[_0x88e0('0x31')][_0x88e0('0xd')](queryQueues));_0x11f864[_0x88e0('0x2c')](db[_0x88e0('0x32')]['findAll'](queryQueues));_0x11f864['push'](db['WhatsappQueue']['findAll'](queryQueues));_0x11f864['push'](db[_0x88e0('0x4')][_0x88e0('0xd')](queryTelephones));_0x11f864[_0x88e0('0x2c')](db[_0x88e0('0x33')][_0x88e0('0xd')](queryTrunks));_0x11f864['push'](db['Campaign'][_0x88e0('0xd')](queryCampaigns));_0x11f864[_0x88e0('0x2c')](db[_0x88e0('0x4')][_0x88e0('0xd')](queryAgents));break;case _0x88e0('0x34'):_0x5a7f39[_0x1a5e0e]('voice:inbound');_0x5a7f39[_0x1a5e0e]('voice:outbound');_0x11f864[_0x88e0('0x2c')](getAssociatedResources(_0x88e0('0x9'),_0xd5a42d[_0x88e0('0x35')],_0x88e0('0x2d')));_0x11f864[_0x88e0('0x2c')](getAssociatedResources('ChatQueues',_0xd5a42d[_0x88e0('0x35')],'ChatQueue'));_0x11f864[_0x88e0('0x2c')](getAssociatedResources(_0x88e0('0xa'),_0xd5a42d['userProfileId'],_0x88e0('0x2f')));_0x11f864[_0x88e0('0x2c')](getAssociatedResources('SmsQueues',_0xd5a42d[_0x88e0('0x35')],'SmsQueue'));_0x11f864['push'](getAssociatedResources('MailQueues',_0xd5a42d[_0x88e0('0x35')],_0x88e0('0x31')));_0x11f864[_0x88e0('0x2c')](getAssociatedResources(_0x88e0('0x36'),_0xd5a42d['userProfileId'],'OpenchannelQueue'));_0x11f864[_0x88e0('0x2c')](getAssociatedResources(_0x88e0('0x37'),_0xd5a42d['userProfileId'],_0x88e0('0x38')));_0x11f864['push'](getAssociatedResources(_0x88e0('0x39'),_0xd5a42d[_0x88e0('0x35')],'User'));_0x11f864['push'](getAssociatedResources(_0x88e0('0xe'),_0xd5a42d[_0x88e0('0x35')],_0x88e0('0x33')));_0x11f864['push'](getAssociatedResources('IvrCampaigns',_0xd5a42d[_0x88e0('0x35')],'Campaign'));_0x11f864[_0x88e0('0x2c')](db['User'][_0x88e0('0xd')](queryAgents));break;case _0x88e0('0x3a'):_0x5a7f39[_0x1a5e0e](_0x88e0('0x28'));_0x5a7f39[_0x1a5e0e](_0x88e0('0x29'));_0x11f864[_0x88e0('0x2c')](_0xd5a42d['getVoiceQueues']({'attributes':['id',_0x88e0('0x3')]}));_0x11f864['push'](_0xd5a42d['getChatQueues']({'attributes':['id','name']}));_0x11f864[_0x88e0('0x2c')](_0xd5a42d['getFaxQueues']({'attributes':['id',_0x88e0('0x3')]}));_0x11f864[_0x88e0('0x2c')](_0xd5a42d[_0x88e0('0x3b')]({'attributes':['id',_0x88e0('0x3')]}));_0x11f864[_0x88e0('0x2c')](_0xd5a42d[_0x88e0('0x3c')]({'attributes':['id',_0x88e0('0x3')]}));_0x11f864['push'](_0xd5a42d['getOpenchannelQueues']({'attributes':['id',_0x88e0('0x3')]}));_0x11f864[_0x88e0('0x2c')](_0xd5a42d[_0x88e0('0x3d')]({'attributes':['id',_0x88e0('0x3')]}));break;}return BPromise['all'](_0x11f864);}})[_0x88e0('0x12')](function(_0x5a8ec4){if(_0x5a8ec4&&_0x5a8ec4['length']){for(var _0x5872ef=0x0;_0x5872ef<_0x5a8ec4[_0x88e0('0x19')];_0x5872ef+=0x1){for(var _0x1f0d9c=0x0;_0x1f0d9c<_0x5a8ec4[_0x5872ef][_0x88e0('0x19')];_0x1f0d9c+=0x1){switch(_0x5872ef){case 0x0:joinOrLeaveQueues(_0x5a7f39,_0x1a5e0e,_0x88e0('0x3e'),_0x5a8ec4[_0x5872ef][_0x1f0d9c]);break;case 0x1:joinOrLeaveQueues(_0x5a7f39,_0x1a5e0e,_0x88e0('0x3f'),_0x5a8ec4[_0x5872ef][_0x1f0d9c]);break;case 0x2:joinOrLeaveQueues(_0x5a7f39,_0x1a5e0e,'fax',_0x5a8ec4[_0x5872ef][_0x1f0d9c]);break;case 0x3:joinOrLeaveQueues(_0x5a7f39,_0x1a5e0e,'sms',_0x5a8ec4[_0x5872ef][_0x1f0d9c]);break;case 0x4:joinOrLeaveQueues(_0x5a7f39,_0x1a5e0e,_0x88e0('0x40'),_0x5a8ec4[_0x5872ef][_0x1f0d9c]);break;case 0x5:joinOrLeaveQueues(_0x5a7f39,_0x1a5e0e,_0x88e0('0x41'),_0x5a8ec4[_0x5872ef][_0x1f0d9c]);break;case 0x6:joinOrLeaveQueues(_0x5a7f39,_0x1a5e0e,_0x88e0('0x42'),_0x5a8ec4[_0x5872ef][_0x1f0d9c]);break;case 0x7:if(_0x350c4c['role']!==_0x88e0('0x3a'))_0x5a7f39[_0x1a5e0e](util[_0x88e0('0x16')](_0x88e0('0x43'),_0x5a8ec4[_0x5872ef][_0x1f0d9c][_0x88e0('0x3')]));break;case 0x8:if(_0x350c4c['role']!==_0x88e0('0x3a'))_0x5a7f39[_0x1a5e0e](util[_0x88e0('0x16')](_0x88e0('0x44'),_0x5a8ec4[_0x5872ef][_0x1f0d9c]['name']));break;case 0x9:if(_0x350c4c[_0x88e0('0x14')]!==_0x88e0('0x3a'))_0x5a7f39[_0x1a5e0e](util['format']('campaign:%s:%s',_0x5a8ec4[_0x5872ef][_0x1f0d9c][_0x88e0('0x6')],_0x5a8ec4[_0x5872ef][_0x1f0d9c][_0x88e0('0x3')]));break;case 0xa:_0x5a7f39[_0x1a5e0e](util[_0x88e0('0x16')]('user:%s',_0x5a8ec4[_0x5872ef][_0x1f0d9c]['name']));break;}}}}})[_0x88e0('0x12')](function(){if(_0x1a5e0e===_0x88e0('0x45')){var _0x593b9e=_['map'](_0x350c4c[_0x88e0('0x46')],'id');return _0x350c4c[_0x88e0('0x47')](_0x593b9e)[_0x88e0('0x12')](function(){for(var _0x4922f4=0x0;_0x4922f4<_0x593b9e[_0x88e0('0x19')];_0x4922f4+=0x1){_0x3f2726[_0x88e0('0x48')](_0x88e0('0x49'),{'ChatInteractionId':Number(_0x593b9e[_0x4922f4]),'UserId':Number(_0x350c4c['id'])});}});}})[_0x88e0('0x12')](function(){if(_0x1a5e0e===_0x88e0('0x45')){var _0x183e53=_['map'](_0x350c4c['MailInteractions'],'id');return _0x350c4c[_0x88e0('0x4a')](_0x183e53)[_0x88e0('0x12')](function(){for(var _0x586197=0x0;_0x586197<_0x183e53['length'];_0x586197+=0x1){_0x3f2726[_0x88e0('0x48')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x183e53[_0x586197]),'UserId':Number(_0x350c4c['id'])});}});}})[_0x88e0('0x12')](function(){if(_0x1a5e0e===_0x88e0('0x45')){var _0x499cf5=_['map'](_0x350c4c[_0x88e0('0x22')],'id');return _0x350c4c[_0x88e0('0x4b')](_0x499cf5)[_0x88e0('0x12')](function(){for(var _0x41ba1e=0x0;_0x41ba1e<_0x499cf5['length'];_0x41ba1e+=0x1){_0x3f2726[_0x88e0('0x48')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x499cf5[_0x41ba1e]),'UserId':Number(_0x350c4c['id'])});}});}})[_0x88e0('0x12')](function(){if(_0x1a5e0e===_0x88e0('0x45')){var _0xcc235a=_[_0x88e0('0x13')](_0x350c4c[_0x88e0('0x24')],'id');return _0x350c4c[_0x88e0('0x4c')](_0xcc235a)[_0x88e0('0x12')](function(){for(var _0x27cf2c=0x0;_0x27cf2c<_0xcc235a['length'];_0x27cf2c+=0x1){_0x3f2726[_0x88e0('0x48')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xcc235a[_0x27cf2c]),'UserId':Number(_0x350c4c['id'])});}});}})[_0x88e0('0x12')](function(){if(_0x1a5e0e===_0x88e0('0x45')){var _0x748bf=_['map'](_0x350c4c[_0x88e0('0x4d')],'id');return _0x350c4c[_0x88e0('0x4e')](_0x748bf)['then'](function(){for(var _0x553bfd=0x0;_0x553bfd<_0x748bf[_0x88e0('0x19')];_0x553bfd+=0x1){_0x3f2726['emit'](_0x88e0('0x4f'),{'OpenchannelInteractionId':Number(_0x748bf[_0x553bfd]),'UserId':Number(_0x350c4c['id'])});}});}})[_0x88e0('0x12')](function(){if(_0x1a5e0e===_0x88e0('0x45')){var _0x4b94a3=_[_0x88e0('0x13')](_0x350c4c[_0x88e0('0x27')],'id');return _0x350c4c[_0x88e0('0x50')](_0x4b94a3)['then'](function(){for(var _0x4b9f9c=0x0;_0x4b9f9c<_0x4b94a3[_0x88e0('0x19')];_0x4b9f9c+=0x1){_0x3f2726[_0x88e0('0x48')](_0x88e0('0x51'),{'WhatsappInteractionId':Number(_0x4b94a3[_0x4b9f9c]),'UserId':Number(_0x350c4c['id'])});}});}})[_0x88e0('0x52')](function(_0x463383){_0x5a7f39[_0x88e0('0x53')](_0x463383);});}}function onDisconnect(_0x5ae76f,_0x24df35){joinOrLeave(_0x5ae76f,_0x88e0('0x45'),_0x24df35);}function onConnect(_0x50ca8b){joinOrLeave(_0x50ca8b,_0x88e0('0x54'));}exports[_0x88e0('0x55')]=function(_0x11dd63){_0x11dd63['on'](_0x88e0('0x56'),function(_0xcd6ff8){_0xcd6ff8[_0x88e0('0x57')](0x0);_0xcd6ff8[_0x88e0('0x58')]=_0xcd6ff8[_0x88e0('0x59')][_0x88e0('0x56')][_0x88e0('0x5a')]+':'+_0xcd6ff8[_0x88e0('0x59')]['connection'][_0x88e0('0x5b')];_0xcd6ff8[_0x88e0('0x5c')]=new Date();_0xcd6ff8['log']=function(_0x279eb7){console['log'](_0x88e0('0x5d')+_0xcd6ff8[_0x88e0('0x5e')][_0x88e0('0x3')]+'['+_0xcd6ff8[_0x88e0('0x58')]+']',_0x279eb7);};_0xcd6ff8['on'](_0x88e0('0x5f'),function(){onDisconnect(_0xcd6ff8,_0x11dd63);_0xcd6ff8[_0x88e0('0x53')](_0x88e0('0x60'));});onConnect(_0xcd6ff8);_0xcd6ff8[_0x88e0('0x53')]('CONNECTED');});}; \ No newline at end of file +var _0x4bd3=['whatsapp','telephone:%s','trunk:%s','emit','removeMailInteractions','user_has_mail_interactions:remove','leave','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','log','connection','address','request','remotePort','connectedAt','SocketIO\x20','DISCONNECTED','lodash','bluebird','../mysqldb','User','name','role','telephone','agent','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','SmsQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','push','VoiceQueue','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','ChatQueues','FaxQueues','MailQueues','MailQueue','OpenchannelQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','fax','mail'];(function(_0x4f9608,_0x208602){var _0x42a340=function(_0x4b7205){while(--_0x4b7205){_0x4f9608['push'](_0x4f9608['shift']());}};_0x42a340(++_0x208602);}(_0x4bd3,0x174));var _0x34bd=function(_0x6a16e,_0x1a5e0f){_0x6a16e=_0x6a16e-0x0;var _0x2b5fdf=_0x4bd3[_0x6a16e];return _0x2b5fdf;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var BPromise=require(_0x34bd('0x1'));var db=require(_0x34bd('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0x34bd('0x3')],'attributes':['id',_0x34bd('0x4'),_0x34bd('0x5')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x34bd('0x4')],'where':{'role':_0x34bd('0x6')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x34bd('0x4')],'where':{'role':_0x34bd('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x34bd('0x8')],'where':{'type':_0x34bd('0x9')}};function getAssociatedResources(_0x3260ff,_0xed6181,_0x1ac77f){return db[_0x34bd('0xa')]['findOne']({'where':{'name':_0x3260ff,'userProfileId':_0xed6181},'raw':!![]})[_0x34bd('0xb')](function(_0x45322f){if(_0x45322f){if(_0x45322f[_0x34bd('0xc')]){switch(_0x3260ff){case _0x34bd('0xd'):case'ChatQueues':case'FaxQueues':case _0x34bd('0xe'):case'MailQueues':case'OpenchannelQueues':case _0x34bd('0xf'):return db[_0x1ac77f][_0x34bd('0x10')](queryQueues);case _0x34bd('0x11'):return db[_0x1ac77f][_0x34bd('0x10')](queryTelephones);case _0x34bd('0x12'):return db[_0x1ac77f][_0x34bd('0x10')](queryTrunks);case _0x34bd('0x13'):return db[_0x1ac77f][_0x34bd('0x10')](queryCampaigns);}}else{return db[_0x34bd('0x14')]['findAll']({'attributes':[_0x34bd('0x15')],'where':{'sectionId':_0x45322f['id']},'raw':!![]})['then'](function(_0x4e3886){if(_0x4e3886){var _0x6638ed={'where':{'id':_[_0x34bd('0x16')](_0x4e3886,_0x34bd('0x15'))},'raw':!![]};switch(_0x1ac77f){case _0x34bd('0x3'):_0x6638ed[_0x34bd('0x17')][_0x34bd('0x5')]=_0x34bd('0x6');break;case _0x34bd('0x18'):_0x6638ed[_0x34bd('0x17')][_0x34bd('0x8')]=_0x34bd('0x9');break;}return db[_0x1ac77f]['findAll'](_0x6638ed);}else{return[];}});}}else{return[];}})[_0x34bd('0xb')](function(_0x324f7d){return _0x324f7d;});}function joinOrLeaveQueues(_0x265e70,_0x220666,_0x3976e4,_0x23a94a){_0x265e70[_0x220666](util[_0x34bd('0x19')](_0x34bd('0x1a'),_0x3976e4,_0x23a94a[_0x34bd('0x4')]));if(_0x23a94a['Agents']){for(var _0x15c0d1=0x0;_0x15c0d1<_0x23a94a[_0x34bd('0x1b')][_0x34bd('0x1c')];_0x15c0d1+=0x1){_0x265e70[_0x220666](util[_0x34bd('0x19')](_0x34bd('0x1d'),_0x23a94a['Agents'][_0x15c0d1]['name']));}}}function joinOrLeave(_0x5da62a,_0x4edf84,_0x3dafe8){var _0x503a60;if(_0x5da62a[_0x34bd('0x1e')][_0x34bd('0x1f')]['id']){db[_0x34bd('0x3')]['find']({'attributes':['id',_0x34bd('0x4'),_0x34bd('0x5'),_0x34bd('0x20')],'where':{'id':_0x5da62a[_0x34bd('0x1e')]['query']['id']},'include':[{'model':db[_0x34bd('0x21')],'as':_0x34bd('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x34bd('0x23')],'as':_0x34bd('0x24'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x34bd('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x34bd('0x26')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x34bd('0x27')],'as':_0x34bd('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x34bd('0x29')],'as':_0x34bd('0x2a'),'attributes':['id'],'raw':!![]}]})[_0x34bd('0xb')](function(_0x4500c8){if(_0x4500c8){_0x503a60=_0x4500c8;_0x5da62a[_0x4edf84](util[_0x34bd('0x19')]('user:%s',_0x4500c8[_0x34bd('0x4')]));var _0x4156f5=[];switch(_0x4500c8['role']){case'admin':_0x5da62a[_0x4edf84](_0x34bd('0x2b'));_0x5da62a[_0x4edf84](_0x34bd('0x2c'));if(queryQueues[_0x34bd('0x2d')]('include')){delete queryQueues['include'];}_0x4156f5[_0x34bd('0x2e')](db[_0x34bd('0x2f')][_0x34bd('0x10')](queryQueues));_0x4156f5[_0x34bd('0x2e')](db['ChatQueue'][_0x34bd('0x10')](queryQueues));_0x4156f5[_0x34bd('0x2e')](db[_0x34bd('0x30')][_0x34bd('0x10')](queryQueues));_0x4156f5[_0x34bd('0x2e')](db[_0x34bd('0x31')]['findAll'](queryQueues));_0x4156f5[_0x34bd('0x2e')](db['MailQueue'][_0x34bd('0x10')](queryQueues));_0x4156f5[_0x34bd('0x2e')](db[_0x34bd('0x32')]['findAll'](queryQueues));_0x4156f5[_0x34bd('0x2e')](db[_0x34bd('0x33')]['findAll'](queryQueues));_0x4156f5[_0x34bd('0x2e')](db[_0x34bd('0x3')][_0x34bd('0x10')](queryTelephones));_0x4156f5['push'](db[_0x34bd('0x34')][_0x34bd('0x10')](queryTrunks));_0x4156f5['push'](db[_0x34bd('0x18')][_0x34bd('0x10')](queryCampaigns));_0x4156f5[_0x34bd('0x2e')](db[_0x34bd('0x3')][_0x34bd('0x10')](queryAgents));break;case _0x34bd('0x35'):_0x5da62a[_0x4edf84]('voice:inbound');_0x5da62a[_0x4edf84]('voice:outbound');_0x4156f5['push'](getAssociatedResources(_0x34bd('0xd'),_0x4500c8[_0x34bd('0x20')],'VoiceQueue'));_0x4156f5['push'](getAssociatedResources(_0x34bd('0x36'),_0x4500c8['userProfileId'],'ChatQueue'));_0x4156f5[_0x34bd('0x2e')](getAssociatedResources(_0x34bd('0x37'),_0x4500c8[_0x34bd('0x20')],_0x34bd('0x30')));_0x4156f5[_0x34bd('0x2e')](getAssociatedResources('SmsQueues',_0x4500c8['userProfileId'],_0x34bd('0x31')));_0x4156f5['push'](getAssociatedResources(_0x34bd('0x38'),_0x4500c8[_0x34bd('0x20')],_0x34bd('0x39')));_0x4156f5[_0x34bd('0x2e')](getAssociatedResources(_0x34bd('0x3a'),_0x4500c8['userProfileId'],_0x34bd('0x32')));_0x4156f5[_0x34bd('0x2e')](getAssociatedResources(_0x34bd('0xf'),_0x4500c8[_0x34bd('0x20')],'WhatsappQueue'));_0x4156f5[_0x34bd('0x2e')](getAssociatedResources('Telephones',_0x4500c8[_0x34bd('0x20')],_0x34bd('0x3')));_0x4156f5['push'](getAssociatedResources(_0x34bd('0x12'),_0x4500c8['userProfileId'],_0x34bd('0x34')));_0x4156f5[_0x34bd('0x2e')](getAssociatedResources(_0x34bd('0x13'),_0x4500c8[_0x34bd('0x20')],_0x34bd('0x18')));_0x4156f5[_0x34bd('0x2e')](db[_0x34bd('0x3')]['findAll'](queryAgents));break;case'agent':_0x5da62a[_0x4edf84]('voice:inbound');_0x5da62a[_0x4edf84](_0x34bd('0x2c'));_0x4156f5[_0x34bd('0x2e')](_0x4500c8[_0x34bd('0x3b')]({'attributes':['id',_0x34bd('0x4')]}));_0x4156f5['push'](_0x4500c8[_0x34bd('0x3c')]({'attributes':['id',_0x34bd('0x4')]}));_0x4156f5[_0x34bd('0x2e')](_0x4500c8[_0x34bd('0x3d')]({'attributes':['id',_0x34bd('0x4')]}));_0x4156f5['push'](_0x4500c8[_0x34bd('0x3e')]({'attributes':['id','name']}));_0x4156f5['push'](_0x4500c8[_0x34bd('0x3f')]({'attributes':['id','name']}));_0x4156f5[_0x34bd('0x2e')](_0x4500c8[_0x34bd('0x40')]({'attributes':['id',_0x34bd('0x4')]}));_0x4156f5[_0x34bd('0x2e')](_0x4500c8[_0x34bd('0x41')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x4156f5);}})[_0x34bd('0xb')](function(_0x51f892){if(_0x51f892&&_0x51f892[_0x34bd('0x1c')]){for(var _0x223adb=0x0;_0x223adb<_0x51f892[_0x34bd('0x1c')];_0x223adb+=0x1){for(var _0x540b04=0x0;_0x540b04<_0x51f892[_0x223adb]['length'];_0x540b04+=0x1){switch(_0x223adb){case 0x0:joinOrLeaveQueues(_0x5da62a,_0x4edf84,'voice',_0x51f892[_0x223adb][_0x540b04]);break;case 0x1:joinOrLeaveQueues(_0x5da62a,_0x4edf84,'chat',_0x51f892[_0x223adb][_0x540b04]);break;case 0x2:joinOrLeaveQueues(_0x5da62a,_0x4edf84,_0x34bd('0x42'),_0x51f892[_0x223adb][_0x540b04]);break;case 0x3:joinOrLeaveQueues(_0x5da62a,_0x4edf84,'sms',_0x51f892[_0x223adb][_0x540b04]);break;case 0x4:joinOrLeaveQueues(_0x5da62a,_0x4edf84,_0x34bd('0x43'),_0x51f892[_0x223adb][_0x540b04]);break;case 0x5:joinOrLeaveQueues(_0x5da62a,_0x4edf84,'openchannel',_0x51f892[_0x223adb][_0x540b04]);break;case 0x6:joinOrLeaveQueues(_0x5da62a,_0x4edf84,_0x34bd('0x44'),_0x51f892[_0x223adb][_0x540b04]);break;case 0x7:if(_0x503a60[_0x34bd('0x5')]!==_0x34bd('0x7'))_0x5da62a[_0x4edf84](util[_0x34bd('0x19')](_0x34bd('0x45'),_0x51f892[_0x223adb][_0x540b04]['name']));break;case 0x8:if(_0x503a60[_0x34bd('0x5')]!==_0x34bd('0x7'))_0x5da62a[_0x4edf84](util[_0x34bd('0x19')](_0x34bd('0x46'),_0x51f892[_0x223adb][_0x540b04][_0x34bd('0x4')]));break;case 0x9:if(_0x503a60['role']!==_0x34bd('0x7'))_0x5da62a[_0x4edf84](util[_0x34bd('0x19')]('campaign:%s:%s',_0x51f892[_0x223adb][_0x540b04][_0x34bd('0x8')],_0x51f892[_0x223adb][_0x540b04][_0x34bd('0x4')]));break;case 0xa:_0x5da62a[_0x4edf84](util['format']('user:%s',_0x51f892[_0x223adb][_0x540b04][_0x34bd('0x4')]));break;}}}}})['then'](function(){if(_0x4edf84==='leave'){var _0x2fb748=_[_0x34bd('0x16')](_0x503a60['ChatInteractions'],'id');return _0x503a60['removeChatInteractions'](_0x2fb748)['then'](function(){for(var _0x4f4ce8=0x0;_0x4f4ce8<_0x2fb748[_0x34bd('0x1c')];_0x4f4ce8+=0x1){_0x3dafe8[_0x34bd('0x47')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x2fb748[_0x4f4ce8]),'UserId':Number(_0x503a60['id'])});}});}})['then'](function(){if(_0x4edf84==='leave'){var _0x477fd4=_[_0x34bd('0x16')](_0x503a60['MailInteractions'],'id');return _0x503a60[_0x34bd('0x48')](_0x477fd4)[_0x34bd('0xb')](function(){for(var _0x3f714b=0x0;_0x3f714b<_0x477fd4[_0x34bd('0x1c')];_0x3f714b+=0x1){_0x3dafe8[_0x34bd('0x47')](_0x34bd('0x49'),{'MailInteractionId':Number(_0x477fd4[_0x3f714b]),'UserId':Number(_0x503a60['id'])});}});}})['then'](function(){if(_0x4edf84===_0x34bd('0x4a')){var _0xb45b50=_[_0x34bd('0x16')](_0x503a60[_0x34bd('0x25')],'id');return _0x503a60['removeFaxInteractions'](_0xb45b50)[_0x34bd('0xb')](function(){for(var _0x5235e4=0x0;_0x5235e4<_0xb45b50[_0x34bd('0x1c')];_0x5235e4+=0x1){_0x3dafe8['emit'](_0x34bd('0x4b'),{'FaxInteractionId':Number(_0xb45b50[_0x5235e4]),'UserId':Number(_0x503a60['id'])});}});}})[_0x34bd('0xb')](function(){if(_0x4edf84===_0x34bd('0x4a')){var _0xc7c58a=_[_0x34bd('0x16')](_0x503a60[_0x34bd('0x4c')],'id');return _0x503a60[_0x34bd('0x4d')](_0xc7c58a)[_0x34bd('0xb')](function(){for(var _0x4768f8=0x0;_0x4768f8<_0xc7c58a[_0x34bd('0x1c')];_0x4768f8+=0x1){_0x3dafe8[_0x34bd('0x47')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xc7c58a[_0x4768f8]),'UserId':Number(_0x503a60['id'])});}});}})[_0x34bd('0xb')](function(){if(_0x4edf84==='leave'){var _0x15fea7=_['map'](_0x503a60[_0x34bd('0x28')],'id');return _0x503a60['removeOpenchannelInteractions'](_0x15fea7)[_0x34bd('0xb')](function(){for(var _0x274ec9=0x0;_0x274ec9<_0x15fea7[_0x34bd('0x1c')];_0x274ec9+=0x1){_0x3dafe8[_0x34bd('0x47')](_0x34bd('0x4e'),{'OpenchannelInteractionId':Number(_0x15fea7[_0x274ec9]),'UserId':Number(_0x503a60['id'])});}});}})[_0x34bd('0xb')](function(){if(_0x4edf84===_0x34bd('0x4a')){var _0xeffa5d=_[_0x34bd('0x16')](_0x503a60[_0x34bd('0x2a')],'id');return _0x503a60[_0x34bd('0x4f')](_0xeffa5d)[_0x34bd('0xb')](function(){for(var _0x134fe0=0x0;_0x134fe0<_0xeffa5d[_0x34bd('0x1c')];_0x134fe0+=0x1){_0x3dafe8[_0x34bd('0x47')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0xeffa5d[_0x134fe0]),'UserId':Number(_0x503a60['id'])});}});}})['catch'](function(_0x246c52){_0x5da62a[_0x34bd('0x50')](_0x246c52);});}}function onDisconnect(_0x352f17,_0x3e8c8e){joinOrLeave(_0x352f17,_0x34bd('0x4a'),_0x3e8c8e);}function onConnect(_0x5d4833){joinOrLeave(_0x5d4833,'join');}exports['default']=function(_0x49f095){_0x49f095['on'](_0x34bd('0x51'),function(_0x19fde8){_0x19fde8['setMaxListeners'](0x0);_0x19fde8[_0x34bd('0x52')]=_0x19fde8[_0x34bd('0x53')][_0x34bd('0x51')]['remoteAddress']+':'+_0x19fde8[_0x34bd('0x53')][_0x34bd('0x51')][_0x34bd('0x54')];_0x19fde8[_0x34bd('0x55')]=new Date();_0x19fde8[_0x34bd('0x50')]=function(_0x26e763){console[_0x34bd('0x50')](_0x34bd('0x56')+_0x19fde8['nsp']['name']+'['+_0x19fde8[_0x34bd('0x52')]+']',_0x26e763);};_0x19fde8['on']('disconnect',function(){onDisconnect(_0x19fde8,_0x49f095);_0x19fde8[_0x34bd('0x50')](_0x34bd('0x57'));});onConnect(_0x19fde8);_0x19fde8[_0x34bd('0x50')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index ea1459f..0d4ffb6 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 _0xa059=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','UserId','interface','format','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','contact','undefined','SIP/%s','AfterCreate','changed','closed','substatus','User','find','fullname','email','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','client','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage','SmsInteraction','Sms','SmsMessage','WhatsappInteraction','Whatsapp','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','direction','resolve'];(function(_0x30ee68,_0x5a5428){var _0x12b9d7=function(_0x15a8ad){while(--_0x15a8ad){_0x30ee68['push'](_0x30ee68['shift']());}};_0x12b9d7(++_0x5a5428);}(_0xa059,0x1e5));var _0x9a05=function(_0x17fa93,_0x394798){_0x17fa93=_0x17fa93-0x0;var _0xebbdb4=_0xa059[_0x17fa93];return _0xebbdb4;};'use strict';var util=require(_0x9a05('0x0'));var db=require(_0x9a05('0x1'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')('triggers');var client=jayson[_0x9a05('0x2')][_0x9a05('0x3')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x9a05('0x4'),'event':_0x9a05('0x5'),'condition':_0x9a05('0x6'),'callback':afterCreate},{'channel':_0x9a05('0x7'),'model':_0x9a05('0x4'),'event':_0x9a05('0x8'),'condition':_0x9a05('0x9'),'callback':afterUpdate},{'channel':'Chat','model':_0x9a05('0xa'),'event':_0x9a05('0x5'),'condition':_0x9a05('0xb'),'callback':afterCreateMessage},{'channel':_0x9a05('0x7'),'model':'ChatOfflineMessage','event':_0x9a05('0x5'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':'Sms','model':'SmsInteraction','event':'afterCreate','condition':_0x9a05('0x6'),'callback':afterCreate},{'channel':'Sms','model':_0x9a05('0xc'),'event':_0x9a05('0x8'),'condition':_0x9a05('0x9'),'callback':afterUpdate},{'channel':_0x9a05('0xd'),'model':_0x9a05('0xe'),'event':_0x9a05('0x5'),'condition':_0x9a05('0xb'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x9a05('0xf'),'event':'afterCreate','condition':_0x9a05('0x6'),'callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0x9a05('0x8'),'condition':_0x9a05('0x9'),'callback':afterUpdate},{'channel':_0x9a05('0x10'),'model':_0x9a05('0x11'),'event':'afterCreate','condition':_0x9a05('0xb'),'callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0x9a05('0x5'),'condition':_0x9a05('0x6'),'callback':afterCreate},{'channel':_0x9a05('0x12'),'model':_0x9a05('0x13'),'event':_0x9a05('0x8'),'condition':_0x9a05('0x9'),'callback':afterUpdate},{'channel':_0x9a05('0x12'),'model':_0x9a05('0x14'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x9a05('0x15'),'model':_0x9a05('0x16'),'event':_0x9a05('0x5'),'condition':_0x9a05('0x6'),'callback':afterCreate},{'channel':_0x9a05('0x15'),'model':_0x9a05('0x16'),'event':_0x9a05('0x8'),'condition':_0x9a05('0x9'),'callback':afterUpdate},{'channel':_0x9a05('0x15'),'model':_0x9a05('0x17'),'event':'afterCreate','condition':_0x9a05('0xb'),'callback':afterCreateMessage},{'channel':_0x9a05('0x18'),'model':'OpenchannelInteraction','event':_0x9a05('0x5'),'condition':_0x9a05('0x6'),'callback':afterCreate},{'channel':_0x9a05('0x18'),'model':_0x9a05('0x19'),'event':_0x9a05('0x8'),'condition':_0x9a05('0x9'),'callback':afterUpdate},{'channel':_0x9a05('0x18'),'model':_0x9a05('0x1a'),'event':_0x9a05('0x5'),'condition':_0x9a05('0xb'),'callback':afterCreateMessage}];function request(_0x3afa4d){return client['request'](_0x9a05('0x1b'),_0x3afa4d)[_0x9a05('0x1c')](function(_0x3999c2){logger[_0x9a05('0x1d')](_0x9a05('0x1e'),_0x9a05('0x1b'),_0x3999c2);if(_0x3999c2[_0x9a05('0x1f')]){if(_0x3999c2[_0x9a05('0x1f')][_0x9a05('0x20')]===0x1f4){logger[_0x9a05('0x1f')]('Trigger,\x20%s','EventManager',_0x3999c2[_0x9a05('0x1f')]);}}})[_0x9a05('0x21')](function(_0x364b8e){logger[_0x9a05('0x1f')]('Trigger,\x20%s',_0x9a05('0x1b'),_0x364b8e);});}function afterCreateMessage(_0x4c1497){return function(_0xac1534){_0xac1534=_0xac1534[_0x9a05('0x22')]({'plain':!![]});_0xac1534[_0x9a05('0x23')]=_0x4c1497;_0xac1534[_0x9a05('0x24')]=_0x4c1497;_0xac1534[_0x9a05('0x25')]=_0xac1534[_0x9a05('0x26')];Promise[_0x9a05('0x27')]()[_0x9a05('0x1c')](function(){if(typeof _0xac1534['ContactId']==='undefined')return null;var _0x1380d2=_0x9a05('0x28')+_0xac1534[_0x9a05('0x29')];return db[_0x9a05('0x2a')][_0x9a05('0x2b')](_0x1380d2,{'type':db[_0x9a05('0x2c')][_0x9a05('0x2d')][_0x9a05('0x2e')],'raw':!![]});})[_0x9a05('0x1c')](function(_0x4dff8b){if(_0x4dff8b){_0xac1534['contact']=_0x4dff8b[0x0];}if(typeof _0xac1534[_0x9a05('0x2f')]==='undefined')return;return getAgent(_0xac1534[_0x9a05('0x2f')]);})[_0x9a05('0x1c')](function(_0x58cc01){if(_0x58cc01){_0xac1534[_0x9a05('0x30')]=util[_0x9a05('0x31')]('SIP/%s',_0x58cc01[_0x9a05('0x32')]);_0xac1534[_0x9a05('0x33')]=_0x58cc01;_0xac1534['channel']=_0x4c1497;return request({'event':_0x9a05('0x34'),'message':_0xac1534});}else{return request({'event':_0x9a05('0x35'),'message':_0xac1534});}})['catch'](function(_0x51db18){logger[_0x9a05('0x1f')](_0x9a05('0x1e'),_0x9a05('0x36'),_0x51db18);});};}function afterCreateOfflineMessage(_0x2fd901){return function(_0x7bbe43){_0x7bbe43=_0x7bbe43['get']({'plain':!![]});_0x7bbe43[_0x9a05('0x23')]=_0x2fd901;_0x7bbe43[_0x9a05('0x24')]=_0x2fd901;_0x7bbe43[_0x9a05('0x25')]=_0x9a05('0x37');return request({'event':_0x7bbe43[_0x9a05('0x25')],'message':_0x7bbe43});};}function afterCreate(_0x3c072c,_0x37ca7e){return function(_0x31a765){_0x31a765=_0x31a765['get']({'plain':!![]});_0x31a765[_0x9a05('0x23')]=_0x3c072c;_0x31a765[_0x9a05('0x24')]=_0x3c072c;_0x31a765[_0x9a05('0x25')]='opened';Promise[_0x9a05('0x27')]()[_0x9a05('0x1c')](function(){var _0x33d549=_0x9a05('0x28')+_0x31a765[_0x9a05('0x29')];return db[_0x9a05('0x2a')][_0x9a05('0x2b')](_0x33d549,{'type':db[_0x9a05('0x2c')]['QueryTypes']['SELECT'],'raw':!![]});})['then'](function(_0x30c32a){if(_0x30c32a){_0x31a765[_0x9a05('0x38')]=_0x30c32a[0x0];}if(typeof _0x31a765[_0x9a05('0x2f')]===_0x9a05('0x39'))return;return getAgent(_0x31a765['UserId']);})[_0x9a05('0x1c')](function(_0x56ac8a){if(_0x56ac8a){_0x31a765[_0x9a05('0x30')]=util[_0x9a05('0x31')](_0x9a05('0x3a'),_0x56ac8a[_0x9a05('0x32')]);_0x31a765[_0x9a05('0x33')]=_0x56ac8a;}return request({'event':_0x37ca7e,'message':_0x31a765});})['catch'](function(_0x32108c){logger[_0x9a05('0x1f')](_0x9a05('0x1e'),_0x9a05('0x3b'),_0x32108c);});};}function afterUpdate(_0xe9feb9){return function(_0x13b097){var _0x456aec=_0x13b097[_0x9a05('0x3c')](_0x9a05('0x3d'))&&_0x13b097[_0x9a05('0x3d')];var _0x416923=_0x13b097['changed'](_0x9a05('0x3e'));if(_0x456aec||_0x416923){var _0x24c5c4=_0x456aec?_0x9a05('0x9'):'substatus';var _0x3bee85=_0x13b097[_0x9a05('0x22')]({'plain':!![]});_0x3bee85['channel']=_0xe9feb9;_0x3bee85['motionChannel']=_0xe9feb9;_0x3bee85[_0x9a05('0x25')]=_0x456aec?_0x9a05('0x3d'):_0x9a05('0x3e');var _0x5dedc9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3bee85[_0x9a05('0x29')];return db[_0x9a05('0x2a')]['query'](_0x5dedc9,{'type':db[_0x9a05('0x2c')]['QueryTypes'][_0x9a05('0x2e')],'raw':!![]})[_0x9a05('0x1c')](function(_0x5ecef4){if(_0x5ecef4){_0x3bee85[_0x9a05('0x38')]=_0x5ecef4[0x0];}if(typeof _0x3bee85[_0x9a05('0x2f')]===_0x9a05('0x39'))return;return getAgent(_0x3bee85[_0x9a05('0x2f')]);})[_0x9a05('0x1c')](function(_0x24fc03){if(_0x24fc03){_0x3bee85[_0x9a05('0x30')]=util[_0x9a05('0x31')](_0x9a05('0x3a'),_0x24fc03[_0x9a05('0x32')]);_0x3bee85[_0x9a05('0x33')]=_0x24fc03;}return request({'event':_0x24c5c4,'message':_0x3bee85});})['catch'](function(_0x237b4c){logger['error'](_0x9a05('0x1e'),'AfterUpdate',_0x237b4c);});}};}function getAgent(_0x53f390){return db[_0x9a05('0x3f')][_0x9a05('0x40')]({'where':{'id':_0x53f390},'attributes':['id',_0x9a05('0x32'),_0x9a05('0x41'),_0x9a05('0x42'),'internal'],'raw':!![]})['then'](function(_0x3d235f){return _0x3d235f;});}exports[_0x9a05('0x43')]=function(){for(var _0x2dad2c=0x0;_0x2dad2c=_0x2e43fe[_0xee2f('0x15')]){throw Error(_0xee2f('0x16'));}_0x5975c9(_0x5505ae);})[_0xee2f('0x17')](function(_0x30b9ee){_0x11d4c9(_0x30b9ee);});});}; \ No newline at end of file +var _0xaf92=['toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','bluebird','voice','mail','chat','sms','whatsapp','openchannel','isValidChannel'];(function(_0x179e13,_0x5832db){var _0x52b568=function(_0x305ec0){while(--_0x305ec0){_0x179e13['push'](_0x179e13['shift']());}};_0x52b568(++_0x5832db);}(_0xaf92,0x187));var _0x2af9=function(_0x343d36,_0x5f248a){_0x343d36=_0x343d36-0x0;var _0x3bd305=_0xaf92[_0x343d36];return _0x3bd305;};'use strict';var _=require('lodash');var BPromise=require(_0x2af9('0x0'));var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=[_0x2af9('0x1'),_0x2af9('0x2'),_0x2af9('0x3'),'fax',_0x2af9('0x4'),_0x2af9('0x5'),_0x2af9('0x6')];exports['getChannels']=function(){return channels;};exports[_0x2af9('0x7')]=function(_0x3bf89b){_0x3bf89b=_0x3bf89b[_0x2af9('0x8')]();return _[_0x2af9('0x9')](channels,_0x3bf89b);};exports[_0x2af9('0xa')]=function(_0x3a2b71,_0x19aaa4,_0x42acaf,_0x5ec28a){var _0x546fdd={'loginAttempts':_0x19aaa4,'blocked':_0x42acaf};if(!_[_0x2af9('0xb')](_0x5ec28a)){_0x546fdd[_0x2af9('0xc')]=_0x5ec28a;}return _0x3a2b71[_0x2af9('0xd')](_0x546fdd);};exports[_0x2af9('0xe')]=function(_0x31a5e5){return new BPromise(function(_0xa5bdab,_0x803182){var _0x4a5f79=0x0;if(_0x31a5e5[_0x2af9('0xf')]!==_0x2af9('0x10')){_0xa5bdab(_0x31a5e5);}db[_0x2af9('0x11')][_0x2af9('0x12')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x31a5e5['id']}}})[_0x2af9('0x13')](function(_0x5a3ff4){_0x4a5f79=_0x5a3ff4;return util[_0x2af9('0xe')]();})[_0x2af9('0x13')](function(_0x43e3f3){if(_0x43e3f3&&_0x43e3f3[_0x2af9('0x14')]&&_0x4a5f79>=_0x43e3f3[_0x2af9('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0xa5bdab(_0x31a5e5);})['catch'](function(_0x18444b){_0x803182(_0x18444b);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 17f8173..b1ba95f 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0be=['send','exports','404','status','json'];(function(_0x1482e2,_0x18b795){var _0x55cf77=function(_0x43ceca){while(--_0x43ceca){_0x1482e2['push'](_0x1482e2['shift']());}};_0x55cf77(++_0x18b795);}(_0xd0be,0x1a0));var _0xed0b=function(_0x7767c3,_0x4825ac){_0x7767c3=_0x7767c3-0x0;var _0x1f22a1=_0xd0be[_0x7767c3];return _0x1f22a1;};'use strict';module[_0xed0b('0x0')][0x194]=function pageNotFound(_0x15506c,_0x45e72e){var _0xce0e11=_0xed0b('0x1');var _0x176f81=0x194;var _0x442e1b={'status':_0x176f81};_0x45e72e[_0xed0b('0x2')](_0x442e1b['status']);_0x45e72e['render'](_0xce0e11,{},function(_0x52161d,_0x28c679){if(_0x52161d){return _0x45e72e[_0xed0b('0x2')](_0x442e1b[_0xed0b('0x2')])[_0xed0b('0x3')](_0x442e1b);}_0x45e72e[_0xed0b('0x4')](_0x28c679);});}; \ No newline at end of file +var _0x9adb=['exports','404','status','json','send'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x9adb,0x104));var _0xb9ad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9adb[_0x20a584];return _0x4b41a8;};'use strict';module[_0xb9ad('0x0')][0x194]=function pageNotFound(_0x5ac92a,_0x3aa6e6){var _0x2f4e40=_0xb9ad('0x1');var _0x5de681=0x194;var _0x4e423f={'status':_0x5de681};_0x3aa6e6[_0xb9ad('0x2')](_0x4e423f['status']);_0x3aa6e6['render'](_0x2f4e40,{},function(_0x3ff72e,_0x42b26b){if(_0x3ff72e){return _0x3aa6e6[_0xb9ad('0x2')](_0x4e423f[_0xb9ad('0x2')])[_0xb9ad('0x3')](_0x4e423f);}_0x3aa6e6[_0xb9ad('0x4')](_0x42b26b);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index f9c68ba..94eea02 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb018=['../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../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','UserSetting','../api/user-setting/user-setting.model','cascade','hasOne','userSetting','UserId','hasMany','UserVoiceQueueRt','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','ReportAgentPreview','OpenchannelInteractions','SmsInteraction','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','UserProfile','userProfileId','belongsToMany','Contacts','cm_user_has_contacts','CmList','Lists','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueues','cm_user_has_lists','user_has_chat_websites','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccount','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperFinal','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','List','TemplateId','Agents','team_has_mail_queues','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','MailInteractionId','ChatWebsite','ChatWebsiteId','ChatOfflineMessageId','TagId','MailQueueReport','ListId','Items','FaxAccountId','Interactions','Exntensions','FaxInteractionId','fax_interaction_has_tags','Interaction','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','UserSmsQueue','SmsQueueId','Teams','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','ChatProactiveAction','ProactiveActions','ChatApplication','Agent','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','UserChatQueue','team_has_chat_queues','ChatInternalMessage','ChatGroupId','chat_group_has_users','CompanyId','Company','cm_contact_has_tags','Queue','CampaignId','OwnerId','AutomationAllId','Any','OneAny','AutomationAnyId','Action','Actions','ParentId','MailApplications','ChatApplications','FaxApplications','CustomReportId','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','AnalyticFieldReport','Fields','MetricId','Configurations','Subjects','SubjectId','DescriptionId','FieldId','AccountId','Subject','Description','Field','VariableId','Descriptions','int_desk_configuration_has_tags','ZohoAccount','ZendeskAccount','int_zendesk_configuration_has_tags','ServicenowConfiguration','ServicenowField','Dynamics365Field','FromId','ToId','SessionId','SmsQueueReport','ProjectId','user_has_teams','team_has_whatsapp_queues','SquareProjectId','MailTransferReport','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','FromChatWebsiteId','ToChatQueueId','ToQueue','ToChatWebsiteId','ToAccount','FaxTransferReport','FromFaxAccountId','FromAgent','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','../config/environment','lodash','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','utf8_general_ci','database','username','password','options','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatInteraction','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','IntegrationReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','FreshsalesAccount','FreshsalesConfiguration','FreshsalesField','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport'];(function(_0x3cadb5,_0x2fd2ee){var _0x2becc7=function(_0x545e0e){while(--_0x545e0e){_0x3cadb5['push'](_0x3cadb5['shift']());}};_0x2becc7(++_0x2fd2ee);}(_0xb018,0x111));var _0x8b01=function(_0x58eaad,_0x44c090){_0x58eaad=_0x58eaad-0x0;var _0x4fbe46=_0xb018[_0x58eaad];return _0x4fbe46;};'use strict';var config=require(_0x8b01('0x0'));var Sequelize=require('sequelize');var _=require(_0x8b01('0x1'));var jstz=require(_0x8b01('0x2'));var timezone=jstz[_0x8b01('0x3')]();config[_0x8b01('0x4')]=_[_0x8b01('0x5')](config['sequelize'],{'database':_0x8b01('0x6'),'username':_0x8b01('0x7'),'password':_0x8b01('0x8'),'options':{'host':_0x8b01('0x9'),'port':0xcea,'dialect':_0x8b01('0xa'),'dialectOptions':{'charset':_0x8b01('0xb')},'logging':![],'timezone':timezone[_0x8b01('0xc')](),'define':{'charset':_0x8b01('0xd'),'collate':'utf8_general_ci'}}});config[_0x8b01('0xe')]=_[_0x8b01('0x5')](config['sequelizeHistory'],{'database':_0x8b01('0x6'),'username':_0x8b01('0x7'),'password':'xC@LL1234','options':{'host':_0x8b01('0x9'),'port':0xcea,'dialect':_0x8b01('0xa'),'dialectOptions':{'charset':_0x8b01('0xb')},'logging':![],'timezone':timezone[_0x8b01('0xc')](),'define':{'charset':'utf8','collate':_0x8b01('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8b01('0x4')][_0x8b01('0x10')],config[_0x8b01('0x4')][_0x8b01('0x11')],config[_0x8b01('0x4')]['password'],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8b01('0xe')][_0x8b01('0x10')],config[_0x8b01('0xe')][_0x8b01('0x11')],config[_0x8b01('0xe')][_0x8b01('0x12')],config[_0x8b01('0xe')][_0x8b01('0x13')])};db[_0x8b01('0x14')]=db[_0x8b01('0x4')]['import'](_0x8b01('0x15'));db[_0x8b01('0x16')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x18'));db['VoiceContext']=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x19'));db['VoiceMusicOnHold']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x1a'));db[_0x8b01('0x1b')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x1c'));db[_0x8b01('0x1d')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x1e'));db['ScreenRecording']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x1f'));db[_0x8b01('0x20')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x21'));db[_0x8b01('0x22')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x23'));db[_0x8b01('0x24')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x25'));db['VoiceDialReport']=db[_0x8b01('0x4')]['import'](_0x8b01('0x26'));db[_0x8b01('0x27')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x28'));db[_0x8b01('0x29')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x2a'));db['MemberReport']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x2b'));db[_0x8b01('0x2c')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x2d'));db['VoiceTransferReport']=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x2e'));db['UserVoiceQueueRt']=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x2f'));db[_0x8b01('0x30')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/userVoiceQueue/userVoiceQueue.model');db['UserChatQueue']=db['sequelize']['import'](_0x8b01('0x31'));db[_0x8b01('0x32')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x33'));db[_0x8b01('0x34')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/userFaxQueue/userFaxQueue.model');db['UserSmsQueue']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x35'));db[_0x8b01('0x36')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x8b01('0x37')]=db[_0x8b01('0x4')]['import'](_0x8b01('0x38'));db[_0x8b01('0x39')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x3a'));db[_0x8b01('0x3b')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x3c'));db['MailAccount']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x3d'));db[_0x8b01('0x3e')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x3f'));db['MailSubstatus']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x40'));db[_0x8b01('0x41')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x42'));db[_0x8b01('0x43')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x44'));db[_0x8b01('0x45')]=db[_0x8b01('0x4')]['import']('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x46'));db[_0x8b01('0x47')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x48'));db[_0x8b01('0x49')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/dashboardItem/dashboardItem.model');db[_0x8b01('0x4a')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x4b'));db[_0x8b01('0x4c')]=db[_0x8b01('0x4')]['import'](_0x8b01('0x4d'));db['FaxInteraction']=db['sequelize']['import'](_0x8b01('0x4e'));db[_0x8b01('0x4f')]=db['sequelize']['import']('../api/faxMessage/faxMessage.model');db[_0x8b01('0x50')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x51'));db['FaxQueueReport']=db[_0x8b01('0x4')]['import'](_0x8b01('0x52'));db[_0x8b01('0x53')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/smsAccount/smsAccount.model');db[_0x8b01('0x54')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x55'));db['SmsInteraction']=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x56'));db['SmsQueue']=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x57'));db['OpenchannelAccount']=db['sequelize'][_0x8b01('0x17')]('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x58'));db[_0x8b01('0x59')]=db[_0x8b01('0x4')]['import'](_0x8b01('0x5a'));db[_0x8b01('0x5b')]=db['sequelize']['import']('../api/openchannelMessage/openchannelMessage.model');db[_0x8b01('0x5c')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x5d'));db[_0x8b01('0x5e')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x5f'));db['ChatApplication']=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/chatApplication/chatApplication.model');db[_0x8b01('0x60')]=db[_0x8b01('0x4')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x8b01('0x61')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/chatMessage/chatMessage.model');db[_0x8b01('0x62')]=db[_0x8b01('0x4')]['import'](_0x8b01('0x63'));db[_0x8b01('0x64')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x65'));db[_0x8b01('0x66')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x67'));db['ChatProactiveAction']=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x68'));db[_0x8b01('0x69')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x6a'));db[_0x8b01('0x6b')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x6c'));db[_0x8b01('0x6d')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x6e'));db[_0x8b01('0x6f')]=db['sequelize'][_0x8b01('0x17')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0x8b01('0x4')]['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0x8b01('0x70')]=db[_0x8b01('0x4')]['import'](_0x8b01('0x71'));db['ReportAgentPreview']=db['sequelize'][_0x8b01('0x17')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize']['import'](_0x8b01('0x72'));db['Action']=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x73'));db[_0x8b01('0x74')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x75'));db[_0x8b01('0x76')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x77'));db[_0x8b01('0x78')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x79'));db[_0x8b01('0x7a')]=db[_0x8b01('0x4')]['import'](_0x8b01('0x7b'));db['Interval']=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/interval/interval.model');db[_0x8b01('0x7c')]=db[_0x8b01('0x4')]['import'](_0x8b01('0x7d'));db[_0x8b01('0x7e')]=db[_0x8b01('0x4')]['import'](_0x8b01('0x7f'));db['VoiceQueuesLog']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x80'));db[_0x8b01('0x81')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x82'));db[_0x8b01('0x83')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x84'));db[_0x8b01('0x85')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x86'));db[_0x8b01('0x87')]=db[_0x8b01('0x4')]['import'](_0x8b01('0x88'));db[_0x8b01('0x89')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x8a'));db[_0x8b01('0x8b')]=db[_0x8b01('0x4')]['import']('../api/variable/variable.model');db['Integration']=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/integration/integration.model');db[_0x8b01('0x8c')]=db['sequelize'][_0x8b01('0x17')]('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x8b01('0x8d')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x8e'));db[_0x8b01('0x8f')]=db['sequelize'][_0x8b01('0x17')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x8b01('0x90')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x91'));db[_0x8b01('0x92')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x93'));db[_0x8b01('0x94')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x95'));db[_0x8b01('0x96')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x97'));db[_0x8b01('0x98')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x99'));db[_0x8b01('0x9a')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x9b'));db[_0x8b01('0x9c')]=db['sequelize']['import'](_0x8b01('0x9d'));db[_0x8b01('0x9e')]=db[_0x8b01('0x4')]['import'](_0x8b01('0x9f'));db[_0x8b01('0xa0')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/intDeskAccount/intDeskAccount.model');db[_0x8b01('0xa1')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xa2'));db[_0x8b01('0xa3')]=db[_0x8b01('0x4')]['import'](_0x8b01('0xa4'));db['ZohoAccount']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xa5'));db[_0x8b01('0xa6')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x8b01('0xa7')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xa8'));db['ZendeskAccount']=db['sequelize'][_0x8b01('0x17')](_0x8b01('0xa9'));db[_0x8b01('0xaa')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xab'));db[_0x8b01('0xac')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xad'));db[_0x8b01('0xae')]=db[_0x8b01('0x4')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x8b01('0xaf')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xb0'));db[_0x8b01('0xb1')]=db[_0x8b01('0x4')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0x8b01('0x4')]['import'](_0x8b01('0xb2'));db[_0x8b01('0xb3')]=db[_0x8b01('0x4')]['import'](_0x8b01('0xb4'));db[_0x8b01('0xb5')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xb6'));db[_0x8b01('0xb7')]=db[_0x8b01('0x4')]['import']('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xb8'));db[_0x8b01('0xb9')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xba'));db[_0x8b01('0xbb')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xbc'));db['Dynamics365Field']=db['sequelize'][_0x8b01('0x17')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x8b01('0xbd')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x8b01('0xbe')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x8b01('0xbf')]=db[_0x8b01('0x4')]['import']('../api/intFreshsalesField/intFreshsalesField.model');db[_0x8b01('0xc0')]=db[_0x8b01('0x4')]['import']('../api/integration/integration.model');db[_0x8b01('0xc1')]=db[_0x8b01('0x4')]['import'](_0x8b01('0xc2'));db[_0x8b01('0xc3')]=db[_0x8b01('0x4')]['import'](_0x8b01('0xc4'));db['ChatInternalMessage']=db['sequelize'][_0x8b01('0x17')](_0x8b01('0xc5'));db[_0x8b01('0xc6')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xc7'));db[_0x8b01('0xc8')]=db[_0x8b01('0x4')]['import'](_0x8b01('0xc9'));db[_0x8b01('0xca')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xcb'));db['SmsQueueReport']=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/smsQueueReport/smsQueueReport.model');db[_0x8b01('0xcc')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xcd'));db[_0x8b01('0xce')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0xcf'));db[_0x8b01('0xd0')]=db[_0x8b01('0x4')]['import'](_0x8b01('0xd1'));db['Setting']=db['sequelize'][_0x8b01('0x17')](_0x8b01('0xd2'));db['SquareOdbc']=db[_0x8b01('0x4')]['import']('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xd3'));db[_0x8b01('0xd4')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/squareRecording/squareRecording.model');db[_0x8b01('0xd5')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xd6'));db[_0x8b01('0xd7')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xd8'));db['License']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xd9'));db[_0x8b01('0xda')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/campaign/campaign.model');db[_0x8b01('0xdb')]=db['sequelize']['import'](_0x8b01('0xdc'));db[_0x8b01('0xdd')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xde'));db['Plugin']=db[_0x8b01('0x4')]['import']('../api/plugin/plugin.model');db['MailTransferReport']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xdf'));db[_0x8b01('0xe0')]=db[_0x8b01('0x4')][_0x8b01('0x17')]('../api/chatTransferReport/chatTransferReport.model');db['FaxTransferReport']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xe1'));db[_0x8b01('0xe2')]=db[_0x8b01('0x4')]['import'](_0x8b01('0xe3'));db[_0x8b01('0xe4')]=db[_0x8b01('0x4')]['import'](_0x8b01('0xe5'));db['CmList']=db[_0x8b01('0x4')]['import'](_0x8b01('0xe6'));db[_0x8b01('0xe7')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xe8'));db['UserProfile']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xe9'));db[_0x8b01('0xea')]=db[_0x8b01('0x4')]['import'](_0x8b01('0xeb'));db['UserProfileResource']=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xec'));db[_0x8b01('0xed')]=db[_0x8b01('0x4')]['import'](_0x8b01('0xee'));db[_0x8b01('0xef')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xf0'));db[_0x8b01('0xf1')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0xf2'));db[_0x8b01('0xf3')]=db[_0x8b01('0x4')]['import'](_0x8b01('0xf4'));db['WhatsappMessage']=db['sequelize'][_0x8b01('0x17')](_0x8b01('0xf5'));db[_0x8b01('0xf6')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xf7'));db[_0x8b01('0xf8')]=db[_0x8b01('0x4')]['import'](_0x8b01('0xf9'));db[_0x8b01('0xfa')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0xfb'));db[_0x8b01('0xfc')]=db[_0x8b01('0x4')]['import'](_0x8b01('0xfd'));db[_0x8b01('0xfe')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0xff'));db[_0x8b01('0x100')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x101'));db[_0x8b01('0x102')]=db[_0x8b01('0x4')][_0x8b01('0x17')](_0x8b01('0x103'));db[_0x8b01('0x104')]=db['sequelize'][_0x8b01('0x17')](_0x8b01('0x105'));db[_0x8b01('0x14')]['hasOne'](db[_0x8b01('0x20')],{'as':_0x8b01('0x20'),'onDelete':_0x8b01('0x106'),'foreignKey':'UserId'});db[_0x8b01('0x14')][_0x8b01('0x107')](db[_0x8b01('0x104')],{'as':_0x8b01('0x108'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x109')});db[_0x8b01('0x14')][_0x8b01('0x10a')](db[_0x8b01('0x1d')],{'as':'Recordings','foreignKey':'UserId'});db[_0x8b01('0x14')]['hasMany'](db[_0x8b01('0x10b')],{'as':_0x8b01('0x10c'),'foreignKey':_0x8b01('0x109')});db['User']['hasMany'](db[_0x8b01('0x10d')],{'as':_0x8b01('0x10e'),'onDelete':_0x8b01('0x106'),'hooks':!![]});db[_0x8b01('0x14')]['hasMany'](db['CmHopperFinal'],{'as':_0x8b01('0x10f'),'foreignKey':_0x8b01('0x109')});db[_0x8b01('0x14')][_0x8b01('0x10a')](db[_0x8b01('0x70')],{'as':'HopperHistory','foreignKey':_0x8b01('0x109')});db['User'][_0x8b01('0x10a')](db[_0x8b01('0x110')],{'as':_0x8b01('0x110'),'foreignKey':'UserId'});db[_0x8b01('0x14')]['hasMany'](db[_0x8b01('0x59')],{'as':_0x8b01('0x111'),'foreignKey':'UserId'});db[_0x8b01('0x14')][_0x8b01('0x10a')](db[_0x8b01('0x60')],{'as':'ChatInteractions','foreignKey':_0x8b01('0x109')});db[_0x8b01('0x14')][_0x8b01('0x10a')](db[_0x8b01('0x112')],{'as':'SmsInteractions','foreignKey':'UserId'});db[_0x8b01('0x14')]['hasMany'](db[_0x8b01('0x113')],{'as':_0x8b01('0x114'),'foreignKey':_0x8b01('0x109')});db[_0x8b01('0x14')]['hasMany'](db[_0x8b01('0x41')],{'as':_0x8b01('0x115'),'foreignKey':'UserId'});db[_0x8b01('0x14')][_0x8b01('0x10a')](db[_0x8b01('0xf3')],{'as':_0x8b01('0x116'),'foreignKey':_0x8b01('0x109')});db[_0x8b01('0x14')]['hasMany'](db[_0x8b01('0xed')],{'as':_0x8b01('0x117'),'foreignKey':_0x8b01('0x118')});db[_0x8b01('0x14')]['belongsTo'](db[_0x8b01('0x119')],{'as':_0x8b01('0x119'),'foreignKey':_0x8b01('0x11a')});db[_0x8b01('0x14')][_0x8b01('0x11b')](db['ChatGroup'],{'as':'Groups','through':'chat_group_has_users'});db[_0x8b01('0x14')][_0x8b01('0x11b')](db[_0x8b01('0x6b')],{'as':_0x8b01('0x11c'),'through':_0x8b01('0x11d')});db[_0x8b01('0x14')][_0x8b01('0x11b')](db[_0x8b01('0x11e')],{'as':_0x8b01('0x11f'),'through':'cm_user_has_lists'});db[_0x8b01('0x14')][_0x8b01('0x11b')](db[_0x8b01('0xd7')],{'through':'user_has_teams'});db[_0x8b01('0x14')][_0x8b01('0x11b')](db[_0x8b01('0x41')],{'as':'MailInteractions','through':_0x8b01('0x120')});db[_0x8b01('0x14')]['belongsToMany'](db[_0x8b01('0x60')],{'as':_0x8b01('0x121'),'through':_0x8b01('0x122')});db[_0x8b01('0x14')]['belongsToMany'](db[_0x8b01('0x113')],{'as':_0x8b01('0x114'),'through':_0x8b01('0x123')});db[_0x8b01('0x14')][_0x8b01('0x11b')](db[_0x8b01('0x112')],{'as':_0x8b01('0x124'),'through':_0x8b01('0x125')});db[_0x8b01('0x14')][_0x8b01('0x11b')](db[_0x8b01('0x59')],{'as':_0x8b01('0x111'),'through':'user_has_openchannel_interactions'});db[_0x8b01('0x14')][_0x8b01('0x11b')](db[_0x8b01('0xf3')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0x8b01('0x14')]['belongsToMany'](db[_0x8b01('0x1b')],{'as':_0x8b01('0x126'),'through':'UserVoiceQueue','required':![]});db[_0x8b01('0x14')][_0x8b01('0x11b')](db[_0x8b01('0xe7')],{'as':_0x8b01('0x127'),'through':'UserVoicePrefix','required':![]});db[_0x8b01('0x14')][_0x8b01('0x11b')](db['MailQueue'],{'as':_0x8b01('0x128'),'through':'UserMailQueue','required':![]});db['User'][_0x8b01('0x11b')](db['ChatQueue'],{'as':_0x8b01('0x129'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0x8b01('0x11b')](db[_0x8b01('0x50')],{'as':_0x8b01('0x12a'),'through':_0x8b01('0x34'),'required':![]});db[_0x8b01('0x14')]['belongsToMany'](db[_0x8b01('0x12b')],{'as':_0x8b01('0x12c'),'through':'UserSmsQueue','required':![]});db[_0x8b01('0x14')][_0x8b01('0x11b')](db[_0x8b01('0x5c')],{'as':_0x8b01('0x12d'),'through':_0x8b01('0x36'),'required':![]});db[_0x8b01('0x14')][_0x8b01('0x11b')](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0x8b01('0x37'),'required':![]});db[_0x8b01('0x14')][_0x8b01('0x11b')](db[_0x8b01('0x11e')],{'through':_0x8b01('0x12e')});db['User']['belongsToMany'](db['ChatWebsite'],{'as':'ChatWebsites','through':_0x8b01('0x12f')});db[_0x8b01('0x14')][_0x8b01('0x11b')](db['FaxAccount'],{'as':'FaxAccounts','through':_0x8b01('0x130')});db[_0x8b01('0x14')]['belongsToMany'](db[_0x8b01('0x131')],{'as':_0x8b01('0x132'),'through':_0x8b01('0x133')});db[_0x8b01('0x14')]['belongsToMany'](db[_0x8b01('0x134')],{'as':'OpenchannelAccounts','through':_0x8b01('0x135')});db[_0x8b01('0x14')][_0x8b01('0x11b')](db[_0x8b01('0x53')],{'as':_0x8b01('0x136'),'through':_0x8b01('0x137')});db[_0x8b01('0x14')][_0x8b01('0x11b')](db[_0x8b01('0xef')],{'as':_0x8b01('0x138'),'through':_0x8b01('0x139')});db['User'][_0x8b01('0x11b')](db[_0x8b01('0x13a')],{'as':_0x8b01('0x13b'),'through':_0x8b01('0x13c')});db[_0x8b01('0x16')][_0x8b01('0x10a')](db[_0x8b01('0x10d')],{'as':_0x8b01('0x13d'),'onDelete':'cascade','foreignKey':_0x8b01('0x13e')});db[_0x8b01('0x13f')][_0x8b01('0x10a')](db['VoiceExtension'],{'onDelete':_0x8b01('0x106')});db['VoiceExtension'][_0x8b01('0x10a')](db[_0x8b01('0x10d')],{'as':_0x8b01('0x140'),'onDelete':_0x8b01('0x106')});db[_0x8b01('0x141')][_0x8b01('0x11b')](db[_0x8b01('0x83')],{'as':_0x8b01('0x142'),'through':_0x8b01('0x143')});db['VoiceQueue'][_0x8b01('0x10a')](db['UserVoiceQueueRt'],{'as':_0x8b01('0x144'),'foreignKey':_0x8b01('0x145')});db[_0x8b01('0x1b')][_0x8b01('0x10a')](db['CmHopper'],{'as':_0x8b01('0x146'),'foreignKey':'VoiceQueueId'});db[_0x8b01('0x1b')][_0x8b01('0x10a')](db[_0x8b01('0x147')],{'as':_0x8b01('0x10f'),'foreignKey':_0x8b01('0x145')});db['VoiceQueue']['hasMany'](db[_0x8b01('0x70')],{'as':_0x8b01('0x148'),'foreignKey':'VoiceQueueId'});db[_0x8b01('0x1b')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x8b01('0x145')});db[_0x8b01('0x1b')][_0x8b01('0x10a')](db[_0x8b01('0x6f')],{'as':_0x8b01('0x149'),'foreignKey':_0x8b01('0x145')});db['VoiceQueue'][_0x8b01('0x10a')](db['JscriptySessionReport'],{'as':_0x8b01('0x14a'),'foreignKey':_0x8b01('0x145')});db[_0x8b01('0x1b')]['belongsTo'](db[_0x8b01('0x2c')],{'as':_0x8b01('0x2c'),'foreignKey':_0x8b01('0x14b')});db['VoiceQueue'][_0x8b01('0x14c')](db[_0x8b01('0x2c')],{'as':_0x8b01('0x14d'),'foreignKey':_0x8b01('0x14e')});db['VoiceQueue']['belongsTo'](db['Interval'],{'as':_0x8b01('0x14f'),'foreignKey':_0x8b01('0x150')});db[_0x8b01('0x1b')][_0x8b01('0x14c')](db[_0x8b01('0x7c')],{'as':_0x8b01('0x151'),'foreignKey':_0x8b01('0x152')});db[_0x8b01('0x1b')][_0x8b01('0x11b')](db['CmList'],{'as':_0x8b01('0x11f'),'through':_0x8b01('0x153')});db['VoiceQueue']['belongsToMany'](db[_0x8b01('0x14')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x8b01('0x1b')][_0x8b01('0x11b')](db[_0x8b01('0xd7')],{'as':'Teams','through':'TeamVoiceQueue'});db['VoiceQueue'][_0x8b01('0x11b')](db['CmList'],{'as':_0x8b01('0x154'),'through':_0x8b01('0x155')});db[_0x8b01('0x1d')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'as':_0x8b01('0x14'),'foreignKey':_0x8b01('0x109')});db[_0x8b01('0x156')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'as':'User','foreignKey':'UserId'});db[_0x8b01('0x20')][_0x8b01('0x10a')](db[_0x8b01('0x22')],{'as':_0x8b01('0x157'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x158'),'sourceKey':'mailbox'});db[_0x8b01('0x22')][_0x8b01('0x14c')](db[_0x8b01('0x20')],{'foreignKey':_0x8b01('0x158'),'targetKey':_0x8b01('0x159')});db[_0x8b01('0x24')]['hasMany'](db[_0x8b01('0x29')],{'as':_0x8b01('0x15a'),'foreignKey':'uniqueid','constraints':![]});db[_0x8b01('0x24')][_0x8b01('0x10a')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':_0x8b01('0x15b'),'constraints':![]});db[_0x8b01('0x24')]['belongsTo'](db[_0x8b01('0x14')],{'as':'User','foreignKey':_0x8b01('0x109')});db[_0x8b01('0x24')]['belongsTo'](db['CmContact'],{'as':_0x8b01('0x15c'),'foreignKey':_0x8b01('0x15d')});db[_0x8b01('0x39')][_0x8b01('0x14c')](db[_0x8b01('0x131')],{'as':_0x8b01('0x131'),'foreignKey':_0x8b01('0x15e')});db[_0x8b01('0x39')][_0x8b01('0x14c')](db[_0x8b01('0xfc')],{'as':_0x8b01('0xfc'),'foreignKey':_0x8b01('0x15f'),'onDelete':'restrict'});db[_0x8b01('0x3b')]['belongsTo'](db[_0x8b01('0x131')],{'as':_0x8b01('0x131'),'foreignKey':_0x8b01('0x15e')});db[_0x8b01('0x3b')]['belongsTo'](db[_0x8b01('0xfc')],{'as':_0x8b01('0xfc'),'foreignKey':_0x8b01('0x15f'),'onDelete':_0x8b01('0x160')});db[_0x8b01('0x131')]['hasOne'](db[_0x8b01('0x39')],{'as':_0x8b01('0x161'),'onDelete':_0x8b01('0x106')});db['MailAccount'][_0x8b01('0x107')](db[_0x8b01('0x3b')],{'as':_0x8b01('0x162'),'onDelete':_0x8b01('0x106')});db[_0x8b01('0x131')]['hasMany'](db[_0x8b01('0x78')],{'as':_0x8b01('0x163'),'foreignKey':_0x8b01('0x15e'),'onDelete':'cascade'});db[_0x8b01('0x131')][_0x8b01('0x10a')](db[_0x8b01('0x76')],{'as':_0x8b01('0x164'),'foreignKey':_0x8b01('0x15e')});db['MailAccount']['hasMany'](db[_0x8b01('0x43')],{'as':_0x8b01('0x157'),'foreignKey':_0x8b01('0x15e')});db[_0x8b01('0x131')]['hasMany'](db[_0x8b01('0x41')],{'as':'Interactions'});db[_0x8b01('0x131')]['hasMany'](db[_0x8b01('0x45')],{'as':_0x8b01('0x140')});db[_0x8b01('0x131')]['belongsTo'](db[_0x8b01('0x11e')],{'as':_0x8b01('0x165'),'foreignKey':'ListId'});db[_0x8b01('0x131')][_0x8b01('0x14c')](db[_0x8b01('0x87')],{'as':_0x8b01('0x87'),'foreignKey':_0x8b01('0x166')});db['MailAccount']['belongsTo'](db[_0x8b01('0x7c')],{'as':_0x8b01('0x151'),'foreignKey':_0x8b01('0x152')});db[_0x8b01('0x131')]['belongsToMany'](db['User'],{'as':_0x8b01('0x167'),'through':'user_has_mail_accounts'});db[_0x8b01('0x3e')][_0x8b01('0x11b')](db[_0x8b01('0x14')],{'as':_0x8b01('0x167'),'through':_0x8b01('0x32')});db['MailQueue'][_0x8b01('0x11b')](db['Team'],{'through':_0x8b01('0x168'),'as':'Teams'});db['MailInteraction']['hasMany'](db[_0x8b01('0x43')],{'as':_0x8b01('0x157'),'onDelete':_0x8b01('0x106'),'foreignKey':'MailInteractionId'});db[_0x8b01('0x41')][_0x8b01('0x14c')](db[_0x8b01('0x131')],{'as':_0x8b01('0x169'),'foreignKey':_0x8b01('0x15e')});db[_0x8b01('0x41')][_0x8b01('0x14c')](db[_0x8b01('0x6b')],{'as':_0x8b01('0x15c'),'foreignKey':_0x8b01('0x15d')});db[_0x8b01('0x41')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'as':_0x8b01('0x16a'),'foreignKey':_0x8b01('0x109')});db[_0x8b01('0x41')][_0x8b01('0x11b')](db[_0x8b01('0x85')],{'through':_0x8b01('0x16b'),'as':_0x8b01('0x16c')});db[_0x8b01('0x41')][_0x8b01('0x11b')](db[_0x8b01('0x85')],{'through':_0x8b01('0x16b'),'as':_0x8b01('0x16d')});db[_0x8b01('0x41')][_0x8b01('0x11b')](db[_0x8b01('0x14')],{'as':_0x8b01('0x16e'),'through':_0x8b01('0x120'),'foreignKey':'MailInteractionId'});db[_0x8b01('0x43')][_0x8b01('0x10a')](db['Attachment'],{'as':_0x8b01('0x16f'),'onDelete':'cascade'});db[_0x8b01('0x43')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'as':_0x8b01('0x14')});db['MailMessage'][_0x8b01('0x14c')](db[_0x8b01('0x6b')],{'onDelete':_0x8b01('0x106'),'as':'Contact'});db['MailMessage'][_0x8b01('0x14c')](db[_0x8b01('0x41')],{'as':'Interaction','foreignKey':_0x8b01('0x170')});db['MailMessage'][_0x8b01('0x14c')](db[_0x8b01('0x131')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x8b01('0x43')][_0x8b01('0x14c')](db['ChatWebsite'],{'as':_0x8b01('0x171'),'foreignKey':_0x8b01('0x172')});db['MailMessage']['belongsTo'](db[_0x8b01('0x62')],{'as':_0x8b01('0x62'),'foreignKey':_0x8b01('0x173')});db['MailApplication'][_0x8b01('0x14c')](db['User'],{'onDelete':_0x8b01('0x160')});db[_0x8b01('0x45')][_0x8b01('0x14c')](db['MailQueue'],{'onDelete':_0x8b01('0x160')});db['MailApplication'][_0x8b01('0x14c')](db['MailAccount'],{'onDelete':_0x8b01('0x160')});db[_0x8b01('0x45')]['belongsTo'](db[_0x8b01('0x14f')],{'onDelete':_0x8b01('0x160'),'foreignKey':'IntervalId'});db[_0x8b01('0x45')]['belongsTo'](db[_0x8b01('0x85')],{'onDelete':_0x8b01('0x160'),'foreignKey':_0x8b01('0x174')});db['MailQueueReport'][_0x8b01('0x14c')](db['MailAccount'],{});db[_0x8b01('0x175')][_0x8b01('0x14c')](db[_0x8b01('0x11e')],{'as':_0x8b01('0x165'),'foreignKey':_0x8b01('0x176')});db[_0x8b01('0x175')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x8b01('0x15d')});db[_0x8b01('0x175')][_0x8b01('0x14c')](db[_0x8b01('0x41')],{});db[_0x8b01('0x175')][_0x8b01('0x14c')](db['MailMessage'],{});db[_0x8b01('0x175')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{});db[_0x8b01('0x175')][_0x8b01('0x14c')](db['MailQueue'],{});db[_0x8b01('0x47')][_0x8b01('0x10a')](db[_0x8b01('0x49')],{'as':_0x8b01('0x177'),'onDelete':_0x8b01('0x106')});db[_0x8b01('0x4a')][_0x8b01('0x10a')](db[_0x8b01('0x78')],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0x8b01('0x106')});db[_0x8b01('0x4a')][_0x8b01('0x10a')](db[_0x8b01('0x76')],{'as':_0x8b01('0x164'),'foreignKey':_0x8b01('0x178')});db[_0x8b01('0x4a')][_0x8b01('0x10a')](db[_0x8b01('0x113')],{'as':_0x8b01('0x179')});db[_0x8b01('0x4a')][_0x8b01('0x10a')](db[_0x8b01('0x4c')],{'as':'Applications'});db[_0x8b01('0x4a')][_0x8b01('0x10a')](db[_0x8b01('0x10d')],{'as':_0x8b01('0x17a'),'onDelete':'cascade'});db['FaxAccount'][_0x8b01('0x10a')](db['FaxMessage'],{'as':_0x8b01('0x157')});db[_0x8b01('0x4a')]['belongsTo'](db[_0x8b01('0x2c')],{'as':'Trunk'});db[_0x8b01('0x4a')]['belongsTo'](db[_0x8b01('0x11e')],{'as':_0x8b01('0x165'),'foreignKey':_0x8b01('0x176')});db[_0x8b01('0x4a')]['belongsTo'](db[_0x8b01('0x7c')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['FaxAccount']['belongsToMany'](db['User'],{'as':_0x8b01('0x167'),'through':_0x8b01('0x130')});db[_0x8b01('0x4c')][_0x8b01('0x14c')](db['User'],{'onDelete':_0x8b01('0x160')});db['FaxApplication'][_0x8b01('0x14c')](db['FaxQueue'],{'onDelete':_0x8b01('0x160')});db[_0x8b01('0x4c')][_0x8b01('0x14c')](db[_0x8b01('0x4a')],{'onDelete':_0x8b01('0x160')});db[_0x8b01('0x4c')]['belongsTo'](db[_0x8b01('0x85')],{'onDelete':_0x8b01('0x160'),'foreignKey':_0x8b01('0x174')});db[_0x8b01('0x113')][_0x8b01('0x10a')](db['FaxMessage'],{'as':_0x8b01('0x157'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x17b')});db[_0x8b01('0x113')][_0x8b01('0x14c')](db[_0x8b01('0x4a')],{'as':_0x8b01('0x169'),'foreignKey':_0x8b01('0x178')});db[_0x8b01('0x113')][_0x8b01('0x14c')](db[_0x8b01('0x6b')],{'as':'Contact','foreignKey':_0x8b01('0x15d')});db[_0x8b01('0x113')]['belongsTo'](db[_0x8b01('0x14')],{'as':'Owner','foreignKey':_0x8b01('0x109')});db[_0x8b01('0x113')][_0x8b01('0x11b')](db[_0x8b01('0x85')],{'through':_0x8b01('0x17c'),'as':_0x8b01('0x16c')});db[_0x8b01('0x113')]['belongsToMany'](db[_0x8b01('0x85')],{'through':'fax_interaction_has_tags','as':_0x8b01('0x16d')});db[_0x8b01('0x113')][_0x8b01('0x11b')](db[_0x8b01('0x14')],{'as':_0x8b01('0x16e'),'through':_0x8b01('0x123'),'foreignKey':_0x8b01('0x17b')});db['FaxMessage'][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'onDelete':'cascade','as':_0x8b01('0x14')});db[_0x8b01('0x4f')][_0x8b01('0x14c')](db[_0x8b01('0x113')],{'as':_0x8b01('0x17d'),'foreignKey':_0x8b01('0x17b')});db[_0x8b01('0x4f')][_0x8b01('0x14c')](db[_0x8b01('0x6b')],{'onDelete':'cascade','as':'Contact'});db[_0x8b01('0x4f')][_0x8b01('0x14c')](db[_0x8b01('0xdd')],{'as':_0x8b01('0xdd'),'foreignKey':_0x8b01('0x17e')});db[_0x8b01('0x4f')][_0x8b01('0x14c')](db[_0x8b01('0x4a')],{'as':_0x8b01('0x169'),'foreignKey':'FaxAccountId'});db[_0x8b01('0x50')][_0x8b01('0x11b')](db['User'],{'as':_0x8b01('0x167'),'through':_0x8b01('0x34')});db[_0x8b01('0x50')][_0x8b01('0x11b')](db['Team'],{'through':_0x8b01('0x17f'),'as':'Teams'});db[_0x8b01('0x180')]['belongsTo'](db[_0x8b01('0x4a')],{});db[_0x8b01('0x180')][_0x8b01('0x14c')](db[_0x8b01('0x11e')],{'as':'List','foreignKey':'ListId'});db['FaxQueueReport'][_0x8b01('0x14c')](db['CmContact'],{'as':_0x8b01('0x15c'),'foreignKey':'ContactId'});db['FaxQueueReport'][_0x8b01('0x14c')](db[_0x8b01('0x113')],{});db[_0x8b01('0x180')][_0x8b01('0x14c')](db[_0x8b01('0x4f')],{});db[_0x8b01('0x180')][_0x8b01('0x14c')](db['User'],{});db['FaxQueueReport'][_0x8b01('0x14c')](db[_0x8b01('0x50')],{});db[_0x8b01('0x53')][_0x8b01('0x10a')](db[_0x8b01('0x78')],{'as':_0x8b01('0x163'),'foreignKey':_0x8b01('0x181'),'onDelete':'cascade'});db[_0x8b01('0x53')]['hasMany'](db[_0x8b01('0x76')],{'as':_0x8b01('0x164'),'foreignKey':_0x8b01('0x181')});db[_0x8b01('0x53')][_0x8b01('0x10a')](db[_0x8b01('0x182')],{'as':_0x8b01('0x157'),'foreignKey':_0x8b01('0x181')});db[_0x8b01('0x53')][_0x8b01('0x10a')](db[_0x8b01('0x112')],{'as':_0x8b01('0x179')});db[_0x8b01('0x53')]['hasMany'](db[_0x8b01('0x54')],{'as':'Applications'});db[_0x8b01('0x53')][_0x8b01('0x14c')](db['CmList'],{'as':_0x8b01('0x165'),'foreignKey':_0x8b01('0x176')});db[_0x8b01('0x53')]['belongsTo'](db[_0x8b01('0x7c')],{'as':_0x8b01('0x151'),'foreignKey':_0x8b01('0x152')});db['SmsAccount'][_0x8b01('0x11b')](db[_0x8b01('0x14')],{'as':_0x8b01('0x167'),'through':_0x8b01('0x137')});db[_0x8b01('0x54')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db[_0x8b01('0x12b')],{'onDelete':_0x8b01('0x160')});db['SmsApplication'][_0x8b01('0x14c')](db[_0x8b01('0x53')],{'onDelete':'restrict'});db[_0x8b01('0x54')]['belongsTo'](db[_0x8b01('0x14f')],{'onDelete':_0x8b01('0x160'),'foreignKey':_0x8b01('0x150')});db[_0x8b01('0x54')][_0x8b01('0x14c')](db['Tag'],{'onDelete':_0x8b01('0x160'),'foreignKey':'TagId'});db[_0x8b01('0x112')]['hasMany'](db[_0x8b01('0x182')],{'as':_0x8b01('0x157'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x183')});db[_0x8b01('0x112')][_0x8b01('0x14c')](db[_0x8b01('0x53')],{'as':_0x8b01('0x169'),'foreignKey':_0x8b01('0x181')});db[_0x8b01('0x112')][_0x8b01('0x14c')](db[_0x8b01('0x6b')],{'as':_0x8b01('0x15c'),'foreignKey':_0x8b01('0x15d')});db[_0x8b01('0x112')][_0x8b01('0x14c')](db['User'],{'as':_0x8b01('0x16a'),'foreignKey':'UserId'});db[_0x8b01('0x112')][_0x8b01('0x11b')](db[_0x8b01('0x85')],{'through':_0x8b01('0x184'),'as':'Tags'});db[_0x8b01('0x112')]['belongsToMany'](db[_0x8b01('0x85')],{'through':'sms_interaction_has_tags','as':_0x8b01('0x16d')});db[_0x8b01('0x112')][_0x8b01('0x11b')](db[_0x8b01('0x14')],{'as':_0x8b01('0x16e'),'through':_0x8b01('0x125'),'foreignKey':_0x8b01('0x183')});db['SmsMessage']['belongsTo'](db['User'],{'as':_0x8b01('0x14')});db[_0x8b01('0x182')][_0x8b01('0x14c')](db['CmContact'],{'onDelete':_0x8b01('0x106'),'as':_0x8b01('0x15c')});db[_0x8b01('0x182')][_0x8b01('0x14c')](db[_0x8b01('0x112')],{'onDelete':_0x8b01('0x106'),'as':_0x8b01('0x17d'),'foreignKey':'SmsInteractionId'});db['SmsMessage']['belongsTo'](db[_0x8b01('0x53')],{'as':_0x8b01('0x169'),'foreignKey':'SmsAccountId'});db[_0x8b01('0x12b')][_0x8b01('0x11b')](db['User'],{'as':_0x8b01('0x167'),'through':_0x8b01('0x185'),'foreignKey':_0x8b01('0x186')});db['SmsQueue'][_0x8b01('0x11b')](db['Team'],{'through':'team_has_sms_queues','as':_0x8b01('0x187')});db[_0x8b01('0x134')][_0x8b01('0x10a')](db['Disposition'],{'as':_0x8b01('0x163'),'foreignKey':_0x8b01('0x188'),'onDelete':_0x8b01('0x106')});db[_0x8b01('0x134')][_0x8b01('0x10a')](db[_0x8b01('0x76')],{'as':_0x8b01('0x164'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0x8b01('0x59')],{'as':_0x8b01('0x179'),'foreignKey':_0x8b01('0x188')});db['OpenchannelAccount'][_0x8b01('0x10a')](db[_0x8b01('0x5b')],{'as':_0x8b01('0x157'),'foreignKey':'OpenchannelAccountId'});db[_0x8b01('0x134')][_0x8b01('0x10a')](db[_0x8b01('0x189')],{'as':'Applications','foreignKey':_0x8b01('0x188')});db[_0x8b01('0x134')][_0x8b01('0x14c')](db['CmList'],{'as':_0x8b01('0x165'),'foreignKey':_0x8b01('0x176')});db[_0x8b01('0x134')][_0x8b01('0x14c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x8b01('0x152')});db[_0x8b01('0x134')][_0x8b01('0x11b')](db[_0x8b01('0x14')],{'as':_0x8b01('0x167'),'through':_0x8b01('0x135')});db[_0x8b01('0x189')][_0x8b01('0x14c')](db['User'],{'onDelete':_0x8b01('0x160')});db[_0x8b01('0x189')]['belongsTo'](db[_0x8b01('0x5c')],{'onDelete':'restrict','foreignKey':_0x8b01('0x18a')});db[_0x8b01('0x189')][_0x8b01('0x14c')](db[_0x8b01('0x134')],{'onDelete':_0x8b01('0x160'),'foreignKey':'OpenchannelAccountId'});db[_0x8b01('0x189')][_0x8b01('0x14c')](db['Interval'],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x8b01('0x189')][_0x8b01('0x14c')](db[_0x8b01('0x85')],{'onDelete':_0x8b01('0x160'),'foreignKey':_0x8b01('0x174')});db[_0x8b01('0x59')][_0x8b01('0x10a')](db[_0x8b01('0x5b')],{'as':'Messages','onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x18b')});db[_0x8b01('0x59')][_0x8b01('0x14c')](db[_0x8b01('0x134')],{'as':_0x8b01('0x169'),'foreignKey':_0x8b01('0x188')});db['OpenchannelInteraction']['belongsTo'](db[_0x8b01('0x6b')],{'as':_0x8b01('0x15c'),'foreignKey':_0x8b01('0x15d')});db[_0x8b01('0x59')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'as':_0x8b01('0x16a'),'foreignKey':_0x8b01('0x109')});db[_0x8b01('0x59')][_0x8b01('0x11b')](db[_0x8b01('0x85')],{'through':_0x8b01('0x18c'),'as':_0x8b01('0x16c')});db['OpenchannelInteraction'][_0x8b01('0x11b')](db['Tag'],{'through':_0x8b01('0x18c'),'as':_0x8b01('0x16d')});db[_0x8b01('0x59')][_0x8b01('0x11b')](db[_0x8b01('0x14')],{'as':_0x8b01('0x16e'),'through':_0x8b01('0x18d'),'foreignKey':_0x8b01('0x18b')});db[_0x8b01('0x5b')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'onDelete':_0x8b01('0x106'),'as':_0x8b01('0x14')});db[_0x8b01('0x5b')]['belongsTo'](db[_0x8b01('0x6b')],{'onDelete':_0x8b01('0x106'),'as':_0x8b01('0x15c')});db[_0x8b01('0x5b')]['belongsTo'](db[_0x8b01('0x59')],{'onDelete':_0x8b01('0x106'),'as':_0x8b01('0x17d'),'foreignKey':_0x8b01('0x18b')});db[_0x8b01('0x5b')][_0x8b01('0x14c')](db[_0x8b01('0xdd')],{'as':_0x8b01('0xdd'),'foreignKey':_0x8b01('0x17e')});db[_0x8b01('0x5b')]['belongsTo'](db[_0x8b01('0x134')],{'as':_0x8b01('0x169'),'foreignKey':'OpenchannelAccountId'});db[_0x8b01('0x5c')]['belongsToMany'](db[_0x8b01('0x14')],{'as':_0x8b01('0x167'),'through':'UserOpenchannelQueue','foreignKey':_0x8b01('0x18a')});db[_0x8b01('0x5c')]['belongsToMany'](db['Team'],{'through':'team_has_openchannel_queues','as':_0x8b01('0x187')});db[_0x8b01('0x171')][_0x8b01('0x10a')](db[_0x8b01('0x78')],{'as':_0x8b01('0x163'),'foreignKey':_0x8b01('0x172'),'onDelete':_0x8b01('0x106')});db[_0x8b01('0x171')]['hasMany'](db['CannedAnswer'],{'as':_0x8b01('0x164'),'foreignKey':'ChatWebsiteId'});db[_0x8b01('0x171')][_0x8b01('0x10a')](db[_0x8b01('0x18e')],{'as':_0x8b01('0x18f')});db[_0x8b01('0x171')][_0x8b01('0x10a')](db[_0x8b01('0x60')],{'as':_0x8b01('0x179')});db[_0x8b01('0x171')][_0x8b01('0x10a')](db[_0x8b01('0x190')],{'as':_0x8b01('0x140')});db[_0x8b01('0x171')][_0x8b01('0x10a')](db['ChatMessage'],{'as':_0x8b01('0x157')});db[_0x8b01('0x171')][_0x8b01('0x14c')](db[_0x8b01('0x11e')],{'as':_0x8b01('0x165'),'foreignKey':'ListId'});db[_0x8b01('0x171')][_0x8b01('0x14c')](db[_0x8b01('0x14f')],{'as':_0x8b01('0x14f'),'foreignKey':_0x8b01('0x150')});db['ChatWebsite']['belongsTo'](db['MailAccount'],{'as':_0x8b01('0x131'),'foreignKey':_0x8b01('0x15e')});db[_0x8b01('0x171')][_0x8b01('0x14c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8b01('0x171')]['belongsToMany'](db['User'],{'as':_0x8b01('0x167'),'through':_0x8b01('0x12f')});db['OpenchannelQueueReport'][_0x8b01('0x14c')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0x8b01('0x14c')](db['CmList'],{'as':_0x8b01('0x165'),'foreignKey':_0x8b01('0x176')});db[_0x8b01('0x5e')][_0x8b01('0x14c')](db[_0x8b01('0x6b')],{'as':_0x8b01('0x15c'),'foreignKey':'ContactId'});db[_0x8b01('0x5e')][_0x8b01('0x14c')](db['OpenchannelInteraction'],{});db[_0x8b01('0x5e')][_0x8b01('0x14c')](db[_0x8b01('0x5b')],{});db[_0x8b01('0x5e')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{});db['OpenchannelQueueReport'][_0x8b01('0x14c')](db[_0x8b01('0x5c')],{});db['ChatApplication'][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'as':_0x8b01('0x191'),'foreignKey':_0x8b01('0x109'),'onDelete':'restrict'});db['ChatApplication'][_0x8b01('0x14c')](db[_0x8b01('0x64')],{'as':'Queue','foreignKey':_0x8b01('0x192'),'onDelete':_0x8b01('0x160')});db['ChatApplication'][_0x8b01('0x14c')](db[_0x8b01('0x171')],{'as':_0x8b01('0x193'),'foreignKey':_0x8b01('0x172'),'onDelete':_0x8b01('0x160')});db[_0x8b01('0x190')][_0x8b01('0x14c')](db[_0x8b01('0x85')],{'onDelete':_0x8b01('0x160'),'foreignKey':_0x8b01('0x174')});db[_0x8b01('0x60')]['hasMany'](db[_0x8b01('0x61')],{'as':_0x8b01('0x157'),'onDelete':'cascade','foreignKey':'ChatInteractionId'});db[_0x8b01('0x60')][_0x8b01('0x14c')](db['ChatWebsite'],{'as':_0x8b01('0x169'),'foreignKey':_0x8b01('0x172')});db[_0x8b01('0x60')]['belongsTo'](db[_0x8b01('0x6b')],{'as':'Contact','foreignKey':_0x8b01('0x15d')});db[_0x8b01('0x60')][_0x8b01('0x14c')](db['User'],{'as':'Owner','foreignKey':_0x8b01('0x109')});db[_0x8b01('0x60')][_0x8b01('0x11b')](db['Tag'],{'through':_0x8b01('0x194'),'as':_0x8b01('0x16c')});db[_0x8b01('0x60')]['belongsToMany'](db[_0x8b01('0x85')],{'through':_0x8b01('0x194'),'as':_0x8b01('0x16d')});db[_0x8b01('0x60')][_0x8b01('0x11b')](db['User'],{'as':'Users','through':'user_has_chat_interactions','foreignKey':_0x8b01('0x195')});db[_0x8b01('0x61')][_0x8b01('0x14c')](db['User'],{'onDelete':_0x8b01('0x106'),'as':_0x8b01('0x14')});db['ChatMessage'][_0x8b01('0x14c')](db['CmContact'],{'onDelete':_0x8b01('0x106'),'as':'Contact','foreignKey':_0x8b01('0x15d')});db['ChatMessage']['belongsTo'](db[_0x8b01('0x60')],{'onDelete':_0x8b01('0x106'),'as':'Interaction','foreignKey':_0x8b01('0x195')});db[_0x8b01('0x61')][_0x8b01('0x14c')](db[_0x8b01('0xdd')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x8b01('0x61')][_0x8b01('0x14c')](db[_0x8b01('0x171')],{'as':_0x8b01('0x169'),'foreignKey':_0x8b01('0x172')});db[_0x8b01('0x62')][_0x8b01('0x10a')](db[_0x8b01('0xdd')],{'as':'Attachments','foreignKey':_0x8b01('0x173'),'onDelete':_0x8b01('0x106'),'hooks':!![]});db[_0x8b01('0x62')][_0x8b01('0x14c')](db['CmContact'],{'onDelete':_0x8b01('0x106'),'as':_0x8b01('0x15c'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0x8b01('0x14c')](db[_0x8b01('0x171')],{'as':'Account','foreignKey':_0x8b01('0x172')});db[_0x8b01('0x64')]['belongsToMany'](db[_0x8b01('0x14')],{'as':'Agents','through':_0x8b01('0x196'),'hooks':!![]});db[_0x8b01('0x64')][_0x8b01('0x11b')](db[_0x8b01('0xd7')],{'through':_0x8b01('0x197'),'as':_0x8b01('0x187')});db[_0x8b01('0x66')][_0x8b01('0x10a')](db[_0x8b01('0x198')],{'as':_0x8b01('0x157'),'foreignKey':_0x8b01('0x199'),'onDelete':'cascade'});db[_0x8b01('0x66')][_0x8b01('0x11b')](db[_0x8b01('0x14')],{'as':_0x8b01('0x144'),'through':_0x8b01('0x19a')});db[_0x8b01('0x18e')][_0x8b01('0x14c')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x8b01('0x172')});db[_0x8b01('0x69')][_0x8b01('0x10a')](db[_0x8b01('0x6b')],{'as':_0x8b01('0x11c'),'foreignKey':_0x8b01('0x19b')});db[_0x8b01('0x6b')][_0x8b01('0x10a')](db[_0x8b01('0x6d')],{'as':_0x8b01('0x146'),'foreignKey':'ContactId'});db[_0x8b01('0x6b')][_0x8b01('0x10a')](db['CmHopperFinal'],{'as':_0x8b01('0x10f'),'foreignKey':_0x8b01('0x15d')});db[_0x8b01('0x6b')]['hasMany'](db['CmHopperHistory'],{'as':_0x8b01('0x148'),'foreignKey':_0x8b01('0x15d')});db[_0x8b01('0x6b')][_0x8b01('0x10a')](db[_0x8b01('0x110')],{'as':_0x8b01('0x110'),'foreignKey':'ContactId'});db['CmContact'][_0x8b01('0x10a')](db[_0x8b01('0xca')],{'as':'JscriptySessions','foreignKey':_0x8b01('0x15d')});db[_0x8b01('0x6b')][_0x8b01('0x10a')](db[_0x8b01('0x59')],{'as':'OpenchannelInteractions','foreignKey':_0x8b01('0x15d'),'onDelete':_0x8b01('0x160')});db[_0x8b01('0x6b')][_0x8b01('0x10a')](db['ChatInteraction'],{'as':_0x8b01('0x121'),'foreignKey':'ContactId','onDelete':_0x8b01('0x160')});db[_0x8b01('0x6b')][_0x8b01('0x10a')](db['SmsInteraction'],{'as':_0x8b01('0x124'),'foreignKey':_0x8b01('0x15d'),'onDelete':_0x8b01('0x160')});db[_0x8b01('0x6b')][_0x8b01('0x10a')](db[_0x8b01('0x113')],{'as':'FaxInteractions','foreignKey':_0x8b01('0x15d'),'onDelete':'restrict'});db['CmContact'][_0x8b01('0x10a')](db[_0x8b01('0x41')],{'as':_0x8b01('0x115'),'foreignKey':_0x8b01('0x15d'),'onDelete':_0x8b01('0x160')});db[_0x8b01('0x6b')][_0x8b01('0x14c')](db[_0x8b01('0x69')],{'as':_0x8b01('0x19c'),'foreignKey':'CompanyId'});db[_0x8b01('0x6b')]['belongsTo'](db[_0x8b01('0x11e')],{'as':_0x8b01('0x165'),'foreignKey':_0x8b01('0x176'),'onDelete':'cascade'});db['CmContact']['belongsToMany'](db[_0x8b01('0x14')],{'as':_0x8b01('0x16e'),'through':_0x8b01('0x11d')});db[_0x8b01('0x6b')][_0x8b01('0x11b')](db[_0x8b01('0x85')],{'as':'Tags','through':_0x8b01('0x19d')});db['CmContact'][_0x8b01('0x11b')](db['Tag'],{'through':_0x8b01('0x19d'),'as':_0x8b01('0x16d')});db[_0x8b01('0x6d')][_0x8b01('0x14c')](db[_0x8b01('0x6b')],{'as':_0x8b01('0x15c'),'foreignKey':'ContactId','onDelete':_0x8b01('0x106')});db['CmHopper'][_0x8b01('0x14c')](db[_0x8b01('0x11e')],{'as':_0x8b01('0x165'),'foreignKey':_0x8b01('0x176'),'onDelete':_0x8b01('0x106')});db['CmHopper'][_0x8b01('0x14c')](db['User'],{'as':'Agent','foreignKey':'UserId'});db['CmHopper'][_0x8b01('0x14c')](db[_0x8b01('0x1b')],{'as':_0x8b01('0x19e'),'foreignKey':'VoiceQueueId','onDelete':_0x8b01('0x106')});db[_0x8b01('0x6d')][_0x8b01('0x14c')](db[_0x8b01('0xda')],{'as':'Campaign','foreignKey':_0x8b01('0x19f'),'onDelete':'cascade'});db['CmHopper'][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'as':'Owner','foreignKey':_0x8b01('0x1a0')});db[_0x8b01('0x6f')]['belongsTo'](db[_0x8b01('0x6b')],{'as':_0x8b01('0x15c'),'foreignKey':_0x8b01('0x15d'),'onDelete':_0x8b01('0x106')});db[_0x8b01('0x6f')][_0x8b01('0x14c')](db[_0x8b01('0x11e')],{'as':_0x8b01('0x165'),'foreignKey':'ListId','onDelete':_0x8b01('0x106')});db['CmHopperBlack']['belongsTo'](db[_0x8b01('0x1b')],{'as':'Queue','foreignKey':_0x8b01('0x145'),'onDelete':_0x8b01('0x106')});db['CmHopperBlack'][_0x8b01('0x14c')](db['Campaign'],{'as':_0x8b01('0xda'),'foreignKey':_0x8b01('0x19f'),'onDelete':_0x8b01('0x106')});db['Automation'][_0x8b01('0x10a')](db[_0x8b01('0x7a')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0x8b01('0x1a1'),'onDelete':'cascade','hooks':!![]});db[_0x8b01('0x74')]['hasMany'](db[_0x8b01('0x7a')],{'as':{'plural':_0x8b01('0x1a2'),'singular':_0x8b01('0x1a3')},'foreignKey':_0x8b01('0x1a4'),'onDelete':_0x8b01('0x106'),'hooks':!![]});db['Automation']['hasMany'](db[_0x8b01('0x1a5')],{'as':_0x8b01('0x1a6'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x8b01('0x78')][_0x8b01('0x10a')](db[_0x8b01('0x78')],{'as':_0x8b01('0x163'),'foreignKey':_0x8b01('0x1a7'),'onDelete':_0x8b01('0x106')});db[_0x8b01('0x14f')][_0x8b01('0x10a')](db['Interval'],{'as':'Intervals','foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0x8b01('0x14f')]['hasMany'](db['VoiceExtension'],{'as':'Extensions','foreignKey':'IntervalId','onDelete':'restrict'});db[_0x8b01('0x14f')][_0x8b01('0x10a')](db['MailApplication'],{'as':_0x8b01('0x1a8'),'foreignKey':_0x8b01('0x150')});db[_0x8b01('0x14f')]['hasMany'](db[_0x8b01('0x190')],{'as':_0x8b01('0x1a9'),'foreignKey':_0x8b01('0x150')});db[_0x8b01('0x14f')][_0x8b01('0x10a')](db[_0x8b01('0x4c')],{'as':_0x8b01('0x1aa'),'foreignKey':_0x8b01('0x150')});db[_0x8b01('0x14f')][_0x8b01('0x10a')](db[_0x8b01('0x54')],{'as':'SmsApplications','foreignKey':_0x8b01('0x150')});db['Schedule']['belongsTo'](db['MailAccount'],{});db[_0x8b01('0x81')][_0x8b01('0x14c')](db[_0x8b01('0x8d')],{'foreignKey':'DefaultReportId'});db[_0x8b01('0x81')][_0x8b01('0x14c')](db['AnalyticCustomReport'],{'foreignKey':_0x8b01('0x1ab')});db[_0x8b01('0x83')][_0x8b01('0x11b')](db['VoiceMusicOnHold'],{'as':'Mohs','through':'moh_has_sounds','onDelete':'restrict'});db['Tag'][_0x8b01('0x11b')](db[_0x8b01('0x6b')],{'through':_0x8b01('0x19d')});db['Tag'][_0x8b01('0x11b')](db[_0x8b01('0x60')],{'through':_0x8b01('0x194')});db[_0x8b01('0x85')]['belongsToMany'](db[_0x8b01('0x41')],{'through':_0x8b01('0x16b')});db[_0x8b01('0x85')]['belongsToMany'](db['SmsInteraction'],{'through':_0x8b01('0x184')});db[_0x8b01('0x85')][_0x8b01('0x11b')](db[_0x8b01('0x113')],{'through':_0x8b01('0x17c')});db[_0x8b01('0x85')][_0x8b01('0x11b')](db[_0x8b01('0x59')],{'through':_0x8b01('0x18c')});db[_0x8b01('0x85')][_0x8b01('0x11b')](db[_0x8b01('0xf3')],{'through':_0x8b01('0x1ac')});db['Trigger'][_0x8b01('0x10a')](db[_0x8b01('0x7a')],{'as':{'plural':_0x8b01('0x1ad'),'singular':_0x8b01('0x1ae')},'foreignKey':_0x8b01('0x1af'),'onDelete':_0x8b01('0x106'),'hooks':!![]});db[_0x8b01('0x89')][_0x8b01('0x10a')](db[_0x8b01('0x7a')],{'as':{'plural':_0x8b01('0x1b0'),'singular':_0x8b01('0x1b1')},'foreignKey':_0x8b01('0x1b2'),'onDelete':'cascade','hooks':!![]});db[_0x8b01('0x89')][_0x8b01('0x10a')](db['Action'],{'as':_0x8b01('0x1a6'),'foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db[_0x8b01('0x1b3')][_0x8b01('0x10a')](db[_0x8b01('0x1b4')],{'as':_0x8b01('0x1b5'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1ab'),'hooks':!![]});db[_0x8b01('0x8d')][_0x8b01('0x10a')](db[_0x8b01('0x1b4')],{'as':_0x8b01('0x1b5'),'onDelete':_0x8b01('0x106'),'foreignKey':'DefaultReportId'});db[_0x8b01('0x90')][_0x8b01('0x10a')](db[_0x8b01('0x1b4')],{'as':_0x8b01('0x1b5'),'onDelete':_0x8b01('0x106'),'foreignKey':'MetricId'});db[_0x8b01('0x1b4')]['belongsTo'](db[_0x8b01('0x90')],{'foreignKey':_0x8b01('0x1b6')});db[_0x8b01('0x94')][_0x8b01('0x10a')](db['SalesforceConfiguration'],{'as':_0x8b01('0x1b7'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x8b01('0x96')][_0x8b01('0x10a')](db[_0x8b01('0x98')],{'as':_0x8b01('0x1b8'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1b9')});db[_0x8b01('0x96')][_0x8b01('0x10a')](db[_0x8b01('0x98')],{'as':'Descriptions','onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1ba')});db['SalesforceConfiguration'][_0x8b01('0x10a')](db['SalesforceField'],{'as':_0x8b01('0x1b5'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1bb')});db[_0x8b01('0x96')][_0x8b01('0x14c')](db['SalesforceAccount'],{'as':_0x8b01('0x169'),'foreignKey':_0x8b01('0x1bc')});db[_0x8b01('0x98')][_0x8b01('0x10a')](db['SalesforceField'],{'as':_0x8b01('0x1bd'),'foreignKey':'SubjectId'});db[_0x8b01('0x98')]['hasMany'](db[_0x8b01('0x98')],{'as':_0x8b01('0x1be'),'foreignKey':_0x8b01('0x1ba')});db[_0x8b01('0x98')][_0x8b01('0x10a')](db[_0x8b01('0x98')],{'as':_0x8b01('0x1bf'),'foreignKey':'FieldId'});db[_0x8b01('0x98')][_0x8b01('0x14c')](db[_0x8b01('0x8b')],{'as':'Variable','foreignKey':_0x8b01('0x1c0')});db[_0x8b01('0x9a')][_0x8b01('0x10a')](db[_0x8b01('0x9c')],{'as':_0x8b01('0x1b7'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1bc')});db['SugarcrmConfiguration'][_0x8b01('0x10a')](db[_0x8b01('0x9e')],{'as':_0x8b01('0x1b8'),'onDelete':_0x8b01('0x106'),'foreignKey':'SubjectId'});db[_0x8b01('0x9c')][_0x8b01('0x10a')](db[_0x8b01('0x9e')],{'as':_0x8b01('0x1c1'),'onDelete':_0x8b01('0x106'),'foreignKey':'DescriptionId'});db[_0x8b01('0x9c')][_0x8b01('0x10a')](db[_0x8b01('0x9e')],{'as':_0x8b01('0x1b5'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1bb')});db[_0x8b01('0x9c')][_0x8b01('0x14c')](db[_0x8b01('0x9a')],{'as':'Account','foreignKey':_0x8b01('0x1bc')});db[_0x8b01('0x9e')][_0x8b01('0x10a')](db['SugarcrmField'],{'as':'Subject','foreignKey':_0x8b01('0x1b9')});db[_0x8b01('0x9e')][_0x8b01('0x10a')](db[_0x8b01('0x9e')],{'as':_0x8b01('0x1be'),'foreignKey':_0x8b01('0x1ba')});db[_0x8b01('0x9e')][_0x8b01('0x10a')](db[_0x8b01('0x9e')],{'as':_0x8b01('0x1bf'),'foreignKey':_0x8b01('0x1bb')});db[_0x8b01('0x9e')]['belongsTo'](db['Variable'],{'as':_0x8b01('0x8b'),'foreignKey':_0x8b01('0x1c0')});db[_0x8b01('0xa0')]['hasMany'](db[_0x8b01('0xa1')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x8b01('0x1bc')});db[_0x8b01('0xa1')][_0x8b01('0x10a')](db['DeskField'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x8b01('0xa1')][_0x8b01('0x10a')](db['DeskField'],{'as':'Descriptions','onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1ba')});db[_0x8b01('0xa1')][_0x8b01('0x10a')](db[_0x8b01('0xa3')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x8b01('0x1bb')});db[_0x8b01('0xa1')]['belongsTo'](db[_0x8b01('0xa0')],{'as':'Account','foreignKey':_0x8b01('0x1bc')});db[_0x8b01('0xa1')][_0x8b01('0x11b')](db[_0x8b01('0x85')],{'through':_0x8b01('0x1c2')});db[_0x8b01('0xa3')][_0x8b01('0x10a')](db['DeskField'],{'as':_0x8b01('0x1bd'),'foreignKey':_0x8b01('0x1b9')});db[_0x8b01('0xa3')][_0x8b01('0x10a')](db[_0x8b01('0xa3')],{'as':_0x8b01('0x1be'),'foreignKey':_0x8b01('0x1ba')});db['DeskField'][_0x8b01('0x10a')](db['DeskField'],{'as':'Field','foreignKey':_0x8b01('0x1bb')});db[_0x8b01('0xa3')][_0x8b01('0x14c')](db[_0x8b01('0x8b')],{'as':_0x8b01('0x8b'),'foreignKey':'VariableId'});db[_0x8b01('0x1c3')][_0x8b01('0x10a')](db[_0x8b01('0xa6')],{'as':_0x8b01('0x1b7'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1bc')});db[_0x8b01('0xa6')][_0x8b01('0x10a')](db['ZohoField'],{'as':_0x8b01('0x1b8'),'onDelete':_0x8b01('0x106'),'foreignKey':'SubjectId'});db[_0x8b01('0xa6')][_0x8b01('0x10a')](db[_0x8b01('0xa7')],{'as':_0x8b01('0x1c1'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1ba')});db[_0x8b01('0xa6')][_0x8b01('0x10a')](db[_0x8b01('0xa7')],{'as':'Fields','onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1bb')});db['ZohoConfiguration'][_0x8b01('0x14c')](db[_0x8b01('0x1c3')],{'as':_0x8b01('0x169'),'foreignKey':_0x8b01('0x1bc')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':'Subject','foreignKey':_0x8b01('0x1b9')});db[_0x8b01('0xa7')][_0x8b01('0x10a')](db[_0x8b01('0xa7')],{'as':_0x8b01('0x1be'),'foreignKey':_0x8b01('0x1ba')});db[_0x8b01('0xa7')][_0x8b01('0x10a')](db[_0x8b01('0xa7')],{'as':_0x8b01('0x1bf'),'foreignKey':_0x8b01('0x1bb')});db[_0x8b01('0xa7')][_0x8b01('0x14c')](db[_0x8b01('0x8b')],{'as':_0x8b01('0x8b'),'foreignKey':_0x8b01('0x1c0')});db[_0x8b01('0x1c4')][_0x8b01('0x10a')](db[_0x8b01('0xaa')],{'as':'Configurations','onDelete':_0x8b01('0x106'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x8b01('0x10a')](db['ZendeskField'],{'as':_0x8b01('0x1b8'),'foreignKey':_0x8b01('0x1b9')});db[_0x8b01('0xaa')][_0x8b01('0x10a')](db[_0x8b01('0xac')],{'as':'Descriptions','foreignKey':_0x8b01('0x1ba')});db['ZendeskConfiguration']['hasMany'](db[_0x8b01('0xac')],{'as':_0x8b01('0x1b5'),'foreignKey':_0x8b01('0x1bb')});db['ZendeskConfiguration'][_0x8b01('0x14c')](db[_0x8b01('0x1c4')],{'as':'Account','foreignKey':_0x8b01('0x1bc')});db[_0x8b01('0xaa')][_0x8b01('0x11b')](db[_0x8b01('0x85')],{'through':_0x8b01('0x1c5')});db[_0x8b01('0xac')][_0x8b01('0x10a')](db[_0x8b01('0xac')],{'as':'Subject','foreignKey':_0x8b01('0x1b9')});db['ZendeskField'][_0x8b01('0x10a')](db[_0x8b01('0xac')],{'as':_0x8b01('0x1be'),'foreignKey':'DescriptionId'});db[_0x8b01('0xac')][_0x8b01('0x10a')](db[_0x8b01('0xac')],{'as':_0x8b01('0x1bf'),'foreignKey':_0x8b01('0x1bb')});db['ZendeskField'][_0x8b01('0x14c')](db[_0x8b01('0x8b')],{'as':_0x8b01('0x8b'),'foreignKey':_0x8b01('0x1c0')});db[_0x8b01('0xae')][_0x8b01('0x10a')](db[_0x8b01('0xaf')],{'as':_0x8b01('0x1b7'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1bc')});db[_0x8b01('0xaf')]['hasMany'](db['FreshdeskField'],{'as':_0x8b01('0x1b8'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1b9')});db[_0x8b01('0xaf')][_0x8b01('0x10a')](db[_0x8b01('0xb1')],{'as':'Descriptions','onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1ba')});db[_0x8b01('0xaf')][_0x8b01('0x10a')](db[_0x8b01('0xb1')],{'as':_0x8b01('0x1b5'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1bb')});db[_0x8b01('0xaf')][_0x8b01('0x14c')](db[_0x8b01('0xae')],{'as':_0x8b01('0x169'),'foreignKey':_0x8b01('0x1bc')});db[_0x8b01('0xaf')][_0x8b01('0x11b')](db[_0x8b01('0x85')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x8b01('0xb1')][_0x8b01('0x10a')](db[_0x8b01('0xb1')],{'as':_0x8b01('0x1bd'),'foreignKey':_0x8b01('0x1b9')});db['FreshdeskField'][_0x8b01('0x10a')](db['FreshdeskField'],{'as':_0x8b01('0x1be'),'foreignKey':_0x8b01('0x1ba')});db['FreshdeskField'][_0x8b01('0x10a')](db[_0x8b01('0xb1')],{'as':'Field','foreignKey':_0x8b01('0x1bb')});db['FreshdeskField'][_0x8b01('0x14c')](db['Variable'],{'as':_0x8b01('0x8b'),'foreignKey':'VariableId'});db['VtigerAccount'][_0x8b01('0x10a')](db[_0x8b01('0xb3')],{'as':_0x8b01('0x1b7'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1bc')});db['VtigerConfiguration'][_0x8b01('0x10a')](db[_0x8b01('0xb5')],{'as':_0x8b01('0x1b8'),'foreignKey':_0x8b01('0x1b9')});db[_0x8b01('0xb3')][_0x8b01('0x10a')](db['VtigerField'],{'as':_0x8b01('0x1c1'),'foreignKey':_0x8b01('0x1ba')});db[_0x8b01('0xb3')][_0x8b01('0x10a')](db['VtigerField'],{'as':_0x8b01('0x1b5'),'foreignKey':_0x8b01('0x1bb')});db[_0x8b01('0xb3')]['belongsTo'](db['VtigerAccount'],{'as':_0x8b01('0x169'),'foreignKey':'AccountId'});db['VtigerField'][_0x8b01('0x10a')](db[_0x8b01('0xb5')],{'as':_0x8b01('0x1bd'),'foreignKey':'SubjectId'});db['VtigerField'][_0x8b01('0x10a')](db['VtigerField'],{'as':_0x8b01('0x1be'),'foreignKey':_0x8b01('0x1ba')});db['VtigerField'][_0x8b01('0x10a')](db[_0x8b01('0xb5')],{'as':_0x8b01('0x1bf'),'foreignKey':_0x8b01('0x1bb')});db['VtigerField']['belongsTo'](db[_0x8b01('0x8b')],{'as':_0x8b01('0x8b'),'foreignKey':_0x8b01('0x1c0')});db[_0x8b01('0xb7')]['hasMany'](db[_0x8b01('0x1c6')],{'as':_0x8b01('0x1b7'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1bc')});db['ServicenowConfiguration']['hasMany'](db[_0x8b01('0x1c7')],{'as':_0x8b01('0x1b8'),'foreignKey':_0x8b01('0x1b9')});db[_0x8b01('0x1c6')]['hasMany'](db[_0x8b01('0x1c7')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x8b01('0x1c6')][_0x8b01('0x10a')](db[_0x8b01('0x1c7')],{'as':_0x8b01('0x1b5'),'foreignKey':_0x8b01('0x1bb')});db[_0x8b01('0x1c6')][_0x8b01('0x14c')](db[_0x8b01('0xb7')],{'as':'Account','foreignKey':'AccountId'});db[_0x8b01('0x1c7')][_0x8b01('0x10a')](db[_0x8b01('0x1c7')],{'as':_0x8b01('0x1bd'),'foreignKey':_0x8b01('0x1b9')});db[_0x8b01('0x1c7')][_0x8b01('0x10a')](db['ServicenowField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x8b01('0x1c7')]['hasMany'](db[_0x8b01('0x1c7')],{'as':_0x8b01('0x1bf'),'foreignKey':'FieldId'});db[_0x8b01('0x1c7')][_0x8b01('0x14c')](db[_0x8b01('0x8b')],{'as':_0x8b01('0x8b'),'foreignKey':_0x8b01('0x1c0')});db['Dynamics365Account'][_0x8b01('0x10a')](db[_0x8b01('0xbb')],{'as':'Configurations','onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1bc')});db[_0x8b01('0xb9')]['belongsTo'](db['CloudProvider'],{'as':_0x8b01('0xfc'),'foreignKey':'CloudProviderId'});db[_0x8b01('0xbb')][_0x8b01('0x10a')](db[_0x8b01('0x1c8')],{'as':_0x8b01('0x1b8'),'onDelete':'cascade','foreignKey':_0x8b01('0x1b9')});db[_0x8b01('0xbb')]['hasMany'](db[_0x8b01('0x1c8')],{'as':_0x8b01('0x1c1'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1ba')});db['Dynamics365Configuration'][_0x8b01('0x10a')](db['Dynamics365Field'],{'as':_0x8b01('0x1b5'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1bb')});db[_0x8b01('0xbb')][_0x8b01('0x14c')](db[_0x8b01('0xb9')],{'as':'Account','foreignKey':_0x8b01('0x1bc')});db[_0x8b01('0x1c8')]['hasMany'](db['Dynamics365Field'],{'as':_0x8b01('0x1bd'),'foreignKey':_0x8b01('0x1b9')});db[_0x8b01('0x1c8')][_0x8b01('0x10a')](db[_0x8b01('0x1c8')],{'as':_0x8b01('0x1be'),'foreignKey':'DescriptionId'});db['Dynamics365Field'][_0x8b01('0x10a')](db['Dynamics365Field'],{'as':_0x8b01('0x1bf'),'foreignKey':'FieldId'});db[_0x8b01('0x1c8')][_0x8b01('0x14c')](db[_0x8b01('0x8b')],{'as':'Variable','foreignKey':'VariableId'});db['FreshsalesAccount'][_0x8b01('0x10a')](db[_0x8b01('0xbe')],{'as':'Configurations','onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1bc')});db[_0x8b01('0xbe')][_0x8b01('0x10a')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x8b01('0x1b9')});db[_0x8b01('0xbe')][_0x8b01('0x10a')](db['FreshsalesField'],{'as':_0x8b01('0x1c1'),'foreignKey':_0x8b01('0x1ba')});db[_0x8b01('0xbe')][_0x8b01('0x10a')](db[_0x8b01('0xbf')],{'as':_0x8b01('0x1b5'),'foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0x8b01('0x14c')](db[_0x8b01('0xbd')],{'as':_0x8b01('0x169'),'foreignKey':'AccountId'});db[_0x8b01('0xbf')][_0x8b01('0x10a')](db[_0x8b01('0xbf')],{'as':'Subject','foreignKey':_0x8b01('0x1b9')});db['FreshsalesField'][_0x8b01('0x10a')](db[_0x8b01('0xbf')],{'as':'Description','foreignKey':_0x8b01('0x1ba')});db['FreshsalesField'][_0x8b01('0x10a')](db[_0x8b01('0xbf')],{'as':_0x8b01('0x1bf'),'foreignKey':_0x8b01('0x1bb')});db[_0x8b01('0xbf')][_0x8b01('0x14c')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['ChatQueueReport'][_0x8b01('0x14c')](db[_0x8b01('0x171')],{});db[_0x8b01('0xc3')][_0x8b01('0x14c')](db[_0x8b01('0x11e')],{'as':_0x8b01('0x165'),'foreignKey':_0x8b01('0x176')});db[_0x8b01('0xc3')][_0x8b01('0x14c')](db['CmContact'],{'as':_0x8b01('0x15c'),'foreignKey':_0x8b01('0x15d')});db[_0x8b01('0xc3')][_0x8b01('0x14c')](db['ChatInteraction'],{});db[_0x8b01('0xc3')][_0x8b01('0x14c')](db[_0x8b01('0x61')],{});db[_0x8b01('0xc3')][_0x8b01('0x14c')](db['User'],{});db[_0x8b01('0xc3')][_0x8b01('0x14c')](db['ChatQueue'],{});db[_0x8b01('0x198')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1c9')});db[_0x8b01('0x198')]['belongsTo'](db[_0x8b01('0x14')],{'onDelete':'cascade','foreignKey':_0x8b01('0x1ca')});db[_0x8b01('0xca')]['hasMany'](db[_0x8b01('0xc8')],{'foreignKey':_0x8b01('0x1cb'),'onDelete':_0x8b01('0x106')});db[_0x8b01('0xca')][_0x8b01('0x10a')](db['JscriptyAnswerReport'],{'foreignKey':_0x8b01('0x1cb'),'onDelete':_0x8b01('0x106')});db['SmsQueueReport']['belongsTo'](db[_0x8b01('0x53')],{});db[_0x8b01('0x1cc')]['belongsTo'](db['CmList'],{'as':_0x8b01('0x165'),'foreignKey':_0x8b01('0x176')});db[_0x8b01('0x1cc')][_0x8b01('0x14c')](db[_0x8b01('0x6b')],{'as':'Contact','foreignKey':_0x8b01('0x15d')});db[_0x8b01('0x1cc')][_0x8b01('0x14c')](db[_0x8b01('0x112')],{});db[_0x8b01('0x1cc')][_0x8b01('0x14c')](db[_0x8b01('0x182')],{});db[_0x8b01('0x1cc')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{});db[_0x8b01('0x1cc')][_0x8b01('0x14c')](db[_0x8b01('0x12b')],{});db[_0x8b01('0xd0')][_0x8b01('0x10a')](db[_0x8b01('0xca')],{'foreignKey':_0x8b01('0x1cd')});db[_0x8b01('0xd0')][_0x8b01('0x10a')](db[_0x8b01('0xc8')],{'foreignKey':_0x8b01('0x1cd')});db['JscriptyProject']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x8b01('0x1cd')});db[_0x8b01('0x13a')][_0x8b01('0x11b')](db[_0x8b01('0x14')],{'as':_0x8b01('0x16e'),'through':_0x8b01('0x13c')});db[_0x8b01('0xd7')][_0x8b01('0x11b')](db['User'],{'as':_0x8b01('0x167'),'through':_0x8b01('0x1ce')});db['Team'][_0x8b01('0x11b')](db[_0x8b01('0x1b')],{'through':'TeamVoiceQueue','as':'VoiceQueues'});db['Team'][_0x8b01('0x11b')](db['MailQueue'],{'through':_0x8b01('0x168'),'as':_0x8b01('0x128')});db[_0x8b01('0xd7')][_0x8b01('0x11b')](db[_0x8b01('0x64')],{'through':_0x8b01('0x197'),'as':_0x8b01('0x129')});db['Team']['belongsToMany'](db[_0x8b01('0x50')],{'through':_0x8b01('0x17f'),'as':_0x8b01('0x12a')});db[_0x8b01('0xd7')]['belongsToMany'](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0x8b01('0x12c')});db['Team'][_0x8b01('0x11b')](db[_0x8b01('0x5c')],{'through':'team_has_openchannel_queues','as':_0x8b01('0x12d')});db[_0x8b01('0xd7')][_0x8b01('0x11b')](db['WhatsappQueue'],{'through':_0x8b01('0x1cf'),'as':'WhatsappQueues'});db[_0x8b01('0xd7')][_0x8b01('0x11b')](db[_0x8b01('0xe7')],{'through':_0x8b01('0x100'),'as':_0x8b01('0x127')});db[_0x8b01('0xda')][_0x8b01('0x10a')](db[_0x8b01('0x6d')],{'as':_0x8b01('0x146'),'foreignKey':'CampaignId'});db[_0x8b01('0xda')][_0x8b01('0x10a')](db[_0x8b01('0x147')],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0x8b01('0xda')][_0x8b01('0x10a')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x8b01('0x19f')});db[_0x8b01('0xda')][_0x8b01('0x10a')](db[_0x8b01('0x6f')],{'as':_0x8b01('0x149'),'foreignKey':'CampaignId'});db[_0x8b01('0xda')]['belongsTo'](db['Trunk'],{'as':_0x8b01('0x2c'),'foreignKey':'TrunkId'});db[_0x8b01('0xda')]['belongsTo'](db[_0x8b01('0x2c')],{'as':_0x8b01('0x14d'),'foreignKey':_0x8b01('0x14e')});db[_0x8b01('0xda')][_0x8b01('0x14c')](db['Interval'],{'as':_0x8b01('0x14f'),'foreignKey':'IntervalId'});db['Campaign']['belongsTo'](db[_0x8b01('0x13a')],{'as':_0x8b01('0x13a'),'foreignKey':_0x8b01('0x1d0')});db[_0x8b01('0xda')][_0x8b01('0x11b')](db[_0x8b01('0x11e')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0x8b01('0xda')][_0x8b01('0x11b')](db[_0x8b01('0x11e')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db[_0x8b01('0xdd')]['belongsTo'](db[_0x8b01('0x62')],{'as':_0x8b01('0x62'),'foreignKey':_0x8b01('0x173')});db['MailTransferReport'][_0x8b01('0x14c')](db['MailMessage'],{});db[_0x8b01('0x1d1')][_0x8b01('0x14c')](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db[_0x8b01('0x131')],{'foreignKey':'FromMailAccountId','as':_0x8b01('0x1d2')});db['MailTransferReport'][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'foreignKey':_0x8b01('0x1d3'),'as':'FromAgent'});db['MailTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x8b01('0x1d4'),'as':_0x8b01('0x1d5')});db[_0x8b01('0x1d1')][_0x8b01('0x14c')](db[_0x8b01('0x3e')],{'foreignKey':_0x8b01('0x1d6'),'as':'ToQueue'});db[_0x8b01('0x1d1')][_0x8b01('0x14c')](db[_0x8b01('0x131')],{'foreignKey':_0x8b01('0x1d7'),'as':'ToAccount'});db[_0x8b01('0xe0')][_0x8b01('0x14c')](db[_0x8b01('0x61')],{});db[_0x8b01('0xe0')][_0x8b01('0x14c')](db[_0x8b01('0x60')],{});db[_0x8b01('0xe0')]['belongsTo'](db[_0x8b01('0x171')],{'foreignKey':_0x8b01('0x1d8'),'as':_0x8b01('0x1d2')});db[_0x8b01('0xe0')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'foreignKey':_0x8b01('0x1d3'),'as':'FromAgent'});db[_0x8b01('0xe0')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'foreignKey':_0x8b01('0x1d4'),'as':_0x8b01('0x1d5')});db['ChatTransferReport'][_0x8b01('0x14c')](db[_0x8b01('0x64')],{'foreignKey':_0x8b01('0x1d9'),'as':_0x8b01('0x1da')});db[_0x8b01('0xe0')][_0x8b01('0x14c')](db['ChatWebsite'],{'foreignKey':_0x8b01('0x1db'),'as':_0x8b01('0x1dc')});db[_0x8b01('0x1dd')]['belongsTo'](db[_0x8b01('0x4f')],{});db['FaxTransferReport'][_0x8b01('0x14c')](db['FaxInteraction'],{});db[_0x8b01('0x1dd')][_0x8b01('0x14c')](db[_0x8b01('0x4a')],{'foreignKey':_0x8b01('0x1de'),'as':'FromAccount'});db[_0x8b01('0x1dd')][_0x8b01('0x14c')](db['User'],{'foreignKey':_0x8b01('0x1d3'),'as':_0x8b01('0x1df')});db[_0x8b01('0x1dd')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'foreignKey':_0x8b01('0x1d4'),'as':_0x8b01('0x1d5')});db[_0x8b01('0x1dd')][_0x8b01('0x14c')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0x8b01('0x1da')});db[_0x8b01('0x1dd')][_0x8b01('0x14c')](db[_0x8b01('0x4a')],{'foreignKey':_0x8b01('0x1e0'),'as':_0x8b01('0x1dc')});db[_0x8b01('0xe2')][_0x8b01('0x14c')](db[_0x8b01('0x5b')],{});db[_0x8b01('0xe2')][_0x8b01('0x14c')](db[_0x8b01('0x59')],{});db['OpenchannelTransferReport'][_0x8b01('0x14c')](db['OpenchannelAccount'],{'foreignKey':_0x8b01('0x1e1'),'as':_0x8b01('0x1d2')});db[_0x8b01('0xe2')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x8b01('0xe2')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'foreignKey':_0x8b01('0x1d4'),'as':_0x8b01('0x1d5')});db[_0x8b01('0xe2')][_0x8b01('0x14c')](db[_0x8b01('0x5c')],{'foreignKey':_0x8b01('0x1e2'),'as':'ToQueue'});db[_0x8b01('0xe2')]['belongsTo'](db[_0x8b01('0x134')],{'foreignKey':_0x8b01('0x1e3'),'as':'ToAccount'});db[_0x8b01('0xe4')][_0x8b01('0x14c')](db['SmsMessage'],{});db[_0x8b01('0xe4')][_0x8b01('0x14c')](db[_0x8b01('0x112')],{});db[_0x8b01('0xe4')][_0x8b01('0x14c')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0x8b01('0xe4')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'foreignKey':_0x8b01('0x1d3'),'as':'FromAgent'});db['SmsTransferReport'][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'foreignKey':_0x8b01('0x1d4'),'as':'ToAgent'});db[_0x8b01('0xe4')][_0x8b01('0x14c')](db['SmsQueue'],{'foreignKey':_0x8b01('0x1e4'),'as':_0x8b01('0x1da')});db[_0x8b01('0xe4')][_0x8b01('0x14c')](db[_0x8b01('0x53')],{'foreignKey':_0x8b01('0x1e5'),'as':'ToAccount'});db[_0x8b01('0x11e')][_0x8b01('0x10a')](db[_0x8b01('0x78')],{'as':_0x8b01('0x163'),'foreignKey':_0x8b01('0x176'),'onDelete':'cascade'});db[_0x8b01('0x11e')][_0x8b01('0x10a')](db['CmCustomField'],{'as':_0x8b01('0x1e6'),'foreignKey':_0x8b01('0x176')});db[_0x8b01('0x11e')]['hasMany'](db[_0x8b01('0x6b')],{'as':'Contacts','onDelete':_0x8b01('0x106'),'foreignKey':'ListId'});db[_0x8b01('0x11e')][_0x8b01('0x10a')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x8b01('0x176')});db[_0x8b01('0x11e')][_0x8b01('0x10a')](db[_0x8b01('0x70')],{'as':_0x8b01('0x1e7'),'foreignKey':'ListId'});db['CmList']['hasMany'](db[_0x8b01('0x110')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0x8b01('0x11e')][_0x8b01('0x11b')](db[_0x8b01('0x1b')],{'as':'Queues','through':_0x8b01('0x153')});db[_0x8b01('0x11e')][_0x8b01('0x11b')](db[_0x8b01('0x14')],{'as':_0x8b01('0x167'),'through':'cm_user_has_lists'});db['VoicePrefix'][_0x8b01('0x10a')](db[_0x8b01('0x10d')],{'as':_0x8b01('0x10e'),'onDelete':'cascade'});db[_0x8b01('0xe7')][_0x8b01('0x11b')](db[_0x8b01('0x14')],{'as':_0x8b01('0x167'),'through':_0x8b01('0x102')});db['VoicePrefix'][_0x8b01('0x11b')](db[_0x8b01('0xd7')],{'through':_0x8b01('0x100'),'as':_0x8b01('0x187')});db[_0x8b01('0x119')][_0x8b01('0x10a')](db['User'],{'as':_0x8b01('0x16e'),'foreignKey':_0x8b01('0x11a')});db[_0x8b01('0x119')]['hasMany'](db['UserProfileSection'],{'as':_0x8b01('0x1e8'),'foreignKey':'userProfileId','onDelete':_0x8b01('0x106')});db['UserProfileSection'][_0x8b01('0x10a')](db[_0x8b01('0x1e9')],{'as':_0x8b01('0x1ea'),'foreignKey':_0x8b01('0x1eb'),'onDelete':_0x8b01('0x106')});db['WhatsappAccount'][_0x8b01('0x10a')](db['Disposition'],{'as':_0x8b01('0x163'),'foreignKey':_0x8b01('0x1ec'),'onDelete':'cascade'});db['WhatsappAccount']['hasMany'](db[_0x8b01('0x76')],{'as':_0x8b01('0x164'),'foreignKey':_0x8b01('0x1ec')});db[_0x8b01('0xef')][_0x8b01('0x10a')](db[_0x8b01('0x1ed')],{'as':_0x8b01('0x157'),'foreignKey':_0x8b01('0x1ec')});db['WhatsappAccount'][_0x8b01('0x10a')](db[_0x8b01('0xf3')],{'as':_0x8b01('0x179')});db[_0x8b01('0xef')]['hasMany'](db[_0x8b01('0xf1')],{'as':'Applications'});db[_0x8b01('0xef')]['belongsTo'](db[_0x8b01('0x11e')],{'as':_0x8b01('0x165'),'foreignKey':_0x8b01('0x176')});db[_0x8b01('0xef')][_0x8b01('0x14c')](db[_0x8b01('0x7c')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0x8b01('0x11b')](db['User'],{'as':_0x8b01('0x167'),'through':_0x8b01('0x139')});db[_0x8b01('0xf1')][_0x8b01('0x14c')](db['User'],{'onDelete':'restrict'});db[_0x8b01('0xf1')][_0x8b01('0x14c')](db[_0x8b01('0xfa')],{'onDelete':_0x8b01('0x160')});db[_0x8b01('0xf1')]['belongsTo'](db[_0x8b01('0xef')],{'onDelete':'restrict'});db[_0x8b01('0xf1')][_0x8b01('0x14c')](db['Interval'],{'onDelete':_0x8b01('0x160'),'foreignKey':_0x8b01('0x150')});db[_0x8b01('0xf1')][_0x8b01('0x14c')](db['Tag'],{'onDelete':_0x8b01('0x160'),'foreignKey':_0x8b01('0x174')});db['WhatsappInteraction'][_0x8b01('0x10a')](db[_0x8b01('0x1ed')],{'as':_0x8b01('0x157'),'onDelete':_0x8b01('0x106'),'foreignKey':_0x8b01('0x1ee')});db[_0x8b01('0xf3')][_0x8b01('0x14c')](db[_0x8b01('0xef')],{'as':'Account','foreignKey':_0x8b01('0x1ec')});db[_0x8b01('0xf3')][_0x8b01('0x14c')](db[_0x8b01('0x6b')],{'as':'Contact','foreignKey':_0x8b01('0x15d')});db['WhatsappInteraction']['belongsTo'](db[_0x8b01('0x14')],{'as':_0x8b01('0x16a'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0x8b01('0x11b')](db[_0x8b01('0x85')],{'through':'whatsapp_interaction_has_tags','as':_0x8b01('0x16c')});db[_0x8b01('0xf3')][_0x8b01('0x11b')](db[_0x8b01('0x85')],{'through':_0x8b01('0x1ac'),'as':'ThroughTags'});db[_0x8b01('0xf3')][_0x8b01('0x11b')](db[_0x8b01('0x14')],{'as':'Users','through':_0x8b01('0x1ef'),'foreignKey':_0x8b01('0x1ee')});db['WhatsappMessage'][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'as':_0x8b01('0x14')});db[_0x8b01('0x1ed')][_0x8b01('0x14c')](db[_0x8b01('0x6b')],{'onDelete':_0x8b01('0x106'),'as':_0x8b01('0x15c')});db['WhatsappMessage'][_0x8b01('0x14c')](db[_0x8b01('0xf3')],{'onDelete':'cascade','as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0x8b01('0x1ed')]['belongsTo'](db[_0x8b01('0xef')],{'as':_0x8b01('0x169'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport']['belongsTo'](db['WhatsappAccount'],{});db[_0x8b01('0xf6')][_0x8b01('0x14c')](db[_0x8b01('0x11e')],{'as':_0x8b01('0x165'),'foreignKey':'ListId'});db['WhatsappQueueReport'][_0x8b01('0x14c')](db[_0x8b01('0x6b')],{'as':_0x8b01('0x15c'),'foreignKey':_0x8b01('0x15d')});db[_0x8b01('0xf6')]['belongsTo'](db['WhatsappInteraction'],{});db[_0x8b01('0xf6')][_0x8b01('0x14c')](db['WhatsappQueue'],{});db[_0x8b01('0xf6')][_0x8b01('0x14c')](db[_0x8b01('0x1ed')],{});db[_0x8b01('0xf6')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{});db[_0x8b01('0xf8')][_0x8b01('0x14c')](db[_0x8b01('0x1ed')],{});db[_0x8b01('0xf8')][_0x8b01('0x14c')](db[_0x8b01('0xf3')],{});db[_0x8b01('0xf8')][_0x8b01('0x14c')](db[_0x8b01('0xef')],{'foreignKey':_0x8b01('0x1f0'),'as':_0x8b01('0x1d2')});db[_0x8b01('0xf8')]['belongsTo'](db[_0x8b01('0xef')],{'foreignKey':_0x8b01('0x1f1'),'as':_0x8b01('0x1dc')});db[_0x8b01('0xf8')]['belongsTo'](db[_0x8b01('0xfa')],{'foreignKey':_0x8b01('0x1f2'),'as':_0x8b01('0x1da')});db[_0x8b01('0xf8')][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'foreignKey':_0x8b01('0x1d3'),'as':'FromAgent'});db['WhatsappTransferReport'][_0x8b01('0x14c')](db[_0x8b01('0x14')],{'foreignKey':_0x8b01('0x1d4'),'as':_0x8b01('0x1d5')});db[_0x8b01('0xfa')][_0x8b01('0x11b')](db[_0x8b01('0x14')],{'as':_0x8b01('0x167'),'through':_0x8b01('0x37'),'foreignKey':_0x8b01('0x1f3')});db[_0x8b01('0xfa')][_0x8b01('0x11b')](db['Team'],{'through':_0x8b01('0x1cf'),'as':_0x8b01('0x187')});db['UserSetting'][_0x8b01('0x14c')](db['User'],{'as':'user','foreignKey':_0x8b01('0x109'),'onDelete':_0x8b01('0x106'),'hooks':!![]});db['CloudProvider'][_0x8b01('0x107')](db[_0x8b01('0xb9')],{'as':_0x8b01('0xb9'),'onDelete':_0x8b01('0x160')});db[_0x8b01('0xfc')]['hasOne'](db[_0x8b01('0x39')],{'as':_0x8b01('0x161'),'onDelete':_0x8b01('0x160')});db['CloudProvider'][_0x8b01('0x107')](db[_0x8b01('0x3b')],{'as':_0x8b01('0x162'),'onDelete':_0x8b01('0x160')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa0dd=['defaultsDeep','xcall','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','database','username','password','options','sequelizeHistory','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../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','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','cascade','UserId','User','userSetting','hasMany','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteraction','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','MailInteractions','UserNotification','UserNotifications','belongsTo','belongsToMany','Groups','cm_user_has_contacts','CmList','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperFinal','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','Pause','mandatoryDispositionPause','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','VoiceMailMessage','QueueCalls','AgentReports','uniqueid','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Interactions','List','ListId','Template','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','TagId','Items','FaxAccountId','Answers','Exntensions','FaxMessage','mandatoryDispositionPauseId','ContactId','fax_interaction_has_tags','Tags','FaxInteractionId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ProactiveActions','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','UserChatQueue','team_has_chat_queues','ChatGroupId','chat_group_has_users','Contacts','JscriptySessionReport','Company','CompanyId','cm_contact_has_tags','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','Trigger','AnyConditions','AnyCondition','Fields','AnalyticFieldReport','MetricId','AccountId','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Field','Configurations','DeskAccount','int_desk_configuration_has_tags','VariableId','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowAccount','ServicenowField','FreshsalesConfiguration','FromId','ToId','SessionId','ProjectId','JscriptyQuestionReport','ChatQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ChatTransferReport','FromChatWebsiteId','ToUserId','ToAgent','ToChatQueueId','ToQueue','ToChatWebsiteId','ToAccount','FromFaxAccountId','FromUserId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Queues','userProfileId','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','hasOne','exports','../config/environment','sequelize','jstz','determine'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0dd,0x1ed));var _0xda0d=function(_0x54a0b8,_0xfcd565){_0x54a0b8=_0x54a0b8-0x0;var _0x5b14fa=_0xa0dd[_0x54a0b8];return _0x5b14fa;};'use strict';var config=require(_0xda0d('0x0'));var Sequelize=require(_0xda0d('0x1'));var _=require('lodash');var jstz=require(_0xda0d('0x2'));var timezone=jstz[_0xda0d('0x3')]();config[_0xda0d('0x1')]=_[_0xda0d('0x4')](config[_0xda0d('0x1')],{'database':'motion2','username':_0xda0d('0x5'),'password':_0xda0d('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xda0d('0x7'),'dialectOptions':{'charset':_0xda0d('0x8')},'logging':![],'timezone':timezone[_0xda0d('0x9')](),'define':{'charset':_0xda0d('0xa'),'collate':_0xda0d('0xb')}}});config['sequelizeHistory']=_[_0xda0d('0x4')](config['sequelizeHistory'],{'database':'motion2','username':_0xda0d('0x5'),'password':_0xda0d('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xda0d('0x7'),'dialectOptions':{'charset':_0xda0d('0x8')},'logging':![],'timezone':timezone[_0xda0d('0x9')](),'define':{'charset':_0xda0d('0xa'),'collate':_0xda0d('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xda0d('0xc')],config['sequelize'][_0xda0d('0xd')],config['sequelize'][_0xda0d('0xe')],config['sequelize'][_0xda0d('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xda0d('0x10')][_0xda0d('0xc')],config['sequelizeHistory'][_0xda0d('0xd')],config[_0xda0d('0x10')][_0xda0d('0xe')],config['sequelizeHistory'][_0xda0d('0xf')])};db['User']=db['sequelize']['import']('../api/user/user.model');db[_0xda0d('0x11')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x13'));db[_0xda0d('0x14')]=db['sequelize'][_0xda0d('0x12')]('../api/voiceContext/voiceContext.model');db[_0xda0d('0x15')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x16'));db[_0xda0d('0x17')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x18'));db[_0xda0d('0x19')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x1a'));db[_0xda0d('0x1b')]=db[_0xda0d('0x1')]['import'](_0xda0d('0x1c'));db[_0xda0d('0x1d')]=db['sequelize']['import'](_0xda0d('0x1e'));db[_0xda0d('0x1f')]=db['sequelize'][_0xda0d('0x12')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db['sequelize'][_0xda0d('0x12')](_0xda0d('0x20'));db[_0xda0d('0x21')]=db['sequelize'][_0xda0d('0x12')]('../api/voiceCallReport/voiceCallReport.model');db[_0xda0d('0x22')]=db['sequelize'][_0xda0d('0x12')](_0xda0d('0x23'));db[_0xda0d('0x24')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x25'));db[_0xda0d('0x26')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xda0d('0x27')]=db[_0xda0d('0x1')]['import'](_0xda0d('0x28'));db[_0xda0d('0x29')]=db[_0xda0d('0x1')]['import'](_0xda0d('0x2a'));db['VoiceTransferReport']=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x2b'));db[_0xda0d('0x2c')]=db[_0xda0d('0x1')]['import'](_0xda0d('0x2d'));db[_0xda0d('0x2e')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x2f'));db['UserChatQueue']=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x30'));db[_0xda0d('0x31')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x32'));db[_0xda0d('0x33')]=db[_0xda0d('0x1')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0xda0d('0x34')]=db['sequelize'][_0xda0d('0x12')](_0xda0d('0x35'));db[_0xda0d('0x36')]=db['sequelize'][_0xda0d('0x12')](_0xda0d('0x37'));db[_0xda0d('0x38')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x39'));db[_0xda0d('0x3a')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/mailServerIn/mailServerIn.model');db[_0xda0d('0x3b')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/mailServerOut/mailServerOut.model');db[_0xda0d('0x3c')]=db['sequelize'][_0xda0d('0x12')]('../api/mailAccount/mailAccount.model');db[_0xda0d('0x3d')]=db['sequelize']['import'](_0xda0d('0x3e'));db['MailSubstatus']=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x3f'));db['MailInteraction']=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x40'));db[_0xda0d('0x41')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x42'));db[_0xda0d('0x43')]=db['sequelize'][_0xda0d('0x12')]('../api/mailApplication/mailApplication.model');db[_0xda0d('0x44')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x45'));db[_0xda0d('0x46')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x47'));db['DashboardItem']=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x48'));db[_0xda0d('0x49')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x4a'));db[_0xda0d('0x4b')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x4c'));db[_0xda0d('0x4d')]=db['sequelize'][_0xda0d('0x12')](_0xda0d('0x4e'));db['FaxMessage']=db[_0xda0d('0x1')]['import'](_0xda0d('0x4f'));db[_0xda0d('0x50')]=db['sequelize']['import'](_0xda0d('0x51'));db[_0xda0d('0x52')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x53'));db[_0xda0d('0x54')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/smsAccount/smsAccount.model');db[_0xda0d('0x55')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x56'));db[_0xda0d('0x57')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x58'));db['SmsMessage']=db['sequelize'][_0xda0d('0x12')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db['sequelize'][_0xda0d('0x12')](_0xda0d('0x59'));db[_0xda0d('0x5a')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/openchannelAccount/openchannelAccount.model');db[_0xda0d('0x5b')]=db[_0xda0d('0x1')]['import'](_0xda0d('0x5c'));db['OpenchannelInteraction']=db['sequelize'][_0xda0d('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0xda0d('0x5d')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x5e'));db[_0xda0d('0x5f')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x60'));db['ChatWebsite']=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x61'));db[_0xda0d('0x62')]=db[_0xda0d('0x1')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xda0d('0x63')]=db[_0xda0d('0x1')]['import'](_0xda0d('0x64'));db[_0xda0d('0x65')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x66'));db[_0xda0d('0x67')]=db['sequelize'][_0xda0d('0x12')](_0xda0d('0x68'));db[_0xda0d('0x69')]=db['sequelize'][_0xda0d('0x12')](_0xda0d('0x6a'));db[_0xda0d('0x6b')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x6c'));db[_0xda0d('0x6d')]=db[_0xda0d('0x1')]['import'](_0xda0d('0x6e'));db[_0xda0d('0x6f')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x70'));db[_0xda0d('0x71')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x72'));db[_0xda0d('0x73')]=db['sequelize'][_0xda0d('0x12')](_0xda0d('0x74'));db[_0xda0d('0x75')]=db['sequelize'][_0xda0d('0x12')]('../api/cmHopper/cmHopper.model');db[_0xda0d('0x76')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x77'));db['CmHopperFinal']=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x78'));db['CmHopperHistory']=db[_0xda0d('0x1')]['import'](_0xda0d('0x79'));db[_0xda0d('0x7a')]=db[_0xda0d('0x1')]['import'](_0xda0d('0x7b'));db[_0xda0d('0x7c')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x7d'));db['Action']=db['sequelize'][_0xda0d('0x12')]('../api/action/action.model');db[_0xda0d('0x7e')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x7f'));db[_0xda0d('0x80')]=db['sequelize'][_0xda0d('0x12')]('../api/cannedAnswer/cannedAnswer.model');db[_0xda0d('0x81')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x82'));db[_0xda0d('0x83')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x84'));db['Interval']=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x85'));db['Pause']=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/pause/pause.model');db[_0xda0d('0x86')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x87'));db[_0xda0d('0x88')]=db[_0xda0d('0x1')]['import'](_0xda0d('0x89'));db['Schedule']=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x8a'));db[_0xda0d('0x8b')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x8c'));db[_0xda0d('0x8d')]=db[_0xda0d('0x1')]['import']('../api/tag/tag.model');db['Template']=db['sequelize']['import'](_0xda0d('0x8e'));db['Trigger']=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x8f'));db[_0xda0d('0x90')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x91'));db['Integration']=db['sequelize'][_0xda0d('0x12')](_0xda0d('0x92'));db[_0xda0d('0x93')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x94'));db['AnalyticCustomReport']=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x95'));db[_0xda0d('0x96')]=db['sequelize'][_0xda0d('0x12')](_0xda0d('0x97'));db[_0xda0d('0x98')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x99'));db[_0xda0d('0x9a')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x9b'));db['AnalyticFieldReport']=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0xda0d('0x9c')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xda0d('0x9d')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x9e'));db[_0xda0d('0x9f')]=db['sequelize'][_0xda0d('0x12')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xda0d('0xa0')]=db['sequelize'][_0xda0d('0x12')](_0xda0d('0xa1'));db[_0xda0d('0xa2')]=db['sequelize'][_0xda0d('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xda0d('0xa3')]=db['sequelize'][_0xda0d('0x12')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xda0d('0xa4')]=db[_0xda0d('0x1')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db['sequelize'][_0xda0d('0x12')](_0xda0d('0xa5'));db[_0xda0d('0xa6')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xda0d('0xa7')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xa8'));db[_0xda0d('0xa9')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/intZohoAccount/intZohoAccount.model');db[_0xda0d('0xaa')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xab'));db[_0xda0d('0xac')]=db[_0xda0d('0x1')]['import']('../api/intZohoField/intZohoField.model');db[_0xda0d('0xad')]=db[_0xda0d('0x1')]['import'](_0xda0d('0xae'));db[_0xda0d('0xaf')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xb0'));db[_0xda0d('0xb1')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xb2'));db[_0xda0d('0xb3')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xda0d('0xb4')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xb5'));db[_0xda0d('0xb6')]=db[_0xda0d('0x1')]['import'](_0xda0d('0xb7'));db[_0xda0d('0xb8')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/intVtigerAccount/intVtigerAccount.model');db['VtigerConfiguration']=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xda0d('0xb9')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xba'));db['ServicenowAccount']=db['sequelize'][_0xda0d('0x12')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xda0d('0xbb')]=db['sequelize'][_0xda0d('0x12')](_0xda0d('0xbc'));db['ServicenowField']=db['sequelize'][_0xda0d('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0xda0d('0xbd')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xda0d('0xbe')]=db[_0xda0d('0x1')]['import'](_0xda0d('0xbf'));db[_0xda0d('0xc0')]=db[_0xda0d('0x1')]['import'](_0xda0d('0xc1'));db[_0xda0d('0xc2')]=db['sequelize'][_0xda0d('0x12')](_0xda0d('0xc3'));db['FreshsalesConfiguration']=db['sequelize'][_0xda0d('0x12')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xda0d('0xc4')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xc5'));db[_0xda0d('0xc6')]=db['sequelize']['import'](_0xda0d('0x92'));db['Network']=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xc7'));db[_0xda0d('0xc8')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/chatQueueReport/chatQueueReport.model');db[_0xda0d('0xc9')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xca'));db[_0xda0d('0xcb')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xcc'));db['JscriptyQuestionReport']=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db['JscriptySessionReport']=db['sequelize']['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xda0d('0xcd')]=db[_0xda0d('0x1')]['import'](_0xda0d('0xce'));db[_0xda0d('0xcf')]=db['sequelize'][_0xda0d('0x12')](_0xda0d('0xd0'));db[_0xda0d('0xd1')]=db[_0xda0d('0x1')]['import'](_0xda0d('0xd2'));db[_0xda0d('0xd3')]=db[_0xda0d('0x1')]['import'](_0xda0d('0xd4'));db[_0xda0d('0xd5')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/setting/setting.model');db[_0xda0d('0xd6')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xd7'));db[_0xda0d('0xd8')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/squareProject/squareProject.model');db[_0xda0d('0xd9')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xda'));db[_0xda0d('0xdb')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xdc'));db[_0xda0d('0xdd')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xde'));db['License']=db[_0xda0d('0x1')]['import'](_0xda0d('0xdf'));db[_0xda0d('0xe0')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xe1'));db[_0xda0d('0xe2')]=db['sequelize'][_0xda0d('0x12')]('../api/migration/migration.model');db[_0xda0d('0xe3')]=db[_0xda0d('0x1')]['import'](_0xda0d('0xe4'));db[_0xda0d('0xe5')]=db[_0xda0d('0x1')]['import'](_0xda0d('0xe6'));db[_0xda0d('0xe7')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xe8'));db['ChatTransferReport']=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/chatTransferReport/chatTransferReport.model');db[_0xda0d('0xe9')]=db[_0xda0d('0x1')]['import'](_0xda0d('0xea'));db['OpenchannelTransferReport']=db['sequelize'][_0xda0d('0x12')](_0xda0d('0xeb'));db[_0xda0d('0xec')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/cmList/cmList.model');db[_0xda0d('0xed')]=db['sequelize']['import'](_0xda0d('0xee'));db[_0xda0d('0xef')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xf0'));db[_0xda0d('0xf1')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xf2'));db[_0xda0d('0xf3')]=db['sequelize']['import'](_0xda0d('0xf4'));db['UserNotification']=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xf5'));db['WhatsappAccount']=db[_0xda0d('0x1')]['import'](_0xda0d('0xf6'));db[_0xda0d('0xf7')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/whatsappApplication/whatsappApplication.model');db[_0xda0d('0xf8')]=db['sequelize'][_0xda0d('0x12')](_0xda0d('0xf9'));db[_0xda0d('0xfa')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xfb'));db['WhatsappQueueReport']=db[_0xda0d('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xda0d('0xfc')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xfd'));db[_0xda0d('0xfe')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0xff'));db[_0xda0d('0x100')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x101'));db[_0xda0d('0x102')]=db['sequelize'][_0xda0d('0x12')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xda0d('0x103')]=db['sequelize'][_0xda0d('0x12')](_0xda0d('0x104'));db[_0xda0d('0x105')]=db[_0xda0d('0x1')][_0xda0d('0x12')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0xda0d('0x106')]=db[_0xda0d('0x1')][_0xda0d('0x12')](_0xda0d('0x107'));db['User']['hasOne'](db[_0xda0d('0x1f')],{'as':'VoiceMail','onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x109')});db[_0xda0d('0x10a')]['hasOne'](db[_0xda0d('0x106')],{'as':_0xda0d('0x10b'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x109')});db['User'][_0xda0d('0x10c')](db[_0xda0d('0x1b')],{'as':'Recordings','foreignKey':'UserId'});db[_0xda0d('0x10a')][_0xda0d('0x10c')](db[_0xda0d('0x2c')],{'as':_0xda0d('0x10d'),'foreignKey':_0xda0d('0x109')});db[_0xda0d('0x10a')]['hasMany'](db['VoiceExtension'],{'as':_0xda0d('0x10e'),'onDelete':_0xda0d('0x108'),'hooks':!![]});db[_0xda0d('0x10a')][_0xda0d('0x10c')](db['CmHopperFinal'],{'as':_0xda0d('0x10f'),'foreignKey':_0xda0d('0x109')});db['User'][_0xda0d('0x10c')](db[_0xda0d('0x110')],{'as':_0xda0d('0x111'),'foreignKey':'UserId'});db[_0xda0d('0x10a')][_0xda0d('0x10c')](db[_0xda0d('0x7a')],{'as':_0xda0d('0x7a'),'foreignKey':'UserId'});db[_0xda0d('0x10a')][_0xda0d('0x10c')](db[_0xda0d('0x112')],{'as':'OpenchannelInteractions','foreignKey':_0xda0d('0x109')});db[_0xda0d('0x10a')][_0xda0d('0x10c')](db[_0xda0d('0x65')],{'as':_0xda0d('0x113'),'foreignKey':_0xda0d('0x109')});db[_0xda0d('0x10a')][_0xda0d('0x10c')](db[_0xda0d('0x57')],{'as':_0xda0d('0x114'),'foreignKey':'UserId'});db[_0xda0d('0x10a')][_0xda0d('0x10c')](db['FaxInteraction'],{'as':_0xda0d('0x115'),'foreignKey':'UserId'});db[_0xda0d('0x10a')][_0xda0d('0x10c')](db[_0xda0d('0x116')],{'as':_0xda0d('0x117'),'foreignKey':_0xda0d('0x109')});db[_0xda0d('0x10a')][_0xda0d('0x10c')](db[_0xda0d('0xf8')],{'as':'WhatsappInteractions','foreignKey':_0xda0d('0x109')});db[_0xda0d('0x10a')]['hasMany'](db[_0xda0d('0x118')],{'as':_0xda0d('0x119'),'foreignKey':'SenderId'});db[_0xda0d('0x10a')][_0xda0d('0x11a')](db[_0xda0d('0xef')],{'as':_0xda0d('0xef'),'foreignKey':'userProfileId'});db[_0xda0d('0x10a')][_0xda0d('0x11b')](db[_0xda0d('0x6d')],{'as':_0xda0d('0x11c'),'through':'chat_group_has_users'});db[_0xda0d('0x10a')]['belongsToMany'](db[_0xda0d('0x73')],{'as':'Contacts','through':_0xda0d('0x11d')});db[_0xda0d('0x10a')][_0xda0d('0x11b')](db[_0xda0d('0x11e')],{'as':'Lists','through':_0xda0d('0x11f')});db['User'][_0xda0d('0x11b')](db[_0xda0d('0xdd')],{'through':_0xda0d('0x120')});db[_0xda0d('0x10a')]['belongsToMany'](db['MailInteraction'],{'as':'MailInteractions','through':_0xda0d('0x121')});db[_0xda0d('0x10a')]['belongsToMany'](db[_0xda0d('0x65')],{'as':_0xda0d('0x113'),'through':_0xda0d('0x122')});db['User']['belongsToMany'](db['FaxInteraction'],{'as':_0xda0d('0x115'),'through':_0xda0d('0x123')});db[_0xda0d('0x10a')][_0xda0d('0x11b')](db['SmsInteraction'],{'as':_0xda0d('0x114'),'through':_0xda0d('0x124')});db[_0xda0d('0x10a')][_0xda0d('0x11b')](db[_0xda0d('0x112')],{'as':_0xda0d('0x125'),'through':_0xda0d('0x126')});db[_0xda0d('0x10a')][_0xda0d('0x11b')](db[_0xda0d('0xf8')],{'as':'WhatsappInteractions','through':_0xda0d('0x127')});db[_0xda0d('0x10a')][_0xda0d('0x11b')](db[_0xda0d('0x19')],{'as':_0xda0d('0x128'),'through':'UserVoiceQueue','required':![]});db[_0xda0d('0x10a')]['belongsToMany'](db['VoicePrefix'],{'as':_0xda0d('0x129'),'through':_0xda0d('0x105'),'required':![]});db[_0xda0d('0x10a')][_0xda0d('0x11b')](db[_0xda0d('0x3d')],{'as':_0xda0d('0x12a'),'through':_0xda0d('0x31'),'required':![]});db[_0xda0d('0x10a')][_0xda0d('0x11b')](db['ChatQueue'],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0xda0d('0x10a')]['belongsToMany'](db['FaxQueue'],{'as':_0xda0d('0x12b'),'through':_0xda0d('0x33'),'required':![]});db[_0xda0d('0x10a')][_0xda0d('0x11b')](db[_0xda0d('0x12c')],{'as':_0xda0d('0x12d'),'through':_0xda0d('0x34'),'required':![]});db[_0xda0d('0x10a')]['belongsToMany'](db[_0xda0d('0x5f')],{'as':_0xda0d('0x12e'),'through':_0xda0d('0x36'),'required':![]});db[_0xda0d('0x10a')][_0xda0d('0x11b')](db[_0xda0d('0xfe')],{'as':_0xda0d('0x12f'),'through':'UserWhatsappQueue','required':![]});db[_0xda0d('0x10a')][_0xda0d('0x11b')](db[_0xda0d('0x11e')],{'through':_0xda0d('0x11f')});db[_0xda0d('0x10a')][_0xda0d('0x11b')](db[_0xda0d('0x130')],{'as':_0xda0d('0x131'),'through':_0xda0d('0x132')});db['User'][_0xda0d('0x11b')](db[_0xda0d('0x49')],{'as':'FaxAccounts','through':_0xda0d('0x133')});db[_0xda0d('0x10a')][_0xda0d('0x11b')](db[_0xda0d('0x3c')],{'as':'MailAccounts','through':_0xda0d('0x134')});db['User']['belongsToMany'](db[_0xda0d('0x5a')],{'as':_0xda0d('0x135'),'through':'user_has_openchannel_accounts'});db[_0xda0d('0x10a')][_0xda0d('0x11b')](db['SmsAccount'],{'as':_0xda0d('0x136'),'through':_0xda0d('0x137')});db[_0xda0d('0x10a')]['belongsToMany'](db[_0xda0d('0x138')],{'as':_0xda0d('0x139'),'through':_0xda0d('0x13a')});db['User'][_0xda0d('0x11b')](db[_0xda0d('0xd8')],{'as':_0xda0d('0x13b'),'through':'user_has_square_projects'});db[_0xda0d('0x11')]['hasMany'](db[_0xda0d('0x15')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':'ChanSpyId'});db[_0xda0d('0x14')][_0xda0d('0x10c')](db[_0xda0d('0x15')],{'onDelete':_0xda0d('0x108')});db[_0xda0d('0x15')][_0xda0d('0x10c')](db[_0xda0d('0x15')],{'as':_0xda0d('0x13c'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x17')][_0xda0d('0x11b')](db[_0xda0d('0x8b')],{'as':_0xda0d('0x13d'),'through':_0xda0d('0x13e')});db[_0xda0d('0x19')][_0xda0d('0x10c')](db['UserVoiceQueueRt'],{'as':_0xda0d('0x13f'),'foreignKey':_0xda0d('0x140')});db[_0xda0d('0x19')]['hasMany'](db[_0xda0d('0x75')],{'as':_0xda0d('0x141'),'foreignKey':_0xda0d('0x140')});db[_0xda0d('0x19')][_0xda0d('0x10c')](db[_0xda0d('0x142')],{'as':_0xda0d('0x10f'),'foreignKey':_0xda0d('0x140')});db['VoiceQueue'][_0xda0d('0x10c')](db[_0xda0d('0x110')],{'as':_0xda0d('0x143'),'foreignKey':_0xda0d('0x140')});db[_0xda0d('0x19')]['hasMany'](db[_0xda0d('0x7a')],{'as':_0xda0d('0x7a'),'foreignKey':_0xda0d('0x140')});db['VoiceQueue'][_0xda0d('0x10c')](db[_0xda0d('0x76')],{'as':_0xda0d('0x144'),'foreignKey':_0xda0d('0x140')});db['VoiceQueue'][_0xda0d('0x10c')](db['JscriptySessionReport'],{'as':_0xda0d('0x145'),'foreignKey':_0xda0d('0x140')});db['VoiceQueue']['belongsTo'](db[_0xda0d('0x29')],{'as':_0xda0d('0x29'),'foreignKey':_0xda0d('0x146')});db['VoiceQueue'][_0xda0d('0x11a')](db[_0xda0d('0x29')],{'as':_0xda0d('0x147'),'foreignKey':_0xda0d('0x148')});db[_0xda0d('0x19')][_0xda0d('0x11a')](db[_0xda0d('0x149')],{'as':_0xda0d('0x149'),'foreignKey':_0xda0d('0x14a')});db[_0xda0d('0x19')][_0xda0d('0x11a')](db[_0xda0d('0x14b')],{'as':_0xda0d('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xda0d('0x19')][_0xda0d('0x11b')](db[_0xda0d('0x11e')],{'as':_0xda0d('0x14d'),'through':_0xda0d('0x14e')});db['VoiceQueue'][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x14f'),'through':_0xda0d('0x2e')});db[_0xda0d('0x19')][_0xda0d('0x11b')](db[_0xda0d('0xdd')],{'as':_0xda0d('0x150'),'through':_0xda0d('0x102')});db['VoiceQueue']['belongsToMany'](db['CmList'],{'as':_0xda0d('0x151'),'through':_0xda0d('0x152')});db[_0xda0d('0x1b')]['belongsTo'](db[_0xda0d('0x10a')],{'as':_0xda0d('0x10a'),'foreignKey':'UserId'});db[_0xda0d('0x1d')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'as':'User','foreignKey':_0xda0d('0x109')});db[_0xda0d('0x1f')][_0xda0d('0x10c')](db['VoiceMailMessage'],{'as':_0xda0d('0x153'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x154'),'sourceKey':'mailbox'});db[_0xda0d('0x155')][_0xda0d('0x11a')](db['VoiceMail'],{'foreignKey':_0xda0d('0x154'),'targetKey':'mailbox'});db[_0xda0d('0x21')][_0xda0d('0x10c')](db[_0xda0d('0x26')],{'as':_0xda0d('0x156'),'foreignKey':'uniqueid','constraints':![]});db[_0xda0d('0x21')][_0xda0d('0x10c')](db[_0xda0d('0x24')],{'as':_0xda0d('0x157'),'foreignKey':_0xda0d('0x158'),'constraints':![]});db[_0xda0d('0x21')][_0xda0d('0x11a')](db['User'],{'as':_0xda0d('0x10a'),'foreignKey':_0xda0d('0x109')});db['VoiceCallReport'][_0xda0d('0x11a')](db[_0xda0d('0x73')],{'as':'Contact','foreignKey':'ContactId'});db[_0xda0d('0x3a')]['belongsTo'](db[_0xda0d('0x3c')],{'as':'MailAccount','foreignKey':_0xda0d('0x159')});db[_0xda0d('0x3a')][_0xda0d('0x11a')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0xda0d('0x15a'),'onDelete':_0xda0d('0x15b')});db[_0xda0d('0x3b')][_0xda0d('0x11a')](db['MailAccount'],{'as':_0xda0d('0x3c'),'foreignKey':_0xda0d('0x159')});db[_0xda0d('0x3b')]['belongsTo'](db[_0xda0d('0x100')],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':'restrict'});db['MailAccount']['hasOne'](db['MailServerIn'],{'as':_0xda0d('0x15c'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x3c')]['hasOne'](db[_0xda0d('0x3b')],{'as':_0xda0d('0x15d'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x3c')]['hasMany'](db[_0xda0d('0x81')],{'as':_0xda0d('0x15e'),'foreignKey':_0xda0d('0x159'),'onDelete':_0xda0d('0x108')});db['MailAccount']['hasMany'](db[_0xda0d('0x80')],{'as':'Answers','foreignKey':_0xda0d('0x159')});db[_0xda0d('0x3c')]['hasMany'](db[_0xda0d('0x41')],{'as':_0xda0d('0x153'),'foreignKey':'MailAccountId'});db['MailAccount'][_0xda0d('0x10c')](db[_0xda0d('0x116')],{'as':_0xda0d('0x15f')});db[_0xda0d('0x3c')][_0xda0d('0x10c')](db[_0xda0d('0x43')],{'as':_0xda0d('0x13c')});db['MailAccount']['belongsTo'](db['CmList'],{'as':_0xda0d('0x160'),'foreignKey':_0xda0d('0x161')});db[_0xda0d('0x3c')][_0xda0d('0x11a')](db[_0xda0d('0x162')],{'as':_0xda0d('0x162'),'foreignKey':'TemplateId'});db[_0xda0d('0x3c')]['belongsTo'](db[_0xda0d('0x14b')],{'as':_0xda0d('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xda0d('0x3c')][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x14f'),'through':'user_has_mail_accounts'});db[_0xda0d('0x3d')][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x14f'),'through':_0xda0d('0x31')});db[_0xda0d('0x3d')][_0xda0d('0x11b')](db[_0xda0d('0xdd')],{'through':_0xda0d('0x163'),'as':_0xda0d('0x150')});db[_0xda0d('0x116')][_0xda0d('0x10c')](db[_0xda0d('0x41')],{'as':_0xda0d('0x153'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x164')});db['MailInteraction']['belongsTo'](db[_0xda0d('0x3c')],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x159')});db[_0xda0d('0x116')]['belongsTo'](db[_0xda0d('0x73')],{'as':_0xda0d('0x166'),'foreignKey':'ContactId'});db[_0xda0d('0x116')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x167'),'foreignKey':_0xda0d('0x109')});db['MailInteraction'][_0xda0d('0x11b')](db[_0xda0d('0x8d')],{'through':_0xda0d('0x168'),'as':'Tags'});db[_0xda0d('0x116')]['belongsToMany'](db[_0xda0d('0x8d')],{'through':_0xda0d('0x168'),'as':_0xda0d('0x169')});db['MailInteraction'][_0xda0d('0x11b')](db['User'],{'as':_0xda0d('0x16a'),'through':_0xda0d('0x121'),'foreignKey':_0xda0d('0x164')});db[_0xda0d('0x41')][_0xda0d('0x10c')](db[_0xda0d('0xe3')],{'as':_0xda0d('0x16b'),'onDelete':_0xda0d('0x108')});db['MailMessage'][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'as':'User'});db[_0xda0d('0x41')]['belongsTo'](db['CmContact'],{'onDelete':_0xda0d('0x108'),'as':_0xda0d('0x166')});db[_0xda0d('0x41')][_0xda0d('0x11a')](db['MailInteraction'],{'as':_0xda0d('0x16c'),'foreignKey':_0xda0d('0x164')});db[_0xda0d('0x41')][_0xda0d('0x11a')](db['MailAccount'],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x159')});db[_0xda0d('0x41')][_0xda0d('0x11a')](db[_0xda0d('0x130')],{'as':_0xda0d('0x130'),'foreignKey':_0xda0d('0x16d')});db[_0xda0d('0x41')][_0xda0d('0x11a')](db[_0xda0d('0x69')],{'as':_0xda0d('0x69'),'foreignKey':'ChatOfflineMessageId'});db[_0xda0d('0x43')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'onDelete':_0xda0d('0x15b')});db[_0xda0d('0x43')][_0xda0d('0x11a')](db[_0xda0d('0x3d')],{'onDelete':_0xda0d('0x15b')});db[_0xda0d('0x43')]['belongsTo'](db[_0xda0d('0x3c')],{'onDelete':_0xda0d('0x15b')});db[_0xda0d('0x43')][_0xda0d('0x11a')](db[_0xda0d('0x149')],{'onDelete':_0xda0d('0x15b'),'foreignKey':_0xda0d('0x14a')});db[_0xda0d('0x43')][_0xda0d('0x11a')](db[_0xda0d('0x8d')],{'onDelete':_0xda0d('0x15b'),'foreignKey':_0xda0d('0x16e')});db[_0xda0d('0x44')]['belongsTo'](db[_0xda0d('0x3c')],{});db[_0xda0d('0x44')][_0xda0d('0x11a')](db['CmList'],{'as':_0xda0d('0x160'),'foreignKey':_0xda0d('0x161')});db[_0xda0d('0x44')][_0xda0d('0x11a')](db[_0xda0d('0x73')],{'as':_0xda0d('0x166'),'foreignKey':'ContactId'});db['MailQueueReport']['belongsTo'](db[_0xda0d('0x116')],{});db['MailQueueReport']['belongsTo'](db[_0xda0d('0x41')],{});db[_0xda0d('0x44')][_0xda0d('0x11a')](db['User'],{});db[_0xda0d('0x44')][_0xda0d('0x11a')](db['MailQueue'],{});db[_0xda0d('0x46')][_0xda0d('0x10c')](db['DashboardItem'],{'as':_0xda0d('0x16f'),'onDelete':'cascade'});db[_0xda0d('0x49')][_0xda0d('0x10c')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xda0d('0x170'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x49')][_0xda0d('0x10c')](db[_0xda0d('0x80')],{'as':_0xda0d('0x171'),'foreignKey':_0xda0d('0x170')});db[_0xda0d('0x49')][_0xda0d('0x10c')](db[_0xda0d('0x4d')],{'as':_0xda0d('0x15f')});db[_0xda0d('0x49')][_0xda0d('0x10c')](db[_0xda0d('0x4b')],{'as':'Applications'});db[_0xda0d('0x49')][_0xda0d('0x10c')](db[_0xda0d('0x15')],{'as':_0xda0d('0x172'),'onDelete':'cascade'});db[_0xda0d('0x49')][_0xda0d('0x10c')](db[_0xda0d('0x173')],{'as':_0xda0d('0x153')});db[_0xda0d('0x49')]['belongsTo'](db['Trunk'],{'as':_0xda0d('0x29')});db[_0xda0d('0x49')][_0xda0d('0x11a')](db[_0xda0d('0x11e')],{'as':'List','foreignKey':_0xda0d('0x161')});db[_0xda0d('0x49')]['belongsTo'](db[_0xda0d('0x14b')],{'as':_0xda0d('0x14c'),'foreignKey':_0xda0d('0x174')});db[_0xda0d('0x49')][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x14f'),'through':_0xda0d('0x133')});db[_0xda0d('0x4b')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'onDelete':_0xda0d('0x15b')});db[_0xda0d('0x4b')][_0xda0d('0x11a')](db[_0xda0d('0x50')],{'onDelete':_0xda0d('0x15b')});db['FaxApplication'][_0xda0d('0x11a')](db[_0xda0d('0x49')],{'onDelete':'restrict'});db[_0xda0d('0x4b')][_0xda0d('0x11a')](db[_0xda0d('0x8d')],{'onDelete':_0xda0d('0x15b'),'foreignKey':_0xda0d('0x16e')});db[_0xda0d('0x4d')]['hasMany'](db[_0xda0d('0x173')],{'as':'Messages','onDelete':'cascade','foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0xda0d('0x11a')](db['FaxAccount'],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x170')});db[_0xda0d('0x4d')][_0xda0d('0x11a')](db[_0xda0d('0x73')],{'as':'Contact','foreignKey':_0xda0d('0x175')});db[_0xda0d('0x4d')][_0xda0d('0x11a')](db['User'],{'as':_0xda0d('0x167'),'foreignKey':_0xda0d('0x109')});db[_0xda0d('0x4d')]['belongsToMany'](db[_0xda0d('0x8d')],{'through':_0xda0d('0x176'),'as':_0xda0d('0x177')});db[_0xda0d('0x4d')][_0xda0d('0x11b')](db['Tag'],{'through':_0xda0d('0x176'),'as':_0xda0d('0x169')});db['FaxInteraction'][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':'Users','through':_0xda0d('0x123'),'foreignKey':'FaxInteractionId'});db[_0xda0d('0x173')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'onDelete':_0xda0d('0x108'),'as':_0xda0d('0x10a')});db['FaxMessage'][_0xda0d('0x11a')](db[_0xda0d('0x4d')],{'as':_0xda0d('0x16c'),'foreignKey':_0xda0d('0x178')});db[_0xda0d('0x173')]['belongsTo'](db['CmContact'],{'onDelete':_0xda0d('0x108'),'as':_0xda0d('0x166')});db['FaxMessage'][_0xda0d('0x11a')](db[_0xda0d('0xe3')],{'as':'Attachment','foreignKey':'AttachmentId'});db['FaxMessage'][_0xda0d('0x11a')](db[_0xda0d('0x49')],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x170')});db[_0xda0d('0x50')]['belongsToMany'](db[_0xda0d('0x10a')],{'as':_0xda0d('0x14f'),'through':_0xda0d('0x33')});db['FaxQueue'][_0xda0d('0x11b')](db[_0xda0d('0xdd')],{'through':_0xda0d('0x179'),'as':_0xda0d('0x150')});db['FaxQueueReport'][_0xda0d('0x11a')](db['FaxAccount'],{});db[_0xda0d('0x52')][_0xda0d('0x11a')](db['CmList'],{'as':_0xda0d('0x160'),'foreignKey':_0xda0d('0x161')});db[_0xda0d('0x52')]['belongsTo'](db[_0xda0d('0x73')],{'as':_0xda0d('0x166'),'foreignKey':_0xda0d('0x175')});db[_0xda0d('0x52')][_0xda0d('0x11a')](db['FaxInteraction'],{});db['FaxQueueReport'][_0xda0d('0x11a')](db[_0xda0d('0x173')],{});db['FaxQueueReport'][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{});db[_0xda0d('0x52')][_0xda0d('0x11a')](db[_0xda0d('0x50')],{});db['SmsAccount'][_0xda0d('0x10c')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xda0d('0x17a'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x54')]['hasMany'](db[_0xda0d('0x80')],{'as':_0xda0d('0x171'),'foreignKey':'SmsAccountId'});db[_0xda0d('0x54')][_0xda0d('0x10c')](db[_0xda0d('0x17b')],{'as':_0xda0d('0x153'),'foreignKey':_0xda0d('0x17a')});db[_0xda0d('0x54')][_0xda0d('0x10c')](db['SmsInteraction'],{'as':_0xda0d('0x15f')});db[_0xda0d('0x54')][_0xda0d('0x10c')](db['SmsApplication'],{'as':_0xda0d('0x13c')});db[_0xda0d('0x54')]['belongsTo'](db['CmList'],{'as':_0xda0d('0x160'),'foreignKey':_0xda0d('0x161')});db['SmsAccount']['belongsTo'](db[_0xda0d('0x14b')],{'as':_0xda0d('0x14c'),'foreignKey':_0xda0d('0x174')});db['SmsAccount'][_0xda0d('0x11b')](db['User'],{'as':_0xda0d('0x14f'),'through':'user_has_sms_accounts'});db[_0xda0d('0x55')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'onDelete':_0xda0d('0x15b')});db[_0xda0d('0x55')]['belongsTo'](db['SmsQueue'],{'onDelete':_0xda0d('0x15b')});db[_0xda0d('0x55')][_0xda0d('0x11a')](db['SmsAccount'],{'onDelete':'restrict'});db[_0xda0d('0x55')][_0xda0d('0x11a')](db[_0xda0d('0x149')],{'onDelete':_0xda0d('0x15b'),'foreignKey':_0xda0d('0x14a')});db[_0xda0d('0x55')][_0xda0d('0x11a')](db['Tag'],{'onDelete':_0xda0d('0x15b'),'foreignKey':_0xda0d('0x16e')});db['SmsInteraction'][_0xda0d('0x10c')](db['SmsMessage'],{'as':_0xda0d('0x153'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x17c')});db['SmsInteraction']['belongsTo'](db[_0xda0d('0x54')],{'as':'Account','foreignKey':_0xda0d('0x17a')});db[_0xda0d('0x57')]['belongsTo'](db[_0xda0d('0x73')],{'as':_0xda0d('0x166'),'foreignKey':'ContactId'});db['SmsInteraction']['belongsTo'](db['User'],{'as':_0xda0d('0x167'),'foreignKey':_0xda0d('0x109')});db[_0xda0d('0x57')][_0xda0d('0x11b')](db[_0xda0d('0x8d')],{'through':'sms_interaction_has_tags','as':_0xda0d('0x177')});db[_0xda0d('0x57')][_0xda0d('0x11b')](db[_0xda0d('0x8d')],{'through':_0xda0d('0x17d'),'as':_0xda0d('0x169')});db[_0xda0d('0x57')][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x16a'),'through':_0xda0d('0x124'),'foreignKey':_0xda0d('0x17c')});db[_0xda0d('0x17b')][_0xda0d('0x11a')](db['User'],{'as':_0xda0d('0x10a')});db[_0xda0d('0x17b')][_0xda0d('0x11a')](db[_0xda0d('0x73')],{'onDelete':_0xda0d('0x108'),'as':_0xda0d('0x166')});db[_0xda0d('0x17b')][_0xda0d('0x11a')](db[_0xda0d('0x57')],{'onDelete':_0xda0d('0x108'),'as':_0xda0d('0x16c'),'foreignKey':_0xda0d('0x17c')});db[_0xda0d('0x17b')][_0xda0d('0x11a')](db[_0xda0d('0x54')],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x17a')});db[_0xda0d('0x12c')][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':'Agents','through':_0xda0d('0x34'),'foreignKey':_0xda0d('0x17e')});db[_0xda0d('0x12c')]['belongsToMany'](db[_0xda0d('0xdd')],{'through':_0xda0d('0x17f'),'as':_0xda0d('0x150')});db[_0xda0d('0x5a')][_0xda0d('0x10c')](db[_0xda0d('0x81')],{'as':_0xda0d('0x15e'),'foreignKey':_0xda0d('0x180'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x5a')][_0xda0d('0x10c')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xda0d('0x180')});db['OpenchannelAccount'][_0xda0d('0x10c')](db['OpenchannelInteraction'],{'as':_0xda0d('0x15f'),'foreignKey':_0xda0d('0x180')});db[_0xda0d('0x5a')][_0xda0d('0x10c')](db[_0xda0d('0x5d')],{'as':_0xda0d('0x153'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0xda0d('0x5b')],{'as':_0xda0d('0x13c'),'foreignKey':_0xda0d('0x180')});db[_0xda0d('0x5a')][_0xda0d('0x11a')](db[_0xda0d('0x11e')],{'as':_0xda0d('0x160'),'foreignKey':_0xda0d('0x161')});db['OpenchannelAccount'][_0xda0d('0x11a')](db[_0xda0d('0x14b')],{'as':_0xda0d('0x14c'),'foreignKey':_0xda0d('0x174')});db['OpenchannelAccount']['belongsToMany'](db[_0xda0d('0x10a')],{'as':_0xda0d('0x14f'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'onDelete':_0xda0d('0x15b')});db['OpenchannelApplication'][_0xda0d('0x11a')](db['OpenchannelQueue'],{'onDelete':_0xda0d('0x15b'),'foreignKey':_0xda0d('0x181')});db[_0xda0d('0x5b')][_0xda0d('0x11a')](db[_0xda0d('0x5a')],{'onDelete':'restrict','foreignKey':_0xda0d('0x180')});db[_0xda0d('0x5b')][_0xda0d('0x11a')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xda0d('0x14a')});db[_0xda0d('0x5b')][_0xda0d('0x11a')](db[_0xda0d('0x8d')],{'onDelete':'restrict','foreignKey':_0xda0d('0x16e')});db['OpenchannelInteraction']['hasMany'](db[_0xda0d('0x5d')],{'as':_0xda0d('0x153'),'onDelete':'cascade','foreignKey':_0xda0d('0x182')});db[_0xda0d('0x112')][_0xda0d('0x11a')](db[_0xda0d('0x5a')],{'as':'Account','foreignKey':_0xda0d('0x180')});db[_0xda0d('0x112')]['belongsTo'](db[_0xda0d('0x73')],{'as':_0xda0d('0x166'),'foreignKey':_0xda0d('0x175')});db[_0xda0d('0x112')][_0xda0d('0x11a')](db['User'],{'as':_0xda0d('0x167'),'foreignKey':'UserId'});db[_0xda0d('0x112')][_0xda0d('0x11b')](db[_0xda0d('0x8d')],{'through':_0xda0d('0x183'),'as':_0xda0d('0x177')});db[_0xda0d('0x112')]['belongsToMany'](db[_0xda0d('0x8d')],{'through':_0xda0d('0x183'),'as':_0xda0d('0x169')});db[_0xda0d('0x112')][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x16a'),'through':'user_has_openchannel_interactions','foreignKey':_0xda0d('0x182')});db[_0xda0d('0x5d')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'onDelete':'cascade','as':_0xda0d('0x10a')});db['OpenchannelMessage'][_0xda0d('0x11a')](db['CmContact'],{'onDelete':_0xda0d('0x108'),'as':'Contact'});db[_0xda0d('0x5d')][_0xda0d('0x11a')](db[_0xda0d('0x112')],{'onDelete':_0xda0d('0x108'),'as':_0xda0d('0x16c'),'foreignKey':_0xda0d('0x182')});db[_0xda0d('0x5d')][_0xda0d('0x11a')](db['Attachment'],{'as':_0xda0d('0xe3'),'foreignKey':_0xda0d('0x184')});db[_0xda0d('0x5d')][_0xda0d('0x11a')](db[_0xda0d('0x5a')],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x180')});db[_0xda0d('0x5f')]['belongsToMany'](db['User'],{'as':_0xda0d('0x14f'),'through':_0xda0d('0x36'),'foreignKey':'OpenchannelQueueId'});db[_0xda0d('0x5f')][_0xda0d('0x11b')](db[_0xda0d('0xdd')],{'through':_0xda0d('0x185'),'as':'Teams'});db[_0xda0d('0x130')][_0xda0d('0x10c')](db[_0xda0d('0x81')],{'as':_0xda0d('0x15e'),'foreignKey':'ChatWebsiteId','onDelete':_0xda0d('0x108')});db['ChatWebsite'][_0xda0d('0x10c')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xda0d('0x16d')});db[_0xda0d('0x130')][_0xda0d('0x10c')](db['ChatProactiveAction'],{'as':_0xda0d('0x186')});db[_0xda0d('0x130')][_0xda0d('0x10c')](db[_0xda0d('0x65')],{'as':'Interactions'});db[_0xda0d('0x130')]['hasMany'](db[_0xda0d('0x63')],{'as':_0xda0d('0x13c')});db[_0xda0d('0x130')][_0xda0d('0x10c')](db['ChatMessage'],{'as':'Messages'});db['ChatWebsite'][_0xda0d('0x11a')](db[_0xda0d('0x11e')],{'as':_0xda0d('0x160'),'foreignKey':_0xda0d('0x161')});db['ChatWebsite'][_0xda0d('0x11a')](db[_0xda0d('0x149')],{'as':_0xda0d('0x149'),'foreignKey':_0xda0d('0x14a')});db[_0xda0d('0x130')][_0xda0d('0x11a')](db[_0xda0d('0x3c')],{'as':_0xda0d('0x3c'),'foreignKey':_0xda0d('0x159')});db[_0xda0d('0x130')][_0xda0d('0x11a')](db[_0xda0d('0x14b')],{'as':'mandatoryDispositionPause','foreignKey':_0xda0d('0x174')});db[_0xda0d('0x130')]['belongsToMany'](db[_0xda0d('0x10a')],{'as':_0xda0d('0x14f'),'through':_0xda0d('0x132')});db[_0xda0d('0x62')][_0xda0d('0x11a')](db[_0xda0d('0x5a')],{});db[_0xda0d('0x62')][_0xda0d('0x11a')](db[_0xda0d('0x11e')],{'as':_0xda0d('0x160'),'foreignKey':'ListId'});db['OpenchannelQueueReport'][_0xda0d('0x11a')](db[_0xda0d('0x73')],{'as':_0xda0d('0x166'),'foreignKey':_0xda0d('0x175')});db[_0xda0d('0x62')]['belongsTo'](db[_0xda0d('0x112')],{});db[_0xda0d('0x62')][_0xda0d('0x11a')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0xda0d('0x11a')](db['User'],{});db['OpenchannelQueueReport'][_0xda0d('0x11a')](db[_0xda0d('0x5f')],{});db[_0xda0d('0x63')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x187'),'foreignKey':_0xda0d('0x109'),'onDelete':_0xda0d('0x15b')});db[_0xda0d('0x63')][_0xda0d('0x11a')](db['ChatQueue'],{'as':_0xda0d('0x188'),'foreignKey':'ChatQueueId','onDelete':_0xda0d('0x15b')});db[_0xda0d('0x63')][_0xda0d('0x11a')](db['ChatWebsite'],{'as':_0xda0d('0x189'),'foreignKey':_0xda0d('0x16d'),'onDelete':_0xda0d('0x15b')});db[_0xda0d('0x63')]['belongsTo'](db[_0xda0d('0x8d')],{'onDelete':_0xda0d('0x15b'),'foreignKey':_0xda0d('0x16e')});db[_0xda0d('0x65')][_0xda0d('0x10c')](db[_0xda0d('0x67')],{'as':'Messages','onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x18a')});db['ChatInteraction'][_0xda0d('0x11a')](db[_0xda0d('0x130')],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x16d')});db[_0xda0d('0x65')]['belongsTo'](db[_0xda0d('0x73')],{'as':_0xda0d('0x166'),'foreignKey':_0xda0d('0x175')});db[_0xda0d('0x65')][_0xda0d('0x11a')](db['User'],{'as':_0xda0d('0x167'),'foreignKey':_0xda0d('0x109')});db['ChatInteraction'][_0xda0d('0x11b')](db[_0xda0d('0x8d')],{'through':_0xda0d('0x18b'),'as':_0xda0d('0x177')});db['ChatInteraction'][_0xda0d('0x11b')](db[_0xda0d('0x8d')],{'through':_0xda0d('0x18b'),'as':_0xda0d('0x169')});db[_0xda0d('0x65')]['belongsToMany'](db[_0xda0d('0x10a')],{'as':_0xda0d('0x16a'),'through':_0xda0d('0x122'),'foreignKey':_0xda0d('0x18a')});db[_0xda0d('0x67')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'onDelete':_0xda0d('0x108'),'as':_0xda0d('0x10a')});db[_0xda0d('0x67')][_0xda0d('0x11a')](db[_0xda0d('0x73')],{'onDelete':_0xda0d('0x108'),'as':_0xda0d('0x166'),'foreignKey':_0xda0d('0x175')});db[_0xda0d('0x67')][_0xda0d('0x11a')](db[_0xda0d('0x65')],{'onDelete':_0xda0d('0x108'),'as':'Interaction','foreignKey':_0xda0d('0x18a')});db['ChatMessage'][_0xda0d('0x11a')](db[_0xda0d('0xe3')],{'as':_0xda0d('0xe3'),'foreignKey':_0xda0d('0x184')});db['ChatMessage'][_0xda0d('0x11a')](db[_0xda0d('0x130')],{'as':_0xda0d('0x165'),'foreignKey':'ChatWebsiteId'});db[_0xda0d('0x69')][_0xda0d('0x10c')](db[_0xda0d('0xe3')],{'as':_0xda0d('0x16b'),'foreignKey':_0xda0d('0x18c'),'onDelete':_0xda0d('0x108'),'hooks':!![]});db[_0xda0d('0x69')][_0xda0d('0x11a')](db[_0xda0d('0x73')],{'onDelete':_0xda0d('0x108'),'as':_0xda0d('0x166'),'foreignKey':_0xda0d('0x175')});db[_0xda0d('0x69')][_0xda0d('0x11a')](db['ChatWebsite'],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x16d')});db['ChatQueue'][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x14f'),'through':_0xda0d('0x18d'),'hooks':!![]});db[_0xda0d('0x6b')][_0xda0d('0x11b')](db['Team'],{'through':_0xda0d('0x18e'),'as':'Teams'});db['ChatGroup'][_0xda0d('0x10c')](db[_0xda0d('0xc9')],{'as':_0xda0d('0x153'),'foreignKey':_0xda0d('0x18f'),'onDelete':'cascade'});db[_0xda0d('0x6d')][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x13f'),'through':_0xda0d('0x190')});db[_0xda0d('0x6f')]['belongsTo'](db[_0xda0d('0x130')],{'as':_0xda0d('0x189'),'foreignKey':_0xda0d('0x16d')});db['CmCompany']['hasMany'](db[_0xda0d('0x73')],{'as':_0xda0d('0x191'),'foreignKey':'CompanyId'});db['CmContact'][_0xda0d('0x10c')](db[_0xda0d('0x75')],{'as':_0xda0d('0x141'),'foreignKey':'ContactId'});db[_0xda0d('0x73')][_0xda0d('0x10c')](db[_0xda0d('0x142')],{'as':_0xda0d('0x10f'),'foreignKey':_0xda0d('0x175')});db[_0xda0d('0x73')][_0xda0d('0x10c')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0xda0d('0x7a')],{'as':_0xda0d('0x7a'),'foreignKey':_0xda0d('0x175')});db[_0xda0d('0x73')][_0xda0d('0x10c')](db[_0xda0d('0x192')],{'as':_0xda0d('0x145'),'foreignKey':'ContactId'});db[_0xda0d('0x73')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xda0d('0x125'),'foreignKey':_0xda0d('0x175'),'onDelete':_0xda0d('0x15b')});db['CmContact'][_0xda0d('0x10c')](db[_0xda0d('0x65')],{'as':_0xda0d('0x113'),'foreignKey':_0xda0d('0x175'),'onDelete':_0xda0d('0x15b')});db['CmContact'][_0xda0d('0x10c')](db[_0xda0d('0x57')],{'as':'SmsInteractions','foreignKey':_0xda0d('0x175'),'onDelete':_0xda0d('0x15b')});db[_0xda0d('0x73')][_0xda0d('0x10c')](db[_0xda0d('0x4d')],{'as':_0xda0d('0x115'),'foreignKey':_0xda0d('0x175'),'onDelete':_0xda0d('0x15b')});db[_0xda0d('0x73')][_0xda0d('0x10c')](db[_0xda0d('0x116')],{'as':_0xda0d('0x117'),'foreignKey':_0xda0d('0x175'),'onDelete':_0xda0d('0x15b')});db[_0xda0d('0x73')][_0xda0d('0x11a')](db[_0xda0d('0x71')],{'as':_0xda0d('0x193'),'foreignKey':_0xda0d('0x194')});db[_0xda0d('0x73')][_0xda0d('0x11a')](db[_0xda0d('0x11e')],{'as':_0xda0d('0x160'),'foreignKey':_0xda0d('0x161'),'onDelete':'cascade'});db['CmContact'][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x16a'),'through':'cm_user_has_contacts'});db['CmContact'][_0xda0d('0x11b')](db[_0xda0d('0x8d')],{'as':_0xda0d('0x177'),'through':_0xda0d('0x195')});db[_0xda0d('0x73')][_0xda0d('0x11b')](db[_0xda0d('0x8d')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0xda0d('0x75')]['belongsTo'](db['CmContact'],{'as':_0xda0d('0x166'),'foreignKey':_0xda0d('0x175'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x75')][_0xda0d('0x11a')](db[_0xda0d('0x11e')],{'as':'List','foreignKey':'ListId','onDelete':_0xda0d('0x108')});db[_0xda0d('0x75')]['belongsTo'](db[_0xda0d('0x10a')],{'as':_0xda0d('0x187'),'foreignKey':_0xda0d('0x109')});db['CmHopper'][_0xda0d('0x11a')](db[_0xda0d('0x19')],{'as':_0xda0d('0x188'),'foreignKey':_0xda0d('0x140'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x75')]['belongsTo'](db[_0xda0d('0xe0')],{'as':_0xda0d('0xe0'),'foreignKey':_0xda0d('0x196'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x75')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x167'),'foreignKey':'OwnerId'});db[_0xda0d('0x76')]['belongsTo'](db['CmContact'],{'as':_0xda0d('0x166'),'foreignKey':_0xda0d('0x175'),'onDelete':'cascade'});db[_0xda0d('0x76')]['belongsTo'](db['CmList'],{'as':_0xda0d('0x160'),'foreignKey':_0xda0d('0x161'),'onDelete':_0xda0d('0x108')});db['CmHopperBlack'][_0xda0d('0x11a')](db[_0xda0d('0x19')],{'as':_0xda0d('0x188'),'foreignKey':_0xda0d('0x140'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x76')][_0xda0d('0x11a')](db[_0xda0d('0xe0')],{'as':_0xda0d('0xe0'),'foreignKey':_0xda0d('0x196'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x7e')][_0xda0d('0x10c')](db[_0xda0d('0x83')],{'as':{'plural':_0xda0d('0x197'),'singular':_0xda0d('0x198')},'foreignKey':_0xda0d('0x199'),'onDelete':'cascade','hooks':!![]});db[_0xda0d('0x7e')][_0xda0d('0x10c')](db['Condition'],{'as':{'plural':_0xda0d('0x19a'),'singular':_0xda0d('0x19b')},'foreignKey':_0xda0d('0x19c'),'onDelete':_0xda0d('0x108'),'hooks':!![]});db['Automation']['hasMany'](db['Action'],{'as':_0xda0d('0x19d'),'foreignKey':'AutomationId','onDelete':_0xda0d('0x108'),'hooks':!![]});db[_0xda0d('0x81')][_0xda0d('0x10c')](db[_0xda0d('0x81')],{'as':_0xda0d('0x15e'),'foreignKey':_0xda0d('0x19e'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x149')]['hasMany'](db[_0xda0d('0x149')],{'as':'Intervals','foreignKey':_0xda0d('0x14a'),'onDelete':_0xda0d('0x108'),'hooks':!![],'required':![]});db[_0xda0d('0x149')][_0xda0d('0x10c')](db[_0xda0d('0x15')],{'as':'Extensions','foreignKey':_0xda0d('0x14a'),'onDelete':_0xda0d('0x15b')});db['Interval'][_0xda0d('0x10c')](db[_0xda0d('0x43')],{'as':_0xda0d('0x19f'),'foreignKey':_0xda0d('0x14a')});db['Interval'][_0xda0d('0x10c')](db['ChatApplication'],{'as':_0xda0d('0x1a0'),'foreignKey':'IntervalId'});db[_0xda0d('0x149')][_0xda0d('0x10c')](db[_0xda0d('0x4b')],{'as':_0xda0d('0x1a1'),'foreignKey':'IntervalId'});db[_0xda0d('0x149')][_0xda0d('0x10c')](db[_0xda0d('0x55')],{'as':_0xda0d('0x1a2'),'foreignKey':_0xda0d('0x14a')});db[_0xda0d('0x1a3')][_0xda0d('0x11a')](db[_0xda0d('0x3c')],{});db['Schedule'][_0xda0d('0x11a')](db['AnalyticDefaultReport'],{'foreignKey':_0xda0d('0x1a4')});db[_0xda0d('0x1a3')]['belongsTo'](db[_0xda0d('0x1a5')],{'foreignKey':_0xda0d('0x1a6')});db[_0xda0d('0x8b')][_0xda0d('0x11b')](db['VoiceMusicOnHold'],{'as':_0xda0d('0x1a7'),'through':_0xda0d('0x13e'),'onDelete':_0xda0d('0x15b')});db[_0xda0d('0x8d')]['belongsToMany'](db[_0xda0d('0x73')],{'through':_0xda0d('0x195')});db['Tag'][_0xda0d('0x11b')](db[_0xda0d('0x65')],{'through':'chat_interaction_has_tags'});db['Tag'][_0xda0d('0x11b')](db[_0xda0d('0x116')],{'through':'mail_interaction_has_tags'});db[_0xda0d('0x8d')]['belongsToMany'](db['SmsInteraction'],{'through':_0xda0d('0x17d')});db['Tag'][_0xda0d('0x11b')](db[_0xda0d('0x4d')],{'through':_0xda0d('0x176')});db[_0xda0d('0x8d')][_0xda0d('0x11b')](db[_0xda0d('0x112')],{'through':'openchannel_interaction_has_tags'});db[_0xda0d('0x8d')][_0xda0d('0x11b')](db[_0xda0d('0xf8')],{'through':_0xda0d('0x1a8')});db['Trigger'][_0xda0d('0x10c')](db['Condition'],{'as':{'plural':_0xda0d('0x1a9'),'singular':_0xda0d('0x1aa')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0xda0d('0x1ab')]['hasMany'](db[_0xda0d('0x83')],{'as':{'plural':_0xda0d('0x1ac'),'singular':_0xda0d('0x1ad')},'foreignKey':'TriggerAnyId','onDelete':_0xda0d('0x108'),'hooks':!![]});db['Trigger'][_0xda0d('0x10c')](db['Action'],{'as':_0xda0d('0x19d'),'foreignKey':'TriggerId','onDelete':_0xda0d('0x108'),'hooks':!![]});db[_0xda0d('0x1a5')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xda0d('0x1ae'),'onDelete':_0xda0d('0x108'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0xda0d('0x1af')],{'as':_0xda0d('0x1ae'),'onDelete':'cascade','foreignKey':_0xda0d('0x1a4')});db[_0xda0d('0x9a')][_0xda0d('0x10c')](db['AnalyticFieldReport'],{'as':_0xda0d('0x1ae'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b0')});db[_0xda0d('0x1af')]['belongsTo'](db[_0xda0d('0x9a')],{'foreignKey':_0xda0d('0x1b0')});db[_0xda0d('0x9d')][_0xda0d('0x10c')](db[_0xda0d('0x9f')],{'as':'Configurations','onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b1')});db['SalesforceConfiguration'][_0xda0d('0x10c')](db[_0xda0d('0xa0')],{'as':_0xda0d('0x1b2'),'onDelete':_0xda0d('0x108'),'foreignKey':'SubjectId'});db[_0xda0d('0x9f')][_0xda0d('0x10c')](db[_0xda0d('0xa0')],{'as':_0xda0d('0x1b3'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b4')});db[_0xda0d('0x9f')][_0xda0d('0x10c')](db[_0xda0d('0xa0')],{'as':_0xda0d('0x1ae'),'onDelete':'cascade','foreignKey':_0xda0d('0x1b5')});db['SalesforceConfiguration'][_0xda0d('0x11a')](db[_0xda0d('0x9d')],{'as':'Account','foreignKey':_0xda0d('0x1b1')});db[_0xda0d('0xa0')][_0xda0d('0x10c')](db[_0xda0d('0xa0')],{'as':_0xda0d('0x1b6'),'foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0xa0')][_0xda0d('0x10c')](db[_0xda0d('0xa0')],{'as':_0xda0d('0x1b8'),'foreignKey':_0xda0d('0x1b4')});db['SalesforceField'][_0xda0d('0x10c')](db[_0xda0d('0xa0')],{'as':_0xda0d('0x1b9'),'foreignKey':_0xda0d('0x1b5')});db[_0xda0d('0xa0')][_0xda0d('0x11a')](db[_0xda0d('0x90')],{'as':'Variable','foreignKey':'VariableId'});db['SugarcrmAccount'][_0xda0d('0x10c')](db['SugarcrmConfiguration'],{'as':_0xda0d('0x1ba'),'onDelete':_0xda0d('0x108'),'foreignKey':'AccountId'});db[_0xda0d('0xa3')][_0xda0d('0x10c')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0xa3')][_0xda0d('0x10c')](db[_0xda0d('0xa4')],{'as':_0xda0d('0x1b3'),'onDelete':_0xda0d('0x108'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0xda0d('0x10c')](db[_0xda0d('0xa4')],{'as':'Fields','onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b5')});db[_0xda0d('0xa3')][_0xda0d('0x11a')](db['SugarcrmAccount'],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x1b1')});db[_0xda0d('0xa4')][_0xda0d('0x10c')](db[_0xda0d('0xa4')],{'as':_0xda0d('0x1b6'),'foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0xa4')][_0xda0d('0x10c')](db[_0xda0d('0xa4')],{'as':_0xda0d('0x1b8'),'foreignKey':_0xda0d('0x1b4')});db[_0xda0d('0xa4')]['hasMany'](db[_0xda0d('0xa4')],{'as':'Field','foreignKey':_0xda0d('0x1b5')});db[_0xda0d('0xa4')][_0xda0d('0x11a')](db[_0xda0d('0x90')],{'as':'Variable','foreignKey':'VariableId'});db[_0xda0d('0x1bb')][_0xda0d('0x10c')](db[_0xda0d('0xa6')],{'as':_0xda0d('0x1ba'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b1')});db[_0xda0d('0xa6')][_0xda0d('0x10c')](db[_0xda0d('0xa7')],{'as':_0xda0d('0x1b2'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b7')});db['DeskConfiguration'][_0xda0d('0x10c')](db[_0xda0d('0xa7')],{'as':_0xda0d('0x1b3'),'onDelete':'cascade','foreignKey':_0xda0d('0x1b4')});db[_0xda0d('0xa6')]['hasMany'](db[_0xda0d('0xa7')],{'as':_0xda0d('0x1ae'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b5')});db['DeskConfiguration'][_0xda0d('0x11a')](db[_0xda0d('0x1bb')],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x1b1')});db['DeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0xda0d('0x1bc')});db[_0xda0d('0xa7')][_0xda0d('0x10c')](db[_0xda0d('0xa7')],{'as':_0xda0d('0x1b6'),'foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0xa7')][_0xda0d('0x10c')](db['DeskField'],{'as':'Description','foreignKey':_0xda0d('0x1b4')});db[_0xda0d('0xa7')][_0xda0d('0x10c')](db[_0xda0d('0xa7')],{'as':_0xda0d('0x1b9'),'foreignKey':'FieldId'});db[_0xda0d('0xa7')]['belongsTo'](db[_0xda0d('0x90')],{'as':_0xda0d('0x90'),'foreignKey':_0xda0d('0x1bd')});db['ZohoAccount'][_0xda0d('0x10c')](db[_0xda0d('0xaa')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xda0d('0xaa')][_0xda0d('0x10c')](db[_0xda0d('0xac')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0xaa')][_0xda0d('0x10c')](db[_0xda0d('0xac')],{'as':_0xda0d('0x1b3'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b4')});db[_0xda0d('0xaa')][_0xda0d('0x10c')](db[_0xda0d('0xac')],{'as':_0xda0d('0x1ae'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b5')});db[_0xda0d('0xaa')][_0xda0d('0x11a')](db[_0xda0d('0xa9')],{'as':'Account','foreignKey':'AccountId'});db[_0xda0d('0xac')]['hasMany'](db['ZohoField'],{'as':_0xda0d('0x1b6'),'foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0xac')][_0xda0d('0x10c')](db[_0xda0d('0xac')],{'as':_0xda0d('0x1b8'),'foreignKey':'DescriptionId'});db['ZohoField'][_0xda0d('0x10c')](db['ZohoField'],{'as':_0xda0d('0x1b9'),'foreignKey':_0xda0d('0x1b5')});db['ZohoField']['belongsTo'](db[_0xda0d('0x90')],{'as':_0xda0d('0x90'),'foreignKey':_0xda0d('0x1bd')});db[_0xda0d('0xad')][_0xda0d('0x10c')](db[_0xda0d('0xaf')],{'as':_0xda0d('0x1ba'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b1')});db[_0xda0d('0xaf')]['hasMany'](db[_0xda0d('0xb1')],{'as':'Subjects','foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0xaf')][_0xda0d('0x10c')](db[_0xda0d('0xb1')],{'as':'Descriptions','foreignKey':_0xda0d('0x1b4')});db[_0xda0d('0xaf')][_0xda0d('0x10c')](db['ZendeskField'],{'as':_0xda0d('0x1ae'),'foreignKey':_0xda0d('0x1b5')});db[_0xda0d('0xaf')][_0xda0d('0x11a')](db['ZendeskAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0xda0d('0xaf')][_0xda0d('0x11b')](db[_0xda0d('0x8d')],{'through':_0xda0d('0x1be')});db[_0xda0d('0xb1')][_0xda0d('0x10c')](db[_0xda0d('0xb1')],{'as':_0xda0d('0x1b6'),'foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0xb1')][_0xda0d('0x10c')](db['ZendeskField'],{'as':_0xda0d('0x1b8'),'foreignKey':_0xda0d('0x1b4')});db[_0xda0d('0xb1')][_0xda0d('0x10c')](db[_0xda0d('0xb1')],{'as':'Field','foreignKey':'FieldId'});db[_0xda0d('0xb1')][_0xda0d('0x11a')](db['Variable'],{'as':_0xda0d('0x90'),'foreignKey':_0xda0d('0x1bd')});db['FreshdeskAccount'][_0xda0d('0x10c')](db[_0xda0d('0xb4')],{'as':_0xda0d('0x1ba'),'onDelete':'cascade','foreignKey':_0xda0d('0x1b1')});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':'Subjects','onDelete':_0xda0d('0x108'),'foreignKey':'SubjectId'});db[_0xda0d('0xb4')]['hasMany'](db['FreshdeskField'],{'as':_0xda0d('0x1b3'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b4')});db[_0xda0d('0xb4')][_0xda0d('0x10c')](db[_0xda0d('0xb6')],{'as':_0xda0d('0x1ae'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b5')});db[_0xda0d('0xb4')][_0xda0d('0x11a')](db[_0xda0d('0xb3')],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x1b1')});db[_0xda0d('0xb4')][_0xda0d('0x11b')](db['Tag'],{'through':_0xda0d('0x1bf')});db[_0xda0d('0xb6')][_0xda0d('0x10c')](db[_0xda0d('0xb6')],{'as':_0xda0d('0x1b6'),'foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0xb6')][_0xda0d('0x10c')](db[_0xda0d('0xb6')],{'as':_0xda0d('0x1b8'),'foreignKey':_0xda0d('0x1b4')});db['FreshdeskField'][_0xda0d('0x10c')](db[_0xda0d('0xb6')],{'as':_0xda0d('0x1b9'),'foreignKey':_0xda0d('0x1b5')});db[_0xda0d('0xb6')][_0xda0d('0x11a')](db[_0xda0d('0x90')],{'as':_0xda0d('0x90'),'foreignKey':_0xda0d('0x1bd')});db[_0xda0d('0xb8')][_0xda0d('0x10c')](db['VtigerConfiguration'],{'as':_0xda0d('0x1ba'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b1')});db[_0xda0d('0x1c0')][_0xda0d('0x10c')](db[_0xda0d('0xb9')],{'as':_0xda0d('0x1b2'),'foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0x1c0')][_0xda0d('0x10c')](db[_0xda0d('0xb9')],{'as':'Descriptions','foreignKey':_0xda0d('0x1b4')});db['VtigerConfiguration'][_0xda0d('0x10c')](db['VtigerField'],{'as':_0xda0d('0x1ae'),'foreignKey':_0xda0d('0x1b5')});db[_0xda0d('0x1c0')][_0xda0d('0x11a')](db['VtigerAccount'],{'as':'Account','foreignKey':_0xda0d('0x1b1')});db['VtigerField'][_0xda0d('0x10c')](db[_0xda0d('0xb9')],{'as':_0xda0d('0x1b6'),'foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0xb9')][_0xda0d('0x10c')](db['VtigerField'],{'as':_0xda0d('0x1b8'),'foreignKey':_0xda0d('0x1b4')});db[_0xda0d('0xb9')][_0xda0d('0x10c')](db['VtigerField'],{'as':_0xda0d('0x1b9'),'foreignKey':'FieldId'});db['VtigerField'][_0xda0d('0x11a')](db['Variable'],{'as':'Variable','foreignKey':_0xda0d('0x1bd')});db[_0xda0d('0x1c1')]['hasMany'](db[_0xda0d('0xbb')],{'as':'Configurations','onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b1')});db[_0xda0d('0xbb')][_0xda0d('0x10c')](db[_0xda0d('0x1c2')],{'as':'Subjects','foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0xbb')][_0xda0d('0x10c')](db[_0xda0d('0x1c2')],{'as':_0xda0d('0x1b3'),'foreignKey':_0xda0d('0x1b4')});db[_0xda0d('0xbb')][_0xda0d('0x10c')](db[_0xda0d('0x1c2')],{'as':_0xda0d('0x1ae'),'foreignKey':_0xda0d('0x1b5')});db[_0xda0d('0xbb')][_0xda0d('0x11a')](db[_0xda0d('0x1c1')],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x1b1')});db[_0xda0d('0x1c2')][_0xda0d('0x10c')](db['ServicenowField'],{'as':_0xda0d('0x1b6'),'foreignKey':'SubjectId'});db['ServicenowField'][_0xda0d('0x10c')](db[_0xda0d('0x1c2')],{'as':_0xda0d('0x1b8'),'foreignKey':_0xda0d('0x1b4')});db[_0xda0d('0x1c2')][_0xda0d('0x10c')](db['ServicenowField'],{'as':'Field','foreignKey':_0xda0d('0x1b5')});db[_0xda0d('0x1c2')][_0xda0d('0x11a')](db[_0xda0d('0x90')],{'as':'Variable','foreignKey':_0xda0d('0x1bd')});db[_0xda0d('0xbd')][_0xda0d('0x10c')](db[_0xda0d('0xbe')],{'as':_0xda0d('0x1ba'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b1')});db[_0xda0d('0xbd')][_0xda0d('0x11a')](db[_0xda0d('0x100')],{'as':'CloudProvider','foreignKey':_0xda0d('0x15a')});db[_0xda0d('0xbe')][_0xda0d('0x10c')](db[_0xda0d('0xc0')],{'as':_0xda0d('0x1b2'),'onDelete':'cascade','foreignKey':_0xda0d('0x1b7')});db['Dynamics365Configuration']['hasMany'](db[_0xda0d('0xc0')],{'as':_0xda0d('0x1b3'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b4')});db['Dynamics365Configuration'][_0xda0d('0x10c')](db[_0xda0d('0xc0')],{'as':_0xda0d('0x1ae'),'onDelete':'cascade','foreignKey':_0xda0d('0x1b5')});db[_0xda0d('0xbe')]['belongsTo'](db['Dynamics365Account'],{'as':_0xda0d('0x165'),'foreignKey':'AccountId'});db['Dynamics365Field'][_0xda0d('0x10c')](db[_0xda0d('0xc0')],{'as':_0xda0d('0x1b6'),'foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0xc0')][_0xda0d('0x10c')](db['Dynamics365Field'],{'as':_0xda0d('0x1b8'),'foreignKey':'DescriptionId'});db[_0xda0d('0xc0')][_0xda0d('0x10c')](db[_0xda0d('0xc0')],{'as':_0xda0d('0x1b9'),'foreignKey':_0xda0d('0x1b5')});db['Dynamics365Field'][_0xda0d('0x11a')](db['Variable'],{'as':_0xda0d('0x90'),'foreignKey':_0xda0d('0x1bd')});db[_0xda0d('0xc2')][_0xda0d('0x10c')](db[_0xda0d('0x1c3')],{'as':_0xda0d('0x1ba'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1b1')});db['FreshsalesConfiguration'][_0xda0d('0x10c')](db[_0xda0d('0xc4')],{'as':_0xda0d('0x1b2'),'foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0x1c3')][_0xda0d('0x10c')](db['FreshsalesField'],{'as':'Descriptions','foreignKey':_0xda0d('0x1b4')});db[_0xda0d('0x1c3')][_0xda0d('0x10c')](db[_0xda0d('0xc4')],{'as':'Fields','foreignKey':_0xda0d('0x1b5')});db['FreshsalesConfiguration'][_0xda0d('0x11a')](db['FreshsalesAccount'],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x1b1')});db[_0xda0d('0xc4')][_0xda0d('0x10c')](db[_0xda0d('0xc4')],{'as':_0xda0d('0x1b6'),'foreignKey':_0xda0d('0x1b7')});db[_0xda0d('0xc4')][_0xda0d('0x10c')](db[_0xda0d('0xc4')],{'as':'Description','foreignKey':_0xda0d('0x1b4')});db[_0xda0d('0xc4')][_0xda0d('0x10c')](db[_0xda0d('0xc4')],{'as':_0xda0d('0x1b9'),'foreignKey':'FieldId'});db['FreshsalesField'][_0xda0d('0x11a')](db[_0xda0d('0x90')],{'as':_0xda0d('0x90'),'foreignKey':_0xda0d('0x1bd')});db[_0xda0d('0xc8')][_0xda0d('0x11a')](db[_0xda0d('0x130')],{});db['ChatQueueReport']['belongsTo'](db[_0xda0d('0x11e')],{'as':'List','foreignKey':_0xda0d('0x161')});db[_0xda0d('0xc8')][_0xda0d('0x11a')](db['CmContact'],{'as':_0xda0d('0x166'),'foreignKey':_0xda0d('0x175')});db['ChatQueueReport']['belongsTo'](db[_0xda0d('0x65')],{});db[_0xda0d('0xc8')][_0xda0d('0x11a')](db[_0xda0d('0x67')],{});db['ChatQueueReport'][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{});db[_0xda0d('0xc8')][_0xda0d('0x11a')](db['ChatQueue'],{});db['ChatInternalMessage'][_0xda0d('0x11a')](db['User'],{'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1c4')});db['ChatInternalMessage'][_0xda0d('0x11a')](db['User'],{'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1c5')});db[_0xda0d('0x192')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0xda0d('0x1c6'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x192')][_0xda0d('0x10c')](db[_0xda0d('0xcb')],{'foreignKey':_0xda0d('0x1c6'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0xcd')]['belongsTo'](db[_0xda0d('0x54')],{});db['SmsQueueReport']['belongsTo'](db['CmList'],{'as':_0xda0d('0x160'),'foreignKey':_0xda0d('0x161')});db[_0xda0d('0xcd')][_0xda0d('0x11a')](db[_0xda0d('0x73')],{'as':_0xda0d('0x166'),'foreignKey':_0xda0d('0x175')});db[_0xda0d('0xcd')][_0xda0d('0x11a')](db[_0xda0d('0x57')],{});db[_0xda0d('0xcd')]['belongsTo'](db[_0xda0d('0x17b')],{});db[_0xda0d('0xcd')][_0xda0d('0x11a')](db['User'],{});db[_0xda0d('0xcd')][_0xda0d('0x11a')](db['SmsQueue'],{});db[_0xda0d('0xd3')][_0xda0d('0x10c')](db[_0xda0d('0x192')],{'foreignKey':_0xda0d('0x1c7')});db[_0xda0d('0xd3')][_0xda0d('0x10c')](db[_0xda0d('0x1c8')],{'foreignKey':_0xda0d('0x1c7')});db[_0xda0d('0xd3')][_0xda0d('0x10c')](db[_0xda0d('0xcb')],{'foreignKey':_0xda0d('0x1c7')});db['SquareProject'][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':'Users','through':'user_has_square_projects'});db['Team'][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x14f'),'through':_0xda0d('0x120')});db[_0xda0d('0xdd')][_0xda0d('0x11b')](db['VoiceQueue'],{'through':_0xda0d('0x102'),'as':_0xda0d('0x128')});db['Team'][_0xda0d('0x11b')](db[_0xda0d('0x3d')],{'through':_0xda0d('0x163'),'as':'MailQueues'});db[_0xda0d('0xdd')][_0xda0d('0x11b')](db['ChatQueue'],{'through':_0xda0d('0x18e'),'as':_0xda0d('0x1c9')});db[_0xda0d('0xdd')][_0xda0d('0x11b')](db[_0xda0d('0x50')],{'through':_0xda0d('0x179'),'as':_0xda0d('0x12b')});db[_0xda0d('0xdd')][_0xda0d('0x11b')](db['SmsQueue'],{'through':_0xda0d('0x17f'),'as':_0xda0d('0x12d')});db[_0xda0d('0xdd')][_0xda0d('0x11b')](db[_0xda0d('0x5f')],{'through':_0xda0d('0x185'),'as':_0xda0d('0x12e')});db['Team']['belongsToMany'](db[_0xda0d('0xfe')],{'through':_0xda0d('0x1ca'),'as':_0xda0d('0x12f')});db['Team'][_0xda0d('0x11b')](db[_0xda0d('0xed')],{'through':'TeamVoicePrefix','as':_0xda0d('0x129')});db['Campaign'][_0xda0d('0x10c')](db[_0xda0d('0x75')],{'as':'Hoppers','foreignKey':_0xda0d('0x196')});db[_0xda0d('0xe0')][_0xda0d('0x10c')](db[_0xda0d('0x142')],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0xda0d('0xe0')][_0xda0d('0x10c')](db['CmHopperHistory'],{'as':_0xda0d('0x143'),'foreignKey':_0xda0d('0x196')});db['Campaign'][_0xda0d('0x10c')](db[_0xda0d('0x76')],{'as':_0xda0d('0x144'),'foreignKey':_0xda0d('0x196')});db['Campaign'][_0xda0d('0x11a')](db[_0xda0d('0x29')],{'as':'Trunk','foreignKey':_0xda0d('0x146')});db[_0xda0d('0xe0')][_0xda0d('0x11a')](db['Trunk'],{'as':_0xda0d('0x147'),'foreignKey':'TrunkBackupId'});db[_0xda0d('0xe0')][_0xda0d('0x11a')](db[_0xda0d('0x149')],{'as':_0xda0d('0x149'),'foreignKey':_0xda0d('0x14a')});db[_0xda0d('0xe0')]['belongsTo'](db['SquareProject'],{'as':_0xda0d('0xd8'),'foreignKey':_0xda0d('0x1cb')});db['Campaign'][_0xda0d('0x11b')](db['CmList'],{'as':_0xda0d('0x14d'),'through':_0xda0d('0x1cc')});db[_0xda0d('0xe0')][_0xda0d('0x11b')](db[_0xda0d('0x11e')],{'as':_0xda0d('0x151'),'through':_0xda0d('0x1cd')});db[_0xda0d('0xe3')][_0xda0d('0x11a')](db[_0xda0d('0x69')],{'as':_0xda0d('0x69'),'foreignKey':_0xda0d('0x18c')});db['MailTransferReport']['belongsTo'](db['MailMessage'],{});db[_0xda0d('0xe7')]['belongsTo'](db[_0xda0d('0x116')],{});db[_0xda0d('0xe7')][_0xda0d('0x11a')](db[_0xda0d('0x3c')],{'foreignKey':_0xda0d('0x1ce'),'as':_0xda0d('0x1cf')});db[_0xda0d('0xe7')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'foreignKey':'FromUserId','as':_0xda0d('0x1d0')});db[_0xda0d('0xe7')]['belongsTo'](db[_0xda0d('0x10a')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xda0d('0xe7')]['belongsTo'](db[_0xda0d('0x3d')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db['MailTransferReport'][_0xda0d('0x11a')](db[_0xda0d('0x3c')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0xda0d('0x1d1')]['belongsTo'](db[_0xda0d('0x67')],{});db[_0xda0d('0x1d1')][_0xda0d('0x11a')](db[_0xda0d('0x65')],{});db[_0xda0d('0x1d1')][_0xda0d('0x11a')](db[_0xda0d('0x130')],{'foreignKey':_0xda0d('0x1d2'),'as':_0xda0d('0x1cf')});db['ChatTransferReport'][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'foreignKey':'FromUserId','as':_0xda0d('0x1d0')});db[_0xda0d('0x1d1')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'foreignKey':_0xda0d('0x1d3'),'as':_0xda0d('0x1d4')});db[_0xda0d('0x1d1')][_0xda0d('0x11a')](db['ChatQueue'],{'foreignKey':_0xda0d('0x1d5'),'as':_0xda0d('0x1d6')});db[_0xda0d('0x1d1')]['belongsTo'](db[_0xda0d('0x130')],{'foreignKey':_0xda0d('0x1d7'),'as':_0xda0d('0x1d8')});db['FaxTransferReport'][_0xda0d('0x11a')](db[_0xda0d('0x173')],{});db[_0xda0d('0xe9')]['belongsTo'](db[_0xda0d('0x4d')],{});db[_0xda0d('0xe9')][_0xda0d('0x11a')](db[_0xda0d('0x49')],{'foreignKey':_0xda0d('0x1d9'),'as':_0xda0d('0x1cf')});db[_0xda0d('0xe9')][_0xda0d('0x11a')](db['User'],{'foreignKey':_0xda0d('0x1da'),'as':_0xda0d('0x1d0')});db[_0xda0d('0xe9')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'foreignKey':_0xda0d('0x1d3'),'as':'ToAgent'});db[_0xda0d('0xe9')][_0xda0d('0x11a')](db[_0xda0d('0x50')],{'foreignKey':_0xda0d('0x1db'),'as':_0xda0d('0x1d6')});db['FaxTransferReport'][_0xda0d('0x11a')](db['FaxAccount'],{'foreignKey':_0xda0d('0x1dc'),'as':'ToAccount'});db['OpenchannelTransferReport']['belongsTo'](db[_0xda0d('0x5d')],{});db['OpenchannelTransferReport'][_0xda0d('0x11a')](db[_0xda0d('0x112')],{});db[_0xda0d('0x1dd')][_0xda0d('0x11a')](db[_0xda0d('0x5a')],{'foreignKey':_0xda0d('0x1de'),'as':_0xda0d('0x1cf')});db[_0xda0d('0x1dd')]['belongsTo'](db[_0xda0d('0x10a')],{'foreignKey':_0xda0d('0x1da'),'as':_0xda0d('0x1d0')});db[_0xda0d('0x1dd')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'foreignKey':_0xda0d('0x1d3'),'as':_0xda0d('0x1d4')});db[_0xda0d('0x1dd')][_0xda0d('0x11a')](db['OpenchannelQueue'],{'foreignKey':_0xda0d('0x1df'),'as':_0xda0d('0x1d6')});db[_0xda0d('0x1dd')][_0xda0d('0x11a')](db[_0xda0d('0x5a')],{'foreignKey':'ToOpenchannelAccountId','as':_0xda0d('0x1d8')});db[_0xda0d('0xec')][_0xda0d('0x11a')](db[_0xda0d('0x17b')],{});db['SmsTransferReport']['belongsTo'](db[_0xda0d('0x57')],{});db[_0xda0d('0xec')][_0xda0d('0x11a')](db['SmsAccount'],{'foreignKey':_0xda0d('0x1e0'),'as':_0xda0d('0x1cf')});db[_0xda0d('0xec')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'foreignKey':_0xda0d('0x1da'),'as':_0xda0d('0x1d0')});db['SmsTransferReport']['belongsTo'](db[_0xda0d('0x10a')],{'foreignKey':'ToUserId','as':'ToAgent'});db['SmsTransferReport']['belongsTo'](db['SmsQueue'],{'foreignKey':_0xda0d('0x1e1'),'as':_0xda0d('0x1d6')});db['SmsTransferReport'][_0xda0d('0x11a')](db[_0xda0d('0x54')],{'foreignKey':_0xda0d('0x1e2'),'as':_0xda0d('0x1d8')});db[_0xda0d('0x11e')]['hasMany'](db['Disposition'],{'as':_0xda0d('0x15e'),'foreignKey':_0xda0d('0x161'),'onDelete':_0xda0d('0x108')});db['CmList'][_0xda0d('0x10c')](db[_0xda0d('0x7c')],{'as':'CustomFields','foreignKey':'ListId'});db[_0xda0d('0x11e')][_0xda0d('0x10c')](db['CmContact'],{'as':_0xda0d('0x191'),'onDelete':_0xda0d('0x108'),'foreignKey':'ListId'});db[_0xda0d('0x11e')][_0xda0d('0x10c')](db[_0xda0d('0x142')],{'as':_0xda0d('0x10f'),'foreignKey':_0xda0d('0x161')});db[_0xda0d('0x11e')][_0xda0d('0x10c')](db[_0xda0d('0x110')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0xda0d('0x11e')][_0xda0d('0x10c')](db[_0xda0d('0x7a')],{'as':'ReportAgentPreview','foreignKey':_0xda0d('0x161')});db[_0xda0d('0x11e')]['belongsToMany'](db['VoiceQueue'],{'as':_0xda0d('0x1e3'),'through':_0xda0d('0x14e')});db['CmList'][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':'Agents','through':_0xda0d('0x11f')});db[_0xda0d('0xed')][_0xda0d('0x10c')](db[_0xda0d('0x15')],{'as':_0xda0d('0x10e'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0xed')][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x14f'),'through':_0xda0d('0x105')});db[_0xda0d('0xed')]['belongsToMany'](db[_0xda0d('0xdd')],{'through':_0xda0d('0x103'),'as':_0xda0d('0x150')});db['UserProfile'][_0xda0d('0x10c')](db['User'],{'as':_0xda0d('0x16a'),'foreignKey':_0xda0d('0x1e4')});db[_0xda0d('0xef')][_0xda0d('0x10c')](db[_0xda0d('0xf1')],{'as':_0xda0d('0x1e5'),'foreignKey':_0xda0d('0x1e4'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0xf1')]['hasMany'](db[_0xda0d('0xf3')],{'as':'Resources','foreignKey':_0xda0d('0x1e6'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x138')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0xda0d('0x1e7'),'onDelete':_0xda0d('0x108')});db[_0xda0d('0x138')]['hasMany'](db[_0xda0d('0x80')],{'as':_0xda0d('0x171'),'foreignKey':'WhatsappAccountId'});db[_0xda0d('0x138')][_0xda0d('0x10c')](db[_0xda0d('0xfa')],{'as':_0xda0d('0x153'),'foreignKey':_0xda0d('0x1e7')});db[_0xda0d('0x138')][_0xda0d('0x10c')](db[_0xda0d('0xf8')],{'as':_0xda0d('0x15f')});db[_0xda0d('0x138')][_0xda0d('0x10c')](db[_0xda0d('0xf7')],{'as':_0xda0d('0x13c')});db[_0xda0d('0x138')]['belongsTo'](db[_0xda0d('0x11e')],{'as':'List','foreignKey':_0xda0d('0x161')});db[_0xda0d('0x138')][_0xda0d('0x11a')](db['Pause'],{'as':_0xda0d('0x14c'),'foreignKey':_0xda0d('0x174')});db[_0xda0d('0x138')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xda0d('0x13a')});db[_0xda0d('0xf7')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'onDelete':_0xda0d('0x15b')});db[_0xda0d('0xf7')]['belongsTo'](db[_0xda0d('0xfe')],{'onDelete':'restrict'});db['WhatsappApplication'][_0xda0d('0x11a')](db[_0xda0d('0x138')],{'onDelete':_0xda0d('0x15b')});db[_0xda0d('0xf7')]['belongsTo'](db[_0xda0d('0x149')],{'onDelete':_0xda0d('0x15b'),'foreignKey':'IntervalId'});db[_0xda0d('0xf7')][_0xda0d('0x11a')](db[_0xda0d('0x8d')],{'onDelete':_0xda0d('0x15b'),'foreignKey':'TagId'});db[_0xda0d('0xf8')][_0xda0d('0x10c')](db[_0xda0d('0xfa')],{'as':_0xda0d('0x153'),'onDelete':_0xda0d('0x108'),'foreignKey':_0xda0d('0x1e8')});db[_0xda0d('0xf8')][_0xda0d('0x11a')](db[_0xda0d('0x138')],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x1e7')});db[_0xda0d('0xf8')][_0xda0d('0x11a')](db[_0xda0d('0x73')],{'as':_0xda0d('0x166'),'foreignKey':_0xda0d('0x175')});db[_0xda0d('0xf8')][_0xda0d('0x11a')](db['User'],{'as':_0xda0d('0x167'),'foreignKey':_0xda0d('0x109')});db['WhatsappInteraction'][_0xda0d('0x11b')](db[_0xda0d('0x8d')],{'through':_0xda0d('0x1a8'),'as':_0xda0d('0x177')});db[_0xda0d('0xf8')]['belongsToMany'](db[_0xda0d('0x8d')],{'through':_0xda0d('0x1a8'),'as':_0xda0d('0x169')});db[_0xda0d('0xf8')]['belongsToMany'](db['User'],{'as':_0xda0d('0x16a'),'through':_0xda0d('0x127'),'foreignKey':_0xda0d('0x1e8')});db[_0xda0d('0xfa')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x10a')});db[_0xda0d('0xfa')][_0xda0d('0x11a')](db['CmContact'],{'onDelete':_0xda0d('0x108'),'as':_0xda0d('0x166')});db[_0xda0d('0xfa')][_0xda0d('0x11a')](db[_0xda0d('0xf8')],{'onDelete':_0xda0d('0x108'),'as':'Interaction','foreignKey':_0xda0d('0x1e8')});db['WhatsappMessage']['belongsTo'](db[_0xda0d('0x138')],{'as':_0xda0d('0x165'),'foreignKey':_0xda0d('0x1e7')});db[_0xda0d('0x1e9')][_0xda0d('0x11a')](db[_0xda0d('0x138')],{});db[_0xda0d('0x1e9')]['belongsTo'](db['CmList'],{'as':_0xda0d('0x160'),'foreignKey':'ListId'});db[_0xda0d('0x1e9')][_0xda0d('0x11a')](db[_0xda0d('0x73')],{'as':_0xda0d('0x166'),'foreignKey':'ContactId'});db[_0xda0d('0x1e9')][_0xda0d('0x11a')](db[_0xda0d('0xf8')],{});db[_0xda0d('0x1e9')]['belongsTo'](db[_0xda0d('0xfe')],{});db['WhatsappQueueReport'][_0xda0d('0x11a')](db['WhatsappMessage'],{});db[_0xda0d('0x1e9')]['belongsTo'](db[_0xda0d('0x10a')],{});db[_0xda0d('0xfc')][_0xda0d('0x11a')](db[_0xda0d('0xfa')],{});db[_0xda0d('0xfc')][_0xda0d('0x11a')](db[_0xda0d('0xf8')],{});db[_0xda0d('0xfc')][_0xda0d('0x11a')](db[_0xda0d('0x138')],{'foreignKey':_0xda0d('0x1ea'),'as':'FromAccount'});db[_0xda0d('0xfc')]['belongsTo'](db[_0xda0d('0x138')],{'foreignKey':_0xda0d('0x1eb'),'as':_0xda0d('0x1d8')});db[_0xda0d('0xfc')][_0xda0d('0x11a')](db[_0xda0d('0xfe')],{'foreignKey':_0xda0d('0x1ec'),'as':'ToQueue'});db['WhatsappTransferReport'][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'foreignKey':_0xda0d('0x1da'),'as':_0xda0d('0x1d0')});db[_0xda0d('0xfc')]['belongsTo'](db[_0xda0d('0x10a')],{'foreignKey':_0xda0d('0x1d3'),'as':_0xda0d('0x1d4')});db['WhatsappQueue'][_0xda0d('0x11b')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x14f'),'through':_0xda0d('0x38'),'foreignKey':_0xda0d('0x1ed')});db['WhatsappQueue'][_0xda0d('0x11b')](db[_0xda0d('0xdd')],{'through':_0xda0d('0x1ca'),'as':'Teams'});db[_0xda0d('0x106')][_0xda0d('0x11a')](db[_0xda0d('0x10a')],{'as':_0xda0d('0x1ee'),'foreignKey':_0xda0d('0x109'),'onDelete':_0xda0d('0x108'),'hooks':!![]});db[_0xda0d('0x100')][_0xda0d('0x1ef')](db['Dynamics365Account'],{'as':_0xda0d('0xbd'),'onDelete':'restrict'});db[_0xda0d('0x100')][_0xda0d('0x1ef')](db[_0xda0d('0x3a')],{'as':_0xda0d('0x15c'),'onDelete':_0xda0d('0x15b')});db['CloudProvider'][_0xda0d('0x1ef')](db[_0xda0d('0x3b')],{'as':'Smtp','onDelete':_0xda0d('0x15b')});module[_0xda0d('0x1f0')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index f06539f..e40e630 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc97=['./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','root','/www','join','/snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','path','express','./errors','./utils/client-side-logger','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/voice/mails','/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/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/dashboard','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','./api/schedule','/api/sounds','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./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/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','/api/migrations','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles'];(function(_0x247f36,_0x333e5b){var _0x4e5abd=function(_0xb3371f){while(--_0xb3371f){_0x247f36['push'](_0x247f36['shift']());}};_0x4e5abd(++_0x333e5b);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3994cd,_0x3061ba){_0x3994cd=_0x3994cd-0x0;var _0x570c3a=_0xdc97[_0x3994cd];return _0x570c3a;};'use strict';var path=require(_0x7dc9('0x0'));var express=require(_0x7dc9('0x1'));var errors=require(_0x7dc9('0x2'));var config=require('./config/environment');var setupLoggers=require(_0x7dc9('0x3'))['setupLoggers'];var clientSideLogs=require(_0x7dc9('0x4'));exports[_0x7dc9('0x5')]=function(_0x478a95){return setupLoggers(_0x478a95)[_0x7dc9('0x6')](function(){_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x8'),require(_0x7dc9('0x9')));_0x478a95['use'](_0x7dc9('0xa'),require('./api/voiceChanSpy'));_0x478a95['use'](_0x7dc9('0xb'),require(_0x7dc9('0xc')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xd'),require(_0x7dc9('0xe')));_0x478a95['use'](_0x7dc9('0xf'),require(_0x7dc9('0x10')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x11'),require(_0x7dc9('0x12')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x13'),require('./api/voiceRecording'));_0x478a95['use']('/api/screen/recordings',require('./api/screenRecording'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x14'),require('./api/voiceMail'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x15'),require(_0x7dc9('0x16')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x17'),require(_0x7dc9('0x18')));_0x478a95['use'](_0x7dc9('0x19'),require(_0x7dc9('0x1a')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x1b'),require(_0x7dc9('0x1c')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x1d'),require(_0x7dc9('0x1e')));_0x478a95[_0x7dc9('0x7')]('/api/members/reports',require(_0x7dc9('0x1f')));_0x478a95['use'](_0x7dc9('0x20'),require(_0x7dc9('0x21')));_0x478a95['use'](_0x7dc9('0x22'),require(_0x7dc9('0x23')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x24'),require(_0x7dc9('0x25')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x26'),require(_0x7dc9('0x27')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x28'),require('./api/mailQueue'));_0x478a95['use'](_0x7dc9('0x29'),require(_0x7dc9('0x2a')));_0x478a95['use'](_0x7dc9('0x2b'),require(_0x7dc9('0x2c')));_0x478a95['use'](_0x7dc9('0x2d'),require(_0x7dc9('0x2e')));_0x478a95[_0x7dc9('0x7')]('/api/mail/applications',require(_0x7dc9('0x2f')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x30'),require('./api/mailQueueReport'));_0x478a95['use']('/api/dashboards',require(_0x7dc9('0x31')));_0x478a95[_0x7dc9('0x7')]('/api/dashboards/items',require('./api/dashboardItem'));_0x478a95[_0x7dc9('0x7')]('/api/fax/accounts',require(_0x7dc9('0x32')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x33'),require(_0x7dc9('0x34')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x35'),require(_0x7dc9('0x36')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x37'),require(_0x7dc9('0x38')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x39'),require('./api/faxQueue'));_0x478a95['use']('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x478a95['use']('/api/sms/accounts',require('./api/smsAccount'));_0x478a95['use'](_0x7dc9('0x3a'),require(_0x7dc9('0x3b')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x3c'),require(_0x7dc9('0x3d')));_0x478a95[_0x7dc9('0x7')]('/api/sms/messages',require('./api/smsMessage'));_0x478a95['use'](_0x7dc9('0x3e'),require('./api/smsQueue'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x3f'),require(_0x7dc9('0x40')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x41'),require(_0x7dc9('0x42')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x43'),require('./api/openchannelInteraction'));_0x478a95[_0x7dc9('0x7')]('/api/openchannel/messages',require(_0x7dc9('0x44')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x45'),require(_0x7dc9('0x46')));_0x478a95['use'](_0x7dc9('0x47'),require('./api/chatWebsite'));_0x478a95[_0x7dc9('0x7')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x48'),require(_0x7dc9('0x49')));_0x478a95[_0x7dc9('0x7')]('/api/chat/interactions',require(_0x7dc9('0x4a')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x4b'),require(_0x7dc9('0x4c')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x4d'),require(_0x7dc9('0x4e')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x4f'),require(_0x7dc9('0x50')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x51'),require('./api/chatGroup'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x52'),require(_0x7dc9('0x53')));_0x478a95[_0x7dc9('0x7')]('/api/cm/companies',require(_0x7dc9('0x54')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x55'),require(_0x7dc9('0x56')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x57'),require('./api/cmHopper'));_0x478a95['use'](_0x7dc9('0x58'),require(_0x7dc9('0x59')));_0x478a95['use'](_0x7dc9('0x5a'),require('./api/cmHopperFinal'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x5b'),require(_0x7dc9('0x5c')));_0x478a95['use'](_0x7dc9('0x5d'),require(_0x7dc9('0x5e')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x5f'),require(_0x7dc9('0x60')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x61'),require('./api/automation'));_0x478a95[_0x7dc9('0x7')]('/api/canned_answers',require('./api/cannedAnswer'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x62'),require(_0x7dc9('0x63')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x64'),require(_0x7dc9('0x65')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x66'),require(_0x7dc9('0x67')));_0x478a95['use'](_0x7dc9('0x68'),require(_0x7dc9('0x69')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x6a'),require(_0x7dc9('0x6b')));_0x478a95[_0x7dc9('0x7')]('/api/voiceQueuesLog',require(_0x7dc9('0x6c')));_0x478a95[_0x7dc9('0x7')]('/api/schedules',require(_0x7dc9('0x6d')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x6e'),require('./api/sound'));_0x478a95[_0x7dc9('0x7')]('/api/tags',require('./api/tag'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x6f'),require(_0x7dc9('0x70')));_0x478a95['use']('/api/triggers',require(_0x7dc9('0x71')));_0x478a95['use'](_0x7dc9('0x72'),require(_0x7dc9('0x73')));_0x478a95['use'](_0x7dc9('0x74'),require(_0x7dc9('0x75')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x76'),require(_0x7dc9('0x77')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x78'),require(_0x7dc9('0x79')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x7a'),require(_0x7dc9('0x7b')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x7c'),require('./api/analyticExtractedReport'));_0x478a95[_0x7dc9('0x7')]('/api/analytics/metrics',require('./api/analyticMetric'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x7d'),require(_0x7dc9('0x7e')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x7f'),require('./api/analyticTreeReport'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x80'),require(_0x7dc9('0x81')));_0x478a95['use'](_0x7dc9('0x82'),require(_0x7dc9('0x83')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x84'),require(_0x7dc9('0x85')));_0x478a95[_0x7dc9('0x7')]('/api/integrations/sugarcrm/accounts',require(_0x7dc9('0x86')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x87'),require(_0x7dc9('0x88')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x89'),require(_0x7dc9('0x8a')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x8b'),require(_0x7dc9('0x8c')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x8d'),require('./api/intDeskConfiguration'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x8e'),require(_0x7dc9('0x8f')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x90'),require('./api/intZohoAccount'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x91'),require(_0x7dc9('0x92')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x93'),require(_0x7dc9('0x94')));_0x478a95['use']('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x95'),require(_0x7dc9('0x96')));_0x478a95[_0x7dc9('0x7')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x97'),require(_0x7dc9('0x98')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x99'),require(_0x7dc9('0x9a')));_0x478a95[_0x7dc9('0x7')]('/api/integrations/freshdesk/fields',require(_0x7dc9('0x9b')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x9c'),require(_0x7dc9('0x9d')));_0x478a95[_0x7dc9('0x7')]('/api/integrations/vtiger/configurations',require(_0x7dc9('0x9e')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x9f'),require(_0x7dc9('0xa0')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xa1'),require(_0x7dc9('0xa2')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xa3'),require(_0x7dc9('0xa4')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xa5'),require(_0x7dc9('0xa6')));_0x478a95['use'](_0x7dc9('0xa7'),require('./api/intDynamics365Account'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xa8'),require('./api/intDynamics365Configuration'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xa9'),require('./api/intDynamics365Field'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xaa'),require(_0x7dc9('0xab')));_0x478a95['use']('/api/integrations/freshsales/configurations',require(_0x7dc9('0xac')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xad'),require(_0x7dc9('0xae')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xaf'),require(_0x7dc9('0xb0')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xb1'),require('./api/chatQueueReport'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xb2'),require(_0x7dc9('0xb3')));_0x478a95['use']('/api/jscripty/answers/reports',require(_0x7dc9('0xb4')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xb5'),require(_0x7dc9('0xb6')));_0x478a95['use']('/api/jscripty/sessions/reports',require(_0x7dc9('0xb7')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xb8'),require(_0x7dc9('0xb9')));_0x478a95['use'](_0x7dc9('0xba'),require(_0x7dc9('0xbb')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xbc'),require(_0x7dc9('0xbd')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xbe'),require('./api/jscriptyProject'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xbf'),require('./api/setting'));_0x478a95['use'](_0x7dc9('0xc0'),require('./api/squareOdbc'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xc1'),require(_0x7dc9('0xc2')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xc3'),require(_0x7dc9('0xc4')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xc5'),require(_0x7dc9('0xc6')));_0x478a95[_0x7dc9('0x7')]('/api/teams',require(_0x7dc9('0xc7')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xc8'),require('./api/license'));_0x478a95[_0x7dc9('0x7')]('/api/campaigns',require('./api/campaign'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xc9'),require('./api/migration'));_0x478a95[_0x7dc9('0x7')]('/api/attachments',require('./api/attachment'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xca'),require(_0x7dc9('0xcb')));_0x478a95[_0x7dc9('0x7')]('/api/mail/reports/transfer',require(_0x7dc9('0xcc')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xcd'),require(_0x7dc9('0xce')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xcf'),require(_0x7dc9('0xd0')));_0x478a95[_0x7dc9('0x7')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x478a95[_0x7dc9('0x7')]('/api/sms/reports/transfer',require(_0x7dc9('0xd1')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xd2'),require(_0x7dc9('0xd3')));_0x478a95['use'](_0x7dc9('0xd4'),require(_0x7dc9('0xd5')));_0x478a95['use'](_0x7dc9('0xd6'),require(_0x7dc9('0xd7')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xd8'),require('./api/userProfileSection'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xd9'),require('./api/userProfileResource'));_0x478a95['use'](_0x7dc9('0xda'),require(_0x7dc9('0xdb')));_0x478a95['use'](_0x7dc9('0xdc'),require('./api/whatsappAccount'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xdd'),require(_0x7dc9('0xde')));_0x478a95['use'](_0x7dc9('0xdf'),require(_0x7dc9('0xe0')));_0x478a95[_0x7dc9('0x7')]('/api/whatsapp/messages',require(_0x7dc9('0xe1')));_0x478a95['use']('/api/whatsapp/reports/queue',require(_0x7dc9('0xe2')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xe3'),require(_0x7dc9('0xe4')));_0x478a95[_0x7dc9('0x7')]('/api/whatsapp/queues',require(_0x7dc9('0xe5')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xe6'),require(_0x7dc9('0xe7')));_0x478a95[_0x7dc9('0x7')]('/api/realtime',require(_0x7dc9('0xe8')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xe9'),require(_0x7dc9('0xea')));_0x478a95['use'](_0x7dc9('0xeb'),require('./api/authLocal'));_0x478a95['use'](_0x7dc9('0xec'),require('./api/authGoogle'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xed'),require(_0x7dc9('0xee')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xef'),require(_0x7dc9('0xf0')));_0x478a95['use'](_0x7dc9('0xf1'),require(_0x7dc9('0xf2')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xf3'),require(_0x7dc9('0xf4')));_0x478a95['use'](_0x7dc9('0xf5'),require('./api/system'));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xf6'),require(_0x7dc9('0xf7')));_0x478a95['use'](_0x7dc9('0xf8'),require(_0x7dc9('0xf9')));_0x478a95['use'](_0x7dc9('0xfa'),clientSideLogs);_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xfb'),express[_0x7dc9('0xfc')](path['join'](config[_0x7dc9('0xfd')],'/apidoc')));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0xfe'),express[_0x7dc9('0xfc')](path['join'](config[_0x7dc9('0xfd')],_0x7dc9('0xfe'))));_0x478a95[_0x7dc9('0x7')]('/demo',express['static'](path[_0x7dc9('0xff')](config[_0x7dc9('0xfd')],'/demo')));_0x478a95['use'](_0x7dc9('0x100'),express[_0x7dc9('0xfc')](path['join'](config[_0x7dc9('0xfd')],'snippet',_0x7dc9('0x101'))));_0x478a95[_0x7dc9('0x7')](_0x7dc9('0x102'),express[_0x7dc9('0xfc')](path[_0x7dc9('0xff')](config[_0x7dc9('0xfd')],'/server/files/plugins')));_0x478a95[_0x7dc9('0x103')](_0x7dc9('0x104'))[_0x7dc9('0x105')](errors[0x194]);_0x478a95[_0x7dc9('0x103')]('/*')[_0x7dc9('0x105')](function(_0x5397a4,_0x42b6d8){_0x42b6d8[_0x7dc9('0x106')](path[_0x7dc9('0x107')](_0x478a95[_0x7dc9('0x105')]('appPath')+_0x7dc9('0x108')));});return _0x478a95;});}; \ No newline at end of file +var _0x9957=['/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/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/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','/api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','3.0.0','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','route','resolve','/index.html','path','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','use','/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/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/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/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport'];(function(_0x4a9150,_0x1588b4){var _0x49ea14=function(_0x1e2b78){while(--_0x1e2b78){_0x4a9150['push'](_0x4a9150['shift']());}};_0x49ea14(++_0x1588b4);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var path=require(_0x7995('0x0'));var express=require(_0x7995('0x1'));var errors=require(_0x7995('0x2'));var config=require(_0x7995('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0x7995('0x4')];var clientSideLogs=require(_0x7995('0x5'));exports[_0x7995('0x6')]=function(_0x462a03){return setupLoggers(_0x462a03)['then'](function(){_0x462a03[_0x7995('0x7')](_0x7995('0x8'),require(_0x7995('0x9')));_0x462a03[_0x7995('0x7')](_0x7995('0xa'),require(_0x7995('0xb')));_0x462a03['use'](_0x7995('0xc'),require(_0x7995('0xd')));_0x462a03['use'](_0x7995('0xe'),require(_0x7995('0xf')));_0x462a03[_0x7995('0x7')](_0x7995('0x10'),require(_0x7995('0x11')));_0x462a03[_0x7995('0x7')](_0x7995('0x12'),require('./api/voiceQueue'));_0x462a03[_0x7995('0x7')](_0x7995('0x13'),require('./api/voiceRecording'));_0x462a03[_0x7995('0x7')](_0x7995('0x14'),require(_0x7995('0x15')));_0x462a03[_0x7995('0x7')](_0x7995('0x16'),require(_0x7995('0x17')));_0x462a03[_0x7995('0x7')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x462a03[_0x7995('0x7')](_0x7995('0x18'),require(_0x7995('0x19')));_0x462a03[_0x7995('0x7')](_0x7995('0x1a'),require(_0x7995('0x1b')));_0x462a03[_0x7995('0x7')](_0x7995('0x1c'),require('./api/voiceAgentReport'));_0x462a03[_0x7995('0x7')]('/api/voice/queues/reports',require(_0x7995('0x1d')));_0x462a03[_0x7995('0x7')](_0x7995('0x1e'),require(_0x7995('0x1f')));_0x462a03[_0x7995('0x7')](_0x7995('0x20'),require('./api/trunk'));_0x462a03['use'](_0x7995('0x21'),require('./api/voiceTransferReport'));_0x462a03['use'](_0x7995('0x22'),require(_0x7995('0x23')));_0x462a03['use'](_0x7995('0x24'),require('./api/mailAccount'));_0x462a03['use'](_0x7995('0x25'),require(_0x7995('0x26')));_0x462a03[_0x7995('0x7')](_0x7995('0x27'),require(_0x7995('0x28')));_0x462a03[_0x7995('0x7')]('/api/mail/interactions',require(_0x7995('0x29')));_0x462a03[_0x7995('0x7')](_0x7995('0x2a'),require(_0x7995('0x2b')));_0x462a03[_0x7995('0x7')](_0x7995('0x2c'),require(_0x7995('0x2d')));_0x462a03[_0x7995('0x7')]('/api/mail/reports/queue',require(_0x7995('0x2e')));_0x462a03[_0x7995('0x7')](_0x7995('0x2f'),require(_0x7995('0x30')));_0x462a03[_0x7995('0x7')](_0x7995('0x31'),require('./api/dashboardItem'));_0x462a03[_0x7995('0x7')]('/api/fax/accounts',require(_0x7995('0x32')));_0x462a03[_0x7995('0x7')](_0x7995('0x33'),require(_0x7995('0x34')));_0x462a03[_0x7995('0x7')]('/api/fax/interactions',require(_0x7995('0x35')));_0x462a03['use'](_0x7995('0x36'),require(_0x7995('0x37')));_0x462a03[_0x7995('0x7')]('/api/fax/queues',require('./api/faxQueue'));_0x462a03['use'](_0x7995('0x38'),require(_0x7995('0x39')));_0x462a03[_0x7995('0x7')](_0x7995('0x3a'),require(_0x7995('0x3b')));_0x462a03[_0x7995('0x7')]('/api/sms/applications',require('./api/smsApplication'));_0x462a03[_0x7995('0x7')]('/api/sms/interactions',require(_0x7995('0x3c')));_0x462a03[_0x7995('0x7')](_0x7995('0x3d'),require(_0x7995('0x3e')));_0x462a03[_0x7995('0x7')]('/api/sms/queues',require(_0x7995('0x3f')));_0x462a03[_0x7995('0x7')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x462a03['use'](_0x7995('0x40'),require(_0x7995('0x41')));_0x462a03['use'](_0x7995('0x42'),require('./api/openchannelInteraction'));_0x462a03[_0x7995('0x7')](_0x7995('0x43'),require(_0x7995('0x44')));_0x462a03['use']('/api/openchannel/queues',require(_0x7995('0x45')));_0x462a03['use']('/api/chat/websites',require(_0x7995('0x46')));_0x462a03[_0x7995('0x7')]('/api/openchannel/reports/queue',require(_0x7995('0x47')));_0x462a03[_0x7995('0x7')](_0x7995('0x48'),require(_0x7995('0x49')));_0x462a03[_0x7995('0x7')]('/api/chat/interactions',require(_0x7995('0x4a')));_0x462a03[_0x7995('0x7')](_0x7995('0x4b'),require(_0x7995('0x4c')));_0x462a03['use'](_0x7995('0x4d'),require(_0x7995('0x4e')));_0x462a03[_0x7995('0x7')](_0x7995('0x4f'),require(_0x7995('0x50')));_0x462a03[_0x7995('0x7')]('/api/chat/groups',require(_0x7995('0x51')));_0x462a03[_0x7995('0x7')](_0x7995('0x52'),require(_0x7995('0x53')));_0x462a03[_0x7995('0x7')](_0x7995('0x54'),require(_0x7995('0x55')));_0x462a03[_0x7995('0x7')](_0x7995('0x56'),require(_0x7995('0x57')));_0x462a03[_0x7995('0x7')](_0x7995('0x58'),require(_0x7995('0x59')));_0x462a03['use']('/api/cm/hopper_black',require(_0x7995('0x5a')));_0x462a03[_0x7995('0x7')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x462a03[_0x7995('0x7')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x462a03[_0x7995('0x7')](_0x7995('0x5b'),require(_0x7995('0x5c')));_0x462a03['use'](_0x7995('0x5d'),require('./api/action'));_0x462a03[_0x7995('0x7')]('/api/automations',require('./api/automation'));_0x462a03[_0x7995('0x7')](_0x7995('0x5e'),require(_0x7995('0x5f')));_0x462a03[_0x7995('0x7')]('/api/dispositions',require(_0x7995('0x60')));_0x462a03[_0x7995('0x7')](_0x7995('0x61'),require(_0x7995('0x62')));_0x462a03['use']('/api/intervals',require(_0x7995('0x63')));_0x462a03['use'](_0x7995('0x64'),require('./api/pause'));_0x462a03[_0x7995('0x7')]('/api/cdr',require(_0x7995('0x65')));_0x462a03[_0x7995('0x7')]('/api/voiceQueuesLog',require(_0x7995('0x66')));_0x462a03[_0x7995('0x7')](_0x7995('0x67'),require(_0x7995('0x68')));_0x462a03['use'](_0x7995('0x69'),require(_0x7995('0x6a')));_0x462a03[_0x7995('0x7')]('/api/tags',require(_0x7995('0x6b')));_0x462a03[_0x7995('0x7')](_0x7995('0x6c'),require(_0x7995('0x6d')));_0x462a03[_0x7995('0x7')]('/api/triggers',require(_0x7995('0x6e')));_0x462a03[_0x7995('0x7')]('/api/variables',require(_0x7995('0x6f')));_0x462a03['use'](_0x7995('0x70'),require(_0x7995('0x71')));_0x462a03[_0x7995('0x7')](_0x7995('0x72'),require(_0x7995('0x73')));_0x462a03[_0x7995('0x7')](_0x7995('0x74'),require('./api/analyticCustomReport'));_0x462a03[_0x7995('0x7')](_0x7995('0x75'),require(_0x7995('0x76')));_0x462a03['use'](_0x7995('0x77'),require(_0x7995('0x78')));_0x462a03[_0x7995('0x7')]('/api/analytics/metrics',require('./api/analyticMetric'));_0x462a03['use'](_0x7995('0x79'),require(_0x7995('0x7a')));_0x462a03['use'](_0x7995('0x7b'),require(_0x7995('0x7c')));_0x462a03[_0x7995('0x7')](_0x7995('0x7d'),require(_0x7995('0x7e')));_0x462a03['use'](_0x7995('0x7f'),require('./api/intSalesforceConfiguration'));_0x462a03[_0x7995('0x7')](_0x7995('0x80'),require(_0x7995('0x81')));_0x462a03['use']('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x462a03['use'](_0x7995('0x82'),require(_0x7995('0x83')));_0x462a03[_0x7995('0x7')](_0x7995('0x84'),require(_0x7995('0x85')));_0x462a03[_0x7995('0x7')](_0x7995('0x86'),require(_0x7995('0x87')));_0x462a03[_0x7995('0x7')](_0x7995('0x88'),require(_0x7995('0x89')));_0x462a03[_0x7995('0x7')](_0x7995('0x8a'),require(_0x7995('0x8b')));_0x462a03[_0x7995('0x7')](_0x7995('0x8c'),require(_0x7995('0x8d')));_0x462a03[_0x7995('0x7')](_0x7995('0x8e'),require('./api/intZohoConfiguration'));_0x462a03[_0x7995('0x7')](_0x7995('0x8f'),require(_0x7995('0x90')));_0x462a03[_0x7995('0x7')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x462a03[_0x7995('0x7')](_0x7995('0x91'),require(_0x7995('0x92')));_0x462a03[_0x7995('0x7')]('/api/integrations/zendesk/fields',require(_0x7995('0x93')));_0x462a03[_0x7995('0x7')](_0x7995('0x94'),require(_0x7995('0x95')));_0x462a03['use']('/api/integrations/freshdesk/configurations',require(_0x7995('0x96')));_0x462a03[_0x7995('0x7')](_0x7995('0x97'),require(_0x7995('0x98')));_0x462a03[_0x7995('0x7')](_0x7995('0x99'),require(_0x7995('0x9a')));_0x462a03[_0x7995('0x7')](_0x7995('0x9b'),require('./api/intVtigerConfiguration'));_0x462a03[_0x7995('0x7')](_0x7995('0x9c'),require(_0x7995('0x9d')));_0x462a03[_0x7995('0x7')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x462a03[_0x7995('0x7')](_0x7995('0x9e'),require('./api/intServicenowConfiguration'));_0x462a03[_0x7995('0x7')](_0x7995('0x9f'),require(_0x7995('0xa0')));_0x462a03[_0x7995('0x7')](_0x7995('0xa1'),require('./api/intDynamics365Account'));_0x462a03[_0x7995('0x7')]('/api/integrations/dynamics365/configurations',require(_0x7995('0xa2')));_0x462a03[_0x7995('0x7')](_0x7995('0xa3'),require(_0x7995('0xa4')));_0x462a03[_0x7995('0x7')](_0x7995('0xa5'),require(_0x7995('0xa6')));_0x462a03[_0x7995('0x7')](_0x7995('0xa7'),require(_0x7995('0xa8')));_0x462a03[_0x7995('0x7')](_0x7995('0xa9'),require('./api/intFreshsalesField'));_0x462a03[_0x7995('0x7')](_0x7995('0xaa'),require(_0x7995('0xab')));_0x462a03[_0x7995('0x7')](_0x7995('0xac'),require('./api/chatQueueReport'));_0x462a03['use'](_0x7995('0xad'),require(_0x7995('0xae')));_0x462a03[_0x7995('0x7')](_0x7995('0xaf'),require('./api/jscriptyAnswerReport'));_0x462a03[_0x7995('0x7')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x462a03[_0x7995('0x7')](_0x7995('0xb0'),require(_0x7995('0xb1')));_0x462a03[_0x7995('0x7')](_0x7995('0xb2'),require(_0x7995('0xb3')));_0x462a03[_0x7995('0x7')](_0x7995('0xb4'),require(_0x7995('0xb5')));_0x462a03[_0x7995('0x7')]('/api/square/details/reports',require(_0x7995('0xb6')));_0x462a03[_0x7995('0x7')](_0x7995('0xb7'),require('./api/jscriptyProject'));_0x462a03[_0x7995('0x7')](_0x7995('0xb8'),require(_0x7995('0xb9')));_0x462a03[_0x7995('0x7')](_0x7995('0xba'),require(_0x7995('0xbb')));_0x462a03[_0x7995('0x7')](_0x7995('0xbc'),require(_0x7995('0xbd')));_0x462a03[_0x7995('0x7')](_0x7995('0xbe'),require('./api/squareRecording'));_0x462a03['use'](_0x7995('0xbf'),require(_0x7995('0xc0')));_0x462a03[_0x7995('0x7')](_0x7995('0xc1'),require('./api/team'));_0x462a03[_0x7995('0x7')](_0x7995('0xc2'),require('./api/license'));_0x462a03['use'](_0x7995('0xc3'),require(_0x7995('0xc4')));_0x462a03['use'](_0x7995('0xc5'),require('./api/migration'));_0x462a03[_0x7995('0x7')](_0x7995('0xc6'),require('./api/attachment'));_0x462a03['use'](_0x7995('0xc7'),require('./api/plugin'));_0x462a03[_0x7995('0x7')](_0x7995('0xc8'),require(_0x7995('0xc9')));_0x462a03[_0x7995('0x7')](_0x7995('0xca'),require(_0x7995('0xcb')));_0x462a03[_0x7995('0x7')](_0x7995('0xcc'),require(_0x7995('0xcd')));_0x462a03[_0x7995('0x7')](_0x7995('0xce'),require(_0x7995('0xcf')));_0x462a03[_0x7995('0x7')](_0x7995('0xd0'),require(_0x7995('0xd1')));_0x462a03[_0x7995('0x7')](_0x7995('0xd2'),require(_0x7995('0xd3')));_0x462a03[_0x7995('0x7')](_0x7995('0xd4'),require(_0x7995('0xd5')));_0x462a03[_0x7995('0x7')](_0x7995('0xd6'),require(_0x7995('0xd7')));_0x462a03[_0x7995('0x7')](_0x7995('0xd8'),require(_0x7995('0xd9')));_0x462a03[_0x7995('0x7')]('/api/userProfile/resources',require(_0x7995('0xda')));_0x462a03[_0x7995('0x7')]('/api/userNotifications',require('./api/userNotification'));_0x462a03[_0x7995('0x7')](_0x7995('0xdb'),require(_0x7995('0xdc')));_0x462a03[_0x7995('0x7')](_0x7995('0xdd'),require(_0x7995('0xde')));_0x462a03['use'](_0x7995('0xdf'),require(_0x7995('0xe0')));_0x462a03[_0x7995('0x7')](_0x7995('0xe1'),require(_0x7995('0xe2')));_0x462a03[_0x7995('0x7')](_0x7995('0xe3'),require(_0x7995('0xe4')));_0x462a03['use'](_0x7995('0xe5'),require(_0x7995('0xe6')));_0x462a03['use']('/api/whatsapp/queues',require(_0x7995('0xe7')));_0x462a03[_0x7995('0x7')](_0x7995('0xe8'),require(_0x7995('0xe9')));_0x462a03[_0x7995('0x7')]('/api/realtime',require(_0x7995('0xea')));_0x462a03[_0x7995('0x7')]('/api/user-settings',require(_0x7995('0xeb')));_0x462a03[_0x7995('0x7')]('/api/auth/local',require(_0x7995('0xec')));_0x462a03['use'](_0x7995('0xed'),require(_0x7995('0xee')));_0x462a03[_0x7995('0x7')](_0x7995('0xef'),require(_0x7995('0xf0')));_0x462a03['use'](_0x7995('0xf1'),require(_0x7995('0xf2')));_0x462a03[_0x7995('0x7')]('/api/rpc',require(_0x7995('0xf3')));_0x462a03[_0x7995('0x7')](_0x7995('0xf4'),require(_0x7995('0xf5')));_0x462a03['use'](_0x7995('0xf6'),require(_0x7995('0xf7')));_0x462a03[_0x7995('0x7')]('/api/pm2',require('./api/pm2'));_0x462a03[_0x7995('0x7')](_0x7995('0xf8'),require('./api/webbar'));_0x462a03['use'](_0x7995('0xf9'),clientSideLogs);_0x462a03[_0x7995('0x7')](_0x7995('0xfa'),express[_0x7995('0xfb')](path[_0x7995('0xfc')](config['root'],'/apidoc')));_0x462a03[_0x7995('0x7')]('/www',express['static'](path[_0x7995('0xfc')](config[_0x7995('0xfd')],_0x7995('0xfe'))));_0x462a03['use'](_0x7995('0xff'),express[_0x7995('0xfb')](path[_0x7995('0xfc')](config[_0x7995('0xfd')],_0x7995('0xff'))));_0x462a03['use'](_0x7995('0x100'),express[_0x7995('0xfb')](path[_0x7995('0xfc')](config[_0x7995('0xfd')],'snippet',_0x7995('0x101'))));_0x462a03[_0x7995('0x7')]('/plugins',express[_0x7995('0xfb')](path[_0x7995('0xfc')](config['root'],_0x7995('0x102'))));_0x462a03['route'](_0x7995('0x103'))['get'](errors[0x194]);_0x462a03[_0x7995('0x104')]('/*')['get'](function(_0xa97c08,_0x20f48c){_0x20f48c['sendFile'](path[_0x7995('0x105')](_0x462a03['get']('appPath')+_0x7995('0x106')));});return _0x462a03;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index b143015..4f545e2 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea5f=['port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.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/squareOdbc/squareOdbc.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/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xea5f,0x91));var _0xfea5=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xea5f[_0x565c49];return _0x20ca34;};'use strict';var jayson=require(_0xfea5('0x0'));var _=require(_0xfea5('0x1'));var config=require(_0xfea5('0x2'));exports[_0xfea5('0x3')]=function(){return new Promise(function(_0x2887dd,_0x168c1b){var _0x1f1734={};_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/user/user.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x5')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/voiceQueue/voiceQueue.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/voiceRecording/voiceRecording.rpc'));_0x1f1734=_['merge'](_0x1f1734,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x1f1734=_['merge'](_0x1f1734,require(_0xfea5('0x6')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x7')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/memberReport/memberReport.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/trunk/trunk.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x8')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x9')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0xa')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0xb')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0xc')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/mailInteraction/mailInteraction.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0xd')));_0x1f1734=_['merge'](_0x1f1734,require('../api/mailApplication/mailApplication.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0xe')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0xf')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x10')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x11')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x12')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x13')));_0x1f1734=_['merge'](_0x1f1734,require(_0xfea5('0x14')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x15')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x16')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/smsQueue/smsQueue.rpc'));_0x1f1734=_['merge'](_0x1f1734,require(_0xfea5('0x17')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x18')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x19')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x1a')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x1b')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x1c')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x1d')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x1e')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x1f')));_0x1f1734=_['merge'](_0x1f1734,require(_0xfea5('0x20')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x21')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x1f1734=_['merge'](_0x1f1734,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x22')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x23')));_0x1f1734=_['merge'](_0x1f1734,require('../api/pause/pause.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x24')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/template/template.rpc'));_0x1f1734=_['merge'](_0x1f1734,require(_0xfea5('0x25')));_0x1f1734=_['merge'](_0x1f1734,require(_0xfea5('0x26')));_0x1f1734=_['merge'](_0x1f1734,require(_0xfea5('0x27')));_0x1f1734=_['merge'](_0x1f1734,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x28')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x29')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x2a')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x2b')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x2c')));_0x1f1734=_['merge'](_0x1f1734,require(_0xfea5('0x2d')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x2e')));_0x1f1734=_['merge'](_0x1f1734,require(_0xfea5('0x2f')));_0x1f1734=_['merge'](_0x1f1734,require(_0xfea5('0x30')));_0x1f1734=_['merge'](_0x1f1734,require('../api/squareReport/squareReport.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/setting/setting.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x31')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/squareProject/squareProject.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x32')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x33')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x34')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x35')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x36')));_0x1f1734=_['merge'](_0x1f1734,require(_0xfea5('0x37')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x38')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x39')));_0x1f1734=_[_0xfea5('0x4')](_0x1f1734,require(_0xfea5('0x3a')));var _0x42f1c5=jayson[_0xfea5('0x3b')](_0x1f1734)[_0xfea5('0x3c')]();var _0x4c18fc=config[_0xfea5('0x3d')][_0xfea5('0x3e')]||config[_0xfea5('0x3e')]+0x1;var _0x621f23=config[_0xfea5('0x3d')]['ip']||_0xfea5('0x3f');_0x42f1c5['on'](_0xfea5('0x40'),function(_0x365f4c){return _0x168c1b(_0x365f4c);});_0x42f1c5[_0xfea5('0x3')](_0x4c18fc,_0x621f23,function(){console[_0xfea5('0x41')](_0xfea5('0x42'),_0x621f23,_0x4c18fc);require('../config/triggers')[_0xfea5('0x43')]();return _0x2887dd(_0xfea5('0x44')+_0x621f23+':'+_0x4c18fc);});});}; \ No newline at end of file +var _0xd75e=['../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.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/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc'];(function(_0x185090,_0x1d1667){var _0x448d8f=function(_0x164fb9){while(--_0x164fb9){_0x185090['push'](_0x185090['shift']());}};_0x448d8f(++_0x1d1667);}(_0xd75e,0x13e));var _0xed75=function(_0x4c647c,_0xca838d){_0x4c647c=_0x4c647c-0x0;var _0x5efb5d=_0xd75e[_0x4c647c];return _0x5efb5d;};'use strict';var jayson=require(_0xed75('0x0'));var _=require(_0xed75('0x1'));var config=require(_0xed75('0x2'));exports['listen']=function(){return new Promise(function(_0x3514d4,_0x3ff2d6){var _0x519c07={};_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x4')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x5')));_0x519c07=_['merge'](_0x519c07,require('../api/voiceQueue/voiceQueue.rpc'));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x6')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x7')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x8')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x9')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0xa')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0xb')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0xc')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x519c07=_[_0xed75('0x3')](_0x519c07,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x519c07=_[_0xed75('0x3')](_0x519c07,require('../api/mailServerIn/mailServerIn.rpc'));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0xd')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0xe')));_0x519c07=_['merge'](_0x519c07,require(_0xed75('0xf')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x10')));_0x519c07=_['merge'](_0x519c07,require(_0xed75('0x11')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x12')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x13')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x14')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require('../api/faxMessage/faxMessage.rpc'));_0x519c07=_['merge'](_0x519c07,require(_0xed75('0x15')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x16')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x17')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x18')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x19')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x1a')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x1b')));_0x519c07=_['merge'](_0x519c07,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x1c')));_0x519c07=_['merge'](_0x519c07,require(_0xed75('0x1d')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x1e')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require('../api/chatQueue/chatQueue.rpc'));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x1f')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require('../api/cmHopper/cmHopper.rpc'));_0x519c07=_['merge'](_0x519c07,require(_0xed75('0x20')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x21')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x22')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x519c07=_['merge'](_0x519c07,require(_0xed75('0x23')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x24')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x25')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require('../api/template/template.rpc'));_0x519c07=_['merge'](_0x519c07,require('../api/trigger/trigger.rpc'));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x26')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x27')));_0x519c07=_['merge'](_0x519c07,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x28')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x29')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x2a')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x2b')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x2c')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x2d')));_0x519c07=_['merge'](_0x519c07,require(_0xed75('0x2e')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x2f')));_0x519c07=_['merge'](_0x519c07,require(_0xed75('0x30')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x519c07=_['merge'](_0x519c07,require(_0xed75('0x31')));_0x519c07=_['merge'](_0x519c07,require(_0xed75('0x32')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x33')));_0x519c07=_['merge'](_0x519c07,require(_0xed75('0x34')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x35')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require('../api/squareRecording/squareRecording.rpc'));_0x519c07=_['merge'](_0x519c07,require(_0xed75('0x36')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require('../api/campaign/campaign.rpc'));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x37')));_0x519c07=_['merge'](_0x519c07,require('../api/plugin/plugin.rpc'));_0x519c07=_['merge'](_0x519c07,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x38')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x39')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x3a')));_0x519c07=_[_0xed75('0x3')](_0x519c07,require(_0xed75('0x3b')));var _0x1253e1=jayson['server'](_0x519c07)['http']();var _0x3ff0c2=config[_0xed75('0x3c')]['port']||config[_0xed75('0x3d')]+0x1;var _0x26b8ab=config[_0xed75('0x3c')]['ip']||'localhost';_0x1253e1['on'](_0xed75('0x3e'),function(_0x528bb8){return _0x3ff2d6(_0x528bb8);});_0x1253e1['listen'](_0x3ff0c2,_0x26b8ab,function(){console[_0xed75('0x3f')](_0xed75('0x40'),_0x26b8ab,_0x3ff0c2);require(_0xed75('0x41'))['default']();return _0x3514d4(_0xed75('0x42')+_0x26b8ab+':'+_0x3ff0c2);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 3b8d2d0..a75864b 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 _0xe829=['sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','noop','GOTO\x20%s\x20%s\x20%s','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','WAIT','label','exports','lodash','events','EventEmitter','./reply','./error','utf8','setTimeout','setEncoding','headers','emit','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','indexOf','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','sendRequest','sync','prototype','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s'];(function(_0x3c6758,_0x27fdd6){var _0x20d048=function(_0x53b971){while(--_0x53b971){_0x3c6758['push'](_0x3c6758['shift']());}};_0x20d048(++_0x27fdd6);}(_0xe829,0xde));var _0x9e82=function(_0x54b458,_0x4da21b){_0x54b458=_0x54b458-0x0;var _0x18d704=_0xe829[_0x54b458];return _0x18d704;};'use strict';var util=require('util');var _=require(_0x9e82('0x0'));var EventEmitter=require(_0x9e82('0x1'))[_0x9e82('0x2')];var AGIReply=require(_0x9e82('0x3'));var AGIError=require(_0x9e82('0x4'));function AGIChannel(_0x375e07){var _0x487d2d=this,_0xc8aec1=new AGIReply(),_0x19ece0=![],_0x4bd524={};EventEmitter['call'](_0x487d2d);_0x375e07['setEncoding'](_0x9e82('0x5'));_0x375e07[_0x9e82('0x6')](0x8*0x3c*0x3c*0x3e8);_0xc8aec1[_0x9e82('0x7')]('utf8');_0xc8aec1['on'](_0x9e82('0x8'),function(_0x2b1ecb){for(var _0x2d83f8 in _0x2b1ecb){_0x487d2d[_0x2d83f8]=_0x2b1ecb[_0x2d83f8];}_0x487d2d[_0x9e82('0x9')]('ready');});_0xc8aec1['on'](_0x9e82('0xa'),function(_0x408027){if(_0x408027['toLowerCase']()==_0x9e82('0xb')){_0x487d2d[_0x9e82('0x9')]('hangup');return;}if(_0x408027[_0x9e82('0xc')](0x0,0xb)==_0x9e82('0xd')){_0x19ece0=!![];}if(_0x19ece0){_0x4bd524['rx']+=_0x408027+'\x0a';if(_0x408027[_0x9e82('0xe')](_0x9e82('0xf'))!=-0x1){_0x19ece0=![];}}else{_0x4bd524['rx']=_0x408027;}if(_0x19ece0){return;}if(typeof _0x4bd524['cb']==_0x9e82('0x10')){var _0x5a835d=_0x4bd524['rx'][_0x9e82('0xc')](0x0,0x3),_0x2cd0f6=null,_0x330e5e=null;_0x5a835d=parseInt(_0x5a835d);if(isNaN(_0x5a835d)){_0x4bd524['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x9e82('0x11')});return;}if(_0x5a835d!=0xc8){_0x4bd524['cb'](null,{'code':_0x5a835d,'result':-0x1,'extra':'KO'});return;}_0x2cd0f6=_0x4bd524['rx']['substring'](0x4)['replace']('result=','');if(_0x2cd0f6['indexOf']('\x20')!=-0x1){_0x2cd0f6=_0x2cd0f6['substr'](0x0,_0x2cd0f6[_0x9e82('0x12')]('\x20'));}if(_['startsWith'](_0x2cd0f6,'-1')){_0x2cd0f6=parseInt(_0x2cd0f6);}_0x330e5e=_0x4bd524['rx'][_0x9e82('0x13')]('\x20');if(_0x330e5e[_0x9e82('0x14')]==0x3){_0x330e5e=_0x330e5e[0x2][_0x9e82('0xc')](0x1,_0x330e5e[0x2][_0x9e82('0x14')]-0x1);}else if(_0x330e5e['length']>0x3){var _0x36c82e=/\((.+)\)/;var _0x121fd0=_0x4bd524['rx']['match'](_0x36c82e);if(_0x121fd0){_0x330e5e=_0x121fd0[0x1];}else{_0x330e5e=null;}}else{_0x330e5e=null;}_0x4bd524['cb'](null,{'code':_0x5a835d,'result':_0x2cd0f6,'extra':_0x330e5e});}});_0x375e07['on']('error',function(_0x2a0afd){_0x487d2d[_0x9e82('0x9')](_0x9e82('0x15'),new AGIError(_0x9e82('0x16'),_0x2a0afd[_0x9e82('0x17')]));});_0x375e07['on'](_0x9e82('0x18'),function(){_0x487d2d[_0x9e82('0x9')]('close',new AGIError(_0x9e82('0x19')));});_0x375e07['on'](_0x9e82('0x1a'),function(){_0x487d2d[_0x9e82('0x9')]('timeout',new AGIError(_0x9e82('0x1b')));_0x375e07['destroy']();});_0x375e07[_0x9e82('0x1c')](_0xc8aec1);this[_0x9e82('0x1d')]=function(_0x463357,_0xede436){var _0x463357=_0x463357||'',_0xede436=typeof _0xede436==_0x9e82('0x10')?_0xede436:new Function();_0x4bd524={'tx':_0x463357,'rx':'','cb':_0xede436};_0x375e07[_0x9e82('0x1e')](_0x463357+'\x0a');},this[_0x9e82('0x18')]=function(){_0x375e07[_0x9e82('0x1f')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x9e82('0x20')]=function(_0x16e006){return this[_0x9e82('0x1d')][_0x9e82('0x21')](this,_0x16e006);};AGIChannel[_0x9e82('0x22')][_0x9e82('0x23')]=function(){return this['sendRequest'](_0x9e82('0x24'));};AGIChannel['prototype']['getData']=function(_0x2cb910,_0x4a8329,_0x5a5a4e){_0x2cb910=_0x2cb910===undefined?_0x9e82('0x25'):_0x2cb910;_0x4a8329=_0x4a8329===undefined?'5':_0x4a8329;_0x5a5a4e=_0x5a5a4e===undefined?'1':_0x5a5a4e;return this[_0x9e82('0x20')](util[_0x9e82('0x26')](_0x9e82('0x27'),_0x2cb910,_0x4a8329*0x3e8,_0x5a5a4e));};AGIChannel[_0x9e82('0x22')]['noop']=function(_0x54060f){_0x54060f=_0x54060f||_0x9e82('0x28');return this[_0x9e82('0x20')](util[_0x9e82('0x26')]('VERBOSE\x20\x22%s\x22',_0x54060f));};AGIChannel['prototype'][_0x9e82('0x29')]=function(_0x41c424,_0x46afaf){if(_[_0x9e82('0x2a')](_0x46afaf)){return this[_0x9e82('0x20')](util[_0x9e82('0x26')]('EXEC\x20%s\x20%s',_0x41c424,_0x46afaf['join'](',')));}return this['sendRequest'](util['format'](_0x9e82('0x2b'),_0x41c424,_0x46afaf));};AGIChannel[_0x9e82('0x22')][_0x9e82('0x2c')]=function(_0x4bcedd){return this[_0x9e82('0x20')](util[_0x9e82('0x26')]('SET\x20CONTEXT\x20%s',_0x4bcedd));};AGIChannel[_0x9e82('0x22')][_0x9e82('0x2d')]=function(_0x329b2d){return this[_0x9e82('0x20')](util[_0x9e82('0x26')](_0x9e82('0x2e'),_0x329b2d));};AGIChannel[_0x9e82('0x22')][_0x9e82('0x2f')]=function(_0x440b32){return this[_0x9e82('0x20')](util[_0x9e82('0x26')](_0x9e82('0x30'),_0x440b32));};AGIChannel[_0x9e82('0x22')][_0x9e82('0xb')]=function(){return this[_0x9e82('0x20')](_0x9e82('0x31'));};AGIChannel[_0x9e82('0x22')][_0x9e82('0x32')]=function(_0x9dd35c,_0x1fdf6a){var _0x31e300=_[_0x9e82('0x33')](_0x1fdf6a)||_[_0x9e82('0x34')](_0x1fdf6a)?_0x1fdf6a[_0x9e82('0x35')]():_0x1fdf6a;return this[_0x9e82('0x20')](util[_0x9e82('0x26')](_0x9e82('0x36'),_0x9dd35c,_0x31e300?_0x31e300['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x1324d5,_0x4163ed){return this[_0x9e82('0x20')](util[_0x9e82('0x26')](_0x9e82('0x37'),_0x1324d5,_0x4163ed));};AGIChannel[_0x9e82('0x22')][_0x9e82('0x38')]=function(_0x3934b3,_0x442999){return this[_0x9e82('0x20')](util[_0x9e82('0x26')](_0x9e82('0x39'),_0x3934b3,_0x442999));};AGIChannel['prototype'][_0x9e82('0x3a')]=function(_0x422ce2,_0x46ca7d){return this['sendRequest'](util[_0x9e82('0x26')](_0x9e82('0x3b'),_0x422ce2,_0x46ca7d));};AGIChannel[_0x9e82('0x22')]['continueAt']=function(_0x12fbdb,_0x2dfaec,_0xd77772){_0x2dfaec=_0x2dfaec||this[_0x9e82('0x3c')];_0xd77772=_0xd77772||0x1;this[_0x9e82('0x2c')](_0x12fbdb);this[_0x9e82('0x2d')](_0x2dfaec);this[_0x9e82('0x2f')](_0xd77772);return this[_0x9e82('0x3d')](util[_0x9e82('0x26')](_0x9e82('0x3e'),_0x12fbdb,_0x2dfaec,_0xd77772));};AGIChannel[_0x9e82('0x22')]['getVariable']=function(_0x42795d){return this[_0x9e82('0x20')](util[_0x9e82('0x26')]('GET\x20VARIABLE\x20\x22%s\x22',_0x42795d));};AGIChannel['prototype']['recordFile']=function(_0x1e10d1,_0x17df58,_0x1d50b4,_0x5eb390,_0x2e3b1f,_0x45ceba){_0x17df58=_0x17df58||_0x9e82('0x3f');_0x1d50b4=_0x1d50b4||'';_0x5eb390=_0x5eb390===undefined?-0x1:_0x5eb390==='-1'?-0x1:_0x5eb390*0x3e8;_0x2e3b1f=_0x2e3b1f===undefined?'':'s='+_0x2e3b1f;_0x45ceba=_0x45ceba?_0x9e82('0x40'):'';return this[_0x9e82('0x20')](util[_0x9e82('0x26')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x1e10d1,_0x17df58,_0x1d50b4,_0x5eb390,_0x45ceba,_0x2e3b1f));};AGIChannel[_0x9e82('0x22')]['streamFile']=function(_0x5c9b3e,_0x2be969){_0x2be969=_0x2be969||'';return this[_0x9e82('0x20')](util[_0x9e82('0x26')](_0x9e82('0x41'),_0x5c9b3e,_0x2be969));};AGIChannel[_0x9e82('0x22')][_0x9e82('0x42')]=function(_0x3780b0){return this[_0x9e82('0x29')]('AGI',_0x3780b0);};AGIChannel[_0x9e82('0x22')]['wait']=function(_0x26137e){return this[_0x9e82('0x29')](_0x9e82('0x43'),_0x26137e);};AGIChannel[_0x9e82('0x22')][_0x9e82('0x15')]=function(_0x38e58e,_0x3fc75f){this[_0x9e82('0x3d')](util[_0x9e82('0x26')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x38e58e['id'],_0x38e58e[_0x9e82('0x44')],_0x3fc75f));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x9e82('0x45')]=AGIChannel; \ No newline at end of file +var _0x9bfb=['WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','utf8','setEncoding','headers','ready','line','toLowerCase','emit','substring','function','no\x20code','replace','result=','substr','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','close','inherits','prototype','sendRequest','answer','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setExtension','setPriority','SET\x20PRIORITY\x20%s','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setContext','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x9bfb,0x1c0));var _0xb9bf=function(_0x51b51a,_0x2f156c){_0x51b51a=_0x51b51a-0x0;var _0x40bcd6=_0x9bfb[_0x51b51a];return _0x40bcd6;};'use strict';var util=require(_0xb9bf('0x0'));var _=require(_0xb9bf('0x1'));var EventEmitter=require(_0xb9bf('0x2'))[_0xb9bf('0x3')];var AGIReply=require(_0xb9bf('0x4'));var AGIError=require(_0xb9bf('0x5'));function AGIChannel(_0x3d9270){var _0x459e8f=this,_0x513b63=new AGIReply(),_0x1177ff=![],_0x5ccbe6={};EventEmitter['call'](_0x459e8f);_0x3d9270['setEncoding'](_0xb9bf('0x6'));_0x3d9270['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x513b63[_0xb9bf('0x7')](_0xb9bf('0x6'));_0x513b63['on'](_0xb9bf('0x8'),function(_0x1a7997){for(var _0x1fea5c in _0x1a7997){_0x459e8f[_0x1fea5c]=_0x1a7997[_0x1fea5c];}_0x459e8f['emit'](_0xb9bf('0x9'));});_0x513b63['on'](_0xb9bf('0xa'),function(_0x7627b8){if(_0x7627b8[_0xb9bf('0xb')]()=='hangup'){_0x459e8f[_0xb9bf('0xc')]('hangup');return;}if(_0x7627b8[_0xb9bf('0xd')](0x0,0xb)=='520-Invalid'){_0x1177ff=!![];}if(_0x1177ff){_0x5ccbe6['rx']+=_0x7627b8+'\x0a';if(_0x7627b8['search']('520\x20End\x20of\x20proper')!=-0x1){_0x1177ff=![];}}else{_0x5ccbe6['rx']=_0x7627b8;}if(_0x1177ff){return;}if(typeof _0x5ccbe6['cb']==_0xb9bf('0xe')){var _0x5de5fa=_0x5ccbe6['rx'][_0xb9bf('0xd')](0x0,0x3),_0x20b852=null,_0x450611=null;_0x5de5fa=parseInt(_0x5de5fa);if(isNaN(_0x5de5fa)){_0x5ccbe6['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xb9bf('0xf')});return;}if(_0x5de5fa!=0xc8){_0x5ccbe6['cb'](null,{'code':_0x5de5fa,'result':-0x1,'extra':'KO'});return;}_0x20b852=_0x5ccbe6['rx'][_0xb9bf('0xd')](0x4)[_0xb9bf('0x10')](_0xb9bf('0x11'),'');if(_0x20b852['indexOf']('\x20')!=-0x1){_0x20b852=_0x20b852[_0xb9bf('0x12')](0x0,_0x20b852[_0xb9bf('0x13')]('\x20'));}if(_[_0xb9bf('0x14')](_0x20b852,'-1')){_0x20b852=parseInt(_0x20b852);}_0x450611=_0x5ccbe6['rx']['split']('\x20');if(_0x450611['length']==0x3){_0x450611=_0x450611[0x2][_0xb9bf('0xd')](0x1,_0x450611[0x2][_0xb9bf('0x15')]-0x1);}else if(_0x450611[_0xb9bf('0x15')]>0x3){var _0x1e2f5a=/\((.+)\)/;var _0x55a7b=_0x5ccbe6['rx'][_0xb9bf('0x16')](_0x1e2f5a);if(_0x55a7b){_0x450611=_0x55a7b[0x1];}else{_0x450611=null;}}else{_0x450611=null;}_0x5ccbe6['cb'](null,{'code':_0x5de5fa,'result':_0x20b852,'extra':_0x450611});}});_0x3d9270['on'](_0xb9bf('0x17'),function(_0x375ff9){_0x459e8f[_0xb9bf('0xc')](_0xb9bf('0x17'),new AGIError(_0xb9bf('0x18'),_0x375ff9['code']));});_0x3d9270['on']('close',function(){_0x459e8f[_0xb9bf('0xc')]('close',new AGIError(_0xb9bf('0x19')));});_0x3d9270['on'](_0xb9bf('0x1a'),function(){_0x459e8f[_0xb9bf('0xc')](_0xb9bf('0x1a'),new AGIError(_0xb9bf('0x1b')));_0x3d9270[_0xb9bf('0x1c')]();});_0x3d9270[_0xb9bf('0x1d')](_0x513b63);this[_0xb9bf('0x1e')]=function(_0x4bf359,_0x1187c8){var _0x4bf359=_0x4bf359||'',_0x1187c8=typeof _0x1187c8==_0xb9bf('0xe')?_0x1187c8:new Function();_0x5ccbe6={'tx':_0x4bf359,'rx':'','cb':_0x1187c8};_0x3d9270[_0xb9bf('0x1f')](_0x4bf359+'\x0a');},this[_0xb9bf('0x20')]=function(){_0x3d9270['destroy']();};}util[_0xb9bf('0x21')](AGIChannel,EventEmitter);AGIChannel[_0xb9bf('0x22')][_0xb9bf('0x23')]=function(_0x54d005){return this['command']['sync'](this,_0x54d005);};AGIChannel[_0xb9bf('0x22')][_0xb9bf('0x24')]=function(){return this['sendRequest']('ANSWER');};AGIChannel['prototype'][_0xb9bf('0x25')]=function(_0x4b61f8,_0x512b27,_0xe08224){_0x4b61f8=_0x4b61f8===undefined?_0xb9bf('0x26'):_0x4b61f8;_0x512b27=_0x512b27===undefined?'5':_0x512b27;_0xe08224=_0xe08224===undefined?'1':_0xe08224;return this['sendRequest'](util[_0xb9bf('0x27')](_0xb9bf('0x28'),_0x4b61f8,_0x512b27*0x3e8,_0xe08224));};AGIChannel[_0xb9bf('0x22')][_0xb9bf('0x29')]=function(_0x536c30){_0x536c30=_0x536c30||_0xb9bf('0x2a');return this[_0xb9bf('0x23')](util[_0xb9bf('0x27')](_0xb9bf('0x2b'),_0x536c30));};AGIChannel['prototype'][_0xb9bf('0x2c')]=function(_0x374779,_0x4b5718){if(_[_0xb9bf('0x2d')](_0x4b5718)){return this[_0xb9bf('0x23')](util[_0xb9bf('0x27')](_0xb9bf('0x2e'),_0x374779,_0x4b5718[_0xb9bf('0x2f')](',')));}return this['sendRequest'](util[_0xb9bf('0x27')](_0xb9bf('0x2e'),_0x374779,_0x4b5718));};AGIChannel['prototype']['setContext']=function(_0x34bc24){return this[_0xb9bf('0x23')](util[_0xb9bf('0x27')]('SET\x20CONTEXT\x20%s',_0x34bc24));};AGIChannel[_0xb9bf('0x22')][_0xb9bf('0x30')]=function(_0x35aefb){return this[_0xb9bf('0x23')](util[_0xb9bf('0x27')]('SET\x20EXTENSION\x20%s',_0x35aefb));};AGIChannel[_0xb9bf('0x22')][_0xb9bf('0x31')]=function(_0x7be13c){return this[_0xb9bf('0x23')](util[_0xb9bf('0x27')](_0xb9bf('0x32'),_0x7be13c));};AGIChannel[_0xb9bf('0x22')]['hangup']=function(){return this[_0xb9bf('0x23')]('HANGUP');};AGIChannel[_0xb9bf('0x22')]['setVariable']=function(_0x123a99,_0x496db9){var _0x294b0e=_[_0xb9bf('0x33')](_0x496db9)||_['isNumber'](_0x496db9)?_0x496db9['toString']():_0x496db9;return this[_0xb9bf('0x23')](util[_0xb9bf('0x27')](_0xb9bf('0x34'),_0x123a99,_0x294b0e?_0x294b0e['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xb9bf('0x22')][_0xb9bf('0x35')]=function(_0x2eeee4,_0x5b3758){return this[_0xb9bf('0x23')](util[_0xb9bf('0x27')](_0xb9bf('0x36'),_0x2eeee4,_0x5b3758));};AGIChannel['prototype'][_0xb9bf('0x37')]=function(_0xd3ece6,_0x56c697){return this['sendRequest'](util['format'](_0xb9bf('0x38'),_0xd3ece6,_0x56c697));};AGIChannel['prototype'][_0xb9bf('0x39')]=function(_0x4de957,_0x42b1f0){return this[_0xb9bf('0x23')](util['format'](_0xb9bf('0x3a'),_0x4de957,_0x42b1f0));};AGIChannel[_0xb9bf('0x22')][_0xb9bf('0x3b')]=function(_0x254bbc,_0x3603f7,_0x5d5657){_0x3603f7=_0x3603f7||this['extension'];_0x5d5657=_0x5d5657||0x1;this[_0xb9bf('0x3c')](_0x254bbc);this['setExtension'](_0x3603f7);this[_0xb9bf('0x31')](_0x5d5657);return this[_0xb9bf('0x29')](util[_0xb9bf('0x27')](_0xb9bf('0x3d'),_0x254bbc,_0x3603f7,_0x5d5657));};AGIChannel[_0xb9bf('0x22')][_0xb9bf('0x3e')]=function(_0x40bc11){return this[_0xb9bf('0x23')](util[_0xb9bf('0x27')]('GET\x20VARIABLE\x20\x22%s\x22',_0x40bc11));};AGIChannel[_0xb9bf('0x22')][_0xb9bf('0x3f')]=function(_0x3e671a,_0x5034ad,_0x1d2dbe,_0x57790b,_0x4f0b10,_0x1c7fab){_0x5034ad=_0x5034ad||'wav';_0x1d2dbe=_0x1d2dbe||'';_0x57790b=_0x57790b===undefined?-0x1:_0x57790b==='-1'?-0x1:_0x57790b*0x3e8;_0x4f0b10=_0x4f0b10===undefined?'':'s='+_0x4f0b10;_0x1c7fab=_0x1c7fab?_0xb9bf('0x40'):'';return this[_0xb9bf('0x23')](util['format'](_0xb9bf('0x41'),_0x3e671a,_0x5034ad,_0x1d2dbe,_0x57790b,_0x1c7fab,_0x4f0b10));};AGIChannel[_0xb9bf('0x22')][_0xb9bf('0x42')]=function(_0x3b82b7,_0xec6cc1){_0xec6cc1=_0xec6cc1||'';return this['sendRequest'](util[_0xb9bf('0x27')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3b82b7,_0xec6cc1));};AGIChannel[_0xb9bf('0x22')][_0xb9bf('0x43')]=function(_0x97828b){return this[_0xb9bf('0x2c')](_0xb9bf('0x44'),_0x97828b);};AGIChannel['prototype'][_0xb9bf('0x45')]=function(_0x13610c){return this[_0xb9bf('0x2c')](_0xb9bf('0x46'),_0x13610c);};AGIChannel[_0xb9bf('0x22')][_0xb9bf('0x17')]=function(_0x3c41f2,_0x30895d){this[_0xb9bf('0x29')](util[_0xb9bf('0x27')](_0xb9bf('0x47'),_0x3c41f2['id'],_0x3c41f2[_0xb9bf('0x48')],_0x30895d));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xb9bf('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 31c5f42..7dfec7d 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 _0x263a=['Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','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\x20error.\x20Code:\x20%s.'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x263a,0xf8));var _0xa263=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x263a[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xa263('0x0'));var error={'E_AGI_UNDEFINED':_0xa263('0x1'),'E_AGI_ARGUMENT_PORT':_0xa263('0x2'),'E_AGI_SERVER_ERROR':_0xa263('0x3'),'E_AGI_SERVER_CLOSE':_0xa263('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xa263('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xa263('0x6'),'E_AGI_SOCKET_ERROR':_0xa263('0x7'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xa263('0x8'),'E_AGI_COMMAND_EMPTY':_0xa263('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xa263('0xa')};function AGIError(_0x4d501b){var _0x4d501b=_0x4d501b||null,_0x10fce8=_0x10fce8||[],_0x3dfcae=0x1,_0x1cc299='';if(!error[_0x4d501b]){_0x4d501b=_0xa263('0xb');}_0x10fce8['push'](error[_0x4d501b]);while(arguments[_0x3dfcae]){_0x10fce8[_0xa263('0xc')](arguments[_0x3dfcae]);_0x3dfcae++;}_0x1cc299=util[_0xa263('0xd')]['apply'](util,_0x10fce8);this['message']=_0x1cc299;this[_0xa263('0xe')]=_0x4d501b;}module[_0xa263('0xf')]=AGIError; \ No newline at end of file +var _0xf921=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','name','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.'];(function(_0x2e26db,_0x135c35){var _0x283797=function(_0x5cc917){while(--_0x5cc917){_0x2e26db['push'](_0x2e26db['shift']());}};_0x283797(++_0x135c35);}(_0xf921,0x17c));var _0x1f92=function(_0x4c0ebb,_0x1e7eae){_0x4c0ebb=_0x4c0ebb-0x0;var _0xfc4dc1=_0xf921[_0x4c0ebb];return _0xfc4dc1;};'use strict';var util=require(_0x1f92('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x1f92('0x1'),'E_AGI_SERVER_ERROR':_0x1f92('0x2'),'E_AGI_SERVER_CLOSE':_0x1f92('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x1f92('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x1f92('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x1f92('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x1f92('0x7'),'E_AGI_COMMAND_EMPTY':_0x1f92('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x1f92('0x9'),'E_AGI_IVR_ENTRY':_0x1f92('0xa')};function AGIError(_0x4a4cbe){var _0x4a4cbe=_0x4a4cbe||null,_0x391bf5=_0x391bf5||[],_0x48c3c6=0x1,_0x222fe7='';if(!error[_0x4a4cbe]){_0x4a4cbe=_0x1f92('0xb');}_0x391bf5[_0x1f92('0xc')](error[_0x4a4cbe]);while(arguments[_0x48c3c6]){_0x391bf5[_0x1f92('0xc')](arguments[_0x48c3c6]);_0x48c3c6++;}_0x222fe7=util[_0x1f92('0xd')]['apply'](util,_0x391bf5);this['message']=_0x222fe7;this[_0x1f92('0xe')]=_0x4a4cbe;}module[_0x1f92('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index a6431cc..0f537fd 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 _0x51af=['getVertex','info','stop\x20traverse','length','condition','split','agicommand','vswitch','default','target','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','size','relations'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0x51af,0x1c2));var _0xf51a=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x51af[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0xf51a('0x0'));var logger=require(_0xf51a('0x1'))(_0xf51a('0x2'));var verticesWithRetry=[_0xf51a('0x3'),_0xf51a('0x4'),_0xf51a('0x5')];var Graph=function(){this[_0xf51a('0x6')]={};this[_0xf51a('0x7')]={};this[_0xf51a('0x8')]=0x0;};Graph[_0xf51a('0x9')][_0xf51a('0xa')]=function(_0x38b165){this[_0xf51a('0x6')][_0x38b165['id']]=_0x38b165;this[_0xf51a('0x7')][_0x38b165['id']]=[];};Graph[_0xf51a('0x9')][_0xf51a('0xb')]=function(_0x5b5f19,_0x5a01e2,_0x1014d2){this[_0xf51a('0x7')][_0x5b5f19]['push']({'target':_0x5a01e2,'condition':_0x1014d2});this['numberOfEdges']+=0x1;};Graph[_0xf51a('0x9')][_0xf51a('0xc')]=function(){return _['size'](this[_0xf51a('0x6')]);};Graph[_0xf51a('0x9')][_0xf51a('0xd')]=function(){return this[_0xf51a('0x8')];};Graph['prototype'][_0xf51a('0xe')]=function(_0x38cf87){return this[_0xf51a('0x6')][_0x38cf87];};Graph[_0xf51a('0x9')]['traverseBFS']=function(_0x3f0311,_0x244126){if(!this[_0xf51a('0x6')][_0x3f0311]){return logger['info']('no\x20vertex\x20found');}var _0x1d4c7c=_0x244126(this['vertices'][_0x3f0311]);if(!_0x1d4c7c){return logger[_0xf51a('0xf')](_0xf51a('0x10'));}if(this['edges'][_0x3f0311][_0xf51a('0x11')]===0x0){return logger['info']('no\x20edge/s\x20available');}for(var _0x28b8f2=0x0,_0x203e99=[],_0x2c2c02=![];_0x28b8f2\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','sync','production','start','debug','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','isUndefined','result','toString','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','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','close','Project\x20%s\x20not\x20published','continueAt','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED'];(function(_0x5e4036,_0x3bef02){var _0x565e72=function(_0x20f1a2){while(--_0x20f1a2){_0x5e4036['push'](_0x5e4036['shift']());}};_0x565e72(++_0x3bef02);}(_0x133a,0xbe));var _0xa133=function(_0xfe08bf,_0x2aab40){_0xfe08bf=_0xfe08bf-0x0;var _0x44b8ca=_0x133a[_0xfe08bf];return _0x44b8ca;};'use strict';var parser=require(_0xa133('0x0'));var _=require(_0xa133('0x1'));var syncho=require(_0xa133('0x2'));var util=require(_0xa133('0x3'));var moment=require(_0xa133('0x4'));var config=require(_0xa133('0x5'));var logger=require(_0xa133('0x6'))('agi');var utilLicense=require(_0xa133('0x7'));var rpc=require(_0xa133('0x8'));var mailRpc=require(_0xa133('0x9'));var Graph=require(_0xa133('0xa'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xa133('0xb')]=_[_0xa133('0xc')](config[_0xa133('0xb')],{'ip':_0xa133('0xd'),'port':0x11dd});function connectionHandler(_0x58a610){process[_0xa133('0xe')](function(){syncho(function(){try{setChannelVariables(_0x58a610);agiHandler(_0x58a610);}catch(_0x258bd3){logger[_0xa133('0xf')](_0x258bd3[_0xa133('0x10')]);}});});}function listeningHandler(){console[_0xa133('0x11')](_0xa133('0x12'),config[_0xa133('0xb')][_0xa133('0x13')]);logger[_0xa133('0x14')](util[_0xa133('0x15')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xa133('0xb')]['ip'],config[_0xa133('0xb')][_0xa133('0x13')]));}function errorHandler(_0x2e5dd3){if(_0x2e5dd3&&_0x2e5dd3['name']&&_0x2e5dd3[_0xa133('0x16')]){logger[_0xa133('0xf')](util[_0xa133('0x15')]('[%s]\x20%s',_0x2e5dd3[_0xa133('0x17')],_0x2e5dd3['message']));}else{logger['error'](util['format'](_0xa133('0x18'),_0x2e5dd3[_0xa133('0x10')]));}}function closeHandler(){logger[_0xa133('0x14')](util['format'](_0xa133('0x19'),this[_0xa133('0x1a')],this[_0xa133('0x1b')],this[_0xa133('0x1c')],this[_0xa133('0x1d')],this[_0xa133('0x1e')]));try{createSquareReport(this);}catch(_0x3080d2){logger[_0xa133('0xf')](_0x3080d2[_0xa133('0x10')]);}}function timeoutHandler(){logger[_0xa133('0x14')](util['format'](_0xa133('0x1f'),this['arg_1'],this[_0xa133('0x1b')],this[_0xa133('0x1c')],this[_0xa133('0x1d')],this[_0xa133('0x1e')]));}function hangupHandler(){logger[_0xa133('0x14')](util[_0xa133('0x15')](_0xa133('0x20'),this['arg_1'],this['calleridname'],this[_0xa133('0x1c')],this[_0xa133('0x1d')],this['uniqueid']));this[_0xa133('0x21')]=!![];}function getRoot(_0x2dc851){return parser['toJson'](_0x2dc851,{'object':!![]})['mxGraphModel'][_0xa133('0x22')];}function addVertex(_0x3873e8,_0x1d0c5b,_0x1820e3){_0x1d0c5b[_0xa133('0x23')]=_0x1820e3;if(_0x1d0c5b[_0xa133('0x24')](_0xa133('0x25'))){_0x1d0c5b['maxRetry']=parseInt(_0x1d0c5b[_0xa133('0x25')],0xa);}_0x3873e8[_0xa133('0x26')](_[_0xa133('0x27')](_0x1d0c5b,_0xa133('0x28')));}function initGraph(_0x411c85,_0x3f4a46){var _0x510ca2=new Graph();for(var _0x5dd15b in _0x411c85){if(_0x411c85[_0xa133('0x24')](_0x5dd15b)){if(_[_0xa133('0x29')](_0x411c85[_0x5dd15b])){for(var _0x49cbb1=0x0;_0x49cbb1<_0x411c85[_0x5dd15b][_0xa133('0x2a')];_0x49cbb1+=0x1){addVertex(_0x510ca2,_0x411c85[_0x5dd15b][_0x49cbb1],_0x5dd15b);}}else{addVertex(_0x510ca2,_0x411c85[_0x5dd15b],_0x5dd15b);}}}for(var _0x311dfa=0x0;_0x311dfa<_0x3f4a46[_0xa133('0x2a')];_0x311dfa+=0x1){if(_0x3f4a46[_0x311dfa][_0xa133('0x2b')]&&_0x3f4a46[_0x311dfa][_0xa133('0x2c')]){_0x510ca2[_0xa133('0x2d')](_0x3f4a46[_0x311dfa][_0xa133('0x2b')],_0x3f4a46[_0x311dfa][_0xa133('0x2c')],_0x3f4a46[_0x311dfa]['value']);}}return _0x510ca2;}function getSquareProject(_0x429683,_0x4a71cb){rpc[_0xa133('0x2e')](_0x429683)[_0xa133('0x2f')](function(_0x3bf1c9){_0x4a71cb(null,_0x3bf1c9);})[_0xa133('0x30')](function(_0x411faf){_0x4a71cb(null,_0x411faf);});}function createSquareReport(_0x6f23f3,_0x363202){rpc[_0xa133('0x31')](_0x6f23f3)[_0xa133('0x2f')](function(_0x1ae36d){if(_0x363202){_0x363202(null,_0x1ae36d);}})[_0xa133('0x30')](function(_0x18f8e4){if(_0x363202){_0x363202(null,_0x18f8e4);}});}function setChannelVariables(_0x3ac099){for(var _0x7ffd39 in _0x3ac099){if(_0x3ac099[_0xa133('0x24')](_0x7ffd39)){if(_0x7ffd39[_0xa133('0x32')](_0xa133('0x33'))===0x0){_0x3ac099[_0x7ffd39[_0xa133('0x34')](0x4)]=_0x3ac099[_0x7ffd39];delete _0x3ac099[_0x7ffd39];}}}}function getLogFromObject(_0xca1c66){return util[_0xa133('0x35')](_0xca1c66,{'showHidden':![],'depth':null});}function agiHandler(_0x5b70f6){var _0x18dd5c,_0x30c62c,_0x546d1f,_0xa5b9a8,_0x3bd450;logger['debug'](_0xa133('0x36'),JSON[_0xa133('0x37')](_0x5b70f6,null,0x2));logger[_0xa133('0x14')](util['format'](_0xa133('0x38'),_0x5b70f6['arg_1'],_0x5b70f6[_0xa133('0x1b')],_0x5b70f6['callerid'],_0x5b70f6[_0xa133('0x1d')],_0x5b70f6[_0xa133('0x1e')]));_0x5b70f6['on'](_0xa133('0xf'),errorHandler);_0x5b70f6['on']('close',closeHandler);_0x5b70f6['on'](_0xa133('0x39'),timeoutHandler);_0x5b70f6[_0xa133('0x21')]=![];_0x5b70f6['on'](_0xa133('0x3a'),hangupHandler);var _0x5a3b0c=getSquareProject[_0xa133('0x3b')](null,_0x5b70f6['arg_1']);if(_0x5a3b0c){if(_0x5a3b0c['production']){_0x18dd5c=getRoot(_0x5a3b0c[_0xa133('0x3c')]);if(_0x18dd5c&&_0x18dd5c[_0xa133('0x3d')]){logger[_0xa133('0x3e')](_0xa133('0x22'),JSON[_0xa133('0x37')](_0x18dd5c,null,0x2));_0x5b70f6[_0xa133('0x3f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x30c62c=initGraph(_['omit'](_0x18dd5c,_0xa133('0x28')),_0x18dd5c[_0xa133('0x28')]);_0x546d1f=new Vertices(_0x5b70f6,rpc,mailRpc);logger[_0xa133('0x14')](util[_0xa133('0x15')](_0xa133('0x40'),_0x5b70f6['arg_1'],_0x5b70f6[_0xa133('0x1b')],_0x5b70f6[_0xa133('0x1c')],_0x5b70f6[_0xa133('0x1d')],_0x5b70f6['uniqueid']));_0x30c62c[_0xa133('0x41')](_0x18dd5c[_0xa133('0x3d')]['id'],function(_0x26feca){try{_0x26feca=_0x546d1f['clear'](_0x26feca);logger[_0xa133('0x3e')](_0xa133('0x42'),JSON[_0xa133('0x37')](_0x26feca,null,0x2));if(_0x26feca['agicommand']===_0xa133('0x43')){logger[_0xa133('0x14')](_0xa133('0x44'));_0x5b70f6[_0xa133('0x45')]=_0x26feca[_0xa133('0x45')]||_0x5b70f6[_0xa133('0x45')];_0x5b70f6[_0xa133('0x46')]=_0x26feca[_0xa133('0x46')];_0x5b70f6[_0xa133('0x47')]=_0x26feca[_0xa133('0x47')]?_0x26feca[_0xa133('0x47')]-0x1:0x1;return null;}else if(_0x26feca&&_0x546d1f[_0x26feca[_0xa133('0x23')]]){_0x3bd450=_0x546d1f[_0x26feca[_0xa133('0x23')]](_0x26feca);logger[_0xa133('0x14')](_0xa133('0x48'),JSON[_0xa133('0x37')](_0x3bd450,null,0x2));if(_0x3bd450&&_0x3bd450['code']===AGI_CODE_SUCCESS&&_0x3bd450['result']!==AGI_RESULT_ERROR&&!_0x5b70f6['evtHangup']){logger[_0xa133('0x3e')]('response',getLogFromObject(_0x3bd450));return _[_0xa133('0x49')](_0x3bd450[_0xa133('0x4a')])?null:_0x3bd450[_0xa133('0x4a')][_0xa133('0x4b')]();}else{logger['error'](_0xa133('0x48'),getLogFromObject(_0x3bd450));return null;}}else{logger[_0xa133('0xf')]('agicommand\x20not\x20found');return null;}}catch(_0x2d9d9e){logger['error'](_0x2d9d9e['stack']);return null;}});if(_0x18dd5c['finally']){logger[_0xa133('0x14')](util[_0xa133('0x15')](_0xa133('0x4c'),_0x5b70f6['arg_1'],_0x5b70f6[_0xa133('0x1b')],_0x5b70f6['callerid'],_0x5b70f6[_0xa133('0x1d')],_0x5b70f6['uniqueid']));_0x30c62c[_0xa133('0x41')](_0x18dd5c[_0xa133('0x4d')]['id'],function(_0x23bc5c){try{_0x23bc5c=_0x546d1f['clear'](_0x23bc5c);logger['debug'](_0xa133('0x42'),JSON[_0xa133('0x37')](_0x23bc5c,null,0x2));if(_0x23bc5c&&_0x546d1f[_0x23bc5c[_0xa133('0x23')]]){_0x3bd450=_0x546d1f[_0x23bc5c['agicommand']](_0x23bc5c);if(_0x3bd450){logger['debug'](_0xa133('0x48'),getLogFromObject(_0x3bd450));return _[_0xa133('0x49')](_0x3bd450[_0xa133('0x4a')])?null:_0x3bd450[_0xa133('0x4a')][_0xa133('0x4b')]();}else{logger[_0xa133('0xf')](_0xa133('0x48'),getLogFromObject(_0x3bd450));return null;}}else{logger[_0xa133('0xf')](_0xa133('0x4e'));return null;}}catch(_0x67728e){logger[_0xa133('0xf')](_0x67728e[_0xa133('0x10')]);return null;}});}logger[_0xa133('0x14')](util['format'](_0xa133('0x4f'),_0x5b70f6['arg_1'],_0x5b70f6[_0xa133('0x1b')],_0x5b70f6[_0xa133('0x1c')],_0x5b70f6[_0xa133('0x1d')],_0x5b70f6[_0xa133('0x1e')]));logger['info'](util[_0xa133('0x15')](_0xa133('0x50'),_0x5b70f6[_0xa133('0x45')],_0x5b70f6[_0xa133('0x46')],parseInt(_0x5b70f6[_0xa133('0x47')],0xa)+0x1));_0x5b70f6['continueAt'](_0x5b70f6[_0xa133('0x45')],_0x5b70f6[_0xa133('0x46')],parseInt(_0x5b70f6['priority'],0xa)+0x1);_0x5b70f6[_0xa133('0x51')]();}}else{logger[_0xa133('0xf')](util['format'](_0xa133('0x52'),_0x5b70f6[_0xa133('0x1a')]));_0x5b70f6[_0xa133('0x53')](_0x5b70f6['context'],_0x5b70f6[_0xa133('0x46')],parseInt(_0x5b70f6[_0xa133('0x47')],0xa)+0x1);_0x5b70f6[_0xa133('0x51')]();}}else{logger['error'](util['format']('Project\x20%s\x20not\x20found',_0x5b70f6['arg_1']));_0x5b70f6[_0xa133('0x53')](_0x5b70f6[_0xa133('0x45')],_0x5b70f6[_0xa133('0x46')],parseInt(_0x5b70f6[_0xa133('0x47')],0xa)+0x1);_0x5b70f6['close']();}}function main(){var _0x252b65;return utilLicense[_0xa133('0x54')]()[_0xa133('0x2f')](function(_0x1033ca){if(_0x1033ca){if(_0x1033ca['voice']){if(_0x1033ca['callysquare']&&_0x1033ca[_0xa133('0x55')]>0x0){logger[_0xa133('0x14')](util['format'](_0xa133('0x56'),_0x1033ca[_0xa133('0x55')]));_0x252b65=_0x1033ca[_0xa133('0x55')];}else{logger[_0xa133('0x14')](_0xa133('0x57'));}}else{logger[_0xa133('0x14')](_0xa133('0x58'));_0x252b65=-0x1;}}})[_0xa133('0x30')](function(_0x2f8a64){logger[_0xa133('0xf')](_0xa133('0x59'),_0x2f8a64['stack']);})[_0xa133('0x4d')](function(){var _0x256018=require(_0xa133('0x5a'))(config[_0xa133('0xb')][_0xa133('0x13')],config['agi']['ip'],_0x252b65);_0x256018['on'](_0xa133('0xf'),errorHandler);_0x256018['on'](_0xa133('0x5b'),listeningHandler);_0x256018['on'](_0xa133('0x5c'),connectionHandler);_0x256018['on'](_0xa133('0x51'),closeHandler);});}main(); \ No newline at end of file +var _0xad6b=['evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','catch','indexOf','agi_','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','clear','vertex','gotoc','context','extension','priority','response','result','agicommand\x20not\x20found','traverseBFS','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','util','../../config/logger','../../config/license/util','./rpc','./mailRpc','./vertices','defaults','agi','127.0.0.1','nextTick','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','message','format','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','uniqueid','[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'];(function(_0xe9c368,_0x49da9f){var _0x1b11da=function(_0x49f6f2){while(--_0x49f6f2){_0xe9c368['push'](_0xe9c368['shift']());}};_0x1b11da(++_0x49da9f);}(_0xad6b,0x1e5));var _0xbad6=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xad6b[_0x45783c];return _0x1161da;};'use strict';var parser=require(_0xbad6('0x0'));var _=require('lodash');var syncho=require(_0xbad6('0x1'));var util=require(_0xbad6('0x2'));var moment=require('moment');var config=require('../../config/environment');var logger=require(_0xbad6('0x3'))('agi');var utilLicense=require(_0xbad6('0x4'));var rpc=require(_0xbad6('0x5'));var mailRpc=require(_0xbad6('0x6'));var Graph=require('./graph');var Vertices=require(_0xbad6('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xbad6('0x8')](config[_0xbad6('0x9')],{'ip':_0xbad6('0xa'),'port':0x11dd});function connectionHandler(_0x4a37e2){process[_0xbad6('0xb')](function(){syncho(function(){try{setChannelVariables(_0x4a37e2);agiHandler(_0x4a37e2);}catch(_0x454ea3){logger[_0xbad6('0xc')](_0x454ea3['stack']);}});});}function listeningHandler(){console[_0xbad6('0xd')](_0xbad6('0xe'),config[_0xbad6('0x9')]['port']);logger[_0xbad6('0xf')](util['format'](_0xbad6('0x10'),config[_0xbad6('0x9')]['ip'],config['agi']['port']));}function errorHandler(_0x5e9aa3){if(_0x5e9aa3&&_0x5e9aa3[_0xbad6('0x11')]&&_0x5e9aa3['message']){logger[_0xbad6('0xc')](util['format'](_0xbad6('0x12'),_0x5e9aa3[_0xbad6('0x11')],_0x5e9aa3[_0xbad6('0x13')]));}else{logger[_0xbad6('0xc')](util[_0xbad6('0x14')](_0xbad6('0x15'),_0x5e9aa3[_0xbad6('0x16')]));}}function closeHandler(){logger[_0xbad6('0xf')](util[_0xbad6('0x14')](_0xbad6('0x17'),this['arg_1'],this[_0xbad6('0x18')],this[_0xbad6('0x19')],this['dnid'],this[_0xbad6('0x1a')]));try{createSquareReport(this);}catch(_0x43fd8e){logger[_0xbad6('0xc')](_0x43fd8e[_0xbad6('0x16')]);}}function timeoutHandler(){logger['info'](util[_0xbad6('0x14')](_0xbad6('0x1b'),this[_0xbad6('0x1c')],this[_0xbad6('0x18')],this[_0xbad6('0x19')],this[_0xbad6('0x1d')],this['uniqueid']));}function hangupHandler(){logger['info'](util['format'](_0xbad6('0x1e'),this['arg_1'],this['calleridname'],this[_0xbad6('0x19')],this['dnid'],this[_0xbad6('0x1a')]));this[_0xbad6('0x1f')]=!![];}function getRoot(_0x2751e9){return parser[_0xbad6('0x20')](_0x2751e9,{'object':!![]})[_0xbad6('0x21')][_0xbad6('0x22')];}function addVertex(_0x51a66e,_0x157e88,_0x335f91){_0x157e88[_0xbad6('0x23')]=_0x335f91;if(_0x157e88[_0xbad6('0x24')]('retry')){_0x157e88[_0xbad6('0x25')]=parseInt(_0x157e88[_0xbad6('0x26')],0xa);}_0x51a66e[_0xbad6('0x27')](_[_0xbad6('0x28')](_0x157e88,_0xbad6('0x29')));}function initGraph(_0x661567,_0x18e5a2){var _0x10bdb0=new Graph();for(var _0x470e34 in _0x661567){if(_0x661567[_0xbad6('0x24')](_0x470e34)){if(_[_0xbad6('0x2a')](_0x661567[_0x470e34])){for(var _0x2eb9b2=0x0;_0x2eb9b2<_0x661567[_0x470e34][_0xbad6('0x2b')];_0x2eb9b2+=0x1){addVertex(_0x10bdb0,_0x661567[_0x470e34][_0x2eb9b2],_0x470e34);}}else{addVertex(_0x10bdb0,_0x661567[_0x470e34],_0x470e34);}}}for(var _0x418af8=0x0;_0x418af8<_0x18e5a2[_0xbad6('0x2b')];_0x418af8+=0x1){if(_0x18e5a2[_0x418af8][_0xbad6('0x2c')]&&_0x18e5a2[_0x418af8][_0xbad6('0x2d')]){_0x10bdb0[_0xbad6('0x2e')](_0x18e5a2[_0x418af8]['source'],_0x18e5a2[_0x418af8][_0xbad6('0x2d')],_0x18e5a2[_0x418af8][_0xbad6('0x2f')]);}}return _0x10bdb0;}function getSquareProject(_0x590cf1,_0x370e3a){rpc[_0xbad6('0x30')](_0x590cf1)['then'](function(_0x40a3eb){_0x370e3a(null,_0x40a3eb);})[_0xbad6('0x31')](function(_0x452ce4){_0x370e3a(null,_0x452ce4);});}function createSquareReport(_0x49e15a,_0x48b9bb){rpc['createSquareReport'](_0x49e15a)['then'](function(_0x55aaf3){if(_0x48b9bb){_0x48b9bb(null,_0x55aaf3);}})[_0xbad6('0x31')](function(_0x95d130){if(_0x48b9bb){_0x48b9bb(null,_0x95d130);}});}function setChannelVariables(_0x46b06d){for(var _0x51a87c in _0x46b06d){if(_0x46b06d[_0xbad6('0x24')](_0x51a87c)){if(_0x51a87c[_0xbad6('0x32')](_0xbad6('0x33'))===0x0){_0x46b06d[_0x51a87c['substring'](0x4)]=_0x46b06d[_0x51a87c];delete _0x46b06d[_0x51a87c];}}}}function getLogFromObject(_0x1afef0){return util['inspect'](_0x1afef0,{'showHidden':![],'depth':null});}function agiHandler(_0x3e03f7){var _0x1de19c,_0x3e40b4,_0x53cf2e,_0x5f02b5,_0x59766a;logger[_0xbad6('0x34')](_0xbad6('0x35'),JSON[_0xbad6('0x36')](_0x3e03f7,null,0x2));logger[_0xbad6('0xf')](util[_0xbad6('0x14')](_0xbad6('0x37'),_0x3e03f7[_0xbad6('0x1c')],_0x3e03f7['calleridname'],_0x3e03f7[_0xbad6('0x19')],_0x3e03f7[_0xbad6('0x1d')],_0x3e03f7[_0xbad6('0x1a')]));_0x3e03f7['on'](_0xbad6('0xc'),errorHandler);_0x3e03f7['on'](_0xbad6('0x38'),closeHandler);_0x3e03f7['on']('timeout',timeoutHandler);_0x3e03f7[_0xbad6('0x1f')]=![];_0x3e03f7['on'](_0xbad6('0x39'),hangupHandler);var _0x2178fc=getSquareProject['sync'](null,_0x3e03f7[_0xbad6('0x1c')]);if(_0x2178fc){if(_0x2178fc[_0xbad6('0x3a')]){_0x1de19c=getRoot(_0x2178fc[_0xbad6('0x3a')]);if(_0x1de19c&&_0x1de19c[_0xbad6('0x3b')]){logger['debug'](_0xbad6('0x22'),JSON['stringify'](_0x1de19c,null,0x2));_0x3e03f7[_0xbad6('0x3c')]=moment()[_0xbad6('0x14')](_0xbad6('0x3d'));_0x3e40b4=initGraph(_[_0xbad6('0x28')](_0x1de19c,_0xbad6('0x29')),_0x1de19c[_0xbad6('0x29')]);_0x53cf2e=new Vertices(_0x3e03f7,rpc,mailRpc);logger[_0xbad6('0xf')](util[_0xbad6('0x14')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3e03f7[_0xbad6('0x1c')],_0x3e03f7[_0xbad6('0x18')],_0x3e03f7['callerid'],_0x3e03f7['dnid'],_0x3e03f7[_0xbad6('0x1a')]));_0x3e40b4['traverseBFS'](_0x1de19c['start']['id'],function(_0x41997b){try{_0x41997b=_0x53cf2e[_0xbad6('0x3e')](_0x41997b);logger[_0xbad6('0x34')](_0xbad6('0x3f'),JSON[_0xbad6('0x36')](_0x41997b,null,0x2));if(_0x41997b[_0xbad6('0x23')]===_0xbad6('0x40')){logger[_0xbad6('0xf')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x3e03f7[_0xbad6('0x41')]=_0x41997b[_0xbad6('0x41')]||_0x3e03f7['context'];_0x3e03f7['extension']=_0x41997b[_0xbad6('0x42')];_0x3e03f7[_0xbad6('0x43')]=_0x41997b['priority']?_0x41997b[_0xbad6('0x43')]-0x1:0x1;return null;}else if(_0x41997b&&_0x53cf2e[_0x41997b[_0xbad6('0x23')]]){_0x59766a=_0x53cf2e[_0x41997b[_0xbad6('0x23')]](_0x41997b);logger[_0xbad6('0xf')](_0xbad6('0x44'),JSON['stringify'](_0x59766a,null,0x2));if(_0x59766a&&_0x59766a['code']===AGI_CODE_SUCCESS&&_0x59766a[_0xbad6('0x45')]!==AGI_RESULT_ERROR&&!_0x3e03f7[_0xbad6('0x1f')]){logger[_0xbad6('0x34')](_0xbad6('0x44'),getLogFromObject(_0x59766a));return _['isUndefined'](_0x59766a[_0xbad6('0x45')])?null:_0x59766a[_0xbad6('0x45')]['toString']();}else{logger[_0xbad6('0xc')](_0xbad6('0x44'),getLogFromObject(_0x59766a));return null;}}else{logger[_0xbad6('0xc')](_0xbad6('0x46'));return null;}}catch(_0x35dc5a){logger[_0xbad6('0xc')](_0x35dc5a[_0xbad6('0x16')]);return null;}});if(_0x1de19c['finally']){logger[_0xbad6('0xf')](util[_0xbad6('0x14')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3e03f7[_0xbad6('0x1c')],_0x3e03f7[_0xbad6('0x18')],_0x3e03f7['callerid'],_0x3e03f7[_0xbad6('0x1d')],_0x3e03f7['uniqueid']));_0x3e40b4[_0xbad6('0x47')](_0x1de19c[_0xbad6('0x48')]['id'],function(_0x4f5f15){try{_0x4f5f15=_0x53cf2e[_0xbad6('0x3e')](_0x4f5f15);logger[_0xbad6('0x34')](_0xbad6('0x3f'),JSON['stringify'](_0x4f5f15,null,0x2));if(_0x4f5f15&&_0x53cf2e[_0x4f5f15[_0xbad6('0x23')]]){_0x59766a=_0x53cf2e[_0x4f5f15[_0xbad6('0x23')]](_0x4f5f15);if(_0x59766a){logger['debug'](_0xbad6('0x44'),getLogFromObject(_0x59766a));return _['isUndefined'](_0x59766a[_0xbad6('0x45')])?null:_0x59766a[_0xbad6('0x45')]['toString']();}else{logger['error'](_0xbad6('0x44'),getLogFromObject(_0x59766a));return null;}}else{logger['error'](_0xbad6('0x46'));return null;}}catch(_0x24854d){logger[_0xbad6('0xc')](_0x24854d[_0xbad6('0x16')]);return null;}});}logger['info'](util[_0xbad6('0x14')](_0xbad6('0x49'),_0x3e03f7[_0xbad6('0x1c')],_0x3e03f7[_0xbad6('0x18')],_0x3e03f7[_0xbad6('0x19')],_0x3e03f7[_0xbad6('0x1d')],_0x3e03f7[_0xbad6('0x1a')]));logger[_0xbad6('0xf')](util[_0xbad6('0x14')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x3e03f7[_0xbad6('0x41')],_0x3e03f7[_0xbad6('0x42')],parseInt(_0x3e03f7[_0xbad6('0x43')],0xa)+0x1));_0x3e03f7[_0xbad6('0x4a')](_0x3e03f7[_0xbad6('0x41')],_0x3e03f7[_0xbad6('0x42')],parseInt(_0x3e03f7[_0xbad6('0x43')],0xa)+0x1);_0x3e03f7[_0xbad6('0x38')]();}}else{logger['error'](util['format'](_0xbad6('0x4b'),_0x3e03f7['arg_1']));_0x3e03f7['continueAt'](_0x3e03f7['context'],_0x3e03f7[_0xbad6('0x42')],parseInt(_0x3e03f7[_0xbad6('0x43')],0xa)+0x1);_0x3e03f7[_0xbad6('0x38')]();}}else{logger['error'](util[_0xbad6('0x14')]('Project\x20%s\x20not\x20found',_0x3e03f7[_0xbad6('0x1c')]));_0x3e03f7[_0xbad6('0x4a')](_0x3e03f7['context'],_0x3e03f7[_0xbad6('0x42')],parseInt(_0x3e03f7['priority'],0xa)+0x1);_0x3e03f7[_0xbad6('0x38')]();}}function main(){var _0x3fa418;return utilLicense['getLicense']()[_0xbad6('0x4c')](function(_0x56eefe){if(_0x56eefe){if(_0x56eefe[_0xbad6('0x4d')]){if(_0x56eefe[_0xbad6('0x4e')]&&_0x56eefe[_0xbad6('0x4e')]>0x0){logger['info'](util[_0xbad6('0x14')](_0xbad6('0x4f'),_0x56eefe['callysquare']));_0x3fa418=_0x56eefe[_0xbad6('0x4e')];}else{logger[_0xbad6('0xf')](_0xbad6('0x50'));}}else{logger[_0xbad6('0xf')](_0xbad6('0x51'));_0x3fa418=-0x1;}}})['catch'](function(_0x545b16){logger['error'](_0xbad6('0x52'),_0x545b16['stack']);})[_0xbad6('0x48')](function(){var _0x8922c3=require(_0xbad6('0x53'))(config[_0xbad6('0x9')]['port'],config['agi']['ip'],_0x3fa418);_0x8922c3['on'](_0xbad6('0xc'),errorHandler);_0x8922c3['on'](_0xbad6('0x54'),listeningHandler);_0x8922c3['on'](_0xbad6('0x55'),connectionHandler);_0x8922c3['on'](_0xbad6('0x38'),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 fb00fd1..8f51e24 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 _0x0c68=['message','result','catch','SendMail','bluebird','client','http'];(function(_0x29f730,_0x23d7ed){var _0x189806=function(_0x2838a7){while(--_0x2838a7){_0x29f730['push'](_0x29f730['shift']());}};_0x189806(++_0x23d7ed);}(_0x0c68,0x162));var _0x80c6=function(_0x2ed0aa,_0x34020f){_0x2ed0aa=_0x2ed0aa-0x0;var _0x57006b=_0x0c68[_0x2ed0aa];return _0x57006b;};'use strict';var BPromise=require(_0x80c6('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x80c6('0x1')][_0x80c6('0x2')]({'port':0x232b});function request(_0x336c61,_0x351f22){return new BPromise(function(_0x5a1b7f,_0xd26205){return client['request'](_0x336c61,_0x351f22)['then'](function(_0x35d5bd){if(_0x35d5bd['error']){return _0xd26205(_0x35d5bd['error'][_0x80c6('0x3')]);}else{return _0x5a1b7f(_0x35d5bd[_0x80c6('0x4')]);}})[_0x80c6('0x5')](function(_0x25bb88){return _0xd26205(_0x25bb88);});});}exports['sendMailMessage']=function(_0x14f6f1,_0x7159b8){return request(_0x80c6('0x6'),{'account':_0x14f6f1,'message':_0x7159b8});}; \ No newline at end of file +var _0x1223=['request','then','error','message','result','catch','SendMail','bluebird','jayson/promise','client','http'];(function(_0x29b046,_0x3d830f){var _0x204735=function(_0x50defb){while(--_0x50defb){_0x29b046['push'](_0x29b046['shift']());}};_0x204735(++_0x3d830f);}(_0x1223,0x8b));var _0x3122=function(_0xbe0bad,_0x242e22){_0xbe0bad=_0xbe0bad-0x0;var _0x2a18cc=_0x1223[_0xbe0bad];return _0x2a18cc;};'use strict';var BPromise=require(_0x3122('0x0'));var jayson=require(_0x3122('0x1'));var client=jayson[_0x3122('0x2')][_0x3122('0x3')]({'port':0x232b});function request(_0x3fd07b,_0x8da32e){return new BPromise(function(_0x1ee655,_0x26143a){return client[_0x3122('0x4')](_0x3fd07b,_0x8da32e)[_0x3122('0x5')](function(_0xece495){if(_0xece495['error']){return _0x26143a(_0xece495[_0x3122('0x6')][_0x3122('0x7')]);}else{return _0x1ee655(_0xece495[_0x3122('0x8')]);}})[_0x3122('0x9')](function(_0x1b6006){return _0x26143a(_0x1b6006);});});}exports['sendMailMessage']=function(_0x3ef929,_0x16ec62){return request(_0x3122('0xa'),{'account':_0x3ef929,'message':_0x16ec62});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index e057587..101f671 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 _0x8bc9=['prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','trim','slice','emit','headers','line','exports','util','stream','call','_localBuffer','_inBody'];(function(_0x2aa10c,_0x21a413){var _0x3f0f3d=function(_0x44fbc4){while(--_0x44fbc4){_0x2aa10c['push'](_0x2aa10c['shift']());}};_0x3f0f3d(++_0x21a413);}(_0x8bc9,0x1c3));var _0x98bc=function(_0x5b989b,_0x28152a){_0x5b989b=_0x5b989b-0x0;var _0x1d4fa0=_0x8bc9[_0x5b989b];return _0x1d4fa0;};'use strict';var util=require(_0x98bc('0x0'));var Transform=require(_0x98bc('0x1'))['Transform'];function AGIReply(_0x12fd71){Transform[_0x98bc('0x2')](this,_0x12fd71);this[_0x98bc('0x3')]='';this[_0x98bc('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x98bc('0x5')][_0x98bc('0x6')]=function(_0x565025,_0xaf96f9,_0x2b773f){var _0x2f2f85='\x0a',_0x31bc8a=['\x0a\x0a',_0x98bc('0x7')],_0x3bb921=-0x1,_0x1d277a=-0x1,_0x1a6e5f='',_0x40c817=0x0,_0x4499b6='',_0x460e17='';this[_0x98bc('0x3')]+=_0x565025[_0x98bc('0x8')]();_0x4499b6=this[_0x98bc('0x3')];if(!this[_0x98bc('0x4')]){_0x40c817=0x0;while(_0x31bc8a[_0x40c817]){while((_0x1d277a=_0x4499b6[_0x98bc('0x9')](_0x31bc8a[_0x40c817]))!=-0x1){_0x1a6e5f=_0x31bc8a[_0x40c817];_0x460e17=_0x4499b6[_0x98bc('0xa')](0x0,_0x1d277a);_0x4499b6=_0x4499b6['substring'](_0x1d277a+_0x1a6e5f[_0x98bc('0xb')]);var _0x38923e=_0x460e17[_0x98bc('0xc')](_0x2f2f85),_0xf5f36e=0x0,_0x1204e2={},_0x2effc5='',_0x32c548='',_0x3b8def=-0x1;while(_0x38923e[_0xf5f36e]){_0x3b8def=_0x38923e[_0xf5f36e][_0x98bc('0x9')](':');if(_0x3b8def!=-0x1){_0x2effc5=_0x38923e[_0xf5f36e]['slice'](0x0,_0x3b8def)[_0x98bc('0xd')]();_0x32c548=_0x38923e[_0xf5f36e][_0x98bc('0xe')](_0x3b8def+0x1)['trim']();if(_0x2effc5[_0x98bc('0xb')]>0x0){_0x1204e2[_0x2effc5]=_0x32c548;}}else{}_0xf5f36e++;}this[_0x98bc('0xf')](_0x98bc('0x10'),_0x1204e2);this[_0x98bc('0x4')]=!![];}_0x40c817++;}this[_0x98bc('0x3')]=_0x4499b6;}else{while((_0x3bb921=_0x4499b6['indexOf'](_0x2f2f85))!=-0x1){_0x460e17=_0x4499b6['substring'](0x0,_0x3bb921);this[_0x98bc('0xf')](_0x98bc('0x11'),_0x460e17);_0x4499b6=_0x4499b6[_0x98bc('0xa')](_0x3bb921+_0x2f2f85['length']);}this['_localBuffer']=_0x4499b6;}_0x2b773f();};module[_0x98bc('0x12')]=AGIReply; \ No newline at end of file +var _0x9750=['indexOf','substring','length','split','slice','trim','emit','headers','line','exports','stream','Transform','call','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','_inBody'];(function(_0x48c612,_0x432076){var _0x5f0583=function(_0x2ebc92){while(--_0x2ebc92){_0x48c612['push'](_0x48c612['shift']());}};_0x5f0583(++_0x432076);}(_0x9750,0x199));var _0x0975=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9750[_0x6131cd];return _0x47e916;};'use strict';var util=require('util');var Transform=require(_0x0975('0x0'))[_0x0975('0x1')];function AGIReply(_0x5da1f6){Transform[_0x0975('0x2')](this,_0x5da1f6);this['_localBuffer']='';this['_inBody']=![];}util[_0x0975('0x3')](AGIReply,Transform);AGIReply[_0x0975('0x4')][_0x0975('0x5')]=function(_0x25510b,_0xd506b3,_0x434521){var _0xe35e10='\x0a',_0xe68205=['\x0a\x0a',_0x0975('0x6')],_0x27a194=-0x1,_0x5c0cf6=-0x1,_0x1532b3='',_0x1e676e=0x0,_0x447f57='',_0x122fa5='';this[_0x0975('0x7')]+=_0x25510b['toString']();_0x447f57=this[_0x0975('0x7')];if(!this[_0x0975('0x8')]){_0x1e676e=0x0;while(_0xe68205[_0x1e676e]){while((_0x5c0cf6=_0x447f57[_0x0975('0x9')](_0xe68205[_0x1e676e]))!=-0x1){_0x1532b3=_0xe68205[_0x1e676e];_0x122fa5=_0x447f57[_0x0975('0xa')](0x0,_0x5c0cf6);_0x447f57=_0x447f57[_0x0975('0xa')](_0x5c0cf6+_0x1532b3[_0x0975('0xb')]);var _0x2ea706=_0x122fa5[_0x0975('0xc')](_0xe35e10),_0xa7f33c=0x0,_0x30fe59={},_0x3afa72='',_0x1bedc1='',_0x4e9150=-0x1;while(_0x2ea706[_0xa7f33c]){_0x4e9150=_0x2ea706[_0xa7f33c][_0x0975('0x9')](':');if(_0x4e9150!=-0x1){_0x3afa72=_0x2ea706[_0xa7f33c][_0x0975('0xd')](0x0,_0x4e9150)[_0x0975('0xe')]();_0x1bedc1=_0x2ea706[_0xa7f33c][_0x0975('0xd')](_0x4e9150+0x1)[_0x0975('0xe')]();if(_0x3afa72[_0x0975('0xb')]>0x0){_0x30fe59[_0x3afa72]=_0x1bedc1;}}else{}_0xa7f33c++;}this[_0x0975('0xf')](_0x0975('0x10'),_0x30fe59);this[_0x0975('0x8')]=!![];}_0x1e676e++;}this[_0x0975('0x7')]=_0x447f57;}else{while((_0x27a194=_0x447f57[_0x0975('0x9')](_0xe35e10))!=-0x1){_0x122fa5=_0x447f57['substring'](0x0,_0x27a194);this[_0x0975('0xf')](_0x0975('0x11'),_0x122fa5);_0x447f57=_0x447f57[_0x0975('0xa')](_0x27a194+_0xe35e10[_0x0975('0xb')]);}this[_0x0975('0x7')]=_0x447f57;}_0x434521();};module[_0x0975('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 512b2c6..c56be80 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 _0x0be3=['lodash','util','jayson/promise','client','request','then','result','getSquareProjects','name','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','ShowVoiceQueue','getVariableById','getSquareOdbcById','dsn','GetContactByPhone','phone','getSoundById','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment'];(function(_0xbca161,_0x4ff432){var _0x16b108=function(_0x1f0463){while(--_0x1f0463){_0xbca161['push'](_0xbca161['shift']());}};_0x16b108(++_0x4ff432);}(_0x0be3,0xa3));var _0x30be=function(_0x3e9505,_0x17419e){_0x3e9505=_0x3e9505-0x0;var _0x49cd1b=_0x0be3[_0x3e9505];return _0x49cd1b;};'use strict';var BPromise=require(_0x30be('0x0'));var moment=require(_0x30be('0x1'));var _=require(_0x30be('0x2'));var util=require(_0x30be('0x3'));var jayson=require(_0x30be('0x4'));var client=jayson[_0x30be('0x5')]['http']({'port':0x2329});function request(_0x19d974,_0x3604fc){return new BPromise(function(_0x15775f,_0x182e67){return client[_0x30be('0x6')](_0x19d974,_0x3604fc)[_0x30be('0x7')](function(_0x4964f0){if(_0x4964f0['error']){return _0x182e67(_0x4964f0['error']['message']);}else{return _0x15775f(_0x4964f0[_0x30be('0x8')]);}})['catch'](function(_0x516eb7){return _0x182e67(_0x516eb7);});});}exports[_0x30be('0x9')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x30be('0xa'),'production']}});};exports['getSquareProject']=function(_0x1a0a43){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x1a0a43},'attributes':[_0x30be('0xb')]}});};exports[_0x30be('0xc')]=function(_0x3fcfd9){return request(_0x30be('0xd'),{'options':{'raw':![],'where':{'id':_0x3fcfd9},'include':[{'model':_0x30be('0xe'),'as':_0x30be('0xf'),'include':[{'model':_0x30be('0x10'),'as':'CloudProvider'}]}],'attributes':['id','name',_0x30be('0x11')],'smtp':!![]}});};exports[_0x30be('0x12')]=function(_0x8b9252){return request('ShowSquareProject',{'options':{'where':{'id':_0x8b9252},'attributes':[_0x30be('0xa')]}});};exports['getVoiceQueueById']=function(_0x5f397a){return request(_0x30be('0x13'),{'options':{'where':{'id':_0x5f397a},'attributes':[_0x30be('0xa')]}});};exports[_0x30be('0x14')]=function(_0x35319a){return request('ShowVariable',{'options':{'where':{'id':_0x35319a},'attributes':[_0x30be('0xa')]}});};exports[_0x30be('0x15')]=function(_0x1f0c36){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x1f0c36},'attributes':[_0x30be('0x16')]}});};exports['getUserById']=function(_0x4f4ef6){return request('ShowUser',{'options':{'where':{'id':_0x4f4ef6},'attributes':[_0x30be('0xa')]}});};exports['getContactByPhone']=function(_0x307d44){return request(_0x30be('0x17'),{'options':{'where':{'phone':_0x307d44[_0x30be('0x18')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x325b85){return request('ShowTrunk',{'options':{'where':{'id':_0x325b85},'attributes':[_0x30be('0xa')]}});};exports[_0x30be('0x19')]=function(_0x4fe3f5){return request('ShowSound',{'options':{'where':{'id':_0x4fe3f5},'attributes':[_0x30be('0x1a')]}});};exports[_0x30be('0x1b')]=function(_0x3e6e11){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x3e6e11},'include':[{'model':_0x30be('0x1c'),'as':_0x30be('0x1d')}]}});};exports[_0x30be('0x1e')]=function(_0x2f2fbd){return request('ShowSmsAccount',{'options':{'where':{'id':_0x2f2fbd},'attributes':['id',_0x30be('0xa')]}});};exports[_0x30be('0x1f')]=function(_0xe190c9){return request(_0x30be('0x20'),{'body':_0xe190c9});};exports[_0x30be('0x21')]=function(_0x5942bf){return request(_0x30be('0x22'),{'body':_0x5942bf});};exports[_0x30be('0x23')]=function(_0x3c271f){return request('CreateSquareReport',{'body':_[_0x30be('0x24')](_0x3c271f,{'project_name':_0x3c271f[_0x30be('0x25')],'prev_project_name':_0x3c271f[_0x30be('0x26')]||'','is_subproject':_0x3c271f[_0x30be('0x26')]?!![]:![],'leaveAt':moment()[_0x30be('0x27')](_0x30be('0x28'))})});};exports['createSquareRecording']=function(_0x34f12c){return request(_0x30be('0x29'),{'body':_0x34f12c});};exports[_0x30be('0x2a')]=function(_0x1ecddc){return request('CreateSquareMessage',{'body':_0x1ecddc});};exports[_0x30be('0x2b')]=function(_0xc4887e){return request(_0x30be('0x2c'),{'options':{'raw':![],'where':{'phone':_0xc4887e[_0x30be('0x18')],'ListId':_0xc4887e[_0x30be('0x2d')]}}})['then'](function(_0x338014){if(_0x338014){return _0x338014;}return request(_0x30be('0x2e'),{'body':_0xc4887e});});};exports[_0x30be('0x2f')]=function(_0x5e59f5){return request(_0x30be('0x30'),{'options':{'where':{'id':_0x5e59f5},'attributes':[_0x30be('0xa')]}});};exports['agentLogin']=function(_0x1704ee,_0x1f4c9b){return request(_0x30be('0x31'),{'body':{'interface':_0x1f4c9b},'options':{'where':_0x1704ee}});};exports['agentPause']=function(_0x3ca8b1,_0x4c0782,_0x4b09bb){return request(_0x30be('0x32'),{'body':{'type':_0x4c0782,'uniqueid':_0x4b09bb},'options':{'where':_0x3ca8b1}});};exports[_0x30be('0x33')]=function(_0x54d606){return request(_0x30be('0x34'),{'body':{},'options':{'where':_0x54d606}});};exports[_0x30be('0x35')]=function(_0x410cd2){return request(_0x30be('0x36'),{'body':{},'options':{'where':_0x410cd2}});}; \ No newline at end of file +var _0x8c65=['getSoundById','ShowSound','getIntervalById','ShowInterval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','util','client','http','then','error','result','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','getSquareProjectById','ShowSquareProject','ShowVoiceQueue','dsn','ShowUser','GetContactByPhone','phone','getTrunkById','ShowTrunk'];(function(_0x586e5b,_0x3dc8fe){var _0x23e8a3=function(_0x37fa39){while(--_0x37fa39){_0x586e5b['push'](_0x586e5b['shift']());}};_0x23e8a3(++_0x3dc8fe);}(_0x8c65,0xcc));var _0x58c6=function(_0x234775,_0x33ed07){_0x234775=_0x234775-0x0;var _0xb6bd02=_0x8c65[_0x234775];return _0xb6bd02;};'use strict';var BPromise=require(_0x58c6('0x0'));var moment=require(_0x58c6('0x1'));var _=require('lodash');var util=require(_0x58c6('0x2'));var jayson=require('jayson/promise');var client=jayson[_0x58c6('0x3')][_0x58c6('0x4')]({'port':0x2329});function request(_0x220294,_0x5c0e5f){return new BPromise(function(_0x5db336,_0x522a1c){return client['request'](_0x220294,_0x5c0e5f)[_0x58c6('0x5')](function(_0x26a4bd){if(_0x26a4bd[_0x58c6('0x6')]){return _0x522a1c(_0x26a4bd['error']['message']);}else{return _0x5db336(_0x26a4bd[_0x58c6('0x7')]);}})[_0x58c6('0x8')](function(_0xca6144){return _0x522a1c(_0xca6144);});});}exports[_0x58c6('0x9')]=function(){return request(_0x58c6('0xa'),{'options':{'raw':![],'attributes':['id',_0x58c6('0xb'),'production']}});};exports[_0x58c6('0xc')]=function(_0x570b85){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x570b85},'attributes':[_0x58c6('0xd')]}});};exports[_0x58c6('0xe')]=function(_0x1812e7){return request(_0x58c6('0xf'),{'options':{'raw':![],'where':{'id':_0x1812e7},'include':[{'model':_0x58c6('0x10'),'as':_0x58c6('0x11'),'include':[{'model':_0x58c6('0x12'),'as':_0x58c6('0x12')}]}],'attributes':['id',_0x58c6('0xb'),'email'],'smtp':!![]}});};exports[_0x58c6('0x13')]=function(_0x3e70dc){return request(_0x58c6('0x14'),{'options':{'where':{'id':_0x3e70dc},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x478225){return request(_0x58c6('0x15'),{'options':{'where':{'id':_0x478225},'attributes':[_0x58c6('0xb')]}});};exports['getVariableById']=function(_0x976a1d){return request('ShowVariable',{'options':{'where':{'id':_0x976a1d},'attributes':[_0x58c6('0xb')]}});};exports['getSquareOdbcById']=function(_0x5ee925){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x5ee925},'attributes':[_0x58c6('0x16')]}});};exports['getUserById']=function(_0x5d7dee){return request(_0x58c6('0x17'),{'options':{'where':{'id':_0x5d7dee},'attributes':['name']}});};exports['getContactByPhone']=function(_0x519fb2){return request(_0x58c6('0x18'),{'options':{'where':{'phone':_0x519fb2[_0x58c6('0x19')]},'attributes':['id']}});};exports[_0x58c6('0x1a')]=function(_0x222a5e){return request(_0x58c6('0x1b'),{'options':{'where':{'id':_0x222a5e},'attributes':[_0x58c6('0xb')]}});};exports[_0x58c6('0x1c')]=function(_0x5efce3){return request(_0x58c6('0x1d'),{'options':{'where':{'id':_0x5efce3},'attributes':['save_name']}});};exports[_0x58c6('0x1e')]=function(_0x23c4ff){return request(_0x58c6('0x1f'),{'options':{'raw':![],'where':{'id':_0x23c4ff},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0x58c6('0x20')]=function(_0x2e38a3){return request(_0x58c6('0x21'),{'options':{'where':{'id':_0x2e38a3},'attributes':['id','name']}});};exports[_0x58c6('0x22')]=function(_0x1e272f){return request(_0x58c6('0x23'),{'body':_0x1e272f});};exports[_0x58c6('0x24')]=function(_0x41a31d){return request(_0x58c6('0x25'),{'body':_0x41a31d});};exports['createSquareReport']=function(_0x5562f3){return request(_0x58c6('0x26'),{'body':_[_0x58c6('0x27')](_0x5562f3,{'project_name':_0x5562f3[_0x58c6('0x28')],'prev_project_name':_0x5562f3[_0x58c6('0x29')]||'','is_subproject':_0x5562f3['arg_2']?!![]:![],'leaveAt':moment()[_0x58c6('0x2a')](_0x58c6('0x2b'))})});};exports[_0x58c6('0x2c')]=function(_0x2e29bf){return request(_0x58c6('0x2d'),{'body':_0x2e29bf});};exports[_0x58c6('0x2e')]=function(_0x3d217e){return request(_0x58c6('0x2f'),{'body':_0x3d217e});};exports[_0x58c6('0x30')]=function(_0x940e12){return request(_0x58c6('0x31'),{'options':{'raw':![],'where':{'phone':_0x940e12[_0x58c6('0x19')],'ListId':_0x940e12[_0x58c6('0x32')]}}})['then'](function(_0x1b27c2){if(_0x1b27c2){return _0x1b27c2;}return request(_0x58c6('0x33'),{'body':_0x940e12});});};exports['getPauseById']=function(_0xfaa4d6){return request('ShowPause',{'options':{'where':{'id':_0xfaa4d6},'attributes':[_0x58c6('0xb')]}});};exports['agentLogin']=function(_0x1d3c07,_0x5b9d73){return request(_0x58c6('0x34'),{'body':{'interface':_0x5b9d73},'options':{'where':_0x1d3c07}});};exports[_0x58c6('0x35')]=function(_0xecc079,_0x3f909f,_0x29da38){return request(_0x58c6('0x36'),{'body':{'type':_0x3f909f,'uniqueid':_0x29da38},'options':{'where':_0xecc079}});};exports[_0x58c6('0x37')]=function(_0x3d15d7){return request(_0x58c6('0x38'),{'body':{},'options':{'where':_0x3d15d7}});};exports[_0x58c6('0x39')]=function(_0x5e4cc2){return request('LogoutUser',{'body':{},'options':{'where':_0x5e4cc2}});}; \ 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 4728efe..e89fc3b 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 _0x714c=['exports','./lex'];(function(_0x50f701,_0x857343){var _0x490d87=function(_0x16e5bd){while(--_0x16e5bd){_0x50f701['push'](_0x50f701['shift']());}};_0x490d87(++_0x857343);}(_0x714c,0x18d));var _0xc714=function(_0x2bfd4f,_0x1bbf2c){_0x2bfd4f=_0x2bfd4f-0x0;var _0x341849=_0x714c[_0x2bfd4f];return _0x341849;};var polly=require('./polly');var lex=require(_0xc714('0x0'));module[_0xc714('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x49fe=['./polly'];(function(_0x253b13,_0x247a2f){var _0x396bcc=function(_0x152c32){while(--_0x152c32){_0x253b13['push'](_0x253b13['shift']());}};_0x396bcc(++_0x247a2f);}(_0x49fe,0x75));var _0xe49f=function(_0x5db56a,_0x7d924d){_0x5db56a=_0x5db56a-0x0;var _0x5f137e=_0x49fe[_0x5db56a];return _0x5f137e;};var polly=require(_0xe49f('0x0'));var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index f7ecae0..a007a48 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 _0x878f=['exports'];(function(_0x3d0212,_0x4c8d60){var _0x27cff5=function(_0x2c390d){while(--_0x2c390d){_0x3d0212['push'](_0x3d0212['shift']());}};_0x27cff5(++_0x4c8d60);}(_0x878f,0x173));var _0xf878=function(_0x481f5d,_0x190cdd){_0x481f5d=_0x481f5d-0x0;var _0x5ca5a1=_0x878f[_0x481f5d];return _0x5ca5a1;};'use strict';var lex=require('./lib/api');module[_0xf878('0x0')]=function(_0x658976,_0x2e1d23,_0x12df2b,_0x1b3d0b,_0x3d74cf,_0x9e6783){return lex(_0x658976,_0x2e1d23,_0x12df2b,_0x1b3d0b,_0x3d74cf,_0x9e6783);}; \ No newline at end of file +var _0xa9e0=['exports','./lib/api'];(function(_0x2fff83,_0x29d5fe){var _0xa2a722=function(_0x18b6b0){while(--_0x18b6b0){_0x2fff83['push'](_0x2fff83['shift']());}};_0xa2a722(++_0x29d5fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var lex=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]=function(_0x29929c,_0x5dd881,_0x550fbc,_0x18d5c9,_0x4ce2f1,_0x333808){return lex(_0x29929c,_0x5dd881,_0x550fbc,_0x18d5c9,_0x4ce2f1,_0x333808);}; \ 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 346cda7..1728b12 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(_0x26f9dc,_0xc1a1d5){var _0x481e3f=function(_0x3428db){while(--_0x3428db){_0x26f9dc['push'](_0x26f9dc['shift']());}};_0x481e3f(++_0xc1a1d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x2a0b74,_0x5ff91e){var _0x75e41=function(_0x3ac688){while(--_0x3ac688){_0x2a0b74['push'](_0x2a0b74['shift']());}};_0x75e41(++_0x5ff91e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 1ccf7c4..663a8bf 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. * // * * // ************************************************************************* -'use strict';var polly=require('./lib/api');module['exports']=function(_0x42822c,_0x930763,_0x48d358,_0x2386ad,_0x222b3f,_0x5a6ae1,_0x47e814){return polly(_0x42822c,_0x930763,_0x48d358,_0x2386ad,_0x222b3f,_0x5a6ae1,_0x47e814);}; \ No newline at end of file +var _0x9286=['./lib/api'];(function(_0x303579,_0x3199f1){var _0x29ab60=function(_0x13e1e7){while(--_0x13e1e7){_0x303579['push'](_0x303579['shift']());}};_0x29ab60(++_0x3199f1);}(_0x9286,0x1de));var _0x6928=function(_0x2e6c19,_0x131233){_0x2e6c19=_0x2e6c19-0x0;var _0x52885d=_0x9286[_0x2e6c19];return _0x52885d;};'use strict';var polly=require(_0x6928('0x0'));module['exports']=function(_0x561440,_0x2bb83a,_0xd9a2d3,_0x43e332,_0x161795,_0x8499a3,_0x278f7f){return polly(_0x561440,_0x2bb83a,_0xd9a2d3,_0x43e332,_0x161795,_0x8499a3,_0x278f7f);}; \ 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 3e9f298..920eb8d 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 _0xfe30=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','bluebird','randomstring','aws-sdk','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xfe30,0xcd));var _0x0fe3=function(_0x2d1f6e,_0x13fdc7){_0x2d1f6e=_0x2d1f6e-0x0;var _0x421074=_0xfe30[_0x2d1f6e];return _0x421074;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x0fe3('0x0'));var rs=require(_0x0fe3('0x1'));var AWS=require(_0x0fe3('0x2'));function pollyResult(_0x2b0987,_0x358fa5,_0x43efb3){return new BPromise(function(_0x458f38,_0x3724b8){_0x2b0987['synthesizeSpeech'](_0x358fa5,function(_0x9805f5,_0x516058){if(_0x9805f5){_0x3724b8(_0x9805f5);}else if(_0x516058){if(_0x516058[_0x0fe3('0x3')]instanceof Buffer){fs['writeFile'](_0x43efb3,_0x516058[_0x0fe3('0x3')],function(_0x22964c){if(_0x22964c){_0x3724b8(_0x22964c);}else{_0x458f38();}});}else{_0x3724b8(new Error(_0x0fe3('0x4')));}}else{_0x3724b8(new Error(_0x0fe3('0x5')));}});});}module[_0x0fe3('0x6')]=function(_0x46ba61,_0x1319d9,_0x4aa541,_0x2e23ac,_0x10979e,_0x1f68e5,_0x4116b7){var _0x48466a=new AWS[(_0x0fe3('0x7'))]({'accessKeyId':_0x46ba61,'secretAccessKey':_0x1319d9,'region':_0x4aa541});var _0x39f882={'Text':_0x10979e,'TextType':_0x1f68e5||_0x0fe3('0x8'),'OutputFormat':_0x0fe3('0x9'),'VoiceId':_0x2e23ac};return pollyResult(_0x48466a,_0x39f882,_0x4116b7);}; \ No newline at end of file +var _0xdd99=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech'];(function(_0x1cf9eb,_0x3397b7){var _0x27c2ab=function(_0x3b03c6){while(--_0x3b03c6){_0x1cf9eb['push'](_0x1cf9eb['shift']());}};_0x27c2ab(++_0x3397b7);}(_0xdd99,0x67));var _0x9dd9=function(_0xa568de,_0x482c87){_0xa568de=_0xa568de-0x0;var _0x52c4be=_0xdd99[_0xa568de];return _0x52c4be;};'use strict';var fs=require('fs');var path=require(_0x9dd9('0x0'));var BPromise=require(_0x9dd9('0x1'));var rs=require(_0x9dd9('0x2'));var AWS=require(_0x9dd9('0x3'));function pollyResult(_0x450dd6,_0x19ab32,_0x4bdebe){return new BPromise(function(_0x47619d,_0x2d8233){_0x450dd6[_0x9dd9('0x4')](_0x19ab32,function(_0x412604,_0x385d89){if(_0x412604){_0x2d8233(_0x412604);}else if(_0x385d89){if(_0x385d89[_0x9dd9('0x5')]instanceof Buffer){fs[_0x9dd9('0x6')](_0x4bdebe,_0x385d89[_0x9dd9('0x5')],function(_0x161db8){if(_0x161db8){_0x2d8233(_0x161db8);}else{_0x47619d();}});}else{_0x2d8233(new Error(_0x9dd9('0x7')));}}else{_0x2d8233(new Error(_0x9dd9('0x8')));}});});}module['exports']=function(_0x2252ea,_0x56423d,_0x808b7b,_0x2fc876,_0x4fdf79,_0x4ba513,_0x29a656){var _0xadb1a1=new AWS[(_0x9dd9('0x9'))]({'accessKeyId':_0x2252ea,'secretAccessKey':_0x56423d,'region':_0x808b7b});var _0x3156ae={'Text':_0x4fdf79,'TextType':_0x4ba513||_0x9dd9('0xa'),'OutputFormat':_0x9dd9('0xb'),'VoiceId':_0x2fc876};return pollyResult(_0xadb1a1,_0x3156ae,_0x29a656);}; \ 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 bdc99ef..23efd5c 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa736=['./lib/api'];(function(_0x249024,_0x525412){var _0x25653a=function(_0x6ef4de){while(--_0x6ef4de){_0x249024['push'](_0x249024['shift']());}};_0x25653a(++_0x525412);}(_0xa736,0x82));var _0x6a73=function(_0x10ed5e,_0x226ccc){_0x10ed5e=_0x10ed5e-0x0;var _0x117ecd=_0xa736[_0x10ed5e];return _0x117ecd;};'use strict';var asr=require(_0x6a73('0x0'));module['exports']=function(_0x35fa28,_0x4c8978,_0x57aeef,_0x9c1ca3){return asr(_0x35fa28,_0x4c8978,_0x57aeef);}; \ No newline at end of file +var _0x66c8=['./lib/api','exports'];(function(_0x14437f,_0xc14167){var _0x4d0175=function(_0xb74854){while(--_0xb74854){_0x14437f['push'](_0x14437f['shift']());}};_0x4d0175(++_0xc14167);}(_0x66c8,0x126));var _0x866c=function(_0x353a94,_0x2ba050){_0x353a94=_0x353a94-0x0;var _0x47e4f0=_0x66c8[_0x353a94];return _0x47e4f0;};'use strict';var asr=require(_0x866c('0x0'));module[_0x866c('0x1')]=function(_0x525f62,_0x53a798,_0x2a7a46,_0x5e67b4){return asr(_0x525f62,_0x53a798,_0x2a7a46);}; \ 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 c797450..f48bf2d 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 _0xaf93=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','readFileSync','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf93,0x151));var _0x3af9=function(_0x28972d,_0x5cd0ba){_0x28972d=_0x28972d-0x0;var _0x302084=_0xaf93[_0x28972d];return _0x302084;};'use strict';var url=require(_0x3af9('0x0'));var BPromise=require(_0x3af9('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x13f5d7,_0x3e84b6,_0x528aa0){return new BPromise(function(_0x1319bc,_0x44ae6e){var _0x5add3;if(typeof _0x13f5d7!==_0x3af9('0x2')||_0x13f5d7[_0x3af9('0x3')]===0x0){return _0x44ae6e(_0x3af9('0x4'));}if(typeof _0x3e84b6!==_0x3af9('0x2')||_0x3e84b6['length']===0x0){return _0x44ae6e(_0x3af9('0x5'));}if(typeof _0x528aa0!=='undefined'&&(typeof _0x528aa0!==_0x3af9('0x2')||_0x528aa0['length']===0x0)){return _0x44ae6e('lang\x20should\x20be\x20a\x20string');}try{_0x5add3=fs[_0x3af9('0x6')](_0x13f5d7)['toString']('base64');}catch(_0x1313eb){return _0x44ae6e(_0x1313eb);}return _0x1319bc({'method':_0x3af9('0x7'),'uri':host+_0x3af9('0x8')+_0x3e84b6,'body':{'config':{'encoding':_0x3af9('0x9'),'sampleRateHertz':'8000','languageCode':_0x528aa0},'audio':{'content':_0x5add3}},'json':!![]});});}; \ No newline at end of file +var _0x3667=['8000','url','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'];(function(_0x5258c2,_0x35fbe4){var _0x394ee3=function(_0x31da22){while(--_0x31da22){_0x5258c2['push'](_0x5258c2['shift']());}};_0x394ee3(++_0x35fbe4);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var url=require(_0x7366('0x0'));var BPromise=require(_0x7366('0x1'));var fs=require('fs');var host=_0x7366('0x2');module[_0x7366('0x3')]=function(_0x3c601d,_0x5d1072,_0x27a90d){return new BPromise(function(_0x1cfcc9,_0x4b32a7){var _0x27726b;if(typeof _0x3c601d!==_0x7366('0x4')||_0x3c601d[_0x7366('0x5')]===0x0){return _0x4b32a7(_0x7366('0x6'));}if(typeof _0x5d1072!==_0x7366('0x4')||_0x5d1072['length']===0x0){return _0x4b32a7(_0x7366('0x7'));}if(typeof _0x27a90d!==_0x7366('0x8')&&(typeof _0x27a90d!==_0x7366('0x4')||_0x27a90d[_0x7366('0x5')]===0x0)){return _0x4b32a7(_0x7366('0x9'));}try{_0x27726b=fs[_0x7366('0xa')](_0x3c601d)[_0x7366('0xb')](_0x7366('0xc'));}catch(_0x18aee5){return _0x4b32a7(_0x18aee5);}return _0x1cfcc9({'method':_0x7366('0xd'),'uri':host+_0x7366('0xe')+_0x5d1072,'body':{'config':{'encoding':_0x7366('0xf'),'sampleRateHertz':_0x7366('0x10'),'languageCode':_0x27a90d},'audio':{'content':_0x27726b}},'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 10cb4be..0c354f8 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x71e0=['./asr'];(function(_0x2e44cf,_0x16f684){var _0x361268=function(_0x2a59db){while(--_0x2a59db){_0x2e44cf['push'](_0x2e44cf['shift']());}};_0x361268(++_0x16f684);}(_0x71e0,0x90));var _0x071e=function(_0x1c0764,_0x54d3a4){_0x1c0764=_0x1c0764-0x0;var _0x286d8c=_0x71e0[_0x1c0764];return _0x286d8c;};var asr=require(_0x071e('0x0'));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 5d633ab..15bd5d7 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 _0xa0a9=['WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','data','transcode','wav','error\x20convert','resolve','tmp','.wav','writeFileSync','then','unlink','chmodSync','777','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','generate','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','utf8','f.req=','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','action','actionIncomplete','fulfillment','speech','score','status','metadata','endConversation','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','fulfillmentText','intent','displayName','queryText','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','ispeechTTS','format','freeform=3','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','md5','path','querystring','request-promise','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','agi','protocol','https:'];(function(_0x59e23a,_0x34c57d){var _0x3d1b09=function(_0x371d8f){while(--_0x371d8f){_0x59e23a['push'](_0x59e23a['shift']());}};_0x3d1b09(++_0x34c57d);}(_0xa0a9,0x1e6));var _0x9a0a=function(_0x6c503d,_0x3da99a){_0x6c503d=_0x6c503d-0x0;var _0x87560f=_0xa0a9[_0x6c503d];return _0x87560f;};'use strict';var apiai=require(_0x9a0a('0x0'));var BPromise=require(_0x9a0a('0x1'));var dialogflow=require(_0x9a0a('0x2'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x9a0a('0x3'));var path=require(_0x9a0a('0x4'));var querystring=require(_0x9a0a('0x5'));var rp=require(_0x9a0a('0x6'));var rs=require('randomstring');var sox=require('sox');var tts=require(_0x9a0a('0x7'));var urlParse=require(_0x9a0a('0x8'))[_0x9a0a('0x9')];var util=require(_0x9a0a('0xa'));var aws=require(_0x9a0a('0xb'));var google=require(_0x9a0a('0xc'));var sestek=require(_0x9a0a('0xd'));var tilde=require(_0x9a0a('0xe'));var logger=require('../../../config/logger')(_0x9a0a('0xf'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x15c824,_0x333001){return new BPromise(function(_0x2e1355,_0x45fade){var _0x40a931=urlParse(_0x15c824);var _0x498529=_0x40a931[_0x9a0a('0x10')]===_0x9a0a('0x11')?https:http;var _0x420478={'host':_0x40a931['host'],'path':_0x40a931[_0x9a0a('0x4')],'headers':{'user-agent':_0x9a0a('0x12')}};_0x498529[_0x9a0a('0x13')](_0x420478,function(_0x22ed4c){if(_0x22ed4c[_0x9a0a('0x14')]!==0xc8){logger[_0x9a0a('0x15')](_0x9a0a('0x16')+_0x15c824+_0x9a0a('0x17')+_0x22ed4c[_0x9a0a('0x14')]+'\x20('+_0x22ed4c[_0x9a0a('0x18')]+')');_0x45fade(new Error(_0x9a0a('0x16')+_0x15c824+_0x9a0a('0x17')+_0x22ed4c['statusCode']+'\x20('+_0x22ed4c[_0x9a0a('0x18')]+')'));return;}var _0x30f3c4=fs['createWriteStream'](_0x333001);_0x30f3c4['on'](_0x9a0a('0x19'),function(){logger[_0x9a0a('0x1a')](_0x9a0a('0x1b'));_0x30f3c4[_0x9a0a('0x1c')](_0x2e1355);});_0x30f3c4['on'](_0x9a0a('0x15'),function(_0x28c937){fs['unlink'](_0x333001);logger['error'](_0x9a0a('0x1d'),_0x28c937);_0x45fade(_0x28c937);});_0x22ed4c[_0x9a0a('0x1e')](_0x30f3c4);})['on'](_0x9a0a('0x15'),function(_0x1e23af){logger[_0x9a0a('0x15')](_0x1e23af);_0x45fade(_0x1e23af);})[_0x9a0a('0x1f')]();});}function uploadFile(_0x49d1e3){return new BPromise(function(_0x13ec32,_0x463359){var _0x2704b3=urlParse(_0x49d1e3);var _0x44c591=_0x2704b3['protocol']===_0x9a0a('0x11')?https:http;var _0x1efb07={'host':_0x2704b3['host'],'path':_0x2704b3[_0x9a0a('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x44c591[_0x9a0a('0x13')](_0x1efb07,function(_0x90c253){if(_0x90c253[_0x9a0a('0x14')]!==0xc8){_0x463359(new Error('request\x20to\x20'+_0x49d1e3+_0x9a0a('0x17')+_0x90c253['statusCode']+'\x20('+_0x90c253[_0x9a0a('0x18')]+')'));return;}var _0xece3f2='';_0x90c253['on'](_0x9a0a('0x20'),function(_0x5655ff){_0xece3f2+=_0x5655ff;});_0x90c253['on'](_0x9a0a('0x1f'),function(){_0x13ec32(_0xece3f2);});})['on'](_0x9a0a('0x15'),function(_0x1a2a97){_0x463359(_0x1a2a97);})[_0x9a0a('0x1f')]();});}function convertFile(_0x3dbbfd,_0x23de72){return new BPromise(function(_0x1fe072,_0x591d69){var _0x17f012=sox[_0x9a0a('0x21')](_0x3dbbfd,_0x23de72,{'sampleRate':0x1f40,'format':_0x9a0a('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x17f012['on'](_0x9a0a('0x15'),function(_0x18730d){logger[_0x9a0a('0x15')](_0x9a0a('0x23'),_0x18730d);_0x591d69(_0x18730d);});_0x17f012['on']('end',function(){logger[_0x9a0a('0x1a')]('finish\x20to\x20convert');_0x1fe072();});_0x17f012['start']();});}function base64Decode(_0x46b84c,_0x2cb0f1){var _0x17f326=path[_0x9a0a('0x24')](__dirname,_0x9a0a('0x25'),rs['generate'](0x4)+_0x9a0a('0x26'));fs[_0x9a0a('0x27')](_0x17f326,_0x46b84c,'base64');return convertFile(_0x17f326,_0x2cb0f1)[_0x9a0a('0x28')](function(){try{fs[_0x9a0a('0x29')](_0x17f326);fs[_0x9a0a('0x2a')](_0x2cb0f1,_0x9a0a('0x2b'));}catch(_0x4df774){logger[_0x9a0a('0x15')](_0x4df774);}return _0x2cb0f1['split']('.')[0x0];});}function base64Encode(_0x35782b){var _0x38c143=fs[_0x9a0a('0x2c')](_0x35782b);return new Buffer(_0x38c143)['toString'](_0x9a0a('0x2d'));}exports[_0x9a0a('0x2e')]=function(_0xecf2a9,_0x5a441f,_0x4cbcb0,_0x5184c1,_0x4d6c14,_0x171f48){var _0xf5cf2d,_0x1d177c;var _0x10ce83=_0x9a0a('0x2f');var _0x18d318=_0x9a0a('0x30')+_0xecf2a9;var _0x3595ce={};if(_0x5a441f===_0x9a0a('0x31')){_0x3595ce[_0x9a0a('0x32')]={'ssml':_0x4cbcb0};}else{_0x3595ce['input']={'text':_0x4cbcb0};};_0x3595ce[_0x9a0a('0x33')]={'languageCode':_0x5184c1,'ssmlGender':_0x4d6c14};_0x3595ce[_0x9a0a('0x34')]={'audioEncoding':_0x9a0a('0x35'),'sampleRateHertz':0x1f40};var _0x15e67c={'url':_0x10ce83+_0x9a0a('0x36')+_0x18d318,'method':'POST','json':!![],'body':_0x3595ce};return rp(_0x15e67c)[_0x9a0a('0x28')](function(_0x414cc8){return new BPromise(function(_0xfd24af,_0x2eea30){_0xf5cf2d=path[_0x9a0a('0x24')](__dirname,_0x9a0a('0x25'),rs[_0x9a0a('0x37')](0x4)+_0x9a0a('0x38'));var _0x315c4a=Buffer[_0x9a0a('0x39')](_0x414cc8[_0x9a0a('0x3a')],'base64');return fs[_0x9a0a('0x3b')](_0xf5cf2d,_0x315c4a,function(_0x3b7338){_0x2eea30(_0x3b7338);},function(_0xfbd1d8){fs[_0x9a0a('0x2a')](_0xf5cf2d,_0x9a0a('0x2b'));_0xfd24af(_0xfbd1d8);});});})[_0x9a0a('0x28')](function(_0x443143){_0x1d177c=path['resolve'](__dirname,_0x9a0a('0x25'),rs['generate'](0x4)+_0x9a0a('0x26'));return convertFile(_0xf5cf2d,_0x1d177c);})[_0x9a0a('0x28')](function(){try{fs['unlink'](_0xf5cf2d);fs[_0x9a0a('0x2a')](_0x1d177c,_0x9a0a('0x2b'));}catch(_0x1bb59a){logger[_0x9a0a('0x15')](_0x1bb59a);}logger['info'](_0x9a0a('0x3c'),_0x1d177c[_0x9a0a('0x3d')]('.')[0x0]);return _0x1d177c['split']('.')[0x0];});};exports[_0x9a0a('0x3e')]=function(_0x106a5c,_0x8c773d){var _0x4b1cda='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x5b7a98,_0x1d1605;var _0x478ea3;var _0x439d4a={'encoding':_0x9a0a('0x3f'),'method':'POST','timeout':0x2710,'url':_0x4b1cda,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x9a0a('0x40')+encodeURIComponent(JSON[_0x9a0a('0x41')]([[[_0x9a0a('0x42'),JSON['stringify']([_0x106a5c,_0x8c773d||'en',![],_0x9a0a('0x43')]),null,_0x9a0a('0x44')]]]))};return rp(_0x439d4a)[_0x9a0a('0x28')](function(_0x5153c2){try{_0x478ea3=eval(_0x5153c2['slice'](0x5))[0x0][0x2];}catch(_0x8cfc12){throw new Error(_0x9a0a('0x45')+_0x5153c2[_0x9a0a('0x20')]);}if(!_0x478ea3){if(_0x106a5c[_0x9a0a('0x46')]>0xc8){throw new Error(_0x9a0a('0x47'));}else{throw new Error(_0x9a0a('0x48')+_0x8c773d+'\x22\x20might\x20not\x20exist');}}try{_0x478ea3=eval(_0x478ea3)[0x0];}catch(_0x5090b3){throw new Error(_0x9a0a('0x45')+res['data']);}const _0x327c09=_0x478ea3;_0x5b7a98=path[_0x9a0a('0x24')](__dirname,_0x9a0a('0x25'),rs['generate'](0x4)+'.mp3');fs['writeFileSync'](_0x5b7a98,_0x478ea3,{'encoding':'base64'});_0x1d1605=path[_0x9a0a('0x24')](__dirname,_0x9a0a('0x25'),rs[_0x9a0a('0x37')](0x4)+'.wav');return convertFile(_0x5b7a98,_0x1d1605);})['then'](function(){try{fs[_0x9a0a('0x29')](_0x5b7a98);fs[_0x9a0a('0x2a')](_0x1d1605,_0x9a0a('0x2b'));}catch(_0x517707){logger['error'](_0x517707);}logger['info'](_0x9a0a('0x49'),_0x1d1605['split']('.')[0x0]);return _0x1d1605[_0x9a0a('0x3d')]('.')[0x0];});};exports['googleASR']=function(_0x4096df,_0x9452cf,_0x3996d9){return google[_0x9a0a('0x4a')](_0x4096df,_0x9452cf,_0x3996d9)[_0x9a0a('0x28')](function(_0x13e5af){logger[_0x9a0a('0x1a')](_0x13e5af['uri']);return rp(_0x13e5af);})[_0x9a0a('0x28')](function(_0x18afde){var _0x3c623d='';var _0x3f0512=0x0;try{fs['unlink'](_0x4096df);}catch(_0x1ca591){logger[_0x9a0a('0x15')](_0x1ca591);}if(_0x18afde&&_0x18afde[_0x9a0a('0x4b')]){_0x3c623d=_0x18afde['results'][_0x9a0a('0x4c')](function(_0x266d11){return _0x266d11&&_0x266d11[_0x9a0a('0x4d')][0x0]&&_0x266d11[_0x9a0a('0x4d')][0x0][_0x9a0a('0x4e')]?_0x266d11['alternatives'][0x0][_0x9a0a('0x4e')]:'';})[_0x9a0a('0x4f')]('\x0a');_0x3f0512=_0x18afde[_0x9a0a('0x4b')][_0x9a0a('0x4c')](function(_0x25eb38){return _0x25eb38&&_0x25eb38[_0x9a0a('0x4d')][0x0]&&_0x25eb38[_0x9a0a('0x4d')][0x0][_0x9a0a('0x50')]?_0x25eb38[_0x9a0a('0x4d')][0x0][_0x9a0a('0x50')]:0x0;})[_0x9a0a('0x4f')]('\x0a');}logger['info'](_0x9a0a('0x51'),_0x3c623d);logger[_0x9a0a('0x1a')](_0x9a0a('0x52'),_0x3f0512);return{'transcript':_0x3c623d,'confidence':_0x3f0512};})[_0x9a0a('0x53')](function(_0x805fc6){logger[_0x9a0a('0x15')](_0x9a0a('0x54'),_0x805fc6[_0x9a0a('0x14')],_0x805fc6[_0x9a0a('0x55')],_0x805fc6[_0x9a0a('0x56')]);});};exports[_0x9a0a('0x57')]=function(_0xa258f2,_0x5b521a,_0x341dbc,_0x2d9ed7){var _0x37c16e=apiai(_0x5b521a,{'language':_0x2d9ed7||'en'});return _0x37c16e[_0x9a0a('0x58')](_0x341dbc,{'sessionId':md5(_0xa258f2)})[_0x9a0a('0x28')](function(_0x4e7fdf){logger[_0x9a0a('0x1a')](JSON[_0x9a0a('0x41')](_0x4e7fdf));return{'source':_0x4e7fdf[_0x9a0a('0x59')]['source'],'resolvedQuery':_0x4e7fdf[_0x9a0a('0x59')]['resolvedQuery'],'action':_0x4e7fdf[_0x9a0a('0x59')][_0x9a0a('0x5a')],'actionIncomplete':_0x4e7fdf[_0x9a0a('0x59')][_0x9a0a('0x5b')],'speech':_0x4e7fdf[_0x9a0a('0x59')][_0x9a0a('0x5c')][_0x9a0a('0x5d')],'score':_0x4e7fdf[_0x9a0a('0x59')][_0x9a0a('0x5e')],'statusCode':_0x4e7fdf[_0x9a0a('0x5f')]['code'],'endConversation':_0x4e7fdf[_0x9a0a('0x59')][_0x9a0a('0x60')][_0x9a0a('0x61')]||![],'isFallbackIntent':_0x4e7fdf['result'][_0x9a0a('0x60')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x412a6d,_0xb47e08,_0xf1ed85,_0x478e8a,_0x10d557,_0x18997c){var _0xfe8cef=_0x478e8a[_0x9a0a('0x62')](/\\n/g,'\x0a');var _0x4e510e={'credentials':{'private_key':_0xfe8cef,'client_email':_0xf1ed85}};var _0x28b7ea=new dialogflow[(_0x9a0a('0x63'))](_0x4e510e);var _0x35cbae=_0x28b7ea[_0x9a0a('0x64')](_0xb47e08,md5(_0x412a6d));var _0x26dada={'session':_0x35cbae,'queryInput':{'text':{'text':_0x10d557,'languageCode':_0x18997c}}};return _0x28b7ea[_0x9a0a('0x65')](_0x26dada)[_0x9a0a('0x28')](function(_0xa03341){if(_0xa03341&&_0xa03341['length']){logger['info'](_0x9a0a('0x66'),JSON[_0x9a0a('0x41')](_0xa03341));var _0x328a15=_0xa03341[0x0];if(_0x328a15){var _0x13aa34={'action':_0x328a15[_0x9a0a('0x67')][_0x9a0a('0x5a')],'allRequiredParamsPresent':_0x328a15[_0x9a0a('0x67')]['allRequiredParamsPresent'],'endConversation':_0x328a15['queryResult'][_0x9a0a('0x68')]&&_0x328a15['queryResult'][_0x9a0a('0x68')][_0x9a0a('0x69')]?_0x328a15[_0x9a0a('0x67')][_0x9a0a('0x68')]['fields']['end_conversation']['boolValue']:![],'fulfillmentText':_0x328a15[_0x9a0a('0x67')][_0x9a0a('0x6a')],'intentName':_0x328a15[_0x9a0a('0x67')][_0x9a0a('0x6b')][_0x9a0a('0x55')],'intentDisplayName':_0x328a15[_0x9a0a('0x67')][_0x9a0a('0x6b')][_0x9a0a('0x6c')],'isFallbackIntent':_0x328a15[_0x9a0a('0x67')][_0x9a0a('0x6b')]['isFallback'],'languageCode':_0x328a15[_0x9a0a('0x67')]['languageCode'],'queryText':_0x328a15[_0x9a0a('0x67')][_0x9a0a('0x6d')],'responseId':_0x328a15['responseId'],'score':_0x328a15['queryResult'][_0x9a0a('0x6e')],'speech':_0x328a15[_0x9a0a('0x67')][_0x9a0a('0x6a')],'providerResponse':JSON[_0x9a0a('0x41')](_0xa03341)};return _0x13aa34;}}});};exports['tildeASR']=function(_0x36f1ae,_0xc8f4f6,_0x366a0b,_0x361c1a){return tilde[_0x9a0a('0x4a')](_0x36f1ae,_0xc8f4f6,_0x366a0b,_0x361c1a)[_0x9a0a('0x28')](function(_0x4ab0f1){try{fs[_0x9a0a('0x29')](_0x36f1ae);}catch(_0x3411f2){logger[_0x9a0a('0x15')](_0x3411f2);}logger[_0x9a0a('0x1a')](_0x9a0a('0x6f'),_0x4ab0f1[_0x9a0a('0x4e')]);logger[_0x9a0a('0x1a')](_0x9a0a('0x70'),_0x4ab0f1[_0x9a0a('0x50')]);return _0x4ab0f1;});};exports['awsPolly']=function(_0x177376,_0x26163e,_0x5454ac,_0x29def4,_0x2b8a41,_0x36f2c7){var _0x4495b4=path[_0x9a0a('0x24')](__dirname,_0x9a0a('0x25'),rs[_0x9a0a('0x37')](0x4)+_0x9a0a('0x38'));var _0x127248;return aws[_0x9a0a('0x71')](_0x177376,_0x26163e,_0x5454ac,_0x29def4,_0x2b8a41,_0x36f2c7,_0x4495b4)[_0x9a0a('0x28')](function(){_0x127248=path[_0x9a0a('0x24')](__dirname,_0x9a0a('0x25'),rs['generate'](0x4)+_0x9a0a('0x26'));return convertFile(_0x4495b4,_0x127248);})[_0x9a0a('0x28')](function(){try{fs[_0x9a0a('0x29')](_0x4495b4);fs[_0x9a0a('0x2a')](_0x127248,'777');}catch(_0x11dcca){logger[_0x9a0a('0x15')](_0x11dcca);}return _0x127248[_0x9a0a('0x3d')]('.')[0x0];});};exports[_0x9a0a('0x72')]=function(_0x2e62ae,_0x5b8e09,_0x3ebb34,_0x19a257,_0x2d1941,_0x25ea1a){return aws['lex'](_0x2e62ae,_0x5b8e09,_0x3ebb34,_0x19a257,_0x2d1941,_0x25ea1a)[_0x9a0a('0x28')](function(_0x3ad283){logger['info'](JSON[_0x9a0a('0x41')](_0x3ad283));return _0x3ad283;});};exports[_0x9a0a('0x73')]=function(_0x1174a2,_0x6e8324,_0x184b26,_0x4fec57){var _0x52954f=util[_0x9a0a('0x74')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x1174a2,encodeURIComponent(_0x6e8324),_0x184b26,_0x4fec57);var _0x3cefb9=path[_0x9a0a('0x24')](__dirname,_0x9a0a('0x25'),rs['generate'](0x4)+_0x9a0a('0x38'));var _0x52b932;return downloadFile(_0x52954f,_0x3cefb9)['then'](function(){_0x52b932=path[_0x9a0a('0x24')](__dirname,_0x9a0a('0x25'),rs['generate'](0x4)+'.wav');return convertFile(_0x3cefb9,_0x52b932);})[_0x9a0a('0x28')](function(){try{fs[_0x9a0a('0x29')](_0x3cefb9);fs[_0x9a0a('0x2a')](_0x52b932,_0x9a0a('0x2b'));}catch(_0x765d2e){logger[_0x9a0a('0x15')](_0x765d2e);}return _0x52b932[_0x9a0a('0x3d')]('.')[0x0];});};exports['ispeechASR']=function(_0x12f8da,_0x502fa8,_0x1f1a65,_0x5568d3){var _0xbabd9=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x502fa8,_0x1f1a65,base64Encode(_0x12f8da),_0x5568d3?util[_0x9a0a('0x74')]('model=%s',encodeURIComponent(_0x5568d3)):_0x9a0a('0x75'));return uploadFile(_0xbabd9)[_0x9a0a('0x28')](function(_0x8fe936){return querystring[_0x9a0a('0x9')](_0x8fe936);});};exports['sestekNDA']=function(_0x35203f,_0x5b275c){return sestek['nda'](_0x35203f,_0x5b275c)[_0x9a0a('0x28')](function(_0x3e52eb){logger[_0x9a0a('0x1a')](JSON[_0x9a0a('0x41')](_0x3e52eb));var _0x476f58={'speech':_0x3e52eb[_0x9a0a('0x76')],'action':_0x3e52eb[_0x9a0a('0x77')]?_0x3e52eb[_0x9a0a('0x77')][_0x9a0a('0x78')]:undefined,'actiondata':_0x3e52eb[_0x9a0a('0x77')]?_0x3e52eb[_0x9a0a('0x77')][_0x9a0a('0x79')]:undefined};if(_0x3e52eb[_0x9a0a('0x77')]&&_0x3e52eb[_0x9a0a('0x77')][_0x9a0a('0x7a')]){return base64Decode(_0x3e52eb[_0x9a0a('0x77')]['AudioFromTts'][_0x9a0a('0x7b')],path[_0x9a0a('0x24')](__dirname,_0x9a0a('0x25'),rs[_0x9a0a('0x37')](0x4)+_0x9a0a('0x26')))[_0x9a0a('0x28')](function(_0x20df12){_0x476f58[_0x9a0a('0x7c')]=_0x20df12;return _0x476f58;});}return _0x476f58;});};exports[_0x9a0a('0x7d')]=function(){return __dirname;}; \ No newline at end of file +var _0x64e2=['start','resolve','tmp','.wav','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','voice','text:synthesize','POST','from','audioContent','writeFile','generate','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','.mp3','writeFileSync','googleASR','asr','results','map','alternatives','transcript','join','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:','queryResult','allRequiredParamsPresent','diagnosticInfo','end_conversation','boolValue','intent','displayName','isFallback','queryText','responseId','fulfillmentText','tildeASR','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','querystring','request-promise','url','parse','./aws','./sestek','agi','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','unlink','pipe','end','protocol','get','data','wav','finish\x20to\x20convert'];(function(_0x5a81f4,_0x3e6613){var _0x2248ea=function(_0x12e460){while(--_0x12e460){_0x5a81f4['push'](_0x5a81f4['shift']());}};_0x2248ea(++_0x3e6613);}(_0x64e2,0x177));var _0x264e=function(_0x5ed14e,_0x1b3ad9){_0x5ed14e=_0x5ed14e-0x0;var _0x4d1547=_0x64e2[_0x5ed14e];return _0x4d1547;};'use strict';var apiai=require(_0x264e('0x0'));var BPromise=require(_0x264e('0x1'));var dialogflow=require(_0x264e('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x264e('0x3'));var md5=require(_0x264e('0x4'));var path=require(_0x264e('0x5'));var querystring=require(_0x264e('0x6'));var rp=require(_0x264e('0x7'));var rs=require('randomstring');var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x264e('0x8'))[_0x264e('0x9')];var util=require('util');var aws=require(_0x264e('0xa'));var google=require('./google');var sestek=require(_0x264e('0xb'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x264e('0xc'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x15fa58,_0x1789d8){return new BPromise(function(_0xf7509b,_0x527e70){var _0x5cd061=urlParse(_0x15fa58);var _0x46eb96=_0x5cd061['protocol']===_0x264e('0xd')?https:http;var _0x19b49a={'host':_0x5cd061[_0x264e('0xe')],'path':_0x5cd061['path'],'headers':{'user-agent':_0x264e('0xf')}};_0x46eb96['get'](_0x19b49a,function(_0x14a141){if(_0x14a141[_0x264e('0x10')]!==0xc8){logger[_0x264e('0x11')](_0x264e('0x12')+_0x15fa58+_0x264e('0x13')+_0x14a141[_0x264e('0x10')]+'\x20('+_0x14a141[_0x264e('0x14')]+')');_0x527e70(new Error(_0x264e('0x12')+_0x15fa58+_0x264e('0x13')+_0x14a141['statusCode']+'\x20('+_0x14a141[_0x264e('0x14')]+')'));return;}var _0x35d148=fs[_0x264e('0x15')](_0x1789d8);_0x35d148['on']('finish',function(){logger[_0x264e('0x16')](_0x264e('0x17'));_0x35d148[_0x264e('0x18')](_0xf7509b);});_0x35d148['on'](_0x264e('0x11'),function(_0x34d6c9){fs[_0x264e('0x19')](_0x1789d8);logger['error']('download\x20error',_0x34d6c9);_0x527e70(_0x34d6c9);});_0x14a141[_0x264e('0x1a')](_0x35d148);})['on'](_0x264e('0x11'),function(_0x27295e){logger[_0x264e('0x11')](_0x27295e);_0x527e70(_0x27295e);})[_0x264e('0x1b')]();});}function uploadFile(_0x240ce5){return new BPromise(function(_0x197b33,_0x15c0e3){var _0x1302c3=urlParse(_0x240ce5);var _0x1f586d=_0x1302c3[_0x264e('0x1c')]===_0x264e('0xd')?https:http;var _0x1d5541={'host':_0x1302c3[_0x264e('0xe')],'path':_0x1302c3[_0x264e('0x5')],'headers':{'user-agent':_0x264e('0xf')}};_0x1f586d[_0x264e('0x1d')](_0x1d5541,function(_0x55a602){if(_0x55a602[_0x264e('0x10')]!==0xc8){_0x15c0e3(new Error(_0x264e('0x12')+_0x240ce5+_0x264e('0x13')+_0x55a602[_0x264e('0x10')]+'\x20('+_0x55a602['statusMessage']+')'));return;}var _0x58cb2f='';_0x55a602['on'](_0x264e('0x1e'),function(_0x1de66d){_0x58cb2f+=_0x1de66d;});_0x55a602['on']('end',function(){_0x197b33(_0x58cb2f);});})['on'](_0x264e('0x11'),function(_0x2f2faf){_0x15c0e3(_0x2f2faf);})[_0x264e('0x1b')]();});}function convertFile(_0x2aaafa,_0x23e0eb){return new BPromise(function(_0x46e7dd,_0xf7026f){var _0x2a1907=sox['transcode'](_0x2aaafa,_0x23e0eb,{'sampleRate':0x1f40,'format':_0x264e('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2a1907['on'](_0x264e('0x11'),function(_0x4c5826){logger[_0x264e('0x11')]('error\x20convert',_0x4c5826);_0xf7026f(_0x4c5826);});_0x2a1907['on'](_0x264e('0x1b'),function(){logger[_0x264e('0x16')](_0x264e('0x20'));_0x46e7dd();});_0x2a1907[_0x264e('0x21')]();});}function base64Decode(_0x5b672f,_0x3e23dc){var _0xc4c236=path[_0x264e('0x22')](__dirname,_0x264e('0x23'),rs['generate'](0x4)+_0x264e('0x24'));fs['writeFileSync'](_0xc4c236,_0x5b672f,_0x264e('0x25'));return convertFile(_0xc4c236,_0x3e23dc)[_0x264e('0x26')](function(){try{fs[_0x264e('0x19')](_0xc4c236);fs[_0x264e('0x27')](_0x3e23dc,_0x264e('0x28'));}catch(_0x2e324b){logger[_0x264e('0x11')](_0x2e324b);}return _0x3e23dc[_0x264e('0x29')]('.')[0x0];});}function base64Encode(_0x51271f){var _0x4577f3=fs[_0x264e('0x2a')](_0x51271f);return new Buffer(_0x4577f3)[_0x264e('0x2b')]('base64');}exports[_0x264e('0x2c')]=function(_0x125e85,_0x4a8d87,_0x41073e,_0x2f08ff,_0x3d9d0d,_0x51ece5){var _0x15fb98,_0x299e15;var _0x20e446=_0x264e('0x2d');var _0x3b37ce=_0x264e('0x2e')+_0x125e85;var _0x54bd0f={};if(_0x4a8d87==='ssml'){_0x54bd0f['input']={'ssml':_0x41073e};}else{_0x54bd0f['input']={'text':_0x41073e};};_0x54bd0f[_0x264e('0x2f')]={'languageCode':_0x2f08ff,'ssmlGender':_0x3d9d0d};_0x54bd0f['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x4e9092={'url':_0x20e446+_0x264e('0x30')+_0x3b37ce,'method':_0x264e('0x31'),'json':!![],'body':_0x54bd0f};return rp(_0x4e9092)[_0x264e('0x26')](function(_0x5e7e91){return new BPromise(function(_0x4d2a62,_0x463498){_0x15fb98=path['resolve'](__dirname,_0x264e('0x23'),rs['generate'](0x4)+'.mp3');var _0x591724=Buffer[_0x264e('0x32')](_0x5e7e91[_0x264e('0x33')],'base64');return fs[_0x264e('0x34')](_0x15fb98,_0x591724,function(_0x28562b){_0x463498(_0x28562b);},function(_0x15c576){fs['chmodSync'](_0x15fb98,_0x264e('0x28'));_0x4d2a62(_0x15c576);});});})[_0x264e('0x26')](function(_0x5a31ed){_0x299e15=path['resolve'](__dirname,_0x264e('0x23'),rs[_0x264e('0x35')](0x4)+_0x264e('0x24'));return convertFile(_0x15fb98,_0x299e15);})[_0x264e('0x26')](function(){try{fs[_0x264e('0x19')](_0x15fb98);fs['chmodSync'](_0x299e15,_0x264e('0x28'));}catch(_0x41c60f){logger[_0x264e('0x11')](_0x41c60f);}logger['info'](_0x264e('0x36'),_0x299e15[_0x264e('0x29')]('.')[0x0]);return _0x299e15[_0x264e('0x29')]('.')[0x0];});};exports[_0x264e('0x37')]=function(_0x5d21fc,_0x197d08){var _0x83c57=_0x264e('0x38');var _0x334c93,_0x5b0853;var _0x16984e;var _0x298890={'encoding':_0x264e('0x39'),'method':'POST','timeout':0x2710,'url':_0x83c57,'headers':{'Content-Type':_0x264e('0x3a')},'body':_0x264e('0x3b')+encodeURIComponent(JSON[_0x264e('0x3c')]([[['jQ1olc',JSON[_0x264e('0x3c')]([_0x5d21fc,_0x197d08||'en',![],_0x264e('0x3d')]),null,_0x264e('0x3e')]]]))};return rp(_0x298890)['then'](function(_0x145e53){try{_0x16984e=eval(_0x145e53['slice'](0x5))[0x0][0x2];}catch(_0xa4ede7){throw new Error('parse\x20response\x20failed:\x0a'+_0x145e53[_0x264e('0x1e')]);}if(!_0x16984e){if(_0x5d21fc[_0x264e('0x3f')]>0xc8){throw new Error(_0x264e('0x40'));}else{throw new Error(_0x264e('0x41')+_0x197d08+_0x264e('0x42'));}}try{_0x16984e=eval(_0x16984e)[0x0];}catch(_0x5ba54b){throw new Error(_0x264e('0x43')+res[_0x264e('0x1e')]);}const _0x1526d7=_0x16984e;_0x334c93=path[_0x264e('0x22')](__dirname,_0x264e('0x23'),rs['generate'](0x4)+_0x264e('0x44'));fs[_0x264e('0x45')](_0x334c93,_0x16984e,{'encoding':_0x264e('0x25')});_0x5b0853=path['resolve'](__dirname,_0x264e('0x23'),rs[_0x264e('0x35')](0x4)+_0x264e('0x24'));return convertFile(_0x334c93,_0x5b0853);})[_0x264e('0x26')](function(){try{fs[_0x264e('0x19')](_0x334c93);fs[_0x264e('0x27')](_0x5b0853,_0x264e('0x28'));}catch(_0x24d40f){logger['error'](_0x24d40f);}logger[_0x264e('0x16')]('goggleTTS\x20path',_0x5b0853[_0x264e('0x29')]('.')[0x0]);return _0x5b0853[_0x264e('0x29')]('.')[0x0];});};exports[_0x264e('0x46')]=function(_0x959b7,_0x5de328,_0x4b9b87){return google[_0x264e('0x47')](_0x959b7,_0x5de328,_0x4b9b87)[_0x264e('0x26')](function(_0x5f4faa){logger[_0x264e('0x16')](_0x5f4faa['uri']);return rp(_0x5f4faa);})[_0x264e('0x26')](function(_0x4ada34){var _0x140f07='';var _0x2e4510=0x0;try{fs['unlink'](_0x959b7);}catch(_0x36e699){logger[_0x264e('0x11')](_0x36e699);}if(_0x4ada34&&_0x4ada34[_0x264e('0x48')]){_0x140f07=_0x4ada34['results'][_0x264e('0x49')](function(_0x588b4b){return _0x588b4b&&_0x588b4b[_0x264e('0x4a')][0x0]&&_0x588b4b[_0x264e('0x4a')][0x0]['transcript']?_0x588b4b[_0x264e('0x4a')][0x0][_0x264e('0x4b')]:'';})[_0x264e('0x4c')]('\x0a');_0x2e4510=_0x4ada34[_0x264e('0x48')][_0x264e('0x49')](function(_0xee1965){return _0xee1965&&_0xee1965[_0x264e('0x4a')][0x0]&&_0xee1965[_0x264e('0x4a')][0x0]['confidence']?_0xee1965[_0x264e('0x4a')][0x0][_0x264e('0x4d')]:0x0;})[_0x264e('0x4c')]('\x0a');}logger['info'](_0x264e('0x4e'),_0x140f07);logger[_0x264e('0x16')](_0x264e('0x4f'),_0x2e4510);return{'transcript':_0x140f07,'confidence':_0x2e4510};})['catch'](function(_0x5d2e6b){logger[_0x264e('0x11')](_0x264e('0x50'),_0x5d2e6b[_0x264e('0x10')],_0x5d2e6b[_0x264e('0x51')],_0x5d2e6b[_0x264e('0x52')]);});};exports[_0x264e('0x53')]=function(_0xb49754,_0xcb9a3a,_0x11606c,_0x348318){var _0x4f0dfd=apiai(_0xcb9a3a,{'language':_0x348318||'en'});return _0x4f0dfd[_0x264e('0x54')](_0x11606c,{'sessionId':md5(_0xb49754)})['then'](function(_0x129571){logger[_0x264e('0x16')](JSON['stringify'](_0x129571));return{'source':_0x129571[_0x264e('0x55')][_0x264e('0x56')],'resolvedQuery':_0x129571['result'][_0x264e('0x57')],'action':_0x129571[_0x264e('0x55')][_0x264e('0x58')],'actionIncomplete':_0x129571[_0x264e('0x55')][_0x264e('0x59')],'speech':_0x129571[_0x264e('0x55')][_0x264e('0x5a')][_0x264e('0x5b')],'score':_0x129571['result'][_0x264e('0x5c')],'statusCode':_0x129571[_0x264e('0x5d')][_0x264e('0x5e')],'endConversation':_0x129571[_0x264e('0x55')][_0x264e('0x5f')][_0x264e('0x60')]||![],'isFallbackIntent':_0x129571['result']['metadata'][_0x264e('0x61')]};});};exports[_0x264e('0x62')]=function(_0x1747ea,_0x59eb3e,_0xabc2e6,_0x59146c,_0x4674a0,_0x36e7dc){var _0x491457=_0x59146c[_0x264e('0x63')](/\\n/g,'\x0a');var _0x1d6c86={'credentials':{'private_key':_0x491457,'client_email':_0xabc2e6}};var _0x41368d=new dialogflow[(_0x264e('0x64'))](_0x1d6c86);var _0x18dbba=_0x41368d[_0x264e('0x65')](_0x59eb3e,md5(_0x1747ea));var _0x50fe76={'session':_0x18dbba,'queryInput':{'text':{'text':_0x4674a0,'languageCode':_0x36e7dc}}};return _0x41368d[_0x264e('0x66')](_0x50fe76)['then'](function(_0x305650){if(_0x305650&&_0x305650[_0x264e('0x3f')]){logger[_0x264e('0x16')](_0x264e('0x67'),JSON[_0x264e('0x3c')](_0x305650));var _0x43764d=_0x305650[0x0];if(_0x43764d){var _0x31e791={'action':_0x43764d[_0x264e('0x68')][_0x264e('0x58')],'allRequiredParamsPresent':_0x43764d[_0x264e('0x68')][_0x264e('0x69')],'endConversation':_0x43764d[_0x264e('0x68')][_0x264e('0x6a')]&&_0x43764d[_0x264e('0x68')][_0x264e('0x6a')]['fields']?_0x43764d[_0x264e('0x68')][_0x264e('0x6a')]['fields'][_0x264e('0x6b')][_0x264e('0x6c')]:![],'fulfillmentText':_0x43764d['queryResult']['fulfillmentText'],'intentName':_0x43764d['queryResult']['intent'][_0x264e('0x51')],'intentDisplayName':_0x43764d[_0x264e('0x68')][_0x264e('0x6d')][_0x264e('0x6e')],'isFallbackIntent':_0x43764d[_0x264e('0x68')][_0x264e('0x6d')][_0x264e('0x6f')],'languageCode':_0x43764d[_0x264e('0x68')]['languageCode'],'queryText':_0x43764d[_0x264e('0x68')][_0x264e('0x70')],'responseId':_0x43764d[_0x264e('0x71')],'score':_0x43764d[_0x264e('0x68')]['intentDetectionConfidence'],'speech':_0x43764d['queryResult'][_0x264e('0x72')],'providerResponse':JSON['stringify'](_0x305650)};return _0x31e791;}}});};exports[_0x264e('0x73')]=function(_0x4efe5d,_0xf00e59,_0x29c7c2,_0x2d607b){return tilde['asr'](_0x4efe5d,_0xf00e59,_0x29c7c2,_0x2d607b)[_0x264e('0x26')](function(_0x431169){try{fs[_0x264e('0x19')](_0x4efe5d);}catch(_0x3d3f12){logger['error'](_0x3d3f12);}logger['info']('Tilde\x20ASR\x20transcription',_0x431169[_0x264e('0x4b')]);logger[_0x264e('0x16')]('Tilde\x20ASR\x20confidence',_0x431169[_0x264e('0x4d')]);return _0x431169;});};exports[_0x264e('0x74')]=function(_0x1358e5,_0x346be5,_0x335b07,_0x36e877,_0x279a59,_0x28f19b){var _0xde83d0=path[_0x264e('0x22')](__dirname,_0x264e('0x23'),rs[_0x264e('0x35')](0x4)+_0x264e('0x44'));var _0x52df6d;return aws[_0x264e('0x75')](_0x1358e5,_0x346be5,_0x335b07,_0x36e877,_0x279a59,_0x28f19b,_0xde83d0)[_0x264e('0x26')](function(){_0x52df6d=path[_0x264e('0x22')](__dirname,_0x264e('0x23'),rs[_0x264e('0x35')](0x4)+_0x264e('0x24'));return convertFile(_0xde83d0,_0x52df6d);})[_0x264e('0x26')](function(){try{fs['unlink'](_0xde83d0);fs['chmodSync'](_0x52df6d,'777');}catch(_0x31ff7d){logger['error'](_0x31ff7d);}return _0x52df6d[_0x264e('0x29')]('.')[0x0];});};exports[_0x264e('0x76')]=function(_0x3ede29,_0x1af20c,_0x2128c4,_0x3134e3,_0x1c3e2b,_0x2ad24e){return aws[_0x264e('0x77')](_0x3ede29,_0x1af20c,_0x2128c4,_0x3134e3,_0x1c3e2b,_0x2ad24e)[_0x264e('0x26')](function(_0x435b81){logger[_0x264e('0x16')](JSON['stringify'](_0x435b81));return _0x435b81;});};exports[_0x264e('0x78')]=function(_0x256adb,_0x26bb35,_0x317374,_0x454d6f){var _0x25ee3a=util[_0x264e('0x79')](_0x264e('0x7a'),ISPEECH_API,_0x256adb,encodeURIComponent(_0x26bb35),_0x317374,_0x454d6f);var _0x440651=path[_0x264e('0x22')](__dirname,_0x264e('0x23'),rs[_0x264e('0x35')](0x4)+_0x264e('0x44'));var _0x2336db;return downloadFile(_0x25ee3a,_0x440651)[_0x264e('0x26')](function(){_0x2336db=path[_0x264e('0x22')](__dirname,_0x264e('0x23'),rs[_0x264e('0x35')](0x4)+'.wav');return convertFile(_0x440651,_0x2336db);})[_0x264e('0x26')](function(){try{fs[_0x264e('0x19')](_0x440651);fs['chmodSync'](_0x2336db,_0x264e('0x28'));}catch(_0x237fd5){logger[_0x264e('0x11')](_0x237fd5);}return _0x2336db[_0x264e('0x29')]('.')[0x0];});};exports[_0x264e('0x7b')]=function(_0x1b0b76,_0x3c0288,_0x30a801,_0x30a97e){var _0x587357=util[_0x264e('0x79')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3c0288,_0x30a801,base64Encode(_0x1b0b76),_0x30a97e?util['format'](_0x264e('0x7c'),encodeURIComponent(_0x30a97e)):_0x264e('0x7d'));return uploadFile(_0x587357)[_0x264e('0x26')](function(_0x5dfe36){return querystring[_0x264e('0x9')](_0x5dfe36);});};exports[_0x264e('0x7e')]=function(_0x3ac874,_0x52c501){return sestek[_0x264e('0x7f')](_0x3ac874,_0x52c501)[_0x264e('0x26')](function(_0x2a1c2f){logger[_0x264e('0x16')](JSON[_0x264e('0x3c')](_0x2a1c2f));var _0x4df242={'speech':_0x2a1c2f[_0x264e('0x80')],'action':_0x2a1c2f[_0x264e('0x81')]?_0x2a1c2f['channelData'][_0x264e('0x82')]:undefined,'actiondata':_0x2a1c2f['channelData']?_0x2a1c2f[_0x264e('0x81')][_0x264e('0x83')]:undefined};if(_0x2a1c2f['channelData']&&_0x2a1c2f[_0x264e('0x81')][_0x264e('0x84')]){return base64Decode(_0x2a1c2f[_0x264e('0x81')][_0x264e('0x84')][_0x264e('0x85')],path[_0x264e('0x22')](__dirname,_0x264e('0x23'),rs[_0x264e('0x35')](0x4)+_0x264e('0x24')))[_0x264e('0x26')](function(_0x3d6baf){_0x4df242[_0x264e('0x86')]=_0x3d6baf;return _0x4df242;});}return _0x4df242;});};exports[_0x264e('0x87')]=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 b22e018..c2b6de3 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 _0xa2de=['./nda','exports'];(function(_0x269e7a,_0x1b342f){var _0x2f76df=function(_0x14847a){while(--_0x14847a){_0x269e7a['push'](_0x269e7a['shift']());}};_0x2f76df(++_0x1b342f);}(_0xa2de,0x188));var _0xea2d=function(_0x27e8b3,_0x3fc162){_0x27e8b3=_0x27e8b3-0x0;var _0x2f772b=_0xa2de[_0x27e8b3];return _0x2f772b;};var nda=require(_0xea2d('0x0'));module[_0xea2d('0x1')]={'nda':nda}; \ No newline at end of file +var _0x9ded=['exports'];(function(_0xf65a11,_0x36475c){var _0x354636=function(_0x485c31){while(--_0x485c31){_0xf65a11['push'](_0xf65a11['shift']());}};_0x354636(++_0x36475c);}(_0x9ded,0x1b1));var _0xd9de=function(_0x24299a,_0x5b9144){_0x24299a=_0x24299a-0x0;var _0x117f96=_0x9ded[_0x24299a];return _0x117f96;};var nda=require('./nda');module[_0xd9de('0x0')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index a96ed81..38e7700 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 _0x9703=['uniqueid','calleridname','dnid','text','Bearer\x20','access_token','project','channelData','ProjectName','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','custom_action_data','info','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','password','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda'];(function(_0x52022b,_0x48548c){var _0x3a2c15=function(_0x585b2e){while(--_0x585b2e){_0x52022b['push'](_0x52022b['shift']());}};_0x3a2c15(++_0x48548c);}(_0x9703,0xdb));var _0x3970=function(_0x232998,_0x345cc2){_0x232998=_0x232998-0x0;var _0x3b23f8=_0x9703[_0x232998];return _0x3b23f8;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x3970('0x0'))(_0x3970('0x1'));module[_0x3970('0x2')]=function(_0x58168c,_0x1fb9af){var _0x5dfa90={'method':_0x3970('0x3'),'uri':url['resolve'](_0x1fb9af[_0x3970('0x4')],_0x3970('0x5')),'form':{'grant_type':'password','username':_0x1fb9af['username'],'password':_0x1fb9af[_0x3970('0x6')]},'json':!![]};return rp(_0x5dfa90)[_0x3970('0x7')](function(_0x282355){var _0x41d4d1={'method':_0x3970('0x3'),'uri':url[_0x3970('0x8')](_0x1fb9af[_0x3970('0x9')],_0x3970('0xa')),'body':{'type':_0x1fb9af['ndaactivity_type']||_0x3970('0xb'),'channelId':_0x3970('0xc'),'conversation':{'id':_0x58168c[_0x3970('0xd')]},'from':{'id':_0x58168c['callerid'],'name':_0x58168c[_0x3970('0xe')]},'recipient':{'id':_0x58168c[_0x3970('0xf')],'name':_0x58168c['extension']},'text':_0x1fb9af[_0x3970('0x10')],'channelData':{}},'headers':{'Authorization':_0x3970('0x11')+_0x282355[_0x3970('0x12')]},'json':!![]};if(_0x1fb9af[_0x3970('0x13')]){_0x41d4d1['body'][_0x3970('0x14')][_0x3970('0x15')]=_0x1fb9af[_0x3970('0x13')];}if(_0x1fb9af[_0x3970('0x16')]=='1'){_0x41d4d1[_0x3970('0x17')][_0x3970('0x14')][_0x3970('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x3970('0x19')};}if(_0x1fb9af['custom_action']){_0x41d4d1[_0x3970('0x17')][_0x3970('0x14')]['CustomAction']=_0x1fb9af[_0x3970('0x1a')];if(_0x1fb9af[_0x3970('0x1b')]){_0x41d4d1['body']['channelData']['CustomActionData']=_0x1fb9af[_0x3970('0x1b')];}}logger[_0x3970('0x1c')](JSON['stringify'](_0x41d4d1));return rp(_0x41d4d1);});}; \ No newline at end of file +var _0xd820=['custom_action_data','info','stringify','request-promise','url','agi','exports','POST','resolve','password','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','callerid','calleridname','dnid','extension','text','project','body','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomActionData'];(function(_0x48ea51,_0x31bd38){var _0xaf73e8=function(_0x342e94){while(--_0x342e94){_0x48ea51['push'](_0x48ea51['shift']());}};_0xaf73e8(++_0x31bd38);}(_0xd820,0x16f));var _0x0d82=function(_0xe30308,_0x434e6c){_0xe30308=_0xe30308-0x0;var _0x493de5=_0xd820[_0xe30308];return _0x493de5;};'use strict';var rp=require(_0x0d82('0x0'));var url=require(_0x0d82('0x1'));var logger=require('../../../../../config/logger')(_0x0d82('0x2'));module[_0x0d82('0x3')]=function(_0x58cb7a,_0x55f08a){var _0x1dfc8b={'method':_0x0d82('0x4'),'uri':url[_0x0d82('0x5')](_0x55f08a['ndauth_url'],'/token'),'form':{'grant_type':_0x0d82('0x6'),'username':_0x55f08a[_0x0d82('0x7')],'password':_0x55f08a[_0x0d82('0x6')]},'json':!![]};return rp(_0x1dfc8b)[_0x0d82('0x8')](function(_0x498585){var _0x36e7b4={'method':_0x0d82('0x4'),'uri':url['resolve'](_0x55f08a['ndassistant_url'],_0x0d82('0x9')),'body':{'type':_0x55f08a[_0x0d82('0xa')]||_0x0d82('0xb'),'channelId':'Nda','conversation':{'id':_0x58cb7a['uniqueid']},'from':{'id':_0x58cb7a[_0x0d82('0xc')],'name':_0x58cb7a[_0x0d82('0xd')]},'recipient':{'id':_0x58cb7a[_0x0d82('0xe')],'name':_0x58cb7a[_0x0d82('0xf')]},'text':_0x55f08a[_0x0d82('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x498585['access_token']},'json':!![]};if(_0x55f08a[_0x0d82('0x11')]){_0x36e7b4[_0x0d82('0x12')][_0x0d82('0x13')]['ProjectName']=_0x55f08a[_0x0d82('0x11')];}if(_0x55f08a[_0x0d82('0x14')]=='1'){_0x36e7b4[_0x0d82('0x12')][_0x0d82('0x13')][_0x0d82('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0d82('0x16')};}if(_0x55f08a[_0x0d82('0x17')]){_0x36e7b4[_0x0d82('0x12')][_0x0d82('0x13')]['CustomAction']=_0x55f08a[_0x0d82('0x17')];if(_0x55f08a['custom_action_data']){_0x36e7b4[_0x0d82('0x12')]['channelData'][_0x0d82('0x18')]=_0x55f08a[_0x0d82('0x19')];}}logger[_0x0d82('0x1a')](JSON[_0x0d82('0x1b')](_0x36e7b4));return rp(_0x36e7b4);});}; \ 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 7ba14ab..57537ab 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 _0x2a4f=['./lib/api'];(function(_0x58fe41,_0x358ea3){var _0x36d743=function(_0x438893){while(--_0x438893){_0x58fe41['push'](_0x58fe41['shift']());}};_0x36d743(++_0x358ea3);}(_0x2a4f,0xfd));var _0xf2a4=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x2a4f[_0x5447fd];return _0x15b28a;};'use strict';var asr=require(_0xf2a4('0x0'));module['exports']=function(_0x371ca9,_0x2bc25a,_0x54e038,_0x2d73fa){return asr(_0x371ca9,_0x2bc25a,_0x54e038,_0x2d73fa);}; \ No newline at end of file +var _0x3ad9=['exports'];(function(_0x29577a,_0x463c67){var _0x601de8=function(_0x2b337b){while(--_0x2b337b){_0x29577a['push'](_0x29577a['shift']());}};_0x601de8(++_0x463c67);}(_0x3ad9,0x142));var _0x93ad=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0x3ad9[_0x26f1b2];return _0x1624a4;};'use strict';var asr=require('./lib/api');module[_0x93ad('0x0')]=function(_0xe333bf,_0x58388f,_0x1efec9,_0x2b9235){return asr(_0xe333bf,_0x58388f,_0x1efec9,_0x2b9235);}; \ 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 f202e26..3b82db7 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 _0xda9e=['Error\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','moment','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','close','EOS','Tilde\x20ASR\x20send\x20error','stringify','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','terminate','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket'];(function(_0x31264d,_0x50b3cc){var _0x333259=function(_0xde7048){while(--_0xde7048){_0x31264d['push'](_0x31264d['shift']());}};_0x333259(++_0x50b3cc);}(_0xda9e,0x7c));var _0xeda9=function(_0x2bc14b,_0x34637b){_0x2bc14b=_0x2bc14b-0x0;var _0x14b2f9=_0xda9e[_0x2bc14b];return _0x14b2f9;};'use strict';var BPromise=require(_0xeda9('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xeda9('0x1'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0xeda9('0x2'));module[_0xeda9('0x3')]=function(_0xc2c01b,_0x1a20fc,_0x494b62,_0x53711b){return new BPromise(function(_0x62b16f,_0x10e1e6){logger[_0xeda9('0x4')]('Tilde\x20URI',_0x53711b||_0xeda9('0x5'));var _0x1bd9e4=new WebSocket(_0x53711b||_0xeda9('0x5'),{'perMessageDeflate':![]});var _0x5e0f0e='';var _0x2965ff='0';var _0xa89e40='1';var _0x2cf11e='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x4f6709(_0x188e38){var _0xca4a64=crypto[_0xeda9('0x6')](_0xeda9('0x7'));_0xca4a64[_0xeda9('0x8')](_0x188e38);return _0xca4a64[_0xeda9('0x9')](_0xeda9('0xa'));}function _0x3cc196(){try{logger['info'](_0xeda9('0xb'));var _0x54935f=moment()[_0xeda9('0xc')]();var _0x10e94b=_0x4f6709(_0x54935f+_0x1a20fc+_0x494b62);_0x1bd9e4[_0xeda9('0xd')](JSON['stringify']({'appID':_0x1a20fc,'timestamp':_0x54935f,'appKey':_0x10e94b}));var _0x383963=fs[_0xeda9('0xe')](_0xc2c01b);_0x383963['on']('data',function(_0x19a69e){_0x1bd9e4[_0xeda9('0xd')](_0x19a69e);});_0x383963['on'](_0xeda9('0xf'),function(){_0x1bd9e4[_0xeda9('0xd')](_0xeda9('0x10'));});}catch(_0x13c2ce){logger['error'](_0xeda9('0x11'),JSON[_0xeda9('0x12')](_0x13c2ce));_0x1bd9e4['terminate']();}}function _0x5aef95(_0x448d81){try{if(_0x448d81){var _0x64de3=JSON[_0xeda9('0x13')](_0x448d81);switch(_0x64de3['status']){case 0x0:if(_0x64de3[_0xeda9('0x14')]){if(_0x64de3['result'][_0xeda9('0x15')]){logger[_0xeda9('0x4')](_0xeda9('0x16'),JSON[_0xeda9('0x12')](_0x64de3[_0xeda9('0x14')]['hypotheses']));_0x5e0f0e=_0x64de3[_0xeda9('0x14')][_0xeda9('0x17')][0x0][_0xeda9('0x18')];_0x2965ff=_0x64de3[_0xeda9('0x14')][_0xeda9('0x17')][0x0][_0xeda9('0x19')];_0xa89e40='0';_0x2cf11e=_0xeda9('0x1a');_0x1bd9e4[_0xeda9('0x1b')]();}}break;case 0x1:logger[_0xeda9('0x4')](_0xeda9('0x1c'));_0xa89e40='1';_0x2cf11e='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info'](_0xeda9('0x1d'));_0xa89e40='2';_0x2cf11e=_0xeda9('0x1d');break;case 0x9:logger[_0xeda9('0x4')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0xa89e40='9';_0x2cf11e=_0xeda9('0x1e');break;case 0xa:logger['info'](_0xeda9('0x1f'));_0xa89e40='10';_0x2cf11e=_0xeda9('0x1f');break;case 0xb:logger[_0xeda9('0x4')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0xa89e40='11';_0x2cf11e=_0xeda9('0x20');}}}catch(_0x398b6e){logger[_0xeda9('0x21')](_0xeda9('0x22'),JSON['stringify'](_0x398b6e));_0x1bd9e4['terminate']();}}function _0x54534c(){logger[_0xeda9('0x4')](_0xeda9('0x23'));_0x62b16f({'transcript':_0x5e0f0e,'confidence':_0x2965ff,'status':_0xa89e40,'status_message':_0x2cf11e});}function _0x4331eb(_0xe4f0fc){logger[_0xeda9('0x21')](_0xeda9('0x24'));if(!_[_0xeda9('0x25')](_0xe4f0fc)){logger['error'](_['isObject'](_0xe4f0fc)?JSON[_0xeda9('0x12')](_0xe4f0fc):_0xe4f0fc);}}_0x1bd9e4['on'](_0xeda9('0x26'),_0x3cc196);_0x1bd9e4['on'](_0xeda9('0x27'),_0x5aef95);_0x1bd9e4['on'](_0xeda9('0xf'),_0x54534c);_0x1bd9e4['on']('error',_0x4331eb);});}; \ No newline at end of file +var _0xe11c=['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','Error\x20Tilde\x20ASR\x20socket','isObject','open','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','EOS','terminate','status','result','final','hypotheses'];(function(_0xa3ef09,_0x258bb2){var _0x2bf419=function(_0x123318){while(--_0x123318){_0xa3ef09['push'](_0xa3ef09['shift']());}};_0x2bf419(++_0x258bb2);}(_0xe11c,0xc4));var _0xce11=function(_0x309073,_0xd406f5){_0x309073=_0x309073-0x0;var _0x1d6691=_0xe11c[_0x309073];return _0x1d6691;};'use strict';var BPromise=require(_0xce11('0x0'));var _=require(_0xce11('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xce11('0x2'));var crypto=require(_0xce11('0x3'));var logger=require(_0xce11('0x4'))(_0xce11('0x5'));module[_0xce11('0x6')]=function(_0x2f0bd1,_0x4085ce,_0x1ce1fa,_0xb540bb){return new BPromise(function(_0x8fd41d,_0x3fba48){logger[_0xce11('0x7')](_0xce11('0x8'),_0xb540bb||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x4b6237=new WebSocket(_0xb540bb||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x4c1fca='';var _0x9f9b3='0';var _0x5cf651='1';var _0x536730=_0xce11('0x9');function _0x2799c1(_0x332807){var _0x342c84=crypto[_0xce11('0xa')](_0xce11('0xb'));_0x342c84['update'](_0x332807);return _0x342c84[_0xce11('0xc')](_0xce11('0xd'));}function _0xb4bf0c(){try{logger[_0xce11('0x7')](_0xce11('0xe'));var _0x388788=moment()[_0xce11('0xf')]();var _0x34a1a6=_0x2799c1(_0x388788+_0x4085ce+_0x1ce1fa);_0x4b6237[_0xce11('0x10')](JSON[_0xce11('0x11')]({'appID':_0x4085ce,'timestamp':_0x388788,'appKey':_0x34a1a6}));var _0x435818=fs['createReadStream'](_0x2f0bd1);_0x435818['on'](_0xce11('0x12'),function(_0x4c8d20){_0x4b6237[_0xce11('0x10')](_0x4c8d20);});_0x435818['on'](_0xce11('0x13'),function(){_0x4b6237[_0xce11('0x10')](_0xce11('0x14'));});}catch(_0x30bbfd){logger['error']('Tilde\x20ASR\x20send\x20error',JSON[_0xce11('0x11')](_0x30bbfd));_0x4b6237[_0xce11('0x15')]();}}function _0x3b31fd(_0xf1dbd){try{if(_0xf1dbd){var _0x53b2b2=JSON['parse'](_0xf1dbd);switch(_0x53b2b2[_0xce11('0x16')]){case 0x0:if(_0x53b2b2['result']){if(_0x53b2b2[_0xce11('0x17')][_0xce11('0x18')]){logger[_0xce11('0x7')]('Tilde\x20ASR\x20hypoteses',JSON[_0xce11('0x11')](_0x53b2b2[_0xce11('0x17')][_0xce11('0x19')]));_0x4c1fca=_0x53b2b2[_0xce11('0x17')][_0xce11('0x19')][0x0]['transcript'];_0x9f9b3=_0x53b2b2[_0xce11('0x17')][_0xce11('0x19')][0x0][_0xce11('0x1a')];_0x5cf651='0';_0x536730=_0xce11('0x1b');_0x4b6237['terminate']();}}break;case 0x1:logger[_0xce11('0x7')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x5cf651='1';_0x536730='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xce11('0x7')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x5cf651='2';_0x536730=_0xce11('0x1c');break;case 0x9:logger[_0xce11('0x7')](_0xce11('0x1d'));_0x5cf651='9';_0x536730=_0xce11('0x1d');break;case 0xa:logger['info'](_0xce11('0x1e'));_0x5cf651='10';_0x536730=_0xce11('0x1e');break;case 0xb:logger[_0xce11('0x7')](_0xce11('0x1f'));_0x5cf651='11';_0x536730=_0xce11('0x1f');}}}catch(_0x1a7fc1){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x1a7fc1));_0x4b6237[_0xce11('0x15')]();}}function _0x34b350(){logger[_0xce11('0x7')](_0xce11('0x20'));_0x8fd41d({'transcript':_0x4c1fca,'confidence':_0x9f9b3,'status':_0x5cf651,'status_message':_0x536730});}function _0x2eacb9(_0x8999cf){logger[_0xce11('0x21')](_0xce11('0x22'));if(!_['isNil'](_0x8999cf)){logger[_0xce11('0x21')](_[_0xce11('0x23')](_0x8999cf)?JSON[_0xce11('0x11')](_0x8999cf):_0x8999cf);}}_0x4b6237['on'](_0xce11('0x24'),_0xb4bf0c);_0x4b6237['on']('message',_0x3b31fd);_0x4b6237['on'](_0xce11('0x13'),_0x34b350);_0x4b6237['on'](_0xce11('0x21'),_0x2eacb9);});}; \ 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 510a114..556a984 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 _0xeef2=['./asr'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xeef2,0x1c4));var _0x2eef=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xeef2[_0x59ee6f];return _0x4c0979;};var asr=require(_0x2eef('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x2a33=['./asr','exports'];(function(_0x984c68,_0x5d104){var _0x4cc1bb=function(_0x118b54){while(--_0x118b54){_0x984c68['push'](_0x984c68['shift']());}};_0x4cc1bb(++_0x5d104);}(_0x2a33,0x8c));var _0x32a3=function(_0x5d95eb,_0x1c9937){_0x5d95eb=_0x5d95eb-0x0;var _0x2224f8=_0x2a33[_0x5d95eb];return _0x2224f8;};var asr=require(_0x32a3('0x0'));module[_0x32a3('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 904b275..6a7db38 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 _0x06c7=['nextTick','inherits','exports','util','events','EventEmitter','./error','./channel','call','emit','error','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close'];(function(_0x4b8f96,_0x1070c6){var _0x7a1edd=function(_0x16cd88){while(--_0x16cd88){_0x4b8f96['push'](_0x4b8f96['shift']());}};_0x7a1edd(++_0x1070c6);}(_0x06c7,0xff));var _0x706c=function(_0x47dbf1,_0x718d6e){_0x47dbf1=_0x47dbf1-0x0;var _0x293c79=_0x06c7[_0x47dbf1];return _0x293c79;};'use strict';var util=require(_0x706c('0x0'));var net=require('net');var EventEmitter=require(_0x706c('0x1'))[_0x706c('0x2')];var AGIError=require(_0x706c('0x3'));var AGIChannel=require(_0x706c('0x4'));var AGIServer=function(_0x2c973b,_0x5718e1,_0x16cccf){var _0x3b9b91=this,_0x2c973b=_0x2c973b||0x11dd,_0x5718e1=_0x5718e1||'127.0.0.1',_0x5e51aa=null,_0x123b6b=0x0;EventEmitter[_0x706c('0x5')](_0x3b9b91);function _0xe27515(){if(!_0x2c973b){_0x3b9b91[_0x706c('0x6')](_0x706c('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x5e51aa=net['createServer']();_0x5e51aa[_0x706c('0x8')](_0x2c973b,_0x5718e1);_0x5e51aa['on'](_0x706c('0x9'),function(){_0x3b9b91['emit'](_0x706c('0x9'));});_0x5e51aa['on'](_0x706c('0xa'),function(_0x305532){_0x5e51aa[_0x706c('0xb')](function(_0x349be8,_0x2a82f7){if(_0x349be8){_0x3b9b91[_0x706c('0x6')](_0x706c('0x7'),new AGIError(_0x706c('0xc'),_0x349be8));}else if(_0x16cccf&&_0x16cccf<0x0){_0x3b9b91[_0x706c('0x6')](_0x706c('0x7'),new AGIError(_0x706c('0xd')));_0x305532[_0x706c('0xe')]();}else if(_0x16cccf&&_0x16cccf>0x0&&_0x16cccf<_0x2a82f7){_0x123b6b+=0x1;_0x3b9b91[_0x706c('0x6')]('error',new AGIError(_0x706c('0xf'),_0x123b6b));_0x305532[_0x706c('0xe')]();}else{var _0x4f9553=new AGIChannel(_0x305532);_0x4f9553['on'](_0x706c('0x10'),function(){_0x3b9b91[_0x706c('0x6')](_0x706c('0xa'),_0x4f9553);});}});});_0x5e51aa['on'](_0x706c('0x7'),function(_0x5e0920){_0x3b9b91[_0x706c('0x6')]('error',new AGIError(_0x706c('0xc'),_0x5e0920['code']));});_0x5e51aa['on'](_0x706c('0x11'),function(){_0x3b9b91[_0x706c('0x6')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x706c('0x12')](function(){_0xe27515();});};util[_0x706c('0x13')](AGIServer,EventEmitter);module[_0x706c('0x14')]=function(_0x28a70e,_0x4d4405,_0x22a963){return new AGIServer(_0x28a70e,_0x4d4405,_0x22a963);}; \ No newline at end of file +var _0xcc0c=['connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening'];(function(_0x186a7f,_0x968867){var _0x18682b=function(_0x3a5e9d){while(--_0x3a5e9d){_0x186a7f['push'](_0x186a7f['shift']());}};_0x18682b(++_0x968867);}(_0xcc0c,0x14c));var _0xccc0=function(_0xed9c99,_0x2217b1){_0xed9c99=_0xed9c99-0x0;var _0x5443a1=_0xcc0c[_0xed9c99];return _0x5443a1;};'use strict';var util=require(_0xccc0('0x0'));var net=require(_0xccc0('0x1'));var EventEmitter=require(_0xccc0('0x2'))[_0xccc0('0x3')];var AGIError=require(_0xccc0('0x4'));var AGIChannel=require(_0xccc0('0x5'));var AGIServer=function(_0x168818,_0x4ef3da,_0x5dac77){var _0x4cf3a2=this,_0x168818=_0x168818||0x11dd,_0x4ef3da=_0x4ef3da||_0xccc0('0x6'),_0x3c67e4=null,_0x57c564=0x0;EventEmitter[_0xccc0('0x7')](_0x4cf3a2);function _0x325b25(){if(!_0x168818){_0x4cf3a2[_0xccc0('0x8')](_0xccc0('0x9'),new AGIError(_0xccc0('0xa')));return![];}_0x3c67e4=net[_0xccc0('0xb')]();_0x3c67e4['listen'](_0x168818,_0x4ef3da);_0x3c67e4['on'](_0xccc0('0xc'),function(){_0x4cf3a2['emit'](_0xccc0('0xc'));});_0x3c67e4['on'](_0xccc0('0xd'),function(_0x58b3ba){_0x3c67e4[_0xccc0('0xe')](function(_0x5d820f,_0x3b8392){if(_0x5d820f){_0x4cf3a2[_0xccc0('0x8')](_0xccc0('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x5d820f));}else if(_0x5dac77&&_0x5dac77<0x0){_0x4cf3a2[_0xccc0('0x8')](_0xccc0('0x9'),new AGIError(_0xccc0('0xf')));_0x58b3ba[_0xccc0('0x10')]();}else if(_0x5dac77&&_0x5dac77>0x0&&_0x5dac77<_0x3b8392){_0x57c564+=0x1;_0x4cf3a2[_0xccc0('0x8')](_0xccc0('0x9'),new AGIError(_0xccc0('0x11'),_0x57c564));_0x58b3ba['destroy']();}else{var _0x3bdecd=new AGIChannel(_0x58b3ba);_0x3bdecd['on']('ready',function(){_0x4cf3a2[_0xccc0('0x8')](_0xccc0('0xd'),_0x3bdecd);});}});});_0x3c67e4['on'](_0xccc0('0x9'),function(_0xa8024f){_0x4cf3a2['emit']('error',new AGIError(_0xccc0('0x12'),_0xa8024f[_0xccc0('0x13')]));});_0x3c67e4['on']('close',function(){_0x4cf3a2[_0xccc0('0x8')](_0xccc0('0x14'),new AGIError(_0xccc0('0x15')));});}process['nextTick'](function(){_0x325b25();});};util['inherits'](AGIServer,EventEmitter);module[_0xccc0('0x16')]=function(_0x3aae4b,_0x1da1a7,_0xd8dd3c){return new AGIServer(_0x3aae4b,_0x1da1a7,_0xd8dd3c);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 823faa9..6f50af2 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 _0x61a5=['Intervals','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','channel','createSquareRecording','calleridname','context','priority','accountcode','arg_1','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','callerid','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','method','timeout','number','includes','POST','PUT','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','isPlainObject','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','scheduledAt','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','no\x20database\x20selected','getSquareOdbc','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','debug','sip_id','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','sestekNDA','SESTEK_NDA_%s','audiofile','streamFile','.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\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','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','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','EVAL\x20CONDITION\x20%s\x20%s','false','interval_id','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','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','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','getVoiceQueue','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','restapi','no\x20url\x20configured','restAPI','Response:','inspect','%s_STATUS_MESSAGE','sayDigits','escape_digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','join','exports','util','shelljs','odbc','moment','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueueById','getSquareProject','getSquareOdbcById','getUser','getUserById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervalById','IntervalId','interval'];(function(_0x50811d,_0x17d91c){var _0x4f1582=function(_0x8450cc){while(--_0x8450cc){_0x50811d['push'](_0x50811d['shift']());}};_0x4f1582(++_0x17d91c);}(_0x61a5,0x19e));var _0x561a=function(_0xffd1b5,_0x1ede18){_0xffd1b5=_0xffd1b5-0x0;var _0x3176d6=_0x61a5[_0xffd1b5];return _0x3176d6;};'use strict';var fs=require('fs');var util=require(_0x561a('0x0'));var _=require('lodash');var sh=require(_0x561a('0x1'));var odbc=require(_0x561a('0x2'))();var rs=require('randomstring');var moment=require(_0x561a('0x3'));var Mustache=require('mustache');var rp=require(_0x561a('0x4'));var logger=require(_0x561a('0x5'))(_0x561a('0x6'));var config=require(_0x561a('0x7'));var shared=require(_0x561a('0x8'));var scripts=require(_0x561a('0x9'));var FILES_PATH=_0x561a('0xa');var recursiveMapAttributes=[_0x561a('0xb'),'rawBody'];var verticesWithRetry=[_0x561a('0xc'),_0x561a('0xd'),_0x561a('0xe')];var AGIVertices=function(_0x5cd4f6,_0x95e2a0,_0x2a0fdb){this['channel']=_0x5cd4f6;this[_0x561a('0xf')]=_0x95e2a0;this[_0x561a('0x10')]=_0x2a0fdb;};AGIVertices[_0x561a('0x11')][_0x561a('0x12')]=function(_0x5f1a15,_0x52759e){this[_0x561a('0xf')][_0x561a('0x13')](_0x5f1a15)[_0x561a('0x14')](function(_0x2ea318){_0x52759e(null,_0x2ea318?_0x2ea318[_0x561a('0x15')]:![]);})[_0x561a('0x16')](function(_0x6ab4df){_0x52759e(_0x6ab4df);});};AGIVertices[_0x561a('0x11')]['getVoiceQueue']=function(_0x15aa0b,_0x29c9c0){this[_0x561a('0xf')][_0x561a('0x17')](_0x15aa0b)['then'](function(_0xd35ad0){_0x29c9c0(null,_0xd35ad0?_0xd35ad0['name']:![]);})[_0x561a('0x16')](function(_0x3a06d3){_0x29c9c0(_0x3a06d3);});};AGIVertices[_0x561a('0x11')][_0x561a('0x18')]=function(_0x340dbc,_0xb777ee){this['rpc']['getSquareProjectById'](_0x340dbc)['then'](function(_0x536472){_0xb777ee(null,_0x536472?_0x536472[_0x561a('0x15')]:![]);})[_0x561a('0x16')](function(_0x1f920e){_0xb777ee(_0x1f920e);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x574430,_0x4552c0){this[_0x561a('0xf')][_0x561a('0x19')](_0x574430)[_0x561a('0x14')](function(_0x42e60b){_0x4552c0(null,_0x42e60b?_0x42e60b['dsn']:![]);})[_0x561a('0x16')](function(_0x374469){_0x4552c0(_0x374469);});};AGIVertices['prototype'][_0x561a('0x1a')]=function(_0xbf17c6,_0x4a038b){this['rpc'][_0x561a('0x1b')](_0xbf17c6)['then'](function(_0x593515){_0x4a038b(null,_0x593515?_0x593515['name']:![]);})['catch'](function(_0x22dfb4){_0x4a038b(_0x22dfb4);});};AGIVertices['prototype']['getTrunk']=function(_0x437bab,_0xcb0e3c){this['rpc']['getTrunkById'](_0x437bab)['then'](function(_0x30657a){_0xcb0e3c(null,_0x30657a?_0x30657a[_0x561a('0x15')]:![]);})['catch'](function(_0x35a1f4){_0xcb0e3c(_0x35a1f4);});};AGIVertices['prototype'][_0x561a('0x1c')]=function(_0x3412b6,_0x19f5e5){var _0x1eea93=this;this[_0x561a('0xf')][_0x561a('0x1d')](_0x3412b6)[_0x561a('0x14')](function(_0x310d40){_0x19f5e5(null,_0x310d40?_0x1eea93[_0x561a('0x1e')](_0x310d40[_0x561a('0x1f')]):![]);})[_0x561a('0x16')](function(_0x1d8948){_0x19f5e5(_0x1d8948);});};AGIVertices['prototype'][_0x561a('0x20')]=function(_0x39fee8,_0x3f98bd){this[_0x561a('0xf')]['getMailAccountById'](_0x39fee8)[_0x561a('0x14')](function(_0x17d557){_0x3f98bd(null,_0x17d557?_0x17d557:![]);})[_0x561a('0x16')](function(_0x264f5f){_0x3f98bd(_0x264f5f);});};AGIVertices[_0x561a('0x11')][_0x561a('0x21')]=function(_0x490cd3,_0x3d5a62,_0x82f608){this[_0x561a('0x10')][_0x561a('0x21')](_0x490cd3,_0x3d5a62)[_0x561a('0x14')](function(){_0x82f608(null);})[_0x561a('0x16')](function(_0x2f81e6){_0x82f608(_0x2f81e6);});};AGIVertices[_0x561a('0x11')]['getIntervals']=function(_0x97a2c7,_0x1131c3){this[_0x561a('0xf')][_0x561a('0x22')](_0x97a2c7)['then'](function(_0x5e8c86){if(_0x5e8c86){if(_0x5e8c86[_0x561a('0x23')]){_0x1131c3(null,[_0x5e8c86[_0x561a('0x24')]]);}else{_0x1131c3(null,_['map'](_0x5e8c86[_0x561a('0x25')],_0x561a('0x24')));}}else{_0x1131c3(null,![]);}})[_0x561a('0x16')](function(_0x3bb322){_0x1131c3(_0x3bb322);});};AGIVertices[_0x561a('0x11')][_0x561a('0x1e')]=function(_0x28e667){return util[_0x561a('0x26')](_0x561a('0x27'),FILES_PATH,_0x28e667);};AGIVertices['prototype']['getQueryOdbc']=function(_0x5b4add,_0x3d3d11,_0x12a631){odbc[_0x561a('0x28')](_0x5b4add,function(_0x52f435){if(_0x52f435){logger[_0x561a('0x29')](_0x561a('0x2a'),_0x52f435);_0x12a631(_0x52f435);}else{logger[_0x561a('0x2b')](_0x561a('0x2c'));odbc[_0x561a('0x2d')](_0x3d3d11,function(_0x3071df,_0x5c59db){if(_0x3071df){logger[_0x561a('0x2b')](_0x561a('0x2e'),_0x3d3d11);_0x12a631(_0x3071df);}else{logger[_0x561a('0x2b')](_0x561a('0x2f'),_0x3d3d11);odbc[_0x561a('0x30')](function(_0x274a7a){if(_0x274a7a){logger[_0x561a('0x29')](_0x561a('0x31'),_0x274a7a);}_0x12a631(null,_0x5c59db);});}});}});};AGIVertices['prototype'][_0x561a('0x32')]=function(_0x4a54ad,_0x4536e8){this[_0x561a('0xf')][_0x561a('0x33')](_0x4a54ad)[_0x561a('0x14')](function(_0x3f28fb){_0x4536e8(null,_0x3f28fb?_0x3f28fb:![]);})['catch'](function(_0x293051){_0x4536e8(_0x293051);});};AGIVertices[_0x561a('0x11')]['createSmsMessage']=function(_0x24076b,_0x4be816){this[_0x561a('0xf')][_0x561a('0x34')](_0x24076b)[_0x561a('0x14')](function(_0x2720b0){_0x4be816(null,_0x2720b0);})[_0x561a('0x16')](function(_0x116031){_0x4be816(_0x116031);});};AGIVertices[_0x561a('0x11')][_0x561a('0x35')]=function(_0x566cda,_0x1ec09c,_0x362f63){this[_0x561a('0xf')][_0x561a('0x35')]({'uniqueid':this['channel'][_0x561a('0x36')],'node':_0x566cda[_0x561a('0x37')],'application':_0x566cda[_0x561a('0x38')],'data':_0x1ec09c||null,'project_name':this[_0x561a('0x39')]['arg_1'],'callerid':this[_0x561a('0x39')]['callerid']})[_0x561a('0x14')](function(_0x4847e7){if(_0x362f63){_0x362f63(null,_0x4847e7);}})[_0x561a('0x16')](function(_0x2f814d){if(_0x362f63){_0x362f63(_0x2f814d);}});};AGIVertices[_0x561a('0x11')]['createSquareRecording']=function(_0x5d41f1,_0x3315d1,_0x3c2bb7,_0x1bd528){this[_0x561a('0xf')][_0x561a('0x3a')]({'uniqueid':this[_0x561a('0x39')]['uniqueid'],'callerid':this[_0x561a('0x39')]['callerid'],'calleridname':this[_0x561a('0x39')][_0x561a('0x3b')],'context':this[_0x561a('0x39')][_0x561a('0x3c')],'extension':this[_0x561a('0x39')]['extension'],'priority':this[_0x561a('0x39')][_0x561a('0x3d')],'accountcode':this[_0x561a('0x39')][_0x561a('0x3e')],'dnid':this[_0x561a('0x39')]['dnid'],'projectName':this[_0x561a('0x39')][_0x561a('0x3f')],'saveName':_0x3315d1,'filename':_0x5d41f1['file']||_0x3315d1,'savePath':_0x3c2bb7})[_0x561a('0x14')](function(_0x1b96dd){_0x1bd528(null,_0x1b96dd);})['catch'](function(_0x426c71){_0x1bd528(_0x426c71);});};AGIVertices['prototype'][_0x561a('0x40')]=function(_0x21f0ba,_0x4dea87,_0x34ea92,_0x80b59e,_0x168135){this['rpc'][_0x561a('0x40')]({'uniqueid':this['channel'][_0x561a('0x36')],'body':_0x21f0ba,'direction':_0x4dea87,'providerName':_0x34ea92,'providerResponse':_0x80b59e})[_0x561a('0x14')](function(_0x3f4757){if(_0x168135){_0x168135(null,_0x3f4757);}})['catch'](function(_0x41c75a){if(_0x168135){_0x168135(_0x41c75a);}});};AGIVertices[_0x561a('0x11')][_0x561a('0x41')]=function(_0x3d2acc,_0x1f9ccb){this[_0x561a('0xf')][_0x561a('0x41')]({'firstName':_[_0x561a('0x42')](_0x3d2acc['name'])||_[_0x561a('0x43')](_0x3d2acc[_0x561a('0x15')])?'callback_'+Math[_0x561a('0x44')]():_0x3d2acc[_0x561a('0x15')],'lastName':_['isEmpty'](_0x3d2acc[_0x561a('0x45')])||_[_0x561a('0x43')](_0x3d2acc[_0x561a('0x45')])?null:_0x3d2acc[_0x561a('0x45')],'phone':_0x3d2acc[_0x561a('0x46')],'ListId':_0x3d2acc[_0x561a('0x47')],'scheduledat':_0x3d2acc['scheduledAt'],'callbackUniqueid':this[_0x561a('0x39')][_0x561a('0x36')],'tags':_0x561a('0x48'),'description':_0x561a('0x49')+_0x3d2acc['scheduledAt'][_0x561a('0x4a')](),'priority':_0x3d2acc[_0x561a('0x4b')]})[_0x561a('0x14')](function(_0xa0ac76){_0x1f9ccb(null,_0xa0ac76);})[_0x561a('0x16')](function(_0x5bd19c){_0x1f9ccb(_0x5bd19c);});};AGIVertices[_0x561a('0x11')][_0x561a('0x4c')]=function(_0x58ba32,_0xff6f00){this[_0x561a('0xf')][_0x561a('0x4d')](_0x58ba32)[_0x561a('0x14')](function(_0x43c90c){_0xff6f00(null,_0x43c90c?_0x43c90c[_0x561a('0x15')]:![]);})[_0x561a('0x16')](function(_0x262056){_0xff6f00(_0x262056);});};AGIVertices[_0x561a('0x11')][_0x561a('0x4e')]=function(_0x4159af,_0x29f1ed,_0x1dad4a){var _0x5b9452={'role':_0x561a('0x4f')};_0x5b9452[_0x4159af]=this[_0x561a('0x39')][_0x561a('0x50')];this[_0x561a('0xf')][_0x561a('0x4e')](_0x5b9452,_0x29f1ed,this[_0x561a('0x39')]['uniqueid'])[_0x561a('0x14')](function(_0x4c0e69){_0x1dad4a(null,_[_0x561a('0x43')](_0x4c0e69)?![]:!![]);})[_0x561a('0x16')](function(_0x3ca5fe){logger[_0x561a('0x29')](_0x3ca5fe);_0x1dad4a(null,![]);});};AGIVertices[_0x561a('0x11')][_0x561a('0x51')]=function(_0x4ff7a7,_0x5b27b5){var _0x1f8f44={'role':_0x561a('0x4f')};_0x1f8f44[_0x4ff7a7]=this[_0x561a('0x39')][_0x561a('0x50')];this[_0x561a('0xf')][_0x561a('0x51')](_0x1f8f44)[_0x561a('0x14')](function(_0x2c23b8){_0x5b27b5(null,_['isNil'](_0x2c23b8)?![]:!![]);})['catch'](function(_0x37bf48){logger[_0x561a('0x29')](_0x37bf48);_0x5b27b5(null,![]);});};AGIVertices['prototype'][_0x561a('0x52')]=function(_0x1dcaa1,_0x5842fd){var _0x4c2753={'role':_0x561a('0x4f')};_0x4c2753[_0x1dcaa1]=this[_0x561a('0x39')]['callerid'];this[_0x561a('0xf')][_0x561a('0x52')](_0x4c2753)['then'](function(_0x5ea01f){_0x5842fd(null,_[_0x561a('0x43')](_0x5ea01f)?![]:!![]);})[_0x561a('0x16')](function(_0x506815){logger[_0x561a('0x29')](_0x506815);_0x5842fd(null,![]);});};AGIVertices[_0x561a('0x11')][_0x561a('0x53')]=function(_0x518836,_0x27e3b7){var _0x507388={'role':'agent'};_0x507388[_0x518836]=this[_0x561a('0x39')]['callerid'];var _0x5365b1=_0x518836!=_0x561a('0x54')?util[_0x561a('0x26')](_0x561a('0x55'),_0x561a('0x56'),this[_0x561a('0x39')]['callerid']):undefined;this[_0x561a('0xf')]['agentLogin'](_0x507388,_0x5365b1)['then'](function(_0x1fea6e){_0x27e3b7(null,_[_0x561a('0x43')](_0x1fea6e)?![]:!![]);})[_0x561a('0x16')](function(_0x4a8d07){logger[_0x561a('0x29')](_0x4a8d07);_0x27e3b7(null,![]);});};AGIVertices['prototype'][_0x561a('0x57')]=function(_0x24c819,_0x5bf6ee){sh[_0x561a('0x58')](_[_0x561a('0x59')](_0x24c819),function(_0x41596e,_0xcf2109){var _0xd0ee36=_0xcf2109[_0x561a('0x5a')](/(\r\n|\n|\r)/gm,'');_0x5bf6ee(null,_0xd0ee36);});};AGIVertices[_0x561a('0x11')][_0x561a('0x5b')]=function(_0x28f36b,_0x1c3def){scripts[_0x561a('0x5b')](_0x28f36b['apiKey'],_0x28f36b[_0x561a('0x5c')]||'text',_0x28f36b[_0x561a('0x5d')],_0x28f36b[_0x561a('0x5e')]||_0x561a('0x5f'),_0x28f36b['ssmlGender']||_0x561a('0x60'),_0x28f36b[_0x561a('0x61')]||_0x561a('0x62'))[_0x561a('0x14')](function(_0x180060){_0x1c3def(null,_0x180060);})['catch'](function(_0x1c7537){_0x1c3def(_0x1c7537);});};AGIVertices['prototype'][_0x561a('0x63')]=function(_0x38856d,_0x5f1c33){scripts[_0x561a('0x63')](_0x38856d['text'],_0x38856d[_0x561a('0x64')]||'en',0x1)[_0x561a('0x14')](function(_0x31df02){_0x5f1c33(null,_0x31df02);})[_0x561a('0x16')](function(_0x2820d1){_0x5f1c33(_0x2820d1);});};AGIVertices[_0x561a('0x11')]['restAPI']=function(_0x592ef7,_0x175b8b){var _0xe3a568={'uri':_0x592ef7['url'],'method':_0x592ef7[_0x561a('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x592ef7[_0x561a('0x66')])===_0x561a('0x67')&&parseInt(_0x592ef7[_0x561a('0x66')])>=0x1?parseInt(_0x592ef7['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x561a('0x68')]([_0x561a('0x69'),_0x561a('0x6a')],_0xe3a568[_0x561a('0x65')][_0x561a('0x6b')]())){try{_0xe3a568[_0x561a('0x6c')]=_0x592ef7[_0x561a('0x6d')]?JSON[_0x561a('0x6e')](_0x592ef7[_0x561a('0x6d')]):{};}catch(_0x2ddb55){logger['error'](_0x561a('0x6f'),_0x2ddb55);}}try{_0xe3a568[_0x561a('0x70')]=_0x592ef7[_0x561a('0xb')]?JSON[_0x561a('0x6e')](_0x592ef7['rawHeaders']):{};}catch(_0x2c7991){logger[_0x561a('0x29')](_0x561a('0x71'),_0x2c7991);}if(_0x592ef7[_0x561a('0x72')]){try{var _0x57ca83=require(_0x592ef7[_0x561a('0x72')])[_0x561a('0x73')](this,_0xe3a568);_0xe3a568[_0x561a('0x74')]=Mustache[_0x561a('0x75')](_0x592ef7[_0x561a('0x76')],_0x57ca83,{},['$$','$$']);if(_0xe3a568[_0x561a('0x70')]){_0xe3a568[_0x561a('0x70')]=JSON[_0x561a('0x6e')](Mustache['render'](JSON[_0x561a('0x77')](_0xe3a568[_0x561a('0x70')]),_0x57ca83,{},['$$','$$']));}if(_0xe3a568[_0x561a('0x6c')]){_0xe3a568[_0x561a('0x6c')]=JSON[_0x561a('0x6e')](Mustache[_0x561a('0x75')](JSON[_0x561a('0x77')](_0xe3a568['body']),_0x57ca83,{},['$$','$$']));}}catch(_0x1a8d3d){logger[_0x561a('0x29')](_0x561a('0x78'),_0x1a8d3d);}}rp(_0xe3a568)[_0x561a('0x14')](function(_0x593158){var _0x76a34={'statusCode':_0x593158[_0x561a('0x79')]||0xc8,'statusMessage':_0x593158[_0x561a('0x7a')]||'OK','headers':_0x593158['headers']||{},'body':_0x593158[_0x561a('0x6c')]||{}};_0x175b8b(null,_0x76a34);})[_0x561a('0x16')](function(_0x5aacbe){var _0xf591be={'statusCode':_0x5aacbe['statusCode']||0x1f4,'statusMessage':_0x5aacbe[_0x561a('0x7b')]||_0x561a('0x7c'),'headers':_0x5aacbe['options'][_0x561a('0x70')]||{},'body':_0x5aacbe[_0x561a('0x7d')]['body']||{}};_0x175b8b(null,_0xf591be);});};AGIVertices[_0x561a('0x11')][_0x561a('0x7e')]=function(_0x2da59f,_0x322316){scripts[_0x561a('0x7e')](this[_0x561a('0x39')]['uniqueid'],_0x2da59f[_0x561a('0x7f')],_0x2da59f[_0x561a('0x5d')],_0x2da59f[_0x561a('0x80')]||'en')[_0x561a('0x14')](function(_0x4e7514){_0x322316(null,_0x4e7514);})[_0x561a('0x16')](function(_0x528917){_0x322316(_0x528917);});};AGIVertices[_0x561a('0x11')]['googleDialogflowV2']=function(_0x1abad8,_0x109736){scripts[_0x561a('0x81')](this[_0x561a('0x39')][_0x561a('0x36')],_0x1abad8['dialogflowV2_project_id'],_0x1abad8[_0x561a('0x82')],_0x1abad8[_0x561a('0x83')],_0x1abad8['text'],_0x1abad8['dialogflowV2_language']||'en')['then'](function(_0x503c09){_0x109736(null,_0x503c09);})[_0x561a('0x16')](function(_0x849b26){_0x109736(_0x849b26);});};AGIVertices[_0x561a('0x11')]['sestekNDA']=function(_0x164450,_0x1bef28){scripts['sestekNDA'](this['channel'],_0x164450)[_0x561a('0x14')](function(_0x2d6245){_0x1bef28(null,_0x2d6245);})[_0x561a('0x16')](function(_0x4f9806){_0x1bef28(_0x4f9806);});};AGIVertices[_0x561a('0x11')][_0x561a('0x84')]=function(_0x22bfd6,_0x239dcf){scripts[_0x561a('0x84')](_0x22bfd6[_0x561a('0x7f')],_0x22bfd6[_0x561a('0x5d')],_0x22bfd6[_0x561a('0x85')]||'en-US',_0x22bfd6[_0x561a('0x86')])[_0x561a('0x14')](function(_0x2fb47a){_0x239dcf(null,_0x2fb47a);})[_0x561a('0x16')](function(_0x3f742f){_0x239dcf(_0x3f742f);});};AGIVertices[_0x561a('0x11')][_0x561a('0x87')]=function(_0x38680c,_0x2957b7,_0x369e96){scripts[_0x561a('0x87')](_0x2957b7,_0x38680c[_0x561a('0x7f')],_0x38680c[_0x561a('0x88')]||_0x561a('0x5f'),this[_0x561a('0x89')](_0x38680c[_0x561a('0x8a')])?_0x38680c[_0x561a('0x8a')]:undefined)[_0x561a('0x14')](function(_0x40dcd0){_0x369e96(null,_0x40dcd0);})[_0x561a('0x16')](function(_0x477c83){_0x369e96(_0x477c83);});};AGIVertices[_0x561a('0x11')][_0x561a('0x8b')]=function(_0x82ac18,_0x523913){scripts[_0x561a('0x8b')](_0x82ac18[_0x561a('0x8c')],_0x82ac18[_0x561a('0x8d')],_0x82ac18[_0x561a('0x8e')],_0x82ac18[_0x561a('0x8f')]||'Amy',_0x82ac18[_0x561a('0x5d')],_0x82ac18[_0x561a('0x90')]||_0x561a('0x5d'))['then'](function(_0x2aed47){_0x523913(null,_0x2aed47);})[_0x561a('0x16')](function(_0x189069){_0x523913(_0x189069);});};AGIVertices['prototype'][_0x561a('0x91')]=function(_0x47fb84,_0x41e763){scripts[_0x561a('0x91')](this[_0x561a('0x39')][_0x561a('0x36')],_0x47fb84[_0x561a('0x8c')],_0x47fb84[_0x561a('0x8d')],_0x47fb84[_0x561a('0x92')],_0x47fb84['text'],_0x47fb84['aws_bot_name'])[_0x561a('0x14')](function(_0x3dfa1b){_0x41e763(null,_0x3dfa1b);})[_0x561a('0x16')](function(_0x1fae80){_0x41e763(_0x1fae80);});};AGIVertices[_0x561a('0x11')][_0x561a('0x93')]=function(_0x2ca44e,_0x2107e3,_0x356d17){scripts[_0x561a('0x93')](_0x2107e3,_0x2ca44e[_0x561a('0x7f')],_0x2ca44e[_0x561a('0x94')]||_0x561a('0x5f'))['then'](function(_0x154de8){_0x356d17(null,_0x154de8);})[_0x561a('0x16')](function(_0x370633){_0x356d17(_0x370633);});};AGIVertices[_0x561a('0x11')][_0x561a('0x95')]=function(_0x44a132,_0x154c6b,_0x8043c6){scripts[_0x561a('0x95')](_0x154c6b,_0x44a132[_0x561a('0x96')],_0x44a132['appsecret'],_0x44a132[_0x561a('0x74')])[_0x561a('0x14')](function(_0xb265b5){_0x8043c6(null,_0xb265b5);})[_0x561a('0x16')](function(_0x733610){_0x8043c6(_0x733610);});};AGIVertices['prototype']['clear']=function(_0x4e3593){var _0x540b93=_[_0x561a('0x68')](verticesWithRetry,_0x4e3593[_0x561a('0x38')])?_0x4e3593:_[_0x561a('0x97')](_0x4e3593);for(var _0x4025b1 in _0x540b93){if(_0x540b93[_0x561a('0x98')](_0x4025b1)){if(_0x540b93[_0x4025b1]&&_[_0x561a('0x99')](_0x540b93[_0x4025b1])){if(_[_0x561a('0x68')](recursiveMapAttributes,_0x4025b1)){_0x540b93[_0x4025b1]=this[_0x561a('0x9a')](_0x540b93[_0x4025b1]);}else{_0x540b93[_0x4025b1]=this[_0x561a('0x9b')](_0x540b93[_0x4025b1]);}}}}return _0x540b93;};AGIVertices['prototype']['recursiveNodeIndex']=function(_0x14f0bc){for(var _0x476e1f in _0x14f0bc){if(_0x14f0bc[_0x561a('0x98')](_0x476e1f)){if(_['isPlainObject'](_0x14f0bc[_0x476e1f])){this[_0x561a('0x9c')](_0x14f0bc[_0x476e1f]);}else if(_[_0x561a('0x9d')](_0x14f0bc[_0x476e1f])){for(var _0x277201=0x0;_0x277201<_0x14f0bc[_0x476e1f][_0x561a('0x9e')];_0x277201++){this[_0x561a('0x9c')](_0x14f0bc[_0x476e1f][_0x277201]);}}else if(_[_0x561a('0x99')](_0x14f0bc[_0x476e1f])){_0x14f0bc[_0x476e1f]=this[_0x561a('0x9b')](_0x14f0bc[_0x476e1f]);}}}};AGIVertices[_0x561a('0x11')]['saveRestApiResult']=function(_0x5a3839,_0x3f44fc){for(var _0x3c5b36 in _0x5a3839){if(_0x5a3839[_0x561a('0x98')](_0x3c5b36)){if(_[_0x561a('0x9f')](_0x5a3839[_0x3c5b36])){if(!_['isEmpty'](_0x5a3839[_0x3c5b36])){this['saveRestApiResult'](_0x5a3839[_0x3c5b36],util[_0x561a('0x26')]('%s.%s',_0x3f44fc,_0x3c5b36));}}else if(_[_0x561a('0x9d')](_0x5a3839[_0x3c5b36])){for(var _0x34d739=0x0;_0x34d739<_0x5a3839[_0x3c5b36][_0x561a('0x9e')];_0x34d739++){this[_0x561a('0xa0')](_0x5a3839[_0x3c5b36][_0x34d739],util[_0x561a('0x26')](_0x561a('0xa1'),_0x3f44fc,_0x3c5b36+'['+_0x34d739+']'));}}else{if(!_[_0x561a('0x43')](_0x5a3839[_0x3c5b36])){this[_0x561a('0x39')][_0x561a('0xa2')](util[_0x561a('0x26')]('%s.%s',_0x3f44fc,_0x3c5b36),_0x5a3839[_0x3c5b36]);}}}}};AGIVertices[_0x561a('0x11')][_0x561a('0x9a')]=function(_0x501673){try{var _0x4ceab1=JSON['parse'](_0x501673);this[_0x561a('0x9c')](_0x4ceab1);return JSON[_0x561a('0x77')](_0x4ceab1);}catch(_0x4717ac){return this[_0x561a('0x9b')](_0x501673);}};AGIVertices[_0x561a('0x11')][_0x561a('0x9b')]=function(_0x3c1089){var _0x2b1b38=_0x3c1089[_0x561a('0xa3')]('{');for(var _0x330faa=0x1;_0x330faa<_0x2b1b38['length'];_0x330faa+=0x1){var _0x53edd0=_0x2b1b38[_0x330faa]['split']('}');if(_0x53edd0['length']>0x1){_0x3c1089=_0x3c1089[_0x561a('0xa4')]('{'+_0x53edd0[0x0]+'}',this[_0x561a('0x39')][_0x561a('0x12')](_0x53edd0[0x0])[_0x561a('0xa5')]||_0x53edd0[0x0]);}}if(_0x2b1b38[_0x561a('0x9e')]===0x1){return _0x3c1089[_0x561a('0x4a')]();}return this['replaceAllVariables'](_0x3c1089);};AGIVertices[_0x561a('0x11')][_0x561a('0xa6')]=function(_0x5e9bc9,_0x512749){var _0x101760=this['channel']['getVariable'](_0x5e9bc9);if(_0x101760[_0x561a('0xa7')]===-0x1){return _0x101760;}logger['info'](util[_0x561a('0x26')](_0x561a('0xa8'),_0x512749,_0x101760[_0x561a('0xa5')]));return this['channel']['setVariable'](_0x512749,_0x101760[_0x561a('0xa5')]);};AGIVertices[_0x561a('0x11')][_0x561a('0x89')]=function(_0x2e10f3){return _0x2e10f3&&_0x2e10f3!=='0'&&_0x2e10f3!=='-1'&&_0x2e10f3!=='';};AGIVertices[_0x561a('0x11')]['maxRetry']=function(_0x1c51f7){this[_0x561a('0x35')][_0x561a('0x73')](this,_0x1c51f7,'-');_0x1c51f7[_0x561a('0xa9')]=_0x1c51f7[_0x561a('0xaa')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x561a('0x11')][_0x561a('0xab')]=function(_0x244587){logger[_0x561a('0x2b')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x244587[_0x561a('0x37')]));if(!this['isConfigured'](_0x244587[_0x561a('0x5d')])){return this['channel'][_0x561a('0xac')](_0x561a('0xad'));}var _0x23c838='\x22'+_0x244587['text']+'\x22';if(this[_0x561a('0x89')](_0x244587[_0x561a('0x7d')])){_0x23c838+=','+_0x244587[_0x561a('0x7d')];}var _0x2c84d5=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0xae'),_0x23c838);if(_0x2c84d5['result']===-0x1){return _0x2c84d5;}return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xaf'),_0x23c838));};AGIVertices[_0x561a('0x11')][_0x561a('0xb0')]=function(_0x409c29){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0xb1'),_0x409c29['label']));if(!this[_0x561a('0x89')](_0x409c29[_0x561a('0xb2')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xb3'));}var _0x55990d=_0x409c29['grammar'];if(this[_0x561a('0x89')](_0x409c29['options'])){_0x55990d+=','+_0x409c29['options'];}var _0x2e89f6=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0xb4'),_0x55990d);if(_0x2e89f6[_0x561a('0xa7')]===-0x1){return _0x2e89f6;}var _0x4541c0=this[_0x561a('0xa6')](_0x561a('0xb5'),_0x561a('0xb6'));if(_0x4541c0[_0x561a('0xa7')]===-0x1){return _0x4541c0;}var _0x18ae66=this[_0x561a('0xa6')](_0x561a('0xb7'),_0x561a('0xb8'));if(_0x18ae66[_0x561a('0xa7')]===-0x1){return _0x18ae66;}var _0x5956b6=this[_0x561a('0xa6')](_0x561a('0xb9'),'MRCP_RECOG_INSTANCE');if(_0x5956b6[_0x561a('0xa7')]===-0x1){return _0x5956b6;}return this['channel']['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x55990d));};AGIVertices['prototype'][_0x561a('0x6')]=function(_0x55a6f2){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0xba'),_0x55a6f2[_0x561a('0x37')]));return this[_0x561a('0x39')]['agi']([_0x55a6f2[_0x561a('0xbb')],_0x55a6f2[_0x561a('0xbc')]]);};AGIVertices[_0x561a('0x11')][_0x561a('0xbd')]=function(_0x1992ce){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x1992ce[_0x561a('0x37')]));if(this[_0x561a('0x89')](_0x1992ce['timeout'])){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0xbe'),_0x1992ce[_0x561a('0x66')]));var _0x393f4=this[_0x561a('0x39')]['wait'](_0x1992ce[_0x561a('0x66')]);if(_0x393f4['result']===-0x1){return _0x393f4;}}return this[_0x561a('0x39')][_0x561a('0xbd')]();};AGIVertices[_0x561a('0x11')][_0x561a('0x48')]=function(_0x2cb78d){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0xbf'),_0x2cb78d[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x2cb78d[_0x561a('0x47')])){return this[_0x561a('0x39')]['error'](_0x2cb78d,_0x561a('0xc0'));}_0x2cb78d[_0x561a('0xc1')]=moment();if(this[_0x561a('0x89')](_0x2cb78d[_0x561a('0xc2')])){_0x2cb78d['scheduledAt']=moment()[_0x561a('0xc3')](_0x2cb78d[_0x561a('0xc2')],_0x561a('0xc4'));}if(!this[_0x561a('0x89')](_0x2cb78d[_0x561a('0x4b')])){_0x2cb78d[_0x561a('0x4b')]=0x2;}this[_0x561a('0x41')]['sync'](this,_0x2cb78d);return this['channel'][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xc5'),_0x2cb78d['phone'],_0x2cb78d[_0x561a('0x47')],_0x2cb78d[_0x561a('0xc1')]));};AGIVertices[_0x561a('0x11')][_0x561a('0xc6')]=function(_0x39f349){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x39f349[_0x561a('0x37')]));var _0x1da3b4=this[_0x561a('0x39')]['exec'](_0x39f349['application'],_0x39f349[_0x561a('0x7d')]);if(_0x1da3b4[_0x561a('0xa7')]===-0x1){return _0x1da3b4;}return this[_0x561a('0x39')]['noop'](util['format'](_0x561a('0xc7'),_0x39f349[_0x561a('0xc8')],_0x39f349[_0x561a('0x7d')]));};AGIVertices[_0x561a('0x11')][_0x561a('0xc9')]=function(_0x53b68e){logger['info'](util[_0x561a('0x26')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x53b68e[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x53b68e[_0x561a('0x5d')])){return this[_0x561a('0x39')][_0x561a('0xac')]('no\x20text\x20configured');}var _0x584a0c='\x22'+_0x53b68e['text']+'\x22';if(this[_0x561a('0x89')](_0x53b68e[_0x561a('0x7d')])){_0x584a0c+=','+_0x53b68e[_0x561a('0x7d')];}var _0x51e958=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0xae'),_0x584a0c);if(_0x51e958[_0x561a('0xa7')]===-0x1){return _0x51e958;}return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xaf'),_0x584a0c));};AGIVertices[_0x561a('0x11')][_0x561a('0xca')]=function(_0x38ef71){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0xcb'),_0x38ef71[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x38ef71['text'])){return this[_0x561a('0x39')][_0x561a('0xac')]('no\x20text\x20configured');}var _0x342ea1='\x22'+_0x38ef71[_0x561a('0x5d')]+'\x22';if(this['isConfigured'](_0x38ef71[_0x561a('0x7d')])){_0x342ea1+=','+_0x38ef71[_0x561a('0x7d')];}var _0x431999=this['channel'][_0x561a('0x58')](_0x561a('0xae'),_0x342ea1);if(_0x431999[_0x561a('0xa7')]===-0x1){return _0x431999;}return this[_0x561a('0x39')]['noop'](util['format'](_0x561a('0xaf'),_0x342ea1));};AGIVertices[_0x561a('0x11')][_0x561a('0xcc')]=function(_0x373928){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0xcd'),_0x373928['label']));if(!this[_0x561a('0x89')](_0x373928['grammar'])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xb3'));}var _0x1217f3=_0x373928['grammar'];if(this[_0x561a('0x89')](_0x373928[_0x561a('0x7d')])){_0x1217f3+=','+_0x373928[_0x561a('0x7d')];}var _0x5496ac=this[_0x561a('0x39')]['exec'](_0x561a('0xb4'),_0x1217f3);if(_0x5496ac['result']===-0x1){return _0x5496ac;}var _0x4fa237=this[_0x561a('0xa6')]('RECOG_CONFIDENCE()',_0x561a('0xce'));if(_0x4fa237[_0x561a('0xa7')]===-0x1){return _0x4fa237;}var _0x22f276=this[_0x561a('0xa6')](_0x561a('0xb7'),_0x561a('0xcf'));if(_0x22f276[_0x561a('0xa7')]===-0x1){return _0x22f276;}var _0x3295bf=this[_0x561a('0xa6')](_0x561a('0xb9'),_0x561a('0xd0'));if(_0x3295bf['result']===-0x1){return _0x3295bf;}return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xd1'),_0x1217f3));};AGIVertices[_0x561a('0x11')]['sestekasr']=function(_0x574707){logger['info'](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x574707[_0x561a('0x37')]));if(!this['isConfigured'](_0x574707[_0x561a('0xb2')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xb3'));}var _0x25fa6e=_0x574707[_0x561a('0xb2')];if(this[_0x561a('0x89')](_0x574707[_0x561a('0x7d')])){_0x25fa6e+=','+_0x574707[_0x561a('0x7d')];}var _0x956e62=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0xb4'),_0x25fa6e);if(_0x956e62['result']===-0x1){return _0x956e62;}var _0x4add75=this['getAndSetVariable'](_0x561a('0xb5'),_0x561a('0xd2'));if(_0x4add75[_0x561a('0xa7')]===-0x1){return _0x4add75;}var _0xe6ae42=this[_0x561a('0xa6')](_0x561a('0xb7'),_0x561a('0xd3'));if(_0xe6ae42[_0x561a('0xa7')]===-0x1){return _0xe6ae42;}var _0x317b8a=this[_0x561a('0xa6')](_0x561a('0xb9'),'SESTEK_ASR_INSTANCE');if(_0x317b8a[_0x561a('0xa7')]===-0x1){return _0x317b8a;}return this['channel'][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xd1'),_0x25fa6e));};AGIVertices['prototype'][_0x561a('0xd4')]=function(_0x1012c){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x1012c[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x1012c['odbc_id'])){return this[_0x561a('0x39')]['error'](_0x1012c,_0x561a('0xd5'));}var _0x562299=this[_0x561a('0xd6')][_0x561a('0x73')](this,_0x1012c[_0x561a('0xd7')]);if(!_0x562299){return this[_0x561a('0x39')][_0x561a('0x29')](_0x1012c,_0x561a('0xd8'));}if(!this['isConfigured'](_0x1012c[_0x561a('0x2d')])){return this['channel'][_0x561a('0x29')](_0x1012c,_0x561a('0xd9'));}var _0x24724c=_0x1012c[_0x561a('0x2d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xda'),_0x24724c));var _0x6030a1=this['getQueryOdbc'][_0x561a('0x73')](this,_0x562299,_0x24724c);this[_0x561a('0x35')][_0x561a('0x73')](this,_0x1012c,_0x24724c);if(!this[_0x561a('0x89')](_0x1012c[_0x561a('0xdb')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xdc'));}var _0x47df54=this['getVariable'][_0x561a('0x73')](this,_0x1012c[_0x561a('0xdb')]);if(!_0x47df54){return this[_0x561a('0x39')]['error'](_0x1012c,_0x561a('0xdd'));}var _0x2053e1=this;_0x6030a1[_0x561a('0xde')](function(_0x57b298,_0x1abec9){Object['keys'](_0x57b298)[_0x561a('0xde')](function(_0x331679){_0x2053e1['channel'][_0x561a('0xa2')](util[_0x561a('0x26')](_0x561a('0xdf'),_0x47df54,_0x1abec9,_0x331679),_0x57b298[_0x331679]);});});this[_0x561a('0x39')][_0x561a('0xa2')](util['format'](_0x561a('0xe0'),_0x47df54),_0x6030a1[_0x561a('0x9e')]);return this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')]('variable\x20%s\x20set',_0x47df54));};AGIVertices['prototype']['dial']=function(_0x1a23e2){logger[_0x561a('0xe1')](util[_0x561a('0x26')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x1a23e2[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x1a23e2[_0x561a('0xe2')])){return this['channel'][_0x561a('0x29')](_0x1a23e2,'no\x20user\x20selected');}var _0x9458=this[_0x561a('0x1a')][_0x561a('0x73')](this,_0x1a23e2[_0x561a('0xe2')]);if(!_0x9458){return this[_0x561a('0x39')][_0x561a('0x29')](_0x1a23e2,'no\x20user\x20found');}var _0x197735=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0xe3'),[util[_0x561a('0x26')](_0x561a('0xe4'),_0x9458),_0x1a23e2[_0x561a('0x66')],_0x1a23e2[_0x561a('0xe5')],_0x1a23e2[_0x561a('0x76')]]);if(_0x197735[_0x561a('0xa7')]===-0x1){return _0x197735;}return this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')](_0x561a('0xe6'),_0x561a('0xe3')));};AGIVertices['prototype']['dialogflow']=function(_0x59bcd4){logger['info'](util['format'](_0x561a('0xe7'),_0x59bcd4[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x59bcd4[_0x561a('0x7f')])){return this[_0x561a('0x39')]['noop']('no\x20key\x20configured');}if(!this[_0x561a('0x89')](_0x59bcd4[_0x561a('0x5d')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xad'));}this[_0x561a('0x39')][_0x561a('0xe8')]=!![];this[_0x561a('0x35')](_0x59bcd4);this['createSquareMessage'](_0x59bcd4[_0x561a('0x5d')],'in','','');this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')]('Trying\x20Dialogflow:\x20%s',_0x59bcd4[_0x561a('0x5d')]));var _0xab9fb1=this[_0x561a('0x7e')][_0x561a('0x73')](this,_0x59bcd4);if(_0xab9fb1){for(var _0x25d955 in _0xab9fb1){if(_0xab9fb1[_0x561a('0x98')](_0x25d955)){this[_0x561a('0x39')][_0x561a('0xa2')](util[_0x561a('0x26')](_0x561a('0xe9'),_0x25d955[_0x561a('0x6b')]()),_0xab9fb1[_0x25d955]);}}this['createSquareMessage'](_0xab9fb1[_0x561a('0xea')],_0x561a('0xeb'),_0x561a('0xec'),'');return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xed'),_0xab9fb1['speech']));}return this[_0x561a('0x39')]['error'](_0x59bcd4,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x561a('0x11')][_0x561a('0xee')]=function(_0x3b556e){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0xef'),_0x3b556e[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x3b556e[_0x561a('0xf0')])){return this[_0x561a('0x39')]['noop'](_0x561a('0xf1'));}if(!this[_0x561a('0x89')](_0x3b556e[_0x561a('0x82')])){return this[_0x561a('0x39')][_0x561a('0xac')]('no\x20client_email\x20configured');}if(!this[_0x561a('0x89')](_0x3b556e[_0x561a('0x83')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xf2'));}if(!this['isConfigured'](_0x3b556e[_0x561a('0xf3')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xf4'));}if(!this[_0x561a('0x89')](_0x3b556e[_0x561a('0x5d')])){return this['channel'][_0x561a('0xac')](_0x561a('0xad'));}this['channel'][_0x561a('0xe8')]=!![];this[_0x561a('0x35')](_0x3b556e);this['createSquareMessage'](_0x3b556e[_0x561a('0x5d')],'in','','');this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')]('Trying\x20DialogflowV2:\x20%s',_0x3b556e['text']));var _0x2b146d=this['googleDialogflowV2'][_0x561a('0x73')](this,_0x3b556e);if(_0x2b146d){for(var _0x1970cd in _0x2b146d){if(_0x2b146d[_0x561a('0x98')](_0x1970cd)){if(_0x1970cd!==_0x561a('0xf5')){this[_0x561a('0x39')]['setVariable'](util[_0x561a('0x26')](_0x561a('0xe9'),_0x1970cd[_0x561a('0x6b')]()),_0x2b146d[_0x1970cd]);}}}this[_0x561a('0x40')](_0x2b146d[_0x561a('0xea')],_0x561a('0xeb'),_0x561a('0xee'),_0x2b146d[_0x561a('0xf5')]);return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xf6'),_0x2b146d['speech']));}return this['channel']['error'](_0x3b556e,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x561a('0x11')][_0x561a('0xf7')]=function(_0x1decc5){logger['info'](util[_0x561a('0x26')](_0x561a('0xf8'),_0x1decc5[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x1decc5[_0x561a('0xf9')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xfa'));}if(!this['isConfigured'](_0x1decc5[_0x561a('0xfb')])){return this[_0x561a('0x39')][_0x561a('0xac')]('no\x20username\x20configured');}if(!this[_0x561a('0x89')](_0x1decc5[_0x561a('0xfc')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xfd'));}if(!this[_0x561a('0x89')](_0x1decc5['ndassistant_url'])){return this[_0x561a('0x39')]['noop']('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0x561a('0x35')](_0x1decc5);this[_0x561a('0x40')](_0x1decc5[_0x561a('0x5d')],'in','','');this[_0x561a('0x39')][_0x561a('0xac')](util['format'](_0x561a('0xfe'),_0x1decc5[_0x561a('0x5d')]));var _0x4900b5=this[_0x561a('0xff')][_0x561a('0x73')](this,_0x1decc5);if(_0x4900b5){for(var _0xe8a5af in _0x4900b5){if(_0x4900b5[_0x561a('0x98')](_0xe8a5af)){this[_0x561a('0x39')]['setVariable'](util[_0x561a('0x26')](_0x561a('0x100'),_0xe8a5af['toUpperCase']()),_0x4900b5[_0xe8a5af]);}}this[_0x561a('0x40')](_0x4900b5[_0x561a('0xea')],'out','sesteknda','');if(_0x4900b5[_0x561a('0x101')]){this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x4900b5['audiofile']));var _0x2abf3c=this[_0x561a('0x39')][_0x561a('0x102')](_0x4900b5[_0x561a('0x101')]);try{fs['unlink'](_0x4900b5[_0x561a('0x101')]+_0x561a('0x103'));}catch(_0x2a00b7){logger[_0x561a('0x29')](_0x2a00b7);}return _0x2abf3c;}else{return this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')](_0x561a('0x104'),_0x4900b5[_0x561a('0xea')]));}}return this['channel'][_0x561a('0x29')](_0x1decc5,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x561a('0x11')][_0x561a('0x105')]=function(_0x5d2651){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x106'),_0x5d2651[_0x561a('0x37')]));return this['channel'][_0x561a('0xac')](_0x561a('0x105'));};AGIVertices['prototype'][_0x561a('0x107')]=function(_0x1db2ac){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x108'),_0x1db2ac[_0x561a('0x37')]));var _0x20af28='';if(_0x1db2ac[_0x561a('0x109')]){if(!this['isConfigured'](_0x1db2ac[_0x561a('0x109')])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x1db2ac,_0x561a('0x10a'));}else{var _0x46c928=parseInt(_0x1db2ac[_0x561a('0x109')],0xa);if(isNaN(_0x46c928)){_0x20af28=_0x1db2ac[_0x561a('0x109')];}else{_0x20af28=this[_0x561a('0x10b')][_0x561a('0x73')](this,_0x1db2ac[_0x561a('0x109')]);if(!_0x20af28){return this[_0x561a('0x39')]['error'](_0x1db2ac,_0x561a('0x10c'));}}}}else if(_0x1db2ac[_0x561a('0x10d')]){_0x20af28=_0x1db2ac['trunk_name'];}else{return this[_0x561a('0x39')]['error'](_0x1db2ac,_0x561a('0x10a'));}var _0x50ab0e=this['channel'][_0x561a('0x58')](_0x561a('0xe3'),[util['format'](_0x561a('0x10e'),_0x20af28,_0x1db2ac['phone']),_0x1db2ac[_0x561a('0x66')],_0x1db2ac[_0x561a('0xe5')],_0x1db2ac['url']]);if(_0x50ab0e[_0x561a('0xa7')]===-0x1){return _0x50ab0e;}return this[_0x561a('0x39')][_0x561a('0xac')](util['format'](_0x561a('0xe6'),_0x561a('0xe3')));};AGIVertices['prototype'][_0x561a('0x10f')]=function(_0x29a1a2){logger['info'](util[_0x561a('0x26')](_0x561a('0x110'),_0x29a1a2['label']));return this[_0x561a('0x39')][_0x561a('0xac')]('finally');};AGIVertices[_0x561a('0x11')][_0x561a('0xd')]=function(_0x528d6b){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x528d6b[_0x561a('0x37')]));if(_0x528d6b[_0x561a('0xa9')]===0x0){return this[_0x561a('0xaa')](_0x528d6b);}_0x528d6b['retry']-=0x1;if(!this[_0x561a('0x89')](_0x528d6b[_0x561a('0x111')])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x528d6b,_0x561a('0x112'));}var _0x44c831=this['getSound']['sync'](this,_0x528d6b['file_id']);if(!_0x44c831){return this[_0x561a('0x39')]['error'](_0x528d6b,_0x561a('0x113'));}if(!this[_0x561a('0x89')](_0x528d6b[_0x561a('0xdb')])){return this[_0x561a('0x39')][_0x561a('0x29')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x127520=this[_0x561a('0x39')][_0x561a('0x114')](_0x44c831,_0x528d6b[_0x561a('0x115')],_0x528d6b[_0x561a('0x116')]);var _0x322b10=_0x127520[_0x561a('0xa7')]?_0x127520[_0x561a('0xa7')][_0x561a('0x4a')]():'';logger[_0x561a('0x2b')](_0x561a('0x117'),JSON['stringify'](_0x127520));if(_0x127520[_0x561a('0xa7')]===-0x1){this[_0x561a('0x35')]['sync'](this,_0x528d6b,_0x322b10);return _0x127520;}else if(_0x127520['extra']===_0x561a('0x66')){_0x127520[_0x561a('0xa7')]=_0x322b10['length']>=parseInt(_0x528d6b[_0x561a('0x118')])?'x':'i';}else{_0x127520[_0x561a('0xa7')]=_0x322b10[_0x561a('0x9e')]>=parseInt(_0x528d6b[_0x561a('0x118')])&&_0x322b10['length']<=parseInt(_0x528d6b[_0x561a('0x116')])?'x':'i';}var _0x15cc3b=this[_0x561a('0x12')][_0x561a('0x73')](this,_0x528d6b['variable_id']);if(!_0x15cc3b){return this['channel']['error'](_0x528d6b,_0x561a('0xdd'));}this[_0x561a('0x39')]['setVariable'](_0x15cc3b,_0x322b10);if(this[_0x561a('0x89')](_0x528d6b[_0x561a('0x119')])){var _0x3fa0a4=parseInt(_0x528d6b[_0x561a('0x119')],0xa);var _0x4be70b=rs[_0x561a('0x11a')]({'charset':'*','length':_0x3fa0a4});var _0xc28b58=_0x322b10[_0x561a('0x9e')];if(_0xc28b58>0x0){if(_0xc28b58>_0x3fa0a4){this['createSquareDetailsReport'][_0x561a('0x73')](this,_0x528d6b,_0x528d6b[_0x561a('0x11b')]===_0x561a('0x11c')?_0x4be70b+_0x322b10[_0x561a('0x11d')](_0x3fa0a4):_0x322b10[_0x561a('0x11d')](0x0,_0xc28b58-_0x3fa0a4)+_0x4be70b);}else{this['createSquareDetailsReport'][_0x561a('0x73')](this,_0x528d6b,rs[_0x561a('0x11a')]({'charset':'*','length':_0xc28b58}));}}else{this[_0x561a('0x35')][_0x561a('0x73')](this,_0x528d6b,'');}}else{this['createSquareDetailsReport'][_0x561a('0x73')](this,_0x528d6b,_0x322b10);}return _0x127520;};AGIVertices[_0x561a('0x11')][_0x561a('0xe')]=function(_0x2aafac){logger['info'](util[_0x561a('0x26')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x2aafac[_0x561a('0x37')]));return this[_0x561a('0xd')](_0x2aafac);};AGIVertices[_0x561a('0x11')][_0x561a('0x11e')]=function(_0x421ea2){logger[_0x561a('0x2b')](util['format'](_0x561a('0x11f'),_0x421ea2[_0x561a('0x37')]));this[_0x561a('0x35')][_0x561a('0x73')](this,_0x421ea2,_0x421ea2[_0x561a('0x120')]);return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')]('GOAL\x20%s',_0x421ea2[_0x561a('0x120')]));};AGIVertices['prototype'][_0x561a('0x121')]=function(_0x32c5b6){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x122'),_0x32c5b6[_0x561a('0x37')]));if(!this['isConfigured'](_0x32c5b6['aws_access_key_id'])||!this[_0x561a('0x89')](_0x32c5b6['aws_secret_access_key'])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0x123'));}if(!this[_0x561a('0x89')](_0x32c5b6[_0x561a('0x5d')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xad'));}this[_0x561a('0x39')][_0x561a('0xac')](util['format']('Trying\x20aws\x20Polly\x20%s',_0x32c5b6[_0x561a('0x5d')]));var _0xc2746a=this['awsPolly'][_0x561a('0x73')](this,_0x32c5b6);if(_0xc2746a){this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x124'),_0xc2746a));var _0x36ff7d=this[_0x561a('0x39')][_0x561a('0x102')](_0xc2746a);try{fs[_0x561a('0x125')](_0xc2746a+'.wav');}catch(_0x23eb5e){logger['error'](_0x23eb5e);}return _0x36ff7d;}return this['channel'][_0x561a('0x29')](_0x32c5b6,_0x561a('0x126'));};AGIVertices[_0x561a('0x11')][_0x561a('0x127')]=function(_0x1f7a81){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x128'),_0x1f7a81[_0x561a('0x37')]));if(!this['isConfigured'](_0x1f7a81[_0x561a('0x8c')])||!this[_0x561a('0x89')](_0x1f7a81[_0x561a('0x8d')])){return this[_0x561a('0x39')][_0x561a('0xac')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x561a('0x89')](_0x1f7a81['aws_bot_name'])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0x129'));}if(!this[_0x561a('0x89')](_0x1f7a81['text'])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xad'));}this['channel']['bot']=!![];this[_0x561a('0x35')](_0x1f7a81);this[_0x561a('0x40')](_0x1f7a81[_0x561a('0x5d')],'in','','');this['channel'][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x12a'),_0x1f7a81[_0x561a('0x5d')]));var _0x1ba591=this['awsLex'][_0x561a('0x73')](this,_0x1f7a81);if(_0x1ba591){for(var _0x3dda45 in _0x1ba591){if(_0x1ba591[_0x561a('0x98')](_0x3dda45)&&_[_0x561a('0x99')](_0x1ba591[_0x3dda45])){this['channel'][_0x561a('0xa2')](util[_0x561a('0x26')](_0x561a('0x12b'),_0x3dda45[_0x561a('0x6b')]()),_0x1ba591[_0x3dda45]);}}if(_['isNil'](_0x1ba591[_0x561a('0x7b')])){return this['channel'][_0x561a('0xac')](_0x561a('0x12c'));}else{this['createSquareMessage'](_0x1ba591[_0x561a('0x7b')],'out',_0x561a('0x12d'),'');return this['channel'][_0x561a('0xac')](util[_0x561a('0x26')]('Amazon\x20Lex\x20Result\x20%s',_0x1ba591['message']));}}return this[_0x561a('0x39')][_0x561a('0x29')](_0x1f7a81,_0x561a('0x12e'));};AGIVertices[_0x561a('0x11')][_0x561a('0x12f')]=function(_0xe39733){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x130'),_0xe39733[_0x561a('0x37')],_0xe39733['timeout']));if(!this[_0x561a('0x89')](_0xe39733[_0x561a('0x7f')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0x131'));}var _0x3abc38=_0x561a('0x132');var _0x1160f5=util[_0x561a('0x26')](_0x561a('0x133'),FILES_PATH,rs[_0x561a('0x11a')](0x4));var _0x2c8aca=util[_0x561a('0x26')](_0x561a('0xa1'),_0x1160f5,_0x3abc38);var _0x4242f2=!![];if(_0xe39733[_0x561a('0x134')]===_0x561a('0x135')){_0x4242f2=![];}var _0x4cc759=this[_0x561a('0x39')]['recordFile'](_0x1160f5,_0x3abc38,_0xe39733[_0x561a('0x136')],_0xe39733['timeout'],undefined,_0x4242f2);if(_0x4cc759[_0x561a('0xa7')]!==-0x1){this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')]('google\x20%s\x20file\x20created',_0x2c8aca));var _0x59ac25=this[_0x561a('0x93')][_0x561a('0x73')](this,_0xe39733,_0x2c8aca);if(_0x59ac25){for(var _0x164688 in _0x59ac25){if(_0x59ac25[_0x561a('0x98')](_0x164688)){this['channel'][_0x561a('0xa2')](util[_0x561a('0x26')](_0x561a('0x137'),_0x164688[_0x561a('0x6b')]()),_0x59ac25[_0x164688]);}}return this['channel'][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x138'),JSON[_0x561a('0x77')](_0x59ac25)));}}return _0x4cc759;};AGIVertices[_0x561a('0x11')][_0x561a('0x139')]=function(_0x2ebba3){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x13a'),_0x2ebba3[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x2ebba3['appid'])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0x13b'));}if(!this[_0x561a('0x89')](_0x2ebba3[_0x561a('0x13c')])){return this['channel'][_0x561a('0xac')](_0x561a('0x13d'));}var _0xf12178=_0x561a('0x132');var _0x1d16da=util[_0x561a('0x26')](_0x561a('0x133'),FILES_PATH,rs[_0x561a('0x11a')](0x4));var _0x1dec1c=util['format'](_0x561a('0xa1'),_0x1d16da,_0xf12178);var _0x3361a0=!![];if(_0x2ebba3[_0x561a('0x134')]==='NOBEEP'){_0x3361a0=![];}var _0x1309f4=this[_0x561a('0x39')][_0x561a('0x13e')](_0x1d16da,_0xf12178,_0x2ebba3[_0x561a('0x136')],_0x2ebba3[_0x561a('0x66')],undefined,_0x3361a0);if(_0x1309f4[_0x561a('0xa7')]!==-0x1){this[_0x561a('0x39')][_0x561a('0xac')](util['format'](_0x561a('0x13f'),_0x1dec1c));var _0x390652=this['tildeASR'][_0x561a('0x73')](this,_0x2ebba3,_0x1dec1c);if(_0x390652){for(var _0x2e8d7a in _0x390652){if(_0x390652[_0x561a('0x98')](_0x2e8d7a)){this['channel'][_0x561a('0xa2')](util['format'](_0x561a('0x140'),_0x2e8d7a[_0x561a('0x6b')]()),_0x390652[_0x2e8d7a]);}}return this[_0x561a('0x39')][_0x561a('0xac')](util['format'](_0x561a('0x141'),JSON[_0x561a('0x77')](_0x390652)));}}return _0x1309f4;};AGIVertices['prototype'][_0x561a('0x142')]=function(_0x23e18d){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x23e18d[_0x561a('0x37')]));return this[_0x561a('0x39')][_0x561a('0x143')](_0x23e18d[_0x561a('0x3c')],_0x23e18d[_0x561a('0x144')],_0x23e18d[_0x561a('0x3d')]);};AGIVertices[_0x561a('0x11')]['gotoif']=function(_0x359899){logger['info'](util['format'](_0x561a('0x145'),_0x359899[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x359899[_0x561a('0x146')])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x359899,'no\x20condition\x20configured');}try{var _0x3f9115=eval(_0x359899[_0x561a('0x146')])?'true':'false';this['channel'][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x147'),_0x359899[_0x561a('0x146')],_0x3f9115));return{'code':0xc8,'result':_0x3f9115};}catch(_0x34a0e0){return{'code':0xc8,'result':_0x561a('0x148')};}};AGIVertices['prototype']['gotoiftime']=function(_0xb8c0d4){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0xb8c0d4[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0xb8c0d4[_0x561a('0x149')])){return this[_0x561a('0x39')][_0x561a('0x29')](_0xb8c0d4,'no\x20interval\x20configured');}var _0xa42fb3=this['getIntervals'][_0x561a('0x73')](this,_0xb8c0d4[_0x561a('0x149')]);if(!_0xa42fb3){return this[_0x561a('0x39')][_0x561a('0x29')](_0xb8c0d4,'no\x20intervals\x20found');}for(var _0xef922f=0x0;_0xef922f<_0xa42fb3[_0x561a('0x9e')];_0xef922f+=0x1){var _0x377026=this[_0x561a('0x39')][_0x561a('0x12')](util[_0x561a('0x26')](_0x561a('0x14a'),_0xa42fb3[_0xef922f]));if(_0x377026[_0x561a('0xa7')]===-0x1){return _0x377026;}logger[_0x561a('0x2b')](util[_0x561a('0x26')]('IFTIME\x20%s\x20%s',_0xa42fb3[_0xef922f],_0x377026['extra']));if(_0x377026['extra']===_0x561a('0x14b')){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x14c'),_0xa42fb3[_0xef922f],_0x561a('0x14b')));this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x14c'),_0xa42fb3[_0xef922f],_0x561a('0x14b')));return{'code':0xc8,'result':_0x561a('0x14b')};}else{logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x14c'),_0xa42fb3[_0xef922f],'false'));this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')](_0x561a('0x14c'),_0xa42fb3[_0xef922f],'false'));}}return{'code':0xc8,'result':_0x561a('0x148')};};AGIVertices[_0x561a('0x11')]['hangup']=function(_0x51a9f5){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x14d'),_0x51a9f5[_0x561a('0x37')]));return this[_0x561a('0x39')][_0x561a('0x14e')]();};AGIVertices[_0x561a('0x11')][_0x561a('0x14f')]=function(_0x5c405a){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x150'),_0x5c405a[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x5c405a['key'])){return this[_0x561a('0x39')]['noop'](_0x561a('0x131'));}var _0x1ce434=_0x561a('0x132');var _0x207af5=util[_0x561a('0x26')]('%s/recordings/%s',FILES_PATH,rs[_0x561a('0x11a')](0x4));var _0x10e123=util[_0x561a('0x26')](_0x561a('0xa1'),_0x207af5,_0x1ce434);var _0x25457d=!![];if(_0x5c405a[_0x561a('0x134')]===_0x561a('0x135')){_0x25457d=![];}var _0x10c02a=this[_0x561a('0x39')][_0x561a('0x13e')](_0x207af5,_0x1ce434,_0x5c405a[_0x561a('0x136')],_0x5c405a[_0x561a('0x66')],undefined,_0x25457d);if(_0x10c02a[_0x561a('0xa7')]!==-0x1){this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x151'),_0x10e123));var _0x4cc34b=this[_0x561a('0x87')]['sync'](this,_0x5c405a,_0x10e123);if(_0x4cc34b){for(var _0x2f8816 in _0x4cc34b){if(_0x4cc34b[_0x561a('0x98')](_0x2f8816)){this[_0x561a('0x39')][_0x561a('0xa2')](util['format']('ISPEECH_ASR_%s',_0x2f8816[_0x561a('0x6b')]()),_0x4cc34b[_0x2f8816]);}}return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x152'),JSON[_0x561a('0x77')](_0x4cc34b)));}}return _0x10c02a;};AGIVertices['prototype'][_0x561a('0x153')]=function(_0x10b1fe){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x154'),_0x10b1fe['label']));if(!this[_0x561a('0x89')](_0x10b1fe[_0x561a('0x7f')])){return this[_0x561a('0x39')]['noop'](_0x561a('0x131'));}if(!this['isConfigured'](_0x10b1fe[_0x561a('0x5d')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xad'));}this[_0x561a('0x39')]['noop'](util['format'](_0x561a('0x155'),_0x10b1fe['text']));var _0x13c565=this['ispeechTTS'][_0x561a('0x73')](this,_0x10b1fe);if(_0x13c565){this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x151'),_0x13c565));var _0xc4137d=this[_0x561a('0x39')]['streamFile'](_0x13c565,_0x10b1fe['intKey']);try{fs[_0x561a('0x125')](_0x13c565+_0x561a('0x103'));}catch(_0x185a54){logger['error'](_0x185a54);}return _0xc4137d;}return this['channel'][_0x561a('0x29')](_0x10b1fe,_0x561a('0x156'));};AGIVertices['prototype'][_0x561a('0x157')]=function(_0x1cd60e){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x158'),_0x1cd60e[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x1cd60e[_0x561a('0x159')])){return this['channel']['error'](_0x1cd60e,'no\x20find\x20by\x20configured');}logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x15a'),this['channel'][_0x561a('0x50')],_0x1cd60e[_0x561a('0x159')]));var _0x136f5f=this['agentLogin'][_0x561a('0x73')](this,_0x1cd60e[_0x561a('0x159')]);if(_0x136f5f){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x15b'),this[_0x561a('0x39')][_0x561a('0x50')],_0x1cd60e['findBy']));this[_0x561a('0x39')][_0x561a('0xac')](util['format'](_0x561a('0x15b'),this[_0x561a('0x39')][_0x561a('0x50')],_0x1cd60e[_0x561a('0x159')]));return{'code':0xc8,'result':_0x561a('0x15c')};}else{logger['info'](util[_0x561a('0x26')](_0x561a('0x15d'),this[_0x561a('0x39')][_0x561a('0x50')],_0x1cd60e[_0x561a('0x159')]));this['channel']['noop'](util[_0x561a('0x26')](_0x561a('0x15d'),this[_0x561a('0x39')][_0x561a('0x50')],_0x1cd60e[_0x561a('0x159')]));return{'code':0xc8,'result':_0x561a('0x15e')};}};AGIVertices[_0x561a('0x11')]['logout']=function(_0x856958){logger[_0x561a('0x2b')](util['format'](_0x561a('0x15f'),_0x856958['label']));if(!this[_0x561a('0x89')](_0x856958['findBy'])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x856958,_0x561a('0x160'));}logger['info'](util['format'](_0x561a('0x15a'),this[_0x561a('0x39')][_0x561a('0x50')],_0x856958['findBy']));var _0xc134c9=this['agentLogout'][_0x561a('0x73')](this,_0x856958['findBy']);if(_0xc134c9){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x15b'),this[_0x561a('0x39')][_0x561a('0x50')],_0x856958[_0x561a('0x159')]));this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x15b'),this[_0x561a('0x39')]['callerid'],_0x856958[_0x561a('0x159')]));return{'code':0xc8,'result':_0x561a('0x15c')};}else{logger[_0x561a('0x2b')](util['format'](_0x561a('0x15d'),this[_0x561a('0x39')][_0x561a('0x50')],_0x856958['findBy']));this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x561a('0x39')][_0x561a('0x50')],_0x856958[_0x561a('0x159')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x561a('0x11')][_0x561a('0x161')]=function(_0x239be4){logger['info'](util[_0x561a('0x26')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x239be4[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x239be4['operation'])){return this[_0x561a('0x39')]['error'](_0x239be4,_0x561a('0x162'));}this['channel']['noop'](util[_0x561a('0x26')](_0x561a('0x163'),_0x239be4['operation']));var _0x257536=eval(_0x239be4[_0x561a('0x164')]);if(!this[_0x561a('0x89')](_0x239be4['variable_id'])){return this[_0x561a('0x39')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x7dd2ff=this['getVariable'][_0x561a('0x73')](this,_0x239be4[_0x561a('0xdb')]);if(!_0x7dd2ff){return this[_0x561a('0x39')]['error'](_0x239be4,_0x561a('0xdd'));}if(_[_0x561a('0x9d')](_0x257536)){var _0x322f64=this;_0x257536[_0x561a('0xde')](function(_0x5d2032,_0x3faaf1){_0x322f64['channel'][_0x561a('0xa2')](util[_0x561a('0x26')](_0x561a('0x165'),_0x7dd2ff,_0x3faaf1),_0x5d2032);});return this['channel'][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x166'),_0x7dd2ff));}else{return this[_0x561a('0x39')][_0x561a('0xa2')](_0x7dd2ff,_0x257536);}};AGIVertices[_0x561a('0x11')][_0x561a('0xc')]=function(_0x16b827){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x167'),_0x16b827[_0x561a('0x37')]));if(_0x16b827['retry']===0x0){return this[_0x561a('0xaa')](_0x16b827);}_0x16b827[_0x561a('0xa9')]-=0x1;if(!this[_0x561a('0x89')](_0x16b827[_0x561a('0x111')])){return this[_0x561a('0x39')]['error'](_0x16b827,_0x561a('0x112'));}var _0x292595=this[_0x561a('0x1c')][_0x561a('0x73')](this,_0x16b827[_0x561a('0x111')]);if(!_0x292595){return this['channel']['error'](_0x16b827,_0x561a('0x113'));}var _0x21c04e=this['channel'][_0x561a('0x114')](_0x292595,_0x16b827[_0x561a('0x115')],_0x16b827[_0x561a('0x168')]);var _0x30e862=_0x21c04e[_0x561a('0xa7')];if(_0x21c04e[_0x561a('0xa7')]===-0x1){this[_0x561a('0x35')]['sync'](this,_0x16b827,'-1');return _0x21c04e;}else if(_0x21c04e[_0x561a('0xa5')]===_0x561a('0x66')){_0x21c04e[_0x561a('0xa7')]=_0x21c04e[_0x561a('0xa7')][_0x561a('0x9e')]>0x0?_0x21c04e['result']:'t';}else if(_['isEmpty'](_0x21c04e[_0x561a('0xa7')])){_0x21c04e[_0x561a('0xa7')]='#';_0x30e862='#';}if(!this[_0x561a('0x89')](_0x16b827[_0x561a('0xdb')])){this[_0x561a('0x39')][_0x561a('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x3fa6d9=this[_0x561a('0x12')][_0x561a('0x73')](this,_0x16b827[_0x561a('0xdb')]);if(!_0x3fa6d9){return this['channel'][_0x561a('0x29')](_0x16b827,_0x561a('0xdd'));}this[_0x561a('0x39')][_0x561a('0xa2')](_0x3fa6d9,_0x30e862);}this[_0x561a('0x35')][_0x561a('0x73')](this,_0x16b827,_0x30e862);return _0x21c04e;};AGIVertices[_0x561a('0x11')]['noop']=function(_0x45d9d2){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x169'),_0x45d9d2[_0x561a('0x37')]));return this[_0x561a('0x39')][_0x561a('0xac')](_0x45d9d2[_0x561a('0x16a')]||_0x45d9d2['label']);};AGIVertices['prototype'][_0x561a('0x16b')]=function(_0x37ab0f){logger['info'](util[_0x561a('0x26')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x37ab0f[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x37ab0f['findBy'])){return this[_0x561a('0x39')]['error'](_0x37ab0f,_0x561a('0x160'));}logger[_0x561a('0x2b')](util[_0x561a('0x26')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x561a('0x39')][_0x561a('0x50')],_0x37ab0f[_0x561a('0x159')]));var _0x140457=this[_0x561a('0x4c')][_0x561a('0x73')](this,_0x37ab0f[_0x561a('0x16c')]);var _0x172335=this['agentPause']['sync'](this,_0x37ab0f['findBy'],_0x140457);if(_0x172335){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x561a('0x39')][_0x561a('0x50')],_0x37ab0f[_0x561a('0x159')]));this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x15b'),this[_0x561a('0x39')]['callerid'],_0x37ab0f['findBy']));return{'code':0xc8,'result':_0x561a('0x15c')};}else{logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x15d'),this['channel'][_0x561a('0x50')],_0x37ab0f['findBy']));this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x15b'),this[_0x561a('0x39')]['callerid'],_0x37ab0f[_0x561a('0x159')]));return{'code':0xc8,'result':_0x561a('0x15e')};}};AGIVertices[_0x561a('0x11')]['playback']=function(_0x2670b6){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x16d'),_0x2670b6['label']));if(!this['isConfigured'](_0x2670b6[_0x561a('0x111')])){return this['channel'][_0x561a('0x29')](_0x2670b6,_0x561a('0x112'));}var _0x4b3e35=this[_0x561a('0x1c')][_0x561a('0x73')](this,_0x2670b6['file_id']);if(!_0x4b3e35){return this['channel'][_0x561a('0x29')](_0x2670b6,_0x561a('0x113'));}var _0xa72dba=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0x16e'),[_0x4b3e35,_0x2670b6[_0x561a('0xe5')]]);if(_0xa72dba[_0x561a('0xa7')]===-0x1){return _0xa72dba;}return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xc7'),_0x561a('0x16e'),_0x4b3e35));};AGIVertices[_0x561a('0x11')][_0x561a('0x16f')]=function(_0x477664){logger['info'](util[_0x561a('0x26')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x477664[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x477664[_0x561a('0x170')])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x477664,_0x561a('0x171'));}var _0xf915c3='';var _0x41c280=parseInt(_0x477664[_0x561a('0x170')],0xa);if(isNaN(_0x41c280)){_0xf915c3=_0x477664[_0x561a('0x170')];}else{_0xf915c3=this[_0x561a('0x172')]['sync'](this,_0x477664[_0x561a('0x170')]);if(!_0xf915c3){return this[_0x561a('0x39')]['error'](_0x477664,'no\x20queue\x20found');}}var _0x155c72='';if(this['isConfigured'](_0x477664['file_id'])){var _0x3cec7a=this[_0x561a('0x1c')]['sync'](this,_0x477664[_0x561a('0x111')]);if(_0x3cec7a){_0x155c72=_0x3cec7a;}}this[_0x561a('0x35')][_0x561a('0x73')](this,_0x477664,_0xf915c3);if(_0x477664[_0x561a('0xe5')][_0x561a('0x173')]('x')<0x0){_0x477664[_0x561a('0xe5')]+='x';}if(_0x477664['opts']['indexOf']('X')<0x0){_0x477664[_0x561a('0xe5')]+='X';}this[_0x561a('0x39')][_0x561a('0xa2')](_0x561a('0x174'),_0xf915c3?_0xf915c3[_0x561a('0x175')]():'');var _0x4226f4=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0x176'),[_0xf915c3,_0x477664[_0x561a('0xe5')],_0x477664[_0x561a('0x76')],_0x155c72,_0x477664[_0x561a('0x66')],_0x477664['agi'],_0x477664[_0x561a('0x177')],_0x477664[_0x561a('0x178')],'',_0x477664[_0x561a('0x179')]]);if(_0x4226f4[_0x561a('0xa7')]===-0x1){return _0x4226f4;}return this['channel'][_0x561a('0xac')](util['format'](_0x561a('0xc7'),'QUEUE',_0xf915c3));};AGIVertices[_0x561a('0x11')][_0x561a('0x17a')]=function(_0x4aa9f3){logger[_0x561a('0x2b')](util['format'](_0x561a('0x17b'),_0x4aa9f3['label']));var _0x5323ff=_0x4aa9f3[_0x561a('0x17c')]||_0x561a('0x132');var _0x82e124=util[_0x561a('0x26')](_0x561a('0x17d'),this[_0x561a('0x39')][_0x561a('0x36')],rs[_0x561a('0x11a')](0x5));var _0x11999e=util['format'](_0x561a('0x17e'),FILES_PATH,_0x82e124,_0x5323ff);var _0x2904c2=util['format'](_0x561a('0x133'),FILES_PATH,_0x82e124);this[_0x561a('0x3a')][_0x561a('0x73')](this,_0x4aa9f3,_0x82e124,_0x11999e);this['channel']['setVariable']('RECORDING_SAVENAME',_0x82e124);logger[_0x561a('0x2b')](_0x561a('0x17f'),_0x2904c2,_0x5323ff,_0x4aa9f3['escape_digits'],_0x4aa9f3[_0x561a('0x66')]);return this[_0x561a('0x39')][_0x561a('0x13e')](_0x2904c2,_0x5323ff,_0x4aa9f3['escape_digits'],_0x4aa9f3[_0x561a('0x66')],undefined,!![]);};AGIVertices[_0x561a('0x11')][_0x561a('0x180')]=function(_0x50e3f5){logger['info'](util[_0x561a('0x26')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x50e3f5[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x50e3f5[_0x561a('0x76')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0x181'));}var _0x425d96=this[_0x561a('0x182')][_0x561a('0x73')](this,_0x50e3f5);logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x183'),util[_0x561a('0x184')](_0x425d96,{'showHidden':![],'depth':null})));if(!this[_0x561a('0x89')](_0x50e3f5[_0x561a('0xdb')])){return this['channel'][_0x561a('0xac')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0xa88469=this[_0x561a('0x12')][_0x561a('0x73')](this,_0x50e3f5[_0x561a('0xdb')]);if(!_0xa88469){return this[_0x561a('0x39')][_0x561a('0x29')](_0x50e3f5,_0x561a('0xdd'));}this[_0x561a('0x39')][_0x561a('0xa2')](util[_0x561a('0x26')]('%s_STATUS_CODE',_0xa88469),_0x425d96[_0x561a('0x79')]?_0x425d96[_0x561a('0x79')]:'200');this[_0x561a('0x39')][_0x561a('0xa2')](util[_0x561a('0x26')](_0x561a('0x185'),_0xa88469),_0x425d96[_0x561a('0x7a')]?_0x425d96[_0x561a('0x7a')]:'OK');if(_0x425d96[_0x561a('0x6c')]){try{this[_0x561a('0xa0')](_0x425d96[_0x561a('0x6c')],_0xa88469);}catch(_0x63f06f){logger[_0x561a('0x29')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0xa88469));}}return this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')]('variable\x20%s\x20set',_0xa88469));};AGIVertices[_0x561a('0x11')]['saydigits']=function(_0x1b91a6){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x1b91a6[_0x561a('0x37')]));return this['channel'][_0x561a('0x186')](_0x1b91a6['digits']['replace'](/\s+/g,''),_0x1b91a6[_0x561a('0x187')]);};AGIVertices[_0x561a('0x11')][_0x561a('0x188')]=function(_0x191ef5){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x189'),_0x191ef5[_0x561a('0x37')]));return this[_0x561a('0x39')][_0x561a('0x18a')](_0x191ef5['number'][_0x561a('0x5a')](/\s+/g,''),_0x191ef5['escape_digits']);};AGIVertices[_0x561a('0x11')][_0x561a('0x18b')]=function(_0x2768bf){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x2768bf[_0x561a('0x37')]));return this[_0x561a('0x39')][_0x561a('0x18c')](_0x2768bf[_0x561a('0x5d')],_0x2768bf['escape_digits']);};AGIVertices['prototype'][_0x561a('0x18d')]=function(_0x131209){logger[_0x561a('0x2b')](util['format'](_0x561a('0x18e'),_0x131209['label']));if(!this[_0x561a('0x89')](_0x131209[_0x561a('0x18f')])){return this[_0x561a('0x39')][_0x561a('0xac')]('no\x20mail\x20account\x20configured');}var _0x3286ab=this[_0x561a('0x20')][_0x561a('0x73')](this,_0x131209['account_id']);if(!_0x3286ab||!_0x3286ab[_0x561a('0x190')]){return this[_0x561a('0x39')][_0x561a('0x29')](_0x131209,_0x561a('0x191'));}var _0x2eafda={'from':util['format'](_0x561a('0x192'),_0x3286ab[_0x561a('0x15')],_0x3286ab[_0x561a('0x193')]||_0x3286ab[_0x561a('0x190')][_0x561a('0x194')]),'to':_0x131209['to']||'','cc':_0x131209['cc']||'','bcc':_0x131209[_0x561a('0x195')]||'','subject':_0x131209[_0x561a('0x196')],'html':_0x131209[_0x561a('0x5d')],'text':_0x131209[_0x561a('0x5d')]};if(this[_0x561a('0x89')](_0x131209[_0x561a('0x197')])){}logger[_0x561a('0xe1')]('sendMail\x20message',JSON[_0x561a('0x77')](_0x2eafda));this[_0x561a('0x35')][_0x561a('0x73')](this,_0x131209,_0x131209[_0x561a('0x18f')]);this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x198'),_0x3286ab[_0x561a('0x15')]));this['sendMailMessage'][_0x561a('0x73')](this,_0x3286ab['smtpOptions'],_0x2eafda);return this['channel'][_0x561a('0xac')](_0x561a('0x199'));};AGIVertices[_0x561a('0x11')][_0x561a('0x19a')]=function(_0x19b5ad){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x19b5ad[_0x561a('0x37')]));return this['channel'][_0x561a('0xac')](_0x561a('0x19b'));};AGIVertices[_0x561a('0x11')]['sendSMS']=function(_0x393674){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x393674[_0x561a('0x37')]));if(!this['isConfigured'](_0x393674[_0x561a('0x19c')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0x19d'));}var _0x2ea0db=this[_0x561a('0x32')][_0x561a('0x73')](this,_0x393674[_0x561a('0x19c')]);if(!_0x2ea0db){return this[_0x561a('0x39')]['error'](_0x393674,_0x561a('0x19e'));}var _0x2869d8={'body':_0x393674[_0x561a('0x19f')],'phone':_0x393674['to']||'','SmsAccountId':_0x2ea0db['id']};logger[_0x561a('0xe1')](_0x561a('0x1a0'),JSON[_0x561a('0x77')](_0x2869d8));this[_0x561a('0x35')][_0x561a('0x73')](this,_0x393674,_0x393674[_0x561a('0x19c')]);this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x1a1'),_0x2ea0db['name']));this['createSmsMessage'][_0x561a('0x73')](this,_0x2869d8);return this['channel'][_0x561a('0xac')](_0x561a('0x1a2'));};AGIVertices[_0x561a('0x11')][_0x561a('0x1a3')]=function(_0x53a503){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x1a4'),_0x53a503[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x53a503[_0x561a('0xdb')])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x53a503,_0x561a('0x1a5'));}var _0x15c6b1=this[_0x561a('0x12')][_0x561a('0x73')](this,_0x53a503['variable_id']);if(!_0x15c6b1){return this[_0x561a('0x39')][_0x561a('0x29')](_0x53a503,_0x561a('0xdd'));}return this['channel'][_0x561a('0xa2')](_0x15c6b1,_0x53a503[_0x561a('0x1a6')]);};AGIVertices[_0x561a('0x11')][_0x561a('0x1a7')]=function(_0xdb8e3c){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x1a8'),_0xdb8e3c[_0x561a('0x37')]));this[_0x561a('0x39')][_0x561a('0xac')]('START\x20CALLY\x20SQUARE');if(_0xdb8e3c[_0x561a('0xbd')]===_0x561a('0x1a9')){this[_0x561a('0x39')]['noop'](_0x561a('0x1aa'));return this[_0x561a('0x39')]['answer']();}return this['channel'][_0x561a('0xac')](_0x561a('0x1ab'));};AGIVertices[_0x561a('0x11')][_0x561a('0x1ac')]=function(_0x2653fb){logger[_0x561a('0x2b')](util['format'](_0x561a('0x1ad'),_0x2653fb[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x2653fb['project_id'])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x2653fb,'no\x20subproject\x20selected');}var _0x13e0d4=this[_0x561a('0x18')]['sync'](this,_0x2653fb[_0x561a('0x1ae')]);if(!this[_0x561a('0x89')](_0x13e0d4)){return this[_0x561a('0x39')][_0x561a('0x29')](_0x2653fb,util[_0x561a('0x26')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x2653fb[_0x561a('0x1ae')]));}if(_0x13e0d4===this['channel'][_0x561a('0x3f')]){return this[_0x561a('0x39')][_0x561a('0x29')](_0x2653fb,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x561a('0x35')]['sync'](this,_0x2653fb,_0x13e0d4);var _0x24e078=this[_0x561a('0x39')][_0x561a('0x58')]('AGI',util[_0x561a('0x26')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x561a('0x6')][_0x561a('0x1af')]||_0x561a('0x1b0'),_0x13e0d4,this[_0x561a('0x39')][_0x561a('0x3f')]));if(_0x24e078['result']===-0x1){return _0x24e078;}return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xc7'),'AGI',_0x13e0d4));};AGIVertices[_0x561a('0x11')]['system']=function(_0xef83ad){logger['info'](util[_0x561a('0x26')](_0x561a('0x1b1'),_0xef83ad['label']));var _0x2486b0=this[_0x561a('0x57')][_0x561a('0x73')](this,_0xef83ad[_0x561a('0xbb')]);this['createSquareDetailsReport'][_0x561a('0x73')](this,_0xef83ad,_0xef83ad[_0x561a('0xbb')]);if(this[_0x561a('0x89')](_0xef83ad[_0x561a('0xdb')])){var _0x12dd49=this[_0x561a('0x12')]['sync'](this,_0xef83ad[_0x561a('0xdb')]);if(_0x12dd49){this[_0x561a('0x39')][_0x561a('0xa2')](_0x12dd49,_0x2486b0);return this['channel'][_0x561a('0xac')](util['format'](_0x561a('0x1b2'),_0xef83ad['command'],_0x12dd49));}}return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x1b3'),_0xef83ad[_0x561a('0xbb')]));};AGIVertices[_0x561a('0x11')][_0x561a('0x1b4')]=function(_0x2ec8f0){logger['info'](util['format'](_0x561a('0x1b5'),_0x2ec8f0[_0x561a('0x37')]));_0x2ec8f0[_0x561a('0x5d')]=_0x2ec8f0['text'][_0x561a('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2ec8f0[_0x561a('0x1b6')])){return this['channel'][_0x561a('0xac')](_0x561a('0x1b7'));}if(!this[_0x561a('0x89')](_0x2ec8f0[_0x561a('0x5d')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xad'));}this[_0x561a('0x39')][_0x561a('0xac')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x2ec8f0[_0x561a('0x5d')]));var _0xc1d490=this[_0x561a('0x5b')]['sync'](this,_0x2ec8f0);if(_0xc1d490){this[_0x561a('0x39')][_0x561a('0xac')](util['format'](_0x561a('0x1b8'),_0xc1d490));var _0x4c5c51=this[_0x561a('0x39')][_0x561a('0x102')](_0xc1d490);try{fs[_0x561a('0x125')](_0xc1d490+_0x561a('0x103'));}catch(_0x84d2e5){logger[_0x561a('0x29')](_0x84d2e5);}return _0x4c5c51;}return this[_0x561a('0x39')][_0x561a('0x29')](_0x2ec8f0,_0x561a('0x1b9'));};AGIVertices[_0x561a('0x11')][_0x561a('0x1ba')]=function(_0x1ebca8){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x1ebca8[_0x561a('0x37')]));_0x1ebca8[_0x561a('0x5d')]=_0x1ebca8[_0x561a('0x5d')][_0x561a('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x561a('0x89')](_0x1ebca8[_0x561a('0x5d')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xad'));}this['channel']['noop'](util['format']('Trying\x20Google\x20TTS\x20%s',_0x1ebca8[_0x561a('0x5d')]));var _0x1d9f46=this[_0x561a('0x63')][_0x561a('0x73')](this,_0x1ebca8);if(_0x1d9f46){this['channel'][_0x561a('0xac')](util['format'](_0x561a('0x1bb'),_0x1d9f46));var _0x3e90b8=this[_0x561a('0x39')][_0x561a('0x102')](_0x1d9f46);try{fs[_0x561a('0x125')](_0x1d9f46+_0x561a('0x103'));}catch(_0x2ea3e8){logger[_0x561a('0x29')](_0x2ea3e8);}return _0x3e90b8;}return this[_0x561a('0x39')][_0x561a('0x29')](_0x1ebca8,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x561a('0x11')][_0x561a('0x1bc')]=function(_0x32a242){logger['info'](util[_0x561a('0x26')](_0x561a('0x1bd'),_0x32a242[_0x561a('0x37')]));if(!this['isConfigured'](_0x32a242[_0x561a('0x159')])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x32a242,'no\x20find\x20by\x20configured');}logger['info'](util[_0x561a('0x26')](_0x561a('0x15a'),this['channel'][_0x561a('0x50')],_0x32a242['findBy']));var _0x402bc7=this[_0x561a('0x51')][_0x561a('0x73')](this,_0x32a242[_0x561a('0x159')]);if(_0x402bc7){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x561a('0x50')],_0x32a242[_0x561a('0x159')]));this[_0x561a('0x39')][_0x561a('0xac')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x32a242[_0x561a('0x159')]));return{'code':0xc8,'result':'success'};}else{logger[_0x561a('0x2b')](util['format'](_0x561a('0x15d'),this['channel'][_0x561a('0x50')],_0x32a242[_0x561a('0x159')]));this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x561a('0x39')][_0x561a('0x50')],_0x32a242['findBy']));return{'code':0xc8,'result':_0x561a('0x15e')};}};AGIVertices['prototype'][_0x561a('0x1be')]=function(_0x147096){logger[_0x561a('0x2b')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x147096['label']));var _0x3ebbb4=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0x1bf'),[_0x147096['mailbox'],_0x147096['options']]);if(_0x3ebbb4[_0x561a('0xa7')]===-0x1){return _0x3ebbb4;}return this['channel'][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xc7'),_0x561a('0x1bf'),_0x147096[_0x561a('0x1c0')]));};AGIVertices['prototype']['vswitch']=function(_0x4d2b55){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x4d2b55[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x4d2b55['variable_id'])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x4d2b55,_0x561a('0x1a5'));}var _0x3f649c=this[_0x561a('0x12')][_0x561a('0x73')](this,_0x4d2b55['variable_id']);if(!_0x3f649c){return this[_0x561a('0x39')][_0x561a('0x29')](_0x4d2b55,'no\x20variable\x20found');}var _0x35c22a=this[_0x561a('0x39')][_0x561a('0x12')](_0x3f649c);return{'code':0xc8,'result':_0x35c22a[_0x561a('0xa5')]?_0x35c22a[_0x561a('0xa5')]:'-'};};String[_0x561a('0x11')]['replaceAll']=function(_0x1eca19,_0x442ac4){return this[_0x561a('0xa3')](_0x1eca19)[_0x561a('0x1c1')](_0x442ac4);};module[_0x561a('0x1c2')]=AGIVertices; \ No newline at end of file +var _0x3f59=['mailRpc','prototype','getVariable','getVariableById','then','name','getVoiceQueue','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','extension','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','list_id','callback','toString','getPause','agent','agentPause','error','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','POST','PUT','toUpperCase','body','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','options','googleDialogflow','key','dialogflow_language','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','awsPolly','aws_access_key_id','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','includes','hasOwnProperty','isString','replaceObjectAllVariables','isPlainObject','recursiveNodeIndex','isArray','replaceAllVariables','saveRestApiResult','length','%s.%s','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','sync','retry','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','result','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','answer','no\x20list\x20selected','scheduledAt','delay','add','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','SESTEK_ASR_CONFIDENCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','replace','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','googleDialogflowV2','providerResponse','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','aws_secret_access_key','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','%s/recordings/%s','beep','NOBEEP','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','wav','recordFile','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','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','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','macro','gosub','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','util','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','rawHeaders','rawBody','menu','getdigits','getsecretdigits','rpc'];(function(_0x53e54f,_0x4ab8cd){var _0x336931=function(_0x3feb54){while(--_0x3feb54){_0x53e54f['push'](_0x53e54f['shift']());}};_0x336931(++_0x4ab8cd);}(_0x3f59,0x1b0));var _0x93f5=function(_0x215b85,_0x474bc3){_0x215b85=_0x215b85-0x0;var _0x2cef15=_0x3f59[_0x215b85];return _0x2cef15;};'use strict';var fs=require('fs');var util=require(_0x93f5('0x0'));var _=require(_0x93f5('0x1'));var sh=require('shelljs');var odbc=require(_0x93f5('0x2'))();var rs=require(_0x93f5('0x3'));var moment=require(_0x93f5('0x4'));var Mustache=require(_0x93f5('0x5'));var rp=require(_0x93f5('0x6'));var logger=require(_0x93f5('0x7'))(_0x93f5('0x8'));var config=require(_0x93f5('0x9'));var shared=require(_0x93f5('0xa'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x93f5('0xb'),_0x93f5('0xc')];var verticesWithRetry=[_0x93f5('0xd'),_0x93f5('0xe'),_0x93f5('0xf')];var AGIVertices=function(_0x5325a7,_0x4e3331,_0x491809){this['channel']=_0x5325a7;this[_0x93f5('0x10')]=_0x4e3331;this[_0x93f5('0x11')]=_0x491809;};AGIVertices[_0x93f5('0x12')][_0x93f5('0x13')]=function(_0x4f85bf,_0x559793){this[_0x93f5('0x10')][_0x93f5('0x14')](_0x4f85bf)[_0x93f5('0x15')](function(_0x4976d1){_0x559793(null,_0x4976d1?_0x4976d1[_0x93f5('0x16')]:![]);})['catch'](function(_0x3e7e84){_0x559793(_0x3e7e84);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x17')]=function(_0x161fe1,_0x3d85da){this[_0x93f5('0x10')]['getVoiceQueueById'](_0x161fe1)[_0x93f5('0x15')](function(_0x46ff12){_0x3d85da(null,_0x46ff12?_0x46ff12[_0x93f5('0x16')]:![]);})[_0x93f5('0x18')](function(_0x316fb2){_0x3d85da(_0x316fb2);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x19')]=function(_0x320517,_0x35afc3){this[_0x93f5('0x10')][_0x93f5('0x1a')](_0x320517)[_0x93f5('0x15')](function(_0x4df4ec){_0x35afc3(null,_0x4df4ec?_0x4df4ec[_0x93f5('0x16')]:![]);})[_0x93f5('0x18')](function(_0x45eac3){_0x35afc3(_0x45eac3);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x1b')]=function(_0x569c0c,_0x34edb9){this[_0x93f5('0x10')][_0x93f5('0x1c')](_0x569c0c)[_0x93f5('0x15')](function(_0x3fc4ab){_0x34edb9(null,_0x3fc4ab?_0x3fc4ab[_0x93f5('0x1d')]:![]);})[_0x93f5('0x18')](function(_0x257aa8){_0x34edb9(_0x257aa8);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x1e')]=function(_0x2ef296,_0xb59065){this[_0x93f5('0x10')]['getUserById'](_0x2ef296)[_0x93f5('0x15')](function(_0x27bde4){_0xb59065(null,_0x27bde4?_0x27bde4[_0x93f5('0x16')]:![]);})[_0x93f5('0x18')](function(_0x365afd){_0xb59065(_0x365afd);});};AGIVertices[_0x93f5('0x12')]['getTrunk']=function(_0x10fb86,_0x2e035f){this['rpc'][_0x93f5('0x1f')](_0x10fb86)[_0x93f5('0x15')](function(_0x57ae09){_0x2e035f(null,_0x57ae09?_0x57ae09['name']:![]);})[_0x93f5('0x18')](function(_0x11e86c){_0x2e035f(_0x11e86c);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x20')]=function(_0x5d71d4,_0x2bc6d1){var _0x4f8063=this;this[_0x93f5('0x10')][_0x93f5('0x21')](_0x5d71d4)['then'](function(_0x36d579){_0x2bc6d1(null,_0x36d579?_0x4f8063[_0x93f5('0x22')](_0x36d579[_0x93f5('0x23')]):![]);})['catch'](function(_0x3090a9){_0x2bc6d1(_0x3090a9);});};AGIVertices['prototype'][_0x93f5('0x24')]=function(_0x5c2ede,_0x448b5a){this[_0x93f5('0x10')]['getMailAccountById'](_0x5c2ede)[_0x93f5('0x15')](function(_0x1c0dcd){_0x448b5a(null,_0x1c0dcd?_0x1c0dcd:![]);})[_0x93f5('0x18')](function(_0xae546e){_0x448b5a(_0xae546e);});};AGIVertices['prototype'][_0x93f5('0x25')]=function(_0x584c7f,_0x385e24,_0x556d3a){this[_0x93f5('0x11')][_0x93f5('0x25')](_0x584c7f,_0x385e24)[_0x93f5('0x15')](function(){_0x556d3a(null);})[_0x93f5('0x18')](function(_0x5acb94){_0x556d3a(_0x5acb94);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x26')]=function(_0x1e5266,_0x3cefa5){this['rpc'][_0x93f5('0x27')](_0x1e5266)['then'](function(_0x2f869e){if(_0x2f869e){if(_0x2f869e[_0x93f5('0x28')]){_0x3cefa5(null,[_0x2f869e[_0x93f5('0x29')]]);}else{_0x3cefa5(null,_[_0x93f5('0x2a')](_0x2f869e['Intervals'],_0x93f5('0x29')));}}else{_0x3cefa5(null,![]);}})['catch'](function(_0x37b515){_0x3cefa5(_0x37b515);});};AGIVertices['prototype']['getSoundPath']=function(_0x1e1fd1){return util[_0x93f5('0x2b')](_0x93f5('0x2c'),FILES_PATH,_0x1e1fd1);};AGIVertices['prototype'][_0x93f5('0x2d')]=function(_0x1977b1,_0x4c026c,_0x314230){odbc['open'](_0x1977b1,function(_0x333736){if(_0x333736){logger['error'](_0x93f5('0x2e'),_0x333736);_0x314230(_0x333736);}else{logger[_0x93f5('0x2f')](_0x93f5('0x30'));odbc[_0x93f5('0x31')](_0x4c026c,function(_0x477910,_0x509e68){if(_0x477910){logger[_0x93f5('0x2f')](_0x93f5('0x32'),_0x4c026c);_0x314230(_0x477910);}else{logger[_0x93f5('0x2f')](_0x93f5('0x33'),_0x4c026c);odbc[_0x93f5('0x34')](function(_0xfacbe3){if(_0xfacbe3){logger['error'](_0x93f5('0x35'),_0xfacbe3);}_0x314230(null,_0x509e68);});}});}});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x36')]=function(_0x1a6e28,_0x20b873){this[_0x93f5('0x10')]['getSmsAccountById'](_0x1a6e28)[_0x93f5('0x15')](function(_0x4f45d8){_0x20b873(null,_0x4f45d8?_0x4f45d8:![]);})[_0x93f5('0x18')](function(_0x286de9){_0x20b873(_0x286de9);});};AGIVertices['prototype'][_0x93f5('0x37')]=function(_0x2d84da,_0x46f5be){this[_0x93f5('0x10')]['createSmsMessage'](_0x2d84da)[_0x93f5('0x15')](function(_0x591043){_0x46f5be(null,_0x591043);})[_0x93f5('0x18')](function(_0x465fd4){_0x46f5be(_0x465fd4);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x38')]=function(_0xd4d915,_0x1d4c11,_0x1aa137){this['rpc'][_0x93f5('0x38')]({'uniqueid':this[_0x93f5('0x39')][_0x93f5('0x3a')],'node':_0xd4d915[_0x93f5('0x3b')],'application':_0xd4d915[_0x93f5('0x3c')],'data':_0x1d4c11||null,'project_name':this[_0x93f5('0x39')][_0x93f5('0x3d')],'callerid':this[_0x93f5('0x39')]['callerid']})['then'](function(_0xfe6109){if(_0x1aa137){_0x1aa137(null,_0xfe6109);}})['catch'](function(_0x18ce7e){if(_0x1aa137){_0x1aa137(_0x18ce7e);}});};AGIVertices['prototype'][_0x93f5('0x3e')]=function(_0x41acbb,_0x47ab20,_0x50bbf6,_0x4754c9){this['rpc'][_0x93f5('0x3e')]({'uniqueid':this[_0x93f5('0x39')]['uniqueid'],'callerid':this[_0x93f5('0x39')][_0x93f5('0x3f')],'calleridname':this[_0x93f5('0x39')][_0x93f5('0x40')],'context':this['channel'][_0x93f5('0x41')],'extension':this['channel'][_0x93f5('0x42')],'priority':this[_0x93f5('0x39')]['priority'],'accountcode':this['channel'][_0x93f5('0x43')],'dnid':this[_0x93f5('0x39')]['dnid'],'projectName':this[_0x93f5('0x39')][_0x93f5('0x3d')],'saveName':_0x47ab20,'filename':_0x41acbb[_0x93f5('0x44')]||_0x47ab20,'savePath':_0x50bbf6})['then'](function(_0x544091){_0x4754c9(null,_0x544091);})[_0x93f5('0x18')](function(_0x157667){_0x4754c9(_0x157667);});};AGIVertices['prototype'][_0x93f5('0x45')]=function(_0x5e3d60,_0x2d9c30,_0x222716,_0x219172,_0xdb658b){this[_0x93f5('0x10')][_0x93f5('0x45')]({'uniqueid':this[_0x93f5('0x39')][_0x93f5('0x3a')],'body':_0x5e3d60,'direction':_0x2d9c30,'providerName':_0x222716,'providerResponse':_0x219172})[_0x93f5('0x15')](function(_0x1fded4){if(_0xdb658b){_0xdb658b(null,_0x1fded4);}})[_0x93f5('0x18')](function(_0x209e7a){if(_0xdb658b){_0xdb658b(_0x209e7a);}});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x46')]=function(_0x24b55b,_0xd2d30a){this[_0x93f5('0x10')][_0x93f5('0x46')]({'firstName':_[_0x93f5('0x47')](_0x24b55b['name'])||_[_0x93f5('0x48')](_0x24b55b['name'])?'callback_'+Math[_0x93f5('0x49')]():_0x24b55b['name'],'lastName':_[_0x93f5('0x47')](_0x24b55b['lastName'])||_[_0x93f5('0x48')](_0x24b55b[_0x93f5('0x4a')])?null:_0x24b55b['lastName'],'phone':_0x24b55b['phone'],'ListId':_0x24b55b[_0x93f5('0x4b')],'scheduledat':_0x24b55b['scheduledAt'],'callbackUniqueid':this[_0x93f5('0x39')][_0x93f5('0x3a')],'tags':_0x93f5('0x4c'),'description':'Callback\x20scheduled\x20at\x20'+_0x24b55b['scheduledAt'][_0x93f5('0x4d')](),'priority':_0x24b55b['callback_priority']})['then'](function(_0x4c6383){_0xd2d30a(null,_0x4c6383);})['catch'](function(_0x20b3e0){_0xd2d30a(_0x20b3e0);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x4e')]=function(_0x170798,_0x4941b3){this['rpc']['getPauseById'](_0x170798)[_0x93f5('0x15')](function(_0x434c4e){_0x4941b3(null,_0x434c4e?_0x434c4e[_0x93f5('0x16')]:![]);})[_0x93f5('0x18')](function(_0x37a148){_0x4941b3(_0x37a148);});};AGIVertices[_0x93f5('0x12')]['agentPause']=function(_0x4d4603,_0x52c30e,_0x1bd031){var _0x4ea59b={'role':_0x93f5('0x4f')};_0x4ea59b[_0x4d4603]=this['channel'][_0x93f5('0x3f')];this[_0x93f5('0x10')][_0x93f5('0x50')](_0x4ea59b,_0x52c30e,this[_0x93f5('0x39')]['uniqueid'])['then'](function(_0xe55c28){_0x1bd031(null,_[_0x93f5('0x48')](_0xe55c28)?![]:!![]);})[_0x93f5('0x18')](function(_0x4289eb){logger[_0x93f5('0x51')](_0x4289eb);_0x1bd031(null,![]);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x52')]=function(_0x4abe55,_0x2cd189){var _0x107727={'role':_0x93f5('0x4f')};_0x107727[_0x4abe55]=this[_0x93f5('0x39')][_0x93f5('0x3f')];this[_0x93f5('0x10')][_0x93f5('0x52')](_0x107727)[_0x93f5('0x15')](function(_0x30cfdb){_0x2cd189(null,_[_0x93f5('0x48')](_0x30cfdb)?![]:!![]);})[_0x93f5('0x18')](function(_0x2db967){logger['error'](_0x2db967);_0x2cd189(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x208557,_0x1296b0){var _0x49e4a1={'role':_0x93f5('0x4f')};_0x49e4a1[_0x208557]=this[_0x93f5('0x39')][_0x93f5('0x3f')];this[_0x93f5('0x10')][_0x93f5('0x53')](_0x49e4a1)['then'](function(_0x2a65b2){_0x1296b0(null,_[_0x93f5('0x48')](_0x2a65b2)?![]:!![]);})[_0x93f5('0x18')](function(_0x1b11c9){logger[_0x93f5('0x51')](_0x1b11c9);_0x1296b0(null,![]);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x54')]=function(_0x2aa519,_0x56ffed){var _0x2fc755={'role':_0x93f5('0x4f')};_0x2fc755[_0x2aa519]=this[_0x93f5('0x39')]['callerid'];var _0x1572af=_0x2aa519!='internal'?util['format'](_0x93f5('0x55'),_0x93f5('0x56'),this[_0x93f5('0x39')]['callerid']):undefined;this[_0x93f5('0x10')][_0x93f5('0x54')](_0x2fc755,_0x1572af)[_0x93f5('0x15')](function(_0x4a83bf){_0x56ffed(null,_[_0x93f5('0x48')](_0x4a83bf)?![]:!![]);})[_0x93f5('0x18')](function(_0xa83367){logger['error'](_0xa83367);_0x56ffed(null,![]);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x57')]=function(_0x30d670,_0x365520){sh[_0x93f5('0x58')](_[_0x93f5('0x59')](_0x30d670),function(_0x5d1e32,_0x135e4c){var _0x3974f9=_0x135e4c['replace'](/(\r\n|\n|\r)/gm,'');_0x365520(null,_0x3974f9);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x5a')]=function(_0x1290e4,_0x212ed1){scripts[_0x93f5('0x5a')](_0x1290e4[_0x93f5('0x5b')],_0x1290e4[_0x93f5('0x5c')]||'text',_0x1290e4[_0x93f5('0x5d')],_0x1290e4['languageCode']||_0x93f5('0x5e'),_0x1290e4[_0x93f5('0x5f')]||_0x93f5('0x60'),_0x1290e4[_0x93f5('0x61')]||_0x93f5('0x62'))['then'](function(_0x296749){_0x212ed1(null,_0x296749);})[_0x93f5('0x18')](function(_0x4c2d18){_0x212ed1(_0x4c2d18);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x63')]=function(_0x48b41b,_0x50b526){scripts[_0x93f5('0x63')](_0x48b41b[_0x93f5('0x5d')],_0x48b41b[_0x93f5('0x64')]||'en',0x1)[_0x93f5('0x15')](function(_0x57b872){_0x50b526(null,_0x57b872);})['catch'](function(_0x2aae78){_0x50b526(_0x2aae78);});};AGIVertices['prototype'][_0x93f5('0x65')]=function(_0x1f0d60,_0x4c8d13){var _0x385392={'uri':_0x1f0d60['url'],'method':_0x1f0d60[_0x93f5('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1f0d60[_0x93f5('0x67')])===_0x93f5('0x68')&&parseInt(_0x1f0d60['timeout'])>=0x1?parseInt(_0x1f0d60[_0x93f5('0x67')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x93f5('0x69'),_0x93f5('0x6a')],_0x385392[_0x93f5('0x66')][_0x93f5('0x6b')]())){try{_0x385392[_0x93f5('0x6c')]=_0x1f0d60[_0x93f5('0xc')]?JSON['parse'](_0x1f0d60[_0x93f5('0xc')]):{};}catch(_0x137f7c){logger[_0x93f5('0x51')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x137f7c);}}try{_0x385392[_0x93f5('0x6d')]=_0x1f0d60[_0x93f5('0xb')]?JSON[_0x93f5('0x6e')](_0x1f0d60['rawHeaders']):{};}catch(_0x3d3b43){logger[_0x93f5('0x51')](_0x93f5('0x6f'),_0x3d3b43);}if(_0x1f0d60['computedVariables']){try{var _0x34632a=require(_0x1f0d60[_0x93f5('0x70')])['sync'](this,_0x385392);_0x385392[_0x93f5('0x71')]=Mustache[_0x93f5('0x72')](_0x1f0d60[_0x93f5('0x73')],_0x34632a,{},['$$','$$']);if(_0x385392[_0x93f5('0x6d')]){_0x385392['headers']=JSON[_0x93f5('0x6e')](Mustache[_0x93f5('0x72')](JSON['stringify'](_0x385392[_0x93f5('0x6d')]),_0x34632a,{},['$$','$$']));}if(_0x385392[_0x93f5('0x6c')]){_0x385392[_0x93f5('0x6c')]=JSON['parse'](Mustache['render'](JSON[_0x93f5('0x74')](_0x385392[_0x93f5('0x6c')]),_0x34632a,{},['$$','$$']));}}catch(_0x41c486){logger[_0x93f5('0x51')](_0x93f5('0x75'),_0x41c486);}}rp(_0x385392)['then'](function(_0x5b44af){var _0x2ab9de={'statusCode':_0x5b44af[_0x93f5('0x76')]||0xc8,'statusMessage':_0x5b44af['statusMessage']||'OK','headers':_0x5b44af['headers']||{},'body':_0x5b44af[_0x93f5('0x6c')]||{}};_0x4c8d13(null,_0x2ab9de);})[_0x93f5('0x18')](function(_0x2904a8){var _0x4a872d={'statusCode':_0x2904a8[_0x93f5('0x76')]||0x1f4,'statusMessage':_0x2904a8[_0x93f5('0x77')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x2904a8[_0x93f5('0x78')][_0x93f5('0x6d')]||{},'body':_0x2904a8[_0x93f5('0x78')][_0x93f5('0x6c')]||{}};_0x4c8d13(null,_0x4a872d);});};AGIVertices['prototype'][_0x93f5('0x79')]=function(_0x4aaf51,_0x2a9f38){scripts[_0x93f5('0x79')](this[_0x93f5('0x39')][_0x93f5('0x3a')],_0x4aaf51[_0x93f5('0x7a')],_0x4aaf51[_0x93f5('0x5d')],_0x4aaf51[_0x93f5('0x7b')]||'en')[_0x93f5('0x15')](function(_0x585c65){_0x2a9f38(null,_0x585c65);})[_0x93f5('0x18')](function(_0xba4060){_0x2a9f38(_0xba4060);});};AGIVertices[_0x93f5('0x12')]['googleDialogflowV2']=function(_0x535277,_0x14e75e){scripts['googleDialogflowV2'](this['channel'][_0x93f5('0x3a')],_0x535277[_0x93f5('0x7c')],_0x535277[_0x93f5('0x7d')],_0x535277[_0x93f5('0x7e')],_0x535277[_0x93f5('0x5d')],_0x535277[_0x93f5('0x7f')]||'en')['then'](function(_0x4a4f8b){_0x14e75e(null,_0x4a4f8b);})[_0x93f5('0x18')](function(_0x5e1f30){_0x14e75e(_0x5e1f30);});};AGIVertices['prototype'][_0x93f5('0x80')]=function(_0x44ddbd,_0xc6eedd){scripts[_0x93f5('0x80')](this['channel'],_0x44ddbd)['then'](function(_0x370b92){_0xc6eedd(null,_0x370b92);})['catch'](function(_0x170ffc){_0xc6eedd(_0x170ffc);});};AGIVertices[_0x93f5('0x12')]['ispeechTTS']=function(_0x386b71,_0x5597fa){scripts[_0x93f5('0x81')](_0x386b71[_0x93f5('0x7a')],_0x386b71[_0x93f5('0x5d')],_0x386b71[_0x93f5('0x82')]||_0x93f5('0x5e'),_0x386b71[_0x93f5('0x83')])[_0x93f5('0x15')](function(_0xfd2f5d){_0x5597fa(null,_0xfd2f5d);})[_0x93f5('0x18')](function(_0x1f2fe5){_0x5597fa(_0x1f2fe5);});};AGIVertices[_0x93f5('0x12')]['ispeechASR']=function(_0x5abfa1,_0x98b04c,_0x7dc82f){scripts[_0x93f5('0x84')](_0x98b04c,_0x5abfa1[_0x93f5('0x7a')],_0x5abfa1['ispeech_asr_language']||'en-US',this[_0x93f5('0x85')](_0x5abfa1['model'])?_0x5abfa1['model']:undefined)[_0x93f5('0x15')](function(_0x314a2b){_0x7dc82f(null,_0x314a2b);})[_0x93f5('0x18')](function(_0x1e7a66){_0x7dc82f(_0x1e7a66);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x86')]=function(_0x5cde2e,_0xe66211){scripts[_0x93f5('0x86')](_0x5cde2e[_0x93f5('0x87')],_0x5cde2e['aws_secret_access_key'],_0x5cde2e['aws_polly_region'],_0x5cde2e[_0x93f5('0x88')]||_0x93f5('0x89'),_0x5cde2e[_0x93f5('0x5d')],_0x5cde2e[_0x93f5('0x8a')]||'text')[_0x93f5('0x15')](function(_0xa87de4){_0xe66211(null,_0xa87de4);})[_0x93f5('0x18')](function(_0xd77927){_0xe66211(_0xd77927);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x8b')]=function(_0x4e70d4,_0x4edcf9){scripts[_0x93f5('0x8b')](this[_0x93f5('0x39')][_0x93f5('0x3a')],_0x4e70d4[_0x93f5('0x87')],_0x4e70d4['aws_secret_access_key'],_0x4e70d4[_0x93f5('0x8c')],_0x4e70d4[_0x93f5('0x5d')],_0x4e70d4[_0x93f5('0x8d')])[_0x93f5('0x15')](function(_0x4d08a4){_0x4edcf9(null,_0x4d08a4);})[_0x93f5('0x18')](function(_0x17bb76){_0x4edcf9(_0x17bb76);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x8e')]=function(_0x1f4919,_0x2d8644,_0x3d0b07){scripts[_0x93f5('0x8e')](_0x2d8644,_0x1f4919['key'],_0x1f4919[_0x93f5('0x8f')]||_0x93f5('0x5e'))['then'](function(_0x435ffb){_0x3d0b07(null,_0x435ffb);})[_0x93f5('0x18')](function(_0x218b85){_0x3d0b07(_0x218b85);});};AGIVertices[_0x93f5('0x12')][_0x93f5('0x90')]=function(_0x1f7690,_0x1647e5,_0x4bbbf2){scripts[_0x93f5('0x90')](_0x1647e5,_0x1f7690[_0x93f5('0x91')],_0x1f7690[_0x93f5('0x92')],_0x1f7690[_0x93f5('0x71')])[_0x93f5('0x15')](function(_0xd45a68){_0x4bbbf2(null,_0xd45a68);})[_0x93f5('0x18')](function(_0xe2017){_0x4bbbf2(_0xe2017);});};AGIVertices[_0x93f5('0x12')]['clear']=function(_0x1452ab){var _0x4e25b9=_[_0x93f5('0x93')](verticesWithRetry,_0x1452ab[_0x93f5('0x3c')])?_0x1452ab:_['clone'](_0x1452ab);for(var _0xff347c in _0x4e25b9){if(_0x4e25b9[_0x93f5('0x94')](_0xff347c)){if(_0x4e25b9[_0xff347c]&&_[_0x93f5('0x95')](_0x4e25b9[_0xff347c])){if(_[_0x93f5('0x93')](recursiveMapAttributes,_0xff347c)){_0x4e25b9[_0xff347c]=this[_0x93f5('0x96')](_0x4e25b9[_0xff347c]);}else{_0x4e25b9[_0xff347c]=this['replaceAllVariables'](_0x4e25b9[_0xff347c]);}}}}return _0x4e25b9;};AGIVertices[_0x93f5('0x12')]['recursiveNodeIndex']=function(_0x60808d){for(var _0x3ec530 in _0x60808d){if(_0x60808d[_0x93f5('0x94')](_0x3ec530)){if(_[_0x93f5('0x97')](_0x60808d[_0x3ec530])){this[_0x93f5('0x98')](_0x60808d[_0x3ec530]);}else if(_[_0x93f5('0x99')](_0x60808d[_0x3ec530])){for(var _0xfef8dc=0x0;_0xfef8dc<_0x60808d[_0x3ec530]['length'];_0xfef8dc++){this[_0x93f5('0x98')](_0x60808d[_0x3ec530][_0xfef8dc]);}}else if(_[_0x93f5('0x95')](_0x60808d[_0x3ec530])){_0x60808d[_0x3ec530]=this[_0x93f5('0x9a')](_0x60808d[_0x3ec530]);}}}};AGIVertices['prototype'][_0x93f5('0x9b')]=function(_0x3e2019,_0x13e888){for(var _0x342d0b in _0x3e2019){if(_0x3e2019[_0x93f5('0x94')](_0x342d0b)){if(_[_0x93f5('0x97')](_0x3e2019[_0x342d0b])){if(!_[_0x93f5('0x47')](_0x3e2019[_0x342d0b])){this['saveRestApiResult'](_0x3e2019[_0x342d0b],util[_0x93f5('0x2b')]('%s.%s',_0x13e888,_0x342d0b));}}else if(_['isArray'](_0x3e2019[_0x342d0b])){for(var _0x2c7e5d=0x0;_0x2c7e5d<_0x3e2019[_0x342d0b][_0x93f5('0x9c')];_0x2c7e5d++){this[_0x93f5('0x9b')](_0x3e2019[_0x342d0b][_0x2c7e5d],util['format'](_0x93f5('0x9d'),_0x13e888,_0x342d0b+'['+_0x2c7e5d+']'));}}else{if(!_[_0x93f5('0x48')](_0x3e2019[_0x342d0b])){this[_0x93f5('0x39')]['setVariable'](util['format'](_0x93f5('0x9d'),_0x13e888,_0x342d0b),_0x3e2019[_0x342d0b]);}}}}};AGIVertices[_0x93f5('0x12')][_0x93f5('0x96')]=function(_0x4798a2){try{var _0x4bec14=JSON[_0x93f5('0x6e')](_0x4798a2);this['recursiveNodeIndex'](_0x4bec14);return JSON['stringify'](_0x4bec14);}catch(_0x3628dc){return this[_0x93f5('0x9a')](_0x4798a2);}};AGIVertices[_0x93f5('0x12')][_0x93f5('0x9a')]=function(_0x42e1c3){var _0x5a01c4=_0x42e1c3[_0x93f5('0x9e')]('{');for(var _0x4b6049=0x1;_0x4b6049<_0x5a01c4['length'];_0x4b6049+=0x1){var _0x530eb4=_0x5a01c4[_0x4b6049][_0x93f5('0x9e')]('}');if(_0x530eb4[_0x93f5('0x9c')]>0x1){_0x42e1c3=_0x42e1c3[_0x93f5('0x9f')]('{'+_0x530eb4[0x0]+'}',this[_0x93f5('0x39')][_0x93f5('0x13')](_0x530eb4[0x0])[_0x93f5('0xa0')]||_0x530eb4[0x0]);}}if(_0x5a01c4[_0x93f5('0x9c')]===0x1){return _0x42e1c3[_0x93f5('0x4d')]();}return this[_0x93f5('0x9a')](_0x42e1c3);};AGIVertices[_0x93f5('0x12')][_0x93f5('0xa1')]=function(_0x80d5d0,_0x343474){var _0x1f0588=this['channel'][_0x93f5('0x13')](_0x80d5d0);if(_0x1f0588['result']===-0x1){return _0x1f0588;}logger['info'](util['format'](_0x93f5('0xa2'),_0x343474,_0x1f0588[_0x93f5('0xa0')]));return this[_0x93f5('0x39')][_0x93f5('0xa3')](_0x343474,_0x1f0588[_0x93f5('0xa0')]);};AGIVertices[_0x93f5('0x12')][_0x93f5('0x85')]=function(_0x22fa62){return _0x22fa62&&_0x22fa62!=='0'&&_0x22fa62!=='-1'&&_0x22fa62!=='';};AGIVertices[_0x93f5('0x12')]['maxRetry']=function(_0x2afd73){this['createSquareDetailsReport'][_0x93f5('0xa4')](this,_0x2afd73,'-');_0x2afd73[_0x93f5('0xa5')]=_0x2afd73[_0x93f5('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x93f5('0x12')]['mrcpsynth']=function(_0x20612a){logger['info'](util[_0x93f5('0x2b')](_0x93f5('0xa7'),_0x20612a[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x20612a['text'])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xa9'));}var _0x2e8038='\x22'+_0x20612a['text']+'\x22';if(this['isConfigured'](_0x20612a[_0x93f5('0x78')])){_0x2e8038+=','+_0x20612a[_0x93f5('0x78')];}var _0x1ed9b6=this[_0x93f5('0x39')]['exec'](_0x93f5('0xaa'),_0x2e8038);if(_0x1ed9b6['result']===-0x1){return _0x1ed9b6;}return this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0xab'),_0x2e8038));};AGIVertices[_0x93f5('0x12')][_0x93f5('0xac')]=function(_0x198a02){logger[_0x93f5('0x2f')](util['format'](_0x93f5('0xad'),_0x198a02[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x198a02[_0x93f5('0xae')])){return this[_0x93f5('0x39')]['noop'](_0x93f5('0xaf'));}var _0x782c8e=_0x198a02['grammar'];if(this[_0x93f5('0x85')](_0x198a02['options'])){_0x782c8e+=','+_0x198a02[_0x93f5('0x78')];}var _0x2ad1c3=this[_0x93f5('0x39')][_0x93f5('0x58')](_0x93f5('0xb0'),_0x782c8e);if(_0x2ad1c3[_0x93f5('0xb1')]===-0x1){return _0x2ad1c3;}var _0x1bdf68=this[_0x93f5('0xa1')](_0x93f5('0xb2'),_0x93f5('0xb3'));if(_0x1bdf68[_0x93f5('0xb1')]===-0x1){return _0x1bdf68;}var _0x23dcd5=this['getAndSetVariable'](_0x93f5('0xb4'),'MRCP_RECOG_TRANSCRIPT');if(_0x23dcd5[_0x93f5('0xb1')]===-0x1){return _0x23dcd5;}var _0x51da1c=this[_0x93f5('0xa1')](_0x93f5('0xb5'),_0x93f5('0xb6'));if(_0x51da1c[_0x93f5('0xb1')]===-0x1){return _0x51da1c;}return this['channel'][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0xb7'),_0x782c8e));};AGIVertices[_0x93f5('0x12')][_0x93f5('0x8')]=function(_0x2c29ca){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0xb8'),_0x2c29ca[_0x93f5('0x3b')]));return this[_0x93f5('0x39')]['agi']([_0x2c29ca[_0x93f5('0xb9')],_0x2c29ca[_0x93f5('0xba')]]);};AGIVertices[_0x93f5('0x12')]['answer']=function(_0x496f5d){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0xbb'),_0x496f5d[_0x93f5('0x3b')]));if(this['isConfigured'](_0x496f5d['timeout'])){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x496f5d['timeout']));var _0x526937=this[_0x93f5('0x39')]['wait'](_0x496f5d[_0x93f5('0x67')]);if(_0x526937[_0x93f5('0xb1')]===-0x1){return _0x526937;}}return this['channel'][_0x93f5('0xbc')]();};AGIVertices[_0x93f5('0x12')][_0x93f5('0x4c')]=function(_0x537a53){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x537a53[_0x93f5('0x3b')]));if(!this['isConfigured'](_0x537a53[_0x93f5('0x4b')])){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x537a53,_0x93f5('0xbd'));}_0x537a53[_0x93f5('0xbe')]=moment();if(this[_0x93f5('0x85')](_0x537a53[_0x93f5('0xbf')])){_0x537a53[_0x93f5('0xbe')]=moment()[_0x93f5('0xc0')](_0x537a53['delay'],_0x93f5('0xc1'));}if(!this[_0x93f5('0x85')](_0x537a53[_0x93f5('0xc2')])){_0x537a53[_0x93f5('0xc2')]=0x2;}this[_0x93f5('0x46')][_0x93f5('0xa4')](this,_0x537a53);return this[_0x93f5('0x39')]['noop'](util[_0x93f5('0x2b')](_0x93f5('0xc3'),_0x537a53[_0x93f5('0xc4')],_0x537a53[_0x93f5('0x4b')],_0x537a53[_0x93f5('0xbe')]));};AGIVertices[_0x93f5('0x12')][_0x93f5('0xc5')]=function(_0x440c8d){logger[_0x93f5('0x2f')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x440c8d[_0x93f5('0x3b')]));var _0x4be8cb=this[_0x93f5('0x39')][_0x93f5('0x58')](_0x440c8d['application'],_0x440c8d['options']);if(_0x4be8cb['result']===-0x1){return _0x4be8cb;}return this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')]('Executed\x20command\x20%s\x20%s',_0x440c8d[_0x93f5('0xc6')],_0x440c8d[_0x93f5('0x78')]));};AGIVertices[_0x93f5('0x12')][_0x93f5('0xc7')]=function(_0x2eb897){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0xc8'),_0x2eb897[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x2eb897['text'])){return this['channel'][_0x93f5('0xa8')](_0x93f5('0xa9'));}var _0x3d7e5d='\x22'+_0x2eb897[_0x93f5('0x5d')]+'\x22';if(this[_0x93f5('0x85')](_0x2eb897[_0x93f5('0x78')])){_0x3d7e5d+=','+_0x2eb897['options'];}var _0x3b7c4f=this['channel']['exec'](_0x93f5('0xaa'),_0x3d7e5d);if(_0x3b7c4f[_0x93f5('0xb1')]===-0x1){return _0x3b7c4f;}return this[_0x93f5('0x39')]['noop'](util['format'](_0x93f5('0xab'),_0x3d7e5d));};AGIVertices['prototype'][_0x93f5('0xc9')]=function(_0x3d42b6){logger[_0x93f5('0x2f')](util['format'](_0x93f5('0xca'),_0x3d42b6[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x3d42b6[_0x93f5('0x5d')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')]('no\x20text\x20configured');}var _0xf902d4='\x22'+_0x3d42b6[_0x93f5('0x5d')]+'\x22';if(this[_0x93f5('0x85')](_0x3d42b6[_0x93f5('0x78')])){_0xf902d4+=','+_0x3d42b6[_0x93f5('0x78')];}var _0x2d117a=this[_0x93f5('0x39')][_0x93f5('0x58')](_0x93f5('0xaa'),_0xf902d4);if(_0x2d117a[_0x93f5('0xb1')]===-0x1){return _0x2d117a;}return this[_0x93f5('0x39')][_0x93f5('0xa8')](util['format'](_0x93f5('0xab'),_0xf902d4));};AGIVertices['prototype'][_0x93f5('0xcb')]=function(_0x2da279){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0xcc'),_0x2da279[_0x93f5('0x3b')]));if(!this['isConfigured'](_0x2da279[_0x93f5('0xae')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xaf'));}var _0x5b3249=_0x2da279[_0x93f5('0xae')];if(this[_0x93f5('0x85')](_0x2da279[_0x93f5('0x78')])){_0x5b3249+=','+_0x2da279[_0x93f5('0x78')];}var _0x309ee5=this[_0x93f5('0x39')][_0x93f5('0x58')](_0x93f5('0xb0'),_0x5b3249);if(_0x309ee5[_0x93f5('0xb1')]===-0x1){return _0x309ee5;}var _0x3db7ec=this[_0x93f5('0xa1')](_0x93f5('0xb2'),_0x93f5('0xcd'));if(_0x3db7ec[_0x93f5('0xb1')]===-0x1){return _0x3db7ec;}var _0x2ff05d=this[_0x93f5('0xa1')](_0x93f5('0xb4'),_0x93f5('0xce'));if(_0x2ff05d['result']===-0x1){return _0x2ff05d;}var _0x12f10a=this['getAndSetVariable']('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x12f10a[_0x93f5('0xb1')]===-0x1){return _0x12f10a;}return this[_0x93f5('0x39')][_0x93f5('0xa8')](util['format'](_0x93f5('0xb7'),_0x5b3249));};AGIVertices['prototype'][_0x93f5('0xcf')]=function(_0x47e1df){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x47e1df['label']));if(!this[_0x93f5('0x85')](_0x47e1df[_0x93f5('0xae')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xaf'));}var _0x50aa9e=_0x47e1df[_0x93f5('0xae')];if(this[_0x93f5('0x85')](_0x47e1df['options'])){_0x50aa9e+=','+_0x47e1df[_0x93f5('0x78')];}var _0x24e506=this[_0x93f5('0x39')]['exec']('MRCPRecog',_0x50aa9e);if(_0x24e506[_0x93f5('0xb1')]===-0x1){return _0x24e506;}var _0x1ded53=this[_0x93f5('0xa1')](_0x93f5('0xb2'),_0x93f5('0xd0'));if(_0x1ded53[_0x93f5('0xb1')]===-0x1){return _0x1ded53;}var _0x3a9f38=this[_0x93f5('0xa1')]('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x3a9f38['result']===-0x1){return _0x3a9f38;}var _0x30ef49=this['getAndSetVariable'](_0x93f5('0xb5'),'SESTEK_ASR_INSTANCE');if(_0x30ef49[_0x93f5('0xb1')]===-0x1){return _0x30ef49;}return this[_0x93f5('0x39')]['noop'](util[_0x93f5('0x2b')](_0x93f5('0xb7'),_0x50aa9e));};AGIVertices[_0x93f5('0x12')]['database']=function(_0x45f9fd){logger['info'](util[_0x93f5('0x2b')](_0x93f5('0xd1'),_0x45f9fd[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x45f9fd[_0x93f5('0xd2')])){return this['channel'][_0x93f5('0x51')](_0x45f9fd,'no\x20database\x20selected');}var _0xfd02b3=this[_0x93f5('0x1b')][_0x93f5('0xa4')](this,_0x45f9fd[_0x93f5('0xd2')]);if(!_0xfd02b3){return this['channel'][_0x93f5('0x51')](_0x45f9fd,_0x93f5('0xd3'));}if(!this[_0x93f5('0x85')](_0x45f9fd[_0x93f5('0x31')])){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x45f9fd,'no\x20query\x20configured');}var _0xa04c52=_0x45f9fd[_0x93f5('0x31')][_0x93f5('0xd4')](/(\r\n|\n|\r)/gm,'\x20');this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')]('query:\x20%s',_0xa04c52));var _0x16f6a7=this['getQueryOdbc'][_0x93f5('0xa4')](this,_0xfd02b3,_0xa04c52);this[_0x93f5('0x38')][_0x93f5('0xa4')](this,_0x45f9fd,_0xa04c52);if(!this['isConfigured'](_0x45f9fd[_0x93f5('0xd5')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xd6'));}var _0x1be8bb=this['getVariable'][_0x93f5('0xa4')](this,_0x45f9fd[_0x93f5('0xd5')]);if(!_0x1be8bb){return this[_0x93f5('0x39')]['error'](_0x45f9fd,_0x93f5('0xd7'));}var _0x52bf4f=this;_0x16f6a7[_0x93f5('0xd8')](function(_0x3885b3,_0x3853df){Object[_0x93f5('0xd9')](_0x3885b3)[_0x93f5('0xd8')](function(_0x337b36){_0x52bf4f[_0x93f5('0x39')][_0x93f5('0xa3')](util['format'](_0x93f5('0xda'),_0x1be8bb,_0x3853df,_0x337b36),_0x3885b3[_0x337b36]);});});this[_0x93f5('0x39')][_0x93f5('0xa3')](util[_0x93f5('0x2b')](_0x93f5('0xdb'),_0x1be8bb),_0x16f6a7[_0x93f5('0x9c')]);return this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0xdc'),_0x1be8bb));};AGIVertices[_0x93f5('0x12')][_0x93f5('0xdd')]=function(_0x51503b){logger[_0x93f5('0xde')](util[_0x93f5('0x2b')](_0x93f5('0xdf'),_0x51503b['label']));if(!this[_0x93f5('0x85')](_0x51503b['sip_id'])){return this['channel'][_0x93f5('0x51')](_0x51503b,_0x93f5('0xe0'));}var _0x471e98=this[_0x93f5('0x1e')]['sync'](this,_0x51503b[_0x93f5('0xe1')]);if(!_0x471e98){return this[_0x93f5('0x39')]['error'](_0x51503b,'no\x20user\x20found');}var _0x1f770e=this['channel'][_0x93f5('0x58')](_0x93f5('0xe2'),[util['format'](_0x93f5('0xe3'),_0x471e98),_0x51503b[_0x93f5('0x67')],_0x51503b[_0x93f5('0xe4')],_0x51503b[_0x93f5('0x73')]]);if(_0x1f770e[_0x93f5('0xb1')]===-0x1){return _0x1f770e;}return this[_0x93f5('0x39')][_0x93f5('0xa8')](util['format'](_0x93f5('0xe5'),_0x93f5('0xe2')));};AGIVertices[_0x93f5('0x12')][_0x93f5('0xe6')]=function(_0x39bfd9){logger['info'](util[_0x93f5('0x2b')](_0x93f5('0xe7'),_0x39bfd9[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x39bfd9[_0x93f5('0x7a')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xe8'));}if(!this[_0x93f5('0x85')](_0x39bfd9['text'])){return this['channel'][_0x93f5('0xa8')](_0x93f5('0xa9'));}this[_0x93f5('0x39')][_0x93f5('0xe9')]=!![];this[_0x93f5('0x38')](_0x39bfd9);this['createSquareMessage'](_0x39bfd9[_0x93f5('0x5d')],'in','','');this[_0x93f5('0x39')]['noop'](util[_0x93f5('0x2b')](_0x93f5('0xea'),_0x39bfd9['text']));var _0xa9d99a=this[_0x93f5('0x79')]['sync'](this,_0x39bfd9);if(_0xa9d99a){for(var _0x4c283a in _0xa9d99a){if(_0xa9d99a[_0x93f5('0x94')](_0x4c283a)){this[_0x93f5('0x39')][_0x93f5('0xa3')](util['format']('DIALOGFLOW_%s',_0x4c283a[_0x93f5('0x6b')]()),_0xa9d99a[_0x4c283a]);}}this[_0x93f5('0x45')](_0xa9d99a[_0x93f5('0xeb')],_0x93f5('0xec'),_0x93f5('0xe6'),'');return this[_0x93f5('0x39')]['noop'](util[_0x93f5('0x2b')]('Dialogflow\x20Result\x20%s',_0xa9d99a[_0x93f5('0xeb')]));}return this[_0x93f5('0x39')]['error'](_0x39bfd9,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x93f5('0x12')][_0x93f5('0xed')]=function(_0x3435a0){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0xee'),_0x3435a0['label']));if(!this[_0x93f5('0x85')](_0x3435a0['dialogflowV2_project_id'])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xef'));}if(!this[_0x93f5('0x85')](_0x3435a0[_0x93f5('0x7d')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xf0'));}if(!this[_0x93f5('0x85')](_0x3435a0['private_key'])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xf1'));}if(!this[_0x93f5('0x85')](_0x3435a0[_0x93f5('0x7f')])){return this['channel'][_0x93f5('0xa8')]('no\x20anguage\x20configured');}if(!this[_0x93f5('0x85')](_0x3435a0[_0x93f5('0x5d')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xa9'));}this[_0x93f5('0x39')][_0x93f5('0xe9')]=!![];this[_0x93f5('0x38')](_0x3435a0);this[_0x93f5('0x45')](_0x3435a0[_0x93f5('0x5d')],'in','','');this['channel']['noop'](util[_0x93f5('0x2b')](_0x93f5('0xf2'),_0x3435a0[_0x93f5('0x5d')]));var _0x329e91=this[_0x93f5('0xf3')][_0x93f5('0xa4')](this,_0x3435a0);if(_0x329e91){for(var _0x2337ce in _0x329e91){if(_0x329e91[_0x93f5('0x94')](_0x2337ce)){if(_0x2337ce!=='providerResponse'){this[_0x93f5('0x39')][_0x93f5('0xa3')](util[_0x93f5('0x2b')]('DIALOGFLOW_%s',_0x2337ce[_0x93f5('0x6b')]()),_0x329e91[_0x2337ce]);}}}this[_0x93f5('0x45')](_0x329e91['speech'],_0x93f5('0xec'),_0x93f5('0xed'),_0x329e91[_0x93f5('0xf4')]);return this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')]('DialogflowV2\x20Result\x20%s',_0x329e91[_0x93f5('0xeb')]));}return this[_0x93f5('0x39')]['error'](_0x3435a0,_0x93f5('0xf5'));};AGIVertices['prototype']['sesteknda']=function(_0x549b6c){logger[_0x93f5('0x2f')](util['format'](_0x93f5('0xf6'),_0x549b6c[_0x93f5('0x3b')]));if(!this['isConfigured'](_0x549b6c[_0x93f5('0xf7')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')]('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x549b6c[_0x93f5('0xf8')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xf9'));}if(!this[_0x93f5('0x85')](_0x549b6c[_0x93f5('0xfa')])){return this['channel'][_0x93f5('0xa8')](_0x93f5('0xfb'));}if(!this[_0x93f5('0x85')](_0x549b6c['ndassistant_url'])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xa9'));}this[_0x93f5('0x39')][_0x93f5('0xe9')]=!![];this['createSquareDetailsReport'](_0x549b6c);this[_0x93f5('0x45')](_0x549b6c['text'],'in','','');this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0xfc'),_0x549b6c[_0x93f5('0x5d')]));var _0x258f9a=this[_0x93f5('0x80')][_0x93f5('0xa4')](this,_0x549b6c);if(_0x258f9a){for(var _0x52c46f in _0x258f9a){if(_0x258f9a[_0x93f5('0x94')](_0x52c46f)){this[_0x93f5('0x39')][_0x93f5('0xa3')](util[_0x93f5('0x2b')](_0x93f5('0xfd'),_0x52c46f['toUpperCase']()),_0x258f9a[_0x52c46f]);}}this[_0x93f5('0x45')](_0x258f9a[_0x93f5('0xeb')],_0x93f5('0xec'),_0x93f5('0xfe'),'');if(_0x258f9a[_0x93f5('0xff')]){this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x100'),_0x258f9a[_0x93f5('0xff')]));var _0x117853=this['channel'][_0x93f5('0x101')](_0x258f9a[_0x93f5('0xff')]);try{fs[_0x93f5('0x102')](_0x258f9a[_0x93f5('0xff')]+_0x93f5('0x103'));}catch(_0x3d464c){logger[_0x93f5('0x51')](_0x3d464c);}return _0x117853;}else{return this['channel'][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x104'),_0x258f9a[_0x93f5('0xeb')]));}}return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x549b6c,_0x93f5('0x105'));};AGIVertices[_0x93f5('0x12')][_0x93f5('0x106')]=function(_0x4153a0){logger['info'](util[_0x93f5('0x2b')](_0x93f5('0x107'),_0x4153a0['label']));return this[_0x93f5('0x39')]['noop'](_0x93f5('0x106'));};AGIVertices['prototype']['ext_dial']=function(_0x3cfc12){logger['info'](util[_0x93f5('0x2b')](_0x93f5('0x108'),_0x3cfc12[_0x93f5('0x3b')]));var _0x3c49e4='';if(_0x3cfc12[_0x93f5('0x109')]){if(!this[_0x93f5('0x85')](_0x3cfc12[_0x93f5('0x109')])){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x3cfc12,_0x93f5('0x10a'));}else{var _0x1eb6b5=parseInt(_0x3cfc12['trunk_id'],0xa);if(isNaN(_0x1eb6b5)){_0x3c49e4=_0x3cfc12[_0x93f5('0x109')];}else{_0x3c49e4=this[_0x93f5('0x10b')][_0x93f5('0xa4')](this,_0x3cfc12['trunk_id']);if(!_0x3c49e4){return this['channel'][_0x93f5('0x51')](_0x3cfc12,_0x93f5('0x10c'));}}}}else if(_0x3cfc12[_0x93f5('0x10d')]){_0x3c49e4=_0x3cfc12[_0x93f5('0x10d')];}else{return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x3cfc12,_0x93f5('0x10a'));}var _0x405967=this[_0x93f5('0x39')][_0x93f5('0x58')]('DIAL',[util[_0x93f5('0x2b')](_0x93f5('0x10e'),_0x3c49e4,_0x3cfc12[_0x93f5('0xc4')]),_0x3cfc12[_0x93f5('0x67')],_0x3cfc12[_0x93f5('0xe4')],_0x3cfc12[_0x93f5('0x73')]]);if(_0x405967[_0x93f5('0xb1')]===-0x1){return _0x405967;}return this[_0x93f5('0x39')][_0x93f5('0xa8')](util['format'](_0x93f5('0xe5'),'DIAL'));};AGIVertices[_0x93f5('0x12')]['finally']=function(_0x3cb343){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x10f'),_0x3cb343[_0x93f5('0x3b')]));return this['channel'][_0x93f5('0xa8')](_0x93f5('0x110'));};AGIVertices[_0x93f5('0x12')][_0x93f5('0xe')]=function(_0xaeae38){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x111'),_0xaeae38['label']));if(_0xaeae38[_0x93f5('0xa5')]===0x0){return this[_0x93f5('0xa6')](_0xaeae38);}_0xaeae38[_0x93f5('0xa5')]-=0x1;if(!this['isConfigured'](_0xaeae38[_0x93f5('0x112')])){return this['channel'][_0x93f5('0x51')](_0xaeae38,_0x93f5('0x113'));}var _0x27dee8=this['getSound'][_0x93f5('0xa4')](this,_0xaeae38[_0x93f5('0x112')]);if(!_0x27dee8){return this['channel'][_0x93f5('0x51')](_0xaeae38,_0x93f5('0x114'));}if(!this[_0x93f5('0x85')](_0xaeae38[_0x93f5('0xd5')])){return this[_0x93f5('0x39')]['error'](_0x93f5('0xd6'));}var _0x4c1f38=this[_0x93f5('0x39')][_0x93f5('0x115')](_0x27dee8,_0xaeae38[_0x93f5('0x116')],_0xaeae38[_0x93f5('0x117')]);var _0x1e7ed8=_0x4c1f38[_0x93f5('0xb1')]?_0x4c1f38[_0x93f5('0xb1')][_0x93f5('0x4d')]():'';logger[_0x93f5('0x2f')](_0x93f5('0x118'),JSON[_0x93f5('0x74')](_0x4c1f38));if(_0x4c1f38[_0x93f5('0xb1')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0xaeae38,_0x1e7ed8);return _0x4c1f38;}else if(_0x4c1f38[_0x93f5('0xa0')]===_0x93f5('0x67')){_0x4c1f38[_0x93f5('0xb1')]=_0x1e7ed8[_0x93f5('0x9c')]>=parseInt(_0xaeae38['mindigit'])?'x':'i';}else{_0x4c1f38[_0x93f5('0xb1')]=_0x1e7ed8[_0x93f5('0x9c')]>=parseInt(_0xaeae38[_0x93f5('0x119')])&&_0x1e7ed8[_0x93f5('0x9c')]<=parseInt(_0xaeae38[_0x93f5('0x117')])?'x':'i';}var _0x557efe=this['getVariable']['sync'](this,_0xaeae38[_0x93f5('0xd5')]);if(!_0x557efe){return this['channel']['error'](_0xaeae38,'no\x20variable\x20found');}this[_0x93f5('0x39')][_0x93f5('0xa3')](_0x557efe,_0x1e7ed8);if(this['isConfigured'](_0xaeae38['hiddendigitsnum'])){var _0x3fe740=parseInt(_0xaeae38[_0x93f5('0x11a')],0xa);var _0x8c0d26=rs[_0x93f5('0x11b')]({'charset':'*','length':_0x3fe740});var _0x3f4e62=_0x1e7ed8['length'];if(_0x3f4e62>0x0){if(_0x3f4e62>_0x3fe740){this['createSquareDetailsReport'][_0x93f5('0xa4')](this,_0xaeae38,_0xaeae38[_0x93f5('0x11c')]===_0x93f5('0x11d')?_0x8c0d26+_0x1e7ed8[_0x93f5('0x11e')](_0x3fe740):_0x1e7ed8[_0x93f5('0x11e')](0x0,_0x3f4e62-_0x3fe740)+_0x8c0d26);}else{this[_0x93f5('0x38')][_0x93f5('0xa4')](this,_0xaeae38,rs[_0x93f5('0x11b')]({'charset':'*','length':_0x3f4e62}));}}else{this[_0x93f5('0x38')][_0x93f5('0xa4')](this,_0xaeae38,'');}}else{this['createSquareDetailsReport'][_0x93f5('0xa4')](this,_0xaeae38,_0x1e7ed8);}return _0x4c1f38;};AGIVertices['prototype'][_0x93f5('0xf')]=function(_0x37856c){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x11f'),_0x37856c[_0x93f5('0x3b')]));return this[_0x93f5('0xe')](_0x37856c);};AGIVertices['prototype'][_0x93f5('0x120')]=function(_0xeafd69){logger['info'](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0xeafd69[_0x93f5('0x3b')]));this['createSquareDetailsReport'][_0x93f5('0xa4')](this,_0xeafd69,_0xeafd69['goalname']);return this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')]('GOAL\x20%s',_0xeafd69['goalname']));};AGIVertices[_0x93f5('0x12')]['awspolly']=function(_0x4ed857){logger['info'](util[_0x93f5('0x2b')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x4ed857[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x4ed857[_0x93f5('0x87')])||!this[_0x93f5('0x85')](_0x4ed857[_0x93f5('0x121')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0x122'));}if(!this[_0x93f5('0x85')](_0x4ed857[_0x93f5('0x5d')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xa9'));}this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')]('Trying\x20aws\x20Polly\x20%s',_0x4ed857[_0x93f5('0x5d')]));var _0x5627f0=this['awsPolly'][_0x93f5('0xa4')](this,_0x4ed857);if(_0x5627f0){this[_0x93f5('0x39')][_0x93f5('0xa8')](util['format'](_0x93f5('0x123'),_0x5627f0));var _0x249e38=this[_0x93f5('0x39')][_0x93f5('0x101')](_0x5627f0);try{fs[_0x93f5('0x102')](_0x5627f0+'.wav');}catch(_0x34a7e7){logger[_0x93f5('0x51')](_0x34a7e7);}return _0x249e38;}return this['channel'][_0x93f5('0x51')](_0x4ed857,_0x93f5('0x124'));};AGIVertices['prototype'][_0x93f5('0x125')]=function(_0x28ba7c){logger['info'](util[_0x93f5('0x2b')](_0x93f5('0x126'),_0x28ba7c[_0x93f5('0x3b')]));if(!this['isConfigured'](_0x28ba7c['aws_access_key_id'])||!this['isConfigured'](_0x28ba7c[_0x93f5('0x121')])){return this['channel'][_0x93f5('0xa8')](_0x93f5('0x122'));}if(!this['isConfigured'](_0x28ba7c[_0x93f5('0x8d')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x28ba7c[_0x93f5('0x5d')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')]('no\x20text\x20configured');}this['channel'][_0x93f5('0xe9')]=!![];this[_0x93f5('0x38')](_0x28ba7c);this[_0x93f5('0x45')](_0x28ba7c[_0x93f5('0x5d')],'in','','');this[_0x93f5('0x39')][_0x93f5('0xa8')](util['format'](_0x93f5('0x127'),_0x28ba7c['text']));var _0x1e1db2=this[_0x93f5('0x8b')][_0x93f5('0xa4')](this,_0x28ba7c);if(_0x1e1db2){for(var _0x3664b in _0x1e1db2){if(_0x1e1db2[_0x93f5('0x94')](_0x3664b)&&_['isString'](_0x1e1db2[_0x3664b])){this['channel'][_0x93f5('0xa3')](util[_0x93f5('0x2b')](_0x93f5('0x128'),_0x3664b[_0x93f5('0x6b')]()),_0x1e1db2[_0x3664b]);}}if(_[_0x93f5('0x48')](_0x1e1db2[_0x93f5('0x77')])){return this['channel']['noop'](_0x93f5('0x129'));}else{this[_0x93f5('0x45')](_0x1e1db2[_0x93f5('0x77')],_0x93f5('0xec'),'amazonlex','');return this[_0x93f5('0x39')]['noop'](util[_0x93f5('0x2b')](_0x93f5('0x12a'),_0x1e1db2[_0x93f5('0x77')]));}}return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x28ba7c,_0x93f5('0x12b'));};AGIVertices[_0x93f5('0x12')]['googleasr']=function(_0x13edde){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x13edde[_0x93f5('0x3b')],_0x13edde[_0x93f5('0x67')]));if(!this[_0x93f5('0x85')](_0x13edde[_0x93f5('0x7a')])){return this[_0x93f5('0x39')]['noop'](_0x93f5('0xe8'));}var _0xd6a4d7='wav';var _0x250b2f=util[_0x93f5('0x2b')](_0x93f5('0x12c'),FILES_PATH,rs['generate'](0x4));var _0x1a19ed=util['format'](_0x93f5('0x9d'),_0x250b2f,_0xd6a4d7);var _0x24f1d3=!![];if(_0x13edde[_0x93f5('0x12d')]===_0x93f5('0x12e')){_0x24f1d3=![];}var _0x487379=this[_0x93f5('0x39')]['recordFile'](_0x250b2f,_0xd6a4d7,_0x13edde[_0x93f5('0x12f')],_0x13edde[_0x93f5('0x67')],undefined,_0x24f1d3);if(_0x487379[_0x93f5('0xb1')]!==-0x1){this['channel'][_0x93f5('0xa8')](util['format']('google\x20%s\x20file\x20created',_0x1a19ed));var _0x5871a7=this[_0x93f5('0x8e')]['sync'](this,_0x13edde,_0x1a19ed);if(_0x5871a7){for(var _0x145bf7 in _0x5871a7){if(_0x5871a7[_0x93f5('0x94')](_0x145bf7)){this[_0x93f5('0x39')][_0x93f5('0xa3')](util[_0x93f5('0x2b')](_0x93f5('0x130'),_0x145bf7[_0x93f5('0x6b')]()),_0x5871a7[_0x145bf7]);}}return this['channel'][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x131'),JSON[_0x93f5('0x74')](_0x5871a7)));}}return _0x487379;};AGIVertices[_0x93f5('0x12')][_0x93f5('0x132')]=function(_0xad9f78){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x133'),_0xad9f78[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0xad9f78[_0x93f5('0x91')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0x134'));}if(!this[_0x93f5('0x85')](_0xad9f78[_0x93f5('0x92')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')]('no\x20appsecret\x20configured');}var _0x569aa5=_0x93f5('0x135');var _0x473c0c=util['format'](_0x93f5('0x12c'),FILES_PATH,rs[_0x93f5('0x11b')](0x4));var _0x1bb3c9=util['format'](_0x93f5('0x9d'),_0x473c0c,_0x569aa5);var _0x16f471=!![];if(_0xad9f78[_0x93f5('0x12d')]==='NOBEEP'){_0x16f471=![];}var _0x2408c2=this[_0x93f5('0x39')][_0x93f5('0x136')](_0x473c0c,_0x569aa5,_0xad9f78[_0x93f5('0x12f')],_0xad9f78[_0x93f5('0x67')],undefined,_0x16f471);if(_0x2408c2['result']!==-0x1){this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')]('tilde\x20%s\x20file\x20created',_0x1bb3c9));var _0x169e50=this[_0x93f5('0x90')][_0x93f5('0xa4')](this,_0xad9f78,_0x1bb3c9);if(_0x169e50){for(var _0x3cef5f in _0x169e50){if(_0x169e50[_0x93f5('0x94')](_0x3cef5f)){this[_0x93f5('0x39')][_0x93f5('0xa3')](util['format'](_0x93f5('0x137'),_0x3cef5f[_0x93f5('0x6b')]()),_0x169e50[_0x3cef5f]);}}return this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x138'),JSON['stringify'](_0x169e50)));}}return _0x2408c2;};AGIVertices['prototype'][_0x93f5('0x139')]=function(_0x3516e8){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x3516e8[_0x93f5('0x3b')]));return this[_0x93f5('0x39')][_0x93f5('0x13a')](_0x3516e8[_0x93f5('0x41')],_0x3516e8[_0x93f5('0x42')],_0x3516e8[_0x93f5('0x13b')]);};AGIVertices[_0x93f5('0x12')]['gotoif']=function(_0x36cc0a){logger[_0x93f5('0x2f')](util['format'](_0x93f5('0x13c'),_0x36cc0a[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x36cc0a[_0x93f5('0x13d')])){return this['channel']['error'](_0x36cc0a,_0x93f5('0x13e'));}try{var _0x41d795=eval(_0x36cc0a[_0x93f5('0x13d')])?_0x93f5('0x13f'):_0x93f5('0x140');this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x141'),_0x36cc0a[_0x93f5('0x13d')],_0x41d795));return{'code':0xc8,'result':_0x41d795};}catch(_0x311718){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype']['gotoiftime']=function(_0x2787ef){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x142'),_0x2787ef[_0x93f5('0x3b')]));if(!this['isConfigured'](_0x2787ef['interval_id'])){return this['channel'][_0x93f5('0x51')](_0x2787ef,_0x93f5('0x143'));}var _0x1f27c4=this[_0x93f5('0x26')][_0x93f5('0xa4')](this,_0x2787ef[_0x93f5('0x144')]);if(!_0x1f27c4){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x2787ef,'no\x20intervals\x20found');}for(var _0x2a9f8c=0x0;_0x2a9f8c<_0x1f27c4[_0x93f5('0x9c')];_0x2a9f8c+=0x1){var _0x3c7bb2=this[_0x93f5('0x39')][_0x93f5('0x13')](util[_0x93f5('0x2b')](_0x93f5('0x145'),_0x1f27c4[_0x2a9f8c]));if(_0x3c7bb2[_0x93f5('0xb1')]===-0x1){return _0x3c7bb2;}logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x146'),_0x1f27c4[_0x2a9f8c],_0x3c7bb2[_0x93f5('0xa0')]));if(_0x3c7bb2[_0x93f5('0xa0')]==='true'){logger[_0x93f5('0x2f')](util['format'](_0x93f5('0x146'),_0x1f27c4[_0x2a9f8c],_0x93f5('0x13f')));this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x146'),_0x1f27c4[_0x2a9f8c],_0x93f5('0x13f')));return{'code':0xc8,'result':_0x93f5('0x13f')};}else{logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x146'),_0x1f27c4[_0x2a9f8c],_0x93f5('0x140')));this[_0x93f5('0x39')]['noop'](util[_0x93f5('0x2b')](_0x93f5('0x146'),_0x1f27c4[_0x2a9f8c],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0x93f5('0x147')]=function(_0x478ac1){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x148'),_0x478ac1[_0x93f5('0x3b')]));return this[_0x93f5('0x39')]['hangup']();};AGIVertices[_0x93f5('0x12')][_0x93f5('0x149')]=function(_0x1aa1b1){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x14a'),_0x1aa1b1[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x1aa1b1[_0x93f5('0x7a')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')]('no\x20key\x20configured');}var _0x51d24d=_0x93f5('0x135');var _0x574af2=util['format'](_0x93f5('0x12c'),FILES_PATH,rs[_0x93f5('0x11b')](0x4));var _0xfa7ee5=util[_0x93f5('0x2b')]('%s.%s',_0x574af2,_0x51d24d);var _0x4ea87a=!![];if(_0x1aa1b1[_0x93f5('0x12d')]===_0x93f5('0x12e')){_0x4ea87a=![];}var _0x28d943=this[_0x93f5('0x39')][_0x93f5('0x136')](_0x574af2,_0x51d24d,_0x1aa1b1[_0x93f5('0x12f')],_0x1aa1b1['timeout'],undefined,_0x4ea87a);if(_0x28d943[_0x93f5('0xb1')]!==-0x1){this['channel']['noop'](util[_0x93f5('0x2b')](_0x93f5('0x14b'),_0xfa7ee5));var _0x489050=this[_0x93f5('0x84')][_0x93f5('0xa4')](this,_0x1aa1b1,_0xfa7ee5);if(_0x489050){for(var _0x2b7fb6 in _0x489050){if(_0x489050[_0x93f5('0x94')](_0x2b7fb6)){this[_0x93f5('0x39')][_0x93f5('0xa3')](util[_0x93f5('0x2b')](_0x93f5('0x14c'),_0x2b7fb6[_0x93f5('0x6b')]()),_0x489050[_0x2b7fb6]);}}return this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x14d'),JSON['stringify'](_0x489050)));}}return _0x28d943;};AGIVertices[_0x93f5('0x12')][_0x93f5('0x14e')]=function(_0x2e075b){logger['info'](util[_0x93f5('0x2b')](_0x93f5('0x14f'),_0x2e075b[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x2e075b[_0x93f5('0x7a')])){return this['channel'][_0x93f5('0xa8')]('no\x20key\x20configured');}if(!this[_0x93f5('0x85')](_0x2e075b[_0x93f5('0x5d')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')]('no\x20text\x20configured');}this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x150'),_0x2e075b[_0x93f5('0x5d')]));var _0x292a73=this[_0x93f5('0x81')]['sync'](this,_0x2e075b);if(_0x292a73){this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x14b'),_0x292a73));var _0x583abb=this[_0x93f5('0x39')][_0x93f5('0x101')](_0x292a73,_0x2e075b[_0x93f5('0x12f')]);try{fs[_0x93f5('0x102')](_0x292a73+_0x93f5('0x103'));}catch(_0x566572){logger[_0x93f5('0x51')](_0x566572);}return _0x583abb;}return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x2e075b,_0x93f5('0x151'));};AGIVertices[_0x93f5('0x12')][_0x93f5('0x152')]=function(_0x2766b4){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x153'),_0x2766b4[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x2766b4[_0x93f5('0x154')])){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x2766b4,_0x93f5('0x155'));}logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x156'),this[_0x93f5('0x39')][_0x93f5('0x3f')],_0x2766b4[_0x93f5('0x154')]));var _0x410a91=this[_0x93f5('0x54')][_0x93f5('0xa4')](this,_0x2766b4[_0x93f5('0x154')]);if(_0x410a91){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x157'),this[_0x93f5('0x39')][_0x93f5('0x3f')],_0x2766b4[_0x93f5('0x154')]));this[_0x93f5('0x39')][_0x93f5('0xa8')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x93f5('0x39')]['callerid'],_0x2766b4['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x158'),this[_0x93f5('0x39')][_0x93f5('0x3f')],_0x2766b4[_0x93f5('0x154')]));this[_0x93f5('0x39')][_0x93f5('0xa8')](util['format'](_0x93f5('0x158'),this['channel'][_0x93f5('0x3f')],_0x2766b4['findBy']));return{'code':0xc8,'result':_0x93f5('0x159')};}};AGIVertices[_0x93f5('0x12')][_0x93f5('0x15a')]=function(_0x2c652a){logger[_0x93f5('0x2f')](util['format'](_0x93f5('0x15b'),_0x2c652a[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x2c652a[_0x93f5('0x154')])){return this[_0x93f5('0x39')]['error'](_0x2c652a,_0x93f5('0x155'));}logger['info'](util[_0x93f5('0x2b')](_0x93f5('0x156'),this[_0x93f5('0x39')][_0x93f5('0x3f')],_0x2c652a[_0x93f5('0x154')]));var _0x40f8b1=this['agentLogout'][_0x93f5('0xa4')](this,_0x2c652a[_0x93f5('0x154')]);if(_0x40f8b1){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x157'),this[_0x93f5('0x39')][_0x93f5('0x3f')],_0x2c652a[_0x93f5('0x154')]));this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x93f5('0x39')]['callerid'],_0x2c652a[_0x93f5('0x154')]));return{'code':0xc8,'result':_0x93f5('0x15c')};}else{logger['info'](util[_0x93f5('0x2b')](_0x93f5('0x158'),this[_0x93f5('0x39')][_0x93f5('0x3f')],_0x2c652a[_0x93f5('0x154')]));this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x158'),this[_0x93f5('0x39')][_0x93f5('0x3f')],_0x2c652a['findBy']));return{'code':0xc8,'result':_0x93f5('0x159')};}};AGIVertices[_0x93f5('0x12')]['math']=function(_0x2513c9){logger['info'](util[_0x93f5('0x2b')](_0x93f5('0x15d'),_0x2513c9[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x2513c9[_0x93f5('0x15e')])){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x2513c9,_0x93f5('0x15f'));}this[_0x93f5('0x39')][_0x93f5('0xa8')](util['format'](_0x93f5('0x160'),_0x2513c9[_0x93f5('0x15e')]));var _0x1129cc=eval(_0x2513c9['operation']);if(!this[_0x93f5('0x85')](_0x2513c9[_0x93f5('0xd5')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xd6'));}var _0x39516e=this[_0x93f5('0x13')]['sync'](this,_0x2513c9[_0x93f5('0xd5')]);if(!_0x39516e){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x2513c9,'no\x20variable\x20found');}if(_[_0x93f5('0x99')](_0x1129cc)){var _0x486c57=this;_0x1129cc[_0x93f5('0xd8')](function(_0x36f8e9,_0x33b90a){_0x486c57[_0x93f5('0x39')][_0x93f5('0xa3')](util['format'](_0x93f5('0x161'),_0x39516e,_0x33b90a),_0x36f8e9);});return this[_0x93f5('0x39')]['noop'](util[_0x93f5('0x2b')]('variable\x20%s[key]\x20set',_0x39516e));}else{return this[_0x93f5('0x39')][_0x93f5('0xa3')](_0x39516e,_0x1129cc);}};AGIVertices['prototype'][_0x93f5('0xd')]=function(_0x21e1e3){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x21e1e3['label']));if(_0x21e1e3[_0x93f5('0xa5')]===0x0){return this[_0x93f5('0xa6')](_0x21e1e3);}_0x21e1e3[_0x93f5('0xa5')]-=0x1;if(!this['isConfigured'](_0x21e1e3[_0x93f5('0x112')])){return this[_0x93f5('0x39')]['error'](_0x21e1e3,'no\x20file\x20audio\x20selected');}var _0x5495dc=this[_0x93f5('0x20')][_0x93f5('0xa4')](this,_0x21e1e3[_0x93f5('0x112')]);if(!_0x5495dc){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x21e1e3,_0x93f5('0x114'));}var _0x5a46b4=this['channel'][_0x93f5('0x115')](_0x5495dc,_0x21e1e3[_0x93f5('0x116')],_0x21e1e3[_0x93f5('0x162')]);var _0x4f7964=_0x5a46b4[_0x93f5('0xb1')];if(_0x5a46b4[_0x93f5('0xb1')]===-0x1){this[_0x93f5('0x38')]['sync'](this,_0x21e1e3,'-1');return _0x5a46b4;}else if(_0x5a46b4[_0x93f5('0xa0')]===_0x93f5('0x67')){_0x5a46b4[_0x93f5('0xb1')]=_0x5a46b4[_0x93f5('0xb1')][_0x93f5('0x9c')]>0x0?_0x5a46b4[_0x93f5('0xb1')]:'t';}else if(_['isEmpty'](_0x5a46b4['result'])){_0x5a46b4[_0x93f5('0xb1')]='#';_0x4f7964='#';}if(!this[_0x93f5('0x85')](_0x21e1e3['variable_id'])){this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xd6'));}else{var _0x4c26e1=this[_0x93f5('0x13')][_0x93f5('0xa4')](this,_0x21e1e3[_0x93f5('0xd5')]);if(!_0x4c26e1){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x21e1e3,'no\x20variable\x20found');}this[_0x93f5('0x39')][_0x93f5('0xa3')](_0x4c26e1,_0x4f7964);}this[_0x93f5('0x38')][_0x93f5('0xa4')](this,_0x21e1e3,_0x4f7964);return _0x5a46b4;};AGIVertices['prototype'][_0x93f5('0xa8')]=function(_0x5b7a5a){logger['info'](util['format'](_0x93f5('0x163'),_0x5b7a5a[_0x93f5('0x3b')]));return this['channel'][_0x93f5('0xa8')](_0x5b7a5a[_0x93f5('0x164')]||_0x5b7a5a['label']);};AGIVertices[_0x93f5('0x12')]['pause']=function(_0x1068f4){logger['info'](util['format'](_0x93f5('0x165'),_0x1068f4['label']));if(!this[_0x93f5('0x85')](_0x1068f4[_0x93f5('0x154')])){return this['channel']['error'](_0x1068f4,'no\x20find\x20by\x20configured');}logger['info'](util[_0x93f5('0x2b')](_0x93f5('0x156'),this[_0x93f5('0x39')]['callerid'],_0x1068f4[_0x93f5('0x154')]));var _0xbdd4c6=this[_0x93f5('0x4e')][_0x93f5('0xa4')](this,_0x1068f4[_0x93f5('0x166')]);var _0x3072b3=this[_0x93f5('0x50')][_0x93f5('0xa4')](this,_0x1068f4[_0x93f5('0x154')],_0xbdd4c6);if(_0x3072b3){logger['info'](util[_0x93f5('0x2b')](_0x93f5('0x157'),this[_0x93f5('0x39')]['callerid'],_0x1068f4[_0x93f5('0x154')]));this[_0x93f5('0x39')]['noop'](util[_0x93f5('0x2b')](_0x93f5('0x157'),this[_0x93f5('0x39')]['callerid'],_0x1068f4[_0x93f5('0x154')]));return{'code':0xc8,'result':_0x93f5('0x15c')};}else{logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x158'),this['channel'][_0x93f5('0x3f')],_0x1068f4['findBy']));this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x93f5('0x39')][_0x93f5('0x3f')],_0x1068f4[_0x93f5('0x154')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x93f5('0x12')][_0x93f5('0x167')]=function(_0x24011b){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x168'),_0x24011b[_0x93f5('0x3b')]));if(!this['isConfigured'](_0x24011b[_0x93f5('0x112')])){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x24011b,_0x93f5('0x113'));}var _0x3c586c=this['getSound'][_0x93f5('0xa4')](this,_0x24011b[_0x93f5('0x112')]);if(!_0x3c586c){return this['channel'][_0x93f5('0x51')](_0x24011b,_0x93f5('0x114'));}var _0x34f3dd=this['channel'][_0x93f5('0x58')](_0x93f5('0x169'),[_0x3c586c,_0x24011b['opts']]);if(_0x34f3dd[_0x93f5('0xb1')]===-0x1){return _0x34f3dd;}return this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x16a'),'PLAYBACK',_0x3c586c));};AGIVertices[_0x93f5('0x12')][_0x93f5('0x16b')]=function(_0x54a23a){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x16c'),_0x54a23a[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x54a23a[_0x93f5('0x16d')])){return this['channel']['error'](_0x54a23a,_0x93f5('0x16e'));}var _0x3c84bf='';var _0x199d02=parseInt(_0x54a23a[_0x93f5('0x16d')],0xa);if(isNaN(_0x199d02)){_0x3c84bf=_0x54a23a[_0x93f5('0x16d')];}else{_0x3c84bf=this[_0x93f5('0x17')][_0x93f5('0xa4')](this,_0x54a23a['queue_id']);if(!_0x3c84bf){return this['channel'][_0x93f5('0x51')](_0x54a23a,'no\x20queue\x20found');}}var _0x2175d5='';if(this[_0x93f5('0x85')](_0x54a23a[_0x93f5('0x112')])){var _0x32b63a=this[_0x93f5('0x20')]['sync'](this,_0x54a23a[_0x93f5('0x112')]);if(_0x32b63a){_0x2175d5=_0x32b63a;}}this[_0x93f5('0x38')][_0x93f5('0xa4')](this,_0x54a23a,_0x3c84bf);if(_0x54a23a[_0x93f5('0xe4')]['indexOf']('x')<0x0){_0x54a23a[_0x93f5('0xe4')]+='x';}if(_0x54a23a['opts'][_0x93f5('0x16f')]('X')<0x0){_0x54a23a[_0x93f5('0xe4')]+='X';}this[_0x93f5('0x39')][_0x93f5('0xa3')](_0x93f5('0x170'),_0x3c84bf?_0x3c84bf['toLowerCase']():'');var _0x5e0a37=this[_0x93f5('0x39')][_0x93f5('0x58')]('QUEUE',[_0x3c84bf,_0x54a23a[_0x93f5('0xe4')],_0x54a23a[_0x93f5('0x73')],_0x2175d5,_0x54a23a[_0x93f5('0x67')],_0x54a23a[_0x93f5('0x8')],_0x54a23a[_0x93f5('0x171')],_0x54a23a[_0x93f5('0x172')],'',_0x54a23a['position']]);if(_0x5e0a37[_0x93f5('0xb1')]===-0x1){return _0x5e0a37;}return this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x16a'),_0x93f5('0x173'),_0x3c84bf));};AGIVertices['prototype'][_0x93f5('0x174')]=function(_0x523da2){logger[_0x93f5('0x2f')](util['format'](_0x93f5('0x175'),_0x523da2['label']));var _0x55a09c=_0x523da2['recordingFormat']||'wav';var _0x36ba0f=util['format'](_0x93f5('0x176'),this[_0x93f5('0x39')][_0x93f5('0x3a')],rs[_0x93f5('0x11b')](0x5));var _0x26f3ab=util[_0x93f5('0x2b')](_0x93f5('0x177'),FILES_PATH,_0x36ba0f,_0x55a09c);var _0xc82a6c=util[_0x93f5('0x2b')](_0x93f5('0x12c'),FILES_PATH,_0x36ba0f);this['createSquareRecording'][_0x93f5('0xa4')](this,_0x523da2,_0x36ba0f,_0x26f3ab);this[_0x93f5('0x39')][_0x93f5('0xa3')](_0x93f5('0x178'),_0x36ba0f);logger[_0x93f5('0x2f')](_0x93f5('0x179'),_0xc82a6c,_0x55a09c,_0x523da2[_0x93f5('0x17a')],_0x523da2[_0x93f5('0x67')]);return this[_0x93f5('0x39')][_0x93f5('0x136')](_0xc82a6c,_0x55a09c,_0x523da2['escape_digits'],_0x523da2[_0x93f5('0x67')],undefined,!![]);};AGIVertices[_0x93f5('0x12')][_0x93f5('0x17b')]=function(_0x18fb09){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x18fb09['label']));if(!this['isConfigured'](_0x18fb09['url'])){return this[_0x93f5('0x39')]['noop'](_0x93f5('0x17c'));}var _0x4cd1df=this['restAPI'][_0x93f5('0xa4')](this,_0x18fb09);logger['info'](util['format'](_0x93f5('0x17d'),util['inspect'](_0x4cd1df,{'showHidden':![],'depth':null})));if(!this[_0x93f5('0x85')](_0x18fb09['variable_id'])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0x17e'));}var _0x89308=this['getVariable'][_0x93f5('0xa4')](this,_0x18fb09[_0x93f5('0xd5')]);if(!_0x89308){return this[_0x93f5('0x39')]['error'](_0x18fb09,'no\x20variable\x20found');}this['channel'][_0x93f5('0xa3')](util[_0x93f5('0x2b')]('%s_STATUS_CODE',_0x89308),_0x4cd1df[_0x93f5('0x76')]?_0x4cd1df[_0x93f5('0x76')]:_0x93f5('0x17f'));this[_0x93f5('0x39')]['setVariable'](util[_0x93f5('0x2b')](_0x93f5('0x180'),_0x89308),_0x4cd1df[_0x93f5('0x181')]?_0x4cd1df[_0x93f5('0x181')]:'OK');if(_0x4cd1df[_0x93f5('0x6c')]){try{this[_0x93f5('0x9b')](_0x4cd1df[_0x93f5('0x6c')],_0x89308);}catch(_0x254916){logger['error'](util[_0x93f5('0x2b')](_0x93f5('0x182'),_0x89308));}}return this['channel'][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0xdc'),_0x89308));};AGIVertices[_0x93f5('0x12')]['saydigits']=function(_0x32a0db){logger['info'](util['format'](_0x93f5('0x183'),_0x32a0db[_0x93f5('0x3b')]));return this[_0x93f5('0x39')][_0x93f5('0x184')](_0x32a0db[_0x93f5('0x185')][_0x93f5('0xd4')](/\s+/g,''),_0x32a0db[_0x93f5('0x17a')]);};AGIVertices[_0x93f5('0x12')][_0x93f5('0x186')]=function(_0x39d2a6){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x187'),_0x39d2a6[_0x93f5('0x3b')]));return this[_0x93f5('0x39')][_0x93f5('0x188')](_0x39d2a6[_0x93f5('0x68')][_0x93f5('0xd4')](/\s+/g,''),_0x39d2a6[_0x93f5('0x17a')]);};AGIVertices[_0x93f5('0x12')][_0x93f5('0x189')]=function(_0x255d24){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x18a'),_0x255d24[_0x93f5('0x3b')]));return this['channel']['sayPhonetic'](_0x255d24['text'],_0x255d24[_0x93f5('0x17a')]);};AGIVertices[_0x93f5('0x12')][_0x93f5('0x18b')]=function(_0x132678){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x18c'),_0x132678['label']));if(!this[_0x93f5('0x85')](_0x132678[_0x93f5('0x18d')])){return this[_0x93f5('0x39')]['noop'](_0x93f5('0x18e'));}var _0x31d266=this['getMailAccount'][_0x93f5('0xa4')](this,_0x132678[_0x93f5('0x18d')]);if(!_0x31d266||!_0x31d266[_0x93f5('0x18f')]){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x132678,'no\x20mail\x20account\x20found');}var _0x2e2c68={'from':util[_0x93f5('0x2b')](_0x93f5('0x190'),_0x31d266[_0x93f5('0x16')],_0x31d266[_0x93f5('0x191')]||_0x31d266[_0x93f5('0x18f')]['user']),'to':_0x132678['to']||'','cc':_0x132678['cc']||'','bcc':_0x132678[_0x93f5('0x192')]||'','subject':_0x132678[_0x93f5('0x193')],'html':_0x132678[_0x93f5('0x5d')],'text':_0x132678[_0x93f5('0x5d')]};if(this[_0x93f5('0x85')](_0x132678[_0x93f5('0x194')])){}logger[_0x93f5('0xde')](_0x93f5('0x195'),JSON[_0x93f5('0x74')](_0x2e2c68));this[_0x93f5('0x38')][_0x93f5('0xa4')](this,_0x132678,_0x132678[_0x93f5('0x18d')]);this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x196'),_0x31d266[_0x93f5('0x16')]));this['sendMailMessage']['sync'](this,_0x31d266[_0x93f5('0x197')],_0x2e2c68);return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0x198'));};AGIVertices[_0x93f5('0x12')][_0x93f5('0x199')]=function(_0x1fde98){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x19a'),_0x1fde98['label']));return this['channel'][_0x93f5('0xa8')](_0x93f5('0x19b'));};AGIVertices[_0x93f5('0x12')][_0x93f5('0x19c')]=function(_0xbb523b){logger[_0x93f5('0x2f')](util['format'](_0x93f5('0x19d'),_0xbb523b['label']));if(!this[_0x93f5('0x85')](_0xbb523b[_0x93f5('0x19e')])){return this[_0x93f5('0x39')]['noop']('no\x20sms\x20account\x20configured');}var _0x1fe679=this[_0x93f5('0x36')][_0x93f5('0xa4')](this,_0xbb523b[_0x93f5('0x19e')]);if(!_0x1fe679){return this[_0x93f5('0x39')]['error'](_0xbb523b,_0x93f5('0x19f'));}var _0x5acb24={'body':_0xbb523b[_0x93f5('0x1a0')],'phone':_0xbb523b['to']||'','SmsAccountId':_0x1fe679['id']};logger['debug'](_0x93f5('0x1a1'),JSON[_0x93f5('0x74')](_0x5acb24));this[_0x93f5('0x38')][_0x93f5('0xa4')](this,_0xbb523b,_0xbb523b[_0x93f5('0x19e')]);this[_0x93f5('0x39')][_0x93f5('0xa8')](util['format'](_0x93f5('0x1a2'),_0x1fe679[_0x93f5('0x16')]));this['createSmsMessage'][_0x93f5('0xa4')](this,_0x5acb24);return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0x1a3'));};AGIVertices[_0x93f5('0x12')][_0x93f5('0x1a4')]=function(_0x1800a0){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x1800a0[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x1800a0[_0x93f5('0xd5')])){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x1800a0,_0x93f5('0x1a5'));}var _0x290381=this[_0x93f5('0x13')]['sync'](this,_0x1800a0['variable_id']);if(!_0x290381){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x1800a0,_0x93f5('0xd7'));}return this[_0x93f5('0x39')][_0x93f5('0xa3')](_0x290381,_0x1800a0[_0x93f5('0x1a6')]);};AGIVertices[_0x93f5('0x12')][_0x93f5('0x1a7')]=function(_0x43751a){logger['info'](util['format'](_0x93f5('0x1a8'),_0x43751a[_0x93f5('0x3b')]));this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0x1a9'));if(_0x43751a[_0x93f5('0xbc')]==='yes'){this[_0x93f5('0x39')][_0x93f5('0xa8')]('Answer');return this[_0x93f5('0x39')]['answer']();}return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0x1aa'));};AGIVertices[_0x93f5('0x12')]['subproject']=function(_0x2aaaf3){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x1ab'),_0x2aaaf3[_0x93f5('0x3b')]));if(!this['isConfigured'](_0x2aaaf3[_0x93f5('0x1ac')])){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x2aaaf3,'no\x20subproject\x20selected');}var _0x35a05e=this[_0x93f5('0x19')][_0x93f5('0xa4')](this,_0x2aaaf3[_0x93f5('0x1ac')]);if(!this[_0x93f5('0x85')](_0x35a05e)){return this['channel'][_0x93f5('0x51')](_0x2aaaf3,util[_0x93f5('0x2b')](_0x93f5('0x1ad'),_0x2aaaf3[_0x93f5('0x1ac')]));}if(_0x35a05e===this[_0x93f5('0x39')][_0x93f5('0x3d')]){return this['channel'][_0x93f5('0x51')](_0x2aaaf3,_0x93f5('0x1ae'));}this[_0x93f5('0x38')]['sync'](this,_0x2aaaf3,_0x35a05e);var _0x1ab8a3=this[_0x93f5('0x39')]['exec'](_0x93f5('0x1af'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x93f5('0x8')][_0x93f5('0x1b0')]||'127.0.0.1',_0x35a05e,this[_0x93f5('0x39')][_0x93f5('0x3d')]));if(_0x1ab8a3['result']===-0x1){return _0x1ab8a3;}return this[_0x93f5('0x39')]['noop'](util[_0x93f5('0x2b')](_0x93f5('0x16a'),_0x93f5('0x1af'),_0x35a05e));};AGIVertices['prototype'][_0x93f5('0x1b1')]=function(_0x3ee3ff){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x3ee3ff[_0x93f5('0x3b')]));var _0x2ba428=this[_0x93f5('0x57')][_0x93f5('0xa4')](this,_0x3ee3ff[_0x93f5('0xb9')]);this['createSquareDetailsReport']['sync'](this,_0x3ee3ff,_0x3ee3ff['command']);if(this[_0x93f5('0x85')](_0x3ee3ff[_0x93f5('0xd5')])){var _0x1a585b=this[_0x93f5('0x13')][_0x93f5('0xa4')](this,_0x3ee3ff[_0x93f5('0xd5')]);if(_0x1a585b){this[_0x93f5('0x39')][_0x93f5('0xa3')](_0x1a585b,_0x2ba428);return this['channel'][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x1b2'),_0x3ee3ff[_0x93f5('0xb9')],_0x1a585b));}}return this[_0x93f5('0x39')]['noop'](util['format'](_0x93f5('0x1b3'),_0x3ee3ff[_0x93f5('0xb9')]));};AGIVertices['prototype']['google_cloud_tts']=function(_0x264a89){logger['info'](util[_0x93f5('0x2b')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x264a89['label']));_0x264a89['text']=_0x264a89[_0x93f5('0x5d')][_0x93f5('0xd4')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x93f5('0x85')](_0x264a89['apiKey'])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0x1b4'));}if(!this['isConfigured'](_0x264a89[_0x93f5('0x5d')])){return this[_0x93f5('0x39')][_0x93f5('0xa8')](_0x93f5('0xa9'));}this['channel'][_0x93f5('0xa8')](util['format'](_0x93f5('0x1b5'),_0x264a89[_0x93f5('0x5d')]));var _0x277efd=this[_0x93f5('0x5a')][_0x93f5('0xa4')](this,_0x264a89);if(_0x277efd){this[_0x93f5('0x39')][_0x93f5('0xa8')](util['format'](_0x93f5('0x1b6'),_0x277efd));var _0x508bf6=this['channel'][_0x93f5('0x101')](_0x277efd);try{fs['unlink'](_0x277efd+'.wav');}catch(_0x47fa29){logger['error'](_0x47fa29);}return _0x508bf6;}return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x264a89,_0x93f5('0x1b7'));};AGIVertices[_0x93f5('0x12')]['tts']=function(_0x312ec6){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x312ec6[_0x93f5('0x3b')]));_0x312ec6[_0x93f5('0x5d')]=_0x312ec6[_0x93f5('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x93f5('0x85')](_0x312ec6[_0x93f5('0x5d')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x1b8'),_0x312ec6[_0x93f5('0x5d')]));var _0x30f5d3=this[_0x93f5('0x63')][_0x93f5('0xa4')](this,_0x312ec6);if(_0x30f5d3){this[_0x93f5('0x39')][_0x93f5('0xa8')](util[_0x93f5('0x2b')]('Google\x20TTS\x20%s\x20file\x20created',_0x30f5d3));var _0x6d5360=this[_0x93f5('0x39')][_0x93f5('0x101')](_0x30f5d3);try{fs[_0x93f5('0x102')](_0x30f5d3+_0x93f5('0x103'));}catch(_0x289fdf){logger[_0x93f5('0x51')](_0x289fdf);}return _0x6d5360;}return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x312ec6,_0x93f5('0x1b9'));};AGIVertices[_0x93f5('0x12')][_0x93f5('0x1ba')]=function(_0x3a138a){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x1bb'),_0x3a138a[_0x93f5('0x3b')]));if(!this[_0x93f5('0x85')](_0x3a138a['findBy'])){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x3a138a,_0x93f5('0x155'));}logger[_0x93f5('0x2f')](util['format'](_0x93f5('0x156'),this[_0x93f5('0x39')][_0x93f5('0x3f')],_0x3a138a[_0x93f5('0x154')]));var _0x12bf3a=this[_0x93f5('0x52')][_0x93f5('0xa4')](this,_0x3a138a['findBy']);if(_0x12bf3a){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x157'),this[_0x93f5('0x39')][_0x93f5('0x3f')],_0x3a138a['findBy']));this[_0x93f5('0x39')]['noop'](util['format'](_0x93f5('0x157'),this[_0x93f5('0x39')][_0x93f5('0x3f')],_0x3a138a[_0x93f5('0x154')]));return{'code':0xc8,'result':_0x93f5('0x15c')};}else{logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x158'),this[_0x93f5('0x39')][_0x93f5('0x3f')],_0x3a138a[_0x93f5('0x154')]));this['channel'][_0x93f5('0xa8')](util[_0x93f5('0x2b')](_0x93f5('0x158'),this['channel'][_0x93f5('0x3f')],_0x3a138a[_0x93f5('0x154')]));return{'code':0xc8,'result':_0x93f5('0x159')};}};AGIVertices[_0x93f5('0x12')][_0x93f5('0x1bc')]=function(_0xed0ada){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x1bd'),_0xed0ada['label']));var _0x18a60b=this[_0x93f5('0x39')][_0x93f5('0x58')]('VOICEMAIL',[_0xed0ada[_0x93f5('0x1be')],_0xed0ada[_0x93f5('0x78')]]);if(_0x18a60b[_0x93f5('0xb1')]===-0x1){return _0x18a60b;}return this[_0x93f5('0x39')][_0x93f5('0xa8')](util['format']('Executed\x20command\x20%s\x20%s',_0x93f5('0x1bf'),_0xed0ada[_0x93f5('0x1be')]));};AGIVertices['prototype']['vswitch']=function(_0x4a3270){logger[_0x93f5('0x2f')](util[_0x93f5('0x2b')](_0x93f5('0x1c0'),_0x4a3270['label']));if(!this['isConfigured'](_0x4a3270['variable_id'])){return this[_0x93f5('0x39')][_0x93f5('0x51')](_0x4a3270,_0x93f5('0x1a5'));}var _0x2360be=this[_0x93f5('0x13')][_0x93f5('0xa4')](this,_0x4a3270[_0x93f5('0xd5')]);if(!_0x2360be){return this[_0x93f5('0x39')]['error'](_0x4a3270,'no\x20variable\x20found');}var _0x28c2e2=this[_0x93f5('0x39')][_0x93f5('0x13')](_0x2360be);return{'code':0xc8,'result':_0x28c2e2['extra']?_0x28c2e2[_0x93f5('0xa0')]:'-'};};String[_0x93f5('0x12')]['replaceAll']=function(_0x2050f1,_0x26d2fe){return this['split'](_0x2050f1)['join'](_0x26d2fe);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index decd530..3342ce1 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 _0x0857=['isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','acw','../rpc/voiceAgentReport','voiceQueues','timers','channels','agentconnect','syncAgentConnect','hangup','bind','agentringnoanswer','syncAgentRingNoAnswer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','QueuePause','agents','getAgent','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','info','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','catch','finally','[ACW][START]\x20%s','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','syncHangupRequest','isUndefined','attended','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x0857,0x1af));var _0x7085=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x0857[_0x5bd426];return _0x23a7eb;};'use strict';var util=require('util');var _=require(_0x7085('0x0'));var moment=require(_0x7085('0x1'));var ami=require(_0x7085('0x2'));var logger=require('../../../config/logger')(_0x7085('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x7085('0x4'));function Acw(_0x456b28){this['voiceQueues']=_0x456b28[_0x7085('0x5')];this['agents']=_0x456b28['agents'];this[_0x7085('0x6')]=_0x456b28[_0x7085('0x6')];this[_0x7085('0x7')]={};ami['on'](_0x7085('0x8'),this[_0x7085('0x9')]['bind'](this));ami['on']('hanguprequest',this['syncHangupRequest']['bind'](this));ami['on'](_0x7085('0xa'),this['syncHangup'][_0x7085('0xb')](this));ami['on'](_0x7085('0xc'),this[_0x7085('0xd')][_0x7085('0xb')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x7085('0xb')](this));ami['on'](_0x7085('0xe'),this[_0x7085('0xf')]['bind'](this));ami['on']('custom:agentConnectPreview',this[_0x7085('0x10')][_0x7085('0xb')](this));}function getDiff(_0x4e5220){var _0x5adff7=moment()[_0x7085('0x11')](0x0);var _0x5e5648=moment(_0x4e5220)[_0x7085('0x11')](0x0);return _0x5adff7[_0x7085('0x12')](_0x5e5648,_0x7085('0x13'));}Acw[_0x7085('0x14')]['startAcw']=function(_0x14b6c9){try{var _0x1b1e0e=this;var _0x4dee38=this[_0x7085('0x7')][_0x14b6c9]['interface'];var _0x54d1ab=this[_0x7085('0x7')][_0x14b6c9][_0x7085('0x15')];var _0x37ae34=this[_0x7085('0x5')][_0x54d1ab];var _0x379d28=![];var _0x451243=_0x7085('0x16');if(_0x37ae34[_0x7085('0x17')]){if(_0x37ae34[_0x7085('0x18')]['name']){_0x379d28=!![];_0x451243=_0x37ae34[_0x7085('0x18')]['name'];}}ami[_0x7085('0x19')]({'action':_0x7085('0x1a'),'interface':_0x4dee38,'paused':!![],'reason':_0x451243})['then'](function(_0x3a8e5d){if(_0x1b1e0e[_0x7085('0x1b')][_0x4dee38]){return RpcUser[_0x7085('0x1c')](_0x1b1e0e[_0x7085('0x1b')][_0x4dee38]['id'])[_0x7085('0x1d')](function(_0x30ca0c){if(_0x30ca0c&&!_0x30ca0c[_0x7085('0x1e')]){logger['info'](_0x7085('0x1f'),_0x14b6c9,_0x4dee38,_0x54d1ab);var _0x55ce7d=_0x1b1e0e['channels'][_0x14b6c9]['attended']&&_0x1b1e0e['channels'][_0x14b6c9][_0x7085('0x20')]?_0x1b1e0e[_0x7085('0x7')][_0x14b6c9][_0x7085('0x20')]:_0x14b6c9;return RpcUser['savePause'](_0x1b1e0e['agents'][_0x4dee38],_0x451243,_0x55ce7d)[_0x7085('0x1d')](function(_0x46095d){if(!_0x379d28){_0x1b1e0e['timers'][_0x4dee38]={};logger[_0x7085('0x21')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x14b6c9,_0x1b1e0e['voiceQueues'][_0x54d1ab]['acwTimeout'],_0x4dee38,_0x54d1ab);_0x1b1e0e['timers'][_0x4dee38]['timer']=setTimeout(_0x1b1e0e['stopAcw'][_0x7085('0xb')](_0x1b1e0e,_0x4dee38),_0x1b1e0e[_0x7085('0x5')][_0x54d1ab][_0x7085('0x22')]*0x3e8);_0x1b1e0e[_0x7085('0x6')][_0x4dee38][_0x7085('0x23')]=moment()[_0x7085('0x24')](_0x7085('0x25'));_0x1b1e0e['timers'][_0x4dee38][_0x7085('0x26')]=_0x14b6c9;_0x1b1e0e[_0x7085('0x6')][_0x4dee38][_0x7085('0x15')]=_0x54d1ab;_0x1b1e0e[_0x7085('0x6')][_0x4dee38][_0x7085('0x27')]=function(){var _0x5efecc=getDiff(_0x1b1e0e[_0x7085('0x6')][_0x4dee38][_0x7085('0x23')]);clearTimeout(_0x1b1e0e['timers'][_0x4dee38][_0x7085('0x28')]);_0x1b1e0e[_0x7085('0x6')][_0x4dee38]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x5efecc},_0x1b1e0e[_0x7085('0x6')][_0x4dee38][_0x7085('0x26')],_0x4dee38)[_0x7085('0x1d')](function(_0x909807){logger[_0x7085('0x21')](_0x7085('0x29'),_0x14b6c9,_0x5efecc,_0x909807);})['catch'](function(_0x56be9b){logger[_0x7085('0x2a')](_0x7085('0x2b'),_0x14b6c9,_0x56be9b);});delete _0x1b1e0e['timers'][_0x4dee38];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x14b6c9,_0x4dee38,_0x54d1ab);}});}})[_0x7085('0x2c')](function(_0x444cf0){logger[_0x7085('0x2a')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x14b6c9,_0x1b1e0e[_0x7085('0x5')][_0x54d1ab][_0x7085('0x22')],_0x4dee38,_0x54d1ab);})[_0x7085('0x2d')](function(){delete _0x1b1e0e[_0x7085('0x7')][_0x14b6c9];});}catch(_0x365d74){logger[_0x7085('0x2a')](_0x7085('0x2e'),_0x365d74[_0x7085('0x2f')]);}};Acw['prototype'][_0x7085('0x30')]=function(_0xc2a967){try{var _0x2a9fe6=this;if(_0x2a9fe6[_0x7085('0x6')][_0xc2a967]){_0x2a9fe6[_0x7085('0x6')][_0xc2a967][_0x7085('0x28')]=![];var _0x456e1c=_0x2a9fe6['timers'][_0xc2a967][_0x7085('0x26')];var _0x85b21f=_0x2a9fe6[_0x7085('0x6')][_0xc2a967][_0x7085('0x15')];var _0x355726=_0x2a9fe6[_0x7085('0x5')][_0x85b21f][_0x7085('0x22')];logger[_0x7085('0x21')](_0x7085('0x31'),_0x456e1c,_0xc2a967);RpcUser['saveUnpause'](this[_0x7085('0x1b')][_0xc2a967]);RpcVoiceAgentReport[_0x7085('0x32')]({'acwtime':_0x355726,'agentacw':!![]},_0x456e1c,_0xc2a967)['then'](function(_0x25fe72){logger[_0x7085('0x21')](_0x7085('0x29'),_0x456e1c,_0x355726,_0x25fe72);})[_0x7085('0x2c')](function(_0x7c798e){logger['error'](_0x7085('0x2b'),_0x456e1c,_0x7c798e);});}else{logger[_0x7085('0x2a')](_0x7085('0x33'),_0xc2a967);if(_0x2a9fe6[_0x7085('0x6')]){logger[_0x7085('0x21')](_0x7085('0x34'),JSON[_0x7085('0x35')](_0x2a9fe6[_0x7085('0x6')]));}}}catch(_0x19b645){logger['error'](_0x7085('0x36'),_0x19b645[_0x7085('0x2f')]);}};Acw['prototype']['syncAgentConnect']=function(_0x10ebda){try{if(this[_0x7085('0x5')][_0x10ebda['queue']]&&(this[_0x7085('0x5')][_0x10ebda['queue']]['acw']||this[_0x7085('0x5')][_0x10ebda[_0x7085('0x15')]][_0x7085('0x17')])){if(this['agents'][_0x10ebda[_0x7085('0x37')]]){this[_0x7085('0x7')][_0x10ebda['uniqueid']]={'queue':_0x10ebda[_0x7085('0x15')],'interface':_0x10ebda[_0x7085('0x37')],'destlinkedid':_0x10ebda[_0x7085('0x20')]};}}}catch(_0x356996){logger[_0x7085('0x2a')]('[ACW][syncAgentConnect]\x20%s',_0x356996[_0x7085('0x2f')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x4709e9){try{if(this[_0x7085('0x5')][_0x4709e9[_0x7085('0x15')]]&&(this['voiceQueues'][_0x4709e9[_0x7085('0x15')]][_0x7085('0x3')]||this[_0x7085('0x5')][_0x4709e9[_0x7085('0x15')]][_0x7085('0x17')])){if(this[_0x7085('0x1b')][_0x4709e9[_0x7085('0x37')]]){this[_0x7085('0x7')][_0x4709e9[_0x7085('0x26')]]={'queue':_0x4709e9[_0x7085('0x15')],'interface':_0x4709e9[_0x7085('0x37')]};}}}catch(_0x49695c){logger[_0x7085('0x2a')]('[ACW][syncAgentConnectPreview]\x20%s',_0x49695c[_0x7085('0x2f')]);}};Acw[_0x7085('0x14')][_0x7085('0x38')]=function(_0x11014d){try{if(this[_0x7085('0x7')][_0x11014d['uniqueid']]&&_[_0x7085('0x39')](this['channels'][_0x11014d['uniqueid']][_0x7085('0x3a')])){logger[_0x7085('0x21')]('[%s][HANGUP:UNIQUEID]',_0x11014d[_0x7085('0x26')]);this['startAcw'](_0x11014d[_0x7085('0x26')]);}else if(this[_0x7085('0x7')][_0x11014d[_0x7085('0x3b')]]&&_[_0x7085('0x39')](this[_0x7085('0x7')][_0x11014d[_0x7085('0x3b')]][_0x7085('0x3a')])){logger['info'](_0x7085('0x3c'),_0x11014d[_0x7085('0x3b')]);this[_0x7085('0x3d')](_0x11014d[_0x7085('0x3b')]);}}catch(_0x4eebb2){logger[_0x7085('0x2a')](_0x7085('0x3e'),_0x4eebb2[_0x7085('0x2f')]);}};Acw[_0x7085('0x14')][_0x7085('0x3f')]=function(_0xcb0c62){try{if(this[_0x7085('0x7')][_0xcb0c62['uniqueid']]&&this[_0x7085('0x7')][_0xcb0c62[_0x7085('0x26')]][_0x7085('0x3a')]){logger[_0x7085('0x21')](_0x7085('0x40'),_0xcb0c62[_0x7085('0x26')]);this[_0x7085('0x3d')](_0xcb0c62[_0x7085('0x26')]);}else if(this[_0x7085('0x7')][_0xcb0c62[_0x7085('0x3b')]]&&this[_0x7085('0x7')][_0xcb0c62[_0x7085('0x3b')]][_0x7085('0x3a')]){logger[_0x7085('0x21')](_0x7085('0x41'),_0xcb0c62[_0x7085('0x3b')]);this['startAcw'](_0xcb0c62['linkedid']);}}catch(_0x54e975){logger[_0x7085('0x2a')]('[ACW][syncHangup]\x20%s',_0x54e975['message']);}};Acw[_0x7085('0x14')][_0x7085('0x42')]=function(_0x4c2622){try{if(!_[_0x7085('0x43')](this[_0x7085('0x7')][_0x4c2622[_0x7085('0x44')]])){this['startAcw'](_0x4c2622['transfereeuniqueid']);if(this[_0x7085('0x7')][_0x4c2622[_0x7085('0x45')]]){this[_0x7085('0x7')][_0x4c2622[_0x7085('0x45')]][_0x7085('0x3a')]=!![];this[_0x7085('0x7')][_0x4c2622[_0x7085('0x46')]]=this[_0x7085('0x7')][_0x4c2622[_0x7085('0x45')]];delete this[_0x7085('0x7')][_0x4c2622[_0x7085('0x45')]];}}else if(!_['isNil'](this['channels'][_0x4c2622[_0x7085('0x46')]])){this[_0x7085('0x3d')](_0x4c2622[_0x7085('0x46')]);if(this[_0x7085('0x7')][_0x4c2622['origtransfereruniqueid']]){this[_0x7085('0x7')][_0x4c2622[_0x7085('0x47')]][_0x7085('0x3a')]=!![];this[_0x7085('0x7')][_0x4c2622[_0x7085('0x44')]]=this['channels'][_0x4c2622[_0x7085('0x47')]];delete this['channels'][_0x4c2622[_0x7085('0x47')]];}}}catch(_0x5580f7){logger[_0x7085('0x2a')](_0x7085('0x48'),_0x5580f7['message']);}};Acw[_0x7085('0x14')][_0x7085('0xf')]=function(_0x2adb12){try{if(this['channels'][_0x2adb12['transfereruniqueid']]){logger['info'](_0x7085('0x49'),JSON['stringify'](_0x2adb12[_0x7085('0x4a')]));this[_0x7085('0x3d')](_0x2adb12[_0x7085('0x4a')]);}else if(this[_0x7085('0x7')][_0x2adb12['transfererlinkedid']]){logger[_0x7085('0x21')](_0x7085('0x4b'),JSON[_0x7085('0x35')](_0x2adb12[_0x7085('0x4c')]));this[_0x7085('0x3d')](_0x2adb12[_0x7085('0x4c')]);}}catch(_0x477173){logger['error'](_0x7085('0x4d'),_0x477173[_0x7085('0x2f')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x28152f){try{if(this[_0x7085('0x5')][_0x28152f[_0x7085('0x15')]]&&this[_0x7085('0x5')][_0x28152f['queue']]['autopause']===_0x7085('0x4e')){if(this[_0x7085('0x1b')][_0x28152f[_0x7085('0x37')]]){logger[_0x7085('0x21')](_0x7085('0x4f'),_0x28152f['uniqueid'],_0x28152f[_0x7085('0x37')],_0x28152f[_0x7085('0x15')]);return RpcUser[_0x7085('0x50')](this[_0x7085('0x1b')][_0x28152f[_0x7085('0x37')]],'Auto-Pause',_0x28152f['uniqueid']);}}}catch(_0x4492be){logger[_0x7085('0x2a')](_0x7085('0x51'),_0x4492be[_0x7085('0x2f')]);}};module[_0x7085('0x52')]=Acw; \ No newline at end of file +var _0x02c5=['autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','bind','syncHangupRequest','syncHangup','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','then','getAgent','voicePause','info','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','YYYY-MM-DD\x20HH:mm:ss','updateAcw','lastPauseAt','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','error','finally','message','prototype','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','acw','interface','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02c5,0xac));var _0x502c=function(_0x2f0057,_0x448b27){_0x2f0057=_0x2f0057-0x0;var _0x17f2c3=_0x02c5[_0x2f0057];return _0x17f2c3;};'use strict';var util=require(_0x502c('0x0'));var _=require(_0x502c('0x1'));var moment=require(_0x502c('0x2'));var ami=require('../ami');var logger=require(_0x502c('0x3'))('acw');var RpcUser=require(_0x502c('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x11e27d){this[_0x502c('0x5')]=_0x11e27d[_0x502c('0x5')];this[_0x502c('0x6')]=_0x11e27d[_0x502c('0x6')];this[_0x502c('0x7')]=_0x11e27d[_0x502c('0x7')];this[_0x502c('0x8')]={};ami['on'](_0x502c('0x9'),this['syncAgentConnect'][_0x502c('0xa')](this));ami['on']('hanguprequest',this[_0x502c('0xb')][_0x502c('0xa')](this));ami['on']('hangup',this[_0x502c('0xc')][_0x502c('0xa')](this));ami['on']('agentringnoanswer',this[_0x502c('0xd')][_0x502c('0xa')](this));ami['on'](_0x502c('0xe'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x502c('0xf'),this[_0x502c('0x10')]['bind'](this));ami['on'](_0x502c('0x11'),this['syncAgentConnectPreview'][_0x502c('0xa')](this));}function getDiff(_0x369015){var _0x2bc535=moment()['milliseconds'](0x0);var _0x4adbc4=moment(_0x369015)[_0x502c('0x12')](0x0);return _0x2bc535[_0x502c('0x13')](_0x4adbc4,_0x502c('0x14'));}Acw['prototype'][_0x502c('0x15')]=function(_0x180213){try{var _0x299376=this;var _0x28fa15=this[_0x502c('0x8')][_0x180213]['interface'];var _0x3c2b42=this[_0x502c('0x8')][_0x180213][_0x502c('0x16')];var _0x5888de=this[_0x502c('0x5')][_0x3c2b42];var _0x11bf57=![];var _0x265b68=_0x502c('0x17');if(_0x5888de[_0x502c('0x18')]){if(_0x5888de['mandatoryDispositionPause']['name']){_0x11bf57=!![];_0x265b68=_0x5888de[_0x502c('0x19')]['name'];}}ami[_0x502c('0x1a')]({'action':'QueuePause','interface':_0x28fa15,'paused':!![],'reason':_0x265b68})[_0x502c('0x1b')](function(_0x55ed05){if(_0x299376['agents'][_0x28fa15]){return RpcUser[_0x502c('0x1c')](_0x299376[_0x502c('0x6')][_0x28fa15]['id'])['then'](function(_0x40d672){if(_0x40d672&&!_0x40d672[_0x502c('0x1d')]){logger[_0x502c('0x1e')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x180213,_0x28fa15,_0x3c2b42);var _0x54e601=_0x299376[_0x502c('0x8')][_0x180213][_0x502c('0x1f')]&&_0x299376[_0x502c('0x8')][_0x180213]['destlinkedid']?_0x299376['channels'][_0x180213][_0x502c('0x20')]:_0x180213;return RpcUser[_0x502c('0x21')](_0x299376[_0x502c('0x6')][_0x28fa15],_0x265b68,_0x54e601)[_0x502c('0x1b')](function(_0x33ff4c){if(!_0x11bf57){_0x299376[_0x502c('0x7')][_0x28fa15]={};logger[_0x502c('0x1e')](_0x502c('0x22'),_0x180213,_0x299376[_0x502c('0x5')][_0x3c2b42][_0x502c('0x23')],_0x28fa15,_0x3c2b42);_0x299376[_0x502c('0x7')][_0x28fa15][_0x502c('0x24')]=setTimeout(_0x299376[_0x502c('0x25')][_0x502c('0xa')](_0x299376,_0x28fa15),_0x299376[_0x502c('0x5')][_0x3c2b42]['acwTimeout']*0x3e8);_0x299376[_0x502c('0x7')][_0x28fa15]['lastPauseAt']=moment()['format'](_0x502c('0x26'));_0x299376['timers'][_0x28fa15]['uniqueid']=_0x180213;_0x299376[_0x502c('0x7')][_0x28fa15][_0x502c('0x16')]=_0x3c2b42;_0x299376[_0x502c('0x7')][_0x28fa15][_0x502c('0x27')]=function(){var _0x265d0d=getDiff(_0x299376['timers'][_0x28fa15][_0x502c('0x28')]);clearTimeout(_0x299376[_0x502c('0x7')][_0x28fa15]['timer']);_0x299376[_0x502c('0x7')][_0x28fa15][_0x502c('0x24')]=![];RpcVoiceAgentReport[_0x502c('0x29')]({'acwtime':_0x265d0d},_0x299376[_0x502c('0x7')][_0x28fa15][_0x502c('0x2a')],_0x28fa15)[_0x502c('0x1b')](function(_0x5e95d7){logger[_0x502c('0x1e')](_0x502c('0x2b'),_0x180213,_0x265d0d,_0x5e95d7);})[_0x502c('0x2c')](function(_0x53b73c){logger['error'](_0x502c('0x2d'),_0x180213,_0x53b73c);});delete _0x299376[_0x502c('0x7')][_0x28fa15];};}});}else{logger[_0x502c('0x1e')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x180213,_0x28fa15,_0x3c2b42);}});}})[_0x502c('0x2c')](function(_0xf836e5){logger[_0x502c('0x2e')](_0x502c('0x22'),_0x180213,_0x299376[_0x502c('0x5')][_0x3c2b42]['acwTimeout'],_0x28fa15,_0x3c2b42);})[_0x502c('0x2f')](function(){delete _0x299376['channels'][_0x180213];});}catch(_0x408ab0){logger[_0x502c('0x2e')]('[ACW][START]\x20%s',_0x408ab0[_0x502c('0x30')]);}};Acw[_0x502c('0x31')][_0x502c('0x25')]=function(_0x3f5e3d){try{var _0x4e7536=this;if(_0x4e7536[_0x502c('0x7')][_0x3f5e3d]){_0x4e7536[_0x502c('0x7')][_0x3f5e3d][_0x502c('0x24')]=![];var _0xf1d566=_0x4e7536[_0x502c('0x7')][_0x3f5e3d][_0x502c('0x2a')];var _0xdcb7ca=_0x4e7536['timers'][_0x3f5e3d][_0x502c('0x16')];var _0x212ef1=_0x4e7536[_0x502c('0x5')][_0xdcb7ca][_0x502c('0x23')];logger['info'](_0x502c('0x32'),_0xf1d566,_0x3f5e3d);RpcUser['saveUnpause'](this['agents'][_0x3f5e3d]);RpcVoiceAgentReport[_0x502c('0x29')]({'acwtime':_0x212ef1,'agentacw':!![]},_0xf1d566,_0x3f5e3d)[_0x502c('0x1b')](function(_0x59fd27){logger[_0x502c('0x1e')](_0x502c('0x2b'),_0xf1d566,_0x212ef1,_0x59fd27);})['catch'](function(_0x4d457a){logger[_0x502c('0x2e')](_0x502c('0x2d'),_0xf1d566,_0x4d457a);});}else{logger[_0x502c('0x2e')](_0x502c('0x33'),_0x3f5e3d);if(_0x4e7536[_0x502c('0x7')]){logger[_0x502c('0x1e')](_0x502c('0x34'),JSON[_0x502c('0x35')](_0x4e7536['timers']));}}}catch(_0x2ba808){logger['error'](_0x502c('0x36'),_0x2ba808['message']);}};Acw[_0x502c('0x31')][_0x502c('0x37')]=function(_0x2e8285){try{if(this['voiceQueues'][_0x2e8285[_0x502c('0x16')]]&&(this[_0x502c('0x5')][_0x2e8285[_0x502c('0x16')]][_0x502c('0x38')]||this['voiceQueues'][_0x2e8285['queue']][_0x502c('0x18')])){if(this['agents'][_0x2e8285[_0x502c('0x39')]]){this[_0x502c('0x8')][_0x2e8285[_0x502c('0x2a')]]={'queue':_0x2e8285[_0x502c('0x16')],'interface':_0x2e8285[_0x502c('0x39')],'destlinkedid':_0x2e8285[_0x502c('0x20')]};}}}catch(_0x2dc382){logger[_0x502c('0x2e')]('[ACW][syncAgentConnect]\x20%s',_0x2dc382[_0x502c('0x30')]);}};Acw[_0x502c('0x31')]['syncAgentConnectPreview']=function(_0x506ec8){try{if(this[_0x502c('0x5')][_0x506ec8[_0x502c('0x16')]]&&(this['voiceQueues'][_0x506ec8['queue']][_0x502c('0x38')]||this['voiceQueues'][_0x506ec8['queue']][_0x502c('0x18')])){if(this[_0x502c('0x6')][_0x506ec8[_0x502c('0x39')]]){this['channels'][_0x506ec8[_0x502c('0x2a')]]={'queue':_0x506ec8[_0x502c('0x16')],'interface':_0x506ec8[_0x502c('0x39')]};}}}catch(_0x5b1ca8){logger[_0x502c('0x2e')](_0x502c('0x3a'),_0x5b1ca8['message']);}};Acw[_0x502c('0x31')][_0x502c('0xb')]=function(_0x2745fd){try{if(this[_0x502c('0x8')][_0x2745fd[_0x502c('0x2a')]]&&_[_0x502c('0x3b')](this[_0x502c('0x8')][_0x2745fd[_0x502c('0x2a')]][_0x502c('0x1f')])){logger[_0x502c('0x1e')](_0x502c('0x3c'),_0x2745fd[_0x502c('0x2a')]);this[_0x502c('0x15')](_0x2745fd['uniqueid']);}else if(this[_0x502c('0x8')][_0x2745fd[_0x502c('0x3d')]]&&_[_0x502c('0x3b')](this[_0x502c('0x8')][_0x2745fd[_0x502c('0x3d')]][_0x502c('0x1f')])){logger[_0x502c('0x1e')]('[%s][HANGUP:LINKEDID]',_0x2745fd['linkedid']);this['startAcw'](_0x2745fd['linkedid']);}}catch(_0x386d05){logger[_0x502c('0x2e')](_0x502c('0x3e'),_0x386d05[_0x502c('0x30')]);}};Acw[_0x502c('0x31')]['syncHangup']=function(_0xee2811){try{if(this[_0x502c('0x8')][_0xee2811[_0x502c('0x2a')]]&&this[_0x502c('0x8')][_0xee2811[_0x502c('0x2a')]]['attended']){logger['info'](_0x502c('0x3f'),_0xee2811[_0x502c('0x2a')]);this[_0x502c('0x15')](_0xee2811[_0x502c('0x2a')]);}else if(this['channels'][_0xee2811[_0x502c('0x3d')]]&&this[_0x502c('0x8')][_0xee2811[_0x502c('0x3d')]]['attended']){logger[_0x502c('0x1e')](_0x502c('0x40'),_0xee2811[_0x502c('0x3d')]);this[_0x502c('0x15')](_0xee2811[_0x502c('0x3d')]);}}catch(_0x4dad5c){logger[_0x502c('0x2e')](_0x502c('0x41'),_0x4dad5c[_0x502c('0x30')]);}};Acw[_0x502c('0x31')][_0x502c('0x42')]=function(_0x59ab8c){try{if(!_[_0x502c('0x43')](this[_0x502c('0x8')][_0x59ab8c[_0x502c('0x44')]])){this['startAcw'](_0x59ab8c['transfereeuniqueid']);if(this['channels'][_0x59ab8c[_0x502c('0x45')]]){this[_0x502c('0x8')][_0x59ab8c[_0x502c('0x45')]]['attended']=!![];this['channels'][_0x59ab8c[_0x502c('0x46')]]=this[_0x502c('0x8')][_0x59ab8c[_0x502c('0x45')]];delete this[_0x502c('0x8')][_0x59ab8c[_0x502c('0x45')]];}}else if(!_['isNil'](this[_0x502c('0x8')][_0x59ab8c['transfertargetuniqueid']])){this['startAcw'](_0x59ab8c[_0x502c('0x46')]);if(this[_0x502c('0x8')][_0x59ab8c[_0x502c('0x47')]]){this[_0x502c('0x8')][_0x59ab8c[_0x502c('0x47')]][_0x502c('0x1f')]=!![];this[_0x502c('0x8')][_0x59ab8c[_0x502c('0x44')]]=this[_0x502c('0x8')][_0x59ab8c[_0x502c('0x47')]];delete this[_0x502c('0x8')][_0x59ab8c[_0x502c('0x47')]];}}}catch(_0x187ee1){logger['error'](_0x502c('0x48'),_0x187ee1[_0x502c('0x30')]);}};Acw[_0x502c('0x31')][_0x502c('0x10')]=function(_0x2441d1){try{if(this[_0x502c('0x8')][_0x2441d1[_0x502c('0x49')]]){logger['info'](_0x502c('0x4a'),JSON[_0x502c('0x35')](_0x2441d1['transfereruniqueid']));this[_0x502c('0x15')](_0x2441d1[_0x502c('0x49')]);}else if(this[_0x502c('0x8')][_0x2441d1[_0x502c('0x4b')]]){logger[_0x502c('0x1e')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x502c('0x35')](_0x2441d1['transfererlinkedid']));this['startAcw'](_0x2441d1[_0x502c('0x4b')]);}}catch(_0x1625f9){logger[_0x502c('0x2e')](_0x502c('0x4c'),_0x1625f9[_0x502c('0x30')]);}};Acw[_0x502c('0x31')][_0x502c('0xd')]=function(_0x345a8f){try{if(this[_0x502c('0x5')][_0x345a8f[_0x502c('0x16')]]&&this['voiceQueues'][_0x345a8f[_0x502c('0x16')]][_0x502c('0x4d')]===_0x502c('0x4e')){if(this['agents'][_0x345a8f[_0x502c('0x39')]]){logger[_0x502c('0x1e')](_0x502c('0x4f'),_0x345a8f['uniqueid'],_0x345a8f[_0x502c('0x39')],_0x345a8f[_0x502c('0x16')]);return RpcUser[_0x502c('0x21')](this[_0x502c('0x6')][_0x345a8f[_0x502c('0x39')]],_0x502c('0x50'),_0x345a8f[_0x502c('0x2a')]);}}}catch(_0x3a10ff){logger['error'](_0x502c('0x51'),_0x3a10ff['message']);}};module[_0x502c('0x52')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index e384543..ca9bb26 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 _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2032,0xd9));var _0x2203=function(_0x393644,_0x127deb){_0x393644=_0x393644-0x0;var _0x176fa4=_0x2032[_0x393644];return _0x176fa4;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file +var _0xb7e7=['username','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','moment','lodash','ami','asterisk','port','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x3f9fae,_0x3e5b72){var _0x5906a2=function(_0x5874f4){while(--_0x5874f4){_0x3f9fae['push'](_0x3f9fae['shift']());}};_0x5906a2(++_0x3e5b72);}(_0xb7e7,0x121));var _0x7b7e=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xb7e7[_0x487b0c];return _0x1adbdc;};'use strict';var Manager=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var moment=require(_0x7b7e('0x1'));var util=require('util');var _=require(_0x7b7e('0x2'));var logger=require('../../config/logger')(_0x7b7e('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x7b7e('0x4')][_0x7b7e('0x5')],config[_0x7b7e('0x4')]['ip'],config['asterisk']['username'],config[_0x7b7e('0x4')][_0x7b7e('0x6')],!![]);ami[_0x7b7e('0x7')]();ami['Action']=BPromise[_0x7b7e('0x8')](ami[_0x7b7e('0x9')]);function error(_0x2917f9){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xc'),config[_0x7b7e('0x4')]['username'],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x2917f9,![],null)));}function close(){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xe'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x11')});};};ami[_0x7b7e('0x12')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x7b7e('0x14')});};};ami[_0x7b7e('0x15')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x16')});};};function connect(_0x2cc400){logger[_0x7b7e('0x17')](util[_0x7b7e('0xb')](_0x7b7e('0x18'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')](_0x7b7e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x7b7e('0x1b'),function(_0x43db4f){logger[_0x7b7e('0x17')](util['format'](_0x7b7e('0x1c'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x43db4f,![],null)));});ami['on'](_0x7b7e('0x1d'),function(_0x53bbb3){logger['info'](util['format'](_0x7b7e('0x1e'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x7b7e('0x1f')]()[_0x7b7e('0x20')](ami[_0x7b7e('0x21')]())[_0x7b7e('0x20')](ami[_0x7b7e('0x22')]())['then'](ami[_0x7b7e('0x12')]())[_0x7b7e('0x20')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7b7e('0x23')](function(_0x423832){logger['error'](_0x7b7e('0x24'),util['inspect'](_0x423832,{'showHidden':![],'depth':null}));});});ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')]('close',close);module[_0x7b7e('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 723c149..104564d 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 _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x382b8f,_0x5e0c9f){var _0x4c9b0e=function(_0x40a0b){while(--_0x40a0b){_0x382b8f['push'](_0x382b8f['shift']());}};_0x4c9b0e(++_0x5e0c9f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x45a72f,_0x3362f7){_0x45a72f=_0x45a72f-0x0;var _0x5a47d9=_0xb43b[_0x45a72f];return _0x5a47d9;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0xcb91[_0x3e21f4];return _0x40fc49;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 2d162b1..e6d9a43 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 _0x2457=['originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','isNil','string','voiceQueue','name','Contact','phone','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme'];(function(_0x288d82,_0x4c638a){var _0xcb9ff4=function(_0x5a492a){while(--_0x5a492a){_0x288d82['push'](_0x288d82['shift']());}};_0xcb9ff4(++_0x4c638a);}(_0x2457,0x1d6));var _0x7245=function(_0x2e9f06,_0x430be){_0x2e9f06=_0x2e9f06-0x0;var _0x1cac7f=_0x2457[_0x2e9f06];return _0x1cac7f;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x26ccbc,_0x2d1f15,_0x272f4f){var _0x1a9852='';if(!_[_0x7245('0x0')](_0x2d1f15)&&_0x7245('0x1')===typeof _0x2d1f15){_0x1a9852+=_0x2d1f15;}if(!_['isNil'](_0x272f4f)&&_0x7245('0x1')===typeof _0x272f4f){_0x1a9852+='\x20'+_0x272f4f;}if(_0x1a9852!==''){return _0x1a9852;}return _0x26ccbc;}function Action(_0x48b8d7,_0x4815f0,_0x5b953f){this[_0x7245('0x2')]=_0x48b8d7;this['uniqueid']=_0x5b953f||undefined;this[_0x7245('0x3')]=checkNameSurname(_0x4815f0[_0x7245('0x4')][_0x7245('0x5')],_0x4815f0[_0x7245('0x4')]['firstName'],_0x4815f0[_0x7245('0x4')][_0x7245('0x6')]);this[_0x7245('0x7')]=_0x4815f0[_0x7245('0x4')]['phone'];this[_0x7245('0x8')]=_0x48b8d7[_0x7245('0x3')];this[_0x7245('0x9')]=_0x4815f0[_0x7245('0x9')]||![];this[_0x7245('0xa')]=_0x48b8d7[_0x7245('0xa')];this[_0x7245('0xb')]=_0x48b8d7[_0x7245('0xb')]||0x3;this[_0x7245('0xc')]=_0x4815f0[_0x7245('0xc')];this[_0x7245('0xd')]=_0x4815f0['countbusyretry'];this[_0x7245('0xe')]=_0x4815f0[_0x7245('0xe')];this[_0x7245('0xf')]=_0x4815f0[_0x7245('0xf')];this['countnosuchnumberretry']=_0x4815f0['countnosuchnumberretry'];this[_0x7245('0x10')]=_0x4815f0[_0x7245('0x10')];this['countabandonedretry']=_0x4815f0[_0x7245('0x11')];this[_0x7245('0x12')]=_0x4815f0[_0x7245('0x12')];this[_0x7245('0x13')]=_0x4815f0[_0x7245('0x13')];this['ContactId']=_0x4815f0[_0x7245('0x14')];this[_0x7245('0x15')]=_0x4815f0[_0x7245('0x15')];this[_0x7245('0x16')]=_0x4815f0[_0x7245('0x16')];this[_0x7245('0x17')]=_0x4815f0['VoiceQueueId'];this[_0x7245('0x18')]=_0x4815f0['CampaignId'];this[_0x7245('0x19')]=_0x4815f0['id'];this['ContactFirstName']=_0x4815f0[_0x7245('0x4')][_0x7245('0x1a')]||'';this[_0x7245('0x1b')]=moment()[_0x7245('0x1c')](_0x7245('0x1d'));this['callback']=_0x4815f0[_0x7245('0x1e')];this[_0x7245('0x1f')]=_0x4815f0['callbackuniqueid'];this['callbackat']=_0x4815f0[_0x7245('0x20')];this[_0x7245('0x21')]=_0x4815f0[_0x7245('0x21')];this[_0x7245('0x22')]='';this['originatecalleridname']='';}Action[_0x7245('0x23')][_0x7245('0x24')]=function(){return util[_0x7245('0x1c')](_0x7245('0x25'),this[_0x7245('0x3')],this['voiceQueue'][_0x7245('0x26')]>0x0?this[_0x7245('0x7')][_0x7245('0x27')](this[_0x7245('0x2')][_0x7245('0x26')]):this[_0x7245('0x7')]);};Action[_0x7245('0x23')][_0x7245('0x28')]=function(){return this['queue'];};module[_0x7245('0x29')]=Action; \ No newline at end of file +var _0xea8a=['YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','voiceQueue','getQueue','exports','util','lodash','moment','isNil','string','name','Contact','phone','firstName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xea8a,0x164));var _0xaea8=function(_0x50826c,_0x14548a){_0x50826c=_0x50826c-0x0;var _0x48d10b=_0xea8a[_0x50826c];return _0x48d10b;};'use strict';var util=require(_0xaea8('0x0'));var _=require(_0xaea8('0x1'));var moment=require(_0xaea8('0x2'));function checkNameSurname(_0x1f66ce,_0x169835,_0x1ee9d0){var _0x4c068c='';if(!_['isNil'](_0x169835)&&'string'===typeof _0x169835){_0x4c068c+=_0x169835;}if(!_[_0xaea8('0x3')](_0x1ee9d0)&&_0xaea8('0x4')===typeof _0x1ee9d0){_0x4c068c+='\x20'+_0x1ee9d0;}if(_0x4c068c!==''){return _0x4c068c;}return _0x1f66ce;}function Action(_0x4385aa,_0x3620e8,_0x315790){this['voiceQueue']=_0x4385aa;this['uniqueid']=_0x315790||undefined;this[_0xaea8('0x5')]=checkNameSurname(_0x3620e8[_0xaea8('0x6')][_0xaea8('0x7')],_0x3620e8[_0xaea8('0x6')][_0xaea8('0x8')],_0x3620e8[_0xaea8('0x6')]['lastName']);this[_0xaea8('0x9')]=_0x3620e8[_0xaea8('0x6')]['phone'];this[_0xaea8('0xa')]=_0x4385aa[_0xaea8('0x5')];this['active']=_0x3620e8[_0xaea8('0xb')]||![];this[_0xaea8('0xc')]=_0x4385aa[_0xaea8('0xc')];this[_0xaea8('0xd')]=_0x4385aa[_0xaea8('0xd')]||0x3;this[_0xaea8('0xe')]=_0x3620e8[_0xaea8('0xe')];this['countbusyretry']=_0x3620e8[_0xaea8('0xf')];this['countcongestionretry']=_0x3620e8[_0xaea8('0x10')];this['countnoanswerretry']=_0x3620e8[_0xaea8('0x11')];this[_0xaea8('0x12')]=_0x3620e8[_0xaea8('0x12')];this[_0xaea8('0x13')]=_0x3620e8[_0xaea8('0x13')];this[_0xaea8('0x14')]=_0x3620e8[_0xaea8('0x14')];this[_0xaea8('0x15')]=_0x3620e8['countmachineretry'];this['countagentrejectretry']=_0x3620e8[_0xaea8('0x16')];this['ContactId']=_0x3620e8[_0xaea8('0x17')];this[_0xaea8('0x18')]=_0x3620e8[_0xaea8('0x18')];this[_0xaea8('0x19')]=_0x3620e8[_0xaea8('0x19')];this[_0xaea8('0x1a')]=_0x3620e8[_0xaea8('0x1a')];this[_0xaea8('0x1b')]=_0x3620e8[_0xaea8('0x1b')];this['idHopper']=_0x3620e8['id'];this[_0xaea8('0x1c')]=_0x3620e8['Contact']['firstName']||'';this[_0xaea8('0x1d')]=moment()[_0xaea8('0x1e')](_0xaea8('0x1f'));this[_0xaea8('0x20')]=_0x3620e8[_0xaea8('0x20')];this[_0xaea8('0x21')]=_0x3620e8[_0xaea8('0x21')];this[_0xaea8('0x22')]=_0x3620e8[_0xaea8('0x22')];this[_0xaea8('0x23')]=_0x3620e8[_0xaea8('0x23')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xaea8('0x24')]['getCaller']=function(){return util['format'](_0xaea8('0x25'),this['name'],this['voiceQueue'][_0xaea8('0x26')]>0x0?this['number'][_0xaea8('0x27')](this[_0xaea8('0x28')][_0xaea8('0x26')]):this['number']);};Action[_0xaea8('0x24')][_0xaea8('0x29')]=function(){return this[_0xaea8('0xa')];};module[_0xaea8('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 2ef4e72..168498c 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 _0x90de=['name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid'];(function(_0x4700a1,_0x2aba9d){var _0x22fb1e=function(_0x4054d6){while(--_0x4054d6){_0x4700a1['push'](_0x4700a1['shift']());}};_0x22fb1e(++_0x2aba9d);}(_0x90de,0x94));var _0xe90d=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0x90de[_0xd0a847];return _0x2536ec;};'use strict';var util=require(_0xe90d('0x0'));var _=require('lodash');var moment=require(_0xe90d('0x1'));function getSeconds(_0xc9b28e,_0x222113){var _0x44ea35=moment(_0xc9b28e)['milliseconds'](0x0);var _0x54a423=moment(_0x222113)[_0xe90d('0x2')](0x0);return _0x44ea35['diff'](_0x54a423,'seconds');}function AgentComplete(_0x55b2de,_0x317a8e){this[_0xe90d('0x3')]=0x4;this[_0xe90d('0x4')]=_0xe90d('0x5');this['scheduledat']=_0x55b2de[_0xe90d('0x6')];this[_0xe90d('0x7')]=_0x55b2de[_0xe90d('0x7')];this['campaigntype']=_0x55b2de['type']===_0xe90d('0x8')?_0xe90d('0x9'):_0x55b2de[_0xe90d('0x7')];this[_0xe90d('0xa')]=_0x55b2de[_0xe90d('0xa')];this[_0xe90d('0xb')]=_0x55b2de[_0xe90d('0xb')];this[_0xe90d('0xc')]=_0x55b2de['countnoanswerretry'];this[_0xe90d('0xd')]=_0x55b2de[_0xe90d('0xa')]+_0x55b2de[_0xe90d('0xb')]+_0x55b2de[_0xe90d('0xc')]+_0x55b2de[_0xe90d('0xe')]+_0x55b2de[_0xe90d('0xf')]+_0x55b2de[_0xe90d('0x10')]+_0x55b2de[_0xe90d('0x11')]+_0x55b2de[_0xe90d('0x12')];this[_0xe90d('0xe')]=_0x55b2de[_0xe90d('0xe')];this['countdropretry']=_0x55b2de[_0xe90d('0xf')];this[_0xe90d('0x10')]=_0x55b2de[_0xe90d('0x10')];this[_0xe90d('0x11')]=_0x55b2de[_0xe90d('0x11')];this[_0xe90d('0x12')]=_0x55b2de[_0xe90d('0x12')];this[_0xe90d('0x13')]=_0x317a8e[_0xe90d('0x13')];this['calleridname']=_0x55b2de[_0xe90d('0x14')];this['calleridnum']=_0x55b2de[_0xe90d('0x15')];this[_0xe90d('0x16')]=_0x55b2de[_0xe90d('0x16')];this[_0xe90d('0x17')]=_0x55b2de[_0xe90d('0x17')];this[_0xe90d('0x18')]=_0x55b2de[_0xe90d('0x18')];this[_0xe90d('0x19')]=moment()[_0xe90d('0x1a')](_0xe90d('0x1b'));this[_0xe90d('0x1c')]=getSeconds(_0x55b2de['responsetime'],_0x55b2de[_0xe90d('0x16')]);this['holdtime']=getSeconds(_0x55b2de['answertime'],_0x55b2de[_0xe90d('0x17')]);this[_0xe90d('0x1d')]=getSeconds(this['endtime'],_0x55b2de[_0xe90d('0x18')]);this[_0xe90d('0x9')]=_0x317a8e['queue'];this[_0xe90d('0x1e')]=_0x317a8e[_0xe90d('0x1e')];this[_0xe90d('0x1f')]=_0x317a8e[_0xe90d('0x1f')];this[_0xe90d('0x20')]=_0x55b2de[_0xe90d('0x20')];this['callbackuniqueid']=_0x55b2de[_0xe90d('0x21')];this[_0xe90d('0x22')]=_0x55b2de['callbackat'];this['recallme']=_0x55b2de[_0xe90d('0x23')];this[_0xe90d('0x24')]=_0x55b2de[_0xe90d('0x24')];this[_0xe90d('0x25')]=_0x55b2de[_0xe90d('0x25')];this['UserId']=_0x55b2de[_0xe90d('0x26')];this[_0xe90d('0x27')]=_0x55b2de['VoiceQueueId'];this['CampaignId']=_0x55b2de['CampaignId'];this['originatecalleridnum']=_0x55b2de[_0xe90d('0x28')]||'';this[_0xe90d('0x29')]=_0x55b2de['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xdc9d=['responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','name','calleridnum','number','starttime'];(function(_0x107e5e,_0xb25cd8){var _0xd7a0da=function(_0xc3340d){while(--_0xc3340d){_0x107e5e['push'](_0x107e5e['shift']());}};_0xd7a0da(++_0xb25cd8);}(_0xdc9d,0xda));var _0xddc9=function(_0xed36df,_0x1af3e4){_0xed36df=_0xed36df-0x0;var _0x18fa12=_0xdc9d[_0xed36df];return _0x18fa12;};'use strict';var util=require(_0xddc9('0x0'));var _=require('lodash');var moment=require(_0xddc9('0x1'));function getSeconds(_0x5b742b,_0x138ebc){var _0x266f56=moment(_0x5b742b)['milliseconds'](0x0);var _0x45d732=moment(_0x138ebc)[_0xddc9('0x2')](0x0);return _0x266f56['diff'](_0x45d732,'seconds');}function AgentComplete(_0x57d5af,_0x3c498e){this['state']=0x4;this['statedesc']='Answer';this[_0xddc9('0x3')]=_0x57d5af[_0xddc9('0x3')];this['type']=_0x57d5af[_0xddc9('0x4')];this[_0xddc9('0x5')]=_0x57d5af['type']===_0xddc9('0x6')?_0xddc9('0x7'):_0x57d5af[_0xddc9('0x4')];this[_0xddc9('0x8')]=_0x57d5af['countbusyretry'];this['countcongestionretry']=_0x57d5af[_0xddc9('0x9')];this[_0xddc9('0xa')]=_0x57d5af[_0xddc9('0xa')];this[_0xddc9('0xb')]=_0x57d5af[_0xddc9('0x8')]+_0x57d5af[_0xddc9('0x9')]+_0x57d5af[_0xddc9('0xa')]+_0x57d5af['countnosuchnumberretry']+_0x57d5af[_0xddc9('0xc')]+_0x57d5af[_0xddc9('0xd')]+_0x57d5af['countmachineretry']+_0x57d5af[_0xddc9('0xe')];this[_0xddc9('0xf')]=_0x57d5af['countnosuchnumberretry'];this[_0xddc9('0xc')]=_0x57d5af[_0xddc9('0xc')];this[_0xddc9('0xd')]=_0x57d5af['countabandonedretry'];this[_0xddc9('0x10')]=_0x57d5af[_0xddc9('0x10')];this['countagentrejectretry']=_0x57d5af[_0xddc9('0xe')];this['uniqueid']=_0x3c498e[_0xddc9('0x11')];this['calleridname']=_0x57d5af[_0xddc9('0x12')];this[_0xddc9('0x13')]=_0x57d5af[_0xddc9('0x14')];this[_0xddc9('0x15')]=_0x57d5af['starttime'];this[_0xddc9('0x16')]=_0x57d5af[_0xddc9('0x16')];this['answertime']=_0x57d5af[_0xddc9('0x17')];this[_0xddc9('0x18')]=moment()['format'](_0xddc9('0x19'));this[_0xddc9('0x1a')]=getSeconds(_0x57d5af[_0xddc9('0x16')],_0x57d5af['starttime']);this[_0xddc9('0x1b')]=getSeconds(_0x57d5af[_0xddc9('0x17')],_0x57d5af[_0xddc9('0x16')]);this[_0xddc9('0x1c')]=getSeconds(this[_0xddc9('0x18')],_0x57d5af[_0xddc9('0x17')]);this[_0xddc9('0x7')]=_0x3c498e['queue'];this['membername']=_0x3c498e[_0xddc9('0x1d')];this['reason']=_0x3c498e['reason'];this[_0xddc9('0x1e')]=_0x57d5af[_0xddc9('0x1e')];this[_0xddc9('0x1f')]=_0x57d5af[_0xddc9('0x1f')];this[_0xddc9('0x20')]=_0x57d5af[_0xddc9('0x20')];this[_0xddc9('0x21')]=_0x57d5af[_0xddc9('0x21')];this[_0xddc9('0x22')]=_0x57d5af[_0xddc9('0x22')];this[_0xddc9('0x23')]=_0x57d5af[_0xddc9('0x23')];this[_0xddc9('0x24')]=_0x57d5af[_0xddc9('0x24')];this['VoiceQueueId']=_0x57d5af['VoiceQueueId'];this[_0xddc9('0x25')]=_0x57d5af[_0xddc9('0x25')];this['originatecalleridnum']=_0x57d5af[_0xddc9('0x26')]||'';this[_0xddc9('0x27')]=_0x57d5af['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 0ae9825..7e7cafc 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 _0xdd0c=['diff','seconds','uniqueid','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds'];(function(_0x55f1ec,_0x107937){var _0x5b3a12=function(_0x4d66aa){while(--_0x4d66aa){_0x55f1ec['push'](_0x55f1ec['shift']());}};_0x5b3a12(++_0x107937);}(_0xdd0c,0x165));var _0xcdd0=function(_0x2d8cd5,_0x2481f0){_0x2d8cd5=_0x2d8cd5-0x0;var _0x50b3d7=_0xdd0c[_0x2d8cd5];return _0x50b3d7;};'use strict';var util=require('util');var _=require(_0xcdd0('0x0'));var moment=require(_0xcdd0('0x1'));function getSeconds(_0x3c0b5d,_0x5e3ada){var _0xe8ed9=moment(_0x3c0b5d)['milliseconds'](0x0);var _0x3d8684=moment(_0x5e3ada)[_0xcdd0('0x2')](0x0);return _0xe8ed9[_0xcdd0('0x3')](_0x3d8684,_0xcdd0('0x4'));}function Final(_0x17ad7d){this['uniqueid']=_0x17ad7d[_0xcdd0('0x5')];this[_0xcdd0('0x6')]=_0x17ad7d[_0xcdd0('0x6')];this[_0xcdd0('0x7')]=_0x17ad7d[_0xcdd0('0x7')];this['campaigntype']=_0x17ad7d[_0xcdd0('0x7')]==='outbound'?'queue':_0x17ad7d[_0xcdd0('0x7')];this[_0xcdd0('0x8')]=_0x17ad7d[_0xcdd0('0x8')];this[_0xcdd0('0x9')]=_0x17ad7d[_0xcdd0('0x9')];this[_0xcdd0('0xa')]=_0x17ad7d[_0xcdd0('0xa')];this[_0xcdd0('0xb')]=_0x17ad7d[_0xcdd0('0x8')]+_0x17ad7d[_0xcdd0('0x9')]+_0x17ad7d['countnoanswerretry']+_0x17ad7d['countnosuchnumberretry']+_0x17ad7d[_0xcdd0('0xc')]+_0x17ad7d[_0xcdd0('0xd')]+_0x17ad7d['countmachineretry']+_0x17ad7d[_0xcdd0('0xe')];this[_0xcdd0('0xf')]=_0x17ad7d['countnosuchnumberretry'];this[_0xcdd0('0xc')]=_0x17ad7d[_0xcdd0('0xc')];this[_0xcdd0('0xd')]=_0x17ad7d[_0xcdd0('0xd')];this[_0xcdd0('0x10')]=_0x17ad7d['countmachineretry'];this['countagentrejectretry']=_0x17ad7d[_0xcdd0('0xe')];this[_0xcdd0('0x11')]=_0x17ad7d[_0xcdd0('0x11')];this[_0xcdd0('0x12')]=_0x17ad7d[_0xcdd0('0x12')];this[_0xcdd0('0x13')]=_0x17ad7d[_0xcdd0('0x13')];this[_0xcdd0('0x14')]=_0x17ad7d[_0xcdd0('0x14')];this[_0xcdd0('0x15')]=_0x17ad7d['responsetime'];this[_0xcdd0('0x16')]=_0x17ad7d[_0xcdd0('0x15')];this['ringtime']=_0x17ad7d['ringtime']||0x0;this[_0xcdd0('0x17')]=_0x17ad7d[_0xcdd0('0x17')]||0x0;this['talktime']=_0x17ad7d[_0xcdd0('0x18')]||0x0;this['callback']=_0x17ad7d['callback'];this['callbackuniqueid']=_0x17ad7d[_0xcdd0('0x19')];this[_0xcdd0('0x1a')]=_0x17ad7d['callbackat'];this[_0xcdd0('0x1b')]=_0x17ad7d[_0xcdd0('0x1b')];this[_0xcdd0('0x1c')]=_0x17ad7d['ContactId'];this[_0xcdd0('0x1d')]=_0x17ad7d[_0xcdd0('0x1d')];this['UserId']=_0x17ad7d[_0xcdd0('0x1e')];this[_0xcdd0('0x1f')]=_0x17ad7d['VoiceQueueId'];this[_0xcdd0('0x20')]=_0x17ad7d['CampaignId'];this[_0xcdd0('0x21')]=_0x17ad7d[_0xcdd0('0x21')]||'';this[_0xcdd0('0x22')]=_0x17ad7d['originatecalleridname']||'';}module[_0xcdd0('0x23')]=Final; \ No newline at end of file +var _0x4b84=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x4b84,0x1cc));var _0x44b8=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x4b84[_0x6a0266];return _0x309e00;};'use strict';var util=require(_0x44b8('0x0'));var _=require(_0x44b8('0x1'));var moment=require('moment');function getSeconds(_0x5005fd,_0x765943){var _0x519db3=moment(_0x5005fd)['milliseconds'](0x0);var _0x3b26c7=moment(_0x765943)[_0x44b8('0x2')](0x0);return _0x519db3[_0x44b8('0x3')](_0x3b26c7,'seconds');}function Final(_0x4f875e){this['uniqueid']=_0x4f875e[_0x44b8('0x4')];this['scheduledat']=_0x4f875e[_0x44b8('0x5')];this['type']=_0x4f875e[_0x44b8('0x6')];this['campaigntype']=_0x4f875e['type']===_0x44b8('0x7')?_0x44b8('0x8'):_0x4f875e[_0x44b8('0x6')];this['countbusyretry']=_0x4f875e[_0x44b8('0x9')];this[_0x44b8('0xa')]=_0x4f875e[_0x44b8('0xa')];this[_0x44b8('0xb')]=_0x4f875e[_0x44b8('0xb')];this[_0x44b8('0xc')]=_0x4f875e[_0x44b8('0x9')]+_0x4f875e['countcongestionretry']+_0x4f875e[_0x44b8('0xb')]+_0x4f875e[_0x44b8('0xd')]+_0x4f875e['countdropretry']+_0x4f875e[_0x44b8('0xe')]+_0x4f875e['countmachineretry']+_0x4f875e[_0x44b8('0xf')];this[_0x44b8('0xd')]=_0x4f875e['countnosuchnumberretry'];this[_0x44b8('0x10')]=_0x4f875e['countdropretry'];this['countabandonedretry']=_0x4f875e[_0x44b8('0xe')];this[_0x44b8('0x11')]=_0x4f875e[_0x44b8('0x11')];this[_0x44b8('0xf')]=_0x4f875e['countagentrejectretry'];this['queue']=_0x4f875e['queue'];this[_0x44b8('0x12')]=_0x4f875e['calleridname'];this[_0x44b8('0x13')]=_0x4f875e[_0x44b8('0x13')];this['starttime']=_0x4f875e[_0x44b8('0x14')];this[_0x44b8('0x15')]=_0x4f875e['responsetime'];this[_0x44b8('0x16')]=_0x4f875e[_0x44b8('0x15')];this['ringtime']=_0x4f875e[_0x44b8('0x17')]||0x0;this[_0x44b8('0x18')]=_0x4f875e[_0x44b8('0x18')]||0x0;this[_0x44b8('0x19')]=_0x4f875e[_0x44b8('0x19')]||0x0;this[_0x44b8('0x1a')]=_0x4f875e[_0x44b8('0x1a')];this[_0x44b8('0x1b')]=_0x4f875e[_0x44b8('0x1b')];this[_0x44b8('0x1c')]=_0x4f875e[_0x44b8('0x1c')];this[_0x44b8('0x1d')]=_0x4f875e['recallme'];this[_0x44b8('0x1e')]=_0x4f875e[_0x44b8('0x1e')];this[_0x44b8('0x1f')]=_0x4f875e[_0x44b8('0x1f')];this[_0x44b8('0x20')]=_0x4f875e['UserId'];this[_0x44b8('0x21')]=_0x4f875e['VoiceQueueId'];this[_0x44b8('0x22')]=_0x4f875e[_0x44b8('0x22')];this[_0x44b8('0x23')]=_0x4f875e[_0x44b8('0x23')]||'';this[_0x44b8('0x24')]=_0x4f875e['originatecalleridname']||'';}module[_0x44b8('0x25')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 5e48de4..f8e81a3 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 _0xf3bf=['format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','name','calleridnum','starttime','responsetime','endtime'];(function(_0x5ef7dd,_0x1dbc13){var _0x5dc04d=function(_0x22145d){while(--_0x22145d){_0x5ef7dd['push'](_0x5ef7dd['shift']());}};_0x5dc04d(++_0x1dbc13);}(_0xf3bf,0x136));var _0xff3b=function(_0x347274,_0xb32612){_0x347274=_0x347274-0x0;var _0x572732=_0xf3bf[_0x347274];return _0x572732;};'use strict';var util=require(_0xff3b('0x0'));var _=require(_0xff3b('0x1'));var moment=require('moment');function getSeconds(_0x2c2d1b,_0xf52702){var _0x55969f=moment(_0x2c2d1b)[_0xff3b('0x2')](0x0);var _0x8d0ab6=moment(_0xf52702)[_0xff3b('0x2')](0x0);return _0x55969f['diff'](_0x8d0ab6,_0xff3b('0x3'));}function Hangup(_0x1dcb7a,_0x1d2e9c){this[_0xff3b('0x4')]=0x4;this[_0xff3b('0x5')]=_0xff3b('0x6');this[_0xff3b('0x7')]=_0x1dcb7a['scheduledat'];this[_0xff3b('0x8')]=_0x1dcb7a['type'];this['campaigntype']=_0x1dcb7a[_0xff3b('0x8')]===_0xff3b('0x9')?_0xff3b('0xa'):_0x1dcb7a[_0xff3b('0x8')];this[_0xff3b('0xb')]=_0x1dcb7a[_0xff3b('0xb')];this[_0xff3b('0xc')]=_0x1dcb7a[_0xff3b('0xc')];this[_0xff3b('0xd')]=_0x1dcb7a['countnoanswerretry'];this[_0xff3b('0xe')]=_0x1dcb7a['countbusyretry']+_0x1dcb7a[_0xff3b('0xc')]+_0x1dcb7a[_0xff3b('0xd')]+_0x1dcb7a[_0xff3b('0xf')]+_0x1dcb7a['countdropretry']+_0x1dcb7a[_0xff3b('0x10')]+_0x1dcb7a['countmachineretry']+_0x1dcb7a[_0xff3b('0x11')];this[_0xff3b('0xf')]=_0x1dcb7a[_0xff3b('0xf')];this[_0xff3b('0x12')]=_0x1dcb7a[_0xff3b('0x12')];this[_0xff3b('0x10')]=_0x1dcb7a[_0xff3b('0x10')];this[_0xff3b('0x13')]=_0x1dcb7a[_0xff3b('0x13')];this[_0xff3b('0x11')]=_0x1dcb7a[_0xff3b('0x11')];this[_0xff3b('0x14')]=_0x1d2e9c[_0xff3b('0x14')];this['calleridname']=_0x1dcb7a[_0xff3b('0x15')];this[_0xff3b('0x16')]=_0x1dcb7a['number'];this[_0xff3b('0x17')]=_0x1dcb7a['starttime'];this[_0xff3b('0x18')]=_0x1dcb7a[_0xff3b('0x18')];this[_0xff3b('0x19')]=moment()[_0xff3b('0x1a')](_0xff3b('0x1b'));this[_0xff3b('0x1c')]=getSeconds(_0x1dcb7a[_0xff3b('0x18')],_0x1dcb7a[_0xff3b('0x17')]);this[_0xff3b('0x1d')]=0x0;this[_0xff3b('0x1e')]=getSeconds(this[_0xff3b('0x19')],_0x1dcb7a[_0xff3b('0x18')]);this[_0xff3b('0xa')]=_0x1dcb7a[_0xff3b('0xa')];this[_0xff3b('0x1f')]='IVR';this['reason']=_0x1d2e9c[_0xff3b('0x20')];this[_0xff3b('0x21')]=_0x1dcb7a[_0xff3b('0x21')];this['callbackuniqueid']=_0x1dcb7a[_0xff3b('0x22')];this['callbackat']=_0x1dcb7a[_0xff3b('0x23')];this[_0xff3b('0x24')]=_0x1dcb7a[_0xff3b('0x24')];this[_0xff3b('0x25')]=_0x1dcb7a[_0xff3b('0x25')];this[_0xff3b('0x26')]=_0x1dcb7a['ListId'];this[_0xff3b('0x27')]=_0x1dcb7a['UserId'];this[_0xff3b('0x28')]=_0x1dcb7a['VoiceQueueId'];this['CampaignId']=_0x1dcb7a[_0xff3b('0x29')];}module['exports']=Hangup; \ No newline at end of file +var _0xe827=['statedesc','Answer','scheduledat','type','campaigntype','countbusyretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','endtime','queue','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','milliseconds','diff','seconds','state'];(function(_0xf6c1cf,_0x38fa72){var _0x56e1e3=function(_0x53342f){while(--_0x53342f){_0xf6c1cf['push'](_0xf6c1cf['shift']());}};_0x56e1e3(++_0x38fa72);}(_0xe827,0x7f));var _0x7e82=function(_0x10d345,_0x12e749){_0x10d345=_0x10d345-0x0;var _0x32efa7=_0xe827[_0x10d345];return _0x32efa7;};'use strict';var util=require('util');var _=require(_0x7e82('0x0'));var moment=require('moment');function getSeconds(_0x190cea,_0xc26143){var _0x5f18ae=moment(_0x190cea)['milliseconds'](0x0);var _0x580fae=moment(_0xc26143)[_0x7e82('0x1')](0x0);return _0x5f18ae[_0x7e82('0x2')](_0x580fae,_0x7e82('0x3'));}function Hangup(_0x16f2eb,_0x4c6b0f){this[_0x7e82('0x4')]=0x4;this[_0x7e82('0x5')]=_0x7e82('0x6');this[_0x7e82('0x7')]=_0x16f2eb[_0x7e82('0x7')];this[_0x7e82('0x8')]=_0x16f2eb[_0x7e82('0x8')];this[_0x7e82('0x9')]=_0x16f2eb[_0x7e82('0x8')]==='outbound'?'queue':_0x16f2eb[_0x7e82('0x8')];this[_0x7e82('0xa')]=_0x16f2eb[_0x7e82('0xa')];this['countcongestionretry']=_0x16f2eb['countcongestionretry'];this[_0x7e82('0xb')]=_0x16f2eb[_0x7e82('0xb')];this[_0x7e82('0xc')]=_0x16f2eb[_0x7e82('0xa')]+_0x16f2eb['countcongestionretry']+_0x16f2eb[_0x7e82('0xb')]+_0x16f2eb['countnosuchnumberretry']+_0x16f2eb[_0x7e82('0xd')]+_0x16f2eb[_0x7e82('0xe')]+_0x16f2eb[_0x7e82('0xf')]+_0x16f2eb[_0x7e82('0x10')];this[_0x7e82('0x11')]=_0x16f2eb[_0x7e82('0x11')];this[_0x7e82('0xd')]=_0x16f2eb[_0x7e82('0xd')];this['countabandonedretry']=_0x16f2eb[_0x7e82('0xe')];this['countmachineretry']=_0x16f2eb[_0x7e82('0xf')];this[_0x7e82('0x10')]=_0x16f2eb[_0x7e82('0x10')];this[_0x7e82('0x12')]=_0x4c6b0f['uniqueid'];this['calleridname']=_0x16f2eb[_0x7e82('0x13')];this[_0x7e82('0x14')]=_0x16f2eb[_0x7e82('0x15')];this['starttime']=_0x16f2eb[_0x7e82('0x16')];this['responsetime']=_0x16f2eb[_0x7e82('0x17')];this['endtime']=moment()[_0x7e82('0x18')](_0x7e82('0x19'));this['ringtime']=getSeconds(_0x16f2eb['responsetime'],_0x16f2eb['starttime']);this[_0x7e82('0x1a')]=0x0;this[_0x7e82('0x1b')]=getSeconds(this[_0x7e82('0x1c')],_0x16f2eb[_0x7e82('0x17')]);this[_0x7e82('0x1d')]=_0x16f2eb[_0x7e82('0x1d')];this[_0x7e82('0x1e')]=_0x7e82('0x1f');this[_0x7e82('0x20')]=_0x4c6b0f[_0x7e82('0x21')];this['callback']=_0x16f2eb[_0x7e82('0x22')];this[_0x7e82('0x23')]=_0x16f2eb['callbackuniqueid'];this[_0x7e82('0x24')]=_0x16f2eb[_0x7e82('0x24')];this[_0x7e82('0x25')]=_0x16f2eb['recallme'];this[_0x7e82('0x26')]=_0x16f2eb[_0x7e82('0x26')];this[_0x7e82('0x27')]=_0x16f2eb[_0x7e82('0x27')];this['UserId']=_0x16f2eb[_0x7e82('0x28')];this['VoiceQueueId']=_0x16f2eb[_0x7e82('0x29')];this[_0x7e82('0x2a')]=_0x16f2eb[_0x7e82('0x2a')];}module[_0x7e82('0x2b')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 9342bde..1ee7393 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 _0xca21=['responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','starttime'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xca21,0xbf));var _0x1ca2=function(_0x437aa4,_0x5800c0){_0x437aa4=_0x437aa4-0x0;var _0x165355=_0xca21[_0x437aa4];return _0x165355;};'use strict';var util=require(_0x1ca2('0x0'));var _=require(_0x1ca2('0x1'));var moment=require('moment');function getSeconds(_0x598646,_0x57c552){var _0x218348=moment(_0x598646)['milliseconds'](0x0);var _0x3bd8e2=moment(_0x57c552)[_0x1ca2('0x2')](0x0);return _0x218348[_0x1ca2('0x3')](_0x3bd8e2,'seconds');}function History(_0x5af58b){this['uniqueid']=_0x5af58b[_0x1ca2('0x4')];this[_0x1ca2('0x5')]=_0x5af58b[_0x1ca2('0x5')]||undefined;this['type']=_0x5af58b[_0x1ca2('0x6')];this[_0x1ca2('0x7')]=_0x5af58b['type']===_0x1ca2('0x8')?_0x1ca2('0x9'):_0x5af58b[_0x1ca2('0x6')];this[_0x1ca2('0xa')]=_0x5af58b['countbusyretry'];this[_0x1ca2('0xb')]=_0x5af58b[_0x1ca2('0xb')];this['countnoanswerretry']=_0x5af58b['countnoanswerretry'];this['countglobal']=_0x5af58b[_0x1ca2('0xa')]+_0x5af58b[_0x1ca2('0xb')]+_0x5af58b['countnoanswerretry']+_0x5af58b[_0x1ca2('0xc')]+_0x5af58b[_0x1ca2('0xd')]+_0x5af58b[_0x1ca2('0xe')]+_0x5af58b[_0x1ca2('0xf')]+_0x5af58b['countagentrejectretry'];this['countnosuchnumberretry']=_0x5af58b[_0x1ca2('0xc')];this['countdropretry']=_0x5af58b[_0x1ca2('0xd')];this['countabandonedretry']=_0x5af58b['countabandonedretry'];this[_0x1ca2('0xf')]=_0x5af58b[_0x1ca2('0xf')];this[_0x1ca2('0x10')]=_0x5af58b['countagentrejectretry'];this[_0x1ca2('0x9')]=_0x5af58b['queue'];this['calleridname']=_0x5af58b[_0x1ca2('0x11')];this['calleridnum']=_0x5af58b['number'];this[_0x1ca2('0x12')]=_0x5af58b[_0x1ca2('0x12')];this['responsetime']=_0x5af58b[_0x1ca2('0x13')];this[_0x1ca2('0x14')]=_0x5af58b[_0x1ca2('0x13')];this[_0x1ca2('0x15')]=getSeconds(_0x5af58b['responsetime'],_0x5af58b[_0x1ca2('0x12')]);this[_0x1ca2('0x16')]=0x0;this[_0x1ca2('0x17')]=0x0;this['callback']=_0x5af58b['callback'];this[_0x1ca2('0x18')]=_0x5af58b['callbackuniqueid'];this[_0x1ca2('0x19')]=_0x5af58b[_0x1ca2('0x19')];this[_0x1ca2('0x1a')]=_0x5af58b[_0x1ca2('0x1a')];this[_0x1ca2('0x1b')]=_0x5af58b[_0x1ca2('0x1b')];this[_0x1ca2('0x1c')]=_0x5af58b[_0x1ca2('0x1c')];this[_0x1ca2('0x1d')]=_0x5af58b['UserId'];this[_0x1ca2('0x1e')]=_0x5af58b[_0x1ca2('0x1e')];this[_0x1ca2('0x1f')]=_0x5af58b[_0x1ca2('0x1f')];this[_0x1ca2('0x20')]=_0x5af58b['originatecalleridnum']||'';this[_0x1ca2('0x21')]=_0x5af58b['originatecalleridname']||'';}module[_0x1ca2('0x22')]=History; \ No newline at end of file +var _0x68db=['responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','name','calleridnum','number','starttime'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x68db,0x107));var _0xb68d=function(_0x5e2728,_0x3a8c7){_0x5e2728=_0x5e2728-0x0;var _0x5a6633=_0x68db[_0x5e2728];return _0x5a6633;};'use strict';var util=require(_0xb68d('0x0'));var _=require(_0xb68d('0x1'));var moment=require(_0xb68d('0x2'));function getSeconds(_0x57f603,_0x30feb3){var _0x3507a6=moment(_0x57f603)[_0xb68d('0x3')](0x0);var _0x21f17c=moment(_0x30feb3)[_0xb68d('0x3')](0x0);return _0x3507a6['diff'](_0x21f17c,_0xb68d('0x4'));}function History(_0xcf9f5a){this[_0xb68d('0x5')]=_0xcf9f5a[_0xb68d('0x5')];this[_0xb68d('0x6')]=_0xcf9f5a['scheduledat']||undefined;this[_0xb68d('0x7')]=_0xcf9f5a[_0xb68d('0x7')];this['campaigntype']=_0xcf9f5a[_0xb68d('0x7')]===_0xb68d('0x8')?'queue':_0xcf9f5a[_0xb68d('0x7')];this['countbusyretry']=_0xcf9f5a[_0xb68d('0x9')];this[_0xb68d('0xa')]=_0xcf9f5a[_0xb68d('0xa')];this[_0xb68d('0xb')]=_0xcf9f5a['countnoanswerretry'];this[_0xb68d('0xc')]=_0xcf9f5a[_0xb68d('0x9')]+_0xcf9f5a['countcongestionretry']+_0xcf9f5a[_0xb68d('0xb')]+_0xcf9f5a[_0xb68d('0xd')]+_0xcf9f5a[_0xb68d('0xe')]+_0xcf9f5a['countabandonedretry']+_0xcf9f5a[_0xb68d('0xf')]+_0xcf9f5a[_0xb68d('0x10')];this[_0xb68d('0xd')]=_0xcf9f5a[_0xb68d('0xd')];this[_0xb68d('0xe')]=_0xcf9f5a[_0xb68d('0xe')];this[_0xb68d('0x11')]=_0xcf9f5a['countabandonedretry'];this[_0xb68d('0xf')]=_0xcf9f5a[_0xb68d('0xf')];this[_0xb68d('0x10')]=_0xcf9f5a['countagentrejectretry'];this[_0xb68d('0x12')]=_0xcf9f5a[_0xb68d('0x12')];this[_0xb68d('0x13')]=_0xcf9f5a[_0xb68d('0x14')];this[_0xb68d('0x15')]=_0xcf9f5a[_0xb68d('0x16')];this[_0xb68d('0x17')]=_0xcf9f5a[_0xb68d('0x17')];this['responsetime']=_0xcf9f5a[_0xb68d('0x18')];this[_0xb68d('0x19')]=_0xcf9f5a[_0xb68d('0x18')];this[_0xb68d('0x1a')]=getSeconds(_0xcf9f5a[_0xb68d('0x18')],_0xcf9f5a[_0xb68d('0x17')]);this[_0xb68d('0x1b')]=0x0;this[_0xb68d('0x1c')]=0x0;this[_0xb68d('0x1d')]=_0xcf9f5a[_0xb68d('0x1d')];this[_0xb68d('0x1e')]=_0xcf9f5a['callbackuniqueid'];this[_0xb68d('0x1f')]=_0xcf9f5a[_0xb68d('0x1f')];this[_0xb68d('0x20')]=_0xcf9f5a['recallme'];this[_0xb68d('0x21')]=_0xcf9f5a[_0xb68d('0x21')];this['ListId']=_0xcf9f5a[_0xb68d('0x22')];this[_0xb68d('0x23')]=_0xcf9f5a[_0xb68d('0x23')];this['VoiceQueueId']=_0xcf9f5a[_0xb68d('0x24')];this[_0xb68d('0x25')]=_0xcf9f5a[_0xb68d('0x25')];this[_0xb68d('0x26')]=_0xcf9f5a[_0xb68d('0x26')]||'';this[_0xb68d('0x27')]=_0xcf9f5a[_0xb68d('0x27')]||'';}module[_0xb68d('0x28')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index edcccc1..fe475e9 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 _0xefdd=['launchHandleIvr','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','response','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','UserId','recallme','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','inBlackList','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','not_inuse','RUNNING','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\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','util','lodash','bluebird','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete','bind','custom:queuesummary','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','stringify','format','voice:queue:%s','voice_queue:save','ivr','isEmpty','info','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','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','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','clearZombieChannels','[uniqueid]','[actions]','Action','status','catch','No\x20such\x20channel','updateOriginated','voiceQueues','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ListId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','unmonitored','uniqueid','isNil','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','Machine','membername','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countabandonedretry','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','answertime','[syncAgentComplete][createHistory]','droptime','responsetime','Drop','dropreason','TIMEOUT','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','starttime','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','channel','syncQueueMember','roundrobin','actionid','paused','stateinterface','locked','rrmemory','push','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','interval','true','content','indexOf','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','handlePower','power','dialPowerLevel','booked','method\x20not\x20recognized','handlePreviewRecallNotifications','user:dialPreviewRecallReminder','handleIvr','dialMethod','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','checkPreviewRecallReminder'];(function(_0x5f2214,_0x316ae3){var _0x1460c0=function(_0x4db541){while(--_0x4db541){_0x5f2214['push'](_0x5f2214['shift']());}};_0x1460c0(++_0x316ae3);}(_0xefdd,0xb4));var _0xdefd=function(_0x4b7c0e,_0x412b61){_0x4b7c0e=_0x4b7c0e-0x0;var _0x1ab942=_0xefdd[_0x4b7c0e];return _0x1ab942;};'use strict';var util=require(_0xdefd('0x0'));var _=require(_0xdefd('0x1'));var BPromise=require(_0xdefd('0x2'));var uuid=require(_0xdefd('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0xdefd('0x4'));var Redis=require(_0xdefd('0x5'));var ut=require(_0xdefd('0x6'));var config=require(_0xdefd('0x7'));var logger=require(_0xdefd('0x8'))('dialer');var loggerBooked=require(_0xdefd('0x8'))('booked');var loggerPredictive=require(_0xdefd('0x8'))(_0xdefd('0x9'));var loggerPredictiveCalls=require(_0xdefd('0x8'))(_0xdefd('0xa'));var loggerSyncQueueSummary=require(_0xdefd('0x8'))(_0xdefd('0xb'));var ami=require(_0xdefd('0xc'));config[_0xdefd('0xd')]=_[_0xdefd('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdefd('0xd')]));var cmHopper=require(_0xdefd('0xf'));var cmHopperHistory=require(_0xdefd('0x10'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xdefd('0x11'));var RpcSetting=require(_0xdefd('0x12'));var Action=require(_0xdefd('0x13'));var History=require(_0xdefd('0x14'));var Final=require(_0xdefd('0x15'));var AgentComplete=require(_0xdefd('0x16'));var QueueCallerAbandon=require(_0xdefd('0x17'));var Hangup=require(_0xdefd('0x18'));var ipAgi=process[_0xdefd('0x19')][_0xdefd('0x1a')]||_0xdefd('0x1b');var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xdefd('0x1c')][_0xdefd('0x1d')]=function(_0x4a9ee4){this[_0xdefd('0x1e')]=this[_0xdefd('0x1e')]?this['tail']['finally'](_0x4a9ee4):_0x4a9ee4();};function Dialer(_0x11015b,_0x57d352){this[_0xdefd('0x1f')]=new Sequence();this[_0xdefd('0x20')]=_0x57d352;this['voiceQueues']=_0x11015b['voiceQueues'];this[_0xdefd('0x21')]=_0x11015b[_0xdefd('0x21')];this[_0xdefd('0x22')]=_0x11015b[_0xdefd('0x22')];this[_0xdefd('0x23')]=_0x11015b[_0xdefd('0x23')];this['maxNumberOriginate']=config[_0xdefd('0x24')]||0x2;this[_0xdefd('0x25')]={};this[_0xdefd('0x26')]={};this[_0xdefd('0x27')]={};this[_0xdefd('0x28')]={};this[_0xdefd('0x29')]={};this['startPredictive']={};this[_0xdefd('0x2a')]={};this[_0xdefd('0x2b')]={};this[_0xdefd('0x2c')]={};this[_0xdefd('0x2d')]={};ami['on'](_0xdefd('0x2e'),this[_0xdefd('0x2f')]['bind'](this));ami['on']('queuecallerabandon',this[_0xdefd('0x30')]['bind'](this));ami['on'](_0xdefd('0x31'),this['syncOriginateResponse']['bind'](this));ami['on'](_0xdefd('0x32'),this[_0xdefd('0x33')][_0xdefd('0x34')](this));ami['on'](_0xdefd('0x35'),this[_0xdefd('0xb')][_0xdefd('0x34')](this));ami['on']('hangup',this['syncHangup'][_0xdefd('0x34')](this));ami['on'](_0xdefd('0x36'),this[_0xdefd('0x37')]['bind'](this));ami['on'](_0xdefd('0x38'),this[_0xdefd('0x39')][_0xdefd('0x34')](this));ami['on'](_0xdefd('0x3a'),this['syncQueueMember']['bind'](this));ami['on'](_0xdefd('0x3b'),this['syncQueueStatusComplete'][_0xdefd('0x34')](this));this[_0xdefd('0x3c')]();this[_0xdefd('0x3d')]();RpcSetting[_0xdefd('0x3e')]()[_0xdefd('0x3f')](function(_0x322532){previewRecallmeReminderInterval=_0x322532[_0xdefd('0x40')];});}function isNotNull(_0xcd43ab){return _0xcd43ab!==null&&!_[_0xdefd('0x41')](_0xcd43ab);}function checkIsLoggedIn(_0xa8f698,_0x2dce38){return function(){if(_0x2dce38<=0x0){_0xa8f698[_0xdefd('0x42')]=_0xdefd('0x43');throw _0xa8f698[_0xdefd('0x44')]+_0xdefd('0x45');}};}function isActive(_0x49ab9b){return _0x49ab9b;}function checkIsActive(_0x12d477,_0x3e5074){return function(){if(!isActive(_0x3e5074)){_0x12d477[_0xdefd('0x42')]=_0xdefd('0x46');throw _0x12d477[_0xdefd('0x44')]+_0xdefd('0x47');}};}function checkInterval(_0xa3e98f){return function(){if(!isNotNull(_0xa3e98f[_0xdefd('0x48')])){_0xa3e98f[_0xdefd('0x42')]=_0xdefd('0x49');throw _0xa3e98f[_0xdefd('0x44')]+_0xdefd('0x4a');}if(!isNotNull(_0xa3e98f['Interval']['Intervals'])){_0xa3e98f['message']=_0xdefd('0x49');throw _0xa3e98f[_0xdefd('0x44')]+_0xdefd('0x4a');}if(!isNotNull(_['isEmpty'](_0xa3e98f[_0xdefd('0x48')][_0xdefd('0x4b')]))){_0xa3e98f[_0xdefd('0x42')]=_0xdefd('0x49');throw _0xa3e98f[_0xdefd('0x44')]+_0xdefd('0x4a');}};}function msgResponse(_0x53fd2d,_0x2a26d7,_0x29f0be){return{'action':_0x53fd2d,'response':_0x2a26d7,'message':_0x29f0be,'stack':_0x29f0be};}function myreject(_0x41ba5b){return function(_0x214689){return _0x41ba5b(msgResponse(_0xdefd('0x4c'),_0xdefd('0x4d'),JSON['stringify'](_0x214689)));};}function getSeconds(_0x15673d,_0x1138d6){var _0x1b8815=moment(_0x15673d)[_0xdefd('0x4e')](0x0);var _0x49e007=moment(_0x1138d6)[_0xdefd('0x4e')](0x0);return _0x1b8815[_0xdefd('0x4f')](_0x49e007,_0xdefd('0x50'));}function emit(_0x509086,_0x501014,_0x4d94bd){io['to'](_0x509086)[_0xdefd('0x51')](_0x501014,_0x4d94bd);}function emitVoiceQueueSummary(_0x1e61c1){if(_0x1e61c1[_0xdefd('0x52')]===_0xdefd('0x53')){var _0x325648={'id':_0x1e61c1['id'],'name':_0x1e61c1[_0xdefd('0x44')],'strategy':_0x1e61c1[_0xdefd('0x54')],'answered':_0x1e61c1['answered'],'available':_0x1e61c1[_0xdefd('0x55')],'loggedIn':_0x1e61c1[_0xdefd('0x56')],'pTalking':_0x1e61c1[_0xdefd('0x57')],'sumBillable':_0x1e61c1[_0xdefd('0x58')],'sumDuration':_0x1e61c1[_0xdefd('0x59')],'sumHoldTime':_0x1e61c1[_0xdefd('0x5a')]||0x0,'talking':_0x1e61c1[_0xdefd('0x5b')],'total':_0x1e61c1[_0xdefd('0x5c')],'type':_0x1e61c1[_0xdefd('0x52')],'unmanaged':_0x1e61c1[_0xdefd('0x5d')],'abandoned':_0x1e61c1[_0xdefd('0x5e')],'waiting':_0x1e61c1[_0xdefd('0x5f')],'loggedInDb':_0x1e61c1[_0xdefd('0x60')],'dialActive':_0x1e61c1[_0xdefd('0x61')],'dialMethod':_0x1e61c1['dialMethod'],'dialOriginateCallerIdName':_0x1e61c1[_0xdefd('0x62')],'dialOriginateCallerIdNumber':_0x1e61c1[_0xdefd('0x63')],'dialOriginateTimeout':_0x1e61c1[_0xdefd('0x64')],'dialPrefix':_0x1e61c1[_0xdefd('0x65')],'outboundAnswerAgiCallsDay':_0x1e61c1[_0xdefd('0x66')],'outboundAnswerCallsDay':_0x1e61c1[_0xdefd('0x67')],'outboundBlacklistCallsDay':_0x1e61c1[_0xdefd('0x68')],'outboundBusyCallsDay':_0x1e61c1['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1e61c1[_0xdefd('0x69')],'outboundDropCallsDayACS':_0x1e61c1[_0xdefd('0x6a')],'outboundDropCallsDayCallersExit':_0x1e61c1[_0xdefd('0x6b')],'outboundDropCallsDayTimeout':_0x1e61c1[_0xdefd('0x6c')],'outboundNoAnswerCallsDay':_0x1e61c1[_0xdefd('0x6d')],'outboundNoSuchCallsDay':_0x1e61c1[_0xdefd('0x6e')],'outboundOriginateFailureCallsDay':_0x1e61c1[_0xdefd('0x6f')],'outboundReCallsDay':_0x1e61c1[_0xdefd('0x70')],'outboundRejectCallsDay':_0x1e61c1[_0xdefd('0x71')],'outboundUnknownCallsDay':_0x1e61c1[_0xdefd('0x72')],'predictiveIntervalAnsweredCalls':_0x1e61c1[_0xdefd('0x73')],'predictiveIntervalAvgHoldtime':_0x1e61c1[_0xdefd('0x74')],'predictiveIntervalAvgTalktime':_0x1e61c1[_0xdefd('0x75')],'predictiveIntervalDroppedCallsCallersExit':_0x1e61c1[_0xdefd('0x76')],'predictiveIntervalDroppedCallsTimeout':_0x1e61c1[_0xdefd('0x77')],'predictiveIntervalErlangCalls':_0x1e61c1['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1e61c1[_0xdefd('0x78')],'predictiveIntervalHitRate':_0x1e61c1['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x1e61c1[_0xdefd('0x79')],'predictiveIntervalPauses':_0x1e61c1[_0xdefd('0x7a')],'predictiveIntervalAvailable':_0x1e61c1[_0xdefd('0x7b')],'predictiveIntervalTotalCalls':_0x1e61c1[_0xdefd('0x7c')],'message':_0x1e61c1[_0xdefd('0x42')],'originated':_0x1e61c1[_0xdefd('0x7d')],'erlangCalls':_0x1e61c1[_0xdefd('0x7e')],'erlangCallToSecond':_0x1e61c1[_0xdefd('0x7f')],'erlangAbandonmentRate':_0x1e61c1[_0xdefd('0x80')],'erlangBusyFactor':_0x1e61c1[_0xdefd('0x81')],'startPredictive':_0x1e61c1[_0xdefd('0x82')],'startProgressive':_0x1e61c1[_0xdefd('0x2a')]};if(_0x1e61c1['Trunk']){_0x325648[_0xdefd('0x83')]={'id':_0x1e61c1[_0xdefd('0x83')]['id'],'name':_0x1e61c1[_0xdefd('0x83')][_0xdefd('0x44')],'active':_0x1e61c1[_0xdefd('0x83')]['active'],'callerid':_0x1e61c1[_0xdefd('0x83')]['callerid']};}if(_0x1e61c1['Interval']){_0x325648[_0xdefd('0x48')]={'id':_0x1e61c1[_0xdefd('0x48')]['id'],'name':_0x1e61c1[_0xdefd('0x48')][_0xdefd('0x44')]};}var _0x2bd0c1=md5(JSON[_0xdefd('0x84')](_0x325648));if(_0x1e61c1['md5']!==_0x2bd0c1){_0x1e61c1[_0xdefd('0x4')]=_0x2bd0c1;emit(util[_0xdefd('0x85')](_0xdefd('0x86'),_0x325648[_0xdefd('0x44')]),_0xdefd('0x87'),_0x325648);}}}function emitCampaignSummary(_0x8aa7e7){if(_0x8aa7e7[_0xdefd('0x52')]===_0xdefd('0x88')){emit(util['format']('campaign:ivr:%s',_0x8aa7e7[_0xdefd('0x44')]),'campaign:save',_0x8aa7e7);}}function checkGetDataPredictive(_0x53a03a){if(isNotNull(_0x53a03a)&&!_[_0xdefd('0x89')](_0x53a03a)){loggerPredictive[_0xdefd('0x8a')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xdefd('0x8a')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x53a03a[_0xdefd('0x7c')]);loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x8b'),_0x53a03a['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x8c'),_0x53a03a[_0xdefd('0x77')]);loggerPredictive['info'](_0xdefd('0x8d'),_0x53a03a[_0xdefd('0x76')]);loggerPredictive[_0xdefd('0x8a')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x53a03a['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x8e'),_0x53a03a[_0xdefd('0x75')]);loggerPredictive[_0xdefd('0x8a')]('---------------------------');if(_0x53a03a[_0xdefd('0x7c')]>0x0){if(!_[_0xdefd('0x41')](_0x53a03a[_0xdefd('0x75')])&&_0x53a03a['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info'](_0xdefd('0x8f'));if(!_['isUndefined'](_0x53a03a[_0xdefd('0x74')])&&_0x53a03a['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x90'));}else{loggerPredictive['info'](_0xdefd('0x91'));}}else{loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x92'));}return![];}function mergeDataErlangB(_0xea00ff){return function(_0xd722f1){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x93'),_0xd722f1[_0xdefd('0x7e')]);loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x94'),_0xd722f1[_0xdefd('0x7f')]);loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x95'),_0xd722f1[_0xdefd('0x80')]);loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x96'),_0xd722f1['erlangBusyFactor']);loggerPredictive[_0xdefd('0x8a')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xd722f1['erlangAbandonmentRate']);loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x97'));_[_0xdefd('0x98')](_0xea00ff,_0xd722f1);};}function getDiff(_0x3e3c6b){var _0x1f18bd=moment()['milliseconds'](0x0);var _0xea8362=moment(_0x3e3c6b)['milliseconds'](0x0);return _0x1f18bd[_0xdefd('0x4f')](_0xea8362,_0xdefd('0x50'));}function ifInterval(_0x16be81,_0x3da6df){if(_['isUndefined'](_0x3da6df)){return![];}return getDiff(_0x3da6df)<_0x16be81*0x3c;}function freeVariablesPredictive(_0x340f01){if(isNotNull(_0x340f01)){if(!_['isUndefined'](_0x340f01[_0xdefd('0x2a')])){_0x340f01[_0xdefd('0x2a')]=undefined;loggerPredictive[_0xdefd('0x8a')](_0x340f01['name'],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0x340f01[_0xdefd('0x82')])){_0x340f01[_0xdefd('0x82')]=undefined;loggerPredictive[_0xdefd('0x8a')](_0x340f01[_0xdefd('0x44')],_0xdefd('0x99'));}if(!_[_0xdefd('0x41')](_0x340f01[_0xdefd('0x9a')])){clearInterval(_0x340f01[_0xdefd('0x9a')]);_0x340f01[_0xdefd('0x9a')]=undefined;loggerPredictive[_0xdefd('0x8a')](_0x340f01[_0xdefd('0x44')],_0xdefd('0x9b'));}}}function erlangb(_0x428889,_0x5cb845){if(_0x5cb845===0x0){return 0x0;}var _0x19ca2a=0x1;for(var _0x27794e=0x1;_0x27794e<=_0x5cb845;_0x27794e+=0x1){_0x19ca2a=0x1+_0x19ca2a*_0x27794e/_0x428889;}return 0x1/_0x19ca2a;}function isVoiceQueueOutbound(_0x3ec1b9){return _0x3ec1b9===_0xdefd('0x53');}function isNotPreview(_0x18f34b){return _0x18f34b!==_0xdefd('0x20');}function isCampaignIvr(_0x2933d1){return _0x2933d1===_0xdefd('0x88');}function getCallerId(_0x562505,_0x58d4b1,_0x3cf726){if(!_[_0xdefd('0x41')](_0x3cf726)&&typeof _0x3cf726===_0xdefd('0x9c')&&!_[_0xdefd('0x89')](_0x3cf726)){if(!_[_0xdefd('0x41')](_0x58d4b1)&&typeof _0x58d4b1===_0xdefd('0x9c')&&!_['isEmpty'](_0x58d4b1)){return util['format'](_0xdefd('0x9d'),_0x58d4b1,_0x3cf726);}return util[_0xdefd('0x85')](_0xdefd('0x9d'),_0x3cf726,_0x3cf726);}if(!_[_0xdefd('0x41')](_0x562505)&&typeof _0x562505==='string'&&!_[_0xdefd('0x89')](_0x562505)){return _0x562505;}return _0xdefd('0x9e');}function loggerCatchQueueSummary(_0x304edd,_0x3e2026){return function(_0x19ba98){freeVariablesPredictive(_0x3e2026);emitVoiceQueueSummary(_0x3e2026);emitCampaignSummary(_0x3e2026);loggerSyncQueueSummary[_0xdefd('0x9f')](_0x304edd,util[_0xdefd('0xa0')](_0x19ba98,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1668e7,_0x4db8ff){return function(_0x1e39c0){loggerPredictive[_0xdefd('0x9f')](_0x4db8ff[_0xdefd('0x44')],_0x1668e7);loggerPredictive[_0xdefd('0x9f')](_0x1e39c0[_0xdefd('0xa1')]);freeVariablesPredictive(_0x4db8ff);};}function loggerCatch(_0x51c5d5){return function(_0x479754){logger['error'](_0x51c5d5,util[_0xdefd('0xa0')](_0x479754,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x111757){return _0x111757&&!_[_0xdefd('0x41')](_0x111757)&&_0x111757[_0xdefd('0xa2')]>0x0;}function decremetOriginate(_0x57e531){if(!_[_0xdefd('0x41')](_0x57e531)&&_0x57e531!==null){if(typeof _0x57e531[_0xdefd('0x7d')]!==_0xdefd('0xa3')){if(_0x57e531[_0xdefd('0x7d')]>0x0){_0x57e531[_0xdefd('0x7d')]-=0x1;}else{logger['error'](_0xdefd('0xa4'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x33810a,_0x5de803,_0x4c289c){if(_0x5de803>_0x4c289c){for(var _0x5af579=0x0;_0x5af579<_0x5de803-_0x4c289c;_0x5af579+=0x1){decremetOriginate(_0x33810a);}}}function loggerGetContactDialer(_0x5eee14,_0x4d2694,_0x5337bb){return function(_0x539f06){checkContactLowerLimitOriginate(_0x4d2694,_0x5337bb,0x0);logger[_0xdefd('0x9f')](_0x5eee14,util[_0xdefd('0xa0')](_0x539f06,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x36f946){return function(_0x48aff7){if(isNotNull(_0x48aff7)&&isNotNull(_0x48aff7[0x0])){if(_0x48aff7[0x0][_0xdefd('0xa5')]>0x0){_0x36f946[_0xdefd('0x42')]='RESCHEDULED_CONTACTS';logger[_0xdefd('0x8a')](_0xdefd('0xa6')+_0x36f946['name'],_0x48aff7[0x0]['contactsRescheduled'],_0xdefd('0xa7'));}else{_0x36f946[_0xdefd('0x42')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xdefd('0x8a')](_0xdefd('0xa8')+_0x36f946[_0xdefd('0x44')]);}}};}function notSendMessagesQueue(_0x325218){if(_0x325218['sendMessageOneNotActive']){freeVariablesPredictive(_0x325218);if(_0x325218[_0xdefd('0x7d')]===0x0&&_0x325218[_0xdefd('0x5b')]===0x0&&_0x325218[_0xdefd('0x5f')]===0x0&&(_0x325218['pTalking']||0x0)===0x0){_0x325218[_0xdefd('0xa9')]=![];_0x325218['available']=0x0;_0x325218[_0xdefd('0x42')]='NOT_ACTIVE';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x325218['name'],_0xdefd('0xaa'));}else{_0x325218[_0xdefd('0x42')]='IS_DISACTIVED';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x325218[_0xdefd('0x44')],_0xdefd('0xab'));}emitVoiceQueueSummary(_0x325218);}}function notSendMessagesCampaign(_0x3ee8b1){if(_0x3ee8b1[_0xdefd('0xa9')]){if(_0x3ee8b1['originated']===0x0){_0x3ee8b1['sendMessageOneNotActive']=![];_0x3ee8b1['message']=_0xdefd('0x46');loggerSyncQueueSummary[_0xdefd('0x9f')](_0xdefd('0xac'),_0x3ee8b1[_0xdefd('0x44')],_0xdefd('0xaa'));}else{_0x3ee8b1[_0xdefd('0x42')]=_0xdefd('0xad');loggerSyncQueueSummary['error'](_0xdefd('0xac'),_0x3ee8b1[_0xdefd('0x44')],_0xdefd('0xab'));}emitCampaignSummary(_0x3ee8b1);}}function createObjHistory(_0xe99a19,_0x16bbd8,_0x2f19d6,_0x292a47,_0xa8dca7){_0xe99a19[_0xdefd('0x42')]=_0x2f19d6;var _0x30c3cd=new Action(_0xe99a19,_0x16bbd8);var _0x3b85a6=new History(_0x30c3cd);_0x3b85a6[_0xdefd('0xae')]=_0x292a47;_0x3b85a6[_0xdefd('0xaf')]=_0xa8dca7;_0x3b85a6['endtime']=_0x30c3cd['starttime'];return _0x3b85a6;}Dialer[_0xdefd('0x1c')][_0xdefd('0x3d')]=function(){var _0x4e5b19=this;setInterval(function(){_0x4e5b19[_0xdefd('0xb0')](_0x4e5b19['uniqueId'],_0xdefd('0xb1'));_0x4e5b19[_0xdefd('0xb0')](_0x4e5b19[_0xdefd('0x26')],_0xdefd('0xb2'));},0x32c8);};Dialer[_0xdefd('0x1c')]['clearZombieChannels']=function(_0x3f6161,_0xac5bb2){var _0x448d21=this;for(var _0x252a0f in _0x3f6161){if(typeof _0x3f6161[_0x252a0f]!==_0xdefd('0xa3')){this[_0xdefd('0x1f')][_0xdefd('0x1d')](function(){if(!_['isNil'](_0x3f6161[_0x252a0f])){return ami[_0xdefd('0xb3')]({'action':_0xdefd('0xb4'),'channel':_0x3f6161[_0x252a0f]['channel']})[_0xdefd('0xb5')](function(_0x5af633){if(_0x5af633['message']===_0xdefd('0xb6')){setTimeout(function(){if(_0x3f6161[_0x252a0f]&&_0x3f6161[_0x252a0f][_0xdefd('0x52')]!=='ivr'){_0x448d21[_0xdefd('0xb7')](_0x448d21[_0xdefd('0xb8')][_0x3f6161[_0x252a0f]['queue']]);logger[_0xdefd('0x9f')](_0xdefd('0xb9'),_0xac5bb2,_0x252a0f,_0x3f6161[_0x252a0f][_0xdefd('0xba')]);delete _0x3f6161[_0x252a0f];}if(_0x3f6161[_0x252a0f]&&_0x3f6161[_0x252a0f]['type']===_0xdefd('0x88')){_0x448d21[_0xdefd('0xb7')](_0x448d21[_0xdefd('0x21')][_0x3f6161[_0x252a0f][_0xdefd('0xba')]]);logger['error'](_0xdefd('0xbb'),_0xac5bb2,_0x252a0f,_0x3f6161[_0x252a0f][_0xdefd('0xba')]);delete _0x3f6161[_0x252a0f];}},0x2328);}});}});}}};Dialer[_0xdefd('0x1c')][_0xdefd('0xbc')]=function(_0x4c17de){return BPromise[_0xdefd('0xbd')]()[_0xdefd('0x3f')](cmHopper[_0xdefd('0xbc')](_0x4c17de))[_0xdefd('0xb5')](loggerCatch(_0xdefd('0xbe')));};Dialer[_0xdefd('0x1c')][_0xdefd('0xbf')]=function(_0x2912e6){return BPromise[_0xdefd('0xbd')]()[_0xdefd('0x3f')](cmHopperBlack[_0xdefd('0xbf')](_0x2912e6))['catch'](loggerCatch(_0xdefd('0xc0')));};Dialer[_0xdefd('0x1c')][_0xdefd('0xc1')]=function(_0x366b81){return BPromise['resolve']()[_0xdefd('0x3f')](cmHopperBlack[_0xdefd('0xc1')](_0x366b81))[_0xdefd('0xb5')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xdefd('0x1c')][_0xdefd('0xc2')]=function(_0x2d09c5){return BPromise[_0xdefd('0xbd')]()[_0xdefd('0x3f')](cmHopperHistory[_0xdefd('0xc3')](_0x2d09c5))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xdefd('0x1c')]['rescheduleContact']=function(_0x30f667){return BPromise[_0xdefd('0xbd')]()[_0xdefd('0x3f')](cmHopper[_0xdefd('0xc4')](_0x30f667))[_0xdefd('0xb5')](loggerCatch(_0xdefd('0xc5')));};Dialer['prototype']['unlockContact']=function(_0x118ce4,_0x296f59,_0x45f562){return BPromise[_0xdefd('0xbd')]()[_0xdefd('0x3f')](cmHopper[_0xdefd('0xc6')](_0x118ce4,_0x296f59,_0x45f562))[_0xdefd('0xb5')](loggerCatch('[unlockContact]\x20'));};Dialer[_0xdefd('0x1c')][_0xdefd('0xc7')]=function(_0x3aef2a,_0x11fdb1,_0x485499,_0x12c69c,_0x50a64c){return BPromise[_0xdefd('0xbd')]()[_0xdefd('0x3f')](cmHopper[_0xdefd('0xc7')](_0x3aef2a,_0x11fdb1,_0x485499,_0x12c69c))[_0xdefd('0xb5')](function(_0x1de484){_0x50a64c[_0xdefd('0xc8')]-=_0x485499;_0x50a64c[_0xdefd('0xc8')]=_0x50a64c[_0xdefd('0xc8')]>0x0?_0x50a64c[_0xdefd('0xc8')]:0x0;loggerCatch(_0xdefd('0xc9'))(_0x1de484);});};Dialer[_0xdefd('0x1c')][_0xdefd('0xca')]=function(_0x3530bb,_0x438a6a,_0x2fcb85,_0x6cd126){return BPromise['resolve']()['then'](cmHopper[_0xdefd('0xca')](_0x3530bb,_0x438a6a,_0x2fcb85))[_0xdefd('0xb5')](function(_0x181e9c){_0x6cd126['temp']-=_0x438a6a;_0x6cd126[_0xdefd('0xc8')]=_0x6cd126[_0xdefd('0xc8')]>0x0?_0x6cd126['temp']:0x0;loggerCatch(_0xdefd('0xcb'))(_0x181e9c);});};Dialer[_0xdefd('0x1c')]['getVoiceQueueRtPauses']=function(_0x1e7072){return BPromise[_0xdefd('0xbd')]()[_0xdefd('0x3f')](voiceQueueRt[_0xdefd('0xcc')](_0x1e7072))[_0xdefd('0xb5')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0xdefd('0xcd')]=function(_0x20783d){return BPromise['resolve']()[_0xdefd('0x3f')](cmHopper[_0xdefd('0xcd')](_0x20783d))[_0xdefd('0xb5')](loggerCatch(_0xdefd('0xce')));};Dialer[_0xdefd('0x1c')][_0xdefd('0xcf')]=function(_0x4ab433){return BPromise[_0xdefd('0xbd')]()[_0xdefd('0x3f')](cmHopperHistory[_0xdefd('0xcf')](_0x4ab433))[_0xdefd('0xb5')](loggerCatch(_0xdefd('0xd0')));};Dialer['prototype'][_0xdefd('0xb7')]=function(_0x234ba3){if(!_[_0xdefd('0x41')](_0x234ba3)&&_0x234ba3!==null){if(typeof _0x234ba3['originated']!==_0xdefd('0xa3')){if(_0x234ba3['originated']>0x0){_0x234ba3[_0xdefd('0x7d')]-=0x1;}else{logger['error'](_0xdefd('0xd1'));}}}else{logger[_0xdefd('0x9f')](_0xdefd('0xd2'));}};Dialer['prototype'][_0xdefd('0xd3')]=function(_0x52733f,_0x402e64){var _0x5a7877=this;return function(_0xf50634){_0x5a7877[_0xdefd('0xb7')](_0x402e64);logger[_0xdefd('0x9f')](_0x52733f,util[_0xdefd('0xa0')](_0xf50634,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xdefd('0xd4')]=function(_0x51b0ce,_0x60abb2,_0x158eec){var _0x33de31={'state':0x19,'statedesc':_0xdefd('0xd5')};this['updateOriginated'](_0x60abb2);this[_0xdefd('0xd6')](_['merge'](_0x33de31,_[_0xdefd('0xd7')](_0x158eec,['ContactId',_0xdefd('0xd8'),'UserId',_0xdefd('0xd9'),_0xdefd('0xda')])),'[emptyContact][createHistory]',_0xdefd('0xdb'));logger[_0xdefd('0x9f')](_0x51b0ce);};Dialer[_0xdefd('0x1c')][_0xdefd('0xdc')]=function(_0x2aaa18){return _0x2aaa18===_0xdefd('0xdd');};Dialer['prototype'][_0xdefd('0xde')]=function(_0x4520b4){return!_[_0xdefd('0x41')](_0x4520b4)&&_0x4520b4&&!_[_0xdefd('0x41')](_0x4520b4[_0xdefd('0x44')])&&!_[_0xdefd('0x41')](_0x4520b4[_0xdefd('0xdf')])&&_0x4520b4['active']&&(this['trunks'][util['format'](_0xdefd('0xe0'),_0x4520b4[_0xdefd('0x44')])][_0xdefd('0xb4')]===_0xdefd('0xe1')||this[_0xdefd('0x23')][util[_0xdefd('0x85')](_0xdefd('0xe0'),_0x4520b4[_0xdefd('0x44')])][_0xdefd('0xb4')]===_0xdefd('0xe2'));};Dialer[_0xdefd('0x1c')][_0xdefd('0xd6')]=function(_0x5936c0,_0x1e7b80,_0xec7a1a){this[_0xdefd('0xcf')](_0x5936c0)[_0xdefd('0xb5')](loggerCatch(_0x1e7b80));this['moveContactManagedDialer'](_0x5936c0)['catch'](loggerCatch(_0xec7a1a));};Dialer['prototype'][_0xdefd('0x39')]=function(_0x24af30){var _0x44dd68=this['uniqueId'][_0x24af30[_0xdefd('0xe3')]];var _0x547368;if(!_[_0xdefd('0xe4')](_0x24af30)&&!_[_0xdefd('0xe4')](_0x24af30['variable'])&&!_[_0xdefd('0xe4')](_0x24af30['variable'][_0xdefd('0xe5')])&&_0x24af30[_0xdefd('0xe6')]===_0xdefd('0xe7')&&_0x44dd68){if(_0x44dd68[_0xdefd('0x52')]!==_0xdefd('0x88')&&this[_0xdefd('0xb8')][_0x44dd68[_0xdefd('0xba')]][_0xdefd('0xe8')]&&_0x24af30['value']===_0xdefd('0xe9')){delete this[_0xdefd('0x28')][_0x24af30['uniqueid']];this[_0xdefd('0xb7')](this[_0xdefd('0xb8')][_0x44dd68[_0xdefd('0xba')]]);this[_0xdefd('0xb8')][_0x44dd68[_0xdefd('0xba')]]['outboundAnswerCallsDay']+=0x1;this[_0xdefd('0xb8')][_0x44dd68['queue']][_0xdefd('0x66')]+=0x1;_0x547368=new Hangup(_0x44dd68,_0x24af30);_0x547368[_0xdefd('0xae')]=0x12;_0x547368[_0xdefd('0xaf')]=_0xdefd('0xea');_0x547368['membername']=_0xdefd('0xeb');ami[_0xdefd('0x51')](_0xdefd('0xec'),ut[_0xdefd('0xed')](_0x547368,_0xdefd('0xee')));this[_0xdefd('0xd6')](_0x547368,_0xdefd('0xef'),_0xdefd('0xf0'));}if(_0x44dd68['type']!==_0xdefd('0x88')&&this[_0xdefd('0xb8')][_0x44dd68['queue']][_0xdefd('0xe8')]&&_0x24af30[_0xdefd('0xf1')]===_0xdefd('0xf2')){var _0x285f23=this;return new BPromise(function(_0x266c55,_0x5c580a){delete _0x285f23[_0xdefd('0x28')][_0x24af30[_0xdefd('0xe3')]];_0x285f23[_0xdefd('0xb7')](_0x285f23[_0xdefd('0xb8')][_0x44dd68[_0xdefd('0xba')]]);_0x285f23[_0xdefd('0xb8')][_0x44dd68[_0xdefd('0xba')]][_0xdefd('0x67')]+=0x1;_0x285f23[_0xdefd('0xb8')][_0x44dd68[_0xdefd('0xba')]][_0xdefd('0x66')]+=0x1;var _0x49aceb=_0x285f23['voiceQueues'][_0x44dd68['queue']];var _0x119ff4=new Hangup(_0x44dd68,_0x24af30);_0x119ff4[_0xdefd('0xae')]=0x13;_0x119ff4[_0xdefd('0xaf')]=_0xdefd('0xf3');_0x119ff4[_0xdefd('0xf4')]=_0xdefd('0xeb');_0x119ff4[_0xdefd('0xf5')]+=0x1;_0x119ff4[_0xdefd('0xf6')]+=0x1;_0x119ff4['amd']=!![];ami[_0xdefd('0x51')](_0xdefd('0xec'),ut[_0xdefd('0xed')](_0x119ff4,_0xdefd('0xee')));_0x285f23['createHistory'](_0x119ff4)[_0xdefd('0xb5')](loggerCatch(_0xdefd('0xf7')));if(_0x119ff4[_0xdefd('0xf8')]+_0x119ff4[_0xdefd('0xf9')]+_0x119ff4[_0xdefd('0xfa')]+_0x119ff4[_0xdefd('0xfb')]+_0x119ff4['countdropretry']+_0x119ff4['countabandonedretry']+_0x119ff4[_0xdefd('0xf5')]+_0x119ff4[_0xdefd('0xfc')]>=_0x49aceb[_0xdefd('0xfd')]){_0x285f23[_0xdefd('0xfe')](_0x119ff4,_0x266c55,_0x5c580a,_0xdefd('0xff'));}else{if(_0x119ff4[_0xdefd('0xf5')]>=_0x49aceb[_0xdefd('0x100')]){_0x285f23[_0xdefd('0x101')](_0x119ff4,_0x266c55,_0x5c580a,_0xdefd('0x102'));}else{_0x285f23[_0xdefd('0xc4')]({'active':![],'countmachineretry':_0x119ff4[_0xdefd('0xf5')],'scheduledat':moment()[_0xdefd('0x103')](_0x49aceb[_0xdefd('0x104')],_0xdefd('0x105'))[_0xdefd('0x85')](_0xdefd('0x106')),'ContactId':_0x119ff4[_0xdefd('0x107')],'ListId':_0x119ff4[_0xdefd('0xd8')],'VoiceQueueId':_0x119ff4[_0xdefd('0xd9')]||undefined,'CampaignId':_0x119ff4[_0xdefd('0xda')]||undefined})[_0xdefd('0xb5')](loggerCatch('[rescheduleContact][Machine]'));_0x266c55({'reschedule':0x1});}}});}if(_0x44dd68[_0xdefd('0x52')]==='ivr'&&this[_0xdefd('0x21')][_0x44dd68[_0xdefd('0xba')]][_0xdefd('0xe8')]&&_0x24af30[_0xdefd('0xf1')]===_0xdefd('0xe9')){delete this['uniqueId'][_0x24af30[_0xdefd('0xe3')]];this[_0xdefd('0xb7')](this[_0xdefd('0x21')][_0x44dd68[_0xdefd('0xba')]]);_0x547368=new Hangup(_0x44dd68,_0x24af30);_0x547368[_0xdefd('0xae')]=0x12;_0x547368['statedesc']=_0xdefd('0xea');_0x547368[_0xdefd('0xf4')]=_0xdefd('0xeb');ami[_0xdefd('0x51')]('custom:amd',ut[_0xdefd('0xed')](_0x547368,_0xdefd('0xee')));this['saveInDb'](_0x547368,_0xdefd('0x108'),_0xdefd('0x109'));}if(_0x44dd68[_0xdefd('0x52')]==='ivr'&&this[_0xdefd('0x21')][_0x44dd68[_0xdefd('0xba')]][_0xdefd('0xe8')]&&_0x24af30[_0xdefd('0xf1')]===_0xdefd('0xf2')){var _0x285f23=this;return new BPromise(function(_0x2f9888,_0x9c6442){delete _0x285f23[_0xdefd('0x28')][_0x24af30['uniqueid']];_0x285f23[_0xdefd('0xb7')](_0x285f23[_0xdefd('0x21')][_0x44dd68['queue']]);_0x285f23[_0xdefd('0x21')][_0x44dd68['queue']][_0xdefd('0x67')]+=0x1;_0x285f23[_0xdefd('0x21')][_0x44dd68[_0xdefd('0xba')]][_0xdefd('0x66')]+=0x1;var _0x2abcf2=_0x285f23[_0xdefd('0x21')][_0x44dd68[_0xdefd('0xba')]];var _0x1f8721=new Hangup(_0x44dd68,_0x24af30);_0x1f8721[_0xdefd('0xae')]=0x13;_0x1f8721[_0xdefd('0xaf')]=_0xdefd('0xf3');_0x1f8721[_0xdefd('0xf4')]=_0xdefd('0xeb');_0x1f8721[_0xdefd('0xf5')]+=0x1;_0x1f8721[_0xdefd('0xf6')]+=0x1;_0x1f8721[_0xdefd('0xee')]=!![];ami[_0xdefd('0x51')](_0xdefd('0xec'),ut[_0xdefd('0xed')](_0x1f8721,_0xdefd('0xee')));_0x285f23[_0xdefd('0xcf')](_0x1f8721)[_0xdefd('0xb5')](loggerCatch(_0xdefd('0xf7')));if(_0x1f8721[_0xdefd('0xf8')]+_0x1f8721['countcongestionretry']+_0x1f8721[_0xdefd('0xfa')]+_0x1f8721[_0xdefd('0xfb')]+_0x1f8721['countdropretry']+_0x1f8721[_0xdefd('0x10a')]+_0x1f8721[_0xdefd('0xf5')]+_0x1f8721[_0xdefd('0xfc')]>=_0x2abcf2[_0xdefd('0xfd')]){_0x285f23[_0xdefd('0xfe')](_0x1f8721,_0x2f9888,_0x9c6442,'reason19\x20machine....');}else{if(_0x1f8721['countmachineretry']>=_0x2abcf2[_0xdefd('0x100')]){_0x285f23[_0xdefd('0x101')](_0x1f8721,_0x2f9888,_0x9c6442,'reason\x2019\x20machine....');}else{_0x285f23[_0xdefd('0xc4')]({'active':![],'countmachineretry':_0x1f8721[_0xdefd('0xf5')],'scheduledat':moment()['add'](_0x2abcf2['dialMachineRetryFrequency'],_0xdefd('0x105'))[_0xdefd('0x85')](_0xdefd('0x106')),'ContactId':_0x1f8721[_0xdefd('0x107')],'ListId':_0x1f8721['ListId'],'VoiceQueueId':_0x1f8721[_0xdefd('0xd9')]||undefined,'CampaignId':_0x1f8721[_0xdefd('0xda')]||undefined})[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x10b')));_0x2f9888({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0xd08463){var _0x5839ba=this['uniqueId'][_0xd08463['uniqueid']];var _0xc639d=this;var _0x400a41;if(_0x5839ba&&_0x5839ba['type']===_0xdefd('0x88')){delete this[_0xdefd('0x28')][_0xd08463[_0xdefd('0xe3')]];this[_0xdefd('0xb7')](this[_0xdefd('0x21')][_0x5839ba[_0xdefd('0xba')]]);this['campaigns'][_0x5839ba[_0xdefd('0xba')]][_0xdefd('0x10c')]+=0x1;_0x400a41=new Hangup(_0x5839ba,_0xd08463);this['createHistory'](_0x400a41)[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x10d')));this[_0xdefd('0xcd')](_0x400a41)[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x10e')));}if(_0x5839ba&&_0x5839ba[_0xdefd('0x52')]!=='ivr'&&isNotNull(this[_0xdefd('0xb8')][_0x5839ba[_0xdefd('0xba')]][_0xdefd('0x10f')])){delete this[_0xdefd('0x28')][_0xd08463[_0xdefd('0xe3')]];this[_0xdefd('0xb7')](this[_0xdefd('0xb8')][_0x5839ba['queue']]);this[_0xdefd('0xb8')][_0x5839ba[_0xdefd('0xba')]][_0xdefd('0x67')]+=0x1;this['voiceQueues'][_0x5839ba[_0xdefd('0xba')]][_0xdefd('0x66')]+=0x1;_0x400a41=new Hangup(_0x5839ba,_0xd08463);_0x400a41[_0xdefd('0xae')]=0x10;_0x400a41[_0xdefd('0xaf')]=_0xdefd('0x110');_0x400a41[_0xdefd('0xf4')]=_0xdefd('0x111');this[_0xdefd('0xcf')](_0x400a41)[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x10d')));this[_0xdefd('0xcd')](_0x400a41)[_0xdefd('0xb5')](loggerCatch('[syncHangupIvr]'));}if(_0x5839ba&&_0x5839ba[_0xdefd('0x52')]!==_0xdefd('0x88')&&!isNotNull(this[_0xdefd('0xb8')][_0x5839ba[_0xdefd('0xba')]][_0xdefd('0x10f')])){delete this['uniqueId'][_0xd08463[_0xdefd('0xe3')]];this[_0xdefd('0xb7')](this[_0xdefd('0xb8')][_0x5839ba[_0xdefd('0xba')]]);this[_0xdefd('0xb8')][_0x5839ba[_0xdefd('0xba')]][_0xdefd('0x72')]+=0x1;_0x400a41=new Hangup(_0x5839ba,_0xd08463);_0x400a41['state']=0xc;_0x400a41[_0xdefd('0xaf')]=_0xd08463[_0xdefd('0x112')];_0x400a41['membername']=_0xdefd('0x113');this[_0xdefd('0xcf')](_0x400a41)[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x10d')));this[_0xdefd('0xcd')](_0x400a41)[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x10e')));}};Dialer[_0xdefd('0x1c')]['syncAgentComplete']=function(_0x271c00){var _0x12b2d7=this[_0xdefd('0x28')][_0x271c00[_0xdefd('0xe3')]];var _0x56961a=this;if(this[_0xdefd('0xb8')][_0x271c00['queue']]){if(_0x12b2d7&&_0x12b2d7[_0xdefd('0x52')]!==_0xdefd('0x88')){delete this[_0xdefd('0x28')][_0x271c00[_0xdefd('0xe3')]];this[_0xdefd('0xb8')][_0x271c00[_0xdefd('0xba')]]['outboundAnswerCallsDay']+=0x1;var _0x1b3f34=new AgentComplete(_0x12b2d7,_0x271c00);if(_0x271c00[_0xdefd('0x114')]===_0xdefd('0x115')){_0x1b3f34[_0xdefd('0x116')]=this[_0xdefd('0xb8')][_0x271c00[_0xdefd('0xba')]][_0xdefd('0x117')]&&this[_0xdefd('0xb8')][_0x271c00['queue']][_0xdefd('0x118')]?moment()['format'](_0xdefd('0x106')):undefined;}this[_0xdefd('0xcf')](_0x1b3f34)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xdefd('0xcd')](_0x1b3f34)[_0xdefd('0xb5')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xdefd('0x1c')][_0xdefd('0x2f')]=function(_0xa6992a){if(this[_0xdefd('0xb8')][_0xa6992a[_0xdefd('0xba')]]){if(this['uniqueId'][_0xa6992a['uniqueid']]&&this[_0xdefd('0x28')][_0xa6992a[_0xdefd('0xe3')]][_0xdefd('0x52')]!==_0xdefd('0x88')){this[_0xdefd('0xb7')](this[_0xdefd('0xb8')][_0xa6992a[_0xdefd('0xba')]]);this[_0xdefd('0x28')][_0xa6992a[_0xdefd('0xe3')]][_0xdefd('0x119')]=moment()[_0xdefd('0x85')](_0xdefd('0x106'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x4f7e18){this[_0xdefd('0xcf')](_0x4f7e18)['catch'](loggerCatch(_0xdefd('0x11a')));this[_0xdefd('0xcd')](_0x4f7e18)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xdefd('0x1c')][_0xdefd('0x30')]=function(_0x254ff1){var _0x394c56=this[_0xdefd('0x28')][_0x254ff1[_0xdefd('0xe3')]];var _0x545731=this;if(this[_0xdefd('0xb8')][_0x254ff1[_0xdefd('0xba')]]){if(_0x394c56&&_0x394c56['type']!==_0xdefd('0x88')){delete this[_0xdefd('0x28')][_0x254ff1[_0xdefd('0xe3')]];this[_0xdefd('0xb7')](this['voiceQueues'][_0x254ff1[_0xdefd('0xba')]]);_0x394c56[_0xdefd('0x11b')]=moment()['format'](_0xdefd('0x106'));var _0x327e75=new QueueCallerAbandon(_0x394c56,_0x254ff1);if(getSeconds(_0x394c56[_0xdefd('0x11b')],_0x394c56[_0xdefd('0x11c')])>=_0x394c56['dialQueueTimeout']){this[_0xdefd('0xb8')][_0x254ff1[_0xdefd('0xba')]][_0xdefd('0x77')]+=0x1;this['voiceQueues'][_0x254ff1['queue']][_0xdefd('0x6c')]+=0x1;this[_0xdefd('0xb8')][_0x254ff1[_0xdefd('0xba')]][_0xdefd('0x78')]+=0x1;_0x327e75[_0xdefd('0xae')]=0xa;_0x327e75[_0xdefd('0xaf')]=_0xdefd('0x11d');_0x327e75[_0xdefd('0x11e')]=_0xdefd('0x11f');_0x327e75[_0xdefd('0x116')]=this['voiceQueues'][_0x254ff1[_0xdefd('0xba')]][_0xdefd('0x117')]?moment()[_0xdefd('0x85')](_0xdefd('0x106')):undefined;_0x327e75[_0xdefd('0x120')]+=0x1;_0x327e75[_0xdefd('0xf6')]+=0x1;if(_0x327e75['countdropretry']>=this[_0xdefd('0xb8')][_0x254ff1['queue']][_0xdefd('0x121')]){this[_0xdefd('0x122')](_0x327e75);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x327e75[_0xdefd('0x120')],'scheduledat':moment()[_0xdefd('0x103')](this['voiceQueues'][_0x254ff1[_0xdefd('0xba')]][_0xdefd('0x123')],'minutes')[_0xdefd('0x85')](_0xdefd('0x106')),'ContactId':_0x394c56[_0xdefd('0x107')],'ListId':_0x394c56['ListId'],'VoiceQueueId':_0x394c56['VoiceQueueId']||undefined,'CampaignId':_0x394c56[_0xdefd('0xda')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x160a6d=new History(_0x327e75);_0x160a6d['state']=0xa;_0x160a6d[_0xdefd('0xaf')]='Drop';_0x160a6d[_0xdefd('0x124')]=moment()[_0xdefd('0x85')](_0xdefd('0x106'));_0x160a6d[_0xdefd('0x125')]=_0x160a6d[_0xdefd('0x124')];_0x160a6d[_0xdefd('0x126')]=_0x327e75[_0xdefd('0x126')];_0x160a6d[_0xdefd('0x127')]=_0x327e75[_0xdefd('0x127')];this['createHistory'](_0x160a6d)[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x128')));}}else{this[_0xdefd('0xb8')][_0x254ff1[_0xdefd('0xba')]][_0xdefd('0x76')]+=0x1;this[_0xdefd('0xb8')][_0x254ff1[_0xdefd('0xba')]][_0xdefd('0x6b')]+=0x1;_0x327e75[_0xdefd('0xae')]=0xb;_0x327e75[_0xdefd('0xaf')]='Abandoned';_0x327e75[_0xdefd('0x11e')]=_0xdefd('0x129');_0x327e75[_0xdefd('0x10a')]+=0x1;_0x327e75[_0xdefd('0xf6')]+=0x1;if(_0x327e75[_0xdefd('0x10a')]>=this[_0xdefd('0xb8')][_0x254ff1[_0xdefd('0xba')]][_0xdefd('0x12a')]){this[_0xdefd('0x122')](_0x327e75);}else{this[_0xdefd('0xc4')]({'active':![],'countabandonedretry':_0x327e75[_0xdefd('0x10a')],'scheduledat':moment()[_0xdefd('0x103')](this['voiceQueues'][_0x254ff1[_0xdefd('0xba')]][_0xdefd('0x12b')],_0xdefd('0x105'))[_0xdefd('0x85')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x394c56[_0xdefd('0x107')],'ListId':_0x394c56[_0xdefd('0xd8')],'VoiceQueueId':_0x394c56[_0xdefd('0xd9')]||undefined,'CampaignId':_0x394c56[_0xdefd('0xda')]||undefined})[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x12c')));var _0x160a6d=new History(_0x327e75);_0x160a6d['state']=0xb;_0x160a6d[_0xdefd('0xaf')]=_0xdefd('0x12d');_0x160a6d[_0xdefd('0x124')]=moment()[_0xdefd('0x85')](_0xdefd('0x106'));_0x160a6d['endtime']=_0x160a6d[_0xdefd('0x124')];_0x160a6d['calleridname']=_0x327e75[_0xdefd('0x126')];_0x160a6d[_0xdefd('0x127')]=_0x327e75[_0xdefd('0x127')];this[_0xdefd('0xcf')](_0x160a6d)[_0xdefd('0xb5')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0xdefd('0x1c')]['syncNewExten']=function(_0x1c2809){if(this[_0xdefd('0x26')][_0x1c2809[_0xdefd('0xe3')]]){this[_0xdefd('0x26')][_0x1c2809[_0xdefd('0xe3')]]['channel']=_0x1c2809[_0xdefd('0x12e')];}if(this[_0xdefd('0x28')][_0x1c2809[_0xdefd('0xe3')]]){this[_0xdefd('0x28')][_0x1c2809[_0xdefd('0xe3')]][_0xdefd('0x12e')]=_0x1c2809[_0xdefd('0x12e')];}};Dialer[_0xdefd('0x1c')][_0xdefd('0x12f')]=function(_0x34f678){if(strategy[this[_0xdefd('0xb8')][this[_0xdefd('0x26')][_0x34f678['actionid']][_0xdefd('0xba')]][_0xdefd('0x54')]]===_0xdefd('0x130')){if(this[_0xdefd('0x26')][_0x34f678[_0xdefd('0x131')]]&&_[_0xdefd('0xe4')](this['actions'][_0x34f678[_0xdefd('0x131')]]['locked'])&&_0x34f678[_0xdefd('0xb4')]==='1'&&_0x34f678[_0xdefd('0x132')]==='0'){if(this[_0xdefd('0x22')][_0x34f678[_0xdefd('0x133')]]){if(!this[_0xdefd('0x22')][_0x34f678['stateinterface']]['locked']){this['agents'][_0x34f678[_0xdefd('0x133')]][_0xdefd('0x134')]=!![];this['actions'][_0x34f678[_0xdefd('0x131')]][_0xdefd('0x134')]=!![];this[_0xdefd('0x26')][_0x34f678[_0xdefd('0x131')]][_0xdefd('0x133')]=_0x34f678[_0xdefd('0x133')];}}}}else if((strategy[this[_0xdefd('0xb8')][this['actions'][_0x34f678[_0xdefd('0x131')]][_0xdefd('0xba')]][_0xdefd('0x54')]]||_0xdefd('0x135'))===_0xdefd('0x135')){if(this[_0xdefd('0x26')][_0x34f678[_0xdefd('0x131')]]){if(this['agents'][_0x34f678[_0xdefd('0x133')]]){this['actions'][_0x34f678[_0xdefd('0x131')]][_0xdefd('0x133')]=_0x34f678[_0xdefd('0x133')];if(_[_0xdefd('0xe4')](this[_0xdefd('0x2c')][this[_0xdefd('0x26')][_0x34f678[_0xdefd('0x131')]][_0xdefd('0xba')]])){this[_0xdefd('0x2c')][this[_0xdefd('0x26')][_0x34f678[_0xdefd('0x131')]]['queue']]=[];}this[_0xdefd('0x2c')][this[_0xdefd('0x26')][_0x34f678['actionid']][_0xdefd('0xba')]][_0xdefd('0x136')](_['merge'](_[_0xdefd('0xd7')](this['actions'][_0x34f678[_0xdefd('0x131')]],[_0xdefd('0x137'),'stateinterface']),{'status':_0x34f678['status'],'paused':_0x34f678[_0xdefd('0x132')]}));}}}};function unlockQueueStatus(_0x20d77f,_0xc7e926){setTimeout(function(){if(_[_0xdefd('0x41')](_0x20d77f[_0xdefd('0x138')])){loggerBooked[_0xdefd('0x9f')]('[unlockQueueStatus][undefined]',_0xc7e926);}_0x20d77f['queueStatusComplete']=!![];loggerBooked[_0xdefd('0x8a')](_0xdefd('0x139'),_0xc7e926,JSON[_0xdefd('0x84')](_[_0xdefd('0xd7')](_0x20d77f,[_0xdefd('0x44'),_0xdefd('0x138')])));},0x1f3);}Dialer[_0xdefd('0x1c')][_0xdefd('0x13a')]=function(_0x178ba1){var _0x30eab3=this;var _0x478fa3=_0x30eab3[_0xdefd('0xb8')][_0x30eab3[_0xdefd('0x26')][_0x178ba1['actionid']][_0xdefd('0xba')]];if(strategy[this[_0xdefd('0xb8')][this[_0xdefd('0x26')][_0x178ba1[_0xdefd('0x131')]]['queue']][_0xdefd('0x54')]]===_0xdefd('0x130')){if(this['actions'][_0x178ba1[_0xdefd('0x131')]]&&this['actions'][_0x178ba1[_0xdefd('0x131')]]['stateinterface']){this[_0xdefd('0x20')][_0xdefd('0x13b')](this[_0xdefd('0x26')][_0x178ba1['actionid']]['idHopper'],this['actions'][_0x178ba1[_0xdefd('0x131')]][_0xdefd('0x133')])[_0xdefd('0xb5')](function(_0x17d894){logger[_0xdefd('0x9f')](_0xdefd('0x13c'),util[_0xdefd('0xa0')](_0x17d894,{'showHidden':![],'depth':null}));})[_0xdefd('0x13d')](function(){_0x30eab3[_0xdefd('0xb7')](_0x30eab3[_0xdefd('0xb8')][_0x30eab3[_0xdefd('0x26')][_0x178ba1['actionid']][_0xdefd('0xba')]]);_0x30eab3[_0xdefd('0x22')][_0x30eab3[_0xdefd('0x26')][_0x178ba1[_0xdefd('0x131')]][_0xdefd('0x133')]][_0xdefd('0x134')]=![];delete _0x30eab3[_0xdefd('0x26')][_0x178ba1[_0xdefd('0x131')]];unlockQueueStatus(_0x478fa3);});}else{this[_0xdefd('0xb7')](this[_0xdefd('0xb8')][this[_0xdefd('0x26')][_0x178ba1[_0xdefd('0x131')]][_0xdefd('0xba')]]);this[_0xdefd('0xc4')]({'active':![],'ContactId':this[_0xdefd('0x26')][_0x178ba1[_0xdefd('0x131')]][_0xdefd('0x107')],'ListId':this[_0xdefd('0x26')][_0x178ba1['actionid']]['ListId'],'VoiceQueueId':this[_0xdefd('0x26')][_0x178ba1[_0xdefd('0x131')]][_0xdefd('0xd9')]||undefined,'CampaignId':this[_0xdefd('0x26')][_0x178ba1[_0xdefd('0x131')]][_0xdefd('0xda')]||undefined})[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x13e')));delete this[_0xdefd('0x26')][_0x178ba1[_0xdefd('0x131')]];unlockQueueStatus(_0x478fa3);}}else if((strategy[this['voiceQueues'][this[_0xdefd('0x26')][_0x178ba1[_0xdefd('0x131')]][_0xdefd('0xba')]][_0xdefd('0x54')]]||'rrmemory')===_0xdefd('0x135')){var _0x5c5c55;if(this[_0xdefd('0x26')][_0x178ba1['actionid']]&&!_[_0xdefd('0x89')](this['queueBooked'][this['actions'][_0x178ba1[_0xdefd('0x131')]][_0xdefd('0xba')]])){if(this[_0xdefd('0x2d')][_0x30eab3['actions'][_0x178ba1[_0xdefd('0x131')]][_0xdefd('0xba')]]){this[_0xdefd('0x2d')][_0x30eab3[_0xdefd('0x26')][_0x178ba1['actionid']][_0xdefd('0xba')]]=this[_0xdefd('0x2d')][this[_0xdefd('0x26')][_0x178ba1[_0xdefd('0x131')]][_0xdefd('0xba')]]?this['queueBookedRR'][this['actions'][_0x178ba1['actionid']][_0xdefd('0xba')]]:this[_0xdefd('0x2c')][this['actions'][_0x178ba1['actionid']][_0xdefd('0xba')]]?this[_0xdefd('0x2c')][this[_0xdefd('0x26')][_0x178ba1[_0xdefd('0x131')]][_0xdefd('0xba')]]['_rr']||0x0:0x0;}this['queueBooked'][this[_0xdefd('0x26')][_0x178ba1[_0xdefd('0x131')]][_0xdefd('0xba')]][_0xdefd('0x13f')]=this[_0xdefd('0x2d')][this['actions'][_0x178ba1['actionid']][_0xdefd('0xba')]];for(var _0x146c7c=0x0;_0x146c7c=0x0;})[_0xdefd('0xb5')](myreject(_0x43eb8d)));}}else{_0x4d5d00['push'](ami[_0xdefd('0xb3')]({'action':_0xdefd('0x157'),'command':util['format'](_0xdefd('0x158'),_0x28a9b3,!_[_0xdefd('0x41')](config['timezones'][_0x248690])?_0x248690:'')})[_0xdefd('0x3f')](function(_0x4c9371){return _0x4c9371[_0xdefd('0x15b')][_0xdefd('0x15c')](_0xdefd('0x15a'))>=0x0;})[_0xdefd('0xb5')](myreject(_0x43eb8d)));}BPromise['all'](_0x4d5d00)[_0xdefd('0x3f')](function(_0x2f5e74){var _0xc45f91=_[_0xdefd('0x15d')](_0x2f5e74);if(_0xc45f91){return _0x18815e(_0xc45f91);}else{_0x5cbef0[_0xdefd('0x42')]=_0x4d9a7c?_0xdefd('0x15e'):_0xdefd('0x15f');return _0x43eb8d(msgResponse(_0xdefd('0x160'),_0xdefd('0x152'),_0xdefd('0x161')+_0x4d9a7c+'\x20'+_0x216bfd+'\x20Interval\x20is\x20overtime:\x20'+util[_0xdefd('0xa0')](_0x28a9b3,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x248690));}})[_0xdefd('0xb5')](function(_0x49fc4f){return _0x43eb8d(msgResponse(_0xdefd('0x14e'),_0xdefd('0x152'),JSON['stringify'](_0x49fc4f)));});});};Dialer[_0xdefd('0x1c')]['checkDialMethod']=function(_0x54fd50){var _0x47b4ad=this;return function(){switch(_0x54fd50['dialMethod']){case'progressive':freeVariablesPredictive(_0x54fd50);_0x47b4ad[_0xdefd('0x162')](_0x54fd50,0x1);break;case _0xdefd('0x163'):freeVariablesPredictive(_0x54fd50);_0x47b4ad[_0xdefd('0x162')](_0x54fd50,_0x54fd50[_0xdefd('0x164')]);break;case _0xdefd('0x9'):_0x47b4ad[_0xdefd('0x9')](_0x54fd50);break;case _0xdefd('0x165'):freeVariablesPredictive(_0x54fd50);_0x47b4ad[_0xdefd('0x162')](_0x54fd50,0x1);break;default:freeVariablesPredictive(_0x54fd50);logger[_0xdefd('0x9f')]('Queue',_0x54fd50[_0xdefd('0x44')],_0xdefd('0x166'));}};};Dialer['prototype']['checkPreviewRecallReminder']=function(_0x599e7e){return BPromise['resolve']()['then'](cmHopper[_0xdefd('0x167')](_0x599e7e['id'],previewRecallmeReminderInterval))[_0xdefd('0x3f')](function(_0x515aff){for(var _0x23f9e0=0x0;_0x23f9e0<_0x515aff[_0xdefd('0xa2')];_0x23f9e0++){var _0x15b502=_0x515aff[_0x23f9e0]['Agent'][_0xdefd('0x44')];if(_0x15b502)io['to'](util[_0xdefd('0x85')]('user:%s',_0x15b502))[_0xdefd('0x51')](_0xdefd('0x168'),{'hopper':_0x515aff[_0x23f9e0]});}})[_0xdefd('0xb5')](function(_0x2c2ccf){});};Dialer['prototype']['launchHandleIvr']=function(_0x1d873e){var _0x5dfdee=this;return function(){_0x5dfdee[_0xdefd('0x169')](_0x1d873e);};};Dialer[_0xdefd('0x1c')][_0xdefd('0xb')]=function(_0x59d317){var _0x50db71=this;if(isNotPreview(_0x59d317[_0xdefd('0x16a')])){if(isVoiceQueueOutbound(_0x59d317['type'])&&isActive(_0x59d317[_0xdefd('0x61')])){_0x59d317[_0xdefd('0xa9')]=!![];BPromise[_0xdefd('0xbd')]()[_0xdefd('0x3f')](checkIsLoggedIn(_0x59d317,_0x59d317[_0xdefd('0x56')]))[_0xdefd('0x3f')](checkIsActive(_0x59d317,_0x59d317[_0xdefd('0x61')]))[_0xdefd('0x3f')](checkInterval(_0x59d317))[_0xdefd('0x3f')](_0x50db71[_0xdefd('0x14a')](_0x59d317))[_0xdefd('0x3f')](_0x50db71[_0xdefd('0x14d')](_0x59d317[_0xdefd('0x16b')],_0x59d317['dialTimezone'],_0x59d317[_0xdefd('0x44')],_0x59d317))[_0xdefd('0x3f')](_0x50db71['checkIfTimeIntervals'](_0x59d317[_0xdefd('0x48')],_0x59d317[_0xdefd('0x16c')],_0x59d317[_0xdefd('0x44')],_0x59d317))[_0xdefd('0x3f')](_0x50db71['checkDialMethod'](_0x59d317))['catch'](loggerCatchQueueSummary(_0xdefd('0x16d'),_0x59d317));}else{notSendMessagesQueue(_0x59d317);}}else{freeVariablesPredictive(_0x59d317);if(_0x59d317[_0xdefd('0x16e')]){_0x50db71[_0xdefd('0x16f')](_0x59d317);}}};Dialer[_0xdefd('0x1c')][_0xdefd('0x149')]=function(){var _0x189c25=this;var _0x3d8fec;for(var _0x345e90 in this[_0xdefd('0x21')]){if(typeof this['campaigns'][_0x345e90]!==_0xdefd('0xa3')){_0x3d8fec=this[_0xdefd('0x21')][_0x345e90];if(isCampaignIvr(_0x3d8fec['type'])&&isActive(_0x3d8fec[_0xdefd('0xdf')])){_0x3d8fec[_0xdefd('0xa9')]=!![];BPromise['resolve']()[_0xdefd('0x3f')](checkIsActive(_0x3d8fec,_0x3d8fec[_0xdefd('0xdf')]))[_0xdefd('0x3f')](checkInterval(_0x3d8fec))[_0xdefd('0x3f')](_0x189c25[_0xdefd('0x14a')](_0x3d8fec))['then'](_0x189c25['checkIfTime'](_0x3d8fec[_0xdefd('0x16b')],_0x3d8fec['dialTimezone'],_0x3d8fec['name'],_0x3d8fec))[_0xdefd('0x3f')](_0x189c25[_0xdefd('0x14f')](_0x3d8fec['Interval'],_0x3d8fec['dialTimezone'],_0x3d8fec[_0xdefd('0x44')],_0x3d8fec))['then'](_0x189c25[_0xdefd('0x170')](_0x3d8fec))[_0xdefd('0xb5')](loggerCatchQueueSummary('[syncCampaigns]',_0x3d8fec));}else{notSendMessagesCampaign(_0x3d8fec);}}}};function getCallerIdRandom(_0x29dd04,_0x1e9a49){var _0x13ed16;var _0x4d5ddf;var _0x2a8817;if(_0x1e9a49<=0x0){_0x1e9a49=0x1;}_0x13ed16=new RegExp('\x5cw{0,'+_0x1e9a49+'}$');_0x4d5ddf=Math[_0xdefd('0x171')](0xa,_0x1e9a49-0x1);_0x2a8817=Math['pow'](0xa,_0x1e9a49)-0x1;return util['format']('%s',_[_0xdefd('0x172')](_0x29dd04,_0x13ed16,_[_0xdefd('0x173')](_0x4d5ddf,_0x2a8817)));}function extractCalleridName(_0x42b751){var _0xec914a=_0x42b751[_0xdefd('0x174')](/"(.*?)"/);return _0xec914a?_0xec914a[0x1]:_0x42b751;}function extractCalleridNumber(_0x426446){var _0x5240f1=_0x426446[_0xdefd('0x174')](/<(.*?)>/);return _0x5240f1?_0x5240f1[0x1]:_0x426446;}Dialer[_0xdefd('0x1c')]['actionOriginate']=function(_0x1d4baf,_0x3fc528){var _0x3a48c6=this;var _0x14cc6d=uuid['v4']();this[_0xdefd('0x26')][_0x14cc6d]=new Action(_0x1d4baf,_0x3fc528,_0x14cc6d);return new BPromise(function(_0x555462,_0x16e14e){if(_[_0xdefd('0x41')](_0x1d4baf)&&typeof _0x1d4baf!==_0xdefd('0x175')){return _0x16e14e(msgResponse(_0xdefd('0x176'),_0xdefd('0x152'),_0xdefd('0x177')));}if(_[_0xdefd('0x41')](_0x3fc528[_0xdefd('0x178')][_0xdefd('0x179')])||_0x3fc528['Contact'][_0xdefd('0x179')]===null){return _0x16e14e(msgResponse(_0xdefd('0x176'),_0xdefd('0x152'),'contact\x20is\x20undefine'));}var _0xc349eb={'XMD-CALLERID':_0x3a48c6[_0xdefd('0x26')][_0x14cc6d][_0xdefd('0x17a')](),'XMD-AGI':_0x1d4baf[_0xdefd('0x10f')]?util[_0xdefd('0x85')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1d4baf[_0xdefd('0x10f')]):_0xdefd('0x17b'),'XMD-AGIAFTER':_0x1d4baf[_0xdefd('0x117')]?util[_0xdefd('0x85')](_0xdefd('0x17c'),ipAgi,_0x1d4baf[_0xdefd('0x117')]):_0xdefd('0x17b'),'XMD-QUEUE':_0x1d4baf[_0xdefd('0x52')]==='outbound'?util[_0xdefd('0x85')](_0xdefd('0x17d'),_0x1d4baf['name'],_0x1d4baf[_0xdefd('0x17e')]||'',_0x1d4baf[_0xdefd('0x118')]?'c':'',_0x1d4baf[_0xdefd('0x17f')]||0x3):_0xdefd('0x17b'),'XMD-CONTACTID':_0x3fc528['ContactId'],'XMD-CDRTYPE':_0xdefd('0x180'),'CALLERID(all)':_0x3a48c6[_0xdefd('0x26')][_0x14cc6d][_0xdefd('0x17a')](),'XMD-AMD':_0x1d4baf['dialAMDActive']?_0xdefd('0x181'):_0xdefd('0x17b'),'XMD-DESTINATION':_0xdefd('0xe7')};if(_0x1d4baf[_0xdefd('0xe8')]){_0xc349eb[_0xdefd('0x182')]=_0x1d4baf[_0xdefd('0x183')]||0x9c4;_0xc349eb['XMD-AMDGREETING']=_0x1d4baf[_0xdefd('0x184')]||0x5dc;_0xc349eb['XMD-AMDAFTERGREETINGSILENCE']=_0x1d4baf[_0xdefd('0x185')]||0x320;_0xc349eb[_0xdefd('0x186')]=_0x1d4baf[_0xdefd('0x187')]||0x1388;_0xc349eb[_0xdefd('0x188')]=_0x1d4baf[_0xdefd('0x189')]||0x64;_0xc349eb['XMD-AMDBETWEENWORDSSILENCE']=_0x1d4baf[_0xdefd('0x18a')]||0x32;_0xc349eb[_0xdefd('0x18b')]=_0x1d4baf[_0xdefd('0x18c')]||0x3;_0xc349eb[_0xdefd('0x18d')]=_0x1d4baf[_0xdefd('0x18e')]||0x100;_0xc349eb['XMD-AMDMAXIMUMWORDLENGTH']=_0x1d4baf['dialAMDMaximumWordLength']||0x1388;}if(_0x1d4baf[_0xdefd('0x52')]===_0xdefd('0x53')){_0xc349eb[_0xdefd('0x18f')]=_0x3fc528[_0xdefd('0xd9')];}else{_0xc349eb[_0xdefd('0x190')]=_0x3fc528['CampaignId'];}for(var _0x5d996e in _0x3fc528[_0xdefd('0x178')]){if(typeof _0x3fc528['Contact'][_0x5d996e]!==_0xdefd('0xa3')){if(isNotNull(_0x3fc528[_0xdefd('0x178')][_0x5d996e])&&_0x5d996e!=='id'&&_0x5d996e!==_0xdefd('0x191')&&_0x5d996e!==_0xdefd('0x192')&&_0x5d996e!==_0xdefd('0x193')){_0xc349eb[util[_0xdefd('0x85')](_0xdefd('0x194'),_0xdefd('0x195'),_[_0xdefd('0x196')](_0x5d996e))]=_0x3fc528[_0xdefd('0x178')][_0x5d996e];}}}var _0x1ddc28=_0x3a48c6[_0xdefd('0xde')](_0x1d4baf[_0xdefd('0x83')])?getCallerId(_0x1d4baf['Trunk'][_0xdefd('0x197')],_0x1d4baf[_0xdefd('0x62')],_0x1d4baf[_0xdefd('0x198')]>0x0?getCallerIdRandom(_0x1d4baf[_0xdefd('0x63')],_0x1d4baf[_0xdefd('0x198')]):_0x1d4baf['dialOriginateCallerIdNumber']):getCallerId(_[_0xdefd('0xe4')](_0x1d4baf['TrunkBackup'])?_0x1d4baf['Trunk']['callerid']:_0x1d4baf['TrunkBackup'][_0xdefd('0x197')],_0x1d4baf['dialOriginateCallerIdName'],_0x1d4baf[_0xdefd('0x198')]>0x0?getCallerIdRandom(_0x1d4baf[_0xdefd('0x63')],_0x1d4baf[_0xdefd('0x198')]):_0x1d4baf[_0xdefd('0x63')]);if(_0x1ddc28){_0xc349eb[_0xdefd('0x199')]=_0x3a48c6[_0xdefd('0x26')][_0x14cc6d][_0xdefd('0x19a')]=extractCalleridName(_0x1ddc28);_0xc349eb[_0xdefd('0x19b')]=_0x3a48c6[_0xdefd('0x26')][_0x14cc6d]['originatecalleridnum']=extractCalleridNumber(_0x1ddc28);}return ami[_0xdefd('0xb3')]({'actionid':_0x14cc6d,'action':_0xdefd('0x176'),'channel':_0x3a48c6[_0xdefd('0xde')](_0x1d4baf[_0xdefd('0x83')])?util[_0xdefd('0x85')](_0xdefd('0x19c'),_0x1d4baf[_0xdefd('0x83')][_0xdefd('0x44')],isNotNull(_0x1d4baf[_0xdefd('0x65')])?_0x1d4baf[_0xdefd('0x65')][_0xdefd('0x19d')]()||'':'',_0x1d4baf[_0xdefd('0x19e')]>0x0?_0x3fc528[_0xdefd('0x178')][_0xdefd('0x179')][_0xdefd('0x19f')](_0x1d4baf[_0xdefd('0x19e')]):_0x3fc528[_0xdefd('0x178')][_0xdefd('0x179')]):util['format'](_0xdefd('0x19c'),_[_0xdefd('0xe4')](_0x1d4baf['TrunkBackup'])?_0x1d4baf[_0xdefd('0x83')][_0xdefd('0x44')]:_0x1d4baf[_0xdefd('0x14b')]['name'],isNotNull(_0x1d4baf[_0xdefd('0x65')])?_0x1d4baf[_0xdefd('0x65')][_0xdefd('0x19d')]()||'':'',_0x1d4baf['dialCutDigit']>0x0?_0x3fc528[_0xdefd('0x178')][_0xdefd('0x179')]['substring'](_0x1d4baf['dialCutDigit']):_0x3fc528[_0xdefd('0x178')]['phone']),'callerid':_0x1ddc28,'Exten':_0xdefd('0xe7'),'Context':_0xdefd('0x1a0'),'Priority':'1','variable':_0xc349eb,'timeout':(_0x1d4baf[_0xdefd('0x64')]||0x1e)*0x3e8,'async':!![],'channelid':_0x14cc6d})[_0xdefd('0x3f')](function(_0x4892cd){return _0x555462(_0x4892cd);})[_0xdefd('0xb5')](function(_0xbeeda9){_0x1d4baf[_0xdefd('0x6f')]+=0x1;var _0x5a6f7f=new History(_0x3a48c6[_0xdefd('0x26')][_0x14cc6d]);logger[_0xdefd('0x9f')](util['format'](_0xdefd('0x1a1'),JSON[_0xdefd('0x84')](_0xbeeda9)));_0x5a6f7f[_0xdefd('0xae')]=0xe;_0x5a6f7f['statedesc']=_0xdefd('0x1a2');_0x5a6f7f[_0xdefd('0x124')]=moment()[_0xdefd('0x85')](_0xdefd('0x106'));_0x5a6f7f[_0xdefd('0x125')]=_0x5a6f7f[_0xdefd('0x124')];_0x3a48c6[_0xdefd('0xcf')](_0x5a6f7f)[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x1a3')));_0x3a48c6['moveContactManagedDialer'](_0x5a6f7f)[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x1a3')))['finally'](function(){delete _0x3a48c6[_0xdefd('0x26')][_0x14cc6d];return _0x16e14e(msgResponse(_0xdefd('0x176'),'Error',_0xdefd('0x1a4')));});});});};Dialer[_0xdefd('0x1c')]['syncOriginateResponse']=function(_0x2ef635){var _0x533ee3=this[_0xdefd('0x26')][_0x2ef635[_0xdefd('0x131')]];if(_0x533ee3){delete this[_0xdefd('0x26')][_0x2ef635[_0xdefd('0x131')]];_0x533ee3[_0xdefd('0x11c')]=moment()[_0xdefd('0x85')](_0xdefd('0x106'));var _0x582a72=_0x533ee3[_0xdefd('0x52')]===_0xdefd('0x88')?this['campaigns'][_0x533ee3['queue']]:this['voiceQueues'][_0x533ee3['getQueue']()];if(!this[_0xdefd('0xdc')](_0x2ef635[_0xdefd('0x1a5')])){this['updateOriginated'](_0x582a72);return this['callProgressDetecting'](_0x533ee3,_0x582a72,_0x2ef635)['catch'](loggerCatch(_0xdefd('0x1a6')));}this[_0xdefd('0x28')][_0x2ef635['uniqueid']]=_0x533ee3;}};Dialer['prototype'][_0xdefd('0x1a7')]=function(_0x26838c,_0x345806,_0x944a82){var _0x1b75f6=new History(_0x345806);if(_0x1b75f6[_0xdefd('0xf8')]+_0x1b75f6['countcongestionretry']+_0x1b75f6['countnoanswerretry']+_0x1b75f6[_0xdefd('0xfb')]+_0x1b75f6['countdropretry']+_0x1b75f6['countabandonedretry']+_0x1b75f6[_0xdefd('0xf5')]+_0x1b75f6[_0xdefd('0xfc')]>=_0x944a82[_0xdefd('0xfd')]-0x1){return!![];}switch(_0x26838c){case 0x3:if(_0x1b75f6[_0xdefd('0xfa')]>=_0x944a82[_0xdefd('0x1a8')]-0x1){return!![];}this[_0xdefd('0xc4')]({'active':![],'countnoanswerretry':_0x1b75f6[_0xdefd('0xfa')]+=0x1,'scheduledat':moment()[_0xdefd('0x103')](_0x944a82['dialNoAnswerRetryFrequency'],'minutes')[_0xdefd('0x85')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1b75f6[_0xdefd('0x107')],'ListId':_0x1b75f6[_0xdefd('0xd8')],'VoiceQueueId':_0x1b75f6[_0xdefd('0xd9')]||undefined,'CampaignId':_0x1b75f6['CampaignId']||undefined})[_0xdefd('0xb5')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x1b75f6['countbusyretry']>=_0x944a82['dialBusyMaxRetry']-0x1){return!![];}this[_0xdefd('0xc4')]({'active':![],'countbusyretry':_0x1b75f6[_0xdefd('0xf8')]+=0x1,'scheduledat':moment()['add'](_0x944a82[_0xdefd('0x1a9')],_0xdefd('0x105'))[_0xdefd('0x85')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1b75f6[_0xdefd('0x107')],'ListId':_0x1b75f6[_0xdefd('0xd8')],'VoiceQueueId':_0x1b75f6['VoiceQueueId']||undefined,'CampaignId':_0x1b75f6[_0xdefd('0xda')]||undefined})[_0xdefd('0xb5')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x1b75f6[_0xdefd('0xf9')]>=_0x944a82[_0xdefd('0x1aa')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x1b75f6[_0xdefd('0xf9')]+=0x1,'scheduledat':moment()[_0xdefd('0x103')](_0x944a82[_0xdefd('0x1ab')],_0xdefd('0x105'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1b75f6[_0xdefd('0x107')],'ListId':_0x1b75f6[_0xdefd('0xd8')],'VoiceQueueId':_0x1b75f6[_0xdefd('0xd9')]||undefined,'CampaignId':_0x1b75f6[_0xdefd('0xda')]||undefined})[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x1ac')));break;case 0x0:if(_0x1b75f6[_0xdefd('0xfb')]>=_0x944a82[_0xdefd('0x1ad')]-0x1){return!![];}else{this[_0xdefd('0xc4')]({'active':![],'countnosuchnumberretry':_0x1b75f6[_0xdefd('0xfb')]+=0x1,'scheduledat':moment()['add'](_0x944a82['dialNoSuchNumberRetryFrequency'],_0xdefd('0x105'))[_0xdefd('0x85')](_0xdefd('0x106')),'ContactId':_0x1b75f6[_0xdefd('0x107')],'ListId':_0x1b75f6['ListId'],'VoiceQueueId':_0x1b75f6['VoiceQueueId']||undefined,'CampaignId':_0x1b75f6[_0xdefd('0xda')]||undefined})[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x1ae')));}break;case 0xa:if(_0x1b75f6['countdropretry']>=_0x944a82[_0xdefd('0x121')]-0x1){return!![];}this[_0xdefd('0xc4')]({'active':![],'countdropretry':_0x1b75f6[_0xdefd('0x120')]+=0x1,'scheduledat':moment()[_0xdefd('0x103')](_0x944a82[_0xdefd('0x123')],_0xdefd('0x105'))[_0xdefd('0x85')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1b75f6[_0xdefd('0x107')],'ListId':_0x1b75f6['ListId'],'VoiceQueueId':_0x1b75f6[_0xdefd('0xd9')]||undefined,'CampaignId':_0x1b75f6['CampaignId']||undefined})['catch'](loggerCatch(_0xdefd('0x1af')));break;case 0xb:if(_0x1b75f6[_0xdefd('0x10a')]>=_0x944a82[_0xdefd('0x12a')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x1b75f6[_0xdefd('0x10a')]+=0x1,'scheduledat':moment()[_0xdefd('0x103')](_0x944a82[_0xdefd('0x12b')],_0xdefd('0x105'))['format'](_0xdefd('0x106')),'ContactId':_0x1b75f6[_0xdefd('0x107')],'ListId':_0x1b75f6[_0xdefd('0xd8')],'VoiceQueueId':_0x1b75f6['VoiceQueueId']||undefined,'CampaignId':_0x1b75f6[_0xdefd('0xda')]||undefined})[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x12c')));break;case 0x13:if(_0x1b75f6[_0xdefd('0xf5')]>=_0x944a82[_0xdefd('0x100')]-0x1){return!![];}this[_0xdefd('0xc4')]({'active':![],'countmachineretry':_0x1b75f6[_0xdefd('0xf5')]+=0x1,'scheduledat':moment()[_0xdefd('0x103')](_0x944a82[_0xdefd('0x104')],_0xdefd('0x105'))['format'](_0xdefd('0x106')),'ContactId':_0x1b75f6[_0xdefd('0x107')],'ListId':_0x1b75f6['ListId'],'VoiceQueueId':_0x1b75f6['VoiceQueueId']||undefined,'CampaignId':_0x1b75f6[_0xdefd('0xda')]||undefined})['catch'](loggerCatch(_0xdefd('0x10b')));break;case 0x14:if(_0x1b75f6[_0xdefd('0xfc')]>=_0x944a82['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xdefd('0xc4')]({'active':![],'countagentrejectretry':_0x1b75f6[_0xdefd('0xfc')]+=0x1,'scheduledat':moment()[_0xdefd('0x103')](_0x944a82[_0xdefd('0x1b0')],_0xdefd('0x105'))['format'](_0xdefd('0x106')),'ContactId':_0x1b75f6['ContactId'],'ListId':_0x1b75f6['ListId'],'VoiceQueueId':_0x1b75f6[_0xdefd('0xd9')]||undefined,'CampaignId':_0x1b75f6[_0xdefd('0xda')]||undefined})[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x1b1')));break;default:return!![];}};Dialer[_0xdefd('0x1c')]['callProgressDetecting']=function(_0xc2cee2,_0x287b96,_0x455154){var _0x4eb3ab=this;var _0x1c2bfd=new History(_0xc2cee2);return new BPromise(function(_0x3633d8,_0x303ead){if(_[_0xdefd('0x41')](_0x287b96)&&typeof _0x287b96!==_0xdefd('0x175')){return _0x303ead(msgResponse(_0xdefd('0x1b2'),_0xdefd('0x152'),_0xdefd('0x1b3')));}if(_[_0xdefd('0x41')](_0x455154)&&typeof _0x455154!==_0xdefd('0x175')){return _0x303ead(msgResponse(_0xdefd('0x1b2'),_0xdefd('0x152'),_0xdefd('0x1b4')));}switch(_0x455154['reason']){case'0':_0x287b96[_0xdefd('0x6e')]+=0x1;_0x1c2bfd['state']=0x0;_0x1c2bfd[_0xdefd('0xaf')]=_0xdefd('0x1b5');_0x1c2bfd[_0xdefd('0xfb')]+=0x1;_0x1c2bfd[_0xdefd('0xf6')]+=0x1;ami[_0xdefd('0x51')](_0xdefd('0x1b6'),ut[_0xdefd('0xed')](_0xc2cee2,'nosuchnumber'));_0x4eb3ab['createHistory'](_0x1c2bfd)[_0xdefd('0xb5')](loggerCatch(_0xdefd('0xf7')));if(_0x4eb3ab['checkRetriveMax'](0x0,_0xc2cee2,_0x287b96)){if(_0x1c2bfd[_0xdefd('0xfb')]>=_0x287b96[_0xdefd('0x1ad')]){_0x4eb3ab[_0xdefd('0x101')](_0x1c2bfd,_0x3633d8,_0x303ead,_0xdefd('0x1b7'));}else{_0x4eb3ab[_0xdefd('0xfe')](_0x1c2bfd,_0x3633d8,_0x303ead,_0xdefd('0x1b7'));}}break;case'3':_0x287b96['outboundNoAnswerCallsDay']+=0x1;_0x1c2bfd['state']=0x3;_0x1c2bfd[_0xdefd('0xaf')]=_0xdefd('0x1b8');_0x1c2bfd['countnoanswerretry']+=0x1;_0x1c2bfd[_0xdefd('0xf6')]+=0x1;ami[_0xdefd('0x51')]('custom:agentnoanswer',ut[_0xdefd('0xed')](_0xc2cee2,_0xdefd('0x1b9')));_0x4eb3ab[_0xdefd('0xcf')](_0x1c2bfd)['catch'](loggerCatch(_0xdefd('0x1ba')));if(_0x4eb3ab[_0xdefd('0x1a7')](0x3,_0xc2cee2,_0x287b96)){if(_0x1c2bfd[_0xdefd('0xfa')]>=_0x287b96[_0xdefd('0x1a8')]){_0x4eb3ab[_0xdefd('0x101')](_0x1c2bfd,_0x3633d8,_0x303ead,_0xdefd('0x1bb'));}else{_0x4eb3ab[_0xdefd('0xfe')](_0x1c2bfd,_0x3633d8,_0x303ead,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x287b96[_0xdefd('0x1bc')]+=0x1;_0x1c2bfd[_0xdefd('0xae')]=0x5;_0x1c2bfd[_0xdefd('0xaf')]='Busy';_0x1c2bfd[_0xdefd('0xf8')]+=0x1;_0x1c2bfd['countglobal']+=0x1;ami[_0xdefd('0x51')](_0xdefd('0x1bd'),ut['buildObj'](_0xc2cee2,'busy'));_0x4eb3ab[_0xdefd('0xcf')](_0x1c2bfd)[_0xdefd('0xb5')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x4eb3ab['checkRetriveMax'](0x5,_0xc2cee2,_0x287b96)){if(_0x1c2bfd[_0xdefd('0xf8')]>=_0x287b96[_0xdefd('0x1be')]){_0x4eb3ab['createStateFinal'](_0x1c2bfd,_0x3633d8,_0x303ead,'reason\x205\x20busy');}else{_0x4eb3ab[_0xdefd('0xfe')](_0x1c2bfd,_0x3633d8,_0x303ead,_0xdefd('0x1bf'));}}break;case'8':_0x287b96[_0xdefd('0x69')]+=0x1;_0x1c2bfd[_0xdefd('0xae')]=0x8;_0x1c2bfd[_0xdefd('0xaf')]=_0xdefd('0x1c0');_0x1c2bfd[_0xdefd('0xf9')]+=0x1;_0x1c2bfd[_0xdefd('0xf6')]+=0x1;ami[_0xdefd('0x51')](_0xdefd('0x1c1'),ut[_0xdefd('0xed')](_0xc2cee2,_0xdefd('0x1c2')));_0x4eb3ab[_0xdefd('0xcf')](_0x1c2bfd)[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x1c3')));if(_0x4eb3ab['checkRetriveMax'](0x8,_0xc2cee2,_0x287b96)){if(_0x1c2bfd['countcongestionretry']>=_0x287b96[_0xdefd('0x1aa')]){_0x4eb3ab[_0xdefd('0x101')](_0x1c2bfd,_0x3633d8,_0x303ead,_0xdefd('0x1c4'));}else{_0x4eb3ab[_0xdefd('0xfe')](_0x1c2bfd,_0x3633d8,_0x303ead,_0xdefd('0x1c4'));}}break;case'11':_0x287b96[_0xdefd('0x1c5')]+=0x1;_0x1c2bfd['state']=0xb;_0x1c2bfd[_0xdefd('0xaf')]='Abandoned';_0x1c2bfd[_0xdefd('0x10a')]+=0x1;_0x1c2bfd['countglobal']+=0x1;_0x4eb3ab[_0xdefd('0xcf')](_0x1c2bfd)[_0xdefd('0xb5')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x4eb3ab[_0xdefd('0x1a7')](0xb,_0xc2cee2,_0x287b96)){if(_0x1c2bfd[_0xdefd('0x10a')]>=_0x287b96[_0xdefd('0x12a')]){_0x4eb3ab[_0xdefd('0x101')](_0x1c2bfd,_0x3633d8,_0x303ead,_0xdefd('0x1c6'));}else{_0x4eb3ab['stateGlobal'](_0x1c2bfd,_0x3633d8,_0x303ead,'reason\x2011\x20abandoned');}}break;case'20':_0x287b96['outboundRejectCallsDay']+=0x1;_0x1c2bfd['state']=0x14;_0x1c2bfd[_0xdefd('0xaf')]=_0xdefd('0x1c7');_0x1c2bfd[_0xdefd('0xfc')]+=0x1;_0x1c2bfd['countglobal']+=0x1;ami[_0xdefd('0x51')](_0xdefd('0x1c8'),ut[_0xdefd('0xed')](_0xc2cee2,_0xdefd('0x1c9')));_0x4eb3ab[_0xdefd('0xcf')](_0x1c2bfd)[_0xdefd('0xb5')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x4eb3ab[_0xdefd('0x1a7')](0x14,_0xc2cee2,_0x287b96)){if(_0x1c2bfd[_0xdefd('0xfc')]>=_0x287b96['dialAgentRejectMaxRetry']){_0x4eb3ab[_0xdefd('0x101')](_0x1c2bfd,_0x3633d8,_0x303ead,_0xdefd('0x1ca'));}else{_0x4eb3ab[_0xdefd('0xfe')](_0x1c2bfd,_0x3633d8,_0x303ead,_0xdefd('0x1ca'));}}break;default:_0x287b96['outboundUnknownCallsDay']+=0x1;_0x1c2bfd[_0xdefd('0xae')]=0xc;_0x1c2bfd[_0xdefd('0xaf')]=_0x455154[_0xdefd('0x114')];_0x4eb3ab[_0xdefd('0xcf')](_0x1c2bfd)[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x1cb')));if(_0x4eb3ab[_0xdefd('0x1a7')](_0x455154[_0xdefd('0x114')],_0xc2cee2,_0x287b96)){if(_0x1c2bfd[_0xdefd('0xf8')]+_0x1c2bfd[_0xdefd('0xf9')]+_0x1c2bfd[_0xdefd('0xfa')]+_0x1c2bfd[_0xdefd('0xfb')]+_0x1c2bfd[_0xdefd('0x120')]+_0x1c2bfd['countabandonedretry']+_0x1c2bfd[_0xdefd('0xf5')]+_0x1c2bfd['countagentrejectretry']>=_0x287b96[_0xdefd('0xfd')]){_0x4eb3ab[_0xdefd('0xfe')](_0x1c2bfd,_0x3633d8,_0x303ead,_0x455154[_0xdefd('0x114')]);}else{_0x4eb3ab[_0xdefd('0x101')](_0x1c2bfd,_0x3633d8,_0x303ead,_0x455154[_0xdefd('0x114')]);}}}});};Dialer['prototype'][_0xdefd('0xfe')]=function(_0x99b575,_0x5f411f,_0x496b06,_0x37e439){var _0xcbca47=new Final(_0x99b575);_0xcbca47['state']=0xf;_0xcbca47[_0xdefd('0xaf')]=_0xdefd('0x1cc');this[_0xdefd('0x101')](_0xcbca47,_0x5f411f,_0x496b06,_0x37e439);};Dialer[_0xdefd('0x1c')][_0xdefd('0x101')]=function(_0x794783,_0x5994fa,_0x11006e,_0x1cb069){this[_0xdefd('0xcd')](_0x794783)[_0xdefd('0x3f')](function(){return _0x5994fa(msgResponse('[callProgressDetecting]',_0xdefd('0xdd'),_0x1cb069));})[_0xdefd('0xb5')](function(){return _0x11006e(msgResponse(_0xdefd('0x1cd'),_0xdefd('0x152'),_0xdefd('0x1ce')));});};Dialer[_0xdefd('0x1c')]['predictive']=function(_0xbf23c4){var _0x3b867e=_0xbf23c4[_0xdefd('0x1cf')]/0x64;var _0x3a98fe=_0xbf23c4['outboundDropCallsDayTimeout']/(_0xbf23c4[_0xdefd('0x6c')]+_0xbf23c4[_0xdefd('0x67')]);var _0x37f838=Math[_0xdefd('0x1d0')](_0xbf23c4['predictiveIntervalAvailable']*(_0xbf23c4['predictiveIntervalMaxThreshold']/0x64));var _0x5e8d1f=Math[_0xdefd('0x1d0')](_0xbf23c4[_0xdefd('0x7b')]*(_0xbf23c4[_0xdefd('0x1d1')]/0x64));var _0x3925c8=_0xbf23c4['available']+_0xbf23c4[_0xdefd('0x5b')];var _0xdfce8c=Math[_0xdefd('0x1d2')](_0xbf23c4['erlangCalls']*_0xbf23c4[_0xdefd('0x80')]*_0xbf23c4[_0xdefd('0x1d3')]*_0xbf23c4['predictiveIntervalMultiplicativeFactor']);if(_[_0xdefd('0x41')](_0xbf23c4[_0xdefd('0x2a')])){if(!_[_0xdefd('0x41')](_0xbf23c4[_0xdefd('0x82')])){_0xbf23c4[_0xdefd('0x82')]=undefined;loggerPredictive[_0xdefd('0x9f')](_0xdefd('0x1d4'),_0xdefd('0x1d5'));}if(!_['isUndefined'](_0xbf23c4[_0xdefd('0x9a')])){loggerPredictive[_0xdefd('0x9f')]('[startMethodPredictive][StartProgressive]',_0xdefd('0x1d6'));clearInterval(_0xbf23c4['handlePredictive']);_0xbf23c4['handlePredictive']=undefined;}_0xbf23c4['startProgressive']=moment()[_0xdefd('0x85')](_0xdefd('0x106'));loggerPredictive[_0xdefd('0x8a')](_0xbf23c4[_0xdefd('0x44')],_0xdefd('0x1d7'),_0xbf23c4[_0xdefd('0x2a')]);this[_0xdefd('0x162')](_0xbf23c4,0x1);}else if(ifInterval(_0xbf23c4[_0xdefd('0x1d8')],_0xbf23c4[_0xdefd('0x2a')])){this['handlePower'](_0xbf23c4,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0xbf23c4['startProgressive'],_0xbf23c4[_0xdefd('0x44')]);_0xbf23c4[_0xdefd('0x7e')]=0x0;_0xbf23c4[_0xdefd('0x78')]=0x0;}else if(_0x3b867e<_0x3a98fe&&_0xbf23c4[_0xdefd('0x1d9')]===_0xdefd('0x1da')){freeVariablesPredictive(_0xbf23c4);loggerPredictive[_0xdefd('0x8a')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x3a98fe,'startProgressive',_0xbf23c4[_0xdefd('0x44')]);}else if(_0xdfce8c<_0xbf23c4[_0xdefd('0x78')]&&_0xbf23c4['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0xbf23c4);loggerPredictive[_0xdefd('0x8a')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xdefd('0x1db'),_0xdfce8c,_0xdefd('0x1dc'),_0xbf23c4[_0xdefd('0x78')],_0xdefd('0x2a'),_0xbf23c4[_0xdefd('0x44')]);}else if(!ifInterval(_0xbf23c4[_0xdefd('0x1d8')],_0xbf23c4[_0xdefd('0x2a')])&&_['isUndefined'](_0xbf23c4[_0xdefd('0x82')])&&!_[_0xdefd('0x41')](_0xbf23c4[_0xdefd('0x2a')])){_0xbf23c4[_0xdefd('0x82')]=moment()[_0xdefd('0x85')](_0xdefd('0x106'));loggerPredictive[_0xdefd('0x8a')](_0xbf23c4['name'],_0xdefd('0x1dd'),_0xbf23c4[_0xdefd('0x82')]);this[_0xdefd('0xc2')](_0xbf23c4[_0xdefd('0x1d8')])[_0xdefd('0x3f')](this[_0xdefd('0x1de')](_0xbf23c4))[_0xdefd('0x3f')](mergeDataErlangB(_0xbf23c4))[_0xdefd('0x3f')](this['startMethodPredictive'](_0xbf23c4))[_0xdefd('0xb5')](loggerCatchPredictive(_0xdefd('0x1df'),_0xbf23c4));}else if(!ifInterval(_0xbf23c4[_0xdefd('0x1d8')],_0xbf23c4['startPredictive'])){_0xbf23c4[_0xdefd('0x78')]=0x0;_0xbf23c4['startPredictive']=moment()[_0xdefd('0x85')](_0xdefd('0x106'));loggerPredictive[_0xdefd('0x8a')](_0xbf23c4['name'],_0xdefd('0x1e0'),_0xbf23c4[_0xdefd('0x82')]);clearInterval(_0xbf23c4['handlePredictive']);_0xbf23c4['handlePredictive']=undefined;this[_0xdefd('0xc2')](_0xbf23c4['dialPredictiveInterval'])[_0xdefd('0x3f')](this[_0xdefd('0x1de')](_0xbf23c4))['then'](mergeDataErlangB(_0xbf23c4))[_0xdefd('0x3f')](this[_0xdefd('0x1e1')](_0xbf23c4))[_0xdefd('0xb5')](loggerCatchPredictive(_0xdefd('0x1e2'),_0xbf23c4));}else if(_0xbf23c4['predictiveIntervalAvailable']&&_0x3925c8<_0xbf23c4[_0xdefd('0x7b')]-_0x5e8d1f){freeVariablesPredictive(_0xbf23c4);loggerPredictive['info'](_0xbf23c4[_0xdefd('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3925c8,_0xdefd('0x1e3'),_0xbf23c4[_0xdefd('0x7b')],'-',_0x5e8d1f,'=',_0xbf23c4[_0xdefd('0x7b')]-_0x5e8d1f,')');}else if(_0xbf23c4[_0xdefd('0x7b')]&&_0x3925c8>_0xbf23c4['predictiveIntervalAvailable']+_0x37f838){freeVariablesPredictive(_0xbf23c4);loggerPredictive[_0xdefd('0x8a')](_0xbf23c4[_0xdefd('0x44')],_0xdefd('0x1e4'),_0x3925c8,_0xdefd('0x1e5'),_0xbf23c4[_0xdefd('0x7b')],'+',_0x37f838,'=',_0xbf23c4[_0xdefd('0x7b')]+_0x37f838,')');}};Dialer[_0xdefd('0x1c')][_0xdefd('0x1de')]=function(_0x442815){var _0x34666e=this;return function(_0xbd10b2){return new BPromise(function(_0x347850,_0x22d09e){_['merge'](_0x442815,_0xbd10b2[0x0]);if(checkGetDataPredictive(_0xbd10b2[0x0])){var _0x58ebef=_0x442815['predictiveIntervalAvailable']=_0x442815[_0xdefd('0x5b')]+_0x442815[_0xdefd('0x55')];var _0x1bfe57=_0x442815[_0xdefd('0x1d8')]*0x3c;var _0x2f8cac=_0xbd10b2[0x0][_0xdefd('0x75')]+_0xbd10b2[0x0][_0xdefd('0x74')];var _0x5a4903=(_0xbd10b2[0x0][_0xdefd('0x73')]+_0xbd10b2[0x0][_0xdefd('0x77')]+_0xbd10b2[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xbd10b2[0x0][_0xdefd('0x7c')];_0x442815['predictiveIntervalHitRate']=_0x5a4903>0x0?_0x5a4903:0x1;switch(_0x442815[_0xdefd('0x1d9')]){case _0xdefd('0x1da'):var _0x538d29=_0x442815[_0xdefd('0x1cf')]/0x64;return _0x34666e[_0xdefd('0x1e6')](_0x58ebef,_0x1bfe57,_0x2f8cac,_0x5a4903,_0x538d29)[_0xdefd('0x3f')](function(_0x15a552){return _0x347850(_0x15a552);});case _0xdefd('0x1e7'):var _0x1fdff8=_0x442815['dialPredictiveOptimizationPercentage']/0x64;return _0x34666e[_0xdefd('0x1e8')](_0x58ebef,_0x1bfe57,_0x2f8cac,_0x5a4903,_0x1fdff8)['then'](function(_0x458dd9){return _0x347850(_0x458dd9);});default:return _0x22d09e(msgResponse(_0xdefd('0x1e9'),_0xdefd('0x152'),_0xdefd('0x1ea')));}}else{return _0x22d09e(msgResponse('[getDataPredictive]','Failure',_0xdefd('0x1eb')));}});};};Dialer[_0xdefd('0x1c')][_0xdefd('0x1ec')]=function(_0x40cafe){var _0x4a4c3a=this;return function(_0x1fab62){return new BPromise(function(_0x3215a7,_0x1fa79c){_[_0xdefd('0x98')](_0x40cafe,_0x1fab62[0x0]);if(checkGetDataPredictive(_0x1fab62[0x0])){loggerPredictive['info'](JSON[_0xdefd('0x84')](_0x1fab62[0x0]));if(_0x40cafe[_0xdefd('0x1d9')]==='dropRate'){return _0x4a4c3a['getVoiceQueueRtPauses'](_0x40cafe['id'])['then'](function(_0x25721e){var _0x5ac754=_0x40cafe[_0xdefd('0x56')]-_0x25721e[0x0][_0xdefd('0x1ed')];var _0x3c8192=_0x40cafe[_0xdefd('0x1d8')]*0x3c;var _0x1b87e2=_0x1fab62[0x0]['predictiveIntervalAvgTalktime']+_0x1fab62[0x0][_0xdefd('0x74')];var _0x75551=(_0x1fab62[0x0]['predictiveIntervalAnsweredCalls']+_0x1fab62[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1fab62[0x0][_0xdefd('0x76')])/_0x1fab62[0x0]['predictiveIntervalTotalCalls'];var _0x58b065=_0x40cafe[_0xdefd('0x1cf')]/0x64;_0x40cafe[_0xdefd('0x7a')]=_0x25721e[0x0][_0xdefd('0x1ed')]||0x0;_0x40cafe[_0xdefd('0x1d3')]=_0x75551>0x0?_0x75551:0x1;return _0x4a4c3a['abandonmentRate'](_0x5ac754,_0x3c8192,_0x1b87e2,_0x75551,_0x58b065);})[_0xdefd('0x3f')](function(_0x4c19ff){return _0x3215a7(_0x4c19ff);})[_0xdefd('0xb5')](function(_0x2bac27){return _0x1fa79c(msgResponse(_0xdefd('0x1ee'),_0xdefd('0x152'),JSON[_0xdefd('0x84')](_0x2bac27)));});}if(_0x40cafe[_0xdefd('0x1d9')]===_0xdefd('0x1e7')){return _0x4a4c3a[_0xdefd('0xcc')](_0x40cafe['id'])[_0xdefd('0x3f')](function(_0x27f9c3){var _0x19c585=_0x40cafe[_0xdefd('0x56')]-_0x27f9c3[0x0][_0xdefd('0x1ed')];var _0x5214a9=_0x40cafe[_0xdefd('0x1d8')]*0x3c;var _0x5e82b3=_0x1fab62[0x0][_0xdefd('0x75')]+_0x1fab62[0x0][_0xdefd('0x74')];var _0x5b99d1=(_0x1fab62[0x0][_0xdefd('0x73')]+_0x1fab62[0x0][_0xdefd('0x77')]+_0x1fab62[0x0][_0xdefd('0x76')])/_0x1fab62[0x0][_0xdefd('0x7c')];var _0x16f100=_0x40cafe[_0xdefd('0x1cf')]/0x64;_0x40cafe[_0xdefd('0x7a')]=_0x27f9c3[0x0][_0xdefd('0x1ed')]||0x0;_0x40cafe['predictiveIntervalHitRate']=_0x5b99d1>0x0?_0x5b99d1:0x1;return _0x4a4c3a['busyFactor'](_0x19c585,_0x5214a9,_0x5e82b3,_0x5b99d1,_0x16f100);})['then'](function(_0x17e2b4){return _0x3215a7(_0x17e2b4);})[_0xdefd('0xb5')](function(_0xd38b0){return _0x1fa79c(msgResponse('[CatchErlangB]',_0xdefd('0x152'),JSON[_0xdefd('0x84')](_0xd38b0)));});}}else{return _0x1fa79c(msgResponse(_0xdefd('0x1e9'),_0xdefd('0x152'),'check\x20failure'));}});};};Dialer[_0xdefd('0x1c')][_0xdefd('0x1e1')]=function(_0x2548ea){var _0x14f443=this;return function(){var _0x1c87d1=0x0;var _0x26f88a=Math[_0xdefd('0x1d2')](_0x2548ea['erlangCallToSecond']*0x3e8);if(_0x26f88a>0x0){_0x26f88a=_0x26f88a<0x64?0x64:_0x26f88a;loggerPredictive[_0xdefd('0x8a')](_0x2548ea[_0xdefd('0x44')],_0xdefd('0x1ef'),_0x26f88a,'milliseconds');_0x2548ea[_0xdefd('0x9a')]=setInterval(function(){_0x14f443[_0xdefd('0x9a')](_0x2548ea);loggerPredictiveCalls['info'](_0xdefd('0x1f0'),_0x1c87d1+=0x1);},_0x26f88a);}else{loggerPredictive['info'](_0x2548ea[_0xdefd('0x44')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xdefd('0x1c')]['checkContactBlack']=function(_0x5b9b57,_0x356785){var _0x5b6288=this;return function(_0x3f36f2){if(_['isEmpty'](_0x3f36f2)){if(_['isNil'](_0x356785[_0xdefd('0x1f1')])||!_0x356785[_0xdefd('0x1f2')]){if(_0x5b9b57['dialMethod']===_0xdefd('0x165')){_0x5b9b57[_0xdefd('0x138')]=_[_0xdefd('0x41')](_0x5b9b57[_0xdefd('0x138')])?!![]:_0x5b9b57[_0xdefd('0x138')];var _0x10edb8=uuid['v4']();_0x5b6288['actions'][_0x10edb8]=new Action(_0x5b9b57,_0x356785,_0x10edb8);loggerBooked[_0xdefd('0x8a')]('[booked][checkContactBlack]',_0x10edb8,_0xdefd('0x1f3'),JSON[_0xdefd('0x84')](_0x5b9b57[_0xdefd('0x138')]),_0xdefd('0x1f4'),_0x5b9b57[_0xdefd('0x44')]);if(_0x5b9b57[_0xdefd('0x138')]){_0x5b9b57[_0xdefd('0x138')]=![];_0x5b6288[_0xdefd('0x2c')][_0x5b6288[_0xdefd('0x26')][_0x10edb8]['queue']]=[];ami[_0xdefd('0xb3')]({'actionid':_0x10edb8,'action':'queuestatus','queue':_0x5b9b57[_0xdefd('0x44')]})[_0xdefd('0xb5')](function(){_0x5b6288[_0xdefd('0xb7')](_0x5b9b57);_0x5b6288[_0xdefd('0xc4')]({'active':![],'ContactId':_0x5b6288[_0xdefd('0x26')][_0x10edb8][_0xdefd('0x107')],'ListId':_0x5b6288[_0xdefd('0x26')][_0x10edb8][_0xdefd('0xd8')],'VoiceQueueId':_0x5b6288[_0xdefd('0x26')][_0x10edb8]['VoiceQueueId']||undefined,'CampaignId':_0x5b6288[_0xdefd('0x26')][_0x10edb8]['CampaignId']||undefined})[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x1f5')));delete _0x5b6288[_0xdefd('0x26')][_0x10edb8];});}else{loggerBooked[_0xdefd('0x8a')](_0xdefd('0x1f6'),JSON['stringify'](_0x5b9b57[_0xdefd('0x138')]),_0xdefd('0x1f4'),_0x5b9b57[_0xdefd('0x44')]);_0x5b6288[_0xdefd('0xb7')](_0x5b9b57);_0x5b6288[_0xdefd('0xc4')]({'active':![],'ContactId':_0x5b6288['actions'][_0x10edb8]['ContactId'],'ListId':_0x5b6288[_0xdefd('0x26')][_0x10edb8][_0xdefd('0xd8')],'VoiceQueueId':_0x5b6288[_0xdefd('0x26')][_0x10edb8][_0xdefd('0xd9')]||undefined,'CampaignId':_0x5b6288[_0xdefd('0x26')][_0x10edb8][_0xdefd('0xda')]||undefined})[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x1f5')));delete _0x5b6288[_0xdefd('0x26')][_0x10edb8];}}else{return _0x5b6288[_0xdefd('0x1f7')](_0x5b9b57,_0x356785);}}else{if(getDiff(_0x356785[_0xdefd('0x1f8')])<_0x5b9b57[_0xdefd('0x1f9')]*0x3c){if(_0x356785[_0xdefd('0x1fa')]&&!_0x356785[_0xdefd('0x1fa')][_0xdefd('0x1fb')]){_0x5b6288['preview'][_0xdefd('0x13b')](_0x356785['id'])[_0xdefd('0x13d')](function(){_0x5b6288[_0xdefd('0xb7')](_0x5b9b57);});}else{_0x5b6288['unlockContact']({'active':![]},_0x356785['id'],0x1)['finally'](function(){_0x5b6288['updateOriginated'](_0x5b9b57);});}}else{_0x5b9b57[_0xdefd('0x70')]+=0x1;_0x5b6288[_0xdefd('0xb7')](_0x5b9b57);if(_0x5b9b57[_0xdefd('0x1fc')]){_0x5b6288[_0xdefd('0xc4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x356785[_0xdefd('0x107')],'ListId':_0x356785[_0xdefd('0xd8')],'VoiceQueueId':_0x356785[_0xdefd('0xd9')]||undefined,'CampaignId':_0x356785[_0xdefd('0xda')]||undefined})[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x1fd')));_0x5b6288[_0xdefd('0xcf')](createObjHistory(_0x5b9b57,_0x356785,_0xdefd('0x1fe'),0x17,'RecallInQueue'))[_0xdefd('0xb5')](loggerCatch(_0xdefd('0x1ff')));}else{_0x5b6288[_0xdefd('0xd6')](createObjHistory(_0x5b9b57,_0x356785,_0xdefd('0x200'),0x16,_0xdefd('0x201')),_0xdefd('0x202'),_0xdefd('0x203'));}}}}else{_0x5b9b57[_0xdefd('0x68')]+=0x1;_0x5b6288[_0xdefd('0xd6')](createObjHistory(_0x5b9b57,_0x356785,_0xdefd('0x204'),0xd,_0xdefd('0x205')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0xdefd('0x206');}};};Dialer['prototype']['handleIvr']=function(_0x381af5){var _0x2e84cf=this;var _0x4cbb8b=_0x381af5[_0xdefd('0x207')]-_0x381af5[_0xdefd('0x7d')]-_0x381af5['temp'];emitCampaignSummary(_0x381af5);if(_0x4cbb8b>0x0){if(_0x4cbb8b>this['maxNumberOriginate']){_0x4cbb8b=this[_0xdefd('0x24')];}_0x381af5[_0xdefd('0xc8')]+=_0x4cbb8b;this[_0xdefd('0xca')](_0x381af5['id'],_0x4cbb8b,_0x381af5[_0xdefd('0x208')],_0x381af5)[_0xdefd('0x3f')](function(_0x248afe){_0x381af5[_0xdefd('0xc8')]-=_0x4cbb8b;_0x381af5['temp']=_0x381af5[_0xdefd('0xc8')]>0x0?_0x381af5[_0xdefd('0xc8')]:0x0;if(!checkContactEmpty(_0x248afe)){_0x381af5[_0xdefd('0x42')]=_0xdefd('0x209');logger[_0xdefd('0x8a')](_0xdefd('0x20a')+_0x381af5[_0xdefd('0x44')]);}else{_0x381af5[_0xdefd('0x7d')]+=_0x248afe[_0xdefd('0xa2')];_0x381af5['message']='RUNNING';for(var _0x1033db=0x0;_0x1033db<_0x248afe[_0xdefd('0xa2')];_0x1033db+=0x1){_0x381af5[_0xdefd('0x20b')]+=0x1;if(_[_0xdefd('0xe4')](_0x248afe[_0x1033db])||_['isNil'](_0x248afe[_0x1033db][_0xdefd('0x178')])||_[_0xdefd('0xe4')](_0x248afe[_0x1033db][_0xdefd('0x178')][_0xdefd('0x179')])){_0x2e84cf[_0xdefd('0xd4')](_0xdefd('0x20c'),_0x381af5,_0x248afe[_0x1033db]);}else{_0x2e84cf['checkIsBlackListIvr'](_[_0xdefd('0xd7')](_0x248afe[_0x1033db],[_0xdefd('0xda'),_0xdefd('0x20d')]))[_0xdefd('0x3f')](_0x2e84cf[_0xdefd('0x20e')](_0x381af5,_0x248afe[_0x1033db]))[_0xdefd('0xb5')](_0x2e84cf[_0xdefd('0xd3')]('[actionOriginateIvr]\x20',_0x381af5));}}}})[_0xdefd('0xb5')](loggerGetContactDialer('[getContactCampaign2]',_0x381af5,_0x4cbb8b));}};Dialer[_0xdefd('0x1c')][_0xdefd('0x162')]=function(_0x3ab26c,_0x5006b3){var _0x4ebe4b=this;var _0x583cb2=[];var _0x374592=_0x5006b3>=0x1?_0x5006b3:0x1;if(_0x3ab26c[_0xdefd('0x16a')]===_0xdefd('0x165')){_0x374592=0x1;}var _0x2b77d6=Math['floor'](_0x3ab26c[_0xdefd('0x55')]*_0x374592)-_0x3ab26c['originated']-_0x3ab26c['temp'];emitVoiceQueueSummary(_0x3ab26c);if(_0x3ab26c['dialLimitQueue']>0x0){var _0x49251b=_0x3ab26c['dialLimitQueue']-_0x3ab26c[_0xdefd('0x7d')]-_0x3ab26c['talking']-_0x3ab26c[_0xdefd('0xc8')]-_0x3ab26c[_0xdefd('0x57')];if(_0x2b77d6>_0x49251b){_0x2b77d6=_0x49251b;}}if(_0x2b77d6>0x0){if(_0x3ab26c[_0xdefd('0x16a')]===_0xdefd('0x165')){_0x2b77d6=0x1;}if(_0x2b77d6>this[_0xdefd('0x24')]){_0x2b77d6=this['maxNumberOriginate'];}_0x3ab26c[_0xdefd('0xc8')]+=_0x2b77d6;for(var _0x4f4e5c in this[_0xdefd('0x22')]){if(typeof this[_0xdefd('0x22')][_0x4f4e5c]!==_0xdefd('0xa3')){if(this['agents'][_0x4f4e5c][_0xdefd('0xae')]===_0xdefd('0x20f')&&this[_0xdefd('0x22')][_0x4f4e5c][_0xdefd('0xb4')]===_0xdefd('0xe1')){_0x583cb2[_0xdefd('0x136')](this[_0xdefd('0x22')][_0x4f4e5c]['id']);}}}this[_0xdefd('0xc7')](_0x3ab26c['id'],_0x583cb2,_0x2b77d6,_0x3ab26c['dialOrderByScheduledAt'],_0x3ab26c)[_0xdefd('0x3f')](function(_0x48dc87){_0x3ab26c[_0xdefd('0xc8')]-=_0x2b77d6;_0x3ab26c[_0xdefd('0xc8')]=_0x3ab26c[_0xdefd('0xc8')]>0x0?_0x3ab26c[_0xdefd('0xc8')]:0x0;if(!checkContactEmpty(_0x48dc87)){_0x4ebe4b[_0xdefd('0xbc')](_0x3ab26c)[_0xdefd('0x3f')](sendMessageReschedule(_0x3ab26c))[_0xdefd('0xb5')](loggerCatch(_0xdefd('0xbe')));}else{_0x3ab26c[_0xdefd('0x7d')]+=_0x48dc87[_0xdefd('0xa2')];_0x3ab26c[_0xdefd('0x42')]=_0x3ab26c[_0xdefd('0x16a')]===_0xdefd('0x165')?_0xdefd('0x181'):_0xdefd('0x210');for(var _0x1600fc=0x0;_0x1600fc<_0x48dc87['length'];_0x1600fc+=0x1){if(_[_0xdefd('0xe4')](_0x48dc87[_0x1600fc])||_['isNil'](_0x48dc87[_0x1600fc]['Contact'])||_['isNil'](_0x48dc87[_0x1600fc][_0xdefd('0x178')][_0xdefd('0x179')])){_0x4ebe4b[_0xdefd('0xd4')]('[actionOriginate]\x20',_0x3ab26c,_0x48dc87[_0x1600fc]);}else{_0x4ebe4b['checkIsBlackList'](_[_0xdefd('0xd7')](_0x48dc87[_0x1600fc],['VoiceQueueId',_0xdefd('0x20d')]))['then'](_0x4ebe4b[_0xdefd('0x20e')](_0x3ab26c,_0x48dc87[_0x1600fc]))[_0xdefd('0xb5')](_0x4ebe4b[_0xdefd('0xd3')](_0xdefd('0x20c'),_0x3ab26c));}}}})[_0xdefd('0xb5')](loggerGetContactDialer('[getContactDialer2]',_0x3ab26c,_0x2b77d6));}};Dialer[_0xdefd('0x1c')][_0xdefd('0x9a')]=function(_0xccc63c){if(_0xccc63c[_0xdefd('0x211')]>0x0){var _0x18760f=_0xccc63c['dialLimitQueue']-_0xccc63c[_0xdefd('0x7d')]-_0xccc63c[_0xdefd('0x5b')];if(_0x18760f>0x0){this[_0xdefd('0x212')](_0xccc63c);}else{loggerPredictiveCalls[_0xdefd('0x8a')](_0xdefd('0x213'));}}else{this[_0xdefd('0x212')](_0xccc63c);}};Dialer[_0xdefd('0x1c')][_0xdefd('0x212')]=function(_0x55467c){var _0x116f69=this;var _0x44814b=[];_0x55467c[_0xdefd('0x7d')]+=0x1;for(var _0x11c5db in this['agents']){if(typeof this['agents'][_0x11c5db]!==_0xdefd('0xa3')){if(this[_0xdefd('0x22')][_0x11c5db]['state']===_0xdefd('0x20f')&&this[_0xdefd('0x22')][_0x11c5db][_0xdefd('0xb4')]==='reachable'){_0x44814b['push'](this[_0xdefd('0x22')][_0x11c5db]['id']);}}}this[_0xdefd('0xc7')](_0x55467c['id'],_0x44814b,0x1,_0x55467c[_0xdefd('0x208')],_0x55467c)['then'](function(_0x42e2ee){if(!checkContactEmpty(_0x42e2ee)){checkContactLowerLimitOriginate(_0x55467c,0x1,0x0);_0x116f69[_0xdefd('0xbc')](_0x55467c)[_0xdefd('0x3f')](sendMessageReschedule(_0x55467c))[_0xdefd('0xb5')](loggerCatch(_0xdefd('0xbe')));}else{_0x55467c[_0xdefd('0x42')]=_0xdefd('0x210');if(_[_0xdefd('0xe4')](_0x42e2ee[0x0])||_['isNil'](_0x42e2ee[0x0][_0xdefd('0x178')])||_[_0xdefd('0xe4')](_0x42e2ee[0x0][_0xdefd('0x178')][_0xdefd('0x179')])){_0x116f69[_0xdefd('0xd4')]('[actionOriginate]\x20',_0x55467c,_0x42e2ee[0x0]);}else{_0x116f69['checkIsBlackList'](_[_0xdefd('0xd7')](_0x42e2ee[0x0],[_0xdefd('0xd9'),_0xdefd('0x20d')]))[_0xdefd('0x3f')](_0x116f69[_0xdefd('0x20e')](_0x55467c,_0x42e2ee[0x0]))[_0xdefd('0xb5')](_0x116f69[_0xdefd('0xd3')](_0xdefd('0x214'),_0x55467c));}}})[_0xdefd('0xb5')](loggerGetContactDialer('[getContactDialerPredictive]',_0x55467c,0x1));emitVoiceQueueSummary(_0x55467c);};Dialer[_0xdefd('0x1c')][_0xdefd('0x1e6')]=function(_0x1e979c,_0x4bafc8,_0x2a0610,_0xff49e7,_0x59fc6a,_0x10dddd){loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x215'));loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x216'),_0x1e979c);loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x217'),_0x4bafc8);loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x218'),_0x2a0610);loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x219'),_0xff49e7);loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x21a'),_0x59fc6a);loggerPredictive[_0xdefd('0x8a')]('---------------------------');return new BPromise(function(_0x228713,_0xfdddf1){if(_0x1e979c<=0x0||isNaN(_0x1e979c)){return _0xfdddf1(msgResponse(_0xdefd('0x21b'),_0xdefd('0x4d'),_0xdefd('0x21c')+_0x1e979c));}if(_0x2a0610<=0x0||isNaN(_0x2a0610)){return _0xfdddf1(msgResponse(_0xdefd('0x21b'),_0xdefd('0x4d'),_0xdefd('0x21d')+_0x2a0610));}if(_0xff49e7<=0x0||isNaN(_0xff49e7)){return _0xfdddf1(msgResponse(_0xdefd('0x21b'),_0xdefd('0x4d'),_0xdefd('0x21e')+_0xff49e7));}if(_0x4bafc8<=0x0||isNaN(_0x4bafc8)){return _0xfdddf1(msgResponse(_0xdefd('0x21b'),_0xdefd('0x4d'),'interval\x20=\x20'+_0x4bafc8));}if(_0x59fc6a<=0x0||isNaN(_0x59fc6a)){return _0xfdddf1(msgResponse(_0xdefd('0x21b'),_0xdefd('0x4d'),_0xdefd('0x21f')+_0x59fc6a));}_0x10dddd=_0x10dddd||0x0;var _0x1369b3=0x1/_0x2a0610;var _0x3411df=0x0;var _0x59d836=0x0;var _0x2d5949=0x0;var _0x1b533a=0x0;for(var _0x547db8=0x0;_0x2d5949<_0x59fc6a;_0x547db8+=0x1){_0x59d836=_0x547db8/_0x4bafc8;_0x3411df=(_0xff49e7*_0x59d836+_0x10dddd)/_0x1369b3;_0x2d5949=erlangb(_0x3411df,_0x1e979c);_0x1b533a=_0x3411df/_0x1e979c*(0x1-erlangb(_0x3411df,_0x1e979c));}return _0x228713({'erlangCalls':_0x547db8,'erlangCallToSecond':_0x4bafc8/_0x547db8,'erlangAbandonmentRate':_0x2d5949,'erlangBusyFactor':_0x1b533a});});};Dialer[_0xdefd('0x1c')][_0xdefd('0x1e8')]=function(_0x2fe85d,_0xe19f4c,_0x195bcc,_0x8b871a,_0x5ef64c,_0x24af62){loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x220'));loggerPredictive[_0xdefd('0x8a')]('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',_0x2fe85d);loggerPredictive['info'](_0xdefd('0x217'),_0xe19f4c);loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x218'),_0x195bcc);loggerPredictive['info'](_0xdefd('0x219'),_0x8b871a);loggerPredictive[_0xdefd('0x8a')](_0xdefd('0x221'),_0x5ef64c);loggerPredictive[_0xdefd('0x8a')]('---------------------------');return new BPromise(function(_0x532075,_0x431c64){if(_0x2fe85d<=0x0||isNaN(_0x2fe85d)){return _0x431c64(msgResponse('[busyFactor]',_0xdefd('0x4d'),_0xdefd('0x21c')+_0x2fe85d));}if(_0x195bcc<=0x0||isNaN(_0x195bcc)){return _0x431c64(msgResponse(_0xdefd('0x222'),_0xdefd('0x4d'),_0xdefd('0x21d')+_0x195bcc));}if(_0x8b871a<=0x0||isNaN(_0x8b871a)){return _0x431c64(msgResponse(_0xdefd('0x222'),'Error',_0xdefd('0x21e')+_0x8b871a));}if(_0xe19f4c<=0x0||isNaN(_0xe19f4c)){return _0x431c64(msgResponse(_0xdefd('0x222'),_0xdefd('0x4d'),'interval\x20=\x20'+_0xe19f4c));}if(_0x5ef64c<=0x0||isNaN(_0x5ef64c)){return _0x431c64(msgResponse(_0xdefd('0x222'),_0xdefd('0x4d'),_0xdefd('0x223')+_0x5ef64c));}_0x24af62=_0x24af62||0x0;var _0x56d7c7=0x1/_0x195bcc;var _0x1d6e2a=0x0;var _0x524348=0x0;var _0x51b36d=0x0;var _0x32ef80=0x0;for(var _0x21a2f3=0x0;_0x32ef80<_0x5ef64c;_0x21a2f3+=0x1){_0x524348=_0x21a2f3/_0xe19f4c;_0x1d6e2a=(_0x8b871a*_0x524348+_0x24af62)/_0x56d7c7;_0x51b36d=erlangb(_0x1d6e2a,_0x2fe85d);_0x32ef80=_0x1d6e2a/_0x2fe85d*(0x1-erlangb(_0x1d6e2a,_0x2fe85d));}return _0x532075({'erlangCalls':_0x21a2f3,'erlangCallToSecond':_0xe19f4c/_0x21a2f3,'erlangAbandonmentRate':_0x51b36d,'erlangBusyFactor':_0x32ef80});});};module['exports']=Dialer; \ No newline at end of file +var _0xbdb7=['createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','[callProgressDetecting]\x20','checkRetriveMax','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','reason\x205\x20busy','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','emptyContact','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','reachable','getContactDialer','[getContactDialer2]','tryOriginatePredictive','Contact.phone','[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','m\x20=\x20','[abandonmentRate]','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','Ts\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','lodash','moment','md5','ioredis','../../../config/environment/','../../../config/logger','booked','predictiveCalls','syncQueueSummary','../ami','redis','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\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\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---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','error','stack','inspect','length','originated','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','[getContactDialer2][ReScheduled]','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','sequence','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','saveInDb','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','outboundAnswerCallsDay','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','membername','countglobal','[syncAgentComplete][createHistory][0]','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','[rescheduleContact][Machine]','HANGUP','HangupInAMD','custom:amd','[syncHangupInAMDIvr][createHistory]','Machine','countbusyretry','stateGlobal','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','Unknow','reason','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','Drop','dropreason','agiafterat','dialDropRetryFrequency','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','roundrobin','actionid','stateinterface','locked','rrmemory','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','run','[unlock][syncQueueStatusComplete]','isEmpty','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','push','content','indexOf','true','command','iftime\x20%s,%s','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','predictive','Queue','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','[syncCampaigns]','\x5cw{0,','pow','replace','match','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDMaximumWordLength','XMD-VOICEQUEUEID'];(function(_0x569b70,_0x171a44){var _0x2eb888=function(_0x1d8071){while(--_0x1d8071){_0x569b70['push'](_0x569b70['shift']());}};_0x2eb888(++_0x171a44);}(_0xbdb7,0x95));var _0x7bdb=function(_0xf04c6d,_0xe98786){_0xf04c6d=_0xf04c6d-0x0;var _0x4a804e=_0xbdb7[_0xf04c6d];return _0x4a804e;};'use strict';var util=require('util');var _=require(_0x7bdb('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x7bdb('0x1'));var rr=require('rr');var md5=require(_0x7bdb('0x2'));var Redis=require(_0x7bdb('0x3'));var ut=require('../preview/util/util');var config=require(_0x7bdb('0x4'));var logger=require(_0x7bdb('0x5'))('dialer');var loggerBooked=require(_0x7bdb('0x5'))(_0x7bdb('0x6'));var loggerPredictive=require(_0x7bdb('0x5'))('predictive');var loggerPredictiveCalls=require(_0x7bdb('0x5'))(_0x7bdb('0x7'));var loggerSyncQueueSummary=require(_0x7bdb('0x5'))(_0x7bdb('0x8'));var ami=require(_0x7bdb('0x9'));config[_0x7bdb('0xa')]=_['defaults'](config['redis'],{'host':_0x7bdb('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7bdb('0xa')]));var cmHopper=require(_0x7bdb('0xc'));var cmHopperHistory=require(_0x7bdb('0xd'));var cmHopperBlack=require(_0x7bdb('0xe'));var voiceQueueRt=require(_0x7bdb('0xf'));var RpcSetting=require(_0x7bdb('0x10'));var Action=require(_0x7bdb('0x11'));var History=require(_0x7bdb('0x12'));var Final=require(_0x7bdb('0x13'));var AgentComplete=require(_0x7bdb('0x14'));var QueueCallerAbandon=require(_0x7bdb('0x15'));var Hangup=require(_0x7bdb('0x16'));var ipAgi=process['env'][_0x7bdb('0x17')]||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x7bdb('0x18')][_0x7bdb('0x19')]=function(_0x589eee){this['tail']=this[_0x7bdb('0x1a')]?this['tail'][_0x7bdb('0x1b')](_0x589eee):_0x589eee();};function Dialer(_0x38b10e,_0x18e1cc){this['sequence']=new Sequence();this[_0x7bdb('0x1c')]=_0x18e1cc;this[_0x7bdb('0x1d')]=_0x38b10e[_0x7bdb('0x1d')];this[_0x7bdb('0x1e')]=_0x38b10e['campaigns'];this[_0x7bdb('0x1f')]=_0x38b10e['agents'];this[_0x7bdb('0x20')]=_0x38b10e[_0x7bdb('0x20')];this['maxNumberOriginate']=config[_0x7bdb('0x21')]||0x2;this[_0x7bdb('0x22')]={};this[_0x7bdb('0x23')]={};this[_0x7bdb('0x24')]={};this[_0x7bdb('0x25')]={};this[_0x7bdb('0x26')]={};this[_0x7bdb('0x27')]={};this[_0x7bdb('0x28')]={};this[_0x7bdb('0x29')]={};this[_0x7bdb('0x2a')]={};this['queueBookedRR']={};ami['on'](_0x7bdb('0x2b'),this[_0x7bdb('0x2c')][_0x7bdb('0x2d')](this));ami['on'](_0x7bdb('0x2e'),this[_0x7bdb('0x2f')]['bind'](this));ami['on'](_0x7bdb('0x30'),this[_0x7bdb('0x31')]['bind'](this));ami['on'](_0x7bdb('0x32'),this[_0x7bdb('0x33')]['bind'](this));ami['on'](_0x7bdb('0x34'),this[_0x7bdb('0x8')][_0x7bdb('0x2d')](this));ami['on']('hangup',this[_0x7bdb('0x35')]['bind'](this));ami['on'](_0x7bdb('0x36'),this[_0x7bdb('0x37')]['bind'](this));ami['on'](_0x7bdb('0x38'),this['syncVarSet'][_0x7bdb('0x2d')](this));ami['on'](_0x7bdb('0x39'),this[_0x7bdb('0x3a')][_0x7bdb('0x2d')](this));ami['on']('queuestatuscomplete',this[_0x7bdb('0x3b')][_0x7bdb('0x2d')](this));this[_0x7bdb('0x3c')]();this[_0x7bdb('0x3d')]();RpcSetting['getSettings']()[_0x7bdb('0x3e')](function(_0x40c53c){previewRecallmeReminderInterval=_0x40c53c[_0x7bdb('0x3f')];});}function isNotNull(_0x33bc9e){return _0x33bc9e!==null&&!_[_0x7bdb('0x40')](_0x33bc9e);}function checkIsLoggedIn(_0x5daa76,_0x1fa0b4){return function(){if(_0x1fa0b4<=0x0){_0x5daa76['message']=_0x7bdb('0x41');throw _0x5daa76[_0x7bdb('0x42')]+_0x7bdb('0x43');}};}function isActive(_0x531ce0){return _0x531ce0;}function checkIsActive(_0x4126a7,_0x471673){return function(){if(!isActive(_0x471673)){_0x4126a7[_0x7bdb('0x44')]=_0x7bdb('0x45');throw _0x4126a7[_0x7bdb('0x42')]+_0x7bdb('0x46');}};}function checkInterval(_0x13b255){return function(){if(!isNotNull(_0x13b255[_0x7bdb('0x47')])){_0x13b255[_0x7bdb('0x44')]=_0x7bdb('0x48');throw _0x13b255[_0x7bdb('0x42')]+_0x7bdb('0x49');}if(!isNotNull(_0x13b255[_0x7bdb('0x47')][_0x7bdb('0x4a')])){_0x13b255[_0x7bdb('0x44')]='INTERVAL_IS_NULL';throw _0x13b255[_0x7bdb('0x42')]+_0x7bdb('0x49');}if(!isNotNull(_['isEmpty'](_0x13b255[_0x7bdb('0x47')][_0x7bdb('0x4a')]))){_0x13b255['message']=_0x7bdb('0x48');throw _0x13b255[_0x7bdb('0x42')]+_0x7bdb('0x49');}};}function msgResponse(_0x514fc0,_0x50dbe2,_0x17ed9c){return{'action':_0x514fc0,'response':_0x50dbe2,'message':_0x17ed9c,'stack':_0x17ed9c};}function myreject(_0x424f5c){return function(_0x367c80){return _0x424f5c(msgResponse(_0x7bdb('0x4b'),_0x7bdb('0x4c'),JSON['stringify'](_0x367c80)));};}function getSeconds(_0x5d3c42,_0x28ee7){var _0x526ec3=moment(_0x5d3c42)[_0x7bdb('0x4d')](0x0);var _0x24f8c2=moment(_0x28ee7)[_0x7bdb('0x4d')](0x0);return _0x526ec3[_0x7bdb('0x4e')](_0x24f8c2,_0x7bdb('0x4f'));}function emit(_0x5387ab,_0x10d0ef,_0x428aef){io['to'](_0x5387ab)[_0x7bdb('0x50')](_0x10d0ef,_0x428aef);}function emitVoiceQueueSummary(_0x493da8){if(_0x493da8['type']===_0x7bdb('0x51')){var _0x345c08={'id':_0x493da8['id'],'name':_0x493da8[_0x7bdb('0x42')],'strategy':_0x493da8[_0x7bdb('0x52')],'answered':_0x493da8[_0x7bdb('0x53')],'available':_0x493da8[_0x7bdb('0x54')],'loggedIn':_0x493da8[_0x7bdb('0x55')],'pTalking':_0x493da8[_0x7bdb('0x56')],'sumBillable':_0x493da8[_0x7bdb('0x57')],'sumDuration':_0x493da8['sumDuration'],'sumHoldTime':_0x493da8[_0x7bdb('0x58')]||0x0,'talking':_0x493da8[_0x7bdb('0x59')],'total':_0x493da8[_0x7bdb('0x5a')],'type':_0x493da8[_0x7bdb('0x5b')],'unmanaged':_0x493da8[_0x7bdb('0x5c')],'abandoned':_0x493da8[_0x7bdb('0x5d')],'waiting':_0x493da8['waiting'],'loggedInDb':_0x493da8[_0x7bdb('0x5e')],'dialActive':_0x493da8[_0x7bdb('0x5f')],'dialMethod':_0x493da8['dialMethod'],'dialOriginateCallerIdName':_0x493da8[_0x7bdb('0x60')],'dialOriginateCallerIdNumber':_0x493da8['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x493da8[_0x7bdb('0x61')],'dialPrefix':_0x493da8[_0x7bdb('0x62')],'outboundAnswerAgiCallsDay':_0x493da8[_0x7bdb('0x63')],'outboundAnswerCallsDay':_0x493da8['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x493da8[_0x7bdb('0x64')],'outboundBusyCallsDay':_0x493da8[_0x7bdb('0x65')],'outboundCongestionCallsDay':_0x493da8[_0x7bdb('0x66')],'outboundDropCallsDayACS':_0x493da8['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x493da8[_0x7bdb('0x67')],'outboundDropCallsDayTimeout':_0x493da8[_0x7bdb('0x68')],'outboundNoAnswerCallsDay':_0x493da8[_0x7bdb('0x69')],'outboundNoSuchCallsDay':_0x493da8[_0x7bdb('0x6a')],'outboundOriginateFailureCallsDay':_0x493da8[_0x7bdb('0x6b')],'outboundReCallsDay':_0x493da8[_0x7bdb('0x6c')],'outboundRejectCallsDay':_0x493da8[_0x7bdb('0x6d')],'outboundUnknownCallsDay':_0x493da8[_0x7bdb('0x6e')],'predictiveIntervalAnsweredCalls':_0x493da8[_0x7bdb('0x6f')],'predictiveIntervalAvgHoldtime':_0x493da8[_0x7bdb('0x70')],'predictiveIntervalAvgTalktime':_0x493da8[_0x7bdb('0x71')],'predictiveIntervalDroppedCallsCallersExit':_0x493da8['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x493da8[_0x7bdb('0x72')],'predictiveIntervalErlangCalls':_0x493da8[_0x7bdb('0x73')],'predictiveIntervalErlangCallsDroppedCalls':_0x493da8[_0x7bdb('0x74')],'predictiveIntervalHitRate':_0x493da8[_0x7bdb('0x75')],'predictiveIntervalMultiplicativeFactor':_0x493da8[_0x7bdb('0x76')],'predictiveIntervalPauses':_0x493da8['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x493da8[_0x7bdb('0x77')],'predictiveIntervalTotalCalls':_0x493da8[_0x7bdb('0x78')],'message':_0x493da8[_0x7bdb('0x44')],'originated':_0x493da8['originated'],'erlangCalls':_0x493da8['erlangCalls'],'erlangCallToSecond':_0x493da8[_0x7bdb('0x79')],'erlangAbandonmentRate':_0x493da8[_0x7bdb('0x7a')],'erlangBusyFactor':_0x493da8[_0x7bdb('0x7b')],'startPredictive':_0x493da8[_0x7bdb('0x27')],'startProgressive':_0x493da8[_0x7bdb('0x28')]};if(_0x493da8['Trunk']){_0x345c08[_0x7bdb('0x7c')]={'id':_0x493da8['Trunk']['id'],'name':_0x493da8[_0x7bdb('0x7c')][_0x7bdb('0x42')],'active':_0x493da8[_0x7bdb('0x7c')][_0x7bdb('0x7d')],'callerid':_0x493da8[_0x7bdb('0x7c')][_0x7bdb('0x7e')]};}if(_0x493da8[_0x7bdb('0x47')]){_0x345c08[_0x7bdb('0x47')]={'id':_0x493da8[_0x7bdb('0x47')]['id'],'name':_0x493da8[_0x7bdb('0x47')][_0x7bdb('0x42')]};}var _0x4d4cc3=md5(JSON['stringify'](_0x345c08));if(_0x493da8['md5']!==_0x4d4cc3){_0x493da8[_0x7bdb('0x2')]=_0x4d4cc3;emit(util[_0x7bdb('0x7f')](_0x7bdb('0x80'),_0x345c08['name']),_0x7bdb('0x81'),_0x345c08);}}}function emitCampaignSummary(_0x55d242){if(_0x55d242['type']===_0x7bdb('0x82')){emit(util[_0x7bdb('0x7f')](_0x7bdb('0x83'),_0x55d242['name']),_0x7bdb('0x84'),_0x55d242);}}function checkGetDataPredictive(_0x49bf8a){if(isNotNull(_0x49bf8a)&&!_['isEmpty'](_0x49bf8a)){loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x86'));loggerPredictive['info'](_0x7bdb('0x87'),_0x49bf8a['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0x7bdb('0x88'),_0x49bf8a[_0x7bdb('0x6f')]);loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x89'),_0x49bf8a[_0x7bdb('0x72')]);loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x8a'),_0x49bf8a[_0x7bdb('0x8b')]);loggerPredictive[_0x7bdb('0x85')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49bf8a[_0x7bdb('0x70')]);loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x8c'),_0x49bf8a[_0x7bdb('0x71')]);loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x8d'));if(_0x49bf8a[_0x7bdb('0x78')]>0x0){if(!_[_0x7bdb('0x40')](_0x49bf8a[_0x7bdb('0x71')])&&_0x49bf8a[_0x7bdb('0x71')]>0x0){return!![];}loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x8e'));if(!_[_0x7bdb('0x40')](_0x49bf8a[_0x7bdb('0x70')])&&_0x49bf8a[_0x7bdb('0x70')]>0x0){return!![];}loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x8f'));}else{loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x90'));}}else{loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x91'));}return![];}function mergeDataErlangB(_0xb9c219){return function(_0x25590b){loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x92'));loggerPredictive['info'](_0x7bdb('0x93'),_0x25590b[_0x7bdb('0x94')]);loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x95'),_0x25590b[_0x7bdb('0x79')]);loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x96'),_0x25590b[_0x7bdb('0x7a')]);loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x97'),_0x25590b['erlangBusyFactor']);loggerPredictive['info'](_0x7bdb('0x96'),_0x25590b[_0x7bdb('0x7a')]);loggerPredictive['info'](_0x7bdb('0x8d'));_[_0x7bdb('0x98')](_0xb9c219,_0x25590b);};}function getDiff(_0x4ae4b7){var _0x368de0=moment()['milliseconds'](0x0);var _0x3a274f=moment(_0x4ae4b7)['milliseconds'](0x0);return _0x368de0['diff'](_0x3a274f,_0x7bdb('0x4f'));}function ifInterval(_0x20a91c,_0x25cf68){if(_[_0x7bdb('0x40')](_0x25cf68)){return![];}return getDiff(_0x25cf68)<_0x20a91c*0x3c;}function freeVariablesPredictive(_0x166619){if(isNotNull(_0x166619)){if(!_[_0x7bdb('0x40')](_0x166619['startProgressive'])){_0x166619[_0x7bdb('0x28')]=undefined;loggerPredictive[_0x7bdb('0x85')](_0x166619['name'],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x7bdb('0x40')](_0x166619[_0x7bdb('0x27')])){_0x166619['startPredictive']=undefined;loggerPredictive['info'](_0x166619[_0x7bdb('0x42')],_0x7bdb('0x99'));}if(!_['isUndefined'](_0x166619['handlePredictive'])){clearInterval(_0x166619[_0x7bdb('0x9a')]);_0x166619['handlePredictive']=undefined;loggerPredictive[_0x7bdb('0x85')](_0x166619[_0x7bdb('0x42')],_0x7bdb('0x9b'));}}}function erlangb(_0x196bf5,_0x527eea){if(_0x527eea===0x0){return 0x0;}var _0x1fb40d=0x1;for(var _0xe17ac=0x1;_0xe17ac<=_0x527eea;_0xe17ac+=0x1){_0x1fb40d=0x1+_0x1fb40d*_0xe17ac/_0x196bf5;}return 0x1/_0x1fb40d;}function isVoiceQueueOutbound(_0x2c19ee){return _0x2c19ee==='outbound';}function isNotPreview(_0xbffb01){return _0xbffb01!==_0x7bdb('0x1c');}function isCampaignIvr(_0x41e2c1){return _0x41e2c1==='ivr';}function getCallerId(_0x28da66,_0x4da46d,_0x3c91f4){if(!_[_0x7bdb('0x40')](_0x3c91f4)&&typeof _0x3c91f4===_0x7bdb('0x9c')&&!_['isEmpty'](_0x3c91f4)){if(!_['isUndefined'](_0x4da46d)&&typeof _0x4da46d===_0x7bdb('0x9c')&&!_['isEmpty'](_0x4da46d)){return util[_0x7bdb('0x7f')]('\x22%s\x22\x20<%s>',_0x4da46d,_0x3c91f4);}return util[_0x7bdb('0x7f')](_0x7bdb('0x9d'),_0x3c91f4,_0x3c91f4);}if(!_[_0x7bdb('0x40')](_0x28da66)&&typeof _0x28da66===_0x7bdb('0x9c')&&!_['isEmpty'](_0x28da66)){return _0x28da66;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x1366fc,_0x1f800){return function(_0x57c188){freeVariablesPredictive(_0x1f800);emitVoiceQueueSummary(_0x1f800);emitCampaignSummary(_0x1f800);loggerSyncQueueSummary[_0x7bdb('0x9e')](_0x1366fc,util['inspect'](_0x57c188,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4247ee,_0x434b7c){return function(_0x17151f){loggerPredictive[_0x7bdb('0x9e')](_0x434b7c[_0x7bdb('0x42')],_0x4247ee);loggerPredictive[_0x7bdb('0x9e')](_0x17151f[_0x7bdb('0x9f')]);freeVariablesPredictive(_0x434b7c);};}function loggerCatch(_0x3d73bd){return function(_0x376e72){logger[_0x7bdb('0x9e')](_0x3d73bd,util[_0x7bdb('0xa0')](_0x376e72,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5e19ca){return _0x5e19ca&&!_[_0x7bdb('0x40')](_0x5e19ca)&&_0x5e19ca[_0x7bdb('0xa1')]>0x0;}function decremetOriginate(_0x5dc86c){if(!_[_0x7bdb('0x40')](_0x5dc86c)&&_0x5dc86c!==null){if(typeof _0x5dc86c[_0x7bdb('0xa2')]!==_0x7bdb('0xa3')){if(_0x5dc86c[_0x7bdb('0xa2')]>0x0){_0x5dc86c[_0x7bdb('0xa2')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x7bdb('0xa4'));}}function checkContactLowerLimitOriginate(_0x1c1a87,_0x2bac99,_0x49164e){if(_0x2bac99>_0x49164e){for(var _0x52e975=0x0;_0x52e975<_0x2bac99-_0x49164e;_0x52e975+=0x1){decremetOriginate(_0x1c1a87);}}}function loggerGetContactDialer(_0x2474ac,_0x26eec0,_0x50ddfc){return function(_0x1af931){checkContactLowerLimitOriginate(_0x26eec0,_0x50ddfc,0x0);logger[_0x7bdb('0x9e')](_0x2474ac,util[_0x7bdb('0xa0')](_0x1af931,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2a214d){return function(_0x5e4593){if(isNotNull(_0x5e4593)&&isNotNull(_0x5e4593[0x0])){if(_0x5e4593[0x0]['contactsRescheduled']>0x0){_0x2a214d[_0x7bdb('0x44')]='RESCHEDULED_CONTACTS';logger[_0x7bdb('0x85')](_0x7bdb('0xa5')+_0x2a214d['name'],_0x5e4593[0x0][_0x7bdb('0xa6')],'contacts');}else{_0x2a214d['message']=_0x7bdb('0xa7');logger[_0x7bdb('0x85')](_0x7bdb('0xa8')+_0x2a214d[_0x7bdb('0x42')]);}}};}function notSendMessagesQueue(_0x298c02){if(_0x298c02[_0x7bdb('0xa9')]){freeVariablesPredictive(_0x298c02);if(_0x298c02['originated']===0x0&&_0x298c02[_0x7bdb('0x59')]===0x0&&_0x298c02[_0x7bdb('0xaa')]===0x0&&(_0x298c02[_0x7bdb('0x56')]||0x0)===0x0){_0x298c02[_0x7bdb('0xa9')]=![];_0x298c02[_0x7bdb('0x54')]=0x0;_0x298c02['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0x7bdb('0x9e')](_0x7bdb('0xab'),_0x298c02[_0x7bdb('0x42')],_0x7bdb('0xac'));}else{_0x298c02[_0x7bdb('0x44')]=_0x7bdb('0xad');loggerSyncQueueSummary[_0x7bdb('0x9e')](_0x7bdb('0xab'),_0x298c02[_0x7bdb('0x42')],_0x7bdb('0xae'));}emitVoiceQueueSummary(_0x298c02);}}function notSendMessagesCampaign(_0x31691c){if(_0x31691c[_0x7bdb('0xa9')]){if(_0x31691c[_0x7bdb('0xa2')]===0x0){_0x31691c[_0x7bdb('0xa9')]=![];_0x31691c['message']=_0x7bdb('0x45');loggerSyncQueueSummary[_0x7bdb('0x9e')](_0x7bdb('0xaf'),_0x31691c[_0x7bdb('0x42')],_0x7bdb('0xac'));}else{_0x31691c[_0x7bdb('0x44')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x7bdb('0x9e')](_0x7bdb('0xaf'),_0x31691c[_0x7bdb('0x42')],_0x7bdb('0xae'));}emitCampaignSummary(_0x31691c);}}function createObjHistory(_0x46980b,_0x4cbaf5,_0x5c1810,_0x5ce9a5,_0x1e3755){_0x46980b[_0x7bdb('0x44')]=_0x5c1810;var _0x46b323=new Action(_0x46980b,_0x4cbaf5);var _0x5d2b88=new History(_0x46b323);_0x5d2b88[_0x7bdb('0xb0')]=_0x5ce9a5;_0x5d2b88[_0x7bdb('0xb1')]=_0x1e3755;_0x5d2b88[_0x7bdb('0xb2')]=_0x46b323[_0x7bdb('0xb3')];return _0x5d2b88;}Dialer['prototype'][_0x7bdb('0x3d')]=function(){var _0x5ecaec=this;setInterval(function(){_0x5ecaec[_0x7bdb('0xb4')](_0x5ecaec[_0x7bdb('0x25')],_0x7bdb('0xb5'));_0x5ecaec['clearZombieChannels'](_0x5ecaec['actions'],_0x7bdb('0xb6'));},0x32c8);};Dialer['prototype'][_0x7bdb('0xb4')]=function(_0x3a95e3,_0x2dfda4){var _0xcf2e8f=this;for(var _0x4633ec in _0x3a95e3){if(typeof _0x3a95e3[_0x4633ec]!==_0x7bdb('0xa3')){this[_0x7bdb('0xb7')][_0x7bdb('0x19')](function(){if(!_[_0x7bdb('0xb8')](_0x3a95e3[_0x4633ec])){return ami[_0x7bdb('0xb9')]({'action':_0x7bdb('0xba'),'channel':_0x3a95e3[_0x4633ec][_0x7bdb('0xbb')]})[_0x7bdb('0xbc')](function(_0x4f43ad){if(_0x4f43ad[_0x7bdb('0x44')]===_0x7bdb('0xbd')){setTimeout(function(){if(_0x3a95e3[_0x4633ec]&&_0x3a95e3[_0x4633ec][_0x7bdb('0x5b')]!==_0x7bdb('0x82')){_0xcf2e8f[_0x7bdb('0xbe')](_0xcf2e8f[_0x7bdb('0x1d')][_0x3a95e3[_0x4633ec][_0x7bdb('0xbf')]]);logger[_0x7bdb('0x9e')](_0x7bdb('0xc0'),_0x2dfda4,_0x4633ec,_0x3a95e3[_0x4633ec][_0x7bdb('0xbf')]);delete _0x3a95e3[_0x4633ec];}if(_0x3a95e3[_0x4633ec]&&_0x3a95e3[_0x4633ec]['type']===_0x7bdb('0x82')){_0xcf2e8f['updateOriginated'](_0xcf2e8f[_0x7bdb('0x1e')][_0x3a95e3[_0x4633ec]['queue']]);logger[_0x7bdb('0x9e')]('[Dialer][checkChannel][ivr]',_0x2dfda4,_0x4633ec,_0x3a95e3[_0x4633ec][_0x7bdb('0xbf')]);delete _0x3a95e3[_0x4633ec];}},0x2328);}});}});}}};Dialer[_0x7bdb('0x18')][_0x7bdb('0xc1')]=function(_0x3bb4c5){return BPromise[_0x7bdb('0xc2')]()[_0x7bdb('0x3e')](cmHopper['countReScheduled'](_0x3bb4c5))['catch'](loggerCatch(_0x7bdb('0xc3')));};Dialer[_0x7bdb('0x18')][_0x7bdb('0xc4')]=function(_0x24aee0){return BPromise[_0x7bdb('0xc2')]()[_0x7bdb('0x3e')](cmHopperBlack[_0x7bdb('0xc4')](_0x24aee0))['catch'](loggerCatch(_0x7bdb('0xc5')));};Dialer[_0x7bdb('0x18')][_0x7bdb('0xc6')]=function(_0x548b5c){return BPromise['resolve']()['then'](cmHopperBlack[_0x7bdb('0xc6')](_0x548b5c))[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0xc7')));};Dialer[_0x7bdb('0x18')][_0x7bdb('0xc8')]=function(_0x5b6eae){return BPromise[_0x7bdb('0xc2')]()['then'](cmHopperHistory[_0x7bdb('0xc9')](_0x5b6eae))[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0xca')));};Dialer[_0x7bdb('0x18')]['rescheduleContact']=function(_0x3090b0){return BPromise[_0x7bdb('0xc2')]()[_0x7bdb('0x3e')](cmHopper[_0x7bdb('0xcb')](_0x3090b0))[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0xcc')));};Dialer[_0x7bdb('0x18')][_0x7bdb('0xcd')]=function(_0x439830,_0x2cdc62,_0x25de80){return BPromise[_0x7bdb('0xc2')]()[_0x7bdb('0x3e')](cmHopper['unlockContact'](_0x439830,_0x2cdc62,_0x25de80))[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0xce')));};Dialer['prototype']['getContactDialer']=function(_0x3b83d9,_0x7f7fe0,_0x4aab9b,_0x4c90b3,_0x40c608){return BPromise[_0x7bdb('0xc2')]()[_0x7bdb('0x3e')](cmHopper['getContactDialer'](_0x3b83d9,_0x7f7fe0,_0x4aab9b,_0x4c90b3))[_0x7bdb('0xbc')](function(_0x1d241a){_0x40c608[_0x7bdb('0xcf')]-=_0x4aab9b;_0x40c608[_0x7bdb('0xcf')]=_0x40c608[_0x7bdb('0xcf')]>0x0?_0x40c608[_0x7bdb('0xcf')]:0x0;loggerCatch(_0x7bdb('0xd0'))(_0x1d241a);});};Dialer[_0x7bdb('0x18')][_0x7bdb('0xd1')]=function(_0x3c8e52,_0x1a56f5,_0x499110,_0xe2320){return BPromise[_0x7bdb('0xc2')]()[_0x7bdb('0x3e')](cmHopper[_0x7bdb('0xd1')](_0x3c8e52,_0x1a56f5,_0x499110))[_0x7bdb('0xbc')](function(_0x88354c){_0xe2320[_0x7bdb('0xcf')]-=_0x1a56f5;_0xe2320['temp']=_0xe2320[_0x7bdb('0xcf')]>0x0?_0xe2320[_0x7bdb('0xcf')]:0x0;loggerCatch(_0x7bdb('0xd2'))(_0x88354c);});};Dialer[_0x7bdb('0x18')][_0x7bdb('0xd3')]=function(_0x1cac00){return BPromise[_0x7bdb('0xc2')]()[_0x7bdb('0x3e')](voiceQueueRt[_0x7bdb('0xd3')](_0x1cac00))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype']['moveContactManagedDialer']=function(_0x157ca0){return BPromise['resolve']()['then'](cmHopper[_0x7bdb('0xd4')](_0x157ca0))['catch'](loggerCatch(_0x7bdb('0xd5')));};Dialer[_0x7bdb('0x18')][_0x7bdb('0xd6')]=function(_0x3f3434){return BPromise[_0x7bdb('0xc2')]()[_0x7bdb('0x3e')](cmHopperHistory['createHistory'](_0x3f3434))[_0x7bdb('0xbc')](loggerCatch('[createHistory]\x20'));};Dialer[_0x7bdb('0x18')][_0x7bdb('0xbe')]=function(_0x2b2548){if(!_[_0x7bdb('0x40')](_0x2b2548)&&_0x2b2548!==null){if(typeof _0x2b2548[_0x7bdb('0xa2')]!==_0x7bdb('0xa3')){if(_0x2b2548[_0x7bdb('0xa2')]>0x0){_0x2b2548['originated']-=0x1;}else{logger['error'](_0x7bdb('0xd7'));}}}else{logger[_0x7bdb('0x9e')](_0x7bdb('0xd8'));}};Dialer['prototype'][_0x7bdb('0xd9')]=function(_0x1291ae,_0x4dc002){var _0x5dde1b=this;return function(_0x2c500d){_0x5dde1b[_0x7bdb('0xbe')](_0x4dc002);logger[_0x7bdb('0x9e')](_0x1291ae,util[_0x7bdb('0xa0')](_0x2c500d,{'showHidden':![],'depth':null}));};};Dialer[_0x7bdb('0x18')]['emptyContact']=function(_0x3f3b6d,_0x124519,_0x54ecb8){var _0x30c22b={'state':0x19,'statedesc':'notFound'};this[_0x7bdb('0xbe')](_0x124519);this[_0x7bdb('0xda')](_[_0x7bdb('0x98')](_0x30c22b,_[_0x7bdb('0xdb')](_0x54ecb8,[_0x7bdb('0xdc'),'ListId',_0x7bdb('0xdd'),_0x7bdb('0xde'),_0x7bdb('0xdf')])),_0x7bdb('0xe0'),_0x7bdb('0xe1'));logger[_0x7bdb('0x9e')](_0x3f3b6d);};Dialer[_0x7bdb('0x18')][_0x7bdb('0xe2')]=function(_0x436953){return _0x436953==='Success';};Dialer[_0x7bdb('0x18')][_0x7bdb('0xe3')]=function(_0x38191e){return!_['isUndefined'](_0x38191e)&&_0x38191e&&!_[_0x7bdb('0x40')](_0x38191e[_0x7bdb('0x42')])&&!_['isUndefined'](_0x38191e[_0x7bdb('0x7d')])&&_0x38191e['active']&&(this[_0x7bdb('0x20')][util['format'](_0x7bdb('0xe4'),_0x38191e[_0x7bdb('0x42')])][_0x7bdb('0xba')]==='reachable'||this['trunks'][util[_0x7bdb('0x7f')](_0x7bdb('0xe4'),_0x38191e[_0x7bdb('0x42')])]['status']===_0x7bdb('0xe5'));};Dialer['prototype'][_0x7bdb('0xda')]=function(_0x524db1,_0x492500,_0x429706){this[_0x7bdb('0xd6')](_0x524db1)['catch'](loggerCatch(_0x492500));this['moveContactManagedDialer'](_0x524db1)[_0x7bdb('0xbc')](loggerCatch(_0x429706));};Dialer[_0x7bdb('0x18')]['syncVarSet']=function(_0x551682){var _0xf6247f=this[_0x7bdb('0x25')][_0x551682[_0x7bdb('0xe6')]];var _0x165c92;if(!_[_0x7bdb('0xb8')](_0x551682)&&!_['isNil'](_0x551682[_0x7bdb('0xe7')])&&!_['isNil'](_0x551682[_0x7bdb('0xe7')][_0x7bdb('0xe8')])&&_0x551682[_0x7bdb('0xe9')]===_0x7bdb('0xea')&&_0xf6247f){if(_0xf6247f[_0x7bdb('0x5b')]!=='ivr'&&this[_0x7bdb('0x1d')][_0xf6247f[_0x7bdb('0xbf')]][_0x7bdb('0xeb')]&&_0x551682[_0x7bdb('0xec')]==='HANGUP'){delete this['uniqueId'][_0x551682['uniqueid']];this[_0x7bdb('0xbe')](this[_0x7bdb('0x1d')][_0xf6247f['queue']]);this[_0x7bdb('0x1d')][_0xf6247f[_0x7bdb('0xbf')]][_0x7bdb('0xed')]+=0x1;this['voiceQueues'][_0xf6247f['queue']][_0x7bdb('0x63')]+=0x1;_0x165c92=new Hangup(_0xf6247f,_0x551682);_0x165c92[_0x7bdb('0xb0')]=0x12;_0x165c92[_0x7bdb('0xb1')]='HangupInAMD';_0x165c92['membername']=_0x7bdb('0xee');ami[_0x7bdb('0x50')]('custom:amd',ut[_0x7bdb('0xef')](_0x165c92,_0x7bdb('0xf0')));this[_0x7bdb('0xda')](_0x165c92,_0x7bdb('0xf1'),_0x7bdb('0xf2'));}if(_0xf6247f['type']!==_0x7bdb('0x82')&&this[_0x7bdb('0x1d')][_0xf6247f[_0x7bdb('0xbf')]][_0x7bdb('0xeb')]&&_0x551682['value']===_0x7bdb('0xf3')){var _0x35423e=this;return new BPromise(function(_0x54fa7f,_0x2e8a2e){delete _0x35423e[_0x7bdb('0x25')][_0x551682[_0x7bdb('0xe6')]];_0x35423e['updateOriginated'](_0x35423e[_0x7bdb('0x1d')][_0xf6247f['queue']]);_0x35423e[_0x7bdb('0x1d')][_0xf6247f[_0x7bdb('0xbf')]]['outboundAnswerCallsDay']+=0x1;_0x35423e[_0x7bdb('0x1d')][_0xf6247f['queue']][_0x7bdb('0x63')]+=0x1;var _0x16282c=_0x35423e[_0x7bdb('0x1d')][_0xf6247f[_0x7bdb('0xbf')]];var _0x4adef7=new Hangup(_0xf6247f,_0x551682);_0x4adef7[_0x7bdb('0xb0')]=0x13;_0x4adef7['statedesc']='Machine';_0x4adef7[_0x7bdb('0xf4')]=_0x7bdb('0xee');_0x4adef7['countmachineretry']+=0x1;_0x4adef7[_0x7bdb('0xf5')]+=0x1;_0x4adef7[_0x7bdb('0xf0')]=!![];ami[_0x7bdb('0x50')]('custom:amd',ut[_0x7bdb('0xef')](_0x4adef7,_0x7bdb('0xf0')));_0x35423e[_0x7bdb('0xd6')](_0x4adef7)[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0xf6')));if(_0x4adef7['countbusyretry']+_0x4adef7[_0x7bdb('0xf7')]+_0x4adef7['countnoanswerretry']+_0x4adef7[_0x7bdb('0xf8')]+_0x4adef7[_0x7bdb('0xf9')]+_0x4adef7[_0x7bdb('0xfa')]+_0x4adef7[_0x7bdb('0xfb')]+_0x4adef7[_0x7bdb('0xfc')]>=_0x16282c[_0x7bdb('0xfd')]){_0x35423e['stateGlobal'](_0x4adef7,_0x54fa7f,_0x2e8a2e,_0x7bdb('0xfe'));}else{if(_0x4adef7[_0x7bdb('0xfb')]>=_0x16282c[_0x7bdb('0xff')]){_0x35423e[_0x7bdb('0x100')](_0x4adef7,_0x54fa7f,_0x2e8a2e,_0x7bdb('0x101'));}else{_0x35423e[_0x7bdb('0xcb')]({'active':![],'countmachineretry':_0x4adef7['countmachineretry'],'scheduledat':moment()[_0x7bdb('0x102')](_0x16282c['dialMachineRetryFrequency'],_0x7bdb('0x103'))[_0x7bdb('0x7f')](_0x7bdb('0x104')),'ContactId':_0x4adef7['ContactId'],'ListId':_0x4adef7[_0x7bdb('0x105')],'VoiceQueueId':_0x4adef7[_0x7bdb('0xde')]||undefined,'CampaignId':_0x4adef7[_0x7bdb('0xdf')]||undefined})['catch'](loggerCatch(_0x7bdb('0x106')));_0x54fa7f({'reschedule':0x1});}}});}if(_0xf6247f[_0x7bdb('0x5b')]===_0x7bdb('0x82')&&this['campaigns'][_0xf6247f[_0x7bdb('0xbf')]][_0x7bdb('0xeb')]&&_0x551682['value']===_0x7bdb('0x107')){delete this['uniqueId'][_0x551682[_0x7bdb('0xe6')]];this[_0x7bdb('0xbe')](this['campaigns'][_0xf6247f['queue']]);_0x165c92=new Hangup(_0xf6247f,_0x551682);_0x165c92[_0x7bdb('0xb0')]=0x12;_0x165c92['statedesc']=_0x7bdb('0x108');_0x165c92[_0x7bdb('0xf4')]=_0x7bdb('0xee');ami['emit'](_0x7bdb('0x109'),ut['buildObj'](_0x165c92,'amd'));this['saveInDb'](_0x165c92,_0x7bdb('0x10a'),'[syncHangupInAMDIvr]');}if(_0xf6247f[_0x7bdb('0x5b')]===_0x7bdb('0x82')&&this[_0x7bdb('0x1e')][_0xf6247f[_0x7bdb('0xbf')]][_0x7bdb('0xeb')]&&_0x551682[_0x7bdb('0xec')]===_0x7bdb('0xf3')){var _0x35423e=this;return new BPromise(function(_0x3a89e7,_0x512226){delete _0x35423e[_0x7bdb('0x25')][_0x551682[_0x7bdb('0xe6')]];_0x35423e[_0x7bdb('0xbe')](_0x35423e[_0x7bdb('0x1e')][_0xf6247f[_0x7bdb('0xbf')]]);_0x35423e[_0x7bdb('0x1e')][_0xf6247f[_0x7bdb('0xbf')]][_0x7bdb('0xed')]+=0x1;_0x35423e[_0x7bdb('0x1e')][_0xf6247f['queue']][_0x7bdb('0x63')]+=0x1;var _0x4807e1=_0x35423e[_0x7bdb('0x1e')][_0xf6247f[_0x7bdb('0xbf')]];var _0x6096ca=new Hangup(_0xf6247f,_0x551682);_0x6096ca[_0x7bdb('0xb0')]=0x13;_0x6096ca[_0x7bdb('0xb1')]=_0x7bdb('0x10b');_0x6096ca[_0x7bdb('0xf4')]='AMD';_0x6096ca[_0x7bdb('0xfb')]+=0x1;_0x6096ca['countglobal']+=0x1;_0x6096ca[_0x7bdb('0xf0')]=!![];ami['emit']('custom:amd',ut[_0x7bdb('0xef')](_0x6096ca,_0x7bdb('0xf0')));_0x35423e[_0x7bdb('0xd6')](_0x6096ca)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x6096ca[_0x7bdb('0x10c')]+_0x6096ca['countcongestionretry']+_0x6096ca['countnoanswerretry']+_0x6096ca[_0x7bdb('0xf8')]+_0x6096ca[_0x7bdb('0xf9')]+_0x6096ca[_0x7bdb('0xfa')]+_0x6096ca[_0x7bdb('0xfb')]+_0x6096ca[_0x7bdb('0xfc')]>=_0x4807e1[_0x7bdb('0xfd')]){_0x35423e[_0x7bdb('0x10d')](_0x6096ca,_0x3a89e7,_0x512226,_0x7bdb('0xfe'));}else{if(_0x6096ca['countmachineretry']>=_0x4807e1[_0x7bdb('0xff')]){_0x35423e[_0x7bdb('0x100')](_0x6096ca,_0x3a89e7,_0x512226,_0x7bdb('0x101'));}else{_0x35423e[_0x7bdb('0xcb')]({'active':![],'countmachineretry':_0x6096ca['countmachineretry'],'scheduledat':moment()[_0x7bdb('0x102')](_0x4807e1['dialMachineRetryFrequency'],_0x7bdb('0x103'))[_0x7bdb('0x7f')](_0x7bdb('0x104')),'ContactId':_0x6096ca[_0x7bdb('0xdc')],'ListId':_0x6096ca[_0x7bdb('0x105')],'VoiceQueueId':_0x6096ca[_0x7bdb('0xde')]||undefined,'CampaignId':_0x6096ca[_0x7bdb('0xdf')]||undefined})[_0x7bdb('0xbc')](loggerCatch('[rescheduleContact][Machine]'));_0x3a89e7({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x7bdb('0x35')]=function(_0x4b2a09){var _0xf21667=this[_0x7bdb('0x25')][_0x4b2a09[_0x7bdb('0xe6')]];var _0xfc95ff=this;var _0x18089c;if(_0xf21667&&_0xf21667[_0x7bdb('0x5b')]===_0x7bdb('0x82')){delete this['uniqueId'][_0x4b2a09[_0x7bdb('0xe6')]];this['updateOriginated'](this[_0x7bdb('0x1e')][_0xf21667[_0x7bdb('0xbf')]]);this[_0x7bdb('0x1e')][_0xf21667[_0x7bdb('0xbf')]]['ivrAnswerCallsDay']+=0x1;_0x18089c=new Hangup(_0xf21667,_0x4b2a09);this['createHistory'](_0x18089c)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x7bdb('0xd4')](_0x18089c)['catch'](loggerCatch(_0x7bdb('0x10e')));}if(_0xf21667&&_0xf21667[_0x7bdb('0x5b')]!=='ivr'&&isNotNull(this[_0x7bdb('0x1d')][_0xf21667[_0x7bdb('0xbf')]][_0x7bdb('0x10f')])){delete this[_0x7bdb('0x25')][_0x4b2a09[_0x7bdb('0xe6')]];this[_0x7bdb('0xbe')](this[_0x7bdb('0x1d')][_0xf21667[_0x7bdb('0xbf')]]);this['voiceQueues'][_0xf21667['queue']][_0x7bdb('0xed')]+=0x1;this[_0x7bdb('0x1d')][_0xf21667[_0x7bdb('0xbf')]][_0x7bdb('0x63')]+=0x1;_0x18089c=new Hangup(_0xf21667,_0x4b2a09);_0x18089c[_0x7bdb('0xb0')]=0x10;_0x18089c[_0x7bdb('0xb1')]=_0x7bdb('0x110');_0x18089c['membername']=_0x7bdb('0x111');this['createHistory'](_0x18089c)[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x112')));this[_0x7bdb('0xd4')](_0x18089c)['catch'](loggerCatch(_0x7bdb('0x10e')));}if(_0xf21667&&_0xf21667['type']!==_0x7bdb('0x82')&&!isNotNull(this[_0x7bdb('0x1d')][_0xf21667[_0x7bdb('0xbf')]][_0x7bdb('0x10f')])){delete this['uniqueId'][_0x4b2a09['uniqueid']];this[_0x7bdb('0xbe')](this[_0x7bdb('0x1d')][_0xf21667['queue']]);this[_0x7bdb('0x1d')][_0xf21667[_0x7bdb('0xbf')]][_0x7bdb('0x6e')]+=0x1;_0x18089c=new Hangup(_0xf21667,_0x4b2a09);_0x18089c[_0x7bdb('0xb0')]=0xc;_0x18089c[_0x7bdb('0xb1')]=_0x4b2a09['cause-txt'];_0x18089c[_0x7bdb('0xf4')]=_0x7bdb('0x113');this['createHistory'](_0x18089c)['catch'](loggerCatch(_0x7bdb('0x112')));this[_0x7bdb('0xd4')](_0x18089c)[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x10e')));}};Dialer[_0x7bdb('0x18')][_0x7bdb('0x33')]=function(_0x1763e5){var _0x135931=this[_0x7bdb('0x25')][_0x1763e5[_0x7bdb('0xe6')]];var _0x494e19=this;if(this[_0x7bdb('0x1d')][_0x1763e5[_0x7bdb('0xbf')]]){if(_0x135931&&_0x135931[_0x7bdb('0x5b')]!=='ivr'){delete this['uniqueId'][_0x1763e5[_0x7bdb('0xe6')]];this['voiceQueues'][_0x1763e5[_0x7bdb('0xbf')]][_0x7bdb('0xed')]+=0x1;var _0x3a079f=new AgentComplete(_0x135931,_0x1763e5);if(_0x1763e5[_0x7bdb('0x114')]==='agent'){_0x3a079f['agiafterat']=this[_0x7bdb('0x1d')][_0x1763e5['queue']][_0x7bdb('0x115')]&&this[_0x7bdb('0x1d')][_0x1763e5[_0x7bdb('0xbf')]]['dialAgiAfterHangupAgent']?moment()['format'](_0x7bdb('0x104')):undefined;}this['createHistory'](_0x3a079f)[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x116')));this[_0x7bdb('0xd4')](_0x3a079f)['catch'](loggerCatch(_0x7bdb('0x117')));}}};Dialer[_0x7bdb('0x18')][_0x7bdb('0x2c')]=function(_0x44cd65){if(this[_0x7bdb('0x1d')][_0x44cd65[_0x7bdb('0xbf')]]){if(this[_0x7bdb('0x25')][_0x44cd65['uniqueid']]&&this[_0x7bdb('0x25')][_0x44cd65['uniqueid']][_0x7bdb('0x5b')]!==_0x7bdb('0x82')){this[_0x7bdb('0xbe')](this[_0x7bdb('0x1d')][_0x44cd65['queue']]);this[_0x7bdb('0x25')][_0x44cd65[_0x7bdb('0xe6')]][_0x7bdb('0x118')]=moment()[_0x7bdb('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x7bdb('0x18')][_0x7bdb('0x119')]=function(_0x1b5f2d){this['createHistory'](_0x1b5f2d)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x7bdb('0xd4')](_0x1b5f2d)[_0x7bdb('0xbc')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer['prototype'][_0x7bdb('0x2f')]=function(_0x101e4c){var _0x15b107=this[_0x7bdb('0x25')][_0x101e4c[_0x7bdb('0xe6')]];var _0x51507c=this;if(this[_0x7bdb('0x1d')][_0x101e4c[_0x7bdb('0xbf')]]){if(_0x15b107&&_0x15b107['type']!==_0x7bdb('0x82')){delete this[_0x7bdb('0x25')][_0x101e4c[_0x7bdb('0xe6')]];this['updateOriginated'](this['voiceQueues'][_0x101e4c[_0x7bdb('0xbf')]]);_0x15b107[_0x7bdb('0x11a')]=moment()[_0x7bdb('0x7f')](_0x7bdb('0x104'));var _0xb2f649=new QueueCallerAbandon(_0x15b107,_0x101e4c);if(getSeconds(_0x15b107[_0x7bdb('0x11a')],_0x15b107['responsetime'])>=_0x15b107['dialQueueTimeout']){this[_0x7bdb('0x1d')][_0x101e4c[_0x7bdb('0xbf')]][_0x7bdb('0x72')]+=0x1;this[_0x7bdb('0x1d')][_0x101e4c[_0x7bdb('0xbf')]][_0x7bdb('0x68')]+=0x1;this['voiceQueues'][_0x101e4c[_0x7bdb('0xbf')]][_0x7bdb('0x74')]+=0x1;_0xb2f649[_0x7bdb('0xb0')]=0xa;_0xb2f649[_0x7bdb('0xb1')]=_0x7bdb('0x11b');_0xb2f649[_0x7bdb('0x11c')]='TIMEOUT';_0xb2f649[_0x7bdb('0x11d')]=this[_0x7bdb('0x1d')][_0x101e4c['queue']][_0x7bdb('0x115')]?moment()[_0x7bdb('0x7f')](_0x7bdb('0x104')):undefined;_0xb2f649[_0x7bdb('0xf9')]+=0x1;_0xb2f649[_0x7bdb('0xf5')]+=0x1;if(_0xb2f649['countdropretry']>=this[_0x7bdb('0x1d')][_0x101e4c[_0x7bdb('0xbf')]]['dialDropMaxRetry']){this[_0x7bdb('0x119')](_0xb2f649);}else{this[_0x7bdb('0xcb')]({'active':![],'countdropretry':_0xb2f649['countdropretry'],'scheduledat':moment()[_0x7bdb('0x102')](this[_0x7bdb('0x1d')][_0x101e4c[_0x7bdb('0xbf')]][_0x7bdb('0x11e')],_0x7bdb('0x103'))[_0x7bdb('0x7f')](_0x7bdb('0x104')),'ContactId':_0x15b107[_0x7bdb('0xdc')],'ListId':_0x15b107[_0x7bdb('0x105')],'VoiceQueueId':_0x15b107[_0x7bdb('0xde')]||undefined,'CampaignId':_0x15b107[_0x7bdb('0xdf')]||undefined})[_0x7bdb('0xbc')](loggerCatch('[rescheduleContact][Drop]'));var _0x64100a=new History(_0xb2f649);_0x64100a[_0x7bdb('0xb0')]=0xa;_0x64100a[_0x7bdb('0xb1')]=_0x7bdb('0x11b');_0x64100a['starttime']=moment()['format'](_0x7bdb('0x104'));_0x64100a['endtime']=_0x64100a[_0x7bdb('0xb3')];_0x64100a[_0x7bdb('0x11f')]=_0xb2f649[_0x7bdb('0x11f')];_0x64100a['calleridnum']=_0xb2f649[_0x7bdb('0x120')];this[_0x7bdb('0xd6')](_0x64100a)[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x121')));}}else{this[_0x7bdb('0x1d')][_0x101e4c[_0x7bdb('0xbf')]][_0x7bdb('0x8b')]+=0x1;this[_0x7bdb('0x1d')][_0x101e4c[_0x7bdb('0xbf')]][_0x7bdb('0x67')]+=0x1;_0xb2f649[_0x7bdb('0xb0')]=0xb;_0xb2f649['statedesc']=_0x7bdb('0x122');_0xb2f649[_0x7bdb('0x11c')]=_0x7bdb('0x123');_0xb2f649[_0x7bdb('0xfa')]+=0x1;_0xb2f649[_0x7bdb('0xf5')]+=0x1;if(_0xb2f649[_0x7bdb('0xfa')]>=this[_0x7bdb('0x1d')][_0x101e4c[_0x7bdb('0xbf')]][_0x7bdb('0x124')]){this[_0x7bdb('0x119')](_0xb2f649);}else{this[_0x7bdb('0xcb')]({'active':![],'countabandonedretry':_0xb2f649[_0x7bdb('0xfa')],'scheduledat':moment()['add'](this['voiceQueues'][_0x101e4c['queue']][_0x7bdb('0x125')],_0x7bdb('0x103'))[_0x7bdb('0x7f')](_0x7bdb('0x104')),'ContactId':_0x15b107[_0x7bdb('0xdc')],'ListId':_0x15b107[_0x7bdb('0x105')],'VoiceQueueId':_0x15b107[_0x7bdb('0xde')]||undefined,'CampaignId':_0x15b107[_0x7bdb('0xdf')]||undefined})[_0x7bdb('0xbc')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x64100a=new History(_0xb2f649);_0x64100a[_0x7bdb('0xb0')]=0xb;_0x64100a[_0x7bdb('0xb1')]='Abandoned';_0x64100a[_0x7bdb('0xb3')]=moment()[_0x7bdb('0x7f')](_0x7bdb('0x104'));_0x64100a[_0x7bdb('0xb2')]=_0x64100a[_0x7bdb('0xb3')];_0x64100a['calleridname']=_0xb2f649[_0x7bdb('0x11f')];_0x64100a[_0x7bdb('0x120')]=_0xb2f649[_0x7bdb('0x120')];this[_0x7bdb('0xd6')](_0x64100a)[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x126')));}}}}};Dialer['prototype']['syncNewExten']=function(_0x2aa309){if(this[_0x7bdb('0x23')][_0x2aa309[_0x7bdb('0xe6')]]){this[_0x7bdb('0x23')][_0x2aa309[_0x7bdb('0xe6')]][_0x7bdb('0xbb')]=_0x2aa309[_0x7bdb('0xbb')];}if(this[_0x7bdb('0x25')][_0x2aa309[_0x7bdb('0xe6')]]){this['uniqueId'][_0x2aa309['uniqueid']][_0x7bdb('0xbb')]=_0x2aa309[_0x7bdb('0xbb')];}};Dialer['prototype'][_0x7bdb('0x3a')]=function(_0x3118f2){if(strategy[this[_0x7bdb('0x1d')][this[_0x7bdb('0x23')][_0x3118f2['actionid']][_0x7bdb('0xbf')]][_0x7bdb('0x52')]]===_0x7bdb('0x127')){if(this[_0x7bdb('0x23')][_0x3118f2[_0x7bdb('0x128')]]&&_['isNil'](this[_0x7bdb('0x23')][_0x3118f2['actionid']]['locked'])&&_0x3118f2[_0x7bdb('0xba')]==='1'&&_0x3118f2['paused']==='0'){if(this[_0x7bdb('0x1f')][_0x3118f2[_0x7bdb('0x129')]]){if(!this['agents'][_0x3118f2['stateinterface']][_0x7bdb('0x12a')]){this['agents'][_0x3118f2[_0x7bdb('0x129')]][_0x7bdb('0x12a')]=!![];this['actions'][_0x3118f2['actionid']]['locked']=!![];this[_0x7bdb('0x23')][_0x3118f2['actionid']][_0x7bdb('0x129')]=_0x3118f2[_0x7bdb('0x129')];}}}}else if((strategy[this[_0x7bdb('0x1d')][this['actions'][_0x3118f2[_0x7bdb('0x128')]][_0x7bdb('0xbf')]]['strategy']]||_0x7bdb('0x12b'))===_0x7bdb('0x12b')){if(this[_0x7bdb('0x23')][_0x3118f2['actionid']]){if(this[_0x7bdb('0x1f')][_0x3118f2['stateinterface']]){this[_0x7bdb('0x23')][_0x3118f2[_0x7bdb('0x128')]][_0x7bdb('0x129')]=_0x3118f2[_0x7bdb('0x129')];if(_[_0x7bdb('0xb8')](this[_0x7bdb('0x2a')][this['actions'][_0x3118f2[_0x7bdb('0x128')]][_0x7bdb('0xbf')]])){this[_0x7bdb('0x2a')][this[_0x7bdb('0x23')][_0x3118f2[_0x7bdb('0x128')]][_0x7bdb('0xbf')]]=[];}this['queueBooked'][this[_0x7bdb('0x23')][_0x3118f2[_0x7bdb('0x128')]]['queue']]['push'](_[_0x7bdb('0x98')](_[_0x7bdb('0xdb')](this['actions'][_0x3118f2[_0x7bdb('0x128')]],[_0x7bdb('0x12c'),_0x7bdb('0x129')]),{'status':_0x3118f2['status'],'paused':_0x3118f2[_0x7bdb('0x12d')]}));}}}};function unlockQueueStatus(_0x403063,_0x29eed8){setTimeout(function(){if(_[_0x7bdb('0x40')](_0x403063[_0x7bdb('0x12e')])){loggerBooked[_0x7bdb('0x9e')](_0x7bdb('0x12f'),_0x29eed8);}_0x403063[_0x7bdb('0x12e')]=!![];loggerBooked['info'](_0x7bdb('0x130'),_0x29eed8,JSON[_0x7bdb('0x131')](_[_0x7bdb('0xdb')](_0x403063,[_0x7bdb('0x42'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x7bdb('0x18')][_0x7bdb('0x3b')]=function(_0x8a97c4){var _0x25e7f7=this;var _0x5bb701=_0x25e7f7[_0x7bdb('0x1d')][_0x25e7f7[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]][_0x7bdb('0xbf')]];if(strategy[this[_0x7bdb('0x1d')][this[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]][_0x7bdb('0xbf')]][_0x7bdb('0x52')]]===_0x7bdb('0x127')){if(this[_0x7bdb('0x23')][_0x8a97c4['actionid']]&&this['actions'][_0x8a97c4[_0x7bdb('0x128')]][_0x7bdb('0x129')]){this[_0x7bdb('0x1c')][_0x7bdb('0x132')](this[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]][_0x7bdb('0x12c')],this[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]][_0x7bdb('0x129')])[_0x7bdb('0xbc')](function(_0x1f436e){logger[_0x7bdb('0x9e')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x7bdb('0xa0')](_0x1f436e,{'showHidden':![],'depth':null}));})[_0x7bdb('0x1b')](function(){_0x25e7f7['updateOriginated'](_0x25e7f7['voiceQueues'][_0x25e7f7[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]][_0x7bdb('0xbf')]]);_0x25e7f7[_0x7bdb('0x1f')][_0x25e7f7['actions'][_0x8a97c4['actionid']][_0x7bdb('0x129')]]['locked']=![];delete _0x25e7f7['actions'][_0x8a97c4[_0x7bdb('0x128')]];unlockQueueStatus(_0x5bb701);});}else{this[_0x7bdb('0xbe')](this[_0x7bdb('0x1d')][this[_0x7bdb('0x23')][_0x8a97c4['actionid']][_0x7bdb('0xbf')]]);this[_0x7bdb('0xcb')]({'active':![],'ContactId':this[_0x7bdb('0x23')][_0x8a97c4['actionid']][_0x7bdb('0xdc')],'ListId':this[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]]['ListId'],'VoiceQueueId':this[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]]['CampaignId']||undefined})[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x133')));delete this[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]];unlockQueueStatus(_0x5bb701);}}else if((strategy[this[_0x7bdb('0x1d')][this[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]][_0x7bdb('0xbf')]]['strategy']]||_0x7bdb('0x12b'))===_0x7bdb('0x12b')){var _0x40f091;if(this['actions'][_0x8a97c4['actionid']]&&!_[_0x7bdb('0x134')](this[_0x7bdb('0x2a')][this[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]][_0x7bdb('0xbf')]])){if(this['queueBookedRR'][_0x25e7f7[_0x7bdb('0x23')][_0x8a97c4['actionid']][_0x7bdb('0xbf')]]){this[_0x7bdb('0x135')][_0x25e7f7[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]][_0x7bdb('0xbf')]]=this[_0x7bdb('0x135')][this[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]][_0x7bdb('0xbf')]]?this[_0x7bdb('0x135')][this[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]]['queue']]:this[_0x7bdb('0x2a')][this[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]][_0x7bdb('0xbf')]]?this['queueBooked'][this['actions'][_0x8a97c4[_0x7bdb('0x128')]][_0x7bdb('0xbf')]][_0x7bdb('0x136')]||0x0:0x0;}this[_0x7bdb('0x2a')][this[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]][_0x7bdb('0xbf')]][_0x7bdb('0x136')]=this[_0x7bdb('0x135')][this[_0x7bdb('0x23')][_0x8a97c4[_0x7bdb('0x128')]][_0x7bdb('0xbf')]];for(var _0x3bdcc6=0x0;_0x3bdcc6=0x0;})[_0x7bdb('0xbc')](myreject(_0x27a8b5)));}}else{_0x4fbb6b[_0x7bdb('0x14f')](ami[_0x7bdb('0xb9')]({'action':_0x7bdb('0x153'),'command':util[_0x7bdb('0x7f')](_0x7bdb('0x154'),_0xbadccc,!_[_0x7bdb('0x40')](config['timezones'][_0x5eb5ee])?_0x5eb5ee:'')})[_0x7bdb('0x3e')](function(_0x1f6ca1){return _0x1f6ca1[_0x7bdb('0x150')]['indexOf'](_0x7bdb('0x152'))>=0x0;})['catch'](myreject(_0x27a8b5)));}BPromise['all'](_0x4fbb6b)[_0x7bdb('0x3e')](function(_0x1bf58d){var _0x3e0f2e=_['some'](_0x1bf58d);if(_0x3e0f2e){return _0x3e4db5(_0x3e0f2e);}else{_0x3dbe03['message']=_0x34f083?_0x7bdb('0x155'):_0x7bdb('0x156');return _0x27a8b5(msgResponse(_0x7bdb('0x157'),'Failure',_0x7bdb('0x158')+_0x34f083+'\x20'+_0x4ac924+_0x7bdb('0x159')+util['inspect'](_0xbadccc,{'showHidden':![],'depth':null})+_0x7bdb('0x15a')+_0x5eb5ee));}})[_0x7bdb('0xbc')](function(_0x4cc80a){return _0x27a8b5(msgResponse(_0x7bdb('0x146'),_0x7bdb('0x14a'),JSON[_0x7bdb('0x131')](_0x4cc80a)));});});};Dialer[_0x7bdb('0x18')][_0x7bdb('0x15b')]=function(_0x543d3a){var _0xed0f0b=this;return function(){switch(_0x543d3a[_0x7bdb('0x15c')]){case _0x7bdb('0x15d'):freeVariablesPredictive(_0x543d3a);_0xed0f0b[_0x7bdb('0x15e')](_0x543d3a,0x1);break;case _0x7bdb('0x15f'):freeVariablesPredictive(_0x543d3a);_0xed0f0b[_0x7bdb('0x15e')](_0x543d3a,_0x543d3a[_0x7bdb('0x160')]);break;case _0x7bdb('0x161'):_0xed0f0b[_0x7bdb('0x161')](_0x543d3a);break;case _0x7bdb('0x6'):freeVariablesPredictive(_0x543d3a);_0xed0f0b[_0x7bdb('0x15e')](_0x543d3a,0x1);break;default:freeVariablesPredictive(_0x543d3a);logger[_0x7bdb('0x9e')](_0x7bdb('0x162'),_0x543d3a[_0x7bdb('0x42')],'method\x20not\x20recognized');}};};Dialer[_0x7bdb('0x18')][_0x7bdb('0x163')]=function(_0x163351){return BPromise['resolve']()[_0x7bdb('0x3e')](cmHopper[_0x7bdb('0x164')](_0x163351['id'],previewRecallmeReminderInterval))[_0x7bdb('0x3e')](function(_0x3fdbf2){for(var _0x451ab5=0x0;_0x451ab5<_0x3fdbf2[_0x7bdb('0xa1')];_0x451ab5++){var _0x84a847=_0x3fdbf2[_0x451ab5][_0x7bdb('0x165')][_0x7bdb('0x42')];if(_0x84a847)io['to'](util['format']('user:%s',_0x84a847))[_0x7bdb('0x50')](_0x7bdb('0x166'),{'hopper':_0x3fdbf2[_0x451ab5]});}})[_0x7bdb('0xbc')](function(_0x2459e4){});};Dialer[_0x7bdb('0x18')][_0x7bdb('0x167')]=function(_0x2fe340){var _0x269c93=this;return function(){_0x269c93[_0x7bdb('0x168')](_0x2fe340);};};Dialer['prototype'][_0x7bdb('0x8')]=function(_0x10b5d4){var _0x47a493=this;if(isNotPreview(_0x10b5d4[_0x7bdb('0x15c')])){if(isVoiceQueueOutbound(_0x10b5d4[_0x7bdb('0x5b')])&&isActive(_0x10b5d4[_0x7bdb('0x5f')])){_0x10b5d4[_0x7bdb('0xa9')]=!![];BPromise['resolve']()[_0x7bdb('0x3e')](checkIsLoggedIn(_0x10b5d4,_0x10b5d4[_0x7bdb('0x55')]))[_0x7bdb('0x3e')](checkIsActive(_0x10b5d4,_0x10b5d4['dialActive']))[_0x7bdb('0x3e')](checkInterval(_0x10b5d4))[_0x7bdb('0x3e')](_0x47a493[_0x7bdb('0x143')](_0x10b5d4))[_0x7bdb('0x3e')](_0x47a493[_0x7bdb('0x145')](_0x10b5d4[_0x7bdb('0x169')],_0x10b5d4[_0x7bdb('0x16a')],_0x10b5d4['name'],_0x10b5d4))[_0x7bdb('0x3e')](_0x47a493['checkIfTimeIntervals'](_0x10b5d4['Interval'],_0x10b5d4['dialTimezone'],_0x10b5d4[_0x7bdb('0x42')],_0x10b5d4))[_0x7bdb('0x3e')](_0x47a493[_0x7bdb('0x15b')](_0x10b5d4))[_0x7bdb('0xbc')](loggerCatchQueueSummary(_0x7bdb('0x16b'),_0x10b5d4));}else{notSendMessagesQueue(_0x10b5d4);}}else{freeVariablesPredictive(_0x10b5d4);if(_0x10b5d4[_0x7bdb('0x16c')]){_0x47a493[_0x7bdb('0x163')](_0x10b5d4);}}};Dialer[_0x7bdb('0x18')][_0x7bdb('0x142')]=function(){var _0x2e932d=this;var _0x164620;for(var _0x2ded3f in this[_0x7bdb('0x1e')]){if(typeof this[_0x7bdb('0x1e')][_0x2ded3f]!==_0x7bdb('0xa3')){_0x164620=this['campaigns'][_0x2ded3f];if(isCampaignIvr(_0x164620[_0x7bdb('0x5b')])&&isActive(_0x164620[_0x7bdb('0x7d')])){_0x164620[_0x7bdb('0xa9')]=!![];BPromise[_0x7bdb('0xc2')]()['then'](checkIsActive(_0x164620,_0x164620[_0x7bdb('0x7d')]))[_0x7bdb('0x3e')](checkInterval(_0x164620))['then'](_0x2e932d['checkIsTrunkReachable'](_0x164620))[_0x7bdb('0x3e')](_0x2e932d['checkIfTime'](_0x164620[_0x7bdb('0x169')],_0x164620[_0x7bdb('0x16a')],_0x164620[_0x7bdb('0x42')],_0x164620))['then'](_0x2e932d['checkIfTimeIntervals'](_0x164620[_0x7bdb('0x47')],_0x164620[_0x7bdb('0x16a')],_0x164620['name'],_0x164620))[_0x7bdb('0x3e')](_0x2e932d[_0x7bdb('0x167')](_0x164620))[_0x7bdb('0xbc')](loggerCatchQueueSummary(_0x7bdb('0x16d'),_0x164620));}else{notSendMessagesCampaign(_0x164620);}}}};function getCallerIdRandom(_0x2a98e8,_0x397d5a){var _0x1be327;var _0x589ead;var _0x11757e;if(_0x397d5a<=0x0){_0x397d5a=0x1;}_0x1be327=new RegExp(_0x7bdb('0x16e')+_0x397d5a+'}$');_0x589ead=Math[_0x7bdb('0x16f')](0xa,_0x397d5a-0x1);_0x11757e=Math[_0x7bdb('0x16f')](0xa,_0x397d5a)-0x1;return util[_0x7bdb('0x7f')]('%s',_[_0x7bdb('0x170')](_0x2a98e8,_0x1be327,_['random'](_0x589ead,_0x11757e)));}function extractCalleridName(_0x2316e8){var _0x50ff0b=_0x2316e8[_0x7bdb('0x171')](/"(.*?)"/);return _0x50ff0b?_0x50ff0b[0x1]:_0x2316e8;}function extractCalleridNumber(_0x33c8d9){var _0x1ca1cd=_0x33c8d9[_0x7bdb('0x171')](/<(.*?)>/);return _0x1ca1cd?_0x1ca1cd[0x1]:_0x33c8d9;}Dialer[_0x7bdb('0x18')]['actionOriginate']=function(_0x1d3411,_0x48551c){var _0x57d7ed=this;var _0xbed3bc=uuid['v4']();this[_0x7bdb('0x23')][_0xbed3bc]=new Action(_0x1d3411,_0x48551c,_0xbed3bc);return new BPromise(function(_0x305b0a,_0x122cb6){if(_[_0x7bdb('0x40')](_0x1d3411)&&typeof _0x1d3411!==_0x7bdb('0x172')){return _0x122cb6(msgResponse('originate','Failure',_0x7bdb('0x173')));}if(_[_0x7bdb('0x40')](_0x48551c[_0x7bdb('0x174')]['phone'])||_0x48551c[_0x7bdb('0x174')][_0x7bdb('0x175')]===null){return _0x122cb6(msgResponse(_0x7bdb('0x176'),_0x7bdb('0x14a'),_0x7bdb('0x177')));}var _0x3ce8f1={'XMD-CALLERID':_0x57d7ed['actions'][_0xbed3bc][_0x7bdb('0x178')](),'XMD-AGI':_0x1d3411[_0x7bdb('0x10f')]?util[_0x7bdb('0x7f')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1d3411[_0x7bdb('0x10f')]):_0x7bdb('0x179'),'XMD-AGIAFTER':_0x1d3411[_0x7bdb('0x115')]?util[_0x7bdb('0x7f')](_0x7bdb('0x17a'),ipAgi,_0x1d3411[_0x7bdb('0x115')]):_0x7bdb('0x179'),'XMD-QUEUE':_0x1d3411[_0x7bdb('0x5b')]===_0x7bdb('0x51')?util[_0x7bdb('0x7f')](_0x7bdb('0x17b'),_0x1d3411['name'],_0x1d3411[_0x7bdb('0x17c')]||'',_0x1d3411['dialAgiAfterHangupAgent']?'c':'',_0x1d3411[_0x7bdb('0x17d')]||0x3):'NONE','XMD-CONTACTID':_0x48551c[_0x7bdb('0xdc')],'XMD-CDRTYPE':_0x7bdb('0x17e'),'CALLERID(all)':_0x57d7ed[_0x7bdb('0x23')][_0xbed3bc][_0x7bdb('0x178')](),'XMD-AMD':_0x1d3411[_0x7bdb('0xeb')]?_0x7bdb('0x17f'):_0x7bdb('0x179'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x1d3411[_0x7bdb('0xeb')]){_0x3ce8f1[_0x7bdb('0x180')]=_0x1d3411[_0x7bdb('0x181')]||0x9c4;_0x3ce8f1[_0x7bdb('0x182')]=_0x1d3411['dialAMDGreeting']||0x5dc;_0x3ce8f1[_0x7bdb('0x183')]=_0x1d3411[_0x7bdb('0x184')]||0x320;_0x3ce8f1[_0x7bdb('0x185')]=_0x1d3411['dialAMDTotalAnalysisTime']||0x1388;_0x3ce8f1[_0x7bdb('0x186')]=_0x1d3411[_0x7bdb('0x187')]||0x64;_0x3ce8f1[_0x7bdb('0x188')]=_0x1d3411[_0x7bdb('0x189')]||0x32;_0x3ce8f1['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x1d3411[_0x7bdb('0x18a')]||0x3;_0x3ce8f1[_0x7bdb('0x18b')]=_0x1d3411['dialAMDSilenceThreshold']||0x100;_0x3ce8f1['XMD-AMDMAXIMUMWORDLENGTH']=_0x1d3411[_0x7bdb('0x18c')]||0x1388;}if(_0x1d3411[_0x7bdb('0x5b')]===_0x7bdb('0x51')){_0x3ce8f1[_0x7bdb('0x18d')]=_0x48551c[_0x7bdb('0xde')];}else{_0x3ce8f1['XMD-CAMPAIGNID']=_0x48551c[_0x7bdb('0xdf')];}for(var _0x162cd0 in _0x48551c['Contact']){if(typeof _0x48551c[_0x7bdb('0x174')][_0x162cd0]!=='undefined'){if(isNotNull(_0x48551c[_0x7bdb('0x174')][_0x162cd0])&&_0x162cd0!=='id'&&_0x162cd0!=='tags'&&_0x162cd0!==_0x7bdb('0x18e')&&_0x162cd0!==_0x7bdb('0x18f')){_0x3ce8f1[util['format'](_0x7bdb('0x190'),_0x7bdb('0x191'),_[_0x7bdb('0x192')](_0x162cd0))]=_0x48551c[_0x7bdb('0x174')][_0x162cd0];}}}var _0x51a32a=_0x57d7ed['isTrunkReachable'](_0x1d3411[_0x7bdb('0x7c')])?getCallerId(_0x1d3411[_0x7bdb('0x7c')][_0x7bdb('0x7e')],_0x1d3411[_0x7bdb('0x60')],_0x1d3411[_0x7bdb('0x193')]>0x0?getCallerIdRandom(_0x1d3411[_0x7bdb('0x194')],_0x1d3411[_0x7bdb('0x193')]):_0x1d3411['dialOriginateCallerIdNumber']):getCallerId(_[_0x7bdb('0xb8')](_0x1d3411['TrunkBackup'])?_0x1d3411['Trunk'][_0x7bdb('0x7e')]:_0x1d3411[_0x7bdb('0x195')]['callerid'],_0x1d3411['dialOriginateCallerIdName'],_0x1d3411[_0x7bdb('0x193')]>0x0?getCallerIdRandom(_0x1d3411['dialOriginateCallerIdNumber'],_0x1d3411[_0x7bdb('0x193')]):_0x1d3411['dialOriginateCallerIdNumber']);if(_0x51a32a){_0x3ce8f1[_0x7bdb('0x196')]=_0x57d7ed[_0x7bdb('0x23')][_0xbed3bc][_0x7bdb('0x197')]=extractCalleridName(_0x51a32a);_0x3ce8f1[_0x7bdb('0x198')]=_0x57d7ed['actions'][_0xbed3bc]['originatecalleridnum']=extractCalleridNumber(_0x51a32a);}return ami[_0x7bdb('0xb9')]({'actionid':_0xbed3bc,'action':_0x7bdb('0x176'),'channel':_0x57d7ed[_0x7bdb('0xe3')](_0x1d3411[_0x7bdb('0x7c')])?util[_0x7bdb('0x7f')](_0x7bdb('0x199'),_0x1d3411['Trunk'][_0x7bdb('0x42')],isNotNull(_0x1d3411['dialPrefix'])?_0x1d3411[_0x7bdb('0x62')][_0x7bdb('0x19a')]()||'':'',_0x1d3411[_0x7bdb('0x19b')]>0x0?_0x48551c[_0x7bdb('0x174')][_0x7bdb('0x175')][_0x7bdb('0x19c')](_0x1d3411[_0x7bdb('0x19b')]):_0x48551c[_0x7bdb('0x174')][_0x7bdb('0x175')]):util[_0x7bdb('0x7f')](_0x7bdb('0x199'),_['isNil'](_0x1d3411[_0x7bdb('0x195')])?_0x1d3411[_0x7bdb('0x7c')][_0x7bdb('0x42')]:_0x1d3411['TrunkBackup'][_0x7bdb('0x42')],isNotNull(_0x1d3411[_0x7bdb('0x62')])?_0x1d3411[_0x7bdb('0x62')][_0x7bdb('0x19a')]()||'':'',_0x1d3411['dialCutDigit']>0x0?_0x48551c[_0x7bdb('0x174')][_0x7bdb('0x175')][_0x7bdb('0x19c')](_0x1d3411[_0x7bdb('0x19b')]):_0x48551c[_0x7bdb('0x174')]['phone']),'callerid':_0x51a32a,'Exten':'xcally-motion-dialer','Context':_0x7bdb('0x19d'),'Priority':'1','variable':_0x3ce8f1,'timeout':(_0x1d3411['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0xbed3bc})[_0x7bdb('0x3e')](function(_0x5dde6c){return _0x305b0a(_0x5dde6c);})[_0x7bdb('0xbc')](function(_0x10b2e1){_0x1d3411['outboundOriginateFailureCallsDay']+=0x1;var _0x5e2dcf=new History(_0x57d7ed[_0x7bdb('0x23')][_0xbed3bc]);logger[_0x7bdb('0x9e')](util['format']('[originateError]:\x20%s',JSON[_0x7bdb('0x131')](_0x10b2e1)));_0x5e2dcf['state']=0xe;_0x5e2dcf['statedesc']=_0x7bdb('0x19e');_0x5e2dcf[_0x7bdb('0xb3')]=moment()[_0x7bdb('0x7f')](_0x7bdb('0x104'));_0x5e2dcf[_0x7bdb('0xb2')]=_0x5e2dcf[_0x7bdb('0xb3')];_0x57d7ed[_0x7bdb('0xd6')](_0x5e2dcf)['catch'](loggerCatch(_0x7bdb('0x19f')));_0x57d7ed[_0x7bdb('0xd4')](_0x5e2dcf)[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x19f')))[_0x7bdb('0x1b')](function(){delete _0x57d7ed[_0x7bdb('0x23')][_0xbed3bc];return _0x122cb6(msgResponse(_0x7bdb('0x176'),_0x7bdb('0x4c'),_0x7bdb('0x1a0')));});});});};Dialer[_0x7bdb('0x18')][_0x7bdb('0x31')]=function(_0x21edb3){var _0x3bd880=this[_0x7bdb('0x23')][_0x21edb3[_0x7bdb('0x128')]];if(_0x3bd880){delete this[_0x7bdb('0x23')][_0x21edb3[_0x7bdb('0x128')]];_0x3bd880['responsetime']=moment()[_0x7bdb('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1dc04b=_0x3bd880[_0x7bdb('0x5b')]===_0x7bdb('0x82')?this[_0x7bdb('0x1e')][_0x3bd880[_0x7bdb('0xbf')]]:this[_0x7bdb('0x1d')][_0x3bd880[_0x7bdb('0x1a1')]()];if(!this[_0x7bdb('0xe2')](_0x21edb3['response'])){this[_0x7bdb('0xbe')](_0x1dc04b);return this['callProgressDetecting'](_0x3bd880,_0x1dc04b,_0x21edb3)['catch'](loggerCatch(_0x7bdb('0x1a2')));}this[_0x7bdb('0x25')][_0x21edb3[_0x7bdb('0xe6')]]=_0x3bd880;}};Dialer[_0x7bdb('0x18')][_0x7bdb('0x1a3')]=function(_0x543b2c,_0x48f2c5,_0x5db136){var _0x2a29e6=new History(_0x48f2c5);if(_0x2a29e6[_0x7bdb('0x10c')]+_0x2a29e6['countcongestionretry']+_0x2a29e6[_0x7bdb('0x1a4')]+_0x2a29e6[_0x7bdb('0xf8')]+_0x2a29e6[_0x7bdb('0xf9')]+_0x2a29e6[_0x7bdb('0xfa')]+_0x2a29e6[_0x7bdb('0xfb')]+_0x2a29e6[_0x7bdb('0xfc')]>=_0x5db136[_0x7bdb('0xfd')]-0x1){return!![];}switch(_0x543b2c){case 0x3:if(_0x2a29e6[_0x7bdb('0x1a4')]>=_0x5db136[_0x7bdb('0x1a5')]-0x1){return!![];}this[_0x7bdb('0xcb')]({'active':![],'countnoanswerretry':_0x2a29e6[_0x7bdb('0x1a4')]+=0x1,'scheduledat':moment()[_0x7bdb('0x102')](_0x5db136[_0x7bdb('0x1a6')],_0x7bdb('0x103'))['format'](_0x7bdb('0x104')),'ContactId':_0x2a29e6['ContactId'],'ListId':_0x2a29e6['ListId'],'VoiceQueueId':_0x2a29e6[_0x7bdb('0xde')]||undefined,'CampaignId':_0x2a29e6[_0x7bdb('0xdf')]||undefined})[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x1a7')));break;case 0x5:if(_0x2a29e6[_0x7bdb('0x10c')]>=_0x5db136[_0x7bdb('0x1a8')]-0x1){return!![];}this[_0x7bdb('0xcb')]({'active':![],'countbusyretry':_0x2a29e6[_0x7bdb('0x10c')]+=0x1,'scheduledat':moment()['add'](_0x5db136[_0x7bdb('0x1a9')],_0x7bdb('0x103'))[_0x7bdb('0x7f')](_0x7bdb('0x104')),'ContactId':_0x2a29e6[_0x7bdb('0xdc')],'ListId':_0x2a29e6['ListId'],'VoiceQueueId':_0x2a29e6['VoiceQueueId']||undefined,'CampaignId':_0x2a29e6['CampaignId']||undefined})[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x1aa')));break;case 0x8:if(_0x2a29e6[_0x7bdb('0xf7')]>=_0x5db136[_0x7bdb('0x1ab')]-0x1){return!![];}this[_0x7bdb('0xcb')]({'active':![],'countcongestionretry':_0x2a29e6[_0x7bdb('0xf7')]+=0x1,'scheduledat':moment()[_0x7bdb('0x102')](_0x5db136[_0x7bdb('0x1ac')],_0x7bdb('0x103'))['format'](_0x7bdb('0x104')),'ContactId':_0x2a29e6[_0x7bdb('0xdc')],'ListId':_0x2a29e6[_0x7bdb('0x105')],'VoiceQueueId':_0x2a29e6[_0x7bdb('0xde')]||undefined,'CampaignId':_0x2a29e6['CampaignId']||undefined})['catch'](loggerCatch(_0x7bdb('0x1ad')));break;case 0x0:if(_0x2a29e6['countnosuchnumberretry']>=_0x5db136['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x7bdb('0xcb')]({'active':![],'countnosuchnumberretry':_0x2a29e6[_0x7bdb('0xf8')]+=0x1,'scheduledat':moment()[_0x7bdb('0x102')](_0x5db136[_0x7bdb('0x1ae')],'minutes')[_0x7bdb('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a29e6[_0x7bdb('0xdc')],'ListId':_0x2a29e6[_0x7bdb('0x105')],'VoiceQueueId':_0x2a29e6['VoiceQueueId']||undefined,'CampaignId':_0x2a29e6[_0x7bdb('0xdf')]||undefined})[_0x7bdb('0xbc')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x2a29e6[_0x7bdb('0xf9')]>=_0x5db136[_0x7bdb('0x1af')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x2a29e6[_0x7bdb('0xf9')]+=0x1,'scheduledat':moment()[_0x7bdb('0x102')](_0x5db136[_0x7bdb('0x11e')],_0x7bdb('0x103'))['format'](_0x7bdb('0x104')),'ContactId':_0x2a29e6[_0x7bdb('0xdc')],'ListId':_0x2a29e6[_0x7bdb('0x105')],'VoiceQueueId':_0x2a29e6['VoiceQueueId']||undefined,'CampaignId':_0x2a29e6[_0x7bdb('0xdf')]||undefined})['catch'](loggerCatch(_0x7bdb('0x1b0')));break;case 0xb:if(_0x2a29e6[_0x7bdb('0xfa')]>=_0x5db136[_0x7bdb('0x124')]-0x1){return!![];}this[_0x7bdb('0xcb')]({'active':![],'countabandonedretry':_0x2a29e6[_0x7bdb('0xfa')]+=0x1,'scheduledat':moment()[_0x7bdb('0x102')](_0x5db136[_0x7bdb('0x125')],_0x7bdb('0x103'))[_0x7bdb('0x7f')](_0x7bdb('0x104')),'ContactId':_0x2a29e6[_0x7bdb('0xdc')],'ListId':_0x2a29e6[_0x7bdb('0x105')],'VoiceQueueId':_0x2a29e6[_0x7bdb('0xde')]||undefined,'CampaignId':_0x2a29e6[_0x7bdb('0xdf')]||undefined})['catch'](loggerCatch(_0x7bdb('0x1b1')));break;case 0x13:if(_0x2a29e6[_0x7bdb('0xfb')]>=_0x5db136[_0x7bdb('0xff')]-0x1){return!![];}this[_0x7bdb('0xcb')]({'active':![],'countmachineretry':_0x2a29e6[_0x7bdb('0xfb')]+=0x1,'scheduledat':moment()['add'](_0x5db136[_0x7bdb('0x1b2')],_0x7bdb('0x103'))[_0x7bdb('0x7f')](_0x7bdb('0x104')),'ContactId':_0x2a29e6['ContactId'],'ListId':_0x2a29e6[_0x7bdb('0x105')],'VoiceQueueId':_0x2a29e6[_0x7bdb('0xde')]||undefined,'CampaignId':_0x2a29e6['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x2a29e6[_0x7bdb('0xfc')]>=_0x5db136[_0x7bdb('0x1b3')]-0x1){return!![];}this[_0x7bdb('0xcb')]({'active':![],'countagentrejectretry':_0x2a29e6['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x7bdb('0x102')](_0x5db136[_0x7bdb('0x1b4')],'minutes')[_0x7bdb('0x7f')](_0x7bdb('0x104')),'ContactId':_0x2a29e6[_0x7bdb('0xdc')],'ListId':_0x2a29e6[_0x7bdb('0x105')],'VoiceQueueId':_0x2a29e6['VoiceQueueId']||undefined,'CampaignId':_0x2a29e6[_0x7bdb('0xdf')]||undefined})[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x1b5')));break;default:return!![];}};Dialer[_0x7bdb('0x18')][_0x7bdb('0x1b6')]=function(_0x3e73ec,_0x133070,_0x4e80b2){var _0x223c0f=this;var _0x474f57=new History(_0x3e73ec);return new BPromise(function(_0x4d2591,_0x150789){if(_[_0x7bdb('0x40')](_0x133070)&&typeof _0x133070!==_0x7bdb('0x172')){return _0x150789(msgResponse(_0x7bdb('0x1b7'),'Failure',_0x7bdb('0x1b8')));}if(_['isUndefined'](_0x4e80b2)&&typeof _0x4e80b2!==_0x7bdb('0x172')){return _0x150789(msgResponse(_0x7bdb('0x1b7'),_0x7bdb('0x14a'),_0x7bdb('0x1b9')));}switch(_0x4e80b2[_0x7bdb('0x114')]){case'0':_0x133070['outboundNoSuchCallsDay']+=0x1;_0x474f57[_0x7bdb('0xb0')]=0x0;_0x474f57['statedesc']='NoSuchNumber';_0x474f57[_0x7bdb('0xf8')]+=0x1;_0x474f57[_0x7bdb('0xf5')]+=0x1;ami[_0x7bdb('0x50')](_0x7bdb('0x1ba'),ut[_0x7bdb('0xef')](_0x3e73ec,_0x7bdb('0x1bb')));_0x223c0f[_0x7bdb('0xd6')](_0x474f57)[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0xf6')));if(_0x223c0f['checkRetriveMax'](0x0,_0x3e73ec,_0x133070)){if(_0x474f57[_0x7bdb('0xf8')]>=_0x133070[_0x7bdb('0x1bc')]){_0x223c0f[_0x7bdb('0x100')](_0x474f57,_0x4d2591,_0x150789,_0x7bdb('0x1bd'));}else{_0x223c0f[_0x7bdb('0x10d')](_0x474f57,_0x4d2591,_0x150789,_0x7bdb('0x1bd'));}}break;case'3':_0x133070[_0x7bdb('0x69')]+=0x1;_0x474f57[_0x7bdb('0xb0')]=0x3;_0x474f57[_0x7bdb('0xb1')]='NoAnswer';_0x474f57[_0x7bdb('0x1a4')]+=0x1;_0x474f57[_0x7bdb('0xf5')]+=0x1;ami[_0x7bdb('0x50')]('custom:agentnoanswer',ut[_0x7bdb('0xef')](_0x3e73ec,_0x7bdb('0x1be')));_0x223c0f[_0x7bdb('0xd6')](_0x474f57)[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x1bf')));if(_0x223c0f[_0x7bdb('0x1a3')](0x3,_0x3e73ec,_0x133070)){if(_0x474f57[_0x7bdb('0x1a4')]>=_0x133070['dialNoAnswerMaxRetry']){_0x223c0f[_0x7bdb('0x100')](_0x474f57,_0x4d2591,_0x150789,_0x7bdb('0x1c0'));}else{_0x223c0f['stateGlobal'](_0x474f57,_0x4d2591,_0x150789,_0x7bdb('0x1c0'));}}break;case'5':_0x133070['outboundBusyCallsDay']+=0x1;_0x474f57['state']=0x5;_0x474f57[_0x7bdb('0xb1')]=_0x7bdb('0x1c1');_0x474f57[_0x7bdb('0x10c')]+=0x1;_0x474f57[_0x7bdb('0xf5')]+=0x1;ami[_0x7bdb('0x50')](_0x7bdb('0x1c2'),ut['buildObj'](_0x3e73ec,'busy'));_0x223c0f[_0x7bdb('0xd6')](_0x474f57)[_0x7bdb('0xbc')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x223c0f['checkRetriveMax'](0x5,_0x3e73ec,_0x133070)){if(_0x474f57[_0x7bdb('0x10c')]>=_0x133070[_0x7bdb('0x1a8')]){_0x223c0f['createStateFinal'](_0x474f57,_0x4d2591,_0x150789,_0x7bdb('0x1c3'));}else{_0x223c0f['stateGlobal'](_0x474f57,_0x4d2591,_0x150789,'reason\x205\x20busy');}}break;case'8':_0x133070['outboundCongestionCallsDay']+=0x1;_0x474f57[_0x7bdb('0xb0')]=0x8;_0x474f57[_0x7bdb('0xb1')]=_0x7bdb('0x1c4');_0x474f57[_0x7bdb('0xf7')]+=0x1;_0x474f57[_0x7bdb('0xf5')]+=0x1;ami[_0x7bdb('0x50')]('custom:agentcongestion',ut['buildObj'](_0x3e73ec,_0x7bdb('0x1c5')));_0x223c0f['createHistory'](_0x474f57)[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x1c6')));if(_0x223c0f['checkRetriveMax'](0x8,_0x3e73ec,_0x133070)){if(_0x474f57[_0x7bdb('0xf7')]>=_0x133070[_0x7bdb('0x1ab')]){_0x223c0f[_0x7bdb('0x100')](_0x474f57,_0x4d2591,_0x150789,_0x7bdb('0x1c7'));}else{_0x223c0f['stateGlobal'](_0x474f57,_0x4d2591,_0x150789,_0x7bdb('0x1c7'));}}break;case'11':_0x133070[_0x7bdb('0x1c8')]+=0x1;_0x474f57[_0x7bdb('0xb0')]=0xb;_0x474f57['statedesc']=_0x7bdb('0x122');_0x474f57[_0x7bdb('0xfa')]+=0x1;_0x474f57[_0x7bdb('0xf5')]+=0x1;_0x223c0f[_0x7bdb('0xd6')](_0x474f57)[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x126')));if(_0x223c0f[_0x7bdb('0x1a3')](0xb,_0x3e73ec,_0x133070)){if(_0x474f57[_0x7bdb('0xfa')]>=_0x133070[_0x7bdb('0x124')]){_0x223c0f[_0x7bdb('0x100')](_0x474f57,_0x4d2591,_0x150789,_0x7bdb('0x1c9'));}else{_0x223c0f[_0x7bdb('0x10d')](_0x474f57,_0x4d2591,_0x150789,_0x7bdb('0x1c9'));}}break;case'20':_0x133070['outboundRejectCallsDay']+=0x1;_0x474f57[_0x7bdb('0xb0')]=0x14;_0x474f57[_0x7bdb('0xb1')]=_0x7bdb('0x1ca');_0x474f57['countagentrejectretry']+=0x1;_0x474f57[_0x7bdb('0xf5')]+=0x1;ami[_0x7bdb('0x50')](_0x7bdb('0x1cb'),ut['buildObj'](_0x3e73ec,_0x7bdb('0x1cc')));_0x223c0f[_0x7bdb('0xd6')](_0x474f57)[_0x7bdb('0xbc')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x223c0f[_0x7bdb('0x1a3')](0x14,_0x3e73ec,_0x133070)){if(_0x474f57[_0x7bdb('0xfc')]>=_0x133070[_0x7bdb('0x1b3')]){_0x223c0f['createStateFinal'](_0x474f57,_0x4d2591,_0x150789,'reason\x2020\x20agentreject');}else{_0x223c0f['stateGlobal'](_0x474f57,_0x4d2591,_0x150789,_0x7bdb('0x1cd'));}}break;default:_0x133070[_0x7bdb('0x6e')]+=0x1;_0x474f57[_0x7bdb('0xb0')]=0xc;_0x474f57[_0x7bdb('0xb1')]=_0x4e80b2[_0x7bdb('0x114')];_0x223c0f[_0x7bdb('0xd6')](_0x474f57)['catch'](loggerCatch(_0x7bdb('0x1ce')));if(_0x223c0f['checkRetriveMax'](_0x4e80b2[_0x7bdb('0x114')],_0x3e73ec,_0x133070)){if(_0x474f57['countbusyretry']+_0x474f57[_0x7bdb('0xf7')]+_0x474f57[_0x7bdb('0x1a4')]+_0x474f57[_0x7bdb('0xf8')]+_0x474f57[_0x7bdb('0xf9')]+_0x474f57[_0x7bdb('0xfa')]+_0x474f57['countmachineretry']+_0x474f57[_0x7bdb('0xfc')]>=_0x133070[_0x7bdb('0xfd')]){_0x223c0f[_0x7bdb('0x10d')](_0x474f57,_0x4d2591,_0x150789,_0x4e80b2[_0x7bdb('0x114')]);}else{_0x223c0f[_0x7bdb('0x100')](_0x474f57,_0x4d2591,_0x150789,_0x4e80b2[_0x7bdb('0x114')]);}}}});};Dialer['prototype'][_0x7bdb('0x10d')]=function(_0x41b834,_0x45c145,_0x263eb7,_0x28eb6e){var _0x593f13=new Final(_0x41b834);_0x593f13['state']=0xf;_0x593f13['statedesc']=_0x7bdb('0x1cf');this[_0x7bdb('0x100')](_0x593f13,_0x45c145,_0x263eb7,_0x28eb6e);};Dialer[_0x7bdb('0x18')][_0x7bdb('0x100')]=function(_0x3e0c94,_0x1ba918,_0x2aeffd,_0x3c3e61){this['moveContactManagedDialer'](_0x3e0c94)[_0x7bdb('0x3e')](function(){return _0x1ba918(msgResponse(_0x7bdb('0x1b7'),_0x7bdb('0x1d0'),_0x3c3e61));})[_0x7bdb('0xbc')](function(){return _0x2aeffd(msgResponse('[moveContactManagedDialer][0]',_0x7bdb('0x14a'),_0x7bdb('0x1d1')));});};Dialer['prototype']['predictive']=function(_0x241e2e){var _0x5d7951=_0x241e2e[_0x7bdb('0x1d2')]/0x64;var _0x2cbf0a=_0x241e2e[_0x7bdb('0x68')]/(_0x241e2e['outboundDropCallsDayTimeout']+_0x241e2e[_0x7bdb('0xed')]);var _0x3b21cc=Math['round'](_0x241e2e[_0x7bdb('0x77')]*(_0x241e2e['predictiveIntervalMaxThreshold']/0x64));var _0x574ff8=Math[_0x7bdb('0x1d3')](_0x241e2e[_0x7bdb('0x77')]*(_0x241e2e[_0x7bdb('0x1d4')]/0x64));var _0x23a003=_0x241e2e[_0x7bdb('0x54')]+_0x241e2e[_0x7bdb('0x59')];var _0x4968cd=Math[_0x7bdb('0x1d5')](_0x241e2e[_0x7bdb('0x94')]*_0x241e2e[_0x7bdb('0x7a')]*_0x241e2e['predictiveIntervalHitRate']*_0x241e2e[_0x7bdb('0x76')]);if(_[_0x7bdb('0x40')](_0x241e2e[_0x7bdb('0x28')])){if(!_[_0x7bdb('0x40')](_0x241e2e['startPredictive'])){_0x241e2e['startPredictive']=undefined;loggerPredictive[_0x7bdb('0x9e')](_0x7bdb('0x1d6'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x241e2e[_0x7bdb('0x9a')])){loggerPredictive[_0x7bdb('0x9e')](_0x7bdb('0x1d6'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x241e2e[_0x7bdb('0x9a')]);_0x241e2e[_0x7bdb('0x9a')]=undefined;}_0x241e2e[_0x7bdb('0x28')]=moment()['format'](_0x7bdb('0x104'));loggerPredictive[_0x7bdb('0x85')](_0x241e2e['name'],_0x7bdb('0x1d7'),_0x241e2e['startProgressive']);this[_0x7bdb('0x15e')](_0x241e2e,0x1);}else if(ifInterval(_0x241e2e[_0x7bdb('0x1d8')],_0x241e2e['startProgressive'])){this[_0x7bdb('0x15e')](_0x241e2e,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x241e2e['startProgressive'],_0x241e2e[_0x7bdb('0x42')]);_0x241e2e[_0x7bdb('0x94')]=0x0;_0x241e2e[_0x7bdb('0x74')]=0x0;}else if(_0x5d7951<_0x2cbf0a&&_0x241e2e[_0x7bdb('0x1d9')]===_0x7bdb('0x1da')){freeVariablesPredictive(_0x241e2e);loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x1db'),'Dropped\x20calls\x20day',_0x2cbf0a,_0x7bdb('0x28'),_0x241e2e[_0x7bdb('0x42')]);}else if(_0x4968cd<_0x241e2e['predictiveIntervalErlangCallsDroppedCalls']&&_0x241e2e[_0x7bdb('0x1d9')]==='dropRate'){freeVariablesPredictive(_0x241e2e);loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x1dc'),_0x7bdb('0x1dd'),_0x4968cd,'Drop\x20in\x20this\x20interval',_0x241e2e[_0x7bdb('0x74')],'startProgressive',_0x241e2e['name']);}else if(!ifInterval(_0x241e2e[_0x7bdb('0x1d8')],_0x241e2e['startProgressive'])&&_[_0x7bdb('0x40')](_0x241e2e['startPredictive'])&&!_[_0x7bdb('0x40')](_0x241e2e[_0x7bdb('0x28')])){_0x241e2e[_0x7bdb('0x27')]=moment()['format'](_0x7bdb('0x104'));loggerPredictive[_0x7bdb('0x85')](_0x241e2e[_0x7bdb('0x42')],_0x7bdb('0x1de'),_0x241e2e[_0x7bdb('0x27')]);this[_0x7bdb('0xc8')](_0x241e2e[_0x7bdb('0x1d8')])[_0x7bdb('0x3e')](this[_0x7bdb('0x1df')](_0x241e2e))[_0x7bdb('0x3e')](mergeDataErlangB(_0x241e2e))[_0x7bdb('0x3e')](this[_0x7bdb('0x1e0')](_0x241e2e))[_0x7bdb('0xbc')](loggerCatchPredictive(_0x7bdb('0x1e1'),_0x241e2e));}else if(!ifInterval(_0x241e2e['dialPredictiveInterval'],_0x241e2e[_0x7bdb('0x27')])){_0x241e2e[_0x7bdb('0x74')]=0x0;_0x241e2e[_0x7bdb('0x27')]=moment()['format'](_0x7bdb('0x104'));loggerPredictive[_0x7bdb('0x85')](_0x241e2e[_0x7bdb('0x42')],_0x7bdb('0x1e2'),_0x241e2e['startPredictive']);clearInterval(_0x241e2e[_0x7bdb('0x9a')]);_0x241e2e[_0x7bdb('0x9a')]=undefined;this[_0x7bdb('0xc8')](_0x241e2e[_0x7bdb('0x1d8')])[_0x7bdb('0x3e')](this['getDataPredictive'](_0x241e2e))[_0x7bdb('0x3e')](mergeDataErlangB(_0x241e2e))[_0x7bdb('0x3e')](this[_0x7bdb('0x1e0')](_0x241e2e))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x241e2e));}else if(_0x241e2e[_0x7bdb('0x77')]&&_0x23a003<_0x241e2e[_0x7bdb('0x77')]-_0x574ff8){freeVariablesPredictive(_0x241e2e);loggerPredictive[_0x7bdb('0x85')](_0x241e2e[_0x7bdb('0x42')],_0x7bdb('0x1e3'),_0x23a003,_0x7bdb('0x1e4'),_0x241e2e[_0x7bdb('0x77')],'-',_0x574ff8,'=',_0x241e2e[_0x7bdb('0x77')]-_0x574ff8,')');}else if(_0x241e2e[_0x7bdb('0x77')]&&_0x23a003>_0x241e2e[_0x7bdb('0x77')]+_0x3b21cc){freeVariablesPredictive(_0x241e2e);loggerPredictive[_0x7bdb('0x85')](_0x241e2e[_0x7bdb('0x42')],_0x7bdb('0x1e3'),_0x23a003,')\x20are\x20more\x20than\x20threshold\x20(',_0x241e2e['predictiveIntervalAvailable'],'+',_0x3b21cc,'=',_0x241e2e[_0x7bdb('0x77')]+_0x3b21cc,')');}};Dialer[_0x7bdb('0x18')]['getDataPredictive']=function(_0x4fe8fa){var _0xf0fd18=this;return function(_0x44b1e0){return new BPromise(function(_0x5ebb83,_0x9f474e){_[_0x7bdb('0x98')](_0x4fe8fa,_0x44b1e0[0x0]);if(checkGetDataPredictive(_0x44b1e0[0x0])){var _0x4bd9f7=_0x4fe8fa['predictiveIntervalAvailable']=_0x4fe8fa[_0x7bdb('0x59')]+_0x4fe8fa[_0x7bdb('0x54')];var _0x506796=_0x4fe8fa['dialPredictiveInterval']*0x3c;var _0xa4a9b1=_0x44b1e0[0x0][_0x7bdb('0x71')]+_0x44b1e0[0x0][_0x7bdb('0x70')];var _0x214b8c=(_0x44b1e0[0x0][_0x7bdb('0x6f')]+_0x44b1e0[0x0][_0x7bdb('0x72')]+_0x44b1e0[0x0][_0x7bdb('0x8b')])/_0x44b1e0[0x0][_0x7bdb('0x78')];_0x4fe8fa['predictiveIntervalHitRate']=_0x214b8c>0x0?_0x214b8c:0x1;switch(_0x4fe8fa['dialPredictiveOptimization']){case _0x7bdb('0x1da'):var _0x289205=_0x4fe8fa[_0x7bdb('0x1d2')]/0x64;return _0xf0fd18[_0x7bdb('0x1e5')](_0x4bd9f7,_0x506796,_0xa4a9b1,_0x214b8c,_0x289205)[_0x7bdb('0x3e')](function(_0x43aaf0){return _0x5ebb83(_0x43aaf0);});case _0x7bdb('0x1e6'):var _0x400832=_0x4fe8fa[_0x7bdb('0x1d2')]/0x64;return _0xf0fd18[_0x7bdb('0x1e7')](_0x4bd9f7,_0x506796,_0xa4a9b1,_0x214b8c,_0x400832)['then'](function(_0x2f486e){return _0x5ebb83(_0x2f486e);});default:return _0x9f474e(msgResponse(_0x7bdb('0x1e8'),_0x7bdb('0x14a'),'Unknown\x20Predictive'));}}else{return _0x9f474e(msgResponse(_0x7bdb('0x1e8'),_0x7bdb('0x14a'),_0x7bdb('0x1e9')));}});};};Dialer[_0x7bdb('0x18')]['getDataPredictiveOld']=function(_0x1a4eb2){var _0x2ca220=this;return function(_0x1ef3da){return new BPromise(function(_0x1098a5,_0x52c6d7){_[_0x7bdb('0x98')](_0x1a4eb2,_0x1ef3da[0x0]);if(checkGetDataPredictive(_0x1ef3da[0x0])){loggerPredictive[_0x7bdb('0x85')](JSON[_0x7bdb('0x131')](_0x1ef3da[0x0]));if(_0x1a4eb2[_0x7bdb('0x1d9')]==='dropRate'){return _0x2ca220[_0x7bdb('0xd3')](_0x1a4eb2['id'])[_0x7bdb('0x3e')](function(_0x4283ee){var _0x462dac=_0x1a4eb2[_0x7bdb('0x55')]-_0x4283ee[0x0]['outboundQueuePauses'];var _0x24c3e0=_0x1a4eb2[_0x7bdb('0x1d8')]*0x3c;var _0x5c971e=_0x1ef3da[0x0][_0x7bdb('0x71')]+_0x1ef3da[0x0]['predictiveIntervalAvgHoldtime'];var _0x29a539=(_0x1ef3da[0x0][_0x7bdb('0x6f')]+_0x1ef3da[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1ef3da[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1ef3da[0x0]['predictiveIntervalTotalCalls'];var _0x5ec7fc=_0x1a4eb2[_0x7bdb('0x1d2')]/0x64;_0x1a4eb2[_0x7bdb('0x1ea')]=_0x4283ee[0x0][_0x7bdb('0x1eb')]||0x0;_0x1a4eb2['predictiveIntervalHitRate']=_0x29a539>0x0?_0x29a539:0x1;return _0x2ca220['abandonmentRate'](_0x462dac,_0x24c3e0,_0x5c971e,_0x29a539,_0x5ec7fc);})[_0x7bdb('0x3e')](function(_0x2243ac){return _0x1098a5(_0x2243ac);})[_0x7bdb('0xbc')](function(_0x12b720){return _0x52c6d7(msgResponse(_0x7bdb('0x1ec'),_0x7bdb('0x14a'),JSON[_0x7bdb('0x131')](_0x12b720)));});}if(_0x1a4eb2['dialPredictiveOptimization']===_0x7bdb('0x1e6')){return _0x2ca220['getVoiceQueueRtPauses'](_0x1a4eb2['id'])[_0x7bdb('0x3e')](function(_0x5bc08b){var _0x567fa3=_0x1a4eb2[_0x7bdb('0x55')]-_0x5bc08b[0x0]['outboundQueuePauses'];var _0x5cec3b=_0x1a4eb2['dialPredictiveInterval']*0x3c;var _0x19858d=_0x1ef3da[0x0]['predictiveIntervalAvgTalktime']+_0x1ef3da[0x0][_0x7bdb('0x70')];var _0x5e4a5f=(_0x1ef3da[0x0]['predictiveIntervalAnsweredCalls']+_0x1ef3da[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1ef3da[0x0][_0x7bdb('0x8b')])/_0x1ef3da[0x0][_0x7bdb('0x78')];var _0x4ffafc=_0x1a4eb2[_0x7bdb('0x1d2')]/0x64;_0x1a4eb2[_0x7bdb('0x1ea')]=_0x5bc08b[0x0][_0x7bdb('0x1eb')]||0x0;_0x1a4eb2[_0x7bdb('0x75')]=_0x5e4a5f>0x0?_0x5e4a5f:0x1;return _0x2ca220['busyFactor'](_0x567fa3,_0x5cec3b,_0x19858d,_0x5e4a5f,_0x4ffafc);})[_0x7bdb('0x3e')](function(_0x3e1dfe){return _0x1098a5(_0x3e1dfe);})[_0x7bdb('0xbc')](function(_0xea96e7){return _0x52c6d7(msgResponse('[CatchErlangB]',_0x7bdb('0x14a'),JSON[_0x7bdb('0x131')](_0xea96e7)));});}}else{return _0x52c6d7(msgResponse('[getDataPredictive]',_0x7bdb('0x14a'),_0x7bdb('0x1e9')));}});};};Dialer['prototype'][_0x7bdb('0x1e0')]=function(_0xfc6cdb){var _0x2d5598=this;return function(){var _0x109923=0x0;var _0x33c53c=Math[_0x7bdb('0x1d5')](_0xfc6cdb[_0x7bdb('0x79')]*0x3e8);if(_0x33c53c>0x0){_0x33c53c=_0x33c53c<0x64?0x64:_0x33c53c;loggerPredictive[_0x7bdb('0x85')](_0xfc6cdb['name'],_0x7bdb('0x1ed'),_0x33c53c,'milliseconds');_0xfc6cdb['handlePredictive']=setInterval(function(){_0x2d5598['handlePredictive'](_0xfc6cdb);loggerPredictiveCalls[_0x7bdb('0x85')](_0x7bdb('0x1ee'),_0x109923+=0x1);},_0x33c53c);}else{loggerPredictive[_0x7bdb('0x85')](_0xfc6cdb['name'],_0x7bdb('0x1ef'));}};};Dialer['prototype'][_0x7bdb('0x1f0')]=function(_0x4f7097,_0xa78ce3){var _0x146f4f=this;return function(_0x85c129){if(_[_0x7bdb('0x134')](_0x85c129)){if(_[_0x7bdb('0xb8')](_0xa78ce3[_0x7bdb('0xdd')])||!_0xa78ce3[_0x7bdb('0x1f1')]){if(_0x4f7097[_0x7bdb('0x15c')]==='booked'){_0x4f7097[_0x7bdb('0x12e')]=_[_0x7bdb('0x40')](_0x4f7097[_0x7bdb('0x12e')])?!![]:_0x4f7097[_0x7bdb('0x12e')];var _0x4220ad=uuid['v4']();_0x146f4f[_0x7bdb('0x23')][_0x4220ad]=new Action(_0x4f7097,_0xa78ce3,_0x4220ad);loggerBooked[_0x7bdb('0x85')](_0x7bdb('0x1f2'),_0x4220ad,_0x7bdb('0x1f3'),JSON[_0x7bdb('0x131')](_0x4f7097[_0x7bdb('0x12e')]),'Queue:\x20',_0x4f7097[_0x7bdb('0x42')]);if(_0x4f7097[_0x7bdb('0x12e')]){_0x4f7097['queueStatusComplete']=![];_0x146f4f['queueBooked'][_0x146f4f[_0x7bdb('0x23')][_0x4220ad][_0x7bdb('0xbf')]]=[];ami[_0x7bdb('0xb9')]({'actionid':_0x4220ad,'action':_0x7bdb('0x1f4'),'queue':_0x4f7097[_0x7bdb('0x42')]})['catch'](function(){_0x146f4f['updateOriginated'](_0x4f7097);_0x146f4f[_0x7bdb('0xcb')]({'active':![],'ContactId':_0x146f4f[_0x7bdb('0x23')][_0x4220ad][_0x7bdb('0xdc')],'ListId':_0x146f4f[_0x7bdb('0x23')][_0x4220ad]['ListId'],'VoiceQueueId':_0x146f4f[_0x7bdb('0x23')][_0x4220ad][_0x7bdb('0xde')]||undefined,'CampaignId':_0x146f4f[_0x7bdb('0x23')][_0x4220ad][_0x7bdb('0xdf')]||undefined})[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x1f5')));delete _0x146f4f[_0x7bdb('0x23')][_0x4220ad];});}else{loggerBooked['info'](_0x7bdb('0x1f6'),JSON[_0x7bdb('0x131')](_0x4f7097[_0x7bdb('0x12e')]),'Queue:\x20',_0x4f7097[_0x7bdb('0x42')]);_0x146f4f[_0x7bdb('0xbe')](_0x4f7097);_0x146f4f[_0x7bdb('0xcb')]({'active':![],'ContactId':_0x146f4f[_0x7bdb('0x23')][_0x4220ad][_0x7bdb('0xdc')],'ListId':_0x146f4f['actions'][_0x4220ad][_0x7bdb('0x105')],'VoiceQueueId':_0x146f4f[_0x7bdb('0x23')][_0x4220ad][_0x7bdb('0xde')]||undefined,'CampaignId':_0x146f4f[_0x7bdb('0x23')][_0x4220ad][_0x7bdb('0xdf')]||undefined})['catch'](loggerCatch(_0x7bdb('0x1f5')));delete _0x146f4f[_0x7bdb('0x23')][_0x4220ad];}}else{return _0x146f4f[_0x7bdb('0x1f7')](_0x4f7097,_0xa78ce3);}}else{if(getDiff(_0xa78ce3['scheduledat'])<_0x4f7097[_0x7bdb('0x1f8')]*0x3c){if(_0xa78ce3[_0x7bdb('0x165')]&&!_0xa78ce3[_0x7bdb('0x165')][_0x7bdb('0x1f9')]){_0x146f4f[_0x7bdb('0x1c')][_0x7bdb('0x132')](_0xa78ce3['id'])[_0x7bdb('0x1b')](function(){_0x146f4f['updateOriginated'](_0x4f7097);});}else{_0x146f4f['unlockContact']({'active':![]},_0xa78ce3['id'],0x1)[_0x7bdb('0x1b')](function(){_0x146f4f['updateOriginated'](_0x4f7097);});}}else{_0x4f7097[_0x7bdb('0x6c')]+=0x1;_0x146f4f[_0x7bdb('0xbe')](_0x4f7097);if(_0x4f7097[_0x7bdb('0x1fa')]){_0x146f4f[_0x7bdb('0xcb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xa78ce3[_0x7bdb('0xdc')],'ListId':_0xa78ce3[_0x7bdb('0x105')],'VoiceQueueId':_0xa78ce3['VoiceQueueId']||undefined,'CampaignId':_0xa78ce3['CampaignId']||undefined})[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x1fb')));_0x146f4f[_0x7bdb('0xd6')](createObjHistory(_0x4f7097,_0xa78ce3,_0x7bdb('0x1fc'),0x17,'RecallInQueue'))[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0x1fd')));}else{_0x146f4f['saveInDb'](createObjHistory(_0x4f7097,_0xa78ce3,_0x7bdb('0x1fe'),0x16,_0x7bdb('0x1ff')),_0x7bdb('0x200'),_0x7bdb('0x201'));}}}}else{_0x4f7097[_0x7bdb('0x64')]+=0x1;_0x146f4f['saveInDb'](createObjHistory(_0x4f7097,_0xa78ce3,'BLACKLIST',0xd,'Blacklist'),_0x7bdb('0x202'),_0x7bdb('0x203'));throw _0x7bdb('0x204');}};};Dialer[_0x7bdb('0x18')][_0x7bdb('0x168')]=function(_0x5bc1f8){var _0xd2baf2=this;var _0x1dd9e7=_0x5bc1f8[_0x7bdb('0x205')]-_0x5bc1f8[_0x7bdb('0xa2')]-_0x5bc1f8[_0x7bdb('0xcf')];emitCampaignSummary(_0x5bc1f8);if(_0x1dd9e7>0x0){if(_0x1dd9e7>this['maxNumberOriginate']){_0x1dd9e7=this['maxNumberOriginate'];}_0x5bc1f8['temp']+=_0x1dd9e7;this['getContactDialerIvr'](_0x5bc1f8['id'],_0x1dd9e7,_0x5bc1f8[_0x7bdb('0x206')],_0x5bc1f8)[_0x7bdb('0x3e')](function(_0x537fa6){_0x5bc1f8['temp']-=_0x1dd9e7;_0x5bc1f8[_0x7bdb('0xcf')]=_0x5bc1f8[_0x7bdb('0xcf')]>0x0?_0x5bc1f8[_0x7bdb('0xcf')]:0x0;if(!checkContactEmpty(_0x537fa6)){_0x5bc1f8[_0x7bdb('0x44')]=_0x7bdb('0xa7');logger[_0x7bdb('0x85')](_0x7bdb('0x207')+_0x5bc1f8[_0x7bdb('0x42')]);}else{_0x5bc1f8[_0x7bdb('0xa2')]+=_0x537fa6[_0x7bdb('0xa1')];_0x5bc1f8[_0x7bdb('0x44')]=_0x7bdb('0x208');for(var _0x354613=0x0;_0x354613<_0x537fa6['length'];_0x354613+=0x1){_0x5bc1f8['ivrTotalCallsDays']+=0x1;if(_[_0x7bdb('0xb8')](_0x537fa6[_0x354613])||_[_0x7bdb('0xb8')](_0x537fa6[_0x354613][_0x7bdb('0x174')])||_[_0x7bdb('0xb8')](_0x537fa6[_0x354613][_0x7bdb('0x174')][_0x7bdb('0x175')])){_0xd2baf2[_0x7bdb('0x209')](_0x7bdb('0x20a'),_0x5bc1f8,_0x537fa6[_0x354613]);}else{_0xd2baf2[_0x7bdb('0xc6')](_[_0x7bdb('0xdb')](_0x537fa6[_0x354613],[_0x7bdb('0xdf'),'Contact.phone']))[_0x7bdb('0x3e')](_0xd2baf2[_0x7bdb('0x1f0')](_0x5bc1f8,_0x537fa6[_0x354613]))[_0x7bdb('0xbc')](_0xd2baf2[_0x7bdb('0xd9')](_0x7bdb('0x20b'),_0x5bc1f8));}}}})['catch'](loggerGetContactDialer(_0x7bdb('0x20c'),_0x5bc1f8,_0x1dd9e7));}};Dialer['prototype'][_0x7bdb('0x15e')]=function(_0xd5555b,_0x21c43f){var _0x5819ec=this;var _0x4012bb=[];var _0x1e3425=_0x21c43f>=0x1?_0x21c43f:0x1;if(_0xd5555b[_0x7bdb('0x15c')]==='booked'){_0x1e3425=0x1;}var _0x4485e0=Math[_0x7bdb('0x1d5')](_0xd5555b[_0x7bdb('0x54')]*_0x1e3425)-_0xd5555b[_0x7bdb('0xa2')]-_0xd5555b[_0x7bdb('0xcf')];emitVoiceQueueSummary(_0xd5555b);if(_0xd5555b[_0x7bdb('0x20d')]>0x0){var _0x31b42b=_0xd5555b[_0x7bdb('0x20d')]-_0xd5555b[_0x7bdb('0xa2')]-_0xd5555b[_0x7bdb('0x59')]-_0xd5555b[_0x7bdb('0xcf')]-_0xd5555b[_0x7bdb('0x56')];if(_0x4485e0>_0x31b42b){_0x4485e0=_0x31b42b;}}if(_0x4485e0>0x0){if(_0xd5555b['dialMethod']==='booked'){_0x4485e0=0x1;}if(_0x4485e0>this[_0x7bdb('0x21')]){_0x4485e0=this[_0x7bdb('0x21')];}_0xd5555b['temp']+=_0x4485e0;for(var _0x3eb803 in this[_0x7bdb('0x1f')]){if(typeof this[_0x7bdb('0x1f')][_0x3eb803]!=='undefined'){if(this[_0x7bdb('0x1f')][_0x3eb803]['state']==='not_inuse'&&this[_0x7bdb('0x1f')][_0x3eb803][_0x7bdb('0xba')]===_0x7bdb('0x20e')){_0x4012bb[_0x7bdb('0x14f')](this[_0x7bdb('0x1f')][_0x3eb803]['id']);}}}this[_0x7bdb('0x20f')](_0xd5555b['id'],_0x4012bb,_0x4485e0,_0xd5555b['dialOrderByScheduledAt'],_0xd5555b)[_0x7bdb('0x3e')](function(_0x231464){_0xd5555b[_0x7bdb('0xcf')]-=_0x4485e0;_0xd5555b[_0x7bdb('0xcf')]=_0xd5555b[_0x7bdb('0xcf')]>0x0?_0xd5555b[_0x7bdb('0xcf')]:0x0;if(!checkContactEmpty(_0x231464)){_0x5819ec[_0x7bdb('0xc1')](_0xd5555b)['then'](sendMessageReschedule(_0xd5555b))[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0xc3')));}else{_0xd5555b['originated']+=_0x231464['length'];_0xd5555b[_0x7bdb('0x44')]=_0xd5555b[_0x7bdb('0x15c')]===_0x7bdb('0x6')?'ACTIVE':_0x7bdb('0x208');for(var _0x2c953b=0x0;_0x2c953b<_0x231464[_0x7bdb('0xa1')];_0x2c953b+=0x1){if(_[_0x7bdb('0xb8')](_0x231464[_0x2c953b])||_[_0x7bdb('0xb8')](_0x231464[_0x2c953b][_0x7bdb('0x174')])||_['isNil'](_0x231464[_0x2c953b]['Contact'][_0x7bdb('0x175')])){_0x5819ec[_0x7bdb('0x209')](_0x7bdb('0x20a'),_0xd5555b,_0x231464[_0x2c953b]);}else{_0x5819ec[_0x7bdb('0xc4')](_['pick'](_0x231464[_0x2c953b],[_0x7bdb('0xde'),'Contact.phone']))['then'](_0x5819ec[_0x7bdb('0x1f0')](_0xd5555b,_0x231464[_0x2c953b]))['catch'](_0x5819ec['loggerHandler'](_0x7bdb('0x20a'),_0xd5555b));}}}})[_0x7bdb('0xbc')](loggerGetContactDialer(_0x7bdb('0x210'),_0xd5555b,_0x4485e0));}};Dialer['prototype'][_0x7bdb('0x9a')]=function(_0x17677d){if(_0x17677d['dialLimitQueue']>0x0){var _0x132d91=_0x17677d[_0x7bdb('0x20d')]-_0x17677d[_0x7bdb('0xa2')]-_0x17677d[_0x7bdb('0x59')];if(_0x132d91>0x0){this[_0x7bdb('0x211')](_0x17677d);}else{loggerPredictiveCalls[_0x7bdb('0x85')]('[handlePredictive][limitChannel]');}}else{this[_0x7bdb('0x211')](_0x17677d);}};Dialer[_0x7bdb('0x18')]['tryOriginatePredictive']=function(_0xd04047){var _0x3a073b=this;var _0x997da1=[];_0xd04047[_0x7bdb('0xa2')]+=0x1;for(var _0x5c0eab in this['agents']){if(typeof this['agents'][_0x5c0eab]!==_0x7bdb('0xa3')){if(this[_0x7bdb('0x1f')][_0x5c0eab][_0x7bdb('0xb0')]==='not_inuse'&&this['agents'][_0x5c0eab][_0x7bdb('0xba')]===_0x7bdb('0x20e')){_0x997da1['push'](this[_0x7bdb('0x1f')][_0x5c0eab]['id']);}}}this[_0x7bdb('0x20f')](_0xd04047['id'],_0x997da1,0x1,_0xd04047['dialOrderByScheduledAt'],_0xd04047)[_0x7bdb('0x3e')](function(_0x12bde9){if(!checkContactEmpty(_0x12bde9)){checkContactLowerLimitOriginate(_0xd04047,0x1,0x0);_0x3a073b[_0x7bdb('0xc1')](_0xd04047)[_0x7bdb('0x3e')](sendMessageReschedule(_0xd04047))[_0x7bdb('0xbc')](loggerCatch(_0x7bdb('0xc3')));}else{_0xd04047[_0x7bdb('0x44')]='RUNNING';if(_[_0x7bdb('0xb8')](_0x12bde9[0x0])||_['isNil'](_0x12bde9[0x0][_0x7bdb('0x174')])||_[_0x7bdb('0xb8')](_0x12bde9[0x0][_0x7bdb('0x174')]['phone'])){_0x3a073b[_0x7bdb('0x209')](_0x7bdb('0x20a'),_0xd04047,_0x12bde9[0x0]);}else{_0x3a073b['checkIsBlackList'](_['pick'](_0x12bde9[0x0],[_0x7bdb('0xde'),_0x7bdb('0x212')]))[_0x7bdb('0x3e')](_0x3a073b[_0x7bdb('0x1f0')](_0xd04047,_0x12bde9[0x0]))[_0x7bdb('0xbc')](_0x3a073b[_0x7bdb('0xd9')](_0x7bdb('0x213'),_0xd04047));}}})['catch'](loggerGetContactDialer(_0x7bdb('0x214'),_0xd04047,0x1));emitVoiceQueueSummary(_0xd04047);};Dialer[_0x7bdb('0x18')][_0x7bdb('0x1e5')]=function(_0x25626c,_0x7c82f5,_0x3afb8e,_0x38b20e,_0x59be72,_0x566c2c){loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x215'));loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x216'),_0x25626c);loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x217'),_0x7c82f5);loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x218'),_0x3afb8e);loggerPredictive['info'](_0x7bdb('0x219'),_0x38b20e);loggerPredictive[_0x7bdb('0x85')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x59be72);loggerPredictive['info'](_0x7bdb('0x8d'));return new BPromise(function(_0x2597a4,_0x5c5d98){if(_0x25626c<=0x0||isNaN(_0x25626c)){return _0x5c5d98(msgResponse('[abandonmentRate]','Error',_0x7bdb('0x21a')+_0x25626c));}if(_0x3afb8e<=0x0||isNaN(_0x3afb8e)){return _0x5c5d98(msgResponse(_0x7bdb('0x21b'),'Error','Ts\x20=\x20'+_0x3afb8e));}if(_0x38b20e<=0x0||isNaN(_0x38b20e)){return _0x5c5d98(msgResponse(_0x7bdb('0x21b'),_0x7bdb('0x4c'),'p\x20=\x20'+_0x38b20e));}if(_0x7c82f5<=0x0||isNaN(_0x7c82f5)){return _0x5c5d98(msgResponse(_0x7bdb('0x21b'),_0x7bdb('0x4c'),_0x7bdb('0x21c')+_0x7c82f5));}if(_0x59be72<=0x0||isNaN(_0x59be72)){return _0x5c5d98(msgResponse(_0x7bdb('0x21b'),'Error','Amax\x20=\x20'+_0x59be72));}_0x566c2c=_0x566c2c||0x0;var _0x56e343=0x1/_0x3afb8e;var _0x29329a=0x0;var _0x46f3de=0x0;var _0x5ec6f0=0x0;var _0x248dff=0x0;for(var _0x4746bb=0x0;_0x5ec6f0<_0x59be72;_0x4746bb+=0x1){_0x46f3de=_0x4746bb/_0x7c82f5;_0x29329a=(_0x38b20e*_0x46f3de+_0x566c2c)/_0x56e343;_0x5ec6f0=erlangb(_0x29329a,_0x25626c);_0x248dff=_0x29329a/_0x25626c*(0x1-erlangb(_0x29329a,_0x25626c));}return _0x2597a4({'erlangCalls':_0x4746bb,'erlangCallToSecond':_0x7c82f5/_0x4746bb,'erlangAbandonmentRate':_0x5ec6f0,'erlangBusyFactor':_0x248dff});});};Dialer['prototype'][_0x7bdb('0x1e7')]=function(_0x727d7f,_0x32ae5e,_0x1b6359,_0x50baa1,_0xe6ea99,_0x5806b2){loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x21d'));loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x216'),_0x727d7f);loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x217'),_0x32ae5e);loggerPredictive['info'](_0x7bdb('0x218'),_0x1b6359);loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x219'),_0x50baa1);loggerPredictive[_0x7bdb('0x85')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xe6ea99);loggerPredictive[_0x7bdb('0x85')](_0x7bdb('0x8d'));return new BPromise(function(_0x7daddb,_0x25d019){if(_0x727d7f<=0x0||isNaN(_0x727d7f)){return _0x25d019(msgResponse(_0x7bdb('0x21e'),_0x7bdb('0x4c'),_0x7bdb('0x21a')+_0x727d7f));}if(_0x1b6359<=0x0||isNaN(_0x1b6359)){return _0x25d019(msgResponse(_0x7bdb('0x21e'),'Error',_0x7bdb('0x21f')+_0x1b6359));}if(_0x50baa1<=0x0||isNaN(_0x50baa1)){return _0x25d019(msgResponse(_0x7bdb('0x21e'),_0x7bdb('0x4c'),_0x7bdb('0x220')+_0x50baa1));}if(_0x32ae5e<=0x0||isNaN(_0x32ae5e)){return _0x25d019(msgResponse(_0x7bdb('0x21e'),_0x7bdb('0x4c'),'interval\x20=\x20'+_0x32ae5e));}if(_0xe6ea99<=0x0||isNaN(_0xe6ea99)){return _0x25d019(msgResponse('[busyFactor]',_0x7bdb('0x4c'),_0x7bdb('0x221')+_0xe6ea99));}_0x5806b2=_0x5806b2||0x0;var _0x5f1499=0x1/_0x1b6359;var _0x2f2bbe=0x0;var _0x2bf95d=0x0;var _0x402862=0x0;var _0xb5c66f=0x0;for(var _0x358d52=0x0;_0xb5c66f<_0xe6ea99;_0x358d52+=0x1){_0x2bf95d=_0x358d52/_0x32ae5e;_0x2f2bbe=(_0x50baa1*_0x2bf95d+_0x5806b2)/_0x5f1499;_0x402862=erlangb(_0x2f2bbe,_0x727d7f);_0xb5c66f=_0x2f2bbe/_0x727d7f*(0x1-erlangb(_0x2f2bbe,_0x727d7f));}return _0x7daddb({'erlangCalls':_0x358d52,'erlangCallToSecond':_0x32ae5e/_0x358d52,'erlangAbandonmentRate':_0x402862,'erlangBusyFactor':_0xb5c66f});});};module[_0x7bdb('0x222')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 9da1e8f..3194aa7 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 _0xad93=['talktime','reason','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','holdtime'];(function(_0x464848,_0x5787ec){var _0x16c728=function(_0x40fde5){while(--_0x40fde5){_0x464848['push'](_0x464848['shift']());}};_0x16c728(++_0x5787ec);}(_0xad93,0x1c4));var _0x3ad9=function(_0x136f29,_0x133911){_0x136f29=_0x136f29-0x0;var _0x5c4a44=_0xad93[_0x136f29];return _0x5c4a44;};'use strict';var util=require(_0x3ad9('0x0'));var _=require(_0x3ad9('0x1'));var moment=require(_0x3ad9('0x2'));function getSeconds(_0x11f6dd,_0x58bf2c){var _0x1232f8=moment(_0x11f6dd)[_0x3ad9('0x3')](0x0);var _0x3cd235=moment(_0x58bf2c)[_0x3ad9('0x3')](0x0);return _0x1232f8[_0x3ad9('0x4')](_0x3cd235,_0x3ad9('0x5'));}function QueueCallerAbandon(_0xc23ff4,_0x13f9a4){this[_0x3ad9('0x6')]=_0xc23ff4[_0x3ad9('0x6')];this[_0x3ad9('0x7')]=_0xc23ff4[_0x3ad9('0x7')];this[_0x3ad9('0x8')]=_0xc23ff4[_0x3ad9('0x7')]===_0x3ad9('0x9')?_0x3ad9('0xa'):_0xc23ff4[_0x3ad9('0x7')];this[_0x3ad9('0xb')]=_0xc23ff4[_0x3ad9('0xb')];this[_0x3ad9('0xc')]=_0xc23ff4[_0x3ad9('0xc')];this[_0x3ad9('0xd')]=_0xc23ff4['countnoanswerretry'];this['countglobal']=_0xc23ff4[_0x3ad9('0xb')]+_0xc23ff4[_0x3ad9('0xc')]+_0xc23ff4[_0x3ad9('0xd')]+_0xc23ff4[_0x3ad9('0xe')]+_0xc23ff4[_0x3ad9('0xf')]+_0xc23ff4[_0x3ad9('0x10')]+_0xc23ff4['countmachineretry']+_0xc23ff4['countagentrejectretry'];this[_0x3ad9('0xe')]=_0xc23ff4[_0x3ad9('0xe')];this[_0x3ad9('0xf')]=_0xc23ff4[_0x3ad9('0xf')];this[_0x3ad9('0x10')]=_0xc23ff4[_0x3ad9('0x10')];this[_0x3ad9('0x11')]=_0xc23ff4[_0x3ad9('0x11')];this['countagentrejectretry']=_0xc23ff4[_0x3ad9('0x12')];this['uniqueid']=_0x13f9a4[_0x3ad9('0x13')];this['calleridname']=_0xc23ff4[_0x3ad9('0x14')];this[_0x3ad9('0x15')]=_0xc23ff4[_0x3ad9('0x16')];this[_0x3ad9('0x17')]=_0xc23ff4[_0x3ad9('0x17')];this[_0x3ad9('0x18')]=_0xc23ff4[_0x3ad9('0x18')];this[_0x3ad9('0x19')]=_0xc23ff4[_0x3ad9('0x19')];this[_0x3ad9('0x1a')]=this[_0x3ad9('0x19')];this['ringtime']=getSeconds(_0xc23ff4[_0x3ad9('0x18')],_0xc23ff4[_0x3ad9('0x17')]);this[_0x3ad9('0x1b')]=getSeconds(this[_0x3ad9('0x19')],_0xc23ff4[_0x3ad9('0x18')]);this[_0x3ad9('0x1c')]=0x0;this[_0x3ad9('0xa')]=_0x13f9a4[_0x3ad9('0xa')];this['membername']=_0x13f9a4['connectedlinename'];this[_0x3ad9('0x1d')]=_0x13f9a4['reason'];this['callback']=_0xc23ff4['callback'];this[_0x3ad9('0x1e')]=_0xc23ff4[_0x3ad9('0x1e')];this[_0x3ad9('0x1f')]=_0xc23ff4['callbackat'];this['recallme']=_0xc23ff4['recallme'];this[_0x3ad9('0x20')]=_0xc23ff4[_0x3ad9('0x20')];this[_0x3ad9('0x21')]=_0xc23ff4[_0x3ad9('0x21')];this[_0x3ad9('0x22')]=_0xc23ff4[_0x3ad9('0x22')];this[_0x3ad9('0x23')]=_0xc23ff4['VoiceQueueId'];this[_0x3ad9('0x24')]=_0xc23ff4[_0x3ad9('0x24')];this['originatecalleridnum']=_0xc23ff4[_0x3ad9('0x25')]||'';this[_0x3ad9('0x26')]=_0xc23ff4[_0x3ad9('0x26')]||'';}module[_0x3ad9('0x27')]=QueueCallerAbandon; \ No newline at end of file +var _0x779f=['talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','seconds','scheduledat','type','outbound','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countmachineretry','uniqueid','calleridname','name','starttime','responsetime','droptime'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x779f,0x9a));var _0xf779=function(_0x35c9e3,_0x26ef7c){_0x35c9e3=_0x35c9e3-0x0;var _0xf874fd=_0x779f[_0x35c9e3];return _0xf874fd;};'use strict';var util=require('util');var _=require(_0xf779('0x0'));var moment=require('moment');function getSeconds(_0x5b22a5,_0x2fd899){var _0x3c6c16=moment(_0x5b22a5)[_0xf779('0x1')](0x0);var _0x24f9a2=moment(_0x2fd899)['milliseconds'](0x0);return _0x3c6c16['diff'](_0x24f9a2,_0xf779('0x2'));}function QueueCallerAbandon(_0x5d2999,_0x2d0e0e){this['scheduledat']=_0x5d2999[_0xf779('0x3')];this[_0xf779('0x4')]=_0x5d2999[_0xf779('0x4')];this['campaigntype']=_0x5d2999[_0xf779('0x4')]===_0xf779('0x5')?'queue':_0x5d2999[_0xf779('0x4')];this[_0xf779('0x6')]=_0x5d2999['countbusyretry'];this['countcongestionretry']=_0x5d2999['countcongestionretry'];this[_0xf779('0x7')]=_0x5d2999[_0xf779('0x7')];this[_0xf779('0x8')]=_0x5d2999[_0xf779('0x6')]+_0x5d2999[_0xf779('0x9')]+_0x5d2999[_0xf779('0x7')]+_0x5d2999['countnosuchnumberretry']+_0x5d2999['countdropretry']+_0x5d2999[_0xf779('0xa')]+_0x5d2999['countmachineretry']+_0x5d2999[_0xf779('0xb')];this[_0xf779('0xc')]=_0x5d2999[_0xf779('0xc')];this['countdropretry']=_0x5d2999[_0xf779('0xd')];this[_0xf779('0xa')]=_0x5d2999[_0xf779('0xa')];this[_0xf779('0xe')]=_0x5d2999[_0xf779('0xe')];this[_0xf779('0xb')]=_0x5d2999[_0xf779('0xb')];this['uniqueid']=_0x2d0e0e[_0xf779('0xf')];this[_0xf779('0x10')]=_0x5d2999[_0xf779('0x11')];this['calleridnum']=_0x5d2999['number'];this[_0xf779('0x12')]=_0x5d2999['starttime'];this[_0xf779('0x13')]=_0x5d2999['responsetime'];this[_0xf779('0x14')]=_0x5d2999['droptime'];this['endtime']=this[_0xf779('0x14')];this['ringtime']=getSeconds(_0x5d2999[_0xf779('0x13')],_0x5d2999[_0xf779('0x12')]);this['holdtime']=getSeconds(this[_0xf779('0x14')],_0x5d2999['responsetime']);this[_0xf779('0x15')]=0x0;this['queue']=_0x2d0e0e['queue'];this['membername']=_0x2d0e0e['connectedlinename'];this[_0xf779('0x16')]=_0x2d0e0e[_0xf779('0x16')];this[_0xf779('0x17')]=_0x5d2999['callback'];this['callbackuniqueid']=_0x5d2999[_0xf779('0x18')];this[_0xf779('0x19')]=_0x5d2999[_0xf779('0x19')];this['recallme']=_0x5d2999[_0xf779('0x1a')];this[_0xf779('0x1b')]=_0x5d2999[_0xf779('0x1b')];this[_0xf779('0x1c')]=_0x5d2999[_0xf779('0x1c')];this[_0xf779('0x1d')]=_0x5d2999[_0xf779('0x1d')];this['VoiceQueueId']=_0x5d2999[_0xf779('0x1e')];this[_0xf779('0x1f')]=_0x5d2999[_0xf779('0x1f')];this[_0xf779('0x20')]=_0x5d2999[_0xf779('0x20')]||'';this[_0xf779('0x21')]=_0x5d2999[_0xf779('0x21')]||'';}module[_0xf779('0x22')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 115bb58..f498ea7 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(_0x3f6dcb,_0x27c7f9){var _0x163b9c=function(_0x35eb47){while(--_0x35eb47){_0x3f6dcb['push'](_0x3f6dcb['shift']());}};_0x163b9c(++_0x27c7f9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x54eca8,_0x253c1e){var _0x387211=function(_0x1341a0){while(--_0x1341a0){_0x54eca8['push'](_0x54eca8['shift']());}};_0x387211(++_0x253c1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 ad6b4c6..0858f1a 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 _0xbfcc=['name','.pdf','application/pdf','then','fax','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','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','variablesAction','Action','execOriginate','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','util','uuid','moment','path','tiff2pdf','./rpcDb','./channel','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','context','hasOwnProperty','uniqueid','channel','info','\x20syncNewchannel\x20','prototype','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','remotestationid','resolution','transferrate','calleridnum','pagestransferred','\x20result\x20conversion\x20file\x20','message','create','parse'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0xbfcc[_0xb833b1];return _0x1ab87a;};'use strict';var util=require(_0xcbfc('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xcbfc('0x1'));var moment=require(_0xcbfc('0x2'));var path=require(_0xcbfc('0x3'));var tiff2pdf=require(_0xcbfc('0x4'));var gs=require('./util/gs');var logger=require('../../../config/logger')('fax');var ami=require('../ami');var rpcDb=require(_0xcbfc('0x5'));var Channel=require(_0xcbfc('0x6'));var ut=require('./util/util');var Action=require(_0xcbfc('0x7'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xcbfc('0x8'));var faxMessage=require(_0xcbfc('0x9'));function Fax(_0x1b1377){this[_0xcbfc('0xa')]={};this['faxAccounts']=_0x1b1377[_0xcbfc('0xb')];this[_0xcbfc('0xc')]=_0x1b1377[_0xcbfc('0xc')];this[_0xcbfc('0xd')]={};ami['on'](_0xcbfc('0xe'),this[_0xcbfc('0xf')]['bind'](this));ami['on'](_0xcbfc('0x10'),this[_0xcbfc('0x11')][_0xcbfc('0x12')](this));ami['on'](_0xcbfc('0x13'),this[_0xcbfc('0x14')]['bind'](this));ami['on'](_0xcbfc('0x15'),this[_0xcbfc('0x16')][_0xcbfc('0x12')](this));ami['on']('faxstatus',this[_0xcbfc('0x17')][_0xcbfc('0x12')](this));ami['on'](_0xcbfc('0x18'),this[_0xcbfc('0x19')][_0xcbfc('0x12')](this));ami['on']('hangup',this[_0xcbfc('0x1a')][_0xcbfc('0x12')](this));ami['on'](_0xcbfc('0x1b'),this[_0xcbfc('0x1c')]['bind'](this));}Fax['prototype'][_0xcbfc('0xf')]=function(_0xd8bbb3){if(_0xd8bbb3[_0xcbfc('0x1d')]==='from-voip-provider'){for(var _0x5b078f in this[_0xcbfc('0xb')]){if(this[_0xcbfc('0xb')][_0xcbfc('0x1e')](_0x5b078f)){if(_0xd8bbb3['exten']===this[_0xcbfc('0xb')][_0x5b078f]['localstationid']){this[_0xcbfc('0xa')][_0xd8bbb3[_0xcbfc('0x1f')]]={};this[_0xcbfc('0xa')][_0xd8bbb3[_0xcbfc('0x1f')]][_0xcbfc('0x20')]=_0xd8bbb3[_0xcbfc('0x20')];this['channels'][_0xd8bbb3[_0xcbfc('0x1f')]]['id']=this[_0xcbfc('0xb')][_0x5b078f]['id'];this['channels'][_0xd8bbb3[_0xcbfc('0x1f')]]['name']=this['faxAccounts'][_0x5b078f]['name'];logger[_0xcbfc('0x21')](_0xd8bbb3['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0xcbfc('0xd')][_0xd8bbb3[_0xcbfc('0x1f')]]){this[_0xcbfc('0xa')][_0xd8bbb3[_0xcbfc('0x1f')]]={};this['channels'][_0xd8bbb3[_0xcbfc('0x1f')]]['channel']=_0xd8bbb3[_0xcbfc('0x20')];logger[_0xcbfc('0x21')](_0xd8bbb3['uniqueid'],_0xcbfc('0x22'));}};Fax[_0xcbfc('0x23')]['syncVarSet']=function(_0x1b2c01){if(this[_0xcbfc('0xa')][_0x1b2c01[_0xcbfc('0x1f')]]){for(var _0x41f3b8 in _0x1b2c01['variable']){if(_0x1b2c01[_0xcbfc('0x24')][_0xcbfc('0x1e')](_0x41f3b8)){this['channels'][_0x1b2c01[_0xcbfc('0x1f')]][_0x41f3b8]=_0x1b2c01[_0xcbfc('0x25')];}}}};Fax[_0xcbfc('0x23')][_0xcbfc('0x14')]=function(_0x2b4286){if(this[_0xcbfc('0xa')][_0x2b4286[_0xcbfc('0x1f')]]){this['channels'][_0x2b4286[_0xcbfc('0x1f')]][_0xcbfc('0x26')]=_0x2b4286[_0xcbfc('0x26')];this[_0xcbfc('0xa')][_0x2b4286['uniqueid']][_0xcbfc('0x27')]=_0x2b4286[_0xcbfc('0x27')];}};Fax[_0xcbfc('0x23')][_0xcbfc('0x16')]=function(_0x335f68){if(this[_0xcbfc('0xa')][_0x335f68[_0xcbfc('0x1f')]]){for(var _0x544f7c in _0x335f68[_0xcbfc('0x24')]){if(_0x335f68[_0xcbfc('0x24')]['hasOwnProperty'](_0x544f7c)){this[_0xcbfc('0xa')][_0x335f68[_0xcbfc('0x1f')]][_0x544f7c]=_0x335f68[_0xcbfc('0x25')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x4bbc63){if(this[_0xcbfc('0xa')][_0x4bbc63[_0xcbfc('0x1f')]]){this[_0xcbfc('0xa')][_0x4bbc63[_0xcbfc('0x1f')]][_0xcbfc('0x28')]=_0x4bbc63[_0xcbfc('0x28')];this[_0xcbfc('0xa')][_0x4bbc63[_0xcbfc('0x1f')]]['status']=_0x4bbc63[_0xcbfc('0x29')];this[_0xcbfc('0xa')][_0x4bbc63['uniqueid']][_0xcbfc('0x2a')]=_0x4bbc63['localstationid'];this[_0xcbfc('0xa')][_0x4bbc63[_0xcbfc('0x1f')]][_0xcbfc('0x2b')]=_0x4bbc63['filename'];logger[_0xcbfc('0x21')](_0x4bbc63['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0xcbfc('0x23')][_0xcbfc('0x19')]=function(_0x382d8b){var _0x20fc31=this;if(this[_0xcbfc('0xa')][_0x382d8b[_0xcbfc('0x1f')]]){var _0x2951f5=this[_0xcbfc('0xa')][_0x382d8b['uniqueid']]['id'];this[_0xcbfc('0xa')][_0x382d8b['uniqueid']][_0xcbfc('0x2c')]=_0x382d8b[_0xcbfc('0x2c')];this[_0xcbfc('0xa')][_0x382d8b[_0xcbfc('0x1f')]]['pagestransferred']=_0x382d8b['pagestransferred'];this[_0xcbfc('0xa')][_0x382d8b[_0xcbfc('0x1f')]][_0xcbfc('0x2a')]=_0x382d8b[_0xcbfc('0x2a')];this[_0xcbfc('0xa')][_0x382d8b['uniqueid']][_0xcbfc('0x2d')]=_0x382d8b[_0xcbfc('0x2d')];this[_0xcbfc('0xa')][_0x382d8b['uniqueid']][_0xcbfc('0x2e')]=_0x382d8b[_0xcbfc('0x2e')];this[_0xcbfc('0xa')][_0x382d8b['uniqueid']][_0xcbfc('0x2b')]=_0x382d8b[_0xcbfc('0x2b')];this[_0xcbfc('0xa')][_0x382d8b[_0xcbfc('0x1f')]][_0xcbfc('0x2f')]=_0x382d8b[_0xcbfc('0x2f')];if(this[_0xcbfc('0xa')][_0x382d8b['uniqueid']][_0xcbfc('0x30')]>0x0){tiff2pdf(_0x382d8b[_0xcbfc('0x2b')],'/var/opt/motion2/server/files/attachments/',function(_0xbd5eb){logger[_0xcbfc('0x21')](_0x382d8b[_0xcbfc('0x1f')],_0xcbfc('0x31'),_0xbd5eb[_0xcbfc('0x32')]);attachment[_0xcbfc('0x33')]({'name':path[_0xcbfc('0x34')](_0x382d8b[_0xcbfc('0x2b')])['name'],'basename':path[_0xcbfc('0x34')](_0x382d8b[_0xcbfc('0x2b')])[_0xcbfc('0x35')]+_0xcbfc('0x36'),'type':_0xcbfc('0x37')})[_0xcbfc('0x38')](function(_0x1c4d87){faxAccount['notify'](_0x2951f5,{'from':_0x382d8b[_0xcbfc('0x2f')],'mapKey':_0xcbfc('0x39'),'body':path['parse'](_0x382d8b[_0xcbfc('0x2b')])[_0xcbfc('0x35')]+_0xcbfc('0x36'),'AttachmentId':_0x1c4d87['id']})['catch'](function(_0x21b49a){logger[_0xcbfc('0x3a')](_0x382d8b[_0xcbfc('0x1f')],_0xcbfc('0x3b'),JSON[_0xcbfc('0x3c')](_0x21b49a));});})[_0xcbfc('0x3d')](function(_0x2548e1){logger['error'](_0x382d8b['uniqueid'],_0xcbfc('0x3e'),JSON[_0xcbfc('0x3c')](_0x2548e1));});});}logger[_0xcbfc('0x21')](_0x382d8b[_0xcbfc('0x1f')],'\x20receiveFax\x20');}};Fax['prototype'][_0xcbfc('0x1c')]=function(_0xe5c5ef){if(this[_0xcbfc('0xd')][_0xe5c5ef['uniqueid']]){_[_0xcbfc('0x3f')](this[_0xcbfc('0xa')][_0xe5c5ef[_0xcbfc('0x1f')]],_['pick'](_0xe5c5ef,[_0xcbfc('0x40'),_0xcbfc('0x41')]));}};function updateStatus(_0x114a8a){if(_0x114a8a[_0xcbfc('0x42')]){faxMessage[_0xcbfc('0x43')](_0x114a8a[_0xcbfc('0x42')],{'failMessage':_0xcbfc('0x44')})[_0xcbfc('0x38')](function(_0x400e15){ut[_0xcbfc('0x45')]('[Fax][Message][Error][Updated]',_0x400e15);})[_0xcbfc('0x3d')](function(_0x3a2c1a){ut[_0xcbfc('0x45')]('[Fax][Message][Error][NoUpdate1]',_0x3a2c1a);});}else{ut[_0xcbfc('0x45')](_0xcbfc('0x46'));}}Fax['prototype'][_0xcbfc('0x47')]=function(_0x5ce8e3,_0x38db76,_0x25e48d){var _0x52bd8c=this;var _0x1f7089={};if(_0x38db76){_0x1f7089={'read':_0x38db76};}else{_0x1f7089={'failMessage':_0x25e48d};}if(this[_0xcbfc('0xd')][_0x5ce8e3]['AttachmentId']){faxMessage[_0xcbfc('0x43')](this[_0xcbfc('0xd')][_0x5ce8e3][_0xcbfc('0x42')],_0x1f7089)[_0xcbfc('0x38')](function(_0x2319af){ut[_0xcbfc('0x45')](_0xcbfc('0x48'),_0x2319af);})[_0xcbfc('0x3d')](function(_0x7a16dc){ut[_0xcbfc('0x45')]('[Fax][Message][NoUpdate1]',_0x7a16dc);})[_0xcbfc('0x49')](function(){delete _0x52bd8c['channels'][_0x5ce8e3];delete _0x52bd8c['actions'][_0x5ce8e3];});}else{ut['logger'](_0xcbfc('0x4a'));delete this[_0xcbfc('0xa')][_0x5ce8e3];delete this[_0xcbfc('0xd')][_0x5ce8e3];}};Fax[_0xcbfc('0x23')][_0xcbfc('0x1a')]=function(_0x7e7e3d){var _0x21d4fa=this;if(this[_0xcbfc('0xa')][_0x7e7e3d['uniqueid']]){if(this[_0xcbfc('0xd')][_0x7e7e3d[_0xcbfc('0x1f')]]){this[_0xcbfc('0xa')][_0x7e7e3d['uniqueid']]['id']=this[_0xcbfc('0xd')][_0x7e7e3d[_0xcbfc('0x1f')]]['id'];this[_0xcbfc('0xa')][_0x7e7e3d[_0xcbfc('0x1f')]][_0xcbfc('0x35')]=this[_0xcbfc('0xd')][_0x7e7e3d[_0xcbfc('0x1f')]]['name'];}logger[_0xcbfc('0x21')](_0x7e7e3d['uniqueid'],this[_0xcbfc('0xd')][_0x7e7e3d[_0xcbfc('0x1f')]]?'\x20hangup\x20sendFile\x20':_0xcbfc('0x4b'),JSON['stringify'](this[_0xcbfc('0xa')][_0x7e7e3d[_0xcbfc('0x1f')]]));if(this[_0xcbfc('0xd')][_0x7e7e3d[_0xcbfc('0x1f')]]){if(this[_0xcbfc('0xa')][_0x7e7e3d[_0xcbfc('0x1f')]]['faxpages']>0x0&&this[_0xcbfc('0xa')][_0x7e7e3d[_0xcbfc('0x1f')]]['faxstatus']===_0xcbfc('0x4c')){this[_0xcbfc('0x47')](_0x7e7e3d[_0xcbfc('0x1f')],!![]);}else{this[_0xcbfc('0x47')](_0x7e7e3d[_0xcbfc('0x1f')],![],this[_0xcbfc('0xa')][_0x7e7e3d[_0xcbfc('0x1f')]][_0xcbfc('0x4d')]?'SENDING\x20FAILED:\x20'+this[_0xcbfc('0xa')][_0x7e7e3d[_0xcbfc('0x1f')]][_0xcbfc('0x4d')]:_0xcbfc('0x4e'));}}}};Fax[_0xcbfc('0x23')][_0xcbfc('0x4f')]=function(_0x209d61){var _0x380539=this;return new BPromise(function(_0x3fa35b,_0x32846f){_0x380539['execOriginate'](_0x209d61,_0x380539[_0xcbfc('0xb')][_0x209d61[_0xcbfc('0x50')]])['then'](function(_0x30f804){ut['logger']('[Fax][execOriginate][success]',_0x30f804);_0x3fa35b(ut[_0xcbfc('0x32')](_0xcbfc('0x51')));})[_0xcbfc('0x3d')](function(_0x133829){ut[_0xcbfc('0x45')]('[Fax][execOriginate][failure]',_0x133829);updateStatus(_0x209d61);_0x32846f(ut['message'](_0xcbfc('0x52')));});});};Fax[_0xcbfc('0x23')][_0xcbfc('0x53')]=function(_0x26cb3a){var _0x17e42f=this;return new BPromise(function(_0x53012d,_0x30380d){var _0x46fe20=_0x17e42f[_0xcbfc('0x54')](_0x17e42f['faxAccounts'][_0x26cb3a['FaxAccountId']]['Trunk'],_0x26cb3a);if(_0x46fe20[_0xcbfc('0x55')]){_0x53012d(ut['message']('Trunk\x20Reachable'));}else{_0x30380d(ut[_0xcbfc('0x32')](_0x46fe20['message']));}});};function originate(_0x99068f,_0x34e671,_0xed28ff){return new BPromise(function(_0x461e5b,_0x16d91a){if(_0xed28ff){var _0x4923e5=util[_0xcbfc('0x56')](_0xcbfc('0x57'),path[_0xcbfc('0x34')](_0x99068f['path'])[_0xcbfc('0x35')],_0x99068f[_0xcbfc('0x3')]);gs[_0xcbfc('0x58')](_0x4923e5)['then'](function(){_0x99068f[_0xcbfc('0x3')]=util[_0xcbfc('0x56')](_0xcbfc('0x59'),path[_0xcbfc('0x34')](_0x99068f[_0xcbfc('0x3')])[_0xcbfc('0x5a')],path[_0xcbfc('0x34')](_0x99068f['path'])[_0xcbfc('0x35')]);_0x34e671['XMF-PATH']=_0x99068f[_0xcbfc('0x3')];ut[_0xcbfc('0x45')](_0xcbfc('0x5b'),'');ami['Action'](ut[_0xcbfc('0x5c')](_0x99068f,_0x34e671))['then'](function(_0x3a11f9){_0x461e5b(_0x3a11f9);})[_0xcbfc('0x3d')](function(_0x174846){_0x16d91a(_0x174846);});})[_0xcbfc('0x3d')](function(_0x1fa249){_0x16d91a(_0x1fa249);});}else{ami[_0xcbfc('0x5d')](ut[_0xcbfc('0x5c')](_0x99068f,_0x34e671))['then'](function(_0x247ca4){_0x461e5b(_0x247ca4);})[_0xcbfc('0x3d')](function(_0x1d0d4f){_0x16d91a(_0x1d0d4f);});}});}Fax['prototype'][_0xcbfc('0x5e')]=function(_0x49e206,_0x189a3a){var _0x2d432=this;return new BPromise(function(_0xfe478,_0x4dcf74){var _0x2cc1ff=uuid['v4']();var _0x86855f=ut['addVariables'](_0x49e206,_0x189a3a);_0x2d432[_0xcbfc('0xd')][_0x2cc1ff]=new Action(_0x2cc1ff,_0x189a3a,_0x49e206);var _0x58be73=_0x2d432[_0xcbfc('0xd')][_0x2cc1ff];if(path['parse'](_0x49e206[_0xcbfc('0x3')])[_0xcbfc('0x5f')]==='.pdf'){originate(_0x58be73,_0x86855f,!![])[_0xcbfc('0x38')](function(_0x4cf2e1){_0xfe478(_0x4cf2e1);})[_0xcbfc('0x3d')](function(_0x2f2f6a){_0x4dcf74(_0x2f2f6a);});}else{originate(_0x58be73,_0x86855f,![])[_0xcbfc('0x38')](function(_0x5a0137){_0xfe478(_0x5a0137);})['catch'](function(_0x353302){_0x4dcf74(_0x353302);});}});};Fax['prototype'][_0xcbfc('0x60')]=function(_0x44c295){return!_[_0xcbfc('0x61')](_0x44c295)&&!_[_0xcbfc('0x61')](_0x44c295[_0xcbfc('0x35')])&&!_[_0xcbfc('0x61')](_0x44c295[_0xcbfc('0x62')])&&_0x44c295[_0xcbfc('0x62')]&&!_[_0xcbfc('0x61')](this[_0xcbfc('0xc')][util[_0xcbfc('0x56')](_0xcbfc('0x63'),_0x44c295[_0xcbfc('0x35')])])&&!_[_0xcbfc('0x61')](this[_0xcbfc('0xc')][util[_0xcbfc('0x56')](_0xcbfc('0x63'),_0x44c295['name'])][_0xcbfc('0x29')])&&(this['trunks'][util[_0xcbfc('0x56')]('SIP/%s',_0x44c295[_0xcbfc('0x35')])][_0xcbfc('0x29')]===_0xcbfc('0x64')||this[_0xcbfc('0xc')][util[_0xcbfc('0x56')](_0xcbfc('0x63'),_0x44c295[_0xcbfc('0x35')])]['status']===_0xcbfc('0x65'));};Fax['prototype'][_0xcbfc('0x54')]=function(_0x1d8745,_0x567807){if(!this['isTrunkReachable'](_0x1d8745)){ut['logger'](_0xcbfc('0x66'),_[_0xcbfc('0x61')](_0x1d8745)?'':_0x1d8745[_0xcbfc('0x35')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0xcbfc('0x61')](_0x567807[_0xcbfc('0x39')])){ut[_0xcbfc('0x45')](_0xcbfc('0x67'),JSON[_0xcbfc('0x3c')](_0x567807));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x567807['path'])){ut[_0xcbfc('0x45')](_0xcbfc('0x68'),JSON[_0xcbfc('0x3c')](_0x567807));return{'isValid':![],'message':_0xcbfc('0x69')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file +var _0xd914=['dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','isTrunkReachable','isNil','active','format','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','syncVarSet','bind','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','channelstate','channelstatedesc','variable','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20receiveFax\x20','stringify','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','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'];(function(_0x1449ce,_0x1061b7){var _0x1b1b51=function(_0x3e3f30){while(--_0x3e3f30){_0x1449ce['push'](_0x1449ce['shift']());}};_0x1b1b51(++_0x1061b7);}(_0xd914,0x17f));var _0x4d91=function(_0x1dd532,_0x36e81c){_0x1dd532=_0x1dd532-0x0;var _0x3732aa=_0xd914[_0x1dd532];return _0x3732aa;};'use strict';var util=require(_0x4d91('0x0'));var _=require(_0x4d91('0x1'));var BPromise=require('bluebird');var uuid=require(_0x4d91('0x2'));var moment=require(_0x4d91('0x3'));var path=require(_0x4d91('0x4'));var tiff2pdf=require(_0x4d91('0x5'));var gs=require(_0x4d91('0x6'));var logger=require(_0x4d91('0x7'))('fax');var ami=require(_0x4d91('0x8'));var rpcDb=require('./rpcDb');var Channel=require(_0x4d91('0x9'));var ut=require(_0x4d91('0xa'));var Action=require(_0x4d91('0xb'));var faxAccount=require(_0x4d91('0xc'));var attachment=require(_0x4d91('0xd'));var faxMessage=require(_0x4d91('0xe'));function Fax(_0x3016c0){this[_0x4d91('0xf')]={};this['faxAccounts']=_0x3016c0[_0x4d91('0x10')];this[_0x4d91('0x11')]=_0x3016c0[_0x4d91('0x11')];this[_0x4d91('0x12')]={};ami['on'](_0x4d91('0x13'),this[_0x4d91('0x14')]['bind'](this));ami['on']('varset',this[_0x4d91('0x15')][_0x4d91('0x16')](this));ami['on'](_0x4d91('0x17'),this[_0x4d91('0x18')][_0x4d91('0x16')](this));ami['on'](_0x4d91('0x19'),this['syncNewExten']['bind'](this));ami['on'](_0x4d91('0x1a'),this[_0x4d91('0x1b')][_0x4d91('0x16')](this));ami['on'](_0x4d91('0x1c'),this[_0x4d91('0x1d')][_0x4d91('0x16')](this));ami['on'](_0x4d91('0x1e'),this['syncHangup'][_0x4d91('0x16')](this));ami['on'](_0x4d91('0x1f'),this[_0x4d91('0x20')][_0x4d91('0x16')](this));}Fax[_0x4d91('0x21')]['syncNewchannel']=function(_0x1241a1){if(_0x1241a1[_0x4d91('0x22')]===_0x4d91('0x23')){for(var _0x44b9a7 in this['faxAccounts']){if(this[_0x4d91('0x10')][_0x4d91('0x24')](_0x44b9a7)){if(_0x1241a1[_0x4d91('0x25')]===this['faxAccounts'][_0x44b9a7][_0x4d91('0x26')]){this[_0x4d91('0xf')][_0x1241a1[_0x4d91('0x27')]]={};this[_0x4d91('0xf')][_0x1241a1[_0x4d91('0x27')]][_0x4d91('0x28')]=_0x1241a1[_0x4d91('0x28')];this[_0x4d91('0xf')][_0x1241a1[_0x4d91('0x27')]]['id']=this[_0x4d91('0x10')][_0x44b9a7]['id'];this['channels'][_0x1241a1[_0x4d91('0x27')]]['name']=this['faxAccounts'][_0x44b9a7][_0x4d91('0x29')];logger[_0x4d91('0x2a')](_0x1241a1[_0x4d91('0x27')],_0x4d91('0x2b'));}}}}if(this[_0x4d91('0x12')][_0x1241a1[_0x4d91('0x27')]]){this[_0x4d91('0xf')][_0x1241a1[_0x4d91('0x27')]]={};this['channels'][_0x1241a1['uniqueid']][_0x4d91('0x28')]=_0x1241a1[_0x4d91('0x28')];logger[_0x4d91('0x2a')](_0x1241a1[_0x4d91('0x27')],_0x4d91('0x2b'));}};Fax[_0x4d91('0x21')][_0x4d91('0x15')]=function(_0x560966){if(this[_0x4d91('0xf')][_0x560966[_0x4d91('0x27')]]){for(var _0x12ac74 in _0x560966['variable']){if(_0x560966['variable'][_0x4d91('0x24')](_0x12ac74)){this[_0x4d91('0xf')][_0x560966['uniqueid']][_0x12ac74]=_0x560966['value'];}}}};Fax[_0x4d91('0x21')][_0x4d91('0x18')]=function(_0x43371e){if(this[_0x4d91('0xf')][_0x43371e['uniqueid']]){this[_0x4d91('0xf')][_0x43371e[_0x4d91('0x27')]][_0x4d91('0x2c')]=_0x43371e[_0x4d91('0x2c')];this[_0x4d91('0xf')][_0x43371e[_0x4d91('0x27')]][_0x4d91('0x2d')]=_0x43371e['channelstatedesc'];}};Fax[_0x4d91('0x21')]['syncNewExten']=function(_0x4ad7bf){if(this[_0x4d91('0xf')][_0x4ad7bf[_0x4d91('0x27')]]){for(var _0x4f95f0 in _0x4ad7bf[_0x4d91('0x2e')]){if(_0x4ad7bf[_0x4d91('0x2e')][_0x4d91('0x24')](_0x4f95f0)){this[_0x4d91('0xf')][_0x4ad7bf[_0x4d91('0x27')]][_0x4f95f0]=_0x4ad7bf['value'];}}}};Fax[_0x4d91('0x21')][_0x4d91('0x1b')]=function(_0x36d7e0){if(this[_0x4d91('0xf')][_0x36d7e0[_0x4d91('0x27')]]){this[_0x4d91('0xf')][_0x36d7e0['uniqueid']][_0x4d91('0x2f')]=_0x36d7e0[_0x4d91('0x2f')];this['channels'][_0x36d7e0[_0x4d91('0x27')]][_0x4d91('0x30')]=_0x36d7e0[_0x4d91('0x30')];this['channels'][_0x36d7e0[_0x4d91('0x27')]][_0x4d91('0x26')]=_0x36d7e0[_0x4d91('0x26')];this[_0x4d91('0xf')][_0x36d7e0['uniqueid']][_0x4d91('0x31')]=_0x36d7e0[_0x4d91('0x31')];logger[_0x4d91('0x2a')](_0x36d7e0[_0x4d91('0x27')],'\x20syncFaxStatus\x20');}};Fax['prototype'][_0x4d91('0x1d')]=function(_0x3dac76){var _0x524052=this;if(this[_0x4d91('0xf')][_0x3dac76[_0x4d91('0x27')]]){var _0x197ea6=this[_0x4d91('0xf')][_0x3dac76['uniqueid']]['id'];this[_0x4d91('0xf')][_0x3dac76[_0x4d91('0x27')]]['remotestationid']=_0x3dac76[_0x4d91('0x32')];this['channels'][_0x3dac76[_0x4d91('0x27')]]['pagestransferred']=_0x3dac76[_0x4d91('0x33')];this['channels'][_0x3dac76[_0x4d91('0x27')]][_0x4d91('0x26')]=_0x3dac76[_0x4d91('0x26')];this[_0x4d91('0xf')][_0x3dac76['uniqueid']]['resolution']=_0x3dac76[_0x4d91('0x34')];this['channels'][_0x3dac76[_0x4d91('0x27')]][_0x4d91('0x35')]=_0x3dac76['transferrate'];this[_0x4d91('0xf')][_0x3dac76[_0x4d91('0x27')]][_0x4d91('0x31')]=_0x3dac76[_0x4d91('0x31')];this[_0x4d91('0xf')][_0x3dac76[_0x4d91('0x27')]][_0x4d91('0x36')]=_0x3dac76['calleridnum'];if(this[_0x4d91('0xf')][_0x3dac76['uniqueid']][_0x4d91('0x33')]>0x0){tiff2pdf(_0x3dac76[_0x4d91('0x31')],_0x4d91('0x37'),function(_0x2483c4){logger[_0x4d91('0x2a')](_0x3dac76[_0x4d91('0x27')],'\x20result\x20conversion\x20file\x20',_0x2483c4['message']);attachment[_0x4d91('0x38')]({'name':path[_0x4d91('0x39')](_0x3dac76['filename'])[_0x4d91('0x29')],'basename':path[_0x4d91('0x39')](_0x3dac76[_0x4d91('0x31')])[_0x4d91('0x29')]+_0x4d91('0x3a'),'type':_0x4d91('0x3b')})[_0x4d91('0x3c')](function(_0x971da4){faxAccount[_0x4d91('0x3d')](_0x197ea6,{'from':_0x3dac76['calleridnum'],'mapKey':'fax','body':path[_0x4d91('0x39')](_0x3dac76['filename'])[_0x4d91('0x29')]+_0x4d91('0x3a'),'AttachmentId':_0x971da4['id']})[_0x4d91('0x3e')](function(_0x10b1bb){logger['error'](_0x3dac76[_0x4d91('0x27')],'\x20notify\x20',JSON['stringify'](_0x10b1bb));});})[_0x4d91('0x3e')](function(_0xfd7c52){logger[_0x4d91('0x3f')](_0x3dac76[_0x4d91('0x27')],_0x4d91('0x40'),JSON[_0x4d91('0x41')](_0xfd7c52));});});}logger['info'](_0x3dac76[_0x4d91('0x27')],_0x4d91('0x40'));}};Fax[_0x4d91('0x21')][_0x4d91('0x20')]=function(_0x106e5b){if(this[_0x4d91('0x12')][_0x106e5b[_0x4d91('0x27')]]){_[_0x4d91('0x42')](this[_0x4d91('0xf')][_0x106e5b[_0x4d91('0x27')]],_[_0x4d91('0x43')](_0x106e5b,['response',_0x4d91('0x44')]));}};function updateStatus(_0x5a5c03){if(_0x5a5c03[_0x4d91('0x45')]){faxMessage[_0x4d91('0x46')](_0x5a5c03[_0x4d91('0x45')],{'failMessage':_0x4d91('0x47')})[_0x4d91('0x3c')](function(_0x3edc43){ut[_0x4d91('0x48')](_0x4d91('0x49'),_0x3edc43);})['catch'](function(_0x63f708){ut[_0x4d91('0x48')](_0x4d91('0x4a'),_0x63f708);});}else{ut[_0x4d91('0x48')](_0x4d91('0x4b'));}}Fax[_0x4d91('0x21')][_0x4d91('0x4c')]=function(_0x4aae23,_0x392cc3,_0x2159e4){var _0x413b25=this;var _0x4382ff={};if(_0x392cc3){_0x4382ff={'read':_0x392cc3};}else{_0x4382ff={'failMessage':_0x2159e4};}if(this[_0x4d91('0x12')][_0x4aae23][_0x4d91('0x45')]){faxMessage[_0x4d91('0x46')](this[_0x4d91('0x12')][_0x4aae23][_0x4d91('0x45')],_0x4382ff)[_0x4d91('0x3c')](function(_0x8339dd){ut[_0x4d91('0x48')](_0x4d91('0x4d'),_0x8339dd);})[_0x4d91('0x3e')](function(_0x3e9154){ut[_0x4d91('0x48')](_0x4d91('0x4e'),_0x3e9154);})['finally'](function(){delete _0x413b25['channels'][_0x4aae23];delete _0x413b25['actions'][_0x4aae23];});}else{ut[_0x4d91('0x48')](_0x4d91('0x4f'));delete this[_0x4d91('0xf')][_0x4aae23];delete this['actions'][_0x4aae23];}};Fax[_0x4d91('0x21')][_0x4d91('0x50')]=function(_0x3985f3){var _0x4ac087=this;if(this['channels'][_0x3985f3['uniqueid']]){if(this[_0x4d91('0x12')][_0x3985f3[_0x4d91('0x27')]]){this[_0x4d91('0xf')][_0x3985f3[_0x4d91('0x27')]]['id']=this[_0x4d91('0x12')][_0x3985f3['uniqueid']]['id'];this[_0x4d91('0xf')][_0x3985f3[_0x4d91('0x27')]]['name']=this['actions'][_0x3985f3[_0x4d91('0x27')]]['name'];}logger[_0x4d91('0x2a')](_0x3985f3[_0x4d91('0x27')],this[_0x4d91('0x12')][_0x3985f3['uniqueid']]?_0x4d91('0x51'):_0x4d91('0x52'),JSON[_0x4d91('0x41')](this[_0x4d91('0xf')][_0x3985f3[_0x4d91('0x27')]]));if(this[_0x4d91('0x12')][_0x3985f3[_0x4d91('0x27')]]){if(this['channels'][_0x3985f3['uniqueid']]['faxpages']>0x0&&this['channels'][_0x3985f3[_0x4d91('0x27')]][_0x4d91('0x1a')]===_0x4d91('0x53')){this['updateStatus'](_0x3985f3[_0x4d91('0x27')],!![]);}else{this['updateStatus'](_0x3985f3[_0x4d91('0x27')],![],this[_0x4d91('0xf')][_0x3985f3['uniqueid']]['faxstatusstring']?_0x4d91('0x54')+this[_0x4d91('0xf')][_0x3985f3[_0x4d91('0x27')]][_0x4d91('0x55')]:_0x4d91('0x56'));}}}};Fax[_0x4d91('0x21')][_0x4d91('0x57')]=function(_0x42e550){var _0xd384a9=this;return new BPromise(function(_0xd660b3,_0x5bfb08){_0xd384a9['execOriginate'](_0x42e550,_0xd384a9[_0x4d91('0x10')][_0x42e550[_0x4d91('0x58')]])[_0x4d91('0x3c')](function(_0x13281d){ut[_0x4d91('0x48')](_0x4d91('0x59'),_0x13281d);_0xd660b3(ut[_0x4d91('0x5a')](_0x4d91('0x5b')));})[_0x4d91('0x3e')](function(_0x564885){ut['logger']('[Fax][execOriginate][failure]',_0x564885);updateStatus(_0x42e550);_0x5bfb08(ut['message'](_0x4d91('0x5c')));});});};Fax[_0x4d91('0x21')][_0x4d91('0x5d')]=function(_0x12f7de){var _0x8565e3=this;return new BPromise(function(_0x12fa2e,_0x37710b){var _0xa1b6e5=_0x8565e3[_0x4d91('0x5e')](_0x8565e3[_0x4d91('0x10')][_0x12f7de[_0x4d91('0x58')]][_0x4d91('0x5f')],_0x12f7de);if(_0xa1b6e5[_0x4d91('0x60')]){_0x12fa2e(ut[_0x4d91('0x5a')](_0x4d91('0x61')));}else{_0x37710b(ut[_0x4d91('0x5a')](_0xa1b6e5[_0x4d91('0x5a')]));}});};function originate(_0x5b3a38,_0x4062c6,_0x1be4b1){return new BPromise(function(_0xc4ef10,_0x2e2105){if(_0x1be4b1){var _0x1cad5b=util['format'](_0x4d91('0x62'),path[_0x4d91('0x39')](_0x5b3a38['path'])[_0x4d91('0x29')],_0x5b3a38[_0x4d91('0x4')]);gs[_0x4d91('0x63')](_0x1cad5b)[_0x4d91('0x3c')](function(){_0x5b3a38[_0x4d91('0x4')]=util['format'](_0x4d91('0x64'),path[_0x4d91('0x39')](_0x5b3a38['path'])[_0x4d91('0x65')],path[_0x4d91('0x39')](_0x5b3a38[_0x4d91('0x4')])['name']);_0x4062c6[_0x4d91('0x66')]=_0x5b3a38[_0x4d91('0x4')];ut[_0x4d91('0x48')](_0x4d91('0x67'),'');ami[_0x4d91('0x68')](ut[_0x4d91('0x69')](_0x5b3a38,_0x4062c6))[_0x4d91('0x3c')](function(_0x4fcc58){_0xc4ef10(_0x4fcc58);})[_0x4d91('0x3e')](function(_0x2e014b){_0x2e2105(_0x2e014b);});})['catch'](function(_0x221e44){_0x2e2105(_0x221e44);});}else{ami['Action'](ut['variablesAction'](_0x5b3a38,_0x4062c6))[_0x4d91('0x3c')](function(_0x4b19e2){_0xc4ef10(_0x4b19e2);})[_0x4d91('0x3e')](function(_0x1a4a33){_0x2e2105(_0x1a4a33);});}});}Fax[_0x4d91('0x21')][_0x4d91('0x6a')]=function(_0x10211f,_0x3fa0e0){var _0x17e61c=this;return new BPromise(function(_0x497f84,_0x485da1){var _0x1c27e7=uuid['v4']();var _0x431223=ut[_0x4d91('0x6b')](_0x10211f,_0x3fa0e0);_0x17e61c[_0x4d91('0x12')][_0x1c27e7]=new Action(_0x1c27e7,_0x3fa0e0,_0x10211f);var _0x1e3838=_0x17e61c['actions'][_0x1c27e7];if(path['parse'](_0x10211f[_0x4d91('0x4')])['ext']==='.pdf'){originate(_0x1e3838,_0x431223,!![])[_0x4d91('0x3c')](function(_0x54fea8){_0x497f84(_0x54fea8);})['catch'](function(_0x216c33){_0x485da1(_0x216c33);});}else{originate(_0x1e3838,_0x431223,![])[_0x4d91('0x3c')](function(_0x1987fa){_0x497f84(_0x1987fa);})['catch'](function(_0x5028c5){_0x485da1(_0x5028c5);});}});};Fax['prototype'][_0x4d91('0x6c')]=function(_0x8d84f3){return!_[_0x4d91('0x6d')](_0x8d84f3)&&!_[_0x4d91('0x6d')](_0x8d84f3[_0x4d91('0x29')])&&!_[_0x4d91('0x6d')](_0x8d84f3[_0x4d91('0x6e')])&&_0x8d84f3[_0x4d91('0x6e')]&&!_[_0x4d91('0x6d')](this['trunks'][util[_0x4d91('0x6f')]('SIP/%s',_0x8d84f3['name'])])&&!_[_0x4d91('0x6d')](this[_0x4d91('0x11')][util[_0x4d91('0x6f')](_0x4d91('0x70'),_0x8d84f3['name'])][_0x4d91('0x30')])&&(this[_0x4d91('0x11')][util[_0x4d91('0x6f')](_0x4d91('0x70'),_0x8d84f3[_0x4d91('0x29')])][_0x4d91('0x30')]===_0x4d91('0x71')||this['trunks'][util[_0x4d91('0x6f')](_0x4d91('0x70'),_0x8d84f3[_0x4d91('0x29')])]['status']===_0x4d91('0x72'));};Fax[_0x4d91('0x21')][_0x4d91('0x5e')]=function(_0x2f4796,_0xb3688a){if(!this[_0x4d91('0x6c')](_0x2f4796)){ut['logger'](_0x4d91('0x73'),_['isNil'](_0x2f4796)?'':_0x2f4796[_0x4d91('0x29')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x4d91('0x74')};}if(_[_0x4d91('0x6d')](_0xb3688a['fax'])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x4d91('0x41')](_0xb3688a));return{'isValid':![],'message':_0x4d91('0x75')};}if(_[_0x4d91('0x6d')](_0xb3688a[_0x4d91('0x4')])){ut[_0x4d91('0x48')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0xb3688a));return{'isValid':![],'message':_0x4d91('0x76')};}return{'isValid':!![],'message':_0x4d91('0x77')};};module[_0x4d91('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 ba98c3f..a0599ef 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 _0xf8db=['error','inspect','resolve','then','notify','catch','bluebird','preview','lodash','../rpc/faxAccount'];(function(_0x2866c1,_0x49347c){var _0x3875be=function(_0x21dbf2){while(--_0x21dbf2){_0x2866c1['push'](_0x2866c1['shift']());}};_0x3875be(++_0x49347c);}(_0xf8db,0x18c));var _0xbf8d=function(_0x735da9,_0x38b186){_0x735da9=_0x735da9-0x0;var _0x39160b=_0xf8db[_0x735da9];return _0x39160b;};'use strict';var util=require('util');var BPromise=require(_0xbf8d('0x0'));var logger=require('../../../config/logger')(_0xbf8d('0x1'));var _=require(_0xbf8d('0x2'));var faxAccount=require(_0xbf8d('0x3'));function loggerCatch(_0x5e591a){return function(_0x4a2f42){logger[_0xbf8d('0x4')](_0x5e591a,util[_0xbf8d('0x5')](_0x4a2f42,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x22d277,_0x49acaf){return BPromise[_0xbf8d('0x6')]()[_0xbf8d('0x7')](faxAccount[_0xbf8d('0x8')](_0x22d277,_0x49acaf))[_0xbf8d('0x9')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x9d46=['inspect','notify','then','catch','util','bluebird','preview','lodash','../rpc/faxAccount'];(function(_0x3c8ede,_0xf49f1f){var _0x162d63=function(_0x25c1e1){while(--_0x25c1e1){_0x3c8ede['push'](_0x3c8ede['shift']());}};_0x162d63(++_0xf49f1f);}(_0x9d46,0x187));var _0x69d4=function(_0x284e84,_0x4ed7fd){_0x284e84=_0x284e84-0x0;var _0x366baf=_0x9d46[_0x284e84];return _0x366baf;};'use strict';var util=require(_0x69d4('0x0'));var BPromise=require(_0x69d4('0x1'));var logger=require('../../../config/logger')(_0x69d4('0x2'));var _=require(_0x69d4('0x3'));var faxAccount=require(_0x69d4('0x4'));function loggerCatch(_0x167f8e){return function(_0x42454c){logger['error'](_0x167f8e,util[_0x69d4('0x5')](_0x42454c,{'showHidden':![],'depth':null}));};}exports[_0x69d4('0x6')]=function(_0x267e4a,_0x292131){return BPromise['resolve']()[_0x69d4('0x7')](faxAccount['notify'](_0x267e4a,_0x292131))[_0x69d4('0x8')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index c71d936..d7bb0c7 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 _0xc5ab=['Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax','bluebird','exec','execute','info'];(function(_0x4f1c6c,_0x1e8f52){var _0x1d9e2a=function(_0xbd0746){while(--_0xbd0746){_0x4f1c6c['push'](_0x4f1c6c['shift']());}};_0x1d9e2a(++_0x1e8f52);}(_0xc5ab,0xfe));var _0xbc5a=function(_0x465af5,_0x220063){_0x465af5=_0x465af5-0x0;var _0x520a68=_0xc5ab[_0x465af5];return _0x520a68;};'use strict';var util=require(_0xbc5a('0x0'));var logger=require(_0xbc5a('0x1'))(_0xbc5a('0x2'));var BPromise=require(_0xbc5a('0x3'));var exec=require('child_process')[_0xbc5a('0x4')];exports[_0xbc5a('0x5')]=function(_0x2e0a77){return new BPromise(function(_0x1e2778,_0x1a19d8){exec(_0x2e0a77,function(_0x24f3d1,_0x463bd5,_0x55e577){logger[_0xbc5a('0x6')](_0xbc5a('0x7'),_0x463bd5);if(_0x24f3d1){logger['info'](_0xbc5a('0x7'),_0xbc5a('0x8'),util['inspect'](_0x24f3d1,{'showHidden':![],'depth':null}),_0x463bd5,_0x55e577);_0x1a19d8(_0x24f3d1);}_0x1e2778(_0x463bd5);});});}; \ No newline at end of file +var _0xa007=['util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','inspect'];(function(_0x1535d7,_0x27ceb4){var _0xccccfb=function(_0x1cbe47){while(--_0x1cbe47){_0x1535d7['push'](_0x1535d7['shift']());}};_0xccccfb(++_0x27ceb4);}(_0xa007,0x15e));var _0x7a00=function(_0x284622,_0x1e419f){_0x284622=_0x284622-0x0;var _0x4d48d6=_0xa007[_0x284622];return _0x4d48d6;};'use strict';var util=require(_0x7a00('0x0'));var logger=require(_0x7a00('0x1'))(_0x7a00('0x2'));var BPromise=require(_0x7a00('0x3'));var exec=require(_0x7a00('0x4'))[_0x7a00('0x5')];exports[_0x7a00('0x6')]=function(_0x3ab66c){return new BPromise(function(_0x40084b,_0x4d9c3e){exec(_0x3ab66c,function(_0x9a1270,_0x223781,_0x49b76d){logger[_0x7a00('0x7')](_0x7a00('0x8'),_0x223781);if(_0x9a1270){logger[_0x7a00('0x7')](_0x7a00('0x8'),'\x20Error\x20:',util[_0x7a00('0x9')](_0x9a1270,{'showHidden':![],'depth':null}),_0x223781,_0x49b76d);_0x4d9c3e(_0x9a1270);}_0x40084b(_0x223781);});});}; \ 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 8a09dd6..9a2776f 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 _0xeebd=['t38timeout','path','variablesAction','uniqueid','originate','channel','\x22%s\x22\x20<%s>','headerinfo','localstationid','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect'];(function(_0x2dacca,_0x3b55a5){var _0x4e8745=function(_0x4c4515){while(--_0x4c4515){_0x2dacca['push'](_0x2dacca['shift']());}};_0x4e8745(++_0x3b55a5);}(_0xeebd,0x117));var _0xdeeb=function(_0x5ab09b,_0x47e1f2){_0x5ab09b=_0x5ab09b-0x0;var _0x478ccf=_0xeebd[_0x5ab09b];return _0x478ccf;};'use strict';var util=require(_0xdeeb('0x0'));var _=require(_0xdeeb('0x1'));var moment=require(_0xdeeb('0x2'));var logger=require(_0xdeeb('0x3'))(_0xdeeb('0x4'));exports[_0xdeeb('0x5')]=function(_0x58534d){return{'message':_0x58534d};};exports[_0xdeeb('0x6')]=function(_0x3591b3,_0x487514){logger[_0xdeeb('0x7')](_0x3591b3,util[_0xdeeb('0x8')](_0x487514,{'showHidden':![],'depth':null}));};exports[_0xdeeb('0x9')]=function(_0x3853f5,_0x596aa4){var _0x737906={'XMF-ECM':_0x596aa4[_0xdeeb('0xa')],'XMF-HEADERINFO':_0x596aa4['headerinfo'],'XMF-MINRATE':_0x596aa4[_0xdeeb('0xb')],'XMF-MAXRATE':_0x596aa4[_0xdeeb('0xc')],'XMF-MODEM':util[_0xdeeb('0xd')](_0xdeeb('0xe'),_0x596aa4[_0xdeeb('0xf')]),'XMF-GATEWAY':_0x596aa4[_0xdeeb('0x10')],'XMF-FAXDETECT':_0x596aa4[_0xdeeb('0x11')],'XMF-T38TIMEOUT':_0x596aa4[_0xdeeb('0x12')],'XMF-LOCALSTATIONID':_0x596aa4['localstationid'],'XMF-PATH':_0x3853f5[_0xdeeb('0x13')]};return _0x737906;};exports[_0xdeeb('0x14')]=function(_0x5f15ec,_0x151a3e){return{'actionid':_0x5f15ec[_0xdeeb('0x15')],'action':_0xdeeb('0x16'),'channel':_0x5f15ec[_0xdeeb('0x17')],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0xdeeb('0xd')](_0xdeeb('0x18'),_0x5f15ec['headerinfo']?_0x5f15ec[_0xdeeb('0x19')]:'',_0x5f15ec[_0xdeeb('0x1a')]),'variable':_0x151a3e,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5f15ec[_0xdeeb('0x15')]};}; \ No newline at end of file +var _0x2eca=['from-sip','uniqueid','util','lodash','../../../../config/logger','fax','message','logger','info','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','t38timeout','localstationid','path','channel','xcally-motion-fax'];(function(_0x7f6e35,_0x4442a9){var _0x23a4e3=function(_0x2fcd84){while(--_0x2fcd84){_0x7f6e35['push'](_0x7f6e35['shift']());}};_0x23a4e3(++_0x4442a9);}(_0x2eca,0x191));var _0xa2ec=function(_0x2b338b,_0x4a06ba){_0x2b338b=_0x2b338b-0x0;var _0x256f66=_0x2eca[_0x2b338b];return _0x256f66;};'use strict';var util=require(_0xa2ec('0x0'));var _=require(_0xa2ec('0x1'));var moment=require('moment');var logger=require(_0xa2ec('0x2'))(_0xa2ec('0x3'));exports[_0xa2ec('0x4')]=function(_0x55c06f){return{'message':_0x55c06f};};exports[_0xa2ec('0x5')]=function(_0x20730f,_0x5564b1){logger[_0xa2ec('0x6')](_0x20730f,util['inspect'](_0x5564b1,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x849504,_0x4bb4ee){var _0x513c32={'XMF-ECM':_0x4bb4ee['ecm'],'XMF-HEADERINFO':_0x4bb4ee[_0xa2ec('0x7')],'XMF-MINRATE':_0x4bb4ee[_0xa2ec('0x8')],'XMF-MAXRATE':_0x4bb4ee[_0xa2ec('0x9')],'XMF-MODEM':util[_0xa2ec('0xa')](_0xa2ec('0xb'),_0x4bb4ee[_0xa2ec('0xc')]),'XMF-GATEWAY':_0x4bb4ee[_0xa2ec('0xd')],'XMF-FAXDETECT':_0x4bb4ee['faxdetect'],'XMF-T38TIMEOUT':_0x4bb4ee[_0xa2ec('0xe')],'XMF-LOCALSTATIONID':_0x4bb4ee[_0xa2ec('0xf')],'XMF-PATH':_0x849504[_0xa2ec('0x10')]};return _0x513c32;};exports['variablesAction']=function(_0x1a8e40,_0x420052){return{'actionid':_0x1a8e40['uniqueid'],'action':'originate','channel':_0x1a8e40[_0xa2ec('0x11')],'Exten':_0xa2ec('0x12'),'Context':_0xa2ec('0x13'),'Priority':'1','callerid':util[_0xa2ec('0xa')]('\x22%s\x22\x20<%s>',_0x1a8e40[_0xa2ec('0x7')]?_0x1a8e40[_0xa2ec('0x7')]:'',_0x1a8e40[_0xa2ec('0xf')]),'variable':_0x420052,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1a8e40[_0xa2ec('0x14')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index ef5b9c8..03b9f2a 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 _0x01e1=['getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','inspect','listen','sync','[index.js][main]','bluebird','util','moment','./server','./realtime','./report','./acw','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','get','hour','resolve','then','initAgents','getTelephones','initTelephones'];(function(_0x4262a2,_0x223d0e){var _0x5d82c5=function(_0x5ea373){while(--_0x5ea373){_0x4262a2['push'](_0x4262a2['shift']());}};_0x5d82c5(++_0x223d0e);}(_0x01e1,0xff));var _0x101e=function(_0x2f80ba,_0x32eb33){_0x2f80ba=_0x2f80ba-0x0;var _0x3f17d1=_0x01e1[_0x2f80ba];return _0x3f17d1;};'use strict';var BPromise=require(_0x101e('0x0'));var util=require(_0x101e('0x1'));var moment=require(_0x101e('0x2'));var server=require(_0x101e('0x3'));var Realtime=require(_0x101e('0x4'));var Report=require(_0x101e('0x5'));var Acw=require(_0x101e('0x6'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0x101e('0x7'));var Fax=require(_0x101e('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0x101e('0x9'));var voiceQueueReport=require(_0x101e('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x101e('0xb'));var trigger=require(_0x101e('0xc'));var template=require(_0x101e('0xd'));var cmHopperHistory=require(_0x101e('0xe'));var campaign=require(_0x101e('0xf'));var voiceExtension=require(_0x101e('0x10'));var faxAccount=require(_0x101e('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x101e('0x12'));var sugarcrm=require(_0x101e('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x101e('0x14'));var zoho=require(_0x101e('0x15'));var vtiger=require(_0x101e('0x16'));var freshsales=require(_0x101e('0x17'));var servicenow=require(_0x101e('0x18'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x101e('0x19'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x101e('0x1a')](_0x101e('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x101e('0x1a')](_0x101e('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x101e('0x1c')]()['then'](user['getAgents']())[_0x101e('0x1d')](realtime[_0x101e('0x1e')]())[_0x101e('0x1d')](user[_0x101e('0x1f')]())[_0x101e('0x1d')](realtime[_0x101e('0x20')]())[_0x101e('0x1d')](trunk[_0x101e('0x21')]())[_0x101e('0x1d')](realtime[_0x101e('0x22')]())[_0x101e('0x1d')](voiceQueue[_0x101e('0x23')]())[_0x101e('0x1d')](realtime[_0x101e('0x24')]())['then'](trigger['getTriggers']())[_0x101e('0x1d')](realtime[_0x101e('0x25')]())[_0x101e('0x1d')](template['getTemplates']())[_0x101e('0x1d')](realtime[_0x101e('0x26')]())[_0x101e('0x1d')](zendesk[_0x101e('0x27')]())[_0x101e('0x1d')](realtime[_0x101e('0x28')]())[_0x101e('0x1d')](salesforce[_0x101e('0x29')]())[_0x101e('0x1d')](realtime[_0x101e('0x2a')]())[_0x101e('0x1d')](sugarcrm['getSugarcrmAccounts']())[_0x101e('0x1d')](realtime[_0x101e('0x2b')]())[_0x101e('0x1d')](freshdesk[_0x101e('0x2c')]())[_0x101e('0x1d')](realtime[_0x101e('0x2d')]())[_0x101e('0x1d')](desk[_0x101e('0x2e')]())[_0x101e('0x1d')](realtime[_0x101e('0x2f')]())[_0x101e('0x1d')](zoho[_0x101e('0x30')]())[_0x101e('0x1d')](realtime[_0x101e('0x31')]())[_0x101e('0x1d')](vtiger['getVtigerAccounts']())[_0x101e('0x1d')](realtime[_0x101e('0x32')]())[_0x101e('0x1d')](freshsales[_0x101e('0x33')]())['then'](realtime['initFreshsalesAccounts']())[_0x101e('0x1d')](servicenow[_0x101e('0x34')]())[_0x101e('0x1d')](realtime[_0x101e('0x35')]())['then'](dynamics365['getDynamics365Accounts']())[_0x101e('0x1d')](realtime['initDynamics365Accounts']())[_0x101e('0x1d')](campaign['getCampaigns']())[_0x101e('0x1d')](realtime[_0x101e('0x36')]())[_0x101e('0x1d')](voiceExtension[_0x101e('0x37')]())[_0x101e('0x1d')](realtime[_0x101e('0x38')]())['then'](faxAccount[_0x101e('0x39')]())[_0x101e('0x1d')](realtime[_0x101e('0x3a')]())['then'](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x101e('0x1d')](voiceQueueReport[_0x101e('0x3b')]())[_0x101e('0x1d')](realtime[_0x101e('0x3c')]())['then'](cmHopperHistory[_0x101e('0x3d')]())['then'](realtime[_0x101e('0x3e')]())[_0x101e('0x1d')](cmHopperHistory[_0x101e('0x3f')]())[_0x101e('0x1d')](realtime['initCampaignHopperHistory']())[_0x101e('0x1d')](voiceCallReport[_0x101e('0x40')]())[_0x101e('0x1d')](realtime[_0x101e('0x41')]())[_0x101e('0x42')](function(_0x192a63){logger[_0x101e('0x43')]('[index.js][initParams]',util[_0x101e('0x44')](_0x192a63,{'showHidden':![],'depth':null}));});}function main(){return server[_0x101e('0x45')](realtime,preview,fax)[_0x101e('0x1d')](function(_0xfc4cb9){return initRealtime();})[_0x101e('0x1d')](function(){return initParams();})['then'](function(){report[_0x101e('0x46')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x314577){logger['error'](_0x101e('0x47'),util['inspect'](_0x314577,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x2507=['./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','ami','get','hour','resolve','getAgents','then','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','sync','[index.js][main]','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger'];(function(_0x2292c2,_0x1d0ab9){var _0x36ec44=function(_0x373b67){while(--_0x373b67){_0x2292c2['push'](_0x2292c2['shift']());}};_0x36ec44(++_0x1d0ab9);}(_0x2507,0xca));var _0x7250=function(_0x8c6ed2,_0x4c2099){_0x8c6ed2=_0x8c6ed2-0x0;var _0x40b793=_0x2507[_0x8c6ed2];return _0x40b793;};'use strict';var BPromise=require(_0x7250('0x0'));var util=require(_0x7250('0x1'));var moment=require(_0x7250('0x2'));var server=require(_0x7250('0x3'));var Realtime=require(_0x7250('0x4'));var Report=require(_0x7250('0x5'));var Acw=require(_0x7250('0x6'));var Trigger=require(_0x7250('0x7'));var Dialer=require(_0x7250('0x8'));var Preview=require(_0x7250('0x9'));var Fax=require(_0x7250('0xa'));var user=require('./rpc/user');var voiceQueue=require(_0x7250('0xb'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x7250('0xc'));var trigger=require(_0x7250('0xd'));var template=require(_0x7250('0xe'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x7250('0xf'));var zendesk=require(_0x7250('0x10'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x7250('0x11'));var freshdesk=require(_0x7250('0x12'));var desk=require(_0x7250('0x13'));var zoho=require(_0x7250('0x14'));var vtiger=require(_0x7250('0x15'));var freshsales=require(_0x7250('0x16'));var servicenow=require(_0x7250('0x17'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x7250('0x18'))(_0x7250('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x7250('0x1a')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x7250('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x7250('0x1c')]()['then'](user[_0x7250('0x1d')]())[_0x7250('0x1e')](realtime[_0x7250('0x1f')]())[_0x7250('0x1e')](user['getTelephones']())['then'](realtime[_0x7250('0x20')]())[_0x7250('0x1e')](trunk[_0x7250('0x21')]())['then'](realtime[_0x7250('0x22')]())['then'](voiceQueue[_0x7250('0x23')]())[_0x7250('0x1e')](realtime['initVoiceQueues']())[_0x7250('0x1e')](trigger[_0x7250('0x24')]())['then'](realtime[_0x7250('0x25')]())['then'](template['getTemplates']())[_0x7250('0x1e')](realtime['initTemplates']())[_0x7250('0x1e')](zendesk[_0x7250('0x26')]())['then'](realtime[_0x7250('0x27')]())['then'](salesforce[_0x7250('0x28')]())[_0x7250('0x1e')](realtime[_0x7250('0x29')]())[_0x7250('0x1e')](sugarcrm[_0x7250('0x2a')]())[_0x7250('0x1e')](realtime[_0x7250('0x2b')]())[_0x7250('0x1e')](freshdesk[_0x7250('0x2c')]())['then'](realtime[_0x7250('0x2d')]())[_0x7250('0x1e')](desk[_0x7250('0x2e')]())[_0x7250('0x1e')](realtime[_0x7250('0x2f')]())['then'](zoho['getZohoAccounts']())[_0x7250('0x1e')](realtime[_0x7250('0x30')]())[_0x7250('0x1e')](vtiger[_0x7250('0x31')]())[_0x7250('0x1e')](realtime[_0x7250('0x32')]())[_0x7250('0x1e')](freshsales[_0x7250('0x33')]())[_0x7250('0x1e')](realtime['initFreshsalesAccounts']())['then'](servicenow['getServicenowAccounts']())['then'](realtime[_0x7250('0x34')]())['then'](dynamics365['getDynamics365Accounts']())['then'](realtime[_0x7250('0x35')]())[_0x7250('0x1e')](campaign[_0x7250('0x36')]())['then'](realtime[_0x7250('0x37')]())[_0x7250('0x1e')](voiceExtension[_0x7250('0x38')]())[_0x7250('0x1e')](realtime[_0x7250('0x39')]())[_0x7250('0x1e')](faxAccount[_0x7250('0x3a')]())['then'](realtime[_0x7250('0x3b')]())[_0x7250('0x1e')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport['getVoiceQueueReports']())[_0x7250('0x1e')](realtime[_0x7250('0x3c')]())[_0x7250('0x1e')](cmHopperHistory[_0x7250('0x3d')]())[_0x7250('0x1e')](realtime[_0x7250('0x3e')]())[_0x7250('0x1e')](cmHopperHistory[_0x7250('0x3f')]())[_0x7250('0x1e')](realtime['initCampaignHopperHistory']())[_0x7250('0x1e')](voiceCallReport[_0x7250('0x40')]())['then'](realtime[_0x7250('0x41')]())[_0x7250('0x42')](function(_0x423ba4){logger[_0x7250('0x43')]('[index.js][initParams]',util['inspect'](_0x423ba4,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x5e5f07){return initRealtime();})[_0x7250('0x1e')](function(){return initParams();})[_0x7250('0x1e')](function(){report[_0x7250('0x44')]();setInterval(initRealtime,0x1388);})[_0x7250('0x42')](function(_0x1144bb){logger['error'](_0x7250('0x45'),util['inspect'](_0x1144bb,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 094b3ea..ff2102f 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 _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x43ece9,_0x415a51){var _0x28ba7f=function(_0x251072){while(--_0x251072){_0x43ece9['push'](_0x43ece9['shift']());}};_0x28ba7f(++_0x415a51);}(_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 md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file +var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x476705,_0x34fe4c){var _0x520734=function(_0x178f06){while(--_0x178f06){_0x476705['push'](_0x476705['shift']());}};_0x520734(++_0x34fe4c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index b4d38a9..1da38bc 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 _0x908a=['dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject'];(function(_0x2207fd,_0x106ee4){var _0x393414=function(_0x5022f8){while(--_0x5022f8){_0x2207fd['push'](_0x2207fd['shift']());}};_0x393414(++_0x106ee4);}(_0x908a,0xd3));var _0xa908=function(_0x11740,_0x44abf7){_0x11740=_0x11740-0x0;var _0x8f60cf=_0x908a[_0x11740];return _0x8f60cf;};'use strict';function Campaign(_0x58782){this['id']=_0x58782['id']||0x0;this[_0xa908('0x0')]=_0x58782[_0xa908('0x0')]||'';this['type']=_0x58782[_0xa908('0x1')]||_0xa908('0x2');this[_0xa908('0x3')]=0x0;this[_0xa908('0x4')]=0x0;this[_0xa908('0x5')]=0x0;this[_0xa908('0x6')]=0x0;this[_0xa908('0x7')]='';this['sendMessageOneNotActive']=!![];this[_0xa908('0x8')]=_0x58782['active'];this[_0xa908('0x9')]=_0x58782['limitCalls'];this['dialTimezone']=_0x58782[_0xa908('0xa')]||null;this[_0xa908('0xb')]=_0x58782[_0xa908('0xb')]?_0x58782[_0xa908('0xb')]:null;this['dialOriginateCallerIdName']=_0x58782[_0xa908('0xc')];this[_0xa908('0xd')]=_0x58782[_0xa908('0xd')];this['dialOriginateTimeout']=_0x58782[_0xa908('0xe')]||0x1e;this[_0xa908('0xf')]=_0x58782['dialCongestionMaxRetry'];this[_0xa908('0x10')]=_0x58782[_0xa908('0x10')];this['dialBusyMaxRetry']=_0x58782[_0xa908('0x11')];this[_0xa908('0x12')]=_0x58782['dialBusyRetryFrequency'];this[_0xa908('0x13')]=_0x58782['dialNoAnswerMaxRetry'];this[_0xa908('0x14')]=_0x58782[_0xa908('0x14')];this[_0xa908('0x15')]=_0x58782[_0xa908('0x15')];this[_0xa908('0x16')]=_0x58782[_0xa908('0x16')]||0x3;this[_0xa908('0x17')]=_0x58782[_0xa908('0x17')]||0x96;this[_0xa908('0x18')]=_0x58782[_0xa908('0x18')]||0x3;this[_0xa908('0x19')]=_0x58782[_0xa908('0x19')]||0x96;this[_0xa908('0x1a')]=_0x58782[_0xa908('0x1a')]||0x3;this[_0xa908('0x1b')]=_0x58782[_0xa908('0x1b')]||0x96;this[_0xa908('0x1c')]=_0x58782['dialMachineMaxRetry']||0x3;this[_0xa908('0x1d')]=_0x58782[_0xa908('0x1d')]||0x96;this[_0xa908('0x1e')]=_0x58782[_0xa908('0x1e')]||0x3;this['dialAgentRejectRetryFrequency']=_0x58782['dialAgentRejectRetryFrequency']||0x96;this[_0xa908('0x1f')]=_0x58782[_0xa908('0x1f')]||'DESC';this[_0xa908('0x20')]=_0x58782[_0xa908('0x20')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x58782[_0xa908('0x21')]||undefined;this[_0xa908('0x22')]=_0x58782[_0xa908('0x22')]||undefined;this[_0xa908('0x23')]=_0x58782[_0xa908('0x23')]?_0x58782[_0xa908('0x23')]:undefined;this[_0xa908('0x24')]=_0x58782[_0xa908('0x24')]?_0x58782[_0xa908('0x24')]:undefined;this[_0xa908('0x25')]=_0x58782['Interval']?_0x58782[_0xa908('0x25')]:undefined;this[_0xa908('0x26')]=_0x58782[_0xa908('0x26')]?_0x58782['SquareProject']:undefined;this[_0xa908('0x27')]=_0x58782['SquareProject']?_0x58782[_0xa908('0x26')][_0xa908('0x0')]:undefined;this[_0xa908('0x28')]=_0x58782[_0xa908('0x28')]||![];this[_0xa908('0x29')]=_0x58782['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x58782['dialAMDGreeting'];this[_0xa908('0x2a')]=_0x58782[_0xa908('0x2a')];this[_0xa908('0x2b')]=_0x58782[_0xa908('0x2b')];this[_0xa908('0x2c')]=_0x58782[_0xa908('0x2c')];this[_0xa908('0x2d')]=_0x58782['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x58782[_0xa908('0x2e')];this[_0xa908('0x2f')]=_0x58782[_0xa908('0x2f')];this[_0xa908('0x30')]=_0x58782[_0xa908('0x30')];}module[_0xa908('0x31')]=Campaign; \ No newline at end of file +var _0x156d=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout'];(function(_0x24c2aa,_0x315eef){var _0x5c6c16=function(_0x4ab5c0){while(--_0x4ab5c0){_0x24c2aa['push'](_0x24c2aa['shift']());}};_0x5c6c16(++_0x315eef);}(_0x156d,0x113));var _0xd156=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x156d[_0x4b369d];return _0x571a98;};'use strict';function Campaign(_0x3cb049){this['id']=_0x3cb049['id']||0x0;this['name']=_0x3cb049['name']||'';this[_0xd156('0x0')]=_0x3cb049[_0xd156('0x0')]||_0xd156('0x1');this['originated']=0x0;this[_0xd156('0x2')]=0x0;this[_0xd156('0x3')]=0x0;this[_0xd156('0x4')]=0x0;this[_0xd156('0x5')]='';this[_0xd156('0x6')]=!![];this[_0xd156('0x7')]=_0x3cb049[_0xd156('0x7')];this[_0xd156('0x8')]=_0x3cb049[_0xd156('0x8')];this['dialTimezone']=_0x3cb049[_0xd156('0x9')]||null;this['dialGlobalInterval']=_0x3cb049[_0xd156('0xa')]?_0x3cb049[_0xd156('0xa')]:null;this[_0xd156('0xb')]=_0x3cb049['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x3cb049['dialOriginateCallerIdNumber'];this[_0xd156('0xc')]=_0x3cb049[_0xd156('0xc')]||0x1e;this[_0xd156('0xd')]=_0x3cb049[_0xd156('0xd')];this['dialCongestionRetryFrequency']=_0x3cb049[_0xd156('0xe')];this[_0xd156('0xf')]=_0x3cb049['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x3cb049[_0xd156('0x10')];this['dialNoAnswerMaxRetry']=_0x3cb049[_0xd156('0x11')];this[_0xd156('0x12')]=_0x3cb049['dialNoAnswerRetryFrequency'];this[_0xd156('0x13')]=_0x3cb049[_0xd156('0x13')];this[_0xd156('0x14')]=_0x3cb049[_0xd156('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x3cb049[_0xd156('0x15')]||0x96;this[_0xd156('0x16')]=_0x3cb049[_0xd156('0x16')]||0x3;this['dialDropRetryFrequency']=_0x3cb049['dialDropRetryFrequency']||0x96;this[_0xd156('0x17')]=_0x3cb049[_0xd156('0x17')]||0x3;this[_0xd156('0x18')]=_0x3cb049[_0xd156('0x18')]||0x96;this[_0xd156('0x19')]=_0x3cb049[_0xd156('0x19')]||0x3;this[_0xd156('0x1a')]=_0x3cb049[_0xd156('0x1a')]||0x96;this[_0xd156('0x1b')]=_0x3cb049[_0xd156('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x3cb049['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x3cb049[_0xd156('0x1c')]||'DESC';this[_0xd156('0x1d')]=_0x3cb049[_0xd156('0x1d')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x3cb049[_0xd156('0x1e')]||undefined;this['dialCutDigit']=_0x3cb049[_0xd156('0x1f')]||undefined;this[_0xd156('0x20')]=_0x3cb049[_0xd156('0x20')]?_0x3cb049[_0xd156('0x20')]:undefined;this['Trunk']=_0x3cb049[_0xd156('0x21')]?_0x3cb049[_0xd156('0x21')]:undefined;this['Interval']=_0x3cb049['Interval']?_0x3cb049[_0xd156('0x22')]:undefined;this[_0xd156('0x23')]=_0x3cb049[_0xd156('0x23')]?_0x3cb049[_0xd156('0x23')]:undefined;this[_0xd156('0x24')]=_0x3cb049[_0xd156('0x23')]?_0x3cb049[_0xd156('0x23')]['name']:undefined;this[_0xd156('0x25')]=_0x3cb049[_0xd156('0x25')]||![];this[_0xd156('0x26')]=_0x3cb049[_0xd156('0x26')];this[_0xd156('0x27')]=_0x3cb049[_0xd156('0x27')];this[_0xd156('0x28')]=_0x3cb049[_0xd156('0x28')];this[_0xd156('0x29')]=_0x3cb049['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x3cb049[_0xd156('0x2a')];this[_0xd156('0x2b')]=_0x3cb049[_0xd156('0x2b')];this[_0xd156('0x2c')]=_0x3cb049[_0xd156('0x2c')];this[_0xd156('0x2d')]=_0x3cb049[_0xd156('0x2d')];this[_0xd156('0x2e')]=_0x3cb049[_0xd156('0x2e')];}module[_0xd156('0x2f')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index b065ffe..8dddee0 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 _0x6947=['abandoned','lastdata','duration','holdtime','type','tag','disposition','monitor','monitorFilename','queue','transfercalleridnum','transferconnectedlinenum','mohtime','exports','channel','calleridnum','calleridname','connectedlinenum','connectedlinename','uniqueid','linkedid','exten','answered','answertime','endtime'];(function(_0x2a9080,_0xa37577){var _0x17881f=function(_0x3ba64d){while(--_0x3ba64d){_0x2a9080['push'](_0x2a9080['shift']());}};_0x17881f(++_0xa37577);}(_0x6947,0x72));var _0x7694=function(_0x46322a,_0x49f6f6){_0x46322a=_0x46322a-0x0;var _0x3e7262=_0x6947[_0x46322a];return _0x3e7262;};'use strict';function Channel(){this['starttime']=null;this[_0x7694('0x0')]='';this['destinationchannel']='';this[_0x7694('0x1')]=0x0;this[_0x7694('0x2')]='';this[_0x7694('0x3')]=undefined;this[_0x7694('0x4')]=undefined;this['accountcode']=0x0;this['context']='';this[_0x7694('0x5')]=0x0;this[_0x7694('0x6')]=0x0;this[_0x7694('0x7')]=0x0;this[_0x7694('0x8')]=![];this[_0x7694('0x9')]=null;this[_0x7694('0xa')]=null;this['unmanaged']=![];this[_0x7694('0xb')]=![];this['lastapplication']='';this[_0x7694('0xc')]='';this[_0x7694('0xd')]=0x0;this['billableseconds']=0x0;this[_0x7694('0xe')]=0x0;this[_0x7694('0xf')]=null;this[_0x7694('0x10')]=null;this[_0x7694('0x11')]=null;this[_0x7694('0x12')]=![];this[_0x7694('0x13')]=null;this[_0x7694('0x14')]=null;this['monitors']=[];this[_0x7694('0x15')]=undefined;this[_0x7694('0x16')]=undefined;this['transferType']=undefined;this[_0x7694('0x17')]=0x0;}module[_0x7694('0x18')]=Channel; \ No newline at end of file +var _0xe5fc=['linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname','context'];(function(_0x46d14b,_0x147907){var _0x367dfd=function(_0x117d8e){while(--_0x117d8e){_0x46d14b['push'](_0x46d14b['shift']());}};_0x367dfd(++_0x147907);}(_0xe5fc,0x109));var _0xce5f=function(_0x287a97,_0x3c0087){_0x287a97=_0x287a97-0x0;var _0x3f4360=_0xe5fc[_0x287a97];return _0x3f4360;};'use strict';function Channel(){this[_0xce5f('0x0')]=null;this['channel']='';this[_0xce5f('0x1')]='';this[_0xce5f('0x2')]=0x0;this[_0xce5f('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0xce5f('0x4')]='';this['uniqueid']=0x0;this[_0xce5f('0x5')]=0x0;this[_0xce5f('0x6')]=0x0;this[_0xce5f('0x7')]=![];this[_0xce5f('0x8')]=null;this[_0xce5f('0x9')]=null;this[_0xce5f('0xa')]=![];this[_0xce5f('0xb')]=![];this[_0xce5f('0xc')]='';this['lastdata']='';this[_0xce5f('0xd')]=0x0;this[_0xce5f('0xe')]=0x0;this[_0xce5f('0xf')]=0x0;this[_0xce5f('0x10')]=null;this[_0xce5f('0x11')]=null;this[_0xce5f('0x12')]=null;this[_0xce5f('0x13')]=![];this['monitorFilename']=null;this[_0xce5f('0x14')]=null;this[_0xce5f('0x15')]=[];this[_0xce5f('0x16')]=undefined;this[_0xce5f('0x17')]=undefined;this[_0xce5f('0x18')]=undefined;this[_0xce5f('0x19')]=0x0;}module[_0xce5f('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 58e79f6..6c987fd 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 _0x9adb=['token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x437bc8,_0x2ec2cf){var _0x3ec57f=function(_0x45e74c){while(--_0x45e74c){_0x437bc8['push'](_0x437bc8['shift']());}};_0x3ec57f(++_0x2ec2cf);}(_0x9adb,0x19d));var _0xb9ad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9adb[_0x20a584];return _0x4b41a8;};'use strict';function DeskAccount(_0x5138d5){this['id']=_0x5138d5['id']||0x0;this['name']=_0x5138d5[_0xb9ad('0x0')]||'';this[_0xb9ad('0x1')]=_0x5138d5[_0xb9ad('0x1')]||'';this[_0xb9ad('0x2')]=_0x5138d5[_0xb9ad('0x2')]||'';this['authType']=_0x5138d5[_0xb9ad('0x3')]||'';this[_0xb9ad('0x4')]=_0x5138d5[_0xb9ad('0x4')]||'';this[_0xb9ad('0x5')]=_0x5138d5['consumerKey']||'';this[_0xb9ad('0x6')]=_0x5138d5[_0xb9ad('0x6')]||'';this[_0xb9ad('0x7')]=_0x5138d5[_0xb9ad('0x7')]||'';this['tokenSecret']=_0x5138d5[_0xb9ad('0x8')]||'';this[_0xb9ad('0x9')]=_0x5138d5[_0xb9ad('0x9')]||'';this[_0xb9ad('0xa')]=_0x5138d5['serverUrl']||'';this[_0xb9ad('0xb')]=_0x5138d5[_0xb9ad('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xf149=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x39d60f,_0x300be5){var _0x3d7691=function(_0x58ac5f){while(--_0x58ac5f){_0x39d60f['push'](_0x39d60f['shift']());}};_0x3d7691(++_0x300be5);}(_0xf149,0x83));var _0x9f14=function(_0x32729c,_0xf5afd8){_0x32729c=_0x32729c-0x0;var _0x482cfd=_0xf149[_0x32729c];return _0x482cfd;};'use strict';function DeskAccount(_0x40debb){this['id']=_0x40debb['id']||0x0;this[_0x9f14('0x0')]=_0x40debb[_0x9f14('0x0')]||'';this[_0x9f14('0x1')]=_0x40debb[_0x9f14('0x1')]||'';this[_0x9f14('0x2')]=_0x40debb[_0x9f14('0x2')]||'';this[_0x9f14('0x3')]=_0x40debb[_0x9f14('0x3')]||'';this[_0x9f14('0x4')]=_0x40debb[_0x9f14('0x4')]||'';this[_0x9f14('0x5')]=_0x40debb[_0x9f14('0x5')]||'';this[_0x9f14('0x6')]=_0x40debb['consumerSecret']||'';this[_0x9f14('0x7')]=_0x40debb[_0x9f14('0x7')]||'';this[_0x9f14('0x8')]=_0x40debb[_0x9f14('0x8')]||'';this[_0x9f14('0x9')]=_0x40debb[_0x9f14('0x9')]||'';this['serverUrl']=_0x40debb[_0x9f14('0xa')]||'';this[_0x9f14('0xb')]=_0x40debb[_0x9f14('0xb')]||{};}module[_0x9f14('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 25755eb..11a5551 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 _0x0453=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId'];(function(_0x5ad5d1,_0x3bb313){var _0x1d6da6=function(_0x3a9e70){while(--_0x3a9e70){_0x5ad5d1['push'](_0x5ad5d1['shift']());}};_0x1d6da6(++_0x3bb313);}(_0x0453,0xd3));var _0x3045=function(_0x1a3ecc,_0x46618a){_0x1a3ecc=_0x1a3ecc-0x0;var _0x289253=_0x0453[_0x1a3ecc];return _0x289253;};'use strict';function Dynamics365Account(_0x4e8dda){this['id']=_0x4e8dda['id']||0x0;this[_0x3045('0x0')]=_0x4e8dda[_0x3045('0x0')]||'';this['username']=_0x4e8dda[_0x3045('0x1')]||'';this[_0x3045('0x2')]=_0x4e8dda[_0x3045('0x2')]||'';this[_0x3045('0x3')]=_0x4e8dda[_0x3045('0x3')]||'';this['tenantId']=_0x4e8dda[_0x3045('0x4')]||'';this['clientId']=_0x4e8dda[_0x3045('0x5')]||'';this[_0x3045('0x6')]=_0x4e8dda[_0x3045('0x6')]||{};this[_0x3045('0x7')]=_0x4e8dda[_0x3045('0x7')]||'';this[_0x3045('0x8')]=_0x4e8dda[_0x3045('0x8')]||![];this[_0x3045('0x9')]=_0x4e8dda[_0x3045('0x9')]||{};this[_0x3045('0xa')]=_0x4e8dda[_0x3045('0xa')]||{};}module[_0x3045('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x3fc0=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId'];(function(_0x2d0a6b,_0x5d3947){var _0x5306be=function(_0x426543){while(--_0x426543){_0x2d0a6b['push'](_0x2d0a6b['shift']());}};_0x5306be(++_0x5d3947);}(_0x3fc0,0x14b));var _0x03fc=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0x3fc0[_0x5d4f12];return _0x4eb577;};'use strict';function Dynamics365Account(_0x46ed4d){this['id']=_0x46ed4d['id']||0x0;this[_0x03fc('0x0')]=_0x46ed4d[_0x03fc('0x0')]||'';this[_0x03fc('0x1')]=_0x46ed4d[_0x03fc('0x1')]||'';this[_0x03fc('0x2')]=_0x46ed4d['password']||'';this['remoteUri']=_0x46ed4d[_0x03fc('0x3')]||'';this[_0x03fc('0x4')]=_0x46ed4d['tenantId']||'';this[_0x03fc('0x5')]=_0x46ed4d[_0x03fc('0x5')]||'';this[_0x03fc('0x6')]=_0x46ed4d['clientSecret']||{};this[_0x03fc('0x7')]=_0x46ed4d[_0x03fc('0x7')]||'';this[_0x03fc('0x8')]=_0x46ed4d[_0x03fc('0x8')]||![];this[_0x03fc('0x9')]=_0x46ed4d[_0x03fc('0x9')]||{};this[_0x03fc('0xa')]=_0x46ed4d[_0x03fc('0xa')]||{};}module[_0x03fc('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 26e56b8..0e42334 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 _0xcba2=['faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','maxrate','modem','v17,v27,v29','gateway'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xcba2,0x118));var _0x2cba=function(_0x20b2db,_0x55e868){_0x20b2db=_0x20b2db-0x0;var _0x3e0fb6=_0xcba2[_0x20b2db];return _0x3e0fb6;};'use strict';function FaxAccount(_0x2b144a){this['id']=_0x2b144a['id']||0x0;this['name']=_0x2b144a[_0x2cba('0x0')]||'';this[_0x2cba('0x1')]=_0x2b144a['description'];this[_0x2cba('0x2')]=_0x2b144a[_0x2cba('0x2')];this[_0x2cba('0x3')]=_0x2b144a[_0x2cba('0x3')];this['localstationid']=_0x2b144a[_0x2cba('0x4')];this['minrate']=_0x2b144a['minrate']||0x960;this[_0x2cba('0x5')]=_0x2b144a[_0x2cba('0x5')]||0x3840;this['modem']=_0x2b144a[_0x2cba('0x6')]||_0x2cba('0x7');this[_0x2cba('0x8')]=_0x2b144a[_0x2cba('0x8')]||'no';this[_0x2cba('0x9')]=_0x2b144a[_0x2cba('0x9')]||'no';this['t38timeout']=_0x2b144a[_0x2cba('0xa')]||0x1388;this[_0x2cba('0xb')]=_0x2b144a['tech']||_0x2cba('0xc');this[_0x2cba('0xd')]=_0x2b144a['Trunk']?_0x2b144a[_0x2cba('0xd')]:undefined;this[_0x2cba('0xe')]=_0x2b144a['ListId'];this[_0x2cba('0xf')]=_0x2b144a['key'];}module[_0x2cba('0x10')]=FaxAccount; \ No newline at end of file +var _0x7988=['name','description','headerinfo','localstationid','minrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports'];(function(_0x48a6d9,_0x1f3744){var _0x3d2936=function(_0x24677a){while(--_0x24677a){_0x48a6d9['push'](_0x48a6d9['shift']());}};_0x3d2936(++_0x1f3744);}(_0x7988,0x100));var _0x8798=function(_0x4b7b9b,_0xa4aff9){_0x4b7b9b=_0x4b7b9b-0x0;var _0x3be710=_0x7988[_0x4b7b9b];return _0x3be710;};'use strict';function FaxAccount(_0xbd49a5){this['id']=_0xbd49a5['id']||0x0;this[_0x8798('0x0')]=_0xbd49a5[_0x8798('0x0')]||'';this['description']=_0xbd49a5[_0x8798('0x1')];this['ecm']=_0xbd49a5['ecm'];this[_0x8798('0x2')]=_0xbd49a5[_0x8798('0x2')];this[_0x8798('0x3')]=_0xbd49a5[_0x8798('0x3')];this['minrate']=_0xbd49a5[_0x8798('0x4')]||0x960;this['maxrate']=_0xbd49a5['maxrate']||0x3840;this[_0x8798('0x5')]=_0xbd49a5['modem']||_0x8798('0x6');this[_0x8798('0x7')]=_0xbd49a5[_0x8798('0x7')]||'no';this['faxdetect']=_0xbd49a5[_0x8798('0x8')]||'no';this[_0x8798('0x9')]=_0xbd49a5[_0x8798('0x9')]||0x1388;this[_0x8798('0xa')]=_0xbd49a5['tech']||_0x8798('0xb');this[_0x8798('0xc')]=_0xbd49a5['Trunk']?_0xbd49a5[_0x8798('0xc')]:undefined;this[_0x8798('0xd')]=_0xbd49a5[_0x8798('0xd')];this[_0x8798('0xe')]=_0xbd49a5[_0x8798('0xe')];}module[_0x8798('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 6d428a4..0734795 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 _0x4cc6=['token','remoteUri','Configurations','exports','name','username','apiKey'];(function(_0x35946b,_0x3151aa){var _0x479375=function(_0x5783e1){while(--_0x5783e1){_0x35946b['push'](_0x35946b['shift']());}};_0x479375(++_0x3151aa);}(_0x4cc6,0x1bd));var _0x64cc=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0x4cc6[_0x26b8b5];return _0x2150a9;};'use strict';function FreshdeskAccount(_0x4b9d32){this['id']=_0x4b9d32['id']||0x0;this[_0x64cc('0x0')]=_0x4b9d32[_0x64cc('0x0')]||'';this[_0x64cc('0x1')]=_0x4b9d32[_0x64cc('0x1')]||'';this[_0x64cc('0x2')]=_0x4b9d32[_0x64cc('0x3')]||'';this[_0x64cc('0x4')]=_0x4b9d32[_0x64cc('0x4')]||'';this['serverUrl']=_0x4b9d32['serverUrl']||'';this[_0x64cc('0x5')]=_0x4b9d32[_0x64cc('0x5')]||{};}module[_0x64cc('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x594c=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x594c,0x19d));var _0xc594=function(_0x59675e,_0x5a89c0){_0x59675e=_0x59675e-0x0;var _0x3ddea8=_0x594c[_0x59675e];return _0x3ddea8;};'use strict';function FreshdeskAccount(_0x4dc0bc){this['id']=_0x4dc0bc['id']||0x0;this[_0xc594('0x0')]=_0x4dc0bc[_0xc594('0x0')]||'';this[_0xc594('0x1')]=_0x4dc0bc[_0xc594('0x1')]||'';this[_0xc594('0x2')]=_0x4dc0bc[_0xc594('0x3')]||'';this['remoteUri']=_0x4dc0bc[_0xc594('0x4')]||'';this[_0xc594('0x5')]=_0x4dc0bc[_0xc594('0x5')]||'';this[_0xc594('0x6')]=_0x4dc0bc[_0xc594('0x6')]||{};}module[_0xc594('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index bba25b6..f3f820f 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 _0xee14=['username','apiKey','token','remoteUri','serverUrl','Configurations','name'];(function(_0x4bf44f,_0x5ee38b){var _0x74b438=function(_0xcf7015){while(--_0xcf7015){_0x4bf44f['push'](_0x4bf44f['shift']());}};_0x74b438(++_0x5ee38b);}(_0xee14,0x13a));var _0x4ee1=function(_0x27daa5,_0x38a38f){_0x27daa5=_0x27daa5-0x0;var _0x21f65b=_0xee14[_0x27daa5];return _0x21f65b;};'use strict';function FreshsalesAccount(_0x48008f){this['id']=_0x48008f['id']||0x0;this['name']=_0x48008f[_0x4ee1('0x0')]||'';this[_0x4ee1('0x1')]=_0x48008f[_0x4ee1('0x1')]||'';this[_0x4ee1('0x2')]=_0x48008f[_0x4ee1('0x3')]||'';this[_0x4ee1('0x4')]=_0x48008f[_0x4ee1('0x4')]||'';this[_0x4ee1('0x5')]=_0x48008f[_0x4ee1('0x5')]||'';this['Configurations']=_0x48008f[_0x4ee1('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x0dee=['serverUrl','Configurations','name','username','apiKey','token','remoteUri'];(function(_0x3af955,_0x5237b0){var _0x5a5bdd=function(_0x6a59d8){while(--_0x6a59d8){_0x3af955['push'](_0x3af955['shift']());}};_0x5a5bdd(++_0x5237b0);}(_0x0dee,0xf7));var _0xe0de=function(_0xa148b5,_0x5773b4){_0xa148b5=_0xa148b5-0x0;var _0x1bb470=_0x0dee[_0xa148b5];return _0x1bb470;};'use strict';function FreshsalesAccount(_0x2d297c){this['id']=_0x2d297c['id']||0x0;this[_0xe0de('0x0')]=_0x2d297c['name']||'';this[_0xe0de('0x1')]=_0x2d297c['username']||'';this[_0xe0de('0x2')]=_0x2d297c[_0xe0de('0x3')]||'';this['remoteUri']=_0x2d297c[_0xe0de('0x4')]||'';this[_0xe0de('0x5')]=_0x2d297c[_0xe0de('0x5')]||'';this['Configurations']=_0x2d297c[_0xe0de('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 2771668..a44f130 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 _0x9214=['uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','connectedlinenum','connectedlinename','context','exten','priority','lastAssignedTo','motionChannel','voice','variables','exports','type','inbound'];(function(_0x46eb27,_0x57ff9f){var _0x4b3b90=function(_0x53216d){while(--_0x53216d){_0x46eb27['push'](_0x46eb27['shift']());}};_0x4b3b90(++_0x57ff9f);}(_0x9214,0xc6));var _0x4921=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0x9214[_0x15ea09];return _0x3e9c78;};'use strict';function QueueReport(){this[_0x4921('0x0')]=_0x4921('0x1');this[_0x4921('0x2')]='';this['calleridnum']='';this[_0x4921('0x3')]='';this[_0x4921('0x4')]='';this[_0x4921('0x5')]=null;this[_0x4921('0x6')]=null;this[_0x4921('0x7')]=0x1;this[_0x4921('0x8')]=0x1;this[_0x4921('0x9')]=![];this[_0x4921('0xa')]=null;this[_0x4921('0xb')]=![];this[_0x4921('0xc')]=null;this[_0x4921('0xd')]=![];this['queuecallerexitAt']=null;this[_0x4921('0xe')]=0x1;this['channel']='';this[_0x4921('0xf')]='';this[_0x4921('0x10')]='';this['accountcode']='';this[_0x4921('0x11')]='';this[_0x4921('0x12')]='';this[_0x4921('0x13')]='';this['holdtime']=0x0;this['assigned']=![];this[_0x4921('0x14')]='';this[_0x4921('0x15')]=_0x4921('0x16');this['mohtime']=0x0;this[_0x4921('0x17')]={};}module[_0x4921('0x18')]=QueueReport; \ No newline at end of file +var _0xbca7=['holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','originalposition','channel','connectedlinename','accountcode','context','exten','priority'];(function(_0x2461a0,_0x26167f){var _0x2fadbd=function(_0x493f1b){while(--_0x493f1b){_0x2461a0['push'](_0x2461a0['shift']());}};_0x2fadbd(++_0x26167f);}(_0xbca7,0x1b7));var _0x7bca=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xbca7[_0x42245d];return _0x4b211a;};'use strict';function QueueReport(){this[_0x7bca('0x0')]=_0x7bca('0x1');this[_0x7bca('0x2')]='';this[_0x7bca('0x3')]='';this[_0x7bca('0x4')]='';this[_0x7bca('0x5')]='';this['queuecallerjoinAt']=null;this[_0x7bca('0x6')]=null;this[_0x7bca('0x7')]=0x1;this[_0x7bca('0x8')]=0x1;this[_0x7bca('0x9')]=![];this[_0x7bca('0xa')]=null;this[_0x7bca('0xb')]=![];this[_0x7bca('0xc')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0x7bca('0xd')]=0x1;this[_0x7bca('0xe')]='';this['connectedlinenum']='';this[_0x7bca('0xf')]='';this[_0x7bca('0x10')]='';this[_0x7bca('0x11')]='';this[_0x7bca('0x12')]='';this[_0x7bca('0x13')]='';this[_0x7bca('0x14')]=0x0;this[_0x7bca('0x15')]=![];this[_0x7bca('0x16')]='';this[_0x7bca('0x17')]=_0x7bca('0x18');this[_0x7bca('0x19')]=0x0;this[_0x7bca('0x1a')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index f366460..525f904 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 _0xbdc2=['integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x2ac5af,_0xe0a021){var _0x4b63f5=function(_0x3c8c06){while(--_0x3c8c06){_0x2ac5af['push'](_0x2ac5af['shift']());}};_0x4b63f5(++_0xe0a021);}(_0xbdc2,0x148));var _0x2bdc=function(_0x1fd2e8,_0x49432f){_0x1fd2e8=_0x1fd2e8-0x0;var _0x32524e=_0xbdc2[_0x1fd2e8];return _0x32524e;};'use strict';function SalesforceAccount(_0x9acb52){this['id']=_0x9acb52['id']||0x0;this[_0x2bdc('0x0')]=_0x9acb52[_0x2bdc('0x0')]||'';this[_0x2bdc('0x1')]=_0x9acb52['username']||'';this['remoteUri']=_0x9acb52[_0x2bdc('0x2')]||'';this[_0x2bdc('0x3')]=_0x9acb52['password']||'';this[_0x2bdc('0x4')]=_0x9acb52[_0x2bdc('0x4')]||'';this['clientSecret']=_0x9acb52[_0x2bdc('0x5')]||'';this['securityToken']=_0x9acb52[_0x2bdc('0x6')]||'';this[_0x2bdc('0x7')]=_0x9acb52[_0x2bdc('0x7')]||_0x2bdc('0x8');this[_0x2bdc('0x9')]=_0x9acb52[_0x2bdc('0x9')]||'';this[_0x2bdc('0xa')]=_0x9acb52[_0x2bdc('0xa')]||{};}module[_0x2bdc('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xe588=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x23a49a,_0x45fd99){var _0x2e0cb8=function(_0x11a7e4){while(--_0x11a7e4){_0x23a49a['push'](_0x23a49a['shift']());}};_0x2e0cb8(++_0x45fd99);}(_0xe588,0xda));var _0x8e58=function(_0x2e5e5f,_0x52aa6f){_0x2e5e5f=_0x2e5e5f-0x0;var _0x345827=_0xe588[_0x2e5e5f];return _0x345827;};'use strict';function SalesforceAccount(_0x263bda){this['id']=_0x263bda['id']||0x0;this[_0x8e58('0x0')]=_0x263bda[_0x8e58('0x0')]||'';this[_0x8e58('0x1')]=_0x263bda[_0x8e58('0x1')]||'';this[_0x8e58('0x2')]=_0x263bda[_0x8e58('0x2')]||'';this[_0x8e58('0x3')]=_0x263bda['password']||'';this['clientId']=_0x263bda[_0x8e58('0x4')]||'';this[_0x8e58('0x5')]=_0x263bda[_0x8e58('0x5')]||'';this[_0x8e58('0x6')]=_0x263bda['securityToken']||'';this[_0x8e58('0x7')]=_0x263bda['type']||_0x8e58('0x8');this[_0x8e58('0x9')]=_0x263bda[_0x8e58('0x9')]||'';this[_0x8e58('0xa')]=_0x263bda['Configurations']||{};}module[_0x8e58('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 829d8c4..3a58cfd 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 _0x5a10=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x59a9b9,_0x3f0ae6){var _0xc3add0=function(_0x17a5e5){while(--_0x17a5e5){_0x59a9b9['push'](_0x59a9b9['shift']());}};_0xc3add0(++_0x3f0ae6);}(_0x5a10,0x15a));var _0x05a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a10[_0x3dd15e];return _0x231fd0;};'use strict';function ServicenowAccount(_0x5a7912){this['id']=_0x5a7912['id']||0x0;this['name']=_0x5a7912[_0x05a1('0x0')]||'';this['username']=_0x5a7912[_0x05a1('0x1')]||'';this[_0x05a1('0x2')]=_0x5a7912[_0x05a1('0x2')]||'';this['remoteUri']=_0x5a7912[_0x05a1('0x3')]||'';this[_0x05a1('0x4')]=_0x5a7912[_0x05a1('0x4')]||'';this[_0x05a1('0x5')]=_0x5a7912['Configurations']||{};}module[_0x05a1('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x2843=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x18a26e,_0x277280){var _0x5ac98c=function(_0x128a59){while(--_0x128a59){_0x18a26e['push'](_0x18a26e['shift']());}};_0x5ac98c(++_0x277280);}(_0x2843,0x1aa));var _0x3284=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0x2843[_0x3c4f1f];return _0x19cb69;};'use strict';function ServicenowAccount(_0x17130b){this['id']=_0x17130b['id']||0x0;this[_0x3284('0x0')]=_0x17130b[_0x3284('0x0')]||'';this[_0x3284('0x1')]=_0x17130b[_0x3284('0x1')]||'';this[_0x3284('0x2')]=_0x17130b[_0x3284('0x2')]||'';this['remoteUri']=_0x17130b[_0x3284('0x3')]||'';this['serverUrl']=_0x17130b[_0x3284('0x4')]||'';this[_0x3284('0x5')]=_0x17130b[_0x3284('0x5')]||{};}module[_0x3284('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 839ea63..676bc10 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 _0x1be3=['password','serverUrl','Configurations','exports','name','username'];(function(_0x52096b,_0x20bab4){var _0x2b1cc7=function(_0x3f7021){while(--_0x3f7021){_0x52096b['push'](_0x52096b['shift']());}};_0x2b1cc7(++_0x20bab4);}(_0x1be3,0x13c));var _0x31be=function(_0x4bf78e,_0x5940d2){_0x4bf78e=_0x4bf78e-0x0;var _0x20c276=_0x1be3[_0x4bf78e];return _0x20c276;};'use strict';function SugarcrmAccount(_0x395438){this['id']=_0x395438['id']||0x0;this['name']=_0x395438[_0x31be('0x0')]||'';this['username']=_0x395438[_0x31be('0x1')]||'';this[_0x31be('0x2')]=_0x395438['password']||'';this['remoteUri']=_0x395438['remoteUri']||'';this[_0x31be('0x3')]=_0x395438[_0x31be('0x3')]||'';this[_0x31be('0x4')]=_0x395438['Configurations']||{};}module[_0x31be('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x7ebd=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x3cb152,_0x57eb54){var _0x4f54c3=function(_0x273a45){while(--_0x273a45){_0x3cb152['push'](_0x3cb152['shift']());}};_0x4f54c3(++_0x57eb54);}(_0x7ebd,0x8f));var _0xd7eb=function(_0x496c30,_0x4f32cf){_0x496c30=_0x496c30-0x0;var _0x168fbb=_0x7ebd[_0x496c30];return _0x168fbb;};'use strict';function SugarcrmAccount(_0x3e6254){this['id']=_0x3e6254['id']||0x0;this[_0xd7eb('0x0')]=_0x3e6254[_0xd7eb('0x0')]||'';this[_0xd7eb('0x1')]=_0x3e6254[_0xd7eb('0x1')]||'';this[_0xd7eb('0x2')]=_0x3e6254[_0xd7eb('0x2')]||'';this[_0xd7eb('0x3')]=_0x3e6254['remoteUri']||'';this[_0xd7eb('0x4')]=_0x3e6254[_0xd7eb('0x4')]||'';this[_0xd7eb('0x5')]=_0x3e6254['Configurations']||{};}module[_0xd7eb('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 66456d3..aa59fcb 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 _0x2b50=['unknown','stateTime','status','exports','name'];(function(_0x59a6e1,_0x1d3571){var _0x58f5a5=function(_0x32cec6){while(--_0x32cec6){_0x59a6e1['push'](_0x59a6e1['shift']());}};_0x58f5a5(++_0x1d3571);}(_0x2b50,0x68));var _0x02b5=function(_0x91135d,_0x1a6ddc){_0x91135d=_0x91135d-0x0;var _0x18dadc=_0x2b50[_0x91135d];return _0x18dadc;};'use strict';function Telephone(_0x5a99a8){this['id']=_0x5a99a8['id']||0x0;this['name']=_0x5a99a8[_0x02b5('0x0')]||'';this['accountcode']=_0x5a99a8['accountcode']||'';this['state']=_0x02b5('0x1');this[_0x02b5('0x2')]=0x0;this[_0x02b5('0x3')]=_0x02b5('0x1');this['address']='';}module[_0x02b5('0x4')]=Telephone; \ No newline at end of file +var _0x928c=['state','unknown','stateTime','status','exports','name','accountcode'];(function(_0x176e9e,_0x3dfe11){var _0x1b675f=function(_0x508167){while(--_0x508167){_0x176e9e['push'](_0x176e9e['shift']());}};_0x1b675f(++_0x3dfe11);}(_0x928c,0x17f));var _0xc928=function(_0x2526c9,_0x1ebc73){_0x2526c9=_0x2526c9-0x0;var _0x29058e=_0x928c[_0x2526c9];return _0x29058e;};'use strict';function Telephone(_0xc59037){this['id']=_0xc59037['id']||0x0;this['name']=_0xc59037[_0xc928('0x0')]||'';this[_0xc928('0x1')]=_0xc59037['accountcode']||'';this[_0xc928('0x2')]=_0xc928('0x3');this[_0xc928('0x4')]=0x0;this[_0xc928('0x5')]=_0xc928('0x3');this['address']='';}module[_0xc928('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 33ed7d0..511ae63 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x5c27ca,_0xf611bb){var _0xca7762=function(_0x53efbe){while(--_0x53efbe){_0x5c27ca['push'](_0x5c27ca['shift']());}};_0xca7762(++_0xf611bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x4c4d9b,_0x15173a){var _0x57860f=function(_0x294ced){while(--_0x294ced){_0x4c4d9b['push'](_0x4c4d9b['shift']());}};_0x57860f(++_0x15173a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 eaa5590..6e00590 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(_0x4b21b4,_0x24b836){var _0x2e6839=function(_0x377bac){while(--_0x377bac){_0x4b21b4['push'](_0x4b21b4['shift']());}};_0x2e6839(++_0x24b836);}(_0xda2d,0x102));var _0xdda2=function(_0x1cc718,_0x8b453f){_0x1cc718=_0x1cc718-0x0;var _0x34292e=_0xda2d[_0x1cc718];return _0x34292e;};'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 _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x2a57e7,_0x367228){var _0x4c7083=function(_0x4fd196){while(--_0x4fd196){_0x2a57e7['push'](_0x2a57e7['shift']());}};_0x4c7083(++_0x367228);}(_0x2032,0xd9));var _0x2203=function(_0x18eb0c,_0x2aa23f){_0x18eb0c=_0x18eb0c-0x0;var _0x2078a1=_0x2032[_0x18eb0c];return _0x2078a1;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 40caa98..649ac4e 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 _0xd205=['domain','registrationtime','address','defaultuser','exports','active','name','state','unknown','status','registry','host','port'];(function(_0x3b3a53,_0x5e2b9e){var _0xf45594=function(_0x4e57f8){while(--_0x4e57f8){_0x3b3a53['push'](_0x3b3a53['shift']());}};_0xf45594(++_0x5e2b9e);}(_0xd205,0x94));var _0x5d20=function(_0x2c5fa1,_0x2cf26e){_0x2c5fa1=_0x2c5fa1-0x0;var _0x380593=_0xd205[_0x2c5fa1];return _0x380593;};'use strict';function Trunk(_0x11b116){this['id']=_0x11b116['id']||0x0;this[_0x5d20('0x0')]=_0x11b116[_0x5d20('0x0')]||![];this[_0x5d20('0x1')]=_0x11b116[_0x5d20('0x1')]||'';this[_0x5d20('0x2')]=_0x5d20('0x3');this['stateTime']=0x0;this[_0x5d20('0x4')]=_0x5d20('0x3');this[_0x5d20('0x5')]=_0x11b116[_0x5d20('0x5')]&&_0x11b116[_0x5d20('0x5')]['indexOf'](':')?_0x11b116['registry']['split'](':')[0x0]:'';this[_0x5d20('0x6')]='';this[_0x5d20('0x7')]='';this[_0x5d20('0x8')]='';this['domainport']='';this['refresh']='';this['stateRegistry']=_0x5d20('0x3');this[_0x5d20('0x9')]='';this[_0x5d20('0xa')]='';this[_0x5d20('0xb')]=_0x11b116[_0x5d20('0xb')]||'';}module[_0x5d20('0xc')]=Trunk; \ No newline at end of file +var _0x4716=['address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4716,0x6f));var _0x6471=function(_0x431d2b,_0x7a3416){_0x431d2b=_0x431d2b-0x0;var _0x7e3d8e=_0x4716[_0x431d2b];return _0x7e3d8e;};'use strict';function Trunk(_0x4b70a7){this['id']=_0x4b70a7['id']||0x0;this[_0x6471('0x0')]=_0x4b70a7[_0x6471('0x0')]||![];this[_0x6471('0x1')]=_0x4b70a7[_0x6471('0x1')]||'';this[_0x6471('0x2')]=_0x6471('0x3');this[_0x6471('0x4')]=0x0;this[_0x6471('0x5')]=_0x6471('0x3');this['registry']=_0x4b70a7[_0x6471('0x6')]&&_0x4b70a7['registry'][_0x6471('0x7')](':')?_0x4b70a7['registry'][_0x6471('0x8')](':')[0x0]:'';this[_0x6471('0x9')]='';this[_0x6471('0xa')]='';this[_0x6471('0xb')]='';this[_0x6471('0xc')]='';this[_0x6471('0xd')]='';this[_0x6471('0xe')]=_0x6471('0x3');this['registrationtime']='';this[_0x6471('0xf')]='';this[_0x6471('0x10')]=_0x4b70a7[_0x6471('0x10')]||'';}module[_0x6471('0x11')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 44e20b3..a3844d4 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 _0xd551=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x43b0ac,_0x308fcc){var _0xbbc88a=function(_0x3d16cf){while(--_0x3d16cf){_0x43b0ac['push'](_0x43b0ac['shift']());}};_0xbbc88a(++_0x308fcc);}(_0xd551,0x183));var _0x1d55=function(_0x3f38e8,_0x5d72fc){_0x3f38e8=_0x3f38e8-0x0;var _0x4027ef=_0xd551[_0x3f38e8];return _0x4027ef;};'use strict';function voiceExtension(_0x3dd6e5){this['id']=_0x3dd6e5['id']||0x0;this[_0x1d55('0x0')]=_0x3dd6e5[_0x1d55('0x0')]||'';this[_0x1d55('0x1')]=_0x3dd6e5[_0x1d55('0x1')]||'none';this[_0x1d55('0x2')]=_0x3dd6e5['mandatoryDisposition']||![];}module[_0x1d55('0x3')]=voiceExtension; \ No newline at end of file +var _0x72b8=['recordingFormat','none','exten'];(function(_0x2207be,_0x129bb1){var _0x28f7d7=function(_0x32d1be){while(--_0x32d1be){_0x2207be['push'](_0x2207be['shift']());}};_0x28f7d7(++_0x129bb1);}(_0x72b8,0x19d));var _0x872b=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x72b8[_0x4b055c];return _0x4b62bb;};'use strict';function voiceExtension(_0x3623a5){this['id']=_0x3623a5['id']||0x0;this[_0x872b('0x0')]=_0x3623a5[_0x872b('0x0')]||'';this['recordingFormat']=_0x3623a5[_0x872b('0x1')]||_0x872b('0x2');this['mandatoryDisposition']=_0x3623a5['mandatoryDisposition']||![];}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 8f50018..8a8c769 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 _0x1786=['erlangAbandonmentRate','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','type','inbound','waiting','talking','total','answered','sumDuration','sumBillable','unmanaged','abandoned','acwTimeout','autopause','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond'];(function(_0x32650f,_0xefd3c4){var _0x50b795=function(_0x473f95){while(--_0x473f95){_0x32650f['push'](_0x32650f['shift']());}};_0x50b795(++_0xefd3c4);}(_0x1786,0x166));var _0x6178=function(_0x3b3327,_0xb5d017){_0x3b3327=_0x3b3327-0x0;var _0x2425c8=_0x1786[_0x3b3327];return _0x2425c8;};'use strict';var statusDesc=[_0x6178('0x0'),_0x6178('0x1'),_0x6178('0x2'),'busy',_0x6178('0x3'),_0x6178('0x4'),_0x6178('0x5'),_0x6178('0x6'),_0x6178('0x7')];var monitorFormat={'wav':_0x6178('0x8'),'wav49':_0x6178('0x9'),'gsm':_0x6178('0xa')};var strategy={'rrmemory':_0x6178('0xb'),'roundrobin':_0x6178('0xc')};function VoiceQueue(_0x1ee135){this['id']=_0x1ee135['id']||0x0;this[_0x6178('0xd')]=_0x1ee135[_0x6178('0xd')]||'';this['monitor_format']=_0x1ee135['monitor_format']||'';this[_0x6178('0xe')]=_0x1ee135[_0x6178('0xe')]||_0x6178('0xf');this[_0x6178('0x10')]=0x0;this[_0x6178('0x11')]=0x0;this[_0x6178('0x12')]=0x0;this[_0x6178('0x13')]=0x0;this[_0x6178('0x14')]=0x0;this['sumHoldTime']=0x0;this[_0x6178('0x15')]=0x0;this[_0x6178('0x16')]=0x0;this[_0x6178('0x17')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this['acw']=_0x1ee135['acw']||![];this[_0x6178('0x18')]=_0x1ee135[_0x6178('0x18')]||0xa;this[_0x6178('0x19')]=_0x1ee135[_0x6178('0x19')]||'no';this['sendMessageOneNotActive']=!![];this[_0x6178('0x1a')]='';this['originated']=0x0;this['temp']=0x0;this[_0x6178('0x1b')]=_0x1ee135[_0x6178('0x1b')]||null;this[_0x6178('0x1c')]=_0x1ee135[_0x6178('0x1c')]?_0x1ee135[_0x6178('0x1c')]:null;this['dialActive']=_0x1ee135[_0x6178('0x1d')];this[_0x6178('0x1e')]=_0x1ee135[_0x6178('0x1e')]||'progressive';this['dialLimitChannel']=_0x1ee135['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x1ee135[_0x6178('0x1f')]||0x0;this['dialPowerLevel']=_0x1ee135['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x1ee135[_0x6178('0x20')]||'dropRate';this[_0x6178('0x21')]=_0x1ee135['dialPredictiveOptimizationPercentage']||0.03;this[_0x6178('0x22')]=_0x1ee135['dialPredictiveInterval']||0x258;this[_0x6178('0x23')]=_0x1ee135[_0x6178('0x23')]||_0x6178('0x24');this[_0x6178('0x25')]=_0x1ee135[_0x6178('0x25')]||_0x6178('0x24');this[_0x6178('0x26')]=_0x1ee135['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x1ee135[_0x6178('0x27')]||_0x6178('0x28');this['dialQueueTimeout']=_0x1ee135['dialQueueTimeout']||0x3;this[_0x6178('0x29')]=_0x1ee135['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x1ee135[_0x6178('0x2a')]||0x3;this['dialCongestionRetryFrequency']=_0x1ee135[_0x6178('0x2b')]||0x96;this['dialBusyMaxRetry']=_0x1ee135['dialBusyMaxRetry']||0x3;this[_0x6178('0x2c')]=_0x1ee135[_0x6178('0x2c')]||0x96;this[_0x6178('0x2d')]=_0x1ee135['dialNoAnswerMaxRetry']||0x3;this[_0x6178('0x2e')]=_0x1ee135[_0x6178('0x2e')]||0x96;this[_0x6178('0x2f')]=_0x1ee135[_0x6178('0x2f')]||0x3;this[_0x6178('0x30')]=_0x1ee135[_0x6178('0x30')]||0x96;this[_0x6178('0x31')]=_0x1ee135['dialDropMaxRetry']||0x3;this[_0x6178('0x32')]=_0x1ee135[_0x6178('0x32')]||0x96;this['dialAbandonedMaxRetry']=_0x1ee135[_0x6178('0x33')]||0x3;this[_0x6178('0x34')]=_0x1ee135[_0x6178('0x34')]||0x96;this[_0x6178('0x35')]=_0x1ee135[_0x6178('0x35')]||0x3;this[_0x6178('0x36')]=_0x1ee135[_0x6178('0x36')]||0x96;this[_0x6178('0x37')]=_0x1ee135[_0x6178('0x37')]||0x3;this[_0x6178('0x38')]=_0x1ee135[_0x6178('0x38')]||0x96;this[_0x6178('0x39')]=_0x1ee135[_0x6178('0x39')]||0x4;this['Trunk']=_0x1ee135[_0x6178('0x3a')]?_0x1ee135[_0x6178('0x3a')]:undefined;this[_0x6178('0x3b')]=_0x1ee135['TrunkBackup']?_0x1ee135[_0x6178('0x3b')]:undefined;this[_0x6178('0x3c')]=_0x1ee135[_0x6178('0x3c')]||undefined;this['Interval']=_0x1ee135['Interval']?_0x1ee135[_0x6178('0x3d')]:undefined;this[_0x6178('0x3e')]=_0x1ee135[_0x6178('0x3e')]||'DESC';this[_0x6178('0x3f')]=_0x1ee135[_0x6178('0x3f')]||undefined;this[_0x6178('0x40')]=_0x1ee135[_0x6178('0x40')]||undefined;this[_0x6178('0x41')]=strategy[_0x1ee135[_0x6178('0x41')]]||_0x6178('0xb');this[_0x6178('0x42')]=!![];this[_0x6178('0x43')]=_0x1ee135[_0x6178('0x43')]||![];this['dialAMDInitialSilence']=_0x1ee135[_0x6178('0x44')];this['dialAMDGreeting']=_0x1ee135[_0x6178('0x45')];this['dialAMDAfterGreetingSilence']=_0x1ee135[_0x6178('0x46')];this[_0x6178('0x47')]=_0x1ee135['dialAMDTotalAnalysisTime'];this[_0x6178('0x48')]=_0x1ee135[_0x6178('0x48')];this[_0x6178('0x49')]=_0x1ee135[_0x6178('0x49')];this[_0x6178('0x4a')]=_0x1ee135[_0x6178('0x4a')];this[_0x6178('0x4b')]=_0x1ee135['dialAMDSilenceThreshold'];this[_0x6178('0x4c')]=_0x1ee135[_0x6178('0x4c')];this[_0x6178('0x4d')]=0x0;this['pTalking']=0x0;this[_0x6178('0x4e')]=_0x1ee135[_0x6178('0x4e')];this[_0x6178('0x4f')]=0x0;this[_0x6178('0x50')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x6178('0x51')]=0x0;this[_0x6178('0x52')]=0x0;this[_0x6178('0x53')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x6178('0x54')]=0x0;this[_0x6178('0x55')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x6178('0x56')]=0x0;this[_0x6178('0x57')]=0x0;this[_0x6178('0x58')]=0x0;this[_0x6178('0x59')]=undefined;this['startPredictive']=undefined;this[_0x6178('0x5a')]=undefined;this[_0x6178('0x5b')]=1.05;this[_0x6178('0x5c')]=0x0;this[_0x6178('0x5d')]=0x0;this[_0x6178('0x5e')]=0x0;this[_0x6178('0x5f')]=0x0;this[_0x6178('0x60')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x6178('0x61')]=0x0;this[_0x6178('0x62')]=0x0;this[_0x6178('0x63')]=_0x1ee135[_0x6178('0x64')]||0x14;this[_0x6178('0x65')]=_0x1ee135[_0x6178('0x64')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x6178('0x66')]=0x0;this[_0x6178('0x67')]=0x1;this[_0x6178('0x68')]=0x0;this[_0x6178('0x69')]=0x0;this[_0x6178('0x6a')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x1ee135['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x1ee135[_0x6178('0x6b')]||![];this[_0x6178('0x6c')]=!!_0x1ee135['dialPreviewAutoRecallMe']||![];this[_0x6178('0x6d')]=!!_0x1ee135[_0x6178('0x6d')]||![];this[_0x6178('0x6e')]=_0x1ee135[_0x6178('0x6e')]||undefined;this[_0x6178('0x6f')]=_0x1ee135[_0x6178('0x6f')]||![];this['dialAgiAfterHangupAgent']=_0x1ee135['dialAgiAfterHangupAgent']||![];this[_0x6178('0x70')]=monitorFormat[_0x1ee135[_0x6178('0x70')]]?monitorFormat[_0x1ee135[_0x6178('0x70')]]:undefined;this[_0x6178('0x71')]=_0x1ee135[_0x6178('0x71')]||![];this[_0x6178('0x72')]=_0x1ee135['mandatoryDispositionPause']?_0x1ee135[_0x6178('0x72')]:undefined;}module[_0x6178('0x73')]=VoiceQueue; \ No newline at end of file +var _0xe83d=['abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable'];(function(_0x50b9ea,_0x58dc43){var _0x18d334=function(_0x9b5254){while(--_0x9b5254){_0x50b9ea['push'](_0x50b9ea['shift']());}};_0x18d334(++_0x58dc43);}(_0xe83d,0x1d3));var _0xde83=function(_0x10edee,_0x3ddbb2){_0x10edee=_0x10edee-0x0;var _0x5fd281=_0xe83d[_0x10edee];return _0x5fd281;};'use strict';var statusDesc=[_0xde83('0x0'),_0xde83('0x1'),_0xde83('0x2'),_0xde83('0x3'),_0xde83('0x4'),_0xde83('0x5'),'ringing',_0xde83('0x6'),_0xde83('0x7')];var monitorFormat={'wav':_0xde83('0x8'),'wav49':'wav49','gsm':_0xde83('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xde83('0xa')};function VoiceQueue(_0x365de5){this['id']=_0x365de5['id']||0x0;this[_0xde83('0xb')]=_0x365de5[_0xde83('0xb')]||'';this[_0xde83('0xc')]=_0x365de5[_0xde83('0xc')]||'';this[_0xde83('0xd')]=_0x365de5[_0xde83('0xd')]||_0xde83('0xe');this[_0xde83('0xf')]=0x0;this[_0xde83('0x10')]=0x0;this['total']=0x0;this[_0xde83('0x11')]=0x0;this[_0xde83('0x12')]=0x0;this[_0xde83('0x13')]=0x0;this[_0xde83('0x14')]=0x0;this['unmanaged']=0x0;this[_0xde83('0x15')]=0x0;this[_0xde83('0x16')]=0x0;this[_0xde83('0x17')]=0x0;this[_0xde83('0x18')]=_0x365de5['acw']||![];this[_0xde83('0x19')]=_0x365de5[_0xde83('0x19')]||0xa;this['autopause']=_0x365de5[_0xde83('0x1a')]||'no';this[_0xde83('0x1b')]=!![];this[_0xde83('0x1c')]='';this[_0xde83('0x1d')]=0x0;this['temp']=0x0;this[_0xde83('0x1e')]=_0x365de5[_0xde83('0x1e')]||null;this[_0xde83('0x1f')]=_0x365de5[_0xde83('0x1f')]?_0x365de5[_0xde83('0x1f')]:null;this[_0xde83('0x20')]=_0x365de5[_0xde83('0x20')];this[_0xde83('0x21')]=_0x365de5[_0xde83('0x21')]||_0xde83('0x22');this[_0xde83('0x23')]=_0x365de5[_0xde83('0x23')]||0x0;this[_0xde83('0x24')]=_0x365de5[_0xde83('0x24')]||0x0;this['dialPowerLevel']=_0x365de5[_0xde83('0x25')]||0x1;this['dialPredictiveOptimization']=_0x365de5[_0xde83('0x26')]||_0xde83('0x27');this[_0xde83('0x28')]=_0x365de5[_0xde83('0x28')]||0.03;this[_0xde83('0x29')]=_0x365de5[_0xde83('0x29')]||0x258;this[_0xde83('0x2a')]=_0x365de5[_0xde83('0x2a')]||'anonymous';this[_0xde83('0x2b')]=_0x365de5[_0xde83('0x2b')]||_0xde83('0x2c');this[_0xde83('0x2d')]=_0x365de5[_0xde83('0x2d')]||0x1e;this['dialQueueOptions']=_0x365de5[_0xde83('0x2e')]||_0xde83('0x2f');this[_0xde83('0x30')]=_0x365de5['dialQueueTimeout']||0x3;this[_0xde83('0x31')]=_0x365de5[_0xde83('0x31')]||undefined;this[_0xde83('0x32')]=_0x365de5['dialCongestionMaxRetry']||0x3;this[_0xde83('0x33')]=_0x365de5['dialCongestionRetryFrequency']||0x96;this[_0xde83('0x34')]=_0x365de5['dialBusyMaxRetry']||0x3;this[_0xde83('0x35')]=_0x365de5[_0xde83('0x35')]||0x96;this[_0xde83('0x36')]=_0x365de5[_0xde83('0x36')]||0x3;this[_0xde83('0x37')]=_0x365de5['dialNoAnswerRetryFrequency']||0x96;this[_0xde83('0x38')]=_0x365de5[_0xde83('0x38')]||0x3;this[_0xde83('0x39')]=_0x365de5['dialNoSuchNumberRetryFrequency']||0x96;this[_0xde83('0x3a')]=_0x365de5['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x365de5[_0xde83('0x3b')]||0x96;this[_0xde83('0x3c')]=_0x365de5['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x365de5[_0xde83('0x3d')]||0x96;this[_0xde83('0x3e')]=_0x365de5['dialMachineMaxRetry']||0x3;this[_0xde83('0x3f')]=_0x365de5[_0xde83('0x3f')]||0x96;this[_0xde83('0x40')]=_0x365de5[_0xde83('0x40')]||0x3;this['dialAgentRejectRetryFrequency']=_0x365de5['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x365de5[_0xde83('0x41')]||0x4;this['Trunk']=_0x365de5[_0xde83('0x42')]?_0x365de5['Trunk']:undefined;this[_0xde83('0x43')]=_0x365de5[_0xde83('0x43')]?_0x365de5[_0xde83('0x43')]:undefined;this[_0xde83('0x44')]=_0x365de5[_0xde83('0x44')]||undefined;this['Interval']=_0x365de5['Interval']?_0x365de5[_0xde83('0x45')]:undefined;this['dialOrderByScheduledAt']=_0x365de5['dialOrderByScheduledAt']||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x365de5[_0xde83('0x46')]||undefined;this[_0xde83('0x47')]=_0x365de5[_0xde83('0x47')]||undefined;this[_0xde83('0x48')]=strategy[_0x365de5[_0xde83('0x48')]]||_0xde83('0x49');this[_0xde83('0x4a')]=!![];this[_0xde83('0x4b')]=_0x365de5[_0xde83('0x4b')]||![];this[_0xde83('0x4c')]=_0x365de5[_0xde83('0x4c')];this['dialAMDGreeting']=_0x365de5['dialAMDGreeting'];this[_0xde83('0x4d')]=_0x365de5['dialAMDAfterGreetingSilence'];this[_0xde83('0x4e')]=_0x365de5['dialAMDTotalAnalysisTime'];this[_0xde83('0x4f')]=_0x365de5[_0xde83('0x4f')];this['dialAMDBetweenWordsSilence']=_0x365de5[_0xde83('0x50')];this[_0xde83('0x51')]=_0x365de5[_0xde83('0x51')];this[_0xde83('0x52')]=_0x365de5[_0xde83('0x52')];this[_0xde83('0x53')]=_0x365de5[_0xde83('0x53')];this[_0xde83('0x54')]=0x0;this[_0xde83('0x55')]=0x0;this[_0xde83('0x56')]=_0x365de5[_0xde83('0x56')];this['outboundAnswerCallsDay']=0x0;this[_0xde83('0x57')]=0x0;this[_0xde83('0x58')]=0x0;this[_0xde83('0x59')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xde83('0x5a')]=0x0;this[_0xde83('0x5b')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xde83('0x5c')]=0x0;this[_0xde83('0x5d')]=0x0;this[_0xde83('0x5e')]=0x0;this[_0xde83('0x5f')]=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0xde83('0x60')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xde83('0x61')]=0x0;this[_0xde83('0x62')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xde83('0x63')]=0x0;this[_0xde83('0x64')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xde83('0x65')]=0x0;this[_0xde83('0x66')]=0x0;this[_0xde83('0x67')]=_0x365de5[_0xde83('0x68')]||0x14;this[_0xde83('0x69')]=_0x365de5['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xde83('0x6a')]=0x0;this[_0xde83('0x6b')]=0x0;this[_0xde83('0x6c')]=0x1;this[_0xde83('0x6d')]=0x0;this[_0xde83('0x6e')]=0x0;this[_0xde83('0x6f')]=0x0;this[_0xde83('0x70')]=0x0;this['dialRecallMeTimeout']=_0x365de5[_0xde83('0x71')]||0x1e;this[_0xde83('0x72')]=_0x365de5[_0xde83('0x72')]||![];this[_0xde83('0x73')]=!!_0x365de5[_0xde83('0x73')]||![];this[_0xde83('0x74')]=!!_0x365de5[_0xde83('0x74')]||![];this['dialQueueProject2']=_0x365de5[_0xde83('0x75')]||undefined;this[_0xde83('0x76')]=_0x365de5[_0xde83('0x76')]||![];this[_0xde83('0x77')]=_0x365de5['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x365de5[_0xde83('0xc')]]?monitorFormat[_0x365de5['monitor_format']]:undefined;this[_0xde83('0x78')]=_0x365de5[_0xde83('0x78')]||![];this[_0xde83('0x79')]=_0x365de5[_0xde83('0x79')]?_0x365de5[_0xde83('0x79')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index d971ba7..dce70d1 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 _0xfbd9=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x34c4dd,_0x26514f){var _0x1a7051=function(_0x5e9e94){while(--_0x5e9e94){_0x34c4dd['push'](_0x34c4dd['shift']());}};_0x1a7051(++_0x26514f);}(_0xfbd9,0x77));var _0x9fbd=function(_0x52e217,_0x1274c6){_0x52e217=_0x52e217-0x0;var _0x279f76=_0xfbd9[_0x52e217];return _0x279f76;};'use strict';function VtigerAccount(_0x33d044){this['id']=_0x33d044['id']||0x0;this[_0x9fbd('0x0')]=_0x33d044[_0x9fbd('0x0')]||'';this[_0x9fbd('0x1')]=_0x33d044[_0x9fbd('0x1')]||'';this['accessKey']=_0x33d044['accessKey']||'';this['remoteUri']=_0x33d044[_0x9fbd('0x2')]||'';this['serverUrl']=_0x33d044[_0x9fbd('0x3')]||'';this[_0x9fbd('0x4')]=_0x33d044[_0x9fbd('0x4')]||{};}module[_0x9fbd('0x5')]=VtigerAccount; \ No newline at end of file +var _0xc0f9=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0xb28d42,_0x36eeaf){var _0x496af2=function(_0x36e26f){while(--_0x36e26f){_0xb28d42['push'](_0xb28d42['shift']());}};_0x496af2(++_0x36eeaf);}(_0xc0f9,0xc5));var _0x9c0f=function(_0xc8a11,_0x347a33){_0xc8a11=_0xc8a11-0x0;var _0x55a500=_0xc0f9[_0xc8a11];return _0x55a500;};'use strict';function VtigerAccount(_0x70f591){this['id']=_0x70f591['id']||0x0;this[_0x9c0f('0x0')]=_0x70f591[_0x9c0f('0x0')]||'';this[_0x9c0f('0x1')]=_0x70f591[_0x9c0f('0x1')]||'';this[_0x9c0f('0x2')]=_0x70f591['accessKey']||'';this[_0x9c0f('0x3')]=_0x70f591[_0x9c0f('0x3')]||'';this[_0x9c0f('0x4')]=_0x70f591['serverUrl']||'';this[_0x9c0f('0x5')]=_0x70f591[_0x9c0f('0x5')]||{};}module[_0x9c0f('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 b5ff37e..45d7132 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 _0x04d3=['integrationTab','Configurations','exports','name','username','password','token','remoteUri','authType','type'];(function(_0x4bf565,_0x420d33){var _0x30e15f=function(_0x91a47f){while(--_0x91a47f){_0x4bf565['push'](_0x4bf565['shift']());}};_0x30e15f(++_0x420d33);}(_0x04d3,0x12f));var _0x304d=function(_0x21b02a,_0x20481d){_0x21b02a=_0x21b02a-0x0;var _0x533b43=_0x04d3[_0x21b02a];return _0x533b43;};'use strict';function ZendeskAccount(_0x4305a0){this['id']=_0x4305a0['id']||0x0;this[_0x304d('0x0')]=_0x4305a0[_0x304d('0x0')]||'';this[_0x304d('0x1')]=_0x4305a0[_0x304d('0x1')]||'';this['password']=_0x4305a0[_0x304d('0x2')]||'';this[_0x304d('0x3')]=_0x4305a0['token']||'';this[_0x304d('0x4')]=_0x4305a0[_0x304d('0x4')]||'';this[_0x304d('0x5')]=_0x4305a0[_0x304d('0x5')]||'';this[_0x304d('0x6')]=_0x4305a0[_0x304d('0x6')]||_0x304d('0x7');this['serverUrl']=_0x4305a0['serverUrl']||'';this[_0x304d('0x8')]=_0x4305a0['Configurations']||{};}module[_0x304d('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x4f15=['type','integrationTab','serverUrl','Configurations','name','username','token','remoteUri'];(function(_0x58db8e,_0x55ded2){var _0x114066=function(_0x3700dd){while(--_0x3700dd){_0x58db8e['push'](_0x58db8e['shift']());}};_0x114066(++_0x55ded2);}(_0x4f15,0x1e4));var _0x54f1=function(_0x15b827,_0x15e6f7){_0x15b827=_0x15b827-0x0;var _0x48326b=_0x4f15[_0x15b827];return _0x48326b;};'use strict';function ZendeskAccount(_0x2ceaf3){this['id']=_0x2ceaf3['id']||0x0;this[_0x54f1('0x0')]=_0x2ceaf3[_0x54f1('0x0')]||'';this['username']=_0x2ceaf3[_0x54f1('0x1')]||'';this['password']=_0x2ceaf3['password']||'';this[_0x54f1('0x2')]=_0x2ceaf3[_0x54f1('0x2')]||'';this[_0x54f1('0x3')]=_0x2ceaf3['remoteUri']||'';this['authType']=_0x2ceaf3['authType']||'';this[_0x54f1('0x4')]=_0x2ceaf3['type']||_0x54f1('0x5');this[_0x54f1('0x6')]=_0x2ceaf3[_0x54f1('0x6')]||'';this[_0x54f1('0x7')]=_0x2ceaf3[_0x54f1('0x7')]||{};}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 c3f17ef..e5f9e81 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 _0xb42a=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x469e4c,_0xb45f1e){var _0x7ff6e1=function(_0x47f70a){while(--_0x47f70a){_0x469e4c['push'](_0x469e4c['shift']());}};_0x7ff6e1(++_0xb45f1e);}(_0xb42a,0x86));var _0xab42=function(_0x8180e0,_0x596957){_0x8180e0=_0x8180e0-0x0;var _0xf7ea2f=_0xb42a[_0x8180e0];return _0xf7ea2f;};'use strict';function ZohoAccount(_0x21ea7b){this['id']=_0x21ea7b['id']||0x0;this['name']=_0x21ea7b[_0xab42('0x0')]||'';this['description']=_0x21ea7b[_0xab42('0x1')]||'';this[_0xab42('0x2')]=_0x21ea7b[_0xab42('0x2')]||'';this[_0xab42('0x3')]=_0x21ea7b[_0xab42('0x3')]||'';this[_0xab42('0x4')]=_0x21ea7b[_0xab42('0x4')]||'';this[_0xab42('0x5')]=_0x21ea7b[_0xab42('0x5')]||'';this[_0xab42('0x6')]=_0x21ea7b['serverUrl']||'';this[_0xab42('0x7')]=_0x21ea7b[_0xab42('0x7')]||'';this[_0xab42('0x8')]=_0x21ea7b[_0xab42('0x8')]||'';this[_0xab42('0x9')]=_0x21ea7b[_0xab42('0x9')]||{};}module[_0xab42('0xa')]=ZohoAccount; \ No newline at end of file +var _0x535d=['Configurations','name','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x4998d1,_0x3fbc4e){var _0x12d73c=function(_0x42527f){while(--_0x42527f){_0x4998d1['push'](_0x4998d1['shift']());}};_0x12d73c(++_0x3fbc4e);}(_0x535d,0x145));var _0xd535=function(_0x2f23c3,_0x17259f){_0x2f23c3=_0x2f23c3-0x0;var _0x593147=_0x535d[_0x2f23c3];return _0x593147;};'use strict';function ZohoAccount(_0x5519d5){this['id']=_0x5519d5['id']||0x0;this['name']=_0x5519d5[_0xd535('0x0')]||'';this['description']=_0x5519d5['description']||'';this[_0xd535('0x1')]=_0x5519d5['host']||'';this[_0xd535('0x2')]=_0x5519d5['zone']||'';this[_0xd535('0x3')]=_0x5519d5['clientId']||'';this[_0xd535('0x4')]=_0x5519d5[_0xd535('0x4')]||'';this[_0xd535('0x5')]=_0x5519d5[_0xd535('0x5')]||'';this[_0xd535('0x6')]=_0x5519d5[_0xd535('0x6')]||'';this[_0xd535('0x7')]=_0x5519d5['refreshToken']||'';this['Configurations']=_0x5519d5[_0xd535('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index e2deed6..f624179 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 _0x4f2a=['countmachineretry','countagentrejectretry','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','util','lodash','moment','isNil','string','uniqueid','queue','name','type','campaigntype','Agent','channelAgent','format','SIP/%s','membername','calleridname','Contact','phone','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x57dd22,_0x16dde0){var _0x577e09=function(_0x5c6492){while(--_0x5c6492){_0x57dd22['push'](_0x57dd22['shift']());}};_0x577e09(++_0x16dde0);}(_0x4f2a,0x14d));var _0xa4f2=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x4f2a[_0x291f8b];return _0x275171;};'use strict';var util=require(_0xa4f2('0x0'));var _=require(_0xa4f2('0x1'));var moment=require(_0xa4f2('0x2'));function checkNameSurname(_0x304b85,_0x229b5d,_0x16f42e){var _0x538d06='';if(!_[_0xa4f2('0x3')](_0x229b5d)&&_0xa4f2('0x4')===typeof _0x229b5d){_0x538d06+=_0x229b5d;}if(!_['isNil'](_0x16f42e)&&'string'===typeof _0x16f42e){_0x538d06+='\x20'+_0x16f42e;}if(_0x538d06!==''){return _0x538d06;}return _0x304b85;}function Action(_0x1de6b3,_0x5615ee,_0x3ffaee,_0x458a72,_0x36862b){this[_0xa4f2('0x5')]=_0x3ffaee||undefined;this['idContact']=_0x1de6b3['id'];this[_0xa4f2('0x6')]=_0x5615ee[_0xa4f2('0x7')];this[_0xa4f2('0x8')]=_0x5615ee[_0xa4f2('0x8')];this[_0xa4f2('0x9')]='queue';this['dialAnswer']=![];this['membername']=_['isNil'](_0x1de6b3[_0xa4f2('0xa')])?undefined:_0x1de6b3[_0xa4f2('0xa')][_0xa4f2('0x7')];this[_0xa4f2('0xb')]=this['membername']?util[_0xa4f2('0xc')](_0xa4f2('0xd'),this[_0xa4f2('0xe')]):_0x458a72||undefined;this[_0xa4f2('0xf')]=checkNameSurname(_0x1de6b3[_0xa4f2('0x10')][_0xa4f2('0x11')],_0x1de6b3[_0xa4f2('0x10')]['firstName'],_0x1de6b3[_0xa4f2('0x10')]['lastName']);this[_0xa4f2('0x12')]=_0x1de6b3[_0xa4f2('0x12')]||![];this['calleridnum']=_0x1de6b3['Contact'][_0xa4f2('0x11')];this['scheduledat']=_0x1de6b3[_0xa4f2('0x13')];this[_0xa4f2('0x14')]=_0x1de6b3[_0xa4f2('0x14')]||0x0;this[_0xa4f2('0x15')]=_0x1de6b3[_0xa4f2('0x15')]||0x0;this['countnoanswerretry']=_0x1de6b3[_0xa4f2('0x16')]||0x0;this[_0xa4f2('0x17')]=(_0x1de6b3['countbusyretry']||0x0)+(_0x1de6b3[_0xa4f2('0x15')]||0x0)+(_0x1de6b3['countnoanswerretry']||0x0)+(_0x1de6b3[_0xa4f2('0x18')]||0x0)+(_0x1de6b3[_0xa4f2('0x19')]||0x0)+(_0x1de6b3[_0xa4f2('0x1a')]||0x0)+(_0x1de6b3[_0xa4f2('0x1b')]||0x0)+(_0x1de6b3[_0xa4f2('0x1c')]||0x0);this[_0xa4f2('0x18')]=_0x1de6b3[_0xa4f2('0x18')]||0x0;this[_0xa4f2('0x19')]=_0x1de6b3[_0xa4f2('0x19')]||0x0;this['countabandonedretry']=_0x1de6b3['countabandonedretry']||0x0;this[_0xa4f2('0x1b')]=_0x1de6b3[_0xa4f2('0x1b')]||0x0;this[_0xa4f2('0x1c')]=_0x1de6b3['countagentrejectretry']||0x0;this['callback']=_0x1de6b3['callback'];this['callbackuniqueid']=_0x1de6b3['callbackuniqueid'];this[_0xa4f2('0x1d')]=_0x1de6b3[_0xa4f2('0x1d')];this[_0xa4f2('0x1e')]=_0x1de6b3['recallme'];this[_0xa4f2('0x1f')]=_0x1de6b3[_0xa4f2('0x1f')];this[_0xa4f2('0x20')]=_0x1de6b3[_0xa4f2('0x20')];this['UserId']=_[_0xa4f2('0x3')](_0x1de6b3[_0xa4f2('0xa')])?_0x1de6b3['UserId']:_0x1de6b3['Agent']['id'];this[_0xa4f2('0x21')]=_0x1de6b3[_0xa4f2('0x21')];this[_0xa4f2('0x22')]='';this[_0xa4f2('0x23')]='';}Action[_0xa4f2('0x24')][_0xa4f2('0x25')]=function(){return util[_0xa4f2('0xc')](_0xa4f2('0x26'),this['calleridname'],this[_0xa4f2('0x27')]);};module['exports']=Action; \ No newline at end of file +var _0xd9e2=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','util','string','isNil','uniqueid','idContact','queue','type','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd9e2,0x19c));var _0x2d9e=function(_0x207cf1,_0x14e106){_0x207cf1=_0x207cf1-0x0;var _0x5e52a2=_0xd9e2[_0x207cf1];return _0x5e52a2;};'use strict';var util=require(_0x2d9e('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x3aa038,_0x4dca6a,_0x1997f3){var _0x37f8c4='';if(!_['isNil'](_0x4dca6a)&&_0x2d9e('0x1')===typeof _0x4dca6a){_0x37f8c4+=_0x4dca6a;}if(!_[_0x2d9e('0x2')](_0x1997f3)&&_0x2d9e('0x1')===typeof _0x1997f3){_0x37f8c4+='\x20'+_0x1997f3;}if(_0x37f8c4!==''){return _0x37f8c4;}return _0x3aa038;}function Action(_0x35ed46,_0x248d3d,_0x395a69,_0xd96140,_0x585ba0){this[_0x2d9e('0x3')]=_0x395a69||undefined;this[_0x2d9e('0x4')]=_0x35ed46['id'];this[_0x2d9e('0x5')]=_0x248d3d['name'];this['type']=_0x248d3d[_0x2d9e('0x6')];this['campaigntype']=_0x2d9e('0x5');this[_0x2d9e('0x7')]=![];this[_0x2d9e('0x8')]=_[_0x2d9e('0x2')](_0x35ed46[_0x2d9e('0x9')])?undefined:_0x35ed46['Agent']['name'];this[_0x2d9e('0xa')]=this[_0x2d9e('0x8')]?util['format'](_0x2d9e('0xb'),this[_0x2d9e('0x8')]):_0xd96140||undefined;this[_0x2d9e('0xc')]=checkNameSurname(_0x35ed46[_0x2d9e('0xd')][_0x2d9e('0xe')],_0x35ed46[_0x2d9e('0xd')][_0x2d9e('0xf')],_0x35ed46[_0x2d9e('0xd')][_0x2d9e('0x10')]);this[_0x2d9e('0x11')]=_0x35ed46[_0x2d9e('0x11')]||![];this[_0x2d9e('0x12')]=_0x35ed46[_0x2d9e('0xd')][_0x2d9e('0xe')];this['scheduledat']=_0x35ed46['scheduledat'];this[_0x2d9e('0x13')]=_0x35ed46[_0x2d9e('0x13')]||0x0;this['countcongestionretry']=_0x35ed46[_0x2d9e('0x14')]||0x0;this[_0x2d9e('0x15')]=_0x35ed46[_0x2d9e('0x15')]||0x0;this[_0x2d9e('0x16')]=(_0x35ed46[_0x2d9e('0x13')]||0x0)+(_0x35ed46[_0x2d9e('0x14')]||0x0)+(_0x35ed46[_0x2d9e('0x15')]||0x0)+(_0x35ed46[_0x2d9e('0x17')]||0x0)+(_0x35ed46[_0x2d9e('0x18')]||0x0)+(_0x35ed46[_0x2d9e('0x19')]||0x0)+(_0x35ed46[_0x2d9e('0x1a')]||0x0)+(_0x35ed46[_0x2d9e('0x1b')]||0x0);this['countnosuchnumberretry']=_0x35ed46[_0x2d9e('0x17')]||0x0;this['countdropretry']=_0x35ed46[_0x2d9e('0x18')]||0x0;this[_0x2d9e('0x19')]=_0x35ed46[_0x2d9e('0x19')]||0x0;this[_0x2d9e('0x1a')]=_0x35ed46[_0x2d9e('0x1a')]||0x0;this[_0x2d9e('0x1b')]=_0x35ed46[_0x2d9e('0x1b')]||0x0;this[_0x2d9e('0x1c')]=_0x35ed46[_0x2d9e('0x1c')];this[_0x2d9e('0x1d')]=_0x35ed46[_0x2d9e('0x1d')];this[_0x2d9e('0x1e')]=_0x35ed46[_0x2d9e('0x1e')];this[_0x2d9e('0x1f')]=_0x35ed46[_0x2d9e('0x1f')];this['ContactId']=_0x35ed46[_0x2d9e('0x20')];this[_0x2d9e('0x21')]=_0x35ed46['ListId'];this[_0x2d9e('0x22')]=_[_0x2d9e('0x2')](_0x35ed46[_0x2d9e('0x9')])?_0x35ed46[_0x2d9e('0x22')]:_0x35ed46['Agent']['id'];this[_0x2d9e('0x23')]=_0x35ed46['VoiceQueueId'];this[_0x2d9e('0x24')]='';this[_0x2d9e('0x25')]='';}Action['prototype'][_0x2d9e('0x26')]=function(){return util['format'](_0x2d9e('0x27'),this['calleridname'],this['number']);};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 59d56de..a08e3f2 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 _0x1cb9=['md5','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','localhost','redis','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','bind','hangup','hanguprequest','syncHangupRequest','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','campaignsPreview','emit','type','outbound','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','Interval','stringify','format','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','sendMessageOneNotActive','originated','available','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','Queue','originated:\x20','pTalking:\x20','queue','dialAnswer','pick','contactId','ListId','Action','status','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','logger2','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','catch','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','activeContact','ANSWER','uniqueid','\x20Queue','connect','custom:agentConnectPreview','custom:agentcomplete','complete','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','BUSY','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','scheduledAt','dialBusyRetryFrequency','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','called','Calling','Call\x20failed','Contact\x20in\x20black\x20List','SIP/%s','run','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','VoiceQueueId','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','trim','dialCutDigit','phone','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','syncOriginateResponse','actionid','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','rejected','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','keys','addVariable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','moment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1cb9,0x14e));var _0x91cb=function(_0x55b909,_0xc2e8e6){_0x55b909=_0x55b909-0x0;var _0x4130b1=_0x1cb9[_0x55b909];return _0x4130b1;};'use strict';var util=require(_0x91cb('0x0'));var _=require('lodash');var BPromise=require(_0x91cb('0x1'));var uuid=require(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var md5=require(_0x91cb('0x4'));var Redis=require('ioredis');var config=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('preview');var loggerAction=require(_0x91cb('0x6'))(_0x91cb('0x7'));var ami=require(_0x91cb('0x8'));var rpcDb=require(_0x91cb('0x9'));var Action=require(_0x91cb('0xa'));var ut=require(_0x91cb('0xb'));config['redis']=_[_0x91cb('0xc')](config['redis'],{'host':_0x91cb('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x91cb('0xe')]));var Sequence=function(){};Sequence[_0x91cb('0xf')][_0x91cb('0x10')]=function(_0x4a631d){this[_0x91cb('0x11')]=this[_0x91cb('0x11')]?this[_0x91cb('0x11')][_0x91cb('0x12')](_0x4a631d):_0x4a631d();};function Preview(_0x2465be){this[_0x91cb('0x13')]=new Sequence();this['campaignsPreview']=_0x2465be[_0x91cb('0x14')];this[_0x91cb('0x15')]=_0x2465be['trunks'];this[_0x91cb('0x16')]={};this[_0x91cb('0x17')]=_0x2465be[_0x91cb('0x17')];this[_0x91cb('0x18')]=0x0;ami['on']('originateresponse',this['syncOriginateResponse'][_0x91cb('0x19')](this));ami['on'](_0x91cb('0x1a'),this['syncHangup']['bind'](this));ami['on'](_0x91cb('0x1b'),this[_0x91cb('0x1c')][_0x91cb('0x19')](this));ami['on']('dialend',this[_0x91cb('0x1d')][_0x91cb('0x19')](this));ami['on']('newexten',this[_0x91cb('0x1e')][_0x91cb('0x19')](this));ami['on'](_0x91cb('0x1f'),this[_0x91cb('0x20')]['bind'](this));ami['on'](_0x91cb('0x21'),this[_0x91cb('0x22')]['bind'](this));ami['on'](_0x91cb('0x23'),this['syncBlindTransfer']['bind'](this));this[_0x91cb('0x24')](this[_0x91cb('0x25')]);}function emit(_0x56e409,_0x51a1d5,_0x5b385a){io['to'](_0x56e409)[_0x91cb('0x26')](_0x51a1d5,_0x5b385a);}function emitCampaignPreview(_0x18827b){if(_0x18827b[_0x91cb('0x27')]===_0x91cb('0x28')){var _0x5c6a15={'id':_0x18827b['id'],'name':_0x18827b[_0x91cb('0x29')],'strategy':_0x18827b[_0x91cb('0x2a')],'answered':_0x18827b[_0x91cb('0x2b')],'available':_0x18827b['available'],'loggedIn':_0x18827b[_0x91cb('0x2c')],'pTalking':_0x18827b[_0x91cb('0x2d')],'sumBillable':_0x18827b[_0x91cb('0x2e')],'sumDuration':_0x18827b[_0x91cb('0x2f')],'sumHoldTime':_0x18827b[_0x91cb('0x30')]||0x0,'talking':_0x18827b[_0x91cb('0x31')],'total':_0x18827b[_0x91cb('0x32')],'type':_0x18827b[_0x91cb('0x27')],'unmanaged':_0x18827b[_0x91cb('0x33')],'abandoned':_0x18827b['abandoned'],'waiting':_0x18827b['waiting'],'loggedInDb':_0x18827b[_0x91cb('0x34')],'dialActive':_0x18827b['dialActive'],'dialMethod':_0x18827b[_0x91cb('0x35')],'dialOriginateCallerIdName':_0x18827b[_0x91cb('0x36')],'dialOriginateCallerIdNumber':_0x18827b[_0x91cb('0x37')],'dialOriginateTimeout':_0x18827b['dialOriginateTimeout'],'dialPrefix':_0x18827b[_0x91cb('0x38')],'outboundAnswerAgiCallsDay':_0x18827b['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x18827b[_0x91cb('0x39')],'outboundBlacklistCallsDay':_0x18827b[_0x91cb('0x3a')],'outboundBusyCallsDay':_0x18827b[_0x91cb('0x3b')],'outboundCongestionCallsDay':_0x18827b[_0x91cb('0x3c')],'outboundDropCallsDayACS':_0x18827b[_0x91cb('0x3d')],'outboundDropCallsDayCallersExit':_0x18827b['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x18827b[_0x91cb('0x3e')],'outboundNoAnswerCallsDay':_0x18827b['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x18827b[_0x91cb('0x3f')],'outboundOriginateFailureCallsDay':_0x18827b[_0x91cb('0x40')],'outboundReCallsDay':_0x18827b[_0x91cb('0x41')],'outboundRejectCallsDay':_0x18827b['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x18827b[_0x91cb('0x42')],'outboundAbandonedCallsDay':_0x18827b[_0x91cb('0x43')],'predictiveIntervalAnsweredCalls':_0x18827b[_0x91cb('0x44')],'predictiveIntervalAvgHoldtime':_0x18827b[_0x91cb('0x45')],'predictiveIntervalAvgTalktime':_0x18827b[_0x91cb('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x18827b[_0x91cb('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x18827b[_0x91cb('0x48')],'predictiveIntervalErlangCalls':_0x18827b[_0x91cb('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x18827b[_0x91cb('0x4a')],'predictiveIntervalHitRate':_0x18827b['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x18827b[_0x91cb('0x4b')],'predictiveIntervalPauses':_0x18827b[_0x91cb('0x4c')],'predictiveIntervalAvailable':_0x18827b[_0x91cb('0x4d')],'predictiveIntervalTotalCalls':_0x18827b[_0x91cb('0x4e')],'message':_0x18827b[_0x91cb('0x4f')],'originated':_0x18827b['originated'],'erlangCalls':_0x18827b[_0x91cb('0x50')],'erlangCallToSecond':_0x18827b[_0x91cb('0x51')],'erlangAbandonmentRate':_0x18827b[_0x91cb('0x52')],'erlangBusyFactor':_0x18827b[_0x91cb('0x53')],'startPredictive':_0x18827b[_0x91cb('0x54')],'startProgressive':_0x18827b['startProgressive']};if(_0x18827b[_0x91cb('0x55')]){_0x5c6a15['Trunk']={'id':_0x18827b['Trunk']['id'],'name':_0x18827b['Trunk'][_0x91cb('0x29')],'active':_0x18827b['Trunk'][_0x91cb('0x56')],'callerid':_0x18827b['Trunk']['callerid']};}if(_0x18827b[_0x91cb('0x57')]){_0x5c6a15[_0x91cb('0x57')]={'id':_0x18827b[_0x91cb('0x57')]['id'],'name':_0x18827b[_0x91cb('0x57')][_0x91cb('0x29')]};}var _0x4b0ca6=md5(JSON[_0x91cb('0x58')](_0x5c6a15));if(_0x18827b[_0x91cb('0x4')]!==_0x4b0ca6){_0x18827b[_0x91cb('0x4')]=_0x4b0ca6;emit(util[_0x91cb('0x59')]('voice:queue:%s',_0x5c6a15['name']),_0x91cb('0x5a'),_0x5c6a15);}}}function emitVoiceQueueChannelRemove(_0x135bf1){logger['info'](_0x91cb('0x5b'),JSON[_0x91cb('0x58')](_0x135bf1));emit(util['format'](_0x91cb('0x5c'),_0x135bf1[_0x91cb('0x29')]),'voice_queue_channel:remove',_0x135bf1);io[_0x91cb('0x26')]('voice_queue_presence:remove',_0x135bf1);}function notSendMessagesQueue(_0x4117db){if(_0x4117db[_0x91cb('0x5d')]){if(_0x4117db[_0x91cb('0x5e')]===0x0&&_0x4117db[_0x91cb('0x2d')]===0x0){_0x4117db[_0x91cb('0x5d')]=![];_0x4117db[_0x91cb('0x5f')]=0x0;_0x4117db['paused']=0x0;_0x4117db[_0x91cb('0x4f')]=_0x91cb('0x60');ut['logger'](_0x91cb('0x61'),_0x4117db['name']+_0x91cb('0x62'));}else{_0x4117db[_0x91cb('0x4f')]=_0x91cb('0x63');ut[_0x91cb('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x4117db[_0x91cb('0x29')]+_0x91cb('0x65'));}emitCampaignPreview(_0x4117db);}}Preview[_0x91cb('0xf')][_0x91cb('0x24')]=function(){var _0x42a7f3=this;setInterval(function(){_0x42a7f3[_0x91cb('0x66')]();},0x7cf);};Preview[_0x91cb('0xf')][_0x91cb('0x66')]=function(){var _0x325dca=this[_0x91cb('0x25')];this['clockClearZombieChannels']+=0x1;for(var _0x16993f in _0x325dca){if(_0x325dca['hasOwnProperty'](_0x16993f)&&(_0x325dca[_0x16993f][_0x91cb('0x35')]==='preview'||_0x325dca[_0x16993f][_0x91cb('0x35')]==='booked')&&_0x325dca[_0x16993f][_0x91cb('0x27')]===_0x91cb('0x28')){if(this[_0x91cb('0x18')]>0x7){this[_0x91cb('0x18')]=0x0;this['clearZombieChannels']();}}if(_0x325dca[_0x91cb('0x67')](_0x16993f)&&_0x325dca[_0x16993f][_0x91cb('0x35')]==='preview'&&_0x325dca[_0x16993f][_0x91cb('0x27')]===_0x91cb('0x28')){if(_0x325dca[_0x16993f][_0x91cb('0x68')]){this[_0x91cb('0x69')](_0x325dca[_0x16993f]);if(_0x325dca[_0x16993f][_0x91cb('0x6a')])this[_0x91cb('0x6b')](_0x325dca[_0x16993f]);}else{notSendMessagesQueue(_0x325dca[_0x16993f]);}}}};Preview[_0x91cb('0xf')][_0x91cb('0x6c')]=function(_0x396b81){var _0x4b26f6=this;this[_0x91cb('0x13')][_0x91cb('0x10')](function(){if(!_[_0x91cb('0x6d')](_0x4b26f6[_0x91cb('0x16')][_0x396b81])){loggerAction[_0x91cb('0x6e')](_0x91cb('0x6f'),_0x396b81,_0x91cb('0x70'),_0x4b26f6[_0x91cb('0x16')][_0x396b81]['queue'],_0x91cb('0x71'),JSON[_0x91cb('0x58')](_0x4b26f6[_0x91cb('0x25')][_0x4b26f6[_0x91cb('0x16')][_0x396b81]['queue']][_0x91cb('0x5e')]),_0x91cb('0x72'),JSON['stringify'](_0x4b26f6[_0x91cb('0x25')][_0x4b26f6['actions'][_0x396b81][_0x91cb('0x73')]]['pTalking']),JSON['stringify'](_0x4b26f6['actions'][_0x396b81][_0x91cb('0x74')]),JSON[_0x91cb('0x58')](_[_0x91cb('0x75')](_0x4b26f6[_0x91cb('0x16')][_0x396b81],[_0x91cb('0x76'),'UserId','VoiceQueueId',_0x91cb('0x77')])));return ami[_0x91cb('0x78')]({'action':_0x91cb('0x79'),'channel':_0x4b26f6[_0x91cb('0x16')][_0x396b81]['channel']})['catch'](function(_0x53f979){if(_0x53f979[_0x91cb('0x4f')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x4b26f6[_0x91cb('0x16')][_0x396b81]){ut['updateOriginated'](_0x4b26f6[_0x91cb('0x25')][_0x4b26f6[_0x91cb('0x16')][_0x396b81][_0x91cb('0x73')]],_0x91cb('0x7a'));if(_0x4b26f6[_0x91cb('0x16')][_0x396b81][_0x91cb('0x74')]===!![]){ut[_0x91cb('0x7b')](_0x4b26f6[_0x91cb('0x25')][_0x4b26f6[_0x91cb('0x16')][_0x396b81][_0x91cb('0x73')]],_0x91cb('0x7a'));ut['loggerError'](_0x91cb('0x7c')+_0x396b81,_0x4b26f6[_0x91cb('0x16')][_0x396b81]['queue']);}ut[_0x91cb('0x7d')](_0x91cb('0x7e')+_0x396b81,_0x4b26f6['actions'][_0x396b81][_0x91cb('0x73')]);delete _0x4b26f6[_0x91cb('0x16')][_0x396b81];}},0x2328);}});}});};Preview[_0x91cb('0xf')][_0x91cb('0x7f')]=function(){var _0x43ddee=this;loggerAction[_0x91cb('0x6e')](_0x91cb('0x80'),_[_0x91cb('0x81')](this[_0x91cb('0x16')]));for(var _0x93ef52 in this[_0x91cb('0x16')]){if(_0x43ddee['actions'][_0x91cb('0x67')](_0x93ef52)){_0x43ddee['clearZombieChannel'](_0x93ef52);}}};Preview[_0x91cb('0xf')]['recallMe']=function(_0x3dfff9){var _0x1b2fec=this;rpcDb[_0x91cb('0x82')](_0x3dfff9['id'],ut['agentReadyId'](this[_0x91cb('0x17')]))[_0x91cb('0x83')](function(_0x48dcf7){if(!_[_0x91cb('0x6d')](_0x48dcf7)){for(var _0x102025=0x0;_0x102025<_0x48dcf7[_0x91cb('0x84')];_0x102025+=0x1){if(ut[_0x91cb('0x85')](_0x48dcf7[_0x102025]['scheduledat'])<_0x3dfff9[_0x91cb('0x86')]*0x3c){if(_0x48dcf7[_0x102025][_0x91cb('0x87')]&&!_0x48dcf7[_0x102025][_0x91cb('0x87')][_0x91cb('0x88')]){_0x1b2fec['run'](_0x48dcf7[_0x102025]['id'])[_0x91cb('0x83')](ut[_0x91cb('0x89')]('[RecallMe]'))['catch'](ut[_0x91cb('0x89')]('[RecallMe]'));}else{rpcDb[_0x91cb('0x8a')](_0x48dcf7[_0x102025]['id']);}}else{var _0x1237fd=new Action(_0x48dcf7[_0x102025],_0x3dfff9);_0x1237fd['starttime']=moment()['format'](_0x91cb('0x8b'));_0x3dfff9['outboundReCallsDay']+=0x1;ut[_0x91cb('0x8c')](_0x1237fd,0x17,_0x91cb('0x8d'));if(_0x3dfff9[_0x91cb('0x8e')]){rpcDb['rescheduleContactInQueue'](ut[_0x91cb('0x8f')](_0x48dcf7[_0x102025]));rpcDb['createCustomerHistory'](_0x1237fd,_0x91cb('0x90'));}else{ut[_0x91cb('0x8c')](_0x1237fd,0x16,_0x91cb('0x91'));rpcDb[_0x91cb('0x92')](_0x1237fd,'[HistoryRecallClose]');rpcDb[_0x91cb('0x93')](_0x1237fd,_0x91cb('0x94'));}}}}})[_0x91cb('0x95')](ut[_0x91cb('0x89')](_0x91cb('0x96')));};Preview[_0x91cb('0xf')][_0x91cb('0x69')]=function(_0x2785f9){_0x2785f9[_0x91cb('0x5d')]=!![];if(ut[_0x91cb('0x97')](_0x2785f9[_0x91cb('0x2c')])){_0x2785f9[_0x91cb('0x4f')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x91cb('0x98')](_0x2785f9[_0x91cb('0x68')])){_0x2785f9[_0x91cb('0x4f')]=_0x91cb('0x60');}else if(!this[_0x91cb('0x99')](_0x2785f9[_0x91cb('0x55')])){if(!this[_0x91cb('0x99')](_0x2785f9['TrunkBackup'])){_0x2785f9[_0x91cb('0x4f')]='TRUNK_IS_NOT_REACHABLE';}else{_0x2785f9[_0x91cb('0x4f')]=_0x91cb('0x9a');}}else{_0x2785f9[_0x91cb('0x4f')]=_0x91cb('0x9a');}emitCampaignPreview(_0x2785f9);};Preview['prototype'][_0x91cb('0x9b')]=function(_0x22ab40,_0x3ebb91,_0x404b50){var _0x1bb16f=this;var _0xe50154=this['actions'][_0x3ebb91];var _0x419841=this[_0x91cb('0x25')][_0xe50154[_0x91cb('0x73')]];var _0x1f0ba2;if(_0x419841){switch(_0x404b50){case'1':_0x419841[_0x91cb('0x3f')]+=0x1;_0xe50154[_0x91cb('0x9c')]+=0x1;_0xe50154[_0x91cb('0x9d')]=ut[_0x91cb('0x9e')](_0xe50154);ut[_0x91cb('0x8c')](_0xe50154,0x0,_0x91cb('0x9f'));ami[_0x91cb('0x26')](_0x91cb('0xa0'),ut[_0x91cb('0xa1')](_0xe50154,_0x91cb('0xa2')));rpcDb[_0x91cb('0x92')](_0xe50154,_0x91cb('0xa3'));if(ut[_0x91cb('0x9e')](_0xe50154)>=_0x419841['dialGlobalMaxRetry']){_0x1f0ba2=ut[_0x91cb('0xa4')](_0xe50154,0xf,_0x91cb('0xa5'));rpcDb['createCustomerFinal'](_0x1f0ba2,_0x91cb('0xa6'));}else{if(_0xe50154[_0x91cb('0x9c')]>=_0x419841[_0x91cb('0xa7')]){rpcDb['createCustomerFinal'](_0xe50154,_0x91cb('0xa6'));}else{rpcDb[_0x91cb('0xa8')](ut['scheduledAt'](_0xe50154,'countnosuchnumberretry',_0x419841[_0x91cb('0xa9')]),_0xe50154['unlockAgent'],_0xe50154[_0x91cb('0xaa')]);}}delete this[_0x91cb('0x16')][_0x22ab40['linkedid']];break;case _0x91cb('0xab'):var _0x4ad2ea=moment()[_0x91cb('0x59')](_0x91cb('0x8b'));_0xe50154['responsetime']=_0x4ad2ea;_0xe50154['answertime']=_0x4ad2ea;_0xe50154[_0x91cb('0x74')]=!![];_0x419841[_0x91cb('0x2d')]+=0x1;logger[_0x91cb('0x6e')]('[syncHangup][talking][increment]',_0xe50154[_0x91cb('0xac')],_0x91cb('0xad'),_0x419841[_0x91cb('0x29')],_0x91cb('0x72'),_0x419841['pTalking']);ami[_0x91cb('0x26')]('custom:agentconnect',ut[_0x91cb('0xa1')](_0xe50154,_0x91cb('0xae'),this[_0x91cb('0x25')][_0xe50154[_0x91cb('0x73')]]));if(_0x419841['acw']){ami['emit'](_0x91cb('0xaf'),ut['buildAcw'](_0xe50154));}break;case'16':ami[_0x91cb('0x26')](_0x91cb('0xb0'),ut[_0x91cb('0xa1')](_0xe50154,_0x91cb('0xb1'),this[_0x91cb('0x25')][_0xe50154[_0x91cb('0x73')]]));emitVoiceQueueChannelRemove(ut[_0x91cb('0xa1')](_0xe50154,'complete'));_0x419841[_0x91cb('0x39')]+=0x1;_0x419841[_0x91cb('0x32')]+=0x1;_0x419841['answered']+=0x1;ut[_0x91cb('0x7b')](_0x419841,'[16]');_0xe50154[_0x91cb('0x9d')]=ut[_0x91cb('0x9e')](_0xe50154);ut[_0x91cb('0x8c')](_0xe50154,0x4,_0x91cb('0xb2'));rpcDb[_0x91cb('0x92')](_0xe50154,_0x91cb('0xb3'));rpcDb[_0x91cb('0x93')](_0xe50154,_0x91cb('0xb4'));rpcDb[_0x91cb('0xb5')](_0xe50154);_0x419841[_0x91cb('0x2f')]+=_0xe50154[_0x91cb('0xb6')];_0x419841[_0x91cb('0x2e')]+=_0xe50154[_0x91cb('0xb6')];logger[_0x91cb('0x6e')](_0x91cb('0xb7'),_0xe50154[_0x91cb('0xac')],'\x20Queue',_0x419841[_0x91cb('0x29')],'pTalking:\x20',_0x419841[_0x91cb('0x2d')]);delete this[_0x91cb('0x16')][_0x22ab40[_0x91cb('0xb8')]];break;case _0x91cb('0xb9'):_0x419841[_0x91cb('0x3b')]+=0x1;_0xe50154[_0x91cb('0xba')]+=0x1;_0xe50154[_0x91cb('0x9d')]=ut[_0x91cb('0x9e')](_0xe50154);ut['logCustomer'](_0xe50154,0x5,_0x91cb('0xbb'));ami[_0x91cb('0x26')]('custom:agentbusy',ut['buildObj'](_0xe50154,_0x91cb('0xbc')));rpcDb['createCustomerHistory'](_0xe50154,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x91cb('0x9e')](_0xe50154)>=_0x419841['dialGlobalMaxRetry']){_0x1f0ba2=ut[_0x91cb('0xa4')](_0xe50154,0xf,'Global');rpcDb[_0x91cb('0x93')](_0x1f0ba2,_0x91cb('0xbd'));}else{if(_0xe50154[_0x91cb('0xba')]>=_0x419841[_0x91cb('0xbe')]){rpcDb['createCustomerFinal'](_0xe50154,_0x91cb('0xbf'));}else{rpcDb[_0x91cb('0xa8')](ut[_0x91cb('0xc0')](_0xe50154,_0x91cb('0xba'),_0x419841[_0x91cb('0xc1')]),_0xe50154[_0x91cb('0xc2')],_0xe50154[_0x91cb('0xaa')]);}}break;case _0x91cb('0xc3'):_0x419841[_0x91cb('0xc4')]+=0x1;_0xe50154[_0x91cb('0xc5')]+=0x1;_0xe50154[_0x91cb('0x9d')]=ut[_0x91cb('0x9e')](_0xe50154);ut[_0x91cb('0x8c')](_0xe50154,0x3,_0x91cb('0xc6'));ami[_0x91cb('0x26')](_0x91cb('0xc7'),ut[_0x91cb('0xa1')](_0xe50154,_0x91cb('0xc8')));rpcDb[_0x91cb('0x92')](_0xe50154,_0x91cb('0xc9'));if(ut[_0x91cb('0x9e')](_0xe50154)>=_0x419841[_0x91cb('0xca')]){_0x1f0ba2=ut[_0x91cb('0xa4')](_0xe50154,0xf,_0x91cb('0xa5'));rpcDb[_0x91cb('0x93')](_0x1f0ba2,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0xe50154[_0x91cb('0xc5')]>=_0x419841[_0x91cb('0xcb')]){rpcDb[_0x91cb('0x93')](_0xe50154,_0x91cb('0xc9'));}else{rpcDb[_0x91cb('0xa8')](ut[_0x91cb('0xc0')](_0xe50154,_0x91cb('0xc5'),_0x419841[_0x91cb('0xcc')]),_0xe50154[_0x91cb('0xc2')],_0xe50154[_0x91cb('0xaa')]);}}break;case _0x91cb('0xcd'):_0x419841['outboundCongestionCallsDay']+=0x1;_0xe50154[_0x91cb('0xce')]+=0x1;_0xe50154['countglobal']=ut['totalGlobal'](_0xe50154);ut[_0x91cb('0x8c')](_0xe50154,0x8,_0x91cb('0xcf'));ami[_0x91cb('0x26')](_0x91cb('0xd0'),ut[_0x91cb('0xa1')](_0xe50154,_0x91cb('0xd1')));rpcDb[_0x91cb('0x92')](_0xe50154,_0x91cb('0xd2'));if(ut[_0x91cb('0x9e')](_0xe50154)>=_0x419841[_0x91cb('0xca')]){_0x1f0ba2=ut['cloneAction'](_0xe50154,0xf,_0x91cb('0xa5'));rpcDb[_0x91cb('0x93')](_0x1f0ba2,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0xe50154[_0x91cb('0xce')]>=_0x419841[_0x91cb('0xd3')]){rpcDb['createCustomerFinal'](_0xe50154,_0x91cb('0xd2'));}else{rpcDb[_0x91cb('0xa8')](ut[_0x91cb('0xc0')](_0xe50154,_0x91cb('0xce'),_0x419841[_0x91cb('0xc1')]),_0xe50154[_0x91cb('0xc2')],_0xe50154[_0x91cb('0xaa')]);}}break;case _0x91cb('0xd4'):_0x419841[_0x91cb('0xd5')]+=0x1;_0xe50154[_0x91cb('0xd6')]+=0x1;_0xe50154[_0x91cb('0x9d')]=ut[_0x91cb('0x9e')](_0xe50154);ut['logCustomer'](_0xe50154,0x14,'AgentReject');ami[_0x91cb('0x26')](_0x91cb('0xd7'),ut[_0x91cb('0xa1')](_0xe50154,_0x91cb('0xd8')));rpcDb[_0x91cb('0x92')](_0xe50154,_0x91cb('0xd9'));if(ut[_0x91cb('0x9e')](_0xe50154)>=_0x419841['dialGlobalMaxRetry']){_0x1f0ba2=ut[_0x91cb('0xa4')](_0xe50154,0x14,'AgentReject');rpcDb[_0x91cb('0x93')](_0x1f0ba2,_0x91cb('0xda'));}else{if(_0xe50154[_0x91cb('0xd6')]>=_0x419841[_0x91cb('0xdb')]){rpcDb[_0x91cb('0x93')](_0xe50154,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x91cb('0xa8')](ut[_0x91cb('0xc0')](_0xe50154,_0x91cb('0xd6'),_0x419841[_0x91cb('0xdc')]),_0xe50154[_0x91cb('0xc2')],_0xe50154['activeContact']);}}break;case _0x91cb('0xdd'):_0x419841[_0x91cb('0x43')]+=0x1;_0xe50154[_0x91cb('0xde')]+=0x1;_0xe50154[_0x91cb('0x9d')]=ut['totalGlobal'](_0xe50154);ut['logCustomer'](_0xe50154,0xb,'Abandoned');rpcDb[_0x91cb('0x92')](_0xe50154,_0x91cb('0xdf'));if(ut[_0x91cb('0x9e')](_0xe50154)>=_0x419841[_0x91cb('0xca')]){_0x1f0ba2=ut['cloneAction'](_0xe50154,0xf,_0x91cb('0xa5'));rpcDb[_0x91cb('0x93')](_0x1f0ba2,_0x91cb('0xdf'));}else{if(_0xe50154[_0x91cb('0xe0')]>=_0x419841['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0xe50154,_0x91cb('0xdf'));}else{rpcDb[_0x91cb('0xa8')](ut[_0x91cb('0xc0')](_0xe50154,_0x91cb('0xde'),_0x419841[_0x91cb('0xe1')]),_0xe50154[_0x91cb('0xc2')],_0xe50154[_0x91cb('0xaa')]);}}break;case'18':_0x419841[_0x91cb('0x42')]+=0x1;_0xe50154[_0x91cb('0xe2')]+=0x1;_0xe50154[_0x91cb('0x9d')]=ut[_0x91cb('0x9e')](_0xe50154);ut[_0x91cb('0x8c')](_0xe50154,0x12,_0x22ab40[_0x91cb('0xe3')]||_0x22ab40['dialstatus']);ami['emit'](_0x91cb('0xe4'),ut['buildObj'](_0xe50154,_0x91cb('0xe5')));rpcDb[_0x91cb('0x92')](_0xe50154,_0x91cb('0xe6'));if(ut[_0x91cb('0x9e')](_0xe50154)>=_0x419841[_0x91cb('0xca')]){_0x1f0ba2=ut[_0x91cb('0xa4')](_0xe50154,0xf,_0x91cb('0xa5'));rpcDb[_0x91cb('0x93')](_0x1f0ba2,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x91cb('0x93')](_0xe50154,_0x91cb('0xe6'));}delete this[_0x91cb('0x16')][_0x22ab40[_0x91cb('0xb8')]];break;case'19':_0x419841[_0x91cb('0x42')]+=0x1;_0xe50154['countglobal']=ut[_0x91cb('0x9e')](_0xe50154);ut[_0x91cb('0x8c')](_0xe50154,0x13,_0x22ab40[_0x91cb('0xe3')]||_0x22ab40[_0x91cb('0xe7')]);ami[_0x91cb('0x26')]('custom:amd',ut[_0x91cb('0xa1')](_0xe50154,_0x91cb('0xe5')));rpcDb[_0x91cb('0x92')](_0xe50154,_0x91cb('0xe8'));if(ut[_0x91cb('0x9e')](_0xe50154)>=_0x419841[_0x91cb('0xca')]){_0x1f0ba2=ut[_0x91cb('0xa4')](_0xe50154,0xf,_0x91cb('0xa5'));rpcDb[_0x91cb('0x93')](_0x1f0ba2,_0x91cb('0xe8'));}else{rpcDb[_0x91cb('0x93')](_0xe50154,_0x91cb('0xe8'));}delete this[_0x91cb('0x16')][_0x22ab40[_0x91cb('0xb8')]];break;default:if(_0xe50154[_0x91cb('0x74')]){ut[_0x91cb('0x7b')](_0x419841,_0x91cb('0xe9'));ut[_0x91cb('0x7d')](_0x91cb('0xea')+_0x419841[_0x91cb('0x29')],_0x22ab40);}_0x419841[_0x91cb('0x42')]+=0x1;_0xe50154[_0x91cb('0x9d')]=ut[_0x91cb('0x9e')](_0xe50154);ut[_0x91cb('0x8c')](_0xe50154,0xc,_0x22ab40[_0x91cb('0xe3')]||_0x22ab40[_0x91cb('0xe7')]);rpcDb['createCustomerHistory'](_0xe50154,_0x91cb('0xeb'));if(ut[_0x91cb('0x9e')](_0xe50154)>=_0x419841[_0x91cb('0xca')]){_0x1f0ba2=ut[_0x91cb('0xa4')](_0xe50154,0xf,_0x91cb('0xa5'));rpcDb['createCustomerFinal'](_0x1f0ba2,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0xe50154,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x22ab40[_0x91cb('0xb8')]];}if(!(_0xe50154[_0x91cb('0x74')]&&_0x404b50==='16')){ut[_0x91cb('0xec')](_0x419841,_0x91cb('0xed'));logger[_0x91cb('0x6e')](_0x91cb('0xee'),_0xe50154[_0x91cb('0xac')],_0x91cb('0xad'),_0x419841[_0x91cb('0x29')],_0x91cb('0x71'),_0x419841['originated']);}if(_0x404b50!==_0x91cb('0xab')){delete this[_0x91cb('0x16')][_0x22ab40['linkedid']];delete this[_0x91cb('0x16')][_0x22ab40[_0x91cb('0xef')]];}}};Preview[_0x91cb('0xf')][_0x91cb('0xf0')]=function(_0x1837ec,_0x30697c,_0x399f47){if(_['isUndefined'](_0x30697c)&&_0x91cb('0xf1')!==typeof _0x30697c){return;}if(_[_0x91cb('0xf2')](_0x399f47)&&_0x91cb('0xf1')!==typeof _0x399f47){return;}switch(_0x399f47[_0x91cb('0xf3')]){case'0':ut[_0x91cb('0xf4')](_0x1837ec,0x0,_0x91cb('0x9f'));rpcDb[_0x91cb('0xf5')](_0x1837ec,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x91cb('0xf4')](_0x1837ec,0x3,'NoAnswer');rpcDb[_0x91cb('0xf5')](_0x1837ec,_0x91cb('0xf6'));break;case'5':ut[_0x91cb('0xf4')](_0x1837ec,0x5,_0x91cb('0xbb'));rpcDb[_0x91cb('0xf5')](_0x1837ec,_0x91cb('0xf7'));break;case'8':ut[_0x91cb('0xf4')](_0x1837ec,0x8,_0x91cb('0xcf'));rpcDb[_0x91cb('0xf5')](_0x1837ec,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x91cb('0xf4')](_0x1837ec,0x16,_0x91cb('0xf8'));rpcDb[_0x91cb('0xf5')](_0x1837ec,_0x91cb('0xf9'));break;default:ut[_0x91cb('0xf4')](_0x1837ec,0xc,_0x399f47[_0x91cb('0xf3')]);rpcDb[_0x91cb('0xf5')](_0x1837ec,_0x91cb('0xfa'));}ut[_0x91cb('0xec')](_0x30697c,_0x91cb('0xfb'));logger[_0x91cb('0x6e')](_0x91cb('0xfc'),_0x1837ec[_0x91cb('0xac')],'\x20Queue',_0x30697c[_0x91cb('0x29')],'originated:\x20',_0x30697c[_0x91cb('0x5e')]);delete this[_0x91cb('0x16')][_0x1837ec[_0x91cb('0xac')]];};Preview[_0x91cb('0xf')][_0x91cb('0xfd')]=function(_0x12da14,_0x2f9b59,_0x17f5dd,_0x4d684e,_0x3353bf){var _0x5b3658=this;return new BPromise(function(_0x3c1703,_0x2f7387){if(_[_0x91cb('0x6d')](_0x2f9b59)||_['isNil'](_0x2f9b59[_0x91cb('0xfe')])||_[_0x91cb('0x6d')](_0x2f9b59[_0x91cb('0xfe')]['phone'])||_['isNil'](_0x2f9b59['VoiceQueueId'])){_0x2f7387(ut[_0x91cb('0x4f')](_0x91cb('0xff'),_0x4d684e,_0x3353bf));return;}var _0x3ac830=uuid['v4']();var _0x5a806e=_0x5b3658[_0x91cb('0x25')][_0x2f9b59[_0x91cb('0x70')][_0x91cb('0x29')]];var _0x1bb2de=_0x17f5dd?_0x5b3658[_0x91cb('0x17')][_0x17f5dd]['id']:undefined;_0x5b3658[_0x91cb('0x16')][_0x3ac830]=new Action(_0x2f9b59,_0x5a806e,_0x3ac830,_0x17f5dd,_0x1bb2de);var _0x3e9eea=_0x5b3658[_0x91cb('0x16')][_0x3ac830];_0x3e9eea['unlockAgent']=_0x4d684e;_0x3e9eea[_0x91cb('0xaa')]=_0x3353bf;_0x3e9eea[_0x91cb('0x100')]=_0x17f5dd;if(_[_0x91cb('0x101')](_0x12da14)){_0x5b3658[_0x91cb('0x102')](_0x3e9eea,_0x5a806e,_0x2f9b59,_0x17f5dd)['then'](function(_0x37a835){logger['info'](_0x91cb('0x103'),_0x91cb('0x104')+_0x3e9eea[_0x91cb('0x73')]+_0x91cb('0x105')+_0x3e9eea[_0x91cb('0x106')],JSON['stringify'](_0x37a835));ami[_0x91cb('0x26')]('custom:agentcalled',ut['buildObj'](_0x3e9eea,_0x91cb('0x107'),_0x5b3658[_0x91cb('0x25')][_0x3e9eea[_0x91cb('0x73')]]));_0x3c1703(ut[_0x91cb('0x4f')](_0x91cb('0x108')));})[_0x91cb('0x95')](function(_0x20ef3d){ut[_0x91cb('0x64')]('[Preview][execCall][failure]',_0x20ef3d);_0x2f7387(ut[_0x91cb('0x4f')](_0x91cb('0x109'),_0x4d684e,_0x3353bf));});}else{_0x5a806e[_0x91cb('0x3a')]+=0x1;ut['logBlacklist'](_0x3e9eea);rpcDb['createHistory'](_0x3e9eea,'[Blacklist][error]');delete _0x5b3658[_0x91cb('0x16')][_0x3ac830];_0x2f7387(ut[_0x91cb('0x4f')](_0x91cb('0x10a'),_0x4d684e,_0x3353bf));}});};Preview['prototype'][_0x91cb('0x99')]=function(_0xbb5862){return!_[_0x91cb('0x6d')](_0xbb5862)&&!_[_0x91cb('0x6d')](_0xbb5862['name'])&&!_[_0x91cb('0x6d')](_0xbb5862[_0x91cb('0x56')])&&_0xbb5862[_0x91cb('0x56')]&&!_[_0x91cb('0x6d')](this[_0x91cb('0x15')][util[_0x91cb('0x59')]('SIP/%s',_0xbb5862[_0x91cb('0x29')])])&&!_[_0x91cb('0x6d')](this[_0x91cb('0x15')][util[_0x91cb('0x59')](_0x91cb('0x10b'),_0xbb5862['name'])][_0x91cb('0x79')])&&(this[_0x91cb('0x15')][util[_0x91cb('0x59')](_0x91cb('0x10b'),_0xbb5862[_0x91cb('0x29')])][_0x91cb('0x79')]==='reachable'||this[_0x91cb('0x15')][util[_0x91cb('0x59')](_0x91cb('0x10b'),_0xbb5862['name'])][_0x91cb('0x79')]==='unmonitored');};Preview[_0x91cb('0xf')][_0x91cb('0x10c')]=function(_0x412855,_0x1de00b){var _0x4df6c1=this;return new BPromise(function(_0x2b29a5,_0x6bebc){_0x4df6c1[_0x91cb('0x10d')](_0x412855,_0x1de00b)['then'](function(_0x2326f8){_0x2b29a5(_['pick'](_0x2326f8,[_0x91cb('0x4f')]));})[_0x91cb('0x95')](function(_0x4c43d9){if(_0x4c43d9[_0x91cb('0x10e')]){rpcDb[_0x91cb('0x10f')](_0x412855);}if(_0x4c43d9[_0x91cb('0x56')]){rpcDb[_0x91cb('0x8a')](_0x412855);}_0x6bebc(_[_0x91cb('0x75')](_0x4c43d9,['message']));});});};Preview[_0x91cb('0xf')][_0x91cb('0x10d')]=function(_0x256dd1,_0x441f8c){var _0x5db6b3=this;return new BPromise(function(_0xfc6c8c,_0x563600){var _0x4a10d2,_0x58fc53;rpcDb[_0x91cb('0x110')](_0x256dd1)[_0x91cb('0x83')](function(_0x262e29){if(!_['isNil'](_0x262e29[0x0])){_0x58fc53=_0x262e29[0x0][_0x91cb('0x111')]?![]:!![];_0x4a10d2=_0x262e29[0x0]['recallme']?!![]:![];_0x4a10d2=_0x441f8c?!![]:_0x4a10d2;}var _0x51c28a=_0x5db6b3[_0x91cb('0x112')](_0x262e29);if(_0x51c28a[_0x91cb('0x113')]){rpcDb[_0x91cb('0x114')](_[_0x91cb('0x75')](_0x262e29[0x0],[_0x91cb('0x115'),'Contact.phone']))['then'](function(_0x387eb8){_0x5db6b3['checkInBlack'](_0x387eb8,_0x262e29[0x0],_0x441f8c,_0x58fc53,_0x4a10d2)[_0x91cb('0x83')](function(_0x42ac5a){_0xfc6c8c(_0x42ac5a);})[_0x91cb('0x95')](function(_0x1425aa){_0x563600(_0x1425aa);});})[_0x91cb('0x95')](function(_0x51d431){ut[_0x91cb('0x64')](_0x91cb('0x116'),_0x51d431);_0x563600(ut[_0x91cb('0x4f')]('Call\x20unsuccessful',_0x58fc53,_0x4a10d2));});}else{_0x563600(ut[_0x91cb('0x4f')](_0x51c28a[_0x91cb('0x4f')],_0x58fc53,_0x4a10d2));}})['catch'](function(_0x5090bc){ut[_0x91cb('0x64')](_0x91cb('0x117'),_0x5090bc);_0x563600(ut[_0x91cb('0x4f')](_0x91cb('0x118'),![],!![]));});});};Preview[_0x91cb('0xf')]['validateContact']=function(_0x91f3dc){if(_['isNil'](_0x91f3dc)||_['isEmpty'](_0x91f3dc)||!_['isNil'](_0x91f3dc[0x0][_0x91cb('0x87')])&&_['isNil'](_0x91f3dc[0x0]['Agent'][_0x91cb('0x29')])){ut[_0x91cb('0x64')](_0x91cb('0x119'),_0x91f3dc);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x4e13bb=this[_0x91cb('0x25')][_0x91f3dc[0x0][_0x91cb('0x70')]['name']];_0x4e13bb[_0x91cb('0x4f')]=_0x91cb('0x9a');if(_[_0x91cb('0x6d')](_0x4e13bb)){ut[_0x91cb('0x64')](_0x91cb('0x11a'),_0x4e13bb);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x4e13bb[_0x91cb('0x55')])){ut[_0x91cb('0x64')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x91cb('0x11b')+_0x4e13bb[_0x91cb('0x29')]+_0x91cb('0x11c'));if(!this[_0x91cb('0x99')](_0x4e13bb[_0x91cb('0x11d')])){ut['logger'](_0x91cb('0x11e'),_0x4e13bb[_0x91cb('0x29')]+_0x91cb('0x11f'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x4e13bb[_0x91cb('0x68')])){ut[_0x91cb('0x64')](_0x91cb('0x120'),_0x4e13bb[_0x91cb('0x29')]+_0x91cb('0x121'));return{'isValid':![],'message':_0x91cb('0x11b')+_0x4e13bb[_0x91cb('0x29')]+_0x91cb('0x121')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x91cb('0xf')][_0x91cb('0x102')]=function(_0x4ac7b9,_0x41c3ff,_0x1ffd5a,_0x582523){var _0x13e8fd=this;return new BPromise(function(_0x398650,_0x1111ab){var _0x67b96=_0x4ac7b9[_0x91cb('0xac')];var _0x5b01c8=_0x13e8fd[_0x91cb('0x99')](_0x41c3ff[_0x91cb('0x55')])?util[_0x91cb('0x59')](_0x91cb('0x122'),_0x41c3ff['Trunk'][_0x91cb('0x29')],_['isNil'](_0x41c3ff[_0x91cb('0x38')])?'':_0x41c3ff[_0x91cb('0x38')][_0x91cb('0x123')]()||'',_0x41c3ff[_0x91cb('0x124')]>0x0?_0x1ffd5a[_0x91cb('0xfe')][_0x91cb('0x125')][_0x91cb('0x126')](_0x41c3ff[_0x91cb('0x124')]):_0x1ffd5a[_0x91cb('0xfe')]['phone']):util[_0x91cb('0x59')](_0x91cb('0x122'),_[_0x91cb('0x6d')](_0x41c3ff['TrunkBackup'])?_0x41c3ff[_0x91cb('0x55')]['name']:_0x41c3ff[_0x91cb('0x11d')]['name'],_[_0x91cb('0x6d')](_0x41c3ff[_0x91cb('0x38')])?'':_0x41c3ff[_0x91cb('0x38')][_0x91cb('0x123')]()||'',_0x41c3ff[_0x91cb('0x124')]>0x0?_0x1ffd5a[_0x91cb('0xfe')][_0x91cb('0x125')]['substring'](_0x41c3ff[_0x91cb('0x124')]):_0x1ffd5a[_0x91cb('0xfe')][_0x91cb('0x125')]);var _0x29af30=_0x13e8fd[_0x91cb('0x99')](_0x41c3ff[_0x91cb('0x55')])?ut[_0x91cb('0x127')](_0x41c3ff['Trunk'][_0x91cb('0x128')],_0x41c3ff[_0x91cb('0x36')],_0x41c3ff[_0x91cb('0x129')]>0x0?ut[_0x91cb('0x12a')](_0x41c3ff[_0x91cb('0x37')],_0x41c3ff['dialRandomLastDigitCallerIdNumber']):_0x41c3ff['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0x91cb('0x6d')](_0x41c3ff[_0x91cb('0x11d')])?_0x41c3ff['Trunk']['callerid']:_0x41c3ff[_0x91cb('0x11d')][_0x91cb('0x128')],_0x41c3ff[_0x91cb('0x36')],_0x41c3ff[_0x91cb('0x129')]>0x0?ut[_0x91cb('0x12a')](_0x41c3ff[_0x91cb('0x37')],_0x41c3ff[_0x91cb('0x129')]):_0x41c3ff[_0x91cb('0x37')]);if(_0x29af30){_0x4ac7b9['originatecalleridname']=ut[_0x91cb('0x12b')](_0x29af30);_0x4ac7b9[_0x91cb('0x12c')]=ut[_0x91cb('0x12d')](_0x29af30);}var _0x48241a=ut[_0x91cb('0x12e')](_0x41c3ff,_0x1ffd5a,_0x5b01c8,_0x29af30,_0x67b96,_0x4ac7b9);_[_0x91cb('0x12f')](_0x4ac7b9,ut[_0x91cb('0x130')](_0x48241a));_0x4ac7b9[_0x91cb('0x131')]=moment()[_0x91cb('0x59')](_0x91cb('0x8b'));ami[_0x91cb('0x78')](ut[_0x91cb('0x132')](_0x4ac7b9,_0x41c3ff,_0x48241a,_0x4ac7b9['activeContact'],_0x582523))['then'](function(_0x23800b){_0x41c3ff['originated']+=0x1;logger[_0x91cb('0x6e')](_0x91cb('0x133'),_0x67b96,_0x91cb('0xad'),_0x41c3ff[_0x91cb('0x29')],'originated:\x20',_0x41c3ff[_0x91cb('0x5e')]);_0x398650(_0x23800b);})[_0x91cb('0x95')](function(_0x19e5b6){ut[_0x91cb('0xf4')](_0x4ac7b9,0xe,_0x91cb('0x134'));rpcDb[_0x91cb('0xf5')](_0x4ac7b9,_0x91cb('0x135'));_0x1111ab(_0x19e5b6);});});};Preview[_0x91cb('0xf')]['syncNewExten']=function(_0x15b223){if(this['actions'][_0x15b223[_0x91cb('0xb8')]]){this[_0x91cb('0x16')][_0x15b223['linkedid']][_0x91cb('0x136')]=_0x15b223[_0x91cb('0x136')];}};Preview[_0x91cb('0xf')][_0x91cb('0x137')]=function(_0x58f5fa){var _0x2b1b7b=this;var _0x1bef2b=this['actions'][_0x58f5fa[_0x91cb('0x138')]];if(_0x1bef2b){if(_0x1bef2b[_0x91cb('0x100')]&&this[_0x91cb('0x17')][_0x1bef2b[_0x91cb('0x100')]]){ut[_0x91cb('0x139')](_0x1bef2b,this[_0x91cb('0x17')][_0x1bef2b[_0x91cb('0x100')]][_0x91cb('0x29')],this[_0x91cb('0x17')][_0x1bef2b[_0x91cb('0x100')]]['id']);}var _0x4b10b3=_[_0x91cb('0x13a')](_0x1bef2b);_0x4b10b3[_0x91cb('0x13b')]=moment()[_0x91cb('0x59')](_0x91cb('0x8b'));var _0x3f6a70=_0x2b1b7b[_0x91cb('0x25')][_0x1bef2b[_0x91cb('0x73')]];if(ut[_0x91cb('0x13c')](_0x58f5fa[_0x91cb('0x13d')])){if(_0x1bef2b[_0x91cb('0xc2')]){rpcDb[_0x91cb('0x10f')](_0x1bef2b['idContact']);}if(_0x1bef2b[_0x91cb('0xaa')]){rpcDb['disableContact'](_0x1bef2b[_0x91cb('0x106')]);}ami[_0x91cb('0x26')](_0x91cb('0x13e'),ut[_0x91cb('0xa1')](_0x1bef2b,_0x91cb('0x13f'),this[_0x91cb('0x25')][_0x1bef2b[_0x91cb('0x73')]]));this['callProgressDetectingAgent'](_0x4b10b3,_0x3f6a70,_0x58f5fa);}else{_0x1bef2b[_0x91cb('0x131')]=moment()[_0x91cb('0x59')](_0x91cb('0x8b'));ut[_0x91cb('0xf4')](_0x4b10b3,0x4,'Answer');rpcDb['createAgentHistory'](_0x4b10b3,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x91cb('0xf')][_0x91cb('0x140')]=function(_0x5b2f91){var _0x53a3f6=this;var _0x5d33dc=this[_0x91cb('0x16')][_0x5b2f91[_0x91cb('0xb8')]];var _0x4f769e;if(_0x5d33dc){_0x4f769e=this['campaignsPreview'][_0x5d33dc['queue']];logger[_0x91cb('0x6e')](_0x91cb('0x141'),_0x5b2f91['linkedid'],_0x91cb('0xad'),_0x4f769e[_0x91cb('0x29')],'pTalking:\x20',_0x4f769e['pTalking']);}if(this[_0x91cb('0x16')][_0x5b2f91[_0x91cb('0xb8')]]&&_0x5b2f91[_0x91cb('0xb8')]!==_0x5b2f91[_0x91cb('0xac')]){if(_0x5b2f91[_0x91cb('0x142')]==='16'&&this['actions'][_0x5b2f91[_0x91cb('0xb8')]][_0x91cb('0x74')]){this['callProgressDetectingCustomer'](_0x5b2f91,_0x5b2f91[_0x91cb('0xb8')],_0x5b2f91[_0x91cb('0x142')]);}else if(this[_0x91cb('0x16')][_0x5b2f91[_0x91cb('0xb8')]][_0x91cb('0x74')]){logger[_0x91cb('0x6e')](_0x91cb('0x143'),_0x5b2f91[_0x91cb('0xb8')],_0x5b2f91[_0x91cb('0x142')],_0x91cb('0xad'),_0x4f769e[_0x91cb('0x29')],_0x91cb('0x72'),_0x4f769e[_0x91cb('0x2d')]);this[_0x91cb('0x9b')](_0x5b2f91,_0x5b2f91[_0x91cb('0xb8')],_0x5b2f91[_0x91cb('0x142')]);}}else if(_0x5d33dc&&_[_0x91cb('0x6d')](_0x5d33dc['statedesc'])&&_0x4f769e['dialQueueProject']&&_0x5b2f91['linkedid']===_0x5b2f91[_0x91cb('0xac')]&&_['isNil'](_0x5b2f91[_0x91cb('0xf3')])&&_0x5b2f91[_0x91cb('0x142')]==='16'&&_0x5b2f91[_0x91cb('0x144')]==='6'&&_[_0x91cb('0xf2')](_0x5d33dc[_0x91cb('0x145')])){if(_0x5d33dc[_0x91cb('0xc2')]){rpcDb[_0x91cb('0x10f')](_0x5d33dc[_0x91cb('0x106')]);}if(_0x5d33dc['activeContact']){rpcDb['disableContact'](_0x5d33dc['idContact']);}_0x5b2f91[_0x91cb('0xf3')]='22';this[_0x91cb('0xf0')](_0x5d33dc,_0x4f769e,_0x5b2f91);}else if(_0x5d33dc&&_0x5d33dc[_0x91cb('0x145')]){if(_0x5b2f91[_0x91cb('0x142')]==='16'&&this['actions'][_0x5b2f91['linkedid']][_0x91cb('0x74')]){logger[_0x91cb('0x6e')](_0x91cb('0x146'),_0x5b2f91[_0x91cb('0xb8')],_0x5b2f91[_0x91cb('0x142')],'\x20Queue',_0x4f769e[_0x91cb('0x29')],'pTalking:\x20',_0x4f769e[_0x91cb('0x2d')]);this[_0x91cb('0x9b')](_0x5b2f91,_0x5b2f91['linkedid'],_0x5b2f91[_0x91cb('0x142')]);}else if(this[_0x91cb('0x16')][_0x5b2f91[_0x91cb('0xb8')]][_0x91cb('0x74')]){logger[_0x91cb('0x6e')]('[syncHangup][talking][cause]',_0x5b2f91[_0x91cb('0xb8')],_0x5b2f91[_0x91cb('0x142')],_0x91cb('0xad'),_0x4f769e[_0x91cb('0x29')],_0x91cb('0x72'),_0x4f769e['pTalking']);this[_0x91cb('0x9b')](_0x5b2f91,_0x5b2f91[_0x91cb('0xb8')],_0x5b2f91[_0x91cb('0x142')]);}}};Preview['prototype']['syncDialEnd']=function(_0x45689a){if(this['actions'][_0x45689a[_0x91cb('0xef')]]&&_0x45689a[_0x91cb('0xef')]!==_0x45689a[_0x91cb('0x147')]){this[_0x91cb('0x9b')](_0x45689a,_0x45689a['destlinkedid'],_0x45689a[_0x91cb('0xe7')]);}};Preview[_0x91cb('0xf')]['syncHangupRequest']=function(_0xcb0e8){if(this[_0x91cb('0x16')][_0xcb0e8[_0x91cb('0xb8')]]&&_0xcb0e8[_0x91cb('0xb8')]!==_0xcb0e8[_0x91cb('0xac')]&&!this[_0x91cb('0x16')][_0xcb0e8['linkedid']][_0x91cb('0x74')]){if(_0xcb0e8['cause']==='1'){this[_0x91cb('0x9b')](_0xcb0e8,_0xcb0e8[_0x91cb('0xb8')],_0xcb0e8[_0x91cb('0x142')]);}}};Preview[_0x91cb('0xf')]['addVariable']=function(_0x34e4fe,_0x426bb6,_0x40a40e){if(this[_0x91cb('0x16')][_0x34e4fe]){if(_[_0x91cb('0x6d')](this[_0x91cb('0x16')][_0x34e4fe][_0x91cb('0x148')])){this[_0x91cb('0x16')][_0x34e4fe][_0x91cb('0x148')]={};}this[_0x91cb('0x16')][_0x34e4fe]['variables'][_0x426bb6]=_0x40a40e;}};Preview[_0x91cb('0xf')]['syncVarSet']=function(_0x37c4c9){try{if(!_[_0x91cb('0x6d')](_0x37c4c9)){if(ut[_0x91cb('0x149')](_[_0x91cb('0x14a')](_0x37c4c9['variable'])[0x0])){this[_0x91cb('0x14b')](_0x37c4c9[_0x91cb('0xac')],_[_0x91cb('0x14a')](_0x37c4c9['variable'])[0x0],_0x37c4c9[_0x91cb('0x14c')]);}}}catch(_0x23bc13){logger[_0x91cb('0x14d')](_0x91cb('0x14e'),util['inspect'](_0x23bc13,{'showHidden':![],'depth':null}));}};Preview[_0x91cb('0xf')]['syncAttendedTransfer']=function(_0xda02df){if(_0xda02df){if(this['actions'][_0xda02df[_0x91cb('0x14f')]]){this['actions'][_0xda02df[_0x91cb('0x14f')]][_0x91cb('0x145')]=!![];}}};Preview[_0x91cb('0xf')]['syncBlindTransfer']=function(_0x4cc7da){if(_0x4cc7da){if(this[_0x91cb('0x16')][_0x4cc7da[_0x91cb('0x150')]]){this[_0x91cb('0x16')][_0x4cc7da[_0x91cb('0x150')]]['transfer']=!![];}}};module[_0x91cb('0x151')]=Preview; \ No newline at end of file +var _0x04de=['erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','voice_queue_presence:remove','pTalking','sendMessageOneNotActive','paused','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','hasOwnProperty','booked','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','isNil','info','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','contactId','UserId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','agentReadyId','getDiff','dialRecallMeTimeout','Agent','voicePause','then','[RecallMe]','logger2','disableContact','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','AGENTS_NOT_LOGGED','NOT_ACTIVE','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','uniqueid','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','scheduledAt','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[default]','loggerError','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','VoiceQueueId','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','run','execRun','pick','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','phone','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','response','unlockContact','idContact','rejected','starttime','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','name','available','loggedIn','sumBillable','sumHoldTime','total','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls'];(function(_0x85c751,_0xec67ef){var _0x30766b=function(_0x44145d){while(--_0x44145d){_0x85c751['push'](_0x85c751['shift']());}};_0x30766b(++_0xec67ef);}(_0x04de,0x107));var _0xe04d=function(_0x10a2a2,_0x5f1413){_0x10a2a2=_0x10a2a2-0x0;var _0x197134=_0x04de[_0x10a2a2];return _0x197134;};'use strict';var util=require(_0xe04d('0x0'));var _=require(_0xe04d('0x1'));var BPromise=require(_0xe04d('0x2'));var uuid=require(_0xe04d('0x3'));var moment=require(_0xe04d('0x4'));var md5=require(_0xe04d('0x5'));var Redis=require(_0xe04d('0x6'));var config=require(_0xe04d('0x7'));var logger=require(_0xe04d('0x8'))(_0xe04d('0x9'));var loggerAction=require(_0xe04d('0x8'))('actionPreview');var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0xe04d('0xa'));config[_0xe04d('0xb')]=_[_0xe04d('0xc')](config[_0xe04d('0xb')],{'host':_0xe04d('0xd'),'port':0x18eb});var io=require(_0xe04d('0xe'))(new Redis(config[_0xe04d('0xb')]));var Sequence=function(){};Sequence[_0xe04d('0xf')]['enqueue']=function(_0x160d4f){this[_0xe04d('0x10')]=this[_0xe04d('0x10')]?this[_0xe04d('0x10')][_0xe04d('0x11')](_0x160d4f):_0x160d4f();};function Preview(_0x3e1837){this[_0xe04d('0x12')]=new Sequence();this[_0xe04d('0x13')]=_0x3e1837[_0xe04d('0x14')];this['trunks']=_0x3e1837[_0xe04d('0x15')];this[_0xe04d('0x16')]={};this[_0xe04d('0x17')]=_0x3e1837[_0xe04d('0x17')];this[_0xe04d('0x18')]=0x0;ami['on'](_0xe04d('0x19'),this[_0xe04d('0x1a')][_0xe04d('0x1b')](this));ami['on'](_0xe04d('0x1c'),this[_0xe04d('0x1d')][_0xe04d('0x1b')](this));ami['on'](_0xe04d('0x1e'),this['syncHangupRequest'][_0xe04d('0x1b')](this));ami['on']('dialend',this[_0xe04d('0x1f')]['bind'](this));ami['on'](_0xe04d('0x20'),this[_0xe04d('0x21')][_0xe04d('0x1b')](this));ami['on'](_0xe04d('0x22'),this[_0xe04d('0x23')][_0xe04d('0x1b')](this));ami['on'](_0xe04d('0x24'),this[_0xe04d('0x25')][_0xe04d('0x1b')](this));ami['on']('blindtransfer',this[_0xe04d('0x26')][_0xe04d('0x1b')](this));this[_0xe04d('0x27')](this[_0xe04d('0x13')]);}function emit(_0x2ac847,_0x34e15f,_0x55fc38){io['to'](_0x2ac847)[_0xe04d('0x28')](_0x34e15f,_0x55fc38);}function emitCampaignPreview(_0x162ee4){if(_0x162ee4['type']==='outbound'){var _0x5bcfc3={'id':_0x162ee4['id'],'name':_0x162ee4[_0xe04d('0x29')],'strategy':_0x162ee4['strategy'],'answered':_0x162ee4['answered'],'available':_0x162ee4[_0xe04d('0x2a')],'loggedIn':_0x162ee4[_0xe04d('0x2b')],'pTalking':_0x162ee4['pTalking'],'sumBillable':_0x162ee4[_0xe04d('0x2c')],'sumDuration':_0x162ee4['sumDuration'],'sumHoldTime':_0x162ee4[_0xe04d('0x2d')]||0x0,'talking':_0x162ee4['talking'],'total':_0x162ee4[_0xe04d('0x2e')],'type':_0x162ee4[_0xe04d('0x2f')],'unmanaged':_0x162ee4[_0xe04d('0x30')],'abandoned':_0x162ee4[_0xe04d('0x31')],'waiting':_0x162ee4[_0xe04d('0x32')],'loggedInDb':_0x162ee4['loggedInDb'],'dialActive':_0x162ee4[_0xe04d('0x33')],'dialMethod':_0x162ee4[_0xe04d('0x34')],'dialOriginateCallerIdName':_0x162ee4[_0xe04d('0x35')],'dialOriginateCallerIdNumber':_0x162ee4[_0xe04d('0x36')],'dialOriginateTimeout':_0x162ee4['dialOriginateTimeout'],'dialPrefix':_0x162ee4[_0xe04d('0x37')],'outboundAnswerAgiCallsDay':_0x162ee4[_0xe04d('0x38')],'outboundAnswerCallsDay':_0x162ee4[_0xe04d('0x39')],'outboundBlacklistCallsDay':_0x162ee4['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x162ee4[_0xe04d('0x3a')],'outboundCongestionCallsDay':_0x162ee4['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x162ee4['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x162ee4['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x162ee4[_0xe04d('0x3b')],'outboundNoAnswerCallsDay':_0x162ee4[_0xe04d('0x3c')],'outboundNoSuchCallsDay':_0x162ee4['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x162ee4['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x162ee4[_0xe04d('0x3d')],'outboundRejectCallsDay':_0x162ee4[_0xe04d('0x3e')],'outboundUnknownCallsDay':_0x162ee4[_0xe04d('0x3f')],'outboundAbandonedCallsDay':_0x162ee4['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x162ee4[_0xe04d('0x40')],'predictiveIntervalAvgHoldtime':_0x162ee4[_0xe04d('0x41')],'predictiveIntervalAvgTalktime':_0x162ee4['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x162ee4[_0xe04d('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x162ee4['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x162ee4[_0xe04d('0x43')],'predictiveIntervalErlangCallsDroppedCalls':_0x162ee4[_0xe04d('0x44')],'predictiveIntervalHitRate':_0x162ee4['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x162ee4[_0xe04d('0x45')],'predictiveIntervalPauses':_0x162ee4['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x162ee4[_0xe04d('0x46')],'predictiveIntervalTotalCalls':_0x162ee4[_0xe04d('0x47')],'message':_0x162ee4[_0xe04d('0x48')],'originated':_0x162ee4[_0xe04d('0x49')],'erlangCalls':_0x162ee4[_0xe04d('0x4a')],'erlangCallToSecond':_0x162ee4[_0xe04d('0x4b')],'erlangAbandonmentRate':_0x162ee4[_0xe04d('0x4c')],'erlangBusyFactor':_0x162ee4['erlangBusyFactor'],'startPredictive':_0x162ee4[_0xe04d('0x4d')],'startProgressive':_0x162ee4[_0xe04d('0x4e')]};if(_0x162ee4[_0xe04d('0x4f')]){_0x5bcfc3[_0xe04d('0x4f')]={'id':_0x162ee4[_0xe04d('0x4f')]['id'],'name':_0x162ee4[_0xe04d('0x4f')][_0xe04d('0x29')],'active':_0x162ee4[_0xe04d('0x4f')][_0xe04d('0x50')],'callerid':_0x162ee4['Trunk'][_0xe04d('0x51')]};}if(_0x162ee4['Interval']){_0x5bcfc3[_0xe04d('0x52')]={'id':_0x162ee4['Interval']['id'],'name':_0x162ee4['Interval'][_0xe04d('0x29')]};}var _0x9353a1=md5(JSON[_0xe04d('0x53')](_0x5bcfc3));if(_0x162ee4[_0xe04d('0x5')]!==_0x9353a1){_0x162ee4['md5']=_0x9353a1;emit(util[_0xe04d('0x54')](_0xe04d('0x55'),_0x5bcfc3[_0xe04d('0x29')]),_0xe04d('0x56'),_0x5bcfc3);}}}function emitVoiceQueueChannelRemove(_0x322228){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xe04d('0x53')](_0x322228));emit(util['format']('voice:queue:%s',_0x322228[_0xe04d('0x29')]),_0xe04d('0x57'),_0x322228);io[_0xe04d('0x28')](_0xe04d('0x58'),_0x322228);}function notSendMessagesQueue(_0x5915d9){if(_0x5915d9['sendMessageOneNotActive']){if(_0x5915d9[_0xe04d('0x49')]===0x0&&_0x5915d9[_0xe04d('0x59')]===0x0){_0x5915d9[_0xe04d('0x5a')]=![];_0x5915d9[_0xe04d('0x2a')]=0x0;_0x5915d9[_0xe04d('0x5b')]=0x0;_0x5915d9[_0xe04d('0x48')]='NOT_ACTIVE';ut[_0xe04d('0x5c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x5915d9[_0xe04d('0x29')]+_0xe04d('0x5d'));}else{_0x5915d9[_0xe04d('0x48')]=_0xe04d('0x5e');ut[_0xe04d('0x5c')](_0xe04d('0x5f'),_0x5915d9[_0xe04d('0x29')]+_0xe04d('0x60'));}emitCampaignPreview(_0x5915d9);}}Preview['prototype'][_0xe04d('0x27')]=function(){var _0x14c36b=this;setInterval(function(){_0x14c36b['syncCampaigns']();},0x7cf);};Preview[_0xe04d('0xf')]['syncCampaigns']=function(){var _0x123926=this[_0xe04d('0x13')];this['clockClearZombieChannels']+=0x1;for(var _0x198d89 in _0x123926){if(_0x123926[_0xe04d('0x61')](_0x198d89)&&(_0x123926[_0x198d89][_0xe04d('0x34')]===_0xe04d('0x9')||_0x123926[_0x198d89][_0xe04d('0x34')]===_0xe04d('0x62'))&&_0x123926[_0x198d89][_0xe04d('0x2f')]===_0xe04d('0x63')){if(this[_0xe04d('0x18')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x123926['hasOwnProperty'](_0x198d89)&&_0x123926[_0x198d89][_0xe04d('0x34')]==='preview'&&_0x123926[_0x198d89][_0xe04d('0x2f')]===_0xe04d('0x63')){if(_0x123926[_0x198d89][_0xe04d('0x33')]){this[_0xe04d('0x64')](_0x123926[_0x198d89]);if(_0x123926[_0x198d89][_0xe04d('0x65')])this[_0xe04d('0x66')](_0x123926[_0x198d89]);}else{notSendMessagesQueue(_0x123926[_0x198d89]);}}}};Preview['prototype'][_0xe04d('0x67')]=function(_0x3d20ac){var _0x5526b5=this;this['sequence'][_0xe04d('0x68')](function(){if(!_[_0xe04d('0x69')](_0x5526b5['actions'][_0x3d20ac])){loggerAction[_0xe04d('0x6a')]('[clearZombieChannels][talking]',_0x3d20ac,_0xe04d('0x6b'),_0x5526b5[_0xe04d('0x16')][_0x3d20ac][_0xe04d('0x6c')],_0xe04d('0x6d'),JSON[_0xe04d('0x53')](_0x5526b5[_0xe04d('0x13')][_0x5526b5[_0xe04d('0x16')][_0x3d20ac][_0xe04d('0x6c')]][_0xe04d('0x49')]),_0xe04d('0x6e'),JSON['stringify'](_0x5526b5['campaignsPreview'][_0x5526b5[_0xe04d('0x16')][_0x3d20ac]['queue']]['pTalking']),JSON['stringify'](_0x5526b5[_0xe04d('0x16')][_0x3d20ac][_0xe04d('0x6f')]),JSON[_0xe04d('0x53')](_['pick'](_0x5526b5['actions'][_0x3d20ac],[_0xe04d('0x70'),_0xe04d('0x71'),'VoiceQueueId','ListId'])));return ami[_0xe04d('0x72')]({'action':'status','channel':_0x5526b5[_0xe04d('0x16')][_0x3d20ac][_0xe04d('0x73')]})[_0xe04d('0x74')](function(_0x434315){if(_0x434315[_0xe04d('0x48')]===_0xe04d('0x75')){setTimeout(function(){if(_0x5526b5[_0xe04d('0x16')][_0x3d20ac]){ut[_0xe04d('0x76')](_0x5526b5['campaignsPreview'][_0x5526b5['actions'][_0x3d20ac][_0xe04d('0x6c')]],_0xe04d('0x77'));if(_0x5526b5[_0xe04d('0x16')][_0x3d20ac][_0xe04d('0x6f')]===!![]){ut[_0xe04d('0x78')](_0x5526b5['campaignsPreview'][_0x5526b5['actions'][_0x3d20ac][_0xe04d('0x6c')]],'[clearZombieChannel]');ut['loggerError'](_0xe04d('0x79')+_0x3d20ac,_0x5526b5['actions'][_0x3d20ac][_0xe04d('0x6c')]);}ut['loggerError'](_0xe04d('0x7a')+_0x3d20ac,_0x5526b5['actions'][_0x3d20ac]['queue']);delete _0x5526b5[_0xe04d('0x16')][_0x3d20ac];}},0x2328);}});}});};Preview[_0xe04d('0xf')][_0xe04d('0x7b')]=function(){var _0x1996cf=this;loggerAction[_0xe04d('0x6a')](_0xe04d('0x7c'),_[_0xe04d('0x7d')](this[_0xe04d('0x16')]));for(var _0xa032af in this[_0xe04d('0x16')]){if(_0x1996cf[_0xe04d('0x16')]['hasOwnProperty'](_0xa032af)){_0x1996cf[_0xe04d('0x67')](_0xa032af);}}};Preview[_0xe04d('0xf')][_0xe04d('0x66')]=function(_0x522242){var _0x455951=this;rpcDb['getContactRecallMe'](_0x522242['id'],ut[_0xe04d('0x7e')](this[_0xe04d('0x17')]))['then'](function(_0x1f9540){if(!_[_0xe04d('0x69')](_0x1f9540)){for(var _0x19c0d6=0x0;_0x19c0d6<_0x1f9540['length'];_0x19c0d6+=0x1){if(ut[_0xe04d('0x7f')](_0x1f9540[_0x19c0d6]['scheduledat'])<_0x522242[_0xe04d('0x80')]*0x3c){if(_0x1f9540[_0x19c0d6][_0xe04d('0x81')]&&!_0x1f9540[_0x19c0d6][_0xe04d('0x81')][_0xe04d('0x82')]){_0x455951['run'](_0x1f9540[_0x19c0d6]['id'])[_0xe04d('0x83')](ut['logger2'](_0xe04d('0x84')))['catch'](ut[_0xe04d('0x85')](_0xe04d('0x84')));}else{rpcDb[_0xe04d('0x86')](_0x1f9540[_0x19c0d6]['id']);}}else{var _0x174143=new Action(_0x1f9540[_0x19c0d6],_0x522242);_0x174143['starttime']=moment()[_0xe04d('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x522242['outboundReCallsDay']+=0x1;ut[_0xe04d('0x87')](_0x174143,0x17,_0xe04d('0x88'));if(_0x522242[_0xe04d('0x89')]){rpcDb[_0xe04d('0x8a')](ut['createBody'](_0x1f9540[_0x19c0d6]));rpcDb['createCustomerHistory'](_0x174143,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x174143,0x16,_0xe04d('0x8b'));rpcDb[_0xe04d('0x8c')](_0x174143,'[HistoryRecallClose]');rpcDb[_0xe04d('0x8d')](_0x174143,_0xe04d('0x8e'));}}}}})[_0xe04d('0x74')](ut[_0xe04d('0x85')](_0xe04d('0x8f')));};Preview['prototype'][_0xe04d('0x64')]=function(_0x49d579){_0x49d579[_0xe04d('0x5a')]=!![];if(ut['IsNotLoggedIn'](_0x49d579[_0xe04d('0x2b')])){_0x49d579[_0xe04d('0x48')]=_0xe04d('0x90');}else if(!ut['isActive'](_0x49d579[_0xe04d('0x33')])){_0x49d579[_0xe04d('0x48')]=_0xe04d('0x91');}else if(!this[_0xe04d('0x92')](_0x49d579[_0xe04d('0x4f')])){if(!this[_0xe04d('0x92')](_0x49d579[_0xe04d('0x93')])){_0x49d579['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x49d579[_0xe04d('0x48')]=_0xe04d('0x94');}}else{_0x49d579[_0xe04d('0x48')]=_0xe04d('0x94');}emitCampaignPreview(_0x49d579);};Preview['prototype'][_0xe04d('0x95')]=function(_0xe6d038,_0x192054,_0xcc3f96){var _0x526733=this;var _0x1d3e7c=this[_0xe04d('0x16')][_0x192054];var _0x5a6e4a=this[_0xe04d('0x13')][_0x1d3e7c[_0xe04d('0x6c')]];var _0x24a3bc;if(_0x5a6e4a){switch(_0xcc3f96){case'1':_0x5a6e4a['outboundNoSuchCallsDay']+=0x1;_0x1d3e7c[_0xe04d('0x96')]+=0x1;_0x1d3e7c[_0xe04d('0x97')]=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0x0,_0xe04d('0x99'));ami[_0xe04d('0x28')](_0xe04d('0x9a'),ut[_0xe04d('0x9b')](_0x1d3e7c,_0xe04d('0x9c')));rpcDb['createCustomerHistory'](_0x1d3e7c,_0xe04d('0x9d'));if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a[_0xe04d('0x9e')]){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0xf,_0xe04d('0xa0'));rpcDb[_0xe04d('0x8d')](_0x24a3bc,_0xe04d('0xa1'));}else{if(_0x1d3e7c[_0xe04d('0x96')]>=_0x5a6e4a[_0xe04d('0xa2')]){rpcDb['createCustomerFinal'](_0x1d3e7c,_0xe04d('0xa1'));}else{rpcDb[_0xe04d('0xa3')](ut['scheduledAt'](_0x1d3e7c,_0xe04d('0x96'),_0x5a6e4a['dialNoSuchNumberRetryFrequency']),_0x1d3e7c['unlockAgent'],_0x1d3e7c[_0xe04d('0xa4')]);}}delete this[_0xe04d('0x16')][_0xe6d038[_0xe04d('0xa5')]];break;case _0xe04d('0xa6'):var _0x242a6b=moment()['format'](_0xe04d('0xa7'));_0x1d3e7c[_0xe04d('0xa8')]=_0x242a6b;_0x1d3e7c['answertime']=_0x242a6b;_0x1d3e7c[_0xe04d('0x6f')]=!![];_0x5a6e4a['pTalking']+=0x1;logger['info']('[syncHangup][talking][increment]',_0x1d3e7c[_0xe04d('0xa9')],'\x20Queue',_0x5a6e4a[_0xe04d('0x29')],'pTalking:\x20',_0x5a6e4a[_0xe04d('0x59')]);ami[_0xe04d('0x28')]('custom:agentconnect',ut[_0xe04d('0x9b')](_0x1d3e7c,'connect',this[_0xe04d('0x13')][_0x1d3e7c['queue']]));if(_0x5a6e4a[_0xe04d('0xaa')]){ami[_0xe04d('0x28')](_0xe04d('0xab'),ut[_0xe04d('0xac')](_0x1d3e7c));}break;case'16':ami[_0xe04d('0x28')](_0xe04d('0xad'),ut[_0xe04d('0x9b')](_0x1d3e7c,'complete',this[_0xe04d('0x13')][_0x1d3e7c['queue']]));emitVoiceQueueChannelRemove(ut[_0xe04d('0x9b')](_0x1d3e7c,_0xe04d('0xae')));_0x5a6e4a['outboundAnswerCallsDay']+=0x1;_0x5a6e4a[_0xe04d('0x2e')]+=0x1;_0x5a6e4a[_0xe04d('0xaf')]+=0x1;ut[_0xe04d('0x78')](_0x5a6e4a,_0xe04d('0xb0'));_0x1d3e7c['countglobal']=ut[_0xe04d('0x98')](_0x1d3e7c);ut['logCustomer'](_0x1d3e7c,0x4,'Answer');rpcDb[_0xe04d('0x8c')](_0x1d3e7c,_0xe04d('0xb1'));rpcDb[_0xe04d('0x8d')](_0x1d3e7c,_0xe04d('0xb2'));rpcDb[_0xe04d('0xb3')](_0x1d3e7c);_0x5a6e4a[_0xe04d('0xb4')]+=_0x1d3e7c[_0xe04d('0xb5')];_0x5a6e4a['sumBillable']+=_0x1d3e7c[_0xe04d('0xb5')];logger[_0xe04d('0x6a')](_0xe04d('0xb6'),_0x1d3e7c[_0xe04d('0xa9')],_0xe04d('0xb7'),_0x5a6e4a[_0xe04d('0x29')],_0xe04d('0x6e'),_0x5a6e4a[_0xe04d('0x59')]);delete this[_0xe04d('0x16')][_0xe6d038[_0xe04d('0xa5')]];break;case _0xe04d('0xb8'):_0x5a6e4a['outboundBusyCallsDay']+=0x1;_0x1d3e7c[_0xe04d('0xb9')]+=0x1;_0x1d3e7c['countglobal']=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0x5,_0xe04d('0xba'));ami[_0xe04d('0x28')](_0xe04d('0xbb'),ut['buildObj'](_0x1d3e7c,'busy'));rpcDb['createCustomerHistory'](_0x1d3e7c,'[callProgressDetectingCustomer][logBusy]');if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a['dialGlobalMaxRetry']){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0xf,'Global');rpcDb[_0xe04d('0x8d')](_0x24a3bc,_0xe04d('0xbc'));}else{if(_0x1d3e7c['countbusyretry']>=_0x5a6e4a[_0xe04d('0xbd')]){rpcDb[_0xe04d('0x8d')](_0x1d3e7c,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x1d3e7c,'countbusyretry',_0x5a6e4a[_0xe04d('0xbe')]),_0x1d3e7c[_0xe04d('0xbf')],_0x1d3e7c['activeContact']);}}break;case _0xe04d('0xc0'):_0x5a6e4a[_0xe04d('0x3c')]+=0x1;_0x1d3e7c[_0xe04d('0xc1')]+=0x1;_0x1d3e7c[_0xe04d('0x97')]=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0x3,_0xe04d('0xc2'));ami['emit'](_0xe04d('0xc3'),ut['buildObj'](_0x1d3e7c,'noanswer'));rpcDb[_0xe04d('0x8c')](_0x1d3e7c,_0xe04d('0xc4'));if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a[_0xe04d('0x9e')]){_0x24a3bc=ut['cloneAction'](_0x1d3e7c,0xf,_0xe04d('0xa0'));rpcDb[_0xe04d('0x8d')](_0x24a3bc,_0xe04d('0xc5'));}else{if(_0x1d3e7c['countnoanswerretry']>=_0x5a6e4a['dialNoAnswerMaxRetry']){rpcDb[_0xe04d('0x8d')](_0x1d3e7c,_0xe04d('0xc4'));}else{rpcDb[_0xe04d('0xa3')](ut['scheduledAt'](_0x1d3e7c,'countnoanswerretry',_0x5a6e4a[_0xe04d('0xc6')]),_0x1d3e7c[_0xe04d('0xbf')],_0x1d3e7c[_0xe04d('0xa4')]);}}break;case'CONGESTION':_0x5a6e4a['outboundCongestionCallsDay']+=0x1;_0x1d3e7c['countcongestionretry']+=0x1;_0x1d3e7c['countglobal']=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0x8,_0xe04d('0xc7'));ami[_0xe04d('0x28')](_0xe04d('0xc8'),ut[_0xe04d('0x9b')](_0x1d3e7c,_0xe04d('0xc9')));rpcDb[_0xe04d('0x8c')](_0x1d3e7c,_0xe04d('0xca'));if(ut['totalGlobal'](_0x1d3e7c)>=_0x5a6e4a[_0xe04d('0x9e')]){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0xf,_0xe04d('0xa0'));rpcDb[_0xe04d('0x8d')](_0x24a3bc,_0xe04d('0xcb'));}else{if(_0x1d3e7c[_0xe04d('0xcc')]>=_0x5a6e4a[_0xe04d('0xcd')]){rpcDb[_0xe04d('0x8d')](_0x1d3e7c,_0xe04d('0xca'));}else{rpcDb[_0xe04d('0xa3')](ut[_0xe04d('0xce')](_0x1d3e7c,_0xe04d('0xcc'),_0x5a6e4a['dialBusyRetryFrequency']),_0x1d3e7c[_0xe04d('0xbf')],_0x1d3e7c['activeContact']);}}break;case _0xe04d('0xcf'):_0x5a6e4a[_0xe04d('0x3e')]+=0x1;_0x1d3e7c[_0xe04d('0xd0')]+=0x1;_0x1d3e7c[_0xe04d('0x97')]=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0x14,_0xe04d('0xd1'));ami[_0xe04d('0x28')](_0xe04d('0xd2'),ut[_0xe04d('0x9b')](_0x1d3e7c,_0xe04d('0xd3')));rpcDb[_0xe04d('0x8c')](_0x1d3e7c,_0xe04d('0xd4'));if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a['dialGlobalMaxRetry']){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x24a3bc,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x1d3e7c[_0xe04d('0xd0')]>=_0x5a6e4a[_0xe04d('0xd5')]){rpcDb[_0xe04d('0x8d')](_0x1d3e7c,_0xe04d('0xd6'));}else{rpcDb[_0xe04d('0xa3')](ut[_0xe04d('0xce')](_0x1d3e7c,_0xe04d('0xd0'),_0x5a6e4a[_0xe04d('0xd7')]),_0x1d3e7c['unlockAgent'],_0x1d3e7c[_0xe04d('0xa4')]);}}break;case _0xe04d('0xd8'):_0x5a6e4a[_0xe04d('0xd9')]+=0x1;_0x1d3e7c[_0xe04d('0xda')]+=0x1;_0x1d3e7c[_0xe04d('0x97')]=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0xb,_0xe04d('0xdb'));rpcDb[_0xe04d('0x8c')](_0x1d3e7c,_0xe04d('0xdc'));if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a[_0xe04d('0x9e')]){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0xf,_0xe04d('0xa0'));rpcDb['createCustomerFinal'](_0x24a3bc,_0xe04d('0xdc'));}else{if(_0x1d3e7c[_0xe04d('0xdd')]>=_0x5a6e4a[_0xe04d('0xde')]){rpcDb[_0xe04d('0x8d')](_0x1d3e7c,_0xe04d('0xdc'));}else{rpcDb[_0xe04d('0xa3')](ut[_0xe04d('0xce')](_0x1d3e7c,_0xe04d('0xda'),_0x5a6e4a['dialAbandonedRetryFrequency']),_0x1d3e7c[_0xe04d('0xbf')],_0x1d3e7c[_0xe04d('0xa4')]);}}break;case'18':_0x5a6e4a[_0xe04d('0x3f')]+=0x1;_0x1d3e7c['countmachineretry']+=0x1;_0x1d3e7c[_0xe04d('0x97')]=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0x12,_0xe6d038['cause-txt']||_0xe6d038[_0xe04d('0xdf')]);ami[_0xe04d('0x28')]('custom:amd',ut['buildObj'](_0x1d3e7c,_0xe04d('0xe0')));rpcDb[_0xe04d('0x8c')](_0x1d3e7c,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a[_0xe04d('0x9e')]){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0xf,_0xe04d('0xa0'));rpcDb[_0xe04d('0x8d')](_0x24a3bc,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xe04d('0x8d')](_0x1d3e7c,_0xe04d('0xe1'));}delete this[_0xe04d('0x16')][_0xe6d038[_0xe04d('0xa5')]];break;case'19':_0x5a6e4a[_0xe04d('0x3f')]+=0x1;_0x1d3e7c[_0xe04d('0x97')]=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0x13,_0xe6d038[_0xe04d('0xe2')]||_0xe6d038[_0xe04d('0xdf')]);ami[_0xe04d('0x28')](_0xe04d('0xe3'),ut['buildObj'](_0x1d3e7c,'amd'));rpcDb[_0xe04d('0x8c')](_0x1d3e7c,_0xe04d('0xe4'));if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a['dialGlobalMaxRetry']){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0xf,_0xe04d('0xa0'));rpcDb['createCustomerFinal'](_0x24a3bc,_0xe04d('0xe4'));}else{rpcDb[_0xe04d('0x8d')](_0x1d3e7c,'[callProgressDetectingCustomer][machine]');}delete this[_0xe04d('0x16')][_0xe6d038['linkedid']];break;default:if(_0x1d3e7c['dialAnswer']){ut[_0xe04d('0x78')](_0x5a6e4a,_0xe04d('0xe5'));ut[_0xe04d('0xe6')](_0xe04d('0xe7')+_0x5a6e4a[_0xe04d('0x29')],_0xe6d038);}_0x5a6e4a[_0xe04d('0x3f')]+=0x1;_0x1d3e7c['countglobal']=ut['totalGlobal'](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0xc,_0xe6d038['cause-txt']||_0xe6d038[_0xe04d('0xdf')]);rpcDb[_0xe04d('0x8c')](_0x1d3e7c,_0xe04d('0xe8'));if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a[_0xe04d('0x9e')]){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0xf,'Global');rpcDb['createCustomerFinal'](_0x24a3bc,_0xe04d('0xe9'));}else{rpcDb[_0xe04d('0x8d')](_0x1d3e7c,_0xe04d('0xe9'));}delete this[_0xe04d('0x16')][_0xe6d038[_0xe04d('0xa5')]];}if(!(_0x1d3e7c[_0xe04d('0x6f')]&&_0xcc3f96==='16')){ut[_0xe04d('0x76')](_0x5a6e4a,_0xe04d('0xea'));logger[_0xe04d('0x6a')]('[originated][decrement][callProgressDetectingCustomer]',_0x1d3e7c[_0xe04d('0xa9')],_0xe04d('0xb7'),_0x5a6e4a[_0xe04d('0x29')],'originated:\x20',_0x5a6e4a[_0xe04d('0x49')]);}if(_0xcc3f96!==_0xe04d('0xa6')){delete this[_0xe04d('0x16')][_0xe6d038[_0xe04d('0xa5')]];delete this['actions'][_0xe6d038[_0xe04d('0xeb')]];}}};Preview[_0xe04d('0xf')][_0xe04d('0xec')]=function(_0x49c639,_0x38bd21,_0x1f8465){if(_[_0xe04d('0xed')](_0x38bd21)&&_0xe04d('0xee')!==typeof _0x38bd21){return;}if(_[_0xe04d('0xed')](_0x1f8465)&&_0xe04d('0xee')!==typeof _0x1f8465){return;}switch(_0x1f8465[_0xe04d('0xef')]){case'0':ut[_0xe04d('0xf0')](_0x49c639,0x0,_0xe04d('0x99'));rpcDb[_0xe04d('0xf1')](_0x49c639,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xe04d('0xf0')](_0x49c639,0x3,_0xe04d('0xc2'));rpcDb[_0xe04d('0xf1')](_0x49c639,_0xe04d('0xf2'));break;case'5':ut['logAgent'](_0x49c639,0x5,_0xe04d('0xba'));rpcDb[_0xe04d('0xf1')](_0x49c639,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x49c639,0x8,_0xe04d('0xc7'));rpcDb[_0xe04d('0xf1')](_0x49c639,_0xe04d('0xf3'));break;case'22':ut[_0xe04d('0xf0')](_0x49c639,0x16,_0xe04d('0xf4'));rpcDb[_0xe04d('0xf1')](_0x49c639,_0xe04d('0xf5'));break;default:ut[_0xe04d('0xf0')](_0x49c639,0xc,_0x1f8465['reason']);rpcDb['createAgentHistory'](_0x49c639,_0xe04d('0xf3'));}ut[_0xe04d('0x76')](_0x38bd21,_0xe04d('0xf6'));logger[_0xe04d('0x6a')]('[originated][decrement][callProgressDetectingAgent]',_0x49c639[_0xe04d('0xa9')],_0xe04d('0xb7'),_0x38bd21[_0xe04d('0x29')],_0xe04d('0x6d'),_0x38bd21[_0xe04d('0x49')]);delete this[_0xe04d('0x16')][_0x49c639[_0xe04d('0xa9')]];};Preview['prototype'][_0xe04d('0xf7')]=function(_0x147aa9,_0x284a56,_0x4a4251,_0x54d5ad,_0x5c2c28){var _0x59834e=this;return new BPromise(function(_0x2104d4,_0x280f4c){if(_[_0xe04d('0x69')](_0x284a56)||_[_0xe04d('0x69')](_0x284a56[_0xe04d('0xf8')])||_[_0xe04d('0x69')](_0x284a56[_0xe04d('0xf8')]['phone'])||_[_0xe04d('0x69')](_0x284a56[_0xe04d('0xf9')])){_0x280f4c(ut[_0xe04d('0x48')]('Contact\x20is\x20undefined',_0x54d5ad,_0x5c2c28));return;}var _0x5d6240=uuid['v4']();var _0x4a494d=_0x59834e[_0xe04d('0x13')][_0x284a56[_0xe04d('0x6b')][_0xe04d('0x29')]];var _0x5cb5a9=_0x4a4251?_0x59834e[_0xe04d('0x17')][_0x4a4251]['id']:undefined;_0x59834e[_0xe04d('0x16')][_0x5d6240]=new Action(_0x284a56,_0x4a494d,_0x5d6240,_0x4a4251,_0x5cb5a9);var _0x42b3d8=_0x59834e[_0xe04d('0x16')][_0x5d6240];_0x42b3d8[_0xe04d('0xbf')]=_0x54d5ad;_0x42b3d8[_0xe04d('0xa4')]=_0x5c2c28;_0x42b3d8[_0xe04d('0xfa')]=_0x4a4251;if(_[_0xe04d('0xfb')](_0x147aa9)){_0x59834e['execCall'](_0x42b3d8,_0x4a494d,_0x284a56,_0x4a4251)[_0xe04d('0x83')](function(_0x36dfa1){logger[_0xe04d('0x6a')](_0xe04d('0xfc'),_0xe04d('0xfd')+_0x42b3d8[_0xe04d('0x6c')]+_0xe04d('0xfe')+_0x42b3d8['idContact'],JSON[_0xe04d('0x53')](_0x36dfa1));ami[_0xe04d('0x28')](_0xe04d('0xff'),ut[_0xe04d('0x9b')](_0x42b3d8,'called',_0x59834e[_0xe04d('0x13')][_0x42b3d8['queue']]));_0x2104d4(ut[_0xe04d('0x48')](_0xe04d('0x100')));})[_0xe04d('0x74')](function(_0x3c700f){ut['logger'](_0xe04d('0x101'),_0x3c700f);_0x280f4c(ut[_0xe04d('0x48')](_0xe04d('0x102'),_0x54d5ad,_0x5c2c28));});}else{_0x4a494d[_0xe04d('0x103')]+=0x1;ut[_0xe04d('0x104')](_0x42b3d8);rpcDb[_0xe04d('0x105')](_0x42b3d8,_0xe04d('0x106'));delete _0x59834e[_0xe04d('0x16')][_0x5d6240];_0x280f4c(ut['message'](_0xe04d('0x107'),_0x54d5ad,_0x5c2c28));}});};Preview[_0xe04d('0xf')]['isTrunkReachable']=function(_0x32bc6e){return!_[_0xe04d('0x69')](_0x32bc6e)&&!_['isNil'](_0x32bc6e['name'])&&!_[_0xe04d('0x69')](_0x32bc6e[_0xe04d('0x50')])&&_0x32bc6e['active']&&!_[_0xe04d('0x69')](this[_0xe04d('0x15')][util[_0xe04d('0x54')](_0xe04d('0x108'),_0x32bc6e['name'])])&&!_['isNil'](this[_0xe04d('0x15')][util[_0xe04d('0x54')](_0xe04d('0x108'),_0x32bc6e[_0xe04d('0x29')])][_0xe04d('0x109')])&&(this[_0xe04d('0x15')][util[_0xe04d('0x54')]('SIP/%s',_0x32bc6e['name'])][_0xe04d('0x109')]===_0xe04d('0x10a')||this[_0xe04d('0x15')][util[_0xe04d('0x54')](_0xe04d('0x108'),_0x32bc6e[_0xe04d('0x29')])][_0xe04d('0x109')]===_0xe04d('0x10b'));};Preview[_0xe04d('0xf')][_0xe04d('0x10c')]=function(_0x38c58c,_0x2f835e){var _0x5e8c40=this;return new BPromise(function(_0x34da09,_0x311cf8){_0x5e8c40[_0xe04d('0x10d')](_0x38c58c,_0x2f835e)[_0xe04d('0x83')](function(_0x570a45){_0x34da09(_[_0xe04d('0x10e')](_0x570a45,[_0xe04d('0x48')]));})[_0xe04d('0x74')](function(_0x48a69d){if(_0x48a69d['unlock']){rpcDb['unlockContact'](_0x38c58c);}if(_0x48a69d[_0xe04d('0x50')]){rpcDb[_0xe04d('0x86')](_0x38c58c);}_0x311cf8(_[_0xe04d('0x10e')](_0x48a69d,['message']));});});};Preview[_0xe04d('0xf')][_0xe04d('0x10d')]=function(_0x40ec63,_0x4f88d0){var _0x309dcc=this;return new BPromise(function(_0x5b3123,_0x2969b1){var _0x2da37c,_0x28ce60;rpcDb[_0xe04d('0x10f')](_0x40ec63)[_0xe04d('0x83')](function(_0x89c842){if(!_['isNil'](_0x89c842[0x0])){_0x28ce60=_0x89c842[0x0]['recallme']?![]:!![];_0x2da37c=_0x89c842[0x0][_0xe04d('0x110')]?!![]:![];_0x2da37c=_0x4f88d0?!![]:_0x2da37c;}var _0x2680d7=_0x309dcc[_0xe04d('0x111')](_0x89c842);if(_0x2680d7[_0xe04d('0x112')]){rpcDb[_0xe04d('0x113')](_[_0xe04d('0x10e')](_0x89c842[0x0],[_0xe04d('0xf9'),_0xe04d('0x114')]))[_0xe04d('0x83')](function(_0x4b61fc){_0x309dcc[_0xe04d('0xf7')](_0x4b61fc,_0x89c842[0x0],_0x4f88d0,_0x28ce60,_0x2da37c)[_0xe04d('0x83')](function(_0x1cd95f){_0x5b3123(_0x1cd95f);})[_0xe04d('0x74')](function(_0x1c42ad){_0x2969b1(_0x1c42ad);});})[_0xe04d('0x74')](function(_0x538e33){ut[_0xe04d('0x5c')](_0xe04d('0x115'),_0x538e33);_0x2969b1(ut[_0xe04d('0x48')]('Call\x20unsuccessful',_0x28ce60,_0x2da37c));});}else{_0x2969b1(ut[_0xe04d('0x48')](_0x2680d7[_0xe04d('0x48')],_0x28ce60,_0x2da37c));}})['catch'](function(_0x33007d){ut[_0xe04d('0x5c')](_0xe04d('0x116'),_0x33007d);_0x2969b1(ut[_0xe04d('0x48')](_0xe04d('0x117'),![],!![]));});});};Preview['prototype'][_0xe04d('0x111')]=function(_0x5d958a){if(_[_0xe04d('0x69')](_0x5d958a)||_[_0xe04d('0xfb')](_0x5d958a)||!_[_0xe04d('0x69')](_0x5d958a[0x0]['Agent'])&&_[_0xe04d('0x69')](_0x5d958a[0x0][_0xe04d('0x81')]['name'])){ut['logger'](_0xe04d('0x118'),_0x5d958a);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x286e88=this[_0xe04d('0x13')][_0x5d958a[0x0][_0xe04d('0x6b')]['name']];_0x286e88['message']=_0xe04d('0x94');if(_[_0xe04d('0x69')](_0x286e88)){ut[_0xe04d('0x5c')](_0xe04d('0x119'),_0x286e88);return{'isValid':![],'message':_0xe04d('0x11a')};}if(!this[_0xe04d('0x92')](_0x286e88['Trunk'])){ut[_0xe04d('0x5c')](_0xe04d('0x11b'),'campaign\x20Name:\x20'+_0x286e88[_0xe04d('0x29')]+_0xe04d('0x11c'));if(!this[_0xe04d('0x92')](_0x286e88[_0xe04d('0x93')])){ut[_0xe04d('0x5c')](_0xe04d('0x11b'),_0x286e88[_0xe04d('0x29')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xe04d('0x11d')};}}if(!ut[_0xe04d('0x11e')](_0x286e88[_0xe04d('0x33')])){ut[_0xe04d('0x5c')](_0xe04d('0x11f'),_0x286e88[_0xe04d('0x29')]+_0xe04d('0x120'));return{'isValid':![],'message':_0xe04d('0x121')+_0x286e88[_0xe04d('0x29')]+_0xe04d('0x120')};}return{'isValid':!![],'message':_0xe04d('0x122')};};Preview[_0xe04d('0xf')][_0xe04d('0x123')]=function(_0x908dd3,_0x4c5a73,_0x5b8dca,_0x568378){var _0x7eab6c=this;return new BPromise(function(_0x2770a5,_0x5556ce){var _0x482e81=_0x908dd3[_0xe04d('0xa9')];var _0x83c3d9=_0x7eab6c[_0xe04d('0x92')](_0x4c5a73[_0xe04d('0x4f')])?util[_0xe04d('0x54')](_0xe04d('0x124'),_0x4c5a73[_0xe04d('0x4f')][_0xe04d('0x29')],_[_0xe04d('0x69')](_0x4c5a73[_0xe04d('0x37')])?'':_0x4c5a73[_0xe04d('0x37')][_0xe04d('0x125')]()||'',_0x4c5a73[_0xe04d('0x126')]>0x0?_0x5b8dca[_0xe04d('0xf8')]['phone'][_0xe04d('0x127')](_0x4c5a73[_0xe04d('0x126')]):_0x5b8dca[_0xe04d('0xf8')]['phone']):util['format']('SIP/%s/%s%s',_['isNil'](_0x4c5a73[_0xe04d('0x93')])?_0x4c5a73[_0xe04d('0x4f')]['name']:_0x4c5a73[_0xe04d('0x93')][_0xe04d('0x29')],_[_0xe04d('0x69')](_0x4c5a73[_0xe04d('0x37')])?'':_0x4c5a73[_0xe04d('0x37')][_0xe04d('0x125')]()||'',_0x4c5a73[_0xe04d('0x126')]>0x0?_0x5b8dca[_0xe04d('0xf8')][_0xe04d('0x128')]['substring'](_0x4c5a73['dialCutDigit']):_0x5b8dca[_0xe04d('0xf8')]['phone']);var _0x50691e=_0x7eab6c[_0xe04d('0x92')](_0x4c5a73[_0xe04d('0x4f')])?ut[_0xe04d('0x129')](_0x4c5a73[_0xe04d('0x4f')][_0xe04d('0x51')],_0x4c5a73[_0xe04d('0x35')],_0x4c5a73[_0xe04d('0x12a')]>0x0?ut[_0xe04d('0x12b')](_0x4c5a73[_0xe04d('0x36')],_0x4c5a73[_0xe04d('0x12a')]):_0x4c5a73['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0xe04d('0x69')](_0x4c5a73[_0xe04d('0x93')])?_0x4c5a73[_0xe04d('0x4f')][_0xe04d('0x51')]:_0x4c5a73[_0xe04d('0x93')]['callerid'],_0x4c5a73['dialOriginateCallerIdName'],_0x4c5a73[_0xe04d('0x12a')]>0x0?ut[_0xe04d('0x12b')](_0x4c5a73[_0xe04d('0x36')],_0x4c5a73['dialRandomLastDigitCallerIdNumber']):_0x4c5a73[_0xe04d('0x36')]);if(_0x50691e){_0x908dd3[_0xe04d('0x12c')]=ut[_0xe04d('0x12d')](_0x50691e);_0x908dd3[_0xe04d('0x12e')]=ut[_0xe04d('0x12f')](_0x50691e);}var _0x6f68f5=ut[_0xe04d('0x130')](_0x4c5a73,_0x5b8dca,_0x83c3d9,_0x50691e,_0x482e81,_0x908dd3);_[_0xe04d('0x131')](_0x908dd3,ut['toLowerVariables'](_0x6f68f5));_0x908dd3['starttime']=moment()[_0xe04d('0x54')](_0xe04d('0xa7'));ami[_0xe04d('0x72')](ut[_0xe04d('0x132')](_0x908dd3,_0x4c5a73,_0x6f68f5,_0x908dd3[_0xe04d('0xa4')],_0x568378))[_0xe04d('0x83')](function(_0x40d8fc){_0x4c5a73[_0xe04d('0x49')]+=0x1;logger['info'](_0xe04d('0x133'),_0x482e81,_0xe04d('0xb7'),_0x4c5a73[_0xe04d('0x29')],'originated:\x20',_0x4c5a73[_0xe04d('0x49')]);_0x2770a5(_0x40d8fc);})[_0xe04d('0x74')](function(_0x3361ab){ut[_0xe04d('0xf0')](_0x908dd3,0xe,_0xe04d('0x134'));rpcDb['createAgentHistory'](_0x908dd3,_0xe04d('0x135'));_0x5556ce(_0x3361ab);});});};Preview[_0xe04d('0xf')]['syncNewExten']=function(_0x2b683e){if(this['actions'][_0x2b683e[_0xe04d('0xa5')]]){this[_0xe04d('0x16')][_0x2b683e[_0xe04d('0xa5')]][_0xe04d('0x73')]=_0x2b683e['channel'];}};Preview[_0xe04d('0xf')]['syncOriginateResponse']=function(_0x2133b4){var _0x2d3a9b=this;var _0x1bf7b6=this[_0xe04d('0x16')][_0x2133b4[_0xe04d('0x136')]];if(_0x1bf7b6){if(_0x1bf7b6[_0xe04d('0xfa')]&&this[_0xe04d('0x17')][_0x1bf7b6[_0xe04d('0xfa')]]){ut[_0xe04d('0x137')](_0x1bf7b6,this[_0xe04d('0x17')][_0x1bf7b6[_0xe04d('0xfa')]][_0xe04d('0x29')],this[_0xe04d('0x17')][_0x1bf7b6[_0xe04d('0xfa')]]['id']);}var _0x4d16c0=_[_0xe04d('0x138')](_0x1bf7b6);_0x4d16c0[_0xe04d('0xa8')]=moment()[_0xe04d('0x54')](_0xe04d('0xa7'));var _0xeb9533=_0x2d3a9b[_0xe04d('0x13')][_0x1bf7b6[_0xe04d('0x6c')]];if(ut['isFailure'](_0x2133b4[_0xe04d('0x139')])){if(_0x1bf7b6[_0xe04d('0xbf')]){rpcDb[_0xe04d('0x13a')](_0x1bf7b6[_0xe04d('0x13b')]);}if(_0x1bf7b6[_0xe04d('0xa4')]){rpcDb[_0xe04d('0x86')](_0x1bf7b6[_0xe04d('0x13b')]);}ami[_0xe04d('0x28')]('custom:agentringnoanswer',ut[_0xe04d('0x9b')](_0x1bf7b6,_0xe04d('0x13c'),this[_0xe04d('0x13')][_0x1bf7b6[_0xe04d('0x6c')]]));this[_0xe04d('0xec')](_0x4d16c0,_0xeb9533,_0x2133b4);}else{_0x1bf7b6[_0xe04d('0x13d')]=moment()['format'](_0xe04d('0xa7'));ut['logAgent'](_0x4d16c0,0x4,_0xe04d('0x13e'));rpcDb[_0xe04d('0xf1')](_0x4d16c0,_0xe04d('0x13f'));}}};Preview[_0xe04d('0xf')][_0xe04d('0x1d')]=function(_0x4d0c00){var _0xe2de8f=this;var _0x4c6236=this[_0xe04d('0x16')][_0x4d0c00[_0xe04d('0xa5')]];var _0x5b6329;if(_0x4c6236){_0x5b6329=this['campaignsPreview'][_0x4c6236[_0xe04d('0x6c')]];logger['info']('[syncHangup][talking]',_0x4d0c00[_0xe04d('0xa5')],'\x20Queue',_0x5b6329[_0xe04d('0x29')],_0xe04d('0x6e'),_0x5b6329[_0xe04d('0x59')]);}if(this[_0xe04d('0x16')][_0x4d0c00[_0xe04d('0xa5')]]&&_0x4d0c00[_0xe04d('0xa5')]!==_0x4d0c00[_0xe04d('0xa9')]){if(_0x4d0c00[_0xe04d('0x140')]==='16'&&this[_0xe04d('0x16')][_0x4d0c00[_0xe04d('0xa5')]][_0xe04d('0x6f')]){this[_0xe04d('0x95')](_0x4d0c00,_0x4d0c00['linkedid'],_0x4d0c00['cause']);}else if(this[_0xe04d('0x16')][_0x4d0c00[_0xe04d('0xa5')]][_0xe04d('0x6f')]){logger[_0xe04d('0x6a')](_0xe04d('0x141'),_0x4d0c00[_0xe04d('0xa5')],_0x4d0c00[_0xe04d('0x140')],_0xe04d('0xb7'),_0x5b6329[_0xe04d('0x29')],'pTalking:\x20',_0x5b6329[_0xe04d('0x59')]);this['callProgressDetectingCustomer'](_0x4d0c00,_0x4d0c00['linkedid'],_0x4d0c00[_0xe04d('0x140')]);}}else if(_0x4c6236&&_[_0xe04d('0x69')](_0x4c6236['statedesc'])&&_0x5b6329[_0xe04d('0x142')]&&_0x4d0c00['linkedid']===_0x4d0c00['uniqueid']&&_[_0xe04d('0x69')](_0x4d0c00[_0xe04d('0xef')])&&_0x4d0c00['cause']==='16'&&_0x4d0c00[_0xe04d('0x143')]==='6'&&_[_0xe04d('0xed')](_0x4c6236[_0xe04d('0x144')])){if(_0x4c6236[_0xe04d('0xbf')]){rpcDb[_0xe04d('0x13a')](_0x4c6236[_0xe04d('0x13b')]);}if(_0x4c6236[_0xe04d('0xa4')]){rpcDb['disableContact'](_0x4c6236[_0xe04d('0x13b')]);}_0x4d0c00[_0xe04d('0xef')]='22';this[_0xe04d('0xec')](_0x4c6236,_0x5b6329,_0x4d0c00);}else if(_0x4c6236&&_0x4c6236[_0xe04d('0x144')]){if(_0x4d0c00[_0xe04d('0x140')]==='16'&&this['actions'][_0x4d0c00[_0xe04d('0xa5')]]['dialAnswer']){logger[_0xe04d('0x6a')](_0xe04d('0x145'),_0x4d0c00[_0xe04d('0xa5')],_0x4d0c00[_0xe04d('0x140')],_0xe04d('0xb7'),_0x5b6329[_0xe04d('0x29')],_0xe04d('0x6e'),_0x5b6329['pTalking']);this[_0xe04d('0x95')](_0x4d0c00,_0x4d0c00['linkedid'],_0x4d0c00[_0xe04d('0x140')]);}else if(this['actions'][_0x4d0c00[_0xe04d('0xa5')]][_0xe04d('0x6f')]){logger['info'](_0xe04d('0x141'),_0x4d0c00[_0xe04d('0xa5')],_0x4d0c00[_0xe04d('0x140')],'\x20Queue',_0x5b6329[_0xe04d('0x29')],_0xe04d('0x6e'),_0x5b6329[_0xe04d('0x59')]);this[_0xe04d('0x95')](_0x4d0c00,_0x4d0c00[_0xe04d('0xa5')],_0x4d0c00['cause']);}}};Preview[_0xe04d('0xf')][_0xe04d('0x1f')]=function(_0x59d4f8){if(this[_0xe04d('0x16')][_0x59d4f8[_0xe04d('0xeb')]]&&_0x59d4f8[_0xe04d('0xeb')]!==_0x59d4f8[_0xe04d('0x146')]){this[_0xe04d('0x95')](_0x59d4f8,_0x59d4f8[_0xe04d('0xeb')],_0x59d4f8[_0xe04d('0xdf')]);}};Preview[_0xe04d('0xf')]['syncHangupRequest']=function(_0x17fc78){if(this[_0xe04d('0x16')][_0x17fc78[_0xe04d('0xa5')]]&&_0x17fc78[_0xe04d('0xa5')]!==_0x17fc78[_0xe04d('0xa9')]&&!this['actions'][_0x17fc78[_0xe04d('0xa5')]]['dialAnswer']){if(_0x17fc78[_0xe04d('0x140')]==='1'){this['callProgressDetectingCustomer'](_0x17fc78,_0x17fc78[_0xe04d('0xa5')],_0x17fc78[_0xe04d('0x140')]);}}};Preview[_0xe04d('0xf')]['addVariable']=function(_0x109a43,_0x479c33,_0x1895de){if(this[_0xe04d('0x16')][_0x109a43]){if(_['isNil'](this[_0xe04d('0x16')][_0x109a43][_0xe04d('0x147')])){this['actions'][_0x109a43][_0xe04d('0x147')]={};}this[_0xe04d('0x16')][_0x109a43][_0xe04d('0x147')][_0x479c33]=_0x1895de;}};Preview[_0xe04d('0xf')][_0xe04d('0x23')]=function(_0x356968){try{if(!_[_0xe04d('0x69')](_0x356968)){if(ut[_0xe04d('0x148')](_[_0xe04d('0x149')](_0x356968[_0xe04d('0x14a')])[0x0])){this[_0xe04d('0x14b')](_0x356968[_0xe04d('0xa9')],_[_0xe04d('0x149')](_0x356968[_0xe04d('0x14a')])[0x0],_0x356968[_0xe04d('0x14c')]);}}}catch(_0x36d1d4){logger[_0xe04d('0x14d')](_0xe04d('0x14e'),util['inspect'](_0x36d1d4,{'showHidden':![],'depth':null}));}};Preview[_0xe04d('0xf')][_0xe04d('0x25')]=function(_0x1ec936){if(_0x1ec936){if(this[_0xe04d('0x16')][_0x1ec936[_0xe04d('0x14f')]]){this['actions'][_0x1ec936[_0xe04d('0x14f')]][_0xe04d('0x144')]=!![];}}};Preview[_0xe04d('0xf')]['syncBlindTransfer']=function(_0x1b40a9){if(_0x1b40a9){if(this[_0xe04d('0x16')][_0x1b40a9[_0xe04d('0x150')]]){this[_0xe04d('0x16')][_0x1b40a9[_0xe04d('0x150')]][_0xe04d('0x144')]=!![];}}};module[_0xe04d('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 b2b5176..c67e0ff 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 _0x1f62=['from-sip','exten','xcally-motion-preview','lastAssignedTo','membername','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','then','createHistory','[createHistory]\x20','resolve','moveContactManagedDialer','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context'];(function(_0x40e220,_0x2bd179){var _0x1808b8=function(_0x3277bf){while(--_0x3277bf){_0x40e220['push'](_0x40e220['shift']());}};_0x1808b8(++_0x2bd179);}(_0x1f62,0x11f));var _0x21f6=function(_0x4fe496,_0x1d8673){_0x4fe496=_0x4fe496-0x0;var _0x422b24=_0x1f62[_0x4fe496];return _0x422b24;};'use strict';var util=require(_0x21f6('0x0'));var BPromise=require('bluebird');var logger=require(_0x21f6('0x1'))('preview');var _=require('lodash');var cmHopper=require(_0x21f6('0x2'));var cmHopperFinal=require(_0x21f6('0x3'));var cmHopperHistory=require(_0x21f6('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x21f6('0x5'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x21f6('0x6'));function loggerCatch(_0x2e7bef){return function(_0x139c5a){logger[_0x21f6('0x7')](_0x2e7bef,util['inspect'](_0x139c5a,{'showHidden':![],'depth':null}));};}function create(_0x2d41ac){return BPromise['resolve']()[_0x21f6('0x8')](cmHopperHistory[_0x21f6('0x9')](_0x2d41ac))['catch'](loggerCatch(_0x21f6('0xa')));}function createAgent(_0x4de216){return BPromise[_0x21f6('0xb')]()[_0x21f6('0x8')](agentReportPreview[_0x21f6('0x9')](_0x4de216))['catch'](loggerCatch(_0x21f6('0xa')));}function moveContact(_0x300c09){return BPromise[_0x21f6('0xb')]()[_0x21f6('0x8')](cmHopper[_0x21f6('0xc')](_0x300c09,!![]))[_0x21f6('0xd')](loggerCatch(_0x21f6('0xe')));}exports['checkIsBlackList']=function(_0x569c23){return BPromise[_0x21f6('0xb')]()[_0x21f6('0x8')](cmHopperBlack[_0x21f6('0xf')](_0x569c23))['catch'](loggerCatch(_0x21f6('0x10')));};exports[_0x21f6('0x11')]=function(_0x5c493f){return BPromise['resolve']()[_0x21f6('0x8')](cmHopper['getContactPreview'](_0x5c493f))['catch'](loggerCatch(_0x21f6('0x12')));};exports['createHistory']=function(_0x2893b5,_0x520067){create(_0x2893b5)[_0x21f6('0xd')](loggerCatch(_0x520067));moveContact(_0x2893b5)[_0x21f6('0xd')](loggerCatch(_0x520067));};exports['createAgentHistory']=function(_0x4024d4,_0x5c8945){createAgent(_0x4024d4)[_0x21f6('0xd')](loggerCatch(_0x5c8945));};exports[_0x21f6('0x13')]=function(_0x157468,_0xf39340){create(_0x157468)[_0x21f6('0xd')](loggerCatch(_0xf39340));};exports[_0x21f6('0x14')]=function(_0x20af9c,_0x2550bb){moveContact(_0x20af9c)[_0x21f6('0xd')](loggerCatch(_0x2550bb));};exports[_0x21f6('0x15')]=function(_0x23ac3f,_0x1033c7,_0x4e9637){if(_0x1033c7){_0x23ac3f[_0x21f6('0x16')]=null;}if(_0x4e9637){_0x23ac3f[_0x21f6('0x17')]=![];}return BPromise[_0x21f6('0xb')]()[_0x21f6('0x8')](cmHopper['rescheduleContact'](_0x23ac3f))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0x21f6('0x18')]=function(_0x4e55c2){return BPromise[_0x21f6('0xb')]()[_0x21f6('0x8')](cmHopper[_0x21f6('0x18')](_0x4e55c2))[_0x21f6('0xd')](loggerCatch(_0x21f6('0x19')));};exports[_0x21f6('0x1a')]=function(_0x1ca344){return BPromise['resolve']()[_0x21f6('0x8')](cmHopper[_0x21f6('0x1a')]({'UserId':null},_0x1ca344,0x1))['catch'](loggerCatch(_0x21f6('0x1b')));};exports[_0x21f6('0x1c')]=function(_0x38a283){return BPromise[_0x21f6('0xb')]()[_0x21f6('0x8')](cmHopper[_0x21f6('0x1a')]({'active':![]},_0x38a283,0x1))[_0x21f6('0xd')](loggerCatch(_0x21f6('0x1d')));};exports[_0x21f6('0x1e')]=function(_0x1d9fbf){var _0x38276c={};_0x38276c[_0x21f6('0x1f')]=_0x1d9fbf[_0x21f6('0x1f')];_0x38276c[_0x21f6('0x20')]=_0x1d9fbf[_0x21f6('0x20')];_0x38276c[_0x21f6('0x21')]=_0x1d9fbf[_0x21f6('0x21')];_0x38276c[_0x21f6('0x22')]=_0x1d9fbf['calleridname'];_0x38276c[_0x21f6('0x23')]=_0x1d9fbf['queue'];_0x38276c[_0x21f6('0x24')]=_0x1d9fbf[_0x21f6('0x25')];_0x38276c['queuecallerleaveAt']=_0x1d9fbf[_0x21f6('0x25')];_0x38276c[_0x21f6('0x26')]=0x1;_0x38276c[_0x21f6('0x27')]=_0x1d9fbf[_0x21f6('0x28')];_0x38276c[_0x21f6('0x29')]=_0x1d9fbf['membername'];_0x38276c[_0x21f6('0x2a')]=_0x21f6('0x2b');_0x38276c[_0x21f6('0x2c')]=_0x21f6('0x2d');_0x38276c['holdtime']=0x0;_0x38276c['assigned']=0x1;_0x38276c[_0x21f6('0x2e')]=_0x1d9fbf[_0x21f6('0x2f')];_0x38276c['queuecallerexitreason']=_0x21f6('0x30');return BPromise[_0x21f6('0xb')]()[_0x21f6('0x8')](voiceQueueReport[_0x21f6('0x31')](_0x38276c))[_0x21f6('0xd')](loggerCatch(_0x21f6('0x32')));};exports[_0x21f6('0x33')]=function(_0x3c288f,_0x3da831){return BPromise[_0x21f6('0xb')]()[_0x21f6('0x8')](cmHopper['getContactRecallMe'](_0x3c288f,_0x3da831))[_0x21f6('0xd')](loggerCatch(_0x21f6('0x34')));};exports[_0x21f6('0x35')]=function(_0x900a86){return BPromise['resolve']()[_0x21f6('0x8')](cmHopper[_0x21f6('0x15')](_0x900a86,!![],!![]))[_0x21f6('0xd')](loggerCatch(_0x21f6('0x36')));}; \ No newline at end of file +var _0xc961=['catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','[createHistory]\x20'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc961,0x113));var _0x1c96=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0xc961[_0x511bd1];return _0x4c48ec;};'use strict';var util=require(_0x1c96('0x0'));var BPromise=require(_0x1c96('0x1'));var logger=require(_0x1c96('0x2'))('preview');var _=require(_0x1c96('0x3'));var cmHopper=require(_0x1c96('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x1c96('0x5'));var voiceQueueRt=require(_0x1c96('0x6'));var agentReportPreview=require(_0x1c96('0x7'));var voiceQueueReport=require(_0x1c96('0x8'));function loggerCatch(_0x2d5452){return function(_0x5081dc){logger[_0x1c96('0x9')](_0x2d5452,util[_0x1c96('0xa')](_0x5081dc,{'showHidden':![],'depth':null}));};}function create(_0x24b31a){return BPromise[_0x1c96('0xb')]()[_0x1c96('0xc')](cmHopperHistory[_0x1c96('0xd')](_0x24b31a))['catch'](loggerCatch(_0x1c96('0xe')));}function createAgent(_0x193f8c){return BPromise['resolve']()[_0x1c96('0xc')](agentReportPreview[_0x1c96('0xd')](_0x193f8c))[_0x1c96('0xf')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x382fd){return BPromise[_0x1c96('0xb')]()[_0x1c96('0xc')](cmHopper[_0x1c96('0x10')](_0x382fd,!![]))[_0x1c96('0xf')](loggerCatch(_0x1c96('0x11')));}exports['checkIsBlackList']=function(_0x35fad6){return BPromise[_0x1c96('0xb')]()[_0x1c96('0xc')](cmHopperBlack[_0x1c96('0x12')](_0x35fad6))[_0x1c96('0xf')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x1dc544){return BPromise[_0x1c96('0xb')]()[_0x1c96('0xc')](cmHopper[_0x1c96('0x13')](_0x1dc544))['catch'](loggerCatch(_0x1c96('0x14')));};exports[_0x1c96('0xd')]=function(_0x2fc7b7,_0x247f32){create(_0x2fc7b7)['catch'](loggerCatch(_0x247f32));moveContact(_0x2fc7b7)[_0x1c96('0xf')](loggerCatch(_0x247f32));};exports[_0x1c96('0x15')]=function(_0x34c5f0,_0x34f1b8){createAgent(_0x34c5f0)[_0x1c96('0xf')](loggerCatch(_0x34f1b8));};exports[_0x1c96('0x16')]=function(_0x5bcef3,_0x3f5a7d){create(_0x5bcef3)[_0x1c96('0xf')](loggerCatch(_0x3f5a7d));};exports[_0x1c96('0x17')]=function(_0x406fd8,_0x590024){moveContact(_0x406fd8)['catch'](loggerCatch(_0x590024));};exports[_0x1c96('0x18')]=function(_0x3d1f6e,_0x274248,_0x360087){if(_0x274248){_0x3d1f6e['UserId']=null;}if(_0x360087){_0x3d1f6e[_0x1c96('0x19')]=![];}return BPromise['resolve']()[_0x1c96('0xc')](cmHopper[_0x1c96('0x18')](_0x3d1f6e))[_0x1c96('0xf')](loggerCatch(_0x1c96('0x1a')));};exports[_0x1c96('0x1b')]=function(_0x136114){return BPromise['resolve']()[_0x1c96('0xc')](cmHopper[_0x1c96('0x1b')](_0x136114))[_0x1c96('0xf')](loggerCatch(_0x1c96('0x1c')));};exports[_0x1c96('0x1d')]=function(_0x1ad1b4){return BPromise[_0x1c96('0xb')]()[_0x1c96('0xc')](cmHopper[_0x1c96('0x1d')]({'UserId':null},_0x1ad1b4,0x1))[_0x1c96('0xf')](loggerCatch(_0x1c96('0x1e')));};exports[_0x1c96('0x1f')]=function(_0x366f9e){return BPromise[_0x1c96('0xb')]()['then'](cmHopper['unlockContact']({'active':![]},_0x366f9e,0x1))[_0x1c96('0xf')](loggerCatch('[activeContact]\x20'));};exports[_0x1c96('0x20')]=function(_0x38e1be){var _0x46bbb8={};_0x46bbb8[_0x1c96('0x21')]=_0x38e1be['type'];_0x46bbb8[_0x1c96('0x22')]=_0x38e1be[_0x1c96('0x22')];_0x46bbb8[_0x1c96('0x23')]=_0x38e1be[_0x1c96('0x23')];_0x46bbb8[_0x1c96('0x24')]=_0x38e1be[_0x1c96('0x24')];_0x46bbb8[_0x1c96('0x25')]=_0x38e1be['queue'];_0x46bbb8['queuecallerjoinAt']=_0x38e1be[_0x1c96('0x26')];_0x46bbb8[_0x1c96('0x27')]=_0x38e1be[_0x1c96('0x26')];_0x46bbb8[_0x1c96('0x28')]=0x1;_0x46bbb8[_0x1c96('0x29')]=_0x38e1be[_0x1c96('0x2a')];_0x46bbb8[_0x1c96('0x2b')]=_0x38e1be[_0x1c96('0x2c')];_0x46bbb8[_0x1c96('0x2d')]=_0x1c96('0x2e');_0x46bbb8[_0x1c96('0x2f')]=_0x1c96('0x30');_0x46bbb8[_0x1c96('0x31')]=0x0;_0x46bbb8[_0x1c96('0x32')]=0x1;_0x46bbb8[_0x1c96('0x33')]=_0x38e1be['membername'];_0x46bbb8[_0x1c96('0x34')]=_0x1c96('0x35');return BPromise[_0x1c96('0xb')]()[_0x1c96('0xc')](voiceQueueReport['create'](_0x46bbb8))[_0x1c96('0xf')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x1c96('0x36')]=function(_0x2c5e68,_0xb59186){return BPromise[_0x1c96('0xb')]()[_0x1c96('0xc')](cmHopper[_0x1c96('0x36')](_0x2c5e68,_0xb59186))[_0x1c96('0xf')](loggerCatch(_0x1c96('0x37')));};exports[_0x1c96('0x38')]=function(_0x594140){return BPromise[_0x1c96('0xb')]()[_0x1c96('0xc')](cmHopper[_0x1c96('0x18')](_0x594140,!![],!![]))['catch'](loggerCatch(_0x1c96('0x39')));}; \ 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 269ca6c..d7a087a 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 _0xa1df=['rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','random','extractCalleridName','match','extractCalleridNumber','moment','env','XCALLY_IP_AGI','milliseconds','error','logger','loggerError','inspect','logger2','info','message','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','updatedAt','%s%s','XMD-','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','ringtime','logLookAgent','membername','logCustomer','endtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','motionChannel','voice','mandatoryDisposition','buildAcw','interface','agentReadyId','not_inuse','status','push','getDiff','diff','seconds','createBody','CampaignId','idContact','campaigntype','countglobal','callback','callbackuniqueid','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos'];(function(_0x81dae,_0x4437c9){var _0x2cab87=function(_0x1f1088){while(--_0x1f1088){_0x81dae['push'](_0x81dae['shift']());}};_0x2cab87(++_0x4437c9);}(_0xa1df,0x9e));var _0xfa1d=function(_0x41735d,_0x171717){_0x41735d=_0x41735d-0x0;var _0x4e13db=_0xa1df[_0x41735d];return _0x4e13db;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xfa1d('0x0'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0xfa1d('0x1')][_0xfa1d('0x2')]||'127.0.0.1';function getSeconds(_0x2be91f,_0x5c6833){var _0x4315a1=moment(_0x2be91f)[_0xfa1d('0x3')](0x0);var _0x2719fa=moment(_0x5c6833)[_0xfa1d('0x3')](0x0);return _0x4315a1['diff'](_0x2719fa,'seconds');}exports['loggerCatch']=function(_0x20d93e){return function(_0x147f0e){logger[_0xfa1d('0x4')](_0x20d93e,util['inspect'](_0x147f0e,{'showHidden':![],'depth':null}));};};exports[_0xfa1d('0x5')]=function(_0xc18375,_0x5350ea){logger['info'](_0xc18375,util['inspect'](_0x5350ea,{'showHidden':![],'depth':null}));};exports[_0xfa1d('0x6')]=function(_0x38d709,_0x512517){logger[_0xfa1d('0x4')](_0x38d709,util[_0xfa1d('0x7')](_0x512517,{'showHidden':![],'depth':null}));};exports[_0xfa1d('0x8')]=function(_0x9795ea){return function(_0x1fdd18){logger[_0xfa1d('0x9')](_0x9795ea,util[_0xfa1d('0x7')](_0x1fdd18,{'showHidden':![],'depth':null}));};};exports[_0xfa1d('0xa')]=function(_0x46f44b,_0x598c33,_0x336a11){return{'message':_0x46f44b,'unlock':_0x598c33,'active':_0x336a11};};exports['getCallerId']=function(_0x54476f,_0x3f5781,_0xa2409a){if(!_[_0xfa1d('0xb')](_0xa2409a)&&'string'===typeof _0xa2409a&&!_[_0xfa1d('0xc')](_0xa2409a)){if(!_[_0xfa1d('0xb')](_0x3f5781)&&_0xfa1d('0xd')===typeof _0x3f5781&&!_[_0xfa1d('0xc')](_0x3f5781)){return util[_0xfa1d('0xe')](_0xfa1d('0xf'),_0x3f5781,_0xa2409a);}return util[_0xfa1d('0xe')](_0xfa1d('0xf'),_0xa2409a,_0xa2409a);}if(!_[_0xfa1d('0xb')](_0x54476f)&&_0xfa1d('0xd')===typeof _0x54476f&&!_[_0xfa1d('0xc')](_0x54476f)){return _0x54476f;}return _0xfa1d('0x10');};exports[_0xfa1d('0x11')]=function(_0x5e4760){if(_[_0xfa1d('0x12')](_0x5e4760)){return![];}return _0x5e4760;};exports[_0xfa1d('0x13')]=function(_0x15db26,_0x296934,_0x15ad61,_0x572ac9,_0x2aaf27,_0x64c287){var _0x326525={'XMD-QUEUE':_0x296934[_0xfa1d('0x14')]?_0x296934[_0xfa1d('0x14')][_0xfa1d('0x15')]:'','XMD-CALLERID':_0x572ac9,'XMD-CALLERID-PREVIEW':_0x64c287?util[_0xfa1d('0xe')](_0xfa1d('0xf'),_0x64c287[_0xfa1d('0x16')],_0x64c287[_0xfa1d('0x17')]):_0x572ac9,'XMD-DIALID':_0x2aaf27,'XMD-CONTACTID':_0x296934[_0xfa1d('0x18')],'XMD-CDRTYPE':_0xfa1d('0x19'),'CALLERID(all)':_0x572ac9,'XMD-VOICEQUEUEID':_0x296934[_0xfa1d('0x1a')],'XMD-DIALCHANNEL':_0x15ad61,'XMD-DIALTIMEOUT':_0x15db26[_0xfa1d('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0xfa1d('0xe')](_0xfa1d('0x1c'),_0x15db26[_0xfa1d('0x1d')]?'g':'',_[_0xfa1d('0xc')](_0x15db26[_0xfa1d('0x1e')])?'':_0xfa1d('0x1f')),'XMD-DIALURL':_0x15db26['dialPreviewUrl']||'','XMD-AGI':_0x15db26[_0xfa1d('0x20')]?util[_0xfa1d('0xe')](_0xfa1d('0x21'),ipAgi,_0x15db26[_0xfa1d('0x20')]):_0xfa1d('0x22'),'XMD-AGIAFTER':_0x15db26[_0xfa1d('0x1d')]?util[_0xfa1d('0xe')]('\x22agi://%s/square,%s\x22',ipAgi,_0x15db26[_0xfa1d('0x1d')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x64c287?_0x64c287[_0xfa1d('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x64c287?_0x64c287[_0xfa1d('0x24')]:'','XMD-DESTINATION':_0xfa1d('0x25'),'SIPADDHEADER':_0xfa1d('0x26')};if(!_[_0xfa1d('0xc')](_0x15db26[_0xfa1d('0x1e')])){_0x326525[util[_0xfa1d('0xe')]('%s',_0xfa1d('0x27'))]=_0x15db26[_0xfa1d('0x1e')];_0x326525[util[_0xfa1d('0xe')]('%s',_0xfa1d('0x28'))]=_0x2aaf27;}if(_0x296934&&_0x296934[_0xfa1d('0x29')]){for(var _0x4ab17d in _0x296934['Contact']){if(_0x296934['Contact']['hasOwnProperty'](_0x4ab17d)){if(!_[_0xfa1d('0x12')](_0x296934['Contact'][_0x4ab17d])&&_0x4ab17d!=='id'&&_0x4ab17d!==_0xfa1d('0x2a')&&_0x4ab17d!=='createdAt'&&_0x4ab17d!==_0xfa1d('0x2b')){_0x326525[util[_0xfa1d('0xe')](_0xfa1d('0x2c'),_0xfa1d('0x2d'),_['toUpper'](_0x4ab17d))]=_0x296934[_0xfa1d('0x29')][_0x4ab17d];}}}}return _0x326525;};exports['toLowerVariables']=function(_0x3464bc){var _0x6f57ca={};for(var _0x3c460e in _0x3464bc){if(_0x3464bc[_0xfa1d('0x2e')](_0x3c460e)){_0x6f57ca[util[_0xfa1d('0xe')]('%s',_[_0xfa1d('0x2f')](_0x3c460e))]=_0x3464bc[_0x3c460e];}}return{'variables':_0x6f57ca};};exports['updateOriginated']=function(_0x5087bc,_0x27cbed){if(!_[_0xfa1d('0x12')](_0x5087bc)){if(_0x5087bc['hasOwnProperty'](_0xfa1d('0x30'))){if(_0x5087bc[_0xfa1d('0x30')]>0x0){_0x5087bc['originated']-=0x1;}else{logger[_0xfa1d('0x4')](_0xfa1d('0x31'),_0x27cbed);}}}else{logger[_0xfa1d('0x4')](_0xfa1d('0x32'),_0x27cbed);}};exports[_0xfa1d('0x33')]=function(_0x10ddc6){var _0x4bb7c1=moment()[_0xfa1d('0xe')](_0xfa1d('0x34'));_0x10ddc6[_0xfa1d('0x35')]=0xd;_0x10ddc6[_0xfa1d('0x36')]=_0xfa1d('0x37');_0x10ddc6[_0xfa1d('0x38')]=_0x4bb7c1;_0x10ddc6[_0xfa1d('0x39')]=_0x4bb7c1;_0x10ddc6['endtime']=_0x4bb7c1;};exports['logAgent']=function(_0x45332f,_0x386d79,_0x549ff2){var _0x195112=moment()[_0xfa1d('0xe')](_0xfa1d('0x34'));_0x45332f[_0xfa1d('0x35')]=_0x386d79;_0x45332f[_0xfa1d('0x36')]=_0x549ff2;_0x45332f[_0xfa1d('0x39')]=_0x195112;_0x45332f[_0xfa1d('0x3a')]=getSeconds(_0x45332f[_0xfa1d('0x39')],_0x45332f[_0xfa1d('0x38')]);};exports[_0xfa1d('0x3b')]=function(_0x319e7e,_0x1f4213,_0x3c7b0d){_0x319e7e[_0xfa1d('0x3c')]=_0x1f4213;_0x319e7e['UserId']=_0x3c7b0d;};exports[_0xfa1d('0x3d')]=function(_0x161901,_0xd719d6,_0x29836f){var _0x26a310=moment()[_0xfa1d('0xe')](_0xfa1d('0x34'));_0x161901[_0xfa1d('0x35')]=_0xd719d6;_0x161901[_0xfa1d('0x36')]=_0x29836f;_0x161901[_0xfa1d('0x39')]=_0x161901[_0xfa1d('0x39')]?_0x161901['responsetime']:_0x26a310;_0x161901[_0xfa1d('0x3e')]=_0x161901[_0xfa1d('0x3e')]?_0x161901[_0xfa1d('0x3e')]:_0x26a310;_0x161901['ringtime']=getSeconds(_0x161901[_0xfa1d('0x39')]||0x0,_0x161901[_0xfa1d('0x38')]||0x0);_0x161901[_0xfa1d('0x3f')]=_0x161901[_0xfa1d('0x40')]?getSeconds(_0x161901[_0xfa1d('0x3e')],_0x161901[_0xfa1d('0x40')]):0x0;};exports[_0xfa1d('0x41')]=function(_0x2b8dfb){return _0x2b8dfb===_0xfa1d('0x42');};exports[_0xfa1d('0x43')]=function(_0x651b56,_0x5f1c2e,_0x52376d,_0x2af79e,_0xd6ef28){var _0xcb0ec5=_0x2af79e?_0xfa1d('0x44'):_0x651b56[_0xfa1d('0x16')];_0xcb0ec5=_0xd6ef28?_0xfa1d('0x45'):_0xcb0ec5;return{'actionid':_0x651b56[_0xfa1d('0x46')],'action':'originate','channel':_0x651b56[_0xfa1d('0x47')],'callerid':util[_0xfa1d('0xe')]('\x22%s\x22\x20<%s>',_0xcb0ec5,_0x651b56['calleridnum']),'Exten':_0xfa1d('0x25'),'Context':_0xfa1d('0x48'),'Priority':'1','variable':_0x52376d,'timeout':(_0x5f1c2e[_0xfa1d('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x651b56[_0xfa1d('0x46')]};};exports[_0xfa1d('0x4a')]=function(_0x193c2f){return _0x193c2f[_0xfa1d('0x4b')]+_0x193c2f[_0xfa1d('0x4c')]+_0x193c2f[_0xfa1d('0x4d')]+_0x193c2f[_0xfa1d('0x4e')]+_0x193c2f[_0xfa1d('0x4f')];};exports['cloneAction']=function(_0x1e58b3){var _0x434fb3=_[_0xfa1d('0x50')](_0x1e58b3);_0x434fb3[_0xfa1d('0x35')]=0xf;_0x434fb3[_0xfa1d('0x36')]='Global';return _0x434fb3;};exports[_0xfa1d('0x51')]=function(_0x2a61c4,_0x3aec61,_0xeeb0bf){var _0x385e25={};_0x385e25[_0x3aec61]=_0x2a61c4[_0x3aec61];_0x385e25[_0xfa1d('0x52')]=![];_0x385e25[_0xfa1d('0x53')]=moment()[_0xfa1d('0x54')](_0xeeb0bf,_0xfa1d('0x55'))[_0xfa1d('0xe')](_0xfa1d('0x34'));_0x385e25[_0xfa1d('0x18')]=_0x2a61c4[_0xfa1d('0x18')];_0x385e25[_0xfa1d('0x56')]=_0x2a61c4[_0xfa1d('0x56')];_0x385e25[_0xfa1d('0x1a')]=_0x2a61c4['VoiceQueueId']||undefined;return _0x385e25;};exports[_0xfa1d('0x57')]=function(_0x5808f0,_0x57fdcc){if(!_[_0xfa1d('0x12')](_0x5808f0)){if(_0x5808f0['pTalking']>0x0){_0x5808f0[_0xfa1d('0x58')]-=0x1;}else{logger[_0xfa1d('0x4')](_0x57fdcc,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xfa1d('0x4')](_0x57fdcc,_0xfa1d('0x59'));}};exports[_0xfa1d('0x5a')]=function(_0x1565f3){if(_0x1565f3<=0x0){return!![];}return![];};exports['buildObj']=function(_0x3beb63,_0x148f0b,_0x5e45d5){_0x3beb63['lastevent']=_0x148f0b;_0x3beb63['name']=_0x3beb63[_0xfa1d('0x5b')];_0x3beb63['interface']=_0x3beb63[_0xfa1d('0x47')];_0x3beb63[_0xfa1d('0x5c')]=_0xfa1d('0x5d');if(_0x5e45d5){_0x3beb63['mandatoryDisposition']=_0x5e45d5[_0xfa1d('0x5e')];}return _0x3beb63;};exports[_0xfa1d('0x5f')]=function(_0x310a6c){var _0x2f48e2={};_0x2f48e2[_0xfa1d('0x5b')]=_0x310a6c[_0xfa1d('0x5b')];_0x2f48e2[_0xfa1d('0x60')]=_0x310a6c[_0xfa1d('0x47')];_0x2f48e2['uniqueid']=_0x310a6c[_0xfa1d('0x46')];return _0x2f48e2;};exports[_0xfa1d('0x61')]=function(_0x7fc787){var _0x4d657c=[];for(var _0x3572e0 in _0x7fc787){if(_0x7fc787['hasOwnProperty'](_0x3572e0)){if(!_[_0xfa1d('0x12')](_0x7fc787[_0x3572e0])&&_0x7fc787[_0x3572e0][_0xfa1d('0x35')]===_0xfa1d('0x62')&&_0x7fc787[_0x3572e0][_0xfa1d('0x63')]==='reachable'){_0x4d657c[_0xfa1d('0x64')](_0x7fc787[_0x3572e0]['id']);}}}return _0x4d657c;};exports[_0xfa1d('0x65')]=function(_0x1398f1){var _0x492692=moment()[_0xfa1d('0x3')](0x0);var _0x287e21=moment(_0x1398f1)['milliseconds'](0x0);return _0x492692[_0xfa1d('0x66')](_0x287e21,_0xfa1d('0x67'));};exports[_0xfa1d('0x68')]=function(_0x1eb61a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1eb61a['ContactId'],'ListId':_0x1eb61a[_0xfa1d('0x56')],'VoiceQueueId':_0x1eb61a[_0xfa1d('0x1a')]||undefined,'CampaignId':_0x1eb61a[_0xfa1d('0x69')]||undefined};};exports['filterKey']=function(_0xaac492){if(_0xaac492===_0xfa1d('0x46')||_0xaac492===_0xfa1d('0x6a')||_0xaac492===_0xfa1d('0x5b')||_0xaac492==='type'||_0xaac492===_0xfa1d('0x6b')||_0xaac492==='dialAnswer'||_0xaac492==='membername'||_0xaac492==='channelAgent'||_0xaac492==='calleridname'||_0xaac492==='active'||_0xaac492===_0xfa1d('0x17')||_0xaac492===_0xfa1d('0x53')||_0xaac492===_0xfa1d('0x4b')||_0xaac492==='countcongestionretry'||_0xaac492===_0xfa1d('0x4d')||_0xaac492===_0xfa1d('0x6c')||_0xaac492===_0xfa1d('0x6d')||_0xaac492===_0xfa1d('0x6e')||_0xaac492==='callbackat'||_0xaac492===_0xfa1d('0x6f')||_0xaac492===_0xfa1d('0x18')||_0xaac492===_0xfa1d('0x56')||_0xaac492===_0xfa1d('0x70')||_0xaac492===_0xfa1d('0x1a')||_0xaac492===_0xfa1d('0x71')||_0xaac492===_0xfa1d('0x72')||_0xaac492===_0xfa1d('0x73')||_0xaac492===_0xfa1d('0x74')||_0xaac492===_0xfa1d('0x75')||_0xaac492===_0xfa1d('0x76')||_0xaac492===_0xfa1d('0x77')||_0xaac492==='xmd-dialoptions'||_0xaac492===_0xfa1d('0x78')||_0xaac492===_0xfa1d('0x79')||_0xaac492===_0xfa1d('0x7a')||_0xaac492===_0xfa1d('0x7b')||_0xaac492===_0xfa1d('0x7c')||_0xaac492===_0xfa1d('0x7d')||_0xaac492===_0xfa1d('0x7e')||_0xaac492===_0xfa1d('0x7f')||_0xaac492===_0xfa1d('0x80')||_0xaac492===_0xfa1d('0x81')||_0xaac492===_0xfa1d('0x82')||_0xaac492===_0xfa1d('0x83')||_0xaac492===_0xfa1d('0x84')||_0xaac492===_0xfa1d('0x85')||_0xaac492===_0xfa1d('0x86')||_0xaac492===_0xfa1d('0x7f')||_0xaac492==='rtpaudioqosbridged'||_0xaac492===_0xfa1d('0x81')||_0xaac492==='rtpaudioqosjitterbridged'||_0xaac492==='rtpaudioqosloss'||_0xaac492===_0xfa1d('0x84')||_0xaac492==='rtpaudioqosrtt'||_0xaac492===_0xfa1d('0x86')||_0xaac492===_0xfa1d('0x87')||_0xaac492===_0xfa1d('0x88')||_0xaac492===_0xfa1d('0x35')||_0xaac492===_0xfa1d('0x36')){return![];}return!![];};exports[_0xfa1d('0x89')]=function(_0x287e9d,_0x3c1933){var _0x5e5ba5,_0x3589d3,_0x3f0d1a;if(_0x3c1933<=0x0){_0x3c1933=0x1;}_0x5e5ba5=new RegExp('\x5cw{0,'+_0x3c1933+'}$');_0x3589d3=Math['pow'](0xa,_0x3c1933-0x1);_0x3f0d1a=Math[_0xfa1d('0x8a')](0xa,_0x3c1933)-0x1;return util['format']('%s',_['replace'](_0x287e9d,_0x5e5ba5,_[_0xfa1d('0x8b')](_0x3589d3,_0x3f0d1a)));};exports[_0xfa1d('0x8c')]=function(_0x4dcc93){var _0x4ffa5a=_0x4dcc93[_0xfa1d('0x8d')](/"(.*?)"/);return _0x4ffa5a?_0x4ffa5a[0x1]:_0x4dcc93;};exports[_0xfa1d('0x8e')]=function(_0x4db9b7){var _0x59a831=_0x4db9b7[_0xfa1d('0x8d')](/<(.*?)>/);return _0x59a831?_0x59a831[0x1]:_0x4db9b7;}; \ No newline at end of file +var _0xe196=['rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqos','rtpaudioqosjitter','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','loggerError','logger2','info','message','getCallerId','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','isNil','tags','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','Blacklist','starttime','responsetime','endtime','logAgent','logLookAgent','UserId','logCustomer','YYYY-MM-DD\x20HH:mm:ss','statedesc','talktime','isFailure','Failure','variablesAction','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','state','Global','scheduledat','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','getDiff','filterKey','idContact','campaigntype','dialAnswer','membername','active','countbusyretry','callback','callbackat','recallme','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqosbridged'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe196,0x122));var _0x6e19=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe196[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x6e19('0x0'));var _=require(_0x6e19('0x1'));var moment=require(_0x6e19('0x2'));var logger=require(_0x6e19('0x3'))(_0x6e19('0x4'));var ipAgi=process[_0x6e19('0x5')][_0x6e19('0x6')]||'127.0.0.1';function getSeconds(_0x2b76a8,_0x15e74c){var _0x20264f=moment(_0x2b76a8)[_0x6e19('0x7')](0x0);var _0x1d1b9e=moment(_0x15e74c)['milliseconds'](0x0);return _0x20264f[_0x6e19('0x8')](_0x1d1b9e,_0x6e19('0x9'));}exports[_0x6e19('0xa')]=function(_0x2dc1d1){return function(_0x38107a){logger[_0x6e19('0xb')](_0x2dc1d1,util[_0x6e19('0xc')](_0x38107a,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x300cca,_0x1f4c24){logger['info'](_0x300cca,util[_0x6e19('0xc')](_0x1f4c24,{'showHidden':![],'depth':null}));};exports[_0x6e19('0xd')]=function(_0x5f5c69,_0x4440bc){logger[_0x6e19('0xb')](_0x5f5c69,util['inspect'](_0x4440bc,{'showHidden':![],'depth':null}));};exports[_0x6e19('0xe')]=function(_0x467f49){return function(_0x4163bb){logger[_0x6e19('0xf')](_0x467f49,util[_0x6e19('0xc')](_0x4163bb,{'showHidden':![],'depth':null}));};};exports[_0x6e19('0x10')]=function(_0x3a093a,_0x1b5953,_0x5916bb){return{'message':_0x3a093a,'unlock':_0x1b5953,'active':_0x5916bb};};exports[_0x6e19('0x11')]=function(_0x1ecd0c,_0x5a19c3,_0x382967){if(!_[_0x6e19('0x12')](_0x382967)&&'string'===typeof _0x382967&&!_[_0x6e19('0x13')](_0x382967)){if(!_['isUndefined'](_0x5a19c3)&&'string'===typeof _0x5a19c3&&!_[_0x6e19('0x13')](_0x5a19c3)){return util[_0x6e19('0x14')](_0x6e19('0x15'),_0x5a19c3,_0x382967);}return util[_0x6e19('0x14')](_0x6e19('0x15'),_0x382967,_0x382967);}if(!_[_0x6e19('0x12')](_0x1ecd0c)&&'string'===typeof _0x1ecd0c&&!_[_0x6e19('0x13')](_0x1ecd0c)){return _0x1ecd0c;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x953a7a){if(_['isNil'](_0x953a7a)){return![];}return _0x953a7a;};exports['addVariables']=function(_0x9d0cf4,_0xb02518,_0x18e046,_0x2d512d,_0x2ecd42,_0x1116d7){var _0x44760d={'XMD-QUEUE':_0xb02518[_0x6e19('0x16')]?_0xb02518[_0x6e19('0x16')][_0x6e19('0x17')]:'','XMD-CALLERID':_0x2d512d,'XMD-CALLERID-PREVIEW':_0x1116d7?util['format'](_0x6e19('0x15'),_0x1116d7[_0x6e19('0x18')],_0x1116d7[_0x6e19('0x19')]):_0x2d512d,'XMD-DIALID':_0x2ecd42,'XMD-CONTACTID':_0xb02518[_0x6e19('0x1a')],'XMD-CDRTYPE':_0x6e19('0x1b'),'CALLERID(all)':_0x2d512d,'XMD-VOICEQUEUEID':_0xb02518[_0x6e19('0x1c')],'XMD-DIALCHANNEL':_0x18e046,'XMD-DIALTIMEOUT':_0x9d0cf4[_0x6e19('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x6e19('0x14')](_0x6e19('0x1e'),_0x9d0cf4[_0x6e19('0x1f')]?'g':'',_[_0x6e19('0x13')](_0x9d0cf4[_0x6e19('0x20')])?'':_0x6e19('0x21')),'XMD-DIALURL':_0x9d0cf4[_0x6e19('0x22')]||'','XMD-AGI':_0x9d0cf4['dialQueueProject']?util[_0x6e19('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x9d0cf4[_0x6e19('0x23')]):_0x6e19('0x24'),'XMD-AGIAFTER':_0x9d0cf4[_0x6e19('0x1f')]?util[_0x6e19('0x14')](_0x6e19('0x25'),ipAgi,_0x9d0cf4[_0x6e19('0x1f')]):_0x6e19('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x1116d7?_0x1116d7['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x1116d7?_0x1116d7[_0x6e19('0x26')]:'','XMD-DESTINATION':_0x6e19('0x27'),'SIPADDHEADER':_0x6e19('0x28')};if(!_[_0x6e19('0x13')](_0x9d0cf4['monitor_format'])){_0x44760d[util['format']('%s',_0x6e19('0x29'))]=_0x9d0cf4[_0x6e19('0x20')];_0x44760d[util[_0x6e19('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x2ecd42;}if(_0xb02518&&_0xb02518[_0x6e19('0x2a')]){for(var _0x5ea1dc in _0xb02518[_0x6e19('0x2a')]){if(_0xb02518[_0x6e19('0x2a')]['hasOwnProperty'](_0x5ea1dc)){if(!_[_0x6e19('0x2b')](_0xb02518[_0x6e19('0x2a')][_0x5ea1dc])&&_0x5ea1dc!=='id'&&_0x5ea1dc!==_0x6e19('0x2c')&&_0x5ea1dc!==_0x6e19('0x2d')&&_0x5ea1dc!==_0x6e19('0x2e')){_0x44760d[util[_0x6e19('0x14')]('%s%s',_0x6e19('0x2f'),_[_0x6e19('0x30')](_0x5ea1dc))]=_0xb02518[_0x6e19('0x2a')][_0x5ea1dc];}}}}return _0x44760d;};exports[_0x6e19('0x31')]=function(_0x3f9da7){var _0x47f399={};for(var _0x4496dc in _0x3f9da7){if(_0x3f9da7[_0x6e19('0x32')](_0x4496dc)){_0x47f399[util['format']('%s',_[_0x6e19('0x33')](_0x4496dc))]=_0x3f9da7[_0x4496dc];}}return{'variables':_0x47f399};};exports[_0x6e19('0x34')]=function(_0x13d94e,_0x4db82d){if(!_[_0x6e19('0x2b')](_0x13d94e)){if(_0x13d94e[_0x6e19('0x32')](_0x6e19('0x35'))){if(_0x13d94e[_0x6e19('0x35')]>0x0){_0x13d94e[_0x6e19('0x35')]-=0x1;}else{logger['error'](_0x6e19('0x36'),_0x4db82d);}}}else{logger[_0x6e19('0xb')](_0x6e19('0x37'),_0x4db82d);}};exports[_0x6e19('0x38')]=function(_0xeef236){var _0x2736a6=moment()[_0x6e19('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0xeef236['state']=0xd;_0xeef236['statedesc']=_0x6e19('0x39');_0xeef236[_0x6e19('0x3a')]=_0x2736a6;_0xeef236[_0x6e19('0x3b')]=_0x2736a6;_0xeef236[_0x6e19('0x3c')]=_0x2736a6;};exports[_0x6e19('0x3d')]=function(_0x210e9b,_0x5c1227,_0x542fa8){var _0x3d2390=moment()[_0x6e19('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x210e9b['state']=_0x5c1227;_0x210e9b['statedesc']=_0x542fa8;_0x210e9b[_0x6e19('0x3b')]=_0x3d2390;_0x210e9b['ringtime']=getSeconds(_0x210e9b['responsetime'],_0x210e9b[_0x6e19('0x3a')]);};exports[_0x6e19('0x3e')]=function(_0x4d4f75,_0x4553bd,_0x48906a){_0x4d4f75['membername']=_0x4553bd;_0x4d4f75[_0x6e19('0x3f')]=_0x48906a;};exports[_0x6e19('0x40')]=function(_0x138824,_0x3573a9,_0x1ecc20){var _0x4eff3e=moment()['format'](_0x6e19('0x41'));_0x138824['state']=_0x3573a9;_0x138824[_0x6e19('0x42')]=_0x1ecc20;_0x138824[_0x6e19('0x3b')]=_0x138824[_0x6e19('0x3b')]?_0x138824[_0x6e19('0x3b')]:_0x4eff3e;_0x138824[_0x6e19('0x3c')]=_0x138824['endtime']?_0x138824[_0x6e19('0x3c')]:_0x4eff3e;_0x138824['ringtime']=getSeconds(_0x138824[_0x6e19('0x3b')]||0x0,_0x138824[_0x6e19('0x3a')]||0x0);_0x138824[_0x6e19('0x43')]=_0x138824['answertime']?getSeconds(_0x138824['endtime'],_0x138824['answertime']):0x0;};exports[_0x6e19('0x44')]=function(_0x3bc20f){return _0x3bc20f===_0x6e19('0x45');};exports[_0x6e19('0x46')]=function(_0x5eafa2,_0x2eb040,_0x3b1d08,_0x582030,_0x89dd89){var _0x41a2a9=_0x582030?'RECALL':_0x5eafa2[_0x6e19('0x18')];_0x41a2a9=_0x89dd89?'BOOKED':_0x41a2a9;return{'actionid':_0x5eafa2[_0x6e19('0x47')],'action':_0x6e19('0x48'),'channel':_0x5eafa2[_0x6e19('0x49')],'callerid':util['format'](_0x6e19('0x15'),_0x41a2a9,_0x5eafa2['calleridnum']),'Exten':_0x6e19('0x27'),'Context':_0x6e19('0x4a'),'Priority':'1','variable':_0x3b1d08,'timeout':(_0x2eb040[_0x6e19('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5eafa2[_0x6e19('0x47')]};};exports[_0x6e19('0x4c')]=function(_0x2e3a4d){return _0x2e3a4d['countbusyretry']+_0x2e3a4d[_0x6e19('0x4d')]+_0x2e3a4d['countnoanswerretry']+_0x2e3a4d[_0x6e19('0x4e')]+_0x2e3a4d[_0x6e19('0x4f')];};exports[_0x6e19('0x50')]=function(_0x289a68){var _0x46bd15=_[_0x6e19('0x51')](_0x289a68);_0x46bd15[_0x6e19('0x52')]=0xf;_0x46bd15['statedesc']=_0x6e19('0x53');return _0x46bd15;};exports['scheduledAt']=function(_0x235b29,_0x4d71f8,_0x281e7c){var _0x1d10d7={};_0x1d10d7[_0x4d71f8]=_0x235b29[_0x4d71f8];_0x1d10d7['active']=![];_0x1d10d7[_0x6e19('0x54')]=moment()['add'](_0x281e7c,'minutes')[_0x6e19('0x14')](_0x6e19('0x41'));_0x1d10d7[_0x6e19('0x1a')]=_0x235b29[_0x6e19('0x1a')];_0x1d10d7[_0x6e19('0x55')]=_0x235b29[_0x6e19('0x55')];_0x1d10d7[_0x6e19('0x1c')]=_0x235b29[_0x6e19('0x1c')]||undefined;return _0x1d10d7;};exports[_0x6e19('0x56')]=function(_0x3c3cf6,_0xb0dacc){if(!_['isNil'](_0x3c3cf6)){if(_0x3c3cf6['pTalking']>0x0){_0x3c3cf6[_0x6e19('0x57')]-=0x1;}else{logger[_0x6e19('0xb')](_0xb0dacc,_0x6e19('0x58'));}}else{logger[_0x6e19('0xb')](_0xb0dacc,_0x6e19('0x59'));}};exports[_0x6e19('0x5a')]=function(_0x9edf1c){if(_0x9edf1c<=0x0){return!![];}return![];};exports[_0x6e19('0x5b')]=function(_0x292154,_0x4a0831,_0x169bf2){_0x292154[_0x6e19('0x5c')]=_0x4a0831;_0x292154[_0x6e19('0x17')]=_0x292154[_0x6e19('0x5d')];_0x292154[_0x6e19('0x5e')]=_0x292154[_0x6e19('0x49')];_0x292154[_0x6e19('0x5f')]=_0x6e19('0x60');if(_0x169bf2){_0x292154[_0x6e19('0x61')]=_0x169bf2['mandatoryDisposition'];}return _0x292154;};exports[_0x6e19('0x62')]=function(_0x1bf2e2){var _0x177811={};_0x177811[_0x6e19('0x5d')]=_0x1bf2e2['queue'];_0x177811[_0x6e19('0x5e')]=_0x1bf2e2[_0x6e19('0x49')];_0x177811[_0x6e19('0x47')]=_0x1bf2e2[_0x6e19('0x47')];return _0x177811;};exports[_0x6e19('0x63')]=function(_0x3aa3f5){var _0x164460=[];for(var _0x4325c7 in _0x3aa3f5){if(_0x3aa3f5[_0x6e19('0x32')](_0x4325c7)){if(!_[_0x6e19('0x2b')](_0x3aa3f5[_0x4325c7])&&_0x3aa3f5[_0x4325c7][_0x6e19('0x52')]===_0x6e19('0x64')&&_0x3aa3f5[_0x4325c7][_0x6e19('0x65')]===_0x6e19('0x66')){_0x164460['push'](_0x3aa3f5[_0x4325c7]['id']);}}}return _0x164460;};exports[_0x6e19('0x67')]=function(_0xfba159){var _0x2bee0f=moment()[_0x6e19('0x7')](0x0);var _0x3f4298=moment(_0xfba159)[_0x6e19('0x7')](0x0);return _0x2bee0f[_0x6e19('0x8')](_0x3f4298,'seconds');};exports['createBody']=function(_0x4bbdfe){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4bbdfe[_0x6e19('0x1a')],'ListId':_0x4bbdfe[_0x6e19('0x55')],'VoiceQueueId':_0x4bbdfe['VoiceQueueId']||undefined,'CampaignId':_0x4bbdfe['CampaignId']||undefined};};exports[_0x6e19('0x68')]=function(_0x2c162c){if(_0x2c162c===_0x6e19('0x47')||_0x2c162c===_0x6e19('0x69')||_0x2c162c===_0x6e19('0x5d')||_0x2c162c==='type'||_0x2c162c===_0x6e19('0x6a')||_0x2c162c===_0x6e19('0x6b')||_0x2c162c===_0x6e19('0x6c')||_0x2c162c===_0x6e19('0x49')||_0x2c162c===_0x6e19('0x18')||_0x2c162c===_0x6e19('0x6d')||_0x2c162c===_0x6e19('0x19')||_0x2c162c===_0x6e19('0x54')||_0x2c162c===_0x6e19('0x6e')||_0x2c162c==='countcongestionretry'||_0x2c162c==='countnoanswerretry'||_0x2c162c==='countglobal'||_0x2c162c===_0x6e19('0x6f')||_0x2c162c==='callbackuniqueid'||_0x2c162c===_0x6e19('0x70')||_0x2c162c===_0x6e19('0x71')||_0x2c162c==='ContactId'||_0x2c162c===_0x6e19('0x55')||_0x2c162c===_0x6e19('0x3f')||_0x2c162c===_0x6e19('0x1c')||_0x2c162c==='sipcallid'||_0x2c162c===_0x6e19('0x72')||_0x2c162c==='xmd-queue'||_0x2c162c===_0x6e19('0x73')||_0x2c162c===_0x6e19('0x74')||_0x2c162c==='xmd-dialurl'||_0x2c162c===_0x6e19('0x75')||_0x2c162c===_0x6e19('0x76')||_0x2c162c==='xmd-dialid'||_0x2c162c===_0x6e19('0x77')||_0x2c162c==='xmd-contactid'||_0x2c162c===_0x6e19('0x78')||_0x2c162c==='xmd-callerid'||_0x2c162c===_0x6e19('0x79')||_0x2c162c===_0x6e19('0x7a')||_0x2c162c==='rtpaudioqos'||_0x2c162c===_0x6e19('0x7b')||_0x2c162c==='rtpaudioqosjitter'||_0x2c162c===_0x6e19('0x7c')||_0x2c162c===_0x6e19('0x7d')||_0x2c162c==='rtpaudioqoslossbridged'||_0x2c162c===_0x6e19('0x7e')||_0x2c162c==='rtpaudioqosrttbridged'||_0x2c162c===_0x6e19('0x7f')||_0x2c162c===_0x6e19('0x7b')||_0x2c162c===_0x6e19('0x80')||_0x2c162c==='rtpaudioqosjitterbridged'||_0x2c162c===_0x6e19('0x7d')||_0x2c162c===_0x6e19('0x81')||_0x2c162c===_0x6e19('0x7e')||_0x2c162c==='rtpaudioqosrttbridged'||_0x2c162c===_0x6e19('0x82')||_0x2c162c===_0x6e19('0x83')||_0x2c162c===_0x6e19('0x52')||_0x2c162c===_0x6e19('0x42')){return![];}return!![];};exports[_0x6e19('0x84')]=function(_0x1272fd,_0x414554){var _0x3195d0,_0x51b961,_0xa5e1b3;if(_0x414554<=0x0){_0x414554=0x1;}_0x3195d0=new RegExp('\x5cw{0,'+_0x414554+'}$');_0x51b961=Math[_0x6e19('0x85')](0xa,_0x414554-0x1);_0xa5e1b3=Math[_0x6e19('0x85')](0xa,_0x414554)-0x1;return util[_0x6e19('0x14')]('%s',_[_0x6e19('0x86')](_0x1272fd,_0x3195d0,_[_0x6e19('0x87')](_0x51b961,_0xa5e1b3)));};exports['extractCalleridName']=function(_0x580f5b){var _0x51942c=_0x580f5b[_0x6e19('0x88')](/"(.*?)"/);return _0x51942c?_0x51942c[0x1]:_0x580f5b;};exports[_0x6e19('0x89')]=function(_0x5c45e6){var _0x490651=_0x5c45e6['match'](/<(.*?)>/);return _0x490651?_0x490651[0x1]:_0x5c45e6;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index de06d5c..9470f19 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 _0x4087=['string','number','boolean','queueremove','queuepause','voicequeuechannel','voicequeuechannelhangup','queueadd'];(function(_0x38b1fe,_0x53aedb){var _0x1b3f86=function(_0x2d4112){while(--_0x2d4112){_0x38b1fe['push'](_0x38b1fe['shift']());}};_0x1b3f86(++_0x53aedb);}(_0x4087,0xef));var _0x7408=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4087[_0x14add3];return _0x4a174f;};'use strict';exports[_0x7408('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x7408('0x1'),'required':!![]},'penalty':{'type':_0x7408('0x2'),'required':![]},'paused':{'type':_0x7408('0x3'),'required':![]}};exports[_0x7408('0x4')]={'queue':{'type':_0x7408('0x1'),'required':!![]},'interface':{'type':_0x7408('0x1'),'required':!![]}};exports[_0x7408('0x5')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x7408('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x7408('0x1'),'required':![]}};exports[_0x7408('0x6')]={'uniqueid':{'type':_0x7408('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x7408('0x1')},'format':{'type':_0x7408('0x1')},'mixmonitorid':{'type':_0x7408('0x1')}};exports[_0x7408('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x7408('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x4abc=['voicequeuechannelredirect','queueadd','string','boolean','queuepause','reload','voicequeuechannel','voicequeuechannelhangup'];(function(_0x55f4f8,_0x469c71){var _0x1f9e8a=function(_0x3c4e0b){while(--_0x3c4e0b){_0x55f4f8['push'](_0x55f4f8['shift']());}};_0x1f9e8a(++_0x469c71);}(_0x4abc,0x99));var _0xc4ab=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x4abc[_0x4792c8];return _0x35edb1;};'use strict';exports[_0xc4ab('0x0')]={'queue':{'type':_0xc4ab('0x1'),'required':!![]},'interface':{'type':_0xc4ab('0x1'),'required':!![]},'membername':{'type':_0xc4ab('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xc4ab('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0xc4ab('0x1'),'required':!![]}};exports[_0xc4ab('0x3')]={'interface':{'type':_0xc4ab('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xc4ab('0x1'),'required':![]}};exports[_0xc4ab('0x4')]={'module':{'type':_0xc4ab('0x1'),'required':![]}};exports[_0xc4ab('0x5')]={'uniqueid':{'type':_0xc4ab('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xc4ab('0x1')},'format':{'type':_0xc4ab('0x1')},'mixmonitorid':{'type':_0xc4ab('0x1')}};exports[_0xc4ab('0x6')]={'uniqueid':{'type':_0xc4ab('0x1'),'required':!![]}};exports[_0xc4ab('0x7')]={'uniqueid':{'type':_0xc4ab('0x1'),'required':!![]},'exten':{'type':_0xc4ab('0x1'),'required':!![]},'context':{'type':_0xc4ab('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 940c478..e23af3b 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 _0x663d=['outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','mergeFromDatabase','initTelephones','isUndefined','telephones','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','answered','queuecallercompleteAt','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','exports','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','voiceQueues','triggers','templates','outbound','voiceExtensions','channels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','sumHoldTime','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','total','unmanaged','abandoned','sumDuration','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay'];(function(_0x414d92,_0x568805){var _0x5b6e85=function(_0x8847e6){while(--_0x8847e6){_0x414d92['push'](_0x414d92['shift']());}};_0x5b6e85(++_0x568805);}(_0x663d,0xa3));var _0xd663=function(_0x4d028d,_0x2dde11){_0x4d028d=_0x4d028d-0x0;var _0x2841a9=_0x663d[_0x4d028d];return _0x2841a9;};'use strict';var BPromise=require('bluebird');var util=require(_0xd663('0x0'));var _=require(_0xd663('0x1'));var moment=require(_0xd663('0x2'));var Agent=require(_0xd663('0x3'));var Telephone=require(_0xd663('0x4'));var Trunk=require(_0xd663('0x5'));var VoiceQueue=require(_0xd663('0x6'));var Trigger=require(_0xd663('0x7'));var Template=require(_0xd663('0x8'));var Campaign=require(_0xd663('0x9'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xd663('0xa'));var SalesforceAccount=require(_0xd663('0xb'));var FreshdeskAccount=require(_0xd663('0xc'));var SugarcrmAccount=require(_0xd663('0xd'));var ZohoAccount=require(_0xd663('0xe'));var DeskAccount=require(_0xd663('0xf'));var VtigerAccount=require(_0xd663('0x10'));var ServicenowAccount=require(_0xd663('0x11'));var Dynamics365Account=require(_0xd663('0x12'));var FreshsalesAccount=require(_0xd663('0x13'));var FaxAccount=require(_0xd663('0x14'));var Realtime=function(){this[_0xd663('0x15')]={};this['telephones']={};this['trunks']={};this[_0xd663('0x16')]={};this[_0xd663('0x17')]={};this['campaigns']={};this[_0xd663('0x18')]={};this[_0xd663('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xd663('0x1a')]={};this[_0xd663('0x1b')]={};this['queueChannels']={};this[_0xd663('0x1c')]={};this[_0xd663('0x1d')]={};this['settings']={};this['zendeskAccounts']={};this[_0xd663('0x1e')]={};this[_0xd663('0x1f')]={};this[_0xd663('0x20')]={};this['zohoAccounts']={};this['deskAccounts']={};this[_0xd663('0x21')]={};this[_0xd663('0x22')]={};this[_0xd663('0x23')]={};this[_0xd663('0x24')]={};this[_0xd663('0x25')]={};};function freeIsNotKey(_0x5588b0,_0x397974,_0x2bc3ec){var _0x4133c9=_[_0xd663('0x26')](_0x5588b0,function(_0xdb918e,_0x384c7e){return _0xdb918e[_0x2bc3ec];});for(var _0x512f1e in _0x397974){if(_0x397974[_0xd663('0x27')](_0x512f1e)){if(!_0x4133c9[_0x512f1e]){delete _0x397974[_0x512f1e];}}}}function freeIsNotKeySip(_0x4474bd,_0x55a544){var _0x2b5ff8=_['mapKeys'](_0x4474bd,function(_0x1554ef,_0x2483ae){return util[_0xd663('0x28')](_0xd663('0x29'),_0x1554ef[_0xd663('0x2a')]);});for(var _0x2c9cf1 in _0x55a544){if(_0x55a544[_0xd663('0x27')](_0x2c9cf1)){if(!_0x2b5ff8[_0x2c9cf1]){delete _0x55a544[_0x2c9cf1];}}}}function freeIsNotKeyAgent(_0x3f5bc3,_0x23de78){var _0x35efb3=_[_0xd663('0x26')](_0x3f5bc3,function(_0xa6f36e,_0x26b244){var _0x58783d=_[_0xd663('0x2b')](_0xa6f36e[_0xd663('0x2c')])?util[_0xd663('0x28')](_0xd663('0x29'),_0xa6f36e[_0xd663('0x2a')]):_0xa6f36e['interface'];return _0x58783d;});for(var _0x153983 in _0x23de78){if(_0x23de78[_0xd663('0x27')](_0x153983)){if(!_0x35efb3[_0x153983]){delete _0x23de78[_0x153983];}}}}function clearVoiceCallReports(_0x41386f){_0x41386f['total']=0x0;_0x41386f['answered']=0x0;_0x41386f[_0xd663('0x2d')]=0x0;_0x41386f['sumDuration']=0x0;_0x41386f[_0xd663('0x2e')]=0x0;}function clearCampaigns(_0x13f952){if(!_['isEmpty'](_0x13f952)){for(var _0x1fc6d4 in _0x13f952){if(_0x13f952[_0xd663('0x27')](_0x1fc6d4)){_0x13f952[_0x1fc6d4][_0xd663('0x2f')]=0x0;_0x13f952[_0x1fc6d4][_0xd663('0x30')]=0x0;}}}}function clearVoiceQueues(_0x16fcda){if(!_[_0xd663('0x31')](_0x16fcda)){for(var _0xb9a16e in _0x16fcda){if(_0x16fcda[_0xd663('0x27')](_0xb9a16e)){_0x16fcda[_0xb9a16e][_0xd663('0x32')]=0x0;_0x16fcda[_0xb9a16e]['answered']=0x0;_0x16fcda[_0xb9a16e][_0xd663('0x33')]=0x0;_0x16fcda[_0xb9a16e][_0xd663('0x34')]=0x0;_0x16fcda[_0xb9a16e]['sumHoldTime']=0x0;_0x16fcda[_0xb9a16e][_0xd663('0x35')]=0x0;_0x16fcda[_0xb9a16e][_0xd663('0x2e')]=0x0;_0x16fcda[_0xb9a16e]['outboundAnswerAgiCallsDay']=0x0;_0x16fcda[_0xb9a16e]['outboundNoAnswerCallsDay']=0x0;_0x16fcda[_0xb9a16e][_0xd663('0x36')]=0x0;_0x16fcda[_0xb9a16e]['outboundCongestionCallsDay']=0x0;_0x16fcda[_0xb9a16e][_0xd663('0x37')]=0x0;_0x16fcda[_0xb9a16e]['outboundUnknownCallsDay']=0x0;_0x16fcda[_0xb9a16e][_0xd663('0x38')]=0x0;_0x16fcda[_0xb9a16e][_0xd663('0x39')]=0x0;_0x16fcda[_0xb9a16e]['outboundBlacklistCallsDay']=0x0;_0x16fcda[_0xb9a16e][_0xd663('0x3a')]=0x0;_0x16fcda[_0xb9a16e][_0xd663('0x3b')]=0x0;_0x16fcda[_0xb9a16e][_0xd663('0x3c')]=0x0;_0x16fcda[_0xb9a16e][_0xd663('0x3d')]=0x0;_0x16fcda[_0xb9a16e][_0xd663('0x3e')]=0x0;_0x16fcda[_0xb9a16e][_0xd663('0x3f')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x2ac6e7,_0x3245fd){for(var _0x13ad10 in _0x3245fd){if(_0x2ac6e7[_0xd663('0x27')](_0x13ad10)){_0x2ac6e7[_0x13ad10]=_0x3245fd[_0x13ad10];}}};Realtime[_0xd663('0x40')][_0xd663('0x41')]=function(){var _0x421fdd=this;return function(_0x3aa045){if(_0x3aa045){freeIsNotKeyAgent(_0x3aa045,_0x421fdd[_0xd663('0x15')]);for(var _0x4d35a8=0x0,_0x17a83f={},_0x1b973c={};_0x4d35a8<_0x3aa045[_0xd663('0x42')];_0x4d35a8+=0x1){_0x17a83f=_0x3aa045[_0x4d35a8];var _0x1ada53=_[_0xd663('0x2b')](_0x17a83f['interface'])?util[_0xd663('0x28')]('SIP/%s',_0x17a83f[_0xd663('0x2a')]):_0x17a83f[_0xd663('0x2c')];if(_['isUndefined'](_0x421fdd[_0xd663('0x15')][_0x1ada53])){_0x421fdd[_0xd663('0x15')][_0x1ada53]=new Agent(_0x17a83f);}else{_0x421fdd[_0xd663('0x43')](_0x421fdd[_0xd663('0x15')][_0x1ada53],_0x17a83f);}}}return _0x421fdd[_0xd663('0x15')];};};Realtime[_0xd663('0x40')][_0xd663('0x44')]=function(){var _0x1b52d1=this;return function(_0x1efae3){if(_0x1efae3){freeIsNotKeySip(_0x1efae3,_0x1b52d1['telephones']);for(var _0x29785f=0x0,_0x35bfad={},_0x2ad2dc={};_0x29785f<_0x1efae3[_0xd663('0x42')];_0x29785f+=0x1){_0x35bfad=_0x1efae3[_0x29785f];if(_[_0xd663('0x45')](_0x1b52d1[_0xd663('0x46')][util[_0xd663('0x28')](_0xd663('0x29'),_0x35bfad[_0xd663('0x2a')])])){_0x1b52d1[_0xd663('0x46')][util[_0xd663('0x28')](_0xd663('0x29'),_0x35bfad[_0xd663('0x2a')])]=new Telephone(_0x35bfad);}else{_0x1b52d1[_0xd663('0x43')](_0x1b52d1[_0xd663('0x46')][util[_0xd663('0x28')](_0xd663('0x29'),_0x35bfad[_0xd663('0x2a')])],_0x35bfad);}}}return _0x1b52d1[_0xd663('0x46')];};};Realtime[_0xd663('0x40')][_0xd663('0x47')]=function(){var _0x2919e4=this;return function(_0x59cd76){if(_0x59cd76){freeIsNotKeySip(_0x59cd76,_0x2919e4[_0xd663('0x48')]);for(var _0x8c357f=0x0,_0x22c331={},_0x1dbd9a={};_0x8c357f<_0x59cd76[_0xd663('0x42')];_0x8c357f+=0x1){_0x22c331=_0x59cd76[_0x8c357f];if(_[_0xd663('0x45')](_0x2919e4[_0xd663('0x48')][util['format'](_0xd663('0x29'),_0x22c331[_0xd663('0x2a')])])){_0x2919e4[_0xd663('0x48')][util[_0xd663('0x28')]('SIP/%s',_0x22c331[_0xd663('0x2a')])]=new Trunk(_0x22c331);}else{_0x2919e4[_0xd663('0x43')](_0x2919e4['trunks'][util[_0xd663('0x28')]('SIP/%s',_0x22c331[_0xd663('0x2a')])],_0x22c331);}}}return _0x2919e4[_0xd663('0x48')];};};Realtime[_0xd663('0x40')][_0xd663('0x49')]=function(){var _0x2704f2=this;return function(_0x48fca2){if(_0x48fca2){freeIsNotKey(_0x48fca2,_0x2704f2['voiceQueues'],'name');for(var _0x2fea82=0x0,_0x14cf25={},_0x4ee3de={};_0x2fea82<_0x48fca2[_0xd663('0x42')];_0x2fea82+=0x1){_0x14cf25=_0x48fca2[_0x2fea82];if(_['isUndefined'](_0x2704f2[_0xd663('0x16')][_0x14cf25[_0xd663('0x2a')]])){_0x2704f2[_0xd663('0x16')][_0x14cf25['name']]=new VoiceQueue(_0x14cf25);}else{_0x2704f2[_0xd663('0x43')](_0x2704f2[_0xd663('0x16')][_0x14cf25['name']],_0x14cf25);}}}return _0x2704f2[_0xd663('0x16')];};};Realtime[_0xd663('0x40')][_0xd663('0x4a')]=function(){var _0x1766bb=this;return function(_0x3a5f86){if(_0x3a5f86){freeIsNotKey(_0x3a5f86,_0x1766bb[_0xd663('0x17')],'id');for(var _0x445304=0x0,_0x58605f={},_0x2d3e62={};_0x445304<_0x3a5f86[_0xd663('0x42')];_0x445304+=0x1){_0x58605f=_0x3a5f86[_0x445304];if(_[_0xd663('0x45')](_0x1766bb['triggers'][_0x58605f['id']])){_0x1766bb[_0xd663('0x17')][_0x58605f['id']]=new Trigger(_0x58605f);}else{_0x1766bb[_0xd663('0x43')](_0x1766bb['triggers'][_0x58605f['id']],_0x58605f);}}}return _0x1766bb[_0xd663('0x17')];};};Realtime[_0xd663('0x40')][_0xd663('0x4b')]=function(){var _0x181a72=this;return function(_0x18eeb8){if(_0x18eeb8){freeIsNotKey(_0x18eeb8,_0x181a72[_0xd663('0x18')],'id');for(var _0x2574da=0x0,_0x465d12={},_0x5e04b1={};_0x2574da<_0x18eeb8[_0xd663('0x42')];_0x2574da+=0x1){_0x465d12=_0x18eeb8[_0x2574da];if(_['isUndefined'](_0x181a72[_0xd663('0x18')][_0x465d12['id']])){_0x181a72[_0xd663('0x18')][_0x465d12['id']]=new Template(_0x465d12);}else{_0x181a72['mergeFromDatabase'](_0x181a72[_0xd663('0x18')][_0x465d12['id']],_0x465d12);}}}return _0x181a72['templates'];};};Realtime[_0xd663('0x40')]['initZendeskAccounts']=function(){var _0x2ce34c=this;return function(_0x320cfa){if(_0x320cfa){freeIsNotKey(_0x320cfa,_0x2ce34c[_0xd663('0x4c')],'id');for(var _0x49361b=0x0,_0x160088={},_0x1bdb69={};_0x49361b<_0x320cfa['length'];_0x49361b+=0x1){_0x160088=_0x320cfa[_0x49361b];if(_[_0xd663('0x45')](_0x2ce34c['zendeskAccounts'][_0x160088['id']])){_0x2ce34c[_0xd663('0x4c')][_0x160088['id']]=new ZendeskAccount(_0x160088);}else{_0x2ce34c[_0xd663('0x43')](_0x2ce34c[_0xd663('0x4c')][_0x160088['id']],_0x160088);}}}return _0x2ce34c[_0xd663('0x4c')];};};Realtime['prototype'][_0xd663('0x4d')]=function(){var _0x23b2c4=this;return function(_0x2421aa){if(_0x2421aa){freeIsNotKey(_0x2421aa,_0x23b2c4['salesforceAccounts'],'id');for(var _0x129f1b=0x0,_0x44d42c={},_0xa57369={};_0x129f1b<_0x2421aa[_0xd663('0x42')];_0x129f1b+=0x1){_0x44d42c=_0x2421aa[_0x129f1b];if(_[_0xd663('0x45')](_0x23b2c4[_0xd663('0x1e')][_0x44d42c['id']])){_0x23b2c4[_0xd663('0x1e')][_0x44d42c['id']]=new SalesforceAccount(_0x44d42c);}else{_0x23b2c4[_0xd663('0x43')](_0x23b2c4[_0xd663('0x1e')][_0x44d42c['id']],_0x44d42c);}}}return _0x23b2c4[_0xd663('0x1e')];};};Realtime[_0xd663('0x40')][_0xd663('0x4e')]=function(){var _0xe01e1a=this;return function(_0x4b0a64){if(_0x4b0a64){freeIsNotKey(_0x4b0a64,_0xe01e1a[_0xd663('0x20')],'id');for(var _0xef869c=0x0,_0x4f1541={},_0x40c728={};_0xef869c<_0x4b0a64[_0xd663('0x42')];_0xef869c+=0x1){_0x4f1541=_0x4b0a64[_0xef869c];if(_['isUndefined'](_0xe01e1a[_0xd663('0x20')][_0x4f1541['id']])){_0xe01e1a[_0xd663('0x20')][_0x4f1541['id']]=new FreshdeskAccount(_0x4f1541);}else{_0xe01e1a['mergeFromDatabase'](_0xe01e1a[_0xd663('0x20')][_0x4f1541['id']],_0x4f1541);}}}return _0xe01e1a['freshdeskAccounts'];};};Realtime[_0xd663('0x40')][_0xd663('0x4f')]=function(){var _0xbeec86=this;return function(_0x14928a){if(_0x14928a){freeIsNotKey(_0x14928a,_0xbeec86['zohoAccounts'],'id');for(var _0x256c61=0x0,_0x2fa380={},_0x459b16={};_0x256c61<_0x14928a[_0xd663('0x42')];_0x256c61+=0x1){_0x2fa380=_0x14928a[_0x256c61];if(_['isUndefined'](_0xbeec86[_0xd663('0x50')][_0x2fa380['id']])){_0xbeec86[_0xd663('0x50')][_0x2fa380['id']]=new ZohoAccount(_0x2fa380);}else{_0xbeec86[_0xd663('0x43')](_0xbeec86['zohoAccounts'][_0x2fa380['id']],_0x2fa380);}}}return _0xbeec86[_0xd663('0x50')];};};Realtime['prototype'][_0xd663('0x51')]=function(){var _0x4e9f8b=this;return function(_0x22cb19){if(_0x22cb19){freeIsNotKey(_0x22cb19,_0x4e9f8b[_0xd663('0x52')],'id');for(var _0x273d75=0x0,_0x292d7e={},_0x4104f1={};_0x273d75<_0x22cb19[_0xd663('0x42')];_0x273d75+=0x1){_0x292d7e=_0x22cb19[_0x273d75];if(_['isUndefined'](_0x4e9f8b['deskAccounts'][_0x292d7e['id']])){_0x4e9f8b[_0xd663('0x52')][_0x292d7e['id']]=new DeskAccount(_0x292d7e);}else{_0x4e9f8b[_0xd663('0x43')](_0x4e9f8b[_0xd663('0x52')][_0x292d7e['id']],_0x292d7e);}}}return _0x4e9f8b[_0xd663('0x52')];};};Realtime[_0xd663('0x40')][_0xd663('0x53')]=function(){var _0x16dc7c=this;return function(_0x412a7b){if(_0x412a7b){freeIsNotKey(_0x412a7b,_0x16dc7c['sugarcrmAccounts'],'id');for(var _0x226f3c=0x0,_0x3441e7={},_0x2f110c={};_0x226f3c<_0x412a7b[_0xd663('0x42')];_0x226f3c+=0x1){_0x3441e7=_0x412a7b[_0x226f3c];if(_[_0xd663('0x45')](_0x16dc7c['sugarcrmAccounts'][_0x3441e7['id']])){_0x16dc7c[_0xd663('0x1f')][_0x3441e7['id']]=new SugarcrmAccount(_0x3441e7);}else{_0x16dc7c[_0xd663('0x43')](_0x16dc7c['sugarcrmAccounts'][_0x3441e7['id']],_0x3441e7);}}}return _0x16dc7c[_0xd663('0x1f')];};};Realtime[_0xd663('0x40')][_0xd663('0x54')]=function(){var _0x2b0139=this;return function(_0xb529fb){if(_0xb529fb){freeIsNotKey(_0xb529fb,_0x2b0139[_0xd663('0x21')],'id');for(var _0x3830e6=0x0,_0x22eade={},_0x24d08d={};_0x3830e6<_0xb529fb['length'];_0x3830e6+=0x1){_0x22eade=_0xb529fb[_0x3830e6];if(_[_0xd663('0x45')](_0x2b0139['vtigerAccounts'][_0x22eade['id']])){_0x2b0139[_0xd663('0x21')][_0x22eade['id']]=new VtigerAccount(_0x22eade);}else{_0x2b0139[_0xd663('0x43')](_0x2b0139['vtigerAccounts'][_0x22eade['id']],_0x22eade);}}}return _0x2b0139[_0xd663('0x21')];};};Realtime[_0xd663('0x40')][_0xd663('0x55')]=function(){var _0x45b17e=this;return function(_0x4f3596){if(_0x4f3596){freeIsNotKey(_0x4f3596,_0x45b17e[_0xd663('0x22')],'id');for(var _0x61fbf5=0x0,_0x301938={},_0x7b6074={};_0x61fbf5<_0x4f3596[_0xd663('0x42')];_0x61fbf5+=0x1){_0x301938=_0x4f3596[_0x61fbf5];if(_[_0xd663('0x45')](_0x45b17e[_0xd663('0x22')][_0x301938['id']])){_0x45b17e[_0xd663('0x22')][_0x301938['id']]=new ServicenowAccount(_0x301938);}else{_0x45b17e['mergeFromDatabase'](_0x45b17e[_0xd663('0x22')][_0x301938['id']],_0x301938);}}}return _0x45b17e['servicenowAccounts'];};};Realtime[_0xd663('0x40')][_0xd663('0x56')]=function(){var _0x17b6fd=this;return function(_0x5570c4){if(_0x5570c4){freeIsNotKey(_0x5570c4,_0x17b6fd[_0xd663('0x23')],'id');for(var _0x590a56=0x0,_0x330a07={},_0xa51636={};_0x590a56<_0x5570c4['length'];_0x590a56+=0x1){_0x330a07=_0x5570c4[_0x590a56];if(_[_0xd663('0x45')](_0x17b6fd['dynamics365Accounts'][_0x330a07['id']])){_0x17b6fd[_0xd663('0x23')][_0x330a07['id']]=new Dynamics365Account(_0x330a07);}else{_0x17b6fd['mergeFromDatabase'](_0x17b6fd[_0xd663('0x23')][_0x330a07['id']],_0x330a07);}}}return _0x17b6fd['dynamics365Accounts'];};};Realtime[_0xd663('0x40')][_0xd663('0x57')]=function(){var _0x55af6f=this;return function(_0x435f95){if(_0x435f95){freeIsNotKey(_0x435f95,_0x55af6f[_0xd663('0x24')],'id');for(var _0xdcc286=0x0,_0x25b82e={},_0x1f2dbb={};_0xdcc286<_0x435f95[_0xd663('0x42')];_0xdcc286+=0x1){_0x25b82e=_0x435f95[_0xdcc286];if(_['isUndefined'](_0x55af6f[_0xd663('0x24')][_0x25b82e['id']])){_0x55af6f[_0xd663('0x24')][_0x25b82e['id']]=new FreshsalesAccount(_0x25b82e);}else{_0x55af6f['mergeFromDatabase'](_0x55af6f['freshsalesAccounts'][_0x25b82e['id']],_0x25b82e);}}}return _0x55af6f[_0xd663('0x24')];};};Realtime[_0xd663('0x40')][_0xd663('0x58')]=function(){var _0x172fb6=this;return function(_0xd4ca33){for(var _0x386974=0x0;_0x386974<_0xd4ca33['length'];_0x386974+=0x1){_['merge'](_0x172fb6['voiceQueues'][_0xd4ca33[_0x386974]['name']],_0xd4ca33[_0x386974]);}return _0x172fb6[_0xd663('0x16')];};};Realtime[_0xd663('0x40')][_0xd663('0x59')]=function(){var _0x4588ba=this;return function(_0x34b97d){clearVoiceQueues(_0x4588ba['voiceQueues']);if(_0x34b97d){_0x34b97d=_[_0xd663('0x5a')](_0x34b97d,_0xd663('0x5b'));for(var _0x594b29 in _0x34b97d){if(_0x34b97d[_0xd663('0x27')](_0x594b29)){var _0x1fb4af={};for(var _0xc45934=0x0;_0xc45934<_0x34b97d[_0x594b29][_0xd663('0x42')];_0xc45934+=0x1){var _0x1c27ca=_0x34b97d[_0x594b29][_0xc45934][_0xd663('0x5c')];if(_0x4588ba['voiceQueues'][_0x1c27ca]){if(_0x34b97d[_0x594b29][_0xc45934][_0xd663('0x5d')]){_0x4588ba[_0xd663('0x16')][_0x1c27ca]['unmanaged']+=0x1;}if(_0x34b97d[_0x594b29][_0xc45934][_0xd663('0x5e')]){_0x4588ba[_0xd663('0x16')][_0x1c27ca]['abandoned']+=0x1;}_0x4588ba[_0xd663('0x16')][_0x1c27ca][_0xd663('0x2d')]+=moment(_0x34b97d[_0x594b29][_0xc45934][_0xd663('0x5f')])['diff'](moment(_0x34b97d[_0x594b29][_0xc45934]['queuecallerjoinAt']),'seconds')||0x0;if(_0xc45934===_0x34b97d[_0x594b29][_0xd663('0x42')]-0x1){_0x4588ba['voiceQueues'][_0x1c27ca][_0xd663('0x35')]+=moment(_0x34b97d[_0x594b29][_0xc45934]['queuecallercompleteAt']||_0x34b97d[_0x594b29][_0xc45934][_0xd663('0x60')]||_0x34b97d[_0x594b29][_0xc45934][_0xd663('0x61')])[_0xd663('0x62')](moment(_0x34b97d[_0x594b29][_0xc45934]['queuecallerjoinAt']),'seconds')||0x0;_0x4588ba[_0xd663('0x16')][_0x1c27ca][_0xd663('0x32')]+=0x1;if(_0x34b97d[_0x594b29][_0xc45934][_0xd663('0x63')]){_0x4588ba[_0xd663('0x16')][_0x1c27ca][_0xd663('0x64')]+=0x1;_0x4588ba[_0xd663('0x16')][_0x1c27ca][_0xd663('0x2e')]+=moment(_0x34b97d[_0x594b29][_0xc45934][_0xd663('0x65')])['diff'](moment(_0x34b97d[_0x594b29][_0xc45934][_0xd663('0x5f')]),'seconds')||0x0;}}else{_0x4588ba[_0xd663('0x16')][_0x1c27ca][_0xd663('0x35')]+=_0x4588ba[_0xd663('0x16')][_0x1c27ca][_0xd663('0x2d')]||0x0;}}}}}}return _0x4588ba[_0xd663('0x16')];};};Realtime[_0xd663('0x40')][_0xd663('0x66')]=function(){var _0x1789e4=this;return function(_0x521684){clearVoiceCallReports(_0x1789e4[_0xd663('0x19')]);if(_0x521684){for(var _0x57cc57=0x0;_0x57cc57<_0x521684[_0xd663('0x42')];_0x57cc57+=0x1){_0x1789e4[_0xd663('0x19')]['total']+=0x1;_0x1789e4[_0xd663('0x19')]['sumDuration']+=_0x521684[_0x57cc57][_0xd663('0x67')];if(_0x521684[_0x57cc57]['disposition']===_0xd663('0x68')){_0x1789e4[_0xd663('0x19')][_0xd663('0x64')]+=0x1;_0x1789e4[_0xd663('0x19')][_0xd663('0x2d')]+=_0x521684[_0x57cc57][_0xd663('0x67')]-_0x521684[_0x57cc57][_0xd663('0x69')]||0x0;_0x1789e4[_0xd663('0x19')][_0xd663('0x2e')]+=_0x521684[_0x57cc57]['billableseconds'];}}}return _0x1789e4[_0xd663('0x19')];};};Realtime[_0xd663('0x40')][_0xd663('0x6a')]=function(){var _0x16ec0f=this;return function(_0x448204){if(_0x448204){freeIsNotKey(_0x448204,_0x16ec0f['campaigns'],_0xd663('0x2a'));for(var _0x176da2=0x0,_0x23a4dd={};_0x176da2<_0x448204[_0xd663('0x42')];_0x176da2+=0x1){_0x23a4dd=_0x448204[_0x176da2];if(_[_0xd663('0x45')](_0x16ec0f[_0xd663('0x6b')][_0x23a4dd[_0xd663('0x2a')]])){_0x16ec0f['campaigns'][_0x23a4dd['name']]=new Campaign(_0x23a4dd);}else{_0x16ec0f['mergeFromDatabase'](_0x16ec0f[_0xd663('0x6b')][_0x23a4dd[_0xd663('0x2a')]],_0x23a4dd);_0x16ec0f[_0xd663('0x6b')][_0x23a4dd[_0xd663('0x2a')]][_0xd663('0x6c')]=_0x23a4dd[_0xd663('0x6d')]?_0x23a4dd[_0xd663('0x6d')]['name']:undefined;}}}return _0x16ec0f[_0xd663('0x6b')];};};Realtime[_0xd663('0x40')]['initVoiceExtensions']=function(){var _0x3709d3=this;return function(_0xef0fed){if(_0xef0fed){freeIsNotKey(_0xef0fed,_0x3709d3[_0xd663('0x1a')],'id');for(var _0x448815=0x0,_0x393667={};_0x448815<_0xef0fed[_0xd663('0x42')];_0x448815+=0x1){_0x393667=_0xef0fed[_0x448815];if(_['isUndefined'](_0x3709d3[_0xd663('0x1a')][_0x393667['id']])){_0x3709d3['voiceExtensions'][_0x393667['id']]=new VoiceExtension(_0x393667);}else{_0x3709d3['mergeFromDatabase'](_0x3709d3[_0xd663('0x1a')][_0x393667['id']],_0x393667);}}}return _0x3709d3[_0xd663('0x1a')];};};Realtime[_0xd663('0x40')]['initCampaignHopperHistory']=function(){var _0x2b1cd8=this;return function(_0x53402a){clearCampaigns(_0x2b1cd8[_0xd663('0x6b')]);for(var _0x271b8a=0x0;_0x271b8a<_0x53402a[_0xd663('0x42')];_0x271b8a+=0x1){_['merge'](_0x2b1cd8[_0xd663('0x6b')][_0x53402a[_0x271b8a][_0xd663('0x2a')]],_0x53402a[_0x271b8a]);}return _0x2b1cd8[_0xd663('0x6b')];};};Realtime[_0xd663('0x40')]['initFaxAccounts']=function(){var _0x1999e2=this;return function(_0x5dce95){if(_0x5dce95){freeIsNotKey(_0x5dce95,_0x1999e2[_0xd663('0x25')],'id');for(var _0x208c8e=0x0,_0x4f6ca4={},_0x12136e={};_0x208c8e<_0x5dce95[_0xd663('0x42')];_0x208c8e+=0x1){_0x4f6ca4=_0x5dce95[_0x208c8e];if(_[_0xd663('0x45')](_0x1999e2[_0xd663('0x25')][_0x4f6ca4['id']])){_0x1999e2[_0xd663('0x25')][_0x4f6ca4['id']]=new FaxAccount(_0x4f6ca4);}else{_0x1999e2[_0xd663('0x43')](_0x1999e2[_0xd663('0x25')][_0x4f6ca4['id']],_0x4f6ca4);}}}return _0x1999e2[_0xd663('0x25')];};};module[_0xd663('0x6e')]=Realtime; \ No newline at end of file +var _0xc114=['triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','length','isUndefined','initTelephones','initTrunks','voiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','uniqueid','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','duration','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','faxAccounts','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks'];(function(_0x275e09,_0x494088){var _0x2c731b=function(_0x572c33){while(--_0x572c33){_0x275e09['push'](_0x275e09['shift']());}};_0x2c731b(++_0x494088);}(_0xc114,0xc3));var _0x4c11=function(_0x1205c6,_0xf84137){_0x1205c6=_0x1205c6-0x0;var _0x5b6dea=_0xc114[_0x1205c6];return _0x5b6dea;};'use strict';var BPromise=require(_0x4c11('0x0'));var util=require(_0x4c11('0x1'));var _=require(_0x4c11('0x2'));var moment=require(_0x4c11('0x3'));var Agent=require(_0x4c11('0x4'));var Telephone=require(_0x4c11('0x5'));var Trunk=require(_0x4c11('0x6'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x4c11('0x7'));var Template=require('../model/template');var Campaign=require(_0x4c11('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x4c11('0x9'));var SalesforceAccount=require(_0x4c11('0xa'));var FreshdeskAccount=require(_0x4c11('0xb'));var SugarcrmAccount=require(_0x4c11('0xc'));var ZohoAccount=require(_0x4c11('0xd'));var DeskAccount=require(_0x4c11('0xe'));var VtigerAccount=require(_0x4c11('0xf'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x4c11('0x10'));var FaxAccount=require(_0x4c11('0x11'));var Realtime=function(){this[_0x4c11('0x12')]={};this[_0x4c11('0x13')]={};this[_0x4c11('0x14')]={};this['voiceQueues']={};this[_0x4c11('0x15')]={};this[_0x4c11('0x16')]={};this[_0x4c11('0x17')]={};this[_0x4c11('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x4c11('0x19')]={};this[_0x4c11('0x1a')]={};this[_0x4c11('0x1b')]={};this[_0x4c11('0x1c')]={};this[_0x4c11('0x1d')]={};this[_0x4c11('0x1e')]={};this[_0x4c11('0x1f')]={};this[_0x4c11('0x20')]={};this['sugarcrmAccounts']={};this[_0x4c11('0x21')]={};this[_0x4c11('0x22')]={};this[_0x4c11('0x23')]={};this[_0x4c11('0x24')]={};this[_0x4c11('0x25')]={};this[_0x4c11('0x26')]={};this[_0x4c11('0x27')]={};this['faxAccounts']={};};function freeIsNotKey(_0xcf1073,_0x5212ec,_0x2172e3){var _0x38cfdc=_[_0x4c11('0x28')](_0xcf1073,function(_0x3358e0,_0x2205d5){return _0x3358e0[_0x2172e3];});for(var _0x1dc2f2 in _0x5212ec){if(_0x5212ec[_0x4c11('0x29')](_0x1dc2f2)){if(!_0x38cfdc[_0x1dc2f2]){delete _0x5212ec[_0x1dc2f2];}}}}function freeIsNotKeySip(_0x5b24e9,_0x1ec213){var _0x3faea7=_[_0x4c11('0x28')](_0x5b24e9,function(_0x9c5634,_0x39f3f7){return util[_0x4c11('0x2a')](_0x4c11('0x2b'),_0x9c5634[_0x4c11('0x2c')]);});for(var _0x27a84e in _0x1ec213){if(_0x1ec213[_0x4c11('0x29')](_0x27a84e)){if(!_0x3faea7[_0x27a84e]){delete _0x1ec213[_0x27a84e];}}}}function freeIsNotKeyAgent(_0x414346,_0x4ee1c0){var _0x14901e=_[_0x4c11('0x28')](_0x414346,function(_0x374d9c,_0x29ad6b){var _0x1ddc36=_[_0x4c11('0x2d')](_0x374d9c[_0x4c11('0x2e')])?util[_0x4c11('0x2a')](_0x4c11('0x2b'),_0x374d9c[_0x4c11('0x2c')]):_0x374d9c[_0x4c11('0x2e')];return _0x1ddc36;});for(var _0x432b48 in _0x4ee1c0){if(_0x4ee1c0['hasOwnProperty'](_0x432b48)){if(!_0x14901e[_0x432b48]){delete _0x4ee1c0[_0x432b48];}}}}function clearVoiceCallReports(_0x5172eb){_0x5172eb[_0x4c11('0x2f')]=0x0;_0x5172eb[_0x4c11('0x30')]=0x0;_0x5172eb[_0x4c11('0x31')]=0x0;_0x5172eb['sumDuration']=0x0;_0x5172eb[_0x4c11('0x32')]=0x0;}function clearCampaigns(_0x7aba0d){if(!_[_0x4c11('0x33')](_0x7aba0d)){for(var _0x424336 in _0x7aba0d){if(_0x7aba0d['hasOwnProperty'](_0x424336)){_0x7aba0d[_0x424336][_0x4c11('0x34')]=0x0;_0x7aba0d[_0x424336]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x16c1d7){if(!_[_0x4c11('0x33')](_0x16c1d7)){for(var _0x5ac7c1 in _0x16c1d7){if(_0x16c1d7[_0x4c11('0x29')](_0x5ac7c1)){_0x16c1d7[_0x5ac7c1][_0x4c11('0x2f')]=0x0;_0x16c1d7[_0x5ac7c1]['answered']=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x35')]=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x36')]=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x31')]=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x37')]=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x32')]=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x38')]=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x39')]=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x3a')]=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x3b')]=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x3c')]=0x0;_0x16c1d7[_0x5ac7c1]['outboundUnknownCallsDay']=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x3d')]=0x0;_0x16c1d7[_0x5ac7c1]['outboundDropCallsDayCallersExit']=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x3e')]=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x3f')]=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x40')]=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x41')]=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x38')]=0x0;_0x16c1d7[_0x5ac7c1][_0x4c11('0x42')]=0x0;_0x16c1d7[_0x5ac7c1]['queueStatusComplete']=!![];}}}}Realtime[_0x4c11('0x43')][_0x4c11('0x44')]=function(_0x6ffee7,_0x1ab9a0){for(var _0xc26a5f in _0x1ab9a0){if(_0x6ffee7[_0x4c11('0x29')](_0xc26a5f)){_0x6ffee7[_0xc26a5f]=_0x1ab9a0[_0xc26a5f];}}};Realtime[_0x4c11('0x43')]['initAgents']=function(){var _0x2e342f=this;return function(_0x3603e3){if(_0x3603e3){freeIsNotKeyAgent(_0x3603e3,_0x2e342f[_0x4c11('0x12')]);for(var _0x2e3936=0x0,_0x376f49={},_0x3f864c={};_0x2e3936<_0x3603e3[_0x4c11('0x45')];_0x2e3936+=0x1){_0x376f49=_0x3603e3[_0x2e3936];var _0xc0a980=_['isNil'](_0x376f49[_0x4c11('0x2e')])?util[_0x4c11('0x2a')](_0x4c11('0x2b'),_0x376f49[_0x4c11('0x2c')]):_0x376f49['interface'];if(_[_0x4c11('0x46')](_0x2e342f['agents'][_0xc0a980])){_0x2e342f[_0x4c11('0x12')][_0xc0a980]=new Agent(_0x376f49);}else{_0x2e342f[_0x4c11('0x44')](_0x2e342f['agents'][_0xc0a980],_0x376f49);}}}return _0x2e342f[_0x4c11('0x12')];};};Realtime[_0x4c11('0x43')][_0x4c11('0x47')]=function(){var _0x25d605=this;return function(_0x4644ae){if(_0x4644ae){freeIsNotKeySip(_0x4644ae,_0x25d605[_0x4c11('0x13')]);for(var _0x407af4=0x0,_0x3b7b3d={},_0x1a06e4={};_0x407af4<_0x4644ae['length'];_0x407af4+=0x1){_0x3b7b3d=_0x4644ae[_0x407af4];if(_[_0x4c11('0x46')](_0x25d605[_0x4c11('0x13')][util['format']('SIP/%s',_0x3b7b3d[_0x4c11('0x2c')])])){_0x25d605['telephones'][util[_0x4c11('0x2a')](_0x4c11('0x2b'),_0x3b7b3d[_0x4c11('0x2c')])]=new Telephone(_0x3b7b3d);}else{_0x25d605[_0x4c11('0x44')](_0x25d605[_0x4c11('0x13')][util[_0x4c11('0x2a')](_0x4c11('0x2b'),_0x3b7b3d[_0x4c11('0x2c')])],_0x3b7b3d);}}}return _0x25d605[_0x4c11('0x13')];};};Realtime[_0x4c11('0x43')][_0x4c11('0x48')]=function(){var _0x7d6376=this;return function(_0x201d6a){if(_0x201d6a){freeIsNotKeySip(_0x201d6a,_0x7d6376[_0x4c11('0x14')]);for(var _0x157d97=0x0,_0x1feb9e={},_0x37a390={};_0x157d97<_0x201d6a['length'];_0x157d97+=0x1){_0x1feb9e=_0x201d6a[_0x157d97];if(_['isUndefined'](_0x7d6376[_0x4c11('0x14')][util[_0x4c11('0x2a')](_0x4c11('0x2b'),_0x1feb9e[_0x4c11('0x2c')])])){_0x7d6376['trunks'][util['format']('SIP/%s',_0x1feb9e[_0x4c11('0x2c')])]=new Trunk(_0x1feb9e);}else{_0x7d6376[_0x4c11('0x44')](_0x7d6376[_0x4c11('0x14')][util[_0x4c11('0x2a')]('SIP/%s',_0x1feb9e['name'])],_0x1feb9e);}}}return _0x7d6376[_0x4c11('0x14')];};};Realtime[_0x4c11('0x43')]['initVoiceQueues']=function(){var _0x3fb497=this;return function(_0x4972f6){if(_0x4972f6){freeIsNotKey(_0x4972f6,_0x3fb497[_0x4c11('0x49')],_0x4c11('0x2c'));for(var _0x375a25=0x0,_0xefbc21={},_0x41cdce={};_0x375a25<_0x4972f6[_0x4c11('0x45')];_0x375a25+=0x1){_0xefbc21=_0x4972f6[_0x375a25];if(_['isUndefined'](_0x3fb497[_0x4c11('0x49')][_0xefbc21[_0x4c11('0x2c')]])){_0x3fb497[_0x4c11('0x49')][_0xefbc21['name']]=new VoiceQueue(_0xefbc21);}else{_0x3fb497['mergeFromDatabase'](_0x3fb497[_0x4c11('0x49')][_0xefbc21[_0x4c11('0x2c')]],_0xefbc21);}}}return _0x3fb497[_0x4c11('0x49')];};};Realtime[_0x4c11('0x43')][_0x4c11('0x4a')]=function(){var _0x2409fb=this;return function(_0x401960){if(_0x401960){freeIsNotKey(_0x401960,_0x2409fb[_0x4c11('0x15')],'id');for(var _0x2308cc=0x0,_0x219ffa={},_0x534633={};_0x2308cc<_0x401960[_0x4c11('0x45')];_0x2308cc+=0x1){_0x219ffa=_0x401960[_0x2308cc];if(_[_0x4c11('0x46')](_0x2409fb['triggers'][_0x219ffa['id']])){_0x2409fb[_0x4c11('0x15')][_0x219ffa['id']]=new Trigger(_0x219ffa);}else{_0x2409fb[_0x4c11('0x44')](_0x2409fb[_0x4c11('0x15')][_0x219ffa['id']],_0x219ffa);}}}return _0x2409fb[_0x4c11('0x15')];};};Realtime[_0x4c11('0x43')][_0x4c11('0x4b')]=function(){var _0x1c0e0f=this;return function(_0x60fc50){if(_0x60fc50){freeIsNotKey(_0x60fc50,_0x1c0e0f['templates'],'id');for(var _0x4c02ec=0x0,_0x1bb5ad={},_0x24c4b8={};_0x4c02ec<_0x60fc50['length'];_0x4c02ec+=0x1){_0x1bb5ad=_0x60fc50[_0x4c02ec];if(_['isUndefined'](_0x1c0e0f['templates'][_0x1bb5ad['id']])){_0x1c0e0f[_0x4c11('0x17')][_0x1bb5ad['id']]=new Template(_0x1bb5ad);}else{_0x1c0e0f['mergeFromDatabase'](_0x1c0e0f[_0x4c11('0x17')][_0x1bb5ad['id']],_0x1bb5ad);}}}return _0x1c0e0f['templates'];};};Realtime[_0x4c11('0x43')][_0x4c11('0x4c')]=function(){var _0x30f624=this;return function(_0xd0b7f){if(_0xd0b7f){freeIsNotKey(_0xd0b7f,_0x30f624[_0x4c11('0x1f')],'id');for(var _0x5d973d=0x0,_0x32d54d={},_0xafbd61={};_0x5d973d<_0xd0b7f[_0x4c11('0x45')];_0x5d973d+=0x1){_0x32d54d=_0xd0b7f[_0x5d973d];if(_[_0x4c11('0x46')](_0x30f624['zendeskAccounts'][_0x32d54d['id']])){_0x30f624[_0x4c11('0x1f')][_0x32d54d['id']]=new ZendeskAccount(_0x32d54d);}else{_0x30f624[_0x4c11('0x44')](_0x30f624['zendeskAccounts'][_0x32d54d['id']],_0x32d54d);}}}return _0x30f624[_0x4c11('0x1f')];};};Realtime[_0x4c11('0x43')][_0x4c11('0x4d')]=function(){var _0x65b2cd=this;return function(_0x22b74a){if(_0x22b74a){freeIsNotKey(_0x22b74a,_0x65b2cd['salesforceAccounts'],'id');for(var _0x3f3191=0x0,_0x24f841={},_0x560ed2={};_0x3f3191<_0x22b74a[_0x4c11('0x45')];_0x3f3191+=0x1){_0x24f841=_0x22b74a[_0x3f3191];if(_[_0x4c11('0x46')](_0x65b2cd[_0x4c11('0x20')][_0x24f841['id']])){_0x65b2cd[_0x4c11('0x20')][_0x24f841['id']]=new SalesforceAccount(_0x24f841);}else{_0x65b2cd[_0x4c11('0x44')](_0x65b2cd[_0x4c11('0x20')][_0x24f841['id']],_0x24f841);}}}return _0x65b2cd[_0x4c11('0x20')];};};Realtime['prototype'][_0x4c11('0x4e')]=function(){var _0x184fdb=this;return function(_0x1bdb20){if(_0x1bdb20){freeIsNotKey(_0x1bdb20,_0x184fdb[_0x4c11('0x21')],'id');for(var _0x1308b4=0x0,_0x40c3c5={},_0x28240e={};_0x1308b4<_0x1bdb20['length'];_0x1308b4+=0x1){_0x40c3c5=_0x1bdb20[_0x1308b4];if(_['isUndefined'](_0x184fdb['freshdeskAccounts'][_0x40c3c5['id']])){_0x184fdb[_0x4c11('0x21')][_0x40c3c5['id']]=new FreshdeskAccount(_0x40c3c5);}else{_0x184fdb[_0x4c11('0x44')](_0x184fdb[_0x4c11('0x21')][_0x40c3c5['id']],_0x40c3c5);}}}return _0x184fdb[_0x4c11('0x21')];};};Realtime[_0x4c11('0x43')][_0x4c11('0x4f')]=function(){var _0x5f0168=this;return function(_0x38964d){if(_0x38964d){freeIsNotKey(_0x38964d,_0x5f0168['zohoAccounts'],'id');for(var _0xf4dd9=0x0,_0x1aa6a4={},_0x595577={};_0xf4dd9<_0x38964d[_0x4c11('0x45')];_0xf4dd9+=0x1){_0x1aa6a4=_0x38964d[_0xf4dd9];if(_[_0x4c11('0x46')](_0x5f0168[_0x4c11('0x22')][_0x1aa6a4['id']])){_0x5f0168[_0x4c11('0x22')][_0x1aa6a4['id']]=new ZohoAccount(_0x1aa6a4);}else{_0x5f0168['mergeFromDatabase'](_0x5f0168[_0x4c11('0x22')][_0x1aa6a4['id']],_0x1aa6a4);}}}return _0x5f0168['zohoAccounts'];};};Realtime[_0x4c11('0x43')][_0x4c11('0x50')]=function(){var _0x348638=this;return function(_0x1b8e45){if(_0x1b8e45){freeIsNotKey(_0x1b8e45,_0x348638[_0x4c11('0x23')],'id');for(var _0x11f723=0x0,_0x7f9074={},_0x205a72={};_0x11f723<_0x1b8e45[_0x4c11('0x45')];_0x11f723+=0x1){_0x7f9074=_0x1b8e45[_0x11f723];if(_[_0x4c11('0x46')](_0x348638[_0x4c11('0x23')][_0x7f9074['id']])){_0x348638[_0x4c11('0x23')][_0x7f9074['id']]=new DeskAccount(_0x7f9074);}else{_0x348638[_0x4c11('0x44')](_0x348638[_0x4c11('0x23')][_0x7f9074['id']],_0x7f9074);}}}return _0x348638['deskAccounts'];};};Realtime[_0x4c11('0x43')][_0x4c11('0x51')]=function(){var _0x347b73=this;return function(_0x3a7d84){if(_0x3a7d84){freeIsNotKey(_0x3a7d84,_0x347b73['sugarcrmAccounts'],'id');for(var _0x2cbf45=0x0,_0x4d6143={},_0xb67931={};_0x2cbf45<_0x3a7d84[_0x4c11('0x45')];_0x2cbf45+=0x1){_0x4d6143=_0x3a7d84[_0x2cbf45];if(_[_0x4c11('0x46')](_0x347b73['sugarcrmAccounts'][_0x4d6143['id']])){_0x347b73[_0x4c11('0x52')][_0x4d6143['id']]=new SugarcrmAccount(_0x4d6143);}else{_0x347b73[_0x4c11('0x44')](_0x347b73[_0x4c11('0x52')][_0x4d6143['id']],_0x4d6143);}}}return _0x347b73[_0x4c11('0x52')];};};Realtime[_0x4c11('0x43')][_0x4c11('0x53')]=function(){var _0x15926b=this;return function(_0x727277){if(_0x727277){freeIsNotKey(_0x727277,_0x15926b[_0x4c11('0x24')],'id');for(var _0x8da409=0x0,_0x112551={},_0x40d5de={};_0x8da409<_0x727277[_0x4c11('0x45')];_0x8da409+=0x1){_0x112551=_0x727277[_0x8da409];if(_[_0x4c11('0x46')](_0x15926b[_0x4c11('0x24')][_0x112551['id']])){_0x15926b['vtigerAccounts'][_0x112551['id']]=new VtigerAccount(_0x112551);}else{_0x15926b[_0x4c11('0x44')](_0x15926b[_0x4c11('0x24')][_0x112551['id']],_0x112551);}}}return _0x15926b['vtigerAccounts'];};};Realtime[_0x4c11('0x43')][_0x4c11('0x54')]=function(){var _0x10f7d4=this;return function(_0x5d63b7){if(_0x5d63b7){freeIsNotKey(_0x5d63b7,_0x10f7d4[_0x4c11('0x25')],'id');for(var _0x118d5e=0x0,_0x1a4a5e={},_0x1999b8={};_0x118d5e<_0x5d63b7['length'];_0x118d5e+=0x1){_0x1a4a5e=_0x5d63b7[_0x118d5e];if(_[_0x4c11('0x46')](_0x10f7d4['servicenowAccounts'][_0x1a4a5e['id']])){_0x10f7d4['servicenowAccounts'][_0x1a4a5e['id']]=new ServicenowAccount(_0x1a4a5e);}else{_0x10f7d4[_0x4c11('0x44')](_0x10f7d4[_0x4c11('0x25')][_0x1a4a5e['id']],_0x1a4a5e);}}}return _0x10f7d4[_0x4c11('0x25')];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x5131d7=this;return function(_0x142e30){if(_0x142e30){freeIsNotKey(_0x142e30,_0x5131d7[_0x4c11('0x26')],'id');for(var _0x3818d5=0x0,_0x16dcc5={},_0x196a79={};_0x3818d5<_0x142e30[_0x4c11('0x45')];_0x3818d5+=0x1){_0x16dcc5=_0x142e30[_0x3818d5];if(_[_0x4c11('0x46')](_0x5131d7['dynamics365Accounts'][_0x16dcc5['id']])){_0x5131d7[_0x4c11('0x26')][_0x16dcc5['id']]=new Dynamics365Account(_0x16dcc5);}else{_0x5131d7['mergeFromDatabase'](_0x5131d7[_0x4c11('0x26')][_0x16dcc5['id']],_0x16dcc5);}}}return _0x5131d7['dynamics365Accounts'];};};Realtime[_0x4c11('0x43')][_0x4c11('0x55')]=function(){var _0x1108b7=this;return function(_0x1a3796){if(_0x1a3796){freeIsNotKey(_0x1a3796,_0x1108b7[_0x4c11('0x27')],'id');for(var _0x43dc59=0x0,_0x50b2bc={},_0x3b4a7b={};_0x43dc59<_0x1a3796[_0x4c11('0x45')];_0x43dc59+=0x1){_0x50b2bc=_0x1a3796[_0x43dc59];if(_[_0x4c11('0x46')](_0x1108b7['freshsalesAccounts'][_0x50b2bc['id']])){_0x1108b7[_0x4c11('0x27')][_0x50b2bc['id']]=new FreshsalesAccount(_0x50b2bc);}else{_0x1108b7['mergeFromDatabase'](_0x1108b7[_0x4c11('0x27')][_0x50b2bc['id']],_0x50b2bc);}}}return _0x1108b7['freshsalesAccounts'];};};Realtime[_0x4c11('0x43')][_0x4c11('0x56')]=function(){var _0x142ac6=this;return function(_0x4ac7a6){for(var _0x33d3f1=0x0;_0x33d3f1<_0x4ac7a6['length'];_0x33d3f1+=0x1){_[_0x4c11('0x57')](_0x142ac6['voiceQueues'][_0x4ac7a6[_0x33d3f1][_0x4c11('0x2c')]],_0x4ac7a6[_0x33d3f1]);}return _0x142ac6[_0x4c11('0x49')];};};Realtime[_0x4c11('0x43')]['initVoiceQueueReports']=function(){var _0x5ca4c6=this;return function(_0x42d356){clearVoiceQueues(_0x5ca4c6[_0x4c11('0x49')]);if(_0x42d356){_0x42d356=_['groupBy'](_0x42d356,_0x4c11('0x58'));for(var _0x44ac75 in _0x42d356){if(_0x42d356[_0x4c11('0x29')](_0x44ac75)){var _0x55505d={};for(var _0x49d40d=0x0;_0x49d40d<_0x42d356[_0x44ac75][_0x4c11('0x45')];_0x49d40d+=0x1){var _0x39b06a=_0x42d356[_0x44ac75][_0x49d40d]['queue'];if(_0x5ca4c6['voiceQueues'][_0x39b06a]){if(_0x42d356[_0x44ac75][_0x49d40d][_0x4c11('0x59')]){_0x5ca4c6[_0x4c11('0x49')][_0x39b06a][_0x4c11('0x35')]+=0x1;}if(_0x42d356[_0x44ac75][_0x49d40d][_0x4c11('0x5a')]){_0x5ca4c6[_0x4c11('0x49')][_0x39b06a]['abandoned']+=0x1;}_0x5ca4c6[_0x4c11('0x49')][_0x39b06a]['sumHoldTime']+=moment(_0x42d356[_0x44ac75][_0x49d40d][_0x4c11('0x5b')])[_0x4c11('0x5c')](moment(_0x42d356[_0x44ac75][_0x49d40d][_0x4c11('0x5d')]),_0x4c11('0x5e'))||0x0;if(_0x49d40d===_0x42d356[_0x44ac75][_0x4c11('0x45')]-0x1){_0x5ca4c6[_0x4c11('0x49')][_0x39b06a][_0x4c11('0x37')]+=moment(_0x42d356[_0x44ac75][_0x49d40d]['queuecallercompleteAt']||_0x42d356[_0x44ac75][_0x49d40d][_0x4c11('0x5f')]||_0x42d356[_0x44ac75][_0x49d40d]['queuecallerexitAt'])[_0x4c11('0x5c')](moment(_0x42d356[_0x44ac75][_0x49d40d][_0x4c11('0x5d')]),_0x4c11('0x5e'))||0x0;_0x5ca4c6['voiceQueues'][_0x39b06a][_0x4c11('0x2f')]+=0x1;if(_0x42d356[_0x44ac75][_0x49d40d][_0x4c11('0x60')]){_0x5ca4c6[_0x4c11('0x49')][_0x39b06a][_0x4c11('0x30')]+=0x1;_0x5ca4c6[_0x4c11('0x49')][_0x39b06a][_0x4c11('0x32')]+=moment(_0x42d356[_0x44ac75][_0x49d40d][_0x4c11('0x61')])[_0x4c11('0x5c')](moment(_0x42d356[_0x44ac75][_0x49d40d][_0x4c11('0x5b')]),_0x4c11('0x5e'))||0x0;}}else{_0x5ca4c6['voiceQueues'][_0x39b06a][_0x4c11('0x37')]+=_0x5ca4c6[_0x4c11('0x49')][_0x39b06a][_0x4c11('0x31')]||0x0;}}}}}}return _0x5ca4c6[_0x4c11('0x49')];};};Realtime[_0x4c11('0x43')][_0x4c11('0x62')]=function(){var _0x2b752f=this;return function(_0x13771c){clearVoiceCallReports(_0x2b752f['outbound']);if(_0x13771c){for(var _0x4b2412=0x0;_0x4b2412<_0x13771c[_0x4c11('0x45')];_0x4b2412+=0x1){_0x2b752f[_0x4c11('0x18')]['total']+=0x1;_0x2b752f[_0x4c11('0x18')][_0x4c11('0x37')]+=_0x13771c[_0x4b2412][_0x4c11('0x63')];if(_0x13771c[_0x4b2412][_0x4c11('0x64')]==='ANSWERED'){_0x2b752f['outbound']['answered']+=0x1;_0x2b752f[_0x4c11('0x18')]['sumHoldTime']+=_0x13771c[_0x4b2412]['duration']-_0x13771c[_0x4b2412]['billableseconds']||0x0;_0x2b752f['outbound'][_0x4c11('0x32')]+=_0x13771c[_0x4b2412][_0x4c11('0x65')];}}}return _0x2b752f['outbound'];};};Realtime[_0x4c11('0x43')][_0x4c11('0x66')]=function(){var _0x163cb9=this;return function(_0xcbe35e){if(_0xcbe35e){freeIsNotKey(_0xcbe35e,_0x163cb9[_0x4c11('0x16')],_0x4c11('0x2c'));for(var _0x3c653d=0x0,_0x348ce2={};_0x3c653d<_0xcbe35e[_0x4c11('0x45')];_0x3c653d+=0x1){_0x348ce2=_0xcbe35e[_0x3c653d];if(_[_0x4c11('0x46')](_0x163cb9['campaigns'][_0x348ce2[_0x4c11('0x2c')]])){_0x163cb9[_0x4c11('0x16')][_0x348ce2['name']]=new Campaign(_0x348ce2);}else{_0x163cb9[_0x4c11('0x44')](_0x163cb9[_0x4c11('0x16')][_0x348ce2[_0x4c11('0x2c')]],_0x348ce2);_0x163cb9[_0x4c11('0x16')][_0x348ce2[_0x4c11('0x2c')]][_0x4c11('0x67')]=_0x348ce2[_0x4c11('0x68')]?_0x348ce2[_0x4c11('0x68')][_0x4c11('0x2c')]:undefined;}}}return _0x163cb9[_0x4c11('0x16')];};};Realtime[_0x4c11('0x43')]['initVoiceExtensions']=function(){var _0x47029d=this;return function(_0x1ae52e){if(_0x1ae52e){freeIsNotKey(_0x1ae52e,_0x47029d['voiceExtensions'],'id');for(var _0x32df4a=0x0,_0xfca969={};_0x32df4a<_0x1ae52e['length'];_0x32df4a+=0x1){_0xfca969=_0x1ae52e[_0x32df4a];if(_[_0x4c11('0x46')](_0x47029d['voiceExtensions'][_0xfca969['id']])){_0x47029d['voiceExtensions'][_0xfca969['id']]=new VoiceExtension(_0xfca969);}else{_0x47029d[_0x4c11('0x44')](_0x47029d[_0x4c11('0x19')][_0xfca969['id']],_0xfca969);}}}return _0x47029d['voiceExtensions'];};};Realtime[_0x4c11('0x43')][_0x4c11('0x69')]=function(){var _0xfcb16d=this;return function(_0x311252){clearCampaigns(_0xfcb16d[_0x4c11('0x16')]);for(var _0x92950=0x0;_0x92950<_0x311252[_0x4c11('0x45')];_0x92950+=0x1){_[_0x4c11('0x57')](_0xfcb16d[_0x4c11('0x16')][_0x311252[_0x92950][_0x4c11('0x2c')]],_0x311252[_0x92950]);}return _0xfcb16d[_0x4c11('0x16')];};};Realtime[_0x4c11('0x43')][_0x4c11('0x6a')]=function(){var _0x4e60a8=this;return function(_0x2c34a8){if(_0x2c34a8){freeIsNotKey(_0x2c34a8,_0x4e60a8[_0x4c11('0x6b')],'id');for(var _0x4a3f0a=0x0,_0x41aa0f={},_0x599e01={};_0x4a3f0a<_0x2c34a8['length'];_0x4a3f0a+=0x1){_0x41aa0f=_0x2c34a8[_0x4a3f0a];if(_[_0x4c11('0x46')](_0x4e60a8[_0x4c11('0x6b')][_0x41aa0f['id']])){_0x4e60a8[_0x4c11('0x6b')][_0x41aa0f['id']]=new FaxAccount(_0x41aa0f);}else{_0x4e60a8[_0x4c11('0x44')](_0x4e60a8[_0x4c11('0x6b')][_0x41aa0f['id']],_0x41aa0f);}}}return _0x4e60a8[_0x4c11('0x6b')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 1caaf3d..2e5c5ba 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 _0x418e=['connectedlinenum','interface','SIP/%s','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','getAgentByInternal','keys','getCallType','channel','calleridnum','outbound','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','lastdata','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','linkedid','transfers','transfereelinkedid','uniqueid','UserId','split','membername','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','telephones','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','prototype','findAgent','find','name','isNil','accountcode','agents','format','length'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x418e,0x93));var _0xe418=function(_0x7ce7e4,_0x18374b){_0x7ce7e4=_0x7ce7e4-0x0;var _0x3eee0c=_0x418e[_0x7ce7e4];return _0x3eee0c;};'use strict';var _=require(_0xe418('0x0'));var moment=require(_0xe418('0x1'));var util=require(_0xe418('0x2'));var config=require(_0xe418('0x3'));var ami=require(_0xe418('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xe418('0x5'));var RpcMemberReport=require(_0xe418('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xe418('0x7'));var RpcVoiceTransferReport=require(_0xe418('0x8'));var VoiceQueueReport=require(_0xe418('0x9'));var VoiceCallReport=require(_0xe418('0xa'));var VoiceAgentReport=require(_0xe418('0xb'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xe418('0xc'));function Report(_0x49fae3){this[_0xe418('0xd')]=_0x49fae3;this['agents']=_0x49fae3['agents'];this[_0xe418('0xe')]=_0x49fae3[_0xe418('0xe')];}Report['prototype']['sync']=function(_0x581a2b){var _0x4dcf63=new VoiceQueueReport(this['realtime']);var _0x4b0a06=new VoiceAgentReport(this[_0xe418('0xd')]);var _0x227b24=new VoiceDialReport(this[_0xe418('0xd')]);var _0x50a4e0=new VoiceCallReport(this[_0xe418('0xd')]);var _0x377d2b=new UserReport(this[_0xe418('0xd')]);if(config['xdr']&&config[_0xe418('0xf')]['disabled']){ami['on'](_0xe418('0x10'),this[_0xe418('0x11')][_0xe418('0x12')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport']['bind'](this));ami['on'](_0xe418('0x13'),this[_0xe418('0x14')][_0xe418('0x12')](this));ami['on'](_0xe418('0x15'),this[_0xe418('0x16')][_0xe418('0x12')](this));ami['on'](_0xe418('0x17'),this[_0xe418('0x18')][_0xe418('0x12')](this));ami['on']('attendedtransfer',this[_0xe418('0x19')][_0xe418('0x12')](this));}};Report[_0xe418('0x1a')][_0xe418('0x1b')]=function(_0x556d8e){var _0x3e9b04;_0x3e9b04=_[_0xe418('0x1c')](this['agents'],function(_0x14a435){return _0x14a435['accountcode']==_0x556d8e||_0x14a435[_0xe418('0x1d')]==_0x556d8e;});if(_[_0xe418('0x1e')](_0x3e9b04)){var _0x36df7a=_['find'](this[_0xe418('0xe')],function(_0x2512fb){return _0x2512fb[_0xe418('0x1f')]==_0x556d8e||_0x2512fb[_0xe418('0x1d')]==_0x556d8e;});if(_0x36df7a){_0x3e9b04=_[_0xe418('0x1c')](this[_0xe418('0x20')],function(_0x193493){return _0x193493['interface']==util[_0xe418('0x21')]('SIP/%s',_0x36df7a[_0xe418('0x1d')]);});}}return _0x3e9b04;};Report[_0xe418('0x1a')]['voiceQueueReport']=function(_0x2b3d2e){for(var _0x9b9e26=0x0;_0x9b9e26<_0x2b3d2e[_0xe418('0x22')];_0x9b9e26+=0x1){var _0x4a5a09=this[_0xe418('0x1b')](_0x2b3d2e[_0x9b9e26][_0xe418('0x23')]);if(_0x4a5a09){_0x2b3d2e[_0x9b9e26]['accountcode']=_0x4a5a09['accountcode'];_0x2b3d2e[_0x9b9e26]['assigned']=!![];_0x2b3d2e[_0x9b9e26]['lastAssignedTo']=_0x4a5a09['name'];_0x2b3d2e[_0x9b9e26]['interface']=_[_0xe418('0x1e')](_0x4a5a09[_0xe418('0x24')])?util[_0xe418('0x21')](_0xe418('0x25'),_0x4a5a09[_0xe418('0x1d')]):_0x4a5a09[_0xe418('0x24')];if(_0x2b3d2e[_0x9b9e26][_0xe418('0x26')]){_0x2b3d2e[_0x9b9e26]['queuecallercompleteAt']=moment()[_0xe418('0x21')](_0xe418('0x27'));}if(_0x2b3d2e[_0x9b9e26][_0xe418('0x28')]){_0x2b3d2e[_0x9b9e26][_0xe418('0x29')]=moment()[_0xe418('0x21')](_0xe418('0x27'));}RpcMemberReport[_0xe418('0x11')](_0x2b3d2e[_0x9b9e26]);}RpcVoiceQueueReport[_0xe418('0x2a')](_0x2b3d2e[_0x9b9e26]);}};function extractCalleridNumber(_0x10befc){var _0x11f0b5=_0x10befc['match'](/<(.*?)>/);return _0x11f0b5?_0x11f0b5[0x1]:_0x10befc;}Report[_0xe418('0x1a')][_0xe418('0x2b')]=function(_0x226ab1){for(var _0x5ee167=0x0;_0x5ee167',_0x1f9952['calleridname'],_0x1f9952[_0xe418('0x2f')]);}if(RpcVoiceTransferReport['transfers'][_0x1f9952[_0xe418('0x42')]]){var _0x389484=RpcVoiceTransferReport[_0xe418('0x43')][_0x1f9952['linkedid']];_0x389484[_0xe418('0x44')]=_0x1f9952[_0xe418('0x45')];RpcVoiceTransferReport[_0xe418('0x18')](_0x389484);delete RpcVoiceTransferReport[_0xe418('0x43')][_0x1f9952[_0xe418('0x42')]];}if(_[_0xe418('0x1e')](_0x1f9952[_0xe418('0x34')])){_0x1f9952[_0xe418('0x34')]=this[_0xe418('0x2d')](_0x1f9952);}if(_[_0xe418('0x1e')](_0x1f9952[_0xe418('0x46')])){var _0x3ec36e=_0x1f9952[_0xe418('0x2e')][_0xe418('0x47')]('-')[0x0];var _0x1fa092=this['agents'][_0x3ec36e];if(!_0x1fa092)_0x1fa092=this[_0xe418('0x2b')](_0x1f9952[_0xe418('0x1f')]);if(_0x1fa092){_0x1f9952[_0xe418('0x46')]=_0x1fa092['id'];_0x1f9952[_0xe418('0x48')]=_0x1fa092[_0xe418('0x1d')];}}RpcVoiceCallReport[_0xe418('0x2a')](_0x1f9952);if(_0x1f9952[_0xe418('0x49')]){for(var _0x463296=0x0;_0x463296<_0x1f9952[_0xe418('0x4a')]['length'];_0x463296+=0x1){_0x1f9952[_0xe418('0x4b')]=_0x1f9952[_0xe418('0x4a')][_0x463296][_0xe418('0x4c')];_0x1f9952[_0xe418('0x4d')]=_0x1f9952[_0xe418('0x4a')][_0x463296][_0xe418('0x4d')];if(_0x1f9952[_0xe418('0x33')]==_0xe418('0x3c')){_0x1f9952[_0xe418('0x2f')]=_0x1f9952[_0xe418('0x23')];_0x1f9952[_0xe418('0x4e')]=_0x1f9952['connectedlinename'];_0x1f9952[_0xe418('0x23')]=_0x1f9952[_0xe418('0x1f')];_0x1f9952[_0xe418('0x4f')]=_0x1f9952[_0xe418('0x48')];_0x1f9952[_0xe418('0x33')]=_0x1f9952['originatecalleridnum'];}else if(_0x1f9952[_0xe418('0x33')]==_0xe418('0x50')){_0x1f9952[_0xe418('0x2f')]=_0x1f9952[_0xe418('0x32')];_0x1f9952['exten']=_0x1f9952[_0xe418('0x3e')];}RpcVoiceRecording['create'](_0x1f9952);}}};Report[_0xe418('0x1a')]['voiceAgentReport']=function(_0x221b8b){if(_[_0xe418('0x51')](_0x221b8b)){_0x221b8b[_0xe418('0x52')](function(_0xbf6b79){RpcVoiceAgentReport['create'](_0xbf6b79);});}else{RpcVoiceAgentReport[_0xe418('0x2a')](_0x221b8b);}};Report['prototype']['voiceDialReport']=function(_0x2bf651){RpcVoiceDialReport[_0xe418('0x2a')](_0x2bf651);var _0xf3e482;var _0x452b79;var _0x38656d=_0x2bf651[_0xe418('0x2e')];if(_[_0xe418('0x53')](_0x38656d,_0xe418('0x54'))){_0x452b79=_0x38656d[_0xe418('0x55')](_0x38656d[_0xe418('0x56')]('/')+0x1,_0x38656d[_0xe418('0x56')]('@'));_0xf3e482=_[_0xe418('0x1c')](this[_0xe418('0x20')],function(_0x1bdfcc){return _0x1bdfcc['mobile']==_0x452b79||_0x1bdfcc[_0xe418('0x57')]==_0x452b79||_0x1bdfcc[_0xe418('0x1f')]==_0x452b79;});}else{_0x452b79=_0x38656d[_0xe418('0x55')](_0x38656d[_0xe418('0x56')]('/')+0x1,_0x38656d[_0xe418('0x58')]('-'));_0xf3e482=this[_0xe418('0x1b')](_0x452b79);}if(_0xf3e482){_0x2bf651['interface']=_['isNil'](_0xf3e482[_0xe418('0x24')])?util[_0xe418('0x21')](_0xe418('0x25'),_0xf3e482[_0xe418('0x1d')]):_0xf3e482[_0xe418('0x24')];_0x2bf651[_0xe418('0x48')]=_0xf3e482[_0xe418('0x1d')];_0x2bf651[_0xe418('0x1f')]=_0xf3e482['accountcode'];RpcMemberReport[_0xe418('0x16')](_0x2bf651);}};Report[_0xe418('0x1a')][_0xe418('0x18')]=function(_0x4ef24c){RpcVoiceTransferReport['transfers'][_0x4ef24c[_0xe418('0x59')]]=_0x4ef24c;};Report['prototype']['attendedTransfer']=function(_0x62113){RpcVoiceTransferReport['attendedTransfer'](_0x62113);};module[_0xe418('0x5a')]=Report; \ No newline at end of file +var _0x3b70=['monitorFilename','filename','createdAt','connectedlinename','exten','xcally-motion-dialer','isArray','forEach','voiceDialReport','startsWith','indexOf','find','mobile','phone','substring','lastIndexOf','transfererlinkedid','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','bind','custom:voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','name','isNil','interface','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','format','create','match','getAgentByInternal','keys','getCallType','channel','calleridnum','voiceCallReport','destination','dialer','queue','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','type','split','UserId','membername','monitors'];(function(_0x25019f,_0x243013){var _0x3f0abd=function(_0x3a4984){while(--_0x3a4984){_0x25019f['push'](_0x25019f['shift']());}};_0x3f0abd(++_0x243013);}(_0x3b70,0x12b));var _0x03b7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3b70[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x03b7('0x0'));var moment=require(_0x03b7('0x1'));var util=require(_0x03b7('0x2'));var config=require(_0x03b7('0x3'));var ami=require(_0x03b7('0x4'));var RpcVoiceAgentReport=require(_0x03b7('0x5'));var RpcVoiceCallReport=require(_0x03b7('0x6'));var RpcVoiceDialReport=require(_0x03b7('0x7'));var RpcMemberReport=require(_0x03b7('0x8'));var RpcVoiceQueueReport=require(_0x03b7('0x9'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x03b7('0xa'));var VoiceQueueReport=require(_0x03b7('0xb'));var VoiceCallReport=require(_0x03b7('0xc'));var VoiceAgentReport=require(_0x03b7('0xd'));var VoiceDialReport=require(_0x03b7('0xe'));var UserReport=require('./userReport');function Report(_0x41bb03){this[_0x03b7('0xf')]=_0x41bb03;this[_0x03b7('0x10')]=_0x41bb03[_0x03b7('0x10')];this[_0x03b7('0x11')]=_0x41bb03[_0x03b7('0x11')];}Report[_0x03b7('0x12')][_0x03b7('0x13')]=function(_0x2ba94e){var _0x34c0e2=new VoiceQueueReport(this['realtime']);var _0x3e4cf4=new VoiceAgentReport(this[_0x03b7('0xf')]);var _0x55cf07=new VoiceDialReport(this[_0x03b7('0xf')]);var _0x585094=new VoiceCallReport(this[_0x03b7('0xf')]);var _0x36fc8e=new UserReport(this['realtime']);if(config[_0x03b7('0x14')]&&config['xdr'][_0x03b7('0x15')]){ami['on']('custom:voiceQueueReport',this[_0x03b7('0x16')]['bind'](this));ami['on'](_0x03b7('0x17'),this['voiceCallReport']['bind'](this));ami['on'](_0x03b7('0x18'),this[_0x03b7('0x19')][_0x03b7('0x1a')](this));ami['on'](_0x03b7('0x1b'),this['voiceDialReport'][_0x03b7('0x1a')](this));ami['on']('blindtransfer',this[_0x03b7('0x1c')][_0x03b7('0x1a')](this));ami['on'](_0x03b7('0x1d'),this[_0x03b7('0x1e')][_0x03b7('0x1a')](this));}};Report[_0x03b7('0x12')][_0x03b7('0x1f')]=function(_0x1cddc7){var _0xb53100;_0xb53100=_['find'](this[_0x03b7('0x10')],function(_0x27f1f3){return _0x27f1f3[_0x03b7('0x20')]==_0x1cddc7||_0x27f1f3[_0x03b7('0x21')]==_0x1cddc7;});if(_[_0x03b7('0x22')](_0xb53100)){var _0x4bd164=_['find'](this[_0x03b7('0x11')],function(_0x406862){return _0x406862[_0x03b7('0x20')]==_0x1cddc7||_0x406862['name']==_0x1cddc7;});if(_0x4bd164){_0xb53100=_['find'](this[_0x03b7('0x10')],function(_0x5388be){return _0x5388be[_0x03b7('0x23')]==util['format'](_0x03b7('0x24'),_0x4bd164[_0x03b7('0x21')]);});}}return _0xb53100;};Report[_0x03b7('0x12')][_0x03b7('0x16')]=function(_0x3f485a){for(var _0x2ebc2f=0x0;_0x2ebc2f<_0x3f485a[_0x03b7('0x25')];_0x2ebc2f+=0x1){var _0x1e7b20=this[_0x03b7('0x1f')](_0x3f485a[_0x2ebc2f][_0x03b7('0x26')]);if(_0x1e7b20){_0x3f485a[_0x2ebc2f][_0x03b7('0x20')]=_0x1e7b20[_0x03b7('0x20')];_0x3f485a[_0x2ebc2f][_0x03b7('0x27')]=!![];_0x3f485a[_0x2ebc2f][_0x03b7('0x28')]=_0x1e7b20['name'];_0x3f485a[_0x2ebc2f]['interface']=_[_0x03b7('0x22')](_0x1e7b20['interface'])?util['format'](_0x03b7('0x24'),_0x1e7b20[_0x03b7('0x21')]):_0x1e7b20['interface'];if(_0x3f485a[_0x2ebc2f][_0x03b7('0x29')]){_0x3f485a[_0x2ebc2f][_0x03b7('0x2a')]=moment()['format'](_0x03b7('0x2b'));}if(_0x3f485a[_0x2ebc2f][_0x03b7('0x2c')]){_0x3f485a[_0x2ebc2f][_0x03b7('0x2d')]=moment()[_0x03b7('0x2e')](_0x03b7('0x2b'));}RpcMemberReport[_0x03b7('0x16')](_0x3f485a[_0x2ebc2f]);}RpcVoiceQueueReport[_0x03b7('0x2f')](_0x3f485a[_0x2ebc2f]);}};function extractCalleridNumber(_0x5e4a02){var _0x599bf6=_0x5e4a02[_0x03b7('0x30')](/<(.*?)>/);return _0x599bf6?_0x599bf6[0x1]:_0x5e4a02;}Report[_0x03b7('0x12')][_0x03b7('0x31')]=function(_0x5208d5){for(var _0x2a0e91=0x0;_0x2a0e910x0?_0x1dc7ff:0x0;this[_0x9952('0x13')][_0x1dc78a[_0x9952('0x71')]][_0x9952('0x2f')]=this[_0x9952('0x13')][_0x1dc78a[_0x9952('0x71')]]['talking']>_['toNumber'](_0x1dc78a[_0x9952('0x72')])?_[_0x9952('0x6f')](_0x1dc78a[_0x9952('0x72')]):this[_0x9952('0x13')][_0x1dc78a[_0x9952('0x71')]][_0x9952('0x2f')];this[_0x9952('0x73')](this[_0x9952('0x13')][_0x1dc78a['queue']],_0x9952('0x66'));}logger[_0x9952('0x43')](_0x9952('0x74'),util[_0x9952('0x3b')](this[_0x9952('0x13')][_0x1dc78a[_0x9952('0x71')]],{'showHidden':![],'depth':null}));ami[_0x9952('0x42')](_0x9952('0x75'),this[_0x9952('0x13')][_0x1dc78a[_0x9952('0x71')]]);}}}catch(_0x46f834){logger[_0x9952('0x3d')](_0x9952('0x68'),util['inspect'](_0x46f834,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9952('0xd')][_0x9952('0x76')]=function(_0xb9bdf7){logger['debug'](_0x9952('0x77'),util[_0x9952('0x3b')](_0xb9bdf7,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x9952('0x18')]=function(_0x25e990){try{if(this['isNotNull'](_0x25e990)){logger[_0x9952('0x43')](_0x9952('0x78'),_0x25e990['uniqueid'],util[_0x9952('0x3b')](_0x25e990,{'showHidden':![],'depth':null}));if(_[_0x9952('0x61')](this[_0x9952('0x3c')][_0x25e990[_0x9952('0x46')]]))this[_0x9952('0x3c')][_0x25e990['uniqueid']]=[];if(_['isUndefined'](this[_0x9952('0x12')][_0x25e990[_0x9952('0x46')]]))this[_0x9952('0x12')][_0x25e990[_0x9952('0x46')]]={};var _0x544b0d=new QueueReport();_0x544b0d[_0x9952('0x4d')]=_0x25e990['queue'];_0x544b0d[_0x9952('0x50')]=this[_0x9952('0x13')][_0x544b0d[_0x9952('0x4d')]]&&this[_0x9952('0x13')][_0x544b0d['name']][_0x9952('0x50')]?this[_0x9952('0x13')][_0x544b0d[_0x9952('0x4d')]][_0x9952('0x50')]||_0x9952('0x51'):'inbound';_0x544b0d[_0x9952('0x71')]=_0x25e990[_0x9952('0x71')];_0x544b0d[_0x9952('0x79')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x544b0d[_0x9952('0x7a')]=_0x25e990[_0x9952('0x7a')];_0x544b0d[_0x9952('0x7b')]=_0x25e990['count'];_0x544b0d[_0x9952('0x46')]=_0x25e990[_0x9952('0x46')];_0x544b0d[_0x9952('0x7c')]=this[_0x9952('0x12')][_0x25e990['uniqueid']][_0x9952('0x7c')];logger[_0x9952('0x6c')](_0x9952('0x7d'),_0x544b0d[_0x9952('0x4d')],_0x544b0d[_0x9952('0x50')]);_[_0x9952('0x7e')](_0x544b0d,_['pick'](_0x25e990,_[_0x9952('0x7f')](_0x544b0d)));this[_0x9952('0x3c')][_0x25e990['uniqueid']][_0x9952('0x80')](_0x544b0d);this[_0x9952('0x12')][_0x25e990[_0x9952('0x46')]]=_0x544b0d;this[_0x9952('0x81')](_0x544b0d,_0x9952('0x82'));}}catch(_0x5914d7){logger['error'](_0x9952('0x78'),_0x25e990['uniqueid'],util[_0x9952('0x3b')](_0x5914d7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9952('0x1a')]=function(_0x52f896){try{if(this[_0x9952('0x6a')](_0x52f896)){logger[_0x9952('0x43')]('[%s][voiceQueueReport][queuecallerabandon]',_0x52f896[_0x9952('0x46')],util['inspect'](_0x52f896,{'showHidden':![],'depth':null}));if(this[_0x9952('0x3c')][_0x52f896[_0x9952('0x46')]]){var _0x121973=_[_0x9952('0x83')](this['queueReports'][_0x52f896[_0x9952('0x46')]]);_0x121973[_0x9952('0x84')]=![];_0x121973['queuecallercompleteAt']=null;_0x121973[_0x9952('0x85')]=_0x52f896['holdtime'];_0x121973[_0x9952('0x86')]=_0x52f896[_0x9952('0x86')];_0x121973[_0x9952('0x19')]=!![];_0x121973[_0x9952('0x87')]=moment()[_0x9952('0x47')](_0x9952('0x88'));_0x121973[_0x9952('0x4b')]=_0x9952('0x89');_0x121973[_0x9952('0x8a')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x121973[_0x9952('0x4d')],_0x121973[_0x9952('0x50')]);this[_0x9952('0x12')][_0x52f896[_0x9952('0x46')]]=_0x121973;this['emitVoiceQueueChannelRemove'](_0x121973,_0x9952('0x19'));}}}catch(_0x572d52){logger[_0x9952('0x3d')](_0x9952('0x8b'),_0x52f896[_0x9952('0x46')],util[_0x9952('0x3b')](_0x572d52,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9952('0xd')]['syncQueueCallerLeave']=function(_0x414e8a){try{if(this[_0x9952('0x6a')](_0x414e8a)){logger[_0x9952('0x43')](_0x9952('0x8c'),_0x414e8a['uniqueid'],util['inspect'](_0x414e8a,{'showHidden':![],'depth':null}));if(this[_0x9952('0x3c')][_0x414e8a[_0x9952('0x46')]]){var _0x4f4d1c=_[_0x9952('0x83')](this[_0x9952('0x3c')][_0x414e8a[_0x9952('0x46')]]);_0x4f4d1c[_0x9952('0x8d')]=moment()[_0x9952('0x47')](_0x9952('0x88'));_0x4f4d1c[_0x9952('0x8e')]=_0x414e8a['connectedlinenum'];_0x4f4d1c['connectedlinename']=_0x414e8a[_0x9952('0x8f')];logger[_0x9952('0x6c')](_0x9952('0x90'),_0x4f4d1c[_0x9952('0x4d')],_0x4f4d1c[_0x9952('0x50')],_0x414e8a[_0x9952('0x8e')],_0x414e8a[_0x9952('0x8f')]);this[_0x9952('0x12')][_0x414e8a[_0x9952('0x46')]]=_0x4f4d1c;this['emitVoiceQueueChannelSave'](_0x4f4d1c,_0x9952('0x91'));}}}catch(_0x209949){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x414e8a[_0x9952('0x46')],util['inspect'](_0x209949,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9952('0x92')]=function(_0x5ac484){try{if(this[_0x9952('0x6a')](_0x5ac484)){logger[_0x9952('0x43')](_0x9952('0x93'),_0x5ac484[_0x9952('0x46')],util[_0x9952('0x3b')](_0x5ac484,{'showHidden':![],'depth':null}));if(this[_0x9952('0x3c')][_0x5ac484['uniqueid']]){var _0x510951=_[_0x9952('0x83')](this[_0x9952('0x3c')][_0x5ac484[_0x9952('0x46')]]);_0x510951[_0x9952('0x84')]=!![];_0x510951[_0x9952('0x4b')]='COMPLETEDBYAGENT';logger[_0x9952('0x6c')](_0x9952('0x94'),_0x510951[_0x9952('0x4d')],_0x510951['type']);}}}catch(_0x2d4fb1){logger[_0x9952('0x3d')]('[%s][voiceQueueReport][agentconnect]',_0x5ac484[_0x9952('0x46')],util[_0x9952('0x3b')](_0x2d4fb1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9952('0xd')]['syncAgentComplete']=function(_0x234135){try{if(this[_0x9952('0x6a')](_0x234135)){logger[_0x9952('0x43')](_0x9952('0x95'),_0x234135[_0x9952('0x46')],util[_0x9952('0x3b')](_0x234135,{'showHidden':![],'depth':null}));if(this[_0x9952('0x3c')][_0x234135['uniqueid']]){var _0x56cfcd=_[_0x9952('0x83')](this[_0x9952('0x3c')][_0x234135[_0x9952('0x46')]]);_0x56cfcd[_0x9952('0x19')]=![];_0x56cfcd[_0x9952('0x87')]=null;_0x56cfcd[_0x9952('0x96')]=!![];_0x56cfcd[_0x9952('0x8a')]=_0x234135['membername'];_0x56cfcd[_0x9952('0x85')]=_0x234135['holdtime'];_0x56cfcd[_0x9952('0x84')]=!![];_0x56cfcd[_0x9952('0x97')]=![];_0x56cfcd['queuecallerexitAt']=null;if(!_0x56cfcd[_0x9952('0x98')]){if(_0x234135[_0x9952('0x99')]==_0x9952('0x98')){_0x56cfcd[_0x9952('0x4b')]=_0x9952('0x9a');logger['info'](_0x9952('0x9b'),_0x56cfcd[_0x9952('0x4d')],_0x56cfcd[_0x9952('0x50')]);}else{if(_['startsWith'](_0x234135['channel'][_0x9952('0x9c')](),_0x9952('0x9d'))){if(this[_0x9952('0x3c')][_0x234135['linkedid']]){var _0x302f99=_[_0x9952('0x83')](this[_0x9952('0x3c')][_0x234135[_0x9952('0x9e')]]);_0x302f99[_0x9952('0x84')]=![];_0x302f99['queuecallerexit']=!![];_0x302f99['queuecallerexitAt']=moment(_0x56cfcd[_0x9952('0x79')])[_0x9952('0x9f')](_0x234135[_0x9952('0x85')],_0x9952('0xa0'))['format'](_0x9952('0x88'));_0x302f99[_0x9952('0x4b')]='FORWARDTRANSFER';_0x302f99[_0x9952('0x98')]=!![];_0x302f99['transfertype']=_0x9952('0xa1');_0x302f99[_0x9952('0xa2')]=_0x234135[_0x9952('0xa3')];_0x302f99[_0x9952('0xa4')]=_0x234135[_0x9952('0x46')];logger[_0x9952('0x6c')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x302f99['name'],_0x302f99[_0x9952('0x50')]);var _0x651b1f=this[_0x9952('0x3c')][_0x234135[_0x9952('0x9e')]];this['queueReports'][_0x234135[_0x9952('0x9e')]]=this['queueReports'][_0x234135[_0x9952('0x46')]];this[_0x9952('0x3c')][_0x234135['uniqueid']]=_0x651b1f;}}else{_0x56cfcd[_0x9952('0x4b')]='COMPLETEDBY'+_0x234135[_0x9952('0x99')][_0x9952('0xa5')]();logger['info'](_0x9952('0xa6'),_0x56cfcd[_0x9952('0x4d')],_0x56cfcd[_0x9952('0x50')],_0x56cfcd[_0x9952('0x4b')]);}}}this[_0x9952('0x12')][_0x234135['uniqueid']]=_0x56cfcd;this[_0x9952('0xa7')](_0x56cfcd,_0x9952('0x1c'));}}}catch(_0x545fa9){logger[_0x9952('0x3d')](_0x9952('0x95'),_0x234135[_0x9952('0x46')],util[_0x9952('0x3b')](_0x545fa9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9952('0xd')]['syncVarSet']=function(_0x1bb59f){try{if(this[_0x9952('0x6a')](_0x1bb59f)){logger[_0x9952('0x43')]('[%s][voiceQueueReport][varset]',_0x1bb59f[_0x9952('0x46')],util[_0x9952('0x3b')](_0x1bb59f,{'showHidden':![],'depth':null}));this[_0x9952('0xa8')](_0x1bb59f[_0x9952('0x46')],_['keys'](_0x1bb59f[_0x9952('0xa9')])[0x0],_0x1bb59f[_0x9952('0xaa')]);if(this[_0x9952('0x3c')][_0x1bb59f[_0x9952('0x46')]]){var _0x3c585e=_[_0x9952('0x83')](this[_0x9952('0x3c')][_0x1bb59f[_0x9952('0x46')]]);if(_0x3c585e){if(this[_0x9952('0x6a')](_0x1bb59f[_0x9952('0xa9')])&&this[_0x9952('0x6a')](_0x1bb59f[_0x9952('0xa9')][_0x9952('0xab')])){switch(_0x1bb59f[_0x9952('0xaa')]){case _0x9952('0xac'):_0x3c585e[_0x9952('0x97')]=![];_0x3c585e[_0x9952('0xad')]=null;break;case _0x9952('0xae'):_0x3c585e[_0x9952('0xaf')]=_0x9952('0xb0');_0x3c585e['queuecallerexit']=!![];_0x3c585e['queuecallerexitAt']=moment()[_0x9952('0x47')](_0x9952('0x88'));_0x3c585e[_0x9952('0x8d')]=moment()[_0x9952('0x47')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x9952('0x43')](_0x9952('0xb1'),_0x1bb59f[_0x9952('0x46')],util['inspect'](_0x3c585e,{'showHidden':![],'depth':null}));ami['emit'](_0x9952('0xb2'),_0x3c585e);break;default:_0x3c585e[_0x9952('0x97')]=!![];_0x3c585e[_0x9952('0xad')]=moment()[_0x9952('0x47')](_0x9952('0x88'));_0x3c585e[_0x9952('0x8d')]=moment()[_0x9952('0x47')](_0x9952('0x88'));}_0x3c585e[_0x9952('0x19')]=![];_0x3c585e[_0x9952('0x87')]=null;_0x3c585e[_0x9952('0x4b')]=_0x1bb59f[_0x9952('0xaa')];this['channels'][_0x1bb59f[_0x9952('0x46')]]=_0x3c585e;this[_0x9952('0xa7')](_0x3c585e,'varset');}else if(this[_0x9952('0x6a')](_0x1bb59f[_0x9952('0xa9')])&&this[_0x9952('0x6a')](_0x1bb59f['variable'][_0x9952('0xb3')])){if(!_0x3c585e[_0x9952('0x19')]){_0x3c585e[_0x9952('0x97')]=!![];_0x3c585e['queuecallerexitAt']=moment()[_0x9952('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c585e[_0x9952('0x4b')]=_0x9952('0xb4');_0x3c585e['queuecallerleaveAt']=moment()[_0x9952('0x47')](_0x9952('0x88'));this['channels'][_0x1bb59f[_0x9952('0x46')]]=_0x3c585e;}}logger[_0x9952('0x6c')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x1bb59f['uniqueid'],_0x3c585e[_0x9952('0x4d')],_0x3c585e[_0x9952('0x50')],_[_0x9952('0x7f')](_0x1bb59f[_0x9952('0xa9')])[0x0],_0x1bb59f[_0x9952('0xaa')]);_0x3c585e[_0x9952('0x15')]=this[_0x9952('0x15')][_0x1bb59f[_0x9952('0x46')]];}}}}catch(_0x4e546c){logger[_0x9952('0x3d')](_0x9952('0xb5'),_0x1bb59f['uniqueid'],util['inspect'](_0x4e546c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9952('0xd')][_0x9952('0xa8')]=function(_0x21ad27,_0x4d0a52,_0x12e1f0){var _0x5aa37c=[_0x9952('0xb6'),_0x9952('0xb7'),_0x9952('0xb8'),_0x9952('0xb9'),_0x9952('0xba'),_0x9952('0xbb'),'rtpaudioqosrtt',_0x9952('0xbc'),'sipcallid',_0x9952('0xbd'),'bridgepeer',_0x9952('0xbe'),'membercalls',_0x9952('0xbf'),_0x9952('0xc0'),_0x9952('0xc1'),_0x9952('0xc2'),'memberpenalty',_0x9952('0xc3')];if(!_[_0x9952('0x33')](_0x4d0a52)&&!_[_0x9952('0xc4')](_0x5aa37c,_0x4d0a52)){if(_[_0x9952('0x61')](this[_0x9952('0x15')][_0x21ad27])){this[_0x9952('0x15')][_0x21ad27]={};}this['variables'][_0x21ad27][_0x4d0a52]=_0x12e1f0;}};VoiceQueueReport[_0x9952('0xd')][_0x9952('0x22')]=function(_0x21ce24){try{if(this[_0x9952('0x6a')](_0x21ce24)){logger[_0x9952('0x43')](_0x9952('0xc5'),_0x21ce24[_0x9952('0x46')],util[_0x9952('0x3b')](_0x21ce24,{'showHidden':![],'depth':null}));if(this[_0x9952('0x3c')][_0x21ce24[_0x9952('0x46')]]){for(var _0x54a2fe=0x0,_0x36a5a6={};_0x54a2fe0x0?_0x19a56b:0x0;this[_0x16a1('0x13')][_0x480ce8['queue']][_0x16a1('0x30')]=this['voiceQueues'][_0x480ce8[_0x16a1('0x6b')]]['talking']>_[_0x16a1('0x71')](_0x480ce8[_0x16a1('0x72')])?_[_0x16a1('0x71')](_0x480ce8[_0x16a1('0x72')]):this['voiceQueues'][_0x480ce8['queue']][_0x16a1('0x30')];this[_0x16a1('0x74')](this[_0x16a1('0x13')][_0x480ce8[_0x16a1('0x6b')]],_0x16a1('0x17'));}logger[_0x16a1('0x4b')](_0x16a1('0x75'),util[_0x16a1('0x3d')](this[_0x16a1('0x13')][_0x480ce8[_0x16a1('0x6b')]],{'showHidden':![],'depth':null}));ami[_0x16a1('0x45')](_0x16a1('0x76'),this[_0x16a1('0x13')][_0x480ce8['queue']]);}}}catch(_0xf459b1){logger[_0x16a1('0x3b')](_0x16a1('0x6a'),util[_0x16a1('0x3d')](_0xf459b1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x16a1('0xb')]['syncQueueSummaryComplete']=function(_0xc3e145){logger[_0x16a1('0x4b')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0xc3e145,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x16a1('0xb')][_0x16a1('0x1c')]=function(_0x1e171f){try{if(this[_0x16a1('0x62')](_0x1e171f)){logger[_0x16a1('0x4b')]('[%s][voiceQueueReport][queuecallerjoin]',_0x1e171f[_0x16a1('0x4d')],util['inspect'](_0x1e171f,{'showHidden':![],'depth':null}));if(_[_0x16a1('0x63')](this[_0x16a1('0xf')][_0x1e171f[_0x16a1('0x4d')]]))this[_0x16a1('0xf')][_0x1e171f[_0x16a1('0x4d')]]=[];if(_[_0x16a1('0x63')](this[_0x16a1('0x11')][_0x1e171f[_0x16a1('0x4d')]]))this['channels'][_0x1e171f[_0x16a1('0x4d')]]={};var _0x511626=new QueueReport();_0x511626[_0x16a1('0x49')]=_0x1e171f[_0x16a1('0x6b')];_0x511626[_0x16a1('0x52')]=this[_0x16a1('0x13')][_0x511626[_0x16a1('0x49')]]&&this['voiceQueues'][_0x511626[_0x16a1('0x49')]][_0x16a1('0x52')]?this[_0x16a1('0x13')][_0x511626['name']]['type']||_0x16a1('0x53'):_0x16a1('0x53');_0x511626[_0x16a1('0x6b')]=_0x1e171f[_0x16a1('0x6b')];_0x511626[_0x16a1('0x77')]=moment()[_0x16a1('0x78')]('YYYY-MM-DD\x20HH:mm:ss');_0x511626[_0x16a1('0x79')]=_0x1e171f[_0x16a1('0x79')];_0x511626[_0x16a1('0x7a')]=_0x1e171f[_0x16a1('0x7a')];_0x511626[_0x16a1('0x4d')]=_0x1e171f[_0x16a1('0x4d')];_0x511626[_0x16a1('0x7b')]=this['channels'][_0x1e171f[_0x16a1('0x4d')]][_0x16a1('0x7b')];logger[_0x16a1('0x6d')](_0x16a1('0x7c'),_0x511626[_0x16a1('0x49')],_0x511626[_0x16a1('0x52')]);_['merge'](_0x511626,_[_0x16a1('0x7d')](_0x1e171f,_[_0x16a1('0x7e')](_0x511626)));this['queueReports'][_0x1e171f[_0x16a1('0x4d')]][_0x16a1('0x7f')](_0x511626);this[_0x16a1('0x11')][_0x1e171f[_0x16a1('0x4d')]]=_0x511626;this[_0x16a1('0x46')](_0x511626,_0x16a1('0x1b'));}}catch(_0x132abd){logger[_0x16a1('0x3b')](_0x16a1('0x80'),_0x1e171f[_0x16a1('0x4d')],util['inspect'](_0x132abd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x16a1('0xb')]['syncQueueCallerAbandon']=function(_0x5c7514){try{if(this[_0x16a1('0x62')](_0x5c7514)){logger[_0x16a1('0x4b')](_0x16a1('0x81'),_0x5c7514[_0x16a1('0x4d')],util[_0x16a1('0x3d')](_0x5c7514,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5c7514['uniqueid']]){var _0x15b611=_[_0x16a1('0x82')](this[_0x16a1('0xf')][_0x5c7514[_0x16a1('0x4d')]]);_0x15b611['queuecallercomplete']=![];_0x15b611[_0x16a1('0x83')]=null;_0x15b611[_0x16a1('0x84')]=_0x5c7514[_0x16a1('0x84')];_0x15b611[_0x16a1('0x85')]=_0x5c7514[_0x16a1('0x85')];_0x15b611[_0x16a1('0x1d')]=!![];_0x15b611[_0x16a1('0x86')]=moment()[_0x16a1('0x78')](_0x16a1('0x87'));_0x15b611[_0x16a1('0x4e')]=_0x16a1('0x88');_0x15b611[_0x16a1('0x89')]=null;logger[_0x16a1('0x6d')](_0x16a1('0x8a'),_0x15b611[_0x16a1('0x49')],_0x15b611['type']);this['channels'][_0x5c7514[_0x16a1('0x4d')]]=_0x15b611;this[_0x16a1('0x43')](_0x15b611,_0x16a1('0x1d'));}}}catch(_0x4fb8d9){logger[_0x16a1('0x3b')](_0x16a1('0x81'),_0x5c7514[_0x16a1('0x4d')],util['inspect'](_0x4fb8d9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x16a1('0xb')][_0x16a1('0x20')]=function(_0x577479){try{if(this[_0x16a1('0x62')](_0x577479)){logger[_0x16a1('0x4b')](_0x16a1('0x8b'),_0x577479[_0x16a1('0x4d')],util[_0x16a1('0x3d')](_0x577479,{'showHidden':![],'depth':null}));if(this[_0x16a1('0xf')][_0x577479[_0x16a1('0x4d')]]){var _0x2115d1=_[_0x16a1('0x82')](this[_0x16a1('0xf')][_0x577479[_0x16a1('0x4d')]]);_0x2115d1[_0x16a1('0x8c')]=moment()[_0x16a1('0x78')](_0x16a1('0x87'));_0x2115d1[_0x16a1('0x8d')]=_0x577479[_0x16a1('0x8d')];_0x2115d1[_0x16a1('0x8e')]=_0x577479[_0x16a1('0x8e')];logger[_0x16a1('0x6d')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2115d1[_0x16a1('0x49')],_0x2115d1[_0x16a1('0x52')],_0x577479[_0x16a1('0x8d')],_0x577479['connectedlinename']);this['channels'][_0x577479[_0x16a1('0x4d')]]=_0x2115d1;this[_0x16a1('0x46')](_0x2115d1,_0x16a1('0x1f'));}}}catch(_0x96e923){logger['error'](_0x16a1('0x8b'),_0x577479['uniqueid'],util[_0x16a1('0x3d')](_0x96e923,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x16a1('0xb')][_0x16a1('0x8f')]=function(_0x56457b){try{if(this[_0x16a1('0x62')](_0x56457b)){logger[_0x16a1('0x4b')](_0x16a1('0x90'),_0x56457b[_0x16a1('0x4d')],util[_0x16a1('0x3d')](_0x56457b,{'showHidden':![],'depth':null}));if(this[_0x16a1('0xf')][_0x56457b[_0x16a1('0x4d')]]){var _0x4155b2=_[_0x16a1('0x82')](this[_0x16a1('0xf')][_0x56457b[_0x16a1('0x4d')]]);_0x4155b2[_0x16a1('0x91')]=!![];_0x4155b2[_0x16a1('0x4e')]='COMPLETEDBYAGENT';logger['info'](_0x16a1('0x92'),_0x4155b2[_0x16a1('0x49')],_0x4155b2['type']);}}}catch(_0x588ce8){logger[_0x16a1('0x3b')](_0x16a1('0x90'),_0x56457b[_0x16a1('0x4d')],util['inspect'](_0x588ce8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x16a1('0xb')][_0x16a1('0x21')]=function(_0x25828b){try{if(this[_0x16a1('0x62')](_0x25828b)){logger['debug'](_0x16a1('0x93'),_0x25828b[_0x16a1('0x4d')],util[_0x16a1('0x3d')](_0x25828b,{'showHidden':![],'depth':null}));if(this[_0x16a1('0xf')][_0x25828b[_0x16a1('0x4d')]]){var _0x19ef2f=_[_0x16a1('0x82')](this[_0x16a1('0xf')][_0x25828b[_0x16a1('0x4d')]]);_0x19ef2f[_0x16a1('0x1d')]=![];_0x19ef2f['queuecallerabandonAt']=null;_0x19ef2f['assigned']=!![];_0x19ef2f['lastAssignedTo']=_0x25828b[_0x16a1('0x94')];_0x19ef2f[_0x16a1('0x84')]=_0x25828b[_0x16a1('0x84')];_0x19ef2f['queuecallercomplete']=!![];_0x19ef2f['queuecallerexit']=![];_0x19ef2f['queuecallerexitAt']=null;if(!_0x19ef2f['transfer']){if(_0x25828b[_0x16a1('0x95')]=='transfer'){_0x19ef2f[_0x16a1('0x4e')]='COMPLETED';logger[_0x16a1('0x6d')](_0x16a1('0x96'),_0x19ef2f['name'],_0x19ef2f[_0x16a1('0x52')]);}else{if(_[_0x16a1('0x97')](_0x25828b[_0x16a1('0x38')][_0x16a1('0x98')](),_0x16a1('0x99'))){if(this[_0x16a1('0xf')][_0x25828b[_0x16a1('0x9a')]]){var _0x2b403b=_[_0x16a1('0x82')](this[_0x16a1('0xf')][_0x25828b[_0x16a1('0x9a')]]);_0x2b403b['queuecallercomplete']=![];_0x2b403b[_0x16a1('0x9b')]=!![];_0x2b403b['queuecallerexitAt']=moment(_0x19ef2f['queuecallerjoinAt'])['add'](_0x25828b['holdtime'],'seconds')['format'](_0x16a1('0x87'));_0x2b403b[_0x16a1('0x4e')]=_0x16a1('0x9c');_0x2b403b[_0x16a1('0x9d')]=!![];_0x2b403b[_0x16a1('0x9e')]='FORWARD';_0x2b403b[_0x16a1('0x9f')]=_0x25828b[_0x16a1('0xa0')];_0x2b403b[_0x16a1('0xa1')]=_0x25828b[_0x16a1('0x4d')];logger['info'](_0x16a1('0xa2'),_0x2b403b['name'],_0x2b403b[_0x16a1('0x52')]);var _0x2ac8d6=this[_0x16a1('0xf')][_0x25828b[_0x16a1('0x9a')]];this[_0x16a1('0xf')][_0x25828b[_0x16a1('0x9a')]]=this[_0x16a1('0xf')][_0x25828b['uniqueid']];this[_0x16a1('0xf')][_0x25828b[_0x16a1('0x4d')]]=_0x2ac8d6;}}else{_0x19ef2f[_0x16a1('0x4e')]=_0x16a1('0xa3')+_0x25828b[_0x16a1('0x95')][_0x16a1('0xa4')]();logger[_0x16a1('0x6d')](_0x16a1('0xa5'),_0x19ef2f[_0x16a1('0x49')],_0x19ef2f[_0x16a1('0x52')],_0x19ef2f['queuecallerexitreason']);}}}this[_0x16a1('0x11')][_0x25828b[_0x16a1('0x4d')]]=_0x19ef2f;this[_0x16a1('0x43')](_0x19ef2f,'agentcomplete');}}}catch(_0x587489){logger[_0x16a1('0x3b')](_0x16a1('0x93'),_0x25828b['uniqueid'],util[_0x16a1('0x3d')](_0x587489,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x16a1('0xb')][_0x16a1('0xa6')]=function(_0x5d9680){try{if(this[_0x16a1('0x62')](_0x5d9680)){logger[_0x16a1('0x4b')](_0x16a1('0xa7'),_0x5d9680['uniqueid'],util[_0x16a1('0x3d')](_0x5d9680,{'showHidden':![],'depth':null}));this[_0x16a1('0xa8')](_0x5d9680['uniqueid'],_[_0x16a1('0x7e')](_0x5d9680[_0x16a1('0xa9')])[0x0],_0x5d9680[_0x16a1('0xaa')]);if(this[_0x16a1('0xf')][_0x5d9680[_0x16a1('0x4d')]]){var _0x57953d=_[_0x16a1('0x82')](this['queueReports'][_0x5d9680[_0x16a1('0x4d')]]);if(_0x57953d){if(this[_0x16a1('0x62')](_0x5d9680[_0x16a1('0xa9')])&&this[_0x16a1('0x62')](_0x5d9680[_0x16a1('0xa9')][_0x16a1('0xab')])){switch(_0x5d9680[_0x16a1('0xaa')]){case'CONTINUE':_0x57953d[_0x16a1('0x9b')]=![];_0x57953d[_0x16a1('0xac')]=null;break;case _0x16a1('0xad'):_0x57953d[_0x16a1('0xae')]=_0x16a1('0xaf');_0x57953d['queuecallerexit']=!![];_0x57953d['queuecallerexitAt']=moment()[_0x16a1('0x78')](_0x16a1('0x87'));_0x57953d[_0x16a1('0x8c')]=moment()['format'](_0x16a1('0x87'));logger[_0x16a1('0x4b')](_0x16a1('0xb0'),_0x5d9680[_0x16a1('0x4d')],util[_0x16a1('0x3d')](_0x57953d,{'showHidden':![],'depth':null}));ami[_0x16a1('0x45')](_0x16a1('0xb1'),_0x57953d);break;default:_0x57953d[_0x16a1('0x9b')]=!![];_0x57953d[_0x16a1('0xac')]=moment()[_0x16a1('0x78')](_0x16a1('0x87'));_0x57953d[_0x16a1('0x8c')]=moment()[_0x16a1('0x78')](_0x16a1('0x87'));}_0x57953d['queuecallerabandon']=![];_0x57953d[_0x16a1('0x86')]=null;_0x57953d['queuecallerexitreason']=_0x5d9680[_0x16a1('0xaa')];this[_0x16a1('0x11')][_0x5d9680['uniqueid']]=_0x57953d;this[_0x16a1('0x43')](_0x57953d,_0x16a1('0x23'));}else if(this[_0x16a1('0x62')](_0x5d9680[_0x16a1('0xa9')])&&this[_0x16a1('0x62')](_0x5d9680['variable']['queueposition'])){if(!_0x57953d[_0x16a1('0x1d')]){_0x57953d['queuecallerexit']=!![];_0x57953d[_0x16a1('0xac')]=moment()[_0x16a1('0x78')](_0x16a1('0x87'));_0x57953d[_0x16a1('0x4e')]='EXITWITHKEY';_0x57953d['queuecallerleaveAt']=moment()[_0x16a1('0x78')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x16a1('0x11')][_0x5d9680[_0x16a1('0x4d')]]=_0x57953d;}}logger[_0x16a1('0x6d')](_0x16a1('0xb2'),_0x5d9680[_0x16a1('0x4d')],_0x57953d[_0x16a1('0x49')],_0x57953d[_0x16a1('0x52')],_[_0x16a1('0x7e')](_0x5d9680[_0x16a1('0xa9')])[0x0],_0x5d9680[_0x16a1('0xaa')]);_0x57953d['variables']=this[_0x16a1('0x16')][_0x5d9680['uniqueid']];}}}}catch(_0x5ddae9){logger['error'](_0x16a1('0xa7'),_0x5d9680['uniqueid'],util['inspect'](_0x5ddae9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x16a1('0xb')][_0x16a1('0xa8')]=function(_0x4d9c81,_0x27ef3c,_0x1f5bfc){var _0x1487a6=[_0x16a1('0xb3'),_0x16a1('0xb4'),_0x16a1('0xb5'),_0x16a1('0xb6'),_0x16a1('0xb7'),_0x16a1('0xb8'),_0x16a1('0xb9'),_0x16a1('0xba'),'sipcallid',_0x16a1('0xbb'),_0x16a1('0xbc'),'bridgepvtcallid',_0x16a1('0xbd'),_0x16a1('0xbe'),_0x16a1('0xbf'),_0x16a1('0xc0'),'membername',_0x16a1('0xc1'),_0x16a1('0xc2')];if(!_[_0x16a1('0x36')](_0x27ef3c)&&!_['includes'](_0x1487a6,_0x27ef3c)){if(_[_0x16a1('0x63')](this[_0x16a1('0x16')][_0x4d9c81])){this['variables'][_0x4d9c81]={};}this[_0x16a1('0x16')][_0x4d9c81][_0x27ef3c]=_0x1f5bfc;}};VoiceQueueReport[_0x16a1('0xb')][_0x16a1('0x25')]=function(_0x30176b){try{if(this['isNotNull'](_0x30176b)){logger[_0x16a1('0x4b')]('[%s][voiceQueueReport][hangup]',_0x30176b['uniqueid'],util[_0x16a1('0x3d')](_0x30176b,{'showHidden':![],'depth':null}));if(this[_0x16a1('0xf')][_0x30176b[_0x16a1('0x4d')]]){for(var _0x4a02e6=0x0,_0x274c52={};_0x4a02e6=0x0?moment(_0x172e44[_0x2d21('0x1a')])[_0x2d21('0x1b')](_0x172e44[_0x2d21('0x19')],_0x2d21('0x10')):null,'data1':_0x2d21('0x1c'),'data2':_0x172e44[_0x2d21('0x14')],'data3':_0x172e44['exten'],'data4':_0x172e44[_0x2d21('0x1d')]||null,'role':_0x2d21('0x1e'),'internal':_0x172e44['accountcode']?_['toNumber'](_0x172e44[_0x2d21('0x14')]):undefined,'uniqueid':_0x172e44[_0x2d21('0x15')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xd148=['voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','isNil','SIP/%s','lastAssignedTo','interface','queuecallerleaveAt','diff','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','CreateMemberReport','voiceDialReport','membername','TALKING','endtime','seconds','outbound','dialstring','lodash','util'];(function(_0x43355d,_0x5909e3){var _0x263e7c=function(_0x3a5efe){while(--_0x3a5efe){_0x43355d['push'](_0x43355d['shift']());}};_0x263e7c(++_0x5909e3);}(_0xd148,0x6a));var _0x8d14=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd148[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var _=require(_0x8d14('0x0'));var util=require(_0x8d14('0x1'));var client=require('../client');exports[_0x8d14('0x2')]=function(_0x29d124){var _0x1ffbdd=_0x29d124[_0x8d14('0x3')]||_0x29d124[_0x8d14('0x4')];return client[_0x8d14('0x5')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x29d124['lastAssignedTo'],'interface':_[_0x8d14('0x6')](_0x29d124['interface'])?util['format'](_0x8d14('0x7'),_0x29d124[_0x8d14('0x8')]):_0x29d124[_0x8d14('0x9')],'type':'TALKING','enterAt':_0x29d124[_0x8d14('0xa')],'exitAt':_0x1ffbdd,'duration':moment(_0x1ffbdd)[_0x8d14('0xb')](_0x29d124['queuecallerleaveAt'],'seconds'),'data1':_0x8d14('0xc'),'data2':_0x29d124[_0x8d14('0xd')],'data3':_0x29d124[_0x8d14('0xe')],'data4':null,'data5':_0x29d124[_0x8d14('0xf')],'role':_0x8d14('0x10'),'internal':_0x29d124[_0x8d14('0x11')]?_[_0x8d14('0x12')](_0x29d124[_0x8d14('0x11')]):undefined,'uniqueid':_0x29d124['uniqueid']},'log':_0x8d14('0x13')});};exports[_0x8d14('0x14')]=function(_0x3d2470){return client[_0x8d14('0x5')](_0x8d14('0x13'),{'body':{'channel':'voice','membername':_0x3d2470[_0x8d14('0x15')],'interface':_0x3d2470[_0x8d14('0x9')],'type':_0x8d14('0x16'),'enterAt':_0x3d2470['starttime'],'exitAt':_0x3d2470[_0x8d14('0x17')],'duration':moment(_0x3d2470[_0x8d14('0x17')])[_0x8d14('0xb')](_0x3d2470['starttime'],_0x8d14('0x18'))>=0x0?moment(_0x3d2470['endtime'])[_0x8d14('0xb')](_0x3d2470['starttime'],_0x8d14('0x18')):null,'data1':_0x8d14('0x19'),'data2':_0x3d2470['accountcode'],'data3':_0x3d2470[_0x8d14('0xe')],'data4':_0x3d2470[_0x8d14('0x1a')]||null,'role':'agent','internal':_0x3d2470[_0x8d14('0x11')]?_[_0x8d14('0x12')](_0x3d2470[_0x8d14('0x11')]):undefined,'uniqueid':_0x3d2470['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 5092561..726b1a2 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 _0x5df3=['GetSettings','../client','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x5df3,0x15f));var _0x35df=function(_0x29abe6,_0x39ef28){_0x29abe6=_0x29abe6-0x0;var _0x4f91aa=_0x5df3[_0x29abe6];return _0x4f91aa;};'use strict';var client=require(_0x35df('0x0'));exports['getSettings']=function(){return client['Request'](_0x35df('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x35df('0x2'),_0x35df('0x3')]},'log':_0x35df('0x4')});}; \ No newline at end of file +var _0xf4ce=['previewRecallmeReminderInterval','GetSettings','../client','ShowSetting','stopRecordingOnTransfer'];(function(_0x37551d,_0x52e5d8){var _0x12b1da=function(_0x156bf7){while(--_0x156bf7){_0x37551d['push'](_0x37551d['shift']());}};_0x12b1da(++_0x52e5d8);}(_0xf4ce,0xf2));var _0xef4c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf4ce[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0xef4c('0x0'));exports['getSettings']=function(){return client['Request'](_0xef4c('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xef4c('0x2'),_0xef4c('0x3')]},'log':_0xef4c('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index a3f41cd..d5e600a 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 _0x59ea=['html','Request','GetTemplate','name'];(function(_0x5413f5,_0x3154c7){var _0x639288=function(_0x4b85e9){while(--_0x4b85e9){_0x5413f5['push'](_0x5413f5['shift']());}};_0x639288(++_0x3154c7);}(_0x59ea,0x19d));var _0xa59e=function(_0x29a24a,_0x41c11c){_0x29a24a=_0x29a24a-0x0;var _0x3cf905=_0x59ea[_0x29a24a];return _0x3cf905;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x3fe4b0){return function(_0x17f720){return client[_0xa59e('0x0')](_0xa59e('0x1'),{'options':{'raw':!![],'attributes':['id',_0xa59e('0x2'),_0xa59e('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xa03c=['name','html','GetTemplate','../client','Request'];(function(_0x5d085e,_0x47382e){var _0x3ac3c5=function(_0x4f51c4){while(--_0x4f51c4){_0x5d085e['push'](_0x5d085e['shift']());}};_0x3ac3c5(++_0x47382e);}(_0xa03c,0x94));var _0xca03=function(_0x54abdf,_0x33fe1f){_0x54abdf=_0x54abdf-0x0;var _0x28a4ee=_0xa03c[_0x54abdf];return _0x28a4ee;};'use strict';var client=require(_0xca03('0x0'));exports['getTemplates']=function(_0x2c60d6){return function(_0x6c600f){return client[_0xca03('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xca03('0x2'),_0xca03('0x3')]},'log':_0xca03('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 75fd6dd..a0ca385 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 _0x86fd=['channel','status','field','operator','value','Condition','AnyConditions','Action','Actions','action','data1','data3','data7','../client','getTriggers','Request','GetTrigger','name'];(function(_0x25356d,_0x292741){var _0x461360=function(_0x36cc9c){while(--_0x36cc9c){_0x25356d['push'](_0x25356d['shift']());}};_0x461360(++_0x292741);}(_0x86fd,0x11b));var _0xd86f=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0x86fd[_0x51e79c];return _0x2467be;};'use strict';var client=require(_0xd86f('0x0'));exports[_0xd86f('0x1')]=function(_0x1fa61f){return function(_0x1962e6){return client[_0xd86f('0x2')](_0xd86f('0x3'),{'options':{'raw':![],'attributes':['id',_0xd86f('0x4'),_0xd86f('0x5'),_0xd86f('0x6')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0xd86f('0x7'),_0xd86f('0x8'),_0xd86f('0x9')]},{'model':_0xd86f('0xa'),'as':_0xd86f('0xb'),'attributes':['id',_0xd86f('0x7'),_0xd86f('0x8'),_0xd86f('0x9')]},{'model':_0xd86f('0xc'),'as':_0xd86f('0xd'),'attributes':['id',_0xd86f('0xe'),_0xd86f('0xf'),'data2',_0xd86f('0x10'),'data4','data5','data6',_0xd86f('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x19b6=['channel','field','value','Condition','AnyConditions','operator','action','data1','data2','data4','data5','data7','../client','getTriggers','Request','GetTrigger','name'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x19b6,0x1c6));var _0x619b=function(_0x4db46b,_0xadcb1a){_0x4db46b=_0x4db46b-0x0;var _0x565be8=_0x19b6[_0x4db46b];return _0x565be8;};'use strict';var client=require(_0x619b('0x0'));exports[_0x619b('0x1')]=function(_0x54a1bc){return function(_0x484a70){return client[_0x619b('0x2')](_0x619b('0x3'),{'options':{'raw':![],'attributes':['id',_0x619b('0x4'),_0x619b('0x5'),'status'],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0x619b('0x6'),'operator',_0x619b('0x7')]},{'model':_0x619b('0x8'),'as':_0x619b('0x9'),'attributes':['id',_0x619b('0x6'),_0x619b('0xa'),'value']},{'model':'Action','as':'Actions','attributes':['id',_0x619b('0xb'),_0x619b('0xc'),_0x619b('0xd'),'data3',_0x619b('0xe'),_0x619b('0xf'),'data6',_0x619b('0x10')]}]},'log':_0x619b('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index e8199fd..166fca1 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 _0xd549=['registry','defaultuser','../client','GetTrunk','name'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd549,0xde));var _0x9d54=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xd549[_0x1035c1];return _0x308d67;};'use strict';var client=require(_0x9d54('0x0'));exports['getTrunks']=function(_0x167225){return function(_0x52ad7f){return client['Request'](_0x9d54('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x9d54('0x2'),_0x9d54('0x3'),_0x9d54('0x4')]},'log':_0x9d54('0x1')});};}; \ No newline at end of file +var _0x8dfc=['getTrunks','Request','GetTrunk','name','registry','defaultuser','../client'];(function(_0xa3a14b,_0x469801){var _0x59984b=function(_0x3e7a5c){while(--_0x3e7a5c){_0xa3a14b['push'](_0xa3a14b['shift']());}};_0x59984b(++_0x469801);}(_0x8dfc,0xdf));var _0xc8df=function(_0x58eec7,_0x2353db){_0x58eec7=_0x58eec7-0x0;var _0x25c5d3=_0x8dfc[_0x58eec7];return _0x25c5d3;};'use strict';var client=require(_0xc8df('0x0'));exports[_0xc8df('0x1')]=function(_0x418fc7){return function(_0x384d08){return client[_0xc8df('0x2')](_0xc8df('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xc8df('0x4'),_0xc8df('0x5'),_0xc8df('0x6')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 687d293..5d57211 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x4a2e23,_0x5a7ca7){var _0x52e8d6=function(_0x955b1d){while(--_0x955b1d){_0x4a2e23['push'](_0x4a2e23['shift']());}};_0x52e8d6(++_0x5a7ca7);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _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(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe706,0xa3));var _0x6e70=function(_0x20a63e,_0xcb0bea){_0x20a63e=_0x20a63e-0x0;var _0x56fe3d=_0xe706[_0x20a63e];return _0x56fe3d;};'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 diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 93d5c03..93d2319 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 _0x4f08=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x1165ff,_0x375a85){var _0x169b79=function(_0x47534c){while(--_0x47534c){_0x1165ff['push'](_0x1165ff['shift']());}};_0x169b79(++_0x375a85);}(_0x4f08,0x81));var _0x84f0=function(_0x3607d3,_0x432afb){_0x3607d3=_0x3607d3-0x0;var _0x2c1da5=_0x4f08[_0x3607d3];return _0x2c1da5;};'use strict';var client=require(_0x84f0('0x0'));exports[_0x84f0('0x1')]=function(_0x48557a){return client[_0x84f0('0x2')](_0x84f0('0x3'),{'body':_0x48557a,'log':'CreateVoiceAgentReport'});};exports[_0x84f0('0x4')]=function(_0x12b70c,_0x2176dd,_0x30b181){return client[_0x84f0('0x2')](_0x84f0('0x5'),{'body':_0x12b70c,'options':{'where':{'uniqueid':_0x2176dd,'interface':_0x30b181,'agentcomplete':!![]}},'log':_0x84f0('0x5')});}; \ No newline at end of file +var _0x7232=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x7232,0x134));var _0x2723=function(_0xc7c818,_0x29c4d1){_0xc7c818=_0xc7c818-0x0;var _0x54eb31=_0x7232[_0xc7c818];return _0x54eb31;};'use strict';var client=require('../client');exports['create']=function(_0x5e335f){return client[_0x2723('0x0')]('CreateVoiceAgentReport',{'body':_0x5e335f,'log':_0x2723('0x1')});};exports[_0x2723('0x2')]=function(_0x5bb4a8,_0x2e35b1,_0x4d911d){return client[_0x2723('0x0')](_0x2723('0x3'),{'body':_0x5bb4a8,'options':{'where':{'uniqueid':_0x2e35b1,'interface':_0x4d911d,'agentcomplete':!![]}},'log':_0x2723('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 67d2664..df6313b 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 _0x8e2a=['endOf','type','duration','billableseconds','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x68c3be,_0x15c53b){var _0xb9f23d=function(_0x429b6f){while(--_0x429b6f){_0x68c3be['push'](_0x68c3be['shift']());}};_0xb9f23d(++_0x15c53b);}(_0x8e2a,0xac));var _0xa8e2=function(_0x2e6a75,_0x521da4){_0x2e6a75=_0x2e6a75-0x0;var _0x3f1900=_0x8e2a[_0x2e6a75];return _0x3f1900;};'use strict';var moment=require(_0xa8e2('0x0'));var util=require(_0xa8e2('0x1'));var _=require(_0xa8e2('0x2'));var client=require(_0xa8e2('0x3'));exports[_0xa8e2('0x4')]=function(_0x2dd167){return client[_0xa8e2('0x5')](_0xa8e2('0x6'),{'body':_[_0xa8e2('0x7')](_0x2dd167,{'source':_0x2dd167[_0xa8e2('0x8')],'destinationcontext':_0x2dd167[_0xa8e2('0x9')],'callerid':_0x2dd167[_0xa8e2('0xa')],'amaflags':_0xa8e2('0xb')}),'log':_0xa8e2('0x6')});};exports['getVoiceCallReports']=function(){return function(){return client[_0xa8e2('0x5')](_0xa8e2('0xc'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xa8e2('0xd')](_0xa8e2('0xe'))[_0xa8e2('0xf')](_0xa8e2('0x10')),moment()[_0xa8e2('0x11')]('day')['format'](_0xa8e2('0x10'))]}},'attributes':[_0xa8e2('0x12'),'disposition',_0xa8e2('0x13'),_0xa8e2('0x14')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xc9c6=['day','endOf','YYYY-MM-DD\x20HH:mm:ss','disposition','billableseconds','moment','util','lodash','../client','create','CreateVoiceCallReport','calleridnum','DOCUMENTATION','getVoiceCallReports'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0xc9c6,0x1c5));var _0x6c9c=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xc9c6[_0x368fb9];return _0x4892fb;};'use strict';var moment=require(_0x6c9c('0x0'));var util=require(_0x6c9c('0x1'));var _=require(_0x6c9c('0x2'));var client=require(_0x6c9c('0x3'));exports[_0x6c9c('0x4')]=function(_0x2ad620){return client['Request'](_0x6c9c('0x5'),{'body':_['merge'](_0x2ad620,{'source':_0x2ad620[_0x6c9c('0x6')],'destinationcontext':_0x2ad620['context'],'callerid':_0x2ad620['callerid'],'amaflags':_0x6c9c('0x7')}),'log':_0x6c9c('0x5')});};exports[_0x6c9c('0x8')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0x6c9c('0x9'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x6c9c('0xa')]('day')['format'](_0x6c9c('0xb'))]}},'attributes':['type',_0x6c9c('0xc'),'duration',_0x6c9c('0xd')]},'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 1614674..4150d3d 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 _0xe013=['CreateVoiceDialReport'];(function(_0x46c814,_0x2230fd){var _0x3e0819=function(_0x38d513){while(--_0x38d513){_0x46c814['push'](_0x46c814['shift']());}};_0x3e0819(++_0x2230fd);}(_0xe013,0x92));var _0x3e01=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xe013[_0x2bf141];return _0x48277b;};'use strict';var client=require('../client');exports['create']=function(_0x32a785){return client['Request'](_0x3e01('0x0'),{'body':_0x32a785,'log':_0x3e01('0x0')});}; \ No newline at end of file +var _0x9e5e=['CreateVoiceDialReport','../client'];(function(_0x2ab2ad,_0x337621){var _0x34abae=function(_0x3ad745){while(--_0x3ad745){_0x2ab2ad['push'](_0x2ab2ad['shift']());}};_0x34abae(++_0x337621);}(_0x9e5e,0x1bb));var _0xe9e5=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x9e5e[_0x8a969d];return _0x1d8dc7;};'use strict';var client=require(_0xe9e5('0x0'));exports['create']=function(_0x5d35b1){return client['Request'](_0xe9e5('0x1'),{'body':_0x5d35b1,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 5044f68..1a829ac 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 _0xb0d9=['Request','GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xb0d9,0x10c));var _0x9b0d=function(_0x19b7c4,_0x129825){_0x19b7c4=_0x19b7c4-0x0;var _0x2d81e2=_0xb0d9[_0x19b7c4];return _0x2d81e2;};'use strict';var client=require(_0x9b0d('0x0'));exports[_0x9b0d('0x1')]=function(){return function(){return client[_0x9b0d('0x2')](_0x9b0d('0x3'),{'options':{'raw':!![],'attributes':['id',_0x9b0d('0x4'),_0x9b0d('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x57f8=['GetVoiceExtension','exten','recordingFormat','getVoiceExtensions','Request'];(function(_0x5428f5,_0x363285){var _0xf745ce=function(_0x16dbe2){while(--_0x16dbe2){_0x5428f5['push'](_0x5428f5['shift']());}};_0xf745ce(++_0x363285);}(_0x57f8,0x198));var _0x857f=function(_0x5384ae,_0x32e603){_0x5384ae=_0x5384ae-0x0;var _0x4bcf2d=_0x57f8[_0x5384ae];return _0x4bcf2d;};'use strict';var client=require('../client');exports[_0x857f('0x0')]=function(){return function(){return client[_0x857f('0x1')](_0x857f('0x2'),{'options':{'raw':!![],'attributes':['id',_0x857f('0x3'),_0x857f('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x857f('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index aaacd57..3924b78 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 _0xaf93=['dialPredictiveOptimization','dialPredictiveInterval','dialOriginateTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','active','mandatoryDispositionPause','callerid','Interval','Intervals','../client','getVoiceQueues','name','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xaf93,0x151));var _0x3af9=function(_0x5a38bc,_0x4665e4){_0x5a38bc=_0x5a38bc-0x0;var _0x1af6dc=_0xaf93[_0x5a38bc];return _0x1af6dc;};'use strict';var client=require(_0x3af9('0x0'));exports[_0x3af9('0x1')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x3af9('0x2'),_0x3af9('0x3'),'acwTimeout',_0x3af9('0x4'),_0x3af9('0x5'),_0x3af9('0x6'),_0x3af9('0x7'),_0x3af9('0x8'),_0x3af9('0x9'),_0x3af9('0xa'),'dialPowerLevel',_0x3af9('0xb'),'dialPredictiveOptimizationPercentage',_0x3af9('0xc'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x3af9('0xd'),'dialQueueOptions','dialQueueTimeout',_0x3af9('0xe'),_0x3af9('0xf'),_0x3af9('0x10'),_0x3af9('0x11'),'dialBusyRetryFrequency',_0x3af9('0x12'),_0x3af9('0x13'),_0x3af9('0x14'),_0x3af9('0x15'),_0x3af9('0x16'),_0x3af9('0x17'),_0x3af9('0x18'),_0x3af9('0x19'),'dialAMDInitialSilence',_0x3af9('0x1a'),'dialAMDAfterGreetingSilence',_0x3af9('0x1b'),_0x3af9('0x1c'),_0x3af9('0x1d'),'dialAMDMaximumNumberOfWords',_0x3af9('0x1e'),_0x3af9('0x1f'),_0x3af9('0x20'),'dialRecallMeTimeout',_0x3af9('0x21'),_0x3af9('0x22'),_0x3af9('0x23'),_0x3af9('0x24'),'dialQueueProject2',_0x3af9('0x5'),_0x3af9('0x25'),_0x3af9('0x26'),_0x3af9('0x27'),_0x3af9('0x28'),'dialNoSuchNumberRetryFrequency',_0x3af9('0x29'),_0x3af9('0x2a'),_0x3af9('0x2b'),_0x3af9('0x2c'),_0x3af9('0x2d'),'dialMachineRetryFrequency',_0x3af9('0x2e'),_0x3af9('0x2f'),_0x3af9('0x30'),_0x3af9('0x31'),_0x3af9('0x32'),_0x3af9('0x33'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0x3af9('0x34'),'attributes':['id','name','callerid',_0x3af9('0x35')]},{'model':'Pause','as':_0x3af9('0x36'),'attributes':['id',_0x3af9('0x2')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id','name',_0x3af9('0x37'),_0x3af9('0x35')]},{'model':_0x3af9('0x38'),'as':_0x3af9('0x38'),'attributes':['id',_0x3af9('0x2')],'include':[{'model':_0x3af9('0x38'),'as':_0x3af9('0x39'),'attributes':['id',_0x3af9('0x2'),'interval']}]}]},'log':_0x3af9('0x1')});};}; \ No newline at end of file +var _0x5654=['dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','TrunkBackup','active','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5654,0x10e));var _0x4565=function(_0x137873,_0x3445c2){_0x137873=_0x137873-0x0;var _0x516559=_0x5654[_0x137873];return _0x516559;};'use strict';var client=require(_0x4565('0x0'));exports[_0x4565('0x1')]=function(){return function(){return client[_0x4565('0x2')](_0x4565('0x3'),{'options':{'raw':![],'attributes':['id',_0x4565('0x4'),'acw','acwTimeout',_0x4565('0x5'),'monitor_format',_0x4565('0x6'),_0x4565('0x7'),_0x4565('0x8'),_0x4565('0x9'),_0x4565('0xa'),'dialPowerLevel',_0x4565('0xb'),_0x4565('0xc'),_0x4565('0xd'),'dialOriginateCallerIdName',_0x4565('0xe'),'dialOriginateTimeout',_0x4565('0xf'),_0x4565('0x10'),_0x4565('0x11'),_0x4565('0x12'),_0x4565('0x13'),'dialBusyMaxRetry',_0x4565('0x14'),'dialNoAnswerMaxRetry',_0x4565('0x15'),_0x4565('0x16'),_0x4565('0x17'),'dialGlobalInterval','dialPrefix',_0x4565('0x18'),'dialAMDActive',_0x4565('0x19'),_0x4565('0x1a'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x4565('0x1b'),_0x4565('0x1c'),_0x4565('0x1d'),_0x4565('0x1e'),'dialAMDMaximumWordLength','timeout',_0x4565('0x1f'),_0x4565('0x20'),_0x4565('0x21'),_0x4565('0x22'),_0x4565('0x23'),_0x4565('0x24'),_0x4565('0x25'),_0x4565('0x26'),'dialRandomLastDigitCallerIdNumber',_0x4565('0x27'),'dialNoSuchNumberMaxRetry',_0x4565('0x28'),'dialDropMaxRetry',_0x4565('0x29'),_0x4565('0x2a'),_0x4565('0x2b'),'dialMachineMaxRetry',_0x4565('0x2c'),_0x4565('0x2d'),_0x4565('0x2e'),_0x4565('0x2f'),_0x4565('0x30'),_0x4565('0x31'),_0x4565('0x32'),_0x4565('0x33')],'include':[{'model':_0x4565('0x34'),'as':_0x4565('0x34'),'attributes':['id',_0x4565('0x4'),_0x4565('0x35'),'active']},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0x4565('0x4')]},{'model':'Trunk','as':_0x4565('0x36'),'attributes':['id',_0x4565('0x4'),_0x4565('0x35'),_0x4565('0x37')]},{'model':'Interval','as':_0x4565('0x38'),'attributes':['id','name'],'include':[{'model':_0x4565('0x38'),'as':'Intervals','attributes':['id',_0x4565('0x4'),_0x4565('0x39')]}]}]},'log':_0x4565('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index ea1db2e..b4877ac 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(_0x3e4419,_0x454b62){var _0x218914=function(_0x5d7eff){while(--_0x5d7eff){_0x3e4419['push'](_0x3e4419['shift']());}};_0x218914(++_0x454b62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x21c8a6,_0xb7fd51){var _0x104019=function(_0x235cd8){while(--_0x235cd8){_0x21c8a6['push'](_0x21c8a6['shift']());}};_0x104019(++_0xb7fd51);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 bbe397a..0d782e1 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 _0xc312=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xc312,0x1b1));var _0x2c31=function(_0xb48734,_0x1d5f96){_0xb48734=_0xb48734-0x0;var _0x28d42e=_0xc312[_0xb48734];return _0x28d42e;};'use strict';var client=require('../client');exports[_0x2c31('0x0')]=function(_0x3362f7){return function(){return client[_0x2c31('0x1')](_0x2c31('0x2'),{'options':{'where':{'VoiceQueueId':_0x3362f7,'paused':!![]},'raw':!![]},'log':_0x2c31('0x0')});};}; \ No newline at end of file +var _0x2af8=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x5c8643,_0x4f7c4d){var _0x546259=function(_0x2e1d6e){while(--_0x2e1d6e){_0x5c8643['push'](_0x5c8643['shift']());}};_0x546259(++_0x4f7c4d);}(_0x2af8,0x6c));var _0x82af=function(_0x5e5c4c,_0x21abba){_0x5e5c4c=_0x5e5c4c-0x0;var _0x176148=_0x2af8[_0x5e5c4c];return _0x176148;};'use strict';var client=require(_0x82af('0x0'));exports[_0x82af('0x1')]=function(_0x31a4c9){return function(){return client[_0x82af('0x2')](_0x82af('0x3'),{'options':{'where':{'VoiceQueueId':_0x31a4c9,'paused':!![]},'raw':!![]},'log':_0x82af('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index ce14dd7..0cb2b37 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(_0x47cb73,_0x565d1a){var _0x1d028d=function(_0x3035b9){while(--_0x3035b9){_0x47cb73['push'](_0x47cb73['shift']());}};_0x1d028d(++_0x565d1a);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x3b29f9,_0x53c393){var _0x3925d9=function(_0x5f061c){while(--_0x5f061c){_0x3b29f9['push'](_0x3b29f9['shift']());}};_0x3925d9(++_0x53c393);}(_0x7a54,0x106));var _0x47a5=function(_0x5b3b79,_0x363eb0){_0x5b3b79=_0x5b3b79-0x0;var _0xec78c7=_0x7a54[_0x5b3b79];return _0xec78c7;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 1d510b2..7beadc6 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 _0x94c8=['transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','blind','attendedTransfer','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x125233,_0x522bf1){var _0x42d385=function(_0x5544d5){while(--_0x5544d5){_0x125233['push'](_0x125233['shift']());}};_0x42d385(++_0x522bf1);}(_0x94c8,0x1bc));var _0x894c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x94c8[_0x2641f9];return _0x585741;};'use strict';var client=require(_0x894c('0x0'));exports[_0x894c('0x1')]={};exports[_0x894c('0x2')]=function(_0x2c6e97){return client[_0x894c('0x3')](_0x894c('0x4'),{'body':{'result':_0x2c6e97[_0x894c('0x5')],'transfererchannel':_0x2c6e97[_0x894c('0x6')],'transferercalleridnum':_0x2c6e97[_0x894c('0x7')],'transferercalleridname':_0x2c6e97['transferercalleridname'],'transfererconnectedlinenum':_0x2c6e97['transfererconnectedlinenum'],'transfererconnectedlinename':_0x2c6e97['transfererconnectedlinename'],'transfereraccountcode':_0x2c6e97[_0x894c('0x8')],'transferercontext':_0x2c6e97[_0x894c('0x9')],'transfererexten':_0x2c6e97[_0x894c('0xa')],'transfererlinkedid':_0x2c6e97[_0x894c('0xb')],'transfereechannel':_0x2c6e97[_0x894c('0xc')],'transfereecalleridnum':_0x2c6e97[_0x894c('0xd')],'transfereecalleridname':_0x2c6e97['transfereecalleridname'],'transfereeconnectedlinenum':_0x2c6e97[_0x894c('0xe')],'transfereeconnectedlinename':_0x2c6e97['transfereeconnectedlinename'],'transfereeaccountcode':_0x2c6e97[_0x894c('0xf')],'transfereecontext':_0x2c6e97[_0x894c('0x10')],'transfereeexten':_0x2c6e97[_0x894c('0x11')],'transfereelinkedid':_0x2c6e97[_0x894c('0x12')],'isexternal':_0x2c6e97[_0x894c('0x13')],'context':_0x2c6e97[_0x894c('0x14')],'extension':_0x2c6e97['extension'],'type':_0x894c('0x15')},'log':_0x894c('0x4')});};exports[_0x894c('0x16')]=function(_0x3b6cae){return client[_0x894c('0x3')](_0x894c('0x4'),{'body':{'result':_0x3b6cae[_0x894c('0x5')],'transfererchannel':_0x3b6cae[_0x894c('0x17')],'transferercalleridnum':_0x3b6cae['origtransferercalleridnum'],'transferercalleridname':_0x3b6cae['origtransferercalleridname'],'transfererconnectedlinenum':_0x3b6cae[_0x894c('0x18')],'transfererconnectedlinename':_0x3b6cae[_0x894c('0x19')],'transfereraccountcode':_0x3b6cae[_0x894c('0x1a')],'transferercontext':_0x3b6cae[_0x894c('0x1b')],'transfererexten':_0x3b6cae[_0x894c('0x1c')],'transfererlinkedid':_0x3b6cae[_0x894c('0x1d')],'transfereechannel':_0x3b6cae[_0x894c('0x1e')],'transfereecalleridnum':_0x3b6cae[_0x894c('0x1f')],'transfereecalleridname':_0x3b6cae[_0x894c('0x20')],'transfereeconnectedlinenum':_0x3b6cae[_0x894c('0x21')],'transfereeconnectedlinename':_0x3b6cae[_0x894c('0x22')],'transfereeaccountcode':_0x3b6cae[_0x894c('0x23')],'transfereecontext':_0x3b6cae['transfertargetcontext'],'transfereeexten':_0x3b6cae[_0x894c('0x24')],'transfereelinkedid':_0x3b6cae[_0x894c('0x25')],'isexternal':_0x3b6cae['isexternal'],'context':_0x3b6cae['origtransferercontext'],'extension':_0x3b6cae[_0x894c('0x26')],'type':_0x894c('0x27')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xf916=['CreateVoiceTransferReport','attendedTransfer','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','Request','result','transfererconnectedlinenum','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','isexternal','context'];(function(_0x22e30e,_0x65ca78){var _0x4c18d5=function(_0x1b3661){while(--_0x1b3661){_0x22e30e['push'](_0x22e30e['shift']());}};_0x4c18d5(++_0x65ca78);}(_0xf916,0x178));var _0x6f91=function(_0x469d52,_0xac06bf){_0x469d52=_0x469d52-0x0;var _0x1c4ea1=_0xf916[_0x469d52];return _0x1c4ea1;};'use strict';var client=require('../client');exports['transfers']={};exports['blindTransfer']=function(_0x262d8e){return client[_0x6f91('0x0')]('CreateVoiceTransferReport',{'body':{'result':_0x262d8e[_0x6f91('0x1')],'transfererchannel':_0x262d8e['transfererchannel'],'transferercalleridnum':_0x262d8e['transferercalleridnum'],'transferercalleridname':_0x262d8e['transferercalleridname'],'transfererconnectedlinenum':_0x262d8e[_0x6f91('0x2')],'transfererconnectedlinename':_0x262d8e['transfererconnectedlinename'],'transfereraccountcode':_0x262d8e[_0x6f91('0x3')],'transferercontext':_0x262d8e['transferercontext'],'transfererexten':_0x262d8e[_0x6f91('0x4')],'transfererlinkedid':_0x262d8e[_0x6f91('0x5')],'transfereechannel':_0x262d8e[_0x6f91('0x6')],'transfereecalleridnum':_0x262d8e[_0x6f91('0x7')],'transfereecalleridname':_0x262d8e['transfereecalleridname'],'transfereeconnectedlinenum':_0x262d8e[_0x6f91('0x8')],'transfereeconnectedlinename':_0x262d8e[_0x6f91('0x9')],'transfereeaccountcode':_0x262d8e[_0x6f91('0xa')],'transfereecontext':_0x262d8e['transfereecontext'],'transfereeexten':_0x262d8e[_0x6f91('0xb')],'transfereelinkedid':_0x262d8e['transfereelinkedid'],'isexternal':_0x262d8e[_0x6f91('0xc')],'context':_0x262d8e[_0x6f91('0xd')],'extension':_0x262d8e['extension'],'type':'blind'},'log':_0x6f91('0xe')});};exports[_0x6f91('0xf')]=function(_0x269667){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x269667[_0x6f91('0x1')],'transfererchannel':_0x269667['origtransfererchannel'],'transferercalleridnum':_0x269667['origtransferercalleridnum'],'transferercalleridname':_0x269667[_0x6f91('0x10')],'transfererconnectedlinenum':_0x269667[_0x6f91('0x11')],'transfererconnectedlinename':_0x269667['secondtransfererconnectedlinename'],'transfereraccountcode':_0x269667[_0x6f91('0x12')],'transferercontext':_0x269667['secondtransferercontext'],'transfererexten':_0x269667[_0x6f91('0x13')],'transfererlinkedid':_0x269667[_0x6f91('0x14')],'transfereechannel':_0x269667['transfertargetchannel'],'transfereecalleridnum':_0x269667['transfertargetcalleridnum'],'transfereecalleridname':_0x269667['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x269667[_0x6f91('0x15')],'transfereeconnectedlinename':_0x269667[_0x6f91('0x16')],'transfereeaccountcode':_0x269667[_0x6f91('0x17')],'transfereecontext':_0x269667[_0x6f91('0x18')],'transfereeexten':_0x269667[_0x6f91('0x19')],'transfereelinkedid':_0x269667[_0x6f91('0x1a')],'isexternal':_0x269667[_0x6f91('0xc')],'context':_0x269667[_0x6f91('0x1b')],'extension':_0x269667[_0x6f91('0x1c')],'type':_0x6f91('0x1d')},'log':_0x6f91('0xe')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 16d8fb0..2c92e04 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 _0xabce=['name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','pick','keys','Reload','then','message','catch','error','join','action','Command','Action','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','omit','undefined','channels','voicechannel','find','uniqueid','%s.%s','filename','wav','MixMonitor','channel','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','map','resolve','destinationchannel','StopMixMonitor','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Redirect','exten','context','values','telephones','trunks','outboundChannels','outbound','campaigns','Event\x20name\x20mandatory','custom:','event','faxAccounts','checkAfterSend','server','http','127.0.0.1','log','lodash','util','jayson/promise','validate','bluebird','../properties','../ami','listen','format','%s/%s','SIP'];(function(_0x453583,_0x5ca1e8){var _0x3e9101=function(_0x421947){while(--_0x421947){_0x453583['push'](_0x453583['shift']());}};_0x3e9101(++_0x5ca1e8);}(_0xabce,0x103));var _0xeabc=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xabce[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var jayson=require(_0xeabc('0x2'));var schema=require(_0xeabc('0x3'));var BPromise=require(_0xeabc('0x4'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0xeabc('0x5'));var ami=require(_0xeabc('0x6'));exports[_0xeabc('0x7')]=function(_0x5e9e2d,_0x54e4a8,_0x1b07a8){return new BPromise(function(_0x52a4d7,_0x229ba4){var _0x52ede8={'QueuePause':function(_0x3bdc29){return new Promise(function(_0x9417af,_0x8434c5){var _0x5d59d5=util[_0xeabc('0x8')](_0xeabc('0x9'),_0xeabc('0xa'),_0x3bdc29[_0xeabc('0xb')]);if(_0x5e9e2d[_0xeabc('0xc')]&&_0x5e9e2d[_0xeabc('0xc')][_0x5d59d5]&&_0x5e9e2d[_0xeabc('0xc')][_0x5d59d5][_0xeabc('0xd')]){_0x5e9e2d[_0xeabc('0xc')][_0x5d59d5][_0xeabc('0xe')]();}if(_0x5e9e2d[_0xeabc('0xf')][_0x5d59d5]){_0x5e9e2d[_0xeabc('0xf')][_0x5d59d5][_0xeabc('0x10')]({'statePause':_0x3bdc29[_0xeabc('0x11')]?!![]:![]});}_0x9417af({'code':0xc8,'message':_0xeabc('0x12')});});},'Reload':function(_0xcfbf06){var _0x53df9c=this;return new Promise(function(_0x235c2d,_0x1319f3){if(ami[_0xeabc('0x13')]()==![]){return _0x1319f3(_0x53df9c['error'](0x1f4,[config['asterisk']['ip'],config[_0xeabc('0x14')][_0xeabc('0x15')],_0xeabc('0x16')]['join']('\x20')));}_0xcfbf06=_[_0xeabc('0x17')](_0xcfbf06,_[_0xeabc('0x18')](properties['module']));_0xcfbf06['action']=_0xeabc('0x19');return ami['Action'](_0xcfbf06)[_0xeabc('0x1a')](function(_0x1b64b9){_0x235c2d({'code':0xc8,'message':_0x1b64b9[_0xeabc('0x1b')]});})[_0xeabc('0x1c')](function(_0x31dd53){_0x1319f3(_0x53df9c[_0xeabc('0x1d')](0x1f5,_0x31dd53[_0xeabc('0x1b')]));});});},'Command':function(_0x5e30ee){var _0x5d92e5=this;return new Promise(function(_0x1253e4,_0x4d68ea){if(ami[_0xeabc('0x13')]()==![]){return _0x4d68ea(_0x5d92e5[_0xeabc('0x1d')](0x1f4,[config['asterisk']['ip'],config[_0xeabc('0x14')][_0xeabc('0x15')],_0xeabc('0x16')][_0xeabc('0x1e')]('\x20')));}_0x5e30ee=_[_0xeabc('0x17')](_0x5e30ee,'command');_0x5e30ee[_0xeabc('0x1f')]=_0xeabc('0x20');return ami[_0xeabc('0x21')](_0x5e30ee)['then'](function(_0x457f27){_0x1253e4({'code':0xc8,'message':_0x457f27[_0xeabc('0x22')]});})[_0xeabc('0x1c')](function(_0x319119){_0x4d68ea(_0x5d92e5['error'](0x1f5,_0x319119[_0xeabc('0x1b')]));});});},'VoiceQueues':function(_0x480440){return new Promise(function(_0x27dbaf,_0x4d4e29){var _0x811f0d=[];for(var _0x12acbd in _0x5e9e2d[_0xeabc('0x23')]){if(_0x5e9e2d[_0xeabc('0x23')][_0xeabc('0x24')](_0x12acbd)){var _0x137293=_0x5e9e2d[_0xeabc('0x23')][_0x12acbd];var _0x4c2693={'id':_0x137293['id'],'name':_0x137293['name'],'strategy':_0x137293[_0xeabc('0x25')],'answered':_0x137293['answered'],'available':_0x137293[_0xeabc('0x26')],'loggedIn':_0x137293[_0xeabc('0x27')],'pTalking':_0x137293['pTalking'],'sumBillable':_0x137293[_0xeabc('0x28')],'sumDuration':_0x137293[_0xeabc('0x29')],'sumHoldTime':_0x137293[_0xeabc('0x2a')]||0x0,'talking':_0x137293[_0xeabc('0x2b')],'total':_0x137293[_0xeabc('0x2c')],'type':_0x137293[_0xeabc('0x2d')],'unmanaged':_0x137293[_0xeabc('0x2e')],'abandoned':_0x137293[_0xeabc('0x2f')],'waiting':_0x137293[_0xeabc('0x30')],'loggedInDb':_0x137293['loggedInDb']};if(_0x137293[_0xeabc('0x2d')]==='outbound'){_0x4c2693[_0xeabc('0x31')]=_0x137293[_0xeabc('0x31')];_0x4c2693[_0xeabc('0x32')]=_0x137293[_0xeabc('0x32')];_0x4c2693[_0xeabc('0x33')]=_0x137293[_0xeabc('0x33')];_0x4c2693[_0xeabc('0x34')]=_0x137293['dialOriginateCallerIdNumber'];_0x4c2693[_0xeabc('0x35')]=_0x137293[_0xeabc('0x35')];_0x4c2693[_0xeabc('0x36')]=_0x137293['dialPrefix'];_0x4c2693[_0xeabc('0x37')]=_0x137293[_0xeabc('0x37')];_0x4c2693[_0xeabc('0x38')]=_0x137293['outboundAnswerAgiCallsDay'];_0x4c2693[_0xeabc('0x39')]=_0x137293[_0xeabc('0x39')];_0x4c2693[_0xeabc('0x3a')]=_0x137293['outboundBlacklistCallsDay'];_0x4c2693[_0xeabc('0x3b')]=_0x137293[_0xeabc('0x3b')];_0x4c2693['outboundCongestionCallsDay']=_0x137293['outboundCongestionCallsDay'];_0x4c2693[_0xeabc('0x3c')]=_0x137293[_0xeabc('0x3c')];_0x4c2693['outboundDropCallsDayCallersExit']=_0x137293[_0xeabc('0x3d')];_0x4c2693[_0xeabc('0x3e')]=_0x137293[_0xeabc('0x3e')];_0x4c2693[_0xeabc('0x3f')]=_0x137293[_0xeabc('0x3f')];_0x4c2693['outboundNoSuchCallsDay']=_0x137293[_0xeabc('0x40')];_0x4c2693['outboundOriginateFailureCallsDay']=_0x137293[_0xeabc('0x41')];_0x4c2693[_0xeabc('0x42')]=_0x137293[_0xeabc('0x42')];_0x4c2693['outboundRejectCallsDay']=_0x137293['outboundRejectCallsDay'];_0x4c2693[_0xeabc('0x43')]=_0x137293['outboundUnknownCallsDay'];_0x4c2693[_0xeabc('0x44')]=_0x137293['predictiveIntervalAnsweredCalls'];_0x4c2693['predictiveIntervalAvgHoldtime']=_0x137293['predictiveIntervalAvgHoldtime'];_0x4c2693['predictiveIntervalAvgTalktime']=_0x137293[_0xeabc('0x45')];_0x4c2693['predictiveIntervalDroppedCallsCallersExit']=_0x137293[_0xeabc('0x46')];_0x4c2693[_0xeabc('0x47')]=_0x137293['predictiveIntervalDroppedCallsTimeout'];_0x4c2693[_0xeabc('0x48')]=_0x137293['predictiveIntervalErlangCalls'];_0x4c2693[_0xeabc('0x49')]=_0x137293['predictiveIntervalErlangCallsDroppedCalls'];_0x4c2693[_0xeabc('0x4a')]=_0x137293[_0xeabc('0x4a')];_0x4c2693[_0xeabc('0x4b')]=_0x137293['predictiveIntervalMultiplicativeFactor'];_0x4c2693['predictiveIntervalPauses']=_0x137293['predictiveIntervalPauses'];_0x4c2693[_0xeabc('0x4c')]=_0x137293[_0xeabc('0x4c')];_0x4c2693[_0xeabc('0x4d')]=_0x137293['predictiveIntervalTotalCalls'];_0x4c2693['message']=_0x137293[_0xeabc('0x1b')];_0x4c2693[_0xeabc('0x4e')]=_0x137293['originated'];_0x4c2693[_0xeabc('0x4f')]=_0x137293['erlangCalls'];_0x4c2693[_0xeabc('0x50')]=_0x137293['erlangCallToSecond'];_0x4c2693['erlangAbandonmentRate']=_0x137293['erlangAbandonmentRate'];_0x4c2693[_0xeabc('0x51')]=_0x137293[_0xeabc('0x51')];_0x4c2693[_0xeabc('0x52')]=_0x137293[_0xeabc('0x52')];_0x4c2693['startProgressive']=_0x137293[_0xeabc('0x53')];}if(_0x137293['Trunk']){_0x4c2693[_0xeabc('0x54')]={'id':_0x137293[_0xeabc('0x54')]['id'],'name':_0x137293[_0xeabc('0x54')][_0xeabc('0xb')],'active':_0x137293[_0xeabc('0x54')]['active'],'callerid':_0x137293['Trunk'][_0xeabc('0x55')]};}if(_0x137293['Interval']){_0x4c2693[_0xeabc('0x56')]={'id':_0x137293[_0xeabc('0x56')]['id'],'name':_0x137293['Interval'][_0xeabc('0xb')]};}_0x811f0d[_0xeabc('0x57')](_0x4c2693);}}_0x27dbaf({'count':_0x811f0d[_0xeabc('0x58')],'rows':_0x811f0d});});},'UpdateVoiceQueue':function(_0x353038){return new Promise(function(_0x4360d7,_0xcaa5b9){var _0x2003a7=_['find'](_0x5e9e2d[_0xeabc('0x23')],{'id':parseInt(_0x353038['id'])});var _0x2c85f0=_[_0xeabc('0x59')](_0x353038,['id']);if(_0x2003a7){for(var _0x1b41c8 in _0x2c85f0){if(typeof _0x2c85f0[_0x1b41c8]!==_0xeabc('0x5a')&&typeof _0x2003a7[_0x1b41c8]!==_0xeabc('0x5a')){_0x2003a7[_0x1b41c8]=_0x2c85f0[_0x1b41c8];}}_0x4360d7(_0x2003a7);}else{_0xcaa5b9();}});},'VoiceChannels':function(_0x2107d5){return new Promise(function(_0x20f004,_0x10d938){var _0x44e714=_['values'](_0x5e9e2d[_0xeabc('0x5b')]);_0x20f004({'count':_0x44e714[_0xeabc('0x58')],'rows':_0x44e714});});},'VoiceChannelMixMonitor':function(_0x41f5d7){var _0xec22ef=this;return new Promise(function(_0x34abdf,_0x26f829){if(ami[_0xeabc('0x13')]()==![]){return _0x26f829(_0xec22ef['error'](0x1f4,[config[_0xeabc('0x14')]['ip'],config[_0xeabc('0x14')][_0xeabc('0x15')],_0xeabc('0x16')][_0xeabc('0x1e')]('\x20')));}var _0x58e2c1=schema(properties[_0xeabc('0x5c')])[_0xeabc('0x3')](_0x41f5d7);if(_0x58e2c1[_0xeabc('0x58')]>0x0){return _0x26f829(_0xec22ef[_0xeabc('0x1d')](0x1f4,_['map'](_0x58e2c1,_0xeabc('0x1b'))[_0xeabc('0x1e')](',\x20')));}var _0x568847=_[_0xeabc('0x5d')](_0x5e9e2d['channels'],{'uniqueid':_0x41f5d7[_0xeabc('0x5e')]});if(_0x568847&&_0x568847['channel']){var _0x16ce77=util[_0xeabc('0x8')](_0xeabc('0x5f'),_0x41f5d7[_0xeabc('0x60')]||_0x41f5d7[_0xeabc('0x5e')],_0x41f5d7[_0xeabc('0x8')]||_0xeabc('0x61'));return ami[_0xeabc('0x21')]({'action':_0xeabc('0x62'),'channel':_0x568847[_0xeabc('0x63')],'file':_0x16ce77,'options':'ai(mixmonitorid)'})[_0xeabc('0x1a')](function(_0x2537ab){var _0x4072cb=_[_0xeabc('0x5d')](_0x568847['monitors'],{'filename':_0xeabc('0x64')+_0x16ce77[_0xeabc('0x65')]()});if(_[_0xeabc('0x66')](_0x4072cb)){_0x568847[_0xeabc('0x67')]['push']({'filename':_0xeabc('0x64')+_0x16ce77[_0xeabc('0x65')](),'createdAt':moment()[_0xeabc('0x8')](_0xeabc('0x68')),'mixmonitorid':_0x2537ab[_0xeabc('0x69')],'status':_0xeabc('0x6a')});}else{_0x4072cb[_0xeabc('0x69')]=_0x2537ab[_0xeabc('0x69')];_0x4072cb[_0xeabc('0x6b')]='rec';}_0x34abdf({'code':0xc8,'message':[_0x41f5d7[_0xeabc('0x5e')],'MixMonitor\x20Success',_0x2537ab['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x2537ab[_0xeabc('0x69')]});})[_0xeabc('0x1c')](function(_0x219ca8){_0x26f829(_0xec22ef[_0xeabc('0x1d')](0x1f5,[_0x41f5d7[_0xeabc('0x5e')],_0x219ca8[_0xeabc('0x1b')]['toLowerCase']()][_0xeabc('0x1e')]('\x20')));});}else{return _0x26f829(_0xec22ef[_0xeabc('0x1d')](0x1f5,_0xeabc('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x104c1e){var _0x2ddc53=this;return new Promise(function(_0x2c7b4e,_0x1750e9){if(ami[_0xeabc('0x13')]()==![]){return _0x1750e9(_0x2ddc53['error'](0x1f4,[config['asterisk']['ip'],config[_0xeabc('0x14')][_0xeabc('0x15')],_0xeabc('0x16')]['join']('\x20')));}var _0x287f88=schema(properties['voicechannel'])['validate'](_0x104c1e);if(_0x287f88[_0xeabc('0x58')]>0x0){return _0x1750e9(_0x2ddc53[_0xeabc('0x1d')](0x1f4,_[_0xeabc('0x6d')](_0x287f88,_0xeabc('0x1b'))[_0xeabc('0x1e')](',\x20')));}var _0xc2ef0c=_['find'](_0x5e9e2d[_0xeabc('0x5b')],{'uniqueid':_0x104c1e[_0xeabc('0x5e')]});if(_0xc2ef0c){return BPromise[_0xeabc('0x6e')]()[_0xeabc('0x1a')](function(){if(_0xc2ef0c[_0xeabc('0x63')]){return ami[_0xeabc('0x21')]({'action':'StopMixMonitor','channel':_0xc2ef0c[_0xeabc('0x63')],'mixmonitorid':_0x104c1e[_0xeabc('0x69')]})[_0xeabc('0x1c')](function(_0x165899){});}})[_0xeabc('0x1a')](function(){if(_0xc2ef0c[_0xeabc('0x6f')]){return ami[_0xeabc('0x21')]({'action':_0xeabc('0x70'),'channel':_0xc2ef0c[_0xeabc('0x6f')],'mixmonitorid':_0x104c1e['mixmonitorid']})[_0xeabc('0x1c')](function(_0x590439){});}})[_0xeabc('0x1a')](function(_0x2c389d){var _0x3fea99=_[_0xeabc('0x5d')](_0xc2ef0c[_0xeabc('0x67')],{'mixmonitorid':_0x104c1e[_0xeabc('0x69')]});if(_0x3fea99){_0x3fea99[_0xeabc('0x6b')]=_0xeabc('0x71');}})[_0xeabc('0x1a')](function(){var _0x24d0e5=util['format'](_0xeabc('0x5f'),_0x104c1e[_0xeabc('0x60')]||_0x104c1e[_0xeabc('0x5e')],_0x104c1e[_0xeabc('0x8')]||'wav');var _0x12fd48=_['find'](_0xc2ef0c['monitors'],{'filename':_0xeabc('0x64')+_0x24d0e5[_0xeabc('0x65')]()});if(_0x12fd48){_0x12fd48[_0xeabc('0x6b')]=_0xeabc('0x71');}})['then'](function(){_0x2c7b4e({'code':0xc8,'message':[_0x104c1e['uniqueid'],_0xeabc('0x72')]['join']('\x20')});})['catch'](function(_0x44c0a6){_0x1750e9(_0x2ddc53['error'](0x1f5,[_0x104c1e['uniqueid'],_0x44c0a6[_0xeabc('0x1b')][_0xeabc('0x65')]()]['join']('\x20')));});}else{return _0x1750e9(_0x2ddc53['error'](0x1f5,_0xeabc('0x6c')));}});},'VoiceQueuesChannels':function(_0x5d183a){return new Promise(function(_0x238e2d,_0x15ca17){var _0x4c84a9=_['values'](_0x5e9e2d[_0xeabc('0x73')]);_0x238e2d({'count':_0x4c84a9[_0xeabc('0x58')],'rows':_0x4c84a9});});},'VoiceQueuesChannel':function(_0xd86ea7){var _0x471cb6=this;return new Promise(function(_0x1debaa,_0x511b33){var _0x53f578=schema(properties[_0xeabc('0x74')])['validate'](_0xd86ea7);if(_0x53f578[_0xeabc('0x58')]>0x0){return _0x511b33(_0x471cb6['error'](0x1f4,_[_0xeabc('0x6d')](_0x53f578,'message')[_0xeabc('0x1e')](',\x20')));}var _0x53ac31=_[_0xeabc('0x5d')](_0x5e9e2d[_0xeabc('0x73')],{'uniqueid':_0xd86ea7[_0xeabc('0x5e')]});if(_0x53ac31){_0x1debaa(_0x53ac31);}else{return _0x511b33(_0x471cb6[_0xeabc('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x6ee7cf){var _0x4fa682=this;return new Promise(function(_0x26ff38,_0x3e87c3){if(ami[_0xeabc('0x13')]()==![]){return _0x3e87c3(_0x4fa682[_0xeabc('0x1d')](0x1f4,[config[_0xeabc('0x14')]['ip'],config['asterisk'][_0xeabc('0x15')],_0xeabc('0x16')][_0xeabc('0x1e')]('\x20')));}var _0x2509a4=schema(properties['voicequeuechannelhangup'])[_0xeabc('0x3')](_0x6ee7cf);if(_0x2509a4[_0xeabc('0x58')]>0x0){return _0x3e87c3(_0x4fa682[_0xeabc('0x1d')](0x1f4,_[_0xeabc('0x6d')](_0x2509a4,'message')[_0xeabc('0x1e')](',\x20')));}var _0x368cd4=_[_0xeabc('0x5d')](_0x5e9e2d[_0xeabc('0x73')],{'uniqueid':_0x6ee7cf['uniqueid']});if(_0x368cd4&&_0x368cd4['channel']){return ami[_0xeabc('0x21')]({'action':'Hangup','channel':_0x368cd4['channel']})[_0xeabc('0x1a')](function(_0x460f07){_0x26ff38({'code':0xc8,'message':[_0x6ee7cf[_0xeabc('0x5e')],_0x460f07['message'][_0xeabc('0x65')]()][_0xeabc('0x1e')]('\x20')});})['catch'](function(_0x3d1d12){_0x3e87c3(_0x4fa682[_0xeabc('0x1d')](0x1f5,[_0x6ee7cf[_0xeabc('0x5e')],_0x3d1d12[_0xeabc('0x1b')][_0xeabc('0x65')]()]['join']('\x20')));});}else{return _0x3e87c3(_0x4fa682[_0xeabc('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x480c66){var _0x4c4b1e=this;return new Promise(function(_0x953553,_0x1c8a51){if(ami[_0xeabc('0x13')]()==![]){return _0x1c8a51(_0x4c4b1e[_0xeabc('0x1d')](0x1f4,[config[_0xeabc('0x14')]['ip'],config['asterisk'][_0xeabc('0x15')],'ami\x20disconnected'][_0xeabc('0x1e')]('\x20')));}var _0x2f95c7=schema(properties['voicequeuechannelredirect'])[_0xeabc('0x3')](_0x480c66);if(_0x2f95c7['length']>0x0){return _0x1c8a51(_0x4c4b1e['error'](0x1f4,_[_0xeabc('0x6d')](_0x2f95c7,_0xeabc('0x1b'))[_0xeabc('0x1e')](',\x20')));}var _0x3acb88=_[_0xeabc('0x5d')](_0x5e9e2d['queueChannels'],{'uniqueid':_0x480c66[_0xeabc('0x5e')]});if(_0x3acb88&&_0x3acb88[_0xeabc('0x63')]){return ami[_0xeabc('0x21')]({'action':_0xeabc('0x75'),'channel':_0x3acb88[_0xeabc('0x63')],'exten':_0x480c66[_0xeabc('0x76')],'context':_0x480c66[_0xeabc('0x77')]||_0x3acb88[_0xeabc('0x77')],'priority':0x1})[_0xeabc('0x1a')](function(_0x1921d5){_0x953553({'code':0xc8,'message':[_0x480c66['uniqueid'],_0x1921d5[_0xeabc('0x1b')][_0xeabc('0x65')]()][_0xeabc('0x1e')]('\x20')});})['catch'](function(_0x4bccf7){_0x1c8a51(_0x4c4b1e[_0xeabc('0x1d')](0x1f5,[_0x480c66[_0xeabc('0x5e')],_0x4bccf7[_0xeabc('0x1b')][_0xeabc('0x65')]()][_0xeabc('0x1e')]('\x20')));});}else{return _0x1c8a51(_0x4c4b1e['error'](0x1f5,_0xeabc('0x6c')));}});},'Agents':function(_0x538190){return new Promise(function(_0x5f39ef,_0x16ff81){var _0x302e94=_['values'](_0x5e9e2d[_0xeabc('0xf')]);_0x5f39ef({'count':_0x302e94[_0xeabc('0x58')],'rows':_0x302e94});});},'Telephones':function(_0x49a70a){return new Promise(function(_0x5963f7,_0xfaef39){var _0xb04677=_[_0xeabc('0x78')](_0x5e9e2d[_0xeabc('0x79')]);_0x5963f7({'count':_0xb04677[_0xeabc('0x58')],'rows':_0xb04677});});},'Trunks':function(_0x1b0995){return new Promise(function(_0x1f8197,_0x485c13){var _0xb54c35=_['values'](_0x5e9e2d[_0xeabc('0x7a')]);_0x1f8197({'count':_0xb54c35[_0xeabc('0x58')],'rows':_0xb54c35});});},'OutboundChannels':function(_0x204e39){return new Promise(function(_0x2d1441,_0x62cb8e){var _0x20c003=_[_0xeabc('0x78')](_0x5e9e2d[_0xeabc('0x7b')]);_0x2d1441({'count':_0x20c003[_0xeabc('0x58')],'rows':_0x20c003});});},'Outbound':function(_0x156e20){return new Promise(function(_0x42e92b,_0x5d471f){_0x42e92b(_0x5e9e2d[_0xeabc('0x7c')]);});},'Campaigns':function(_0x274ddc){return new Promise(function(_0x3a3967,_0x1e880e){var _0x5b00d6=_[_0xeabc('0x78')](_0x5e9e2d[_0xeabc('0x7d')]);_0x3a3967({'count':_0x5b00d6['length'],'rows':_0x5b00d6});});},'VoiceQueuesPreview':function(_0x3de927){var _0x22ef88=this;return new Promise(function(_0x5086e7,_0x507ac0){_0x54e4a8['run'](_0x3de927['id'])['then'](function(_0x2959e9){_0x5086e7({'code':0xc8,'message':_0x2959e9[_0xeabc('0x1b')]});})[_0xeabc('0x1c')](function(_0xe18bf1){_0x507ac0(_0x22ef88[_0xeabc('0x1d')](0x1f4,_0xe18bf1[_0xeabc('0x1b')]));});});},'EventManager':function(_0x3abe69){var _0x385ecf=this;return new Promise(function(_0x18c27f,_0x3eb795){if(!_0x3abe69['event']){return _0x3eb795(_0x385ecf[_0xeabc('0x1d')](0x1f4,_0xeabc('0x7e')));}ami['emit'](_0xeabc('0x7f')+_0x3abe69[_0xeabc('0x80')],_0x3abe69[_0xeabc('0x1b')]);_0x18c27f({'code':0xc8,'message':_0x3abe69});});},'FaxAccounts':function(_0x4c4ee3){return new Promise(function(_0x1f3198,_0x488120){var _0x425e5c=_[_0xeabc('0x78')](_0x5e9e2d[_0xeabc('0x81')]);_0x1f3198({'count':_0x425e5c[_0xeabc('0x58')],'rows':_0x425e5c});});},'SendFax':function(_0x1c52f7){var _0x5e7e00=this;return new Promise(function(_0x53a5bc,_0x5e9079){_0x1b07a8['send'](_0x1c52f7)[_0xeabc('0x1a')](function(_0x3c2725){_0x53a5bc({'code':0xc8,'message':_0x3c2725[_0xeabc('0x1b')]});})['catch'](function(_0x12f83f){_0x5e9079(_0x5e7e00[_0xeabc('0x1d')](0x1f4,_0x12f83f[_0xeabc('0x1b')]));});});},'CheckAfterSend':function(_0x36cc30){var _0x39964d=this;return new Promise(function(_0x646353,_0xdd956){_0x1b07a8[_0xeabc('0x82')](_0x36cc30)[_0xeabc('0x1a')](function(_0x391e67){_0x646353({'code':0xc8,'message':_0x391e67[_0xeabc('0x1b')]});})[_0xeabc('0x1c')](function(_0x5a1422){_0xdd956(_0x39964d['error'](0x1f4,_0x5a1422[_0xeabc('0x1b')]));});});}};var _0x50a5d5=jayson[_0xeabc('0x83')](_0x52ede8)[_0xeabc('0x84')]();_0x50a5d5['on'](_0xeabc('0x1d'),function(_0x56f622){return _0x229ba4(_0x56f622);});_0x50a5d5[_0xeabc('0x7')](0x232a,_0xeabc('0x85'),function(){console[_0xeabc('0x86')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x52a4d7('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x2c8f=['updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','action','Reload','Action','then','error','message','command','Command','catch','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumDuration','total','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','length','find','omit','undefined','channels','voicechannel','validate','uniqueid','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','channel','destinationchannel','StopMixMonitor','status','stop','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','map','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','event','faxAccounts','checkAfterSend','server','http','listen','127.0.0.1','log','util','moment','../../../config/environment','../properties','format','%s/%s','name','timers','timer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2c8f,0x192));var _0xf2c8=function(_0x1653a1,_0x2a7ade){_0x1653a1=_0x1653a1-0x0;var _0x281b52=_0x2c8f[_0x1653a1];return _0x281b52;};'use strict';var _=require('lodash');var util=require(_0xf2c8('0x0'));var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0xf2c8('0x1'));var config=require(_0xf2c8('0x2'));var properties=require(_0xf2c8('0x3'));var ami=require('../ami');exports['listen']=function(_0x2581a1,_0x34f179,_0x182b73){return new BPromise(function(_0x3ad7a0,_0x2785ee){var _0x4eae22={'QueuePause':function(_0x475616){return new Promise(function(_0x28cc0d,_0x4e3109){var _0x450f1e=util[_0xf2c8('0x4')](_0xf2c8('0x5'),'SIP',_0x475616[_0xf2c8('0x6')]);if(_0x2581a1[_0xf2c8('0x7')]&&_0x2581a1[_0xf2c8('0x7')][_0x450f1e]&&_0x2581a1[_0xf2c8('0x7')][_0x450f1e][_0xf2c8('0x8')]){_0x2581a1[_0xf2c8('0x7')][_0x450f1e][_0xf2c8('0x9')]();}if(_0x2581a1[_0xf2c8('0xa')][_0x450f1e]){_0x2581a1['agents'][_0x450f1e][_0xf2c8('0xb')]({'statePause':_0x475616['pause']?!![]:![]});}_0x28cc0d({'code':0xc8,'message':_0xf2c8('0xc')});});},'Reload':function(_0x16b7a4){var _0x2b6565=this;return new Promise(function(_0x46d0c6,_0x37db9b){if(ami[_0xf2c8('0xd')]()==![]){return _0x37db9b(_0x2b6565['error'](0x1f4,[config[_0xf2c8('0xe')]['ip'],config[_0xf2c8('0xe')][_0xf2c8('0xf')],_0xf2c8('0x10')][_0xf2c8('0x11')]('\x20')));}_0x16b7a4=_[_0xf2c8('0x12')](_0x16b7a4,_[_0xf2c8('0x13')](properties['module']));_0x16b7a4[_0xf2c8('0x14')]=_0xf2c8('0x15');return ami[_0xf2c8('0x16')](_0x16b7a4)[_0xf2c8('0x17')](function(_0xe1ec71){_0x46d0c6({'code':0xc8,'message':_0xe1ec71['message']});})['catch'](function(_0x104d9d){_0x37db9b(_0x2b6565[_0xf2c8('0x18')](0x1f5,_0x104d9d[_0xf2c8('0x19')]));});});},'Command':function(_0x283ecf){var _0x516d99=this;return new Promise(function(_0x29d2df,_0x100542){if(ami[_0xf2c8('0xd')]()==![]){return _0x100542(_0x516d99['error'](0x1f4,[config[_0xf2c8('0xe')]['ip'],config[_0xf2c8('0xe')]['username'],'ami\x20disconnected'][_0xf2c8('0x11')]('\x20')));}_0x283ecf=_[_0xf2c8('0x12')](_0x283ecf,_0xf2c8('0x1a'));_0x283ecf['action']=_0xf2c8('0x1b');return ami[_0xf2c8('0x16')](_0x283ecf)[_0xf2c8('0x17')](function(_0x239350){_0x29d2df({'code':0xc8,'message':_0x239350['content']});})[_0xf2c8('0x1c')](function(_0xe5ff6c){_0x100542(_0x516d99[_0xf2c8('0x18')](0x1f5,_0xe5ff6c[_0xf2c8('0x19')]));});});},'VoiceQueues':function(_0x16938e){return new Promise(function(_0x4d0e56,_0x93707c){var _0x54bbcb=[];for(var _0x3cd344 in _0x2581a1[_0xf2c8('0x1d')]){if(_0x2581a1[_0xf2c8('0x1d')][_0xf2c8('0x1e')](_0x3cd344)){var _0x1d2e74=_0x2581a1[_0xf2c8('0x1d')][_0x3cd344];var _0x3ffd20={'id':_0x1d2e74['id'],'name':_0x1d2e74[_0xf2c8('0x6')],'strategy':_0x1d2e74[_0xf2c8('0x1f')],'answered':_0x1d2e74[_0xf2c8('0x20')],'available':_0x1d2e74[_0xf2c8('0x21')],'loggedIn':_0x1d2e74[_0xf2c8('0x22')],'pTalking':_0x1d2e74[_0xf2c8('0x23')],'sumBillable':_0x1d2e74['sumBillable'],'sumDuration':_0x1d2e74[_0xf2c8('0x24')],'sumHoldTime':_0x1d2e74['sumHoldTime']||0x0,'talking':_0x1d2e74['talking'],'total':_0x1d2e74[_0xf2c8('0x25')],'type':_0x1d2e74['type'],'unmanaged':_0x1d2e74[_0xf2c8('0x26')],'abandoned':_0x1d2e74[_0xf2c8('0x27')],'waiting':_0x1d2e74[_0xf2c8('0x28')],'loggedInDb':_0x1d2e74[_0xf2c8('0x29')]};if(_0x1d2e74[_0xf2c8('0x2a')]===_0xf2c8('0x2b')){_0x3ffd20[_0xf2c8('0x2c')]=_0x1d2e74['dialActive'];_0x3ffd20[_0xf2c8('0x2d')]=_0x1d2e74[_0xf2c8('0x2d')];_0x3ffd20[_0xf2c8('0x2e')]=_0x1d2e74[_0xf2c8('0x2e')];_0x3ffd20[_0xf2c8('0x2f')]=_0x1d2e74[_0xf2c8('0x2f')];_0x3ffd20['dialOriginateTimeout']=_0x1d2e74[_0xf2c8('0x30')];_0x3ffd20['dialPrefix']=_0x1d2e74[_0xf2c8('0x31')];_0x3ffd20['temp']=_0x1d2e74[_0xf2c8('0x32')];_0x3ffd20[_0xf2c8('0x33')]=_0x1d2e74[_0xf2c8('0x33')];_0x3ffd20[_0xf2c8('0x34')]=_0x1d2e74[_0xf2c8('0x34')];_0x3ffd20['outboundBlacklistCallsDay']=_0x1d2e74[_0xf2c8('0x35')];_0x3ffd20[_0xf2c8('0x36')]=_0x1d2e74['outboundBusyCallsDay'];_0x3ffd20[_0xf2c8('0x37')]=_0x1d2e74[_0xf2c8('0x37')];_0x3ffd20['outboundDropCallsDayACS']=_0x1d2e74[_0xf2c8('0x38')];_0x3ffd20[_0xf2c8('0x39')]=_0x1d2e74[_0xf2c8('0x39')];_0x3ffd20[_0xf2c8('0x3a')]=_0x1d2e74[_0xf2c8('0x3a')];_0x3ffd20['outboundNoAnswerCallsDay']=_0x1d2e74['outboundNoAnswerCallsDay'];_0x3ffd20[_0xf2c8('0x3b')]=_0x1d2e74[_0xf2c8('0x3b')];_0x3ffd20[_0xf2c8('0x3c')]=_0x1d2e74[_0xf2c8('0x3c')];_0x3ffd20[_0xf2c8('0x3d')]=_0x1d2e74[_0xf2c8('0x3d')];_0x3ffd20[_0xf2c8('0x3e')]=_0x1d2e74[_0xf2c8('0x3e')];_0x3ffd20['outboundUnknownCallsDay']=_0x1d2e74[_0xf2c8('0x3f')];_0x3ffd20[_0xf2c8('0x40')]=_0x1d2e74[_0xf2c8('0x40')];_0x3ffd20['predictiveIntervalAvgHoldtime']=_0x1d2e74['predictiveIntervalAvgHoldtime'];_0x3ffd20['predictiveIntervalAvgTalktime']=_0x1d2e74['predictiveIntervalAvgTalktime'];_0x3ffd20[_0xf2c8('0x41')]=_0x1d2e74['predictiveIntervalDroppedCallsCallersExit'];_0x3ffd20[_0xf2c8('0x42')]=_0x1d2e74['predictiveIntervalDroppedCallsTimeout'];_0x3ffd20[_0xf2c8('0x43')]=_0x1d2e74['predictiveIntervalErlangCalls'];_0x3ffd20['predictiveIntervalErlangCallsDroppedCalls']=_0x1d2e74[_0xf2c8('0x44')];_0x3ffd20[_0xf2c8('0x45')]=_0x1d2e74['predictiveIntervalHitRate'];_0x3ffd20[_0xf2c8('0x46')]=_0x1d2e74[_0xf2c8('0x46')];_0x3ffd20['predictiveIntervalPauses']=_0x1d2e74[_0xf2c8('0x47')];_0x3ffd20[_0xf2c8('0x48')]=_0x1d2e74[_0xf2c8('0x48')];_0x3ffd20[_0xf2c8('0x49')]=_0x1d2e74[_0xf2c8('0x49')];_0x3ffd20[_0xf2c8('0x19')]=_0x1d2e74['message'];_0x3ffd20['originated']=_0x1d2e74[_0xf2c8('0x4a')];_0x3ffd20['erlangCalls']=_0x1d2e74[_0xf2c8('0x4b')];_0x3ffd20['erlangCallToSecond']=_0x1d2e74[_0xf2c8('0x4c')];_0x3ffd20['erlangAbandonmentRate']=_0x1d2e74[_0xf2c8('0x4d')];_0x3ffd20[_0xf2c8('0x4e')]=_0x1d2e74[_0xf2c8('0x4e')];_0x3ffd20[_0xf2c8('0x4f')]=_0x1d2e74['startPredictive'];_0x3ffd20[_0xf2c8('0x50')]=_0x1d2e74[_0xf2c8('0x50')];}if(_0x1d2e74['Trunk']){_0x3ffd20[_0xf2c8('0x51')]={'id':_0x1d2e74[_0xf2c8('0x51')]['id'],'name':_0x1d2e74[_0xf2c8('0x51')][_0xf2c8('0x6')],'active':_0x1d2e74[_0xf2c8('0x51')][_0xf2c8('0x52')],'callerid':_0x1d2e74[_0xf2c8('0x51')]['callerid']};}if(_0x1d2e74[_0xf2c8('0x53')]){_0x3ffd20[_0xf2c8('0x53')]={'id':_0x1d2e74[_0xf2c8('0x53')]['id'],'name':_0x1d2e74[_0xf2c8('0x53')]['name']};}_0x54bbcb['push'](_0x3ffd20);}}_0x4d0e56({'count':_0x54bbcb[_0xf2c8('0x54')],'rows':_0x54bbcb});});},'UpdateVoiceQueue':function(_0x175b93){return new Promise(function(_0x3203c3,_0x520029){var _0xe257cc=_[_0xf2c8('0x55')](_0x2581a1['voiceQueues'],{'id':parseInt(_0x175b93['id'])});var _0x574476=_[_0xf2c8('0x56')](_0x175b93,['id']);if(_0xe257cc){for(var _0xce3dd5 in _0x574476){if(typeof _0x574476[_0xce3dd5]!==_0xf2c8('0x57')&&typeof _0xe257cc[_0xce3dd5]!==_0xf2c8('0x57')){_0xe257cc[_0xce3dd5]=_0x574476[_0xce3dd5];}}_0x3203c3(_0xe257cc);}else{_0x520029();}});},'VoiceChannels':function(_0x48ee2c){return new Promise(function(_0x16f713,_0x826ca6){var _0x18bbd9=_['values'](_0x2581a1[_0xf2c8('0x58')]);_0x16f713({'count':_0x18bbd9[_0xf2c8('0x54')],'rows':_0x18bbd9});});},'VoiceChannelMixMonitor':function(_0x15fa55){var _0x48f770=this;return new Promise(function(_0x105438,_0x452b12){if(ami[_0xf2c8('0xd')]()==![]){return _0x452b12(_0x48f770[_0xf2c8('0x18')](0x1f4,[config[_0xf2c8('0xe')]['ip'],config['asterisk'][_0xf2c8('0xf')],'ami\x20disconnected']['join']('\x20')));}var _0x168acb=schema(properties[_0xf2c8('0x59')])[_0xf2c8('0x5a')](_0x15fa55);if(_0x168acb[_0xf2c8('0x54')]>0x0){return _0x452b12(_0x48f770[_0xf2c8('0x18')](0x1f4,_['map'](_0x168acb,_0xf2c8('0x19'))[_0xf2c8('0x11')](',\x20')));}var _0x34bd47=_[_0xf2c8('0x55')](_0x2581a1[_0xf2c8('0x58')],{'uniqueid':_0x15fa55[_0xf2c8('0x5b')]});if(_0x34bd47&&_0x34bd47['channel']){var _0x53f6ee=util[_0xf2c8('0x4')](_0xf2c8('0x5c'),_0x15fa55[_0xf2c8('0x5d')]||_0x15fa55[_0xf2c8('0x5b')],_0x15fa55[_0xf2c8('0x4')]||_0xf2c8('0x5e'));return ami[_0xf2c8('0x16')]({'action':_0xf2c8('0x5f'),'channel':_0x34bd47['channel'],'file':_0x53f6ee,'options':_0xf2c8('0x60')})[_0xf2c8('0x17')](function(_0x5ebf58){var _0x56f7e5=_[_0xf2c8('0x55')](_0x34bd47[_0xf2c8('0x61')],{'filename':'/var/spool/asterisk/monitor/'+_0x53f6ee[_0xf2c8('0x62')]()});if(_[_0xf2c8('0x63')](_0x56f7e5)){_0x34bd47[_0xf2c8('0x61')]['push']({'filename':_0xf2c8('0x64')+_0x53f6ee[_0xf2c8('0x62')](),'createdAt':moment()[_0xf2c8('0x4')](_0xf2c8('0x65')),'mixmonitorid':_0x5ebf58[_0xf2c8('0x66')],'status':_0xf2c8('0x67')});}else{_0x56f7e5[_0xf2c8('0x66')]=_0x5ebf58[_0xf2c8('0x66')];_0x56f7e5['status']=_0xf2c8('0x67');}_0x105438({'code':0xc8,'message':[_0x15fa55[_0xf2c8('0x5b')],_0xf2c8('0x68'),_0x5ebf58['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x5ebf58[_0xf2c8('0x66')]});})[_0xf2c8('0x1c')](function(_0x4d79af){_0x452b12(_0x48f770[_0xf2c8('0x18')](0x1f5,[_0x15fa55['uniqueid'],_0x4d79af['message'][_0xf2c8('0x62')]()][_0xf2c8('0x11')]('\x20')));});}else{return _0x452b12(_0x48f770['error'](0x1f5,_0xf2c8('0x69')));}});},'VoiceChannelStopMixMonitor':function(_0x3adba6){var _0x28464c=this;return new Promise(function(_0x3d2d39,_0x2f78b1){if(ami['isConnected']()==![]){return _0x2f78b1(_0x28464c[_0xf2c8('0x18')](0x1f4,[config[_0xf2c8('0xe')]['ip'],config['asterisk'][_0xf2c8('0xf')],'ami\x20disconnected'][_0xf2c8('0x11')]('\x20')));}var _0x184c25=schema(properties[_0xf2c8('0x59')])[_0xf2c8('0x5a')](_0x3adba6);if(_0x184c25[_0xf2c8('0x54')]>0x0){return _0x2f78b1(_0x28464c[_0xf2c8('0x18')](0x1f4,_['map'](_0x184c25,_0xf2c8('0x19'))[_0xf2c8('0x11')](',\x20')));}var _0x2fe8da=_[_0xf2c8('0x55')](_0x2581a1[_0xf2c8('0x58')],{'uniqueid':_0x3adba6['uniqueid']});if(_0x2fe8da){return BPromise[_0xf2c8('0x6a')]()[_0xf2c8('0x17')](function(){if(_0x2fe8da[_0xf2c8('0x6b')]){return ami[_0xf2c8('0x16')]({'action':'StopMixMonitor','channel':_0x2fe8da[_0xf2c8('0x6b')],'mixmonitorid':_0x3adba6[_0xf2c8('0x66')]})[_0xf2c8('0x1c')](function(_0x20d8d4){});}})[_0xf2c8('0x17')](function(){if(_0x2fe8da[_0xf2c8('0x6c')]){return ami[_0xf2c8('0x16')]({'action':_0xf2c8('0x6d'),'channel':_0x2fe8da[_0xf2c8('0x6c')],'mixmonitorid':_0x3adba6['mixmonitorid']})[_0xf2c8('0x1c')](function(_0x117bac){});}})['then'](function(_0xdbf069){var _0x452ade=_['find'](_0x2fe8da[_0xf2c8('0x61')],{'mixmonitorid':_0x3adba6[_0xf2c8('0x66')]});if(_0x452ade){_0x452ade[_0xf2c8('0x6e')]=_0xf2c8('0x6f');}})['then'](function(){var _0x5b4758=util[_0xf2c8('0x4')]('%s.%s',_0x3adba6[_0xf2c8('0x5d')]||_0x3adba6[_0xf2c8('0x5b')],_0x3adba6[_0xf2c8('0x4')]||_0xf2c8('0x5e'));var _0x13afc0=_[_0xf2c8('0x55')](_0x2fe8da['monitors'],{'filename':_0xf2c8('0x64')+_0x5b4758[_0xf2c8('0x62')]()});if(_0x13afc0){_0x13afc0['status']=_0xf2c8('0x6f');}})[_0xf2c8('0x17')](function(){_0x3d2d39({'code':0xc8,'message':[_0x3adba6['uniqueid'],_0xf2c8('0x70')]['join']('\x20')});})[_0xf2c8('0x1c')](function(_0x154cbe){_0x2f78b1(_0x28464c['error'](0x1f5,[_0x3adba6['uniqueid'],_0x154cbe['message'][_0xf2c8('0x62')]()][_0xf2c8('0x11')]('\x20')));});}else{return _0x2f78b1(_0x28464c[_0xf2c8('0x18')](0x1f5,_0xf2c8('0x69')));}});},'VoiceQueuesChannels':function(_0xb5801f){return new Promise(function(_0x2e963f,_0x5bf80e){var _0x2f5718=_[_0xf2c8('0x71')](_0x2581a1[_0xf2c8('0x72')]);_0x2e963f({'count':_0x2f5718[_0xf2c8('0x54')],'rows':_0x2f5718});});},'VoiceQueuesChannel':function(_0x4ff195){var _0x5b0b51=this;return new Promise(function(_0x949a87,_0x9d63ca){var _0x3f0dcb=schema(properties[_0xf2c8('0x73')])['validate'](_0x4ff195);if(_0x3f0dcb['length']>0x0){return _0x9d63ca(_0x5b0b51[_0xf2c8('0x18')](0x1f4,_[_0xf2c8('0x74')](_0x3f0dcb,_0xf2c8('0x19'))[_0xf2c8('0x11')](',\x20')));}var _0x4c0ae9=_['find'](_0x2581a1[_0xf2c8('0x72')],{'uniqueid':_0x4ff195[_0xf2c8('0x5b')]});if(_0x4c0ae9){_0x949a87(_0x4c0ae9);}else{return _0x9d63ca(_0x5b0b51[_0xf2c8('0x18')](0x1f5,_0xf2c8('0x69')));}});},'VoiceQueuesChannelHangup':function(_0x30190c){var _0x24ed2c=this;return new Promise(function(_0x5ef316,_0x35c799){if(ami[_0xf2c8('0xd')]()==![]){return _0x35c799(_0x24ed2c['error'](0x1f4,[config[_0xf2c8('0xe')]['ip'],config['asterisk'][_0xf2c8('0xf')],'ami\x20disconnected'][_0xf2c8('0x11')]('\x20')));}var _0x173e02=schema(properties[_0xf2c8('0x75')])[_0xf2c8('0x5a')](_0x30190c);if(_0x173e02[_0xf2c8('0x54')]>0x0){return _0x35c799(_0x24ed2c['error'](0x1f4,_['map'](_0x173e02,'message')[_0xf2c8('0x11')](',\x20')));}var _0x25addf=_[_0xf2c8('0x55')](_0x2581a1['queueChannels'],{'uniqueid':_0x30190c[_0xf2c8('0x5b')]});if(_0x25addf&&_0x25addf['channel']){return ami[_0xf2c8('0x16')]({'action':'Hangup','channel':_0x25addf[_0xf2c8('0x6b')]})['then'](function(_0x4316e2){_0x5ef316({'code':0xc8,'message':[_0x30190c[_0xf2c8('0x5b')],_0x4316e2[_0xf2c8('0x19')][_0xf2c8('0x62')]()][_0xf2c8('0x11')]('\x20')});})[_0xf2c8('0x1c')](function(_0xb3f69a){_0x35c799(_0x24ed2c[_0xf2c8('0x18')](0x1f5,[_0x30190c['uniqueid'],_0xb3f69a[_0xf2c8('0x19')]['toLowerCase']()][_0xf2c8('0x11')]('\x20')));});}else{return _0x35c799(_0x24ed2c['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x5936cd){var _0x54ef2e=this;return new Promise(function(_0x34989a,_0x2f48dc){if(ami[_0xf2c8('0xd')]()==![]){return _0x2f48dc(_0x54ef2e[_0xf2c8('0x18')](0x1f4,[config['asterisk']['ip'],config[_0xf2c8('0xe')][_0xf2c8('0xf')],_0xf2c8('0x10')][_0xf2c8('0x11')]('\x20')));}var _0x48f6b9=schema(properties[_0xf2c8('0x76')])[_0xf2c8('0x5a')](_0x5936cd);if(_0x48f6b9['length']>0x0){return _0x2f48dc(_0x54ef2e['error'](0x1f4,_[_0xf2c8('0x74')](_0x48f6b9,_0xf2c8('0x19'))[_0xf2c8('0x11')](',\x20')));}var _0x4d2686=_[_0xf2c8('0x55')](_0x2581a1[_0xf2c8('0x72')],{'uniqueid':_0x5936cd[_0xf2c8('0x5b')]});if(_0x4d2686&&_0x4d2686['channel']){return ami[_0xf2c8('0x16')]({'action':_0xf2c8('0x77'),'channel':_0x4d2686[_0xf2c8('0x6b')],'exten':_0x5936cd[_0xf2c8('0x78')],'context':_0x5936cd[_0xf2c8('0x79')]||_0x4d2686[_0xf2c8('0x79')],'priority':0x1})['then'](function(_0xb8f09c){_0x34989a({'code':0xc8,'message':[_0x5936cd[_0xf2c8('0x5b')],_0xb8f09c[_0xf2c8('0x19')][_0xf2c8('0x62')]()][_0xf2c8('0x11')]('\x20')});})[_0xf2c8('0x1c')](function(_0x5eedb2){_0x2f48dc(_0x54ef2e[_0xf2c8('0x18')](0x1f5,[_0x5936cd[_0xf2c8('0x5b')],_0x5eedb2[_0xf2c8('0x19')][_0xf2c8('0x62')]()][_0xf2c8('0x11')]('\x20')));});}else{return _0x2f48dc(_0x54ef2e['error'](0x1f5,_0xf2c8('0x69')));}});},'Agents':function(_0x4766a7){return new Promise(function(_0x268480,_0x5e07cf){var _0x45428c=_[_0xf2c8('0x71')](_0x2581a1[_0xf2c8('0xa')]);_0x268480({'count':_0x45428c[_0xf2c8('0x54')],'rows':_0x45428c});});},'Telephones':function(_0x3d6b14){return new Promise(function(_0x535ef0,_0x5e9f26){var _0x2b1939=_['values'](_0x2581a1[_0xf2c8('0x7a')]);_0x535ef0({'count':_0x2b1939[_0xf2c8('0x54')],'rows':_0x2b1939});});},'Trunks':function(_0x295f52){return new Promise(function(_0x48e8ee,_0x30c823){var _0x22ce8f=_[_0xf2c8('0x71')](_0x2581a1[_0xf2c8('0x7b')]);_0x48e8ee({'count':_0x22ce8f[_0xf2c8('0x54')],'rows':_0x22ce8f});});},'OutboundChannels':function(_0x1cf5fa){return new Promise(function(_0x8acd72,_0x33d312){var _0x1c4a85=_[_0xf2c8('0x71')](_0x2581a1[_0xf2c8('0x7c')]);_0x8acd72({'count':_0x1c4a85['length'],'rows':_0x1c4a85});});},'Outbound':function(_0x558303){return new Promise(function(_0x17352c,_0x415424){_0x17352c(_0x2581a1[_0xf2c8('0x2b')]);});},'Campaigns':function(_0x1f679f){return new Promise(function(_0x462f32,_0xa20ca3){var _0x176186=_[_0xf2c8('0x71')](_0x2581a1[_0xf2c8('0x7d')]);_0x462f32({'count':_0x176186[_0xf2c8('0x54')],'rows':_0x176186});});},'VoiceQueuesPreview':function(_0x3d9947){var _0x3c822e=this;return new Promise(function(_0x1912e2,_0x6b1ec){_0x34f179[_0xf2c8('0x7e')](_0x3d9947['id'])['then'](function(_0x4455b3){_0x1912e2({'code':0xc8,'message':_0x4455b3[_0xf2c8('0x19')]});})[_0xf2c8('0x1c')](function(_0xe80749){_0x6b1ec(_0x3c822e[_0xf2c8('0x18')](0x1f4,_0xe80749[_0xf2c8('0x19')]));});});},'EventManager':function(_0x3f94f2){var _0x17e707=this;return new Promise(function(_0x32dfa2,_0x40cfac){if(!_0x3f94f2['event']){return _0x40cfac(_0x17e707[_0xf2c8('0x18')](0x1f4,_0xf2c8('0x7f')));}ami[_0xf2c8('0x80')]('custom:'+_0x3f94f2[_0xf2c8('0x81')],_0x3f94f2[_0xf2c8('0x19')]);_0x32dfa2({'code':0xc8,'message':_0x3f94f2});});},'FaxAccounts':function(_0x13fecc){return new Promise(function(_0x2d32d3,_0x4762e1){var _0x25e0e4=_[_0xf2c8('0x71')](_0x2581a1[_0xf2c8('0x82')]);_0x2d32d3({'count':_0x25e0e4[_0xf2c8('0x54')],'rows':_0x25e0e4});});},'SendFax':function(_0x182fbf){var _0x1169c4=this;return new Promise(function(_0x24759b,_0x480d25){_0x182b73['send'](_0x182fbf)[_0xf2c8('0x17')](function(_0x3299af){_0x24759b({'code':0xc8,'message':_0x3299af[_0xf2c8('0x19')]});})['catch'](function(_0x271c5c){_0x480d25(_0x1169c4[_0xf2c8('0x18')](0x1f4,_0x271c5c['message']));});});},'CheckAfterSend':function(_0x55ae62){var _0x56ec66=this;return new Promise(function(_0x5a1204,_0x111746){_0x182b73[_0xf2c8('0x83')](_0x55ae62)[_0xf2c8('0x17')](function(_0x1f55e5){_0x5a1204({'code':0xc8,'message':_0x1f55e5[_0xf2c8('0x19')]});})[_0xf2c8('0x1c')](function(_0x41d22e){_0x111746(_0x56ec66['error'](0x1f4,_0x41d22e[_0xf2c8('0x19')]));});});}};var _0x346a11=jayson[_0xf2c8('0x84')](_0x4eae22)[_0xf2c8('0x85')]();_0x346a11['on'](_0xf2c8('0x18'),function(_0x49ddc1){return _0x2785ee(_0x49ddc1);});_0x346a11[_0xf2c8('0x86')](0x232a,_0xf2c8('0x87'),function(){console[_0xf2c8('0x88')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3ad7a0('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 3b443ee..56c8cfd 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 _0x008c=['defaults','localhost','socket.io-emitter','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','map','firstName','scheduledAt','getContacts','then','isEmpty','length','info','uniqueid','join','data4','routeId','calleridnum','destcalleridnum','calleridname','Unknown','','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','trigger:%s','action','toLowerCase','lodash','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis'];(function(_0x409789,_0xba72a0){var _0x56e5b2=function(_0x516c6e){while(--_0x516c6e){_0x409789['push'](_0x409789['shift']());}};_0x56e5b2(++_0xba72a0);}(_0x008c,0x188));var _0xc008=function(_0x50bf5a,_0x807bba){_0x50bf5a=_0x50bf5a-0x0;var _0x4ddc1d=_0x008c[_0x50bf5a];return _0x4ddc1d;};'use strict';var _=require(_0xc008('0x0'));var BPromise=require(_0xc008('0x1'));var Redis=require(_0xc008('0x2'));var util=require(_0xc008('0x3'));var config=require(_0xc008('0x4'));var logger=require('../../../../config/logger')(_0xc008('0x5'));var cmContactRpc=require(_0xc008('0x6'));config[_0xc008('0x7')]=_[_0xc008('0x8')](config[_0xc008('0x7')],{'host':_0xc008('0x9'),'port':0x18eb});var io=require(_0xc008('0xa'))(new Redis(config[_0xc008('0x7')]));function emit(_0x9c8cb2,_0x4af530,_0x428fa9,_0x5aa09b,_0x30be38){logger['info']('[CM][%s][%s]',_0x9c8cb2,_0x4af530['id'],_0x428fa9,_0x5aa09b,JSON[_0xc008('0xb')](_0x30be38));io['to'](_0x428fa9)[_0xc008('0xc')](_0x5aa09b,_0x30be38);}exports['exec']=function(_0x51ba7d,_0x543eb8,_0x1eacfa,_0xc881aa){var _0x5b2004,_0xae2dab;var _0x332fd4={};var _0x2ea200=Number(_0x1eacfa[_0xc008('0xd')]);var _0x9ffa93=_0x1eacfa[_0xc008('0xe')]?Boolean(Number(_0x1eacfa[_0xc008('0xe')])):![];var _0x593f7a;var _0x560e28=![];if(!_[_0xc008('0xf')](_0x1eacfa['data5'])){if(_0x1eacfa[_0xc008('0x10')]=='1')_0x560e28=!![];}if(!_0x560e28){if(_0xc881aa[_0xc008('0x11')]){_0x332fd4['id']=_0xc881aa[_0xc008('0x11')];}}if(!_0x332fd4['id']){_0x332fd4[_0xc008('0x12')]=_0x2ea200;_0x593f7a=_0x1eacfa[_0xc008('0x13')]&&_0x1eacfa['data3']!=='0'?_0x1eacfa['data3']['split'](','):[_0xc008('0x14')];_0x332fd4[_0xc008('0x15')]=_[_0xc008('0x16')](_0x593f7a,function(_0x3eb12a){var _0x4fe771={};_0x4fe771[_0x3eb12a]=_0xc881aa['routeId']?_0xc881aa['destcalleridnum']:_0xc881aa['calleridnum'];return _0x4fe771;});}var _0x46042b=['id',_0xc008('0x17'),'lastName',_0xc008('0x14'),'mobile','fax','ListId','createdAt',_0xc008('0x18'),'updatedAt'];var _0x5560b1=_['union'](_0x46042b,_0x593f7a);BPromise['resolve']()['then'](cmContactRpc[_0xc008('0x19')]({'attributes':_0x5560b1,'where':_0x332fd4}))[_0xc008('0x1a')](function(_0x251db2){_0xae2dab=_0x251db2;if(!_[_0xc008('0x1b')](_0xae2dab)){if(_0xae2dab[_0xc008('0x1c')]===0x1){_0x5b2004=_0xae2dab[0x0];logger[_0xc008('0x1d')]('[CM][%s][%s]\x20Contact\x20found:%s',_0xc881aa[_0xc008('0x1e')],_0x543eb8['id'],_0x5b2004['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0xc881aa[_0xc008('0x1e')],_0x543eb8['id'],_[_0xc008('0x16')](_0xae2dab,'id')[_0xc008('0x1f')](','));}return;}else{logger[_0xc008('0x1d')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0xc881aa['uniqueid'],_0x543eb8['id']);var _0x5de1e9={'ListId':_0x2ea200};var _0x3f7b07=_0x1eacfa[_0xc008('0x20')]&&_0x1eacfa[_0xc008('0x20')]!=='0'?_0x1eacfa[_0xc008('0x20')]:'phone';if(_0x9ffa93){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0xc881aa['uniqueid'],_0x543eb8['id']);_0x5de1e9[_0x3f7b07]=_['isNil'](_0xc881aa[_0xc008('0x21')])?_0xc881aa[_0xc008('0x22')]:_0xc881aa[_0xc008('0x23')];if(_['isNil'](_0xc881aa[_0xc008('0x21')])){_0x5de1e9[_0xc008('0x17')]=_0xc881aa[_0xc008('0x24')]&&_0xc881aa[_0xc008('0x24')]!==''?_0xc881aa[_0xc008('0x24')]:_0xc008('0x25');}else{_0x5de1e9['firstName']=_0xc881aa['destcalleridname']&&_0xc881aa['destcalleridname']!==_0xc008('0x26')?_0xc881aa[_0xc008('0x27')]:_0xc008('0x25');}return BPromise[_0xc008('0x28')]()[_0xc008('0x1a')](cmContactRpc[_0xc008('0x29')](_0x5de1e9))[_0xc008('0x1a')](function(_0x22d8e8){_0x5b2004=_0x22d8e8;_0xae2dab[_0xc008('0x2a')](_0x22d8e8);if(_0x5b2004){logger[_0xc008('0x1d')](_0xc008('0x2b'),_0xc881aa[_0xc008('0x1e')],_0x543eb8['id'],_0x5b2004['id']);}return;});}else{logger['info'](_0xc008('0x2c'),_0xc881aa[_0xc008('0x1e')],_0x543eb8['id']);_0x5de1e9[_0x3f7b07]=_['isNil'](_0xc881aa[_0xc008('0x21')])?_0xc881aa[_0xc008('0x22')]:_0xc881aa[_0xc008('0x23')];if(_[_0xc008('0xf')](_0xc881aa[_0xc008('0x21')])){_0x5de1e9[_0xc008('0x17')]=_0xc881aa[_0xc008('0x24')]&&_0xc881aa[_0xc008('0x24')]!==_0xc008('0x26')?_0xc881aa['calleridname']:_0xc008('0x25');}else{_0x5de1e9[_0xc008('0x17')]=_0xc881aa[_0xc008('0x27')]&&_0xc881aa[_0xc008('0x27')]!==_0xc008('0x26')?_0xc881aa[_0xc008('0x27')]:_0xc008('0x25');}_0x5b2004=_0x5de1e9;_0xae2dab['push'](_0x5de1e9);return;}}})[_0xc008('0x1a')](function(){if(_0x51ba7d){emit(_0xc881aa[_0xc008('0x1e')],_0x543eb8,util['format'](_0xc008('0x2d'),_0x51ba7d[_0xc008('0x2e')]),util['format'](_0xc008('0x2f'),_0x1eacfa[_0xc008('0x30')][_0xc008('0x31')]()),{'evt':_['merge'](_0xc881aa,{'autoCreate':_0x9ffa93}),'contact':_0x5b2004===undefined?{}:_0x5b2004,'contacts':_0xae2dab['length']===0x0?undefined:_0xae2dab});}});}; \ No newline at end of file +var _0x668b=['join','data4','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','calleridnum','format','user:%s','action','lodash','bluebird','util','../../../../config/environment','trigger','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','routeId','destcalleridnum','firstName','fax','createdAt','scheduledAt','union','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','map'];(function(_0x507c08,_0x2ae1df){var _0x250559=function(_0x2d6e65){while(--_0x2d6e65){_0x507c08['push'](_0x507c08['shift']());}};_0x250559(++_0x2ae1df);}(_0x668b,0x140));var _0xb668=function(_0x53f37f,_0xfb0b18){_0x53f37f=_0x53f37f-0x0;var _0x2fe5f8=_0x668b[_0x53f37f];return _0x2fe5f8;};'use strict';var _=require(_0xb668('0x0'));var BPromise=require(_0xb668('0x1'));var Redis=require('ioredis');var util=require(_0xb668('0x2'));var config=require(_0xb668('0x3'));var logger=require('../../../../config/logger')(_0xb668('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0xb668('0x5')]=_[_0xb668('0x6')](config[_0xb668('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xb668('0x7'))(new Redis(config[_0xb668('0x5')]));function emit(_0x3be92e,_0x2778e9,_0x20b749,_0x3f01bc,_0x517fc5){logger[_0xb668('0x8')](_0xb668('0x9'),_0x3be92e,_0x2778e9['id'],_0x20b749,_0x3f01bc,JSON[_0xb668('0xa')](_0x517fc5));io['to'](_0x20b749)[_0xb668('0xb')](_0x3f01bc,_0x517fc5);}exports[_0xb668('0xc')]=function(_0x3606a7,_0x45bc39,_0x3616e9,_0x567ea9){var _0x3b15a6,_0x27dbf7;var _0x27de15={};var _0x2ea5fc=Number(_0x3616e9[_0xb668('0xd')]);var _0x167057=_0x3616e9[_0xb668('0xe')]?Boolean(Number(_0x3616e9[_0xb668('0xe')])):![];var _0x3e5be0;var _0x25c5c5=![];if(!_[_0xb668('0xf')](_0x3616e9[_0xb668('0x10')])){if(_0x3616e9[_0xb668('0x10')]=='1')_0x25c5c5=!![];}if(!_0x25c5c5){if(_0x567ea9[_0xb668('0x11')]){_0x27de15['id']=_0x567ea9[_0xb668('0x11')];}}if(!_0x27de15['id']){_0x27de15[_0xb668('0x12')]=_0x2ea5fc;_0x3e5be0=_0x3616e9[_0xb668('0x13')]&&_0x3616e9[_0xb668('0x13')]!=='0'?_0x3616e9[_0xb668('0x13')][_0xb668('0x14')](','):[_0xb668('0x15')];_0x27de15[_0xb668('0x16')]=_['map'](_0x3e5be0,function(_0x13ee71){var _0x567ad7={};_0x567ad7[_0x13ee71]=_0x567ea9[_0xb668('0x17')]?_0x567ea9[_0xb668('0x18')]:_0x567ea9['calleridnum'];return _0x567ad7;});}var _0x38595d=['id',_0xb668('0x19'),'lastName',_0xb668('0x15'),'mobile',_0xb668('0x1a'),_0xb668('0x12'),_0xb668('0x1b'),_0xb668('0x1c'),'updatedAt'];var _0x2b7f96=_[_0xb668('0x1d')](_0x38595d,_0x3e5be0);BPromise[_0xb668('0x1e')]()['then'](cmContactRpc['getContacts']({'attributes':_0x2b7f96,'where':_0x27de15}))[_0xb668('0x1f')](function(_0x1e5620){_0x27dbf7=_0x1e5620;if(!_['isEmpty'](_0x27dbf7)){if(_0x27dbf7[_0xb668('0x20')]===0x1){_0x3b15a6=_0x27dbf7[0x0];logger['info'](_0xb668('0x21'),_0x567ea9['uniqueid'],_0x45bc39['id'],_0x3b15a6['id']);}else{logger[_0xb668('0x8')](_0xb668('0x22'),_0x567ea9[_0xb668('0x23')],_0x45bc39['id'],_[_0xb668('0x24')](_0x27dbf7,'id')[_0xb668('0x25')](','));}return;}else{logger[_0xb668('0x8')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x567ea9[_0xb668('0x23')],_0x45bc39['id']);var _0x10d767={'ListId':_0x2ea5fc};var _0x2ab8c2=_0x3616e9['data4']&&_0x3616e9['data4']!=='0'?_0x3616e9[_0xb668('0x26')]:_0xb668('0x15');if(_0x167057){logger[_0xb668('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x567ea9[_0xb668('0x23')],_0x45bc39['id']);_0x10d767[_0x2ab8c2]=_[_0xb668('0xf')](_0x567ea9[_0xb668('0x17')])?_0x567ea9['calleridnum']:_0x567ea9['destcalleridnum'];if(_[_0xb668('0xf')](_0x567ea9[_0xb668('0x17')])){_0x10d767['firstName']=_0x567ea9[_0xb668('0x27')]&&_0x567ea9[_0xb668('0x27')]!==_0xb668('0x28')?_0x567ea9[_0xb668('0x27')]:_0xb668('0x29');}else{_0x10d767['firstName']=_0x567ea9[_0xb668('0x2a')]&&_0x567ea9[_0xb668('0x2a')]!==''?_0x567ea9[_0xb668('0x2a')]:'Unknown';}return BPromise[_0xb668('0x1e')]()[_0xb668('0x1f')](cmContactRpc[_0xb668('0x2b')](_0x10d767))[_0xb668('0x1f')](function(_0x2e40dd){_0x3b15a6=_0x2e40dd;_0x27dbf7[_0xb668('0x2c')](_0x2e40dd);if(_0x3b15a6){logger[_0xb668('0x8')](_0xb668('0x2d'),_0x567ea9[_0xb668('0x23')],_0x45bc39['id'],_0x3b15a6['id']);}return;});}else{logger['info'](_0xb668('0x2e'),_0x567ea9[_0xb668('0x23')],_0x45bc39['id']);_0x10d767[_0x2ab8c2]=_[_0xb668('0xf')](_0x567ea9['routeId'])?_0x567ea9[_0xb668('0x2f')]:_0x567ea9[_0xb668('0x18')];if(_[_0xb668('0xf')](_0x567ea9[_0xb668('0x17')])){_0x10d767['firstName']=_0x567ea9[_0xb668('0x27')]&&_0x567ea9[_0xb668('0x27')]!==_0xb668('0x28')?_0x567ea9[_0xb668('0x27')]:_0xb668('0x29');}else{_0x10d767[_0xb668('0x19')]=_0x567ea9[_0xb668('0x2a')]&&_0x567ea9['destcalleridname']!==_0xb668('0x28')?_0x567ea9[_0xb668('0x2a')]:'Unknown';}_0x3b15a6=_0x10d767;_0x27dbf7[_0xb668('0x2c')](_0x10d767);return;}}})['then'](function(){if(_0x3606a7){emit(_0x567ea9['uniqueid'],_0x45bc39,util[_0xb668('0x30')](_0xb668('0x31'),_0x3606a7['name']),util[_0xb668('0x30')]('trigger:%s',_0x3616e9[_0xb668('0x32')]['toLowerCase']()),{'evt':_['merge'](_0x567ea9,{'autoCreate':_0x167057}),'contact':_0x3b15a6===undefined?{}:_0x3b15a6,'contacts':_0x27dbf7[_0xb668('0x20')]===0x0?undefined:_0x27dbf7});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index c3f001f..adc6412 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 _0x3e2a=['ChatWebsiteId','upperFirst','AccountId','message','event','queue','operator','agent','membername','lastevent','mailSubstatus','null','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/logger','../ami','redis','defaults','localhost','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','salesforceAccounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','emit','prototype','clone','motionChannel','undefined','voice','checkTriggers','hasOwnProperty','status','merge','Actions','interface','action','contactmanager','motionbar','browser','data1','popup','TemplateId','data2','html','render','template\x20not\x20found','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','600','winapp','winApplication','winArguments','format','user:%s','name','toLowerCase','jscripty','trigger:%s','exec','accounts','routeId','urlforward','script','parse','query','search','replace','checkTrigger','channel','AllConditions','length','checkConditions','some','AnyConditions','field','account','chat','value'];(function(_0x3e730f,_0x3f378d){var _0x15a410=function(_0x42d72e){while(--_0x42d72e){_0x3e730f['push'](_0x3e730f['shift']());}};_0x15a410(++_0x3f378d);}(_0x3e2a,0x10c));var _0xa3e2=function(_0x287234,_0x4b9e28){_0x287234=_0x287234-0x0;var _0x4bfc27=_0x3e2a[_0x287234];return _0x4bfc27;};'use strict';var util=require(_0xa3e2('0x0'));var _=require(_0xa3e2('0x1'));var url=require(_0xa3e2('0x2'));var Mustache=require(_0xa3e2('0x3'));var Redis=require(_0xa3e2('0x4'));var urlforward=require(_0xa3e2('0x5'));var integration=require(_0xa3e2('0x6'));var cmContact=require(_0xa3e2('0x7'));var script=require(_0xa3e2('0x8'));var config=require('../../../config/environment');var logger=require(_0xa3e2('0x9'))('trigger');var ami=require(_0xa3e2('0xa'));config[_0xa3e2('0xb')]=_[_0xa3e2('0xc')](config[_0xa3e2('0xb')],{'host':_0xa3e2('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa3e2('0xb')]));var operators={'equals':function(_0x16ffa6,_0x4b00fa){return _0x16ffa6==_0x4b00fa;},'not_equals':function(_0x3b5326,_0x3482d3){return _0x3b5326!=_0x3482d3;}};var barAndWebActions=['popup','url','winapp'];function Trigger(_0x18fe26){this[_0xa3e2('0xe')]=_0x18fe26[_0xa3e2('0xe')];this['agents']=_0x18fe26[_0xa3e2('0xf')];this[_0xa3e2('0x10')]=_0x18fe26[_0xa3e2('0x10')];this['templates']=_0x18fe26[_0xa3e2('0x11')];this[_0xa3e2('0x12')]=_0x18fe26['voiceExtensions'];this[_0xa3e2('0x13')]=_0x18fe26[_0xa3e2('0x13')];this['freshdeskAccounts']=_0x18fe26[_0xa3e2('0x14')];this['salesforceAccounts']=_0x18fe26['salesforceAccounts'];this[_0xa3e2('0x15')]=_0x18fe26[_0xa3e2('0x15')];this[_0xa3e2('0x16')]=_0x18fe26['zohoAccounts'];this[_0xa3e2('0x17')]=_0x18fe26['deskAccounts'];this[_0xa3e2('0x18')]=_0x18fe26['vtigerAccounts'];this[_0xa3e2('0x19')]=_0x18fe26[_0xa3e2('0x19')];this[_0xa3e2('0x1a')]=_0x18fe26[_0xa3e2('0x1a')];this[_0xa3e2('0x1b')]=_0x18fe26[_0xa3e2('0x1b')];this['accounts']={'zendesk':this[_0xa3e2('0x13')],'salesforce':this[_0xa3e2('0x1c')],'freshdesk':this[_0xa3e2('0x14')],'sugarcrm':this[_0xa3e2('0x15')],'zoho':this[_0xa3e2('0x16')],'desk':this[_0xa3e2('0x17')],'vtiger':this[_0xa3e2('0x18')],'dynamics365':this[_0xa3e2('0x1a')],'freshsales':this[_0xa3e2('0x1b')],'servicenow':this['servicenowAccounts']};ami['on'](_0xa3e2('0x1d'),this['syncCustomEvent'][_0xa3e2('0x1e')](this));ami['on'](_0xa3e2('0x1f'),this[_0xa3e2('0x20')]['bind'](this));ami['on'](_0xa3e2('0x21'),this[_0xa3e2('0x20')]['bind'](this));ami['on'](_0xa3e2('0x22'),this[_0xa3e2('0x20')][_0xa3e2('0x1e')](this));ami['on']('custom:agentnosuchnumber',this['syncCustomEvent']['bind'](this));ami['on'](_0xa3e2('0x23'),this[_0xa3e2('0x20')][_0xa3e2('0x1e')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0xa3e2('0x1e')](this));ami['on'](_0xa3e2('0x24'),this[_0xa3e2('0x20')]['bind'](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0xa3e2('0x1e')](this));ami['on'](_0xa3e2('0x25'),this[_0xa3e2('0x20')][_0xa3e2('0x1e')](this));ami['on'](_0xa3e2('0x26'),this[_0xa3e2('0x20')][_0xa3e2('0x1e')](this));ami['on'](_0xa3e2('0x27'),this[_0xa3e2('0x20')][_0xa3e2('0x1e')](this));ami['on'](_0xa3e2('0x28'),this['syncAgentDial'][_0xa3e2('0x1e')](this));ami['on']('custom:dialconnect',this[_0xa3e2('0x29')][_0xa3e2('0x1e')](this));ami['on']('custom:dialend',this[_0xa3e2('0x29')][_0xa3e2('0x1e')](this));ami['on']('custom:newinteraction',this[_0xa3e2('0x20')][_0xa3e2('0x1e')](this));ami['on'](_0xa3e2('0x2a'),this[_0xa3e2('0x20')][_0xa3e2('0x1e')](this));ami['on'](_0xa3e2('0x2b'),this[_0xa3e2('0x20')][_0xa3e2('0x1e')](this));ami['on']('custom:incomingmessage',this[_0xa3e2('0x20')][_0xa3e2('0x1e')](this));ami['on'](_0xa3e2('0x2c'),this[_0xa3e2('0x20')][_0xa3e2('0x1e')](this));ami['on']('custom:acceptmessage',this['syncCustomEvent'][_0xa3e2('0x1e')](this));ami['on'](_0xa3e2('0x2d'),this[_0xa3e2('0x20')]['bind'](this));ami['on'](_0xa3e2('0x2e'),this[_0xa3e2('0x20')][_0xa3e2('0x1e')](this));}Trigger['prototype'][_0xa3e2('0x2f')]=function(_0x48172e,_0x486884,_0x1cd942){logger['info'](_0x48172e,_0x486884,JSON['stringify'](_0x1cd942));io['to'](_0x48172e)[_0xa3e2('0x2f')](_0x486884,_0x1cd942);};Trigger[_0xa3e2('0x30')]['syncCustomEvent']=function(_0x433d51){var _0x568b1f=_[_0xa3e2('0x31')](_0x433d51);if(typeof _0x568b1f[_0xa3e2('0x32')]===_0xa3e2('0x33')){_0x568b1f[_0xa3e2('0x32')]=_0xa3e2('0x34');}this[_0xa3e2('0x35')](_0x568b1f);};Trigger[_0xa3e2('0x30')][_0xa3e2('0x29')]=function(_0x1df74d){if(this[_0xa3e2('0xf')][_0x1df74d['interface']]){this['syncCustomEvent'](_0x1df74d);}};Trigger[_0xa3e2('0x30')][_0xa3e2('0x35')]=function(_0x4f2cd2){var _0x5e13e0;for(var _0x3dd9e8 in this[_0xa3e2('0xe')]){if(this[_0xa3e2('0xe')][_0xa3e2('0x36')](_0x3dd9e8)){if(this[_0xa3e2('0xe')][_0x3dd9e8][_0xa3e2('0x37')]){_0x5e13e0=this['checkTrigger'](this[_0xa3e2('0xe')][_0x3dd9e8],_0x4f2cd2);if(_0x5e13e0){_[_0xa3e2('0x38')](_0x4f2cd2,_0x4f2cd2['variables']);for(var _0x76beaf=0x0,_0x47bdc0,_0x2339a9,_0x1ae5b8;_0x76beaf0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _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(_0x5096ac,_0x3ebd43){var _0x1db7c1=function(_0x52b541){while(--_0x52b541){_0x5096ac['push'](_0x5096ac['shift']());}};_0x1db7c1(++_0x3ebd43);}(_0x7217,0x19e));var _0x7721=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x7217[_0x37bd26];return _0xe83dc4;};'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 8cd8161..4a1ee79 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 _0x7570=['remoteUri','CloudProvider','data7','tenantId','resolve','clientId','username','password','clientSecret','then','access_token','catch','error','toUpperCase','Bearer\x20','4.0','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId','systemuserid','userEmail','message','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','headers','odata-entityid','substring','lastIndexOf','enduserId','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','telephone1','contactid','nothing',']\x20Enduser\x20created!','includes','string','picklist','type','nameField','customField','idField','indexOf','incident','incidents','assign','getString','Subjects','Descriptions','/systemusers(','Fields','ticketType','phonecall','callDirection','/contacts(','queue','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication'];(function(_0x234e35,_0x13fdbc){var _0x1ba6aa=function(_0x440b66){while(--_0x440b66){_0x234e35['push'](_0x234e35['shift']());}};_0x1ba6aa(++_0x13fdbc);}(_0x7570,0x18d));var _0x0757=function(_0x14734f,_0x13c6b6){_0x14734f=_0x14734f-0x0;var _0x237c5c=_0x7570[_0x14734f];return _0x237c5c;};'use strict';var _=require('lodash');var rp=require(_0x0757('0x0'));var util=require(_0x0757('0x1'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x0757('0x2'));var logger=require(_0x0757('0x3'))(_0x0757('0x4'));var config=require(_0x0757('0x5'));config[_0x0757('0x6')]=_[_0x0757('0x7')](config[_0x0757('0x6')],{'host':_0x0757('0x8'),'port':0x18eb});var io=require(_0x0757('0x9'))(new Redis(config[_0x0757('0x6')]));function getAuthToken(_0x454675,_0x246e71,_0x4d5c9f){if(_0x454675[_0x0757('0xa')]){_0x454675[_0x0757('0xb')]=_0x454675[_0x0757('0xc')][_0x0757('0xd')];_0x454675[_0x0757('0xe')]=_0x454675[_0x0757('0xc')]['data2'];return Promise[_0x0757('0xf')](_0x454675[_0x0757('0xc')]['data5']);}var _0x279bab={'method':'POST','uri':_0x246e71,'form':{'client_id':_0x454675[_0x0757('0x10')],'resource':_0x454675[_0x0757('0xb')],'username':_0x454675[_0x0757('0x11')],'password':_0x454675['password'],'grant_type':_0x0757('0x12'),'client_secret':_0x454675[_0x0757('0x13')]},'json':!![]};return rp(_0x279bab)[_0x0757('0x14')](function(_0x36256d){return _0x36256d[_0x0757('0x15')];})[_0x0757('0x16')](function(_0x3d698d){logger[_0x0757('0x17')]('['+[_0x4d5c9f[_0x0757('0x18')]()]+']\x20Wrong\x20credentials!');return _0x3d698d['message'];});}function getUser(_0x5f5452,_0x4d2f1b,_0x325b08,_0x594a95,_0x1203f0,_0x193d27){return new Promise(function(_0x679f47,_0x1fb070){return getAuthToken(_0x4d2f1b,_0x594a95,_0x193d27)[_0x0757('0x14')](function(_0x455bdf){var _0x163478={'method':'GET','uri':_0x1203f0+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x0757('0x19')+_0x455bdf,'OData-Version':_0x0757('0x1a')},'json':!![]};return rp(_0x163478);})[_0x0757('0x14')](function(_0x98d578){var _0x5eab31=_0x98d578['value'];var _0x36af7e=![];var _0x3d6979=null;if(!_[_0x0757('0x1b')](_0x325b08)){if(intUtil[_0x0757('0x1c')](_0x325b08['email'])){_0x5f5452['userEmail']=_0x325b08[_0x0757('0x1d')];for(_0x3d6979=0x0;_0x3d6979<_0x5eab31[_0x0757('0x1e')];_0x3d6979++){if(_0x5eab31[_0x3d6979][_0x0757('0x1f')]===_0x325b08['email']&&!_0x5eab31[_0x3d6979][_0x0757('0x20')]){_0x36af7e=!![];logger[_0x0757('0x21')]('['+[_0x193d27[_0x0757('0x18')]()]+_0x0757('0x22')+_0x5eab31[_0x3d6979]['systemuserid']+'!');_0x5f5452[_0x0757('0x23')]=_0x5eab31[_0x3d6979][_0x0757('0x24')];}}}}if(!_0x36af7e){logger[_0x0757('0x21')]('['+[_0x193d27[_0x0757('0x18')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x5f5452[_0x0757('0x25')]=_0x4d2f1b[_0x0757('0x11')];for(_0x3d6979=0x0;_0x3d6979<_0x5eab31[_0x0757('0x1e')];_0x3d6979++){if(_0x5eab31[_0x3d6979][_0x0757('0x1f')]===_0x4d2f1b['username']){_0x5f5452['userId']=_0x5eab31[_0x3d6979][_0x0757('0x24')];}}}_0x679f47(_0x5f5452);})[_0x0757('0x16')](function(_0x48c263){_0x1fb070(_0x48c263[_0x0757('0x26')]);});});}function createEndUser(_0x397458,_0x4c4664,_0x59d546,_0x2fab93,_0x5ca302,_0x8709bc){return new Promise(function(_0x44ccc8,_0x44ee60){return getAuthToken(_0x4c4664,_0x59d546,_0x8709bc)['then'](function(_0x154932){var _0x3b2a50=_0x8709bc[_0x0757('0x27')]()===_0x0757('0x28')?_0x5ca302[_0x0757('0x29')]:_0x5ca302[_0x0757('0x2a')];var _0x3bb795={'method':_0x0757('0x2b'),'uri':_0x2fab93+_0x0757('0x2c'),'body':{'telephone1':_0x3b2a50,'fullname':_0x3b2a50,'firstname':_0x3b2a50,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x397458[_0x0757('0x23')]+')'},'headers':{'Authorization':_0x0757('0x19')+_0x154932,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3bb795);})[_0x0757('0x14')](function(_0x4ec0eb){var _0x395720=_0x4ec0eb[_0x0757('0x2d')][_0x0757('0x2e')];var _0xad5d16=_0x395720[_0x0757('0x2f')](_0x395720[_0x0757('0x30')]('(')+0x1,_0x395720[_0x0757('0x30')](')'));_0x397458[_0x0757('0x31')]=_0xad5d16;_0x44ccc8(_0x397458);})[_0x0757('0x16')](function(_0x3fb653){_0x44ee60(_0x3fb653['message']);});});}function getEndUser(_0x315524,_0x1491bc,_0x589215,_0x4fdf2d,_0xfddf08,_0x227644,_0x4e119a){var _0x16dde1=_0x227644[_0x0757('0x27')]()==='outbound'?_0xfddf08[_0x0757('0x29')]:_0xfddf08[_0x0757('0x2a')];return getAuthToken(_0x1491bc,_0x589215,_0x227644)['then'](function(_0x178733){var _0x37ac35={'method':_0x0757('0x32'),'uri':_0x4fdf2d+_0x0757('0x33')+_0x16dde1[_0x0757('0x34')]('+','%2b')+'\x27','headers':{'Authorization':_0x0757('0x19')+_0x178733,'If-None-Match':null,'OData-Version':_0x0757('0x1a')},'json':!![]};return rp(_0x37ac35);})['then'](function(_0x9cc20){var _0x3ae63f=![];if(!_0x9cc20)return _0x3ae63f;var _0x3279b7=_0x9cc20['value'];for(var _0x46c31b=0x0;_0x46c31b<_0x3279b7['length'];_0x46c31b++){if(_0x3279b7[_0x46c31b][_0x0757('0x35')]===_0x16dde1){_0x3ae63f=!![];_0x315524[_0x0757('0x31')]=_0x3279b7[_0x46c31b][_0x0757('0x36')];}}return _0x3ae63f;})[_0x0757('0x14')](function(_0x572a9b){if(_0x572a9b)return _0x315524;if(_0x4e119a===_0x0757('0x37')){logger['info']('['+[_0x227644[_0x0757('0x18')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x315524;}return createEndUser(_0x315524,_0x1491bc,_0x589215,_0x4fdf2d,_0xfddf08,_0x227644)[_0x0757('0x14')](function(_0x50c594){logger[_0x0757('0x21')]('['+[_0x227644['toUpperCase']()]+_0x0757('0x38'),_0x50c594[_0x0757('0x31')]);return _0x50c594;});});}function getCustomFields(_0x3b3a5d,_0x156594,_0x1f17db){var _0x223a68={};if(_0x3b3a5d['length']>0x0){_['forEach'](_0x3b3a5d,function(_0x1efe7e){if(_[_0x0757('0x39')]([_0x0757('0x3a'),_0x0757('0x3b')],_0x1efe7e[_0x0757('0x3c')])&&_0x1efe7e[_0x0757('0x3d')]&&!_0x1efe7e[_0x0757('0x3e')]){var _0x5df601=_0x1efe7e[_0x0757('0x3f')][_0x0757('0x27')]();var _0x24ce30=_0x5df601[_0x0757('0x2f')](0x0,_0x5df601[_0x0757('0x40')]('_'));var _0x4949f9=_0x5df601[_0x0757('0x2f')](_0x5df601[_0x0757('0x40')]('_')+0x1);if(_0x24ce30===_0x1f17db){_0x223a68[_0x4949f9]=_0x1efe7e['content'];}}});}return _0x223a68;}function getTicket(_0x3ac50c,_0xd9292a,_0x188d8a,_0x36e45d,_0x10a533,_0x5d05f2,_0x76a366){return new Promise(function(_0x128c4c,_0x3228e2){var _0x430e9a;return getAuthToken(_0xd9292a,_0x188d8a,_0x76a366)['then'](function(_0x209092){if(_0x5d05f2['ticketType']===_0x0757('0x41')){_0x430e9a={'method':'POST','uri':_0x36e45d+_0x0757('0x42'),'body':Object[_0x0757('0x43')]({},{'title':intUtil[_0x0757('0x44')](_0x5d05f2[_0x0757('0x45')],_0x10a533,'\x20'),'description':intUtil[_0x0757('0x44')](_0x5d05f2[_0x0757('0x46')],_0x10a533,'\x0a'),'customerid_contact@odata.bind':_0x3ac50c['enduserId']?'/contacts('+_0x3ac50c['enduserId']+')':undefined,'ownerid@odata.bind':_0x0757('0x47')+_0x3ac50c[_0x0757('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x5d05f2[_0x0757('0x48')],_0x10a533,_0x5d05f2[_0x0757('0x49')])),'headers':{'Authorization':_0x0757('0x19')+_0x209092,'OData-Version':_0x0757('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5d05f2[_0x0757('0x49')]===_0x0757('0x4a')){var _0x328a00=_0x3ac50c[_0x0757('0x31')]?[{'partyid_systemuser@odata.bind':_0x0757('0x47')+_0x3ac50c[_0x0757('0x23')]+')','participationtypemask':_0x3ac50c[_0x0757('0x4b')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x0757('0x4c')+_0x3ac50c['enduserId']+')','participationtypemask':_0x3ac50c[_0x0757('0x4b')]===_0x0757('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x0757('0x47')+_0x3ac50c['userId']+')','participationtypemask':_0x3ac50c[_0x0757('0x4b')]===_0x0757('0x4d')?0x2:0x1}];_0x430e9a={'method':_0x0757('0x2b'),'uri':_0x36e45d+_0x0757('0x4e'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x5d05f2[_0x0757('0x45')],_0x10a533,'\x20'),'phonenumber':String(_0x10a533[_0x0757('0x2a')]),'description':intUtil[_0x0757('0x44')](_0x5d05f2['Descriptions'],_0x10a533,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3ac50c[_0x0757('0x31')]?_0x0757('0x4c')+_0x3ac50c[_0x0757('0x31')]+')':undefined,'ownerid@odata.bind':_0x0757('0x47')+_0x3ac50c[_0x0757('0x23')]+')','directioncode':_0x3ac50c['callDirection']===_0x0757('0x4d')?![]:!![],'phonecall_activity_parties':_0x328a00},getCustomFields(_0x5d05f2[_0x0757('0x48')],_0x10a533,_0x5d05f2['ticketType'])),'headers':{'Authorization':_0x0757('0x19')+_0x209092,'OData-Version':_0x0757('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x430e9a);})['then'](function(_0x48837d){var _0x4a0e00=_0x48837d[_0x0757('0x2d')][_0x0757('0x2e')];var _0x597a31=_0x4a0e00[_0x0757('0x2f')](_0x4a0e00[_0x0757('0x30')]('(')+0x1,_0x4a0e00[_0x0757('0x30')](')'));_0x3ac50c[_0x0757('0x4f')]=_0x597a31;_0x128c4c(_0x3ac50c);})['catch'](function(_0x1fafa4){_0x3228e2(_0x1fafa4[_0x0757('0x26')]);});});}function emit(_0x12bdbe,_0x28619a,_0x3f85ef,_0x5b37b9){var _0x36d80a={'uri':util[_0x0757('0x50')](_0x0757('0x51'),_0x12bdbe,_0x3f85ef,_0x5b37b9)};io['to'](util[_0x0757('0x50')]('user:%s',_0x28619a))['emit'](_0x0757('0x52'),_0x36d80a);}exports['cs']=function(_0x3a6b4b,_0x3266ce,_0x102ee6,_0x1e54c1,_0x518549,_0x1f5772,_0x12367d,_0x299ba9){var _0x390bf2={};_0x1f5772[_0x0757('0xb')]=_0x1f5772['modernAuthentication']?intUtil[_0x0757('0x53')](_0x1f5772[_0x0757('0xc')][_0x0757('0xd')]):intUtil['stripTrailingSlash'](_0x1f5772[_0x0757('0xb')]);_0x1f5772[_0x0757('0x54')]=intUtil[_0x0757('0x53')](_0x1f5772[_0x0757('0x54')]);_0x390bf2[_0x0757('0x4b')]=_0x299ba9==='queue'||_0x299ba9===_0x0757('0x55')?_0x0757('0x4d'):_0x0757('0x28');var _0x8ce2f7=_0x1f5772[_0x0757('0xa')]?util['format'](_0x0757('0x56'),_0x1f5772['CloudProvider'][_0x0757('0xd')]):util['format'](_0x0757('0x56'),_0x1f5772[_0x0757('0xb')]);var _0x3080dd=util[_0x0757('0x50')](_0x0757('0x57'),_0x1f5772[_0x0757('0xe')]);var _0x234864=util[_0x0757('0x50')](_0x0757('0x58'),_0x1f5772[_0x0757('0x54')],_0x3266ce[_0x0757('0x59')],md5(_0x3266ce[_0x0757('0x59')]));if(_0x518549&&_0x518549[_0x0757('0x5a')]){logger[_0x0757('0x21')](_0x0757('0x5b'),'Recording\x20is\x20enabled!');_0x3266ce[_0x0757('0x5c')]=_0x234864;}else if(_0x12367d&&_0x12367d['recordingFormat']&&_0x12367d[_0x0757('0x5d')]!==_0x0757('0x5e')){logger['info'](_0x0757('0x5f'),_0x0757('0x60'));_0x3266ce['recordingURL']=_0x234864;}else{_0x3266ce[_0x0757('0x5c')]='';}return getUser(_0x390bf2,_0x1f5772,_0x1e54c1,_0x3080dd,_0x8ce2f7,_0x299ba9)['then'](function(_0x1f608f){logger[_0x0757('0x21')]('['+_0x299ba9[_0x0757('0x18')]()+']\x20The\x20User\x20ID\x20is:',_0x1f608f['userId']);logger['info']('['+_0x299ba9[_0x0757('0x18')]()+']\x20The\x20User\x20email\x20is:',_0x1f608f[_0x0757('0x25')]);return getEndUser(_0x1f608f,_0x1f5772,_0x3080dd,_0x8ce2f7,_0x3266ce,_0x299ba9,_0x102ee6[_0x0757('0x61')]);})['then'](function(_0x10baeb){logger[_0x0757('0x21')]('['+_0x299ba9[_0x0757('0x18')]()+_0x0757('0x62'),_0x10baeb['enduserId']);logger[_0x0757('0x21')]('['+_0x299ba9[_0x0757('0x18')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x3266ce[_0x0757('0x2a')]);return getTicket(_0x10baeb,_0x1f5772,_0x3080dd,_0x8ce2f7,_0x3266ce,_0x102ee6,_0x299ba9);})[_0x0757('0x14')](function(_0x33d413){logger['info'](util[_0x0757('0x50')]('['+_0x299ba9['toUpperCase']()+_0x0757('0x63'),_0x102ee6['ticketType'],_0x33d413[_0x0757('0x4f')]));logger[_0x0757('0x21')](util[_0x0757('0x50')]('['+_0x299ba9[_0x0757('0x18')]()+_0x0757('0x64'),_0x299ba9));if(_0x299ba9!==_0x0757('0x55')){logger[_0x0757('0x21')]('['+_0x299ba9[_0x0757('0x18')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1f5772[_0x0757('0xb')],_0x1e54c1['name'],_0x102ee6[_0x0757('0x49')],_0x33d413[_0x0757('0x4f')]);}})[_0x0757('0x16')](function(_0x3eba3e){logger[_0x0757('0x17')]('['+_0x299ba9[_0x0757('0x18')]()+_0x0757('0x65'),_0x3eba3e['message']);});}; \ No newline at end of file +var _0x9d2c=['request-promise','util','./util','md5','ioredis','../../../../config/logger','redis','defaults','localhost','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','clientId','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','value','isNil','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','outbound','calleridnum','POST','contacts','/systemusers(','userId','Bearer\x20','4.0','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','customField','idField','indexOf','incident','assign','getString','Subjects','Descriptions','ticketType','callDirection','queue','phonecalls','/contacts(','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','%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\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s',']\x20Error\x20running\x20Dynamics365\x20integration','lodash'];(function(_0xf894c2,_0x12a43c){var _0x151400=function(_0x1f9c63){while(--_0x1f9c63){_0xf894c2['push'](_0xf894c2['shift']());}};_0x151400(++_0x12a43c);}(_0x9d2c,0x68));var _0xc9d2=function(_0x49eb46,_0x1f8e82){_0x49eb46=_0x49eb46-0x0;var _0x11bcd2=_0x9d2c[_0x49eb46];return _0x11bcd2;};'use strict';var _=require(_0xc9d2('0x0'));var rp=require(_0xc9d2('0x1'));var util=require(_0xc9d2('0x2'));var intUtil=require(_0xc9d2('0x3'));var md5=require(_0xc9d2('0x4'));var Redis=require(_0xc9d2('0x5'));var logger=require(_0xc9d2('0x6'))('dynamics365');var config=require('../../../../config/environment');config[_0xc9d2('0x7')]=_[_0xc9d2('0x8')](config[_0xc9d2('0x7')],{'host':_0xc9d2('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc9d2('0x7')]));function getAuthToken(_0x13e158,_0x336d68,_0x22ac7e){if(_0x13e158[_0xc9d2('0xa')]){_0x13e158[_0xc9d2('0xb')]=_0x13e158[_0xc9d2('0xc')][_0xc9d2('0xd')];_0x13e158[_0xc9d2('0xe')]=_0x13e158[_0xc9d2('0xc')][_0xc9d2('0xf')];return Promise[_0xc9d2('0x10')](_0x13e158[_0xc9d2('0xc')][_0xc9d2('0x11')]);}var _0x39973d={'method':'POST','uri':_0x336d68,'form':{'client_id':_0x13e158[_0xc9d2('0x12')],'resource':_0x13e158[_0xc9d2('0xb')],'username':_0x13e158[_0xc9d2('0x13')],'password':_0x13e158['password'],'grant_type':_0xc9d2('0x14'),'client_secret':_0x13e158['clientSecret']},'json':!![]};return rp(_0x39973d)[_0xc9d2('0x15')](function(_0x5406b0){return _0x5406b0[_0xc9d2('0x16')];})[_0xc9d2('0x17')](function(_0x516447){logger[_0xc9d2('0x18')]('['+[_0x22ac7e[_0xc9d2('0x19')]()]+_0xc9d2('0x1a'));return _0x516447[_0xc9d2('0x1b')];});}function getUser(_0x2d5d66,_0xca8ff8,_0x5c560c,_0x3e5572,_0x62d465,_0x44077e){return new Promise(function(_0x2fa19d,_0xa327c7){return getAuthToken(_0xca8ff8,_0x3e5572,_0x44077e)[_0xc9d2('0x15')](function(_0x5d7d47){var _0x1ff3e6={'method':_0xc9d2('0x1c'),'uri':_0x62d465+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x5d7d47,'OData-Version':'4.0'},'json':!![]};return rp(_0x1ff3e6);})[_0xc9d2('0x15')](function(_0x55528d){var _0x51ffee=_0x55528d[_0xc9d2('0x1d')];var _0x4b5c3f=![];var _0x258a55=null;if(!_[_0xc9d2('0x1e')](_0x5c560c)){if(intUtil['validateEmail'](_0x5c560c[_0xc9d2('0x1f')])){_0x2d5d66[_0xc9d2('0x20')]=_0x5c560c[_0xc9d2('0x1f')];for(_0x258a55=0x0;_0x258a55<_0x51ffee[_0xc9d2('0x21')];_0x258a55++){if(_0x51ffee[_0x258a55][_0xc9d2('0x22')]===_0x5c560c[_0xc9d2('0x1f')]&&!_0x51ffee[_0x258a55][_0xc9d2('0x23')]){_0x4b5c3f=!![];logger[_0xc9d2('0x24')]('['+[_0x44077e[_0xc9d2('0x19')]()]+_0xc9d2('0x25')+_0x51ffee[_0x258a55][_0xc9d2('0x26')]+'!');_0x2d5d66['userId']=_0x51ffee[_0x258a55][_0xc9d2('0x26')];}}}}if(!_0x4b5c3f){logger[_0xc9d2('0x24')]('['+[_0x44077e['toUpperCase']()]+_0xc9d2('0x27'));_0x2d5d66[_0xc9d2('0x20')]=_0xca8ff8['username'];for(_0x258a55=0x0;_0x258a55<_0x51ffee[_0xc9d2('0x21')];_0x258a55++){if(_0x51ffee[_0x258a55]['internalemailaddress']===_0xca8ff8[_0xc9d2('0x13')]){_0x2d5d66['userId']=_0x51ffee[_0x258a55]['systemuserid'];}}}_0x2fa19d(_0x2d5d66);})[_0xc9d2('0x17')](function(_0x55ebf1){_0xa327c7(_0x55ebf1[_0xc9d2('0x1b')]);});});}function createEndUser(_0x3e1625,_0x572a1b,_0x2f52d8,_0x5278ac,_0x4682a1,_0x4f5d46){return new Promise(function(_0x21600e,_0x30d8d6){return getAuthToken(_0x572a1b,_0x2f52d8,_0x4f5d46)[_0xc9d2('0x15')](function(_0x121183){var _0x238cd9=_0x4f5d46['toLowerCase']()===_0xc9d2('0x28')?_0x4682a1['destcalleridnum']:_0x4682a1[_0xc9d2('0x29')];var _0x1d75a3={'method':_0xc9d2('0x2a'),'uri':_0x5278ac+_0xc9d2('0x2b'),'body':{'telephone1':_0x238cd9,'fullname':_0x238cd9,'firstname':_0x238cd9,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc9d2('0x2c')+_0x3e1625[_0xc9d2('0x2d')]+')'},'headers':{'Authorization':_0xc9d2('0x2e')+_0x121183,'OData-Version':_0xc9d2('0x2f')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x1d75a3);})['then'](function(_0x2f5299){var _0xaa6da4=_0x2f5299[_0xc9d2('0x30')][_0xc9d2('0x31')];var _0x1fbb2f=_0xaa6da4[_0xc9d2('0x32')](_0xaa6da4[_0xc9d2('0x33')]('(')+0x1,_0xaa6da4[_0xc9d2('0x33')](')'));_0x3e1625[_0xc9d2('0x34')]=_0x1fbb2f;_0x21600e(_0x3e1625);})[_0xc9d2('0x17')](function(_0x1f48e6){_0x30d8d6(_0x1f48e6[_0xc9d2('0x1b')]);});});}function getEndUser(_0xbe7517,_0x2d2af5,_0xa81e69,_0x45259b,_0x4c8a55,_0x407df1,_0x2b35b8){var _0x3ec492=_0x407df1[_0xc9d2('0x35')]()==='outbound'?_0x4c8a55['destcalleridnum']:_0x4c8a55[_0xc9d2('0x29')];return getAuthToken(_0x2d2af5,_0xa81e69,_0x407df1)[_0xc9d2('0x15')](function(_0x328e3f){var _0x5c9404={'method':'GET','uri':_0x45259b+_0xc9d2('0x36')+_0x3ec492[_0xc9d2('0x37')]('+',_0xc9d2('0x38'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x328e3f,'If-None-Match':null,'OData-Version':_0xc9d2('0x2f')},'json':!![]};return rp(_0x5c9404);})[_0xc9d2('0x15')](function(_0x96f5d9){var _0x112e78=![];if(!_0x96f5d9)return _0x112e78;var _0x14228a=_0x96f5d9[_0xc9d2('0x1d')];for(var _0x4db801=0x0;_0x4db801<_0x14228a[_0xc9d2('0x21')];_0x4db801++){if(_0x14228a[_0x4db801][_0xc9d2('0x39')]===_0x3ec492){_0x112e78=!![];_0xbe7517['enduserId']=_0x14228a[_0x4db801][_0xc9d2('0x3a')];}}return _0x112e78;})[_0xc9d2('0x15')](function(_0x1aed1a){if(_0x1aed1a)return _0xbe7517;if(_0x2b35b8===_0xc9d2('0x3b')){logger[_0xc9d2('0x24')]('['+[_0x407df1[_0xc9d2('0x19')]()]+_0xc9d2('0x3c'));return _0xbe7517;}return createEndUser(_0xbe7517,_0x2d2af5,_0xa81e69,_0x45259b,_0x4c8a55,_0x407df1)['then'](function(_0x36d3d5){logger[_0xc9d2('0x24')]('['+[_0x407df1[_0xc9d2('0x19')]()]+']\x20Enduser\x20created!',_0x36d3d5['enduserId']);return _0x36d3d5;});});}function getCustomFields(_0x5a7926,_0x40f907,_0x44981d){var _0x5d104b={};if(_0x5a7926['length']>0x0){_[_0xc9d2('0x3d')](_0x5a7926,function(_0x3fee8a){if(_[_0xc9d2('0x3e')]([_0xc9d2('0x3f'),_0xc9d2('0x40')],_0x3fee8a[_0xc9d2('0x41')])&&_0x3fee8a['nameField']&&!_0x3fee8a[_0xc9d2('0x42')]){var _0x3fa9e1=_0x3fee8a[_0xc9d2('0x43')][_0xc9d2('0x35')]();var _0xd8f5ff=_0x3fa9e1['substring'](0x0,_0x3fa9e1[_0xc9d2('0x44')]('_'));var _0xc6ce5c=_0x3fa9e1[_0xc9d2('0x32')](_0x3fa9e1[_0xc9d2('0x44')]('_')+0x1);if(_0xd8f5ff===_0x44981d){_0x5d104b[_0xc6ce5c]=_0x3fee8a['content'];}}});}return _0x5d104b;}function getTicket(_0x2cc31d,_0xeb4835,_0x1c96e2,_0x1bf24d,_0x5dd038,_0x2493e7,_0x95ac29){return new Promise(function(_0x27fdcc,_0x420acf){var _0x2b4112;return getAuthToken(_0xeb4835,_0x1c96e2,_0x95ac29)['then'](function(_0x663c12){if(_0x2493e7['ticketType']===_0xc9d2('0x45')){_0x2b4112={'method':_0xc9d2('0x2a'),'uri':_0x1bf24d+'incidents','body':Object[_0xc9d2('0x46')]({},{'title':intUtil[_0xc9d2('0x47')](_0x2493e7[_0xc9d2('0x48')],_0x5dd038,'\x20'),'description':intUtil['getString'](_0x2493e7[_0xc9d2('0x49')],_0x5dd038,'\x0a'),'customerid_contact@odata.bind':_0x2cc31d[_0xc9d2('0x34')]?'/contacts('+_0x2cc31d['enduserId']+')':undefined,'ownerid@odata.bind':_0xc9d2('0x2c')+_0x2cc31d[_0xc9d2('0x2d')]+')','caseorigincode':'1'},getCustomFields(_0x2493e7['Fields'],_0x5dd038,_0x2493e7[_0xc9d2('0x4a')])),'headers':{'Authorization':'Bearer\x20'+_0x663c12,'OData-Version':_0xc9d2('0x2f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2493e7['ticketType']==='phonecall'){var _0x157cc4=_0x2cc31d[_0xc9d2('0x34')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2cc31d[_0xc9d2('0x2d')]+')','participationtypemask':_0x2cc31d[_0xc9d2('0x4b')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x2cc31d['enduserId']+')','participationtypemask':_0x2cc31d[_0xc9d2('0x4b')]===_0xc9d2('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xc9d2('0x2c')+_0x2cc31d[_0xc9d2('0x2d')]+')','participationtypemask':_0x2cc31d[_0xc9d2('0x4b')]===_0xc9d2('0x4c')?0x2:0x1}];_0x2b4112={'method':_0xc9d2('0x2a'),'uri':_0x1bf24d+_0xc9d2('0x4d'),'body':Object[_0xc9d2('0x46')]({},{'subject':intUtil['getString'](_0x2493e7[_0xc9d2('0x48')],_0x5dd038,'\x20'),'phonenumber':String(_0x5dd038[_0xc9d2('0x29')]),'description':intUtil[_0xc9d2('0x47')](_0x2493e7[_0xc9d2('0x49')],_0x5dd038,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2cc31d[_0xc9d2('0x34')]?_0xc9d2('0x4e')+_0x2cc31d[_0xc9d2('0x34')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2cc31d['userId']+')','directioncode':_0x2cc31d[_0xc9d2('0x4b')]===_0xc9d2('0x4c')?![]:!![],'phonecall_activity_parties':_0x157cc4},getCustomFields(_0x2493e7[_0xc9d2('0x4f')],_0x5dd038,_0x2493e7[_0xc9d2('0x4a')])),'headers':{'Authorization':_0xc9d2('0x2e')+_0x663c12,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2b4112);})[_0xc9d2('0x15')](function(_0x33a08f){var _0x48b249=_0x33a08f[_0xc9d2('0x30')][_0xc9d2('0x31')];var _0x5cad81=_0x48b249[_0xc9d2('0x32')](_0x48b249['lastIndexOf']('(')+0x1,_0x48b249[_0xc9d2('0x33')](')'));_0x2cc31d[_0xc9d2('0x50')]=_0x5cad81;_0x27fdcc(_0x2cc31d);})[_0xc9d2('0x17')](function(_0x2ae922){_0x420acf(_0x2ae922[_0xc9d2('0x1b')]);});});}function emit(_0x5db8aa,_0x3972bd,_0x13b1c5,_0x212dfe){var _0x41b27f={'uri':util[_0xc9d2('0x51')](_0xc9d2('0x52'),_0x5db8aa,_0x13b1c5,_0x212dfe)};io['to'](util[_0xc9d2('0x51')](_0xc9d2('0x53'),_0x3972bd))[_0xc9d2('0x54')](_0xc9d2('0x55'),_0x41b27f);}exports['cs']=function(_0x599218,_0x358c27,_0x4a9c0d,_0x24693a,_0x5a3ab7,_0x3d6048,_0x4c6281,_0x3a379d){var _0x438d93={};_0x3d6048['remoteUri']=_0x3d6048[_0xc9d2('0xa')]?intUtil[_0xc9d2('0x56')](_0x3d6048[_0xc9d2('0xc')]['data7']):intUtil[_0xc9d2('0x56')](_0x3d6048[_0xc9d2('0xb')]);_0x3d6048[_0xc9d2('0x57')]=intUtil[_0xc9d2('0x56')](_0x3d6048[_0xc9d2('0x57')]);_0x438d93[_0xc9d2('0x4b')]=_0x3a379d===_0xc9d2('0x4c')||_0x3a379d===_0xc9d2('0x58')?'queue':_0xc9d2('0x28');var _0x6e8d9c=_0x3d6048[_0xc9d2('0xa')]?util[_0xc9d2('0x51')](_0xc9d2('0x59'),_0x3d6048['CloudProvider']['data7']):util[_0xc9d2('0x51')](_0xc9d2('0x59'),_0x3d6048[_0xc9d2('0xb')]);var _0x13f0ca=util[_0xc9d2('0x51')]('https://login.microsoftonline.com/%s/oauth2/token',_0x3d6048[_0xc9d2('0xe')]);var _0x1262f6=util[_0xc9d2('0x51')](_0xc9d2('0x5a'),_0x3d6048['serverUrl'],_0x358c27[_0xc9d2('0x5b')],md5(_0x358c27[_0xc9d2('0x5b')]));if(_0x5a3ab7&&_0x5a3ab7[_0xc9d2('0x5c')]){logger['info'](_0xc9d2('0x5d'),_0xc9d2('0x5e'));_0x358c27['recordingURL']=_0x1262f6;}else if(_0x4c6281&&_0x4c6281[_0xc9d2('0x5f')]&&_0x4c6281['recordingFormat']!==_0xc9d2('0x60')){logger[_0xc9d2('0x24')](_0xc9d2('0x61'),'Recording\x20is\x20enabled!');_0x358c27[_0xc9d2('0x62')]=_0x1262f6;}else{_0x358c27[_0xc9d2('0x62')]='';}return getUser(_0x438d93,_0x3d6048,_0x24693a,_0x13f0ca,_0x6e8d9c,_0x3a379d)[_0xc9d2('0x15')](function(_0x1ade99){logger[_0xc9d2('0x24')]('['+_0x3a379d[_0xc9d2('0x19')]()+_0xc9d2('0x63'),_0x1ade99[_0xc9d2('0x2d')]);logger[_0xc9d2('0x24')]('['+_0x3a379d[_0xc9d2('0x19')]()+']\x20The\x20User\x20email\x20is:',_0x1ade99[_0xc9d2('0x20')]);return getEndUser(_0x1ade99,_0x3d6048,_0x13f0ca,_0x6e8d9c,_0x358c27,_0x3a379d,_0x4a9c0d['moduleCreate']);})[_0xc9d2('0x15')](function(_0x445cd5){logger['info']('['+_0x3a379d[_0xc9d2('0x19')]()+_0xc9d2('0x64'),_0x445cd5[_0xc9d2('0x34')]);logger[_0xc9d2('0x24')]('['+_0x3a379d['toUpperCase']()+_0xc9d2('0x65'),_0x358c27['calleridnum']);return getTicket(_0x445cd5,_0x3d6048,_0x13f0ca,_0x6e8d9c,_0x358c27,_0x4a9c0d,_0x3a379d);})['then'](function(_0x3840c4){logger[_0xc9d2('0x24')](util[_0xc9d2('0x51')]('['+_0x3a379d['toUpperCase']()+_0xc9d2('0x66'),_0x4a9c0d[_0xc9d2('0x4a')],_0x3840c4[_0xc9d2('0x50')]));logger[_0xc9d2('0x24')](util[_0xc9d2('0x51')]('['+_0x3a379d[_0xc9d2('0x19')]()+_0xc9d2('0x67'),_0x3a379d));if(_0x3a379d!=='unmanaged'){logger[_0xc9d2('0x24')]('['+_0x3a379d[_0xc9d2('0x19')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3d6048['remoteUri'],_0x24693a['name'],_0x4a9c0d['ticketType'],_0x3840c4[_0xc9d2('0x50')]);}})[_0xc9d2('0x17')](function(_0xa2545){logger[_0xc9d2('0x18')]('['+_0x3a379d[_0xc9d2('0x19')]()+_0xc9d2('0x68'),_0xa2545[_0xc9d2('0x1b')]);});}; \ 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 d538188..40aaba8 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 _0xc226=['recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','catch','unmanaged','lastevent','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','
','name','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','length','find','contact','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\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','apiKey','debug','stringify','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x80de21,_0xa4bcd7){var _0x116aae=function(_0x5a6d3c){while(--_0x5a6d3c){_0x80de21['push'](_0x80de21['shift']());}};_0x116aae(++_0xa4bcd7);}(_0xc226,0x1e6));var _0x6c22=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc226[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x6c22('0x0'));var rp=require(_0x6c22('0x1'));var md5=require(_0x6c22('0x2'));var util=require('util');var Redis=require(_0x6c22('0x3'));var intUtil=require(_0x6c22('0x4'));var config=require(_0x6c22('0x5'));var logger=require(_0x6c22('0x6'))(_0x6c22('0x7'));config[_0x6c22('0x8')]=_[_0x6c22('0x9')](config[_0x6c22('0x8')],{'host':_0x6c22('0xa'),'port':0x18eb});var io=require(_0x6c22('0xb'))(new Redis(config[_0x6c22('0x8')]));var headers={'Content-Type':'application/json','Accept':_0x6c22('0xc')};function emit(_0x22b3c6,_0xa7a4d7,_0x26e025){io['to'](_0x22b3c6)[_0x6c22('0xd')](_0xa7a4d7,_0x26e025);}function getTicket(_0x332431,_0x735799,_0x5b1c49,_0x269cbb,_0x1049d3){logger[_0x6c22('0xe')]('Creating\x20new\x20ticket...');var _0x302210=_[_0x6c22('0xf')]({'responder_id':_0x735799['id'],'requester_id':_0x5b1c49['id'],'name':util[_0x6c22('0x10')](_0x6c22('0x11'),_0x1049d3[_0x6c22('0x12')]),'phone':_0x1049d3[_0x6c22('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x269cbb[_0x6c22('0x14')],_0x1049d3,'\x20'),'description':intUtil[_0x6c22('0x15')](_0x269cbb[_0x6c22('0x16')],_0x1049d3,_0x6c22('0x17')),'tags':getTags(_0x269cbb['Tags'],_0x6c22('0x18'))},getCustomFields(_0x269cbb['Fields'],_0x1049d3));_0x302210['custom_fields']=_[_0x6c22('0x19')](_[_0x6c22('0x1a')](_0x302210[_0x6c22('0x1b')],'id'),_0x6c22('0x1c'));return request({'uri':util[_0x6c22('0x10')](_0x6c22('0x1d'),_0x332431[_0x6c22('0x1e')]),'method':'POST','body':_0x302210})['then'](function(_0x249973){logger[_0x6c22('0xe')](_0x6c22('0x1f'));return _0x249973;});}function getUser(_0xd75954,_0x58b1d2){if(intUtil[_0x6c22('0x20')](_0x58b1d2)){return request({'uri':util[_0x6c22('0x10')](_0x6c22('0x21'),_0xd75954['remoteUri']),'qs':{'email':_0x58b1d2}})[_0x6c22('0x22')](function(_0x5e9b52){if(_0x5e9b52[_0x6c22('0x23')]){logger['info']('Agent\x20found!');return _[_0x6c22('0x24')](_0x5e9b52,function(_0x3c0990){return _0x3c0990[_0x6c22('0x25')]['email']===_0x58b1d2;});}else{logger[_0x6c22('0xe')](_0x6c22('0x26'));return request({'uri':util[_0x6c22('0x10')](_0x6c22('0x27'),_0xd75954[_0x6c22('0x1e')])})[_0x6c22('0x22')](function(_0x3e54b9){logger[_0x6c22('0xe')](_0x6c22('0x28'));return _0x3e54b9;});}});}else{logger[_0x6c22('0xe')](_0x6c22('0x29'));return request({'uri':util[_0x6c22('0x10')](_0x6c22('0x27'),_0xd75954[_0x6c22('0x1e')])})[_0x6c22('0x22')](function(_0x19916e){logger['info'](_0x6c22('0x28'));return _0x19916e;});}}function getEndUser(_0x4a2daf,_0x79c9f7,_0x22530e){logger[_0x6c22('0xe')](_0x6c22('0x2a'),_0x22530e);return request({'uri':util[_0x6c22('0x10')](_0x6c22('0x2b'),_0x4a2daf[_0x6c22('0x1e')]),'qs':{'phone':_0x22530e}})[_0x6c22('0x22')](function(_0x24d0d0){if(_0x24d0d0[_0x6c22('0x23')]){logger['info']('Enduser\x20found!');return _[_0x6c22('0x24')](_0x24d0d0,{'phone':_0x22530e});}else{logger[_0x6c22('0xe')](_0x6c22('0x2c'));return request({'uri':util[_0x6c22('0x10')](_0x6c22('0x2b'),_0x4a2daf[_0x6c22('0x1e')]),'method':_0x6c22('0x2d'),'body':{'name':_0x79c9f7,'phone':_0x22530e}})[_0x6c22('0x22')](function(_0x107687){logger['info']('Enduser\x20created.');return _0x107687;});}});}function getAuth(_0x1d249f){return util['format']('Basic\x20%s',new Buffer(_0x1d249f[_0x6c22('0x2e')]+':X')['toString']('base64'));}function request(_0x319faf){logger[_0x6c22('0x2f')]('[HTTP]',JSON[_0x6c22('0x30')](_0x319faf));return rp(_[_0x6c22('0x9')](_0x319faf,{'method':_0x6c22('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x49d446,_0x4f353f){var _0x3f5718=[];if(_0x49d446&&_0x49d446['length']>0x0){_0x3f5718=_['map'](_0x49d446,_0x4f353f);}return _0x3f5718;}function getCustomFields(_0x23fc5d,_0x19a29f){var _0x305489=[];var _0x3d062f={'custom_fields':[]};if(_0x23fc5d[_0x6c22('0x23')]>0x0){_[_0x6c22('0x32')](_0x23fc5d,function(_0x3dc1b9){if(_[_0x6c22('0x33')]([_0x6c22('0x34'),_0x6c22('0x35')],_0x3dc1b9[_0x6c22('0x36')])&&_0x3dc1b9[_0x6c22('0x37')]&&!_0x3dc1b9[_0x6c22('0x38')]){_0x3d062f[_0x3dc1b9[_0x6c22('0x37')][_0x6c22('0x39')]()]=_0x3dc1b9[_0x6c22('0x3a')][_0x6c22('0x3b')]();}else if(_[_0x6c22('0x33')]([_0x6c22('0x34'),_0x6c22('0x35')],_0x3dc1b9[_0x6c22('0x36')])&&_0x3dc1b9[_0x6c22('0x3c')]&&_0x3dc1b9['customField']){_0x3d062f[_0x6c22('0x1b')][_0x6c22('0x3d')]({'id':_0x3dc1b9['idField'],'value':_0x3dc1b9[_0x6c22('0x3a')][_0x6c22('0x3b')]()});}else if(_0x3dc1b9['type']===_0x6c22('0x3e')&&_0x3dc1b9[_0x6c22('0x3f')]&&_0x3dc1b9['idField']&&_0x3dc1b9[_0x6c22('0x38')]){_0x19a29f[_0x3dc1b9[_0x6c22('0x3f')]]&&_0x3d062f[_0x6c22('0x1b')][_0x6c22('0x3d')]({'id':_0x3dc1b9[_0x6c22('0x3c')],'value':_0x19a29f[_0x3dc1b9[_0x6c22('0x3f')]]['toString']()});}else if(_0x3dc1b9[_0x6c22('0x36')]===_0x6c22('0x40')&&_0x3dc1b9['Variable']&&_0x3dc1b9[_0x6c22('0x41')][_0x6c22('0x18')]&&_0x3dc1b9[_0x6c22('0x3c')]&&_0x3dc1b9[_0x6c22('0x38')]){_0x19a29f[_0x3dc1b9[_0x6c22('0x41')][_0x6c22('0x18')][_0x6c22('0x39')]()]&&_0x3d062f[_0x6c22('0x1b')]['push']({'id':_0x3dc1b9[_0x6c22('0x3c')],'value':_0x19a29f[_0x3dc1b9['Variable'][_0x6c22('0x18')]['toLowerCase']()]['toString']()});}});}return _0x3d062f;}exports[_0x6c22('0x42')]=function(_0x354a90,_0x454d84,_0x584047,_0x5c4b0d,_0x3694d8,_0x2ca554){var _0xa01ca9,_0x3d4d50;_0x2ca554['remoteUri']=intUtil[_0x6c22('0x43')](_0x2ca554[_0x6c22('0x1e')]);_0x2ca554[_0x6c22('0x44')]=intUtil[_0x6c22('0x43')](_0x2ca554[_0x6c22('0x44')]);if(_0x3694d8&&_0x3694d8[_0x6c22('0x45')]){logger[_0x6c22('0xe')](_0x6c22('0x46'),_0x6c22('0x47'));_0x454d84[_0x6c22('0x48')]=util[_0x6c22('0x10')](_0x6c22('0x49'),_0x2ca554[_0x6c22('0x44')],_0x454d84[_0x6c22('0x4a')],md5(_0x454d84['uniqueid']));}else{_0x454d84[_0x6c22('0x48')]='';}headers[_0x6c22('0x4b')]=getAuth(_0x2ca554);return getUser(_0x2ca554,_0x5c4b0d[_0x6c22('0x4c')])[_0x6c22('0x22')](function(_0x1ab075){_0xa01ca9=_0x1ab075;logger['info'](_0x6c22('0x4d'),_0xa01ca9['id']);return getEndUser(_0x2ca554,_0x454d84[_0x6c22('0x12')],_0x454d84['calleridnum']);})[_0x6c22('0x22')](function(_0x40b19d){_0x3d4d50=_0x40b19d;logger[_0x6c22('0xe')](_0x6c22('0x4e'),_0x3d4d50['id']);return getTicket(_0x2ca554,_0xa01ca9,_0x3d4d50,_0x584047,_0x454d84);})[_0x6c22('0x22')](function(_0x21df17){if(_0x21df17&&_0x21df17['id']){logger[_0x6c22('0xe')](_0x6c22('0x1f'));logger[_0x6c22('0xe')](_0x6c22('0x4f'),_0x21df17['id']);logger['info'](_0x6c22('0x46'),_0x6c22('0x50'));emit(util[_0x6c22('0x10')](_0x6c22('0x51'),_0x5c4b0d['name']),_0x6c22('0x52'),{'uri':util[_0x6c22('0x10')](_0x6c22('0x53'),_0x2ca554['remoteUri'],_0x21df17['id'])});}})['catch'](function(_0x247848){logger[_0x6c22('0x54')](_0x6c22('0x46'),JSON[_0x6c22('0x30')](_0x247848));});};exports[_0x6c22('0x55')]=function(_0xfc8ffb,_0x5d2446,_0x2f035c,_0x201fc6,_0x31468d,_0x15a96e,_0x1f2011){var _0x40f5ae,_0x4e47af;_0x15a96e['remoteUri']=intUtil[_0x6c22('0x43')](_0x15a96e['remoteUri']);_0x15a96e[_0x6c22('0x44')]=intUtil['stripTrailingSlash'](_0x15a96e[_0x6c22('0x44')]);if(_0x1f2011&&_0x1f2011['recordingFormat']&&_0x1f2011[_0x6c22('0x56')]!==_0x6c22('0x57')){logger[_0x6c22('0xe')](_0x6c22('0x58'),_0x6c22('0x47'));_0x5d2446[_0x6c22('0x48')]=util[_0x6c22('0x10')](_0x6c22('0x49'),_0x15a96e[_0x6c22('0x44')],_0x5d2446[_0x6c22('0x4a')],md5(_0x5d2446[_0x6c22('0x4a')]));}headers['Authorization']=getAuth(_0x15a96e);return getUser(_0x15a96e,_0x201fc6['email'])[_0x6c22('0x22')](function(_0x7854ca){_0x40f5ae=_0x7854ca;logger[_0x6c22('0xe')]('The\x20User\x20ID\x20is:',_0x40f5ae['id']);return getEndUser(_0x15a96e,_0x5d2446['destcalleridname'],_0x5d2446[_0x6c22('0x59')]);})[_0x6c22('0x22')](function(_0x26469d){_0x4e47af=_0x26469d;logger['info'](_0x6c22('0x4e'),_0x4e47af['id']);return getTicket(_0x15a96e,_0x40f5ae,_0x4e47af,_0x2f035c,_0x5d2446);})['then'](function(_0x4a880e){if(_0x4a880e&&_0x4a880e['id']){logger['info'](_0x6c22('0x1f'));logger[_0x6c22('0xe')](_0x6c22('0x4f'),_0x4a880e['id']);logger[_0x6c22('0xe')](_0x6c22('0x58'),_0x6c22('0x50'));emit(util[_0x6c22('0x10')](_0x6c22('0x51'),_0x201fc6[_0x6c22('0x18')]),'trigger:browser:url',{'uri':util['format'](_0x6c22('0x53'),_0x15a96e[_0x6c22('0x1e')],_0x4a880e['id'])});}})[_0x6c22('0x5a')](function(_0xe1f17d){logger[_0x6c22('0x54')](_0x6c22('0x58'),JSON['stringify'](_0xe1f17d));});};exports[_0x6c22('0x5b')]=function(_0x26a7ce,_0x1f6b28,_0x1d7d90,_0x496926,_0xdd58de,_0x58adae){var _0x4e1771,_0x43f0a9;_0x58adae[_0x6c22('0x1e')]=intUtil[_0x6c22('0x43')](_0x58adae[_0x6c22('0x1e')]);_0x58adae[_0x6c22('0x44')]=intUtil[_0x6c22('0x43')](_0x58adae['serverUrl']);if(_0xdd58de&&_0xdd58de[_0x6c22('0x45')]){logger[_0x6c22('0xe')]('['+_0x1f6b28[_0x6c22('0x5c')]['toUpperCase']()+']',_0x6c22('0x47'));_0x1f6b28[_0x6c22('0x48')]=util['format'](_0x6c22('0x49'),_0x58adae['serverUrl'],_0x1f6b28['uniqueid'],md5(_0x1f6b28[_0x6c22('0x4a')]));}else{_0x1f6b28[_0x6c22('0x48')]='';}headers[_0x6c22('0x4b')]=getAuth(_0x58adae);return getUser(_0x58adae,'')[_0x6c22('0x22')](function(_0x3056fe){_0x4e1771=_0x3056fe;logger[_0x6c22('0xe')]('The\x20User\x20ID\x20is:',_0x4e1771['id']);return getEndUser(_0x58adae,_0x1f6b28['calleridname'],_0x1f6b28['calleridnum']);})[_0x6c22('0x22')](function(_0x11c9d8){_0x43f0a9=_0x11c9d8;logger[_0x6c22('0xe')](_0x6c22('0x4e'),_0x43f0a9['id']);return getTicket(_0x58adae,_0x4e1771,_0x43f0a9,_0x1d7d90,_0x1f6b28);})[_0x6c22('0x22')](function(_0x3a2310){if(_0x3a2310){logger[_0x6c22('0xe')]('Ticket\x20created!');logger[_0x6c22('0xe')]('The\x20Ticket\x20ID\x20is:',_0x3a2310['id']);}})[_0x6c22('0x5a')](function(_0x113c62){logger[_0x6c22('0x54')]('['+_0x1f6b28[_0x6c22('0x5c')]['toUpperCase']()+']',JSON[_0x6c22('0x30')](_0x113c62));});}; \ No newline at end of file +var _0xab1f=['[OUTBOUND]','destcalleridname','destcalleridnum','unmanaged','Authorization','toUpperCase','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','calleridname','calleridnum','Subjects','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','Ticket\x20created!','validateEmail','remoteUri','then','length','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','defaults','map','includes','string','type','nameField','customField','content','picklist','idField','push','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat'];(function(_0xe6cc15,_0x32a11d){var _0x9235a8=function(_0x3fc0d4){while(--_0x3fc0d4){_0xe6cc15['push'](_0xe6cc15['shift']());}};_0x9235a8(++_0x32a11d);}(_0xab1f,0x166));var _0xfab1=function(_0x30146a,_0x49a86c){_0x30146a=_0x30146a-0x0;var _0x1ee876=_0xab1f[_0x30146a];return _0x1ee876;};'use strict';var _=require(_0xfab1('0x0'));var rp=require(_0xfab1('0x1'));var md5=require('md5');var util=require(_0xfab1('0x2'));var Redis=require('ioredis');var intUtil=require(_0xfab1('0x3'));var config=require(_0xfab1('0x4'));var logger=require(_0xfab1('0x5'))('freshdesk');config[_0xfab1('0x6')]=_['defaults'](config[_0xfab1('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xfab1('0x7'))(new Redis(config[_0xfab1('0x6')]));var headers={'Content-Type':_0xfab1('0x8'),'Accept':_0xfab1('0x8')};function emit(_0x1f58bc,_0x3a3db1,_0x46d71c){io['to'](_0x1f58bc)['emit'](_0x3a3db1,_0x46d71c);}function getTicket(_0x2b3675,_0xd816de,_0x56f82f,_0x23ef65,_0x52134c){logger[_0xfab1('0x9')](_0xfab1('0xa'));var _0x3cbfdd=_['merge']({'responder_id':_0xd816de['id'],'requester_id':_0x56f82f['id'],'name':util[_0xfab1('0xb')]('Caller\x20-\x20%s',_0x52134c[_0xfab1('0xc')]),'phone':_0x52134c[_0xfab1('0xd')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x23ef65[_0xfab1('0xe')],_0x52134c,'\x20'),'description':intUtil[_0xfab1('0xf')](_0x23ef65[_0xfab1('0x10')],_0x52134c,_0xfab1('0x11')),'tags':getTags(_0x23ef65[_0xfab1('0x12')],_0xfab1('0x13'))},getCustomFields(_0x23ef65[_0xfab1('0x14')],_0x52134c));_0x3cbfdd[_0xfab1('0x15')]=_[_0xfab1('0x16')](_[_0xfab1('0x17')](_0x3cbfdd['custom_fields'],'id'),_0xfab1('0x18'));return request({'uri':util['format'](_0xfab1('0x19'),_0x2b3675['remoteUri']),'method':_0xfab1('0x1a'),'body':_0x3cbfdd})['then'](function(_0x358c49){logger[_0xfab1('0x9')](_0xfab1('0x1b'));return _0x358c49;});}function getUser(_0x42fca5,_0x4709d6){if(intUtil[_0xfab1('0x1c')](_0x4709d6)){return request({'uri':util['format']('%s/api/v2/agents',_0x42fca5[_0xfab1('0x1d')]),'qs':{'email':_0x4709d6}})[_0xfab1('0x1e')](function(_0x48ba19){if(_0x48ba19[_0xfab1('0x1f')]){logger['info']('Agent\x20found!');return _[_0xfab1('0x20')](_0x48ba19,function(_0x3455bc){return _0x3455bc[_0xfab1('0x21')]['email']===_0x4709d6;});}else{logger[_0xfab1('0x9')](_0xfab1('0x22'));return request({'uri':util[_0xfab1('0xb')](_0xfab1('0x23'),_0x42fca5[_0xfab1('0x1d')])})[_0xfab1('0x1e')](function(_0x42e521){logger[_0xfab1('0x9')](_0xfab1('0x24'));return _0x42e521;});}});}else{logger[_0xfab1('0x9')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xfab1('0xb')]('%s/api/v2/agents/me',_0x42fca5['remoteUri'])})[_0xfab1('0x1e')](function(_0x1842a9){logger[_0xfab1('0x9')](_0xfab1('0x24'));return _0x1842a9;});}}function getEndUser(_0x5b62ed,_0x5f5cda,_0x4f24fa){logger[_0xfab1('0x9')]('Searching\x20enduser\x20with\x20phone',_0x4f24fa);return request({'uri':util[_0xfab1('0xb')](_0xfab1('0x25'),_0x5b62ed[_0xfab1('0x1d')]),'qs':{'phone':_0x4f24fa}})[_0xfab1('0x1e')](function(_0x17b294){if(_0x17b294['length']){logger['info']('Enduser\x20found!');return _['find'](_0x17b294,{'phone':_0x4f24fa});}else{logger[_0xfab1('0x9')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xfab1('0xb')](_0xfab1('0x25'),_0x5b62ed['remoteUri']),'method':_0xfab1('0x1a'),'body':{'name':_0x5f5cda,'phone':_0x4f24fa}})[_0xfab1('0x1e')](function(_0x266000){logger[_0xfab1('0x9')](_0xfab1('0x26'));return _0x266000;});}});}function getAuth(_0x3137f1){return util[_0xfab1('0xb')](_0xfab1('0x27'),new Buffer(_0x3137f1[_0xfab1('0x28')]+':X')[_0xfab1('0x29')](_0xfab1('0x2a')));}function request(_0x43f225){logger['debug'](_0xfab1('0x2b'),JSON['stringify'](_0x43f225));return rp(_[_0xfab1('0x2c')](_0x43f225,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3d0dcb,_0x83d55b){var _0xadfe35=[];if(_0x3d0dcb&&_0x3d0dcb[_0xfab1('0x1f')]>0x0){_0xadfe35=_[_0xfab1('0x2d')](_0x3d0dcb,_0x83d55b);}return _0xadfe35;}function getCustomFields(_0x48a471,_0x19ec5c){var _0x551fb6=[];var _0x322669={'custom_fields':[]};if(_0x48a471['length']>0x0){_['forEach'](_0x48a471,function(_0xc6981a){if(_[_0xfab1('0x2e')]([_0xfab1('0x2f'),'picklist'],_0xc6981a[_0xfab1('0x30')])&&_0xc6981a[_0xfab1('0x31')]&&!_0xc6981a[_0xfab1('0x32')]){_0x322669[_0xc6981a[_0xfab1('0x31')]['toLowerCase']()]=_0xc6981a[_0xfab1('0x33')][_0xfab1('0x29')]();}else if(_['includes'](['string',_0xfab1('0x34')],_0xc6981a[_0xfab1('0x30')])&&_0xc6981a[_0xfab1('0x35')]&&_0xc6981a['customField']){_0x322669['custom_fields'][_0xfab1('0x36')]({'id':_0xc6981a[_0xfab1('0x35')],'value':_0xc6981a[_0xfab1('0x33')][_0xfab1('0x29')]()});}else if(_0xc6981a[_0xfab1('0x30')]===_0xfab1('0x37')&&_0xc6981a[_0xfab1('0x38')]&&_0xc6981a[_0xfab1('0x35')]&&_0xc6981a[_0xfab1('0x32')]){_0x19ec5c[_0xc6981a[_0xfab1('0x38')]]&&_0x322669[_0xfab1('0x15')]['push']({'id':_0xc6981a[_0xfab1('0x35')],'value':_0x19ec5c[_0xc6981a[_0xfab1('0x38')]]['toString']()});}else if(_0xc6981a[_0xfab1('0x30')]===_0xfab1('0x39')&&_0xc6981a['Variable']&&_0xc6981a[_0xfab1('0x3a')][_0xfab1('0x13')]&&_0xc6981a[_0xfab1('0x35')]&&_0xc6981a[_0xfab1('0x32')]){_0x19ec5c[_0xc6981a[_0xfab1('0x3a')][_0xfab1('0x13')][_0xfab1('0x3b')]()]&&_0x322669[_0xfab1('0x15')][_0xfab1('0x36')]({'id':_0xc6981a[_0xfab1('0x35')],'value':_0x19ec5c[_0xc6981a[_0xfab1('0x3a')]['name']['toLowerCase']()]['toString']()});}});}return _0x322669;}exports[_0xfab1('0x3c')]=function(_0x219f9f,_0x4160a4,_0x4b1b1e,_0x415a01,_0x1e9343,_0x244e6e){var _0x38ed62,_0x3702d6;_0x244e6e[_0xfab1('0x1d')]=intUtil[_0xfab1('0x3d')](_0x244e6e[_0xfab1('0x1d')]);_0x244e6e['serverUrl']=intUtil[_0xfab1('0x3d')](_0x244e6e[_0xfab1('0x3e')]);if(_0x1e9343&&_0x1e9343[_0xfab1('0x3f')]){logger[_0xfab1('0x9')]('[QUEUE]',_0xfab1('0x40'));_0x4160a4[_0xfab1('0x41')]=util[_0xfab1('0xb')](_0xfab1('0x42'),_0x244e6e[_0xfab1('0x3e')],_0x4160a4[_0xfab1('0x43')],md5(_0x4160a4[_0xfab1('0x43')]));}else{_0x4160a4[_0xfab1('0x41')]='';}headers['Authorization']=getAuth(_0x244e6e);return getUser(_0x244e6e,_0x415a01[_0xfab1('0x44')])[_0xfab1('0x1e')](function(_0x308b7b){_0x38ed62=_0x308b7b;logger[_0xfab1('0x9')](_0xfab1('0x45'),_0x38ed62['id']);return getEndUser(_0x244e6e,_0x4160a4[_0xfab1('0xc')],_0x4160a4['calleridnum']);})[_0xfab1('0x1e')](function(_0x2e5d99){_0x3702d6=_0x2e5d99;logger[_0xfab1('0x9')](_0xfab1('0x46'),_0x3702d6['id']);return getTicket(_0x244e6e,_0x38ed62,_0x3702d6,_0x4b1b1e,_0x4160a4);})[_0xfab1('0x1e')](function(_0x2535c4){if(_0x2535c4&&_0x2535c4['id']){logger[_0xfab1('0x9')](_0xfab1('0x1b'));logger[_0xfab1('0x9')](_0xfab1('0x47'),_0x2535c4['id']);logger[_0xfab1('0x9')](_0xfab1('0x48'),_0xfab1('0x49'));emit(util[_0xfab1('0xb')](_0xfab1('0x4a'),_0x415a01[_0xfab1('0x13')]),_0xfab1('0x4b'),{'uri':util[_0xfab1('0xb')](_0xfab1('0x4c'),_0x244e6e[_0xfab1('0x1d')],_0x2535c4['id'])});}})[_0xfab1('0x4d')](function(_0x2c1c50){logger[_0xfab1('0x4e')]('[QUEUE]',JSON[_0xfab1('0x4f')](_0x2c1c50));});};exports[_0xfab1('0x50')]=function(_0x438307,_0x4f9cb8,_0x4e3249,_0x19ce29,_0x18fdc7,_0x53695d,_0x267892){var _0x2535b7,_0x69f46;_0x53695d[_0xfab1('0x1d')]=intUtil[_0xfab1('0x3d')](_0x53695d['remoteUri']);_0x53695d[_0xfab1('0x3e')]=intUtil['stripTrailingSlash'](_0x53695d[_0xfab1('0x3e')]);if(_0x267892&&_0x267892[_0xfab1('0x51')]&&_0x267892[_0xfab1('0x51')]!=='none'){logger[_0xfab1('0x9')](_0xfab1('0x52'),'Recording\x20is\x20enabled!');_0x4f9cb8[_0xfab1('0x41')]=util[_0xfab1('0xb')](_0xfab1('0x42'),_0x53695d[_0xfab1('0x3e')],_0x4f9cb8[_0xfab1('0x43')],md5(_0x4f9cb8[_0xfab1('0x43')]));}headers['Authorization']=getAuth(_0x53695d);return getUser(_0x53695d,_0x19ce29[_0xfab1('0x44')])['then'](function(_0x946ac0){_0x2535b7=_0x946ac0;logger['info'](_0xfab1('0x45'),_0x2535b7['id']);return getEndUser(_0x53695d,_0x4f9cb8[_0xfab1('0x53')],_0x4f9cb8[_0xfab1('0x54')]);})[_0xfab1('0x1e')](function(_0x11f5cc){_0x69f46=_0x11f5cc;logger[_0xfab1('0x9')](_0xfab1('0x46'),_0x69f46['id']);return getTicket(_0x53695d,_0x2535b7,_0x69f46,_0x4e3249,_0x4f9cb8);})[_0xfab1('0x1e')](function(_0x3fc798){if(_0x3fc798&&_0x3fc798['id']){logger['info'](_0xfab1('0x1b'));logger['info'](_0xfab1('0x47'),_0x3fc798['id']);logger[_0xfab1('0x9')](_0xfab1('0x52'),_0xfab1('0x49'));emit(util[_0xfab1('0xb')](_0xfab1('0x4a'),_0x19ce29['name']),'trigger:browser:url',{'uri':util['format'](_0xfab1('0x4c'),_0x53695d[_0xfab1('0x1d')],_0x3fc798['id'])});}})['catch'](function(_0xa44027){logger[_0xfab1('0x4e')](_0xfab1('0x52'),JSON[_0xfab1('0x4f')](_0xa44027));});};exports[_0xfab1('0x55')]=function(_0x5d949c,_0x474af7,_0x1b405f,_0x1d0bf0,_0x3080c2,_0x13478a){var _0x31248b,_0x493d51;_0x13478a[_0xfab1('0x1d')]=intUtil[_0xfab1('0x3d')](_0x13478a['remoteUri']);_0x13478a[_0xfab1('0x3e')]=intUtil['stripTrailingSlash'](_0x13478a['serverUrl']);if(_0x3080c2&&_0x3080c2[_0xfab1('0x3f')]){logger[_0xfab1('0x9')]('['+_0x474af7['lastevent']['toUpperCase']()+']',_0xfab1('0x40'));_0x474af7['recordingURL']=util[_0xfab1('0xb')](_0xfab1('0x42'),_0x13478a[_0xfab1('0x3e')],_0x474af7[_0xfab1('0x43')],md5(_0x474af7[_0xfab1('0x43')]));}else{_0x474af7['recordingURL']='';}headers[_0xfab1('0x56')]=getAuth(_0x13478a);return getUser(_0x13478a,'')['then'](function(_0x12ef83){_0x31248b=_0x12ef83;logger['info'](_0xfab1('0x45'),_0x31248b['id']);return getEndUser(_0x13478a,_0x474af7[_0xfab1('0xc')],_0x474af7[_0xfab1('0xd')]);})[_0xfab1('0x1e')](function(_0xd344e3){_0x493d51=_0xd344e3;logger[_0xfab1('0x9')](_0xfab1('0x46'),_0x493d51['id']);return getTicket(_0x13478a,_0x31248b,_0x493d51,_0x1b405f,_0x474af7);})[_0xfab1('0x1e')](function(_0x3e1159){if(_0x3e1159){logger[_0xfab1('0x9')](_0xfab1('0x1b'));logger[_0xfab1('0x9')](_0xfab1('0x47'),_0x3e1159['id']);}})[_0xfab1('0x4d')](function(_0x2b5d75){logger[_0xfab1('0x4e')]('['+_0x474af7['lastevent'][_0xfab1('0x57')]()+']',JSON[_0xfab1('0x4f')](_0x2b5d75));});}; \ 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 37058f8..fad3a9f 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 _0xb4e8=['redis','defaults','localhost','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','GET','headers','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','User\x20found:','userId','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','work_number','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','/api/tasks','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','moment','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales'];(function(_0x49e913,_0x14dbe3){var _0x3f9f12=function(_0x4ae45d){while(--_0x4ae45d){_0x49e913['push'](_0x49e913['shift']());}};_0x3f9f12(++_0x14dbe3);}(_0xb4e8,0x18c));var _0x8b4e=function(_0x3d8f2c,_0x4807db){_0x3d8f2c=_0x3d8f2c-0x0;var _0x4cf46e=_0xb4e8[_0x3d8f2c];return _0x4cf46e;};'use strict';var _=require(_0x8b4e('0x0'));var rp=require('request-promise');var md5=require(_0x8b4e('0x1'));var util=require(_0x8b4e('0x2'));var moment=require(_0x8b4e('0x3'));var Promise=require('bluebird');var Redis=require(_0x8b4e('0x4'));var intUtil=require(_0x8b4e('0x5'));var config=require(_0x8b4e('0x6'));var logger=require(_0x8b4e('0x7'))(_0x8b4e('0x8'));config[_0x8b4e('0x9')]=_[_0x8b4e('0xa')](config[_0x8b4e('0x9')],{'host':_0x8b4e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8b4e('0x9')]));function getAdminId(_0x3d5c9d,_0x3ce97e,_0x1274bc,_0x141131){return new Promise(function(_0x7d44d8,_0x1c2c75){var _0x50e2e4=![];var _0x5ce696={'method':'GET','uri':_0x141131+'/api/selector/owners','json':!![]};_0x5ce696['headers']=_0x1274bc;logger[_0x8b4e('0xc')](_0x8b4e('0xd'));return rp(_0x5ce696)[_0x8b4e('0xe')](function(_0x132000){if(_0x132000){var _0x4df4e4=_0x132000[_0x8b4e('0xf')];var _0x5aae2e=null;for(_0x5aae2e=0x0;_0x5aae2e<_0x4df4e4['length'];_0x5aae2e++){if(_0x4df4e4[_0x5aae2e][_0x8b4e('0x10')]===_0x3d5c9d[_0x8b4e('0x11')]){_0x3d5c9d[_0x8b4e('0x12')]=_0x4df4e4[_0x5aae2e]['id'];_0x50e2e4=!![];}}if(_0x50e2e4){logger['info'](_0x8b4e('0x13'),_0x3d5c9d[_0x8b4e('0x12')]);_0x7d44d8(_0x3d5c9d);}else{_0x1c2c75({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1c2c75({'statusCode':0x194,'message':_0x8b4e('0x14')});}})[_0x8b4e('0x15')](function(_0x3218d6){logger[_0x8b4e('0x16')]('['+[_0x3ce97e[_0x8b4e('0x17')]()]+']',_0x3218d6[_0x8b4e('0x18')]);_0x1c2c75(_0x3218d6);});});}function getUser(_0x2747dc,_0xe1b883,_0x3b24e9){return function(_0x2df8cb){return new Promise(function(_0x20d5a9,_0x4e737e){var _0x22c13d={'method':_0x8b4e('0x19'),'uri':_0x3b24e9+'/api/selector/owners','json':!![]};_0x22c13d[_0x8b4e('0x1a')]=_0xe1b883;logger[_0x8b4e('0xc')](_0x8b4e('0x1b'));return rp(_0x22c13d)[_0x8b4e('0xe')](function(_0x50dc8c){if(_0x50dc8c){var _0x1c3a9d=_0x50dc8c[_0x8b4e('0xf')];var _0x37fefe=![];var _0x366863=null;if(_0x2df8cb[_0x8b4e('0x1c')]!==null){logger[_0x8b4e('0xc')](_0x8b4e('0x1d'),_0x2df8cb[_0x8b4e('0x1c')]);_0x2df8cb[_0x8b4e('0x1e')]=_0x2df8cb[_0x8b4e('0x1c')];for(_0x366863=0x0;_0x366863<_0x1c3a9d[_0x8b4e('0x1f')];_0x366863++){if(_0x1c3a9d[_0x366863][_0x8b4e('0x10')]===_0x2df8cb['agentEmail']){_0x37fefe=!![];_0x2df8cb['userId']=_0x1c3a9d[_0x366863]['id'];logger['info'](_0x8b4e('0x20'),_0x2df8cb['userId']);}}}if(!_0x37fefe){logger[_0x8b4e('0xc')]('Admin\x20selected');_0x2df8cb['userEmail']=_0x2df8cb[_0x8b4e('0x11')];_0x2df8cb[_0x8b4e('0x21')]=_0x2df8cb[_0x8b4e('0x12')];_0x37fefe=!![];}if(_0x37fefe){_0x20d5a9(_0x2df8cb);}else{_0x4e737e({'statusCode':0x194,'message':_0x8b4e('0x14')});}}else{_0x4e737e({'statusCode':0x194,'message':_0x8b4e('0x14')});}})[_0x8b4e('0x15')](function(_0x59538c){logger[_0x8b4e('0x16')]('['+[_0x2747dc[_0x8b4e('0x17')]()]+']',_0x59538c['message']);_0x4e737e(_0x59538c);});});};}function searchContact(_0x35b18c,_0x574be5,_0x2f2db3,_0x273e71){return new Promise(function(_0x32223a,_0x4fa75e){var _0x586023={'method':'GET','headers':_0x574be5,'uri':_0x35b18c+_0x8b4e('0x22')+_0x273e71+_0x8b4e('0x23')+_0x2f2db3+_0x8b4e('0x24'),'json':!![]};rp(_0x586023)[_0x8b4e('0xe')](function(_0x247d4f){var _0x379adc=_[_0x8b4e('0x25')](_0x247d4f[_0x8b4e('0x26')]['contacts'],[_0x2f2db3,_0x273e71]);_0x32223a(_0x379adc);})['catch'](function(_0x27872f){_0x4fa75e(_0x27872f);});});}function getEndUser(_0x3f69cf,_0xbd3c45,_0x3e7406){return function(_0x3db0e6){return new Promise(function(_0xc8efc6,_0x39750e){logger[_0x8b4e('0xc')](util[_0x8b4e('0x27')](_0x8b4e('0x28'),_0x3db0e6[_0x8b4e('0x29')]));searchContact(_0x3e7406,_0xbd3c45,_0x8b4e('0x2a'),_0x3db0e6[_0x8b4e('0x29')])['then'](function(_0x412cc0){if(_0x412cc0){_0x3db0e6['endUserId']=_0x412cc0['id'];logger[_0x8b4e('0xc')](_0x8b4e('0x2b'),_0x3db0e6['endUserId']);return _0xc8efc6(_0x3db0e6);}searchContact(_0x3e7406,_0xbd3c45,_0x8b4e('0x2c'),_0x3db0e6[_0x8b4e('0x29')])[_0x8b4e('0xe')](function(_0x245b31){if(_0x245b31){_0x3db0e6[_0x8b4e('0x2d')]=_0x245b31['id'];logger[_0x8b4e('0xc')](_0x8b4e('0x2e'),_0x3db0e6[_0x8b4e('0x2d')]);return _0xc8efc6(_0x3db0e6);}createEndUser(_0x3db0e6,_0x3f69cf,_0xbd3c45,_0x3e7406)['then'](function(_0x659c46){logger['info'](_0x8b4e('0x2f'),_0x659c46[_0x8b4e('0x2d')]);return _0xc8efc6(_0x659c46);});});})['catch'](function(_0x211646){_0x39750e(_0x211646);});});};}function createEndUser(_0x871175,_0x2df8eb,_0x291653,_0x4407ef){return new Promise(function(_0x3d9d71,_0x3cad3f){var _0x82f00c=moment();var _0x29d475={'method':'POST','uri':_0x4407ef+_0x8b4e('0x30'),'body':{'contact':{'last_name':_0x871175[_0x8b4e('0x29')],'work_number':_0x871175[_0x8b4e('0x29')],'mobile_number':_0x871175[_0x8b4e('0x29')],'owner_id':_0x871175[_0x8b4e('0x21')],'created_at':_0x82f00c[_0x8b4e('0x27')](_0x8b4e('0x31'))}},'json':!![]};_0x29d475[_0x8b4e('0x1a')]=_0x291653;logger['info']('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x29d475)['then'](function(_0xe93166){_0x871175[_0x8b4e('0x2d')]=_0xe93166['contact']['id'];_0x3d9d71(_0x871175);})[_0x8b4e('0x15')](function(_0xdc828a){logger[_0x8b4e('0x16')]('['+[_0x2df8eb[_0x8b4e('0x17')]()]+']',_0xdc828a[_0x8b4e('0x18')]);_0x3cad3f(_0xdc828a[_0x8b4e('0x18')]);});});}function getTicket(_0xb04787,_0x40e04c,_0x3c724f,_0x4be93b,_0x51f353){return function(_0x469e70){logger[_0x8b4e('0xc')]('Creating\x20new\x20task');return new Promise(function(_0x45e656,_0x9af80d){var _0x47c97f=moment();var _0x1013ad={'method':'POST','uri':_0x3c724f+_0x8b4e('0x32'),'body':{'title':intUtil[_0x8b4e('0x33')](_0x4be93b['Subjects'],_0x51f353,'\x20'),'description':intUtil[_0x8b4e('0x33')](_0x4be93b[_0x8b4e('0x34')],_0x51f353,'\x0a'),'owner_id':_0x469e70[_0x8b4e('0x21')],'creater_id':_0x469e70[_0x8b4e('0x12')],'targetable_id':_0x469e70['endUserId'],'targetable_type':_0x8b4e('0x35'),'created_at':_0x47c97f['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x47c97f[_0x8b4e('0x36')](0x1e,'m')['format'](_0x8b4e('0x31'))},'json':!![]};_0x1013ad[_0x8b4e('0x1a')]=_0x40e04c;return rp(_0x1013ad)[_0x8b4e('0xe')](function(_0x43c51d){_0x469e70[_0x8b4e('0x37')]=_0x43c51d[_0x8b4e('0x38')]['id'];logger[_0x8b4e('0xc')](_0x8b4e('0x39'),_0x469e70['ticketId']);_0x45e656(_0x469e70);})['catch'](function(_0x2eaa9a){logger['error']('['+[_0xb04787[_0x8b4e('0x17')]()]+']',_0x2eaa9a[_0x8b4e('0x18')]);_0x9af80d(_0x2eaa9a[_0x8b4e('0x18')]);});});};}function emit(_0x344ba9,_0x15f9a8,_0x2a2842){var _0x422974={'uri':_0x344ba9+_0x8b4e('0x3a')+_0x2a2842};io['to'](util[_0x8b4e('0x27')]('user:%s',_0x15f9a8))['emit']('trigger:browser:url',_0x422974);}exports['cs']=function(_0x199289,_0x5fd11c,_0x304872,_0x4feeca,_0x3c652b,_0x54dcad,_0x42e504,_0x10674d){var _0x498efc={};var _0x198a01={'Authorization':'Token\x20token='+_0x54dcad['apiKey']};_0x54dcad[_0x8b4e('0x3b')]=intUtil[_0x8b4e('0x3c')](_0x54dcad[_0x8b4e('0x3b')]);_0x54dcad[_0x8b4e('0x3d')]=intUtil['stripTrailingSlash'](_0x54dcad['serverUrl']);var _0x52887f=_0x54dcad[_0x8b4e('0x3b')];_0x498efc[_0x8b4e('0x11')]=_0x54dcad[_0x8b4e('0x3e')];_0x498efc[_0x8b4e('0x29')]=_0x10674d[_0x8b4e('0x3f')]()===_0x8b4e('0x40')?_0x5fd11c['destcalleridnum']:_0x5fd11c[_0x8b4e('0x41')];_0x498efc[_0x8b4e('0x42')]=_0x10674d===_0x8b4e('0x43')||_0x10674d===_0x8b4e('0x44')?'queue':'outbound';if(_0x4feeca){_0x498efc[_0x8b4e('0x1c')]=_0x4feeca[_0x8b4e('0x10')];}var _0xa0d499=util[_0x8b4e('0x27')](_0x8b4e('0x45'),_0x54dcad[_0x8b4e('0x3d')],_0x5fd11c[_0x8b4e('0x46')],md5(_0x5fd11c[_0x8b4e('0x46')]));if(_0x3c652b&&_0x3c652b[_0x8b4e('0x47')]){logger[_0x8b4e('0xc')]('[QUEUE]',_0x8b4e('0x48'));_0x5fd11c[_0x8b4e('0x49')]=_0xa0d499;}else if(_0x42e504&&_0x42e504[_0x8b4e('0x4a')]&&_0x42e504['recordingFormat']!==_0x8b4e('0x4b')){logger[_0x8b4e('0xc')](_0x8b4e('0x4c'),_0x8b4e('0x48'));_0x5fd11c[_0x8b4e('0x49')]=_0xa0d499;}else{_0x5fd11c['recordingURL']='';}return getAdminId(_0x498efc,_0x10674d,_0x198a01,_0x52887f)[_0x8b4e('0xe')](getUser(_0x10674d,_0x198a01,_0x52887f))[_0x8b4e('0xe')](getEndUser(_0x10674d,_0x198a01,_0x52887f))['then'](getTicket(_0x10674d,_0x198a01,_0x52887f,_0x304872,_0x5fd11c))[_0x8b4e('0xe')](function(_0x2f572d){logger[_0x8b4e('0xc')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x2f572d[_0x8b4e('0x37')]));if(_0x10674d!==_0x8b4e('0x44')){logger[_0x8b4e('0xc')]('['+[_0x10674d[_0x8b4e('0x17')]()]+']',_0x8b4e('0x4d'));emit(_0x52887f,_0x4feeca[_0x8b4e('0x4e')],_0x2f572d[_0x8b4e('0x2d')]);}})[_0x8b4e('0x15')](function(_0x47259c){logger[_0x8b4e('0x16')]('['+[_0x10674d[_0x8b4e('0x17')]()]+_0x8b4e('0x4f'),util[_0x8b4e('0x50')](_0x47259c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7fbe=['bluebird','./util','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','headers','info','Getting\x20admin\x20information','then','users','length','email','Admin\x20found:','adminId','catch','error','toUpperCase','message','GET','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','Requested\x20Resource\x20not\x20Found','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','work_number','endUserId','Contact\x20found\x20work_number:','POST','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util'];(function(_0x530c53,_0x546020){var _0x5408ca=function(_0x1de646){while(--_0x1de646){_0x530c53['push'](_0x530c53['shift']());}};_0x5408ca(++_0x546020);}(_0x7fbe,0x19b));var _0xe7fb=function(_0x4a3e45,_0x1e8ef3){_0x4a3e45=_0x4a3e45-0x0;var _0x48db76=_0x7fbe[_0x4a3e45];return _0x48db76;};'use strict';var _=require(_0xe7fb('0x0'));var rp=require(_0xe7fb('0x1'));var md5=require(_0xe7fb('0x2'));var util=require(_0xe7fb('0x3'));var moment=require('moment');var Promise=require(_0xe7fb('0x4'));var Redis=require('ioredis');var intUtil=require(_0xe7fb('0x5'));var config=require('../../../../config/environment');var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));config[_0xe7fb('0x8')]=_[_0xe7fb('0x9')](config[_0xe7fb('0x8')],{'host':_0xe7fb('0xa'),'port':0x18eb});var io=require(_0xe7fb('0xb'))(new Redis(config[_0xe7fb('0x8')]));function getAdminId(_0x32863e,_0x4be21e,_0x5e49ab,_0x52091c){return new Promise(function(_0x418b62,_0x2ac225){var _0x5cec8f=![];var _0x5cd564={'method':'GET','uri':_0x52091c+'/api/selector/owners','json':!![]};_0x5cd564[_0xe7fb('0xc')]=_0x5e49ab;logger[_0xe7fb('0xd')](_0xe7fb('0xe'));return rp(_0x5cd564)[_0xe7fb('0xf')](function(_0x25a81f){if(_0x25a81f){var _0x34e6f0=_0x25a81f[_0xe7fb('0x10')];var _0x275c74=null;for(_0x275c74=0x0;_0x275c74<_0x34e6f0[_0xe7fb('0x11')];_0x275c74++){if(_0x34e6f0[_0x275c74][_0xe7fb('0x12')]===_0x32863e['adminEmail']){_0x32863e['adminId']=_0x34e6f0[_0x275c74]['id'];_0x5cec8f=!![];}}if(_0x5cec8f){logger[_0xe7fb('0xd')](_0xe7fb('0x13'),_0x32863e[_0xe7fb('0x14')]);_0x418b62(_0x32863e);}else{_0x2ac225({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x2ac225({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xe7fb('0x15')](function(_0x3aadad){logger[_0xe7fb('0x16')]('['+[_0x4be21e[_0xe7fb('0x17')]()]+']',_0x3aadad[_0xe7fb('0x18')]);_0x2ac225(_0x3aadad);});});}function getUser(_0x5e4dd8,_0x12eaf4,_0x22d664){return function(_0x19a9df){return new Promise(function(_0x22f0f9,_0x548347){var _0xeafde8={'method':_0xe7fb('0x19'),'uri':_0x22d664+_0xe7fb('0x1a'),'json':!![]};_0xeafde8['headers']=_0x12eaf4;logger[_0xe7fb('0xd')](_0xe7fb('0x1b'));return rp(_0xeafde8)['then'](function(_0x168f91){if(_0x168f91){var _0x81daed=_0x168f91[_0xe7fb('0x10')];var _0x293b20=![];var _0x539daf=null;if(_0x19a9df[_0xe7fb('0x1c')]!==null){logger[_0xe7fb('0xd')](_0xe7fb('0x1d'),_0x19a9df[_0xe7fb('0x1c')]);_0x19a9df[_0xe7fb('0x1e')]=_0x19a9df[_0xe7fb('0x1c')];for(_0x539daf=0x0;_0x539daf<_0x81daed['length'];_0x539daf++){if(_0x81daed[_0x539daf][_0xe7fb('0x12')]===_0x19a9df[_0xe7fb('0x1c')]){_0x293b20=!![];_0x19a9df[_0xe7fb('0x1f')]=_0x81daed[_0x539daf]['id'];logger[_0xe7fb('0xd')](_0xe7fb('0x20'),_0x19a9df[_0xe7fb('0x1f')]);}}}if(!_0x293b20){logger['info'](_0xe7fb('0x21'));_0x19a9df[_0xe7fb('0x1e')]=_0x19a9df[_0xe7fb('0x22')];_0x19a9df[_0xe7fb('0x1f')]=_0x19a9df[_0xe7fb('0x14')];_0x293b20=!![];}if(_0x293b20){_0x22f0f9(_0x19a9df);}else{_0x548347({'statusCode':0x194,'message':_0xe7fb('0x23')});}}else{_0x548347({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xe7fb('0x15')](function(_0x475545){logger[_0xe7fb('0x16')]('['+[_0x5e4dd8[_0xe7fb('0x17')]()]+']',_0x475545[_0xe7fb('0x18')]);_0x548347(_0x475545);});});};}function searchContact(_0x22877f,_0x21582a,_0x40f1f4,_0x4155ad){return new Promise(function(_0x46c8ed,_0xc6b7c4){var _0x378d77={'method':_0xe7fb('0x19'),'headers':_0x21582a,'uri':_0x22877f+'/api/lookup?q='+_0x4155ad+_0xe7fb('0x24')+_0x40f1f4+_0xe7fb('0x25'),'json':!![]};rp(_0x378d77)[_0xe7fb('0xf')](function(_0x419772){var _0x59b5bc=_['find'](_0x419772['contacts'][_0xe7fb('0x26')],[_0x40f1f4,_0x4155ad]);_0x46c8ed(_0x59b5bc);})[_0xe7fb('0x15')](function(_0x203b53){_0xc6b7c4(_0x203b53);});});}function getEndUser(_0x46e5c6,_0x4e2787,_0x294516){return function(_0x7d473b){return new Promise(function(_0x38826d,_0x5e702b){logger['info'](util[_0xe7fb('0x27')](_0xe7fb('0x28'),_0x7d473b[_0xe7fb('0x29')]));searchContact(_0x294516,_0x4e2787,_0xe7fb('0x2a'),_0x7d473b['contactNumber'])[_0xe7fb('0xf')](function(_0x5ee4ba){if(_0x5ee4ba){_0x7d473b['endUserId']=_0x5ee4ba['id'];logger['info'](_0xe7fb('0x2b'),_0x7d473b['endUserId']);return _0x38826d(_0x7d473b);}searchContact(_0x294516,_0x4e2787,_0xe7fb('0x2c'),_0x7d473b[_0xe7fb('0x29')])[_0xe7fb('0xf')](function(_0x1eb1d7){if(_0x1eb1d7){_0x7d473b[_0xe7fb('0x2d')]=_0x1eb1d7['id'];logger[_0xe7fb('0xd')](_0xe7fb('0x2e'),_0x7d473b[_0xe7fb('0x2d')]);return _0x38826d(_0x7d473b);}createEndUser(_0x7d473b,_0x46e5c6,_0x4e2787,_0x294516)['then'](function(_0x26dc2b){logger[_0xe7fb('0xd')]('Contact\x20created:',_0x26dc2b[_0xe7fb('0x2d')]);return _0x38826d(_0x26dc2b);});});})[_0xe7fb('0x15')](function(_0x37e3c3){_0x5e702b(_0x37e3c3);});});};}function createEndUser(_0x4e6478,_0x4f0e0d,_0x47a809,_0xa5bc28){return new Promise(function(_0x2de0bd,_0x7eebf3){var _0x4a8204=moment();var _0x15210b={'method':_0xe7fb('0x2f'),'uri':_0xa5bc28+'/api/contacts','body':{'contact':{'last_name':_0x4e6478['contactNumber'],'work_number':_0x4e6478[_0xe7fb('0x29')],'mobile_number':_0x4e6478[_0xe7fb('0x29')],'owner_id':_0x4e6478['userId'],'created_at':_0x4a8204[_0xe7fb('0x27')](_0xe7fb('0x30'))}},'json':!![]};_0x15210b[_0xe7fb('0xc')]=_0x47a809;logger['info']('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x15210b)[_0xe7fb('0xf')](function(_0x173be0){_0x4e6478[_0xe7fb('0x2d')]=_0x173be0[_0xe7fb('0x31')]['id'];_0x2de0bd(_0x4e6478);})[_0xe7fb('0x15')](function(_0x3fec13){logger[_0xe7fb('0x16')]('['+[_0x4f0e0d[_0xe7fb('0x17')]()]+']',_0x3fec13['message']);_0x7eebf3(_0x3fec13[_0xe7fb('0x18')]);});});}function getTicket(_0x3ad005,_0x4513b5,_0x1ec25e,_0x64c0c1,_0x5806a2){return function(_0x5eefb4){logger[_0xe7fb('0xd')](_0xe7fb('0x32'));return new Promise(function(_0x4c4cd1,_0x5371dd){var _0x4f6da5=moment();var _0x4021fc={'method':'POST','uri':_0x1ec25e+_0xe7fb('0x33'),'body':{'title':intUtil['getString'](_0x64c0c1['Subjects'],_0x5806a2,'\x20'),'description':intUtil[_0xe7fb('0x34')](_0x64c0c1[_0xe7fb('0x35')],_0x5806a2,'\x0a'),'owner_id':_0x5eefb4[_0xe7fb('0x1f')],'creater_id':_0x5eefb4[_0xe7fb('0x14')],'targetable_id':_0x5eefb4[_0xe7fb('0x2d')],'targetable_type':_0xe7fb('0x36'),'created_at':_0x4f6da5[_0xe7fb('0x27')](_0xe7fb('0x30')),'due_date':_0x4f6da5[_0xe7fb('0x37')](0x1e,'m')[_0xe7fb('0x27')](_0xe7fb('0x30'))},'json':!![]};_0x4021fc[_0xe7fb('0xc')]=_0x4513b5;return rp(_0x4021fc)[_0xe7fb('0xf')](function(_0x20fcda){_0x5eefb4[_0xe7fb('0x38')]=_0x20fcda[_0xe7fb('0x39')]['id'];logger[_0xe7fb('0xd')](_0xe7fb('0x3a'),_0x5eefb4[_0xe7fb('0x38')]);_0x4c4cd1(_0x5eefb4);})[_0xe7fb('0x15')](function(_0x1054fd){logger[_0xe7fb('0x16')]('['+[_0x3ad005['toUpperCase']()]+']',_0x1054fd['message']);_0x5371dd(_0x1054fd[_0xe7fb('0x18')]);});});};}function emit(_0x158437,_0x4e2490,_0x32acc4){var _0x30c306={'uri':_0x158437+'/contacts/'+_0x32acc4};io['to'](util[_0xe7fb('0x27')](_0xe7fb('0x3b'),_0x4e2490))[_0xe7fb('0x3c')](_0xe7fb('0x3d'),_0x30c306);}exports['cs']=function(_0x5b54a4,_0x5a299e,_0xe49673,_0x31e350,_0x24cf0a,_0x212f08,_0x4bf4c2,_0x11b8e8){var _0x2430ae={};var _0x59b436={'Authorization':_0xe7fb('0x3e')+_0x212f08[_0xe7fb('0x3f')]};_0x212f08[_0xe7fb('0x40')]=intUtil[_0xe7fb('0x41')](_0x212f08[_0xe7fb('0x40')]);_0x212f08['serverUrl']=intUtil['stripTrailingSlash'](_0x212f08['serverUrl']);var _0xecb1a0=_0x212f08[_0xe7fb('0x40')];_0x2430ae[_0xe7fb('0x22')]=_0x212f08[_0xe7fb('0x42')];_0x2430ae[_0xe7fb('0x29')]=_0x11b8e8[_0xe7fb('0x43')]()===_0xe7fb('0x44')?_0x5a299e[_0xe7fb('0x45')]:_0x5a299e[_0xe7fb('0x46')];_0x2430ae[_0xe7fb('0x47')]=_0x11b8e8===_0xe7fb('0x48')||_0x11b8e8===_0xe7fb('0x49')?_0xe7fb('0x48'):_0xe7fb('0x44');if(_0x31e350){_0x2430ae[_0xe7fb('0x1c')]=_0x31e350[_0xe7fb('0x12')];}var _0x243570=util[_0xe7fb('0x27')](_0xe7fb('0x4a'),_0x212f08['serverUrl'],_0x5a299e[_0xe7fb('0x4b')],md5(_0x5a299e[_0xe7fb('0x4b')]));if(_0x24cf0a&&_0x24cf0a['monitor_format']){logger[_0xe7fb('0xd')]('[QUEUE]','Recording\x20is\x20enabled!');_0x5a299e[_0xe7fb('0x4c')]=_0x243570;}else if(_0x4bf4c2&&_0x4bf4c2[_0xe7fb('0x4d')]&&_0x4bf4c2['recordingFormat']!==_0xe7fb('0x4e')){logger[_0xe7fb('0xd')](_0xe7fb('0x4f'),'Recording\x20is\x20enabled!');_0x5a299e[_0xe7fb('0x4c')]=_0x243570;}else{_0x5a299e['recordingURL']='';}return getAdminId(_0x2430ae,_0x11b8e8,_0x59b436,_0xecb1a0)[_0xe7fb('0xf')](getUser(_0x11b8e8,_0x59b436,_0xecb1a0))['then'](getEndUser(_0x11b8e8,_0x59b436,_0xecb1a0))[_0xe7fb('0xf')](getTicket(_0x11b8e8,_0x59b436,_0xecb1a0,_0xe49673,_0x5a299e))[_0xe7fb('0xf')](function(_0x34bfcd){logger[_0xe7fb('0xd')](util[_0xe7fb('0x27')](_0xe7fb('0x50'),_0x34bfcd[_0xe7fb('0x38')]));if(_0x11b8e8!==_0xe7fb('0x49')){logger['info']('['+[_0x11b8e8[_0xe7fb('0x17')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0xecb1a0,_0x31e350[_0xe7fb('0x51')],_0x34bfcd[_0xe7fb('0x2d')]);}})['catch'](function(_0xd36107){logger['error']('['+[_0x11b8e8[_0xe7fb('0x17')]()]+_0xe7fb('0x52'),util['inspect'](_0xd36107,{'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 6bb8dc4..52ad911 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 _0x3bda=['./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','dynamics365','servicenow','includes','data1','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','toLowerCase','vtiger','freshsales','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','util'];(function(_0x491001,_0x2e13ee){var _0x2971ef=function(_0x59793f){while(--_0x59793f){_0x491001['push'](_0x491001['shift']());}};_0x2971ef(++_0x2e13ee);}(_0x3bda,0x143));var _0xa3bd=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x3bda[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var util=require(_0xa3bd('0x0'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0xa3bd('0x1'));var freshdesk=require(_0xa3bd('0x2'));var zoho=require(_0xa3bd('0x3'));var desk=require(_0xa3bd('0x4'));var vtiger=require(_0xa3bd('0x5'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require('./freshsales');var integrations=[_0xa3bd('0x6'),_0xa3bd('0x7'),_0xa3bd('0x8'),_0xa3bd('0x9'),_0xa3bd('0xa'),_0xa3bd('0xb'),'vtiger',_0xa3bd('0xc'),'freshsales',_0xa3bd('0xd')];exports['exec']=function(_0x42e24b,_0x1a6779,_0x50ed62,_0x1062fa,_0x346731,_0x59ed4c){if(_0x50ed62){if(_[_0xa3bd('0xe')](integrations,_0x42e24b[_0xa3bd('0xf')]['toLowerCase']())){try{var _0x2e17d9=null;var _0x89af4f='';var _0x5de930=_0x50ed62[_0x42e24b[_0xa3bd('0xf')]['toLowerCase']()];if(_0x5de930){var _0x2a6d42=_0x5de930[_0x42e24b[_0xa3bd('0x10')]];if(_0x2a6d42){var _0x873d07=_[_0xa3bd('0x11')](_0x2a6d42[_0xa3bd('0x12')],{'id':parseInt(_0x42e24b[_0xa3bd('0x13')],0xa)});if(_0x873d07){if(_0x1062fa){if(_0x346731&&_0x1a6779[_0xa3bd('0x14')]){_0x89af4f=_0xa3bd('0x14');}else if(_0x1a6779[_0xa3bd('0x15')]){_0x89af4f=_0xa3bd('0x16');}else{console[_0xa3bd('0x17')](_0xa3bd('0x18'),_0x1a6779);}}else{_0x89af4f=_0xa3bd('0x19');}switch(_0x42e24b[_0xa3bd('0xf')][_0xa3bd('0x1a')]()){case _0xa3bd('0x6'):zendesk[_0x89af4f](_0x42e24b,_0x1a6779,_0x873d07,_0x1062fa,_0x346731,_0x2a6d42,_0x59ed4c);break;case _0xa3bd('0x7'):salesforce[_0x89af4f](_0x42e24b,_0x1a6779,_0x873d07,_0x1062fa,_0x346731,_0x2a6d42,_0x59ed4c);break;case _0xa3bd('0x8'):sugarcrm[_0x89af4f](_0x42e24b,_0x1a6779,_0x873d07,_0x1062fa,_0x346731,_0x2a6d42,_0x59ed4c);break;case'freshdesk':freshdesk[_0x89af4f](_0x42e24b,_0x1a6779,_0x873d07,_0x1062fa,_0x346731,_0x2a6d42,_0x59ed4c);break;case'zoho':zoho[_0x89af4f](_0x42e24b,_0x1a6779,_0x873d07,_0x1062fa,_0x346731,_0x2a6d42,_0x59ed4c);break;case _0xa3bd('0xb'):desk[_0x89af4f](_0x42e24b,_0x1a6779,_0x873d07,_0x1062fa,_0x346731,_0x2a6d42,_0x59ed4c);break;case _0xa3bd('0x1b'):vtiger[_0x89af4f](_0x42e24b,_0x1a6779,_0x873d07,_0x1062fa,_0x346731,_0x2a6d42,_0x59ed4c);break;case _0xa3bd('0x1c'):freshsales['cs'](_0x42e24b,_0x1a6779,_0x873d07,_0x1062fa,_0x346731,_0x2a6d42,_0x59ed4c,_0x89af4f);break;case _0xa3bd('0xd'):servicenow['cs'](_0x42e24b,_0x1a6779,_0x873d07,_0x1062fa,_0x346731,_0x2a6d42,_0x59ed4c,_0x89af4f);break;case _0xa3bd('0xc'):dynamics365['cs'](_0x42e24b,_0x1a6779,_0x873d07,_0x1062fa,_0x346731,_0x2a6d42,_0x59ed4c,_0x89af4f);break;default:console[_0xa3bd('0x17')](_0xa3bd('0x1d'));}}else{_0x2e17d9=require(_0xa3bd('0x1e'))(_0x42e24b[_0xa3bd('0xf')][_0xa3bd('0x1a')]());_0x2e17d9[_0xa3bd('0x1f')](_0xa3bd('0x20'),util[_0xa3bd('0x21')](_0xa3bd('0x22'),_0x42e24b['data1'][_0xa3bd('0x1a')](),_0x42e24b[_0xa3bd('0x13')]));}}else{_0x2e17d9=require(_0xa3bd('0x1e'))(_0x42e24b[_0xa3bd('0xf')][_0xa3bd('0x1a')]());_0x2e17d9['error']('[EXEC]',util[_0xa3bd('0x21')](_0xa3bd('0x23'),_0x42e24b[_0xa3bd('0xf')][_0xa3bd('0x1a')](),_0x42e24b[_0xa3bd('0x10')]));}}else{}}catch(_0x3a130d){console[_0xa3bd('0x1f')](_0x3a130d);}}}}; \ No newline at end of file +var _0xddeb=['freshsales','servicenow','exec','includes','toLowerCase','data1','data2','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','freshdesk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','zoho','desk','vtiger','dynamics365'];(function(_0x36bd8f,_0xa73410){var _0x4e6fd2=function(_0x243eac){while(--_0x243eac){_0x36bd8f['push'](_0x36bd8f['shift']());}};_0x4e6fd2(++_0xa73410);}(_0xddeb,0x1ac));var _0xbdde=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xddeb[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xbdde('0x0'));var util=require(_0xbdde('0x1'));var zendesk=require(_0xbdde('0x2'));var salesforce=require(_0xbdde('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xbdde('0x4'));var zoho=require(_0xbdde('0x5'));var desk=require(_0xbdde('0x6'));var vtiger=require('./vtiger');var servicenow=require(_0xbdde('0x7'));var dynamics365=require(_0xbdde('0x8'));var freshsales=require(_0xbdde('0x9'));var integrations=['zendesk',_0xbdde('0xa'),_0xbdde('0xb'),'freshdesk',_0xbdde('0xc'),_0xbdde('0xd'),_0xbdde('0xe'),_0xbdde('0xf'),_0xbdde('0x10'),_0xbdde('0x11')];exports[_0xbdde('0x12')]=function(_0x9837c0,_0x165abf,_0x291e06,_0x178832,_0x202d48,_0x53e387){if(_0x291e06){if(_[_0xbdde('0x13')](integrations,_0x9837c0['data1'][_0xbdde('0x14')]())){try{var _0x5f3770=null;var _0x385161='';var _0x35e260=_0x291e06[_0x9837c0[_0xbdde('0x15')][_0xbdde('0x14')]()];if(_0x35e260){var _0x194a6e=_0x35e260[_0x9837c0[_0xbdde('0x16')]];if(_0x194a6e){var _0x595c25=_['find'](_0x194a6e['Configurations'],{'id':parseInt(_0x9837c0[_0xbdde('0x17')],0xa)});if(_0x595c25){if(_0x178832){if(_0x202d48&&_0x165abf[_0xbdde('0x18')]){_0x385161='queue';}else if(_0x165abf[_0xbdde('0x19')]){_0x385161=_0xbdde('0x1a');}else{console[_0xbdde('0x1b')](_0xbdde('0x1c'),_0x165abf);}}else{_0x385161=_0xbdde('0x1d');}switch(_0x9837c0[_0xbdde('0x15')][_0xbdde('0x14')]()){case _0xbdde('0x1e'):zendesk[_0x385161](_0x9837c0,_0x165abf,_0x595c25,_0x178832,_0x202d48,_0x194a6e,_0x53e387);break;case _0xbdde('0xa'):salesforce[_0x385161](_0x9837c0,_0x165abf,_0x595c25,_0x178832,_0x202d48,_0x194a6e,_0x53e387);break;case _0xbdde('0xb'):sugarcrm[_0x385161](_0x9837c0,_0x165abf,_0x595c25,_0x178832,_0x202d48,_0x194a6e,_0x53e387);break;case _0xbdde('0x1f'):freshdesk[_0x385161](_0x9837c0,_0x165abf,_0x595c25,_0x178832,_0x202d48,_0x194a6e,_0x53e387);break;case _0xbdde('0xc'):zoho[_0x385161](_0x9837c0,_0x165abf,_0x595c25,_0x178832,_0x202d48,_0x194a6e,_0x53e387);break;case'desk':desk[_0x385161](_0x9837c0,_0x165abf,_0x595c25,_0x178832,_0x202d48,_0x194a6e,_0x53e387);break;case _0xbdde('0xe'):vtiger[_0x385161](_0x9837c0,_0x165abf,_0x595c25,_0x178832,_0x202d48,_0x194a6e,_0x53e387);break;case _0xbdde('0x10'):freshsales['cs'](_0x9837c0,_0x165abf,_0x595c25,_0x178832,_0x202d48,_0x194a6e,_0x53e387,_0x385161);break;case _0xbdde('0x11'):servicenow['cs'](_0x9837c0,_0x165abf,_0x595c25,_0x178832,_0x202d48,_0x194a6e,_0x53e387,_0x385161);break;case _0xbdde('0xf'):dynamics365['cs'](_0x9837c0,_0x165abf,_0x595c25,_0x178832,_0x202d48,_0x194a6e,_0x53e387,_0x385161);break;default:console[_0xbdde('0x1b')](_0xbdde('0x20'));}}else{_0x5f3770=require(_0xbdde('0x21'))(_0x9837c0['data1'][_0xbdde('0x14')]());_0x5f3770[_0xbdde('0x22')](_0xbdde('0x23'),util[_0xbdde('0x24')]('%s\x20configuration\x20#%s\x20not\x20found',_0x9837c0[_0xbdde('0x15')][_0xbdde('0x14')](),_0x9837c0[_0xbdde('0x17')]));}}else{_0x5f3770=require(_0xbdde('0x21'))(_0x9837c0[_0xbdde('0x15')][_0xbdde('0x14')]());_0x5f3770[_0xbdde('0x22')](_0xbdde('0x23'),util[_0xbdde('0x24')]('%s\x20account\x20#%s\x20not\x20found',_0x9837c0[_0xbdde('0x15')][_0xbdde('0x14')](),_0x9837c0[_0xbdde('0x16')]));}}else{}}catch(_0x57d9ff){console[_0xbdde('0x22')](_0x57d9ff);}}}}; \ 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 267c4e4..dc053ec 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 _0x930e=['Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','[OUTBOUND]','unmanaged','recordingURL','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','contact','endUserType','lead','WhoId','account','WhatId','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','info','resolve','Name','identity','user_id','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','Phone','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','format','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Caller\x20-\x20%s','Company','No\x20Company','','upperFirst','forEach','includes','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username'];(function(_0x170f4d,_0x1dc262){var _0x94eef0=function(_0x5d7eaf){while(--_0x5d7eaf){_0x170f4d['push'](_0x170f4d['shift']());}};_0x94eef0(++_0x1dc262);}(_0x930e,0x135));var _0xe930=function(_0x20b828,_0x320966){_0x20b828=_0x20b828-0x0;var _0x426d41=_0x930e[_0x20b828];return _0x426d41;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0xe930('0x0'));var BPromise=require(_0xe930('0x1'));var md5=require(_0xe930('0x2'));var jsforce=require(_0xe930('0x3'));var util=require(_0xe930('0x4'));var Redis=require(_0xe930('0x5'));var intUtil=require(_0xe930('0x6'));var config=require('../../../../config/environment');var logger=require(_0xe930('0x7'))(_0xe930('0x8'));config[_0xe930('0x9')]=_[_0xe930('0xa')](config[_0xe930('0x9')],{'host':_0xe930('0xb'),'port':0x18eb});var io=require(_0xe930('0xc'))(new Redis(config[_0xe930('0x9')]));function emit(_0x33d0b4,_0x3feb51,_0x176775){io['to'](_0x33d0b4)[_0xe930('0xd')](_0x3feb51,_0x176775);}function getTicket(_0x374b89,_0x279409,_0x2c98b3,_0xa662ef,_0x80d71a,_0x1e015d,_0x4fe780,_0x1d78bd){var _0xb40ffe=Object[_0xe930('0xe')]({},{'OwnerId':_0x279409['id'],'Subject':intUtil['getString'](_0xa662ef[_0xe930('0xf')],_0x80d71a,'\x20'),'Description':intUtil[_0xe930('0x10')](_0xa662ef[_0xe930('0x11')],_0x80d71a,'\x0a')},getCustomFields(_0x1e015d,_0x80d71a));if(_0x2c98b3){if(_0xa662ef[_0xe930('0x12')]===_0xe930('0x13')){_0xb40ffe[_0xe930('0x14')]=moment[_0xe930('0x15')]();_0xb40ffe[_0xe930('0x16')]=![];_0xb40ffe[_0xe930('0x17')]=![];if(_0x2c98b3['endUserType']===_0xe930('0x18')||_0x2c98b3[_0xe930('0x19')]===_0xe930('0x1a')){_0xb40ffe[_0xe930('0x1b')]=_0x2c98b3['id'];}else if(_0x2c98b3[_0xe930('0x19')]===_0xe930('0x1c')){_0xb40ffe[_0xe930('0x1d')]=_0x2c98b3['id'];}}else if(_0xa662ef[_0xe930('0x12')]==='Case'){if(_0x2c98b3[_0xe930('0x19')]===_0xe930('0x18')){_0xb40ffe[_0xe930('0x1e')]=_0x2c98b3['id'];}else if(_0x2c98b3['endUserType']===_0xe930('0x1c')){_0xb40ffe[_0xe930('0x1f')]=_0x2c98b3['id'];}else if(_0x2c98b3['endUserType']===_0xe930('0x1a')&&_0xa662ef[_0xe930('0x20')]){_0xb40ffe[_0xa662ef[_0xe930('0x20')]]=_0x2c98b3['id'];}else{logger['info'](_0xe930('0x21'));}}}return _0x4fe780[_0xe930('0x22')](_0xa662ef[_0xe930('0x12')])[_0xe930('0x23')](_0xb40ffe);}function getUser(_0x428b71,_0x527f18,_0x3bf6a6){if(!_[_0xe930('0x24')](_0x527f18)&&intUtil[_0xe930('0x25')](_0x527f18)){var _0xb340e3={'Email':_0x527f18};var _0x54bdf2={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3bf6a6[_0xe930('0x22')](_0xe930('0x26'))[_0xe930('0x27')](_0xb340e3,_0x54bdf2)[_0xe930('0x28')]()[_0xe930('0x29')](function(_0x1a50cf){if(_0x1a50cf[_0xe930('0x2a')]){var _0x1f5eed=_[_0xe930('0x27')](_0x1a50cf,function(_0x456b4e){return _0x456b4e[_0xe930('0x2b')]===_0x527f18;});if(_0x1f5eed){logger[_0xe930('0x2c')]('Agent\x20%s\x20found.',_0x527f18);return BPromise[_0xe930('0x2d')]({'id':_0x1f5eed['Id'],'name':_0x1f5eed[_0xe930('0x2e')]});}}else{logger[_0xe930('0x2c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x527f18);return _0x3bf6a6[_0xe930('0x2f')]()[_0xe930('0x29')](function(_0x4a4529){return BPromise[_0xe930('0x2d')]({'id':_0x4a4529[_0xe930('0x30')],'name':_0x4a4529['display_name']});});}});}else{logger[_0xe930('0x2c')](_0xe930('0x31'),_0x527f18);return _0x3bf6a6[_0xe930('0x2f')]()[_0xe930('0x29')](function(_0x2ab58f){return BPromise[_0xe930('0x2d')]({'id':_0x2ab58f[_0xe930('0x30')],'name':_0x2ab58f['display_name']});});}}function getEndUser(_0x1710ed,_0x4550af,_0x3329f7,_0x381132,_0x5887b9){var _0x768f3d={'$or':{'Phone':_0x381132}};var _0x34f21e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xe930('0x2d')]()[_0xe930('0x29')](function(){logger[_0xe930('0x2c')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x381132,_0x4550af[_0xe930('0x32')]);switch(_0x4550af[_0xe930('0x32')]){case _0xe930('0x33'):var _0x3ac156=_[_0xe930('0x34')](_0x768f3d);if(_0x4550af['additionalSearchContact']){var _0x525d06={};_0x525d06[_0x4550af[_0xe930('0x35')]]=_0x381132;_[_0xe930('0x36')](_0x3ac156[_0xe930('0x37')],_0x525d06);}return _0x5887b9[_0xe930('0x22')]('Contact')['find'](_0x3ac156,_0x34f21e)['execute']()['then'](function(_0x4bf6e5){if(_0x4bf6e5&&_0x4bf6e5[_0xe930('0x2a')]){return _0x4bf6e5;}else{var _0x125cd8=_[_0xe930('0x34')](_0x768f3d);if(_0x4550af[_0xe930('0x38')]){var _0x1eb901={};_0x1eb901[_0x4550af[_0xe930('0x38')]]=_0x381132;_[_0xe930('0x36')](_0x125cd8[_0xe930('0x37')],_0x1eb901);}return _0x5887b9[_0xe930('0x22')](_0xe930('0x39'))[_0xe930('0x27')](_0x125cd8,_0x34f21e);}});case _0xe930('0x3a'):var _0x56c9e0=_[_0xe930('0x34')](_0x768f3d);if(_0x4550af[_0xe930('0x3b')]){var _0x525d06={};_0x525d06[_0x4550af[_0xe930('0x3b')]]=_0x381132;_[_0xe930('0x36')](_0x56c9e0[_0xe930('0x37')],_0x525d06);}return _0x5887b9[_0xe930('0x22')](_0xe930('0x3c'))[_0xe930('0x27')](_0x56c9e0,_0x34f21e)[_0xe930('0x28')]()[_0xe930('0x29')](function(_0x47708a){if(_0x47708a&&_0x47708a[_0xe930('0x2a')]){return _0x47708a;}else{var _0x38ea6d=_[_0xe930('0x34')](_0x768f3d);if(_0x4550af[_0xe930('0x35')]){var _0x26dca9={};_0x26dca9[_0x4550af[_0xe930('0x35')]]=_0x381132;_['merge'](_0x38ea6d[_0xe930('0x37')],_0x26dca9);}return _0x5887b9[_0xe930('0x22')]('Contact')['find'](_0x38ea6d,_0x34f21e)['then'](function(_0xfa7b65){if(_0xfa7b65&&_0xfa7b65[_0xe930('0x2a')]){return _0xfa7b65;}else{var _0x50ddf8=_['cloneDeep'](_0x768f3d);if(_0x4550af[_0xe930('0x38')]){var _0x359eaf={};_0x359eaf[_0x4550af[_0xe930('0x38')]]=_0x381132;_['merge'](_0x50ddf8[_0xe930('0x37')],_0x359eaf);}return _0x5887b9[_0xe930('0x22')](_0xe930('0x39'))[_0xe930('0x27')](_0x50ddf8,_0x34f21e);}});}});case _0xe930('0x18'):var _0x3ac156=_['cloneDeep'](_0x768f3d);if(_0x4550af['additionalSearchContact']){var _0x525d06={};_0x525d06[_0x4550af[_0xe930('0x35')]]=_0x381132;_['merge'](_0x3ac156[_0xe930('0x37')],_0x525d06);}return _0x5887b9[_0xe930('0x22')](_0xe930('0x3d'))[_0xe930('0x27')](_0x3ac156,_0x34f21e)[_0xe930('0x28')]();case _0xe930('0x1a'):var _0x4cce91=_[_0xe930('0x34')](_0x768f3d);if(_0x4550af['additionalSearchLead']){var _0x525d06={};_0x525d06[_0x4550af[_0xe930('0x38')]]=_0x381132;_[_0xe930('0x36')](_0x4cce91[_0xe930('0x37')],_0x525d06);}return _0x5887b9['sobject'](_0xe930('0x39'))['find'](_0x4cce91,_0x34f21e);case'account':var _0x56c9e0=_[_0xe930('0x34')](_0x768f3d);if(_0x4550af[_0xe930('0x3b')]){var _0x525d06={};_0x525d06[_0x4550af[_0xe930('0x3b')]]=_0x381132;_[_0xe930('0x36')](_0x56c9e0['$or'],_0x525d06);}return _0x5887b9[_0xe930('0x22')]('Account')[_0xe930('0x27')](_0x56c9e0,_0x34f21e);default:return null;}})[_0xe930('0x29')](function(_0x533e95){if(_0x533e95&&_0x533e95[_0xe930('0x2a')]){var _0x4bea85=_[_0xe930('0x3e')](_0x533e95);if(_0x4bea85){return BPromise['resolve']({'id':_0x4bea85['Id'],'name':_0x4bea85[_0xe930('0x2e')],'phone':_0x4bea85[_0xe930('0x3f')],'endUserType':_0x4bea85['attributes'][_0xe930('0x40')]['toLowerCase']()});}}})['then'](function(_0x540550){if(_0x540550){logger[_0xe930('0x2c')](_0xe930('0x41'),_0x540550[_0xe930('0x19')],_0x381132);return BPromise[_0xe930('0x2d')](_0x540550);}else{logger[_0xe930('0x2c')](_0xe930('0x42'),_0x381132);var _0x409254={'Phone':_0x381132};if(_0x4550af[_0xe930('0x43')]){if(_0x4550af[_0xe930('0x43')]==='contact'){logger[_0xe930('0x2c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x381132,_0x4550af[_0xe930('0x43')]);_0x409254[_0xe930('0x44')]=_0x3329f7!==''?_0x3329f7:util[_0xe930('0x45')]('Caller\x20-\x20%s',_0x381132);}else if(_0x4550af[_0xe930('0x43')]===_0xe930('0x1a')){logger[_0xe930('0x2c')](_0xe930('0x46'),_0x381132,_0x4550af[_0xe930('0x43')]);_0x409254[_0xe930('0x44')]=_0x3329f7!==''?_0x3329f7:util[_0xe930('0x45')](_0xe930('0x47'),_0x381132);_0x409254[_0xe930('0x48')]=_0xe930('0x49');}else if(_0x4550af[_0xe930('0x43')]===_0xe930('0x1c')){logger[_0xe930('0x2c')](_0xe930('0x46'),_0x381132,_0x4550af[_0xe930('0x43')]);_0x409254['Name']=_0x3329f7!==_0xe930('0x4a')?_0x3329f7:util[_0xe930('0x45')](_0xe930('0x47'),_0x381132);}else{return null;}}return _0x5887b9[_0xe930('0x22')](_[_0xe930('0x4b')](_0x4550af[_0xe930('0x43')]))[_0xe930('0x23')](_0x409254)['then'](function(_0xc09dd5){return BPromise['resolve']({'id':_0xc09dd5['id'],'endUserType':_0x4550af['moduleCreate']});});}});}function getCustomFields(_0x52b7d7,_0x525a77){var _0x3c6d26={};if(_0x52b7d7[_0xe930('0x2a')]>0x0){_[_0xe930('0x4c')](_0x52b7d7,function(_0x425f35){if(_[_0xe930('0x4d')]([_0xe930('0x4e'),'picklist'],_0x425f35[_0xe930('0x40')])&&_0x425f35[_0xe930('0x4f')]){_0x3c6d26[_0x425f35[_0xe930('0x4f')]]=_0x425f35[_0xe930('0x50')][_0xe930('0x51')]();}else if(_0x425f35[_0xe930('0x40')]===_0xe930('0x52')&&_0x425f35[_0xe930('0x53')]&&_0x425f35[_0xe930('0x4f')]){_0x525a77[_0x425f35[_0xe930('0x53')]]&&(_0x3c6d26[_0x425f35[_0xe930('0x4f')]]=_0x525a77[_0x425f35['variableName']][_0xe930('0x51')]());}else if(_0x425f35[_0xe930('0x40')]===_0xe930('0x54')&&_0x425f35[_0xe930('0x55')]&&_0x425f35[_0xe930('0x55')][_0xe930('0x56')]&&_0x425f35[_0xe930('0x4f')]){_0x525a77[_0x425f35[_0xe930('0x55')][_0xe930('0x56')]['toLowerCase']()]&&(_0x3c6d26[_0x425f35['idField']]=_0x525a77[_0x425f35['Variable'][_0xe930('0x56')][_0xe930('0x57')]()][_0xe930('0x51')]());}});}return _0x3c6d26;}function getConnection(_0x245bf4){var _0x3a07a3=_0x245bf4[_0xe930('0x58')]['concat'](_0x245bf4[_0xe930('0x59')]);var _0x2f3d2f=new jsforce[(_0xe930('0x5a'))]({'oauth2':{'loginUrl':_0x245bf4[_0xe930('0x5b')]||_0xe930('0x5c'),'clientId':_0x245bf4[_0xe930('0x5d')],'clientSecret':_0x245bf4[_0xe930('0x5e')]}});return _0x2f3d2f['login'](_0x245bf4[_0xe930('0x5f')],_0x3a07a3)[_0xe930('0x29')](function(){logger['info'](_0xe930('0x60'));return _0x2f3d2f;});}exports[_0xe930('0x61')]=function(_0xc8b70e,_0x46522f,_0x4e7138,_0x5a280a,_0x583c70,_0x18fd12){var _0x5bacd2,_0x346f37,_0x17331f,_0x260713;_0x18fd12[_0xe930('0x62')]=intUtil['stripTrailingSlash'](_0x18fd12[_0xe930('0x62')]);_0x18fd12['remoteUri']=intUtil[_0xe930('0x63')](_0x18fd12['remoteUri']);if(_0x583c70&&_0x583c70[_0xe930('0x64')]){logger[_0xe930('0x2c')](_0xe930('0x65'),_0xe930('0x66'));_0x46522f['recordingURL']=util['format'](_0xe930('0x67'),_0x18fd12['serverUrl'],_0x46522f[_0xe930('0x68')],md5(_0x46522f['uniqueid']));}else{_0x46522f['recordingURL']='';}return getConnection(_0x18fd12)['then'](function(_0x51b46a){_0x260713=_0x51b46a;return getUser(_0x18fd12,_0x5a280a[_0xe930('0x69')],_0x260713);})[_0xe930('0x29')](function(_0x54d3e8){_0x5bacd2=_0x54d3e8;return getEndUser(_0x18fd12,_0x4e7138,_0x46522f[_0xe930('0x6a')],_0x46522f[_0xe930('0x6b')],_0x260713);})[_0xe930('0x29')](function(_0x3eeb6a){_0x346f37=_0x3eeb6a;return getTicket(_0x18fd12,_0x5bacd2,_0x346f37,_0x4e7138,_0x46522f,_0x4e7138[_0xe930('0x6c')],_0x260713,'queue');})['then'](function(_0x4c8c70){_0x17331f=_0x4c8c70;logger['info'](_0xe930('0x6d'),_0x17331f['id']);logger[_0xe930('0x2c')](_0xe930('0x6e'),_0x17331f['id'],_0x5a280a[_0xe930('0x56')],_0x18fd12[_0xe930('0x40')]);switch(_0x18fd12[_0xe930('0x40')]){case _0xe930('0x6f'):emit(util[_0xe930('0x45')](_0xe930('0x70'),_0x5a280a[_0xe930('0x56')]),_0xe930('0x71'),{'recordId':_0x17331f['id']});break;case _0xe930('0x72'):emit(util['format'](_0xe930('0x70'),_0x5a280a[_0xe930('0x56')]),_0xe930('0x73'),{'uri':util[_0xe930('0x45')](_0xe930('0x74'),_0x260713['instanceUrl'],_0x17331f['id'])});break;default:logger[_0xe930('0x75')](_0xe930('0x76'));}})[_0xe930('0x77')](function(_0x338749){logger['error']('[QUEUE]',_0x338749);});};exports[_0xe930('0x78')]=function(_0x414a51,_0x379a66,_0x3766bf,_0x1c29a5,_0x3c5dbb,_0x49ec70,_0x1cf168){var _0x50a1bd,_0x3c9597,_0x1d395c,_0x5ad3d9;_0x49ec70[_0xe930('0x62')]=intUtil[_0xe930('0x63')](_0x49ec70[_0xe930('0x62')]);_0x49ec70[_0xe930('0x5b')]=intUtil['stripTrailingSlash'](_0x49ec70['remoteUri']);if(_0x1cf168&&_0x1cf168[_0xe930('0x79')]&&_0x1cf168[_0xe930('0x79')]!==_0xe930('0x7a')){logger['info']('[OUTBOUND]',_0xe930('0x66'));_0x379a66['recordingURL']=util[_0xe930('0x45')](_0xe930('0x67'),_0x49ec70['serverUrl'],_0x379a66[_0xe930('0x68')],md5(_0x379a66['uniqueid']));}return getConnection(_0x49ec70)['then'](function(_0x15ef39){_0x5ad3d9=_0x15ef39;return getUser(_0x49ec70,_0x1c29a5[_0xe930('0x69')],_0x5ad3d9);})[_0xe930('0x29')](function(_0x19233f){_0x50a1bd=_0x19233f;return getEndUser(_0x49ec70,_0x3766bf,_0x379a66[_0xe930('0x7b')],_0x379a66[_0xe930('0x7c')],_0x5ad3d9);})[_0xe930('0x29')](function(_0x3cf6ca){_0x3c9597=_0x3cf6ca;return getTicket(_0x49ec70,_0x50a1bd,_0x3c9597,_0x3766bf,_0x379a66,_0x3766bf['Fields'],_0x5ad3d9,_0xe930('0x78'));})[_0xe930('0x29')](function(_0x262338){_0x1d395c=_0x262338;logger[_0xe930('0x2c')](_0xe930('0x7d'),_0x1d395c['id']);logger[_0xe930('0x2c')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1d395c['id'],_0x1c29a5[_0xe930('0x56')],_0x49ec70['type']);switch(_0x49ec70[_0xe930('0x40')]){case _0xe930('0x6f'):emit(util[_0xe930('0x45')](_0xe930('0x70'),_0x1c29a5['name']),'trigger:salesforce:display',{'recordId':_0x1d395c['id']});break;case'newTab':emit(util['format'](_0xe930('0x70'),_0x1c29a5[_0xe930('0x56')]),_0xe930('0x73'),{'uri':util[_0xe930('0x45')](_0xe930('0x74'),_0x5ad3d9[_0xe930('0x7e')],_0x1d395c['id'])});break;default:logger[_0xe930('0x75')]('[OUTBOUND]',_0xe930('0x7f'));}})[_0xe930('0x77')](function(_0x1ea9f2){logger[_0xe930('0x75')](_0xe930('0x80'),_0x1ea9f2);});};exports[_0xe930('0x81')]=function(_0x32814b,_0x41b569,_0x51aad0,_0x4e3179,_0x590fc7,_0x5b63dc){var _0x4bcfa1,_0x906601,_0x522ef0,_0x2ffc97;_0x5b63dc[_0xe930('0x62')]=intUtil['stripTrailingSlash'](_0x5b63dc[_0xe930('0x62')]);_0x5b63dc[_0xe930('0x5b')]=intUtil[_0xe930('0x63')](_0x5b63dc[_0xe930('0x5b')]);if(_0x590fc7&&_0x590fc7[_0xe930('0x64')]){logger['info']('['+_0x41b569['lastevent']['toUpperCase']()+']',_0xe930('0x66'));_0x41b569[_0xe930('0x82')]=util['format'](_0xe930('0x67'),_0x5b63dc['serverUrl'],_0x41b569[_0xe930('0x68')],md5(_0x41b569[_0xe930('0x68')]));}else{_0x41b569[_0xe930('0x82')]='';}return getConnection(_0x5b63dc)[_0xe930('0x29')](function(_0x73613b){_0x2ffc97=_0x73613b;if(!_[_0xe930('0x24')](_0x4e3179)){return getUser(_0x5b63dc,_0x4e3179[_0xe930('0x56')],_0x2ffc97);}else{return getUser(_0x5b63dc,null,_0x2ffc97);}})[_0xe930('0x29')](function(_0x37c243){_0x4bcfa1=_0x37c243;return getEndUser(_0x5b63dc,_0x51aad0,_0x41b569['calleridname'],_0x41b569['calleridnum'],_0x2ffc97);})['then'](function(_0x3dfa10){_0x906601=_0x3dfa10;return getTicket(_0x5b63dc,_0x4bcfa1,_0x906601,_0x51aad0,_0x41b569,_0x51aad0[_0xe930('0x6c')],_0x2ffc97);})[_0xe930('0x29')](function(_0x4ca5b3){_0x522ef0=_0x4ca5b3;logger['info']('['+_0x41b569[_0xe930('0x83')][_0xe930('0x84')]()+_0xe930('0x85'),_0x522ef0['id']);logger[_0xe930('0x2c')]('['+_0x41b569['lastevent'][_0xe930('0x84')]()+_0xe930('0x86'),_0x5b63dc[_0xe930('0x40')]);})[_0xe930('0x77')](function(_0x1f447f){logger['error']('['+_0x41b569[_0xe930('0x83')][_0xe930('0x84')]()+']',_0x1f447f);});}; \ No newline at end of file +var _0x0abe=['email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','newTab','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','trigger:salesforce:display','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','request-promise','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','lead','account','WhatId','Case','contact','AccountId','isNil','sobject','execute','then','find','Email','info','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','length','additionalSearchLead','$or','account_contact_lead','additionalSearchAccount','Contact','Lead','Account','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','upperFirst','forEach','includes','content','toString','variable','idField','variableName','customVariable','Variable','name','password','concat','Connection','remoteUri','clientId','clientSecret','login','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL'];(function(_0x54a8ba,_0x12076f){var _0x1c35b5=function(_0x20be43){while(--_0x20be43){_0x54a8ba['push'](_0x54a8ba['shift']());}};_0x1c35b5(++_0x12076f);}(_0x0abe,0x90));var _0xe0ab=function(_0xf055fc,_0x4e85d3){_0xf055fc=_0xf055fc-0x0;var _0xc51dad=_0x0abe[_0xf055fc];return _0xc51dad;};'use strict';var _=require('lodash');var rp=require(_0xe0ab('0x0'));var moment=require(_0xe0ab('0x1'));var BPromise=require(_0xe0ab('0x2'));var md5=require('md5');var jsforce=require('jsforce');var util=require('util');var Redis=require(_0xe0ab('0x3'));var intUtil=require(_0xe0ab('0x4'));var config=require(_0xe0ab('0x5'));var logger=require(_0xe0ab('0x6'))(_0xe0ab('0x7'));config[_0xe0ab('0x8')]=_[_0xe0ab('0x9')](config[_0xe0ab('0x8')],{'host':_0xe0ab('0xa'),'port':0x18eb});var io=require(_0xe0ab('0xb'))(new Redis(config[_0xe0ab('0x8')]));function emit(_0x37ab11,_0x22fab9,_0x21db85){io['to'](_0x37ab11)['emit'](_0x22fab9,_0x21db85);}function getTicket(_0x3cfe99,_0x39ef9a,_0x37dcf0,_0x173da6,_0x2efc36,_0x4c3e79,_0x5a0fb4,_0x4ff6f3){var _0x4ddae3=Object[_0xe0ab('0xc')]({},{'OwnerId':_0x39ef9a['id'],'Subject':intUtil[_0xe0ab('0xd')](_0x173da6[_0xe0ab('0xe')],_0x2efc36,'\x20'),'Description':intUtil['getString'](_0x173da6[_0xe0ab('0xf')],_0x2efc36,'\x0a')},getCustomFields(_0x4c3e79,_0x2efc36));if(_0x37dcf0){if(_0x173da6[_0xe0ab('0x10')]===_0xe0ab('0x11')){_0x4ddae3[_0xe0ab('0x12')]=moment[_0xe0ab('0x13')]();_0x4ddae3[_0xe0ab('0x14')]=![];_0x4ddae3[_0xe0ab('0x15')]=![];if(_0x37dcf0['endUserType']==='contact'||_0x37dcf0[_0xe0ab('0x16')]===_0xe0ab('0x17')){_0x4ddae3['WhoId']=_0x37dcf0['id'];}else if(_0x37dcf0[_0xe0ab('0x16')]===_0xe0ab('0x18')){_0x4ddae3[_0xe0ab('0x19')]=_0x37dcf0['id'];}}else if(_0x173da6[_0xe0ab('0x10')]===_0xe0ab('0x1a')){if(_0x37dcf0[_0xe0ab('0x16')]===_0xe0ab('0x1b')){_0x4ddae3['ContactId']=_0x37dcf0['id'];}else if(_0x37dcf0['endUserType']===_0xe0ab('0x18')){_0x4ddae3[_0xe0ab('0x1c')]=_0x37dcf0['id'];}else if(_0x37dcf0[_0xe0ab('0x16')]===_0xe0ab('0x17')&&_0x173da6['leadId']){_0x4ddae3[_0x173da6['leadId']]=_0x37dcf0['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x5a0fb4['sobject'](_0x173da6[_0xe0ab('0x10')])['create'](_0x4ddae3);}function getUser(_0x47062c,_0x34987b,_0x413148){if(!_[_0xe0ab('0x1d')](_0x34987b)&&intUtil['validateEmail'](_0x34987b)){var _0xfdc68={'Email':_0x34987b};var _0x579670={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x413148[_0xe0ab('0x1e')]('User')['find'](_0xfdc68,_0x579670)[_0xe0ab('0x1f')]()[_0xe0ab('0x20')](function(_0x43f626){if(_0x43f626['length']){var _0x51e48f=_[_0xe0ab('0x21')](_0x43f626,function(_0x139743){return _0x139743[_0xe0ab('0x22')]===_0x34987b;});if(_0x51e48f){logger[_0xe0ab('0x23')](_0xe0ab('0x24'),_0x34987b);return BPromise[_0xe0ab('0x25')]({'id':_0x51e48f['Id'],'name':_0x51e48f['Name']});}}else{logger[_0xe0ab('0x23')](_0xe0ab('0x26'),_0x34987b);return _0x413148[_0xe0ab('0x27')]()[_0xe0ab('0x20')](function(_0x2c4f5){return BPromise[_0xe0ab('0x25')]({'id':_0x2c4f5[_0xe0ab('0x28')],'name':_0x2c4f5[_0xe0ab('0x29')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x34987b);return _0x413148[_0xe0ab('0x27')]()['then'](function(_0x4ec759){return BPromise[_0xe0ab('0x25')]({'id':_0x4ec759[_0xe0ab('0x28')],'name':_0x4ec759[_0xe0ab('0x29')]});});}}function getEndUser(_0x56286a,_0xc3937e,_0x484071,_0x1ca684,_0x26bb54){var _0x44a2d7={'$or':{'Phone':_0x1ca684}};var _0x1bf54b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xe0ab('0x25')]()[_0xe0ab('0x20')](function(){logger['info'](_0xe0ab('0x2a'),_0x1ca684,_0xc3937e[_0xe0ab('0x2b')]);switch(_0xc3937e[_0xe0ab('0x2b')]){case _0xe0ab('0x2c'):var _0x4bb0d0=_[_0xe0ab('0x2d')](_0x44a2d7);if(_0xc3937e[_0xe0ab('0x2e')]){var _0x5569af={};_0x5569af[_0xc3937e[_0xe0ab('0x2e')]]=_0x1ca684;_[_0xe0ab('0x2f')](_0x4bb0d0['$or'],_0x5569af);}return _0x26bb54['sobject']('Contact')[_0xe0ab('0x21')](_0x4bb0d0,_0x1bf54b)[_0xe0ab('0x1f')]()[_0xe0ab('0x20')](function(_0x43a699){if(_0x43a699&&_0x43a699[_0xe0ab('0x30')]){return _0x43a699;}else{var _0x5c490c=_[_0xe0ab('0x2d')](_0x44a2d7);if(_0xc3937e[_0xe0ab('0x31')]){var _0x7faa9e={};_0x7faa9e[_0xc3937e[_0xe0ab('0x31')]]=_0x1ca684;_[_0xe0ab('0x2f')](_0x5c490c[_0xe0ab('0x32')],_0x7faa9e);}return _0x26bb54[_0xe0ab('0x1e')]('Lead')[_0xe0ab('0x21')](_0x5c490c,_0x1bf54b);}});case _0xe0ab('0x33'):var _0x50ee22=_[_0xe0ab('0x2d')](_0x44a2d7);if(_0xc3937e['additionalSearchAccount']){var _0x5569af={};_0x5569af[_0xc3937e[_0xe0ab('0x34')]]=_0x1ca684;_['merge'](_0x50ee22[_0xe0ab('0x32')],_0x5569af);}return _0x26bb54[_0xe0ab('0x1e')]('Account')['find'](_0x50ee22,_0x1bf54b)['execute']()[_0xe0ab('0x20')](function(_0x33a0c1){if(_0x33a0c1&&_0x33a0c1[_0xe0ab('0x30')]){return _0x33a0c1;}else{var _0x2d6c21=_[_0xe0ab('0x2d')](_0x44a2d7);if(_0xc3937e[_0xe0ab('0x2e')]){var _0x1e3086={};_0x1e3086[_0xc3937e[_0xe0ab('0x2e')]]=_0x1ca684;_['merge'](_0x2d6c21[_0xe0ab('0x32')],_0x1e3086);}return _0x26bb54['sobject'](_0xe0ab('0x35'))[_0xe0ab('0x21')](_0x2d6c21,_0x1bf54b)[_0xe0ab('0x20')](function(_0x512008){if(_0x512008&&_0x512008[_0xe0ab('0x30')]){return _0x512008;}else{var _0xbd093b=_[_0xe0ab('0x2d')](_0x44a2d7);if(_0xc3937e[_0xe0ab('0x31')]){var _0x48450d={};_0x48450d[_0xc3937e[_0xe0ab('0x31')]]=_0x1ca684;_[_0xe0ab('0x2f')](_0xbd093b[_0xe0ab('0x32')],_0x48450d);}return _0x26bb54[_0xe0ab('0x1e')](_0xe0ab('0x36'))[_0xe0ab('0x21')](_0xbd093b,_0x1bf54b);}});}});case _0xe0ab('0x1b'):var _0x4bb0d0=_[_0xe0ab('0x2d')](_0x44a2d7);if(_0xc3937e['additionalSearchContact']){var _0x5569af={};_0x5569af[_0xc3937e[_0xe0ab('0x2e')]]=_0x1ca684;_[_0xe0ab('0x2f')](_0x4bb0d0[_0xe0ab('0x32')],_0x5569af);}return _0x26bb54[_0xe0ab('0x1e')](_0xe0ab('0x35'))[_0xe0ab('0x21')](_0x4bb0d0,_0x1bf54b)[_0xe0ab('0x1f')]();case'lead':var _0x4aec55=_[_0xe0ab('0x2d')](_0x44a2d7);if(_0xc3937e[_0xe0ab('0x31')]){var _0x5569af={};_0x5569af[_0xc3937e[_0xe0ab('0x31')]]=_0x1ca684;_[_0xe0ab('0x2f')](_0x4aec55[_0xe0ab('0x32')],_0x5569af);}return _0x26bb54[_0xe0ab('0x1e')]('Lead')[_0xe0ab('0x21')](_0x4aec55,_0x1bf54b);case'account':var _0x50ee22=_[_0xe0ab('0x2d')](_0x44a2d7);if(_0xc3937e[_0xe0ab('0x34')]){var _0x5569af={};_0x5569af[_0xc3937e[_0xe0ab('0x34')]]=_0x1ca684;_[_0xe0ab('0x2f')](_0x50ee22[_0xe0ab('0x32')],_0x5569af);}return _0x26bb54[_0xe0ab('0x1e')](_0xe0ab('0x37'))['find'](_0x50ee22,_0x1bf54b);default:return null;}})['then'](function(_0x24d349){if(_0x24d349&&_0x24d349[_0xe0ab('0x30')]){var _0x25f619=_[_0xe0ab('0x38')](_0x24d349);if(_0x25f619){return BPromise['resolve']({'id':_0x25f619['Id'],'name':_0x25f619[_0xe0ab('0x39')],'phone':_0x25f619[_0xe0ab('0x3a')],'endUserType':_0x25f619[_0xe0ab('0x3b')][_0xe0ab('0x3c')][_0xe0ab('0x3d')]()});}}})[_0xe0ab('0x20')](function(_0x9ae6ea){if(_0x9ae6ea){logger[_0xe0ab('0x23')](_0xe0ab('0x3e'),_0x9ae6ea['endUserType'],_0x1ca684);return BPromise[_0xe0ab('0x25')](_0x9ae6ea);}else{logger[_0xe0ab('0x23')](_0xe0ab('0x3f'),_0x1ca684);var _0x436921={'Phone':_0x1ca684};if(_0xc3937e[_0xe0ab('0x40')]){if(_0xc3937e['moduleCreate']==='contact'){logger[_0xe0ab('0x23')](_0xe0ab('0x41'),_0x1ca684,_0xc3937e['moduleCreate']);_0x436921[_0xe0ab('0x42')]=_0x484071!==_0xe0ab('0x43')?_0x484071:util[_0xe0ab('0x44')](_0xe0ab('0x45'),_0x1ca684);}else if(_0xc3937e[_0xe0ab('0x40')]===_0xe0ab('0x17')){logger[_0xe0ab('0x23')](_0xe0ab('0x41'),_0x1ca684,_0xc3937e[_0xe0ab('0x40')]);_0x436921['LastName']=_0x484071!==_0xe0ab('0x43')?_0x484071:util['format']('Caller\x20-\x20%s',_0x1ca684);_0x436921[_0xe0ab('0x46')]='No\x20Company';}else if(_0xc3937e[_0xe0ab('0x40')]===_0xe0ab('0x18')){logger[_0xe0ab('0x23')](_0xe0ab('0x41'),_0x1ca684,_0xc3937e[_0xe0ab('0x40')]);_0x436921[_0xe0ab('0x39')]=_0x484071!==''?_0x484071:util[_0xe0ab('0x44')]('Caller\x20-\x20%s',_0x1ca684);}else{return null;}}return _0x26bb54[_0xe0ab('0x1e')](_[_0xe0ab('0x47')](_0xc3937e['moduleCreate']))['create'](_0x436921)[_0xe0ab('0x20')](function(_0x49d2b3){return BPromise[_0xe0ab('0x25')]({'id':_0x49d2b3['id'],'endUserType':_0xc3937e[_0xe0ab('0x40')]});});}});}function getCustomFields(_0x29479b,_0x50a0b3){var _0x5e2c23={};if(_0x29479b[_0xe0ab('0x30')]>0x0){_[_0xe0ab('0x48')](_0x29479b,function(_0x1c5582){if(_[_0xe0ab('0x49')](['string','picklist'],_0x1c5582['type'])&&_0x1c5582['idField']){_0x5e2c23[_0x1c5582['idField']]=_0x1c5582[_0xe0ab('0x4a')][_0xe0ab('0x4b')]();}else if(_0x1c5582[_0xe0ab('0x3c')]===_0xe0ab('0x4c')&&_0x1c5582['variableName']&&_0x1c5582[_0xe0ab('0x4d')]){_0x50a0b3[_0x1c5582[_0xe0ab('0x4e')]]&&(_0x5e2c23[_0x1c5582[_0xe0ab('0x4d')]]=_0x50a0b3[_0x1c5582[_0xe0ab('0x4e')]]['toString']());}else if(_0x1c5582[_0xe0ab('0x3c')]===_0xe0ab('0x4f')&&_0x1c5582[_0xe0ab('0x50')]&&_0x1c5582['Variable'][_0xe0ab('0x51')]&&_0x1c5582[_0xe0ab('0x4d')]){_0x50a0b3[_0x1c5582['Variable']['name'][_0xe0ab('0x3d')]()]&&(_0x5e2c23[_0x1c5582[_0xe0ab('0x4d')]]=_0x50a0b3[_0x1c5582[_0xe0ab('0x50')]['name'][_0xe0ab('0x3d')]()][_0xe0ab('0x4b')]());}});}return _0x5e2c23;}function getConnection(_0x2e6169){var _0x30db71=_0x2e6169[_0xe0ab('0x52')][_0xe0ab('0x53')](_0x2e6169['securityToken']);var _0x3deffe=new jsforce[(_0xe0ab('0x54'))]({'oauth2':{'loginUrl':_0x2e6169[_0xe0ab('0x55')]||'https://login.salesforce.com','clientId':_0x2e6169[_0xe0ab('0x56')],'clientSecret':_0x2e6169[_0xe0ab('0x57')]}});return _0x3deffe[_0xe0ab('0x58')](_0x2e6169['username'],_0x30db71)[_0xe0ab('0x20')](function(){logger[_0xe0ab('0x23')](_0xe0ab('0x59'));return _0x3deffe;});}exports['queue']=function(_0x30deed,_0x4c295d,_0x290677,_0x38dd33,_0x346250,_0x564903){var _0xd886e5,_0x501135,_0x5ee9dc,_0x29d9d9;_0x564903[_0xe0ab('0x5a')]=intUtil[_0xe0ab('0x5b')](_0x564903[_0xe0ab('0x5a')]);_0x564903[_0xe0ab('0x55')]=intUtil[_0xe0ab('0x5b')](_0x564903[_0xe0ab('0x55')]);if(_0x346250&&_0x346250[_0xe0ab('0x5c')]){logger[_0xe0ab('0x23')](_0xe0ab('0x5d'),_0xe0ab('0x5e'));_0x4c295d['recordingURL']=util['format'](_0xe0ab('0x5f'),_0x564903['serverUrl'],_0x4c295d[_0xe0ab('0x60')],md5(_0x4c295d[_0xe0ab('0x60')]));}else{_0x4c295d[_0xe0ab('0x61')]='';}return getConnection(_0x564903)[_0xe0ab('0x20')](function(_0x5b988e){_0x29d9d9=_0x5b988e;return getUser(_0x564903,_0x38dd33[_0xe0ab('0x62')],_0x29d9d9);})[_0xe0ab('0x20')](function(_0x18fd60){_0xd886e5=_0x18fd60;return getEndUser(_0x564903,_0x290677,_0x4c295d[_0xe0ab('0x63')],_0x4c295d[_0xe0ab('0x64')],_0x29d9d9);})['then'](function(_0x564726){_0x501135=_0x564726;return getTicket(_0x564903,_0xd886e5,_0x501135,_0x290677,_0x4c295d,_0x290677[_0xe0ab('0x65')],_0x29d9d9,'queue');})['then'](function(_0x1903fd){_0x5ee9dc=_0x1903fd;logger[_0xe0ab('0x23')](_0xe0ab('0x66'),_0x5ee9dc['id']);logger['info'](_0xe0ab('0x67'),_0x5ee9dc['id'],_0x38dd33[_0xe0ab('0x51')],_0x564903[_0xe0ab('0x3c')]);switch(_0x564903[_0xe0ab('0x3c')]){case'integrationTab':emit(util[_0xe0ab('0x44')](_0xe0ab('0x68'),_0x38dd33['name']),'trigger:salesforce:display',{'recordId':_0x5ee9dc['id']});break;case _0xe0ab('0x69'):emit(util[_0xe0ab('0x44')](_0xe0ab('0x68'),_0x38dd33[_0xe0ab('0x51')]),'trigger:browser:url',{'uri':util[_0xe0ab('0x44')](_0xe0ab('0x6a'),_0x29d9d9[_0xe0ab('0x6b')],_0x5ee9dc['id'])});break;default:logger[_0xe0ab('0x6c')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xe0ab('0x6d')](function(_0x51ac99){logger[_0xe0ab('0x6c')]('[QUEUE]',_0x51ac99);});};exports[_0xe0ab('0x6e')]=function(_0x45af75,_0x181406,_0x1941a7,_0x12b886,_0xe4814b,_0x1ca43d,_0xb6899a){var _0x52f2c8,_0x17b7b3,_0x323b09,_0x3bb350;_0x1ca43d[_0xe0ab('0x5a')]=intUtil[_0xe0ab('0x5b')](_0x1ca43d[_0xe0ab('0x5a')]);_0x1ca43d['remoteUri']=intUtil[_0xe0ab('0x5b')](_0x1ca43d[_0xe0ab('0x55')]);if(_0xb6899a&&_0xb6899a[_0xe0ab('0x6f')]&&_0xb6899a['recordingFormat']!=='none'){logger['info'](_0xe0ab('0x70'),'Recording\x20is\x20enabled!');_0x181406[_0xe0ab('0x61')]=util[_0xe0ab('0x44')](_0xe0ab('0x5f'),_0x1ca43d[_0xe0ab('0x5a')],_0x181406['uniqueid'],md5(_0x181406['uniqueid']));}return getConnection(_0x1ca43d)['then'](function(_0x7b28df){_0x3bb350=_0x7b28df;return getUser(_0x1ca43d,_0x12b886[_0xe0ab('0x62')],_0x3bb350);})[_0xe0ab('0x20')](function(_0x5720b5){_0x52f2c8=_0x5720b5;return getEndUser(_0x1ca43d,_0x1941a7,_0x181406[_0xe0ab('0x71')],_0x181406['destcalleridnum'],_0x3bb350);})[_0xe0ab('0x20')](function(_0x475636){_0x17b7b3=_0x475636;return getTicket(_0x1ca43d,_0x52f2c8,_0x17b7b3,_0x1941a7,_0x181406,_0x1941a7[_0xe0ab('0x65')],_0x3bb350,_0xe0ab('0x6e'));})[_0xe0ab('0x20')](function(_0x178661){_0x323b09=_0x178661;logger[_0xe0ab('0x23')](_0xe0ab('0x72'),_0x323b09['id']);logger[_0xe0ab('0x23')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x323b09['id'],_0x12b886['name'],_0x1ca43d[_0xe0ab('0x3c')]);switch(_0x1ca43d['type']){case'integrationTab':emit(util[_0xe0ab('0x44')](_0xe0ab('0x68'),_0x12b886[_0xe0ab('0x51')]),_0xe0ab('0x73'),{'recordId':_0x323b09['id']});break;case _0xe0ab('0x69'):emit(util[_0xe0ab('0x44')](_0xe0ab('0x68'),_0x12b886[_0xe0ab('0x51')]),_0xe0ab('0x74'),{'uri':util[_0xe0ab('0x44')](_0xe0ab('0x6a'),_0x3bb350['instanceUrl'],_0x323b09['id'])});break;default:logger[_0xe0ab('0x6c')]('[OUTBOUND]',_0xe0ab('0x75'));}})[_0xe0ab('0x6d')](function(_0x563c68){logger['error']('[OUTBOUND]',_0x563c68);});};exports[_0xe0ab('0x76')]=function(_0x53b355,_0x315763,_0x1db632,_0x3938c2,_0x2f86a1,_0x9e2ac7){var _0x4fc428,_0x29d197,_0x4ce431,_0x295106;_0x9e2ac7[_0xe0ab('0x5a')]=intUtil[_0xe0ab('0x5b')](_0x9e2ac7[_0xe0ab('0x5a')]);_0x9e2ac7[_0xe0ab('0x55')]=intUtil[_0xe0ab('0x5b')](_0x9e2ac7['remoteUri']);if(_0x2f86a1&&_0x2f86a1['monitor_format']){logger[_0xe0ab('0x23')]('['+_0x315763[_0xe0ab('0x77')][_0xe0ab('0x78')]()+']','Recording\x20is\x20enabled!');_0x315763[_0xe0ab('0x61')]=util[_0xe0ab('0x44')](_0xe0ab('0x5f'),_0x9e2ac7[_0xe0ab('0x5a')],_0x315763[_0xe0ab('0x60')],md5(_0x315763[_0xe0ab('0x60')]));}else{_0x315763['recordingURL']='';}return getConnection(_0x9e2ac7)[_0xe0ab('0x20')](function(_0xcc6713){_0x295106=_0xcc6713;if(!_[_0xe0ab('0x1d')](_0x3938c2)){return getUser(_0x9e2ac7,_0x3938c2[_0xe0ab('0x51')],_0x295106);}else{return getUser(_0x9e2ac7,null,_0x295106);}})['then'](function(_0x7407bc){_0x4fc428=_0x7407bc;return getEndUser(_0x9e2ac7,_0x1db632,_0x315763['calleridname'],_0x315763[_0xe0ab('0x64')],_0x295106);})[_0xe0ab('0x20')](function(_0x520a72){_0x29d197=_0x520a72;return getTicket(_0x9e2ac7,_0x4fc428,_0x29d197,_0x1db632,_0x315763,_0x1db632[_0xe0ab('0x65')],_0x295106);})[_0xe0ab('0x20')](function(_0x428136){_0x4ce431=_0x428136;logger[_0xe0ab('0x23')]('['+_0x315763[_0xe0ab('0x77')][_0xe0ab('0x78')]()+']\x20Ticket\x20%s\x20created.',_0x4ce431['id']);logger[_0xe0ab('0x23')]('['+_0x315763[_0xe0ab('0x77')][_0xe0ab('0x78')]()+']\x20Integration\x20account\x20type\x20%s.',_0x9e2ac7[_0xe0ab('0x3c')]);})[_0xe0ab('0x6d')](function(_0xf3fdcc){logger['error']('['+_0x315763[_0xe0ab('0x77')]['toUpperCase']()+']',_0xf3fdcc);});}; \ 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 1b7c884..d1eab22 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 _0xb120=['serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','inspect','lodash','bluebird','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','catch','error','message','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','active','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','userId','POST','sys_user?','endUserNumber','user','true','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','endUserId','],\x20getEndUser\x20crm','forEach','includes','string','picklist','nameField','content','toString','type','idField','toLowerCase','variable','customField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','push','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash'];(function(_0x11dd75,_0x340f1c){var _0x21bd9b=function(_0x22f10f){while(--_0x22f10f){_0x11dd75['push'](_0x11dd75['shift']());}};_0x21bd9b(++_0x340f1c);}(_0xb120,0x1c1));var _0x0b12=function(_0x5b28de,_0x4f1fc7){_0x5b28de=_0x5b28de-0x0;var _0x47f360=_0xb120[_0x5b28de];return _0x47f360;};'use strict';var _=require(_0x0b12('0x0'));var Promise=require(_0x0b12('0x1'));var rp=require('request-promise');var util=require('util');var md5=require(_0x0b12('0x2'));var Redis=require(_0x0b12('0x3'));var intUtil=require('./util');var config=require(_0x0b12('0x4'));var logger=require(_0x0b12('0x5'))(_0x0b12('0x6'));config['redis']=_['defaults'](config[_0x0b12('0x7')],{'host':_0x0b12('0x8'),'port':0x18eb});var io=require(_0x0b12('0x9'))(new Redis(config[_0x0b12('0x7')]));function getAdminUser(_0x246c40,_0x4b3bc2,_0x1a9313,_0x5394bf,_0x2bc5ff,_0x2424cf){return new Promise(function(_0x4e6b34,_0x4a223c){var _0xa3b4d8={'method':_0x0b12('0xa'),'uri':_0x5394bf+_0x0b12('0xb')+'&'+_0x2bc5ff+'&'+_0x2424cf,'auth':_0x4b3bc2,'json':!![]};return rp(_0xa3b4d8)[_0x0b12('0xc')](function(_0x1431a2){if(_0x1431a2[_0x0b12('0xd')][_0x0b12('0xe')]>0x0){_0x1a9313[_0x0b12('0xf')]=_0x1431a2['result'][0x0][_0x0b12('0x10')];}logger[_0x0b12('0x11')]('['+[_0x246c40[_0x0b12('0x12')]()]+'],\x20getAdminUser\x20crm',_0x1a9313);_0x4e6b34(_0x1a9313);})[_0x0b12('0x13')](function(_0xbb0028){logger[_0x0b12('0x14')]('['+[_0x246c40[_0x0b12('0x12')]()]+']',_0xbb0028['message']);_0x4a223c(_0xbb0028[_0x0b12('0x15')]);});});}function getUser(_0x56f0af,_0x3dfee0,_0xf1b90a,_0x5540b6,_0x124896){return function(_0x1ae6fd){logger[_0x0b12('0x11')]('['+[_0x56f0af[_0x0b12('0x12')]()]+'],\x20getUser\x20input\x20crm',_0x1ae6fd);return new Promise(function(_0x36de6b,_0x83e1){if(intUtil[_0x0b12('0x16')](_0x1ae6fd['userEmail'])){var _0x29818d={'method':_0x0b12('0xa'),'uri':_0xf1b90a+_0x0b12('0x17')+_0x1ae6fd[_0x0b12('0x18')]+'&'+_0x5540b6+'&'+_0x124896,'auth':_0x3dfee0,'json':!![]};logger['info']('['+[_0x56f0af[_0x0b12('0x12')]()]+_0x0b12('0x19'),_0x29818d);return rp(_0x29818d)[_0x0b12('0xc')](function(_0x587634){logger[_0x0b12('0x11')]('['+[_0x56f0af[_0x0b12('0x12')]()]+'],\x20getUser\x20entity',_0x587634);if(_0x587634[_0x0b12('0xd')][_0x0b12('0xe')]>0x0&&String(_0x587634[_0x0b12('0xd')][0x0][_0x0b12('0x1a')])==='true'){_0x1ae6fd['userId']=_0x587634[_0x0b12('0xd')][0x0]['sys_id'];}else{_0x1ae6fd['userId']=_0x1ae6fd[_0x0b12('0xf')];_0x1ae6fd[_0x0b12('0x18')]=_0x1ae6fd[_0x0b12('0x1b')];}logger['info']('['+[_0x56f0af[_0x0b12('0x12')]()]+_0x0b12('0x1c'),_0x1ae6fd);_0x36de6b(_0x1ae6fd);})[_0x0b12('0x13')](function(_0x4320aa){logger[_0x0b12('0x14')]('['+[_0x56f0af[_0x0b12('0x12')]()]+']',_0x4320aa['message']);_0x83e1(_0x4320aa[_0x0b12('0x15')]);});}else{logger[_0x0b12('0x11')]('['+[_0x56f0af[_0x0b12('0x12')]()]+_0x0b12('0x1d'));_0x1ae6fd[_0x0b12('0x1e')]=_0x1ae6fd[_0x0b12('0xf')];_0x1ae6fd[_0x0b12('0x18')]=_0x1ae6fd[_0x0b12('0x1b')];_0x36de6b(_0x1ae6fd);}});};}function createEndUser(_0x3d09d8,_0x242f2b,_0x58266e,_0x16b5f2,_0x1a2c92){logger[_0x0b12('0x11')]('['+[_0x3d09d8[_0x0b12('0x12')]()]+'],\x20createEndUser\x20input\x20crm',_0x58266e);return new Promise(function(_0x492f5d,_0x1b9049){var _0x2cc43c={'method':_0x0b12('0x1f'),'uri':_0x16b5f2+_0x0b12('0x20')+_0x1a2c92,'body':{'user_name':_0x58266e[_0x0b12('0x21')],'roles':_0x0b12('0x22'),'first_name':_0x58266e[_0x0b12('0x21')],'active':_0x0b12('0x23'),'date_format':_0x0b12('0x24'),'phone':_0x58266e[_0x0b12('0x21')]},'auth':_0x242f2b,'json':!![]};return rp(_0x2cc43c)[_0x0b12('0xc')](function(_0x387ec8){logger['info']('['+[_0x3d09d8[_0x0b12('0x12')]()]+_0x0b12('0x25'),_0x387ec8[_0x0b12('0xd')]);_0x58266e['endUserId']=_0x387ec8[_0x0b12('0xd')]['sys_id'];_0x492f5d(_0x58266e);})[_0x0b12('0x13')](function(_0x31d83){logger[_0x0b12('0x14')]('['+[_0x3d09d8['toUpperCase']()]+']',_0x31d83[_0x0b12('0x15')]);_0x1b9049(_0x31d83[_0x0b12('0x15')]);});});}function getEndUser(_0x17fb65,_0x2398ae,_0x58ba4f,_0x10b19c,_0x4a6acf){return function(_0xb48314){logger['info']('['+[_0x17fb65[_0x0b12('0x12')]()]+_0x0b12('0x26'),_0xb48314);return new Promise(function(_0xbee865,_0x8d4177){var _0x3e2d91={'method':'GET','uri':_0x58ba4f+'sys_user?sysparm_query=phone%3D'+_0xb48314[_0x0b12('0x21')]+'&'+_0x10b19c+'&'+_0x4a6acf,'auth':_0x2398ae,'json':!![]};return rp(_0x3e2d91)['then'](function(_0x137807){if(_0x137807[_0x0b12('0xd')][_0x0b12('0xe')]>0x0){_0xb48314[_0x0b12('0x27')]=_0x137807[_0x0b12('0xd')][0x0]['sys_id'];logger['info']('['+[_0x17fb65[_0x0b12('0x12')]()]+_0x0b12('0x28'),_0xb48314);_0xbee865(_0xb48314);}else{return createEndUser(_0x17fb65,_0x2398ae,_0xb48314,_0x58ba4f,_0x10b19c)[_0x0b12('0xc')](function(_0x17e739){logger[_0x0b12('0x11')]('['+[_0x17fb65['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x17e739);_0xbee865(_0x17e739);});}})['catch'](function(_0x205e38){logger['error']('['+[_0x17fb65[_0x0b12('0x12')]()]+']',_0x205e38[_0x0b12('0x15')]);_0x8d4177(_0x205e38['message']);});});};}function getCustomFields(_0x159ac0,_0x229a20){var _0x5b9a62={};if(_0x159ac0['length']>0x0){_[_0x0b12('0x29')](_0x159ac0,function(_0x449af8){if(_[_0x0b12('0x2a')]([_0x0b12('0x2b'),_0x0b12('0x2c')],_0x449af8['type'])&&_0x449af8[_0x0b12('0x2d')]&&!_0x449af8['customField']){_0x5b9a62[_0x449af8[_0x0b12('0x2d')]['toLowerCase']()]=_0x449af8[_0x0b12('0x2e')][_0x0b12('0x2f')]();}else if(_[_0x0b12('0x2a')](['string',_0x0b12('0x2c')],_0x449af8[_0x0b12('0x30')])&&_0x449af8['idField']&&_0x449af8['customField']){_0x5b9a62[_0x449af8[_0x0b12('0x31')][_0x0b12('0x32')]()]=_0x449af8['content'][_0x0b12('0x2f')]();}else if(_0x449af8[_0x0b12('0x30')]===_0x0b12('0x33')&&_0x449af8['variableName']&&_0x449af8[_0x0b12('0x31')]&&_0x449af8[_0x0b12('0x34')]){_0x5b9a62[_0x449af8[_0x0b12('0x31')][_0x0b12('0x32')]()]=_0x229a20[_0x449af8[_0x0b12('0x35')]][_0x0b12('0x2f')]();}else if(_0x449af8[_0x0b12('0x30')]===_0x0b12('0x36')&&_0x449af8[_0x0b12('0x37')]&&_0x449af8['Variable'][_0x0b12('0x38')]&&_0x449af8[_0x0b12('0x31')]&&_0x449af8['customField']){_0x5b9a62[_0x449af8[_0x0b12('0x31')]['toLowerCase']()]=_0x229a20[_0x449af8[_0x0b12('0x37')][_0x0b12('0x38')][_0x0b12('0x32')]()][_0x0b12('0x2f')]();}});}return _0x5b9a62;}function getTicket(_0x47f2e0,_0x51618f,_0x492c2a,_0x4be5fe,_0x41ba7d,_0x59905f){return function(_0xfe1d26){logger[_0x0b12('0x11')]('['+[_0x47f2e0[_0x0b12('0x12')]()]+_0x0b12('0x39'),_0xfe1d26);return new Promise(function(_0x42ef2d,_0x32c2c0){var _0x3f4773=_0x47f2e0[_0x0b12('0x32')]()===_0x0b12('0x3a')?_0xfe1d26[_0x0b12('0x1e')]:_0xfe1d26[_0x0b12('0x27')];var _0x26fbe3={'method':_0x0b12('0x1f'),'uri':_0x492c2a+'incident'+'?'+_0x59905f,'body':Object[_0x0b12('0x3b')]({},{'active':'true','caller_id':_0x3f4773,'assigned_to':_0xfe1d26[_0x0b12('0x1e')],'short_description':intUtil['getString'](_0x4be5fe['Subjects'],_0x41ba7d,'\x20'),'description':intUtil[_0x0b12('0x3c')](_0x4be5fe['Descriptions'],_0x41ba7d,'\x0a')},getCustomFields(_0x4be5fe[_0x0b12('0x3d')],_0x41ba7d)),'auth':_0x51618f,'json':!![]};return rp(_0x26fbe3)['then'](function(_0x2f5587){logger[_0x0b12('0x11')]('['+[_0x47f2e0[_0x0b12('0x12')]()]+_0x0b12('0x3e'),_0x2f5587[_0x0b12('0xd')]);_0xfe1d26[_0x0b12('0x3f')]=_0x2f5587[_0x0b12('0xd')][_0x0b12('0x10')];_0xfe1d26[_0x0b12('0x40')]=_0x2f5587[_0x0b12('0xd')][_0x0b12('0x41')];logger[_0x0b12('0x11')]('['+[_0x47f2e0[_0x0b12('0x12')]()]+_0x0b12('0x42'),_0xfe1d26);_0x42ef2d(_0xfe1d26);})[_0x0b12('0x13')](function(_0x5d26db){logger[_0x0b12('0x14')]('['+[_0x47f2e0[_0x0b12('0x12')]()]+']',_0x5d26db['message']);_0x32c2c0(_0x5d26db[_0x0b12('0x15')]);});});};}function createRemoteTag(_0x95c755,_0x338bb,_0x8c4230,_0x4ea74d){return new Promise(function(_0x31fad6,_0x440fb4){var _0x4235e9={'method':_0x0b12('0x1f'),'uri':_0x8c4230+_0x0b12('0x43')+'?'+_0x4ea74d,'body':{'short_description':_0x95c755,'global':!![],'active':!![],'name':_0x95c755},'auth':_0x338bb,'json':!![]};return rp(_0x4235e9)[_0x0b12('0xc')](function(_0x4f19d4){var _0xe5e4da=_0x4f19d4[_0x0b12('0xd')][_0x0b12('0x10')];_0x31fad6(_0xe5e4da);});});}function getRemoteTag(_0x352fe8,_0x2a6703,_0x4d38b7,_0x21f9f0,_0xd085f1){return new Promise(function(_0x34e916,_0x4a8900){var _0x47a287={'method':_0x0b12('0xa'),'uri':_0x4d38b7+'label'+_0x0b12('0x44')+_0x352fe8+'&'+_0x21f9f0,'auth':_0x2a6703,'json':!![]};return rp(_0x47a287)[_0x0b12('0xc')](function(_0x5d64f2){if(_0x5d64f2[_0x0b12('0xd')]['length']>0x0){var _0x5e9e24=_0x5d64f2['result'][0x0][_0x0b12('0x10')];_0x34e916(_0x5e9e24);}else{return createRemoteTag(_0x352fe8,_0x2a6703,_0x4d38b7,_0x21f9f0)['then'](function(_0x3f8cbd){_0x34e916(_0x3f8cbd);});}});});}function assignTagToIncident(_0x479e08,_0x42af2b,_0x9bc4dd,_0x53b771,_0x586920){return new Promise(function(_0x399a8c,_0x2b11ec){var _0x56884a={'method':_0x0b12('0x1f'),'uri':_0x9bc4dd+_0x0b12('0x45')+'?'+_0x586920,'body':{'label':_0x479e08,'table':'incident','id_type':'Incident','table_key':_0x53b771[_0x0b12('0x3f')],'title':'Incident\x20-\x20'+_0x53b771[_0x0b12('0x40')],'id_display':_0x53b771['ticketNumber']},'auth':_0x42af2b,'json':!![]};return rp(_0x56884a)[_0x0b12('0xc')](function(_0x435a39){_0x399a8c();})[_0x0b12('0x13')](function(){_0x399a8c();});});}function manageTags(_0x20fe0a,_0x15c6f6,_0x711aaf,_0x338a35,_0x2130ba,_0x5dd7d9,_0x3d0340){return new Promise(function(_0x3d53a4,_0x4ec4bf){var _0x1879fa=[];_0x15c6f6[_0x0b12('0x29')](function(_0x585f56){_0x1879fa[_0x0b12('0x46')](getRemoteTag(_0x585f56,_0x711aaf,_0x338a35,_0x5dd7d9,_0x3d0340));});return Promise['all'](_0x1879fa)[_0x0b12('0xc')](function(_0x47b9f5){if(_0x47b9f5[_0x0b12('0xe')]){logger['info']('['+[_0x20fe0a[_0x0b12('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x47b9f5);var _0x527dbc=[];_0x47b9f5[_0x0b12('0x29')](function(_0x4aed8f){_0x527dbc[_0x0b12('0x46')](assignTagToIncident(_0x4aed8f,_0x711aaf,_0x338a35,_0x2130ba,_0x5dd7d9));});return Promise[_0x0b12('0x47')](_0x527dbc)[_0x0b12('0xc')](function(){_0x3d53a4();})[_0x0b12('0x13')](function(){_0x3d53a4();});}else{_0x3d53a4();}});});}function getTags(_0x59a675,_0x32f554,_0x2e11db,_0x14cf5d,_0x3942de,_0x4fb8da){return function(_0x7245ca){return new Promise(function(_0x281e95,_0xc523d8){var _0x2fadc8=[];var _0x17c6d4=_0x14cf5d['Tags'];if(_0x17c6d4&&_0x17c6d4[_0x0b12('0xe')]>0x0){_0x2fadc8=_[_0x0b12('0x48')](_0x17c6d4,_0x0b12('0x38'));}if(_0x2fadc8[_0x0b12('0xe')]>0x0){return manageTags(_0x59a675,_0x2fadc8,_0x32f554,_0x2e11db,_0x7245ca,_0x3942de,_0x4fb8da)[_0x0b12('0xc')](function(){_0x281e95(_0x7245ca);});}else{_0x281e95(_0x7245ca);}});};}function emit(_0x48452c,_0x54172a,_0x1d1d4e){var _0x56ef27=_0x0b12('0x49')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x0b12('0x4a')+_0x0b12('0x4b');var _0x5c592e={'uri':_0x48452c+_0x0b12('0x4c')+_0x1d1d4e+_0x56ef27};io['to'](util['format'](_0x0b12('0x4d'),_0x54172a))[_0x0b12('0x4e')](_0x0b12('0x4f'),_0x5c592e);}exports['cs']=function(_0x3f1224,_0x5b5846,_0x5ec912,_0x380b75,_0x475ad4,_0xbe6854,_0x298a4d,_0x237303){var _0x5ef7a9={};var _0x523db4={'user':_0xbe6854[_0x0b12('0x50')],'pass':_0xbe6854[_0x0b12('0x51')]};var _0x32500f=_0x0b12('0x52');var _0x276d42=_0x0b12('0x53');_0xbe6854[_0x0b12('0x54')]=intUtil[_0x0b12('0x55')](_0xbe6854[_0x0b12('0x54')]);_0xbe6854[_0x0b12('0x56')]=intUtil[_0x0b12('0x55')](_0xbe6854[_0x0b12('0x56')]);var _0x1ad759=util[_0x0b12('0x57')](_0x0b12('0x58'),_0xbe6854['remoteUri']);_0x5ef7a9[_0x0b12('0x18')]=!_[_0x0b12('0x59')](_0x380b75)?_0x380b75['email']:null;_0x5ef7a9[_0x0b12('0x1b')]=_0xbe6854[_0x0b12('0x5a')];_0x5ef7a9[_0x0b12('0x21')]=_0x237303[_0x0b12('0x32')]()===_0x0b12('0x3a')?_0x5b5846[_0x0b12('0x5b')]:_0x5b5846[_0x0b12('0x5c')];_0x5ef7a9[_0x0b12('0x5d')]=_0x237303===_0x0b12('0x5e')||_0x237303===_0x0b12('0x5f')?_0x0b12('0x5e'):_0x0b12('0x3a');var _0x24fc84=util[_0x0b12('0x57')](_0x0b12('0x60'),_0xbe6854[_0x0b12('0x56')],_0x5b5846[_0x0b12('0x61')],md5(_0x5b5846[_0x0b12('0x61')]));if(_0x475ad4&&_0x475ad4[_0x0b12('0x62')]){logger[_0x0b12('0x11')](_0x0b12('0x63'),_0x0b12('0x64'));_0x5b5846[_0x0b12('0x65')]=_0x24fc84;}else if(_0x298a4d&&_0x298a4d[_0x0b12('0x66')]&&_0x298a4d[_0x0b12('0x66')]!=='none'){logger[_0x0b12('0x11')](_0x0b12('0x67'),_0x0b12('0x64'));_0x5b5846['recordingURL']=_0x24fc84;}else{_0x5b5846[_0x0b12('0x65')]='';}return getAdminUser(_0x237303,_0x523db4,_0x5ef7a9,_0x1ad759,_0x276d42,_0x32500f)[_0x0b12('0xc')](getUser(_0x237303,_0x523db4,_0x1ad759,_0x276d42,_0x32500f))[_0x0b12('0xc')](getEndUser(_0x237303,_0x523db4,_0x1ad759,_0x276d42,_0x32500f))[_0x0b12('0xc')](getTicket(_0x237303,_0x523db4,_0x1ad759,_0x5ec912,_0x5b5846,_0x276d42))[_0x0b12('0xc')](function(_0x3c63c3){logger[_0x0b12('0x11')](util[_0x0b12('0x57')](_0x0b12('0x68'),_0x3c63c3[_0x0b12('0x3f')]));logger[_0x0b12('0x11')](util[_0x0b12('0x57')](_0x0b12('0x69'),_0x237303));if(_0x237303!==_0x0b12('0x5f')){logger[_0x0b12('0x11')]('['+[_0x237303['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xbe6854['remoteUri'],_0x380b75['name'],_0x3c63c3['ticketId']);}})[_0x0b12('0x13')](function(_0x43d985){logger[_0x0b12('0x14')]('['+[_0x237303['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x0b12('0x6a')](_0x43d985,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe61a=['getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','queue','outbound','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','then','length','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','content','toString','idField','variable','customField','toLowerCase','variableName','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign'];(function(_0x3fe842,_0x2f65e5){var _0x26da02=function(_0x4ba0fe){while(--_0x4ba0fe){_0x3fe842['push'](_0x3fe842['shift']());}};_0x26da02(++_0x2f65e5);}(_0xe61a,0x10f));var _0xae61=function(_0x2824ec,_0x2e3ffc){_0x2824ec=_0x2824ec-0x0;var _0x4203f7=_0xe61a[_0x2824ec];return _0x4203f7;};'use strict';var _=require(_0xae61('0x0'));var Promise=require(_0xae61('0x1'));var rp=require('request-promise');var util=require(_0xae61('0x2'));var md5=require(_0xae61('0x3'));var Redis=require(_0xae61('0x4'));var intUtil=require(_0xae61('0x5'));var config=require(_0xae61('0x6'));var logger=require(_0xae61('0x7'))(_0xae61('0x8'));config[_0xae61('0x9')]=_[_0xae61('0xa')](config[_0xae61('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xae61('0xb'))(new Redis(config[_0xae61('0x9')]));function getAdminUser(_0x203fc1,_0x1ad25c,_0x17e667,_0x558af9,_0x56dfb9,_0x36db73){return new Promise(function(_0x575d9c,_0x2e7f24){var _0x55e5d4={'method':_0xae61('0xc'),'uri':_0x558af9+_0xae61('0xd')+'&'+_0x56dfb9+'&'+_0x36db73,'auth':_0x1ad25c,'json':!![]};return rp(_0x55e5d4)['then'](function(_0x5ce52e){if(_0x5ce52e['result']['length']>0x0){_0x17e667[_0xae61('0xe')]=_0x5ce52e[_0xae61('0xf')][0x0][_0xae61('0x10')];}logger[_0xae61('0x11')]('['+[_0x203fc1[_0xae61('0x12')]()]+_0xae61('0x13'),_0x17e667);_0x575d9c(_0x17e667);})[_0xae61('0x14')](function(_0x59a345){logger[_0xae61('0x15')]('['+[_0x203fc1[_0xae61('0x12')]()]+']',_0x59a345['message']);_0x2e7f24(_0x59a345[_0xae61('0x16')]);});});}function getUser(_0x7aa0b5,_0x56d753,_0x586704,_0x3b1b9b,_0x3888e3){return function(_0x1c2612){logger[_0xae61('0x11')]('['+[_0x7aa0b5[_0xae61('0x12')]()]+_0xae61('0x17'),_0x1c2612);return new Promise(function(_0x391488,_0x280483){if(intUtil[_0xae61('0x18')](_0x1c2612[_0xae61('0x19')])){var _0x65ce5={'method':_0xae61('0xc'),'uri':_0x586704+'sys_user?sysparm_query=email%3D'+_0x1c2612[_0xae61('0x19')]+'&'+_0x3b1b9b+'&'+_0x3888e3,'auth':_0x56d753,'json':!![]};logger[_0xae61('0x11')]('['+[_0x7aa0b5[_0xae61('0x12')]()]+_0xae61('0x1a'),_0x65ce5);return rp(_0x65ce5)[_0xae61('0x1b')](function(_0x48dbd){logger[_0xae61('0x11')]('['+[_0x7aa0b5[_0xae61('0x12')]()]+'],\x20getUser\x20entity',_0x48dbd);if(_0x48dbd[_0xae61('0xf')][_0xae61('0x1c')]>0x0&&String(_0x48dbd[_0xae61('0xf')][0x0][_0xae61('0x1d')])===_0xae61('0x1e')){_0x1c2612['userId']=_0x48dbd['result'][0x0][_0xae61('0x10')];}else{_0x1c2612[_0xae61('0x1f')]=_0x1c2612[_0xae61('0xe')];_0x1c2612[_0xae61('0x19')]=_0x1c2612[_0xae61('0x20')];}logger['info']('['+[_0x7aa0b5['toUpperCase']()]+_0xae61('0x21'),_0x1c2612);_0x391488(_0x1c2612);})[_0xae61('0x14')](function(_0xea8f2f){logger['error']('['+[_0x7aa0b5[_0xae61('0x12')]()]+']',_0xea8f2f[_0xae61('0x16')]);_0x280483(_0xea8f2f[_0xae61('0x16')]);});}else{logger['info']('['+[_0x7aa0b5[_0xae61('0x12')]()]+_0xae61('0x22'));_0x1c2612['userId']=_0x1c2612['adminId'];_0x1c2612['userEmail']=_0x1c2612[_0xae61('0x20')];_0x391488(_0x1c2612);}});};}function createEndUser(_0x2c064d,_0x2ce97a,_0x167432,_0x45e167,_0x170ed9){logger['info']('['+[_0x2c064d[_0xae61('0x12')]()]+_0xae61('0x23'),_0x167432);return new Promise(function(_0x4f9460,_0x2b3a89){var _0x3d513f={'method':_0xae61('0x24'),'uri':_0x45e167+_0xae61('0x25')+_0x170ed9,'body':{'user_name':_0x167432[_0xae61('0x26')],'roles':_0xae61('0x27'),'first_name':_0x167432[_0xae61('0x26')],'active':_0xae61('0x1e'),'date_format':'System','phone':_0x167432[_0xae61('0x26')]},'auth':_0x2ce97a,'json':!![]};return rp(_0x3d513f)[_0xae61('0x1b')](function(_0xd76844){logger[_0xae61('0x11')]('['+[_0x2c064d[_0xae61('0x12')]()]+'],\x20EndUser\x20schema',_0xd76844[_0xae61('0xf')]);_0x167432[_0xae61('0x28')]=_0xd76844['result'][_0xae61('0x10')];_0x4f9460(_0x167432);})['catch'](function(_0x20b598){logger[_0xae61('0x15')]('['+[_0x2c064d['toUpperCase']()]+']',_0x20b598[_0xae61('0x16')]);_0x2b3a89(_0x20b598[_0xae61('0x16')]);});});}function getEndUser(_0x3380f7,_0x40a261,_0x48c60,_0x1451d2,_0x4e6443){return function(_0x1fcde8){logger[_0xae61('0x11')]('['+[_0x3380f7[_0xae61('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x1fcde8);return new Promise(function(_0x1612b9,_0x1a9be5){var _0x2dae0f={'method':_0xae61('0xc'),'uri':_0x48c60+_0xae61('0x29')+_0x1fcde8['endUserNumber']+'&'+_0x1451d2+'&'+_0x4e6443,'auth':_0x40a261,'json':!![]};return rp(_0x2dae0f)[_0xae61('0x1b')](function(_0x3c14dc){if(_0x3c14dc[_0xae61('0xf')][_0xae61('0x1c')]>0x0){_0x1fcde8[_0xae61('0x28')]=_0x3c14dc[_0xae61('0xf')][0x0][_0xae61('0x10')];logger[_0xae61('0x11')]('['+[_0x3380f7[_0xae61('0x12')]()]+_0xae61('0x2a'),_0x1fcde8);_0x1612b9(_0x1fcde8);}else{return createEndUser(_0x3380f7,_0x40a261,_0x1fcde8,_0x48c60,_0x1451d2)[_0xae61('0x1b')](function(_0x4bb4ce){logger['info']('['+[_0x3380f7[_0xae61('0x12')]()]+_0xae61('0x2b'),_0x4bb4ce);_0x1612b9(_0x4bb4ce);});}})[_0xae61('0x14')](function(_0x24c7dd){logger['error']('['+[_0x3380f7[_0xae61('0x12')]()]+']',_0x24c7dd[_0xae61('0x16')]);_0x1a9be5(_0x24c7dd['message']);});});};}function getCustomFields(_0x3ceaa6,_0x32eb49){var _0x4e3072={};if(_0x3ceaa6[_0xae61('0x1c')]>0x0){_[_0xae61('0x2c')](_0x3ceaa6,function(_0x466b40){if(_[_0xae61('0x2d')]([_0xae61('0x2e'),_0xae61('0x2f')],_0x466b40[_0xae61('0x30')])&&_0x466b40[_0xae61('0x31')]&&!_0x466b40['customField']){_0x4e3072[_0x466b40[_0xae61('0x31')]['toLowerCase']()]=_0x466b40[_0xae61('0x32')][_0xae61('0x33')]();}else if(_[_0xae61('0x2d')]([_0xae61('0x2e'),_0xae61('0x2f')],_0x466b40[_0xae61('0x30')])&&_0x466b40[_0xae61('0x34')]&&_0x466b40['customField']){_0x4e3072[_0x466b40[_0xae61('0x34')]['toLowerCase']()]=_0x466b40[_0xae61('0x32')][_0xae61('0x33')]();}else if(_0x466b40[_0xae61('0x30')]===_0xae61('0x35')&&_0x466b40['variableName']&&_0x466b40[_0xae61('0x34')]&&_0x466b40[_0xae61('0x36')]){_0x4e3072[_0x466b40[_0xae61('0x34')][_0xae61('0x37')]()]=_0x32eb49[_0x466b40[_0xae61('0x38')]]['toString']();}else if(_0x466b40['type']==='customVariable'&&_0x466b40['Variable']&&_0x466b40[_0xae61('0x39')][_0xae61('0x3a')]&&_0x466b40[_0xae61('0x34')]&&_0x466b40[_0xae61('0x36')]){_0x4e3072[_0x466b40[_0xae61('0x34')][_0xae61('0x37')]()]=_0x32eb49[_0x466b40['Variable'][_0xae61('0x3a')]['toLowerCase']()]['toString']();}});}return _0x4e3072;}function getTicket(_0x99e039,_0x21ee19,_0x34321b,_0x218fd9,_0x302b13,_0x2ed67a){return function(_0x3ed1c6){logger['info']('['+[_0x99e039[_0xae61('0x12')]()]+_0xae61('0x3b'),_0x3ed1c6);return new Promise(function(_0x3abb59,_0x4b6cdd){var _0x3b6d42=_0x99e039[_0xae61('0x37')]()==='outbound'?_0x3ed1c6[_0xae61('0x1f')]:_0x3ed1c6[_0xae61('0x28')];var _0x344f5a={'method':_0xae61('0x24'),'uri':_0x34321b+_0xae61('0x3c')+'?'+_0x2ed67a,'body':Object[_0xae61('0x3d')]({},{'active':_0xae61('0x1e'),'caller_id':_0x3b6d42,'assigned_to':_0x3ed1c6[_0xae61('0x1f')],'short_description':intUtil[_0xae61('0x3e')](_0x218fd9[_0xae61('0x3f')],_0x302b13,'\x20'),'description':intUtil[_0xae61('0x3e')](_0x218fd9['Descriptions'],_0x302b13,'\x0a')},getCustomFields(_0x218fd9[_0xae61('0x40')],_0x302b13)),'auth':_0x21ee19,'json':!![]};return rp(_0x344f5a)[_0xae61('0x1b')](function(_0x194f2f){logger['info']('['+[_0x99e039[_0xae61('0x12')]()]+_0xae61('0x41'),_0x194f2f[_0xae61('0xf')]);_0x3ed1c6[_0xae61('0x42')]=_0x194f2f[_0xae61('0xf')][_0xae61('0x10')];_0x3ed1c6[_0xae61('0x43')]=_0x194f2f[_0xae61('0xf')]['number'];logger[_0xae61('0x11')]('['+[_0x99e039['toUpperCase']()]+_0xae61('0x44'),_0x3ed1c6);_0x3abb59(_0x3ed1c6);})[_0xae61('0x14')](function(_0x425547){logger[_0xae61('0x15')]('['+[_0x99e039[_0xae61('0x12')]()]+']',_0x425547[_0xae61('0x16')]);_0x4b6cdd(_0x425547['message']);});});};}function createRemoteTag(_0x5bad7e,_0x4ee519,_0x14ec84,_0x528d61){return new Promise(function(_0x3ce46b,_0x4ba61f){var _0x3839a5={'method':'POST','uri':_0x14ec84+_0xae61('0x45')+'?'+_0x528d61,'body':{'short_description':_0x5bad7e,'global':!![],'active':!![],'name':_0x5bad7e},'auth':_0x4ee519,'json':!![]};return rp(_0x3839a5)[_0xae61('0x1b')](function(_0x39223e){var _0xa5cd67=_0x39223e[_0xae61('0xf')][_0xae61('0x10')];_0x3ce46b(_0xa5cd67);});});}function getRemoteTag(_0x49adf1,_0x268791,_0x5218f,_0x43db08,_0x276092){return new Promise(function(_0x3e88dc,_0x2639e7){var _0x229fc1={'method':_0xae61('0xc'),'uri':_0x5218f+'label'+_0xae61('0x46')+_0x49adf1+'&'+_0x43db08,'auth':_0x268791,'json':!![]};return rp(_0x229fc1)['then'](function(_0x15c77d){if(_0x15c77d[_0xae61('0xf')][_0xae61('0x1c')]>0x0){var _0x5b777b=_0x15c77d['result'][0x0][_0xae61('0x10')];_0x3e88dc(_0x5b777b);}else{return createRemoteTag(_0x49adf1,_0x268791,_0x5218f,_0x43db08)[_0xae61('0x1b')](function(_0x125fdd){_0x3e88dc(_0x125fdd);});}});});}function assignTagToIncident(_0x3ddea9,_0x259479,_0x1d6120,_0x53f6df,_0x14efd1){return new Promise(function(_0x5e72ae,_0x3587f7){var _0x56f783={'method':_0xae61('0x24'),'uri':_0x1d6120+_0xae61('0x47')+'?'+_0x14efd1,'body':{'label':_0x3ddea9,'table':_0xae61('0x3c'),'id_type':_0xae61('0x48'),'table_key':_0x53f6df[_0xae61('0x42')],'title':_0xae61('0x49')+_0x53f6df[_0xae61('0x43')],'id_display':_0x53f6df[_0xae61('0x43')]},'auth':_0x259479,'json':!![]};return rp(_0x56f783)[_0xae61('0x1b')](function(_0x3db758){_0x5e72ae();})[_0xae61('0x14')](function(){_0x5e72ae();});});}function manageTags(_0xfcc2f2,_0x3b41d1,_0x25ec0c,_0x530324,_0xdfd002,_0x8131f1,_0x483585){return new Promise(function(_0x113e9d,_0x2d4959){var _0x40aea3=[];_0x3b41d1[_0xae61('0x2c')](function(_0x4a9d17){_0x40aea3['push'](getRemoteTag(_0x4a9d17,_0x25ec0c,_0x530324,_0x8131f1,_0x483585));});return Promise[_0xae61('0x4a')](_0x40aea3)[_0xae61('0x1b')](function(_0x158149){if(_0x158149[_0xae61('0x1c')]){logger[_0xae61('0x11')]('['+[_0xfcc2f2[_0xae61('0x12')]()]+_0xae61('0x4b'),_0x158149);var _0x140017=[];_0x158149['forEach'](function(_0x3bea24){_0x140017['push'](assignTagToIncident(_0x3bea24,_0x25ec0c,_0x530324,_0xdfd002,_0x8131f1));});return Promise[_0xae61('0x4a')](_0x140017)[_0xae61('0x1b')](function(){_0x113e9d();})[_0xae61('0x14')](function(){_0x113e9d();});}else{_0x113e9d();}});});}function getTags(_0x2c9f30,_0x23acc0,_0x198076,_0x308360,_0x3bd1f1,_0x31d1c9){return function(_0xd79496){return new Promise(function(_0x1bfd66,_0x2225e2){var _0x1b157b=[];var _0x4e9d6b=_0x308360['Tags'];if(_0x4e9d6b&&_0x4e9d6b['length']>0x0){_0x1b157b=_[_0xae61('0x4c')](_0x4e9d6b,'name');}if(_0x1b157b[_0xae61('0x1c')]>0x0){return manageTags(_0x2c9f30,_0x1b157b,_0x23acc0,_0x198076,_0xd79496,_0x3bd1f1,_0x31d1c9)[_0xae61('0x1b')](function(){_0x1bfd66(_0xd79496);});}else{_0x1bfd66(_0xd79496);}});};}function emit(_0x748889,_0x1321fc,_0x33a15a){var _0x4ea5b6=_0xae61('0x4d')+_0xae61('0x4e')+_0xae61('0x4f')+'%255EORDERBYDESCnumber';var _0x1ad67d={'uri':_0x748889+_0xae61('0x50')+_0x33a15a+_0x4ea5b6};io['to'](util['format'](_0xae61('0x51'),_0x1321fc))['emit'](_0xae61('0x52'),_0x1ad67d);}exports['cs']=function(_0x3293a0,_0x43ebc3,_0x49f9d4,_0x2a0c2d,_0x3bb77b,_0x394b54,_0x48fc54,_0x32e67a){var _0x50a287={};var _0x3e52d1={'user':_0x394b54[_0xae61('0x53')],'pass':_0x394b54[_0xae61('0x54')]};var _0x672603=_0xae61('0x55');var _0xa9bd57=_0xae61('0x56');_0x394b54['remoteUri']=intUtil['stripTrailingSlash'](_0x394b54[_0xae61('0x57')]);_0x394b54[_0xae61('0x58')]=intUtil['stripTrailingSlash'](_0x394b54[_0xae61('0x58')]);var _0x2b3c27=util['format'](_0xae61('0x59'),_0x394b54[_0xae61('0x57')]);_0x50a287[_0xae61('0x19')]=!_[_0xae61('0x5a')](_0x2a0c2d)?_0x2a0c2d[_0xae61('0x5b')]:null;_0x50a287[_0xae61('0x20')]=_0x394b54['email'];_0x50a287['endUserNumber']=_0x32e67a['toLowerCase']()==='outbound'?_0x43ebc3[_0xae61('0x5c')]:_0x43ebc3[_0xae61('0x5d')];_0x50a287[_0xae61('0x5e')]=_0x32e67a==='queue'||_0x32e67a===_0xae61('0x5f')?_0xae61('0x60'):_0xae61('0x61');var _0x1fce5c=util[_0xae61('0x62')](_0xae61('0x63'),_0x394b54[_0xae61('0x58')],_0x43ebc3[_0xae61('0x64')],md5(_0x43ebc3['uniqueid']));if(_0x3bb77b&&_0x3bb77b['monitor_format']){logger[_0xae61('0x11')](_0xae61('0x65'),_0xae61('0x66'));_0x43ebc3[_0xae61('0x67')]=_0x1fce5c;}else if(_0x48fc54&&_0x48fc54[_0xae61('0x68')]&&_0x48fc54['recordingFormat']!==_0xae61('0x69')){logger[_0xae61('0x11')]('[OUTBOUND]',_0xae61('0x66'));_0x43ebc3[_0xae61('0x67')]=_0x1fce5c;}else{_0x43ebc3[_0xae61('0x67')]='';}return getAdminUser(_0x32e67a,_0x3e52d1,_0x50a287,_0x2b3c27,_0xa9bd57,_0x672603)[_0xae61('0x1b')](getUser(_0x32e67a,_0x3e52d1,_0x2b3c27,_0xa9bd57,_0x672603))[_0xae61('0x1b')](getEndUser(_0x32e67a,_0x3e52d1,_0x2b3c27,_0xa9bd57,_0x672603))[_0xae61('0x1b')](getTicket(_0x32e67a,_0x3e52d1,_0x2b3c27,_0x49f9d4,_0x43ebc3,_0xa9bd57))[_0xae61('0x1b')](function(_0x33cb32){logger[_0xae61('0x11')](util[_0xae61('0x62')](_0xae61('0x6a'),_0x33cb32[_0xae61('0x42')]));logger[_0xae61('0x11')](util[_0xae61('0x62')](_0xae61('0x6b'),_0x32e67a));if(_0x32e67a!==_0xae61('0x5f')){logger[_0xae61('0x11')]('['+[_0x32e67a[_0xae61('0x12')]()]+']',_0xae61('0x6c'));emit(_0x394b54[_0xae61('0x57')],_0x2a0c2d[_0xae61('0x3a')],_0x33cb32['ticketId']);}})[_0xae61('0x14')](function(_0x10e4f7){logger[_0xae61('0x15')]('['+[_0x32e67a['toUpperCase']()]+_0xae61('0x6d'),util[_0xae61('0x6e')](_0x10e4f7,{'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 1c42dd1..dbe835c 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 _0x1c03=['variableName','push','set_entry','JSON','Calls','apiKey','toString','base64','get_server_info','stringify','Getting\x20agent\x20with\x20name','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','value','info','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','idField','custom_fields','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','Outbound','trigger:browser:url','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridnum','Ticket\x20created!','lodash','md5','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','emit','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','replace','duration_hours','Contacts','parent_name','name','direction','length','forEach'];(function(_0x44c974,_0x1bcfde){var _0x5214c6=function(_0x10aad5){while(--_0x10aad5){_0x44c974['push'](_0x44c974['shift']());}};_0x5214c6(++_0x1bcfde);}(_0x1c03,0x148));var _0x31c0=function(_0x566168,_0x4c39af){_0x566168=_0x566168-0x0;var _0x4e1f7a=_0x1c03[_0x566168];return _0x4e1f7a;};'use strict';var _=require(_0x31c0('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x31c0('0x1'));var util=require('util');var Redis=require(_0x31c0('0x2'));var intUtil=require(_0x31c0('0x3'));var config=require(_0x31c0('0x4'));var logger=require('../../../../config/logger')('sugarcrm');config[_0x31c0('0x5')]=_[_0x31c0('0x6')](config[_0x31c0('0x5')],{'host':_0x31c0('0x7'),'port':0x18eb});var io=require(_0x31c0('0x8'))(new Redis(config[_0x31c0('0x5')]));var def={'method':_0x31c0('0x9'),'json':!![]};function emit(_0x5124f4,_0x35285f,_0x221b99){io['to'](_0x5124f4)[_0x31c0('0xa')](_0x35285f,_0x221b99);}function getTicket(_0x69e32a,_0x2ada45,_0x4dca85,_0xa2ee19,_0xd5c078,_0x2f3611,_0x25a24e,_0x409005){logger['info']('Creating\x20new\x20ticket...');var _0x416b0b=new Date();var _0x3180cc=[{'name':'name','value':intUtil[_0x31c0('0xb')](_0xa2ee19[_0x31c0('0xc')],_0xd5c078,'\x20')},{'name':_0x31c0('0xd'),'value':_0x2ada45['id']},{'name':_0x31c0('0xe'),'value':_0x2ada45['id']},{'name':_0x31c0('0xf'),'value':intUtil[_0x31c0('0xb')](_0xa2ee19[_0x31c0('0x10')],_0xd5c078,'\x0a')},{'name':_0x31c0('0x11'),'value':_0x416b0b['toISOString']()['slice'](0x0,0x13)[_0x31c0('0x12')]('T','\x20')},{'name':_0x31c0('0x13'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x4dca85['id']},{'name':'parent_type','value':_0x31c0('0x14')},{'name':_0x31c0('0x15'),'value':_0x4dca85[_0x31c0('0x16')]},{'name':_0x31c0('0x17'),'value':_0x409005}];if(_0x2f3611[_0x31c0('0x18')]){_[_0x31c0('0x19')](_0x2f3611,function(_0x59668e){if(_0xd5c078[_0x59668e[_0x31c0('0x1a')]]){_0x3180cc[_0x31c0('0x1b')]({'name':_0x59668e['idField'],'value':_0xd5c078[_0x59668e[_0x31c0('0x1a')]]});}});}return request({'form':{'method':_0x31c0('0x1c'),'input_type':_0x31c0('0x1d'),'response_type':_0x31c0('0x1d'),'rest_data':JSON['stringify']({'session':_0x25a24e['id'],'module_name':_0x31c0('0x1e'),'name_value_list':_0x3180cc})}});}function getAuth(_0x15aa22){return util['format']('Basic\x20%s',new Buffer(_0x15aa22[_0x31c0('0x1f')]+':X')[_0x31c0('0x20')](_0x31c0('0x21')));}function getServerInfo(_0x3e18a9){return request({'form':{'method':_0x31c0('0x22'),'input_type':_0x31c0('0x1d'),'response_type':'JSON','rest_data':JSON[_0x31c0('0x23')]({'session':_0x3e18a9['id']})}});}function getUser(_0x265128,_0x34f320,_0xca323c){if(!_['isNil'](_0x34f320)){logger['info'](_0x31c0('0x24'),_0x34f320);return request({'form':{'method':'get_entry_list','input_type':_0x31c0('0x1d'),'response_type':_0x31c0('0x1d'),'rest_data':JSON[_0x31c0('0x23')]({'session':_0xca323c['id'],'module_name':'Employees','query':util[_0x31c0('0x25')](_0x31c0('0x26'),_0x34f320),'order_by':'','offset':'0','select_fields':['id','name',_0x31c0('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x31c0('0x28')](function(_0x50d5e2){if(_0x50d5e2['entry_list'][_0x31c0('0x18')]){var _0x4c0245=_[_0x31c0('0x29')](_0x50d5e2[_0x31c0('0x2a')],function(_0x183d31){return _0x183d31[_0x31c0('0x2b')][_0x31c0('0x27')][_0x31c0('0x2c')]===_0x34f320;});if(_0x4c0245){logger[_0x31c0('0x2d')](_0x31c0('0x2e'));return BPromise[_0x31c0('0x2f')]({'id':_0x4c0245[_0x31c0('0x2b')]['id'][_0x31c0('0x2c')],'name':_0x4c0245[_0x31c0('0x2b')][_0x31c0('0x16')][_0x31c0('0x2c')]});}}logger[_0x31c0('0x2d')](_0x31c0('0x30'));return BPromise[_0x31c0('0x2f')]({'id':_0xca323c[_0x31c0('0x2b')][_0x31c0('0x31')][_0x31c0('0x2c')],'name':_0xca323c[_0x31c0('0x2b')][_0x31c0('0x27')][_0x31c0('0x2c')]});});}else{logger[_0x31c0('0x2d')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x31c0('0x2f')]({'id':_0xca323c['name_value_list'][_0x31c0('0x31')][_0x31c0('0x2c')],'name':_0xca323c['name_value_list'][_0x31c0('0x27')]['value']});}}function getEndUser(_0x1089c9,_0x77acf6,_0x45dd5f,_0x341134){logger[_0x31c0('0x2d')]('Searching\x20enduser\x20with\x20phone',_0x45dd5f);return request({'form':{'method':_0x31c0('0x32'),'input_type':_0x31c0('0x1d'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x341134['id'],'module_name':'Contacts','query':util[_0x31c0('0x25')](_0x31c0('0x33'),_0x45dd5f),'order_by':'','offset':'0','select_fields':['id',_0x31c0('0x16'),_0x31c0('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x576e8a){if(_0x576e8a[_0x31c0('0x2a')][_0x31c0('0x18')]){var _0x130f40=_[_0x31c0('0x29')](_0x576e8a[_0x31c0('0x2a')],function(_0x50a20){return _0x50a20[_0x31c0('0x2b')]['phone_home']['value']===_0x45dd5f;});if(_0x130f40){logger['info'](_0x31c0('0x35'));return BPromise[_0x31c0('0x2f')]({'id':_0x130f40[_0x31c0('0x2b')]['id'][_0x31c0('0x2c')],'name':_0x130f40['name_value_list']['name'][_0x31c0('0x2c')],'phone':_0x130f40[_0x31c0('0x2b')]['phone_home']['value']});}}else{logger['info'](_0x31c0('0x36'));return request({'form':{'method':'set_entry','input_type':_0x31c0('0x1d'),'response_type':_0x31c0('0x1d'),'rest_data':JSON[_0x31c0('0x23')]({'session':_0x341134['id'],'module_name':_0x31c0('0x14'),'name_value_list':[{'name':'first_name','value':_0x77acf6!==_0x31c0('0x37')?_0x77acf6:util[_0x31c0('0x25')](_0x31c0('0x38'),_0x45dd5f)},{'name':'phone_home','value':_0x45dd5f}]})}})['then'](function(_0x62f5ee){logger[_0x31c0('0x2d')](_0x31c0('0x39'));return BPromise[_0x31c0('0x2f')]({'id':_0x62f5ee['id'],'name':_0x62f5ee[_0x31c0('0x2a')][_0x31c0('0x3a')][_0x31c0('0x2c')],'phone':_0x62f5ee['entry_list'][_0x31c0('0x34')][_0x31c0('0x2c')]});});}});}function request(_0x267d86){logger[_0x31c0('0x3b')](_0x31c0('0x3c'),JSON[_0x31c0('0x23')](_0x267d86));return rp(_[_0x31c0('0x3d')](def,_0x267d86));}function getTags(_0x431353,_0x30c327){var _0x241a08=[];if(_0x431353&&_0x431353[_0x31c0('0x18')]>0x0){_0x241a08=_[_0x31c0('0x3e')](_0x431353,_0x30c327);}return _0x241a08;}function getCustomFields(_0x4970b2,_0x49c205){var _0x505815=[];var _0x1babd7={'custom_fields':[]};if(_0x4970b2[_0x31c0('0x18')]>0x0){_['forEach'](_0x4970b2,function(_0x23dda6){if(_0x23dda6[_0x31c0('0x3f')]===_0x31c0('0x40')&&_0x23dda6[_0x31c0('0x41')]&&!_0x23dda6[_0x31c0('0x42')]){_0x1babd7[_0x23dda6[_0x31c0('0x41')][_0x31c0('0x43')]()]=_0x23dda6[_0x31c0('0x44')][_0x31c0('0x20')]();}else if(_0x23dda6[_0x31c0('0x3f')]===_0x31c0('0x40')&&_0x23dda6[_0x31c0('0x45')]&&_0x23dda6['customField']){_0x1babd7[_0x31c0('0x46')][_0x31c0('0x1b')]({'id':_0x23dda6['idField'],'value':_0x23dda6[_0x31c0('0x44')][_0x31c0('0x20')]()});}else if(_0x23dda6[_0x31c0('0x3f')]==='variable'&&_0x23dda6[_0x31c0('0x1a')]&&_0x23dda6[_0x31c0('0x45')]&&_0x23dda6[_0x31c0('0x42')]){_0x49c205[_0x23dda6['variableName']]&&_0x1babd7[_0x31c0('0x46')][_0x31c0('0x1b')]({'id':_0x23dda6[_0x31c0('0x45')],'value':_0x49c205[_0x23dda6['variableName']][_0x31c0('0x20')]()});}else if(_0x23dda6[_0x31c0('0x3f')]===_0x31c0('0x47')&&_0x23dda6['Variable']&&_0x23dda6[_0x31c0('0x48')][_0x31c0('0x16')]&&_0x23dda6['idField']&&_0x23dda6['customField']){_0x49c205[_0x23dda6['Variable']['name'][_0x31c0('0x43')]()]&&_0x1babd7['custom_fields'][_0x31c0('0x1b')]({'id':_0x23dda6[_0x31c0('0x45')],'value':_0x49c205[_0x23dda6[_0x31c0('0x48')][_0x31c0('0x16')][_0x31c0('0x43')]()][_0x31c0('0x20')]()});}});}return _0x1babd7;}function getConnection(_0x5dfb1d){return request({'method':_0x31c0('0x9'),'form':{'method':'login','input_type':_0x31c0('0x1d'),'response_type':_0x31c0('0x1d'),'rest_data':JSON[_0x31c0('0x23')]({'user_auth':{'user_name':_0x5dfb1d[_0x31c0('0x49')],'password':_0x5dfb1d[_0x31c0('0x4a')],'encryption':_0x31c0('0x4b')},'application':_0x31c0('0x4c')})}})[_0x31c0('0x28')](function(_0x541b90){var _0x5a6b06=_0x541b90;if(_0x5a6b06['id']){def[_0x31c0('0x4d')]=_0x5a6b06['id'];return BPromise['resolve'](_0x5a6b06);}else{throw new Error(util['format'](_0x31c0('0x4e'),_0x5dfb1d['id']));}});}function setRelationship(_0x2aeec1,_0x2b82ae,_0x220c4a,_0x2c8867){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x31c0('0x23')]({'session':_0x2aeec1['id'],'module_name':'Calls','module_id':_0x220c4a['id'],'link_field_name':_0x2c8867,'related_ids':[_0x2b82ae['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x31c0('0x4f')]=function(_0x5ad1d6,_0x5d87b2,_0x3c0cce,_0x2e9fe0,_0x57f36c,_0x3d783f){var _0x2922a5,_0x2eae1a,_0x35d889,_0x45c2c4;_0x3d783f[_0x31c0('0x50')]=intUtil[_0x31c0('0x51')](_0x3d783f[_0x31c0('0x50')]);_0x3d783f[_0x31c0('0x52')]=intUtil[_0x31c0('0x51')](_0x3d783f[_0x31c0('0x52')]);def[_0x31c0('0x53')]=util[_0x31c0('0x25')](_0x31c0('0x54'),_0x3d783f[_0x31c0('0x50')]);if(_0x57f36c&&_0x57f36c[_0x31c0('0x55')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5d87b2[_0x31c0('0x56')]=util[_0x31c0('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3d783f[_0x31c0('0x52')],_0x5d87b2['uniqueid'],md5(_0x5d87b2[_0x31c0('0x57')]));}else{_0x5d87b2[_0x31c0('0x56')]='';}return getConnection(_0x3d783f)[_0x31c0('0x28')](function(_0x33ea09){_0x45c2c4=_0x33ea09;return getUser(_0x3d783f,_0x2e9fe0['name'],_0x45c2c4);})['then'](function(_0x1ae1c9){_0x2922a5=_0x1ae1c9;logger[_0x31c0('0x2d')](_0x31c0('0x58'),_0x2922a5['id']);return getEndUser(_0x3d783f,_0x5d87b2[_0x31c0('0x59')],_0x5d87b2['calleridnum'],_0x45c2c4);})[_0x31c0('0x28')](function(_0x5034aa){_0x2eae1a=_0x5034aa;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2eae1a['id']);return getTicket(_0x3d783f,_0x2922a5,_0x2eae1a,_0x3c0cce,_0x5d87b2,_0x3c0cce['Fields'],_0x45c2c4,_0x31c0('0x5a'));})['then'](function(_0xcb50e0){_0x35d889=_0xcb50e0;logger[_0x31c0('0x2d')]('Ticket\x20created!');logger[_0x31c0('0x2d')](_0x31c0('0x5b'),_0x35d889['id']);return setRelationship(_0x45c2c4,_0x2922a5,_0x35d889,_0x31c0('0x5c'));})[_0x31c0('0x28')](function(){return setRelationship(_0x45c2c4,_0x2eae1a,_0x35d889,_0x31c0('0x5d'));})[_0x31c0('0x28')](function(){return getServerInfo(_0x45c2c4);})[_0x31c0('0x28')](function(_0x218fa2){var _0x27c84c=parseInt(_0x218fa2[_0x31c0('0x5e')]['charAt'](0x0));var _0x35625e=util[_0x31c0('0x25')](_0x31c0('0x5f'),_0x3d783f['remoteUri'],_0x35d889['id']);if(_0x27c84c>0x6){_0x35625e=util[_0x31c0('0x25')](_0x31c0('0x60'),_0x3d783f[_0x31c0('0x50')],_0x35d889['id']);}logger[_0x31c0('0x2d')](_0x31c0('0x61'),_0x31c0('0x62'));emit(util[_0x31c0('0x25')](_0x31c0('0x63'),_0x2e9fe0[_0x31c0('0x16')]),'trigger:browser:url',{'uri':_0x35625e});})[_0x31c0('0x64')](function(_0x43b27d){logger[_0x31c0('0x65')](_0x31c0('0x61'),JSON['stringify'](_0x43b27d));});};exports[_0x31c0('0x66')]=function(_0x5ae807,_0x14714f,_0x1250bc,_0x2a6bed,_0x25b7ea,_0x4b07bd,_0x1cdcad){var _0x378849,_0x29dd53,_0x5149e0,_0xcf95d3;_0x4b07bd[_0x31c0('0x50')]=intUtil[_0x31c0('0x51')](_0x4b07bd['remoteUri']);_0x4b07bd['serverUrl']=intUtil['stripTrailingSlash'](_0x4b07bd[_0x31c0('0x52')]);def[_0x31c0('0x53')]=util['format'](_0x31c0('0x54'),_0x4b07bd['remoteUri']);if(_0x1cdcad&&_0x1cdcad[_0x31c0('0x67')]&&_0x1cdcad[_0x31c0('0x67')]!==_0x31c0('0x68')){logger[_0x31c0('0x2d')](_0x31c0('0x69'),_0x31c0('0x6a'));_0x14714f[_0x31c0('0x56')]=util[_0x31c0('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4b07bd['serverUrl'],_0x14714f[_0x31c0('0x57')],md5(_0x14714f['uniqueid']));}return getConnection(_0x4b07bd)['then'](function(_0x39075b){_0xcf95d3=_0x39075b;return getUser(_0x4b07bd,_0x2a6bed[_0x31c0('0x16')],_0xcf95d3);})[_0x31c0('0x28')](function(_0x23eccf){_0x378849=_0x23eccf;logger[_0x31c0('0x2d')](_0x31c0('0x58'),_0x378849['id']);return getEndUser(_0x4b07bd,_0x14714f[_0x31c0('0x6b')],_0x14714f['destcalleridnum'],_0xcf95d3);})[_0x31c0('0x28')](function(_0x1b65cb){_0x29dd53=_0x1b65cb;logger['info'](_0x31c0('0x6c'),_0x29dd53['id']);return getTicket(_0x4b07bd,_0x378849,_0x29dd53,_0x1250bc,_0x14714f,_0x1250bc[_0x31c0('0x6d')],_0xcf95d3,_0x31c0('0x6e'));})[_0x31c0('0x28')](function(_0x1db7ad){_0x5149e0=_0x1db7ad;logger[_0x31c0('0x2d')]('Ticket\x20created!');logger[_0x31c0('0x2d')](_0x31c0('0x5b'),_0x5149e0['id']);return setRelationship(_0xcf95d3,_0x378849,_0x5149e0,'users');})[_0x31c0('0x28')](function(){return setRelationship(_0xcf95d3,_0x29dd53,_0x5149e0,_0x31c0('0x5d'));})[_0x31c0('0x28')](function(){return getServerInfo(_0xcf95d3);})[_0x31c0('0x28')](function(_0x3efb6b){var _0x5a4d9d=parseInt(_0x3efb6b['version']['charAt'](0x0));var _0x3846a3=util[_0x31c0('0x25')](_0x31c0('0x5f'),_0x4b07bd['remoteUri'],_0x5149e0['id']);if(_0x5a4d9d>0x6){_0x3846a3=util[_0x31c0('0x25')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4b07bd[_0x31c0('0x50')],_0x5149e0['id']);}logger[_0x31c0('0x2d')](_0x31c0('0x69'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x31c0('0x25')]('user:%s',_0x2a6bed['name']),_0x31c0('0x6f'),{'uri':_0x3846a3});})[_0x31c0('0x64')](function(_0x972942){logger[_0x31c0('0x65')]('[OUTBOUND]',JSON['stringify'](_0x972942));});};exports[_0x31c0('0x70')]=function(_0x3aaf61,_0x384b43,_0x5c60f5,_0xa6ccfd,_0x9d058c,_0x1ef96b){var _0x13fb36,_0x48424d,_0x270000,_0x4eb660;_0x1ef96b[_0x31c0('0x50')]=intUtil['stripTrailingSlash'](_0x1ef96b['remoteUri']);_0x1ef96b[_0x31c0('0x52')]=intUtil[_0x31c0('0x51')](_0x1ef96b['serverUrl']);def['uri']=util[_0x31c0('0x25')](_0x31c0('0x54'),_0x1ef96b[_0x31c0('0x50')]);if(_0x9d058c&&_0x9d058c[_0x31c0('0x55')]){logger[_0x31c0('0x2d')]('['+_0x384b43[_0x31c0('0x71')][_0x31c0('0x72')]()+']',_0x31c0('0x6a'));_0x384b43[_0x31c0('0x56')]=util['format'](_0x31c0('0x73'),_0x1ef96b[_0x31c0('0x52')],_0x384b43[_0x31c0('0x57')],md5(_0x384b43['uniqueid']));}else{_0x384b43[_0x31c0('0x56')]='';}return getConnection(_0x1ef96b)[_0x31c0('0x28')](function(_0x74ea06){_0x4eb660=_0x74ea06;if(!_['isNil'](_0xa6ccfd)){return getUser(_0x1ef96b,_0xa6ccfd[_0x31c0('0x16')],_0x4eb660);}else{return getUser(_0x1ef96b,null,_0x4eb660);}})[_0x31c0('0x28')](function(_0x271737){_0x13fb36=_0x271737;logger['info'](_0x31c0('0x58'),_0x13fb36['id']);return getEndUser(_0x1ef96b,_0x384b43[_0x31c0('0x59')],_0x384b43[_0x31c0('0x74')],_0x4eb660);})['then'](function(_0x2e2572){_0x48424d=_0x2e2572;logger['info'](_0x31c0('0x6c'),_0x48424d['id']);return getTicket(_0x1ef96b,_0x13fb36,_0x48424d,_0x5c60f5,_0x384b43,_0x5c60f5[_0x31c0('0x6d')],_0x4eb660,_0x31c0('0x5a'));})[_0x31c0('0x28')](function(_0x475c2d){_0x270000=_0x475c2d;logger[_0x31c0('0x2d')](_0x31c0('0x75'));logger[_0x31c0('0x2d')](_0x31c0('0x5b'),_0x270000['id']);return setRelationship(_0x4eb660,_0x13fb36,_0x270000,_0x31c0('0x5c'));})[_0x31c0('0x28')](function(){return setRelationship(_0x4eb660,_0x48424d,_0x270000,'contacts');})[_0x31c0('0x28')](function(){return getServerInfo(_0x4eb660);})[_0x31c0('0x64')](function(_0x26a963){logger['error']('['+_0x384b43[_0x31c0('0x71')][_0x31c0('0x72')]()+']',JSON[_0x31c0('0x23')](_0x26a963));});}; \ No newline at end of file +var _0xbb46=['lastevent','toUpperCase','Inbound','The\x20Ticket\x20ID\x20is:','lodash','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','POST','emit','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','length','forEach','variableName','push','idField','set_entry','JSON','Calls','format','apiKey','base64','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Searching\x20enduser\x20with\x20phone','stringify','contacts.phone_home\x20=\x20\x22%s\x22','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','toString','custom_fields','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','users','contacts','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','remoteUri','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Ticket\x20created!','version','user:%s','unmanaged'];(function(_0x4b9a46,_0x4812bb){var _0x3a7334=function(_0x3a3336){while(--_0x3a3336){_0x4b9a46['push'](_0x4b9a46['shift']());}};_0x3a7334(++_0x4812bb);}(_0xbb46,0x7d));var _0x6bb4=function(_0xe16628,_0x1723b5){_0xe16628=_0xe16628-0x0;var _0x3f6924=_0xbb46[_0xe16628];return _0x3f6924;};'use strict';var _=require(_0x6bb4('0x0'));var rp=require(_0x6bb4('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x6bb4('0x2'));var Redis=require(_0x6bb4('0x3'));var intUtil=require('./util');var config=require(_0x6bb4('0x4'));var logger=require(_0x6bb4('0x5'))(_0x6bb4('0x6'));config[_0x6bb4('0x7')]=_[_0x6bb4('0x8')](config[_0x6bb4('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6bb4('0x7')]));var def={'method':_0x6bb4('0x9'),'json':!![]};function emit(_0x13d748,_0x1758f1,_0x470502){io['to'](_0x13d748)[_0x6bb4('0xa')](_0x1758f1,_0x470502);}function getTicket(_0x2d699f,_0x2fa09c,_0x51c55e,_0x3e5304,_0x55cfe4,_0x261e1f,_0x1b4bf9,_0xdacf02){logger['info'](_0x6bb4('0xb'));var _0x3489ff=new Date();var _0x2e6fe=[{'name':'name','value':intUtil[_0x6bb4('0xc')](_0x3e5304[_0x6bb4('0xd')],_0x55cfe4,'\x20')},{'name':_0x6bb4('0xe'),'value':_0x2fa09c['id']},{'name':_0x6bb4('0xf'),'value':_0x2fa09c['id']},{'name':_0x6bb4('0x10'),'value':intUtil[_0x6bb4('0xc')](_0x3e5304[_0x6bb4('0x11')],_0x55cfe4,'\x0a')},{'name':_0x6bb4('0x12'),'value':_0x3489ff['toISOString']()[_0x6bb4('0x13')](0x0,0x13)[_0x6bb4('0x14')]('T','\x20')},{'name':_0x6bb4('0x15'),'value':'0'},{'name':_0x6bb4('0x16'),'value':'15'},{'name':_0x6bb4('0x17'),'value':_0x51c55e['id']},{'name':_0x6bb4('0x18'),'value':_0x6bb4('0x19')},{'name':_0x6bb4('0x1a'),'value':_0x51c55e[_0x6bb4('0x1b')]},{'name':_0x6bb4('0x1c'),'value':_0xdacf02}];if(_0x261e1f[_0x6bb4('0x1d')]){_[_0x6bb4('0x1e')](_0x261e1f,function(_0xf80502){if(_0x55cfe4[_0xf80502[_0x6bb4('0x1f')]]){_0x2e6fe[_0x6bb4('0x20')]({'name':_0xf80502[_0x6bb4('0x21')],'value':_0x55cfe4[_0xf80502['variableName']]});}});}return request({'form':{'method':_0x6bb4('0x22'),'input_type':'JSON','response_type':_0x6bb4('0x23'),'rest_data':JSON['stringify']({'session':_0x1b4bf9['id'],'module_name':_0x6bb4('0x24'),'name_value_list':_0x2e6fe})}});}function getAuth(_0x59fe97){return util[_0x6bb4('0x25')]('Basic\x20%s',new Buffer(_0x59fe97[_0x6bb4('0x26')]+':X')['toString'](_0x6bb4('0x27')));}function getServerInfo(_0x314c2a){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x6bb4('0x23'),'rest_data':JSON['stringify']({'session':_0x314c2a['id']})}});}function getUser(_0x348b94,_0x3260be,_0x39523c){if(!_[_0x6bb4('0x28')](_0x3260be)){logger[_0x6bb4('0x29')](_0x6bb4('0x2a'),_0x3260be);return request({'form':{'method':_0x6bb4('0x2b'),'input_type':_0x6bb4('0x23'),'response_type':_0x6bb4('0x23'),'rest_data':JSON['stringify']({'session':_0x39523c['id'],'module_name':_0x6bb4('0x2c'),'query':util[_0x6bb4('0x25')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x3260be),'order_by':'','offset':'0','select_fields':['id',_0x6bb4('0x1b'),_0x6bb4('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6bb4('0x2e')](function(_0x22be94){if(_0x22be94[_0x6bb4('0x2f')]['length']){var _0x3e200d=_[_0x6bb4('0x30')](_0x22be94[_0x6bb4('0x2f')],function(_0x509da5){return _0x509da5[_0x6bb4('0x31')]['user_name'][_0x6bb4('0x32')]===_0x3260be;});if(_0x3e200d){logger['info'](_0x6bb4('0x33'));return BPromise[_0x6bb4('0x34')]({'id':_0x3e200d[_0x6bb4('0x31')]['id'][_0x6bb4('0x32')],'name':_0x3e200d['name_value_list'][_0x6bb4('0x1b')][_0x6bb4('0x32')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x6bb4('0x34')]({'id':_0x39523c[_0x6bb4('0x31')][_0x6bb4('0x35')][_0x6bb4('0x32')],'name':_0x39523c[_0x6bb4('0x31')]['user_name'][_0x6bb4('0x32')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x39523c[_0x6bb4('0x31')]['user_id'][_0x6bb4('0x32')],'name':_0x39523c[_0x6bb4('0x31')][_0x6bb4('0x2d')][_0x6bb4('0x32')]});}}function getEndUser(_0x5f407d,_0x565656,_0x34d5c2,_0xd9063e){logger[_0x6bb4('0x29')](_0x6bb4('0x36'),_0x34d5c2);return request({'form':{'method':_0x6bb4('0x2b'),'input_type':_0x6bb4('0x23'),'response_type':'JSON','rest_data':JSON[_0x6bb4('0x37')]({'session':_0xd9063e['id'],'module_name':_0x6bb4('0x19'),'query':util['format'](_0x6bb4('0x38'),_0x34d5c2),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6bb4('0x2e')](function(_0x12904d){if(_0x12904d[_0x6bb4('0x2f')][_0x6bb4('0x1d')]){var _0x2b9e35=_[_0x6bb4('0x30')](_0x12904d[_0x6bb4('0x2f')],function(_0x4e767f){return _0x4e767f[_0x6bb4('0x31')]['phone_home'][_0x6bb4('0x32')]===_0x34d5c2;});if(_0x2b9e35){logger[_0x6bb4('0x29')](_0x6bb4('0x39'));return BPromise[_0x6bb4('0x34')]({'id':_0x2b9e35[_0x6bb4('0x31')]['id'][_0x6bb4('0x32')],'name':_0x2b9e35[_0x6bb4('0x31')][_0x6bb4('0x1b')][_0x6bb4('0x32')],'phone':_0x2b9e35[_0x6bb4('0x31')][_0x6bb4('0x3a')][_0x6bb4('0x32')]});}}else{logger[_0x6bb4('0x29')](_0x6bb4('0x3b'));return request({'form':{'method':_0x6bb4('0x22'),'input_type':_0x6bb4('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0xd9063e['id'],'module_name':_0x6bb4('0x19'),'name_value_list':[{'name':_0x6bb4('0x3c'),'value':_0x565656!==''?_0x565656:util[_0x6bb4('0x25')](_0x6bb4('0x3d'),_0x34d5c2)},{'name':_0x6bb4('0x3a'),'value':_0x34d5c2}]})}})[_0x6bb4('0x2e')](function(_0x1acd76){logger[_0x6bb4('0x29')]('Enduser\x20created.');return BPromise[_0x6bb4('0x34')]({'id':_0x1acd76['id'],'name':_0x1acd76['entry_list'][_0x6bb4('0x3c')][_0x6bb4('0x32')],'phone':_0x1acd76[_0x6bb4('0x2f')][_0x6bb4('0x3a')][_0x6bb4('0x32')]});});}});}function request(_0x4c04a8){logger['debug'](_0x6bb4('0x3e'),JSON[_0x6bb4('0x37')](_0x4c04a8));return rp(_[_0x6bb4('0x3f')](def,_0x4c04a8));}function getTags(_0xa17813,_0x508c3f){var _0x207dc0=[];if(_0xa17813&&_0xa17813[_0x6bb4('0x1d')]>0x0){_0x207dc0=_[_0x6bb4('0x40')](_0xa17813,_0x508c3f);}return _0x207dc0;}function getCustomFields(_0x53c93a,_0x4f581a){var _0x2959b4=[];var _0x2de3ea={'custom_fields':[]};if(_0x53c93a[_0x6bb4('0x1d')]>0x0){_[_0x6bb4('0x1e')](_0x53c93a,function(_0x566629){if(_0x566629[_0x6bb4('0x41')]===_0x6bb4('0x42')&&_0x566629[_0x6bb4('0x43')]&&!_0x566629[_0x6bb4('0x44')]){_0x2de3ea[_0x566629[_0x6bb4('0x43')][_0x6bb4('0x45')]()]=_0x566629[_0x6bb4('0x46')][_0x6bb4('0x47')]();}else if(_0x566629[_0x6bb4('0x41')]===_0x6bb4('0x42')&&_0x566629['idField']&&_0x566629[_0x6bb4('0x44')]){_0x2de3ea[_0x6bb4('0x48')][_0x6bb4('0x20')]({'id':_0x566629[_0x6bb4('0x21')],'value':_0x566629[_0x6bb4('0x46')]['toString']()});}else if(_0x566629[_0x6bb4('0x41')]===_0x6bb4('0x49')&&_0x566629[_0x6bb4('0x1f')]&&_0x566629[_0x6bb4('0x21')]&&_0x566629[_0x6bb4('0x44')]){_0x4f581a[_0x566629[_0x6bb4('0x1f')]]&&_0x2de3ea[_0x6bb4('0x48')]['push']({'id':_0x566629[_0x6bb4('0x21')],'value':_0x4f581a[_0x566629['variableName']][_0x6bb4('0x47')]()});}else if(_0x566629[_0x6bb4('0x41')]===_0x6bb4('0x4a')&&_0x566629['Variable']&&_0x566629['Variable'][_0x6bb4('0x1b')]&&_0x566629[_0x6bb4('0x21')]&&_0x566629['customField']){_0x4f581a[_0x566629[_0x6bb4('0x4b')]['name'][_0x6bb4('0x45')]()]&&_0x2de3ea[_0x6bb4('0x48')][_0x6bb4('0x20')]({'id':_0x566629['idField'],'value':_0x4f581a[_0x566629[_0x6bb4('0x4b')]['name'][_0x6bb4('0x45')]()][_0x6bb4('0x47')]()});}});}return _0x2de3ea;}function getConnection(_0x30a34b){return request({'method':_0x6bb4('0x9'),'form':{'method':_0x6bb4('0x4c'),'input_type':_0x6bb4('0x23'),'response_type':_0x6bb4('0x23'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x30a34b[_0x6bb4('0x4d')],'password':_0x30a34b[_0x6bb4('0x4e')],'encryption':_0x6bb4('0x4f')},'application':_0x6bb4('0x50')})}})[_0x6bb4('0x2e')](function(_0x3b209c){var _0x3b9c24=_0x3b209c;if(_0x3b9c24['id']){def[_0x6bb4('0x51')]=_0x3b9c24['id'];return BPromise[_0x6bb4('0x34')](_0x3b9c24);}else{throw new Error(util[_0x6bb4('0x25')](_0x6bb4('0x52'),_0x30a34b['id']));}});}function setRelationship(_0xb2d2fd,_0x1f4ea8,_0x1cf505,_0x5f3b2c){return request({'form':{'method':_0x6bb4('0x53'),'input_type':_0x6bb4('0x23'),'response_type':_0x6bb4('0x23'),'rest_data':JSON[_0x6bb4('0x37')]({'session':_0xb2d2fd['id'],'module_name':_0x6bb4('0x24'),'module_id':_0x1cf505['id'],'link_field_name':_0x5f3b2c,'related_ids':[_0x1f4ea8['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x6bb4('0x54')]=function(_0x51c9fa,_0x35f519,_0x2cfd0a,_0x27eeed,_0x532e4e,_0x211d15){var _0x38d9a0,_0x587767,_0x39db39,_0x56fb81;_0x211d15['remoteUri']=intUtil[_0x6bb4('0x55')](_0x211d15['remoteUri']);_0x211d15['serverUrl']=intUtil['stripTrailingSlash'](_0x211d15[_0x6bb4('0x56')]);def['uri']=util[_0x6bb4('0x25')](_0x6bb4('0x57'),_0x211d15['remoteUri']);if(_0x532e4e&&_0x532e4e[_0x6bb4('0x58')]){logger[_0x6bb4('0x29')](_0x6bb4('0x59'),_0x6bb4('0x5a'));_0x35f519[_0x6bb4('0x5b')]=util[_0x6bb4('0x25')](_0x6bb4('0x5c'),_0x211d15[_0x6bb4('0x56')],_0x35f519['uniqueid'],md5(_0x35f519[_0x6bb4('0x5d')]));}else{_0x35f519[_0x6bb4('0x5b')]='';}return getConnection(_0x211d15)[_0x6bb4('0x2e')](function(_0x542058){_0x56fb81=_0x542058;return getUser(_0x211d15,_0x27eeed[_0x6bb4('0x1b')],_0x56fb81);})['then'](function(_0x2bda3c){_0x38d9a0=_0x2bda3c;logger[_0x6bb4('0x29')](_0x6bb4('0x5e'),_0x38d9a0['id']);return getEndUser(_0x211d15,_0x35f519[_0x6bb4('0x5f')],_0x35f519[_0x6bb4('0x60')],_0x56fb81);})['then'](function(_0x3f625c){_0x587767=_0x3f625c;logger['info'](_0x6bb4('0x61'),_0x587767['id']);return getTicket(_0x211d15,_0x38d9a0,_0x587767,_0x2cfd0a,_0x35f519,_0x2cfd0a[_0x6bb4('0x62')],_0x56fb81,'Inbound');})[_0x6bb4('0x2e')](function(_0xc604d2){_0x39db39=_0xc604d2;logger['info']('Ticket\x20created!');logger[_0x6bb4('0x29')]('The\x20Ticket\x20ID\x20is:',_0x39db39['id']);return setRelationship(_0x56fb81,_0x38d9a0,_0x39db39,_0x6bb4('0x63'));})[_0x6bb4('0x2e')](function(){return setRelationship(_0x56fb81,_0x587767,_0x39db39,_0x6bb4('0x64'));})[_0x6bb4('0x2e')](function(){return getServerInfo(_0x56fb81);})['then'](function(_0x111ea0){var _0x1232a4=parseInt(_0x111ea0['version'][_0x6bb4('0x65')](0x0));var _0x3929e2=util[_0x6bb4('0x25')](_0x6bb4('0x66'),_0x211d15['remoteUri'],_0x39db39['id']);if(_0x1232a4>0x6){_0x3929e2=util['format'](_0x6bb4('0x67'),_0x211d15[_0x6bb4('0x68')],_0x39db39['id']);}logger['info']('[QUEUE]',_0x6bb4('0x69'));emit(util['format']('user:%s',_0x27eeed[_0x6bb4('0x1b')]),_0x6bb4('0x6a'),{'uri':_0x3929e2});})['catch'](function(_0x13a5e1){logger[_0x6bb4('0x6b')](_0x6bb4('0x59'),JSON[_0x6bb4('0x37')](_0x13a5e1));});};exports['outbound']=function(_0x463636,_0x504df3,_0x6c8bf8,_0x538465,_0x5a7bde,_0x33f7a1,_0x52cc97){var _0x43ac1d,_0x84c8ba,_0x2eb8c0,_0x12daf7;_0x33f7a1[_0x6bb4('0x68')]=intUtil[_0x6bb4('0x55')](_0x33f7a1[_0x6bb4('0x68')]);_0x33f7a1['serverUrl']=intUtil[_0x6bb4('0x55')](_0x33f7a1[_0x6bb4('0x56')]);def['uri']=util[_0x6bb4('0x25')](_0x6bb4('0x57'),_0x33f7a1['remoteUri']);if(_0x52cc97&&_0x52cc97[_0x6bb4('0x6c')]&&_0x52cc97[_0x6bb4('0x6c')]!==_0x6bb4('0x6d')){logger[_0x6bb4('0x29')](_0x6bb4('0x6e'),_0x6bb4('0x5a'));_0x504df3[_0x6bb4('0x5b')]=util['format'](_0x6bb4('0x5c'),_0x33f7a1['serverUrl'],_0x504df3[_0x6bb4('0x5d')],md5(_0x504df3[_0x6bb4('0x5d')]));}return getConnection(_0x33f7a1)[_0x6bb4('0x2e')](function(_0x3d68a5){_0x12daf7=_0x3d68a5;return getUser(_0x33f7a1,_0x538465[_0x6bb4('0x1b')],_0x12daf7);})[_0x6bb4('0x2e')](function(_0x59e02a){_0x43ac1d=_0x59e02a;logger[_0x6bb4('0x29')](_0x6bb4('0x5e'),_0x43ac1d['id']);return getEndUser(_0x33f7a1,_0x504df3[_0x6bb4('0x6f')],_0x504df3[_0x6bb4('0x70')],_0x12daf7);})[_0x6bb4('0x2e')](function(_0x4480da){_0x84c8ba=_0x4480da;logger[_0x6bb4('0x29')](_0x6bb4('0x61'),_0x84c8ba['id']);return getTicket(_0x33f7a1,_0x43ac1d,_0x84c8ba,_0x6c8bf8,_0x504df3,_0x6c8bf8['Fields'],_0x12daf7,'Outbound');})['then'](function(_0x2c2124){_0x2eb8c0=_0x2c2124;logger[_0x6bb4('0x29')](_0x6bb4('0x71'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2eb8c0['id']);return setRelationship(_0x12daf7,_0x43ac1d,_0x2eb8c0,'users');})['then'](function(){return setRelationship(_0x12daf7,_0x84c8ba,_0x2eb8c0,'contacts');})['then'](function(){return getServerInfo(_0x12daf7);})['then'](function(_0x11462b){var _0xdc7880=parseInt(_0x11462b[_0x6bb4('0x72')][_0x6bb4('0x65')](0x0));var _0x5a9ba8=util[_0x6bb4('0x25')](_0x6bb4('0x66'),_0x33f7a1[_0x6bb4('0x68')],_0x2eb8c0['id']);if(_0xdc7880>0x6){_0x5a9ba8=util[_0x6bb4('0x25')](_0x6bb4('0x67'),_0x33f7a1['remoteUri'],_0x2eb8c0['id']);}logger['info'](_0x6bb4('0x6e'),_0x6bb4('0x69'));emit(util['format'](_0x6bb4('0x73'),_0x538465['name']),'trigger:browser:url',{'uri':_0x5a9ba8});})['catch'](function(_0x6c286d){logger[_0x6bb4('0x6b')]('[OUTBOUND]',JSON[_0x6bb4('0x37')](_0x6c286d));});};exports[_0x6bb4('0x74')]=function(_0x4fd71d,_0x51bb91,_0x57794f,_0x5de1b8,_0x3e3d3f,_0x983f34){var _0x5f35f3,_0x499f3d,_0x16342a,_0x49dc76;_0x983f34['remoteUri']=intUtil[_0x6bb4('0x55')](_0x983f34[_0x6bb4('0x68')]);_0x983f34['serverUrl']=intUtil[_0x6bb4('0x55')](_0x983f34[_0x6bb4('0x56')]);def['uri']=util[_0x6bb4('0x25')]('%s/service/v4_1/rest.php',_0x983f34[_0x6bb4('0x68')]);if(_0x3e3d3f&&_0x3e3d3f[_0x6bb4('0x58')]){logger['info']('['+_0x51bb91[_0x6bb4('0x75')][_0x6bb4('0x76')]()+']',_0x6bb4('0x5a'));_0x51bb91[_0x6bb4('0x5b')]=util['format'](_0x6bb4('0x5c'),_0x983f34[_0x6bb4('0x56')],_0x51bb91[_0x6bb4('0x5d')],md5(_0x51bb91['uniqueid']));}else{_0x51bb91[_0x6bb4('0x5b')]='';}return getConnection(_0x983f34)[_0x6bb4('0x2e')](function(_0x5761db){_0x49dc76=_0x5761db;if(!_['isNil'](_0x5de1b8)){return getUser(_0x983f34,_0x5de1b8[_0x6bb4('0x1b')],_0x49dc76);}else{return getUser(_0x983f34,null,_0x49dc76);}})['then'](function(_0x46aded){_0x5f35f3=_0x46aded;logger[_0x6bb4('0x29')]('The\x20User\x20ID\x20is:',_0x5f35f3['id']);return getEndUser(_0x983f34,_0x51bb91[_0x6bb4('0x5f')],_0x51bb91[_0x6bb4('0x60')],_0x49dc76);})[_0x6bb4('0x2e')](function(_0x238d37){_0x499f3d=_0x238d37;logger['info'](_0x6bb4('0x61'),_0x499f3d['id']);return getTicket(_0x983f34,_0x5f35f3,_0x499f3d,_0x57794f,_0x51bb91,_0x57794f['Fields'],_0x49dc76,_0x6bb4('0x77'));})[_0x6bb4('0x2e')](function(_0x3351cf){_0x16342a=_0x3351cf;logger[_0x6bb4('0x29')]('Ticket\x20created!');logger[_0x6bb4('0x29')](_0x6bb4('0x78'),_0x16342a['id']);return setRelationship(_0x49dc76,_0x5f35f3,_0x16342a,'users');})[_0x6bb4('0x2e')](function(){return setRelationship(_0x49dc76,_0x499f3d,_0x16342a,_0x6bb4('0x64'));})['then'](function(){return getServerInfo(_0x49dc76);})['catch'](function(_0x441347){logger[_0x6bb4('0x6b')]('['+_0x51bb91[_0x6bb4('0x75')]['toUpperCase']()+']',JSON[_0x6bb4('0x37')](_0x441347));});}; \ 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 d959e17..67dfd9b 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 _0x04da=['variable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','lodash','sortBy','length','string','push','content','type','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x04da,0xfb));var _0xa04d=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0x04da[_0x285800];return _0x4b809e;};'use strict';var _=require(_0xa04d('0x0'));var util=require('util');exports['getString']=function(_0xba235a,_0x5ddeb8,_0x369968){var _0x2ca775=[];if(_0xba235a['length']>0x0){var _0x2c6ce9=_[_0xa04d('0x1')](_0xba235a,['id']);for(var _0x2934c6=0x0;_0x2934c6<_0x2c6ce9[_0xa04d('0x2')];_0x2934c6++){var _0x3d9d08=_0x2c6ce9[_0x2934c6];if(_0x3d9d08['type']===_0xa04d('0x3')){_0x2ca775[_0xa04d('0x4')](_0x3d9d08[_0xa04d('0x5')]);}else if(_0x3d9d08[_0xa04d('0x6')]==='variable'&&_0x3d9d08[_0xa04d('0x7')]){_0x5ddeb8[_0x3d9d08['variableName']]&&_0x2ca775[_0xa04d('0x4')](_0x5ddeb8[_0x3d9d08[_0xa04d('0x7')]][_0xa04d('0x8')]());}else if(_0x3d9d08[_0xa04d('0x6')]===_0xa04d('0x9')&&_0x3d9d08[_0xa04d('0xa')]&&_0x3d9d08[_0xa04d('0xa')][_0xa04d('0xb')]){_0x5ddeb8[_0x3d9d08[_0xa04d('0xa')][_0xa04d('0xb')][_0xa04d('0xc')]()]&&_0x2ca775[_0xa04d('0x4')](_0x5ddeb8[_0x3d9d08[_0xa04d('0xa')][_0xa04d('0xb')][_0xa04d('0xc')]()][_0xa04d('0x8')]());}else if(_0x3d9d08[_0xa04d('0x6')]===_0xa04d('0xd')){if(_0x3d9d08[_0xa04d('0xe')]==='string'&&_0x3d9d08[_0xa04d('0xf')]){_0x2ca775[_0xa04d('0x4')](util[_0xa04d('0x10')](_0xa04d('0x11'),_0x3d9d08[_0xa04d('0xf')],_0x3d9d08[_0xa04d('0x12')]));}else if(_0x3d9d08[_0xa04d('0xe')]===_0xa04d('0x13')&&_0x3d9d08['variableName']&&_0x3d9d08[_0xa04d('0xf')]){_0x5ddeb8[_0x3d9d08[_0xa04d('0x7')]]&&_0x2ca775[_0xa04d('0x4')](util[_0xa04d('0x10')](_0xa04d('0x11'),_0x3d9d08[_0xa04d('0xf')],_0x5ddeb8[_0x3d9d08[_0xa04d('0x7')]]));}else if(_0x3d9d08[_0xa04d('0xe')]===_0xa04d('0x9')&&_0x3d9d08[_0xa04d('0xa')]&&_0x3d9d08[_0xa04d('0xa')][_0xa04d('0xb')]&&_0x3d9d08[_0xa04d('0xf')]){_0x5ddeb8[_0x3d9d08[_0xa04d('0xa')]['name']['toLowerCase']()]&&_0x2ca775[_0xa04d('0x4')](util[_0xa04d('0x10')](_0xa04d('0x11'),_0x3d9d08['key'],_0x5ddeb8[_0x3d9d08[_0xa04d('0xa')][_0xa04d('0xb')][_0xa04d('0xc')]()]));}}}}return _0x2ca775[_0xa04d('0x14')](_0x369968);};exports[_0xa04d('0x15')]=function(_0x36abf1){var _0x129060=_0x36abf1[_0xa04d('0x16')](-0x1);if(_0x129060==='/'){_0x36abf1=_0x36abf1[_0xa04d('0x17')](0x0,_0x36abf1[_0xa04d('0x18')](_0x129060));}return _0x36abf1;};exports[_0xa04d('0x19')]=function(_0x1e7d08){if(!_[_0xa04d('0x1a')](_0x1e7d08)&&_0x1e7d08!==''){var _0x45aaf5=/^(([^<>()\[\]\\.,;:\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 _0x45aaf5['test'](String(_0x1e7d08)[_0xa04d('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x249e=['substring','isNil','test','lodash','util','getString','length','sortBy','type','push','content','variable','variableName','toString','customVariable','Variable','name','keyValue','keyType','string','key','keyContent','format','%s:\x20%s','toLowerCase','join','stripTrailingSlash','slice'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x249e,0xff));var _0xe249=function(_0x28738a,_0x478aa2){_0x28738a=_0x28738a-0x0;var _0x315475=_0x249e[_0x28738a];return _0x315475;};'use strict';var _=require(_0xe249('0x0'));var util=require(_0xe249('0x1'));exports[_0xe249('0x2')]=function(_0x3a129f,_0x71c3c5,_0x37cb94){var _0x2d2132=[];if(_0x3a129f[_0xe249('0x3')]>0x0){var _0x523336=_[_0xe249('0x4')](_0x3a129f,['id']);for(var _0x2d6a54=0x0;_0x2d6a54<_0x523336[_0xe249('0x3')];_0x2d6a54++){var _0x4d7ba9=_0x523336[_0x2d6a54];if(_0x4d7ba9[_0xe249('0x5')]==='string'){_0x2d2132[_0xe249('0x6')](_0x4d7ba9[_0xe249('0x7')]);}else if(_0x4d7ba9[_0xe249('0x5')]===_0xe249('0x8')&&_0x4d7ba9[_0xe249('0x9')]){_0x71c3c5[_0x4d7ba9['variableName']]&&_0x2d2132[_0xe249('0x6')](_0x71c3c5[_0x4d7ba9[_0xe249('0x9')]][_0xe249('0xa')]());}else if(_0x4d7ba9[_0xe249('0x5')]===_0xe249('0xb')&&_0x4d7ba9[_0xe249('0xc')]&&_0x4d7ba9[_0xe249('0xc')][_0xe249('0xd')]){_0x71c3c5[_0x4d7ba9[_0xe249('0xc')][_0xe249('0xd')]['toLowerCase']()]&&_0x2d2132['push'](_0x71c3c5[_0x4d7ba9[_0xe249('0xc')][_0xe249('0xd')]['toLowerCase']()][_0xe249('0xa')]());}else if(_0x4d7ba9[_0xe249('0x5')]===_0xe249('0xe')){if(_0x4d7ba9[_0xe249('0xf')]===_0xe249('0x10')&&_0x4d7ba9['key']){_0x2d2132[_0xe249('0x6')](util['format']('%s:\x20%s',_0x4d7ba9[_0xe249('0x11')],_0x4d7ba9[_0xe249('0x12')]));}else if(_0x4d7ba9[_0xe249('0xf')]==='variable'&&_0x4d7ba9[_0xe249('0x9')]&&_0x4d7ba9[_0xe249('0x11')]){_0x71c3c5[_0x4d7ba9[_0xe249('0x9')]]&&_0x2d2132[_0xe249('0x6')](util[_0xe249('0x13')](_0xe249('0x14'),_0x4d7ba9[_0xe249('0x11')],_0x71c3c5[_0x4d7ba9[_0xe249('0x9')]]));}else if(_0x4d7ba9[_0xe249('0xf')]===_0xe249('0xb')&&_0x4d7ba9[_0xe249('0xc')]&&_0x4d7ba9[_0xe249('0xc')]['name']&&_0x4d7ba9[_0xe249('0x11')]){_0x71c3c5[_0x4d7ba9[_0xe249('0xc')][_0xe249('0xd')][_0xe249('0x15')]()]&&_0x2d2132[_0xe249('0x6')](util[_0xe249('0x13')](_0xe249('0x14'),_0x4d7ba9[_0xe249('0x11')],_0x71c3c5[_0x4d7ba9[_0xe249('0xc')][_0xe249('0xd')][_0xe249('0x15')]()]));}}}}return _0x2d2132[_0xe249('0x16')](_0x37cb94);};exports[_0xe249('0x17')]=function(_0x2fbe8d){var _0x182a01=_0x2fbe8d[_0xe249('0x18')](-0x1);if(_0x182a01==='/'){_0x2fbe8d=_0x2fbe8d[_0xe249('0x19')](0x0,_0x2fbe8d['lastIndexOf'](_0x182a01));}return _0x2fbe8d;};exports['validateEmail']=function(_0x5a5416){if(!_[_0xe249('0x1a')](_0x5a5416)&&_0x5a5416!==''){var _0x456bb2=/^(([^<>()\[\]\\.,;:\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 _0x456bb2[_0xe249('0x1b')](String(_0x5a5416)['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 bd287f1..d9f7788 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x5a1d97,_0x265b5a){var _0x401646=function(_0x4dd898){while(--_0x4dd898){_0x5a1d97['push'](_0x5a1d97['shift']());}};_0x401646(++_0x265b5a);}(_0xe706,0xa3));var _0x6e70=function(_0x4f3021,_0x15bf04){_0x4f3021=_0x4f3021-0x0;var _0xd62bcd=_0xe706[_0x4f3021];return _0xd62bcd;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('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;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ 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 d320709..726ed4e 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 _0x2dfb=['map','forEach','string','picklist','nameField','customField','toLowerCase','content','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','The\x20Enduser\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','[OUTBOUND]','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','The\x20Ticket\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','./util','../../../../config/environment','zendesk','redis','localhost','emit','application/json','info','format','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','%s/search.json','length','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','password','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','defaults','GET'];(function(_0x7790bd,_0x19b9e6){var _0x4e6960=function(_0x5c0d5f){while(--_0x5c0d5f){_0x7790bd['push'](_0x7790bd['shift']());}};_0x4e6960(++_0x19b9e6);}(_0x2dfb,0x107));var _0xb2df=function(_0x2e52e3,_0x200273){_0x2e52e3=_0x2e52e3-0x0;var _0x562cf3=_0x2dfb[_0x2e52e3];return _0x562cf3;};'use strict';var _=require(_0xb2df('0x0'));var rp=require(_0xb2df('0x1'));var md5=require('md5');var util=require(_0xb2df('0x2'));var Redis=require(_0xb2df('0x3'));var intUtil=require(_0xb2df('0x4'));var config=require(_0xb2df('0x5'));var logger=require('../../../../config/logger')(_0xb2df('0x6'));config[_0xb2df('0x7')]=_['defaults'](config['redis'],{'host':_0xb2df('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0xa27253,_0x4d162d,_0x2aa560){io['to'](_0xa27253)[_0xb2df('0x9')](_0x4d162d,_0x2aa560);}var headers={'Content-Type':_0xb2df('0xa'),'Accept':_0xb2df('0xa')};function getTicket(_0x154c7d,_0x3dc4af,_0x5b0867,_0x589e63,_0x1c7705){logger[_0xb2df('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xb2df('0xc')]('%s/tickets.json',_0x154c7d[_0xb2df('0xd')]),'method':_0xb2df('0xe'),'body':{'ticket':_[_0xb2df('0xf')]({'requester_id':_0x5b0867['id'],'submitter_id':_0x3dc4af?_0x3dc4af['id']:undefined,'assignee_id':_0x3dc4af?_0x3dc4af['id']:undefined,'tags':getTags(_0x589e63[_0xb2df('0x10')],_0xb2df('0x11')),'subject':intUtil[_0xb2df('0x12')](_0x589e63[_0xb2df('0x13')],_0x1c7705,'\x20'),'description':intUtil[_0xb2df('0x12')](_0x589e63[_0xb2df('0x14')],_0x1c7705,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb2df('0x12')](_0x589e63[_0xb2df('0x14')],_0x1c7705,'\x0a')}},getCustomFields(_0x589e63[_0xb2df('0x15')],_0x1c7705))}})[_0xb2df('0x16')](function(_0x10a8bc){logger[_0xb2df('0xb')]('Ticket\x20created!');return _0x10a8bc['ticket'];});}function getUser(_0x49b800,_0x42ded5){if(intUtil['validateEmail'](_0x42ded5)){logger[_0xb2df('0xb')](_0xb2df('0x17'),_0x42ded5);return request({'uri':util['format']('%s/search.json',_0x49b800[_0xb2df('0xd')]),'qs':{'query':util['format'](_0xb2df('0x18'),_0x42ded5)}})[_0xb2df('0x16')](function(_0x3adede){if(_0x3adede['count']){logger[_0xb2df('0xb')](_0xb2df('0x19'));return _[_0xb2df('0x1a')](_0x3adede[_0xb2df('0x1b')],{'email':_0x42ded5,'role':_0xb2df('0x1c')});}else{logger[_0xb2df('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xb2df('0xc')]('%s/users/me.json',_0x49b800[_0xb2df('0xd')])})[_0xb2df('0x16')](function(_0x19683d){logger[_0xb2df('0xb')]('Admin\x20account\x20selected.');return _0x19683d[_0xb2df('0x1d')];});}});}else{logger[_0xb2df('0xb')](_0xb2df('0x1e'));return request({'uri':util[_0xb2df('0xc')](_0xb2df('0x1f'),_0x49b800[_0xb2df('0xd')])})[_0xb2df('0x16')](function(_0xf34a85){logger['info']('Admin\x20account\x20selected.');return _0xf34a85[_0xb2df('0x1d')];});}}function getEndUser(_0x25f3f3,_0x3a7532,_0x2d1468){logger[_0xb2df('0xb')]('Searching\x20enduser\x20with\x20phone',_0x2d1468);return request({'uri':util[_0xb2df('0xc')](_0xb2df('0x20'),_0x25f3f3[_0xb2df('0xd')]),'qs':{'query':util[_0xb2df('0xc')]('type:user\x20role:end-user\x20phone:%s',_0x2d1468)}})[_0xb2df('0x16')](function(_0x48c593){var _0x36a15e;if(_0x48c593[_0xb2df('0x1b')][_0xb2df('0x21')]){_0x48c593[_0xb2df('0x1b')]=_['filter'](_0x48c593['results'],{'suspended':![],'role':_0xb2df('0x22')});if(_0x48c593['results'][_0xb2df('0x21')]){_0x36a15e=_[_0xb2df('0x23')](_0x48c593['results']);}}if(_0x36a15e){logger[_0xb2df('0xb')]('Enduser\x20found!');return _0x36a15e;}else{logger[_0xb2df('0xb')](_0xb2df('0x24'));return request({'uri':util[_0xb2df('0xc')](_0xb2df('0x25'),_0x25f3f3[_0xb2df('0xd')]),'method':_0xb2df('0xe'),'body':{'user':{'role':_0xb2df('0x22'),'name':util['format']('Caller\x20-\x20%s',_0x3a7532||_0x2d1468),'phone':_0x2d1468}}})[_0xb2df('0x16')](function(_0x39d33a){logger['info'](_0xb2df('0x26'));return _0x39d33a[_0xb2df('0x1d')];});}});}function getAuth(_0x5b6a50){var _0x29319d;if(_0x5b6a50[_0xb2df('0x27')]===_0xb2df('0x28')){_0x29319d=util[_0xb2df('0xc')]('%s:%s',_0x5b6a50['username'],_0x5b6a50[_0xb2df('0x28')]);}else if(_0x5b6a50[_0xb2df('0x27')]===_0xb2df('0x29')){_0x29319d=util[_0xb2df('0xc')](_0xb2df('0x2a'),_0x5b6a50[_0xb2df('0x2b')],_0x5b6a50['token']);}return util['format'](_0xb2df('0x2c'),new Buffer(_0x29319d)[_0xb2df('0x2d')](_0xb2df('0x2e')));}function request(_0xd678c9){logger[_0xb2df('0x2f')](_0xb2df('0x30'),JSON[_0xb2df('0x31')](_0xd678c9));return rp(_[_0xb2df('0x32')](_0xd678c9,{'method':_0xb2df('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x5192fa,_0x5e67c2){var _0x2241c6=[];if(_0x5192fa&&_0x5192fa[_0xb2df('0x21')]>0x0){_0x2241c6=_[_0xb2df('0x34')](_0x5192fa,_0x5e67c2);}return _0x2241c6;}function getCustomFields(_0x491f00,_0x5b8c04){var _0x1986d5=[];var _0x1b4d76={'custom_fields':[]};if(_0x491f00[_0xb2df('0x21')]>0x0){_[_0xb2df('0x35')](_0x491f00,function(_0x564e33){if(_['includes']([_0xb2df('0x36'),_0xb2df('0x37')],_0x564e33['type'])&&_0x564e33[_0xb2df('0x38')]&&!_0x564e33[_0xb2df('0x39')]){_0x1b4d76[_0x564e33['nameField'][_0xb2df('0x3a')]()]=_0x564e33[_0xb2df('0x3b')][_0xb2df('0x2d')]();}else if(_['includes']([_0xb2df('0x36'),_0xb2df('0x37')],_0x564e33[_0xb2df('0x3c')])&&_0x564e33[_0xb2df('0x3d')]&&_0x564e33[_0xb2df('0x39')]){_0x1b4d76[_0xb2df('0x3e')][_0xb2df('0x3f')]({'id':_0x564e33[_0xb2df('0x3d')],'value':_0x564e33['content']['toString']()});}else if(_0x564e33['type']===_0xb2df('0x40')&&_0x564e33[_0xb2df('0x41')]&&_0x564e33[_0xb2df('0x3d')]&&_0x564e33[_0xb2df('0x39')]){_0x5b8c04[_0x564e33[_0xb2df('0x41')]]&&_0x1b4d76[_0xb2df('0x3e')][_0xb2df('0x3f')]({'id':_0x564e33[_0xb2df('0x3d')],'value':_0x5b8c04[_0x564e33[_0xb2df('0x41')]][_0xb2df('0x2d')]()});}else if(_0x564e33['type']===_0xb2df('0x42')&&_0x564e33[_0xb2df('0x43')]&&_0x564e33[_0xb2df('0x43')][_0xb2df('0x11')]&&_0x564e33[_0xb2df('0x3d')]&&_0x564e33[_0xb2df('0x39')]){_0x5b8c04[_0x564e33[_0xb2df('0x43')]['name'][_0xb2df('0x3a')]()]&&_0x1b4d76[_0xb2df('0x3e')]['push']({'id':_0x564e33[_0xb2df('0x3d')],'value':_0x5b8c04[_0x564e33[_0xb2df('0x43')]['name'][_0xb2df('0x3a')]()][_0xb2df('0x2d')]()});}});}return _0x1b4d76;}exports[_0xb2df('0x44')]=function(_0x1c1a16,_0x331a05,_0x2526eb,_0x1e7312,_0x12bb36,_0x19b21a){var _0x3a209b,_0x3819d6;_0x19b21a['remoteUri']=intUtil[_0xb2df('0x45')](_0x19b21a[_0xb2df('0xd')]);_0x19b21a[_0xb2df('0x46')]=intUtil[_0xb2df('0x45')](_0x19b21a[_0xb2df('0x46')]);if(_0x12bb36&&_0x12bb36['monitor_format']){logger[_0xb2df('0xb')](_0xb2df('0x47'),'Recording\x20is\x20enabled!');_0x331a05['recordingURL']=util[_0xb2df('0xc')](_0xb2df('0x48'),_0x19b21a[_0xb2df('0x46')],_0x331a05[_0xb2df('0x49')],md5(_0x331a05[_0xb2df('0x49')]));}else{_0x331a05['recordingURL']='';}headers[_0xb2df('0x4a')]=getAuth(_0x19b21a);return getUser(_0x19b21a,_0x1e7312[_0xb2df('0x4b')])[_0xb2df('0x16')](function(_0x269a96){_0x3a209b=_0x269a96;logger[_0xb2df('0xb')]('The\x20User\x20ID\x20is:',_0x3a209b['id']);return getEndUser(_0x19b21a,_0x331a05[_0xb2df('0x4c')],_0x331a05['calleridnum']);})[_0xb2df('0x16')](function(_0x398235){_0x3819d6=_0x398235;logger[_0xb2df('0xb')](_0xb2df('0x4d'),_0x3819d6['id']);return getTicket(_0x19b21a,_0x3a209b,_0x3819d6,_0x2526eb,_0x331a05);})[_0xb2df('0x16')](function(_0x11161a){if(_0x11161a){logger['info']('The\x20Ticket\x20ID\x20is:',_0x11161a['id']);switch(_0x19b21a[_0xb2df('0x3c')]){case _0xb2df('0x4e'):logger['info'](_0xb2df('0x47'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xb2df('0xc')](_0xb2df('0x4f'),_0x19b21a[_0xb2df('0xd')],_0x3a209b['id'],_0x11161a['id']),'method':_0xb2df('0xe')});case'newTab':logger['info'](_0xb2df('0x47'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb2df('0x50'),_0x1e7312['name']),_0xb2df('0x51'),{'uri':util[_0xb2df('0xc')](_0xb2df('0x52'),_0x19b21a[_0xb2df('0xd')][_0xb2df('0x53')](_0xb2df('0x54'),''),_0x11161a['id'])});break;default:logger[_0xb2df('0x55')](_0xb2df('0x47'),_0xb2df('0x56'));}}})[_0xb2df('0x57')](function(_0x587603){logger[_0xb2df('0x55')](_0xb2df('0x58'),util[_0xb2df('0x59')](_0x587603,{'showHidden':!![],'depth':null}));});};exports[_0xb2df('0x5a')]=function(_0x39166c,_0x3e0af2,_0x5db70f,_0xb77c77,_0x29549a,_0x57e9f0,_0xa55c14){var _0x16ed69,_0x86da9f;_0x57e9f0[_0xb2df('0xd')]=intUtil['stripTrailingSlash'](_0x57e9f0['remoteUri']);_0x57e9f0[_0xb2df('0x46')]=intUtil[_0xb2df('0x45')](_0x57e9f0[_0xb2df('0x46')]);if(_0xa55c14&&_0xa55c14[_0xb2df('0x5b')]&&_0xa55c14[_0xb2df('0x5b')]!==_0xb2df('0x5c')){logger[_0xb2df('0xb')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3e0af2[_0xb2df('0x5d')]=util[_0xb2df('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x57e9f0['serverUrl'],_0x3e0af2[_0xb2df('0x49')],md5(_0x3e0af2['uniqueid']));}headers[_0xb2df('0x4a')]=getAuth(_0x57e9f0);return getUser(_0x57e9f0,_0xb77c77[_0xb2df('0x4b')])['then'](function(_0x5d4fb2){_0x16ed69=_0x5d4fb2;logger['info'](_0xb2df('0x5e'),_0x16ed69['id']);return getEndUser(_0x57e9f0,_0x3e0af2['destcalleridname'],_0x3e0af2['destcalleridnum']);})['then'](function(_0x25f663){_0x86da9f=_0x25f663;logger['info']('The\x20Enduser\x20ID\x20is:',_0x86da9f['id']);return getTicket(_0x57e9f0,_0x16ed69,_0x86da9f,_0x5db70f,_0x3e0af2);})[_0xb2df('0x16')](function(_0x599142){if(_0x599142){logger[_0xb2df('0xb')]('The\x20Ticket\x20ID\x20is:',_0x599142['id']);switch(_0x57e9f0['type']){case _0xb2df('0x4e'):logger['info'](_0xb2df('0x5f'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xb2df('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x57e9f0[_0xb2df('0xd')],_0x16ed69['id'],_0x599142['id']),'method':'POST'});case _0xb2df('0x60'):logger[_0xb2df('0xb')](_0xb2df('0x5f'),_0xb2df('0x61'));emit(util[_0xb2df('0xc')](_0xb2df('0x50'),_0xb77c77[_0xb2df('0x11')]),_0xb2df('0x51'),{'uri':util['format'](_0xb2df('0x52'),_0x57e9f0[_0xb2df('0xd')][_0xb2df('0x53')](_0xb2df('0x54'),''),_0x599142['id'])});break;default:logger[_0xb2df('0x55')](_0xb2df('0x5f'),_0xb2df('0x56'));}}})[_0xb2df('0x57')](function(_0x4d8e0a){logger['error'](_0xb2df('0x62'),util[_0xb2df('0x59')](_0x4d8e0a,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x55734c,_0x59b645,_0x475452,_0x2ba130,_0xb8e855,_0xebbf25){var _0x6ea694,_0x215ffc;_0xebbf25[_0xb2df('0xd')]=intUtil[_0xb2df('0x45')](_0xebbf25[_0xb2df('0xd')]);_0xebbf25[_0xb2df('0x46')]=intUtil[_0xb2df('0x45')](_0xebbf25[_0xb2df('0x46')]);if(_0xb8e855&&_0xb8e855[_0xb2df('0x63')]){logger['info']('['+_0x59b645[_0xb2df('0x64')][_0xb2df('0x65')]()+']',_0xb2df('0x66'));_0x59b645[_0xb2df('0x5d')]=util[_0xb2df('0xc')](_0xb2df('0x48'),_0xebbf25['serverUrl'],_0x59b645[_0xb2df('0x49')],md5(_0x59b645[_0xb2df('0x49')]));}else{_0x59b645[_0xb2df('0x5d')]='';}headers[_0xb2df('0x4a')]=getAuth(_0xebbf25);return getUser(_0xebbf25)[_0xb2df('0x16')](function(_0x15415f){_0x6ea694=_0x15415f;logger[_0xb2df('0xb')](_0xb2df('0x5e'),_0x6ea694['id']);return getEndUser(_0xebbf25,_0x59b645[_0xb2df('0x4c')],_0x59b645['calleridnum']);})[_0xb2df('0x16')](function(_0x2886bc){_0x215ffc=_0x2886bc;logger[_0xb2df('0xb')](_0xb2df('0x4d'),_0x215ffc['id']);return getTicket(_0xebbf25,_0x6ea694,_0x215ffc,_0x475452,_0x59b645);})[_0xb2df('0x16')](function(_0x885e07){if(_0x885e07){logger[_0xb2df('0xb')](_0xb2df('0x67'),_0x885e07['id']);}})[_0xb2df('0x57')](function(_0x5e7a69){logger['error']('['+_0x59b645['lastevent'][_0xb2df('0x65')]()+']'+_0xb2df('0x68'),util[_0xb2df('0x59')](_0x5e7a69,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xcb1d=['Creating\x20new\x20ticket...','format','%s/tickets.json','POST','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20found!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','%s/token:%s','toString','debug','[HTTP]','stringify','map','forEach','string','picklist','type','nameField','customField','toLowerCase','content','includes','push','idField','variable','variableName','customVariable','Variable','name','custom_fields','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Authorization','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','integrationTab','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','monitor_format','toUpperCase','The\x20Ticket\x20ID\x20is:','lastevent','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','info'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xcb1d,0x1c2));var _0xdcb1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb1d[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var rp=require(_0xdcb1('0x0'));var md5=require(_0xdcb1('0x1'));var util=require(_0xdcb1('0x2'));var Redis=require(_0xdcb1('0x3'));var intUtil=require(_0xdcb1('0x4'));var config=require(_0xdcb1('0x5'));var logger=require(_0xdcb1('0x6'))(_0xdcb1('0x7'));config[_0xdcb1('0x8')]=_[_0xdcb1('0x9')](config[_0xdcb1('0x8')],{'host':_0xdcb1('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x18947a,_0x5c97a0,_0x4d026d){io['to'](_0x18947a)[_0xdcb1('0xb')](_0x5c97a0,_0x4d026d);}var headers={'Content-Type':_0xdcb1('0xc'),'Accept':_0xdcb1('0xc')};function getTicket(_0x1ca6ba,_0x169f08,_0x4a5c31,_0x41de50,_0x4089cf){logger[_0xdcb1('0xd')](_0xdcb1('0xe'));return request({'uri':util[_0xdcb1('0xf')](_0xdcb1('0x10'),_0x1ca6ba['remoteUri']),'method':_0xdcb1('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x4a5c31['id'],'submitter_id':_0x169f08?_0x169f08['id']:undefined,'assignee_id':_0x169f08?_0x169f08['id']:undefined,'tags':getTags(_0x41de50[_0xdcb1('0x12')],'name'),'subject':intUtil[_0xdcb1('0x13')](_0x41de50[_0xdcb1('0x14')],_0x4089cf,'\x20'),'description':intUtil[_0xdcb1('0x13')](_0x41de50[_0xdcb1('0x15')],_0x4089cf,'\x0a'),'comment':{'public':![],'body':intUtil[_0xdcb1('0x13')](_0x41de50[_0xdcb1('0x15')],_0x4089cf,'\x0a')}},getCustomFields(_0x41de50[_0xdcb1('0x16')],_0x4089cf))}})[_0xdcb1('0x17')](function(_0x15a1fa){logger[_0xdcb1('0xd')](_0xdcb1('0x18'));return _0x15a1fa[_0xdcb1('0x19')];});}function getUser(_0x1d3cba,_0x36560f){if(intUtil[_0xdcb1('0x1a')](_0x36560f)){logger[_0xdcb1('0xd')](_0xdcb1('0x1b'),_0x36560f);return request({'uri':util[_0xdcb1('0xf')](_0xdcb1('0x1c'),_0x1d3cba[_0xdcb1('0x1d')]),'qs':{'query':util[_0xdcb1('0xf')](_0xdcb1('0x1e'),_0x36560f)}})[_0xdcb1('0x17')](function(_0x734825){if(_0x734825[_0xdcb1('0x1f')]){logger[_0xdcb1('0xd')](_0xdcb1('0x20'));return _[_0xdcb1('0x21')](_0x734825[_0xdcb1('0x22')],{'email':_0x36560f,'role':_0xdcb1('0x23')});}else{logger['info'](_0xdcb1('0x24'));return request({'uri':util[_0xdcb1('0xf')](_0xdcb1('0x25'),_0x1d3cba[_0xdcb1('0x1d')])})[_0xdcb1('0x17')](function(_0x5cd446){logger[_0xdcb1('0xd')]('Admin\x20account\x20selected.');return _0x5cd446[_0xdcb1('0x26')];});}});}else{logger[_0xdcb1('0xd')](_0xdcb1('0x24'));return request({'uri':util['format'](_0xdcb1('0x25'),_0x1d3cba[_0xdcb1('0x1d')])})[_0xdcb1('0x17')](function(_0x45a51a){logger[_0xdcb1('0xd')](_0xdcb1('0x27'));return _0x45a51a[_0xdcb1('0x26')];});}}function getEndUser(_0x5387be,_0x17560d,_0x26d6aa){logger[_0xdcb1('0xd')](_0xdcb1('0x28'),_0x26d6aa);return request({'uri':util[_0xdcb1('0xf')](_0xdcb1('0x1c'),_0x5387be[_0xdcb1('0x1d')]),'qs':{'query':util[_0xdcb1('0xf')](_0xdcb1('0x29'),_0x26d6aa)}})[_0xdcb1('0x17')](function(_0x139f7e){var _0x4c527b;if(_0x139f7e[_0xdcb1('0x22')][_0xdcb1('0x2a')]){_0x139f7e[_0xdcb1('0x22')]=_[_0xdcb1('0x2b')](_0x139f7e[_0xdcb1('0x22')],{'suspended':![],'role':'end-user'});if(_0x139f7e[_0xdcb1('0x22')][_0xdcb1('0x2a')]){_0x4c527b=_[_0xdcb1('0x2c')](_0x139f7e[_0xdcb1('0x22')]);}}if(_0x4c527b){logger[_0xdcb1('0xd')](_0xdcb1('0x2d'));return _0x4c527b;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xdcb1('0xf')]('%s/users.json',_0x5387be[_0xdcb1('0x1d')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0xdcb1('0xf')](_0xdcb1('0x2e'),_0x17560d||_0x26d6aa),'phone':_0x26d6aa}}})[_0xdcb1('0x17')](function(_0x17fe61){logger[_0xdcb1('0xd')](_0xdcb1('0x2f'));return _0x17fe61['user'];});}});}function getAuth(_0x46f5d2){var _0x1ff518;if(_0x46f5d2[_0xdcb1('0x30')]===_0xdcb1('0x31')){_0x1ff518=util[_0xdcb1('0xf')]('%s:%s',_0x46f5d2[_0xdcb1('0x32')],_0x46f5d2[_0xdcb1('0x31')]);}else if(_0x46f5d2[_0xdcb1('0x30')]===_0xdcb1('0x33')){_0x1ff518=util[_0xdcb1('0xf')](_0xdcb1('0x34'),_0x46f5d2[_0xdcb1('0x32')],_0x46f5d2[_0xdcb1('0x33')]);}return util[_0xdcb1('0xf')]('Basic\x20%s',new Buffer(_0x1ff518)[_0xdcb1('0x35')]('base64'));}function request(_0x16915f){logger[_0xdcb1('0x36')](_0xdcb1('0x37'),JSON[_0xdcb1('0x38')](_0x16915f));return rp(_[_0xdcb1('0x9')](_0x16915f,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3bf2a8,_0x7a97f1){var _0x2c8f70=[];if(_0x3bf2a8&&_0x3bf2a8[_0xdcb1('0x2a')]>0x0){_0x2c8f70=_[_0xdcb1('0x39')](_0x3bf2a8,_0x7a97f1);}return _0x2c8f70;}function getCustomFields(_0x1d8aff,_0x37637c){var _0xff460c=[];var _0x549d6a={'custom_fields':[]};if(_0x1d8aff[_0xdcb1('0x2a')]>0x0){_[_0xdcb1('0x3a')](_0x1d8aff,function(_0x3571e3){if(_['includes']([_0xdcb1('0x3b'),_0xdcb1('0x3c')],_0x3571e3[_0xdcb1('0x3d')])&&_0x3571e3[_0xdcb1('0x3e')]&&!_0x3571e3[_0xdcb1('0x3f')]){_0x549d6a[_0x3571e3['nameField'][_0xdcb1('0x40')]()]=_0x3571e3[_0xdcb1('0x41')]['toString']();}else if(_[_0xdcb1('0x42')]([_0xdcb1('0x3b'),_0xdcb1('0x3c')],_0x3571e3['type'])&&_0x3571e3['idField']&&_0x3571e3[_0xdcb1('0x3f')]){_0x549d6a['custom_fields'][_0xdcb1('0x43')]({'id':_0x3571e3[_0xdcb1('0x44')],'value':_0x3571e3[_0xdcb1('0x41')][_0xdcb1('0x35')]()});}else if(_0x3571e3[_0xdcb1('0x3d')]===_0xdcb1('0x45')&&_0x3571e3['variableName']&&_0x3571e3['idField']&&_0x3571e3['customField']){_0x37637c[_0x3571e3[_0xdcb1('0x46')]]&&_0x549d6a['custom_fields'][_0xdcb1('0x43')]({'id':_0x3571e3[_0xdcb1('0x44')],'value':_0x37637c[_0x3571e3['variableName']][_0xdcb1('0x35')]()});}else if(_0x3571e3[_0xdcb1('0x3d')]===_0xdcb1('0x47')&&_0x3571e3[_0xdcb1('0x48')]&&_0x3571e3[_0xdcb1('0x48')][_0xdcb1('0x49')]&&_0x3571e3[_0xdcb1('0x44')]&&_0x3571e3[_0xdcb1('0x3f')]){_0x37637c[_0x3571e3[_0xdcb1('0x48')]['name'][_0xdcb1('0x40')]()]&&_0x549d6a[_0xdcb1('0x4a')][_0xdcb1('0x43')]({'id':_0x3571e3[_0xdcb1('0x44')],'value':_0x37637c[_0x3571e3[_0xdcb1('0x48')][_0xdcb1('0x49')][_0xdcb1('0x40')]()][_0xdcb1('0x35')]()});}});}return _0x549d6a;}exports[_0xdcb1('0x4b')]=function(_0x5e30a7,_0x53307d,_0x4d291d,_0x185882,_0x9ec673,_0x4e40fc){var _0x1e7bd0,_0x2c7136;_0x4e40fc[_0xdcb1('0x1d')]=intUtil[_0xdcb1('0x4c')](_0x4e40fc[_0xdcb1('0x1d')]);_0x4e40fc[_0xdcb1('0x4d')]=intUtil['stripTrailingSlash'](_0x4e40fc['serverUrl']);if(_0x9ec673&&_0x9ec673['monitor_format']){logger[_0xdcb1('0xd')](_0xdcb1('0x4e'),_0xdcb1('0x4f'));_0x53307d[_0xdcb1('0x50')]=util[_0xdcb1('0xf')](_0xdcb1('0x51'),_0x4e40fc[_0xdcb1('0x4d')],_0x53307d[_0xdcb1('0x52')],md5(_0x53307d['uniqueid']));}else{_0x53307d[_0xdcb1('0x50')]='';}headers['Authorization']=getAuth(_0x4e40fc);return getUser(_0x4e40fc,_0x185882[_0xdcb1('0x53')])['then'](function(_0x284525){_0x1e7bd0=_0x284525;logger[_0xdcb1('0xd')]('The\x20User\x20ID\x20is:',_0x1e7bd0['id']);return getEndUser(_0x4e40fc,_0x53307d[_0xdcb1('0x54')],_0x53307d[_0xdcb1('0x55')]);})[_0xdcb1('0x17')](function(_0x521175){_0x2c7136=_0x521175;logger['info'](_0xdcb1('0x56'),_0x2c7136['id']);return getTicket(_0x4e40fc,_0x1e7bd0,_0x2c7136,_0x4d291d,_0x53307d);})[_0xdcb1('0x17')](function(_0x512a9d){if(_0x512a9d){logger[_0xdcb1('0xd')]('The\x20Ticket\x20ID\x20is:',_0x512a9d['id']);switch(_0x4e40fc[_0xdcb1('0x3d')]){case'integrationTab':logger[_0xdcb1('0xd')]('[QUEUE]',_0xdcb1('0x57'));return request({'uri':util[_0xdcb1('0xf')](_0xdcb1('0x58'),_0x4e40fc['remoteUri'],_0x1e7bd0['id'],_0x512a9d['id']),'method':_0xdcb1('0x11')});case _0xdcb1('0x59'):logger[_0xdcb1('0xd')](_0xdcb1('0x4e'),_0xdcb1('0x5a'));emit(util[_0xdcb1('0xf')](_0xdcb1('0x5b'),_0x185882[_0xdcb1('0x49')]),_0xdcb1('0x5c'),{'uri':util[_0xdcb1('0xf')](_0xdcb1('0x5d'),_0x4e40fc[_0xdcb1('0x1d')][_0xdcb1('0x5e')](_0xdcb1('0x5f'),''),_0x512a9d['id'])});break;default:logger[_0xdcb1('0x60')](_0xdcb1('0x4e'),_0xdcb1('0x61'));}}})[_0xdcb1('0x62')](function(_0x49d1ec){logger[_0xdcb1('0x60')](_0xdcb1('0x63'),util[_0xdcb1('0x64')](_0x49d1ec,{'showHidden':!![],'depth':null}));});};exports[_0xdcb1('0x65')]=function(_0x363cc1,_0xbe6616,_0x5156e4,_0x153503,_0x3ff998,_0x1c34b0,_0x1637e8){var _0x4b28fa,_0x195408;_0x1c34b0[_0xdcb1('0x1d')]=intUtil['stripTrailingSlash'](_0x1c34b0['remoteUri']);_0x1c34b0['serverUrl']=intUtil['stripTrailingSlash'](_0x1c34b0[_0xdcb1('0x4d')]);if(_0x1637e8&&_0x1637e8['recordingFormat']&&_0x1637e8[_0xdcb1('0x66')]!==_0xdcb1('0x67')){logger['info'](_0xdcb1('0x68'),_0xdcb1('0x4f'));_0xbe6616[_0xdcb1('0x50')]=util['format'](_0xdcb1('0x51'),_0x1c34b0[_0xdcb1('0x4d')],_0xbe6616[_0xdcb1('0x52')],md5(_0xbe6616[_0xdcb1('0x52')]));}headers[_0xdcb1('0x69')]=getAuth(_0x1c34b0);return getUser(_0x1c34b0,_0x153503[_0xdcb1('0x53')])[_0xdcb1('0x17')](function(_0x235e26){_0x4b28fa=_0x235e26;logger[_0xdcb1('0xd')](_0xdcb1('0x6a'),_0x4b28fa['id']);return getEndUser(_0x1c34b0,_0xbe6616[_0xdcb1('0x6b')],_0xbe6616[_0xdcb1('0x6c')]);})[_0xdcb1('0x17')](function(_0x5aa33b){_0x195408=_0x5aa33b;logger[_0xdcb1('0xd')](_0xdcb1('0x56'),_0x195408['id']);return getTicket(_0x1c34b0,_0x4b28fa,_0x195408,_0x5156e4,_0xbe6616);})[_0xdcb1('0x17')](function(_0x58d719){if(_0x58d719){logger['info']('The\x20Ticket\x20ID\x20is:',_0x58d719['id']);switch(_0x1c34b0['type']){case _0xdcb1('0x6d'):logger[_0xdcb1('0xd')](_0xdcb1('0x68'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xdcb1('0xf')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1c34b0[_0xdcb1('0x1d')],_0x4b28fa['id'],_0x58d719['id']),'method':_0xdcb1('0x11')});case _0xdcb1('0x59'):logger[_0xdcb1('0xd')](_0xdcb1('0x68'),_0xdcb1('0x5a'));emit(util[_0xdcb1('0xf')]('user:%s',_0x153503[_0xdcb1('0x49')]),_0xdcb1('0x5c'),{'uri':util[_0xdcb1('0xf')](_0xdcb1('0x5d'),_0x1c34b0[_0xdcb1('0x1d')][_0xdcb1('0x5e')](_0xdcb1('0x5f'),''),_0x58d719['id'])});break;default:logger[_0xdcb1('0x60')](_0xdcb1('0x68'),_0xdcb1('0x61'));}}})[_0xdcb1('0x62')](function(_0x404853){logger[_0xdcb1('0x60')](_0xdcb1('0x6e'),util[_0xdcb1('0x64')](_0x404853,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x376769,_0x2b6599,_0x38d2f5,_0x2b5f4c,_0x8fa652,_0x5e7b9d){var _0x1156c4,_0x3b8099;_0x5e7b9d[_0xdcb1('0x1d')]=intUtil['stripTrailingSlash'](_0x5e7b9d[_0xdcb1('0x1d')]);_0x5e7b9d[_0xdcb1('0x4d')]=intUtil[_0xdcb1('0x4c')](_0x5e7b9d[_0xdcb1('0x4d')]);if(_0x8fa652&&_0x8fa652[_0xdcb1('0x6f')]){logger[_0xdcb1('0xd')]('['+_0x2b6599['lastevent'][_0xdcb1('0x70')]()+']',_0xdcb1('0x4f'));_0x2b6599['recordingURL']=util['format'](_0xdcb1('0x51'),_0x5e7b9d['serverUrl'],_0x2b6599[_0xdcb1('0x52')],md5(_0x2b6599[_0xdcb1('0x52')]));}else{_0x2b6599[_0xdcb1('0x50')]='';}headers[_0xdcb1('0x69')]=getAuth(_0x5e7b9d);return getUser(_0x5e7b9d)[_0xdcb1('0x17')](function(_0x56bbee){_0x1156c4=_0x56bbee;logger['info'](_0xdcb1('0x6a'),_0x1156c4['id']);return getEndUser(_0x5e7b9d,_0x2b6599[_0xdcb1('0x54')],_0x2b6599['calleridnum']);})[_0xdcb1('0x17')](function(_0x113fea){_0x3b8099=_0x113fea;logger['info'](_0xdcb1('0x56'),_0x3b8099['id']);return getTicket(_0x5e7b9d,_0x1156c4,_0x3b8099,_0x38d2f5,_0x2b6599);})['then'](function(_0x360b21){if(_0x360b21){logger[_0xdcb1('0xd')](_0xdcb1('0x71'),_0x360b21['id']);}})['catch'](function(_0x55f66e){logger[_0xdcb1('0x60')]('['+_0x2b6599[_0xdcb1('0x72')][_0xdcb1('0x70')]()+']'+_0xdcb1('0x73'),util[_0xdcb1('0x64')](_0x55f66e,{'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 1be5e8e..24c89cd 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 _0xa1e4=['serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','idField','content','toString','type','variable','variableName','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','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Leads','Creating\x20new\x20call...','Owner','administrator','getString','Descriptions','Who_Id','First_Name','Last_Name','What_Id','Full_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','Called','connect','Answered','rejected','Abandoned','timeout','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','err','host','stripTrailingSlash'];(function(_0x330218,_0x528e87){var _0x20f06a=function(_0x3f217a){while(--_0x3f217a){_0x330218['push'](_0x330218['shift']());}};_0x20f06a(++_0x528e87);}(_0xa1e4,0xb8));var _0x4a1e=function(_0x460f81,_0x553431){_0x460f81=_0x460f81-0x0;var _0x423f0d=_0xa1e4[_0x460f81];return _0x423f0d;};'use strict';var _=require(_0x4a1e('0x0'));var rp=require(_0x4a1e('0x1'));var md5=require(_0x4a1e('0x2'));var util=require(_0x4a1e('0x3'));var intUtil=require(_0x4a1e('0x4'));var moment=require(_0x4a1e('0x5'));var Redis=require(_0x4a1e('0x6'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require(_0x4a1e('0x7'))('zoho');config[_0x4a1e('0x8')]=_[_0x4a1e('0x9')](config[_0x4a1e('0x8')],{'host':_0x4a1e('0xa'),'port':0x18eb});var io=require(_0x4a1e('0xb'))(new Redis(config[_0x4a1e('0x8')]));function emit(_0x4dc597,_0x289bd5,_0x1a9a5d){io['to'](_0x4dc597)[_0x4a1e('0xc')](_0x289bd5,_0x1a9a5d);}function request(_0x4c77ac){logger[_0x4a1e('0xd')](_0x4a1e('0xe'),JSON[_0x4a1e('0xf')](_0x4c77ac));return rp(_0x4c77ac);}function getCustomFields(_0x384dab,_0x5c8e72){var _0x533438={};if(_0x384dab[_0x4a1e('0x10')]>0x0){_[_0x4a1e('0x11')](_0x384dab,function(_0x87e87a){if(_[_0x4a1e('0x12')]([_0x4a1e('0x13'),'picklist'],_0x87e87a['type'])&&_0x87e87a[_0x4a1e('0x14')]){_0x533438[_0x87e87a[_0x4a1e('0x14')]]=_0x87e87a[_0x4a1e('0x15')][_0x4a1e('0x16')]();}else if(_0x87e87a[_0x4a1e('0x17')]===_0x4a1e('0x18')&&_0x87e87a[_0x4a1e('0x19')]&&_0x87e87a[_0x4a1e('0x14')]&&_0x5c8e72[_0x87e87a[_0x4a1e('0x19')]]){_0x533438[_0x87e87a[_0x4a1e('0x14')]]=_0x5c8e72[_0x87e87a[_0x4a1e('0x19')]][_0x4a1e('0x16')]();}else if(_0x87e87a[_0x4a1e('0x17')]===_0x4a1e('0x1a')&&_0x87e87a[_0x4a1e('0x1b')]&&_0x87e87a[_0x4a1e('0x1b')]['name']&&_0x87e87a['idField']&&_0x5c8e72[_0x87e87a[_0x4a1e('0x1b')][_0x4a1e('0x1c')][_0x4a1e('0x1d')]()]){_0x533438[_0x87e87a[_0x4a1e('0x14')]]=_0x5c8e72[_0x87e87a['Variable'][_0x4a1e('0x1c')][_0x4a1e('0x1d')]()][_0x4a1e('0x16')]();}});}return _0x533438;}function getName(_0x2593ef){if(_0x2593ef['indexOf']('\x20')>0x0){var _0x443a87=_0x2593ef['split'](/ (.+)/);if(_0x443a87[0x1]){return _0x443a87;}}return[_0x2593ef,_0x2593ef];}var accountsTokens={};function getAccessToken(_0x53852f){return new Promise(function(_0x28b507,_0x1db773){if(!_['isNil'](accountsTokens[_0x53852f['id']])&&!_[_0x4a1e('0x1e')](accountsTokens[_0x53852f['id']][_0x4a1e('0x1f')])){if(moment()[_0x4a1e('0x20')](accountsTokens[_0x53852f['id']][_0x4a1e('0x21')])){_0x28b507(accountsTokens[_0x53852f['id']][_0x4a1e('0x1f')]);}}var _0x5297a3;switch(_0x53852f[_0x4a1e('0x22')]){case'US':_0x5297a3=_0x4a1e('0x23');break;case'AU':_0x5297a3=_0x4a1e('0x24');break;case'EU':_0x5297a3=_0x4a1e('0x25');break;case'IN':_0x5297a3=_0x4a1e('0x26');break;case'CN':_0x5297a3='https://accounts.zoho.com.cn';break;default:_0x5297a3=_0x4a1e('0x25');break;}var _0x4fa3d9={'method':_0x4a1e('0x27'),'uri':_0x5297a3+_0x4a1e('0x28'),'qs':{'refresh_token':_0x53852f[_0x4a1e('0x29')],'client_id':_0x53852f[_0x4a1e('0x2a')],'client_secret':_0x53852f[_0x4a1e('0x2b')],'grant_type':_0x4a1e('0x2c')},'json':!![]};return rp(_0x4fa3d9)[_0x4a1e('0x2d')](function(_0x55dbb5){accountsTokens[_0x53852f['id']]={'access_token':_0x55dbb5[_0x4a1e('0x1f')],'expires_in':moment()['add'](_0x55dbb5[_0x4a1e('0x21')],_0x4a1e('0x2e'))};_0x28b507(_0x55dbb5[_0x4a1e('0x1f')]);})[_0x4a1e('0x2f')](function(_0x486783){logger['error'](_0x4a1e('0x30'),_0x486783[_0x4a1e('0x31')]);_0x1db773(_0x486783);});});}function getUser(_0x126f0c,_0x58bcd8,_0x1c7710,_0x3ce314){logger[_0x4a1e('0x32')](_0x4a1e('0x33'));return request({'method':_0x4a1e('0x34'),'uri':util[_0x4a1e('0x35')](_0x4a1e('0x36'),_0x58bcd8),'qs':{'type':_0x4a1e('0x37')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x126f0c},'json':!![]})[_0x4a1e('0x2d')](function(_0x4d496d){if(_0x4d496d[_0x4a1e('0x38')]){var _0x1a73ba=-0x1;if(_[_0x4a1e('0x39')](_0x4d496d['users'])){if(!_[_0x4a1e('0x1e')](_0x3ce314)){_0x1a73ba=_['findIndex'](_0x4d496d[_0x4a1e('0x38')],function(_0x128eaf){return _0x128eaf['email']===_0x3ce314;});}if(_0x1a73ba>=0x0){logger[_0x4a1e('0x32')](_0x4a1e('0x3a'));}else{logger[_0x4a1e('0x32')](_0x4a1e('0x3b'));_0x1a73ba=_[_0x4a1e('0x3c')](_0x4d496d[_0x4a1e('0x38')],function(_0x4df4dd){return _0x4df4dd[_0x4a1e('0x3d')]['name']===_0x4a1e('0x3e');});}return _0x4d496d[_0x4a1e('0x38')][_0x1a73ba];}else{if(_0x4d496d[_0x4a1e('0x3f')][_0x4a1e('0x3d')][_0x4a1e('0x1c')]===_0x4a1e('0x3e')){logger['info'](_0x4a1e('0x3b'));user=_0x4d496d[_0x4a1e('0x3f')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x4d496d));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x4d496d));}}}else{logger[_0x4a1e('0x40')](_0x4a1e('0x41'),JSON[_0x4a1e('0xf')](_0x4d496d));throw new Error(_0x4a1e('0x42')+JSON[_0x4a1e('0xf')](_0x4d496d));}})[_0x4a1e('0x2f')](function(_0x263d36){console[_0x4a1e('0x40')](_0x263d36);});}function getZohoUser(_0x50acac,_0xc703e){return new BPromise(function(_0x4f16b8,_0x4520d8){request(_0x50acac)['then'](function(_0x320639){var _0x56db0c=null;if(_0x320639){_0x56db0c=_0x320639[_0x4a1e('0x43')][0x0];_0x56db0c[_0x4a1e('0x44')]=_0xc703e;}_0x4f16b8(_0x56db0c);})[_0x4a1e('0x2f')](function(_0xb378c){_0x4520d8(_0xb378c);});});}function createEndUser(_0x5e71e4,_0x4dd0f4,_0x46d1cf,_0x2c3d5a,_0x3ef4a2,_0x57e9a0){var _0x46d1cf=getName(_0x46d1cf);return request({'method':'POST','uri':_0x4a1e('0x45')+_0x4dd0f4+_0x4a1e('0x46')+_[_0x4a1e('0x47')](_0x57e9a0[_0x4a1e('0x48')])+'s','body':{'data':[{'Last_Name':_0x46d1cf[0x1],'First_Name':_0x46d1cf[0x0],'Phone':_0x2c3d5a,'Owner':{'name':!_[_0x4a1e('0x1e')](_0x3ef4a2[_0x4a1e('0x49')][_0x4a1e('0x1c')])?_0x3ef4a2[_0x4a1e('0x49')]['name']:!_[_0x4a1e('0x1e')](_0x3ef4a2[_0x4a1e('0x4a')])?_0x3ef4a2[_0x4a1e('0x4a')]+'\x20'+_0x3ef4a2['last_name']:_0x3ef4a2[_0x4a1e('0x4b')],'id':_0x3ef4a2['id']}}]},'headers':{'Authorization':_0x4a1e('0x4c')+_0x5e71e4},'json':!![]})['then'](function(_0x9d96e9){if(_0x9d96e9&&_0x9d96e9['data'][0x0][_0x4a1e('0x4d')]===_0x4a1e('0x4e')){var _0x59f67a=_0x9d96e9['data'][0x0][_0x4a1e('0x4f')];_0x59f67a['enduserType']=_['startCase'](_0x57e9a0[_0x4a1e('0x48')])+'s';return _0x59f67a;}logger[_0x4a1e('0x40')](_0x4a1e('0x41'),JSON['stringify'](data));throw new Error(_0x4a1e('0x50')+JSON[_0x4a1e('0xf')](data));})[_0x4a1e('0x2f')](function(_0x4e2ddd){console[_0x4a1e('0x51')](_0x4a1e('0x52'),_0x4e2ddd);});}function getEndUser(_0x237295,_0x23c0c5,_0x4a5b2f,_0x2dd927,_0x18e452,_0x33c9c0,_0xe7221d){var _0x4fd708={'method':_0x4a1e('0x34'),'uri':'','headers':{'Authorization':_0x4a1e('0x4c')+_0x237295},'json':!![]};switch(_0xe7221d['moduleSearch']){case _0x4a1e('0x53'):_0x4fd708[_0x4a1e('0x54')]=_0x4a1e('0x45')+_0x23c0c5+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x18e452+'))';return getZohoUser(_0x4fd708,_0x4a1e('0x55'))[_0x4a1e('0x2d')](function(_0x2d7275){if(_0x2d7275)return _0x2d7275;_0x4fd708[_0x4a1e('0x54')]=_0x4a1e('0x45')+_0x23c0c5+_0x4a1e('0x56')+_0x18e452+'))';return getZohoUser(_0x4fd708,'Leads')[_0x4a1e('0x2d')](function(_0x5be750){if(_0x5be750)return _0x5be750;if(_0xe7221d[_0x4a1e('0x48')]!=_0x4a1e('0x57')){return createEndUser(_0x237295,_0x23c0c5,_0x2dd927,_0x18e452,_0x33c9c0,_0xe7221d);}else{return{};}});});break;case'contact':_0x4fd708[_0x4a1e('0x54')]=_0x4a1e('0x45')+_0x23c0c5+_0x4a1e('0x58')+_0x18e452+'))';return getZohoUser(_0x4fd708,_0x4a1e('0x55'))['then'](function(_0x53bfc4){if(_0x53bfc4)return _0x53bfc4;if(_0xe7221d['moduleCreate']!=_0x4a1e('0x57')){return createEndUser(_0x237295,_0x23c0c5,_0x2dd927,_0x18e452,_0x33c9c0,_0xe7221d);}else{return{};}});break;case _0x4a1e('0x59'):_0x4fd708['uri']='https://www.zohoapis.'+_0x23c0c5+_0x4a1e('0x56')+_0x18e452+'))';return getZohoUser(_0x4fd708,_0x4a1e('0x5a'))[_0x4a1e('0x2d')](function(_0x4310c4){if(_0x4310c4)return _0x4310c4;if(_0xe7221d[_0x4a1e('0x48')]!=_0x4a1e('0x57')){return createEndUser(_0x237295,_0x23c0c5,_0x2dd927,_0x18e452,_0x33c9c0,_0xe7221d);}else{return{};}});break;}}function getCall(_0x5698df,_0x1335ab,_0x232b9c,_0x18046d,_0x4a2b3e,_0x559ccb,_0x3361c2,_0x256e80){logger[_0x4a1e('0x32')](_0x4a1e('0x5b'));var _0x5b36cc={};_0x5b36cc[_0x4a1e('0x5c')]={'name':!_['isNil'](_0x18046d[_0x4a1e('0x49')][_0x4a1e('0x1c')])&&!_[_0x4a1e('0x1e')](_0x18046d[_0x4a1e('0x3d')]['name'])&&_0x18046d['profile'][_0x4a1e('0x1c')]===_0x4a1e('0x5d')?_0x18046d[_0x4a1e('0x49')][_0x4a1e('0x1c')]:!_[_0x4a1e('0x1e')](_0x18046d[_0x4a1e('0x4a')])?_0x18046d['first_name']+'\x20'+_0x18046d[_0x4a1e('0x4b')]:_0x18046d[_0x4a1e('0x4b')],'id':_0x18046d['id']};_0x5b36cc['Subject']=intUtil[_0x4a1e('0x5e')](_0x559ccb['Subjects'],_0x3361c2,'\x20');_0x5b36cc['Description']=intUtil[_0x4a1e('0x5e')](_0x559ccb[_0x4a1e('0x5f')],_0x3361c2,'\x0a');if(_0x4a2b3e['enduserType']===_0x4a1e('0x55')){_0x5b36cc[_0x4a1e('0x60')]={'name':!_[_0x4a1e('0x1e')](_0x4a2b3e['Full_Name'])?_0x4a2b3e['Full_Name']:!_['isNil'](_0x4a2b3e['First_Name'])?_0x4a2b3e[_0x4a1e('0x61')]+'\x20'+_0x4a2b3e[_0x4a1e('0x62')]:_0x4a2b3e[_0x4a1e('0x62')],'id':_0x4a2b3e['id']};}if(_0x4a2b3e[_0x4a1e('0x44')]===_0x4a1e('0x5a')){_0x5b36cc[_0x4a1e('0x63')]={'name':!_[_0x4a1e('0x1e')](_0x4a2b3e[_0x4a1e('0x64')])?_0x4a2b3e[_0x4a1e('0x64')]:!_['isNil'](_0x4a2b3e[_0x4a1e('0x61')])?_0x4a2b3e[_0x4a1e('0x61')]+'\x20'+_0x4a2b3e[_0x4a1e('0x62')]:_0x4a2b3e[_0x4a1e('0x62')],'id':_0x4a2b3e['id']};_0x5b36cc[_0x4a1e('0x65')]=_['startCase'](_0x4a2b3e[_0x4a1e('0x44')]);}if(_0x3361c2[_0x4a1e('0x66')]){_0x5b36cc[_0x4a1e('0x67')]=moment[_0x4a1e('0x68')](parseInt(_0x3361c2[_0x4a1e('0x66')])*0x3e8)[_0x4a1e('0x35')](_0x4a1e('0x69'));}else if(_0x3361c2[_0x4a1e('0x6a')]&&_0x3361c2[_0x4a1e('0x6b')]){_0x5b36cc[_0x4a1e('0x67')]=moment[_0x4a1e('0x68')](moment(_0x3361c2[_0x4a1e('0x6b')],_0x4a1e('0x6c'))[_0x4a1e('0x6d')](moment(_0x3361c2['starttime'],_0x4a1e('0x6c'))))[_0x4a1e('0x35')](_0x4a1e('0x69'));}switch(_0x3361c2[_0x4a1e('0x6e')]){case _0x4a1e('0x6f'):_0x5b36cc[_0x4a1e('0x70')]=_0x4a1e('0x71');break;case'complete':case _0x4a1e('0x72'):_0x5b36cc[_0x4a1e('0x70')]=_0x4a1e('0x73');break;case _0x4a1e('0x74'):_0x5b36cc[_0x4a1e('0x70')]='Rejected';break;case'abandoned':_0x5b36cc[_0x4a1e('0x70')]=_0x4a1e('0x75');break;case _0x4a1e('0x76'):_0x5b36cc['Call_Result']='Timeout';default:}_0x5b36cc['Call_Start_Time']=(_0x256e80==='outbound'?moment(_0x3361c2['starttime'])[_0x4a1e('0x35')](_0x4a1e('0x6c')):moment(_0x3361c2[_0x4a1e('0x77')])[_0x4a1e('0x35')](_0x4a1e('0x6c')))||moment()[_0x4a1e('0x35')]('YYYY-MM-DDTHH:mm:ss');_0x5b36cc[_0x4a1e('0x78')]=_0x256e80||_0x4a1e('0x79');_0x5b36cc=_[_0x4a1e('0x7a')](_0x5b36cc,getCustomFields(_0x559ccb[_0x4a1e('0x7b')],_0x3361c2));return request({'method':_0x4a1e('0x27'),'uri':_0x4a1e('0x45')+_0x1335ab+'/crm/v2/Calls','headers':{'Authorization':_0x4a1e('0x4c')+_0x5698df},'body':{'data':[_0x5b36cc]},'json':!![]})[_0x4a1e('0x2d')](function(_0x11b380){if(_0x11b380&&_0x11b380[_0x4a1e('0x43')][0x0][_0x4a1e('0x4d')]===_0x4a1e('0x4e')){logger['info'](_0x4a1e('0x7c'));return{'id':_0x11b380[_0x4a1e('0x43')][0x0][_0x4a1e('0x4f')]['id']};}})[_0x4a1e('0x2f')](function(_0x31c663){logger[_0x4a1e('0x32')]('err',_0x31c663['stack']);console[_0x4a1e('0x51')](_0x4a1e('0x7d'),_0x31c663);});}exports['queue']=function(_0x414642,_0x5ee592,_0x4cc040,_0x48910d,_0x2740e2,_0x24595b){var _0x5ce1dd,_0xa53b7a,_0x45482d;_0x24595b[_0x4a1e('0x7e')]=intUtil[_0x4a1e('0x7f')](_0x24595b[_0x4a1e('0x7e')]);_0x24595b[_0x4a1e('0x80')]=intUtil['stripTrailingSlash'](_0x24595b[_0x4a1e('0x80')]);if(_0x2740e2&&_0x2740e2[_0x4a1e('0x81')]){logger[_0x4a1e('0x32')](_0x4a1e('0x82'),_0x4a1e('0x83'));_0x5ee592['recordingURL']=_0x24595b['serverUrl']+_0x4a1e('0x84')+_0x5ee592[_0x4a1e('0x85')]+_0x4a1e('0x86')+md5(_0x5ee592[_0x4a1e('0x85')]);}else{_0x5ee592['recordingURL']='';}var _0x5722bf=_0x24595b[_0x4a1e('0x7e')]===_0x4a1e('0x87')?'eu':_0x4a1e('0x88');return getAccessToken(_0x24595b)[_0x4a1e('0x2d')](function(_0x4dbd9d){_0x45482d=_0x4dbd9d;return getUser(_0x45482d,_0x5722bf,_0x24595b,_0x48910d[_0x4a1e('0x89')]);})[_0x4a1e('0x2d')](function(_0x2b3bdc){_0x5ce1dd=_0x2b3bdc;logger[_0x4a1e('0x32')](_0x4a1e('0x8a'),_0x5ce1dd['id']);return getEndUser(_0x45482d,_0x5722bf,_0x24595b,_0x5ee592[_0x4a1e('0x8b')],_0x5ee592[_0x4a1e('0x8c')],_0x5ce1dd,_0x4cc040);})['then'](function(_0x224b8f){_0xa53b7a=_0x224b8f;return getCall(_0x45482d,_0x5722bf,_0x24595b,_0x5ce1dd,_0xa53b7a,_0x4cc040,_0x5ee592,_0x4a1e('0x79'));})[_0x4a1e('0x2d')](function(_0x38a748){if(_0x38a748){logger[_0x4a1e('0x32')](_0x4a1e('0x8d'),_0x38a748['id']);logger[_0x4a1e('0x32')](_0x4a1e('0x82'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4a1e('0x35')](_0x4a1e('0x8e'),_0x48910d[_0x4a1e('0x1c')]),'trigger:browser:url',{'uri':'https://crm.'+_0x24595b[_0x4a1e('0x7e')]+_0x4a1e('0x8f')+_0x38a748['id']});}})[_0x4a1e('0x2f')](function(_0x1b96bc){logger[_0x4a1e('0x40')](_0x4a1e('0x82'),JSON[_0x4a1e('0xf')](_0x1b96bc));});};exports[_0x4a1e('0x90')]=function(_0x10cb6d,_0xe21a36,_0x18f264,_0x4601d4,_0x5c6323,_0xbc60ac,_0x4862f7){var _0x12fc94,_0xb0ad8e,_0x382a19;_0xbc60ac[_0x4a1e('0x7e')]=intUtil[_0x4a1e('0x7f')](_0xbc60ac[_0x4a1e('0x7e')]);_0xbc60ac['serverUrl']=intUtil[_0x4a1e('0x7f')](_0xbc60ac['serverUrl']);if(_0x4862f7&&_0x4862f7[_0x4a1e('0x91')]&&_0x4862f7[_0x4a1e('0x91')]!==_0x4a1e('0x92')){logger[_0x4a1e('0x32')](_0x4a1e('0x93'),_0x4a1e('0x83'));_0xe21a36[_0x4a1e('0x94')]=_0xbc60ac[_0x4a1e('0x80')]+_0x4a1e('0x84')+_0xe21a36[_0x4a1e('0x85')]+_0x4a1e('0x86')+md5(_0xe21a36[_0x4a1e('0x85')]);}var _0x4592c9=_0xbc60ac['host']===_0x4a1e('0x87')?'eu':'com';return getAccessToken(_0xbc60ac)['then'](function(_0x468f88){_0x382a19=_0x468f88;return getUser(_0x382a19,_0x4592c9,_0xbc60ac,_0x4601d4['email']);})[_0x4a1e('0x2d')](function(_0x195bb5){_0x12fc94=_0x195bb5;logger[_0x4a1e('0x32')](_0x4a1e('0x8a'),_0x12fc94['id']);return getEndUser(_0x382a19,_0x4592c9,_0xbc60ac,_0xe21a36[_0x4a1e('0x95')],_0xe21a36[_0x4a1e('0x96')],_0x12fc94,_0x18f264);})[_0x4a1e('0x2d')](function(_0xfba8ba){_0xb0ad8e=_0xfba8ba;return getCall(_0x382a19,_0x4592c9,_0xbc60ac,_0x12fc94,_0xb0ad8e,_0x18f264,_0xe21a36,_0x4a1e('0x97'));})['then'](function(_0x37f976){if(_0x37f976){logger[_0x4a1e('0x32')]('The\x20Call\x20ID\x20is:',_0x37f976['id']);logger['info'](_0x4a1e('0x93'),_0x4a1e('0x98'));emit(util['format'](_0x4a1e('0x8e'),_0x4601d4[_0x4a1e('0x1c')]),_0x4a1e('0x99'),{'uri':_0x4a1e('0x9a')+_0xbc60ac[_0x4a1e('0x7e')]+'/crm/EntityInfo.do?module=Calls&id='+_0x37f976['id']});}})['catch'](function(_0x524767){logger[_0x4a1e('0x40')](_0x4a1e('0x93'),JSON[_0x4a1e('0xf')](_0x524767));});};exports['unmanaged']=function(_0x3c5aaf,_0x3a285a,_0x592883,_0x475956,_0x81b54f,_0x4e7beb){var _0xfa1995,_0x39b210,_0x1e0d31;_0x4e7beb[_0x4a1e('0x7e')]=intUtil[_0x4a1e('0x7f')](_0x4e7beb[_0x4a1e('0x7e')]);_0x4e7beb[_0x4a1e('0x80')]=intUtil[_0x4a1e('0x7f')](_0x4e7beb[_0x4a1e('0x80')]);if(_0x81b54f&&_0x81b54f[_0x4a1e('0x81')]){logger[_0x4a1e('0x32')]('['+_0x3a285a[_0x4a1e('0x6e')][_0x4a1e('0x9b')]()+']','Recording\x20is\x20enabled!');_0x3a285a['recordingURL']=_0x4e7beb[_0x4a1e('0x80')]+_0x4a1e('0x84')+_0x3a285a[_0x4a1e('0x85')]+_0x4a1e('0x86')+md5(_0x3a285a[_0x4a1e('0x85')]);}else{_0x3a285a[_0x4a1e('0x94')]='';}var _0x529905=_0x4e7beb[_0x4a1e('0x7e')]===_0x4a1e('0x87')?'eu':_0x4a1e('0x88');return getAccessToken(_0x4e7beb)['then'](function(_0x14c329){_0x1e0d31=_0x14c329;return getUser(_0x1e0d31,_0x529905,_0x4e7beb);})[_0x4a1e('0x2d')](function(_0x2c21eb){_0xfa1995=_0x2c21eb;logger['info'](_0x4a1e('0x8a'),_0xfa1995['id']);return getEndUser(_0x1e0d31,_0x529905,_0x4e7beb,_0x3a285a[_0x4a1e('0x8b')],_0x3a285a[_0x4a1e('0x8c')],_0xfa1995,_0x592883);})['then'](function(_0x287fef){_0x39b210=_0x287fef;return getCall(_0x1e0d31,_0x529905,_0x4e7beb,_0xfa1995,_0x39b210,_0x592883,_0x3a285a,_0x4a1e('0x79'));})[_0x4a1e('0x2d')](function(_0x17942f){if(_0x17942f){logger[_0x4a1e('0x32')](_0x4a1e('0x8d'),_0x17942f['id']);}})['catch'](function(_0x42c719){logger[_0x4a1e('0x40')]('['+_0x3a285a['lastevent'][_0x4a1e('0x9b')]()+']',JSON['stringify'](_0x42c719));});}; \ No newline at end of file +var _0x0ce1=['connect','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','[OUTBOUND]','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','debug','stringify','length','forEach','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','users','email','info','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','last_name','code','SUCCESS','details','log','CREATE\x20ERROR','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','moduleCreate','nothing','lead','Creating\x20new\x20call...','Owner','administrator','first_name','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','Last_Name','What_Id','First_Name','$se_module','Call_Duration','talktime','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','complete'];(function(_0x264d4d,_0x118fb5){var _0xc917e2=function(_0x21b9dc){while(--_0x21b9dc){_0x264d4d['push'](_0x264d4d['shift']());}};_0xc917e2(++_0x118fb5);}(_0x0ce1,0xc4));var _0x10ce=function(_0x1d3d91,_0x128cf1){_0x1d3d91=_0x1d3d91-0x0;var _0x5d4e8d=_0x0ce1[_0x1d3d91];return _0x5d4e8d;};'use strict';var _=require(_0x10ce('0x0'));var rp=require(_0x10ce('0x1'));var md5=require(_0x10ce('0x2'));var util=require(_0x10ce('0x3'));var intUtil=require(_0x10ce('0x4'));var moment=require('moment');var Redis=require(_0x10ce('0x5'));var BPromise=require(_0x10ce('0x6'));var config=require(_0x10ce('0x7'));var logger=require(_0x10ce('0x8'))('zoho');config['redis']=_[_0x10ce('0x9')](config[_0x10ce('0xa')],{'host':_0x10ce('0xb'),'port':0x18eb});var io=require(_0x10ce('0xc'))(new Redis(config['redis']));function emit(_0x482736,_0x4c895c,_0x3aa108){io['to'](_0x482736)['emit'](_0x4c895c,_0x3aa108);}function request(_0x16dae3){logger[_0x10ce('0xd')]('[HTTP]',JSON[_0x10ce('0xe')](_0x16dae3));return rp(_0x16dae3);}function getCustomFields(_0x36217c,_0x5da244){var _0x5a16a8={};if(_0x36217c[_0x10ce('0xf')]>0x0){_[_0x10ce('0x10')](_0x36217c,function(_0x1af412){if(_[_0x10ce('0x11')]([_0x10ce('0x12'),_0x10ce('0x13')],_0x1af412[_0x10ce('0x14')])&&_0x1af412[_0x10ce('0x15')]){_0x5a16a8[_0x1af412[_0x10ce('0x15')]]=_0x1af412['content'][_0x10ce('0x16')]();}else if(_0x1af412['type']===_0x10ce('0x17')&&_0x1af412[_0x10ce('0x18')]&&_0x1af412['idField']&&_0x5da244[_0x1af412[_0x10ce('0x18')]]){_0x5a16a8[_0x1af412['idField']]=_0x5da244[_0x1af412[_0x10ce('0x18')]]['toString']();}else if(_0x1af412[_0x10ce('0x14')]===_0x10ce('0x19')&&_0x1af412['Variable']&&_0x1af412[_0x10ce('0x1a')][_0x10ce('0x1b')]&&_0x1af412['idField']&&_0x5da244[_0x1af412[_0x10ce('0x1a')]['name'][_0x10ce('0x1c')]()]){_0x5a16a8[_0x1af412[_0x10ce('0x15')]]=_0x5da244[_0x1af412[_0x10ce('0x1a')]['name'][_0x10ce('0x1c')]()][_0x10ce('0x16')]();}});}return _0x5a16a8;}function getName(_0x11f4c8){if(_0x11f4c8[_0x10ce('0x1d')]('\x20')>0x0){var _0x1b8224=_0x11f4c8[_0x10ce('0x1e')](/ (.+)/);if(_0x1b8224[0x1]){return _0x1b8224;}}return[_0x11f4c8,_0x11f4c8];}var accountsTokens={};function getAccessToken(_0x287b3c){return new Promise(function(_0x4de54c,_0x241a3a){if(!_[_0x10ce('0x1f')](accountsTokens[_0x287b3c['id']])&&!_[_0x10ce('0x1f')](accountsTokens[_0x287b3c['id']][_0x10ce('0x20')])){if(moment()[_0x10ce('0x21')](accountsTokens[_0x287b3c['id']][_0x10ce('0x22')])){_0x4de54c(accountsTokens[_0x287b3c['id']][_0x10ce('0x20')]);}}var _0x3f9e76;switch(_0x287b3c['zone']){case'US':_0x3f9e76='https://accounts.zoho.com';break;case'AU':_0x3f9e76='https://accounts.zoho.com.au';break;case'EU':_0x3f9e76='https://accounts.zoho.eu';break;case'IN':_0x3f9e76=_0x10ce('0x23');break;case'CN':_0x3f9e76=_0x10ce('0x24');break;default:_0x3f9e76=_0x10ce('0x25');break;}var _0x34e27e={'method':_0x10ce('0x26'),'uri':_0x3f9e76+_0x10ce('0x27'),'qs':{'refresh_token':_0x287b3c[_0x10ce('0x28')],'client_id':_0x287b3c[_0x10ce('0x29')],'client_secret':_0x287b3c[_0x10ce('0x2a')],'grant_type':_0x10ce('0x2b')},'json':!![]};return rp(_0x34e27e)[_0x10ce('0x2c')](function(_0x436bde){accountsTokens[_0x287b3c['id']]={'access_token':_0x436bde['access_token'],'expires_in':moment()['add'](_0x436bde[_0x10ce('0x22')],_0x10ce('0x2d'))};_0x4de54c(_0x436bde[_0x10ce('0x20')]);})[_0x10ce('0x2e')](function(_0x36568f){logger['error'](_0x10ce('0x2f'),_0x36568f[_0x10ce('0x30')]);_0x241a3a(_0x36568f);});});}function getUser(_0x548f37,_0x4b1cc3,_0x5ef3c1,_0x9648cc){logger['info'](_0x10ce('0x31'));return request({'method':_0x10ce('0x32'),'uri':util[_0x10ce('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0x4b1cc3),'qs':{'type':_0x10ce('0x34')},'headers':{'Authorization':_0x10ce('0x35')+_0x548f37},'json':!![]})['then'](function(_0x35a0df){if(_0x35a0df['users']){var _0x3d7391=-0x1;if(_[_0x10ce('0x36')](_0x35a0df['users'])){if(!_[_0x10ce('0x1f')](_0x9648cc)){_0x3d7391=_[_0x10ce('0x37')](_0x35a0df[_0x10ce('0x38')],function(_0x5d9bee){return _0x5d9bee[_0x10ce('0x39')]===_0x9648cc;});}if(_0x3d7391>=0x0){logger[_0x10ce('0x3a')](_0x10ce('0x3b'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x3d7391=_[_0x10ce('0x37')](_0x35a0df['users'],function(_0x3745bb){return _0x3745bb[_0x10ce('0x3c')]['name']===_0x10ce('0x3d');});}return _0x35a0df[_0x10ce('0x38')][_0x3d7391];}else{if(_0x35a0df[_0x10ce('0x3e')][_0x10ce('0x3c')][_0x10ce('0x1b')]===_0x10ce('0x3d')){logger[_0x10ce('0x3a')](_0x10ce('0x3f'));user=_0x35a0df[_0x10ce('0x3e')];return user;}else{logger['error'](_0x10ce('0x40'),JSON[_0x10ce('0xe')](_0x35a0df));throw new Error(_0x10ce('0x41')+JSON[_0x10ce('0xe')](_0x35a0df));}}}else{logger[_0x10ce('0x42')](_0x10ce('0x40'),JSON['stringify'](_0x35a0df));throw new Error(_0x10ce('0x41')+JSON[_0x10ce('0xe')](_0x35a0df));}})[_0x10ce('0x2e')](function(_0x512692){console['error'](_0x512692);});}function getZohoUser(_0x441af3,_0x24a8f3){return new BPromise(function(_0x4957bf,_0x43de50){request(_0x441af3)['then'](function(_0x83b157){var _0x3771a1=null;if(_0x83b157){_0x3771a1=_0x83b157[_0x10ce('0x43')][0x0];_0x3771a1[_0x10ce('0x44')]=_0x24a8f3;}_0x4957bf(_0x3771a1);})['catch'](function(_0x33ed15){_0x43de50(_0x33ed15);});});}function createEndUser(_0x3c6f30,_0x4ac300,_0x335959,_0x35b13c,_0x4cbde6,_0x36f59){var _0x335959=getName(_0x335959);return request({'method':'POST','uri':_0x10ce('0x45')+_0x4ac300+_0x10ce('0x46')+_[_0x10ce('0x47')](_0x36f59['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x335959[0x1],'First_Name':_0x335959[0x0],'Phone':_0x35b13c,'Owner':{'name':!_[_0x10ce('0x1f')](_0x4cbde6[_0x10ce('0x48')][_0x10ce('0x1b')])?_0x4cbde6['role'][_0x10ce('0x1b')]:!_[_0x10ce('0x1f')](_0x4cbde6['first_name'])?_0x4cbde6['first_name']+'\x20'+_0x4cbde6[_0x10ce('0x49')]:_0x4cbde6[_0x10ce('0x49')],'id':_0x4cbde6['id']}}]},'headers':{'Authorization':_0x10ce('0x35')+_0x3c6f30},'json':!![]})[_0x10ce('0x2c')](function(_0x193b0f){if(_0x193b0f&&_0x193b0f[_0x10ce('0x43')][0x0][_0x10ce('0x4a')]===_0x10ce('0x4b')){var _0x508519=_0x193b0f[_0x10ce('0x43')][0x0][_0x10ce('0x4c')];_0x508519[_0x10ce('0x44')]=_[_0x10ce('0x47')](_0x36f59['moduleCreate'])+'s';return _0x508519;}logger[_0x10ce('0x42')]('The\x20failing\x20result\x20is',JSON[_0x10ce('0xe')](data));throw new Error('Error:\x20'+JSON[_0x10ce('0xe')](data));})[_0x10ce('0x2e')](function(_0x393f7f){console[_0x10ce('0x4d')](_0x10ce('0x4e'),_0x393f7f);});}function getEndUser(_0x7aebdb,_0x1e024b,_0x5a0033,_0x2629d2,_0x112f9e,_0x5e48d6,_0x512719){var _0xac1f89={'method':_0x10ce('0x32'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x7aebdb},'json':!![]};switch(_0x512719['moduleSearch']){case _0x10ce('0x4f'):_0xac1f89[_0x10ce('0x50')]=_0x10ce('0x45')+_0x1e024b+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x112f9e+'))';return getZohoUser(_0xac1f89,_0x10ce('0x51'))[_0x10ce('0x2c')](function(_0x140e15){if(_0x140e15)return _0x140e15;_0xac1f89[_0x10ce('0x50')]=_0x10ce('0x45')+_0x1e024b+_0x10ce('0x52')+_0x112f9e+'))';return getZohoUser(_0xac1f89,_0x10ce('0x53'))[_0x10ce('0x2c')](function(_0xe56a8){if(_0xe56a8)return _0xe56a8;if(_0x512719['moduleCreate']!='nothing'){return createEndUser(_0x7aebdb,_0x1e024b,_0x2629d2,_0x112f9e,_0x5e48d6,_0x512719);}else{return{};}});});break;case _0x10ce('0x54'):_0xac1f89['uri']=_0x10ce('0x45')+_0x1e024b+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x112f9e+'))';return getZohoUser(_0xac1f89,_0x10ce('0x51'))[_0x10ce('0x2c')](function(_0x460a6e){if(_0x460a6e)return _0x460a6e;if(_0x512719[_0x10ce('0x55')]!=_0x10ce('0x56')){return createEndUser(_0x7aebdb,_0x1e024b,_0x2629d2,_0x112f9e,_0x5e48d6,_0x512719);}else{return{};}});break;case _0x10ce('0x57'):_0xac1f89[_0x10ce('0x50')]=_0x10ce('0x45')+_0x1e024b+_0x10ce('0x52')+_0x112f9e+'))';return getZohoUser(_0xac1f89,_0x10ce('0x53'))['then'](function(_0x47f020){if(_0x47f020)return _0x47f020;if(_0x512719['moduleCreate']!=_0x10ce('0x56')){return createEndUser(_0x7aebdb,_0x1e024b,_0x2629d2,_0x112f9e,_0x5e48d6,_0x512719);}else{return{};}});break;}}function getCall(_0x24a061,_0x1c2061,_0x2ebf1e,_0x477341,_0x168245,_0xee1c48,_0x5224cf,_0x39c4af){logger[_0x10ce('0x3a')](_0x10ce('0x58'));var _0x36fa03={};_0x36fa03[_0x10ce('0x59')]={'name':!_[_0x10ce('0x1f')](_0x477341[_0x10ce('0x48')][_0x10ce('0x1b')])&&!_[_0x10ce('0x1f')](_0x477341[_0x10ce('0x3c')][_0x10ce('0x1b')])&&_0x477341[_0x10ce('0x3c')]['name']===_0x10ce('0x5a')?_0x477341[_0x10ce('0x48')][_0x10ce('0x1b')]:!_[_0x10ce('0x1f')](_0x477341[_0x10ce('0x5b')])?_0x477341[_0x10ce('0x5b')]+'\x20'+_0x477341['last_name']:_0x477341[_0x10ce('0x49')],'id':_0x477341['id']};_0x36fa03[_0x10ce('0x5c')]=intUtil[_0x10ce('0x5d')](_0xee1c48[_0x10ce('0x5e')],_0x5224cf,'\x20');_0x36fa03['Description']=intUtil[_0x10ce('0x5d')](_0xee1c48[_0x10ce('0x5f')],_0x5224cf,'\x0a');if(_0x168245[_0x10ce('0x44')]===_0x10ce('0x51')){_0x36fa03[_0x10ce('0x60')]={'name':!_[_0x10ce('0x1f')](_0x168245[_0x10ce('0x61')])?_0x168245[_0x10ce('0x61')]:!_[_0x10ce('0x1f')](_0x168245['First_Name'])?_0x168245['First_Name']+'\x20'+_0x168245[_0x10ce('0x62')]:_0x168245[_0x10ce('0x62')],'id':_0x168245['id']};}if(_0x168245[_0x10ce('0x44')]==='Leads'){_0x36fa03[_0x10ce('0x63')]={'name':!_[_0x10ce('0x1f')](_0x168245['Full_Name'])?_0x168245[_0x10ce('0x61')]:!_[_0x10ce('0x1f')](_0x168245[_0x10ce('0x64')])?_0x168245['First_Name']+'\x20'+_0x168245[_0x10ce('0x62')]:_0x168245['Last_Name'],'id':_0x168245['id']};_0x36fa03[_0x10ce('0x65')]=_[_0x10ce('0x47')](_0x168245['enduserType']);}if(_0x5224cf['talktime']){_0x36fa03[_0x10ce('0x66')]=moment['utc'](parseInt(_0x5224cf[_0x10ce('0x67')])*0x3e8)[_0x10ce('0x33')]('mm:ss');}else if(_0x5224cf[_0x10ce('0x68')]&&_0x5224cf[_0x10ce('0x69')]){_0x36fa03['Call_Duration']=moment[_0x10ce('0x6a')](moment(_0x5224cf['endtime'],_0x10ce('0x6b'))[_0x10ce('0x6c')](moment(_0x5224cf[_0x10ce('0x6d')],_0x10ce('0x6b'))))[_0x10ce('0x33')]('mm:ss');}switch(_0x5224cf[_0x10ce('0x6e')]){case _0x10ce('0x6f'):_0x36fa03[_0x10ce('0x70')]='Called';break;case _0x10ce('0x71'):case _0x10ce('0x72'):_0x36fa03['Call_Result']=_0x10ce('0x73');break;case _0x10ce('0x74'):_0x36fa03[_0x10ce('0x70')]=_0x10ce('0x75');break;case'abandoned':_0x36fa03['Call_Result']=_0x10ce('0x76');break;case _0x10ce('0x77'):_0x36fa03[_0x10ce('0x70')]=_0x10ce('0x78');default:}_0x36fa03[_0x10ce('0x79')]=(_0x39c4af===_0x10ce('0x7a')?moment(_0x5224cf[_0x10ce('0x6d')])['format'](_0x10ce('0x6b')):moment(_0x5224cf[_0x10ce('0x7b')])[_0x10ce('0x33')](_0x10ce('0x6b')))||moment()[_0x10ce('0x33')](_0x10ce('0x6b'));_0x36fa03[_0x10ce('0x7c')]=_0x39c4af||_0x10ce('0x7d');_0x36fa03=_[_0x10ce('0x7e')](_0x36fa03,getCustomFields(_0xee1c48['Fields'],_0x5224cf));return request({'method':_0x10ce('0x26'),'uri':'https://www.zohoapis.'+_0x1c2061+_0x10ce('0x7f'),'headers':{'Authorization':_0x10ce('0x35')+_0x24a061},'body':{'data':[_0x36fa03]},'json':!![]})['then'](function(_0x16965a){if(_0x16965a&&_0x16965a[_0x10ce('0x43')][0x0][_0x10ce('0x4a')]===_0x10ce('0x4b')){logger[_0x10ce('0x3a')](_0x10ce('0x80'));return{'id':_0x16965a[_0x10ce('0x43')][0x0]['details']['id']};}})[_0x10ce('0x2e')](function(_0x195b48){logger['info'](_0x10ce('0x81'),_0x195b48['stack']);console['log'](_0x10ce('0x81'),_0x195b48);});}exports['queue']=function(_0x24720e,_0x5d59aa,_0x43a41d,_0x97ed3a,_0x58829e,_0x3bd620){var _0x497582,_0x2ca229,_0x4fbf66;_0x3bd620[_0x10ce('0x82')]=intUtil[_0x10ce('0x83')](_0x3bd620[_0x10ce('0x82')]);_0x3bd620[_0x10ce('0x84')]=intUtil['stripTrailingSlash'](_0x3bd620[_0x10ce('0x84')]);if(_0x58829e&&_0x58829e[_0x10ce('0x85')]){logger[_0x10ce('0x3a')]('[QUEUE]','Recording\x20is\x20enabled!');_0x5d59aa[_0x10ce('0x86')]=_0x3bd620[_0x10ce('0x84')]+_0x10ce('0x87')+_0x5d59aa[_0x10ce('0x88')]+_0x10ce('0x89')+md5(_0x5d59aa['uniqueid']);}else{_0x5d59aa[_0x10ce('0x86')]='';}var _0x241f59=_0x3bd620[_0x10ce('0x82')]===_0x10ce('0x8a')?'eu':_0x10ce('0x8b');return getAccessToken(_0x3bd620)['then'](function(_0x317706){_0x4fbf66=_0x317706;return getUser(_0x4fbf66,_0x241f59,_0x3bd620,_0x97ed3a[_0x10ce('0x39')]);})[_0x10ce('0x2c')](function(_0x29f521){_0x497582=_0x29f521;logger[_0x10ce('0x3a')]('The\x20User\x20ID\x20is:',_0x497582['id']);return getEndUser(_0x4fbf66,_0x241f59,_0x3bd620,_0x5d59aa[_0x10ce('0x8c')],_0x5d59aa['calleridnum'],_0x497582,_0x43a41d);})['then'](function(_0x1acb96){_0x2ca229=_0x1acb96;return getCall(_0x4fbf66,_0x241f59,_0x3bd620,_0x497582,_0x2ca229,_0x43a41d,_0x5d59aa,_0x10ce('0x7d'));})[_0x10ce('0x2c')](function(_0x2aa4a4){if(_0x2aa4a4){logger['info'](_0x10ce('0x8d'),_0x2aa4a4['id']);logger[_0x10ce('0x3a')](_0x10ce('0x8e'),_0x10ce('0x8f'));emit(util[_0x10ce('0x33')](_0x10ce('0x90'),_0x97ed3a[_0x10ce('0x1b')]),_0x10ce('0x91'),{'uri':_0x10ce('0x92')+_0x3bd620[_0x10ce('0x82')]+_0x10ce('0x93')+_0x2aa4a4['id']});}})[_0x10ce('0x2e')](function(_0x20fa31){logger['error'](_0x10ce('0x8e'),JSON[_0x10ce('0xe')](_0x20fa31));});};exports[_0x10ce('0x7a')]=function(_0x415f58,_0x2922f5,_0x3bec92,_0x3a0c6a,_0x559b3b,_0x450a29,_0x5d0936){var _0x30f06c,_0x2fc9ae,_0x1bd6db;_0x450a29['host']=intUtil[_0x10ce('0x83')](_0x450a29[_0x10ce('0x82')]);_0x450a29['serverUrl']=intUtil[_0x10ce('0x83')](_0x450a29[_0x10ce('0x84')]);if(_0x5d0936&&_0x5d0936[_0x10ce('0x94')]&&_0x5d0936[_0x10ce('0x94')]!=='none'){logger[_0x10ce('0x3a')]('[OUTBOUND]',_0x10ce('0x95'));_0x2922f5[_0x10ce('0x86')]=_0x450a29[_0x10ce('0x84')]+_0x10ce('0x87')+_0x2922f5[_0x10ce('0x88')]+_0x10ce('0x89')+md5(_0x2922f5[_0x10ce('0x88')]);}var _0x59da0e=_0x450a29[_0x10ce('0x82')]===_0x10ce('0x8a')?'eu':'com';return getAccessToken(_0x450a29)[_0x10ce('0x2c')](function(_0x84914c){_0x1bd6db=_0x84914c;return getUser(_0x1bd6db,_0x59da0e,_0x450a29,_0x3a0c6a['email']);})[_0x10ce('0x2c')](function(_0x25518b){_0x30f06c=_0x25518b;logger['info'](_0x10ce('0x96'),_0x30f06c['id']);return getEndUser(_0x1bd6db,_0x59da0e,_0x450a29,_0x2922f5[_0x10ce('0x97')],_0x2922f5['destcalleridnum'],_0x30f06c,_0x3bec92);})[_0x10ce('0x2c')](function(_0x372936){_0x2fc9ae=_0x372936;return getCall(_0x1bd6db,_0x59da0e,_0x450a29,_0x30f06c,_0x2fc9ae,_0x3bec92,_0x2922f5,'Outbound');})[_0x10ce('0x2c')](function(_0x25fee1){if(_0x25fee1){logger[_0x10ce('0x3a')](_0x10ce('0x8d'),_0x25fee1['id']);logger[_0x10ce('0x3a')](_0x10ce('0x98'),_0x10ce('0x8f'));emit(util[_0x10ce('0x33')]('user:%s',_0x3a0c6a['name']),_0x10ce('0x91'),{'uri':_0x10ce('0x92')+_0x450a29['host']+_0x10ce('0x93')+_0x25fee1['id']});}})[_0x10ce('0x2e')](function(_0xef745f){logger[_0x10ce('0x42')](_0x10ce('0x98'),JSON['stringify'](_0xef745f));});};exports[_0x10ce('0x99')]=function(_0x9b5360,_0x23fec6,_0x312b23,_0x344a30,_0x4ffab4,_0x5efd49){var _0x380a25,_0x4a43c2,_0x51d97e;_0x5efd49[_0x10ce('0x82')]=intUtil[_0x10ce('0x83')](_0x5efd49[_0x10ce('0x82')]);_0x5efd49[_0x10ce('0x84')]=intUtil['stripTrailingSlash'](_0x5efd49[_0x10ce('0x84')]);if(_0x4ffab4&&_0x4ffab4[_0x10ce('0x85')]){logger[_0x10ce('0x3a')]('['+_0x23fec6[_0x10ce('0x6e')][_0x10ce('0x9a')]()+']',_0x10ce('0x95'));_0x23fec6[_0x10ce('0x86')]=_0x5efd49[_0x10ce('0x84')]+'/api/voice/recordings/'+_0x23fec6[_0x10ce('0x88')]+'/downloads?type=uniqueid&token='+md5(_0x23fec6[_0x10ce('0x88')]);}else{_0x23fec6[_0x10ce('0x86')]='';}var _0x2a8a7a=_0x5efd49[_0x10ce('0x82')]===_0x10ce('0x8a')?'eu':'com';return getAccessToken(_0x5efd49)[_0x10ce('0x2c')](function(_0x1432a1){_0x51d97e=_0x1432a1;return getUser(_0x51d97e,_0x2a8a7a,_0x5efd49);})[_0x10ce('0x2c')](function(_0xaa2f77){_0x380a25=_0xaa2f77;logger[_0x10ce('0x3a')](_0x10ce('0x96'),_0x380a25['id']);return getEndUser(_0x51d97e,_0x2a8a7a,_0x5efd49,_0x23fec6[_0x10ce('0x8c')],_0x23fec6['calleridnum'],_0x380a25,_0x312b23);})[_0x10ce('0x2c')](function(_0x3c4315){_0x4a43c2=_0x3c4315;return getCall(_0x51d97e,_0x2a8a7a,_0x5efd49,_0x380a25,_0x4a43c2,_0x312b23,_0x23fec6,_0x10ce('0x7d'));})[_0x10ce('0x2c')](function(_0x3a052f){if(_0x3a052f){logger['info']('The\x20Call\x20ID\x20is:',_0x3a052f['id']);}})[_0x10ce('0x2e')](function(_0x260aa1){logger[_0x10ce('0x42')]('['+_0x23fec6[_0x10ce('0x6e')][_0x10ce('0x9a')]()+']',JSON[_0x10ce('0xe')](_0x260aa1));});}; \ 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 af369e9..7561e5f 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 _0x5a8a=['mustache','../../../../config/logger','trigger','exec','Script','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0x5a8a,0xdc));var _0xa5a8=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5a8a[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0xa5a8('0x0'));var sh=require('shelljs');var Mustache=require(_0xa5a8('0x1'));var logger=require(_0xa5a8('0x2'))(_0xa5a8('0x3'));exports[_0xa5a8('0x4')]=function(_0x3f02bf,_0x230f68){var _0x16011c=_0x3f02bf['data2']?_0x3f02bf['data2']:_0xa5a8('0x5');var _0x5cfbeb=_0x3f02bf['data3']?Mustache[_0xa5a8('0x6')](_0x3f02bf[_0xa5a8('0x7')],_0x230f68):_0x230f68;sh[_0xa5a8('0x4')](_0x5cfbeb,function(_0x5532c5,_0x406f27,_0x16c7a3){if(_0x5532c5!==0x0){logger[_0xa5a8('0x8')](util[_0xa5a8('0x9')](_0xa5a8('0xa'),_0x16011c,_0x5cfbeb,_0x5532c5,_0x16c7a3));}else{logger[_0xa5a8('0xb')](util[_0xa5a8('0x9')](_0xa5a8('0xc'),_0x16011c,_0x5cfbeb,_0x406f27));}});}; \ No newline at end of file +var _0xd6f7=['trigger','exec','data2','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','mustache','../../../../config/logger'];(function(_0x37ed15,_0x453b04){var _0x21d877=function(_0x8253b){while(--_0x8253b){_0x37ed15['push'](_0x37ed15['shift']());}};_0x21d877(++_0x453b04);}(_0xd6f7,0x6c));var _0x7d6f=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xd6f7[_0x5d4607];return _0x5e4a86;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require(_0x7d6f('0x0'));var logger=require(_0x7d6f('0x1'))(_0x7d6f('0x2'));exports[_0x7d6f('0x3')]=function(_0x1012a7,_0x56d2ab){var _0x1f1e9c=_0x1012a7[_0x7d6f('0x4')]?_0x1012a7[_0x7d6f('0x4')]:'Script';var _0x5c9813=_0x1012a7[_0x7d6f('0x5')]?Mustache['render'](_0x1012a7[_0x7d6f('0x5')],_0x56d2ab):_0x56d2ab;sh[_0x7d6f('0x3')](_0x5c9813,function(_0x2260c1,_0x57d9c6,_0x202b24){if(_0x2260c1!==0x0){logger[_0x7d6f('0x6')](util[_0x7d6f('0x7')](_0x7d6f('0x8'),_0x1f1e9c,_0x5c9813,_0x2260c1,_0x202b24));}else{logger['info'](util[_0x7d6f('0x7')](_0x7d6f('0x9'),_0x1f1e9c,_0x5c9813,_0x57d9c6));}});}; \ 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 4746e37..2e69377 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 _0x32f8=['object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','parse','data6','stack','GET','POST','PUT','data7','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','isNil',',\x20request\x20body:\x20','body'];(function(_0x56d1b7,_0x1d88f5){var _0x184d91=function(_0x123bdb){while(--_0x123bdb){_0x56d1b7['push'](_0x56d1b7['shift']());}};_0x184d91(++_0x1d88f5);}(_0x32f8,0x15c));var _0x832f=function(_0x30e6f9,_0x4d9281){_0x30e6f9=_0x30e6f9-0x0;var _0x50e68c=_0x32f8[_0x30e6f9];return _0x50e68c;};'use strict';var rp=require(_0x832f('0x0'));var util=require(_0x832f('0x1'));var _=require('lodash');var Mustache=require('mustache');var logger=require(_0x832f('0x2'))(_0x832f('0x3'));exports[_0x832f('0x4')]=function(_0x5c08f7,_0xc48a83){var _0x2f3ddf,_0x131f02;var _0x9e90ff={'method':_0x5c08f7[_0x832f('0x5')][_0x832f('0x6')](),'uri':Mustache[_0x832f('0x7')](_0x5c08f7[_0x832f('0x8')],_0xc48a83),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5c08f7[_0x832f('0x9')])===_0x832f('0xa')&&parseInt(_0x5c08f7['data5'])>=0x1&&parseInt(_0x5c08f7[_0x832f('0x9')])<=0xa?parseInt(_0x5c08f7['data5'])*0x3e8:0x5*0x3e8};try{_0x9e90ff[_0x832f('0xb')]=_0x5c08f7['data6']?JSON[_0x832f('0xc')](Mustache[_0x832f('0x7')](_0x5c08f7[_0x832f('0xd')],_0xc48a83)):{};}catch(_0x8a720e){logger['error'](_0x8a720e[_0x832f('0xe')]);}switch(_0x5c08f7['data1']['toUpperCase']()){case _0x832f('0xf'):case'DELETE':_0x2f3ddf=null;_0x9e90ff['qs']=_0xc48a83;break;case _0x832f('0x10'):case _0x832f('0x11'):if(_0x5c08f7[_0x832f('0x12')]){try{_0x2f3ddf=JSON[_0x832f('0xc')](Mustache['render'](_0x5c08f7[_0x832f('0x12')],_0xc48a83));_0x9e90ff['body']=_0x2f3ddf;}catch(_0x47af60){logger[_0x832f('0x13')](_0x47af60[_0x832f('0xe')]);logger['error'](_0x832f('0x14'));}}else{_0x2f3ddf=_0xc48a83;_0x9e90ff['body']=_0x2f3ddf;}break;}logger['info'](util[_0x832f('0x15')](_0x832f('0x16'),_0x5c08f7[_0x832f('0x5')],_0x5c08f7[_0x832f('0x8')],JSON['stringify'](_0x9e90ff)));rp(_0x9e90ff)['then'](function(_0x1931bc){_0x2f3ddf=!_[_0x832f('0x17')](_0x2f3ddf)?_0x832f('0x18')+_0x2f3ddf:'';_0x131f02=typeof _0x1931bc[_0x832f('0x19')]===_0x832f('0x1a')?JSON[_0x832f('0x1b')](_0x1931bc[_0x832f('0x19')]):_0x1931bc[_0x832f('0x19')];logger['info'](util[_0x832f('0x15')](_0x832f('0x1c'),_0x5c08f7[_0x832f('0x5')],_0x5c08f7[_0x832f('0x8')],_0x1931bc[_0x832f('0x1d')],_0x131f02));})[_0x832f('0x1e')](function(_0x7915f1){logger['error'](util['format'](_0x832f('0x1f'),_0x5c08f7[_0x832f('0x5')],_0x5c08f7[_0x832f('0x8')],_0x7915f1[_0x832f('0x1d')],_0x7915f1[_0x832f('0x20')],_0x7915f1[_0x832f('0x21')]));});}; \ No newline at end of file +var _0xe6cb=['%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','data1','message','lodash','mustache','../../../../config/logger','trigger','exec','toUpperCase','render','data2','data5','headers','data6','parse','error','GET','DELETE','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch'];(function(_0x45f79,_0x415134){var _0x21e0e3=function(_0x24aef7){while(--_0x24aef7){_0x45f79['push'](_0x45f79['shift']());}};_0x21e0e3(++_0x415134);}(_0xe6cb,0x183));var _0xbe6c=function(_0x17277b,_0x3a4d5e){_0x17277b=_0x17277b-0x0;var _0x4fe312=_0xe6cb[_0x17277b];return _0x4fe312;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0xbe6c('0x0'));var Mustache=require(_0xbe6c('0x1'));var logger=require(_0xbe6c('0x2'))(_0xbe6c('0x3'));exports[_0xbe6c('0x4')]=function(_0x47ffef,_0x31f436){var _0x15245e,_0x1e00d9;var _0x2ea797={'method':_0x47ffef['data1'][_0xbe6c('0x5')](),'uri':Mustache[_0xbe6c('0x6')](_0x47ffef[_0xbe6c('0x7')],_0x31f436),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x47ffef[_0xbe6c('0x8')])==='number'&&parseInt(_0x47ffef[_0xbe6c('0x8')])>=0x1&&parseInt(_0x47ffef[_0xbe6c('0x8')])<=0xa?parseInt(_0x47ffef[_0xbe6c('0x8')])*0x3e8:0x5*0x3e8};try{_0x2ea797[_0xbe6c('0x9')]=_0x47ffef[_0xbe6c('0xa')]?JSON[_0xbe6c('0xb')](Mustache[_0xbe6c('0x6')](_0x47ffef['data6'],_0x31f436)):{};}catch(_0x330ad9){logger[_0xbe6c('0xc')](_0x330ad9['stack']);}switch(_0x47ffef['data1'][_0xbe6c('0x5')]()){case _0xbe6c('0xd'):case _0xbe6c('0xe'):_0x15245e=null;_0x2ea797['qs']=_0x31f436;break;case'POST':case'PUT':if(_0x47ffef[_0xbe6c('0xf')]){try{_0x15245e=JSON[_0xbe6c('0xb')](Mustache['render'](_0x47ffef['data7'],_0x31f436));_0x2ea797[_0xbe6c('0x10')]=_0x15245e;}catch(_0x1ba52d){logger[_0xbe6c('0xc')](_0x1ba52d[_0xbe6c('0x11')]);logger[_0xbe6c('0xc')](_0xbe6c('0x12'));}}else{_0x15245e=_0x31f436;_0x2ea797['body']=_0x15245e;}break;}logger[_0xbe6c('0x13')](util['format'](_0xbe6c('0x14'),_0x47ffef['data1'],_0x47ffef[_0xbe6c('0x7')],JSON[_0xbe6c('0x15')](_0x2ea797)));rp(_0x2ea797)[_0xbe6c('0x16')](function(_0x46ebf5){_0x15245e=!_['isNil'](_0x15245e)?_0xbe6c('0x17')+_0x15245e:'';_0x1e00d9=typeof _0x46ebf5[_0xbe6c('0x10')]===_0xbe6c('0x18')?JSON[_0xbe6c('0x15')](_0x46ebf5['body']):_0x46ebf5[_0xbe6c('0x10')];logger[_0xbe6c('0x13')](util[_0xbe6c('0x19')](_0xbe6c('0x1a'),_0x47ffef['data1'],_0x47ffef[_0xbe6c('0x7')],_0x46ebf5[_0xbe6c('0x1b')],_0x1e00d9));})[_0xbe6c('0x1c')](function(_0xe0bbd0){logger['error'](util[_0xbe6c('0x19')](_0xbe6c('0x1d'),_0x47ffef[_0xbe6c('0x1e')],_0x47ffef[_0xbe6c('0x7')],_0xe0bbd0['statusCode'],_0xe0bbd0['name'],_0xe0bbd0[_0xbe6c('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 8068b06..b8d9b98 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 _0x4a4c=['rpc','routing','error','message','result','catch','jayson/promise','bluebird','client','http','Request','debug'];(function(_0x4af2f,_0x1fe72c){var _0x558226=function(_0x7c99e1){while(--_0x7c99e1){_0x4af2f['push'](_0x4af2f['shift']());}};_0x558226(++_0x1fe72c);}(_0x4a4c,0x8a));var _0xc4a4=function(_0x25398f,_0x54cf2f){_0x25398f=_0x25398f-0x0;var _0x49f9c8=_0x4a4c[_0x25398f];return _0x49f9c8;};'use strict';var jayson=require(_0xc4a4('0x0'));var BPromise=require(_0xc4a4('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0xc4a4('0x2')][_0xc4a4('0x3')]({'port':0x2329});client[_0xc4a4('0x4')]=function(_0x4d966d,_0x177913){return new BPromise(function(_0x56660a,_0x480f98){return client['request'](_0x4d966d,_0x177913)['then'](function(_0x3e82a6){logger[_0xc4a4('0x5')](_0xc4a4('0x6'),_0xc4a4('0x7'),_0x4d966d,_0x177913,_0x3e82a6);if(_0x3e82a6[_0xc4a4('0x8')]){logger[_0xc4a4('0x8')]('rpc',_0xc4a4('0x7'),_0x4d966d,_0x3e82a6[_0xc4a4('0x8')][_0xc4a4('0x9')],_0x177913);return _0x480f98(_0x3e82a6[_0xc4a4('0x8')][_0xc4a4('0x9')]);}else{return _0x56660a(_0x3e82a6[_0xc4a4('0xa')]);}})[_0xc4a4('0xb')](function(_0x3e5543){logger[_0xc4a4('0x8')](_0xc4a4('0x6'),_0xc4a4('0x7'),_0x4d966d,_0x3e5543,_0x177913);return _0x480f98(_0x3e5543);});});};module['exports']=client; \ No newline at end of file +var _0x1f94=['exports','jayson/promise','bluebird','../../config/logger','routing','client','http','then','debug','error','rpc','message','result','catch'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1f94,0x71));var _0x41f9=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x1f94[_0xfae23b];return _0x200640;};'use strict';var jayson=require(_0x41f9('0x0'));var BPromise=require(_0x41f9('0x1'));var logger=require(_0x41f9('0x2'))(_0x41f9('0x3'));var client=jayson[_0x41f9('0x4')][_0x41f9('0x5')]({'port':0x2329});client['Request']=function(_0x3433dd,_0x10b1be){return new BPromise(function(_0x561abf,_0x29844b){return client['request'](_0x3433dd,_0x10b1be)[_0x41f9('0x6')](function(_0x539444){logger[_0x41f9('0x7')]('rpc',_0x41f9('0x3'),_0x3433dd,_0x10b1be,_0x539444);if(_0x539444['error']){logger[_0x41f9('0x8')](_0x41f9('0x9'),_0x41f9('0x3'),_0x3433dd,_0x539444[_0x41f9('0x8')]['message'],_0x10b1be);return _0x29844b(_0x539444[_0x41f9('0x8')][_0x41f9('0xa')]);}else{return _0x561abf(_0x539444[_0x41f9('0xb')]);}})[_0x41f9('0xc')](function(_0x5445d3){logger['error'](_0x41f9('0x9'),_0x41f9('0x3'),_0x3433dd,_0x5445d3,_0x10b1be);return _0x29844b(_0x5445d3);});});};module[_0x41f9('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 84d9ffa..adcd217 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 _0xa76c=['refresh','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','initMailAccounts'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xa76c,0x106));var _0xca76=function(_0x9edfd5,_0x286486){_0x9edfd5=_0x9edfd5-0x0;var _0x330738=_0xa76c[_0x9edfd5];return _0x330738;};'use strict';var server=require(_0xca76('0x0'));var Realtime=require(_0xca76('0x1'));var EmailChannel=require(_0xca76('0x2'));var mailAccount=require(_0xca76('0x3'));var setting=require(_0xca76('0x4'));var logger=require(_0xca76('0x5'))(_0xca76('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xca76('0x7')]()[_0xca76('0x8')](mailAccount['getMailAccounts']())[_0xca76('0x8')](realtime[_0xca76('0x9')]())['then'](function(){email[_0xca76('0xa')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xca76('0xb')](realtime,email)['then'](function(){return initRealtime();})[_0xca76('0x8')](function(){return setting[_0xca76('0xc')]();})[_0xca76('0x8')](function(_0x11c815){return setInterval(initRealtime,_0x11c815[_0xca76('0xd')]*0x3e8);})[_0xca76('0xe')](function(_0xd37f5a){logger[_0xca76('0xf')](_0xca76('0x10'),_0xd37f5a);});}main(); \ No newline at end of file +var _0x7d3c=['../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','catch','error','./realtime','./lib/email','./rpc/setting'];(function(_0x4231a5,_0x154b7a){var _0x1c783c=function(_0x22b944){while(--_0x22b944){_0x4231a5['push'](_0x4231a5['shift']());}};_0x1c783c(++_0x154b7a);}(_0x7d3c,0x1dd));var _0xc7d3=function(_0x46aaaa,_0x1078ea){_0x46aaaa=_0x46aaaa-0x0;var _0x4ff218=_0x7d3c[_0x46aaaa];return _0x4ff218;};'use strict';var server=require('./server');var Realtime=require(_0xc7d3('0x0'));var EmailChannel=require(_0xc7d3('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xc7d3('0x2'));var logger=require(_0xc7d3('0x3'))(_0xc7d3('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xc7d3('0x5')]()[_0xc7d3('0x6')](mailAccount[_0xc7d3('0x7')]())[_0xc7d3('0x6')](realtime[_0xc7d3('0x8')]())[_0xc7d3('0x6')](function(){email[_0xc7d3('0x9')](realtime[_0xc7d3('0xa')]);return realtime;});}function main(){return server[_0xc7d3('0xb')](realtime,email)[_0xc7d3('0x6')](function(){return initRealtime();})[_0xc7d3('0x6')](function(){return setting[_0xc7d3('0xc')]();})['then'](function(_0x4c176b){return setInterval(initRealtime,_0x4c176b['loginMailFrequency']*0x3e8);})[_0xc7d3('0xd')](function(_0x6ab7e2){logger[_0xc7d3('0xe')]('Email\x20service\x20initialization',_0x6ab7e2);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 6be408b..32e907a 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 _0xd350=['Imap','messageStatus','total','isNil','stringify','prototype','refresh','service','provider','custom','box','handleImapBox','bind','end','error','status','disabled','connected','messages','handleImapEmail','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','name','key','active'];(function(_0x4e9f82,_0x5395c2){var _0x2d0a0e=function(_0x5ca0fa){while(--_0x5ca0fa){_0x4e9f82['push'](_0x4e9f82['shift']());}};_0x2d0a0e(++_0x5395c2);}(_0xd350,0x105));var _0x0d35=function(_0x381372,_0xf0a5a){_0x381372=_0x381372-0x0;var _0x4e959a=_0xd350[_0x381372];return _0x4e959a;};'use strict';var _=require(_0x0d35('0x0'));var moment=require(_0x0d35('0x1'));var BPromise=require(_0x0d35('0x2'));var md5=require(_0x0d35('0x3'));var Redis=require(_0x0d35('0x4'));var config=require(_0x0d35('0x5'));var logger=require(_0x0d35('0x6'))(_0x0d35('0x7'));config[_0x0d35('0x8')]=_[_0x0d35('0x9')](config[_0x0d35('0x8')],{'host':_0x0d35('0xa'),'port':0x18eb});var io=require(_0x0d35('0xb'))(new Redis(config[_0x0d35('0x8')]));var EmailImap=require(_0x0d35('0xc'));var EmailSmtp=require(_0x0d35('0xd'));var mailAccount=require(_0x0d35('0xe'));var md5Accounts={};function EmailChannel(_0x1ce2fb){logger[_0x0d35('0xf')](_0x0d35('0x10'));this[_0x0d35('0x11')]=_0x1ce2fb[_0x0d35('0x11')];this[_0x0d35('0x12')]={};this[_0x0d35('0x13')]=new EmailSmtp();}EmailChannel['prototype'][_0x0d35('0x14')]=function(_0x22cd5f){var _0x282f77=this[_0x0d35('0x11')][_0x22cd5f];var _0x713084={'id':_0x282f77['id'],'name':_0x282f77[_0x0d35('0x15')],'key':_0x282f77[_0x0d35('0x16')],'active':_0x282f77[_0x0d35('0x17')],'Imap':{'status':_0x282f77[_0x0d35('0x18')]['status'],'messageStatus':_0x282f77[_0x0d35('0x18')][_0x0d35('0x19')],'total':_0x282f77['Imap'][_0x0d35('0x1a')]}};if(_[_0x0d35('0x1b')](md5Accounts[_0x22cd5f])){md5Accounts[_0x22cd5f]={};}var _0x3ff00f=md5(JSON[_0x0d35('0x1c')](_0x713084));if(md5Accounts[_0x22cd5f]['md5']!==_0x3ff00f){md5Accounts[_0x22cd5f][_0x0d35('0x3')]=_0x3ff00f;io[_0x0d35('0x14')]('mailAccount:update',_0x713084);}};EmailChannel[_0x0d35('0x1d')][_0x0d35('0x1e')]=function(_0x11fbf5){for(var _0xeb95a4 in _0x11fbf5){if(_0x11fbf5['hasOwnProperty'](_0xeb95a4)){if(_0x11fbf5[_0xeb95a4][_0x0d35('0x18')]&&_0x11fbf5[_0xeb95a4]['active']){var _0xc49700=_0x11fbf5[_0xeb95a4][_0x0d35('0x18')];if(!_0xc49700[_0x0d35('0x1f')]&&_0x11fbf5[_0xeb95a4][_0x0d35('0x20')]!==_0x0d35('0x21'))_0xc49700[_0x0d35('0x1f')]=_0x11fbf5[_0xeb95a4][_0x0d35('0x20')];if(!this['imapAccounts']['hasOwnProperty'](_0xc49700['id'])){this[_0x0d35('0x12')][_0xc49700['id']]=new EmailImap(_0xc49700,_0x11fbf5[_0xeb95a4]['email']);this['imapAccounts'][_0xc49700['id']]['on'](_0x0d35('0x22'),this[_0x0d35('0x23')][_0x0d35('0x24')](this,_0xeb95a4));this[_0x0d35('0x12')][_0xc49700['id']]['on'](_0x0d35('0x7'),this['handleImapEmail'][_0x0d35('0x24')](this,_0xeb95a4));this[_0x0d35('0x12')][_0xc49700['id']]['on'](_0x0d35('0x25'),this['handleImapEnd']['bind'](this,_0xeb95a4));this[_0x0d35('0x12')][_0xc49700['id']]['on'](_0x0d35('0x26'),this['handleImapError']['bind'](this,_0xeb95a4));}}else{if(_[_0x0d35('0x1b')](this[_0x0d35('0x11')][_0xeb95a4][_0x0d35('0x18')])){this[_0x0d35('0x11')][_0xeb95a4][_0x0d35('0x18')]={};}this[_0x0d35('0x11')][_0xeb95a4][_0x0d35('0x18')][_0x0d35('0x27')]=_0x0d35('0x28');this['mailAccounts'][_0xeb95a4][_0x0d35('0x18')][_0x0d35('0x19')]='';this[_0x0d35('0x14')](_0xeb95a4);}}}};EmailChannel[_0x0d35('0x1d')][_0x0d35('0x23')]=function(_0x48bba2,_0xc150d2){if(this['mailAccounts'][_0x48bba2]){this[_0x0d35('0x11')][_0x48bba2][_0x0d35('0x18')]['status']=_0x0d35('0x29');this[_0x0d35('0x11')][_0x48bba2][_0x0d35('0x18')][_0x0d35('0x19')]=_0xc150d2[_0x0d35('0x15')];if(_0xc150d2[_0x0d35('0x2a')]){this[_0x0d35('0x11')][_0x48bba2][_0x0d35('0x18')]['total']=_0xc150d2[_0x0d35('0x2a')][_0x0d35('0x1a')];}return this[_0x0d35('0x14')](_0x48bba2);}};EmailChannel[_0x0d35('0x1d')][_0x0d35('0x2b')]=function(_0x22e717,_0x25daa3){logger[_0x0d35('0xf')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x25daa3[_0x0d35('0x2c')],_0x25daa3[_0x0d35('0x2d')],_0x25daa3['from'],_0x22e717);if(this[_0x0d35('0x11')][_0x22e717]){return mailAccount[_0x0d35('0x2e')](_0x22e717,_0x25daa3)[_0x0d35('0x2f')](function(_0x49b898){if(_0x49b898){logger[_0x0d35('0xf')](_0x0d35('0x30'));}})[_0x0d35('0x31')](function(_0x2f5aae){logger[_0x0d35('0x26')](_0x0d35('0x32'),JSON[_0x0d35('0x1c')](_0x2f5aae));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x3c7154){if(this['mailAccounts'][_0x3c7154]&&this[_0x0d35('0x11')][_0x3c7154]['Imap']){if(this[_0x0d35('0x12')][this['mailAccounts'][_0x3c7154]['Imap']['id']]){delete this[_0x0d35('0x12')][this['mailAccounts'][_0x3c7154][_0x0d35('0x18')]['id']];}this[_0x0d35('0x11')][_0x3c7154][_0x0d35('0x18')]['lastSync']=moment();this[_0x0d35('0x14')](_0x3c7154);}};EmailChannel[_0x0d35('0x1d')]['handleImapError']=function(_0x1304d5,_0x289011){if(this[_0x0d35('0x11')][_0x1304d5]){this[_0x0d35('0x11')][_0x1304d5][_0x0d35('0x18')]['status']=_0x0d35('0x26');this[_0x0d35('0x11')][_0x1304d5][_0x0d35('0x18')][_0x0d35('0x19')]=_0x289011;return this[_0x0d35('0x14')](_0x1304d5);}};EmailChannel[_0x0d35('0x1d')][_0x0d35('0x33')]=function(_0x29d6e5,_0x2e2353){return this[_0x0d35('0x13')][_0x0d35('0x34')](_0x29d6e5,_0x2e2353);};EmailChannel['prototype']['verifySmtp']=function(_0x1abebe){var _0x11c22e=this;if(this[_0x0d35('0x11')][_0x1abebe['id']]){if(_[_0x0d35('0x1b')](this[_0x0d35('0x11')][_0x1abebe['id']][_0x0d35('0x35')])){this[_0x0d35('0x11')][_0x1abebe['id']][_0x0d35('0x35')]={};}this[_0x0d35('0x11')][_0x1abebe['id']][_0x0d35('0x35')]['lastSync']=moment();return new BPromise(function(_0xbed526,_0x5139d1){return _0x11c22e[_0x0d35('0x13')][_0x0d35('0x36')](_0x1abebe)[_0x0d35('0x2f')](function(_0x340ca1){_0x11c22e[_0x0d35('0x11')][_0x1abebe['id']][_0x0d35('0x35')]['status']=_0x0d35('0x37');_0x11c22e[_0x0d35('0x11')][_0x1abebe['id']][_0x0d35('0x35')][_0x0d35('0x19')]='';_0x11c22e[_0x0d35('0x14')](_0x1abebe['id']);_0xbed526(_0x340ca1);})[_0x0d35('0x31')](function(_0x251705){_0x11c22e[_0x0d35('0x11')][_0x1abebe['id']][_0x0d35('0x35')]['status']=_0x0d35('0x26');_0x11c22e[_0x0d35('0x11')][_0x1abebe['id']]['Smtp']['messageStatus']=_0x251705;_0x11c22e['emit'](_0x1abebe['id']);_0x5139d1(_0x251705);});});}return this[_0x0d35('0x13')][_0x0d35('0x36')](_0x1abebe);};module[_0x0d35('0x38')]=EmailChannel; \ No newline at end of file +var _0x7b6b=['../../../config/environment','../../../config/logger','email','redis','defaults','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','mailAccount:update','refresh','hasOwnProperty','service','provider','box','handleImapBox','bind','handleImapEmail','error','handleImapError','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','send','isNil','Smtp','verify','verified','lodash','bluebird','md5','ioredis'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x7b6b,0x16f));var _0xb7b6=function(_0x1a18e9,_0x319607){_0x1a18e9=_0x1a18e9-0x0;var _0x148e6b=_0x7b6b[_0x1a18e9];return _0x148e6b;};'use strict';var _=require(_0xb7b6('0x0'));var moment=require('moment');var BPromise=require(_0xb7b6('0x1'));var md5=require(_0xb7b6('0x2'));var Redis=require(_0xb7b6('0x3'));var config=require(_0xb7b6('0x4'));var logger=require(_0xb7b6('0x5'))(_0xb7b6('0x6'));config[_0xb7b6('0x7')]=_[_0xb7b6('0x8')](config[_0xb7b6('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb7b6('0x7')]));var EmailImap=require(_0xb7b6('0x9'));var EmailSmtp=require(_0xb7b6('0xa'));var mailAccount=require(_0xb7b6('0xb'));var md5Accounts={};function EmailChannel(_0x55e961){logger[_0xb7b6('0xc')]('start\x20email\x20channel');this['mailAccounts']=_0x55e961[_0xb7b6('0xd')];this[_0xb7b6('0xe')]={};this[_0xb7b6('0xf')]=new EmailSmtp();}EmailChannel[_0xb7b6('0x10')][_0xb7b6('0x11')]=function(_0x3c3dd5){var _0x3ece3b=this[_0xb7b6('0xd')][_0x3c3dd5];var _0x150b9b={'id':_0x3ece3b['id'],'name':_0x3ece3b[_0xb7b6('0x12')],'key':_0x3ece3b[_0xb7b6('0x13')],'active':_0x3ece3b[_0xb7b6('0x14')],'Imap':{'status':_0x3ece3b[_0xb7b6('0x15')][_0xb7b6('0x16')],'messageStatus':_0x3ece3b[_0xb7b6('0x15')][_0xb7b6('0x17')],'total':_0x3ece3b[_0xb7b6('0x15')][_0xb7b6('0x18')]}};if(_['isNil'](md5Accounts[_0x3c3dd5])){md5Accounts[_0x3c3dd5]={};}var _0x2a7ef5=md5(JSON['stringify'](_0x150b9b));if(md5Accounts[_0x3c3dd5][_0xb7b6('0x2')]!==_0x2a7ef5){md5Accounts[_0x3c3dd5][_0xb7b6('0x2')]=_0x2a7ef5;io[_0xb7b6('0x11')](_0xb7b6('0x19'),_0x150b9b);}};EmailChannel['prototype'][_0xb7b6('0x1a')]=function(_0x2d1b2f){for(var _0x4f01c4 in _0x2d1b2f){if(_0x2d1b2f[_0xb7b6('0x1b')](_0x4f01c4)){if(_0x2d1b2f[_0x4f01c4][_0xb7b6('0x15')]&&_0x2d1b2f[_0x4f01c4]['active']){var _0x3e4a2d=_0x2d1b2f[_0x4f01c4][_0xb7b6('0x15')];if(!_0x3e4a2d[_0xb7b6('0x1c')]&&_0x2d1b2f[_0x4f01c4][_0xb7b6('0x1d')]!=='custom')_0x3e4a2d[_0xb7b6('0x1c')]=_0x2d1b2f[_0x4f01c4][_0xb7b6('0x1d')];if(!this['imapAccounts'][_0xb7b6('0x1b')](_0x3e4a2d['id'])){this[_0xb7b6('0xe')][_0x3e4a2d['id']]=new EmailImap(_0x3e4a2d,_0x2d1b2f[_0x4f01c4][_0xb7b6('0x6')]);this[_0xb7b6('0xe')][_0x3e4a2d['id']]['on'](_0xb7b6('0x1e'),this[_0xb7b6('0x1f')][_0xb7b6('0x20')](this,_0x4f01c4));this['imapAccounts'][_0x3e4a2d['id']]['on']('email',this[_0xb7b6('0x21')][_0xb7b6('0x20')](this,_0x4f01c4));this['imapAccounts'][_0x3e4a2d['id']]['on']('end',this['handleImapEnd'][_0xb7b6('0x20')](this,_0x4f01c4));this['imapAccounts'][_0x3e4a2d['id']]['on'](_0xb7b6('0x22'),this[_0xb7b6('0x23')][_0xb7b6('0x20')](this,_0x4f01c4));}}else{if(_['isNil'](this['mailAccounts'][_0x4f01c4][_0xb7b6('0x15')])){this[_0xb7b6('0xd')][_0x4f01c4][_0xb7b6('0x15')]={};}this[_0xb7b6('0xd')][_0x4f01c4][_0xb7b6('0x15')][_0xb7b6('0x16')]=_0xb7b6('0x24');this[_0xb7b6('0xd')][_0x4f01c4][_0xb7b6('0x15')][_0xb7b6('0x17')]='';this[_0xb7b6('0x11')](_0x4f01c4);}}}};EmailChannel[_0xb7b6('0x10')][_0xb7b6('0x1f')]=function(_0x320899,_0x266816){if(this[_0xb7b6('0xd')][_0x320899]){this['mailAccounts'][_0x320899][_0xb7b6('0x15')][_0xb7b6('0x16')]=_0xb7b6('0x25');this[_0xb7b6('0xd')][_0x320899][_0xb7b6('0x15')][_0xb7b6('0x17')]=_0x266816[_0xb7b6('0x12')];if(_0x266816[_0xb7b6('0x26')]){this['mailAccounts'][_0x320899]['Imap']['total']=_0x266816[_0xb7b6('0x26')]['total'];}return this[_0xb7b6('0x11')](_0x320899);}};EmailChannel[_0xb7b6('0x10')]['handleImapEmail']=function(_0x4116fe,_0x4842d0){logger[_0xb7b6('0xc')](_0xb7b6('0x27'),_0x4842d0['firstName'],_0x4842d0[_0xb7b6('0x28')],_0x4842d0['from'],_0x4116fe);if(this[_0xb7b6('0xd')][_0x4116fe]){return mailAccount[_0xb7b6('0x29')](_0x4116fe,_0x4842d0)[_0xb7b6('0x2a')](function(_0xe2f784){if(_0xe2f784){logger['info'](_0xb7b6('0x2b'));}})[_0xb7b6('0x2c')](function(_0x32f8ef){logger[_0xb7b6('0x22')](_0xb7b6('0x2d'),JSON['stringify'](_0x32f8ef));});}};EmailChannel[_0xb7b6('0x10')][_0xb7b6('0x2e')]=function(_0x2c0a19){if(this['mailAccounts'][_0x2c0a19]&&this[_0xb7b6('0xd')][_0x2c0a19][_0xb7b6('0x15')]){if(this[_0xb7b6('0xe')][this[_0xb7b6('0xd')][_0x2c0a19]['Imap']['id']]){delete this[_0xb7b6('0xe')][this[_0xb7b6('0xd')][_0x2c0a19][_0xb7b6('0x15')]['id']];}this[_0xb7b6('0xd')][_0x2c0a19][_0xb7b6('0x15')][_0xb7b6('0x2f')]=moment();this[_0xb7b6('0x11')](_0x2c0a19);}};EmailChannel[_0xb7b6('0x10')]['handleImapError']=function(_0x190b8f,_0x3fa023){if(this[_0xb7b6('0xd')][_0x190b8f]){this[_0xb7b6('0xd')][_0x190b8f][_0xb7b6('0x15')][_0xb7b6('0x16')]=_0xb7b6('0x22');this[_0xb7b6('0xd')][_0x190b8f][_0xb7b6('0x15')][_0xb7b6('0x17')]=_0x3fa023;return this['emit'](_0x190b8f);}};EmailChannel[_0xb7b6('0x10')]['sendMail']=function(_0x5c6a4a,_0x3588a7){return this['smtp'][_0xb7b6('0x30')](_0x5c6a4a,_0x3588a7);};EmailChannel[_0xb7b6('0x10')]['verifySmtp']=function(_0x2ae203){var _0x216d47=this;if(this['mailAccounts'][_0x2ae203['id']]){if(_[_0xb7b6('0x31')](this[_0xb7b6('0xd')][_0x2ae203['id']][_0xb7b6('0x32')])){this[_0xb7b6('0xd')][_0x2ae203['id']][_0xb7b6('0x32')]={};}this[_0xb7b6('0xd')][_0x2ae203['id']][_0xb7b6('0x32')][_0xb7b6('0x2f')]=moment();return new BPromise(function(_0x60a286,_0x1a910b){return _0x216d47[_0xb7b6('0xf')][_0xb7b6('0x33')](_0x2ae203)[_0xb7b6('0x2a')](function(_0x414b4a){_0x216d47[_0xb7b6('0xd')][_0x2ae203['id']][_0xb7b6('0x32')]['status']=_0xb7b6('0x34');_0x216d47['mailAccounts'][_0x2ae203['id']][_0xb7b6('0x32')][_0xb7b6('0x17')]='';_0x216d47[_0xb7b6('0x11')](_0x2ae203['id']);_0x60a286(_0x414b4a);})[_0xb7b6('0x2c')](function(_0x305b96){_0x216d47['mailAccounts'][_0x2ae203['id']][_0xb7b6('0x32')]['status']=_0xb7b6('0x22');_0x216d47[_0xb7b6('0xd')][_0x2ae203['id']][_0xb7b6('0x32')]['messageStatus']=_0x305b96;_0x216d47['emit'](_0x2ae203['id']);_0x1a910b(_0x305b96);});});}return this[_0xb7b6('0xf')]['verify'](_0x2ae203);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 82e67c5..1af04eb 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 _0xee2c=['imap','mailparser','simpleParser','iconv','EventEmitter','./utils','email','mailbox','INBOX','account','once','ready','handleReady','bind','end','handleEnd','error','prototype','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','handleError','search','handleReadUnseen','length','message','handleFetchEnd','closeBox','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xee2c,0x1c7));var _0xcee2=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xee2c[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xcee2('0x0'));var util=require('util');var Imap=require(_0xcee2('0x1'));var simpleParser=require(_0xcee2('0x2'))[_0xcee2('0x3')];var Iconv=require(_0xcee2('0x4'))['Iconv'];var EventEmitter=require('events')[_0xcee2('0x5')];var utils=require(_0xcee2('0x6'));var logger=require('../../../config/logger')(_0xcee2('0x7'));function EmailImap(_0x409944,_0x12fa86){this[_0xcee2('0x8')]=_0xcee2('0x9');this['account']=this['getAccount'](_0x409944,_0x12fa86);this[_0xcee2('0x1')]=new Imap(this[_0xcee2('0xa')]);this[_0xcee2('0x1')][_0xcee2('0xb')](_0xcee2('0xc'),this[_0xcee2('0xd')][_0xcee2('0xe')](this));this[_0xcee2('0x1')]['once'](_0xcee2('0xf'),this[_0xcee2('0x10')][_0xcee2('0xe')](this));this[_0xcee2('0x1')]['on'](_0xcee2('0x11'),this['handleError'][_0xcee2('0xe')](this));this['imap']['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xcee2('0x12')][_0xcee2('0x13')]=function(_0x2afc56,_0x347a97){var _0x54a718={'connTimeout':_0x2afc56[_0xcee2('0x14')]?_0x2afc56[_0xcee2('0x14')]*0x3e8:0x2710,'authTimeout':_0x2afc56[_0xcee2('0x15')]?_0x2afc56[_0xcee2('0x15')]*0x3e8:0x1388};if(_0x2afc56[_0xcee2('0x16')]){_0x54a718[_0xcee2('0x17')]=_0x2afc56[_0xcee2('0x17')];_0x54a718[_0xcee2('0x7')]=_0x347a97||_0x2afc56[_0xcee2('0x17')]||'anonymous@xcally.com';if(_0x2afc56[_0xcee2('0x18')]){_0x54a718['xoauth2']=utils[_0xcee2('0x19')](_0x2afc56[_0xcee2('0x1a')][_0xcee2('0x1b')],_0x2afc56[_0xcee2('0x17')]);}else{_0x54a718['password']=_0x2afc56[_0xcee2('0x1c')];}}else{if(_0x2afc56[_0xcee2('0x1d')]){_0x54a718[_0xcee2('0x17')]=_0x2afc56[_0xcee2('0x17')];_0x54a718[_0xcee2('0x1c')]=_0x2afc56[_0xcee2('0x1c')];}}_0x54a718[_0xcee2('0x1e')]=_0x2afc56[_0xcee2('0x1e')];_0x54a718[_0xcee2('0x1f')]=_0x2afc56[_0xcee2('0x1f')]||0x3e1;if(_0x2afc56[_0xcee2('0x20')]){_0x54a718['tls']=!![];}else{_0x54a718[_0xcee2('0x20')]=![];_0x54a718[_0xcee2('0x21')]='required';}return _0x54a718;};EmailImap['prototype'][_0xcee2('0xd')]=function(){this['imap'][_0xcee2('0x22')](this[_0xcee2('0x8')],![],this[_0xcee2('0x23')]['bind'](this));};EmailImap['prototype'][_0xcee2('0x23')]=function(_0x2ccc9c,_0x22789d){if(_0x2ccc9c){this['handleError'](_0x2ccc9c,!![]);}else{this[_0xcee2('0x24')]('box',_0x22789d);this[_0xcee2('0x25')]();}};EmailImap[_0xcee2('0x12')][_0xcee2('0x26')]=function(_0x21bc84){if(_0x21bc84){this[_0xcee2('0x27')](_0x21bc84,!![]);}else{this[_0xcee2('0x1')][_0xcee2('0xf')]();}};EmailImap[_0xcee2('0x12')][_0xcee2('0x25')]=function(){this[_0xcee2('0x1')][_0xcee2('0x28')](['UNSEEN'],this[_0xcee2('0x29')][_0xcee2('0xe')](this));};EmailImap[_0xcee2('0x12')]['handleReadUnseen']=function(_0x2f07e9,_0x117342){if(_0x2f07e9){this['handleError'](_0x2f07e9,!![]);}else{if(_0x117342[_0xcee2('0x2a')]){try{var _0x25ead9=this['imap']['fetch'](_0x117342,{'bodies':'','markSeen':!![]});_0x25ead9['on'](_0xcee2('0x2b'),this['handleFetchMessage']['bind'](this));_0x25ead9[_0xcee2('0xb')](_0xcee2('0x11'),this['handleFetchError'][_0xcee2('0xe')](this));_0x25ead9[_0xcee2('0xb')](_0xcee2('0xf'),this[_0xcee2('0x2c')][_0xcee2('0xe')](this));}catch(_0x150660){logger[_0xcee2('0x11')](_0x150660);}}else{this[_0xcee2('0x1')][_0xcee2('0x2d')](!![],this[_0xcee2('0x26')][_0xcee2('0xe')](this));}}};EmailImap[_0xcee2('0x12')]['handleFetchMessage']=function(_0x4775ba){_0x4775ba['on'](_0xcee2('0x2e'),this['handleMessageBody'][_0xcee2('0xe')](this));_0x4775ba[_0xcee2('0xb')]('attributes',this[_0xcee2('0x2f')][_0xcee2('0xe')](this));_0x4775ba[_0xcee2('0xb')]('end',this[_0xcee2('0x30')][_0xcee2('0xe')](this));};EmailImap[_0xcee2('0x12')][_0xcee2('0x31')]=function(_0x352df6){simpleParser(_0x352df6,{'Iconv':Iconv},this[_0xcee2('0x32')]['bind'](this));};EmailImap[_0xcee2('0x12')][_0xcee2('0x2f')]=function(){};EmailImap[_0xcee2('0x12')]['handleMessageEnd']=function(){};EmailImap[_0xcee2('0x12')]['handleSimpleParser']=function(_0x594eab,_0x42c307){if(_0x594eab){logger[_0xcee2('0x11')](_0x594eab);}else{var _0x16ae5c=this;utils[_0xcee2('0x33')](this[_0xcee2('0xa')],_0x42c307,function(_0x2eb529){_0x16ae5c['emit']('email',_0x2eb529);});}};EmailImap['prototype'][_0xcee2('0x2c')]=function(){this['imap'][_0xcee2('0x2d')](!![],this[_0xcee2('0x26')]['bind'](this));};EmailImap[_0xcee2('0x12')]['handleFetchError']=function(_0x54d75a){this[_0xcee2('0x27')](_0x54d75a);this[_0xcee2('0x1')]['closeBox'](!![],this['handleCloseBox'][_0xcee2('0xe')](this));};EmailImap[_0xcee2('0x12')][_0xcee2('0x10')]=function(){this[_0xcee2('0x24')](_0xcee2('0xf'));};EmailImap[_0xcee2('0x12')][_0xcee2('0x27')]=function(_0x4243d4,_0x377b2f){logger['error'](_0xcee2('0x27'),this[_0xcee2('0xa')][_0xcee2('0x7')],JSON[_0xcee2('0x34')](_0x4243d4));var _0x4bad7b='';if(_0x4243d4){if(_0x4243d4[_0xcee2('0x35')]){_0x4bad7b=_0x4243d4[_0xcee2('0x35')];}else{for(var _0x207764 in _0x4243d4){if(_0x4243d4[_0xcee2('0x36')](_0x207764)){_0x4bad7b+=_[_0xcee2('0x37')](_0x207764)+':\x20'+_0x4243d4[_0x207764]+'\x0a';}}}}if(_0x377b2f){this[_0xcee2('0x1')][_0xcee2('0xf')]();}else{this[_0xcee2('0x24')](_0xcee2('0x11'),_0x4bad7b);this['emit'](_0xcee2('0xf'));}};module[_0xcee2('0x38')]=EmailImap; \ No newline at end of file +var _0xc2c7=['EventEmitter','email','getAccount','account','once','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','stringify','textCode','hasOwnProperty','upperFirst','util','imap','mailparser','simpleParser','iconv','Iconv','events'];(function(_0x1bcaad,_0xc59b3d){var _0x3793ae=function(_0x314276){while(--_0x314276){_0x1bcaad['push'](_0x1bcaad['shift']());}};_0x3793ae(++_0xc59b3d);}(_0xc2c7,0x134));var _0x7c2c=function(_0xe242d1,_0x2b2e80){_0xe242d1=_0xe242d1-0x0;var _0x3ccad5=_0xc2c7[_0xe242d1];return _0x3ccad5;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var Imap=require(_0x7c2c('0x1'));var simpleParser=require(_0x7c2c('0x2'))[_0x7c2c('0x3')];var Iconv=require(_0x7c2c('0x4'))[_0x7c2c('0x5')];var EventEmitter=require(_0x7c2c('0x6'))[_0x7c2c('0x7')];var utils=require('./utils');var logger=require('../../../config/logger')(_0x7c2c('0x8'));function EmailImap(_0x42ecc9,_0x23c038){this['mailbox']='INBOX';this['account']=this[_0x7c2c('0x9')](_0x42ecc9,_0x23c038);this[_0x7c2c('0x1')]=new Imap(this[_0x7c2c('0xa')]);this[_0x7c2c('0x1')][_0x7c2c('0xb')]('ready',this[_0x7c2c('0xc')][_0x7c2c('0xd')](this));this[_0x7c2c('0x1')][_0x7c2c('0xb')](_0x7c2c('0xe'),this[_0x7c2c('0xf')][_0x7c2c('0xd')](this));this[_0x7c2c('0x1')]['on'](_0x7c2c('0x10'),this[_0x7c2c('0x11')][_0x7c2c('0xd')](this));this[_0x7c2c('0x1')][_0x7c2c('0x12')]();}util[_0x7c2c('0x13')](EmailImap,EventEmitter);EmailImap[_0x7c2c('0x14')][_0x7c2c('0x9')]=function(_0x4c4aaf,_0x5b5729){var _0x102778={'connTimeout':_0x4c4aaf[_0x7c2c('0x15')]?_0x4c4aaf[_0x7c2c('0x15')]*0x3e8:0x2710,'authTimeout':_0x4c4aaf['authTimeout']?_0x4c4aaf[_0x7c2c('0x16')]*0x3e8:0x1388};if(_0x4c4aaf[_0x7c2c('0x17')]){_0x102778['user']=_0x4c4aaf[_0x7c2c('0x18')];_0x102778['email']=_0x5b5729||_0x4c4aaf[_0x7c2c('0x18')]||'anonymous@xcally.com';if(_0x4c4aaf[_0x7c2c('0x19')]){_0x102778[_0x7c2c('0x1a')]=utils[_0x7c2c('0x1b')](_0x4c4aaf[_0x7c2c('0x1c')][_0x7c2c('0x1d')],_0x4c4aaf[_0x7c2c('0x18')]);}else{_0x102778[_0x7c2c('0x1e')]=_0x4c4aaf[_0x7c2c('0x1e')];}}else{if(_0x4c4aaf[_0x7c2c('0x1f')]){_0x102778[_0x7c2c('0x18')]=_0x4c4aaf[_0x7c2c('0x18')];_0x102778[_0x7c2c('0x1e')]=_0x4c4aaf['password'];}}_0x102778[_0x7c2c('0x20')]=_0x4c4aaf['host'];_0x102778['port']=_0x4c4aaf[_0x7c2c('0x21')]||0x3e1;if(_0x4c4aaf[_0x7c2c('0x22')]){_0x102778[_0x7c2c('0x22')]=!![];}else{_0x102778[_0x7c2c('0x22')]=![];_0x102778[_0x7c2c('0x23')]=_0x7c2c('0x24');}return _0x102778;};EmailImap[_0x7c2c('0x14')]['handleReady']=function(){this[_0x7c2c('0x1')]['openBox'](this[_0x7c2c('0x25')],![],this['handleOpenBox'][_0x7c2c('0xd')](this));};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x26')]=function(_0x481867,_0x4d6ec7){if(_0x481867){this[_0x7c2c('0x11')](_0x481867,!![]);}else{this[_0x7c2c('0x27')](_0x7c2c('0x28'),_0x4d6ec7);this[_0x7c2c('0x29')]();}};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x2a')]=function(_0x3f4618){if(_0x3f4618){this['handleError'](_0x3f4618,!![]);}else{this[_0x7c2c('0x1')][_0x7c2c('0xe')]();}};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x29')]=function(){this[_0x7c2c('0x1')][_0x7c2c('0x2b')]([_0x7c2c('0x2c')],this[_0x7c2c('0x2d')][_0x7c2c('0xd')](this));};EmailImap['prototype'][_0x7c2c('0x2d')]=function(_0x3a3730,_0x2343f4){if(_0x3a3730){this[_0x7c2c('0x11')](_0x3a3730,!![]);}else{if(_0x2343f4['length']){try{var _0xcb98ba=this[_0x7c2c('0x1')][_0x7c2c('0x2e')](_0x2343f4,{'bodies':'','markSeen':!![]});_0xcb98ba['on'](_0x7c2c('0x2f'),this[_0x7c2c('0x30')][_0x7c2c('0xd')](this));_0xcb98ba[_0x7c2c('0xb')]('error',this[_0x7c2c('0x31')][_0x7c2c('0xd')](this));_0xcb98ba[_0x7c2c('0xb')](_0x7c2c('0xe'),this[_0x7c2c('0x32')]['bind'](this));}catch(_0x47ef3c){logger[_0x7c2c('0x10')](_0x47ef3c);}}else{this['imap']['closeBox'](!![],this[_0x7c2c('0x2a')][_0x7c2c('0xd')](this));}}};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x30')]=function(_0x536dcf){_0x536dcf['on'](_0x7c2c('0x33'),this[_0x7c2c('0x34')][_0x7c2c('0xd')](this));_0x536dcf[_0x7c2c('0xb')](_0x7c2c('0x35'),this[_0x7c2c('0x36')][_0x7c2c('0xd')](this));_0x536dcf[_0x7c2c('0xb')](_0x7c2c('0xe'),this[_0x7c2c('0x37')][_0x7c2c('0xd')](this));};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x34')]=function(_0x530e2c){simpleParser(_0x530e2c,{'Iconv':Iconv},this['handleSimpleParser'][_0x7c2c('0xd')](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap['prototype'][_0x7c2c('0x37')]=function(){};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x38')]=function(_0x273399,_0x1cf51e){if(_0x273399){logger[_0x7c2c('0x10')](_0x273399);}else{var _0x1f8d75=this;utils[_0x7c2c('0x39')](this[_0x7c2c('0xa')],_0x1cf51e,function(_0x3bd119){_0x1f8d75[_0x7c2c('0x27')]('email',_0x3bd119);});}};EmailImap['prototype'][_0x7c2c('0x32')]=function(){this[_0x7c2c('0x1')][_0x7c2c('0x3a')](!![],this[_0x7c2c('0x2a')]['bind'](this));};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x31')]=function(_0x93e2a8){this[_0x7c2c('0x11')](_0x93e2a8);this[_0x7c2c('0x1')][_0x7c2c('0x3a')](!![],this[_0x7c2c('0x2a')][_0x7c2c('0xd')](this));};EmailImap[_0x7c2c('0x14')]['handleEnd']=function(){this[_0x7c2c('0x27')]('end');};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x11')]=function(_0x51e150,_0x114c30){logger['error'](_0x7c2c('0x11'),this[_0x7c2c('0xa')][_0x7c2c('0x8')],JSON[_0x7c2c('0x3b')](_0x51e150));var _0x4f3948='';if(_0x51e150){if(_0x51e150[_0x7c2c('0x3c')]){_0x4f3948=_0x51e150['textCode'];}else{for(var _0x5235c0 in _0x51e150){if(_0x51e150[_0x7c2c('0x3d')](_0x5235c0)){_0x4f3948+=_[_0x7c2c('0x3e')](_0x5235c0)+':\x20'+_0x51e150[_0x5235c0]+'\x0a';}}}}if(_0x114c30){this[_0x7c2c('0x1')]['end']();}else{this[_0x7c2c('0x27')](_0x7c2c('0x10'),_0x4f3948);this['emit'](_0x7c2c('0xe'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 1005990..0756839 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 _0x08ca=['sendMail','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x08ca,0xd4));var _0xa08c=function(_0x2d66bc,_0x20492b){_0x2d66bc=_0x2d66bc-0x0;var _0x44a28a=_0x08ca[_0x2d66bc];return _0x44a28a;};'use strict';var nodemailer=require(_0xa08c('0x0'));var inlineBase64=require(_0xa08c('0x1'));function EmailSmtp(){}EmailSmtp[_0xa08c('0x2')]['send']=function(_0xd42921,_0x43c0b8){return new Promise(function(_0x5b17c9,_0x120b5b){var _0x2ae054=nodemailer[_0xa08c('0x3')](_0xd42921);_0x2ae054['use']('compile',inlineBase64());_0x2ae054[_0xa08c('0x4')](_0x43c0b8,function(_0x2dbb26,_0x4e454d){if(_0x2dbb26){_0x120b5b(_0x2dbb26['toString']());}else{_0x5b17c9(_0x4e454d);}});});};EmailSmtp[_0xa08c('0x2')][_0xa08c('0x5')]=function(_0xf1f510){return new Promise(function(_0xd8889f,_0x269583){var _0x584171=nodemailer[_0xa08c('0x3')](_0xf1f510);_0x584171['verify'](function(_0x129989,_0xc253e8){if(_0x129989){_0x269583(_0x129989['toString']());}else{if(_0xc253e8){_0xd8889f(_0xc253e8);}else{_0x269583(_0xa08c('0x6'));}}});});};module[_0xa08c('0x7')]=EmailSmtp; \ No newline at end of file +var _0x287e=['prototype','send','createTransport','compile','sendMail','verify','exports','nodemailer'];(function(_0x1a8a95,_0x438780){var _0x319cfb=function(_0xb71d90){while(--_0xb71d90){_0x1a8a95['push'](_0x1a8a95['shift']());}};_0x319cfb(++_0x438780);}(_0x287e,0xd7));var _0xe287=function(_0x5db884,_0xde5fcb){_0x5db884=_0x5db884-0x0;var _0x45b682=_0x287e[_0x5db884];return _0x45b682;};'use strict';var nodemailer=require(_0xe287('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xe287('0x1')][_0xe287('0x2')]=function(_0x1f5497,_0x55321b){return new Promise(function(_0x55c476,_0x1d4cee){var _0x254912=nodemailer[_0xe287('0x3')](_0x1f5497);_0x254912['use'](_0xe287('0x4'),inlineBase64());_0x254912[_0xe287('0x5')](_0x55321b,function(_0x1fc3aa,_0x46c2db){if(_0x1fc3aa){_0x1d4cee(_0x1fc3aa['toString']());}else{_0x55c476(_0x46c2db);}});});};EmailSmtp[_0xe287('0x1')][_0xe287('0x6')]=function(_0x19dfd6){return new Promise(function(_0x430229,_0x5bf3b5){var _0x1e32c2=nodemailer[_0xe287('0x3')](_0x19dfd6);_0x1e32c2[_0xe287('0x6')](function(_0x8f8094,_0x137c09){if(_0x8f8094){_0x5bf3b5(_0x8f8094['toString']());}else{if(_0x137c09){_0x430229(_0x137c09);}else{_0x5bf3b5('Not\x20verifired');}}});});};module[_0xe287('0x7')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 0574f16..8116bc8 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 _0x651a=['originCc','includes','bcc','attach','type','attachment','format','%s-%s','now','join','root','writeFileSync','content','push','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','from','messageId','inReplyTo','date','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','lodash','moment','randomstring','util','node-tnef','email','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','indexOf','split','length','slice','Anonymous','isEmpty','html','replace','attachments','_IMG','\x20[Attachment:\x20','body','textAsHtml','0x1?_0x2e495d[_0xa651('0x11')](0x0,-0x1)['join']('\x20'):_0x3cf49b[_0xa651('0xc')];}return _0xa651('0x12');}function getLastName(_0x3816ff){var _0x3a2cb2=_[_0xa651('0x7')](_0x3816ff[_0xa651('0x8')]);if(_0x3a2cb2&&_0x3a2cb2[_0xa651('0xc')]){var _0x2f4a60=_0x3a2cb2[_0xa651('0xc')][_0xa651('0xf')](/\s+/);return _0x2f4a60[_0xa651('0x10')]>0x1?_0x2f4a60['pop']():'';}return'';}function getMails(_0x476825,_0x52ab29){var _0x1e71ec='';for(var _0x159d6e=0x0;_0x159d6e<_0x52ab29[_0xa651('0x8')][_0xa651('0x10')];_0x159d6e+=0x1){if(_0x52ab29[_0xa651('0x8')][_0x159d6e]['address']!==_0x476825){if(!_[_0xa651('0x13')](_0x1e71ec)){_0x1e71ec+=',';}_0x1e71ec+=_0x52ab29[_0xa651('0x8')][_0x159d6e]['name']||_0x52ab29['value'][_0x159d6e][_0xa651('0x9')]||'';_0x1e71ec+='\x20<';_0x1e71ec+=_0x52ab29[_0xa651('0x8')][_0x159d6e][_0xa651('0x9')]?_0x52ab29[_0xa651('0x8')][_0x159d6e][_0xa651('0x9')]:'anonymous'+random[_0xa651('0xa')](0x6)+'@xcally.com';_0x1e71ec+='>';}}return _0x1e71ec;}function parseEmail(_0x3003bb,_0x2eb7fd,_0x4ecbe1){if(_0x2eb7fd[_0xa651('0x14')]){var _0x5c0452=/)<[^<]*)*<\/script>/gi;while(_0x5c0452['test'](_0x2eb7fd[_0xa651('0x14')])){_0x2eb7fd[_0xa651('0x14')]=_0x2eb7fd[_0xa651('0x14')][_0xa651('0x15')](_0x5c0452,'');}if(_0x2eb7fd[_0xa651('0x14')]['includes']('{_0x148724['push'](_0x41b748['filename']);});var _0x45a5a5=/]+>/g;var _0x277c82=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xebb3d1=_0x2eb7fd['html'][_0xa651('0x15')](_0x277c82,'_SRC');var _0x502f29=_0xebb3d1['replace'](_0x45a5a5,_0xa651('0x17'));for(let _0xdd1015=0x0;_0xdd1015<_0x148724[_0xa651('0x10')];_0xdd1015++){var _0x4d09db=_0x502f29[_0xa651('0x15')](_0xa651('0x17'),_0xa651('0x18')+_0x148724[_0xdd1015]+'\x20]');_0x502f29=_0x4d09db;}_0x2eb7fd[_0xa651('0x14')]=_0x502f29;}_0x4ecbe1[_0xa651('0x19')]=_0x2eb7fd[_0xa651('0x14')];}else{_0x4ecbe1['body']=_0x2eb7fd[_0xa651('0x1a')];}if(_0x4ecbe1['body']){_0x4ecbe1[_0xa651('0x19')]=_0x4ecbe1[_0xa651('0x19')][_0xa651('0x15')](/0x0){var _0x729c46=['Auto-Submitted:\x20auto-replied',_0xa651('0x2d'),_0xa651('0x2e')];for(var _0x33484d=0x0;_0x33484d<_0x2eb7fd['headerLines'][_0xa651('0x10')];_0x33484d++){var _0x32ad36=_[_0xa651('0xe')](_0x729c46,_0x2eb7fd[_0xa651('0x2c')][_0x33484d][_0xa651('0x2f')]);if(_0x32ad36>=0x0){_0x4ecbe1[_0xa651('0x30')]=!![];}}}return _0x4ecbe1;}exports['parser']=function(_0x1eefe1,_0x4867dc,_0x5b1c30){var _0x3581c5={'from':getAddress(_0x4867dc[_0xa651('0x31')]),'firstName':getFirstName(_0x4867dc[_0xa651('0x31')]),'lastName':getLastName(_0x4867dc['from']),'mapKey':_0xa651('0x5'),'message':{'from':getMails(_0x1eefe1[_0xa651('0x5')],_0x4867dc[_0xa651('0x31')]),'to':_0x1eefe1[_0xa651('0x5')],'cc':'','subject':_0x4867dc['subject']||'','messageId':_0x4867dc[_0xa651('0x32')],'inReplyTo':_0x4867dc[_0xa651('0x33')],'sentAt':moment(_0x4867dc[_0xa651('0x34')])[_0xa651('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x4867dc[_0xa651('0x14')]&&!_0x4867dc[_0xa651('0x1a')]){var _0x5be078=_[_0xa651('0x35')](_0x4867dc['attachments'],{'contentType':_0xa651('0x36')});if(_0x5be078[_0xa651('0x10')]){logger[_0xa651('0x37')](util[_0xa651('0x24')](_0xa651('0x38'),_0x4867dc[_0xa651('0x32')]));tnef[_0xa651('0x39')](_[_0xa651('0x3a')](_0x5be078)[_0xa651('0x2a')],function(_0x2cc7bb,_0x8daed5){if(_0x8daed5){_0x4867dc[_0xa651('0x14')]=_0x8daed5[_0xa651('0x3b')]||_0xa651('0x3c');if(_0x8daed5['Attachments']){for(var _0x2ea857=0x0;_0x2ea857<_0x8daed5['Attachments'][_0xa651('0x10')];_0x2ea857++){var _0x78d132=_0x8daed5[_0xa651('0x3d')][_0x2ea857];_0x3581c5[_0xa651('0x1c')][_0xa651('0x16')]['push']({'filename':_0x78d132[_0xa651('0x3e')],'content':Buffer['from'](_0x78d132[_0xa651('0x3f')])});}}}_0x5b1c30(parseEmail(_0x1eefe1,_0x4867dc,_0x3581c5));});}else{_0x4867dc[_0xa651('0x14')]='

Empty\x20message

';_0x5b1c30(parseEmail(_0x1eefe1,_0x4867dc,_0x3581c5));}}else{_0x5b1c30(parseEmail(_0x1eefe1,_0x4867dc,_0x3581c5));}};exports[_0xa651('0x40')]=function(_0x230f06,_0x64cad6){var _0x1b5a09=[_0xa651('0x41')+(_0x64cad6||''),_0xa651('0x42')+_0x230f06,'',''];return Buffer['from'](_0x1b5a09[_0xa651('0x27')](''),_0xa651('0x43'))[_0xa651('0x44')]('base64');}; \ No newline at end of file +var _0xd369=['util','node-tnef','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','length','join','Anonymous','split','isEmpty','html','replace','includes','\x20[Attachment:\x20','body','textAsHtml','Empty\x20message

','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','randomstring','path'];(function(_0x25e00b,_0x25e2b3){var _0x31dfb5=function(_0x5bcbe7){while(--_0x5bcbe7){_0x25e00b['push'](_0x25e00b['shift']());}};_0x31dfb5(++_0x25e2b3);}(_0xd369,0x1e0));var _0x9d36=function(_0x542e41,_0x5ee654){_0x542e41=_0x542e41-0x0;var _0x3b96f1=_0xd369[_0x542e41];return _0x3b96f1;};'use strict';var _=require(_0x9d36('0x0'));var moment=require('moment');var random=require(_0x9d36('0x1'));var fs=require('fs');var path=require(_0x9d36('0x2'));var util=require(_0x9d36('0x3'));var tnef=require(_0x9d36('0x4'));var logger=require('../../../config/logger')(_0x9d36('0x5'));var config=require(_0x9d36('0x6'));function getAddress(_0x539af3){var _0x2d2eb9=_[_0x9d36('0x7')](_0x539af3[_0x9d36('0x8')]);return _0x2d2eb9&&_0x2d2eb9[_0x9d36('0x9')]?_0x2d2eb9[_0x9d36('0x9')]:_0x9d36('0xa')+random[_0x9d36('0xb')](0x6)+_0x9d36('0xc');}function getFirstName(_0x4d83fd){var _0x1691f8=_[_0x9d36('0x7')](_0x4d83fd['value']);if(_0x1691f8&&_0x1691f8[_0x9d36('0xd')]){if(_0x1691f8[_0x9d36('0xd')]==_0x1691f8[_0x9d36('0x9')]){return _0x1691f8[_0x9d36('0xd')][_0x9d36('0xe')](0x0,_0x1691f8['name'][_0x9d36('0xf')]('@'));}var _0x3f66b8=_0x1691f8['name']['split'](/\s+/);return _0x3f66b8[_0x9d36('0x10')]>0x1?_0x3f66b8['slice'](0x0,-0x1)[_0x9d36('0x11')]('\x20'):_0x1691f8[_0x9d36('0xd')];}return _0x9d36('0x12');}function getLastName(_0x3b3993){var _0x3fbb43=_[_0x9d36('0x7')](_0x3b3993['value']);if(_0x3fbb43&&_0x3fbb43['name']){var _0x5765e7=_0x3fbb43[_0x9d36('0xd')][_0x9d36('0x13')](/\s+/);return _0x5765e7['length']>0x1?_0x5765e7['pop']():'';}return'';}function getMails(_0x2b7402,_0x118bab){var _0x2853d9='';for(var _0x163318=0x0;_0x163318<_0x118bab[_0x9d36('0x8')][_0x9d36('0x10')];_0x163318+=0x1){if(_0x118bab[_0x9d36('0x8')][_0x163318][_0x9d36('0x9')]!==_0x2b7402){if(!_[_0x9d36('0x14')](_0x2853d9)){_0x2853d9+=',';}_0x2853d9+=_0x118bab[_0x9d36('0x8')][_0x163318][_0x9d36('0xd')]||_0x118bab[_0x9d36('0x8')][_0x163318]['address']||'';_0x2853d9+='\x20<';_0x2853d9+=_0x118bab['value'][_0x163318][_0x9d36('0x9')]?_0x118bab['value'][_0x163318][_0x9d36('0x9')]:_0x9d36('0xa')+random[_0x9d36('0xb')](0x6)+_0x9d36('0xc');_0x2853d9+='>';}}return _0x2853d9;}function parseEmail(_0x26371a,_0x59d200,_0x4bfdf6){if(_0x59d200[_0x9d36('0x15')]){var _0x3b320d=/)<[^<]*)*<\/script>/gi;while(_0x3b320d['test'](_0x59d200[_0x9d36('0x15')])){_0x59d200['html']=_0x59d200['html'][_0x9d36('0x16')](_0x3b320d,'');}if(_0x59d200['html'][_0x9d36('0x17')](_0x9d36('0x18'))){var _0x234ce5=[];_0x59d200[_0x9d36('0x19')][_0x9d36('0x1a')](_0x181664=>{_0x234ce5[_0x9d36('0x1b')](_0x181664[_0x9d36('0x1c')]);});var _0x1703a5=/]+>/g;var _0x5413eb=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x7c5aa6=_0x59d200['html']['replace'](_0x5413eb,'_SRC');var _0x143f38=_0x7c5aa6[_0x9d36('0x16')](_0x1703a5,_0x9d36('0x1d'));for(let _0x1f5f71=0x0;_0x1f5f71<_0x234ce5[_0x9d36('0x10')];_0x1f5f71++){var _0x59758c=_0x143f38[_0x9d36('0x16')](_0x9d36('0x1d'),_0x9d36('0x1e')+_0x234ce5[_0x1f5f71]+'\x20]');_0x143f38=_0x59758c;}_0x59d200[_0x9d36('0x15')]=_0x143f38;}_0x4bfdf6[_0x9d36('0x1f')]=_0x59d200[_0x9d36('0x15')];}else{_0x4bfdf6['body']=_0x59d200[_0x9d36('0x20')];}if(_0x4bfdf6[_0x9d36('0x1f')]){_0x4bfdf6['body']=_0x4bfdf6[_0x9d36('0x1f')]['replace'](/0x0){var _0x4d2797=[_0x9d36('0x31'),_0x9d36('0x32'),_0x9d36('0x33')];for(var _0x448b05=0x0;_0x448b05<_0x59d200['headerLines'][_0x9d36('0x10')];_0x448b05++){var _0x4625a2=_[_0x9d36('0xf')](_0x4d2797,_0x59d200['headerLines'][_0x448b05]['line']);if(_0x4625a2>=0x0){_0x4bfdf6['isAutoreply']=!![];}}}return _0x4bfdf6;}exports[_0x9d36('0x34')]=function(_0x5d3640,_0x54231b,_0x538940){var _0x202434={'from':getAddress(_0x54231b[_0x9d36('0x35')]),'firstName':getFirstName(_0x54231b[_0x9d36('0x35')]),'lastName':getLastName(_0x54231b[_0x9d36('0x35')]),'mapKey':_0x9d36('0x5'),'message':{'from':getMails(_0x5d3640[_0x9d36('0x5')],_0x54231b[_0x9d36('0x35')]),'to':_0x5d3640[_0x9d36('0x5')],'cc':'','subject':_0x54231b['subject']||'','messageId':_0x54231b[_0x9d36('0x36')],'inReplyTo':_0x54231b[_0x9d36('0x37')],'sentAt':moment(_0x54231b['date'])[_0x9d36('0x29')](_0x9d36('0x38')),'attach':![],'attachments':[]}};if(!_0x54231b[_0x9d36('0x15')]&&!_0x54231b[_0x9d36('0x20')]){var _0x254c8c=_[_0x9d36('0x39')](_0x54231b[_0x9d36('0x19')],{'contentType':_0x9d36('0x3a')});if(_0x254c8c[_0x9d36('0x10')]){logger[_0x9d36('0x3b')](util[_0x9d36('0x29')](_0x9d36('0x3c'),_0x54231b['messageId']));tnef[_0x9d36('0x3d')](_['first'](_0x254c8c)[_0x9d36('0x2e')],function(_0x1c46d6,_0x55174a){if(_0x55174a){_0x54231b[_0x9d36('0x15')]=_0x55174a['BodyHTML']||'

Empty\x20message

';if(_0x55174a['Attachments']){for(var _0x2ec530=0x0;_0x2ec530<_0x55174a[_0x9d36('0x3e')][_0x9d36('0x10')];_0x2ec530++){var _0x3cd434=_0x55174a['Attachments'][_0x2ec530];_0x202434['message'][_0x9d36('0x19')]['push']({'filename':_0x3cd434['Title'],'content':Buffer[_0x9d36('0x35')](_0x3cd434['Data'])});}}}_0x538940(parseEmail(_0x5d3640,_0x54231b,_0x202434));});}else{_0x54231b[_0x9d36('0x15')]=_0x9d36('0x3f');_0x538940(parseEmail(_0x5d3640,_0x54231b,_0x202434));}}else{_0x538940(parseEmail(_0x5d3640,_0x54231b,_0x202434));}};exports['generateXOAuth2Token']=function(_0xd9a609,_0x48d2fd){var _0x5c5611=[_0x9d36('0x40')+(_0x48d2fd||''),_0x9d36('0x41')+_0xd9a609,'',''];return Buffer['from'](_0x5c5611[_0x9d36('0x11')](''),_0x9d36('0x42'))[_0x9d36('0x43')](_0x9d36('0x44'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index d398d16..ab1c65d 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 _0xf33e=['lodash','name','Service','active','Imap','Smtp'];(function(_0x37cbf9,_0xe7bc60){var _0x529c0e=function(_0x241953){while(--_0x241953){_0x37cbf9['push'](_0x37cbf9['shift']());}};_0x529c0e(++_0xe7bc60);}(_0xf33e,0x1e0));var _0xef33=function(_0x34cda3,_0x15868c){_0x34cda3=_0x34cda3-0x0;var _0x4a7731=_0xf33e[_0x34cda3];return _0x4a7731;};'use strict';var _=require(_0xef33('0x0'));function MailAccount(_0x1900c5){this['id']=_0x1900c5['id']||0x0;this['name']=_0x1900c5[_0xef33('0x1')]||_0xef33('0x2');this['key']=_0x1900c5['key']||'SERV';this[_0xef33('0x3')]=_0x1900c5[_0xef33('0x3')]||![];this['Imap']=_0x1900c5[_0xef33('0x4')]||[];this[_0xef33('0x5')]=_0x1900c5[_0xef33('0x5')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x200d=['name','Service','key','SERV','active','Imap','Smtp','lodash'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x200d,0x97));var _0xd200=function(_0x55e1d1,_0x3c9376){_0x55e1d1=_0x55e1d1-0x0;var _0x1165db=_0x200d[_0x55e1d1];return _0x1165db;};'use strict';var _=require(_0xd200('0x0'));function MailAccount(_0x5309c0){this['id']=_0x5309c0['id']||0x0;this[_0xd200('0x1')]=_0x5309c0[_0xd200('0x1')]||_0xd200('0x2');this[_0xd200('0x3')]=_0x5309c0['key']||_0xd200('0x4');this[_0xd200('0x5')]=_0x5309c0['active']||![];this[_0xd200('0x6')]=_0x5309c0['Imap']||[];this[_0xd200('0x7')]=_0x5309c0[_0xd200('0x7')]||[];}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 97950d8..c557e5d 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 _0x7478=['isUndefined','merge','lodash','mailAccounts','hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts'];(function(_0x39d39d,_0x5586bd){var _0x577ac3=function(_0x12f9f2){while(--_0x12f9f2){_0x39d39d['push'](_0x39d39d['shift']());}};_0x577ac3(++_0x5586bd);}(_0x7478,0x1da));var _0x8747=function(_0x276b22,_0x5ae3b5){_0x276b22=_0x276b22-0x0;var _0x4549f9=_0x7478[_0x276b22];return _0x4549f9;};'use strict';var _=require(_0x8747('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x8747('0x1')]={};};function freeIsNotKey(_0x860162,_0x3c8bd4,_0x1e4193){var _0x578e2b=_['mapKeys'](_0x860162,function(_0x5ea0f7,_0x44e65d){return _0x5ea0f7[_0x1e4193];});for(var _0x41263c in _0x3c8bd4){if(_0x3c8bd4[_0x8747('0x2')](_0x41263c)){if(!_0x578e2b[_0x41263c]){delete _0x3c8bd4[_0x41263c];}}}}Realtime['prototype'][_0x8747('0x3')]=function(_0x10a46b,_0x2332bd){for(var _0x5ddd20 in _0x2332bd){if(_0x10a46b[_0x8747('0x2')](_0x5ddd20)){_0x10a46b[_0x5ddd20]=_0x2332bd[_0x5ddd20];}}};Realtime[_0x8747('0x4')][_0x8747('0x5')]=function(){var _0x274c5=this;return function(_0x556d56){if(_0x556d56){freeIsNotKey(_0x556d56,_0x274c5['mailAccounts'],'id');for(var _0x25b1a3=0x0,_0x2e9cf4={},_0x44c1c0={};_0x25b1a3<_0x556d56['length'];_0x25b1a3+=0x1){_0x2e9cf4=_0x556d56[_0x25b1a3];if(_[_0x8747('0x6')](_0x274c5[_0x8747('0x1')][_0x2e9cf4['id']])){_0x274c5[_0x8747('0x1')][_0x2e9cf4['id']]=new MailAccount(_0x2e9cf4);}else{_[_0x8747('0x7')](_0x274c5[_0x8747('0x1')][_0x2e9cf4['id']],_0x2e9cf4);}}}return _0x274c5[_0x8747('0x1')];};};module['exports']=Realtime; \ No newline at end of file +var _0xfd50=['merge','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts'];(function(_0x126e31,_0x54eae6){var _0x3567c8=function(_0x50ab9b){while(--_0x50ab9b){_0x126e31['push'](_0x126e31['shift']());}};_0x3567c8(++_0x54eae6);}(_0xfd50,0x160));var _0x0fd5=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xfd50[_0x4914e2];return _0x2dcd07;};'use strict';var _=require(_0x0fd5('0x0'));var MailAccount=require(_0x0fd5('0x1'));var Realtime=function(){this[_0x0fd5('0x2')]={};};function freeIsNotKey(_0x110d22,_0x3c1cb7,_0x17adc5){var _0x2081f4=_[_0x0fd5('0x3')](_0x110d22,function(_0x366031,_0x11f267){return _0x366031[_0x17adc5];});for(var _0xeb967 in _0x3c1cb7){if(_0x3c1cb7[_0x0fd5('0x4')](_0xeb967)){if(!_0x2081f4[_0xeb967]){delete _0x3c1cb7[_0xeb967];}}}}Realtime[_0x0fd5('0x5')][_0x0fd5('0x6')]=function(_0x482a50,_0x524be6){for(var _0x349c4d in _0x524be6){if(_0x482a50[_0x0fd5('0x4')](_0x349c4d)){_0x482a50[_0x349c4d]=_0x524be6[_0x349c4d];}}};Realtime['prototype'][_0x0fd5('0x7')]=function(){var _0x3ba67e=this;return function(_0x4246fa){if(_0x4246fa){freeIsNotKey(_0x4246fa,_0x3ba67e[_0x0fd5('0x2')],'id');for(var _0x413070=0x0,_0x388e87={},_0x3fb008={};_0x413070<_0x4246fa['length'];_0x413070+=0x1){_0x388e87=_0x4246fa[_0x413070];if(_['isUndefined'](_0x3ba67e[_0x0fd5('0x2')][_0x388e87['id']])){_0x3ba67e[_0x0fd5('0x2')][_0x388e87['id']]=new MailAccount(_0x388e87);}else{_[_0x0fd5('0x8')](_0x3ba67e['mailAccounts'][_0x388e87['id']],_0x388e87);}}}return _0x3ba67e['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index b7c8987..f62de75 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 _0xd664=['ListId','TemplateId','MailServerIn','CloudProvider','name','type','data5','MailServerOut','Smtp','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','provider','service','active','key'];(function(_0x5373d6,_0x1fb3ef){var _0x165852=function(_0xed479b){while(--_0xed479b){_0x5373d6['push'](_0x5373d6['shift']());}};_0x165852(++_0x1fb3ef);}(_0xd664,0xa5));var _0x4d66=function(_0x52a618,_0x5c14df){_0x52a618=_0x52a618-0x0;var _0x24e968=_0xd664[_0x52a618];return _0x24e968;};'use strict';var client=require(_0x4d66('0x0'));exports[_0x4d66('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id','name',_0x4d66('0x2'),_0x4d66('0x3'),'email',_0x4d66('0x4'),_0x4d66('0x5'),_0x4d66('0x6'),_0x4d66('0x7')],'raw':![],'include':[{'model':_0x4d66('0x8'),'as':'Imap','include':[{'model':_0x4d66('0x9'),'attributes':['id',_0x4d66('0xa'),_0x4d66('0x3'),_0x4d66('0xb'),_0x4d66('0xc')],'as':_0x4d66('0x9')}]},{'model':_0x4d66('0xd'),'as':_0x4d66('0xe'),'include':[{'model':_0x4d66('0x9'),'attributes':['id',_0x4d66('0xa'),'service',_0x4d66('0xb'),_0x4d66('0xc')],'as':_0x4d66('0x9')}]}]},'log':_0x4d66('0xf')});};};exports[_0x4d66('0x10')]=function(_0x1e7d20,_0x3da8ec){return client[_0x4d66('0x11')](_0x4d66('0x12'),{'account':{'id':_0x1e7d20},'body':_0x3da8ec,'log':_0x4d66('0x12')});}; \ No newline at end of file +var _0xa992=['GetMailAccount','provider','service','email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','Smtp','name','notify','NotifyMailAccount','../client','getMailAccounts','Request'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa992,0x18c));var _0x2a99=function(_0x21019e,_0x47f625){_0x21019e=_0x21019e-0x0;var _0x2ac80c=_0xa992[_0x21019e];return _0x2ac80c;};'use strict';var client=require(_0x2a99('0x0'));exports[_0x2a99('0x1')]=function(){return function(){return client[_0x2a99('0x2')](_0x2a99('0x3'),{'options':{'attributes':['id','name',_0x2a99('0x4'),_0x2a99('0x5'),_0x2a99('0x6'),_0x2a99('0x7'),_0x2a99('0x8'),_0x2a99('0x9'),_0x2a99('0xa')],'raw':![],'include':[{'model':_0x2a99('0xb'),'as':_0x2a99('0xc'),'include':[{'model':_0x2a99('0xd'),'attributes':['id','name',_0x2a99('0x5'),_0x2a99('0xe'),_0x2a99('0xf')],'as':_0x2a99('0xd')}]},{'model':_0x2a99('0x10'),'as':_0x2a99('0x11'),'include':[{'model':_0x2a99('0xd'),'attributes':['id',_0x2a99('0x12'),_0x2a99('0x5'),_0x2a99('0xe'),_0x2a99('0xf')],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports[_0x2a99('0x13')]=function(_0x3a2457,_0x108682){return client[_0x2a99('0x2')](_0x2a99('0x14'),{'account':{'id':_0x3a2457},'body':_0x108682,'log':_0x2a99('0x14')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 82aca48..ed824cf 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 _0xcfa9=['getSettings','Request','loginMailFrequency','GetSettings','../client'];(function(_0x40c499,_0x38a649){var _0x12a5bc=function(_0x1e79ec){while(--_0x1e79ec){_0x40c499['push'](_0x40c499['shift']());}};_0x12a5bc(++_0x38a649);}(_0xcfa9,0x7c));var _0x9cfa=function(_0x5688b5,_0x3a68a9){_0x5688b5=_0x5688b5-0x0;var _0x41ae42=_0xcfa9[_0x5688b5];return _0x41ae42;};'use strict';var client=require(_0x9cfa('0x0'));exports[_0x9cfa('0x1')]=function(){return client[_0x9cfa('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9cfa('0x3')]},'log':_0x9cfa('0x4')});}; \ No newline at end of file +var _0x6cce=['Request','ShowSetting','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x3e00f1,_0x331950){var _0x5b481a=function(_0x54eb05){while(--_0x54eb05){_0x3e00f1['push'](_0x3e00f1['shift']());}};_0x5b481a(++_0x331950);}(_0x6cce,0xbe));var _0xe6cc=function(_0x2f4d41,_0x525047){_0x2f4d41=_0x2f4d41-0x0;var _0x3b0bb2=_0x6cce[_0x2f4d41];return _0x3b0bb2;};'use strict';var client=require(_0xe6cc('0x0'));exports[_0xe6cc('0x1')]=function(){return client[_0xe6cc('0x2')](_0xe6cc('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe6cc('0x4')]},'log':_0xe6cc('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index e25ac11..6bde9fe 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 7f6d141..a506a9e 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 _0x5046=['localhost','adapter','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','express','sticky-session','ioredis','../../config/environment','createServer','port','socket.io','websocket','polling','redis','defaults'];(function(_0x324e63,_0x20b79a){var _0xc7a56=function(_0x4afd9c){while(--_0x4afd9c){_0x324e63['push'](_0x324e63['shift']());}};_0xc7a56(++_0x20b79a);}(_0x5046,0x106));var _0x6504=function(_0x3afa1c,_0xcafcaf){_0x3afa1c=_0x3afa1c-0x0;var _0x5835cb=_0x5046[_0x3afa1c];return _0x5835cb;};'use strict';var _=require('lodash');var http=require('http');var express=require(_0x6504('0x0'));var sticky=require(_0x6504('0x1'));var Redis=require(_0x6504('0x2'));var config=require(_0x6504('0x3'));var app=express();var server=http[_0x6504('0x4')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0x6504('0x5')])){var socketio=require(_0x6504('0x6'))(server,{'transports':[_0x6504('0x7'),_0x6504('0x8')]});config[_0x6504('0x9')]=_[_0x6504('0xa')](config[_0x6504('0x9')],{'host':_0x6504('0xb'),'port':0x18eb});socketio[_0x6504('0xc')](require('socket.io-redis')({'pubClient':new Redis(config[_0x6504('0x9')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0x6504('0xd')]();require(_0x6504('0xe'))['default'](socketio);require(_0x6504('0xf'))[_0x6504('0xd')](app);require(_0x6504('0x10'))[_0x6504('0xd')](app);}else{server[_0x6504('0x11')](_0x6504('0x12'),function(){console[_0x6504('0x13')](_0x6504('0x14'),config[_0x6504('0x5')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x6917=['defaults','localhost','adapter','socket.io-redis','default','../../config/socketio','../../config/express','../../routes','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','port','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','websocket','polling','redis'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0x6917,0x1a9));var _0x7691=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x6917[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0x7691('0x0'));var http=require(_0x7691('0x1'));var express=require(_0x7691('0x2'));var sticky=require(_0x7691('0x3'));var Redis=require(_0x7691('0x4'));var config=require(_0x7691('0x5'));var app=express();var server=http[_0x7691('0x6')](app);server[_0x7691('0x7')]=0xdbba0;if(sticky[_0x7691('0x8')](server,config['port'])){var socketio=require('socket.io')(server,{'transports':[_0x7691('0x9'),_0x7691('0xa')]});config[_0x7691('0xb')]=_[_0x7691('0xc')](config[_0x7691('0xb')],{'host':_0x7691('0xd'),'port':0x18eb});socketio[_0x7691('0xe')](require(_0x7691('0xf'))({'pubClient':new Redis(config[_0x7691('0xb')]),'subClient':new Redis(config[_0x7691('0xb')])}));require('../../config/triggers')[_0x7691('0x10')]();require(_0x7691('0x11'))[_0x7691('0x10')](socketio);require(_0x7691('0x12'))['default'](app);require(_0x7691('0x13'))['default'](app);}else{server['once'](_0x7691('0x14'),function(){console['log'](_0x7691('0x15'),config[_0x7691('0x16')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index c96e650..77e7264 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 _0x309e=['message','result','exports','bluebird','../../config/logger','routing','client','http','Request','request','rpc','error'];(function(_0x3fa6e3,_0x4fe7df){var _0x35b493=function(_0x435a4a){while(--_0x435a4a){_0x3fa6e3['push'](_0x3fa6e3['shift']());}};_0x35b493(++_0x4fe7df);}(_0x309e,0x153));var _0xe309=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x309e[_0x5f09c5];return _0x426ad9;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe309('0x0'));var logger=require(_0xe309('0x1'))(_0xe309('0x2'));var client=jayson[_0xe309('0x3')][_0xe309('0x4')]({'port':0x2329});client[_0xe309('0x5')]=function(_0x3d059e,_0x2afe0b){return new BPromise(function(_0x19c51d,_0x34047b){return client[_0xe309('0x6')](_0x3d059e,_0x2afe0b)['then'](function(_0x49717e){logger['debug'](_0xe309('0x7'),_0xe309('0x2'),_0x3d059e,_0x2afe0b,_0x49717e);if(_0x49717e[_0xe309('0x8')]){logger[_0xe309('0x8')](_0xe309('0x7'),_0xe309('0x2'),_0x3d059e,_0x49717e[_0xe309('0x8')][_0xe309('0x9')],_0x2afe0b);return _0x34047b(_0x49717e['error']['message']);}else{return _0x19c51d(_0x49717e[_0xe309('0xa')]);}})['catch'](function(_0x19b7a2){logger[_0xe309('0x8')](_0xe309('0x7'),_0xe309('0x2'),_0x3d059e,_0x19b7a2,_0x2afe0b);return _0x34047b(_0x19b7a2);});});};module[_0xe309('0xb')]=client; \ No newline at end of file +var _0x1c4e=['catch','rpc','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','debug','error','message','result'];(function(_0x4e3ed4,_0x3934f9){var _0x52b63a=function(_0x314e8c){while(--_0x314e8c){_0x4e3ed4['push'](_0x4e3ed4['shift']());}};_0x52b63a(++_0x3934f9);}(_0x1c4e,0xc6));var _0xe1c4=function(_0x5502db,_0x1ab12f){_0x5502db=_0x5502db-0x0;var _0x5d199c=_0x1c4e[_0x5502db];return _0x5d199c;};'use strict';var jayson=require(_0xe1c4('0x0'));var BPromise=require(_0xe1c4('0x1'));var logger=require(_0xe1c4('0x2'))(_0xe1c4('0x3'));var client=jayson[_0xe1c4('0x4')][_0xe1c4('0x5')]({'port':0x2329});client[_0xe1c4('0x6')]=function(_0x53758b,_0x3d4e75){return new BPromise(function(_0x4905db,_0x451e59){return client['request'](_0x53758b,_0x3d4e75)[_0xe1c4('0x7')](function(_0x2c62f5){logger[_0xe1c4('0x8')]('rpc',_0xe1c4('0x3'),_0x53758b,_0x3d4e75,_0x2c62f5);if(_0x2c62f5[_0xe1c4('0x9')]){logger[_0xe1c4('0x9')]('rpc',_0xe1c4('0x3'),_0x53758b,_0x2c62f5[_0xe1c4('0x9')]['message'],_0x3d4e75);return _0x451e59(_0x2c62f5['error'][_0xe1c4('0xa')]);}else{return _0x4905db(_0x2c62f5[_0xe1c4('0xb')]);}})[_0xe1c4('0xc')](function(_0x2a6bf6){logger[_0xe1c4('0x9')](_0xe1c4('0xd'),'routing',_0x53758b,_0x2a6bf6,_0x3d4e75);return _0x451e59(_0x2a6bf6);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 8cae212..654a62d 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 _0x27a6=['./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue'];(function(_0x130486,_0x37e269){var _0x152c12=function(_0x1c2009){while(--_0x1c2009){_0x130486['push'](_0x130486['shift']());}};_0x152c12(++_0x37e269);}(_0x27a6,0x1da));var _0x627a=function(_0x203c8c,_0x2728e5){_0x203c8c=_0x203c8c-0x0;var _0x1e5322=_0x27a6[_0x203c8c];return _0x1e5322;};'use strict';var BPromise=require(_0x627a('0x0'));var server=require(_0x627a('0x1'));var Realtime=require(_0x627a('0x2'));var user=require(_0x627a('0x3'));var interval=require(_0x627a('0x4'));var openchannelQueue=require(_0x627a('0x5'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x627a('0x6'));var mailQueue=require(_0x627a('0x7'));var faxQueue=require(_0x627a('0x8'));var whatsappQueue=require(_0x627a('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x627a('0xa')]()[_0x627a('0xb')](user[_0x627a('0xc')]())[_0x627a('0xb')](realtime['initAgents']())[_0x627a('0xb')](interval[_0x627a('0xd')]())[_0x627a('0xb')](realtime[_0x627a('0xe')]())[_0x627a('0xb')](openchannelQueue[_0x627a('0xf')]())[_0x627a('0xb')](realtime[_0x627a('0x10')]())[_0x627a('0xb')](chatQueue['getChatQueues']())['then'](realtime['initChatQueues']())[_0x627a('0xb')](smsQueue['getSmsQueues']())['then'](realtime['initSmsQueues']())[_0x627a('0xb')](mailQueue['getMailQueues']())['then'](realtime[_0x627a('0x11')]())[_0x627a('0xb')](faxQueue[_0x627a('0x12')]())[_0x627a('0xb')](realtime[_0x627a('0x13')]())[_0x627a('0xb')](whatsappQueue[_0x627a('0x14')]())['then'](realtime[_0x627a('0x15')]())[_0x627a('0xb')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x627a('0xb')](function(_0x4884f0){return initRealtime();})['then'](function(_0x1d0ad4){return setInterval(initRealtime,0x1388);})[_0x627a('0x16')](function(_0x169841){console[_0x627a('0x17')](_0x169841);});}main(); \ No newline at end of file +var _0x51a4=['getChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues'];(function(_0x26cf90,_0x50702d){var _0x3e13f6=function(_0x41a24e){while(--_0x41a24e){_0x26cf90['push'](_0x26cf90['shift']());}};_0x3e13f6(++_0x50702d);}(_0x51a4,0x106));var _0x451a=function(_0x3e5a25,_0x3880bd){_0x3e5a25=_0x3e5a25-0x0;var _0x4ad6af=_0x51a4[_0x3e5a25];return _0x4ad6af;};'use strict';var BPromise=require(_0x451a('0x0'));var server=require(_0x451a('0x1'));var Realtime=require('./realtime');var user=require(_0x451a('0x2'));var interval=require(_0x451a('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x451a('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x451a('0x5'));var faxQueue=require(_0x451a('0x6'));var whatsappQueue=require(_0x451a('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x451a('0x8')](user['getAgents']())[_0x451a('0x8')](realtime[_0x451a('0x9')]())[_0x451a('0x8')](interval[_0x451a('0xa')]())['then'](realtime[_0x451a('0xb')]())[_0x451a('0x8')](openchannelQueue[_0x451a('0xc')]())[_0x451a('0x8')](realtime[_0x451a('0xd')]())[_0x451a('0x8')](chatQueue[_0x451a('0xe')]())[_0x451a('0x8')](realtime['initChatQueues']())[_0x451a('0x8')](smsQueue['getSmsQueues']())[_0x451a('0x8')](realtime[_0x451a('0xf')]())['then'](mailQueue[_0x451a('0x10')]())[_0x451a('0x8')](realtime[_0x451a('0x11')]())[_0x451a('0x8')](faxQueue[_0x451a('0x12')]())[_0x451a('0x8')](realtime[_0x451a('0x13')]())[_0x451a('0x8')](whatsappQueue[_0x451a('0x14')]())[_0x451a('0x8')](realtime['initWhatsappQueues']())[_0x451a('0x8')](function(){return realtime;});}function main(){return server[_0x451a('0x15')](realtime)[_0x451a('0x8')](function(_0x59a5aa){return initRealtime();})[_0x451a('0x8')](function(_0x515290){return setInterval(initRealtime,0x1388);})['catch'](function(_0x91cbef){console[_0x451a('0x16')](_0x91cbef);});}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 0fdaf37..1bb00de 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 _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x123088,_0x29bf8a){var _0x481aca=function(_0x218966){while(--_0x218966){_0x123088['push'](_0x123088['shift']());}};_0x481aca(++_0x29bf8a);}(_0x2ef3,0xba));var _0x32ef=function(_0x2e92ee,_0x3ab381){_0x2e92ee=_0x2e92ee-0x0;var _0x374b1a=_0x2ef3[_0x2e92ee];return _0x374b1a;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x54336b,_0x299d97){var _0xcd0bc5=function(_0x2818f7){while(--_0x2818f7){_0x54336b['push'](_0x54336b['shift']());}};_0xcd0bc5(++_0x299d97);}(_0x326f,0xd1));var _0xf326=function(_0x4ec61e,_0x294ae0){_0x4ec61e=_0x4ec61e-0x0;var _0x105d11=_0x326f[_0x4ec61e];return _0x105d11;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index a13dc50..8dfc5f5 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 _0x3bb9=['then','error','sendMailMessage','bluebird','jayson/promise','client','http','request'];(function(_0xf405ad,_0x1afcdf){var _0x45c5a7=function(_0x4d32df){while(--_0x4d32df){_0xf405ad['push'](_0xf405ad['shift']());}};_0x45c5a7(++_0x1afcdf);}(_0x3bb9,0x10b));var _0x93bb=function(_0x28ff30,_0x342f9c){_0x28ff30=_0x28ff30-0x0;var _0x453c8b=_0x3bb9[_0x28ff30];return _0x453c8b;};'use strict';var BPromise=require(_0x93bb('0x0'));var jayson=require(_0x93bb('0x1'));var client=jayson[_0x93bb('0x2')][_0x93bb('0x3')]({'port':0x232b});function request(_0x4730f4,_0x2e6beb){return new BPromise(function(_0x3634db,_0x59ab13){return client[_0x93bb('0x4')](_0x4730f4,_0x2e6beb)[_0x93bb('0x5')](function(_0x225626){if(_0x225626['error']){return _0x59ab13(_0x225626[_0x93bb('0x6')]['message']);}else{return _0x3634db(_0x225626['result']);}})['catch'](function(_0x31a9cb){return _0x59ab13(_0x31a9cb);});});}exports[_0x93bb('0x7')]=function(_0x5192e9,_0x4d6d4a){return request('SendMail',{'account':_0x5192e9,'message':_0x4d6d4a});}; \ No newline at end of file +var _0x3feb=['result','sendMailMessage','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x3feb,0xa4));var _0xb3fe=function(_0x4d520d,_0x540526){_0x4d520d=_0x4d520d-0x0;var _0x5c375b=_0x3feb[_0x4d520d];return _0x5c375b;};'use strict';var BPromise=require(_0xb3fe('0x0'));var jayson=require(_0xb3fe('0x1'));var client=jayson[_0xb3fe('0x2')][_0xb3fe('0x3')]({'port':0x232b});function request(_0x230855,_0x4985b1){return new BPromise(function(_0x3c5a46,_0x55d05c){return client[_0xb3fe('0x4')](_0x230855,_0x4985b1)['then'](function(_0xf3cd4c){if(_0xf3cd4c[_0xb3fe('0x5')]){return _0x55d05c(_0xf3cd4c['error'][_0xb3fe('0x6')]);}else{return _0x3c5a46(_0xf3cd4c[_0xb3fe('0x7')]);}})['catch'](function(_0xe49ea3){return _0x55d05c(_0xe49ea3);});});}exports[_0xb3fe('0x8')]=function(_0x4cad38,_0x2eed73){return request('SendMail',{'account':_0x4cad38,'message':_0x2eed73});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 16d3525..918dfc6 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 _0x16d4=['busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','fax','sms','length','StatusTime','toNumber','Status','smsPause','chatCapacity','mailStatus','smsStatus','whatsappStatusTime','whatsappCurrentCapacity','openchannelStatus','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','defaults','socket.io-emitter','redis','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','chatStatusTime','chatCurrentCapacity','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0x16d4,0x189));var _0x416d=function(_0x4cb331,_0x130e1e){_0x4cb331=_0x4cb331-0x0;var _0x5742a6=_0x16d4[_0x4cb331];return _0x5742a6;};'use strict';var _=require(_0x416d('0x0'));var moment=require(_0x416d('0x1'));var md5=require(_0x416d('0x2'));var Redis=require(_0x416d('0x3'));var config=require(_0x416d('0x4'));config['redis']=_[_0x416d('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x416d('0x6'))(new Redis(config[_0x416d('0x7')]));function Agent(_0x1de488){this['id']=_0x1de488['id']||0x0;this[_0x416d('0x8')]=_0x1de488[_0x416d('0x8')]||'';this[_0x416d('0x9')]=_0x1de488[_0x416d('0x9')]||!![];this[_0x416d('0xa')]=_0x1de488[_0x416d('0xa')]||![];this[_0x416d('0xb')]=_0x1de488[_0x416d('0xb')]||![];this[_0x416d('0xc')]=_0x1de488['mailPause']||![];this[_0x416d('0xd')]=_0x1de488[_0x416d('0xd')]||![];this['smsPause']=_0x1de488['smsPause']||![];this['openchannelPause']=_0x1de488[_0x416d('0xe')]||![];this[_0x416d('0xf')]='unknown';this[_0x416d('0x10')]=0x0;this['chatCapacity']=_0x1de488['chatCapacity']||0x0;this[_0x416d('0x11')]=0x0;this['mailStatus']=_0x416d('0x12');this[_0x416d('0x13')]=0x0;this[_0x416d('0x14')]=_0x1de488['mailCapacity']||0x0;this[_0x416d('0x15')]=0x0;this[_0x416d('0x16')]='unknown';this[_0x416d('0x17')]=0x0;this[_0x416d('0x18')]=_0x1de488[_0x416d('0x18')]||0x0;this[_0x416d('0x19')]=0x0;this['smsStatus']=_0x416d('0x12');this[_0x416d('0x1a')]=0x0;this[_0x416d('0x1b')]=_0x1de488[_0x416d('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x416d('0x1c')]=_0x416d('0x12');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x1de488[_0x416d('0x1d')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x416d('0x12');this[_0x416d('0x1e')]=0x0;this['openchannelCapacity']=_0x1de488[_0x416d('0x1f')]||0x0;this[_0x416d('0x20')]=0x0;this[_0x416d('0x21')]=![];this[_0x416d('0x22')]=undefined;this[_0x416d('0x2')]='';this[_0x416d('0x23')]();}Agent[_0x416d('0x24')][_0x416d('0x25')]=function(_0x18e4d0){if(this[_0x18e4d0+_0x416d('0x26')]>0x0){if(this[_0x18e4d0+_0x416d('0x27')]>0x0&&this[_0x18e4d0+_0x416d('0x26')]>=this[_0x18e4d0+_0x416d('0x27')]){return _0x416d('0x28');}else{return _0x416d('0x29');}}else{return _0x416d('0x2a');}};Agent['prototype'][_0x416d('0x23')]=function(){var _0x2678e8=[_0x416d('0x2b'),'chat','openchannel',_0x416d('0x2c'),_0x416d('0x2d'),'whatsapp'];for(var _0x3d5b1f=0x0;_0x3d5b1f<_0x2678e8[_0x416d('0x2e')];_0x3d5b1f+=0x1){var _0x5672f4=this[_0x416d('0x25')](_0x2678e8[_0x3d5b1f]);if(this[_0x2678e8[_0x3d5b1f]+'Status']!==_0x5672f4){this[_0x2678e8[_0x3d5b1f]+_0x416d('0x2f')]=_[_0x416d('0x30')](moment()['format']('x'));}this[_0x2678e8[_0x3d5b1f]+_0x416d('0x31')]=_0x5672f4;}var _0x3b55a8={'id':this['id'],'name':this[_0x416d('0x8')],'online':this[_0x416d('0x9')],'voicePause':this[_0x416d('0xa')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x416d('0x32')],'faxPause':this[_0x416d('0xd')],'openchannelPause':this[_0x416d('0xe')],'chatStatus':this[_0x416d('0xf')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x416d('0x33')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x416d('0x34')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x416d('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x416d('0x17')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x416d('0x35')],'smsStatusTime':this[_0x416d('0x1a')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x416d('0x36')],'whatsappCapacity':this[_0x416d('0x1d')],'whatsappCurrentCapacity':this[_0x416d('0x37')],'openchannelStatus':this[_0x416d('0x38')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x416d('0x1f')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x416d('0x22')]};var _0x49efca=md5(JSON[_0x416d('0x39')](_0x3b55a8));if(this[_0x416d('0x2')]!==_0x49efca){this[_0x416d('0x2')]=_0x49efca;io[_0x416d('0x3a')](_0x416d('0x3b'),_0x3b55a8);}};module[_0x416d('0x3c')]=Agent; \ No newline at end of file +var _0xbaaa=['whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','openchannel','fax','whatsapp','length','Status','StatusTime','toNumber','format','faxStatus','whatsappStatus','stringify','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xbaaa,0x137));var _0xabaa=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xbaaa[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0xabaa('0x0'));var moment=require('moment');var md5=require(_0xabaa('0x1'));var Redis=require(_0xabaa('0x2'));var config=require(_0xabaa('0x3'));config['redis']=_[_0xabaa('0x4')](config[_0xabaa('0x5')],{'host':_0xabaa('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xabaa('0x5')]));function Agent(_0xf9791c){this['id']=_0xf9791c['id']||0x0;this['name']=_0xf9791c[_0xabaa('0x7')]||'';this['online']=_0xf9791c[_0xabaa('0x8')]||!![];this[_0xabaa('0x9')]=_0xf9791c[_0xabaa('0x9')]||![];this[_0xabaa('0xa')]=_0xf9791c[_0xabaa('0xa')]||![];this[_0xabaa('0xb')]=_0xf9791c[_0xabaa('0xb')]||![];this[_0xabaa('0xc')]=_0xf9791c[_0xabaa('0xc')]||![];this[_0xabaa('0xd')]=_0xf9791c[_0xabaa('0xd')]||![];this['openchannelPause']=_0xf9791c[_0xabaa('0xe')]||![];this[_0xabaa('0xf')]=_0xabaa('0x10');this[_0xabaa('0x11')]=0x0;this['chatCapacity']=_0xf9791c['chatCapacity']||0x0;this[_0xabaa('0x12')]=0x0;this[_0xabaa('0x13')]='unknown';this[_0xabaa('0x14')]=0x0;this['mailCapacity']=_0xf9791c[_0xabaa('0x15')]||0x0;this[_0xabaa('0x16')]=0x0;this['faxStatus']=_0xabaa('0x10');this['faxStatusTime']=0x0;this[_0xabaa('0x17')]=_0xf9791c[_0xabaa('0x17')]||0x0;this[_0xabaa('0x18')]=0x0;this[_0xabaa('0x19')]='unknown';this[_0xabaa('0x1a')]=0x0;this[_0xabaa('0x1b')]=_0xf9791c['smsCapacity']||0x0;this[_0xabaa('0x1c')]=0x0;this['whatsappStatus']=_0xabaa('0x10');this[_0xabaa('0x1d')]=0x0;this[_0xabaa('0x1e')]=_0xf9791c[_0xabaa('0x1e')]||0x0;this[_0xabaa('0x1f')]=0x0;this[_0xabaa('0x20')]='unknown';this[_0xabaa('0x21')]=0x0;this[_0xabaa('0x22')]=_0xf9791c[_0xabaa('0x22')]||0x0;this[_0xabaa('0x23')]=0x0;this[_0xabaa('0x24')]=![];this[_0xabaa('0x25')]=undefined;this[_0xabaa('0x1')]='';this[_0xabaa('0x26')]();}Agent[_0xabaa('0x27')][_0xabaa('0x28')]=function(_0x3ee7c1){if(this[_0x3ee7c1+_0xabaa('0x29')]>0x0){if(this[_0x3ee7c1+'Capacity']>0x0&&this[_0x3ee7c1+_0xabaa('0x29')]>=this[_0x3ee7c1+_0xabaa('0x2a')]){return _0xabaa('0x2b');}else{return'working';}}else{return _0xabaa('0x2c');}};Agent[_0xabaa('0x27')][_0xabaa('0x26')]=function(){var _0x20bd26=['mail','chat',_0xabaa('0x2d'),_0xabaa('0x2e'),'sms',_0xabaa('0x2f')];for(var _0x1482b8=0x0;_0x1482b8<_0x20bd26[_0xabaa('0x30')];_0x1482b8+=0x1){var _0x6c9a13=this[_0xabaa('0x28')](_0x20bd26[_0x1482b8]);if(this[_0x20bd26[_0x1482b8]+_0xabaa('0x31')]!==_0x6c9a13){this[_0x20bd26[_0x1482b8]+_0xabaa('0x32')]=_[_0xabaa('0x33')](moment()[_0xabaa('0x34')]('x'));}this[_0x20bd26[_0x1482b8]+_0xabaa('0x31')]=_0x6c9a13;}var _0x1c819d={'id':this['id'],'name':this[_0xabaa('0x7')],'online':this[_0xabaa('0x8')],'voicePause':this[_0xabaa('0x9')],'chatPause':this[_0xabaa('0xa')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0xabaa('0xc')],'openchannelPause':this[_0xabaa('0xe')],'chatStatus':this[_0xabaa('0xf')],'chatStatusTime':this[_0xabaa('0x11')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xabaa('0x12')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xabaa('0x16')],'faxStatus':this[_0xabaa('0x35')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xabaa('0x17')],'faxCurrentCapacity':this[_0xabaa('0x18')],'smsStatus':this[_0xabaa('0x19')],'smsStatusTime':this[_0xabaa('0x1a')],'smsCapacity':this[_0xabaa('0x1b')],'smsCurrentCapacity':this[_0xabaa('0x1c')],'whatsappStatus':this[_0xabaa('0x36')],'whatsappStatusTime':this[_0xabaa('0x1d')],'whatsappCapacity':this[_0xabaa('0x1e')],'whatsappCurrentCapacity':this[_0xabaa('0x1f')],'openchannelStatus':this[_0xabaa('0x20')],'openchannelStatusTime':this[_0xabaa('0x21')],'openchannelCapacity':this[_0xabaa('0x22')],'openchannelCurrentCapacity':this[_0xabaa('0x23')],'busy':this[_0xabaa('0x24')],'busyQueue':this['busyQueue']};var _0x48d5f2=md5(JSON[_0xabaa('0x37')](_0x1c819d));if(this[_0xabaa('0x1')]!==_0x48d5f2){this[_0xabaa('0x1')]=_0x48d5f2;io['emit']('user:save',_0x1c819d);}};module[_0xabaa('0x38')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index d0c6c81..bdd53df 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 _0x7cb2=['redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','chatPause','available','waiting','format','emit','chat_queue:save','exports','lodash','util','ioredis','../../../config/environment'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x7cb2,0xa4));var _0x27cb=function(_0x3a7852,_0xf08f2e){_0x3a7852=_0x3a7852-0x0;var _0x152c1a=_0x7cb2[_0x3a7852];return _0x152c1a;};'use strict';var _=require(_0x27cb('0x0'));var md5=require('md5');var util=require(_0x27cb('0x1'));var Redis=require(_0x27cb('0x2'));var config=require(_0x27cb('0x3'));config[_0x27cb('0x4')]=_[_0x27cb('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x27cb('0x6'))(new Redis(config[_0x27cb('0x4')]));function ChatQueue(_0x143b77){this['id']=_0x143b77['id']||0x0;this['name']=_0x143b77[_0x27cb('0x7')]||'';this[_0x27cb('0x8')]=_0x143b77[_0x27cb('0x8')]||0xa;this[_0x27cb('0x9')]=_0x143b77[_0x27cb('0x9')]||_0x27cb('0xa');this[_0x27cb('0xb')]=_0x143b77['Agents'];this[_0x27cb('0xc')]={};this['waiting']=0x0;this[_0x27cb('0xd')]='';this[_0x27cb('0xe')]();this['updateRealtime']();}ChatQueue[_0x27cb('0xf')][_0x27cb('0xe')]=function(){var _0x198bf6=this['mapAgentsId'][_0x27cb('0x10')];this[_0x27cb('0xc')]=_[_0x27cb('0x11')](this[_0x27cb('0xb')],'id');this[_0x27cb('0xc')][_0x27cb('0x10')]=_0x198bf6;};ChatQueue[_0x27cb('0xf')][_0x27cb('0x12')]=function(){this[_0x27cb('0x13')]=0x0;this[_0x27cb('0x14')]=0x0;for(var _0x2e993d=0x0;_0x2e993d=0x0?this[_0x27cb('0x16')]:0x0;var _0x2611fb={'id':this['id'],'available':this[_0x27cb('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x27cb('0x7')],'paused':this[_0x27cb('0x14')],'waiting':this[_0x27cb('0x17')]};var _0x23b3c5=md5(JSON['stringify'](_0x2611fb));if(this[_0x27cb('0xd')]!==_0x23b3c5){this[_0x27cb('0xd')]=_0x23b3c5;io['to'](util[_0x27cb('0x18')]('chat:queue:%s',_0x2611fb[_0x27cb('0x7')]))[_0x27cb('0x19')](_0x27cb('0x1a'),_0x2611fb);}};module[_0x27cb('0x1b')]=ChatQueue; \ No newline at end of file +var _0xba28=['strategy','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','prototype','loggedIn','paused','length','online','chatPause','available','stringify','chat:queue:%s','emit','chat_queue:save','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name'];(function(_0x5018bd,_0x24b200){var _0x5cb7c7=function(_0x3a5d84){while(--_0x3a5d84){_0x5018bd['push'](_0x5018bd['shift']());}};_0x5cb7c7(++_0x24b200);}(_0xba28,0xe2));var _0x8ba2=function(_0xf84870,_0x4dc38f){_0xf84870=_0xf84870-0x0;var _0x4541a4=_0xba28[_0xf84870];return _0x4541a4;};'use strict';var _=require(_0x8ba2('0x0'));var md5=require(_0x8ba2('0x1'));var util=require(_0x8ba2('0x2'));var Redis=require(_0x8ba2('0x3'));var config=require('../../../config/environment');config[_0x8ba2('0x4')]=_['defaults'](config[_0x8ba2('0x4')],{'host':_0x8ba2('0x5'),'port':0x18eb});var io=require(_0x8ba2('0x6'))(new Redis(config[_0x8ba2('0x4')]));function ChatQueue(_0x2a3366){this['id']=_0x2a3366['id']||0x0;this[_0x8ba2('0x7')]=_0x2a3366[_0x8ba2('0x7')]||'';this['timeout']=_0x2a3366['timeout']||0xa;this[_0x8ba2('0x8')]=_0x2a3366[_0x8ba2('0x8')]||'beepall';this[_0x8ba2('0x9')]=_0x2a3366[_0x8ba2('0x9')];this[_0x8ba2('0xa')]={};this[_0x8ba2('0xb')]=0x0;this[_0x8ba2('0x1')]='';this['updateRouting']();this[_0x8ba2('0xc')]();}ChatQueue['prototype'][_0x8ba2('0xd')]=function(){var _0x56b908=this[_0x8ba2('0xa')]['_rr'];this[_0x8ba2('0xa')]=_['map'](this[_0x8ba2('0x9')],'id');this[_0x8ba2('0xa')][_0x8ba2('0xe')]=_0x56b908;};ChatQueue[_0x8ba2('0xf')][_0x8ba2('0xc')]=function(){this[_0x8ba2('0x10')]=0x0;this[_0x8ba2('0x11')]=0x0;for(var _0x92a5a8=0x0;_0x92a5a8=0x0?this['available']:0x0;var _0x5df195={'id':this['id'],'available':this[_0x8ba2('0x15')],'loggedIn':this[_0x8ba2('0x10')],'name':this['name'],'paused':this[_0x8ba2('0x11')],'waiting':this[_0x8ba2('0xb')]};var _0x1e06e7=md5(JSON[_0x8ba2('0x16')](_0x5df195));if(this['md5']!==_0x1e06e7){this[_0x8ba2('0x1')]=_0x1e06e7;io['to'](util['format'](_0x8ba2('0x17'),_0x5df195[_0x8ba2('0x7')]))[_0x8ba2('0x18')](_0x8ba2('0x19'),_0x5df195);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 8e54a41..83c8db5 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 _0x7107=['fax:queue:%s','fax_queue:save','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','md5','prototype','updateRouting','_rr','updateRealtime','loggedIn','length','online','faxPause','paused','available','format'];(function(_0x3474ac,_0x22d0f7){var _0x5345ec=function(_0x45056e){while(--_0x45056e){_0x3474ac['push'](_0x3474ac['shift']());}};_0x5345ec(++_0x22d0f7);}(_0x7107,0xb8));var _0x7710=function(_0x2f8b9a,_0x60e0f4){_0x2f8b9a=_0x2f8b9a-0x0;var _0x1a4e38=_0x7107[_0x2f8b9a];return _0x1a4e38;};'use strict';var _=require(_0x7710('0x0'));var md5=require('md5');var util=require(_0x7710('0x1'));var Redis=require('ioredis');var config=require(_0x7710('0x2'));config[_0x7710('0x3')]=_[_0x7710('0x4')](config['redis'],{'host':_0x7710('0x5'),'port':0x18eb});var io=require(_0x7710('0x6'))(new Redis(config[_0x7710('0x3')]));function FaxQueue(_0x2993d9){this['id']=_0x2993d9['id']||0x0;this[_0x7710('0x7')]=_0x2993d9[_0x7710('0x7')]||'';this[_0x7710('0x8')]=_0x2993d9[_0x7710('0x8')]||0xa;this[_0x7710('0x9')]=_0x2993d9[_0x7710('0x9')]||'beepall';this[_0x7710('0xa')]=_0x2993d9[_0x7710('0xa')];this[_0x7710('0xb')]={};this['waiting']=0x0;this[_0x7710('0xc')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0x7710('0xd')][_0x7710('0xe')]=function(){var _0x498e89=this['mapAgentsId'][_0x7710('0xf')];this[_0x7710('0xb')]=_['map'](this[_0x7710('0xa')],'id');this[_0x7710('0xb')][_0x7710('0xf')]=_0x498e89;};FaxQueue['prototype'][_0x7710('0x10')]=function(){this[_0x7710('0x11')]=0x0;this['paused']=0x0;for(var _0x1c656d=0x0;_0x1c656d=0x0?this[_0x7710('0x16')]:0x0;var _0x323874={'id':this['id'],'available':this[_0x7710('0x16')],'loggedIn':this[_0x7710('0x11')],'name':this[_0x7710('0x7')],'paused':this[_0x7710('0x15')],'waiting':this['waiting']};var _0x475ee4=md5(JSON['stringify'](_0x323874));if(this[_0x7710('0xc')]!==_0x475ee4){this['md5']=_0x475ee4;io['to'](util[_0x7710('0x17')](_0x7710('0x18'),_0x323874[_0x7710('0x7')]))['emit'](_0x7710('0x19'),_0x323874);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x1144=['emit','fax_queue:save','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','online','loggedIn','faxPause','paused','available','format','fax:queue:%s'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0x1144,0xe2));var _0x4114=function(_0x336dca,_0xc88458){_0x336dca=_0x336dca-0x0;var _0x621521=_0x1144[_0x336dca];return _0x621521;};'use strict';var _=require(_0x4114('0x0'));var md5=require(_0x4114('0x1'));var util=require('util');var Redis=require(_0x4114('0x2'));var config=require(_0x4114('0x3'));config[_0x4114('0x4')]=_['defaults'](config[_0x4114('0x4')],{'host':_0x4114('0x5'),'port':0x18eb});var io=require(_0x4114('0x6'))(new Redis(config[_0x4114('0x4')]));function FaxQueue(_0x246673){this['id']=_0x246673['id']||0x0;this[_0x4114('0x7')]=_0x246673[_0x4114('0x7')]||'';this[_0x4114('0x8')]=_0x246673[_0x4114('0x8')]||0xa;this['strategy']=_0x246673[_0x4114('0x9')]||_0x4114('0xa');this['Agents']=_0x246673[_0x4114('0xb')];this[_0x4114('0xc')]={};this[_0x4114('0xd')]=0x0;this[_0x4114('0x1')]='';this['updateRouting']();this[_0x4114('0xe')]();}FaxQueue[_0x4114('0xf')][_0x4114('0x10')]=function(){var _0x1cbb83=this['mapAgentsId'][_0x4114('0x11')];this['mapAgentsId']=_[_0x4114('0x12')](this[_0x4114('0xb')],'id');this['mapAgentsId'][_0x4114('0x11')]=_0x1cbb83;};FaxQueue['prototype'][_0x4114('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x49e46c=0x0;_0x49e46c=0x0?this[_0x4114('0x17')]:0x0;var _0x47676a={'id':this['id'],'available':this[_0x4114('0x17')],'loggedIn':this[_0x4114('0x14')],'name':this[_0x4114('0x7')],'paused':this[_0x4114('0x16')],'waiting':this[_0x4114('0xd')]};var _0x5f0f4c=md5(JSON['stringify'](_0x47676a));if(this[_0x4114('0x1')]!==_0x5f0f4c){this[_0x4114('0x1')]=_0x5f0f4c;io['to'](util[_0x4114('0x18')](_0x4114('0x19'),_0x47676a['name']))[_0x4114('0x1a')](_0x4114('0x1b'),_0x47676a);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 1827100..bf43f8c 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 _0x3d7d=['name','Intervals','exports'];(function(_0x2bd4e3,_0x4d9b53){var _0x259f7c=function(_0x419754){while(--_0x419754){_0x2bd4e3['push'](_0x2bd4e3['shift']());}};_0x259f7c(++_0x4d9b53);}(_0x3d7d,0x19b));var _0xd3d7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3d7d[_0xfae23b];return _0x200640;};'use strict';function Interval(_0x4b6018){this['id']=_0x4b6018['id']||0x0;this[_0xd3d7('0x0')]=_0x4b6018[_0xd3d7('0x0')]||'';this[_0xd3d7('0x1')]=_0x4b6018[_0xd3d7('0x1')]||{};}module[_0xd3d7('0x2')]=Interval; \ No newline at end of file +var _0x06d3=['Intervals','exports','name'];(function(_0x5d5d55,_0x1811d6){var _0x24f36f=function(_0xce22ad){while(--_0xce22ad){_0x5d5d55['push'](_0x5d5d55['shift']());}};_0x24f36f(++_0x1811d6);}(_0x06d3,0x188));var _0x306d=function(_0x46763f,_0x473c32){_0x46763f=_0x46763f-0x0;var _0x22d8d4=_0x06d3[_0x46763f];return _0x22d8d4;};'use strict';function Interval(_0x4a8e23){this['id']=_0x4a8e23['id']||0x0;this[_0x306d('0x0')]=_0x4a8e23[_0x306d('0x0')]||'';this[_0x306d('0x1')]=_0x4a8e23[_0x306d('0x1')]||{};}module[_0x306d('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 5d0ddd9..b3ef563 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 _0x72b7=['updateRouting','updateRealtime','_rr','loggedIn','paused','mailPause','available','stringify','mail:queue:%s','emit','mail_queue:save','exports','md5','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0x5e0067,_0x44c6c9){var _0x127b1e=function(_0x353941){while(--_0x353941){_0x5e0067['push'](_0x5e0067['shift']());}};_0x127b1e(++_0x44c6c9);}(_0x72b7,0x193));var _0x772b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x72b7[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var md5=require(_0x772b('0x0'));var util=require('util');var Redis=require(_0x772b('0x1'));var config=require(_0x772b('0x2'));config['redis']=_['defaults'](config[_0x772b('0x3')],{'host':_0x772b('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x109c8b){this['id']=_0x109c8b['id']||0x0;this[_0x772b('0x5')]=_0x109c8b['name']||'';this['timeout']=_0x109c8b[_0x772b('0x6')]||0xa;this[_0x772b('0x7')]=_0x109c8b[_0x772b('0x7')]||'beepall';this[_0x772b('0x8')]=_0x109c8b[_0x772b('0x8')];this[_0x772b('0x9')]={};this[_0x772b('0xa')]=0x0;this[_0x772b('0x0')]='';this[_0x772b('0xb')]();this[_0x772b('0xc')]();}MailQueue['prototype'][_0x772b('0xb')]=function(){var _0x3587ea=this[_0x772b('0x9')][_0x772b('0xd')];this[_0x772b('0x9')]=_['map'](this[_0x772b('0x8')],'id');this['mapAgentsId']['_rr']=_0x3587ea;};MailQueue['prototype'][_0x772b('0xc')]=function(){this[_0x772b('0xe')]=0x0;this[_0x772b('0xf')]=0x0;for(var _0x2358aa=0x0;_0x2358aa=0x0?this[_0x772b('0x11')]:0x0;var _0x2481e6={'id':this['id'],'available':this[_0x772b('0x11')],'loggedIn':this[_0x772b('0xe')],'name':this[_0x772b('0x5')],'paused':this[_0x772b('0xf')],'waiting':this[_0x772b('0xa')]};var _0x2c6d8c=md5(JSON[_0x772b('0x12')](_0x2481e6));if(this[_0x772b('0x0')]!==_0x2c6d8c){this[_0x772b('0x0')]=_0x2c6d8c;io['to'](util['format'](_0x772b('0x13'),_0x2481e6[_0x772b('0x5')]))[_0x772b('0x14')](_0x772b('0x15'),_0x2481e6);}};module[_0x772b('0x16')]=MailQueue; \ No newline at end of file +var _0xf9c5=['redis','localhost','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','mailPause','available','waiting','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','defaults'];(function(_0x2ceaeb,_0x1861ce){var _0x4e4e9a=function(_0x4a57a8){while(--_0x4a57a8){_0x2ceaeb['push'](_0x2ceaeb['shift']());}};_0x4e4e9a(++_0x1861ce);}(_0xf9c5,0xf7));var _0x5f9c=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xf9c5[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x5f9c('0x0'));var md5=require(_0x5f9c('0x1'));var util=require(_0x5f9c('0x2'));var Redis=require(_0x5f9c('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x5f9c('0x4')](config[_0x5f9c('0x5')],{'host':_0x5f9c('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x372ea9){this['id']=_0x372ea9['id']||0x0;this['name']=_0x372ea9[_0x5f9c('0x7')]||'';this[_0x5f9c('0x8')]=_0x372ea9[_0x5f9c('0x8')]||0xa;this['strategy']=_0x372ea9[_0x5f9c('0x9')]||'beepall';this[_0x5f9c('0xa')]=_0x372ea9[_0x5f9c('0xa')];this[_0x5f9c('0xb')]={};this['waiting']=0x0;this[_0x5f9c('0x1')]='';this[_0x5f9c('0xc')]();this[_0x5f9c('0xd')]();}MailQueue[_0x5f9c('0xe')][_0x5f9c('0xc')]=function(){var _0x2e9baa=this[_0x5f9c('0xb')][_0x5f9c('0xf')];this[_0x5f9c('0xb')]=_['map'](this[_0x5f9c('0xa')],'id');this[_0x5f9c('0xb')][_0x5f9c('0xf')]=_0x2e9baa;};MailQueue['prototype']['updateRealtime']=function(){this[_0x5f9c('0x10')]=0x0;this[_0x5f9c('0x11')]=0x0;for(var _0xe74c0a=0x0;_0xe74c0a=0x0?this[_0x5f9c('0x15')]:0x0;var _0x372891={'id':this['id'],'available':this[_0x5f9c('0x15')],'loggedIn':this[_0x5f9c('0x10')],'name':this[_0x5f9c('0x7')],'paused':this['paused'],'waiting':this[_0x5f9c('0x16')]};var _0x2f25e2=md5(JSON['stringify'](_0x372891));if(this[_0x5f9c('0x1')]!==_0x2f25e2){this[_0x5f9c('0x1')]=_0x2f25e2;io['to'](util[_0x5f9c('0x17')](_0x5f9c('0x18'),_0x372891[_0x5f9c('0x7')]))[_0x5f9c('0x19')](_0x5f9c('0x1a'),_0x372891);}};module[_0x5f9c('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index a5f96d8..5cc5d29 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc4aa[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0xc0638b,_0x2fccf4){var _0xd57dfa=function(_0x322fba){while(--_0x322fba){_0xc0638b['push'](_0xc0638b['shift']());}};_0xd57dfa(++_0x2fccf4);}(_0x2ef3,0xba));var _0x32ef=function(_0x1371c4,_0x81cb7){_0x1371c4=_0x1371c4-0x0;var _0x46ad5e=_0x2ef3[_0x1371c4];return _0x46ad5e;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index fafe9cc..4050928 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 _0xad36=['localhost','socket.io-emitter','name','timeout','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','smsPause','paused','available','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults'];(function(_0x2c7717,_0x47821e){var _0x426f54=function(_0x46aafd){while(--_0x46aafd){_0x2c7717['push'](_0x2c7717['shift']());}};_0x426f54(++_0x47821e);}(_0xad36,0x11c));var _0x6ad3=function(_0x2ef554,_0x339d17){_0x2ef554=_0x2ef554-0x0;var _0x1b58ef=_0xad36[_0x2ef554];return _0x1b58ef;};'use strict';var _=require('lodash');var md5=require(_0x6ad3('0x0'));var util=require(_0x6ad3('0x1'));var Redis=require(_0x6ad3('0x2'));var config=require(_0x6ad3('0x3'));config[_0x6ad3('0x4')]=_[_0x6ad3('0x5')](config[_0x6ad3('0x4')],{'host':_0x6ad3('0x6'),'port':0x18eb});var io=require(_0x6ad3('0x7'))(new Redis(config['redis']));function SmsQueue(_0x2053e8){this['id']=_0x2053e8['id']||0x0;this[_0x6ad3('0x8')]=_0x2053e8[_0x6ad3('0x8')]||'';this[_0x6ad3('0x9')]=_0x2053e8['timeout']||0xa;this['strategy']=_0x2053e8['strategy']||'beepall';this[_0x6ad3('0xa')]=_0x2053e8[_0x6ad3('0xa')];this[_0x6ad3('0xb')]={};this[_0x6ad3('0xc')]=0x0;this[_0x6ad3('0x0')]='';this[_0x6ad3('0xd')]();this[_0x6ad3('0xe')]();}SmsQueue[_0x6ad3('0xf')][_0x6ad3('0xd')]=function(){var _0x4a47d0=this[_0x6ad3('0xb')][_0x6ad3('0x10')];this[_0x6ad3('0xb')]=_[_0x6ad3('0x11')](this[_0x6ad3('0xa')],'id');this[_0x6ad3('0xb')][_0x6ad3('0x10')]=_0x4a47d0;};SmsQueue[_0x6ad3('0xf')]['updateRealtime']=function(){this[_0x6ad3('0x12')]=0x0;this['paused']=0x0;for(var _0x14418f=0x0;_0x14418f=0x0?this['available']:0x0;var _0x358243={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6ad3('0x12')],'name':this[_0x6ad3('0x8')],'paused':this[_0x6ad3('0x16')],'waiting':this[_0x6ad3('0xc')]};var _0x5b20b1=md5(JSON['stringify'](_0x358243));if(this[_0x6ad3('0x0')]!==_0x5b20b1){this[_0x6ad3('0x0')]=_0x5b20b1;io['to'](util[_0x6ad3('0x18')](_0x6ad3('0x19'),_0x358243[_0x6ad3('0x8')]))[_0x6ad3('0x1a')](_0x6ad3('0x1b'),_0x358243);}};module[_0x6ad3('0x1c')]=SmsQueue; \ No newline at end of file +var _0xd6ce=['redis','defaults','name','strategy','Agents','mapAgentsId','waiting','map','prototype','updateRealtime','paused','length','loggedIn','smsPause','available','stringify','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x5b9256,_0x560e3a){var _0x1f66f3=function(_0x1df725){while(--_0x1df725){_0x5b9256['push'](_0x5b9256['shift']());}};_0x1f66f3(++_0x560e3a);}(_0xd6ce,0x127));var _0xed6c=function(_0x239f36,_0x35b910){_0x239f36=_0x239f36-0x0;var _0x52b59d=_0xd6ce[_0x239f36];return _0x52b59d;};'use strict';var _=require(_0xed6c('0x0'));var md5=require(_0xed6c('0x1'));var util=require(_0xed6c('0x2'));var Redis=require(_0xed6c('0x3'));var config=require(_0xed6c('0x4'));config[_0xed6c('0x5')]=_[_0xed6c('0x6')](config[_0xed6c('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xed6c('0x5')]));function SmsQueue(_0x160735){this['id']=_0x160735['id']||0x0;this[_0xed6c('0x7')]=_0x160735[_0xed6c('0x7')]||'';this['timeout']=_0x160735['timeout']||0xa;this[_0xed6c('0x8')]=_0x160735[_0xed6c('0x8')]||'beepall';this['Agents']=_0x160735[_0xed6c('0x9')];this[_0xed6c('0xa')]={};this[_0xed6c('0xb')]=0x0;this[_0xed6c('0x1')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue['prototype']['updateRouting']=function(){var _0x978b9f=this['mapAgentsId']['_rr'];this[_0xed6c('0xa')]=_[_0xed6c('0xc')](this['Agents'],'id');this[_0xed6c('0xa')]['_rr']=_0x978b9f;};SmsQueue[_0xed6c('0xd')][_0xed6c('0xe')]=function(){this['loggedIn']=0x0;this[_0xed6c('0xf')]=0x0;for(var _0x32a8c9=0x0;_0x32a8c9=0x0?this[_0xed6c('0x13')]:0x0;var _0x4a920e={'id':this['id'],'available':this[_0xed6c('0x13')],'loggedIn':this[_0xed6c('0x11')],'name':this[_0xed6c('0x7')],'paused':this['paused'],'waiting':this[_0xed6c('0xb')]};var _0x2d34d5=md5(JSON[_0xed6c('0x14')](_0x4a920e));if(this[_0xed6c('0x1')]!==_0x2d34d5){this[_0xed6c('0x1')]=_0x2d34d5;io['to'](util['format'](_0xed6c('0x15'),_0x4a920e['name']))[_0xed6c('0x16')](_0xed6c('0x17'),_0x4a920e);}};module[_0xed6c('0x18')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 6c826a8..a993df3 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 _0x5975=['whatsapp:queue:%s','exports','lodash','util','../../../config/environment','defaults','redis','socket.io-emitter','name','strategy','beepall','Agents','waiting','md5','updateRouting','mapAgentsId','_rr','map','prototype','updateRealtime','loggedIn','paused','online','whatsappPause','available','stringify','format'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x5975,0x197));var _0x5597=function(_0x1b7ea1,_0x540dd9){_0x1b7ea1=_0x1b7ea1-0x0;var _0x31a047=_0x5975[_0x1b7ea1];return _0x31a047;};'use strict';var _=require(_0x5597('0x0'));var md5=require('md5');var util=require(_0x5597('0x1'));var Redis=require('ioredis');var config=require(_0x5597('0x2'));config['redis']=_[_0x5597('0x3')](config[_0x5597('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x5597('0x5'))(new Redis(config[_0x5597('0x4')]));function WhatsappQueue(_0x46f91e){this['id']=_0x46f91e['id']||0x0;this[_0x5597('0x6')]=_0x46f91e[_0x5597('0x6')]||'';this['timeout']=_0x46f91e['timeout']||0xa;this[_0x5597('0x7')]=_0x46f91e[_0x5597('0x7')]||_0x5597('0x8');this[_0x5597('0x9')]=_0x46f91e[_0x5597('0x9')];this['mapAgentsId']={};this[_0x5597('0xa')]=0x0;this[_0x5597('0xb')]='';this[_0x5597('0xc')]();this['updateRealtime']();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x57445b=this[_0x5597('0xd')][_0x5597('0xe')];this[_0x5597('0xd')]=_[_0x5597('0xf')](this[_0x5597('0x9')],'id');this['mapAgentsId'][_0x5597('0xe')]=_0x57445b;};WhatsappQueue[_0x5597('0x10')][_0x5597('0x11')]=function(){this[_0x5597('0x12')]=0x0;this[_0x5597('0x13')]=0x0;for(var _0x55306a=0x0;_0x55306a=0x0?this[_0x5597('0x16')]:0x0;var _0x50c0d1={'id':this['id'],'available':this[_0x5597('0x16')],'loggedIn':this[_0x5597('0x12')],'name':this['name'],'paused':this[_0x5597('0x13')],'waiting':this[_0x5597('0xa')]};var _0x1b10f7=md5(JSON[_0x5597('0x17')](_0x50c0d1));if(this[_0x5597('0xb')]!==_0x1b10f7){this[_0x5597('0xb')]=_0x1b10f7;io['to'](util[_0x5597('0x18')](_0x5597('0x19'),_0x50c0d1[_0x5597('0x6')]))['emit']('whatsapp_queue:save',_0x50c0d1);}};module[_0x5597('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0xac8d=['whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','loggedIn','length','online','whatsappPause','paused','available','stringify','format','whatsapp:queue:%s','emit'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xac8d,0x76));var _0xdac8=function(_0x37fb60,_0x3cafd1){_0x37fb60=_0x37fb60-0x0;var _0x4db1a2=_0xac8d[_0x37fb60];return _0x4db1a2;};'use strict';var _=require(_0xdac8('0x0'));var md5=require(_0xdac8('0x1'));var util=require('util');var Redis=require(_0xdac8('0x2'));var config=require(_0xdac8('0x3'));config[_0xdac8('0x4')]=_['defaults'](config[_0xdac8('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xdac8('0x5'))(new Redis(config['redis']));function WhatsappQueue(_0x225113){this['id']=_0x225113['id']||0x0;this[_0xdac8('0x6')]=_0x225113[_0xdac8('0x6')]||'';this[_0xdac8('0x7')]=_0x225113['timeout']||0xa;this[_0xdac8('0x8')]=_0x225113['strategy']||_0xdac8('0x9');this[_0xdac8('0xa')]=_0x225113['Agents'];this['mapAgentsId']={};this[_0xdac8('0xb')]=0x0;this[_0xdac8('0x1')]='';this['updateRouting']();this[_0xdac8('0xc')]();}WhatsappQueue[_0xdac8('0xd')][_0xdac8('0xe')]=function(){var _0x3852fb=this['mapAgentsId']['_rr'];this[_0xdac8('0xf')]=_['map'](this['Agents'],'id');this[_0xdac8('0xf')][_0xdac8('0x10')]=_0x3852fb;};WhatsappQueue[_0xdac8('0xd')][_0xdac8('0xc')]=function(){this[_0xdac8('0x11')]=0x0;this['paused']=0x0;for(var _0x23c1a6=0x0;_0x23c1a6=0x0?this[_0xdac8('0x16')]:0x0;var _0xe209e0={'id':this['id'],'available':this[_0xdac8('0x16')],'loggedIn':this[_0xdac8('0x11')],'name':this[_0xdac8('0x6')],'paused':this[_0xdac8('0x15')],'waiting':this['waiting']};var _0x389403=md5(JSON[_0xdac8('0x17')](_0xe209e0));if(this['md5']!==_0x389403){this[_0xdac8('0x1')]=_0x389403;io['to'](util[_0xdac8('0x18')](_0xdac8('0x19'),_0xe209e0[_0xdac8('0x6')]))[_0xdac8('0x1a')](_0xdac8('0x1b'),_0xe209e0);}};module[_0xdac8('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index d425b07..ddc50d5 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(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x22b60c,_0x6f8859){var _0x400f19=function(_0x5dbcd8){while(--_0x5dbcd8){_0x22b60c['push'](_0x22b60c['shift']());}};_0x400f19(++_0x6f8859);}(_0xb10b,0x12a));var _0xbb10=function(_0x3dc55d,_0xd07e93){_0x3dc55d=_0x3dc55d-0x0;var _0x3aa7f3=_0xb10b[_0x3dc55d];return _0x3aa7f3;};'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 efc0503..ffecbd5 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 _0xaf40=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','update','Request'];(function(_0x2a844c,_0x5b0342){var _0xbfb877=function(_0x1bdd79){while(--_0x1bdd79){_0x2a844c['push'](_0x2a844c['shift']());}};_0xbfb877(++_0x5b0342);}(_0xaf40,0x75));var _0x0af4=function(_0x2ed74b,_0x504b45){_0x2ed74b=_0x2ed74b-0x0;var _0x48f850=_0xaf40[_0x2ed74b];return _0x48f850;};'use strict';var client=require('../client');exports[_0x0af4('0x0')]=function(_0x1e1a16,_0x1662b5){return client[_0x0af4('0x1')](_0x0af4('0x2'),{'body':_0x1662b5,'options':{'where':{'id':_0x1e1a16}},'log':_0x0af4('0x3')});};exports[_0x0af4('0x4')]=function(_0x35be09,_0x18ca82){return client[_0x0af4('0x1')](_0x0af4('0x5'),{'body':_0x18ca82,'options':{'where':{'id':_0x35be09}},'log':_0x0af4('0x6')});}; \ No newline at end of file +var _0x0956=['updateChatInteraction','addTags','AddTagsToChatInteraction','../client','update','Request','UpdateChatInteraction'];(function(_0x25c760,_0x450723){var _0x333345=function(_0xbe28){while(--_0xbe28){_0x25c760['push'](_0x25c760['shift']());}};_0x333345(++_0x450723);}(_0x0956,0x18b));var _0x6095=function(_0x90ed2f,_0x593aa6){_0x90ed2f=_0x90ed2f-0x0;var _0x56cce9=_0x0956[_0x90ed2f];return _0x56cce9;};'use strict';var client=require(_0x6095('0x0'));exports[_0x6095('0x1')]=function(_0x15f9de,_0x522c35){return client[_0x6095('0x2')](_0x6095('0x3'),{'body':_0x522c35,'options':{'where':{'id':_0x15f9de}},'log':_0x6095('0x4')});};exports[_0x6095('0x5')]=function(_0x3ff9ae,_0x315eb8){return client[_0x6095('0x2')](_0x6095('0x6'),{'body':_0x315eb8,'options':{'where':{'id':_0x3ff9ae}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 7dd4a5e..aafef3f 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 _0x5e28=['Request','CreateChatMessage','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e28,0xc5));var _0x85e2=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x5e28[_0x1064bc];return _0x5edc45;};'use strict';var client=require('../client');exports[_0x85e2('0x0')]=function(_0x10de10){return client[_0x85e2('0x1')](_0x85e2('0x2'),{'body':_0x10de10,'log':'createChatMessage'});}; \ No newline at end of file +var _0xaa12=['../client','CreateChatMessage','createChatMessage'];(function(_0x51c22b,_0x4d4855){var _0x404ae0=function(_0x2ced9b){while(--_0x2ced9b){_0x51c22b['push'](_0x51c22b['shift']());}};_0x404ae0(++_0x4d4855);}(_0xaa12,0x195));var _0x2aa1=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xaa12[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x2aa1('0x0'));exports['create']=function(_0x36d759){return client['Request'](_0x2aa1('0x1'),{'body':_0x36d759,'log':_0x2aa1('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 3e9ea1d..0f46b08 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 _0x56da=['User','Agents','name','online','chatPause','getChatQueues','../client','Request','GetChatQueue','timeout','strategy'];(function(_0x3b9b2e,_0x1d3afe){var _0x3e1a74=function(_0x1d5439){while(--_0x1d5439){_0x3b9b2e['push'](_0x3b9b2e['shift']());}};_0x3e1a74(++_0x1d3afe);}(_0x56da,0x119));var _0xa56d=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x56da[_0x369151];return _0x4292d5;};'use strict';var client=require(_0xa56d('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xa56d('0x1')](_0xa56d('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xa56d('0x3'),_0xa56d('0x4')],'include':[{'model':_0xa56d('0x5'),'as':_0xa56d('0x6'),'attributes':['id',_0xa56d('0x7'),_0xa56d('0x8'),_0xa56d('0x9')]}]},'log':_0xa56d('0xa')});};}; \ No newline at end of file +var _0xc92f=['GetChatQueue','name','timeout','User','Agents','../client','getChatQueues'];(function(_0x391aca,_0x2bc004){var _0x345869=function(_0x52d83b){while(--_0x52d83b){_0x391aca['push'](_0x391aca['shift']());}};_0x345869(++_0x2bc004);}(_0xc92f,0xf3));var _0xfc92=function(_0xb3400c,_0x361099){_0xb3400c=_0xb3400c-0x0;var _0x5c5f11=_0xc92f[_0xb3400c];return _0x5c5f11;};'use strict';var client=require(_0xfc92('0x0'));exports[_0xfc92('0x1')]=function(){return function(){return client['Request'](_0xfc92('0x2'),{'options':{'raw':![],'attributes':['id',_0xfc92('0x3'),_0xfc92('0x4'),'strategy'],'include':[{'model':_0xfc92('0x5'),'as':_0xfc92('0x6'),'attributes':['id',_0xfc92('0x3'),'online','chatPause']}]},'log':_0xfc92('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 6d8c651..78b0d79 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 _0x292e=['Request','update','DESC','../client','create'];(function(_0x378ce4,_0xc7d9f4){var _0xf4662=function(_0x57826f){while(--_0x57826f){_0x378ce4['push'](_0x378ce4['shift']());}};_0xf4662(++_0xc7d9f4);}(_0x292e,0xcb));var _0xe292=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x292e[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0xe292('0x0'));exports[_0xe292('0x1')]=function(_0x34fdf4){return client[_0xe292('0x2')]('CreateChatQueueReport',{'body':_0x34fdf4,'log':'CreateChatQueueReport'});};exports[_0xe292('0x3')]=function(_0x343aee,_0x17890d){return client[_0xe292('0x2')]('UpdateChatQueueReport',{'body':_0x17890d,'options':{'where':{'uniqueid':_0x343aee},'order':[['id',_0xe292('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x14ee=['update','UpdateChatQueueReport','../client','Request','CreateChatQueueReport'];(function(_0x5a289d,_0x1e3925){var _0x221226=function(_0x211495){while(--_0x211495){_0x5a289d['push'](_0x5a289d['shift']());}};_0x221226(++_0x1e3925);}(_0x14ee,0x115));var _0xe14e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x14ee[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xe14e('0x0'));exports['create']=function(_0x4892de){return client[_0xe14e('0x1')](_0xe14e('0x2'),{'body':_0x4892de,'log':_0xe14e('0x2')});};exports[_0xe14e('0x3')]=function(_0x244b80,_0x5db128){return client[_0xe14e('0x1')](_0xe14e('0x4'),{'body':_0x5db128,'options':{'where':{'uniqueid':_0x244b80},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 33769e1..9ff9673 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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x36a94f,_0x3fcc6c){var _0x4ba69f=function(_0x362371){while(--_0x362371){_0x36a94f['push'](_0x36a94f['shift']());}};_0x4ba69f(++_0x3fcc6c);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x53a7af,_0x1408a5){var _0x3cc7f6=function(_0x4bf101){while(--_0x4bf101){_0x53a7af['push'](_0x53a7af['shift']());}};_0x3cc7f6(++_0x1408a5);}(_0x7a54,0x106));var _0x47a5=function(_0x1b1347,_0x3b6383){_0x1b1347=_0x1b1347-0x0;var _0x6bf548=_0x7a54[_0x1b1347];return _0x6bf548;};'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 9273e32..2325ec3 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 _0xc486=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc486,0xa2));var _0x6c48=function(_0x4544d3,_0x149a72){_0x4544d3=_0x4544d3-0x0;var _0x36aeca=_0xc486[_0x4544d3];return _0x36aeca;};'use strict';var client=require(_0x6c48('0x0'));exports[_0x6c48('0x1')]=function(_0x511e2d){return client[_0x6c48('0x2')](_0x6c48('0x3'),{'body':_0x511e2d,'log':_0x6c48('0x4')});}; \ No newline at end of file +var _0xd88c=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0xd88c,0xaa));var _0xcd88=function(_0x4452dc,_0x479149){_0x4452dc=_0x4452dc-0x0;var _0x52b892=_0xd88c[_0x4452dc];return _0x52b892;};'use strict';var client=require(_0xcd88('0x0'));exports[_0xcd88('0x1')]=function(_0x192408){return client[_0xcd88('0x2')](_0xcd88('0x3'),{'body':_0x192408,'log':_0xcd88('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index d620764..c441138 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 _0x51e4=['faxPause','getFaxQueues','Request','strategy','Agents','name'];(function(_0x2ba384,_0x11f59c){var _0x36f324=function(_0x25d79a){while(--_0x25d79a){_0x2ba384['push'](_0x2ba384['shift']());}};_0x36f324(++_0x11f59c);}(_0x51e4,0x73));var _0x451e=function(_0x38750a,_0x316de4){_0x38750a=_0x38750a-0x0;var _0x92e34a=_0x51e4[_0x38750a];return _0x92e34a;};'use strict';var client=require('../client');exports[_0x451e('0x0')]=function(){return function(){return client[_0x451e('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x451e('0x2')],'include':[{'model':'User','as':_0x451e('0x3'),'attributes':['id',_0x451e('0x4'),'online',_0x451e('0x5')]}]},'log':_0x451e('0x0')});};}; \ No newline at end of file +var _0x1721=['name','timeout','strategy','User','Agents','faxPause','../client','getFaxQueues','Request'];(function(_0x434a8b,_0x571078){var _0x403367=function(_0x5db4d2){while(--_0x5db4d2){_0x434a8b['push'](_0x434a8b['shift']());}};_0x403367(++_0x571078);}(_0x1721,0x1bf));var _0x1172=function(_0x5d076e,_0x2f9af5){_0x5d076e=_0x5d076e-0x0;var _0x1cdfc1=_0x1721[_0x5d076e];return _0x1cdfc1;};'use strict';var client=require(_0x1172('0x0'));exports[_0x1172('0x1')]=function(){return function(){return client[_0x1172('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x1172('0x3'),_0x1172('0x4'),_0x1172('0x5')],'include':[{'model':_0x1172('0x6'),'as':_0x1172('0x7'),'attributes':['id',_0x1172('0x3'),'online',_0x1172('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 9e09239..b5b75af 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 _0x0845=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x4c8c3a,_0x4ebaa3){var _0x39ddfc=function(_0x2323f4){while(--_0x2323f4){_0x4c8c3a['push'](_0x4c8c3a['shift']());}};_0x39ddfc(++_0x4ebaa3);}(_0x0845,0x125));var _0x5084=function(_0x1f53f1,_0x546cc4){_0x1f53f1=_0x1f53f1-0x0;var _0x4d7ebe=_0x0845[_0x1f53f1];return _0x4d7ebe;};'use strict';var client=require(_0x5084('0x0'));exports['create']=function(_0x587345){return client[_0x5084('0x1')](_0x5084('0x2'),{'body':_0x587345,'log':_0x5084('0x2')});};exports[_0x5084('0x3')]=function(_0x41255e,_0x26a738){return client['Request'](_0x5084('0x4'),{'body':_0x26a738,'options':{'where':{'uniqueid':_0x41255e},'order':[['id',_0x5084('0x5')]],'limit':0x1},'log':_0x5084('0x4')});}; \ No newline at end of file +var _0x8036=['update','UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport'];(function(_0x3a5a85,_0xd5c404){var _0x5c13d8=function(_0x122780){while(--_0x122780){_0x3a5a85['push'](_0x3a5a85['shift']());}};_0x5c13d8(++_0xd5c404);}(_0x8036,0x19a));var _0x6803=function(_0x26a029,_0x46a71e){_0x26a029=_0x26a029-0x0;var _0x3e5109=_0x8036[_0x26a029];return _0x3e5109;};'use strict';var client=require(_0x6803('0x0'));exports[_0x6803('0x1')]=function(_0x1b8585){return client[_0x6803('0x2')](_0x6803('0x3'),{'body':_0x1b8585,'log':_0x6803('0x3')});};exports[_0x6803('0x4')]=function(_0x3faad4,_0x4abab6){return client['Request'](_0x6803('0x5'),{'body':_0x4abab6,'options':{'where':{'uniqueid':_0x3faad4},'order':[['id','DESC']],'limit':0x1},'log':_0x6803('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index c1dfde8..50d217e 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 _0x4bff=['GetInterval','name','Intervals','interval','../client','getIntervals','Request'];(function(_0x3bf1e3,_0x143a13){var _0x31b24c=function(_0x4591ad){while(--_0x4591ad){_0x3bf1e3['push'](_0x3bf1e3['shift']());}};_0x31b24c(++_0x143a13);}(_0x4bff,0x131));var _0xf4bf=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x4bff[_0x24f31b];return _0x488401;};'use strict';var client=require(_0xf4bf('0x0'));exports[_0xf4bf('0x1')]=function(){return function(){return client[_0xf4bf('0x2')](_0xf4bf('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xf4bf('0x4')],'include':[{'model':'Interval','as':_0xf4bf('0x5'),'attributes':['id',_0xf4bf('0x4'),_0xf4bf('0x6')]}]},'log':_0xf4bf('0x1')});};}; \ No newline at end of file +var _0x0b20=['getIntervals','Request','name','interval','../client'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0x0b20,0x9a));var _0x00b2=function(_0x5e0bf0,_0x161ebe){_0x5e0bf0=_0x5e0bf0-0x0;var _0x57717e=_0x0b20[_0x5e0bf0];return _0x57717e;};'use strict';var client=require(_0x00b2('0x0'));exports[_0x00b2('0x1')]=function(){return function(){return client[_0x00b2('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x00b2('0x3'),_0x00b2('0x4')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 701cf46..ab976d7 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 _0x5f66=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x39f769,_0x3ff725){var _0xf15f10=function(_0x354121){while(--_0x354121){_0x39f769['push'](_0x39f769['shift']());}};_0xf15f10(++_0x3ff725);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var client=require('../client');exports[_0x65f6('0x0')]=function(_0x4a3887,_0x2d5fd9){return client[_0x65f6('0x1')](_0x65f6('0x2'),{'body':_0x2d5fd9,'options':{'where':{'id':_0x4a3887}},'log':_0x65f6('0x3')});};exports[_0x65f6('0x4')]=function(_0x5eb9ad,_0x3c5029){return client['Request'](_0x65f6('0x5'),{'body':_0x3c5029,'options':{'where':{'id':_0x5eb9ad}},'log':_0x65f6('0x6')});}; \ No newline at end of file +var _0x68b3=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','updateMailInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68b3,0x1d8));var _0x368b=function(_0x100041,_0x5b7608){_0x100041=_0x100041-0x0;var _0x6318b=_0x68b3[_0x100041];return _0x6318b;};'use strict';var client=require(_0x368b('0x0'));exports[_0x368b('0x1')]=function(_0x3e8034,_0xa371c){return client[_0x368b('0x2')]('UpdateMailInteraction',{'body':_0xa371c,'options':{'where':{'id':_0x3e8034}},'log':_0x368b('0x3')});};exports[_0x368b('0x4')]=function(_0xc40116,_0x404282){return client['Request'](_0x368b('0x5'),{'body':_0x404282,'options':{'where':{'id':_0xc40116}},'log':_0x368b('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index da3e782..20f6d7d 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 _0x09e9=['CreateMailMessage','../client','create','Request'];(function(_0xf5dbed,_0x28884b){var _0x1b102f=function(_0x198396){while(--_0x198396){_0xf5dbed['push'](_0xf5dbed['shift']());}};_0x1b102f(++_0x28884b);}(_0x09e9,0xc5));var _0x909e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x09e9[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x909e('0x0'));exports[_0x909e('0x1')]=function(_0x1b7e33){return client[_0x909e('0x2')](_0x909e('0x3'),{'body':_0x1b7e33,'log':'createMailMessage'});}; \ No newline at end of file +var _0x6e25=['Request','createMailMessage','../client','create'];(function(_0x5142b8,_0x1def06){var _0x4d3dde=function(_0x449d0b){while(--_0x449d0b){_0x5142b8['push'](_0x5142b8['shift']());}};_0x4d3dde(++_0x1def06);}(_0x6e25,0xd6));var _0x56e2=function(_0x2eec1f,_0x1b9987){_0x2eec1f=_0x2eec1f-0x0;var _0x543075=_0x6e25[_0x2eec1f];return _0x543075;};'use strict';var client=require(_0x56e2('0x0'));exports[_0x56e2('0x1')]=function(_0x25e46a){return client[_0x56e2('0x2')]('CreateMailMessage',{'body':_0x25e46a,'log':_0x56e2('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 81311fa..7f9046d 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 _0xc727=['strategy','User','Agents','mailPause','../client','getMailQueues','name','timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc727,0x16c));var _0x7c72=function(_0x1d4ddd,_0x2376a2){_0x1d4ddd=_0x1d4ddd-0x0;var _0x6543bd=_0xc727[_0x1d4ddd];return _0x6543bd;};'use strict';var client=require(_0x7c72('0x0'));exports[_0x7c72('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x7c72('0x2'),_0x7c72('0x3'),_0x7c72('0x4')],'include':[{'model':_0x7c72('0x5'),'as':_0x7c72('0x6'),'attributes':['id','name','online',_0x7c72('0x7')]}]},'log':_0x7c72('0x1')});};}; \ No newline at end of file +var _0xb868=['timeout','strategy','Agents','online','../client','Request','GetMailQueue','name'];(function(_0x241633,_0x2446bc){var _0x1f74f1=function(_0x390c0b){while(--_0x390c0b){_0x241633['push'](_0x241633['shift']());}};_0x1f74f1(++_0x2446bc);}(_0xb868,0x13c));var _0x8b86=function(_0x3bb385,_0x539d0a){_0x3bb385=_0x3bb385-0x0;var _0xac559b=_0xb868[_0x3bb385];return _0xac559b;};'use strict';var client=require(_0x8b86('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x8b86('0x1')](_0x8b86('0x2'),{'options':{'raw':![],'attributes':['id',_0x8b86('0x3'),_0x8b86('0x4'),_0x8b86('0x5')],'include':[{'model':'User','as':_0x8b86('0x6'),'attributes':['id','name',_0x8b86('0x7'),'mailPause']}]},'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 944f861..59e7863 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 _0xafb5=['UpdateMailQueueReport','DESC','../client','Request','CreateMailQueueReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xafb5,0x7a));var _0x5afb=function(_0x5d3353,_0x508788){_0x5d3353=_0x5d3353-0x0;var _0x2aade6=_0xafb5[_0x5d3353];return _0x2aade6;};'use strict';var client=require(_0x5afb('0x0'));exports['create']=function(_0x229698){return client[_0x5afb('0x1')](_0x5afb('0x2'),{'body':_0x229698,'log':_0x5afb('0x2')});};exports['update']=function(_0x380067,_0x3fca7c){return client[_0x5afb('0x1')](_0x5afb('0x3'),{'body':_0x3fca7c,'options':{'where':{'uniqueid':_0x380067},'order':[['id',_0x5afb('0x4')]],'limit':0x1},'log':_0x5afb('0x3')});}; \ No newline at end of file +var _0x5f65=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create'];(function(_0x3d2617,_0x2cfd74){var _0x2cbcb0=function(_0x581b33){while(--_0x581b33){_0x3d2617['push'](_0x3d2617['shift']());}};_0x2cbcb0(++_0x2cfd74);}(_0x5f65,0x186));var _0x55f6=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0x5f65[_0x31991b];return _0x307304;};'use strict';var client=require(_0x55f6('0x0'));exports[_0x55f6('0x1')]=function(_0x3bfbee){return client[_0x55f6('0x2')](_0x55f6('0x3'),{'body':_0x3bfbee,'log':_0x55f6('0x3')});};exports[_0x55f6('0x4')]=function(_0x2df107,_0x15de52){return client[_0x55f6('0x2')](_0x55f6('0x5'),{'body':_0x15de52,'options':{'where':{'uniqueid':_0x2df107},'order':[['id',_0x55f6('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 6864c04..ec8ffe2 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 _0x0bfc=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x587693,_0x27fe90){var _0x510a1a=function(_0x290f71){while(--_0x290f71){_0x587693['push'](_0x587693['shift']());}};_0x510a1a(++_0x27fe90);}(_0x0bfc,0x155));var _0xc0bf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0bfc[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0xc0bf('0x0'));exports[_0xc0bf('0x1')]=function(_0x25f2cc,_0x3e30e4){return client[_0xc0bf('0x2')](_0xc0bf('0x3'),{'body':_0x3e30e4,'options':{'where':{'id':_0x25f2cc}},'log':_0xc0bf('0x4')});};exports[_0xc0bf('0x5')]=function(_0x21e909,_0x5d498b){return client[_0xc0bf('0x2')](_0xc0bf('0x6'),{'body':_0x5d498b,'options':{'where':{'id':_0x21e909}},'log':_0xc0bf('0x7')});}; \ No newline at end of file +var _0x09b0=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x4bf23a,_0x4bb656){var _0xce76b9=function(_0x47d6f0){while(--_0x47d6f0){_0x4bf23a['push'](_0x4bf23a['shift']());}};_0xce76b9(++_0x4bb656);}(_0x09b0,0x155));var _0x009b=function(_0x17ec6a,_0x201926){_0x17ec6a=_0x17ec6a-0x0;var _0x2944ea=_0x09b0[_0x17ec6a];return _0x2944ea;};'use strict';var client=require(_0x009b('0x0'));exports['update']=function(_0x1c0008,_0xb84290){return client[_0x009b('0x1')](_0x009b('0x2'),{'body':_0xb84290,'options':{'where':{'id':_0x1c0008}},'log':_0x009b('0x3')});};exports['addTags']=function(_0x40c05a,_0x1271c3){return client[_0x009b('0x1')](_0x009b('0x4'),{'body':_0x1271c3,'options':{'where':{'id':_0x40c05a}},'log':_0x009b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 4a005e8..c617058 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 _0x4565=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x2b63f1,_0x1df791){var _0x23e3d4=function(_0x8e8784){while(--_0x8e8784){_0x2b63f1['push'](_0x2b63f1['shift']());}};_0x23e3d4(++_0x1df791);}(_0x4565,0x84));var _0x5456=function(_0x5935e6,_0x4a2b41){_0x5935e6=_0x5935e6-0x0;var _0x3aba85=_0x4565[_0x5935e6];return _0x3aba85;};'use strict';var client=require('../client');exports[_0x5456('0x0')]=function(_0x14a3e9){return client[_0x5456('0x1')](_0x5456('0x2'),{'body':_0x14a3e9,'log':_0x5456('0x3')});}; \ No newline at end of file +var _0xc273=['createOpenchannelMessage','create','Request','CreateOpenchannelMessage'];(function(_0x39a2d6,_0x477459){var _0x23af66=function(_0x2eb95e){while(--_0x2eb95e){_0x39a2d6['push'](_0x39a2d6['shift']());}};_0x23af66(++_0x477459);}(_0xc273,0x1e9));var _0x3c27=function(_0x24431a,_0x52459a){_0x24431a=_0x24431a-0x0;var _0x454ec7=_0xc273[_0x24431a];return _0x454ec7;};'use strict';var client=require('../client');exports[_0x3c27('0x0')]=function(_0x20b643){return client[_0x3c27('0x1')](_0x3c27('0x2'),{'body':_0x20b643,'log':_0x3c27('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 6f30c4a..85b6e32 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 _0x1da6=['Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User'];(function(_0x22226b,_0x1c67f0){var _0x3543c4=function(_0x407278){while(--_0x407278){_0x22226b['push'](_0x22226b['shift']());}};_0x3543c4(++_0x1c67f0);}(_0x1da6,0x7c));var _0x61da=function(_0x23f3fe,_0x37a19c){_0x23f3fe=_0x23f3fe-0x0;var _0x1b1cb1=_0x1da6[_0x23f3fe];return _0x1b1cb1;};'use strict';var client=require(_0x61da('0x0'));exports[_0x61da('0x1')]=function(){return function(){return client[_0x61da('0x2')](_0x61da('0x3'),{'options':{'raw':![],'attributes':['id',_0x61da('0x4'),_0x61da('0x5'),_0x61da('0x6')],'include':[{'model':_0x61da('0x7'),'as':_0x61da('0x8'),'attributes':['id',_0x61da('0x4'),_0x61da('0x9'),_0x61da('0xa')]}]},'log':_0x61da('0x1')});};}; \ No newline at end of file +var _0x646b=['User','Agents','online','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy'];(function(_0x90c963,_0x2df7d2){var _0x1f15ad=function(_0x217022){while(--_0x217022){_0x90c963['push'](_0x90c963['shift']());}};_0x1f15ad(++_0x2df7d2);}(_0x646b,0x123));var _0xb646=function(_0x51ac09,_0x383098){_0x51ac09=_0x51ac09-0x0;var _0x3f827d=_0x646b[_0x51ac09];return _0x3f827d;};'use strict';var client=require('../client');exports[_0xb646('0x0')]=function(){return function(){return client[_0xb646('0x1')](_0xb646('0x2'),{'options':{'raw':![],'attributes':['id',_0xb646('0x3'),_0xb646('0x4'),_0xb646('0x5')],'include':[{'model':_0xb646('0x6'),'as':_0xb646('0x7'),'attributes':['id',_0xb646('0x3'),_0xb646('0x8'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 354eecd..442efbc 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 _0xf1c4=['UpdateOpenchannelQueueReport','DESC','Request','CreateOpenchannelQueueReport','update'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xf1c4,0x15b));var _0x4f1c=function(_0x3c67ef,_0x580433){_0x3c67ef=_0x3c67ef-0x0;var _0x4dfa22=_0xf1c4[_0x3c67ef];return _0x4dfa22;};'use strict';var client=require('../client');exports['create']=function(_0x471795){return client[_0x4f1c('0x0')](_0x4f1c('0x1'),{'body':_0x471795,'log':'CreateOpenchannelQueueReport'});};exports[_0x4f1c('0x2')]=function(_0x4ba6ed,_0x38b455){return client[_0x4f1c('0x0')](_0x4f1c('0x3'),{'body':_0x38b455,'options':{'where':{'uniqueid':_0x4ba6ed},'order':[['id',_0x4f1c('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xba28=['../client','Request','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x47bc58,_0x1e1998){var _0x4a0860=function(_0x2a5b23){while(--_0x2a5b23){_0x47bc58['push'](_0x47bc58['shift']());}};_0x4a0860(++_0x1e1998);}(_0xba28,0xc8));var _0x8ba2=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xba28[_0x59d89e];return _0x554e93;};'use strict';var client=require(_0x8ba2('0x0'));exports['create']=function(_0x5da370){return client[_0x8ba2('0x1')]('CreateOpenchannelQueueReport',{'body':_0x5da370,'log':'CreateOpenchannelQueueReport'});};exports[_0x8ba2('0x2')]=function(_0x2efd24,_0x69fbc){return client[_0x8ba2('0x1')](_0x8ba2('0x3'),{'body':_0x69fbc,'options':{'where':{'uniqueid':_0x2efd24},'order':[['id',_0x8ba2('0x4')]],'limit':0x1},'log':_0x8ba2('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 99106d1..38dc4f6 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 _0xeec6=['Request','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x3e8cae,_0x4cb96a){var _0x45c4d6=function(_0x4bf3a5){while(--_0x4bf3a5){_0x3e8cae['push'](_0x3e8cae['shift']());}};_0x45c4d6(++_0x4cb96a);}(_0xeec6,0x1c2));var _0x6eec=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0xeec6[_0xc77819];return _0x1c9434;};'use strict';var client=require(_0x6eec('0x0'));exports[_0x6eec('0x1')]=function(_0x16ccaa,_0x33cc53){return client['Request'](_0x6eec('0x2'),{'body':_0x33cc53,'options':{'where':{'id':_0x16ccaa}},'log':_0x6eec('0x3')});};exports[_0x6eec('0x4')]=function(_0x2d7a15,_0x3e7b6b){return client[_0x6eec('0x5')]('AddTagsToSmsInteraction',{'body':_0x3e7b6b,'options':{'where':{'id':_0x2d7a15}},'log':_0x6eec('0x6')});}; \ No newline at end of file +var _0x4c6d=['addTags','AddTagsToSmsInteraction','../client','update','Request','updateSmsInteraction'];(function(_0x162d1d,_0x57dc92){var _0x3601df=function(_0x462280){while(--_0x462280){_0x162d1d['push'](_0x162d1d['shift']());}};_0x3601df(++_0x57dc92);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0xff7025,_0x237d34){_0xff7025=_0xff7025-0x0;var _0x10fc95=_0x4c6d[_0xff7025];return _0x10fc95;};'use strict';var client=require(_0xd4c6('0x0'));exports[_0xd4c6('0x1')]=function(_0x300800,_0x2d4a85){return client[_0xd4c6('0x2')]('UpdateSmsInteraction',{'body':_0x2d4a85,'options':{'where':{'id':_0x300800}},'log':_0xd4c6('0x3')});};exports[_0xd4c6('0x4')]=function(_0x306766,_0x4b2d75){return client[_0xd4c6('0x2')](_0xd4c6('0x5'),{'body':_0x4b2d75,'options':{'where':{'id':_0x306766}},'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 cbe1725..855ec60 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 _0xf401=['Request','CreateSmsMessage','createSmsMessage'];(function(_0x30c858,_0x158c2c){var _0x51be4a=function(_0x58c051){while(--_0x58c051){_0x30c858['push'](_0x30c858['shift']());}};_0x51be4a(++_0x158c2c);}(_0xf401,0x126));var _0x1f40=function(_0x481976,_0x547a88){_0x481976=_0x481976-0x0;var _0xb703d4=_0xf401[_0x481976];return _0xb703d4;};'use strict';var client=require('../client');exports['create']=function(_0x410e24){return client[_0x1f40('0x0')](_0x1f40('0x1'),{'body':_0x410e24,'log':_0x1f40('0x2')});}; \ No newline at end of file +var _0xfd3c=['createSmsMessage','../client','create','CreateSmsMessage'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xfd3c,0x121));var _0xcfd3=function(_0x398a27,_0x513e55){_0x398a27=_0x398a27-0x0;var _0xdaf572=_0xfd3c[_0x398a27];return _0xdaf572;};'use strict';var client=require(_0xcfd3('0x0'));exports[_0xcfd3('0x1')]=function(_0x45d722){return client['Request'](_0xcfd3('0x2'),{'body':_0x45d722,'log':_0xcfd3('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 6a950ad..b231531 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x5a5b82,_0x38a4bd){var _0x36c94c=function(_0x3dd395){while(--_0x3dd395){_0x5a5b82['push'](_0x5a5b82['shift']());}};_0x36c94c(++_0x38a4bd);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0xcb91[_0x58afd5];return _0x3e503b;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x380ee9,_0x2dc6d3){var _0x370858=function(_0x190b03){while(--_0x190b03){_0x380ee9['push'](_0x380ee9['shift']());}};_0x370858(++_0x2dc6d3);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb7e7[_0x1a36a5];return _0x746243;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 445e1d1..8160fc0 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 _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x1308ec,_0x32c99e){var _0x1a43c8=function(_0x18ff62){while(--_0x18ff62){_0x1308ec['push'](_0x1308ec['shift']());}};_0x1a43c8(++_0x32c99e);}(_0x70e0,0x17b));var _0x070e=function(_0x5a466e,_0x14794e){_0x5a466e=_0x5a466e-0x0;var _0x366888=_0x70e0[_0x5a466e];return _0x366888;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x5a60eb,_0x41370c){var _0x4b0993=function(_0x1fbb62){while(--_0x1fbb62){_0x5a60eb['push'](_0x5a60eb['shift']());}};_0x4b0993(++_0x41370c);}(_0x55ca,0x126));var _0xa55c=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x55ca[_0x307d86];return _0x361745;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index ec64985..cf653d2 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(_0x12c3db,_0x1b4fd7){var _0x7619fb=function(_0x44c918){while(--_0x44c918){_0x12c3db['push'](_0x12c3db['shift']());}};_0x7619fb(++_0x1b4fd7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0xa829e1,_0x4ff69e){var _0x464519=function(_0x5972dc){while(--_0x5972dc){_0xa829e1['push'](_0xa829e1['shift']());}};_0x464519(++_0x4ff69e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 c4fcdf2..9986656 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 _0xe2fe=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xee2f('0x0'));exports['update']=function(_0x521787,_0xb0780a){return client['Request'](_0xee2f('0x1'),{'body':_0xb0780a,'options':{'where':{'id':_0x521787}},'log':_0xee2f('0x2')});};exports[_0xee2f('0x3')]=function(_0x2d2b03,_0xcb45e6){return client['Request'](_0xee2f('0x4'),{'body':_0xcb45e6,'options':{'where':{'id':_0x2d2b03}},'log':_0xee2f('0x5')});}; \ No newline at end of file +var _0xa23f=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x36103c,_0x40ff7e){var _0x2f1931=function(_0x285867){while(--_0x285867){_0x36103c['push'](_0x36103c['shift']());}};_0x2f1931(++_0x40ff7e);}(_0xa23f,0x7c));var _0xfa23=function(_0x1a9ba2,_0x136970){_0x1a9ba2=_0x1a9ba2-0x0;var _0xee42b5=_0xa23f[_0x1a9ba2];return _0xee42b5;};'use strict';var client=require(_0xfa23('0x0'));exports[_0xfa23('0x1')]=function(_0x56a4e3,_0x48fd46){return client[_0xfa23('0x2')](_0xfa23('0x3'),{'body':_0x48fd46,'options':{'where':{'id':_0x56a4e3}},'log':_0xfa23('0x4')});};exports[_0xfa23('0x5')]=function(_0x5643b1,_0x86778e){return client['Request'](_0xfa23('0x6'),{'body':_0x86778e,'options':{'where':{'id':_0x5643b1}},'log':_0xfa23('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index ce6ff2e..ff056a5 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 _0xa1f6=['../client','create','createWhatsappMessage'];(function(_0x33eadc,_0x4a86bf){var _0x222734=function(_0x5c10eb){while(--_0x5c10eb){_0x33eadc['push'](_0x33eadc['shift']());}};_0x222734(++_0x4a86bf);}(_0xa1f6,0x102));var _0x6a1f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa1f6[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0x6a1f('0x0'));exports[_0x6a1f('0x1')]=function(_0x2c93bc){return client['Request']('CreateWhatsappMessage',{'body':_0x2c93bc,'log':_0x6a1f('0x2')});}; \ No newline at end of file +var _0x0bea=['createWhatsappMessage','../client','create','Request','CreateWhatsappMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0bea,0x132));var _0xa0be=function(_0x4b70a2,_0x5d0fbd){_0x4b70a2=_0x4b70a2-0x0;var _0x2170fa=_0x0bea[_0x4b70a2];return _0x2170fa;};'use strict';var client=require(_0xa0be('0x0'));exports[_0xa0be('0x1')]=function(_0x170a46){return client[_0xa0be('0x2')](_0xa0be('0x3'),{'body':_0x170a46,'log':_0xa0be('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index a77dc34..6670939 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 _0x07ef=['getWhatsappQueues','Request','name','timeout','User','Agents','whatsappPause','../client'];(function(_0x42dac8,_0x71377){var _0x5b3c34=function(_0x5c3831){while(--_0x5c3831){_0x42dac8['push'](_0x42dac8['shift']());}};_0x5b3c34(++_0x71377);}(_0x07ef,0xef));var _0xf07e=function(_0x5a87fb,_0x2c2d6d){_0x5a87fb=_0x5a87fb-0x0;var _0x5c1ac5=_0x07ef[_0x5a87fb];return _0x5c1ac5;};'use strict';var client=require(_0xf07e('0x0'));exports[_0xf07e('0x1')]=function(){return function(){return client[_0xf07e('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xf07e('0x3'),_0xf07e('0x4'),'strategy'],'include':[{'model':_0xf07e('0x5'),'as':_0xf07e('0x6'),'attributes':['id',_0xf07e('0x3'),'online',_0xf07e('0x7')]}]},'log':_0xf07e('0x1')});};}; \ No newline at end of file +var _0xb378=['getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','online'];(function(_0x39dcdf,_0x192054){var _0x57c762=function(_0x2c8512){while(--_0x2c8512){_0x39dcdf['push'](_0x39dcdf['shift']());}};_0x57c762(++_0x192054);}(_0xb378,0xfc));var _0x8b37=function(_0x34d760,_0x19beba){_0x34d760=_0x34d760-0x0;var _0x3b7a47=_0xb378[_0x34d760];return _0x3b7a47;};'use strict';var client=require('../client');exports[_0x8b37('0x0')]=function(){return function(){return client[_0x8b37('0x1')](_0x8b37('0x2'),{'options':{'raw':![],'attributes':['id',_0x8b37('0x3'),_0x8b37('0x4'),_0x8b37('0x5')],'include':[{'model':_0x8b37('0x6'),'as':_0x8b37('0x7'),'attributes':['id',_0x8b37('0x3'),_0x8b37('0x8'),'whatsappPause']}]},'log':_0x8b37('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 830a4cf..0b1df22 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 _0x6ae3=['../client','CreateWhatsappQueueReport','Request','UpdateWhatsappQueueReport'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6ae3,0x178));var _0x36ae=function(_0x19eda8,_0x126799){_0x19eda8=_0x19eda8-0x0;var _0x54bc58=_0x6ae3[_0x19eda8];return _0x54bc58;};'use strict';var client=require(_0x36ae('0x0'));exports['create']=function(_0x8bb931){return client['Request'](_0x36ae('0x1'),{'body':_0x8bb931,'log':_0x36ae('0x1')});};exports['update']=function(_0x537960,_0x1e3b70){return client[_0x36ae('0x2')](_0x36ae('0x3'),{'body':_0x1e3b70,'options':{'where':{'uniqueid':_0x537960},'order':[['id','DESC']],'limit':0x1},'log':_0x36ae('0x3')});}; \ No newline at end of file +var _0x9ee5=['../client','create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9ee5,0x10e));var _0x59ee=function(_0x898426,_0x6a4eab){_0x898426=_0x898426-0x0;var _0x5577cf=_0x9ee5[_0x898426];return _0x5577cf;};'use strict';var client=require(_0x59ee('0x0'));exports[_0x59ee('0x1')]=function(_0x5ed448){return client[_0x59ee('0x2')](_0x59ee('0x3'),{'body':_0x5ed448,'log':_0x59ee('0x3')});};exports['update']=function(_0x553df0,_0x30be24){return client[_0x59ee('0x2')](_0x59ee('0x4'),{'body':_0x30be24,'options':{'where':{'uniqueid':_0x553df0},'order':[['id',_0x59ee('0x5')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 8860578..bb59b69 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 _0x57a3=['timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','stop','find','timeout','createQueue','atimeout','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x57a3,0x18f));var _0x357a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x57a3[_0x3bf83f];return _0x22c4a9;};'use strict';var schema=require(_0x357a('0x0'));var _=require('lodash');var util=require(_0x357a('0x1'));var seqqueue=require(_0x357a('0x2'));var logger=require(_0x357a('0x3'))(_0x357a('0x4'));var strategy=require(_0x357a('0x5'));var queue=schema({'name':{'type':_0x357a('0x6'),'required':!![],'message':_0x357a('0x7')},'timeout':{'type':_0x357a('0x8'),'message':_0x357a('0x9')}});function writeLog(_0x4756ef,_0x3fd9c7,_0x20e5c2){return logger[_0x357a('0xa')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x4756ef,_0x3fd9c7[_0x357a('0xb')],_0x20e5c2));}function handleFindAgent(_0x373bf2){return function(_0x3441f0){return _0x3441f0['name'][_0x357a('0xc')]()===_0x373bf2[_0x357a('0xc')]();};}exports[_0x357a('0xd')]=function(_0x212a84,_0x19d443,_0x306f37,_0x10b83a){return function(_0x1ddfa3){try{var _0x4b102d={'name':_0x19d443[0x0],'timeout':_0x19d443[0x1]};var _0xa84860=queue['validate'](_0x4b102d,{'typecast':!![]});if(_0xa84860[_0x357a('0xe')]){logger['error'](_0x357a('0xf'),_0x212a84,_[_0x357a('0x10')](_0xa84860,'message')['join'](',\x20'));_0x1ddfa3[_0x357a('0x11')]();}else{var _0x2826e9=_[_0x357a('0x12')](_0x306f37['agents'],handleFindAgent(_0x4b102d[_0x357a('0xb')]));if(_0x2826e9){var _0x5e1d47=(_0x4b102d[_0x357a('0x13')]||0xa)*0x3e8;var _0x4e7763,_0x19b777;var _0x17cf9c=seqqueue[_0x357a('0x14')](_0x5e1d47);_0x17cf9c['id']=_0x212a84;_0x17cf9c[_0x357a('0x15')]=_0x5e1d47;_0x17cf9c['channel']=_0x10b83a['channel'];writeLog(_0x212a84,_0x2826e9,util['format'](_0x357a('0x16'),_0x5e1d47));_0x306f37[_0x357a('0x17')][_0x212a84]['on']('end',function(){logger['info'](_0x357a('0x18'),_0x212a84);clearTimeout(_0x19b777);_0x19b777=undefined;_0x17cf9c[_0x357a('0x19')]();if(_0x306f37['rules'][_0x212a84]){delete _0x306f37[_0x357a('0x17')][_0x212a84];}_0x1ddfa3[_0x357a('0x11')]();});_0x306f37[_0x357a('0x17')][_0x212a84]['on'](_0x357a('0x1a'),function(){if(_0x306f37[_0x357a('0x17')][_0x212a84]){delete _0x306f37[_0x357a('0x17')][_0x212a84];}});_0x19b777=setTimeout(function(){logger[_0x357a('0xa')]('[%s][AGENT]\x20ROUTING\x20END',_0x212a84);clearTimeout(_0x19b777);_0x17cf9c['close']();_0x1ddfa3[_0x357a('0x1b')]();},_0x5e1d47);strategy[_0x357a('0x1c')](_0x17cf9c,_0x2826e9,_0x306f37,_0x10b83a);}else{logger[_0x357a('0x1d')](_0x357a('0x1e'),_0x212a84,_0x4b102d['name']);_0x1ddfa3[_0x357a('0x11')]();}}}catch(_0x2cce56){console[_0x357a('0x1f')](_0x2cce56);logger[_0x357a('0x1d')](_0x357a('0x20'),_0x212a84,_0x2cce56[_0x357a('0x21')]);_0x1ddfa3[_0x357a('0x11')]();}};}; \ No newline at end of file +var _0xb771=['[%s][QUEUE]\x20%s','stack','validate','util','../../../../config/logger','routing','number','timeout\x20is\x20a\x20number','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','stop','agents','createQueue','channel','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log'];(function(_0x363f17,_0x32c342){var _0x45d258=function(_0x27cfe1){while(--_0x27cfe1){_0x363f17['push'](_0x363f17['shift']());}};_0x45d258(++_0x32c342);}(_0xb771,0x98));var _0x1b77=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xb771[_0x19b3f9];return _0x18c3f6;};'use strict';var schema=require(_0x1b77('0x0'));var _=require('lodash');var util=require(_0x1b77('0x1'));var seqqueue=require('seq-queue');var logger=require(_0x1b77('0x2'))(_0x1b77('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x1b77('0x4'),'message':_0x1b77('0x5')}});function writeLog(_0x25fe12,_0x3c8a97,_0x3f1134){return logger['info'](util[_0x1b77('0x6')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x25fe12,_0x3c8a97[_0x1b77('0x7')],_0x3f1134));}function handleFindAgent(_0x3dd499){return function(_0x2444ed){return _0x2444ed[_0x1b77('0x7')][_0x1b77('0x8')]()===_0x3dd499[_0x1b77('0x8')]();};}exports[_0x1b77('0x9')]=function(_0x252e38,_0x505b8a,_0x1a59be,_0x2a7c1b){return function(_0x3407a8){try{var _0x51dc04={'name':_0x505b8a[0x0],'timeout':_0x505b8a[0x1]};var _0x47cbe9=queue[_0x1b77('0x0')](_0x51dc04,{'typecast':!![]});if(_0x47cbe9[_0x1b77('0xa')]){logger[_0x1b77('0xb')](_0x1b77('0xc'),_0x252e38,_[_0x1b77('0xd')](_0x47cbe9,_0x1b77('0xe'))['join'](',\x20'));_0x3407a8[_0x1b77('0xf')]();}else{var _0x539663=_['find'](_0x1a59be[_0x1b77('0x10')],handleFindAgent(_0x51dc04['name']));if(_0x539663){var _0x120b4d=(_0x51dc04['timeout']||0xa)*0x3e8;var _0x43ed9b,_0x5368bd;var _0x5b5fe6=seqqueue[_0x1b77('0x11')](_0x120b4d);_0x5b5fe6['id']=_0x252e38;_0x5b5fe6['atimeout']=_0x120b4d;_0x5b5fe6[_0x1b77('0x12')]=_0x2a7c1b[_0x1b77('0x12')];writeLog(_0x252e38,_0x539663,util[_0x1b77('0x6')]('START:%s',_0x120b4d));_0x1a59be[_0x1b77('0x13')][_0x252e38]['on'](_0x1b77('0x14'),function(){logger[_0x1b77('0x15')](_0x1b77('0x16'),_0x252e38);clearTimeout(_0x5368bd);_0x5368bd=undefined;_0x5b5fe6[_0x1b77('0x17')]();if(_0x1a59be[_0x1b77('0x13')][_0x252e38]){delete _0x1a59be[_0x1b77('0x13')][_0x252e38];}_0x3407a8[_0x1b77('0xf')]();});_0x1a59be[_0x1b77('0x13')][_0x252e38]['on'](_0x1b77('0x18'),function(){if(_0x1a59be[_0x1b77('0x13')][_0x252e38]){delete _0x1a59be[_0x1b77('0x13')][_0x252e38];}});_0x5368bd=setTimeout(function(){logger[_0x1b77('0x15')](_0x1b77('0x19'),_0x252e38);clearTimeout(_0x5368bd);_0x5b5fe6[_0x1b77('0x17')]();_0x3407a8['next']();},_0x120b4d);strategy['agent'](_0x5b5fe6,_0x539663,_0x1a59be,_0x2a7c1b);}else{logger[_0x1b77('0xb')](_0x1b77('0x1a'),_0x252e38,_0x51dc04[_0x1b77('0x7')]);_0x3407a8['stop']();}}}catch(_0x270403){console[_0x1b77('0x1b')](_0x270403);logger[_0x1b77('0xb')](_0x1b77('0x1c'),_0x252e38,_0x270403[_0x1b77('0x1d')]);_0x3407a8[_0x1b77('0xf')]();}};}; \ 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 cfff836..dc58a1a 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 _0x15aa=['error','next','message','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty','getMustacheRender','Message','create','then','body','catch','[%s][AMAZONLEX]\x20%s','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST'];(function(_0x22fadf,_0x509ed9){var _0x4f47d4=function(_0x22388b){while(--_0x22388b){_0x22fadf['push'](_0x22fadf['shift']());}};_0x4f47d4(++_0x509ed9);}(_0x15aa,0x1ad));var _0xa15a=function(_0x505591,_0x4a083e){_0x505591=_0x505591-0x0;var _0x5a4e4c=_0x15aa[_0x505591];return _0x5a4e4c;};'use strict';var _=require(_0xa15a('0x0'));var moment=require(_0xa15a('0x1'));var AWS=require(_0xa15a('0x2'));var utils=require(_0xa15a('0x3'));var logger=require(_0xa15a('0x4'))('routing');var rpc={'chatMessage':require(_0xa15a('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa15a('0x6')),'smsMessage':require(_0xa15a('0x7')),'faxMessage':require(_0xa15a('0x8')),'whatsappMessage':require(_0xa15a('0x9'))};exports['consequence']=function(_0x45f797,_0x359b0a){return function(_0x572ce3){try{if(!_[_0xa15a('0xa')](this[_0xa15a('0xb')]['UserId'])){logger[_0xa15a('0xc')]('[%s][AMAZONLEX]\x20%s',_0x45f797,_0xa15a('0xd'));return _0x572ce3['next']();}var _0x8b012={'ContactId':this['contact']['id'],'sentAt':moment()[_0xa15a('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa15a('0xf')};if(this[_0xa15a('0x10')]===_0xa15a('0x11')||this[_0xa15a('0x10')]===_0xa15a('0x12')){_0x8b012['phone']=this[_0xa15a('0xb')][_0xa15a('0x13')];}var _0x4741d9=this[_0xa15a('0x10')];if(_0x4741d9===_0xa15a('0x14')){_0x8b012[_0xa15a('0x15')]=this[_0xa15a('0x16')]['id'];}else{_0x8b012[_['upperFirst'](_0x4741d9)+_0xa15a('0x17')]=this[_0xa15a('0x16')]['id'];}_0x8b012[_[_0xa15a('0x18')](_0x4741d9)+_0xa15a('0x19')]=this[_0xa15a('0xb')]['id'];if(this['interaction']['created']){var _0x32b37b=_0x359b0a[0x4];if(!_[_0xa15a('0x1a')](_0x32b37b)){_0x8b012['body']=utils[_0xa15a('0x1b')](_0x32b37b,this);return rpc[_0x4741d9+_0xa15a('0x1c')][_0xa15a('0x1d')](_0x8b012)[_0xa15a('0x1e')](function(_0x28df53){logger[_0xa15a('0xc')]('[%s][AMAZONLEX]\x20%s',_0x45f797,_0x8b012[_0xa15a('0x1f')]);})[_0xa15a('0x20')](function(_0x4ee3fe){logger['error'](_0xa15a('0x21'),_0x45f797,JSON[_0xa15a('0x22')](_0x4ee3fe));})[_0xa15a('0x23')](function(){logger[_0xa15a('0xc')](_0xa15a('0x24'),_0x45f797);_0x572ce3[_0xa15a('0x25')]();});}else{logger[_0xa15a('0xc')](_0xa15a('0x26'),_0x45f797);_0x572ce3[_0xa15a('0x25')]();}}else{var _0x3e83f8=this;var _0x2e2664=new AWS[(_0xa15a('0x27'))]({'accessKeyId':_0x359b0a[0x0],'secretAccessKey':_0x359b0a[0x1],'region':_0x359b0a[0x2]});var _0x21fc9f={'botAlias':_0xa15a('0x28'),'botName':_0x359b0a[0x3],'inputText':this['message'][_0xa15a('0x1f')],'userId':this[_0xa15a('0x10')]+':'+this[_0xa15a('0xb')]['id']['toString']()};_0x2e2664['postText'](_0x21fc9f,function(_0x3a628d,_0x4e0470){if(_0x3a628d){logger[_0xa15a('0x29')](_0xa15a('0x21'),_0x45f797,_0x3a628d['message']);_0x572ce3[_0xa15a('0x2a')]();}else if(_0x4e0470&&_0x4e0470['message']){_0x3e83f8[_0xa15a('0x1f')]['amazonlex']=_0x4e0470;_0x8b012[_0xa15a('0x1f')]=_0x4e0470[_0xa15a('0x2b')];_0x8b012['providerName']='amazonlex';_0x8b012[_0xa15a('0x2c')]=JSON[_0xa15a('0x22')](_0x4e0470);return rpc[_0x4741d9+_0xa15a('0x1c')]['create'](_0x8b012)[_0xa15a('0x1e')](function(_0x48ea28){logger[_0xa15a('0xc')](_0xa15a('0x21'),_0x45f797,_0x8b012[_0xa15a('0x1f')]);if(_0x4e0470[_0xa15a('0x2d')]==_0xa15a('0x2e')){_0x572ce3[_0xa15a('0x2a')]();}else{_0x572ce3['stop']();}})['catch'](function(_0x16a137){logger[_0xa15a('0x29')]('[%s][AMAZONLEX]\x20%s',_0x45f797,JSON[_0xa15a('0x22')](_0x16a137));_0x572ce3[_0xa15a('0x2a')]();});}else{_0x572ce3[_0xa15a('0x2a')]();}});}}catch(_0x4a4dc3){logger[_0xa15a('0x29')]('[%s][AMAZONLEX]\x20%s',_0x45f797,JSON[_0xa15a('0x22')](_0x4a4dc3));_0x572ce3[_0xa15a('0x25')]();}};}; \ No newline at end of file +var _0xe9a4=['providerResponse','dialogState','Failed','next','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','Message','create','[%s][AMAZONLEX]\x20%s','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','postText','error','providerName','amazonlex'];(function(_0x383f31,_0x3c9b07){var _0x1d9755=function(_0x2f6b59){while(--_0x2f6b59){_0x383f31['push'](_0x383f31['shift']());}};_0x1d9755(++_0x3c9b07);}(_0xe9a4,0x112));var _0x4e9a=function(_0x5daeb2,_0x4b007c){_0x5daeb2=_0x5daeb2-0x0;var _0x2dbb9f=_0xe9a4[_0x5daeb2];return _0x2dbb9f;};'use strict';var _=require(_0x4e9a('0x0'));var moment=require('moment');var AWS=require(_0x4e9a('0x1'));var utils=require(_0x4e9a('0x2'));var logger=require(_0x4e9a('0x3'))(_0x4e9a('0x4'));var rpc={'chatMessage':require(_0x4e9a('0x5')),'openchannelMessage':require(_0x4e9a('0x6')),'mailMessage':require(_0x4e9a('0x7')),'smsMessage':require(_0x4e9a('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x4e9a('0x9'))};exports[_0x4e9a('0xa')]=function(_0x1b565e,_0x3aa693){return function(_0x42f508){try{if(!_[_0x4e9a('0xb')](this[_0x4e9a('0xc')][_0x4e9a('0xd')])){logger[_0x4e9a('0xe')]('[%s][AMAZONLEX]\x20%s',_0x1b565e,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x42f508['next']();}var _0x272d68={'ContactId':this[_0x4e9a('0xf')]['id'],'sentAt':moment()[_0x4e9a('0x10')](_0x4e9a('0x11')),'direction':'out'};if(this[_0x4e9a('0x12')]===_0x4e9a('0x13')||this[_0x4e9a('0x12')]==='whatsapp'){_0x272d68[_0x4e9a('0x14')]=this['interaction'][_0x4e9a('0x14')];}var _0x100068=this[_0x4e9a('0x12')];if(_0x100068==='chat'){_0x272d68[_0x4e9a('0x15')]=this[_0x4e9a('0x16')]['id'];}else{_0x272d68[_[_0x4e9a('0x17')](_0x100068)+_0x4e9a('0x18')]=this[_0x4e9a('0x16')]['id'];}_0x272d68[_[_0x4e9a('0x17')](_0x100068)+'InteractionId']=this['interaction']['id'];if(this[_0x4e9a('0xc')][_0x4e9a('0x19')]){var _0x3f8803=_0x3aa693[0x4];if(!_[_0x4e9a('0x1a')](_0x3f8803)){_0x272d68[_0x4e9a('0x1b')]=utils['getMustacheRender'](_0x3f8803,this);return rpc[_0x100068+_0x4e9a('0x1c')][_0x4e9a('0x1d')](_0x272d68)['then'](function(_0x522039){logger['info']('[%s][AMAZONLEX]\x20%s',_0x1b565e,_0x272d68[_0x4e9a('0x1b')]);})['catch'](function(_0xb5076f){logger['error'](_0x4e9a('0x1e'),_0x1b565e,JSON[_0x4e9a('0x1f')](_0xb5076f));})['finally'](function(){logger[_0x4e9a('0xe')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1b565e);_0x42f508['stop']();});}else{logger['info'](_0x4e9a('0x20'),_0x1b565e);_0x42f508[_0x4e9a('0x21')]();}}else{var _0x328703=this;var _0x252694=new AWS[(_0x4e9a('0x22'))]({'accessKeyId':_0x3aa693[0x0],'secretAccessKey':_0x3aa693[0x1],'region':_0x3aa693[0x2]});var _0x3b4e02={'botAlias':_0x4e9a('0x23'),'botName':_0x3aa693[0x3],'inputText':this[_0x4e9a('0x24')][_0x4e9a('0x1b')],'userId':this[_0x4e9a('0x12')]+':'+this[_0x4e9a('0xc')]['id']['toString']()};_0x252694[_0x4e9a('0x25')](_0x3b4e02,function(_0x2ce110,_0x3ac4e3){if(_0x2ce110){logger[_0x4e9a('0x26')](_0x4e9a('0x1e'),_0x1b565e,_0x2ce110['message']);_0x42f508['next']();}else if(_0x3ac4e3&&_0x3ac4e3[_0x4e9a('0x24')]){_0x328703[_0x4e9a('0x1b')]['amazonlex']=_0x3ac4e3;_0x272d68[_0x4e9a('0x1b')]=_0x3ac4e3['message'];_0x272d68[_0x4e9a('0x27')]=_0x4e9a('0x28');_0x272d68[_0x4e9a('0x29')]=JSON['stringify'](_0x3ac4e3);return rpc[_0x100068+_0x4e9a('0x1c')][_0x4e9a('0x1d')](_0x272d68)['then'](function(_0x5de1f7){logger[_0x4e9a('0xe')](_0x4e9a('0x1e'),_0x1b565e,_0x272d68[_0x4e9a('0x1b')]);if(_0x3ac4e3[_0x4e9a('0x2a')]==_0x4e9a('0x2b')){_0x42f508[_0x4e9a('0x2c')]();}else{_0x42f508['stop']();}})['catch'](function(_0x54098b){logger[_0x4e9a('0x26')](_0x4e9a('0x1e'),_0x1b565e,JSON['stringify'](_0x54098b));_0x42f508['next']();});}else{_0x42f508[_0x4e9a('0x2c')]();}});}}catch(_0x525376){logger[_0x4e9a('0x26')](_0x4e9a('0x1e'),_0x1b565e,JSON[_0x4e9a('0x1f')](_0x525376));_0x42f508[_0x4e9a('0x21')]();}};}; \ 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 8462516..370f407 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 _0x6f6d=['[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','Message','html','','headers','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','stop','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created'];(function(_0x216f7d,_0x496249){var _0xc49d7f=function(_0x27be52){while(--_0x27be52){_0x216f7d['push'](_0x216f7d['shift']());}};_0xc49d7f(++_0x496249);}(_0x6f6d,0xac));var _0xd6f6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6f6d[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xd6f6('0x0'));var moment=require(_0xd6f6('0x1'));var utils=require('./utils');var logger=require(_0xd6f6('0x2'))(_0xd6f6('0x3'));var rpc={'chatMessage':require(_0xd6f6('0x4')),'openchannelMessage':require(_0xd6f6('0x5')),'mailMessage':require(_0xd6f6('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xd6f6('0x7')),'whatsappMessage':require(_0xd6f6('0x8')),'chatInteraction':require(_0xd6f6('0x9')),'openchannelInteraction':require(_0xd6f6('0xa')),'mailInteraction':require(_0xd6f6('0xb')),'smsInteraction':require(_0xd6f6('0xc')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xd6f6('0xd'))};var mailRpc=require(_0xd6f6('0xe'));exports[_0xd6f6('0xf')]=function(_0x4bbadc,_0x20deb2,_0x240c24,_0x4f657d){return function(_0x5de57e){try{var _0x29d1c9=this[_0xd6f6('0x10')];if(_0x29d1c9===_0xd6f6('0x11')&&_0x4f657d[_0xd6f6('0x12')][_0xd6f6('0x13')]){logger[_0xd6f6('0x14')]('[%s][AUTOREPLY]\x20%s',_0x4bbadc,_0xd6f6('0x15'));return _0x5de57e[_0xd6f6('0x16')]();}if(_0x20deb2[0x0]==='1'&&(_[_0xd6f6('0x17')](this[_0xd6f6('0x18')][_0xd6f6('0x19')])||!this[_0xd6f6('0x18')]['created'])){logger[_0xd6f6('0x14')](_0xd6f6('0x1a'),_0x4bbadc,_0xd6f6('0x1b'));return _0x5de57e['next']();}if(_0x20deb2[0x0]==='2'&&this['interaction']['autoreplyExecuted']){logger[_0xd6f6('0x14')](_0xd6f6('0x1c'),_0x4bbadc,_0xd6f6('0x1d'));return _0x5de57e[_0xd6f6('0x16')]();}var _0x484b5c={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xd6f6('0x1e')),'direction':'out'};if(this[_0xd6f6('0x10')]==='mail'){_0x484b5c['body']=utils['getMustacheRender'](_0x20deb2[0x2],this);}else{_0x484b5c[_0xd6f6('0x12')]=utils['getMustacheRender'](_0x20deb2[0x1],this);}if(this[_0xd6f6('0x1f')]){_0x484b5c['to']=this[_0xd6f6('0x1f')][_0xd6f6('0x20')]||'';if(this['channel']===_0xd6f6('0x11')&&_0x20deb2[0x1]==='1'){_0x484b5c['cc']=this[_0xd6f6('0x1f')]['cc']||'';}_0x484b5c['from']=this[_0xd6f6('0x1f')]['to']||'';_0x484b5c[_0xd6f6('0x21')]=this[_0xd6f6('0x1f')][_0xd6f6('0x21')]||'';_0x484b5c[_0xd6f6('0x22')]=!![];if(this[_0xd6f6('0x1f')]['subject']){_0x484b5c['subject']='';_0x484b5c[_0xd6f6('0x23')]+=_[_0xd6f6('0x24')](this[_0xd6f6('0x1f')][_0xd6f6('0x23')],_0xd6f6('0x25'))?'':_0xd6f6('0x26');_0x484b5c[_0xd6f6('0x23')]+=this[_0xd6f6('0x1f')][_0xd6f6('0x23')];}}if(this['channel']===_0xd6f6('0x27')){_0x484b5c[_0xd6f6('0x28')]=this[_0xd6f6('0x29')]['id'];}else{_0x484b5c[_['upperFirst'](this[_0xd6f6('0x10')])+_0xd6f6('0x2a')]=this['account']['id'];}_0x484b5c[_[_0xd6f6('0x2b')](this[_0xd6f6('0x10')])+_0xd6f6('0x2c')]=this[_0xd6f6('0x18')]['id'];var _0x3e9413=this[_0xd6f6('0x18')];if(rpc[this[_0xd6f6('0x10')]+_0xd6f6('0x2d')]){if(this[_0xd6f6('0x10')]===_0xd6f6('0x11')){_0x484b5c['inReplyTo']=this[_0xd6f6('0x1f')]['messageId'];_0x484b5c[_0xd6f6('0x2e')]=''+_['replace'](_0x484b5c[_0xd6f6('0x12')],'','replace','','headers','auto-replied','All','sendMailMessage','smtpOptions','then','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s'];(function(_0x59e131,_0x59685f){var _0x11ef0d=function(_0x3a9024){while(--_0x3a9024){_0x59e131['push'](_0x59e131['shift']());}};_0x11ef0d(++_0x59685f);}(_0x87a0,0xef));var _0x087a=function(_0x2f8689,_0x309c2d){_0x2f8689=_0x2f8689-0x0;var _0x17fb53=_0x87a0[_0x2f8689];return _0x17fb53;};'use strict';var _=require(_0x087a('0x0'));var moment=require(_0x087a('0x1'));var utils=require('./utils');var logger=require(_0x087a('0x2'))(_0x087a('0x3'));var rpc={'chatMessage':require(_0x087a('0x4')),'openchannelMessage':require(_0x087a('0x5')),'mailMessage':require(_0x087a('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x087a('0x7')),'chatInteraction':require(_0x087a('0x8')),'openchannelInteraction':require(_0x087a('0x9')),'mailInteraction':require(_0x087a('0xa')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x087a('0xb')),'whatsappInteraction':require(_0x087a('0xc'))};var mailRpc=require(_0x087a('0xd'));exports[_0x087a('0xe')]=function(_0x6f5f76,_0x14c5e2,_0x4932d8,_0x4d3a5a){return function(_0x1698ab){try{var _0xc3a1e4=this[_0x087a('0xf')];if(_0xc3a1e4===_0x087a('0x10')&&_0x4d3a5a[_0x087a('0x11')][_0x087a('0x12')]){logger[_0x087a('0x13')]('[%s][AUTOREPLY]\x20%s',_0x6f5f76,_0x087a('0x14'));return _0x1698ab[_0x087a('0x15')]();}if(_0x14c5e2[0x0]==='1'&&(_[_0x087a('0x16')](this[_0x087a('0x17')][_0x087a('0x18')])||!this[_0x087a('0x17')][_0x087a('0x18')])){logger[_0x087a('0x13')](_0x087a('0x19'),_0x6f5f76,_0x087a('0x1a'));return _0x1698ab[_0x087a('0x15')]();}if(_0x14c5e2[0x0]==='2'&&this[_0x087a('0x17')][_0x087a('0x1b')]){logger[_0x087a('0x13')](_0x087a('0x1c'),_0x6f5f76,_0x087a('0x1d'));return _0x1698ab[_0x087a('0x15')]();}var _0x6a5f80={'ContactId':this['contact']['id'],'sentAt':moment()[_0x087a('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x087a('0x1f')};if(this[_0x087a('0xf')]===_0x087a('0x10')){_0x6a5f80[_0x087a('0x11')]=utils[_0x087a('0x20')](_0x14c5e2[0x2],this);}else{_0x6a5f80[_0x087a('0x11')]=utils[_0x087a('0x20')](_0x14c5e2[0x1],this);}if(this[_0x087a('0x21')]){_0x6a5f80['to']=this[_0x087a('0x21')]['from']||'';if(this[_0x087a('0xf')]===_0x087a('0x10')&&_0x14c5e2[0x1]==='1'){_0x6a5f80['cc']=this['message']['cc']||'';}_0x6a5f80['from']=this[_0x087a('0x21')]['to']||'';_0x6a5f80['phone']=this[_0x087a('0x21')][_0x087a('0x22')]||'';_0x6a5f80[_0x087a('0x23')]=!![];if(this[_0x087a('0x21')][_0x087a('0x24')]){_0x6a5f80['subject']='';_0x6a5f80[_0x087a('0x24')]+=_[_0x087a('0x25')](this['message'][_0x087a('0x24')],_0x087a('0x26'))?'':_0x087a('0x27');_0x6a5f80['subject']+=this[_0x087a('0x21')][_0x087a('0x24')];}}if(this[_0x087a('0xf')]==='chat'){_0x6a5f80[_0x087a('0x28')]=this[_0x087a('0x29')]['id'];}else{_0x6a5f80[_['upperFirst'](this[_0x087a('0xf')])+_0x087a('0x2a')]=this[_0x087a('0x29')]['id'];}_0x6a5f80[_[_0x087a('0x2b')](this['channel'])+_0x087a('0x2c')]=this[_0x087a('0x17')]['id'];var _0x1d7cef=this[_0x087a('0x17')];if(rpc[this[_0x087a('0xf')]+_0x087a('0x2d')]){if(this[_0x087a('0xf')]===_0x087a('0x10')){_0x6a5f80[_0x087a('0x2e')]=this[_0x087a('0x21')][_0x087a('0x2f')];_0x6a5f80['html']=_0x087a('0x30')+_[_0x087a('0x31')](_0x6a5f80[_0x087a('0x11')],_0x087a('0x32'),']+(>|$)/g,''),'priorityTrue':_0x555d83[0x1],'priorityFalse':_0x555d83[0x2]};var _0x116f26=gotoif['validate'](_0x223100,{'typecast':!![]});if(_0x116f26['length']){logger[_0x3456('0x9')](_0x3456('0xa'),_0x304bb6,_[_0x3456('0xb')](_0x116f26,'message')[_0x3456('0xc')](',\x20'));_0x4a6a3a[_0x3456('0xd')]();}else{try{var _0x98c2a6=eval('('+_0x223100[_0x3456('0xe')]+')');var _0x11e59d=_0x98c2a6?_0x223100['priorityTrue']:_0x223100[_0x3456('0xf')];logger[_0x3456('0x10')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x304bb6,_0x223100[_0x3456('0xe')],_0x98c2a6,_0x11e59d||_0x3456('0x11'));if(_0x11e59d){var _0x5c90d6=_[_0x3456('0x12')](_0x4a6a3a[_0x3456('0x13')](),{'p':_0x11e59d});if(_0x5c90d6>=0x0){logger[_0x3456('0x10')](_0x3456('0x14'),_0x304bb6,_0x11e59d||'next',_0x5c90d6);_0x4a6a3a[_0x3456('0x11')](_0x5c90d6);}else{logger[_0x3456('0x10')](_0x3456('0x15'),_0x304bb6,_0x11e59d||_0x3456('0x11'));_0x4a6a3a[_0x3456('0xd')]();}}else{_0x4a6a3a[_0x3456('0x11')]();}}catch(_0xc17e58){logger[_0x3456('0x9')](_0x3456('0x16'),_0x304bb6,_0xc17e58[_0x3456('0x17')]);_0x4a6a3a[_0x3456('0xd')]();}}}catch(_0x1099b7){logger[_0x3456('0x9')](_0x3456('0xa'),_0x304bb6,JSON[_0x3456('0x18')](_0x1099b7));_0x4a6a3a[_0x3456('0xd')]();}};}; \ No newline at end of file +var _0x71f8=['message','join','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20eval\x20error:\x20%s','stop','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','error','[%s][GOTOIF]\x20%s','map'];(function(_0x5cc541,_0x3f123c){var _0x4d3dfa=function(_0x5669a1){while(--_0x5669a1){_0x5cc541['push'](_0x5cc541['shift']());}};_0x4d3dfa(++_0x3f123c);}(_0x71f8,0x184));var _0x871f=function(_0x22daf4,_0x1da5e8){_0x22daf4=_0x22daf4-0x0;var _0x4ac4de=_0x71f8[_0x22daf4];return _0x4ac4de;};'use strict';var schema=require(_0x871f('0x0'));var _=require(_0x871f('0x1'));var htmlToText=require(_0x871f('0x2'));var utils=require(_0x871f('0x3'));var logger=require(_0x871f('0x4'))(_0x871f('0x5'));var gotoif=schema({'condition':{'type':_0x871f('0x6'),'required':!![],'message':_0x871f('0x7')},'priorityTrue':{'type':_0x871f('0x8'),'message':_0x871f('0x9')},'priorityFalse':{'type':'number','message':_0x871f('0xa')}});exports['consequence']=function(_0x24b7b8,_0x6185e8){return function(_0x2f87fa){try{var _0x38ae2e={'condition':htmlToText[_0x871f('0xb')](utils[_0x871f('0xc')](_0x6185e8[0x0],this),{'wordwrap':![]})[_0x871f('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x6185e8[0x1],'priorityFalse':_0x6185e8[0x2]};var _0x4cb8ec=gotoif['validate'](_0x38ae2e,{'typecast':!![]});if(_0x4cb8ec['length']){logger[_0x871f('0xe')](_0x871f('0xf'),_0x24b7b8,_[_0x871f('0x10')](_0x4cb8ec,_0x871f('0x11'))[_0x871f('0x12')](',\x20'));_0x2f87fa['stop']();}else{try{var _0x32bbbf=eval('('+_0x38ae2e[_0x871f('0x13')]+')');var _0xf93c3f=_0x32bbbf?_0x38ae2e['priorityTrue']:_0x38ae2e[_0x871f('0x14')];logger[_0x871f('0x15')](_0x871f('0x16'),_0x24b7b8,_0x38ae2e[_0x871f('0x13')],_0x32bbbf,_0xf93c3f||_0x871f('0x17'));if(_0xf93c3f){var _0x297f9b=_['findIndex'](_0x2f87fa[_0x871f('0x18')](),{'p':_0xf93c3f});if(_0x297f9b>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x24b7b8,_0xf93c3f||_0x871f('0x17'),_0x297f9b);_0x2f87fa['next'](_0x297f9b);}else{logger[_0x871f('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x24b7b8,_0xf93c3f||'next');_0x2f87fa['stop']();}}else{_0x2f87fa[_0x871f('0x17')]();}}catch(_0x54ff46){logger[_0x871f('0xe')](_0x871f('0x19'),_0x24b7b8,_0x54ff46['message']);_0x2f87fa['stop']();}}}catch(_0x3fb2d5){logger[_0x871f('0xe')]('[%s][GOTOIF]\x20%s',_0x24b7b8,JSON['stringify'](_0x3fb2d5));_0x2f87fa[_0x871f('0x1a')]();}};}; \ 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 176a9b8..0188ff6 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 _0x78f8=['validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','error','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20%s','stringify'];(function(_0x5da27f,_0x504b76){var _0x54a3fb=function(_0x3b65a8){while(--_0x3b65a8){_0x5da27f['push'](_0x5da27f['shift']());}};_0x54a3fb(++_0x504b76);}(_0x78f8,0x1ba));var _0x878f=function(_0x2e1b0a,_0x3b4a9a){_0x2e1b0a=_0x2e1b0a-0x0;var _0x4966a9=_0x78f8[_0x2e1b0a];return _0x4966a9;};'use strict';var schema=require(_0x878f('0x0'));var _=require(_0x878f('0x1'));var logger=require(_0x878f('0x2'))(_0x878f('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x878f('0x4')}});exports['consequence']=function(_0x12a163,_0x1ef056){return function(_0x56cdb5){try{var _0x5d67c1={'priority':_0x1ef056[0x0]};var _0x48ae7d=gotop[_0x878f('0x0')](_0x5d67c1,{'typecast':!![]});if(_0x48ae7d['length']){logger[_0x878f('0x5')]('[%s][GOTOP]\x20%s',_0x12a163,_['map'](_0x48ae7d,'message')[_0x878f('0x6')](',\x20'));_0x56cdb5[_0x878f('0x7')]();}else{logger['info'](_0x878f('0x8'),_0x12a163,_0x5d67c1[_0x878f('0x9')]);if(_0x5d67c1['priority']){var _0x40ea0a=_[_0x878f('0xa')](_0x56cdb5[_0x878f('0xb')](),{'p':_0x5d67c1['priority']});if(_0x40ea0a>=0x0){logger[_0x878f('0xc')](_0x878f('0xd'),_0x12a163,_0x5d67c1[_0x878f('0x9')]||'next',_0x40ea0a);_0x56cdb5['next'](_0x40ea0a);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x12a163,_0x5d67c1[_0x878f('0x9')]||_0x878f('0xe'));_0x56cdb5[_0x878f('0x7')]();}}else{_0x56cdb5[_0x878f('0xe')]();}}}catch(_0x2c4a48){logger[_0x878f('0x5')](_0x878f('0xf'),_0x12a163,JSON[_0x878f('0x10')](_0x2c4a48));_0x56cdb5[_0x878f('0x7')]();}};}; \ No newline at end of file +var _0x1137=['map','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s'];(function(_0x53acb9,_0x3e4767){var _0x21aa20=function(_0x169b6d){while(--_0x169b6d){_0x53acb9['push'](_0x53acb9['shift']());}};_0x21aa20(++_0x3e4767);}(_0x1137,0x136));var _0x7113=function(_0x2e3107,_0x25f970){_0x2e3107=_0x2e3107-0x0;var _0x833d69=_0x1137[_0x2e3107];return _0x833d69;};'use strict';var schema=require(_0x7113('0x0'));var _=require(_0x7113('0x1'));var logger=require(_0x7113('0x2'))(_0x7113('0x3'));var gotop=schema({'priority':{'type':_0x7113('0x4'),'required':!![],'message':_0x7113('0x5')}});exports[_0x7113('0x6')]=function(_0xffc14f,_0x40c049){return function(_0x35e586){try{var _0x5b0d9c={'priority':_0x40c049[0x0]};var _0x355c42=gotop[_0x7113('0x0')](_0x5b0d9c,{'typecast':!![]});if(_0x355c42[_0x7113('0x7')]){logger[_0x7113('0x8')](_0x7113('0x9'),_0xffc14f,_[_0x7113('0xa')](_0x355c42,'message')['join'](',\x20'));_0x35e586[_0x7113('0xb')]();}else{logger[_0x7113('0xc')](_0x7113('0xd'),_0xffc14f,_0x5b0d9c['priority']);if(_0x5b0d9c[_0x7113('0xe')]){var _0x34f27d=_[_0x7113('0xf')](_0x35e586[_0x7113('0x10')](),{'p':_0x5b0d9c[_0x7113('0xe')]});if(_0x34f27d>=0x0){logger['info'](_0x7113('0x11'),_0xffc14f,_0x5b0d9c['priority']||'next',_0x34f27d);_0x35e586[_0x7113('0x12')](_0x34f27d);}else{logger[_0x7113('0xc')](_0x7113('0x13'),_0xffc14f,_0x5b0d9c['priority']||_0x7113('0x12'));_0x35e586[_0x7113('0xb')]();}}else{_0x35e586[_0x7113('0x12')]();}}}catch(_0x535803){logger[_0x7113('0x8')](_0x7113('0x9'),_0xffc14f,JSON['stringify'](_0x535803));_0x35e586[_0x7113('0xb')]();}};}; \ 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 6072c68..afb6079 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 _0x5f4d=['account','upperFirst','AccountId','InteractionId','interaction','channel','Message','create','then','info','[%s][MESSAGE]\x20%s','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId'];(function(_0x461cb7,_0x17c547){var _0x299e16=function(_0x2e15eb){while(--_0x2e15eb){_0x461cb7['push'](_0x461cb7['shift']());}};_0x299e16(++_0x17c547);}(_0x5f4d,0x91));var _0xd5f4=function(_0x224b3b,_0x5aa1ae){_0x224b3b=_0x224b3b-0x0;var _0x5d8820=_0x5f4d[_0x224b3b];return _0x5d8820;};'use strict';var _=require(_0xd5f4('0x0'));var utils=require(_0xd5f4('0x1'));var logger=require(_0xd5f4('0x2'))('routing');var rpc={'chatMessage':require(_0xd5f4('0x3')),'openchannelMessage':require(_0xd5f4('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xd5f4('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xd5f4('0x6')]=function(_0x207c2d,_0x14591c){return function(_0x62c385){try{var _0x18461c={'body':utils[_0xd5f4('0x7')](_0x14591c[0x0],this),'ContactId':this[_0xd5f4('0x8')]['id']};if(this['channel']===_0xd5f4('0x9')){_0x18461c[_0xd5f4('0xa')]=this[_0xd5f4('0xb')]['id'];}else{_0x18461c[_[_0xd5f4('0xc')](this['channel'])+_0xd5f4('0xd')]=this[_0xd5f4('0xb')]['id'];}_0x18461c[_[_0xd5f4('0xc')](this['channel'])+_0xd5f4('0xe')]=this[_0xd5f4('0xf')]['id'];if(rpc[this[_0xd5f4('0x10')]+_0xd5f4('0x11')]){return rpc[this[_0xd5f4('0x10')]+'Message'][_0xd5f4('0x12')](_0x18461c)[_0xd5f4('0x13')](function(_0x2c1ec1){logger[_0xd5f4('0x14')](_0xd5f4('0x15'),_0x207c2d,_0x18461c['body']);_0x62c385['next']();})[_0xd5f4('0x16')](function(_0x1273b6){logger[_0xd5f4('0x17')](_0xd5f4('0x15'),_0x207c2d,JSON[_0xd5f4('0x18')](_0x1273b6));_0x62c385[_0xd5f4('0x19')]();});}}catch(_0x1082ea){logger['error'](_0xd5f4('0x15'),_0x207c2d,JSON['stringify'](_0x1082ea));_0x62c385[_0xd5f4('0x19')]();}};}; \ No newline at end of file +var _0x988c=['interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','account','upperFirst','InteractionId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x988c,0x136));var _0xc988=function(_0xe0251a,_0x36f386){_0xe0251a=_0xe0251a-0x0;var _0x7cf0ab=_0x988c[_0xe0251a];return _0x7cf0ab;};'use strict';var _=require('lodash');var utils=require(_0xc988('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xc988('0x1')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xc988('0x2')),'smsMessage':require(_0xc988('0x3')),'faxMessage':require(_0xc988('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xc988('0x5')]=function(_0xd3a0e4,_0x4946a4){return function(_0x5a3437){try{var _0x28bfc7={'body':utils[_0xc988('0x6')](_0x4946a4[0x0],this),'ContactId':this[_0xc988('0x7')]['id']};if(this[_0xc988('0x8')]==='chat'){_0x28bfc7['ChatWebsiteId']=this[_0xc988('0x9')]['id'];}else{_0x28bfc7[_[_0xc988('0xa')](this[_0xc988('0x8')])+'AccountId']=this[_0xc988('0x9')]['id'];}_0x28bfc7[_[_0xc988('0xa')](this[_0xc988('0x8')])+_0xc988('0xb')]=this[_0xc988('0xc')]['id'];if(rpc[this[_0xc988('0x8')]+_0xc988('0xd')]){return rpc[this[_0xc988('0x8')]+'Message'][_0xc988('0xe')](_0x28bfc7)[_0xc988('0xf')](function(_0x4177ce){logger[_0xc988('0x10')](_0xc988('0x11'),_0xd3a0e4,_0x28bfc7[_0xc988('0x12')]);_0x5a3437[_0xc988('0x13')]();})['catch'](function(_0x58f652){logger[_0xc988('0x14')](_0xc988('0x11'),_0xd3a0e4,JSON[_0xc988('0x15')](_0x58f652));_0x5a3437[_0xc988('0x16')]();});}}catch(_0x16172e){logger[_0xc988('0x14')](_0xc988('0x11'),_0xd3a0e4,JSON[_0xc988('0x15')](_0x16172e));_0x5a3437[_0xc988('0x16')]();}};}; \ 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 a9c96c0..0f25ece 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 _0x9089=['routing','consequence','[%s][NOOP]\x20%s','next','error','stringify','stop','./utils','../../../../config/logger'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0x9089,0x154));var _0x9908=function(_0x233716,_0x346676){_0x233716=_0x233716-0x0;var _0x302298=_0x9089[_0x233716];return _0x302298;};'use strict';var utils=require(_0x9908('0x0'));var logger=require(_0x9908('0x1'))(_0x9908('0x2'));exports[_0x9908('0x3')]=function(_0x4caf7a,_0x33a684){return function(_0x97f885){try{logger['info'](_0x9908('0x4'),_0x4caf7a,utils['getMustacheRender'](_0x33a684[0x0],this));_0x97f885[_0x9908('0x5')]();}catch(_0x388740){logger[_0x9908('0x6')](_0x9908('0x4'),_0x4caf7a,JSON[_0x9908('0x7')](_0x388740));_0x97f885[_0x9908('0x8')]();}};}; \ No newline at end of file +var _0x29ef=['routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','./utils','../../../../config/logger'];(function(_0x4344ce,_0x525f14){var _0x33c6e1=function(_0x1eb541){while(--_0x1eb541){_0x4344ce['push'](_0x4344ce['shift']());}};_0x33c6e1(++_0x525f14);}(_0x29ef,0x196));var _0xf29e=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0x29ef[_0x2601b4];return _0x3e3661;};'use strict';var utils=require(_0xf29e('0x0'));var logger=require(_0xf29e('0x1'))(_0xf29e('0x2'));exports[_0xf29e('0x3')]=function(_0x491523,_0x458386){return function(_0x249634){try{logger[_0xf29e('0x4')](_0xf29e('0x5'),_0x491523,utils[_0xf29e('0x6')](_0x458386[0x0],this));_0x249634[_0xf29e('0x7')]();}catch(_0x4d790f){logger['error'](_0xf29e('0x5'),_0x491523,JSON['stringify'](_0x4d790f));_0x249634['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 0cc930e..c0a5203 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 _0x89a4=['error','update\x20queue\x20report','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','atimeout','qtimeout','rules','end','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','stack','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','AccountId','WebsiteId','info','name','QueueReport','create','catch','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]'];(function(_0x44d7e7,_0x1a0d37){var _0x353799=function(_0x210ecd){while(--_0x210ecd){_0x44d7e7['push'](_0x44d7e7['shift']());}};_0x353799(++_0x1a0d37);}(_0x89a4,0x1e4));var _0x489a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x89a4[_0x321bb2];return _0x9c12ed;};'use strict';var schema=require('validate');var _=require(_0x489a('0x0'));var util=require(_0x489a('0x1'));var seqqueue=require(_0x489a('0x2'));var moment=require(_0x489a('0x3'));var Redis=require('ioredis');var config=require(_0x489a('0x4'));var logger=require(_0x489a('0x5'))(_0x489a('0x6'));var strategy=require(_0x489a('0x7'));config[_0x489a('0x8')]=_['defaults'](config[_0x489a('0x8')],{'host':_0x489a('0x9'),'port':0x18eb});var io=require(_0x489a('0xa'))(new Redis(config[_0x489a('0x8')]));var attributes=['id',_0x489a('0xb'),_0x489a('0xc'),_0x489a('0xd'),_0x489a('0xe'),_0x489a('0xf')];function emit(_0x3fd509,_0x15e4f6,_0x54f40e){io['to'](_0x3fd509)[_0x489a('0x10')](_0x15e4f6,_0x54f40e);}function emitChannelQueueInteraction(_0x1c3f7a,_0x17df1b,_0x305f87,_0x1d014a,_0xda95ad,_0x993af8,_0x1eecb5,_0x543397){var _0x3bb703=_[_0x489a('0x11')](_0x305f87);_0x3bb703[_0x489a('0xb')]=_0x543397;_0x3bb703[_0x489a('0xd')]=_0x17df1b;_0x3bb703[_0x489a('0xc')]=_0x1d014a;_0x3bb703['id']=_0xda95ad;if(_0x993af8){_0x1eecb5[util[_0x489a('0x12')]('%sQueuesWaitingInteractions',_0x1c3f7a)][_0xda95ad]=_[_0x489a('0x13')](_0x3bb703,attributes);}else{delete _0x1eecb5[util['format']('%sQueuesWaitingInteractions',_0x1c3f7a)][_0xda95ad];}emit(util[_0x489a('0x12')](_0x489a('0x14'),_0x1c3f7a,_0x17df1b),util['format'](_0x489a('0x15'),_0x1c3f7a,_0x993af8?_0x489a('0x16'):'remove'),_['pick'](_0x3bb703,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x489a('0x17')),'chatQueueReport':require(_0x489a('0x18')),'smsQueueReport':require(_0x489a('0x19')),'faxQueueReport':require(_0x489a('0x1a')),'whatsappQueueReport':require(_0x489a('0x1b'))};var queue=schema({'name':{'type':_0x489a('0x1c'),'required':!![],'message':_0x489a('0x1d')},'timeout':{'type':'number','message':_0x489a('0x1e')}});function startRouting(_0x4295cd,_0x35b47d,_0x24f1cd,_0x28553e){if(_0x4295cd&&_0x35b47d&&_0x24f1cd){_0x35b47d[_0x489a('0x1f')]+=0x1;var _0x48077d={'uniqueid':_0x4295cd,'from':_0x24f1cd[_0x489a('0x20')]?_0x24f1cd[_0x489a('0x20')][_0x489a('0xe')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x24f1cd[_0x489a('0x21')]?_0x24f1cd['contact']['id']:null,'ListId':_0x24f1cd[_0x489a('0x22')]?_0x24f1cd[_0x489a('0x22')]['id']:null};_0x48077d[_[_0x489a('0x23')](_0x24f1cd['channel'])+_0x489a('0x24')]=_0x35b47d['id']||null;_0x48077d[_['upperFirst'](_0x24f1cd[_0x489a('0x25')])+_0x489a('0x26')]=_0x24f1cd[_0x489a('0x27')]?_0x24f1cd[_0x489a('0x27')]['id']:null;_0x48077d[_[_0x489a('0x23')](_0x24f1cd[_0x489a('0x25')])+_0x489a('0x28')]=_0x24f1cd[_0x489a('0x29')]?_0x24f1cd['message']['id']:null;_0x48077d[_['upperFirst'](_0x24f1cd['channel'])+(_0x24f1cd[_0x489a('0x25')]!=='chat'?_0x489a('0x2a'):_0x489a('0x2b'))]=_0x24f1cd['account']?_0x24f1cd[_0x489a('0xc')]['id']:null;logger[_0x489a('0x2c')](util[_0x489a('0x12')]('[%s][START:QUEUE][NAME:%s]',_0x4295cd,_0x35b47d[_0x489a('0x2d')]));emitChannelQueueInteraction(_0x24f1cd['channel'],_0x35b47d[_0x489a('0x2d')],_0x48077d,_0x24f1cd[_0x489a('0xc')][_0x489a('0x2d')],_0x24f1cd[_0x489a('0x29')]['id'],!![],_0x28553e,_0x35b47d['id']);if(rpc[_0x24f1cd[_0x489a('0x25')]+_0x489a('0x2e')]){return rpc[_0x24f1cd[_0x489a('0x25')]+_0x489a('0x2e')][_0x489a('0x2f')](_0x48077d)[_0x489a('0x30')](function(_0x18caeb){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x52b2bc,_0x46ebae,_0x2cc0e9,_0x439c32){if(_0x52b2bc&&_0x46ebae){_0x46ebae[_0x489a('0x1f')]-=0x1;var _0x31ea45={'leaveAt':moment()[_0x489a('0x12')](_0x489a('0x31')),'acceptAt':moment()['format'](_0x489a('0x31')),'reason':_0x489a('0x32')};logger[_0x489a('0x2c')](util[_0x489a('0x12')](_0x489a('0x33'),_0x52b2bc,_0x46ebae[_0x489a('0x2d')]));emitChannelQueueInteraction(_0x2cc0e9['channel'],_0x46ebae[_0x489a('0x2d')],_0x2cc0e9[_0x489a('0x20')],_0x2cc0e9[_0x489a('0xc')]['name'],_0x2cc0e9[_0x489a('0x29')]['id'],![],_0x439c32,_0x46ebae['id']);if(rpc[_0x2cc0e9[_0x489a('0x25')]+_0x489a('0x2e')]){return rpc[_0x2cc0e9[_0x489a('0x25')]+_0x489a('0x2e')][_0x489a('0x34')](_0x52b2bc,_0x31ea45)[_0x489a('0x30')](function(_0x567a06){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x368a26,_0x30df58,_0x3cf4da,_0x5c6911){if(_0x368a26&&_0x30df58){_0x30df58[_0x489a('0x1f')]-=0x1;var _0x290f7e={'leaveAt':moment()[_0x489a('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x489a('0x12')](_0x489a('0x31')),'reason':_0x489a('0x35')};logger[_0x489a('0x2c')](util[_0x489a('0x12')](_0x489a('0x36'),_0x368a26,_0x30df58[_0x489a('0x2d')]));emitChannelQueueInteraction(_0x3cf4da['channel'],_0x30df58[_0x489a('0x2d')],_0x3cf4da[_0x489a('0x20')],_0x3cf4da[_0x489a('0xc')][_0x489a('0x2d')],_0x3cf4da[_0x489a('0x29')]['id'],![],_0x5c6911);if(rpc[_0x3cf4da[_0x489a('0x25')]+_0x489a('0x2e')]){return rpc[_0x3cf4da['channel']+_0x489a('0x2e')][_0x489a('0x34')](_0x368a26,_0x290f7e)['catch'](function(_0x3d2b13){logger[_0x489a('0x37')](_0x489a('0x38'));});}}}function handleFindQueue(_0x2da3ed){return function(_0x37df89){return _0x37df89[_0x489a('0x2d')]['toLowerCase']()===_0x2da3ed[_0x489a('0x39')]();};}exports[_0x489a('0x3a')]=function(_0xd78077,_0x4aa3bc,_0x23fd09,_0x122f74){return function(_0x2288b7){try{var _0x5e1e4f={'name':_0x4aa3bc[0x0],'timeout':_0x4aa3bc[0x1]};var _0x366646=queue[_0x489a('0x3b')](_0x5e1e4f,{'typecast':!![]});if(_0x366646[_0x489a('0x3c')]){logger[_0x489a('0x37')](_0x489a('0x3d'),_0xd78077,_[_0x489a('0x3e')](_0x366646,_0x489a('0x29'))[_0x489a('0x3f')](',\x20'));_0x2288b7[_0x489a('0x40')]();}else{var _0x561361=_[_0x489a('0x41')](_0x23fd09[_0x122f74[_0x489a('0x25')]+_0x489a('0x42')],handleFindQueue(_0x5e1e4f[_0x489a('0x2d')]));if(_0x561361){startRouting(_0xd78077,_0x561361,_0x122f74,_0x23fd09);var _0x17b7fa=(_0x561361[_0x489a('0x35')]||0xa)*0x3e8;var _0x3eb6e8=(_0x5e1e4f[_0x489a('0x35')]||0x14)*0x3e8;var _0x427ce3,_0x26172f;if(_0x17b7fa>_0x3eb6e8){_0x3eb6e8=_0x17b7fa;}var _0x50b1c4=seqqueue['createQueue'](_0x17b7fa);_0x50b1c4['id']=_0xd78077;_0x50b1c4[_0x489a('0x43')]=_0x17b7fa;_0x50b1c4[_0x489a('0x44')]=_0x3eb6e8;_0x50b1c4[_0x489a('0x25')]=_0x122f74[_0x489a('0x25')];_0x23fd09[_0x489a('0x45')][_0xd78077]['on'](_0x489a('0x46'),function(){logger[_0x489a('0x2c')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0xd78077);stopRouting(_0xd78077,_0x561361,_0x122f74,_0x23fd09);clearTimeout(_0x427ce3);_0x427ce3=undefined;_0x50b1c4[_0x489a('0x47')](!![]);if(_0x23fd09['rules'][_0xd78077]){delete _0x23fd09[_0x489a('0x45')][_0xd78077];}_0x2288b7[_0x489a('0x40')]();});_0x23fd09[_0x489a('0x45')][_0xd78077]['on']('complete',function(){if(_0x23fd09[_0x489a('0x45')][_0xd78077]){delete _0x23fd09['rules'][_0xd78077];}});_0x427ce3=setTimeout(function(){logger['info'](_0x489a('0x48'),_0xd78077);endRouting(_0xd78077,_0x561361,_0x122f74,_0x23fd09);clearTimeout(_0x427ce3);_0x50b1c4[_0x489a('0x47')](!![]);_0x2288b7[_0x489a('0x49')]();},_0x3eb6e8);switch(_0x561361[_0x489a('0x4a')]){case'rrmemory':strategy[_0x489a('0x4b')](_0x50b1c4,_0x561361,_0x23fd09,_0x122f74);break;default:strategy['beepall'](_0x50b1c4,_0x561361,_0x23fd09,_0x122f74);}}else{logger[_0x489a('0x37')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0xd78077,_0x5e1e4f[_0x489a('0x2d')]);_0x2288b7[_0x489a('0x40')]();}}}catch(_0x9dbdfc){console['log'](_0x9dbdfc);logger['error'](_0x489a('0x3d'),_0xd78077,_0x9dbdfc[_0x489a('0x4c')]);_0x2288b7[_0x489a('0x40')]();}};}; \ No newline at end of file +var _0x7d8a=['../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','message','QueueReport','create','error','waiting','accepted','update','catch','update\x20queue\x20report','length','[%s][QUEUE]\x20%s','map','stop','find','timeout','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','log','validate','lodash','util','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','account','queue','from','clone','queue_id','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport'];(function(_0x1a9c75,_0xa83750){var _0xb2f37e=function(_0x2b90f6){while(--_0x2b90f6){_0x1a9c75['push'](_0x1a9c75['shift']());}};_0xb2f37e(++_0xa83750);}(_0x7d8a,0xbf));var _0xa7d8=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x7d8a[_0x4bb145];return _0x4db596;};'use strict';var schema=require(_0xa7d8('0x0'));var _=require(_0xa7d8('0x1'));var util=require(_0xa7d8('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xa7d8('0x3'));var Redis=require('ioredis');var config=require(_0xa7d8('0x4'));var logger=require(_0xa7d8('0x5'))(_0xa7d8('0x6'));var strategy=require(_0xa7d8('0x7'));config[_0xa7d8('0x8')]=_['defaults'](config[_0xa7d8('0x8')],{'host':_0xa7d8('0x9'),'port':0x18eb});var io=require(_0xa7d8('0xa'))(new Redis(config[_0xa7d8('0x8')]));var attributes=['id','queue_id',_0xa7d8('0xb'),_0xa7d8('0xc'),_0xa7d8('0xd'),'joinAt'];function emit(_0x3bdf79,_0x39d72d,_0xfa0a46){io['to'](_0x3bdf79)['emit'](_0x39d72d,_0xfa0a46);}function emitChannelQueueInteraction(_0xbfdd7b,_0x4731cc,_0x404fdf,_0x3752ba,_0x3b1085,_0x54a3ce,_0x4c2b1b,_0x298bd2){var _0x226747=_[_0xa7d8('0xe')](_0x404fdf);_0x226747[_0xa7d8('0xf')]=_0x298bd2;_0x226747[_0xa7d8('0xc')]=_0x4731cc;_0x226747[_0xa7d8('0xb')]=_0x3752ba;_0x226747['id']=_0x3b1085;if(_0x54a3ce){_0x4c2b1b[util[_0xa7d8('0x10')](_0xa7d8('0x11'),_0xbfdd7b)][_0x3b1085]=_[_0xa7d8('0x12')](_0x226747,attributes);}else{delete _0x4c2b1b[util[_0xa7d8('0x10')]('%sQueuesWaitingInteractions',_0xbfdd7b)][_0x3b1085];}emit(util[_0xa7d8('0x10')](_0xa7d8('0x13'),_0xbfdd7b,_0x4731cc),util[_0xa7d8('0x10')](_0xa7d8('0x14'),_0xbfdd7b,_0x54a3ce?_0xa7d8('0x15'):_0xa7d8('0x16')),_[_0xa7d8('0x12')](_0x226747,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xa7d8('0x17')),'chatQueueReport':require(_0xa7d8('0x18')),'smsQueueReport':require(_0xa7d8('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xa7d8('0x1a'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xa7d8('0x1b')}});function startRouting(_0x2570c1,_0x1a2ea2,_0x5a67ea,_0x25550a){if(_0x2570c1&&_0x1a2ea2&&_0x5a67ea){_0x1a2ea2['waiting']+=0x1;var _0xa774ff={'uniqueid':_0x2570c1,'from':_0x5a67ea[_0xa7d8('0x1c')]?_0x5a67ea[_0xa7d8('0x1c')][_0xa7d8('0xd')]:'','joinAt':moment()['format'](_0xa7d8('0x1d')),'ContactId':_0x5a67ea[_0xa7d8('0x1e')]?_0x5a67ea[_0xa7d8('0x1e')]['id']:null,'ListId':_0x5a67ea[_0xa7d8('0x1f')]?_0x5a67ea[_0xa7d8('0x1f')]['id']:null};_0xa774ff[_[_0xa7d8('0x20')](_0x5a67ea[_0xa7d8('0x21')])+_0xa7d8('0x22')]=_0x1a2ea2['id']||null;_0xa774ff[_[_0xa7d8('0x20')](_0x5a67ea[_0xa7d8('0x21')])+_0xa7d8('0x23')]=_0x5a67ea[_0xa7d8('0x24')]?_0x5a67ea[_0xa7d8('0x24')]['id']:null;_0xa774ff[_[_0xa7d8('0x20')](_0x5a67ea[_0xa7d8('0x21')])+'MessageId']=_0x5a67ea['message']?_0x5a67ea['message']['id']:null;_0xa774ff[_[_0xa7d8('0x20')](_0x5a67ea['channel'])+(_0x5a67ea['channel']!==_0xa7d8('0x25')?_0xa7d8('0x26'):_0xa7d8('0x27'))]=_0x5a67ea[_0xa7d8('0xb')]?_0x5a67ea[_0xa7d8('0xb')]['id']:null;logger[_0xa7d8('0x28')](util['format'](_0xa7d8('0x29'),_0x2570c1,_0x1a2ea2[_0xa7d8('0x2a')]));emitChannelQueueInteraction(_0x5a67ea[_0xa7d8('0x21')],_0x1a2ea2[_0xa7d8('0x2a')],_0xa774ff,_0x5a67ea[_0xa7d8('0xb')][_0xa7d8('0x2a')],_0x5a67ea[_0xa7d8('0x2b')]['id'],!![],_0x25550a,_0x1a2ea2['id']);if(rpc[_0x5a67ea['channel']+'QueueReport']){return rpc[_0x5a67ea[_0xa7d8('0x21')]+_0xa7d8('0x2c')][_0xa7d8('0x2d')](_0xa774ff)['catch'](function(_0x24913f){logger[_0xa7d8('0x2e')]('create\x20queue\x20report');});}}}function stopRouting(_0x2f38d9,_0x5cc4c3,_0x33d0b6,_0x52e3ed){if(_0x2f38d9&&_0x5cc4c3){_0x5cc4c3[_0xa7d8('0x2f')]-=0x1;var _0x4cc87f={'leaveAt':moment()[_0xa7d8('0x10')](_0xa7d8('0x1d')),'acceptAt':moment()[_0xa7d8('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa7d8('0x30')};logger['info'](util[_0xa7d8('0x10')]('[%s][STOP:QUEUE][NAME:%s]',_0x2f38d9,_0x5cc4c3['name']));emitChannelQueueInteraction(_0x33d0b6[_0xa7d8('0x21')],_0x5cc4c3[_0xa7d8('0x2a')],_0x33d0b6[_0xa7d8('0x1c')],_0x33d0b6[_0xa7d8('0xb')][_0xa7d8('0x2a')],_0x33d0b6['message']['id'],![],_0x52e3ed,_0x5cc4c3['id']);if(rpc[_0x33d0b6['channel']+_0xa7d8('0x2c')]){return rpc[_0x33d0b6['channel']+_0xa7d8('0x2c')][_0xa7d8('0x31')](_0x2f38d9,_0x4cc87f)['catch'](function(_0x2ff2fd){logger[_0xa7d8('0x2e')]('update\x20queue\x20report');});}}}function endRouting(_0x27ae4c,_0x5847a1,_0x4f80c1,_0x61f203){if(_0x27ae4c&&_0x5847a1){_0x5847a1['waiting']-=0x1;var _0x581649={'leaveAt':moment()['format'](_0xa7d8('0x1d')),'exitAt':moment()[_0xa7d8('0x10')](_0xa7d8('0x1d')),'reason':'timeout'};logger['info'](util[_0xa7d8('0x10')]('[%s][END:QUEUE][NAME:%s]',_0x27ae4c,_0x5847a1[_0xa7d8('0x2a')]));emitChannelQueueInteraction(_0x4f80c1[_0xa7d8('0x21')],_0x5847a1[_0xa7d8('0x2a')],_0x4f80c1['body'],_0x4f80c1[_0xa7d8('0xb')][_0xa7d8('0x2a')],_0x4f80c1['message']['id'],![],_0x61f203);if(rpc[_0x4f80c1['channel']+_0xa7d8('0x2c')]){return rpc[_0x4f80c1[_0xa7d8('0x21')]+_0xa7d8('0x2c')][_0xa7d8('0x31')](_0x27ae4c,_0x581649)[_0xa7d8('0x32')](function(_0x594f1d){logger[_0xa7d8('0x2e')](_0xa7d8('0x33'));});}}}function handleFindQueue(_0x29210d){return function(_0x393b44){return _0x393b44[_0xa7d8('0x2a')]['toLowerCase']()===_0x29210d['toLowerCase']();};}exports['consequence']=function(_0x97dac9,_0x50b3eb,_0x2a2d52,_0x485af1){return function(_0x5de07c){try{var _0x42b58b={'name':_0x50b3eb[0x0],'timeout':_0x50b3eb[0x1]};var _0x4c544e=queue[_0xa7d8('0x0')](_0x42b58b,{'typecast':!![]});if(_0x4c544e[_0xa7d8('0x34')]){logger[_0xa7d8('0x2e')](_0xa7d8('0x35'),_0x97dac9,_[_0xa7d8('0x36')](_0x4c544e,_0xa7d8('0x2b'))['join'](',\x20'));_0x5de07c[_0xa7d8('0x37')]();}else{var _0x2a11d3=_[_0xa7d8('0x38')](_0x2a2d52[_0x485af1[_0xa7d8('0x21')]+'Queues'],handleFindQueue(_0x42b58b[_0xa7d8('0x2a')]));if(_0x2a11d3){startRouting(_0x97dac9,_0x2a11d3,_0x485af1,_0x2a2d52);var _0x2f27c3=(_0x2a11d3[_0xa7d8('0x39')]||0xa)*0x3e8;var _0x42cfd9=(_0x42b58b['timeout']||0x14)*0x3e8;var _0x54224e,_0x36f665;if(_0x2f27c3>_0x42cfd9){_0x42cfd9=_0x2f27c3;}var _0x1ed070=seqqueue[_0xa7d8('0x3a')](_0x2f27c3);_0x1ed070['id']=_0x97dac9;_0x1ed070[_0xa7d8('0x3b')]=_0x2f27c3;_0x1ed070[_0xa7d8('0x3c')]=_0x42cfd9;_0x1ed070[_0xa7d8('0x21')]=_0x485af1['channel'];_0x2a2d52['rules'][_0x97dac9]['on'](_0xa7d8('0x3d'),function(){logger[_0xa7d8('0x28')](_0xa7d8('0x3e'),_0x97dac9);stopRouting(_0x97dac9,_0x2a11d3,_0x485af1,_0x2a2d52);clearTimeout(_0x54224e);_0x54224e=undefined;_0x1ed070[_0xa7d8('0x3f')](!![]);if(_0x2a2d52['rules'][_0x97dac9]){delete _0x2a2d52[_0xa7d8('0x40')][_0x97dac9];}_0x5de07c[_0xa7d8('0x37')]();});_0x2a2d52[_0xa7d8('0x40')][_0x97dac9]['on'](_0xa7d8('0x41'),function(){if(_0x2a2d52[_0xa7d8('0x40')][_0x97dac9]){delete _0x2a2d52[_0xa7d8('0x40')][_0x97dac9];}});_0x54224e=setTimeout(function(){logger['info'](_0xa7d8('0x42'),_0x97dac9);endRouting(_0x97dac9,_0x2a11d3,_0x485af1,_0x2a2d52);clearTimeout(_0x54224e);_0x1ed070[_0xa7d8('0x3f')](!![]);_0x5de07c[_0xa7d8('0x43')]();},_0x42cfd9);switch(_0x2a11d3[_0xa7d8('0x44')]){case _0xa7d8('0x45'):strategy[_0xa7d8('0x45')](_0x1ed070,_0x2a11d3,_0x2a2d52,_0x485af1);break;default:strategy[_0xa7d8('0x46')](_0x1ed070,_0x2a11d3,_0x2a2d52,_0x485af1);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x97dac9,_0x42b58b[_0xa7d8('0x2a')]);_0x5de07c[_0xa7d8('0x37')]();}}}catch(_0x171e60){console[_0xa7d8('0x47')](_0x171e60);logger[_0xa7d8('0x2e')](_0xa7d8('0x35'),_0x97dac9,_0x171e60['stack']);_0x5de07c[_0xa7d8('0x37')]();}};}; \ 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 e23f648..a36c602 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 _0x8807=['[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busy','busyQueue','notificationId','forcedOwnership',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','realtime','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','push','info'];(function(_0x5cf93c,_0x2b5075){var _0x56aa24=function(_0x20b2ee){while(--_0x20b2ee){_0x5cf93c['push'](_0x5cf93c['shift']());}};_0x56aa24(++_0x2b5075);}(_0x8807,0x127));var _0x7880=function(_0x5bcd23,_0x1242f1){_0x5bcd23=_0x5bcd23-0x0;var _0x17ec3c=_0x8807[_0x5bcd23];return _0x17ec3c;};'use strict';var _=require(_0x7880('0x0'));var uuid=require(_0x7880('0x1'));var util=require(_0x7880('0x2'));var logger=require(_0x7880('0x3'))(_0x7880('0x4'));var Agent=function(_0x2635db,_0x35ac26,_0x261949,_0x4bbd53){this['notificationId']=uuid['v4']();this[_0x7880('0x5')]=_0x2635db;this['agent']=_0x35ac26;this[_0x7880('0x6')]=_0x261949;this[_0x7880('0x4')]=_0x4bbd53;this['squeue']['push'](this[_0x7880('0x7')][_0x7880('0x8')](this),this[_0x7880('0x9')][_0x7880('0x8')](this));this['squeue']['on'](_0x7880('0xa'),this[_0x7880('0x9')]['bind'](this));this[_0x7880('0x5')]['on']('drained',this[_0x7880('0xb')][_0x7880('0x8')](this));};Agent[_0x7880('0xc')][_0x7880('0xd')]=function(){this[_0x7880('0x5')]['push'](this[_0x7880('0x7')][_0x7880('0x8')](this),this[_0x7880('0x9')]['bind'](this));};Agent[_0x7880('0xc')][_0x7880('0xb')]=function(){this[_0x7880('0x9')](!![]);};Agent[_0x7880('0xc')][_0x7880('0x7')]=function(_0x3a4390){logger[_0x7880('0xe')](_0x7880('0xf'),this[_0x7880('0x5')]['id'],this[_0x7880('0x10')]['id']);if(_[_0x7880('0x11')](this['realtime'][_0x7880('0x12')][this[_0x7880('0x10')]['id']])){logger[_0x7880('0xe')](_0x7880('0x13'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x7880('0xd')][_0x7880('0x8')](this),0x3e8);}else{if(this[_0x7880('0x4')]['forcedOwnership']||util['isAgentAvailable'](this[_0x7880('0x5')]['id'],this['realtime'][_0x7880('0x12')][this[_0x7880('0x10')]['id']],this[_0x7880('0x5')][_0x7880('0x14')],![])){this['realtime']['agents'][this[_0x7880('0x10')]['id']][_0x7880('0x15')]=!![];this['realtime'][_0x7880('0x12')][this['agent']['id']][_0x7880('0x16')]=undefined;util['showNotification'](this[_0x7880('0x17')],this[_0x7880('0x5')]['id'],this[_0x7880('0x6')][_0x7880('0x12')][this['agent']['id']],null,this[_0x7880('0x4')]);util['writeLog'](this[_0x7880('0x5')]['id'],this[_0x7880('0x6')][_0x7880('0x12')][this[_0x7880('0x10')]['id']],'RINGING'+(this[_0x7880('0x4')][_0x7880('0x18')]?_0x7880('0x19'):''));}else{logger[_0x7880('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x7880('0x5')]['id'],this[_0x7880('0x10')]['id']);setTimeout(this[_0x7880('0xd')][_0x7880('0x8')](this),0x3e8);}}};Agent[_0x7880('0xc')][_0x7880('0x9')]=function(_0x28a020){if(_[_0x7880('0x11')](this[_0x7880('0x6')][_0x7880('0x12')][this[_0x7880('0x10')]['id']])){return logger[_0x7880('0xe')](_0x7880('0x13'),this[_0x7880('0x5')]['id'],this[_0x7880('0x10')]['id']);}else{logger[_0x7880('0xe')](_0x7880('0x1a'),this[_0x7880('0x5')]['id'],this['agent']['id']);util[_0x7880('0x1b')](this[_0x7880('0x17')],this['squeue']['id'],this[_0x7880('0x6')][_0x7880('0x12')][this[_0x7880('0x10')]['id']],null,this['routing']);this[_0x7880('0x6')][_0x7880('0x12')][this[_0x7880('0x10')]['id']][_0x7880('0x15')]=![];this[_0x7880('0x6')]['agents'][this['agent']['id']]['busyQueue']=undefined;util[_0x7880('0x1c')](this[_0x7880('0x5')]['id'],this[_0x7880('0x6')]['agents'][this[_0x7880('0x10')]['id']],_0x28a020?'STOP':_0x7880('0x1d'));}if(!_0x28a020){setTimeout(this['push'][_0x7880('0x8')](this),0x3e8);}};function agent(_0x83c52a,_0x32bfe3,_0x5b9412,_0x4de001){return new Agent(_0x83c52a,_0x32bfe3,_0x5b9412,_0x4de001);}module[_0x7880('0x1e')]=agent; \ No newline at end of file +var _0x5543=['busy','busyQueue','showNotification','writeLog','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','info','isNil','agents','isAgentAvailable','channel'];(function(_0x305f4f,_0x7df820){var _0x177a7e=function(_0x5d819b){while(--_0x5d819b){_0x305f4f['push'](_0x305f4f['shift']());}};_0x177a7e(++_0x7df820);}(_0x5543,0x19e));var _0x3554=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0x5543[_0x5c4e16];return _0x36044a;};'use strict';var _=require(_0x3554('0x0'));var uuid=require(_0x3554('0x1'));var util=require(_0x3554('0x2'));var logger=require('../../../../../config/logger')(_0x3554('0x3'));var Agent=function(_0x43d3ec,_0x5ac2c8,_0x184bb1,_0x3a2042){this[_0x3554('0x4')]=uuid['v4']();this[_0x3554('0x5')]=_0x43d3ec;this[_0x3554('0x6')]=_0x5ac2c8;this[_0x3554('0x7')]=_0x184bb1;this[_0x3554('0x3')]=_0x3a2042;this[_0x3554('0x5')][_0x3554('0x8')](this[_0x3554('0x9')][_0x3554('0xa')](this),this[_0x3554('0xb')][_0x3554('0xa')](this));this['squeue']['on']('timeout',this['handleTimeout']['bind'](this));this[_0x3554('0x5')]['on'](_0x3554('0xc'),this[_0x3554('0xd')][_0x3554('0xa')](this));};Agent[_0x3554('0xe')]['push']=function(){this['squeue'][_0x3554('0x8')](this[_0x3554('0x9')]['bind'](this),this[_0x3554('0xb')][_0x3554('0xa')](this));};Agent[_0x3554('0xe')][_0x3554('0xd')]=function(){this[_0x3554('0xb')](!![]);};Agent[_0x3554('0xe')][_0x3554('0x9')]=function(_0x248788){logger[_0x3554('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x3554('0x5')]['id'],this[_0x3554('0x6')]['id']);if(_[_0x3554('0x10')](this['realtime'][_0x3554('0x11')][this[_0x3554('0x6')]['id']])){logger[_0x3554('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x3554('0x5')]['id'],this[_0x3554('0x6')]['id']);setTimeout(this[_0x3554('0x8')][_0x3554('0xa')](this),0x3e8);}else{if(this[_0x3554('0x3')]['forcedOwnership']||util[_0x3554('0x12')](this[_0x3554('0x5')]['id'],this[_0x3554('0x7')][_0x3554('0x11')][this[_0x3554('0x6')]['id']],this[_0x3554('0x5')][_0x3554('0x13')],![])){this[_0x3554('0x7')][_0x3554('0x11')][this[_0x3554('0x6')]['id']][_0x3554('0x14')]=!![];this['realtime']['agents'][this[_0x3554('0x6')]['id']][_0x3554('0x15')]=undefined;util[_0x3554('0x16')](this[_0x3554('0x4')],this[_0x3554('0x5')]['id'],this[_0x3554('0x7')]['agents'][this['agent']['id']],null,this[_0x3554('0x3')]);util[_0x3554('0x17')](this[_0x3554('0x5')]['id'],this['realtime'][_0x3554('0x11')][this[_0x3554('0x6')]['id']],'RINGING'+(this['routing'][_0x3554('0x18')]?_0x3554('0x19'):''));}else{logger[_0x3554('0xf')](_0x3554('0x1a'),this[_0x3554('0x5')]['id'],this[_0x3554('0x6')]['id']);setTimeout(this[_0x3554('0x8')][_0x3554('0xa')](this),0x3e8);}}};Agent[_0x3554('0xe')][_0x3554('0xb')]=function(_0x21d1cd){if(_[_0x3554('0x10')](this[_0x3554('0x7')][_0x3554('0x11')][this[_0x3554('0x6')]['id']])){return logger['info'](_0x3554('0x1b'),this[_0x3554('0x5')]['id'],this[_0x3554('0x6')]['id']);}else{logger['info']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x3554('0x5')]['id'],this[_0x3554('0x6')]['id']);util[_0x3554('0x1c')](this['notificationId'],this[_0x3554('0x5')]['id'],this[_0x3554('0x7')][_0x3554('0x11')][this[_0x3554('0x6')]['id']],null,this['routing']);this[_0x3554('0x7')][_0x3554('0x11')][this['agent']['id']][_0x3554('0x14')]=![];this[_0x3554('0x7')][_0x3554('0x11')][this['agent']['id']][_0x3554('0x15')]=undefined;util[_0x3554('0x17')](this['squeue']['id'],this[_0x3554('0x7')][_0x3554('0x11')][this[_0x3554('0x6')]['id']],_0x21d1cd?_0x3554('0x1d'):_0x3554('0x1e'));}if(!_0x21d1cd){setTimeout(this['push'][_0x3554('0xa')](this),0x3e8);}};function agent(_0x425853,_0x3d3cf4,_0x24513b,_0x14cd5d){return new Agent(_0x425853,_0x3d3cf4,_0x24513b,_0x14cd5d);}module['exports']=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 cd0c253..482b12a 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 _0x212b=['../../../../../config/logger','routing','notificationId','queue','realtime','push','handleRun','handleTimeout','bind','squeue','prototype','handleDrained','isNil','Agents','length','agents','isAgentAvailable','channel','writeLog','RINGING','busyQueue','name','showNotification','info','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','busy','exports','lodash','./util'];(function(_0x1ebd10,_0x4914b4){var _0x1004d3=function(_0x59e3ba){while(--_0x59e3ba){_0x1ebd10['push'](_0x1ebd10['shift']());}};_0x1004d3(++_0x4914b4);}(_0x212b,0x148));var _0xb212=function(_0x544d53,_0x4f84dd){_0x544d53=_0x544d53-0x0;var _0xd0f676=_0x212b[_0x544d53];return _0xd0f676;};'use strict';var _=require(_0xb212('0x0'));var uuid=require('uuid');var util=require(_0xb212('0x1'));var logger=require(_0xb212('0x2'))(_0xb212('0x3'));var Beepall=function(_0x309b83,_0x5731dc,_0xd8b506,_0x18e53a){this[_0xb212('0x4')]=uuid['v4']();this['squeue']=_0x309b83;this[_0xb212('0x5')]=_0x5731dc;this[_0xb212('0x6')]=_0xd8b506;this[_0xb212('0x3')]=_0x18e53a;this['squeue'][_0xb212('0x7')](this[_0xb212('0x8')]['bind'](this),this[_0xb212('0x9')][_0xb212('0xa')](this));this[_0xb212('0xb')]['on']('timeout',this[_0xb212('0x9')][_0xb212('0xa')](this));this['squeue']['on']('drained',this['handleDrained'][_0xb212('0xa')](this));};Beepall['prototype'][_0xb212('0x7')]=function(){this[_0xb212('0xb')][_0xb212('0x7')](this[_0xb212('0x8')][_0xb212('0xa')](this),this[_0xb212('0x9')][_0xb212('0xa')](this));};Beepall[_0xb212('0xc')][_0xb212('0xd')]=function(_0x3ea7dc){this[_0xb212('0x9')](!![]);};Beepall[_0xb212('0xc')]['handleRun']=function(_0x576095){var _0x5c56e2=!![];if(!_['isNil'](this[_0xb212('0x5')])&&!_[_0xb212('0xe')](this[_0xb212('0x5')]['Agents'])&&this[_0xb212('0x5')][_0xb212('0xf')][_0xb212('0x10')]>0x0){for(var _0xaffb30=0x0,_0x320802;_0xaffb300x0){for(var _0x39fec5=0x0,_0xc5472a;_0x39fec50x0&&_0x4169c0[_0x3eacd3+_0xac4a('0x26')]>=_0x4169c0[_0x3eacd3+_0xac4a('0x25')]){writeLog(_0x3d7ce0,_0x4169c0,_0x3eacd3[_0xac4a('0x27')]()+_0xac4a('0x28'));return![];}}return!![];};exports[_0xac4a('0x29')]=function(_0x20202c,_0x4e17ce,_0x23b061,_0x267a22,_0x42a33c){return sendNotification(!![],_0x20202c,_0x4e17ce,_0x23b061,_0x267a22,_0x42a33c);};exports[_0xac4a('0x2a')]=function(_0x116700,_0x4a5a9e,_0x47f49c,_0xdb7e,_0x7a948b){return sendNotification(![],_0x116700,_0x4a5a9e,_0x47f49c,_0xdb7e,_0x7a948b);};exports[_0xac4a('0x2b')]=writeLog; \ No newline at end of file +var _0x9a5a=['account','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','online','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/logger','routing','redis','defaults','localhost','emit','format','user:%s','name','split','\x20interaction'];(function(_0x19997d,_0x2c92a4){var _0x49be7f=function(_0x2e5d31){while(--_0x2e5d31){_0x19997d['push'](_0x19997d['shift']());}};_0x49be7f(++_0x2c92a4);}(_0x9a5a,0x194));var _0xa9a5=function(_0x295356,_0x16090e){_0x295356=_0x295356-0x0;var _0x484451=_0x9a5a[_0x295356];return _0x484451;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var utils=require(_0xa9a5('0x2'));var Mustache=require(_0xa9a5('0x3'));var Redis=require(_0xa9a5('0x4'));var config=require('../../../../../config/environment');var logger=require(_0xa9a5('0x5'))(_0xa9a5('0x6'));config[_0xa9a5('0x7')]=_[_0xa9a5('0x8')](config[_0xa9a5('0x7')],{'host':_0xa9a5('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa9a5('0x7')]));function emit(_0x37e93b,_0x20bbe8,_0x1eafa6){io['to'](_0x37e93b)[_0xa9a5('0xa')](_0x20bbe8,_0x1eafa6);}function sendNotification(_0x5f2e83,_0x483b1e,_0x57d90b,_0xc95120,_0x308f82,_0x186fcf){io['to'](util[_0xa9a5('0xb')](_0xa9a5('0xc'),_0xc95120[_0xa9a5('0xd')]))[_0xa9a5('0xa')]('user:save',_0xc95120);var _0x54b0b4=_0x186fcf||{};var _0x56f162=_0x57d90b[_0xa9a5('0xe')]('.');var _0x1d349e={'uniqueid':_0x483b1e,'channel':_0x56f162[0x0],'id':_0x56f162[0x1],'title':_0x56f162[0x0]+_0xa9a5('0xf'),'interactionId':_0x56f162[0x2],'queue':_0x308f82?_0x308f82[_0xa9a5('0xd')]:null,'sound':_0x54b0b4[_0xa9a5('0x10')]['notificationSound'],'shake':_0x54b0b4[_0xa9a5('0x10')][_0xa9a5('0x11')]};try{if(!_0x54b0b4[_0xa9a5('0x12')]){_0x54b0b4[_0xa9a5('0x12')]={};}if(_0x308f82){_0x54b0b4[_0xa9a5('0x12')][_0xa9a5('0x13')]=_0x308f82;}else if(_0x54b0b4['body'][_0xa9a5('0x13')]){delete _0x54b0b4[_0xa9a5('0x12')][_0xa9a5('0x13')];}_0x1d349e[_0xa9a5('0x14')]=utils['getMustacheRender'](_0x54b0b4[_0xa9a5('0x10')][_0xa9a5('0x15')],_0x54b0b4);}catch(_0xb8bed2){_0x1d349e['msg']=_0xa9a5('0x16');logger['error'](util['format'](_0xa9a5('0x17'),_0x483b1e,_0xb8bed2[_0xa9a5('0x18')]));}io['to'](util['format'](_0xa9a5('0xc'),_0xc95120['name']))[_0xa9a5('0xa')](util[_0xa9a5('0xb')](_0xa9a5('0x19'),_0x5f2e83?_0xa9a5('0x1a'):_0xa9a5('0x1b')),_0x1d349e);}function writeLog(_0x1cc402,_0x21ea08,_0x6bd62d){return logger[_0xa9a5('0x1c')](util[_0xa9a5('0xb')](_0xa9a5('0x1d'),_0x1cc402,_0x21ea08[_0xa9a5('0xd')],_0x6bd62d));}exports['isAgentAvailable']=function(_0x5c8314,_0x59b37c,_0x43017d,_0x5210c1){if(_0x59b37c[_0xa9a5('0x1e')]){writeLog(_0x5c8314,_0x59b37c,_0xa9a5('0x1f'));return![];}if(!_0x59b37c[_0xa9a5('0x20')]){writeLog(_0x5c8314,_0x59b37c,'OFFLINE');return![];}if(_0x59b37c[_0x43017d+_0xa9a5('0x21')]){writeLog(_0x5c8314,_0x59b37c,_0xa9a5('0x22'));return![];}if(_0x5210c1&&_0x59b37c[_0xa9a5('0x23')](_0x43017d+'Capacity')&&_0x59b37c['hasOwnProperty'](_0x43017d+_0xa9a5('0x24'))){if(_0x59b37c[_0x43017d+_0xa9a5('0x25')]>0x0&&_0x59b37c[_0x43017d+_0xa9a5('0x24')]>=_0x59b37c[_0x43017d+'Capacity']){writeLog(_0x5c8314,_0x59b37c,_0x43017d[_0xa9a5('0x26')]()+_0xa9a5('0x27'));return![];}}return!![];};exports['showNotification']=function(_0xda152d,_0x474671,_0x5743b6,_0x11f6ce,_0x52e2ad){return sendNotification(!![],_0xda152d,_0x474671,_0x5743b6,_0x11f6ce,_0x52e2ad);};exports[_0xa9a5('0x28')]=function(_0x47ee9e,_0x1a9832,_0x3b271d,_0x4a84ad,_0x4d2629){return sendNotification(![],_0x47ee9e,_0x1a9832,_0x3b271d,_0x4a84ad,_0x4d2629);};exports[_0xa9a5('0x29')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index adfc26e..406f8a7 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 _0xec1b=['stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','shelljs','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','next','getMustacheRender','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject'];(function(_0x2d8262,_0x2bbaf4){var _0x402c7c=function(_0x5b3fff){while(--_0x5b3fff){_0x2d8262['push'](_0x2d8262['shift']());}};_0x402c7c(++_0x2bbaf4);}(_0xec1b,0xf5));var _0xbec1=function(_0x1830ce,_0x305798){_0x1830ce=_0x1830ce-0x0;var _0x2bce9f=_0xec1b[_0x1830ce];return _0x2bce9f;};'use strict';var schema=require('validate');var sh=require(_0xbec1('0x0'));var _=require('lodash');var utils=require(_0xbec1('0x1'));var logger=require(_0xbec1('0x2'))(_0xbec1('0x3'));var system=schema({'command':{'type':_0xbec1('0x4'),'required':!![],'message':_0xbec1('0x5')}});exports[_0xbec1('0x6')]=function(_0xc9b14a,_0x5eb784){return function(_0x415243){try{var _0x4edd94={'command':_0x5eb784[0x0]};var _0x9d1bbe=system[_0xbec1('0x7')](_0x4edd94,{'typecast':!![]});if(_0x9d1bbe[_0xbec1('0x8')]){logger[_0xbec1('0x9')](_0xbec1('0xa'),_0xc9b14a,_[_0xbec1('0xb')](_0x9d1bbe,_0xbec1('0xc'))[_0xbec1('0xd')](',\x20'));logger[_0xbec1('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0xc9b14a);_0x415243[_0xbec1('0xf')]();}else{var _0x439bc1=this;var _0x37e6d4=utils[_0xbec1('0x10')](_0x5eb784[0x0],this);logger[_0xbec1('0xe')]('[%s][SYSTEM]\x20commnad:\x20%s',_0xc9b14a,_0x37e6d4);sh[_0xbec1('0x11')](_['trim'](_0x37e6d4),function(_0x48cc63,_0x1e2548){logger[_0xbec1('0xe')](_0xbec1('0x12'),_0xc9b14a,_0x48cc63);if(_0x48cc63==0x0){var _0x2b9b37=_0x1e2548[_0xbec1('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xbec1('0x14')](_0x5eb784[0x1])||_[_0xbec1('0x15')](_0x5eb784[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0xc9b14a);_0x439bc1[_0xbec1('0x16')][_0x5eb784[0x1]]=_0x2b9b37;}else{logger[_0xbec1('0xe')](_0xbec1('0x17'),_0xc9b14a,_0x5eb784[0x1],_0x2b9b37);_0x439bc1['body'][_0x5eb784[0x1]]=_0x2b9b37;}}_0x415243[_0xbec1('0xf')]();});}}catch(_0x1dbe58){logger[_0xbec1('0x9')]('[%s][SYSTEM]\x20%s',_0xc9b14a,_[_0xbec1('0x18')](_0x1dbe58)?JSON[_0xbec1('0x19')](_0x1dbe58):_0x1dbe58);logger['info'](_0xbec1('0x1a'),_0xc9b14a);_0x415243['next']();}};}; \ No newline at end of file +var _0xea12=['body','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable'];(function(_0x28ec1b,_0x5412ea){var _0x1ae01c=function(_0x2697c5){while(--_0x2697c5){_0x28ec1b['push'](_0x28ec1b['shift']());}};_0x1ae01c(++_0x5412ea);}(_0xea12,0x149));var _0x2ea1=function(_0x16a958,_0x5d0d42){_0x16a958=_0x16a958-0x0;var _0x57d9e7=_0xea12[_0x16a958];return _0x57d9e7;};'use strict';var schema=require(_0x2ea1('0x0'));var sh=require(_0x2ea1('0x1'));var _=require(_0x2ea1('0x2'));var utils=require(_0x2ea1('0x3'));var logger=require(_0x2ea1('0x4'))(_0x2ea1('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0x2ea1('0x6')}});exports[_0x2ea1('0x7')]=function(_0x573dcf,_0x372df0){return function(_0x1ff9a0){try{var _0x30fad9={'command':_0x372df0[0x0]};var _0x3bf38d=system['validate'](_0x30fad9,{'typecast':!![]});if(_0x3bf38d[_0x2ea1('0x8')]){logger[_0x2ea1('0x9')]('[%s][SYSTEM]\x20%s',_0x573dcf,_[_0x2ea1('0xa')](_0x3bf38d,'message')[_0x2ea1('0xb')](',\x20'));logger[_0x2ea1('0xc')](_0x2ea1('0xd'),_0x573dcf);_0x1ff9a0[_0x2ea1('0xe')]();}else{var _0x21224a=this;var _0x56bf80=utils[_0x2ea1('0xf')](_0x372df0[0x0],this);logger[_0x2ea1('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x573dcf,_0x56bf80);sh['exec'](_[_0x2ea1('0x10')](_0x56bf80),function(_0x7e5d4,_0x5cf161){logger['info'](_0x2ea1('0x11'),_0x573dcf,_0x7e5d4);if(_0x7e5d4==0x0){var _0x1c80d1=_0x5cf161['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x2ea1('0x12')](_0x372df0[0x1])||_[_0x2ea1('0x13')](_0x372df0[0x1])){logger[_0x2ea1('0xc')](_0x2ea1('0x14'),_0x573dcf);_0x21224a[_0x2ea1('0x15')][_0x372df0[0x1]]=_0x1c80d1;}else{logger[_0x2ea1('0xc')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x573dcf,_0x372df0[0x1],_0x1c80d1);_0x21224a[_0x2ea1('0x15')][_0x372df0[0x1]]=_0x1c80d1;}}_0x1ff9a0['next']();});}}catch(_0x557837){logger[_0x2ea1('0x9')](_0x2ea1('0x16'),_0x573dcf,_[_0x2ea1('0x17')](_0x557837)?JSON[_0x2ea1('0x18')](_0x557837):_0x557837);logger[_0x2ea1('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x573dcf);_0x1ff9a0[_0x2ea1('0xe')]();}};}; \ 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 9315087..b53c8b9 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 _0xd7f1=['../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][TAG]\x20%s','map','message','join','channel','Interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','next','error','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction'];(function(_0x3c1d9b,_0x40369f){var _0xdcc0e0=function(_0x57bbac){while(--_0x57bbac){_0x3c1d9b['push'](_0x3c1d9b['shift']());}};_0xdcc0e0(++_0x40369f);}(_0xd7f1,0x1ad));var _0x1d7f=function(_0x38162f,_0x1558f2){_0x38162f=_0x38162f-0x0;var _0xad645a=_0xd7f1[_0x38162f];return _0xad645a;};'use strict';var schema=require(_0x1d7f('0x0'));var _=require(_0x1d7f('0x1'));var rpc={'chatInteraction':require(_0x1d7f('0x2')),'openchannelInteraction':require(_0x1d7f('0x3')),'smsInteraction':require(_0x1d7f('0x4')),'mailInteraction':require(_0x1d7f('0x5')),'faxInteraction':require(_0x1d7f('0x6')),'whatsappInteraction':require(_0x1d7f('0x7'))};var logger=require(_0x1d7f('0x8'))(_0x1d7f('0x9'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x1d7f('0xa')}});exports['consequence']=function(_0x553165,_0x611b36,_0x5ce1ca,_0x44ab49){return function(_0x607f18){try{var _0xf7cca3={'tag':_0x611b36[0x0]};var _0x34ac46=tag[_0x1d7f('0x0')](_0xf7cca3,{'typecast':!![]});if(_0x34ac46[_0x1d7f('0xb')]){logger['error'](_0x1d7f('0xc'),_0x553165,_[_0x1d7f('0xd')](_0x34ac46,_0x1d7f('0xe'))[_0x1d7f('0xf')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x553165);_0x607f18['next']();}else{var _0x345035={'ids':[_0x611b36[0x0]]};if(rpc[_0x44ab49[_0x1d7f('0x10')]+'Interaction']){rpc[_0x44ab49[_0x1d7f('0x10')]+_0x1d7f('0x11')]['addTags'](_0x44ab49['interaction']['id'],_0x345035)[_0x1d7f('0x12')](function(_0x45597f){logger[_0x1d7f('0x13')](_0x1d7f('0x14'),_0x553165,_0x611b36[0x1],_0x44ab49[_0x1d7f('0x10')],_0x44ab49[_0x1d7f('0x15')]['id']);})[_0x1d7f('0x16')](function(_0x1179a6){logger['error']('[%s][TAG]\x20%s',_0x553165,JSON[_0x1d7f('0x17')](_0x1179a6));logger[_0x1d7f('0x13')](_0x1d7f('0x18'),_0x553165);})[_0x1d7f('0x19')](function(){_0x607f18[_0x1d7f('0x1a')]();});}}}catch(_0x88e5f0){logger[_0x1d7f('0x1b')](_0x1d7f('0xc'),_0x553165,_[_0x1d7f('0x1c')](_0x88e5f0)?JSON[_0x1d7f('0x17')](_0x88e5f0):_0x88e5f0);logger[_0x1d7f('0x13')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x553165);_0x607f18['next']();}};}; \ No newline at end of file +var _0x6306=['channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','error','finally','isObject','next','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','number','consequence','length','[%s][TAG]\x20%s','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0xc52aa1,_0x29f6ae){var _0x3969cc=function(_0xfdeb8a){while(--_0xfdeb8a){_0xc52aa1['push'](_0xc52aa1['shift']());}};_0x3969cc(++_0x29f6ae);}(_0x6306,0xca));var _0x6630=function(_0x547b53,_0x5ea6cb){_0x547b53=_0x547b53-0x0;var _0x166225=_0x6306[_0x547b53];return _0x166225;};'use strict';var schema=require(_0x6630('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x6630('0x1')),'openchannelInteraction':require(_0x6630('0x2')),'smsInteraction':require(_0x6630('0x3')),'mailInteraction':require(_0x6630('0x4')),'faxInteraction':require(_0x6630('0x5')),'whatsappInteraction':require(_0x6630('0x6'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0x6630('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x6630('0x8')]=function(_0x52136f,_0x46827c,_0x2c9c1e,_0x5d6687){return function(_0x560e93){try{var _0x4e346d={'tag':_0x46827c[0x0]};var _0x288769=tag[_0x6630('0x0')](_0x4e346d,{'typecast':!![]});if(_0x288769[_0x6630('0x9')]){logger['error'](_0x6630('0xa'),_0x52136f,_['map'](_0x288769,_0x6630('0xb'))['join'](',\x20'));logger[_0x6630('0xc')](_0x6630('0xd'),_0x52136f);_0x560e93['next']();}else{var _0x2ac194={'ids':[_0x46827c[0x0]]};if(rpc[_0x5d6687[_0x6630('0xe')]+_0x6630('0xf')]){rpc[_0x5d6687[_0x6630('0xe')]+_0x6630('0xf')][_0x6630('0x10')](_0x5d6687['interaction']['id'],_0x2ac194)[_0x6630('0x11')](function(_0x21640e){logger[_0x6630('0xc')](_0x6630('0x12'),_0x52136f,_0x46827c[0x1],_0x5d6687[_0x6630('0xe')],_0x5d6687[_0x6630('0x13')]['id']);})['catch'](function(_0x28e46f){logger[_0x6630('0x14')](_0x6630('0xa'),_0x52136f,JSON['stringify'](_0x28e46f));logger[_0x6630('0xc')](_0x6630('0xd'),_0x52136f);})[_0x6630('0x15')](function(){_0x560e93['next']();});}}}catch(_0x89338){logger['error']('[%s][TAG]\x20%s',_0x52136f,_[_0x6630('0x16')](_0x89338)?JSON['stringify'](_0x89338):_0x89338);logger['info'](_0x6630('0xd'),_0x52136f);_0x560e93[_0x6630('0x17')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 94c1c94..5680c34 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc8c=['urlOnRing','?params=','jsonrpc','2.0','push','utf8','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','stringify','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','routing','consequence','replace','\x20-\x20','includes'];(function(_0x4acfd2,_0x5b9374){var _0x12afbe=function(_0x5bc178){while(--_0x5bc178){_0x4acfd2['push'](_0x4acfd2['shift']());}};_0x12afbe(++_0x5b9374);}(_0xbc8c,0x11c));var _0xcbc8=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xbc8c[_0x1f9f37];return _0x21c080;};'use strict';var rp=require(_0xcbc8('0x0'));var logger=require('../../../../config/logger')(_0xcbc8('0x1'));var _=require('lodash');var arr=[];exports[_0xcbc8('0x2')]=function(_0x3a7e79,_0x426a8f){return function(_0x287686){var _0x3f3599=_0x426a8f[0xa];var _0x592153=_0x426a8f[0xb];var _0x184309=_0x426a8f[0xc];var _0x3c5f92=_0x426a8f[0xd];var _0x4f1324=_0x426a8f[0xe];var _0x577b17=_0x426a8f[0xf][_0xcbc8('0x3')](/\n/g,_0xcbc8('0x4'));var _0x27b332=_0x426a8f[0x10][_0xcbc8('0x3')](/\n/g,'\x20');if(!arr[_0xcbc8('0x5')](_0x592153)){arr['push'](_0x592153);var _0x525add=_0x426a8f[0x3];var _0x2fc683=_0x426a8f[0x4];var _0x432b13=_0x426a8f[0x1];var _0x32a998=_0x426a8f[0x0];var _0x275798={};_0x275798['urlOnAnswer']=_0x426a8f[0x8]+'?params='+_0x184309+'|'+_0x3f3599+'|'+_0x3c5f92+'|'+_0x592153+'|'+_0x4f1324;_0x275798[_0xcbc8('0x6')]=_0x426a8f[0x7]+_0xcbc8('0x7')+_0x184309+'|'+_0x3f3599+'|'+_0x3c5f92+'|'+_0x592153+'|'+_0x4f1324+'|'+_0x577b17+'|'+_0x27b332;_0x275798['title']=_0x426a8f[0x9];var _0x226cca={};_0x226cca[_0xcbc8('0x8')]=_0xcbc8('0x9');_0x226cca['method']='login';var _0x4bf955=[];_0x4bf955['push'](_0x426a8f[0x2]);_0x4bf955[_0xcbc8('0xa')](_0x426a8f[0x5]);_0x4bf955[_0xcbc8('0xa')](_0x426a8f[0x6]);_0x226cca['params']=_0x4bf955;_0x226cca['id']=0x1;var _0x3cea29=JSON['stringify'](_0x226cca);var _0x3dff5a={'encoding':_0xcbc8('0xb'),'method':_0xcbc8('0xc'),'timeout':0x2710,'url':_0x525add,'headers':{'Content-Type':_0xcbc8('0xd')},'body':_0x3cea29};return rp(_0x3dff5a)[_0xcbc8('0xe')](function(_0x3e79d8){const _0x169976=JSON[_0xcbc8('0xf')](_0x3e79d8);if(!_0x169976[_0xcbc8('0x10')][_0xcbc8('0x11')]){throw new Error(_0xcbc8('0x12'));}var _0x494b6a=_0x592153;var _0x3a87d6=_0xcbc8('0x13')+_0x432b13+'&serviceId='+_0x32a998+_0xcbc8('0x14')+_0x494b6a+'&data='+JSON[_0xcbc8('0x15')](_0x275798);var _0x111ae7=_0x2fc683+'?'+_0x3a87d6;return rp(_0x111ae7);})[_0xcbc8('0xe')](function(_0x4bd058){logger['info'](_0xcbc8('0x16'),_0x3a7e79,_0x4bd058);_0x287686[_0xcbc8('0x17')]();})[_0xcbc8('0x18')](function(_0x5254a7){logger[_0xcbc8('0x19')](_0xcbc8('0x1a'),_0x3a7e79,_['isObject'](_0x5254a7)?JSON[_0xcbc8('0x15')](_0x5254a7):_0x5254a7);_0x287686[_0xcbc8('0x17')]();});}else{logger[_0xcbc8('0x1b')](_0xcbc8('0x1c'),_0x3a7e79);_0x287686['next']();}};}; \ No newline at end of file +var _0x6dce=['?params=','jsonrpc','2.0','method','params','stringify','utf8','POST','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','stop','catch','error','[%s][TVOX]\x20%s','isObject','info','../../../../config/logger','replace','\x20-\x20','includes','push','urlOnAnswer','urlOnRing'];(function(_0x3d23ca,_0x5020dd){var _0x54946f=function(_0x20c1f8){while(--_0x20c1f8){_0x3d23ca['push'](_0x3d23ca['shift']());}};_0x54946f(++_0x5020dd);}(_0x6dce,0xa7));var _0xe6dc=function(_0x323d63,_0x1c8e98){_0x323d63=_0x323d63-0x0;var _0x1d0674=_0x6dce[_0x323d63];return _0x1d0674;};'use strict';var rp=require('request-promise');var logger=require(_0xe6dc('0x0'))('routing');var _=require('lodash');var arr=[];exports['consequence']=function(_0x50e002,_0x1bd216){return function(_0x220134){var _0x190937=_0x1bd216[0xa];var _0x554d5a=_0x1bd216[0xb];var _0x1a619f=_0x1bd216[0xc];var _0x49a50e=_0x1bd216[0xd];var _0xb83a8d=_0x1bd216[0xe];var _0x3730ae=_0x1bd216[0xf][_0xe6dc('0x1')](/\n/g,_0xe6dc('0x2'));var _0x4596a0=_0x1bd216[0x10][_0xe6dc('0x1')](/\n/g,'\x20');if(!arr[_0xe6dc('0x3')](_0x554d5a)){arr[_0xe6dc('0x4')](_0x554d5a);var _0x347efc=_0x1bd216[0x3];var _0x5a06df=_0x1bd216[0x4];var _0x352305=_0x1bd216[0x1];var _0x5e3168=_0x1bd216[0x0];var _0x2e3559={};_0x2e3559[_0xe6dc('0x5')]=_0x1bd216[0x8]+'?params='+_0x1a619f+'|'+_0x190937+'|'+_0x49a50e+'|'+_0x554d5a+'|'+_0xb83a8d;_0x2e3559[_0xe6dc('0x6')]=_0x1bd216[0x7]+_0xe6dc('0x7')+_0x1a619f+'|'+_0x190937+'|'+_0x49a50e+'|'+_0x554d5a+'|'+_0xb83a8d+'|'+_0x3730ae+'|'+_0x4596a0;_0x2e3559['title']=_0x1bd216[0x9];var _0x571cd5={};_0x571cd5[_0xe6dc('0x8')]=_0xe6dc('0x9');_0x571cd5[_0xe6dc('0xa')]='login';var _0x31e2ca=[];_0x31e2ca[_0xe6dc('0x4')](_0x1bd216[0x2]);_0x31e2ca['push'](_0x1bd216[0x5]);_0x31e2ca[_0xe6dc('0x4')](_0x1bd216[0x6]);_0x571cd5[_0xe6dc('0xb')]=_0x31e2ca;_0x571cd5['id']=0x1;var _0x3f8637=JSON[_0xe6dc('0xc')](_0x571cd5);var _0x8732c1={'encoding':_0xe6dc('0xd'),'method':_0xe6dc('0xe'),'timeout':0x2710,'url':_0x347efc,'headers':{'Content-Type':_0xe6dc('0xf')},'body':_0x3f8637};return rp(_0x8732c1)[_0xe6dc('0x10')](function(_0x4690d0){const _0x108c9e=JSON[_0xe6dc('0x11')](_0x4690d0);if(!_0x108c9e[_0xe6dc('0x12')]['logged']){throw new Error(_0xe6dc('0x13'));}var _0x284fc1=_0x554d5a;var _0x37c8dc=_0xe6dc('0x14')+_0x352305+_0xe6dc('0x15')+_0x5e3168+'&sessionId='+_0x284fc1+_0xe6dc('0x16')+JSON['stringify'](_0x2e3559);var _0x11eef=_0x5a06df+'?'+_0x37c8dc;return rp(_0x11eef);})[_0xe6dc('0x10')](function(_0x360df9){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x50e002,_0x360df9);_0x220134[_0xe6dc('0x17')]();})[_0xe6dc('0x18')](function(_0x171425){logger[_0xe6dc('0x19')](_0xe6dc('0x1a'),_0x50e002,_[_0xe6dc('0x1b')](_0x171425)?JSON[_0xe6dc('0xc')](_0x171425):_0x171425);_0x220134[_0xe6dc('0x17')]();});}else{logger[_0xe6dc('0x1c')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x50e002);_0x220134['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 9d10f5a..4e575b9 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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x5dfef2,_0x101bba){var _0x2718b4=function(_0x11a427){while(--_0x11a427){_0x5dfef2['push'](_0x5dfef2['shift']());}};_0x2718b4(++_0x101bba);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x332607,_0x998dd0){var _0x1cd885=function(_0x24bb97){while(--_0x24bb97){_0x332607['push'](_0x332607['shift']());}};_0x1cd885(++_0x998dd0);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'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 0af0670..89405b4 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 _0x1491=['QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','map','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','app','.js','toLowerCase','autoreply','appdata','split','push','slice','join','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ContactId','%s:%s:%s','condition','./applications/','info','intervals','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','emit','complete','stack','routing\x20is\x20empty','agent','agents','busy','end'];(function(_0x2c9c52,_0x5f04b2){var _0x383db9=function(_0x51bc46){while(--_0x51bc46){_0x2c9c52['push'](_0x2c9c52['shift']());}};_0x383db9(++_0x5f04b2);}(_0x1491,0x1b1));var _0x1149=function(_0x95e565,_0x59e36d){_0x95e565=_0x95e565-0x0;var _0x30ac1d=_0x1491[_0x95e565];return _0x30ac1d;};'use strict';var _=require(_0x1149('0x0'));var util=require(_0x1149('0x1'));var path=require(_0x1149('0x2'));var fs=require('fs');var jayson=require(_0x1149('0x3'));var BPromise=require('bluebird');var uuid=require(_0x1149('0x4'));var utils=require(_0x1149('0x5'));var config=require(_0x1149('0x6'));var logger=require(_0x1149('0x7'))(_0x1149('0x8'));var rpc={'openchannelQueueReport':require(_0x1149('0x9')),'mailQueueReport':require(_0x1149('0xa')),'chatQueueReport':require(_0x1149('0xb')),'smsQueueReport':require(_0x1149('0xc')),'faxQueueReport':require(_0x1149('0xd')),'whatsappQueueReport':require(_0x1149('0xe'))};var RuleEngine=require(_0x1149('0xf'));function getId(_0x285f6c,_0xde257c,_0x2fa4de){return util[_0x1149('0x10')](_0x1149('0x11'),_0x285f6c,_0xde257c||0x0,_0x2fa4de||0x0);}function getIntervals(_0x449487,_0x82dd3f){var _0x4f0bb6=[];if(!_[_0x1149('0x12')](_0x82dd3f['IntervalId'])&&!_['isNil'](_0x449487[_0x82dd3f['IntervalId']])&&!_[_0x1149('0x12')](_0x449487[_0x82dd3f['IntervalId']]['Intervals'])){_0x4f0bb6=_[_0x1149('0x13')](_0x449487[_0x82dd3f['IntervalId']][_0x1149('0x14')],_0x1149('0x15'));}else if(!_[_0x1149('0x12')](_0x82dd3f[_0x1149('0x15')])){_0x4f0bb6=[_0x82dd3f[_0x1149('0x15')]];}return _0x4f0bb6;}exports[_0x1149('0x16')]=function(_0x5aa405){_0x5aa405[_0x1149('0x17')]={};return new BPromise(function(_0x55a803,_0x4ca1c0){var _0x669ae={'Start':function(_0xdac107){var _0x552de8=this;return new Promise(function(_0xdee3e5,_0x10e218){if(_0xdac107){try{var _0x2fd083=[];var _0x165b15=getId(_0xdac107[_0x1149('0x18')],_0xdac107[_0x1149('0x19')]?_0xdac107[_0x1149('0x19')]['id']:0x0,_0xdac107[_0x1149('0x1a')]?_0xdac107[_0x1149('0x1a')]['id']:0x0);if(_0xdac107[_0x1149('0x1b')]&&_[_0x1149('0x1c')](_0xdac107[_0x1149('0x1b')])&&_0xdac107[_0x1149('0x1b')]['length']){for(var _0x5e744b=0x0;_0x5e744b<_0xdac107[_0x1149('0x1b')][_0x1149('0x1d')];_0x5e744b+=0x1){var _0x3a9337=_0xdac107[_0x1149('0x1b')][_0x5e744b];if(fs[_0x1149('0x1e')](path['join'](__dirname,_0x1149('0x1b'),_0x3a9337[_0x1149('0x1f')]+_0x1149('0x20')))){var _0x4d5649=[];switch(_0x3a9337[_0x1149('0x1f')][_0x1149('0x21')]()){case _0x1149('0x22'):var _0x4c6c52=_0x3a9337[_0x1149('0x23')][_0x1149('0x24')](',');if(_0xdac107[_0x1149('0x18')]==='mail'){_0x4d5649[_0x1149('0x25')](_0x4c6c52[0x0]);_0x4d5649[_0x1149('0x25')](_0x4c6c52[0x1]);_0x4d5649[_0x1149('0x25')](_0x4c6c52[_0x1149('0x26')](0x2,_0x4c6c52[_0x1149('0x1d')])[_0x1149('0x27')](','));}else{_0x4d5649[_0x1149('0x25')](_0x4c6c52[0x0]);_0x4d5649[_0x1149('0x25')](_0x4c6c52[_0x1149('0x26')](0x1,_0x4c6c52[_0x1149('0x1d')])['join'](','));}break;case _0x1149('0x28'):var _0x17cf9b=_0x3a9337['appdata'][_0x1149('0x24')](',');_0x4d5649[_0x1149('0x25')](_0x17cf9b[0x0]);_0x4d5649['push'](_0x17cf9b[0x1]);_0x4d5649[_0x1149('0x25')](_0x17cf9b[_0x1149('0x26')](0x2,_0x17cf9b[_0x1149('0x1d')])['join'](','));break;case _0x1149('0x29'):var _0x31a52d=_0x3a9337[_0x1149('0x23')][_0x1149('0x24')](',');_0x4d5649['push'](_0x31a52d[0x0]);_0x4d5649['push'](_0x31a52d[0x1]);_0x4d5649['push'](_0x31a52d[0x2]);_0x4d5649[_0x1149('0x25')](_0x31a52d[0x3]);_0x4d5649[_0x1149('0x25')](_0x31a52d[_0x1149('0x26')](0x4,_0x31a52d['length'])[_0x1149('0x27')](','));break;case _0x1149('0x2a'):var _0x123c9e=_0x3a9337[_0x1149('0x23')]['split'](',');_0x4d5649[_0x1149('0x25')](_0x123c9e[0x0]);_0x4d5649[_0x1149('0x25')](_0x123c9e[0x1]);_0x4d5649['push'](_0x123c9e[0x2]);_0x4d5649['push'](_0x123c9e[0x3]);_0x4d5649[_0x1149('0x25')](_0x123c9e['slice'](0x4,_0x123c9e['length'])['join'](','));break;case'message':_0x4d5649[_0x1149('0x25')](_0x3a9337[_0x1149('0x23')]);break;case _0x1149('0x2b'):_0x4d5649['push'](_0x3a9337[_0x1149('0x2c')]);_0x4d5649['push'](_0x3a9337['appdata']);break;case _0x1149('0x2d'):var _0xa20656=utils[_0x1149('0x2e')](_0xdac107[_0x1149('0x2f')][_0x1149('0x30')],_0xdac107);var _0x489bc4=_0x3a9337[_0x1149('0x23')][_0x1149('0x24')](',');_0x4d5649[_0x1149('0x25')](_0x489bc4[0x0]);_0x4d5649[_0x1149('0x25')](_0x489bc4[0x1]);_0x4d5649[_0x1149('0x25')](_0x489bc4[0x2]);_0x4d5649['push'](_0x489bc4[0x3]);_0x4d5649[_0x1149('0x25')](_0x489bc4[0x4]);_0x4d5649[_0x1149('0x25')](_0x489bc4[0x5]);_0x4d5649[_0x1149('0x25')](_0x489bc4[0x6]);_0x4d5649[_0x1149('0x25')](_0x489bc4[0x7]);_0x4d5649[_0x1149('0x25')](_0x489bc4[0x8]);_0x4d5649[_0x1149('0x25')](_0x489bc4[0x9]);_0x4d5649[_0x1149('0x25')](_0x489bc4[0xa]);_0x4d5649[_0x1149('0x25')](_0xdac107['interaction']['id']);_0x4d5649[_0x1149('0x25')](_0xdac107[_0x1149('0x19')]['id']);_0x4d5649['push'](_0x3a9337['ChatWebsiteId']);_0x4d5649[_0x1149('0x25')](_0xdac107[_0x1149('0x1a')][_0x1149('0x31')]);_0x4d5649[_0x1149('0x25')](_0xdac107['body']['body']);_0x4d5649['push'](_0xa20656);break;default:_0x4d5649=_[_0x1149('0x12')](_0x3a9337[_0x1149('0x23')])?[]:_0x3a9337[_0x1149('0x23')]['split'](',');}var _0x478a5c={'id':util['format'](_0x1149('0x32'),_0x165b15,_0x3a9337['id'],_0x3a9337['app']),'condition':require('./interval')[_0x1149('0x33')](_0x165b15,getIntervals(_0x5aa405['intervals'],_0x3a9337),_0x5aa405),'consequence':require(_0x1149('0x34')+_0x3a9337['app'])['consequence'](_0x165b15,_0x4d5649,_0x5aa405,_0xdac107),'p':_0x3a9337['priority']||0x0};logger[_0x1149('0x35')]('Push\x20new\x20rule',_0x478a5c['id'],'on\x20interval',getIntervals(_0x5aa405[_0x1149('0x36')],_0x3a9337)[_0x1149('0x27')]('\x20|\x20'));_0x2fd083['push'](_0x478a5c);}else{logger[_0x1149('0x37')](_0x1149('0x38'),path[_0x1149('0x27')](__dirname,_0x1149('0x1b'),_0x3a9337[_0x1149('0x1f')]+'.js'));}}_0x5aa405['rules'][_0x165b15]=new RuleEngine(_0x2fd083);_0x5aa405[_0x1149('0x17')][_0x165b15][_0x1149('0x39')](_0xdac107,function(_0x47af09){logger[_0x1149('0x35')]('Applications\x20executed',JSON[_0x1149('0x3a')](_0x47af09['matchPath']));if(_0x5aa405[_0x1149('0x17')][_0x165b15]){_0x5aa405[_0x1149('0x17')][_0x165b15][_0x1149('0x3b')](_0x1149('0x3c'));}});return _0xdee3e5({'code':0xc8,'message':_0xdac107});}else{logger[_0x1149('0x35')]('No\x20applications\x20to\x20execute');return _0xdee3e5({'code':0xc8,'message':_0xdac107});}}catch(_0x3e615f){logger[_0x1149('0x37')](_0x3e615f[_0x1149('0x3d')]);return _0x10e218(_0x552de8[_0x1149('0x37')](0x1f4,_0x3e615f));}}return _0x10e218(_0x1149('0x3e'));});},'AcceptMessage':function(_0x50fb46){var _0x5602dd=this;return new Promise(function(_0x418236,_0x22e765){if(_0x50fb46[_0x1149('0x3f')]&&_0x50fb46[_0x1149('0x3f')]['id']){if(_0x5aa405['agents'][_0x50fb46[_0x1149('0x3f')]['id']]){_0x5aa405[_0x1149('0x40')][_0x50fb46['agent']['id']][_0x1149('0x41')]=![];_0x5aa405[_0x1149('0x40')][_0x50fb46['agent']['id']]['busyQueue']=undefined;}}if(_0x50fb46[_0x1149('0x19')]&&_0x50fb46[_0x1149('0x19')]['id']){try{var _0x5805da=getId(_0x50fb46[_0x1149('0x18')],_0x50fb46[_0x1149('0x19')]?_0x50fb46[_0x1149('0x19')]['id']:0x0,_0x50fb46[_0x1149('0x1a')]?_0x50fb46['interaction']['id']:0x0);if(_0x5aa405[_0x1149('0x17')][_0x5805da]){_0x5aa405[_0x1149('0x17')][_0x5805da][_0x1149('0x3b')](_0x1149('0x42'));if(rpc[_0x50fb46[_0x1149('0x18')]+_0x1149('0x43')]){rpc[_0x50fb46[_0x1149('0x18')]+_0x1149('0x43')][_0x1149('0x44')](_0x5805da,{'UserId':_0x50fb46[_0x1149('0x19')][_0x1149('0x45')]})[_0x1149('0x46')](function(_0x13c8ed){logger['error'](_0x1149('0x47'));});}}return _0x418236({'code':0xc8,'message':_0x50fb46});}catch(_0x263c2b){logger[_0x1149('0x37')](_0x263c2b[_0x1149('0x3d')]);return _0x22e765(_0x5602dd[_0x1149('0x37')](0x1f4,_0x263c2b));}}logger['error'](_0x1149('0x48'));return _0x22e765(_0x5602dd[_0x1149('0x37')](0x1f4,_0x1149('0x48')));});},'RejectMessage':function(_0x2f4d10){var _0x37b69a=this;return new Promise(function(_0x3ca311,_0x301796){if(_0x2f4d10[_0x1149('0x3f')]&&_0x2f4d10[_0x1149('0x3f')]['id']){try{if(_0x5aa405[_0x1149('0x40')][_0x2f4d10['agent']['id']]){_0x5aa405[_0x1149('0x40')][_0x2f4d10[_0x1149('0x3f')]['id']][_0x1149('0x41')]=![];_0x5aa405['agents'][_0x2f4d10['agent']['id']][_0x1149('0x49')]=undefined;}return _0x3ca311({'code':0xc8,'message':_0x2f4d10});}catch(_0x1ceeaa){logger[_0x1149('0x37')](_0x1ceeaa['stack']);return _0x301796(_0x37b69a['error'](0x1f4,_0x1ceeaa));}}logger[_0x1149('0x37')](_0x1149('0x48'));return _0x301796(_0x37b69a[_0x1149('0x37')](0x1f4,_0x1149('0x48')));});},'AbandonInteraction':function(_0x5b6924){var _0x16c12e=this;return new Promise(function(_0x5430a1,_0x4221f9){if(_0x5b6924[_0x1149('0x18')]&&_0x5b6924[_0x1149('0x1a')]&&_0x5b6924['interaction']['id']){try{var _0x5eed38=getId(_0x5b6924[_0x1149('0x18')],_0x5b6924[_0x1149('0x19')]?_0x5b6924['message']['id']:0x0,_0x5b6924[_0x1149('0x1a')]?_0x5b6924[_0x1149('0x1a')]['id']:0x0);if(_0x5aa405[_0x1149('0x17')][_0x5eed38]){_0x5aa405[_0x1149('0x17')][_0x5eed38][_0x1149('0x3b')](_0x1149('0x42'));}return _0x5430a1({'code':0xc8,'message':_0x5b6924});}catch(_0x54aa25){logger[_0x1149('0x37')](_0x54aa25['stack']);return _0x4221f9(_0x16c12e[_0x1149('0x37')](0x1f4,_0x54aa25));}}logger[_0x1149('0x37')](_0x1149('0x48'));return _0x4221f9(_0x16c12e['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x582ff6){var _0x260244=this;return new Promise(function(_0x3fdd93,_0x518b23){if(_0x5aa405[_0x1149('0x40')][_0x1149('0x4a')](_0x582ff6['id'])){for(var _0x2bbd63 in _0x582ff6[_0x1149('0x4b')]){if(_0x582ff6[_0x1149('0x4b')][_0x1149('0x4a')](_0x2bbd63)){if(_0x5aa405[_0x1149('0x40')][_0x582ff6['id']]['hasOwnProperty'](_0x2bbd63+_0x1149('0x4c'))){_0x5aa405[_0x1149('0x40')][_0x582ff6['id']][_0x2bbd63+_0x1149('0x4c')]=parseInt(_0x582ff6[_0x1149('0x4b')][_0x2bbd63],0xa);}}}_0x5aa405[_0x1149('0x40')][_0x582ff6['id']][_0x1149('0x4d')]();return _0x3fdd93({'code':0xc8,'message':_0x5aa405['agents'][_0x582ff6['id']]});}else{return _0x518b23(_0x260244[_0x1149('0x37')](0x1f4,_0x1149('0x4e')));}});},'Agents':function(_0x728846){return new Promise(function(_0x2c2f02,_0x17aa9c){var _0x2bf75e=_[_0x1149('0x4f')](_0x5aa405['agents']);_0x2c2f02({'count':_0x2bf75e[_0x1149('0x1d')],'rows':_0x2bf75e});});},'ChatQueues':function(_0x28c818){return new Promise(function(_0x160c8b,_0x3f9cc7){var _0x55591d=[];for(var _0x5840cc in _0x5aa405[_0x1149('0x50')]){if(_0x5aa405[_0x1149('0x50')]['hasOwnProperty'](_0x5840cc)){var _0x52e07a=_0x5aa405[_0x1149('0x50')][_0x5840cc];var _0x4fa852={'id':_0x52e07a['id'],'available':_0x52e07a[_0x1149('0x51')],'loggedIn':_0x52e07a[_0x1149('0x52')],'name':_0x52e07a[_0x1149('0x53')],'paused':_0x52e07a[_0x1149('0x54')],'waiting':_0x52e07a[_0x1149('0x55')]};_0x55591d['push'](_0x4fa852);}}_0x160c8b({'count':_0x55591d[_0x1149('0x1d')],'rows':_0x55591d});});},'MailQueues':function(_0x2bc271){return new Promise(function(_0x2dcb81,_0x197081){var _0x415bc0=[];for(var _0x3abcac in _0x5aa405[_0x1149('0x56')]){if(_0x5aa405[_0x1149('0x56')][_0x1149('0x4a')](_0x3abcac)){var _0x120659=_0x5aa405[_0x1149('0x56')][_0x3abcac];var _0x21b429={'id':_0x120659['id'],'available':_0x120659[_0x1149('0x51')],'loggedIn':_0x120659['loggedIn'],'name':_0x120659[_0x1149('0x53')],'paused':_0x120659[_0x1149('0x54')],'waiting':_0x120659[_0x1149('0x55')]};_0x415bc0[_0x1149('0x25')](_0x21b429);}}_0x2dcb81({'count':_0x415bc0[_0x1149('0x1d')],'rows':_0x415bc0});});},'OpenchannelQueues':function(_0x14fce5){return new Promise(function(_0x4bec18,_0x362914){var _0x2ddc28=[];for(var _0x55be85 in _0x5aa405[_0x1149('0x57')]){if(_0x5aa405[_0x1149('0x57')]['hasOwnProperty'](_0x55be85)){var _0x1920af=_0x5aa405[_0x1149('0x57')][_0x55be85];var _0x4adc8e={'id':_0x1920af['id'],'available':_0x1920af['available'],'loggedIn':_0x1920af[_0x1149('0x52')],'name':_0x1920af[_0x1149('0x53')],'paused':_0x1920af[_0x1149('0x54')],'waiting':_0x1920af[_0x1149('0x55')]};_0x2ddc28['push'](_0x4adc8e);}}_0x4bec18({'count':_0x2ddc28['length'],'rows':_0x2ddc28});});},'SmsQueues':function(_0x420b6d){return new Promise(function(_0xe21f0d,_0x45d055){var _0x399c76=[];for(var _0x1be14b in _0x5aa405[_0x1149('0x58')]){if(_0x5aa405[_0x1149('0x58')][_0x1149('0x4a')](_0x1be14b)){var _0x119579=_0x5aa405['smsQueues'][_0x1be14b];var _0x534a72={'id':_0x119579['id'],'available':_0x119579[_0x1149('0x51')],'loggedIn':_0x119579['loggedIn'],'name':_0x119579['name'],'paused':_0x119579['paused'],'waiting':_0x119579[_0x1149('0x55')]};_0x399c76[_0x1149('0x25')](_0x534a72);}}_0xe21f0d({'count':_0x399c76['length'],'rows':_0x399c76});});},'FaxQueues':function(_0x15221f){return new Promise(function(_0x55e663,_0xdaf2fa){var _0x39c41e=[];for(var _0x415427 in _0x5aa405[_0x1149('0x59')]){if(_0x5aa405[_0x1149('0x59')][_0x1149('0x4a')](_0x415427)){var _0x337394=_0x5aa405[_0x1149('0x59')][_0x415427];var _0x2dd932={'id':_0x337394['id'],'available':_0x337394[_0x1149('0x51')],'loggedIn':_0x337394[_0x1149('0x52')],'name':_0x337394[_0x1149('0x53')],'paused':_0x337394['paused'],'waiting':_0x337394[_0x1149('0x55')]};_0x39c41e[_0x1149('0x25')](_0x2dd932);}}_0x55e663({'count':_0x39c41e[_0x1149('0x1d')],'rows':_0x39c41e});});},'WhatsappQueues':function(_0x2816db){return new Promise(function(_0x175ae6,_0x191ab2){var _0x497dd5=[];for(var _0x2422f0 in _0x5aa405[_0x1149('0x5a')]){if(_0x5aa405[_0x1149('0x5a')]['hasOwnProperty'](_0x2422f0)){var _0x29a877=_0x5aa405[_0x1149('0x5a')][_0x2422f0];var _0x59f756={'id':_0x29a877['id'],'available':_0x29a877['available'],'loggedIn':_0x29a877[_0x1149('0x52')],'name':_0x29a877[_0x1149('0x53')],'paused':_0x29a877['paused'],'waiting':_0x29a877[_0x1149('0x55')]};_0x497dd5[_0x1149('0x25')](_0x59f756);}}_0x175ae6({'count':_0x497dd5[_0x1149('0x1d')],'rows':_0x497dd5});});},'ChatQueuesWaitingInteractions':function(_0x29d9cf){return new Promise(function(_0x4f4d5c,_0x3c0e5c){var _0x3e829b=_[_0x1149('0x4f')](_0x5aa405[_0x1149('0x5b')]);_0x4f4d5c({'count':_0x3e829b['length'],'rows':_0x3e829b});});},'MailQueuesWaitingInteractions':function(_0x1771e7){return new Promise(function(_0x57cbff,_0x502e63){var _0x134ef1=_[_0x1149('0x4f')](_0x5aa405['mailQueuesWaitingInteractions']);_0x57cbff({'count':_0x134ef1['length'],'rows':_0x134ef1});});},'OpenchannelQueuesWaitingInteractions':function(_0x310851){return new Promise(function(_0x18e7cf,_0x910faa){var _0x59a125=_[_0x1149('0x4f')](_0x5aa405['openchannelQueuesWaitingInteractions']);_0x18e7cf({'count':_0x59a125['length'],'rows':_0x59a125});});},'SmsQueuesWaitingInteractions':function(_0x4695f3){return new Promise(function(_0x4f871e,_0x97acc2){var _0x34bc27=_['values'](_0x5aa405[_0x1149('0x5c')]);_0x4f871e({'count':_0x34bc27[_0x1149('0x1d')],'rows':_0x34bc27});});},'FaxQueuesWaitingInteractions':function(_0x5e6ce5){return new Promise(function(_0x4283ca,_0x543eda){var _0x21f2b3=_['values'](_0x5aa405['faxQueuesWaitingInteractions']);_0x4283ca({'count':_0x21f2b3[_0x1149('0x1d')],'rows':_0x21f2b3});});},'WhatsappQueuesWaitingInteractions':function(_0x2f8fd4){return new Promise(function(_0x217ead,_0x15ed5d){var _0x469805=_[_0x1149('0x4f')](_0x5aa405[_0x1149('0x5d')]);_0x217ead({'count':_0x469805[_0x1149('0x1d')],'rows':_0x469805});});}};var _0x131559=jayson[_0x1149('0x5e')](_0x669ae)[_0x1149('0x5f')]();_0x131559['on'](_0x1149('0x37'),function(_0x251ac2){logger['error'](JSON[_0x1149('0x3a')](_0x251ac2));return _0x4ca1c0(_0x251ac2);});_0x131559['listen'](0x232c,_0x1149('0x60'),function(){console[_0x1149('0x61')](_0x1149('0x62'),0x232c);return _0x55a803(_0x1149('0x63')+0x232c);});});}; \ No newline at end of file +var _0xfc4c=['listen','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','uuid','./applications/utils','routing','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','isNil','IntervalId','Intervals','map','interval','rules','message','interaction','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','channel','mail','push','slice','dialogflow','split','amazonlex','tag','TagId','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server'];(function(_0x89b900,_0x5cca43){var _0x38a08a=function(_0x41f2f7){while(--_0x41f2f7){_0x89b900['push'](_0x89b900['shift']());}};_0x38a08a(++_0x5cca43);}(_0xfc4c,0xca));var _0xcfc4=function(_0x4720b4,_0x28057e){_0x4720b4=_0x4720b4-0x0;var _0x392795=_0xfc4c[_0x4720b4];return _0x392795;};'use strict';var _=require(_0xcfc4('0x0'));var util=require(_0xcfc4('0x1'));var path=require(_0xcfc4('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xcfc4('0x3'));var uuid=require(_0xcfc4('0x4'));var utils=require(_0xcfc4('0x5'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xcfc4('0x6'));var rpc={'openchannelQueueReport':require(_0xcfc4('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xcfc4('0x8')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xcfc4('0x9'))};var RuleEngine=require(_0xcfc4('0xa'));function getId(_0x520566,_0x13b9f6,_0x57e2f5){return util['format']('%s.%s.%s',_0x520566,_0x13b9f6||0x0,_0x57e2f5||0x0);}function getIntervals(_0x1ce9e8,_0x2d8256){var _0x584f17=[];if(!_[_0xcfc4('0xb')](_0x2d8256['IntervalId'])&&!_['isNil'](_0x1ce9e8[_0x2d8256[_0xcfc4('0xc')]])&&!_[_0xcfc4('0xb')](_0x1ce9e8[_0x2d8256[_0xcfc4('0xc')]][_0xcfc4('0xd')])){_0x584f17=_[_0xcfc4('0xe')](_0x1ce9e8[_0x2d8256['IntervalId']][_0xcfc4('0xd')],'interval');}else if(!_[_0xcfc4('0xb')](_0x2d8256['interval'])){_0x584f17=[_0x2d8256[_0xcfc4('0xf')]];}return _0x584f17;}exports['listen']=function(_0x57fffb){_0x57fffb[_0xcfc4('0x10')]={};return new BPromise(function(_0x40029f,_0x588dd1){var _0x407cd6={'Start':function(_0x391d92){var _0x39f8f1=this;return new Promise(function(_0x4bb1f3,_0x5af66f){if(_0x391d92){try{var _0xe4c5bd=[];var _0x47db36=getId(_0x391d92['channel'],_0x391d92['message']?_0x391d92[_0xcfc4('0x11')]['id']:0x0,_0x391d92['interaction']?_0x391d92[_0xcfc4('0x12')]['id']:0x0);if(_0x391d92[_0xcfc4('0x13')]&&_['isArray'](_0x391d92[_0xcfc4('0x13')])&&_0x391d92[_0xcfc4('0x13')][_0xcfc4('0x14')]){for(var _0x520dae=0x0;_0x520dae<_0x391d92[_0xcfc4('0x13')][_0xcfc4('0x14')];_0x520dae+=0x1){var _0x2aec71=_0x391d92['applications'][_0x520dae];if(fs[_0xcfc4('0x15')](path[_0xcfc4('0x16')](__dirname,_0xcfc4('0x13'),_0x2aec71[_0xcfc4('0x17')]+_0xcfc4('0x18')))){var _0x3e6839=[];switch(_0x2aec71[_0xcfc4('0x17')][_0xcfc4('0x19')]()){case _0xcfc4('0x1a'):var _0x42ef35=_0x2aec71[_0xcfc4('0x1b')]['split'](',');if(_0x391d92[_0xcfc4('0x1c')]===_0xcfc4('0x1d')){_0x3e6839[_0xcfc4('0x1e')](_0x42ef35[0x0]);_0x3e6839['push'](_0x42ef35[0x1]);_0x3e6839[_0xcfc4('0x1e')](_0x42ef35['slice'](0x2,_0x42ef35[_0xcfc4('0x14')])[_0xcfc4('0x16')](','));}else{_0x3e6839[_0xcfc4('0x1e')](_0x42ef35[0x0]);_0x3e6839[_0xcfc4('0x1e')](_0x42ef35[_0xcfc4('0x1f')](0x1,_0x42ef35[_0xcfc4('0x14')])['join'](','));}break;case _0xcfc4('0x20'):var _0x347f15=_0x2aec71[_0xcfc4('0x1b')][_0xcfc4('0x21')](',');_0x3e6839[_0xcfc4('0x1e')](_0x347f15[0x0]);_0x3e6839['push'](_0x347f15[0x1]);_0x3e6839[_0xcfc4('0x1e')](_0x347f15[_0xcfc4('0x1f')](0x2,_0x347f15[_0xcfc4('0x14')])[_0xcfc4('0x16')](','));break;case'dialogflowv2':var _0x4c65fc=_0x2aec71['appdata'][_0xcfc4('0x21')](',');_0x3e6839[_0xcfc4('0x1e')](_0x4c65fc[0x0]);_0x3e6839[_0xcfc4('0x1e')](_0x4c65fc[0x1]);_0x3e6839[_0xcfc4('0x1e')](_0x4c65fc[0x2]);_0x3e6839[_0xcfc4('0x1e')](_0x4c65fc[0x3]);_0x3e6839[_0xcfc4('0x1e')](_0x4c65fc[_0xcfc4('0x1f')](0x4,_0x4c65fc['length'])[_0xcfc4('0x16')](','));break;case _0xcfc4('0x22'):var _0x28a085=_0x2aec71[_0xcfc4('0x1b')][_0xcfc4('0x21')](',');_0x3e6839[_0xcfc4('0x1e')](_0x28a085[0x0]);_0x3e6839[_0xcfc4('0x1e')](_0x28a085[0x1]);_0x3e6839['push'](_0x28a085[0x2]);_0x3e6839['push'](_0x28a085[0x3]);_0x3e6839[_0xcfc4('0x1e')](_0x28a085[_0xcfc4('0x1f')](0x4,_0x28a085[_0xcfc4('0x14')])['join'](','));break;case _0xcfc4('0x11'):_0x3e6839[_0xcfc4('0x1e')](_0x2aec71['appdata']);break;case _0xcfc4('0x23'):_0x3e6839[_0xcfc4('0x1e')](_0x2aec71[_0xcfc4('0x24')]);_0x3e6839[_0xcfc4('0x1e')](_0x2aec71[_0xcfc4('0x1b')]);break;case'tvox':var _0x3d59c8=utils['getMustacheRender'](_0x391d92[_0xcfc4('0x25')][_0xcfc4('0x26')],_0x391d92);var _0x3ac6ea=_0x2aec71[_0xcfc4('0x1b')][_0xcfc4('0x21')](',');_0x3e6839[_0xcfc4('0x1e')](_0x3ac6ea[0x0]);_0x3e6839[_0xcfc4('0x1e')](_0x3ac6ea[0x1]);_0x3e6839[_0xcfc4('0x1e')](_0x3ac6ea[0x2]);_0x3e6839[_0xcfc4('0x1e')](_0x3ac6ea[0x3]);_0x3e6839[_0xcfc4('0x1e')](_0x3ac6ea[0x4]);_0x3e6839['push'](_0x3ac6ea[0x5]);_0x3e6839[_0xcfc4('0x1e')](_0x3ac6ea[0x6]);_0x3e6839[_0xcfc4('0x1e')](_0x3ac6ea[0x7]);_0x3e6839[_0xcfc4('0x1e')](_0x3ac6ea[0x8]);_0x3e6839[_0xcfc4('0x1e')](_0x3ac6ea[0x9]);_0x3e6839[_0xcfc4('0x1e')](_0x3ac6ea[0xa]);_0x3e6839['push'](_0x391d92[_0xcfc4('0x12')]['id']);_0x3e6839['push'](_0x391d92[_0xcfc4('0x11')]['id']);_0x3e6839[_0xcfc4('0x1e')](_0x2aec71['ChatWebsiteId']);_0x3e6839['push'](_0x391d92['interaction'][_0xcfc4('0x27')]);_0x3e6839['push'](_0x391d92[_0xcfc4('0x28')][_0xcfc4('0x28')]);_0x3e6839['push'](_0x3d59c8);break;default:_0x3e6839=_[_0xcfc4('0xb')](_0x2aec71[_0xcfc4('0x1b')])?[]:_0x2aec71[_0xcfc4('0x1b')]['split'](',');}var _0x15b89f={'id':util['format'](_0xcfc4('0x29'),_0x47db36,_0x2aec71['id'],_0x2aec71[_0xcfc4('0x17')]),'condition':require(_0xcfc4('0x2a'))[_0xcfc4('0x2b')](_0x47db36,getIntervals(_0x57fffb[_0xcfc4('0x2c')],_0x2aec71),_0x57fffb),'consequence':require(_0xcfc4('0x2d')+_0x2aec71[_0xcfc4('0x17')])[_0xcfc4('0x2e')](_0x47db36,_0x3e6839,_0x57fffb,_0x391d92),'p':_0x2aec71['priority']||0x0};logger['info'](_0xcfc4('0x2f'),_0x15b89f['id'],_0xcfc4('0x30'),getIntervals(_0x57fffb['intervals'],_0x2aec71)[_0xcfc4('0x16')](_0xcfc4('0x31')));_0xe4c5bd['push'](_0x15b89f);}else{logger[_0xcfc4('0x32')](_0xcfc4('0x33'),path[_0xcfc4('0x16')](__dirname,_0xcfc4('0x13'),_0x2aec71['app']+_0xcfc4('0x18')));}}_0x57fffb[_0xcfc4('0x10')][_0x47db36]=new RuleEngine(_0xe4c5bd);_0x57fffb[_0xcfc4('0x10')][_0x47db36][_0xcfc4('0x34')](_0x391d92,function(_0x329029){logger['info'](_0xcfc4('0x35'),JSON[_0xcfc4('0x36')](_0x329029[_0xcfc4('0x37')]));if(_0x57fffb[_0xcfc4('0x10')][_0x47db36]){_0x57fffb['rules'][_0x47db36]['emit'](_0xcfc4('0x38'));}});return _0x4bb1f3({'code':0xc8,'message':_0x391d92});}else{logger['info'](_0xcfc4('0x39'));return _0x4bb1f3({'code':0xc8,'message':_0x391d92});}}catch(_0x7464ed){logger[_0xcfc4('0x32')](_0x7464ed[_0xcfc4('0x3a')]);return _0x5af66f(_0x39f8f1['error'](0x1f4,_0x7464ed));}}return _0x5af66f(_0xcfc4('0x3b'));});},'AcceptMessage':function(_0x11e8aa){var _0x68ea0d=this;return new Promise(function(_0x5018a3,_0x1bac85){if(_0x11e8aa[_0xcfc4('0x3c')]&&_0x11e8aa[_0xcfc4('0x3c')]['id']){if(_0x57fffb[_0xcfc4('0x3d')][_0x11e8aa[_0xcfc4('0x3c')]['id']]){_0x57fffb[_0xcfc4('0x3d')][_0x11e8aa[_0xcfc4('0x3c')]['id']][_0xcfc4('0x3e')]=![];_0x57fffb[_0xcfc4('0x3d')][_0x11e8aa[_0xcfc4('0x3c')]['id']][_0xcfc4('0x3f')]=undefined;}}if(_0x11e8aa['message']&&_0x11e8aa['message']['id']){try{var _0x127889=getId(_0x11e8aa['channel'],_0x11e8aa[_0xcfc4('0x11')]?_0x11e8aa[_0xcfc4('0x11')]['id']:0x0,_0x11e8aa[_0xcfc4('0x12')]?_0x11e8aa[_0xcfc4('0x12')]['id']:0x0);if(_0x57fffb[_0xcfc4('0x10')][_0x127889]){_0x57fffb[_0xcfc4('0x10')][_0x127889][_0xcfc4('0x40')](_0xcfc4('0x41'));if(rpc[_0x11e8aa['channel']+_0xcfc4('0x42')]){rpc[_0x11e8aa[_0xcfc4('0x1c')]+_0xcfc4('0x42')][_0xcfc4('0x43')](_0x127889,{'UserId':_0x11e8aa['message'][_0xcfc4('0x44')]})[_0xcfc4('0x45')](function(_0x42ffe2){logger[_0xcfc4('0x32')](_0xcfc4('0x46'));});}}return _0x5018a3({'code':0xc8,'message':_0x11e8aa});}catch(_0x38d89d){logger['error'](_0x38d89d[_0xcfc4('0x3a')]);return _0x1bac85(_0x68ea0d[_0xcfc4('0x32')](0x1f4,_0x38d89d));}}logger['error']('message\x20is\x20empty');return _0x1bac85(_0x68ea0d[_0xcfc4('0x32')](0x1f4,_0xcfc4('0x47')));});},'RejectMessage':function(_0x137804){var _0x4d5551=this;return new Promise(function(_0x3d7981,_0x44d0e5){if(_0x137804[_0xcfc4('0x3c')]&&_0x137804['agent']['id']){try{if(_0x57fffb['agents'][_0x137804[_0xcfc4('0x3c')]['id']]){_0x57fffb[_0xcfc4('0x3d')][_0x137804[_0xcfc4('0x3c')]['id']][_0xcfc4('0x3e')]=![];_0x57fffb[_0xcfc4('0x3d')][_0x137804['agent']['id']][_0xcfc4('0x3f')]=undefined;}return _0x3d7981({'code':0xc8,'message':_0x137804});}catch(_0x1f2116){logger[_0xcfc4('0x32')](_0x1f2116[_0xcfc4('0x3a')]);return _0x44d0e5(_0x4d5551['error'](0x1f4,_0x1f2116));}}logger[_0xcfc4('0x32')](_0xcfc4('0x47'));return _0x44d0e5(_0x4d5551[_0xcfc4('0x32')](0x1f4,_0xcfc4('0x47')));});},'AbandonInteraction':function(_0x1718fb){var _0x49aa5a=this;return new Promise(function(_0x51c637,_0x20ddf6){if(_0x1718fb[_0xcfc4('0x1c')]&&_0x1718fb[_0xcfc4('0x12')]&&_0x1718fb[_0xcfc4('0x12')]['id']){try{var _0x2e0019=getId(_0x1718fb['channel'],_0x1718fb['message']?_0x1718fb['message']['id']:0x0,_0x1718fb['interaction']?_0x1718fb[_0xcfc4('0x12')]['id']:0x0);if(_0x57fffb['rules'][_0x2e0019]){_0x57fffb[_0xcfc4('0x10')][_0x2e0019]['emit'](_0xcfc4('0x41'));}return _0x51c637({'code':0xc8,'message':_0x1718fb});}catch(_0x508c0f){logger[_0xcfc4('0x32')](_0x508c0f[_0xcfc4('0x3a')]);return _0x20ddf6(_0x49aa5a[_0xcfc4('0x32')](0x1f4,_0x508c0f));}}logger[_0xcfc4('0x32')](_0xcfc4('0x47'));return _0x20ddf6(_0x49aa5a[_0xcfc4('0x32')](0x1f4,_0xcfc4('0x47')));});},'AgentCapacity':function(_0x1e0a33){var _0x4baa0e=this;return new Promise(function(_0x3f19d0,_0x31a253){if(_0x57fffb[_0xcfc4('0x3d')]['hasOwnProperty'](_0x1e0a33['id'])){for(var _0x4edf39 in _0x1e0a33[_0xcfc4('0x48')]){if(_0x1e0a33['capacity'][_0xcfc4('0x49')](_0x4edf39)){if(_0x57fffb['agents'][_0x1e0a33['id']][_0xcfc4('0x49')](_0x4edf39+_0xcfc4('0x4a'))){_0x57fffb[_0xcfc4('0x3d')][_0x1e0a33['id']][_0x4edf39+'CurrentCapacity']=parseInt(_0x1e0a33['capacity'][_0x4edf39],0xa);}}}_0x57fffb['agents'][_0x1e0a33['id']][_0xcfc4('0x4b')]();return _0x3f19d0({'code':0xc8,'message':_0x57fffb[_0xcfc4('0x3d')][_0x1e0a33['id']]});}else{return _0x31a253(_0x4baa0e['error'](0x1f4,_0xcfc4('0x4c')));}});},'Agents':function(_0x18c87c){return new Promise(function(_0x22049a,_0x2ff874){var _0x336800=_[_0xcfc4('0x4d')](_0x57fffb[_0xcfc4('0x3d')]);_0x22049a({'count':_0x336800[_0xcfc4('0x14')],'rows':_0x336800});});},'ChatQueues':function(_0x54802b){return new Promise(function(_0x30d118,_0x25174d){var _0x569a5e=[];for(var _0x522939 in _0x57fffb[_0xcfc4('0x4e')]){if(_0x57fffb[_0xcfc4('0x4e')]['hasOwnProperty'](_0x522939)){var _0x55e73c=_0x57fffb[_0xcfc4('0x4e')][_0x522939];var _0x582ee1={'id':_0x55e73c['id'],'available':_0x55e73c[_0xcfc4('0x4f')],'loggedIn':_0x55e73c[_0xcfc4('0x50')],'name':_0x55e73c[_0xcfc4('0x51')],'paused':_0x55e73c[_0xcfc4('0x52')],'waiting':_0x55e73c[_0xcfc4('0x53')]};_0x569a5e[_0xcfc4('0x1e')](_0x582ee1);}}_0x30d118({'count':_0x569a5e['length'],'rows':_0x569a5e});});},'MailQueues':function(_0x2fd03c){return new Promise(function(_0x5a5c7d,_0x839c74){var _0x582630=[];for(var _0x40d671 in _0x57fffb[_0xcfc4('0x54')]){if(_0x57fffb['mailQueues'][_0xcfc4('0x49')](_0x40d671)){var _0x57e093=_0x57fffb[_0xcfc4('0x54')][_0x40d671];var _0x24a42f={'id':_0x57e093['id'],'available':_0x57e093[_0xcfc4('0x4f')],'loggedIn':_0x57e093[_0xcfc4('0x50')],'name':_0x57e093[_0xcfc4('0x51')],'paused':_0x57e093[_0xcfc4('0x52')],'waiting':_0x57e093[_0xcfc4('0x53')]};_0x582630[_0xcfc4('0x1e')](_0x24a42f);}}_0x5a5c7d({'count':_0x582630[_0xcfc4('0x14')],'rows':_0x582630});});},'OpenchannelQueues':function(_0x306748){return new Promise(function(_0x5ad449,_0x3245e4){var _0x5455dd=[];for(var _0x1c5519 in _0x57fffb['openchannelQueues']){if(_0x57fffb[_0xcfc4('0x55')]['hasOwnProperty'](_0x1c5519)){var _0x1b7708=_0x57fffb['openchannelQueues'][_0x1c5519];var _0x484993={'id':_0x1b7708['id'],'available':_0x1b7708[_0xcfc4('0x4f')],'loggedIn':_0x1b7708[_0xcfc4('0x50')],'name':_0x1b7708[_0xcfc4('0x51')],'paused':_0x1b7708['paused'],'waiting':_0x1b7708[_0xcfc4('0x53')]};_0x5455dd[_0xcfc4('0x1e')](_0x484993);}}_0x5ad449({'count':_0x5455dd['length'],'rows':_0x5455dd});});},'SmsQueues':function(_0x32fafc){return new Promise(function(_0x495329,_0x272ee8){var _0xa51dce=[];for(var _0x2a4c90 in _0x57fffb[_0xcfc4('0x56')]){if(_0x57fffb[_0xcfc4('0x56')]['hasOwnProperty'](_0x2a4c90)){var _0x2aaad2=_0x57fffb[_0xcfc4('0x56')][_0x2a4c90];var _0x1a13bb={'id':_0x2aaad2['id'],'available':_0x2aaad2[_0xcfc4('0x4f')],'loggedIn':_0x2aaad2['loggedIn'],'name':_0x2aaad2[_0xcfc4('0x51')],'paused':_0x2aaad2[_0xcfc4('0x52')],'waiting':_0x2aaad2[_0xcfc4('0x53')]};_0xa51dce[_0xcfc4('0x1e')](_0x1a13bb);}}_0x495329({'count':_0xa51dce[_0xcfc4('0x14')],'rows':_0xa51dce});});},'FaxQueues':function(_0x2fcbb8){return new Promise(function(_0xa1c5f2,_0x36d305){var _0x25f42b=[];for(var _0x4bef20 in _0x57fffb[_0xcfc4('0x57')]){if(_0x57fffb['faxQueues'][_0xcfc4('0x49')](_0x4bef20)){var _0x1b8a2b=_0x57fffb['faxQueues'][_0x4bef20];var _0xcae1b2={'id':_0x1b8a2b['id'],'available':_0x1b8a2b['available'],'loggedIn':_0x1b8a2b['loggedIn'],'name':_0x1b8a2b[_0xcfc4('0x51')],'paused':_0x1b8a2b['paused'],'waiting':_0x1b8a2b[_0xcfc4('0x53')]};_0x25f42b[_0xcfc4('0x1e')](_0xcae1b2);}}_0xa1c5f2({'count':_0x25f42b[_0xcfc4('0x14')],'rows':_0x25f42b});});},'WhatsappQueues':function(_0x250789){return new Promise(function(_0x252594,_0x4b6358){var _0x40edea=[];for(var _0x1959e0 in _0x57fffb[_0xcfc4('0x58')]){if(_0x57fffb[_0xcfc4('0x58')]['hasOwnProperty'](_0x1959e0)){var _0x24809b=_0x57fffb[_0xcfc4('0x58')][_0x1959e0];var _0x51d4e0={'id':_0x24809b['id'],'available':_0x24809b['available'],'loggedIn':_0x24809b[_0xcfc4('0x50')],'name':_0x24809b[_0xcfc4('0x51')],'paused':_0x24809b[_0xcfc4('0x52')],'waiting':_0x24809b[_0xcfc4('0x53')]};_0x40edea[_0xcfc4('0x1e')](_0x51d4e0);}}_0x252594({'count':_0x40edea[_0xcfc4('0x14')],'rows':_0x40edea});});},'ChatQueuesWaitingInteractions':function(_0x42eaad){return new Promise(function(_0x11259b,_0x1b6438){var _0x3fabc6=_['values'](_0x57fffb[_0xcfc4('0x59')]);_0x11259b({'count':_0x3fabc6[_0xcfc4('0x14')],'rows':_0x3fabc6});});},'MailQueuesWaitingInteractions':function(_0x3c4889){return new Promise(function(_0x1937a1,_0x353bec){var _0x481083=_[_0xcfc4('0x4d')](_0x57fffb[_0xcfc4('0x5a')]);_0x1937a1({'count':_0x481083[_0xcfc4('0x14')],'rows':_0x481083});});},'OpenchannelQueuesWaitingInteractions':function(_0x1373f6){return new Promise(function(_0x4cbb68,_0x1d1ebe){var _0xde585d=_[_0xcfc4('0x4d')](_0x57fffb[_0xcfc4('0x5b')]);_0x4cbb68({'count':_0xde585d[_0xcfc4('0x14')],'rows':_0xde585d});});},'SmsQueuesWaitingInteractions':function(_0x3f3664){return new Promise(function(_0x1f39bc,_0x4d6dfb){var _0x59d996=_[_0xcfc4('0x4d')](_0x57fffb[_0xcfc4('0x5c')]);_0x1f39bc({'count':_0x59d996[_0xcfc4('0x14')],'rows':_0x59d996});});},'FaxQueuesWaitingInteractions':function(_0x4d86a8){return new Promise(function(_0x157b3b,_0x1dc62f){var _0x1d7ed4=_[_0xcfc4('0x4d')](_0x57fffb['faxQueuesWaitingInteractions']);_0x157b3b({'count':_0x1d7ed4[_0xcfc4('0x14')],'rows':_0x1d7ed4});});},'WhatsappQueuesWaitingInteractions':function(_0x24b1bd){return new Promise(function(_0x27199a,_0x40ce03){var _0x2d6065=_[_0xcfc4('0x4d')](_0x57fffb[_0xcfc4('0x5d')]);_0x27199a({'count':_0x2d6065[_0xcfc4('0x14')],'rows':_0x2d6065});});}};var _0x71653f=jayson[_0xcfc4('0x5e')](_0x407cd6)['http']();_0x71653f['on']('error',function(_0x232afe){logger['error'](JSON[_0xcfc4('0x36')](_0x232afe));return _0x588dd1(_0x232afe);});_0x71653f[_0xcfc4('0x5f')](0x232c,'127.0.0.1',function(){console[_0xcfc4('0x60')](_0xcfc4('0x61'),0x232c);return _0x40029f(_0xcfc4('0x62')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index ef56c62..4a2a506 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 _0x80e1=['info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','iftime\x20%s','then','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','when','log','join','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','http','request','error','message','result','condition','rules'];(function(_0xc0cedc,_0x5e7206){var _0x10b523=function(_0x189682){while(--_0x189682){_0xc0cedc['push'](_0xc0cedc['shift']());}};_0x10b523(++_0x5e7206);}(_0x80e1,0x149));var _0x180e=function(_0x52d7e0,_0x10986f){_0x52d7e0=_0x52d7e0-0x0;var _0x1275e2=_0x80e1[_0x52d7e0];return _0x1275e2;};'use strict';var util=require(_0x180e('0x0'));var BPromise=require(_0x180e('0x1'));var jayson=require(_0x180e('0x2'));var _=require(_0x180e('0x3'));var logger=require(_0x180e('0x4'))('routing');var client=jayson['client'][_0x180e('0x5')]({'port':0x232a});function request(_0xd026f6,_0x4f03c8){return new BPromise(function(_0x34bc34,_0x33f926){return client[_0x180e('0x6')](_0xd026f6,_0x4f03c8)['then'](function(_0x88adf){if(_0x88adf[_0x180e('0x7')]){return _0x33f926(_0x88adf[_0x180e('0x7')][_0x180e('0x8')]);}else{return _0x34bc34(_0x88adf[_0x180e('0x9')]);}})['catch'](function(_0x293bd0){return _0x33f926(_0x293bd0);});});}exports[_0x180e('0xa')]=function(_0x83341b,_0x482659,_0x3bf371){return function(_0x31d6f5){if(_0x3bf371[_0x180e('0xb')]&&!_0x3bf371[_0x180e('0xb')][_0x83341b]){logger[_0x180e('0xc')](_0x180e('0xd'),_0x83341b);return _0x31d6f5[_0x180e('0xe')]();}var _0x503779=[];for(var _0x22cc83=0x0;_0x22cc83<_0x482659[_0x180e('0xf')];_0x22cc83+=0x1){_0x503779[_0x180e('0x10')](request('Command',{'command':util['format'](_0x180e('0x11'),_0x482659[_0x22cc83])})[_0x180e('0x12')](function(_0x543447){return _0x543447&&_0x543447[_0x180e('0x8')]&&_0x543447[_0x180e('0x8')][_0x180e('0x13')](_0x180e('0x14'))>=0x0?!![]:![];})[_0x180e('0x15')](function(_0x34a02c){logger['error'](_0x180e('0x16'),_0x83341b,_0x482659[_0x22cc83]);}));}BPromise[_0x180e('0x17')](_0x503779)[_0x180e('0x12')](function(_0xc82d52){var _0xa9d694=_[_0x180e('0x18')](_0xc82d52);logger[_0x180e('0xc')](_0x180e('0x19'),_0x83341b,_0x482659['join']('\x20|\x20'),_0xa9d694);_0x31d6f5[_0x180e('0x1a')](_0xa9d694);})['catch'](function(_0x170d12){console[_0x180e('0x1b')](_0x170d12);logger[_0x180e('0x7')](_0x180e('0x19'),_0x83341b,_0x482659[_0x180e('0x1c')](_0x180e('0x1d')),_0x170d12[_0x180e('0x1e')]);_0x31d6f5['stop']();});};}; \ No newline at end of file +var _0x61bc=['routing','client','http','then','error','message','result','catch','condition','rules','info','stop','length','Command','format','iftime\x20%s','indexOf','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','lodash'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0x61bc,0x1d9));var _0xc61b=function(_0x28f1ee,_0x130e0d){_0x28f1ee=_0x28f1ee-0x0;var _0x3a0a79=_0x61bc[_0x28f1ee];return _0x3a0a79;};'use strict';var util=require(_0xc61b('0x0'));var BPromise=require(_0xc61b('0x1'));var jayson=require('jayson/promise');var _=require(_0xc61b('0x2'));var logger=require('../../../config/logger')(_0xc61b('0x3'));var client=jayson[_0xc61b('0x4')][_0xc61b('0x5')]({'port':0x232a});function request(_0x527195,_0x1be28a){return new BPromise(function(_0x169eb8,_0x2c3d37){return client['request'](_0x527195,_0x1be28a)[_0xc61b('0x6')](function(_0x5b269e){if(_0x5b269e[_0xc61b('0x7')]){return _0x2c3d37(_0x5b269e[_0xc61b('0x7')][_0xc61b('0x8')]);}else{return _0x169eb8(_0x5b269e[_0xc61b('0x9')]);}})[_0xc61b('0xa')](function(_0x34dd68){return _0x2c3d37(_0x34dd68);});});}exports[_0xc61b('0xb')]=function(_0x383b12,_0x15d406,_0x212bf4){return function(_0x2eb140){if(_0x212bf4['rules']&&!_0x212bf4[_0xc61b('0xc')][_0x383b12]){logger[_0xc61b('0xd')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x383b12);return _0x2eb140[_0xc61b('0xe')]();}var _0x40f424=[];for(var _0x4eebe1=0x0;_0x4eebe1<_0x15d406[_0xc61b('0xf')];_0x4eebe1+=0x1){_0x40f424['push'](request(_0xc61b('0x10'),{'command':util[_0xc61b('0x11')](_0xc61b('0x12'),_0x15d406[_0x4eebe1])})[_0xc61b('0x6')](function(_0x1ce5ab){return _0x1ce5ab&&_0x1ce5ab[_0xc61b('0x8')]&&_0x1ce5ab[_0xc61b('0x8')][_0xc61b('0x13')]('true')>=0x0?!![]:![];})[_0xc61b('0xa')](function(_0x1ee4eb){logger['error']('[%s][INTERVAL]\x20%s',_0x383b12,_0x15d406[_0x4eebe1]);}));}BPromise[_0xc61b('0x14')](_0x40f424)[_0xc61b('0x6')](function(_0x19fe04){var _0x21ce64=_[_0xc61b('0x15')](_0x19fe04);logger[_0xc61b('0xd')](_0xc61b('0x16'),_0x383b12,_0x15d406[_0xc61b('0x17')](_0xc61b('0x18')),_0x21ce64);_0x2eb140[_0xc61b('0x19')](_0x21ce64);})[_0xc61b('0xa')](function(_0x546a39){console[_0xc61b('0x1a')](_0x546a39);logger[_0xc61b('0x7')](_0xc61b('0x16'),_0x383b12,_0x15d406[_0xc61b('0x17')](_0xc61b('0x18')),_0x546a39[_0xc61b('0x1b')]);_0x2eb140[_0xc61b('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 87ac6e1..622bb50 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 _0x0713=['cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','./utils','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','destuniqueid','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','forIn','includes','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','[%s][agents][agentcomplete]','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]'];(function(_0x1e3ac3,_0x21a0b9){var _0x37b1be=function(_0x35fb7b){while(--_0x35fb7b){_0x1e3ac3['push'](_0x1e3ac3['shift']());}};_0x37b1be(++_0x21a0b9);}(_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 utils=require(_0x3071('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2afa91,_0x27405a){utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2afa91[_0x3071('0x3')],_0x2afa91[_0x3071('0x4')],_0x2afa91[_0x3071('0x5')],_0x2afa91[_0x3071('0x6')],_0x2afa91[_0x3071('0x7')],_0x2afa91[_0x3071('0x8')],_0x2afa91[_0x3071('0x9')],_0x2afa91[_0x3071('0xa')]));if(_0x2afa91[_0x3071('0x5')]){utils[_0x3071('0xb')](_0x2afa91[_0x3071('0x5')])[_0x3071('0xc')](function(_0x1a868e){if(_0x1a868e){_0x2afa91['type']=_0x1a868e[_0x3071('0xd')];_0x2afa91[_0x3071('0xe')]=_0x2afa91[_0x3071('0xf')]?_0x1a868e[_0x3071('0x10')]:![];_0x2afa91[_0x3071('0x11')]=_0x2afa91['agentacw']?_0x1a868e[_0x3071('0x12')]:0x0;}utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);});}else{utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);}if(_0x27405a){delete transfers[_0x2afa91['uniqueid']];}else{delete agents[_0x2afa91['destuniqueid']];}}exports[_0x3071('0x15')]=function(_0x5dc13b){try{utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][agentcalled]',_0x5dc13b[_0x3071('0x3')]),_0x5dc13b);agents[_0x5dc13b['destuniqueid']]=_0x5dc13b;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x18')]=utils[_0x3071('0x19')]();agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x1a');agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x9')]=null;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x1b')]=null;utils['info'](util[_0x3071('0x2')](_0x3071('0x1c'),_0x5dc13b[_0x3071('0x3')],agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x6')],_0x5dc13b[_0x3071('0x17')]));}catch(_0x105bbb){utils[_0x3071('0x1d')](util['format'](_0x3071('0x1e'),_0x5dc13b[_0x3071('0x3')]),_0x105bbb);}};exports[_0x3071('0x1f')]=function(_0x56c267){try{if(!_[_0x3071('0x20')](agents[_0x56c267['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x56c267);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x22'),_0x56c267[_0x3071('0x3')],agents[_0x56c267['destuniqueid']]['membername'],_0x56c267[_0x3071('0x17')]));agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x1f')]=!![];agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x23')]=utils[_0x3071('0x19')]();agents[_0x56c267[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x24');agents[_0x56c267['destuniqueid']][_0x3071('0x25')]=_0x3071('0x24');agents[_0x56c267[_0x3071('0x17')]]['holdtime']=_0x56c267[_0x3071('0x26')]?parseInt(_0x56c267[_0x3071('0x26')])/0x3e8:0x0;agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x27')]=0x0;unanswered[_0x3071('0x28')](_0x56c267[_0x3071('0x17')]);}}catch(_0x177b5f){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x177b5f);}};exports['queuecallerabandon']=function(_0x4f1484){try{_[_0x3071('0x29')](agents,function(_0x149e0d,_0x6ddf96){if(_0x149e0d[_0x3071('0x3')]==_0x4f1484[_0x3071('0x3')]&&!_[_0x3071('0x2a')](unanswered,_0x149e0d[_0x3071('0x17')])){utils[_0x3071('0x16')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484['uniqueid']),_0x4f1484);utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x4f1484[_0x3071('0x3')],_0x149e0d[_0x3071('0x6')],_0x149e0d[_0x3071('0x17')]));_0x149e0d[_0x3071('0x1f')]=!![];_0x149e0d['agentringnoanswerAt']=utils[_0x3071('0x19')]();_0x149e0d[_0x3071('0xa')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x25')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x2c')]=_0x4f1484[_0x3071('0x2c')];_0x149e0d[_0x3071('0x27')]=0x0;writeDB(_0x149e0d);}});}catch(_0x596cc3){utils[_0x3071('0x1d')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484[_0x3071('0x3')]),_0x596cc3);}};exports[_0x3071('0x2d')]=function(_0x54d9c3){try{if(agents[_0x54d9c3[_0x3071('0x17')]]){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x54d9c3);utils[_0x3071('0x1')](util['format'](_0x3071('0x2f'),_0x54d9c3[_0x3071('0x3')],agents[_0x54d9c3['destuniqueid']][_0x3071('0x6')],_0x54d9c3['destuniqueid']));agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0x30')]=utils['now']();agents[_0x54d9c3['destuniqueid']][_0x3071('0x9')]=_0x54d9c3[_0x3071('0x9')];agents[_0x54d9c3[_0x3071('0x17')]]['connectedlinename']=_0x54d9c3[_0x3071('0x1b')];agents[_0x54d9c3['destuniqueid']][_0x3071('0x2c')]=_0x54d9c3['ringtime'];agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x31');_[_0x3071('0x29')](agents,function(_0x30ab68,_0x593c9c){if(_0x30ab68['destuniqueid']!=_0x54d9c3[_0x3071('0x17')]&&_0x30ab68[_0x3071('0x3')]==_0x54d9c3[_0x3071('0x3')]){_0x30ab68[_0x3071('0x27')]=0x0;_0x30ab68['holdtime']=_0x54d9c3[_0x3071('0x26')];_0x30ab68[_0x3071('0x1f')]=!![];_0x30ab68[_0x3071('0x23')]=utils[_0x3071('0x19')]();_0x30ab68[_0x3071('0xa')]=_0x3071('0x32');_0x30ab68['reason']=_0x3071('0x32');_0x30ab68['answeredelsewheredestinationuniqueid']=_0x54d9c3['destuniqueid'];_0x30ab68['answeredelsewheremembername']=_0x54d9c3['membername'];writeDB(_0x30ab68);}});}}catch(_0x2992e6){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x2992e6);}};exports[_0x3071('0xf')]=function(_0xa711b5){try{if(!_[_0x3071('0x20')](agents[_0xa711b5['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x33'),_0xa711b5[_0x3071('0x3')]),_0xa711b5);utils[_0x3071('0x1')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xa711b5[_0x3071('0x3')],agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x6')],_0xa711b5[_0x3071('0x17')]));agents[_0xa711b5[_0x3071('0x17')]]['agentcomplete']=!![];agents[_0xa711b5[_0x3071('0x17')]]['agentcompleteAt']=utils[_0x3071('0x19')]();agents[_0xa711b5['destuniqueid']]['talktime']=utils[_0x3071('0x34')](agents[_0xa711b5['destuniqueid']][_0x3071('0x35')],agents[_0xa711b5['destuniqueid']][_0x3071('0x30')]);agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x25')]=_0xa711b5[_0x3071('0x25')];agents[_0xa711b5['destuniqueid']][_0x3071('0xa')]='complete';writeDB(agents[_0xa711b5[_0x3071('0x17')]]);}}catch(_0x4b6bbb){utils[_0x3071('0x1d')](util[_0x3071('0x2')]('[%s][agents][agentcomplete]',_0xa711b5[_0x3071('0x3')]),_0x4b6bbb);}};exports[_0x3071('0x36')]=function(_0x224a70){try{if(!_[_0x3071('0x20')](agents[_0x224a70[_0x3071('0x37')]])){utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x224a70);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x38'),_0x224a70['uniqueid'],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x6')],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')]));agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x39')]=!![];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3a')]=_0x3071('0x3b');agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3c')]=_0x224a70[_0x3071('0x3d')];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3e')]=agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')];}}catch(_0x596cdd){utils['error'](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x596cdd);}};exports[_0x3071('0x3f')]=function(_0x15c6f8){try{utils['debug'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x15c6f8);if(_0x15c6f8['origtransfereruniqueid']==_0x15c6f8[_0x3071('0x41')]){if(!_[_0x3071('0x20')](agents[_0x15c6f8[_0x3071('0x42')]])){utils[_0x3071('0x1')](util['format'](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x42')]]['transfer']=!![];agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3a')]=_0x3071('0x45');agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x46')];agents[_0x15c6f8[_0x3071('0x42')]]['transferuniqueid']=_0x15c6f8['origtransfereruniqueid'];}if(_0x15c6f8[_0x3071('0x47')]&&agents[_0x15c6f8['transfereeuniqueid']]){agents[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x1;transfers[_0x15c6f8['transfereeuniqueid']]=_[_0x3071('0x49')](agents[_0x15c6f8[_0x3071('0x47')]]);transfers[_0x15c6f8['transfereeuniqueid']][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x8')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x4a')]=agents[_0x15c6f8['secondtransfereruniqueid']][_0x3071('0x4a')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x18')]=utils['now']();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x2;}}else if(_0x15c6f8[_0x3071('0x42')]==_0x15c6f8[_0x3071('0x4b')]){if(!_['isNil'](agents[_0x15c6f8[_0x3071('0x44')]])){utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x39')]=!![];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3a')]='ATTENDED';agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x4c')];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3e')]=_0x15c6f8[_0x3071('0x42')];}if(_0x15c6f8[_0x3071('0x4d')]&&agents[_0x15c6f8[_0x3071('0x4d')]]){agents[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x48')]=0x1;transfers[_0x15c6f8[_0x3071('0x4d')]]=_['clone'](agents[_0x15c6f8['transfertargetuniqueid']]);transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x8')];transfers[_0x15c6f8['transfertargetuniqueid']]['calleridname']=agents[_0x15c6f8[_0x3071('0x44')]]['calleridname'];transfers[_0x15c6f8['transfertargetuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x48')]=0x2;}}}catch(_0x19a03d){utils['error'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x19a03d);}};exports[_0x3071('0x4e')]=function(_0x29ee70){try{utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70[_0x3071('0x3')]),_0x29ee70);if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']]['reason']===_0x3071('0x24')){if(_0x29ee70[_0x3071('0x50')]==='21'){agents[_0x29ee70[_0x3071('0x3')]]['reason']='rejected';agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x51');}utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]]['membername'],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);var _0x2fbac7=unanswered[_0x3071('0x53')](_0x29ee70[_0x3071('0x3')]);if(_0x2fbac7>-0x1){unanswered[_0x3071('0x54')](_0x2fbac7,0x1);}}if(transfers[_0x29ee70[_0x3071('0x3')]]){transfers[_0x29ee70['uniqueid']][_0x3071('0xf')]=!![];transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils['now']();transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](transfers[_0x29ee70['uniqueid']]['agentcompleteAt'],transfers[_0x29ee70[_0x3071('0x3')]]['agentconnectAt']);transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')]=_0x3071('0x55');transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x56');utils[_0x3071('0x1')](util['format'](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(transfers[_0x29ee70['uniqueid']],!![]);}if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']][_0x3071('0x30')]){agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xf')]=!![];agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils[_0x3071('0x19')]();agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](agents[_0x29ee70[_0x3071('0x3')]]['agentcompleteAt'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x30')]);agents[_0x29ee70['uniqueid']][_0x3071('0x25')]=agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x39')]?_0x3071('0x39'):_0x3071('0x55');agents[_0x29ee70['uniqueid']]['lastevent']=_0x3071('0x56');utils['info'](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);}}catch(_0x291bb9){utils['error'](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70['uniqueid']),_0x291bb9);}}; \ No newline at end of file +var _0x153f=['type','agentacw','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','includes','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferuniqueid','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agentcompleteAt','agent','lodash','util','./utils','info','format','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x153f,0x15b));var _0xf153=function(_0x12c6cf,_0x2c57ed){_0x12c6cf=_0x12c6cf-0x0;var _0x92a4d7=_0x153f[_0x12c6cf];return _0x92a4d7;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var utils=require(_0xf153('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x44cea3,_0x2afb9a){utils[_0xf153('0x3')](util[_0xf153('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x44cea3[_0xf153('0x5')],_0x44cea3['channel'],_0x44cea3[_0xf153('0x6')],_0x44cea3[_0xf153('0x7')],_0x44cea3[_0xf153('0x8')],_0x44cea3[_0xf153('0x9')],_0x44cea3[_0xf153('0xa')],_0x44cea3['lastevent']));if(_0x44cea3[_0xf153('0x6')]){utils[_0xf153('0xb')](_0x44cea3[_0xf153('0x6')])[_0xf153('0xc')](function(_0x253fd3){if(_0x253fd3){_0x44cea3[_0xf153('0xd')]=_0x253fd3[_0xf153('0xd')];_0x44cea3[_0xf153('0xe')]=_0x44cea3[_0xf153('0xf')]?_0x253fd3[_0xf153('0x10')]:![];_0x44cea3['acwtime']=_0x44cea3[_0xf153('0xe')]?_0x253fd3[_0xf153('0x11')]:0x0;}utils[_0xf153('0x12')]('CreateVoiceAgentReport',_0x44cea3);});}else{utils[_0xf153('0x12')](_0xf153('0x13'),_0x44cea3);}if(_0x2afb9a){delete transfers[_0x44cea3[_0xf153('0x5')]];}else{delete agents[_0x44cea3[_0xf153('0x14')]];}}exports[_0xf153('0x15')]=function(_0x107d31){try{utils[_0xf153('0x16')](util[_0xf153('0x4')](_0xf153('0x17'),_0x107d31['uniqueid']),_0x107d31);agents[_0x107d31[_0xf153('0x14')]]=_0x107d31;agents[_0x107d31[_0xf153('0x14')]][_0xf153('0x18')]=utils[_0xf153('0x19')]();agents[_0x107d31[_0xf153('0x14')]][_0xf153('0x1a')]=_0xf153('0x1b');agents[_0x107d31[_0xf153('0x14')]]['connectedlinenum']=null;agents[_0x107d31[_0xf153('0x14')]]['connectedlinename']=null;utils[_0xf153('0x3')](util[_0xf153('0x4')](_0xf153('0x1c'),_0x107d31[_0xf153('0x5')],agents[_0x107d31['destuniqueid']][_0xf153('0x7')],_0x107d31[_0xf153('0x14')]));}catch(_0x41946a){utils[_0xf153('0x1d')](util[_0xf153('0x4')](_0xf153('0x17'),_0x107d31[_0xf153('0x5')]),_0x41946a);}};exports[_0xf153('0x1e')]=function(_0x3735a7){try{if(!_[_0xf153('0x1f')](agents[_0x3735a7[_0xf153('0x14')]])){utils[_0xf153('0x16')](util['format'](_0xf153('0x20'),_0x3735a7[_0xf153('0x5')]),_0x3735a7);utils[_0xf153('0x3')](util[_0xf153('0x4')](_0xf153('0x21'),_0x3735a7[_0xf153('0x5')],agents[_0x3735a7[_0xf153('0x14')]][_0xf153('0x7')],_0x3735a7[_0xf153('0x14')]));agents[_0x3735a7[_0xf153('0x14')]][_0xf153('0x1e')]=!![];agents[_0x3735a7[_0xf153('0x14')]][_0xf153('0x22')]=utils[_0xf153('0x19')]();agents[_0x3735a7[_0xf153('0x14')]][_0xf153('0x1a')]=_0xf153('0x23');agents[_0x3735a7[_0xf153('0x14')]][_0xf153('0x24')]=_0xf153('0x23');agents[_0x3735a7['destuniqueid']][_0xf153('0x25')]=_0x3735a7[_0xf153('0x26')]?parseInt(_0x3735a7['ringtime'])/0x3e8:0x0;agents[_0x3735a7[_0xf153('0x14')]][_0xf153('0x27')]=0x0;unanswered['push'](_0x3735a7[_0xf153('0x14')]);}}catch(_0x10295e){utils[_0xf153('0x1d')](util[_0xf153('0x4')](_0xf153('0x20'),_0x3735a7[_0xf153('0x5')]),_0x10295e);}};exports[_0xf153('0x28')]=function(_0x3b5f4f){try{_[_0xf153('0x29')](agents,function(_0x8e31bf,_0x13b541){if(_0x8e31bf[_0xf153('0x5')]==_0x3b5f4f['uniqueid']&&!_[_0xf153('0x2a')](unanswered,_0x8e31bf[_0xf153('0x14')])){utils[_0xf153('0x16')](util[_0xf153('0x4')]('[%s][agents][queuecallerabandon]',_0x3b5f4f['uniqueid']),_0x3b5f4f);utils[_0xf153('0x3')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x3b5f4f[_0xf153('0x5')],_0x8e31bf['membername'],_0x8e31bf[_0xf153('0x14')]));_0x8e31bf['agentringnoanswer']=!![];_0x8e31bf[_0xf153('0x22')]=utils[_0xf153('0x19')]();_0x8e31bf['lastevent']=_0xf153('0x2b');_0x8e31bf[_0xf153('0x24')]=_0xf153('0x2b');_0x8e31bf[_0xf153('0x25')]=_0x3b5f4f[_0xf153('0x25')];_0x8e31bf[_0xf153('0x27')]=0x0;writeDB(_0x8e31bf);}});}catch(_0x4ab69c){utils[_0xf153('0x1d')](util['format'](_0xf153('0x2c'),_0x3b5f4f[_0xf153('0x5')]),_0x4ab69c);}};exports[_0xf153('0x2d')]=function(_0x1820c3){try{if(agents[_0x1820c3[_0xf153('0x14')]]){utils[_0xf153('0x16')](util['format'](_0xf153('0x2e'),_0x1820c3[_0xf153('0x5')]),_0x1820c3);utils[_0xf153('0x3')](util['format'](_0xf153('0x2f'),_0x1820c3[_0xf153('0x5')],agents[_0x1820c3[_0xf153('0x14')]][_0xf153('0x7')],_0x1820c3[_0xf153('0x14')]));agents[_0x1820c3[_0xf153('0x14')]]['agentconnectAt']=utils[_0xf153('0x19')]();agents[_0x1820c3[_0xf153('0x14')]]['connectedlinenum']=_0x1820c3[_0xf153('0xa')];agents[_0x1820c3[_0xf153('0x14')]][_0xf153('0x30')]=_0x1820c3[_0xf153('0x30')];agents[_0x1820c3[_0xf153('0x14')]][_0xf153('0x25')]=_0x1820c3[_0xf153('0x26')];agents[_0x1820c3['destuniqueid']][_0xf153('0x1a')]=_0xf153('0x31');_[_0xf153('0x29')](agents,function(_0x352e7c,_0x25657a){if(_0x352e7c[_0xf153('0x14')]!=_0x1820c3['destuniqueid']&&_0x352e7c['uniqueid']==_0x1820c3[_0xf153('0x5')]){_0x352e7c['talktime']=0x0;_0x352e7c[_0xf153('0x25')]=_0x1820c3[_0xf153('0x26')];_0x352e7c[_0xf153('0x1e')]=!![];_0x352e7c[_0xf153('0x22')]=utils[_0xf153('0x19')]();_0x352e7c[_0xf153('0x1a')]='answered_elsewhere';_0x352e7c['reason']=_0xf153('0x32');_0x352e7c[_0xf153('0x33')]=_0x1820c3['destuniqueid'];_0x352e7c[_0xf153('0x34')]=_0x1820c3[_0xf153('0x7')];writeDB(_0x352e7c);}});}}catch(_0x1edf65){utils[_0xf153('0x1d')](util[_0xf153('0x4')](_0xf153('0x2e'),_0x1820c3[_0xf153('0x5')]),_0x1edf65);}};exports[_0xf153('0xf')]=function(_0x1b453f){try{if(!_[_0xf153('0x1f')](agents[_0x1b453f[_0xf153('0x14')]])){utils[_0xf153('0x16')](util['format'](_0xf153('0x35'),_0x1b453f[_0xf153('0x5')]),_0x1b453f);utils[_0xf153('0x3')](util['format'](_0xf153('0x36'),_0x1b453f[_0xf153('0x5')],agents[_0x1b453f['destuniqueid']][_0xf153('0x7')],_0x1b453f['destuniqueid']));agents[_0x1b453f[_0xf153('0x14')]][_0xf153('0xf')]=!![];agents[_0x1b453f[_0xf153('0x14')]]['agentcompleteAt']=utils[_0xf153('0x19')]();agents[_0x1b453f[_0xf153('0x14')]][_0xf153('0x27')]=utils[_0xf153('0x37')](agents[_0x1b453f[_0xf153('0x14')]]['agentcompleteAt'],agents[_0x1b453f[_0xf153('0x14')]][_0xf153('0x38')]);agents[_0x1b453f['destuniqueid']][_0xf153('0x24')]=_0x1b453f[_0xf153('0x24')];agents[_0x1b453f[_0xf153('0x14')]]['lastevent']=_0xf153('0x39');writeDB(agents[_0x1b453f[_0xf153('0x14')]]);}}catch(_0x82dc34){utils[_0xf153('0x1d')](util[_0xf153('0x4')](_0xf153('0x35'),_0x1b453f[_0xf153('0x5')]),_0x82dc34);}};exports[_0xf153('0x3a')]=function(_0x3b91ed){try{if(!_['isNil'](agents[_0x3b91ed[_0xf153('0x3b')]])){utils['debug'](util['format']('[%s][agents][blindtransfer]',_0x3b91ed[_0xf153('0x5')]),_0x3b91ed);utils[_0xf153('0x3')](util['format'](_0xf153('0x3c'),_0x3b91ed[_0xf153('0x5')],agents[_0x3b91ed['transfereruniqueid']][_0xf153('0x7')],agents[_0x3b91ed[_0xf153('0x3b')]][_0xf153('0x5')]));agents[_0x3b91ed[_0xf153('0x3b')]][_0xf153('0x3d')]=!![];agents[_0x3b91ed[_0xf153('0x3b')]]['transfertype']=_0xf153('0x3e');agents[_0x3b91ed[_0xf153('0x3b')]]['transferexten']=_0x3b91ed['extension'];agents[_0x3b91ed[_0xf153('0x3b')]][_0xf153('0x3f')]=agents[_0x3b91ed[_0xf153('0x3b')]][_0xf153('0x5')];}}catch(_0x419e7e){utils[_0xf153('0x1d')](util['format'](_0xf153('0x40'),_0x3b91ed['uniqueid']),_0x419e7e);}};exports[_0xf153('0x41')]=function(_0x365209){try{utils[_0xf153('0x16')](util['format'](_0xf153('0x42'),_0x365209[_0xf153('0x43')]),_0x365209);if(_0x365209[_0xf153('0x43')]==_0x365209[_0xf153('0x44')]){if(!_[_0xf153('0x1f')](agents[_0x365209[_0xf153('0x45')]])){utils[_0xf153('0x3')](util['format'](_0xf153('0x46'),_0x365209[_0xf153('0x43')],agents[_0x365209[_0xf153('0x45')]]['membername']));agents[_0x365209[_0xf153('0x45')]][_0xf153('0x3d')]=!![];agents[_0x365209[_0xf153('0x45')]][_0xf153('0x47')]=_0xf153('0x48');agents[_0x365209[_0xf153('0x45')]][_0xf153('0x49')]=_0x365209[_0xf153('0x4a')];agents[_0x365209['secondtransfereruniqueid']][_0xf153('0x3f')]=_0x365209[_0xf153('0x43')];}if(_0x365209['transfereeuniqueid']&&agents[_0x365209[_0xf153('0x4b')]]){agents[_0x365209[_0xf153('0x4b')]][_0xf153('0x4c')]=0x1;transfers[_0x365209[_0xf153('0x4b')]]=_[_0xf153('0x4d')](agents[_0x365209[_0xf153('0x4b')]]);transfers[_0x365209[_0xf153('0x4b')]][_0xf153('0x9')]=agents[_0x365209[_0xf153('0x45')]][_0xf153('0x9')];transfers[_0x365209[_0xf153('0x4b')]]['calleridname']=agents[_0x365209[_0xf153('0x45')]][_0xf153('0x4e')];transfers[_0x365209['transfereeuniqueid']][_0xf153('0x18')]=utils[_0xf153('0x19')]();transfers[_0x365209[_0xf153('0x4b')]][_0xf153('0x38')]=utils[_0xf153('0x19')]();transfers[_0x365209[_0xf153('0x4b')]][_0xf153('0x25')]=0x0;transfers[_0x365209['transfereeuniqueid']][_0xf153('0x4c')]=0x2;}}else if(_0x365209[_0xf153('0x45')]==_0x365209[_0xf153('0x4f')]){if(!_[_0xf153('0x1f')](agents[_0x365209[_0xf153('0x43')]])){utils[_0xf153('0x3')](util[_0xf153('0x4')](_0xf153('0x46'),_0x365209[_0xf153('0x43')],agents[_0x365209['origtransfereruniqueid']][_0xf153('0x7')]));agents[_0x365209[_0xf153('0x43')]]['transfer']=!![];agents[_0x365209[_0xf153('0x43')]]['transfertype']=_0xf153('0x48');agents[_0x365209[_0xf153('0x43')]]['transferexten']=_0x365209[_0xf153('0x50')];agents[_0x365209['origtransfereruniqueid']][_0xf153('0x3f')]=_0x365209[_0xf153('0x45')];}if(_0x365209[_0xf153('0x51')]&&agents[_0x365209[_0xf153('0x51')]]){agents[_0x365209['transfertargetuniqueid']][_0xf153('0x4c')]=0x1;transfers[_0x365209[_0xf153('0x51')]]=_['clone'](agents[_0x365209[_0xf153('0x51')]]);transfers[_0x365209[_0xf153('0x51')]][_0xf153('0x9')]=agents[_0x365209[_0xf153('0x43')]][_0xf153('0x9')];transfers[_0x365209['transfertargetuniqueid']][_0xf153('0x4e')]=agents[_0x365209['origtransfereruniqueid']][_0xf153('0x4e')];transfers[_0x365209[_0xf153('0x51')]]['agentcalledAt']=utils['now']();transfers[_0x365209[_0xf153('0x51')]][_0xf153('0x38')]=utils['now']();transfers[_0x365209[_0xf153('0x51')]][_0xf153('0x25')]=0x0;transfers[_0x365209[_0xf153('0x51')]]['agententerreason']=0x2;}}}catch(_0x671efe){utils[_0xf153('0x1d')](util[_0xf153('0x4')](_0xf153('0x42'),_0x365209[_0xf153('0x43')]),_0x671efe);}};exports[_0xf153('0x52')]=function(_0x37443f){try{utils[_0xf153('0x16')](util[_0xf153('0x4')](_0xf153('0x53'),_0x37443f[_0xf153('0x5')]),_0x37443f);if(agents[_0x37443f[_0xf153('0x5')]]&&agents[_0x37443f[_0xf153('0x5')]][_0xf153('0x24')]===_0xf153('0x23')){if(_0x37443f[_0xf153('0x54')]==='21'){agents[_0x37443f['uniqueid']][_0xf153('0x24')]='rejected';agents[_0x37443f['uniqueid']][_0xf153('0x1a')]='rejected';}utils[_0xf153('0x3')](util[_0xf153('0x4')](_0xf153('0x55'),_0x37443f[_0xf153('0x5')],agents[_0x37443f[_0xf153('0x5')]][_0xf153('0x7')],agents[_0x37443f['uniqueid']][_0xf153('0x24')],agents[_0x37443f[_0xf153('0x5')]][_0xf153('0x1a')]));writeDB(agents[_0x37443f['uniqueid']]);var _0x59e22d=unanswered[_0xf153('0x56')](_0x37443f[_0xf153('0x5')]);if(_0x59e22d>-0x1){unanswered[_0xf153('0x57')](_0x59e22d,0x1);}}if(transfers[_0x37443f['uniqueid']]){transfers[_0x37443f[_0xf153('0x5')]]['agentcomplete']=!![];transfers[_0x37443f['uniqueid']][_0xf153('0x58')]=utils[_0xf153('0x19')]();transfers[_0x37443f[_0xf153('0x5')]]['talktime']=utils[_0xf153('0x37')](transfers[_0x37443f[_0xf153('0x5')]]['agentcompleteAt'],transfers[_0x37443f[_0xf153('0x5')]][_0xf153('0x38')]);transfers[_0x37443f[_0xf153('0x5')]][_0xf153('0x24')]=_0xf153('0x59');transfers[_0x37443f['uniqueid']][_0xf153('0x1a')]=_0xf153('0x39');utils[_0xf153('0x3')](util[_0xf153('0x4')](_0xf153('0x55'),_0x37443f[_0xf153('0x5')],transfers[_0x37443f[_0xf153('0x5')]]['membername'],transfers[_0x37443f[_0xf153('0x5')]][_0xf153('0x24')],transfers[_0x37443f[_0xf153('0x5')]][_0xf153('0x1a')]));writeDB(transfers[_0x37443f[_0xf153('0x5')]],!![]);}if(agents[_0x37443f[_0xf153('0x5')]]&&agents[_0x37443f['uniqueid']][_0xf153('0x38')]){agents[_0x37443f[_0xf153('0x5')]][_0xf153('0xf')]=!![];agents[_0x37443f[_0xf153('0x5')]][_0xf153('0x58')]=utils[_0xf153('0x19')]();agents[_0x37443f[_0xf153('0x5')]][_0xf153('0x27')]=utils[_0xf153('0x37')](agents[_0x37443f[_0xf153('0x5')]]['agentcompleteAt'],agents[_0x37443f['uniqueid']]['agentconnectAt']);agents[_0x37443f['uniqueid']][_0xf153('0x24')]=agents[_0x37443f[_0xf153('0x5')]][_0xf153('0x3d')]?_0xf153('0x3d'):_0xf153('0x59');agents[_0x37443f['uniqueid']][_0xf153('0x1a')]=_0xf153('0x39');utils[_0xf153('0x3')](util[_0xf153('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x37443f[_0xf153('0x5')],agents[_0x37443f[_0xf153('0x5')]][_0xf153('0x7')],agents[_0x37443f['uniqueid']][_0xf153('0x24')],agents[_0x37443f['uniqueid']][_0xf153('0x1a')]));writeDB(agents[_0x37443f[_0xf153('0x5')]]);}}catch(_0x2651ff){utils['error'](util['format']('[%s][agents][hangup]',_0x37443f[_0xf153('0x5')]),_0x2651ff);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 911ab37..a8a1760 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 _0x4baf=['error','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr','appdata','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','now','DOCUMENTATION','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','context','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber'];(function(_0xf34eaa,_0x257051){var _0x4a7677=function(_0x30391d){while(--_0x30391d){_0xf34eaa['push'](_0xf34eaa['shift']());}};_0x4a7677(++_0x257051);}(_0x4baf,0xb4));var _0xf4ba=function(_0x2ed825,_0x120124){_0x2ed825=_0x2ed825-0x0;var _0x224045=_0x4baf[_0x2ed825];return _0x224045;};'use strict';var _=require(_0xf4ba('0x0'));var util=require('util');var utils=require(_0xf4ba('0x1'));var transfers=require(_0xf4ba('0x2'));var dispositions=[_0xf4ba('0x3'),_0xf4ba('0x4'),_0xf4ba('0x4'),_0xf4ba('0x3'),_0xf4ba('0x3'),_0xf4ba('0x3'),_0xf4ba('0x5'),'BUSY',_0xf4ba('0x4'),'FAILED',_0xf4ba('0x4')];var channels={};function writeDB(_0x35a4e7){var _0x5732a5;if(transfers[_0xf4ba('0x6')][_0x35a4e7[_0xf4ba('0x7')]]){_0x5732a5=_0x35a4e7[_0xf4ba('0x7')];_0x35a4e7[_0xf4ba('0x7')]=transfers[_0xf4ba('0x6')][_0x35a4e7['uniqueid']]['transfereeuniqueid'];}utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0xa'),_0x35a4e7['uniqueid'],_0x35a4e7[_0xf4ba('0xb')],_0x35a4e7[_0xf4ba('0xc')],_0x35a4e7[_0xf4ba('0xd')],_0x35a4e7['interface'],_0x35a4e7[_0xf4ba('0xe')],_0x35a4e7[_0xf4ba('0xf')],_0x35a4e7[_0xf4ba('0x10')]));if(_0x35a4e7[_0xf4ba('0x11')]){utils[_0xf4ba('0x12')](_0x35a4e7[_0xf4ba('0x11')])[_0xf4ba('0x13')](function(_0x466d63){if(_0x466d63){_0x35a4e7[_0xf4ba('0x14')]=_0x466d63['id'];}utils['request'](_0xf4ba('0x15'),_0x35a4e7);});}else{utils['request'](_0xf4ba('0x15'),_0x35a4e7);}if(channels[_0x35a4e7[_0xf4ba('0x7')]]){delete channels[_0x35a4e7['uniqueid']];}else if(_0x5732a5&&channels[_0x5732a5]){if(!transfers['blinds'][_0x5732a5][_0xf4ba('0x16')])delete transfers[_0xf4ba('0x6')][_0x5732a5];delete channels[_0x5732a5];}}exports[_0xf4ba('0x17')]=function(_0x314cf5){try{utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x19'),_0x314cf5['uniqueid']),_0x314cf5);if(_0x314cf5[_0xf4ba('0x7')]==_0x314cf5[_0xf4ba('0x1a')]&&_0x314cf5[_0xf4ba('0xb')]!='OutgoingSpoolFailed'){utils['info'](util[_0xf4ba('0x9')](_0xf4ba('0x1b'),_0x314cf5[_0xf4ba('0x7')],_0x314cf5['context'],_0x314cf5[_0xf4ba('0x1c')]));channels[_0x314cf5[_0xf4ba('0x7')]]={'uniqueid':_0x314cf5[_0xf4ba('0x7')],'accountcode':_0x314cf5[_0xf4ba('0x11')],'source':_0x314cf5[_0xf4ba('0xe')],'destination':_0x314cf5['exten'],'destinationcontext':_0x314cf5['context'],'channel':_0x314cf5[_0xf4ba('0xb')],'starttime':utils[_0xf4ba('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xf4ba('0x1e')};}}catch(_0x212dc5){utils['error'](util['format'](_0xf4ba('0x19'),_0x314cf5[_0xf4ba('0x7')]),_0x212dc5);}};exports['newstate']=function(_0x3b71e4){try{utils['debug'](util[_0xf4ba('0x9')](_0xf4ba('0x1f'),_0x3b71e4['uniqueid']),_0x3b71e4);if(!_[_0xf4ba('0x20')](channels[_0x3b71e4['uniqueid']])&&_0x3b71e4[_0xf4ba('0x21')]==0x6){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x22'),_0x3b71e4[_0xf4ba('0x7')],_0x3b71e4[_0xf4ba('0x23')],_0x3b71e4[_0xf4ba('0xb')]));if(_[_0xf4ba('0x20')](channels[_0x3b71e4['uniqueid']][_0xf4ba('0x24')])){channels[_0x3b71e4[_0xf4ba('0x7')]][_0xf4ba('0x24')]=utils[_0xf4ba('0x1d')]();}}else if(!_[_0xf4ba('0x20')](channels[_0x3b71e4[_0xf4ba('0x1a')]])&&_0x3b71e4['channelstate']==0x6&&_0x3b71e4[_0xf4ba('0x23')]!=_0xf4ba('0x25')){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x26'),_0x3b71e4[_0xf4ba('0x7')],_0x3b71e4[_0xf4ba('0x1a')],_0x3b71e4[_0xf4ba('0x23')],_0x3b71e4[_0xf4ba('0xb')]));channels[_0x3b71e4[_0xf4ba('0x1a')]][_0xf4ba('0x11')]=_0x3b71e4[_0xf4ba('0x11')];channels[_0x3b71e4[_0xf4ba('0x1a')]][_0xf4ba('0x27')]=_0x3b71e4['channel'];if(_[_0xf4ba('0x20')](channels[_0x3b71e4[_0xf4ba('0x1a')]][_0xf4ba('0x28')])){channels[_0x3b71e4[_0xf4ba('0x1a')]][_0xf4ba('0x28')]=utils[_0xf4ba('0x1d')]();}channels[_0x3b71e4[_0xf4ba('0x1a')]]['disposition']=dispositions[_[_0xf4ba('0x29')](_0x3b71e4[_0xf4ba('0x21')])]||_0xf4ba('0x5');}}catch(_0x4b048e){utils[_0xf4ba('0x2a')](util[_0xf4ba('0x9')](_0xf4ba('0x1f'),_0x3b71e4['uniqueid']),_0x4b048e);}};exports[_0xf4ba('0x2b')]=function(_0x2fdba0){try{if(!_[_0xf4ba('0x20')](channels[_0x2fdba0[_0xf4ba('0x7')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x2c'),_0x2fdba0[_0xf4ba('0x7')]),_0x2fdba0);if(_[_0xf4ba('0x20')](channels[_0x2fdba0[_0xf4ba('0x7')]]['callerid'])){channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x2d')]=_0x2fdba0[_0xf4ba('0x2e')]+'\x20<'+_0x2fdba0[_0xf4ba('0xe')]+'>';}utils[_0xf4ba('0x8')](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x2fdba0['uniqueid'],channels[_0x2fdba0[_0xf4ba('0x7')]]['callerid'],_0x2fdba0[_0xf4ba('0x2f')]));channels[_0x2fdba0['uniqueid']][_0xf4ba('0x30')]=utils[_0xf4ba('0x1d')]();channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x31')]=utils[_0xf4ba('0x32')](channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x30')],channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x33')]);channels[_0x2fdba0['uniqueid']][_0xf4ba('0x34')]=channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x28')]?utils['diffTime'](channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x30')],channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x28')]):0x0;writeDB(channels[_0x2fdba0[_0xf4ba('0x7')]]);}}catch(_0x1329fa){utils[_0xf4ba('0x2a')](util[_0xf4ba('0x9')](_0xf4ba('0x2c'),_0x2fdba0['uniqueid']),_0x1329fa);}};exports[_0xf4ba('0x35')]=function(_0x423825){try{if(!_[_0xf4ba('0x20')](channels[_0x423825[_0xf4ba('0x36')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')]('[%s][calls][attendedtransfer]',_0x423825[_0xf4ba('0x37')]),_0x423825);if(channels[_0x423825[_0xf4ba('0x36')]][_0xf4ba('0xb')]==_0x423825[_0xf4ba('0x38')]){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x39'),_0x423825[_0xf4ba('0x37')],_0x423825[_0xf4ba('0x36')],_0x423825[_0xf4ba('0x3a')]));channels[_0x423825[_0xf4ba('0x36')]][_0xf4ba('0x27')]=_0x423825[_0xf4ba('0x3a')];channels[_0x423825[_0xf4ba('0x36')]][_0xf4ba('0x3b')]='_attended';}else if(channels[_0x423825[_0xf4ba('0x36')]][_0xf4ba('0xb')]=_0x423825['transfertargetchannel']){utils['info'](util[_0xf4ba('0x9')](_0xf4ba('0x39'),_0x423825['origtransfereruniqueid'],_0x423825['localtwolinkedid'],_0x423825[_0xf4ba('0x3c')]));channels[_0x423825[_0xf4ba('0x36')]]['destinationchannel']=_0x423825[_0xf4ba('0x3c')];channels[_0x423825['localtwolinkedid']]['userfield']='_attended';}}}catch(_0x212930){utils['error'](util[_0xf4ba('0x9')]('[%s][calls][attendedtransfer]',_0x423825['origtransfereruniqueid']),_0x212930);}};exports[_0xf4ba('0x3d')]=function(_0x358fb4){try{if(!_[_0xf4ba('0x20')](channels[_0x358fb4[_0xf4ba('0x7')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x3e'),_0x358fb4[_0xf4ba('0x7')]),_0x358fb4);channels[_0x358fb4[_0xf4ba('0x7')]][_0xf4ba('0x3f')]=utils[_0xf4ba('0x1d')]();utils['info'](util[_0xf4ba('0x9')](_0xf4ba('0x40'),_0x358fb4[_0xf4ba('0x7')],channels[_0x358fb4['uniqueid']][_0xf4ba('0x3f')]));}}catch(_0xc8583b){utils[_0xf4ba('0x2a')](util['format'](_0xf4ba('0x3e'),_0x358fb4[_0xf4ba('0x7')]),_0xc8583b);}};exports[_0xf4ba('0x41')]=function(_0x445eda){try{if(!_[_0xf4ba('0x20')](channels[_0x445eda[_0xf4ba('0x7')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x42'),_0x445eda['uniqueid']),_0x445eda);if(!_[_0xf4ba('0x20')](channels[_0x445eda['uniqueid']][_0xf4ba('0x3f')])){channels[_0x445eda[_0xf4ba('0x7')]][_0xf4ba('0x43')]+=utils['diffTime'](utils[_0xf4ba('0x1d')](),channels[_0x445eda[_0xf4ba('0x7')]][_0xf4ba('0x3f')]);utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x44'),_0x445eda['uniqueid'],channels[_0x445eda[_0xf4ba('0x7')]][_0xf4ba('0x43')]));delete channels[_0x445eda[_0xf4ba('0x7')]][_0xf4ba('0x3f')];}}}catch(_0xdad88){utils[_0xf4ba('0x2a')](util['format']('[%s][calls][musiconholdstop]',_0x445eda[_0xf4ba('0x7')]),_0xdad88);}};exports[_0xf4ba('0x45')]=function(_0x35dbe1){try{if(!_[_0xf4ba('0x20')](channels[_0x35dbe1['uniqueid']])){utils[_0xf4ba('0x18')](util['format'](_0xf4ba('0x46'),_0x35dbe1['uniqueid']),_0x35dbe1);if(!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')]['xmd-originatecalleridnum'])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x48'),_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1['uniqueid']][_0xf4ba('0x4a')]=_0x35dbe1['value'];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x4b')])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x4c'),_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1['value']));channels[_0x35dbe1[_0xf4ba('0x7')]]['destination']=_0x35dbe1[_0xf4ba('0x49')];channels[_0x35dbe1['uniqueid']][_0xf4ba('0x2d')]='\x22'+_0x35dbe1[_0xf4ba('0x49')]+_0xf4ba('0x4d')+_0x35dbe1['value']+'>';}if(!_['isNil'](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x4e')])||!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x4f')])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x35dbe1[_0xf4ba('0x7')],!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x4e')])?_0xf4ba('0x4e'):_0xf4ba('0x4f'),_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1[_0xf4ba('0x7')]]['callerid']=_0x35dbe1[_0xf4ba('0x49')];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x50')])||!_['isNil'](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x51')])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x52'),_0x35dbe1[_0xf4ba('0x7')],!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x50')])?'xmd-queue':_0xf4ba('0x51'),_0x35dbe1['value']));channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x53')]=_0xf4ba('0x54');channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x55')]=_0x35dbe1[_0xf4ba('0x49')];channels[_0x35dbe1[_0xf4ba('0x7')]]['queue']=!![];}if(!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x56')])){utils['info'](util[_0xf4ba('0x9')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x57')]=_0x35dbe1[_0xf4ba('0x49')];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x58')])){utils[_0xf4ba('0x8')](util['format'](_0xf4ba('0x59'),_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1['uniqueid']][_0xf4ba('0x5a')]=_0x35dbe1[_0xf4ba('0x49')];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x5b')])){utils['info'](util['format'](_0xf4ba('0x5c'),_0x35dbe1['uniqueid'],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x5d')]=_0x35dbe1[_0xf4ba('0x49')];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x5e')])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x5f'),_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x5e')]=_0x35dbe1[_0xf4ba('0x49')];}}}catch(_0x4e8229){utils[_0xf4ba('0x2a')](util['format'](_0xf4ba('0x46'),_0x35dbe1['uniqueid']),_0x4e8229);}};exports[_0xf4ba('0x60')]=function(_0x1efd3d){try{if(!_[_0xf4ba('0x20')](channels[_0x1efd3d[_0xf4ba('0x7')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x61'),_0x1efd3d[_0xf4ba('0x7')]),_0x1efd3d);utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x62'),_0x1efd3d[_0xf4ba('0x7')],_0x1efd3d[_0xf4ba('0x63')],_0x1efd3d['appdata']));if(_0x1efd3d['application'][_0xf4ba('0x64')]()==_0xf4ba('0x65')&&_[_0xf4ba('0x66')](_0x1efd3d['appdata'][_0xf4ba('0x64')](),_0xf4ba('0x67'))){var _0x1a422e=_0x1efd3d[_0xf4ba('0x68')]['split']('=');var _0x4310ce=_0x1a422e[0x0][_0xf4ba('0x69')](_0x1a422e[0x0]['lastIndexOf']('(')+0x1,_0x1a422e[0x0][_0xf4ba('0x6a')](')'));var _0x22fb55=_0x1a422e[0x1];channels[_0x1efd3d[_0xf4ba('0x7')]][_0x4310ce]=_0x22fb55;}if(!_[_0xf4ba('0x6b')]([_0xf4ba('0x2b'),_0xf4ba('0x6c'),_0xf4ba('0x6d'),_0xf4ba('0x65'),_0xf4ba('0x6e')],_0x1efd3d['application']['toLowerCase']())){channels[_0x1efd3d[_0xf4ba('0x7')]][_0xf4ba('0x53')]=_0x1efd3d[_0xf4ba('0x63')];channels[_0x1efd3d[_0xf4ba('0x7')]][_0xf4ba('0x55')]=_0x1efd3d[_0xf4ba('0x68')];}}}catch(_0x4dd001){utils[_0xf4ba('0x2a')](util['format'](_0xf4ba('0x61'),_0x1efd3d[_0xf4ba('0x7')]),_0x4dd001);}}; \ No newline at end of file +var _0x4209=['context','exten','now','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','transfertargetchannel','origtransfererchannel','userfield','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmcs-queue','xmd-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','appdata','toLowerCase','substring','lastIndexOf','noop','set','gotoif','application','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','info','format','channel','queue','calleridnum','connectedlinenum','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x4209,0x11c));var _0x9420=function(_0x5572b7,_0x244036){_0x5572b7=_0x5572b7-0x0;var _0x1bc232=_0x4209[_0x5572b7];return _0x1bc232;};'use strict';var _=require(_0x9420('0x0'));var util=require(_0x9420('0x1'));var utils=require('./utils');var transfers=require(_0x9420('0x2'));var dispositions=[_0x9420('0x3'),'FAILED',_0x9420('0x4'),_0x9420('0x3'),_0x9420('0x3'),_0x9420('0x3'),_0x9420('0x5'),_0x9420('0x6'),'FAILED',_0x9420('0x4'),_0x9420('0x4')];var channels={};function writeDB(_0x37b985){var _0xd27452;if(transfers['blinds'][_0x37b985[_0x9420('0x7')]]){_0xd27452=_0x37b985[_0x9420('0x7')];_0x37b985['uniqueid']=transfers[_0x9420('0x8')][_0x37b985[_0x9420('0x7')]]['transfereeuniqueid'];}utils[_0x9420('0x9')](util[_0x9420('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x37b985[_0x9420('0x7')],_0x37b985[_0x9420('0xb')],_0x37b985[_0x9420('0xc')],_0x37b985['membername'],_0x37b985['interface'],_0x37b985[_0x9420('0xd')],_0x37b985[_0x9420('0xe')],_0x37b985['lastevent']));if(_0x37b985[_0x9420('0xf')]){utils[_0x9420('0x10')](_0x37b985[_0x9420('0xf')])[_0x9420('0x11')](function(_0x338da4){if(_0x338da4){_0x37b985[_0x9420('0x12')]=_0x338da4['id'];}utils[_0x9420('0x13')]('CreateVoiceCallReport',_0x37b985);});}else{utils[_0x9420('0x13')](_0x9420('0x14'),_0x37b985);}if(channels[_0x37b985[_0x9420('0x7')]]){delete channels[_0x37b985[_0x9420('0x7')]];}else if(_0xd27452&&channels[_0xd27452]){if(!transfers[_0x9420('0x8')][_0xd27452][_0x9420('0x15')])delete transfers[_0x9420('0x8')][_0xd27452];delete channels[_0xd27452];}}exports[_0x9420('0x16')]=function(_0x3c8671){try{utils[_0x9420('0x17')](util[_0x9420('0xa')](_0x9420('0x18'),_0x3c8671[_0x9420('0x7')]),_0x3c8671);if(_0x3c8671['uniqueid']==_0x3c8671[_0x9420('0x19')]&&_0x3c8671['channel']!=_0x9420('0x1a')){utils[_0x9420('0x9')](util[_0x9420('0xa')](_0x9420('0x1b'),_0x3c8671['uniqueid'],_0x3c8671[_0x9420('0x1c')],_0x3c8671[_0x9420('0x1d')]));channels[_0x3c8671[_0x9420('0x7')]]={'uniqueid':_0x3c8671['uniqueid'],'accountcode':_0x3c8671[_0x9420('0xf')],'source':_0x3c8671[_0x9420('0xd')],'destination':_0x3c8671[_0x9420('0x1d')],'destinationcontext':_0x3c8671['context'],'channel':_0x3c8671[_0x9420('0xb')],'starttime':utils[_0x9420('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9420('0x3'),'amaflags':_0x9420('0x1f')};}}catch(_0x539b49){utils[_0x9420('0x20')](util[_0x9420('0xa')](_0x9420('0x18'),_0x3c8671['uniqueid']),_0x539b49);}};exports['newstate']=function(_0x2abb6b){try{utils['debug'](util[_0x9420('0xa')](_0x9420('0x21'),_0x2abb6b['uniqueid']),_0x2abb6b);if(!_[_0x9420('0x22')](channels[_0x2abb6b['uniqueid']])&&_0x2abb6b[_0x9420('0x23')]==0x6){utils['info'](util['format'](_0x9420('0x24'),_0x2abb6b[_0x9420('0x7')],_0x2abb6b[_0x9420('0x1c')],_0x2abb6b[_0x9420('0xb')]));if(_[_0x9420('0x22')](channels[_0x2abb6b[_0x9420('0x7')]]['systemanswertime'])){channels[_0x2abb6b[_0x9420('0x7')]][_0x9420('0x25')]=utils[_0x9420('0x1e')]();}}else if(!_['isNil'](channels[_0x2abb6b['linkedid']])&&_0x2abb6b[_0x9420('0x23')]==0x6&&_0x2abb6b[_0x9420('0x1c')]!=_0x9420('0x26')){utils['info'](util[_0x9420('0xa')](_0x9420('0x27'),_0x2abb6b[_0x9420('0x7')],_0x2abb6b[_0x9420('0x19')],_0x2abb6b[_0x9420('0x1c')],_0x2abb6b[_0x9420('0xb')]));channels[_0x2abb6b[_0x9420('0x19')]][_0x9420('0xf')]=_0x2abb6b[_0x9420('0xf')];channels[_0x2abb6b[_0x9420('0x19')]][_0x9420('0x28')]=_0x2abb6b['channel'];if(_['isNil'](channels[_0x2abb6b[_0x9420('0x19')]][_0x9420('0x29')])){channels[_0x2abb6b['linkedid']]['answertime']=utils[_0x9420('0x1e')]();}channels[_0x2abb6b[_0x9420('0x19')]]['disposition']=dispositions[_[_0x9420('0x2a')](_0x2abb6b['channelstate'])]||_0x9420('0x5');}}catch(_0x1aac41){utils[_0x9420('0x20')](util[_0x9420('0xa')]('[%s][calls][newstate]',_0x2abb6b[_0x9420('0x7')]),_0x1aac41);}};exports[_0x9420('0x2b')]=function(_0x341c94){try{if(!_[_0x9420('0x22')](channels[_0x341c94[_0x9420('0x7')]])){utils['debug'](util[_0x9420('0xa')](_0x9420('0x2c'),_0x341c94['uniqueid']),_0x341c94);if(_[_0x9420('0x22')](channels[_0x341c94[_0x9420('0x7')]][_0x9420('0x2d')])){channels[_0x341c94[_0x9420('0x7')]][_0x9420('0x2d')]=_0x341c94[_0x9420('0x2e')]+'\x20<'+_0x341c94[_0x9420('0xd')]+'>';}utils[_0x9420('0x9')](util['format'](_0x9420('0x2f'),_0x341c94[_0x9420('0x7')],channels[_0x341c94['uniqueid']]['callerid'],_0x341c94[_0x9420('0x30')]));channels[_0x341c94[_0x9420('0x7')]][_0x9420('0x31')]=utils['now']();channels[_0x341c94[_0x9420('0x7')]][_0x9420('0x32')]=utils['diffTime'](channels[_0x341c94[_0x9420('0x7')]]['endtime'],channels[_0x341c94[_0x9420('0x7')]]['starttime']);channels[_0x341c94['uniqueid']]['billableseconds']=channels[_0x341c94[_0x9420('0x7')]][_0x9420('0x29')]?utils[_0x9420('0x33')](channels[_0x341c94['uniqueid']][_0x9420('0x31')],channels[_0x341c94[_0x9420('0x7')]][_0x9420('0x29')]):0x0;writeDB(channels[_0x341c94[_0x9420('0x7')]]);}}catch(_0x2cceb2){utils[_0x9420('0x20')](util['format'](_0x9420('0x2c'),_0x341c94[_0x9420('0x7')]),_0x2cceb2);}};exports[_0x9420('0x34')]=function(_0x21105b){try{if(!_['isNil'](channels[_0x21105b['localtwolinkedid']])){utils[_0x9420('0x17')](util['format'](_0x9420('0x35'),_0x21105b[_0x9420('0x36')]),_0x21105b);if(channels[_0x21105b[_0x9420('0x37')]]['channel']==_0x21105b[_0x9420('0x38')]){utils[_0x9420('0x9')](util['format'](_0x9420('0x39'),_0x21105b[_0x9420('0x36')],_0x21105b[_0x9420('0x37')],_0x21105b[_0x9420('0x3a')]));channels[_0x21105b['localtwolinkedid']][_0x9420('0x28')]=_0x21105b[_0x9420('0x3a')];channels[_0x21105b[_0x9420('0x37')]]['userfield']='_attended';}else if(channels[_0x21105b[_0x9420('0x37')]][_0x9420('0xb')]=_0x21105b[_0x9420('0x3b')]){utils[_0x9420('0x9')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x21105b['origtransfereruniqueid'],_0x21105b[_0x9420('0x37')],_0x21105b[_0x9420('0x3c')]));channels[_0x21105b[_0x9420('0x37')]][_0x9420('0x28')]=_0x21105b[_0x9420('0x3c')];channels[_0x21105b['localtwolinkedid']][_0x9420('0x3d')]=_0x9420('0x3e');}}}catch(_0x4be1ea){utils['error'](util[_0x9420('0xa')]('[%s][calls][attendedtransfer]',_0x21105b[_0x9420('0x36')]),_0x4be1ea);}};exports[_0x9420('0x3f')]=function(_0x1fa900){try{if(!_[_0x9420('0x22')](channels[_0x1fa900[_0x9420('0x7')]])){utils['debug'](util[_0x9420('0xa')](_0x9420('0x40'),_0x1fa900['uniqueid']),_0x1fa900);channels[_0x1fa900['uniqueid']][_0x9420('0x41')]=utils[_0x9420('0x1e')]();utils[_0x9420('0x9')](util['format'](_0x9420('0x42'),_0x1fa900[_0x9420('0x7')],channels[_0x1fa900[_0x9420('0x7')]][_0x9420('0x41')]));}}catch(_0x343330){utils[_0x9420('0x20')](util[_0x9420('0xa')]('[%s][calls][musiconholdstart]',_0x1fa900[_0x9420('0x7')]),_0x343330);}};exports[_0x9420('0x43')]=function(_0x17fd6e){try{if(!_['isNil'](channels[_0x17fd6e[_0x9420('0x7')]])){utils['debug'](util[_0x9420('0xa')]('[%s][calls][musiconholdstop]',_0x17fd6e[_0x9420('0x7')]),_0x17fd6e);if(!_[_0x9420('0x22')](channels[_0x17fd6e['uniqueid']]['musiconholdstartAt'])){channels[_0x17fd6e[_0x9420('0x7')]][_0x9420('0x44')]+=utils[_0x9420('0x33')](utils['now'](),channels[_0x17fd6e[_0x9420('0x7')]][_0x9420('0x41')]);utils[_0x9420('0x9')](util[_0x9420('0xa')](_0x9420('0x45'),_0x17fd6e['uniqueid'],channels[_0x17fd6e[_0x9420('0x7')]][_0x9420('0x44')]));delete channels[_0x17fd6e[_0x9420('0x7')]][_0x9420('0x41')];}}}catch(_0x5a6b86){utils['error'](util[_0x9420('0xa')](_0x9420('0x46'),_0x17fd6e['uniqueid']),_0x5a6b86);}};exports[_0x9420('0x47')]=function(_0x5f0c6b){try{if(!_['isNil'](channels[_0x5f0c6b[_0x9420('0x7')]])){utils['debug'](util[_0x9420('0xa')](_0x9420('0x48'),_0x5f0c6b[_0x9420('0x7')]),_0x5f0c6b);if(!_[_0x9420('0x22')](_0x5f0c6b['variable'][_0x9420('0x49')])){utils[_0x9420('0x9')](util['format'](_0x9420('0x4a'),_0x5f0c6b['uniqueid'],_0x5f0c6b['value']));channels[_0x5f0c6b[_0x9420('0x7')]]['source']=_0x5f0c6b[_0x9420('0x4b')];}if(!_[_0x9420('0x22')](_0x5f0c6b[_0x9420('0x4c')][_0x9420('0x4d')])){utils['info'](util[_0x9420('0xa')](_0x9420('0x4e'),_0x5f0c6b[_0x9420('0x7')],_0x5f0c6b[_0x9420('0x4b')]));channels[_0x5f0c6b['uniqueid']]['destination']=_0x5f0c6b[_0x9420('0x4b')];channels[_0x5f0c6b[_0x9420('0x7')]]['callerid']='\x22'+_0x5f0c6b[_0x9420('0x4b')]+'\x22\x20<'+_0x5f0c6b[_0x9420('0x4b')]+'>';}if(!_[_0x9420('0x22')](_0x5f0c6b['variable'][_0x9420('0x4f')])||!_[_0x9420('0x22')](_0x5f0c6b[_0x9420('0x4c')]['xmd-callerid'])){utils[_0x9420('0x9')](util[_0x9420('0xa')](_0x9420('0x50'),_0x5f0c6b[_0x9420('0x7')],!_[_0x9420('0x22')](_0x5f0c6b[_0x9420('0x4c')][_0x9420('0x4f')])?'xmd-callerid-preview':_0x9420('0x51'),_0x5f0c6b[_0x9420('0x4b')]));channels[_0x5f0c6b[_0x9420('0x7')]][_0x9420('0x2d')]=_0x5f0c6b['value'];}if(!_[_0x9420('0x22')](_0x5f0c6b[_0x9420('0x4c')]['xmd-queue'])||!_['isNil'](_0x5f0c6b[_0x9420('0x4c')][_0x9420('0x52')])){utils['info'](util[_0x9420('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5f0c6b[_0x9420('0x7')],!_[_0x9420('0x22')](_0x5f0c6b['variable'][_0x9420('0x53')])?_0x9420('0x53'):_0x9420('0x52'),_0x5f0c6b[_0x9420('0x4b')]));channels[_0x5f0c6b['uniqueid']][_0x9420('0x54')]='Queue';channels[_0x5f0c6b[_0x9420('0x7')]][_0x9420('0x55')]=_0x5f0c6b[_0x9420('0x4b')];channels[_0x5f0c6b[_0x9420('0x7')]][_0x9420('0xc')]=!![];}if(!_[_0x9420('0x22')](_0x5f0c6b[_0x9420('0x4c')][_0x9420('0x56')])){utils[_0x9420('0x9')](util[_0x9420('0xa')](_0x9420('0x57'),_0x5f0c6b[_0x9420('0x7')],_0x5f0c6b[_0x9420('0x4b')]));channels[_0x5f0c6b[_0x9420('0x7')]][_0x9420('0x58')]=_0x5f0c6b['value'];}if(!_[_0x9420('0x22')](_0x5f0c6b['variable'][_0x9420('0x59')])){utils['info'](util[_0x9420('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x5f0c6b[_0x9420('0x7')],_0x5f0c6b['value']));channels[_0x5f0c6b['uniqueid']][_0x9420('0x5a')]=_0x5f0c6b[_0x9420('0x4b')];}if(!_[_0x9420('0x22')](_0x5f0c6b['variable']['outboundrouteid'])){utils[_0x9420('0x9')](util[_0x9420('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x5f0c6b[_0x9420('0x7')],_0x5f0c6b[_0x9420('0x4b')]));channels[_0x5f0c6b[_0x9420('0x7')]][_0x9420('0x5b')]=_0x5f0c6b[_0x9420('0x4b')];}if(!_[_0x9420('0x22')](_0x5f0c6b[_0x9420('0x4c')][_0x9420('0x5c')])){utils['info'](util[_0x9420('0xa')](_0x9420('0x5d'),_0x5f0c6b['uniqueid'],_0x5f0c6b[_0x9420('0x4b')]));channels[_0x5f0c6b[_0x9420('0x7')]]['sipcallid']=_0x5f0c6b['value'];}}}catch(_0x3bed50){utils[_0x9420('0x20')](util[_0x9420('0xa')]('[%s][calls][varset]',_0x5f0c6b[_0x9420('0x7')]),_0x3bed50);}};exports[_0x9420('0x5e')]=function(_0x25c0e6){try{if(!_[_0x9420('0x22')](channels[_0x25c0e6[_0x9420('0x7')]])){utils[_0x9420('0x17')](util[_0x9420('0xa')](_0x9420('0x5f'),_0x25c0e6['uniqueid']),_0x25c0e6);utils[_0x9420('0x9')](util[_0x9420('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x25c0e6['uniqueid'],_0x25c0e6['application'],_0x25c0e6[_0x9420('0x60')]));if(_0x25c0e6['application'][_0x9420('0x61')]()=='set'&&_['startsWith'](_0x25c0e6[_0x9420('0x60')]['toLowerCase'](),'cdr')){var _0x511414=_0x25c0e6[_0x9420('0x60')]['split']('=');var _0x3b0c1a=_0x511414[0x0][_0x9420('0x62')](_0x511414[0x0][_0x9420('0x63')]('(')+0x1,_0x511414[0x0][_0x9420('0x63')](')'));var _0xc5a319=_0x511414[0x1];channels[_0x25c0e6[_0x9420('0x7')]][_0x3b0c1a]=_0xc5a319;}if(!_['includes']([_0x9420('0x2b'),_0x9420('0x64'),'execif',_0x9420('0x65'),_0x9420('0x66')],_0x25c0e6[_0x9420('0x67')][_0x9420('0x61')]())){channels[_0x25c0e6['uniqueid']][_0x9420('0x54')]=_0x25c0e6[_0x9420('0x67')];channels[_0x25c0e6['uniqueid']][_0x9420('0x55')]=_0x25c0e6['appdata'];}}}catch(_0x22838f){utils[_0x9420('0x20')](util['format'](_0x9420('0x5f'),_0x25c0e6[_0x9420('0x7')]),_0x22838f);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 21bed5f..154f7de 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 _0x38fb=['close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error'];(function(_0x2b3133,_0x2382ac){var _0x48cfb5=function(_0x3b87e4){while(--_0x3b87e4){_0x2b3133['push'](_0x2b3133['shift']());}};_0x48cfb5(++_0x2382ac);}(_0x38fb,0x1b0));var _0xb38f=function(_0x4f708f,_0x19857c){_0x4f708f=_0x4f708f-0x0;var _0xc14ea8=_0x38fb[_0x4f708f];return _0xc14ea8;};'use strict';var utils=require(_0xb38f('0x0'));exports[_0xb38f('0x1')]=function(){utils[_0xb38f('0x2')](_0xb38f('0x3'));};exports[_0xb38f('0x4')]=function(){utils[_0xb38f('0x2')](_0xb38f('0x5'));};exports[_0xb38f('0x6')]=function(){utils[_0xb38f('0x2')](_0xb38f('0x7'));};exports[_0xb38f('0x8')]=function(_0x44c665){utils[_0xb38f('0x8')](_0xb38f('0x9'),_0x44c665);};exports[_0xb38f('0xa')]=function(){utils[_0xb38f('0x2')](_0xb38f('0xb'));};exports[_0xb38f('0xc')]=function(_0x59f8df){}; \ No newline at end of file +var _0x2966=['connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils'];(function(_0x4b0dac,_0x598f38){var _0x4a3e90=function(_0x283f69){while(--_0x283f69){_0x4b0dac['push'](_0x4b0dac['shift']());}};_0x4a3e90(++_0x598f38);}(_0x2966,0x151));var _0x6296=function(_0x56ee7e,_0x31be7a){_0x56ee7e=_0x56ee7e-0x0;var _0x5a8d6a=_0x2966[_0x56ee7e];return _0x5a8d6a;};'use strict';var utils=require(_0x6296('0x0'));exports[_0x6296('0x1')]=function(){utils[_0x6296('0x2')](_0x6296('0x3'));};exports[_0x6296('0x4')]=function(){utils['info'](_0x6296('0x5'));};exports[_0x6296('0x6')]=function(){utils[_0x6296('0x2')](_0x6296('0x7'));};exports[_0x6296('0x8')]=function(_0x5b533c){utils['error'](_0x6296('0x9'),_0x5b533c);};exports[_0x6296('0xa')]=function(){utils[_0x6296('0x2')](_0x6296('0xb'));};exports[_0x6296('0xc')]=function(_0x10dff7){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index f7aa81c..a9eb68d 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 _0x3457=['diffTime','endtime','billableseconds','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr(routeid)','split','error','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','complete'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x3457,0x9c));var _0x7345=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3457[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x7345('0x0'));var utils=require(_0x7345('0x1'));var dials={};function writeDB(_0x5ca495){utils['info'](util[_0x7345('0x2')](_0x7345('0x3'),_0x5ca495[_0x7345('0x4')],_0x5ca495[_0x7345('0x5')],_0x5ca495[_0x7345('0x6')],_0x5ca495[_0x7345('0x7')],_0x5ca495[_0x7345('0x8')],_0x5ca495[_0x7345('0x9')]));utils[_0x7345('0xa')](_0x7345('0xb'),_0x5ca495);delete dials[_0x5ca495[_0x7345('0x4')]];}exports[_0x7345('0xc')]=function(_0x2b7e5a){try{utils[_0x7345('0xd')](util[_0x7345('0x2')](_0x7345('0xe'),_0x2b7e5a[_0x7345('0x4')]),_0x2b7e5a);utils[_0x7345('0xf')](util[_0x7345('0x2')](_0x7345('0x10'),_0x2b7e5a['uniqueid'],_0x2b7e5a[_0x7345('0x11')],_0x2b7e5a[_0x7345('0x12')]));if(_0x2b7e5a['application']['toLowerCase']()==_0x7345('0x13')&&_[_0x7345('0x14')](_0x2b7e5a[_0x7345('0x12')][_0x7345('0x15')](),_0x7345('0x16'))){var _0x5f0873=_0x2b7e5a[_0x7345('0x12')][_0x7345('0x17')]('=');dials[_0x2b7e5a[_0x7345('0x4')]]={'routeId':_0x5f0873[0x1]};}}catch(_0x47c2bf){utils[_0x7345('0x18')](util['format'](_0x7345('0xe'),_0x2b7e5a['uniqueid']),_0x47c2bf);}};exports['varset']=function(_0x13c2e0){try{utils[_0x7345('0xd')](util[_0x7345('0x2')]('[%s][dials][varset]',_0x13c2e0[_0x7345('0x4')]),_0x13c2e0);if(!_[_0x7345('0x19')](_0x13c2e0[_0x7345('0x1a')][_0x7345('0x1b')])){utils[_0x7345('0xf')](util[_0x7345('0x2')](_0x7345('0x1c'),_0x13c2e0[_0x7345('0x4')],_0x13c2e0[_0x7345('0x1d')]));dials[_0x13c2e0[_0x7345('0x4')]]={'routeId':_0x13c2e0[_0x7345('0x1d')]};}}catch(_0xb917c4){utils[_0x7345('0x18')](util[_0x7345('0x2')](_0x7345('0x1e'),_0x13c2e0[_0x7345('0x4')]),_0xb917c4);}};exports[_0x7345('0x1f')]=function(_0x14921a){try{if(!_['isNil'](dials[_0x14921a[_0x7345('0x4')]])){utils[_0x7345('0xd')](util['format']('[%s][dials][dialbegin]',_0x14921a[_0x7345('0x4')]),_0x14921a);dials[_0x14921a[_0x7345('0x4')]]=_[_0x7345('0x20')](dials[_0x14921a[_0x7345('0x4')]],_0x14921a);dials[_0x14921a['uniqueid']][_0x7345('0x21')]=utils[_0x7345('0x22')]();dials[_0x14921a[_0x7345('0x4')]][_0x7345('0x23')]='called';utils[_0x7345('0xf')](util[_0x7345('0x2')](_0x7345('0x24'),_0x14921a[_0x7345('0x4')],dials[_0x14921a[_0x7345('0x4')]][_0x7345('0x21')]));}}catch(_0x51a351){utils[_0x7345('0x18')](util[_0x7345('0x2')](_0x7345('0x25'),_0x14921a['uniqueid']),_0x51a351);}};exports[_0x7345('0x26')]=function(_0x534aa7){try{if(!_[_0x7345('0x19')](dials[_0x534aa7[_0x7345('0x4')]])){utils[_0x7345('0xd')](util['format'](_0x7345('0x27'),_0x534aa7[_0x7345('0x4')]),_0x534aa7);dials[_0x534aa7[_0x7345('0x4')]][_0x7345('0x9')]=_0x534aa7[_0x7345('0x9')];if(_0x534aa7['dialstatus']==_0x7345('0x28')){dials[_0x534aa7[_0x7345('0x4')]]=_[_0x7345('0x20')](dials[_0x534aa7[_0x7345('0x4')]],_0x534aa7);dials[_0x534aa7['uniqueid']][_0x7345('0x29')]=utils[_0x7345('0x22')]();dials[_0x534aa7[_0x7345('0x4')]][_0x7345('0x23')]=_0x7345('0x2a');utils['info'](util[_0x7345('0x2')](_0x7345('0x2b'),_0x534aa7['uniqueid'],_0x534aa7[_0x7345('0x9')],dials[_0x534aa7['uniqueid']][_0x7345('0x29')]));}else{utils[_0x7345('0xf')](util[_0x7345('0x2')](_0x7345('0x2c'),_0x534aa7[_0x7345('0x4')],_0x534aa7['dialstatus']));}}}catch(_0x1e30a9){utils[_0x7345('0x18')](util[_0x7345('0x2')]('[%s][dials][dialend]',_0x534aa7[_0x7345('0x4')]),_0x1e30a9);}};exports['hangup']=function(_0xa3ea73){try{if(!_[_0x7345('0x19')](dials[_0xa3ea73[_0x7345('0x4')]])){utils[_0x7345('0xd')](util[_0x7345('0x2')](_0x7345('0x2d'),_0xa3ea73[_0x7345('0x4')]),_0xa3ea73);utils[_0x7345('0xf')](util['format'](_0x7345('0x2e'),_0xa3ea73[_0x7345('0x4')],_0xa3ea73[_0x7345('0x7')],_0xa3ea73['calleridname'],_0xa3ea73['cause-txt']));dials[_0xa3ea73[_0x7345('0x4')]]=_['assign'](dials[_0xa3ea73[_0x7345('0x4')]],{'endtime':utils[_0x7345('0x22')](),'lastevent':_0x7345('0x2f')});dials[_0xa3ea73['uniqueid']]['duration']=utils[_0x7345('0x30')](dials[_0xa3ea73['uniqueid']]['endtime'],dials[_0xa3ea73[_0x7345('0x4')]][_0x7345('0x21')]);dials[_0xa3ea73[_0x7345('0x4')]]['holdtime']=utils[_0x7345('0x30')](dials[_0xa3ea73[_0x7345('0x4')]][_0x7345('0x29')]||dials[_0xa3ea73[_0x7345('0x4')]][_0x7345('0x31')],dials[_0xa3ea73[_0x7345('0x4')]][_0x7345('0x21')]);dials[_0xa3ea73[_0x7345('0x4')]][_0x7345('0x32')]=dials[_0xa3ea73[_0x7345('0x4')]][_0x7345('0x29')]?utils[_0x7345('0x30')](dials[_0xa3ea73[_0x7345('0x4')]][_0x7345('0x31')],dials[_0xa3ea73[_0x7345('0x4')]][_0x7345('0x29')]):0x0;writeDB(dials[_0xa3ea73[_0x7345('0x4')]]);}}catch(_0x556c09){utils[_0x7345('0x18')](util[_0x7345('0x2')](_0x7345('0x2d'),_0xa3ea73[_0x7345('0x4')]),_0x556c09);}}; \ No newline at end of file +var _0xdf09=['./utils','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','connectedlinenum','request','uniqueid','newexten','format','[%s][dials][newexten]','info','application','toLowerCase','set','startsWith','appdata','split','varset','debug','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','util'];(function(_0x51b80a,_0x355fe3){var _0x22fdf0=function(_0x152b3e){while(--_0x152b3e){_0x51b80a['push'](_0x51b80a['shift']());}};_0x22fdf0(++_0x355fe3);}(_0xdf09,0x197));var _0x9df0=function(_0xc3e225,_0x166fbb){_0xc3e225=_0xc3e225-0x0;var _0xfb3aae=_0xdf09[_0xc3e225];return _0xfb3aae;};'use strict';var _=require('lodash');var util=require(_0x9df0('0x0'));var utils=require(_0x9df0('0x1'));var dials={};function writeDB(_0x5daa9a){utils['info'](util['format'](_0x9df0('0x2'),_0x5daa9a['uniqueid'],_0x5daa9a[_0x9df0('0x3')],_0x5daa9a[_0x9df0('0x4')],_0x5daa9a['calleridnum'],_0x5daa9a[_0x9df0('0x5')],_0x5daa9a['dialstatus']));utils[_0x9df0('0x6')]('CreateVoiceDialReport',_0x5daa9a);delete dials[_0x5daa9a[_0x9df0('0x7')]];}exports[_0x9df0('0x8')]=function(_0x1d553f){try{utils['debug'](util[_0x9df0('0x9')](_0x9df0('0xa'),_0x1d553f['uniqueid']),_0x1d553f);utils[_0x9df0('0xb')](util[_0x9df0('0x9')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x1d553f['uniqueid'],_0x1d553f['application'],_0x1d553f['appdata']));if(_0x1d553f[_0x9df0('0xc')][_0x9df0('0xd')]()==_0x9df0('0xe')&&_[_0x9df0('0xf')](_0x1d553f[_0x9df0('0x10')][_0x9df0('0xd')](),'cdr(routeid)')){var _0x3233e9=_0x1d553f[_0x9df0('0x10')][_0x9df0('0x11')]('=');dials[_0x1d553f[_0x9df0('0x7')]]={'routeId':_0x3233e9[0x1]};}}catch(_0x3e9ffe){utils['error'](util[_0x9df0('0x9')](_0x9df0('0xa'),_0x1d553f['uniqueid']),_0x3e9ffe);}};exports[_0x9df0('0x12')]=function(_0x2e5517){try{utils[_0x9df0('0x13')](util[_0x9df0('0x9')]('[%s][dials][varset]',_0x2e5517['uniqueid']),_0x2e5517);if(!_[_0x9df0('0x14')](_0x2e5517[_0x9df0('0x15')][_0x9df0('0x16')])){utils[_0x9df0('0xb')](util[_0x9df0('0x9')](_0x9df0('0x17'),_0x2e5517[_0x9df0('0x7')],_0x2e5517[_0x9df0('0x18')]));dials[_0x2e5517['uniqueid']]={'routeId':_0x2e5517[_0x9df0('0x18')]};}}catch(_0x39114b){utils[_0x9df0('0x19')](util[_0x9df0('0x9')](_0x9df0('0x1a'),_0x2e5517[_0x9df0('0x7')]),_0x39114b);}};exports[_0x9df0('0x1b')]=function(_0x2d20b6){try{if(!_[_0x9df0('0x14')](dials[_0x2d20b6['uniqueid']])){utils[_0x9df0('0x13')](util[_0x9df0('0x9')](_0x9df0('0x1c'),_0x2d20b6[_0x9df0('0x7')]),_0x2d20b6);dials[_0x2d20b6['uniqueid']]=_[_0x9df0('0x1d')](dials[_0x2d20b6[_0x9df0('0x7')]],_0x2d20b6);dials[_0x2d20b6[_0x9df0('0x7')]][_0x9df0('0x1e')]=utils[_0x9df0('0x1f')]();dials[_0x2d20b6[_0x9df0('0x7')]]['lastevent']=_0x9df0('0x20');utils[_0x9df0('0xb')](util[_0x9df0('0x9')](_0x9df0('0x21'),_0x2d20b6[_0x9df0('0x7')],dials[_0x2d20b6['uniqueid']][_0x9df0('0x1e')]));}}catch(_0x57ee6a){utils['error'](util[_0x9df0('0x9')](_0x9df0('0x1c'),_0x2d20b6[_0x9df0('0x7')]),_0x57ee6a);}};exports[_0x9df0('0x22')]=function(_0x14b3e2){try{if(!_['isNil'](dials[_0x14b3e2[_0x9df0('0x7')]])){utils[_0x9df0('0x13')](util[_0x9df0('0x9')]('[%s][dials][dialend]',_0x14b3e2[_0x9df0('0x7')]),_0x14b3e2);dials[_0x14b3e2[_0x9df0('0x7')]][_0x9df0('0x23')]=_0x14b3e2['dialstatus'];if(_0x14b3e2['dialstatus']==_0x9df0('0x24')){dials[_0x14b3e2[_0x9df0('0x7')]]=_[_0x9df0('0x1d')](dials[_0x14b3e2[_0x9df0('0x7')]],_0x14b3e2);dials[_0x14b3e2[_0x9df0('0x7')]][_0x9df0('0x25')]=utils[_0x9df0('0x1f')]();dials[_0x14b3e2['uniqueid']]['lastevent']=_0x9df0('0x26');utils[_0x9df0('0xb')](util[_0x9df0('0x9')](_0x9df0('0x27'),_0x14b3e2[_0x9df0('0x7')],_0x14b3e2['dialstatus'],dials[_0x14b3e2[_0x9df0('0x7')]][_0x9df0('0x25')]));}else{utils['info'](util[_0x9df0('0x9')](_0x9df0('0x28'),_0x14b3e2[_0x9df0('0x7')],_0x14b3e2[_0x9df0('0x23')]));}}}catch(_0x445118){utils[_0x9df0('0x19')](util[_0x9df0('0x9')](_0x9df0('0x29'),_0x14b3e2['uniqueid']),_0x445118);}};exports['hangup']=function(_0x1a3902){try{if(!_[_0x9df0('0x14')](dials[_0x1a3902[_0x9df0('0x7')]])){utils[_0x9df0('0x13')](util[_0x9df0('0x9')]('[%s][dials][hangup]',_0x1a3902[_0x9df0('0x7')]),_0x1a3902);utils['info'](util['format'](_0x9df0('0x2a'),_0x1a3902[_0x9df0('0x7')],_0x1a3902['calleridnum'],_0x1a3902[_0x9df0('0x2b')],_0x1a3902[_0x9df0('0x2c')]));dials[_0x1a3902[_0x9df0('0x7')]]=_[_0x9df0('0x1d')](dials[_0x1a3902['uniqueid']],{'endtime':utils[_0x9df0('0x1f')](),'lastevent':_0x9df0('0x2d')});dials[_0x1a3902[_0x9df0('0x7')]][_0x9df0('0x2e')]=utils[_0x9df0('0x2f')](dials[_0x1a3902[_0x9df0('0x7')]][_0x9df0('0x30')],dials[_0x1a3902['uniqueid']]['starttime']);dials[_0x1a3902[_0x9df0('0x7')]][_0x9df0('0x31')]=utils['diffTime'](dials[_0x1a3902[_0x9df0('0x7')]]['answertime']||dials[_0x1a3902[_0x9df0('0x7')]][_0x9df0('0x30')],dials[_0x1a3902[_0x9df0('0x7')]][_0x9df0('0x1e')]);dials[_0x1a3902['uniqueid']][_0x9df0('0x32')]=dials[_0x1a3902['uniqueid']][_0x9df0('0x25')]?utils[_0x9df0('0x2f')](dials[_0x1a3902[_0x9df0('0x7')]][_0x9df0('0x30')],dials[_0x1a3902['uniqueid']]['answertime']):0x0;writeDB(dials[_0x1a3902[_0x9df0('0x7')]]);}}catch(_0x3d30eb){utils[_0x9df0('0x19')](util['format']('[%s][dials][hangup]',_0x1a3902[_0x9df0('0x7')]),_0x3d30eb);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 67a28c0..ae88843 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 _0xf0f3=['cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','xdr','disabled','env','production','local','port','asterisk','username','keepConnected','XDR\x20DISABLED','info','./agents.controller','./calls.controller','./queues.controller','./members.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]'];(function(_0x59273d,_0x59bee7){var _0x5b01a5=function(_0x5f5c40){while(--_0x5f5c40){_0x59273d['push'](_0x59273d['shift']());}};_0x5b01a5(++_0x59bee7);}(_0xf0f3,0x195));var _0x3f0f=function(_0x4c9252,_0x1d4f7a){_0x4c9252=_0x4c9252-0x0;var _0x5a2360=_0xf0f3[_0x4c9252];return _0x5a2360;};var AsteriskManager=require('asterisk-manager');var config=require(_0x3f0f('0x0'));var utils=require(_0x3f0f('0x1'));var util=require('util');var isXDREnabled=config[_0x3f0f('0x2')]&&config[_0x3f0f('0x2')][_0x3f0f('0x3')]?!config[_0x3f0f('0x2')]['disabled']:!![];var isProduction=config[_0x3f0f('0x4')]===_0x3f0f('0x5')||![];var isLocalAsterisk=config[_0x3f0f('0x2')]&&config[_0x3f0f('0x2')][_0x3f0f('0x6')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x3f0f('0x7')],config[_0x3f0f('0x8')]['ip'],config[_0x3f0f('0x8')][_0x3f0f('0x9')],config[_0x3f0f('0x8')]['password'],!![]);ami[_0x3f0f('0xa')]();if(!isXDREnabled){utils['info'](_0x3f0f('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x3f0f('0xc')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x3f0f('0xd'));var calls=require(_0x3f0f('0xe'));var queues=require(_0x3f0f('0xf'));var recordings=require('./recordings.controller');var members=require(_0x3f0f('0x10'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0x3f0f('0x11'),core[_0x3f0f('0x11')]);ami['on'](_0x3f0f('0x12'),core[_0x3f0f('0x12')]);ami['on']('fullybooted',core[_0x3f0f('0x13')]);ami['on'](_0x3f0f('0x14'),core[_0x3f0f('0x14')]);ami['on'](_0x3f0f('0x15'),core[_0x3f0f('0x15')]);ami['on'](_0x3f0f('0x16'),core[_0x3f0f('0x16')]);ami['on'](_0x3f0f('0x17'),function(_0x39740b){try{utils[_0x3f0f('0x18')](util[_0x3f0f('0x19')](_0x3f0f('0x1a'),_0x39740b['device']),_0x39740b);members['devicestatechange'](_0x39740b);}catch(_0x39ba1a){utils['error'](util[_0x3f0f('0x19')](_0x3f0f('0x1a'),_0x39740b['device']),_0x39ba1a);}});ami['on'](_0x3f0f('0x1b'),function(_0x376195){try{utils[_0x3f0f('0x18')](util[_0x3f0f('0x19')](_0x3f0f('0x1c'),_0x376195[_0x3f0f('0x1d')]),_0x376195);agents['agentcalled'](_0x376195);}catch(_0xcad595){utils[_0x3f0f('0x14')](util[_0x3f0f('0x19')]('[%s][index][agentcalled]',_0x376195[_0x3f0f('0x1d')]),_0xcad595);}});ami['on'](_0x3f0f('0x1e'),function(_0x53a965){try{utils[_0x3f0f('0x18')](util['format']('[%s][index][agentringnoanswer]',_0x53a965[_0x3f0f('0x1d')]),_0x53a965);agents[_0x3f0f('0x1e')](_0x53a965);}catch(_0x30994d){utils[_0x3f0f('0x14')](util[_0x3f0f('0x19')](_0x3f0f('0x1f'),_0x53a965['uniqueid']),_0x30994d);}});ami['on'](_0x3f0f('0x20'),function(_0x4ef4c0){try{utils[_0x3f0f('0x18')](util[_0x3f0f('0x19')](_0x3f0f('0x21'),_0x4ef4c0[_0x3f0f('0x1d')]),_0x4ef4c0);agents[_0x3f0f('0x20')](_0x4ef4c0);queues[_0x3f0f('0x20')](_0x4ef4c0);}catch(_0x5ede70){utils[_0x3f0f('0x14')](util['format'](_0x3f0f('0x21'),_0x4ef4c0[_0x3f0f('0x1d')]),_0x5ede70);}});ami['on']('agentcomplete',function(_0x3c35d1){try{utils['debug'](util['format'](_0x3f0f('0x22'),_0x3c35d1[_0x3f0f('0x1d')]),_0x3c35d1);agents[_0x3f0f('0x23')](_0x3c35d1);queues[_0x3f0f('0x23')](_0x3c35d1);members['agentcomplete'](_0x3c35d1);}catch(_0x2f9b5e){utils['error'](util['format'](_0x3f0f('0x22'),_0x3c35d1[_0x3f0f('0x1d')]),_0x2f9b5e);}});ami['on'](_0x3f0f('0x24'),function(_0x37bd65){try{utils[_0x3f0f('0x18')](util[_0x3f0f('0x19')]('[%s][index][queuecallerabandon]',_0x37bd65[_0x3f0f('0x1d')]),_0x37bd65);agents['queuecallerabandon'](_0x37bd65);queues[_0x3f0f('0x24')](_0x37bd65);}catch(_0x1579b9){utils['error'](util[_0x3f0f('0x19')](_0x3f0f('0x25'),_0x37bd65['uniqueid']),_0x1579b9);}});ami['on']('queuecallerjoin',function(_0x58f4f0){try{utils[_0x3f0f('0x18')](util['format'](_0x3f0f('0x26'),_0x58f4f0[_0x3f0f('0x1d')]),_0x58f4f0);queues[_0x3f0f('0x27')](_0x58f4f0);recordings[_0x3f0f('0x27')](_0x58f4f0);}catch(_0xcbbd19){utils['error'](util[_0x3f0f('0x19')](_0x3f0f('0x26'),_0x58f4f0[_0x3f0f('0x1d')]),_0xcbbd19);}});ami['on'](_0x3f0f('0x28'),function(_0x36f05d){try{utils[_0x3f0f('0x18')](util[_0x3f0f('0x19')](_0x3f0f('0x29'),_0x36f05d['uniqueid']),_0x36f05d);queues[_0x3f0f('0x28')](_0x36f05d);}catch(_0x231ade){utils[_0x3f0f('0x14')](util[_0x3f0f('0x19')](_0x3f0f('0x29'),_0x36f05d[_0x3f0f('0x1d')]),_0x231ade);}});ami['on']('musiconholdstart',function(_0x5bea55){try{utils['debug'](util[_0x3f0f('0x19')](_0x3f0f('0x2a'),_0x5bea55[_0x3f0f('0x1d')]),_0x5bea55);queues['musiconholdstart'](_0x5bea55);calls[_0x3f0f('0x2b')](_0x5bea55);}catch(_0x333316){utils[_0x3f0f('0x14')](util[_0x3f0f('0x19')](_0x3f0f('0x2a'),_0x5bea55[_0x3f0f('0x1d')]),_0x333316);}});ami['on'](_0x3f0f('0x2c'),function(_0x12479f){try{utils[_0x3f0f('0x18')](util[_0x3f0f('0x19')](_0x3f0f('0x2d'),_0x12479f['uniqueid']),_0x12479f);queues['musiconholdstop'](_0x12479f);calls[_0x3f0f('0x2c')](_0x12479f);}catch(_0x29edb9){utils['error'](util[_0x3f0f('0x19')](_0x3f0f('0x2d'),_0x12479f[_0x3f0f('0x1d')]),_0x29edb9);}});ami['on']('newstate',function(_0x17a61c){try{utils[_0x3f0f('0x18')](util[_0x3f0f('0x19')](_0x3f0f('0x2e'),_0x17a61c[_0x3f0f('0x1d')]),_0x17a61c);calls[_0x3f0f('0x2f')](_0x17a61c);recordings[_0x3f0f('0x2f')](_0x17a61c);}catch(_0x16769e){utils['error'](util[_0x3f0f('0x19')](_0x3f0f('0x2e'),_0x17a61c['uniqueid']),_0x16769e);}});ami['on'](_0x3f0f('0x30'),function(_0x42598c){try{utils[_0x3f0f('0x18')](util[_0x3f0f('0x19')](_0x3f0f('0x31'),_0x42598c[_0x3f0f('0x1d')]),_0x42598c);calls[_0x3f0f('0x30')](_0x42598c);recordings[_0x3f0f('0x30')](_0x42598c);dials[_0x3f0f('0x30')](_0x42598c);agents[_0x3f0f('0x30')](_0x42598c);queues[_0x3f0f('0x30')](_0x42598c);}catch(_0x3d648c){utils[_0x3f0f('0x14')](util[_0x3f0f('0x19')](_0x3f0f('0x31'),_0x42598c['uniqueid']),_0x3d648c);}});ami['on'](_0x3f0f('0x32'),function(_0x48e7fc){try{utils['debug'](util[_0x3f0f('0x19')](_0x3f0f('0x33'),_0x48e7fc['uniqueid']),_0x48e7fc);members[_0x3f0f('0x32')](_0x48e7fc);}catch(_0x36a85f){utils[_0x3f0f('0x14')](util[_0x3f0f('0x19')](_0x3f0f('0x33'),_0x48e7fc[_0x3f0f('0x1d')]),_0x36a85f);}});ami['on']('blindtransfer',function(_0x1724d0){try{utils[_0x3f0f('0x18')](util[_0x3f0f('0x19')](_0x3f0f('0x34'),_0x1724d0[_0x3f0f('0x1d')]),_0x1724d0);queues['blindtransfer'](_0x1724d0);agents[_0x3f0f('0x35')](_0x1724d0);transfers[_0x3f0f('0x35')](_0x1724d0);recordings[_0x3f0f('0x35')](_0x1724d0);}catch(_0x5affd3){utils['error'](util[_0x3f0f('0x19')](_0x3f0f('0x34'),_0x1724d0[_0x3f0f('0x1d')]),_0x5affd3);}});ami['on'](_0x3f0f('0x36'),function(_0x2c7997){try{utils[_0x3f0f('0x18')](util['format'](_0x3f0f('0x37'),_0x2c7997[_0x3f0f('0x38')]),_0x2c7997);queues[_0x3f0f('0x36')](_0x2c7997);transfers[_0x3f0f('0x36')](_0x2c7997);agents[_0x3f0f('0x36')](_0x2c7997);calls[_0x3f0f('0x36')](_0x2c7997);}catch(_0x531b79){utils[_0x3f0f('0x14')](util[_0x3f0f('0x19')](_0x3f0f('0x37'),_0x2c7997[_0x3f0f('0x38')]),_0x531b79);}});ami['on'](_0x3f0f('0x39'),function(_0x407a99){try{utils['debug'](util['format'](_0x3f0f('0x3a'),_0x407a99[_0x3f0f('0x1d')]),_0x407a99);queues['varset'](_0x407a99);recordings['varset'](_0x407a99);calls[_0x3f0f('0x39')](_0x407a99);dials[_0x3f0f('0x39')](_0x407a99);}catch(_0x548a9f){utils['error'](util[_0x3f0f('0x19')](_0x3f0f('0x3a'),_0x407a99[_0x3f0f('0x1d')]),_0x548a9f);}});ami['on'](_0x3f0f('0x3b'),function(_0x4414bd){try{utils['debug'](util[_0x3f0f('0x19')]('[%s][index][newexten]',_0x4414bd[_0x3f0f('0x1d')]),_0x4414bd);calls[_0x3f0f('0x3b')](_0x4414bd);recordings['newexten'](_0x4414bd);dials[_0x3f0f('0x3b')](_0x4414bd);}catch(_0x287ae3){utils[_0x3f0f('0x14')](util[_0x3f0f('0x19')]('[%s][index][newexten]',_0x4414bd[_0x3f0f('0x1d')]),_0x287ae3);}});ami['on'](_0x3f0f('0x3c'),function(_0xc34483){try{utils[_0x3f0f('0x18')](util[_0x3f0f('0x19')](_0x3f0f('0x3d'),_0xc34483[_0x3f0f('0x1d')]),_0xc34483);calls['newchannel'](_0xc34483);recordings[_0x3f0f('0x3c')](_0xc34483);}catch(_0x8cfa0c){utils[_0x3f0f('0x14')](util[_0x3f0f('0x19')](_0x3f0f('0x3d'),_0xc34483['uniqueid']),_0x8cfa0c);}});ami['on']('dialbegin',function(_0x25b502){try{utils[_0x3f0f('0x18')](util[_0x3f0f('0x19')]('[%s][index][dialbegin]',_0x25b502[_0x3f0f('0x1d')]),_0x25b502);dials['dialbegin'](_0x25b502);}catch(_0x444cc8){utils[_0x3f0f('0x14')](util[_0x3f0f('0x19')](_0x3f0f('0x3e'),_0x25b502[_0x3f0f('0x1d')]),_0x444cc8);}});ami['on'](_0x3f0f('0x3f'),function(_0x3df79e){try{utils[_0x3f0f('0x18')](util[_0x3f0f('0x19')](_0x3f0f('0x40'),_0x3df79e[_0x3f0f('0x1d')]),_0x3df79e);dials[_0x3f0f('0x3f')](_0x3df79e);}catch(_0x540045){utils[_0x3f0f('0x14')](util[_0x3f0f('0x19')](_0x3f0f('0x40'),_0x3df79e[_0x3f0f('0x1d')]),_0x540045);}});} \ No newline at end of file +var _0x2ce0=['uniqueid','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','devicestatechange','debug','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]'];(function(_0x814543,_0x8b8394){var _0xc6d327=function(_0x1a28c1){while(--_0x1a28c1){_0x814543['push'](_0x814543['shift']());}};_0xc6d327(++_0x8b8394);}(_0x2ce0,0x1c3));var _0x02ce=function(_0x34f6ec,_0x3a96ee){_0x34f6ec=_0x34f6ec-0x0;var _0x4eb74e=_0x2ce0[_0x34f6ec];return _0x4eb74e;};var AsteriskManager=require('asterisk-manager');var config=require(_0x02ce('0x0'));var utils=require(_0x02ce('0x1'));var util=require(_0x02ce('0x2'));var isXDREnabled=config['xdr']&&config[_0x02ce('0x3')]['disabled']?!config['xdr'][_0x02ce('0x4')]:!![];var isProduction=config[_0x02ce('0x5')]===_0x02ce('0x6')||![];var isLocalAsterisk=config[_0x02ce('0x3')]&&config[_0x02ce('0x3')][_0x02ce('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x02ce('0x8')][_0x02ce('0x9')],config['asterisk']['ip'],config[_0x02ce('0x8')][_0x02ce('0xa')],config[_0x02ce('0x8')][_0x02ce('0xb')],!![]);ami[_0x02ce('0xc')]();if(!isXDREnabled){utils[_0x02ce('0xd')](_0x02ce('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x02ce('0xd')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require(_0x02ce('0xf'));var queues=require(_0x02ce('0x10'));var recordings=require(_0x02ce('0x11'));var members=require(_0x02ce('0x12'));var dials=require(_0x02ce('0x13'));var transfers=require(_0x02ce('0x14'));var core=require('./core.controller');ami['on'](_0x02ce('0x15'),core[_0x02ce('0x15')]);ami['on'](_0x02ce('0x16'),core[_0x02ce('0x16')]);ami['on'](_0x02ce('0x17'),core[_0x02ce('0x17')]);ami['on'](_0x02ce('0x18'),core['error']);ami['on'](_0x02ce('0x19'),core[_0x02ce('0x19')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0x02ce('0x1a'),function(_0x136387){try{utils[_0x02ce('0x1b')](util[_0x02ce('0x1c')](_0x02ce('0x1d'),_0x136387['device']),_0x136387);members[_0x02ce('0x1a')](_0x136387);}catch(_0x3d371c){utils[_0x02ce('0x18')](util[_0x02ce('0x1c')](_0x02ce('0x1d'),_0x136387['device']),_0x3d371c);}});ami['on']('agentcalled',function(_0x5cfc0d){try{utils[_0x02ce('0x1b')](util[_0x02ce('0x1c')]('[%s][index][agentcalled]',_0x5cfc0d['uniqueid']),_0x5cfc0d);agents[_0x02ce('0x1e')](_0x5cfc0d);}catch(_0x27fa7b){utils[_0x02ce('0x18')](util['format'](_0x02ce('0x1f'),_0x5cfc0d[_0x02ce('0x20')]),_0x27fa7b);}});ami['on'](_0x02ce('0x21'),function(_0x369f4c){try{utils[_0x02ce('0x1b')](util[_0x02ce('0x1c')]('[%s][index][agentringnoanswer]',_0x369f4c[_0x02ce('0x20')]),_0x369f4c);agents[_0x02ce('0x21')](_0x369f4c);}catch(_0x2bea04){utils[_0x02ce('0x18')](util[_0x02ce('0x1c')]('[%s][index][agentringnoanswer]',_0x369f4c['uniqueid']),_0x2bea04);}});ami['on'](_0x02ce('0x22'),function(_0x3e2721){try{utils[_0x02ce('0x1b')](util['format'](_0x02ce('0x23'),_0x3e2721[_0x02ce('0x20')]),_0x3e2721);agents['agentconnect'](_0x3e2721);queues[_0x02ce('0x22')](_0x3e2721);}catch(_0x469c89){utils['error'](util[_0x02ce('0x1c')](_0x02ce('0x23'),_0x3e2721['uniqueid']),_0x469c89);}});ami['on'](_0x02ce('0x24'),function(_0x11712d){try{utils[_0x02ce('0x1b')](util[_0x02ce('0x1c')](_0x02ce('0x25'),_0x11712d['uniqueid']),_0x11712d);agents[_0x02ce('0x24')](_0x11712d);queues[_0x02ce('0x24')](_0x11712d);members[_0x02ce('0x24')](_0x11712d);}catch(_0x27a996){utils[_0x02ce('0x18')](util[_0x02ce('0x1c')]('[%s][index][agentcomplete]',_0x11712d[_0x02ce('0x20')]),_0x27a996);}});ami['on']('queuecallerabandon',function(_0x3cb5d7){try{utils['debug'](util[_0x02ce('0x1c')]('[%s][index][queuecallerabandon]',_0x3cb5d7[_0x02ce('0x20')]),_0x3cb5d7);agents[_0x02ce('0x26')](_0x3cb5d7);queues[_0x02ce('0x26')](_0x3cb5d7);}catch(_0x35b161){utils['error'](util['format'](_0x02ce('0x27'),_0x3cb5d7[_0x02ce('0x20')]),_0x35b161);}});ami['on'](_0x02ce('0x28'),function(_0x2b16fd){try{utils[_0x02ce('0x1b')](util[_0x02ce('0x1c')](_0x02ce('0x29'),_0x2b16fd[_0x02ce('0x20')]),_0x2b16fd);queues[_0x02ce('0x28')](_0x2b16fd);recordings[_0x02ce('0x28')](_0x2b16fd);}catch(_0x57609b){utils[_0x02ce('0x18')](util[_0x02ce('0x1c')](_0x02ce('0x29'),_0x2b16fd[_0x02ce('0x20')]),_0x57609b);}});ami['on'](_0x02ce('0x2a'),function(_0x119de1){try{utils['debug'](util[_0x02ce('0x1c')](_0x02ce('0x2b'),_0x119de1[_0x02ce('0x20')]),_0x119de1);queues['queuecallerleave'](_0x119de1);}catch(_0x189dc3){utils[_0x02ce('0x18')](util[_0x02ce('0x1c')](_0x02ce('0x2b'),_0x119de1['uniqueid']),_0x189dc3);}});ami['on'](_0x02ce('0x2c'),function(_0x3c6ed5){try{utils[_0x02ce('0x1b')](util[_0x02ce('0x1c')](_0x02ce('0x2d'),_0x3c6ed5[_0x02ce('0x20')]),_0x3c6ed5);queues[_0x02ce('0x2c')](_0x3c6ed5);calls[_0x02ce('0x2c')](_0x3c6ed5);}catch(_0x5e7f13){utils['error'](util[_0x02ce('0x1c')](_0x02ce('0x2d'),_0x3c6ed5[_0x02ce('0x20')]),_0x5e7f13);}});ami['on']('musiconholdstop',function(_0x5ad548){try{utils[_0x02ce('0x1b')](util[_0x02ce('0x1c')](_0x02ce('0x2e'),_0x5ad548['uniqueid']),_0x5ad548);queues['musiconholdstop'](_0x5ad548);calls[_0x02ce('0x2f')](_0x5ad548);}catch(_0x1b5e33){utils['error'](util[_0x02ce('0x1c')](_0x02ce('0x2e'),_0x5ad548[_0x02ce('0x20')]),_0x1b5e33);}});ami['on'](_0x02ce('0x30'),function(_0x26c27a){try{utils['debug'](util[_0x02ce('0x1c')]('[%s][index][newstate]',_0x26c27a[_0x02ce('0x20')]),_0x26c27a);calls[_0x02ce('0x30')](_0x26c27a);recordings[_0x02ce('0x30')](_0x26c27a);}catch(_0x38bd4b){utils['error'](util[_0x02ce('0x1c')](_0x02ce('0x31'),_0x26c27a[_0x02ce('0x20')]),_0x38bd4b);}});ami['on'](_0x02ce('0x32'),function(_0x138ffc){try{utils[_0x02ce('0x1b')](util[_0x02ce('0x1c')](_0x02ce('0x33'),_0x138ffc[_0x02ce('0x20')]),_0x138ffc);calls[_0x02ce('0x32')](_0x138ffc);recordings[_0x02ce('0x32')](_0x138ffc);dials[_0x02ce('0x32')](_0x138ffc);agents[_0x02ce('0x32')](_0x138ffc);queues[_0x02ce('0x32')](_0x138ffc);}catch(_0x5822d4){utils[_0x02ce('0x18')](util[_0x02ce('0x1c')]('[%s][index][hangup]',_0x138ffc[_0x02ce('0x20')]),_0x5822d4);}});ami['on'](_0x02ce('0x34'),function(_0x35aa0e){try{utils['debug'](util['format'](_0x02ce('0x35'),_0x35aa0e[_0x02ce('0x20')]),_0x35aa0e);members[_0x02ce('0x34')](_0x35aa0e);}catch(_0x51c1cb){utils[_0x02ce('0x18')](util[_0x02ce('0x1c')](_0x02ce('0x35'),_0x35aa0e[_0x02ce('0x20')]),_0x51c1cb);}});ami['on'](_0x02ce('0x36'),function(_0x2fe450){try{utils[_0x02ce('0x1b')](util['format']('[%s][index][blindtransfer]',_0x2fe450[_0x02ce('0x20')]),_0x2fe450);queues[_0x02ce('0x36')](_0x2fe450);agents[_0x02ce('0x36')](_0x2fe450);transfers['blindtransfer'](_0x2fe450);recordings[_0x02ce('0x36')](_0x2fe450);}catch(_0x5a6faf){utils[_0x02ce('0x18')](util[_0x02ce('0x1c')](_0x02ce('0x37'),_0x2fe450[_0x02ce('0x20')]),_0x5a6faf);}});ami['on'](_0x02ce('0x38'),function(_0x3550c2){try{utils['debug'](util['format'](_0x02ce('0x39'),_0x3550c2[_0x02ce('0x3a')]),_0x3550c2);queues[_0x02ce('0x38')](_0x3550c2);transfers['attendedtransfer'](_0x3550c2);agents[_0x02ce('0x38')](_0x3550c2);calls[_0x02ce('0x38')](_0x3550c2);}catch(_0x469cf5){utils['error'](util[_0x02ce('0x1c')]('[%s][index][attendedtransfer]',_0x3550c2['origtransfereruniqueid']),_0x469cf5);}});ami['on']('varset',function(_0x1078c7){try{utils[_0x02ce('0x1b')](util[_0x02ce('0x1c')]('[%s][index][varset]',_0x1078c7[_0x02ce('0x20')]),_0x1078c7);queues[_0x02ce('0x3b')](_0x1078c7);recordings[_0x02ce('0x3b')](_0x1078c7);calls['varset'](_0x1078c7);dials[_0x02ce('0x3b')](_0x1078c7);}catch(_0x13521e){utils[_0x02ce('0x18')](util[_0x02ce('0x1c')]('[%s][index][varset]',_0x1078c7[_0x02ce('0x20')]),_0x13521e);}});ami['on'](_0x02ce('0x3c'),function(_0x349ffd){try{utils[_0x02ce('0x1b')](util[_0x02ce('0x1c')]('[%s][index][newexten]',_0x349ffd[_0x02ce('0x20')]),_0x349ffd);calls['newexten'](_0x349ffd);recordings[_0x02ce('0x3c')](_0x349ffd);dials[_0x02ce('0x3c')](_0x349ffd);}catch(_0x34b6bd){utils['error'](util['format'](_0x02ce('0x3d'),_0x349ffd[_0x02ce('0x20')]),_0x34b6bd);}});ami['on'](_0x02ce('0x3e'),function(_0x4339e0){try{utils[_0x02ce('0x1b')](util[_0x02ce('0x1c')](_0x02ce('0x3f'),_0x4339e0['uniqueid']),_0x4339e0);calls[_0x02ce('0x3e')](_0x4339e0);recordings[_0x02ce('0x3e')](_0x4339e0);}catch(_0x4c5cc7){utils[_0x02ce('0x18')](util[_0x02ce('0x1c')](_0x02ce('0x3f'),_0x4339e0[_0x02ce('0x20')]),_0x4c5cc7);}});ami['on'](_0x02ce('0x40'),function(_0x3acdf3){try{utils[_0x02ce('0x1b')](util[_0x02ce('0x1c')](_0x02ce('0x41'),_0x3acdf3[_0x02ce('0x20')]),_0x3acdf3);dials['dialbegin'](_0x3acdf3);}catch(_0x2ec710){utils[_0x02ce('0x18')](util[_0x02ce('0x1c')](_0x02ce('0x42'),_0x3acdf3['uniqueid']),_0x2ec710);}});ami['on']('dialend',function(_0x49ea2d){try{utils[_0x02ce('0x1b')](util[_0x02ce('0x1c')]('[%s][index][dialend]',_0x49ea2d[_0x02ce('0x20')]),_0x49ea2d);dials[_0x02ce('0x43')](_0x49ea2d);}catch(_0x2bc86e){utils[_0x02ce('0x18')](util['format'](_0x02ce('0x44'),_0x49ea2d[_0x02ce('0x20')]),_0x2bc86e);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 15da294..2cacf0c 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 _0x330c=['getUserByInterface','then','membername','internal','request','getUserByName','split','name','catch','[%s][members][writeDB]','some','startsWith','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','error','channel','data1','data2','source','destination','data3','destinationchannel','lodash','util','./utils','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','type'];(function(_0x16b890,_0x47cffe){var _0x102297=function(_0x16db1f){while(--_0x16db1f){_0x16b890['push'](_0x16b890['shift']());}};_0x102297(++_0x47cffe);}(_0x330c,0x186));var _0xc330=function(_0x12fded,_0x3aa1ec){_0x12fded=_0x12fded-0x0;var _0x4b0956=_0x330c[_0x12fded];return _0x4b0956;};'use strict';var _=require(_0xc330('0x0'));var util=require(_0xc330('0x1'));var utils=require(_0xc330('0x2'));var members={};var exclude=[_0xc330('0x3'),'Queue:'];function writeDB(_0x17e47c){utils[_0xc330('0x4')](util[_0xc330('0x5')](_0xc330('0x6'),_0x17e47c[_0xc330('0x7')],_0x17e47c[_0xc330('0x8')],_0x17e47c['channel'],_0x17e47c['data2'],_0x17e47c['membername'],_0x17e47c[_0xc330('0x9')]));if(_0x17e47c[_0xc330('0x8')]){utils[_0xc330('0xa')](_0x17e47c[_0xc330('0x8')])[_0xc330('0xb')](function(_0x18ffbe){if(_0x18ffbe){_0x17e47c[_0xc330('0xc')]=_0x18ffbe['name'];_0x17e47c[_0xc330('0xd')]=_0x18ffbe[_0xc330('0xd')];utils[_0xc330('0xe')]('CreateMemberReport',_0x17e47c);}else{utils[_0xc330('0xf')](_0x17e47c[_0xc330('0x8')][_0xc330('0x10')]('/')[0x1])[_0xc330('0xb')](function(_0x40f26d){if(_0x40f26d){_0x17e47c[_0xc330('0xc')]=_0x40f26d[_0xc330('0x11')];_0x17e47c[_0xc330('0xd')]=_0x40f26d[_0xc330('0xd')];utils['request']('CreateMemberReport',_0x17e47c);}});}})[_0xc330('0x12')](function(_0x1c559b){utils['error'](util[_0xc330('0x5')](_0xc330('0x13'),_0x17e47c[_0xc330('0x7')]),_0x1c559b);});}delete members[_0x17e47c[_0xc330('0x8')]];}function startsWith(_0x37675c,_0xdd6f7f){return _[_0xc330('0x14')](_0x37675c,function(_0x28d4ee){return _[_0xc330('0x15')](_0xdd6f7f,_0x28d4ee);});}exports['devicestatechange']=function(_0x1dae13){try{utils[_0xc330('0x16')](util['format'](_0xc330('0x17'),members[_0x1dae13[_0xc330('0x18')]]?members[_0x1dae13[_0xc330('0x18')]][_0xc330('0x7')]:_0x1dae13[_0xc330('0x18')]),_0x1dae13);utils['info'](util[_0xc330('0x5')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x1dae13[_0xc330('0x18')]]?members[_0x1dae13[_0xc330('0x18')]][_0xc330('0x7')]:_0x1dae13[_0xc330('0x18')],_0x1dae13[_0xc330('0x19')],_0x1dae13[_0xc330('0x18')]));switch(_0x1dae13[_0xc330('0x19')]){case _0xc330('0x1a'):case _0xc330('0x1b'):if(!startsWith(exclude,_0x1dae13[_0xc330('0x18')])){members[_0x1dae13['device']]={'channel':'voice','interface':_0x1dae13[_0xc330('0x18')],'type':_0xc330('0x1c'),'enterAt':utils[_0xc330('0x1d')](),'role':_0xc330('0x1e')};}break;case _0xc330('0x1f'):if(!_[_0xc330('0x20')](members[_0x1dae13[_0xc330('0x18')]])){members[_0x1dae13[_0xc330('0x18')]][_0xc330('0x21')]=utils[_0xc330('0x1d')]();members[_0x1dae13[_0xc330('0x18')]][_0xc330('0x22')]=utils[_0xc330('0x23')](members[_0x1dae13['device']][_0xc330('0x21')],members[_0x1dae13['device']][_0xc330('0x24')]);if(members[_0x1dae13[_0xc330('0x18')]][_0xc330('0x7')]){writeDB(members[_0x1dae13['device']]);}}break;default:break;}}catch(_0x503281){utils['error'](util['format']('[%s][members][devicestatechange]',members[_0x1dae13[_0xc330('0x18')]]?members[_0x1dae13[_0xc330('0x18')]][_0xc330('0x7')]:_0x1dae13[_0xc330('0x18')]),_0x503281);}};exports[_0xc330('0x25')]=function(_0x1982f4){try{if(!_['isNil'](members[_0x1982f4[_0xc330('0x8')]])){utils['debug'](util[_0xc330('0x5')](_0xc330('0x26'),_0x1982f4[_0xc330('0x7')]),_0x1982f4);utils[_0xc330('0x4')](util['format'](_0xc330('0x27'),_0x1982f4[_0xc330('0x7')],_0x1982f4[_0xc330('0x8')],_0x1982f4['queue']));members[_0x1982f4[_0xc330('0x8')]]=_[_0xc330('0x28')](members[_0x1982f4['interface']],{'data4':_0x1982f4[_0xc330('0x29')],'uniqueid':_0x1982f4[_0xc330('0x7')]});}}catch(_0x281517){utils[_0xc330('0x2a')](util[_0xc330('0x5')](_0xc330('0x26'),_0x1982f4[_0xc330('0x7')]),_0x281517);}};exports['cdr']=function(_0x181099){try{utils[_0xc330('0x16')](util['format']('[%s][members][cdr]',_0x181099['uniqueid']),_0x181099);if(_0x181099['channel']){var _0x4c925e=_0x181099[_0xc330('0x2b')][_0xc330('0x10')]('-')[0x0];if(!_['isNil'](members[_0x4c925e])){members[_0x4c925e]=_[_0xc330('0x28')](members[_0x4c925e],{'data1':members[_0x4c925e][_0xc330('0x2c')]||_0x181099[_0xc330('0x9')],'data2':members[_0x4c925e][_0xc330('0x2d')]||_0x181099[_0xc330('0x2e')],'data3':members[_0x4c925e]['data3']||_0x181099[_0xc330('0x2f')],'uniqueid':members[_0x4c925e]['uniqueid']||_0x181099[_0xc330('0x7')]});utils['info'](util[_0xc330('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x181099['uniqueid'],members[_0x4c925e][_0xc330('0x2c')],members[_0x4c925e][_0xc330('0x2d')],members[_0x4c925e][_0xc330('0x30')]));if(members[_0x4c925e][_0xc330('0x21')]){writeDB(members[_0x4c925e]);}}}if(_0x181099[_0xc330('0x31')]){var _0x4473c8=_0x181099[_0xc330('0x31')][_0xc330('0x10')]('-')[0x0];if(!_[_0xc330('0x20')](members[_0x4473c8])){members[_0x4473c8]=_[_0xc330('0x28')](members[_0x4473c8],{'data1':members[_0x4473c8][_0xc330('0x2c')]||_0x181099['type'],'data2':members[_0x4473c8][_0xc330('0x2d')]||_0x181099[_0xc330('0x2e')],'data3':members[_0x4473c8][_0xc330('0x30')]||_0x181099['destination'],'uniqueid':members[_0x4473c8][_0xc330('0x7')]||_0x181099['uniqueid']});utils[_0xc330('0x4')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x181099['uniqueid'],members[_0x4473c8]['data1'],members[_0x4473c8][_0xc330('0x2d')],members[_0x4473c8][_0xc330('0x30')]));if(members[_0x4473c8][_0xc330('0x21')]){writeDB(members[_0x4473c8]);}}}}catch(_0x3d6bad){utils[_0xc330('0x2a')](util['format']('[%s][members][cdr]',_0x181099['uniqueid']),_0x3d6bad);}}; \ No newline at end of file +var _0x82c0=['exitAt','now','duration','diffTime','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','channel','split','assign','data1','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','Local/_attended@transfer','Queue:','info','uniqueid','interface','data2','getUserByInterface','membername','name','internal','CreateMemberReport','getUserByName','then','request','error','format','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','agent','NOT_INUSE','isNil'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x82c0,0xe8));var _0x082c=function(_0x4066fa,_0x233fc8){_0x4066fa=_0x4066fa-0x0;var _0x5c356b=_0x82c0[_0x4066fa];return _0x5c356b;};'use strict';var _=require(_0x082c('0x0'));var util=require(_0x082c('0x1'));var utils=require('./utils');var members={};var exclude=[_0x082c('0x2'),_0x082c('0x3')];function writeDB(_0x3b5501){utils[_0x082c('0x4')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x3b5501[_0x082c('0x5')],_0x3b5501[_0x082c('0x6')],_0x3b5501['channel'],_0x3b5501[_0x082c('0x7')],_0x3b5501['membername'],_0x3b5501['type']));if(_0x3b5501[_0x082c('0x6')]){utils[_0x082c('0x8')](_0x3b5501[_0x082c('0x6')])['then'](function(_0xc2baa6){if(_0xc2baa6){_0x3b5501[_0x082c('0x9')]=_0xc2baa6[_0x082c('0xa')];_0x3b5501[_0x082c('0xb')]=_0xc2baa6[_0x082c('0xb')];utils['request'](_0x082c('0xc'),_0x3b5501);}else{utils[_0x082c('0xd')](_0x3b5501[_0x082c('0x6')]['split']('/')[0x1])[_0x082c('0xe')](function(_0x507f53){if(_0x507f53){_0x3b5501[_0x082c('0x9')]=_0x507f53[_0x082c('0xa')];_0x3b5501['internal']=_0x507f53['internal'];utils[_0x082c('0xf')](_0x082c('0xc'),_0x3b5501);}});}})['catch'](function(_0x14eb7d){utils[_0x082c('0x10')](util[_0x082c('0x11')](_0x082c('0x12'),_0x3b5501[_0x082c('0x5')]),_0x14eb7d);});}delete members[_0x3b5501['interface']];}function startsWith(_0x1e0e5c,_0x1b03aa){return _[_0x082c('0x13')](_0x1e0e5c,function(_0x481ec6){return _[_0x082c('0x14')](_0x1b03aa,_0x481ec6);});}exports[_0x082c('0x15')]=function(_0x267f70){try{utils[_0x082c('0x16')](util[_0x082c('0x11')](_0x082c('0x17'),members[_0x267f70[_0x082c('0x18')]]?members[_0x267f70[_0x082c('0x18')]][_0x082c('0x5')]:_0x267f70[_0x082c('0x18')]),_0x267f70);utils['info'](util[_0x082c('0x11')](_0x082c('0x19'),members[_0x267f70[_0x082c('0x18')]]?members[_0x267f70[_0x082c('0x18')]][_0x082c('0x5')]:_0x267f70[_0x082c('0x18')],_0x267f70[_0x082c('0x1a')],_0x267f70['device']));switch(_0x267f70[_0x082c('0x1a')]){case _0x082c('0x1b'):case _0x082c('0x1c'):if(!startsWith(exclude,_0x267f70[_0x082c('0x18')])){members[_0x267f70[_0x082c('0x18')]]={'channel':'voice','interface':_0x267f70[_0x082c('0x18')],'type':_0x082c('0x1d'),'enterAt':utils['now'](),'role':_0x082c('0x1e')};}break;case _0x082c('0x1f'):if(!_[_0x082c('0x20')](members[_0x267f70[_0x082c('0x18')]])){members[_0x267f70['device']][_0x082c('0x21')]=utils[_0x082c('0x22')]();members[_0x267f70[_0x082c('0x18')]][_0x082c('0x23')]=utils[_0x082c('0x24')](members[_0x267f70[_0x082c('0x18')]][_0x082c('0x21')],members[_0x267f70[_0x082c('0x18')]][_0x082c('0x25')]);if(members[_0x267f70[_0x082c('0x18')]][_0x082c('0x5')]){writeDB(members[_0x267f70['device']]);}}break;default:break;}}catch(_0xe2410f){utils[_0x082c('0x10')](util[_0x082c('0x11')](_0x082c('0x17'),members[_0x267f70[_0x082c('0x18')]]?members[_0x267f70[_0x082c('0x18')]]['uniqueid']:_0x267f70[_0x082c('0x18')]),_0xe2410f);}};exports['agentcomplete']=function(_0x284e6e){try{if(!_['isNil'](members[_0x284e6e[_0x082c('0x6')]])){utils[_0x082c('0x16')](util['format'](_0x082c('0x26'),_0x284e6e['uniqueid']),_0x284e6e);utils[_0x082c('0x4')](util[_0x082c('0x11')](_0x082c('0x27'),_0x284e6e[_0x082c('0x5')],_0x284e6e[_0x082c('0x6')],_0x284e6e[_0x082c('0x28')]));members[_0x284e6e[_0x082c('0x6')]]=_['assign'](members[_0x284e6e[_0x082c('0x6')]],{'data4':_0x284e6e['queue'],'uniqueid':_0x284e6e[_0x082c('0x5')]});}}catch(_0x47b7b7){utils[_0x082c('0x10')](util[_0x082c('0x11')](_0x082c('0x26'),_0x284e6e['uniqueid']),_0x47b7b7);}};exports[_0x082c('0x29')]=function(_0x1cb1ca){try{utils[_0x082c('0x16')](util[_0x082c('0x11')](_0x082c('0x2a'),_0x1cb1ca['uniqueid']),_0x1cb1ca);if(_0x1cb1ca[_0x082c('0x2b')]){var _0x509b50=_0x1cb1ca[_0x082c('0x2b')][_0x082c('0x2c')]('-')[0x0];if(!_[_0x082c('0x20')](members[_0x509b50])){members[_0x509b50]=_[_0x082c('0x2d')](members[_0x509b50],{'data1':members[_0x509b50][_0x082c('0x2e')]||_0x1cb1ca[_0x082c('0x2f')],'data2':members[_0x509b50][_0x082c('0x7')]||_0x1cb1ca[_0x082c('0x30')],'data3':members[_0x509b50][_0x082c('0x31')]||_0x1cb1ca[_0x082c('0x32')],'uniqueid':members[_0x509b50][_0x082c('0x5')]||_0x1cb1ca[_0x082c('0x5')]});utils['info'](util[_0x082c('0x11')](_0x082c('0x33'),_0x1cb1ca[_0x082c('0x5')],members[_0x509b50][_0x082c('0x2e')],members[_0x509b50][_0x082c('0x7')],members[_0x509b50]['data3']));if(members[_0x509b50]['exitAt']){writeDB(members[_0x509b50]);}}}if(_0x1cb1ca[_0x082c('0x34')]){var _0x55fd32=_0x1cb1ca['destinationchannel'][_0x082c('0x2c')]('-')[0x0];if(!_[_0x082c('0x20')](members[_0x55fd32])){members[_0x55fd32]=_[_0x082c('0x2d')](members[_0x55fd32],{'data1':members[_0x55fd32]['data1']||_0x1cb1ca[_0x082c('0x2f')],'data2':members[_0x55fd32]['data2']||_0x1cb1ca[_0x082c('0x30')],'data3':members[_0x55fd32][_0x082c('0x31')]||_0x1cb1ca[_0x082c('0x32')],'uniqueid':members[_0x55fd32][_0x082c('0x5')]||_0x1cb1ca[_0x082c('0x5')]});utils[_0x082c('0x4')](util[_0x082c('0x11')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1cb1ca['uniqueid'],members[_0x55fd32][_0x082c('0x2e')],members[_0x55fd32][_0x082c('0x7')],members[_0x55fd32][_0x082c('0x31')]));if(members[_0x55fd32][_0x082c('0x21')]){writeDB(members[_0x55fd32]);}}}}catch(_0x4b9bec){utils['error'](util['format'](_0x082c('0x2a'),_0x1cb1ca['uniqueid']),_0x4b9bec);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index ceba211..d241329 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 _0x6975=['[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','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','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','varset','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandon','queuecallerexitAt','value','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]'];(function(_0x47e6c5,_0x43d0ce){var _0x4ec5ad=function(_0x4b6154){while(--_0x4b6154){_0x47e6c5['push'](_0x47e6c5['shift']());}};_0x4ec5ad(++_0x43d0ce);}(_0x6975,0x16c));var _0x5697=function(_0x5958d2,_0x550300){_0x5958d2=_0x5958d2-0x0;var _0x2a4809=_0x6975[_0x5958d2];return _0x2a4809;};'use strict';var _=require(_0x5697('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x4d701f){utils['info'](util[_0x5697('0x1')](_0x5697('0x2'),_0x4d701f[_0x5697('0x3')],_0x4d701f[_0x5697('0x4')],_0x4d701f[_0x5697('0x5')],_0x4d701f[_0x5697('0x6')],_0x4d701f[_0x5697('0x7')],_0x4d701f[_0x5697('0x8')],_0x4d701f[_0x5697('0x9')]));if(_0x4d701f[_0x5697('0x5')]){utils['getVoiceQueueByName'](_0x4d701f[_0x5697('0x5')])[_0x5697('0xa')](function(_0x55b34f){if(_0x55b34f){_0x4d701f[_0x5697('0xb')]=_0x55b34f[_0x5697('0xb')];}utils[_0x5697('0xc')](_0x5697('0xd'),_0x4d701f);});}else{utils['request']('CreateVoiceQueueReport',_0x4d701f);}if(_0x4d701f['transfereduniqueid']){delete queues[_0x4d701f[_0x5697('0xe')]];}else{delete queues[_0x4d701f[_0x5697('0x3')]];}}exports[_0x5697('0xf')]=function(_0x3e542c){try{utils[_0x5697('0x10')](util[_0x5697('0x1')](_0x5697('0x11'),_0x3e542c['uniqueid']),_0x3e542c);utils[_0x5697('0x12')](util['format'](_0x5697('0x13'),_0x3e542c[_0x5697('0x3')],_0x3e542c[_0x5697('0x5')],_0x3e542c[_0x5697('0x14')]));queues[_0x3e542c['uniqueid']]=_[_0x5697('0x15')](_0x3e542c,{'originalposition':_0x3e542c[_0x5697('0x14')],'queuecallerjoinAt':utils[_0x5697('0x16')](),'mohtime':0x0});}catch(_0x3d09cb){utils['error'](util[_0x5697('0x1')](_0x5697('0x11'),_0x3e542c['uniqueid']),_0x3d09cb);}};exports[_0x5697('0x17')]=function(_0x507a58){try{if(!_[_0x5697('0x18')](queues[_0x507a58[_0x5697('0x3')]])){utils[_0x5697('0x10')](util[_0x5697('0x1')](_0x5697('0x19'),_0x507a58['uniqueid']),_0x507a58);if(queues[_0x507a58[_0x5697('0x3')]][_0x5697('0x1a')]){if(!queues[_0x507a58['uniqueid']]['queuecallerabandon']&&!queues[_0x507a58['uniqueid']][_0x5697('0x1b')]){queues[_0x507a58[_0x5697('0x3')]][_0x5697('0x1c')]=!![];queues[_0x507a58[_0x5697('0x3')]][_0x5697('0x1d')]=utils[_0x5697('0x16')]();queues[_0x507a58['uniqueid']]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0x5697('0x12')](util[_0x5697('0x1')](_0x5697('0x1e'),_0x507a58[_0x5697('0x3')],queues[_0x507a58[_0x5697('0x3')]][_0x5697('0x1f')],queues[_0x507a58[_0x5697('0x3')]][_0x5697('0x9')]));writeDB(queues[_0x507a58[_0x5697('0x3')]]);}else if(queues[_0x507a58[_0x5697('0x3')]][_0x5697('0xe')]){utils[_0x5697('0x12')](util[_0x5697('0x1')](_0x5697('0x20'),_0x507a58[_0x5697('0x3')],queues[_0x507a58[_0x5697('0x3')]]['name'],queues[_0x507a58[_0x5697('0x3')]][_0x5697('0xe')]));queues[queues[_0x507a58[_0x5697('0x3')]][_0x5697('0xe')]]=queues[_0x507a58[_0x5697('0x3')]];queues[queues[_0x507a58[_0x5697('0x3')]]['transfereduniqueid']][_0x5697('0x21')]=0x2;delete queues[_0x507a58[_0x5697('0x3')]];}}}catch(_0x2b8e73){utils[_0x5697('0x22')](util[_0x5697('0x1')](_0x5697('0x19'),_0x507a58[_0x5697('0x3')]),_0x2b8e73);}};exports[_0x5697('0x23')]=function(_0x2b455c){try{utils[_0x5697('0x10')](util['format'](_0x5697('0x24'),_0x2b455c[_0x5697('0x3')]),_0x2b455c);if(!_[_0x5697('0x18')](_0x2b455c[_0x5697('0x25')][_0x5697('0x26')])&&_0x2b455c['value'][_0x5697('0x27')]()!==_0x5697('0x28')){if(!_[_0x5697('0x18')](queues[_0x2b455c['uniqueid']])){queues[_0x2b455c['uniqueid']][_0x5697('0x29')]=![];queues[_0x2b455c[_0x5697('0x3')]]['queuecallerabandonAt']=null;queues[_0x2b455c[_0x5697('0x3')]][_0x5697('0x1b')]=!![];queues[_0x2b455c['uniqueid']][_0x5697('0x2a')]=utils[_0x5697('0x16')]();queues[_0x2b455c[_0x5697('0x3')]]['queuecallerexitreason']=_0x2b455c[_0x5697('0x2b')][_0x5697('0x27')]();utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x2b455c[_0x5697('0x3')],queues[_0x2b455c['uniqueid']][_0x5697('0x1f')],_0x2b455c[_0x5697('0x2b')],queues[_0x2b455c[_0x5697('0x3')]][_0x5697('0x9')]));writeDB(queues[_0x2b455c[_0x5697('0x3')]]);}}else if(!_[_0x5697('0x18')](_0x2b455c[_0x5697('0x25')][_0x5697('0x2c')])){if(!_[_0x5697('0x18')](queues[_0x2b455c[_0x5697('0x3')]])&&!queues[_0x2b455c[_0x5697('0x3')]][_0x5697('0x29')]){queues[_0x2b455c[_0x5697('0x3')]][_0x5697('0x29')]=![];queues[_0x2b455c[_0x5697('0x3')]][_0x5697('0x2d')]=null;queues[_0x2b455c['uniqueid']]['queuecallerexit']=!![];queues[_0x2b455c[_0x5697('0x3')]][_0x5697('0x2a')]=utils[_0x5697('0x16')]();queues[_0x2b455c[_0x5697('0x3')]]['queuecallerexitreason']=_0x5697('0x2e');utils['info'](util[_0x5697('0x1')](_0x5697('0x2f'),_0x2b455c['uniqueid'],queues[_0x2b455c['uniqueid']][_0x5697('0x1f')],_0x2b455c[_0x5697('0x2b')],queues[_0x2b455c['uniqueid']][_0x5697('0x9')]));}}}catch(_0x377938){utils['error'](util[_0x5697('0x1')](_0x5697('0x24'),_0x2b455c['uniqueid']),_0x377938);}};exports[_0x5697('0x29')]=function(_0x539725){try{if(!_[_0x5697('0x18')](queues[_0x539725[_0x5697('0x3')]])){utils[_0x5697('0x10')](util[_0x5697('0x1')]('[%s][queues][queuecallerabandon]',_0x539725[_0x5697('0x3')]),_0x539725);queues[_0x539725['uniqueid']][_0x5697('0x1b')]=![];queues[_0x539725['uniqueid']]['queuecallerexitAt']=null;queues[_0x539725[_0x5697('0x3')]][_0x5697('0x29')]=!![];queues[_0x539725['uniqueid']][_0x5697('0x2d')]=utils[_0x5697('0x16')]();queues[_0x539725[_0x5697('0x3')]][_0x5697('0x9')]=_0x5697('0x30');utils[_0x5697('0x12')](util[_0x5697('0x1')](_0x5697('0x31'),_0x539725[_0x5697('0x3')],queues[_0x539725[_0x5697('0x3')]][_0x5697('0x1f')],queues[_0x539725[_0x5697('0x3')]][_0x5697('0x9')]));}}catch(_0x40699f){utils[_0x5697('0x22')](util[_0x5697('0x1')]('[%s][queues][queuecallerabandon]',_0x539725[_0x5697('0x3')]),_0x40699f);}};exports[_0x5697('0x32')]=function(_0x4f1e6d){try{if(!_[_0x5697('0x18')](queues[_0x4f1e6d[_0x5697('0x3')]])){utils['debug'](util[_0x5697('0x1')](_0x5697('0x33'),_0x4f1e6d[_0x5697('0x3')]),_0x4f1e6d);utils[_0x5697('0x12')](util[_0x5697('0x1')](_0x5697('0x34'),_0x4f1e6d[_0x5697('0x3')],queues[_0x4f1e6d[_0x5697('0x3')]][_0x5697('0x1f')],_0x4f1e6d[_0x5697('0x35')],_0x4f1e6d[_0x5697('0x36')]));queues[_0x4f1e6d[_0x5697('0x3')]][_0x5697('0x32')]=!![];queues[_0x4f1e6d[_0x5697('0x3')]][_0x5697('0x1a')]=utils[_0x5697('0x16')]();queues[_0x4f1e6d[_0x5697('0x3')]]['holdtime']=utils[_0x5697('0x37')](queues[_0x4f1e6d[_0x5697('0x3')]]['queuecallerleaveAt'],queues[_0x4f1e6d[_0x5697('0x3')]][_0x5697('0x38')]);queues[_0x4f1e6d[_0x5697('0x3')]]['position']=_0x4f1e6d[_0x5697('0x14')];queues[_0x4f1e6d[_0x5697('0x3')]][_0x5697('0x39')]=_0x4f1e6d[_0x5697('0x39')];queues[_0x4f1e6d[_0x5697('0x3')]]['connectedlinenum']=_0x4f1e6d[_0x5697('0x35')];queues[_0x4f1e6d[_0x5697('0x3')]]['connectedlinename']=_0x4f1e6d[_0x5697('0x36')];}}catch(_0x31acf3){utils[_0x5697('0x22')](util[_0x5697('0x1')](_0x5697('0x33'),_0x4f1e6d['uniqueid']),_0x31acf3);}};exports[_0x5697('0x3a')]=function(_0x22e388){try{if(!_[_0x5697('0x18')](queues[_0x22e388[_0x5697('0x3')]])){utils[_0x5697('0x10')](util[_0x5697('0x1')](_0x5697('0x3b'),_0x22e388['uniqueid']),_0x22e388);utils[_0x5697('0x12')](util[_0x5697('0x1')](_0x5697('0x3c'),_0x22e388['uniqueid'],queues[_0x22e388[_0x5697('0x3')]][_0x5697('0x1f')],_0x22e388[_0x5697('0x3d')],_0x22e388['destaccountcode']));queues[_0x22e388[_0x5697('0x3')]][_0x5697('0x29')]=![];queues[_0x22e388['uniqueid']][_0x5697('0x29')]=![];queues[_0x22e388[_0x5697('0x3')]][_0x5697('0x2d')]=null;queues[_0x22e388[_0x5697('0x3')]]['queuecallerexit']=![];queues[_0x22e388['uniqueid']][_0x5697('0x9')]=null;queues[_0x22e388['uniqueid']][_0x5697('0x2a')]=null;queues[_0x22e388[_0x5697('0x3')]][_0x5697('0x3e')]=!![];queues[_0x22e388[_0x5697('0x3')]][_0x5697('0x8')]=_0x22e388[_0x5697('0x3f')];queues[_0x22e388[_0x5697('0x3')]][_0x5697('0x6')]=_0x22e388[_0x5697('0x3d')];}}catch(_0x107467){utils[_0x5697('0x22')](util[_0x5697('0x1')](_0x5697('0x3b'),_0x22e388['uniqueid']),_0x107467);}};exports[_0x5697('0x40')]=function(_0x4033b0){try{if(!_[_0x5697('0x18')](queues[_0x4033b0['uniqueid']])){if(queues[_0x4033b0[_0x5697('0x3')]]['queuecallerleaveAt']){utils[_0x5697('0x10')](util['format']('[%s][queues][agentcomplete]',_0x4033b0[_0x5697('0x3')]),_0x4033b0);queues[_0x4033b0[_0x5697('0x3')]]['queuecallerabandon']=![];queues[_0x4033b0[_0x5697('0x3')]][_0x5697('0x29')]=![];queues[_0x4033b0[_0x5697('0x3')]][_0x5697('0x2d')]=null;queues[_0x4033b0[_0x5697('0x3')]]['queuecallerexit']=![];queues[_0x4033b0[_0x5697('0x3')]][_0x5697('0x2a')]=null;queues[_0x4033b0[_0x5697('0x3')]][_0x5697('0x3e')]=!![];queues[_0x4033b0['uniqueid']][_0x5697('0x6')]=_0x4033b0[_0x5697('0x3d')];queues[_0x4033b0[_0x5697('0x3')]]['queuecallercomplete']=!![];queues[_0x4033b0[_0x5697('0x3')]][_0x5697('0x1d')]=utils['now']();if(_0x4033b0[_0x5697('0x41')]==_0x5697('0x42')){if(!queues[_0x4033b0[_0x5697('0x3')]][_0x5697('0x42')]){queues[_0x4033b0[_0x5697('0x3')]]['queuecallerexitreason']=_0x5697('0x43');}}else{queues[_0x4033b0[_0x5697('0x3')]]['queuecallerexitreason']=_0x5697('0x44')+_0x4033b0[_0x5697('0x41')][_0x5697('0x27')]();}utils[_0x5697('0x12')](util[_0x5697('0x1')](_0x5697('0x45'),_0x4033b0[_0x5697('0x3')],queues[_0x4033b0['uniqueid']][_0x5697('0x1f')],_0x4033b0[_0x5697('0x3d')],queues[_0x4033b0[_0x5697('0x3')]][_0x5697('0x9')]));writeDB(queues[_0x4033b0[_0x5697('0x3')]]);}}}catch(_0x3527b1){utils['error'](util['format'](_0x5697('0x46'),_0x4033b0['uniqueid']),_0x3527b1);}};exports['blindtransfer']=function(_0x37803f){try{if(!_[_0x5697('0x18')](queues[_0x37803f[_0x5697('0x47')]])){utils['debug'](util[_0x5697('0x1')]('[%s][queues][blindtransfer]',_0x37803f[_0x5697('0x3')]),_0x37803f);queues[_0x37803f[_0x5697('0x47')]]['transfer']=!![];queues[_0x37803f[_0x5697('0x47')]][_0x5697('0x48')]=_0x5697('0x49');queues[_0x37803f['transfereeuniqueid']][_0x5697('0x4a')]=_0x37803f[_0x5697('0x4b')];queues[_0x37803f[_0x5697('0x47')]][_0x5697('0x4c')]=_0x37803f[_0x5697('0x47')];queues[_0x37803f[_0x5697('0x47')]][_0x5697('0x9')]=_0x5697('0x4d');utils[_0x5697('0x12')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x37803f[_0x5697('0x3')],queues[_0x37803f['transfereeuniqueid']]['name'],_0x37803f['transfereeuniqueid'],_0x37803f[_0x5697('0x4b')]));}}catch(_0x1a44bd){utils[_0x5697('0x22')](util[_0x5697('0x1')](_0x5697('0x4e'),_0x37803f[_0x5697('0x3')]),_0x1a44bd);}};exports[_0x5697('0x4f')]=function(_0x4c1b63){try{utils[_0x5697('0x10')](util['format'](_0x5697('0x50'),_0x4c1b63['origtransfereruniqueid']),_0x4c1b63);if(_0x4c1b63[_0x5697('0x51')]==_0x4c1b63[_0x5697('0x52')]){if(!_[_0x5697('0x18')](queues[_0x4c1b63[_0x5697('0x53')]])){utils[_0x5697('0x12')](util[_0x5697('0x1')](_0x5697('0x54'),_0x4c1b63[_0x5697('0x51')],queues[_0x4c1b63[_0x5697('0x53')]][_0x5697('0x1f')],_0x4c1b63['origtransfererexten']));queues[_0x4c1b63[_0x5697('0x53')]][_0x5697('0x42')]=!![];queues[_0x4c1b63[_0x5697('0x53')]][_0x5697('0x48')]=_0x5697('0x55');queues[_0x4c1b63[_0x5697('0x53')]]['transferexten']=_0x4c1b63[_0x5697('0x56')];queues[_0x4c1b63[_0x5697('0x53')]]['transferuniqueid']=_0x4c1b63['origtransfereruniqueid'];queues[_0x4c1b63['secondtransfererlinkedid']]['queuecallerexitreason']=_0x5697('0x57');}if(!_[_0x5697('0x18')](queues[_0x4c1b63['origtransfererlinkedid']])){if(_0x4c1b63[_0x5697('0x58')]&&queues[_0x4c1b63[_0x5697('0x58')]]){queues[_0x4c1b63[_0x5697('0x58')]][_0x5697('0x21')]=0x1;queues[_0x4c1b63['transfereeuniqueid']]=_[_0x5697('0x59')](queues[_0x4c1b63[_0x5697('0x58')]]);queues[_0x4c1b63['transfereeuniqueid']][_0x5697('0xe')]=_0x4c1b63[_0x5697('0x5a')];queues[_0x4c1b63[_0x5697('0x47')]]['queuecallerenterreason']=0x2;queues[_0x4c1b63[_0x5697('0x47')]][_0x5697('0x7')]=queues[_0x4c1b63[_0x5697('0x53')]]['calleridnum'];queues[_0x4c1b63['transfereeuniqueid']]['calleridname']=queues[_0x4c1b63['secondtransfererlinkedid']][_0x5697('0x5b')];queues[_0x4c1b63[_0x5697('0x47')]]['queuecallerjoinAt']=utils['now']();queues[_0x4c1b63[_0x5697('0x47')]][_0x5697('0x1a')]=utils[_0x5697('0x16')]();queues[_0x4c1b63[_0x5697('0x47')]]['holdtime']=0x0;queues[_0x4c1b63[_0x5697('0x47')]]['mohtime']=0x0;utils[_0x5697('0x12')](util[_0x5697('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x4c1b63[_0x5697('0x51')],queues[_0x4c1b63[_0x5697('0x47')]][_0x5697('0x1f')],queues[_0x4c1b63[_0x5697('0x47')]][_0x5697('0x7')],queues[_0x4c1b63[_0x5697('0x47')]][_0x5697('0x5b')]));}else{utils['info'](util[_0x5697('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4c1b63[_0x5697('0x51')],queues[_0x4c1b63[_0x5697('0x52')]][_0x5697('0x1f')],_0x4c1b63['secondtransfererlinkedid']));queues[_0x4c1b63[_0x5697('0x52')]][_0x5697('0xe')]=_0x4c1b63['secondtransfererlinkedid'];}}}else if(_0x4c1b63[_0x5697('0x5c')]==_0x4c1b63[_0x5697('0x53')]){if(!_[_0x5697('0x18')](queues[_0x4c1b63[_0x5697('0x52')]])){utils[_0x5697('0x12')](util[_0x5697('0x1')](_0x5697('0x5d'),_0x4c1b63[_0x5697('0x51')],queues[_0x4c1b63['origtransfererlinkedid']]['name'],_0x4c1b63[_0x5697('0x5c')],_0x4c1b63[_0x5697('0x5e')]));queues[_0x4c1b63[_0x5697('0x52')]]['transfer']=!![];queues[_0x4c1b63[_0x5697('0x52')]][_0x5697('0x48')]=_0x5697('0x55');queues[_0x4c1b63[_0x5697('0x52')]][_0x5697('0x4a')]=_0x4c1b63['secondtransfererexten'];queues[_0x4c1b63[_0x5697('0x52')]][_0x5697('0x4c')]=_0x4c1b63[_0x5697('0x5c')];queues[_0x4c1b63['origtransfererlinkedid']][_0x5697('0x9')]=_0x5697('0x57');}if(!_[_0x5697('0x18')](queues[_0x4c1b63[_0x5697('0x53')]])){if(_0x4c1b63[_0x5697('0x5f')]&&queues[_0x4c1b63[_0x5697('0x5f')]]){queues[_0x4c1b63[_0x5697('0x5f')]]['queuecallerenterreason']=0x1;queues[_0x4c1b63['transfertargetuniqueid']]=_['clone'](queues[_0x4c1b63[_0x5697('0x5f')]]);queues[_0x4c1b63[_0x5697('0x5a')]][_0x5697('0xe')]=_0x4c1b63[_0x5697('0x5a')];queues[_0x4c1b63[_0x5697('0x5a')]]['queuecallerenterreason']=0x2;queues[_0x4c1b63[_0x5697('0x5a')]][_0x5697('0x7')]=queues[_0x4c1b63[_0x5697('0x52')]][_0x5697('0x7')];queues[_0x4c1b63[_0x5697('0x5a')]][_0x5697('0x5b')]=queues[_0x4c1b63[_0x5697('0x52')]]['calleridname'];queues[_0x4c1b63[_0x5697('0x5a')]][_0x5697('0x38')]=utils[_0x5697('0x16')]();queues[_0x4c1b63['transfertargetuniqueid']][_0x5697('0x1a')]=utils['now']();queues[_0x4c1b63[_0x5697('0x5a')]][_0x5697('0x60')]=0x0;queues[_0x4c1b63['transfertargetuniqueid']][_0x5697('0x61')]=0x0;utils[_0x5697('0x12')](util[_0x5697('0x1')](_0x5697('0x62'),_0x4c1b63[_0x5697('0x51')],queues[_0x4c1b63[_0x5697('0x5a')]][_0x5697('0x1f')],queues[_0x4c1b63[_0x5697('0x5a')]][_0x5697('0xe')],queues[_0x4c1b63[_0x5697('0x5a')]]['calleridnum'],queues[_0x4c1b63[_0x5697('0x5a')]][_0x5697('0x5b')]));}else{utils[_0x5697('0x12')](util[_0x5697('0x1')](_0x5697('0x63'),_0x4c1b63[_0x5697('0x51')],queues[_0x4c1b63[_0x5697('0x53')]][_0x5697('0x1f')],_0x4c1b63['origtransfererlinkedid']));queues[_0x4c1b63[_0x5697('0x53')]][_0x5697('0xe')]=_0x4c1b63[_0x5697('0x52')];}}}}catch(_0x4d17ae){utils['error'](util[_0x5697('0x1')](_0x5697('0x50'),_0x4c1b63[_0x5697('0x51')]),_0x4d17ae);}};exports['musiconholdstart']=function(_0x2c873d){try{if(!_[_0x5697('0x18')](queues[_0x2c873d[_0x5697('0x3')]])){utils[_0x5697('0x10')](util[_0x5697('0x1')](_0x5697('0x64'),_0x2c873d[_0x5697('0x3')]),_0x2c873d);queues[_0x2c873d[_0x5697('0x3')]][_0x5697('0x65')]=utils[_0x5697('0x16')]();utils['info'](util[_0x5697('0x1')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x2c873d[_0x5697('0x3')],queues[_0x2c873d[_0x5697('0x3')]][_0x5697('0x1f')],queues[_0x2c873d[_0x5697('0x3')]][_0x5697('0x65')]));}}catch(_0x543338){utils['error'](util[_0x5697('0x1')](_0x5697('0x64'),_0x2c873d[_0x5697('0x3')]),_0x543338);}};exports['musiconholdstop']=function(_0x5d6814){try{if(!_[_0x5697('0x18')](queues[_0x5d6814['uniqueid']])){if(!_['isNil'](queues[_0x5d6814[_0x5697('0x3')]]['musiconholdstartAt'])){utils[_0x5697('0x10')](util[_0x5697('0x1')]('[%s][queues][musiconholdstop]',_0x5d6814[_0x5697('0x3')]),_0x5d6814);queues[_0x5d6814[_0x5697('0x3')]][_0x5697('0x61')]+=utils[_0x5697('0x37')](utils[_0x5697('0x16')](),queues[_0x5d6814[_0x5697('0x3')]][_0x5697('0x65')]);utils[_0x5697('0x12')](util[_0x5697('0x1')](_0x5697('0x66'),_0x5d6814['uniqueid'],queues[_0x5d6814[_0x5697('0x3')]][_0x5697('0x1f')],queues[_0x5d6814['uniqueid']]['mohtime']));delete queues[_0x5d6814[_0x5697('0x3')]][_0x5697('0x65')];}}}catch(_0x5e8034){utils[_0x5697('0x22')](util['format'](_0x5697('0x67'),_0x5d6814['uniqueid']),_0x5e8034);}}; \ No newline at end of file +var _0x9974=['now','hangup','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','error','[%s][queues][hangup]','varset','debug','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','isNil','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','accountcode','[%s][queues][agentcomplete]','transfer','TRANSFER','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfereruniqueid','origtransfererexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','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','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','assign','position'];(function(_0x1f28e5,_0x4bcc70){var _0x43de71=function(_0x5432d0){while(--_0x5432d0){_0x1f28e5['push'](_0x1f28e5['shift']());}};_0x43de71(++_0x4bcc70);}(_0x9974,0xbc));var _0x4997=function(_0x40a3c1,_0x1095d){_0x40a3c1=_0x40a3c1-0x0;var _0x536a99=_0x9974[_0x40a3c1];return _0x536a99;};'use strict';var _=require(_0x4997('0x0'));var util=require(_0x4997('0x1'));var utils=require(_0x4997('0x2'));var queues={};function writeDB(_0x28dbad){utils[_0x4997('0x3')](util[_0x4997('0x4')](_0x4997('0x5'),_0x28dbad[_0x4997('0x6')],_0x28dbad[_0x4997('0x7')],_0x28dbad[_0x4997('0x8')],_0x28dbad[_0x4997('0x9')],_0x28dbad[_0x4997('0xa')],_0x28dbad['accountcode'],_0x28dbad[_0x4997('0xb')]));if(_0x28dbad[_0x4997('0x8')]){utils[_0x4997('0xc')](_0x28dbad['queue'])[_0x4997('0xd')](function(_0x17f3f8){if(_0x17f3f8){_0x28dbad[_0x4997('0xe')]=_0x17f3f8['type'];}utils[_0x4997('0xf')]('CreateVoiceQueueReport',_0x28dbad);});}else{utils[_0x4997('0xf')](_0x4997('0x10'),_0x28dbad);}if(_0x28dbad[_0x4997('0x11')]){delete queues[_0x28dbad[_0x4997('0x11')]];}else{delete queues[_0x28dbad[_0x4997('0x6')]];}}exports[_0x4997('0x12')]=function(_0x34b9fb){try{utils['debug'](util[_0x4997('0x4')](_0x4997('0x13'),_0x34b9fb[_0x4997('0x6')]),_0x34b9fb);utils[_0x4997('0x3')](util[_0x4997('0x4')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x34b9fb['uniqueid'],_0x34b9fb[_0x4997('0x8')],_0x34b9fb['position']));queues[_0x34b9fb[_0x4997('0x6')]]=_[_0x4997('0x14')](_0x34b9fb,{'originalposition':_0x34b9fb[_0x4997('0x15')],'queuecallerjoinAt':utils[_0x4997('0x16')](),'mohtime':0x0});}catch(_0x119d53){utils['error'](util[_0x4997('0x4')](_0x4997('0x13'),_0x34b9fb[_0x4997('0x6')]),_0x119d53);}};exports[_0x4997('0x17')]=function(_0x172e1f){try{if(!_['isNil'](queues[_0x172e1f[_0x4997('0x6')]])){utils['debug'](util['format']('[%s][queues][hangup]',_0x172e1f[_0x4997('0x6')]),_0x172e1f);if(queues[_0x172e1f[_0x4997('0x6')]][_0x4997('0x18')]){if(!queues[_0x172e1f[_0x4997('0x6')]][_0x4997('0x19')]&&!queues[_0x172e1f['uniqueid']][_0x4997('0x1a')]){queues[_0x172e1f['uniqueid']][_0x4997('0x1b')]=!![];queues[_0x172e1f['uniqueid']][_0x4997('0x1c')]=utils['now']();queues[_0x172e1f[_0x4997('0x6')]][_0x4997('0xb')]=_0x4997('0x1d');}utils[_0x4997('0x3')](util['format'](_0x4997('0x1e'),_0x172e1f['uniqueid'],queues[_0x172e1f[_0x4997('0x6')]]['name'],queues[_0x172e1f['uniqueid']][_0x4997('0xb')]));writeDB(queues[_0x172e1f['uniqueid']]);}else if(queues[_0x172e1f['uniqueid']][_0x4997('0x11')]){utils[_0x4997('0x3')](util[_0x4997('0x4')](_0x4997('0x1f'),_0x172e1f[_0x4997('0x6')],queues[_0x172e1f['uniqueid']][_0x4997('0x20')],queues[_0x172e1f['uniqueid']][_0x4997('0x11')]));queues[queues[_0x172e1f[_0x4997('0x6')]]['transfereduniqueid']]=queues[_0x172e1f[_0x4997('0x6')]];queues[queues[_0x172e1f['uniqueid']][_0x4997('0x11')]][_0x4997('0x21')]=0x2;delete queues[_0x172e1f[_0x4997('0x6')]];}}}catch(_0x43f7c8){utils[_0x4997('0x22')](util[_0x4997('0x4')](_0x4997('0x23'),_0x172e1f[_0x4997('0x6')]),_0x43f7c8);}};exports[_0x4997('0x24')]=function(_0x599e77){try{utils[_0x4997('0x25')](util[_0x4997('0x4')](_0x4997('0x26'),_0x599e77[_0x4997('0x6')]),_0x599e77);if(!_['isNil'](_0x599e77[_0x4997('0x27')][_0x4997('0x28')])&&_0x599e77[_0x4997('0x29')][_0x4997('0x2a')]()!=='CONTINUE'){if(!_[_0x4997('0x2b')](queues[_0x599e77[_0x4997('0x6')]])){queues[_0x599e77[_0x4997('0x6')]][_0x4997('0x19')]=![];queues[_0x599e77[_0x4997('0x6')]][_0x4997('0x2c')]=null;queues[_0x599e77[_0x4997('0x6')]][_0x4997('0x1a')]=!![];queues[_0x599e77['uniqueid']][_0x4997('0x2d')]=utils[_0x4997('0x16')]();queues[_0x599e77[_0x4997('0x6')]][_0x4997('0xb')]=_0x599e77[_0x4997('0x29')][_0x4997('0x2a')]();utils[_0x4997('0x3')](util[_0x4997('0x4')](_0x4997('0x2e'),_0x599e77[_0x4997('0x6')],queues[_0x599e77['uniqueid']][_0x4997('0x20')],_0x599e77['value'],queues[_0x599e77[_0x4997('0x6')]][_0x4997('0xb')]));writeDB(queues[_0x599e77[_0x4997('0x6')]]);}}else if(!_[_0x4997('0x2b')](_0x599e77[_0x4997('0x27')][_0x4997('0x2f')])){if(!_['isNil'](queues[_0x599e77[_0x4997('0x6')]])&&!queues[_0x599e77[_0x4997('0x6')]][_0x4997('0x19')]){queues[_0x599e77[_0x4997('0x6')]][_0x4997('0x19')]=![];queues[_0x599e77[_0x4997('0x6')]][_0x4997('0x2c')]=null;queues[_0x599e77[_0x4997('0x6')]]['queuecallerexit']=!![];queues[_0x599e77[_0x4997('0x6')]][_0x4997('0x2d')]=utils[_0x4997('0x16')]();queues[_0x599e77[_0x4997('0x6')]][_0x4997('0xb')]=_0x4997('0x30');utils['info'](util[_0x4997('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x599e77['uniqueid'],queues[_0x599e77[_0x4997('0x6')]][_0x4997('0x20')],_0x599e77['value'],queues[_0x599e77[_0x4997('0x6')]][_0x4997('0xb')]));}}}catch(_0x5c206d){utils[_0x4997('0x22')](util[_0x4997('0x4')](_0x4997('0x26'),_0x599e77[_0x4997('0x6')]),_0x5c206d);}};exports['queuecallerabandon']=function(_0x14e242){try{if(!_[_0x4997('0x2b')](queues[_0x14e242[_0x4997('0x6')]])){utils['debug'](util[_0x4997('0x4')](_0x4997('0x31'),_0x14e242['uniqueid']),_0x14e242);queues[_0x14e242[_0x4997('0x6')]]['queuecallerexit']=![];queues[_0x14e242[_0x4997('0x6')]][_0x4997('0x2d')]=null;queues[_0x14e242[_0x4997('0x6')]]['queuecallerabandon']=!![];queues[_0x14e242[_0x4997('0x6')]]['queuecallerabandonAt']=utils[_0x4997('0x16')]();queues[_0x14e242['uniqueid']][_0x4997('0xb')]=_0x4997('0x32');utils[_0x4997('0x3')](util['format'](_0x4997('0x33'),_0x14e242[_0x4997('0x6')],queues[_0x14e242['uniqueid']][_0x4997('0x20')],queues[_0x14e242[_0x4997('0x6')]][_0x4997('0xb')]));}}catch(_0x182544){utils['error'](util[_0x4997('0x4')]('[%s][queues][queuecallerabandon]',_0x14e242[_0x4997('0x6')]),_0x182544);}};exports[_0x4997('0x34')]=function(_0x149c01){try{if(!_[_0x4997('0x2b')](queues[_0x149c01[_0x4997('0x6')]])){utils[_0x4997('0x25')](util[_0x4997('0x4')](_0x4997('0x35'),_0x149c01[_0x4997('0x6')]),_0x149c01);utils[_0x4997('0x3')](util[_0x4997('0x4')](_0x4997('0x36'),_0x149c01['uniqueid'],queues[_0x149c01[_0x4997('0x6')]][_0x4997('0x20')],_0x149c01[_0x4997('0x37')],_0x149c01['connectedlinename']));queues[_0x149c01['uniqueid']]['queuecallerleave']=!![];queues[_0x149c01['uniqueid']]['queuecallerleaveAt']=utils[_0x4997('0x16')]();queues[_0x149c01[_0x4997('0x6')]][_0x4997('0x38')]=utils[_0x4997('0x39')](queues[_0x149c01[_0x4997('0x6')]]['queuecallerleaveAt'],queues[_0x149c01[_0x4997('0x6')]][_0x4997('0x3a')]);queues[_0x149c01[_0x4997('0x6')]]['position']=_0x149c01[_0x4997('0x15')];queues[_0x149c01['uniqueid']][_0x4997('0x3b')]=_0x149c01[_0x4997('0x3b')];queues[_0x149c01['uniqueid']][_0x4997('0x37')]=_0x149c01[_0x4997('0x37')];queues[_0x149c01[_0x4997('0x6')]]['connectedlinename']=_0x149c01[_0x4997('0x3c')];}}catch(_0x43d10a){utils[_0x4997('0x22')](util[_0x4997('0x4')]('[%s][queues][queuecallerleave]',_0x149c01['uniqueid']),_0x43d10a);}};exports[_0x4997('0x3d')]=function(_0x5ba6f5){try{if(!_[_0x4997('0x2b')](queues[_0x5ba6f5[_0x4997('0x6')]])){utils['debug'](util['format'](_0x4997('0x3e'),_0x5ba6f5[_0x4997('0x6')]),_0x5ba6f5);utils[_0x4997('0x3')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x5ba6f5[_0x4997('0x6')],queues[_0x5ba6f5['uniqueid']][_0x4997('0x20')],_0x5ba6f5[_0x4997('0x3f')],_0x5ba6f5[_0x4997('0x40')]));queues[_0x5ba6f5['uniqueid']]['queuecallerabandon']=![];queues[_0x5ba6f5[_0x4997('0x6')]][_0x4997('0x19')]=![];queues[_0x5ba6f5['uniqueid']][_0x4997('0x2c')]=null;queues[_0x5ba6f5[_0x4997('0x6')]][_0x4997('0x1a')]=![];queues[_0x5ba6f5[_0x4997('0x6')]][_0x4997('0xb')]=null;queues[_0x5ba6f5[_0x4997('0x6')]][_0x4997('0x2d')]=null;queues[_0x5ba6f5['uniqueid']][_0x4997('0x41')]=!![];queues[_0x5ba6f5[_0x4997('0x6')]][_0x4997('0x42')]=_0x5ba6f5[_0x4997('0x40')];queues[_0x5ba6f5[_0x4997('0x6')]][_0x4997('0x9')]=_0x5ba6f5[_0x4997('0x3f')];}}catch(_0x501d57){utils[_0x4997('0x22')](util[_0x4997('0x4')]('[%s][queues][agentconnect]',_0x5ba6f5[_0x4997('0x6')]),_0x501d57);}};exports['agentcomplete']=function(_0x5edf57){try{if(!_[_0x4997('0x2b')](queues[_0x5edf57[_0x4997('0x6')]])){if(queues[_0x5edf57[_0x4997('0x6')]][_0x4997('0x18')]){utils[_0x4997('0x25')](util[_0x4997('0x4')](_0x4997('0x43'),_0x5edf57[_0x4997('0x6')]),_0x5edf57);queues[_0x5edf57[_0x4997('0x6')]][_0x4997('0x19')]=![];queues[_0x5edf57[_0x4997('0x6')]]['queuecallerabandon']=![];queues[_0x5edf57[_0x4997('0x6')]][_0x4997('0x2c')]=null;queues[_0x5edf57[_0x4997('0x6')]][_0x4997('0x1a')]=![];queues[_0x5edf57['uniqueid']][_0x4997('0x2d')]=null;queues[_0x5edf57[_0x4997('0x6')]][_0x4997('0x41')]=!![];queues[_0x5edf57[_0x4997('0x6')]][_0x4997('0x9')]=_0x5edf57[_0x4997('0x3f')];queues[_0x5edf57[_0x4997('0x6')]][_0x4997('0x1b')]=!![];queues[_0x5edf57[_0x4997('0x6')]]['queuecallercompleteAt']=utils['now']();if(_0x5edf57['reason']=='transfer'){if(!queues[_0x5edf57[_0x4997('0x6')]][_0x4997('0x44')]){queues[_0x5edf57[_0x4997('0x6')]][_0x4997('0xb')]=_0x4997('0x45');}}else{queues[_0x5edf57[_0x4997('0x6')]][_0x4997('0xb')]='COMPLETEDBY'+_0x5edf57['reason'][_0x4997('0x2a')]();}utils[_0x4997('0x3')](util[_0x4997('0x4')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x5edf57[_0x4997('0x6')],queues[_0x5edf57[_0x4997('0x6')]]['name'],_0x5edf57[_0x4997('0x3f')],queues[_0x5edf57['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x5edf57[_0x4997('0x6')]]);}}}catch(_0x3b571c){utils['error'](util[_0x4997('0x4')]('[%s][queues][agentcomplete]',_0x5edf57[_0x4997('0x6')]),_0x3b571c);}};exports[_0x4997('0x46')]=function(_0x28aa24){try{if(!_['isNil'](queues[_0x28aa24['transfereeuniqueid']])){utils[_0x4997('0x25')](util[_0x4997('0x4')](_0x4997('0x47'),_0x28aa24[_0x4997('0x6')]),_0x28aa24);queues[_0x28aa24[_0x4997('0x48')]]['transfer']=!![];queues[_0x28aa24[_0x4997('0x48')]][_0x4997('0x49')]=_0x4997('0x4a');queues[_0x28aa24[_0x4997('0x48')]][_0x4997('0x4b')]=_0x28aa24[_0x4997('0x4c')];queues[_0x28aa24[_0x4997('0x48')]][_0x4997('0x4d')]=_0x28aa24['transfereeuniqueid'];queues[_0x28aa24[_0x4997('0x48')]][_0x4997('0xb')]=_0x4997('0x4e');utils[_0x4997('0x3')](util[_0x4997('0x4')](_0x4997('0x4f'),_0x28aa24[_0x4997('0x6')],queues[_0x28aa24[_0x4997('0x48')]]['name'],_0x28aa24['transfereeuniqueid'],_0x28aa24['extension']));}}catch(_0x13eb3d){utils[_0x4997('0x22')](util[_0x4997('0x4')](_0x4997('0x47'),_0x28aa24[_0x4997('0x6')]),_0x13eb3d);}};exports['attendedtransfer']=function(_0x2738ca){try{utils['debug'](util[_0x4997('0x4')](_0x4997('0x50'),_0x2738ca['origtransfereruniqueid']),_0x2738ca);if(_0x2738ca['origtransfereruniqueid']==_0x2738ca['origtransfererlinkedid']){if(!_[_0x4997('0x2b')](queues[_0x2738ca[_0x4997('0x51')]])){utils['info'](util['format'](_0x4997('0x52'),_0x2738ca[_0x4997('0x53')],queues[_0x2738ca[_0x4997('0x51')]][_0x4997('0x20')],_0x2738ca[_0x4997('0x54')]));queues[_0x2738ca[_0x4997('0x51')]]['transfer']=!![];queues[_0x2738ca['secondtransfererlinkedid']][_0x4997('0x49')]='ATTENDED';queues[_0x2738ca[_0x4997('0x51')]][_0x4997('0x4b')]=_0x2738ca['origtransfererexten'];queues[_0x2738ca[_0x4997('0x51')]][_0x4997('0x4d')]=_0x2738ca[_0x4997('0x53')];queues[_0x2738ca[_0x4997('0x51')]][_0x4997('0xb')]=_0x4997('0x55');}if(!_[_0x4997('0x2b')](queues[_0x2738ca[_0x4997('0x56')]])){if(_0x2738ca[_0x4997('0x57')]&&queues[_0x2738ca[_0x4997('0x57')]]){queues[_0x2738ca[_0x4997('0x57')]][_0x4997('0x21')]=0x1;queues[_0x2738ca[_0x4997('0x48')]]=_[_0x4997('0x58')](queues[_0x2738ca[_0x4997('0x57')]]);queues[_0x2738ca['transfereeuniqueid']][_0x4997('0x11')]=_0x2738ca['transfertargetuniqueid'];queues[_0x2738ca[_0x4997('0x48')]][_0x4997('0x21')]=0x2;queues[_0x2738ca[_0x4997('0x48')]][_0x4997('0xa')]=queues[_0x2738ca[_0x4997('0x51')]][_0x4997('0xa')];queues[_0x2738ca[_0x4997('0x48')]][_0x4997('0x59')]=queues[_0x2738ca['secondtransfererlinkedid']][_0x4997('0x59')];queues[_0x2738ca[_0x4997('0x48')]][_0x4997('0x3a')]=utils['now']();queues[_0x2738ca[_0x4997('0x48')]][_0x4997('0x18')]=utils[_0x4997('0x16')]();queues[_0x2738ca[_0x4997('0x48')]]['holdtime']=0x0;queues[_0x2738ca['transfereeuniqueid']][_0x4997('0x5a')]=0x0;utils['info'](util[_0x4997('0x4')](_0x4997('0x5b'),_0x2738ca[_0x4997('0x53')],queues[_0x2738ca['transfereeuniqueid']][_0x4997('0x20')],queues[_0x2738ca[_0x4997('0x48')]][_0x4997('0xa')],queues[_0x2738ca[_0x4997('0x48')]][_0x4997('0x59')]));}else{utils[_0x4997('0x3')](util['format'](_0x4997('0x5c'),_0x2738ca['origtransfereruniqueid'],queues[_0x2738ca[_0x4997('0x56')]][_0x4997('0x20')],_0x2738ca[_0x4997('0x51')]));queues[_0x2738ca[_0x4997('0x56')]][_0x4997('0x11')]=_0x2738ca[_0x4997('0x51')];}}}else if(_0x2738ca[_0x4997('0x5d')]==_0x2738ca[_0x4997('0x51')]){if(!_[_0x4997('0x2b')](queues[_0x2738ca[_0x4997('0x56')]])){utils[_0x4997('0x3')](util['format'](_0x4997('0x5e'),_0x2738ca['origtransfereruniqueid'],queues[_0x2738ca['origtransfererlinkedid']]['name'],_0x2738ca[_0x4997('0x5d')],_0x2738ca[_0x4997('0x5f')]));queues[_0x2738ca[_0x4997('0x56')]][_0x4997('0x44')]=!![];queues[_0x2738ca[_0x4997('0x56')]][_0x4997('0x49')]=_0x4997('0x60');queues[_0x2738ca['origtransfererlinkedid']][_0x4997('0x4b')]=_0x2738ca['secondtransfererexten'];queues[_0x2738ca[_0x4997('0x56')]][_0x4997('0x4d')]=_0x2738ca[_0x4997('0x5d')];queues[_0x2738ca[_0x4997('0x56')]]['queuecallerexitreason']=_0x4997('0x55');}if(!_[_0x4997('0x2b')](queues[_0x2738ca['secondtransfererlinkedid']])){if(_0x2738ca[_0x4997('0x61')]&&queues[_0x2738ca[_0x4997('0x61')]]){queues[_0x2738ca[_0x4997('0x61')]]['queuecallerenterreason']=0x1;queues[_0x2738ca[_0x4997('0x62')]]=_[_0x4997('0x58')](queues[_0x2738ca['transfertargetlinkedid']]);queues[_0x2738ca[_0x4997('0x62')]][_0x4997('0x11')]=_0x2738ca[_0x4997('0x62')];queues[_0x2738ca[_0x4997('0x62')]][_0x4997('0x21')]=0x2;queues[_0x2738ca[_0x4997('0x62')]][_0x4997('0xa')]=queues[_0x2738ca[_0x4997('0x56')]]['calleridnum'];queues[_0x2738ca[_0x4997('0x62')]][_0x4997('0x59')]=queues[_0x2738ca['origtransfererlinkedid']][_0x4997('0x59')];queues[_0x2738ca['transfertargetuniqueid']][_0x4997('0x3a')]=utils['now']();queues[_0x2738ca[_0x4997('0x62')]][_0x4997('0x18')]=utils[_0x4997('0x16')]();queues[_0x2738ca[_0x4997('0x62')]][_0x4997('0x38')]=0x0;queues[_0x2738ca[_0x4997('0x62')]]['mohtime']=0x0;utils[_0x4997('0x3')](util[_0x4997('0x4')](_0x4997('0x63'),_0x2738ca[_0x4997('0x53')],queues[_0x2738ca['transfertargetuniqueid']][_0x4997('0x20')],queues[_0x2738ca[_0x4997('0x62')]][_0x4997('0x11')],queues[_0x2738ca[_0x4997('0x62')]]['calleridnum'],queues[_0x2738ca[_0x4997('0x62')]][_0x4997('0x59')]));}else{utils[_0x4997('0x3')](util[_0x4997('0x4')](_0x4997('0x5c'),_0x2738ca[_0x4997('0x53')],queues[_0x2738ca['secondtransfererlinkedid']][_0x4997('0x20')],_0x2738ca['origtransfererlinkedid']));queues[_0x2738ca[_0x4997('0x51')]]['transfereduniqueid']=_0x2738ca[_0x4997('0x56')];}}}}catch(_0x5de117){utils['error'](util[_0x4997('0x4')](_0x4997('0x50'),_0x2738ca[_0x4997('0x53')]),_0x5de117);}};exports['musiconholdstart']=function(_0x488d4a){try{if(!_[_0x4997('0x2b')](queues[_0x488d4a[_0x4997('0x6')]])){utils[_0x4997('0x25')](util[_0x4997('0x4')]('[%s][queues][musiconholdstart]',_0x488d4a[_0x4997('0x6')]),_0x488d4a);queues[_0x488d4a[_0x4997('0x6')]][_0x4997('0x64')]=utils['now']();utils['info'](util['format'](_0x4997('0x65'),_0x488d4a[_0x4997('0x6')],queues[_0x488d4a['uniqueid']][_0x4997('0x20')],queues[_0x488d4a[_0x4997('0x6')]]['musiconholdstartAt']));}}catch(_0x33dd61){utils[_0x4997('0x22')](util[_0x4997('0x4')](_0x4997('0x66'),_0x488d4a[_0x4997('0x6')]),_0x33dd61);}};exports[_0x4997('0x67')]=function(_0x5e2bd7){try{if(!_['isNil'](queues[_0x5e2bd7[_0x4997('0x6')]])){if(!_[_0x4997('0x2b')](queues[_0x5e2bd7[_0x4997('0x6')]][_0x4997('0x64')])){utils[_0x4997('0x25')](util['format']('[%s][queues][musiconholdstop]',_0x5e2bd7[_0x4997('0x6')]),_0x5e2bd7);queues[_0x5e2bd7[_0x4997('0x6')]][_0x4997('0x5a')]+=utils[_0x4997('0x39')](utils[_0x4997('0x16')](),queues[_0x5e2bd7['uniqueid']][_0x4997('0x64')]);utils[_0x4997('0x3')](util[_0x4997('0x4')](_0x4997('0x68'),_0x5e2bd7[_0x4997('0x6')],queues[_0x5e2bd7['uniqueid']]['name'],queues[_0x5e2bd7[_0x4997('0x6')]][_0x4997('0x5a')]));delete queues[_0x5e2bd7[_0x4997('0x6')]][_0x4997('0x64')];}}}catch(_0x5e925b){utils['error'](util[_0x4997('0x4')]('[%s][queues][musiconholdstop]',_0x5e2bd7[_0x4997('0x6')]),_0x5e925b);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index c2ed262..ac376a9 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 _0x061a=['[%s][recordings][queuecallerjoin]','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','newstate','[%s][recordings][newstate]','isNil','channel','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','endsWith','value','replace','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue'];(function(_0x4f0489,_0x588f18){var _0x5efd9d=function(_0x2632dc){while(--_0x2632dc){_0x4f0489['push'](_0x4f0489['shift']());}};_0x5efd9d(++_0x588f18);}(_0x061a,0x199));var _0xa061=function(_0x3910e1,_0xb72415){_0x3910e1=_0x3910e1-0x0;var _0x1f2d16=_0x061a[_0x3910e1];return _0x1f2d16;};'use strict';var _=require(_0xa061('0x0'));var util=require(_0xa061('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x25466f){var _0x22b87d;utils[_0xa061('0x2')](util[_0xa061('0x3')](_0xa061('0x4'),_0x25466f[_0xa061('0x5')]));if(transfers[_0xa061('0x6')][_0x25466f[_0xa061('0x5')]]){_0x22b87d=_0x25466f[_0xa061('0x5')];_0x25466f[_0xa061('0x5')]=transfers[_0xa061('0x6')][_0x25466f[_0xa061('0x5')]][_0xa061('0x7')];}if(_0x25466f[_0xa061('0x8')]){utils[_0xa061('0x9')](_0x25466f[_0xa061('0x8')])[_0xa061('0xa')](function(_0x4e00a3){if(_0x4e00a3){_0x25466f[_0xa061('0xb')]=_0x4e00a3[_0xa061('0xc')];_0x25466f[_0xa061('0xd')]=_0x4e00a3['id'];}utils['request'](_0xa061('0xe'),_0x25466f);});}else{utils['request'](_0xa061('0xe'),_0x25466f);}if(_0x22b87d)delete transfers[_0xa061('0x6')][_0x22b87d];}exports[_0xa061('0xf')]=function(_0x52974e){try{utils[_0xa061('0x10')](util[_0xa061('0x3')](_0xa061('0x11'),_0x52974e[_0xa061('0x5')]),_0x52974e);if(_0x52974e['uniqueid']==_0x52974e['linkedid']){utils[_0xa061('0x2')](util[_0xa061('0x3')](_0xa061('0x12'),_0x52974e['uniqueid'],_0x52974e[_0xa061('0x13')],_0x52974e['exten']));recordings[_0x52974e[_0xa061('0x5')]]={'uniqueid':_0x52974e['uniqueid'],'accountcode':_0x52974e['accountcode'],'exten':_0x52974e[_0xa061('0x14')],'context':_0x52974e[_0xa061('0x13')],'channel':_0x52974e['channel'],'monitors':[]};}}catch(_0x201cd3){utils['error'](util[_0xa061('0x3')]('[%s][recordings][newchannel]',_0x52974e[_0xa061('0x5')]),_0x201cd3);}};exports[_0xa061('0x15')]=function(_0x2fe1ab){try{utils['debug'](util[_0xa061('0x3')](_0xa061('0x16'),_0x2fe1ab[_0xa061('0x5')]),_0x2fe1ab);if(!_[_0xa061('0x17')](recordings[_0x2fe1ab[_0xa061('0x5')]])&&_0x2fe1ab['channelstate']==0x6){utils['info'](util[_0xa061('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x2fe1ab[_0xa061('0x5')],_0x2fe1ab[_0xa061('0x13')],_0x2fe1ab[_0xa061('0x18')]));}else if(!_[_0xa061('0x17')](recordings[_0x2fe1ab['linkedid']])&&_0x2fe1ab['channelstate']==0x6&&_0x2fe1ab['context']!='transfer'){utils[_0xa061('0x2')](util[_0xa061('0x3')](_0xa061('0x19'),_0x2fe1ab['uniqueid'],_0x2fe1ab['linkedid'],_0x2fe1ab[_0xa061('0x13')],_0x2fe1ab[_0xa061('0x18')]));recordings[_0x2fe1ab[_0xa061('0x1a')]]['accountcode']=_0x2fe1ab['accountcode'];}}catch(_0x1923fe){utils[_0xa061('0x1b')](util[_0xa061('0x3')](_0xa061('0x16'),_0x2fe1ab[_0xa061('0x5')]),_0x1923fe);}};exports[_0xa061('0x1c')]=function(_0x2c7647){try{if(!_['isNil'](_0x2c7647['variable'])&&!_['isNil'](_0x2c7647[_0xa061('0x1d')][_0xa061('0x1e')])){utils[_0xa061('0x10')](util[_0xa061('0x3')](_0xa061('0x1f'),_0x2c7647[_0xa061('0x5')]),_0x2c7647);utils['info'](util[_0xa061('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x2c7647[_0xa061('0x5')],_0x2c7647[_0xa061('0x1d')],_0x2c7647['value']));if(_[_0xa061('0x20')](_0x2c7647[_0xa061('0x21')],'.wav49')){_0x2c7647[_0xa061('0x21')]=_0x2c7647['value'][_0xa061('0x22')]('.wav49','.WAV');}if(recordings[_0x2c7647[_0xa061('0x1a')]]){var _0x1c1f82=_['find'](recordings[_0x2c7647[_0xa061('0x1a')]][_0xa061('0x23')],{'value':_0x2c7647[_0xa061('0x21')]});if(_['isNil'](_0x1c1f82)){recordings[_0x2c7647['linkedid']][_0xa061('0x23')][_0xa061('0x24')]({'value':_0x2c7647[_0xa061('0x21')]});}}}}catch(_0x29a14b){utils[_0xa061('0x1b')](util['format'](_0xa061('0x1f'),_0x2c7647[_0xa061('0x5')]),_0x29a14b);}};exports[_0xa061('0x25')]=function(_0x6920b1){try{if(!_[_0xa061('0x17')](recordings[_0x6920b1[_0xa061('0x5')]])){utils[_0xa061('0x10')](util[_0xa061('0x3')]('[%s][recordings][hangup]',_0x6920b1['uniqueid']),_0x6920b1);utils[_0xa061('0x2')](util[_0xa061('0x3')](_0xa061('0x26'),_0x6920b1[_0xa061('0x5')],_0x6920b1[_0xa061('0x27')],_0x6920b1[_0xa061('0x28')],_0x6920b1[_0xa061('0x29')]));recordings[_0x6920b1[_0xa061('0x5')]][_0xa061('0x27')]=_0x6920b1[_0xa061('0x27')];recordings[_0x6920b1[_0xa061('0x5')]][_0xa061('0x28')]=_0x6920b1[_0xa061('0x28')];recordings[_0x6920b1[_0xa061('0x5')]][_0xa061('0x2a')]=_0x6920b1['connectedlinenum'];recordings[_0x6920b1[_0xa061('0x5')]][_0xa061('0x2b')]=_0x6920b1[_0xa061('0x2b')];if(recordings[_0x6920b1['uniqueid']][_0xa061('0x2c')]==_0xa061('0x2d')&&recordings[_0x6920b1[_0xa061('0x5')]][_0xa061('0x8')]){recordings[_0x6920b1[_0xa061('0x5')]][_0xa061('0x2a')]=recordings[_0x6920b1['uniqueid']][_0xa061('0x8')];recordings[_0x6920b1['uniqueid']][_0xa061('0x2b')]='';}recordings[_0x6920b1[_0xa061('0x5')]][_0xa061('0x23')][_0xa061('0x2e')](function(_0x95ed2f){var _0xc16600=_['clone'](recordings[_0x6920b1[_0xa061('0x5')]]);_0xc16600['value']=_0x95ed2f[_0xa061('0x21')];writeDB(_0xc16600);});delete recordings[_0x6920b1[_0xa061('0x5')]];}}catch(_0x2ca845){utils[_0xa061('0x1b')](util['format']('[%s][recordings][hangup]',_0x6920b1[_0xa061('0x5')]),_0x2ca845);}};exports['newexten']=function(_0x1710ed){try{if(!_[_0xa061('0x17')](recordings[_0x1710ed[_0xa061('0x5')]])){utils['debug'](util['format'](_0xa061('0x2f'),_0x1710ed[_0xa061('0x5')]),_0x1710ed);utils[_0xa061('0x2')](util['format'](_0xa061('0x30'),_0x1710ed[_0xa061('0x5')],_0x1710ed[_0xa061('0x31')],_0x1710ed['appdata']));if(_0x1710ed[_0xa061('0x31')][_0xa061('0x32')]()==_0xa061('0x33')&&_[_0xa061('0x34')](_0x1710ed['appdata'][_0xa061('0x32')](),'cdr')){var _0x4e773d=_0x1710ed[_0xa061('0x35')][_0xa061('0x36')]('=');var _0x3f8a64=_0x4e773d[0x0][_0xa061('0x37')](_0x4e773d[0x0][_0xa061('0x38')]('(')+0x1,_0x4e773d[0x0][_0xa061('0x38')](')'));var _0x687c57=_0x4e773d[0x1];recordings[_0x1710ed[_0xa061('0x5')]][_0x3f8a64]=_0x687c57;}}}catch(_0x33c701){utils['error'](util[_0xa061('0x3')](_0xa061('0x2f'),_0x1710ed[_0xa061('0x5')]),_0x33c701);}};exports[_0xa061('0x39')]=function(_0x14d40e){try{if(!_['isNil'](recordings[_0x14d40e[_0xa061('0x5')]])){utils[_0xa061('0x10')](util[_0xa061('0x3')]('[%s][recordings][queuecallerjoin]',_0x14d40e[_0xa061('0x5')]),_0x14d40e);utils['info'](util[_0xa061('0x3')](_0xa061('0x3a'),_0x14d40e[_0xa061('0x5')],_0x14d40e[_0xa061('0x3b')]));recordings[_0x14d40e[_0xa061('0x5')]][_0xa061('0x3b')]=_0x14d40e[_0xa061('0x3b')];}}catch(_0xd73f24){utils[_0xa061('0x1b')](util[_0xa061('0x3')](_0xa061('0x3c'),_0x14d40e[_0xa061('0x5')]),_0xd73f24);}};exports['blindtransfer']=function(_0x507c99){try{utils[_0xa061('0x10')](util['format'](_0xa061('0x3d'),_0x507c99[_0xa061('0x5')]),_0x507c99);utils['info'](util[_0xa061('0x3')](_0xa061('0x3e'),_0x507c99['uniqueid'],_0x507c99[_0xa061('0x3f')],_0x507c99['transferercalleridname'],_0x507c99['transfereecalleridnum'],_0x507c99[_0xa061('0x40')]));if(recordings[_0x507c99['transfereruniqueid']]&&transfers[_0xa061('0x6')][_0x507c99[_0xa061('0x41')]]){transfers[_0xa061('0x6')][_0x507c99[_0xa061('0x41')]][_0xa061('0x42')]=!![];}}catch(_0x10a15f){utils['error'](util[_0xa061('0x3')]('[%s][recordings][blindtransfer]',_0x507c99[_0xa061('0x5')]),_0x10a15f);}}; \ No newline at end of file +var _0xba05=['UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','[%s][recordings][newchannel]','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','.WAV','find','monitors','push','error','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','lodash','util','./transfers.controller','info','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','getUserByInternal','accountcode','membername','name'];(function(_0x4d3638,_0x49e95f){var _0x1cdff6=function(_0x465f02){while(--_0x465f02){_0x4d3638['push'](_0x4d3638['shift']());}};_0x1cdff6(++_0x49e95f);}(_0xba05,0x1dd));var _0x5ba0=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xba05[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x5ba0('0x0'));var util=require(_0x5ba0('0x1'));var utils=require('./utils');var transfers=require(_0x5ba0('0x2'));var recordings={};function writeDB(_0x45b9c6){var _0x27d61e;utils[_0x5ba0('0x3')](util[_0x5ba0('0x4')](_0x5ba0('0x5'),_0x45b9c6['uniqueid']));if(transfers[_0x5ba0('0x6')][_0x45b9c6['uniqueid']]){_0x27d61e=_0x45b9c6[_0x5ba0('0x7')];_0x45b9c6['uniqueid']=transfers[_0x5ba0('0x6')][_0x45b9c6[_0x5ba0('0x7')]][_0x5ba0('0x8')];}if(_0x45b9c6['accountcode']){utils[_0x5ba0('0x9')](_0x45b9c6[_0x5ba0('0xa')])['then'](function(_0x93f794){if(_0x93f794){_0x45b9c6[_0x5ba0('0xb')]=_0x93f794[_0x5ba0('0xc')];_0x45b9c6[_0x5ba0('0xd')]=_0x93f794['id'];}utils[_0x5ba0('0xe')]('CreateVoiceRecording',_0x45b9c6);});}else{utils[_0x5ba0('0xe')](_0x5ba0('0xf'),_0x45b9c6);}if(_0x27d61e)delete transfers[_0x5ba0('0x6')][_0x27d61e];}exports[_0x5ba0('0x10')]=function(_0x4013de){try{utils[_0x5ba0('0x11')](util[_0x5ba0('0x4')]('[%s][recordings][newchannel]',_0x4013de[_0x5ba0('0x7')]),_0x4013de);if(_0x4013de[_0x5ba0('0x7')]==_0x4013de[_0x5ba0('0x12')]){utils['info'](util[_0x5ba0('0x4')](_0x5ba0('0x13'),_0x4013de['uniqueid'],_0x4013de[_0x5ba0('0x14')],_0x4013de[_0x5ba0('0x15')]));recordings[_0x4013de[_0x5ba0('0x7')]]={'uniqueid':_0x4013de['uniqueid'],'accountcode':_0x4013de[_0x5ba0('0xa')],'exten':_0x4013de[_0x5ba0('0x15')],'context':_0x4013de[_0x5ba0('0x14')],'channel':_0x4013de[_0x5ba0('0x16')],'monitors':[]};}}catch(_0x1ab9d6){utils['error'](util[_0x5ba0('0x4')](_0x5ba0('0x17'),_0x4013de['uniqueid']),_0x1ab9d6);}};exports['newstate']=function(_0x5b0f9b){try{utils['debug'](util['format'](_0x5ba0('0x18'),_0x5b0f9b[_0x5ba0('0x7')]),_0x5b0f9b);if(!_[_0x5ba0('0x19')](recordings[_0x5b0f9b['uniqueid']])&&_0x5b0f9b['channelstate']==0x6){utils[_0x5ba0('0x3')](util[_0x5ba0('0x4')](_0x5ba0('0x1a'),_0x5b0f9b[_0x5ba0('0x7')],_0x5b0f9b['context'],_0x5b0f9b[_0x5ba0('0x16')]));}else if(!_['isNil'](recordings[_0x5b0f9b[_0x5ba0('0x12')]])&&_0x5b0f9b['channelstate']==0x6&&_0x5b0f9b['context']!=_0x5ba0('0x1b')){utils[_0x5ba0('0x3')](util['format'](_0x5ba0('0x1c'),_0x5b0f9b['uniqueid'],_0x5b0f9b[_0x5ba0('0x12')],_0x5b0f9b[_0x5ba0('0x14')],_0x5b0f9b[_0x5ba0('0x16')]));recordings[_0x5b0f9b[_0x5ba0('0x12')]][_0x5ba0('0xa')]=_0x5b0f9b[_0x5ba0('0xa')];}}catch(_0x47f14a){utils['error'](util[_0x5ba0('0x4')](_0x5ba0('0x18'),_0x5b0f9b[_0x5ba0('0x7')]),_0x47f14a);}};exports[_0x5ba0('0x1d')]=function(_0x178b75){try{if(!_['isNil'](_0x178b75[_0x5ba0('0x1e')])&&!_[_0x5ba0('0x19')](_0x178b75['variable']['mixmonitor_filename'])){utils[_0x5ba0('0x11')](util[_0x5ba0('0x4')]('[%s][recordings][varset]',_0x178b75[_0x5ba0('0x7')]),_0x178b75);utils[_0x5ba0('0x3')](util[_0x5ba0('0x4')](_0x5ba0('0x1f'),_0x178b75[_0x5ba0('0x7')],_0x178b75[_0x5ba0('0x1e')],_0x178b75[_0x5ba0('0x20')]));if(_['endsWith'](_0x178b75[_0x5ba0('0x20')],'.wav49')){_0x178b75[_0x5ba0('0x20')]=_0x178b75[_0x5ba0('0x20')]['replace'](_0x5ba0('0x21'),_0x5ba0('0x22'));}if(recordings[_0x178b75[_0x5ba0('0x12')]]){var _0x3bff8b=_[_0x5ba0('0x23')](recordings[_0x178b75[_0x5ba0('0x12')]][_0x5ba0('0x24')],{'value':_0x178b75[_0x5ba0('0x20')]});if(_[_0x5ba0('0x19')](_0x3bff8b)){recordings[_0x178b75[_0x5ba0('0x12')]][_0x5ba0('0x24')][_0x5ba0('0x25')]({'value':_0x178b75[_0x5ba0('0x20')]});}}}}catch(_0x3a8197){utils[_0x5ba0('0x26')](util[_0x5ba0('0x4')]('[%s][recordings][varset]',_0x178b75[_0x5ba0('0x7')]),_0x3a8197);}};exports[_0x5ba0('0x27')]=function(_0x3d6ae2){try{if(!_[_0x5ba0('0x19')](recordings[_0x3d6ae2[_0x5ba0('0x7')]])){utils[_0x5ba0('0x11')](util[_0x5ba0('0x4')](_0x5ba0('0x28'),_0x3d6ae2[_0x5ba0('0x7')]),_0x3d6ae2);utils[_0x5ba0('0x3')](util[_0x5ba0('0x4')](_0x5ba0('0x29'),_0x3d6ae2[_0x5ba0('0x7')],_0x3d6ae2[_0x5ba0('0x2a')],_0x3d6ae2['calleridname'],_0x3d6ae2['cause-txt']));recordings[_0x3d6ae2[_0x5ba0('0x7')]][_0x5ba0('0x2a')]=_0x3d6ae2[_0x5ba0('0x2a')];recordings[_0x3d6ae2['uniqueid']][_0x5ba0('0x2b')]=_0x3d6ae2[_0x5ba0('0x2b')];recordings[_0x3d6ae2[_0x5ba0('0x7')]][_0x5ba0('0x2c')]=_0x3d6ae2[_0x5ba0('0x2c')];recordings[_0x3d6ae2[_0x5ba0('0x7')]][_0x5ba0('0x2d')]=_0x3d6ae2['connectedlinename'];if(recordings[_0x3d6ae2['uniqueid']]['type']==_0x5ba0('0x2e')&&recordings[_0x3d6ae2['uniqueid']][_0x5ba0('0xa')]){recordings[_0x3d6ae2['uniqueid']][_0x5ba0('0x2c')]=recordings[_0x3d6ae2['uniqueid']]['accountcode'];recordings[_0x3d6ae2[_0x5ba0('0x7')]][_0x5ba0('0x2d')]='';}recordings[_0x3d6ae2[_0x5ba0('0x7')]][_0x5ba0('0x24')][_0x5ba0('0x2f')](function(_0x2d30b5){var _0x285e70=_['clone'](recordings[_0x3d6ae2['uniqueid']]);_0x285e70['value']=_0x2d30b5[_0x5ba0('0x20')];writeDB(_0x285e70);});delete recordings[_0x3d6ae2[_0x5ba0('0x7')]];}}catch(_0x268a15){utils['error'](util[_0x5ba0('0x4')](_0x5ba0('0x28'),_0x3d6ae2[_0x5ba0('0x7')]),_0x268a15);}};exports[_0x5ba0('0x30')]=function(_0x3d9351){try{if(!_[_0x5ba0('0x19')](recordings[_0x3d9351[_0x5ba0('0x7')]])){utils[_0x5ba0('0x11')](util[_0x5ba0('0x4')]('[%s][recordings][newexten]',_0x3d9351[_0x5ba0('0x7')]),_0x3d9351);utils[_0x5ba0('0x3')](util[_0x5ba0('0x4')](_0x5ba0('0x31'),_0x3d9351[_0x5ba0('0x7')],_0x3d9351[_0x5ba0('0x32')],_0x3d9351[_0x5ba0('0x33')]));if(_0x3d9351[_0x5ba0('0x32')][_0x5ba0('0x34')]()==_0x5ba0('0x35')&&_[_0x5ba0('0x36')](_0x3d9351[_0x5ba0('0x33')][_0x5ba0('0x34')](),_0x5ba0('0x37'))){var _0x832f6d=_0x3d9351['appdata'][_0x5ba0('0x38')]('=');var _0x4b1415=_0x832f6d[0x0]['substring'](_0x832f6d[0x0][_0x5ba0('0x39')]('(')+0x1,_0x832f6d[0x0][_0x5ba0('0x39')](')'));var _0xb573ea=_0x832f6d[0x1];recordings[_0x3d9351[_0x5ba0('0x7')]][_0x4b1415]=_0xb573ea;}}}catch(_0x1e2cd7){utils['error'](util[_0x5ba0('0x4')](_0x5ba0('0x3a'),_0x3d9351[_0x5ba0('0x7')]),_0x1e2cd7);}};exports[_0x5ba0('0x3b')]=function(_0x912905){try{if(!_[_0x5ba0('0x19')](recordings[_0x912905[_0x5ba0('0x7')]])){utils['debug'](util['format'](_0x5ba0('0x3c'),_0x912905[_0x5ba0('0x7')]),_0x912905);utils[_0x5ba0('0x3')](util[_0x5ba0('0x4')](_0x5ba0('0x3d'),_0x912905[_0x5ba0('0x7')],_0x912905[_0x5ba0('0x3e')]));recordings[_0x912905['uniqueid']][_0x5ba0('0x3e')]=_0x912905[_0x5ba0('0x3e')];}}catch(_0x39c6d9){utils[_0x5ba0('0x26')](util['format'](_0x5ba0('0x3c'),_0x912905[_0x5ba0('0x7')]),_0x39c6d9);}};exports[_0x5ba0('0x3f')]=function(_0x233633){try{utils[_0x5ba0('0x11')](util['format']('[%s][recordings][blindtransfer]',_0x233633[_0x5ba0('0x7')]),_0x233633);utils[_0x5ba0('0x3')](util['format']('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x233633[_0x5ba0('0x7')],_0x233633[_0x5ba0('0x40')],_0x233633['transferercalleridname'],_0x233633[_0x5ba0('0x41')],_0x233633[_0x5ba0('0x42')]));if(recordings[_0x233633[_0x5ba0('0x43')]]&&transfers['blinds'][_0x233633['transfereruniqueid']]){transfers[_0x5ba0('0x6')][_0x233633[_0x5ba0('0x43')]][_0x5ba0('0x44')]=!![];}}catch(_0x4fccdf){utils[_0x5ba0('0x26')](util[_0x5ba0('0x4')](_0x5ba0('0x45'),_0x233633[_0x5ba0('0x7')]),_0x4fccdf);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 83a5ba2..152f50e 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 _0x5b68=['error','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','blind','blinds','transfereruniqueid'];(function(_0x1a3647,_0x11a272){var _0x204689=function(_0x4b49c9){while(--_0x4b49c9){_0x1a3647['push'](_0x1a3647['shift']());}};_0x204689(++_0x11a272);}(_0x5b68,0x10d));var _0x85b6=function(_0x2476fc,_0xe642c7){_0x2476fc=_0x2476fc-0x0;var _0x46c630=_0x5b68[_0x2476fc];return _0x46c630;};'use strict';var _=require(_0x85b6('0x0'));var util=require(_0x85b6('0x1'));var utils=require(_0x85b6('0x2'));function writeDB(_0x1873b1){utils[_0x85b6('0x3')](util[_0x85b6('0x4')](_0x85b6('0x5'),_0x1873b1[_0x85b6('0x6')]===_0x85b6('0x7')?_0x1873b1[_0x85b6('0x8')]:_0x1873b1[_0x85b6('0x9')],_0x1873b1[_0x85b6('0x6')]));utils[_0x85b6('0xa')]('CreateVoiceTransferReport',_0x1873b1);}exports['blinds']={};exports[_0x85b6('0xb')]=function(_0x1a694c){try{utils[_0x85b6('0xc')](util['format'](_0x85b6('0xd'),_0x1a694c['uniqueid']),_0x1a694c);utils['info'](util[_0x85b6('0x4')](_0x85b6('0xe'),_0x1a694c[_0x85b6('0x9')],_0x1a694c['transferercalleridnum'],_0x1a694c[_0x85b6('0xf')],_0x1a694c['transfereecalleridnum'],_0x1a694c['transfereecalleridname']));_0x1a694c['type']=_0x85b6('0x10');exports[_0x85b6('0x11')][_0x1a694c[_0x85b6('0x12')]]=_0x1a694c;writeDB(_0x1a694c);}catch(_0x4b9d0f){utils[_0x85b6('0x13')](util[_0x85b6('0x4')]('[%s][transfers][blindtransfer]',_0x1a694c[_0x85b6('0x9')]),_0x4b9d0f);}};exports['attendedtransfer']=function(_0x209487){try{utils[_0x85b6('0xc')](util[_0x85b6('0x4')]('[%s][transfers][attendedtransfer]',_0x209487['origtransfereruniqueid']),_0x209487);utils[_0x85b6('0x3')](util['format'](_0x85b6('0x14'),_0x209487[_0x85b6('0x8')],_0x209487[_0x85b6('0x15')],_0x209487['origtransferercalleridname'],_0x209487[_0x85b6('0x16')],_0x209487[_0x85b6('0x17')]));_0x209487=_[_0x85b6('0x18')](_0x209487,{'transfererchannel':_0x209487[_0x85b6('0x19')],'transferercalleridnum':_0x209487[_0x85b6('0x15')],'transferercalleridname':_0x209487[_0x85b6('0x1a')],'transfererconnectedlinenum':_0x209487[_0x85b6('0x1b')],'transfererconnectedlinename':_0x209487['secondtransfererconnectedlinename'],'transfereraccountcode':_0x209487[_0x85b6('0x1c')],'transferercontext':_0x209487[_0x85b6('0x1d')],'transfererexten':_0x209487['secondtransfererexten'],'transfererlinkedid':_0x209487[_0x85b6('0x1e')],'context':_0x209487['origtransferercontext'],'extension':_0x209487['origtransfererexten'],'type':_0x85b6('0x7')});if(_['isNil'](_0x209487[_0x85b6('0x1f')])){_0x209487=_['assign'](_0x209487,{'transfereechannel':_0x209487[_0x85b6('0x20')],'transfereecalleridnum':_0x209487['transfertargetcalleridnum'],'transfereecalleridname':_0x209487[_0x85b6('0x17')],'transfereeconnectedlinenum':_0x209487[_0x85b6('0x21')],'transfereeconnectedlinename':_0x209487['transfertargetconnectedlinename'],'transfereeaccountcode':_0x209487[_0x85b6('0x22')],'transfereecontext':_0x209487[_0x85b6('0x23')],'transfereeexten':_0x209487['transfertargetexten'],'transfereelinkedid':_0x209487['transfertargetlinkedid']});}writeDB(_0x209487);}catch(_0x3ea4d7){utils[_0x85b6('0x13')](util[_0x85b6('0x4')]('[%s][transfers][attendedtransfer]',_0x209487[_0x85b6('0x8')]),_0x3ea4d7);}}; \ No newline at end of file +var _0x26e7=['transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','type','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','info','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname'];(function(_0x2f445d,_0xf22b8d){var _0x43744b=function(_0x373b5c){while(--_0x373b5c){_0x2f445d['push'](_0x2f445d['shift']());}};_0x43744b(++_0xf22b8d);}(_0x26e7,0xde));var _0x726e=function(_0x4e0eb6,_0x240784){_0x4e0eb6=_0x4e0eb6-0x0;var _0x46e432=_0x26e7[_0x4e0eb6];return _0x46e432;};'use strict';var _=require('lodash');var util=require(_0x726e('0x0'));var utils=require(_0x726e('0x1'));function writeDB(_0x2f4984){utils['info'](util[_0x726e('0x2')](_0x726e('0x3'),_0x2f4984['type']===_0x726e('0x4')?_0x2f4984[_0x726e('0x5')]:_0x2f4984[_0x726e('0x6')],_0x2f4984[_0x726e('0x7')]));utils[_0x726e('0x8')]('CreateVoiceTransferReport',_0x2f4984);}exports[_0x726e('0x9')]={};exports[_0x726e('0xa')]=function(_0x419f91){try{utils[_0x726e('0xb')](util['format'](_0x726e('0xc'),_0x419f91[_0x726e('0x6')]),_0x419f91);utils[_0x726e('0xd')](util[_0x726e('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x419f91[_0x726e('0x6')],_0x419f91[_0x726e('0xe')],_0x419f91[_0x726e('0xf')],_0x419f91[_0x726e('0x10')],_0x419f91[_0x726e('0x11')]));_0x419f91['type']=_0x726e('0x12');exports[_0x726e('0x9')][_0x419f91[_0x726e('0x13')]]=_0x419f91;writeDB(_0x419f91);}catch(_0x68b102){utils['error'](util[_0x726e('0x2')](_0x726e('0xc'),_0x419f91[_0x726e('0x6')]),_0x68b102);}};exports[_0x726e('0x14')]=function(_0x47e5f0){try{utils[_0x726e('0xb')](util[_0x726e('0x2')](_0x726e('0x15'),_0x47e5f0[_0x726e('0x5')]),_0x47e5f0);utils[_0x726e('0xd')](util[_0x726e('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x47e5f0[_0x726e('0x5')],_0x47e5f0[_0x726e('0x16')],_0x47e5f0[_0x726e('0x17')],_0x47e5f0[_0x726e('0x18')],_0x47e5f0[_0x726e('0x19')]));_0x47e5f0=_[_0x726e('0x1a')](_0x47e5f0,{'transfererchannel':_0x47e5f0[_0x726e('0x1b')],'transferercalleridnum':_0x47e5f0[_0x726e('0x16')],'transferercalleridname':_0x47e5f0[_0x726e('0x17')],'transfererconnectedlinenum':_0x47e5f0[_0x726e('0x1c')],'transfererconnectedlinename':_0x47e5f0['secondtransfererconnectedlinename'],'transfereraccountcode':_0x47e5f0[_0x726e('0x1d')],'transferercontext':_0x47e5f0['secondtransferercontext'],'transfererexten':_0x47e5f0[_0x726e('0x1e')],'transfererlinkedid':_0x47e5f0[_0x726e('0x1f')],'context':_0x47e5f0['origtransferercontext'],'extension':_0x47e5f0['origtransfererexten'],'type':_0x726e('0x4')});if(_['isNil'](_0x47e5f0[_0x726e('0x20')])){_0x47e5f0=_[_0x726e('0x1a')](_0x47e5f0,{'transfereechannel':_0x47e5f0[_0x726e('0x21')],'transfereecalleridnum':_0x47e5f0['transfertargetcalleridnum'],'transfereecalleridname':_0x47e5f0['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x47e5f0[_0x726e('0x22')],'transfereeconnectedlinename':_0x47e5f0[_0x726e('0x23')],'transfereeaccountcode':_0x47e5f0[_0x726e('0x24')],'transfereecontext':_0x47e5f0[_0x726e('0x25')],'transfereeexten':_0x47e5f0[_0x726e('0x26')],'transfereelinkedid':_0x47e5f0[_0x726e('0x27')]});}writeDB(_0x47e5f0);}catch(_0x52c359){utils[_0x726e('0x28')](util[_0x726e('0x2')](_0x726e('0x15'),_0x47e5f0[_0x726e('0x5')]),_0x52c359);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 1751ee9..c296e79 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 _0x6f08=['[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diff','sumTime','isAfter','bluebird','jayson/promise','moment','util','client','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','[utils][getUser]\x20where:%s','result','length','getUserByInternal','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName'];(function(_0x1535f1,_0x7f8167){var _0x4cf5c0=function(_0x16f2d7){while(--_0x16f2d7){_0x1535f1['push'](_0x1535f1['shift']());}};_0x4cf5c0(++_0x7f8167);}(_0x6f08,0x9c));var _0x86f0=function(_0x894378,_0x4fc23c){_0x894378=_0x894378-0x0;var _0x1da4ca=_0x6f08[_0x894378];return _0x1da4ca;};'use strict';var BPromise=require(_0x86f0('0x0'));var jayson=require(_0x86f0('0x1'));var moment=require(_0x86f0('0x2'));var util=require(_0x86f0('0x3'));var client=jayson[_0x86f0('0x4')]['http']({'port':0x2329});var logger=require('../../config/logger')(_0x86f0('0x5'));exports['info']=function(_0x167900,_0x1a07a6){logger[_0x86f0('0x6')](_0x167900,_0x1a07a6?util[_0x86f0('0x7')](_0x1a07a6,{'showHidden':![],'depth':null}):'');};exports[_0x86f0('0x8')]=function(_0x22d398,_0x287cc1){logger[_0x86f0('0x8')](_0x22d398,_0x287cc1?util['inspect'](_0x287cc1,{'showHidden':![],'depth':null}):'');};exports[_0x86f0('0x9')]=function(_0x435b47,_0x160927){logger[_0x86f0('0x9')](_0x435b47,_0x160927?util['inspect'](_0x160927,{'showHidden':![],'depth':null}):'');};exports[_0x86f0('0xa')]=function(_0x47e4f3,_0x2c62a9){return client['request'](_0x47e4f3,{'body':_0x2c62a9})[_0x86f0('0xb')](function(_0x6adeb0){logger['debug'](_0x86f0('0xc'),_0x47e4f3,_0x6adeb0?util[_0x86f0('0x7')](_0x6adeb0,{'showHidden':![],'depth':null}):'');})[_0x86f0('0xd')](function(_0x2f72ad){logger[_0x86f0('0x9')]('[utils][request]\x20name:%s',_0x47e4f3,_0x2f72ad?util[_0x86f0('0x7')](_0x2f72ad,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4ea095){return client['request'](_0x86f0('0xe'),{'options':{'raw':!![],'attributes':['id',_0x86f0('0xf'),_0x86f0('0x10'),'interface'],'where':_0x4ea095,'limit':0x1}})[_0x86f0('0xb')](function(_0x5964d7){logger[_0x86f0('0x8')](_0x86f0('0x11'),JSON['stringify'](_0x4ea095),_0x5964d7?util[_0x86f0('0x7')](_0x5964d7,{'showHidden':![],'depth':null}):'');return _0x5964d7[_0x86f0('0x12')][_0x86f0('0x13')]?_0x5964d7[_0x86f0('0x12')][0x0]:null;});}exports[_0x86f0('0x14')]=function(_0x7a5f6f){return new BPromise(function(_0x2aaa10,_0x37fa78){if(_0x7a5f6f){return getUser({'internal':_0x7a5f6f})[_0x86f0('0xb')](function(_0x5d9b1c){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x7a5f6f,_0x5d9b1c?_0x86f0('0x15'):_0x86f0('0x16'));return _0x2aaa10(_0x5d9b1c);})['catch'](function(_0x49f5dc){logger[_0x86f0('0x9')](_0x86f0('0x17'),_0x49f5dc?util[_0x86f0('0x7')](_0x49f5dc,{'showHidden':![],'depth':null}):'');return _0x2aaa10(null);});}return _0x2aaa10(null);});};exports[_0x86f0('0x18')]=function(_0x1b19b6){return new BPromise(function(_0xba9ed3,_0x2ad78e){if(_0x1b19b6){return getUser({'interface':_0x1b19b6})[_0x86f0('0xb')](function(_0x433f39){logger[_0x86f0('0x6')](_0x86f0('0x19'),_0x1b19b6,_0x433f39?_0x86f0('0x15'):_0x86f0('0x16'));return _0xba9ed3(_0x433f39);})[_0x86f0('0xd')](function(_0x32d985){logger[_0x86f0('0x9')](_0x86f0('0x1a'),_0x32d985?util[_0x86f0('0x7')](_0x32d985,{'showHidden':![],'depth':null}):'');return _0xba9ed3(null);});}return _0xba9ed3(null);});};exports[_0x86f0('0x1b')]=function(_0x2ece6b){return new BPromise(function(_0x242da9,_0xac15e5){if(_0x2ece6b){return getUser({'name':_0x2ece6b})[_0x86f0('0xb')](function(_0x1233ca){logger['info'](_0x86f0('0x1c'),_0x2ece6b,_0x1233ca?_0x86f0('0x15'):'notfound');return _0x242da9(_0x1233ca);})['catch'](function(_0x15dc49){logger[_0x86f0('0x9')](_0x86f0('0x1d'),_0x15dc49?util[_0x86f0('0x7')](_0x15dc49,{'showHidden':![],'depth':null}):'');return _0x242da9(null);});}return _0x242da9(null);});};exports[_0x86f0('0x1e')]=function(_0x1dfefb){return new BPromise(function(_0x470d9d,_0xa0603f){if(_0x1dfefb){return client[_0x86f0('0xa')](_0x86f0('0x1f'),{'options':{'raw':!![],'attributes':['id','name',_0x86f0('0x20'),_0x86f0('0x21'),'acwTimeout'],'where':{'name':_0x1dfefb},'limit':0x1}})['then'](function(_0x467fd7){logger['debug'](_0x86f0('0x22'),_0x1dfefb,_0x467fd7?util[_0x86f0('0x7')](_0x467fd7,{'showHidden':![],'depth':null}):'');logger[_0x86f0('0x6')](_0x86f0('0x23'),_0x1dfefb,_0x467fd7?'found':_0x86f0('0x16'));return _0x470d9d(_0x467fd7[_0x86f0('0x12')][_0x86f0('0x13')]?_0x467fd7[_0x86f0('0x12')][0x0]:null);})[_0x86f0('0xd')](function(_0x242b0c){logger[_0x86f0('0x9')](_0x86f0('0x24'),_0x242b0c?util['inspect'](_0x242b0c,{'showHidden':![],'depth':null}):'');return _0x470d9d(null);});}return _0x470d9d(null);});};exports['addTime']=function(_0x4e6a47,_0x305ebc){return moment(_0x4e6a47)[_0x86f0('0x25')](_0x305ebc,'seconds')[_0x86f0('0x26')](_0x86f0('0x27'));};exports[_0x86f0('0x28')]=function(_0x35ba10,_0x4e4125){return moment(_0x35ba10)[_0x86f0('0x29')](_0x4e4125,_0x86f0('0x2a'))[_0x86f0('0x26')](_0x86f0('0x27'));};exports['diffTime']=function(_0x2a12aa,_0x5de25f){return moment(_0x2a12aa)[_0x86f0('0x2b')](moment(_0x5de25f),_0x86f0('0x2a'));};exports[_0x86f0('0x2c')]=function(_0x512b4f,_0x2812c8){return parseInt(_0x512b4f,0xa)+parseInt(_0x2812c8,0xa);};exports['now']=function(){return moment()[_0x86f0('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x86f0('0x2d')]=function(_0x21e41b,_0xffa36e){if(_0xffa36e){return moment(_0x21e41b)[_0x86f0('0x2d')](_0xffa36e);}return!![];};exports['isBefore']=function(_0x209a48,_0x1e63b2){if(_0x1e63b2){return moment(_0x209a48)['isBefore'](_0x1e63b2);}else if(_0x209a48){return!![];}return![];}; \ No newline at end of file +var _0xad30=['then','[utils][request]\x20name:%s','catch','name','interface','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','client','../../config/logger','xdr','info','inspect','debug','error','request'];(function(_0x2dd22e,_0xec41fe){var _0x257b01=function(_0x26de99){while(--_0x26de99){_0x2dd22e['push'](_0x2dd22e['shift']());}};_0x257b01(++_0xec41fe);}(_0xad30,0x82));var _0x0ad3=function(_0x1705e6,_0x3a4238){_0x1705e6=_0x1705e6-0x0;var _0x44f92b=_0xad30[_0x1705e6];return _0x44f92b;};'use strict';var BPromise=require(_0x0ad3('0x0'));var jayson=require(_0x0ad3('0x1'));var moment=require(_0x0ad3('0x2'));var util=require('util');var client=jayson[_0x0ad3('0x3')]['http']({'port':0x2329});var logger=require(_0x0ad3('0x4'))(_0x0ad3('0x5'));exports[_0x0ad3('0x6')]=function(_0x51f8b4,_0x3f0146){logger[_0x0ad3('0x6')](_0x51f8b4,_0x3f0146?util[_0x0ad3('0x7')](_0x3f0146,{'showHidden':![],'depth':null}):'');};exports[_0x0ad3('0x8')]=function(_0x362392,_0x78cda5){logger['debug'](_0x362392,_0x78cda5?util['inspect'](_0x78cda5,{'showHidden':![],'depth':null}):'');};exports[_0x0ad3('0x9')]=function(_0x22efa4,_0x16117a){logger[_0x0ad3('0x9')](_0x22efa4,_0x16117a?util[_0x0ad3('0x7')](_0x16117a,{'showHidden':![],'depth':null}):'');};exports[_0x0ad3('0xa')]=function(_0x299af0,_0x27641c){return client['request'](_0x299af0,{'body':_0x27641c})[_0x0ad3('0xb')](function(_0x43159b){logger[_0x0ad3('0x8')](_0x0ad3('0xc'),_0x299af0,_0x43159b?util[_0x0ad3('0x7')](_0x43159b,{'showHidden':![],'depth':null}):'');})[_0x0ad3('0xd')](function(_0x5a1b35){logger['error'](_0x0ad3('0xc'),_0x299af0,_0x5a1b35?util[_0x0ad3('0x7')](_0x5a1b35,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3dbf0a){return client[_0x0ad3('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0x0ad3('0xe'),_0x0ad3('0xf')],'where':_0x3dbf0a,'limit':0x1}})[_0x0ad3('0xb')](function(_0x1c1a28){logger[_0x0ad3('0x8')]('[utils][getUser]\x20where:%s',JSON[_0x0ad3('0x10')](_0x3dbf0a),_0x1c1a28?util[_0x0ad3('0x7')](_0x1c1a28,{'showHidden':![],'depth':null}):'');return _0x1c1a28['result']['length']?_0x1c1a28[_0x0ad3('0x11')][0x0]:null;});}exports[_0x0ad3('0x12')]=function(_0x45ec3f){return new BPromise(function(_0x3b8837,_0x5a99a7){if(_0x45ec3f){return getUser({'internal':_0x45ec3f})[_0x0ad3('0xb')](function(_0x269f1c){logger['info'](_0x0ad3('0x13'),_0x45ec3f,_0x269f1c?_0x0ad3('0x14'):_0x0ad3('0x15'));return _0x3b8837(_0x269f1c);})['catch'](function(_0x18cb86){logger[_0x0ad3('0x9')](_0x0ad3('0x16'),_0x18cb86?util[_0x0ad3('0x7')](_0x18cb86,{'showHidden':![],'depth':null}):'');return _0x3b8837(null);});}return _0x3b8837(null);});};exports[_0x0ad3('0x17')]=function(_0x34e63c){return new BPromise(function(_0x3fb15f,_0x1b7e8b){if(_0x34e63c){return getUser({'interface':_0x34e63c})['then'](function(_0x3ca6dc){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x34e63c,_0x3ca6dc?'found':_0x0ad3('0x15'));return _0x3fb15f(_0x3ca6dc);})['catch'](function(_0x4bff47){logger[_0x0ad3('0x9')](_0x0ad3('0x18'),_0x4bff47?util[_0x0ad3('0x7')](_0x4bff47,{'showHidden':![],'depth':null}):'');return _0x3fb15f(null);});}return _0x3fb15f(null);});};exports[_0x0ad3('0x19')]=function(_0x4bfd86){return new BPromise(function(_0xec9350,_0x2f1560){if(_0x4bfd86){return getUser({'name':_0x4bfd86})[_0x0ad3('0xb')](function(_0x551c9b){logger[_0x0ad3('0x6')](_0x0ad3('0x1a'),_0x4bfd86,_0x551c9b?_0x0ad3('0x14'):_0x0ad3('0x15'));return _0xec9350(_0x551c9b);})[_0x0ad3('0xd')](function(_0x373f29){logger[_0x0ad3('0x9')](_0x0ad3('0x1b'),_0x373f29?util[_0x0ad3('0x7')](_0x373f29,{'showHidden':![],'depth':null}):'');return _0xec9350(null);});}return _0xec9350(null);});};exports[_0x0ad3('0x1c')]=function(_0x51dfb6){return new BPromise(function(_0x56c25f,_0x206753){if(_0x51dfb6){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x0ad3('0xe'),_0x0ad3('0x1d'),_0x0ad3('0x1e'),_0x0ad3('0x1f')],'where':{'name':_0x51dfb6},'limit':0x1}})[_0x0ad3('0xb')](function(_0x430ab5){logger[_0x0ad3('0x8')](_0x0ad3('0x20'),_0x51dfb6,_0x430ab5?util[_0x0ad3('0x7')](_0x430ab5,{'showHidden':![],'depth':null}):'');logger[_0x0ad3('0x6')](_0x0ad3('0x21'),_0x51dfb6,_0x430ab5?_0x0ad3('0x14'):_0x0ad3('0x15'));return _0x56c25f(_0x430ab5['result'][_0x0ad3('0x22')]?_0x430ab5[_0x0ad3('0x11')][0x0]:null);})[_0x0ad3('0xd')](function(_0x453883){logger['error'](_0x0ad3('0x23'),_0x453883?util[_0x0ad3('0x7')](_0x453883,{'showHidden':![],'depth':null}):'');return _0x56c25f(null);});}return _0x56c25f(null);});};exports[_0x0ad3('0x24')]=function(_0x51361b,_0x412ff4){return moment(_0x51361b)[_0x0ad3('0x25')](_0x412ff4,_0x0ad3('0x26'))['format'](_0x0ad3('0x27'));};exports[_0x0ad3('0x28')]=function(_0xc47f1b,_0x359e19){return moment(_0xc47f1b)[_0x0ad3('0x29')](_0x359e19,'seconds')['format'](_0x0ad3('0x27'));};exports[_0x0ad3('0x2a')]=function(_0x54af7f,_0x48c2ae){return moment(_0x54af7f)[_0x0ad3('0x2b')](moment(_0x48c2ae),_0x0ad3('0x26'));};exports[_0x0ad3('0x2c')]=function(_0x1de5d9,_0x13c78c){return parseInt(_0x1de5d9,0xa)+parseInt(_0x13c78c,0xa);};exports['now']=function(){return moment()['format'](_0x0ad3('0x27'));};exports[_0x0ad3('0x2d')]=function(_0x4bc422,_0x1d66f5){if(_0x1d66f5){return moment(_0x4bc422)['isAfter'](_0x1d66f5);}return!![];};exports[_0x0ad3('0x2e')]=function(_0x14cfad,_0xd446b5){if(_0xd446b5){return moment(_0x14cfad)[_0x0ad3('0x2e')](_0xd446b5);}else if(_0x14cfad){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 1a1d347..b9fd39d 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x156f=['agent_name','setupLoggers','lodash','express-winston','path','./loggers','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','catch','user','then','data','timestamp','error','api','set','client-side-logger','logger','body','\x20body=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','format','statusCode','other'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x156f,0xb6));var _0xf156=function(_0x4b0879,_0x5b2b70){_0x4b0879=_0x4b0879-0x0;var _0x24e004=_0x156f[_0x4b0879];return _0x24e004;};var fs=require('fs-extra');var _=require(_0xf156('0x0'));var ewinston=require(_0xf156('0x1'));var path=require(_0xf156('0x2'));var util=require('util');var fileLogger=require(_0xf156('0x3'))[_0xf156('0x4')];var safeTemplate=require(_0xf156('0x5'))['safeTemplate'];var maskSensitiveData=require(_0xf156('0x6'))[_0xf156('0x7')];function ClientSideLogger(){function _0x5c8e54(_0xf0223e){var _0x2541ef=path[_0xf156('0x8')](_0xf156('0x9'),_0xf156('0xa'),_0xf156('0xb'));var _0x53d472=path['join'](_0xf156('0xc'),_0xf0223e[_0xf156('0xd')]+'-'+_0xf0223e[_0xf156('0xe')]);return fs[_0xf156('0xf')](path[_0xf156('0x8')](_0x2541ef,_0x53d472))['then'](function(){var _0x492c9f=fileLogger(_0xf156('0xc'),path[_0xf156('0x8')](_0x2541ef,_0x53d472));return _0x492c9f;})[_0xf156('0x10')](function(_0x392e12){throw _0x392e12;});}this[_0xf156('0xa')]=function(_0x4278a4,_0x2d5aca,_0x4b2a96,_0x37b8b8){return _0x5c8e54(_0x4278a4[_0xf156('0x11')])[_0xf156('0x12')](function(_0x15b28e){var _0x2e49c9=_0x15b28e[_0x2d5aca];return _0x2e49c9;})[_0xf156('0x12')](function(_0x17a94c){var _0x4d92df=_0x4278a4[_0xf156('0x11')]?_0x4278a4[_0xf156('0x11')]['id']:'no-user';var _0x527f45=_0x37b8b8[_0xf156('0x13')];var _0x36ab4a=_0x37b8b8[_0xf156('0x14')];var _0x52bf8b=new Date(Number(_0x36ab4a));return _0x17a94c(_0x4d92df,_0x52bf8b,_0x4b2a96,_0x527f45);})['catch'](function(_0x29a3a9){fileLogger(_0xf156('0xc'))[_0xf156('0x15')](_0x29a3a9);});};}function setupLoggers(_0x535ca9){return new Promise(function(_0x41d453){var _0x1084bf=new ClientSideLogger();var _0x3d30eb=fileLogger(_0xf156('0x16'));var _0x1b9b2f=fileLogger('auth');_0x535ca9[_0xf156('0x17')](_0xf156('0x18'),_0x1084bf);_0x535ca9['use'](ewinston[_0xf156('0x19')]({'winstonInstance':_0x3d30eb,'meta':![],'statusLevels':!![],'msg':function(_0x105471,_0x4a5fa9){var _0x65b91b='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x105471[_0xf156('0x1a')])){_0x65b91b+=_0xf156('0x1b');var _0x130a1b=_0x105471[_0xf156('0x1a')];maskSensitiveData(_0x130a1b);}return safeTemplate(util['format'](_0x65b91b,_0x105471[_0xf156('0x1c')],_0x105471[_0xf156('0x1d')][_0xf156('0x1e')]?_0x105471[_0xf156('0x1d')][_0xf156('0x1e')]:_0x105471[_0xf156('0x1f')][_0xf156('0x20')]||_0x105471['ip'],_0x105471[_0xf156('0x21')],_0x4a5fa9['statusCode'],_0x4a5fa9[_0xf156('0x22')],_0x105471[_0xf156('0x11')]?_0x105471[_0xf156('0x11')]['id']:null,_0x105471[_0xf156('0x11')]?_0x105471['user'][_0xf156('0xe')]:null,_0x105471['user']?_0x105471[_0xf156('0x11')][_0xf156('0xd')]:null,_0x130a1b?util[_0xf156('0x23')](_0x130a1b,![],null):''));}}));_0x535ca9[_0xf156('0x24')](ewinston[_0xf156('0x19')]({'winstonInstance':_0x1b9b2f,'meta':![],'statusLevels':!![],'msg':function(_0x138a7a,_0x543d3f){var _0x4269a7=_0xf156('0x25');if(_0x138a7a[_0xf156('0x1a')]&&_0x138a7a['body'][_0xf156('0x26')]&&_0x138a7a[_0xf156('0x1a')][_0xf156('0x27')]){_0x4269a7='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xf156('0x28')](_0x4269a7,_0x138a7a[_0xf156('0x1c')],_0x138a7a['headers'][_0xf156('0x1e')]?_0x138a7a[_0xf156('0x1d')][_0xf156('0x1e')]:_0x138a7a[_0xf156('0x1f')][_0xf156('0x20')]||_0x138a7a['ip'],_0x138a7a[_0xf156('0x21')],_0x543d3f[_0xf156('0x29')],_0x543d3f[_0xf156('0x22')],_0x138a7a[_0xf156('0x11')]?_0x138a7a['user']['id']:null,_0x138a7a[_0xf156('0x11')]?_0x138a7a[_0xf156('0x11')][_0xf156('0xe')]:null,_0x138a7a[_0xf156('0x11')]?_0x138a7a[_0xf156('0x11')][_0xf156('0xd')]:null,_0x138a7a[_0xf156('0x1a')]&&_0x138a7a[_0xf156('0x1a')]['device']?_0x138a7a[_0xf156('0x1a')][_0xf156('0x26')]:_0xf156('0x2a'),_0x138a7a[_0xf156('0x1a')]&&_0x138a7a[_0xf156('0x1a')][_0xf156('0x27')]?_0x138a7a[_0xf156('0x1a')][_0xf156('0x27')]:'',_0x138a7a[_0xf156('0x1a')]&&_0x138a7a['body'][_0xf156('0x2b')]?_0x138a7a[_0xf156('0x1a')][_0xf156('0x2b')]:'');},'ignoreRoute':function(_0x4af0b3){var _0x151977=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x151977['test'](_0x4af0b3[_0xf156('0x21')]);}}));return _0x41d453();});}exports[_0xf156('0x2c')]=setupLoggers; \ No newline at end of file +var _0xbdc6=['role','ensureDir','then','catch','user','no-user','data','timestamp','set','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','method','headers','x-forwarded-for','remoteAddress','statusCode','responseTime','name','inspect','use','agent_id','device','other','agent_name','test','setupLoggers','fs-extra','lodash','util','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client'];(function(_0x230628,_0x4b01f9){var _0xd221b1=function(_0x3a5610){while(--_0x3a5610){_0x230628['push'](_0x230628['shift']());}};_0xd221b1(++_0x4b01f9);}(_0xbdc6,0x6e));var _0x6bdc=function(_0x5cc728,_0x55f737){_0x5cc728=_0x5cc728-0x0;var _0x580962=_0xbdc6[_0x5cc728];return _0x580962;};var fs=require(_0x6bdc('0x0'));var _=require(_0x6bdc('0x1'));var ewinston=require('express-winston');var path=require('path');var util=require(_0x6bdc('0x2'));var fileLogger=require('./loggers')[_0x6bdc('0x3')];var safeTemplate=require(_0x6bdc('0x4'))[_0x6bdc('0x5')];var maskSensitiveData=require(_0x6bdc('0x6'))[_0x6bdc('0x7')];function ClientSideLogger(){function _0x1703d7(_0x266a99){var _0x3756a7=path[_0x6bdc('0x8')](_0x6bdc('0x9'),_0x6bdc('0xa'),_0x6bdc('0xb'));var _0x347c0a=path[_0x6bdc('0x8')](_0x6bdc('0xc'),_0x266a99[_0x6bdc('0xd')]+'-'+_0x266a99['name']);return fs[_0x6bdc('0xe')](path['join'](_0x3756a7,_0x347c0a))[_0x6bdc('0xf')](function(){var _0x186fcd=fileLogger(_0x6bdc('0xc'),path[_0x6bdc('0x8')](_0x3756a7,_0x347c0a));return _0x186fcd;})[_0x6bdc('0x10')](function(_0x38ef49){throw _0x38ef49;});}this[_0x6bdc('0xa')]=function(_0xb5ba05,_0x5d3334,_0x4fe2a3,_0x10f969){return _0x1703d7(_0xb5ba05[_0x6bdc('0x11')])[_0x6bdc('0xf')](function(_0x35434c){var _0x5d7c0c=_0x35434c[_0x5d3334];return _0x5d7c0c;})[_0x6bdc('0xf')](function(_0x474b28){var _0x161627=_0xb5ba05[_0x6bdc('0x11')]?_0xb5ba05[_0x6bdc('0x11')]['id']:_0x6bdc('0x12');var _0x117c3c=_0x10f969[_0x6bdc('0x13')];var _0x41843d=_0x10f969[_0x6bdc('0x14')];var _0x31faf0=new Date(Number(_0x41843d));return _0x474b28(_0x161627,_0x31faf0,_0x4fe2a3,_0x117c3c);})[_0x6bdc('0x10')](function(_0x1be030){fileLogger(_0x6bdc('0xc'))['error'](_0x1be030);});};}function setupLoggers(_0x4078c1){return new Promise(function(_0xb0aa92){var _0x8a4097=new ClientSideLogger();var _0x3e8ffd=fileLogger('api');var _0x357832=fileLogger('auth');_0x4078c1[_0x6bdc('0x15')]('client-side-logger',_0x8a4097);_0x4078c1['use'](ewinston[_0x6bdc('0x16')]({'winstonInstance':_0x3e8ffd,'meta':![],'statusLevels':!![],'msg':function(_0x1e706c,_0x72adc5){var _0x558e04=_0x6bdc('0x17');if(!_['isEmpty'](_0x1e706c[_0x6bdc('0x18')])){_0x558e04+=_0x6bdc('0x19');var _0x6a7e8d=_0x1e706c[_0x6bdc('0x18')];maskSensitiveData(_0x6a7e8d);}return safeTemplate(util['format'](_0x558e04,_0x1e706c[_0x6bdc('0x1a')],_0x1e706c[_0x6bdc('0x1b')][_0x6bdc('0x1c')]?_0x1e706c[_0x6bdc('0x1b')][_0x6bdc('0x1c')]:_0x1e706c['connection'][_0x6bdc('0x1d')]||_0x1e706c['ip'],_0x1e706c['url'],_0x72adc5[_0x6bdc('0x1e')],_0x72adc5[_0x6bdc('0x1f')],_0x1e706c[_0x6bdc('0x11')]?_0x1e706c[_0x6bdc('0x11')]['id']:null,_0x1e706c[_0x6bdc('0x11')]?_0x1e706c[_0x6bdc('0x11')][_0x6bdc('0x20')]:null,_0x1e706c[_0x6bdc('0x11')]?_0x1e706c[_0x6bdc('0x11')][_0x6bdc('0xd')]:null,_0x6a7e8d?util[_0x6bdc('0x21')](_0x6a7e8d,![],null):''));}}));_0x4078c1[_0x6bdc('0x22')](ewinston[_0x6bdc('0x16')]({'winstonInstance':_0x357832,'meta':![],'statusLevels':!![],'msg':function(_0x1d33bd,_0xd613a6){var _0x3d3971='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x1d33bd['body']&&_0x1d33bd[_0x6bdc('0x18')]['device']&&_0x1d33bd[_0x6bdc('0x18')][_0x6bdc('0x23')]){_0x3d3971='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x3d3971,_0x1d33bd[_0x6bdc('0x1a')],_0x1d33bd[_0x6bdc('0x1b')]['x-forwarded-for']?_0x1d33bd['headers']['x-forwarded-for']:_0x1d33bd['connection'][_0x6bdc('0x1d')]||_0x1d33bd['ip'],_0x1d33bd['url'],_0xd613a6[_0x6bdc('0x1e')],_0xd613a6['responseTime'],_0x1d33bd['user']?_0x1d33bd[_0x6bdc('0x11')]['id']:null,_0x1d33bd['user']?_0x1d33bd[_0x6bdc('0x11')][_0x6bdc('0x20')]:null,_0x1d33bd[_0x6bdc('0x11')]?_0x1d33bd['user']['role']:null,_0x1d33bd['body']&&_0x1d33bd[_0x6bdc('0x18')]['device']?_0x1d33bd['body'][_0x6bdc('0x24')]:_0x6bdc('0x25'),_0x1d33bd['body']&&_0x1d33bd[_0x6bdc('0x18')]['agent_id']?_0x1d33bd[_0x6bdc('0x18')][_0x6bdc('0x23')]:'',_0x1d33bd['body']&&_0x1d33bd[_0x6bdc('0x18')][_0x6bdc('0x26')]?_0x1d33bd[_0x6bdc('0x18')][_0x6bdc('0x26')]:'');},'ignoreRoute':function(_0x2a1eb9){var _0x182bde=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x182bde[_0x6bdc('0x27')](_0x2a1eb9['url']);}}));return _0xb0aa92();});}exports[_0x6bdc('0x28')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index f936ba9..f984cb8 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96a9=['white','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','join','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','{{{','keys','meta','length','format','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','transports','Console','warn','File','%s-%s','error','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow'];(function(_0x1ac952,_0xd5a34){var _0x2cef75=function(_0x23cecc){while(--_0x23cecc){_0x1ac952['push'](_0x1ac952['shift']());}};_0x2cef75(++_0xd5a34);}(_0x96a9,0x6d));var _0x996a=function(_0x12196e,_0x3aff81){_0x12196e=_0x12196e-0x0;var _0x300e88=_0x96a9[_0x12196e];return _0x300e88;};'use strict';var path=require(_0x996a('0x0'));var util=require(_0x996a('0x1'));var moment=require(_0x996a('0x2'));var winston=require(_0x996a('0x3'));var config=require(_0x996a('0x4'));var debugLevel=config[_0x996a('0x5')]?config[_0x996a('0x5')][_0x996a('0x6')]():_0x996a('0x7');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x996a('0x8'),'error':_0x996a('0x9'),'warn':_0x996a('0xa'),'info':_0x996a('0xb'),'print':'bold\x20white','success':'bold\x20green','http':_0x996a('0xc'),'verbose':_0x996a('0xd'),'debug':_0x996a('0xe'),'silly':_0x996a('0xf')};winston[_0x996a('0x10')](XC_LOG_COLORS);function getLogFileName(_0xdc300f,_0x1da917,_0x3a9c4c){var _0x266b29=_0xdc300f||'/var/log/xcally';return path[_0x996a('0x11')](_0x266b29,util['format'](_0x996a('0x12'),_0x1da917,_0x3a9c4c));}function formatter(_0x4b5f6c,_0x203cfc){_0x203cfc['message']=_0x203cfc[_0x996a('0x13')][_0x996a('0x14')](/@@{/g,'{{{')[_0x996a('0x14')](/}@@/g,_0x996a('0x15'))[_0x996a('0x14')](/@{/g,'{{')[_0x996a('0x14')](/}@/g,'}}');return util['format'](_0x996a('0x16'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x203cfc['level']['toUpperCase'](),_0x4b5f6c,_0x203cfc['message']);}function fileFormat(_0x190f1f,_0x14d1db){_0x14d1db[_0x996a('0x13')]=_0x14d1db[_0x996a('0x13')][_0x996a('0x14')](/@@{/g,_0x996a('0x17'))[_0x996a('0x14')](/}@@/g,_0x996a('0x15'))[_0x996a('0x14')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x2083e4=_0x14d1db['meta']&&Object[_0x996a('0x18')](_0x14d1db[_0x996a('0x19')])[_0x996a('0x1a')]?'\x0a\x09'+JSON['stringify'](_0x14d1db[_0x996a('0x19')]):'';return util[_0x996a('0x1b')](_0x996a('0x1c'),moment()[_0x996a('0x1b')](_0x996a('0x1d')),_0x14d1db[_0x996a('0x1e')][_0x996a('0x1f')](),_0x190f1f,_0x14d1db[_0x996a('0x13')],_0x2083e4);}function consoleLogger(){var _0x48e950=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x996a('0x20'))][(_0x996a('0x21'))]({'level':_0x996a('0x22'),'json':![],'formatter':function(_0x39f2db){return formatter('',_0x39f2db);}})]});return _0x48e950;}function fileLogger(_0x2119d3,_0x4f9ba7){var _0x5a9cf4=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x996a('0x20'))][(_0x996a('0x23'))]({'name':util['format'](_0x996a('0x24'),_0x2119d3,_0x996a('0x25')),'filename':getLogFileName(_0x4f9ba7,_0x2119d3,_0x996a('0x25')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x46bf7b){return fileFormat(_0x2119d3,_0x46bf7b);}}),new winston[(_0x996a('0x20'))][(_0x996a('0x23'))]({'name':util[_0x996a('0x1b')](_0x996a('0x24'),_0x2119d3,debugLevel),'filename':getLogFileName(_0x4f9ba7,_0x2119d3,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x46468d){return fileFormat(_0x2119d3,_0x46468d);}}),new winston[(_0x996a('0x20'))][(_0x996a('0x21'))]({'level':_0x996a('0x22'),'json':![],'formatter':function(_0x1feb4a){return fileFormat(_0x2119d3,_0x1feb4a);}})]});return _0x5a9cf4;}exports[_0x996a('0x26')]=consoleLogger;exports[_0x996a('0x27')]=fileLogger; \ No newline at end of file +var _0xd9c0=['YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','Console','transports','%s-%s','error','File','warn','consoleLogger','path','moment','winston','debugLevel','red','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s'];(function(_0x5086ca,_0x244e9e){var _0x3bbc6e=function(_0x5dabbe){while(--_0x5dabbe){_0x5086ca['push'](_0x5086ca['shift']());}};_0x3bbc6e(++_0x244e9e);}(_0xd9c0,0x1e4));var _0x0d9c=function(_0x3c64e4,_0x1772bd){_0x3c64e4=_0x3c64e4-0x0;var _0x476bf2=_0xd9c0[_0x3c64e4];return _0x476bf2;};'use strict';var path=require(_0x0d9c('0x0'));var util=require('util');var moment=require(_0x0d9c('0x1'));var winston=require(_0x0d9c('0x2'));var config=require('../config/environment');var debugLevel=config[_0x0d9c('0x3')]?config[_0x0d9c('0x3')]['toLowerCase']():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x0d9c('0x4'),'warn':'bold\x20yellow','info':'white','print':_0x0d9c('0x5'),'success':_0x0d9c('0x6'),'http':'gray','verbose':_0x0d9c('0x7'),'debug':_0x0d9c('0x8'),'silly':_0x0d9c('0x9')};winston[_0x0d9c('0xa')](XC_LOG_COLORS);function getLogFileName(_0x48304f,_0x157bf4,_0x59f98f){var _0x380b8b=_0x48304f||_0x0d9c('0xb');return path[_0x0d9c('0xc')](_0x380b8b,util[_0x0d9c('0xd')](_0x0d9c('0xe'),_0x157bf4,_0x59f98f));}function formatter(_0x1194cf,_0x36a061){_0x36a061[_0x0d9c('0xf')]=_0x36a061[_0x0d9c('0xf')][_0x0d9c('0x10')](/@@{/g,_0x0d9c('0x11'))[_0x0d9c('0x10')](/}@@/g,_0x0d9c('0x12'))[_0x0d9c('0x10')](/@{/g,'{{')[_0x0d9c('0x10')](/}@/g,'}}');return util[_0x0d9c('0xd')](_0x0d9c('0x13'),moment()[_0x0d9c('0xd')](_0x0d9c('0x14')),_0x36a061[_0x0d9c('0x15')][_0x0d9c('0x16')](),_0x1194cf,_0x36a061['message']);}function fileFormat(_0x56345b,_0x411af0){_0x411af0[_0x0d9c('0xf')]=_0x411af0[_0x0d9c('0xf')]['replace'](/@@{/g,'{{{')[_0x0d9c('0x10')](/}@@/g,_0x0d9c('0x12'))['replace'](/@{/g,'{{')[_0x0d9c('0x10')](/}@/g,'}}');var _0x6416cb=_0x411af0[_0x0d9c('0x17')]&&Object[_0x0d9c('0x18')](_0x411af0[_0x0d9c('0x17')])[_0x0d9c('0x19')]?'\x0a\x09'+JSON[_0x0d9c('0x1a')](_0x411af0[_0x0d9c('0x17')]):'';return util[_0x0d9c('0xd')](_0x0d9c('0x1b'),moment()[_0x0d9c('0xd')](_0x0d9c('0x14')),_0x411af0['level']['toUpperCase'](),_0x56345b,_0x411af0[_0x0d9c('0xf')],_0x6416cb);}function consoleLogger(){var _0xe570cd=new winston[(_0x0d9c('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x0d9c('0x1d'))]({'level':'warn','json':![],'formatter':function(_0x1922e9){return formatter('',_0x1922e9);}})]});return _0xe570cd;}function fileLogger(_0x380703,_0x35db38){var _0x1b8012=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x0d9c('0x1e'))]['File']({'name':util[_0x0d9c('0xd')](_0x0d9c('0x1f'),_0x380703,_0x0d9c('0x20')),'filename':getLogFileName(_0x35db38,_0x380703,_0x0d9c('0x20')),'level':_0x0d9c('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x538488){return fileFormat(_0x380703,_0x538488);}}),new winston[(_0x0d9c('0x1e'))][(_0x0d9c('0x21'))]({'name':util[_0x0d9c('0xd')](_0x0d9c('0x1f'),_0x380703,debugLevel),'filename':getLogFileName(_0x35db38,_0x380703,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3028db){return fileFormat(_0x380703,_0x3028db);}}),new winston['transports']['Console']({'level':_0x0d9c('0x22'),'json':![],'formatter':function(_0x2da3b8){return fileFormat(_0x380703,_0x2da3b8);}})]});return _0x1b8012;}exports[_0x0d9c('0x23')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 6a3709f..b02de20 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57ca=['accesskeyid','secretaccesskey','key','user','accountSid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','@@{','replace','}@@','includes','exports','username','password','apiKey','firstName','lastName','street','phone','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerSecret','calleridname','calleridnum','vidaooApiKey','privateKey'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x57ca,0x108));var _0xa57c=function(_0x347d46,_0x54b037){_0x347d46=_0x347d46-0x0;var _0x17b251=_0x57ca[_0x347d46];return _0x17b251;};var _=require('lodash');var sensitiveFields=[_0xa57c('0x0'),_0xa57c('0x1'),'newPassword',_0xa57c('0x2'),_0xa57c('0x3'),_0xa57c('0x4'),_0xa57c('0x5'),_0xa57c('0x6'),'mobile',_0xa57c('0x7'),_0xa57c('0x8'),_0xa57c('0x9'),_0xa57c('0xa'),_0xa57c('0xb'),_0xa57c('0xc'),_0xa57c('0xd'),_0xa57c('0xe'),'token',_0xa57c('0xf'),'accessToken',_0xa57c('0x10'),_0xa57c('0x11'),'consumerKey',_0xa57c('0x12'),'membername',_0xa57c('0x13'),_0xa57c('0x14'),'exten',_0xa57c('0x15'),'clientEmail',_0xa57c('0x16'),_0xa57c('0x17'),_0xa57c('0x18'),_0xa57c('0x19'),_0xa57c('0x1a'),'pass',_0xa57c('0x1b'),'localstationid',_0xa57c('0x1c'),_0xa57c('0x1d'),_0xa57c('0x1e'),_0xa57c('0x1f')];function maskSensitiveData(_0x3238ff){const _0x37a323=/(?!^)[\s\S](?!$)/g;if(_[_0xa57c('0x20')](_0x3238ff)){for(const _0x4b4bdb in _0x3238ff){if(_[_0xa57c('0x21')](_0x3238ff[_0x4b4bdb])){for(let _0xdf7ff6=0x0;_0xdf7ff6<_0x3238ff[_0x4b4bdb][_0xa57c('0x22')];_0xdf7ff6++){maskSensitiveData(_0x3238ff[_0x4b4bdb][_0xdf7ff6]);}}else if(_['isPlainObject'](_0x3238ff[_0x4b4bdb])){maskSensitiveData(_0x3238ff[_0x4b4bdb]);}else if(_[_0xa57c('0x23')](_0x3238ff[_0x4b4bdb])){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb]['replace'](/{{{/g,_0xa57c('0x24'))[_0xa57c('0x25')](/}}}/g,_0xa57c('0x26'))[_0xa57c('0x25')](/{{/g,'@{')[_0xa57c('0x25')](/}}/g,'}@');if(_[_0xa57c('0x27')](sensitiveFields,_0x4b4bdb)){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb][_0xa57c('0x25')](_0x37a323,'*');}}}}}module[_0xa57c('0x28')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x1967,0x173));var _0x7196=function(_0xb204dd,_0x4fd661){_0xb204dd=_0xb204dd-0x0;var _0x481026=_0x1967[_0xb204dd];return _0x481026;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 9441390..1bcd992 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed3c=['{\x20{\x20','\x20}\x20}','string','replace','isPlainObject','keys','reduce','safeTemplate','lodash'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xed3c,0x1a6));var _0xced3=function(_0x530191,_0x52edef){_0x530191=_0x530191-0x0;var _0x212d5d=_0xed3c[_0x530191];return _0x212d5d;};var _=require(_0xced3('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x408853){return _0x408853==='{{'?_0xced3('0x1'):_0xced3('0x2');}function safeTemplate(_0x558ee8){var _0xfdc1ed=_0x558ee8;if(typeof _0x558ee8===_0xced3('0x3')){_0xfdc1ed=_0x558ee8[_0xced3('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x558ee8)){_0xfdc1ed=_0x558ee8['map'](function(_0x3d3aa0){return safeTemplate(_0x3d3aa0);});}else if(_[_0xced3('0x5')](_0x558ee8)){_0xfdc1ed=Object[_0xced3('0x6')](_0x558ee8)[_0xced3('0x7')](function(_0x4795cd,_0x510164){_0x4795cd[_0x510164]=safeTemplate(_0x558ee8[_0x510164]);return _0x4795cd;},{});}return _0xfdc1ed;}module['exports'][_0xced3('0x8')]=safeTemplate; \ No newline at end of file +var _0x13f6=['isArray','map','keys','reduce','lodash','string'];(function(_0x463f7e,_0x8b0ee){var _0x31d340=function(_0x45e2e4){while(--_0x45e2e4){_0x463f7e['push'](_0x463f7e['shift']());}};_0x31d340(++_0x8b0ee);}(_0x13f6,0x124));var _0x613f=function(_0x477aad,_0x83bacf){_0x477aad=_0x477aad-0x0;var _0x37883c=_0x13f6[_0x477aad];return _0x37883c;};var _=require(_0x613f('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x1844a4){return _0x1844a4==='{{'?'{\x20{\x20':'\x20}\x20}';}function safeTemplate(_0xd04cfd){var _0x13b50a=_0xd04cfd;if(typeof _0xd04cfd===_0x613f('0x1')){_0x13b50a=_0xd04cfd['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x613f('0x2')](_0xd04cfd)){_0x13b50a=_0xd04cfd[_0x613f('0x3')](function(_0x20af2f){return safeTemplate(_0x20af2f);});}else if(_['isPlainObject'](_0xd04cfd)){_0x13b50a=Object[_0x613f('0x4')](_0xd04cfd)[_0x613f('0x5')](function(_0x5618fa,_0x4b546b){_0x5618fa[_0x4b546b]=safeTemplate(_0xd04cfd[_0x4b546b]);return _0x5618fa;},{});}return _0x13b50a;}module['exports']['safeTemplate']=safeTemplate; \ No newline at end of file diff --git a/snippet/3.0.1/assets/images/00fe515d7113c2841e5d.svg b/snippet/3.0.0/assets/images/00fe515d7113c2841e5d.svg similarity index 100% rename from snippet/3.0.1/assets/images/00fe515d7113c2841e5d.svg rename to snippet/3.0.0/assets/images/00fe515d7113c2841e5d.svg diff --git a/snippet/3.0.1/assets/images/3b24a6b94b2631f4d565.svg b/snippet/3.0.0/assets/images/3b24a6b94b2631f4d565.svg similarity index 100% rename from snippet/3.0.1/assets/images/3b24a6b94b2631f4d565.svg rename to snippet/3.0.0/assets/images/3b24a6b94b2631f4d565.svg diff --git a/snippet/3.0.1/assets/images/c9f502ad417b1b987198.svg b/snippet/3.0.0/assets/images/c9f502ad417b1b987198.svg similarity index 100% rename from snippet/3.0.1/assets/images/c9f502ad417b1b987198.svg rename to snippet/3.0.0/assets/images/c9f502ad417b1b987198.svg diff --git a/snippet/3.0.1/index.html b/snippet/3.0.0/index.html similarity index 96% rename from snippet/3.0.1/index.html rename to snippet/3.0.0/index.html index 66f15e7..7336920 100644 --- a/snippet/3.0.1/index.html +++ b/snippet/3.0.0/index.html @@ -26,4 +26,4 @@ status != 'online' && status != 'offline' && status != 'unmanaged' - " ng-click="vm.close(); $event.stopPropagation();">
\ No newline at end of file + " ng-click="vm.close(); $event.stopPropagation();">
\ No newline at end of file diff --git a/snippet/3.0.1/scripts/app.js b/snippet/3.0.0/scripts/app.js similarity index 100% rename from snippet/3.0.1/scripts/app.js rename to snippet/3.0.0/scripts/app.js diff --git a/snippet/3.0.1/scripts/app.js.LICENSE.txt b/snippet/3.0.0/scripts/app.js.LICENSE.txt similarity index 100% rename from snippet/3.0.1/scripts/app.js.LICENSE.txt rename to snippet/3.0.0/scripts/app.js.LICENSE.txt diff --git a/snippet/3.0.0/scripts/chat.js b/snippet/3.0.0/scripts/chat.js new file mode 100644 index 0000000..1b3c1e8 --- /dev/null +++ b/snippet/3.0.0/scripts/chat.js @@ -0,0 +1,3 @@ +/*! For license information please see chat.js.LICENSE.txt */ +(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["chat"],{"./node_modules/@flowjs/ng-flow/dist/ng-flow.js":(e,t,n)=>{var o=n("./node_modules/@flowjs/flow.js/src/flow.js");angular.module("flow.provider",[]).provider("flowFactory",(function(){"use strict";this.defaults={},this.factory=function(e){return new o(e)},this.events=[],this.on=function(e,t){this.events.push([e,t])},this.$get=function(){var e=this.factory,t=this.defaults,n=this.events;return{create:function(o){var r=e(angular.extend({},t,o));return angular.forEach(n,(function(e){r.on(e[0],e[1])})),r}}}})),angular.module("flow.init",["flow.provider"]).controller("flowCtrl",["$scope","$attrs","$parse","flowFactory",function(e,t,n,o){var r=angular.extend({},e.$eval(t.flowInit)),s=e.$eval(t.flowObject)||o.create(r),a=function(t){var n=Array.prototype.slice.call(arguments);n.shift();var o=e.$broadcast.apply(e,["flow::"+t,s].concat(n));if({progress:1,filesSubmitted:1,fileSuccess:1,fileError:1,complete:1}[t]&&e.$applyAsync(),o.defaultPrevented)return!1};s.on("catchAll",a),e.$on("$destroy",(function(){s.off("catchAll",a)})),e.$flow=s,t.hasOwnProperty("flowName")&&(n(t.flowName).assign(e,s),e.$on("$destroy",(function(){n(t.flowName).assign(e)})))}]).directive("flowInit",[function(){return{scope:!0,controller:"flowCtrl"}}]),angular.module("flow.btn",["flow.init"]).directive("flowBtn",[function(){return{restrict:"EA",scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.hasOwnProperty("flowDirectory"),r=n.hasOwnProperty("flowSingleFile"),s=n.hasOwnProperty("flowAttrs")&&e.$eval(n.flowAttrs);e.$flow.assignBrowse(t,o,r,s)}}}]),angular.module("flow.dragEvents",["flow.init"]).directive("flowPreventDrop",(function(){return{scope:!1,link:function(e,t,n){t.bind("drop dragover",(function(e){e.preventDefault()}))}}})).directive("flowDragEnter",["$timeout",function(e){return{scope:!1,link:function(t,n,o){var r,s=!1;n.bind("dragover",(function(n){var a,i,d;i=!1,d=(a=n).dataTransfer||a.originalEvent.dataTransfer,angular.forEach(d&&d.types,(function(e){"Files"===e&&(i=!0)})),i&&(s||(t.$apply(o.flowDragEnter),s=!0),e.cancel(r),n.preventDefault())})),n.bind("dragleave drop",(function(n){e.cancel(r),r=e((function(){t.$eval(o.flowDragLeave),r=null,s=!1}),100)}))}}}]),angular.module("flow.drop",["flow.init"]).directive("flowDrop",(function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){function o(){e.$flow.assignDrop(t)}n.flowDropEnabled?e.$watch(n.flowDropEnabled,(function(n){n?o():e.$flow.unAssignDrop(t)})):o()}}})),function(e){"use strict";var t=e.module("flow.events",["flow.init"]);e.forEach({fileSuccess:["$file","$message"],fileProgress:["$file"],fileAdded:["$file","$event"],filesAdded:["$files","$event"],filesSubmitted:["$files","$event"],fileRetry:["$file"],fileRemoved:["$file"],fileError:["$file","$message"],uploadStart:[],complete:[],progress:[],error:["$message","$file"]},(function(n,o){var r,s="flow"+((r=o).charAt(0).toUpperCase()+r.slice(1));"flowUploadStart"==s&&(s="flowUploadStarted"),t.directive(s,[function(){return{require:"^flowInit",controller:["$scope","$attrs",function(t,r){t.$on("flow::"+o,(function(){var o=Array.prototype.slice.call(arguments),a=o.shift();if(t.$flow===o.shift()){var i={};e.forEach(n,(function(e,t){i[e]=o[t]})),!1===t.$eval(r[s],i)&&a.preventDefault()}}))}]}}])}))}(angular),angular.module("flow.img",["flow.init"]).directive("flowImg",[function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.flowImg;e.$watch(o,(function(t){if(t){var o=new FileReader;o.readAsDataURL(t.file),o.onload=function(t){e.$apply((function(){n.$set("src",t.target.result)}))}}}))}}}]),angular.module("flow.transfers",["flow.init"]).directive("flowTransfers",[function(){return{scope:!0,require:"^flowInit",link:function(e){e.transfers=e.$flow.files}}}]),angular.module("flow",["flow.provider","flow.init","flow.events","flow.btn","flow.drop","flow.transfers","flow.img","flow.dragEvents"])},"./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js":(e,t,n)=>{"use strict";var o,r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),a=n("./node_modules/@uirouter/angularjs/lib-esm/services.js"),i=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js");function d(e,t,n,o,i){var d=(0,r.parse)("viewDecl.controllerAs"),u=(0,r.parse)("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(o){var m=o.html();return o.empty(),function(o,_){var c=_.data("$uiView");if(!c)return _.html(m),void e(_.contents())(o);var h=c.$cfg||{viewDecl:{},getTemplate:r.noop},f=h.path&&new r.ResolveContext(h.path);_.html(h.getTemplate(_,f)||m),r.trace.traceUIViewFill(c.$uiView,_.html());var p=e(_.contents()),M=h.controller,y=d(h),L=u(h),Y=f&&(0,a.D)(f);if(o[L]=Y,M){var g=t(M,(0,r.extend)({},Y,{$scope:o,$element:_}));y&&(o[y]=g,o[y][L]=Y),_.data("$ngControllerController",g),_.children().data("$ngControllerController",g),l(i,n,g,o,h)}if((0,r.isString)(h.component))var v=(0,r.kebobString)(h.component),k=new RegExp("^(x-|data-)?"+v+"$","i"),j=o.$watch((function(){var e=[].slice.call(_[0].children).filter((function(e){return e&&e.tagName&&k.exec(e.tagName)}));return e&&s.ng.element(e).data("$"+h.component+"Controller")}),(function(e){e&&(l(i,n,e,o,h),j())}));p(o)}}}}o=["$view","$animate","$uiViewScroll","$interpolate","$q",function(e,t,n,o,a){var d={$cfg:{viewDecl:{$context:e._pluginapi._rootViewContext()}},$uiView:{}},u={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(m,l,_){return function(m,l,c){var h,f,p,M,y=c.onload||"",L=c.autoscroll,Y=function(e,n,o){s.ng.version.minor>2?t.enter(e,null,n).then(o):t.enter(e,null,n,o)},g=function(e,n){s.ng.version.minor>2?t.leave(e).then(n):t.leave(e,n)},v=l.inheritedData("$uiView")||d,k=o(c.uiView||c.name||"")(m)||"$default",j={$type:"ng1",id:u.count++,name:k,fqn:v.$uiView.fqn?v.$uiView.fqn+"."+k:k,config:null,configUpdated:function(e){(!e||e instanceof i.qO)&&(M!==e&&(r.trace.traceUIViewConfigUpdated(j,e&&e.viewDecl&&e.viewDecl.$context),M=e,b(e)))},get creationContext(){var e=(0,r.parse)("$cfg.viewDecl.$context")(v),t=(0,r.parse)("$uiView.creationContext")(v);return e||t}};r.trace.traceUIViewEvent("Linking",j),l.data("$uiView",{$uiView:j}),b();var w=e.registerUIView(j);function b(e){var t=m.$new(),o=a.defer(),s=a.defer(),i={$cfg:e,$uiView:j},d={$animEnter:o.promise,$animLeave:s.promise,$$animLeave:s};t.$emit("$viewContentLoading",k);var u=_(t,(function(e){e.data("$uiViewAnim",d),e.data("$uiView",i),Y(e,l,(function(){o.resolve(),p&&p.$emit("$viewContentAnimationEnded"),((0,r.isDefined)(L)&&!L||m.$eval(L))&&n(e)})),function(){if(h&&(r.trace.traceUIViewEvent("Removing (previous) el",h.data("$uiView")),h.remove(),h=null),p&&(r.trace.traceUIViewEvent("Destroying scope",j),p.$destroy(),p=null),f){var e=f.data("$uiViewAnim");r.trace.traceUIViewEvent("Animate out",e),g(f,(function(){e.$$animLeave.resolve(),h=null})),h=f,f=null}}()}));f=u,(p=t).$emit("$viewContentLoaded",e||M),p.$eval(y)}m.$on("$destroy",(function(){r.trace.traceUIViewEvent("Destroying/Unregistering",j),w()}))}}};return u}],d.$inject=["$compile","$controller","$transitions","$view","$q"];var u="function"==typeof s.ng.module("ui.router").component,m=0;function l(e,t,n,o,s){!(0,r.isFunction)(n.$onInit)||(s.viewDecl.component||s.viewDecl.componentProvider)&&u||n.$onInit();var a=(0,r.tail)(s.path).state.self,i={bind:n};if((0,r.isFunction)(n.uiOnParamsChanged)){var d=new r.ResolveContext(s.path).getResolvable("$transition$").data;o.$on("$destroy",t.onSuccess({},(function(e){if(e!==d&&-1===e.exiting().indexOf(a)){var t=e.params("to"),o=e.params("from"),s=function(e){return e.paramSchema},i=e.treeChanges("to").map(s).reduce(r.unnestR,[]),u=e.treeChanges("from").map(s).reduce(r.unnestR,[]),m=i.filter((function(e){var n=u.indexOf(e);return-1===n||!u[n].type.equals(t[e.id],o[e.id])}));if(m.length){var l=m.map((function(e){return e.id})),_=(0,r.filter)(t,(function(e,t){return-1!==l.indexOf(t)}));n.uiOnParamsChanged(_,e)}}}),i))}if((0,r.isFunction)(n.uiCanExit)){var l=m++,_="_uiCanExitIds",c=function(e){return!!e&&(e[_]&&!0===e[_][l]||c(e.redirectedFrom()))},h={exiting:a.name};o.$on("$destroy",t.onBefore(h,(function(t){var o,r=t[_]=t[_]||{};return c(t)||(o=e.when(n.uiCanExit(t))).then((function(e){return r[l]=!1!==e})),o}),i))}}s.ng.module("ui.router.state").directive("uiView",o),s.ng.module("ui.router.state").directive("uiView",d)},"./node_modules/@uirouter/angularjs/lib-esm/services.js":(e,t,n)=>{"use strict";n.d(t,{D:()=>k});var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),a=function(){function e(){var e=this;this._useHttp=o.ng.version.minor<3,this.$get=["$http","$templateCache","$injector",function(t,n,o){return e.$templateRequest=o.has&&o.has("$templateRequest")&&o.get("$templateRequest"),e.$http=t,e.$templateCache=n,e}]}return e.prototype.useHttpService=function(e){this._useHttp=e},e.prototype.fromConfig=function(e,t,n){var o=function(e){return r.services.$q.when(e).then((function(e){return{template:e}}))},s=function(e){return r.services.$q.when(e).then((function(e){return{component:e}}))};return(0,r.isDefined)(e.template)?o(this.fromString(e.template,t)):(0,r.isDefined)(e.templateUrl)?o(this.fromUrl(e.templateUrl,t)):(0,r.isDefined)(e.templateProvider)?o(this.fromProvider(e.templateProvider,t,n)):(0,r.isDefined)(e.component)?s(e.component):(0,r.isDefined)(e.componentProvider)?s(this.fromComponentProvider(e.componentProvider,t,n)):o("")},e.prototype.fromString=function(e,t){return(0,r.isFunction)(e)?e(t):e},e.prototype.fromUrl=function(e,t){return(0,r.isFunction)(e)&&(e=e(t)),null==e?null:this._useHttp?this.$http.get(e,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then((function(e){return e.data})):this.$templateRequest(e)},e.prototype.fromProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.fromComponentProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.makeComponentTemplate=function(e,t,n,s){s=s||{};var a=o.ng.version.minor>=3?"::":"",d=function(e){var t=(0,r.kebobString)(e);return/^(x|data)-/.exec(t)?"x-"+t:t},u=function(e){var t=r.services.$injector.get(e+"Directive");if(!t||!t.length)throw new Error("Unable to find component named '"+e+"'");return t.map(i).reduce(r.unnestR,[])}(n).map((function(n){var o=n.name,i=n.type,u=d(o);if(e.attr(u)&&!s[o])return u+"='"+e.attr(u)+"'";var m=s[o]||o;if("@"===i)return u+"='{{"+a+"$resolve."+m+"}}'";if("&"===i){var l=t.getResolvable(m),_=l&&l.data,c=_&&r.services.$injector.annotate(_)||[];return u+"='$resolve."+m+((0,r.isArray)(_)?"["+(_.length-1)+"]":"")+"("+c.join(",")+")'"}return u+"='"+a+"$resolve."+m+"'"})).join(" "),m=d(n);return"<"+m+" "+u+">"},e}(),i=function(e){return(0,r.isObject)(e.bindToController)?d(e.bindToController):d(e.scope)},d=function(e){return Object.keys(e||{}).map((function(t){return[t,/^([=<@&])[?]?(.*)/.exec(e[t])]})).filter((function(e){return(0,r.isDefined)(e)&&(0,r.isArray)(e[1])})).map((function(e){return{name:e[1][2]||e[0],type:e[1][1]}}))},u=n("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),m=function(e){return function(t){var n=t[e],o="onExit"===e?"from":"to";return n?function(e,t){var s=new r.ResolveContext(e.treeChanges(o)).subContext(t.$$state()),a=(0,r.extend)(k(s),{$state$:t,$transition$:e});return r.services.$injector.invoke(n,this,a)}:void 0}},l=function(){function e(e){this._urlListeners=[],this.$locationProvider=e;var t=(0,r.val)(e);(0,r.createProxyFunctions)(t,this,t,["hashPrefix"])}return e.monkeyPatchPathParameterType=function(e){var t=e.urlMatcherFactory.type("path");t.encode=function(e){return null!=e?e.toString().replace(/(~|\/)/g,(function(e){return{"~":"~~","/":"~2F"}[e]})):e},t.decode=function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,(function(e){return{"~~":"~","~2F":"/"}[e]})):e}},e.prototype.dispose=function(){},e.prototype.onChange=function(e){var t=this;return this._urlListeners.push(e),function(){return(0,r.removeFrom)(t._urlListeners)(e)}},e.prototype.html5Mode=function(){var e=this.$locationProvider.html5Mode();return(e=(0,r.isObject)(e)?e.enabled:e)&&this.$sniffer.history},e.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},e.prototype.url=function(e,t,n){return void 0===t&&(t=!1),(0,r.isDefined)(e)&&this.$location.url(e),t&&this.$location.replace(),n&&this.$location.state(n),this.$location.url()},e.prototype._runtimeServices=function(e,t,n,o,s){var a=this;this.$location=t,this.$sniffer=n,this.$browser=o,this.$window=s,e.$on("$locationChangeSuccess",(function(e){return a._urlListeners.forEach((function(t){return t(e)}))}));var i=(0,r.val)(t);(0,r.createProxyFunctions)(i,this,i,["replace","path","search","hash"]),(0,r.createProxyFunctions)(i,this,i,["port","protocol","host"])},e}(),_=n("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js");o.ng.module("ui.router.angular1",[]);var c=o.ng.module("ui.router.init",["ng"]),h=o.ng.module("ui.router.util",["ui.router.init"]),f=o.ng.module("ui.router.router",["ui.router.util"]),p=o.ng.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),M=o.ng.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),y=(o.ng.module("ui.router.compat",["ui.router"]),null);function L(e){(y=this.router=new r.UIRouter).stateProvider=new u.X(y.stateRegistry,y.stateService),y.stateRegistry.decorator("views",s.LB),y.stateRegistry.decorator("onExit",m("onExit")),y.stateRegistry.decorator("onRetain",m("onRetain")),y.stateRegistry.decorator("onEnter",m("onEnter")),y.viewService._pluginapi._viewConfigFactory("ng1",(0,s.OB)()),y.urlService.config._decodeParams=!1;var t=y.locationService=y.locationConfig=new l(e);function n(e,n,o,r,s,a,i){return t._runtimeServices(s,e,r,n,o),delete y.router,delete y.$get,y}return l.monkeyPatchPathParameterType(y),y.router=y,y.$get=n,n.$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],y}L.$inject=["$locationProvider"];var Y=function(e){return["$uiRouterProvider",function(t){var n=t.router[e];return n.$get=function(){return n},n}]};function g(e,t,n){if(r.services.$injector=e,r.services.$q=t,!Object.prototype.hasOwnProperty.call(e,"strictDi"))try{e.invoke((function(e){}))}catch(t){e.strictDi=!!/strict mode/.exec(t&&t.toString())}n.stateRegistry.get().map((function(e){return e.$$state().resolvables})).reduce(r.unnestR,[]).filter((function(e){return"deferred"===e.deps})).forEach((function(t){return t.deps=e.annotate(t.resolveFn,e.strictDi)}))}function v(e){e.$watch((function(){r.trace.approximateDigests++}))}g.$inject=["$injector","$q","$uiRouter"],v.$inject=["$rootScope"],c.provider("$uiRouter",L),f.provider("$urlRouter",["$uiRouterProvider",function(e){return e.urlRouterProvider=new _.L(e)}]),h.provider("$urlService",Y("urlService")),h.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return y.urlMatcherFactory}]),h.provider("$templateFactory",(function(){return new a})),p.provider("$stateRegistry",Y("stateRegistry")),p.provider("$uiRouterGlobals",Y("globals")),p.provider("$transitions",Y("transitionService")),p.provider("$state",["$uiRouterProvider",function(){return(0,r.extend)(y.stateProvider,{$get:function(){return y.stateService}})}]),p.factory("$stateParams",["$uiRouter",function(e){return e.globals.params}]),M.factory("$view",(function(){return y.viewService})),M.service("$trace",(function(){return r.trace})),M.run(v),h.run(["$urlMatcherFactory",function(e){}]),p.run(["$state",function(e){}]),f.run(["$urlRouter",function(e){}]),c.run(g);var k=function(e){return e.getTokens().filter(r.isString).map((function(t){var n=e.getResolvable(t);return[t,"NOWAIT"===e.getPolicy(n).async?n.promise:n.data]})).reduce(r.applyPairs,{})}},"./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js");function r(e){var t=function(t,n,o){return e.is(t,n,o)};return t.$stateful=!0,t}function s(e){var t=function(t,n,o){return e.includes(t,n,o)};return t.$stateful=!0,t}r.$inject=["$state"],s.$inject=["$state"],o.ng.module("ui.router.state").filter("isState",r).filter("includedByState",s)},"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(t,n){this.stateRegistry=t,this.stateService=n,(0,o.createProxyFunctions)((0,o.val)(e.prototype),this,(0,o.val)(this))}return e.prototype.decorator=function(e,t){return this.stateRegistry.decorator(e,t)||this},e.prototype.state=function(e,t){return(0,o.isObject)(e)?t=e:t.name=e,this.stateRegistry.register(t),this},e.prototype.onInvalid=function(e){return this.stateService.onInvalid(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js":(e,t,n)=>{"use strict";n.d(t,{OB:()=>r,LB:()=>a,qO:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/index.js");function r(){var e=null;return function(t,n){return e=e||o.services.$injector.get("$templateFactory"),[new d(t,n,e)]}}var s=function(e,t){return e.reduce((function(e,n){return e||(0,o.isDefined)(t[n])}),!1)};function a(e){if(!e.parent)return{};var t=["component","bindings","componentProvider"],n=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),r=t.concat(n);if((0,o.isDefined)(e.views)&&s(r,e))throw new Error("State '"+e.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+r.filter((function(t){return(0,o.isDefined)(e[t])})).join(", "));var a={},i=e.views||{$default:(0,o.pick)(e,r)};return(0,o.forEach)(i,(function(r,i){if(i=i||"$default",(0,o.isString)(r)&&(r={component:r}),r=(0,o.extend)({},r),s(t,r)&&s(n,r))throw new Error("Cannot combine: "+t.join("|")+" with: "+n.join("|")+" in stateview: '"+i+"@"+e.name+"'");r.resolveAs=r.resolveAs||"$resolve",r.$type="ng1",r.$context=e,r.$name=i;var d=o.ViewService.normalizeUIViewTarget(r.$context,r.$name);r.$uiViewName=d.uiViewName,r.$uiViewContextAnchor=d.uiViewContextAnchor,a[i]=r})),a}var i=0,d=function(){function e(e,t,n){var o=this;this.path=e,this.viewDecl=t,this.factory=n,this.$id=i++,this.loaded=!1,this.getTemplate=function(e,t){return o.component?o.factory.makeComponentTemplate(e,t,o.component,o.viewDecl.bindings):o.template}}return e.prototype.load=function(){var e=this,t=o.services.$q,n=new o.ResolveContext(this.path),r=this.path.reduce((function(e,t){return(0,o.extend)(e,t.paramValues)}),{}),s={template:t.when(this.factory.fromConfig(this.viewDecl,r,n)),controller:t.when(this.getController(n))};return t.all(s).then((function(t){return o.trace.traceViewServiceEvent("Loaded",e),e.controller=t.controller,(0,o.extend)(e,t.template),e}))},e.prototype.getController=function(e){var t=this.viewDecl.controllerProvider;if(!(0,o.isInjectable)(t))return this.viewDecl.controller;var n=o.services.$injector.annotate(t),r=(0,o.isArray)(t)?(0,o.tail)(t):t;return new o.Resolvable("",r,n).get(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(e){this.router=e}return e.injectableHandler=function(e,t){return function(n){return o.services.$injector.invoke(t,null,{$match:n,$stateParams:e.globals.params})}},e.prototype.$get=function(){var e=this.router.urlService;return this.router.urlRouter.update(!0),e.interceptDeferred||e.listen(),this.router.urlRouter},e.prototype.rule=function(e){var t=this;if(!(0,o.isFunction)(e))throw new Error("'rule' must be a function");var n=new o.BaseUrlRule((function(){return e(o.services.$injector,t.router.locationService)}),o.identity);return this.router.urlService.rules.rule(n),this},e.prototype.otherwise=function(e){var t=this,n=this.router.urlService.rules;if((0,o.isString)(e))n.otherwise(e);else{if(!(0,o.isFunction)(e))throw new Error("'rule' must be a string or function");n.otherwise((function(){return e(o.services.$injector,t.router.locationService)}))}return this},e.prototype.when=function(t,n){return((0,o.isArray)(n)||(0,o.isFunction)(n))&&(n=e.injectableHandler(this.router,n)),this.router.urlService.rules.when(t,n),this},e.prototype.deferIntercept=function(e){this.router.urlService.deferIntercept(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/angularjs/lib-esm/angular.js").ng.module("ui.router.state").provider("$uiViewScroll",(function(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,n){return e?t:function(e){return n((function(){e[0].scrollIntoView()}),0,!1)}}]}))},"./node_modules/@uirouter/core/lib-esm/common/common.js":(e,t,n)=>{"use strict";n.d(t,{Jz:()=>i,xZ:()=>u,Qs:()=>m,Ed:()=>l,l7:()=>_,fS:()=>c,yR:()=>h,ZT:()=>f,WR:()=>p,ED:()=>M,d3:()=>y,nA:()=>L,LH:()=>Y,Wk:()=>g,ce:()=>v,LQ:()=>k,mX:()=>j,ei:()=>w,CE:()=>b,hX:()=>D,sE:()=>T,js:()=>S,UI:()=>H,VO:()=>x,XC:()=>E,o8:()=>P,M7:()=>O,FN:()=>$,Ez:()=>A,v_:()=>F,UW:()=>R,sp:()=>W,ym:()=>C,bb:()=>z,Gb:()=>I,JG:()=>J,HX:()=>V,jv:()=>N});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),a=function(){for(var e=0,t=0,n=arguments.length;t=0&&e.splice(n,1),e})),Y=(0,r.WA)((function(e,t){return e.push(t),t})),g=function(e){return e.slice().forEach((function(t){"function"==typeof t&&t(),L(e,t)}))};function v(e){for(var t=[],n=1;n{"use strict";n.d(t,{H:()=>o,u:()=>r});var o=function(e,t){return t.reduce((function(t,n){return t[n]=(o=e+"."+n+"()",function(){throw new Error("No implementation for "+o+". The framework specific code did not implement this method.")}),t;var o}),{})},r={$q:void 0,$injector:void 0}},"./node_modules/@uirouter/core/lib-esm/common/glob.js":(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var o=function(){function e(e){this.text=e,this.glob=e.split(".");var t=this.text.split(".").map((function(e){return"**"===e?"(?:|(?:\\.[^.]*)*)":"*"===e?"\\.[^.]*":"\\."+e})).join("");this.regexp=new RegExp("^"+t+"$")}return e.is=function(e){return!!/[!,*]+/.exec(e)},e.fromString=function(t){return e.is(t)?new e(t):null},e.prototype.matches=function(e){return this.regexp.test("."+e)},e}()},"./node_modules/@uirouter/core/lib-esm/common/hof.js":(e,t,n)=>{"use strict";n.d(t,{WA:()=>r,zG:()=>a,vg:()=>i,OH:()=>d,Qc:()=>u,ff:()=>m,xD:()=>l,or:()=>_,$6:()=>c,Yj:()=>h,is:()=>f,P0:()=>p,uj:()=>M});var o=function(){for(var e=0,t=0,n=arguments.length;t=e.length)return e.apply(this,arguments);var n=Array.prototype.slice.call(arguments);return t.bind.apply(t,o([this],n))}}function s(){var e=arguments,t=e.length-1;return function(){for(var n=t,o=e[t].apply(this,arguments);n--;)o=e[n].call(this,o);return o}}function a(){for(var e=[],t=0;t{"use strict";n.d(t,{o8:()=>a,$K:()=>i,Ft:()=>d,le:()=>u,mf:()=>m,hj:()=>l,HD:()=>_,Kn:()=>c,kJ:()=>h,J_:()=>f,Kj:()=>p,Qh:()=>M,tI:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),r=Object.prototype.toString,s=function(e){return function(t){return typeof t===e}},a=s("undefined"),i=(0,o.ff)(a),d=function(e){return null===e},u=(0,o.or)(d,a),m=s("function"),l=s("number"),_=s("string"),c=function(e){return null!==e&&"object"==typeof e},h=Array.isArray,f=function(e){return"[object Date]"===r.call(e)},p=function(e){return"[object RegExp]"===r.call(e)};function M(e){if(h(e)&&e.length){var t=e.slice(0,-1),n=e.slice(-1);return!(t.filter((0,o.ff)(_)).length||n.filter((0,o.ff)(m)).length)}return m(e)}var y=(0,o.xD)(c,(0,o.zG)((0,o.vg)("then"),m))},"./node_modules/@uirouter/core/lib-esm/common/queue.js":(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=null),this._items=e,this._limit=t,this._evictListeners=[],this.onEvict=(0,o.LH)(this._evictListeners)}return e.prototype.enqueue=function(e){var t=this._items;return t.push(e),this._limit&&t.length>this._limit&&this.evict(),e},e.prototype.evict=function(){var e=this._items.shift();return this._evictListeners.forEach((function(t){return t(e)})),e},e.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},e.prototype.clear=function(){var e=this._items;return this._items=[],e},e.prototype.size=function(){return this._items.length},e.prototype.remove=function(e){var t=this._items.indexOf(e);return t>-1&&this._items.splice(t,1)[0]},e.prototype.peekTail=function(){return this._items[this._items.length-1]},e.prototype.peekHead=function(){if(this.size())return this._items[0]},e}()},"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r={log:o.ZT,error:o.ZT,table:o.ZT},s="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?function(e){var t=function(t){return Function.prototype.bind.call(t,e)};return{log:t(e.log),error:t(e.log),table:t(e.log)}}(window.console):r:console.table&&console.error?console:function(e){var t=e.log.bind(e);return{log:t,error:e.error?e.error.bind(e):t,table:e.table?e.table.bind(e):t}}(console)},"./node_modules/@uirouter/core/lib-esm/common/strings.js":(e,t,n)=>{"use strict";n.d(t,{BS:()=>i,NE:()=>d,L$:()=>u,XF:()=>m,iC:()=>l,Pz:()=>h,Lb:()=>p,cW:()=>M,C7:()=>y,Fb:()=>L,HV:()=>Y,PX:()=>g,iV:()=>v});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");function i(e,t){return t.length<=e?t:t.substr(0,e-3)+"..."}function d(e,t){for(;t.length{"use strict";n.d(t,{g4:()=>c});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js");function d(e){if(!e)return"ui-view (defunct)";var t=e.creationContext?e.creationContext.name||"(root)":"(none)";return"[ui-view#"+e.id+" "+e.$type+":"+e.fqn+" ("+e.name+"@"+t+")]"}function u(e){return(0,s.hj)(e)?o[e]:o[o[e]]}!function(e){e[e.RESOLVE=0]="RESOLVE",e[e.TRANSITION=1]="TRANSITION",e[e.HOOK=2]="HOOK",e[e.UIVIEW=3]="UIVIEW",e[e.VIEWCONFIG=4]="VIEWCONFIG"}(o||(o={}));var m=(0,r.Qc)("$id"),l=(0,r.Qc)("router.$id"),_=function(e){return"Transition #"+m(e)+"-"+l(e)},c=new(function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,t){var n=this;t.length||(t=Object.keys(o).map((function(e){return parseInt(e,10)})).filter((function(e){return!isNaN(e)})).map((function(e){return o[e]}))),t.map(u).forEach((function(t){return n._enabled[t]=e}))},e.prototype.enable=function(){for(var e=[],t=0;t "+(0,a.Pz)(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Ignored <> "+(0,a.Pz)(e))},e.prototype.traceHookInvocation=function(e,t,n){if(this.enabled(o.HOOK)){var s=(0,r.Qc)("traceData.hookType")(n)||"internal",d=(0,r.Qc)("traceData.context.state.name")(n)||(0,r.Qc)("traceData.context")(n)||"unknown",u=(0,a.XF)(e.registeredHook.callback);i.L.log(_(t)+": Hook -> "+s+" context: "+d+", "+(0,a.BS)(200,u))}},e.prototype.traceHookResult=function(e,t,n){this.enabled(o.HOOK)&&i.L.log(_(t)+": <- Hook returned: "+(0,a.BS)(200,(0,a.Pz)(e)))},e.prototype.traceResolvePath=function(e,t,n){this.enabled(o.RESOLVE)&&i.L.log(_(n)+": Resolving "+e+" ("+t+")")},e.prototype.traceResolvableResolved=function(e,t){this.enabled(o.RESOLVE)&&i.L.log(_(t)+": <- Resolved "+e+" to: "+(0,a.BS)(200,(0,a.Pz)(e.data)))},e.prototype.traceError=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Rejected "+(0,a.Pz)(t)+", reason: "+e)},e.prototype.traceSuccess=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Success "+(0,a.Pz)(t)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,t,n){void 0===n&&(n=""),this.enabled(o.UIVIEW)&&i.L.log("ui-view: "+(0,a.NE)(30,e)+" "+d(t)+n)},e.prototype.traceUIViewConfigUpdated=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+t+"'")},e.prototype.traceUIViewFill=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+(0,a.BS)(200,t))},e.prototype.traceViewSync=function(e){if(this.enabled(o.VIEWCONFIG)){var t="uiview component fqn",n=e.map((function(e){var n,o=e.uiView,r=e.viewConfig,s=o&&o.fqn,a=r&&r.viewDecl.$context.name+": ("+r.viewDecl.$name+")";return(n={})[t]=s,n["view config state (view name)"]=a,n})).sort((function(e,n){return(e[t]||"").localeCompare(n[t]||"")}));i.L.table(n)}},e.prototype.traceViewServiceEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+function(e){var t=e.viewDecl,n=t.$context.name||"(root)";return"[View#"+e.$id+" from '"+n+"' state]: target ui-view: '"+t.$uiViewName+"@"+t.$uiViewContextAnchor+"'"}(t))},e.prototype.traceViewServiceUIViewEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+d(t))},e}())},"./node_modules/@uirouter/core/lib-esm/globals.js":(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/queue.js"),s=function(){function e(){this.params=new o.i,this.lastStartedTransitionId=-1,this.transitionHistory=new r.c([],1),this.successfulTransitions=new r.c([],1)}return e.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},e}()},"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js":(e,t,n)=>{"use strict";n.d(t,{v:()=>s,A:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),r=function(e){var t=e.router,n=e.entering().filter((function(e){return!!e.$$state().lazyLoad})).map((function(t){return a(e,t)}));return o.u.$q.all(n).then((function(){if("url"!==e.originalTransition().options().source){var n=e.targetState();return t.stateService.target(n.identifier(),n.params(),n.options())}var o=t.urlService,r=o.match(o.parts()),s=r&&r.rule;if(s&&"STATE"===s.type){var a=s.state,i=r.match;return t.stateService.target(a,i,e.options())}t.urlService.sync()}))},s=function(e){return e.onBefore({entering:function(e){return!!e.lazyLoad}},r)};function a(e,t){var n=t.$$state().lazyLoad,r=n._promise;return r||(r=n._promise=o.u.$q.when(n(e,t)).then((function(t){return t&&Array.isArray(t.states)&&t.states.forEach((function(t){return e.router.stateRegistry.register(t)})),t})).then((function(e){return delete t.lazyLoad,delete t.$$state().lazyLoad,delete n._promise,e}),(function(e){return delete n._promise,o.u.$q.reject(e)}))),r}},"./node_modules/@uirouter/core/lib-esm/interface.js":(e,t,n)=>{},"./node_modules/@uirouter/core/lib-esm/params/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/params/param.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>o,d:()=>m});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=Object.prototype.hasOwnProperty;!function(e){e[e.PATH=0]="PATH",e[e.SEARCH=1]="SEARCH",e[e.CONFIG=2]="CONFIG"}(o||(o={}));var m=function(){function e(e,t,n,i,m){var l=function(e,t,n){var s=!1===n.reloadOnSearch&&t===o.SEARCH||void 0,i=(0,r.sE)([n.dynamic,s],a.$K),d=(0,a.$K)(i)?{dynamic:i}:{},m=function(e){function t(){return e.value}e=function(e){return 0===["value","type","squash","array","dynamic"].filter(u.bind(e||{})).length}(e)?{value:e}:e,t.__cacheable=!0;var n=(0,a.Qh)(e.value)?e.value:t;return(0,r.l7)(e,{$$fn:n})}(n&&n.params&&n.params[e]);return(0,r.l7)(d,m)}(e,n,m);t=function(e,t,n,r,s){if(e.type&&t&&"string"!==t.name)throw new Error("Param '"+r+"' has two type configurations.");if(e.type&&t&&"string"===t.name&&s.type(e.type))return s.type(e.type);if(t)return t;if(!e.type){var a=n===o.CONFIG?"any":n===o.PATH?"path":n===o.SEARCH?"query":"string";return s.type(a)}return e.type instanceof d._?e.type:s.type(e.type)}(l,t,n,e,i.paramTypes);var _,c,h=(_={array:n===o.SEARCH&&"auto"},c=e.match(/\[\]$/)?{array:!0}:{},(0,r.l7)(_,c,l).array);t=h?t.$asArray(h,n===o.SEARCH):t;var f=void 0!==l.value||n===o.SEARCH,p=(0,a.$K)(l.dynamic)?!!l.dynamic:!!t.dynamic,M=(0,a.$K)(l.raw)?!!l.raw:!!t.raw,y=function(e,t,n){var o=e.squash;if(!t||!1===o)return!1;if(!(0,a.$K)(o)||null==o)return n;if(!0===o||(0,a.HD)(o))return o;throw new Error("Invalid squash policy: '"+o+"'. Valid policies: false, true, or arbitrary string")}(l,f,i.defaultSquashPolicy()),L=function(e,t,n,o){var i=[{from:"",to:n||t?void 0:""},{from:null,to:n||t?void 0:""}],d=(0,a.kJ)(e.replace)?e.replace:[];(0,a.HD)(o)&&d.push({from:o,to:void 0});var u=(0,r.UI)(d,(0,s.vg)("from"));return(0,r.hX)(i,(function(e){return-1===u.indexOf(e.from)})).concat(d)}(l,h,f,y),Y=(0,a.$K)(l.inherit)?!!l.inherit:!!t.inherit;(0,r.l7)(this,{id:e,type:t,location:n,isOptional:f,dynamic:p,raw:M,squash:y,replace:L,inherit:Y,array:h,config:l})}return e.values=function(e,t){void 0===t&&(t={});for(var n={},o=0,r=e;o{"use strict";n.d(t,{_:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=function(){function e(e){this.pattern=/.*/,this.inherit=!0,(0,o.l7)(this,e)}return e.prototype.is=function(e,t){return!0},e.prototype.encode=function(e,t){return e},e.prototype.decode=function(e,t){return e},e.prototype.equals=function(e,t){return e==t},e.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},e.prototype.toString=function(){return"{ParamType:"+this.name+"}"},e.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},e.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new a(this,e)},e}();function a(e,t){var n=this;function s(e){return(0,r.kJ)(e)?e:(0,r.$K)(e)?[e]:[]}function a(e,n){return function(a){if((0,r.kJ)(a)&&0===a.length)return a;var i=s(a),d=(0,o.UI)(i,e);return!0===n?0===(0,o.hX)(d,(function(e){return!e})).length:function(e){switch(e.length){case 0:return;case 1:return"auto"===t?e[0]:e;default:return e}}(d)}}function i(e){return function(t,n){var o=s(t),r=s(n);if(o.length!==r.length)return!1;for(var a=0;a{"use strict";n.d(t,{p:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=function(){function e(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=(0,r.ei)(e.prototype,["hash","string","query","path","int","bool","date","json","any"]),this.types=(0,r.ED)((0,r.UI)(this.defaultTypes,(function(e,t){return new d._((0,r.l7)({name:t},e))})),{})}return e.prototype.dispose=function(){this.types={}},e.prototype.type=function(e,t,n){if(!(0,s.$K)(t))return this.types[e];if(this.types.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return this.types[e]=new d._((0,r.l7)({name:e},t)),n&&(this.typeQueue.push({name:e,def:n}),this.enqueue||this._flushTypeQueue()),this},e.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var e=this.typeQueue.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");(0,r.l7)(this.types[e.name],i.u.$injector.invoke(e.def))}},e}();o=function(e){var t=function(e){return null!=e?e.toString():e},n={encode:t,decode:t,is:(0,a.is)(String),pattern:/.*/,equals:function(e,t){return e==t}};return(0,r.l7)({},n,e)},(0,r.l7)(u.prototype,{string:o({}),path:o({pattern:/[^/]*/}),query:o({}),hash:o({inherit:!1}),int:o({decode:function(e){return parseInt(e,10)},is:function(e){return!(0,s.le)(e)&&this.decode(e.toString())===e},pattern:/-?\d+/}),bool:o({encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:(0,a.is)(Boolean),pattern:/0|1/}),date:o({encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):void 0},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):void 0},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return["getFullYear","getMonth","getDate"].reduce((function(n,o){return n&&e[o]()===t[o]()}),!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:o({encode:r.Qs,decode:r.xZ,is:(0,a.is)(Object),equals:r.fS,pattern:/[^/]*/}),any:o({encode:r.yR,decode:r.yR,is:function(){return!0},equals:r.fS})})},"./node_modules/@uirouter/core/lib-esm/params/stateParams.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e){void 0===e&&(e={}),(0,o.l7)(this,e)}return e.prototype.$inherit=function(e,t,n){var r,s=(0,o.mX)(t,n),a={},i=[];for(var d in s)if(s[d]&&s[d].params&&(r=Object.keys(s[d].params)).length)for(var u in r)i.indexOf(r[u])>=0||(i.push(r[u]),a[r[u]]=this[r[u]]);return(0,o.l7)({},a,e)},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathNode.js":(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/param.js"),a=function(){function e(t){if(t instanceof e){var n=t;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=(0,o.l7)({},n.paramValues),this.resolvables=n.resolvables.slice(),this.views=n.views&&n.views.slice()}else{var r=t;this.state=r,this.paramSchema=r.parameters({inherit:!1}),this.paramValues={},this.resolvables=r.resolvables.map((function(e){return e.clone()}))}}return e.prototype.clone=function(){return new e(this)},e.prototype.applyRawParams=function(e){return this.paramValues=this.paramSchema.reduce((function(t,n){return(0,o.bb)(t,[(r=n).id,r.value(e[r.id])]);var r}),{}),this},e.prototype.parameter=function(e){return(0,o.sE)(this.paramSchema,(0,r.OH)("id",e))},e.prototype.equals=function(e,t){var n=this.diff(e,t);return n&&0===n.length},e.prototype.diff=function(e,t){if(this.state!==e.state)return!1;var n=t?t(this):this.paramSchema;return s.d.changed(n,this.paramValues,e.paramValues)},e.clone=function(e){return e.clone()},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js":(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),a=n("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),i=function(){function e(){}return e.makeTargetState=function(e,t){var n=(0,o.Gb)(t).state;return new s.F(e,n,t.map((0,r.vg)("paramValues")).reduce(o.LQ,{}),{})},e.buildPath=function(e){var t=e.params();return e.$state().path.map((function(e){return new a.V(e).applyRawParams(t)}))},e.buildToPath=function(t,n){var o=e.buildPath(n);return n.options().inherit?e.inheritParams(t,o,Object.keys(n.params())):o},e.applyViewConfigs=function(t,n,r){n.filter((function(e){return(0,o.d3)(r,e.state)})).forEach((function(r){var s=(0,o.VO)(r.state.views||{}),a=e.subPath(n,(function(e){return e===r})),i=s.map((function(e){return t.createViewConfig(a,e)}));r.views=i.reduce(o.M7,[])}))},e.inheritParams=function(e,t,n){void 0===n&&(n=[]);var s=e.map((function(e){return e.paramSchema})).reduce(o.M7,[]).filter((function(e){return!e.inherit})).map((0,r.vg)("id"));return t.map((function(t){var i=(0,o.l7)({},t&&t.paramValues),d=(0,o.ei)(i,n);i=(0,o.CE)(i,n);var u,m,l,_=(0,o.CE)((u=e,m=t.state,l=(0,o.sE)(u,(0,r.OH)("state",m)),(0,o.l7)({},l&&l.paramValues)||{}),s),c=(0,o.l7)(i,_,d);return new a.V(t.state).applyRawParams(c)}))},e.treeChanges=function(t,n,o){for(var r,s,a,i,d,u,m=Math.min(t.length,n.length),l=0;l{"use strict";n.d(t,{u:()=>o});var o={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}}},"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),d=function(){function e(t,n,s,a,d){if(this.resolved=!1,this.promise=void 0,t instanceof e)(0,o.l7)(this,t);else if((0,i.mf)(n)){if((0,i.le)(t))throw new Error("new Resolvable(): token argument is required");if(!(0,i.mf)(n))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=t,this.policy=a,this.resolveFn=n,this.deps=s||[],this.data=d,this.resolved=void 0!==d,this.promise=this.resolved?r.u.$q.when(this.data):void 0}else if((0,i.Kn)(t)&&t.token&&(t.hasOwnProperty("resolveFn")||t.hasOwnProperty("data"))){var u=t;return new e(u.token,u.resolveFn,u.deps,u.policy,u.data)}}return e.prototype.getPolicy=function(e){var t=this.policy||{},n=e&&e.resolvePolicy||{};return{when:t.when||n.when||"LAZY",async:t.async||n.async||"WAIT"}},e.prototype.resolve=function(e,t){var n=this,a=r.u.$q,d=e.findNode(this),u=d&&d.state,m=this.getPolicy(u).async,l=(0,i.mf)(m)?m:o.yR;return this.promise=a.when().then((function(){return a.all(e.getDependencies(n).map((function(n){return n.get(e,t)})))})).then((function(e){return n.resolveFn.apply(null,e)})).then(l).then((function(e){return n.data=e,n.resolved=!0,n.resolveFn=null,s.g4.traceResolvableResolved(n,t),n.data}))},e.prototype.get=function(e,t){return this.promise||this.resolve(e,t)},e.prototype.toString=function(){return"Resolvable(token: "+(0,a.Pz)(this.token)+", requires: ["+this.deps.map(a.Pz)+"])"},e.prototype.clone=function(){return new e(this)},e.fromData=function(t,n){return new e(t,(function(){return n}),null,null,n)},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>f});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/interface.js"),d=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),u=n("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),_=i.u.when,c=[_.EAGER,_.LAZY],h=[_.EAGER],f=function(){function e(e){this._path=e}return e.prototype.getTokens=function(){return this._path.reduce((function(e,t){return e.concat(t.resolvables.map((function(e){return e.token})))}),[]).reduce(o.v_,[])},e.prototype.getResolvable=function(e){var t=this._path.map((function(e){return e.resolvables})).reduce(o.M7,[]).filter((function(t){return t.token===e}));return(0,o.Gb)(t)},e.prototype.getPolicy=function(e){var t=this.findNode(e);return e.getPolicy(t.state)},e.prototype.subContext=function(t){return new e(u.C.subPath(this._path,(function(e){return e.state===t})))},e.prototype.addResolvables=function(e,t){var n=(0,o.sE)(this._path,(0,r.OH)("state",t)),s=e.map((function(e){return e.token}));n.resolvables=n.resolvables.filter((function(e){return-1===s.indexOf(e.token)})).concat(e)},e.prototype.resolvePath=function(e,t){var n=this;void 0===e&&(e="LAZY");var d=((0,o.d3)(c,e)?e:"LAZY")===i.u.when.EAGER?h:c;s.g4.traceResolvePath(this._path,e,t);var u=function(e,t){return function(r){return(0,o.d3)(e,n.getPolicy(r)[t])}},m=this._path.reduce((function(e,o){var s=o.resolvables.filter(u(d,"when")),a=s.filter(u(["NOWAIT"],"async")),i=s.filter((0,r.ff)(u(["NOWAIT"],"async"))),m=n.subContext(o.state),l=function(e){return e.get(m,t).then((function(t){return{token:e.token,value:t}}))};return a.forEach(l),e.concat(i.map(l))}),[]);return a.u.$q.all(m)},e.prototype.injector=function(){return this._injector||(this._injector=new p(this))},e.prototype.findNode=function(e){return(0,o.sE)(this._path,(function(t){return(0,o.d3)(t.resolvables,e)}))},e.prototype.getDependencies=function(e){var t=this,n=this.findNode(e),r=(u.C.subPath(this._path,(function(e){return e===n}))||this._path).reduce((function(e,t){return e.concat(t.resolvables)}),[]).filter((function(t){return t!==e}));return e.deps.map((function(e){var n=r.filter((function(t){return t.token===e}));if(n.length)return(0,o.Gb)(n);var s=t.injector().getNative(e);if((0,l.wV)(s))throw new Error("Could not find Dependency Injection token: "+(0,m.Pz)(e));return new d.X(e,(function(){return s}),[],s)}))},e}(),p=function(){function e(e){this.context=e,this.native=this.get("Native Injector")||a.u.$injector}return e.prototype.get=function(e){var t=this.context.getResolvable(e);if(t){if("NOWAIT"===this.context.getPolicy(t).async)return t.get(this.context);if(!t.resolved)throw new Error("Resolvable async .get() not complete:"+(0,m.Pz)(t.token));return t.data}return this.getNative(e)},e.prototype.getAsync=function(e){var t=this.context.getResolvable(e);return t?t.get(this.context):a.u.$q.when(this.native.get(e))},e.prototype.getNative=function(e){return this.native&&this.native.get(e)},e}()},"./node_modules/@uirouter/core/lib-esm/router.js":(e,t,n)=>{"use strict";n.d(t,{a:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"),a=n("./node_modules/@uirouter/core/lib-esm/view/view.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),d=n("./node_modules/@uirouter/core/lib-esm/state/stateService.js"),u=n("./node_modules/@uirouter/core/lib-esm/globals.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),_=n("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),c=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),f=0,p=(0,h.HV)("LocationServices",["url","path","search","hash","onChange"]),M=(0,h.HV)("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),y=function(){function e(e,t){void 0===e&&(e=p),void 0===t&&(t=M),this.locationService=e,this.locationConfig=t,this.$id=f++,this._disposed=!1,this._disposables=[],this.trace=c.g4,this.viewService=new a.s(this),this.globals=new u.k,this.transitionService=new s.Z(this),this.urlMatcherFactory=new o.y(this),this.urlRouter=new r.g(this),this.urlService=new _.i(this),this.stateRegistry=new i.q(this),this.stateService=new d.b(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(e),this.disposable(t)}return e.prototype.disposable=function(e){this._disposables.push(e)},e.prototype.dispose=function(e){var t=this;e&&(0,l.mf)(e.dispose)?e.dispose(this):(this._disposed=!0,this._disposables.slice().forEach((function(e){try{"function"==typeof e.dispose&&e.dispose(t),(0,m.nA)(t._disposables,e)}catch(e){}})))},e.prototype.plugin=function(e,t){void 0===t&&(t={});var n=new e(this,t);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},e.prototype.getPlugin=function(e){return e?this._plugins[e]:(0,m.VO)(this._plugins)},e}()},"./node_modules/@uirouter/core/lib-esm/state/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>M});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js");function u(e){return e.name}function m(e){return e.self.$$state=function(){return e},e.self}function l(e){return e.parent&&e.parent.data&&(e.data=e.self.data=(0,o.ED)(e.parent.data,e.data)),e.data}var _=function(e,t){return function(n){var s=n.self;if(s&&s.url&&s.name&&s.name.match(/\.\*\*$/)){var a={};(0,o.JG)(s,a),a.url+="{remainder:any}",s=a}var i=n.parent,d=function(e){if(!(0,r.HD)(e))return!1;var t="^"===e.charAt(0);return{val:t?e.substring(1):e,root:t}}(s.url),u=d?e.compile(d.val,{state:s}):s.url;if(!u)return null;if(!e.isMatcher(u))throw new Error("Invalid url '"+u+"' in state '"+n+"'");return d&&d.root?u:(i&&i.navigable||t()).url.append(u)}},c=function(e){return function(t){return!e(t)&&t.url?t:t.parent?t.parent.navigable:null}};function h(e){return e.parent?e.parent.path.concat(e):[e]}function f(e){var t=e.parent?(0,o.l7)({},e.parent.includes):{};return t[e.name]=!0,t}function p(e){var t,n,u=function(e){return e.provide||e.token},m=(0,a.uj)([[(0,a.vg)("resolveFn"),function(e){return new i.X(u(e),e.resolveFn,e.deps,e.policy)}],[(0,a.vg)("useFactory"),function(e){return new i.X(u(e),e.useFactory,e.deps||e.dependencies,e.policy)}],[(0,a.vg)("useClass"),function(e){return new i.X(u(e),(function(){return new e.useClass}),[],e.policy)}],[(0,a.vg)("useValue"),function(e){return new i.X(u(e),(function(){return e.useValue}),[],e.policy,e.useValue)}],[(0,a.vg)("useExisting"),function(e){return new i.X(u(e),o.yR,[e.useExisting],e.policy)}]]),l=(0,a.uj)([[(0,a.zG)((0,a.vg)("val"),r.HD),function(e){return new i.X(e.token,o.yR,[e.val],e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.kJ),function(e){return new i.X(e.token,(0,o.Gb)(e.val),e.val.slice(0,-1),e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.mf),function(e){return new i.X(e.token,e.val,(t=e.val,n=d.u.$injector,t.$inject||n&&n.annotate(t,n.strictDi)||"deferred"),e.policy);var t,n}]]),_=(0,a.uj)([[(0,a.is)(i.X),function(e){return e}],[function(e){return!(!e.token||!e.resolveFn)},m],[function(e){return!(!e.provide&&!e.token||!(e.useValue||e.useFactory||e.useExisting||e.useClass))},m],[function(e){return!!(e&&e.val&&((0,r.HD)(e.val)||(0,r.kJ)(e.val)||(0,r.mf)(e.val)))},l],[(0,a.P0)(!0),function(e){throw new Error("Invalid resolve value: "+(0,s.Pz)(e))}]]),c=e.resolve;return((0,r.kJ)(c)?c:(t=c,n=e.resolvePolicy||{},Object.keys(t||{}).map((function(e){return{token:e,val:t[e],deps:void 0,policy:n[e]}})))).map(_)}var M=function(){function e(e,t){this.matcher=e;var n,r=this,s=function(){return e.find("")},i=function(e){return""===e.name};this.builders={name:[u],self:[m],parent:[function(t){return i(t)?null:e.find(r.parentName(t))||s()}],data:[l],url:[_(t,s)],navigable:[c(i)],params:[(n=t.paramFactory,function(e){var t=e.url&&e.url.parameters({inherit:!1})||[],r=(0,o.VO)((0,o.js)((0,o.CE)(e.params||{},t.map((0,a.vg)("id"))),(function(t,o){return n.fromConfig(o,null,e.self)})));return t.concat(r).map((function(e){return[e.id,e]})).reduce(o.bb,{})})],views:[],path:[h],includes:[f],resolvables:[p]}}return e.prototype.builder=function(e,t){var n=this.builders,o=n[e]||[];return(0,r.HD)(e)&&!(0,r.$K)(t)?o.length>1?o:o[0]:(0,r.HD)(e)&&(0,r.mf)(t)?(n[e]=o,n[e].push(t),function(){return n[e].splice(n[e].indexOf(t,1))&&null}):void 0},e.prototype.build=function(e){var t=this.matcher,n=this.builders,r=this.parentName(e);if(r&&!t.find(r,void 0,!1))return null;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s].reduce((function(e,t){return function(n){return t(n,e)}}),o.ZT);e[s]=a(e)}return e},e.prototype.parentName=function(e){var t=e.name||"",n=t.split(".");if("**"===n.pop()&&n.pop(),n.length){if(e.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+t+")");return n.join(".")}return e.parent?(0,r.HD)(e.parent)?e.parent:e.parent.name:""},e.prototype.name=function(e){var t=e.name;if(-1!==t.indexOf(".")||!e.parent)return t;var n=(0,r.HD)(e.parent)?e.parent:e.parent.name;return n?n+"."+t:t},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js":(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"),a=function(){function e(e){this._states=e}return e.prototype.isRelative=function(e){return 0===(e=e||"").indexOf(".")||0===e.indexOf("^")},e.prototype.find=function(e,t,n){if(void 0===n&&(n=!0),e||""===e){var a=(0,o.HD)(e),i=a?e:e.name;this.isRelative(i)&&(i=this.resolvePath(i,t));var d=this._states[i];if(d&&(a||!(a||d!==e&&d.self!==e)))return d;if(a&&n){var u=(0,r.VO)(this._states).filter((function(e){return e.__stateObjectCache.nameGlob&&e.__stateObjectCache.nameGlob.matches(i)}));return u.length>1&&s.L.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map((function(e){return e.name}))),u[0]}}},e.prototype.resolvePath=function(e,t){if(!t)throw new Error("No reference point given for path '"+e+"'");for(var n=this.find(t),o=e.split("."),r=o.length,s=0,a=n;s{"use strict";n.d(t,{l:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/glob.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=function(){function e(t){return e.create(t||{})}return e.create=function(t){t=e.isStateClass(t)?new t:t;var n=(0,o.ED)((0,o.ED)(t,e.prototype));return t.$$state=function(){return n},n.self=t,n.__stateObjectCache={nameGlob:s.r.fromString(n.name)},n},e.prototype.is=function(e){return this===e||this.self===e||this.fqn()===e},e.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var e=this.parent.fqn();return e?e+"."+this.name:this.name},e.prototype.root=function(){return this.parent&&this.parent.root()||this},e.prototype.parameters=function(e){return((e=(0,o.ce)(e,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat((0,o.VO)(this.params)).filter((function(t){return!e.matchingKeys||e.matchingKeys.hasOwnProperty(t.id)}))},e.prototype.parameter=function(e,t){return void 0===t&&(t={}),this.url&&this.url.parameter(e,t)||(0,o.sE)((0,o.VO)(this.params),(0,r.OH)("id",e))||t.inherit&&this.parent&&this.parent.parameter(e)},e.prototype.toString=function(){return this.fqn()},e.isStateClass=function(e){return(0,a.mf)(e)&&!0===e.__uiRouterState},e.isStateDeclaration=function(e){return(0,a.mf)(e.$$state)},e.isState=function(e){return(0,a.Kn)(e.__stateObjectCache)},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),s=function(){function e(e,t,n,o){this.router=e,this.states=t,this.builder=n,this.listeners=o,this.queue=[]}return e.prototype.dispose=function(){this.queue=[]},e.prototype.register=function(e){var t=this.queue,n=r.l.create(e),s=n.name;if(!(0,o.HD)(s))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(s)||(0,o.d3)(t.map((0,o.vg)("name")),s))throw new Error("State '"+s+"' is already defined");return t.push(n),this.flush(),n},e.prototype.flush=function(){for(var e=this,t=this,n=t.queue,o=t.states,r=t.builder,s=[],a=[],i={},d=function(t){return e.states.hasOwnProperty(t)&&e.states[t]},u=function(){s.length&&e.listeners.forEach((function(e){return e("registered",s.map((function(e){return e.self})))}))};n.length>0;){var m=n.shift(),l=m.name,_=r.build(m),c=a.indexOf(m);if(_){var h=d(l);if(h&&h.name===l)throw new Error("State '"+l+"' is already defined");var f=d(l+".**");f&&this.router.stateRegistry.deregister(f),o[l]=m,this.attachRoute(m),c>=0&&a.splice(c,1),s.push(m)}else{var p=i[l];if(i[l]=n.length,c>=0&&p===n.length)return n.push(m),u(),o;c<0&&a.push(m),n.push(m)}}return u(),o},e.prototype.attachRoute=function(e){if(!e.abstract&&e.url){var t=this.router.urlService.rules;t.rule(t.urlRuleFactory.create(e))}},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js":(e,t,n)=>{"use strict";n.d(t,{q:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=function(){function e(e){this.router=e,this.states={},this.listeners=[],this.matcher=new o.Q(this.states),this.builder=new r.t(this.matcher,e.urlMatcherFactory),this.stateQueue=new s.L(e,this.states,this.builder,this.listeners),this._registerRoot()}return e.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},e.prototype.dispose=function(){var e=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach((function(t){return e.get(t)&&e.deregister(t)}))},e.prototype.onStatesChanged=function(e){return this.listeners.push(e),function(){(0,a.nA)(this.listeners)(e)}.bind(this)},e.prototype.root=function(){return this._root},e.prototype.register=function(e){return this.stateQueue.register(e)},e.prototype._deregisterTree=function(e){var t=this,n=this.get().map((function(e){return e.$$state()})),o=function(e){var t=n.filter((function(t){return-1!==e.indexOf(t.parent)}));return 0===t.length?t:t.concat(o(t))},r=o([e]),s=[e].concat(r).reverse();return s.forEach((function(e){var n=t.router.urlService.rules;n.rules().filter((0,i.OH)("state",e)).forEach((function(e){return n.removeRule(e)})),delete t.states[e.name]})),s},e.prototype.deregister=function(e){var t=this.get(e);if(!t)throw new Error("Can't deregister state; not found: "+e);var n=this._deregisterTree(t.$$state());return this.listeners.forEach((function(e){return e("deregistered",n.map((function(e){return e.self})))})),n},e.prototype.get=function(e,t){var n=this;if(0===arguments.length)return Object.keys(this.states).map((function(e){return n.states[e].self}));var o=this.matcher.find(e,t);return o&&o.self||null},e.prototype.decorator=function(e,t){return this.builder.builder(e,t)},e}()},"./node_modules/@uirouter/core/lib-esm/state/targetState.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=function(){function e(e,t,n,o){this._stateRegistry=e,this._identifier=t,this._identifier=t,this._params=(0,s.l7)({},n||{}),this._options=(0,s.l7)({},o||{}),this._definition=e.matcher.find(t,this._options.relative)}return e.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},e.prototype.identifier=function(){return this._identifier},e.prototype.params=function(){return this._params},e.prototype.$state=function(){return this._definition},e.prototype.state=function(){return this._definition&&this._definition.self},e.prototype.options=function(){return this._options},e.prototype.exists=function(){return!(!this._definition||!this._definition.self)},e.prototype.valid=function(){return!this.error()},e.prototype.error=function(){var e=this.options().relative;if(!this._definition&&e){var t=e.name?e.name:e;return"Could not resolve '"+this.name()+"' from state '"+t+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},e.prototype.toString=function(){return"'"+this.name()+"'"+(0,r.Pz)(this.params())},e.prototype.withState=function(t){return new e(this._stateRegistry,t,this._params,this._options)},e.prototype.withParams=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._params,t);return new e(this._stateRegistry,this._identifier,o,this._options)},e.prototype.withOptions=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._options,t);return new e(this._stateRegistry,this._identifier,this._params,o)},e.isDef=function(e){return e&&e.state&&((0,o.HD)(e.state)||(0,o.Kn)(e.state)&&(0,o.HD)(e.state.name))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js":(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),a=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),i=function(){function e(e){this.transition=e}return e.prototype.buildHooksForPhase=function(e){var t=this;return this.transition.router.transitionService._pluginapi._getEvents(e).map((function(e){return t.buildHooks(e)})).reduce(o.M7,[]).filter(o.yR)},e.prototype.buildHooks=function(e){var t=this.transition,n=t.treeChanges(),r=this.getMatchingHooks(e,n,t);if(!r)return[];var i,d={transition:t,current:t.options().current};return r.map((function(r){return r.matches(n,t)[e.criteriaMatchPath.name].map((function(n){var i=(0,o.l7)({bind:r.bind,traceData:{hookType:e.name,context:n}},d),u=e.criteriaMatchPath.scope===s.c.STATE?n.state.self:null,m=new a.I(t,u,r,i);return{hook:r,node:n,transitionHook:m}}))})).reduce(o.M7,[]).sort((i=e.reverseSort,void 0===i&&(i=!1),function(e,t){var n=i?-1:1,o=(e.node.state.path.length-t.node.state.path.length)*n;return 0!==o?o:t.hook.priority-e.hook.priority})).map((function(e){return e.transitionHook}))},e.prototype.getMatchingHooks=function(e,t,n){var a=e.hookPhase===s.k.CREATE,i=this.transition.router.transitionService;return(a?[i]:[this.transition,i]).map((function(t){return t.getHooks(e.name)})).filter((0,o.sp)(r.kJ,"broken event named: "+e.name)).reduce(o.M7,[]).filter((function(e){return e.matches(t,n)}))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js":(e,t,n)=>{"use strict";n.d(t,{cN:()=>s,BU:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js");function s(e,t,n){var r=(0,o.HD)(t)?[t]:t;return!!((0,o.mf)(r)?r:function(e){for(var t=r,n=0;n{"use strict";var o,r;n.d(t,{k:()=>o,c:()=>r}),function(e){e[e.CREATE=0]="CREATE",e[e.BEFORE=1]="BEFORE",e[e.RUN=2]="RUN",e[e.SUCCESS=3]="SUCCESS",e[e.ERROR=4]="ERROR"}(o||(o={})),function(e){e[e.TRANSITION=0]="TRANSITION",e[e.STATE=1]="STATE"}(r||(r={}))},"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js":(e,t,n)=>{"use strict";n.d(t,{K:()=>o,i:()=>d});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");!function(e){e[e.SUPERSEDED=2]="SUPERSEDED",e[e.ABORTED=3]="ABORTED",e[e.INVALID=4]="INVALID",e[e.IGNORED=5]="IGNORED",e[e.ERROR=6]="ERROR"}(o||(o={}));var i=0,d=function(){function e(e,t,n){this.$id=i++,this.type=e,this.message=t,this.detail=n}return e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&(0,a.is)(e)(t._transitionRejection)},e.superseded=function(t,n){var r=new e(o.SUPERSEDED,"The transition has been superseded by a different transition",t);return n&&n.redirected&&(r.redirected=!0),r},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(t){return new e(o.INVALID,"This transition is invalid",t)},e.ignored=function(t){return new e(o.IGNORED,"The transition was ignored",t)},e.aborted=function(t){return new e(o.ABORTED,"The transition has been aborted",t)},e.errored=function(t){return new e(o.ERROR,"The transition errored",t)},e.normalize=function(t){return(0,a.is)(e)(t)?t:e.errored(t)},e.prototype.toString=function(){var e,t=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():(0,s.Pz)(e),n=this;return"Transition Rejection($id: "+n.$id+" type: "+n.type+", message: "+n.message+", detail: "+t+")"},e.prototype.toPromise=function(){return(0,r.l7)((0,r.jv)(this),{_transitionRejection:this})},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r=function(e,t,n,r,s,a,i,d){void 0===s&&(s=!1),void 0===a&&(a=o.I.HANDLE_RESULT),void 0===i&&(i=o.I.REJECT_ERROR),void 0===d&&(d=!1),this.name=e,this.hookPhase=t,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=s,this.getResultHandler=a,this.getErrorHandler=i,this.synchronous=d}},"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>c});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),u=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),m=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),l=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),_={current:r.ZT,transition:null,traceData:{},bind:null},c=function(){function e(e,t,n,s){var a=this;this.transition=e,this.stateContext=t,this.registeredHook=n,this.options=s,this.isSuperseded=function(){return a.type.hookPhase===o.k.RUN&&!a.options.transition.isActive()},this.options=(0,r.ce)(s,_),this.type=n.eventType}return e.chain=function(e,t){return e.reduce((function(e,t){return e.then((function(){return t.invokeHook()}))}),t||u.u.$q.when())},e.invokeHooks=function(t,n){for(var o=0;o=t.invokeLimit&&t.deregister()}}},e.prototype.handleHookResult=function(e){var t=this;return this.getNotCurrentRejection()||((0,a.tI)(e)?e.then((function(e){return t.handleHookResult(e)})):(d.g4.traceHookResult(e,this.transition,this.options),!1===e?m.i.aborted("Hook aborted transition").toPromise():(0,i.is)(l.F)(e)?m.i.redirected(e).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var e=this.transition.router;return e._disposed?m.i.aborted("UIRouter instance #"+e.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?m.i.aborted().toPromise():this.isSuperseded()?m.i.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var e=this.options,t=this.registeredHook,n=(0,i.Qc)("traceData.hookType")(e)||"internal",o=(0,i.Qc)("traceData.context.state.name")(e)||(0,i.Qc)("traceData.context")(e)||"unknown",r=(0,s.iC)(t.callback);return n+" context: "+o+", "+(0,s.BS)(200,r)},e.HANDLE_RESULT=function(e){return function(t){return e.handleHookResult(t)}},e.LOG_REJECTED_RESULT=function(e){return function(t){(0,a.tI)(t)&&t.catch((function(t){return e.logError(m.i.normalize(t))}))}},e.LOG_ERROR=function(e){return function(t){return e.logError(t)}},e.REJECT_ERROR=function(e){return function(e){return(0,r.jv)(e)}},e.THROW_ERROR=function(e){return function(e){throw e}},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js":(e,t,n)=>{"use strict";n.d(t,{Z:()=>C,q:()=>W});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),a=n("./node_modules/@uirouter/core/lib-esm/router.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/index.js");function u(e){e.addResolvable(i.XU.fromData(a.a,e.router),""),e.addResolvable(i.XU.fromData(r.u,e),""),e.addResolvable(i.XU.fromData("$transition$",e),""),e.addResolvable(i.XU.fromData("$stateParams",e.params()),""),e.entering().forEach((function(t){e.addResolvable(i.XU.fromData("$state$",t),t)}))}var m=["$transition$",r.u],l=(0,d.d3)(m),_=function(e){var t=(0,d.VO)(e.treeChanges()).reduce(d.M7,[]).reduce(d.v_,[]),n=function(e){return l(e.token)?i.XU.fromData(e.token,null):e};t.forEach((function(e){e.resolvables=e.resolvables.map(n)}))},c=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),f=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),p=function(e){var t=e.to().redirectTo;if(t){var n=e.router.stateService;return(0,c.mf)(t)?h.u.$q.when(t(e)).then(o):o(t)}function o(t){if(t)return t instanceof f.F?t:(0,c.HD)(t)?n.target(t,e.params(),e.options()):t.state||t.params?n.target(t.state||e.to(),t.params||e.params(),e.options()):void 0}};function M(e){return function(t,n){return(0,n.$$state()[e])(t,n)}}var y=M("onExit"),L=M("onRetain"),Y=M("onEnter"),g=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),v=n("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"),k=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),j=1e3,w=function(e){return new v.l(e.treeChanges().to).resolvePath("EAGER",e).then(g.ZT)},b=function(e,t){return new v.l(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY",e).then(g.ZT)},D=function(e){return new v.l(e.treeChanges().to).resolvePath("LAZY",e).then(g.ZT)},T=function(e){var t=h.u.$q,n=e.views("entering");if(n.length)return t.all(n.map((function(e){return t.when(e.load())}))).then(g.ZT)},S=function(e){var t=e.views("entering"),n=e.views("exiting");if(t.length||n.length){var o=e.router.viewService;n.forEach((function(e){return o.deactivateViewConfig(e)})),t.forEach((function(e){return o.activateViewConfig(e)})),o.sync()}},H=function(e){var t=e.router.globals,n=function(){t.transition===e&&(t.transition=null)};e.onSuccess({},(function(){t.successfulTransitions.enqueue(e),t.$current=e.$to(),t.current=t.$current.self,(0,g.JG)(e.params(),t.params)}),{priority:1e4}),e.promise.then(n,n)},x=function(e){var t=e.options(),n=e.router.stateService,o=e.router.urlRouter;if("url"!==t.source&&t.location&&n.$current.navigable){var r={replace:"replace"===t.location};o.push(n.$current.navigable.url,n.params,r)}o.update(!0)},E=n("./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"),P=n("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),O=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),$=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),A=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js");function F(e){var t=e._ignoredReason();if(t){$.g4.traceTransitionIgnored(e);var n=e.router.globals.transition;return"SameAsCurrent"===t&&n&&n.abort(),A.i.ignored().toPromise()}}function R(e){if(!e.valid())throw new Error(e.error().toString())}var W={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},C=function(){function e(e){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=e,this.$view=e.viewService,this._deregisterHookFns={},this._pluginapi=(0,g.WR)((0,k.P0)(this),{},(0,k.P0)(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),e.globals.successfulTransitions.onEvict(_)}return e.prototype.onCreate=function(e,t,n){},e.prototype.onBefore=function(e,t,n){},e.prototype.onStart=function(e,t,n){},e.prototype.onExit=function(e,t,n){},e.prototype.onRetain=function(e,t,n){},e.prototype.onEnter=function(e,t,n){},e.prototype.onFinish=function(e,t,n){},e.prototype.onSuccess=function(e,t,n){},e.prototype.onError=function(e,t,n){},e.prototype.dispose=function(e){(0,g.VO)(this._registeredHooks).forEach((function(e){return e.forEach((function(t){t._deregistered=!0,(0,g.nA)(e,t)}))}))},e.prototype.create=function(e,t){return new r.u(e,t,this._router)},e.prototype._defineCoreEvents=function(){var e=o.k,t=O.I,n=this._criteriaPaths,r=!1,s=!0;this._defineEvent("onCreate",e.CREATE,0,n.to,r,t.LOG_REJECTED_RESULT,t.THROW_ERROR,s),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s),this._defineEvent("onError",e.ERROR,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s)},e.prototype._defineCorePaths=function(){var e=o.c.STATE,t=o.c.TRANSITION;this._definePathType("to",t),this._definePathType("from",t),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(e,t,n,o,r,a,i,d){void 0===r&&(r=!1),void 0===a&&(a=O.I.HANDLE_RESULT),void 0===i&&(i=O.I.REJECT_ERROR),void 0===d&&(d=!1);var u=new P.t(e,t,n,o,r,a,i,d);this._eventTypes.push(u),(0,s.BU)(this,this,u)},e.prototype._getEvents=function(e){return((0,c.$K)(e)?this._eventTypes.filter((function(t){return t.hookPhase===e})):this._eventTypes.slice()).sort((function(e,t){var n=e.hookPhase-t.hookPhase;return 0===n?e.hookOrder-t.hookOrder:n}))},e.prototype._definePathType=function(e,t){this._criteriaPaths[e]={name:e,scope:t}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(e){return this._registeredHooks[e]},e.prototype._registerCoreTransitionHooks=function(){var e=this._deregisterHookFns;e.addCoreResolves=this.onCreate({},u),e.ignored=this.onBefore({},F,{priority:-9999}),e.invalid=function(e){return e.onBefore({},R,{priority:-1e4})}(this),e.redirectTo=function(e){return e.onStart({to:function(e){return!!e.redirectTo}},p)}(this),e.onExit=function(e){return e.onExit({exiting:function(e){return!!e.onExit}},y)}(this),e.onRetain=function(e){return e.onRetain({retained:function(e){return!!e.onRetain}},L)}(this),e.onEnter=function(e){return e.onEnter({entering:function(e){return!!e.onEnter}},Y)}(this),e.eagerResolve=function(e){return e.onStart({},w,{priority:j})}(this),e.lazyResolve=function(e){return e.onEnter({entering:(0,k.P0)(!0)},b,{priority:j})}(this),e.resolveAll=function(e){return e.onFinish({},D,{priority:j})}(this),e.loadViews=function(e){return e.onFinish({},T)}(this),e.activateViews=function(e){return e.onSuccess({},S)}(this),e.updateGlobals=function(e){return e.onCreate({},H)}(this),e.updateUrl=function(e){return e.onSuccess({},x,{priority:9999})}(this),e.lazyLoad=(0,E.v)(this)},e}()},"./node_modules/@uirouter/core/lib-esm/url/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=function(){function e(e){var t=this;this.router=e,this.paramTypes=new o.ParamTypes,this._decodeParams=!0,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return t.paramTypes.dispose()},this.baseHref=function(){return t.router.locationConfig.baseHref()},this.hashPrefix=function(e){return t.router.locationConfig.hashPrefix(e)},this.host=function(){return t.router.locationConfig.host()},this.html5Mode=function(){return t.router.locationConfig.html5Mode()},this.port=function(){return t.router.locationConfig.port()},this.protocol=function(){return t.router.locationConfig.protocol()}}return e.prototype.caseInsensitive=function(e){return this._isCaseInsensitive=(0,r.$K)(e)?e:this._isCaseInsensitive},e.prototype.defaultSquashPolicy=function(e){if((0,r.$K)(e)&&!0!==e&&!1!==e&&!(0,r.HD)(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=(0,r.$K)(e)?e:this._defaultSquashPolicy},e.prototype.strictMode=function(e){return this._isStrictMode=(0,r.$K)(e)?e:this._isStrictMode},e.prototype.type=function(e,t,n){var o=this.paramTypes.type(e,t,n);return(0,r.$K)(t)?this:o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js":(e,t,n)=>{"use strict";n.d(t,{y:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),a=function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n{"use strict";n.d(t,{g:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js"),s=function(){function e(e){var t=this;this.router=e,this.sync=function(e){return t.router.urlService.sync(e)},this.listen=function(e){return t.router.urlService.listen(e)},this.deferIntercept=function(e){return t.router.urlService.deferIntercept(e)},this.match=function(e){return t.router.urlService.match(e)},this.initial=function(e){return t.router.urlService.rules.initial(e)},this.otherwise=function(e){return t.router.urlService.rules.otherwise(e)},this.removeRule=function(e){return t.router.urlService.rules.removeRule(e)},this.rule=function(e){return t.router.urlService.rules.rule(e)},this.rules=function(){return t.router.urlService.rules.rules()},this.sort=function(e){return t.router.urlService.rules.sort(e)},this.when=function(e,n,o){return t.router.urlService.rules.when(e,n,o)},this.urlRuleFactory=new r.I(e)}return e.prototype.update=function(e){var t=this.router.locationService;e?this.location=t.url():t.url()!==this.location&&t.url(this.location,!0)},e.prototype.push=function(e,t,n){var o=n&&!!n.replace;this.router.urlService.url(e.format(t||{}),o)},e.prototype.href=function(e,t,n){var r=e.format(t);if(null==r)return null;n=n||{absolute:!1};var s=this.router.urlService.config,a=s.html5Mode();if(a||null===r||(r="#"+s.hashPrefix()+r),r=function(e,t,n,r){return"/"===r?e:t?(0,o.Lb)(r)+e:n?r.slice(1)+e:e}(r,a,n.absolute,s.baseHref()),!n.absolute||!r)return r;var i=!a&&r?"/":"",d=s.port(),u=80===d||443===d?"":":"+d;return[s.protocol(),"://",s.host(),u,i,r].join("")},Object.defineProperty(e.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!1,configurable:!0}),e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRule.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>d,n:()=>u});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),d=function(){function e(e){this.router=e}return e.prototype.compile=function(e){return this.router.urlMatcherFactory.compile(e)},e.prototype.create=function(e,t){var n=this,s=i.l.isState,d=i.l.isStateDeclaration,m=(0,a.uj)([[r.HD,function(e){return m(n.compile(e))}],[(0,a.is)(o.x),function(e){return n.fromUrlMatcher(e,t)}],[(0,a.or)(s,d),function(e){return n.fromState(e,n.router)}],[(0,a.is)(RegExp),function(e){return n.fromRegExp(e,t)}],[r.mf,function(e){return new u(e,t)}]]),l=m(e);if(!l)throw new Error("invalid 'what' in when()");return l},e.prototype.fromUrlMatcher=function(e,t){var n=t;(0,r.HD)(t)&&(t=this.router.urlMatcherFactory.compile(t)),(0,a.is)(o.x)(t)&&(n=function(e){return t.format(e)});var i={urlMatcher:e,matchPriority:function(t){var n=e.parameters().filter((function(e){return e.isOptional}));return n.length?n.filter((function(e){return t[e.id]})).length/n.length:1e-6},type:"URLMATCHER"};return(0,s.l7)(new u((function(t){var n=e.exec(t.path,t.search,t.hash);return e.validates(n)&&n}),n),i)},e.prototype.fromState=function(e,t){var n=i.l.isStateDeclaration(e)?e.$$state():e,o={state:n,type:"STATE"};return(0,s.l7)(this.fromUrlMatcher(n.url,(function(e){var o=t.stateService,r=t.globals;o.href(n,e)!==o.href(r.current,r.params)&&o.transitionTo(n,e,{inherit:!0,source:"url"})})),o)},e.prototype.fromRegExp=function(e,t){if(e.global||e.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=(0,r.HD)(t)?function(e){return t.replace(/\$(\$|\d{1,2})/,(function(t,n){return e["$"===n?0:Number(n)]}))}:t,o={regexp:e,type:"REGEXP"};return(0,s.l7)(new u((function(t){return e.exec(t.path)}),n),o)},e.isUrlRule=function(e){return e&&["type","match","handler"].every((function(t){return(0,r.$K)(e[t])}))},e}(),u=function(e,t){var n=this;this.match=e,this.type="RAW",this.matchPriority=function(e){return 0-n.$id},this.handler=t||s.yR}},"./node_modules/@uirouter/core/lib-esm/url/urlRules.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),i=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");function d(e){if(!((0,a.mf)(e)||(0,a.HD)(e)||(0,a.is)(r.TargetState)(e)||r.TargetState.isDef(e)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return(0,a.mf)(e)?e:(0,a.P0)(e)}o=function(e,t){var n=function(e,t){return(t.priority||0)-(e.priority||0)}(e,t);return 0!==n||0!==(n=function(e,t){var n={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(n[e.type]||0)-(n[t.type]||0)}(e,t))||0!==(n=function(e,t){return e.urlMatcher&&t.urlMatcher?s.x.compare(e.urlMatcher,t.urlMatcher):0}(e,t))?n:function(e,t){var n={STATE:!0,URLMATCHER:!0};return n[e.type]&&n[t.type]?0:(e.$id||0)-(t.$id||0)}(e,t)};var u=function(){function e(e){this.router=e,this._sortFn=o,this._rules=[],this._id=0,this.urlRuleFactory=new i.I(e)}return e.prototype.dispose=function(e){this._rules=[],delete this._otherwiseFn},e.prototype.initial=function(e){var t=d(e);this.rule(this.urlRuleFactory.create((function(e,t){return 0===t.globals.transitionHistory.size()&&!!/^\/?$/.exec(e.path)}),t))},e.prototype.otherwise=function(e){var t=d(e);this._otherwiseFn=this.urlRuleFactory.create((0,a.P0)(!0),t),this._sorted=!1},e.prototype.removeRule=function(e){(0,a.nA)(this._rules,e)},e.prototype.rule=function(e){var t=this;if(!i.I.isUrlRule(e))throw new Error("invalid rule");return e.$id=this._id++,e.priority=e.priority||0,this._rules.push(e),this._sorted=!1,function(){return t.removeRule(e)}},e.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},e.prototype.sort=function(e){for(var t=this.stableSort(this._rules,this._sortFn=e||this._sortFn),n=0,o=0;o{"use strict";n.d(t,{i:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"),a=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),i=function(){function e(e){var t=this;this.router=e,this.interceptDeferred=!1,this.rules=new r.h(this.router),this.config=new s.F(this.router),this.url=function(e,n,o){return t.router.locationService.url(e,n,o)},this.path=function(){return t.router.locationService.path()},this.search=function(){return t.router.locationService.search()},this.hash=function(){return t.router.locationService.hash()},this.onChange=function(e){return t.router.locationService.onChange(e)}}return e.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},e.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},e.prototype.sync=function(e){if(!e||!e.defaultPrevented){var t=this.router,n=t.urlService,r=t.stateService,s={path:n.path(),search:n.search(),hash:n.hash()},i=this.match(s);(0,o.uj)([[o.HD,function(e){return n.url(e,!0)}],[a.TargetState.isDef,function(e){return r.go(e.state,e.params,e.options)}],[(0,o.is)(a.TargetState),function(e){return r.go(e.state(),e.params(),e.options())}]])(i&&i.rule.handler(i.match,s,this.router))}},e.prototype.listen=function(e){var t=this;if(!1!==e)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange((function(e){return t.sync(e)}));this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},e.prototype.deferIntercept=function(e){void 0===e&&(e=!0),this.interceptDeferred=e},e.prototype.match=function(e){e=(0,o.l7)({path:"",search:{},hash:""},e);for(var t,n,r,s=this.rules.rules(),a=0;at.weight?i:t}return t},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/vanilla/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js":(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),s=function(){function e(e,t){var n=this;this.fireAfterUpdate=t,this._listeners=[],this._listener=function(e){return n._listeners.forEach((function(t){return t(e)}))},this.hash=function(){return(0,r.en)(n._get()).hash},this.path=function(){return(0,r.en)(n._get()).path},this.search=function(){return(0,r.Qf)((0,r.en)(n._get()).search)},this._location=o.Jz.location,this._history=o.Jz.history}return e.prototype.url=function(e,t){return void 0===t&&(t=!0),(0,o.$K)(e)&&e!==this._get()&&(this._set(null,null,e,t),this.fireAfterUpdate&&this._listeners.forEach((function(t){return t({url:e})}))),(0,r.Q2)(this)},e.prototype.onChange=function(e){var t=this;return this._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}},e.prototype.dispose=function(e){(0,o.Wk)(this._listeners)},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=function(){function e(e,t){void 0===t&&(t=!1),this._isHtml5=t,this._baseHref=void 0,this._hashPrefix=""}return e.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},e.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},e.prototype.host=function(){return location.hostname},e.prototype.html5Mode=function(){return this._isHtml5},e.prototype.hashPrefix=function(e){return(0,o.$K)(e)?this._hashPrefix=e:this._hashPrefix},e.prototype.baseHref=function(e){return(0,o.$K)(e)&&(this._baseHref=e),(0,o.o8)(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},e.prototype.getBaseHref=function(){var e=document.getElementsByTagName("base")[0];return e&&e.href?e.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):this._isHtml5?"/":location.pathname||"/"},e.prototype.dispose=function(){},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js":(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!1)||this;return r.Jz.addEventListener("hashchange",n._listener,!1),n}return a(t,e),t.prototype._get=function(){return(0,r.Ld)(this._location.hash)},t.prototype._set=function(e,t,n,o){this._location.hash=n},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),r.Jz.removeEventListener("hashchange",this._listener)},t}(s.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=function(){var e=this;this.dispose=r.ZT,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return e._port},this.protocol=function(){return e._protocol},this.host=function(){return e._host},this.baseHref=function(){return e._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(t){return(0,o.$K)(t)?e._hashPrefix=t:e._hashPrefix}}},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(t){return e.call(this,t,!0)||this}return s(t,e),t.prototype._get=function(){return this._url},t.prototype._set=function(e,t,n,o){this._url=n},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),a=n("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),i=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),d=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js");n("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),n("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),(0,s._D)("vanilla.hashBangLocation",!1,r.R,o.u),(0,s._D)("vanilla.pushStateLocation",!0,a.h,o.u),(0,s._D)("vanilla.memoryLocation",!1,i.I,d.W)},"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!0)||this;return n._config=t.urlService.config,s.Jz.addEventListener("popstate",n._listener,!1),n}return a(t,e),t.prototype._getBasePrefix=function(){return(0,s.Lb)(this._config.baseHref())},t.prototype._get=function(){var e=this._location,t=e.pathname,n=e.hash,o=e.search;o=(0,s.C7)(o)[1],n=(0,s.cW)(n)[1];var r=this._getBasePrefix(),a=t===this._config.baseHref(),i=t.substr(0,r.length)===r;return(t=a?"/":i?t.substring(r.length):t)+(o?"?"+o:"")+(n?"#"+n:"")},t.prototype._set=function(e,t,n,o){var r=this._getBasePrefix(),s=n&&"/"!==n[0]?"/":"",a=""===n||"/"===n?this._config.baseHref():r+s+n;o?this._history.replaceState(e,t,a):this._history.pushState(e,t,a)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),s.Jz.removeEventListener("popstate",this._listener)},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/q.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js":(e,t,n)=>{"use strict";n.d(t,{Qf:()=>s,en:()=>a,Q2:()=>i,_D:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=function(e,t){var n=t[0],r=t[1];return e.hasOwnProperty(n)?(0,o.kJ)(e[n])?e[n].push(r):e[n]=[e[n],r]:e[n]=r,e},s=function(e){return e.split("&").filter(o.yR).map(o.Fb).reduce(r,{})};function a(e){var t=function(e){return e||""},n=(0,o.cW)(e).map(t),r=n[0],s=n[1],a=(0,o.C7)(r).map(t);return{path:a[0],search:a[1],hash:s,url:e}}var i=function(e){var t=e.path(),n=e.search(),r=e.hash(),s=Object.keys(n).map((function(e){var t=n[e];return((0,o.kJ)(t)?t:[t]).map((function(t){return e+"="+t}))})).reduce(o.M7,[]).join("&");return t+(s?"?"+s:"")+(r?"#"+r:"")};function d(e,t,n,o){return function(r){var s=r.locationService=new n(r),a=r.locationConfig=new o(r,t);return{name:e,service:s,configuration:a,dispose:function(e){e.dispose(s),e.dispose(a)}}}}},"./node_modules/@uirouter/core/lib-esm/view/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/view/view.js":(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),i=function(){function e(e){var t=this;this.router=e,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(e){return(0,o.sE)(t._uiViews,(function(n){return t.router.$id+"."+n.id===e}))},_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs},_onSync:function(e){return t._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}}}}return e.normalizeUIViewTarget=function(e,t){void 0===t&&(t="");var n=t.split("@"),o=n[0]||"$default",r=(0,s.HD)(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(o);if(a&&(r=a[1],o=a[2]),"!"===o.charAt(0)&&(o=o.substr(1),r=""),/^(\^(?:\.\^)*)$/.exec(r)){var i=r.split(".").reduce((function(e,t){return e.parent}),e);r=i.name}else"."===r&&(r=e.name);return{uiViewName:o,uiViewContextAnchor:r}},e.prototype._rootViewContext=function(e){return this._rootContext=e||this._rootContext},e.prototype._viewConfigFactory=function(e,t){this._viewConfigFactories[e]=t},e.prototype.createViewConfig=function(e,t){var n=this._viewConfigFactories[t.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+t.$type);var o=n(e,t);return(0,s.kJ)(o)?o:[o]},e.prototype.deactivateViewConfig=function(e){a.g4.traceViewServiceEvent("<- Removing",e),(0,o.nA)(this._viewConfigs,e)},e.prototype.activateViewConfig=function(e){a.g4.traceViewServiceEvent("-> Registering",e),this._viewConfigs.push(e)},e.prototype.sync=function(){var t=this,n=this._uiViews.map((function(e){return[e.fqn,e]})).reduce(o.bb,{});function s(e){for(var t=e.viewDecl.$context,n=0;++n&&t.parent;)t=t.parent;return n}var i=(0,r.WA)((function(e,t,n,o){return t*(e(n)-e(o))})),d=this._uiViews.sort(i((function(e){var t=function(e){return e&&e.parent?t(e.parent)+1:1};return 1e4*e.fqn.split(".").length+t(e.creationContext)}),1)).map((function(o){var r=t._viewConfigs.filter(e.matches(n,o));return r.length>1&&r.sort(i(s,-1)),{uiView:o,viewConfig:r[0]}})),u=d.map((function(e){return e.viewConfig})),m=this._viewConfigs.filter((function(e){return!(0,o.d3)(u,e)})).map((function(e){return{uiView:void 0,viewConfig:e}}));d.forEach((function(e){-1!==t._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)}));var l=d.concat(m);this._listeners.forEach((function(e){return e(l)})),a.g4.traceViewSync(l)},e.prototype.registerUIView=function(e){a.g4.traceViewServiceUIViewEvent("-> Registering",e);var t=this._uiViews;return t.filter((function(t){return t.fqn===e.fqn&&t.$type===e.$type})).length&&a.g4.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",e),t.push(e),this.sync(),function(){-1!==t.indexOf(e)?(a.g4.traceViewServiceUIViewEvent("<- Deregistering",e),(0,o.nA)(t)(e)):a.g4.traceViewServiceUIViewEvent("Tried removing non-registered uiView",e)}},e.prototype.available=function(){return this._uiViews.map((0,r.vg)("fqn"))},e.prototype.active=function(){return this._uiViews.filter((0,r.vg)("$config")).map((0,r.vg)("name"))},e.matches=function(e,t){return function(n){if(t.$type!==n.viewDecl.$type)return!1;var r=n.viewDecl,s=r.$uiViewName.split("."),a=t.fqn.split(".");if(!(0,o.fS)(s,a.slice(0-s.length)))return!1;var i=1-s.length||void 0,d=a.slice(0,i).join("."),u=e[d].creationContext;return r.$uiViewContextAnchor===(u&&u.name)}},e}()},"./node_modules/angular-aria/angular-aria.js":()=>{!function(e,t){"use strict";var n="ngAriaDisable",o=t.module("ngAria",["ng"]).info({angularVersion:"1.8.2"}).provider("$aria",(function(){var e={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeydown:!0,bindRoleForClick:!0};function o(t,o,r,a){return function(i,d,u){if(!u.hasOwnProperty(n)){var m=u.$normalize(o);!e[m]||s(d,r)||u[m]||i.$watch(u[t],(function(e){e=a?!e:!!e,d.attr(o,e)}))}}}this.config=function(n){e=t.extend(e,n)},this.$get=function(){return{config:function(t){return e[t]},$$watchExpr:o}}})),r=["BUTTON","A","INPUT","TEXTAREA","SELECT","DETAILS","SUMMARY"],s=function(e,t){if(-1!==t.indexOf(e[0].nodeName))return!0};o.directive("ngShow",["$aria",function(e){return e.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(e){return e.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(e){return e.$$watchExpr("ngValue","aria-checked",r,!1)}]).directive("ngChecked",["$aria",function(e){return e.$$watchExpr("ngChecked","aria-checked",r,!1)}]).directive("ngReadonly",["$aria",function(e){return e.$$watchExpr("ngReadonly","aria-readonly",r,!1)}]).directive("ngRequired",["$aria",function(e){return e.$$watchExpr("ngRequired","aria-required",r,!1)}]).directive("ngModel",["$aria",function(e){function t(t,n,o,a){return e.config(n)&&!o.attr(t)&&(a||!s(o,r))&&("hidden"!==o.attr("type")||"INPUT"!==o[0].nodeName)}function o(e,t){return!t.attr("role")&&t.attr("type")===e&&!s(t,r)}return{restrict:"A",require:"ngModel",priority:200,compile:function(r,s){if(!s.hasOwnProperty(n)){var a=function(e,t){var n=e.type,o=e.role;return"checkbox"===(n||o)||"menuitemcheckbox"===o?"checkbox":"radio"===(n||o)||"menuitemradio"===o?"radio":"range"===n||"progressbar"===o||"slider"===o?"range":""}(s);return{post:function(n,r,s,i){var d=t("tabindex","tabindex",r,!1);function u(){return i.$modelValue}switch(a){case"radio":case"checkbox":o(a,r)&&r.attr("role",a),t("aria-checked","ariaChecked",r,!1)&&n.$watch(u,"radio"===a?function(e){var t=s.value==i.$viewValue;r.attr("aria-checked",t)}:function(){r.attr("aria-checked",!i.$isEmpty(i.$viewValue))}),d&&r.attr("tabindex",0);break;case"range":if(o(a,r)&&r.attr("role","slider"),e.config("ariaValue")){var m=!r.attr("aria-valuemin")&&(s.hasOwnProperty("min")||s.hasOwnProperty("ngMin")),l=!r.attr("aria-valuemax")&&(s.hasOwnProperty("max")||s.hasOwnProperty("ngMax")),_=!r.attr("aria-valuenow");m&&s.$observe("min",(function(e){r.attr("aria-valuemin",e)})),l&&s.$observe("max",(function(e){r.attr("aria-valuemax",e)})),_&&n.$watch(u,(function(e){r.attr("aria-valuenow",e)}))}d&&r.attr("tabindex",0)}!s.hasOwnProperty("ngRequired")&&i.$validators.required&&t("aria-required","ariaRequired",r,!1)&&s.$observe("required",(function(){r.attr("aria-required",!!s.required)})),t("aria-invalid","ariaInvalid",r,!0)&&n.$watch((function(){return i.$invalid}),(function(e){r.attr("aria-invalid",!!e)}))}}}}}}]).directive("ngDisabled",["$aria",function(e){return e.$$watchExpr("ngDisabled","aria-disabled",r,!1)}]).directive("ngMessages",(function(){return{restrict:"A",require:"?ngMessages",link:function(e,t,o,r){o.hasOwnProperty(n)||t.attr("aria-live")||t.attr("aria-live","assertive")}}})).directive("ngClick",["$aria","$parse",function(e,t){return{restrict:"A",compile:function(o,a){if(!a.hasOwnProperty(n)){var i=t(a.ngClick);return function(t,n,o){s(n,r)||(e.config("bindRoleForClick")&&!n.attr("role")&&n.attr("role","button"),e.config("tabindex")&&!n.attr("tabindex")&&n.attr("tabindex",0),!e.config("bindKeydown")||o.ngKeydown||o.ngKeypress||o.ngKeyup||n.on("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(-1!==r.indexOf(e.target.nodeName)||e.target.isContentEditable||e.preventDefault(),t.$apply((function(){i(t,{$event:e})})))})))}}}}}]).directive("ngDblclick",["$aria",function(e){return function(t,o,a){a.hasOwnProperty(n)||!e.config("tabindex")||o.attr("tabindex")||s(o,r)||o.attr("tabindex",0)}}])}(window,window.angular)},"./node_modules/angular-rateit/dist/ng-rateit.js":()=>{angular.module("ngRateIt",["ng"]).directive("ngRateIt",["$q",function(e){"use strict";return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"&?rated",reset:"&?reset",beforeRated:"&?beforeRated",beforeReset:"&?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:function(t,n,o){o.readOnly||(t.readOnly=function(){return!1}),o.resetable||(t.resetable=function(){return!0}),o.beforeRated||(t.beforeRated=function(){var t=e.defer();return t.resolve(),t.promise}),o.rated||(t.rated=function(){}),o.beforeReset||(t.beforeReset=function(){var t=e.defer();return t.resolve(),t.promise}),o.reset||(t.reset=function(){})},controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(e,t){"use strict";e.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,e.orgValue=angular.copy(e.ngModel),e.min=e.min||0,e.max=e.max||5,e.step=e.step||.5,e.pristine=e.orgValue===e.ngModel,e.starWidth=e.starWidth||16,e.starPartWidth=e.starWidth*e.step,e.starHeight=e.starHeight||16,e.canelWidth=e.canelWidth||e.starWidth,e.cancelHeight=e.cancelHeight||e.starHeight;var n=e.max-e.min,o=n/e.step,r=e.$watch("ngModel",(function(){e.pristine=e.orgValue===e.ngModel})),s=function(e){return(e+1)/o*n};e.getStartParts=function(){return new Array(o)},e.getStarOffset=function(t){var n=1/e.step;return-e.starWidth/n*(t%n)},e.isSelected=function(t){return s(t)<=e.ngModel-e.min},e.removeRating=function(){e.resetable()&&!e.readOnly()&&e.beforeReset({rating:e.ngModel}).then((function(){e.ngModel=e.min,e.reset({rating:e.ngModel})}))},e.setValue=function(n){if(!e.readOnly()){var o=angular.copy(e.min+s(n));e.beforeRated({rating:o}).then((function(){e.ngModel=o,t((function(){e.rated({rating:e.ngModel})}))}))}},e.$on("$destroy",(function(){r()}))}]).run(["$templateCache",function(e){"use strict";e.put("ngRateIt/ng-rate-it.html",'
')}])},"./src/js/index.module.js":(e,t,n)=>{"use strict";n("./node_modules/angular-animate/index.js"),n("./node_modules/angular-aria/index.js"),n("./node_modules/angular-messages/index.js"),n("./node_modules/angular-material/index.js"),n("./node_modules/angular-resource/index.js"),n("./node_modules/angular-sanitize/index.js"),n("./node_modules/ng-csv/build/ng-csv.min.js"),n("./node_modules/ng-embed/src/ng-embed.js"),n("./node_modules/@uirouter/angularjs/lib-esm/index.js"),n("./node_modules/angular-local-storage/index.js"),n("./node_modules/angular-rateit/dist/ng-rateit.js"),n("./node_modules/@flowjs/ng-flow/dist/ng-flow.js"),n("./node_modules/emojionearea/dist/emojionearea.js"),n("./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js");var o=n("./node_modules/moment/moment.js"),r=n.n(o),s=n("./node_modules/lodash.map/index.js"),a=n.n(s);function i(e,t,n,o,s,i,d,u,m){const l=this;function _(t,n,o){const r=i.get(t)||{};o?delete r[e.location]:r[e.location]=n,i.set(t,r)}function c(n){var o;e.layout.up=n,_(u,e.layout),o=n?"show":"hide",t.parent.postMessage({cmd:o},"*"),e.$$phase||e.$apply()}e.location=e.settings.location,l.$onInit=function(){e.status="init";const o=e.settings.color,r=e.settings.textColor,s=e.settings.textButtonColor||e.settings.textColor,a=e.settings.color_button,d=e.settings.backgroundColor,l=Math.max(document.documentElement.clientHeight,window.innerHeight||0),_=document.documentElement.clientWidth;document.documentElement.style.setProperty("--xc-ws-div-color",o),document.documentElement.style.setProperty("--xc-ws-text-color",r),document.documentElement.style.setProperty("--xc-ws-text-button-color",s),document.documentElement.style.setProperty("--xc-ws-button-color",a),document.documentElement.style.setProperty("--xc-ws-background-color",d),document.documentElement.style.setProperty("--xc-ws-client-height",l),document.documentElement.style.setProperty("--xc-ws-client-width",_);let h=!1;const f=i.get(m)||{},p=i.get(u)||{};e.visitor=f[e.location]?f[e.location]:{},e.layout=p[e.location]?p[e.location]:{},e.visitor.interaction&&e.layout.up?h=!0:e.layout.up=!0,"bottom_right"===e.settings.alignment&&c(h),n.go(function(){const t=e.settings.online,n=!!(e.visitor&&e.visitor.interaction&&e.visitor.interaction.id),o=Number(e.settings.maxInteractions)&&Number(e.settings.openedInteractions)>=Number(e.settings.maxInteractions);return!!(n||!o&&t)}()?"app.online":"app.offline",null,{location:"replace"});let M="";M=e.settings.online||!e.settings.hideWhenOffline?"init":"offline",t.parent.postMessage({cmd:M,div_color:o,text_color:r,client_height:l,client_width:_},"*");const y=document.createElement("style");document.head.appendChild(y),y.sheet.insertRule(".mdi-send:before {color:"+e.settings.color+"!important}")},l.close=function(){const t=e.visitor.interaction;if(t&&t.id){const s=o.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(e.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");o.show(s).then((function(){return d.chatInteraction.customUpdate({id:t.id,closed:!0,closeReason:"contact",closedAt:r()().format("YYYY-MM-DD HH:mm:ss")}).$promise})).then((function(){n.go("app.closing",null,{location:"replace"})})).catch((function(e){console.error("keep open",e)}))}},l.toggle=c,l.download=function(){const t=s.defer(),n=e.visitor.interaction;return n&&n.id&&d.chatInteraction.getMessages({intid:n.id,includeAll:!0}).$promise.then((function(n){t.resolve(a()(n.rows.slice(1),(function(t){let n;if("in"===t.direction&&(n=e.settings.customerAlias||e.visitor.from||"Visitor"+t.ContactId),"out"===t.direction)switch(e.settings.agentIdentifier){case"website_alias":n=t.UserId?e.settings.agentAlias+t.UserId:"System";break;case"agent_alias":n=t.UserId?t.User.alias||t.User.fullname:"System";break;case"agent_fullname":n=t.UserId?t.User.fullname:"System";break;default:n=t.UserId?e.settings.agentAlias+t.UserId:"System"}return{sender:n,message:t.body,createdAt:r()(t.createdAt).format("MM/DD/YYYY HH:mm:ss")}})))})).catch((function(e){console.error(e)})),t.promise},l.getHeaderShape=function(){return"rounded"===e.settings.header_shape?"15px":"0px"};const h={online:["online","chat","waiting","closing","unmanaged"],offline:["offline"]};Object.defineProperty(e,"actualTitle",{get(){let t=e.settings.defaultTitle;return h.online.includes(e.status)?t=e.settings.header_online:h.offline.includes(e.status)&&(t=e.settings.header_offline),t}}),e.updateStorage=_,window.addEventListener("message",(function(e){"show"===e.data.evt?c(!0):"hide"===e.data.evt&&c(!1)}),!1)}i.$inject=["$rootScope","$window","$state","$mdDialog","$q","localStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR"];var d=n("./node_modules/lodash.forin/index.js"),u=n.n(d),m=n("./node_modules/lodash.isnil/index.js"),l=n.n(m),_=n("./src/js/chat/index.tpl.html"),c=n("./src/js/closing/index.tpl.html"),h=n("./src/js/offline/index.tpl.html"),f=n("./src/js/online/index.tpl.html"),p=n("./src/js/unmanaged/index.tpl.html"),M=n("./src/js/waiting/index.tpl.html");function y(e,t){const n=t.search();e.settings={cursor:"pointer",hide:!0},u()(n,(function(t,n){""===t||l()(t)||("true"===t&&(t=!0),"false"===t&&(t=!1),e.settings[n]=t)}))}function L(e,t,n,o,r,s){n.html5Mode(!0),o.defaults.headers.get||(o.defaults.headers.get={}),o.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",o.defaults.headers.get["Cache-Control"]="no-cache",o.defaults.headers.get.Pragma="no-cache",r.setPrefix(s),e.state("app",{abstract:!0}).state("app.waiting",{url:"/waiting",templateUrl:M,controller:"WaitingController as vm"}).state("app.online",{url:"/online",templateUrl:f,controller:"OnlineController as vm"}).state("app.offline",{url:"/offline",templateUrl:h,controller:"OfflineController as vm"}).state("app.chat",{url:"/chat",templateUrl:_,controller:"ChatController as vm"}).state("app.unmanaged",{url:"/unmanaged",templateUrl:p,controller:"UnmanagedController as vm"}).state("app.closing",{url:"/closing",templateUrl:c,controller:"ClosingController as vm"})}L.$inject=["$stateProvider","$urlRouterProvider","$locationProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX"],y.$inject=["$rootScope","$location"];var Y=n("./node_modules/lodash.merge/index.js"),g=n.n(Y);function v(e,t,n,o,r,s){const a=this;function i(t){return function(o){a.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").position("top");n.show(r)}}function d(){e.loading=!1}function u(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function m(){a.form={},a.upColor=null,a.downColor=null,a.userForm.$setPristine(),a.userForm.$setUntouched(),delete e.visitor.interaction,e.enableDownload=!1}a.$onInit=function(){e.status="closing",e.updateStorage(r,null,!0),e.updateStorage(s,null,!0),e.loading=!1},a.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.close(g()({id:e.visitor.interaction.id,ratingType:e.settings.ratingType,customer:e.settings.customerAlias||e.visitor.from},a.form)).$promise.then((function(){delete a.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(m).then(u).catch(i("submit")).finally(d):(d(),i("submit"))},a.skip=function(){m(),u()},a.form={},a.errors={}}function k(e,t){const n={id:"@id",token:e.settings.token},o={};return o.baseUrl=e.settings.remote+"/api/",o.chatWebsite=t(o.baseUrl+"chat/websites/:id",n,{notify:{method:"POST",url:o.baseUrl+"chat/websites/:id/notify"},offline:{method:"POST",url:o.baseUrl+"chat/websites/:id/offline"},getFields:{method:"GET",url:o.baseUrl+"chat/websites/:id/fields"}}),o.chatInteraction=t(o.baseUrl+"chat/interactions/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/interactions/:id"},customUpdate:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/custom_update"},close:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/close"},getMessages:{method:"GET",url:o.baseUrl+"chat/interactions/:intid/my_messages"},uploadAttachment:{method:"POST",url:o.baseUrl+"chat/interactions/:id/attachment_upload",headers:{"Content-Type":void 0},transformRequest:angular.identity},downloadAttachment:{method:"GET",url:o.baseUrl+"chat/interactions/:id/attachment_download"}}),o.chatMessage=t(o.baseUrl+"chat/messages/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/messages/:id"}}),o}v.$inject=["$rootScope","$state","$mdToast","api","STORAGE_VISITOR","STORAGE_LAYOUT"],k.$inject=["$rootScope","$resource"];var j=n("./node_modules/lodash.find/index.js"),w=n.n(j),b=n("./node_modules/lodash.values/index.js"),D=n.n(b),T=n("./node_modules/jquery/dist/jquery.js");function S(e,t,n,o,r,s,a,i,d,u){const m=this;let _,c,h,f;function p(){n((function(){const e=r[0].getElementsByClassName("chat-messages")[0];e&&(e.scrollTop=e.scrollHeight)}))}function M(e){return function(t){m.errors[e]=t.data,p()}}function y(e){i.chatWebsite.notify(e).$promise.then((function(e){delete m.errors.chatMessageError,l()(t.visitor.interaction)&&(t.visitor.interaction={id:e.interaction.id},t.updateStorage(d,t.visitor)),_[0].emojioneArea.setText(""),p()})).catch(M("chatMessageError"))}function L(){t.settings.online?s.go("app.online",null,{location:"replace"}):s.go("app.offline",null,{location:"replace"})}function Y(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&i.chatInteraction.get({id:t.visitor.interaction.id}).$promise.then((function(e){delete m.errors.getInteraction,e.closed&&(t.visitor.interaction.closed=!0,t.updateStorage(d,t.visitor),"unmanaged"===e.disposition?s.go("app.unmanaged",null,{location:"replace"}):s.go("app.closing",null,{location:"replace"}))})).catch((function(e){switch(e.status){case 403:s.go("app.closing",null,{location:"replace"});break;case 404:t.updateStorage(d,null,!0),t.updateStorage(u,null,!0),L();break;case 405:s.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function v(e){const n=_[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==n&&y(g()({body:n},t.visitor))}function k(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&i.chatInteraction.getMessages({intid:t.visitor.interaction.id,includeAgent:!0,id:f||void 0}).$promise.then((function(e){if(delete m.errors.interaction,e.count){let o=!1,r=0;for(r=0,o=!1;r'+e.name+"",AttachmentId:e.id},t.visitor))):M("sendAttachment")}),M("sendAttachment"))},e.$on("$destroy",(function(){o.cancel(c),o.cancel(h),c=null,h=null})),t.$on("$download",(function(e,n){n&&n(D()(t.messages))}))}S.$inject=["$scope","$rootScope","$timeout","$interval","$document","$state","$http","api","STORAGE_VISITOR","STORAGE_LAYOUT"];var H=n("./node_modules/lodash.random/index.js"),x=n.n(H),E=n("./node_modules/lodash.clonedeep/index.js"),P=n.n(E),O=n("./node_modules/json-form-data/src/jsonToFormData.js"),$=n.n(O);function A(e,t,n,o,r,s,a){const i=this;let d=null,u=null;t.typeField="";const m={showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}};function _(){delete i.errors.submit,t.$emit("hide"),i.fields=P()(u),i.form={},i.userForm.$setPristine(),i.userForm.$setUntouched();const e=r.simple().textContent(t.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.initUploadButton=function(t){const n=i.fields[t],o=s.find(".upload-item");if(o.length){const t=angular.element(o[0].querySelector(".upload-button")),r=angular.element(o[0].querySelector("input[type=file]")),s=t.find("label");s.length&&s.css("display","none"),t.on("click",(()=>{s.css("display","none"),"function"==typeof r.trigger?r.trigger("click"):r[0].click()})),r.on("change",(t=>{e.$apply((function(){"string"==typeof n.props.error&&(n.props.error=null);const e=Array.from(t.target.files),o=1048576*n.config.size;e.some((e=>e.size>=o))?(n.options=[],n.props.error=n.config.sizeErrMessage):n.options=e.map((e=>{const{name:t,size:n,type:o}=e;return{name:t,size:n,type:o,file:e}})),i.form[n.props.title]=n.options}))}))}},i.removeFileItem=function(e,t){e.options.splice(t,1),i.form[e.props.title]=e.options},i.setupFileInput=function(e){console.log("form item setup",e);const t=s.find(".upload-item"),n=angular.element(t[0].querySelector("input[type=file]")),{multipleUpload:o,accept:r}=e.config;o&&n.attr("multiple","multiple"),r&&n[0].setAttribute("accept",r)},i.makeFileOptionsVisible=function(){const e=Array.from(s.find(".filename-label")),t=e[e.length-1];t&&t.scrollIntoView&&t.scrollIntoView()},i.$onInit=function(){t.status="offline",i.visitor={id:t.settings.id,mapKeyOffline:"firstName",from:"Anonymous"+x()(1,1e6)},t.settings.showMenu=!1,t.loading=!1,o.chatWebsite.getFields({id:t.settings.id,online:!1}).$promise.then((function(e){e.count&&(d=e.fromKey,u=P()(e.rows),i.fields=P()(u))})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=t(n.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){t.loading=!0;const e={...i.form};for(let n=0;ne.file))))}const n=Array.isArray(i.fields)?i.fields.filter((e=>"upload"===e.type)):[],s=g()({body:e},i.visitor),u=null!=e&&n.length>0,c=null!==e&&"{}"!==JSON.stringify(e);var h,f;(u?(h=s,a({url:`${o.baseUrl}chat/websites/${h.id}/offline`,headers:{"Content-Type":void 0},data:$()(h,{...m,initialFormData:new FormData}),method:"POST"})):c?o.chatWebsite.offline(s).$promise:Promise.reject("INVALID_FORM")).then(_).catch((f="submit",function(e){const n=r.simple().textContent(t.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n),i.errors[f]=e.data})).finally((()=>{i.form.invalid||(i.form={}),t.loading=!1}))},i.toggle=function(e,t){i.form[e]||(i.form[e]=[]);const n=i.form[e].indexOf(t);n>-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1},i.checkHTML=[],i.form={},i.errors={},i.userForm={}}function F(e,t,n,o,s,a){const i=this;let d=null;function u(){return"Anonymous"+x()(1,1e6)}i.checkHTML=[],i.form={},i.errors={},i.userForm={},i.disableItem=!1,i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.$onInit=function(){if(e.status="online",e.visitor&&e.visitor.interaction)if(e.visitor.interaction.id)if(e.visitor.interaction.UserId)t.go("app.chat",null,{location:"replace"});else{const t=e.visitor.interaction.id,n=JSON.stringify({channel:"chat",interaction:{id:t},message:{id:e.visitor.message.id},disposition:"abandoned",closed:!0,closeReason:"contact",closedAt:r()().format("YYYY-MM-DD HH:mm:ss")});o({url:`${e.settings.remote}/api/chat/interactions/${t}/abandon?token=${e.settings.token}`,headers:{"Content-Type":"application/json; charset=utf-8"},data:n,method:"PUT"}),e.visitor={id:e.settings.id,mapKey:"firstName",from:u()},e.settings.showMenu=!1,e.updateStorage(a,e.visitor),s.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(d=e.fromKey,i.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))}else t.go("app.waiting",null,{location:"replace"});else e.visitor={id:e.settings.id,mapKey:"firstName",from:u()},e.settings.showMenu=!1,e.updateStorage(a,e.visitor),s.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(d=e.fromKey,i.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){let n="New chat request \n";for(let t=0;t-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1}}function R(e,t,n,o,r,s){const a=this;function i(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function d(){a.form={},a.upColor=null,a.downColor=null,a.userForm.$setPristine(),a.userForm.$setUntouched(),e.visitor={},e.enableDownload=!1,e.$emit("hide")}function u(t){return function(o){a.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(r)}}function m(){e.loading=!1}a.form={},a.errors={},a.$onInit=function(){e.status="unmanaged",e.updateStorage(r,null,!0),e.updateStorage(s,null,!0),e.loading=!1},a.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.customUpdate({id:e.visitor.interaction.id,note:a.form.note}).$promise.then((function(){delete a.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(d).then(i).catch(u("submit")).finally(m):(m(),u("submit"))},a.skip=function(){d(),i()}}function W(e,t,n,o,s,a,i,d){let u,m=!1;function l(){let t={},n=!1;a.chatInteraction.get({id:e.visitor.interaction.id}).$promise.then((function(n){return t=n,a.chatInteraction.getMessages({intid:e.visitor.interaction.id}).$promise})).then((function(r){n=r.rows.length>1,t.closed?(e.visitor.interaction.closed=!0,e.updateStorage(i,e.visitor),"unmanaged"===t.disposition&&o.go("app.unmanaged",null,{location:"replace"})):t.UserId?(e.visitor.interaction.UserId=t.UserId,e.updateStorage(i,e.visitor),o.go("app.chat",null,{location:"replace"})):n&&o.go("app.chat",null,{location:"replace"})})).catch((function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function _(){if(e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&!m){m=!0;const t=new XMLHttpRequest;t.open("PUT",e.settings.remote+"/api/chat/interactions/"+e.visitor.interaction.id+"/abandon?token="+e.settings.token,!1),t.setRequestHeader("Content-type","application/json; charset=utf-8"),t.send(JSON.stringify({channel:"chat",interaction:{id:e.visitor.interaction.id},message:{id:e.visitor.message.id},disposition:"abandoned",closed:!0,closeReason:"contact",closedAt:r()().format("YYYY-MM-DD HH:mm:ss")})),4===t.readyState&&200===t.status&&(e.updateStorage(i,null,!0),e.updateStorage(d,null,!0))}}this.$onInit=function(){e.status="waiting",e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&(u=n(l,3e3))},t.$on("$destroy",(function(){s.removeEventListener("beforeunload",_),s.removeEventListener("unload",_),n.cancel(u)})),s.addEventListener("beforeunload",_),s.addEventListener("unload",_)}function C(e){return function(t){return e.trustAsHtml(t)}}A.$inject=["$scope","$rootScope","$sce","api","$mdToast","$element","$http"],F.$inject=["$rootScope","$state","$sce","$http","api","STORAGE_VISITOR"],R.$inject=["$rootScope","$state","$mdToast","api","STORAGE_VISITOR","STORAGE_LAYOUT"],W.$inject=["$rootScope","$scope","$interval","$state","$window","api","STORAGE_VISITOR","STORAGE_LAYOUT"],C.$inject=["$sce"],angular.module("motion-chat",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).filter("toTrusted",C).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").directive("ngEnter",(function(){return function(e,t,n){t.bind("keydown keypress",(function(t){13===t.which&&(e.$apply((function(){e.$eval(n.ngEnter)})),t.preventDefault())}))}})).directive("ngPrint",(function(){return{link:function(e,t){t.on("click",(function(){document.getElementById("chatContent1")&&function(e,t){const n=document.createElement("div"),o=t.visitor,s=t.settings;let a;for(let e=0;e"+document.title+""),i.document.write(""),i.document.write("

Website: "+s.referer+"

"),i.document.write("

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

"),i.document.write("

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

"),i.document.write(n.innerHTML),i.document.write(""),i.document.close(),i.focus(),i.print(),i.close()}(0,e)}))},restrict:"A"}})).controller("ChatController",S).controller("ClosingController",v).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("IndexController",i).factory("api",k).config(L).run(y).controller("OfflineController",A).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("OnlineController",F).controller("UnmanagedController",R).controller("WaitingController",W)},"./node_modules/expose-loader/dist/runtime/getGlobalThis.js":(e,t,n)=>{"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},"./node_modules/json-form-data/src/jsonToFormData.js":function(e,t){var n,o;(o=this)||(o={}),void 0===(n=function(){return o.jsonToFormData=function(){function e(e){return"[object Array]"==={}.toString.call(e)}function t(t){return!(e(t)||"object"!=typeof t||!t||t instanceof Blob||t instanceof Date)}function n(){return"function"==typeof FormData}function o(){if(n())return new FormData}function r(n,o,s,a){var i=0;for(var d in n){if(n.hasOwnProperty(d)){var u=a||d,m=o.mapping(n[d]);if(a&&t(n)&&(u=a+"["+d+"]"),a&&e(n)&&(u=e(m)||o.showLeafArrayIndexes?a+"["+i+"]":a+"[]"),e(m)||t(m))r(m,o,s,u);else if(m instanceof FileList)for(var l=0;l=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-dz.js":function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(o,r,s,a){var i=t(o),d=n[e][t(o)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,o)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-kw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ly.js":function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,s,a){var i=n(t),d=o[e][n(t)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ma.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-sa.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-tn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,n,s,a){var i=o(t),d=r[e][o(t)];return 2===i&&(d=d[n?0:1]),d.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/az.js":function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/be.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn-bd.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bo.js":function(e,t,n){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/br.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bs.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cs.js":function(e,t,n){!function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),o=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function a(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"pár sekund":"pár sekundami";case"ss":return t||o?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":o?"minutu":"minutou";case"mm":return t||o?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||o?"den":"dnem";case"dd":return t||o?r+(s(e)?"dny":"dní"):r+"dny";case"M":return t||o?"měsíc":"měsícem";case"MM":return t||o?r+(s(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||o?"rok":"rokem";case"yy":return t||o?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cy.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/da.js":function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-at.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-ch.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/dv.js":function(e,t,n){!function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/el.js":function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,o=this._calendarEl[e],r=t&&t.hours();return n=o,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(o=o.apply(t)),o.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-au.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-gb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ie.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-il.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-in.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-nz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-sg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-do.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-mx.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-us.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/et.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:o?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eu.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fa.js":function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fi.js":function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function o(e,o,r,s){var a="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":a=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":a=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":a=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":a=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":a=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":a=s?"vuoden":"vuotta"}return function(e,o){return e<10?o?n[e]:t[e]:e}(e,s)+" "+a}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fil.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr.js":function(e,t,n){!function(e){"use strict";var t=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,monthsShortStrictRegex:/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fy.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ga.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gd.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gl.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-deva.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){switch(t){case"D":return e+"वेर";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-latn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gu.js":function(e,t,n){!function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/he.js":function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hi.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hr.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hu.js":function(e,t,n){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,o){var r=e;switch(n){case"s":return o||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(o||t)?" másodperc":" másodperce";case"m":return"egy"+(o||t?" perc":" perce");case"mm":return r+(o||t?" perc":" perce");case"h":return"egy"+(o||t?" óra":" órája");case"hh":return r+(o||t?" óra":" órája");case"d":return"egy"+(o||t?" nap":" napja");case"dd":return r+(o||t?" nap":" napja");case"M":return"egy"+(o||t?" hónap":" hónapja");case"MM":return r+(o||t?" hónap":" hónapja");case"y":return"egy"+(o||t?" év":" éve");case"yy":return r+(o||t?" év":" éve")}return""}function o(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return o.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return o.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hy-am.js":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/id.js":function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/is.js":function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,o,r){var s=e+" ";switch(o){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(n||r?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?s+(n||r?"mínútur":"mínútum"):n?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"dögum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?n?s+"mánuðir":s+(r?"mánuði":"mánuðum"):n?s+"mánuður":s+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return t(e)?s+(n||r?"ár":"árum"):s+(n||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ja.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/jv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ka.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kk.js":function(e,t,n){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/km.js":function(e,t,n){!function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kn.js":function(e,t,n){!function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ko.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ku.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ky.js":function(e,t,n){!function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lb.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lt.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,o){return t?r(n)[0]:o?r(n)[1]:r(n)[2]}function o(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,a){var i=e+" ";return 1===e?i+n(0,t,s[0],a):t?i+(o(e)?r(s)[1]:r(s)[0]):a?i+r(s)[1]:i+(o(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,n,o){return t?"kelios sekundės":o?"kelių sekundžių":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lv.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function o(e,o,r){return e+" "+n(t[r],e,o)}function r(e,o,r){return n(t[r],e,o)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/me.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ml.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mr.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function o(e,t,n,o){var r="";if(t)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms-my.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/my.js":function(e,t,n){!function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ne.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl-be.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/oc-lnc.js":function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pa-in.js":function(e,t,n){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pl.js":function(e,t,n){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),o=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var o=e+" ";switch(n){case"ss":return o+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return o+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return o+(r(e)?"godziny":"godzin");case"ww":return o+(r(e)?"tygodnie":"tygodni");case"MM":return o+(r(e)?"miesiące":"miesięcy");case"yy":return o+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,o){return e?/D MMMM/.test(o)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:s,M:"miesiąc",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt-br.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ro.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=" ";return(e%100>=20||e>=100&&e%100==0)&&(o=" de "),e+o+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ru.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"минута":"минуту":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,w:"неделя",ww:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sd.js":function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/se.js":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/si.js":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sk.js":function(e,t,n){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function o(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?s+(o(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?s+(o(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(o(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?s+(o(e)?"dni":"dní"):s+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(o(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(o(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||o?"sekundi":"sekundah":e<5?t||o?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||o?"minuti":"minutama":e<5?t||o?"minute":"minutami":t||o?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||o?"uri":"urama":e<5?t||o?"ure":"urami":t||o?"ur":"urami");case"d":return t||o?"en dan":"enim dnem";case"dd":return r+(1===e?t||o?"dan":"dnem":2===e?t||o?"dni":"dnevoma":t||o?"dni":"dnevi");case"M":return t||o?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||o?"mesec":"mesecem":2===e?t||o?"meseca":"mesecema":e<5?t||o?"mesece":"meseci":t||o?"mesecev":"meseci");case"y":return t||o?"eno leto":"enim letom";case"yy":return r+(1===e?t||o?"leto":"letom":2===e?t||o?"leti":"letoma":e<5?t||o?"leta":"leti":t||o?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sq.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr-cyrl.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ss.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ta.js":function(e,t,n){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/te.js":function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tet.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tg.js":function(e,t,n){!function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/th.js":function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tk.js":function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tl-ph.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tlh.js":function(e,t,n){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,o,r){var s=function(e){var n=Math.floor(e%1e3/100),o=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),o>0&&(s+=(""!==s?" ":"")+t[o]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(o){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tr.js":function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"öö":"ÖÖ":n?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return o||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ug-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"يېرىم كېچە":o<900?"سەھەر":o<1130?"چۈشتىن بۇرۇن":o<1230?"چۈش":o<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uk.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(o=+e,r={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ur.js":function(e,t,n){!function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/vi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/x-pseudo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/yo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-hk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1200?"上午":1200===o?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-mo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-tw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(e,t,n)=>{var o={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=s,e.exports=r,r.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"./node_modules/ng-csv/build/ng-csv.min.js":(e,t)=>{var n;n=window,document,angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function(e){angular.isDefined(e.urlSanitizationWhitelist)?e.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),e.exports===t&&(e.exports="ngCsv"),angular.module("ngCsv.services").service("CSV",["$q",function(e){var t="\r\n",n={"\\t":"\t","\\b":"\b","\\v":"\v","\\f":"\f","\\r":"\r"};this.stringifyField=function(e,t){return"locale"===t.decimalSep&&this.isFloat(e)?e.toLocaleString():"."!==t.decimalSep&&this.isFloat(e)?e.toString().replace(".",t.decimalSep):"string"==typeof e?(e=e.replace(/"/g,'""'),(t.quoteStrings||e.indexOf(",")>-1||e.indexOf("\n")>-1||e.indexOf("\r")>-1)&&(e=t.txtDelim+e+t.txtDelim),e):"boolean"==typeof e?e?"TRUE":"FALSE":e},this.isFloat=function(e){return+e===e&&(!isFinite(e)||Boolean(e%1))},this.stringify=function(n,o){var r=e.defer(),s=this,a="",i="",d=e.when(n).then((function(e){var n,d;angular.isDefined(o.header)&&o.header&&(n=[],angular.forEach(o.header,(function(e){this.push(s.stringifyField(e,o))}),n),d=n.join(o.fieldSep?o.fieldSep:","),i+=d+t);var u,m,l=[];angular.isArray(e)?l=e:angular.isFunction(e)&&(l=e()),angular.isDefined(o.label)&&o.label&&"boolean"==typeof o.label&&(u=[],angular.forEach(l[0],(function(e,t){this.push(s.stringifyField(t,o))}),u),m=u.join(o.fieldSep?o.fieldSep:","),i+=m+t),angular.forEach(l,(function(e,n){var r,a,d=angular.copy(l[n]);a=[];var u=o.columnOrder?o.columnOrder:d;angular.forEach(u,(function(e){var t=o.columnOrder?d[e]:e;this.push(s.stringifyField(t,o))}),a),r=a.join(o.fieldSep?o.fieldSep:","),i+=n'),i=angular.element(a.children()[0]);i.attr("href",n.URL.createObjectURL(o)),i.attr("download",e.getFilename()),i.attr("target","_blank"),r.find("body").append(a),s((function(){i[0].click(),i.remove()}),null)}}()})),e.$apply()}))}}}])},"./src/js/chat/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/5e32f2e1a6d11e8f150e.html"},"./src/js/closing/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/b5ecdf1981d6cd190497.html"},"./src/js/offline/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/f2a9fbb003feacb050d3.html"},"./src/js/online/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/26fbe83f4ba96d6e6cf1.html"},"./src/js/unmanaged/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/4b1f437e6978b48d5480.html"},"./src/js/waiting/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/6043a16afdb829ba5934.html"}},e=>{var t=t=>e(e.s=t);e.O(0,["vendor-index","vendor-angular-76f2ed34","vendor-angular-58d021f3","vendor-ng-embed","vendor-moment","vendor-jquery","vendor-jquery.textcomplete","vendor-emojionearea","vendor-emojione","vendor-angular-sanitize","vendor-angular-resource","vendor-angular-messages","vendor-angular-material","vendor-angular-local-storage","vendor-angular-animate","vendor-urlMatcher","vendor-transition","vendor-stateService","vendor-stateDirectives","vendor-flow"],(()=>(t("./node_modules/jquery/dist/jquery.js"),t("./node_modules/angular/index-exposed.js"),t("./node_modules/moment/moment.js"),t("./node_modules/@flowjs/flow.js/src/flow.js"),t("./node_modules/emojione/lib/js/emojione.js"),t("./src/js/index.module.js")))),e.O()}]); +//# sourceMappingURL=chat.js.map \ No newline at end of file diff --git a/snippet/3.0.1/scripts/chat.js.LICENSE.txt b/snippet/3.0.0/scripts/chat.js.LICENSE.txt similarity index 100% rename from snippet/3.0.1/scripts/chat.js.LICENSE.txt rename to snippet/3.0.0/scripts/chat.js.LICENSE.txt diff --git a/snippet/3.0.0/scripts/chat.js.map b/snippet/3.0.0/scripts/chat.js.map new file mode 100644 index 0000000..5352db3 --- /dev/null +++ b/snippet/3.0.0/scripts/chat.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scripts/chat.js","mappings":"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","sources":["webpack://motion-chat/./node_modules/@flowjs/ng-flow/dist/ng-flow.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/locationServices.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/services.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/common.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/coreservices.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/glob.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/hof.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/predicates.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/queue.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/safeConsole.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/strings.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/trace.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/globals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/param.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramTypes.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/stateParams.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathNode.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathUtils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/router.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateObject.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/targetState.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/resolve.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/views.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/url.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRouter.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRule.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRules.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/utils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/view/view.js","webpack://motion-chat/./node_modules/angular-aria/angular-aria.js","webpack://motion-chat/./node_modules/angular-rateit/dist/ng-rateit.js","webpack://motion-chat/./src/js/index.controller.js","webpack://motion-chat/./src/js/index.route.js","webpack://motion-chat/./src/js/closing/index.controller.js","webpack://motion-chat/./src/js/index.factory.js","webpack://motion-chat/./src/js/chat/index.controller.js","webpack://motion-chat/./src/js/offline/index.controller.js","webpack://motion-chat/./src/js/online/index.controller.js","webpack://motion-chat/./src/js/unmanaged/index.controller.js","webpack://motion-chat/./src/js/waiting/index.controller.js","webpack://motion-chat/./src/js/index.module.js","webpack://motion-chat/./node_modules/expose-loader/dist/runtime/getGlobalThis.js","webpack://motion-chat/./node_modules/json-form-data/src/jsonToFormData.js","webpack://motion-chat/./node_modules/moment/locale/af.js","webpack://motion-chat/./node_modules/moment/locale/ar-dz.js","webpack://motion-chat/./node_modules/moment/locale/ar-kw.js","webpack://motion-chat/./node_modules/moment/locale/ar-ly.js","webpack://motion-chat/./node_modules/moment/locale/ar-ma.js","webpack://motion-chat/./node_modules/moment/locale/ar-sa.js","webpack://motion-chat/./node_modules/moment/locale/ar-tn.js","webpack://motion-chat/./node_modules/moment/locale/ar.js","webpack://motion-chat/./node_modules/moment/locale/az.js","webpack://motion-chat/./node_modules/moment/locale/be.js","webpack://motion-chat/./node_modules/moment/locale/bg.js","webpack://motion-chat/./node_modules/moment/locale/bm.js","webpack://motion-chat/./node_modules/moment/locale/bn-bd.js","webpack://motion-chat/./node_modules/moment/locale/bn.js","webpack://motion-chat/./node_modules/moment/locale/bo.js","webpack://motion-chat/./node_modules/moment/locale/br.js","webpack://motion-chat/./node_modules/moment/locale/bs.js","webpack://motion-chat/./node_modules/moment/locale/ca.js","webpack://motion-chat/./node_modules/moment/locale/cs.js","webpack://motion-chat/./node_modules/moment/locale/cv.js","webpack://motion-chat/./node_modules/moment/locale/cy.js","webpack://motion-chat/./node_modules/moment/locale/da.js","webpack://motion-chat/./node_modules/moment/locale/de-at.js","webpack://motion-chat/./node_modules/moment/locale/de-ch.js","webpack://motion-chat/./node_modules/moment/locale/de.js","webpack://motion-chat/./node_modules/moment/locale/dv.js","webpack://motion-chat/./node_modules/moment/locale/el.js","webpack://motion-chat/./node_modules/moment/locale/en-au.js","webpack://motion-chat/./node_modules/moment/locale/en-ca.js","webpack://motion-chat/./node_modules/moment/locale/en-gb.js","webpack://motion-chat/./node_modules/moment/locale/en-ie.js","webpack://motion-chat/./node_modules/moment/locale/en-il.js","webpack://motion-chat/./node_modules/moment/locale/en-in.js","webpack://motion-chat/./node_modules/moment/locale/en-nz.js","webpack://motion-chat/./node_modules/moment/locale/en-sg.js","webpack://motion-chat/./node_modules/moment/locale/eo.js","webpack://motion-chat/./node_modules/moment/locale/es-do.js","webpack://motion-chat/./node_modules/moment/locale/es-mx.js","webpack://motion-chat/./node_modules/moment/locale/es-us.js","webpack://motion-chat/./node_modules/moment/locale/es.js","webpack://motion-chat/./node_modules/moment/locale/et.js","webpack://motion-chat/./node_modules/moment/locale/eu.js","webpack://motion-chat/./node_modules/moment/locale/fa.js","webpack://motion-chat/./node_modules/moment/locale/fi.js","webpack://motion-chat/./node_modules/moment/locale/fil.js","webpack://motion-chat/./node_modules/moment/locale/fo.js","webpack://motion-chat/./node_modules/moment/locale/fr-ca.js","webpack://motion-chat/./node_modules/moment/locale/fr-ch.js","webpack://motion-chat/./node_modules/moment/locale/fr.js","webpack://motion-chat/./node_modules/moment/locale/fy.js","webpack://motion-chat/./node_modules/moment/locale/ga.js","webpack://motion-chat/./node_modules/moment/locale/gd.js","webpack://motion-chat/./node_modules/moment/locale/gl.js","webpack://motion-chat/./node_modules/moment/locale/gom-deva.js","webpack://motion-chat/./node_modules/moment/locale/gom-latn.js","webpack://motion-chat/./node_modules/moment/locale/gu.js","webpack://motion-chat/./node_modules/moment/locale/he.js","webpack://motion-chat/./node_modules/moment/locale/hi.js","webpack://motion-chat/./node_modules/moment/locale/hr.js","webpack://motion-chat/./node_modules/moment/locale/hu.js","webpack://motion-chat/./node_modules/moment/locale/hy-am.js","webpack://motion-chat/./node_modules/moment/locale/id.js","webpack://motion-chat/./node_modules/moment/locale/is.js","webpack://motion-chat/./node_modules/moment/locale/it-ch.js","webpack://motion-chat/./node_modules/moment/locale/it.js","webpack://motion-chat/./node_modules/moment/locale/ja.js","webpack://motion-chat/./node_modules/moment/locale/jv.js","webpack://motion-chat/./node_modules/moment/locale/ka.js","webpack://motion-chat/./node_modules/moment/locale/kk.js","webpack://motion-chat/./node_modules/moment/locale/km.js","webpack://motion-chat/./node_modules/moment/locale/kn.js","webpack://motion-chat/./node_modules/moment/locale/ko.js","webpack://motion-chat/./node_modules/moment/locale/ku.js","webpack://motion-chat/./node_modules/moment/locale/ky.js","webpack://motion-chat/./node_modules/moment/locale/lb.js","webpack://motion-chat/./node_modules/moment/locale/lo.js","webpack://motion-chat/./node_modules/moment/locale/lt.js","webpack://motion-chat/./node_modules/moment/locale/lv.js","webpack://motion-chat/./node_modules/moment/locale/me.js","webpack://motion-chat/./node_modules/moment/locale/mi.js","webpack://motion-chat/./node_modules/moment/locale/mk.js","webpack://motion-chat/./node_modules/moment/locale/ml.js","webpack://motion-chat/./node_modules/moment/locale/mn.js","webpack://motion-chat/./node_modules/moment/locale/mr.js","webpack://motion-chat/./node_modules/moment/locale/ms-my.js","webpack://motion-chat/./node_modules/moment/locale/ms.js","webpack://motion-chat/./node_modules/moment/locale/mt.js","webpack://motion-chat/./node_modules/moment/locale/my.js","webpack://motion-chat/./node_modules/moment/locale/nb.js","webpack://motion-chat/./node_modules/moment/locale/ne.js","webpack://motion-chat/./node_modules/moment/locale/nl-be.js","webpack://motion-chat/./node_modules/moment/locale/nl.js","webpack://motion-chat/./node_modules/moment/locale/nn.js","webpack://motion-chat/./node_modules/moment/locale/oc-lnc.js","webpack://motion-chat/./node_modules/moment/locale/pa-in.js","webpack://motion-chat/./node_modules/moment/locale/pl.js","webpack://motion-chat/./node_modules/moment/locale/pt-br.js","webpack://motion-chat/./node_modules/moment/locale/pt.js","webpack://motion-chat/./node_modules/moment/locale/ro.js","webpack://motion-chat/./node_modules/moment/locale/ru.js","webpack://motion-chat/./node_modules/moment/locale/sd.js","webpack://motion-chat/./node_modules/moment/locale/se.js","webpack://motion-chat/./node_modules/moment/locale/si.js","webpack://motion-chat/./node_modules/moment/locale/sk.js","webpack://motion-chat/./node_modules/moment/locale/sl.js","webpack://motion-chat/./node_modules/moment/locale/sq.js","webpack://motion-chat/./node_modules/moment/locale/sr-cyrl.js","webpack://motion-chat/./node_modules/moment/locale/sr.js","webpack://motion-chat/./node_modules/moment/locale/ss.js","webpack://motion-chat/./node_modules/moment/locale/sv.js","webpack://motion-chat/./node_modules/moment/locale/sw.js","webpack://motion-chat/./node_modules/moment/locale/ta.js","webpack://motion-chat/./node_modules/moment/locale/te.js","webpack://motion-chat/./node_modules/moment/locale/tet.js","webpack://motion-chat/./node_modules/moment/locale/tg.js","webpack://motion-chat/./node_modules/moment/locale/th.js","webpack://motion-chat/./node_modules/moment/locale/tk.js","webpack://motion-chat/./node_modules/moment/locale/tl-ph.js","webpack://motion-chat/./node_modules/moment/locale/tlh.js","webpack://motion-chat/./node_modules/moment/locale/tr.js","webpack://motion-chat/./node_modules/moment/locale/tzl.js","webpack://motion-chat/./node_modules/moment/locale/tzm-latn.js","webpack://motion-chat/./node_modules/moment/locale/tzm.js","webpack://motion-chat/./node_modules/moment/locale/ug-cn.js","webpack://motion-chat/./node_modules/moment/locale/uk.js","webpack://motion-chat/./node_modules/moment/locale/ur.js","webpack://motion-chat/./node_modules/moment/locale/uz-latn.js","webpack://motion-chat/./node_modules/moment/locale/uz.js","webpack://motion-chat/./node_modules/moment/locale/vi.js","webpack://motion-chat/./node_modules/moment/locale/x-pseudo.js","webpack://motion-chat/./node_modules/moment/locale/yo.js","webpack://motion-chat/./node_modules/moment/locale/zh-cn.js","webpack://motion-chat/./node_modules/moment/locale/zh-hk.js","webpack://motion-chat/./node_modules/moment/locale/zh-mo.js","webpack://motion-chat/./node_modules/moment/locale/zh-tw.js","webpack://motion-chat//Users/andreacuccaro/Documents/MotionV3/motion-chat/node_modules/moment/locale|sync|/^\\.\\/.*$/","webpack://motion-chat/./node_modules/ng-csv/build/ng-csv.min.js"],"names":["angular","module","provider","this","defaults","factory","options","Flow","events","on","event","callback","push","$get","fn","opts","flow","extend","forEach","controller","$scope","$attrs","$parse","flowFactory","$eval","flowInit","flowObject","create","catchAllHandler","eventName","args","Array","prototype","slice","call","arguments","shift","$broadcast","apply","concat","$applyAsync","defaultPrevented","$on","off","$flow","hasOwnProperty","flowName","assign","directive","scope","element","attrs","isDirectory","isSingleFile","inputAttrs","flowAttrs","assignBrowse","bind","preventDefault","$timeout","promise","enter","dragEvent","fileDrag","dataTransfer","originalEvent","types","val","$apply","flowDragEnter","cancel","flowDragLeave","assignDrop","flowDropEnabled","$watch","value","unAssignDrop","fileSuccess","fileProgress","fileAdded","filesAdded","filesSubmitted","fileRetry","fileRemoved","fileError","uploadStart","complete","progress","error","eventArgs","string","name","charAt","toUpperCase","require","funcArgs","key","file","flowImg","fileReader","FileReader","readAsDataURL","onload","$set","target","result","transfers","files","uiView","$ViewDirectiveFill","$compile","$controller","$transitions","$view","$q","getControllerAs","parse","getResolveAs","restrict","priority","compile","tElement","initial","html","empty","$element","data","contents","cfg","$cfg","viewDecl","getTemplate","noop","resolveCtx","path","ResolveContext","trace","$uiView","link","controllerAs","resolveAs","locals","controllerInstance","children","registerControllerCallbacks","isString","component","kebobName","kebobString","tagRegexp_1","RegExp","deregisterWatch_1","directiveEl","filter","el","tagName","exec","ctrlInstance","$animate","$uiViewScroll","$interpolate","rootData","$context","_pluginapi","_rootViewContext","count","terminal","transclude","tAttrs","$transclude","previousEl","currentEl","currentScope","viewConfig","onloadExp","autoScrollExp","renderer","cb","then","leave","inherited","inheritedData","activeUIView","$type","id","fqn","config","configUpdated","updateView","fromParentTagConfig","fromParentTag","unregister","registerUIView","newScope","$new","animEnter","defer","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","$emit","cloned","clone","resolve","isDefined","remove","$destroy","_viewData_1","cleanupLastView","$inject","hasComponentImpl","_uiCanExitId","isFunction","$onInit","componentProvider","viewState","tail","state","self","hookOptions","uiOnParamsChanged","viewCreationTrans_1","getResolvable","onSuccess","$transition$","exiting","indexOf","toParams","params","fromParams","getNodeSchema","node","paramSchema","toSchema","treeChanges","map","reduce","unnestR","fromSchema","changedToParams","param","idx","type","equals","length","changedKeys_1","x","newValues","uiCanExit","id_1","cacheProp_1","prevTruthyAnswer_1","trans","redirectedFrom","criteria","onBefore","ids","when","TemplateFactory","_this","_useHttp","$http","$templateCache","$injector","$templateRequest","has","get","useHttpService","fromConfig","context","asTemplate","services","str","template","asComponent","fromString","templateUrl","fromUrl","templateProvider","fromProvider","fromComponentProvider","url","cache","headers","Accept","response","deps","providerFn","isArray","Resolvable","makeComponentTemplate","bindings","prefix","kebob","camelCase","kebobed","cmpDefs","Error","getBindings","getComponentBindings","input","attrName","attr","resolveName","res","join","def","isObject","bindToController","scopeBindings","bindingsObj","Object","keys","tuple","getStateHookBuilder","hookName","stateObject","hook","pathname","subContext","$$state","getLocals","$state$","undefined","Ng1LocationServices","$locationProvider","_urlListeners","_lp","createProxyFunctions","monkeyPatchPathParameterType","router","pathType","urlMatcherFactory","encode","toString","replace","m","decode","dispose","onChange","removeFrom","html5Mode","enabled","$sniffer","history","baseHref","_baseHref","$browser","$window","location","newUrl","$location","_runtimeServices","$rootScope","evt","_loc","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","UIRouter","stateProvider","stateRegistry","stateService","decorator","viewService","_viewConfigFactory","urlService","_decodeParams","ng1LocationService","locationService","locationConfig","getProviderFor","serviceName","$urp","service","runBlock","$uiRouter","invoke","checkStrictDi","strictDi","resolvables","resolvable","annotate","resolveFn","watchDigests","uiRouter","urlRouterProvider","globals","run","$urlMatcherFactory","$state","$urlRouter","ctx","getTokens","getPolicy","async","applyPairs","$IsStateFilter","isFilter","is","$stateful","$IncludedByStateFilter","includesFilter","includes","StateProvider","func","definition","register","onInvalid","getNg1ViewConfigFactory","templateFactory","view","Ng1ViewConfig","hasAnyKey","obj","acc","ng1ViewsBuilder","parent","compKeys","nonCompKeys","allViewKeys","views","viewsObject","$default","pick","$name","normalized","ViewService","$uiViewName","uiViewName","$uiViewContextAnchor","uiViewContextAnchor","$id","loaded","load","paramValues","promises","getController","all","results","controllerProvider","isInjectable","UrlRouterProvider","injectableHandler","handler","match","$match","$stateParams","urlRouter","update","interceptDeferred","listen","rule","ruleFn","BaseUrlRule","identity","rules","otherwise","urlRules","what","deferIntercept","useAnchorScroll","$anchorScroll","scrollIntoView","__spreadArrays","s","i","il","r","k","a","j","jl","root","g","global","fromJson","JSON","toJson","stringify","toObj","_equals","o1","o2","t1","a1","a2","tup","arrayTuples","b","t","getTime","source","fnNames","latebind","bindFunction","fnName","inherit","extra","inArray","array","splice","pushTo","arr","deregAll","functions","defaultsList","_i","defaultVals","reverse","mergeR","memo","item","ancestors","first","second","n","propNames","objCopy","_prop","omit","collection","accept","find","mapObj","values","allTrueR","elem","anyTrueR","flattenR","pushR","uniqR","token","unnest","assertPredicate","predicateOrMap","errMsg","maxArrayLen","min","Math","_loop_1","keyValTuple","copy","src","dest","silenceUncaughtInPromise","catch","e","silentRejection","makeStub","methods","fnname","Glob","text","glob","split","regexpString","seg","regexp","matches","test","curry","curried","compose","start","pipe","funcs","prop","propEq","_val","not","and","fn1","fn2","or","any","ctor","constructor","v","pattern","struct","toStr","tis","isUndefined","isNull","o","isNullOrUndefined","isNumber","isDate","isRegExp","head","isPromise","Queue","_items","_limit","_evictListeners","onEvict","enqueue","items","evict","dequeue","size","clear","current","peekTail","peekHead","noopConsoleStub","log","table","safeConsole","document","documentMode","window","console","bound","Function","ie9Console","fallbackConsole","maxLength","max","substr","padString","$1","toLowerCase","functionToString","fnStr","fnToString","namedFunctionMatch","_fn","isRejection","stringifyPattern","_transitionRejection","seen","format","beforeAfterSubstr","char","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","re","joinNeighborsR","Category","uiViewString","uiview","creationContext","normalizedCat","_tid","_rid","transLbl","Trace","_enabled","approximateDigests","_set","categories","parseInt","isNaN","category","enable","disable","traceTransitionStart","TRANSITION","traceTransitionIgnored","traceHookInvocation","step","HOOK","registeredHook","traceHookResult","hookResult","transitionOptions","traceResolvePath","RESOLVE","traceResolvableResolved","traceError","reason","traceSuccess","finalState","traceUIViewEvent","viewData","UIVIEW","traceUIViewConfigUpdated","traceUIViewFill","traceViewSync","pairs","VIEWCONFIG","uivheader","mapping","_a","_b","uiv","sort","localeCompare","traceViewServiceEvent","viewConfigString","traceViewServiceUIViewEvent","UIRouterGlobals","lastStartedTransitionId","transitionHistory","successfulTransitions","transition","lazyLoadHook","entering","lazyLoad","lazyLoadState","originalTransition","orig","targetState","identifier","$url","parts","sync","registerLazyLoadHook","transitionService","lazyLoadFn","states","_state","err","DefType","hasOwn","Param","urlConfig","paramName","noReloadOnSearch","reloadOnSearch","SEARCH","dynamic","defaultConfig","paramConfig","getStaticDefaultValue","isShorthand","$$fn","unwrapShorthand","getParamDeclaration","urlType","paramTypes","CONFIG","PATH","getType","arrayDefaults","arrayParamNomenclature","arrayMode","$asArray","isOptional","raw","squash","defaultPolicy","getSquashPolicy","defaultSquashPolicy","from","to","configuredKeys","getReplace","params_1","changed","values1","values2","validates","isDefaultValue","replaceSpecialValues","_defaultValueCache","defaultValue","getDefaultValue","$normalize","isSearch","encoded","ParamType","$subPattern","sub","mode","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","left","right","paramTypeFn","wrapperFn","$arrayMode","makeDefaultType","ParamTypes","typeQueue","defaultTypes","definitionFn","_flushTypeQueue","valToString","defaultTypeBase","String","query","hash","int","bool","Boolean","date","getFullYear","getMonth","getDate","capture","Date","valueOf","l","json","StateParams","$inherit","newParams","$current","$to","parentParams","parents","inheritList","PathNode","stateOrNode","parameters","applyRawParams","pDef","paramDef","parameter","paramsFn","diff","PathUtils","makeTargetState","registry","buildPath","buildToPath","fromPath","toPath","inheritParams","applyViewConfigs","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","toNode","toParamVals","incomingParamVals","fromParamVals","ownParamVals","reloadState","node1","node2","retained","keep","nonDynamicParams","retainedWithToParams","retainedNode","matching","pathA","pathB","done","nodeA","nodeB","predicate","elementIdx","resolvePolicies","LAZY","EAGER","WAIT","NOWAIT","arg1","policy","resolved","literal","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","asyncPolicy","customAsyncPolicy","getDependencies","resolvedDeps","resolvedValue","fromData","whens","ALL_WHENS","EAGER_WHENS","_path","addResolvables","newResolvables","resolvePath","matchedWhens","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","wait","getResult","injector","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","getNative","native","getAsync","_routerInstance","locationServiceStub","locationConfigStub","_disposed","_disposables","_plugins","disposable","d","ignored","plugin","pluginInstance","getPlugin","pluginName","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","stateDec","newStateDec","parsed","substring","parseUrl","isMatcher","navigable","append","getNavigableBuilder","isRoot","pathBuilder","includesBuilder","resolvablesBuilder","resolveObj","getToken","p","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","item2Resolvable","decl","StateBuilder","matcher","paramFactory","builders","parentName","urlParams","nonUrlParams","builder","build","chain","parentFn","segments","pop","StateMatcher","_states","isRelative","stateName","stateOrName","base","matchGlob","isStr","__stateObjectCache","nameGlob","baseState","splitName","pathLength","relName","StateObject","stateDecl","isStateClass","ref","matchingKeys","isStateDeclaration","isState","StateQueueManager","listeners","queue","flush","registered","orphans","previousQueueLength","getState","notifyListeners","listener","name_1","orphanIdx","existingState","existingFutureState","deregister","attachRoute","prev","abstract","rulesApi","urlRuleFactory","StateRegistry","stateQueue","_registerRoot","_root","onStatesChanged","stateDefinition","_deregisterTree","getChildren","_children","deregistered","removeRule","deregisteredStates","found","property","builderFunction","TargetState","_stateRegistry","_identifier","_params","_options","_definition","relative","exists","valid","withState","withParams","withOptions","newOpts","isDef","HookBuilder","buildHooksForPhase","phase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","reverseDepthSort","baseHookOptions","criteriaMatchPath","traceData","transitionHook","reverseSort","factor","depthDelta","isCreate","hookPhase","reg","getHooks","matchState","criterion","toMatch","globStrings","RegisteredHook","tranSvc","eventType","matchCriteria","removeHookFromRegistry","invokeCount","_deregistered","invokeLimit","_matchingNodes","nodes","_getDefaultMatchCriteria","_getPathTypes","_getMatchingNodes","mn","pathtype","isStateHook","every","makeEvent","hooks","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","TransitionHookPhase","TransitionHookScope","RejectType","Rejection","message","detail","isRejectionPromise","superseded","rejection","SUPERSEDED","redirected","invalid","INVALID","IGNORED","aborted","ABORTED","errored","ERROR","normalize","toPromise","TransitionEventType","hookOrder","getResultHandler","getErrorHandler","synchronous","defaultOptions","TransitionHook","stateContext","isSuperseded","isActive","waitFor","nextHook","invokeHook","invokeHooks","doneCallback","remainingHooks","runAllHooks","logError","defaultErrorHandler","notCurrent","getNotCurrentRejection","handleError","handleResult","handleHookResult","isTargetState","_aborted","HANDLE_RESULT","LOG_REJECTED_RESULT","LOG_ERROR","REJECT_ERROR","THROW_ERROR","addCoreResolvables","addResolvable","TRANSITION_TOKENS","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirect","redirectTo","makeEnterExitRetainHook","hookFn","onExitHook","onRetainHook","onEnterHook","RESOLVE_HOOK_PRIORITY","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","activateViews","exitingViews","vc","deactivateViewConfig","activateViewConfig","updateGlobalState","clearCurrentTransition","updateUrl","urlOptions","ignoredHook","ignoredReason","_ignoredReason","pending","abort","invalidTransitionHook","defaultTransOpts","notify","reload","supercede","custom","TransitionService","_router","_transitionCount","_eventTypes","_criteriaPaths","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onCreate","onStart","onExit","onRetain","onEnter","onFinish","onError","hooksArray","Phase","TH","paths","NORMAL_SORT","SYNCHRONOUS","_defineEvent","CREATE","BEFORE","RUN","SUCCESS","STATE","_definePathType","cmpByPhase","hookScope","fns","addCoreResolves","registerInvalidTransitionHook","registerRedirectToHook","registerOnExitHook","registerOnRetainHook","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","UrlConfig","_isCaseInsensitive","_isStrictMode","_defaultSquashPolicy","hashPrefix","newprefix","host","port","protocol","caseInsensitive","strictMode","__assign","ParamFactory","fromSearch","UrlMatcherFactory","UrlMatcher","globalConfig","strict","decodeParams","object","UrlRouter","urlParts","compareFn","read","urlMatcher","href","absolute","isHtml5","appendBasePath","slash","cfgPort","defineProperty","enumerable","configurable","UrlRuleFactory","makeRule","_what","fromUrlMatcher","fromState","fromRegExp","_handler","details","matchPriority","optional","search","stateOrDecl","transitionTo","sticky","Number","isUrlRule","defaultRuleSortFn","getHandlerFn","cmp","prioritySort","weights","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRules","_sortFn","_rules","_id","_otherwiseFn","handlerFn","_sorted","ensureSorted","sorted","stableSort","group","_group","arrOfWrapper","wrapperA","wrapperB","cmpDiff","wrapper","UrlService","newurl","best","go","applyResult","_stopListeningFn","weight","BaseLocationServices","fireAfterUpdate","_listeners","_listener","_get","_location","_history","BrowserLocationConfig","_isHtml5","_hashPrefix","hostname","getBaseHref","baseTag","getElementsByTagName","extendStatics","__extends","setPrototypeOf","__proto__","__","HashLocationService","_super","title","MemoryLocationConfig","_port","_protocol","_host","newval","MemoryLocationService","_url","PushStateLocationService","_config","_getBasePrefix","basePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","pushState","keyValsToObjectR","accum","getParams","queryString","orEmptyString","beforehash","buildUrl","loc","searchObject","locationPluginFactory","serviceClass","configurationClass","configuration","_uiViews","_viewConfigs","_viewConfigFactories","_registeredUIView","_registeredUIViews","_activeViewConfigs","_onSync","normalizeUIViewTarget","rawViewName","viewAtContext","relativeViewNameSugar","anchorState","anchor","_rootContext","viewType","cfgFactory","cfgs","uiViewsByFqn","viewConfigDepth","depthCompare","depthFn","posNeg","uiViewTuples","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","allTuples","uiViews","available","active","vcSegments","uivSegments","negOffset","fqnToFirstSegment","uiViewContext","ARIA_DISABLE_ATTR","ngAriaModule","info","angularVersion","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeydown","bindRoleForClick","watchExpr","ariaAttr","nativeAriaNodeNames","negate","ariaCamelName","isNodeOneOf","boolVal","newConfig","$$watchExpr","nodeTypeArray","nodeName","$aria","shouldAttachAttr","normalizedAttr","allowNonAriaNodes","shouldAttachRole","role","shape","getShape","post","ngModel","needsTabIndex","ngAriaWatchModelValue","$modelValue","newVal","$viewValue","$isEmpty","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","$observe","$validators","required","$invalid","ngMessages","ngClick","ngKeydown","ngKeypress","ngKeyup","keyCode","which","isContentEditable","$event","readOnly","pristine","resetable","starWidth","starHeight","canelWidth","cancelHeight","rated","reset","beforeRated","beforeReset","isTouch","navigator","msMaxTouchPoints","orgValue","starPartWidth","steps","garbage","getValue","index","getStartParts","getStarOffset","ratio","isSelected","removeRating","rating","setValue","tmpValue","put","IndexController","$mdDialog","localStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","vm","updateStorage","storage","set","toggle","up","cmd","layout","postMessage","$$phase","settings","status","div_color","color","text_color","textColor","text_button_color","textButtonColor","button_color","color_button","background_color","backgroundColor","client_height","documentElement","clientHeight","innerHeight","client_width","clientWidth","style","setProperty","tg","visitorStorage","layoutStorage","visitor","interaction","alignment","online","exceeded","maxInteractions","openedInteractions","isOnline","hideWhenOffline","createElement","appendChild","sheet","insertRule","close","confirm","querySelector","clickOutsideToClose","closingQuestion","ok","show","chatInteraction","customUpdate","closed","closeReason","closedAt","moment","$promise","download","deferred","getMessages","intid","includeAll","_map","rows","row","sender","direction","customerAlias","ContactId","agentIdentifier","UserId","agentAlias","User","alias","fullname","body","createdAt","getHeaderShape","header_shape","CHAT_STATUSES","offline","defaultTitle","header_online","header_offline","addEventListener","routeRun","cursor","hide","_forIn","_isNil","routeConfig","$stateProvider","$urlRouterProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX","Pragma","setPrefix","waitingTemplate","onlineTemplate","offlineTemplate","chatTemplate","unmanagedTemplate","closingTemplate","ClosingController","$mdToast","errors","toast","simple","textContent","formSubmitFailureMessage","toastClass","position","stopLoading","loading","goToIfTime","form","upColor","downColor","userForm","$setPristine","$setUntouched","enableDownload","submit","_merge","ratingType","customer","formSubmitSuccessMessage","finally","skip","apiService","$resource","paramDefaults","baseUrl","remote","chatWebsite","method","getFields","uploadAttachment","transformRequest","downloadAttachment","chatMessage","ChatController","$interval","$document","emojiArea","getMessagesInterval","getInteractionInterval","lastMessageId","scrollToBottomOfChat","getElementsByClassName","scrollTop","scrollHeight","sendMessage","chatMessageError","emojioneArea","setText","getInteraction","disposition","reply","getText","shiftKey","includeAgent","added","_find","messages","emojiOptions","watchEmbedData","fontSmiley","emoji","linkTarget","showMenu","replyMessage","$","placeholder","placeholderMessage","keyup","editor","ready","setFocus","reply_button","fd","FormData","sendAttachment","AttachmentId","_values","OfflineController","$sce","fromKey","initialFields","typeField","optJsonFormData","showLeafArrayIndexes","includeNullValues","onSubmitSuccess","fields","_cloneDeep","trustAsHtml","initUploadButton","formItem","uploadItem","button","label","css","trigger","click","props","maxSizeMB","some","sizeErrMessage","removeFileItem","setupFileInput","multipleUpload","setAttribute","makeFileOptionsVisible","fileOpts","lastOpt","mapKeyOffline","_random","field","helpText","isHTML","checkHTML","cmField","uploadFields","payLoad","isFormDataPayload","isJsonPayload","payload","jsonToFormData","initialFormData","Promise","reject","OnlineController","getAnonymous","disableItem","chatInteractionId","channel","mapKey","variable","referer","customerIp","enableCustomerWriting","UnmanagedController","note","WaitingController","called","open","unload","xhr","XMLHttpRequest","setRequestHeader","send","readyState","removeEventListener","toTrustedFilter","constant","ngEnter","getElementById","div","startTime","sentAt","createTextNode","myWindow","write","innerHTML","focus","print","printElement","elemToPrint","$mdGestureProvider","skipClickHijack","exports","globalThis","isJsonObject","Blob","isGlobalFormDataPresent","getDefaultFormData","convertRecursively","jsonObject","formData","parentKey","propName","FileList","toISOString","mergedOptions","carry","objectToMerge","objectKey","defineLocale","months","monthsShort","weekdays","weekdaysShort","weekdaysMin","meridiemParse","isPM","meridiem","hours","minutes","isLower","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","ss","mm","h","hh","dd","M","MM","y","yy","dayOfMonthOrdinalParse","ordinal","number","week","dow","doy","pluralForm","plurals","pluralize","u","withoutSuffix","isFuture","f","weekdaysParseExact","hour","minute","postformat","symbolMap","preparse","numberMap","suffixes","relativeTimeWithPlural","num","forms","standalone","isFormat","day","period","w","ww","lastDigit","last2Digits","meridiemHour","monthsShortRegex","monthsParseExact","relativeTimeWithMutation","mutationTable","softMutation","mutation","lastNumber","monthsParse","monthsRegex","minWeekdaysParse","weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","translate","ll","lll","llll","output","plural","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","month","_monthsNominativeEl","calendarEl","mom","_calendarEl","monthsShortDot","invalidDate","numbersPast","numbersFuture","verbalNumber","monthsShortWithDots","monthsShortWithoutDots","weekEndings","eras","since","offset","narrow","abbr","until","eraYearOrdinalRegex","eraYearOrdinalParse","now","$0","$2","isUpper","eifelerRegelAppliesToNumber","units","translateSingular","special","relativeTimeWithSingular","translator","words","correctGrammaticalCase","wordKey","relativeTimeMr","monthsNominative","monthsSubjective","separator","days","numbersNouns","numberNoun","hundred","floor","ten","one","word","numberAsNoun","time","hm","processHoursFunction","nominative","accusative","genitive","webpackContext","req","webpackContextResolve","__webpack_require__","code","debug","urlSanitizationWhitelist","aHrefSanitizationWhitelist","stringifyField","decimalSep","isFloat","toLocaleString","quoteStrings","txtDelim","isFinite","header","fieldSep","c","columnOrder","addByteOrderMarker","isSpecialChar","getSpecialChar","filename","charset","csv","buildCSV","getFilename","addClass","ngCsvLoadingClass","csvHeader","csvColumnOrder","csvLabel","removeClass","msSaveOrOpenBlob","msSaveBlob","URL","createObjectURL"],"sourceRoot":""} \ No newline at end of file diff --git a/snippet/3.0.1/scripts/mobile.js b/snippet/3.0.0/scripts/mobile.js similarity index 100% rename from snippet/3.0.1/scripts/mobile.js rename to snippet/3.0.0/scripts/mobile.js diff --git a/snippet/3.0.1/scripts/runtime.js b/snippet/3.0.0/scripts/runtime.js similarity index 100% rename from snippet/3.0.1/scripts/runtime.js rename to snippet/3.0.0/scripts/runtime.js diff --git a/snippet/3.0.1/scripts/runtime.js.map b/snippet/3.0.0/scripts/runtime.js.map similarity index 100% rename from snippet/3.0.1/scripts/runtime.js.map rename to snippet/3.0.0/scripts/runtime.js.map diff --git a/snippet/3.0.1/scripts/vendor-angular-58d021f3.js b/snippet/3.0.0/scripts/vendor-angular-58d021f3.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-58d021f3.js rename to snippet/3.0.0/scripts/vendor-angular-58d021f3.js diff --git a/snippet/3.0.1/scripts/vendor-angular-58d021f3.js.map b/snippet/3.0.0/scripts/vendor-angular-58d021f3.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-58d021f3.js.map rename to snippet/3.0.0/scripts/vendor-angular-58d021f3.js.map diff --git a/snippet/3.0.1/scripts/vendor-angular-76f2ed34.js b/snippet/3.0.0/scripts/vendor-angular-76f2ed34.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-76f2ed34.js rename to snippet/3.0.0/scripts/vendor-angular-76f2ed34.js diff --git a/snippet/3.0.1/scripts/vendor-angular-76f2ed34.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-76f2ed34.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt diff --git a/snippet/3.0.1/scripts/vendor-angular-76f2ed34.js.map b/snippet/3.0.0/scripts/vendor-angular-76f2ed34.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-76f2ed34.js.map rename to snippet/3.0.0/scripts/vendor-angular-76f2ed34.js.map diff --git a/snippet/3.0.1/scripts/vendor-angular-animate.js b/snippet/3.0.0/scripts/vendor-angular-animate.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-animate.js rename to snippet/3.0.0/scripts/vendor-angular-animate.js diff --git a/snippet/3.0.1/scripts/vendor-angular-animate.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-animate.js.LICENSE.txt similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-animate.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-animate.js.LICENSE.txt diff --git a/snippet/3.0.1/scripts/vendor-angular-animate.js.map b/snippet/3.0.0/scripts/vendor-angular-animate.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-animate.js.map rename to snippet/3.0.0/scripts/vendor-angular-animate.js.map diff --git a/snippet/3.0.1/scripts/vendor-angular-local-storage.js b/snippet/3.0.0/scripts/vendor-angular-local-storage.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-local-storage.js rename to snippet/3.0.0/scripts/vendor-angular-local-storage.js diff --git a/snippet/3.0.1/scripts/vendor-angular-local-storage.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-local-storage.js.LICENSE.txt similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-local-storage.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-local-storage.js.LICENSE.txt diff --git a/snippet/3.0.1/scripts/vendor-angular-local-storage.js.map b/snippet/3.0.0/scripts/vendor-angular-local-storage.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-local-storage.js.map rename to snippet/3.0.0/scripts/vendor-angular-local-storage.js.map diff --git a/snippet/3.0.1/scripts/vendor-angular-material.js b/snippet/3.0.0/scripts/vendor-angular-material.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-material.js rename to snippet/3.0.0/scripts/vendor-angular-material.js diff --git a/snippet/3.0.1/scripts/vendor-angular-material.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-material.js.LICENSE.txt similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-material.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-material.js.LICENSE.txt diff --git a/snippet/3.0.1/scripts/vendor-angular-material.js.map b/snippet/3.0.0/scripts/vendor-angular-material.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-material.js.map rename to snippet/3.0.0/scripts/vendor-angular-material.js.map diff --git a/snippet/3.0.1/scripts/vendor-angular-messages.js b/snippet/3.0.0/scripts/vendor-angular-messages.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-messages.js rename to snippet/3.0.0/scripts/vendor-angular-messages.js diff --git a/snippet/3.0.1/scripts/vendor-angular-messages.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-messages.js.LICENSE.txt similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-messages.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-messages.js.LICENSE.txt diff --git a/snippet/3.0.1/scripts/vendor-angular-messages.js.map b/snippet/3.0.0/scripts/vendor-angular-messages.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-messages.js.map rename to snippet/3.0.0/scripts/vendor-angular-messages.js.map diff --git a/snippet/3.0.1/scripts/vendor-angular-resource.js b/snippet/3.0.0/scripts/vendor-angular-resource.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-resource.js rename to snippet/3.0.0/scripts/vendor-angular-resource.js diff --git a/snippet/3.0.1/scripts/vendor-angular-resource.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-resource.js.LICENSE.txt similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-resource.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-resource.js.LICENSE.txt diff --git a/snippet/3.0.1/scripts/vendor-angular-resource.js.map b/snippet/3.0.0/scripts/vendor-angular-resource.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-resource.js.map rename to snippet/3.0.0/scripts/vendor-angular-resource.js.map diff --git a/snippet/3.0.1/scripts/vendor-angular-sanitize.js b/snippet/3.0.0/scripts/vendor-angular-sanitize.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-sanitize.js rename to snippet/3.0.0/scripts/vendor-angular-sanitize.js diff --git a/snippet/3.0.1/scripts/vendor-angular-sanitize.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-sanitize.js.LICENSE.txt similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-sanitize.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-sanitize.js.LICENSE.txt diff --git a/snippet/3.0.1/scripts/vendor-angular-sanitize.js.map b/snippet/3.0.0/scripts/vendor-angular-sanitize.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-angular-sanitize.js.map rename to snippet/3.0.0/scripts/vendor-angular-sanitize.js.map diff --git a/snippet/3.0.1/scripts/vendor-emojione.js b/snippet/3.0.0/scripts/vendor-emojione.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-emojione.js rename to snippet/3.0.0/scripts/vendor-emojione.js diff --git a/snippet/3.0.1/scripts/vendor-emojione.js.map b/snippet/3.0.0/scripts/vendor-emojione.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-emojione.js.map rename to snippet/3.0.0/scripts/vendor-emojione.js.map diff --git a/snippet/3.0.1/scripts/vendor-emojionearea.js b/snippet/3.0.0/scripts/vendor-emojionearea.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-emojionearea.js rename to snippet/3.0.0/scripts/vendor-emojionearea.js diff --git a/snippet/3.0.1/scripts/vendor-emojionearea.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-emojionearea.js.LICENSE.txt similarity index 100% rename from snippet/3.0.1/scripts/vendor-emojionearea.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-emojionearea.js.LICENSE.txt diff --git a/snippet/3.0.1/scripts/vendor-emojionearea.js.map b/snippet/3.0.0/scripts/vendor-emojionearea.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-emojionearea.js.map rename to snippet/3.0.0/scripts/vendor-emojionearea.js.map diff --git a/snippet/3.0.1/scripts/vendor-flow.js b/snippet/3.0.0/scripts/vendor-flow.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-flow.js rename to snippet/3.0.0/scripts/vendor-flow.js diff --git a/snippet/3.0.1/scripts/vendor-flow.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-flow.js.LICENSE.txt similarity index 100% rename from snippet/3.0.1/scripts/vendor-flow.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-flow.js.LICENSE.txt diff --git a/snippet/3.0.1/scripts/vendor-flow.js.map b/snippet/3.0.0/scripts/vendor-flow.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-flow.js.map rename to snippet/3.0.0/scripts/vendor-flow.js.map diff --git a/snippet/3.0.1/scripts/vendor-index.js b/snippet/3.0.0/scripts/vendor-index.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-index.js rename to snippet/3.0.0/scripts/vendor-index.js diff --git a/snippet/3.0.1/scripts/vendor-index.js.map b/snippet/3.0.0/scripts/vendor-index.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-index.js.map rename to snippet/3.0.0/scripts/vendor-index.js.map diff --git a/snippet/3.0.1/scripts/vendor-jquery.js b/snippet/3.0.0/scripts/vendor-jquery.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-jquery.js rename to snippet/3.0.0/scripts/vendor-jquery.js diff --git a/snippet/3.0.1/scripts/vendor-jquery.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-jquery.js.LICENSE.txt similarity index 100% rename from snippet/3.0.1/scripts/vendor-jquery.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-jquery.js.LICENSE.txt diff --git a/snippet/3.0.1/scripts/vendor-jquery.js.map b/snippet/3.0.0/scripts/vendor-jquery.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-jquery.js.map rename to snippet/3.0.0/scripts/vendor-jquery.js.map diff --git a/snippet/3.0.1/scripts/vendor-jquery.textcomplete.js b/snippet/3.0.0/scripts/vendor-jquery.textcomplete.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-jquery.textcomplete.js rename to snippet/3.0.0/scripts/vendor-jquery.textcomplete.js diff --git a/snippet/3.0.1/scripts/vendor-jquery.textcomplete.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-jquery.textcomplete.js.LICENSE.txt similarity index 100% rename from snippet/3.0.1/scripts/vendor-jquery.textcomplete.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-jquery.textcomplete.js.LICENSE.txt diff --git a/snippet/3.0.1/scripts/vendor-jquery.textcomplete.js.map b/snippet/3.0.0/scripts/vendor-jquery.textcomplete.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-jquery.textcomplete.js.map rename to snippet/3.0.0/scripts/vendor-jquery.textcomplete.js.map diff --git a/snippet/3.0.1/scripts/vendor-moment.js b/snippet/3.0.0/scripts/vendor-moment.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-moment.js rename to snippet/3.0.0/scripts/vendor-moment.js diff --git a/snippet/3.0.1/scripts/vendor-moment.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-moment.js.LICENSE.txt similarity index 100% rename from snippet/3.0.1/scripts/vendor-moment.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-moment.js.LICENSE.txt diff --git a/snippet/3.0.1/scripts/vendor-moment.js.map b/snippet/3.0.0/scripts/vendor-moment.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-moment.js.map rename to snippet/3.0.0/scripts/vendor-moment.js.map diff --git a/snippet/3.0.1/scripts/vendor-ng-embed.js b/snippet/3.0.0/scripts/vendor-ng-embed.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-ng-embed.js rename to snippet/3.0.0/scripts/vendor-ng-embed.js diff --git a/snippet/3.0.1/scripts/vendor-ng-embed.js.map b/snippet/3.0.0/scripts/vendor-ng-embed.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-ng-embed.js.map rename to snippet/3.0.0/scripts/vendor-ng-embed.js.map diff --git a/snippet/3.0.1/scripts/vendor-stateDirectives.js b/snippet/3.0.0/scripts/vendor-stateDirectives.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-stateDirectives.js rename to snippet/3.0.0/scripts/vendor-stateDirectives.js diff --git a/snippet/3.0.1/scripts/vendor-stateDirectives.js.map b/snippet/3.0.0/scripts/vendor-stateDirectives.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-stateDirectives.js.map rename to snippet/3.0.0/scripts/vendor-stateDirectives.js.map diff --git a/snippet/3.0.1/scripts/vendor-stateService.js b/snippet/3.0.0/scripts/vendor-stateService.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-stateService.js rename to snippet/3.0.0/scripts/vendor-stateService.js diff --git a/snippet/3.0.1/scripts/vendor-stateService.js.map b/snippet/3.0.0/scripts/vendor-stateService.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-stateService.js.map rename to snippet/3.0.0/scripts/vendor-stateService.js.map diff --git a/snippet/3.0.1/scripts/vendor-transition.js b/snippet/3.0.0/scripts/vendor-transition.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-transition.js rename to snippet/3.0.0/scripts/vendor-transition.js diff --git a/snippet/3.0.1/scripts/vendor-transition.js.map b/snippet/3.0.0/scripts/vendor-transition.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-transition.js.map rename to snippet/3.0.0/scripts/vendor-transition.js.map diff --git a/snippet/3.0.1/scripts/vendor-urlMatcher.js b/snippet/3.0.0/scripts/vendor-urlMatcher.js similarity index 100% rename from snippet/3.0.1/scripts/vendor-urlMatcher.js rename to snippet/3.0.0/scripts/vendor-urlMatcher.js diff --git a/snippet/3.0.1/scripts/vendor-urlMatcher.js.map b/snippet/3.0.0/scripts/vendor-urlMatcher.js.map similarity index 100% rename from snippet/3.0.1/scripts/vendor-urlMatcher.js.map rename to snippet/3.0.0/scripts/vendor-urlMatcher.js.map diff --git a/snippet/3.0.1/styles/app.css b/snippet/3.0.0/styles/app.css similarity index 100% rename from snippet/3.0.1/styles/app.css rename to snippet/3.0.0/styles/app.css diff --git a/snippet/3.0.1/styles/app.css.map b/snippet/3.0.0/styles/app.css.map similarity index 100% rename from snippet/3.0.1/styles/app.css.map rename to snippet/3.0.0/styles/app.css.map diff --git a/snippet/3.0.1/styles/mobile.css b/snippet/3.0.0/styles/mobile.css similarity index 100% rename from snippet/3.0.1/styles/mobile.css rename to snippet/3.0.0/styles/mobile.css diff --git a/snippet/3.0.1/styles/mobile.css.map b/snippet/3.0.0/styles/mobile.css.map similarity index 100% rename from snippet/3.0.1/styles/mobile.css.map rename to snippet/3.0.0/styles/mobile.css.map diff --git a/snippet/3.0.1/styles/vendor.css b/snippet/3.0.0/styles/vendor.css similarity index 100% rename from snippet/3.0.1/styles/vendor.css rename to snippet/3.0.0/styles/vendor.css diff --git a/snippet/3.0.1/styles/vendor.css.map b/snippet/3.0.0/styles/vendor.css.map similarity index 100% rename from snippet/3.0.1/styles/vendor.css.map rename to snippet/3.0.0/styles/vendor.css.map diff --git a/snippet/3.0.1/templates/d5d747d90310b44f0100.html b/snippet/3.0.0/templates/26fbe83f4ba96d6e6cf1.html similarity index 98% rename from snippet/3.0.1/templates/d5d747d90310b44f0100.html rename to snippet/3.0.0/templates/26fbe83f4ba96d6e6cf1.html index 5e63ae4..cabf4fd 100644 --- a/snippet/3.0.1/templates/d5d747d90310b44f0100.html +++ b/snippet/3.0.0/templates/26fbe83f4ba96d6e6cf1.html @@ -182,7 +182,7 @@ class="md-raised" ng-click="vm.submit()" ng-disabled="vm.userForm.$invalid || vm.disableItem" - ng-style="{'background-color': '{{settings.color_button}}', 'color': '{{settings.textButtonColor}}'}" + ng-style="{'background-color': '{{settings.color_button}}', 'color': '{{settings.textButtonColor || settings.textColor}}'}" > {{settings.start_chat_button}} diff --git a/snippet/3.0.1/templates/4b1f437e6978b48d5480.html b/snippet/3.0.0/templates/4b1f437e6978b48d5480.html similarity index 100% rename from snippet/3.0.1/templates/4b1f437e6978b48d5480.html rename to snippet/3.0.0/templates/4b1f437e6978b48d5480.html diff --git a/snippet/3.0.1/templates/5e32f2e1a6d11e8f150e.html b/snippet/3.0.0/templates/5e32f2e1a6d11e8f150e.html similarity index 100% rename from snippet/3.0.1/templates/5e32f2e1a6d11e8f150e.html rename to snippet/3.0.0/templates/5e32f2e1a6d11e8f150e.html diff --git a/snippet/3.0.1/templates/6043a16afdb829ba5934.html b/snippet/3.0.0/templates/6043a16afdb829ba5934.html similarity index 100% rename from snippet/3.0.1/templates/6043a16afdb829ba5934.html rename to snippet/3.0.0/templates/6043a16afdb829ba5934.html diff --git a/snippet/3.0.1/templates/b5ecdf1981d6cd190497.html b/snippet/3.0.0/templates/b5ecdf1981d6cd190497.html similarity index 100% rename from snippet/3.0.1/templates/b5ecdf1981d6cd190497.html rename to snippet/3.0.0/templates/b5ecdf1981d6cd190497.html diff --git a/snippet/3.0.1/templates/f2a9fbb003feacb050d3.html b/snippet/3.0.0/templates/f2a9fbb003feacb050d3.html similarity index 100% rename from snippet/3.0.1/templates/f2a9fbb003feacb050d3.html rename to snippet/3.0.0/templates/f2a9fbb003feacb050d3.html diff --git a/snippet/3.0.1/scripts/chat.js b/snippet/3.0.1/scripts/chat.js deleted file mode 100644 index d6d0c80..0000000 --- a/snippet/3.0.1/scripts/chat.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see chat.js.LICENSE.txt */ -(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["chat"],{"./node_modules/@flowjs/ng-flow/dist/ng-flow.js":(e,t,n)=>{var o=n("./node_modules/@flowjs/flow.js/src/flow.js");angular.module("flow.provider",[]).provider("flowFactory",(function(){"use strict";this.defaults={},this.factory=function(e){return new o(e)},this.events=[],this.on=function(e,t){this.events.push([e,t])},this.$get=function(){var e=this.factory,t=this.defaults,n=this.events;return{create:function(o){var r=e(angular.extend({},t,o));return angular.forEach(n,(function(e){r.on(e[0],e[1])})),r}}}})),angular.module("flow.init",["flow.provider"]).controller("flowCtrl",["$scope","$attrs","$parse","flowFactory",function(e,t,n,o){var r=angular.extend({},e.$eval(t.flowInit)),s=e.$eval(t.flowObject)||o.create(r),a=function(t){var n=Array.prototype.slice.call(arguments);n.shift();var o=e.$broadcast.apply(e,["flow::"+t,s].concat(n));if({progress:1,filesSubmitted:1,fileSuccess:1,fileError:1,complete:1}[t]&&e.$applyAsync(),o.defaultPrevented)return!1};s.on("catchAll",a),e.$on("$destroy",(function(){s.off("catchAll",a)})),e.$flow=s,t.hasOwnProperty("flowName")&&(n(t.flowName).assign(e,s),e.$on("$destroy",(function(){n(t.flowName).assign(e)})))}]).directive("flowInit",[function(){return{scope:!0,controller:"flowCtrl"}}]),angular.module("flow.btn",["flow.init"]).directive("flowBtn",[function(){return{restrict:"EA",scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.hasOwnProperty("flowDirectory"),r=n.hasOwnProperty("flowSingleFile"),s=n.hasOwnProperty("flowAttrs")&&e.$eval(n.flowAttrs);e.$flow.assignBrowse(t,o,r,s)}}}]),angular.module("flow.dragEvents",["flow.init"]).directive("flowPreventDrop",(function(){return{scope:!1,link:function(e,t,n){t.bind("drop dragover",(function(e){e.preventDefault()}))}}})).directive("flowDragEnter",["$timeout",function(e){return{scope:!1,link:function(t,n,o){var r,s=!1;n.bind("dragover",(function(n){var a,i,d;i=!1,d=(a=n).dataTransfer||a.originalEvent.dataTransfer,angular.forEach(d&&d.types,(function(e){"Files"===e&&(i=!0)})),i&&(s||(t.$apply(o.flowDragEnter),s=!0),e.cancel(r),n.preventDefault())})),n.bind("dragleave drop",(function(n){e.cancel(r),r=e((function(){t.$eval(o.flowDragLeave),r=null,s=!1}),100)}))}}}]),angular.module("flow.drop",["flow.init"]).directive("flowDrop",(function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){function o(){e.$flow.assignDrop(t)}n.flowDropEnabled?e.$watch(n.flowDropEnabled,(function(n){n?o():e.$flow.unAssignDrop(t)})):o()}}})),function(e){"use strict";var t=e.module("flow.events",["flow.init"]);e.forEach({fileSuccess:["$file","$message"],fileProgress:["$file"],fileAdded:["$file","$event"],filesAdded:["$files","$event"],filesSubmitted:["$files","$event"],fileRetry:["$file"],fileRemoved:["$file"],fileError:["$file","$message"],uploadStart:[],complete:[],progress:[],error:["$message","$file"]},(function(n,o){var r,s="flow"+((r=o).charAt(0).toUpperCase()+r.slice(1));"flowUploadStart"==s&&(s="flowUploadStarted"),t.directive(s,[function(){return{require:"^flowInit",controller:["$scope","$attrs",function(t,r){t.$on("flow::"+o,(function(){var o=Array.prototype.slice.call(arguments),a=o.shift();if(t.$flow===o.shift()){var i={};e.forEach(n,(function(e,t){i[e]=o[t]})),!1===t.$eval(r[s],i)&&a.preventDefault()}}))}]}}])}))}(angular),angular.module("flow.img",["flow.init"]).directive("flowImg",[function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.flowImg;e.$watch(o,(function(t){if(t){var o=new FileReader;o.readAsDataURL(t.file),o.onload=function(t){e.$apply((function(){n.$set("src",t.target.result)}))}}}))}}}]),angular.module("flow.transfers",["flow.init"]).directive("flowTransfers",[function(){return{scope:!0,require:"^flowInit",link:function(e){e.transfers=e.$flow.files}}}]),angular.module("flow",["flow.provider","flow.init","flow.events","flow.btn","flow.drop","flow.transfers","flow.img","flow.dragEvents"])},"./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js":(e,t,n)=>{"use strict";var o,r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),a=n("./node_modules/@uirouter/angularjs/lib-esm/services.js"),i=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js");function d(e,t,n,o,i){var d=(0,r.parse)("viewDecl.controllerAs"),u=(0,r.parse)("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(o){var m=o.html();return o.empty(),function(o,_){var c=_.data("$uiView");if(!c)return _.html(m),void e(_.contents())(o);var h=c.$cfg||{viewDecl:{},getTemplate:r.noop},f=h.path&&new r.ResolveContext(h.path);_.html(h.getTemplate(_,f)||m),r.trace.traceUIViewFill(c.$uiView,_.html());var p=e(_.contents()),M=h.controller,y=d(h),L=u(h),Y=f&&(0,a.D)(f);if(o[L]=Y,M){var g=t(M,(0,r.extend)({},Y,{$scope:o,$element:_}));y&&(o[y]=g,o[y][L]=Y),_.data("$ngControllerController",g),_.children().data("$ngControllerController",g),l(i,n,g,o,h)}if((0,r.isString)(h.component))var v=(0,r.kebobString)(h.component),k=new RegExp("^(x-|data-)?"+v+"$","i"),j=o.$watch((function(){var e=[].slice.call(_[0].children).filter((function(e){return e&&e.tagName&&k.exec(e.tagName)}));return e&&s.ng.element(e).data("$"+h.component+"Controller")}),(function(e){e&&(l(i,n,e,o,h),j())}));p(o)}}}}o=["$view","$animate","$uiViewScroll","$interpolate","$q",function(e,t,n,o,a){var d={$cfg:{viewDecl:{$context:e._pluginapi._rootViewContext()}},$uiView:{}},u={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(m,l,_){return function(m,l,c){var h,f,p,M,y=c.onload||"",L=c.autoscroll,Y=function(e,n,o){s.ng.version.minor>2?t.enter(e,null,n).then(o):t.enter(e,null,n,o)},g=function(e,n){s.ng.version.minor>2?t.leave(e).then(n):t.leave(e,n)},v=l.inheritedData("$uiView")||d,k=o(c.uiView||c.name||"")(m)||"$default",j={$type:"ng1",id:u.count++,name:k,fqn:v.$uiView.fqn?v.$uiView.fqn+"."+k:k,config:null,configUpdated:function(e){(!e||e instanceof i.qO)&&(M!==e&&(r.trace.traceUIViewConfigUpdated(j,e&&e.viewDecl&&e.viewDecl.$context),M=e,b(e)))},get creationContext(){var e=(0,r.parse)("$cfg.viewDecl.$context")(v),t=(0,r.parse)("$uiView.creationContext")(v);return e||t}};r.trace.traceUIViewEvent("Linking",j),l.data("$uiView",{$uiView:j}),b();var w=e.registerUIView(j);function b(e){var t=m.$new(),o=a.defer(),s=a.defer(),i={$cfg:e,$uiView:j},d={$animEnter:o.promise,$animLeave:s.promise,$$animLeave:s};t.$emit("$viewContentLoading",k);var u=_(t,(function(e){e.data("$uiViewAnim",d),e.data("$uiView",i),Y(e,l,(function(){o.resolve(),p&&p.$emit("$viewContentAnimationEnded"),((0,r.isDefined)(L)&&!L||m.$eval(L))&&n(e)})),function(){if(h&&(r.trace.traceUIViewEvent("Removing (previous) el",h.data("$uiView")),h.remove(),h=null),p&&(r.trace.traceUIViewEvent("Destroying scope",j),p.$destroy(),p=null),f){var e=f.data("$uiViewAnim");r.trace.traceUIViewEvent("Animate out",e),g(f,(function(){e.$$animLeave.resolve(),h=null})),h=f,f=null}}()}));f=u,(p=t).$emit("$viewContentLoaded",e||M),p.$eval(y)}m.$on("$destroy",(function(){r.trace.traceUIViewEvent("Destroying/Unregistering",j),w()}))}}};return u}],d.$inject=["$compile","$controller","$transitions","$view","$q"];var u="function"==typeof s.ng.module("ui.router").component,m=0;function l(e,t,n,o,s){!(0,r.isFunction)(n.$onInit)||(s.viewDecl.component||s.viewDecl.componentProvider)&&u||n.$onInit();var a=(0,r.tail)(s.path).state.self,i={bind:n};if((0,r.isFunction)(n.uiOnParamsChanged)){var d=new r.ResolveContext(s.path).getResolvable("$transition$").data;o.$on("$destroy",t.onSuccess({},(function(e){if(e!==d&&-1===e.exiting().indexOf(a)){var t=e.params("to"),o=e.params("from"),s=function(e){return e.paramSchema},i=e.treeChanges("to").map(s).reduce(r.unnestR,[]),u=e.treeChanges("from").map(s).reduce(r.unnestR,[]),m=i.filter((function(e){var n=u.indexOf(e);return-1===n||!u[n].type.equals(t[e.id],o[e.id])}));if(m.length){var l=m.map((function(e){return e.id})),_=(0,r.filter)(t,(function(e,t){return-1!==l.indexOf(t)}));n.uiOnParamsChanged(_,e)}}}),i))}if((0,r.isFunction)(n.uiCanExit)){var l=m++,_="_uiCanExitIds",c=function(e){return!!e&&(e[_]&&!0===e[_][l]||c(e.redirectedFrom()))},h={exiting:a.name};o.$on("$destroy",t.onBefore(h,(function(t){var o,r=t[_]=t[_]||{};return c(t)||(o=e.when(n.uiCanExit(t))).then((function(e){return r[l]=!1!==e})),o}),i))}}s.ng.module("ui.router.state").directive("uiView",o),s.ng.module("ui.router.state").directive("uiView",d)},"./node_modules/@uirouter/angularjs/lib-esm/services.js":(e,t,n)=>{"use strict";n.d(t,{D:()=>k});var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),a=function(){function e(){var e=this;this._useHttp=o.ng.version.minor<3,this.$get=["$http","$templateCache","$injector",function(t,n,o){return e.$templateRequest=o.has&&o.has("$templateRequest")&&o.get("$templateRequest"),e.$http=t,e.$templateCache=n,e}]}return e.prototype.useHttpService=function(e){this._useHttp=e},e.prototype.fromConfig=function(e,t,n){var o=function(e){return r.services.$q.when(e).then((function(e){return{template:e}}))},s=function(e){return r.services.$q.when(e).then((function(e){return{component:e}}))};return(0,r.isDefined)(e.template)?o(this.fromString(e.template,t)):(0,r.isDefined)(e.templateUrl)?o(this.fromUrl(e.templateUrl,t)):(0,r.isDefined)(e.templateProvider)?o(this.fromProvider(e.templateProvider,t,n)):(0,r.isDefined)(e.component)?s(e.component):(0,r.isDefined)(e.componentProvider)?s(this.fromComponentProvider(e.componentProvider,t,n)):o("")},e.prototype.fromString=function(e,t){return(0,r.isFunction)(e)?e(t):e},e.prototype.fromUrl=function(e,t){return(0,r.isFunction)(e)&&(e=e(t)),null==e?null:this._useHttp?this.$http.get(e,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then((function(e){return e.data})):this.$templateRequest(e)},e.prototype.fromProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.fromComponentProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.makeComponentTemplate=function(e,t,n,s){s=s||{};var a=o.ng.version.minor>=3?"::":"",d=function(e){var t=(0,r.kebobString)(e);return/^(x|data)-/.exec(t)?"x-"+t:t},u=function(e){var t=r.services.$injector.get(e+"Directive");if(!t||!t.length)throw new Error("Unable to find component named '"+e+"'");return t.map(i).reduce(r.unnestR,[])}(n).map((function(n){var o=n.name,i=n.type,u=d(o);if(e.attr(u)&&!s[o])return u+"='"+e.attr(u)+"'";var m=s[o]||o;if("@"===i)return u+"='{{"+a+"$resolve."+m+"}}'";if("&"===i){var l=t.getResolvable(m),_=l&&l.data,c=_&&r.services.$injector.annotate(_)||[];return u+"='$resolve."+m+((0,r.isArray)(_)?"["+(_.length-1)+"]":"")+"("+c.join(",")+")'"}return u+"='"+a+"$resolve."+m+"'"})).join(" "),m=d(n);return"<"+m+" "+u+">"},e}(),i=function(e){return(0,r.isObject)(e.bindToController)?d(e.bindToController):d(e.scope)},d=function(e){return Object.keys(e||{}).map((function(t){return[t,/^([=<@&])[?]?(.*)/.exec(e[t])]})).filter((function(e){return(0,r.isDefined)(e)&&(0,r.isArray)(e[1])})).map((function(e){return{name:e[1][2]||e[0],type:e[1][1]}}))},u=n("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),m=function(e){return function(t){var n=t[e],o="onExit"===e?"from":"to";return n?function(e,t){var s=new r.ResolveContext(e.treeChanges(o)).subContext(t.$$state()),a=(0,r.extend)(k(s),{$state$:t,$transition$:e});return r.services.$injector.invoke(n,this,a)}:void 0}},l=function(){function e(e){this._urlListeners=[],this.$locationProvider=e;var t=(0,r.val)(e);(0,r.createProxyFunctions)(t,this,t,["hashPrefix"])}return e.monkeyPatchPathParameterType=function(e){var t=e.urlMatcherFactory.type("path");t.encode=function(e){return null!=e?e.toString().replace(/(~|\/)/g,(function(e){return{"~":"~~","/":"~2F"}[e]})):e},t.decode=function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,(function(e){return{"~~":"~","~2F":"/"}[e]})):e}},e.prototype.dispose=function(){},e.prototype.onChange=function(e){var t=this;return this._urlListeners.push(e),function(){return(0,r.removeFrom)(t._urlListeners)(e)}},e.prototype.html5Mode=function(){var e=this.$locationProvider.html5Mode();return(e=(0,r.isObject)(e)?e.enabled:e)&&this.$sniffer.history},e.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},e.prototype.url=function(e,t,n){return void 0===t&&(t=!1),(0,r.isDefined)(e)&&this.$location.url(e),t&&this.$location.replace(),n&&this.$location.state(n),this.$location.url()},e.prototype._runtimeServices=function(e,t,n,o,s){var a=this;this.$location=t,this.$sniffer=n,this.$browser=o,this.$window=s,e.$on("$locationChangeSuccess",(function(e){return a._urlListeners.forEach((function(t){return t(e)}))}));var i=(0,r.val)(t);(0,r.createProxyFunctions)(i,this,i,["replace","path","search","hash"]),(0,r.createProxyFunctions)(i,this,i,["port","protocol","host"])},e}(),_=n("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js");o.ng.module("ui.router.angular1",[]);var c=o.ng.module("ui.router.init",["ng"]),h=o.ng.module("ui.router.util",["ui.router.init"]),f=o.ng.module("ui.router.router",["ui.router.util"]),p=o.ng.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),M=o.ng.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),y=(o.ng.module("ui.router.compat",["ui.router"]),null);function L(e){(y=this.router=new r.UIRouter).stateProvider=new u.X(y.stateRegistry,y.stateService),y.stateRegistry.decorator("views",s.LB),y.stateRegistry.decorator("onExit",m("onExit")),y.stateRegistry.decorator("onRetain",m("onRetain")),y.stateRegistry.decorator("onEnter",m("onEnter")),y.viewService._pluginapi._viewConfigFactory("ng1",(0,s.OB)()),y.urlService.config._decodeParams=!1;var t=y.locationService=y.locationConfig=new l(e);function n(e,n,o,r,s,a,i){return t._runtimeServices(s,e,r,n,o),delete y.router,delete y.$get,y}return l.monkeyPatchPathParameterType(y),y.router=y,y.$get=n,n.$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],y}L.$inject=["$locationProvider"];var Y=function(e){return["$uiRouterProvider",function(t){var n=t.router[e];return n.$get=function(){return n},n}]};function g(e,t,n){if(r.services.$injector=e,r.services.$q=t,!Object.prototype.hasOwnProperty.call(e,"strictDi"))try{e.invoke((function(e){}))}catch(t){e.strictDi=!!/strict mode/.exec(t&&t.toString())}n.stateRegistry.get().map((function(e){return e.$$state().resolvables})).reduce(r.unnestR,[]).filter((function(e){return"deferred"===e.deps})).forEach((function(t){return t.deps=e.annotate(t.resolveFn,e.strictDi)}))}function v(e){e.$watch((function(){r.trace.approximateDigests++}))}g.$inject=["$injector","$q","$uiRouter"],v.$inject=["$rootScope"],c.provider("$uiRouter",L),f.provider("$urlRouter",["$uiRouterProvider",function(e){return e.urlRouterProvider=new _.L(e)}]),h.provider("$urlService",Y("urlService")),h.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return y.urlMatcherFactory}]),h.provider("$templateFactory",(function(){return new a})),p.provider("$stateRegistry",Y("stateRegistry")),p.provider("$uiRouterGlobals",Y("globals")),p.provider("$transitions",Y("transitionService")),p.provider("$state",["$uiRouterProvider",function(){return(0,r.extend)(y.stateProvider,{$get:function(){return y.stateService}})}]),p.factory("$stateParams",["$uiRouter",function(e){return e.globals.params}]),M.factory("$view",(function(){return y.viewService})),M.service("$trace",(function(){return r.trace})),M.run(v),h.run(["$urlMatcherFactory",function(e){}]),p.run(["$state",function(e){}]),f.run(["$urlRouter",function(e){}]),c.run(g);var k=function(e){return e.getTokens().filter(r.isString).map((function(t){var n=e.getResolvable(t);return[t,"NOWAIT"===e.getPolicy(n).async?n.promise:n.data]})).reduce(r.applyPairs,{})}},"./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js");function r(e){var t=function(t,n,o){return e.is(t,n,o)};return t.$stateful=!0,t}function s(e){var t=function(t,n,o){return e.includes(t,n,o)};return t.$stateful=!0,t}r.$inject=["$state"],s.$inject=["$state"],o.ng.module("ui.router.state").filter("isState",r).filter("includedByState",s)},"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(t,n){this.stateRegistry=t,this.stateService=n,(0,o.createProxyFunctions)((0,o.val)(e.prototype),this,(0,o.val)(this))}return e.prototype.decorator=function(e,t){return this.stateRegistry.decorator(e,t)||this},e.prototype.state=function(e,t){return(0,o.isObject)(e)?t=e:t.name=e,this.stateRegistry.register(t),this},e.prototype.onInvalid=function(e){return this.stateService.onInvalid(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js":(e,t,n)=>{"use strict";n.d(t,{OB:()=>r,LB:()=>a,qO:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/index.js");function r(){var e=null;return function(t,n){return e=e||o.services.$injector.get("$templateFactory"),[new d(t,n,e)]}}var s=function(e,t){return e.reduce((function(e,n){return e||(0,o.isDefined)(t[n])}),!1)};function a(e){if(!e.parent)return{};var t=["component","bindings","componentProvider"],n=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),r=t.concat(n);if((0,o.isDefined)(e.views)&&s(r,e))throw new Error("State '"+e.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+r.filter((function(t){return(0,o.isDefined)(e[t])})).join(", "));var a={},i=e.views||{$default:(0,o.pick)(e,r)};return(0,o.forEach)(i,(function(r,i){if(i=i||"$default",(0,o.isString)(r)&&(r={component:r}),r=(0,o.extend)({},r),s(t,r)&&s(n,r))throw new Error("Cannot combine: "+t.join("|")+" with: "+n.join("|")+" in stateview: '"+i+"@"+e.name+"'");r.resolveAs=r.resolveAs||"$resolve",r.$type="ng1",r.$context=e,r.$name=i;var d=o.ViewService.normalizeUIViewTarget(r.$context,r.$name);r.$uiViewName=d.uiViewName,r.$uiViewContextAnchor=d.uiViewContextAnchor,a[i]=r})),a}var i=0,d=function(){function e(e,t,n){var o=this;this.path=e,this.viewDecl=t,this.factory=n,this.$id=i++,this.loaded=!1,this.getTemplate=function(e,t){return o.component?o.factory.makeComponentTemplate(e,t,o.component,o.viewDecl.bindings):o.template}}return e.prototype.load=function(){var e=this,t=o.services.$q,n=new o.ResolveContext(this.path),r=this.path.reduce((function(e,t){return(0,o.extend)(e,t.paramValues)}),{}),s={template:t.when(this.factory.fromConfig(this.viewDecl,r,n)),controller:t.when(this.getController(n))};return t.all(s).then((function(t){return o.trace.traceViewServiceEvent("Loaded",e),e.controller=t.controller,(0,o.extend)(e,t.template),e}))},e.prototype.getController=function(e){var t=this.viewDecl.controllerProvider;if(!(0,o.isInjectable)(t))return this.viewDecl.controller;var n=o.services.$injector.annotate(t),r=(0,o.isArray)(t)?(0,o.tail)(t):t;return new o.Resolvable("",r,n).get(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(e){this.router=e}return e.injectableHandler=function(e,t){return function(n){return o.services.$injector.invoke(t,null,{$match:n,$stateParams:e.globals.params})}},e.prototype.$get=function(){var e=this.router.urlService;return this.router.urlRouter.update(!0),e.interceptDeferred||e.listen(),this.router.urlRouter},e.prototype.rule=function(e){var t=this;if(!(0,o.isFunction)(e))throw new Error("'rule' must be a function");var n=new o.BaseUrlRule((function(){return e(o.services.$injector,t.router.locationService)}),o.identity);return this.router.urlService.rules.rule(n),this},e.prototype.otherwise=function(e){var t=this,n=this.router.urlService.rules;if((0,o.isString)(e))n.otherwise(e);else{if(!(0,o.isFunction)(e))throw new Error("'rule' must be a string or function");n.otherwise((function(){return e(o.services.$injector,t.router.locationService)}))}return this},e.prototype.when=function(t,n){return((0,o.isArray)(n)||(0,o.isFunction)(n))&&(n=e.injectableHandler(this.router,n)),this.router.urlService.rules.when(t,n),this},e.prototype.deferIntercept=function(e){this.router.urlService.deferIntercept(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/angularjs/lib-esm/angular.js").ng.module("ui.router.state").provider("$uiViewScroll",(function(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,n){return e?t:function(e){return n((function(){e[0].scrollIntoView()}),0,!1)}}]}))},"./node_modules/@uirouter/core/lib-esm/common/common.js":(e,t,n)=>{"use strict";n.d(t,{Jz:()=>i,xZ:()=>u,Qs:()=>m,Ed:()=>l,l7:()=>_,fS:()=>c,yR:()=>h,ZT:()=>f,WR:()=>p,ED:()=>M,d3:()=>y,nA:()=>L,LH:()=>Y,Wk:()=>g,ce:()=>v,LQ:()=>k,mX:()=>j,ei:()=>w,CE:()=>b,hX:()=>D,sE:()=>T,js:()=>S,UI:()=>H,VO:()=>x,XC:()=>E,o8:()=>P,M7:()=>O,FN:()=>$,Ez:()=>A,v_:()=>F,UW:()=>R,sp:()=>W,ym:()=>C,bb:()=>z,Gb:()=>I,JG:()=>J,HX:()=>V,jv:()=>N});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),a=function(){for(var e=0,t=0,n=arguments.length;t=0&&e.splice(n,1),e})),Y=(0,r.WA)((function(e,t){return e.push(t),t})),g=function(e){return e.slice().forEach((function(t){"function"==typeof t&&t(),L(e,t)}))};function v(e){for(var t=[],n=1;n{"use strict";n.d(t,{H:()=>o,u:()=>r});var o=function(e,t){return t.reduce((function(t,n){return t[n]=(o=e+"."+n+"()",function(){throw new Error("No implementation for "+o+". The framework specific code did not implement this method.")}),t;var o}),{})},r={$q:void 0,$injector:void 0}},"./node_modules/@uirouter/core/lib-esm/common/glob.js":(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var o=function(){function e(e){this.text=e,this.glob=e.split(".");var t=this.text.split(".").map((function(e){return"**"===e?"(?:|(?:\\.[^.]*)*)":"*"===e?"\\.[^.]*":"\\."+e})).join("");this.regexp=new RegExp("^"+t+"$")}return e.is=function(e){return!!/[!,*]+/.exec(e)},e.fromString=function(t){return e.is(t)?new e(t):null},e.prototype.matches=function(e){return this.regexp.test("."+e)},e}()},"./node_modules/@uirouter/core/lib-esm/common/hof.js":(e,t,n)=>{"use strict";n.d(t,{WA:()=>r,zG:()=>a,vg:()=>i,OH:()=>d,Qc:()=>u,ff:()=>m,xD:()=>l,or:()=>_,$6:()=>c,Yj:()=>h,is:()=>f,P0:()=>p,uj:()=>M});var o=function(){for(var e=0,t=0,n=arguments.length;t=e.length)return e.apply(this,arguments);var n=Array.prototype.slice.call(arguments);return t.bind.apply(t,o([this],n))}}function s(){var e=arguments,t=e.length-1;return function(){for(var n=t,o=e[t].apply(this,arguments);n--;)o=e[n].call(this,o);return o}}function a(){for(var e=[],t=0;t{"use strict";n.d(t,{o8:()=>a,$K:()=>i,Ft:()=>d,le:()=>u,mf:()=>m,hj:()=>l,HD:()=>_,Kn:()=>c,kJ:()=>h,J_:()=>f,Kj:()=>p,Qh:()=>M,tI:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),r=Object.prototype.toString,s=function(e){return function(t){return typeof t===e}},a=s("undefined"),i=(0,o.ff)(a),d=function(e){return null===e},u=(0,o.or)(d,a),m=s("function"),l=s("number"),_=s("string"),c=function(e){return null!==e&&"object"==typeof e},h=Array.isArray,f=function(e){return"[object Date]"===r.call(e)},p=function(e){return"[object RegExp]"===r.call(e)};function M(e){if(h(e)&&e.length){var t=e.slice(0,-1),n=e.slice(-1);return!(t.filter((0,o.ff)(_)).length||n.filter((0,o.ff)(m)).length)}return m(e)}var y=(0,o.xD)(c,(0,o.zG)((0,o.vg)("then"),m))},"./node_modules/@uirouter/core/lib-esm/common/queue.js":(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=null),this._items=e,this._limit=t,this._evictListeners=[],this.onEvict=(0,o.LH)(this._evictListeners)}return e.prototype.enqueue=function(e){var t=this._items;return t.push(e),this._limit&&t.length>this._limit&&this.evict(),e},e.prototype.evict=function(){var e=this._items.shift();return this._evictListeners.forEach((function(t){return t(e)})),e},e.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},e.prototype.clear=function(){var e=this._items;return this._items=[],e},e.prototype.size=function(){return this._items.length},e.prototype.remove=function(e){var t=this._items.indexOf(e);return t>-1&&this._items.splice(t,1)[0]},e.prototype.peekTail=function(){return this._items[this._items.length-1]},e.prototype.peekHead=function(){if(this.size())return this._items[0]},e}()},"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r={log:o.ZT,error:o.ZT,table:o.ZT},s="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?function(e){var t=function(t){return Function.prototype.bind.call(t,e)};return{log:t(e.log),error:t(e.log),table:t(e.log)}}(window.console):r:console.table&&console.error?console:function(e){var t=e.log.bind(e);return{log:t,error:e.error?e.error.bind(e):t,table:e.table?e.table.bind(e):t}}(console)},"./node_modules/@uirouter/core/lib-esm/common/strings.js":(e,t,n)=>{"use strict";n.d(t,{BS:()=>i,NE:()=>d,L$:()=>u,XF:()=>m,iC:()=>l,Pz:()=>h,Lb:()=>p,cW:()=>M,C7:()=>y,Fb:()=>L,HV:()=>Y,PX:()=>g,iV:()=>v});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");function i(e,t){return t.length<=e?t:t.substr(0,e-3)+"..."}function d(e,t){for(;t.length{"use strict";n.d(t,{g4:()=>c});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js");function d(e){if(!e)return"ui-view (defunct)";var t=e.creationContext?e.creationContext.name||"(root)":"(none)";return"[ui-view#"+e.id+" "+e.$type+":"+e.fqn+" ("+e.name+"@"+t+")]"}function u(e){return(0,s.hj)(e)?o[e]:o[o[e]]}!function(e){e[e.RESOLVE=0]="RESOLVE",e[e.TRANSITION=1]="TRANSITION",e[e.HOOK=2]="HOOK",e[e.UIVIEW=3]="UIVIEW",e[e.VIEWCONFIG=4]="VIEWCONFIG"}(o||(o={}));var m=(0,r.Qc)("$id"),l=(0,r.Qc)("router.$id"),_=function(e){return"Transition #"+m(e)+"-"+l(e)},c=new(function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,t){var n=this;t.length||(t=Object.keys(o).map((function(e){return parseInt(e,10)})).filter((function(e){return!isNaN(e)})).map((function(e){return o[e]}))),t.map(u).forEach((function(t){return n._enabled[t]=e}))},e.prototype.enable=function(){for(var e=[],t=0;t "+(0,a.Pz)(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Ignored <> "+(0,a.Pz)(e))},e.prototype.traceHookInvocation=function(e,t,n){if(this.enabled(o.HOOK)){var s=(0,r.Qc)("traceData.hookType")(n)||"internal",d=(0,r.Qc)("traceData.context.state.name")(n)||(0,r.Qc)("traceData.context")(n)||"unknown",u=(0,a.XF)(e.registeredHook.callback);i.L.log(_(t)+": Hook -> "+s+" context: "+d+", "+(0,a.BS)(200,u))}},e.prototype.traceHookResult=function(e,t,n){this.enabled(o.HOOK)&&i.L.log(_(t)+": <- Hook returned: "+(0,a.BS)(200,(0,a.Pz)(e)))},e.prototype.traceResolvePath=function(e,t,n){this.enabled(o.RESOLVE)&&i.L.log(_(n)+": Resolving "+e+" ("+t+")")},e.prototype.traceResolvableResolved=function(e,t){this.enabled(o.RESOLVE)&&i.L.log(_(t)+": <- Resolved "+e+" to: "+(0,a.BS)(200,(0,a.Pz)(e.data)))},e.prototype.traceError=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Rejected "+(0,a.Pz)(t)+", reason: "+e)},e.prototype.traceSuccess=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Success "+(0,a.Pz)(t)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,t,n){void 0===n&&(n=""),this.enabled(o.UIVIEW)&&i.L.log("ui-view: "+(0,a.NE)(30,e)+" "+d(t)+n)},e.prototype.traceUIViewConfigUpdated=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+t+"'")},e.prototype.traceUIViewFill=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+(0,a.BS)(200,t))},e.prototype.traceViewSync=function(e){if(this.enabled(o.VIEWCONFIG)){var t="uiview component fqn",n=e.map((function(e){var n,o=e.uiView,r=e.viewConfig,s=o&&o.fqn,a=r&&r.viewDecl.$context.name+": ("+r.viewDecl.$name+")";return(n={})[t]=s,n["view config state (view name)"]=a,n})).sort((function(e,n){return(e[t]||"").localeCompare(n[t]||"")}));i.L.table(n)}},e.prototype.traceViewServiceEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+function(e){var t=e.viewDecl,n=t.$context.name||"(root)";return"[View#"+e.$id+" from '"+n+"' state]: target ui-view: '"+t.$uiViewName+"@"+t.$uiViewContextAnchor+"'"}(t))},e.prototype.traceViewServiceUIViewEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+d(t))},e}())},"./node_modules/@uirouter/core/lib-esm/globals.js":(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/queue.js"),s=function(){function e(){this.params=new o.i,this.lastStartedTransitionId=-1,this.transitionHistory=new r.c([],1),this.successfulTransitions=new r.c([],1)}return e.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},e}()},"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js":(e,t,n)=>{"use strict";n.d(t,{v:()=>s,A:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),r=function(e){var t=e.router,n=e.entering().filter((function(e){return!!e.$$state().lazyLoad})).map((function(t){return a(e,t)}));return o.u.$q.all(n).then((function(){if("url"!==e.originalTransition().options().source){var n=e.targetState();return t.stateService.target(n.identifier(),n.params(),n.options())}var o=t.urlService,r=o.match(o.parts()),s=r&&r.rule;if(s&&"STATE"===s.type){var a=s.state,i=r.match;return t.stateService.target(a,i,e.options())}t.urlService.sync()}))},s=function(e){return e.onBefore({entering:function(e){return!!e.lazyLoad}},r)};function a(e,t){var n=t.$$state().lazyLoad,r=n._promise;return r||(r=n._promise=o.u.$q.when(n(e,t)).then((function(t){return t&&Array.isArray(t.states)&&t.states.forEach((function(t){return e.router.stateRegistry.register(t)})),t})).then((function(e){return delete t.lazyLoad,delete t.$$state().lazyLoad,delete n._promise,e}),(function(e){return delete n._promise,o.u.$q.reject(e)}))),r}},"./node_modules/@uirouter/core/lib-esm/interface.js":(e,t,n)=>{},"./node_modules/@uirouter/core/lib-esm/params/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/params/param.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>o,d:()=>m});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=Object.prototype.hasOwnProperty;!function(e){e[e.PATH=0]="PATH",e[e.SEARCH=1]="SEARCH",e[e.CONFIG=2]="CONFIG"}(o||(o={}));var m=function(){function e(e,t,n,i,m){var l=function(e,t,n){var s=!1===n.reloadOnSearch&&t===o.SEARCH||void 0,i=(0,r.sE)([n.dynamic,s],a.$K),d=(0,a.$K)(i)?{dynamic:i}:{},m=function(e){function t(){return e.value}e=function(e){return 0===["value","type","squash","array","dynamic"].filter(u.bind(e||{})).length}(e)?{value:e}:e,t.__cacheable=!0;var n=(0,a.Qh)(e.value)?e.value:t;return(0,r.l7)(e,{$$fn:n})}(n&&n.params&&n.params[e]);return(0,r.l7)(d,m)}(e,n,m);t=function(e,t,n,r,s){if(e.type&&t&&"string"!==t.name)throw new Error("Param '"+r+"' has two type configurations.");if(e.type&&t&&"string"===t.name&&s.type(e.type))return s.type(e.type);if(t)return t;if(!e.type){var a=n===o.CONFIG?"any":n===o.PATH?"path":n===o.SEARCH?"query":"string";return s.type(a)}return e.type instanceof d._?e.type:s.type(e.type)}(l,t,n,e,i.paramTypes);var _,c,h=(_={array:n===o.SEARCH&&"auto"},c=e.match(/\[\]$/)?{array:!0}:{},(0,r.l7)(_,c,l).array);t=h?t.$asArray(h,n===o.SEARCH):t;var f=void 0!==l.value||n===o.SEARCH,p=(0,a.$K)(l.dynamic)?!!l.dynamic:!!t.dynamic,M=(0,a.$K)(l.raw)?!!l.raw:!!t.raw,y=function(e,t,n){var o=e.squash;if(!t||!1===o)return!1;if(!(0,a.$K)(o)||null==o)return n;if(!0===o||(0,a.HD)(o))return o;throw new Error("Invalid squash policy: '"+o+"'. Valid policies: false, true, or arbitrary string")}(l,f,i.defaultSquashPolicy()),L=function(e,t,n,o){var i=[{from:"",to:n||t?void 0:""},{from:null,to:n||t?void 0:""}],d=(0,a.kJ)(e.replace)?e.replace:[];(0,a.HD)(o)&&d.push({from:o,to:void 0});var u=(0,r.UI)(d,(0,s.vg)("from"));return(0,r.hX)(i,(function(e){return-1===u.indexOf(e.from)})).concat(d)}(l,h,f,y),Y=(0,a.$K)(l.inherit)?!!l.inherit:!!t.inherit;(0,r.l7)(this,{id:e,type:t,location:n,isOptional:f,dynamic:p,raw:M,squash:y,replace:L,inherit:Y,array:h,config:l})}return e.values=function(e,t){void 0===t&&(t={});for(var n={},o=0,r=e;o{"use strict";n.d(t,{_:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=function(){function e(e){this.pattern=/.*/,this.inherit=!0,(0,o.l7)(this,e)}return e.prototype.is=function(e,t){return!0},e.prototype.encode=function(e,t){return e},e.prototype.decode=function(e,t){return e},e.prototype.equals=function(e,t){return e==t},e.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},e.prototype.toString=function(){return"{ParamType:"+this.name+"}"},e.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},e.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new a(this,e)},e}();function a(e,t){var n=this;function s(e){return(0,r.kJ)(e)?e:(0,r.$K)(e)?[e]:[]}function a(e,n){return function(a){if((0,r.kJ)(a)&&0===a.length)return a;var i=s(a),d=(0,o.UI)(i,e);return!0===n?0===(0,o.hX)(d,(function(e){return!e})).length:function(e){switch(e.length){case 0:return;case 1:return"auto"===t?e[0]:e;default:return e}}(d)}}function i(e){return function(t,n){var o=s(t),r=s(n);if(o.length!==r.length)return!1;for(var a=0;a{"use strict";n.d(t,{p:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=function(){function e(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=(0,r.ei)(e.prototype,["hash","string","query","path","int","bool","date","json","any"]),this.types=(0,r.ED)((0,r.UI)(this.defaultTypes,(function(e,t){return new d._((0,r.l7)({name:t},e))})),{})}return e.prototype.dispose=function(){this.types={}},e.prototype.type=function(e,t,n){if(!(0,s.$K)(t))return this.types[e];if(this.types.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return this.types[e]=new d._((0,r.l7)({name:e},t)),n&&(this.typeQueue.push({name:e,def:n}),this.enqueue||this._flushTypeQueue()),this},e.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var e=this.typeQueue.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");(0,r.l7)(this.types[e.name],i.u.$injector.invoke(e.def))}},e}();o=function(e){var t=function(e){return null!=e?e.toString():e},n={encode:t,decode:t,is:(0,a.is)(String),pattern:/.*/,equals:function(e,t){return e==t}};return(0,r.l7)({},n,e)},(0,r.l7)(u.prototype,{string:o({}),path:o({pattern:/[^/]*/}),query:o({}),hash:o({inherit:!1}),int:o({decode:function(e){return parseInt(e,10)},is:function(e){return!(0,s.le)(e)&&this.decode(e.toString())===e},pattern:/-?\d+/}),bool:o({encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:(0,a.is)(Boolean),pattern:/0|1/}),date:o({encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):void 0},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):void 0},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return["getFullYear","getMonth","getDate"].reduce((function(n,o){return n&&e[o]()===t[o]()}),!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:o({encode:r.Qs,decode:r.xZ,is:(0,a.is)(Object),equals:r.fS,pattern:/[^/]*/}),any:o({encode:r.yR,decode:r.yR,is:function(){return!0},equals:r.fS})})},"./node_modules/@uirouter/core/lib-esm/params/stateParams.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e){void 0===e&&(e={}),(0,o.l7)(this,e)}return e.prototype.$inherit=function(e,t,n){var r,s=(0,o.mX)(t,n),a={},i=[];for(var d in s)if(s[d]&&s[d].params&&(r=Object.keys(s[d].params)).length)for(var u in r)i.indexOf(r[u])>=0||(i.push(r[u]),a[r[u]]=this[r[u]]);return(0,o.l7)({},a,e)},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathNode.js":(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/param.js"),a=function(){function e(t){if(t instanceof e){var n=t;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=(0,o.l7)({},n.paramValues),this.resolvables=n.resolvables.slice(),this.views=n.views&&n.views.slice()}else{var r=t;this.state=r,this.paramSchema=r.parameters({inherit:!1}),this.paramValues={},this.resolvables=r.resolvables.map((function(e){return e.clone()}))}}return e.prototype.clone=function(){return new e(this)},e.prototype.applyRawParams=function(e){return this.paramValues=this.paramSchema.reduce((function(t,n){return(0,o.bb)(t,[(r=n).id,r.value(e[r.id])]);var r}),{}),this},e.prototype.parameter=function(e){return(0,o.sE)(this.paramSchema,(0,r.OH)("id",e))},e.prototype.equals=function(e,t){var n=this.diff(e,t);return n&&0===n.length},e.prototype.diff=function(e,t){if(this.state!==e.state)return!1;var n=t?t(this):this.paramSchema;return s.d.changed(n,this.paramValues,e.paramValues)},e.clone=function(e){return e.clone()},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js":(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),a=n("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),i=function(){function e(){}return e.makeTargetState=function(e,t){var n=(0,o.Gb)(t).state;return new s.F(e,n,t.map((0,r.vg)("paramValues")).reduce(o.LQ,{}),{})},e.buildPath=function(e){var t=e.params();return e.$state().path.map((function(e){return new a.V(e).applyRawParams(t)}))},e.buildToPath=function(t,n){var o=e.buildPath(n);return n.options().inherit?e.inheritParams(t,o,Object.keys(n.params())):o},e.applyViewConfigs=function(t,n,r){n.filter((function(e){return(0,o.d3)(r,e.state)})).forEach((function(r){var s=(0,o.VO)(r.state.views||{}),a=e.subPath(n,(function(e){return e===r})),i=s.map((function(e){return t.createViewConfig(a,e)}));r.views=i.reduce(o.M7,[])}))},e.inheritParams=function(e,t,n){void 0===n&&(n=[]);var s=e.map((function(e){return e.paramSchema})).reduce(o.M7,[]).filter((function(e){return!e.inherit})).map((0,r.vg)("id"));return t.map((function(t){var i=(0,o.l7)({},t&&t.paramValues),d=(0,o.ei)(i,n);i=(0,o.CE)(i,n);var u,m,l,_=(0,o.CE)((u=e,m=t.state,l=(0,o.sE)(u,(0,r.OH)("state",m)),(0,o.l7)({},l&&l.paramValues)||{}),s),c=(0,o.l7)(i,_,d);return new a.V(t.state).applyRawParams(c)}))},e.treeChanges=function(t,n,o){for(var r,s,a,i,d,u,m=Math.min(t.length,n.length),l=0;l{"use strict";n.d(t,{u:()=>o});var o={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}}},"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),d=function(){function e(t,n,s,a,d){if(this.resolved=!1,this.promise=void 0,t instanceof e)(0,o.l7)(this,t);else if((0,i.mf)(n)){if((0,i.le)(t))throw new Error("new Resolvable(): token argument is required");if(!(0,i.mf)(n))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=t,this.policy=a,this.resolveFn=n,this.deps=s||[],this.data=d,this.resolved=void 0!==d,this.promise=this.resolved?r.u.$q.when(this.data):void 0}else if((0,i.Kn)(t)&&t.token&&(t.hasOwnProperty("resolveFn")||t.hasOwnProperty("data"))){var u=t;return new e(u.token,u.resolveFn,u.deps,u.policy,u.data)}}return e.prototype.getPolicy=function(e){var t=this.policy||{},n=e&&e.resolvePolicy||{};return{when:t.when||n.when||"LAZY",async:t.async||n.async||"WAIT"}},e.prototype.resolve=function(e,t){var n=this,a=r.u.$q,d=e.findNode(this),u=d&&d.state,m=this.getPolicy(u).async,l=(0,i.mf)(m)?m:o.yR;return this.promise=a.when().then((function(){return a.all(e.getDependencies(n).map((function(n){return n.get(e,t)})))})).then((function(e){return n.resolveFn.apply(null,e)})).then(l).then((function(e){return n.data=e,n.resolved=!0,n.resolveFn=null,s.g4.traceResolvableResolved(n,t),n.data}))},e.prototype.get=function(e,t){return this.promise||this.resolve(e,t)},e.prototype.toString=function(){return"Resolvable(token: "+(0,a.Pz)(this.token)+", requires: ["+this.deps.map(a.Pz)+"])"},e.prototype.clone=function(){return new e(this)},e.fromData=function(t,n){return new e(t,(function(){return n}),null,null,n)},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>f});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/interface.js"),d=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),u=n("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),_=i.u.when,c=[_.EAGER,_.LAZY],h=[_.EAGER],f=function(){function e(e){this._path=e}return e.prototype.getTokens=function(){return this._path.reduce((function(e,t){return e.concat(t.resolvables.map((function(e){return e.token})))}),[]).reduce(o.v_,[])},e.prototype.getResolvable=function(e){var t=this._path.map((function(e){return e.resolvables})).reduce(o.M7,[]).filter((function(t){return t.token===e}));return(0,o.Gb)(t)},e.prototype.getPolicy=function(e){var t=this.findNode(e);return e.getPolicy(t.state)},e.prototype.subContext=function(t){return new e(u.C.subPath(this._path,(function(e){return e.state===t})))},e.prototype.addResolvables=function(e,t){var n=(0,o.sE)(this._path,(0,r.OH)("state",t)),s=e.map((function(e){return e.token}));n.resolvables=n.resolvables.filter((function(e){return-1===s.indexOf(e.token)})).concat(e)},e.prototype.resolvePath=function(e,t){var n=this;void 0===e&&(e="LAZY");var d=((0,o.d3)(c,e)?e:"LAZY")===i.u.when.EAGER?h:c;s.g4.traceResolvePath(this._path,e,t);var u=function(e,t){return function(r){return(0,o.d3)(e,n.getPolicy(r)[t])}},m=this._path.reduce((function(e,o){var s=o.resolvables.filter(u(d,"when")),a=s.filter(u(["NOWAIT"],"async")),i=s.filter((0,r.ff)(u(["NOWAIT"],"async"))),m=n.subContext(o.state),l=function(e){return e.get(m,t).then((function(t){return{token:e.token,value:t}}))};return a.forEach(l),e.concat(i.map(l))}),[]);return a.u.$q.all(m)},e.prototype.injector=function(){return this._injector||(this._injector=new p(this))},e.prototype.findNode=function(e){return(0,o.sE)(this._path,(function(t){return(0,o.d3)(t.resolvables,e)}))},e.prototype.getDependencies=function(e){var t=this,n=this.findNode(e),r=(u.C.subPath(this._path,(function(e){return e===n}))||this._path).reduce((function(e,t){return e.concat(t.resolvables)}),[]).filter((function(t){return t!==e}));return e.deps.map((function(e){var n=r.filter((function(t){return t.token===e}));if(n.length)return(0,o.Gb)(n);var s=t.injector().getNative(e);if((0,l.wV)(s))throw new Error("Could not find Dependency Injection token: "+(0,m.Pz)(e));return new d.X(e,(function(){return s}),[],s)}))},e}(),p=function(){function e(e){this.context=e,this.native=this.get("Native Injector")||a.u.$injector}return e.prototype.get=function(e){var t=this.context.getResolvable(e);if(t){if("NOWAIT"===this.context.getPolicy(t).async)return t.get(this.context);if(!t.resolved)throw new Error("Resolvable async .get() not complete:"+(0,m.Pz)(t.token));return t.data}return this.getNative(e)},e.prototype.getAsync=function(e){var t=this.context.getResolvable(e);return t?t.get(this.context):a.u.$q.when(this.native.get(e))},e.prototype.getNative=function(e){return this.native&&this.native.get(e)},e}()},"./node_modules/@uirouter/core/lib-esm/router.js":(e,t,n)=>{"use strict";n.d(t,{a:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"),a=n("./node_modules/@uirouter/core/lib-esm/view/view.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),d=n("./node_modules/@uirouter/core/lib-esm/state/stateService.js"),u=n("./node_modules/@uirouter/core/lib-esm/globals.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),_=n("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),c=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),f=0,p=(0,h.HV)("LocationServices",["url","path","search","hash","onChange"]),M=(0,h.HV)("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),y=function(){function e(e,t){void 0===e&&(e=p),void 0===t&&(t=M),this.locationService=e,this.locationConfig=t,this.$id=f++,this._disposed=!1,this._disposables=[],this.trace=c.g4,this.viewService=new a.s(this),this.globals=new u.k,this.transitionService=new s.Z(this),this.urlMatcherFactory=new o.y(this),this.urlRouter=new r.g(this),this.urlService=new _.i(this),this.stateRegistry=new i.q(this),this.stateService=new d.b(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(e),this.disposable(t)}return e.prototype.disposable=function(e){this._disposables.push(e)},e.prototype.dispose=function(e){var t=this;e&&(0,l.mf)(e.dispose)?e.dispose(this):(this._disposed=!0,this._disposables.slice().forEach((function(e){try{"function"==typeof e.dispose&&e.dispose(t),(0,m.nA)(t._disposables,e)}catch(e){}})))},e.prototype.plugin=function(e,t){void 0===t&&(t={});var n=new e(this,t);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},e.prototype.getPlugin=function(e){return e?this._plugins[e]:(0,m.VO)(this._plugins)},e}()},"./node_modules/@uirouter/core/lib-esm/state/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>M});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js");function u(e){return e.name}function m(e){return e.self.$$state=function(){return e},e.self}function l(e){return e.parent&&e.parent.data&&(e.data=e.self.data=(0,o.ED)(e.parent.data,e.data)),e.data}var _=function(e,t){return function(n){var s=n.self;if(s&&s.url&&s.name&&s.name.match(/\.\*\*$/)){var a={};(0,o.JG)(s,a),a.url+="{remainder:any}",s=a}var i=n.parent,d=function(e){if(!(0,r.HD)(e))return!1;var t="^"===e.charAt(0);return{val:t?e.substring(1):e,root:t}}(s.url),u=d?e.compile(d.val,{state:s}):s.url;if(!u)return null;if(!e.isMatcher(u))throw new Error("Invalid url '"+u+"' in state '"+n+"'");return d&&d.root?u:(i&&i.navigable||t()).url.append(u)}},c=function(e){return function(t){return!e(t)&&t.url?t:t.parent?t.parent.navigable:null}};function h(e){return e.parent?e.parent.path.concat(e):[e]}function f(e){var t=e.parent?(0,o.l7)({},e.parent.includes):{};return t[e.name]=!0,t}function p(e){var t,n,u=function(e){return e.provide||e.token},m=(0,a.uj)([[(0,a.vg)("resolveFn"),function(e){return new i.X(u(e),e.resolveFn,e.deps,e.policy)}],[(0,a.vg)("useFactory"),function(e){return new i.X(u(e),e.useFactory,e.deps||e.dependencies,e.policy)}],[(0,a.vg)("useClass"),function(e){return new i.X(u(e),(function(){return new e.useClass}),[],e.policy)}],[(0,a.vg)("useValue"),function(e){return new i.X(u(e),(function(){return e.useValue}),[],e.policy,e.useValue)}],[(0,a.vg)("useExisting"),function(e){return new i.X(u(e),o.yR,[e.useExisting],e.policy)}]]),l=(0,a.uj)([[(0,a.zG)((0,a.vg)("val"),r.HD),function(e){return new i.X(e.token,o.yR,[e.val],e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.kJ),function(e){return new i.X(e.token,(0,o.Gb)(e.val),e.val.slice(0,-1),e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.mf),function(e){return new i.X(e.token,e.val,(t=e.val,n=d.u.$injector,t.$inject||n&&n.annotate(t,n.strictDi)||"deferred"),e.policy);var t,n}]]),_=(0,a.uj)([[(0,a.is)(i.X),function(e){return e}],[function(e){return!(!e.token||!e.resolveFn)},m],[function(e){return!(!e.provide&&!e.token||!(e.useValue||e.useFactory||e.useExisting||e.useClass))},m],[function(e){return!!(e&&e.val&&((0,r.HD)(e.val)||(0,r.kJ)(e.val)||(0,r.mf)(e.val)))},l],[(0,a.P0)(!0),function(e){throw new Error("Invalid resolve value: "+(0,s.Pz)(e))}]]),c=e.resolve;return((0,r.kJ)(c)?c:(t=c,n=e.resolvePolicy||{},Object.keys(t||{}).map((function(e){return{token:e,val:t[e],deps:void 0,policy:n[e]}})))).map(_)}var M=function(){function e(e,t){this.matcher=e;var n,r=this,s=function(){return e.find("")},i=function(e){return""===e.name};this.builders={name:[u],self:[m],parent:[function(t){return i(t)?null:e.find(r.parentName(t))||s()}],data:[l],url:[_(t,s)],navigable:[c(i)],params:[(n=t.paramFactory,function(e){var t=e.url&&e.url.parameters({inherit:!1})||[],r=(0,o.VO)((0,o.js)((0,o.CE)(e.params||{},t.map((0,a.vg)("id"))),(function(t,o){return n.fromConfig(o,null,e.self)})));return t.concat(r).map((function(e){return[e.id,e]})).reduce(o.bb,{})})],views:[],path:[h],includes:[f],resolvables:[p]}}return e.prototype.builder=function(e,t){var n=this.builders,o=n[e]||[];return(0,r.HD)(e)&&!(0,r.$K)(t)?o.length>1?o:o[0]:(0,r.HD)(e)&&(0,r.mf)(t)?(n[e]=o,n[e].push(t),function(){return n[e].splice(n[e].indexOf(t,1))&&null}):void 0},e.prototype.build=function(e){var t=this.matcher,n=this.builders,r=this.parentName(e);if(r&&!t.find(r,void 0,!1))return null;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s].reduce((function(e,t){return function(n){return t(n,e)}}),o.ZT);e[s]=a(e)}return e},e.prototype.parentName=function(e){var t=e.name||"",n=t.split(".");if("**"===n.pop()&&n.pop(),n.length){if(e.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+t+")");return n.join(".")}return e.parent?(0,r.HD)(e.parent)?e.parent:e.parent.name:""},e.prototype.name=function(e){var t=e.name;if(-1!==t.indexOf(".")||!e.parent)return t;var n=(0,r.HD)(e.parent)?e.parent:e.parent.name;return n?n+"."+t:t},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js":(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"),a=function(){function e(e){this._states=e}return e.prototype.isRelative=function(e){return 0===(e=e||"").indexOf(".")||0===e.indexOf("^")},e.prototype.find=function(e,t,n){if(void 0===n&&(n=!0),e||""===e){var a=(0,o.HD)(e),i=a?e:e.name;this.isRelative(i)&&(i=this.resolvePath(i,t));var d=this._states[i];if(d&&(a||!(a||d!==e&&d.self!==e)))return d;if(a&&n){var u=(0,r.VO)(this._states).filter((function(e){return e.__stateObjectCache.nameGlob&&e.__stateObjectCache.nameGlob.matches(i)}));return u.length>1&&s.L.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map((function(e){return e.name}))),u[0]}}},e.prototype.resolvePath=function(e,t){if(!t)throw new Error("No reference point given for path '"+e+"'");for(var n=this.find(t),o=e.split("."),r=o.length,s=0,a=n;s{"use strict";n.d(t,{l:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/glob.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=function(){function e(t){return e.create(t||{})}return e.create=function(t){t=e.isStateClass(t)?new t:t;var n=(0,o.ED)((0,o.ED)(t,e.prototype));return t.$$state=function(){return n},n.self=t,n.__stateObjectCache={nameGlob:s.r.fromString(n.name)},n},e.prototype.is=function(e){return this===e||this.self===e||this.fqn()===e},e.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var e=this.parent.fqn();return e?e+"."+this.name:this.name},e.prototype.root=function(){return this.parent&&this.parent.root()||this},e.prototype.parameters=function(e){return((e=(0,o.ce)(e,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat((0,o.VO)(this.params)).filter((function(t){return!e.matchingKeys||e.matchingKeys.hasOwnProperty(t.id)}))},e.prototype.parameter=function(e,t){return void 0===t&&(t={}),this.url&&this.url.parameter(e,t)||(0,o.sE)((0,o.VO)(this.params),(0,r.OH)("id",e))||t.inherit&&this.parent&&this.parent.parameter(e)},e.prototype.toString=function(){return this.fqn()},e.isStateClass=function(e){return(0,a.mf)(e)&&!0===e.__uiRouterState},e.isStateDeclaration=function(e){return(0,a.mf)(e.$$state)},e.isState=function(e){return(0,a.Kn)(e.__stateObjectCache)},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),s=function(){function e(e,t,n,o){this.router=e,this.states=t,this.builder=n,this.listeners=o,this.queue=[]}return e.prototype.dispose=function(){this.queue=[]},e.prototype.register=function(e){var t=this.queue,n=r.l.create(e),s=n.name;if(!(0,o.HD)(s))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(s)||(0,o.d3)(t.map((0,o.vg)("name")),s))throw new Error("State '"+s+"' is already defined");return t.push(n),this.flush(),n},e.prototype.flush=function(){for(var e=this,t=this,n=t.queue,o=t.states,r=t.builder,s=[],a=[],i={},d=function(t){return e.states.hasOwnProperty(t)&&e.states[t]},u=function(){s.length&&e.listeners.forEach((function(e){return e("registered",s.map((function(e){return e.self})))}))};n.length>0;){var m=n.shift(),l=m.name,_=r.build(m),c=a.indexOf(m);if(_){var h=d(l);if(h&&h.name===l)throw new Error("State '"+l+"' is already defined");var f=d(l+".**");f&&this.router.stateRegistry.deregister(f),o[l]=m,this.attachRoute(m),c>=0&&a.splice(c,1),s.push(m)}else{var p=i[l];if(i[l]=n.length,c>=0&&p===n.length)return n.push(m),u(),o;c<0&&a.push(m),n.push(m)}}return u(),o},e.prototype.attachRoute=function(e){if(!e.abstract&&e.url){var t=this.router.urlService.rules;t.rule(t.urlRuleFactory.create(e))}},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js":(e,t,n)=>{"use strict";n.d(t,{q:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=function(){function e(e){this.router=e,this.states={},this.listeners=[],this.matcher=new o.Q(this.states),this.builder=new r.t(this.matcher,e.urlMatcherFactory),this.stateQueue=new s.L(e,this.states,this.builder,this.listeners),this._registerRoot()}return e.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},e.prototype.dispose=function(){var e=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach((function(t){return e.get(t)&&e.deregister(t)}))},e.prototype.onStatesChanged=function(e){return this.listeners.push(e),function(){(0,a.nA)(this.listeners)(e)}.bind(this)},e.prototype.root=function(){return this._root},e.prototype.register=function(e){return this.stateQueue.register(e)},e.prototype._deregisterTree=function(e){var t=this,n=this.get().map((function(e){return e.$$state()})),o=function(e){var t=n.filter((function(t){return-1!==e.indexOf(t.parent)}));return 0===t.length?t:t.concat(o(t))},r=o([e]),s=[e].concat(r).reverse();return s.forEach((function(e){var n=t.router.urlService.rules;n.rules().filter((0,i.OH)("state",e)).forEach((function(e){return n.removeRule(e)})),delete t.states[e.name]})),s},e.prototype.deregister=function(e){var t=this.get(e);if(!t)throw new Error("Can't deregister state; not found: "+e);var n=this._deregisterTree(t.$$state());return this.listeners.forEach((function(e){return e("deregistered",n.map((function(e){return e.self})))})),n},e.prototype.get=function(e,t){var n=this;if(0===arguments.length)return Object.keys(this.states).map((function(e){return n.states[e].self}));var o=this.matcher.find(e,t);return o&&o.self||null},e.prototype.decorator=function(e,t){return this.builder.builder(e,t)},e}()},"./node_modules/@uirouter/core/lib-esm/state/targetState.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=function(){function e(e,t,n,o){this._stateRegistry=e,this._identifier=t,this._identifier=t,this._params=(0,s.l7)({},n||{}),this._options=(0,s.l7)({},o||{}),this._definition=e.matcher.find(t,this._options.relative)}return e.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},e.prototype.identifier=function(){return this._identifier},e.prototype.params=function(){return this._params},e.prototype.$state=function(){return this._definition},e.prototype.state=function(){return this._definition&&this._definition.self},e.prototype.options=function(){return this._options},e.prototype.exists=function(){return!(!this._definition||!this._definition.self)},e.prototype.valid=function(){return!this.error()},e.prototype.error=function(){var e=this.options().relative;if(!this._definition&&e){var t=e.name?e.name:e;return"Could not resolve '"+this.name()+"' from state '"+t+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},e.prototype.toString=function(){return"'"+this.name()+"'"+(0,r.Pz)(this.params())},e.prototype.withState=function(t){return new e(this._stateRegistry,t,this._params,this._options)},e.prototype.withParams=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._params,t);return new e(this._stateRegistry,this._identifier,o,this._options)},e.prototype.withOptions=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._options,t);return new e(this._stateRegistry,this._identifier,this._params,o)},e.isDef=function(e){return e&&e.state&&((0,o.HD)(e.state)||(0,o.Kn)(e.state)&&(0,o.HD)(e.state.name))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js":(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),a=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),i=function(){function e(e){this.transition=e}return e.prototype.buildHooksForPhase=function(e){var t=this;return this.transition.router.transitionService._pluginapi._getEvents(e).map((function(e){return t.buildHooks(e)})).reduce(o.M7,[]).filter(o.yR)},e.prototype.buildHooks=function(e){var t=this.transition,n=t.treeChanges(),r=this.getMatchingHooks(e,n,t);if(!r)return[];var i,d={transition:t,current:t.options().current};return r.map((function(r){return r.matches(n,t)[e.criteriaMatchPath.name].map((function(n){var i=(0,o.l7)({bind:r.bind,traceData:{hookType:e.name,context:n}},d),u=e.criteriaMatchPath.scope===s.c.STATE?n.state.self:null,m=new a.I(t,u,r,i);return{hook:r,node:n,transitionHook:m}}))})).reduce(o.M7,[]).sort((i=e.reverseSort,void 0===i&&(i=!1),function(e,t){var n=i?-1:1,o=(e.node.state.path.length-t.node.state.path.length)*n;return 0!==o?o:t.hook.priority-e.hook.priority})).map((function(e){return e.transitionHook}))},e.prototype.getMatchingHooks=function(e,t,n){var a=e.hookPhase===s.k.CREATE,i=this.transition.router.transitionService;return(a?[i]:[this.transition,i]).map((function(t){return t.getHooks(e.name)})).filter((0,o.sp)(r.kJ,"broken event named: "+e.name)).reduce(o.M7,[]).filter((function(e){return e.matches(t,n)}))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js":(e,t,n)=>{"use strict";n.d(t,{cN:()=>s,BU:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js");function s(e,t,n){var r=(0,o.HD)(t)?[t]:t;return!!((0,o.mf)(r)?r:function(e){for(var t=r,n=0;n{"use strict";var o,r;n.d(t,{k:()=>o,c:()=>r}),function(e){e[e.CREATE=0]="CREATE",e[e.BEFORE=1]="BEFORE",e[e.RUN=2]="RUN",e[e.SUCCESS=3]="SUCCESS",e[e.ERROR=4]="ERROR"}(o||(o={})),function(e){e[e.TRANSITION=0]="TRANSITION",e[e.STATE=1]="STATE"}(r||(r={}))},"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js":(e,t,n)=>{"use strict";n.d(t,{K:()=>o,i:()=>d});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");!function(e){e[e.SUPERSEDED=2]="SUPERSEDED",e[e.ABORTED=3]="ABORTED",e[e.INVALID=4]="INVALID",e[e.IGNORED=5]="IGNORED",e[e.ERROR=6]="ERROR"}(o||(o={}));var i=0,d=function(){function e(e,t,n){this.$id=i++,this.type=e,this.message=t,this.detail=n}return e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&(0,a.is)(e)(t._transitionRejection)},e.superseded=function(t,n){var r=new e(o.SUPERSEDED,"The transition has been superseded by a different transition",t);return n&&n.redirected&&(r.redirected=!0),r},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(t){return new e(o.INVALID,"This transition is invalid",t)},e.ignored=function(t){return new e(o.IGNORED,"The transition was ignored",t)},e.aborted=function(t){return new e(o.ABORTED,"The transition has been aborted",t)},e.errored=function(t){return new e(o.ERROR,"The transition errored",t)},e.normalize=function(t){return(0,a.is)(e)(t)?t:e.errored(t)},e.prototype.toString=function(){var e,t=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():(0,s.Pz)(e),n=this;return"Transition Rejection($id: "+n.$id+" type: "+n.type+", message: "+n.message+", detail: "+t+")"},e.prototype.toPromise=function(){return(0,r.l7)((0,r.jv)(this),{_transitionRejection:this})},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r=function(e,t,n,r,s,a,i,d){void 0===s&&(s=!1),void 0===a&&(a=o.I.HANDLE_RESULT),void 0===i&&(i=o.I.REJECT_ERROR),void 0===d&&(d=!1),this.name=e,this.hookPhase=t,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=s,this.getResultHandler=a,this.getErrorHandler=i,this.synchronous=d}},"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>c});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),u=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),m=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),l=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),_={current:r.ZT,transition:null,traceData:{},bind:null},c=function(){function e(e,t,n,s){var a=this;this.transition=e,this.stateContext=t,this.registeredHook=n,this.options=s,this.isSuperseded=function(){return a.type.hookPhase===o.k.RUN&&!a.options.transition.isActive()},this.options=(0,r.ce)(s,_),this.type=n.eventType}return e.chain=function(e,t){return e.reduce((function(e,t){return e.then((function(){return t.invokeHook()}))}),t||u.u.$q.when())},e.invokeHooks=function(t,n){for(var o=0;o=t.invokeLimit&&t.deregister()}}},e.prototype.handleHookResult=function(e){var t=this;return this.getNotCurrentRejection()||((0,a.tI)(e)?e.then((function(e){return t.handleHookResult(e)})):(d.g4.traceHookResult(e,this.transition,this.options),!1===e?m.i.aborted("Hook aborted transition").toPromise():(0,i.is)(l.F)(e)?m.i.redirected(e).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var e=this.transition.router;return e._disposed?m.i.aborted("UIRouter instance #"+e.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?m.i.aborted().toPromise():this.isSuperseded()?m.i.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var e=this.options,t=this.registeredHook,n=(0,i.Qc)("traceData.hookType")(e)||"internal",o=(0,i.Qc)("traceData.context.state.name")(e)||(0,i.Qc)("traceData.context")(e)||"unknown",r=(0,s.iC)(t.callback);return n+" context: "+o+", "+(0,s.BS)(200,r)},e.HANDLE_RESULT=function(e){return function(t){return e.handleHookResult(t)}},e.LOG_REJECTED_RESULT=function(e){return function(t){(0,a.tI)(t)&&t.catch((function(t){return e.logError(m.i.normalize(t))}))}},e.LOG_ERROR=function(e){return function(t){return e.logError(t)}},e.REJECT_ERROR=function(e){return function(e){return(0,r.jv)(e)}},e.THROW_ERROR=function(e){return function(e){throw e}},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js":(e,t,n)=>{"use strict";n.d(t,{Z:()=>C,q:()=>W});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),a=n("./node_modules/@uirouter/core/lib-esm/router.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/index.js");function u(e){e.addResolvable(i.XU.fromData(a.a,e.router),""),e.addResolvable(i.XU.fromData(r.u,e),""),e.addResolvable(i.XU.fromData("$transition$",e),""),e.addResolvable(i.XU.fromData("$stateParams",e.params()),""),e.entering().forEach((function(t){e.addResolvable(i.XU.fromData("$state$",t),t)}))}var m=["$transition$",r.u],l=(0,d.d3)(m),_=function(e){var t=(0,d.VO)(e.treeChanges()).reduce(d.M7,[]).reduce(d.v_,[]),n=function(e){return l(e.token)?i.XU.fromData(e.token,null):e};t.forEach((function(e){e.resolvables=e.resolvables.map(n)}))},c=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),f=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),p=function(e){var t=e.to().redirectTo;if(t){var n=e.router.stateService;return(0,c.mf)(t)?h.u.$q.when(t(e)).then(o):o(t)}function o(t){if(t)return t instanceof f.F?t:(0,c.HD)(t)?n.target(t,e.params(),e.options()):t.state||t.params?n.target(t.state||e.to(),t.params||e.params(),e.options()):void 0}};function M(e){return function(t,n){return(0,n.$$state()[e])(t,n)}}var y=M("onExit"),L=M("onRetain"),Y=M("onEnter"),g=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),v=n("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"),k=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),j=1e3,w=function(e){return new v.l(e.treeChanges().to).resolvePath("EAGER",e).then(g.ZT)},b=function(e,t){return new v.l(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY",e).then(g.ZT)},D=function(e){return new v.l(e.treeChanges().to).resolvePath("LAZY",e).then(g.ZT)},T=function(e){var t=h.u.$q,n=e.views("entering");if(n.length)return t.all(n.map((function(e){return t.when(e.load())}))).then(g.ZT)},S=function(e){var t=e.views("entering"),n=e.views("exiting");if(t.length||n.length){var o=e.router.viewService;n.forEach((function(e){return o.deactivateViewConfig(e)})),t.forEach((function(e){return o.activateViewConfig(e)})),o.sync()}},H=function(e){var t=e.router.globals,n=function(){t.transition===e&&(t.transition=null)};e.onSuccess({},(function(){t.successfulTransitions.enqueue(e),t.$current=e.$to(),t.current=t.$current.self,(0,g.JG)(e.params(),t.params)}),{priority:1e4}),e.promise.then(n,n)},x=function(e){var t=e.options(),n=e.router.stateService,o=e.router.urlRouter;if("url"!==t.source&&t.location&&n.$current.navigable){var r={replace:"replace"===t.location};o.push(n.$current.navigable.url,n.params,r)}o.update(!0)},E=n("./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"),P=n("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),O=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),$=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),A=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js");function F(e){var t=e._ignoredReason();if(t){$.g4.traceTransitionIgnored(e);var n=e.router.globals.transition;return"SameAsCurrent"===t&&n&&n.abort(),A.i.ignored().toPromise()}}function R(e){if(!e.valid())throw new Error(e.error().toString())}var W={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},C=function(){function e(e){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=e,this.$view=e.viewService,this._deregisterHookFns={},this._pluginapi=(0,g.WR)((0,k.P0)(this),{},(0,k.P0)(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),e.globals.successfulTransitions.onEvict(_)}return e.prototype.onCreate=function(e,t,n){},e.prototype.onBefore=function(e,t,n){},e.prototype.onStart=function(e,t,n){},e.prototype.onExit=function(e,t,n){},e.prototype.onRetain=function(e,t,n){},e.prototype.onEnter=function(e,t,n){},e.prototype.onFinish=function(e,t,n){},e.prototype.onSuccess=function(e,t,n){},e.prototype.onError=function(e,t,n){},e.prototype.dispose=function(e){(0,g.VO)(this._registeredHooks).forEach((function(e){return e.forEach((function(t){t._deregistered=!0,(0,g.nA)(e,t)}))}))},e.prototype.create=function(e,t){return new r.u(e,t,this._router)},e.prototype._defineCoreEvents=function(){var e=o.k,t=O.I,n=this._criteriaPaths,r=!1,s=!0;this._defineEvent("onCreate",e.CREATE,0,n.to,r,t.LOG_REJECTED_RESULT,t.THROW_ERROR,s),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s),this._defineEvent("onError",e.ERROR,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s)},e.prototype._defineCorePaths=function(){var e=o.c.STATE,t=o.c.TRANSITION;this._definePathType("to",t),this._definePathType("from",t),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(e,t,n,o,r,a,i,d){void 0===r&&(r=!1),void 0===a&&(a=O.I.HANDLE_RESULT),void 0===i&&(i=O.I.REJECT_ERROR),void 0===d&&(d=!1);var u=new P.t(e,t,n,o,r,a,i,d);this._eventTypes.push(u),(0,s.BU)(this,this,u)},e.prototype._getEvents=function(e){return((0,c.$K)(e)?this._eventTypes.filter((function(t){return t.hookPhase===e})):this._eventTypes.slice()).sort((function(e,t){var n=e.hookPhase-t.hookPhase;return 0===n?e.hookOrder-t.hookOrder:n}))},e.prototype._definePathType=function(e,t){this._criteriaPaths[e]={name:e,scope:t}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(e){return this._registeredHooks[e]},e.prototype._registerCoreTransitionHooks=function(){var e=this._deregisterHookFns;e.addCoreResolves=this.onCreate({},u),e.ignored=this.onBefore({},F,{priority:-9999}),e.invalid=function(e){return e.onBefore({},R,{priority:-1e4})}(this),e.redirectTo=function(e){return e.onStart({to:function(e){return!!e.redirectTo}},p)}(this),e.onExit=function(e){return e.onExit({exiting:function(e){return!!e.onExit}},y)}(this),e.onRetain=function(e){return e.onRetain({retained:function(e){return!!e.onRetain}},L)}(this),e.onEnter=function(e){return e.onEnter({entering:function(e){return!!e.onEnter}},Y)}(this),e.eagerResolve=function(e){return e.onStart({},w,{priority:j})}(this),e.lazyResolve=function(e){return e.onEnter({entering:(0,k.P0)(!0)},b,{priority:j})}(this),e.resolveAll=function(e){return e.onFinish({},D,{priority:j})}(this),e.loadViews=function(e){return e.onFinish({},T)}(this),e.activateViews=function(e){return e.onSuccess({},S)}(this),e.updateGlobals=function(e){return e.onCreate({},H)}(this),e.updateUrl=function(e){return e.onSuccess({},x,{priority:9999})}(this),e.lazyLoad=(0,E.v)(this)},e}()},"./node_modules/@uirouter/core/lib-esm/url/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=function(){function e(e){var t=this;this.router=e,this.paramTypes=new o.ParamTypes,this._decodeParams=!0,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return t.paramTypes.dispose()},this.baseHref=function(){return t.router.locationConfig.baseHref()},this.hashPrefix=function(e){return t.router.locationConfig.hashPrefix(e)},this.host=function(){return t.router.locationConfig.host()},this.html5Mode=function(){return t.router.locationConfig.html5Mode()},this.port=function(){return t.router.locationConfig.port()},this.protocol=function(){return t.router.locationConfig.protocol()}}return e.prototype.caseInsensitive=function(e){return this._isCaseInsensitive=(0,r.$K)(e)?e:this._isCaseInsensitive},e.prototype.defaultSquashPolicy=function(e){if((0,r.$K)(e)&&!0!==e&&!1!==e&&!(0,r.HD)(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=(0,r.$K)(e)?e:this._defaultSquashPolicy},e.prototype.strictMode=function(e){return this._isStrictMode=(0,r.$K)(e)?e:this._isStrictMode},e.prototype.type=function(e,t,n){var o=this.paramTypes.type(e,t,n);return(0,r.$K)(t)?this:o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js":(e,t,n)=>{"use strict";n.d(t,{y:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),a=function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n{"use strict";n.d(t,{g:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js"),s=function(){function e(e){var t=this;this.router=e,this.sync=function(e){return t.router.urlService.sync(e)},this.listen=function(e){return t.router.urlService.listen(e)},this.deferIntercept=function(e){return t.router.urlService.deferIntercept(e)},this.match=function(e){return t.router.urlService.match(e)},this.initial=function(e){return t.router.urlService.rules.initial(e)},this.otherwise=function(e){return t.router.urlService.rules.otherwise(e)},this.removeRule=function(e){return t.router.urlService.rules.removeRule(e)},this.rule=function(e){return t.router.urlService.rules.rule(e)},this.rules=function(){return t.router.urlService.rules.rules()},this.sort=function(e){return t.router.urlService.rules.sort(e)},this.when=function(e,n,o){return t.router.urlService.rules.when(e,n,o)},this.urlRuleFactory=new r.I(e)}return e.prototype.update=function(e){var t=this.router.locationService;e?this.location=t.url():t.url()!==this.location&&t.url(this.location,!0)},e.prototype.push=function(e,t,n){var o=n&&!!n.replace;this.router.urlService.url(e.format(t||{}),o)},e.prototype.href=function(e,t,n){var r=e.format(t);if(null==r)return null;n=n||{absolute:!1};var s=this.router.urlService.config,a=s.html5Mode();if(a||null===r||(r="#"+s.hashPrefix()+r),r=function(e,t,n,r){return"/"===r?e:t?(0,o.Lb)(r)+e:n?r.slice(1)+e:e}(r,a,n.absolute,s.baseHref()),!n.absolute||!r)return r;var i=!a&&r?"/":"",d=s.port(),u=80===d||443===d?"":":"+d;return[s.protocol(),"://",s.host(),u,i,r].join("")},Object.defineProperty(e.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!1,configurable:!0}),e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRule.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>d,n:()=>u});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),d=function(){function e(e){this.router=e}return e.prototype.compile=function(e){return this.router.urlMatcherFactory.compile(e)},e.prototype.create=function(e,t){var n=this,s=i.l.isState,d=i.l.isStateDeclaration,m=(0,a.uj)([[r.HD,function(e){return m(n.compile(e))}],[(0,a.is)(o.x),function(e){return n.fromUrlMatcher(e,t)}],[(0,a.or)(s,d),function(e){return n.fromState(e,n.router)}],[(0,a.is)(RegExp),function(e){return n.fromRegExp(e,t)}],[r.mf,function(e){return new u(e,t)}]]),l=m(e);if(!l)throw new Error("invalid 'what' in when()");return l},e.prototype.fromUrlMatcher=function(e,t){var n=t;(0,r.HD)(t)&&(t=this.router.urlMatcherFactory.compile(t)),(0,a.is)(o.x)(t)&&(n=function(e){return t.format(e)});var i={urlMatcher:e,matchPriority:function(t){var n=e.parameters().filter((function(e){return e.isOptional}));return n.length?n.filter((function(e){return t[e.id]})).length/n.length:1e-6},type:"URLMATCHER"};return(0,s.l7)(new u((function(t){var n=e.exec(t.path,t.search,t.hash);return e.validates(n)&&n}),n),i)},e.prototype.fromState=function(e,t){var n=i.l.isStateDeclaration(e)?e.$$state():e,o={state:n,type:"STATE"};return(0,s.l7)(this.fromUrlMatcher(n.url,(function(e){var o=t.stateService,r=t.globals;o.href(n,e)!==o.href(r.current,r.params)&&o.transitionTo(n,e,{inherit:!0,source:"url"})})),o)},e.prototype.fromRegExp=function(e,t){if(e.global||e.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=(0,r.HD)(t)?function(e){return t.replace(/\$(\$|\d{1,2})/,(function(t,n){return e["$"===n?0:Number(n)]}))}:t,o={regexp:e,type:"REGEXP"};return(0,s.l7)(new u((function(t){return e.exec(t.path)}),n),o)},e.isUrlRule=function(e){return e&&["type","match","handler"].every((function(t){return(0,r.$K)(e[t])}))},e}(),u=function(e,t){var n=this;this.match=e,this.type="RAW",this.matchPriority=function(e){return 0-n.$id},this.handler=t||s.yR}},"./node_modules/@uirouter/core/lib-esm/url/urlRules.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),i=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");function d(e){if(!((0,a.mf)(e)||(0,a.HD)(e)||(0,a.is)(r.TargetState)(e)||r.TargetState.isDef(e)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return(0,a.mf)(e)?e:(0,a.P0)(e)}o=function(e,t){var n=function(e,t){return(t.priority||0)-(e.priority||0)}(e,t);return 0!==n||0!==(n=function(e,t){var n={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(n[e.type]||0)-(n[t.type]||0)}(e,t))||0!==(n=function(e,t){return e.urlMatcher&&t.urlMatcher?s.x.compare(e.urlMatcher,t.urlMatcher):0}(e,t))?n:function(e,t){var n={STATE:!0,URLMATCHER:!0};return n[e.type]&&n[t.type]?0:(e.$id||0)-(t.$id||0)}(e,t)};var u=function(){function e(e){this.router=e,this._sortFn=o,this._rules=[],this._id=0,this.urlRuleFactory=new i.I(e)}return e.prototype.dispose=function(e){this._rules=[],delete this._otherwiseFn},e.prototype.initial=function(e){var t=d(e);this.rule(this.urlRuleFactory.create((function(e,t){return 0===t.globals.transitionHistory.size()&&!!/^\/?$/.exec(e.path)}),t))},e.prototype.otherwise=function(e){var t=d(e);this._otherwiseFn=this.urlRuleFactory.create((0,a.P0)(!0),t),this._sorted=!1},e.prototype.removeRule=function(e){(0,a.nA)(this._rules,e)},e.prototype.rule=function(e){var t=this;if(!i.I.isUrlRule(e))throw new Error("invalid rule");return e.$id=this._id++,e.priority=e.priority||0,this._rules.push(e),this._sorted=!1,function(){return t.removeRule(e)}},e.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},e.prototype.sort=function(e){for(var t=this.stableSort(this._rules,this._sortFn=e||this._sortFn),n=0,o=0;o{"use strict";n.d(t,{i:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"),a=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),i=function(){function e(e){var t=this;this.router=e,this.interceptDeferred=!1,this.rules=new r.h(this.router),this.config=new s.F(this.router),this.url=function(e,n,o){return t.router.locationService.url(e,n,o)},this.path=function(){return t.router.locationService.path()},this.search=function(){return t.router.locationService.search()},this.hash=function(){return t.router.locationService.hash()},this.onChange=function(e){return t.router.locationService.onChange(e)}}return e.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},e.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},e.prototype.sync=function(e){if(!e||!e.defaultPrevented){var t=this.router,n=t.urlService,r=t.stateService,s={path:n.path(),search:n.search(),hash:n.hash()},i=this.match(s);(0,o.uj)([[o.HD,function(e){return n.url(e,!0)}],[a.TargetState.isDef,function(e){return r.go(e.state,e.params,e.options)}],[(0,o.is)(a.TargetState),function(e){return r.go(e.state(),e.params(),e.options())}]])(i&&i.rule.handler(i.match,s,this.router))}},e.prototype.listen=function(e){var t=this;if(!1!==e)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange((function(e){return t.sync(e)}));this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},e.prototype.deferIntercept=function(e){void 0===e&&(e=!0),this.interceptDeferred=e},e.prototype.match=function(e){e=(0,o.l7)({path:"",search:{},hash:""},e);for(var t,n,r,s=this.rules.rules(),a=0;at.weight?i:t}return t},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/vanilla/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js":(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),s=function(){function e(e,t){var n=this;this.fireAfterUpdate=t,this._listeners=[],this._listener=function(e){return n._listeners.forEach((function(t){return t(e)}))},this.hash=function(){return(0,r.en)(n._get()).hash},this.path=function(){return(0,r.en)(n._get()).path},this.search=function(){return(0,r.Qf)((0,r.en)(n._get()).search)},this._location=o.Jz.location,this._history=o.Jz.history}return e.prototype.url=function(e,t){return void 0===t&&(t=!0),(0,o.$K)(e)&&e!==this._get()&&(this._set(null,null,e,t),this.fireAfterUpdate&&this._listeners.forEach((function(t){return t({url:e})}))),(0,r.Q2)(this)},e.prototype.onChange=function(e){var t=this;return this._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}},e.prototype.dispose=function(e){(0,o.Wk)(this._listeners)},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=function(){function e(e,t){void 0===t&&(t=!1),this._isHtml5=t,this._baseHref=void 0,this._hashPrefix=""}return e.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},e.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},e.prototype.host=function(){return location.hostname},e.prototype.html5Mode=function(){return this._isHtml5},e.prototype.hashPrefix=function(e){return(0,o.$K)(e)?this._hashPrefix=e:this._hashPrefix},e.prototype.baseHref=function(e){return(0,o.$K)(e)&&(this._baseHref=e),(0,o.o8)(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},e.prototype.getBaseHref=function(){var e=document.getElementsByTagName("base")[0];return e&&e.href?e.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):this._isHtml5?"/":location.pathname||"/"},e.prototype.dispose=function(){},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js":(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!1)||this;return r.Jz.addEventListener("hashchange",n._listener,!1),n}return a(t,e),t.prototype._get=function(){return(0,r.Ld)(this._location.hash)},t.prototype._set=function(e,t,n,o){this._location.hash=n},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),r.Jz.removeEventListener("hashchange",this._listener)},t}(s.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=function(){var e=this;this.dispose=r.ZT,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return e._port},this.protocol=function(){return e._protocol},this.host=function(){return e._host},this.baseHref=function(){return e._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(t){return(0,o.$K)(t)?e._hashPrefix=t:e._hashPrefix}}},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(t){return e.call(this,t,!0)||this}return s(t,e),t.prototype._get=function(){return this._url},t.prototype._set=function(e,t,n,o){this._url=n},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),a=n("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),i=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),d=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js");n("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),n("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),(0,s._D)("vanilla.hashBangLocation",!1,r.R,o.u),(0,s._D)("vanilla.pushStateLocation",!0,a.h,o.u),(0,s._D)("vanilla.memoryLocation",!1,i.I,d.W)},"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!0)||this;return n._config=t.urlService.config,s.Jz.addEventListener("popstate",n._listener,!1),n}return a(t,e),t.prototype._getBasePrefix=function(){return(0,s.Lb)(this._config.baseHref())},t.prototype._get=function(){var e=this._location,t=e.pathname,n=e.hash,o=e.search;o=(0,s.C7)(o)[1],n=(0,s.cW)(n)[1];var r=this._getBasePrefix(),a=t===this._config.baseHref(),i=t.substr(0,r.length)===r;return(t=a?"/":i?t.substring(r.length):t)+(o?"?"+o:"")+(n?"#"+n:"")},t.prototype._set=function(e,t,n,o){var r=this._getBasePrefix(),s=n&&"/"!==n[0]?"/":"",a=""===n||"/"===n?this._config.baseHref():r+s+n;o?this._history.replaceState(e,t,a):this._history.pushState(e,t,a)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),s.Jz.removeEventListener("popstate",this._listener)},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/q.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js":(e,t,n)=>{"use strict";n.d(t,{Qf:()=>s,en:()=>a,Q2:()=>i,_D:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=function(e,t){var n=t[0],r=t[1];return e.hasOwnProperty(n)?(0,o.kJ)(e[n])?e[n].push(r):e[n]=[e[n],r]:e[n]=r,e},s=function(e){return e.split("&").filter(o.yR).map(o.Fb).reduce(r,{})};function a(e){var t=function(e){return e||""},n=(0,o.cW)(e).map(t),r=n[0],s=n[1],a=(0,o.C7)(r).map(t);return{path:a[0],search:a[1],hash:s,url:e}}var i=function(e){var t=e.path(),n=e.search(),r=e.hash(),s=Object.keys(n).map((function(e){var t=n[e];return((0,o.kJ)(t)?t:[t]).map((function(t){return e+"="+t}))})).reduce(o.M7,[]).join("&");return t+(s?"?"+s:"")+(r?"#"+r:"")};function d(e,t,n,o){return function(r){var s=r.locationService=new n(r),a=r.locationConfig=new o(r,t);return{name:e,service:s,configuration:a,dispose:function(e){e.dispose(s),e.dispose(a)}}}}},"./node_modules/@uirouter/core/lib-esm/view/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/view/view.js":(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),i=function(){function e(e){var t=this;this.router=e,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(e){return(0,o.sE)(t._uiViews,(function(n){return t.router.$id+"."+n.id===e}))},_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs},_onSync:function(e){return t._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}}}}return e.normalizeUIViewTarget=function(e,t){void 0===t&&(t="");var n=t.split("@"),o=n[0]||"$default",r=(0,s.HD)(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(o);if(a&&(r=a[1],o=a[2]),"!"===o.charAt(0)&&(o=o.substr(1),r=""),/^(\^(?:\.\^)*)$/.exec(r)){var i=r.split(".").reduce((function(e,t){return e.parent}),e);r=i.name}else"."===r&&(r=e.name);return{uiViewName:o,uiViewContextAnchor:r}},e.prototype._rootViewContext=function(e){return this._rootContext=e||this._rootContext},e.prototype._viewConfigFactory=function(e,t){this._viewConfigFactories[e]=t},e.prototype.createViewConfig=function(e,t){var n=this._viewConfigFactories[t.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+t.$type);var o=n(e,t);return(0,s.kJ)(o)?o:[o]},e.prototype.deactivateViewConfig=function(e){a.g4.traceViewServiceEvent("<- Removing",e),(0,o.nA)(this._viewConfigs,e)},e.prototype.activateViewConfig=function(e){a.g4.traceViewServiceEvent("-> Registering",e),this._viewConfigs.push(e)},e.prototype.sync=function(){var t=this,n=this._uiViews.map((function(e){return[e.fqn,e]})).reduce(o.bb,{});function s(e){for(var t=e.viewDecl.$context,n=0;++n&&t.parent;)t=t.parent;return n}var i=(0,r.WA)((function(e,t,n,o){return t*(e(n)-e(o))})),d=this._uiViews.sort(i((function(e){var t=function(e){return e&&e.parent?t(e.parent)+1:1};return 1e4*e.fqn.split(".").length+t(e.creationContext)}),1)).map((function(o){var r=t._viewConfigs.filter(e.matches(n,o));return r.length>1&&r.sort(i(s,-1)),{uiView:o,viewConfig:r[0]}})),u=d.map((function(e){return e.viewConfig})),m=this._viewConfigs.filter((function(e){return!(0,o.d3)(u,e)})).map((function(e){return{uiView:void 0,viewConfig:e}}));d.forEach((function(e){-1!==t._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)}));var l=d.concat(m);this._listeners.forEach((function(e){return e(l)})),a.g4.traceViewSync(l)},e.prototype.registerUIView=function(e){a.g4.traceViewServiceUIViewEvent("-> Registering",e);var t=this._uiViews;return t.filter((function(t){return t.fqn===e.fqn&&t.$type===e.$type})).length&&a.g4.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",e),t.push(e),this.sync(),function(){-1!==t.indexOf(e)?(a.g4.traceViewServiceUIViewEvent("<- Deregistering",e),(0,o.nA)(t)(e)):a.g4.traceViewServiceUIViewEvent("Tried removing non-registered uiView",e)}},e.prototype.available=function(){return this._uiViews.map((0,r.vg)("fqn"))},e.prototype.active=function(){return this._uiViews.filter((0,r.vg)("$config")).map((0,r.vg)("name"))},e.matches=function(e,t){return function(n){if(t.$type!==n.viewDecl.$type)return!1;var r=n.viewDecl,s=r.$uiViewName.split("."),a=t.fqn.split(".");if(!(0,o.fS)(s,a.slice(0-s.length)))return!1;var i=1-s.length||void 0,d=a.slice(0,i).join("."),u=e[d].creationContext;return r.$uiViewContextAnchor===(u&&u.name)}},e}()},"./node_modules/angular-aria/angular-aria.js":()=>{!function(e,t){"use strict";var n="ngAriaDisable",o=t.module("ngAria",["ng"]).info({angularVersion:"1.8.2"}).provider("$aria",(function(){var e={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeydown:!0,bindRoleForClick:!0};function o(t,o,r,a){return function(i,d,u){if(!u.hasOwnProperty(n)){var m=u.$normalize(o);!e[m]||s(d,r)||u[m]||i.$watch(u[t],(function(e){e=a?!e:!!e,d.attr(o,e)}))}}}this.config=function(n){e=t.extend(e,n)},this.$get=function(){return{config:function(t){return e[t]},$$watchExpr:o}}})),r=["BUTTON","A","INPUT","TEXTAREA","SELECT","DETAILS","SUMMARY"],s=function(e,t){if(-1!==t.indexOf(e[0].nodeName))return!0};o.directive("ngShow",["$aria",function(e){return e.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(e){return e.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(e){return e.$$watchExpr("ngValue","aria-checked",r,!1)}]).directive("ngChecked",["$aria",function(e){return e.$$watchExpr("ngChecked","aria-checked",r,!1)}]).directive("ngReadonly",["$aria",function(e){return e.$$watchExpr("ngReadonly","aria-readonly",r,!1)}]).directive("ngRequired",["$aria",function(e){return e.$$watchExpr("ngRequired","aria-required",r,!1)}]).directive("ngModel",["$aria",function(e){function t(t,n,o,a){return e.config(n)&&!o.attr(t)&&(a||!s(o,r))&&("hidden"!==o.attr("type")||"INPUT"!==o[0].nodeName)}function o(e,t){return!t.attr("role")&&t.attr("type")===e&&!s(t,r)}return{restrict:"A",require:"ngModel",priority:200,compile:function(r,s){if(!s.hasOwnProperty(n)){var a=function(e,t){var n=e.type,o=e.role;return"checkbox"===(n||o)||"menuitemcheckbox"===o?"checkbox":"radio"===(n||o)||"menuitemradio"===o?"radio":"range"===n||"progressbar"===o||"slider"===o?"range":""}(s);return{post:function(n,r,s,i){var d=t("tabindex","tabindex",r,!1);function u(){return i.$modelValue}switch(a){case"radio":case"checkbox":o(a,r)&&r.attr("role",a),t("aria-checked","ariaChecked",r,!1)&&n.$watch(u,"radio"===a?function(e){var t=s.value==i.$viewValue;r.attr("aria-checked",t)}:function(){r.attr("aria-checked",!i.$isEmpty(i.$viewValue))}),d&&r.attr("tabindex",0);break;case"range":if(o(a,r)&&r.attr("role","slider"),e.config("ariaValue")){var m=!r.attr("aria-valuemin")&&(s.hasOwnProperty("min")||s.hasOwnProperty("ngMin")),l=!r.attr("aria-valuemax")&&(s.hasOwnProperty("max")||s.hasOwnProperty("ngMax")),_=!r.attr("aria-valuenow");m&&s.$observe("min",(function(e){r.attr("aria-valuemin",e)})),l&&s.$observe("max",(function(e){r.attr("aria-valuemax",e)})),_&&n.$watch(u,(function(e){r.attr("aria-valuenow",e)}))}d&&r.attr("tabindex",0)}!s.hasOwnProperty("ngRequired")&&i.$validators.required&&t("aria-required","ariaRequired",r,!1)&&s.$observe("required",(function(){r.attr("aria-required",!!s.required)})),t("aria-invalid","ariaInvalid",r,!0)&&n.$watch((function(){return i.$invalid}),(function(e){r.attr("aria-invalid",!!e)}))}}}}}}]).directive("ngDisabled",["$aria",function(e){return e.$$watchExpr("ngDisabled","aria-disabled",r,!1)}]).directive("ngMessages",(function(){return{restrict:"A",require:"?ngMessages",link:function(e,t,o,r){o.hasOwnProperty(n)||t.attr("aria-live")||t.attr("aria-live","assertive")}}})).directive("ngClick",["$aria","$parse",function(e,t){return{restrict:"A",compile:function(o,a){if(!a.hasOwnProperty(n)){var i=t(a.ngClick);return function(t,n,o){s(n,r)||(e.config("bindRoleForClick")&&!n.attr("role")&&n.attr("role","button"),e.config("tabindex")&&!n.attr("tabindex")&&n.attr("tabindex",0),!e.config("bindKeydown")||o.ngKeydown||o.ngKeypress||o.ngKeyup||n.on("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(-1!==r.indexOf(e.target.nodeName)||e.target.isContentEditable||e.preventDefault(),t.$apply((function(){i(t,{$event:e})})))})))}}}}}]).directive("ngDblclick",["$aria",function(e){return function(t,o,a){a.hasOwnProperty(n)||!e.config("tabindex")||o.attr("tabindex")||s(o,r)||o.attr("tabindex",0)}}])}(window,window.angular)},"./node_modules/angular-rateit/dist/ng-rateit.js":()=>{angular.module("ngRateIt",["ng"]).directive("ngRateIt",["$q",function(e){"use strict";return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"&?rated",reset:"&?reset",beforeRated:"&?beforeRated",beforeReset:"&?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:function(t,n,o){o.readOnly||(t.readOnly=function(){return!1}),o.resetable||(t.resetable=function(){return!0}),o.beforeRated||(t.beforeRated=function(){var t=e.defer();return t.resolve(),t.promise}),o.rated||(t.rated=function(){}),o.beforeReset||(t.beforeReset=function(){var t=e.defer();return t.resolve(),t.promise}),o.reset||(t.reset=function(){})},controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(e,t){"use strict";e.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,e.orgValue=angular.copy(e.ngModel),e.min=e.min||0,e.max=e.max||5,e.step=e.step||.5,e.pristine=e.orgValue===e.ngModel,e.starWidth=e.starWidth||16,e.starPartWidth=e.starWidth*e.step,e.starHeight=e.starHeight||16,e.canelWidth=e.canelWidth||e.starWidth,e.cancelHeight=e.cancelHeight||e.starHeight;var n=e.max-e.min,o=n/e.step,r=e.$watch("ngModel",(function(){e.pristine=e.orgValue===e.ngModel})),s=function(e){return(e+1)/o*n};e.getStartParts=function(){return new Array(o)},e.getStarOffset=function(t){var n=1/e.step;return-e.starWidth/n*(t%n)},e.isSelected=function(t){return s(t)<=e.ngModel-e.min},e.removeRating=function(){e.resetable()&&!e.readOnly()&&e.beforeReset({rating:e.ngModel}).then((function(){e.ngModel=e.min,e.reset({rating:e.ngModel})}))},e.setValue=function(n){if(!e.readOnly()){var o=angular.copy(e.min+s(n));e.beforeRated({rating:o}).then((function(){e.ngModel=o,t((function(){e.rated({rating:e.ngModel})}))}))}},e.$on("$destroy",(function(){r()}))}]).run(["$templateCache",function(e){"use strict";e.put("ngRateIt/ng-rate-it.html",'
')}])},"./src/js/index.module.js":(e,t,n)=>{"use strict";n("./node_modules/angular-animate/index.js"),n("./node_modules/angular-aria/index.js"),n("./node_modules/angular-messages/index.js"),n("./node_modules/angular-material/index.js"),n("./node_modules/angular-resource/index.js"),n("./node_modules/angular-sanitize/index.js"),n("./node_modules/ng-csv/build/ng-csv.min.js"),n("./node_modules/ng-embed/src/ng-embed.js"),n("./node_modules/@uirouter/angularjs/lib-esm/index.js"),n("./node_modules/angular-local-storage/index.js"),n("./node_modules/angular-rateit/dist/ng-rateit.js"),n("./node_modules/@flowjs/ng-flow/dist/ng-flow.js"),n("./node_modules/emojionearea/dist/emojionearea.js"),n("./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js");var o=n("./node_modules/moment/moment.js"),r=n.n(o),s=n("./node_modules/lodash.map/index.js"),a=n.n(s);function i(e,t,n,o,s,i,d,u,m){const l=this;function _(t,n,o){const r=i.get(t)||{};o?delete r[e.location]:r[e.location]=n,i.set(t,r)}function c(n){var o;e.layout.up=n,_(u,e.layout),o=n?"show":"hide",t.parent.postMessage({cmd:o},"*"),e.$$phase||e.$apply()}e.location=e.settings.location,l.$onInit=function(){e.status="init";const o=e.settings.color,r=e.settings.textColor,s=e.settings.textButtonColor,a=e.settings.color_button,d=e.settings.backgroundColor,l=Math.max(document.documentElement.clientHeight,window.innerHeight||0),_=document.documentElement.clientWidth;document.documentElement.style.setProperty("--xc-ws-div-color",o),document.documentElement.style.setProperty("--xc-ws-text-color",r),document.documentElement.style.setProperty("--xc-ws-text-button-color",s),document.documentElement.style.setProperty("--xc-ws-button-color",a),document.documentElement.style.setProperty("--xc-ws-background-color",d),document.documentElement.style.setProperty("--xc-ws-client-height",l),document.documentElement.style.setProperty("--xc-ws-client-width",_);let h=!1;const f=i.get(m)||{},p=i.get(u)||{};e.visitor=f[e.location]?f[e.location]:{},e.layout=p[e.location]?p[e.location]:{},e.visitor.interaction&&e.layout.up?h=!0:e.layout.up=!0,"bottom_right"===e.settings.alignment&&c(h),n.go(function(){const t=e.settings.online,n=!!(e.visitor&&e.visitor.interaction&&e.visitor.interaction.id),o=Number(e.settings.maxInteractions)&&Number(e.settings.openedInteractions)>=Number(e.settings.maxInteractions);return!!(n||!o&&t)}()?"app.online":"app.offline",null,{location:"replace"});let M="";M=e.settings.online||!e.settings.hideWhenOffline?"init":"offline",t.parent.postMessage({cmd:M,div_color:o,text_color:r,client_height:l,client_width:_},"*");const y=document.createElement("style");document.head.appendChild(y),y.sheet.insertRule(".mdi-send:before {color:"+e.settings.color+"!important}")},l.close=function(){const t=e.visitor.interaction;if(t&&t.id){const s=o.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(e.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");o.show(s).then((function(){return d.chatInteraction.customUpdate({id:t.id,closed:!0,closeReason:"contact",closedAt:r()().format("YYYY-MM-DD HH:mm:ss")}).$promise})).then((function(){n.go("app.closing",null,{location:"replace"})})).catch((function(e){console.error("keep open",e)}))}},l.toggle=c,l.download=function(){const t=s.defer(),n=e.visitor.interaction;return n&&n.id&&d.chatInteraction.getMessages({intid:n.id,includeAll:!0}).$promise.then((function(n){t.resolve(a()(n.rows.slice(1),(function(t){let n;if("in"===t.direction&&(n=e.settings.customerAlias||e.visitor.from||"Visitor"+t.ContactId),"out"===t.direction)switch(e.settings.agentIdentifier){case"website_alias":n=t.UserId?e.settings.agentAlias+t.UserId:"System";break;case"agent_alias":n=t.UserId?t.User.alias||t.User.fullname:"System";break;case"agent_fullname":n=t.UserId?t.User.fullname:"System";break;default:n=t.UserId?e.settings.agentAlias+t.UserId:"System"}return{sender:n,message:t.body,createdAt:r()(t.createdAt).format("MM/DD/YYYY HH:mm:ss")}})))})).catch((function(e){console.error(e)})),t.promise},l.getHeaderShape=function(){return"rounded"===e.settings.header_shape?"15px":"0px"};const h={online:["online","chat","waiting","closing","unmanaged"],offline:["offline"]};Object.defineProperty(e,"actualTitle",{get(){let t=e.settings.defaultTitle;return h.online.includes(e.status)?t=e.settings.header_online:h.offline.includes(e.status)&&(t=e.settings.header_offline),t}}),e.updateStorage=_,window.addEventListener("message",(function(e){"show"===e.data.evt?c(!0):"hide"===e.data.evt&&c(!1)}),!1)}i.$inject=["$rootScope","$window","$state","$mdDialog","$q","localStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR"];var d=n("./node_modules/lodash.forin/index.js"),u=n.n(d),m=n("./node_modules/lodash.isnil/index.js"),l=n.n(m),_=n("./src/js/chat/index.tpl.html"),c=n("./src/js/closing/index.tpl.html"),h=n("./src/js/offline/index.tpl.html"),f=n("./src/js/online/index.tpl.html"),p=n("./src/js/unmanaged/index.tpl.html"),M=n("./src/js/waiting/index.tpl.html");function y(e,t){const n=t.search();e.settings={cursor:"pointer",hide:!0},u()(n,(function(t,n){""===t||l()(t)||("true"===t&&(t=!0),"false"===t&&(t=!1),e.settings[n]=t)}))}function L(e,t,n,o,r,s){n.html5Mode(!0),o.defaults.headers.get||(o.defaults.headers.get={}),o.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",o.defaults.headers.get["Cache-Control"]="no-cache",o.defaults.headers.get.Pragma="no-cache",r.setPrefix(s),e.state("app",{abstract:!0}).state("app.waiting",{url:"/waiting",templateUrl:M,controller:"WaitingController as vm"}).state("app.online",{url:"/online",templateUrl:f,controller:"OnlineController as vm"}).state("app.offline",{url:"/offline",templateUrl:h,controller:"OfflineController as vm"}).state("app.chat",{url:"/chat",templateUrl:_,controller:"ChatController as vm"}).state("app.unmanaged",{url:"/unmanaged",templateUrl:p,controller:"UnmanagedController as vm"}).state("app.closing",{url:"/closing",templateUrl:c,controller:"ClosingController as vm"})}L.$inject=["$stateProvider","$urlRouterProvider","$locationProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX"],y.$inject=["$rootScope","$location"];var Y=n("./node_modules/lodash.merge/index.js"),g=n.n(Y);function v(e,t,n,o,r,s){const a=this;function i(t){return function(o){a.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").position("top");n.show(r)}}function d(){e.loading=!1}function u(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function m(){a.form={},a.upColor=null,a.downColor=null,a.userForm.$setPristine(),a.userForm.$setUntouched(),delete e.visitor.interaction,e.enableDownload=!1}a.$onInit=function(){e.status="closing",e.updateStorage(r,null,!0),e.updateStorage(s,null,!0),e.loading=!1},a.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.close(g()({id:e.visitor.interaction.id,ratingType:e.settings.ratingType,customer:e.settings.customerAlias||e.visitor.from},a.form)).$promise.then((function(){delete a.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(m).then(u).catch(i("submit")).finally(d):(d(),i("submit"))},a.skip=function(){m(),u()},a.form={},a.errors={}}function k(e,t){const n={id:"@id",token:e.settings.token},o={};return o.baseUrl=e.settings.remote+"/api/",o.chatWebsite=t(o.baseUrl+"chat/websites/:id",n,{notify:{method:"POST",url:o.baseUrl+"chat/websites/:id/notify"},offline:{method:"POST",url:o.baseUrl+"chat/websites/:id/offline"},getFields:{method:"GET",url:o.baseUrl+"chat/websites/:id/fields"}}),o.chatInteraction=t(o.baseUrl+"chat/interactions/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/interactions/:id"},customUpdate:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/custom_update"},close:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/close"},getMessages:{method:"GET",url:o.baseUrl+"chat/interactions/:intid/my_messages"},uploadAttachment:{method:"POST",url:o.baseUrl+"chat/interactions/:id/attachment_upload",headers:{"Content-Type":void 0},transformRequest:angular.identity},downloadAttachment:{method:"GET",url:o.baseUrl+"chat/interactions/:id/attachment_download"}}),o.chatMessage=t(o.baseUrl+"chat/messages/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/messages/:id"}}),o}v.$inject=["$rootScope","$state","$mdToast","api","STORAGE_VISITOR","STORAGE_LAYOUT"],k.$inject=["$rootScope","$resource"];var j=n("./node_modules/lodash.find/index.js"),w=n.n(j),b=n("./node_modules/lodash.values/index.js"),D=n.n(b),T=n("./node_modules/jquery/dist/jquery.js");function S(e,t,n,o,r,s,a,i,d,u){const m=this;let _,c,h,f;function p(){n((function(){const e=r[0].getElementsByClassName("chat-messages")[0];e&&(e.scrollTop=e.scrollHeight)}))}function M(e){return function(t){m.errors[e]=t.data,p()}}function y(e){i.chatWebsite.notify(e).$promise.then((function(e){delete m.errors.chatMessageError,l()(t.visitor.interaction)&&(t.visitor.interaction={id:e.interaction.id},t.updateStorage(d,t.visitor)),_[0].emojioneArea.setText(""),p()})).catch(M("chatMessageError"))}function L(){t.settings.online?s.go("app.online",null,{location:"replace"}):s.go("app.offline",null,{location:"replace"})}function Y(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&i.chatInteraction.get({id:t.visitor.interaction.id}).$promise.then((function(e){delete m.errors.getInteraction,e.closed&&(t.visitor.interaction.closed=!0,t.updateStorage(d,t.visitor),"unmanaged"===e.disposition?s.go("app.unmanaged",null,{location:"replace"}):s.go("app.closing",null,{location:"replace"}))})).catch((function(e){switch(e.status){case 403:s.go("app.closing",null,{location:"replace"});break;case 404:t.updateStorage(d,null,!0),t.updateStorage(u,null,!0),L();break;case 405:s.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function v(e){const n=_[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==n&&y(g()({body:n},t.visitor))}function k(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&i.chatInteraction.getMessages({intid:t.visitor.interaction.id,includeAgent:!0,id:f||void 0}).$promise.then((function(e){if(delete m.errors.interaction,e.count){let o=!1,r=0;for(r=0,o=!1;r'+e.name+"",AttachmentId:e.id},t.visitor))):M("sendAttachment")}),M("sendAttachment"))},e.$on("$destroy",(function(){o.cancel(c),o.cancel(h),c=null,h=null})),t.$on("$download",(function(e,n){n&&n(D()(t.messages))}))}S.$inject=["$scope","$rootScope","$timeout","$interval","$document","$state","$http","api","STORAGE_VISITOR","STORAGE_LAYOUT"];var H=n("./node_modules/lodash.random/index.js"),x=n.n(H),E=n("./node_modules/lodash.clonedeep/index.js"),P=n.n(E),O=n("./node_modules/json-form-data/src/jsonToFormData.js"),$=n.n(O);function A(e,t,n,o,r,s,a){const i=this;let d=null,u=null;t.typeField="";const m={showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}};function _(){delete i.errors.submit,t.$emit("hide"),i.fields=P()(u),i.form={},i.userForm.$setPristine(),i.userForm.$setUntouched();const e=r.simple().textContent(t.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.initUploadButton=function(t){const n=i.fields[t],o=s.find(".upload-item");if(o.length){const t=angular.element(o[0].querySelector(".upload-button")),r=angular.element(o[0].querySelector("input[type=file]")),s=t.find("label");s.length&&s.css("display","none"),t.on("click",(()=>{s.css("display","none"),"function"==typeof r.trigger?r.trigger("click"):r[0].click()})),r.on("change",(t=>{e.$apply((function(){"string"==typeof n.props.error&&(n.props.error=null);const e=Array.from(t.target.files),o=1048576*n.config.size;e.some((e=>e.size>=o))?(n.options=[],n.props.error=n.config.sizeErrMessage):n.options=e.map((e=>{const{name:t,size:n,type:o}=e;return{name:t,size:n,type:o,file:e}})),i.form[n.props.title]=n.options}))}))}},i.removeFileItem=function(e,t){e.options.splice(t,1),i.form[e.props.title]=e.options},i.setupFileInput=function(e){console.log("form item setup",e);const t=s.find(".upload-item"),n=angular.element(t[0].querySelector("input[type=file]")),{multipleUpload:o,accept:r}=e.config;o&&n.attr("multiple","multiple"),r&&n[0].setAttribute("accept",r)},i.makeFileOptionsVisible=function(){const e=Array.from(s.find(".filename-label")),t=e[e.length-1];t&&t.scrollIntoView&&t.scrollIntoView()},i.$onInit=function(){t.status="offline",i.visitor={id:t.settings.id,mapKeyOffline:"firstName",from:"Anonymous"+x()(1,1e6)},t.settings.showMenu=!1,t.loading=!1,o.chatWebsite.getFields({id:t.settings.id,online:!1}).$promise.then((function(e){e.count&&(d=e.fromKey,u=P()(e.rows),i.fields=P()(u))})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=t(n.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){t.loading=!0;const e={...i.form};for(let n=0;ne.file))))}const n=Array.isArray(i.fields)?i.fields.filter((e=>"upload"===e.type)):[],s=g()({body:e},i.visitor),u=null!=e&&n.length>0,c=null!==e&&"{}"!==JSON.stringify(e);var h,f;(u?(h=s,a({url:`${o.baseUrl}chat/websites/${h.id}/offline`,headers:{"Content-Type":void 0},data:$()(h,{...m,initialFormData:new FormData}),method:"POST"})):c?o.chatWebsite.offline(s).$promise:Promise.reject("INVALID_FORM")).then(_).catch((f="submit",function(e){const n=r.simple().textContent(t.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n),i.errors[f]=e.data})).finally((()=>{i.form.invalid||(i.form={}),t.loading=!1}))},i.toggle=function(e,t){i.form[e]||(i.form[e]=[]);const n=i.form[e].indexOf(t);n>-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1},i.checkHTML=[],i.form={},i.errors={},i.userForm={}}function F(e,t,n,o,s,a){const i=this;let d=null;function u(){return"Anonymous"+x()(1,1e6)}i.checkHTML=[],i.form={},i.errors={},i.userForm={},i.disableItem=!1,i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.$onInit=function(){if(e.status="online",e.visitor&&e.visitor.interaction)if(e.visitor.interaction.id)if(e.visitor.interaction.UserId)t.go("app.chat",null,{location:"replace"});else{const t=e.visitor.interaction.id,n=JSON.stringify({channel:"chat",interaction:{id:t},message:{id:e.visitor.message.id},disposition:"abandoned",closed:!0,closeReason:"contact",closedAt:r()().format("YYYY-MM-DD HH:mm:ss")});o({url:`${e.settings.remote}/api/chat/interactions/${t}/abandon?token=${e.settings.token}`,headers:{"Content-Type":"application/json; charset=utf-8"},data:n,method:"PUT"}),e.visitor={id:e.settings.id,mapKey:"firstName",from:u()},e.settings.showMenu=!1,e.updateStorage(a,e.visitor),s.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(d=e.fromKey,i.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))}else t.go("app.waiting",null,{location:"replace"});else e.visitor={id:e.settings.id,mapKey:"firstName",from:u()},e.settings.showMenu=!1,e.updateStorage(a,e.visitor),s.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(d=e.fromKey,i.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){let n="New chat request \n";for(let t=0;t-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1}}function R(e,t,n,o,r,s){const a=this;function i(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function d(){a.form={},a.upColor=null,a.downColor=null,a.userForm.$setPristine(),a.userForm.$setUntouched(),e.visitor={},e.enableDownload=!1,e.$emit("hide")}function u(t){return function(o){a.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(r)}}function m(){e.loading=!1}a.form={},a.errors={},a.$onInit=function(){e.status="unmanaged",e.updateStorage(r,null,!0),e.updateStorage(s,null,!0),e.loading=!1},a.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.customUpdate({id:e.visitor.interaction.id,note:a.form.note}).$promise.then((function(){delete a.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(d).then(i).catch(u("submit")).finally(m):(m(),u("submit"))},a.skip=function(){d(),i()}}function W(e,t,n,o,s,a,i,d){let u,m=!1;function l(){let t={},n=!1;a.chatInteraction.get({id:e.visitor.interaction.id}).$promise.then((function(n){return t=n,a.chatInteraction.getMessages({intid:e.visitor.interaction.id}).$promise})).then((function(r){n=r.rows.length>1,t.closed?(e.visitor.interaction.closed=!0,e.updateStorage(i,e.visitor),"unmanaged"===t.disposition&&o.go("app.unmanaged",null,{location:"replace"})):t.UserId?(e.visitor.interaction.UserId=t.UserId,e.updateStorage(i,e.visitor),o.go("app.chat",null,{location:"replace"})):n&&o.go("app.chat",null,{location:"replace"})})).catch((function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function _(){if(e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&!m){m=!0;const t=new XMLHttpRequest;t.open("PUT",e.settings.remote+"/api/chat/interactions/"+e.visitor.interaction.id+"/abandon?token="+e.settings.token,!1),t.setRequestHeader("Content-type","application/json; charset=utf-8"),t.send(JSON.stringify({channel:"chat",interaction:{id:e.visitor.interaction.id},message:{id:e.visitor.message.id},disposition:"abandoned",closed:!0,closeReason:"contact",closedAt:r()().format("YYYY-MM-DD HH:mm:ss")})),4===t.readyState&&200===t.status&&(e.updateStorage(i,null,!0),e.updateStorage(d,null,!0))}}this.$onInit=function(){e.status="waiting",e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&(u=n(l,3e3))},t.$on("$destroy",(function(){s.removeEventListener("beforeunload",_),s.removeEventListener("unload",_),n.cancel(u)})),s.addEventListener("beforeunload",_),s.addEventListener("unload",_)}function C(e){return function(t){return e.trustAsHtml(t)}}A.$inject=["$scope","$rootScope","$sce","api","$mdToast","$element","$http"],F.$inject=["$rootScope","$state","$sce","$http","api","STORAGE_VISITOR"],R.$inject=["$rootScope","$state","$mdToast","api","STORAGE_VISITOR","STORAGE_LAYOUT"],W.$inject=["$rootScope","$scope","$interval","$state","$window","api","STORAGE_VISITOR","STORAGE_LAYOUT"],C.$inject=["$sce"],angular.module("motion-chat",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).filter("toTrusted",C).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").directive("ngEnter",(function(){return function(e,t,n){t.bind("keydown keypress",(function(t){13===t.which&&(e.$apply((function(){e.$eval(n.ngEnter)})),t.preventDefault())}))}})).directive("ngPrint",(function(){return{link:function(e,t){t.on("click",(function(){document.getElementById("chatContent1")&&function(e,t){const n=document.createElement("div"),o=t.visitor,s=t.settings;let a;for(let e=0;e"+document.title+""),i.document.write(""),i.document.write("

Website: "+s.referer+"

"),i.document.write("

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

"),i.document.write("

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

"),i.document.write(n.innerHTML),i.document.write(""),i.document.close(),i.focus(),i.print(),i.close()}(0,e)}))},restrict:"A"}})).controller("ChatController",S).controller("ClosingController",v).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("IndexController",i).factory("api",k).config(L).run(y).controller("OfflineController",A).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("OnlineController",F).controller("UnmanagedController",R).controller("WaitingController",W)},"./node_modules/expose-loader/dist/runtime/getGlobalThis.js":(e,t,n)=>{"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},"./node_modules/json-form-data/src/jsonToFormData.js":function(e,t){var n,o;(o=this)||(o={}),void 0===(n=function(){return o.jsonToFormData=function(){function e(e){return"[object Array]"==={}.toString.call(e)}function t(t){return!(e(t)||"object"!=typeof t||!t||t instanceof Blob||t instanceof Date)}function n(){return"function"==typeof FormData}function o(){if(n())return new FormData}function r(n,o,s,a){var i=0;for(var d in n){if(n.hasOwnProperty(d)){var u=a||d,m=o.mapping(n[d]);if(a&&t(n)&&(u=a+"["+d+"]"),a&&e(n)&&(u=e(m)||o.showLeafArrayIndexes?a+"["+i+"]":a+"[]"),e(m)||t(m))r(m,o,s,u);else if(m instanceof FileList)for(var l=0;l=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-dz.js":function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(o,r,s,a){var i=t(o),d=n[e][t(o)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,o)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-kw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ly.js":function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,s,a){var i=n(t),d=o[e][n(t)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ma.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-sa.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-tn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,n,s,a){var i=o(t),d=r[e][o(t)];return 2===i&&(d=d[n?0:1]),d.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/az.js":function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/be.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn-bd.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bo.js":function(e,t,n){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/br.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bs.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cs.js":function(e,t,n){!function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),o=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function a(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"pár sekund":"pár sekundami";case"ss":return t||o?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":o?"minutu":"minutou";case"mm":return t||o?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||o?"den":"dnem";case"dd":return t||o?r+(s(e)?"dny":"dní"):r+"dny";case"M":return t||o?"měsíc":"měsícem";case"MM":return t||o?r+(s(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||o?"rok":"rokem";case"yy":return t||o?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cy.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/da.js":function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-at.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-ch.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/dv.js":function(e,t,n){!function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/el.js":function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,o=this._calendarEl[e],r=t&&t.hours();return n=o,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(o=o.apply(t)),o.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-au.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-gb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ie.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-il.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-in.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-nz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-sg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-do.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-mx.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-us.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/et.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:o?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eu.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fa.js":function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fi.js":function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function o(e,o,r,s){var a="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":a=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":a=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":a=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":a=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":a=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":a=s?"vuoden":"vuotta"}return function(e,o){return e<10?o?n[e]:t[e]:e}(e,s)+" "+a}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fil.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr.js":function(e,t,n){!function(e){"use strict";var t=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,monthsShortStrictRegex:/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fy.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ga.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gd.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gl.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-deva.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){switch(t){case"D":return e+"वेर";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-latn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gu.js":function(e,t,n){!function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/he.js":function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hi.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hr.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hu.js":function(e,t,n){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,o){var r=e;switch(n){case"s":return o||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(o||t)?" másodperc":" másodperce";case"m":return"egy"+(o||t?" perc":" perce");case"mm":return r+(o||t?" perc":" perce");case"h":return"egy"+(o||t?" óra":" órája");case"hh":return r+(o||t?" óra":" órája");case"d":return"egy"+(o||t?" nap":" napja");case"dd":return r+(o||t?" nap":" napja");case"M":return"egy"+(o||t?" hónap":" hónapja");case"MM":return r+(o||t?" hónap":" hónapja");case"y":return"egy"+(o||t?" év":" éve");case"yy":return r+(o||t?" év":" éve")}return""}function o(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return o.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return o.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hy-am.js":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/id.js":function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/is.js":function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,o,r){var s=e+" ";switch(o){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(n||r?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?s+(n||r?"mínútur":"mínútum"):n?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"dögum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?n?s+"mánuðir":s+(r?"mánuði":"mánuðum"):n?s+"mánuður":s+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return t(e)?s+(n||r?"ár":"árum"):s+(n||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ja.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/jv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ka.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kk.js":function(e,t,n){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/km.js":function(e,t,n){!function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kn.js":function(e,t,n){!function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ko.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ku.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ky.js":function(e,t,n){!function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lb.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lt.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,o){return t?r(n)[0]:o?r(n)[1]:r(n)[2]}function o(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,a){var i=e+" ";return 1===e?i+n(0,t,s[0],a):t?i+(o(e)?r(s)[1]:r(s)[0]):a?i+r(s)[1]:i+(o(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,n,o){return t?"kelios sekundės":o?"kelių sekundžių":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lv.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function o(e,o,r){return e+" "+n(t[r],e,o)}function r(e,o,r){return n(t[r],e,o)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/me.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ml.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mr.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function o(e,t,n,o){var r="";if(t)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms-my.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/my.js":function(e,t,n){!function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ne.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl-be.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/oc-lnc.js":function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pa-in.js":function(e,t,n){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pl.js":function(e,t,n){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),o=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var o=e+" ";switch(n){case"ss":return o+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return o+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return o+(r(e)?"godziny":"godzin");case"ww":return o+(r(e)?"tygodnie":"tygodni");case"MM":return o+(r(e)?"miesiące":"miesięcy");case"yy":return o+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,o){return e?/D MMMM/.test(o)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:s,M:"miesiąc",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt-br.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ro.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=" ";return(e%100>=20||e>=100&&e%100==0)&&(o=" de "),e+o+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ru.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"минута":"минуту":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,w:"неделя",ww:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sd.js":function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/se.js":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/si.js":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sk.js":function(e,t,n){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function o(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?s+(o(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?s+(o(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(o(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?s+(o(e)?"dni":"dní"):s+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(o(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(o(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||o?"sekundi":"sekundah":e<5?t||o?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||o?"minuti":"minutama":e<5?t||o?"minute":"minutami":t||o?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||o?"uri":"urama":e<5?t||o?"ure":"urami":t||o?"ur":"urami");case"d":return t||o?"en dan":"enim dnem";case"dd":return r+(1===e?t||o?"dan":"dnem":2===e?t||o?"dni":"dnevoma":t||o?"dni":"dnevi");case"M":return t||o?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||o?"mesec":"mesecem":2===e?t||o?"meseca":"mesecema":e<5?t||o?"mesece":"meseci":t||o?"mesecev":"meseci");case"y":return t||o?"eno leto":"enim letom";case"yy":return r+(1===e?t||o?"leto":"letom":2===e?t||o?"leti":"letoma":e<5?t||o?"leta":"leti":t||o?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sq.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr-cyrl.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ss.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ta.js":function(e,t,n){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/te.js":function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tet.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tg.js":function(e,t,n){!function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/th.js":function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tk.js":function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tl-ph.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tlh.js":function(e,t,n){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,o,r){var s=function(e){var n=Math.floor(e%1e3/100),o=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),o>0&&(s+=(""!==s?" ":"")+t[o]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(o){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tr.js":function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"öö":"ÖÖ":n?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return o||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ug-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"يېرىم كېچە":o<900?"سەھەر":o<1130?"چۈشتىن بۇرۇن":o<1230?"چۈش":o<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uk.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(o=+e,r={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ur.js":function(e,t,n){!function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/vi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/x-pseudo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/yo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-hk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1200?"上午":1200===o?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-mo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-tw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(e,t,n)=>{var o={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=s,e.exports=r,r.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"./node_modules/ng-csv/build/ng-csv.min.js":(e,t)=>{var n;n=window,document,angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function(e){angular.isDefined(e.urlSanitizationWhitelist)?e.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),e.exports===t&&(e.exports="ngCsv"),angular.module("ngCsv.services").service("CSV",["$q",function(e){var t="\r\n",n={"\\t":"\t","\\b":"\b","\\v":"\v","\\f":"\f","\\r":"\r"};this.stringifyField=function(e,t){return"locale"===t.decimalSep&&this.isFloat(e)?e.toLocaleString():"."!==t.decimalSep&&this.isFloat(e)?e.toString().replace(".",t.decimalSep):"string"==typeof e?(e=e.replace(/"/g,'""'),(t.quoteStrings||e.indexOf(",")>-1||e.indexOf("\n")>-1||e.indexOf("\r")>-1)&&(e=t.txtDelim+e+t.txtDelim),e):"boolean"==typeof e?e?"TRUE":"FALSE":e},this.isFloat=function(e){return+e===e&&(!isFinite(e)||Boolean(e%1))},this.stringify=function(n,o){var r=e.defer(),s=this,a="",i="",d=e.when(n).then((function(e){var n,d;angular.isDefined(o.header)&&o.header&&(n=[],angular.forEach(o.header,(function(e){this.push(s.stringifyField(e,o))}),n),d=n.join(o.fieldSep?o.fieldSep:","),i+=d+t);var u,m,l=[];angular.isArray(e)?l=e:angular.isFunction(e)&&(l=e()),angular.isDefined(o.label)&&o.label&&"boolean"==typeof o.label&&(u=[],angular.forEach(l[0],(function(e,t){this.push(s.stringifyField(t,o))}),u),m=u.join(o.fieldSep?o.fieldSep:","),i+=m+t),angular.forEach(l,(function(e,n){var r,a,d=angular.copy(l[n]);a=[];var u=o.columnOrder?o.columnOrder:d;angular.forEach(u,(function(e){var t=o.columnOrder?d[e]:e;this.push(s.stringifyField(t,o))}),a),r=a.join(o.fieldSep?o.fieldSep:","),i+=n'),i=angular.element(a.children()[0]);i.attr("href",n.URL.createObjectURL(o)),i.attr("download",e.getFilename()),i.attr("target","_blank"),r.find("body").append(a),s((function(){i[0].click(),i.remove()}),null)}}()})),e.$apply()}))}}}])},"./src/js/chat/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/5e32f2e1a6d11e8f150e.html"},"./src/js/closing/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/b5ecdf1981d6cd190497.html"},"./src/js/offline/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/f2a9fbb003feacb050d3.html"},"./src/js/online/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/d5d747d90310b44f0100.html"},"./src/js/unmanaged/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/4b1f437e6978b48d5480.html"},"./src/js/waiting/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/6043a16afdb829ba5934.html"}},e=>{var t=t=>e(e.s=t);e.O(0,["vendor-index","vendor-angular-76f2ed34","vendor-angular-58d021f3","vendor-ng-embed","vendor-moment","vendor-jquery","vendor-jquery.textcomplete","vendor-emojionearea","vendor-emojione","vendor-angular-sanitize","vendor-angular-resource","vendor-angular-messages","vendor-angular-material","vendor-angular-local-storage","vendor-angular-animate","vendor-urlMatcher","vendor-transition","vendor-stateService","vendor-stateDirectives","vendor-flow"],(()=>(t("./node_modules/jquery/dist/jquery.js"),t("./node_modules/angular/index-exposed.js"),t("./node_modules/moment/moment.js"),t("./node_modules/@flowjs/flow.js/src/flow.js"),t("./node_modules/emojione/lib/js/emojione.js"),t("./src/js/index.module.js")))),e.O()}]); -//# sourceMappingURL=chat.js.map \ No newline at end of file diff --git a/snippet/3.0.1/scripts/chat.js.map b/snippet/3.0.1/scripts/chat.js.map deleted file mode 100644 index c6a84aa..0000000 --- a/snippet/3.0.1/scripts/chat.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scripts/chat.js","mappings":";iMAOAA,QAAQC,OAAO,gBAAiB,IAC/BC,SAAS,eAAe,WACvB,aAMAC,KAAKC,SAAW,GAQhBD,KAAKE,QAAU,SAAUC,GACvB,OAAO,IAAIC,EAAKD,IASlBH,KAAKK,OAAS,GASdL,KAAKM,GAAK,SAAUC,EAAOC,GACzBR,KAAKK,OAAOI,KAAK,CAACF,EAAOC,KAG3BR,KAAKU,KAAO,WACV,IAAIC,EAAKX,KAAKE,QACVD,EAAWD,KAAKC,SAChBI,EAASL,KAAKK,OAClB,MAAO,CACL,OAAU,SAASO,GAEjB,IAAIC,EAAOF,EAAGd,QAAQiB,OAAO,GAAIb,EAAUW,IAI3C,OAHAf,QAAQkB,QAAQV,GAAQ,SAAUE,GAChCM,EAAKP,GAAGC,EAAM,GAAIA,EAAM,OAEnBM,QAKfhB,QAAQC,OAAO,YAAa,CAAC,kBAC1BkB,WAAW,WAAY,CAAC,SAAU,SAAU,SAAU,cACvD,SAAUC,EAAQC,EAAQC,EAAQC,GAEhC,IAAIjB,EAAUN,QAAQiB,OAAO,GAAIG,EAAOI,MAAMH,EAAOI,WAGjDT,EAAQI,EAAOI,MAAMH,EAAOK,aAAeH,EAAYI,OAAOrB,GAE9DsB,EAAkB,SAASC,GAC7B,IAAIC,EAAOC,MAAMC,UAAUC,MAAMC,KAAKC,WACtCL,EAAKM,QACL,IAAI1B,EAAQU,EAAOiB,WAAWC,MAAMlB,EAAQ,CAAC,SAAWS,EAAWb,GAAMuB,OAAOT,IAMhF,GALI,CACF,SAAW,EAAG,eAAiB,EAAG,YAAe,EAAG,UAAa,EAAG,SAAY,GAChFD,IACAT,EAAOoB,cAEL9B,EAAM+B,iBACR,OAAO,GAIXzB,EAAKP,GAAG,WAAYmB,GACpBR,EAAOsB,IAAI,YAAY,WACnB1B,EAAK2B,IAAI,WAAYf,MAGzBR,EAAOwB,MAAQ5B,EAEXK,EAAOwB,eAAe,cACxBvB,EAAOD,EAAOyB,UAAUC,OAAO3B,EAAQJ,GACvCI,EAAOsB,IAAI,YAAY,WACrBpB,EAAOD,EAAOyB,UAAUC,OAAO3B,UAIpC4B,UAAU,WAAY,CAAC,WACtB,MAAO,CACLC,OAAO,EACP9B,WAAY,eAGlBnB,QAAQC,OAAO,WAAY,CAAC,cAC3B+C,UAAU,UAAW,CAAC,WACrB,MAAO,CACL,SAAY,KACZ,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAC/B,IAAIC,EAAcD,EAAMN,eAAe,iBACnCQ,EAAeF,EAAMN,eAAe,kBACpCS,EAAaH,EAAMN,eAAe,cAAgBI,EAAMzB,MAAM2B,EAAMI,WACxEN,EAAML,MAAMY,aAAaN,EAASE,EAAaC,EAAcC,QAInEtD,QAAQC,OAAO,kBAAmB,CAAC,cAKhC+C,UAAU,mBAAmB,WAC5B,MAAO,CACL,OAAS,EACT,KAAQ,SAASC,EAAOC,EAASC,GAC/BD,EAAQO,KAAK,iBAAiB,SAAU/C,GACtCA,EAAMgD,yBASbV,UAAU,gBAAiB,CAAC,WAAY,SAASW,GAChD,MAAO,CACL,OAAS,EACT,KAAQ,SAASV,EAAOC,EAASC,GAC/B,IAAIS,EACAC,GAAQ,EACZX,EAAQO,KAAK,YAAY,SAAU/C,GAmBnC,IAAoBoD,EACdC,EACAC,EADAD,GAAW,EACXC,GAFcF,EAlBFpD,GAoBasD,cAAgBF,EAAUG,cAAcD,aACrEhE,QAAQkB,QAAQ8C,GAAgBA,EAAaE,OAAO,SAASC,GAC/C,UAARA,IACFJ,GAAW,MAGRA,IAvBFF,IACHZ,EAAMmB,OAAOjB,EAAMkB,eACnBR,GAAQ,GAEVF,EAASW,OAAOV,GAChBlD,EAAMgD,qBAERR,EAAQO,KAAK,kBAAkB,SAAU/C,GACvCiD,EAASW,OAAOV,GAChBA,EAAUD,GAAS,WACjBV,EAAMzB,MAAM2B,EAAMoB,eAClBX,EAAU,KACVC,GAAQ,IACP,aAgBb7D,QAAQC,OAAO,YAAa,CAAC,cAC5B+C,UAAU,YAAY,WACrB,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAY/B,SAASqB,IACPvB,EAAML,MAAM4B,WAAWtB,GAZrBC,EAAMsB,gBACRxB,EAAMyB,OAAOvB,EAAMsB,iBAAiB,SAAUE,GACxCA,EACFH,IAYJvB,EAAML,MAAMgC,aAAa1B,MANzBsB,SAYP,SAAUxE,GAAU,aACnB,IAAIC,EAASD,EAAQC,OAAO,cAAe,CAAC,cAgB5CD,EAAQkB,QAfK,CACX2D,YAAa,CAAC,QAAS,YACvBC,aAAc,CAAC,SACfC,UAAW,CAAC,QAAS,UACrBC,WAAY,CAAC,SAAU,UACvBC,eAAgB,CAAC,SAAU,UAC3BC,UAAW,CAAC,SACZC,YAAa,CAAC,SACdC,UAAW,CAAC,QAAS,YACrBC,YAAa,GACbC,SAAU,GACVC,SAAU,GACVC,MAAO,CAAC,WAAY,WAGE,SAAUC,EAAW5D,GAC3C,IA4B6B6D,EA5BzBC,EAAO,SA4BkBD,EA5Ba7D,GA6B5B+D,OAAO,GAAGC,cAAgBH,EAAOzD,MAAM,IA5BzC,mBAAR0D,IACFA,EAAO,qBAET1F,EAAO+C,UAAU2C,EAAM,CAAC,WACtB,MAAO,CACLG,QAAS,YACT3E,WAAY,CAAC,SAAU,SAAU,SAAUC,EAAQC,GACjDD,EAAOsB,IAAI,SAAWb,GAAW,WAC/B,IAAIkE,EAAWhE,MAAMC,UAAUC,MAAMC,KAAKC,WACtCzB,EAAQqF,EAAS3D,QAErB,GAAIhB,EAAOwB,QAAUmD,EAAS3D,QAA9B,CAGA,IAAIN,EAAO,GACX9B,EAAQkB,QAAQuE,GAAW,SAASd,EAAOqB,GACzClE,EAAK6C,GAASoB,EAASC,OAEgB,IAArC5E,EAAOI,MAAMH,EAAOsE,GAAO7D,IAC7BpB,EAAMgD,8BAtCnB,CAiDC1D,SAEFA,QAAQC,OAAO,WAAY,CAAC,cAC3B+C,UAAU,UAAW,CAAC,WACrB,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAC/B,IAAI8C,EAAO9C,EAAM+C,QACjBjD,EAAMyB,OAAOuB,GAAM,SAAUA,GAC3B,GAAKA,EAAL,CAGA,IAAIE,EAAa,IAAIC,WACrBD,EAAWE,cAAcJ,EAAKA,MAC9BE,EAAWG,OAAS,SAAU5F,GAC5BuC,EAAMmB,QAAO,WACXjB,EAAMoD,KAAK,MAAO7F,EAAM8F,OAAOC,qBAO3CzG,QAAQC,OAAO,iBAAkB,CAAC,cACjC+C,UAAU,gBAAiB,CAAC,WAC3B,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,GACfA,EAAMyD,UAAYzD,EAAML,MAAM+D,WAIpC3G,QAAQC,OAAO,OAAQ,CAAC,gBAAiB,YAAa,cAAe,WACnE,YAAa,iBAAkB,WAAY,yHC9JlC2G,4PAkKX,SAASC,EAAmBC,EAAUC,EAAaC,EAAcC,EAAOC,GACpE,IAAIC,GAAkB,IAAAC,OAAM,yBACxBC,GAAe,IAAAD,OAAM,sBACzB,MAAO,CACHE,SAAU,MACVC,UAAW,IACXC,QAAS,SAAUC,GACf,IAAIC,EAAUD,EAASE,OAEvB,OADAF,EAASG,QACF,SAAU3E,EAAO4E,GACpB,IAAIC,EAAOD,EAASC,KAAK,WACzB,IAAKA,EAGD,OAFAD,EAASF,KAAKD,QACdZ,EAASe,EAASE,WAAlBjB,CAA8B7D,GAGlC,IAAI+E,EAAMF,EAAKG,MAAQ,CAAEC,SAAU,GAAIC,YAAa,EAAAC,MAChDC,EAAaL,EAAIM,MAAQ,IAAI,EAAAC,eAAeP,EAAIM,MACpDT,EAASF,KAAKK,EAAIG,YAAYN,EAAUQ,IAAeX,GACvD,EAAAc,MAAA,gBAAsBV,EAAKW,QAASZ,EAASF,QAC7C,IAAIe,EAAO5B,EAASe,EAASE,YACzB5G,EAAa6G,EAAI7G,WACjBwH,EAAexB,EAAgBa,GAC/BY,EAAYvB,EAAaW,GACzBa,EAASR,IAAc,OAAUA,GAErC,GADApF,EAAM2F,GAAaC,EACf1H,EAAY,CACZ,IAAI2H,EAAsB/B,EAAY5F,GAAY,IAAAF,QAAO,GAAI4H,EAAQ,CAAEzH,OAAQ6B,EAAO4E,SAAUA,KAC5Fc,IACA1F,EAAM0F,GAAgBG,EACtB7F,EAAM0F,GAAcC,GAAaC,GAMrChB,EAASC,KAAK,0BAA2BgB,GACzCjB,EAASkB,WAAWjB,KAAK,0BAA2BgB,GACpDE,EAA4B9B,EAAIF,EAAc8B,EAAoB7F,EAAO+E,GAG7E,IAAI,IAAAiB,UAASjB,EAAIkB,WACb,IAAIC,GAAY,IAAAC,aAAYpB,EAAIkB,WAC5BG,EAAc,IAAIC,OAAO,eAAiBH,EAAY,IAAK,KAO3DI,EAAoBtG,EAAMyB,QAND,WACzB,IAAI8E,EAAc,GAAGvH,MAChBC,KAAK2F,EAAS,GAAGkB,UACjBU,QAAO,SAAUC,GAAM,OAAOA,GAAMA,EAAGC,SAAWN,EAAYO,KAAKF,EAAGC,YAC3E,OAAOH,GAAe,aAAgBA,GAAa1B,KAAK,IAAME,EAAIkB,UAAY,iBAErB,SAAUW,GAC9DA,IAELb,EAA4B9B,EAAIF,EAAc6C,EAAc5G,EAAO+E,GACnEuB,QAGRb,EAAKzF,MAzNrB2D,EAAS,CACL,QACA,WACA,gBACA,eACA,KACA,SAAwBK,EAAO6C,EAAUC,EAAeC,EAAc9C,GAwBlE,IAAI+C,EAAW,CACXhC,KAAM,CAAEC,SAAU,CAAEgC,SAAUjD,EAAMkD,WAAWC,qBAC/C3B,QAAS,IAETzF,EAAY,CACZqH,MAAO,EACP/C,SAAU,MACVgD,UAAU,EACV/C,SAAU,IACVgD,WAAY,UACZ/C,QAAS,SAAUC,EAAU+C,EAAQC,GACjC,OAAO,SAAUxH,EAAO4E,EAAU1E,GAC9B,IACIuH,EAAYC,EAAWC,EAAcC,EADrCC,EAAY3H,EAAc,QAAK,GAAI4H,EAAgB5H,EAAkB,WAAG6H,EAjCzE,SAAU9H,EAASsD,EAAQyE,GAC1B,mBAAwB,EACxBnB,EAASjG,MAAMX,EAAS,KAAMsD,GAAQ0E,KAAKD,GAG3CnB,EAASjG,MAAMX,EAAS,KAAMsD,EAAQyE,IA4BkCD,EAzBzE,SAAU9H,EAAS+H,GAClB,mBAAwB,EACxBnB,EAASqB,MAAMjI,GAASgI,KAAKD,GAG7BnB,EAASqB,MAAMjI,EAAS+H,IAoB0EG,EAAYvD,EAASwD,cAAc,YAAcpB,EAAUtE,EAAOqE,EAAa7G,EAAc,QAAKA,EAAY,MAAK,GAAjD6G,CAAqD/G,IAAU,WAEnOqI,EAAe,CACfC,MAAO,MACPC,GAAIxI,EAAUqH,QACd1E,KAAMA,EACN8F,IAAKL,EAAU3C,QAAQgD,IAAML,EAAU3C,QAAQgD,IAAM,IAAM9F,EAAOA,EAClE+F,OAAQ,KACRC,cAWJ,SAA+BD,KACvBA,GAAYA,aAAkB,QAEjBb,IAAYa,IAE7B,EAAAlD,MAAA,yBAA+B8C,EAAcI,GAAUA,EAAOxD,UAAYwD,EAAOxD,SAASgC,UAC1FW,EAAaa,EACbE,EAAWF,MAjBX,sBAEI,IAAIG,GAAsB,IAAAzE,OAAM,yBAAN,CAAgCgE,GAGtDU,GAAgB,IAAA1E,OAAM,0BAAN,CAAiCgE,GACrD,OAAOS,GAAuBC,IAGtC,EAAAtD,MAAA,iBAAuB,UAAW8C,GAUlCzD,EAASC,KAAK,UAAW,CAAEW,QAAS6C,IACpCM,IACA,IAAIG,EAAa9E,EAAM+E,eAAeV,GA2BtC,SAASM,EAAWF,GAChB,IAAIO,EAAWhJ,EAAMiJ,OACjBC,EAAYjF,EAAGkF,QAASC,EAAYnF,EAAGkF,QACvCE,EAAc,CACdrE,KAAMyD,EACNjD,QAAS6C,GAETiB,EAAc,CACdC,WAAYL,EAAUvI,QACtB6I,WAAYJ,EAAUzI,QACtB8I,YAAaL,GAcjBJ,EAASU,MAAM,sBAAuBhH,GACtC,IAAIiH,EAASnC,EAAYwB,GAAU,SAAUY,GACzCA,EAAM/E,KAAK,cAAeyE,GAC1BM,EAAM/E,KAAK,UAAWwE,GACtBtB,EAAe6B,EAAOhF,GAAU,WAC5BsE,EAAUW,UACNlC,GACAA,EAAa+B,MAAM,gCAClB,IAAAI,WAAUhC,KAAmBA,GAAkB9H,EAAMzB,MAAMuJ,KAC5DhB,EAAc8C,MAvD9B,WAWI,GAVInC,IACA,EAAAlC,MAAA,iBAAuB,yBAA0BkC,EAAW5C,KAAK,YACjE4C,EAAWsC,SACXtC,EAAa,MAEbE,IACA,EAAApC,MAAA,iBAAuB,mBAAoB8C,GAC3CV,EAAaqC,WACbrC,EAAe,MAEfD,EAAW,CACX,IAAIuC,EAAcvC,EAAU7C,KAAK,eACjC,EAAAU,MAAA,iBAAuB,cAAe0E,GACtClC,EAAeL,GAAW,WACtBuC,EAAYR,YAAYI,UACxBpC,EAAa,QAEjBA,EAAaC,EACbA,EAAY,MAuCZwC,MAEJxC,EAAYiC,GACZhC,EAAeqB,GAWFU,MAAM,qBAAsBjB,GAAUb,GACnDD,EAAapJ,MAAMsJ,GA7EvB7H,EAAMP,IAAI,YAAY,WAClB,EAAA8F,MAAA,iBAAuB,2BAA4B8C,GACnDS,UAgFhB,OAAO/I,IAGf6D,EAAmBuG,QAAU,CAAC,WAAY,cAAe,eAAgB,QAAS,MAiElF,IAAIC,EAAuE,mBAA7C,YAAe,aAAwB,UAEjEC,EAAe,EAEnB,SAAStE,EAA4B9B,EAAIF,EAAc8B,EAAoB1H,EAAQ4G,KAE3E,IAAAuF,YAAWzE,EAAmB0E,WAC3BxF,EAAIE,SAASgB,WAAalB,EAAIE,SAASuF,oBAAsBJ,GAChEvE,EAAmB0E,UAEvB,IAAIE,GAAY,IAAAC,MAAK3F,EAAIM,MAAMsF,MAAMC,KACjCC,EAAc,CAAErK,KAAMqF,GAE1B,IAAI,IAAAyE,YAAWzE,EAAmBiF,mBAAoB,CAClD,IACIC,EADiB,IAAI,EAAAzF,eAAeP,EAAIM,MACH2F,cAAc,gBAAgBnG,KAyBvE1G,EAAOsB,IAAI,WAAYsE,EAAakH,UAAU,IAvB1B,SAAUC,GAG1B,GAAIA,IAAiBH,IAAsE,IAA/CG,EAAaC,UAAUC,QAAQX,GAA3E,CAEA,IAAIY,EAAWH,EAAaI,OAAO,MAC/BC,EAAaL,EAAaI,OAAO,QACjCE,EAAgB,SAAUC,GAAQ,OAAOA,EAAKC,aAC9CC,EAAWT,EAAaU,YAAY,MAAMC,IAAIL,GAAeM,OAAO,EAAAC,QAAS,IAC7EC,EAAad,EAAaU,YAAY,QAAQC,IAAIL,GAAeM,OAAO,EAAAC,QAAS,IAEjFE,EAAkBN,EAASnF,QAAO,SAAU0F,GAC5C,IAAIC,EAAMH,EAAWZ,QAAQc,GAC7B,OAAgB,IAATC,IAAeH,EAAWG,GAAKC,KAAKC,OAAOhB,EAASa,EAAM3D,IAAKgD,EAAWW,EAAM3D,QAG3F,GAAI0D,EAAgBK,OAAQ,CACxB,IAAIC,EAAgBN,EAAgBJ,KAAI,SAAUW,GAAK,OAAOA,EAAEjE,MAE5DkE,GAAY,IAAAjG,QAAO6E,GAAU,SAAUnK,EAAK6B,GAAO,OAAuC,IAAhCwJ,EAAcnB,QAAQrI,MACpF8C,EAAmBiF,kBAAkB2B,EAAWvB,OAGSL,IAGrE,IAAI,IAAAP,YAAWzE,EAAmB6G,WAAY,CAC1C,IAAIC,EAAOtC,IACPuC,EAAc,gBAEdC,EAAqB,SAAUC,GAC/B,QAASA,IAAWA,EAAMF,KAA6C,IAA7BE,EAAMF,GAAaD,IAAmBE,EAAmBC,EAAMC,oBAYzGC,EAAW,CAAE7B,QAASV,EAAU/H,MACpCvE,EAAOsB,IAAI,WAAYsE,EAAakJ,SAASD,GAV3B,SAAUF,GACxB,IAAInM,EACAuM,EAAOJ,EAAMF,GAAeE,EAAMF,IAAgB,GAKtD,OAJKC,EAAmBC,KACpBnM,EAAUsD,EAAGkJ,KAAKtH,EAAmB6G,UAAUI,KACvC7E,MAAK,SAAU/G,GAAO,OAAQgM,EAAIP,IAAgB,IAARzL,KAE/CP,IAGyDkK,KAG5E,YAAe,mBAAmB9K,UAAU,SAAU4D,GACtD,YAAe,mBAAmB5D,UAAU,SAAU6D,qSC9ZlDwJ,EAAiC,WACjC,SAASA,IACL,IAAIC,EAAQnQ,KACGA,KAAKoQ,SAAWvQ,EAAQ,GAAR,cAAwB,EACxCG,KAAKU,KAAO,CACvB,QACA,iBACA,YACA,SAAU2P,EAAOC,EAAgBC,GAI7B,OAHAJ,EAAMK,iBAAmBD,EAAUE,KAAOF,EAAUE,IAAI,qBAAuBF,EAAUG,IAAI,oBAC7FP,EAAME,MAAQA,EACdF,EAAMG,eAAiBA,EAChBH,IAyJnB,OApJAD,EAAgBrO,UAAU8O,eAAiB,SAAUnM,GACjDxE,KAAKoQ,SAAW5L,GAepB0L,EAAgBrO,UAAU+O,WAAa,SAAUrF,EAAQ6C,EAAQyC,GAC7D,IACIC,EAAa,SAAUxK,GAAU,OAAO,EAAAyK,SAAA,QAAiBzK,GAAQyE,MAAK,SAAUiG,GAAO,MAAO,CAAGC,SAAUD,OAC3GE,EAAc,SAAU5K,GAAU,OAAO,EAAAyK,SAAA,QAAiBzK,GAAQyE,MAAK,SAAUiG,GAAO,MAAO,CAAGjI,UAAWiI,OACjH,OAAO,IAAApE,WAAUrB,EAAO0F,UAClBH,EAAW9Q,KAAKmR,WAAW5F,EAAO0F,SAAU7C,KAC5C,IAAAxB,WAAUrB,EAAO6F,aACbN,EAAW9Q,KAAKqR,QAAQ9F,EAAO6F,YAAahD,KAC5C,IAAAxB,WAAUrB,EAAO+F,kBACbR,EAAW9Q,KAAKuR,aAAahG,EAAO+F,iBAAkBlD,EAAQyC,KAC9D,IAAAjE,WAAUrB,EAAOxC,WACbmI,EAAY3F,EAAOxC,YACnB,IAAA6D,WAAUrB,EAAO+B,mBACb4D,EAAYlR,KAAKwR,sBAAsBjG,EAAO+B,kBAAmBc,EAAQyC,IACzEC,EAbA,wBAwB1BZ,EAAgBrO,UAAUsP,WAAa,SAAUF,EAAU7C,GACvD,OAAO,IAAAhB,YAAW6D,GAAYA,EAAS7C,GAAU6C,GAWrDf,EAAgBrO,UAAUwP,QAAU,SAAUI,EAAKrD,GAG/C,OAFI,IAAAhB,YAAWqE,KACXA,EAAMA,EAAIrD,IACH,MAAPqD,EACO,KACPzR,KAAKoQ,SACEpQ,KAAKqQ,MACPK,IAAIe,EAAK,CAAEC,MAAO1R,KAAKsQ,eAAgBqB,QAAS,CAAEC,OAAQ,eAC1D7G,MAAK,SAAU8G,GAChB,OAAOA,EAASlK,QAGjB3H,KAAKwQ,iBAAiBiB,IAUjCvB,EAAgBrO,UAAU0P,aAAe,SAAUxR,EAAUqO,EAAQyC,GACjE,IAAIiB,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAS1BX,EAAgBrO,UAAU2P,sBAAwB,SAAUzR,EAAUqO,EAAQyC,GAC1E,IAAIiB,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAgB1BX,EAAgBrO,UAAUqQ,sBAAwB,SAAUzL,EAAQoK,EAAS9H,EAAWoJ,GACpFA,EAAWA,GAAY,GAEvB,IAAIC,EAASvS,EAAQ,GAAR,eAAyB,EAAI,KAAO,GAE7CwS,EAAQ,SAAUC,GAClB,IAAIC,GAAU,IAAAtJ,aAAYqJ,GAC1B,MAAO,aAAa7I,KAAK8I,GAAW,KAAOA,EAAUA,GA6BrDvP,EAQZ,SAA8BwC,GAC1B,IAAIgN,EAAU,EAAAzB,SAAA,cAAuBvL,EAAO,aAC5C,IAAKgN,IAAYA,EAAQpD,OACrB,MAAM,IAAIqD,MAAM,mCAAqCjN,EAAO,KAChE,OAAOgN,EAAQ7D,IAAI+D,GAAa9D,OAAO,EAAAC,QAAS,IAZhC8D,CAAqB5J,GAAW4F,KA3BzB,SAAUiE,GACzB,IAAIpN,EAAOoN,EAAMpN,KAAM0J,EAAO0D,EAAM1D,KAChC2D,EAAWR,EAAM7M,GAIrB,GAAIiB,EAAOqM,KAAKD,KAAcV,EAAS3M,GACnC,OAAOqN,EAAW,KAAOpM,EAAOqM,KAAKD,GAAY,IACrD,IAAIE,EAAcZ,EAAS3M,IAASA,EAGpC,GAAa,MAAT0J,EACA,OAAO2D,EAAW,OAAST,EAAS,YAAcW,EAAc,MAIpE,GAAa,MAAT7D,EAAc,CACd,IAAI8D,EAAMnC,EAAQ/C,cAAciF,GAC5BpS,EAAKqS,GAAOA,EAAIrL,KAChBhG,EAAQhB,GAAM,EAAAoQ,SAAA,mBAA4BpQ,IAAQ,GAGtD,OAAOkS,EAAW,cAAgBE,IADhB,IAAAf,SAAQrR,GAAM,KAAOA,EAAGyO,OAAS,GAAK,IAAM,IACA,IAAMzN,EAAKsR,KAAK,KAAO,KAGzF,OAAOJ,EAAW,KAAOT,EAAS,YAAcW,EAAc,OAEJE,KAAK,KAC/DjK,EAAYqJ,EAAMtJ,GACtB,MAAO,IAAMC,EAAY,IAAMhG,EAAQ,MAAQgG,EAAY,KAExDkH,EArKyB,GAiLhCwC,EAAc,SAAUQ,GACxB,OAAI,IAAAC,UAASD,EAAIE,kBACNC,EAAcH,EAAIE,kBACtBC,EAAcH,EAAIpQ,QAIzBuQ,EAAgB,SAAUC,GAC1B,OAAOC,OAAOC,KAAKF,GAAe,IAE7B3E,KAAI,SAAU9I,GAAO,MAAO,CAACA,EAAK,oBAAoB4D,KAAK6J,EAAYzN,QAEvEyD,QAAO,SAAUmK,GAAS,OAAO,IAAA7G,WAAU6G,KAAU,IAAAzB,SAAQyB,EAAM,OAEnE9E,KAAI,SAAU8E,GAAS,MAAO,CAAGjO,KAAMiO,EAAM,GAAG,IAAMA,EAAM,GAAIvE,KAAMuE,EAAM,GAAG,2ECzL7EC,EAAsB,SAAUC,GACvC,OAAO,SAA0BC,GAC7B,IAAIC,EAAOD,EAAYD,GACnBG,EAAwB,WAAbH,EAAwB,OAAS,KAOhD,OAAOE,EANP,SAA0BjE,EAAOnC,GAC7B,IACIsG,EADiB,IAAI,EAAA3L,eAAewH,EAAMlB,YAAYoF,IAC1BC,WAAWtG,EAAMuG,WAC7CtL,GAAS,IAAA5H,QAAOmT,EAAUF,GAAa,CAAEG,QAASzG,EAAOO,aAAc4B,IAC3E,OAAO,EAAAmB,SAAA,iBAA0B8C,EAAM7T,KAAM0I,SAEhByL,ICfrCC,EAAqC,WACrC,SAASA,EAAoBC,GAEzBrU,KAAKsU,cAAgB,GACrBtU,KAAKqU,kBAAoBA,EACzB,IAAIE,GAAM,IAAAvQ,KAAIqQ,IACd,IAAAG,sBAAqBD,EAAKvU,KAAMuU,EAAK,CAAC,eA8D1C,OAhDAH,EAAoBK,6BAA+B,SAAUC,GACzD,IAAIC,EAAWD,EAAOE,kBAAkB1F,KAAK,QAC7CyF,EAASE,OAAS,SAAUvF,GACxB,OAAY,MAALA,EAAYA,EAAEwF,WAAWC,QAAQ,WAAW,SAAUC,GAAK,MAAQ,CAAE,IAAK,KAAM,IAAK,OAAQA,MAAU1F,GAElHqF,EAASM,OAAS,SAAU3F,GACxB,OAAY,MAALA,EAAYA,EAAEwF,WAAWC,QAAQ,aAAa,SAAUC,GAAK,MAAQ,CAAE,KAAM,IAAK,MAAO,KAAMA,MAAU1F,IAIxH8E,EAAoBvS,UAAUqT,QAAU,aACxCd,EAAoBvS,UAAUsT,SAAW,SAAU3U,GAC/C,IAAI2P,EAAQnQ,KAEZ,OADAA,KAAKsU,cAAc7T,KAAKD,GACjB,WAAc,OAAO,IAAA4U,YAAWjF,EAAMmE,cAAjB,CAAgC9T,KAEhE4T,EAAoBvS,UAAUwT,UAAY,WACtC,IAAIA,EAAYrV,KAAKqU,kBAAkBgB,YAEvC,OADAA,GAAY,IAAAlC,UAASkC,GAAaA,EAAUC,QAAUD,IAClCrV,KAAKuV,SAASC,SAEtCpB,EAAoBvS,UAAU4T,SAAW,WACrC,OAAOzV,KAAK0V,YAAc1V,KAAK0V,UAAY1V,KAAK2V,SAASF,YAAczV,KAAK4V,QAAQC,SAAS/B,WAEjGM,EAAoBvS,UAAU4P,IAAM,SAAUqE,EAAQf,EAAStH,GAQ3D,YAPgB,IAAZsH,IAAsBA,GAAU,IAChC,IAAAnI,WAAUkJ,IACV9V,KAAK+V,UAAUtE,IAAIqE,GACnBf,GACA/U,KAAK+V,UAAUhB,UACftH,GACAzN,KAAK+V,UAAUtI,MAAMA,GAClBzN,KAAK+V,UAAUtE,OAE1B2C,EAAoBvS,UAAUmU,iBAAmB,SAAUC,EAAYF,EAAWR,EAAUI,EAAUC,GAClG,IAAIzF,EAAQnQ,KACZA,KAAK+V,UAAYA,EACjB/V,KAAKuV,SAAWA,EAChBvV,KAAK2V,SAAWA,EAChB3V,KAAK4V,QAAUA,EAEfK,EAAW1T,IAAI,0BAA0B,SAAU2T,GAAO,OAAO/F,EAAMmE,cAAcvT,SAAQ,SAAUJ,GAAM,OAAOA,EAAGuV,SACvH,IAAIC,GAAO,IAAAnS,KAAI+R,IAEf,IAAAvB,sBAAqB2B,EAAMnW,KAAMmW,EAAM,CAAC,UAAW,OAAQ,SAAU,UAErE,IAAA3B,sBAAqB2B,EAAMnW,KAAMmW,EAAM,CAAC,OAAQ,WAAY,UAEzD/B,EApE6B,0ECaxCvU,EAAQ,GAAR,OAAe,qBAAsB,IACrC,IAAIuW,EAAWvW,EAAQ,GAAR,OAAe,iBAAkB,CAAC,OAC7CwW,EAAWxW,EAAQ,GAAR,OAAe,iBAAkB,CAAC,mBAC7CyW,EAAUzW,EAAQ,GAAR,OAAe,mBAAoB,CAAC,mBAC9C0W,EAAY1W,EAAQ,GAAR,OAAe,kBAAmB,CAAC,mBAAoB,iBAAkB,uBACrF2W,EAAW3W,EAAQ,GAAR,OAAe,YAAa,CAAC,iBAAkB,kBAAmB,uBAE7E6U,GADW7U,EAAQ,GAAR,OAAe,mBAAoB,CAAC,cACtC,MAGb,SAAS4W,EAAkBpC,IAEvBK,EAAS1U,KAAK0U,OAAS,IAAI,EAAAgC,UACpBC,cAAgB,IAAI,IAAcjC,EAAOkC,cAAelC,EAAOmC,cAEtEnC,EAAOkC,cAAcE,UAAU,QAAS,MACxCpC,EAAOkC,cAAcE,UAAU,SAAUpD,EAAoB,WAC7DgB,EAAOkC,cAAcE,UAAU,WAAYpD,EAAoB,aAC/DgB,EAAOkC,cAAcE,UAAU,UAAWpD,EAAoB,YAC9DgB,EAAOqC,YAAY/M,WAAWgN,mBAAmB,OAAO,WAExDtC,EAAOuC,WAAW1L,OAAO2L,eAAgB,EACzC,IAAIC,EAAsBzC,EAAO0C,gBAAkB1C,EAAO2C,eAAiB,IAAIjD,EAAoBC,GAMnG,SAAS3T,EAAKqV,EAAWJ,EAAUC,EAASL,EAAUU,EAAY5F,EAAOC,GAIrE,OAHA6G,EAAmBnB,iBAAiBC,EAAYF,EAAWR,EAAUI,EAAUC,UACxElB,EAAe,cACfA,EAAa,KACbA,EAEX,OAXAN,EAAoBK,6BAA6BC,GAEjDA,EAAe,OAAIA,EACnBA,EAAa,KAAIhU,EACjBA,EAAKuM,QAAU,CAAC,YAAa,WAAY,UAAW,WAAY,aAAc,QAAS,kBAOhFyH,EA1BX+B,EAAkBxJ,QAAU,CAAC,qBA4B7B,IAAIqK,EAAiB,SAAUC,GAAe,MAAO,CACjD,oBACA,SAAUC,GACN,IAAIC,EAAUD,EAAK9C,OAAO6C,GAE1B,OADAE,EAAc,KAAI,WAAc,OAAOA,GAChCA,KAKf,SAASC,EAASnH,EAAWxJ,EAAI4Q,GAI7B,GAHA,EAAA5G,SAAA,UAAqBR,EACrB,EAAAQ,SAAA,GAAchK,GAETwM,OAAO1R,UAAUa,eAAeX,KAAKwO,EAAW,YACjD,IACIA,EAAUqH,QAAO,SAAUC,OAE/B,MAAOxS,GACHkL,EAAUuH,WAAa,cAAcrO,KAAKpE,GAASA,EAAMyP,YAKjE6C,EAAUf,cACLlG,MACA/B,KAAI,SAAUW,GAAK,OAAOA,EAAE0E,UAAU+D,eACtCnJ,OAAO,EAAAC,QAAS,IAChBvF,QAAO,SAAUgG,GAAK,MAAkB,aAAXA,EAAEwC,QAC/B/Q,SAAQ,SAAUiX,GAAc,OAAQA,EAAWlG,KAAOvB,EAAU0H,SAASD,EAAWE,UAAW3H,EAAUuH,aAQ/G,SAASK,EAAalC,GACzBA,EAAW1R,QAAO,WACd,EAAA8D,MAAA,wBA9BRqP,EAASzK,QAAU,CAAC,YAAa,KAAM,aA2BvCkL,EAAalL,QAAU,CAAC,cAMxBmJ,EAASrW,SAAS,YAAa0W,GAC/BH,EAAQvW,SAAS,aAAc,CAAC,oBAXL,SAAUqY,GAAY,OAAQA,EAASC,kBAAoB,IAAI,IAAkBD,MAY5G/B,EAAStW,SAAS,cAAeuX,EAAe,eAChDjB,EAAStW,SAAS,qBAAsB,CAAC,oBAAqB,WAAc,OAAO2U,EAAOE,qBAC1FyB,EAAStW,SAAS,oBAAoB,WAAc,OAAO,IAAImQ,KAC/DqG,EAAUxW,SAAS,iBAAkBuX,EAAe,kBACpDf,EAAUxW,SAAS,mBAAoBuX,EAAe,YACtDf,EAAUxW,SAAS,eAAgBuX,EAAe,sBAClDf,EAAUxW,SAAS,SAAU,CAAC,oBAfP,WAAc,OAAO,IAAAe,QAAO4T,EAAOiC,cAAe,CAAEjW,KAAM,WAAc,OAAOgU,EAAOmC,mBAgB7GN,EAAUrW,QAAQ,eAAgB,CAAC,YAAa,SAAUyX,GAAa,OAAOA,EAAUW,QAAQlK,UAChGoI,EAAStW,QAAQ,SAAS,WAAc,OAAOwU,EAAOqC,eACtDP,EAASiB,QAAQ,UAAU,WAAc,OAAO,EAAApP,SAChDmO,EAAS+B,IAAIJ,GACb9B,EAASkC,IAAI,CAAC,qBAAsB,SAAUC,OAC9CjC,EAAUgC,IAAI,CAAC,SAAU,SAAUE,OACnCnC,EAAQiC,IAAI,CAAC,aAAc,SAAUG,OACrCtC,EAASmC,IAAIb,GAEN,IAAIzD,EAAY,SAAU0E,GAO7B,OANaA,EAAIC,YAAYtP,OAAO,EAAAR,UAChB6F,KAAI,SAAU9I,GAC9B,IAAImS,EAAaW,EAAI7K,cAAcjI,GAEnC,MAAO,CAACA,EAAoB,WADX8S,EAAIE,UAAUb,GAAYc,MACJd,EAAWvU,QAAUuU,EAAWrQ,SAE7DiH,OAAO,EAAAmK,WAAY,2JC9GrC,SAASC,EAAeP,GACpB,IAAIQ,EAAW,SAAUxL,EAAOW,EAAQjO,GACpC,OAAOsY,EAAOS,GAAGzL,EAAOW,EAAQjO,IAGpC,OADA8Y,EAASE,WAAY,EACdF,EAaX,SAASG,EAAuBX,GAC5B,IAAIY,EAAiB,SAAU5L,EAAOW,EAAQjO,GAC1C,OAAOsY,EAAOa,SAAS7L,EAAOW,EAAQjO,IAG1C,OADAkZ,EAAeF,WAAY,EACpBE,EAxBXL,EAAe/L,QAAU,CAAC,UAkB1BmM,EAAuBnM,QAAU,CAAC,UAQlC,YAAe,mBAAmB3D,OAAO,UAAW0P,GAAgB1P,OAAO,kBAAmB8P,oKCpB1FG,EAA+B,WAC/B,SAASA,EAAc3C,EAAeC,GAClC7W,KAAK4W,cAAgBA,EACrB5W,KAAK6W,aAAeA,GACpB,IAAArC,uBAAqB,IAAAxQ,KAAIuV,EAAc1X,WAAY7B,MAAM,IAAAgE,KAAIhE,OAgHjE,OArBAuZ,EAAc1X,UAAUiV,UAAY,SAAUtR,EAAMgU,GAChD,OAAOxZ,KAAK4W,cAAcE,UAAUtR,EAAMgU,IAASxZ,MAEvDuZ,EAAc1X,UAAU4L,MAAQ,SAAUjI,EAAMiU,GAQ5C,OAPI,IAAAtG,UAAS3N,GACTiU,EAAajU,EAGbiU,EAAWjU,KAAOA,EAEtBxF,KAAK4W,cAAc8C,SAASD,GACrBzZ,MAOXuZ,EAAc1X,UAAU8X,UAAY,SAAUnZ,GAC1C,OAAOR,KAAK6W,aAAa8C,UAAUnZ,IAEhC+Y,EApHuB,6LCf3B,SAASK,IACZ,IAAIC,EAAkB,KACtB,OAAO,SAAU1R,EAAM2R,GAEnB,OADAD,EAAkBA,GAAmB,EAAA9I,SAAA,cAAuB,oBACrD,CAAC,IAAIgJ,EAAc5R,EAAM2R,EAAMD,KAI9C,IAAIG,EAAY,SAAUxG,EAAMyG,GAAO,OAAOzG,EAAK5E,QAAO,SAAUsL,EAAKrU,GAAO,OAAOqU,IAAO,IAAAtN,WAAUqN,EAAIpU,OAAU,IAY/G,SAASsU,EAAgB1M,GAE5B,IAAKA,EAAM2M,OACP,MAAO,GACX,IAAgKC,EAAW,CAAC,YAAa,WAAY,qBAAsBC,EAA7M,CAAC,mBAAoB,cAAe,WAAY,SAAU,SAAyKlY,OAApJ,CAAC,aAAc,qBAAsB,eAAgB,cAAiHmY,EAAcF,EAASjY,OAAOkY,GAIjS,IAAI,IAAA1N,WAAUa,EAAM+M,QAAUR,EAAUO,EAAa9M,GACjD,MAAM,IAAIgF,MAAM,UAAYhF,EAAMjI,KAAlB,4JAGL+U,EAAYjR,QAAO,SAAUzD,GAAO,OAAO,IAAA+G,WAAUa,EAAM5H,OAAUoN,KAAK,OAEzF,IAAIuH,EAAQ,GAAIC,EAAchN,EAAM+M,OAAS,CAAEE,UAAU,IAAAC,MAAKlN,EAAO8M,IAsBrE,OArBA,IAAAxZ,SAAQ0Z,GAAa,SAAUlP,EAAQ/F,GASnC,GAPAA,EAAOA,GAAQ,YAEX,IAAAsD,UAASyC,KACTA,EAAS,CAAExC,UAAWwC,IAE1BA,GAAS,IAAAzK,QAAO,GAAIyK,GAEhByO,EAAUK,EAAU9O,IAAWyO,EAAUM,EAAa/O,GACtD,MAAM,IAAIkH,MAAM,mBAAqB4H,EAASpH,KAAK,KAAO,UAAYqH,EAAYrH,KAAK,KAAO,mBAAqBzN,EAAO,IAAMiI,EAAMjI,KAAO,KAEjJ+F,EAAO9C,UAAY8C,EAAO9C,WAAa,WACvC8C,EAAOH,MAAQ,MACfG,EAAOxB,SAAW0D,EAClBlC,EAAOqP,MAAQpV,EACf,IAAIqV,EAAa,EAAAC,YAAA,sBAAkCvP,EAAOxB,SAAUwB,EAAOqP,OAC3ErP,EAAOwP,YAAcF,EAAWG,WAChCzP,EAAO0P,qBAAuBJ,EAAWK,oBACzCV,EAAMhV,GAAQ+F,KAEXiP,EAGX,IAAInP,EAAK,EAEL0O,EAA+B,WAC/B,SAASA,EAAc5R,EAAMJ,EAAU7H,GACnC,IAAIiQ,EAAQnQ,KACZA,KAAKmI,KAAOA,EACZnI,KAAK+H,SAAWA,EAChB/H,KAAKE,QAAUA,EACfF,KAAKmb,IAAM9P,IACXrL,KAAKob,QAAS,EACdpb,KAAKgI,YAAc,SAAUvB,EAAQoK,GACjC,OAAOV,EAAMpH,UACPoH,EAAMjQ,QAAQgS,sBAAsBzL,EAAQoK,EAASV,EAAMpH,UAAWoH,EAAMpI,SAASoK,UACrFhC,EAAMc,UAiCpB,OA9BA8I,EAAclY,UAAUwZ,KAAO,WAC3B,IAAIlL,EAAQnQ,KACR+G,EAAK,EAAAgK,SAAA,GACLF,EAAU,IAAI,EAAAzI,eAAepI,KAAKmI,MAClCiG,EAASpO,KAAKmI,KAAKyG,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO,IAAAzN,QAAOoZ,EAAK3L,EAAK+M,eAAiB,IAC1FC,EAAW,CACXtK,SAAUlK,EAAGkJ,KAAKjQ,KAAKE,QAAQ0Q,WAAW5Q,KAAK+H,SAAUqG,EAAQyC,IACjE7P,WAAY+F,EAAGkJ,KAAKjQ,KAAKwb,cAAc3K,KAE3C,OAAO9J,EAAG0U,IAAIF,GAAUxQ,MAAK,SAAU2Q,GAInC,OAHA,EAAArT,MAAA,sBAA4B,SAAU8H,GACtCA,EAAMnP,WAAa0a,EAAQ1a,YAC3B,IAAAF,QAAOqP,EAAOuL,EAAQzK,UACfd,MAQf4J,EAAclY,UAAU2Z,cAAgB,SAAU3K,GAC9C,IAAI9Q,EAAWC,KAAK+H,SAAS4T,mBAC7B,KAAK,IAAAC,cAAa7b,GACd,OAAOC,KAAK+H,SAAS/G,WACzB,IAAI8Q,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAEnBkJ,EA5CuB,wKC9C9B8B,EAAmC,WAEnC,SAASA,EAAiCnH,GACtC1U,KAAK0U,OAASA,EA2KlB,OAzKAmH,EAAkBC,kBAAoB,SAAUpH,EAAQqH,GACpD,OAAO,SAAUC,GAAS,OAAO,EAAAjL,SAAA,iBAA0BgL,EAAS,KAAM,CAAEE,OAAQD,EAAOE,aAAcxH,EAAO4D,QAAQlK,WAG5HyN,EAAkBha,UAAUnB,KAAO,WAC/B,IAAIuW,EAAajX,KAAK0U,OAAOuC,WAI7B,OAHAjX,KAAK0U,OAAOyH,UAAUC,QAAO,GACxBnF,EAAWoF,mBACZpF,EAAWqF,SACRtc,KAAK0U,OAAOyH,WAiCvBN,EAAkBha,UAAU0a,KAAO,SAAUC,GACzC,IAAIrM,EAAQnQ,KACZ,KAAK,IAAAoN,YAAWoP,GACZ,MAAM,IAAI/J,MAAM,6BACpB,IACI8J,EAAO,IAAI,EAAAE,aADH,WAAc,OAAOD,EAAO,EAAAzL,SAAA,UAAoBZ,EAAMuE,OAAO0C,mBACvC,EAAAsF,UAElC,OADA1c,KAAK0U,OAAOuC,WAAW0F,MAAMJ,KAAKA,GAC3Bvc,MA4BX6b,EAAkBha,UAAU+a,UAAY,SAAUL,GAC9C,IAAIpM,EAAQnQ,KACR6c,EAAW7c,KAAK0U,OAAOuC,WAAW0F,MACtC,IAAI,IAAA7T,UAASyT,GACTM,EAASD,UAAUL,OAElB,MAAI,IAAAnP,YAAWmP,GAIhB,MAAM,IAAI9J,MAAM,uCAHhBoK,EAASD,WAAU,WAAc,OAAOL,EAAK,EAAAxL,SAAA,UAAoBZ,EAAMuE,OAAO0C,oBAKlF,OAAOpX,MAwCX6b,EAAkBha,UAAUoO,KAAO,SAAU6M,EAAMf,GAK/C,QAJI,IAAA/J,SAAQ+J,KAAY,IAAA3O,YAAW2O,MAC/BA,EAAUF,EAAkBC,kBAAkB9b,KAAK0U,OAAQqH,IAE/D/b,KAAK0U,OAAOuC,WAAW0F,MAAM1M,KAAK6M,EAAMf,GACjC/b,MAgCX6b,EAAkBha,UAAUkb,eAAiB,SAAU9Q,GACnDjM,KAAK0U,OAAOuC,WAAW8F,eAAe9Q,IAEnC4P,EA9K2B,iJCKtC,UAAe,mBAAmB9b,SAAS,iBApB3C,WACI,IAAIid,GAAkB,EACtBhd,KAAKgd,gBAAkB,WACnBA,GAAkB,GAEtBhd,KAAKU,KAAO,CACR,gBACA,WACA,SAAUuc,EAAezZ,GACrB,OAAIwZ,EACOC,EAEJ,SAAUvV,GACb,OAAOlE,GAAS,WACZkE,EAAS,GAAGwV,mBACb,GAAG,8nBClBlBC,EAAkD,WAClD,IAAK,IAAIC,EAAI,EAAGC,EAAI,EAAGC,EAAKtb,UAAUoN,OAAQiO,EAAIC,EAAID,IAAKD,GAAKpb,UAAUqb,GAAGjO,OACxE,IAAImO,EAAI3b,MAAMwb,GAAII,EAAI,EAA3B,IAA8BH,EAAI,EAAGA,EAAIC,EAAID,IACzC,IAAK,IAAII,EAAIzb,UAAUqb,GAAIK,EAAI,EAAGC,EAAKF,EAAErO,OAAQsO,EAAIC,EAAID,IAAKF,IAC1DD,EAAEC,GAAKC,EAAEC,GACjB,OAAOH,GAaAK,EAAwB,iBAATlQ,MAAqBA,KAAKA,OAASA,MAAQA,MAC9C,iBAAX,EAAAmQ,GAAuB,EAAAA,EAAOC,SAAW,EAAAD,GAAU,EAAAA,QAC3D,EACAhe,EAAU+d,EAAK/d,SAAW,GACnBke,EAAWle,EAAQke,UAAYC,KAAK/W,MAAM3D,KAAK0a,MAC/CC,EAASpe,EAAQoe,QAAUD,KAAKE,UAAU5a,KAAK0a,MAC/Cjd,EAAUlB,EAAQkB,SAqc7B,SAAkBkZ,EAAKnP,EAAIqF,GACvB,IAAI,QAAQ8J,GACR,OAAOA,EAAIlZ,QAAQ+J,EAAIqF,GAC3BoD,OAAOC,KAAKyG,GAAKlZ,SAAQ,SAAU8E,GAAO,OAAOiF,EAAGmP,EAAIpU,GAAMA,OAvcvD/E,EAASyS,OAAO3Q,QAycpB,SAAiBub,GACpB,IAAK,IAAId,EAAI,EAAGA,EAAIrb,UAAUoN,OAAQiO,IAAK,CACvC,IAAIpD,EAAMjY,UAAUqb,GACpB,GAAKpD,EAGL,IADA,IAAIzG,EAAOD,OAAOC,KAAKyG,GACdyD,EAAI,EAAGA,EAAIlK,EAAKpE,OAAQsO,IAC7BS,EAAM3K,EAAKkK,IAAMzD,EAAIzG,EAAKkK,IAGlC,OAAOS,GAldAhP,EAAStP,EAAQsP,QAod5B,SAASiP,EAAQC,EAAIC,GACjB,GAAID,IAAOC,EACP,OAAO,EACX,GAAW,OAAPD,GAAsB,OAAPC,EACf,OAAO,EACX,GAAID,GAAOA,GAAMC,GAAOA,EACpB,OAAO,EACX,IAAIC,SAAYF,EAChB,GAAIE,WAD4BD,GACR,WAAPC,EACb,OAAO,EACX,IAyBeC,EAAIC,EAzBfC,EAAM,CAACL,EAAIC,GACf,IAAI,QAAI,KAAJ,CAAaI,GACb,OAuBeD,EAvBMH,GAuBVE,EAvBMH,GAwBdjP,SAAWqP,EAAGrP,QAEduP,EAAYH,EAAIC,GAAI7P,QAAO,SAAUgQ,EAAGC,GAAK,OAAOD,GAAKR,EAAQS,EAAE,GAAIA,EAAE,OAAQ,GAzBxF,IAAI,QAAI,KAAJ,CAAYH,GACZ,OAAOL,EAAGS,YAAcR,EAAGQ,UAC/B,IAAI,QAAI,KAAJ,CAAcJ,GACd,OAAOL,EAAGvJ,aAAewJ,EAAGxJ,WAChC,IAAI,QAAI,KAAJ,CAAgB4J,GAChB,OAAO,EAEX,GADiB,CAAC,KAAY,KAAS,KAAQ,MAChC/P,IAAI,MAAKC,QAAO,SAAUgQ,EAAGje,GAAM,OAAOie,KAAOje,EAAG+d,MAAS,GACxE,OAAO,EACX,IAAIlL,EAAO,GAEX,IAAK,IAAI3N,KAAOwY,EAAI,CAChB,IAAKD,EAAQC,EAAGxY,GAAMyY,EAAGzY,IACrB,OAAO,EACX2N,EAAK3N,IAAO,EAEhB,IAAK,IAAIA,KAAOyY,EACZ,IAAK9K,EAAK3N,GACN,OAAO,EAEf,OAAO,GApfJ,SAAS6W,EAASpN,GACrB,OAAOA,EAEJ,SAASrH,KAyDT,SAASuM,EAAqBuK,EAAQ1Y,EAAQ/C,EAAM0b,EAASC,QAC/C,IAAbA,IAAuBA,GAAW,GACtC,IAAIC,EAAe,SAAUC,GAAU,OAAOJ,IAASI,GAAQ7b,KAAKA,MAQpE,OADA0b,EAAUA,GAAWzL,OAAOC,KAAKuL,MAClBnQ,QAAO,SAAUsL,EAAK1U,GAPd,IAAU2Z,EAS7B,OADAjF,EAAI1U,GAAQyZ,GARiBE,EAQW3Z,EAPjC,WAEH,OADAa,EAAO8Y,GAAUD,EAAaC,GACvB9Y,EAAO8Y,GAAQhd,MAAM,KAAMH,aAKUkd,EAAa1Z,GACtD0U,IACR7T,GAMA,IAAI+Y,EAAU,SAAUhF,EAAQiF,GAAS,OAAOve,EAAOyS,OAAO/R,OAAO4Y,GAASiF,IAE1EC,GAAU,SACd,SAAkBC,EAAOtF,GAC5B,OAA+B,IAAxBsF,EAAMrR,QAAQ+L,MAMd7E,GAAa,SACjB,SAAqBmK,EAAOtF,GAC/B,IAAIhL,EAAMsQ,EAAMrR,QAAQ+L,GAGxB,OAFIhL,GAAO,GACPsQ,EAAMC,OAAOvQ,EAAK,GACfsQ,KAGAE,GAAS,SACb,SAAiBC,EAAK1b,GACzB,OAAO0b,EAAIjf,KAAKuD,GAAMA,KAGf2b,EAAW,SAAUC,GAC5B,OAAOA,EAAU9d,QAAQf,SAAQ,SAAUJ,GACzB,mBAAPA,GAAqBA,IAC5ByU,EAAWwK,EAAWjf,OAQvB,SAASV,EAASW,GAErB,IADA,IAAIif,EAAe,GACVC,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCD,EAAaC,EAAK,GAAK9d,UAAU8d,GAErC,IAAIC,EAAcjf,EAAOqB,WAAM,EAAQgb,EAAe,CAAC,IAAK0C,EAAaG,YACzE,OAAOlf,EAAOif,EAAapF,EAAK/Z,GAAQ,GAAI2S,OAAOC,KAAKuM,KAGrD,IAAIE,EAAS,SAAUC,EAAMC,GAAQ,OAAOrf,EAAOof,EAAMC,IAQzD,SAASC,EAAUC,EAAOC,GAC7B,IAAInY,EAAO,GAEX,IAAK,IAAIoY,KAAKF,EAAMlY,KAAM,CACtB,GAAIkY,EAAMlY,KAAKoY,KAAOD,EAAOnY,KAAKoY,GAC9B,MACJpY,EAAK1H,KAAK4f,EAAMlY,KAAKoY,IAEzB,OAAOpY,EAaJ,SAASwS,EAAKV,EAAKuG,GACtB,IAAIC,EAAU,GACd,IAAK,IAAIC,KAASzG,GACoB,IAA9BuG,EAAUtS,QAAQwS,KAClBD,EAAQC,GAASzG,EAAIyG,IAG7B,OAAOD,EAcJ,SAASE,EAAK1G,EAAKuG,GACtB,OAAOjN,OAAOC,KAAKyG,GACd3Q,QAAO,QAAIgW,EAAQkB,KACnB5R,QAAO,SAAUsL,EAAKrU,GAAO,OAASqU,EAAIrU,GAAOoU,EAAIpU,GAAOqU,IAAS,IASvE,SAAS5Q,EAAOsX,EAAYpgB,GAC/B,IAAIkf,GAAM,QAAQkB,GAAata,EAASoZ,EAAM,GAAK,GAC/CmB,EAASnB,EAAM,SAAUpQ,GAAK,OAAOhJ,EAAO7F,KAAK6O,IAAQ,SAAUA,EAAGzJ,GAAO,OAAQS,EAAOT,GAAOyJ,GAKvG,OAJAvO,EAAQ6f,GAAY,SAAUT,EAAM9C,GAC5B7c,EAAS2f,EAAM9C,IACfwD,EAAOV,EAAM9C,MAEd/W,EAGJ,SAASwa,EAAKF,EAAYpgB,GAC7B,IAAI8F,EAOJ,OANAvF,EAAQ6f,GAAY,SAAUT,EAAM9C,GAC5B/W,GAEA9F,EAAS2f,EAAM9C,KACf/W,EAAS6Z,MAEV7Z,EAGJ,IAAIya,EAASpS,EAEb,SAASA,EAAIiS,EAAYpgB,EAAU6F,GAGtC,OAFAA,EAASA,KAAW,QAAQua,GAAc,GAAK,IAC/C7f,EAAQ6f,GAAY,SAAUT,EAAM9C,GAAK,OAAQhX,EAAOgX,GAAK7c,EAAS2f,EAAM9C,MACrEhX,EAYJ,IAAI2a,EAAS,SAAU/G,GAAO,OAAO1G,OAAOC,KAAKyG,GAAKtL,KAAI,SAAU9I,GAAO,OAAOoU,EAAIpU,OAclFob,EAAW,SAAUf,EAAMgB,GAAQ,OAAOhB,GAAQgB,GAclDC,EAAW,SAAUjB,EAAMgB,GAAQ,OAAOhB,GAAQgB,GAUlDrS,EAAU,SAAUqR,EAAMgB,GAAQ,OAAOhB,EAAK9d,OAAO8e,IAWrDE,EAAW,SAAUlB,EAAMgB,GAClC,OAAO,QAAQA,GAAQhB,EAAK9d,OAAO8e,EAAKtS,OAAOwS,EAAU,KAAOC,EAAMnB,EAAMgB,IAMzE,SAASG,EAAM3B,EAAKzF,GAEvB,OADAyF,EAAIjf,KAAKwZ,GACFyF,EAGJ,IAAI4B,EAAQ,SAAUpH,EAAKqH,GAAS,OAAQjC,EAAQpF,EAAKqH,GAASrH,EAAMmH,EAAMnH,EAAKqH,IAW/EC,EAAS,SAAU9B,GAAO,OAAOA,EAAI9Q,OAAOC,EAAS,KAyBrD4S,EAkBJ,SAAkBC,EAAgBC,GAErC,YADe,IAAXA,IAAqBA,EAAS,kBAC3B,SAAU1H,GACb,IAAI3T,EAASob,EAAezH,GAC5B,IAAK3T,EACD,MAAM,IAAImM,OAAM,QAAWkP,GAAUA,EAAO1H,GAAO0H,GAEvD,OAAOrb,IA2BR,SAASqY,IAEZ,IADA,IAAIhd,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,GAAoB,IAAhBne,EAAKyN,OACL,MAAO,GAwBX,IAvBA,IAAIwS,EAAcjgB,EAAKiN,QAAO,SAAUiT,EAAKnC,GAAO,OAAOoC,KAAKD,IAAInC,EAAItQ,OAAQyS,KAAS,kBACrFvb,EAAS,GACTyb,EAAU,SAAU1E,GAGpB,OAAQ1b,EAAKyN,QACT,KAAK,EACD9I,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,KACrB,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KACjC,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KAC7C,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KACzD,MACJ,QACI/W,EAAO7F,KAAKkB,EAAKgN,KAAI,SAAU4Q,GAAS,OAAOA,EAAMlC,SAIxDA,EAAI,EAAGA,EAAIuE,EAAavE,IAC7B0E,EAAQ1E,GAEZ,OAAO/W,EAsBJ,SAASyS,EAAWmH,EAAM8B,GAC7B,IAAInc,EAAKrB,EAGT,IAFI,QAAQwd,KACRnc,EAAMmc,EAAY,GAAIxd,EAAQwd,EAAY,MACzC,QAASnc,GACV,MAAM,IAAI4M,MAAM,oCAEpB,OADAyN,EAAKra,GAAOrB,EACL0b,EAGJ,SAAS1S,EAAKkS,GACjB,OAAQA,EAAItQ,QAAUsQ,EAAIA,EAAItQ,OAAS,SAAO+E,EAK3C,SAAS8N,EAAKC,EAAKC,GAKtB,OAJIA,GACA5O,OAAOC,KAAK2O,GAAMphB,SAAQ,SAAU8E,GAAO,cAAcsc,EAAKtc,MAC7Dsc,IACDA,EAAO,IACJrhB,EAAOqhB,EAAMD,GA6DjB,IAAIE,EAA2B,SAAU3e,GAAW,OAAOA,EAAQ4e,OAAM,SAAUC,GAAK,OAAO,MAAS7e,GACpG8e,EAAkB,SAAUld,GAAS,OAAO+c,EAAyB,cAAmB/c,qHCxhBnG,IAGWmd,EAAW,SAAU/K,EAASgL,GACrC,OAAOA,EAAQ7T,QAAO,SAAUsL,EAAKrU,GAAO,OAASqU,EAAIrU,IAJtC6c,EAIoDjL,EAAU,IAAM5R,EAAM,KAJzD,WACpC,MAAM,IAAI4M,MAAM,yBAA2BiQ,EAAS,kEAGiDxI,EAJ5F,IAAUwI,IAI2F,KAE9G3R,EAAW,CACXhK,QAAIoN,EACJ5D,eAAW4D,mGCyCf,IAAIwO,EAAsB,WACtB,SAASA,EAAKC,GACV5iB,KAAK4iB,KAAOA,EACZ5iB,KAAK6iB,KAAOD,EAAKE,MAAM,KACvB,IAAIC,EAAe/iB,KAAK4iB,KACnBE,MAAM,KACNnU,KAAI,SAAUqU,GACf,MAAY,OAARA,EACO,qBACC,MAARA,EACO,WACJ,MAAQA,KAEd/P,KAAK,IACVjT,KAAKijB,OAAS,IAAI9Z,OAAO,IAAM4Z,EAAe,KAalD,OAVAJ,EAAKzJ,GAAK,SAAU0J,GAChB,QAAS,SAASnZ,KAAKmZ,IAG3BD,EAAKxR,WAAa,SAAUyR,GACxB,OAAOD,EAAKzJ,GAAG0J,GAAQ,IAAID,EAAKC,GAAQ,MAE5CD,EAAK9gB,UAAUqhB,QAAU,SAAU1d,GAC/B,OAAOxF,KAAKijB,OAAOE,KAAK,IAAM3d,IAE3Bmd,EA3Bc,+MC1CzB,IAAIxF,EAAkD,WAClD,IAAK,IAAIC,EAAI,EAAGC,EAAI,EAAGC,EAAKtb,UAAUoN,OAAQiO,EAAIC,EAAID,IAAKD,GAAKpb,UAAUqb,GAAGjO,OACxE,IAAImO,EAAI3b,MAAMwb,GAAII,EAAI,EAA3B,IAA8BH,EAAI,EAAGA,EAAIC,EAAID,IACzC,IAAK,IAAII,EAAIzb,UAAUqb,GAAIK,EAAI,EAAGC,EAAKF,EAAErO,OAAQsO,EAAIC,EAAID,IAAKF,IAC1DD,EAAEC,GAAKC,EAAEC,GACjB,OAAOH,GA2CJ,SAAS6F,EAAMziB,GAClB,OAAO,SAAS0iB,IACZ,GAAIrhB,UAAUoN,QAAUzO,EAAGyO,OACvB,OAAOzO,EAAGwB,MAAMnC,KAAMgC,WAE1B,IAAIL,EAAOC,MAAMC,UAAUC,MAAMC,KAAKC,WACtC,OAAOqhB,EAAQ/f,KAAKnB,MAAMkhB,EAASlG,EAAe,CAACnd,MAAO2B,KAS3D,SAAS2hB,IACZ,IAAI3hB,EAAOK,UACPuhB,EAAQ5hB,EAAKyN,OAAS,EAC1B,OAAO,WAEH,IADA,IAAIiO,EAAIkG,EAAOjd,EAAS3E,EAAK4hB,GAAOphB,MAAMnC,KAAMgC,WACzCqb,KACH/W,EAAS3E,EAAK0b,GAAGtb,KAAK/B,KAAMsG,GAChC,OAAOA,GASR,SAASkd,IAEZ,IADA,IAAIC,EAAQ,GACH3D,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpC2D,EAAM3D,GAAM9d,UAAU8d,GAE1B,OAAOwD,EAAQnhB,MAAM,KAAM,GAAGL,MAAMC,KAAKC,WAAWge,WAQjD,IAAI0D,EAAO,SAAUle,GAAQ,OAAO,SAAUyU,GAAO,OAAOA,GAAOA,EAAIzU,KAQnEme,EAASP,GAAM,SAAU5d,EAAMoe,EAAM3J,GAAO,OAAOA,GAAOA,EAAIzU,KAAUoe,KASxE3c,EAAQ,SAAUzB,GAAQ,OAAOge,EAAKrhB,MAAM,KAAMqD,EAAKsd,MAAM,KAAKnU,IAAI+U,KAKtEG,EAAM,SAAUljB,GAAM,OAAO,WAEpC,IADA,IAAIgB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAQnf,EAAGwB,MAAM,KAAMR,KAMpB,SAASmiB,EAAIC,EAAKC,GACrB,OAAO,WAEH,IADA,IAAIriB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAOiE,EAAI5hB,MAAM,KAAMR,IAASqiB,EAAI7hB,MAAM,KAAMR,IAOjD,SAASsiB,EAAGF,EAAKC,GACpB,OAAO,WAEH,IADA,IAAIriB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAOiE,EAAI5hB,MAAM,KAAMR,IAASqiB,EAAI7hB,MAAM,KAAMR,IASjD,IAAI8Z,EAAM,SAAUsI,GAAO,OAAO,SAAUrE,GAAO,OAAOA,EAAI9Q,QAAO,SAAUgQ,EAAGtP,GAAK,OAAOsP,KAAOmF,EAAIzU,MAAO,KAE5G4U,EAAM,SAAUH,GAAO,OAAO,SAAUrE,GAAO,OAAOA,EAAI9Q,QAAO,SAAUgQ,EAAGtP,GAAK,OAAOsP,KAAOmF,EAAIzU,MAAO,KAE5G4J,EAAK,SAAUiL,GAAQ,OAAO,SAAUlK,GAC/C,OAAe,MAAPA,GAAeA,EAAImK,cAAgBD,GAASlK,aAAekK,IAK5DngB,EAAM,SAAUqgB,GAAK,OAAO,WAAc,OAAOA,IA4CrD,SAASC,EAAQC,GACpB,OAAO,SAAUjV,GACb,IAAK,IAAI+N,EAAI,EAAGA,EAAIkH,EAAOnV,OAAQiO,IAC/B,GAAIkH,EAAOlH,GAAG,GAAG/N,GACb,OAAOiV,EAAOlH,GAAG,GAAG/N,uRCjNhCkV,EAAQjR,OAAO1R,UAAUiT,SACzB2P,EAAM,SAAU5F,GAAK,OAAO,SAAUvP,GAAK,cAAcA,IAAMuP,IACxD6F,EAAcD,EAAI,aAClB7X,GAAY,QAAI8X,GAChBC,EAAS,SAAUC,GAAK,OAAa,OAANA,GAC/BC,GAAoB,IAAAZ,IAAGU,EAAQD,GAC/BtX,EAAaqX,EAAI,YACjBK,EAAWL,EAAI,UACf3b,EAAW2b,EAAI,UACftR,EAAW,SAAU7D,GAAK,OAAa,OAANA,GAA2B,iBAANA,GACtD0C,EAAUpQ,MAAMoQ,QAChB+S,EAAS,SAAWzV,GAAK,MAAyB,kBAAlBkV,EAAMziB,KAAKuN,IAC3C0V,EAAW,SAAW1V,GAAK,MAAyB,oBAAlBkV,EAAMziB,KAAKuN,IAOjD,SAASsM,EAAa5X,GACzB,GAAIgO,EAAQhO,IAAQA,EAAIoL,OAAQ,CAC5B,IAAI6V,EAAOjhB,EAAIlC,MAAM,GAAI,GAAI0L,EAAOxJ,EAAIlC,OAAO,GAC/C,QAASmjB,EAAK3b,QAAO,QAAIR,IAAWsG,QAAU5B,EAAKlE,QAAO,QAAI8D,IAAagC,QAE/E,OAAOhC,EAAWpJ,GAOf,IAAIkhB,GAAY,QAAI/R,GAAU,SAAK,QAAK,QAAS/F,uKCvCpD+X,EAAuB,WACvB,SAASA,EAAMC,EAAQC,QACJ,IAAXD,IAAqBA,EAAS,SACnB,IAAXC,IAAqBA,EAAS,MAClCrlB,KAAKolB,OAASA,EACdplB,KAAKqlB,OAASA,EACdrlB,KAAKslB,gBAAkB,GACvBtlB,KAAKulB,SAAU,QAAOvlB,KAAKslB,iBAqC/B,OAnCAH,EAAMtjB,UAAU2jB,QAAU,SAAUrF,GAChC,IAAIsF,EAAQzlB,KAAKolB,OAIjB,OAHAK,EAAMhlB,KAAK0f,GACPngB,KAAKqlB,QAAUI,EAAMrW,OAASpP,KAAKqlB,QACnCrlB,KAAK0lB,QACFvF,GAEXgF,EAAMtjB,UAAU6jB,MAAQ,WACpB,IAAIvF,EAAOngB,KAAKolB,OAAOnjB,QAEvB,OADAjC,KAAKslB,gBAAgBvkB,SAAQ,SAAUJ,GAAM,OAAOA,EAAGwf,MAChDA,GAEXgF,EAAMtjB,UAAU8jB,QAAU,WACtB,GAAI3lB,KAAK4lB,OACL,OAAO5lB,KAAKolB,OAAO5F,OAAO,EAAG,GAAG,IAExC2F,EAAMtjB,UAAUgkB,MAAQ,WACpB,IAAIC,EAAU9lB,KAAKolB,OAEnB,OADAplB,KAAKolB,OAAS,GACPU,GAEXX,EAAMtjB,UAAU+jB,KAAO,WACnB,OAAO5lB,KAAKolB,OAAOhW,QAEvB+V,EAAMtjB,UAAUgL,OAAS,SAAUsT,GAC/B,IAAIlR,EAAMjP,KAAKolB,OAAOlX,QAAQiS,GAC9B,OAAOlR,GAAO,GAAKjP,KAAKolB,OAAO5F,OAAOvQ,EAAK,GAAG,IAElDkW,EAAMtjB,UAAUkkB,SAAW,WACvB,OAAO/lB,KAAKolB,OAAOplB,KAAKolB,OAAOhW,OAAS,IAE5C+V,EAAMtjB,UAAUmkB,SAAW,WACvB,GAAIhmB,KAAK4lB,OACL,OAAO5lB,KAAKolB,OAAO,IAEpBD,EA5Ce,4KCKtBc,EAAkB,CAAEC,IAAK,KAAM7gB,MAAO,KAAM8gB,MAAO,MA4B5CC,EAXyB,oBAAbC,UAA4BA,SAASC,cAA0C,IAA1BD,SAASC,aAEtEC,QAAUA,OAAOC,QAlBhC,SAAoBA,GAChB,IAAIC,EAAQ,SAAU9lB,GAAM,OAAO+lB,SAAS7kB,UAAUyB,KAAKvB,KAAKpB,EAAI6lB,IACpE,MAAO,CACHN,IAAKO,EAAMD,EAAQN,KACnB7gB,MAAOohB,EAAMD,EAAQN,KACrBC,MAAOM,EAAMD,EAAQN,MAaaS,CAAWJ,OAAOC,SAAWP,EAEzDO,QAAQL,OAAUK,QAAQnhB,MAIzBmhB,QAhBf,SAAyBA,GACrB,IAAIN,EAAMM,EAAQN,IAAI5iB,KAAKkjB,GAG3B,MAAO,CAAEN,IAAKA,EAAK7gB,MAFPmhB,EAAQnhB,MAAQmhB,EAAQnhB,MAAM/B,KAAKkjB,GAAWN,EAEzBC,MADrBK,EAAQL,MAAQK,EAAQL,MAAM7iB,KAAKkjB,GAAWN,GAU/CU,CAAgBJ,ieCRxB,SAASK,EAAUC,EAAK9V,GAC3B,OAAIA,EAAI5B,QAAU0X,EACP9V,EACJA,EAAI+V,OAAO,EAAGD,EAAM,GAAK,MAW7B,SAASE,EAAU5X,EAAQ4B,GAC9B,KAAOA,EAAI5B,OAASA,GAChB4B,GAAO,IACX,OAAOA,EAEJ,SAAS/H,EAAYqJ,GACxB,OAAOA,EACFyC,QAAQ,YAAY,SAAUkS,GAAM,OAAOA,EAAGC,iBAC9CnS,QAAQ,YAAY,SAAUkS,GAAM,MAAO,IAAMA,EAAGC,iBAEtD,SAASC,EAAiBxmB,GAC7B,IAAIymB,EAAQC,EAAW1mB,GACnB2mB,EAAqBF,EAAMpL,MAAM,8BACjCwI,EAAQ8C,EAAqBA,EAAmB,GAAKF,EACrDjI,EAASxe,EAAS,MAAK,GAC3B,OAAIwe,GAAUqF,EAAMxI,MAAM,eACf,YAAcmD,EAASqF,EAAMuC,OAAO,GAExCvC,EAEJ,SAAS6C,EAAW1mB,GACvB,IAAI4mB,GAAM,QAAQ5mB,GAAMA,EAAGmB,OAAO,GAAG,GAAKnB,EAC1C,OAAQ4mB,GAAOA,EAAIzS,YAAe,YAEtC,IAAI0S,EAAc,uBAIdC,GAAmB,QAAQ,CAC3B,CAAC,MAAa,QAAI,cAClB,CAAC,MAAQ,QAAI,SACb,CAAC,MAAW,QAAI,cAChB,CAACD,EAAa,SAAUlY,GAAK,OAAOA,EAAEoY,qBAAqB5S,aAC3D,CARc,SAAUmF,GACxB,OAAO,QAASA,MAAS,QAAQA,IAAQA,EAAImK,cAAgB7Q,SAAU,QAAW0G,EAAInF,WAOxE,SAAUxF,GAAK,OAAOA,EAAEwF,aACtC,CAAC,KAAcqS,GACf,EAAC,SAAI,GAAO,QAET,SAASjJ,EAAU0G,GACtB,IAAI+C,EAAO,GACX,SAASC,EAAOpjB,GACZ,IAAI,QAASA,GAAQ,CACjB,IAA6B,IAAzBmjB,EAAKzZ,QAAQ1J,GACb,MAAO,iBACXmjB,EAAKlnB,KAAK+D,GAEd,OAAOijB,EAAiBjjB,GAE5B,OAAI,QAAYogB,GAILgD,EAAOhD,GAEX5G,KAAKE,UAAU0G,GAAG,SAAU/e,EAAKrB,GAAS,OAAOojB,EAAOpjB,MAAWuQ,QAAQ,OAAQ,KAGvF,IAAI8S,EAAoB,SAAUC,GAAQ,OAAO,SAAU9W,GAC9D,IAAKA,EACD,MAAO,CAAC,GAAI,IAChB,IAAI/B,EAAM+B,EAAI9C,QAAQ4Z,GACtB,OAAa,IAAT7Y,EACO,CAAC+B,EAAK,IACV,CAACA,EAAI+V,OAAO,EAAG9X,GAAM+B,EAAI+V,OAAO9X,EAAM,MAGtC8Y,EAAuB,SAAU/W,GAAO,OAAOA,EAAI+D,QAAQ,WAAY,KACvEiT,EAAYH,EAAkB,KAC9BI,EAAaJ,EAAkB,KAC/BK,EAAaL,EAAkB,KAC/BM,EAAc,SAAUnX,GAAO,OAAQA,EAAMA,EAAI+D,QAAQ,KAAM,IAAM,IAWzE,SAASqT,EAAaC,GACzB,IAAIC,EAAK,IAAInf,OAAO,IAAMkf,EAAQ,IAAK,KACvC,OAAO,SAAUrX,GAAO,OAAOA,EAAI8R,MAAMwF,GAAIhf,OAAO,OAcjD,SAASif,EAAerO,EAAK5K,GAChC,OAAI,SAAS,QAAK4K,MAAS,QAAS5K,GACzB4K,EAAIpY,MAAM,GAAI,GAAGM,QAAO,QAAK8X,GAAO5K,IACxC,QAAM4K,EAAK5K,0GCpElBkZ,iQA3BJ,SAASC,EAAaC,GAClB,IAAKA,EACD,MAAO,oBACX,IAAIjb,EAAQib,EAAOC,gBAAkBD,EAAOC,gBAAgBnjB,MAAQ,SAAW,SAC/E,MAAO,YAAckjB,EAAOrd,GAAK,IAAMqd,EAAOtd,MAAQ,IAAMsd,EAAOpd,IAAM,KAAOod,EAAOljB,KAAO,IAAMiI,EAAQ,KAOhH,SAASmb,EAAchW,GACnB,OAAO,QAASA,GAAS4V,EAAS5V,GAAS4V,EAASA,EAAS5V,KAgBjE,SAAW4V,GACPA,EAASA,EAAkB,QAAI,GAAK,UACpCA,EAASA,EAAqB,WAAI,GAAK,aACvCA,EAASA,EAAe,KAAI,GAAK,OACjCA,EAASA,EAAiB,OAAI,GAAK,SACnCA,EAASA,EAAqB,WAAI,GAAK,aAL3C,CAMGA,IAAaA,EAAW,KAE3B,IAAIK,GAAO,QAAM,OACbC,GAAO,QAAM,cACbC,EAAW,SAAUnZ,GAAS,MAAO,eAAiBiZ,EAAKjZ,GAAS,IAAMkZ,EAAKlZ,IA6J/EvH,EAAQ,IAzJe,WAEvB,SAAS2gB,IAELhpB,KAAKipB,SAAW,GAChBjpB,KAAKkpB,mBAAqB,EAwI9B,OArIAF,EAAMnnB,UAAUsnB,KAAO,SAAU7T,EAAS8T,GACtC,IAAIjZ,EAAQnQ,KACPopB,EAAWha,SACZga,EAAa7V,OAAOC,KAAKgV,GACpB7Z,KAAI,SAAU6O,GAAK,OAAO6L,SAAS7L,EAAG,OACtClU,QAAO,SAAUkU,GAAK,OAAQ8L,MAAM9L,MACpC7O,KAAI,SAAU9I,GAAO,OAAO2iB,EAAS3iB,OAE9CujB,EAAWza,IAAIia,GAAe7nB,SAAQ,SAAUwoB,GAAY,OAAQpZ,EAAM8Y,SAASM,GAAYjU,MAEnG0T,EAAMnnB,UAAU2nB,OAAS,WAErB,IADA,IAAIJ,EAAa,GACRtJ,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCsJ,EAAWtJ,GAAM9d,UAAU8d,GAE/B9f,KAAKmpB,MAAK,EAAMC,IAEpBJ,EAAMnnB,UAAU4nB,QAAU,WAEtB,IADA,IAAIL,EAAa,GACRtJ,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCsJ,EAAWtJ,GAAM9d,UAAU8d,GAE/B9f,KAAKmpB,MAAK,EAAOC,IAWrBJ,EAAMnnB,UAAUyT,QAAU,SAAUiU,GAChC,QAASvpB,KAAKipB,SAASL,EAAcW,KAGzCP,EAAMnnB,UAAU6nB,qBAAuB,SAAU9Z,GACxC5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,KAGnEoZ,EAAMnnB,UAAU+nB,uBAAyB,SAAUha,GAC1C5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,KAGnEoZ,EAAMnnB,UAAUgoB,oBAAsB,SAAUC,EAAMla,EAAOzP,GACzD,GAAKH,KAAKsV,QAAQkT,EAASuB,MAA3B,CAEA,IAAIxpB,GAAQ,QAAM,qBAAN,CAA4BJ,IAAY,WAAY0Q,GAAU,QAAM,+BAAN,CAAsC1Q,KAAY,QAAM,oBAAN,CAA2BA,IAAY,UAAWqF,GAAO,QAAiBskB,EAAKE,eAAexpB,UAC1N,QAAgBuoB,EAASnZ,GAAS,eAAiBrP,EAAQ,aAAesQ,EAAU,MAAO,QAAU,IAAKrL,MAG9GwjB,EAAMnnB,UAAUooB,gBAAkB,SAAUC,EAAYta,EAAOua,GACtDnqB,KAAKsV,QAAQkT,EAASuB,OAE3B,QAAgBhB,EAASnZ,GAAS,0BAA2B,QAAU,KAAK,QAAUsa,MAG1FlB,EAAMnnB,UAAUuoB,iBAAmB,SAAUjiB,EAAM8H,EAAML,GAChD5P,KAAKsV,QAAQkT,EAAS6B,UAE3B,QAAgBtB,EAASnZ,GAAS,uBAAyBzH,EAAO,KAAO8H,EAAO,MAGpF+Y,EAAMnnB,UAAUyoB,wBAA0B,SAAUtS,EAAYpI,GACvD5P,KAAKsV,QAAQkT,EAAS6B,UAE3B,QAAgBtB,EAASnZ,GAAS,gCAAkCoI,EAAa,SAAU,QAAU,KAAK,QAAUA,EAAWrQ,SAGnIqhB,EAAMnnB,UAAU0oB,WAAa,SAAUC,EAAQ5a,GACtC5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,GAAS,aAAe4a,IAG3FxB,EAAMnnB,UAAU4oB,aAAe,SAAUC,EAAY9a,GAC5C5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,GAAS,kBAAoB8a,EAAWllB,OAG3GwjB,EAAMnnB,UAAU8oB,iBAAmB,SAAUpqB,EAAOqqB,EAAUvL,QAC5C,IAAVA,IAAoBA,EAAQ,IAC3Brf,KAAKsV,QAAQkT,EAASqC,SAE3B,QAAgB,aAAc,QAAU,GAAItqB,GAAS,IAAMkoB,EAAamC,GAAYvL,IAGxF2J,EAAMnnB,UAAUipB,yBAA2B,SAAUF,EAAU/Z,GACtD7Q,KAAKsV,QAAQkT,EAASqC,SAE3B7qB,KAAK2qB,iBAAiB,WAAYC,EAAU,kCAAoC/Z,EAAU,MAG9FmY,EAAMnnB,UAAUkpB,gBAAkB,SAAUH,EAAUpjB,GAC7CxH,KAAKsV,QAAQkT,EAASqC,SAE3B7qB,KAAK2qB,iBAAiB,OAAQC,EAAU,WAAY,QAAU,IAAKpjB,KAGvEwhB,EAAMnnB,UAAUmpB,cAAgB,SAAUC,GACtC,GAAKjrB,KAAKsV,QAAQkT,EAAS0C,YAA3B,CAEA,IAAIC,EAAY,uBAEZC,EAAUH,EACTtc,KAAI,SAAU0c,GACf,IAAIC,EACA7kB,EAAS4kB,EAAG5kB,OAAQiE,EAAa2gB,EAAG3gB,WACpC6gB,EAAM9kB,GAAUA,EAAO6E,IACvBzD,EAAM6C,GAAcA,EAAW3C,SAASgC,SAASvE,KAAO,MAAQkF,EAAW3C,SAAS6S,MAAQ,IAChG,OAAO0Q,EAAK,IAAOH,GAAaI,EAAKD,EAPzB,iCAOyCzjB,EAAKyjB,KAEzDE,MAAK,SAAU/N,EAAGmB,GAAK,OAAQnB,EAAE0N,IAAc,IAAIM,cAAc7M,EAAEuM,IAAc,OACtF,UAAkBC,KAGtBpC,EAAMnnB,UAAU6pB,sBAAwB,SAAUnrB,EAAOmK,GAChD1K,KAAKsV,QAAQkT,EAAS0C,aAE3B,QAAgB,eAAiB3qB,EAAQ,IAzK1B,SAAUmK,GAC7B,IAAIoP,EAAOpP,EAAW3C,SAClB0F,EAAQqM,EAAK/P,SAASvE,MAAQ,SAClC,MAAO,SAAWkF,EAAWyQ,IAAM,UAAY1N,EAAQ,8BAAgCqM,EAAKiB,YAAc,IAAMjB,EAAKmB,qBAAuB,IAsKzF0Q,CAAiBjhB,KAGpEse,EAAMnnB,UAAU+pB,4BAA8B,SAAUrrB,EAAOqqB,GACtD5qB,KAAKsV,QAAQkT,EAAS0C,aAE3B,QAAgB,eAAiB3qB,EAAQ,IAAMkoB,EAAamC,KAEzD5B,EA7Ie,oOCxEtB6C,EAAiC,WACjC,SAASA,IAML7rB,KAAKoO,OAAS,IAAI,IAElBpO,KAAK8rB,yBAA2B,EAEhC9rB,KAAK+rB,kBAAoB,IAAI,IAAM,GAAI,GAEvC/rB,KAAKgsB,sBAAwB,IAAI,IAAM,GAAI,GAO/C,OALAH,EAAgBhqB,UAAUqT,QAAU,WAChClV,KAAK+rB,kBAAkBlG,QACvB7lB,KAAKgsB,sBAAsBnG,QAC3B7lB,KAAKisB,WAAa,MAEfJ,EApByB,sLCiBhCK,EAAe,SAAUD,GACzB,IAAIvX,EAASuX,EAAWvX,OAuBpB6G,EAAW0Q,EACVE,WACA7iB,QAAO,SAAUmE,GAAS,QAASA,EAAMuG,UAAUoY,YACnDzd,KAAI,SAAUlB,GAAS,OAAO4e,EAAcJ,EAAYxe,MAC7D,OAAO,WAAgB8N,GAAUxQ,MA1BjC,WACI,GAAyD,QAArDkhB,EAAWK,qBAAqBnsB,UAAU4e,OAAkB,CAG5D,IAAIwN,EAAON,EAAWO,cACtB,OAAO9X,EAAOmC,aAAaxQ,OAAOkmB,EAAKE,aAAcF,EAAKne,SAAUme,EAAKpsB,WAI7E,IAAIusB,EAAOhY,EAAOuC,WACd3Q,EAASomB,EAAK1Q,MAAM0Q,EAAKC,SACzBpQ,EAAOjW,GAAUA,EAAOiW,KAG5B,GAAIA,GAAsB,UAAdA,EAAKrN,KAAkB,CAC/B,IAAIzB,EAAQ8O,EAAK9O,MACbW,EAAS9H,EAAO0V,MACpB,OAAOtH,EAAOmC,aAAaxQ,OAAOoH,EAAOW,EAAQ6d,EAAW9rB,WAGhEuU,EAAOuC,WAAW2V,WAQfC,EAAuB,SAAUC,GACxC,OAAOA,EAAkB/c,SAAS,CAAEoc,SAAU,SAAU1e,GAAS,QAASA,EAAM2e,WAAeF,IAS5F,SAASG,EAAcJ,EAAYxe,GACtC,IAAIsf,EAAatf,EAAMuG,UAAUoY,SAE7B3oB,EAAUspB,EAAqB,SAwBnC,OAvBKtpB,IAWDA,EAAUspB,EAAqB,SAAI,YACzBA,EAAWd,EAAYxe,IAC5B1C,MAIT,SAA6BzE,GAIzB,OAHIA,GAAU1E,MAAMoQ,QAAQ1L,EAAO0mB,SAC/B1mB,EAAO0mB,OAAOjsB,SAAQ,SAAUksB,GAAU,OAAOhB,EAAWvX,OAAOkC,cAAc8C,SAASuT,MAEvF3mB,KAPFyE,MAbS,SAAUzE,GAIpB,cAHOmH,EAAM2e,gBACN3e,EAAMuG,UAAUoY,gBAChBW,EAAqB,SACrBzmB,KAEC,SAAU4mB,GAElB,cADOH,EAAqB,SACrB,cAAmBG,OAc3BzpB,oPCnFP0pB,kUAJAC,EAAS7Z,OAAO1R,UAAUa,gBAK9B,SAAWyqB,GACPA,EAAQA,EAAc,KAAI,GAAK,OAC/BA,EAAQA,EAAgB,OAAI,GAAK,SACjCA,EAAQA,EAAgB,OAAI,GAAK,SAHrC,CAIGA,IAAYA,EAAU,KA2DzB,IAAIE,EAAuB,WACvB,SAASA,EAAMhiB,EAAI6D,EAAM2G,EAAUyX,EAAW7f,GAC1C,IAAIlC,EA3DZ,SAA6BgiB,EAAW1X,EAAUpI,GAC9C,IAAI+f,GAA6C,IAAzB/f,EAAMggB,gBAA4B5X,IAAasX,EAAQO,aAAWvZ,EACtFwZ,GAAU,QAAK,CAAClgB,EAAMkgB,QAASH,GAAmB,MAClDI,GAAgB,QAAUD,GAAW,CAAEA,QAASA,GAAY,GAC5DE,EAGR,SAAyBhmB,GAGrB,SAASimB,IACL,OAAOjmB,EAAIrD,MAHfqD,EAlBc,SAAUA,GACxB,OAAiG,IAA1F,CAAC,QAAS,OAAQ,SAAU,QAAS,WAAWyB,OAAO8jB,EAAO9pB,KAAKuE,GAAO,KAAKuH,OAiBhF2e,CAAYlmB,GAAO,CAAErD,MAAOqD,GAAQA,EAC1CimB,EAAmC,aAAI,EAIvC,IAAIE,GAAO,QAAanmB,EAAIrD,OAASqD,EAAIrD,MAAQspB,EACjD,OAAO,QAAOjmB,EAAK,CAAEmmB,KAAMA,IAVTC,CAAgBxgB,GAASA,EAAMW,QAAUX,EAAMW,OAAOmf,IACxE,OAAO,QAAOK,EAAeC,GAsDZK,CAAoB7iB,EAAIwK,EAAUpI,GAC/CyB,EA5CR,SAAiBrH,EAAKsmB,EAAStY,EAAUxK,EAAI+iB,GACzC,GAAIvmB,EAAIqH,MAAQif,GAA4B,WAAjBA,EAAQ3oB,KAC/B,MAAM,IAAIiN,MAAM,UAAYpH,EAAK,kCACrC,GAAIxD,EAAIqH,MAAQif,GAA4B,WAAjBA,EAAQ3oB,MAAqB4oB,EAAWlf,KAAKrH,EAAIqH,MACxE,OAAOkf,EAAWlf,KAAKrH,EAAIqH,MAC/B,GAAIif,EACA,OAAOA,EACX,IAAKtmB,EAAIqH,KAAM,CACX,IAAIA,EAAO2G,IAAasX,EAAQkB,OAC1B,MACAxY,IAAasX,EAAQmB,KACjB,OACAzY,IAAasX,EAAQO,OACjB,QACA,SACd,OAAOU,EAAWlf,KAAKA,GAE3B,OAAOrH,EAAIqH,gBAAgB,IAAYrH,EAAIqH,KAAOkf,EAAWlf,KAAKrH,EAAIqH,MA2B3Dqf,CAAQhjB,EAAQ2D,EAAM2G,EAAUxK,EAAIiiB,EAAUc,YACrD,IAUQI,EACAC,EAXJC,GAUIF,EAAgB,CAAEjP,MAAO1J,IAAasX,EAAQO,QAAS,QACvDe,EAAyBpjB,EAAG2Q,MAAM,SAAW,CAAEuD,OAAO,GAAS,IAC5D,QAAOiP,EAAeC,EAAwBljB,GAAQgU,OAXjErQ,EAAOwf,EAAYxf,EAAKyf,SAASD,EAAW7Y,IAAasX,EAAQO,QAAUxe,EAC3E,IAAI0f,OAA8Bza,IAAjB5I,EAAO/G,OAAuBqR,IAAasX,EAAQO,OAChEC,GAAU,QAAUpiB,EAAOoiB,WAAapiB,EAAOoiB,UAAYze,EAAKye,QAChEkB,GAAM,QAAUtjB,EAAOsjB,OAAStjB,EAAOsjB,MAAQ3f,EAAK2f,IACpDC,EA9BZ,SAAyBvjB,EAAQqjB,EAAYG,GACzC,IAAID,EAASvjB,EAAOujB,OACpB,IAAKF,IAAyB,IAAXE,EACf,OAAO,EACX,KAAK,QAAUA,IAAqB,MAAVA,EACtB,OAAOC,EACX,IAAe,IAAXD,IAAmB,QAASA,GAC5B,OAAOA,EACX,MAAM,IAAIrc,MAAM,2BAA6Bqc,EAAS,uDAsBrCE,CAAgBzjB,EAAQqjB,EAAYtB,EAAU2B,uBACvDla,EArBZ,SAAoBxJ,EAAQmjB,EAAWE,EAAYE,GAC/C,IAAIC,EAAgB,CAChB,CAAEG,KAAM,GAAIC,GAAIP,GAAcF,OAAYva,EAAY,IACtD,CAAE+a,KAAM,KAAMC,GAAIP,GAAcF,OAAYva,EAAY,KAExDY,GAAU,QAAQxJ,EAAOwJ,SAAWxJ,EAAOwJ,QAAU,IACrD,QAAS+Z,IACT/Z,EAAQtU,KAAK,CAAEyuB,KAAMJ,EAAQK,QAAIhb,IACrC,IAAIib,GAAiB,QAAIra,GAAS,QAAK,SACvC,OAAO,QAAOga,GAAe,SAAU5O,GAAQ,OAA8C,IAAvCiP,EAAelhB,QAAQiS,EAAK+O,SAAiB9sB,OAAO2S,GAYxFsa,CAAW9jB,EAAQmjB,EAAWE,EAAYE,GACpD1P,GAAU,QAAU7T,EAAO6T,WAAa7T,EAAO6T,UAAYlQ,EAAKkQ,SAOpE,QAAOpf,KAAM,CAAEqL,GAAIA,EAAI6D,KAAMA,EAAM2G,SAAUA,EAAU+Y,WAAYA,EAAYjB,QAASA,EAASkB,IAAKA,EAAKC,OAAQA,EAAQ/Z,QAASA,EAASqK,QAASA,EAASG,MAAOmP,EAAWnjB,OAAQA,IAoG7L,OAlGA8hB,EAAMrM,OAAS,SAAU5S,EAAQ4S,QACd,IAAXA,IAAqBA,EAAS,IAElC,IADA,IAAI1F,EAAc,GACTwE,EAAK,EAAGwP,EAAWlhB,EAAQ0R,EAAKwP,EAASlgB,OAAQ0Q,IAAM,CAC5D,IAAI9Q,EAAQsgB,EAASxP,GACrBxE,EAAYtM,EAAM3D,IAAM2D,EAAMxK,MAAMwc,EAAOhS,EAAM3D,KAErD,OAAOiQ,GAaX+R,EAAMkC,QAAU,SAAUnhB,EAAQohB,EAASC,GAGvC,YAFgB,IAAZD,IAAsBA,EAAU,SACpB,IAAZC,IAAsBA,EAAU,IAC7BrhB,EAAO9E,QAAO,SAAU0F,GAAS,OAAQA,EAAME,KAAKC,OAAOqgB,EAAQxgB,EAAM3D,IAAKokB,EAAQzgB,EAAM3D,SAWvGgiB,EAAMle,OAAS,SAAUf,EAAQohB,EAASC,GAGtC,YAFgB,IAAZD,IAAsBA,EAAU,SACpB,IAAZC,IAAsBA,EAAU,IACsB,IAAnDpC,EAAMkC,QAAQnhB,EAAQohB,EAASC,GAASrgB,QAGnDie,EAAMqC,UAAY,SAAUthB,EAAQ4S,GAEhC,YADe,IAAXA,IAAqBA,EAAS,IAC3B5S,EAAOO,KAAI,SAAUK,GAAS,OAAOA,EAAM0gB,UAAU1O,EAAOhS,EAAM3D,QAASuD,OAAO,MAAU,IAEvGye,EAAMxrB,UAAU8tB,eAAiB,SAAUnrB,GACvC,OAAOxE,KAAK4uB,YAAc5uB,KAAKkP,KAAKC,OAAOnP,KAAKwE,QAASA,IAM7D6oB,EAAMxrB,UAAU2C,MAAQ,SAAUA,GAC9B,IAAI2L,EAAQnQ,KA0BZ,OADAwE,EAR2B,SAAUR,GACjC,IAAK,IAAI8b,EAAK,EAAGuL,EAAKlb,EAAM4E,QAAS+K,EAAKuL,EAAGjc,OAAQ0Q,IAAM,CACvD,IAAIrM,EAAQ4X,EAAGvL,GACf,GAAIrM,EAAMyb,OAASlrB,EACf,OAAOyP,EAAM0b,GAErB,OAAOnrB,EAEH4rB,CAAqBprB,IACtB,QAAYA,GAtBG,WAClB,GAAI2L,EAAM0f,mBACN,OAAO1f,EAAM0f,mBAAmBC,aACpC,IAAK,cACD,MAAM,IAAIrd,MAAM,+DACpB,IAAIqd,EAAe,qBAA0B3f,EAAM5E,OAAOyiB,MAC1D,GAAI8B,MAAAA,IAAwD3f,EAAMjB,KAAKgK,GAAG4W,GACtE,MAAM,IAAIrd,MAAM,kBAAoBqd,EAAe,oBAAsB3f,EAAM9E,GAAK,sCAAwC8E,EAAMjB,KAAK1J,KAAO,KAIlJ,OAHI2K,EAAM5E,OAAOyiB,KAAkB,cAC/B7d,EAAM0f,mBAAqB,CAAEC,aAAcA,IAExCA,EAWiBC,GAAoB/vB,KAAKkP,KAAK8gB,WAAWxrB,IAEzE6oB,EAAMxrB,UAAUouB,SAAW,WACvB,OAAOjwB,KAAK6V,WAAasX,EAAQO,QAErCL,EAAMxrB,UAAU6tB,UAAY,SAAUlrB,GAElC,KAAK,QAAYA,IAAoB,OAAVA,IAAmBxE,KAAK4uB,WAC/C,OAAO,EAEX,IAAI/T,EAAa7a,KAAKkP,KAAK8gB,WAAWxrB,GACtC,IAAKxE,KAAKkP,KAAKgK,GAAG2B,GACd,OAAO,EAEX,IAAIqV,EAAUlwB,KAAKkP,KAAK2F,OAAOgG,GAC/B,SAAS,QAASqV,KAAalwB,KAAKkP,KAAKoV,QAAQ7a,KAAKymB,KAE1D7C,EAAMxrB,UAAUiT,SAAW,WACvB,MAAO,UAAY9U,KAAKqL,GAAK,IAAMrL,KAAKkP,KAAO,aAAelP,KAAK8uB,OAAS,eAAiB9uB,KAAK4uB,WAAa,KAE5GvB,EAtHe,4OChDtB8C,EAA2B,WAM3B,SAASA,EAAUjd,GAEflT,KAAKskB,QAAU,KAEftkB,KAAKof,SAAU,GACf,QAAOpf,KAAMkT,GAgDjB,OA5CAid,EAAUtuB,UAAUqX,GAAK,SAAUlV,EAAK6B,GACpC,OAAO,GAGXsqB,EAAUtuB,UAAUgT,OAAS,SAAU7Q,EAAK6B,GACxC,OAAO7B,GAGXmsB,EAAUtuB,UAAUoT,OAAS,SAAUjR,EAAK6B,GACxC,OAAO7B,GAGXmsB,EAAUtuB,UAAUsN,OAAS,SAAUsO,EAAGmB,GAEtC,OAAOnB,GAAKmB,GAEhBuR,EAAUtuB,UAAUuuB,YAAc,WAC9B,IAAIC,EAAMrwB,KAAKskB,QAAQxP,WACvB,OAAOub,EAAItJ,OAAO,EAAGsJ,EAAIjhB,OAAS,IAEtC+gB,EAAUtuB,UAAUiT,SAAW,WAC3B,MAAO,cAAgB9U,KAAKwF,KAAO,KAGvC2qB,EAAUtuB,UAAUmuB,WAAa,SAAUhsB,GACvC,OAAOhE,KAAKkZ,GAAGlV,GAAOA,EAAMhE,KAAKiV,OAAOjR,IAY5CmsB,EAAUtuB,UAAU8sB,SAAW,SAAU2B,EAAML,GAC3C,IAAKK,EACD,OAAOtwB,KACX,GAAa,SAATswB,IAAoBL,EACpB,MAAM,IAAIxd,MAAM,kDACpB,OAAO,IAAI8d,EAAUvwB,KAAMswB,IAExBH,EA3DmB,GA+D9B,SAASI,EAAUrhB,EAAMohB,GACrB,IAAIngB,EAAQnQ,KAEZ,SAASwwB,EAAUxsB,GACf,OAAO,QAAQA,GAAOA,GAAM,QAAUA,GAAO,CAACA,GAAO,GAczD,SAASysB,EAAajwB,EAAUkwB,GAC5B,OAAO,SAAqB1sB,GACxB,IAAI,QAAQA,IAAuB,IAAfA,EAAIoL,OACpB,OAAOpL,EACX,IAAI0b,EAAM8Q,EAAUxsB,GAChBsC,GAAS,QAAIoZ,EAAKlf,GACtB,OAAyB,IAAlBkwB,EAAgF,KAAvD,QAAOpqB,GAAQ,SAAUgJ,GAAK,OAAQA,KAAMF,OAjBpF,SAAqBpL,GACjB,OAAQA,EAAIoL,QACR,KAAK,EACD,OACJ,KAAK,EACD,MAAgB,SAATkhB,EAAkBtsB,EAAI,GAAKA,EACtC,QACI,OAAOA,GAUgF2sB,CAAYrqB,IAI/G,SAASsqB,EAAmBpwB,GACxB,OAAO,SAAqBqwB,EAAMC,GAC9B,IAAIC,EAAOP,EAAUK,GAAOG,EAAQR,EAAUM,GAC9C,GAAIC,EAAK3hB,SAAW4hB,EAAM5hB,OACtB,OAAO,EACX,IAAK,IAAIiO,EAAI,EAAGA,EAAI0T,EAAK3hB,OAAQiO,IAC7B,IAAK7c,EAASuwB,EAAK1T,GAAI2T,EAAM3T,IACzB,OAAO,EAEf,OAAO,GAGf,CAAC,SAAU,SAAU,SAAU,cAActc,SAAQ,SAAUyE,GAC3D,IAAIyrB,EAAc/hB,EAAK1J,GAAMlC,KAAK4L,GAC9BgiB,EAAqB,WAAT1rB,EAAoBorB,EAAqBH,EACzDtgB,EAAM3K,GAAQ0rB,EAAUD,OAE5B,QAAOjxB,KAAM,CACT2tB,QAASze,EAAKye,QACdnoB,KAAM0J,EAAK1J,KACX8e,QAASpV,EAAKoV,QACdlF,QAASlQ,EAAKkQ,QACdyP,IAAK3f,EAAK2f,IACV3V,GAAIuX,EAAavhB,EAAKgK,GAAG5V,KAAK4L,IAAO,GACrCiiB,WAAYb,+GC5DZc,kUApDJC,EAA4B,WAC5B,SAASA,IACLrxB,KAAKwlB,SAAU,EACfxlB,KAAKsxB,UAAY,GACjBtxB,KAAKuxB,cAAe,QAAKF,EAAWxvB,UAAW,CAC3C,OACA,SACA,QACA,OACA,MACA,OACA,OACA,OACA,QAIJ7B,KAAK+D,OAAQ,SAAQ,QAAI/D,KAAKuxB,cADf,SAAU9X,EAAYjU,GAAQ,OAAO,IAAI,KAAU,QAAO,CAAEA,KAAMA,GAAQiU,OAClC,IA+B3D,OA7BA4X,EAAWxvB,UAAUqT,QAAU,WAC3BlV,KAAK+D,MAAQ,IAOjBstB,EAAWxvB,UAAUqN,KAAO,SAAU1J,EAAMiU,EAAY+X,GACpD,KAAK,QAAU/X,GACX,OAAOzZ,KAAK+D,MAAMyB,GACtB,GAAIxF,KAAK+D,MAAMrB,eAAe8C,GAC1B,MAAM,IAAIiN,MAAM,iBAAmBjN,EAAO,+BAO9C,OANAxF,KAAK+D,MAAMyB,GAAQ,IAAI,KAAU,QAAO,CAAEA,KAAMA,GAAQiU,IACpD+X,IACAxxB,KAAKsxB,UAAU7wB,KAAK,CAAE+E,KAAMA,EAAM0N,IAAKse,IAClCxxB,KAAKwlB,SACNxlB,KAAKyxB,mBAENzxB,MAEXqxB,EAAWxvB,UAAU4vB,gBAAkB,WACnC,KAAOzxB,KAAKsxB,UAAUliB,QAAQ,CAC1B,IAAIF,EAAOlP,KAAKsxB,UAAUrvB,QAC1B,GAAIiN,EAAKoV,QACL,MAAM,IAAI7R,MAAM,sDACpB,QAAOzS,KAAK+D,MAAMmL,EAAK1J,MAAO,qBAA0B0J,EAAKgE,QAG9Dme,EAhDoB,GAoDvBD,EAAkB,SAAUle,GAC5B,IAAIwe,EAAc,SAAU1tB,GAAO,OAAe,MAAPA,EAAcA,EAAI8Q,WAAa9Q,GACtE2tB,EAAkB,CAClB9c,OAAQ6c,EACRzc,OAAQyc,EACRxY,IAAI,IAAAA,IAAG0Y,QACPtN,QAAS,KAETnV,OAAQ,SAAUsO,EAAGmB,GAAK,OAAOnB,GAAKmB,IAE1C,OAAO,QAAO,GAAI+S,EAAiBze,KAGvC,QAAOme,EAAWxvB,UAAW,CACzB0D,OAAQ6rB,EAAgB,IACxBjpB,KAAMipB,EAAgB,CAClB9M,QAAS,UAEbuN,MAAOT,EAAgB,IACvBU,KAAMV,EAAgB,CAClBhS,SAAS,IAEb2S,IAAKX,EAAgB,CACjBnc,OAAQ,SAAUjR,GAAO,OAAOqlB,SAASrlB,EAAK,KAC9CkV,GAAI,SAAUlV,GACV,QAAQ,QAAkBA,IAAQhE,KAAKiV,OAAOjR,EAAI8Q,cAAgB9Q,GAEtEsgB,QAAS,UAEb0N,KAAMZ,EAAgB,CAClBvc,OAAQ,SAAU7Q,GAAO,OAAQA,EAAO,EAAM,GAC9CiR,OAAQ,SAAUjR,GAAO,OAA6B,IAAtBqlB,SAASrlB,EAAK,KAC9CkV,IAAI,IAAAA,IAAG+Y,SACP3N,QAAS,QAEb4N,KAAMd,EAAgB,CAClBvc,OAAQ,SAAU7Q,GACd,OAAQhE,KAAKkZ,GAAGlV,GAEV,CAACA,EAAImuB,eAAgB,KAAOnuB,EAAIouB,WAAa,IAAItwB,OAAO,IAAK,IAAMkC,EAAIquB,WAAWvwB,OAAO,IAAImR,KAAK,UADlGkB,GAGVc,OAAQ,SAAUjR,GACd,GAAIhE,KAAKkZ,GAAGlV,GACR,OAAOA,EACX,IAAIgY,EAAQhc,KAAKsyB,QAAQ7oB,KAAKzF,GAC9B,OAAOgY,EAAQ,IAAIuW,KAAKvW,EAAM,GAAIA,EAAM,GAAK,EAAGA,EAAM,SAAM7H,GAEhE+E,GAAI,SAAUlV,GAAO,OAAOA,aAAeuuB,OAASjJ,MAAMtlB,EAAIwuB,YAC9DrjB,OAAQ,SAAUsjB,EAAGlV,GACjB,MAAO,CAAC,cAAe,WAAY,WAAW3O,QAAO,SAAUsL,EAAKvZ,GAAM,OAAOuZ,GAAOuY,EAAE9xB,OAAU4c,EAAE5c,QAAU,IAEpH2jB,QAAS,0DACTgO,QAAS,0DAEbI,KAAMtB,EAAgB,CAClBvc,OAAQ,KACRI,OAAQ,KACRiE,IAAI,IAAAA,IAAG3F,QACPpE,OAAQ,KACRmV,QAAS,UAGbJ,IAAKkN,EAAgB,CACjBvc,OAAQ,KACRI,OAAQ,KACRiE,GAAI,WAAc,OAAO,GACzB/J,OAAQ,kLCjJhBwjB,EAA6B,WAC7B,SAASA,EAAYvkB,QACF,IAAXA,IAAqBA,EAAS,KAClC,QAAOpO,KAAMoO,GA4BjB,OAlBAukB,EAAY9wB,UAAU+wB,SAAW,SAAUC,EAAWC,EAAUC,GAC5D,IAAIC,EACAC,GAAU,QAAUH,EAAUC,GAAM9nB,EAAY,GAAIioB,EAAc,GACtE,IAAK,IAAI7V,KAAK4V,EACV,GAAKA,EAAQ5V,IAAO4V,EAAQ5V,GAAGjP,SAE/B4kB,EAAezf,OAAOC,KAAKyf,EAAQ5V,GAAGjP,SACpBgB,OAElB,IAAK,IAAIsO,KAAKsV,EACNE,EAAYhlB,QAAQ8kB,EAAatV,KAAO,IAE5CwV,EAAYzyB,KAAKuyB,EAAatV,IAC9BzS,EAAU+nB,EAAatV,IAAM1d,KAAKgzB,EAAatV,KAGvD,OAAO,QAAO,GAAIzS,EAAW4nB,IAE1BF,EA/BqB,+RCS5BQ,EAA0B,WAC1B,SAASA,EAASC,GACd,GAAIA,aAAuBD,EAAU,CACjC,IAAI5kB,EAAO6kB,EACXpzB,KAAKyN,MAAQc,EAAKd,MAClBzN,KAAKwO,YAAcD,EAAKC,YAAY1M,QACpC9B,KAAKsb,aAAc,QAAO,GAAI/M,EAAK+M,aACnCtb,KAAK+X,YAAcxJ,EAAKwJ,YAAYjW,QACpC9B,KAAKwa,MAAQjM,EAAKiM,OAASjM,EAAKiM,MAAM1Y,YAErC,CACD,IAAI2L,EAAQ2lB,EACZpzB,KAAKyN,MAAQA,EACbzN,KAAKwO,YAAcf,EAAM4lB,WAAW,CAAEjU,SAAS,IAC/Cpf,KAAKsb,YAAc,GACnBtb,KAAK+X,YAActK,EAAMsK,YAAYpJ,KAAI,SAAUqE,GAAO,OAAOA,EAAItG,YA+C7E,OA5CAymB,EAAStxB,UAAU6K,MAAQ,WACvB,OAAO,IAAIymB,EAASnzB,OAGxBmzB,EAAStxB,UAAUyxB,eAAiB,SAAUllB,GAG1C,OADApO,KAAKsb,YAActb,KAAKwO,YAAYI,QAAO,SAAUsR,EAAMqT,GAAQ,OAAO,QAAWrT,EADtC,EAAnBsT,EAC2ED,GAD9CloB,GAAImoB,EAAShvB,MAAM4J,EAAOolB,EAASnoB,OAA1E,IAAUmoB,IACsF,IAC3GxzB,MAGXmzB,EAAStxB,UAAU4xB,UAAY,SAAUjuB,GACrC,OAAO,QAAKxF,KAAKwO,aAAa,QAAO,KAAMhJ,KAM/C2tB,EAAStxB,UAAUsN,OAAS,SAAUZ,EAAMmlB,GACxC,IAAIC,EAAO3zB,KAAK2zB,KAAKplB,EAAMmlB,GAC3B,OAAOC,GAAwB,IAAhBA,EAAKvkB,QAcxB+jB,EAAStxB,UAAU8xB,KAAO,SAAUplB,EAAMmlB,GACtC,GAAI1zB,KAAKyN,QAAUc,EAAKd,MACpB,OAAO,EACX,IAAIW,EAASslB,EAAWA,EAAS1zB,MAAQA,KAAKwO,YAC9C,OAAO,YAAcJ,EAAQpO,KAAKsb,YAAa/M,EAAK+M,cAMxD6X,EAASzmB,MAAQ,SAAU6B,GAAQ,OAAOA,EAAK7B,SACxCymB,EA9DkB,mWCHzBS,EAA2B,WAC3B,SAASA,KA4JT,OAzJAA,EAAUC,gBAAkB,SAAUC,EAAU3rB,GAC5C,IAAIsF,GAAQ,QAAKtF,GAAMsF,MACvB,OAAO,IAAI,IAAYqmB,EAAUrmB,EAAOtF,EAAKwG,KAAI,QAAK,gBAAgBC,OAAO,KAAQ,IAAK,KAE9FglB,EAAUG,UAAY,SAAUvH,GAC5B,IAAIre,EAAWqe,EAAYpe,SAC3B,OAAOoe,EAAY/T,SAAStQ,KAAKwG,KAAI,SAAUlB,GAAS,OAAO,IAAI,IAASA,GAAO6lB,eAAenlB,OAGtGylB,EAAUI,YAAc,SAAUC,EAAUzH,GACxC,IAAI0H,EAASN,EAAUG,UAAUvH,GACjC,OAAIA,EAAYrsB,UAAUif,QACfwU,EAAUO,cAAcF,EAAUC,EAAQ3gB,OAAOC,KAAKgZ,EAAYpe,WAEtE8lB,GAOXN,EAAUQ,iBAAmB,SAAUttB,EAAOqB,EAAM6kB,GAEhD7kB,EACKmB,QAAO,SAAUiF,GAAQ,OAAO,QAAQye,EAAQze,EAAKd,UACrD1M,SAAQ,SAAUwN,GACnB,IAAI8lB,GAAY,QAAO9lB,EAAKd,MAAM+M,OAAS,IACvC8Z,EAAUV,EAAUU,QAAQnsB,GAAM,SAAUoY,GAAK,OAAOA,IAAMhS,KAC9DgmB,EAAcF,EAAU1lB,KAAI,SAAUmL,GAAQ,OAAOhT,EAAM0tB,iBAAiBF,EAASxa,MACzFvL,EAAKiM,MAAQ+Z,EAAY3lB,OAAO,KAAS,QAcjDglB,EAAUO,cAAgB,SAAUF,EAAUC,EAAQO,QACnC,IAAXA,IAAqBA,EAAS,IAKlC,IAAIC,EAAYT,EACXtlB,KAAI,SAAUJ,GAAQ,OAAOA,EAAKC,eAClCI,OAAO,KAAS,IAChBtF,QAAO,SAAU0F,GAAS,OAAQA,EAAMoQ,WACxCzQ,KAAI,QAAK,OAiBd,OAAOulB,EAAOvlB,KAZd,SAAiCgmB,GAE7B,IAAIC,GAAc,QAAO,GAAID,GAAUA,EAAOrZ,aAE1CuZ,GAAoB,QAAKD,EAAaH,GAC1CG,GAAc,QAAKA,EAAaH,GAChC,IAnBmBtsB,EAAMsF,EACrBc,EAkBAumB,GAAgB,SAnBD3sB,EAmBoB8rB,EAnBdxmB,EAmBwBknB,EAAOlnB,MAlBpDc,GAAO,QAAKpG,GAAM,QAAO,QAASsF,KAC/B,QAAO,GAAIc,GAAQA,EAAK+M,cAiBmC,IAAIoZ,GAElEK,GAAe,QAAOH,EAAaE,EAAeD,GACtD,OAAO,IAAI,IAASF,EAAOlnB,OAAO6lB,eAAeyB,OAQzDnB,EAAUllB,YAAc,SAAUulB,EAAUC,EAAQc,GAIhD,IAHA,IAE2BC,EAAOC,EAU9BhG,EAAMiG,EAAUlnB,EAASke,EAZzBrF,EAAMhF,KAAKD,IAAIoS,EAAS7kB,OAAQ8kB,EAAO9kB,QACvCgmB,EAAO,EAEJA,EAAOtO,GAAOmN,EAASmB,GAAM3nB,QAAUunB,IADnBC,EAC6ChB,EAASmB,GAD/CF,EACsDhB,EAAOkB,GAD7CH,EAAM9lB,OAAO+lB,EAAOtB,EAAUyB,oBAE5ED,IAUJD,GADAjG,EAAO+E,GACSnyB,MAAM,EAAGszB,GACzBnnB,EAAUihB,EAAKptB,MAAMszB,GAErB,IAAIE,EAAuBH,EAASxmB,KAVpC,SAAuB4mB,EAActmB,GACjC,IAAIxC,EAAS8oB,EAAa7oB,QAE1B,OADAD,EAAO6O,YAAc4Y,EAAOjlB,GAAKqM,YAC1B7O,KAUX,OAFA0f,EAAW+H,EAAOpyB,MAAMszB,GAEjB,CAAElG,KAAMA,EAAMC,GADhBmG,EAAqBlzB,OAAO+pB,GACJgJ,SAAUA,EAAUG,qBAAsBA,EAAsBrnB,QAASA,EAASke,SAAUA,IAiB7HyH,EAAU4B,SAAW,SAAUC,EAAOC,EAAOhC,GACzC,IAAIiC,GAAO,EAEX,OADa,QAAYF,EAAOC,GAClB9mB,QAAO,SAAU4mB,EAAUnK,GACrC,IAAIuK,EAAQvK,EAAG,GAAIwK,EAAQxK,EAAG,GAE9B,OADAsK,EAAOA,IAASC,EAAMzmB,OAAO0mB,EAAOnC,IACtB8B,EAAWA,EAASpzB,OAAOwzB,KAC1C,KAUPhC,EAAUzkB,OAAS,SAAUsmB,EAAOC,EAAOhC,GACvC,OAAO+B,EAAMrmB,SAAWsmB,EAAMtmB,QAAUwkB,EAAU4B,SAASC,EAAOC,EAAOhC,GAAUtkB,SAAWqmB,EAAMrmB,QAYxGwkB,EAAUU,QAAU,SAAUnsB,EAAM2tB,GAChC,IAAIvnB,GAAO,QAAKpG,EAAM2tB,GAClBC,EAAa5tB,EAAK+F,QAAQK,GAC9B,OAAuB,IAAhBwnB,OAAoB5hB,EAAYhM,EAAKrG,MAAM,EAAGi0B,EAAa,IAEtEnC,EAAUyB,iBAAmB,SAAU9mB,GACnC,OAAOA,EAAKd,MAAM4lB,WAAW,CAAEjU,SAAS,IAAS9V,QAAO,SAAU0F,GAAS,OAAQA,EAAM2e,YAG7FiG,EAAUtY,YAAc,SAAUnT,GAAQ,OAAOA,EAAKyG,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO,QAAO2L,EAAK3L,EAAK+M,eAAiB,KACtHsY,EA7JmB,yGCPvB,IAAIoC,EAAkB,CACzB/lB,KAAM,CACFgmB,KAAM,OACNC,MAAO,SAEXpd,MAAO,CACHqd,KAAM,OACNC,OAAQ,sbCgBZnkB,EAA4B,WAC5B,SAASA,EAAWokB,EAAMne,EAAWpG,EAAMwkB,EAAQ3uB,GAG/C,GAFA3H,KAAKu2B,UAAW,EAChBv2B,KAAKyD,aAAU0Q,EACXkiB,aAAgBpkB,GAChB,QAAOjS,KAAMq2B,QAEZ,IAAI,QAAWne,GAAY,CAC5B,IAAI,QAAkBme,GAClB,MAAM,IAAI5jB,MAAM,gDACpB,KAAK,QAAWyF,GACZ,MAAM,IAAIzF,MAAM,2DACpBzS,KAAKuhB,MAAQ8U,EACbr2B,KAAKs2B,OAASA,EACdt2B,KAAKkY,UAAYA,EACjBlY,KAAK8R,KAAOA,GAAQ,GACpB9R,KAAK2H,KAAOA,EACZ3H,KAAKu2B,cAAoBpiB,IAATxM,EAChB3H,KAAKyD,QAAUzD,KAAKu2B,SAAW,YAAiBv2B,KAAK2H,WAAQwM,OAE5D,IAAI,QAASkiB,IAASA,EAAK9U,QAAU8U,EAAK3zB,eAAe,cAAgB2zB,EAAK3zB,eAAe,SAAU,CACxG,IAAI8zB,EAAUH,EACd,OAAO,IAAIpkB,EAAWukB,EAAQjV,MAAOiV,EAAQte,UAAWse,EAAQ1kB,KAAM0kB,EAAQF,OAAQE,EAAQ7uB,OA+DtG,OA5DAsK,EAAWpQ,UAAUgX,UAAY,SAAUpL,GACvC,IAAIgpB,EAAaz2B,KAAKs2B,QAAU,GAC5BI,EAAejpB,GAASA,EAAMkpB,eAAkB,GACpD,MAAO,CACH1mB,KAAMwmB,EAAWxmB,MAAQymB,EAAYzmB,MA5CvC,OA6CE6I,MAAO2d,EAAW3d,OAAS4d,EAAY5d,OA5CxC,SAsDP7G,EAAWpQ,UAAU8K,QAAU,SAAUiqB,EAAgBhnB,GACrD,IAAIO,EAAQnQ,KACR+G,EAAK,OAOLwH,EAAOqoB,EAAeC,SAAS72B,MAC/ByN,EAAQc,GAAQA,EAAKd,MACrBqpB,EAAc92B,KAAK6Y,UAAUpL,GAAOqL,MACpCie,GAAoB,QAAWD,GAAeA,EAAc,KAUhE,OAAQ92B,KAAKyD,QAAUsD,EAClBkJ,OACAlF,MApB2B,WAC5B,OAAOhE,EAAG0U,IAAImb,EAAeI,gBAAgB7mB,GAAOxB,KAAI,SAAUqJ,GAAc,OAAOA,EAAWtH,IAAIkmB,EAAgBhnB,UAoBrH7E,MAjBiB,SAAUksB,GAAgB,OAAO9mB,EAAM+H,UAAU/V,MAAM,KAAM80B,MAkB9ElsB,KAAKgsB,GACLhsB,MAboB,SAAUmsB,GAK/B,OAJA/mB,EAAMxI,KAAOuvB,EACb/mB,EAAMomB,UAAW,EACjBpmB,EAAM+H,UAAY,KAClB,6BAA8B/H,EAAOP,GAC9BO,EAAMxI,SAgBrBsK,EAAWpQ,UAAU6O,IAAM,SAAUkmB,EAAgBhnB,GACjD,OAAO5P,KAAKyD,SAAWzD,KAAK2M,QAAQiqB,EAAgBhnB,IAExDqC,EAAWpQ,UAAUiT,SAAW,WAC5B,MAAO,sBAAuB,QAAU9U,KAAKuhB,OAAS,gBAAkBvhB,KAAK8R,KAAKnD,IAAI,MAAa,MAEvGsD,EAAWpQ,UAAU6K,MAAQ,WACzB,OAAO,IAAIuF,EAAWjS,OAE1BiS,EAAWklB,SAAW,SAAU5V,EAAO5Z,GAAQ,OAAO,IAAIsK,EAAWsP,GAAO,WAAc,OAAO5Z,IAAS,KAAM,KAAMA,IAC/GsK,EArFoB,4qBCd3BmlB,EAAQ,SACRC,EAAY,CAACD,EAAMlB,MAAOkB,EAAMnB,MAChCqB,EAAc,CAACF,EAAMlB,OAarB9tB,EAAgC,WAChC,SAASA,EAAemvB,GACpBv3B,KAAKu3B,MAAQA,EA8IjB,OA3IAnvB,EAAevG,UAAU+W,UAAY,WACjC,OAAO5Y,KAAKu3B,MAAM3oB,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO2L,EAAI9X,OAAOmM,EAAKwJ,YAAYpJ,KAAI,SAAU4O,GAAK,OAAOA,EAAEgE,YAAe,IAAI3S,OAAO,KAAO,KAQpJxG,EAAevG,UAAUiM,cAAgB,SAAUyT,GAC/C,IAAIiU,EAAWx1B,KAAKu3B,MACf5oB,KAAI,SAAUJ,GAAQ,OAAOA,EAAKwJ,eAClCnJ,OAAO,KAAS,IAChBtF,QAAO,SAAUiU,GAAK,OAAOA,EAAEgE,QAAUA,KAC9C,OAAO,QAAKiU,IAGhBptB,EAAevG,UAAUgX,UAAY,SAAUb,GAC3C,IAAIzJ,EAAOvO,KAAK62B,SAAS7e,GACzB,OAAOA,EAAWa,UAAUtK,EAAKd,QAyBrCrF,EAAevG,UAAUkS,WAAa,SAAUtG,GAC5C,OAAO,IAAIrF,EAAe,YAAkBpI,KAAKu3B,OAAO,SAAUhpB,GAAQ,OAAOA,EAAKd,QAAUA,OAiBpGrF,EAAevG,UAAU21B,eAAiB,SAAUC,EAAgBhqB,GAChE,IAAIc,GAAO,QAAKvO,KAAKu3B,OAAO,QAAO,QAAS9pB,IACxC+F,EAAOikB,EAAe9oB,KAAI,SAAU4O,GAAK,OAAOA,EAAEgE,SACtDhT,EAAKwJ,YAAcxJ,EAAKwJ,YAAYzO,QAAO,SAAUiU,GAAK,OAAkC,IAA3B/J,EAAKtF,QAAQqP,EAAEgE,UAAkBnf,OAAOq1B,IAS7GrvB,EAAevG,UAAU61B,YAAc,SAAUznB,EAAML,GACnD,IAAIO,EAAQnQ,UACC,IAATiQ,IAAmBA,EAAO,QAE9B,IAGI0nB,IAHa,QAAQN,EAAWpnB,GAAQA,EAAO,UAGjB,eAA6BqnB,EAAcD,EAE7E,sBAAuBr3B,KAAKu3B,MAAOtnB,EAAML,GACzC,IAAIgoB,EAAgB,SAAUC,EAAcC,GAAe,OAAO,SAAU9f,GACxE,OAAO,QAAQ6f,EAAc1nB,EAAM0I,UAAUb,GAAY8f,MAIzDvc,EAAWvb,KAAKu3B,MAAM3oB,QAAO,SAAUsL,EAAK3L,GAC5C,IAAIwpB,EAAkBxpB,EAAKwJ,YAAYzO,OAAOsuB,EAAcD,EAAc,SACtEK,EAASD,EAAgBzuB,OAAOsuB,EAAc,CAAC,UAAW,UAC1DK,EAAOF,EAAgBzuB,QAAO,QAAIsuB,EAAc,CAAC,UAAW,WAE5D7jB,EAAa5D,EAAM4D,WAAWxF,EAAKd,OACnCyqB,EAAY,SAAU3a,GACtB,OAAOA,EACF7M,IAAIqD,EAAYnE,GAEhB7E,MAAK,SAAUvG,GAAS,MAAO,CAAG+c,MAAOhE,EAAEgE,MAAO/c,MAAOA,OAGlE,OADAwzB,EAAOj3B,QAAQm3B,GACRhe,EAAI9X,OAAO61B,EAAKtpB,IAAIupB,MAC5B,IAEH,OAAO,WAAgB3c,IAE3BnT,EAAevG,UAAUs2B,SAAW,WAChC,OAAOn4B,KAAKo4B,YAAcp4B,KAAKo4B,UAAY,IAAIC,EAAer4B,QAElEoI,EAAevG,UAAUg1B,SAAW,SAAU7e,GAC1C,OAAO,QAAKhY,KAAKu3B,OAAO,SAAUhpB,GAAQ,OAAO,QAAQA,EAAKwJ,YAAaC,OAO/E5P,EAAevG,UAAUm1B,gBAAkB,SAAUhf,GACjD,IAAI7H,EAAQnQ,KACRuO,EAAOvO,KAAK62B,SAAS7e,GAIrBsgB,GADU,YAAkBt4B,KAAKu3B,OAAO,SAAUjoB,GAAK,OAAOA,IAAMf,MAAYvO,KAAKu3B,OAEpF3oB,QAAO,SAAUsL,EAAKqe,GAAS,OAAOre,EAAI9X,OAAOm2B,EAAMxgB,eAAiB,IACxEzO,QAAO,SAAU0J,GAAO,OAAOA,IAAQgF,KAW5C,OAAOA,EAAWlG,KAAKnD,KAVH,SAAU4S,GAC1B,IAAIiU,EAAW8C,EAAqBhvB,QAAO,SAAUiU,GAAK,OAAOA,EAAEgE,QAAUA,KAC7E,GAAIiU,EAASpmB,OACT,OAAO,QAAKomB,GAChB,IAAIgD,EAAeroB,EAAMgoB,WAAWM,UAAUlX,GAC9C,IAAI,QAAYiX,GACZ,MAAM,IAAI/lB,MAAM,+CAAgD,QAAU8O,IAE9E,OAAO,IAAI,IAAWA,GAAO,WAAc,OAAOiX,IAAiB,GAAIA,OAIxEpwB,EAhJwB,GAoJ/BiwB,EAAgC,WAChC,SAASA,EAAexnB,GACpB7Q,KAAK6Q,QAAUA,EACf7Q,KAAK04B,OAAS14B,KAAK0Q,IAlKQ,oBAkKsB,cAwBrD,OAtBA2nB,EAAex2B,UAAU6O,IAAM,SAAU6Q,GACrC,IAAIvJ,EAAahY,KAAK6Q,QAAQ/C,cAAcyT,GAC5C,GAAIvJ,EAAY,CACZ,GAAiD,WAA7ChY,KAAK6Q,QAAQgI,UAAUb,GAAYc,MACnC,OAAOd,EAAWtH,IAAI1Q,KAAK6Q,SAE/B,IAAKmH,EAAWue,SACZ,MAAM,IAAI9jB,MAAM,yCAA0C,QAAUuF,EAAWuJ,QAEnF,OAAOvJ,EAAWrQ,KAEtB,OAAO3H,KAAKy4B,UAAUlX,IAE1B8W,EAAex2B,UAAU82B,SAAW,SAAUpX,GAC1C,IAAIvJ,EAAahY,KAAK6Q,QAAQ/C,cAAcyT,GAC5C,OAAIvJ,EACOA,EAAWtH,IAAI1Q,KAAK6Q,SACxB,YAAiB7Q,KAAK04B,OAAOhoB,IAAI6Q,KAE5C8W,EAAex2B,UAAU42B,UAAY,SAAUlX,GAC3C,OAAOvhB,KAAK04B,QAAU14B,KAAK04B,OAAOhoB,IAAI6Q,IAEnC8W,EA3BwB,q2BC/J/BO,EAAkB,EAMlBC,GAAsB,QAAS,mBAJnB,CAAC,MAAO,OAAQ,SAAU,OAAQ,aAM9CC,GAAqB,QAAS,iBAJlB,CAAC,OAAQ,WAAY,OAAQ,WAAY,YAAa,eAUlEpiB,EAA0B,WAQ1B,SAASA,EAASU,EAAiBC,QACP,IAApBD,IAA8BA,EAAkByhB,QAC7B,IAAnBxhB,IAA6BA,EAAiByhB,GAClD94B,KAAKoX,gBAAkBA,EACvBpX,KAAKqX,eAAiBA,EACLrX,KAAKmb,IAAMyd,IACX54B,KAAK+4B,WAAY,EACjB/4B,KAAKg5B,aAAe,GAErCh5B,KAAKqI,MAAQ,KAEbrI,KAAK+W,YAAc,IAAI,IAAY/W,MAEnCA,KAAKsY,QAAU,IAAI,IAEnBtY,KAAK8sB,kBAAoB,IAAI,IAAkB9sB,MAK/CA,KAAK4U,kBAAoB,IAAI,IAAkB5U,MAK/CA,KAAKmc,UAAY,IAAI,IAAUnc,MAE/BA,KAAKiX,WAAa,IAAI,IAAWjX,MAEjCA,KAAK4W,cAAgB,IAAI,IAAc5W,MAEvCA,KAAK6W,aAAe,IAAI,IAAa7W,MAErCA,KAAKi5B,SAAW,GAChBj5B,KAAK+W,YAAY/M,WAAWC,iBAAiBjK,KAAK4W,cAAcgH,QAChE5d,KAAKsY,QAAQwa,SAAW9yB,KAAK4W,cAAcgH,OAC3C5d,KAAKsY,QAAQwN,QAAU9lB,KAAKsY,QAAQwa,SAASplB,KAC7C1N,KAAKk5B,WAAWl5B,KAAKsY,SACrBtY,KAAKk5B,WAAWl5B,KAAK6W,cACrB7W,KAAKk5B,WAAWl5B,KAAK4W,eACrB5W,KAAKk5B,WAAWl5B,KAAK8sB,mBACrB9sB,KAAKk5B,WAAWl5B,KAAKiX,YACrBjX,KAAKk5B,WAAW9hB,GAChBpX,KAAKk5B,WAAW7hB,GAgGpB,OA7FAX,EAAS7U,UAAUq3B,WAAa,SAAUA,GACtCl5B,KAAKg5B,aAAav4B,KAAKy4B,IAa3BxiB,EAAS7U,UAAUqT,QAAU,SAAUgkB,GACnC,IAAI/oB,EAAQnQ,KACRk5B,IAAc,QAAWA,EAAWhkB,SACpCgkB,EAAWhkB,QAAQlV,OAGvBA,KAAK+4B,WAAY,EACjB/4B,KAAKg5B,aAAal3B,QAAQf,SAAQ,SAAUo4B,GACxC,IACyB,mBAAdA,EAAEjkB,SAA0BikB,EAAEjkB,QAAQ/E,IAC7C,QAAWA,EAAM6oB,aAAcG,GAEnC,MAAOC,UAwDf1iB,EAAS7U,UAAUw3B,OAAS,SAAUA,EAAQl5B,QAC1B,IAAZA,IAAsBA,EAAU,IACpC,IAAIm5B,EAAiB,IAAID,EAAOr5B,KAAMG,GACtC,IAAKm5B,EAAe9zB,KAChB,MAAM,IAAIiN,MAAM,+CAAiD6mB,GAErE,OADAt5B,KAAKg5B,aAAav4B,KAAK64B,GACft5B,KAAKi5B,SAASK,EAAe9zB,MAAQ8zB,GAEjD5iB,EAAS7U,UAAU03B,UAAY,SAAUC,GACrC,OAAOA,EAAax5B,KAAKi5B,SAASO,IAAc,QAAOx5B,KAAKi5B,WAEzDviB,EAnJkB,ijBCf7B,SAAS+iB,EAAYhsB,GACjB,OAAOA,EAAMjI,KAEjB,SAASk0B,EAAYjsB,GAEjB,OADAA,EAAMC,KAAKsG,QAAU,WAAc,OAAOvG,GACnCA,EAAMC,KAEjB,SAASisB,EAAYlsB,GAIjB,OAHIA,EAAM2M,QAAU3M,EAAM2M,OAAOzS,OAC7B8F,EAAM9F,KAAO8F,EAAMC,KAAK/F,MAAO,QAAQ8F,EAAM2M,OAAOzS,KAAM8F,EAAM9F,OAE7D8F,EAAM9F,KAEjB,IAAIiyB,EAAgB,SAAUC,EAA4Bjc,GACtD,OAAO,SAAoBhK,GACvB,IAAIkmB,EAAWlmB,EAAYlG,KAG3B,GAAIosB,GAAYA,EAASroB,KAAOqoB,EAASt0B,MAAQs0B,EAASt0B,KAAKwW,MAAM,WAAY,CAC7E,IAAI+d,EAAc,IAClB,QAAKD,EAAUC,GACfA,EAAYtoB,KAAO,kBACnBqoB,EAAWC,EAEf,IAAI3f,EAASxG,EAAYwG,OACrB4f,EA/BG,SAAUvoB,GACrB,KAAK,QAASA,GACV,OAAO,EACX,IAAImM,EAAyB,MAAlBnM,EAAIhM,OAAO,GACtB,MAAO,CAAEzB,IAAK4Z,EAAOnM,EAAIwoB,UAAU,GAAKxoB,EAAKmM,KAAMA,GA2BlCsc,CAASJ,EAASroB,KAC3BA,EAAOuoB,EAAwBH,EAA2BxyB,QAAQ2yB,EAAOh2B,IAAK,CAAEyJ,MAAOqsB,IAAvEA,EAASroB,IAC7B,IAAKA,EACD,OAAO,KACX,IAAKooB,EAA2BM,UAAU1oB,GACtC,MAAM,IAAIgB,MAAM,gBAAkBhB,EAAM,eAAiBmC,EAAc,KAC3E,OAAOomB,GAAUA,EAAOpc,KAAOnM,GAAQ2I,GAAUA,EAAOggB,WAAcxc,KAAQnM,IAAI4oB,OAAO5oB,KAG7F6oB,EAAsB,SAAUC,GAChC,OAAO,SAA0B9sB,GAC7B,OAAQ8sB,EAAO9sB,IAAUA,EAAMgE,IAAMhE,EAAQA,EAAM2M,OAAS3M,EAAM2M,OAAOggB,UAAY,OAc7F,SAASI,EAAY/sB,GACjB,OAAOA,EAAM2M,OAAS3M,EAAM2M,OAAOjS,KAAK/F,OAAOqL,GAAkB,CAACA,GAEtE,SAASgtB,EAAgBhtB,GACrB,IAAI6L,EAAW7L,EAAM2M,QAAS,QAAO,GAAI3M,EAAM2M,OAAOd,UAAY,GAElE,OADAA,EAAS7L,EAAMjI,OAAQ,EAChB8T,EA2CJ,SAASohB,EAAmBjtB,GAE/B,IAA+BktB,EAAY3E,EA2BvC4E,EAAW,SAAUC,GAAK,OAAOA,EAAEC,SAAWD,EAAEtZ,OAEhDwZ,GAAqB,QAAQ,CAC7B,EAAC,QAAK,aAAc,SAAUF,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAIA,EAAE3iB,UAAW2iB,EAAE/oB,KAAM+oB,EAAEvE,UAC7F,EAAC,QAAK,cAAe,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAIA,EAAEG,WAAYH,EAAE/oB,MAAQ+oB,EAAEI,aAAcJ,EAAEvE,UACjH,EAAC,QAAK,YAAa,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,IAAI,WAAc,OAAO,IAAIA,EAAEK,WAAe,GAAIL,EAAEvE,UACrH,EAAC,QAAK,YAAa,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,IAAI,WAAc,OAAOA,EAAEM,WAAa,GAAIN,EAAEvE,OAAQuE,EAAEM,YACzH,EAAC,QAAK,eAAgB,SAAUN,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAI,KAAU,CAACA,EAAEO,aAAcP,EAAEvE,YAGrG+E,GAAmB,QAAQ,CAC3B,EAAC,SAAK,QAAK,OAAQ,MAAW,SAAU5nB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,MAAO,KAAU,CAAC9N,EAAMzP,KAAMyP,EAAM6iB,UACjH,EAAC,SAAK,QAAK,OAAQ,MAAU,SAAU7iB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,OAAO,QAAK9N,EAAMzP,KAAMyP,EAAMzP,IAAIlC,MAAM,GAAI,GAAI2R,EAAM6iB,UAClI,EAAC,SAAK,QAAK,OAAQ,MAAa,SAAU7iB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,MAAO9N,EAAMzP,KA/BvErD,EA+BqF8S,EAAMzP,IA9B5GuM,EAAY,cAIT5P,EAAY,SAAM4P,GAAaA,EAAU0H,SAAStX,EAAI4P,EAAUuH,WAAc,YA0BiCrE,EAAM6iB,QA/BjH,IAAU31B,EACjB4P,MAiCJ+qB,GAAkB,QAAQ,CAC1B,EAAC,IAAApiB,IAAG,KAAa,SAAUqE,GAAK,OAAOA,IACvC,CA5BmB,SAAUtD,GAAO,SAAUA,EAAIsH,QAAStH,EAAI/B,YA4B5C6iB,GACnB,CA3BoB,SAAU9gB,GAC9B,SAAWA,EAAI6gB,UAAW7gB,EAAIsH,SAAWtH,EAAIkhB,UAAYlhB,EAAI+gB,YAAc/gB,EAAImhB,aAAenhB,EAAIihB,YA0B9EH,GACpB,CAxBiB,SAAU9gB,GAC3B,SAAUA,GAAOA,EAAIjW,OAAQ,QAASiW,EAAIjW,OAAQ,QAAQiW,EAAIjW,OAAQ,QAAWiW,EAAIjW,QAuBpEq3B,GACjB,EAAC,SAAI,GAAO,SAAUphB,GAAO,MAAM,IAAIxH,MAAM,2BAA4B,QAAUwH,QAInFshB,EAAO9tB,EAAMd,QAEjB,QADY,QAAQ4uB,GAAQA,GArDGZ,EAqDmBY,EArDPvF,EAqDavoB,EAAMkpB,eAAiB,GApDpEpjB,OAAOC,KAAKmnB,GAAc,IAAIhsB,KAAI,SAAU4S,GAAS,MAAO,CAC/DA,MAAOA,EACPvd,IAAK22B,EAAWpZ,GAChBzP,UAAMqC,EACNmiB,OAAQN,EAAgBzU,SAiDnB5S,IAAI2sB,GAcrB,IAAIE,EAA8B,WAC9B,SAASA,EAAaC,EAAS7mB,GAC3B5U,KAAKy7B,QAAUA,EACf,IArIyBC,EAqIrBhuB,EAAO1N,KACP4d,EAAO,WAAc,OAAO6d,EAAQ3a,KAAK,KACzCyZ,EAAS,SAAU9sB,GAAS,MAAsB,KAAfA,EAAMjI,MAM7CxF,KAAK27B,SAAW,CACZn2B,KAAM,CAACi0B,GACP/rB,KAAM,CAACgsB,GACPtf,OAAQ,CARZ,SAAuB3M,GACnB,OAAI8sB,EAAO9sB,GACA,KACJguB,EAAQ3a,KAAKpT,EAAKkuB,WAAWnuB,KAAWmQ,MAM/CjW,KAAM,CAACgyB,GAEPloB,IAAK,CAACmoB,EAAchlB,EAAmBgJ,IAEvCwc,UAAW,CAACE,EAAoBC,IAChCnsB,OAAQ,EAtJastB,EAsJK9mB,EAAkB8mB,aArJ7C,SAAuBjuB,GAC1B,IACIouB,EAAapuB,EAAMgE,KAAOhE,EAAMgE,IAAI4hB,WAAW,CAAEjU,SAAS,KAAa,GACvE0c,GAAe,SAAO,SAAO,QAAKruB,EAAMW,QAAU,GAAIytB,EAAUltB,KAAI,QAAK,SAFvD,SAAUpD,EAAQF,GAAM,OAAOqwB,EAAa9qB,WAAWvF,EAAI,KAAMoC,EAAMC,UAG7F,OAAOmuB,EACFz5B,OAAO05B,GACPntB,KAAI,SAAUksB,GAAK,MAAO,CAACA,EAAExvB,GAAIwvB,MACjCjsB,OAAO,KAAY,OAiJpB4L,MAAO,GAEPrS,KAAM,CAACqyB,GAEPlhB,SAAU,CAACmhB,GACX1iB,YAAa,CAAC2iB,IAgEtB,OA7DAc,EAAa35B,UAAUk6B,QAAU,SAAUv2B,EAAM7E,GAC7C,IAAIg7B,EAAW37B,KAAK27B,SAChBpc,EAAQoc,EAASn2B,IAAS,GAE9B,OAAI,QAASA,MAAU,QAAU7E,GACtB4e,EAAMnQ,OAAS,EAAImQ,EAAQA,EAAM,IACvC,QAAS/Z,KAAU,QAAW7E,IAEnCg7B,EAASn2B,GAAQ+Z,EACjBoc,EAASn2B,GAAM/E,KAAKE,GACb,WAAc,OAAOg7B,EAASn2B,GAAMga,OAAOmc,EAASn2B,GAAM0I,QAAQvN,EAAI,KAAO,YAJpF,GAaJ66B,EAAa35B,UAAUm6B,MAAQ,SAAUvuB,GACrC,IAAeguB,EAANz7B,KAAmBy7B,QAASE,EAA5B37B,KAA0C27B,SAC/CvhB,EAASpa,KAAK47B,WAAWnuB,GAC7B,GAAI2M,IAAWqhB,EAAQ3a,KAAK1G,OAAQjG,GAAW,GAC3C,OAAO,KAEX,IAAK,IAAItO,KAAO81B,EACZ,GAAKA,EAASj5B,eAAemD,GAA7B,CAEA,IAAIo2B,EAAQN,EAAS91B,GAAK+I,QAAO,SAAUstB,EAAUpS,GAAQ,OAAO,SAAUmD,GAAU,OAAOnD,EAAKmD,EAAQiP,MAAiB,MAC7HzuB,EAAM5H,GAAOo2B,EAAMxuB,GAEvB,OAAOA,GAEX+tB,EAAa35B,UAAU+5B,WAAa,SAAUnuB,GAE1C,IAAIjI,EAAOiI,EAAMjI,MAAQ,GAErB22B,EAAW32B,EAAKsd,MAAM,KAM1B,GAFoB,OAFFqZ,EAASC,OAGvBD,EAASC,MACTD,EAAS/sB,OAAQ,CACjB,GAAI3B,EAAM2M,OACN,MAAM,IAAI3H,MAAM,mFAAqFjN,EAAO,KAGhH,OAAO22B,EAASlpB,KAAK,KAEzB,OAAKxF,EAAM2M,QAEJ,QAAS3M,EAAM2M,QAAU3M,EAAM2M,OAAS3M,EAAM2M,OAAO5U,KADjD,IAGfg2B,EAAa35B,UAAU2D,KAAO,SAAUiI,GACpC,IAAIjI,EAAOiI,EAAMjI,KACjB,IAA2B,IAAvBA,EAAK0I,QAAQ,OAAgBT,EAAM2M,OACnC,OAAO5U,EACX,IAAIo2B,GAAa,QAASnuB,EAAM2M,QAAU3M,EAAM2M,OAAS3M,EAAM2M,OAAO5U,KACtE,OAAOo2B,EAAaA,EAAa,IAAMp2B,EAAOA,GAE3Cg2B,EA5FsB,iTClL7Ba,EAA8B,WAC9B,SAASA,EAAaC,GAClBt8B,KAAKs8B,QAAUA,EAmDnB,OAjDAD,EAAax6B,UAAU06B,WAAa,SAAUC,GAE1C,OAAkC,KADlCA,EAAYA,GAAa,IACRtuB,QAAQ,MAAyC,IAA3BsuB,EAAUtuB,QAAQ,MAE7DmuB,EAAax6B,UAAUif,KAAO,SAAU2b,EAAaC,EAAMC,GAEvD,QADkB,IAAdA,IAAwBA,GAAY,GACnCF,GAA+B,KAAhBA,EAApB,CAEA,IAAIG,GAAQ,QAASH,GACjBj3B,EAAOo3B,EAAQH,EAAcA,EAAYj3B,KACzCxF,KAAKu8B,WAAW/2B,KAChBA,EAAOxF,KAAK03B,YAAYlyB,EAAMk3B,IAClC,IAAIjvB,EAAQzN,KAAKs8B,QAAQ92B,GACzB,GAAIiI,IAAUmvB,KAAWA,GAAUnvB,IAAUgvB,GAAehvB,EAAMC,OAAS+uB,IACvE,OAAOhvB,EAEN,GAAImvB,GAASD,EAAW,CACzB,IACIzZ,GADU,QAAOljB,KAAKs8B,SACJhzB,QAAO,SAAU2jB,GAAU,OAAOA,EAAO4P,mBAAmBC,UAAY7P,EAAO4P,mBAAmBC,SAAS5Z,QAAQ1d,MAIzI,OAHI0d,EAAQ9T,OAAS,GACjB,UAAkB,iDAAmD5J,EAAO,gBAAiB0d,EAAQvU,KAAI,SAAUqN,GAAS,OAAOA,EAAMxW,SAEtI0d,EAAQ,MAIvBmZ,EAAax6B,UAAU61B,YAAc,SAAUlyB,EAAMk3B,GACjD,IAAKA,EACD,MAAM,IAAIjqB,MAAM,sCAAwCjN,EAAO,KAKnE,IAJA,IAAIu3B,EAAY/8B,KAAK8gB,KAAK4b,GACtBM,EAAYx3B,EAAKsd,MAAM,KACvBma,EAAaD,EAAU5tB,OACvBiO,EAAI,EAAGyI,EAAUiX,EACd1f,EAAI4f,EAAY5f,IACnB,GAAqB,KAAjB2f,EAAU3f,IAAmB,IAANA,EAA3B,CAIA,GAAqB,MAAjB2f,EAAU3f,GAMd,MALI,IAAKyI,EAAQ1L,OACT,MAAM,IAAI3H,MAAM,SAAWjN,EAAO,0BAA4Bu3B,EAAUv3B,KAAO,KACnFsgB,EAAUA,EAAQ1L,YANlB0L,EAAUiX,EAWlB,IAAIG,EAAUF,EAAUl7B,MAAMub,GAAGpK,KAAK,KACtC,OAAO6S,EAAQtgB,MAAQsgB,EAAQtgB,MAAQ03B,EAAU,IAAM,IAAMA,GAE1Db,EArDsB,oWCW7Bc,EAA6B,WAE7B,SAASA,EAAY5xB,GACjB,OAAO4xB,EAAY37B,OAAO+J,GAAU,IA4FxC,OAlFA4xB,EAAY37B,OAAS,SAAU47B,GAC3BA,EAAYD,EAAYE,aAAaD,GAAa,IAAIA,EAAcA,EACpE,IAAI3vB,GAAQ,SAAQ,QAAQ2vB,EAAWD,EAAYt7B,YAMnD,OALAu7B,EAAUppB,QAAU,WAAc,OAAOvG,GACzCA,EAAMC,KAAO0vB,EACb3vB,EAAMovB,mBAAqB,CACvBC,SAAU,eAAgBrvB,EAAMjI,OAE7BiI,GAaX0vB,EAAYt7B,UAAUqX,GAAK,SAAUokB,GACjC,OAAOt9B,OAASs9B,GAAOt9B,KAAK0N,OAAS4vB,GAAOt9B,KAAKsL,QAAUgyB,GAM/DH,EAAYt7B,UAAUyJ,IAAM,WACxB,KAAKtL,KAAKoa,QAAYpa,KAAKoa,kBAAkBpa,KAAKokB,aAC9C,OAAOpkB,KAAKwF,KAChB,IAAIA,EAAOxF,KAAKoa,OAAO9O,MACvB,OAAO9F,EAAOA,EAAO,IAAMxF,KAAKwF,KAAOxF,KAAKwF,MAOhD23B,EAAYt7B,UAAU+b,KAAO,WACzB,OAAQ5d,KAAKoa,QAAUpa,KAAKoa,OAAOwD,QAAW5d,MAWlDm9B,EAAYt7B,UAAUwxB,WAAa,SAAUzyB,GAGzC,QAFAA,GAAO,QAASA,EAAM,CAAEwe,SAAS,EAAMme,aAAc,QAC/Bne,SAAWpf,KAAKoa,QAAUpa,KAAKoa,OAAOiZ,cAAiB,IAExEjxB,QAAO,QAAOpC,KAAKoO,SACnB9E,QAAO,SAAU0F,GAAS,OAAQpO,EAAK28B,cAAgB38B,EAAK28B,aAAa76B,eAAesM,EAAM3D,QASvG8xB,EAAYt7B,UAAU4xB,UAAY,SAAUpoB,EAAIzK,GAE5C,YADa,IAATA,IAAmBA,EAAO,IACrBZ,KAAKyR,KAAOzR,KAAKyR,IAAIgiB,UAAUpoB,EAAIzK,KACxC,SAAK,QAAOZ,KAAKoO,SAAS,QAAO,KAAM/C,KACtCzK,EAAKwe,SAAWpf,KAAKoa,QAAUpa,KAAKoa,OAAOqZ,UAAUpoB,IAE9D8xB,EAAYt7B,UAAUiT,SAAW,WAC7B,OAAO9U,KAAKsL,OAGhB6xB,EAAYE,aAAe,SAAUD,GACjC,OAAO,QAAWA,KAA+C,IAAjCA,EAA2B,iBAG/DD,EAAYK,mBAAqB,SAAUvjB,GAAO,OAAO,QAAWA,EAAa,UAEjFkjB,EAAYM,QAAU,SAAUxjB,GAAO,OAAO,QAASA,EAAwB,qBACxEkjB,EA/FqB,kPCZ5BO,EAAmC,WACnC,SAASA,EAAkBhpB,EAAQsY,EAAQ+O,EAAS4B,GAChD39B,KAAK0U,OAASA,EACd1U,KAAKgtB,OAASA,EACdhtB,KAAK+7B,QAAUA,EACf/7B,KAAK29B,UAAYA,EACjB39B,KAAK49B,MAAQ,GA4EjB,OA1EAF,EAAkB77B,UAAUqT,QAAU,WAClClV,KAAK49B,MAAQ,IAEjBF,EAAkB77B,UAAU6X,SAAW,SAAU0jB,GAC7C,IAAIQ,EAAQ59B,KAAK49B,MACbnwB,EAAQ,WAAmB2vB,GAC3B53B,EAAOiI,EAAMjI,KACjB,KAAK,QAASA,GACV,MAAM,IAAIiN,MAAM,gCACpB,GAAIzS,KAAKgtB,OAAOtqB,eAAe8C,KAAS,QAAQo4B,EAAMjvB,KAAI,QAAK,SAAUnJ,GACrE,MAAM,IAAIiN,MAAM,UAAYjN,EAAO,wBAGvC,OAFAo4B,EAAMn9B,KAAKgN,GACXzN,KAAK69B,QACEpwB,GAEXiwB,EAAkB77B,UAAUg8B,MAAQ,WAchC,IAbA,IAAI1tB,EAAQnQ,KACRqrB,EAAKrrB,KAAM49B,EAAQvS,EAAGuS,MAAO5Q,EAAS3B,EAAG2B,OAAQ+O,EAAU1Q,EAAG0Q,QAC9D+B,EAAa,GACjBC,EAAU,GACVC,EAAsB,GAClBC,EAAW,SAAUz4B,GAAQ,OAAO2K,EAAM6c,OAAOtqB,eAAe8C,IAAS2K,EAAM6c,OAAOxnB,IACtF04B,EAAkB,WACdJ,EAAW1uB,QACXe,EAAMwtB,UAAU58B,SAAQ,SAAUo9B,GAC9B,OAAOA,EAAS,aAAcL,EAAWnvB,KAAI,SAAUyO,GAAK,OAAOA,EAAE1P,aAI1EkwB,EAAMxuB,OAAS,GAAG,CACrB,IAAI3B,EAAQmwB,EAAM37B,QACdm8B,EAAS3wB,EAAMjI,KACfc,EAASy1B,EAAQC,MAAMvuB,GACvB4wB,EAAYN,EAAQ7vB,QAAQT,GAChC,GAAInH,EAAJ,CACI,IAAIg4B,EAAgBL,EAASG,GAC7B,GAAIE,GAAiBA,EAAc94B,OAAS44B,EACxC,MAAM,IAAI3rB,MAAM,UAAY2rB,EAAS,wBAEzC,IAAIG,EAAsBN,EAASG,EAAS,OACxCG,GAEAv+B,KAAK0U,OAAOkC,cAAc4nB,WAAWD,GAEzCvR,EAAOoR,GAAU3wB,EACjBzN,KAAKy+B,YAAYhxB,GACb4wB,GAAa,GACbN,EAAQve,OAAO6e,EAAW,GAC9BP,EAAWr9B,KAAKgN,OAdpB,CAiBA,IAAIixB,EAAOV,EAAoBI,GAE/B,GADAJ,EAAoBI,GAAUR,EAAMxuB,OAChCivB,GAAa,GAAKK,IAASd,EAAMxuB,OAKjC,OAFAwuB,EAAMn9B,KAAKgN,GACXywB,IACOlR,EAEFqR,EAAY,GACjBN,EAAQt9B,KAAKgN,GAEjBmwB,EAAMn9B,KAAKgN,IAGf,OADAywB,IACOlR,GAEX0Q,EAAkB77B,UAAU48B,YAAc,SAAUhxB,GAChD,IAAIA,EAAMkxB,UAAalxB,EAAMgE,IAA7B,CAEA,IAAImtB,EAAW5+B,KAAK0U,OAAOuC,WAAW0F,MACtCiiB,EAASriB,KAAKqiB,EAASC,eAAer9B,OAAOiM,MAE1CiwB,EAlF2B,sbCQlCoB,EAA+B,WAE/B,SAASA,EAAcpqB,GACnB1U,KAAK0U,OAASA,EACd1U,KAAKgtB,OAAS,GAEdhtB,KAAK29B,UAAY,GACjB39B,KAAKy7B,QAAU,IAAI,IAAaz7B,KAAKgtB,QACrChtB,KAAK+7B,QAAU,IAAI,IAAa/7B,KAAKy7B,QAAS/mB,EAAOE,mBACrD5U,KAAK++B,WAAa,IAAI,IAAkBrqB,EAAQ1U,KAAKgtB,OAAQhtB,KAAK+7B,QAAS/7B,KAAK29B,WAChF39B,KAAKg/B,gBAmJT,OAhJAF,EAAcj9B,UAAUm9B,cAAgB,YAUvBh/B,KAAKi/B,MAAQj/B,KAAK++B,WAAWrlB,SATvB,CACflU,KAAM,GACNiM,IAAK,IACL+I,MAAO,KACPpM,OAAQ,CACJ,IAAK,CAAE5J,MAAO,KAAM0K,KAAM,OAAQye,SAAS,IAE/CgR,UAAU,KAGRvE,UAAY,MAGtB0E,EAAcj9B,UAAUqT,QAAU,WAC9B,IAAI/E,EAAQnQ,KACZA,KAAK++B,WAAW7pB,UAChBlV,KAAK29B,UAAY,GACjB39B,KAAK0Q,MAAM3P,SAAQ,SAAU0M,GAAS,OAAO0C,EAAMO,IAAIjD,IAAU0C,EAAMquB,WAAW/wB,OAgCtFqxB,EAAcj9B,UAAUq9B,gBAAkB,SAAUf,GAEhD,OADAn+B,KAAK29B,UAAUl9B,KAAK09B,GACb,YACH,QAAWn+B,KAAK29B,UAAhB,CAA2BQ,IAC7B76B,KAAKtD,OAWX8+B,EAAcj9B,UAAU+b,KAAO,WAC3B,OAAO5d,KAAKi/B,OAchBH,EAAcj9B,UAAU6X,SAAW,SAAUylB,GACzC,OAAOn/B,KAAK++B,WAAWrlB,SAASylB,IAGpCL,EAAcj9B,UAAUu9B,gBAAkB,SAAU3xB,GAChD,IAAI0C,EAAQnQ,KACRyb,EAAMzb,KAAK0Q,MAAM/B,KAAI,SAAUyO,GAAK,OAAOA,EAAEpJ,aAC7CqrB,EAAc,SAAUrS,GACxB,IAAIsS,EAAY7jB,EAAInS,QAAO,SAAU8T,GAAK,OAAqC,IAA9B4P,EAAO9e,QAAQkP,EAAEhD,WAClE,OAA4B,IAArBklB,EAAUlwB,OAAekwB,EAAYA,EAAUl9B,OAAOi9B,EAAYC,KAEzE12B,EAAWy2B,EAAY,CAAC5xB,IACxB8xB,EAAe,CAAC9xB,GAAOrL,OAAOwG,GAAUoX,UAW5C,OAVAuf,EAAax+B,SAAQ,SAAUksB,GAC3B,IAAI2R,EAAWzuB,EAAMuE,OAAOuC,WAAW0F,MAEvCiiB,EACKjiB,QACArT,QAAO,QAAO,QAAS2jB,IACvBlsB,SAAQ,SAAUwb,GAAQ,OAAOqiB,EAASY,WAAWjjB,aAEnDpM,EAAM6c,OAAOC,EAAOznB,SAExB+5B,GAWXT,EAAcj9B,UAAU28B,WAAa,SAAU/B,GAC3C,IAAIxP,EAASjtB,KAAK0Q,IAAI+rB,GACtB,IAAKxP,EACD,MAAM,IAAIxa,MAAM,sCAAwCgqB,GAC5D,IAAIgD,EAAqBz/B,KAAKo/B,gBAAgBnS,EAAOjZ,WAIrD,OAHAhU,KAAK29B,UAAU58B,SAAQ,SAAUo9B,GAC7B,OAAOA,EAAS,eAAgBsB,EAAmB9wB,KAAI,SAAUyO,GAAK,OAAOA,EAAE1P,YAE5E+xB,GAEXX,EAAcj9B,UAAU6O,IAAM,SAAU+rB,EAAaC,GACjD,IAAIvsB,EAAQnQ,KACZ,GAAyB,IAArBgC,UAAUoN,OACV,OAAOmE,OAAOC,KAAKxT,KAAKgtB,QAAQre,KAAI,SAAUnJ,GAAQ,OAAO2K,EAAM6c,OAAOxnB,GAAMkI,QACpF,IAAIgyB,EAAQ1/B,KAAKy7B,QAAQ3a,KAAK2b,EAAaC,GAC3C,OAAQgD,GAASA,EAAMhyB,MAAS,MAYpCoxB,EAAcj9B,UAAUiV,UAAY,SAAU6oB,EAAUC,GACpD,OAAO5/B,KAAK+7B,QAAQA,QAAQ4D,EAAUC,IAEnCd,EA7JuB,2SCsB9Be,EAA6B,WAe7B,SAASA,EAAYC,EAAgBC,EAAaC,EAASC,GACvDjgC,KAAK8/B,eAAiBA,EACtB9/B,KAAK+/B,YAAcA,EACnB//B,KAAK+/B,YAAcA,EACnB//B,KAAKggC,SAAU,QAAO,GAAIA,GAAW,IACrChgC,KAAKigC,UAAW,QAAO,GAAIA,GAAY,IACvCjgC,KAAKkgC,YAAcJ,EAAerE,QAAQ3a,KAAKif,EAAa//B,KAAKigC,SAASE,UAsF9E,OAnFAN,EAAYh+B,UAAU2D,KAAO,WACzB,OAAQxF,KAAKkgC,aAAelgC,KAAKkgC,YAAY16B,MAASxF,KAAK+/B,aAG/DF,EAAYh+B,UAAU4qB,WAAa,WAC/B,OAAOzsB,KAAK+/B,aAGhBF,EAAYh+B,UAAUuM,OAAS,WAC3B,OAAOpO,KAAKggC,SAGhBH,EAAYh+B,UAAU4W,OAAS,WAC3B,OAAOzY,KAAKkgC,aAGhBL,EAAYh+B,UAAU4L,MAAQ,WAC1B,OAAOzN,KAAKkgC,aAAelgC,KAAKkgC,YAAYxyB,MAGhDmyB,EAAYh+B,UAAU1B,QAAU,WAC5B,OAAOH,KAAKigC,UAGhBJ,EAAYh+B,UAAUu+B,OAAS,WAC3B,SAAUpgC,KAAKkgC,cAAelgC,KAAKkgC,YAAYxyB,OAGnDmyB,EAAYh+B,UAAUw+B,MAAQ,WAC1B,OAAQrgC,KAAKqF,SAGjBw6B,EAAYh+B,UAAUwD,MAAQ,WAC1B,IAAIq3B,EAAO18B,KAAKG,UAAUggC,SAC1B,IAAKngC,KAAKkgC,aAAiBxD,EAAM,CAC7B,IAAIF,EAAYE,EAAKl3B,KAAOk3B,EAAKl3B,KAAOk3B,EACxC,MAAO,sBAAwB18B,KAAKwF,OAAS,iBAAmBg3B,EAAY,IAEhF,OAAKx8B,KAAKkgC,YAELlgC,KAAKkgC,YAAYxyB,UAAtB,EACW,UAAY1N,KAAKwF,OAAS,8BAF1B,kBAAoBxF,KAAKwF,OAAS,KAIjDq6B,EAAYh+B,UAAUiT,SAAW,WAC7B,MAAO,IAAM9U,KAAKwF,OAAS,KAAM,QAAUxF,KAAKoO,WAQpDyxB,EAAYh+B,UAAUy+B,UAAY,SAAU7yB,GACxC,OAAO,IAAIoyB,EAAY7/B,KAAK8/B,eAAgBryB,EAAOzN,KAAKggC,QAAShgC,KAAKigC,WAS1EJ,EAAYh+B,UAAU0+B,WAAa,SAAUnyB,EAAQ2G,QACjC,IAAZA,IAAsBA,GAAU,GACpC,IAAI8d,EAAY9d,EAAU3G,GAAS,QAAO,GAAIpO,KAAKggC,QAAS5xB,GAC5D,OAAO,IAAIyxB,EAAY7/B,KAAK8/B,eAAgB9/B,KAAK+/B,YAAalN,EAAW7yB,KAAKigC,WASlFJ,EAAYh+B,UAAU2+B,YAAc,SAAUrgC,EAAS4U,QACnC,IAAZA,IAAsBA,GAAU,GACpC,IAAI0rB,EAAU1rB,EAAU5U,GAAU,QAAO,GAAIH,KAAKigC,SAAU9/B,GAC5D,OAAO,IAAI0/B,EAAY7/B,KAAK8/B,eAAgB9/B,KAAK+/B,YAAa//B,KAAKggC,QAASS,IAGhFZ,EAAYa,MAAQ,SAAUzmB,GAC1B,OAAOA,GAAOA,EAAIxM,SAAU,QAASwM,EAAIxM,SAAW,QAASwM,EAAIxM,SAAU,QAASwM,EAAIxM,MAAMjI,QAE3Fq6B,EA3GqB,iYCf5Bc,EAA6B,WAC7B,SAASA,EAAY1U,GACjBjsB,KAAKisB,WAAaA,EA2EtB,OAzEA0U,EAAY9+B,UAAU++B,mBAAqB,SAAUC,GACjD,IAAI1wB,EAAQnQ,KAEZ,OADmBA,KAAKisB,WAAWvX,OAAOoY,kBACtB9iB,WACf82B,WAAWD,GACXlyB,KAAI,SAAUO,GAAQ,OAAOiB,EAAM4wB,WAAW7xB,MAC9CN,OAAO,KAAS,IAChBtF,OAAO,OAWhBq3B,EAAY9+B,UAAUk/B,WAAa,SAAUC,GACzC,IAAI/U,EAAajsB,KAAKisB,WAClBvd,EAAcud,EAAWvd,cAEzBuyB,EAAgBjhC,KAAKkhC,iBAAiBF,EAAUtyB,EAAaud,GACjE,IAAKgV,EACD,MAAO,GACX,IA4DWE,EA5DPC,EAAkB,CAClBnV,WAAYA,EACZnG,QAASmG,EAAW9rB,UAAU2lB,SAkBlC,OAAOmb,EACFtyB,KAjBqB,SAAUkF,GAMhC,OAJcA,EAAKqP,QAAQxU,EAAaud,GAEZ+U,EAASK,kBAAkB77B,MAElCmJ,KAAI,SAAUJ,GAC/B,IAAI0xB,GAAW,QAAO,CAClB38B,KAAMuQ,EAAKvQ,KACXg+B,UAAW,CAAEN,SAAUA,EAASx7B,KAAMqL,QAAStC,IAChD6yB,GACC3zB,EAAQuzB,EAASK,kBAAkBv+B,QAAU,UAA4ByL,EAAKd,MAAMC,KAAO,KAC3F6zB,EAAiB,IAAI,IAAetV,EAAYxe,EAAOoG,EAAMosB,GACjE,MAAO,CAAEpsB,KAAMA,EAAMtF,KAAMA,EAAMgzB,eAAgBA,SAKpD3yB,OAAO,KAAS,IAChB4c,MAqCM2V,EArCSH,EAASQ,iBAsCR,IAArBL,IAA+BA,GAAmB,GAC/C,SAA+B1O,EAAGlV,GACrC,IAAIkkB,EAASN,GAAoB,EAAI,EACjCO,GAAcjP,EAAElkB,KAAKd,MAAMtF,KAAKiH,OAASmO,EAAEhP,KAAKd,MAAMtF,KAAKiH,QAAUqyB,EACzE,OAAsB,IAAfC,EAAmBA,EAAankB,EAAE1J,KAAKzM,SAAWqrB,EAAE5e,KAAKzM,YAzC3DuH,KAAI,SAAU8E,GAAS,OAAOA,EAAM8tB,mBAa7CZ,EAAY9+B,UAAUq/B,iBAAmB,SAAUF,EAAUtyB,EAAaud,GACtE,IAAI0V,EAAWX,EAASY,YAAc,WAElC/6B,EAAe7G,KAAKisB,WAAWvX,OAAOoY,kBAE1C,OADiB6U,EAAW,CAAC96B,GAAgB,CAAC7G,KAAKisB,WAAYplB,IAE1D8H,KAAI,SAAUkzB,GAAO,OAAOA,EAAIC,SAASd,EAASx7B,SAClD8D,QAAO,QAAgB,KAAS,uBAAyB03B,EAASx7B,OAClEoJ,OAAO,KAAS,IAChBtF,QAAO,SAAUuK,GAAQ,OAAOA,EAAKqP,QAAQxU,EAAaud,OAE5D0U,EA7EqB,+PCDzB,SAASoB,EAAWt0B,EAAOu0B,EAAW/V,GACzC,IAAIgW,GAAU,QAASD,GAAa,CAACA,GAAaA,EAYlD,UADe,QAAWC,GAAWA,EAVrC,SAAoBhV,GAEhB,IADA,IAAIiV,EAAcD,EACT5kB,EAAI,EAAGA,EAAI6kB,EAAY9yB,OAAQiO,IAAK,CACzC,IAAIwF,EAAO,IAAI,KAAKqf,EAAY7kB,IAChC,GAAKwF,GAAQA,EAAKK,QAAQ+J,EAAOznB,QAAYqd,GAAQqf,EAAY7kB,KAAO4P,EAAOznB,KAC3E,OAAO,EAGf,OAAO,IAGMiI,EAAOwe,GAK5B,IAAIkW,EAAgC,WAChC,SAASA,EAAeC,EAASC,EAAW7hC,EAAU8hC,EAAeC,EAAwBpiC,QACzE,IAAZA,IAAsBA,EAAU,IACpCH,KAAKoiC,QAAUA,EACfpiC,KAAKqiC,UAAYA,EACjBriC,KAAKQ,SAAWA,EAChBR,KAAKsiC,cAAgBA,EACrBtiC,KAAKuiC,uBAAyBA,EAC9BviC,KAAKwiC,YAAc,EACnBxiC,KAAKyiC,eAAgB,EACrBziC,KAAKoH,SAAWjH,EAAQiH,UAAY,EACpCpH,KAAKsD,KAAOnD,EAAQmD,MAAQ,KAC5BtD,KAAK0iC,YAAcviC,EAAQuiC,YAqF/B,OApEAP,EAAetgC,UAAU8gC,eAAiB,SAAUC,EAAOZ,EAAW/V,GAClE,IAAkB,IAAd+V,EACA,OAAOY,EACX,IAAIpN,EAAWoN,EAAMt5B,QAAO,SAAUiF,GAAQ,OAAOwzB,EAAWxzB,EAAKd,MAAOu0B,EAAW/V,MACvF,OAAOuJ,EAASpmB,OAASomB,EAAW,MAgBxC2M,EAAetgC,UAAUghC,yBAA2B,WAChD,OAAO,QAAO7iC,KAAKoiC,QAAQp4B,WAAW84B,iBAAiB,WAAc,OAAO,MAiBhFX,EAAetgC,UAAUkhC,kBAAoB,SAAUr0B,EAAaud,GAChE,IAAI9b,EAAQnQ,KACR8P,GAAW,QAAO9P,KAAK6iC,2BAA4B7iC,KAAKsiC,eAE5D,OADY,QAAOtiC,KAAKoiC,QAAQp4B,WAAW84B,iBAC9Bl0B,QAAO,SAAUo0B,EAAIC,GAG9B,IAAIC,EAAcD,EAASngC,QAAU,UACjCqF,EAAOuG,EAAYu0B,EAASz9B,OAAS,GACrCo9B,EAAQM,EAAc/6B,EAAO,EAAC,QAAKA,IAEvC,OADA66B,EAAGC,EAASz9B,MAAQ2K,EAAMwyB,eAAeC,EAAO9yB,EAASmzB,EAASz9B,MAAOymB,GAClE+W,IACR,KAQPb,EAAetgC,UAAUqhB,QAAU,SAAUxU,EAAaud,GACtD,IAAI/I,EAAUljB,KAAK+iC,kBAAkBr0B,EAAaud,GAGlD,OADiB,QAAO/I,GAASigB,MAAM,MACnBjgB,EAAU,MAElCif,EAAetgC,UAAU28B,WAAa,WAClCx+B,KAAKuiC,uBAAuBviC,MAC5BA,KAAKyiC,eAAgB,GAElBN,EAjGwB,GAqG5B,SAASiB,EAAUtP,EAAUhH,EAAmBuV,GAEnD,IACIgB,GADoBvP,EAASwP,iBAAmBxP,EAASwP,kBAAoB,IACnDjB,EAAU78B,MAAQ,GAC5C+9B,GAAe,QAAWF,GAG9B,SAASG,EAAmBC,EAAajjC,EAAUL,QAC/B,IAAZA,IAAsBA,EAAU,IACpC,IAAI6pB,EAAiB,IAAImY,EAAerV,EAAmBuV,EAAW7hC,EAAUijC,EAAaF,EAAcpjC,GAE3G,OADAkjC,EAAM5iC,KAAKupB,GACJA,EAAewU,WAAWl7B,KAAK0mB,GAE1C,OAPA8J,EAASuO,EAAU78B,MAAQg+B,EAOpBA,2FCpJX,IAAIE,EAQAC,2BAPJ,SAAWD,GACPA,EAAoBA,EAA4B,OAAI,GAAK,SACzDA,EAAoBA,EAA4B,OAAI,GAAK,SACzDA,EAAoBA,EAAyB,IAAI,GAAK,MACtDA,EAAoBA,EAA6B,QAAI,GAAK,UAC1DA,EAAoBA,EAA2B,MAAI,GAAK,QAL5D,CAMGA,IAAwBA,EAAsB,KAEjD,SAAWC,GACPA,EAAoBA,EAAgC,WAAI,GAAK,aAC7DA,EAAoBA,EAA2B,MAAI,GAAK,QAF5D,CAGGA,IAAwBA,EAAsB,8HCP7CC,2LACJ,SAAWA,GAOPA,EAAWA,EAAuB,WAAI,GAAK,aAM3CA,EAAWA,EAAoB,QAAI,GAAK,UAMxCA,EAAWA,EAAoB,QAAI,GAAK,UAWxCA,EAAWA,EAAoB,QAAI,GAAK,UAMxCA,EAAWA,EAAkB,MAAI,GAAK,QApC1C,CAqCGA,IAAeA,EAAa,KAG/B,IAAIv4B,EAAK,EACLw4B,EAA2B,WAC3B,SAASA,EAAU30B,EAAM40B,EAASC,GAE9B/jC,KAAKmb,IAAM9P,IACXrL,KAAKkP,KAAOA,EACZlP,KAAK8jC,QAAUA,EACf9jC,KAAK+jC,OAASA,EA4DlB,OAzDAF,EAAUG,mBAAqB,SAAU/pB,GACrC,OAAOA,GAA2B,mBAAbA,EAAIlP,OAAuB,IAAAmO,IAAG2qB,EAAH,CAAc5pB,EAAIyN,uBAGtEmc,EAAUI,WAAa,SAAUF,EAAQ5jC,GACrC,IACI+jC,EAAY,IAAIL,EAAUD,EAAWO,WAD3B,+DACgDJ,GAI9D,OAHI5jC,GAAWA,EAAQikC,aACnBF,EAAUE,YAAa,GAEpBF,GAGXL,EAAUO,WAAa,SAAUL,GAC7B,OAAOF,EAAUI,WAAWF,EAAQ,CAAEK,YAAY,KAGtDP,EAAUQ,QAAU,SAAUN,GAE1B,OAAO,IAAIF,EAAUD,EAAWU,QADlB,6BACoCP,IAGtDF,EAAUzK,QAAU,SAAU2K,GAE1B,OAAO,IAAIF,EAAUD,EAAWW,QADlB,6BACoCR,IAGtDF,EAAUW,QAAU,SAAUT,GAE1B,OAAO,IAAIF,EAAUD,EAAWa,QADlB,kCACoCV,IAGtDF,EAAUa,QAAU,SAAUX,GAE1B,OAAO,IAAIF,EAAUD,EAAWe,MADlB,yBACkCZ,IAWpDF,EAAUe,UAAY,SAAUb,GAC5B,OAAO,IAAA7qB,IAAG2qB,EAAH,CAAcE,GAAUA,EAASF,EAAUa,QAAQX,IAE9DF,EAAUhiC,UAAUiT,SAAW,WAC3B,IAA6BqkB,EACzB4K,GADyB5K,EACHn5B,KAAK+jC,SADgB5K,EAAErkB,WAAavB,OAAO1R,UAAUiT,SAAWqkB,EAAErkB,YAAa,QAAUqkB,GAE/G9N,EAAKrrB,KACT,MAAO,6BADcqrB,EAAGlQ,IACoB,UADRkQ,EAAGnc,KACwB,cADRmc,EAAGyY,QAC+B,aAAeC,EAAS,KAErHF,EAAUhiC,UAAUgjC,UAAY,WAC5B,OAAO,SAAO,QAAgB7kC,MAAO,CAAE0nB,qBAAsB1nB,QAE1D6jC,EAlEmB,oMC1C1BiB,EAEA,SAA6Bt/B,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,QACpG,IAAhB1D,IAA0BA,GAAc,QACnB,IAArBwD,IAA+BA,EAAmB,wBAC9B,IAApBC,IAA8BA,EAAkB,uBAChC,IAAhBC,IAA0BA,GAAc,GAC5CllC,KAAKwF,KAAOA,EACZxF,KAAK4hC,UAAYA,EACjB5hC,KAAK+kC,UAAYA,EACjB/kC,KAAKqhC,kBAAoBA,EACzBrhC,KAAKwhC,YAAcA,EACnBxhC,KAAKglC,iBAAmBA,EACxBhlC,KAAKilC,gBAAkBA,EACvBjlC,KAAKklC,YAAcA,gsBCVvBC,EAAiB,CACjBrf,QAAS,KACTmG,WAAY,KACZqV,UAAW,GACXh+B,KAAM,MAEN8hC,EAAgC,WAChC,SAASA,EAAenZ,EAAYoZ,EAAcrb,EAAgB7pB,GAC9D,IAAIgQ,EAAQnQ,KACZA,KAAKisB,WAAaA,EAClBjsB,KAAKqlC,aAAeA,EACpBrlC,KAAKgqB,eAAiBA,EACtBhqB,KAAKG,QAAUA,EACfH,KAAKslC,aAAe,WAAc,OAAOn1B,EAAMjB,KAAK0yB,YAAc,UAA4BzxB,EAAMhQ,QAAQ8rB,WAAWsZ,YACvHvlC,KAAKG,SAAU,QAASA,EAASglC,GACjCnlC,KAAKkP,KAAO8a,EAAeqY,UAyK/B,OArJA+C,EAAenJ,MAAQ,SAAUoH,EAAOmC,GAGpC,OAAOnC,EAAMz0B,QADU,SAAU8vB,EAAM+G,GAAY,OAAO/G,EAAK3zB,MAAK,WAAc,OAAO06B,EAASC,kBAC5DF,GAAW,gBAarDJ,EAAeO,YAAc,SAAUtC,EAAOuC,GAC1C,IAAK,IAAI32B,EAAM,EAAGA,EAAMo0B,EAAMj0B,OAAQH,IAAO,CACzC,IAAIib,EAAamZ,EAAMp0B,GAAKy2B,aAC5B,IAAI,QAAUxb,GAAa,CACvB,IAAI2b,EAAiBxC,EAAMvhC,MAAMmN,EAAM,GACvC,OAAOm2B,EAAenJ,MAAM4J,EAAgB3b,GAAYnf,KAAK66B,IAGrE,OAAOA,KAKXR,EAAeU,YAAc,SAAUzC,GACnCA,EAAMtiC,SAAQ,SAAU8S,GAAQ,OAAOA,EAAK6xB,iBAEhDN,EAAevjC,UAAUkkC,SAAW,SAAU7Y,GAC1CltB,KAAKisB,WAAWvX,OAAOmC,aAAamvB,qBAApChmC,CAA0DktB,IAE9DkY,EAAevjC,UAAU6jC,WAAa,WAClC,IAAIv1B,EAAQnQ,KACR6T,EAAO7T,KAAKgqB,eAChB,IAAInW,EAAK4uB,cAAT,CAEA,IAAIwD,EAAajmC,KAAKkmC,yBACtB,GAAID,EACA,OAAOA,EACX,IAAI9lC,EAAUH,KAAKG,QACnB,yBAA0BH,KAAMA,KAAKisB,WAAY9rB,GACjD,IAEIgmC,EAAc,SAAUjZ,GAAO,OAAOrZ,EAAKwuB,UAAU4C,gBAAgB90B,EAA/B0D,CAAsCqZ,IAC5EkZ,EAAe,SAAU9/B,GAAU,OAAOuN,EAAKwuB,UAAU2C,iBAAiB70B,EAAhC0D,CAAuCvN,IACrF,IACI,IAAIA,EALkCuN,EAAKrT,SAASuB,KAAK5B,EAAQmD,KAAM6M,EAAM8b,WAAY9b,EAAMk1B,cAM/F,OAAKrlC,KAAKkP,KAAKg2B,cAAe,QAAU5+B,GAC7BA,EAAO+b,OANH,SAAU6K,GAAO,OAAO,cAAoBA,GAAK2X,eAM1B95B,KAAKq7B,EAAcD,GAG9CC,EAAa9/B,GAG5B,MAAO4mB,GAEH,OAAOiZ,EAAY,cAAoBjZ,IAE3C,QACQrZ,EAAK6uB,eAAiB7uB,EAAK2uB,aAAe3uB,EAAK6uB,aAC/C7uB,EAAK2qB,gBAajB4G,EAAevjC,UAAUwkC,iBAAmB,SAAU//B,GAClD,IAAI6J,EAAQnQ,KAEZ,OADiBA,KAAKkmC,4BAIlB,QAAU5/B,GAEHA,EAAOyE,MAAK,SAAU/G,GAAO,OAAOmM,EAAMk2B,iBAAiBriC,OAEtE,qBAAsBsC,EAAQtG,KAAKisB,WAAYjsB,KAAKG,UAErC,IAAXmG,EAEO,YAAkB,2BAA2Bu+B,aAEpC,IAAA3rB,IAAG,IAEnBotB,CAAchgC,GAEP,eAAqBA,GAAQu+B,iBAFxC,KASJO,EAAevjC,UAAUqkC,uBAAyB,WAC9C,IAAIxxB,EAAS1U,KAAKisB,WAAWvX,OAE7B,OAAIA,EAAOqkB,UACA,YAAkB,sBAAwBrkB,EAAOyG,IAAM,gCAAgC0pB,YAE9F7kC,KAAKisB,WAAWsa,SACT,cAAoB1B,YAI3B7kC,KAAKslC,eAEE,eAAqBtlC,KAAKG,QAAQ2lB,WAAW+e,iBAFxD,GAKJO,EAAevjC,UAAUiT,SAAW,WAChC,IAAe3U,EAANH,KAAmBG,QAAS6pB,EAA5BhqB,KAAgDgqB,eACrDzpB,GAAQ,QAAM,qBAAN,CAA4BJ,IAAY,WAAY0Q,GAAU,QAAM,+BAAN,CAAsC1Q,KAAY,QAAM,oBAAN,CAA2BA,IAAY,UAAWqF,GAAO,QAAWwkB,EAAexpB,UAC/M,OAAOD,EAAQ,aAAesQ,EAAU,MAAO,QAAU,IAAKrL,IAMlE4/B,EAAeoB,cAAgB,SAAU3yB,GAAQ,OAAO,SAAUvN,GAC9D,OAAOuN,EAAKwyB,iBAAiB//B,KAMjC8+B,EAAeqB,oBAAsB,SAAU5yB,GAAQ,OAAO,SAAUvN,IACpE,QAAUA,IAAWA,EAAO+b,OAAM,SAAU6K,GAAO,OAAOrZ,EAAKkyB,SAAS,cAAoB7Y,SAOhGkY,EAAesB,UAAY,SAAU7yB,GAAQ,OAAO,SAAUxO,GAAS,OAAOwO,EAAKkyB,SAAS1gC,KAC5F+/B,EAAeuB,aAAe,SAAU9yB,GAAQ,OAAO,SAAUxO,GAAS,OAAO,QAAgBA,KACjG+/B,EAAewB,YAAc,SAAU/yB,GAAQ,OAAO,SAAUxO,GAC5D,MAAMA,IAEH+/B,EAlLwB,qgBCXnC,SAASyB,EAAmBj3B,GACxBA,EAAMk3B,cAAc,cAAoB,IAAUl3B,EAAM8E,QAAS,IACjE9E,EAAMk3B,cAAc,cAAoB,IAAYl3B,GAAQ,IAC5DA,EAAMk3B,cAAc,cAAoB,eAAgBl3B,GAAQ,IAChEA,EAAMk3B,cAAc,cAAoB,eAAgBl3B,EAAMxB,UAAW,IACzEwB,EAAMuc,WAAWprB,SAAQ,SAAU0M,GAC/BmC,EAAMk3B,cAAc,cAAoB,UAAWr5B,GAAQA,MAG5D,IAGHs5B,EAAoB,CAAC,eAAgB,KACrCC,GAAe,QAAQD,GAKhBE,EAAqB,SAAUr3B,GACtC,IAAIgzB,GAAQ,QAAOhzB,EAAMlB,eAAeE,OAAO,KAAS,IAAIA,OAAO,KAAO,IAEtEs4B,EAA4B,SAAU3pB,GACtC,OAAOypB,EAAazpB,EAAEgE,OAAS,cAAoBhE,EAAEgE,MAAO,MAAQhE,GAExEqlB,EAAM7hC,SAAQ,SAAUwN,GACpBA,EAAKwJ,YAAcxJ,EAAKwJ,YAAYpJ,IAAIu4B,+MCnB5CC,EAAiB,SAAUv3B,GAC3B,IAAIw3B,EAAWx3B,EAAMuf,KAAKkY,WAC1B,GAAKD,EAAL,CAEA,IAAI3uB,EAAS7I,EAAM8E,OAAOmC,aAW1B,OAAI,QAAWuwB,GACJ,YAAiBA,EAASx3B,IAAQ7E,KAAKq7B,GAE3CA,EAAagB,GAbpB,SAAShB,EAAa9/B,GAClB,GAAKA,EAEL,OAAIA,aAAkB,IACXA,GACP,QAASA,GACFmS,EAAOpS,OAAOC,EAAQsJ,EAAMxB,SAAUwB,EAAMzP,WACnDmG,EAAc,OAAKA,EAAe,OAC3BmS,EAAOpS,OAAOC,EAAc,OAAKsJ,EAAMuf,KAAM7oB,EAAe,QAAKsJ,EAAMxB,SAAUwB,EAAMzP,gBADlG,IChBR,SAASmnC,EAAwB3zB,GAC7B,OAAO,SAAUsY,EAAYxe,GAGzB,OAAO85B,EAFM95B,EAAMuG,UACCL,IACNsY,EAAYxe,IAYlC,IAAI+5B,EAAaF,EAAwB,UAarCG,EAAeH,EAAwB,YAavCI,EAAcJ,EAAwB,2MC7C/BK,EAAwB,IAU/BC,EAAmB,SAAUh4B,GAC7B,OAAO,IAAI,IAAeA,EAAMlB,cAAcygB,IAAIuI,YAAY,QAAS9nB,GAAO7E,KAAK,OAcnF88B,EAAmB,SAAUj4B,EAAOnC,GACpC,OAAO,IAAI,IAAemC,EAAMlB,cAAcygB,IAAIpb,WAAWtG,EAAMuG,WAAW0jB,YAAY,OAAQ9nB,GAAO7E,KAAK,OAe9G+8B,EAAmB,SAAUl4B,GAC7B,OAAO,IAAI,IAAeA,EAAMlB,cAAcygB,IAAIuI,YAAY,OAAQ9nB,GAAO7E,KAAK,OCnClFg9B,EAAoB,SAAU9b,GAC9B,IAAIllB,EAAK,OACLihC,EAAgB/b,EAAWzR,MAAM,YACrC,GAAKwtB,EAAc54B,OAEnB,OAAOrI,EAAG0U,IAAIusB,EAAcr5B,KAAI,SAAUmL,GAAQ,OAAO/S,EAAGkJ,KAAK6J,EAAKuB,YAAatQ,KAAK,OAexFk9B,EAAgB,SAAUhc,GAC1B,IAAI+b,EAAgB/b,EAAWzR,MAAM,YACjC0tB,EAAejc,EAAWzR,MAAM,WACpC,GAAKwtB,EAAc54B,QAAW84B,EAAa94B,OAA3C,CAEA,IAAItI,EAAQmlB,EAAWvX,OAAOqC,YAC9BmxB,EAAannC,SAAQ,SAAUonC,GAAM,OAAOrhC,EAAMshC,qBAAqBD,MACvEH,EAAcjnC,SAAQ,SAAUonC,GAAM,OAAOrhC,EAAMuhC,mBAAmBF,MACtErhC,EAAM8lB,SCzBN0b,EAAoB,SAAU14B,GAC9B,IAAI0I,EAAU1I,EAAM8E,OAAO4D,QAOvBiwB,EAAyB,WAErBjwB,EAAQ2T,aAAerc,IACvB0I,EAAQ2T,WAAa,OAE7Brc,EAAM7B,UAAU,IAXW,WACvBuK,EAAQ0T,sBAAsBxG,QAAQ5V,GACtC0I,EAAQwa,SAAWljB,EAAMmjB,MACzBza,EAAQwN,QAAUxN,EAAQwa,SAASplB,MACnC,QAAKkC,EAAMxB,SAAUkK,EAAQlK,UAOS,CAAEhH,SAAU,MACtDwI,EAAMnM,QAAQsH,KAAKw9B,EAAwBA,ICtB3CC,EAAY,SAAUvc,GACtB,IAAI9rB,EAAU8rB,EAAW9rB,UACrBsY,EAASwT,EAAWvX,OAAOmC,aAC3B6B,EAAauT,EAAWvX,OAAOyH,UAKnC,GAAuB,QAAnBhc,EAAQ4e,QAAoB5e,EAAQ0V,UAAY4C,EAAOqa,SAASsH,UAAW,CAC3E,IAAIqO,EAAa,CAAE1zB,QAA8B,YAArB5U,EAAQ0V,UACpC6C,EAAWjY,KAAKgY,EAAOqa,SAASsH,UAAU3oB,IAAKgH,EAAOrK,OAAQq6B,GAElE/vB,EAAW0D,QAAO,kWCPtB,SAASssB,EAAY94B,GACjB,IAAI+4B,EAAgB/4B,EAAMg5B,iBAC1B,GAAKD,EAAL,CAEAtgC,EAAA,0BAA6BuH,GAC7B,IAAIi5B,EAAUj5B,EAAM8E,OAAO4D,QAAQ2T,WAOnC,MAHsB,kBAAlB0c,GAAqCE,GACrCA,EAAQC,QAEL,cAAoBjE,aCf/B,SAASkE,EAAsBn5B,GAC3B,IAAKA,EAAMywB,QACP,MAAM,IAAI5tB,MAAM7C,EAAMvK,QAAQyP,YAG/B,ICaIk0B,EAAmB,CAC1BnzB,UAAU,EACVsqB,SAAU,KACV/gB,SAAS,EACT6pB,QAAQ,EACRC,QAAQ,EACRC,WAAW,EACXC,OAAQ,GACRtjB,QAAS,WAAc,OAAO,MAC9B/G,OAAQ,WAaRsqB,EAAmC,WAEnC,SAASA,EAAkBC,GAEvBtpC,KAAKupC,iBAAmB,EAExBvpC,KAAKwpC,YAAc,GAEnBxpC,KAAKsjC,iBAAmB,GAExBtjC,KAAKypC,eAAiB,GACtBzpC,KAAKspC,QAAUA,EACftpC,KAAK8G,MAAQwiC,EAAQvyB,YACrB/W,KAAK0pC,mBAAqB,GAC1B1pC,KAAKgK,YAAc,SAAqB,QAAIhK,MAAO,IAAI,QAAIA,MAAO,CAC9D,kBACA,eACA,gBACA,aACA,aAEJA,KAAK2pC,mBACL3pC,KAAK4pC,oBACL5pC,KAAK6pC,+BACLP,EAAQhxB,QAAQ0T,sBAAsBzG,QAAQ0hB,GAuLlD,OA9JAoC,EAAkBxnC,UAAUioC,SAAW,SAAUh6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkO,SAAW,SAAUD,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkoC,QAAU,SAAUj6B,EAAUtP,EAAUL,KAIpEkpC,EAAkBxnC,UAAUmoC,OAAS,SAAUl6B,EAAUtP,EAAUL,KAInEkpC,EAAkBxnC,UAAUooC,SAAW,SAAUn6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUqoC,QAAU,SAAUp6B,EAAUtP,EAAUL,KAIpEkpC,EAAkBxnC,UAAUsoC,SAAW,SAAUr6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkM,UAAY,SAAU+B,EAAUtP,EAAUL,KAItEkpC,EAAkBxnC,UAAUuoC,QAAU,SAAUt6B,EAAUtP,EAAUL,KAOpEkpC,EAAkBxnC,UAAUqT,QAAU,SAAUR,IAC5C,QAAO1U,KAAKsjC,kBAAkBviC,SAAQ,SAAUspC,GAC5C,OAAOA,EAAWtpC,SAAQ,SAAU8S,GAChCA,EAAK4uB,eAAgB,GACrB,QAAW4H,EAAYx2B,UAenCw1B,EAAkBxnC,UAAUL,OAAS,SAAUyyB,EAAUzH,GACrD,OAAO,IAAI,IAAWyH,EAAUzH,EAAaxsB,KAAKspC,UAGtDD,EAAkBxnC,UAAU+nC,kBAAoB,WAC5C,IAAIU,EAAQ,IACRC,EAAK,IACLC,EAAQxqC,KAAKypC,eACbgB,GAAc,EACdC,GAAc,EAClB1qC,KAAK2qC,aAAa,WAAYL,EAAMM,OAAQ,EAAGJ,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG3D,YAAa8D,GAC9G1qC,KAAK2qC,aAAa,WAAYL,EAAMO,OAAQ,EAAGL,EAAMrb,IACrDnvB,KAAK2qC,aAAa,UAAWL,EAAMQ,IAAK,EAAGN,EAAMrb,IACjDnvB,KAAK2qC,aAAa,SAAUL,EAAMQ,IAAK,IAAKN,EAAMv8B,SALV,GAMxCjO,KAAK2qC,aAAa,WAAYL,EAAMQ,IAAK,IAAKN,EAAMrV,UACpDn1B,KAAK2qC,aAAa,UAAWL,EAAMQ,IAAK,IAAKN,EAAMre,UACnDnsB,KAAK2qC,aAAa,WAAYL,EAAMQ,IAAK,IAAKN,EAAMrb,IACpDnvB,KAAK2qC,aAAa,YAAaL,EAAMS,QAAS,EAAGP,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG7D,UAAWgE,GAC9G1qC,KAAK2qC,aAAa,UAAWL,EAAM3F,MAAO,EAAG6F,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG7D,UAAWgE,IAG9GrB,EAAkBxnC,UAAU8nC,iBAAmB,WAC3C,IAAIqB,EAAQ,UAA2BrhB,EAAa,eACpD3pB,KAAKirC,gBAAgB,KAAMthB,GAC3B3pB,KAAKirC,gBAAgB,OAAQthB,GAC7B3pB,KAAKirC,gBAAgB,UAAWD,GAChChrC,KAAKirC,gBAAgB,WAAYD,GACjChrC,KAAKirC,gBAAgB,WAAYD,IAGrC3B,EAAkBxnC,UAAU8oC,aAAe,SAAUnlC,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,QAC5H,IAAhB1D,IAA0BA,GAAc,QACnB,IAArBwD,IAA+BA,EAAmB,wBAC9B,IAApBC,IAA8BA,EAAkB,uBAChC,IAAhBC,IAA0BA,GAAc,GAC5C,IAAI7C,EAAY,IAAI,IAAoB78B,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,GACvIllC,KAAKwpC,YAAY/oC,KAAK4hC,IACtB,QAAUriC,KAAMA,KAAMqiC,IAG1BgH,EAAkBxnC,UAAUi/B,WAAa,SAAUD,GAI/C,QAH0B,QAAUA,GAC9B7gC,KAAKwpC,YAAYlgC,QAAO,SAAU4F,GAAQ,OAAOA,EAAK0yB,YAAcf,KACpE7gC,KAAKwpC,YAAY1nC,SACI0pB,MAAK,SAAUiH,EAAGlV,GACzC,IAAI2tB,EAAazY,EAAEmP,UAAYrkB,EAAEqkB,UACjC,OAAsB,IAAfsJ,EAAmBzY,EAAEsS,UAAYxnB,EAAEwnB,UAAYmG,MAgB9D7B,EAAkBxnC,UAAUopC,gBAAkB,SAAUzlC,EAAM2lC,GAC1DnrC,KAAKypC,eAAejkC,GAAQ,CAAEA,KAAMA,EAAM1C,MAAOqoC,IAIrD9B,EAAkBxnC,UAAUihC,cAAgB,WACxC,OAAO9iC,KAAKypC,gBAGhBJ,EAAkBxnC,UAAUigC,SAAW,SAAUnuB,GAC7C,OAAO3T,KAAKsjC,iBAAiB3vB,IAGjC01B,EAAkBxnC,UAAUgoC,6BAA+B,WACvD,IAAIuB,EAAMprC,KAAK0pC,mBACf0B,EAAIC,gBAA6CrrC,KTzN5B8pC,SAAS,GAAIjD,GS0NlCuE,EAAIhS,QAAwCp5B,KF/MvB+P,SAAS,GAAI24B,EAAa,CAAEthC,UAAW,OEgN5DgkC,EAAI/G,QD7N+B,SAAUvX,GACjD,OAAOA,EAAkB/c,SAAS,GAAIg5B,EAAuB,CAAE3hC,UAAW,MC4NxDkkC,CAA8BtrC,MAE5CorC,EAAI/D,WR7MwB,SAAUva,GAC1C,OAAOA,EAAkBid,QAAQ,CAAE5a,GAAI,SAAU1hB,GAAS,QAASA,EAAM45B,aAAiBF,GQ4MrEoE,CAAuBvrC,MAExCorC,EAAIpB,OPtNoB,SAAUld,GACtC,OAAOA,EAAkBkd,OAAO,CAAE/7B,QAAS,SAAUR,GAAS,QAASA,EAAMu8B,SAAaxC,GOqNzEgE,CAAmBxrC,MAChCorC,EAAInB,SP1MsB,SAAUnd,GACxC,OAAOA,EAAkBmd,SAAS,CAAE9U,SAAU,SAAU1nB,GAAS,QAASA,EAAMw8B,WAAexC,GOyM5EgE,CAAqBzrC,MACpCorC,EAAIlB,QP9LqB,SAAUpd,GACvC,OAAOA,EAAkBod,QAAQ,CAAE/d,SAAU,SAAU1e,GAAS,QAASA,EAAMy8B,UAAcxC,GO6L3EgE,CAAoB1rC,MAElCorC,EAAIO,aNjO0B,SAAU7e,GAC5C,OAAOA,EAAkBid,QAAQ,GAAInC,EAAkB,CAAExgC,SAAUugC,IMgO5CiE,CAAyB5rC,MAC5CorC,EAAIS,YNnN0B,SAAU/e,GAC5C,OAAOA,EAAkBod,QAAQ,CAAE/d,UAAU,SAAI,IAAS0b,EAAkB,CAAEzgC,SAAUugC,IMkNlEmE,CAAyB9rC,MAC3CorC,EAAIW,WNpM0B,SAAUjf,GAC5C,OAAOA,EAAkBqd,SAAS,GAAIrC,EAAkB,CAAE1gC,SAAUugC,IMmM/CqE,CAAyBhsC,MAE1CorC,EAAIa,ULpO2B,SAAUnf,GAC7C,OAAOA,EAAkBqd,SAAS,GAAIpC,GKmOlBmE,CAA0BlsC,MAC1CorC,EAAInD,cL9MuB,SAAUnb,GACzC,OAAOA,EAAkB/e,UAAU,GAAIk6B,GK6MfkE,CAAsBnsC,MAE1CorC,EAAIgB,cJ3N2B,SAAUtf,GAC7C,OAAOA,EAAkBgd,SAAS,GAAIxB,GI0Nd+D,CAA0BrsC,MAE9CorC,EAAI5C,UHvOmB,SAAU1b,GACrC,OAAOA,EAAkB/e,UAAU,GAAIy6B,EAAW,CAAEphC,SAAU,OGsO1CklC,CAAkBtsC,MAElCorC,EAAIhf,UAAW,OAAqBpsB,OAEjCqpC,EA/M2B,mSChClCkD,EAA2B,WACV,SAASA,EAA2B73B,GACjD,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKouB,WAAa,IAAI,EAAAiD,WACtBrxB,KAAKkX,eAAgB,EACrBlX,KAAKwsC,oBAAqB,EAC1BxsC,KAAKysC,eAAgB,EACrBzsC,KAAK0sC,sBAAuB,EAC5B1sC,KAAKkV,QAAU,WAAc,OAAO/E,EAAMie,WAAWlZ,WAOtElV,KAAKyV,SAAW,WAAc,OAAOtF,EAAMuE,OAAO2C,eAAe5B,YAUjEzV,KAAK2sC,WAAa,SAAUC,GAAa,OAAOz8B,EAAMuE,OAAO2C,eAAes1B,WAAWC,IAMvF5sC,KAAK6sC,KAAO,WAAc,OAAO18B,EAAMuE,OAAO2C,eAAew1B,QAM7D7sC,KAAKqV,UAAY,WAAc,OAAOlF,EAAMuE,OAAO2C,eAAehC,aAMlErV,KAAK8sC,KAAO,WAAc,OAAO38B,EAAMuE,OAAO2C,eAAey1B,QAM7D9sC,KAAK+sC,SAAW,WAAc,OAAO58B,EAAMuE,OAAO2C,eAAe01B,YAwFrE,OA1EAR,EAAU1qC,UAAUmrC,gBAAkB,SAAUxoC,GAC5C,OAAQxE,KAAKwsC,oBAAqB,QAAUhoC,GAASA,EAAQxE,KAAKwsC,oBAmBtED,EAAU1qC,UAAUotB,oBAAsB,SAAUzqB,GAChD,IAAI,QAAUA,KAAoB,IAAVA,IAA4B,IAAVA,KAAoB,QAASA,GACnE,MAAM,IAAIiO,MAAM,0BAA4BjO,EAAQ,mDACxD,OAAQxE,KAAK0sC,sBAAuB,QAAUloC,GAASA,EAAQxE,KAAK0sC,sBAcxEH,EAAU1qC,UAAUorC,WAAa,SAAUzoC,GACvC,OAAQxE,KAAKysC,eAAgB,QAAUjoC,GAASA,EAAQxE,KAAKysC,eAgCjEF,EAAU1qC,UAAUqN,KAAO,SAAU1J,EAAMiU,EAAY+X,GACnD,IAAItiB,EAAOlP,KAAKouB,WAAWlf,KAAK1J,EAAMiU,EAAY+X,GAClD,OAAQ,QAAU/X,GAAqBzZ,KAAPkP,GAE7Bq9B,EA1ImB,0SCf1BW,EAAsC,WAStC,OARAA,EAAW35B,OAAO3Q,QAAU,SAASic,GACjC,IAAK,IAAIzB,EAAGC,EAAI,EAAGkD,EAAIve,UAAUoN,OAAQiO,EAAIkD,EAAGlD,IAE5C,IAAK,IAAIwd,KADTzd,EAAIpb,UAAUqb,GACO9J,OAAO1R,UAAUa,eAAeX,KAAKqb,EAAGyd,KACzDhc,EAAEgc,GAAKzd,EAAEyd,IAEjB,OAAOhc,IAEK1c,MAAMnC,KAAMgC,YAK5BmrC,EAA8B,WAC9B,SAASA,EAAaz4B,GAClB1U,KAAK0U,OAASA,EAWlB,OATAy4B,EAAatrC,UAAU+O,WAAa,SAAUvF,EAAI6D,EAAMzB,GACpD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,OAAgBntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAE9E0/B,EAAatrC,UAAUoyB,SAAW,SAAU5oB,EAAI6D,EAAMzB,GAClD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,KAAcntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAE5E0/B,EAAatrC,UAAUurC,WAAa,SAAU/hC,EAAI6D,EAAMzB,GACpD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,OAAgBntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAEvE0/B,EAbsB,GAsB7BE,EAAmC,WAEnC,SAASA,EAAmC34B,GACxC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EAEd1U,KAAK07B,aAAe,IAAIyR,EAAantC,KAAK0U,QAE1C1U,KAAKstC,WAAa,IAClBttC,KAAKqtB,MAAQ,EAAAA,MAEbrtB,KAAKgtC,gBAAkB,SAAUxoC,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAOyhC,gBAAgBxoC,IAEhGxE,KAAKivB,oBAAsB,SAAUzqB,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAO0jB,oBAAoBzqB,IAExGxE,KAAKitC,WAAa,SAAUzoC,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAO0hC,WAAWzoC,IAEtFxE,KAAKkP,KAAO,SAAU1J,EAAMiU,EAAY+X,GACpC,OAAOrhB,EAAMuE,OAAOuC,WAAW1L,OAAO2D,KAAK1J,EAAMiU,EAAY+X,IAAiBrhB,GA+CtF,OArCAk9B,EAAkBxrC,UAAUwF,QAAU,SAAUid,EAAS/Y,GACrD,IAAI+hB,EAAYttB,KAAK0U,OAAOuC,WAAW1L,OAEnC6C,EAAS7C,IAAWA,EAAOkC,OAASlC,EAAO6C,OAC/C7C,EAAS6C,EAAS8+B,EAAS,CAAEz/B,MAAO,CAAEW,OAAQA,IAAY7C,GAAUA,EACpE,IAAIgiC,EAAe,CACfC,OAAQlgB,EAAUmf,cAClBO,gBAAiB1f,EAAUkf,mBAC3BiB,aAAcngB,EAAUpW,eAE5B,OAAO,IAAI,IAAWoN,EAASgJ,EAAUc,WAAYpuB,KAAK07B,cAAc,QAAO6R,EAAchiC,KASjG8hC,EAAkBxrC,UAAUs4B,UAAY,SAAUuT,GAE9C,KAAK,QAASA,GACV,OAAO,EACX,IAAIpnC,GAAS,EAKb,OAJA,QAAQ,eAAsB,SAAUtC,EAAKwB,IACrC,QAAWxB,KACXsC,EAASA,IAAU,QAAUonC,EAAOloC,MAAU,QAAWkoC,EAAOloC,QAEjEc,GAGX+mC,EAAkBxrC,UAAUnB,KAAO,WAC/B,IAAI4sB,EAAYttB,KAAK0U,OAAOuC,WAAW1L,OAGvC,OAFA+hB,EAAUc,WAAW5I,SAAU,EAC/B8H,EAAUc,WAAWqD,kBACdzxB,MAEJqtC,EAjE2B,kOCjBlCM,EAA2B,WAE3B,SAASA,EAA2Bj5B,GAChC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EAGd1U,KAAK4sB,KAAO,SAAU1W,GAAO,OAAO/F,EAAMuE,OAAOuC,WAAW2V,KAAK1W,IAEjElW,KAAKsc,OAAS,SAAUhH,GAAW,OAAOnF,EAAMuE,OAAOuC,WAAWqF,OAAOhH,IAEzEtV,KAAK+c,eAAiB,SAAU9Q,GAAS,OAAOkE,EAAMuE,OAAOuC,WAAW8F,eAAe9Q,IAEvFjM,KAAKgc,MAAQ,SAAU4xB,GAAY,OAAOz9B,EAAMuE,OAAOuC,WAAW+E,MAAM4xB,IAGxE5tC,KAAKuH,QAAU,SAAUwU,GACrB,OAAO5L,EAAMuE,OAAOuC,WAAW0F,MAAMpV,QAAQwU,IAGjD/b,KAAK4c,UAAY,SAAUb,GACvB,OAAO5L,EAAMuE,OAAOuC,WAAW0F,MAAMC,UAAUb,IAGnD/b,KAAKw/B,WAAa,SAAUjjB,GAAQ,OAAOpM,EAAMuE,OAAOuC,WAAW0F,MAAM6iB,WAAWjjB,IAEpFvc,KAAKuc,KAAO,SAAUA,GAAQ,OAAOpM,EAAMuE,OAAOuC,WAAW0F,MAAMJ,KAAKA,IAExEvc,KAAK2c,MAAQ,WAAc,OAAOxM,EAAMuE,OAAOuC,WAAW0F,MAAMA,SAEhE3c,KAAKwrB,KAAO,SAAUqiB,GAAa,OAAO19B,EAAMuE,OAAOuC,WAAW0F,MAAM6O,KAAKqiB,IAE7E7tC,KAAKiQ,KAAO,SAAUwrB,EAAS1f,EAAS5b,GAAW,OAAOgQ,EAAMuE,OAAOuC,WAAW0F,MAAM1M,KAAKwrB,EAAS1f,EAAS5b,IAC/GH,KAAK6+B,eAAiB,IAAI,IAAenqB,GAyE7C,OAtEAi5B,EAAU9rC,UAAUua,OAAS,SAAU0xB,GACnC,IAAIphB,EAAO1sB,KAAK0U,OAAO0C,gBACnB02B,EACA9tC,KAAK6V,SAAW6W,EAAKjb,MAGrBib,EAAKjb,QAAUzR,KAAK6V,UAExB6W,EAAKjb,IAAIzR,KAAK6V,UAAU,IAY5B83B,EAAU9rC,UAAUpB,KAAO,SAAUstC,EAAY3/B,EAAQjO,GACrD,IAAI4U,EAAU5U,KAAaA,EAAQ4U,QACnC/U,KAAK0U,OAAOuC,WAAWxF,IAAIs8B,EAAWnmB,OAAOxZ,GAAU,IAAK2G,IAqBhE44B,EAAU9rC,UAAUmsC,KAAO,SAAUD,EAAY3/B,EAAQjO,GACrD,IAAIsR,EAAMs8B,EAAWnmB,OAAOxZ,GAC5B,GAAW,MAAPqD,EACA,OAAO,KACXtR,EAAUA,GAAW,CAAE8tC,UAAU,GACjC,IAAIpmC,EAAM7H,KAAK0U,OAAOuC,WAAW1L,OAC7B2iC,EAAUrmC,EAAIwN,YAKlB,GAJK64B,GAAmB,OAARz8B,IACZA,EAAM,IAAM5J,EAAI8kC,aAAel7B,GAEnCA,EA1GR,SAAwBA,EAAKy8B,EAASD,EAAUx4B,GAC5C,MAAiB,MAAbA,EACOhE,EACPy8B,GACO,QAAqBz4B,GAAYhE,EACxCw8B,EACOx4B,EAAS3T,MAAM,GAAK2P,EACxBA,EAmGG08B,CAAe18B,EAAKy8B,EAAS/tC,EAAQ8tC,SAAUpmC,EAAI4N,aACpDtV,EAAQ8tC,WAAax8B,EACtB,OAAOA,EAEX,IAAI28B,GAASF,GAAWz8B,EAAM,IAAM,GAChC48B,EAAUxmC,EAAIilC,OACdA,EAAoB,KAAZuB,GAA8B,MAAZA,EAAkB,GAAK,IAAMA,EAC3D,MAAO,CAACxmC,EAAIklC,WAAY,MAAOllC,EAAIglC,OAAQC,EAAMsB,EAAO38B,GAAKwB,KAAK,KAEtEM,OAAO+6B,eAAeX,EAAU9rC,UAAW,oBAAqB,CAE5D6O,IAAK,WACD,OAAO1Q,KAAK0U,OAAOuC,WAAWoF,mBAElCkyB,YAAY,EACZC,cAAc,IAEXb,EA1GmB,2aCJ1Bc,EAAgC,WAChC,SAASA,EAAe/5B,GACpB1U,KAAK0U,OAASA,EAiKlB,OA/JA+5B,EAAe5sC,UAAUwF,QAAU,SAAU2J,GACzC,OAAOhR,KAAK0U,OAAOE,kBAAkBvN,QAAQ2J,IAEjDy9B,EAAe5sC,UAAUL,OAAS,SAAUsb,EAAMf,GAC9C,IAAI5L,EAAQnQ,KACRy9B,EAAU,YAAqBD,EAAqB,uBACpDkR,GAAW,QAAQ,CACnB,CAAC,KAAU,SAAUC,GAAS,OAAOD,EAASv+B,EAAM9I,QAAQsnC,MAC5D,EAAC,IAAAz1B,IAAG,KAAa,SAAUy1B,GAAS,OAAOx+B,EAAMy+B,eAAeD,EAAO5yB,KACvE,EAAC,IAAAkI,IAAGwZ,EAASD,GAAqB,SAAUmR,GAAS,OAAOx+B,EAAM0+B,UAAUF,EAAOx+B,EAAMuE,UACzF,EAAC,IAAAwE,IAAG/P,QAAS,SAAUwlC,GAAS,OAAOx+B,EAAM2+B,WAAWH,EAAO5yB,KAC/D,CAAC,KAAY,SAAU4yB,GAAS,OAAO,IAAIlyB,EAAYkyB,EAAO5yB,OAE9DQ,EAAOmyB,EAAS5xB,GACpB,IAAKP,EACD,MAAM,IAAI9J,MAAM,4BACpB,OAAO8J,GAsCXkyB,EAAe5sC,UAAU+sC,eAAiB,SAAUb,EAAYhyB,GAC5D,IAAIgzB,EAAWhzB,GACX,QAASA,KACTA,EAAU/b,KAAK0U,OAAOE,kBAAkBvN,QAAQ0U,KAChD,IAAA7C,IAAG,IAAH,CAAe6C,KACfgzB,EAAW,SAAU/yB,GAAS,OAAOD,EAAQ6L,OAAO5L,KAiBxD,IAAIgzB,EAAU,CAAEjB,WAAYA,EAAYkB,cAPxC,SAAuB7gC,GACnB,IAAI8gC,EAAWnB,EAAW1a,aAAa/pB,QAAO,SAAU0F,GAAS,OAAOA,EAAM4f,cAC9E,OAAKsgB,EAAS9/B,OAEA8/B,EAAS5lC,QAAO,SAAU0F,GAAS,OAAOZ,EAAOY,EAAM3D,OACtD+D,OAAS8/B,EAAS9/B,OAFtB,MAIuDF,KAAM,cAC5E,OAAO,QAAO,IAAIuN,GAjBlB,SAA2BhL,GACvB,IAAIrD,EAAS2/B,EAAWtkC,KAAKgI,EAAItJ,KAAMsJ,EAAI09B,OAAQ19B,EAAIqgB,MACvD,OAAOic,EAAWre,UAAUthB,IAAWA,IAeM2gC,GAAWC,IAahEP,EAAe5sC,UAAUgtC,UAAY,SAAUO,EAAa16B,GACxD,IAAIjH,EAAQ,uBAA+B2hC,GAAeA,EAAYp7B,UAAYo7B,EAe9EJ,EAAU,CAAEvhC,MAAOA,EAAOyB,KAAM,SACpC,OAAO,QAAOlP,KAAK4uC,eAAenhC,EAAMgE,KAR1B,SAAUuK,GACpB,IAAIvD,EAAS/D,EAAOmC,aAChByB,EAAU5D,EAAO4D,QACjBG,EAAOu1B,KAAKvgC,EAAOuO,KAAWvD,EAAOu1B,KAAK11B,EAAQwN,QAASxN,EAAQlK,SACnEqK,EAAO42B,aAAa5hC,EAAOuO,EAAO,CAAEoD,SAAS,EAAML,OAAQ,WAIZiwB,IAkC3DP,EAAe5sC,UAAUitC,WAAa,SAAU7rB,EAAQlH,GACpD,GAAIkH,EAAOnF,QAAUmF,EAAOqsB,OACxB,MAAM,IAAI78B,MAAM,4CAMpB,IAIIs8B,GAAW,QAAShzB,GAJJ,SAAUC,GAE1B,OAAOD,EAAQhH,QAAQ,kBAAkB,SAAUC,EAAG8H,GAAQ,OAAOd,EAAe,MAATc,EAAe,EAAIyyB,OAAOzyB,QAEtDf,EAE/CizB,EAAU,CAAE/rB,OAAQA,EAAQ/T,KAAM,UACtC,OAAO,QAAO,IAAIuN,GAFU,SAAUhL,GAAO,OAAOwR,EAAOxZ,KAAKgI,EAAItJ,QAEf4mC,GAAWC,IAEpEP,EAAee,UAAY,SAAUv1B,GAAO,OAAOA,GAAO,CAAC,OAAQ,QAAS,WAAWkpB,OAAM,SAAUt9B,GAAO,OAAO,QAAUoU,EAAIpU,QAC5H4oC,EAnKwB,GA4K/BhyB,EACA,SAAqBT,EAAOD,GACxB,IAAI5L,EAAQnQ,KACZA,KAAKgc,MAAQA,EACbhc,KAAKkP,KAAO,MACZlP,KAAKivC,cAAgB,SAAUjzB,GAAS,OAAO,EAAI7L,EAAMgL,KACzDnb,KAAK+b,QAAUA,GAAW,2GCnK9B0zB,sPAaJ,SAASC,EAAa3zB,GAClB,MAAK,QAAWA,KAAa,QAASA,KAAa,IAAA7C,IAAG,EAAA2mB,YAAH,CAAgB9jB,IAAa,EAAA8jB,YAAA,MAAkB9jB,IAC9F,MAAM,IAAItJ,MAAM,4FAEpB,OAAO,QAAWsJ,GAAWA,GAAU,QAAIA,GAhB/C0zB,EAAoB,SAAUhyB,EAAGmB,GAC7B,IAAI+wB,EA5BW,SAAUlyB,EAAGmB,GAAK,OAAQA,EAAExX,UAAY,IAAMqW,EAAErW,UAAY,GA4BjEwoC,CAAanyB,EAAGmB,GAC1B,OAAY,IAAR+wB,GAGQ,KADZA,EA9BW,SAAUlyB,EAAGmB,GACxB,IAAIixB,EAAU,CAAE7E,MAAO,EAAG8E,WAAY,EAAGC,OAAQ,EAAGC,IAAK,EAAGC,MAAO,GACnE,OAAQJ,EAAQpyB,EAAEvO,OAAS,IAAM2gC,EAAQjxB,EAAE1P,OAAS,GA4B9CghC,CAASzyB,EAAGmB,KAIN,KADZ+wB,EA7BiB,SAAUlyB,EAAGmB,GAC9B,OAAQnB,EAAEswB,YAAenvB,EAAEmvB,WAAiB,YAAmBtwB,EAAEswB,WAAYnvB,EAAEmvB,YAAvC,EA4BlCoC,CAAe1yB,EAAGmB,IAJb+wB,EAtBF,SAAUlyB,EAAGmB,GAEtB,IAAIwxB,EAAmB,CAAEpF,OAAO,EAAM8E,YAAY,GAElD,OADYM,EAAiB3yB,EAAEvO,OAASkhC,EAAiBxxB,EAAE1P,MAC5C,GAAKuO,EAAEtC,KAAO,IAAMyD,EAAEzD,KAAO,GAyBrCk1B,CAAO5yB,EAAGmB,IAkBrB,IAAI0xB,EAA0B,WAE1B,SAASA,EAA0B57B,GAC/B1U,KAAK0U,OAASA,EACG1U,KAAKuwC,QAAUd,EACfzvC,KAAKwwC,OAAS,GACdxwC,KAAKywC,IAAM,EAC5BzwC,KAAK6+B,eAAiB,IAAI,IAAenqB,GA8Q7C,OA3QA47B,EAASzuC,UAAUqT,QAAU,SAAUR,GACnC1U,KAAKwwC,OAAS,UACPxwC,KAAK0wC,cAqChBJ,EAASzuC,UAAU0F,QAAU,SAAUwU,GACnC,IAAI40B,EAAYjB,EAAa3zB,GAI7B/b,KAAKuc,KAAKvc,KAAK6+B,eAAer9B,QAHhB,SAAUosC,EAAUl5B,GAC9B,OAAmD,IAA5CA,EAAO4D,QAAQyT,kBAAkBnG,UAAkB,QAAQnc,KAAKmkC,EAASzlC,QAEtCwoC,KA6ClDL,EAASzuC,UAAU+a,UAAY,SAAUb,GACrC,IAAI40B,EAAYjB,EAAa3zB,GAC7B/b,KAAK0wC,aAAe1wC,KAAK6+B,eAAer9B,QAAO,SAAI,GAAOmvC,GAC1D3wC,KAAK4wC,SAAU,GAOnBN,EAASzuC,UAAU29B,WAAa,SAAUjjB,IACtC,QAAWvc,KAAKwwC,OAAQj0B,IAc5B+zB,EAASzuC,UAAU0a,KAAO,SAAUA,GAChC,IAAIpM,EAAQnQ,KACZ,IAAK,cAAyBuc,GAC1B,MAAM,IAAI9J,MAAM,gBAKpB,OAJA8J,EAAKpB,IAAMnb,KAAKywC,MAChBl0B,EAAKnV,SAAWmV,EAAKnV,UAAY,EACjCpH,KAAKwwC,OAAO/vC,KAAK8b,GACjBvc,KAAK4wC,SAAU,EACR,WAAc,OAAOzgC,EAAMqvB,WAAWjjB,KAOjD+zB,EAASzuC,UAAU8a,MAAQ,WAEvB,OADA3c,KAAK6wC,eACE7wC,KAAKwwC,OAAOpuC,OAAOpC,KAAK0wC,aAAe,CAAC1wC,KAAK0wC,cAAgB,KA4CxEJ,EAASzuC,UAAU2pB,KAAO,SAAUqiB,GAIhC,IAHA,IAAIiD,EAAS9wC,KAAK+wC,WAAW/wC,KAAKwwC,OAASxwC,KAAKuwC,QAAU1C,GAAa7tC,KAAKuwC,SAExES,EAAQ,EACH3zB,EAAI,EAAGA,EAAIyzB,EAAO1hC,OAAQiO,IAC/ByzB,EAAOzzB,GAAG4zB,OAASD,EACf3zB,EAAIyzB,EAAO1hC,OAAS,GAAgD,IAA3CpP,KAAKuwC,QAAQO,EAAOzzB,GAAIyzB,EAAOzzB,EAAI,KAC5D2zB,IAGRhxC,KAAKwwC,OAASM,EACd9wC,KAAK4wC,SAAU,GAGnBN,EAASzuC,UAAUgvC,aAAe,WAC9B7wC,KAAK4wC,SAAW5wC,KAAKwrB,QAGzB8kB,EAASzuC,UAAUkvC,WAAa,SAAUrxB,EAAKmuB,GAC3C,IAAIqD,EAAexxB,EAAI/Q,KAAI,SAAUuS,EAAMjS,GAAO,MAAO,CAAGiS,KAAMA,EAAMjS,IAAKA,MAK7E,OAJAiiC,EAAa1lB,MAAK,SAAU2lB,EAAUC,GAClC,IAAIC,EAAUxD,EAAUsD,EAASjwB,KAAMkwB,EAASlwB,MAChD,OAAmB,IAAZmwB,EAAgBF,EAASliC,IAAMmiC,EAASniC,IAAMoiC,KAElDH,EAAaviC,KAAI,SAAU2iC,GAAW,OAAOA,EAAQpwB,SA6DhEovB,EAASzuC,UAAUoO,KAAO,SAAUwrB,EAAS1f,EAAS5b,GAClD,IAAIoc,EAAOvc,KAAK6+B,eAAer9B,OAAOi6B,EAAS1f,GAI/C,OAHI,QAAU5b,GAAWA,EAAQiH,YAC7BmV,EAAKnV,SAAWjH,EAAQiH,UAC5BpH,KAAKuc,KAAKA,GACHA,GAEJ+zB,EArRkB,8VCpDzBiB,EAA4B,WAE5B,SAASA,EAA4B78B,GACjC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKqc,mBAAoB,EAM1Crc,KAAK2c,MAAQ,IAAI,IAAS3c,KAAK0U,QAM/B1U,KAAKuL,OAAS,IAAI,IAAUvL,KAAK0U,QAsDjC1U,KAAKyR,IAAM,SAAU+/B,EAAQz8B,EAAStH,GAClC,OAAO0C,EAAMuE,OAAO0C,gBAAgB3F,IAAI+/B,EAAQz8B,EAAStH,IAS7DzN,KAAKmI,KAAO,WAAc,OAAOgI,EAAMuE,OAAO0C,gBAAgBjP,QAQ9DnI,KAAKmvC,OAAS,WAAc,OAAOh/B,EAAMuE,OAAO0C,gBAAgB+3B,UAQhEnvC,KAAK8xB,KAAO,WAAc,OAAO3hB,EAAMuE,OAAO0C,gBAAgB0a,QAgB9D9xB,KAAKmV,SAAW,SAAU3U,GAAY,OAAO2P,EAAMuE,OAAO0C,gBAAgBjC,SAAS3U,IA4IvF,OAzIA+wC,EAAW1vC,UAAUqT,QAAU,WAC3BlV,KAAKsc,QAAO,GACZtc,KAAK2c,MAAMzH,WAOfq8B,EAAW1vC,UAAU8qB,MAAQ,WACzB,MAAO,CAAExkB,KAAMnI,KAAKmI,OAAQgnC,OAAQnvC,KAAKmvC,SAAUrd,KAAM9xB,KAAK8xB,SAsBlEyf,EAAW1vC,UAAU+qB,KAAO,SAAU1W,GAClC,IAAIA,IAAOA,EAAI5T,iBAAf,CAEA,IAAI+oB,EAAKrrB,KAAK0U,OAAQuC,EAAaoU,EAAGpU,WAAYJ,EAAewU,EAAGxU,aAChEpF,EAAM,CAAEtJ,KAAM8O,EAAW9O,OAAQgnC,OAAQl4B,EAAWk4B,SAAUrd,KAAM7a,EAAW6a,QAC/E2f,EAAOzxC,KAAKgc,MAAMvK,IACJ,QAAQ,CACtB,CAAC,KAAU,SAAU+/B,GAAU,OAAOv6B,EAAWxF,IAAI+/B,GAAQ,KAC7D,CAAC,EAAA3R,YAAA,MAAmB,SAAU3sB,GAAO,OAAO2D,EAAa66B,GAAGx+B,EAAIzF,MAAOyF,EAAI9E,OAAQ8E,EAAI/S,WACvF,EAAC,IAAA+Y,IAAG,EAAA2mB,aAAc,SAAUx5B,GAAU,OAAOwQ,EAAa66B,GAAGrrC,EAAOoH,QAASpH,EAAO+H,SAAU/H,EAAOlG,cAEzGwxC,CAAYF,GAAQA,EAAKl1B,KAAKR,QAAQ01B,EAAKz1B,MAAOvK,EAAKzR,KAAK0U,WAwBhE68B,EAAW1vC,UAAUya,OAAS,SAAUhH,GACpC,IAAInF,EAAQnQ,KACZ,IAAgB,IAAZsV,EAKA,OAAQtV,KAAK4xC,iBACT5xC,KAAK4xC,kBAAoB5xC,KAAK0U,OAAOuC,WAAW9B,UAAS,SAAUe,GAAO,OAAO/F,EAAMyc,KAAK1W,MALhGlW,KAAK4xC,kBAAoB5xC,KAAK4xC,0BACvB5xC,KAAK4xC,kBA+BpBL,EAAW1vC,UAAUkb,eAAiB,SAAU9Q,QAC9BkI,IAAVlI,IACAA,GAAQ,GACZjM,KAAKqc,kBAAoBpQ,GAQ7BslC,EAAW1vC,UAAUma,MAAQ,SAAUvK,GAEnCA,GAAM,QAAO,CAAEtJ,KAAM,GAAIgnC,OAAQ,GAAIrd,KAAM,IAAMrgB,GAYjD,IAXA,IAUIggC,EARsBl1B,EAClBP,EAHJW,EAAQ3c,KAAK2c,MAAMA,QAWdU,EAAI,EAAGA,EAAIV,EAAMvN,UAElBqiC,GAAQA,EAAKl1B,KAAK00B,SAAWt0B,EAAMU,GAAG4zB,QAFZ5zB,IAAK,CAInC,IAAIyI,QAZA9J,GAAAA,GADkBO,EAaEI,EAAMU,IAZbrB,MAAMvK,EALfzR,KAK0B0U,UAClB,CAAEsH,MAAOA,EAAOO,KAAMA,EAAMs1B,OAAQt1B,EAAK0yB,cAAcjzB,KAavEy1B,GAAQA,GAAS3rB,GAAWA,EAAQ+rB,OAASJ,EAAKI,OAAU/rB,EAAU2rB,EAE1E,OAAOA,GAEJF,EA7PoB,yXCJ3BO,EAAsC,WACtC,SAASA,EAAqBp9B,EAAQq9B,GAClC,IAAI5hC,EAAQnQ,KACZA,KAAK+xC,gBAAkBA,EACvB/xC,KAAKgyC,WAAa,GAClBhyC,KAAKiyC,UAAY,SAAU/7B,GAAO,OAAO/F,EAAM6hC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAGoL,OAC5FlW,KAAK8xB,KAAO,WAAc,OAAO,QAAS3hB,EAAM+hC,QAAQpgB,MACxD9xB,KAAKmI,KAAO,WAAc,OAAO,QAASgI,EAAM+hC,QAAQ/pC,MACxDnI,KAAKmvC,OAAS,WAAc,OAAO,SAAU,QAASh/B,EAAM+hC,QAAQ/C,SACpEnvC,KAAKmyC,UAAY,cACjBnyC,KAAKoyC,SAAW,aAoBpB,OAlBAN,EAAqBjwC,UAAU4P,IAAM,SAAUA,EAAKsD,GAQhD,YAPgB,IAAZA,IAAsBA,GAAU,IAChC,QAAUtD,IAAQA,IAAQzR,KAAKkyC,SAC/BlyC,KAAKmpB,KAAK,KAAM,KAAM1X,EAAKsD,GACvB/U,KAAK+xC,iBACL/xC,KAAKgyC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAG,CAAE2G,IAAKA,SAG1D,QAASzR,OAEpB8xC,EAAqBjwC,UAAUsT,SAAW,SAAUrK,GAChD,IAAIqF,EAAQnQ,KAEZ,OADAA,KAAKgyC,WAAWvxC,KAAKqK,GACd,WAAc,OAAO,QAAWqF,EAAM6hC,WAAYlnC,KAE7DgnC,EAAqBjwC,UAAUqT,QAAU,SAAUR,IAC/C,QAAS1U,KAAKgyC,aAEXF,EA9B8B,2LCDrCO,EAAuC,WACvC,SAASA,EAAsB39B,EAAQ49B,QAClB,IAAbA,IAAuBA,GAAW,GACtCtyC,KAAKsyC,SAAWA,EAChBtyC,KAAK0V,eAAYvB,EACjBnU,KAAKuyC,YAAc,GAmCvB,OAjCAF,EAAsBxwC,UAAUirC,KAAO,WACnC,OAAIj3B,SAASi3B,KACFyC,OAAO15B,SAASi3B,MAEA,UAApB9sC,KAAK+sC,WAAyB,IAAM,IAE/CsF,EAAsBxwC,UAAUkrC,SAAW,WACvC,OAAOl3B,SAASk3B,SAASh4B,QAAQ,KAAM,KAE3Cs9B,EAAsBxwC,UAAUgrC,KAAO,WACnC,OAAOh3B,SAAS28B,UAEpBH,EAAsBxwC,UAAUwT,UAAY,WACxC,OAAOrV,KAAKsyC,UAEhBD,EAAsBxwC,UAAU8qC,WAAa,SAAUC,GACnD,OAAO,QAAUA,GAAc5sC,KAAKuyC,YAAc3F,EAAa5sC,KAAKuyC,aAExEF,EAAsBxwC,UAAU4T,SAAW,SAAUu4B,GAKjD,OAJI,QAAUA,KACVhuC,KAAK0V,UAAYs4B,IACjB,QAAYhuC,KAAK0V,aACjB1V,KAAK0V,UAAY1V,KAAKyyC,eACnBzyC,KAAK0V,WAEhB28B,EAAsBxwC,UAAU4wC,YAAc,WAC1C,IAAIC,EAAUrsB,SAASssB,qBAAqB,QAAQ,GACpD,OAAID,GAAWA,EAAQ1E,KACZ0E,EAAQ1E,KAAKj5B,QAAQ,uBAAwB,IAEjD/U,KAAKsyC,SAAW,IAAMz8B,SAAS/B,UAAY,KAEtDu+B,EAAsBxwC,UAAUqT,QAAU,aACnCm9B,EAxC+B,uHCDlCO,2IADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAMnFC,EAAqC,SAAUC,GAE/C,SAASD,EAAoBv+B,GACzB,IAAIvE,EAAQ+iC,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAU1U,KAEhD,OADA,sBAAsB,aAAcmQ,EAAM8hC,WAAW,GAC9C9hC,EAYX,OAhBA0iC,EAAUI,EAAqBC,GAM/BD,EAAoBpxC,UAAUqwC,KAAO,WACjC,OAAO,QAAYlyC,KAAKmyC,UAAUrgB,OAEtCmhB,EAAoBpxC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GAC9D/U,KAAKmyC,UAAUrgB,KAAOrgB,GAE1BwhC,EAAoBpxC,UAAUqT,QAAU,SAAUR,GAC9Cw+B,EAAOrxC,UAAUqT,QAAQnT,KAAK/B,KAAM0U,GACpC,yBAAyB,aAAc1U,KAAKiyC,YAEzCgB,EAjB6B,CAkBtC,yYC/BEG,EACA,WACI,IAAIjjC,EAAQnQ,KACZA,KAAKkV,QAAU,KACflV,KAAK0V,UAAY,GACjB1V,KAAKqzC,MAAQ,GACbrzC,KAAKszC,UAAY,OACjBtzC,KAAKuzC,MAAQ,YACbvzC,KAAKuyC,YAAc,GACnBvyC,KAAK8sC,KAAO,WAAc,OAAO38B,EAAMkjC,OACvCrzC,KAAK+sC,SAAW,WAAc,OAAO58B,EAAMmjC,WAC3CtzC,KAAK6sC,KAAO,WAAc,OAAO18B,EAAMojC,OACvCvzC,KAAKyV,SAAW,WAAc,OAAOtF,EAAMuF,WAC3C1V,KAAKqV,UAAY,WAAc,OAAO,GACtCrV,KAAK2sC,WAAa,SAAU6G,GAAU,OAAQ,QAAUA,GAAWrjC,EAAMoiC,YAAciB,EAAUrjC,EAAMoiC,oIChBvGK,8EADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAKnFS,EAAuC,SAAUP,GAEjD,SAASO,EAAsB/+B,GAC3B,OAAOw+B,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAS1U,KAQ9C,OAVA6yC,EAAUY,EAAuBP,GAIjCO,EAAsB5xC,UAAUqwC,KAAO,WACnC,OAAOlyC,KAAK0zC,MAEhBD,EAAsB5xC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GAChE/U,KAAK0zC,KAAOjiC,GAETgiC,EAX+B,CAYxC,0tBCZ8B,QAAsB,4BAA4B,EAAO,IAAqB,MAEzE,QAAsB,6BAA6B,EAAM,IAA0B,MAEtF,QAAsB,0BAA0B,EAAO,IAAuB,8HClBxGb,2IADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAUnFW,EAA0C,SAAUT,GAEpD,SAASS,EAAyBj/B,GAC9B,IAAIvE,EAAQ+iC,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAS1U,KAG/C,OAFAmQ,EAAMyjC,QAAUl/B,EAAOuC,WAAW1L,OAClC,sBAAsB,WAAY4E,EAAM8hC,WAAW,GAC5C9hC,EA8CX,OAnDA0iC,EAAUc,EAA0BT,GAuBpCS,EAAyB9xC,UAAUgyC,eAAiB,WAChD,OAAO,QAAqB7zC,KAAK4zC,QAAQn+B,aAE7Ck+B,EAAyB9xC,UAAUqwC,KAAO,WACtC,IAAI7mB,EAAKrrB,KAAKmyC,UAAWr+B,EAAWuX,EAAGvX,SAAUge,EAAOzG,EAAGyG,KAAMqd,EAAS9jB,EAAG8jB,OAC7EA,GAAS,QAAWA,GAAQ,GAC5Brd,GAAO,QAAUA,GAAM,GACvB,IAAIgiB,EAAa9zC,KAAK6zC,iBAClBE,EAAqBjgC,IAAa9T,KAAK4zC,QAAQn+B,WAC/Cu+B,EAAiBlgC,EAASiT,OAAO,EAAG+sB,EAAW1kC,UAAY0kC,EAE/D,OADAhgC,EAAWigC,EAAqB,IAAMC,EAAiBlgC,EAASmmB,UAAU6Z,EAAW1kC,QAAU0E,IAC5Eq7B,EAAS,IAAMA,EAAS,KAAOrd,EAAO,IAAMA,EAAO,KAE1E6hB,EAAyB9xC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GACnE,IAAI++B,EAAa9zC,KAAK6zC,iBAClBzF,EAAQ38B,GAAkB,MAAXA,EAAI,GAAa,IAAM,GACtCwiC,EAAkB,KAARxiC,GAAsB,MAARA,EAAczR,KAAK4zC,QAAQn+B,WAAaq+B,EAAa1F,EAAQ38B,EACrFsD,EACA/U,KAAKoyC,SAAS8B,aAAazmC,EAAO0lC,EAAOc,GAGzCj0C,KAAKoyC,SAAS+B,UAAU1mC,EAAO0lC,EAAOc,IAG9CN,EAAyB9xC,UAAUqT,QAAU,SAAUR,GACnDw+B,EAAOrxC,UAAUqT,QAAQnT,KAAK/B,KAAM0U,GACpC,yBAAyB,WAAY1U,KAAKiyC,YAEvC0B,EApDkC,CAqD3C,4UCxESS,EAAmB,SAAUC,EAAOhpB,GAC3C,IAAIxlB,EAAMwlB,EAAG,GAAIrnB,EAAMqnB,EAAG,GAU1B,OATKgpB,EAAM3xC,eAAemD,IAGjB,QAAQwuC,EAAMxuC,IACnBwuC,EAAMxuC,GAAKpF,KAAKuD,GAGhBqwC,EAAMxuC,GAAO,CAACwuC,EAAMxuC,GAAM7B,GAN1BqwC,EAAMxuC,GAAO7B,EAQVqwC,GAEAC,EAAY,SAAUC,GAC7B,OAAOA,EAAYzxB,MAAM,KAAKxZ,OAAO,MAAUqF,IAAI,MAAYC,OAAOwlC,EAAkB,KAErF,SAASla,EAASzoB,GACrB,IAAI+iC,EAAgB,SAAUllC,GAAK,OAAOA,GAAK,IAC3C+b,GAAK,QAAU5Z,GAAK9C,IAAI6lC,GAAgBC,EAAappB,EAAG,GAAIyG,EAAOzG,EAAG,GACtEC,GAAK,QAAWmpB,GAAY9lC,IAAI6lC,GACpC,MAAO,CAAErsC,KADkDmjB,EAAG,GACzC6jB,OADsD7jB,EAAG,GACzCwG,KAAMA,EAAMrgB,IAAKA,GAEnD,IAAIijC,EAAW,SAAUC,GAC5B,IAAIxsC,EAAOwsC,EAAIxsC,OACXysC,EAAeD,EAAIxF,SACnBrd,EAAO6iB,EAAI7iB,OACXqd,EAAS57B,OAAOC,KAAKohC,GACpBjmC,KAAI,SAAU9I,GACf,IAAImJ,EAAQ4lC,EAAa/uC,GAEzB,QADW,QAAQmJ,GAASA,EAAQ,CAACA,IACzBL,KAAI,SAAU3K,GAAO,OAAO6B,EAAM,IAAM7B,QAEnD4K,OAAO,KAAS,IAChBqE,KAAK,KACV,OAAO9K,GAAQgnC,EAAS,IAAMA,EAAS,KAAOrd,EAAO,IAAMA,EAAO,KAE/D,SAAS+iB,EAAsBrvC,EAAM0oC,EAAS4G,EAAcC,GAC/D,OAAO,SAAU38B,GACb,IAAIX,EAAWW,EAAShB,gBAAkB,IAAI09B,EAAa18B,GACvD48B,EAAiB58B,EAASf,eAAiB,IAAI09B,EAAmB38B,EAAU81B,GAKhF,MAAO,CAAE1oC,KAAMA,EAAMiS,QAASA,EAASu9B,cAAeA,EAAe9/B,QAJrE,SAAiBR,GACbA,EAAOQ,QAAQuC,GACf/C,EAAOQ,QAAQ8/B,kaCvBvBl6B,EAA6B,WAE7B,SAASA,EAA6BpG,GAClC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKi1C,SAAW,GAChBj1C,KAAKk1C,aAAe,GACpBl1C,KAAKm1C,qBAAuB,GAC5Bn1C,KAAKgyC,WAAa,GAEnChyC,KAAKgK,WAAa,CACdC,iBAAkBjK,KAAKiK,iBAAiB3G,KAAKtD,MAC7CgX,mBAAoBhX,KAAKgX,mBAAmB1T,KAAKtD,MACjDo1C,kBAAmB,SAAU/pC,GAAM,OAAO,QAAK8E,EAAM8kC,UAAU,SAAUn7B,GAAQ,OAAO3J,EAAMuE,OAAOyG,IAAM,IAAMrB,EAAKzO,KAAOA,MAC7HgqC,mBAAoB,WAAc,OAAOllC,EAAM8kC,UAC/CK,mBAAoB,WAAc,OAAOnlC,EAAM+kC,cAC/CK,QAAS,SAAUpX,GAEf,OADAhuB,EAAM6hC,WAAWvxC,KAAK09B,GACf,WAAc,OAAO,QAAWhuB,EAAM6hC,WAAY7T,MAwPrE,OAzOArjB,EAAY06B,sBAAwB,SAAU3kC,EAAS4kC,QAC/B,IAAhBA,IAA0BA,EAAc,IAI5C,IAAIC,EAAgBD,EAAY3yB,MAAM,KAClC9H,EAAa06B,EAAc,IAAM,WACjCx6B,GAAsB,QAASw6B,EAAc,IAAMA,EAAc,GAAK,IAGtEC,EAAwB,wBAAwBlsC,KAAKuR,GAYzD,GAXI26B,IAEAz6B,EAAsBy6B,EAAsB,GAC5C36B,EAAa26B,EAAsB,IAEV,MAAzB36B,EAAWvV,OAAO,KAClBuV,EAAaA,EAAW+L,OAAO,GAC/B7L,EAAsB,IAGN,kBACFzR,KAAKyR,GAAsB,CACzC,IAAI06B,EAAc16B,EAAoB4H,MAAM,KAAKlU,QAAO,SAAUinC,EAAQvmC,GAAK,OAAOumC,EAAOz7B,SAAWvJ,GACxGqK,EAAsB06B,EAAYpwC,SAEL,MAAxB0V,IACLA,EAAsBrK,EAAQrL,MAElC,MAAO,CAAEwV,WAAYA,EAAYE,oBAAqBA,IAG1DJ,EAAYjZ,UAAUoI,iBAAmB,SAAU4G,GAC/C,OAAQ7Q,KAAK81C,aAAejlC,GAAW7Q,KAAK81C,cAGhDh7B,EAAYjZ,UAAUmV,mBAAqB,SAAU++B,EAAU71C,GAC3DF,KAAKm1C,qBAAqBY,GAAY71C,GAE1C4a,EAAYjZ,UAAU2yB,iBAAmB,SAAUrsB,EAAMozB,GACrD,IAAIya,EAAah2C,KAAKm1C,qBAAqB5Z,EAAKnwB,OAChD,IAAK4qC,EACD,MAAM,IAAIvjC,MAAM,2DAA6D8oB,EAAKnwB,OACtF,IAAI6qC,EAAOD,EAAW7tC,EAAMozB,GAC5B,OAAO,QAAQ0a,GAAQA,EAAO,CAACA,IAUnCn7B,EAAYjZ,UAAUumC,qBAAuB,SAAU19B,GACnD,2BAA4B,cAAeA,IAC3C,QAAW1K,KAAKk1C,aAAcxqC,IAElCoQ,EAAYjZ,UAAUwmC,mBAAqB,SAAU39B,GACjD,2BAA4B,iBAAkBA,GAC9C1K,KAAKk1C,aAAaz0C,KAAKiK,IAE3BoQ,EAAYjZ,UAAU+qB,KAAO,WACzB,IAAIzc,EAAQnQ,KACRk2C,EAAel2C,KAAKi1C,SAAStmC,KAAI,SAAU4c,GAAO,MAAO,CAACA,EAAIjgB,IAAKigB,MAAS3c,OAAO,KAAY,IASnG,SAASunC,EAAgB5qC,GAErB,IADA,IAAIsF,EAAUtF,EAAOxD,SAASgC,SAAUG,EAAQ,IACvCA,GAAS2G,EAAQuJ,QACtBvJ,EAAUA,EAAQuJ,OACtB,OAAOlQ,EAGX,IAAIksC,GAAe,SAAM,SAAUC,EAASC,EAAQvlB,EAAMC,GAAS,OAAOslB,GAAUD,EAAQtlB,GAAQslB,EAAQrlB,OAkBxGulB,EAAev2C,KAAKi1C,SAASzpB,KAAK4qB,GA9BtC,SAAqB3vC,GACjB,IAAI+vC,EAAa,SAAU3lC,GAAW,OAAQA,GAAWA,EAAQuJ,OAASo8B,EAAW3lC,EAAQuJ,QAAU,EAAI,GAC3G,OAAsC,IAA/B3T,EAAO6E,IAAIwX,MAAM,KAAK1T,OAAiBonC,EAAW/vC,EAAOkiB,mBA4BJ,IAAIha,KAjB3C,SAAUlI,GAC/B,IAAIgwC,EAAkBtmC,EAAM+kC,aAAa5rC,OAAOwR,EAAYoI,QAAQgzB,EAAczvC,IAOlF,OANIgwC,EAAgBrnC,OAAS,GAIzBqnC,EAAgBjrB,KAAK4qB,EAAaD,GAAkB,IAEjD,CAAE1vC,OAAQA,EAAQiE,WAAY+rC,EAAgB,OAUrDC,EAAqBH,EAAa5nC,KAAI,SAAU8E,GAAS,OAAOA,EAAM/I,cACtEisC,EAAwB32C,KAAKk1C,aAC5B5rC,QAAO,SAAUiC,GAAU,QAAQ,QAAQmrC,EAAoBnrC,MAC/DoD,KAAI,SAAUjE,GAAc,MAAO,CAAGjE,YAAQ0N,EAAWzJ,WAAYA,MAC1E6rC,EAAax1C,SAZS,SAAU0S,IAGkB,IAA1CtD,EAAM8kC,SAAS/mC,QAAQuF,EAAMhN,SAC7BgN,EAAMhN,OAAO+E,cAAciI,EAAM/I,eASzC,IAAIksC,EAAYL,EAAan0C,OAAOu0C,GACpC32C,KAAKgyC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAG8rC,MAClD,mBAAoBA,IAiBxB97B,EAAYjZ,UAAUgK,eAAiB,SAAUpF,GAC7C,iCAAkC,iBAAkBA,GACpD,IAAIowC,EAAU72C,KAAKi1C,SAMnB,OAJI4B,EAAQvtC,QADY,SAAUiiB,GAAO,OAAOA,EAAIjgB,MAAQ7E,EAAO6E,KAAOigB,EAAIngB,QAAU3E,EAAO2E,SACzDgE,QAClC,iCAAkC,+BAAgC3I,GACtEowC,EAAQp2C,KAAKgG,GACbzG,KAAK4sB,OACE,YAEU,IADHiqB,EAAQ3oC,QAAQzH,IAK1B,iCAAkC,mBAAoBA,IACtD,QAAWowC,EAAX,CAAoBpwC,IAJhB,iCAAkC,uCAAwCA,KAYtFqU,EAAYjZ,UAAUi1C,UAAY,WAC9B,OAAO92C,KAAKi1C,SAAStmC,KAAI,QAAK,SAOlCmM,EAAYjZ,UAAUk1C,OAAS,WAC3B,OAAO/2C,KAAKi1C,SAAS3rC,QAAO,QAAK,YAAYqF,KAAI,QAAK,UA2D1DmM,EAAYoI,QAAU,SAAUgzB,EAAczvC,GAAU,OAAO,SAAUiE,GAErE,GAAIjE,EAAO2E,QAAUV,EAAW3C,SAASqD,MACrC,OAAO,EAEX,IAAI+8B,EAAKz9B,EAAW3C,SAChBivC,EAAa7O,EAAGptB,YAAY+H,MAAM,KAClCm0B,EAAcxwC,EAAO6E,IAAIwX,MAAM,KAGnC,KAAK,QAAOk0B,EAAYC,EAAYn1C,MAAM,EAAIk1C,EAAW5nC,SACrD,OAAO,EAGX,IAAI8nC,EAAY,EAAIF,EAAW5nC,aAAU+E,EACrCgjC,EAAoBF,EAAYn1C,MAAM,EAAGo1C,GAAWjkC,KAAK,KACzDmkC,EAAgBlB,EAAaiB,GAAmBxuB,gBACpD,OAAOwf,EAAGltB,wBAA0Bm8B,GAAiBA,EAAc5xC,QAEhEsV,EA1QqB,wDCfhC,SAAUyL,EAAQ1mB,GAAU,aAyD5B,IAAIw3C,EAAoB,gBAEpBC,EAAez3C,EAAQC,OAAO,SAAU,CAAC,OACrBy3C,KAAK,CAAEC,eAAgB,UACvBz3C,SAAS,SAkCjC,WACE,IAAIwL,EAAS,CACXksC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,aAAa,EACbC,WAAW,EACXC,UAAU,EACVC,aAAa,EACbC,kBAAkB,GAgCpB,SAASC,EAAUtlC,EAAUulC,EAAUC,EAAqBC,GAC1D,OAAO,SAASx1C,EAAOoe,EAAMpO,GAC3B,IAAIA,EAAKpQ,eAAe20C,GAAxB,CAEA,IAAIkB,EAAgBzlC,EAAKkd,WAAWooB,IAChC7sC,EAAOgtC,IAAmBC,EAAYt3B,EAAMm3B,IAAyBvlC,EAAKylC,IAC5Ez1C,EAAMyB,OAAOuO,EAAKD,IAAW,SAAS4lC,GAEpCA,EAAUH,GAAUG,IAAYA,EAChCv3B,EAAKpO,KAAKslC,EAAUK,QAb5Bz4C,KAAKuL,OAAS,SAASmtC,GACrBntC,EAAS1L,EAAQiB,OAAOyK,EAAQmtC,IAkElC14C,KAAKU,KAAO,WACV,MAAO,CACL6K,OAAQ,SAAS1F,GACf,OAAO0F,EAAO1F,IAEhB8yC,YAAaR,OA5IfE,EAAsB,CAAC,SAAU,IAAK,QAAS,WAAY,SAAU,UAAW,WAEhFG,EAAc,SAASt3B,EAAM03B,GAC/B,IAAiD,IAA7CA,EAAc1qC,QAAQgT,EAAK,GAAG23B,UAChC,OAAO,GA8IXvB,EAAaz0C,UAAU,SAAU,CAAC,QAAS,SAASi2C,GAClD,OAAOA,EAAMH,YAAY,SAAU,cAAe,IAAI,MAEvD91C,UAAU,SAAU,CAAC,QAAS,SAASi2C,GACtC,OAAOA,EAAMH,YAAY,SAAU,cAAe,IAAI,MAEvD91C,UAAU,UAAW,CAAC,QAAS,SAASi2C,GACvC,OAAOA,EAAMH,YAAY,UAAW,eAAgBN,GAAqB,MAE1Ex1C,UAAU,YAAa,CAAC,QAAS,SAASi2C,GACzC,OAAOA,EAAMH,YAAY,YAAa,eAAgBN,GAAqB,MAE5Ex1C,UAAU,aAAc,CAAC,QAAS,SAASi2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9Ex1C,UAAU,aAAc,CAAC,QAAS,SAASi2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9Ex1C,UAAU,UAAW,CAAC,QAAS,SAASi2C,GAEvC,SAASC,EAAiBjmC,EAAMkmC,EAAgB93B,EAAM+3B,GACpD,OAAOH,EAAMvtC,OAAOytC,KACjB93B,EAAKpO,KAAKA,KACVmmC,IAAsBT,EAAYt3B,EAAMm3B,MAClB,WAAtBn3B,EAAKpO,KAAK,SAA6C,UAArBoO,EAAK,GAAG23B,UAG/C,SAASK,EAAiBC,EAAMj4B,GAI9B,OAAQA,EAAKpO,KAAK,SAAYoO,EAAKpO,KAAK,UAAYqmC,IAAUX,EAAYt3B,EAAMm3B,GAYlF,MAAO,CACLlxC,SAAU,IACVxB,QAAS,UACTyB,SAAU,IACVC,QAAS,SAAS6Z,EAAMpO,GACtB,IAAIA,EAAKpQ,eAAe20C,GAAxB,CAEA,IAAI+B,EAhBR,SAAkBtmC,EAAMoO,GACtB,IAAIhS,EAAO4D,EAAK5D,KACZiqC,EAAOrmC,EAAKqmC,KAEhB,MAA2B,cAAlBjqC,GAAQiqC,IAAiC,qBAATA,EAA+B,WAC7C,WAAlBjqC,GAAQiqC,IAAiC,kBAATA,EAA4B,QACpD,UAATjqC,GAA0C,gBAATiqC,GAAmC,WAATA,EAAqB,QAAU,GAUpFE,CAASvmC,GAErB,MAAO,CACLwmC,KAAM,SAASx2C,EAAOoe,EAAMpO,EAAMymC,GAChC,IAAIC,EAAgBT,EAAiB,WAAY,WAAY73B,GAAM,GAEnE,SAASu4B,IACP,OAAOF,EAAQG,YAcjB,OAAQN,GACN,IAAK,QACL,IAAK,WACCF,EAAiBE,EAAOl4B,IAC1BA,EAAKpO,KAAK,OAAQsmC,GAEhBL,EAAiB,eAAgB,cAAe73B,GAAM,IACxDpe,EAAMyB,OAAOk1C,EAAiC,UAAVL,EAlB1C,SAA0BO,GAGxB,IAAIlB,EAAW3lC,EAAKtO,OAAS+0C,EAAQK,WACrC14B,EAAKpO,KAAK,eAAgB2lC,IAG5B,WACEv3B,EAAKpO,KAAK,gBAAiBymC,EAAQM,SAASN,EAAQK,eAa9CJ,GACFt4B,EAAKpO,KAAK,WAAY,GAExB,MACF,IAAK,QAIH,GAHIomC,EAAiBE,EAAOl4B,IAC1BA,EAAKpO,KAAK,OAAQ,UAEhBgmC,EAAMvtC,OAAO,aAAc,CAC7B,IAAIuuC,GAAqB54B,EAAKpO,KAAK,mBAC9BA,EAAKpQ,eAAe,QAAUoQ,EAAKpQ,eAAe,UACnDq3C,GAAqB74B,EAAKpO,KAAK,mBAC9BA,EAAKpQ,eAAe,QAAUoQ,EAAKpQ,eAAe,UACnDs3C,GAAqB94B,EAAKpO,KAAK,iBAE/BgnC,GACFhnC,EAAKmnC,SAAS,OAAO,SAAgCN,GACnDz4B,EAAKpO,KAAK,gBAAiB6mC,MAG3BI,GACFjnC,EAAKmnC,SAAS,OAAO,SAAgCN,GACnDz4B,EAAKpO,KAAK,gBAAiB6mC,MAG3BK,GACFl3C,EAAMyB,OAAOk1C,GAAuB,SAAgCE,GAClEz4B,EAAKpO,KAAK,gBAAiB6mC,MAI7BH,GACFt4B,EAAKpO,KAAK,WAAY,IAKvBA,EAAKpQ,eAAe,eAAiB62C,EAAQW,YAAYC,UACzDpB,EAAiB,gBAAiB,eAAgB73B,GAAM,IAE3DpO,EAAKmnC,SAAS,YAAY,WACxB/4B,EAAKpO,KAAK,kBAAmBA,EAAe,aAI5CimC,EAAiB,eAAgB,cAAe73B,GAAM,IACxDpe,EAAMyB,QAAO,WACX,OAAOg1C,EAAQa,YACd,SAA+BT,GAChCz4B,EAAKpO,KAAK,iBAAkB6mC,cAQzC92C,UAAU,aAAc,CAAC,QAAS,SAASi2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9Ex1C,UAAU,cAAc,WACvB,MAAO,CACLsE,SAAU,IACVxB,QAAS,cACT4C,KAAM,SAASzF,EAAOoe,EAAMpO,EAAMunC,GAC5BvnC,EAAKpQ,eAAe20C,IAEnBn2B,EAAKpO,KAAK,cACboO,EAAKpO,KAAK,YAAa,kBAK9BjQ,UAAU,UAAU,CAAC,QAAS,SAAU,SAASi2C,EAAO33C,GACvD,MAAO,CACLgG,SAAU,IACVE,QAAS,SAAS6Z,EAAMpO,GACtB,IAAIA,EAAKpQ,eAAe20C,GAAxB,CAEA,IAAI12C,EAAKQ,EAAO2R,EAAKwnC,SACrB,OAAO,SAASx3C,EAAOoe,EAAMpO,GAEtB0lC,EAAYt3B,EAAMm3B,KAEjBS,EAAMvtC,OAAO,sBAAwB2V,EAAKpO,KAAK,SACjDoO,EAAKpO,KAAK,OAAQ,UAGhBgmC,EAAMvtC,OAAO,cAAgB2V,EAAKpO,KAAK,aACzCoO,EAAKpO,KAAK,WAAY,IAGpBgmC,EAAMvtC,OAAO,gBAAmBuH,EAAKynC,WAAcznC,EAAK0nC,YAAe1nC,EAAK2nC,SAC9Ev5B,EAAK5gB,GAAG,WAAW,SAASC,GAC1B,IAAIm6C,EAAUn6C,EAAMo6C,OAASp6C,EAAMm6C,QAEnB,KAAZA,GAA8B,KAAZA,KAEwC,IAAxDrC,EAAoBnqC,QAAQ3N,EAAM8F,OAAOwyC,WAAqBt4C,EAAM8F,OAAOu0C,mBAG7Er6C,EAAMgD,iBAERT,EAAMmB,QAGR,WACEtD,EAAGmC,EAAO,CAAE+3C,OAAQt6C,mBASnCsC,UAAU,aAAc,CAAC,QAAS,SAASi2C,GAC1C,OAAO,SAASh2C,EAAOoe,EAAMpO,GACvBA,EAAKpQ,eAAe20C,KAEpByB,EAAMvtC,OAAO,aAAgB2V,EAAKpO,KAAK,aAAgB0lC,EAAYt3B,EAAMm3B,IAC3En3B,EAAKpO,KAAK,WAAY,OA9Z5B,CAoaGyT,OAAQA,OAAO1mB,iECzalBA,QAAQC,OAAO,WAAY,CAAC,OAC3B+C,UAAU,WAAY,CAAC,KAAM,SAAUkE,GACvC,aAgCA,MAAO,CACNjE,MAAM,CACLy2C,QAAe,IACf13B,IAAe,QACfiF,IAAe,QACfgD,KAAe,SACfgxB,SAAe,aACfC,SAAe,aACfC,UAAe,cACfC,UAAe,cACfC,WAAe,eACfC,WAAe,eACfC,aAAe,iBACfC,MAAe,UACfC,MAAe,UACfC,YAAe,gBACfC,YAAe,iBAEhBpqC,YAAa,2BACPzL,QAAS,UACToP,SAAS,EACTxM,KAlDI,SAAUtH,EAAQyG,EAAUxG,GAElCA,EAAO45C,WACV75C,EAAO65C,SAAW,WAAW,OAAO,IAGjC55C,EAAO85C,YACV/5C,EAAO+5C,UAAY,WAAW,OAAO,IAGlC95C,EAAOq6C,cACVt6C,EAAOs6C,YAAc,WAAW,IAAIpiB,EAAIpyB,EAAGkF,QAAsB,OAAbktB,EAAExsB,UAAkBwsB,EAAE11B,UAGvEvC,EAAOm6C,QACVp6C,EAAOo6C,MAAQ,cAGZn6C,EAAOs6C,cACVv6C,EAAOu6C,YAAc,WAAW,IAAIriB,EAAIpyB,EAAGkF,QAAsB,OAAbktB,EAAExsB,UAAkBwsB,EAAE11B,UAGvEvC,EAAOo6C,QACVr6C,EAAOq6C,MAAQ,eA4BVt6C,WAAY,yBAInBA,WAAW,qBAAsB,CAAC,SAAU,WAAY,SAAWC,EAAQuC,GAC3E,aAEAvC,EAAOw6C,UAAal1B,OAAO7jB,eAAe,iBAAmB6jB,OAAOm1B,UAAUC,iBAAmB,EACjG16C,EAAO26C,SAAW/7C,QAAQoiB,KAAKhhB,EAAOs4C,SAEtCt4C,EAAO4gB,IAAM5gB,EAAO4gB,KAAO,EAC3B5gB,EAAO6lB,IAAM7lB,EAAO6lB,KAAO,EAC3B7lB,EAAO6oB,KAAO7oB,EAAO6oB,MAAQ,GAE7B7oB,EAAO85C,SAAW95C,EAAO26C,WAAa36C,EAAOs4C,QAE7Ct4C,EAAOg6C,UAAYh6C,EAAOg6C,WAAa,GACvCh6C,EAAO46C,cAAgB56C,EAAOg6C,UAAYh6C,EAAO6oB,KACjD7oB,EAAOi6C,WAAaj6C,EAAOi6C,YAAc,GACzCj6C,EAAOk6C,WAAal6C,EAAOk6C,YAAcl6C,EAAOg6C,UAChDh6C,EAAOm6C,aAAen6C,EAAOm6C,cAAgBn6C,EAAOi6C,WAEpD,IAAIvnB,EAAO1yB,EAAO6lB,IAAM7lB,EAAO4gB,IAC/Bi6B,EAAQnoB,EAAO1yB,EAAO6oB,KACtBiyB,EAAU96C,EAAOsD,OAAO,WAAW,WAClCtD,EAAO85C,SAAW95C,EAAO26C,WAAa36C,EAAOs4C,WAG9CyC,EAAW,SAAUC,GACpB,OAAQA,EAAM,GAAKH,EAAQnoB,GAG5B1yB,EAAOi7C,cAAgB,WACtB,OAAO,IAAIt6C,MAAMk6C,IAGlB76C,EAAOk7C,cAAgB,SAAUF,GAChC,IAAIG,EAAQ,EAAEn7C,EAAO6oB,KAErB,OADW7oB,EAAOg6C,UAAUmB,GAAQH,EAAMG,IAI3Cn7C,EAAOo7C,WAAa,SAAUJ,GAC7B,OAAOD,EAASC,IAAUh7C,EAAOs4C,QAAQt4C,EAAO4gB,KAGjD5gB,EAAOq7C,aAAe,WACjBr7C,EAAO+5C,cAAgB/5C,EAAO65C,YACjC75C,EAAOu6C,YAAY,CAACe,OAAOt7C,EAAOs4C,UAAUxuC,MAAK,WAChD9J,EAAOs4C,QAAUt4C,EAAO4gB,IACxB5gB,EAAOq6C,MAAM,CAACiB,OAAOt7C,EAAOs4C,cAK/Bt4C,EAAOu7C,SAAW,SAAUP,GAC3B,IAAKh7C,EAAO65C,WAAY,CACvB,IAAI2B,EAAW58C,QAAQoiB,KAAKhhB,EAAO4gB,IAAMm6B,EAASC,IAElDh7C,EAAOs6C,YAAY,CAACgB,OAAOE,IAAW1xC,MAAK,WAC1C9J,EAAOs4C,QAAUkD,EACjBj5C,GAAS,WACRvC,EAAOo6C,MAAM,CAACkB,OAAOt7C,EAAOs4C,kBAMhCt4C,EAAOsB,IAAI,YAAY,WACtBw5C,UAIDxjC,IAAI,CAAC,iBAAkB,SAAUjI,GACjC,aAEAA,EAAeosC,IAAI,2BAElB,siDCvHF,SAASC,EACP1mC,EACAL,EACA6C,EACAmkC,EACA71C,EACA81C,EACAC,EACAC,EACAC,GAEA,MAAMC,EAAKj9C,KA+FX,SAASk9C,EAAcr3C,EAAK8B,EAAMkF,GAChC,MAAMswC,EAAUN,EAAoBnsC,IAAI7K,IAAQ,GAE5CgH,SACKswC,EAAQlnC,EAAWJ,UAE1BsnC,EAAQlnC,EAAWJ,UAAYlO,EAGjCk1C,EAAoBO,IAAIv3C,EAAKs3C,GAG/B,SAASE,EAAOC,GA3BhB,IAAqBC,EA4BnBtnC,EAAWunC,OAAOF,GAAKA,EACvBJ,EAAcH,EAAgB9mC,EAAWunC,QA7BtBD,EA8BPD,EAAK,OAAS,OA7B1B1nC,EAAQwE,OAAOqjC,YACb,CACEF,IAAKA,GAEP,KA0BGtnC,EAAWynC,SACdznC,EAAWhS,SA7GfgS,EAAWJ,SAAWI,EAAW0nC,SAAS9nC,SAoT1ConC,EAAG5vC,QA9FH,WACE4I,EAAW2nC,OAAS,OAEpB,MAAMC,EAAY5nC,EAAW0nC,SAASG,MAChCC,EAAa9nC,EAAW0nC,SAASK,UACjCC,EAAoBhoC,EAAW0nC,SAASO,gBACxCC,EAAeloC,EAAW0nC,SAASS,aACnCC,EAAmBpoC,EAAW0nC,SAASW,gBACvCC,EAAgBz8B,KAAKgF,IACzBT,SAASm4B,gBAAgBC,aACzBl4B,OAAOm4B,aAAe,GAElBC,EAAet4B,SAASm4B,gBAAgBI,YAG9Cv4B,SAASm4B,gBAAgBK,MAAMC,YAAY,oBAAqBjB,GAChEx3B,SAASm4B,gBAAgBK,MAAMC,YAAY,qBAAsBf,GACjE13B,SAASm4B,gBAAgBK,MAAMC,YAAY,4BAA6Bb,GACxE53B,SAASm4B,gBAAgBK,MAAMC,YAC7B,uBACAX,GAEF93B,SAASm4B,gBAAgBK,MAAMC,YAC7B,2BACAT,GAEFh4B,SAASm4B,gBAAgBK,MAAMC,YAC7B,wBACAP,GAEFl4B,SAASm4B,gBAAgBK,MAAMC,YAC7B,uBACAH,GAGF,IAAII,GAAK,EACT,MAAMC,EAAiBnC,EAAoBnsC,IAAIssC,IAAoB,GAC7DiC,EAAgBpC,EAAoBnsC,IAAIqsC,IAAmB,GAEjE9mC,EAAWipC,QAAUF,EAAe/oC,EAAWJ,UAC3CmpC,EAAe/oC,EAAWJ,UAC1B,GACJI,EAAWunC,OAASyB,EAAchpC,EAAWJ,UACzCopC,EAAchpC,EAAWJ,UACzB,GAEAI,EAAWipC,QAAQC,aAAelpC,EAAWunC,OAAOF,GACtDyB,GAAK,EAEL9oC,EAAWunC,OAAOF,IAAK,EAGa,iBAAlCrnC,EAAW0nC,SAASyB,WACtB/B,EAAO0B,GAvMTtmC,EAAOi5B,GA/DT,WACE,MAAM2N,EAASppC,EAAW0nC,SAAS0B,OAC7BH,KACJjpC,EAAWipC,SACXjpC,EAAWipC,QAAQC,aACnBlpC,EAAWipC,QAAQC,YAAY9zC,IAG3Bi0C,EACJ/P,OAAOt5B,EAAW0nC,SAAS4B,kBAC3BhQ,OAAOt5B,EAAW0nC,SAAS6B,qBACzBjQ,OAAOt5B,EAAW0nC,SAAS4B,iBAE/B,SAAML,IAAaI,GAAYD,GAkDrBI,GAAa,aAAe,cAAe,KAAM,CACzD5pC,SAAU,YA4MZ,IAAI0nC,EAAM,GAERA,EADEtnC,EAAW0nC,SAAS0B,SAAWppC,EAAW0nC,SAAS+B,gBAC/C,OAEA,UAGR9pC,EAAQwE,OAAOqjC,YACb,CACEF,IAAAA,EACAM,UAAAA,EACAE,WAAAA,EACAQ,cAAAA,EACAI,aAAAA,GAEF,KAGF,MAAME,EAAQx4B,SAASs5B,cAAc,SACrCt5B,SAASpB,KAAK26B,YAAYf,GAC1BA,EAAMgB,MAAMC,WACV,2BAA6B7pC,EAAW0nC,SAASG,MAAQ,gBAe7Db,EAAG8C,MApMH,WACE,MAAMZ,EAAclpC,EAAWipC,QAAQC,YAEvC,GAAIA,GAAeA,EAAY9zC,GAAI,CAEjC,MAAM20C,EAAUpD,EACboD,UACA5lC,OAAOva,QAAQkD,QAAQsjB,SAAS45B,cAAc,eAC9CC,qBAAoB,GACpB/M,MACCl9B,EAAW0nC,SAASwC,iBAClB,yCAEHC,GAAG,MACHj8C,OAAO,UAEVy4C,EACGyD,KAAKL,GACLj1C,MAAK,WACJ,OAAO+xC,EAAIwD,gBAAgBC,aAAa,CACtCl1C,GAAI8zC,EAAY9zC,GAChBm1C,QAAQ,EACRC,YAAa,UACbC,SAAUC,GAAAA,GAAS/4B,OAAO,yBACzBg5B,YAEJ71C,MAAK,WACJ0N,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,eAGbwM,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM,YAAa6nB,QAqKnC+vB,EAAGI,OAASA,EACZJ,EAAG4D,SAjKH,WACE,MAAMC,EAAW/5C,EAAGkF,QACdkzC,EAAclpC,EAAWipC,QAAQC,YA2DvC,OAzDIA,GAAeA,EAAY9zC,IAC7ByxC,EAAIwD,gBACDS,YAAY,CACXC,MAAO7B,EAAY9zC,GACnB41C,YAAY,IAEbL,SAAS71C,MAAK,SAAUpD,GACvBm5C,EAASn0C,QACPu0C,GAAAA,CAAKv5C,EAAKw5C,KAAKr/C,MAAM,IAAI,SAAUs/C,GACjC,IAAIC,EASJ,GAPsB,OAAlBD,EAAIE,YACND,EACEprC,EAAW0nC,SAAS4D,eACpBtrC,EAAWipC,QAAQhwB,MACnB,UAAYkyB,EAAII,WAGE,QAAlBJ,EAAIE,UACN,OAAQrrC,EAAW0nC,SAAS8D,iBAC1B,IAAK,gBACHJ,EAASD,EAAIM,OACTzrC,EAAW0nC,SAASgE,WAAaP,EAAIM,OACrC,SACJ,MAEF,IAAK,cACHL,EAASD,EAAIM,OACTN,EAAIQ,KAAKC,OAAST,EAAIQ,KAAKE,SAC3B,SACJ,MAEF,IAAK,iBACHT,EAASD,EAAIM,OAASN,EAAIQ,KAAKE,SAAW,SAC1C,MAEF,QACET,EAASD,EAAIM,OACTzrC,EAAW0nC,SAASgE,WAAaP,EAAIM,OACrC,SAKV,MAAO,CACLL,OAAQA,EACRvd,QAASsd,EAAIW,KACbC,UAAWrB,GAAAA,CAAOS,EAAIY,WAAWp6B,OAAO,+BAK/CvF,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,MAIb4zB,EAASr9C,SAqGlBw5C,EAAGgF,eA/OH,WACE,MAA4C,YAArChsC,EAAW0nC,SAASuE,aAA6B,OAAS,OA+OnE,MAAMC,EAAgB,CACpB9C,OAAQ,CAAC,SAAU,OAAQ,UAAW,UAAW,aACjD+C,QAAS,CAAC,YAKZ7uC,OAAO+6B,eAAer4B,EAAY,cAAe,CAC/CvF,MACE,IAAIpK,EAAS2P,EAAW0nC,SAAS0E,aAKjC,OAJIF,EAAc9C,OAAO/lC,SAASrD,EAAW2nC,QAC3Ct3C,EAAS2P,EAAW0nC,SAAS2E,cACtBH,EAAcC,QAAQ9oC,SAASrD,EAAW2nC,UACjDt3C,EAAS2P,EAAW0nC,SAAS4E,gBACxBj8C,KAKX2P,EAAWinC,cAAgBA,EAE3B32B,OAAOi8B,iBACL,WACA,SAAUtsC,GACa,SAAjBA,EAAIvO,KAAKuO,IACXmnC,GAAO,GACmB,SAAjBnnC,EAAIvO,KAAKuO,KAClBmnC,GAAO,MAGX,qdC1WJ,SAASoF,EAASxsC,EAAYF,GAE5B,MAAM3H,EAAS2H,EAAUo5B,SAEzBl5B,EAAW0nC,SAAW,CACpB+E,OAAQ,UACRC,MAAM,GAGRC,GAAAA,CAAOx0C,GAAQ,SAAU5J,EAAOqB,GAChB,KAAVrB,GAAiBq+C,GAAAA,CAAOr+C,KACZ,SAAVA,IACFA,GAAQ,GAGI,UAAVA,IACFA,GAAQ,GAGVyR,EAAW0nC,SAAS93C,GAAOrB,MAcjC,SAASs+C,EACPC,EACAC,EACA3uC,EACA4uC,EACAC,EACAC,GAEA9uC,EAAkBgB,WAAU,GAIvB4tC,EAAchjD,SAAS0R,QAAQjB,MAClCuyC,EAAchjD,SAAS0R,QAAQjB,IAAM,IAIvCuyC,EAAchjD,SAAS0R,QAAQjB,IAAI,qBACjC,gCAEFuyC,EAAchjD,SAAS0R,QAAQjB,IAAI,iBAAmB,WACtDuyC,EAAchjD,SAAS0R,QAAQjB,IAAI0yC,OAAS,WAG5CF,EAA4BG,UAAUF,GAGtCJ,EACGt1C,MAAM,MAAO,CACZkxB,UAAU,IAEXlxB,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAakyC,EACbtiD,WAAY,4BAEbyM,MAAM,aAAc,CACnBgE,IAAK,UACLL,YAAamyC,EACbviD,WAAY,2BAEbyM,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAaoyC,EACbxiD,WAAY,4BAEbyM,MAAM,WAAY,CACjBgE,IAAK,QACLL,YAAaqyC,EACbziD,WAAY,yBAEbyM,MAAM,gBAAiB,CACtBgE,IAAK,aACLL,YAAasyC,EACb1iD,WAAY,8BAEbyM,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAauyC,EACb3iD,WAAY,+PCnGlB,SAAS4iD,EACP3tC,EACAwC,EACAorC,EACA/G,EACAE,EACAD,GAEA,MAAME,EAAKj9C,KAIX,SAASmmC,EAAY3gC,GACnB,OAAO,SAAU0nB,GACf+vB,EAAG6G,OAAOt+C,GAAQ0nB,EAAIvlB,KAEtB,MAAMo8C,EAAQF,EACXG,SACAC,YACChuC,EAAW0nC,SAASuG,0BAClB,yBAEHC,WAAW,oBACXC,SAAS,OAEZP,EAASxD,KAAK0D,IAIlB,SAASM,IACPpuC,EAAWquC,SAAU,EAYvB,SAASC,IACHtuC,EAAW0nC,SAAS0B,OACtB5mC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAI/C,SAASylC,IACP2B,EAAGuH,KAAO,GACVvH,EAAGwH,QAAU,KACbxH,EAAGyH,UAAY,KACfzH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,uBAEL5uC,EAAWipC,QAAQC,YAE1BlpC,EAAW6uC,gBAAiB,EAiD9B7H,EAAG5vC,QA3EH,WACE4I,EAAW2nC,OAAS,UAGpB3nC,EAAWinC,cAAcF,EAAiB,MAAM,GAChD/mC,EAAWinC,cAAcH,EAAgB,MAAM,GAC/C9mC,EAAWquC,SAAU,GAsEvBrH,EAAG8H,OA1CH,WACE9uC,EAAWquC,SAAU,EAEjBruC,EAAWipC,QAAQC,aAAelpC,EAAWipC,QAAQC,YAAY9zC,GACnEyxC,EAAIwD,gBACDP,MACCiF,GAAAA,CACE,CACE35C,GAAI4K,EAAWipC,QAAQC,YAAY9zC,GACnC45C,WAAYhvC,EAAW0nC,SAASsH,WAChCC,SACEjvC,EAAW0nC,SAAS4D,eAAiBtrC,EAAWipC,QAAQhwB,MAE5D+tB,EAAGuH,OAGN5D,SAAS71C,MAAK,kBACNkyC,EAAG6G,OAAOiB,OAEjB,MAAMhB,EAAQF,EACXG,SACAC,YACChuC,EAAW0nC,SAASwH,0BAClB,2BAEHhB,WAAW,oBACX/pC,OAAOva,QAAQkD,QAAQsjB,SAAS45B,cAAc,mBAEjD4D,EAASxD,KAAK0D,MAEfh5C,KAAKuwC,GACLvwC,KAAKw5C,GACLliC,MAAM8jB,EAAY,WAClBif,QAAQf,IAEXA,IACAle,EAAY,YAOhB8W,EAAGoI,KAhDH,WACE/J,IACAiJ,KAgDFtH,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GC/Gd,SAASwB,EAAWrvC,EAAYsvC,GAC9B,MAAMC,EAAgB,CACpBn6C,GAAI,MACJkW,MAAOtL,EAAW0nC,SAASp8B,OAGvBu7B,EAAM,GAqEZ,OAnEAA,EAAI2I,QAAUxvC,EAAW0nC,SAAS+H,OAAS,QAE3C5I,EAAI6I,YAAcJ,EAChBzI,EAAI2I,QAAU,oBACdD,EACA,CACEvc,OAAQ,CACN2c,OAAQ,OACRn0C,IAAKqrC,EAAI2I,QAAU,4BAErBrD,QAAS,CACPwD,OAAQ,OACRn0C,IAAKqrC,EAAI2I,QAAU,6BAErBI,UAAW,CACTD,OAAQ,MACRn0C,IAAKqrC,EAAI2I,QAAU,8BAKzB3I,EAAIwD,gBAAkBiF,EACpBzI,EAAI2I,QAAU,wBACdD,EACA,CACEppC,OAAQ,CACNwpC,OAAQ,MACRn0C,IAAKqrC,EAAI2I,QAAU,yBAErBlF,aAAc,CACZqF,OAAQ,MACRn0C,IAAKqrC,EAAI2I,QAAU,uCAErB1F,MAAO,CACL6F,OAAQ,MACRn0C,IAAKqrC,EAAI2I,QAAU,+BAErB1E,YAAa,CACX6E,OAAQ,MACRn0C,IAAKqrC,EAAI2I,QAAU,wCAErBK,iBAAkB,CAChBF,OAAQ,OACRn0C,IAAKqrC,EAAI2I,QAAU,0CACnB9zC,QAAS,CACP,oBAAgBwC,GAElB4xC,iBAAkBlmD,QAAQ6c,UAE5BspC,mBAAoB,CAClBJ,OAAQ,MACRn0C,IAAKqrC,EAAI2I,QAAU,+CAKzB3I,EAAImJ,YAAcV,EAChBzI,EAAI2I,QAAU,oBACdD,EACA,CACEppC,OAAQ,CACNwpC,OAAQ,MACRn0C,IAAKqrC,EAAI2I,QAAU,uBAKlB3I,uRC9DT,SAASoJ,EACPjlD,EACAgV,EACAzS,EACA2iD,EACAC,EACA3tC,EACApI,EACAysC,EACAE,EACAD,GAEA,MAAME,EAAKj9C,KACX,IAAIqmD,EACAC,EACAC,EACAC,EAmBJ,SAASC,IACPjjD,GAAS,WACP,MAAMT,EAAUqjD,EAAU,GAAGM,uBAAuB,iBAAiB,GAEjE3jD,IACFA,EAAQ4jD,UAAY5jD,EAAQ6jD,iBAMlC,SAASzgB,EAAY3gC,GACnB,OAAO,SAAU0nB,GACf+vB,EAAG6G,OAAOt+C,GAAQ0nB,EAAIvlB,KAEtB8+C,KAIJ,SAASI,EAAY/iB,GACnBgZ,EAAI6I,YACD1c,OAAOnF,GACP8c,SAAS71C,MAAK,SAAUpD,UAChBs1C,EAAG6G,OAAOgD,iBAEbjE,GAAAA,CAAO5sC,EAAWipC,QAAQC,eAC5BlpC,EAAWipC,QAAQC,YAAc,CAC/B9zC,GAAI1D,EAAKw3C,YAAY9zC,IAGvB4K,EAAWinC,cAAcF,EAAiB/mC,EAAWipC,UAGvDmH,EAAU,GAAGU,aAAaC,QAAQ,IAElCP,OAEDpkC,MAAM8jB,EAAY,qBAwDvB,SAASoe,IACHtuC,EAAW0nC,SAAS0B,OACtB5mC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAkB/C,SAASoxC,IAELhxC,EAAWipC,SACXjpC,EAAWipC,QAAQC,aACnBlpC,EAAWipC,QAAQC,YAAY9zC,IAE/ByxC,EAAIwD,gBACD5vC,IAAI,CACHrF,GAAI4K,EAAWipC,QAAQC,YAAY9zC,KAEpCu1C,SAAS71C,MAAK,SAAUpD,UAChBs1C,EAAG6G,OAAOmD,eAGbt/C,EAAK64C,SACPvqC,EAAWipC,QAAQC,YAAYqB,QAAS,EACxCvqC,EAAWinC,cAAcF,EAAiB/mC,EAAWipC,SAE5B,cAArBv3C,EAAKu/C,YACPzuC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAE7C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,gBAIhDwM,OAAM,SAAU6K,GACf,OAAQA,EAAI0wB,QACV,KAAK,IACHnlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IAEHI,EAAWinC,cAAcF,EAAiB,MAAM,GAChD/mC,EAAWinC,cAAcH,EAAgB,MAAM,GAC/CwH,IACA,MACF,KAAK,IACH9rC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OAQ1B,SAASi6B,EAAMtM,GACb,MAAMkH,EAAOsE,EAAU,GAAGU,aAAaK,UAEnCvM,GAA6B,KAAnBA,EAAOH,SAAkBG,EAAOwM,UAK1CxM,GAA6B,KAAnBA,EAAOH,SAKR,KAATqH,GAKJ8E,EACE7B,GAAAA,CACE,CACEjD,KAAMA,GAER9rC,EAAWipC,UAqCjB,SAAS6B,IAEL9qC,EAAWipC,SACXjpC,EAAWipC,QAAQC,aACnBlpC,EAAWipC,QAAQC,YAAY9zC,IAE/ByxC,EAAIwD,gBACDS,YAAY,CACXC,MAAO/qC,EAAWipC,QAAQC,YAAY9zC,GACtCi8C,cAAc,EACdj8C,GAAIm7C,QAAiBryC,IAEtBysC,SAAS71C,MAAK,SAAUpD,GAIvB,UAHOs1C,EAAG6G,OAAO3E,YAGbx3C,EAAKuC,MAAO,CACd,IAAIq9C,GAAQ,EACRlqC,EAAI,EACR,IAAKA,EAAI,EAAGkqC,GAAQ,EAAOlqC,EAAI1V,EAAKw5C,KAAK/xC,OAAQiO,IAAK,CACpD,MAAMrI,EAAIwyC,GAAAA,CAAMvxC,EAAWwxC,SAAU,CACnCp8C,GAAI1D,EAAKw5C,KAAK9jC,GAAGhS,KAEd2J,EAGMrN,EAAKw5C,KAAK9jC,GAAGywB,OACtB94B,EAAE84B,MAAO,IAHTyZ,GAAQ,EACRtxC,EAAWwxC,SAAShnD,KAAKkH,EAAKw5C,KAAK9jC,KAMN,QAA3B1V,EAAKw5C,KAAK9jC,GAAGikC,WAAwB35C,EAAKw5C,KAAK9jC,GAAGywB,OA1C3CziC,EA2CK1D,EAAKw5C,KAAK9jC,GAAGhS,GA1ChCyxC,EAAImJ,YACR7pC,OAAO,CACN/Q,GAAIA,EACJyiC,MAAM,IAEP8S,SAASv+B,OAAM,SAAU6K,GACxB1G,QAAQnhB,MAAM6nB,OAwCNq6B,GAEFd,IAGE9+C,EAAKw5C,KAAK9jC,EAAI,GAAGywB,OACnB0Y,EAAgB7+C,EAAKw5C,KAAK9jC,EAAI,GAAGhS,IArD7C,IAAuBA,KAyDhBgX,OAAM,SAAU6K,GACf,OAAQA,EAAI0wB,QACV,KAAK,IACHnlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACH4C,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OAtS1B+vB,EAAG6G,OAAS,GACZ7tC,EAAWwxC,SAAW,GACtBxK,EAAGyK,aAAe,CAChBC,gBAAgB,EAChBC,YAAY,EACZC,OAAO,EACPt/C,MAAM,EACNu/C,WAAY,UA4Ud7K,EAAG5vC,QAvCH,WACE4I,EAAW2nC,OAAS,OACpB3nC,EAAWquC,SAAU,EACrBruC,EAAW0nC,SAASoK,UAAW,EAE/B9K,EAAG+K,aAAe,GAGhB/xC,EAAWipC,QAAQC,aACnBlpC,EAAWipC,QAAQC,YAAYqB,QAG/BvqC,EAAWinC,cAAcF,EAAiB,MAAM,GAChD/mC,EAAWinC,cAAcH,EAAgB,MAAM,GAE/CwH,MAGA0C,IAGAX,EAAsBH,EAAUpF,EAAa,KAC7CwF,EAAyBJ,EAAUc,EAAgB,MAGrDZ,EAAY4B,EAAE,iBAAiBlB,aAAa,CAC1CmB,YAAajyC,EAAW0nC,SAASwK,oBAAsB,iBACvD9nD,OAAQ,CACN+nD,MAAO,SAAUC,EAAQxN,GACvBsM,EAAMtM,IAERyN,MAAO,WACLtoD,KAAKuoD,gBAQbtL,EAAGkK,MAAQA,EACXlK,EAAGuL,aAtIH,WACE,MAAMzG,EAAOsE,EAAU,GAAGU,aAAaK,UAG1B,KAATrF,IAKJ8E,EACE7B,GAAAA,CACE,CACEjD,KAAMA,GAER9rC,EAAWipC,UAIfmH,EAAU,GAAGU,aAAawB,aAqH5BtL,EAAGr4C,UA9RH,SAAmB+C,GACjB,MAAM8gD,EAAK,IAAIC,SAEfD,EAAGpuB,OAAO,OAAQ1yB,EAAK7B,MAEvBuK,EACGipC,KACCrjC,EAAW0nC,SAAS+H,OAClB,0BACAzvC,EAAWipC,QAAQC,YAAY9zC,GAC/B,4BACA4K,EAAW0nC,SAASp8B,MACtBknC,EACA,CACE1C,iBAAkBlmD,QAAQ6c,SAC1B/K,QAAS,CACP,oBAAgBwC,KAIrBpJ,MAAK,SAAUpD,IACdA,EAAOA,EAAKA,MAEH0D,WACA4xC,EAAG6G,OAAO6E,eAGjB9B,EACE7B,GAAAA,CACE,CACEjD,KACE,YACA9rC,EAAW0nC,SAAS+H,OACpB,0BACAzvC,EAAWipC,QAAQC,YAAY9zC,GAC/B,iCACA1D,EAAK0D,GACL,UACA4K,EAAW0nC,SAASp8B,MACpB,qBACA5Z,EAAKnC,KACL,OACFojD,aAAcjhD,EAAK0D,IAErB4K,EAAWipC,WAIf/Y,EAAY,oBAEbA,EAAY,oBA+OnBllC,EAAOsB,IAAI,YApOX,WACE4jD,EAAUhiD,OAAOmiD,GACjBH,EAAUhiD,OAAOoiD,GAEjBD,EAAsB,KACtBC,EAAyB,QAgO3BtwC,EAAW1T,IAAI,aA7Nf,SAAoBoF,EAAMnH,GACpBA,GACFA,EAASqoD,GAAAA,CAAQ5yC,EAAWwxC,oUClJlC,SAASqB,EACP7nD,EACAgV,EACA8yC,EACAjM,EACA+G,EACAn8C,EACA2I,GAEA,MAAM4sC,EAAKj9C,KACX,IAAIgpD,EAAU,KACVC,EAAgB,KACpBhzC,EAAWizC,UAAY,GAEvB,MAAMC,EAAkB,CACtBC,sBAAsB,EACtBC,mBAAmB,EACnBj+B,QAAS,SAAU5mB,GACjB,MAAqB,kBAAVA,GACDA,EAAQ,IAAM,IAEjBA,IA4GX,SAAS8kD,WACArM,EAAG6G,OAAOiB,OACjB9uC,EAAWzJ,MAAM,QAGjBywC,EAAGsM,OAASC,GAAAA,CAAWP,GAEvBhM,EAAGuH,KAAO,GACVvH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,gBAEZ,MAAMd,EAAQF,EACXG,SACAC,YACChuC,EAAW0nC,SAASwH,0BAClB,2BAEHhB,WAAW,oBACX/pC,OAAOva,QAAQkD,QAAQsjB,SAAS45B,cAAc,mBAEjD4D,EAASxD,KAAK0D,GA5HhB9G,EAAGwM,YAAc,SAAUlkD,GACzB,OAAOwjD,EAAKU,YAAYlkD,IA8Q1B03C,EAAGyM,iBArDH,SAA0BzN,GAExB,MAAM0N,EAAW1M,EAAGsM,OAAOtN,GACrB2N,EAAaliD,EAASoZ,KAAK,gBACjC,GAAI8oC,EAAWx6C,OAAQ,CACrB,MAAMy6C,EAAShqD,QAAQkD,QACrB6mD,EAAW,GAAG3J,cAAc,mBAExBrtC,EAAQ/S,QAAQkD,QACpB6mD,EAAW,GAAG3J,cAAc,qBAExB6J,EAAQD,EAAO/oC,KAAK,SAEtBgpC,EAAM16C,QACR06C,EAAMC,IAAI,UAAW,QAGvBF,EAAOvpD,GAAG,SAAS,KACjBwpD,EAAMC,IAAI,UAAW,QACI,mBAAlBn3C,EAAMo3C,QACTp3C,EAAMo3C,QAAQ,SACdp3C,EAAM,GAAGq3C,WAGfr3C,EAAMtS,GAAG,UAAWgiB,IAClBrhB,EAAOgD,QAAO,WACwB,iBAAzB0lD,EAASO,MAAM7kD,QACxBskD,EAASO,MAAM7kD,MAAQ,MAKzB,MAAMmB,EAAQ5E,MAAMstB,KAAK5M,EAAEjc,OAAOG,OAE5B2jD,EAhSL,QAgSiBR,EAASp+C,OAAOqa,KACdpf,EAAM4jD,MAAMtkD,GAASA,EAAK8f,MAAQukC,KAKpDR,EAASxpD,QAAU,GACnBwpD,EAASO,MAAM7kD,MAAQskD,EAASp+C,OAAO8+C,gBAEvCV,EAASxpD,QAAUqG,EAAMmI,KAAK7I,IAC5B,MAAM,KAAEN,EAAF,KAAQogB,EAAR,KAAc1W,GAASpJ,EAC7B,MAAO,CAAEN,KAAAA,EAAMogB,KAAAA,EAAM1W,KAAAA,EAAMpJ,KAAAA,MAG/Bm3C,EAAGuH,KAAKmF,EAASO,MAAM/W,OAASwW,EAASxpD,gBAkBjD88C,EAAGqN,eANH,SAAwBX,EAAU1N,GAGhC0N,EAASxpD,QAAQqf,OAAOy8B,EAAO,GAC/BgB,EAAGuH,KAAKmF,EAASO,MAAM/W,OAASwW,EAASxpD,SAuB3C88C,EAAGsN,eAfH,SAAwBZ,GACtBnjC,QAAQN,IAAI,kBAAmByjC,GAC/B,MAAMC,EAAaliD,EAASoZ,KAAK,gBAC3BlO,EAAQ/S,QAAQkD,QACpB6mD,EAAW,GAAG3J,cAAc,sBAExB,eAAEuK,EAAF,OAAkB3pC,GAAW8oC,EAASp+C,OACxCi/C,GACF53C,EAAME,KAAK,WAAY,YAErB+N,GACFjO,EAAM,GAAG63C,aAAa,SAAU5pC,IAapCo8B,EAAGyN,uBAPH,WACE,MAAMC,EAAW/oD,MAAMstB,KAAKxnB,EAASoZ,KAAK,oBACpC8pC,EAAUD,EAASA,EAASv7C,OAAS,GACvCw7C,GAAWA,EAAQ1tC,gBACrB0tC,EAAQ1tC,kBAMZ+/B,EAAG5vC,QAhTH,WACE4I,EAAW2nC,OAAS,UAGpBX,EAAGiC,QAAU,CACX7zC,GAAI4K,EAAW0nC,SAAStyC,GACxBw/C,cAAe,YACf37B,KAfK,YAAc47B,GAAAA,CAAQ,EAAG,MAkBhC70C,EAAW0nC,SAASoK,UAAW,EAC/B9xC,EAAWquC,SAAU,EAErBxH,EAAI6I,YACDE,UAAU,CACTx6C,GAAI4K,EAAW0nC,SAAStyC,GACxBg0C,QAAQ,IAETuB,SAAS71C,MAAK,SAAUpD,GACnBA,EAAKuC,QACP8+C,EAAUrhD,EAAKqhD,QACfC,EAAgBO,GAAAA,CAAW7hD,EAAKw5C,MAChClE,EAAGsM,OAASC,GAAAA,CAAWP,OAG1Bl+C,MAAK,WACJ,IAAK,IAAIsS,EAAI,EAAGA,EAAI4/B,EAAGsM,OAAOn6C,OAAQiO,IAAK,CACzC,MAAM0tC,EAAQ9N,EAAGsM,OAAOlsC,GAExB,GADApH,EAAWizC,WAAa6B,EAAM77C,UACH,IAAhB67C,EAAMb,OACXa,EAAMb,MAAMc,SAAU,CACxB,MAAMC,EAAS9hD,OAAOtH,UAAUshB,KAAK7f,KAAK,gBAC1C25C,EAAGiO,UAAU7tC,GAAK4tC,EAAOF,EAAMb,MAAMc,eAK5C3oC,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,OA2QpB+vB,EAAG8H,OA5LH,WAEE9uC,EAAWquC,SAAU,EAErB,MAAM38C,EAAO,IAAKs1C,EAAGuH,MAErB,IAAK,IAAInnC,EAAI,EAAGA,EAAI4/B,EAAGsM,OAAOn6C,OAAQiO,IAAK,CACzC,MAAM0tC,EAAQ9N,EAAGsM,OAAOlsC,GACpB0tC,EAAMb,YAA4C,IAA5BviD,EAAKojD,EAAMb,MAAM/W,SAEpC0P,GAAAA,CAAOkI,EAAMI,WAChBlO,EAAGiC,QAAQ6L,EAAMI,SAAWvpD,MAAMoQ,QAAQrK,EAAKojD,EAAMb,MAAM/W,QACvDxrC,EAAKojD,EAAMb,MAAM/W,OAAOlgC,OACxBtL,EAAKojD,EAAMb,MAAM/W,QAGnB91B,IAAM2rC,IACHnG,GAAAA,CAAO5sC,EAAW0nC,SAASkN,iBAC9B5N,EAAGiC,QAAQ2L,cAAgB50C,EAAW0nC,SAASkN,cAC/C5N,EAAGiC,QAAQhwB,KAAOttB,MAAMoQ,QAAQrK,EAAKojD,EAAMb,MAAM/W,QAC7CxrC,EAAKojD,EAAMb,MAAM/W,OAAOlgC,OACxBtL,EAAKojD,EAAMb,MAAM/W,SAIN,WAAf4X,EAAM77C,OACRvH,EAAKojD,EAAMb,MAAM/W,OAASxrC,EAAKojD,EAAMb,MAAM/W,OAAOxkC,KAC/C+U,GAASA,EAAK5d,SAMvB,MAAMslD,EAAexpD,MAAMoQ,QAAQirC,EAAGsM,QAClCtM,EAAGsM,OAAOjgD,QAAQyhD,GAAyB,WAAfA,EAAM77C,OAClC,GAEEm8C,EAAUrG,GAAAA,CACd,CACEjD,KAAMp6C,GAERs1C,EAAGiC,SAGCoM,EAA4B,MAAR3jD,GAAgByjD,EAAah8C,OAAS,EAC1Dm8C,EAAyB,OAAT5jD,GAA0C,OAAzBqW,KAAKE,UAAUvW,GAnFxD,IAAgB6jD,EApCKhmD,GAwHG8lD,GApFRE,EAqFHH,EApFJh7C,EAAM,CACXoB,IAAM,GAAEqrC,EAAI2I,wBAAwB+F,EAAQngD,aAC5CsG,QAAS,CAAE,oBAAgBwC,GAC3BxM,KAAM8jD,GAAAA,CAAeD,EAAS,IACzBrC,EACHuC,gBAAiB,IAAIhD,WAEvB9C,OAAQ,UA8EN2F,EACAzO,EAAI6I,YAAYvD,QAAQiJ,GAASzK,SACjC+K,QAAQC,OAAO,iBAGhB7gD,KAAKu+C,GACLjnC,OAhIgB7c,EAgIE,SAjHZ,SAAU0nB,GACf,MAAM62B,EAAQF,EACXG,SACAC,YACChuC,EAAW0nC,SAASuG,0BAClB,yBAEHC,WAAW,oBACX/pC,OAAOva,QAAQkD,QAAQsjB,SAAS45B,cAAc,mBAEjD4D,EAASxD,KAAK0D,GAEd9G,EAAG6G,OAAOt+C,GAAQ0nB,EAAIvlB,QAsGvBy9C,SAAQ,KACFnI,EAAGuH,KAAKngB,UACX4Y,EAAGuH,KAAO,IAjLhBvuC,EAAWquC,SAAU,MAqTvBrH,EAAGI,OA9HH,SAAgB73C,EAAM2a,GACf88B,EAAGuH,KAAKh/C,KACXy3C,EAAGuH,KAAKh/C,GAAQ,IAGlB,MAAMyJ,EAAMguC,EAAGuH,KAAKh/C,GAAM0I,QAAQiS,GAC9BlR,GAAO,EACTguC,EAAGuH,KAAKh/C,GAAMga,OAAOvQ,EAAK,GAE1BguC,EAAGuH,KAAKh/C,GAAM/E,KAAK0f,IAsHvB88B,EAAG7c,OAlHH,SAAgB56B,EAAM2a,GAKpB,OAJK88B,EAAGuH,KAAKh/C,KACXy3C,EAAGuH,KAAKh/C,GAAQ,IAGXy3C,EAAGuH,KAAKh/C,GAAM0I,QAAQiS,IAAS,GA8GxC88B,EAAGiO,UAAY,GAEfjO,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GACZ7G,EAAG0H,SAAW,GC1WhB,SAASkH,EACP51C,EACAwC,EACAswC,EACA14C,EACAysC,EACAE,GAEA,MAAMC,EAAKj9C,KACX,IAAIgpD,EAAU,KAkHd,SAAS8C,IACP,MAAO,YAAchB,GAAAA,CAAQ,EAAG,KAlHlC7N,EAAGiO,UAAY,GAGfjO,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GACZ7G,EAAG0H,SAAW,GACd1H,EAAG8O,aAAc,EAEjB9O,EAAGwM,YAAc,SAAUlkD,GACzB,OAAOwjD,EAAKU,YAAYlkD,IAmP1B03C,EAAG5vC,QAlHH,WAGE,GAFA4I,EAAW2nC,OAAS,SAEhB3nC,EAAWipC,SAAWjpC,EAAWipC,QAAQC,YAC3C,GAAIlpC,EAAWipC,QAAQC,YAAY9zC,GACjC,GAAI4K,EAAWipC,QAAQC,YAAYuC,OAEjCjpC,EAAOi5B,GAAG,WAAY,KAAM,CAC1B77B,SAAU,gBAEP,CACL,MAAMm2C,EAAoB/1C,EAAWipC,QAAQC,YAAY9zC,GAEnD1D,EAAOqW,KAAKE,UAAU,CAC1B+tC,QAAS,OACT9M,YAAa,CACX9zC,GAAI2gD,GAENloB,QAAS,CACPz4B,GAAI4K,EAAWipC,QAAQpb,QAAQz4B,IAEjC67C,YAAa,YACb1G,QAAQ,EACRC,YAAa,UACbC,SAAUC,GAAAA,GAAS/4B,OAAO,yBAG5BvX,EAAM,CACJoB,IAAM,GAAEwE,EAAW0nC,SAAS+H,gCAAgCsG,mBAAmC/1C,EAAW0nC,SAASp8B,QACnH5P,QAAS,CAAE,eAAgB,mCAC3BhK,KAAMA,EACNi+C,OAAQ,QAIV3vC,EAAWipC,QAAU,CACnB7zC,GAAI4K,EAAW0nC,SAAStyC,GACxB6gD,OAAQ,YACRh9B,KAAM48B,KAGR71C,EAAW0nC,SAASoK,UAAW,EAE/B9xC,EAAWinC,cAAcF,EAAiB/mC,EAAWipC,SAErDpC,EAAI6I,YACDE,UAAU,CACTx6C,GAAI4K,EAAW0nC,SAAStyC,GACxBg0C,QAAQ,IAETuB,SAAS71C,MAAK,SAAUpD,GACnBA,EAAKuC,QACP8+C,EAAUrhD,EAAKqhD,QACf/L,EAAGsM,OAAS5hD,EAAKw5C,SAGpBp2C,MAAK,WACJ,IAAK,IAAIsS,EAAI,EAAGA,EAAI4/B,EAAGsM,OAAOn6C,OAAQiO,IAAK,CACzC,MAAM0tC,EAAQ9N,EAAGsM,OAAOlsC,GACxB,GAAI0tC,EAAMb,MAAMc,SAAU,CACxB,MAAMC,EAAS9hD,OAAOtH,UAAUshB,KAAK7f,KAAK,gBAC1C25C,EAAGiO,UAAU7tC,GAAK4tC,EAAOF,EAAMb,MAAMc,eAI1C3oC,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,WAKpBzU,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,iBAKdI,EAAWipC,QAAU,CACnB7zC,GAAI4K,EAAW0nC,SAAStyC,GACxB6gD,OAAQ,YACRh9B,KAAM48B,KAGR71C,EAAW0nC,SAASoK,UAAW,EAE/B9xC,EAAWinC,cAAcF,EAAiB/mC,EAAWipC,SAErDpC,EAAI6I,YACDE,UAAU,CACTx6C,GAAI4K,EAAW0nC,SAAStyC,GACxBg0C,QAAQ,IAETuB,SAAS71C,MAAK,SAAUpD,GACnBA,EAAKuC,QACP8+C,EAAUrhD,EAAKqhD,QACf/L,EAAGsM,OAAS5hD,EAAKw5C,SAGpBp2C,MAAK,WACJ,IAAK,IAAIsS,EAAI,EAAGA,EAAI4/B,EAAGsM,OAAOn6C,OAAQiO,IAAK,CACzC,MAAM0tC,EAAQ9N,EAAGsM,OAAOlsC,GACxB,GAAI0tC,EAAMb,MAAMc,SAAU,CACxB,MAAMC,EAAS9hD,OAAOtH,UAAUshB,KAAK7f,KAAK,gBAC1C25C,EAAGiO,UAAU7tC,GAAK4tC,EAAOF,EAAMb,MAAMc,eAI1C3oC,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,OAOtB+vB,EAAG8H,OAhMH,WACE,IAAIhD,EAAO,sBAEX,IAAK,IAAI1kC,EAAI,EAAGA,EAAI4/B,EAAGsM,OAAOn6C,OAAQiO,IAAK,CACzC,MAAM0tC,EAAQ9N,EAAGsM,OAAOlsC,GAEpB0tC,EAAMb,YAA+C,IAA/BjN,EAAGuH,KAAKuG,EAAMb,MAAM/W,SAEvC0P,GAAAA,CAAOkI,EAAMoB,YAChBl2C,EAAWipC,QAAQ6L,EAAMoB,UAAYvqD,MAAMoQ,QACzCirC,EAAGuH,KAAKuG,EAAMb,MAAM/W,QAElB8J,EAAGuH,KAAKuG,EAAMb,MAAM/W,OAAOlgC,OAC3BgqC,EAAGuH,KAAKuG,EAAMb,MAAM/W,QAGrB0P,GAAAA,CAAOkI,EAAMI,WAChBl1C,EAAWipC,QAAQ6L,EAAMI,SAAWvpD,MAAMoQ,QACxCirC,EAAGuH,KAAKuG,EAAMb,MAAM/W,QAElB8J,EAAGuH,KAAKuG,EAAMb,MAAM/W,OAAOlgC,OAC3BgqC,EAAGuH,KAAKuG,EAAMb,MAAM/W,QAGtB91B,IAAM2rC,IACHnG,GAAAA,CAAO5sC,EAAW0nC,SAASuO,UAC9Bj2C,EAAWipC,QAAQgN,OAASj2C,EAAW0nC,SAASuO,OAChDj2C,EAAWipC,QAAQhwB,KAAOttB,MAAMoQ,QAAQirC,EAAGuH,KAAKuG,EAAMb,MAAM/W,QACxD8J,EAAGuH,KAAKuG,EAAMb,MAAM/W,OAAOlgC,OAC3BgqC,EAAGuH,KAAKuG,EAAMb,MAAM/W,SAIxB8J,EAAGuH,KAAKuG,EAAMb,MAAM/W,SACtB4O,GAAQgJ,EAAMb,MAAM/W,MAAQ,KAAO8J,EAAGuH,KAAKuG,EAAMb,MAAM/W,OAAS,OAnExE,IAAqBrP,EAAAA,EA0EjBkhB,GAAAA,CACE,CACEjD,KAAMA,EACNqK,QAASn2C,EAAW0nC,SAASyO,QAC7BC,WAAYp2C,EAAW0nC,SAAS0O,YAElCp2C,EAAWipC,SA/EfjC,EAAG8O,aAAc,EAEjBjP,EAAI6I,YACD1c,OAAOnF,GACP8c,SAAS71C,MAAK,SAAUpD,UAChBs1C,EAAG6G,OAAOgD,iBAEjB7wC,EAAWipC,QAAQpb,QAAU,CAC3Bz4B,GAAI1D,EAAKm8B,QAAQz4B,IAGnB4K,EAAWipC,QAAQC,YAAc,CAC/B9zC,GAAI1D,EAAKw3C,YAAY9zC,IAIvB4K,EAAWinC,cAAcF,EAAiB/mC,EAAWipC,SAGrDjC,EAAG8O,aAAc,EAjChB91C,EAAW0nC,SAAS2O,sBAOvB7zC,EAAOi5B,GAAG,WAAY,KAAM,CAC1B77B,SAAU,YANZ4C,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,eAmCXwM,OAAM,SAAU6K,GAEf+vB,EAAG8O,aAAc,EAEjBvlC,QAAQnhB,MAAM6nB,OAqMpB+vB,EAAGI,OAzIH,SAAgB73C,EAAM2a,GACf88B,EAAGuH,KAAKh/C,KACXy3C,EAAGuH,KAAKh/C,GAAQ,IAGlB,MAAMyJ,EAAMguC,EAAGuH,KAAKh/C,GAAM0I,QAAQiS,GAC9BlR,GAAO,EACTguC,EAAGuH,KAAKh/C,GAAMga,OAAOvQ,EAAK,GAE1BguC,EAAGuH,KAAKh/C,GAAM/E,KAAK0f,IAiIvB88B,EAAG7c,OA7HH,SAAgB56B,EAAM2a,GAKpB,OAJK88B,EAAGuH,KAAKh/C,KACXy3C,EAAGuH,KAAKh/C,GAAQ,IAGXy3C,EAAGuH,KAAKh/C,GAAM0I,QAAQiS,IAAS,GCtJ1C,SAASosC,EACPt2C,EACAwC,EACAorC,EACA/G,EACAE,EACAD,GAEA,MAAME,EAAKj9C,KAQX,SAASukD,IACHtuC,EAAW0nC,SAAS0B,OACtB5mC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAI/C,SAASylC,IACP2B,EAAGuH,KAAO,GACVvH,EAAGwH,QAAU,KACbxH,EAAGyH,UAAY,KACfzH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,gBAEZ5uC,EAAWipC,QAAU,GAErBjpC,EAAW6uC,gBAAiB,EAC5B7uC,EAAWzJ,MAAM,QAQnB,SAAS25B,EAAY3gC,GACnB,OAAO,SAAU0nB,GACf+vB,EAAG6G,OAAOt+C,GAAQ0nB,EAAIvlB,KAEtB,MAAMo8C,EAAQF,EACXG,SACAC,YACChuC,EAAW0nC,SAASuG,0BAClB,yBAEHC,WAAW,oBACX/pC,OAAOva,QAAQkD,QAAQsjB,SAAS45B,cAAc,mBAEjD4D,EAASxD,KAAK0D,IAIlB,SAASM,IACPpuC,EAAWquC,SAAU,EAjDvBrH,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GA+FZ7G,EAAG5vC,QAXH,WACE4I,EAAW2nC,OAAS,YAGpB3nC,EAAWinC,cAAcF,EAAiB,MAAM,GAChD/mC,EAAWinC,cAAcH,EAAgB,MAAM,GAE/C9mC,EAAWquC,SAAU,GAKvBrH,EAAG8H,OA7CH,WACE9uC,EAAWquC,SAAU,EAEjBruC,EAAWipC,QAAQC,aAAelpC,EAAWipC,QAAQC,YAAY9zC,GACnEyxC,EAAIwD,gBACDC,aAAa,CACZl1C,GAAI4K,EAAWipC,QAAQC,YAAY9zC,GACnCmhD,KAAMvP,EAAGuH,KAAKgI,OAEf5L,SAAS71C,MAAK,kBACNkyC,EAAG6G,OAAOiB,OAEjB,MAAMhB,EAAQF,EACXG,SACAC,YACChuC,EAAW0nC,SAASwH,0BAClB,2BAEHhB,WAAW,oBACX/pC,OAAOva,QAAQkD,QAAQsjB,SAAS45B,cAAc,mBAEjD4D,EAASxD,KAAK0D,MAEfh5C,KAAKuwC,GACLvwC,KAAKw5C,GACLliC,MAAM8jB,EAAY,WAClBif,QAAQf,IAEXA,IACAle,EAAY,YAiBhB8W,EAAGoI,KAxEH,WACE/J,IACAiJ,KCrCJ,SAASkI,EACPx2C,EACAhV,EACAklD,EACA1tC,EACA7C,EACAknC,EACAE,EACAD,GAGA,IACIwJ,EADAmG,GAAS,EAIb,SAASzF,IACP,IAAI9H,EAAc,GACdwN,GAAO,EAEX7P,EAAIwD,gBACD5vC,IAAI,CACHrF,GAAI4K,EAAWipC,QAAQC,YAAY9zC,KAEpCu1C,SAAS71C,MAAK,SAAUpD,GAGvB,OAFAw3C,EAAcx3C,EAEPm1C,EAAIwD,gBAAgBS,YAAY,CACrCC,MAAO/qC,EAAWipC,QAAQC,YAAY9zC,KACrCu1C,YAEJ71C,MAAK,SAAUpD,GACdglD,EAAOhlD,EAAKw5C,KAAK/xC,OAAS,EAEtB+vC,EAAYqB,QACdvqC,EAAWipC,QAAQC,YAAYqB,QAAS,EACxCvqC,EAAWinC,cAAcF,EAAiB/mC,EAAWipC,SAErB,cAA5BC,EAAY+H,aACdzuC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,aAEtCspC,EAAYuC,QAErBzrC,EAAWipC,QAAQC,YAAYuC,OAASvC,EAAYuC,OACpDzrC,EAAWinC,cAAcF,EAAiB/mC,EAAWipC,SAErDzmC,EAAOi5B,GAAG,WAAY,KAAM,CAAE77B,SAAU,aAC/B82C,GACTl0C,EAAOi5B,GAAG,WAAY,KAAM,CAAE77B,SAAU,eAG3CwM,OAAM,SAAU6K,GACf,OAAQA,EAAI0wB,QACV,KAAK,IACHnlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACH4C,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OAKxB,SAAS0/B,IACP,GACE32C,EAAWipC,SACXjpC,EAAWipC,QAAQC,aACnBlpC,EAAWipC,QAAQC,YAAY9zC,KAC9BqhD,EACD,CAEAA,GAAS,EAGT,MAAMG,EAAM,IAAIC,eAEhBD,EAAIF,KACF,MACA12C,EAAW0nC,SAAS+H,OAClB,0BACAzvC,EAAWipC,QAAQC,YAAY9zC,GAC/B,kBACA4K,EAAW0nC,SAASp8B,OACtB,GAEFsrC,EAAIE,iBAAiB,eAAgB,mCAErCF,EAAIG,KACFhvC,KAAKE,UAAU,CACb+tC,QAAS,OACT9M,YAAa,CACX9zC,GAAI4K,EAAWipC,QAAQC,YAAY9zC,IAErCy4B,QAAS,CACPz4B,GAAI4K,EAAWipC,QAAQpb,QAAQz4B,IAEjC67C,YAAa,YACb1G,QAAQ,EACRC,YAAa,UACbC,SAAUC,GAAAA,GAAS/4B,OAAO,0BAIP,IAAnBilC,EAAII,YAAmC,MAAfJ,EAAIjP,SAE9B3nC,EAAWinC,cAAcF,EAAiB,MAAM,GAChD/mC,EAAWinC,cAAcH,EAAgB,MAAM,KAjG1C/8C,KA0HRqN,QAbH,WACE4I,EAAW2nC,OAAS,UAGlB3nC,EAAWipC,SACXjpC,EAAWipC,QAAQC,aACnBlpC,EAAWipC,QAAQC,YAAY9zC,KAG/Bk7C,EAAyBJ,EAAUc,EAAgB,OAQvDhmD,EAAOsB,IAAI,YAxBX,WACEqT,EAAQs3C,oBAAoB,eAAgBN,GAC5Ch3C,EAAQs3C,oBAAoB,SAAUN,GAEtCzG,EAAUhiD,OAAOoiD,MAqBnB3wC,EAAQ4sC,iBAAiB,eAAgBoK,GACzCh3C,EAAQ4sC,iBAAiB,SAAUoK,GC/GrC,SAASO,EAAgBpE,GACvB,OAAO,SAAUvkD,GACf,OAAOukD,EAAKU,YAAYjlD,6WAqI5B3E,QACGC,OAFiB,cAEG,CACnB,YACA,SACA,aACA,aACA,aACA,aACA,QACA,UACA,YACA,qBACA,WACA,SAEDwJ,OAAO,YAAa6jD,GACpBC,SAAS,iBAAkB,eAC3BA,SAAS,kBAAmB,WAC5BA,SAAS,iBAAkB,UAC3BvqD,UAAU,WAlCb,WACE,OAAO,SAAUC,EAAOC,EAASC,GAC/BD,EAAQO,KAAK,oBAAoB,SAAU/C,GACrB,KAAhBA,EAAMo6C,QACR73C,EAAMmB,QAAO,WACXnB,EAAMzB,MAAM2B,EAAMqqD,YAEpB9sD,EAAMgD,yBA4BXV,UAAU,WApJb,WA0GE,MAAO,CACL0F,KAVF,SAAczF,EAAOC,GACnBA,EAAQzC,GAAG,SAAS,WACE+lB,SAASinC,eAAe,iBAlGhD,SAAsBpsC,EAAMpe,GAE1B,MAAMyqD,EAAMlnC,SAASs5B,cAAc,OAC7BT,EAAUp8C,EAAMo8C,QAChBvB,EAAW76C,EAAM66C,SACvB,IAAI6P,EAEJ,IAAK,IAAInwC,EAAI,EAAGA,EAAIva,EAAM2kD,SAASr4C,OAAQiO,IAAK,CAC9C,MAAMymB,EAAUhhC,EAAM2kD,SAASpqC,GAC/B,IAAIgkC,EAAS,WACb,MAAMU,EAAO,YAAcje,EAAQie,KAC7B0L,EACJ,YAAc9M,GAAAA,CAAO7c,EAAQke,WAAWp6B,OAAO,uBAEjD,GAAU,IAANvK,EAAJ,CAKA,OAAQva,EAAM66C,SAAS8D,iBACrB,IAAK,gBACHJ,GACwB,QAAtBvd,EAAQwd,UACJxd,EAAQ4d,OACN/D,EAASgE,WAAa7d,EAAQ4d,OAC9B,SACF/D,EAAS4D,eACTrC,EAAQhwB,MACR,UAAY4U,EAAQ0d,UAC1B,MAEF,IAAK,cACHH,GACwB,QAAtBvd,EAAQwd,UACJxd,EAAQ4d,OACN5d,EAAQ8d,KAAKC,OAAS/d,EAAQ8d,KAAKE,SACnC,SACFnE,EAAS4D,eACTrC,EAAQhwB,MACR,UAAY4U,EAAQ0d,UAC1B,MAEF,IAAK,iBACHH,GACwB,QAAtBvd,EAAQwd,UACJxd,EAAQ4d,OACN5d,EAAQ8d,KAAKE,SACb,SACFnE,EAAS4D,eACTrC,EAAQhwB,MACR,UAAY4U,EAAQ0d,UAC1B,MAEF,QACEH,GACwB,QAAtBvd,EAAQwd,UACJxd,EAAQ4d,QACL/D,EAASgE,YAAc,SAAW7d,EAAQ4d,OAC3C,SACF/D,EAAS4D,eACTrC,EAAQhwB,MACR,UAAY4U,EAAQ0d,UAG9B+L,EAAI3N,YAAYv5B,SAASqnC,eAAerM,IACxCkM,EAAI3N,YAAYv5B,SAASs5B,cAAc,OACvC4N,EAAI3N,YAAYv5B,SAASqnC,eAAe3L,IACxCwL,EAAI3N,YAAYv5B,SAASs5B,cAAc,OACvC4N,EAAI3N,YAAYv5B,SAASqnC,eAAeD,IACxCF,EAAI3N,YAAYv5B,SAASs5B,cAAc,OACvC4N,EAAI3N,YAAYv5B,SAASs5B,cAAc,YAvDrC6N,EAAY1pB,EAAQke,UA0DxB,MAAM2L,EAAWpnC,OAAOomC,OAExBgB,EAAStnC,SAASunC,MAAM,sBAAwBvnC,SAAS8sB,MAAQ,YACjEwa,EAAStnC,SAASunC,MAAM,kBACxBD,EAAStnC,SAASunC,MAAM,iBAAmBjQ,EAASyO,QAAU,SAC9DuB,EAAStnC,SAASunC,MAChB,oBACEjN,GAAAA,CAAO6M,GAAW5lC,OAAO,uBACzB,SAEJ+lC,EAAStnC,SAASunC,MAChB,oBAAsBjN,GAAAA,GAAS/4B,OAAO,uBAAyB,SAEjE+lC,EAAStnC,SAASunC,MAAML,EAAIM,WAC5BF,EAAStnC,SAASunC,MAAM,kBAExBD,EAAStnC,SAAS05B,QAClB4N,EAASG,QAETH,EAASI,QACTJ,EAAS5N,QAOLiO,CAAaC,EAAanrD,OAO9BqE,SAAU,QA0CXnG,WAAW,iBAAkBklD,GAE7BllD,WAAW,oBAAqB4iD,GAEhCr4C,OA1BH,sBA0BU,SAAU2iD,GAChBA,EAAmBC,qBAEpBntD,WAAW,kBAAmB27C,GAE9Bz8C,QAAQ,MAAOolD,GAEf/5C,OAAOu3C,GACPvqC,IAAIkqC,GAEJzhD,WAAW,oBAAqB8nD,GAEhCv9C,OAtCH,sBAsCU,SAAU2iD,GAChBA,EAAmBC,qBAEpBntD,WAAW,mBAAoB6qD,GAE/B7qD,WAAW,sBAAuBurD,GAElCvrD,WAAW,oBAAqByrD,wFC/MnC3sD,EAAOsuD,QAAU,WACf,GAA0B,iBAAfC,WACT,OAAOA,WAGT,IAAIxwC,EAEJ,IAGEA,EAAI7d,MAAQ,IAAI0mB,SAAS,cAAb,GACZ,MAAOpE,GAEP,GAAsB,iBAAXiE,OACT,OAAOA,OAIT,GAAoB,iBAAT7Y,KACT,OAAOA,KAIT,QAAsB,IAAX,EAAAmQ,EACT,OAAO,EAAAA,EAIX,OAAOA,EA5BQ,wECHjB,WAoBE7d,QAjBM4d,EAAO,SAON,KAFU,EAAF,WACL,OAAQA,EAAK6tC,eAWjB,WAWJ,SAASz5C,EAAQhO,GAEb,MAAmC,mBAA5B,GAAK8Q,SAAS/S,KAAKiC,GAG9B,SAASsqD,EAAatqD,GAElB,QAAQgO,EAAQhO,IAAuB,iBAARA,IAAsBA,GAASA,aAAeuqD,MAAWvqD,aAAeuuB,MAQ3G,SAASi8B,IAEL,MAA2B,mBAAb9F,SAGlB,SAAS+F,IAEL,GAAID,IACA,OAAO,IAAI9F,SAkCnB,SAASgG,EAAmBC,EAAYxuD,EAASyuD,EAAUC,GAEvD,IAAI5S,EAAQ,EAEZ,IAAK,IAAIp2C,KAAO8oD,EAAY,CAExB,GAAIA,EAAWjsD,eAAemD,GAAM,CAEhC,IAAIipD,EAAWD,GAAahpD,EACxBrB,EAAQrE,EAAQirB,QAAQujC,EAAW9oD,IAevC,GAbIgpD,GAAaP,EAAaK,KAC1BG,EAAWD,EAAY,IAAMhpD,EAAM,KAGnCgpD,GAAa78C,EAAQ28C,KAGjBG,EADA98C,EAAQxN,IAAUrE,EAAQipD,qBACfyF,EAAY,IAAM5S,EAAQ,IAE1B4S,EAAY,MAI3B78C,EAAQxN,IAAU8pD,EAAa9pD,GAE/BkqD,EAAmBlqD,EAAOrE,EAASyuD,EAAUE,QAE1C,GAAItqD,aAAiBuqD,SAExB,IAAK,IAAIrxC,EAAI,EAAGA,EAAIlZ,EAAM4K,OAAQsO,IAC9BkxC,EAASv0B,OAAOy0B,EAAW,IAAMpxC,EAAI,IAAKlZ,EAAM2b,KAAKzC,SAElDlZ,aAAiB+pD,KAExBK,EAASv0B,OAAOy0B,EAAUtqD,EAAOA,EAAMgB,MAEhChB,aAAiB+tB,KAExBq8B,EAASv0B,OAAOy0B,EAAUtqD,EAAMwqD,gBAEb,OAAVxqD,GAAkBrE,EAAQkpD,mBAAgC,OAAV7kD,SAA6B2P,IAAV3P,GAE5EoqD,EAASv0B,OAAOy0B,EAAUtqD,GAGlCy3C,IAEJ,OAAO2S,EAEX,OAhFA,SAAiBD,EAAYxuD,GAEzB,GAAIA,GAAWA,EAAQurD,iBAEnB,GAnB8B,mBAmBDvrD,EAAQurD,gBAnBlBrxB,OAqBf,KAAM,qDAEP,IAAKm0B,IAER,KAAM,8FA3Bd,IA0CQS,EA5DG,CAgDc,CACjBvD,gBAAiB+C,IACjBrF,sBAAsB,EACtBC,mBAAmB,EACnBj+B,QAAS,SAAS5mB,GACd,MAAqB,kBAAVA,GACCA,EAAQ,IAAK,IAElBA,IAIkCrE,GAAW,IA5DlCyO,QAAO,SAAUsgD,EAAOC,GAI9C,OAHA57C,OAAOC,KAAK27C,GAAepuD,SAAQ,SAAUquD,GACzCF,EAAME,GAAaD,EAAcC,MAE9BF,IACR,IAyDH,OAAOR,EAAmBC,EAAYM,EAAeA,EAAcvD,kBA5EjCxrD,IACjC,QAFM,OAEN,oECDD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,8FAA8FxsC,MAClG,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,4DAA4D1sC,MAClE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C6sC,cAAe,SACfC,KAAM,SAAUh9C,GACZ,MAAO,QAAQuQ,KAAKvQ,IAExBi9C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,eACTC,SAAU,eACVC,QAAS,iBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,YACN7zC,EAAG,mBACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,WACHC,GAAI,YACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KArEyB9xD,CAAQ,EAAQ,8FCOlD,SAAWygD,GAAU,aAIzB,IAAIsR,EAAa,SAAU1xC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEV2xC,EAAU,CACN90C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJo8C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJj4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJo4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAe9sD,EAAQ+sD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf7gD,EAAMkhD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAvhD,EAAMA,EAAIqhD,EAAgB,EAAI,IAE3BrhD,EAAI+D,QAAQ,MAAO88C,KAGlCvC,EAAS,CACL,QACA,QACA,OACA,QACA,MACA,OACA,SACA,MACA,SACA,SACA,SACA,UAGG3O,EAAO0O,aAAa,QAAS,CACpCC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,wCAAwC3sC,MAAM,KAC7D4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAUh9C,GACZ,MAAO,MAAQA,GAEnBi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN7zC,EAAG+0C,EAAU,KACbjB,GAAIiB,EAAU,KACdn9C,EAAGm9C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACdh5B,EAAGg5B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBQ,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC+8C,KAAM,CACFC,IAAK,EACLC,IAAK,KAtJyB9xD,CAAQ,EAAQ,8FCDlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wEAAwExsC,MAC5E,KAEJysC,YAAa,wEAAwEzsC,MACjF,KAEJ0sC,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,wCAAwC3sC,MAAM,KAC7D4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,OACH8zC,GAAI,WACJl8C,EAAG,QACHm8C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJl4B,EAAG,MACHm4B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MApDyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPX,EAAa,SAAU1xC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEV2xC,EAAU,CACN90C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJo8C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJj4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJo4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAe9sD,EAAQ+sD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf7gD,EAAMkhD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAvhD,EAAMA,EAAIqhD,EAAgB,EAAI,IAE3BrhD,EAAI+D,QAAQ,MAAO88C,KAGlCvC,EAAS,CACL,QACA,SACA,OACA,QACA,OACA,QACA,QACA,QACA,SACA,SACA,SACA,UAGG3O,EAAO0O,aAAa,QAAS,CACpCC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,wCAAwC3sC,MAAM,KAC7D4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAUh9C,GACZ,MAAO,MAAQA,GAEnBi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN7zC,EAAG+0C,EAAU,KACbjB,GAAIiB,EAAU,KACdn9C,EAAGm9C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACdh5B,EAAGg5B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBU,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC49C,WAAY,SAAUptD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO42C,EAAU52C,MAEpBjH,QAAQ,KAAM,MAEvB+8C,KAAM,CACFC,IAAK,EACLC,IAAK,MAzKyB9xD,CAAQ,EAAQ,8FCIlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wEAAwExsC,MAC5E,KAEJysC,YAAa,wEAAwEzsC,MACjF,KAEJ0sC,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,wCAAwC3sC,MAAM,KAC7D4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,OACH8zC,GAAI,WACJl8C,EAAG,QACHm8C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJl4B,EAAG,MACHm4B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB9xD,CAAQ,EAAQ,8FCElD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGFnS,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,6EAA6ExsC,MACjF,KAEJysC,YAAa,6EAA6EzsC,MACtF,KAEJ0sC,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,wCAAwC3sC,MAAM,KAC7D4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAUh9C,GACZ,MAAO,MAAQA,GAEnBi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,OACH8zC,GAAI,WACJl8C,EAAG,QACHm8C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJl4B,EAAG,MACHm4B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERmB,SAAU,SAAUttD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO82C,EAAU92C,MAEpBjH,QAAQ,KAAM,MAEvB49C,WAAY,SAAUptD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO42C,EAAU52C,MAEpBjH,QAAQ,KAAM,MAEvB+8C,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,yEAAyExsC,MAC7E,KAEJysC,YAAa,yEAAyEzsC,MAClF,KAEJ0sC,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,wCAAwC3sC,MAAM,KAC7D4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,OACH8zC,GAAI,WACJl8C,EAAG,QACHm8C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJl4B,EAAG,MACHm4B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETb,EAAa,SAAU1xC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEV2xC,EAAU,CACN90C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJo8C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJj4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJo4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAe9sD,EAAQ+sD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf7gD,EAAMkhD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAvhD,EAAMA,EAAIqhD,EAAgB,EAAI,IAE3BrhD,EAAI+D,QAAQ,MAAO88C,KAGlCvC,EAAS,CACL,QACA,SACA,OACA,QACA,OACA,QACA,QACA,QACA,SACA,SACA,SACA,UAGC3O,EAAO0O,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,wCAAwC3sC,MAAM,KAC7D4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAUh9C,GACZ,MAAO,MAAQA,GAEnBi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN7zC,EAAG+0C,EAAU,KACbjB,GAAIiB,EAAU,KACdn9C,EAAGm9C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACdh5B,EAAGg5B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBU,SAAU,SAAUttD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO82C,EAAU92C,MAEpBjH,QAAQ,KAAM,MAEvB49C,WAAY,SAAUptD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO42C,EAAU52C,MAEpBjH,QAAQ,KAAM,MAEvB+8C,KAAM,CACFC,IAAK,EACLC,IAAK,MAzLyB9xD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIzB,IAAIoS,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGCpS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,+EAA+ExsC,MACnF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,qEAAqE1sC,MAC3E,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,+BACVC,QAAS,aACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN7zC,EAAG,kBACH8zC,GAAI,YACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,SACHC,GAAI,SAER/B,cAAe,0BACfC,KAAM,SAAUh9C,GACZ,MAAO,mBAAmBuQ,KAAKvQ,IAEnCi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,SAEA,SAGfd,uBAAwB,wCACxBC,QAAS,SAAUC,GACf,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIp0C,EAAIo0C,EAAS,GAGjB,OAAOA,GAAUkB,EAASt1C,IAAMs1C,EAFvBlB,EAAS,IAAOp0C,IAEsBs1C,EADvClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnGyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAYzB,SAASqS,EAAuBnB,EAAQQ,EAAexsD,GASnD,MAAY,MAARA,EACOwsD,EAAgB,UAAY,UACpB,MAARxsD,EACAwsD,EAAgB,UAAY,UAE5BR,EAAS,KAtBFoB,GAsB6BpB,EArB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,yBAA2B,yBAC/ChB,GAAIgB,EAAgB,yBAA2B,yBAC/Cf,GAAI,iBACJE,GAAI,uBACJE,GAAI,kBAOgC7rD,GArBvBid,MAAM,KAChBmwC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAyBCvS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ1nC,OAAQ,uGAAuG9E,MAC3G,KAEJqwC,WAAY,qGAAqGrwC,MAC7G,MAGRysC,YAAa,0DAA0DzsC,MACnE,KAEJ0sC,SAAU,CACN5nC,OAAQ,0DAA0D9E,MAC9D,KAEJqwC,WAAY,0DAA0DrwC,MAClE,KAEJswC,SAAU,+CAEd3D,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,gBACTE,QAAS,eACTD,SAAU,WACN,MAAO,mBAEXE,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,0BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,2BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN7zC,EAAG,kBACHpI,EAAGg+C,EACH7B,GAAI6B,EACJ5B,EAAG4B,EACH3B,GAAI2B,EACJ75B,EAAG,QACHm4B,GAAI0B,EACJzB,EAAG,QACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAERrD,cAAe,yBACfC,KAAM,SAAUh9C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjCi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,SACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,mBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACD,OAAQzB,EAAS,IAAO,GAAKA,EAAS,IAAO,GACzCA,EAAS,KAAQ,IACjBA,EAAS,KAAQ,GAEfA,EAAS,KADTA,EAAS,KAEnB,IAAK,IACD,OAAOA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyB9xD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFxsC,MACxF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,YACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,0BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN7zC,EAAG,kBACH8zC,GAAI,aACJl8C,EAAG,SACHm8C,GAAI,YACJC,EAAG,MACHC,GAAI,UACJl4B,EAAG,MACHm4B,GAAI,UACJiC,EAAG,UACHC,GAAI,aACJjC,EAAG,QACHC,GAAI,YACJC,EAAG,SACHC,GAAI,aAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,IAAI4B,EAAY5B,EAAS,GACrB6B,EAAc7B,EAAS,IAC3B,OAAe,IAAXA,EACOA,EAAS,MACO,IAAhB6B,EACA7B,EAAS,MACT6B,EAAc,IAAMA,EAAc,GAClC7B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,GAAiC,IAAdA,EACnB5B,EAAS,MAETA,EAAS,OAGxBC,KAAM,CACFC,IAAK,EACLC,IAAK,KArFyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,8IAA8IxsC,MAClJ,KAEJysC,YAAa,iDAAiDzsC,MAAM,KACpE0sC,SAAU,+CAA+C1sC,MAAM,KAC/D2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,2BACJC,IAAK,wCACLC,KAAM,8CAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,qBACVC,QAAS,iBACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN7zC,EAAG,kBACH8zC,GAAI,aACJl8C,EAAG,eACHm8C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJl4B,EAAG,aACHm4B,GAAI,UACJC,EAAG,aACHC,GAAI,UACJC,EAAG,YACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAjDyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGFnS,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,mEAAmEzsC,MAC5E,KAEJ0sC,SAAU,4DAA4D1sC,MAClE,KAEJ2sC,cAAe,uCAAuC3sC,MAAM,KAC5D4sC,YAAa,kCAAkC5sC,MAAM,KACrDmtC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,gBACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN7zC,EAAG,eACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAIzB2zC,cAAe,uCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,QAAb5C,GAEa,SAAbA,EADA4C,EAGa,UAAb5C,EACA4C,GAAQ,EAAIA,EAAOA,EAAO,GACb,UAAb5C,GAEa,YAAbA,EADA4C,EAAO,QACX,GAKX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,EACP,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,QACAA,EAAO,GACP,UAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KA9HyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,mEAAmEzsC,MAC5E,KAEJ0sC,SAAU,4DAA4D1sC,MAClE,KAEJ2sC,cAAe,uCAAuC3sC,MAAM,KAC5D4sC,YAAa,kCAAkC5sC,MAAM,KACrDmtC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,gBACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN7zC,EAAG,eACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAGzB2zC,cAAe,2BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,QAAb5C,GAAsB4C,GAAQ,GACjB,UAAb5C,GAAwB4C,EAAO,GACnB,UAAb5C,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,QAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KApHyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qJAAqJxsC,MACzJ,KAEJysC,YAAa,iEAAiEzsC,MAC1E,KAEJ8wC,iBAAkB,gBAClBC,kBAAkB,EAClBrE,SAAU,gFAAgF1sC,MACtF,KAEJ2sC,cAAe,oDAAoD3sC,MAC/D,KAEJ4sC,YAAa,6BAA6B5sC,MAAM,KAChDmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,wBACVC,QAAS,YACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,QACH8zC,GAAI,YACJl8C,EAAG,aACHm8C,GAAI,WACJC,EAAG,cACHC,GAAI,YACJl4B,EAAG,WACHm4B,GAAI,UACJC,EAAG,YACHC,GAAI,UACJC,EAAG,UACHC,GAAI,SAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAGzB2zC,cAAe,wCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,WAAb5C,GAAyB4C,GAAQ,GACpB,YAAb5C,GAA0B4C,EAAO,GACrB,YAAb5C,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,UACAA,EAAO,GACP,UACAA,EAAO,GACP,UAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAxHyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,SAASmT,EAAyBjC,EAAQQ,EAAexsD,GAMrD,OAAOgsD,EAAS,IAoBpB,SAAkBjvC,EAAMivC,GACpB,OAAe,IAAXA,EAKR,SAAsBjvC,GAClB,IAAImxC,EAAgB,CAChB/+C,EAAG,IACH4J,EAAG,IACHua,EAAG,KAEP,YAAsChlB,IAAlC4/C,EAAcnxC,EAAKnd,OAAO,IACnBmd,EAEJmxC,EAAcnxC,EAAKnd,OAAO,IAAMmd,EAAKqX,UAAU,GAb3C+5B,CAAapxC,GAEjBA,EAxBeqxC,CALT,CACT9C,GAAI,WACJK,GAAI,MACJF,GAAI,UAE8BzrD,GAAMgsD,GAchD,SAASqC,EAAWrC,GAChB,OAAIA,EAAS,EACFqC,EAAWrC,EAAS,IAExBA,EAoBX,IAAIsC,EAAc,CACV,QACA,cACA,QACA,QACA,QACA,cACA,QACA,QACA,QACA,QACA,OACA,SAEJC,EAAc,6IAqBdC,EAAmB,CACf,OACA,OACA,eACA,QACA,OACA,OACA,QAGC1T,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,gFAAgFxsC,MACpF,KAEJysC,YAAa,mDAAmDzsC,MAAM,KACtE0sC,SAAU,6CAA6C1sC,MAAM,KAC7D2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,wBAAwB5sC,MAAM,KAC3CwxC,cAAeD,EACfE,kBArCoB,CAChB,QACA,QACA,WACA,iBACA,SACA,WACA,YA+BJC,mBA7BqB,CACjB,QACA,QACA,QACA,QACA,QACA,QACA,SAuBJH,iBAAkBA,EAElBD,YAAaA,EACbR,iBAAkBQ,EAClBK,kBA7CoB,wFA8CpBC,uBA7CyB,2DA8CzBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElBlE,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,sBACJC,IAAK,4BACLC,KAAM,mCAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,qBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,SACN7zC,EAAG,wBACH8zC,GAAI,YACJl8C,EAAG,cACHm8C,GAAI2C,EACJ1C,EAAG,SACHC,GAAI,SACJl4B,EAAG,YACHm4B,GAAIwC,EACJvC,EAAG,SACHC,GAAIsC,EACJrC,EAAG,WACHC,GApIR,SAAiCG,GAC7B,OAAQqC,EAAWrC,IACf,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOA,EAAS,SACpB,QACI,OAAOA,EAAS,YA6HxBF,uBAAwB,kBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,KAAO,QAGvCC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,YACfC,KAAM,SAAUruC,GACZ,MAAiB,SAAVA,GAEXsuC,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAOyC,EAAO,GAAK,OAAS,UAnKEvyD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,SAASkU,EAAUhD,EAAQQ,EAAexsD,GACtC,IAAIS,EAASurD,EAAS,IACtB,OAAQhsD,GACJ,IAAK,KAQD,OANIS,GADW,IAAXurD,EACU,UACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,IACD,OAAOQ,EAAgB,eAAiB,eAC5C,IAAK,KAQD,OANI/rD,GADW,IAAXurD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,UAGlB,IAAK,IACD,OAAOQ,EAAgB,YAAc,cACzC,IAAK,KAQD,OANI/rD,GADW,IAAXurD,EACU,MACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,OAEA,QAGlB,IAAK,KAMD,OAJIvrD,GADW,IAAXurD,EACU,MAEA,QAGlB,IAAK,KAQD,OANIvrD,GADW,IAAXurD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,KAQD,OANIvrD,GADW,IAAXurD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,WAMjBlR,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,8DAA8DzsC,MACvE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,4DAA4D1sC,MAClE,KAEJ2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,cACH8zC,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG,MACHm4B,GAAIuD,EACJtD,EAAG,SACHC,GAAIqD,EACJpD,EAAG,SACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAlJyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ6D,WAAY,oFAAoFrwC,MAC5F,KAEJ8E,OAAQ,qHAAqH9E,MACzH,KAEJswC,SAAU,mBAEd7D,YAAa,8DAA8DzsC,MACvE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,8DAA8D1sC,MACpE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,mBACJyE,GAAI,aACJxE,IAAK,gCACLyE,IAAK,mBACLxE,KAAM,qCACNyE,KAAM,wBAEVxE,SAAU,CACNC,QAAS,WACL,MAAO,YAA+B,IAAjBzwD,KAAK8vD,QAAgB,MAAQ,MAAQ,QAE9DY,QAAS,WACL,MAAO,YAA+B,IAAjB1wD,KAAK8vD,QAAgB,MAAQ,MAAQ,QAE9Da,SAAU,WACN,MAAO,YAA+B,IAAjB3wD,KAAK8vD,QAAgB,MAAQ,MAAQ,QAE9Dc,QAAS,WACL,MAAO,YAA+B,IAAjB5wD,KAAK8vD,QAAgB,MAAQ,MAAQ,QAE9De,SAAU,WACN,MACI,wBACkB,IAAjB7wD,KAAK8vD,QAAgB,MAAQ,MAC9B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,QACN7zC,EAAG,aACH8zC,GAAI,YACJl8C,EAAG,WACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,qBACxBC,QAAS,SAAUC,EAAQyB,GACvB,IAAI2B,EACW,IAAXpD,EACM,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACA,IAIV,MAHe,MAAXyB,GAA6B,MAAXA,IAClB2B,EAAS,KAENpD,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KA/FyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAI2O,EAAS,oFAAoFxsC,MACzF,KAEJysC,EAAc,kDAAkDzsC,MAAM,KACtEqxC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,yBACA,4BACA,QACA,QACA,QACA,QACA,SAIJC,EAAc,wJAElB,SAASc,EAAO30C,GACZ,OAAOA,EAAI,GAAKA,EAAI,GAAoB,MAAZA,EAAI,IAEpC,SAASs0C,EAAUhD,EAAQQ,EAAexsD,EAAKysD,GAC3C,IAAIhsD,EAASurD,EAAS,IACtB,OAAQhsD,GACJ,IAAK,IACD,OAAOwsD,GAAiBC,EAAW,aAAe,gBACtD,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,UAAY,UAEvCvrD,EAAS,YAExB,IAAK,IACD,OAAO+rD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,SAAW,SAEtCvrD,EAAS,WAExB,IAAK,IACD,OAAO+rD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,SAAW,SAEtCvrD,EAAS,WAExB,IAAK,IACD,OAAO+rD,GAAiBC,EAAW,MAAQ,OAC/C,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,MAAQ,OAEnCvrD,EAAS,MAExB,IAAK,IACD,OAAO+rD,GAAiBC,EAAW,QAAU,UACjD,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,SAAW,UAEtCvrD,EAAS,SAExB,IAAK,IACD,OAAO+rD,GAAiBC,EAAW,MAAQ,QAC/C,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,OAAS,OAEpCvrD,EAAS,QAKvBq6C,EAAO0O,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaA,EACb6E,YAAaA,EACbR,iBAAkBQ,EAGlBK,kBAAmB,uKACnBC,uBAAwB,sDACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,mDAAmD1sC,MAAM,KACnE2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,yBACN99B,EAAG,cAEP+9B,SAAU,CACNC,QAAS,cACTC,QAAS,eACTC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,kBACX,KAAK,EACL,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,mBACX,KAAK,EACD,MAAO,oBACX,KAAK,EACD,MAAO,iBACX,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,wBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,0BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAGy3C,EACH3D,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG07B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzKyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,gEAAgExsC,MACpE,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,oEAAoE1sC,MAC1E,KAEJ2sC,cAAe,6BAA6B3sC,MAAM,KAClD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,sCACJC,IAAK,6CACLC,KAAM,oDAEVC,SAAU,CACNC,QAAS,sBACTC,QAAS,sBACTE,QAAS,sBACTD,SAAU,4BACVE,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAUiE,GAMd,OAAOA,GALK,UAAUxrD,KAAKwrD,GACrB,MACA,QAAQxrD,KAAKwrD,GACb,MACA,QAGVhE,KAAM,YACN7zC,EAAG,iBACH8zC,GAAI,aACJl8C,EAAG,YACHm8C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,WACHC,GAAI,UACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,cACxBC,QAAS,SACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA5DyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFxsC,MAC7F,KAEJysC,YAAa,qDAAqDzsC,MAC9D,KAEJ0sC,SAAU,+EAA+E1sC,MACrF,KAEJ2sC,cAAe,+BAA+B3sC,MAAM,KACpD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EAEpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN7zC,EAAG,mBACH8zC,GAAI,YACJl8C,EAAG,QACHm8C,GAAI,WACJC,EAAG,MACHC,GAAI,SACJl4B,EAAG,UACHm4B,GAAI,aACJC,EAAG,MACHC,GAAI,SACJC,EAAG,WACHC,GAAI,cAERC,uBAAwB,mCAExBC,QAAS,SAAUC,GACf,IACIoD,EAAS,GAiCb,OAlCQpD,EAyBA,GAEAoD,EADM,KA1BNpD,GA0BkB,KA1BlBA,GA0B8B,KA1B9BA,GA0B0C,KA1B1CA,GA0BsD,MA1BtDA,EA2BS,MAEA,MA7BTA,EA+BO,IACXoD,EA9BS,CACL,GACA,KACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,OAvBApD,IAkCDA,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KA9FyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,sFAAsFxsC,MAC1F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,qDAAqD1sC,MAAM,KACrE2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,mBACVC,QAAS,iBACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,cACH8zC,GAAI,cACJl8C,EAAG,WACHm8C,GAAI,cACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJC,EAAG,WACHC,GAAI,aACJC,EAAG,QACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB9xD,CAAQ,EAAQ,8FCMlD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBo8C,EAAG,CAAC,cAAe,gBACnBj4B,EAAG,CAAC,UAAW,aACfm4B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgBzqC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG7C86C,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,6DAA6DzsC,MACtE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,8DAA8D1sC,MACpE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAGmgD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJl4B,EAAGg8B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB9xD,CAAQ,EAAQ,8FCAlD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBo8C,EAAG,CAAC,cAAe,gBACnBj4B,EAAG,CAAC,UAAW,aACfm4B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgBzqC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG7C86C,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,6DAA6DzsC,MACtE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,8DAA8D1sC,MACpE,KAEJ2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAGmgD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJl4B,EAAGg8B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBo8C,EAAG,CAAC,cAAe,gBACnBj4B,EAAG,CAAC,UAAW,aACfm4B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgBzqC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG/C86C,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,6DAA6DzsC,MACtE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,8DAA8D1sC,MACpE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAGmgD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJl4B,EAAGg8B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB9xD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIzB,IAAI2O,EAAS,CACL,WACA,aACA,SACA,WACA,KACA,OACA,SACA,WACA,eACA,aACA,aACA,cAEJE,EAAW,CACP,WACA,OACA,WACA,OACA,aACA,SACA,YAGC7O,EAAO0O,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUA,EACVC,cAAeD,EACfE,YAAa,qCAAqC5sC,MAAM,KACxDmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,WACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,QACfC,KAAM,SAAUh9C,GACZ,MAAO,OAASA,GAEpBi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,UACVC,QAAS,cACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,cACRC,KAAM,YACN7zC,EAAG,iBACH8zC,GAAI,cACJl8C,EAAG,WACHm8C,GAAI,YACJC,EAAG,aACHC,GAAI,cACJl4B,EAAG,WACHm4B,GAAI,YACJC,EAAG,SACHC,GAAI,UACJC,EAAG,WACHC,GAAI,aAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC49C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC+8C,KAAM,CACFC,IAAK,EACLC,IAAK,MAxFyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAWhBA,EAAO0O,aAAa,KAAM,CAC/B+F,mBAAoB,qHAAqHtyC,MACrI,KAEJuyC,iBAAkB,qHAAqHvyC,MACnI,KAEJwsC,OAAQ,SAAUgG,EAAgB1tC,GAC9B,OAAK0tC,EAGiB,iBAAX1tC,GACP,IAAIzE,KAAKyE,EAAOqS,UAAU,EAAGrS,EAAO1Z,QAAQ,UAGrClO,KAAKu1D,kBAAkBD,EAAeE,SAEtCx1D,KAAKy1D,oBAAoBH,EAAeE,SARxCx1D,KAAKy1D,qBAWpBlG,YAAa,oDAAoDzsC,MAAM,KACvE0sC,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C+sC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCJ,KAAM,SAAUh9C,GACZ,MAAyC,OAAjCA,EAAQ,IAAIsU,cAAc,IAEtCyoC,cAAe,gBACfM,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVmF,WAAY,CACRjF,QAAS,iBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MAAO,gCACX,QACI,MAAO,mCAGnBvC,SAAU,KAEdN,SAAU,SAAU3qD,EAAK8vD,GACrB,IApEY/iD,EAoERqiD,EAASj1D,KAAK41D,YAAY/vD,GAC1BiqD,EAAQ6F,GAAOA,EAAI7F,QAIvB,OAzEYl9C,EAsEGqiD,GApEM,oBAAbvuC,UAA4B9T,aAAiB8T,UACX,sBAA1CnT,OAAO1R,UAAUiT,SAAS/S,KAAK6Q,MAoE3BqiD,EAASA,EAAO9yD,MAAMwzD,IAEnBV,EAAOlgD,QAAQ,KAAM+6C,EAAQ,IAAO,EAAI,MAAQ,SAE3DiB,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,oBACH8zC,GAAI,kBACJl8C,EAAG,YACHm8C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,WACHm4B,GAAI,WACJC,EAAG,aACHC,GAAI,WACJC,EAAG,cACHC,GAAI,aAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,eACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,SA7DgB1e,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,SA7DgB1e,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB9xD,CAAQ,EAAQ,2FCMlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FxsC,MACjG,KAEJysC,YAAa,oDAAoDzsC,MAAM,KACvE0sC,SAAU,qDAAqD1sC,MAAM,KACrE2sC,cAAe,gCAAgC3sC,MAAM,KACrD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,4BACJC,IAAK,kCACLC,KAAM,2CACNyE,KAAM,uCAEVrF,cAAe,cACfC,KAAM,SAAUh9C,GACZ,MAAyC,MAAlCA,EAAMnN,OAAO,GAAGyhB,eAE3B2oC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,SAAW,SAErBA,EAAU,SAAW,UAGpCQ,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN7zC,EAAG,kBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,WACHm4B,GAAI,WACJC,EAAG,aACHC,GAAI,aACJC,EAAG,WACHC,GAAI,YAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA/DyB9xD,CAAQ,EAAQ,8FCDlD,SAAWygD,GAAU,aAIzB,IAAIkV,EAAiB,8DAA8D/yC,MAC3E,KAEJysC,EAAc,kDAAkDzsC,MAAM,KACtEqxC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEPzT,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,2FAA2FxsC,MAC/F,KAEJysC,YAAa,SAAUv6C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACb2nC,EAAYv6C,EAAEwgD,SAEdK,EAAe7gD,EAAEwgD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,+BACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBzwD,KAAK8vD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjB1wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjB3wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB5wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB7wD,KAAK8vD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,gBACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB9xD,CAAQ,EAAQ,8FCIlD,SAAWygD,GAAU,aAIzB,IAAIkV,EAAiB,8DAA8D/yC,MAC3E,KAEJysC,EAAc,kDAAkDzsC,MAAM,KACtEqxC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEPzT,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,2FAA2FxsC,MAC/F,KAEJysC,YAAa,SAAUv6C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACb2nC,EAAYv6C,EAAEwgD,SAEdK,EAAe7gD,EAAEwgD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBzwD,KAAK8vD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjB1wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjB3wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB5wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB7wD,KAAK8vD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,gBACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,GAET8D,YAAa,mBAzGqB51D,CAAQ,EAAQ,8FCIlD,SAAWygD,GAAU,aAIzB,IAAIkV,EAAiB,8DAA8D/yC,MAC3E,KAEJysC,EAAc,kDAAkDzsC,MAAM,KACtEqxC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEPzT,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,2FAA2FxsC,MAC/F,KAEJysC,YAAa,SAAUv6C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACb2nC,EAAYv6C,EAAEwgD,SAEdK,EAAe7gD,EAAEwgD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,+BACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBzwD,KAAK8vD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjB1wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjB3wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB5wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB7wD,KAAK8vD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,gBACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIzB,IAAIkV,EAAiB,8DAA8D/yC,MAC3E,KAEJysC,EAAc,kDAAkDzsC,MAAM,KACtEqxC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAETzT,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FxsC,MAC/F,KAEJysC,YAAa,SAAUv6C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACb2nC,EAAYv6C,EAAEwgD,SAEdK,EAAe7gD,EAAEwgD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBzwD,KAAK8vD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjB1wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjB3wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB5wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB7wD,KAAK8vD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,gBACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,GAET8D,YAAa,mBAzGqB51D,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACTxK,EAAG,CAAC,eAAgB,cAAe,iBACnC8zC,GAAI,CAACW,EAAS,UAAWA,EAAS,YAClC78C,EAAG,CAAC,aAAc,aAClBm8C,GAAI,CAACU,EAAS,UAAWA,EAAS,YAClCT,EAAG,CAAC,YAAa,YAAa,YAC9BC,GAAI,CAACQ,EAAS,SAAUA,EAAS,UACjC14B,EAAG,CAAC,YAAa,YACjBo4B,EAAG,CAAC,UAAW,WAAY,WAC3BC,GAAI,CAACK,EAAS,OAAQA,EAAS,SAC/BJ,EAAG,CAAC,YAAa,QAAS,aAC1BC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAIQ,EACOzqC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAElDysD,EAAW1qC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG1C86C,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FxsC,MACjG,KAEJysC,YAAa,6DAA6DzsC,MACtE,KAEJ0sC,SAAU,iEAAiE1sC,MACvE,KAEJ2sC,cAAe,gBAAgB3sC,MAAM,KACrC4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,cACTC,SAAU,qBACVC,QAAS,aACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,YACN7zC,EAAG+3C,EACHjE,GAAIiE,EACJngD,EAAGmgD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJh8B,EAAGg8B,EACH7D,GAAI,WACJC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA3EyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,+FAA+FxsC,MACnG,KAEJysC,YAAa,8DAA8DzsC,MACvE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,sEAAsE1sC,MAC5E,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,0BACJC,IAAK,gCACLC,KAAM,sCACN99B,EAAG,WACHqiC,GAAI,oBACJC,IAAK,0BACLC,KAAM,gCAEVxE,SAAU,CACNC,QAAS,kBACTC,QAAS,mBACTC,SAAU,gBACVC,QAAS,kBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN7zC,EAAG,iBACH8zC,GAAI,aACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,WACHm4B,GAAI,UACJC,EAAG,eACHC,GAAI,cACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7DyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,wEAAwExsC,MAC5E,KAEJysC,YAAa,wEAAwEzsC,MACjF,KAEJ0sC,SAAU,qDAAoE1sC,MAC1E,KAEJ2sC,cAAe,qDAAoE3sC,MAC/E,KAEJ4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,wBACfC,KAAM,SAAUh9C,GACZ,MAAO,aAAauQ,KAAKvQ,IAE7Bi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,aAEA,cAGfjC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,iBACVC,QAAS,kBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,YACH8zC,GAAI,WACJl8C,EAAG,WACHm8C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUttD,GAChB,OAAOA,EACFwP,QAAQ,UAAU,SAAUiH,GACzB,OAAO82C,EAAU92C,MAEpBjH,QAAQ,KAAM,MAEvB49C,WAAY,SAAUptD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO42C,EAAU52C,MAEpBjH,QAAQ,KAAM,MAEvB48C,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,MA5GyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIoV,EAAc,wEAAwEjzC,MAClF,KAEJkzC,EAAgB,CACZ,QACA,QACA,SACA,SACA,SACA,SACA,SACAD,EAAY,GACZA,EAAY,GACZA,EAAY,IAEpB,SAASlB,EAAUhD,EAAQQ,EAAexsD,EAAKysD,GAC3C,IAAIhsD,EAAS,GACb,OAAQT,GACJ,IAAK,IACD,OAAOysD,EAAW,oBAAsB,kBAC5C,IAAK,KACDhsD,EAASgsD,EAAW,WAAa,WACjC,MACJ,IAAK,IACD,OAAOA,EAAW,WAAa,WACnC,IAAK,KACDhsD,EAASgsD,EAAW,WAAa,YACjC,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACDhsD,EAASgsD,EAAW,SAAW,SAC/B,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACDhsD,EAASgsD,EAAW,SAAW,SAC/B,MACJ,IAAK,IACD,OAAOA,EAAW,YAAc,WACpC,IAAK,KACDhsD,EAASgsD,EAAW,YAAc,YAClC,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACDhsD,EAASgsD,EAAW,SAAW,SAIvC,OAEJ,SAAsBT,EAAQS,GAC1B,OAAOT,EAAS,GACVS,EACI0D,EAAcnE,GACdkE,EAAYlE,GAChBA,EARGoE,CAAapE,EAAQS,GAAY,IAAMhsD,EAW3Cq6C,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,2GAA2GxsC,MAC/G,KAEJysC,YAAa,uEAAuEzsC,MAChF,KAEJ0sC,SAAU,qEAAqE1sC,MAC3E,KAEJ2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,mBACJC,IAAK,gCACLC,KAAM,sCACN99B,EAAG,WACHqiC,GAAI,cACJC,IAAK,2BACLC,KAAM,iCAEVxE,SAAU,CACNC,QAAS,oBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,mBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,YACN7zC,EAAGy3C,EACH3D,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG07B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyB9xD,CAAQ,EAAQ,4FCIlD,SAAWygD,GAAU,aAIfA,EAAO0O,aAAa,MAAO,CACjCC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,wBAAwB5sC,MAAM,KAC3CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,YACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,gBACTC,SAAU,0BACVC,QAAS,eACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,mBACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,eACHm8C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJl4B,EAAG,aACHm4B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,aACHC,GAAI,WAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,4EAA4E1sC,MAClF,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,kBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,YACN7zC,EAAG,YACH8zC,GAAI,cACJl8C,EAAG,eACHm8C,GAAI,cACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,YACHm4B,GAAI,WACJC,EAAG,cACHC,GAAI,aACJC,EAAG,UACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KArDyB9xD,CAAQ,EAAQ,8FCElD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,uFAAuFxsC,MAC3F,KAEJysC,YAAa,iEAAiEzsC,MAC1E,KAEJ+wC,kBAAkB,EAClBrE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJl4B,EAAG,UACHm4B,GAAI,WACJC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,gBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,QACA,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,SAlEjB3xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,uFAAuFxsC,MAC3F,KAEJysC,YAAa,iEAAiEzsC,MAC1E,KAEJ+wC,kBAAkB,EAClBrE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJl4B,EAAG,UACHm4B,GAAI,WACJC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,gBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,QACA,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,OAGnDC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvEyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAEIyT,EAAc,yKACdD,EAAc,CACV,SACA,SACA,SACA,QACA,QACA,SACA,SACA,SACA,SACA,QACA,QACA,SAGCxT,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFxsC,MAC3F,KAEJysC,YAAa,iEAAiEzsC,MAC1E,KAEJsxC,YAAaA,EACbR,iBAAkBQ,EAClBK,kBA3BoB,2FA4BpBC,uBA3ByB,oFA4BzBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJl4B,EAAG,UACHm4B,GAAI,WACJiC,EAAG,cACHC,GAAI,cACJjC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAIJ,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,IAG3C,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,OAGnDC,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIuV,EAAsB,6DAA6DpzC,MAC/E,KAEJqzC,EAAyB,kDAAkDrzC,MACvE,KAGC69B,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,iGAAiGxsC,MACrG,KAEJysC,YAAa,SAAUv6C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbuuC,EAAuBnhD,EAAEwgD,SAEzBU,EAAoBlhD,EAAEwgD,SAJtBU,GAOfrC,kBAAkB,EAClBrE,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,iBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN7zC,EAAG,mBACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,UACHm4B,GAAI,WACJC,EAAG,aACHC,GAAI,aACJC,EAAG,WACHC,GAAI,cAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA3EyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aA4ChBA,EAAO0O,aAAa,KAAM,CAC/BC,OAzCS,CACL,SACA,UACA,QACA,UACA,YACA,YACA,OACA,SACA,eACA,mBACA,UACA,WA8BJC,YA5Bc,CACV,MACA,QACA,OACA,MACA,OACA,QACA,OACA,MACA,OACA,OACA,OACA,QAiBJsE,kBAAkB,EAClBrE,SAhBW,CACP,eACA,WACA,WACA,cACA,YACA,YACA,eAUJC,cARgB,CAAC,OAAQ,OAAQ,QAAS,OAAQ,OAAQ,QAAS,QASnEC,YARc,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,IAAK,MASlDO,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,kBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,YACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,UACHm8C,GAAI,aACJC,EAAG,iBACHC,GAAI,oBACJl4B,EAAG,KACHm4B,GAAI,QACJC,EAAG,KACHC,GAAI,YACJC,EAAG,SACHC,GAAI,aAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,IAAMA,EAAS,IAAO,EAAI,KAAO,OAGjEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA7FyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aA4ChBA,EAAO0O,aAAa,KAAM,CAC/BC,OAzCS,CACL,gBACA,aACA,UACA,aACA,aACA,eACA,cACA,cACA,eACA,aACA,eACA,gBA8BJC,YA5Bc,CACV,OACA,OACA,OACA,OACA,OACA,OACA,OACA,MACA,OACA,OACA,OACA,QAiBJsE,kBAAkB,EAClBrE,SAhBW,CACP,cACA,UACA,UACA,YACA,YACA,WACA,eAUJC,cARgB,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OAS3DC,YARc,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,MASnDO,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,gBACN7zC,EAAG,gBACH8zC,GAAI,YACJl8C,EAAG,UACHm8C,GAAI,gBACJC,EAAG,OACHC,GAAI,aACJl4B,EAAG,QACHm4B,GAAI,WACJC,EAAG,OACHC,GAAI,YACJC,EAAG,WACHC,GAAI,eAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,IAAMA,EAAS,IAAO,EAAI,KAAO,OAGjEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA7FyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFxsC,MAC7F,KAEJysC,YAAa,8DAA8DzsC,MACvE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,mDAAmD1sC,MAAM,KACnE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,UAA6B,IAAjBzwD,KAAK8vD,QAAgB,KAAO,KAAO,QAE1DY,QAAS,WACL,MAAO,UAA6B,IAAjB1wD,KAAK8vD,QAAgB,KAAO,KAAO,QAE1Da,SAAU,WACN,MAAO,UAA6B,IAAjB3wD,KAAK8vD,QAAgB,KAAO,KAAO,QAE1Dc,QAAS,WACL,MAAO,UAA6B,IAAjB5wD,KAAK8vD,QAAgB,IAAM,KAAO,QAEzDe,SAAU,WACN,MACI,qBAAwC,IAAjB7wD,KAAK8vD,QAAgB,KAAO,KAAO,QAGlEgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAUhgD,GACd,OAA0B,IAAtBA,EAAI9C,QAAQ,MACL,IAAM8C,EAEV,MAAQA,GAEnBigD,KAAM,SACN7zC,EAAG,eACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,YACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxEyB9xD,CAAQ,EAAQ,iGCGlD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACTxK,EAAG,CAAC,kBAAmB,cACvB8zC,GAAI,CAACW,EAAS,aAAcA,EAAS,UACrC78C,EAAG,CAAC,aAAc,YAClBm8C,GAAI,CAACU,EAAS,YAAaA,EAAS,WACpCT,EAAG,CAAC,WAAY,SAChBC,GAAI,CAACQ,EAAS,UAAWA,EAAS,SAClC14B,EAAG,CAAC,YAAa,UACjBm4B,GAAI,CAACO,EAAS,WAAYA,EAAS,QACnCN,EAAG,CAAC,gBAAiB,aACrBC,GAAI,CAACK,EAAS,cAAeA,EAAS,WACtCJ,EAAG,CAAC,aAAc,WAClBC,GAAI,CAACG,EAAS,YAAaA,EAAS,YAExC,OAAOS,EAAW1qC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAGrC86C,EAAO0O,aAAa,WAAY,CAC1CC,OAAQ,CACJ6D,WAAY,wFAAwFrwC,MAChG,KAEJ8E,OAAQ,mJAAmJ9E,MACvJ,KAEJswC,SAAU,mBAEd7D,YAAa,4EAA4EzsC,MACrF,KAEJ+wC,kBAAkB,EAClBrE,SAAU,qDAAqD1sC,MAAM,KACrE2sC,cAAe,4CAA4C3sC,MAAM,KACjE4sC,YAAa,wBAAwB5sC,MAAM,KAC3C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,kBACJC,IAAK,qBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,8BACLC,KAAM,uCACNyE,KAAM,oCAEVxE,SAAU,CACNC,QAAS,WACTC,QAAS,eACTC,SAAU,qBACVC,QAAS,WACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,KACRC,KAAM,UACN7zC,EAAG+3C,EACHjE,GAAIiE,EACJngD,EAAGmgD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJh8B,EAAGg8B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,IAAK,IACD,OAAOzB,EAAS,MACpB,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,IACD,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,4BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,WAAb5C,EACA4C,EACa,YAAb5C,EACA4C,EAAO,GAAKA,EAAOA,EAAO,GACb,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,SACAA,EAAO,GACP,UACAA,EAAO,GACP,QAEA,UAzHmBvyD,CAAQ,EAAQ,iGCGlD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACTxK,EAAG,CAAC,qBAAsB,iBAC1B8zC,GAAI,CAACW,EAAS,cAAeA,EAAS,WACtC78C,EAAG,CAAC,aAAc,YAClBm8C,GAAI,CAACU,EAAS,YAAaA,EAAS,WACpCT,EAAG,CAAC,YAAa,UACjBC,GAAI,CAACQ,EAAS,WAAYA,EAAS,UACnC14B,EAAG,CAAC,YAAa,UACjBm4B,GAAI,CAACO,EAAS,WAAYA,EAAS,QACnCN,EAAG,CAAC,eAAgB,aACpBC,GAAI,CAACK,EAAS,cAAeA,EAAS,WACtCJ,EAAG,CAAC,aAAc,YAClBC,GAAI,CAACG,EAAS,YAAaA,EAAS,YAExC,OAAOS,EAAW1qC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAGrC86C,EAAO0O,aAAa,WAAY,CAC1CC,OAAQ,CACJ6D,WAAY,4EAA4ErwC,MACpF,KAEJ8E,OAAQ,wIAAwI9E,MAC5I,KAEJswC,SAAU,mBAEd7D,YAAa,4DAA4DzsC,MACrE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,iBACJC,IAAK,oBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,6BACLC,KAAM,sCACNyE,KAAM,mCAEVxE,SAAU,CACNC,QAAS,WACTC,QAAS,cACTC,SAAU,sBACVC,QAAS,WACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,KACRC,KAAM,UACN7zC,EAAG+3C,EACHjE,GAAIiE,EACJngD,EAAGmgD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJh8B,EAAGg8B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,cACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,IAAK,IACD,OAAOzB,EAAS,KACpB,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,IACD,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,+BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,aAAb5C,EACA4C,EACa,aAAb5C,EACA4C,EAAO,GAAKA,EAAOA,EAAO,GACb,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,QAEA,UAzHmBvyD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFxsC,MAC7F,KAEJysC,YAAa,yEAAyEzsC,MAClF,KAEJ+wC,kBAAkB,EAClBrE,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,mCAAmC3sC,MAAM,KACxD4sC,YAAa,qBAAqB5sC,MAAM,KACxCmtC,eAAgB,CACZC,GAAI,gBACJC,IAAK,mBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,WACH8zC,GAAI,WACJl8C,EAAG,WACHm8C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,UACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAKzB2zC,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,SAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,OACAA,EAAO,GACP,OAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,0EAA0ExsC,MAC9E,KAEJysC,YAAa,4DAA4DzsC,MACrE,KAEJ0sC,SAAU,uCAAuC1sC,MAAM,KACvD2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,uBACLC,KAAM,6BACN99B,EAAG,WACHqiC,GAAI,aACJC,IAAK,mBACLC,KAAM,yBAEVxE,SAAU,CACNC,QAAS,cACTC,QAAS,aACTC,SAAU,iBACVC,QAAS,eACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN7zC,EAAG,aACH8zC,GAAI,WACJl8C,EAAG,MACHm8C,GAAI,UACJC,EAAG,MACHC,GAAI,SAAUQ,GACV,OAAe,IAAXA,EACO,SAEJA,EAAS,SAEpB14B,EAAG,MACHm4B,GAAI,SAAUO,GACV,OAAe,IAAXA,EACO,SAEJA,EAAS,SAEpBN,EAAG,OACHC,GAAI,SAAUK,GACV,OAAe,IAAXA,EACO,UAEJA,EAAS,WAEpBJ,EAAG,MACHC,GAAI,SAAUG,GACV,OAAe,IAAXA,EACO,SACAA,EAAS,IAAO,GAAgB,KAAXA,EACrBA,EAAS,OAEbA,EAAS,UAGxBlC,cAAe,gEACfC,KAAM,SAAUh9C,GACZ,MAAO,8BAA8BuQ,KAAKvQ,IAE9Ci9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,aACAA,EAAO,GACP,QACAA,EAAO,GACPzC,EAAU,SAAW,eACrByC,EAAO,GACPzC,EAAU,QAAU,eAEpB,UAzFmB9vD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETqB,EAAc,CACV,OACA,WACA,UACA,UACA,OACA,QACA,QACA,OACA,aACA,UACA,WACA,cAiBCxT,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ1nC,OAAQ,8EAA8E9E,MAClF,KAEJqwC,WAAY,0EAA0ErwC,MAClF,MAGRysC,YAAa,6DAA6DzsC,MACtE,KAEJ0sC,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,kCAAkC3sC,MAAM,KACvD4sC,YAAa,qBAAqB5sC,MAAM,KACxCmtC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAGV4D,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAzCmB,CACf,OACA,QACA,UACA,UACA,OACA,QACA,QACA,OACA,QACA,UACA,OACA,SA+BJR,YAAa,+KAEbR,iBAAkB,+KAElBa,kBAAmB,uIAEnBC,uBAAwB,sFAExBlE,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,WACVC,QAAS,UACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN7zC,EAAG,cACH8zC,GAAI,WACJl8C,EAAG,UACHm8C,GAAI,UACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAKzB2zC,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,QAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,MAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAlKyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,SAASkU,EAAUhD,EAAQQ,EAAexsD,GACtC,IAAIS,EAASurD,EAAS,IACtB,OAAQhsD,GACJ,IAAK,KAQD,OANIS,GADW,IAAXurD,EACU,UACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,IACD,OAAOQ,EAAgB,eAAiB,eAC5C,IAAK,KAQD,OANI/rD,GADW,IAAXurD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,UAGlB,IAAK,IACD,OAAOQ,EAAgB,YAAc,cACzC,IAAK,KAQD,OANI/rD,GADW,IAAXurD,EACU,MACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,OAEA,QAGlB,IAAK,KAMD,OAJIvrD,GADW,IAAXurD,EACU,MAEA,QAGlB,IAAK,KAQD,OANIvrD,GADW,IAAXurD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,KAQD,OANIvrD,GADW,IAAXurD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,WAMjBlR,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ1nC,OAAQ,oGAAoG9E,MACxG,KAEJqwC,WAAY,gGAAgGrwC,MACxG,MAGRysC,YAAa,+DAA+DzsC,MACxE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,4DAA4D1sC,MAClE,KAEJ2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MAAO,6BACX,KAAK,EACD,MAAO,4BACX,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,cACH8zC,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG,MACHm4B,GAAIuD,EACJtD,EAAG,SACHC,GAAIqD,EACJpD,EAAG,SACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxJyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,IAAIyV,EAAc,gEAAgEtzC,MAC9E,KAEJ,SAAS+xC,EAAUhD,EAAQQ,EAAexsD,EAAKysD,GAC3C,IAAIW,EAAMpB,EACV,OAAQhsD,GACJ,IAAK,IACD,OAAOysD,GAAYD,EACb,mBACA,oBACV,IAAK,KACD,OAAOY,GAAOX,GAAYD,GACpB,aACA,cACV,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,QAAU,UAC1D,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,QAAU,UACxD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,OAAS,UACzD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,OAAS,UACvD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,OAAS,UACzD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,OAAS,UACvD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,SAAW,YAC3D,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,SAAW,YACzD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,MAAQ,QACxD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,MAAQ,QAE1D,MAAO,GAEX,SAASP,EAAKQ,GACV,OACKA,EAAW,GAAK,WACjB,IACA8D,EAAYp2D,KAAKqzD,OACjB,aAIC1S,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGxsC,MACxG,KAEJysC,YAAa,iEAAiEzsC,MAC1E,KAEJ+wC,kBAAkB,EAClBrE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,gCAAgC3sC,MAAM,KACrD4sC,YAAa,qBAAqB5sC,MAAM,KACxCmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVZ,cAAe,SACfC,KAAM,SAAUh9C,GACZ,MAAyC,MAAlCA,EAAMnN,OAAO,GAAGyhB,eAE3B2oC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,IACW,IAAZE,EAAmB,KAAO,MAEd,IAAZA,EAAmB,KAAO,MAGzCQ,SAAU,CACNC,QAAS,gBACTC,QAAS,oBACTC,SAAU,WACN,OAAOmB,EAAK/vD,KAAK/B,MAAM,IAE3B4wD,QAAS,oBACTC,SAAU,WACN,OAAOiB,EAAK/vD,KAAK/B,MAAM,IAE3B8wD,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,KACN7zC,EAAGy3C,EACH3D,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG07B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnHyB9xD,CAAQ,EAAQ,8FCElD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,CACJ1nC,OAAQ,4GAA4G9E,MAChH,KAEJqwC,WAAY,gGAAgGrwC,MACxG,MAGRysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,gEAAgE1sC,MACtE,KAEJ2sC,cAAe,+BAA+B3sC,MAAM,KACpD4sC,YAAa,+BAA+B5sC,MAAM,KAClDmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTE,QAAS,YACTD,SAAU,WACN,MAAO,sBAEXE,SAAU,WACN,MAAO,8BAEXC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN7zC,EAAG,mBACH8zC,GAAI,cACJl8C,EAAG,OACHm8C,GAAI,UACJC,EAAG,MACHC,GAAI,SACJl4B,EAAG,KACHm4B,GAAI,QACJC,EAAG,OACHC,GAAI,UACJC,EAAG,OACHC,GAAI,WAER/B,cAAe,oCACfC,KAAM,SAAUh9C,GACZ,MAAO,uBAAuBuQ,KAAKvQ,IAEvCi9C,SAAU,SAAU4C,GAChB,OAAIA,EAAO,EACA,UACAA,EAAO,GACP,WACAA,EAAO,GACP,UAEA,YAGfd,uBAAwB,0BACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,OACD,OAAe,IAAXzB,EACOA,EAAS,MAEbA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFxsC,MAC7F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,6CAA6C1sC,MAAM,KAC7D2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,wBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,GAAoC,UAAbA,EACvB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,QACAA,EAAQ,GACR,OAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,mBACTC,SAAU,kBACVC,QAAS,qBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,eACN7zC,EAAG,iBACH8zC,GAAI,WACJl8C,EAAG,UACHm8C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJl4B,EAAG,SACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIzB,SAASuU,EAAO30C,GACZ,OAAIA,EAAI,KAAQ,IAELA,EAAI,IAAO,EAK1B,SAASs0C,EAAUhD,EAAQQ,EAAexsD,EAAKysD,GAC3C,IAAIhsD,EAASurD,EAAS,IACtB,OAAQhsD,GACJ,IAAK,IACD,OAAOwsD,GAAiBC,EAClB,mBACA,mBACV,IAAK,KACD,OAAI4C,EAAOrD,GAEHvrD,GACC+rD,GAAiBC,EAAW,WAAa,YAG3ChsD,EAAS,UACpB,IAAK,IACD,OAAO+rD,EAAgB,SAAW,SACtC,IAAK,KACD,OAAI6C,EAAOrD,GAEHvrD,GAAU+rD,GAAiBC,EAAW,UAAY,WAE/CD,EACA/rD,EAAS,SAEbA,EAAS,SACpB,IAAK,KACD,OAAI4uD,EAAOrD,GAEHvrD,GACC+rD,GAAiBC,EACZ,gBACA,iBAGPhsD,EAAS,cACpB,IAAK,IACD,OAAI+rD,EACO,QAEJC,EAAW,MAAQ,OAC9B,IAAK,KACD,OAAI4C,EAAOrD,GACHQ,EACO/rD,EAAS,QAEbA,GAAUgsD,EAAW,OAAS,SAC9BD,EACA/rD,EAAS,QAEbA,GAAUgsD,EAAW,MAAQ,QACxC,IAAK,IACD,OAAID,EACO,UAEJC,EAAW,QAAU,SAChC,IAAK,KACD,OAAI4C,EAAOrD,GACHQ,EACO/rD,EAAS,UAEbA,GAAUgsD,EAAW,SAAW,WAChCD,EACA/rD,EAAS,UAEbA,GAAUgsD,EAAW,QAAU,UAC1C,IAAK,IACD,OAAOD,GAAiBC,EAAW,KAAO,MAC9C,IAAK,KACD,OAAI4C,EAAOrD,GACAvrD,GAAU+rD,GAAiBC,EAAW,KAAO,QAEjDhsD,GAAU+rD,GAAiBC,EAAW,KAAO,QAIvD3R,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFxsC,MACxF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,mFAAmF1sC,MACzF,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,iBACN7zC,EAAGy3C,EACH3D,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAG,cACHC,GAAIwD,EACJ17B,EAAG07B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,gGAAgGxsC,MACpG,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,mBACTC,SAAU,iBACVC,QAAS,iBACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MAAO,6BACX,QACI,MAAO,+BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAU5zC,GACd,OAAQ,YAAY+F,KAAK/F,GAAK,MAAQ,MAAQ,IAAMA,GAExD6zC,KAAM,QACN7zC,EAAG,iBACH8zC,GAAI,aACJl8C,EAAG,YACHm8C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJl4B,EAAG,YACHm4B,GAAI,YACJC,EAAG,UACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA9DyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,gGAAgGxsC,MACpG,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,WACL,MACI,WACCzwD,KAAK8vD,QAAU,EAAI,OAA0B,IAAjB9vD,KAAK8vD,QAAgB,IAAM,OACxD,OAGRY,QAAS,WACL,MACI,aACC1wD,KAAK8vD,QAAU,EAAI,OAA0B,IAAjB9vD,KAAK8vD,QAAgB,IAAM,OACxD,OAGRa,SAAU,WACN,MACI,WACC3wD,KAAK8vD,QAAU,EAAI,OAA0B,IAAjB9vD,KAAK8vD,QAAgB,IAAM,OACxD,OAGRc,QAAS,WACL,MACI,WACC5wD,KAAK8vD,QAAU,EAAI,OAA0B,IAAjB9vD,KAAK8vD,QAAgB,IAAM,OACxD,OAGRe,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MACI,uBACCrzD,KAAK8vD,QAAU,EACV,OACiB,IAAjB9vD,KAAK8vD,QACL,IACA,OACN,MAER,QACI,MACI,uBACC9vD,KAAK8vD,QAAU,EACV,OACiB,IAAjB9vD,KAAK8vD,QACL,IACA,OACN,QAIhBgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN7zC,EAAG,iBACH8zC,GAAI,aACJl8C,EAAG,YACHm8C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJl4B,EAAG,YACHm4B,GAAI,YACJiC,EAAG,gBACHC,GAAI,eACJjC,EAAG,UACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB9xD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BgH,KAAM,CACF,CACIC,MAAO,aACPC,OAAQ,EACR/wD,KAAM,KACNgxD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR/wD,KAAM,KACNgxD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR/wD,KAAM,KACNgxD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR/wD,KAAM,KACNgxD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR/wD,KAAM,KACNgxD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR/wD,KAAM,KACNgxD,OAAQ,KACRC,KAAM,MAEV,CACIH,MAAO,aACPI,OAAO,IACPH,OAAQ,EACR/wD,KAAM,MACNgxD,OAAQ,KACRC,KAAM,OAGdE,oBAAqB,WACrBC,oBAAqB,SAAUhkD,EAAOoJ,GAClC,MAAoB,MAAbA,EAAM,GAAa,EAAIqN,SAASrN,EAAM,IAAMpJ,EAAO,KAE9D08C,OAAQ,yCAAyCxsC,MAAM,KACvDysC,YAAa,yCAAyCzsC,MAClD,KAEJ0sC,SAAU,8BAA8B1sC,MAAM,KAC9C2sC,cAAe,gBAAgB3sC,MAAM,KACrC4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBACN99B,EAAG,aACHqiC,GAAI,YACJC,IAAK,kBACLC,KAAM,wBAEVrF,cAAe,SACfC,KAAM,SAAUh9C,GACZ,MAAiB,OAAVA,GAEXi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,SAAUkG,GAChB,OAAIA,EAAI/E,SAAW9xD,KAAK8xD,OACb,cAEA,WAGflB,QAAS,UACTC,SAAU,SAAUgG,GAChB,OAAI72D,KAAK8xD,SAAW+E,EAAI/E,OACb,cAEA,WAGfhB,SAAU,KAEda,uBAAwB,WACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACD,OAAkB,IAAXzB,EAAe,KAAOA,EAAS,IAC1C,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN7zC,EAAG,KACH8zC,GAAI,MACJl8C,EAAG,KACHm8C,GAAI,MACJC,EAAG,MACHC,GAAI,OACJl4B,EAAG,KACHm4B,GAAI,MACJC,EAAG,MACHC,GAAI,OACJC,EAAG,KACHC,GAAI,SAlJ0BxxD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFxsC,MAC7F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,+CAA+C1sC,MAAM,KAC/D2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,6BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,SACAA,EAAQ,GACR,SACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,2BACTC,QAAS,sBACTC,SAAU,kBACVC,QAAS,wBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,uBACN7zC,EAAG,kBACH8zC,GAAI,WACJl8C,EAAG,kBACHm8C,GAAI,WACJC,EAAG,gBACHC,GAAI,SACJl4B,EAAG,WACHm4B,GAAI,YACJC,EAAG,UACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qGAAqGxsC,MACzG,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,CACN2D,WAAY,gEAAgErwC,MACxE,KAEJ8E,OAAQ,iEAAiE9E,MACrE,KAEJswC,SAAU,iBAEd3D,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTE,QAAS,kBACTD,SAAU,wBACVE,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAU5zC,GACd,OAAOA,EAAErI,QAAQ,iCAAiC,SAC9C+hD,EACA7vC,EACA8vC,GAEA,MAAc,MAAPA,EAAa9vC,EAAK,KAAOA,EAAK8vC,EAAK,SAGlD9F,KAAM,SAAU7zC,GACZ,MAAI,4BAA4B+F,KAAK/F,GAC1BA,EAAErI,QAAQ,SAAU,UAE3B,OAAOoO,KAAK/F,GACLA,EAAErI,QAAQ,QAAS,YAEvBqI,GAEXA,EAAG,iBACH8zC,GAAI,UACJl8C,EAAG,OACHm8C,GAAI,UACJC,EAAG,QACHC,GAAI,WACJl4B,EAAG,MACHm4B,GAAI,SACJC,EAAG,MACHC,GAAI,SACJC,EAAG,OACHC,GAAI,WAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,OAAe,IAAXA,EACOA,EAEI,IAAXA,EACOA,EAAS,MAGhBA,EAAS,IACRA,GAAU,KAAOA,EAAS,IAAO,GAClCA,EAAS,KAAQ,EAEV,MAAQA,EAEZA,EAAS,MAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIoS,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGApS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,0DAA0D1sC,MAChE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTC,SAAU,kBACVC,QAAS,kBACTC,SAAU,kCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN7zC,EAAG,iBACH8zC,GAAI,YACJl8C,EAAG,YACHm8C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAhFyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yEAAyExsC,MAC7E,KAEJysC,YAAa,yEAAyEzsC,MAClF,KAEJ0sC,SAAU,iDAAiD1sC,MAAM,KACjE2sC,cAAe,oBAAoB3sC,MAAM,KACzC4sC,YAAa,oBAAoB5sC,MAAM,KACvC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,cACfC,KAAM,SAAUh9C,GACZ,MAAiB,UAAVA,GAEXi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,QAEA,SAGfjC,SAAU,CACNC,QAAS,oBACTC,QAAS,kBACTC,SAAU,iBACVC,QAAS,qBACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN7zC,EAAG,iBACH8zC,GAAI,YACJl8C,EAAG,UACHm8C,GAAI,UACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,UACJC,EAAG,QACHC,GAAI,QACJC,EAAG,WACHC,GAAI,YAERC,uBAAwB,YACxBC,QAAS,OACTiB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAGzB81C,KAAM,CACFC,IAAK,EACLC,IAAK,KApGyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FxsC,MACjG,KAEJysC,YAAa,2EAA2EzsC,MACpF,KAEJ+wC,kBAAkB,EAClBrE,SAAU,0DAA0D1sC,MAChE,KAEJ2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,wBAAwB5sC,MAAM,KAC3CmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,YACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN7zC,EAAG,gBACH8zC,GAAI,gBACJl8C,EAAG,aACHm8C,GAAI,WACJC,EAAG,YACHC,GAAI,UACJl4B,EAAG,WACHm4B,GAAI,SACJC,EAAG,cACHC,GAAI,YACJC,EAAG,YACHC,GAAI,WAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAGzB2zC,cAAe,gCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,aAAb5C,EACA4C,EACa,aAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,OAEA,UAGfd,uBAAwB,eACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,OAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzHyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yCAAyCxsC,MAAM,KACvDysC,YAAa,yCAAyCzsC,MAClD,KAEJ0sC,SAAU,8BAA8B1sC,MAAM,KAC9C2sC,cAAe,gBAAgB3sC,MAAM,KACrC4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,uBACLC,KAAM,4BACN99B,EAAG,cACHqiC,GAAI,gBACJC,IAAK,uBACLC,KAAM,6BAEVxE,SAAU,CACNC,QAAS,QACTC,QAAS,QACTC,SAAU,UACVC,QAAS,QACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,OACN7zC,EAAG,MACH8zC,GAAI,MACJl8C,EAAG,KACHm8C,GAAI,MACJC,EAAG,OACHC,GAAI,OACJl4B,EAAG,KACHm4B,GAAI,MACJC,EAAG,MACHC,GAAI,MACJC,EAAG,MACHC,GAAI,OAERC,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBlC,cAAe,QACfC,KAAM,SAAUruC,GACZ,MAAiB,OAAVA,GAEXsuC,SAAU,SAAU4C,EAAMC,EAAQsE,GAC9B,OAAOvE,EAAO,GAAK,KAAO,QAxEIvyD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETxD,EAAS,CACL,eACA,QACA,QACA,QACA,QACA,WACA,SACA,MACA,UACA,eACA,eACA,gBAGC3O,EAAO0O,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAU,0EAA0E1sC,MAChF,KAEJ2sC,cAAe,2DAA2D3sC,MACtE,KAEJ4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,kBACfC,KAAM,SAAUh9C,GACZ,MAAO,UAAUuQ,KAAKvQ,IAE1Bi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,UAEA,WAGfjC,SAAU,CACNC,QAAS,sBACTC,QAAS,uBACTC,SAAU,oBACVC,QAAS,qBACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,KACN7zC,EAAG,kBACH8zC,GAAI,WACJl8C,EAAG,cACHm8C,GAAI,YACJC,EAAG,eACHC,GAAI,aACJl4B,EAAG,WACHm4B,GAAI,SACJC,EAAG,YACHC,GAAI,UACJC,EAAG,WACHC,GAAI,UAERmB,SAAU,SAAUttD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO82C,EAAU92C,MAEpBjH,QAAQ,KAAM,MAEvB49C,WAAY,SAAUptD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO42C,EAAU52C,MAEpBjH,QAAQ,KAAM,MAEvB+8C,KAAM,CACFC,IAAK,EACLC,IAAK,MApHyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIoS,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGApS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,kFAAkFxsC,MACtF,KAEJysC,YAAa,qDAAqDzsC,MAC9D,KAEJ0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,iBACVC,QAAS,kBACTC,SAAU,wCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN7zC,EAAG,iBACH8zC,GAAI,YACJl8C,EAAG,YACHm8C,GAAI,WACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,wBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlFyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACT5S,EAAG,CAAC,aAAc,gBAClBo8C,EAAG,CAAC,YAAa,eACjBj4B,EAAG,CAAC,UAAW,aACfo4B,EAAG,CAAC,WAAY,eAChBE,EAAG,CAAC,UAAW,eAEnB,OAAOY,EAAgBzqC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAuBxD,SAASoxD,EAA4BpF,GAEjC,GADAA,EAASxoC,SAASwoC,EAAQ,IACtBvoC,MAAMuoC,GACN,OAAO,EAEX,GAAIA,EAAS,EAET,OAAO,EACJ,GAAIA,EAAS,GAEhB,OAAI,GAAKA,GAAUA,GAAU,EAI1B,GAAIA,EAAS,IAAK,CAErB,IAAI4B,EAAY5B,EAAS,GAEzB,OACWoF,EADO,IAAdxD,EADa5B,EAAS,GAIS4B,GAChC,GAAI5B,EAAS,IAAO,CAEvB,KAAOA,GAAU,IACbA,GAAkB,GAEtB,OAAOoF,EAA4BpF,GAInC,OAAOoF,EADPpF,GAAkB,KAKjBlR,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFxsC,MAC3F,KAEJysC,YAAa,+DAA+DzsC,MACxE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,mEAAmE1sC,MACzE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,cACJC,IAAK,iBACLC,EAAG,aACHC,GAAI,eACJC,IAAK,2BACLC,KAAM,kCAEVC,SAAU,CACNC,QAAS,eACTK,SAAU,IACVJ,QAAS,eACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,WAEN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACL,KAAK,EACD,MAAO,0BACX,QACI,MAAO,4BAIvBtC,aAAc,CACVC,OAhGR,SAA2BzrD,GAEvB,OAAI0xD,EADS1xD,EAAOwhB,OAAO,EAAGxhB,EAAO2I,QAAQ,OAElC,KAAO3I,EAEX,MAAQA,GA4FX0rD,KA1FR,SAAyB1rD,GAErB,OAAI0xD,EADS1xD,EAAOwhB,OAAO,EAAGxhB,EAAO2I,QAAQ,OAElC,QAAU3I,EAEd,SAAWA,GAsFd6X,EAAG,kBACH8zC,GAAI,cACJl8C,EAAGmgD,EACHhE,GAAI,cACJC,EAAG+D,EACH9D,GAAI,aACJl4B,EAAGg8B,EACH7D,GAAI,UACJC,EAAG4D,EACH3D,GAAI,WACJC,EAAG0D,EACHzD,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KApIyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,6EAA6ExsC,MACjF,KAEJysC,YAAa,6EAA6EzsC,MACtF,KAEJ0sC,SAAU,sCAAsC1sC,MAAM,KACtD2sC,cAAe,oCAAoC3sC,MAAM,KACzD4sC,YAAa,mBAAmB5sC,MAAM,KACtC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,6BAEVZ,cAAe,kBACfC,KAAM,SAAUh9C,GACZ,MAAiB,WAAVA,GAEXi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,WAEA,UAGfjC,SAAU,CACNC,QAAS,kBACTC,QAAS,mBACTC,SAAU,wBACVC,QAAS,qBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN7zC,EAAG,mBACH8zC,GAAI,YACJl8C,EAAG,SACHm8C,GAAI,UACJC,EAAG,YACHC,GAAI,aACJl4B,EAAG,QACHm4B,GAAI,SACJC,EAAG,UACHC,GAAI,WACJC,EAAG,OACHC,GAAI,SAERC,uBAAwB,eACxBC,QAAS,SAAUC,GACf,MAAO,MAAQA,KA/De3xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIuW,EAAQ,CACRhG,GAAI,6BACJl8C,EAAG,wBACHm8C,GAAI,0BACJC,EAAG,2BACHC,GAAI,4BACJl4B,EAAG,qBACHm4B,GAAI,sBACJC,EAAG,uBACHC,GAAI,4BACJC,EAAG,mBACHC,GAAI,oBASR,SAASyF,EAAkBtF,EAAQQ,EAAexsD,EAAKysD,GACnD,OAAOD,EACDa,EAAMrtD,GAAK,GACXysD,EACAY,EAAMrtD,GAAK,GACXqtD,EAAMrtD,GAAK,GAErB,SAASuxD,EAAQvF,GACb,OAAOA,EAAS,IAAO,GAAMA,EAAS,IAAMA,EAAS,GAEzD,SAASqB,EAAMrtD,GACX,OAAOqxD,EAAMrxD,GAAKid,MAAM,KAE5B,SAAS+xC,EAAUhD,EAAQQ,EAAexsD,EAAKysD,GAC3C,IAAIhsD,EAASurD,EAAS,IACtB,OAAe,IAAXA,EAEIvrD,EAAS6wD,EAAkBtF,EAAQQ,EAAexsD,EAAI,GAAIysD,GAEvDD,EACA/rD,GAAU8wD,EAAQvF,GAAUqB,EAAMrtD,GAAK,GAAKqtD,EAAMrtD,GAAK,IAE1DysD,EACOhsD,EAAS4sD,EAAMrtD,GAAK,GAEpBS,GAAU8wD,EAAQvF,GAAUqB,EAAMrtD,GAAK,GAAKqtD,EAAMrtD,GAAK,IAIjE86C,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ1nC,OAAQ,oGAAoG9E,MACxG,KAEJqwC,WAAY,kGAAkGrwC,MAC1G,KAEJswC,SAAU,+DAEd7D,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,CACN5nC,OAAQ,oFAAoF9E,MACxF,KAEJqwC,WAAY,2FAA2FrwC,MACnG,KAEJswC,SAAU,cAEd3D,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,iBAAiB5sC,MAAM,KACpC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,sCACLC,KAAM,4CACN99B,EAAG,aACHqiC,GAAI,wBACJC,IAAK,sCACLC,KAAM,4CAEVxE,SAAU,CACNC,QAAS,gBACTC,QAAS,aACTC,SAAU,UACVC,QAAS,aACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAlFR,SAA0By0C,EAAQQ,EAAexsD,EAAKysD,GAClD,OAAID,EACO,kBAEAC,EAAW,kBAAoB,mBA+EtCpB,GAAI2D,EACJ7/C,EAAGmiD,EACHhG,GAAI0D,EACJzD,EAAG+F,EACH9F,GAAIwD,EACJ17B,EAAGg+B,EACH7F,GAAIuD,EACJtD,EAAG4F,EACH3F,GAAIqD,EACJpD,EAAG0F,EACHzF,GAAImD,GAERlD,uBAAwB,cACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,QAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzHyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,IAAIuW,EAAQ,CACRhG,GAAI,qCAAqCpuC,MAAM,KAC/C9N,EAAG,iCAAiC8N,MAAM,KAC1CquC,GAAI,iCAAiCruC,MAAM,KAC3CsuC,EAAG,iCAAiCtuC,MAAM,KAC1CuuC,GAAI,iCAAiCvuC,MAAM,KAC3CqW,EAAG,6BAA6BrW,MAAM,KACtCwuC,GAAI,6BAA6BxuC,MAAM,KACvCyuC,EAAG,iCAAiCzuC,MAAM,KAC1C0uC,GAAI,iCAAiC1uC,MAAM,KAC3C2uC,EAAG,wBAAwB3uC,MAAM,KACjC4uC,GAAI,wBAAwB5uC,MAAM,MAKtC,SAAS8E,EAAOsrC,EAAOrB,EAAQQ,GAC3B,OAAIA,EAEOR,EAAS,IAAO,GAAKA,EAAS,KAAQ,GAAKqB,EAAM,GAAKA,EAAM,GAI5DrB,EAAS,IAAO,GAAKA,EAAS,KAAQ,GAAKqB,EAAM,GAAKA,EAAM,GAG3E,SAASF,EAAuBnB,EAAQQ,EAAexsD,GACnD,OAAOgsD,EAAS,IAAMjqC,EAAOsvC,EAAMrxD,GAAMgsD,EAAQQ,GAErD,SAASgF,EAAyBxF,EAAQQ,EAAexsD,GACrD,OAAO+hB,EAAOsvC,EAAMrxD,GAAMgsD,EAAQQ,GAM7B1R,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,uGAAuGxsC,MAC3G,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,0EAA0E1sC,MAChF,KAEJ2sC,cAAe,kBAAkB3sC,MAAM,KACvC4sC,YAAa,kBAAkB5sC,MAAM,KACrC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,cACHC,GAAI,uBACJC,IAAK,8BACLC,KAAM,qCAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,oBACTC,SAAU,qBACVC,QAAS,sBACTC,SAAU,gCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN7zC,EAlCR,SAAyBy0C,EAAQQ,GAC7B,OAAOA,EAAgB,iBAAmB,kBAkCtCnB,GAAI8B,EACJh+C,EAAGqiD,EACHlG,GAAI6B,EACJ5B,EAAGiG,EACHhG,GAAI2B,EACJ75B,EAAGk+B,EACH/F,GAAI0B,EACJzB,EAAG8F,EACH7F,GAAIwB,EACJvB,EAAG4F,EACH3F,GAAIsB,GAERrB,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIzB,IAAI2W,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,SAAU,UAAW,WAC1Bl8C,EAAG,CAAC,cAAe,iBACnBm8C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,SAAU,UAAW,WAC1BE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAexsD,GACxC,IAAI4xD,EAAUH,EAAWC,MAAM1xD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACGijD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAMjD9W,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,mFAAmFxsC,MACvF,KAEJysC,YAAa,2DAA2DzsC,MACpE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,4DAA4D1sC,MAClE,KAEJ2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,gBAETC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,6BACA,iCACA,4BACA,4BACA,8BACA,2BACA,4BAEgB7wD,KAAKqzD,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,mBACH8zC,GAAIoG,EAAWzC,UACf7/C,EAAGsiD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACf17B,EAAG,MACHm4B,GAAIgG,EAAWzC,UACftD,EAAG,SACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KApHyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,8IAA8IxsC,MAClJ,KAEJysC,YAAa,iEAAiEzsC,MAC1E,KAEJsxC,YAAa,yCACbK,kBAAmB,yCACnBb,iBAAkB,yCAClBc,uBAAwB,yCACxBlF,SAAU,kDAAkD1sC,MAAM,KAClE2sC,cAAe,wBAAwB3sC,MAAM,KAC7C4sC,YAAa,wBAAwB5sC,MAAM,KAC3CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,eACTC,SAAU,cACVC,QAAS,iBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,cACRC,KAAM,WACN7zC,EAAG,mBACH8zC,GAAI,YACJl8C,EAAG,YACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,QACJC,EAAG,YACHC,GAAI,YACJC,EAAG,SACHC,GAAI,UAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFxsC,MAC3F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,YACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,eACTC,SAAU,oBACVC,QAAS,gBACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,4BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,8BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,kBACH8zC,GAAI,aACJl8C,EAAG,cACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,WACHm4B,GAAI,UACJC,EAAG,aACHC,GAAI,YACJC,EAAG,cACHC,GAAI,aAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,IAAI4B,EAAY5B,EAAS,GACrB6B,EAAc7B,EAAS,IAC3B,OAAe,IAAXA,EACOA,EAAS,MACO,IAAhB6B,EACA7B,EAAS,MACT6B,EAAc,IAAMA,EAAc,GAClC7B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,GAAiC,IAAdA,EACnB5B,EAAS,MAETA,EAAS,OAGxBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnFyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFxsC,MAC7F,KAEJysC,YAAa,yEAAyEzsC,MAClF,KAEJ+wC,kBAAkB,EAClBrE,SAAU,wEAAwE1sC,MAC9E,KAEJ2sC,cAAe,2CAA2C3sC,MAAM,KAChE4sC,YAAa,wBAAwB5sC,MAAM,KAC3CmtC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,aACRC,KAAM,WACN7zC,EAAG,gBACH8zC,GAAI,cACJl8C,EAAG,eACHm8C,GAAI,cACJC,EAAG,eACHC,GAAI,cACJl4B,EAAG,YACHm4B,GAAI,WACJC,EAAG,WACHC,GAAI,UACJC,EAAG,WACHC,GAAI,WAER/B,cAAe,gDACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,WAAb5C,GAAyB4C,GAAQ,GACrB,iBAAb5C,GACa,eAAbA,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,SACAA,EAAO,GACP,eACAA,EAAO,GACP,aAEA,YA7EmBvyD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,SAASkU,EAAUhD,EAAQQ,EAAexsD,EAAKysD,GAC3C,OAAQzsD,GACJ,IAAK,IACD,OAAOwsD,EAAgB,gBAAkB,kBAC7C,IAAK,KACD,OAAOR,GAAUQ,EAAgB,UAAY,aACjD,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,SAAW,YAChD,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,WAC9C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,QAAU,WAC/C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,UAC9C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,WAC9C,QACI,OAAOR,GAIVlR,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,+LAA+LxsC,MACnM,KAEJysC,YAAa,6EAA6EzsC,MACtF,KAEJ+wC,kBAAkB,EAClBrE,SAAU,6CAA6C1sC,MAAM,KAC7D2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,0BACLC,KAAM,iCAEVZ,cAAe,SACfC,KAAM,SAAUh9C,GACZ,MAAiB,OAAVA,GAEXi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,iBACVC,QAAS,eACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,UACN7zC,EAAGy3C,EACH3D,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG07B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,QACpB,QACI,OAAOA,MAhGe3xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGb,SAAS4E,EAAe7F,EAAQQ,EAAe9sD,EAAQ+sD,GACnD,IAAI2C,EAAS,GACb,GAAI5C,EACA,OAAQ9sD,GACJ,IAAK,IACD0vD,EAAS,aACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,YACT,MACJ,IAAK,IACDA,EAAS,SACT,MACJ,IAAK,KACDA,EAAS,SACT,MACJ,IAAK,IACDA,EAAS,UACT,MACJ,IAAK,KACDA,EAAS,UACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,UACT,MACJ,IAAK,KACDA,EAAS,gBAIjB,OAAQ1vD,GACJ,IAAK,IACD0vD,EAAS,eACT,MACJ,IAAK,KACDA,EAAS,aACT,MACJ,IAAK,IACDA,EAAS,aACT,MACJ,IAAK,KACDA,EAAS,aACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,YACT,MACJ,IAAK,KACDA,EAAS,YACT,MACJ,IAAK,IACDA,EAAS,cACT,MACJ,IAAK,KACDA,EAAS,cACT,MACJ,IAAK,IACDA,EAAS,YACT,MACJ,IAAK,KACDA,EAAS,YAIrB,OAAOA,EAAOlgD,QAAQ,MAAO88C,GAGxBlR,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,gFAAgFzsC,MACzF,KAEJ+wC,kBAAkB,EAClBrE,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,kCAAkC3sC,MAAM,KACvD4sC,YAAa,qBAAqB5sC,MAAM,KACxCmtC,eAAgB,CACZC,GAAI,eACJC,IAAK,kBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,aACTC,SAAU,WACVC,QAAS,WACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN7zC,EAAGs6C,EACHxG,GAAIwG,EACJ1iD,EAAG0iD,EACHvG,GAAIuG,EACJtG,EAAGsG,EACHrG,GAAIqG,EACJv+B,EAAGu+B,EACHpG,GAAIoG,EACJnG,EAAGmG,EACHlG,GAAIkG,EACJjG,EAAGiG,EACHhG,GAAIgG,GAER7E,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAGzB2zC,cAAe,qCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,UAAb5C,GAAqC,UAAbA,EACjB4C,EAEM,WAAb5C,GACa,aAAbA,GACa,WAAbA,EAEO4C,GAAQ,GAAKA,EAAOA,EAAO,QAL/B,GAQX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,GAAQ,GAAKA,EAAO,EACb,QACAA,EAAO,GACP,QACAA,EAAO,GACP,SACAA,EAAO,GACP,WAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvMyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,oFAAoFxsC,MACxF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,6CAA6C1sC,MAAM,KAC7D2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,8BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,YACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,kBACTC,SAAU,kBACVC,QAAS,sBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,gBACN7zC,EAAG,gBACH8zC,GAAI,UACJl8C,EAAG,UACHm8C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJl4B,EAAG,SACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFxsC,MACxF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,6CAA6C1sC,MAAM,KAC7D2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,8BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,YACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,kBACTC,SAAU,kBACVC,QAAS,sBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,gBACN7zC,EAAG,gBACH8zC,GAAI,UACJl8C,EAAG,UACHm8C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJl4B,EAAG,SACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,iEAAiE1sC,MACvE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTC,SAAU,gBACVC,QAAS,qBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,eACH8zC,GAAI,aACJl8C,EAAG,SACHm8C,GAAI,YACJC,EAAG,SACHC,GAAI,aACJl4B,EAAG,UACHm4B,GAAI,YACJC,EAAG,QACHC,GAAI,UACJC,EAAG,OACHC,GAAI,UAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KArDyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FxsC,MAC/F,KAEJysC,YAAa,mDAAmDzsC,MAAM,KACtE0sC,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,2BAA2B3sC,MAAM,KAChD4sC,YAAa,2BAA2B5sC,MAAM,KAE9CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,mBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,kBACN7zC,EAAG,kBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,OACHC,GAAI,OACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAGzB81C,KAAM,CACFC,IAAK,EACLC,IAAK,KAvFyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,6DAA6DzsC,MACtE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,qDAAqD1sC,MAAM,KACrE2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,2BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,gBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,cACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,WACJiC,EAAG,SACHC,GAAI,UACJjC,EAAG,WACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB9xD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFxsC,MAC3F,KAEJysC,YAAa,uEAAuEzsC,MAChF,KAEJ+wC,kBAAkB,EAClBrE,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,0CAA0C3sC,MAAM,KAC/D4sC,YAAa,4BAA4B5sC,MAAM,KAC/C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,eACJC,IAAK,kBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVsC,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAGzB2zC,cAAe,yBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,UAAb5C,EACA4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,SACAA,EAAO,GACP,OAEA,QAGfjC,SAAU,CACNC,QAAS,UACTC,QAAS,YACTC,SAAU,qBACVC,QAAS,YACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,WACN7zC,EAAG,YACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAtHyB9xD,CAAQ,EAAQ,8FCIlD,SAAWygD,GAAU,aAIzB,IAAIuV,EAAsB,6DAA6DpzC,MAC/E,KAEJqzC,EAAyB,kDAAkDrzC,MACvE,KAEJqxC,EAAc,CACV,QACA,QACA,iBACA,QACA,SACA,cACA,cACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,qKAEPzT,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,SAAUv6C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbuuC,EAAuBnhD,EAAEwgD,SAEzBU,EAAoBlhD,EAAEwgD,SAJtBU,GAQf9B,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,4FACnBC,uBAAwB,mFAExBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElB3E,SAAU,6DAA6D1sC,MACnE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,SACJl4B,EAAG,UACHm4B,GAAI,WACJC,EAAG,YACHC,GAAI,aACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnGyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIuV,EAAsB,6DAA6DpzC,MAC/E,KAEJqzC,EAAyB,kDAAkDrzC,MACvE,KAEJqxC,EAAc,CACV,QACA,QACA,iBACA,QACA,SACA,cACA,cACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,qKAETzT,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,SAAUv6C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbuuC,EAAuBnhD,EAAEwgD,SAEzBU,EAAoBlhD,EAAEwgD,SAJtBU,GAQf9B,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,4FACnBC,uBAAwB,mFAExBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElB3E,SAAU,6DAA6D1sC,MACnE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,SACJl4B,EAAG,UACHm4B,GAAI,WACJiC,EAAG,WACHC,GAAI,WACJjC,EAAG,YACHC,GAAI,aACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KArGyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,6DAA6DzsC,MACtE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,qDAAqD1sC,MAAM,KACrE2sC,cAAe,+BAA+B3sC,MAAM,KACpD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,uBACTC,SAAU,mBACVC,QAAS,oBACTC,SAAU,gCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,eACH8zC,GAAI,YACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,UACHm4B,GAAI,WACJiC,EAAG,UACHC,GAAI,WACJjC,EAAG,YACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB9xD,CAAQ,EAAQ,+FCElD,SAAWygD,GAAU,aAIbA,EAAO0O,aAAa,SAAU,CACtCC,OAAQ,CACJ6D,WAAY,qFAAqFrwC,MAC7F,KAEJ8E,OAAQ,sHAAsH9E,MAC1H,KAEJswC,SAAU,mBAEd7D,YAAa,+DAA+DzsC,MACxE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,mBACJyE,GAAI,aACJxE,IAAK,4BACLyE,IAAK,mBACLxE,KAAM,iCACNyE,KAAM,wBAEVxE,SAAU,CACNC,QAAS,aACTC,QAAS,eACTC,SAAU,cACVC,QAAS,aACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,QACN7zC,EAAG,gBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,WACJC,EAAG,SACHC,GAAI,WACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,qBACxBC,QAAS,SAAUC,EAAQyB,GACvB,IAAI2B,EACW,IAAXpD,EACM,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACA,IAIV,MAHe,MAAXyB,GAA6B,MAAXA,IAClB2B,EAAS,KAENpD,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KAjFyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGFnS,EAAO0O,aAAa,QAAS,CAEpCC,OAAQ,sEAAsExsC,MAC1E,KAEJysC,YAAa,sEAAsEzsC,MAC/E,KAEJ0sC,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,iCAAiC3sC,MAAM,KACtD4sC,YAAa,iCAAiC5sC,MAAM,KACpDmtC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,kBACVC,QAAS,UACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN7zC,EAAG,YACH8zC,GAAI,WACJl8C,EAAG,UACHm8C,GAAI,UACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,YACHC,GAAI,WACJC,EAAG,UACHC,GAAI,UAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAKzB2zC,cAAe,uBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,SACAA,EAAO,GACP,OAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIgX,EAAmB,mGAAmG70C,MAClH,KAEJ80C,EAAmB,qGAAqG90C,MACpH,KAEJqxC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAER,SAASe,EAAO30C,GACZ,OAAOA,EAAI,GAAK,GAAKA,EAAI,GAAK,MAAQA,EAAI,IAAM,IAAO,EAE3D,SAASs0C,EAAUhD,EAAQQ,EAAexsD,GACtC,IAAIS,EAASurD,EAAS,IACtB,OAAQhsD,GACJ,IAAK,KACD,OAAOS,GAAU4uD,EAAOrD,GAAU,UAAY,UAClD,IAAK,IACD,OAAOQ,EAAgB,SAAW,SACtC,IAAK,KACD,OAAO/rD,GAAU4uD,EAAOrD,GAAU,SAAW,SACjD,IAAK,IACD,OAAOQ,EAAgB,UAAY,UACvC,IAAK,KACD,OAAO/rD,GAAU4uD,EAAOrD,GAAU,UAAY,UAClD,IAAK,KACD,OAAOvrD,GAAU4uD,EAAOrD,GAAU,WAAa,WACnD,IAAK,KACD,OAAOvrD,GAAU4uD,EAAOrD,GAAU,WAAa,YACnD,IAAK,KACD,OAAOvrD,GAAU4uD,EAAOrD,GAAU,OAAS,QAI9ClR,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,SAAUgG,EAAgB1tC,GAC9B,OAAK0tC,EAEM,SAASnyC,KAAKyE,GACdgwC,EAAiBtC,EAAeE,SAEhCmC,EAAiBrC,EAAeE,SAJhCmC,GAOfpI,YAAa,kDAAkDzsC,MAAM,KACrEqxC,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,6DAA6D1sC,MACnE,KAEJ2sC,cAAe,2BAA2B3sC,MAAM,KAChD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,eACTC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,qBAEX,KAAK,EACD,MAAO,mBAEX,KAAK,EACD,MAAO,iBAEX,KAAK,EACD,MAAO,kBAEX,QACI,MAAO,oBAGnBzC,QAAS,iBACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MAAO,4BACX,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,yBACX,QACI,MAAO,2BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,eACH8zC,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG,UACHm4B,GAAI,SACJiC,EAAG,UACHC,GAAIqB,EACJtD,EAAG,UACHC,GAAIqD,EACJpD,EAAG,MACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,2FAA2FxsC,MAC/F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,iFAAiF1sC,MACvF,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,mCACLC,KAAM,0CAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,WACN,OAAsB,IAAf7wD,KAAKqzD,OAA8B,IAAfrzD,KAAKqzD,MAC1B,wBACA,yBAEVvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN7zC,EAAG,kBACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTkE,YAAa,kBAxDqB51D,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FxsC,MAC/F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,iFAAiF1sC,MACvF,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,8BACLC,KAAM,qCAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,WACN,OAAsB,IAAf7wD,KAAKqzD,OAA8B,IAAfrzD,KAAKqzD,MAC1B,wBACA,yBAEVvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN7zC,EAAG,WACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA5DyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAIzB,SAASqS,EAAuBnB,EAAQQ,EAAexsD,GACnD,IASIgyD,EAAY,IAIhB,OAHIhG,EAAS,KAAO,IAAOA,GAAU,KAAOA,EAAS,KAAQ,KACzDgG,EAAY,QAEThG,EAASgG,EAbH,CACL3G,GAAI,UACJC,GAAI,SACJE,GAAI,MACJC,GAAI,OACJkC,GAAI,YACJhC,GAAI,OACJE,GAAI,OAMuB7rD,GAG9B86C,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGxsC,MACxG,KAEJysC,YAAa,+DAA+DzsC,MACxE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,kDAAkD1sC,MAAM,KAClE2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,aACN7zC,EAAG,iBACH8zC,GAAI8B,EACJh+C,EAAG,WACHm8C,GAAI6B,EACJ5B,EAAG,QACHC,GAAI2B,EACJ75B,EAAG,OACHm4B,GAAI0B,EACJO,EAAG,cACHC,GAAIR,EACJzB,EAAG,SACHC,GAAIwB,EACJvB,EAAG,QACHC,GAAIsB,GAERlB,KAAM,CACFC,IAAK,EACLC,IAAK,KAvEyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAYzB,SAASqS,EAAuBnB,EAAQQ,EAAexsD,GAUnD,MAAY,MAARA,EACOwsD,EAAgB,SAAW,SAE3BR,EAAS,KArBFoB,GAqB6BpB,EApB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,sBAAwB,sBAC5ChB,GAAI,iBACJC,GAAI,gBACJkC,GAAI,uBACJhC,GAAI,uBACJE,GAAI,gBAKgC7rD,GApBvBid,MAAM,KAChBmwC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAuBR,IAAIiB,EAAc,CACd,QACA,QACA,QACA,QACA,WACA,QACA,QACA,QACA,QACA,QACA,QACA,SAMKxT,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ1nC,OAAQ,oFAAoF9E,MACxF,KAEJqwC,WAAY,kFAAkFrwC,MAC1F,MAGRysC,YAAa,CAET3nC,OAAQ,gEAAgE9E,MACpE,KAEJqwC,WAAY,gEAAgErwC,MACxE,MAGR0sC,SAAU,CACN2D,WAAY,gEAAgErwC,MACxE,KAEJ8E,OAAQ,gEAAgE9E,MACpE,KAEJswC,SAAU,iDAEd3D,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1CqxC,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAGlBC,YAAa,2MAGbR,iBAAkB,2MAGlBa,kBAAmB,wHAGnBC,uBAAwB,6FACxBzE,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,uBACLC,KAAM,8BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTE,QAAS,gBACTD,SAAU,SAAUkG,GAChB,GAAIA,EAAI/E,SAAW9xD,KAAK8xD,OAcpB,OAAmB,IAAf9xD,KAAKqzD,MACE,oBAEA,mBAhBX,OAAQrzD,KAAKqzD,OACT,KAAK,EACD,MAAO,6BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,6BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,+BAUvBxC,SAAU,SAAUgG,GAChB,GAAIA,EAAI/E,SAAW9xD,KAAK8xD,OAcpB,OAAmB,IAAf9xD,KAAKqzD,MACE,oBAEA,mBAhBX,OAAQrzD,KAAKqzD,OACT,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,6BAUvBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN7zC,EAAG,mBACH8zC,GAAI8B,EACJh+C,EAAGg+C,EACH7B,GAAI6B,EACJ5B,EAAG,MACHC,GAAI2B,EACJ75B,EAAG,OACHm4B,GAAI0B,EACJO,EAAG,SACHC,GAAIR,EACJzB,EAAG,QACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAERrD,cAAe,wBACfC,KAAM,SAAUh9C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjCi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,OACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,mBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,KACpB,IAAK,IACD,OAAOA,EAAS,MACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,KACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1MyB9xD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIzB,IAAI2O,EAAS,CACL,QACA,UACA,OACA,QACA,MACA,MACA,SACA,OACA,UACA,SACA,QACA,SAEJwI,EAAO,CAAC,MAAO,OAAQ,QAAS,OAAQ,OAAQ,MAAO,QAElDnX,EAAO0O,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUsI,EACVrI,cAAeqI,EACfpI,YAAaoI,EACb7H,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,UACfC,KAAM,SAAUh9C,GACZ,MAAO,QAAUA,GAErBi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,MAEJ,OAEXjC,SAAU,CACNC,QAAS,UACTC,QAAS,aACTC,SAAU,yBACVC,QAAS,aACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN7zC,EAAG,YACH8zC,GAAI,WACJl8C,EAAG,SACHm8C,GAAI,SACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,WACHm4B,GAAI,WACJC,EAAG,WACHC,GAAI,WACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC49C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC+8C,KAAM,CACFC,IAAK,EACLC,IAAK,KA/EyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,mJAAmJxsC,MACvJ,KAEJysC,YAAa,6DAA6DzsC,MACtE,KAEJ0sC,SAAU,6EAA6E1sC,MACnF,KAEJ2sC,cAAe,mCAAmC3sC,MAAM,KACxD4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,gCACLC,KAAM,uCAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN7zC,EAAG,mBACH8zC,GAAI,eACJl8C,EAAG,eACHm8C,GAAI,cACJC,EAAG,cACHC,GAAI,aACJl4B,EAAG,cACHm4B,GAAI,cACJC,EAAG,aACHC,GAAI,WACJC,EAAG,aACHC,GAAI,YAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAKhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,kGAAkGxsC,MACtG,KAEJysC,YAAa,wDAAwDzsC,MACjE,KAEJ0sC,SAAU,gEAAgE1sC,MACtE,KAEJ2sC,cAAe,gCAAgC3sC,MAAM,KACrD4sC,YAAa,qBAAqB5sC,MAAM,KACxC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,cACTC,SAAU,aACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN7zC,EAAG,eACH8zC,GAAI,WACJl8C,EAAG,YACHm8C,GAAI,cACJC,EAAG,MACHC,GAAI,SACJl4B,EAAG,OACHm4B,GAAI,SACJC,EAAG,OACHC,GAAI,SACJC,EAAG,MACHC,GAAI,UAERC,uBAAwB,eACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,SAEpBlC,cAAe,4BACfC,KAAM,SAAUh9C,GACZ,MAAiB,SAAVA,GAA8B,YAAVA,GAE/Bi9C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,OAAS,UAEnBA,EAAU,QAAU,aAjED9vD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,IAAI2O,EAAS,oFAAoFxsC,MACzF,KAEJysC,EAAc,kDAAkDzsC,MAAM,KAC1E,SAASoyC,EAAO30C,GACZ,OAAOA,EAAI,GAAKA,EAAI,EAExB,SAASs0C,EAAUhD,EAAQQ,EAAexsD,EAAKysD,GAC3C,IAAIhsD,EAASurD,EAAS,IACtB,OAAQhsD,GACJ,IAAK,IACD,OAAOwsD,GAAiBC,EAAW,aAAe,gBACtD,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,UAAY,UAEvCvrD,EAAS,YAExB,IAAK,IACD,OAAO+rD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,SAAW,SAEtCvrD,EAAS,WAExB,IAAK,IACD,OAAO+rD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,SAAW,SAEtCvrD,EAAS,WAExB,IAAK,IACD,OAAO+rD,GAAiBC,EAAW,MAAQ,OAC/C,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,MAAQ,OAEnCvrD,EAAS,QAExB,IAAK,IACD,OAAO+rD,GAAiBC,EAAW,SAAW,WAClD,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,UAAY,YAEvCvrD,EAAS,WAExB,IAAK,IACD,OAAO+rD,GAAiBC,EAAW,MAAQ,QAC/C,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,OAAS,SAEpCvrD,EAAS,SAKvBq6C,EAAO0O,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaA,EACbC,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,kBACX,KAAK,EACL,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,oBACX,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAGy3C,EACH3D,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG07B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7IyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAIhsD,EAASurD,EAAS,IACtB,OAAQhsD,GACJ,IAAK,IACD,OAAOwsD,GAAiBC,EAClB,eACA,kBACV,IAAK,KAUD,OARIhsD,GADW,IAAXurD,EACUQ,EAAgB,UAAY,UACpB,IAAXR,EACGQ,GAAiBC,EAAW,UAAY,WAC3CT,EAAS,EACNQ,GAAiBC,EAAW,UAAY,WAExC,UAGlB,IAAK,IACD,OAAOD,EAAgB,aAAe,aAC1C,IAAK,KAUD,OARI/rD,GADW,IAAXurD,EACUQ,EAAgB,SAAW,SACnB,IAAXR,EACGQ,GAAiBC,EAAW,SAAW,WAC1CT,EAAS,EACNQ,GAAiBC,EAAW,SAAW,WAEvCD,GAAiBC,EAAW,QAAU,YAGxD,IAAK,IACD,OAAOD,EAAgB,UAAY,UACvC,IAAK,KAUD,OARI/rD,GADW,IAAXurD,EACUQ,EAAgB,MAAQ,MAChB,IAAXR,EACGQ,GAAiBC,EAAW,MAAQ,QACvCT,EAAS,EACNQ,GAAiBC,EAAW,MAAQ,QAEpCD,GAAiBC,EAAW,KAAO,SAGrD,IAAK,IACD,OAAOD,GAAiBC,EAAW,SAAW,YAClD,IAAK,KAQD,OANIhsD,GADW,IAAXurD,EACUQ,GAAiBC,EAAW,MAAQ,OAC5B,IAAXT,EACGQ,GAAiBC,EAAW,MAAQ,UAEpCD,GAAiBC,EAAW,MAAQ,SAGtD,IAAK,IACD,OAAOD,GAAiBC,EAAW,WAAa,eACpD,IAAK,KAUD,OARIhsD,GADW,IAAXurD,EACUQ,GAAiBC,EAAW,QAAU,UAC9B,IAAXT,EACGQ,GAAiBC,EAAW,SAAW,WAC1CT,EAAS,EACNQ,GAAiBC,EAAW,SAAW,SAEvCD,GAAiBC,EAAW,UAAY,UAG1D,IAAK,IACD,OAAOD,GAAiBC,EAAW,WAAa,aACpD,IAAK,KAUD,OARIhsD,GADW,IAAXurD,EACUQ,GAAiBC,EAAW,OAAS,QAC7B,IAAXT,EACGQ,GAAiBC,EAAW,OAAS,SACxCT,EAAS,EACNQ,GAAiBC,EAAW,OAAS,OAErCD,GAAiBC,EAAW,MAAQ,SAMrD3R,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,8DAA8DzsC,MACvE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,eACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBAETC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,qBAGnBzC,QAAS,iBACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MAAO,+BACX,KAAK,EACD,MAAO,6BACX,KAAK,EACD,MAAO,8BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,4BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN7zC,EAAG+3C,EACHjE,GAAIiE,EACJngD,EAAGmgD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJh8B,EAAGg8B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxKyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,gFAAgFxsC,MACpF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,4DAA4D1sC,MAClE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,mBAAmB5sC,MAAM,KACtC0vC,oBAAoB,EACpB7C,cAAe,QACfC,KAAM,SAAUh9C,GACZ,MAA2B,MAApBA,EAAMnN,OAAO,IAExBoqD,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAOF,EAAQ,GAAK,KAAO,MAE/BG,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,cACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,aACN7zC,EAAG,eACH8zC,GAAI,aACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,UACHC,GAAI,SACJl4B,EAAG,WACHm4B,GAAI,UACJC,EAAG,WACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7DyB9xD,CAAQ,EAAQ,gGCElD,SAAWygD,GAAU,aAIzB,IAAI2W,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,UAAW,UAAW,WAC3Bl8C,EAAG,CAAC,cAAe,gBACnBm8C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,QAAS,SAAU,UACxBE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAexsD,GACxC,IAAI4xD,EAAUH,EAAWC,MAAM1xD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACGijD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAM7C9W,EAAO0O,aAAa,UAAW,CACxCC,OAAQ,mFAAmFxsC,MACvF,KAEJysC,YAAa,2DAA2DzsC,MACpE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,sBACX,KAAK,EACD,MAAO,qBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,2BACA,+BACA,4BACA,0BACA,8BACA,2BACA,4BAEgB7wD,KAAKqzD,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,mBACH8zC,GAAIoG,EAAWzC,UACf7/C,EAAGsiD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACf17B,EAAG,MACHm4B,GAAIgG,EAAWzC,UACftD,EAAG,QACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAjHyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAI2W,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,UAAW,UAAW,WAC3Bl8C,EAAG,CAAC,cAAe,gBACnBm8C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,QAAS,SAAU,UACxBE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAexsD,GACxC,IAAI4xD,EAAUH,EAAWC,MAAM1xD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACGijD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAMjD9W,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,mFAAmFxsC,MACvF,KAEJysC,YAAa,2DAA2DzsC,MACpE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,qBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,4BACA,gCACA,4BACA,0BACA,8BACA,2BACA,4BAEgB7wD,KAAKqzD,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,mBACH8zC,GAAIoG,EAAWzC,UACf7/C,EAAGsiD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACf17B,EAAG,MACHm4B,GAAIgG,EAAWzC,UACftD,EAAG,QACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnHyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,mHAAmHxsC,MACvH,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,sEAAsE1sC,MAC5E,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,kBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,iBACN7zC,EAAG,qBACH8zC,GAAI,cACJl8C,EAAG,SACHm8C,GAAI,aACJC,EAAG,SACHC,GAAI,aACJl4B,EAAG,UACHm4B,GAAI,cACJC,EAAG,UACHC,GAAI,cACJC,EAAG,UACHC,GAAI,eAER/B,cAAe,mCACfE,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,UACAA,EAAQ,GACR,QACAA,EAAQ,GACR,aAEA,WAGf6D,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,YAAb5C,EACO4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,eAAb5C,GAA0C,YAAbA,EACvB,IAAT4C,EACO,EAEJA,EAAO,QAJX,GAOXd,uBAAwB,UACxBC,QAAS,KACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAjFyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,oDAAoD1sC,MAAM,KACpE2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,+BACNwE,IAAK,mBACLC,KAAM,wBAEVxE,SAAU,CACNC,QAAS,YACTC,QAAS,eACTE,QAAS,YACTD,SAAU,eACVE,SAAU,iBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,eACN7zC,EAAG,iBACH8zC,GAAI,cACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,YACJl4B,EAAG,SACHm4B,GAAI,WACJC,EAAG,WACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,GAEM,IAANA,EADA,KAIA,OAIlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,sFAAsFxsC,MAC1F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,8DAA8D1sC,MACpE,KAEJ2sC,cAAe,kCAAkC3sC,MAAM,KACvD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,UACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,8BACVC,QAAS,YACTC,SAAU,kCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,aACRC,KAAM,WACN7zC,EAAG,aACH8zC,GAAI,aACJl8C,EAAG,cACHm8C,GAAI,YACJC,EAAG,aACHC,GAAI,WACJl4B,EAAG,YACHm4B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,cACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,0FAA0FzsC,MACnG,KAEJ0sC,SAAU,8FAA8F1sC,MACpG,KAEJ2sC,cAAe,mDAAmD3sC,MAC9D,KAEJ4sC,YAAa,sBAAsB5sC,MAAM,KACzCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN7zC,EAAG,oBACH8zC,GAAI,eACJl8C,EAAG,cACHm8C,GAAI,gBACJC,EAAG,gBACHC,GAAI,eACJl4B,EAAG,WACHm4B,GAAI,aACJC,EAAG,YACHC,GAAI,cACJC,EAAG,aACHC,GAAI,eAERC,uBAAwB,aACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,OAEpBgB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAIzB2zC,cAAe,wCACfE,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,EACP,SACAA,EAAO,GACP,QACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,QAEA,UAGfkB,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,UAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,UAAb5C,GAAqC,SAAbA,GAEX,YAAbA,GACA4C,GAAQ,GAFRA,EAIAA,EAAO,IAGtBX,KAAM,CACFC,IAAK,EACLC,IAAK,KA/HyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,mEAAmEzsC,MAC5E,KAEJ+wC,kBAAkB,EAClBrE,SAAU,8DAA8D1sC,MACpE,KAEJ2sC,cAAe,kCAAkC3sC,MAAM,KACvD4sC,YAAa,qBAAqB5sC,MAAM,KACxCmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,YACTC,QAAS,YACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,YACN7zC,EAAG,iBACH8zC,GAAI,aACJl8C,EAAG,YACHm8C,GAAI,cACJC,EAAG,SACHC,GAAI,WACJl4B,EAAG,UACHm4B,GAAI,YACJC,EAAG,SACHC,GAAI,WACJC,EAAG,cACHC,GAAI,iBAERC,uBAAwB,WACxBC,QAAS,MACTjC,cAAe,iCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,aAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,OACAA,EAAO,GACP,YACAA,EAAO,GACP,WAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KApFyB9xD,CAAQ,EAAQ,4FCKlD,SAAWygD,GAAU,aAIfA,EAAO0O,aAAa,MAAO,CACjCC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,kDAAkD1sC,MAAM,KAClE2sC,cAAe,iCAAiC3sC,MAAM,KACtD4sC,YAAa,yBAAyB5sC,MAAM,KAC5CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBACTC,SAAU,gBACVC,QAAS,oBACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,YACHm4B,GAAI,WACJC,EAAG,YACHC,GAAI,WACJC,EAAG,YACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAhEyB9xD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIzB,IAAIoS,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGApS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ1nC,OAAQ,qFAAqF9E,MACzF,KAEJqwC,WAAY,yEAAyErwC,MACjF,MAGRysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTE,QAAS,mBACTD,SAAU,kCACVE,SAAU,oCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,SACN7zC,EAAG,eACHpI,EAAG,YACHm8C,GAAI,YACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAER/B,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,QAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,MACAA,EAAO,GACP,QAEA,OAGfd,uBAAwB,kBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlHyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGxsC,MACxG,KAEJysC,YAAa,iEAAiEzsC,MAC1E,KAEJ+wC,kBAAkB,EAClBrE,SAAU,iDAAiD1sC,MAAM,KACjE2sC,cAAe,8CAA8C3sC,MAAM,KACnE4sC,YAAa,yBAAyB5sC,MAAM,KAC5C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,cACJC,IAAK,wBACLC,KAAM,oCAEVZ,cAAe,wBACfC,KAAM,SAAUh9C,GACZ,MAAiB,eAAVA,GAEXi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,aAEA,cAGfjC,SAAU,CACNC,QAAS,mBACTC,QAAS,qBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,YACN7zC,EAAG,eACH8zC,GAAI,YACJl8C,EAAG,SACHm8C,GAAI,UACJC,EAAG,YACHC,GAAI,aACJl4B,EAAG,QACHm4B,GAAI,SACJiC,EAAG,YACHC,GAAI,aACJjC,EAAG,UACHC,GAAI,WACJC,EAAG,OACHC,GAAI,WA9D0BxxD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIoS,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGCpS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,+EAA+ExsC,MACnF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,YACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN7zC,EAAG,iBACHpI,EAAG,YACHm8C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERE,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,KACL,IAAK,KACD,OAAOzB,EACX,QACI,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIp0C,EAAIo0C,EAAS,GAGjB,OAAOA,GAAUkB,EAASt1C,IAAMs1C,EAFvBlB,EAAS,IAAOp0C,IAEsBs1C,EADvClB,GAAU,IAAM,IAAM,SAI1CC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzFyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,wBAAwB5sC,MAAM,KAC3CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,YACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,gBACTC,SAAU,0BACVC,QAAS,eACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,mBACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,eACHm8C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJl4B,EAAG,aACHm4B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,aACHC,GAAI,WAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB9xD,CAAQ,EAAQ,4FCGlD,SAAWygD,GAAU,aAIzB,IAAIoX,EAAe,iDAAiDj1C,MAAM,KA4B1E,SAAS+xC,EAAUhD,EAAQQ,EAAe9sD,EAAQ+sD,GAC9C,IAAI0F,EAiBR,SAAsBnG,GAClB,IAAIoG,EAAUn2C,KAAKo2C,MAAOrG,EAAS,IAAQ,KACvCsG,EAAMr2C,KAAKo2C,MAAOrG,EAAS,IAAO,IAClCuG,EAAMvG,EAAS,GACfwG,EAAO,GAUX,OATIJ,EAAU,IACVI,GAAQN,EAAaE,GAAW,SAEhCE,EAAM,IACNE,IAAkB,KAATA,EAAc,IAAM,IAAMN,EAAaI,GAAO,OAEvDC,EAAM,IACNC,IAAkB,KAATA,EAAc,IAAM,IAAMN,EAAaK,IAEpC,KAATC,EAAc,OAASA,EA/BbC,CAAazG,GAC9B,OAAQtsD,GACJ,IAAK,KACD,OAAOyyD,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,QAqBtBrX,EAAO0O,aAAa,MAAO,CACjCC,OAAQ,kMAAkMxsC,MACtM,KAEJysC,YAAa,0HAA0HzsC,MACnI,KAEJ+wC,kBAAkB,EAClBrE,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,2DAA2D3sC,MACtE,KAEJ4sC,YAAa,2DAA2D5sC,MACpE,KAEJmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,MACVC,QAAS,cACTC,SAAU,MACVC,SAAU,KAEdC,aAAc,CACVC,OA/FR,SAAyBiE,GACrB,IAAIsD,EAAOtD,EASX,OAP+B,IAA3BA,EAAO/mD,QAAQ,OACTqqD,EAAKz2D,MAAM,GAAI,GAAK,OACO,IAA3BmzD,EAAO/mD,QAAQ,OACfqqD,EAAKz2D,MAAM,GAAI,GAAK,OACO,IAA3BmzD,EAAO/mD,QAAQ,OACfqqD,EAAKz2D,MAAM,GAAI,GAAK,MACpBy2D,EAAO,QAuFbtH,KAnFR,SAAuBgE,GACnB,IAAIsD,EAAOtD,EASX,OAP+B,IAA3BA,EAAO/mD,QAAQ,OACTqqD,EAAKz2D,MAAM,GAAI,GAAK,OACO,IAA3BmzD,EAAO/mD,QAAQ,OACfqqD,EAAKz2D,MAAM,GAAI,GAAK,OACO,IAA3BmzD,EAAO/mD,QAAQ,OACfqqD,EAAKz2D,MAAM,GAAI,GAAK,MACpBy2D,EAAO,QA2Ebn7C,EAAG,UACH8zC,GAAI2D,EACJ7/C,EAAG,UACHm8C,GAAI0D,EACJzD,EAAG,UACHC,GAAIwD,EACJ17B,EAAG,UACHm4B,GAAIuD,EACJtD,EAAG,UACHC,GAAIqD,EACJpD,EAAG,UACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA3HyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,IAAIoS,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGCpS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,6EAA6ExsC,MACjF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C+sC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCL,cAAe,cACfC,KAAM,SAAUh9C,GACZ,MAAiB,OAAVA,GAA4B,OAAVA,GAE7Bq9C,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,2BACVC,QAAS,WACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,UACN7zC,EAAG,gBACH8zC,GAAI,YACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,SACJiC,EAAG,YACHC,GAAI,WACJjC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERE,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,KACL,IAAK,KACD,OAAOzB,EACX,QACI,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIp0C,EAAIo0C,EAAS,GAGjB,OAAOA,GAAUkB,EAASt1C,IAAMs1C,EAFvBlB,EAAS,IAAOp0C,IAEsBs1C,EADvClB,GAAU,IAAM,IAAM,SAI1CC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB9xD,CAAQ,EAAQ,4FCGlD,SAAWygD,GAAU,aAiEzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACTxK,EAAG,CAAC,kBAAmB,mBACvB8zC,GAAI,CAACW,EAAS,WAAiBA,EAAS,YACxC78C,EAAG,CAAC,UAAW,cACfm8C,GAAI,CAACU,EAAS,SAAeA,EAAS,UACtCT,EAAG,CAAC,UAAW,eACfC,GAAI,CAACQ,EAAS,SAAeA,EAAS,UACtC14B,EAAG,CAAC,UAAW,eACfm4B,GAAI,CAACO,EAAS,SAAeA,EAAS,UACtCN,EAAG,CAAC,SAAU,aACdC,GAAI,CAACK,EAAS,SAAeA,EAAS,UACtCJ,EAAG,CAAC,QAAS,YACbC,GAAI,CAACG,EAAS,OAAaA,EAAS,SAExC,OAAOS,GAEDD,EADAzqC,EAAO/hB,GAAK,GAGZ+hB,EAAO/hB,GAAK,GA9EZ86C,EAAO0O,aAAa,MAAO,CACjCC,OAAQ,sFAAsFxsC,MAC1F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,8BACLC,KAAM,0CAEVZ,cAAe,aACfC,KAAM,SAAUh9C,GACZ,MAAO,QAAUA,EAAMsU,eAE3B2oC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,MAAQ,MAElBA,EAAU,MAAQ,OAGjCQ,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,OACN7zC,EAAG+3C,EACHjE,GAAIiE,EACJngD,EAAGmgD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJh8B,EAAGg8B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAhEyB9xD,CAAQ,EAAQ,iGCElD,SAAWygD,GAAU,aAIXA,EAAO0O,aAAa,WAAY,CAC1CC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,wFAAwFzsC,MACjG,KAEJ0sC,SAAU,kDAAkD1sC,MAAM,KAClE2sC,cAAe,kDAAkD3sC,MAAM,KACvE4sC,YAAa,kDAAkD5sC,MAAM,KACrEmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,cACTC,SAAU,cACVC,QAAS,gBACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,iBACRC,KAAM,SACN7zC,EAAG,OACH8zC,GAAI,UACJl8C,EAAG,QACHm8C,GAAI,WACJC,EAAG,OACHC,GAAI,cACJl4B,EAAG,MACHm4B,GAAI,WACJC,EAAG,QACHC,GAAI,YACJC,EAAG,QACHC,GAAI,aAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MAnDyB9xD,CAAQ,EAAQ,4FCGlD,SAAWygD,GAAU,aAIfA,EAAO0O,aAAa,MAAO,CACjCC,OAAQ,kFAAkFxsC,MACtF,KAEJysC,YAAa,kFAAkFzsC,MAC3F,KAEJ0sC,SAAU,kDAAkD1sC,MAAM,KAClE2sC,cAAe,kDAAkD3sC,MAAM,KACvE4sC,YAAa,kDAAkD5sC,MAAM,KACrEmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,SACN7zC,EAAG,OACH8zC,GAAI,UACJl8C,EAAG,QACHm8C,GAAI,WACJC,EAAG,OACHC,GAAI,cACJl4B,EAAG,MACHm4B,GAAI,WACJC,EAAG,QACHC,GAAI,YACJC,EAAG,QACHC,GAAI,aAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MAnDyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,sFAAsFxsC,MAC1F,KAEJysC,YAAa,sFAAsFzsC,MAC/F,KAEJ0sC,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,0BACJC,IAAK,iCACLC,KAAM,wCAEVZ,cAAe,qDACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGM,eAAb5C,GACa,UAAbA,GACa,iBAAbA,EAEO4C,EACa,iBAAb5C,GAA4C,QAAbA,EAC/B4C,EAAO,GAEPA,GAAQ,GAAKA,EAAOA,EAAO,IAG1C5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,aACAA,EAAK,IACL,QACAA,EAAK,KACL,eACAA,EAAK,KACL,MACAA,EAAK,KACL,eAEA,OAGfhI,SAAU,CACNC,QAAS,mBACTC,QAAS,kBACTC,SAAU,4BACVC,QAAS,eACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN7zC,EAAG,eACH8zC,GAAI,YACJl8C,EAAG,YACHm8C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,UACHC,GAAI,SACJC,EAAG,UACHC,GAAI,UAGRC,uBAAwB,6BACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,QACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,SACpB,QACI,OAAOA,IAGnBgB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC49C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC+8C,KAAM,CAEFC,IAAK,EACLC,IAAK,KA5GyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAYzB,SAASqS,EAAuBnB,EAAQQ,EAAexsD,GASnD,MAAY,MAARA,EACOwsD,EAAgB,UAAY,UACpB,MAARxsD,EACAwsD,EAAgB,SAAW,SAE3BR,EAAS,KAtBFoB,GAsB6BpB,EArB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,yBAA2B,yBAC/ChB,GAAIgB,EAAgB,sBAAwB,sBAC5Cf,GAAI,gBACJE,GAAI,wBACJE,GAAI,kBAOgC7rD,GArBvBid,MAAM,KAChBmwC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAsDR,SAASuF,EAAqBznD,GAC1B,OAAO,WACH,OAAOA,EAAM,KAAwB,KAAjBhR,KAAK8vD,QAAiB,IAAM,IAAM,QAIrDnP,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ1nC,OAAQ,yFAAyF9E,MAC7F,KAEJqwC,WAAY,iGAAiGrwC,MACzG,MAGRysC,YAAa,yDAAyDzsC,MAClE,KAEJ0sC,SAhDJ,SAA6Bx6C,EAAG4S,GAC5B,IAAI4nC,EAAW,CACPkJ,WAAY,0DAA0D51C,MAClE,KAEJ61C,WAAY,0DAA0D71C,MAClE,KAEJ81C,SAAU,4DAA4D91C,MAClE,MAKZ,OAAU,IAAN9N,EACOw6C,EAAqB,WACvB1tD,MAAM,EAAG,GACTM,OAAOotD,EAAqB,WAAE1tD,MAAM,EAAG,IAE3CkT,EASEw6C,EALI,qBAAqBrsC,KAAKyE,GAC/B,aACA,sCAAsCzE,KAAKyE,GAC3C,WACA,cACoB5S,EAAEq+C,OARjB7D,EAAqB,YA6BhCC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAASgI,EAAqB,cAC9B/H,QAAS+H,EAAqB,YAC9B7H,QAAS6H,EAAqB,WAC9B9H,SAAU8H,EAAqB,cAC/B5H,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOoF,EAAqB,oBAAoB12D,KAAK/B,MACzD,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOy4D,EAAqB,qBAAqB12D,KAAK/B,QAGlE8wD,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,kBACH8zC,GAAI8B,EACJh+C,EAAGg+C,EACH7B,GAAI6B,EACJ5B,EAAG,SACHC,GAAI2B,EACJ75B,EAAG,OACHm4B,GAAI0B,EACJzB,EAAG,SACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAGRrD,cAAe,wBACfC,KAAM,SAAUh9C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjCi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACD,OAAOzB,EAAS,KACpB,IAAK,IACD,OAAOA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAhKyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAI2O,EAAS,CACL,QACA,QACA,OACA,QACA,MACA,MACA,SACA,OACA,QACA,SACA,QACA,SAEJwI,EAAO,CAAC,QAAS,MAAO,OAAQ,MAAO,SAAU,OAAQ,QAEpDnX,EAAO0O,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUsI,EACVrI,cAAeqI,EACfpI,YAAaoI,EACb7H,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,UACfC,KAAM,SAAUh9C,GACZ,MAAO,QAAUA,GAErBi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,MAEJ,OAEXjC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,iBACVC,QAAS,sBACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN7zC,EAAG,YACH8zC,GAAI,WACJl8C,EAAG,UACHm8C,GAAI,SACJC,EAAG,YACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,QACJC,EAAG,UACHC,GAAI,SACJC,EAAG,UACHC,GAAI,UAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC49C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC+8C,KAAM,CACFC,IAAK,EACLC,IAAK,KA/EyB9xD,CAAQ,EAAQ,gGCElD,SAAWygD,GAAU,aAIZA,EAAO0O,aAAa,UAAW,CACxCC,OAAQ,6EAA6ExsC,MACjF,KAEJysC,YAAa,oDAAoDzsC,MAAM,KACvE0sC,SAAU,+DAA+D1sC,MACrE,KAEJ2sC,cAAe,kCAAkC3sC,MAAM,KACvD4sC,YAAa,yBAAyB5sC,MAAM,KAC5CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,uBACTC,SAAU,oCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,kBACRC,KAAM,qBACN7zC,EAAG,SACH8zC,GAAI,YACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yEAAyExsC,MAC7E,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,sBACTC,SAAU,mCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,oBACN7zC,EAAG,SACH8zC,GAAI,YACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAjDyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qGAAqGxsC,MACzG,KAEJysC,YAAa,sFAAsFzsC,MAC/F,KAEJ+wC,kBAAkB,EAClBrE,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpB7C,cAAe,SACfC,KAAM,SAAUh9C,GACZ,MAAO,QAAQuQ,KAAKvQ,IAExBi9C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,0BACLC,KAAM,gCACN99B,EAAG,YACHqiC,GAAI,aACJC,IAAK,mBACLC,KAAM,yBAEVxE,SAAU,CACNC,QAAS,mBACTC,QAAS,oBACTC,SAAU,yBACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN7zC,EAAG,WACH8zC,GAAI,UACJl8C,EAAG,WACHm8C,GAAI,UACJC,EAAG,UACHC,GAAI,SACJl4B,EAAG,WACHm4B,GAAI,UACJiC,EAAG,WACHC,GAAI,UACJjC,EAAG,YACHC,GAAI,WACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KA5EyB9xD,CAAQ,EAAQ,iGCElD,SAAWygD,GAAU,aAIXA,EAAO0O,aAAa,WAAY,CAC1CC,OAAQ,6GAA6GxsC,MACjH,KAEJysC,YAAa,8DAA8DzsC,MACvE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,yEAAyE1sC,MAC/E,KAEJ2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,4BAA4B5sC,MAAM,KAC/C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJE,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,sBACTC,SAAU,eACVC,QAAS,uBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN7zC,EAAG,mBACH8zC,GAAI,eACJl8C,EAAG,aACHm8C,GAAI,eACJC,EAAG,YACHC,GAAI,YACJl4B,EAAG,SACHm4B,GAAI,WACJC,EAAG,YACHC,GAAI,cACJC,EAAG,UACHC,GAAI,aAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KArEyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,gEAAgEzsC,MAAM,KACnF0sC,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,sCAAsC3sC,MAAM,KAC3D4sC,YAAa,2BAA2B5sC,MAAM,KAC9CmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,eACTC,SAAU,8BACVC,QAAS,eACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN7zC,EAAG,oBACH8zC,GAAI,WACJl8C,EAAG,cACHm8C,GAAI,aACJC,EAAG,cACHC,GAAI,aACJl4B,EAAG,WACHm4B,GAAI,UACJC,EAAG,WACHC,GAAI,UACJC,EAAG,YACHC,GAAI,YAERC,uBAAwB,gBACxBC,QAAS,UACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB9xD,CAAQ,EAAQ,8FCKlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wCAAwCxsC,MAC5C,KAEJysC,YAAa,yCAAyCzsC,MAClD,KAEJ0sC,SAAU,8BAA8B1sC,MAAM,KAC9C2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN99B,EAAG,WACHqiC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,GAGPA,GAAQ,GAAKA,EAAOA,EAAO,IAG1C5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,SACTC,QAAS,SACTC,SAAU,SAAUkG,GAChB,OAAIA,EAAI/E,SAAW9xD,KAAK8xD,OACb,WAEA,YAGflB,QAAS,SACTC,SAAU,SAAUgG,GAChB,OAAI72D,KAAK8xD,SAAW+E,EAAI/E,OACb,WAEA,YAGfhB,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN7zC,EAAG,KACH8zC,GAAI,OACJl8C,EAAG,OACHm8C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJl4B,EAAG,MACHm4B,GAAI,OACJiC,EAAG,MACHC,GAAI,OACJjC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,QAERI,KAAM,CAEFC,IAAK,EACLC,IAAK,KApHyB9xD,CAAQ,EAAQ,8FCIlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wCAAwCxsC,MAC5C,KAEJysC,YAAa,yCAAyCzsC,MAClD,KAEJ0sC,SAAU,8BAA8B1sC,MAAM,KAC9C2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN99B,EAAG,WACHqiC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACO,OAAPA,EACA,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,SACTC,QAAS,SACTC,SAAU,YACVC,QAAS,SACTC,SAAU,YACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN7zC,EAAG,KACH8zC,GAAI,OACJl8C,EAAG,OACHm8C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJl4B,EAAG,MACHm4B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BxxD,CAAQ,EAAQ,8FCElD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wCAAwCxsC,MAC5C,KAEJysC,YAAa,yCAAyCzsC,MAClD,KAEJ0sC,SAAU,8BAA8B1sC,MAAM,KAC9C2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN99B,EAAG,WACHqiC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,aACVC,QAAS,UACTC,SAAU,aACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN7zC,EAAG,KACH8zC,GAAI,OACJl8C,EAAG,OACHm8C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJl4B,EAAG,MACHm4B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BxxD,CAAQ,EAAQ,8FCElD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wCAAwCxsC,MAC5C,KAEJysC,YAAa,yCAAyCzsC,MAClD,KAEJ0sC,SAAU,8BAA8B1sC,MAAM,KAC9C2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN99B,EAAG,WACHqiC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,aACVC,QAAS,UACTC,SAAU,aACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN7zC,EAAG,KACH8zC,GAAI,OACJl8C,EAAG,OACHm8C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJl4B,EAAG,MACHm4B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BxxD,CAAQ,EAAQ,wGCP1D,IAAIyO,EAAM,CACT,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,aAAc,2CACd,gBAAiB,2CACjB,aAAc,2CACd,gBAAiB,2CACjB,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,WAAY,yCACZ,cAAe,yCACf,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,YAAa,0CACb,eAAgB,0CAChB,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,QAAS,sCACT,aAAc,2CACd,gBAAiB,2CACjB,WAAY,sCACZ,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,YAAa,0CACb,eAAgB,0CAChB,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,aAAc,2CACd,gBAAiB,2CACjB,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,yCAIf,SAASkqD,EAAeC,GACvB,IAAIztD,EAAK0tD,EAAsBD,GAC/B,OAAOE,EAAoB3tD,GAE5B,SAAS0tD,EAAsBD,GAC9B,IAAIE,EAAoBp0C,EAAEjW,EAAKmqD,GAAM,CACpC,IAAIx2C,EAAI,IAAI7P,MAAM,uBAAyBqmD,EAAM,KAEjD,MADAx2C,EAAE22C,KAAO,mBACH32C,EAEP,OAAO3T,EAAImqD,GAEZD,EAAerlD,KAAO,WACrB,OAAOD,OAAOC,KAAK7E,IAEpBkqD,EAAelsD,QAAUosD,EACzBj5D,EAAOsuD,QAAUyK,EACjBA,EAAextD,GAAK,8GClSnB,IAASoS,EAAAA,EAAqiI8I,OAAOF,SAAziIxmB,QAAQC,OAAO,eAAe,IAAI0E,MAAM,eAAe,CAAC00D,OAAM,IAAK3tD,OAAO,CAAC,mBAAmB,SAASkS,GAAG5d,QAAQ+M,UAAU6Q,EAAE07C,0BAA0B17C,EAAE07C,yBAAyB,sCAAsC17C,EAAE27C,2BAA2B,yCAAyCv5D,QAAQC,OAAO,mBAAmB,CAAC,mBAAmBD,QAAQC,OAAO,iBAAiB,IAAID,QAAQC,OAAO,QAAQ,CAAC,eAAe,iBAAiB,mBAAmB,eAAwEA,EAAOsuD,UAAUA,IAAUtuD,EAAOsuD,QAAQ,SAASvuD,QAAQC,OAAO,kBAAkB2X,QAAQ,MAAM,CAAC,KAAK,SAASgG,GAAG,IAAImB,EAAE,OAAaua,EAAE,CAAC,MAAM,KAAI,MAAM,KAAK,MAAM,KAAI,MAAM,KAAK,MAAM,MAAMn5B,KAAKq5D,eAAe,SAAS57C,EAAEmB,GAAG,MAAM,WAAWA,EAAE06C,YAAYt5D,KAAKu5D,QAAQ97C,GAAGA,EAAE+7C,iBAAiB,MAAM56C,EAAE06C,YAAYt5D,KAAKu5D,QAAQ97C,GAAGA,EAAE3I,WAAWC,QAAQ,IAAI6J,EAAE06C,YAAY,iBAAiB77C,GAAGA,EAAEA,EAAE1I,QAAQ,KAAK,OAAO6J,EAAE66C,cAAch8C,EAAEvP,QAAQ,MAAM,GAAGuP,EAAEvP,QAAQ,OAAO,GAAGuP,EAAEvP,QAAQ,OAAO,KAAKuP,EAAEmB,EAAE86C,SAASj8C,EAAEmB,EAAE86C,UAAUj8C,GAAG,kBAAkBA,EAAEA,EAAE,OAAO,QAAQA,GAAGzd,KAAKu5D,QAAQ,SAAS97C,GAAG,OAAOA,IAAIA,KAAKk8C,SAASl8C,IAAIwU,QAAQxU,EAAE,KAAKzd,KAAKke,UAAU,SAASib,EAAE7W,GAAG,IAAIiwC,EAAE90C,EAAExR,QAAQ4R,EAAE7d,KAAKoxD,EAAE,GAAG/zC,EAAE,GAAGK,EAAED,EAAExN,KAAKkpB,GAAGpuB,MAAK,SAAS0S,GAA6C,IAAI0b,EAAEzb,EAA7C7d,QAAQ+M,UAAU0V,EAAEs3C,SAASt3C,EAAEs3C,SAAgBzgC,EAAE,GAAGt5B,QAAQkB,QAAQuhB,EAAEs3C,QAAO,SAASn8C,GAAGzd,KAAKS,KAAKod,EAAEw7C,eAAe57C,EAAE6E,MAAK6W,GAAGzb,EAAEyb,EAAElmB,KAAKqP,EAAEu3C,SAASv3C,EAAEu3C,SAAS,KAAKx8C,GAAGK,EAAEkB,GAAE,IAAsI6T,EAAEzd,EAApIwI,EAAE,GAAM3d,QAAQmS,QAAQyL,GAAGD,EAAEC,EAAE5d,QAAQuN,WAAWqQ,KAAKD,EAAEC,KAAK5d,QAAQ+M,UAAU0V,EAAEwnC,QAAQxnC,EAAEwnC,OAAO,kBAAkBxnC,EAAEwnC,QAAer3B,EAAE,GAAG5yB,QAAQkB,QAAQyc,EAAE,IAAG,SAASC,EAAEmB,GAAG5e,KAAKS,KAAKod,EAAEw7C,eAAez6C,EAAE0D,MAAKmQ,GAAGzd,EAAEyd,EAAExf,KAAKqP,EAAEu3C,SAASv3C,EAAEu3C,SAAS,KAAKx8C,GAAGrI,EAAE4J,GAAE/e,QAAQkB,QAAQyc,GAAE,SAASC,EAAEq8C,GAAG,IAAI3gC,EAAEo5B,EAAEnB,EAAEvxD,QAAQoiB,KAAKzE,EAAEs8C,IAAIvH,EAAE,GAAG,IAAI70C,EAAE4E,EAAEy3C,YAAYz3C,EAAEy3C,YAAY3I,EAAEvxD,QAAQkB,QAAQ2c,GAAE,SAASD,GAAG,IAAImB,EAAE0D,EAAEy3C,YAAY3I,EAAE3zC,GAAGA,EAAEzd,KAAKS,KAAKod,EAAEw7C,eAAez6C,EAAE0D,MAAKiwC,GAAGp5B,EAAEo5B,EAAEt/C,KAAKqP,EAAEu3C,SAASv3C,EAAEu3C,SAAS,KAAKx8C,GAAGy8C,EAAEt8C,EAAEpO,OAAO+pB,EAAEva,EAAEua,KAAI7W,EAAE03C,qBAAqB5I,GAA9wC,UAAoxCA,GAAG/zC,EAAEk1C,EAAE5lD,QAAQykD,MAAK,MAAM,mBAAmB1zC,EAAS,OAAGA,EAAS,OAAE,SAASD,GAAG80C,EAAE3G,OAAOnuC,MAAK80C,EAAE9uD,SAASzD,KAAKi6D,cAAc,SAASx8C,GAAG,YAAO,IAAS0b,EAAE1b,IAAIzd,KAAKk6D,eAAe,SAASz8C,GAAG,OAAO0b,EAAE1b,OAAO5d,QAAQC,OAAO,oBAAoB+C,UAAU,QAAQ,CAAC,SAAS,KAAK,MAAM,YAAY,WAAW,SAAS+b,EAAEk7C,EAAE3gC,EAAE7W,EAAEiwC,GAAG,MAAM,CAACprD,SAAS,KAAKrE,MAAM,CAAC6E,KAAK,SAASwyD,SAAS,YAAYP,OAAO,aAAaG,YAAY,kBAAkBL,SAAS,iBAAiBJ,WAAW,oBAAoBG,aAAa,gBAAgBI,SAAS,kBAAkBztC,SAAS,YAAY4tC,mBAAmB,UAAU1f,QAAQ,IAAI8f,QAAQ,WAAWtQ,MAAM,aAAa9oD,WAAW,CAAC,SAAS,WAAW,SAAS,cAAc,SAASyc,EAAEmB,EAAE0D,GAAwe7E,EAAE48C,IAAI,GAAGx6D,QAAQ+M,UAAU6Q,EAAE2O,WAAW,QAAQ3O,EAAE2O,UAAUvsB,QAAQmS,QAAQyL,EAAE9V,OAAO8V,EAAElZ,OAAO,QAAO,WAAWkZ,EAAE68C,cAAY,GAAI78C,EAAE88C,YAAY,WAAW,OAAO98C,EAAE08C,UAAU,gBAAgB18C,EAAE68C,SAAS,WAAW,IAAIz8C,EAAEi8C,EAAE7tD,QAAQ,OAAO2S,EAAE47C,SAASl4C,EAAEm4C,mBAAmB,kBAAkBthC,EAAEjb,UAAUT,EAAE9V,OAAhxB,WAAa,IAAIiX,EAAE,CAAC86C,SAASj8C,EAAEi8C,SAASj8C,EAAEi8C,SAAS,IAAIJ,WAAW77C,EAAE67C,WAAW77C,EAAE67C,WAAW,IAAIG,aAAah8C,EAAEg8C,aAAaO,mBAAmBv8C,EAAEu8C,oBAAoB,OAAOn6D,QAAQ+M,UAAU0V,EAAEo4C,aAAa97C,EAAEg7C,OAAOn8C,EAAEpc,MAAMoc,EAAEm8C,SAAS/5D,QAAQ+M,UAAU0V,EAAEq4C,kBAAkB/7C,EAAEm7C,YAAYt8C,EAAEpc,MAAMoc,EAAEs8C,cAAcl6D,QAAQ+M,UAAU0V,EAAEs4C,YAAYh8C,EAAEkrC,MAAMrsC,EAAEpc,MAAMoc,EAAEqsC,QAAQlrC,EAAEi7C,SAASp8C,EAAEo8C,SAASp8C,EAAEo8C,SAAS,IAAIj7C,EAAEi7C,SAAS1gC,EAAE8gC,cAAcr7C,EAAEi7C,UAAU1gC,EAAE+gC,eAAet7C,EAAEi7C,UAAUj7C,EAAEi7C,SAASj7C,EAAoT2zC,IAAKxnD,MAAK,SAAS+uD,GAAGr8C,EAAE48C,IAAIP,EAAEl7C,EAAEi8C,YAAYv4C,EAAEm4C,mBAAmB,kBAAkB58C,EAAElR,QAAQmtD,MAAKr8C,EAAExZ,SAAS4Z,EAAEpa,WAAW8E,KAAK,SAASqW,EAAEk7C,GAA8bA,EAAEx2D,KAAK,SAAQ,WAAWsb,EAAE07C,WAAWvvD,MAAK,YAAve,WAAa,IAAI+uD,EAAEl7C,EAAEw7C,SAAS,QAAQjhC,EAAE,IAAIo1B,KAAK,CAAC3vC,EAAEy7C,KAAK,CAACnrD,KAAK,oBAAoB4qD,EAAE,MAAM,GAAGr8C,EAAEi+B,UAAUof,iBAAiBpf,UAAUqf,WAAW5hC,EAAEva,EAAE27C,mBAAmB,CAAC,IAAI18C,EAAEhe,QAAQkD,QAAQ,+CAA+CquD,EAAEvxD,QAAQkD,QAAQ8a,EAAEjV,WAAW,IAAIwoD,EAAEt+C,KAAK,OAAO2K,EAAEu9C,IAAIC,gBAAgB9hC,IAAIi4B,EAAEt+C,KAAK,WAAW8L,EAAE27C,eAAenJ,EAAEt+C,KAAK,SAAS,UAAUwP,EAAExB,KAAK,QAAQuZ,OAAOxc,GAAG00C,GAAE,WAAWnB,EAAE,GAAGnH,QAAQmH,EAAEvkD,WAAU,OAA8DssB,MAAMva,EAAE3a","sources":["webpack://motion-chat/./node_modules/@flowjs/ng-flow/dist/ng-flow.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/locationServices.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/services.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/common.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/coreservices.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/glob.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/hof.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/predicates.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/queue.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/safeConsole.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/strings.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/trace.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/globals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/param.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramTypes.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/stateParams.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathNode.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathUtils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/router.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateObject.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/targetState.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/resolve.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/views.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/url.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRouter.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRule.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRules.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/utils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/view/view.js","webpack://motion-chat/./node_modules/angular-aria/angular-aria.js","webpack://motion-chat/./node_modules/angular-rateit/dist/ng-rateit.js","webpack://motion-chat/./src/js/index.controller.js","webpack://motion-chat/./src/js/index.route.js","webpack://motion-chat/./src/js/closing/index.controller.js","webpack://motion-chat/./src/js/index.factory.js","webpack://motion-chat/./src/js/chat/index.controller.js","webpack://motion-chat/./src/js/offline/index.controller.js","webpack://motion-chat/./src/js/online/index.controller.js","webpack://motion-chat/./src/js/unmanaged/index.controller.js","webpack://motion-chat/./src/js/waiting/index.controller.js","webpack://motion-chat/./src/js/index.module.js","webpack://motion-chat/./node_modules/expose-loader/dist/runtime/getGlobalThis.js","webpack://motion-chat/./node_modules/json-form-data/src/jsonToFormData.js","webpack://motion-chat/./node_modules/moment/locale/af.js","webpack://motion-chat/./node_modules/moment/locale/ar-dz.js","webpack://motion-chat/./node_modules/moment/locale/ar-kw.js","webpack://motion-chat/./node_modules/moment/locale/ar-ly.js","webpack://motion-chat/./node_modules/moment/locale/ar-ma.js","webpack://motion-chat/./node_modules/moment/locale/ar-sa.js","webpack://motion-chat/./node_modules/moment/locale/ar-tn.js","webpack://motion-chat/./node_modules/moment/locale/ar.js","webpack://motion-chat/./node_modules/moment/locale/az.js","webpack://motion-chat/./node_modules/moment/locale/be.js","webpack://motion-chat/./node_modules/moment/locale/bg.js","webpack://motion-chat/./node_modules/moment/locale/bm.js","webpack://motion-chat/./node_modules/moment/locale/bn-bd.js","webpack://motion-chat/./node_modules/moment/locale/bn.js","webpack://motion-chat/./node_modules/moment/locale/bo.js","webpack://motion-chat/./node_modules/moment/locale/br.js","webpack://motion-chat/./node_modules/moment/locale/bs.js","webpack://motion-chat/./node_modules/moment/locale/ca.js","webpack://motion-chat/./node_modules/moment/locale/cs.js","webpack://motion-chat/./node_modules/moment/locale/cv.js","webpack://motion-chat/./node_modules/moment/locale/cy.js","webpack://motion-chat/./node_modules/moment/locale/da.js","webpack://motion-chat/./node_modules/moment/locale/de-at.js","webpack://motion-chat/./node_modules/moment/locale/de-ch.js","webpack://motion-chat/./node_modules/moment/locale/de.js","webpack://motion-chat/./node_modules/moment/locale/dv.js","webpack://motion-chat/./node_modules/moment/locale/el.js","webpack://motion-chat/./node_modules/moment/locale/en-au.js","webpack://motion-chat/./node_modules/moment/locale/en-ca.js","webpack://motion-chat/./node_modules/moment/locale/en-gb.js","webpack://motion-chat/./node_modules/moment/locale/en-ie.js","webpack://motion-chat/./node_modules/moment/locale/en-il.js","webpack://motion-chat/./node_modules/moment/locale/en-in.js","webpack://motion-chat/./node_modules/moment/locale/en-nz.js","webpack://motion-chat/./node_modules/moment/locale/en-sg.js","webpack://motion-chat/./node_modules/moment/locale/eo.js","webpack://motion-chat/./node_modules/moment/locale/es-do.js","webpack://motion-chat/./node_modules/moment/locale/es-mx.js","webpack://motion-chat/./node_modules/moment/locale/es-us.js","webpack://motion-chat/./node_modules/moment/locale/es.js","webpack://motion-chat/./node_modules/moment/locale/et.js","webpack://motion-chat/./node_modules/moment/locale/eu.js","webpack://motion-chat/./node_modules/moment/locale/fa.js","webpack://motion-chat/./node_modules/moment/locale/fi.js","webpack://motion-chat/./node_modules/moment/locale/fil.js","webpack://motion-chat/./node_modules/moment/locale/fo.js","webpack://motion-chat/./node_modules/moment/locale/fr-ca.js","webpack://motion-chat/./node_modules/moment/locale/fr-ch.js","webpack://motion-chat/./node_modules/moment/locale/fr.js","webpack://motion-chat/./node_modules/moment/locale/fy.js","webpack://motion-chat/./node_modules/moment/locale/ga.js","webpack://motion-chat/./node_modules/moment/locale/gd.js","webpack://motion-chat/./node_modules/moment/locale/gl.js","webpack://motion-chat/./node_modules/moment/locale/gom-deva.js","webpack://motion-chat/./node_modules/moment/locale/gom-latn.js","webpack://motion-chat/./node_modules/moment/locale/gu.js","webpack://motion-chat/./node_modules/moment/locale/he.js","webpack://motion-chat/./node_modules/moment/locale/hi.js","webpack://motion-chat/./node_modules/moment/locale/hr.js","webpack://motion-chat/./node_modules/moment/locale/hu.js","webpack://motion-chat/./node_modules/moment/locale/hy-am.js","webpack://motion-chat/./node_modules/moment/locale/id.js","webpack://motion-chat/./node_modules/moment/locale/is.js","webpack://motion-chat/./node_modules/moment/locale/it-ch.js","webpack://motion-chat/./node_modules/moment/locale/it.js","webpack://motion-chat/./node_modules/moment/locale/ja.js","webpack://motion-chat/./node_modules/moment/locale/jv.js","webpack://motion-chat/./node_modules/moment/locale/ka.js","webpack://motion-chat/./node_modules/moment/locale/kk.js","webpack://motion-chat/./node_modules/moment/locale/km.js","webpack://motion-chat/./node_modules/moment/locale/kn.js","webpack://motion-chat/./node_modules/moment/locale/ko.js","webpack://motion-chat/./node_modules/moment/locale/ku.js","webpack://motion-chat/./node_modules/moment/locale/ky.js","webpack://motion-chat/./node_modules/moment/locale/lb.js","webpack://motion-chat/./node_modules/moment/locale/lo.js","webpack://motion-chat/./node_modules/moment/locale/lt.js","webpack://motion-chat/./node_modules/moment/locale/lv.js","webpack://motion-chat/./node_modules/moment/locale/me.js","webpack://motion-chat/./node_modules/moment/locale/mi.js","webpack://motion-chat/./node_modules/moment/locale/mk.js","webpack://motion-chat/./node_modules/moment/locale/ml.js","webpack://motion-chat/./node_modules/moment/locale/mn.js","webpack://motion-chat/./node_modules/moment/locale/mr.js","webpack://motion-chat/./node_modules/moment/locale/ms-my.js","webpack://motion-chat/./node_modules/moment/locale/ms.js","webpack://motion-chat/./node_modules/moment/locale/mt.js","webpack://motion-chat/./node_modules/moment/locale/my.js","webpack://motion-chat/./node_modules/moment/locale/nb.js","webpack://motion-chat/./node_modules/moment/locale/ne.js","webpack://motion-chat/./node_modules/moment/locale/nl-be.js","webpack://motion-chat/./node_modules/moment/locale/nl.js","webpack://motion-chat/./node_modules/moment/locale/nn.js","webpack://motion-chat/./node_modules/moment/locale/oc-lnc.js","webpack://motion-chat/./node_modules/moment/locale/pa-in.js","webpack://motion-chat/./node_modules/moment/locale/pl.js","webpack://motion-chat/./node_modules/moment/locale/pt-br.js","webpack://motion-chat/./node_modules/moment/locale/pt.js","webpack://motion-chat/./node_modules/moment/locale/ro.js","webpack://motion-chat/./node_modules/moment/locale/ru.js","webpack://motion-chat/./node_modules/moment/locale/sd.js","webpack://motion-chat/./node_modules/moment/locale/se.js","webpack://motion-chat/./node_modules/moment/locale/si.js","webpack://motion-chat/./node_modules/moment/locale/sk.js","webpack://motion-chat/./node_modules/moment/locale/sl.js","webpack://motion-chat/./node_modules/moment/locale/sq.js","webpack://motion-chat/./node_modules/moment/locale/sr-cyrl.js","webpack://motion-chat/./node_modules/moment/locale/sr.js","webpack://motion-chat/./node_modules/moment/locale/ss.js","webpack://motion-chat/./node_modules/moment/locale/sv.js","webpack://motion-chat/./node_modules/moment/locale/sw.js","webpack://motion-chat/./node_modules/moment/locale/ta.js","webpack://motion-chat/./node_modules/moment/locale/te.js","webpack://motion-chat/./node_modules/moment/locale/tet.js","webpack://motion-chat/./node_modules/moment/locale/tg.js","webpack://motion-chat/./node_modules/moment/locale/th.js","webpack://motion-chat/./node_modules/moment/locale/tk.js","webpack://motion-chat/./node_modules/moment/locale/tl-ph.js","webpack://motion-chat/./node_modules/moment/locale/tlh.js","webpack://motion-chat/./node_modules/moment/locale/tr.js","webpack://motion-chat/./node_modules/moment/locale/tzl.js","webpack://motion-chat/./node_modules/moment/locale/tzm-latn.js","webpack://motion-chat/./node_modules/moment/locale/tzm.js","webpack://motion-chat/./node_modules/moment/locale/ug-cn.js","webpack://motion-chat/./node_modules/moment/locale/uk.js","webpack://motion-chat/./node_modules/moment/locale/ur.js","webpack://motion-chat/./node_modules/moment/locale/uz-latn.js","webpack://motion-chat/./node_modules/moment/locale/uz.js","webpack://motion-chat/./node_modules/moment/locale/vi.js","webpack://motion-chat/./node_modules/moment/locale/x-pseudo.js","webpack://motion-chat/./node_modules/moment/locale/yo.js","webpack://motion-chat/./node_modules/moment/locale/zh-cn.js","webpack://motion-chat/./node_modules/moment/locale/zh-hk.js","webpack://motion-chat/./node_modules/moment/locale/zh-mo.js","webpack://motion-chat/./node_modules/moment/locale/zh-tw.js","webpack://motion-chat//Users/andreacuccaro/Documents/MotionV3/motion-chat/node_modules/moment/locale|sync|/^\\.\\/.*$/","webpack://motion-chat/./node_modules/ng-csv/build/ng-csv.min.js"],"names":["angular","module","provider","this","defaults","factory","options","Flow","events","on","event","callback","push","$get","fn","opts","flow","extend","forEach","controller","$scope","$attrs","$parse","flowFactory","$eval","flowInit","flowObject","create","catchAllHandler","eventName","args","Array","prototype","slice","call","arguments","shift","$broadcast","apply","concat","$applyAsync","defaultPrevented","$on","off","$flow","hasOwnProperty","flowName","assign","directive","scope","element","attrs","isDirectory","isSingleFile","inputAttrs","flowAttrs","assignBrowse","bind","preventDefault","$timeout","promise","enter","dragEvent","fileDrag","dataTransfer","originalEvent","types","val","$apply","flowDragEnter","cancel","flowDragLeave","assignDrop","flowDropEnabled","$watch","value","unAssignDrop","fileSuccess","fileProgress","fileAdded","filesAdded","filesSubmitted","fileRetry","fileRemoved","fileError","uploadStart","complete","progress","error","eventArgs","string","name","charAt","toUpperCase","require","funcArgs","key","file","flowImg","fileReader","FileReader","readAsDataURL","onload","$set","target","result","transfers","files","uiView","$ViewDirectiveFill","$compile","$controller","$transitions","$view","$q","getControllerAs","parse","getResolveAs","restrict","priority","compile","tElement","initial","html","empty","$element","data","contents","cfg","$cfg","viewDecl","getTemplate","noop","resolveCtx","path","ResolveContext","trace","$uiView","link","controllerAs","resolveAs","locals","controllerInstance","children","registerControllerCallbacks","isString","component","kebobName","kebobString","tagRegexp_1","RegExp","deregisterWatch_1","directiveEl","filter","el","tagName","exec","ctrlInstance","$animate","$uiViewScroll","$interpolate","rootData","$context","_pluginapi","_rootViewContext","count","terminal","transclude","tAttrs","$transclude","previousEl","currentEl","currentScope","viewConfig","onloadExp","autoScrollExp","renderer","cb","then","leave","inherited","inheritedData","activeUIView","$type","id","fqn","config","configUpdated","updateView","fromParentTagConfig","fromParentTag","unregister","registerUIView","newScope","$new","animEnter","defer","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","$emit","cloned","clone","resolve","isDefined","remove","$destroy","_viewData_1","cleanupLastView","$inject","hasComponentImpl","_uiCanExitId","isFunction","$onInit","componentProvider","viewState","tail","state","self","hookOptions","uiOnParamsChanged","viewCreationTrans_1","getResolvable","onSuccess","$transition$","exiting","indexOf","toParams","params","fromParams","getNodeSchema","node","paramSchema","toSchema","treeChanges","map","reduce","unnestR","fromSchema","changedToParams","param","idx","type","equals","length","changedKeys_1","x","newValues","uiCanExit","id_1","cacheProp_1","prevTruthyAnswer_1","trans","redirectedFrom","criteria","onBefore","ids","when","TemplateFactory","_this","_useHttp","$http","$templateCache","$injector","$templateRequest","has","get","useHttpService","fromConfig","context","asTemplate","services","str","template","asComponent","fromString","templateUrl","fromUrl","templateProvider","fromProvider","fromComponentProvider","url","cache","headers","Accept","response","deps","providerFn","isArray","Resolvable","makeComponentTemplate","bindings","prefix","kebob","camelCase","kebobed","cmpDefs","Error","getBindings","getComponentBindings","input","attrName","attr","resolveName","res","join","def","isObject","bindToController","scopeBindings","bindingsObj","Object","keys","tuple","getStateHookBuilder","hookName","stateObject","hook","pathname","subContext","$$state","getLocals","$state$","undefined","Ng1LocationServices","$locationProvider","_urlListeners","_lp","createProxyFunctions","monkeyPatchPathParameterType","router","pathType","urlMatcherFactory","encode","toString","replace","m","decode","dispose","onChange","removeFrom","html5Mode","enabled","$sniffer","history","baseHref","_baseHref","$browser","$window","location","newUrl","$location","_runtimeServices","$rootScope","evt","_loc","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","UIRouter","stateProvider","stateRegistry","stateService","decorator","viewService","_viewConfigFactory","urlService","_decodeParams","ng1LocationService","locationService","locationConfig","getProviderFor","serviceName","$urp","service","runBlock","$uiRouter","invoke","checkStrictDi","strictDi","resolvables","resolvable","annotate","resolveFn","watchDigests","uiRouter","urlRouterProvider","globals","run","$urlMatcherFactory","$state","$urlRouter","ctx","getTokens","getPolicy","async","applyPairs","$IsStateFilter","isFilter","is","$stateful","$IncludedByStateFilter","includesFilter","includes","StateProvider","func","definition","register","onInvalid","getNg1ViewConfigFactory","templateFactory","view","Ng1ViewConfig","hasAnyKey","obj","acc","ng1ViewsBuilder","parent","compKeys","nonCompKeys","allViewKeys","views","viewsObject","$default","pick","$name","normalized","ViewService","$uiViewName","uiViewName","$uiViewContextAnchor","uiViewContextAnchor","$id","loaded","load","paramValues","promises","getController","all","results","controllerProvider","isInjectable","UrlRouterProvider","injectableHandler","handler","match","$match","$stateParams","urlRouter","update","interceptDeferred","listen","rule","ruleFn","BaseUrlRule","identity","rules","otherwise","urlRules","what","deferIntercept","useAnchorScroll","$anchorScroll","scrollIntoView","__spreadArrays","s","i","il","r","k","a","j","jl","root","g","global","fromJson","JSON","toJson","stringify","toObj","_equals","o1","o2","t1","a1","a2","tup","arrayTuples","b","t","getTime","source","fnNames","latebind","bindFunction","fnName","inherit","extra","inArray","array","splice","pushTo","arr","deregAll","functions","defaultsList","_i","defaultVals","reverse","mergeR","memo","item","ancestors","first","second","n","propNames","objCopy","_prop","omit","collection","accept","find","mapObj","values","allTrueR","elem","anyTrueR","flattenR","pushR","uniqR","token","unnest","assertPredicate","predicateOrMap","errMsg","maxArrayLen","min","Math","_loop_1","keyValTuple","copy","src","dest","silenceUncaughtInPromise","catch","e","silentRejection","makeStub","methods","fnname","Glob","text","glob","split","regexpString","seg","regexp","matches","test","curry","curried","compose","start","pipe","funcs","prop","propEq","_val","not","and","fn1","fn2","or","any","ctor","constructor","v","pattern","struct","toStr","tis","isUndefined","isNull","o","isNullOrUndefined","isNumber","isDate","isRegExp","head","isPromise","Queue","_items","_limit","_evictListeners","onEvict","enqueue","items","evict","dequeue","size","clear","current","peekTail","peekHead","noopConsoleStub","log","table","safeConsole","document","documentMode","window","console","bound","Function","ie9Console","fallbackConsole","maxLength","max","substr","padString","$1","toLowerCase","functionToString","fnStr","fnToString","namedFunctionMatch","_fn","isRejection","stringifyPattern","_transitionRejection","seen","format","beforeAfterSubstr","char","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","re","joinNeighborsR","Category","uiViewString","uiview","creationContext","normalizedCat","_tid","_rid","transLbl","Trace","_enabled","approximateDigests","_set","categories","parseInt","isNaN","category","enable","disable","traceTransitionStart","TRANSITION","traceTransitionIgnored","traceHookInvocation","step","HOOK","registeredHook","traceHookResult","hookResult","transitionOptions","traceResolvePath","RESOLVE","traceResolvableResolved","traceError","reason","traceSuccess","finalState","traceUIViewEvent","viewData","UIVIEW","traceUIViewConfigUpdated","traceUIViewFill","traceViewSync","pairs","VIEWCONFIG","uivheader","mapping","_a","_b","uiv","sort","localeCompare","traceViewServiceEvent","viewConfigString","traceViewServiceUIViewEvent","UIRouterGlobals","lastStartedTransitionId","transitionHistory","successfulTransitions","transition","lazyLoadHook","entering","lazyLoad","lazyLoadState","originalTransition","orig","targetState","identifier","$url","parts","sync","registerLazyLoadHook","transitionService","lazyLoadFn","states","_state","err","DefType","hasOwn","Param","urlConfig","paramName","noReloadOnSearch","reloadOnSearch","SEARCH","dynamic","defaultConfig","paramConfig","getStaticDefaultValue","isShorthand","$$fn","unwrapShorthand","getParamDeclaration","urlType","paramTypes","CONFIG","PATH","getType","arrayDefaults","arrayParamNomenclature","arrayMode","$asArray","isOptional","raw","squash","defaultPolicy","getSquashPolicy","defaultSquashPolicy","from","to","configuredKeys","getReplace","params_1","changed","values1","values2","validates","isDefaultValue","replaceSpecialValues","_defaultValueCache","defaultValue","getDefaultValue","$normalize","isSearch","encoded","ParamType","$subPattern","sub","mode","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","left","right","paramTypeFn","wrapperFn","$arrayMode","makeDefaultType","ParamTypes","typeQueue","defaultTypes","definitionFn","_flushTypeQueue","valToString","defaultTypeBase","String","query","hash","int","bool","Boolean","date","getFullYear","getMonth","getDate","capture","Date","valueOf","l","json","StateParams","$inherit","newParams","$current","$to","parentParams","parents","inheritList","PathNode","stateOrNode","parameters","applyRawParams","pDef","paramDef","parameter","paramsFn","diff","PathUtils","makeTargetState","registry","buildPath","buildToPath","fromPath","toPath","inheritParams","applyViewConfigs","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","toNode","toParamVals","incomingParamVals","fromParamVals","ownParamVals","reloadState","node1","node2","retained","keep","nonDynamicParams","retainedWithToParams","retainedNode","matching","pathA","pathB","done","nodeA","nodeB","predicate","elementIdx","resolvePolicies","LAZY","EAGER","WAIT","NOWAIT","arg1","policy","resolved","literal","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","asyncPolicy","customAsyncPolicy","getDependencies","resolvedDeps","resolvedValue","fromData","whens","ALL_WHENS","EAGER_WHENS","_path","addResolvables","newResolvables","resolvePath","matchedWhens","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","wait","getResult","injector","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","getNative","native","getAsync","_routerInstance","locationServiceStub","locationConfigStub","_disposed","_disposables","_plugins","disposable","d","ignored","plugin","pluginInstance","getPlugin","pluginName","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","stateDec","newStateDec","parsed","substring","parseUrl","isMatcher","navigable","append","getNavigableBuilder","isRoot","pathBuilder","includesBuilder","resolvablesBuilder","resolveObj","getToken","p","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","item2Resolvable","decl","StateBuilder","matcher","paramFactory","builders","parentName","urlParams","nonUrlParams","builder","build","chain","parentFn","segments","pop","StateMatcher","_states","isRelative","stateName","stateOrName","base","matchGlob","isStr","__stateObjectCache","nameGlob","baseState","splitName","pathLength","relName","StateObject","stateDecl","isStateClass","ref","matchingKeys","isStateDeclaration","isState","StateQueueManager","listeners","queue","flush","registered","orphans","previousQueueLength","getState","notifyListeners","listener","name_1","orphanIdx","existingState","existingFutureState","deregister","attachRoute","prev","abstract","rulesApi","urlRuleFactory","StateRegistry","stateQueue","_registerRoot","_root","onStatesChanged","stateDefinition","_deregisterTree","getChildren","_children","deregistered","removeRule","deregisteredStates","found","property","builderFunction","TargetState","_stateRegistry","_identifier","_params","_options","_definition","relative","exists","valid","withState","withParams","withOptions","newOpts","isDef","HookBuilder","buildHooksForPhase","phase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","reverseDepthSort","baseHookOptions","criteriaMatchPath","traceData","transitionHook","reverseSort","factor","depthDelta","isCreate","hookPhase","reg","getHooks","matchState","criterion","toMatch","globStrings","RegisteredHook","tranSvc","eventType","matchCriteria","removeHookFromRegistry","invokeCount","_deregistered","invokeLimit","_matchingNodes","nodes","_getDefaultMatchCriteria","_getPathTypes","_getMatchingNodes","mn","pathtype","isStateHook","every","makeEvent","hooks","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","TransitionHookPhase","TransitionHookScope","RejectType","Rejection","message","detail","isRejectionPromise","superseded","rejection","SUPERSEDED","redirected","invalid","INVALID","IGNORED","aborted","ABORTED","errored","ERROR","normalize","toPromise","TransitionEventType","hookOrder","getResultHandler","getErrorHandler","synchronous","defaultOptions","TransitionHook","stateContext","isSuperseded","isActive","waitFor","nextHook","invokeHook","invokeHooks","doneCallback","remainingHooks","runAllHooks","logError","defaultErrorHandler","notCurrent","getNotCurrentRejection","handleError","handleResult","handleHookResult","isTargetState","_aborted","HANDLE_RESULT","LOG_REJECTED_RESULT","LOG_ERROR","REJECT_ERROR","THROW_ERROR","addCoreResolvables","addResolvable","TRANSITION_TOKENS","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirect","redirectTo","makeEnterExitRetainHook","hookFn","onExitHook","onRetainHook","onEnterHook","RESOLVE_HOOK_PRIORITY","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","activateViews","exitingViews","vc","deactivateViewConfig","activateViewConfig","updateGlobalState","clearCurrentTransition","updateUrl","urlOptions","ignoredHook","ignoredReason","_ignoredReason","pending","abort","invalidTransitionHook","defaultTransOpts","notify","reload","supercede","custom","TransitionService","_router","_transitionCount","_eventTypes","_criteriaPaths","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onCreate","onStart","onExit","onRetain","onEnter","onFinish","onError","hooksArray","Phase","TH","paths","NORMAL_SORT","SYNCHRONOUS","_defineEvent","CREATE","BEFORE","RUN","SUCCESS","STATE","_definePathType","cmpByPhase","hookScope","fns","addCoreResolves","registerInvalidTransitionHook","registerRedirectToHook","registerOnExitHook","registerOnRetainHook","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","UrlConfig","_isCaseInsensitive","_isStrictMode","_defaultSquashPolicy","hashPrefix","newprefix","host","port","protocol","caseInsensitive","strictMode","__assign","ParamFactory","fromSearch","UrlMatcherFactory","UrlMatcher","globalConfig","strict","decodeParams","object","UrlRouter","urlParts","compareFn","read","urlMatcher","href","absolute","isHtml5","appendBasePath","slash","cfgPort","defineProperty","enumerable","configurable","UrlRuleFactory","makeRule","_what","fromUrlMatcher","fromState","fromRegExp","_handler","details","matchPriority","optional","search","stateOrDecl","transitionTo","sticky","Number","isUrlRule","defaultRuleSortFn","getHandlerFn","cmp","prioritySort","weights","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRules","_sortFn","_rules","_id","_otherwiseFn","handlerFn","_sorted","ensureSorted","sorted","stableSort","group","_group","arrOfWrapper","wrapperA","wrapperB","cmpDiff","wrapper","UrlService","newurl","best","go","applyResult","_stopListeningFn","weight","BaseLocationServices","fireAfterUpdate","_listeners","_listener","_get","_location","_history","BrowserLocationConfig","_isHtml5","_hashPrefix","hostname","getBaseHref","baseTag","getElementsByTagName","extendStatics","__extends","setPrototypeOf","__proto__","__","HashLocationService","_super","title","MemoryLocationConfig","_port","_protocol","_host","newval","MemoryLocationService","_url","PushStateLocationService","_config","_getBasePrefix","basePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","pushState","keyValsToObjectR","accum","getParams","queryString","orEmptyString","beforehash","buildUrl","loc","searchObject","locationPluginFactory","serviceClass","configurationClass","configuration","_uiViews","_viewConfigs","_viewConfigFactories","_registeredUIView","_registeredUIViews","_activeViewConfigs","_onSync","normalizeUIViewTarget","rawViewName","viewAtContext","relativeViewNameSugar","anchorState","anchor","_rootContext","viewType","cfgFactory","cfgs","uiViewsByFqn","viewConfigDepth","depthCompare","depthFn","posNeg","uiViewTuples","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","allTuples","uiViews","available","active","vcSegments","uivSegments","negOffset","fqnToFirstSegment","uiViewContext","ARIA_DISABLE_ATTR","ngAriaModule","info","angularVersion","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeydown","bindRoleForClick","watchExpr","ariaAttr","nativeAriaNodeNames","negate","ariaCamelName","isNodeOneOf","boolVal","newConfig","$$watchExpr","nodeTypeArray","nodeName","$aria","shouldAttachAttr","normalizedAttr","allowNonAriaNodes","shouldAttachRole","role","shape","getShape","post","ngModel","needsTabIndex","ngAriaWatchModelValue","$modelValue","newVal","$viewValue","$isEmpty","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","$observe","$validators","required","$invalid","ngMessages","ngClick","ngKeydown","ngKeypress","ngKeyup","keyCode","which","isContentEditable","$event","readOnly","pristine","resetable","starWidth","starHeight","canelWidth","cancelHeight","rated","reset","beforeRated","beforeReset","isTouch","navigator","msMaxTouchPoints","orgValue","starPartWidth","steps","garbage","getValue","index","getStartParts","getStarOffset","ratio","isSelected","removeRating","rating","setValue","tmpValue","put","IndexController","$mdDialog","localStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","vm","updateStorage","storage","set","toggle","up","cmd","layout","postMessage","$$phase","settings","status","div_color","color","text_color","textColor","text_button_color","textButtonColor","button_color","color_button","background_color","backgroundColor","client_height","documentElement","clientHeight","innerHeight","client_width","clientWidth","style","setProperty","tg","visitorStorage","layoutStorage","visitor","interaction","alignment","online","exceeded","maxInteractions","openedInteractions","isOnline","hideWhenOffline","createElement","appendChild","sheet","insertRule","close","confirm","querySelector","clickOutsideToClose","closingQuestion","ok","show","chatInteraction","customUpdate","closed","closeReason","closedAt","moment","$promise","download","deferred","getMessages","intid","includeAll","_map","rows","row","sender","direction","customerAlias","ContactId","agentIdentifier","UserId","agentAlias","User","alias","fullname","body","createdAt","getHeaderShape","header_shape","CHAT_STATUSES","offline","defaultTitle","header_online","header_offline","addEventListener","routeRun","cursor","hide","_forIn","_isNil","routeConfig","$stateProvider","$urlRouterProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX","Pragma","setPrefix","waitingTemplate","onlineTemplate","offlineTemplate","chatTemplate","unmanagedTemplate","closingTemplate","ClosingController","$mdToast","errors","toast","simple","textContent","formSubmitFailureMessage","toastClass","position","stopLoading","loading","goToIfTime","form","upColor","downColor","userForm","$setPristine","$setUntouched","enableDownload","submit","_merge","ratingType","customer","formSubmitSuccessMessage","finally","skip","apiService","$resource","paramDefaults","baseUrl","remote","chatWebsite","method","getFields","uploadAttachment","transformRequest","downloadAttachment","chatMessage","ChatController","$interval","$document","emojiArea","getMessagesInterval","getInteractionInterval","lastMessageId","scrollToBottomOfChat","getElementsByClassName","scrollTop","scrollHeight","sendMessage","chatMessageError","emojioneArea","setText","getInteraction","disposition","reply","getText","shiftKey","includeAgent","added","_find","messages","emojiOptions","watchEmbedData","fontSmiley","emoji","linkTarget","showMenu","replyMessage","$","placeholder","placeholderMessage","keyup","editor","ready","setFocus","reply_button","fd","FormData","sendAttachment","AttachmentId","_values","OfflineController","$sce","fromKey","initialFields","typeField","optJsonFormData","showLeafArrayIndexes","includeNullValues","onSubmitSuccess","fields","_cloneDeep","trustAsHtml","initUploadButton","formItem","uploadItem","button","label","css","trigger","click","props","maxSizeMB","some","sizeErrMessage","removeFileItem","setupFileInput","multipleUpload","setAttribute","makeFileOptionsVisible","fileOpts","lastOpt","mapKeyOffline","_random","field","helpText","isHTML","checkHTML","cmField","uploadFields","payLoad","isFormDataPayload","isJsonPayload","payload","jsonToFormData","initialFormData","Promise","reject","OnlineController","getAnonymous","disableItem","chatInteractionId","channel","mapKey","variable","referer","customerIp","enableCustomerWriting","UnmanagedController","note","WaitingController","called","open","unload","xhr","XMLHttpRequest","setRequestHeader","send","readyState","removeEventListener","toTrustedFilter","constant","ngEnter","getElementById","div","startTime","sentAt","createTextNode","myWindow","write","innerHTML","focus","print","printElement","elemToPrint","$mdGestureProvider","skipClickHijack","exports","globalThis","isJsonObject","Blob","isGlobalFormDataPresent","getDefaultFormData","convertRecursively","jsonObject","formData","parentKey","propName","FileList","toISOString","mergedOptions","carry","objectToMerge","objectKey","defineLocale","months","monthsShort","weekdays","weekdaysShort","weekdaysMin","meridiemParse","isPM","meridiem","hours","minutes","isLower","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","ss","mm","h","hh","dd","M","MM","y","yy","dayOfMonthOrdinalParse","ordinal","number","week","dow","doy","pluralForm","plurals","pluralize","u","withoutSuffix","isFuture","f","weekdaysParseExact","hour","minute","postformat","symbolMap","preparse","numberMap","suffixes","relativeTimeWithPlural","num","forms","standalone","isFormat","day","period","w","ww","lastDigit","last2Digits","meridiemHour","monthsShortRegex","monthsParseExact","relativeTimeWithMutation","mutationTable","softMutation","mutation","lastNumber","monthsParse","monthsRegex","minWeekdaysParse","weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","translate","ll","lll","llll","output","plural","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","month","_monthsNominativeEl","calendarEl","mom","_calendarEl","monthsShortDot","invalidDate","numbersPast","numbersFuture","verbalNumber","monthsShortWithDots","monthsShortWithoutDots","weekEndings","eras","since","offset","narrow","abbr","until","eraYearOrdinalRegex","eraYearOrdinalParse","now","$0","$2","isUpper","eifelerRegelAppliesToNumber","units","translateSingular","special","relativeTimeWithSingular","translator","words","correctGrammaticalCase","wordKey","relativeTimeMr","monthsNominative","monthsSubjective","separator","days","numbersNouns","numberNoun","hundred","floor","ten","one","word","numberAsNoun","time","hm","processHoursFunction","nominative","accusative","genitive","webpackContext","req","webpackContextResolve","__webpack_require__","code","debug","urlSanitizationWhitelist","aHrefSanitizationWhitelist","stringifyField","decimalSep","isFloat","toLocaleString","quoteStrings","txtDelim","isFinite","header","fieldSep","c","columnOrder","addByteOrderMarker","isSpecialChar","getSpecialChar","filename","charset","csv","buildCSV","getFilename","addClass","ngCsvLoadingClass","csvHeader","csvColumnOrder","csvLabel","removeClass","msSaveOrOpenBlob","msSaveBlob","URL","createObjectURL"],"sourceRoot":""} \ No newline at end of file